Commit 79239a48f19 for nodejs

commit 79239a48f1999c7ffa6b0a37ffb823485587d0b0
Author: Node.js GitHub Bot <github-bot@iojs.org>
Date:   Fri Oct 23 23:48:13 2026 +0000

    deps: upgrade openssl sources to openssl-4.1.0

    PR-URL: https://github.com/nodejs/node/pull/66971
    Reviewed-By: Filip Skokan <panva.ip@gmail.com>
    Reviewed-By: Richard Lau <richard.lau@ibm.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

diff --git a/deps/openssl/openssl/engines/e_dasync.txt b/deps/openssl/openssl/.ctags.d/langmap.ctags
similarity index 67%
rename from deps/openssl/openssl/engines/e_dasync.txt
rename to deps/openssl/openssl/.ctags.d/langmap.ctags
index d050a148c30..ef431ba2e49 100644
--- a/deps/openssl/openssl/engines/e_dasync.txt
+++ b/deps/openssl/openssl/.ctags.d/langmap.ctags
@@ -1,9 +1,11 @@
-# Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
 # in the file LICENSE in the source distribution or at
 # https://www.openssl.org/source/license.html
+#

-#Reason codes
-DASYNC_R_INIT_FAILED:100:init failed
+--langmap=C:+.h
+--langmap=C:+.inc
diff --git a/deps/openssl/openssl/CHANGES.md b/deps/openssl/openssl/CHANGES.md
index 64385e4fc22..5e17f0ac670 100644
--- a/deps/openssl/openssl/CHANGES.md
+++ b/deps/openssl/openssl/CHANGES.md
@@ -12,6 +12,9 @@ appropriate release branch.
 OpenSSL Releases
 ----------------

+ - [OpenSSL 4.1](#openssl-41)
+ - [OpenSSL 4.0](#openssl-40)
+ - [OpenSSL 3.6](#openssl-36)
  - [OpenSSL 3.5](#openssl-35)
  - [OpenSSL 3.4](#openssl-34)
  - [OpenSSL 3.3](#openssl-33)
@@ -25,10 +28,595 @@ OpenSSL Releases
  - [OpenSSL 1.0.0](#openssl-100)
  - [OpenSSL 0.9.x](#openssl-09x)

-OpenSSL 3.5
+OpenSSL 4.1
+-----------
+
+### Changes between 4.0 and 4.1.0 [23 Oct 2026]
+
+ * Changed the OpenSSL FIPS provider so that every algorithm advertised with
+   `fips=yes` explicitly exposes the `fips-indicator` as a gettable context
+   parameter and returns 1 for an approved operation. The absence of an
+   indicator is no longer interpreted as approval. Algorithms advertised
+   with `fips=no`, including X448MLKEM1024, remain unapproved and return 0 when
+   they expose the indicator.
+
+   *Shane Lontis and Paul Dale*
+
+ * Changed TLS 1.3 clients to offer a PSK, and to attempt 0-RTT early data,
+   only when it can actually be used. A resumption ticket or external PSK is
+   offered only if some offered ciphersuite shares its handshake digest, and
+   0-RTT is attempted only if the first offered PSK's exact ciphersuite and,
+   where recorded, its ALPN protocol are offered and, for a ticket, it has not
+   aged out. When 0-RTT is not viable the client keeps the PSK for a 1-RTT
+   handshake. In particular a client-detected ALPN inconsistency now suppresses
+   0-RTT rather than failing with `SSL_R_INCONSISTENT_EARLY_DATA_ALPN`.
+
+   Fixed TLS 1.3 clients to reject a `psk_use_session` callback PSK whose master
+   key is empty, with `SSL_R_BAD_PSK`, instead of failing later in binder
+   computation.
+
+   *Viktor Dukhovni*
+
+ * Added support for DTLS 1.3 ([RFC 9147]).
+   Refer to the `ossl-guide-dtlsv13(7)` manual page for details.
+
+   *Frederik Wedel-Heinen and Ryan Hooper*
+
+ * Added support for [RFC 8701] GREASE (Generate Random Extensions And Sustain
+   Extensibility).  When `SSL_OP_GREASE` is set, the TLS client injects
+   reserved GREASE values into cipher suites, supported versions, supported
+   groups, signature algorithms, key share, and extensions in the `ClientHello`
+   to prevent ecosystem ossification.
+   Added `-grease` option to `openssl s_client` to enable this.
+   <!-- https://github.com/openssl/openssl/pull/30303 -->
+
+   *William McCormack*
+
+ * Added support for Ed25519 and Ed448 certificates in DTLS 1.2.  Previously,
+   these certificate types were only supported in TLS 1.2 and TLS 1.3.
+   <!-- https://github.com/openssl/openssl/pull/30007 -->
+
+   *Adriano Sela Aviles*
+
+ * Added DTLS support to the SSL listener API.  `SSL_new_listener()` can now
+   create a DTLS listener that demultiplexes incoming datagrams into per-peer
+   connections accepted with `SSL_accept_connection()`.  The listener performs
+   address validation (`HelloVerifyRequest` for DTLS 1.0/1.2,
+   `HelloRetryRequest` cookie for DTLS 1.3) by default;  pass
+   `SSL_LISTENER_FLAG_NO_VALIDATE` to disable it.  Refer
+   to the `SSL_new_listener(3)` manual page for details.
+
+   *Ryan Hooper*
+
+ * Added configurable values for DTLS listeners, accessed
+   via `SSL_get_value_uint()`/`SSL_set_value_uint()`:
+   `SSL_VALUE_DTLS_LISTENER_MAX_PENDING_CONNS`,
+   `SSL_VALUE_DTLS_LISTENER_PENDING_TIMEOUT`,
+   and `SSL_VALUE_DTLS_LISTENER_MAX_DGRAM_SIZE`. Refer
+   to the `SSL_get_value_uint(3)` manual page for details.
+
+   *Ryan Hooper*
+
+ * Implemented an ability to configure additional QUIC transport parameters
+   via the `SSL_get_value_uint()`/`SSL_set_value_uint()` functions:
+   `max_udp_payload_size`, `initial_max_data`,
+   `initial_max_stream_data_bidi_local`, `initial_max_stream_data_uni`,
+   `ack_delay_exponent`, and `max_ack_delay`.
+   <!-- https://github.com/openssl/openssl/pull/29664 -->
+
+   *Nikolas Gauder*
+
+ * Simplified EC key point format handling.
+
+   The point conversion form (compressed, uncompressed, or hybrid)
+   is now a single value on the `EC_GROUP` and round-trips
+   unchanged through import and export of `EC_KEY` objects.
+
+   Freshly generated keys have their public point encoded
+   in uncompressed form.  A `point-format` supplied at key generation
+   time via `OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT`
+   is validated (an invalid value is rejected) but otherwise ignored
+   on the generated key.  EC parameter generation continues
+   to honour the requested form on the group's generator;  imported
+   keys keep their form.
+
+   The `ec_point_formats` extension no longer affects TLS 1.2
+   X.509 certificate selection or acceptance.  OpenSSL now
+   accepts an EC certificate in any point form it can decode,
+   and sends any EC certificate it has regardless of point form.
+   TLS 1.3 disregards the extension entirely.
+
+   The [RFC 4492][RFC 4492 Section 5.1.2]/[8422 section 5.1.2][RFC 8422 Section 5.1.2]
+   requirement that the peer's point-format list contain "uncompressed" is now
+   enforced on both sides (previously client-only), and only when an ECC TLS 1.2
+   ciphersuite is negotiated—a missing "uncompressed" is ignored under TLS 1.3
+   or with a non-ECC cipher.
+   <!-- https://github.com/openssl/openssl/pull/30940 -->
+
+   *Viktor Dukhovni*
+
+ * Added a new verification error, `X509_V_ERR_DUPLICATE_EXTENSION`,
+   with a descriptive message for certificates containing duplicate X.509
+   extensions, which are explicitly prohibited by [RFC 5280].
+   <!-- https://github.com/openssl/openssl/pull/30233 -->
+
+   *Daniel Kubec*
+
+ * Implemented extended support of metadata for symmetric key objects
+   (`EVP_SKEY`).
+   <!-- https://github.com/openssl/openssl/pull/32644 -->
+
+   *Dmitry Belyavskiy*
+
+ * Added `CMS_VERIFY_PARTIAL` flag to `CMS_verify()`, `-verify_partial`
+   option to `openssl cms -verify` operation,
+   and `CMS_SignerInfo_get_verification_result()`
+   and `CMS_SignerInfo_get0_signer_cert()` functions.
+
+   If the `CMS_VERIFY_PARTIAL` flag is set, the `CMS_verify()` call
+   is successful if at least one of the individual signatures can be verified
+   (as opposed to all of them), which may be useful to gracefully handle various
+   situations, like missing CAs, expired certificates, or unsupported
+   algorithms;  applications can call `CMS_get0_signers()` to check if the set
+   of valid signatures satisfies its policy, or use
+   `CMS_SignerInfo_get_verification_result()`
+   and `CMS_SignerInfo_get0_signer_cert()` functions to access the detailed
+   verification results.
+   <!-- https://github.com/openssl/openssl/pull/27604 -->
+
+   *Jan Lübbe*
+
+ * Added `OSSL_CMP_OPT_NONMATCHED_ERROR_NONCES` option for `OSSL_CMP_CTX`
+   and a corresponding `-nonmatched_error_nonces` option for the `openssl cmp`
+   command.
+
+   This work was sponsored by Siemens AG.
+   <!-- https://github.com/openssl/openssl/pull/29043 -->
+
+   *David von Oheimb*
+
+ * Changed the output of the `-disabled` option for the `openssl list` command
+   to display disabled features, protocols, and algorithms, in relevant
+   sections.
+   <!-- https://github.com/openssl/openssl/pull/30212 -->
+
+   *Paul Louvel*
+
+ * Added `-n` option for the `openssl rand` command to suppress the trailing
+   newline in hexadecimal output mode.
+   <!-- https://github.com/openssl/openssl/pull/31795 -->
+
+   *Evy Garden*
+
+ * Added `-testmode` option for the `openssl s_time` command.
+   <!-- https://github.com/openssl/openssl/pull/31192 -->
+
+   *Jakub Zelenka*
+
+ * Added ability to utilise memory-mapped I/O when reading raw input
+   from a file for one-shot sign/verify operations (such as Ed25519,
+   Ed448, and ML-DSA) to `openssl pkeyutl` command on platforms
+   that support it (Unix-like).  The `openssl dgst` command uses the same
+   approach for one-shot sign/verify when the input is from a file, removing
+   the previous 16 MB limit for file-based input.  This improves performance
+   and supports large files without doubling memory use.  Other platforms
+   and `stdin` input continue to use the existing buffer-based implementation.
+   <!-- https://github.com/openssl/openssl/pull/30429 -->
+
+   *John Claus, Viktor Dukhovni, and David von Oheimb*
+
+ * Added a `seed_strict` option to the `random` configuration section,
+   which makes the configured random seed source strictly enforced when
+   a provider (such as the FIPS provider) requests entropy or a nonce.
+
+   When a provider requests seeding material before the primary DRBG
+   has been created, the request falls back to the operating system entropy
+   sources, because the seed source only comes into existence as a side
+   effect of creating the primary DRBG.  Whether a configured seed source
+   is used therefore depends on operation order.  With `seed_strict` enabled,
+   the seed source is instead instantiated on demand and an error is reported
+   if it cannot be used.  The option is off by default with two exceptions:
+   the `JITTER` seed source seeds strictly unless the option disables it,
+   and `enable-fips-jitter` builds always seed strictly.  Additionally,
+   the property query used to fetch the default seed source can now be set
+   at build time with `-DOPENSSL_DEFAULT_SEED_PROPQ`.
+   <!-- https://github.com/openssl/openssl/pull/31939 -->
+
+   *Jakub Zelenka*
+
+ * Added IKEV2 KDF (`EVP_KDF-IKEV2KDF`) to `EVP_KDF`.
+   <!-- https://github.com/openssl/openssl/pull/30121 -->
+
+   *Helen Zhang*
+
+ * Added `CRYPTO_atomic_load_ptr`, `CRYPTO_atomic_store_ptr`,
+   and `CRYPTO_atomic_cmp_exch_ptr` functions to `libcrypto`, that implement
+   the respective atomic operations with a locking-based fallback on platforms
+   that do not support them.
+   <!-- https://github.com/openssl/openssl/pull/30670 -->
+
+   *Neil Horman*
+
+ * Added `EVP_EC_affine2oct()` function, that converts the affine coordinates
+   of an EC point to an octet string conforming
+   to [Section 2.3.4 of SECG SEC 1][SECG SEC 1 Section 2.3.4] ("Elliptic Curve
+   Cryptography") standard.
+   <!-- https://github.com/openssl/openssl/pull/30597 -->
+
+   *Igor Ustinov*
+
+ * Added `EVP_KDF_CTX_get0_kdf()` and `EVP_KDF_CTX_get1_kdf()` functions
+   as a replacement for the now deprecated `EVP_KDF_CTX_kdf()`.
+   <!-- https://github.com/openssl/openssl/pull/28954 -->
+
+   *Leon Timmermans*
+
+ * Added `ASN1_STRING_new_not_owned()` function to `libcrypto`.  It provides
+   the ability to construct an `ASN1_STRING` with data for which ownership
+   is not taken by the created `ASN1_STRING` object.
+   <!-- https://github.com/openssl/openssl/pull/30964 -->
+
+   *Bob Beck*
+
+ * Added `ASN1_STRING_set1_data()`, `ASN1_STRING_set1_string()`,
+   and `ASN1_STRING_get_length()` API functions, and deprecated
+   `ASN1_STRING_set()` and `ASN1_STRING_length()`.
+
+   The new setter functions do not append a terminating NUL byte to the newly
+   allocated strings, contrary to historic `ASN1_STRING_set()`'s behaviour,
+   so `ASN1_STRING_get0_data()` may return data not followed
+   by an out-of-`ASN1_STRING_get_length()` bounds NUL byte (whose presence
+   has never been guaranteed there by API contract) in more cases
+   than it used to before.  A future release will switch to the usage
+   of the new APIs internally.
+
+   When OpenSSL is built with `AddressSanitizer` or `MemorySanitizer` support,
+   or is run under Valgrind having been built where the Valgrind headers
+   are installed, the added NUL byte is marked inaccessible, so treating
+   the result of `ASN1_STRING_get0_data()` as a C string (`strlen()`, `%s`,
+   `strdup()` and the like) is reported as an error.  All such uses
+   must be changed to honour `ASN1_STRING_get_length()`. The Valgrind
+   check may be disabled by building with `-DOPENSSL_NO_VALGRIND_CHECK`.
+   <!-- https://github.com/openssl/openssl/pull/31194 -->
+   <!-- https://github.com/openssl/openssl/pull/32829 -->
+   <!-- https://github.com/openssl/openssl/pull/32837 -->
+
+   *Bob Beck*
+
+ * Added `CMS_add_standard_smimecap_ex()` API function, which populates
+   an `SMIMECapabilities` list using `EVP_CIPHER_fetch()` and `EVP_MD_fetch()`
+   so that only algorithms available in the active providers are advertised.
+   `PKCS7_sign_add_signer()` was updated in the same way, so that legacy
+   ciphers, such as RC2 and DES, are no longer included in `SMIMECapabilities`
+   by default when only the default provider is loaded.
+   <!-- https://github.com/openssl/openssl/pull/31990 -->
+
+   *Todd Short*
+
+ * Added `CTLOG_STORE_add0_log()` function to add individual CT logs
+   to a `CTLOG_STORE`.
+   <!-- https://github.com/openssl/openssl/pull/30427 -->
+
+   *Tim Perry*
+
+ * Added `FIPS_mode()` macro as a convenience alias
+   to `EVP_default_properties_is_fips_enabled(NULL)`, which is a shorthand
+   to check whether the `fips=yes` property is currently enabled in the default
+   library context.
+   <!-- https://github.com/openssl/openssl/pull/30339 -->
+
+   *Dimitri John Ledkov*
+
+ * Refactored remaining cipher `OSSL_PARAM` name parsing so that automatically
+   generated parsers are used instead of `OSSL_PARAM_locate()` calls.
+   This should ensure that the list of acceptable parameters better matches
+   those which are actually processed.  It should also provide a small
+   performance improvement, because repeated iteration over passed parameter
+   arrays is avoided.
+   <!-- https://github.com/openssl/openssl/pull/32536 -->
+
+   *Dr Paul Dale*
+
+ * Improved interoperability with TPM 1.2 Endorsement Key certificates
+   per [TCG Credential Profiles specification Version 1.2, Section 3.2.7]:
+   `SubjectPublicKeyInfo` blobs whose `AlgorithmIdentifier` uses
+   `id-RSAES-OAEP` (`NID_rsaesOaep`, 1.2.840.113549.1.1.7) with a plain
+   `RSAPublicKey` body are now decoded as RSA keys.  The OAEP
+   `AlgorithmIdentifier` parameters are not interpreted.
+   <!-- https://github.com/openssl/openssl/pull/30961 -->
+
+   *Craig Lorentzen*
+
+ * Do not issue TLS 1.3 session tickets if the server has explicitly disabled
+   them via `SSL_OP_NO_TICKET` and also turned off the session cache with
+   `SSL_SESS_CACHE_OFF`. Both conditions together indicate a clear intent to
+   suppress resumption, so sending `NewSessionTicket` messages would be wasteful
+   and misleading. TLS 1.3 client that does not send the `psk_key_exchange_modes`
+   extension, or that sends it together with [RFC 9149] parameters such as
+   `new_session_count = 0` or `resumption_count = 0`, is effectively signaling
+   no interest in session tickets and session resumption.
+   <!-- https://github.com/openssl/openssl/pull/30639 -->
+
+   *Daniel Kubec*
+
+ * Improved DTLS handshake robustness under UDP reordering by buffering
+   and replaying early `ChangeCipherSpec` (CCS) records at the expected state.
+   <!-- https://github.com/openssl/openssl/pull/30225 -->
+
+   *Tong Li*
+
+ * Updated X.509 certificate verification to no longer consult the subject
+   distinguished name (DN) by default.  Previously, when a certificate contained
+   no subject alternative name of the type being checked, the subject
+   `commonName` (for host name checks) or `emailAddress` (for email checks)
+   was matched instead.  The subject DN is now checked only when
+   the `X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT` flag is set.  Correspondingly,
+   during chain verification, DNS name constraints are applied to the subject
+   `commonName` of the leaf certificate only when that flag is set, rather than
+   whenever the leaf had no DNS subject alternative name.
+   <!-- https://github.com/openssl/openssl/pull/31982 -->
+
+   *Bob Beck*
+
+ * Added various optimizations for the Elbrus2000 architecture
+   in the cryptographic and BN code.
+   <!-- https://github.com/openssl/openssl/pull/31269 -->
+
+   *Gleb Popov*
+
+ * Declared support for AArch64 Guarded Control Stack (GCS) in assembly code.
+
+   When building with compilers that support GCS (Clang 18+, GCC 15+),
+   assembly modules are marked as compatible when branch protection
+   is enabled (e.g. `-mbranch-protection=standard`).  No functional changes
+   to the assembly implementations are required, but compliance ensures
+   correct operation with shadow stack enforcement.
+   <!-- https://github.com/openssl/openssl/pull/31162 -->
+
+   *Guillaume Gardet and Gowtham Suresh Kumar*
+
+ * Added optimized ML-DSA and ML-KEM NTT operations on `ppc64le`.
+   <!-- https://github.com/openssl/openssl/pull/29611 -->
+   <!-- https://github.com/openssl/openssl/pull/30709 -->
+
+   *Danny Tsen*
+
+ * Added AVX2-optimized ML-DSA NTT operations on `x86_64`.
+   <!-- https://github.com/openssl/openssl/pull/30160 -->
+
+   *Marcel Cornu and Tomasz Kantecki*
+
+ * Added AVX-512-optimized SHAKE x4 operations for ML-DSA on `x86_64`.
+   <!-- https://github.com/openssl/openssl/pull/31090 -->
+
+   *Marcel Cornu and Tomasz Kantecki*
+
+ * Added AVX-512 and VAES optimizations for AES-CBC decryption.  Decryption
+   performance for large inputs (1024 bytes or more) improved by 3.5x to 3.8x.
+   <!-- https://github.com/openssl/openssl/pull/30902 -->
+
+   *Madan Mohan Manokar*
+
+ * Added `VC-WIN32-MSVC2013` and `VC-WIN64A-MSVC2013` build targets to provide
+   internal functions for bridging the gaps in C99 standard support
+   that are present in MSVC 2013.
+   <!-- https://github.com/openssl/openssl/pull/31640 -->
+   <!-- https://github.com/openssl/openssl/pull/31988 -->
+
+   *Bob Beck*
+
+ * Added support for the (BSD-specific) `mdoc` format for the manual pages
+   output, which can be selected via `--manpage-format=mdoc` configuration
+   option.  It requires presence of `pod2mdoc` utility in order for it to work.
+   <!-- https://github.com/openssl/openssl/pull/28450 -->
+
+   *Enji Cooper*
+
+ * Added unit tests setup activated via `enable-unit-tests` option.  This works
+   only on platforms with ld `--wrap` support (Linux, BSD).
+   <!-- https://github.com/openssl/openssl/pull/30788 -->
+
+   *Jakub Zelenka*
+
+ * Added test framework for testing function memory allocation failures.
+   <!-- https://github.com/openssl/openssl/pull/30871 -->
+
+   *Jakub Zelenka*
+
+ * Updated header files to reflect modern development practices: all include
+   files now have header guards and they are self-contained (they include all
+   dependencies they need to be included on their own).
+   <!-- https://github.com/openssl/openssl/pull/31001 -->
+
+   *Bob Beck*
+
+ * Fixed a bug where a TLS 1.3 session ticket could retain a stale ALPN
+   protocol from an earlier connection after a resumption negotiated
+   a different protocol (or none), on both the server and the client,
+   which could otherwise affect a later 0-RTT decision.
+   <!-- https://github.com/openssl/openssl/pull/32401 -->
+
+   *Daniel Kubec and Viktor Dukhovni*
+
+ * Fixed `SSL_listen_ex()` to correctly adopt a QUIC connection and to preserve
+   queued connections on allocation failure. Invalid arguments, including
+   non-QUIC SSL objects, and internal failures now return `-1`, reserving `0`
+   for "no connection available".
+   <!-- https://github.com/openssl/openssl/pull/32491 -->
+
+   *Mounir IDRASSI*
+
+ * Fixed QUIC child objects to inherit the effective flags of their explicit
+   event domain.  `SSL_get0_domain()` now reports that domain for connections
+   and streams in the hierarchy.
+   <!-- https://github.com/openssl/openssl/pull/32491 -->
+
+   *Mounir IDRASSI*
+
+ * Fixed TLS 1.3 clients to encrypt 0-RTT early data with the first offered
+   PSK identity ([RFC 9846 Section 4.3.10]) when a 0-RTT-capable resumption
+   ticket has aged out and an external PSK is offered in its place. The early
+   data was being encrypted with the retired ticket's secret, rather than
+   the external PSK's, causing the server to reject it with a bad record MAC.
+   <!-- https://github.com/openssl/openssl/pull/32202 -->
+
+   *Viktor Dukhovni*
+
+ * Fixed TLS 1.3 servers to reject early data when a resumed PSK's
+   ticket age is outside tolerance, per [RFC 9846], instead of accepting
+   0-RTT data from a ticket that has aged out.
+   <!-- https://github.com/openssl/openssl/pull/32202 -->
+
+   *Daniel Kubec*
+
+ * Fixed TLS 1.3 external PSK connections being wrongly rejected when
+   the client sets a non-empty session ID context.
+   <!-- https://github.com/openssl/openssl/pull/31964 -->
+
+   *Viktor Dukhovni*
+
+ * Fixed a TLS 1.3 server with no session ID context to accept external PSK
+   connections and to stop issuing unusable session tickets.
+   <!-- https://github.com/openssl/openssl/pull/31964 -->
+
+   *Viktor Dukhovni*
+
+ * Fixed TLS 1.3 servers to reject early data when the selected ciphersuite
+   differs from the ciphersuite associated with the selected PSK. Same-hash
+   PSK resumption can still continue without accepting 0-RTT data.
+   <!-- https://github.com/openssl/openssl/pull/32032 -->
+
+   *Mounir IDRASSI*
+
+ * Fixed X.509v3 extension configuration parsing to reject repeated fields
+   in the `basicConstraints`, `basicAttConstraints`, and `policyConstraints`
+   X.509v3 extension configurations, instead of silently using the last value.
+   <!-- https://github.com/openssl/openssl/pull/32181 -->
+
+   *Adam Tabak*
+
+ * Fixed X.509 verification of certificate chains that use DSA signatures
+   with SHA-384 or SHA-512 by registering `dsa_with_SHA384` and
+   `dsa_with_SHA512` in the signature-algorithm cross-reference table.
+   <!-- https://github.com/openssl/openssl/pull/30655 -->
+
+   *John Claus*
+
+ * Fixed `CMS_SignerInfo_verify()` to no longer accept signature algorithm
+   identifiers as valid `digestAlgorithms`, in violation of [RFC 5652].
+   <!-- https://github.com/openssl/openssl/pull/32702 -->
+
+   *Jakub Zelenka*
+
+ * Fixed reading of binary data (for example, certificates in DER format)
+   by `openssl` command from `stdin` on Windows.
+   <!-- https://github.com/openssl/openssl/pull/30559 -->
+
+   *Milan Brož*
+
+ * Fixed CRL scope checking for certificates without a CRL distribution
+   points extension.  A CRL having an issuing distribution point extension
+   including a name that matches the certificate issuer name or any
+   `issuerAltName` of the certificate is now accepted, as required
+   by the default distribution point rule at the end
+   of [RFC 5280 Section 6.3.3], instead of being rejected
+   with `X509_V_ERR_DIFFERENT_CRL_SCOPE`.
+
+   *Paul Grubbs*
+
+ * TLS clients no longer send the TLS padding extension ([RFC 7685]).  It was
+   only ever sent when `SSL_OP_TLSEXT_PADDING` was set, to work around
+   a `ClientHello` length bug in F5 middleboxes;  the fix shipped long ago
+   and the affected hardware is long out of support, so nothing should still
+   be running the problematic version.
+   `SSL_OP_TLSEXT_PADDING` is now a no-op retained for compatibility,
+   and is no longer included in `SSL_OP_ALL`.
+   <!-- https://github.com/openssl/openssl/pull/32389 -->
+
+   *Bob Beck*
+
+ * Changed `tsget` utility to use `Net::Curl::Easy` (from the `Net-Curl` CPAN
+   distribution) instead of the abandoned `WWW::Curl::Easy`.  Users who rely
+   on `tsget` should install `Net::Curl::Easy` before upgrading.
+   <!-- https://github.com/openssl/openssl/pull/31445 -->
+
+   *Shreenidhi Shedi*
+
+ * Deprecated the `enable-unit-test` configure option and the
+   `SSL_test_functions()` function.  Both will be removed in OpenSSL 5.0.
+   <!-- https://github.com/openssl/openssl/pull/30788 -->
+
+   *Jakub Zelenka*
+
+ * Deprecated `BIO_snprintf()` and `BIO_vsnprintf()`.  `snprintf()`, being part
+   of C99 standard, that is the baseline for OpenSSL since version 3.6,
+   is now considered universally available;  moreover, the fact that `BIO_*()`
+   functions return -1 on truncation, rather than the would-have-been length,
+   makes their usage error-prone.  Use `snprintf()` and `vsnprintf()` directly.
+   <!-- https://github.com/openssl/openssl/pull/31640 -->
+
+   *Bob Beck*
+
+ * Deprecated undocumented public functions `UTF8_putc()` and `UTF8_getc()`.
+   No public replacement is planned.
+   <!-- https://github.com/openssl/openssl/pull/30967 -->
+
+   *Bob Beck*
+
+ * Deprecated `EVP_CIPHER_CTX_get_num()` and `EVP_CIPHER_CTX_set_num()`
+   functions.  Refer to `ossl-migration-guide(7)` for more info.
+   <!-- https://github.com/openssl/openssl/pull/30335 -->
+
+   *Shane Lontis*
+
+ * Deprecated `ASN1_BIT_STRING_name_print()`, `ASN1_BIT_STRING_num_asc()`,
+   and `ASN1_BIT_STRING_set_asc()` functions. Refer to the manual
+   pages for more information.
+   <!-- https://github.com/openssl/openssl/pull/30853 -->
+
+   *Bob Beck*
+
+ * Deprecated `ASN1_BIT_STRING_set()` function in favour
+   of `ASN1_BIT_STRING_set1()`.
+   <!-- https://github.com/openssl/openssl/pull/30692 -->
+
+   *Norbert Pócs*
+
+ * Deprecated `CMS_stream()` and `PKCS7_stream()` API functions.  These
+   are internal plumbing that was unintentionally exposed as the public API,
+   and they no longer return a streaming boundary.  Use `BIO_new_CMS()`
+   or `BIO_new_PKCS7()` to stream CMS and PKCS#7 content.
+   <!-- https://github.com/openssl/openssl/pull/32242 -->
+
+   *Bob Beck*
+
+ * Deprecated `X509_check_host()`, `X509_check_email()`, `X509_check_ip()`,
+   and `X509_check_ip_asc()` functions.  Applications should migrate to setting
+   a reference identifier to check using `X509_VERIFY_PARAM_set1_host()`,
+   `X509_VERIFY_PARAM_set1_email()`, or `X509_VERIFY_PARAM_set1_ip_asc()`,
+   and using `X509_verify_cert()`.
+   <!-- https://github.com/openssl/openssl/pull/30403 -->
+
+   *Bob Beck*
+
+ * Dropped Windows-on-Itanium (`VC-WIN64I`) and Windows CE (`VC-CE`) targets
+   from Configurations.
+   <!-- https://github.com/openssl/openssl/pull/31601 -->
+   <!-- https://github.com/openssl/openssl/pull/31913 -->
+
+   *Bob Beck*
+
+ * Dropped `no-ecdsa` and `no-ecdh` options from `Configure`, as these options
+   did not really disable the implementations.  Use `no-ec` to disable
+   the elliptic curve support.
+   <!-- https://github.com/openssl/openssl/pull/30446 -->
+
+   *Tomáš Mráz*
+
+OpenSSL 4.0
 -----------

-### Changes between 3.5.8 and 3.5.9 [29 Sep 2026]
+### Changes between 4.0.2 and 4.0.3 [29 Sep 2026]

  * Fixed DTLS retransmissions of handshake messages from a stale buffer offset.

@@ -50,6 +638,27 @@ OpenSSL 3.5

    *Ryan Hooper*

+ * Fixed a use-after-free in X.509 extension cache under concurrent use.
+
+   Severity: Moderate
+
+   Issue summary: The first concurrent use of the same X.509 certificate
+   by several threads may cause its cached extension data to be freed
+   while another thread is still using it.
+
+   Impact summary: A remote, unauthenticated peer could crash a multi-threaded
+   TLS client, or a multi-threaded TLS server that requests client certificates,
+   if the first certificate chains built to the same trusted CA certificate
+   are built by several connections at the same time.  This is a use-after-free
+   read, which is likely to crash the process, resulting in a Denial of Service.
+
+   Reported by: Tim Becker (Xint.io) and Aydın Mercan.
+
+   ([CVE-2026-84783])
+   <!-- https://github.com/openssl/openssl/pull/32614 -->
+
+   *Bob Beck*
+
  * Fixed excessive memory allocation in relative CRLDP processing.

    Severity: Low
@@ -72,7 +681,7 @@ OpenSSL 3.5

    Severity: Low

-   Issue summary: The OpenSSL QUIC server, when configured to not preform
+   Issue summary: The OpenSSL QUIC server, when configured to not perform
    address validation, can be forced to count incoming packets multiple times
    in its unvalidated credit computation, leading to a violation
    of the [RFC 9000] unvalidated connection amplification limit of 3 times
@@ -106,11 +715,12 @@ OpenSSL 3.5
    with OpenAI

    ([CVE-2026-42772])
-   <!-- https://github.com/openssl/openssl/pull/32769 -->
+   <!-- https://github.com/openssl/openssl/pull/32771 -->

    *Alexandr Nedvědický*

- * Fixed a timing side-channel in scalar multiplication for mon-NIST EC curves.
+ * Fixed a timing side-channel leak in generic elliptic curve scalar
+   multiplication.

    Severity: Low

@@ -147,7 +757,7 @@ OpenSSL 3.5
    Reported by: Zhen Yan (AntAISecurityLab) and Bhabani Sankar Das.

    ([CVE-2026-54873])
-   <!-- https://github.com/openssl/openssl/pull/32769 -->
+   <!-- https://github.com/openssl/openssl/pull/32771 -->

    *Alexandr Nedvědický*

@@ -203,7 +813,7 @@ OpenSSL 3.5
    flow control for streams to make the QUIC stack receive ~100 MiB of memory
    instead of 768 KiB (default flow control window size).

-   Reportedby: Moltenbit, Bhabani Sankar Das, Saiyowa Security Team, mzfr.
+   Reported by: Moltenbit, Bhabani Sankar Das, Saiyowa Security Team, mzfr.

    ([CVE-2026-75804])

@@ -288,12 +898,19 @@ OpenSSL 3.5
    *Alexandr Nedvědický*

  * Fixed a bug where `EVP_DecryptFinal()` incorrectly reported a stale success
-   on AES-SIV authentication failure after a preciously successful message
+   on AES-SIV authentication failure after a previously successful message
    decryption.
    <!-- https://github.com/openssl/openssl/pull/31610 -->

    *Abel Thomas*

+ * Fixed a regression in base64 encoding BIO filter introduced in OpenSSL 4.0,
+   where incomplete writes down the BIO chain may result in the loss of encoded
+   base64 data.
+   <!-- https://github.com/openssl/openssl/pull/31000 -->
+
+   *Mounir IDRASSI*
+
  * Fixed a bug in `OSSL_HTTP_get()` that allowed to perform HTTPS-to-HTTP
    downgrade through a relative redirect.
    <!-- https://github.com/openssl/openssl/pull/32694 -->
@@ -306,9 +923,9 @@ OpenSSL 3.5
    of an indicator is no longer interpreted as approval.  Algorithms advertised
    with `fips=no` property, including X448MLKEM1024, remain unapproved
    and return 0 when they expose the indicator.
-   <!-- https://github.com/openssl/openssl/pull/32913 -->
+   <!-- https://github.com/openssl/openssl/pull/32941 -->

-   *Shane Lontis*
+   *Shane Lontis and Paul Dale*

  * Changed the compiler flags supplied to MSVC targets to no longer include
    `/Gs0` (resetting the minimum memory size occupied by local variables
@@ -318,7 +935,7 @@ OpenSSL 3.5

    *Norbert Pócs*

-### Changes between 3.5.7 and 3.5.8 [25 Aug 2026]
+### Changes between 4.0.1 and 4.0.2 [25 Aug 2026]

  * Fixed QUIC server being able to trigger double free when processing `INITIAL`
    packet.
@@ -442,6 +1059,26 @@ OpenSSL 3.5

    *Matt Caswell*

+ * Fixed client-side memory leak in OCSP response checking.
+
+   Severity: Low
+
+   Issue summary: A malicious TLS server can cause a memory leak in a TLS
+   client that has enabled OCSP response checking by sending an OCSP response
+   that contains no single response entries.
+
+   Impact summary: An attacker can leak an attacker-tunable amount of memory
+   per TLS handshake in a victim client application. A long-running client
+   that repeatedly connects to a malicious server can have its memory
+   exhausted, resulting in a Denial of Service.
+
+   Reported by: Bhabani Sankar Das and Zhenzhe Shao.
+
+   ([CVE-2026-54876])
+   <!-- https://github.com/openssl/openssl/pull/31764 -->
+
+   *Mounir IDRASSI*
+
  * Fixed untrusted Sender DN being used as a format string in CMP response
    validation.

@@ -520,7 +1157,7 @@ OpenSSL 3.5
    Reported by: Billy Brumley (Rochester Institute of Technology).

    ([CVE-2026-75803])
-   <!-- https://github.com/openssl/openssl/pull/32416 -->
+   <!-- https://github.com/openssl/openssl/pull/32300 -->

    *Billy Bob Brumley*

@@ -549,7 +1186,7 @@ OpenSSL 3.5

    *Mounir IDRASSI*

-### Changes between 3.5.6 and 3.5.7 [9 Jun 2026]
+### Changes between 4.0.0 and 4.0.1 [9 Jun 2026]

  * Fixed heap use-after-free in `PKCS7_verify()`.

@@ -604,6 +1241,26 @@ OpenSSL 3.5

    *Abhinav Agarwal and Alexandr Nedvedicky*

+ * Fixed double-free when checking OCSP stapled response.
+
+   Severity: Moderate
+
+   Issue summary: A malicious server can exploit TLS OCSP stapling by delivering
+   a crafted response through the `status_request` extension, triggering
+   a double-free in the client's certificate verification path.
+
+   Impact summary: Successful exploitation allows an attacker to corrupt heap
+   memory via a double-free, potentially leading to a Denial of Service
+   or possibly an attacker controlled code execution or other undefined
+   behavior.
+
+   Reported by: Wang Kenaz (University of Illinois),
+   Guido Vranken (Aisle Research), and Aaron Grattafiori (Nvidia).
+
+   ([CVE-2026-35188])
+
+   *Daniel Kubec*
+
  * Fixed NULL pointer dereference in QUIC server initial packet handling.

    Severity: Moderate
@@ -716,6 +1373,24 @@ OpenSSL 3.5

    *Alicja Kario (Red Hat)*

+ * Fixed NULL dereference in certificate verification with OCSP Checking.
+
+   Severity: Low
+
+   Issue summary: When a partial-chain certificate verification is enabled
+   together with OCSP response checking for the whole chain, a NULL dereference
+   will happen if the verified chain does not have a self-signed trusted anchor,
+   crashing the process.
+
+   Impact summary: A NULL pointer dereference can trigger a crash which leads
+   to a Denial of Service for an application.
+
+   Reported by: Joshua Rogers (Aisle Research).
+
+   ([CVE-2026-42765])
+
+   *Joshua Rogers (Aisle Research) and Daniel Kubec*
+
  * Fixed possible NULL dereference in password-dased CMS decryption.

    Severity: Low
@@ -809,6 +1484,24 @@ OpenSSL 3.5

    *Alex Gaynor (Anthropic), Viktor Dukhovni, and Norbert Pócs*

+ * Fixed possible out of bounds read in `X509_VERIFY_PARAM_set1_email()`.
+
+   Severity: Low
+
+   Issue summary: When `X509_VERIFY_PARAM_set1_email()` is called
+   by an application to validate a crafted e-mail address, such as during
+   S/MIME message validation, an out of bounds read can happen.
+
+   Impact summary: This out of bounds read will not directly exfiltrate
+   the data read to the attacker, so, the most likely result is a crash
+   and a Denial of Service.
+
+   Reported by: TrendAI Zero Day Initiative.
+
+   ([CVE-2026-42771])
+
+   *Bob Beck*
+
  * Fixed incorrect tag processing for empty messages in AES-GCM-SIV
    and AES-SIV modes.

@@ -838,10 +1531,24 @@ OpenSSL 3.5
    incrementally grow the buffer as we receive the data.

    This issue was reported by Okta Red Team.
-   <!-- https://github.com/openssl/openssl/pull/30793 -->
+   <!-- https://github.com/openssl/openssl/pull/30792 -->

    *Matt Caswell*

+ * Fixed a regression introduced in 4.0.0 that led to a `openssl pkey`
+   command crash when it was invoked to encrypt a private key with password
+   being provided interactively.
+   <!-- https://github.com/openssl/openssl/pull/30904 -->
+
+   *Viktor Dukhovni*
+
+ * Fixed a regression introduced in 4.0.0 that led to `openssl s_client -adv`
+   command prematurely terminating a session when reading input of 16384 bytes
+   in one `read()` call.
+   <!-- https://github.com/openssl/openssl/pull/31413 -->
+
+   *Eugene Syromiatnikov*
+
  * Fixed TLS 1.3 server not sending `NewSessionTicket` message
    after ciphersuite mismatch.
    <!-- https://github.com/openssl/openssl/pull/30626 -->
@@ -861,28 +1568,727 @@ OpenSSL 3.5

    *Ilya Maximets*

-### Changes between 3.5.5 and 3.5.6 [7 Apr 2026]
+### Changes between 3.6 and 4.0.0 [14 Apr 2026]

- * Fixed incorrect failure handling in RSA KEM RSASVE encapsulation.
+ * Added `-expected-rpks` option to the `openssl s_client`
+   and `openssl s_server` commands.  This makes it possible to specify
+   one or more public keys expected from the remote peer that are then used
+   to authenticate the connection.
+   <!-- https://github.com/openssl/openssl/pull/30089 -->

-   Severity: Moderate
+   *Viktor Dukhovni*

-   Issue summary: Applications using RSASVE key encapsulation to establish
-   a secret encryption key can send contents of an uninitialized memory buffer
-   to a malicious peer.
+ * Added `-hmac-env` and `-hmac-stdin` options to `openssl dgst` command.
+   <!-- https://github.com/openssl/openssl/pull/28160 -->

-   Impact summary: The uninitialized buffer might contain sensitive data
-   from the previous execution of the application process which leads
-   to sensitive data leakage to an attacker.
+   *Igor Ustinov*

-   Reported by: Simo Sorce (Red Hat).
+ * Added LMS support for signature verification to `openssl pkeyutl` command.
+   To enable this, LMS `SubjectPublicKeyInfo` encoder and decoders were
+   added, and the LMS keymanager and signature code were updated.
+   <!-- https://github.com/openssl/openssl/pull/29381 -->

-   ([CVE-2026-31790])
+   *Shane Lontis*

-   *Nikola Pajkovsky*
+ * Added new `SSL_get0_sigalg()` and `SSL_get0_shared_sigalg()` functions
+   to report the TLS signature algorithm name and codepoint for the peer
+   advertised and shared algorithms respectively.  These supersede the existing
+   `SSL_get_sigalgs()` and `SSL_get_shared_sigalgs()` functions, which are only
+   a good fit for TLS 1.2.  The names reported are the IANA names,
+   and are expected to consistently match the names expected
+   in `SignatureAlgorithms` configuration settings, see `SSL_CONF_cmd(3)`
+   for details.  Previously reported names were not always directly usable
+   for configurations, and were mostly OpenSSL-specific aliases that rarely
+   matched the official IANA codepoint names.

- * Fixed loss of key agreement group tuple structure when the `DEFAULT` keyword
-   is used in the server-side configuration of the key-agreement group list.
+   There is an associated change in how signature algorithms are reported by the
+   `openssl s_client` and `openssl s_server` commands.  They now use
+   the new functions and report the IANA registered names of each signature
+   scheme.  Example new output:
+
+       Signature Algorithms: mldsa65:mldsa87:mldsa44:ecdsa_secp256r1_sha256:ecdsa_secp384r1_sha384:ecdsa_secp521r1_sha512:ed25519:ed448:ecdsa_brainpoolP256r1tls13_sha256:ecdsa_brainpoolP384r1tls13_sha384:ecdsa_brainpoolP512r1tls13_sha512:rsa_pss_pss_sha256:rsa_pss_pss_sha384:rsa_pss_pss_sha512:rsa_pss_rsae_sha256:rsa_pss_rsae_sha384:rsa_pss_rsae_sha512:rsa_pkcs1_sha256:rsa_pkcs1_sha384:rsa_pkcs1_sha512:ecdsa_sha224:rsa_pkcs1_sha224:dsa_sha224:dsa_sha256:dsa_sha384:dsa_sha512
+
+   <!-- https://github.com/openssl/openssl/pull/29982 -->
+
+   *Viktor Dukhovni*
+
+ * Implemented client-side predicted keyshare floating.  When a tuple loses
+   the last element that was tagged for transmission of a predicted client
+   keyshare (by default `*X25519MLKEM768` and `*X25519` in their respective
+   tuples), either because the group is not enabled at compile-time, or
+   because it is removed by configuration (e.g. `DEFAULT:-<groupname>`), if
+   the tuple remains non-empty, the keyshare is inherited by the first (i.e.
+   most preferred) remaining element of the tuple.
+   <!-- https://github.com/openssl/openssl/pull/30113 -->
+
+   *Viktor Dukhovni*
+
+ * Implemented `OSSL_STORE` support for `EVP_SKEY` objects, that includes
+   addition of new `-skeyuri` and `-storepass` options to `openssl enc`
+   command, addition of a new `-skeys` option to `openssl storeutl` command,
+   addition of `OSSL_STORE_INFO_SKEY` `OSS_STORE` object type and the relevant
+   `OSSL_STORE_INFO_get0_SKEY()`, `OSSL_STORE_INFO_get1_SKEY()`,
+   and `OSSL_STORE_INFO_new_SKEY()` APIs.
+   <!-- https://github.com/openssl/openssl/pull/28278 -->
+
+   *Dmitry Belyavskiy*
+
+ * Added support for [RFC 8998], signature algorithm `sm2sig_sm3`, key exchange
+   group `curveSM2`, and [tls-hybrid-sm2-mlkem] post-quantum group
+   `curveSM2MLKEM768`.
+
+   Verification of SM2-signed certificates required changing the default
+   *distinguishing identifier* from empty to the constant ASCII string
+   "1234567812345678".  An explicit empty distinguishing identifier value may
+   need to be used to verify or create signatures that are compatible with
+   versions of OpenSSL prior to 4.0.  With the command-line tools an empty
+   value can be specified with the use of either the **-pkeyopt**
+   (`openssl-pkeyutl(1)`) or **-sigopt** (`openssl-dgst(1)`) option with a
+   value of "distid:".
+   <!-- https://github.com/openssl/openssl/pull/29953 -->
+
+   *Viktor Dukhovni*
+
+ * Added support for TLS 1.3 SM cipher suites `TLS_SM4_GCM_SM3`
+   and `TLS_SM4_CCM_SM3` from [RFC 8998].
+   <!-- https://github.com/openssl/openssl/pull/30028 -->
+
+   *Milan Brož*
+
+ * Added cSHAKE function support as per [SP 800-185].
+   <!-- https://github.com/openssl/openssl/pull/28432 -->
+
+   *Shane Lontis*
+
+ * Added "ML-DSA-MU" digest algorithm support.
+   <!-- https://github.com/openssl/openssl/pull/29223 -->
+
+   *Shane Lontis*
+
+ * Added SNMP KDF (`EVP_KDF_SNMPKDF`) to `EVP_KDF`.
+   <!-- https://github.com/openssl/openssl/pull/29195 -->
+
+   *Barry Fussell and Helen Zhang*
+
+ * Added SRTP KDF (`EVP_KDF_SRTPKDF`) to `EVP_KDF`.
+   <!-- https://github.com/openssl/openssl/pull/29435 -->
+
+   *Barry Fussell and Helen Zhang*
+
+ * Implemented [RFC 7919], adding support for negotiated FFDHE key exchange
+   in TLS 1.2.
+   <!-- https://github.com/openssl/openssl/pull/24551 -->
+
+   *Joachim Vandersmissen* (with additional support from *Viktor Dukhovni*)
+
+ * Added AKID verification checks when `X509_V_FLAG_X509_STRICT` is set.
+   Raise `X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIER` when AKID is not present.
+   Raise `X509_V_ERR_EMPTY_AUTHORITY_KEY_IDENTIFIER` when AKID has no attributes.
+   Raise `X509_V_ERR_AKID_ISSUER_SERIAL_NOT_PAIRED` when `authorityCertIssuer`
+   and `authorityCertSerialNumber` fields are not paired.
+   <!-- https://github.com/openssl/openssl/pull/29971 -->
+
+   *Daniel Kubec*
+
+ * Implemented [RFC 9849], adding support for Encrypted Client Hello (ECH).
+   See `doc/design/ech-api.md` for details.
+   <!-- https://github.com/openssl/openssl/pull/25193 -->
+   <!-- https://github.com/openssl/openssl/pull/25420 -->
+   <!-- https://github.com/openssl/openssl/pull/25663 -->
+   <!-- https://github.com/openssl/openssl/pull/26011 -->
+   <!-- https://github.com/openssl/openssl/pull/27540 -->
+   <!-- https://github.com/openssl/openssl/pull/27561 -->
+   <!-- https://github.com/openssl/openssl/pull/28270 -->
+   <!-- https://github.com/openssl/openssl/pull/29200 -->
+   <!-- https://github.com/openssl/openssl/pull/30048 -->
+
+   *Stephen Farrell* (with much support from *Matt Caswell* and *Tomáš Mráz*)
+
+ * Implemented display of CPU capabilities in `openssl version -c` output
+   on POWER and SPARC platforms, added `OPENSSL_ppccap(3)` manual page.
+   <!-- https://github.com/openssl/openssl/pull/28535 -->
+   <!-- https://github.com/openssl/openssl/pull/29116 -->
+   <!-- https://github.com/openssl/openssl/pull/29230 -->
+
+   *Bernd Edlinger, Nia Alarie, and George Wilson*
+
+ * Added `OSSL_ESS_check_signing_certs_ex()` function.
+   This API call is an extension to `OSSL_ESS_check_signing_certs()` that adds
+   the ability to specify a library context and property query when fetching
+   algorithms to validate a given certificate.
+   <!-- https://github.com/openssl/openssl/pull/30034 -->
+
+   *Neil Horman*
+
+ * Added `OPENSSL_sk_set_cmp_thunks()` function to allow for proper typecasting
+   during comparison of elements in a `STACK_OF` structure.
+   <!-- https://github.com/openssl/openssl/pull/29640 -->
+
+   *Neil Horman*
+
+ * Added `OSSL_PARAM_clear_free` function that allows cleansing `PARAM`s that
+   contain sensitive information, and switched to its use where it is suitable.
+   <!-- https://github.com/openssl/openssl/pull/28108 -->
+
+   *Simo Source*
+
+ * Added `ASN1_BIT_STRING_get_length()` function, that returns the number
+   of octets and the number of unused bits in an `ASN1_BIT_STRING` object.
+   <!-- https://github.com/openssl/openssl/pull/29387 -->
+
+   *Bob Beck*
+
+ * Added `ASN1_BIT_STRING_set1()` function to set a bit string to a value,
+   including the length in bytes and the number of unused bits.  Internally,
+   `ASN1_BIT_STRING_set_bit()` has also been modified to keep the number
+   of unused bits correct when changing an `ASN1_BIT_STRING`.
+   <!-- https://github.com/openssl/openssl/pull/29926 -->
+
+   *Bob Beck*
+
+ * Added `PACKET_msg_start()` function, that allows obtaining start
+   of a `PACKET` buffer.
+   <!-- https://github.com/openssl/openssl/pull/27776 -->
+
+   *Matt Caswell*
+
+ * Added `SSL_add1_dnsname()`, `SSL_set1_dnsname()`, `SSL_add1_ipaddr()`,
+   and `SSL_set1_ipaddr()` functions as a replacement for `SSL_add1_host()`
+   and `SSL_set1_host()` that are deprecated now.  The new replacement API
+   functions was added to support checking multiple names against a certificate
+   with `X509_VERIFY_PARAM`.  See `X509_VERIFY_PARAM_set_flags(3)` for full
+   details.
+   <!-- https://github.com/openssl/openssl/pull/29612 -->
+
+   *Bob Beck*
+
+ * Added `SSL_listen_ex()` function, that, together with added ability to create
+   "blank" SSL objects using `OSSL_QUIC_method()`, allows implementing polling
+   of inbound connections in QUIC in a fashion similar to DTLS.
+   <!-- https://github.com/openssl/openssl/pull/27397 -->
+
+   *Neil Horman*
+
+ * Added `SSL_CTX_get0_alpn_protos()` and `SSL_get0_alpn_protos()` functions.
+   <!-- https://github.com/openssl/openssl/pull/29646 -->
+
+   *Daniel Kubec*
+
+ * Added `SSL_CTX_is_server()` function, that is similar to `SSL_is_server()`,
+   but takes `SSL_CTX` object as an argument.
+   <!-- https://github.com/openssl/openssl/pull/29635 -->
+
+   *Igor Ustinov*
+
+ * Added `EVP_MD_CTX_serialize()`/`EVP_MD_CTX_deserialize()` functions.
+   These functions allow to export the internal state of a Digest and re-import
+   it later to continue a computation from a specific checkpoint.  Only SHA-2
+   and the SHA-3 family (Keccak, SHAKE, SHA-3) of functions currently support
+   this functionality.
+   <!-- https://github.com/openssl/openssl/pull/28837 -->
+
+   *Simo Sorce*
+
+ * Added `BIO_set_send_flags()` function that allows setting flags passed to
+   `send()`, `sendto()`, and `sendmsg()`.  The main intention is to allow
+   setting the `MSG_NOSIGNAL` flag to avoid a crash on receiving the `SIGPIPE`
+   signal.
+   <!-- https://github.com/openssl/openssl/pull/30044 -->
+
+   *Igor Ustinov*
+
+ * Added `X509v3_delete_extension()` function, that extends
+   `X509v3_delete_ext()` by deallocating the extension stack if it becomes
+   empty, as a convenience wrapper useful for optional X.509 extensions.
+   <!-- https://github.com/openssl/openssl/pull/30252 -->
+
+   *Viktor Dukhovni*
+
+ * Added ability to specify ML-KEM and ML-DSA encoding formats on a per-key
+   basis, by setting `output-formats` `EVP_PKEY` encoding parameter
+   appropriately via `OSSL_ENCODER_CTX_set_params(3)`.
+   <!-- https://github.com/openssl/openssl/pull/29206 -->
+
+   *Viktor Dukhovni*
+
+ * Added documentation for `BIO` flags and related functions.
+   <!-- https://github.com/openssl/openssl/pull/29311 -->
+
+   *Igor Ustinov*
+
+ * FIPS self tests can now be deferred and run as needed when installing
+   the FIPS module with the `-defer_tests` option of the `openssl fipsinstall`
+   command.
+   <!-- https://github.com/openssl/openssl/pull/29222 -->
+
+   *Simo Sorce*
+
+ * Lower bounds checks are now enforced when using `PKCS5_PBKDF2_HMAC` API
+   with FIPS provider.
+
+   When using the FIPS provider via the `PKCS5_PBKDF2_HMAC` API,
+   password protected encrypted files will now have lower bounds
+   checks (minimum iteration count, minimum password length, salt
+   size and derived key lengths) enforced by default.  Prior to
+   upgrading to this version, users may want to check if their
+   password protected key–stores are encrypted using short passwords,
+   salts, low iteration counts for PBKDF or weaker ciphers. To
+   upgrade to the new defaults one can decrypt the keys with a
+   previous OpenSSL version or the default provider, and then
+   re-encrypt them with the newer OpenSSL (using the FIPS provider),
+   thus upgrading to longer password, salt length and AES-256 CBC.
+   <!-- https://github.com/openssl/openssl/pull/27431 -->
+
+   *Dimitri John Ledkov*
+
+ * Added support for using either static or dynamic VC runtime linkage
+   on Windows.  Using the `enable-static-vcruntime` configuration option,
+   OpenSSL can now be configured to use the static or dynamic `vcruntime.dll`
+   linkage.  The multithreaded or single threaded static VC runtime is selected
+   based on the `enable-threads` option.
+   <!-- https://github.com/openssl/openssl/pull/29995 -->
+
+   *Neil Horman*
+
+ * Added configure options to disable KDF algorithms for `hmac-drbg-kdf`,
+   `kbkdf`, `krb5kdf`, `pvkkdf`, `snmpkdf`, `sskdf`, `sshkdf`, `x942kdf`,
+   and `x963kdf`.
+   <!-- https://github.com/openssl/openssl/pull/29576 -->
+
+   *Shane Lontis*
+
+ * Removed configure options can now only be disabled.  You may continue
+   to use `disable-<feature>` syntax, which will remain supported.  Using
+   `enable-<feature>` for a removed feature is no longer permitted.
+   <!-- https://github.com/openssl/openssl/pull/29338 -->
+
+   *Andrew Dinh*
+
+ * Added restrictions on the maximum number of TLS `key_share`s (16)
+   that a server will pay attention to, as well as the maximum number
+   of supported `group`s (128) and `sig_alg`s (128).  Any sent beyond
+   these limits are ignored, in order to avoid clients sending excessively
+   long lists in these extensions.
+   <!-- https://github.com/openssl/openssl/pull/30263 -->
+
+   *Matt Caswell*
+
+ * Removed specialised built-in logic for adding the SKID and AKID extensions
+   from `openssl x509`, `openssl req`, and `openssl ca` commands,
+   these extensions are handled through configuration files and command-line
+   options just like any other extension.  See their documentation and also
+   `x509v3_config(5)` for additional details.
+
+   Updated the syntax of the `subjectKeyIdentifier` (SKID) and
+   `authorityKeyIdentifier` (AKID) extensions, introducing the `nonss` qualifier
+   for the `keyid` and `issuer` keywords.
+
+   The x509 "mini-CA" now attempts to find extension settings in the default
+   configuration file even if neither the `-extfile` nor the `-extensions`
+   option is explicitly specified.  Failure to open the default configuration
+   is silently ignored.
+
+   The settings in the stock OpenSSL 4.0 configuration file arrange for
+   addition of the requisite SKID and AKID extensions.  Other configuration
+   files may need to be adjusted if desired.
+   <!-- https://github.com/openssl/openssl/pull/29057 -->
+
+   *Viktor Dukhovni*
+
+ * Enabled Server verification by default in `s_server`
+   when the `-verify_return_error` option is enabled.
+   <!-- https://github.com/openssl/openssl/pull/28445 -->
+
+   *Ryan Hooper*
+
+ * Removed extra leading '00:' when printing key data such as an RSA modulus
+   in hexadecimal format where the first (most significant) byte is >= 0x80.
+   This had been added artificially to resemble ASN.1 DER encoding internals.
+   Fixing this also makes sure that key output always has the expected length.
+   <!-- https://github.com/openssl/openssl/pull/8136 -->
+
+   *David von Oheimb*
+
+ * Standardized the width of hexadecimal dumps to 24 bytes for signatures
+   (to stay within the 80 characters limit) and 16 bytes for everything else.
+   <!-- https://github.com/openssl/openssl/pull/29266 -->
+
+   *Beat Bolli*
+
+ * Updated the default group list to append `SecP256r1MKEM768` and
+   `curveSM2MLKEM768` to the first tuple in that order after `*X25519MLKEM768`.
+   Also inserted a penultimate tuple with `curveSM2` (just before the `FFDHE`
+   groups).
+   <!-- https://github.com/openssl/openssl/pull/30113 -->
+
+   *Viktor Dukhovni*
+
+ * Consolidated processing of SM2 and EdDSA signatures with essentially
+   identical code for ECDSA in the `openssl speed` command.  The output format
+   has changed slightly to report the EC curve name rather than its bit size.
+   <!-- https://github.com/openssl/openssl/pull/29953 -->
+
+   *Viktor Dukhovni*
+
+ * CRLs with a malformed Issuing Distribution Point extensions are now rejected.
+   <!-- https://github.com/openssl/openssl/pull/30171 -->
+
+   *Daniel Kubec*
+
+ * CRLs with malformed `CRL Number` or `Delta CRL Indicator` extensions
+   are now rejected.
+   <!-- https://github.com/openssl/openssl/pull/30024 -->
+
+   *Daniel Kubec*
+
+ * Fixed CRLs with invalid `ASN1_TIME` in `invalidityDate` extensions,
+   where verification incorrectly succeeded.  Enforced proper handling
+   of `ASN1_TIME` validation results so that any CRL containing invalid
+   time fields is rejected immediately, preventing the error from propagating
+   to verification.
+   <!-- https://github.com/openssl/openssl/pull/29107 -->
+
+   *Daniel Kubec*
+
+ * CRLs with a `Certificate Issuer` extension in a certificate revocation entry
+   are now rejected, unless the `Indirect` flag is set to `TRUE`
+   in the `Issuing Distribution Point` extension of the CRL.
+   <!-- https://github.com/openssl/openssl/pull/29018 -->
+
+   *Daniel Kubec*
+
+ * `SSL_get_error()` no longer depends on the state of the error stack,
+   so it is no longer necessary to empty the error queue before the
+   TLS/SSL I/O operations.
+   <!-- https://github.com/openssl/openssl/pull/29991 -->
+
+   *Igor Ustinov*
+
+ * `ASN1_STRING` has been made opaque.
+
+   Access to values from `ASN1_STRING` and related types should be done with the
+   appropriate accessor functions.  The various `ASN1_STRING_FLAG` values have
+   been made private.
+   <!-- https://github.com/openssl/openssl/pull/29862 -->
+
+   *Bob Beck*
+
+ * `OPENSSL_cleanup()` now runs in a global destructor, or not at all
+   by default:  `OPENSSL_cleanup()` will no longer by default free global
+   objects when run from an application. Instead it sets a flag for a global
+   destructor to do this after the process exits, and after subordinate
+   libraries using OpenSSL have run their destructors. If destructor support
+   is not available, `OPENSSL_cleanup()` will do nothing, leaving the global
+   objects to be cleaned up by the operating system.
+   <!-- https://github.com/openssl/openssl/pull/29721 -->
+
+   *Bob Beck*
+
+ * Added a `-ta_in_ip_extracert` option for the `openssl cmp` command, that sets
+   `OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR` option for the `OSSL_CMP_CTX`
+   object.
+
+   This work was sponsored by Siemens AG.
+
+   *David von Oheimb*
+
+ * `X509_ALGOR_set_md()` function now returns a value indicating success
+    or failure.
+    <!-- https://github.com/openssl/openssl/pull/17495 -->
+
+   *David von Oheimb*
+
+ * Changed `BIO_snprintf()` implementation to use `snprintf()` provided
+   by system's libc (instead of relying on internal implementation),
+   making it bug-for-bug compatible with it.
+   <!-- https://github.com/openssl/openssl/pull/28305 -->
+
+   *Alexandr Nedvedicky*
+
+ * Added `X509_check_certificate_times()` function, as well as
+   the `<openssl/posix_time.h>` interface from BoringSSL/LibreSSL, that replace
+   now deprecated `X509_cmp_time()`, `X509_cmp_current_time()`,
+   and `X509_cmp_timeframe()`. See `X509_check_certificate_times(3)`
+   for details.
+   <!-- https://github.com/openssl/openssl/pull/28623 -->
+   <!-- https://github.com/openssl/openssl/pull/29152 -->
+   <!-- https://github.com/openssl/openssl/pull/30098 -->
+
+   *Bob Beck*
+
+ * `const`-corrected `time_t` arguments for `X509_cmp_time()`,
+   `X509_time_adj()`, and `X509_time_adj_ex()`.
+   <!-- https://github.com/openssl/openssl/pull/30020 -->
+
+   *Frederik Wedel-Heinen*
+
+ * Made `X509_ATTRIBUTE` accessor functions `const`-correct. The functions
+   `X509_ATTRIBUTE_get0_object()`, `X509_ATTRIBUTE_get0_type()`, and
+   `X509_ATTRIBUTE_get0_data()` now accept `const X509_ATTRIBUTE *` and
+   return `const` pointers. Related PKCS#12 functions `PKCS12_get_attr_gen()`,
+   `PKCS12_get_attr()`, and `PKCS8_get_attr()` have also been updated to
+   return `const ASN1_TYPE *`.
+   <!-- https://github.com/openssl/openssl/pull/29813 -->
+
+   *kovan*
+
+ * Made `X509_PUBKEY` accessor functions `const`-correct.
+   <!-- https://github.com/openssl/openssl/pull/29428 -->
+
+   *Bob Beck*
+
+ * `const`-corrected various function return values, particularly in `X509`
+   and related areas, and when functions were returning non-`const` objects
+   owned by a `const` parameter.
+   <!-- https://github.com/openssl/openssl/pull/30035 -->
+   <!-- https://github.com/openssl/openssl/pull/30036 -->
+
+   *Bob Beck*
+
+ * Many functions accepting `X509 *` arguments, or returning values
+   from a `const` `X509 *` have been changed to take/return `const`
+   arguments. The most visible changes are places where pointer values
+   are returned from a `const` `X509 *` object. In many places where
+   these were non `const` values being returned from a `const` object,
+   these pointer values have now been made `const`. The goal of this
+   change is to enable future improvements in X.509 certificate
+   handling. For full details see the relevant section in
+   `ossl-migration-guide(7)`.
+   <!-- https://github.com/openssl/openssl/pull/29465 -->
+   <!-- https://github.com/openssl/openssl/pull/29468 -->
+   <!-- https://github.com/openssl/openssl/pull/29488 -->
+   <!-- https://github.com/openssl/openssl/pull/30053 -->
+   <!-- https://github.com/openssl/openssl/pull/30054 -->
+   <!-- https://github.com/openssl/openssl/pull/30056 -->
+   <!-- https://github.com/openssl/openssl/pull/30058 -->
+   <!-- https://github.com/openssl/openssl/pull/30067 -->
+   <!-- https://github.com/openssl/openssl/pull/30071 -->
+   <!-- https://github.com/openssl/openssl/pull/30072 -->
+   <!-- https://github.com/openssl/openssl/pull/30073 -->
+   <!-- https://github.com/openssl/openssl/pull/30074 -->
+   <!-- https://github.com/openssl/openssl/pull/30076 -->
+   <!-- https://github.com/openssl/openssl/pull/30079 -->
+   <!-- https://github.com/openssl/openssl/pull/30080 -->
+   <!-- https://github.com/openssl/openssl/pull/30082 -->
+   <!-- https://github.com/openssl/openssl/pull/30084 -->
+   <!-- https://github.com/openssl/openssl/pull/30090 -->
+   <!-- https://github.com/openssl/openssl/pull/30092 -->
+   <!-- https://github.com/openssl/openssl/pull/30096 -->
+   <!-- https://github.com/openssl/openssl/pull/30117 -->
+   <!-- https://github.com/openssl/openssl/pull/30127 -->
+   <!-- https://github.com/openssl/openssl/pull/30229 -->
+   <!-- https://github.com/openssl/openssl/pull/30235 -->
+   <!-- https://github.com/openssl/openssl/pull/30265 -->
+   <!-- https://github.com/openssl/openssl/pull/30272 -->
+   <!-- https://github.com/openssl/openssl/pull/30273 -->
+   <!-- https://github.com/openssl/openssl/pull/30276 -->
+
+   *Bob Beck*
+
+ * `const`-corrected various function parameters, in particular
+   for `X509`-related functions.
+   <!-- https://github.com/openssl/openssl/pull/28033 -->
+
+   *David von Oheimb*
+
+ * `const`-corrected various `X509`-related functions: `X509_get_pathlen()`,
+   `X509_check_ca()`, `X509_check_purpose()`, `X509_get_proxy_pathlen()`,
+   `X509_get_extension_flags()`, `X509_get_key_usage()`,
+   `X509_get_extended_key_usage()`, `X509_get0_subject_key_id()`,
+   `X509_get0_authority_key_id()`, `X509_get0_authority_issuer()`,
+   `X509_get0_authority_serial()`, `X509_get0_distinguishing_id()`.
+   <!-- https://github.com/openssl/openssl/pull/30055 -->
+
+   *Bob Beck*
+
+ * Removed needless `const` qualifiers from scalar type arguments in the public
+   APIs, mostly for AES and Camellia.
+   <!-- https://github.com/openssl/openssl/pull/18229 -->
+
+   *David von Oheimb*
+
+ * Fixed a bug that allowed TLS 1.2 ciphers to be added to the TLS 1.3
+   `ciphersuites` list, and for that list to contain duplicates.
+   Cipher configuration strings for both TLS 1.2 and 1.3 are now
+   case-insensitive.
+   <!-- https://github.com/openssl/openssl/pull/30140 -->
+
+   *Viktor Dukhovni*
+
+ * Deprecated `ASN1_OBJECT_new()` function.
+   Refer to `ossl-migration-guide(7)` for more info.
+   <!-- https://github.com/openssl/openssl/pull/30011 -->
+
+   *Frederik Wedel-Heinen*
+
+ * Deprecated `X509_NAME_get_text_by_NID()` and `X509_NAME_get_text_by_OBJ()`
+   functions, and documented them as such.
+   <!-- https://github.com/openssl/openssl/pull/30031 -->
+
+   *Bob Beck*
+
+ * Removed the `SSL_TXT_FIPS` option.  This was a remnant of the old FIPS
+   canister and wasn't used anymore.
+   <!-- https://github.com/openssl/openssl/pull/30200 -->
+
+   *Dr Paul Dale*
+
+ * Removed `OPENSSL_atexit()` function.
+   <!-- https://github.com/openssl/openssl/pull/29874 -->
+
+   *Bob Beck*
+
+ * Removed critical extension enforcement for `EXFLAG_BCONS_CRITICAL`,
+   `EXFLAG_AKID_CRITICAL`, `EXFLAG_SKID_CRITICAL`, and `EXFLAG_SAN_CRITICAL`,
+   as it was incorrect.  These checks were intended as CA requirements
+   to prevent misinterpretation by verifiers that don't support certain
+   extensions.  However, since we do support these extensions,
+   there is no requirement for them to be marked as critical.  Enforcing
+   that on `X509_V_FLAG_X509_STRICT` was a mistake.
+   <!-- https://github.com/openssl/openssl/pull/30249 -->
+
+   *Daniel Kubec*
+
+ * Removed support for an SSLv2 Client Hello.  When a client wanted to support
+   both SSLv2 and higher versions like SSLv3 or even TLSv1, it needed to
+   send an SSLv2 Client Hello.  SSLv2 support itself was removed
+   in OpenSSL 1.1.0, but there was still compatibility code for clients sending
+   an SSLv2 Client Hello.  Since we no longer support SSLv2 Client Hello,
+   `SSL_client_hello_isv2()` is now deprecated and always returns 0.
+   <!-- https://github.com/openssl/openssl/pull/28041 -->
+
+   *Kurt Roeckx*
+
+ * Removed support for SSLv3.  SSLv3 has been deprecated since 2015, and OpenSSL
+   had it disabled by default since version 1.1.0 (2016).
+   <!-- https://github.com/openssl/openssl/pull/29338 -->
+
+   *Kurt Roeckx*
+
+ * Support of deprecated elliptic curves in TLS according to [RFC 8422] was
+   disabled at compile-time by default. To enable it, use the
+   `enable-tls-deprecated-ec` configuration option.
+   <!-- https://github.com/openssl/openssl/pull/29658 -->
+
+   *Dmitry Belyavskiy*
+
+ * Support of explicit EC curves was disabled by default, an error will occur
+   if an explicit EC curve doesn't match any known one.  A new configuration
+   option, `enable-ec_explicit_curves`, is added.
+   <!-- https://github.com/openssl/openssl/pull/29639 -->
+
+   *Dmitry Belyavskiy*
+
+ * Removed `c_rehash` script tool. Use `openssl rehash` instead.
+   <!-- https://github.com/openssl/openssl/pull/29427 -->
+
+   *Norbert Pócs*
+
+ * `libcrypto` no longer cleans up globally allocated data via `atexit()`.
+   This data is cleaned up automatically by the OS.  Some memory leak detectors
+   may report spurious allocated and reachable memory at application exit.
+   To avoid such spurious leak detection reports the application may call
+   `OPENSSL_cleanup()` before the process exits.
+   <!-- https://github.com/openssl/openssl/pull/29385 -->
+
+   *Alexandr Nedvedicky*
+
+ * Removed the `crypto-mdebug-backtrace` configuration option entirely.
+   The option has been a no-op since OpenSSL 1.0.2.
+   <!-- https://github.com/openssl/openssl/pull/29380 -->
+
+   *Neil Horman*
+
+ * Removed the deprecated function `ASN1_STRING_data()`.
+   <!-- https://github.com/openssl/openssl/pull/29149 -->
+
+   *Bob Beck*
+
+ * Removed the `ASN1_STRING_FLAG_X509_TIME` define.
+   <!-- https://github.com/openssl/openssl/pull/29187 -->
+
+   *Bob Beck*
+
+ * Dropped `darwin-i386{,-cc}` and `darwin-ppc{,64}{,-cc}` targets
+   from Configurations.
+   <!-- https://github.com/openssl/openssl/pull/29653 -->
+   <!-- https://github.com/openssl/openssl/pull/29672 -->
+
+   *Daniel Kubec and Eugene Syromiatnikov*
+
+ * Removed support for engines.  The `no-engine` build option
+   and the `OPENSSL_NO_ENGINE` macro are always present.  Applications that use
+   `ENGINE_` functions without `OPENSSL_NO_ENGINE` guards can be built
+   by defining a macro `OPENSSL_ENGINE_STUBS`;  however, all these functions
+   will return error when called.  Provider API should be used to replace
+   engine functionality.
+   <!-- https://github.com/openssl/openssl/pull/29305 -->
+
+   *Milan Brož*, *Neil Horman*, *Norbert Pócs*
+
+ * Removed deprecated support for custom `EVP_CIPHER`, `EVP_MD`, `EVP_PKEY`,
+   and `EVP_PKEY_ASN1` methods (`EVP_CIPHER_meth_*`, `EVP_MD_meth_*`,
+   `EVP_PKEY_meth_*`, and `EVP_PKEY_asn1_*` function families, respectively).
+   <!-- https://github.com/openssl/openssl/pull/29299 -->
+   <!-- https://github.com/openssl/openssl/pull/29366 -->
+   <!-- https://github.com/openssl/openssl/pull/29384 -->
+   <!-- https://github.com/openssl/openssl/pull/29405 -->
+   <!-- https://github.com/openssl/openssl/pull/29446 -->
+
+   *Matt Caswell*
+
+ * Removed deprecated fixed SSL/TLS version methods
+   (`{SSLv3,{D,}TLSv1{,_1,_2}}{,_client,_server}_method()` functions),
+   the migrating application should use `TLS_method()`, `TLS_client_method()`,
+   and `TLS_server_method()` functions instead.
+   <!-- https://github.com/openssl/openssl/pull/30128 -->
+
+   *Frederik Wedel-Heinen*
+
+ * Removed `BIO_f_reliable()` implementation without replacement.
+   It was broken since 3.0 release without any complaints.
+   <!-- https://github.com/openssl/openssl/pull/29445 -->
+
+   *Tomáš Mráz*
+
+ * Removed deprecated functions `ERR_get_state()`, `ERR_remove_state()`
+   and `ERR_remove_thread_state()`, as well as the `ERR_FLAG_MARK`,
+   `ERR_FLAG_CLEAR` and `ERR_NUM_ERRORS` macros. The `ERR_STATE` object is now
+   always opaque.
+   <!-- https://github.com/openssl/openssl/pull/30005 -->
+
+   *Tomáš Mráz*
+
+ * Removed the deprecated `msie-hack` option from the `openssl ca` command.
+   <!-- https://github.com/openssl/openssl/pull/30033 -->
+
+   *Bob Beck*
+
+OpenSSL 3.6
+-----------
+
+### Changes between 3.6.1 and 3.6.2 [7 Apr 2026]
+
+ * Fixed incorrect failure handling in RSA KEM RSASVE encapsulation.
+
+   Severity: Moderate
+
+   Issue summary: Applications using RSASVE key encapsulation to establish
+   a secret encryption key can send contents of an uninitialized memory buffer
+   to a malicious peer.
+
+   Impact summary: The uninitialized buffer might contain sensitive data
+   from the previous execution of the application process which leads
+   to sensitive data leakage to an attacker.
+
+   Reported by: Simo Sorce (Red Hat).
+
+   ([CVE-2026-31790])
+
+   *Nikola Pajkovsky*
+
+ * Fixed loss of key agreement group tuple structure when the `DEFAULT` keyword
+   is used in the server-side configuration of the key-agreement group list.

    Severity: Low

@@ -898,9 +2304,25 @@ OpenSSL 3.5
    the server.
    <!-- https://github.com/openssl/openssl/pull/30111 -->

-   ([CVE-2026-2673])
+ * Fixed out-of-bounds read in AES-CFB-128 on x86-64 CPUs with AVX-512 support.

-   *Viktor Dukhovni*
+   Severity: Low
+
+   Issue summary: Applications using AES-CFB128 encryption or decryption on
+   systems with AVX-512 and VAES support can trigger an out-of-bounds read
+   of up to 15 bytes when processing partial cipher blocks.
+
+   Impact summary: This out-of-bounds read may trigger a crash which leads to
+   Denial of Service for an application if the input buffer ends at a memory
+   page boundary and the following page is unmapped. There is no information
+   disclosure as the over-read bytes are not written to output.
+
+   Reported by: Stanislav Fort (Aisle Research), Pavel Kohout (Aisle Research),
+   and Alex Gaynor (Anthropic).
+
+   ([CVE-2026-28386])
+
+   *Stanislav Fort, Pavel Kohout, and Alex Gaynor*

  * Fixed potential use-after-free in DANE client code.

@@ -1005,7 +2427,14 @@ OpenSSL 3.5

    *Matt Caswell*

-### Changes between 3.5.4 and 3.5.5 [27 Jan 2026]
+ * Fixed performance regressions introduced in 3.6 caused by the lack
+   of usage of CPU-capability-specific optimisations with non-EVP APIs,
+   as the capability detection was no longer performed during library load.
+   <!-- https://github.com/openssl/openssl/pull/30557 -->
+
+   *Bob Beck*
+
+### Changes between 3.6.0 and 3.6.1 [27 Jan 2026]

  * Fixed Improper validation of PBMAC1 parameters in PKCS#12 MAC verification.

@@ -1234,16 +2663,258 @@ OpenSSL 3.5

    *Bernd Edlinger*

+ * Fixed a regression in `X509_V_FLAG_CRL_CHECK_ALL` flag handling by restoring
+   its pre-3.6.0 behaviour of being ignored when `X509_V_FLAG_CRL_CHECK` flag
+   is not set, and no longer implying the latter flag instead.
+   <!-- https://github.com/openssl/openssl/pull/28797 -->
+
+   *Carter Thaxton*
+
+ * Fixed a regression that caused generation of empty stapled OCSP responses
+   when at least one certificate in the certificate chain had a stapled OCSP
+   response present, causing handshake failures for OpenSSL 3.6.0 servers
+   with various client implementations, including GnuTLS and BoringSSL.
+   <!-- https://github.com/openssl/openssl/pull/28955 -->
+
+   *Martin Rauch*
+
+ * Fixed exit code of `openssl x509` command with `-checkend` option in use.
+   <!-- https://github.com/openssl/openssl/pull/29155 -->
+
+   *Stefan Rieche*
+
  * Fixed incorrect acceptance of some malformed ECDSA signatures on s390x.
    <!-- https://github.com/openssl/openssl/pull/29214 -->

    *Holger Dengler*

  * Source code has been reformatted with `clang-format`.
-   <!-- https://github.com/openssl/openssl/pull/29262 -->
+   <!-- https://github.com/openssl/openssl/pull/29245 -->

    *Bob Beck*

+ * Reverted a change in behaviour of the single stapled OCSP response API
+   with respect to the ownership of the OCSP response object that caused
+   a memory leak.
+   <!-- https://github.com/openssl/openssl/pull/29251 -->
+
+   *Remi Gacogne and Tomáš Mráz*
+
+### Changes between 3.5 and 3.6.0 [1 Oct 2025]
+
+ * Added support for `EVP_SKEY` opaque symmetric key objects to the key
+   derivation and key exchange provider methods.  Added
+   `EVP_KDF_CTX_set_SKEY()`, `EVP_KDF_derive_SKEY()`,
+   and `EVP_PKEY_derive_SKEY()` functions.
+
+   *Dmitry Belyavskiy and Simo Sorce*
+
+ * Added PCT for key import for SLH-DSA when in FIPS mode.
+
+   *Dr Paul Dale*
+
+ * Added `i2d_PKCS8PrivateKey(3)` API to complement `i2d_PrivateKey(3)`,
+   the former always outputs PKCS#8.
+
+   *Viktor Dukhovni*
+
+ * Implemented interleaved AES-CBC+HMAC-SHA algorithm on AArch64.
+
+   *Fangming Fang*
+
+ * Added NIST security categories for PKEY objects.
+
+   *Dr Paul Dale*
+
+ * Added notification when all stream FINs are acknowledged in QUIC.  Introduced
+   `ossl_quic_channel_notify_flush_done()` so that once final FINs are ACKed,
+   the channel transitions to terminating and `SSL_poll()` signals completion.
+   This allows applications to progress shutdown reliably.
+
+   *Alexandr Nedvědický*
+
+ * Added array memory allocation routines and converted suitable memory
+   allocation calls in the library to them.
+
+   *Eugene Syromiatnikov*
+
+ * Fixed behavior change of EC keygen by adding the generic error entry if the
+   provider did not itself add an error entry onto the queue.  That way, there
+   always is an error on the error queue in case of a failure, but no behavior
+   change in case the provider emitted the error entry itself.
+
+   *Ingo Franzki*
+
+ * Documented all the environment variables used across the project
+   in `openssl-env(7)` and in specific man pages.
+
+   *Eugene Syromiatnikov*
+
+ * Added SHA-2 assembly implementation enhancing performance for LoongArch.
+   Added optimized SM3, MD5, SHA-256, SHA-512 implementation using Zbb extension
+   for RISC-V.
+
+   *Julian Zhu*
+
+ * Added options `CRYPTO_MEM_SEC` and `CRYPTO_MEM_SEC_MINSIZE` to `openssl` app
+   to initialize secure memory at the beginning of `openssl` app.
+
+   *Norbert Pócs*
+
+ * Resolved compiler warnings on Win64 builds.
+
+   *Tomáš Mráz*
+
+ * Extended new `CRYPTO_THREAD_[get|set]_local` API to reduce the usage
+   of OS thread-local variables.
+
+   *Neil Horman*
+
+ * Added `make` targets `build_inst_sw` and `build_inst_programs` which have
+   the functionality to split the build into two parts, e.g. when tests
+   should be built with different compiler flags than the installed software.
+
+   *Pavol Zacik*
+
+ * Refactored `OSSL_PARAM` name parsing so that automatically generated
+   parsers are used instead of `OSSL_PARAM_locate()` calls.  This should
+   also ensure that the list of acceptable parameters better matches
+   those which are actually processed.  It should also provide a small
+   performance improvement, because repeated iteration over passed
+   parameter arrays is avoided.
+
+   *Dr Paul Dale*
+
+ * Introduced `SSL_OP_SERVER_PREFERENCE`, superseding misleadingly
+   named `SSL_OP_CIPHER_SERVER_PREFERENCE`.
+
+   *Michael Baentsch*
+
+ * Added LMS signature verification support as per [SP 800-208].
+   This support is present in both the FIPS and default providers.
+
+   *Shane Lontis and Paul Dale*
+
+ * Introduced use of `<stdbool.h>` when handling JSON encoding
+   in the OpenSSL codebase, replacing the previous use of `int`
+   for these boolean values.
+
+   *Alexis Goodfellow*
+
+ * An ANSI-C toolchain is no longer sufficient for building OpenSSL.
+   The code should be built using compilers supporting C-99 features.
+
+   *Alexandr Nedvědický*
+
+ * Support for the VxWorks platforms has been removed.  These platforms
+   were unadopted, unmaintained and reported to be non-functional.
+
+   *Anthony Ioppolo*
+
+ * Relaxed the path check in OpenSSL's `file:` scheme implementation for
+   `OSSL_STORE`.  Previously, when the `file:` scheme is an explicit part
+   of the URI, our implementation required an absolute path, such as
+   `file:/path/to/file.pem`.  This requirement is now relaxed, allowing
+   `file:path/to/file.pem`, as well as `file:file.pem`.
+
+   *Richard Levitte*
+
+ * Changed `openssl-pkey(1)` to match the documentation when private keys
+   are output in DER format (`-outform DER`) by producing the PKCS#8 form
+   by default.  Previously, this would output the *traditional* form for those
+   older key types (`DSA`, `RSA`, `ECDSA`) that had such a form.  The
+   `-traditional` flag has been extended to support explicit requests to output
+   that format in DER format (it was previously PEM-only).
+
+   *Viktor Dukhovni*
+
+ * Added an `openssl configutl` utility for processing the OpenSSL
+   configuration file and dumping the equal configuration file.
+
+   *Dmitry Belyavskiy based on Clemens Lang's code*
+
+ * Added support for setting a free function thunk to `OPENSSL_sk` stack types.
+   Using a thunk allows the type specific free function to be called
+   with the correct type information from generic functions like
+   `OPENSSL_sk_pop_free()`.
+
+   *Frederik Wedel-Heinen*
+
+ * Enabled x86-64 SM4 optimizations with SM4 ISA Extension available starting
+   Lunar Lake and Arrow Lake S CPUs.  The expected performance improvement
+   is ~3.6x for `sm4-cbc`, ~2.9x for `sm4-gcm`, ~9.2x for `sm4-xts`,
+   ~5.3x for `sm4-ccm` (on average, may vary depending on the data size)
+   on Arrow Lake S.
+
+   *Alina Elizarova*
+
+ * Enabled x86-64 SM3 optimizations with SM3 ISA Extension available starting
+   Lunar Lake and Arrow Lake S CPUs.  The expected performance improvement
+   is ~2.2—4.7x (depends on the data size) on Arrow Lake S.
+
+   *Alina Elizarova*
+
+ * Enabled x86-64 SHA-512 optimizations with SHA512 ISA Extension.
+   Optimized digests: `sha384`, `sha512`, `sha512-224`, `sha512-256`.
+   `openssl speed` shows speedups ranging from 1.6x to 4.5x
+   on the P-cores of Intel Core Ultra 5 238V.
+
+   *Adrian Stanciu*
+
+ * Changed default EC point formats configuration to support only 'uncompressed'
+   format, and added `SSL_OP_LEGACY_EC_POINT_FORMATS` flag and options
+   to re-enable previous default, if required.
+
+   *Tim Perry*
+
+ * Increased PKCS#12 default `macsaltlen` from 8 to 16, as, per NIST
+   [SP 800-132], this improves interoperability for newly generated PKCS#12
+   stores between FIPS and non-FIPS implementations.
+
+   *Dimitri John Ledkov*
+
+ * Added `X509_CRL_get0_tbs_sigalg()` accessor for the signature
+   `AlgorithmIdentifier` inside CRL's `TBSCertList`.
+
+   *Theo Buehler*
+
+ * Added OIDS for HKDFs with SHA-256, SHA-384, and SHA-512.  Added ability
+   to load HKDF configured with these explicit digests by name or OID.
+
+   *Daniel Van Geest (CryptoNext Security)*
+
+ * Added Intel AVX-512 and VAES optimizations for AES-CFB128 algorithms.
+   Encryption performance on large buffers improved by 1.5—1.7x,
+   while decryption speed increased by 20—23x.
+
+   *Adrian Stanciu*
+
+ * Added support for TLS 1.3 OCSP multi-stapling for server certs.
+    * new `s_client` options:
+       * `-ocsp_check_leaf`: Checks the status of the leaf (server) certificate.
+       * `-ocsp_check_all`: Checks the status of all certificates in the server
+         chain.
+    * new `s_server` option:
+       * `-status_all` Provides OCSP status information for the entire server
+         certificate chain (multi-stapling) for TLS 1.3 and later.
+    * Improved `-status_file` option can now be given multiple times to provide
+      multiple files containing OCSP responses.
+
+   *Michael Krueger, Martin Rauch*
+
+ * Added `KEMRecipientInfo` (RFC 9629) and ML-KEM (`draft-ietf-lamps-cms-kyber`)
+   support to CMS.
+
+   *Daniel Van Geest (CryptoNext Security)*
+
+ * Added support for FIPS 186-5 deterministic ECDSA signature
+   generation to the FIPS provider.
+
+   *Dimitri John Ledkov*
+
+OpenSSL 3.5
+-----------
+
 ### Changes between 3.5.3 and 3.5.4 [30 Sep 2025]

  * Fix Out-of-bounds read & write in RFC 3211 KEK Unwrap
@@ -1277,10 +2948,10 @@ OpenSSL 3.5

    *Stanislav Fort and Tomáš Mráz*

- * Fix Out-of-bounds read in HTTP client no_proxy handling
+ * Fix Out-of-bounds read in HTTP client `no_proxy` handling

    Issue summary: An application using the OpenSSL HTTP client API functions
-   may trigger an out-of-bounds read if the "no_proxy" environment variable is
+   may trigger an out-of-bounds read if the `no_proxy` environment variable is
    set and the host portion of the authority component of the HTTP URL is an
    IPv6 address.

@@ -1381,10 +3052,10 @@ OpenSSL 3.5

    *Tomas Mraz*

- * Aligned the behaviour of TLS and DTLS in the event of a no_renegotiation
+ * Aligned the behaviour of TLS and DTLS in the event of a `no_renegotiation`
    alert being received. Older versions of OpenSSL failed with DTLS if a
-   no_renegotiation alert was received. All versions of OpenSSL do this for TLS.
-   From 3.2 a bug was exposed that meant that DTLS ignored no_rengotiation. We
+   `no_renegotiation` alert was received. All versions of OpenSSL do this for TLS.
+   From 3.2 a bug was exposed that meant that DTLS ignored `no_rengotiation`. We
    have now restored the original behaviour and brought DTLS back into line with
    TLS.

@@ -3406,7 +5077,7 @@ breaking changes, and mappings for the large list of deprecated functions.

  * Fixed a bug in the function `OCSP_basic_verify` that verifies the signer
    certificate on an OCSP response. The bug caused the function in the case
-   where the (non-default) flag OCSP_NOCHECKS is used to return a postivie
+   where the (non-default) flag OCSP_NOCHECKS is used to return a positive
    response (meaning a successful verification) even in the case where the
    response signing certificate fails to verify.

@@ -19204,7 +20875,7 @@ s-cbc           3624.96k     5258.21k     5530.91k     5624.30k     5628.26k
    The new configuration file reading functions are:

            NCONF_new, NCONF_free, NCONF_load, NCONF_load_fp, NCONF_load_bio,
-           NCONF_get_section, NCONF_get_string, NCONF_get_numbre
+           NCONF_get_section, NCONF_get_string, NCONF_get_number

            NCONF_default, NCONF_WIN32

@@ -22801,6 +24472,7 @@ ndif
 [CVE-2026-18798]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-18798
 [CVE-2026-22795]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-22795
 [CVE-2026-22796]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-22796
+[CVE-2026-28386]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28386
 [CVE-2026-28387]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28387
 [CVE-2026-28388]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28388
 [CVE-2026-28389]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28389
@@ -22811,14 +24483,17 @@ ndif
 [CVE-2026-34181]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-34181
 [CVE-2026-34182]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-34182
 [CVE-2026-34183]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-34183
+[CVE-2026-35188]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-35188
 [CVE-2026-35189]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-35189
 [CVE-2026-35191]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-35191
 [CVE-2026-42764]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42764
+[CVE-2026-42765]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42765
 [CVE-2026-42766]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42766
 [CVE-2026-42767]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42767
 [CVE-2026-42768]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42768
 [CVE-2026-42769]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42769
 [CVE-2026-42770]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42770
+[CVE-2026-42771]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42771
 [CVE-2026-42772]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42772
 [CVE-2026-45445]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-45445
 [CVE-2026-45446]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-45446
@@ -22827,6 +24502,7 @@ ndif
 [CVE-2026-54873]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54873
 [CVE-2026-54874]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54874
 [CVE-2026-54875]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54875
+[CVE-2026-54876]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54876
 [CVE-2026-63072]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63072
 [CVE-2026-63073]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63073
 [CVE-2026-63074]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63074
@@ -22839,13 +24515,35 @@ ndif
 [CVE-2026-75806]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-75806
 [CVE-2026-77696]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-77696
 [CVE-2026-84782]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-84782
+[CVE-2026-84783]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-84783
 [CVE-2026-84784]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-84784
 [ESV]: https://csrc.nist.gov/Projects/cryptographic-module-validation-program/entropy-validations
 [RFC 2578 (STD 58), section 3.5]: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5
 [RFC 3211]: https://datatracker.ietf.org/doc/html/rfc3211
+[RFC 4492 Section 5.1.2]: https://datatracker.ietf.org/doc/html/rfc4492#section-5.1.2
+[RFC 5280]: https://datatracker.ietf.org/doc/html/rfc5280
+[RFC 5280 Section 6.3.3]: https://datatracker.ietf.org/doc/html/rfc5280#section-6.3.3
 [RFC 5297]: https://datatracker.ietf.org/doc/html/rfc5297
+[RFC 5652]: https://datatracker.ietf.org/doc/html/rfc5652
 [RFC 7250]: https://datatracker.ietf.org/doc/html/rfc7250
+[RFC 7685]: https://datatracker.ietf.org/doc/html/rfc7685
+[RFC 7919]: https://datatracker.ietf.org/doc/html/rfc7919
+[RFC 8422]: https://datatracker.ietf.org/doc/html/rfc8422
+[RFC 8422 Section 5.1.2]: https://datatracker.ietf.org/doc/html/rfc8422#section-5.1.2
 [RFC 8446]: https://datatracker.ietf.org/doc/html/rfc8446
 [RFC 8446 Section 4.6.1]: https://datatracker.ietf.org/doc/html/rfc8446#section-4.6.1
 [RFC 8452]: https://datatracker.ietf.org/doc/html/rfc8452
+[RFC 8701]: https://datatracker.ietf.org/doc/html/rfc8701
+[RFC 8998]: https://datatracker.ietf.org/doc/html/rfc8998#name-iana-considerations
 [RFC 9000]: https://datatracker.ietf.org/doc/html/rfc9000
+[RFC 9147]: https://datatracker.ietf.org/doc/html/rfc9147
+[RFC 9149]: https://datatracker.ietf.org/doc/html/rfc9149
+[RFC 9846]: https://datatracker.ietf.org/doc/html/rfc9846
+[RFC 9846 Section 4.3.10]: https://datatracker.ietf.org/doc/html/rfc9846#section-4.3.10
+[RFC 9849]: https://datatracker.ietf.org/doc/html/rfc9849
+[SECG SEC 1 Section 2.3.4]: https://www.secg.org/sec1-v2.pdf#subsubsection.2.3.4
+[SP 800-132]: https://csrc.nist.gov/pubs/sp/800/132/final
+[SP 800-185]: https://csrc.nist.gov/pubs/sp/800/185/final
+[SP 800-208]: https://csrc.nist.gov/pubs/sp/800/208/final
+[TCG Credential Profiles specification Version 1.2, Section 3.2.7]: https://trustedcomputinggroup.org/wp-content/uploads/Credential_Profiles_V1.2_Level2_Revision8.pdf#page=35
+[tls-hybrid-sm2-mlkem]: https://datatracker.ietf.org/doc/html/draft-yang-tls-hybrid-sm2-mlkem-03#name-iana-considerations
diff --git a/deps/openssl/openssl/CONTRIBUTING.md b/deps/openssl/openssl/CONTRIBUTING.md
index 8a0d40524dd..e4ade85d9bf 100644
--- a/deps/openssl/openssl/CONTRIBUTING.md
+++ b/deps/openssl/openssl/CONTRIBUTING.md
@@ -19,13 +19,40 @@ open an issue for it before starting work, to get comments from the community.
 Someone may be already working on the same thing,
 or there may be special reasons why a feature is not implemented.

-Similarly, if you plan to submit many pull requests, please start with
-a representative sample (no more than 3 or 4) and open an issue
-explaining your process. The OpenSSL project has limited resources,
-especially when it comes to reviewers, so we appreciate advanced
-communication before submitting many pull requests. In addition,
-contributors should personally evaluate potential patches generated by
-automated tools.
+Do not submit changes in bulk.  Review, not authorship, is the scarce
+resource in this project: every pull request consumes the attention of
+at least two committers, and a batch of them submitted together does not get
+reviewed any faster than the same batch submitted over months.  It
+merely displaces the review of everyone else's work, including security
+fixes.
+
+Nor is the answer to bundle them together.  A pull request carrying
+twenty unrelated fixes is harder to review than any one of them alone,
+cannot be merged a piece at a time, and leaves every change in it blocked
+behind the one a reviewer disagrees with.  Each pull request should address
+one logical change (perhaps spread across multiple commits); what has to give
+is how many you submit, not how much you put in each one.
+
+Keep to no more than three or four open pull requests at a time, and let
+those be reviewed to completion before opening more.  If you are working
+through a list of candidate changes, then choose those three or four
+deliberately: send us the ones you consider most important, rather than the
+first on the list or the quickest to write, and explain in each why it
+matters.  You know your list; we do not, and without that ranking the
+judgement of what to look at first falls on the reviewers.  Pull requests
+opened well in excess of this may be closed without review, with a request to
+resubmit at a sustainable rate.
+
+This applies regardless of how good the individual changes are, and it
+is not satisfied by spacing submissions out over a few hours or days.
+
+You are the author of everything you submit, whatever produced the first
+draft of it.  Before opening a pull request you must have read the
+change in full, understood why it is correct, built and tested it
+yourself, and satisfied yourself that the problem it fixes is real.  You
+must be prepared to answer a reviewer's questions about any line of it.  The
+`Assisted-by:` trailer (see below) discloses that a tool was used; it does not
+transfer responsibility for the result.

 Provide a clear description of the issue or feature being addressed,
 including any relevant implementation details and, for performance
@@ -39,6 +66,16 @@ with clear explanations of what is changing and why.  Long descriptions
 are encouraged if they aid understanding.  Commit message titles (their
 first line) should be kept to 50-70 characters if possible.

+Pull Requests (PR's) go through multiple phases before they are merged. In the
+first phase the label 'approval: review pending' is added. Once you receive 2 or
+more approvals from [Committers] the label is changed to 'approval: done' and
+24 hours after this the label changes to 'approval: ready to merge'. At some time
+after this your PR will be merged and the PR is closed. Reviewers may ask you to
+make changes at any phase before the Pull Request is merged, and any changes
+(that are not just a rebase) will require re-approval.
+
+[Committers]: https://openssl-library.org/about/committers/index.html
+
 To make it easier to review and accept your pull request, please follow these
 guidelines:

@@ -117,19 +154,23 @@ guidelines:
     often. We do not accept merge commits, you will have to remove them
     (usually by rebasing) before it will be acceptable.

- 5. Code provided should follow our [coding style] and [documentation policy]
-    and compile without warnings.
-    There is a [Perl tool](util/check-format.pl) that helps
-    finding code formatting mistakes and other coding style nits.
+ 5. Code provided should follow our [coding style](STYLE.md) and
+    [documentation policy](DOCUMENTATION.md) and compile without warnings when
+    using a --strict-warnings configuration.
+
+    Consistent formatting is enforced by using `clang-format` with configuration
+    stored in [.clang-format](.clang-format). OpenSSL uses `WebKit` style.
+    You can configure git pre-commit to automatically reformat your code with
+    [.pre-commit-config.yaml](.pre-commit-config.yaml) configuration.
+    There is also a [Perl tool](util/reformat-patches.sh) to help with
+    reformatting existing patches.
+
     Where `gcc` or `clang` is available, you should use the
     `--strict-warnings` `Configure` option.  OpenSSL compiles on many varied
     platforms: try to ensure you only use portable features.
     Clean builds via GitHub Actions are required. They are started automatically
     whenever a PR is created or updated by committers.

-    [coding style]: https://openssl-library.org/policies/technical/coding-style/
-    [documentation policy]: https://openssl-library.org/policies/technical/documentation-policy/
-
  6. When at all possible, code contributions should include tests. These can
     either be added to an existing test, or completely new.  Please see
     [test/README.md](test/README.md) for information on the test framework.
@@ -152,3 +193,35 @@ guidelines:

  9. Guidelines on how to integrate error output of new crypto library modules
     can be found in [crypto/err/README.md](crypto/err/README.md).
+
+10. Once your Pull Request gets to the stage of being reviewed fixup commits
+    should be used where possible. Fixup commits are squashed when the PR is
+    finally merged. Fixup commits are done in the following way:
+
+    ```
+
+        # Add one or more updated files that needed changes
+        git add <filename>
+
+        # Do a fixup commit
+        # <commit-id> is the id of a previous commit that you want to fix up.
+        git commit --fixup <commit-id>
+
+        # Do a non forced push
+        git push
+    ```
+
+    To view commit-id's use:
+
+    ```
+       git log
+    ```
+
+11. If a Pull Request addresses an [issue](https://github.com/openssl/openssl/issues/)
+    the commit should include the line:
+
+    ```
+        Fixes: LINK
+    ```
+
+    where LINK is the https link to the issue in github.
diff --git a/deps/openssl/openssl/Configurations/00-base-templates.conf b/deps/openssl/openssl/Configurations/00-base-templates.conf
index 86287c3a25a..09295bf846e 100644
--- a/deps/openssl/openssl/Configurations/00-base-templates.conf
+++ b/deps/openssl/openssl/Configurations/00-base-templates.conf
@@ -47,7 +47,7 @@ my %targets=(

 	defines		=>
 	    sub {
-                my @defs = ( 'OPENSSL_BUILDING_OPENSSL' );
+                my @defs = ();
                 push @defs, "BROTLI" unless $disabled{brotli};
                 push @defs, "BROTLI_SHARED" unless $disabled{"brotli-dynamic"};
                 push @defs, "ZLIB" unless $disabled{zlib};
diff --git a/deps/openssl/openssl/Configurations/10-main.conf b/deps/openssl/openssl/Configurations/10-main.conf
index 389b4a839a9..3d044e8045f 100644
--- a/deps/openssl/openssl/Configurations/10-main.conf
+++ b/deps/openssl/openssl/Configurations/10-main.conf
@@ -61,70 +61,6 @@ sub vc_win32_info {
     return $vc_win32_info;
 }

-my $vc_wince_info = {};
-sub vc_wince_info {
-    unless (%$vc_wince_info) {
-        # sanity check
-        $die->('%OSVERSION% is not defined') if (!defined(env('OSVERSION')));
-        $die->('%PLATFORM% is not defined')  if (!defined(env('PLATFORM')));
-        $die->('%TARGETCPU% is not defined') if (!defined(env('TARGETCPU')));
-
-        #
-        # Idea behind this is to mimic flags set by eVC++ IDE...
-        #
-        my $wcevers = env('OSVERSION');                     # WCENNN
-	my $wcevernum;
-	my $wceverdotnum;
-	if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
-	    $wcevernum = "$1$2";
-	    $wceverdotnum = "$1.$2";
-	} else {
-	    $die->('%OSVERSION% value is insane');
-	    $wcevernum = "{unknown}";
-	    $wceverdotnum = "{unknown}";
-	}
-        my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
-        my $wcelflag = "/subsystem:windowsce,$wceverdotnum";        # ...,N.NN
-
-        my $wceplatf =  env('PLATFORM');
-
-        $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
-        $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
-
-        my $wcetgt = env('TARGETCPU');                      # just shorter name...
-      SWITCH: for($wcetgt) {
-          /^X86/        && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
-                                $wcelflag.=" /machine:X86";     last; };
-          /^ARMV4[IT]/  && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
-                                $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
-                                $wcecdefs.=" -QRarch4T -QRinterwork-return";
-                                $wcelflag.=" /machine:THUMB";   last; };
-          /^ARM/        && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
-                                $wcelflag.=" /machine:ARM";     last; };
-          /^MIPSIV/     && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
-                                $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
-                                $wcelflag.=" /machine:MIPSFPU"; last; };
-          /^MIPS16/     && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
-                                $wcecdefs.=" -DMIPSII -QMmips16";
-                                $wcelflag.=" /machine:MIPS16";  last; };
-          /^MIPSII/     && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
-                                $wcecdefs.=" -QMmips2";
-                                $wcelflag.=" /machine:MIPS";    last; };
-          /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
-                                $wcelflag.=" /machine:MIPS";    last; };
-          /^SH[0-9]/    && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx";
-                                $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
-                                $wcelflag.=" /machine:$wcetgt"; last; };
-          { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
-            $wcelflag.=" /machine:$wcetgt";                     last; };
-      }
-
-        $vc_wince_info = { cppflags => $wcecdefs,
-                           lflags => $wcelflag };
-    }
-    return $vc_wince_info;
-}
-
 # Helper functions for the VMS configs
 my $vms_info = {};
 sub vms_info {
@@ -258,7 +194,7 @@ my %targets = (
         # gcc shared build with Sun C. Given that gcc generates faster
         # code [thanks to inline assembler], I would actually recommend
         # to consider using gcc shared build even with vendor compiler:-)
-        #                        -- <appro@openssl.org>
+        #                        -- <https://github.com/dot-asm>
         inherit_from     => [ "solaris-common-gcc" ],
         CC               => "gcc",
         CFLAGS           => add_before(picker(default => "-Wall",
@@ -680,13 +616,13 @@ my %targets = (
         CXX              => "g++",
         CFLAGS           => picker(default => "-Wall",
                                    debug   => "-O0 -g",
-                                   release => "-O3"),
+                                   release => "-O3",
+                                   pgo => "-O3 -fprofile-use -Wno-coverage-mismatch"),
         CXXFLAGS         => picker(default => "-Wall",
                                    debug   => "-O0 -g",
                                    release => "-O3"),
         cflags           => threads("-pthread"),
         cxxflags         => combine("-std=c++11", threads("-pthread")),
-        lib_cppflags     => "-DOPENSSL_USE_NODELETE",
         ex_libs          => add("-ldl", threads("-pthread")),
         bn_ops           => "BN_LLONG RC4_CHAR",
         thread_scheme    => "pthreads",
@@ -694,7 +630,6 @@ my %targets = (
         shared_target    => "linux-shared",
         shared_cflag     => "-fPIC",
         shared_ldflag    => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
-        enable           => [ "afalgeng" ],
     },
     "linux-latomic" => {
         inherit_from     => [ "linux-generic32" ],
@@ -971,7 +906,6 @@ my %targets = (
         perlasm_scheme   => 'void',
     },
     "linux64-sparcv9" => {
-        # GCC 3.1 is a requirement
         inherit_from     => [ "linux-generic64" ],
         cflags           => add("-m64 -mcpu=ultrasparc"),
         cxxflags         => add("-m64 -mcpu=ultrasparc"),
@@ -1027,7 +961,6 @@ my %targets = (
         cflags           => threads("-pthread"),
         cppflags         => threads("-D_THREAD_SAFE -D_REENTRANT"),
         ex_libs          => add(threads("-pthread")),
-        enable           => add("devcryptoeng"),
         bn_ops           => "BN_LLONG",
         thread_scheme    => "pthreads",
         dso_scheme       => "dlfcn",
@@ -1201,7 +1134,6 @@ my %targets = (
         cflags           => threads("-pthread"),
         cppflags         => threads("-D_THREAD_SAFE -D_REENTRANT"),
         ex_libs          => add(threads("-pthread")),
-        enable           => add("devcryptoeng"),
         bn_ops           => "BN_LLONG",
         thread_scheme    => "pthreads",
         dso_scheme       => "dlfcn",
@@ -1502,7 +1434,7 @@ my %targets = (

 #### Visual C targets
 #
-# Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64
+# Win64 target, WIN64A denotes AMD64
 #
 # Note about /wd4090, disable warning C4090. This warning returns false
 # positives in some situations. Disabling it altogether masks both
@@ -1544,10 +1476,10 @@ my %targets = (
                                 "UNICODE", "_UNICODE",
                                 "_CRT_SECURE_NO_DEPRECATE",
                                 "_WINSOCK_DEPRECATED_NO_WARNINGS"),
-        lib_cflags       => add("/Zi /Fdossl_static.pdb"),
+        lib_cflags       => add("/Z7"),
         lib_defines      => add("L_ENDIAN"),
-        dso_cflags       => "/Zi /Fddso.pdb",
-        bin_cflags       => "/Zi /Fdapp.pdb",
+        dso_cflags       => "/Z7",
+        bin_cflags       => "/Z7",
         # def_flag made to empty string so a .def file gets generated
         shared_defflag   => '',
         shared_ldflag    => "/dll",
@@ -1569,11 +1501,11 @@ my %targets = (
         cflags           => add(picker(default => '/GF /Gy',
                                        debug   =>
                                        sub {
-                                           ($disabled{shared} ? "" : "/MDd");
+                                           ($disabled{shared} ? "" : ($disabled{"static-vcruntime"} ? "/MDd" : ($disabled{threads} ? "" : "/MTd")));
                                        },
                                        release =>
                                        sub {
-                                           ($disabled{shared} ? "" : "/MD");
+                                           ($disabled{shared} ? "" : ($disabled{"static-vcruntime"} ? "/MD": ($disabled{threads} ? "" : "/MT")));
                                        })),
         defines          => add(picker(default => [], # works as type cast
                                        debug   => [ "DEBUG", "_DEBUG" ])),
@@ -1610,17 +1542,6 @@ my %targets = (
         }),
         bn_ops           => add("SIXTY_FOUR_BIT"),
     },
-    "VC-WIN64I" => {
-        inherit_from     => [ "VC-WIN64-common" ],
-        AS               => "ias",
-        ASFLAGS          => "-d debug",
-        asoutflag        => "-o ",
-        sys_id           => "WIN64I",
-        uplink_arch      => 'ia64',
-        asm_arch         => 'ia64',
-        perlasm_scheme   => "ias",
-        multilib         => "-ia64",
-    },
     "VC-WIN64A" => {
         inherit_from     => [ "VC-WIN64-common" ],
         AS               => sub { vc_win64a_info()->{AS} },
@@ -1648,53 +1569,6 @@ my %targets = (
         # some installation path heuristics in windows-makefile.tmpl...
         build_scheme     => add("VC-WOW", { separator => undef }),
     },
-    "VC-CE" => {
-        inherit_from     => [ "VC-common" ],
-        CFLAGS           => add(picker(debug   => "/Od",
-                                       release => "/O1i")),
-        CPPDEFINES       => picker(debug   => [ "DEBUG", "_DEBUG" ]),
-        LDFLAGS          => add("/nologo /opt:ref"),
-        cflags           =>
-            combine('/GF /Gy',
-                    sub { vc_wince_info()->{cflags}; },
-                    sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
-                              ? ($disabled{shared} ? " /MT" : " /MD")
-                              : " /MC"; }),
-        cppflags         => sub { vc_wince_info()->{cppflags}; },
-        lib_defines      => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"),
-        lib_cppflags     => sub { vc_wince_info()->{cppflags}; },
-        includes         =>
-            add(combine(sub { defined(env('WCECOMPAT'))
-                              ? '$(WCECOMPAT)/include' : (); },
-                        sub { defined(env('PORTSDK_LIBPATH'))
-                                  ? '$(PORTSDK_LIBPATH)/../../include'
-                                  : (); })),
-        lflags           => add(combine(sub { vc_wince_info()->{lflags}; },
-                                        sub { defined(env('PORTSDK_LIBPATH'))
-                                                  ? "/entry:mainCRTstartup" : (); })),
-        sys_id           => "WINCE",
-        bn_ops           => add("BN_LLONG"),
-        ex_libs          => add(sub {
-            my @ex_libs = ();
-            push @ex_libs, 'ws2.lib' unless $disabled{sock};
-            push @ex_libs, 'crypt32.lib';
-            if (defined(env('WCECOMPAT'))) {
-                my $x = '$(WCECOMPAT)/lib';
-                if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
-                    $x .= '/$(TARGETCPU)/wcecompatex.lib';
-                } else {
-                    $x .= '/wcecompatex.lib';
-                }
-                push @ex_libs, $x;
-            }
-            push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
-                if (defined(env('PORTSDK_LIBPATH')));
-            push @ex_libs, '/nodefaultlib coredll.lib corelibc.lib'
-                if (env('TARGETCPU') =~ /^X86|^ARMV4[IT]/);
-            return join(" ", @ex_libs);
-        }),
-    },
-
 #### MinGW
     "mingw-common" => {
         inherit_from     => [ 'BASE_unix' ],
@@ -1706,7 +1580,7 @@ my %targets = (
         cppflags         => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
                                     threads("-D_MT")),
         lib_cppflags     => "-DL_ENDIAN",
-        ex_libs          => add("-lws2_32 -lgdi32 -lcrypt32"),
+        ex_libs          => add("-lws2_32 -lgdi32 -lcrypt32 -lbcrypt"),
         thread_scheme    => "winthreads",
         dso_scheme       => "win32",
         shared_target    => "mingw-shared",
@@ -1747,6 +1621,18 @@ my %targets = (
         multilib         => "64",
     },

+    "mingwarm64" => {
+        inherit_from     => [ "mingw-common" ],
+        cflags           => "",
+        sys_id           => "MINGWARM64",
+        bn_ops           => add("SIXTY_FOUR_BIT"),
+        asm_arch         => 'aarch64',
+        uplink_arch      => 'armv8',
+        perlasm_scheme   => "win64",
+        shared_rcflag    => "",
+        multilib         => "-arm64",
+    },
+
 #### UEFI
     "UEFI" => {
         inherit_from     => [ "BASE_unix" ],
@@ -1847,37 +1733,6 @@ my %targets = (
         shared_cflag     => "-fPIC",
         shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
     },
-    # Option "freeze" such as -std=gnu9x can't negatively interfere
-    # with future defaults for below two targets, because MacOS X
-    # for PPC has no future, it was discontinued by vendor in 2009.
-    "darwin-ppc-cc" => { inherit_from => [ "darwin-ppc" ] }, # Historic alias
-    "darwin-ppc" => {
-        inherit_from     => [ "darwin-common" ],
-        cflags           => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
-        lib_cppflags     => add("-DB_ENDIAN"),
-        shared_cflag     => add("-fno-common"),
-        asm_arch         => 'ppc32',
-        perlasm_scheme   => "osx32",
-    },
-    "darwin64-ppc-cc" => { inherit_from => [ "darwin64-ppc" ] }, # Historic alias
-    "darwin64-ppc" => {
-        inherit_from     => [ "darwin-common" ],
-        cflags           => add("-arch ppc64 -std=gnu9x"),
-        lib_cppflags     => add("-DB_ENDIAN"),
-        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
-        asm_arch         => 'ppc64',
-        perlasm_scheme   => "osx64",
-    },
-    "darwin-i386-cc" => { inherit_from => [ "darwin-i386" ] }, # Historic alias
-    "darwin-i386" => {
-        inherit_from     => [ "darwin-common" ],
-        CFLAGS           => add(picker(release => "-fomit-frame-pointer")),
-        cflags           => add("-arch i386"),
-        lib_cppflags     => add("-DL_ENDIAN"),
-        bn_ops           => "BN_LLONG RC4_INT",
-        asm_arch         => 'x86',
-        perlasm_scheme   => "macosx",
-    },
     "darwin64-x86_64-cc" => { inherit_from => [ "darwin64-x86_64" ] }, # Historic alias
     "darwin64-x86_64" => {
         inherit_from     => [ "darwin-common" ],
@@ -1949,109 +1804,6 @@ my %targets = (
         multilib         => "64",
     },

-##### VxWorks for various targets
-    "vxworks-ppc60x" => {
-        inherit_from     => [ "BASE_unix" ],
-        CC               => "ccppc",
-        CFLAGS           => "-O2 -Wall -fstrength-reduce",
-        cflags           => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing",
-        cppflags         => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
-                                    "_DTOOL_FAMILY=gnu -DTOOL=gnu",
-                                    "-I\$(WIND_BASE)/target/usr/h",
-                                    "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
-        sys_id           => "VXWORKS",
-        lflags           => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
-        ex_libs          => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
-    },
-    "vxworks-ppcgen" => {
-        inherit_from     => [ "BASE_unix" ],
-        CC               => "ccppc",
-        CFLAGS           => "-O1 -Wall",
-        cflags           => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
-        cppflags         => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
-                                    "-DTOOL_FAMILY=gnu -DTOOL=gnu",
-                                    "-I\$(WIND_BASE)/target/usr/h",
-                                    "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
-        sys_id           => "VXWORKS",
-        lflags           => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
-        ex_libs          => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
-    },
-    "vxworks-ppc405" => {
-        inherit_from     => [ "BASE_unix" ],
-        CC               => "ccppc",
-        CFLAGS           => "-g",
-        cflags           => "-msoft-float -mlongcall",
-        cppflags         => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
-                                    "-DTOOL_FAMILY=gnu -DTOOL=gnu",
-                                    "-I\$(WIND_BASE)/target/h"),
-        sys_id           => "VXWORKS",
-        lflags           => add("-r"),
-    },
-    "vxworks-ppc750" => {
-        inherit_from     => [ "BASE_unix" ],
-        CC               => "ccppc",
-        CFLAGS           => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
-        cflags           => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
-        cppflags         => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
-                                    "-I\$(WIND_BASE)/target/h"),
-        sys_id           => "VXWORKS",
-        lflags           => add("-r"),
-    },
-    "vxworks-ppc750-debug" => {
-        inherit_from     => [ "BASE_unix" ],
-        CC               => "ccppc",
-        CFLAGS           => "-ansi -fvolatile -Wall -g",
-        cflags           => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
-        cppflags         => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
-                                    "-DPEDANTIC -DDEBUG",
-                                    "-I\$(WIND_BASE)/target/h"),
-        sys_id           => "VXWORKS",
-        lflags           => add("-r"),
-    },
-    "vxworks-ppc860" => {
-        inherit_from     => [ "BASE_unix" ],
-        CC               => "ccppc",
-        cflags           => "-nostdinc -msoft-float",
-        cppflags         => combine("-DCPU=PPC860 -DNO_STRINGS_H",
-                                    "-I\$(WIND_BASE)/target/h"),
-        sys_id           => "VXWORKS",
-        lflags           => add("-r"),
-    },
-    "vxworks-simlinux" => {
-        inherit_from     => [ "BASE_unix" ],
-        CC               => "ccpentium",
-        cflags           => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
-        cppflags         => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
-                                    "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
-                                    "-DTOOL_FAMILY=gnu -DTOOL=gnu",
-                                    "-DOPENSSL_NO_HW_PADLOCK",
-                                    "-I\$(WIND_BASE)/target/h",
-                                    "-I\$(WIND_BASE)/target/h/wrn/coreip"),
-        sys_id           => "VXWORKS",
-        lflags           => add("-r"),
-        ranlib           => "ranlibpentium",
-    },
-    "vxworks-mips" => {
-        inherit_from     => [ "BASE_unix" ],
-        CC               => "ccmips",
-        CFLAGS           => "-O -G 0",
-        cflags           => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop",
-        cppflags         => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
-                                    "-DCPU=MIPS32 -DNO_STRINGS_H",
-                                    "-DTOOL_FAMILY=gnu -DTOOL=gnu",
-                                    "-DOPENSSL_NO_HW_PADLOCK",
-                                    threads("-D_REENTRANT"),
-                                    "-I\$(WIND_BASE)/target/h",
-                                    "-I\$(WIND_BASE)/target/h/wrn/coreip"),
-        sys_id           => "VXWORKS",
-        lflags           => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
-        ex_libs          => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
-        thread_scheme    => "pthreads",
-        asm_arch         => 'mips32',
-        perlasm_scheme   => "o32",
-        ranlib           => "ranlibmips",
-    },
-
 #### uClinux
     "uClinux-dist" => {
         inherit_from     => [ "BASE_unix" ],
@@ -2098,8 +1850,7 @@ my %targets = (
                               ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
         cflag_incfirst   => '/FIRST_INCLUDE=',
         lib_defines      =>
-            add("OPENSSL_USE_NODELETE",
-                "_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED=1",
+            add("_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED=1",
                 sub {
                     return vms_info()->{def_zlib}
                         ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
@@ -2132,7 +1883,7 @@ my %targets = (
         asflags          => sub { vms_info()->{asflags} },
         perlasm_scheme   => sub { vms_info()->{perlasm_scheme} },

-        disable          => add('pinshared', 'loadereng'),
+        disable          => add('pinshared'),

     },

diff --git a/deps/openssl/openssl/Configurations/15-android.conf b/deps/openssl/openssl/Configurations/15-android.conf
index 1de6b7a9157..26d9d6508f5 100644
--- a/deps/openssl/openssl/Configurations/15-android.conf
+++ b/deps/openssl/openssl/Configurations/15-android.conf
@@ -232,6 +232,7 @@ my %targets = (
         bn_ops           => add("RC4_CHAR"),
         asm_arch         => 'aarch64',
         perlasm_scheme   => "linux64",
+        shared_ldflag    => add("-Wl,-z,max-page-size=16384"),
     },

     "android-mips" => {
@@ -269,6 +270,7 @@ my %targets = (
         bn_ops           => add("RC4_INT"),
         asm_arch         => 'x86_64',
         perlasm_scheme   => "elf",
+        shared_ldflag    => add("-Wl,-z,max-page-size=16384"),
     },

     "android-riscv64" => {
diff --git a/deps/openssl/openssl/Configurations/50-djgpp.conf b/deps/openssl/openssl/Configurations/50-djgpp.conf
index fbe4911c420..4b6861dc08f 100644
--- a/deps/openssl/openssl/Configurations/50-djgpp.conf
+++ b/deps/openssl/openssl/Configurations/50-djgpp.conf
@@ -7,9 +7,9 @@ my %targets = (
         inherit_from     => [ "BASE_unix" ],
         CC               => "gcc",
         CFLAGS           => "-fomit-frame-pointer -O2 -Wall",
-        cflags           => "-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN",
+        cflags           => "-I\$(WATT_ROOT)/inc -DTERMIOS -DL_ENDIAN",
         sys_id           => "MSDOS",
-        lflags           => add("-L/dev/env/WATT_ROOT/lib"),
+        lflags           => add("-L\$(WATT_ROOT)/lib"),
         ex_libs          => add("-lwatt"),
         bn_ops           => "BN_LLONG",
         asm_arch         => 'x86',
diff --git a/deps/openssl/openssl/Configurations/50-e2k.conf b/deps/openssl/openssl/Configurations/50-e2k.conf
new file mode 100644
index 00000000000..8bcad65087e
--- /dev/null
+++ b/deps/openssl/openssl/Configurations/50-e2k.conf
@@ -0,0 +1,20 @@
+## -*- mode: perl; -*-
+(
+    "linux-e2k" => {
+        inherit_from    => [ "linux-generic64" ],
+        cflags          => add("-m64"),
+        cxxflags        => add("-m64"),
+        lib_cppflags    => add("-DL_ENDIAN"),
+        multilib        => "64",
+        bn_ops          => "SIXTY_FOUR_BIT_LONG",
+        asm_arch        => "e2k",
+    },
+    "linux-e2kv6" => {
+        inherit_from    => [ "linux-e2k" ],
+        asm_arch        => "e2kv6",
+    },
+    "linux-e2kv7" => {
+        inherit_from    => [ "linux-e2k" ],
+        asm_arch        => "e2kv7",
+    },
+);
diff --git a/deps/openssl/openssl/Configurations/50-masm.conf b/deps/openssl/openssl/Configurations/50-masm.conf
index 587a1e70e8e..9cb767cefef 100644
--- a/deps/openssl/openssl/Configurations/50-masm.conf
+++ b/deps/openssl/openssl/Configurations/50-masm.conf
@@ -18,5 +18,6 @@ my %targets = (
         uplink_arch      => 'x86_64',
         asm_arch         => 'x86_64',
         perlasm_scheme   => "masm",
+        multilib         => "-x64",
     },
 );
diff --git a/deps/openssl/openssl/Configurations/50-nonstop.conf b/deps/openssl/openssl/Configurations/50-nonstop.conf
index 24ab6009fcf..633d5ed6a04 100644
--- a/deps/openssl/openssl/Configurations/50-nonstop.conf
+++ b/deps/openssl/openssl/Configurations/50-nonstop.conf
@@ -22,7 +22,6 @@
         ex_libs          => add('-lrld'),
         enable           => ['egd'],
 	# Not currently inherited
-        disable          => ['atexit'],
         dso_scheme       => 'DLFCN',
         sys_id           => 'TANDEM',
     },
@@ -191,7 +190,7 @@
                               'nonstop-archenv-x86_64-oss',
                               'nonstop-ilp32',
                               'nonstop-efloat-x86_64' ],
-        disable          => ['threads','atexit'],
+        disable          => ['threads'],
     },
     'nonstop-nsx_put' => {
         inherit_from     => [ 'nonstop-common',
@@ -201,7 +200,6 @@
                               'nonstop-model-put' ],
         multilib         => '-put',
         multibin         => '-put',
-        disable          => ['atexit'],
     },
     'nonstop-nsx_64' => {
         inherit_from     => [ 'nonstop-common',
@@ -210,7 +208,7 @@
                               'nonstop-efloat-x86_64' ],
         multilib         => '64',
         multibin         => '64',
-        disable          => ['threads','atexit'],
+        disable          => ['threads'],
     },
     'nonstop-nsx_64_put' => {
         inherit_from     => [ 'nonstop-common',
@@ -220,7 +218,6 @@
                               'nonstop-model-put' ],
         multilib         => '64-put',
         multibin         => '64-put',
-        disable          => ['atexit'],
     },
     'nonstop-nsx_64_klt' => {
         inherit_from     => [ 'nonstop-common',
@@ -230,19 +227,18 @@
                               'nonstop-model-klt' ],
         multilib         => '64-klt',
         multibin         => '64-klt',
-        disable          => ['atexit'],
     },
     'nonstop-nsx_g' => {
         inherit_from     => [ 'nonstop-common',
                               'nonstop-archenv-x86_64-guardian',
                               'nonstop-ilp32', 'nonstop-nfloat-x86_64' ],
-        disable          => ['threads','atexit'],
+        disable          => ['threads'],
     },
     'nonstop-nsx_g_tandem' => {
         inherit_from     => [ 'nonstop-common',
                               'nonstop-archenv-x86_64-guardian',
                               'nonstop-ilp32', 'nonstop-tfloat-x86_64' ],
-        disable          => ['threads','atexit'],
+        disable          => ['threads'],
     },
     'nonstop-nsv' => {
         inherit_from     => [ 'nonstop-nsx' ],
@@ -252,7 +248,7 @@
                               'nonstop-archenv-itanium-oss',
                               'nonstop-ilp32',
                               'nonstop-efloat-itanium' ],
-        disable          => ['threads','atexit'],
+        disable          => ['threads'],
     },
     'nonstop-nse_put' => {
         inherit_from     => [ 'nonstop-common',
@@ -262,7 +258,6 @@
                               'nonstop-model-put' ],
         multilib         => '-put',
         multibin         => '-put',
-        disable          => ['atexit'],
     },
     'nonstop-nse_64' => {
         inherit_from     => [ 'nonstop-common',
@@ -271,7 +266,7 @@
                               'nonstop-efloat-itanium' ],
         multilib         => '64',
         multibin         => '64',
-        disable          => ['threads','atexit'],
+        disable          => ['threads'],
     },
     'nonstop-nse_64_put' => {
         inherit_from     => [ 'nonstop-common',
@@ -281,5 +276,4 @@
                               'nonstop-model-put' ],
         multilib         => '64-put',
         multibin         => '64-put',
-        disable          => ['atexit'],
     },
diff --git a/deps/openssl/openssl/Configurations/50-win-hybridcrt.conf b/deps/openssl/openssl/Configurations/50-win-hybridcrt.conf
index 242583c7281..ddd4636a628 100644
--- a/deps/openssl/openssl/Configurations/50-win-hybridcrt.conf
+++ b/deps/openssl/openssl/Configurations/50-win-hybridcrt.conf
@@ -34,4 +34,13 @@ my %targets = (
         lflags          => add(picker(debug   => "/NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib",
                                       release => "/NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")),
     },
+        "VC-WIN64-ARM-HYBRIDCRT" => {
+        inherit_from    => [ "VC-WIN64-ARM" ],
+        cflags          => sub {
+            remove_from_flags(qr/\/MDd?\s/, add(picker(debug   => "/MTd",
+                                                       release => "/MT"))->(@_))
+        },
+        lflags          => add(picker(debug   => "/NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib",
+                                      release => "/NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")),
+    },
 );
diff --git a/deps/openssl/openssl/Configurations/50-win-msvc2013.conf b/deps/openssl/openssl/Configurations/50-win-msvc2013.conf
new file mode 100644
index 00000000000..755144376e4
--- /dev/null
+++ b/deps/openssl/openssl/Configurations/50-win-msvc2013.conf
@@ -0,0 +1,19 @@
+## -*- mode: perl; -*-
+# Windows MSVC 2013 compatibility targets.
+#
+# Visual Studio versions earlier than VS 2015 (_MSC_VER < 1900) do not
+# provide the C99 snprintf or vsnprintf functions, and their
+# _snprintf / _vsnprintf counterparts have non-C99 semantics.  These
+# target variants build in a small compatibility source file that
+# supplies C99 snprintf and vsnprintf.
+
+my %targets = (
+    "VC-WIN32-MSVC2013" => {
+        inherit_from              => [ "VC-WIN32" ],
+        needs_c99_snprintf_compat => 1,
+    },
+    "VC-WIN64A-MSVC2013" => {
+        inherit_from              => [ "VC-WIN64A" ],
+        needs_c99_snprintf_compat => 1,
+    },
+);
diff --git a/deps/openssl/openssl/Configurations/descrip.mms.tmpl b/deps/openssl/openssl/Configurations/descrip.mms.tmpl
index db6a1b17997..adfd448f9f2 100644
--- a/deps/openssl/openssl/Configurations/descrip.mms.tmpl
+++ b/deps/openssl/openssl/Configurations/descrip.mms.tmpl
@@ -56,13 +56,8 @@
       map { platform->sharedname($_) // () }
       grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
       @{$unified_info{libraries}};
-  our @install_engines =
-      grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
-             && $unified_info{attributes}->{modules}->{$_}->{engine} }
-      @{$unified_info{modules}};
   our @install_modules =
       grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
-             && !$unified_info{attributes}->{modules}->{$_}->{engine}
              && !$unified_info{attributes}->{modules}->{$_}->{fips} }
       @{$unified_info{modules}};
   our @install_fipsmodules =
@@ -109,7 +104,6 @@
                 @{$config{lib_defines}}, @{$config{shared_defines}},
                 @cnf_defines,
                 'OPENSSLDIR="""$(OPENSSLDIR_C)"""',
-                'ENGINESDIR="""$(ENGINESDIR_C)"""',
                 'MODULESDIR="""$(MODULESDIR_C)"""'
                 )
       . '$(DEFINES)'
@@ -353,7 +347,6 @@ GENERATED={- # common0.tmpl provides @generated

 INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @install_libs) -}
 INSTALL_SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @install_shlibs) -}
-INSTALL_ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @install_engines) -}
 INSTALL_MODULES={- join(", ", map { "-\n\t".$_.".EXE" } @install_modules) -}
 INSTALL_FIPSMODULE={- join(", ", map { "-\n\t".$_.".EXE" } @install_fipsmodules) -}
 INSTALL_FIPSMODULECONF=[.providers]fipsmodule.cnf
@@ -387,8 +380,6 @@ OPENSSLDIR={- catdir($config{openssldir}) or
                               : "SYS\$COMMON:[OPENSSL-COMMON]" -}
 # The same, but for C
 OPENSSLDIR_C={- platform->osslprefix() -}DATAROOT:[000000]
-# Where installed ENGINE modules reside, for C
-ENGINESDIR_C={- platform->osslprefix() -}ENGINES{- $sover_dirname.$target{pointer_size} -}:
 # Where modules reside, for C
 MODULESDIR_C={- platform->osslprefix() -}MODULES{- $target{pointer_size} -}:

@@ -491,6 +482,8 @@ NODEBUG=@
 {- dependmagic('build_libs'); -} : build_libs_nodep
 {- dependmagic('build_modules'); -} : build_modules_nodep
 {- dependmagic('build_programs'); -} : build_programs_nodep
+{- dependmagic('build_inst_sw'); -} : build_libs_nodep, build_modules_nodep, build_inst_programs_nodep
+{- dependmagic('build_inst_programs'); -} : build_inst_programs_nodep

 build_generated_pods : $(GENERATED_PODS)
 build_docs : build_html_docs
@@ -500,6 +493,7 @@ build_generated : $(GENERATED_MANDATORY)
 build_libs_nodep : $(LIBS), $(SHLIBS)
 build_modules_nodep : $(MODULES)
 build_programs_nodep : $(PROGRAMS), $(SCRIPTS)
+build_inst_programs_nodep : $(INSTALL_PROGRAMS), $(SCRIPTS)

 # Kept around for backward compatibility
 build_apps build_tests : build_programs
@@ -595,10 +589,10 @@ depend : descrip.mms

 # Install helper targets #############################################

-install_sw : install_dev install_engines install_modules -
+install_sw : install_dev install_modules -
              install_runtime install_startup install_ivp

-uninstall_sw : uninstall_dev uninstall_modules uninstall_engines -
+uninstall_sw : uninstall_dev uninstall_modules -
                uninstall_runtime uninstall_startup uninstall_ivp

 install_docs : install_html_docs
@@ -606,7 +600,7 @@ install_docs : install_html_docs
 uninstall_docs : uninstall_html_docs

 {- output_off() if $disabled{fips}; "" -}
-install_fips : build_sw $(INSTALL_FIPSMODULECONF)
+install_fips : build_inst_sw $(INSTALL_FIPSMODULECONF)
 	@ WRITE SYS$OUTPUT "*** Installing FIPS module"
 	- CREATE/DIR ossl_installroot:[MODULES{- $target{pointer_size} -}.'arch']
 	- CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[000000]
@@ -657,15 +651,6 @@ install_dev : check_INSTALLTOP install_runtime_libs
                 map { "COPY/PROT=W:R $_.OLB ossl_installroot:[LIB.'arch']" }
                 @install_libs) -}

-install_engines : check_INSTALLTOP install_runtime_libs build_modules
-        @ {- output_off() unless scalar @install_engines; "" -} !
-        @ WRITE SYS$OUTPUT "*** Installing engines"
-        - CREATE/DIR ossl_installroot:[ENGINES{- $sover_dirname.$target{pointer_size} -}.'arch']
-        {- join("\n        ",
-                map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[ENGINES$sover_dirname$target{pointer_size}.'arch']" }
-                @install_engines) -}
-        @ {- output_on() unless scalar @install_engines; "" -} !
-
 install_modules : check_INSTALLTOP install_runtime_libs build_modules
         @ {- output_off() unless scalar @install_modules; "" -} !
         @ WRITE SYS$OUTPUT "*** Installing modules"
@@ -687,7 +672,7 @@ install_runtime_libs : check_INSTALLTOP build_libs
                 @install_shlibs) -}
         @ {- output_on() if $disabled{shared}; "" -} !

-install_programs : check_INSTALLTOP install_runtime_libs build_programs
+install_programs : check_INSTALLTOP install_runtime_libs build_inst_programs
         @ {- output_off() if $disabled{apps}; "" -} !
         @ ! Install the main program
         - CREATE/DIR ossl_installroot:[EXE.'arch']
@@ -947,7 +932,9 @@ EOF
       } elsif (-f $inprologue) {
           my $local_scripture .= <<"EOF";
 $outprologue : $inprologue
+	IF F$SEARCH("$outprologue") .EQS. "" SET FILE/PROT=(O:RWD) $outprologue
 	COPY $inprologue $outprologue
+	SET FILE/PROT=(O:RD) $outprologue
 EOF
           $includefile_cache{$outprologue} = $local_scripture;

@@ -959,7 +946,9 @@ EOF
       } elsif (-f $inepilogue) {
           my $local_scripture .= <<"EOF";
 $outepilogue : $inepilogue
+	IF F$SEARCH("$outepilogue") .EQS. "" SET FILE/PROT=(O:RWD) $outepilogue
 	COPY $inepilogue $outepilogue
+	SET FILE/PROT=(O:RD) $outepilogue
 EOF
           $includefile_cache{$outepilogue} = $local_scripture;

@@ -1113,7 +1102,9 @@ EOF

           return <<"EOF";
 $args{src} : $gen0 $deps
+	IF F$SEARCH("\$\@") .EQS. "" SET FILE/PROT=(O:RWD) \$\@
 	\$(PERL)$perlmodules $dofile "-o$target{build_file}" $gen0$gen_args > \$\@
+	SET FILE/PROT=(O:RD) \$\@
 $decc_include_scripture
 EOF
       } elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) {
@@ -1476,10 +1467,11 @@ EOF
                            rel2abs($config{builddir}));
       return <<"EOF";
 $script : $sources configdata.pm
-        \$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile -
+	IF F$SEARCH("$script") .EQS. "" SET FILE/PROT=(S:RWED,O:RWED,G:RE,W:RE) $script
+	\$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile -
 	    "-o$target{build_file}" $sources > $script
-        SET FILE/PROT=(S:RWED,O:RWED,G:RE,W:RE) $script
-        PURGE $script
+	SET FILE/PROT=(S:RWED,O:RE,G:RE,W:RE) $script
+	PURGE $script
 EOF
   }
   ""    # Important!  This becomes part of the template result.
diff --git a/deps/openssl/openssl/Configurations/unix-Makefile.tmpl b/deps/openssl/openssl/Configurations/unix-Makefile.tmpl
index 5bf397eba02..f8a5b1612ed 100644
--- a/deps/openssl/openssl/Configurations/unix-Makefile.tmpl
+++ b/deps/openssl/openssl/Configurations/unix-Makefile.tmpl
@@ -11,6 +11,7 @@
      our $makedepcmd = platform->makedepcmd();

      sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ }
+     sub run_on_windows { $^O =~ /^(?:cygwin|msys|MSWin32)/ }

      # Shared AIX support is special. We put libcrypto[64].so.ver into
      # libcrypto.a and use libcrypto_a.a as static one, unless using
@@ -184,20 +185,11 @@ INSTALL_SHLIB_INFO={-
                         grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
                         @{$unified_info{libraries}}))
 -}
-INSTALL_ENGINES={-
-        join(" \\\n" . ' ' x 16,
-             fill_lines(" ", $COLUMNS - 16,
-                        map { platform->dso($_) }
-                        grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
-                               && $unified_info{attributes}->{modules}->{$_}->{engine} }
-                        @{$unified_info{modules}}))
--}
 INSTALL_MODULES={-
         join(" \\\n" . ' ' x 16,
              fill_lines(" ", $COLUMNS - 16,
                         map { platform->dso($_) }
                         grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
-                               && !$unified_info{attributes}->{modules}->{$_}->{engine}
                                && !$unified_info{attributes}->{modules}->{$_}->{fips} }
                         @{$unified_info{modules}}))
 -}
@@ -249,18 +241,22 @@ MISC_SCRIPTS={-
 IMAGEDOCS1={-
         join(" \\\n" . ' ' x 10,
              fill_lines(" ", $COLUMNS - 10,
+                        map { '$(SRCDIR)/'.$_ }
                         @{$unified_info{imagedocs}->{man1}})) -}
 IMAGEDOCS3={-
         join(" \\\n" . ' ' x 10,
              fill_lines(" ", $COLUMNS - 10,
+                        map { '$(SRCDIR)/'.$_ }
                         @{$unified_info{imagedocs}->{man3}})) -}
 IMAGEDOCS5={-
         join(" \\\n" . ' ' x 10,
              fill_lines(" ", $COLUMNS - 10,
+                        map { '$(SRCDIR)/'.$_ }
                         @{$unified_info{imagedocs}->{man5}})) -}
 IMAGEDOCS7={-
         join(" \\\n" . ' ' x 10,
              fill_lines(" ", $COLUMNS - 10,
+                        map { '$(SRCDIR)/'.$_ }
                         @{$unified_info{imagedocs}->{man7}})) -}
 HTMLDOCS1={-
         join(" \\\n" . ' ' x 10,
@@ -278,6 +274,17 @@ HTMLDOCS7={-
         join(" \\\n" . ' ' x 10,
              fill_lines(" ", $COLUMNS - 10,
                         @{$unified_info{htmldocs}->{man7}})) -}
+
+# The pods every HTML page is made from, which is what the whole set is
+# converted from in one go.  Each page's pod is the first element of its
+# generator, the same place generatesrc() below takes it from.
+HTMLPODS={-
+        join(" \\\n" . ' ' x 9,
+             fill_lines(" ", $COLUMNS - 9,
+                        map { $unified_info{generate}->{$_}->[0] }
+                        map { @{$unified_info{htmldocs}->{$_} // []} }
+                        qw(man1 man3 man5 man7))) -}
+
 MANDOCS1={-
         join(" \\\n" . ' ' x 9,
              fill_lines(" ", $COLUMNS - 9,
@@ -295,6 +302,16 @@ MANDOCS7={-
              fill_lines(" ", $COLUMNS - 9,
                         @{$unified_info{mandocs}->{man7}})) -}

+# The pods every manual page is made from, which is what the whole manual
+# is formatted from in one go.  Each page's pod is the first element of its
+# generator, the same place generatesrc() below takes it from.
+MANPODS={-
+        join(" \\\n" . ' ' x 8,
+             fill_lines(" ", $COLUMNS - 8,
+                        map { $unified_info{generate}->{$_}->[0] }
+                        map { @{$unified_info{mandocs}->{$_} // []} }
+                        qw(man1 man3 man5 man7))) -}
+
 APPS_OPENSSL="{- use File::Spec::Functions;
                  catfile("apps","openssl") -}"

@@ -334,7 +351,6 @@ LIBDIR={- our $libdir = $config{libdir};
 # $(libdir) is chosen to be compatible with the GNU coding standards
 libdir={- file_name_is_absolute($libdir)
           ? $libdir : '$(INSTALLTOP)/$(LIBDIR)' -}
-ENGINESDIR=$(libdir)/engines-{- $sover_dirname -}
 MODULESDIR=$(libdir)/ossl-modules

 # Convenience variable for those who want to set the rpath in shared
@@ -451,7 +467,6 @@ LIB_CPPFLAGS={- our $lib_cppflags =
                 join(' ', $lib_cppflags,
                           (map { '-D'.$_ }
                                'OPENSSLDIR="\"$(OPENSSLDIR)\""',
-                               'ENGINESDIR="\"$(ENGINESDIR)\""',
                                'MODULESDIR="\"$(MODULESDIR)\""'),
                           '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
 LIB_CFLAGS={- join(' ', $target{lib_cflags} || (),
@@ -514,6 +529,9 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
                          '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
 BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)

+CMOCKA_LIBS={- $config{cmocka_libs} // '' -}
+DETOURS_LIBS={- $config{detours_libs} // '' -}
+
 # CPPFLAGS_Q is used for one thing only: to build up buildinf.h
 CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
               $cppflags2 =~ s|([\\"])|\\$1|g;
@@ -542,8 +560,10 @@ LANG=C

 {- dependmagic('build_sw', 'Build all the software (default target)'); -}: build_libs_nodep build_modules_nodep build_programs_nodep link-utils
 {- dependmagic('build_libs', 'Build the libraries libssl and libcrypto'); -}: build_libs_nodep
-{- dependmagic('build_modules', 'Build the modules (i.e. providers and engines)'); -}: build_modules_nodep
-{- dependmagic('build_programs', 'Build the openssl executables and scripts'); -}: build_programs_nodep
+{- dependmagic('build_modules', 'Build the modules (i.e. providers)'); -}: build_modules_nodep
+{- dependmagic('build_programs', 'Build the openssl executables, scripts and all other programs as configured (e.g. tests or demos)'); -}: build_programs_nodep
+{- dependmagic('build_inst_sw', 'Build all the software to be installed'); -}: build_libs_nodep build_modules_nodep build_inst_programs_nodep link-utils
+{- dependmagic('build_inst_programs', 'Build only the installable openssl executables and scripts'); -}: build_inst_programs_nodep

 all: build_sw {- "build_docs" if !$disabled{docs}; -} ## Build software and documentation
 debuginfo: $(SHLIBS)
@@ -552,16 +572,49 @@ debuginfo: $(SHLIBS)
 		$(OBJCOPY) --strip-debug --add-gnu-debuglink=$$i.debug $$i; \
 	done;

+cov-report: $(SHLIBS)
+	@set -e; gcovr -r . --txt-metric=branch --html --html-details -o openssl-metrics.html
+
 ##@ Documentation
 build_generated_pods: $(GENERATED_PODS)
 build_docs: build_man_docs build_html_docs ## Create documentation
-build_man_docs: $(MANDOCS1) $(MANDOCS3) $(MANDOCS5) $(MANDOCS7) ## Create manpages
-build_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7) ## Create HTML documentation
+build_man_docs: doc/man/.mandocs.stamp ## Create manpages
+
+# The whole manual is formatted in one run.  pod2man is a perl program that
+# compiles Pod::Man before it reads a single pod, so a process per page
+# spends most of its time loading the same module over nine hundred times.
+# No target depends on an individual page -- the install recipes take them
+# as arguments -- so a stamp is enough to order the work, and the per-page
+# rules below stay available for building one page by name.
+doc/man/.mandocs.stamp: {- $config{manpage_format} eq "roff"
+                           ? '$(MANPODS)'
+                           : '$(MANDOCS1) $(MANDOCS3) $(MANDOCS5) $(MANDOCS7)' -}
+{- $config{manpage_format} eq "roff"
+   ? "\t" . '@$(ECHO) "Formatting the manual pages"'
+     . "\n\t" . '@$(PERL) $(SRCDIR)/util/mkpod2man.pl -o doc/man \\'
+     . "\n\t\t" . '-m "$(MANSUFFIX)" -d "$(RELEASE_DATE)" -r "$(VERSION)" \\'
+     . "\n\t\t" . '$(MANPODS)'
+     . "\n\t" . '@touch $@'
+   : "\t" . '@touch $@' -}
+
+build_html_docs: doc/html/.htmldocs.stamp ## Create HTML documentation
+
+# As with the manual pages, Pod::Html is compiled before the first pod is
+# read, so the whole set is converted in one invocation rather than in a
+# process per page.  Nothing depends on an individual page -- the install
+# recipe takes them as arguments -- so a stamp is enough to order the work,
+# and the per-page rules below stay available for one page by name.
+doc/html/.htmldocs.stamp: $(HTMLPODS)
+	@$(ECHO) "Converting the manual pages to HTML"
+	@$(PERL) $(SRCDIR)/util/mkpod2html.pl -o doc/html \
+		-r "$(SRCDIR)/doc" $(HTMLPODS)
+	@touch $@

 build_generated: $(GENERATED_MANDATORY)
 build_libs_nodep: $(LIBS) {- join(" ",map { platform->sharedlib_simple($_) // platform->sharedlib_import($_) // platform->sharedlib($_) // () } @{$unified_info{libraries}}) -}
 build_modules_nodep: $(MODULES)
 build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
+build_inst_programs_nodep: $(INSTALL_PROGRAMS) $(SCRIPTS)

 # Kept around for backward compatibility
 build_apps build_tests: build_programs
@@ -605,6 +658,12 @@ list-tests: ## List available tests that can be invoked via "make test TESTS=<na

 ##@ Workspace cleaning

+cov-clean: ## Remove all coverage data files
+	-find . \( -name '*.gcda' -o -name '*.gcno' \) \! -type d | xargs $(RM)
+
+cov-reset: ## Remove runtime coverage counters
+	-find . -name '*.gcda' \! -type d | xargs $(RM)
+
 libclean:
 	@set -e; for s in $(SHLIB_INFO); do \
 		if [ "$$s" = ";" ]; then continue; fi; \
@@ -633,21 +692,40 @@ clean: libclean ## Clean the workspace, keep the configuration
 	$(RM) $(HTMLDOCS3)
 	$(RM) $(HTMLDOCS5)
 	$(RM) $(HTMLDOCS7)
+	$(RM) doc/html/.htmldocs.stamp
 	$(RM) $(MANDOCS1)
 	$(RM) $(MANDOCS3)
 	$(RM) $(MANDOCS5)
 	$(RM) $(MANDOCS7)
+	$(RM) doc/man/.mandocs.stamp
 	$(RM) $(PROGRAMS) $(TESTPROGS) $(MODULES) $(FIPSMODULE) $(SCRIPTS)
 	$(RM) $(GENERATED_MANDATORY) $(GENERATED)
-	-find . -name '*{- platform->depext() -}' \! -name '.*' \! -type d -exec $(RM) {} \;
-	-find . -name '*{- platform->objext() -}' \! -name '.*' \! -type d -exec $(RM) {} \;
 	$(RM) core
 	$(RM) tags TAGS doc-nits md-nits
 	$(RM) -r $(RESULT_D)
 	$(RM) providers/fips*.new
-	-find . -type l \! -name '.*' -exec $(RM) {} \;
-
-distclean: clean ## Clean and remove the configuration
+	# Remove the generated dependency files, object files, and symlinks
+	# in a single pass, avoid descending into submodules.
+	-find . \( -path './cloudflare-quiche' \
+	           -o -path './fuzz/corpora' \
+	           -o -path './gost-engine' \
+	           -o -path './krb5' \
+	           -o -path './oqs-provider' \
+	           -o -path './pkcs11-provider' \
+	           -o -path './pyca-cryptography' \
+	           -o -path './python-ecdsa' \
+	           -o -path './tlsfuzzer' \
+	           -o -path './tlslite-ng' \
+	           -o -path './wycheproof' \) \
+	        -prune \
+	        -o \! -type d \
+	           \( -name '*{- platform->depext() -}' \
+	              -o -name '*{- platform->objext() -}' \
+	              -o -type l \) \
+	           \! -name '.*' \
+	           -exec $(RM) '{}' +
+
+distclean: clean cov-clean ## Clean and remove the configuration
 	$(RM) include/openssl/configuration.h
 	$(RM) configdata.pm
 	$(RM) Makefile
@@ -662,13 +740,28 @@ depend: Makefile
 # Install helper targets #############################################
 ##@ Installation

-install: install_sw install_ssldirs {- "install_docs" if !$disabled{docs}; -} {- $disabled{fips} ? "" : "install_fips" -} ## Install software and documentation, create OpenSSL directories
+install: Makefile ## Install software and documentation, create OpenSSL directories
+	$(MAKE) install_sw
+	$(MAKE) install_ssldirs
+	{- "\$(MAKE) install_docs" if !$disabled{docs} -}
+	{- "\$(MAKE) install_fips" if !$disabled{fips} -}

 uninstall: {- "uninstall_docs" if !$disabled{docs}; -} uninstall_sw {- $disabled{fips} ? "" : "uninstall_fips" -} ## Uninstall software and documentation

-install_sw: install_dev install_engines install_modules install_runtime ## Install just the software and libraries
+# install_dev, install_modules and install_runtime each reach the build
+# through a recursive $(MAKE) of their own, and they do not build disjoint
+# sets: apps/libapps.a is a member of $(LIBS) and also a prerequisite of the
+# installable programs.  Under "make -j" the prerequisites below run at the
+# same time, so two of those sub-makes build the archive concurrently and one
+# removes it while the other is running ranlib over it.  Build everything in
+# a single make first; the sub-makes then find their targets current and
+# build nothing.
+install_sw: build_inst_sw ## Install just the software and libraries
+	"$(MAKE)" _install_sw
+
+_install_sw: install_dev install_modules install_runtime

-uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev ## Uninstall the software and libraries
+uninstall_sw: uninstall_runtime uninstall_modules uninstall_dev ## Uninstall the software and libraries

 install_docs: install_man_docs install_html_docs ## Install manpages and HTML documentation

@@ -676,16 +769,21 @@ uninstall_docs: uninstall_man_docs uninstall_html_docs ## Uninstall manpages and
 	$(RM) -r "$(DESTDIR)$(DOCDIR)"

 {- output_off() if $disabled{fips}; "" -}
-install_fips: build_sw $(INSTALL_FIPSMODULECONF)
+install_fips: build_inst_sw $(INSTALL_FIPSMODULECONF)
 	@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
 	@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MODULESDIR)"
 	@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(OPENSSLDIR)"
 	@$(ECHO) "*** Installing FIPS module"
-	@$(ECHO) "install $(INSTALL_FIPSMODULE) -> $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME)"
 	@cp "$(INSTALL_FIPSMODULE)" "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new"
 	@chmod 755 "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new"
-	@mv -f "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new" \
-	       "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME)"
+	@if cmp -s "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new" \
+		   "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME)"; then \
+		$(RM) "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new"; \
+	else \
+		$(ECHO) "install $(INSTALL_FIPSMODULE) -> $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME)"; \
+		mv -f "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new" \
+		      "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME)"; \
+	fi
 	@$(ECHO) "*** Installing FIPS module configuration"
 	@$(ECHO) "install $(INSTALL_FIPSMODULECONF) -> $(DESTDIR)$(OPENSSLDIR)/fipsmodule.cnf"
 	@cp $(INSTALL_FIPSMODULECONF) "$(DESTDIR)$(OPENSSLDIR)/fipsmodule.cnf"
@@ -713,11 +811,16 @@ install_ssldirs:
 		x1=`echo "$$x" | cut -f1 -d:`; \
 		x2=`echo "$$x" | cut -f2 -d:`; \
 		fn=`basename $$x1`; \
-		$(ECHO) "install $$x1 -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
 		cp $$x1 "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new"; \
 		chmod 755 "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new"; \
-		mv -f "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new" \
-		      "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
+		if cmp -s "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new" \
+			  "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; then \
+			$(RM) "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new"; \
+		else \
+			$(ECHO) "install $$x1 -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
+			mv -f "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new" \
+			      "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
+		fi; \
 		if [ "$$x1" != "$$x2" ]; then \
 			ln=`basename "$$x2"`; \
 			: {- output_off() unless windowsdll(); "" -}; \
@@ -730,19 +833,31 @@ install_ssldirs:
 			: {- output_on() if windowsdll(); "" -}; \
 		fi; \
 	done
-	@$(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist"
 	@cp $(SRCDIR)/apps/openssl.cnf "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new"
 	@chmod 644 "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new"
-	@mv -f  "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new" "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist"
+	@if cmp -s "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new" \
+		   "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist"; then \
+		$(RM) "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new"; \
+	else \
+		$(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist"; \
+		mv -f "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new" \
+		      "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist"; \
+	fi
 	@if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf" ]; then \
 		$(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \
 		cp $(SRCDIR)/apps/openssl.cnf "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \
 		chmod 644 "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \
 	fi
-	@$(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist"
 	@cp $(SRCDIR)/apps/ct_log_list.cnf "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new"
 	@chmod 644 "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new"
-	@mv -f  "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new" "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist"
+	@if cmp -s "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new" \
+		   "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist"; then \
+		$(RM) "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new"; \
+	else \
+		$(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist"; \
+		mv -f "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new" \
+		      "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist"; \
+	fi
 	@if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf" ]; then \
 		$(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf"; \
 		cp $(SRCDIR)/apps/ct_log_list.cnf "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf"; \
@@ -754,26 +869,26 @@ install_dev: install_runtime_libs
 	@$(ECHO) "*** Installing development files"
 	@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(INSTALLTOP)/include/openssl"
 	@ : {- output_off() if $disabled{uplink}; "" -}
-	@$(ECHO) "install $(SRCDIR)/ms/applink.c -> $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
-	@cp $(SRCDIR)/ms/applink.c "$(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
-	@chmod 644 "$(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
+	@$(PERL) $(SRCDIR)/util/install-files.pl 644 \
+		"$(DESTDIR)$(INSTALLTOP)/include/openssl" $(SRCDIR)/ms/applink.c
 	@ : {- output_on() if $disabled{uplink}; "" -}
-	@set -e; for i in $(SRCDIR)/include/openssl/*.h \
-			  $(BLDDIR)/include/openssl/*.h; do \
-		fn=`basename $$i`; \
-		$(ECHO) "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
-		cp $$i "$(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
-		chmod 644 "$(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
-	done
+	@$(PERL) $(SRCDIR)/util/install-files.pl 644 \
+		"$(DESTDIR)$(INSTALLTOP)/include/openssl" \
+		$(SRCDIR)/include/openssl/*.h $(BLDDIR)/include/openssl/*.h
 	@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(libdir)"
 	@set -e; for l in $(INSTALL_LIBS); do \
 		fn=`basename $$l`; \
-		$(ECHO) "install $$l -> $(DESTDIR)$(libdir)/$$fn"; \
 		cp $$l "$(DESTDIR)$(libdir)/$$fn.new"; \
 		$(RANLIB) "$(DESTDIR)$(libdir)/$$fn.new"; \
 		chmod 644 "$(DESTDIR)$(libdir)/$$fn.new"; \
-		mv -f "$(DESTDIR)$(libdir)/$$fn.new" \
-		      "$(DESTDIR)$(libdir)/$$fn"; \
+		if cmp -s "$(DESTDIR)$(libdir)/$$fn.new" \
+			  "$(DESTDIR)$(libdir)/$$fn"; then \
+			$(RM) "$(DESTDIR)$(libdir)/$$fn.new"; \
+		else \
+			$(ECHO) "install $$l -> $(DESTDIR)$(libdir)/$$fn"; \
+			mv -f "$(DESTDIR)$(libdir)/$$fn.new" \
+			      "$(DESTDIR)$(libdir)/$$fn"; \
+		fi; \
 	done
 	@ : {- output_off() if $disabled{shared}; "" -}
 	@set -e; for s in $(INSTALL_SHLIB_INFO); do \
@@ -815,19 +930,11 @@ install_dev: install_runtime_libs
 	done
 	@ : {- output_on() if $disabled{shared}; "" -}
 	@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(PKGCONFIGDIR)"
-	@for e in $(INSTALL_EXPORTERS_PKGCONFIG); do \
-		fn=`basename $$e`; \
-		$(ECHO) "install $$e -> $(DESTDIR)$(PKGCONFIGDIR)/$$fn"; \
-		cp $$e "$(DESTDIR)$(PKGCONFIGDIR)/$$fn"; \
-		chmod 644 "$(DESTDIR)$(PKGCONFIGDIR)/$$fn"; \
-	done
+	@$(PERL) $(SRCDIR)/util/install-files.pl 644 \
+		"$(DESTDIR)$(PKGCONFIGDIR)" $(INSTALL_EXPORTERS_PKGCONFIG)
 	@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(CMAKECONFIGDIR)"
-	@for e in $(INSTALL_EXPORTERS_CMAKE); do \
-		fn=`basename $$e`; \
-		$(ECHO) "install $$e -> $(DESTDIR)$(CMAKECONFIGDIR)/$$fn"; \
-		cp $$e "$(DESTDIR)$(CMAKECONFIGDIR)/$$fn"; \
-		chmod 644 "$(DESTDIR)$(CMAKECONFIGDIR)/$$fn"; \
-	done
+	@$(PERL) $(SRCDIR)/util/install-files.pl 644 \
+		"$(DESTDIR)$(CMAKECONFIGDIR)" $(INSTALL_EXPORTERS_CMAKE)

 uninstall_dev: uninstall_runtime_libs
 	@$(ECHO) "*** Uninstalling development files"
@@ -886,30 +993,6 @@ uninstall_dev: uninstall_runtime_libs

 _install_modules_deps: install_runtime_libs build_modules

-install_engines: _install_modules_deps
-	@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
-	@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(ENGINESDIR)/"
-	@$(ECHO) "*** Installing engines"
-	@set -e; for e in dummy $(INSTALL_ENGINES); do \
-		if [ "$$e" = "dummy" ]; then continue; fi; \
-		fn=`basename $$e`; \
-		$(ECHO) "install $$e -> $(DESTDIR)$(ENGINESDIR)/$$fn"; \
-		cp $$e "$(DESTDIR)$(ENGINESDIR)/$$fn.new"; \
-		chmod 755 "$(DESTDIR)$(ENGINESDIR)/$$fn.new"; \
-		mv -f "$(DESTDIR)$(ENGINESDIR)/$$fn.new" \
-		      "$(DESTDIR)$(ENGINESDIR)/$$fn"; \
-	done
-
-uninstall_engines:
-	@$(ECHO) "*** Uninstalling engines"
-	@set -e; for e in dummy $(INSTALL_ENGINES); do \
-		if [ "$$e" = "dummy" ]; then continue; fi; \
-		fn=`basename $$e`; \
-		$(ECHO) "$(RM) $(DESTDIR)$(ENGINESDIR)/$$fn"; \
-		$(RM) "$(DESTDIR)$(ENGINESDIR)/$$fn"; \
-	done
-	-$(RMDIR) "$(DESTDIR)$(ENGINESDIR)"
-
 install_modules: _install_modules_deps
 	@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
 	@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MODULESDIR)/"
@@ -917,11 +1000,16 @@ install_modules: _install_modules_deps
 	@set -e; for e in dummy $(INSTALL_MODULES); do \
 		if [ "$$e" = "dummy" ]; then continue; fi; \
 		fn=`basename $$e`; \
-		$(ECHO) "install $$e -> $(DESTDIR)$(MODULESDIR)/$$fn"; \
 		cp $$e "$(DESTDIR)$(MODULESDIR)/$$fn.new"; \
 		chmod 755 "$(DESTDIR)$(MODULESDIR)/$$fn.new"; \
-		mv -f "$(DESTDIR)$(MODULESDIR)/$$fn.new" \
-		      "$(DESTDIR)$(MODULESDIR)/$$fn"; \
+		if cmp -s "$(DESTDIR)$(MODULESDIR)/$$fn.new" \
+			  "$(DESTDIR)$(MODULESDIR)/$$fn"; then \
+			$(RM) "$(DESTDIR)$(MODULESDIR)/$$fn.new"; \
+		else \
+			$(ECHO) "install $$e -> $(DESTDIR)$(MODULESDIR)/$$fn"; \
+			mv -f "$(DESTDIR)$(MODULESDIR)/$$fn.new" \
+			      "$(DESTDIR)$(MODULESDIR)/$$fn"; \
+		fi; \
 	done

 uninstall_modules:
@@ -948,41 +1036,61 @@ install_runtime_libs: build_libs
 		if [ "$$s" = "dummy" ]; then continue; fi; \
 		fn=`basename $$s`; \
 		: {- output_off() unless windowsdll(); "" -}; \
-		$(ECHO) "install $$s -> $(DESTDIR)$(bindir)/$$fn"; \
 		cp $$s "$(DESTDIR)$(bindir)/$$fn.new"; \
 		chmod 755 "$(DESTDIR)$(bindir)/$$fn.new"; \
-		mv -f "$(DESTDIR)$(bindir)/$$fn.new" \
-		      "$(DESTDIR)$(bindir)/$$fn"; \
+		if cmp -s "$(DESTDIR)$(bindir)/$$fn.new" \
+			  "$(DESTDIR)$(bindir)/$$fn"; then \
+			$(RM) "$(DESTDIR)$(bindir)/$$fn.new"; \
+		else \
+			$(ECHO) "install $$s -> $(DESTDIR)$(bindir)/$$fn"; \
+			mv -f "$(DESTDIR)$(bindir)/$$fn.new" \
+			      "$(DESTDIR)$(bindir)/$$fn"; \
+		fi; \
 		: {- output_on() unless windowsdll(); "" -}{- output_off() if windowsdll(); "" -}; \
-		$(ECHO) "install $$s -> $(DESTDIR)$(libdir)/$$fn"; \
 		cp $$s "$(DESTDIR)$(libdir)/$$fn.new"; \
 		chmod 755 "$(DESTDIR)$(libdir)/$$fn.new"; \
-		mv -f "$(DESTDIR)$(libdir)/$$fn.new" \
-		      "$(DESTDIR)$(libdir)/$$fn"; \
+		if cmp -s "$(DESTDIR)$(libdir)/$$fn.new" \
+			  "$(DESTDIR)$(libdir)/$$fn"; then \
+			$(RM) "$(DESTDIR)$(libdir)/$$fn.new"; \
+		else \
+			$(ECHO) "install $$s -> $(DESTDIR)$(libdir)/$$fn"; \
+			mv -f "$(DESTDIR)$(libdir)/$$fn.new" \
+			      "$(DESTDIR)$(libdir)/$$fn"; \
+		fi; \
 		: {- output_on() if windowsdll(); "" -}; \
 	done

-install_programs: install_runtime_libs build_programs
+install_programs: install_runtime_libs build_inst_programs
 	@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
 	@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(bindir)"
 	@$(ECHO) "*** Installing runtime programs"
 	@set -e; for x in dummy $(INSTALL_PROGRAMS); do \
 		if [ "$$x" = "dummy" ]; then continue; fi; \
 		fn=`basename $$x`; \
-		$(ECHO) "install $$x -> $(DESTDIR)$(bindir)/$$fn"; \
 		cp $$x "$(DESTDIR)$(bindir)/$$fn.new"; \
 		chmod 755 "$(DESTDIR)$(bindir)/$$fn.new"; \
-		mv -f "$(DESTDIR)$(bindir)/$$fn.new" \
-		      "$(DESTDIR)$(bindir)/$$fn"; \
+		if cmp -s "$(DESTDIR)$(bindir)/$$fn.new" \
+			  "$(DESTDIR)$(bindir)/$$fn"; then \
+			$(RM) "$(DESTDIR)$(bindir)/$$fn.new"; \
+		else \
+			$(ECHO) "install $$x -> $(DESTDIR)$(bindir)/$$fn"; \
+			mv -f "$(DESTDIR)$(bindir)/$$fn.new" \
+			      "$(DESTDIR)$(bindir)/$$fn"; \
+		fi; \
 	done
 	@set -e; for x in dummy $(BIN_SCRIPTS); do \
 		if [ "$$x" = "dummy" ]; then continue; fi; \
 		fn=`basename $$x`; \
-		$(ECHO) "install $$x -> $(DESTDIR)$(bindir)/$$fn"; \
 		cp $$x "$(DESTDIR)$(bindir)/$$fn.new"; \
 		chmod 755 "$(DESTDIR)$(bindir)/$$fn.new"; \
-		mv -f "$(DESTDIR)$(bindir)/$$fn.new" \
-		      "$(DESTDIR)$(bindir)/$$fn"; \
+		if cmp -s "$(DESTDIR)$(bindir)/$$fn.new" \
+			  "$(DESTDIR)$(bindir)/$$fn"; then \
+			$(RM) "$(DESTDIR)$(bindir)/$$fn.new"; \
+		else \
+			$(ECHO) "install $$x -> $(DESTDIR)$(bindir)/$$fn"; \
+			mv -f "$(DESTDIR)$(bindir)/$$fn.new" \
+			      "$(DESTDIR)$(bindir)/$$fn"; \
+		fi; \
 	done

 uninstall_runtime: uninstall_programs uninstall_runtime_libs
@@ -1024,69 +1132,33 @@ install_man_docs: build_man_docs
 	@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MANDIR)/man5"
 	@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MANDIR)/man7"
 	@$(ECHO) "*** Installing manpages"
-	@set -e; for x in dummy $(MANDOCS1); do \
-		if [ "$$x" = "dummy" ]; then continue; fi; \
-		fn=`basename $$x`; \
-		$(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \
-		cp $$x "$(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \
-		chmod 644 "$(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \
-		$(PERL) $(SRCDIR)/util/write-man-symlinks install $(SRCDIR)/doc/man1 $(BLDDIR)/doc/man1 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man1"; \
-	done
-	@set -e; for x in dummy $(MANDOCS3); do \
-		if [ "$$x" = "dummy" ]; then continue; fi; \
-		fn=`basename $$x`; \
-		$(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \
-		cp $$x "$(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \
-		chmod 644 "$(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \
-		$(PERL) $(SRCDIR)/util/write-man-symlinks install $(SRCDIR)/doc/man3 $(BLDDIR)/doc/man3 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man3"; \
-	done
-	@set -e; for x in dummy $(MANDOCS5); do \
-		if [ "$$x" = "dummy" ]; then continue; fi; \
-		fn=`basename $$x`; \
-		$(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \
-		cp $$x "$(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \
-		chmod 644 "$(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \
-		$(PERL) $(SRCDIR)/util/write-man-symlinks install $(SRCDIR)/doc/man5 $(BLDDIR)/doc/man5 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man5"; \
-	done
-	@set -e; for x in dummy $(MANDOCS7); do \
-		if [ "$$x" = "dummy" ]; then continue; fi; \
-		fn=`basename $$x`; \
-		$(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \
-		cp $$x "$(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \
-		chmod 644 "$(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \
-		$(PERL) $(SRCDIR)/util/write-man-symlinks install $(SRCDIR)/doc/man7 $(BLDDIR)/doc/man7 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man7"; \
-	done
+	@$(PERL) $(SRCDIR)/util/install-man-pages.pl install \
+		$(SRCDIR)/doc/man1 $(BLDDIR)/doc/man1 \
+		"$(DESTDIR)$(MANDIR)/man1" "$(MANSUFFIX)" $(MANDOCS1)
+	@$(PERL) $(SRCDIR)/util/install-man-pages.pl install \
+		$(SRCDIR)/doc/man3 $(BLDDIR)/doc/man3 \
+		"$(DESTDIR)$(MANDIR)/man3" "$(MANSUFFIX)" $(MANDOCS3)
+	@$(PERL) $(SRCDIR)/util/install-man-pages.pl install \
+		$(SRCDIR)/doc/man5 $(BLDDIR)/doc/man5 \
+		"$(DESTDIR)$(MANDIR)/man5" "$(MANSUFFIX)" $(MANDOCS5)
+	@$(PERL) $(SRCDIR)/util/install-man-pages.pl install \
+		$(SRCDIR)/doc/man7 $(BLDDIR)/doc/man7 \
+		"$(DESTDIR)$(MANDIR)/man7" "$(MANSUFFIX)" $(MANDOCS7)

 uninstall_man_docs: build_man_docs
 	@$(ECHO) "*** Uninstalling manpages"
-	@set -e; for x in dummy $(MANDOCS1); do \
-		if [ "$$x" = "dummy" ]; then continue; fi; \
-		fn=`basename $$x`; \
-		$(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \
-		$(RM) "$(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \
-		$(PERL) $(SRCDIR)/util/write-man-symlinks uninstall $(SRCDIR)/doc/man1 $(BLDDIR)/doc/man1 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man1"; \
-	done
-	@set -e; for x in dummy $(MANDOCS3); do \
-		if [ "$$x" = "dummy" ]; then continue; fi; \
-		fn=`basename $$x`; \
-		$(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \
-		$(RM) "$(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \
-		$(PERL) $(SRCDIR)/util/write-man-symlinks uninstall $(SRCDIR)/doc/man3 $(BLDDIR)/doc/man3 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man3"; \
-	done
-	@set -e; for x in dummy $(MANDOCS5); do \
-		if [ "$$x" = "dummy" ]; then continue; fi; \
-		fn=`basename $$x`; \
-		$(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \
-		$(RM) "$(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \
-		$(PERL) $(SRCDIR)/util/write-man-symlinks uninstall $(SRCDIR)/doc/man5 $(BLDDIR)/doc/man5 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man5"; \
-	done
-	@set -e; for x in dummy $(MANDOCS7); do \
-		if [ "$$x" = "dummy" ]; then continue; fi; \
-		fn=`basename $$x`; \
-		$(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \
-		$(RM) "$(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \
-		$(PERL) $(SRCDIR)/util/write-man-symlinks uninstall $(SRCDIR)/doc/man7 $(BLDDIR)/doc/man7 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man7"; \
-	done
+	@$(PERL) $(SRCDIR)/util/install-man-pages.pl uninstall \
+		$(SRCDIR)/doc/man1 $(BLDDIR)/doc/man1 \
+		"$(DESTDIR)$(MANDIR)/man1" "$(MANSUFFIX)" $(MANDOCS1)
+	@$(PERL) $(SRCDIR)/util/install-man-pages.pl uninstall \
+		$(SRCDIR)/doc/man3 $(BLDDIR)/doc/man3 \
+		"$(DESTDIR)$(MANDIR)/man3" "$(MANSUFFIX)" $(MANDOCS3)
+	@$(PERL) $(SRCDIR)/util/install-man-pages.pl uninstall \
+		$(SRCDIR)/doc/man5 $(BLDDIR)/doc/man5 \
+		"$(DESTDIR)$(MANDIR)/man5" "$(MANSUFFIX)" $(MANDOCS5)
+	@$(PERL) $(SRCDIR)/util/install-man-pages.pl uninstall \
+		$(SRCDIR)/doc/man7 $(BLDDIR)/doc/man7 \
+		"$(DESTDIR)$(MANDIR)/man7" "$(MANSUFFIX)" $(MANDOCS7)

 install_html_docs: install_image_docs build_html_docs
 	@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
@@ -1095,34 +1167,14 @@ install_html_docs: install_image_docs build_html_docs
 	@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(HTMLDIR)/man5"
 	@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(HTMLDIR)/man7"
 	@$(ECHO) "*** Installing HTML manpages"
-	@set -e; for x in dummy $(HTMLDOCS1); do \
-		if [ "$$x" = "dummy" ]; then continue; fi; \
-		fn=`basename $$x`; \
-		$(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man1/$$fn"; \
-		cp $$x "$(DESTDIR)$(HTMLDIR)/man1/$$fn"; \
-		chmod 644 "$(DESTDIR)$(HTMLDIR)/man1/$$fn"; \
-	done
-	@set -e; for x in dummy $(HTMLDOCS3); do \
-		if [ "$$x" = "dummy" ]; then continue; fi; \
-		fn=`basename $$x`; \
-		$(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man3/$$fn"; \
-		cp $$x "$(DESTDIR)$(HTMLDIR)/man3/$$fn"; \
-		chmod 644 "$(DESTDIR)$(HTMLDIR)/man3/$$fn"; \
-	done
-	@set -e; for x in dummy $(HTMLDOCS5); do \
-		if [ "$$x" = "dummy" ]; then continue; fi; \
-		fn=`basename $$x`; \
-		$(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man5/$$fn"; \
-		cp $$x "$(DESTDIR)$(HTMLDIR)/man5/$$fn"; \
-		chmod 644 "$(DESTDIR)$(HTMLDIR)/man5/$$fn"; \
-	done
-	@set -e; for x in dummy $(HTMLDOCS7); do \
-		if [ "$$x" = "dummy" ]; then continue; fi; \
-		fn=`basename $$x`; \
-		$(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man7/$$fn"; \
-		cp $$x "$(DESTDIR)$(HTMLDIR)/man7/$$fn"; \
-		chmod 644 "$(DESTDIR)$(HTMLDIR)/man7/$$fn"; \
-	done
+	@$(PERL) $(SRCDIR)/util/install-files.pl 644 \
+		"$(DESTDIR)$(HTMLDIR)/man1" $(HTMLDOCS1)
+	@$(PERL) $(SRCDIR)/util/install-files.pl 644 \
+		"$(DESTDIR)$(HTMLDIR)/man3" $(HTMLDOCS3)
+	@$(PERL) $(SRCDIR)/util/install-files.pl 644 \
+		"$(DESTDIR)$(HTMLDIR)/man5" $(HTMLDOCS5)
+	@$(PERL) $(SRCDIR)/util/install-files.pl 644 \
+		"$(DESTDIR)$(HTMLDIR)/man7" $(HTMLDOCS7)

 uninstall_html_docs: uninstall_image_docs
 	@$(ECHO) "*** Uninstalling HTML manpages"
@@ -1153,13 +1205,8 @@ uninstall_html_docs: uninstall_image_docs

 install_image_docs:
 	@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(HTMLDIR)/man7/img"
-	@set -e; for x in dummy $(IMAGEDOCS7); do \
-		if [ "$$x" = "dummy" ]; then continue; fi; \
-		fn=`basename $$x`; \
-		$(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man7/img/$$fn"; \
-		cp $(SRCDIR)/$$x "$(DESTDIR)$(HTMLDIR)/man7/img/$$fn"; \
-		chmod 644 "$(DESTDIR)$(HTMLDIR)/man7/img/$$fn"; \
-	done
+	@$(PERL) $(SRCDIR)/util/install-files.pl 644 \
+		"$(DESTDIR)$(HTMLDIR)/man7/img" $(IMAGEDOCS7)

 uninstall_image_docs:
 	@set -e; for x in dummy $(IMAGEDOCS7); do \
@@ -1176,17 +1223,20 @@ uninstall_image_docs:
 # is sensitive to build.info changes.
 update: generate errors ordinals generate_buildinfo ## Update errors, ordinals and build info

-.PHONY: generate generate_apps generate_crypto_bn generate_crypto_objects \
-          generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids
-generate: generate_apps generate_crypto_bn generate_crypto_objects \
-          generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids
+# $(UPTODATE) target input... succeeds when target exists and is strictly
+# newer than every input, and fails otherwise; used to skip regeneration
+# of a target that is already current.
+UPTODATE=$(PERL) -e 'my $$o = shift; exit 1 unless -e $$o; -M $$o < -M $$_ or exit 1 for @ARGV'
+
+.PHONY: generate generate_apps generate_crypto_objects generate_fuzz_oids
+generate: generate_apps generate_crypto_objects generate_fuzz_oids

 .PHONY: generate_buildinfo generate_doc_buildinfo
 generate_buildinfo: generate_doc_buildinfo

 .PHONY: doc-nits md-nits
 doc-nits: build_generated_pods ## Evaluate OpenSSL documentation
-	$(PERL) $(SRCDIR)/util/find-doc-nits -c -n -l -e -i
+	$(PERL) $(SRCDIR)/util/find-doc-nits -c -n -l -e -i -a

 # This uses "mdl", the markdownlint application, which is written in ruby.
 # The source is at https://github.com/markdownlint/markdownlint
@@ -1221,42 +1271,31 @@ check-format: check-clang-format-diff-cmd ## Evaluate C code according to OpenSS
 	( cd $(SRCDIR); git diff -U0 --no-prefix --no-color | $(CLANG_FORMAT_DIFF) )

 generate_apps:
-	( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \
+	( cd $(SRCDIR); \
+	  $(UPTODATE) apps/openssl-vms.cnf \
+		      apps/openssl.cnf VMS/VMSify-conf.pl || \
+	  $(PERL) VMS/VMSify-conf.pl \
 				< apps/openssl.cnf > apps/openssl-vms.cnf )

-generate_crypto_bn:
-	( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
-
 generate_crypto_objects:
-	( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl -n \
-				crypto/objects/objects.txt \
-				crypto/objects/obj_mac.num \
-				> crypto/objects/obj_mac.new && \
-	    mv crypto/objects/obj_mac.new crypto/objects/obj_mac.num )
-	( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl \
-				crypto/objects/objects.txt \
-				crypto/objects/obj_mac.num \
-				> include/openssl/obj_mac.h )
-	( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \
-				include/openssl/obj_mac.h \
-				> crypto/objects/obj_dat.h )
-	( cd $(SRCDIR); $(PERL) crypto/objects/objxref.pl \
-				crypto/objects/obj_mac.num \
-				crypto/objects/obj_xref.txt \
-				> crypto/objects/obj_xref.h )
-	( cd $(SRCDIR);	sed -e '1,8d' crypto/objects/obj_compat.h >> include/openssl/obj_mac.h )
-
-generate_crypto_conf:
-	( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
-			        > crypto/conf/conf_def.h )
-
-generate_crypto_asn1:
-	( cd $(SRCDIR); $(PERL) crypto/asn1/charmap.pl \
-			        > crypto/asn1/charmap.h )
-
-generate_fuzz_oids:
-	( cd $(SRCDIR); $(PERL) fuzz/mkfuzzoids.pl \
-				crypto/objects/obj_dat.h \
+	( cd $(SRCDIR); set -e; \
+	  $(PERL) crypto/objects/objects.pl -n \
+			crypto/objects/objects.txt \
+			crypto/objects/obj_mac.num \
+			> crypto/objects/obj_mac.num.new; \
+	  if cmp crypto/objects/obj_mac.num.new \
+		 crypto/objects/obj_mac.num > /dev/null 2>&1; then \
+		rm crypto/objects/obj_mac.num.new; \
+	  else \
+		mv crypto/objects/obj_mac.num.new crypto/objects/obj_mac.num; \
+	  fi )
+
+generate_fuzz_oids: crypto/objects/obj_dat.h
+	( b=`pwd`; cd $(SRCDIR); \
+	  $(UPTODATE) fuzz/oids.txt \
+		      $$b/crypto/objects/obj_dat.h fuzz/mkfuzzoids.pl || \
+	  $(PERL) fuzz/mkfuzzoids.pl \
+				$$b/crypto/objects/obj_dat.h \
 				> fuzz/oids.txt )

 generate_doc_buildinfo:
@@ -1315,11 +1354,14 @@ providers/fips.module.sources.new: configdata.pm
 	  for x in crypto/bn/asm/*.pl crypto/bn/asm/*.S \
 		   crypto/aes/asm/*.pl crypto/aes/asm/*.S \
 		   crypto/ec/asm/*.pl \
+		   crypto/ml_dsa/asm/*.pl \
+		   crypto/ml_kem/asm/*.pl \
 		   crypto/modes/asm/*.pl \
 		   crypto/sha/asm/*.pl \
+		   crypto/slh_dsa/asm/*.pl \
 		   crypto/*cpuid.pl crypto/*cpuid.S \
 		   crypto/*cap.c; do \
-	    echo "$$x"; \
+	    test -e "$$x" && echo "$$x"; \
 	  done \
 	) | grep -v sm2p256 | sort | uniq > providers/fips.module.sources.new
 	rm -rf sources-tmp
@@ -1329,14 +1371,7 @@ ERROR_REBUILD=
 errors:
 	( b=`pwd`; set -e; cd $(SRCDIR); \
           $(PERL) util/ck_errf.pl -strict -internal; \
-          $(PERL) -I$$b util/mkerr.pl $(ERROR_REBUILD) -internal )
-	( b=`pwd`; set -e; cd $(SRCDIR)/engines; \
-          for E in *.ec ; do \
-              $(PERL) ../util/ck_errf.pl -strict \
-                -conf $$E `basename $$E .ec`.c; \
-              $(PERL) -I$$b ../util/mkerr.pl $(ERROR_REBUILD) -static \
-                -conf $$E `basename $$E .ec`.c ; \
-          done )
+          $(PERL) -I$$b util/mkerr.pl $(ERROR_REBUILD) -internal -state )

 {- use File::Basename;

@@ -1349,7 +1384,8 @@ errors:
            include/openssl/dtls1.h
            include/openssl/srtp.h
            include/openssl/quic.h
-           include/openssl/sslerr_legacy.h );
+           include/openssl/sslerr_legacy.h
+           include/openssl/ech.h);
    my @cryptoheaders_tmpl =
        qw( include/internal/dso.h
            include/internal/o_dir.h
@@ -1361,6 +1397,7 @@ errors:
    my @cryptoskipheaders = ( @sslheaders_tmpl,
        qw( include/openssl/conf_api.h
            include/openssl/ebcdic.h
+           include/openssl/engine.h
            include/openssl/opensslconf.h
            include/openssl/symhacks.h ) );
    our %cryptoheaders = ();
@@ -1433,10 +1470,10 @@ ordinals: build_generated
 test_ordinals:
 	"$(MAKE)" run_tests TESTS=test_ordinals

-tags TAGS: FORCE
+tags TAGS: FORCE build_generated
 	rm -f TAGS tags
 	-( cd $(SRCDIR); util/ctags.sh )
-	-etags `find . -name '*.[ch]' -o -name '*.pm'`
+	-etags `find . -name '*.[ch]' -o -name '*.pm' -o -name '*.inc'`

 providers/fips.checksum.new: providers/fips.module.sources.new
 	@which unifdef > /dev/null || \
@@ -1565,6 +1602,18 @@ EOF
       my $defs = join("", map { " -D".$_ } @{$args{defs}});
       my $deps = join(" ", compute_platform_depends(@{$args{generator_deps}},
                                                     @{$args{deps}}));
+      my $tofile = "\$(PERL) \$(SRCDIR)/util/file-from-stdout.pl";
+      # A generator named for more than one target cannot be producing them
+      # on standard output; it writes them itself, so its output must not be
+      # captured.
+      our %gen_targets;
+      unless (%gen_targets) {
+          foreach my $t (keys %{$unified_info{generate}}) {
+              $gen_targets{join(" ", @{$unified_info{generate}->{$t}})}++;
+          }
+      }
+      my $writes_own_files =
+          $gen_targets{join(" ", @{$args{generator}})} > 1;

       if ($args{src} =~ /\.html$/) {
           #
@@ -1583,12 +1632,27 @@ EOF
           my $section = $1;
           my $name = uc basename($args{src}, ".$section");
           my $pod = $gen0;
-          return <<"EOF";
+
+          if ($config{manpage_format} eq "mdoc") {
+              return <<"EOF";
 $args{src}: $pod
-	pod2man --name=$name --section=$section\$(MANSUFFIX) --center=OpenSSL \\
-		--date=\$(RELEASE_DATE) --release=\$(VERSION) \\
-		$pod >\$\@
+	pod2mdoc -n $name -s $section\$(MANSUFFIX) \\
+		 -d \$(RELEASE_DATE) \\
+		 $pod >\$\@
 EOF
+          } elsif ($config{manpage_format} eq "roff") {
+              # One page at a time, through the same script that formats
+              # the whole manual, so there is a single implementation.  It
+              # does not fork for a single pod, and still beats pod2man,
+              # which has more of its own start-up to do.
+              return <<"EOF";
+$args{src}: $pod
+	\$(PERL) \$(SRCDIR)/util/mkpod2man.pl -o doc/man -m "\$(MANSUFFIX)" \\
+		-d "\$(RELEASE_DATE)" -r "\$(VERSION)" $pod
+EOF
+          } else {
+              die "Unhandled manpage format: $config{manpage_format}";
+          }
       } elsif (platform->isdef($args{src})) {
           #
           # Linker script-ish generator
@@ -1599,7 +1663,8 @@ EOF
           my $ord_name = $args{generator}->[1] || $args{product};
           return <<"EOF";
 $target: $gen0 $deps \$(SRCDIR)/util/mkdef.pl
-	\$(PERL) \$(SRCDIR)/util/mkdef.pl$ord_ver --type $args{intent} --ordinals $gen0  --name $ord_name --OS $mkdef_os > $target
+	$tofile $target \\
+		\$(PERL) \$(SRCDIR)/util/mkdef.pl$ord_ver --type $args{intent} --ordinals $gen0  --name $ord_name --OS $mkdef_os
 EOF
       } elsif (platform->isasm($args{src})
                || platform->iscppasm($args{src})) {
@@ -1614,11 +1679,15 @@ EOF
           } -> {$args{intent}};

           my $generator;
+          # The perlasm modules take the output name as their last argument;
+          # m4 writes to standard output.
+          my $to_stdout = 0;
           if ($gen0 =~ /\.pl$/) {
               $generator = 'CC="$(CC)" $(PERL)'.$gen_incs.' '.$gen0.$gen_args
                   .' "$(PERLASM_SCHEME)"'.$incs.' '.$cppflags.$defs.' $(PROCESSOR)';
           } elsif ($gen0 =~ /\.m4$/) {
-              $generator = 'm4 -B 8192'.$gen_incs.' '.$gen0.$gen_args.' >'
+              $generator = 'm4 -B 8192'.$gen_incs.' '.$gen0.$gen_args;
+              $to_stdout = 1;
           } elsif ($gen0 =~ /\.S$/) {
               $generator = undef;
           } else {
@@ -1626,15 +1695,17 @@ EOF
           }

           if (defined($generator)) {
+              my $recipe = $to_stdout ? "$tofile \$\@ $generator"
+                                      : "$generator \$\@";
               return <<"EOF";
 $args{src}: $gen0 $deps
-	$generator \$@
+	$recipe
 EOF
           }
           return <<"EOF";
 $args{src}: $gen0 $deps
 	\$(CC) $incs $cppflags $defs -E $gen0 | \\
-	\$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@
+	$tofile \$@ \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print'
 EOF
       } elsif ($gen0 =~ m|^.*\.in$|) {
           #
@@ -1683,7 +1754,8 @@ EOF

           return <<"EOF";
 $args{src}: $gen0 $deps
-	\$(PERL)$perlmodules "$dofile" "-o$target{build_file}" $gen0$gen_args > \$@
+	$tofile \$@ \\
+		\$(PERL)$perlmodules "$dofile" "-o$target{build_file}" $gen0$gen_args
 EOF
       } elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) {
           #
@@ -1696,7 +1768,9 @@ EOF
           # Use $(PERL) to execute wrap.pl directly to avoid calling env
           return <<"EOF";
 $args{src}: $gen0 $deps \$(BLDDIR)/util/wrap.pl
-	\$(PERL) \$(BLDDIR)/util/wrap.pl $gen0$gen_args > \$@
+	@{[ $writes_own_files
+	    ? "\$(PERL) \$(BLDDIR)/util/wrap.pl $gen0$gen_args > \$\@"
+	    : "$tofile \$\@ \$(PERL) \$(BLDDIR)/util/wrap.pl $gen0$gen_args" ]}
 EOF
       } else {
           #
@@ -1704,7 +1778,9 @@ EOF
           #
           return <<"EOF";
 $args{src}: $gen0 $deps
-	\$(PERL)$gen_incs $gen0$gen_args > \$@
+	@{[ $writes_own_files
+	    ? "\$(PERL)$gen_incs $gen0$gen_args > \$\@"
+	    : "$tofile \$\@ \$(PERL)$gen_incs $gen0$gen_args" ]}
 EOF
       }
   }
@@ -1897,13 +1973,27 @@ $import: $full
 EOF
           }
       }
-      $recipe .= <<"EOF";
+      if (!run_on_windows()) {
+          $recipe .= <<"EOF";
 $full: $fulldeps
 	\$(CC) \$(LIB_CFLAGS) $linkflags\$(LIB_LDFLAGS)$shared_soname$shared_imp \\
 		-o $full$shared_def \\
 		$fullobjs \\
 		$linklibs \$(LIB_EX_LIBS)
 EOF
+      } else {
+          $recipe .= <<"EOF";
+$full: $fulldeps
+	\$(file >\$@.lst, \\
+		$fullobjs \\
+	)
+	\$(CC) \$(LIB_CFLAGS) $linkflags\$(LIB_LDFLAGS)$shared_soname$shared_imp \\
+		-o $full$shared_def \\
+		@\$@.lst \\
+		$linklibs \$(LIB_EX_LIBS)
+	rm -f \$@.lst
+EOF
+      }
       if (windowsdll()) {
           $recipe .= <<"EOF";
 	rm -f apps/$full
@@ -2008,6 +2098,15 @@ EOF
               push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
           }
       }
+      my $wrapflags = '';
+      if (defined $unified_info{wraps}->{$args{bin}}) {
+          $wrapflags = ' ' . join(' ',
+                                  map { "-Wl,--wrap=$_" }
+                                  @{$unified_info{wraps}->{$args{bin}}});
+      }
+      my $utlibs = $unified_info{unit_test_libs}->{$args{bin}};
+      $utlibs = $utlibs ne '' ? ' ' . $utlibs : '' if defined $utlibs;
+      $utlibs //= '';
       my $linkflags = join("", map { $_." " } @linkdirs);
       my $linklibs = join("", map { $_." " } @linklibs);
       my $cmd = '$(CC)';
@@ -2025,10 +2124,10 @@ EOF
       return <<"EOF";
 $bin: $deps
 	rm -f $bin
-	\$\${LDCMD:-$cmd} $cmdflags $linkflags\$(BIN_LDFLAGS) \\
+	\$\${LDCMD:-$cmd} $cmdflags $linkflags\$(BIN_LDFLAGS)$wrapflags \\
 		-o $bin \\
 		$objs \\
-		$linklibs\$(BIN_EX_LIBS)
+		$linklibs\$(BIN_EX_LIBS)$utlibs
 EOF
   }
   sub in2script {
@@ -2040,10 +2139,9 @@ EOF
                            rel2abs($config{builddir}));
       return <<"EOF";
 $script: $sources configdata.pm
-	\$(RM) "$script"
-	\$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
-	    "-o$target{build_file}" $sources > "$script"
-	chmod a+x $script
+	\$(PERL) \$(SRCDIR)/util/file-from-stdout.pl -x "$script" \\
+	    \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
+	    "-o$target{build_file}" $sources
 EOF
   }
   sub generatedir {
diff --git a/deps/openssl/openssl/Configurations/windows-makefile.tmpl b/deps/openssl/openssl/Configurations/windows-makefile.tmpl
index e553e8f9fec..747d145d7f5 100644
--- a/deps/openssl/openssl/Configurations/windows-makefile.tmpl
+++ b/deps/openssl/openssl/Configurations/windows-makefile.tmpl
@@ -102,29 +102,15 @@ INSTALL_SHLIBPDBS={-
                   grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
                   @{$unified_info{libraries}})
 -}
-INSTALL_ENGINES={-
-        join(" ", map { quotify1(platform->dso($_)) }
-                  grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
-                         && $unified_info{attributes}->{modules}->{$_}->{engine} }
-                  @{$unified_info{modules}})
--}
-INSTALL_ENGINEPDBS={-
-        join(" ", map { quotify1(platform->dsopdb($_)) }
-                  grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
-                         && $unified_info{attributes}->{modules}->{$_}->{engine} }
-                  @{$unified_info{modules}})
--}
 INSTALL_MODULES={-
         join(" ", map { quotify1(platform->dso($_)) }
                   grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
-                          && !$unified_info{attributes}->{modules}->{$_}->{engine}
                           && !$unified_info{attributes}->{modules}->{$_}->{fips} }
                   @{$unified_info{modules}})
 -}
 INSTALL_MODULEPDBS={-
         join(" ", map { quotify1(platform->dsopdb($_)) }
-                  grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
-                         && !$unified_info{attributes}->{modules}->{$_}->{engine} }
+                  grep { !$unified_info{attributes}->{modules}->{$_}->{noinst} }
                   @{$unified_info{modules}})
 -}
 INSTALL_FIPSMODULE={-
@@ -231,23 +217,15 @@ MODULESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath catpath);
                   our $modulesdir_dir =
                       catdir($modulesprefix_dir, "ossl-modules");
                   our $modulesdir = catpath($modulesdir_dev, $modulesdir_dir);
-                  our $enginesdir_dev = $modulesprefix_dev;
-                  our $enginesdir_dir =
-                      catdir($modulesprefix_dir, "engines-$sover_dirname");
-                  our $enginesdir = catpath($enginesdir_dev, $enginesdir_dir);
                   $modulesdir_dev -}
 MODULESDIR_dir={- canonpath($modulesdir_dir) -}
-ENGINESDIR_dev={- $enginesdir_dev -}
-ENGINESDIR_dir={- canonpath($enginesdir_dir) -}
 !IF "$(DESTDIR)" != ""
 INSTALLTOP=$(DESTDIR)$(INSTALLTOP_dir)
 OPENSSLDIR=$(DESTDIR)$(OPENSSLDIR_dir)
-ENGINESDIR=$(DESTDIR)$(ENGINESDIR_dir)
 MODULESDIR=$(DESTDIR)$(MODULESDIR_dir)
 !ELSE
 INSTALLTOP=$(INSTALLTOP_dev)$(INSTALLTOP_dir)
 OPENSSLDIR=$(OPENSSLDIR_dev)$(OPENSSLDIR_dir)
-ENGINESDIR=$(ENGINESDIR_dev)$(ENGINESDIR_dir)
 MODULESDIR=$(MODULESDIR_dev)$(MODULESDIR_dir)
 !ENDIF

@@ -345,7 +323,6 @@ LIB_CPPFLAGS={- our $lib_cppflags =
                 join(' ', $lib_cppflags,
                           (map { '-D'.quotify1($_) }
                                "OPENSSLDIR=\"$openssldir\"",
-                               "ENGINESDIR=\"$enginesdir\"",
                                "MODULESDIR=\"$modulesdir\""),
                           '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
 LIB_CFLAGS={- join(' ', $target{lib_cflags} || (),
@@ -403,6 +380,9 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
                          '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
 BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)

+CMOCKA_LIBS={- $config{cmocka_libs} // '' -}
+DETOURS_LIBS={- $config{detours_libs} // '' -}
+
 # CPPFLAGS_Q is used for one thing only: to build up buildinf.h
 CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
               $cppflags2 =~ s|([\\"])|\\$1|g;
@@ -419,6 +399,8 @@ PROCESSOR= {- $config{processor} -}
 {- dependmagic('build_libs'); -}: build_libs_nodep
 {- dependmagic('build_modules'); -}: build_modules_nodep
 {- dependmagic('build_programs'); -}: build_programs_nodep
+{- dependmagic('build_inst_sw'); -}: build_libs_nodep build_modules_nodep build_inst_programs_nodep copy-utils
+{- dependmagic('build_inst_programs'); -}: build_inst_programs_nodep

 build_docs: build_html_docs
 build_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7)
@@ -431,6 +413,8 @@ build_modules_nodep: $(MODULES)
 	@
 build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
 	@
+build_inst_programs_nodep: $(INSTALL_PROGRAMS) $(SCRIPTS)
+	@

 # Kept around for backward compatibility
 build_apps build_tests: build_programs
@@ -469,20 +453,19 @@ uninstall: {- "uninstall_docs" if !$disabled{docs}; -} uninstall_sw {- $disabled

 libclean:
 	"$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """{.,apps,test,fuzz}/$$1.*"""; } @ARGV" $(SHLIBS)
-	-del /Q /F $(LIBS) libcrypto.* libssl.* ossl_static.pdb
+	-del /Q /F $(LIBS) libcrypto.* libssl.*

 clean: libclean
-	{- join("\n\t", map { "-del /Q /F $_" } @HTMLDOCS1) || "\@rem" -}
-	{- join("\n\t", map { "-del /Q /F $_" } @HTMLDOCS3) || "\@rem" -}
-	{- join("\n\t", map { "-del /Q /F $_" } @HTMLDOCS5) || "\@rem" -}
-	{- join("\n\t", map { "-del /Q /F $_" } @HTMLDOCS7) || "\@rem" -}
-	{- join("\n\t", map { "-del /Q /F $_" } @PROGRAMS) || "\@rem" -}
-	{- join("\n\t", map { "-del /Q /F $_" } @MODULES) || "\@rem" -}
-	{- join("\n\t", map { "-del /Q /F $_" } @SCRIPTS) || "\@rem" -}
-	{- join("\n\t", map { "-del /Q /F $_" } @GENERATED_MANDATORY) || "\@rem" -}
-	{- join("\n\t", map { "-del /Q /F $_" } @GENERATED) || "\@rem" -}
+	{- join("\n\t", map { "-if exist $_ del /Q /F $_" } @HTMLDOCS1) || "\@rem" -}
+	{- join("\n\t", map { "-if exist $_ del /Q /F $_" } @HTMLDOCS3) || "\@rem" -}
+	{- join("\n\t", map { "-if exist $_ del /Q /F $_" } @HTMLDOCS5) || "\@rem" -}
+	{- join("\n\t", map { "-if exist $_ del /Q /F $_" } @HTMLDOCS7) || "\@rem" -}
+	{- join("\n\t", map { "-if exist $_ del /Q /F $_" } @PROGRAMS) || "\@rem" -}
+	{- join("\n\t", map { "-if exist $_ del /Q /F $_" } @MODULES) || "\@rem" -}
+	{- join("\n\t", map { "-if exist $_ del /Q /F $_" } @SCRIPTS) || "\@rem" -}
+	{- join("\n\t", map { "-if exist $_ del /Q /F $_" } @GENERATED_MANDATORY) || "\@rem" -}
+	{- join("\n\t", map { "-if exist $_ del /Q /F $_" } @GENERATED) || "\@rem" -}
 	-del /Q /S /F *.d *.obj *.pdb *.ilk *.manifest
-	-del /Q /S /F engines\*.lib engines\*.exp
 	-del /Q /S /F apps\*.lib apps\*.rc apps\*.res apps\*.exp
 	-del /Q /S /F test\*.exp
 	-@if exist "$(RESULT_D)" rd /Q /S "$(RESULT_D)"
@@ -499,16 +482,16 @@ depend: makefile

 # Install helper targets #############################################

-install_sw: install_dev install_engines install_modules install_runtime
+install_sw: install_dev install_modules install_runtime

-uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev
+uninstall_sw: uninstall_runtime uninstall_modules uninstall_dev

 install_docs: install_html_docs

 uninstall_docs: uninstall_html_docs

 {- output_off() if $disabled{fips}; "" -}
-install_fips: build_sw $(INSTALL_FIPSMODULECONF)
+install_fips: build_inst_sw $(INSTALL_FIPSMODULECONF)
 #	@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
 	@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(MODULESDIR)"
 	@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)"
@@ -565,8 +548,6 @@ install_dev: install_runtime_libs
 				       "$(INSTALLTOP)\include\openssl"
 	@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(libdir)"
 	@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_LIBS) "$(libdir)"
-	@if "$(SHLIBS)"=="" \
-	 "$(PERL)" "$(SRCDIR)\util\copy.pl" ossl_static.pdb "$(libdir)"
 	@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(CMAKECONFIGDIR)"
 	@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_EXPORTERS_CMAKE) "$(CMAKECONFIGDIR)"

@@ -574,17 +555,6 @@ uninstall_dev:

 _install_modules_deps: install_runtime_libs build_modules

-install_engines: _install_modules_deps
-	@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
-	@$(ECHO) "*** Installing engines"
-	@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)"
-	@if not "$(INSTALL_ENGINES)"=="" \
-	 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)"
-	@if not "$(INSTALL_ENGINES)"=="" \
-	 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINEPDBS) "$(ENGINESDIR)"
-
-uninstall_engines:
-
 install_modules: _install_modules_deps
 	@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
 	@$(ECHO) "*** Installing modules"
@@ -608,7 +578,7 @@ install_runtime_libs: build_libs
 	 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBPDBS) \
                                         "$(INSTALLTOP)\bin"

-install_programs: install_runtime_libs build_programs
+install_programs: install_runtime_libs build_inst_programs
 	@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
 	@$(ECHO) "*** Installing runtime programs"
 	@if not "$(INSTALL_PROGRAMS)"=="" \
@@ -616,10 +586,10 @@ install_programs: install_runtime_libs build_programs
 	@if not "$(INSTALL_PROGRAMS)"=="" \
 	 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMS) \
                                         "$(INSTALLTOP)\bin"
-	@if not "$(INSTALL_PROGRAMS)"=="" \
+	@if not "$(INSTALL_PROGRAMPDBS)"=="" \
 	 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMPDBS) \
                                         "$(INSTALLTOP)\bin"
-	@if not "$(INSTALL_PROGRAMS)"=="" \
+	@if not "$(BIN_SCRIPTS)"=="" \
 	 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(BIN_SCRIPTS) \
                                         "$(INSTALLTOP)\bin"

@@ -721,10 +691,26 @@ EOF
   # (in the build tree), but quotes paths of non-generated dependencies (in the
   # source tree). This is a workaround for a limitation of C++Builder's make.exe
   # in handling quoted paths: https://quality.embarcadero.com/browse/RSP-31756
+  # Configure runs the generator script itself through cleanfile(), which
+  # yields native (backslash) paths on Windows, but the remaining generator
+  # arguments are carried over verbatim from build.info.  Arguments written
+  # as $(SRCDIR)/... or $(BLDDIR)/... therefore arrive with forward slashes;
+  # convert those to backslashes and quote them so a path containing spaces
+  # survives the shell.  Anything else is a flag or a bare file name and is
+  # left alone.
+  sub generatearg {
+      my $arg = shift;
+      if ($arg =~ /\$\((?:SRCDIR|BLDDIR)\)/) {
+          $arg =~ s|/|\\|g;
+          return "\"$arg\"";
+      }
+      return $arg;
+  }
+
   sub generatesrc {
       my %args = @_;
       my $gen0 = $args{generator}->[0];
-      my $gen_args = join('', map { " $_" }
+      my $gen_args = join('', map { " ".generatearg($_) }
                               @{$args{generator}}[1..$#{$args{generator}}]);
       my $gen_incs = join("", map { " -I\"$_\"" } @{$args{generator_incs}});
       my $incs = join("", map { " -I\"$_\"" } @{$args{incs}});
@@ -842,7 +828,9 @@ EOF

           return <<"EOF";
 $args{src}: "$gen0" $deps
+	if exist \$@ attrib -r \$@
 	"\$(PERL)"$perlmodules "$dofile" "-o$target{build_file}" "$gen0"$gen_args > \$@
+	attrib +r \$@
 EOF
       } elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) {
           #
@@ -1032,11 +1020,14 @@ EOF
      my $ress = join($target{ld_resp_delim}, @ress);
      my $linklibs = join("", map { "$_$target{ld_resp_delim}" } @deps);
      my $deps = join(" ", @objs, @ress, @deps);
+     my $utlibs = $unified_info{unit_test_libs}->{$args{bin}};
+     $utlibs = (defined $utlibs && $utlibs ne '')
+               ? "$utlibs$target{ld_resp_delim}" : '';
      return <<"EOF";
 $bin: $deps
 	IF EXIST $bin.manifest DEL /F /Q $bin.manifest
 	\$(LD) \$(LDFLAGS) \$(BIN_LDFLAGS) @<<
-$objs$target{ld_resp_delim}\$(LDOUTFLAG)$bin$target{ldpostoutflag}$target{ld_resp_delim}$linklibs\$(BIN_EX_LIBS)$target{ldresflag}$target{ldresflag}$ress
+$objs$target{ld_resp_delim}\$(LDOUTFLAG)$bin$target{ldpostoutflag}$target{ld_resp_delim}$utlibs$linklibs\$(BIN_EX_LIBS)$target{ldresflag}$target{ldresflag}$ress
 <<
 	IF EXIST $bin.manifest \\
 	   \$(MT) \$(MTFLAGS) \$(MTINFLAG)$bin.manifest \$(MTOUTFLAG)$bin
@@ -1051,8 +1042,10 @@ EOF
                            rel2abs($config{builddir}));
       return <<"EOF";
 $script: $sources configdata.pm
+	if exist $script attrib -r $script
 	"\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
 	    "-o$target{build_file}" $sources > \$@
+	attrib +r $script
 EOF
   }
   sub generatedir {
diff --git a/deps/openssl/openssl/Configure b/deps/openssl/openssl/Configure
index 1b020faadb0..e66424aa400 100755
--- a/deps/openssl/openssl/Configure
+++ b/deps/openssl/openssl/Configure
@@ -27,7 +27,7 @@ use OpenSSL::config;
 my $orig_death_handler = $SIG{__DIE__};
 $SIG{__DIE__} = \&death_handler;

-my $usage="Usage: Configure [no-<feature> ...] [enable-<feature> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]thread-pool] [[no-]default-thread-pool] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]\n";
+my $usage="Usage: Configure [no-<feature> ...] [enable-<feature> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]thread-pool] [[no-]default-thread-pool] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] [--manpage-format={roff,mdoc}] [--help] os/compiler[:flags]\n";

 my $banner = <<"EOF";

@@ -96,7 +96,7 @@ EOF
 #               [don't] allow default thread pool functionality
 # [no-]shared   [don't] try to create shared libraries when supported.
 # [no-]pic      [don't] try to build position independent code when supported.
-#               If disabled, it also disables shared and dynamic-engine.
+#               If disabled, it also disables shared.
 # no-asm        do not use assembler
 # no-egd        do not compile support for the entropy-gathering daemon APIs
 # [no-]zlib     [don't] compile support for zlib compression.
@@ -171,16 +171,17 @@ my @gcc_devteam_warn = qw(
     -Wextra
     -Wno-unused-parameter
     -Wno-missing-field-initializers
-    -Wno-unterminated-string-initialization
     -Wswitch
     -Wsign-compare
     -Wshadow
     -Wformat
-    -Wno-type-limits
+    -Wtype-limits
     -Wundef
     -Werror
     -Wmissing-prototypes
     -Wstrict-prototypes
+    -Wpointer-arith
+    -Wfloat-conversion
 );

 # These are used in addition to $gcc_devteam_warn when the compiler is clang.
@@ -236,7 +237,8 @@ my $apitable = {

 # From 3.0 and on, we internalise the given version number in decimal
 # as MAJOR * 10000 + MINOR * 100 + 0
-my @post30_versions = ([3, 0], [3, 1], [3, 2], [3, 3], [3, 4], [3, 5],
+my @post30_versions = ([3, 0], [3, 1], [3, 2], [3, 3], [3, 4], [3, 5], [3, 6],
+                       [4, 0], [4, 1],
                        );

 # The numbering used changes from 3.0 and on because we updated
@@ -293,6 +295,7 @@ my $dofile = abs2rel(catfile($srcdir, "util/dofile.pl"));

 my $local_config_envname = 'OPENSSL_LOCAL_CONFIG_DIR';

+$config{manpage_format} = "roff";
 $config{sourcedir} = abs2rel($srcdir, $blddir);
 $config{builddir} = abs2rel($blddir, $blddir);
 # echo -n 'holy hand grenade of antioch' | openssl sha256
@@ -418,66 +421,121 @@ my $auto_threads=1;    # enable threads automatically? true by default
 my $default_ranlib;

 # Known TLS and DTLS protocols
-my @tls = qw(ssl3 tls1 tls1_1 tls1_2 tls1_3);
-my @dtls = qw(dtls1 dtls1_2);
+my @tls = qw(tls1 tls1_1 tls1_2 tls1_3);
+my @dtls = qw(dtls1 dtls1_2 dtls1_3);

 # Explicitly known options that are possible to disable.  They can
 # be regexps, and will be used like this: /^no-${option}$/
 # For developers: keep it sorted alphabetically

-my @disablables = (
-    "acvp-tests",
-    "afalgeng",
-    "apps",
+my @disablables_protocols = (
+  "cmp",
+  "dtls",
+  "http",
+  "ocsp",
+  "ktls",
+  "tls",
+  "tls-deprecated-ec",
+  "quic",
+  "sctp",
+  "srp",
+  "srtp"
+);
+
+foreach my $proto ((@tls, @dtls))
+        {
+        push(@disablables_protocols, $proto);
+        push(@disablables_protocols, "$proto-method") unless $proto eq "tls1_3" || $proto eq "dtls1_3";
+        }
+
+my @disablables_algorithms = (
     "argon2",
     "aria",
+    "bf",
+    "blake2",
+    "brotli",
+    "camellia",
+    "cast",
+    "chacha",
+    "cmac",
+    "cms",
+    "comp",
+    "des",
+    "dh",
+    "dsa",
+    "hmac-drbg-kdf",
+    "ec",
+    "ec2m",
+    "ecx",
+    "kbkdf",
+    "krb5kdf",
+    "gost",
+    "idea",
+    "ikev2kdf",
+    "md2",
+    "md4",
+    "md5",
+    "mdc2",
+    "ml-dsa",
+    "ml-kem",
+    "lms",
+    "ocb",
+    "poly1305",
+    "psk",
+    "pvkkdf",
+    "rc2",
+    "rc4",
+    "rc5",
+    "rmd160",
+    "scrypt",
+    "seed",
+    "siphash",
+    "slh-dsa",
+    "siv",
+    "snmpkdf",
+    "sm2",
+    "sm3",
+    "sm4",
+    "srtpkdf",
+    "sshkdf",
+    "sskdf",
+    "x942kdf",
+    "x963kdf",
+    "whirlpool",
+    "zlib",
+    "zstd",
+);
+
+my @disablables_features = (
+    "acvp-tests",
+    "apps",
     "asan",
     "asm",
     "async",
-    "atexit",
     "autoalginit",
     "autoerrinit",
     "autoload-config",
-    "bf",
-    "blake2",
-    "brotli",
     "brotli-dynamic",
     "buildtest-c++",
     "bulk",
     "cached-fetch",
-    "camellia",
-    "capieng",
+    "dgram",
     "winstore",
-    "cast",
-    "chacha",
-    "cmac",
-    "cmp",
-    "cms",
-    "comp",
     "crypto-mdebug",
+    "allocfail-tests",
     "ct",
+    "ct-validation",
     "default-thread-pool",
     "demos",
     "h3demo",
     "hqinterop",
     "deprecated",
-    "des",
-    "devcryptoeng",
-    "dgram",
-    "dh",
     "docs",
-    "dsa",
     "dso",
-    "dtls",
-    "dynamic-engine",
-    "ec",
-    "ec2m",
+    "ech",
+    "ec_explicit_curves",
     "ec_nistp_64_gcc_128",
-    "ecdh",
-    "ecdsa",
-    "ecx",
     "egd",
-    "engine",
     "err",
     "external-tests",
     "filenames",
@@ -487,86 +545,48 @@ my @disablables = (
     "fips-jitter",
     "fuzz-afl",
     "fuzz-libfuzzer",
-    "gost",
-    "http",
-    "idea",
     "integrity-only-ciphers",
     "jitter",
-    "ktls",
     "legacy",
-    "loadereng",
     "makedepend",
-    "md2",
-    "md4",
-    "mdc2",
-    "ml-dsa",
-    "ml-kem",
     "module",
     "msan",
     "multiblock",
     "nextprotoneg",
-    "ocb",
-    "ocsp",
-    "padlockeng",
     "pic",
     "pie",
     "pinshared",
-    "poly1305",
     "posix-io",
-    "psk",
-    "quic",
     "unstable-qlog",
-    "rc2",
-    "rc4",
-    "rc5",
     "rdrand",
     "rfc3779",
-    "rmd160",
-    "scrypt",
-    "sctp",
     "secure-memory",
-    "seed",
     "shared",
-    "siphash",
-    "siv",
-    "slh-dsa",
-    "sm2",
     "sm2-precomp",
-    "sm3",
-    "sm4",
     "sock",
-    "srp",
-    "srtp",
     "sse2",
-    "ssl",
     "ssl-trace",
-    "static-engine",
+    "static-vcruntime",
     "stdio",
     "sslkeylog",
     "tests",
     "tfo",
     "thread-pool",
     "threads",
-    "tls",
-    "tls-deprecated-ec",
     "trace",
     "ts",
     "ubsan",
     "ui-console",
     "unit-test",
+    "unit-tests",
     "uplink",
     "weak-ssl-ciphers",
-    "whirlpool",
-    "zlib",
     "zlib-dynamic",
-    "zstd",
     "zstd-dynamic",
-    );
-foreach my $proto ((@tls, @dtls))
-        {
-        push(@disablables, $proto);
-        push(@disablables, "$proto-method") unless $proto eq "tls1_3";
-        }
+
+);
+
+my @disablables = sort (@disablables_protocols,@disablables_algorithms,@disablables_features);

 # Internal disablables, for aliasing purposes.  They serve no special
 # purpose here, but allow scripts to get to know them through configdata.pm,
@@ -577,19 +597,31 @@ my @disablables_int = qw(
     );

 my %deprecated_disablables = (
+    "atexit" => undef,
+    "engine" => undef,
+    "static-engine" => undef,
+    "dynamic-engine" => undef,
+    "afalgeng" => undef,
+    "capieng" => undef,
+    "devcryptoeng" => undef,
+    "loadereng" => undef,
+    "padlockeng" => undef,
     "ssl2" => undef,
     "buf-freelists" => undef,
-    "crypto-mdebug-backtrace" => undef,
-    "hw" => "hw",               # causes cascade, but no macro
-    "hw-padlock" => "padlockeng",
+    "hw" => undef,
+    "hw-padlock" => undef,
     "ripemd" => "rmd160",
     "ui" => "ui-console",
     "heartbeats" => undef,
+    "ssl" => undef,
+    "ssl3" => undef,
+    "ssl3-method" => undef,
     );

 # All of the following are disabled by default:

 our %disabled = ( # "what"         => "comment"
+                  "atexit"              => "default",
                   "fips"                => "default",
                   "fips-jitter"         => "default",
                   "asan"                => "default",
@@ -597,30 +629,34 @@ our %disabled = ( # "what"         => "comment"
                   "brotli-dynamic"      => "default",
                   "buildtest-c++"       => "default",
                   "crypto-mdebug"       => "default",
-                  "crypto-mdebug-backtrace" => "default",
+                  "allocfail-tests"     => "default",
+                  "ct-validation"       => "default",
                   "demos"               => "default",
                   "h3demo"              => "default",
                   "hqinterop"           => "default",
-                  "devcryptoeng"        => "default",
+                  "ec_explicit_curves" => "default",
                   "ec_nistp_64_gcc_128" => "default",
                   "egd"                 => "default",
+                  "engine"              => "default",
                   "external-tests"      => "default",
                   "fuzz-afl"            => "default",
                   "fuzz-libfuzzer"      => "default",
                   "pie"                 => "default",
                   "jitter"              => "default",
                   "ktls"                => "default",
+                  "lms"                 => "default",
                   "md2"                 => "default",
                   "msan"                => "default",
                   "rc5"                 => "default",
                   "sctp"                => "default",
-                  "ssl3"                => "default",
-                  "ssl3-method"         => "default",
                   "sslkeylog"           => "default",
+                  "static-vcruntime"    => "default",
                   "tfo"                 => "default",
+                  "tls-deprecated-ec"   => "default",
                   "trace"               => "default",
                   "ubsan"               => "default",
                   "unit-test"           => "default",
+                  "unit-tests"          => "default",
                   "weak-ssl-ciphers"    => "default",
                   "zlib"                => "default",
                   "zlib-dynamic"        => "default",
@@ -632,32 +668,32 @@ our %disabled = ( # "what"         => "comment"
 my @disable_cascades = (
     # "what"            => [ "cascade", ... ]
     "bulk"              => [ "shared", "dso",
-                             "aria", "async", "atexit", "autoload-config",
+                             "argon2", "aria", "async", "autoload-config",
                              "blake2", "bf", "camellia", "cast", "chacha",
                              "cmac", "cms", "cmp", "comp", "ct",
                              "des", "dgram", "dh", "dsa",
-                             "ec", "engine",
-                             "filenames",
-                             "idea", "ktls",
+                             "ec", "ech",
+                             "filenames", "hmac-drbg-kdf",
+                             "idea", "ikev2kdf", "kbkdf", "krb5kdf", "ktls", "lms",
                              "md4", "ml-dsa", "ml-kem", "multiblock",
                              "nextprotoneg", "ocsp", "ocb", "poly1305", "psk",
-                             "rc2", "rc4", "rmd160",
-                             "seed", "siphash", "siv",
-                             "sm3", "sm4", "srp",
-                             "srtp", "ssl3-method", "ssl-trace",
+                             "pvkkdf", "rc2", "rc4", "rmd160",
+                             "scrypt", "seed", "siphash", "siv",
+                             "slh-dsa", "sm3", "sm4", "snmpkdf",
+                             "srp", "srtp", "srtpkdf", "sshkdf", "sskdf",
+                             "ssl-trace",
                              "tfo",
                              "ts", "ui-console", "whirlpool",
+                             "x942kdf", "x963kdf",
                              "fips-securitychecks" ],
     sub { $config{processor} eq "386" }
                         => [ "sse2" ],
-    "ssl"               => [ "ssl3" ],
-    "ssl3-method"       => [ "ssl3" ],
     "zlib"              => [ "zlib-dynamic" ],
     "brotli"            => [ "brotli-dynamic" ],
     "zstd"              => [ "zstd-dynamic" ],
     "des"               => [ "mdc2" ],
     "deprecated"        => [ "tls-deprecated-ec" ],
-    "ec"                => [ qw(ec2m ecdsa ecdh sm2 gost ecx tls-deprecated-ec) ],
+    "ec"                => [ qw(ec2m ec_explicit_curves sm2 gost ecx tls-deprecated-ec) ],
     "dgram"             => [ "dtls", "quic", "sctp" ],
     "sock"              => [ "dgram", "tfo" ],
     "dtls"              => [ @dtls ],
@@ -670,19 +706,12 @@ my @disable_cascades = (
     "tls1_3"            => [ "quic" ],
     "quic"              => [ "unstable-qlog" ],

-    "crypto-mdebug"     => [ "crypto-mdebug-backtrace" ],
+    "crypto-mdebug"     => [ "allocfail-tests" ],

-    "module"            => [ "dynamic-engine", "fips" ],
+    "module"            => [ "fips" ],

-    # Without shared libraries, dynamic engines aren't possible.
-    # This is due to them having to link with libcrypto and register features
-    # using the ENGINE functionality, and since that relies on global tables,
-    # those *have* to be exactly the same as the ones accessed from the app,
-    # which cannot be guaranteed if shared libraries aren't present.
-    # (note that even with shared libraries, both the app and dynamic engines
-    # must be linked with the same library)
-    "shared"            => [ "dynamic-engine", "uplink" ],
-    "dso"               => [ "dynamic-engine", "module" ],
+    "shared"            => [ "uplink" ],
+    "dso"               => [ "module" ],
     # Other modules don't necessarily have to link with libcrypto, so shared
     # libraries do not have to be a condition to produce those.

@@ -690,16 +719,14 @@ my @disable_cascades = (
     # or modules.
     "pic"               => [ "shared", "module" ],

-    "engine"            => [ "dynamic-engine", grep(/eng$/, @disablables) ],
-    "dynamic-engine"    => [ "loadereng" ],
-    "hw"                => [ "padlockeng" ],
+    "engine"            => [ "static-engine", "dynamic-engine" ],

     # no-autoalginit is only useful when building non-shared
     "autoalginit"       => [ "shared", "apps", "fips" ],

-    "stdio"             => [ "apps", "capieng", "egd" ],
+    "stdio"             => [ "apps", "egd" ],
     "apps"              => [ "tests" ],
-    "tests"             => [ "external-tests" ],
+    "tests"             => [ "external-tests", "unit-tests" ],
     "comp"              => [ "zlib", "brotli", "zstd" ],
     "sm3"               => [ "sm2" ],
     sub { !$disabled{"unit-test"} } => [ "heartbeats" ],
@@ -719,7 +746,7 @@ my @disable_cascades = (

     "blake2"            => [ "argon2" ],

-    "deprecated-3.0"    => [ "engine", "srp" ],
+    "deprecated-3.0"    => [ "srp" ],

     "http"              => [ "ocsp" ]
     );
@@ -834,6 +861,11 @@ $config{ex_libs} = [ env('__CNF_LDLIBS') || () ];
 $config{openssl_api_defines}=[];
 $config{openssl_sys_defines}=[];
 $config{openssl_feature_defines}=[];
+
+$config{openssl_disabled_protocols}=[];
+$config{openssl_disabled_algorithms}=[];
+$config{openssl_disabled_features}=[];
+
 $config{options}="";
 $config{build_type} = "release";
 my $target="";
@@ -894,6 +926,14 @@ while (@argvcopy)
                         $unsupported_options{$_} = 1;
                         next;
                         }
+
+                # Do not allow users to enable removed features
+                if (/^enable-(.+)$/ && exists $deprecated_disablables{$word}
+                        && $deprecated_disablables{$word} eq undef)
+                        {
+                        $unsupported_options{$_} = 1;
+                        next;
+                        }
                 }
         if (/^no-(.+)$/ || /^disable-(.+)$/)
                 {
@@ -913,11 +953,6 @@ while (@argvcopy)
                                 }
                         $disabled{"dtls"} = "option(dtls)";
                         }
-                elsif ($1 eq "ssl")
-                        {
-                        # Last one of its kind
-                        $disabled{"ssl3"} = "option(ssl)";
-                        }
                 elsif ($1 eq "tls")
                         {
                         # XXX: Tests will fail if all SSL/TLS
@@ -927,14 +962,6 @@ while (@argvcopy)
                                 $disabled{$proto} = "option(tls)";
                                 }
                         }
-                elsif ($1 eq "static-engine")
-                        {
-                        delete $disabled{"dynamic-engine"};
-                        }
-                elsif ($1 eq "dynamic-engine")
-                        {
-                        $disabled{"dynamic-engine"} = "option";
-                        }
                 elsif (exists $deprecated_disablables{$1})
                         {
                         $deprecated_options{$_} = 1;
@@ -956,15 +983,7 @@ while (@argvcopy)
                 }
         elsif (/^enable-(.+)$/)
                 {
-                if ($1 eq "static-engine")
-                        {
-                        $disabled{"dynamic-engine"} = "option";
-                        }
-                elsif ($1 eq "dynamic-engine")
-                        {
-                        delete $disabled{"dynamic-engine"};
-                        }
-                elsif ($1 eq "zlib-dynamic")
+                if ($1 eq "zlib-dynamic")
                         {
                         delete $disabled{"zlib"};
                         }
@@ -985,6 +1004,10 @@ while (@argvcopy)
                         delete $disabled{"fips"};
                         delete $disabled{"jitter"};
                         }
+                elsif (exists $deprecated_disablables{$1})
+                        {
+                        $deprecated_options{$_} = 1;
+                        }
                 my $algo = $1;
                 delete $disabled{$algo};

@@ -1022,6 +1045,14 @@ while (@argvcopy)
                 {
                 $config{build_type} = "release";
                 }
+        elsif (/^--manpage-format=(mdoc|roff)$/)
+		{
+		$config{manpage_format}="$1";
+		}
+        elsif (/^--pgo$/)
+                {
+                $config{build_type} = "pgo";
+                }
         elsif (/^386$/)
                 { $config{processor}=386; }
         elsif (/^rsaref$/)
@@ -1091,6 +1122,22 @@ while (@argvcopy)
                         {
                         $withargs{fuzzer_include}=$1;
                         }
+                elsif (/^--with-cmocka-lib=(.*)$/)
+                        {
+                        $withargs{cmocka_lib}=$1;
+                        }
+                elsif (/^--with-cmocka-include=(.*)$/)
+                        {
+                        $withargs{cmocka_include}=$1;
+                        }
+                elsif (/^--with-detours-lib=(.*)$/)
+                        {
+                        $withargs{detours_lib}=$1;
+                        }
+                elsif (/^--with-detours-include=(.*)$/)
+                        {
+                        $withargs{detours_include}=$1;
+                        }
                 elsif (/^--with-rand-seed=(.*)$/)
                         {
                         foreach my $x (split(m|,|, $1))
@@ -1158,6 +1205,10 @@ while (@argvcopy)
                         {
                         push @{$useradd{CPPFLAGS}}, $1;
                         }
+                elsif (/^--help$/)
+                        {
+                        &usage;
+                        }
                 else    # common if (/^[-+]/), just pass down...
                         {
                         # Treat %xx as an ASCII code (e.g. replace %20 by a space character).
@@ -1166,6 +1217,15 @@ while (@argvcopy)
                         $_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei;
                         push @{$useradd{CFLAGS}}, $_;
                         push @{$useradd{CXXFLAGS}}, $_;
+                        if (/^--(no|with|without|enable|disable)-(\S+)/)
+                                {
+                                # Ideally this would also cover cascades, but I lack Perl-fu.
+                                if (grep ($_ eq $2, @disablables) or exists $deprecated_disablables{$2})
+                                        {
+                                        print STDERR "NOTE: Flag --$1-$2 will be passed to the compiler.  It looks similar to a Configure\n";
+                                        print STDERR "      option, though.  If the latter is what you meant to do, drop the leading '--'.\n";
+                                        }
+                                }
                         }
                 }
         elsif (m|^/|)
@@ -1358,11 +1418,11 @@ application.

 Instead of manually seeding, a different random generator can be set
 at runtime in openssl.cnf or configured at build time with
--DOPENSSL_DEFAULT_SEED_SRC.
+-DOPENSSL_DEFAULT_SEED_SRC.  The property query used to fetch it can
+be set with -DOPENSSL_DEFAULT_SEED_PROPQ if needed.

 Please read the 'Note on random number generation' section in the
-INSTALL.md instructions and the RAND_DRBG(7) manual page for more
-details.
+INSTALL.md instructions for more details.
 ============================== WARNING ===============================

 _____
@@ -1591,12 +1651,12 @@ unless ($disabled{threads}) {
     }
 }

-# Find out if clang's sanitizers have been enabled with -fsanitize
-# flags and ensure that the corresponding %disabled elements area
-# removed to reflect that the sanitizers are indeed enabled.
+# Find out if clang's sanitizers have been enabled with -fsanitize (or
+# /fsanitize for VC targets) flags and ensure that the corresponding %disabled
+# elements area removed to reflect that the sanitizers are indeed enabled.
 my %detected_sanitizers = ();
-foreach (grep /^-fsanitize=/, @{$config{CFLAGS} || []}) {
-    (my $checks = $_) =~ s/^-fsanitize=//;
+foreach (grep { /^[-\/]fsanitize=/ } @{$config{CFLAGS} || []}) {
+    (my $checks = $_) =~ s|^[-/]fsanitize=||;
     foreach (split /,/, $checks) {
         my $d = { address       => 'asan',
                   undefined     => 'ubsan',
@@ -1626,22 +1686,22 @@ my $no_shared_warn=0;
 if (($target{shared_target} // '') eq "")
         {
         $no_shared_warn = 1
-            if (!$disabled{shared} || !$disabled{"dynamic-engine"});
+            if (!$disabled{shared});
         disable('no-shared-target', 'pic');
         }

-if ($disabled{"dynamic-engine"}) {
-        $config{dynamic_engines} = 0;
-} else {
-        $config{dynamic_engines} = 1;
-}
-
 unless ($disabled{asan} || defined $detected_sanitizers{asan}) {
-    push @{$config{cflags}}, "-fsanitize=address";
+    push @{$config{cflags}},
+        $config{target} =~ /^VC-/ ? "/fsanitize=address" : "-fsanitize=address";
 }

+my %predefined_C = compiler_predefined($config{CROSS_COMPILE}.$config{CC});
+
 unless ($disabled{ubsan} || defined $detected_sanitizers{ubsan}) {
     push @{$config{cflags}}, "-fsanitize=undefined", "-fno-sanitize-recover=all", "-DPEDANTIC";
+    if ($predefined_C{__clang__}) {
+        push @{$config{cflags}}, "-fno-sanitize=function";
+    }
 }

 unless ($disabled{msan} || defined $detected_sanitizers{msan}) {
@@ -1650,8 +1710,50 @@ unless ($disabled{msan} || defined $detected_sanitizers{msan}) {

 unless ($disabled{"fuzz-libfuzzer"} && $disabled{"fuzz-afl"}
         && $disabled{asan} && $disabled{ubsan} && $disabled{msan}) {
-    push @{$config{cflags}}, "-fno-omit-frame-pointer", "-g";
-    push @{$config{cxxflags}}, "-fno-omit-frame-pointer", "-g" if $config{CXX};
+    unless ($config{target} =~ /^VC-/) {
+        push @{$config{cflags}}, "-fno-omit-frame-pointer", "-g";
+        push @{$config{cxxflags}}, "-fno-omit-frame-pointer", "-g" if $config{CXX};
+    }
+}
+
+# Valgrind-based constant-time validation: marks secret data as "undefined"
+# to Valgrind's memcheck tool, so that any control flow or memory indexing
+# that depends on secret data is flagged as an error.  Requires valgrind
+# headers at build time and running the tests under valgrind at test time.
+# Use |make TESTS="test_internal_ml_kem test_internal_ml_dsa" test| under
+# valgrind after building with this option.
+#
+# Package names for the required valgrind headers:
+#   Debian/Ubuntu  : valgrind          (headers bundled in the main package)
+#   Fedora/RHEL    : valgrind-devel
+#   Alpine         : valgrind-dev
+#   Arch Linux     : valgrind
+unless ($disabled{"ct-validation"}) {
+    # Probe for <valgrind/memcheck.h> so that we give a clear error here
+    # rather than a cryptic compile failure inside constant_time.h later.
+    my $cc = ($config{CROSS_COMPILE} // "").$config{CC};
+    my $probe_src = "ct_valgrind_probe_$$.c";
+    my $probe_obj = "ct_valgrind_probe_$$.o";
+    open(my $fh, ">", $probe_src)
+        or die "Cannot write probe file '$probe_src': $!";
+    print $fh "#include <valgrind/memcheck.h>\n";
+    close($fh);
+    my $probe_ok = (system("$cc -c -o $probe_obj $probe_src 2>/dev/null") == 0);
+    unlink($probe_src, $probe_obj);
+    if (!$probe_ok) {
+        die <<EOT;
+
+***** enable-ct-validation requires <valgrind/memcheck.h> at build time,
+***** but the header was not found by '$cc'.
+*****
+***** Install the appropriate package and re-run Configure:
+*****   Debian/Ubuntu : sudo apt-get install valgrind
+*****   Fedora/RHEL   : sudo dnf install valgrind-devel
+*****   Alpine        : sudo apk add valgrind-dev
+*****   Arch Linux    : sudo pacman -S valgrind
+EOT
+    }
+    push @{$config{openssl_feature_defines}}, "OPENSSL_CONSTANT_TIME_VALIDATION";
 }
 #
 # Platform fix-ups
@@ -1679,7 +1781,6 @@ if ($target{sys_id} ne "")
         push @{$config{openssl_sys_defines}}, "OPENSSL_SYS_$target{sys_id}";
         }

-my %predefined_C = compiler_predefined($config{CROSS_COMPILE}.$config{CC});
 my %predefined_CXX = $config{CXX}
     ? compiler_predefined($config{CROSS_COMPILE}.$config{CXX})
     : ();
@@ -1814,30 +1915,6 @@ $config{CFLAGS} = [ map { $_ eq '--ossl-strict-warnings'
                               : ( $_ ) }
                     @{$config{CFLAGS}} ];

-unless ($disabled{afalgeng}) {
-    $config{afalgeng}="";
-    if (grep { $_ eq 'afalgeng' } @{$target{enable}}) {
-        push @{$config{engdirs}}, "afalg";
-    } else {
-        disable('not-linux', 'afalgeng');
-    }
-}
-
-unless ($disabled{devcryptoeng}) {
-    if ($target =~ m/^BSD/) {
-        my $maxver = 5*100 + 7;
-        my $sysstr = `uname -s`;
-        my $verstr = `uname -r`;
-        $sysstr =~ s|\R$||;
-        $verstr =~ s|\R$||;
-        my ($ma, $mi, @rest) = split m|\.|, $verstr;
-        my $ver = $ma*100 + $mi;
-        if ($sysstr eq 'OpenBSD' && $ver >= $maxver) {
-            disable('too-new-kernel', 'devcryptoeng');
-        }
-    }
-}
-
 unless ($disabled{ktls}) {
     $config{ktls}="";
     my $cc = $config{CROSS_COMPILE}.$config{CC};
@@ -1864,6 +1941,29 @@ unless ($disabled{winstore}) {

 push @{$config{openssl_other_defines}}, "OPENSSL_NO_KTLS" if ($disabled{ktls});

+# Keywords accepted in a build.info UNIT_TEST[] link set.
+my @unit_test_keywords = qw(cmocka detours);
+
+unless ($disabled{"unit-tests"}) {
+    if ($target =~ /^linux/ || $target =~ /^BSD/) {
+        $config{cmocka_includes} =
+            $withargs{cmocka_include} ? [$withargs{cmocka_include}] : [];
+        $config{cmocka_libs} = $withargs{cmocka_lib}
+            ? "-L$withargs{cmocka_lib} -lcmocka" : "-lcmocka";
+    } elsif ($target =~ /^VC-/) {
+        $config{cmocka_includes} =
+            $withargs{cmocka_include} ? [$withargs{cmocka_include}] : [];
+        $config{cmocka_libs} = $withargs{cmocka_lib}
+            ? "/LIBPATH:$withargs{cmocka_lib} cmocka.lib" : "cmocka.lib";
+        $config{detours_includes} =
+            $withargs{detours_include} ? [$withargs{detours_include}] : [];
+        $config{detours_libs} = $withargs{detours_lib}
+            ? "/LIBPATH:$withargs{detours_lib} detours.lib" : "detours.lib";
+    } else {
+        disable('no-unit-test-support', 'unit-tests');
+    }
+}
+
 # Get the extra flags used when building shared libraries and modules.  We
 # do this late because some of them depend on %disabled.

@@ -1932,7 +2032,7 @@ foreach my $what (sort keys %disabled) {
     $config{options} .= " no-$what";

     if (!grep { $what eq $_ } ( 'buildtest-c++', 'fips', 'threads', 'shared',
-                                'module', 'pic', 'dynamic-engine', 'makedepend',
+                                'module', 'pic', 'makedepend',
                                 'sse2', 'legacy' )) {
         (my $WHAT = uc $what) =~ s|-|_|g;
         my $skipdir = $what;
@@ -1944,18 +2044,28 @@ foreach my $what (sort keys %disabled) {
         my $macro = $disabled_info{$what}->{macro} = "OPENSSL_NO_$WHAT";
         push @{$config{openssl_feature_defines}}, $macro;

-        $skipdir{engines} = $what if $what eq 'engine';
+        my @rules = (
+            [ \@disablables_protocols,  'openssl_disabled_protocols'  ],
+            [ \@disablables_algorithms, 'openssl_disabled_algorithms' ],
+            [ \@disablables_features,   'openssl_disabled_features'   ],
+        );
+
+        for my $r (@rules) {
+            my ($list, $target) = @$r;
+
+            if (grep { $what eq $_ } @$list) {
+              push @{$config{$target}}, uc $what;
+            }
+        }
+
+        # siphash is used internally by libcrypto (X509 processing), so
+        # no-siphash only removes the provider algorithm.
         $skipdir{"crypto/$skipdir"} = $what
-            unless $what eq 'async' || $what eq 'err' || $what eq 'dso' || $what eq 'http';
+            unless $what eq 'async' || $what eq 'err' || $what eq 'dso'
+                || $what eq 'http' || $what eq 'siphash';
     }
 }

-if ($disabled{"dynamic-engine"}) {
-    push @{$config{openssl_feature_defines}}, "OPENSSL_NO_DYNAMIC_ENGINE";
-} else {
-    push @{$config{openssl_feature_defines}}, "OPENSSL_NO_STATIC_ENGINE";
-}
-
 # If we use the unified build, collect information from build.info files
 my %unified_info = ();

@@ -2081,6 +2191,8 @@ if ($builder eq "unified") {
         my %includes = ();
         my %defines = ();
         my %depends = ();
+        my %unit_tests = ();
+        my %wraps = ();
         my %generate = ();
         my %imagedocs = ();
         my %htmldocs = ();
@@ -2336,6 +2448,16 @@ if ($builder eq "unified") {
                                 \$attributes{depends}, $+{ATTRIBS},
                                 tokenize($expand_variables->($+{VALUE})))
                          if !@skip || $skip[$#skip] > 0; },
+            qr/^\s* UNIT_TEST ${index_re} \s* = \s* ${value_re} \s* $/x
+            => sub { $push_to->(\%unit_tests, $expand_variables->($+{INDEX}),
+                                undef, undef,
+                                tokenize($expand_variables->($+{VALUE})))
+                         if !@skip || $skip[$#skip] > 0; },
+            qr/^\s* WRAP ${index_re} \s* = \s* ${value_re} \s* $/x
+            => sub { $push_to->(\%wraps, $expand_variables->($+{INDEX}),
+                                undef, undef,
+                                tokenize($expand_variables->($+{VALUE})))
+                         if !@skip || $skip[$#skip] > 0; },
             qr/^\s* GENERATE ${index_re} ${attribs_re} \s* = \s* ${value_re} \s* $/x
             => sub { $push_to->(\%generate, $expand_variables->($+{INDEX}),
                                 \$attributes{generate}, $+{ATTRIBS},
@@ -2357,14 +2479,6 @@ if ($builder eq "unified") {
             );
         die "runaway IF?" if (@skip);

-        if (grep { defined $attributes{modules}->{$_}->{engine} } keys %attributes
-                and !$config{dynamic_engines}) {
-            die <<"EOF"
-ENGINES can only be used if configured with 'dynamic-engine'.
-This is usually a fault in a build.info file.
-EOF
-        }
-
         {
             my %infos = ( programs  => [ @programs  ],
                           libraries => [ @libraries ],
@@ -2630,6 +2744,27 @@ EOF
             }
         }

+        foreach my $dest (keys %wraps) {
+            my $ddest = cleanfile($buildd, $dest, $blddir);
+            foreach my $fn (@{$wraps{$dest}}) {
+                push @{$unified_info{wraps}->{$ddest}}, $fn;
+            }
+        }
+
+        foreach my $dest (keys %unit_tests) {
+            my $ddest = cleanfile($buildd, $dest, $blddir);
+            foreach my $kw (@{$unit_tests{$dest}}) {
+                die "***** Unknown keyword '$kw' in UNIT_TEST[$dest] at $sourced/$f\n"
+                    unless grep { $_ eq $kw } @unit_test_keywords;
+            }
+            $unified_info{unit_tests}->{$ddest} =
+                [ @{$unit_tests{$dest}} ];
+        }
+        # WRAP implies cmocka unless an explicit UNIT_TEST set was given
+        foreach my $dest (keys %{$unified_info{wraps} // {}}) {
+            $unified_info{unit_tests}->{$dest} //= [ "cmocka" ];
+        }
+
         foreach my $section (keys %imagedocs) {
             foreach (@{$imagedocs{$section}}) {
                 my $imagedocs = cleanfile($buildd, $_, $blddir);
@@ -2962,6 +3097,28 @@ EOF
     }
 }

+# Attach cmocka (and, on Windows, Detours) include paths to unit tests,
+# based on each test's UNIT_TEST[] link set.
+if (!$disabled{"unit-tests"}) {
+    while (my ($dest, $libs) = each %{$unified_info{unit_tests} // {}}) {
+        my %want = map { $_ => 1 } @$libs;
+        push @{$unified_info{includes}->{$dest}}, @{$config{cmocka_includes}}
+            if $want{cmocka} && @{$config{cmocka_includes} // []};
+        push @{$unified_info{includes}->{$dest}}, @{$config{detours_includes}}
+            if $want{detours} && @{$config{detours_includes} // []};
+    }
+}
+
+if (!$disabled{"unit-tests"}) {
+    foreach my $dest (sort keys %{$unified_info{unit_tests} // {}}) {
+        my %want = map { $_ => 1 } @{$unified_info{unit_tests}->{$dest}};
+        my @resolved;
+        push @resolved, '$(CMOCKA_LIBS)'  if $want{cmocka}  && $config{cmocka_libs};
+        push @resolved, '$(DETOURS_LIBS)' if $want{detours} && $config{detours_libs};
+        $unified_info{unit_test_libs}->{$dest} = join(' ', @resolved);
+    }
+}
+
 # For the schemes that need it, we provide the old *_obj configs
 # from the *_asm_obj ones
 foreach (grep /_(asm|aux)_src$/, keys %target) {
@@ -3031,9 +3188,9 @@ EOF

 print <<"EOF" if ($no_shared_warn);

-The options 'shared', 'pic' and 'dynamic-engine' aren't supported on this
+The options 'shared' and 'pic' aren't supported on this
 platform, so we will pretend you gave the option 'no-pic', which also disables
-'shared' and 'dynamic-engine'.  If you know how to implement shared libraries
+'shared'.  If you know how to implement shared libraries
 or position independent code, please let us know (but please first make sure
 you have tried with a current version of OpenSSL).
 EOF
@@ -3362,33 +3519,74 @@ sub usage
         {
         print STDERR $usage;
         print STDERR "\npick os/compiler from:\n";
-        my $j=0;
         my $i;
         my $k=0;
+        print STDERR "  ";
         foreach $i (sort keys %table)
                 {
                 next if $table{$i}->{template};
                 next if $i =~ /^debug/;
-                $k += length($i) + 1;
+                $k += length($i);
                 if ($k > 78)
                         {
-                        print STDERR "\n";
-                        $k=length($i);
+                        print STDERR "\n  ";
+                        $k=length($i) + 2;
                         }
+                $k += 1;
                 print STDERR $i . " ";
                 }
         foreach $i (sort keys %table)
                 {
                 next if $table{$i}->{template};
                 next if $i !~ /^debug/;
-                $k += length($i) + 1;
+                $k += length($i);
                 if ($k > 78)
                         {
-                        print STDERR "\n";
-                        $k=length($i);
+                        print STDERR "\n  ";
+                        $k=length($i) + 2;
                         }
+                $k += 1;
                 print STDERR $i . " ";
                 }
+        print STDERR "\n";
+
+        disable();
+
+        # Do some color wizardry.  Ideally, this would be done by a library and
+        # would use proper termcap/terminfo, but we would rather avoid external
+        # dependencies.  It's disabled by default unless you define CLICOLOR in
+        # your env.  (We approximate ls(1)'s behavior in BSD in this regard.)
+        my $en_color="";
+        my $dis_color="";
+        my $reset_color="";
+        my $this_color;
+        if ( defined $ENV{'CLICOLOR'} and (defined $ENV{'CLICOLOR_FORCE'} or -t 2) )
+                {
+                $en_color="\e[1;32m";  # bold green
+                $dis_color="\e[3;2m";  # dim italic
+                $reset_color="\e[0;0m";
+                }
+
+        print STDERR "The following ${en_color}ENABLED${reset_color} and ${dis_color}disabled${reset_color} flags are available:\n  ";
+        $k = 2;
+        foreach $i (sort @disablables)
+                {
+                $this_color=$dis_color;
+                $k += length($i);
+                if (not exists $disabled{$i})
+                        {
+                        $this_color=$en_color;
+                        $i = uc $i;
+                        }
+                if ($k > 78)
+                        {
+                        print STDERR "\n  ";
+                        $k=length($i) + 2;
+                        }
+                $k += 1;
+                print STDERR "${this_color}${i}${reset_color} ";
+                }
+        print STDERR "\n";
         exit(1);
         }

diff --git a/deps/openssl/openssl/DOCUMENTATION.md b/deps/openssl/openssl/DOCUMENTATION.md
new file mode 100644
index 00000000000..05bbb8564c9
--- /dev/null
+++ b/deps/openssl/openssl/DOCUMENTATION.md
@@ -0,0 +1,194 @@
+OpenSSL Documentation Policy
+============================
+
+This document describes the code documentation and commenting requirements
+for the OpenSSL project.
+
+The project's documentation is about making the libraries and tools more
+accessible to our users and making the code more maintainable. This policy
+applies to new submissions; existing code does not uniformly conform to it
+and will be brought up to standard gradually.
+
+Any non-trivial change to existing code must bring the affected code into
+conformance with this policy as part of the same change. In particular,
+renaming or relocating functions, changes to public APIs, and any change
+that would render an existing POD page or in-source comment inaccurate
+require the corresponding documentation to be updated. This includes
+adding documentation that was previously absent where the change brings
+the affected code within the scope of this policy.
+
+The form and style of code comments themselves -- comment markers, layout,
+the use of `/**` and `/*-` blocks, doxygen markup, the structure of the
+sample multi-line comment, and similar -- are described in
+[STYLE.md](STYLE.md). This file describes what *must* be documented and
+where; [STYLE.md](STYLE.md) describes how code comments look.
+
+Command line commands and arguments
+-----------------------------------
+
+All new commands, as well as new or modified arguments to existing
+commands, must be documented in the `doc/man1` directory. This
+documentation is in POD format.
+
+Public symbols in the libraries
+-------------------------------
+
+All new public symbols must be documented in a POD manual page in the
+`doc/man3` directory. This includes types, macros, and functions.
+
+The allowed exceptions are:
+
+- guard macros preventing a header file being included twice
+- new symbols generated automatically via `make update` (errors, objects, etc.)
+
+Each public function's declaration in its public header must carry a
+doxygen comment block. The block's `@see` must include the function's
+own manual page (`name(3)`) and may include additional manual pages
+that a caller needs to use the function correctly. The doxygen block
+is a navigation aid pointing to the canonical reference documentation
+in the corresponding POD file; see [STYLE.md](STYLE.md) for the
+doxygen form.
+
+Overviews, conventions, et al
+-----------------------------
+
+Where additional user-facing information is required, it should be
+included in the `doc/man7` section. This includes, but is not limited to:
+
+- algorithm descriptions and parameters
+- architectural and subsystem overviews
+- user guides and tutorials
+- conventions and reference material (environment variables, glossary,
+  threading rules, file format conventions)
+
+Internal functions, structures, globals and macros
+--------------------------------------------------
+
+Internal functions, structures, globals and macros are non-public
+items declared in any header that is not part of the public API.
+These include items declared in:
+
+- `include/internal/` (shared across subsystems);
+- `include/crypto/` (cryptographic internals);
+- per-directory local headers (for example, `crypto/asn1/asn1_local.h`)
+  shared between source files in a single subdirectory.
+
+These should all be documented at the declaration site -- that is,
+in the header that declares them -- using a doxygen-style comment
+block. For functions, this places the comment at the prototype,
+where editor tooling (clangd and similar) can surface it to readers
+at every call site. The comment should describe the purpose and,
+for functions, the input and output arguments and the return value.
+See [STYLE.md](STYLE.md) for the doxygen conventions used by OpenSSL.
+
+For *trivial* items, where their operation is obvious from their
+implementation, the documentation requirement is not mandated. The
+following are generally representative of trivial items, however it is
+quite possible for any of these to be non-trivial in specific instances
+and therefore require documentation:
+
+- `OSSL_DISPATCH` tables
+- upref functions
+- free functions
+- simple getter/setter functions
+- wrappers for other functions (a function that calls a more recent
+  `_ex` variant or a group of functions that call a common internal
+  routine)
+
+For structures, each of the fields should be commented stating its
+purpose. Again, a *trivial* exception applies where the purpose is
+obvious. Some representative examples:
+
+- `OSSL_LIB_CTX *ctx;` where there is only one library context referenced
+  in the structure.
+- `struct *next;` in a linked list implementation.
+- `CRYPTO_REF_COUNT refcnt;`
+
+File-local items
+----------------
+
+These are functions, structures, globals, and macros that are local
+to a single C file: `static` functions, file-scope variables,
+structures, and macros defined inside a `.c` file with no declaration
+in any header.
+
+These should all be documented at the point of definition. Follow the
+same rules and exceptions as for internal items above. In some cases
+slightly more leniency with respect to *trivial* can be tolerated.
+
+Code comments
+-------------
+
+The form, style, and content guidance for code comments are described in
+[STYLE.md](STYLE.md). Comments are required at the points described in
+the internal and static sections above, subject to the *trivial*
+exception, and at the additional points described in
+[STYLE.md](STYLE.md).
+
+Assembly code
+-------------
+
+Assembly code should include a good description of the algorithm and
+approach being used. This should be followed by a performance comparison
+and then the assembly code itself. The assembly code should be well
+commented, but it is not necessary to comment every line. A comment
+describing each block of code suffices.
+
+For pure-assembly modules (`.s` files and the perlasm scripts that
+generate them), comments use the native syntax of the assembler or
+generator (typically `#`). Doxygen-style markup does not apply here;
+the algorithm description, performance comparison, and per-block
+comments described above are still required.
+
+For assembly that appears inline inside a C file (within an `asm()`
+statement, for example), the surrounding C function is documented
+with doxygen-style C comments as for any other C code; see
+[STYLE.md](STYLE.md). Comments inside the `asm()` body itself use
+plain C `/* */` comments.
+
+There are no *trivial* exceptions for assembly code.
+
+Configure options
+-----------------
+
+New options added to the configuration scripts must be documented in the
+[INSTALL.md](INSTALL.md) file.
+
+Changes and news
+----------------
+
+Significant modifications should be documented in the
+[CHANGES.md](CHANGES.md) file.
+
+Very significant features and changes should be documented in the
+[NEWS.md](NEWS.md) file.
+
+In both cases, the added note should be short and to the point, and
+should be written for users of the library, focusing on impact rather
+than implementation details.
+
+Automated sanity checking
+-------------------------
+
+The `make doc-nits` command should be run before submitting a pull
+request and any problems it locates must be addressed.
+
+Language
+--------
+
+The language used for documentation shall be *British English*.
+
+In general the language, abbreviations, layout and formatting should also
+correspond to the
+[LDP](https://openssl-library.org/policies/general/glossary/#ldp)
+guidelines.
+
+Common sense
+------------
+
+Comments and documentation are to improve readability and comprehension.
+Where the code is obvious, there is no need to include a comment.
+However, common sense applies: always err in favour of including more
+comments than less or none. Code that you have just written that is
+*obvious* will not necessarily be to someone else two years later. See
+[STYLE.md](STYLE.md) for the form and content of code comments.
diff --git a/deps/openssl/openssl/HACKING.md b/deps/openssl/openssl/HACKING.md
deleted file mode 100644
index b58f08a2dc9..00000000000
--- a/deps/openssl/openssl/HACKING.md
+++ /dev/null
@@ -1,80 +0,0 @@
-MODIFYING OPENSSL SOURCE
-========================
-
-This document describes the way to add custom modifications to OpenSSL
-sources.
-
-If you are adding new C source files
-------------------------------------
-
-Please update the `build.info` files in the directories where you placed the
-C source files, to include a line like this for each new C source file:
-
--   In `crypto/` or any of its subdirectories (intended for `libcrypto`):
-
-        SOURCE[../libcrypto]={name-of-C-source-file}
-
--   In `ssl/` or any of its subdirectories (intended for `libssl`):
-
-        SOURCE[../libssl]={name-of-C-source-file}
-
-Do note that the path given as the `SOURCE` attribute must be adapted
-appropriately for the location of the `build.info` file, as it's a relative
-path to where the library itself is built, for example:
-
--   For `crypto/build.info`, the library path should be `../libcrypto`
--   For `crypto/evp/build.info`, the library path should be
-    `../../libcrypto`
--   For `ssl/build.info`, the library path should be `../libssl`
--   For `ssl/quic/build.info`, the library path should be `../../libssl`
-
-To know more about `build.info` files, please read [doc/internal/man7/build.info.pod].
-For better viewing, consider converting it to HTML or PDF using `pod2html`
-or `pod2pdf`.
-
-Adding new public functions
----------------------------
-
-If you are adding new public functions to the custom library build, you need to
-either add a prototype in one of the existing OpenSSL header files, or
-provide a new header file and edit.
-
-Only headers in the `include/openssl` subdirectory are considered for public
-functions.  If you're creating a new header file, it must be located in that
-directory.
-
-Functions declared in `include/openssl` header files are assumed to be part
-of the `libcrypto` library unless specified otherwise.  *If your new
-functions are meant for the `libssl` library*, you will need to edit
-[Configurations/unix-Makefile.tmpl] and add the header file name in the
-array `my @sslheaders_tmpl`.
-
-Updating OpenSSL's bookkeeping files
-------------------------------------
-
-OpenSSL has a few bookkeeping files to keep track of exposed functions, most
-importantly `util/libcrypto.num` and `util/libssl.num`.  Any time a new
-public function - as defined above - is added, these files must be updated.
-
-To make such an update, please do the following:
-
-    ./Configure -Werror --strict-warnings [your-options]
-    make update
-
-If you plan to submit the changes you made to OpenSSL (see
-[CONTRIBUTING.md]), it's also worth running the following after running
-`make update`, to ensure that documentation has correct format.
-
-    make doc-nits
-
-Do note that `make update` also generates files related to OIDs (in the
-`crypto/objects/`  folder) and errors messages.
-
-If a git merge error occurs in one of these generated files, then the
-generated files need to be removed and regenerated using `make update`.
-To aid in this process, the generated files can be committed separately
-so they can be removed easily by reverting that commit.
-
-[doc/internal/man7/build.info.pod]: ./doc/internal/man7/build.info.pod
-[Configurations/unix-Makefile.tmpl]: ./Configurations/unix-Makefile.tmpl
-[CONTRIBUTING.md]: ./CONTRIBUTING.md
diff --git a/deps/openssl/openssl/HOWTO.md b/deps/openssl/openssl/HOWTO.md
new file mode 100644
index 00000000000..8ee3be5e05c
--- /dev/null
+++ b/deps/openssl/openssl/HOWTO.md
@@ -0,0 +1,8 @@
+MODIFYING OPENSSL SOURCE
+========================
+
+This is a collection of pointers to parts of the documentation that will help
+people doing modifications.
+
+* [doc/HOWTO/adding-functions.md](Adding new Functions)
+* [doc/HOWTO/documenting-functions-macros.md](Documenting Functions and Macros)
diff --git a/deps/openssl/openssl/INSTALL.md b/deps/openssl/openssl/INSTALL.md
index 983f6aad136..6dc586d4a7f 100644
--- a/deps/openssl/openssl/INSTALL.md
+++ b/deps/openssl/openssl/INSTALL.md
@@ -21,7 +21,7 @@ Table of Contents
    - [Compiler Warnings](#compiler-warnings)
    - [Compression Algorithm Flags](#compression-algorithm-flags)
    - [Seeding the Random Generator](#seeding-the-random-generator)
-   - [Setting the FIPS HMAC key](#setting-the-FIPS-HMAC-key)
+   - [Setting the FIPS HMAC key](#setting-the-fips-hmac-key)
    - [Enable and Disable Features](#enable-and-disable-features)
    - [Displaying configuration data](#displaying-configuration-data)
  - [Installation Steps in Detail](#installation-steps-in-detail)
@@ -51,7 +51,7 @@ To install OpenSSL, you will need:
  * A "make" implementation
  * Perl 5 with core modules (please read [NOTES-PERL.md](NOTES-PERL.md))
  * The Perl module `Text::Template` (please read [NOTES-PERL.md](NOTES-PERL.md))
- * an ANSI C compiler
+ * a C-99 compiler
  * POSIX C library (at least POSIX.1-2008), or compatible types and
    functionality.
  * a development environment in the form of development libraries and C
@@ -169,13 +169,11 @@ issue the following commands to build OpenSSL.
     $ nmake test

 As mentioned in the [Choices](#choices) section, you need to pick one
-of the four Configure targets in the first command.
+of the Configure targets in the first command.

 Most likely you will be using the `VC-WIN64A`/`VC-WIN64A-HYBRIDCRT` target for
 64bit Windows binaries (AMD64) or `VC-WIN32`/`VC-WIN32-HYBRIDCRT` for 32bit
 Windows binaries (X86).
-The other two options are `VC-WIN64I` (Intel IA64, Itanium) and
-`VC-CE` (Windows CE) are rather uncommon nowadays.

 Installing OpenSSL
 ------------------
@@ -335,6 +333,14 @@ Build OpenSSL with debugging symbols and zero optimization level.

 Build OpenSSL without debugging symbols.  This is the default.

+    --coverage
+
+Build OpenSSL with gcov profiling information included
+
+    --pgo
+
+Build OpenSSL optimized using gcov data obtained from --coverage build
+
 Directories
 -----------

@@ -420,6 +426,22 @@ The names of the libraries are:
 * brotlidec.lib
 * brotlienc.lib

+### with-cmocka-include
+
+    --with-cmocka-include=DIR
+
+The directory for the location of the cmocka include file. This option is only
+necessary if [enable-unit-tests](#enable-unit-tests) is used and the include
+file is not already on the system include path.
+
+### with-cmocka-lib
+
+    --with-cmocka-lib=DIR
+
+The directory containing the cmocka library. This option is only necessary if
+[enable-unit-tests](#enable-unit-tests) is used and the library is not already
+on the system library path.
+
 ### with-zlib-include

     --with-zlib-include=DIR
@@ -576,11 +598,14 @@ In the following list, always the non-default variant is documented: if
 feature `xxxx` is disabled by default then `enable-xxxx` is documented and
 if feature `xxxx` is enabled by default then `no-xxxx` is documented.

-### no-afalgeng
+### enable-static-vcruntime

-Don't build the AFALG engine.
+Build binaries that do not require that VC runtimes are installed

-This option will be forced on a platform that does not support AFALG.
+This option will produce binaries that are "self contained", that do not
+depend upon VC runtime libraries being installed, so can be used on any
+computer running MS Windows.  Without this option, the build will produce
+binaries that rely on the VC runtimes being installed and available.

 ### enable-ktls

@@ -632,9 +657,10 @@ Do not build support for async operations.

 Do not use `atexit()` in libcrypto builds.

-`atexit()` has varied semantics between platforms and can cause SIGSEGV in some
-circumstances. This option disables the atexit registration of OPENSSL_cleanup.
-By default, NonStop configurations use `no-atexit`.
+Before version 4.0, OpenSSL used to set `atexit()` handler for cleaning up
+global data, and this option allowed to disable that functionality.  `atexit()`
+handler setup was removed in OpenSSL 4.0, so `no-atexit` option is retained
+for compatibility reasons only, always present, and does nothing.

 ### no-autoalginit

@@ -707,12 +733,6 @@ this option will reduce run-time memory usage but it also introduces a
 significant performance penalty.  This option is primarily designed to help
 with detecting incorrect reference counting.

-### no-capieng
-
-Don't build the CAPI engine.
-
-This option will be forced if on a platform that does not support CAPI.
-
 ### no-cmp

 Don't build support for Certificate Management Protocol (CMP)
@@ -733,9 +753,10 @@ the zlib or `zlib-dynamic` options are also chosen.

 This now only enables the `failed-malloc` feature.

-### enable-crypto-mdebug-backtrace
+### enable-allocfail-tests

-This is a no-op; the project uses the compiler's address/leak sanitizer instead.
+This option enables testing that leverages the use of the crypto-mdebug feature
+to test error paths resulting from failed memory allocations.

 ### no-ct

@@ -760,32 +781,21 @@ Don't build and install documentation, i.e. manual pages in various forms.

 Don't build support for loading Dynamic Shared Objects (DSO)

-### enable-devcryptoeng
-
-Build the `/dev/crypto` engine.
-
-This option is automatically selected on the BSD platform, in which case it can
-be disabled with `no-devcryptoeng`.
-
-### no-dynamic-engine
+### enable-tls-deprecated-ec

-Don't build the dynamically loaded engines.
-
-This only has an effect in a shared build.
-
-### no-ec
-
-Don't build support for Elliptic Curves.
+Enable legacy TLS EC groups that were deprecated in RFC8422.  These are the
+Koblitz curves, B<secp160r1>, B<secp160r2>, B<secp192r1>, B<secp224r1>, and the
+binary Elliptic curves that would also be disabled by C<no-ec2m>.

-### no-ec2m
+### enable-ec_explicit_curves

-Don't build support for binary Elliptic Curves
+Enable support for explicitly specified elliptic curves not matching the
+well-known ones. Until this option is on, such curves can't be instantiated
+from ASN.1 formats.

-### no-tls-deprecated-ec
+### no-ech

-Disable legacy TLS EC groups that were deprecated in RFC8422.  These are the
-Koblitz curves, B<secp160r1>, B<secp160r2>, B<secp192r1>, B<secp224r1>, and the
-binary Elliptic curves that would also be disabled by C<no-ec2m>.
+Don't build support for Encrypted Client Hello (ECH) extension.

 ### enable-ec_nistp_64_gcc_128

@@ -804,10 +814,6 @@ This option is only supported on platforms:

 Build support for gathering entropy from the Entropy Gathering Daemon (EGD).

-### no-engine
-
-Don't build support for loading engines.
-
 ### no-err

 Don't compile in any error strings.
@@ -826,6 +832,12 @@ external test suites are currently supported:
 See the file [test/README-external.md](test/README-external.md)
 for further details.

+### enable-unit-tests
+
+Enable building and running unit tests.
+
+This works only on platforms supporting ld `--wrap` option like Linux and BSD.
+
 ### no-filenames

 Don't compile in filename and line number information (e.g.  for errors and
@@ -877,6 +889,13 @@ Note that if this feature is enabled then GOST ciphersuites are only available
 if the GOST algorithms are also available through loading an externally supplied
 engine.

+### no-engine, no-static-engine, no-dynamic-engine
+
+The `no-engine` option is always present.  These options are deprecated and do
+nothing, and are retained for backwards compatibility only.  The ENGINE API was
+deprecated in OpenSSL 3.0 and removed in OpenSSL 4.0, so applications should
+transition to using providers instead.
+
 ### no-http

 Disable HTTP support.
@@ -891,21 +910,9 @@ Disabling this also disables the legacy algorithms: MD2 (already disabled by def

 Don't generate dependencies.

-### no-ml-dsa
-
-Disable Module-Lattice-Based Digital Signature Standard (ML-DSA) support.
-ML-DSA is based on CRYSTALS-DILITHIUM. See [FIPS 204].
-
-### no-ml-kem
-
-Disable Module-Lattice-Based Key-Encapsulation Mechanism Standard (ML-KEM)
-support.  ML-KEM is based on CRYSTALS-KYBER. See [FIPS 203].
-
 ### no-module

-Don't build any dynamically loadable engines.
-
-This also implies `no-dynamic-engine`.
+Don't build any dynamically loadable modules.

 ### no-multiblock

@@ -921,14 +928,6 @@ Don't build support for the Next Protocol Negotiation (NPN) TLS extension.

 Don't build support for Online Certificate Status Protocol (OCSP).

-### no-padlockeng
-
-Don't build the padlock engine.
-
-### no-hw-padlock
-
-As synonym for `no-padlockeng`.  Deprecated and should not be used.
-
 ### no-pic

 Don't build with support for Position Independent Code.
@@ -941,17 +940,17 @@ Build with support for Position Independent Execution.

 Don't pin the shared libraries.

-By default OpenSSL will attempt to stay in memory until the process exits.
-This is so that libcrypto and libssl can be properly cleaned up automatically
-via an `atexit()` handler.  The handler is registered by libcrypto and cleans
-up both libraries.  On some platforms the `atexit()` handler will run on unload of
-libcrypto (if it has been dynamically loaded) rather than at process exit.
+By default, on supported platforms (such as Linux and GNU Hurd), OpenSSL
+is built with linker options (e.g., `-Wl,-znodelete`) that prevent the
+operating system from unloading the libcrypto and libssl shared libraries
+from memory, even if the application explicitly unloads them using
+`dlclose()`. On platforms that do not support these options, this feature
+is disabled by default.

-This option can be used to stop OpenSSL from attempting to stay in memory until the
-process exits.  This could lead to crashes if either libcrypto or libssl have
-already been unloaded at the point that the atexit handler is invoked, e.g.  on a
-platform which calls `atexit()` on unload of the library, and libssl is unloaded
-before libcrypto then a crash is likely to happen.
+This option prevents the addition of those linker flags, allowing the
+shared libraries to be completely unloaded from the process address space.
+This is useful for applications that dynamically load and unload OpenSSL
+plugins to conserve memory.

 Note that shared library pinning is not automatically disabled for static builds,
 i.e., `no-shared` does not imply `no-pinshared`. This may come as a surprise when
@@ -959,10 +958,6 @@ linking libcrypto statically into a shared third-party library, because in this
 case the shared library will be pinned. To prevent this behaviour, you need to
 configure the static build using `no-shared` and `no-pinshared` together.

-Applications can suppress running of the `atexit()` handler at run time by
-using the `OPENSSL_INIT_NO_ATEXIT` option to `OPENSSL_init_crypto()`.
-See the man page for it for further details.
-
 ### no-posix-io

 Don't use POSIX IO capabilities.
@@ -990,11 +985,6 @@ Do not create shared libraries, only static ones.

 See [Notes on shared libraries](#notes-on-shared-libraries) below.

-### no-slh-dsa
-
-Disable Stateless Hash Based Digital Signature Standard support.
-(SLH-DSA is based on SPHINCS+. See [FIPS 205])
-
 ### no-sm2-precomp

 Disable using the SM2 precomputed table on aarch64 to make the library smaller.
@@ -1035,12 +1025,6 @@ This removes the `-trace` option from `s_client` and `s_server`, and omits the

 Disabling `ssl-trace` may provide a small reduction in libssl binary size.

-### no-static-engine
-
-Don't build the statically linked engines.
-
-This only has an impact when not built "shared".
-
 ### no-stdio

 Don't use anything from the C header file `stdio.h` that makes use of the `FILE`
@@ -1131,10 +1115,12 @@ The User Interface console method enables text based console prompts.

 ### enable-unit-test

-Enable additional unit test APIs.
+Enable exposing SSL_test_functions for overwriting ssl_init_wbio_buffer.

 This should not typically be used in production deployments.

+This option is deprecated and will be removed in OpenSSL 5.0.
+
 ### no-uplink

 Don't build support for UPLINK interface.
@@ -1191,8 +1177,8 @@ Don't build support for negotiating the specified SSL/TLS protocol.

 If `no-tls` is selected then all of `tls1`, `tls1_1`, `tls1_2` and `tls1_3`
 are disabled.
-Similarly `no-dtls` will disable `dtls1` and `dtls1_2`.  The `no-ssl` option is
-synonymous with `no-ssl3`.  Note this only affects version negotiation.
+Similarly `no-dtls` will disable `dtls1` and `dtls1_2`.
+`no-ssl` and `no-ssl3` are deprecated and do nothing.
 OpenSSL will still provide the methods for applications to explicitly select
 the individual protocol versions.

@@ -1208,28 +1194,37 @@ Analogous to `no-{protocol}` but in addition do not build the methods for
 applications to explicitly select individual protocol versions.  Note that there
 is no `no-tls1_3-method` option because there is no application method for
 TLSv1.3.
+`no-ssl3` is deprecated and does nothing.

 Using individual protocol methods directly is deprecated.  Applications should
 use `TLS_method()` instead.

 ### enable-{algorithm}

-    enable-{md2|rc5}
+    enable-{md2|rc5|lms}

 Build with support for the specified algorithm.

+The `lms` algorithm support is currently limited to verification only as per
+[SP 800-208](https://csrc.nist.gov/pubs/sp/800/208/final).
+
 ### no-{algorithm}

     no-{aria|bf|blake2|camellia|cast|chacha|cmac|
-        des|dh|dsa|ecdh|ecdsa|idea|md4|mdc2|ml-dsa|
-        ml-kem|ocb|poly1305|rc2|rc4|rmd160|scrypt|
-        seed|siphash|siv|sm2|sm3|sm4|whirlpool}
+        des|dh|dsa|
+        ec|ec2m|ecdh|ecdsa|hmac-drbg-kdf|idea|ikev2kdf|kbkdf|krb5kdf|
+        md4|mdc2|
+        ml-dsa|ml-kem|
+        ocb|poly1305|pvkkdf|rc2|rc4|rmd160|scrypt|
+        seed|siphash|siv|slh-dsa|sm2|sm3|sm4|snmpkdf|srtpkdf|sshkdf|sskdf|
+        x942kdf|x963kdf|whirlpool}

 Build without support for the specified algorithm.

 The `ripemd` algorithm is deprecated and if used is synonymous with `rmd160`.

-### Compiler-specific options
+Compiler-specific options
+-------------------------

     -Dxxx, -Ixxx, -Wp, -lxxx, -Lxxx, -Wl, -rpath, -R, -framework, -static

@@ -1260,7 +1255,17 @@ encoding.
 Take note of the [Environment Variables](#environment-variables) documentation
 below and how these flags interact with those variables.

-### Environment Variables
+Miscellaneous options
+---------------------
+
+### --manpage-format
+
+Specify a specific output manpage format. The supported output types are mandoc
+and *roff. The *roff output format is the default for legacy and portability
+reasons.
+
+Environment Variables
+---------------------

     VAR=value

@@ -1337,10 +1342,18 @@ If `CC` is set, it is advisable to also set `CXX` to ensure both the C and C++
 compiler are in the same "family".  This becomes relevant with
 `enable-external-tests` and `enable-buildtest-c++`.

-### Reconfigure
+Reconfigure
+-----------

-    reconf
-    reconfigure
+### Make targets
+
+    `$ make reconf`
+
+or
+
+    `$ make reconfigure`
+
+### Description

 Reconfigure from earlier data.

@@ -1529,7 +1542,6 @@ its default):
                    to build your own programs that use libcrypto
                    or libssl.
     lib            Contains the OpenSSL library files.
-    lib/engines    Contains the OpenSSL dynamically loadable engines.

     share/man/man1 Contains the OpenSSL command line man-pages.
     share/man/man3 Contains the OpenSSL library calls man-pages.
@@ -1555,8 +1567,6 @@ its default):
                    to build your own programs that use libcrypto
                    or libssl.
     [.LIB.'arch']  Contains the OpenSSL library files.
-    [.ENGINES'sover''pz'.'arch']
-                   Contains the OpenSSL dynamically loadable engines.
     [.SYS$STARTUP] Contains startup, login and shutdown scripts.
                    These define appropriate logical names and
                    command symbols.
@@ -1577,7 +1587,7 @@ for you convenience:

 The installation directory should be appropriately protected to ensure
 unprivileged users cannot make changes to OpenSSL binaries or files, or
-install engines.  If you already have a pre-installed version of OpenSSL as
+install providers.  If you already have a pre-installed version of OpenSSL as
 part of your Operating System it is recommended that you do not overwrite
 the system version and instead install to somewhere else.

@@ -1961,9 +1971,8 @@ on Cygwin, shared libraries are named `cygcrypto-1.1.dll` and `cygssl-1.1.dll`
 with import libraries `libcrypto.dll.a` and `libssl.dll.a`.

 On Windows build with MSVC or using MingW, shared libraries are named
-`libcrypto-1_1.dll` and `libssl-1_1.dll` for 32-bit Windows,
-`libcrypto-1_1-x64.dll` and `libssl-1_1-x64.dll` for 64-bit x86_64 Windows,
-and `libcrypto-1_1-ia64.dll` and `libssl-1_1-ia64.dll` for IA64 Windows.
+`libcrypto-1_1.dll` and `libssl-1_1.dll` for 32-bit Windows, and
+`libcrypto-1_1-x64.dll` and `libssl-1_1-x64.dll` for 64-bit x86_64 Windows.
 With MSVC, the import libraries are named `libcrypto.lib` and `libssl.lib`,
 while with MingW, they are named `libcrypto.dll.a` and `libssl.dll.a`.

@@ -2033,6 +2042,24 @@ around the problem by forcing the build procedure to use the following script:
 instead of the real clang. In which case it doesn't matter what clang version
 is used, as it is the version of the GNU assembler that will be checked.

+Notes on profile guided optimization
+------------------------------------
+
+Some compilers support the concept of profile guided optimization.  This feature
+allows a user to build openssl and use profiling data gathered while running an
+application such that it can then be rebuilt in a way that is optimized specifically
+for that application, increasing performance.  Currently this feature is built into
+the openssl build system for x86_64 only.
+
+1) Configure openssl with the --coverage option.  This will configure the compiler to
+   record profiling data for the libcrypto and libssl libraries
+2) Run the application(s) which you wish to optimize for, ensuring that they use
+   the libraries compiled in step (1) (note this may entail the use of LD_LIBRARY_PATH)
+3) Clean the openssl build with make clean.  Note that the profile data (the .gcda and .gcno
+   files are retained through the clean operation). This is intentional.
+4) Configure openssl again, but this time select the --pgo build type.  This will use the
+   profiled data to optimize code layout for the application in question.
+
 ---

 <!-- Links  -->
diff --git a/deps/openssl/openssl/NEWS.md b/deps/openssl/openssl/NEWS.md
index 157587f0f52..dc72ef2a7aa 100644
--- a/deps/openssl/openssl/NEWS.md
+++ b/deps/openssl/openssl/NEWS.md
@@ -7,6 +7,9 @@ release. For more details please read the CHANGES file.
 OpenSSL Releases
 ----------------

+ - [OpenSSL 4.1](#openssl-41)
+ - [OpenSSL 4.0](#openssl-40)
+ - [OpenSSL 3.6](#openssl-36)
  - [OpenSSL 3.5](#openssl-35)
  - [OpenSSL 3.4](#openssl-34)
  - [OpenSSL 3.3](#openssl-33)
@@ -20,12 +23,85 @@ OpenSSL Releases
  - [OpenSSL 1.0.0](#openssl-100)
  - [OpenSSL 0.9.x](#openssl-09x)

-OpenSSL 3.5
+OpenSSL 4.1
+-----------
+
+### Major changes between OpenSSL 4.0 and OpenSSL 4.1.0 [23 Oct 2026]
+
+OpenSSL 4.1.0 is a feature release adding significant new functionality
+to OpenSSL.
+
+This release incorporates the following potentially significant or incompatible
+changes:
+
+  * Added `VC-WIN32-MSVC2013` and `VC-WIN64A-MSVC2013` build targets to provide
+    internal functions for bridging the gaps in C99 standard support
+    that are present in MSVC 2013.
+
+  * Added optimized ML-DSA and ML-KEM NTT operations on `ppc64le`;
+    optimized ML-DSA operations on `x86_64`;
+    AVX-512-optimized SHAKE x4 operations for ML-DSA on `x86_64`;
+    AVX-512 and VAES optimizations for AES-CBC decryption on `x86_64`.
+
+  * Changed `tsget` utility to use `Net::Curl::Easy` (from the `Net-Curl` CPAN
+    distribution) instead of the abandoned `WWW::Curl::Easy`.  Users who rely
+    on `tsget` should install `Net::Curl::Easy` before upgrading.
+
+  * Dropped Windows-on-Itanium (`VC-WIN64I`) and Windows CE (`VC-CE`) targets
+    from Configurations.
+
+  * Dropped `no-ecdsa` and `no-ecdh` options from `Configure`, as these options
+    did not really disable the implementations.  Use `no-ec` to disable
+    the elliptic curve support.
+
+This release adds the following new features:
+
+  * Support for DTLS 1.3 ([RFC 9147]).
+    Refer to the `ossl-guide-dtlsv13(7)` manual page for details.
+
+  * Support for [RFC 8701] GREASE (Generate Random Extensions And Sustain
+    Extensibility).
+
+  * DTLS support in the SSL listener API.
+
+  * Support for IKEV2 KDF.
+
+  * Initial support for the Elbrus2000 (`e2k`) architecture.
+
+Known issues in 4.1.0
+
+  * <https://github.com/openssl/openssl/issues/32878>
+    When a DTLS 1.3 KeyUpdate is received, all other outstanding
+    post-handshake records are dropped from the retransmission buffer.
+    This means post-handshake records still awaiting an ACK (such as a
+    NewSessionTicket) will no longer be retransmitted if the original
+    transmission is lost. A fix is in progress and planned for a future
+    release.
+
+  * <https://github.com/openssl/openssl/issues/33277>
+    A permanent receive failure on a DTLS listener can be reported as
+    `SSL_ERROR_WANT_READ` on an accepted connection. Polling and subsequent
+    accept calls may also fail to report the error, causing applications
+    to continue waiting after a permanent failure.
+
+  * <https://github.com/openssl/openssl/issues/33278>
+    A retryable write failure on a nonblocking connection accepted from a
+    DTLS listener can be reported as `SSL_ERROR_SYSCALL` instead of
+    `SSL_ERROR_WANT_WRITE`. Applications treating this result as fatal may
+    close a connection that is still usable.
+
+  * <https://github.com/openssl/openssl/issues/33242>
+    DTLS 1.3 servers may abort handshakes with an `unexpected_message` alert
+    when a client acknowledges part or all of the server's first flight
+    before sending its response. This can occur after packet loss or while
+    the client is preparing its authentication response.
+
+OpenSSL 4.0
 -----------

-### Major changes between OpenSSL 3.5.8 and OpenSSL 3.5.9 [29 Sep 2026]
+### Major changes between OpenSSL 4.0.2 and OpenSSL 4.0.3 [29 Sep 2026]

-OpenSSL 3.5.9 is a security patch release.  The most severe CVE fixed
+OpenSSL 4.0.3 is a security patch release.  The most severe CVE fixed
 in this release is High.

 This release incorporates the following bug fixes and mitigations:
@@ -33,6 +109,9 @@ This release incorporates the following bug fixes and mitigations:
   * Fixed DTLS retransmissions of handshake messages from a stale buffer offset.
     ([CVE-2026-84782])

+  * Fixed a use-after-free in X.509 extension cache under concurrent use.
+    ([CVE-2026-84783])
+
   * Fixed excessive memory allocation in relative CRLDP processing.
     ([CVE-2026-35189])

@@ -42,7 +121,8 @@ This release incorporates the following bug fixes and mitigations:
   * Fixed potential CPU DoS via O(n^2) fragment reassembly in QUIC.
     ([CVE-2026-42772])

-  * Fixed a timing side-channel in scalar multiplication for mon-NIST EC curves.
+  * Fixed a timing side-channel leak in generic elliptic curve scalar
+    multiplication.
     ([CVE-2026-54872])

   * Fixed QUIC `STREAM` fragment metadata DoS.
@@ -73,9 +153,23 @@ This release incorporates the following bug fixes and mitigations:
   * Fixed a bug where `EVP_DecryptFinal()` incorrectly reported a stale success
     on AES-SIV authentication failure.

-### Major changes between OpenSSL 3.5.7 and OpenSSL 3.5.8 [25 Aug 2026]
+  * Fixed a regression in base64 encoding BIO filter introduced in OpenSSL 4.0,
+    where incomplete writes down the BIO chain may result in the loss of encoded
+    base64 data.
+
+This release incorporates the following potentially significant or incompatible
+changes:
+
+ * Changed the OpenSSL FIPS provider so that every algorithm advertised
+   with `fips=yes` property explicitly exposes a `fips-indicator` gettable
+   context parameter, that returns 1 for an approved operation.  The absence
+   of an indicator is no longer interpreted as approval.  Algorithms advertised
+   with `fips=no` property, including X448MLKEM1024, remain unapproved
+   and return 0 when they expose the indicator.
+
+### Major changes between OpenSSL 4.0.1 and OpenSSL 4.0.2 [25 Aug 2026]

-OpenSSL 3.5.8 is a security patch release.  The most severe CVE fixed
+OpenSSL 4.0.2 is a security patch release.  The most severe CVE fixed
 in this release is Moderate.

 This release incorporates the following bug fixes and mitigations:
@@ -100,6 +194,9 @@ This release incorporates the following bug fixes and mitigations:
   * Fixed excessive memory use buffering DTLS records for a future epoch.
     ([CVE-2026-54874])

+  * Fixed client-side memory leak in OCSP response checking.
+    ([CVE-2026-54876])
+
   * Fixed untrusted Sender DN being used as a format string in CMP response
     validation.
     ([CVE-2026-63073])
@@ -117,9 +214,9 @@ This release incorporates the following bug fixes and mitigations:
   * Fixed checking of authentication tags for empty ciphertexts for AEAD ciphers
     in CCM cipher mode.

-### Major changes between OpenSSL 3.5.6 and OpenSSL 3.5.7 [9 Jun 2026]
+### Major changes between OpenSSL 4.0.0 and OpenSSL 4.0.1 [9 Jun 2026]

-OpenSSL 3.5.7 is a security patch release.  The most severe CVE fixed
+OpenSSL 4.0.1 is a security patch release.  The most severe CVE fixed
 in this release is High.

 This release incorporates the following bug fixes and mitigations:
@@ -133,6 +230,9 @@ This release incorporates the following bug fixes and mitigations:
   * Fixed unbounded memory growth in the QUIC `PATH_CHALLENGE` handler.
     ([CVE-2026-34183])

+  * Fixed double-free when checking OCSP stapled response.
+    ([CVE-2026-35188])
+
   * Fixed NULL pointer dereference in QUIC server initial packet handling.
     ([CVE-2026-42764])

@@ -151,6 +251,9 @@ This release incorporates the following bug fixes and mitigations:
   * Fixed PKCS#12 files with PBMAC1 are accepted with short HMAC keys.
     ([CVE-2026-34181])

+  * Fixed NULL dereference in certificate verification with OCSP Checking.
+    ([CVE-2026-42765])
+
   * Fixed possible NULL dereference in password-dased CMS decryption.
     ([CVE-2026-42766])

@@ -168,15 +271,126 @@ This release incorporates the following bug fixes and mitigations:
   * Fixed FFC-DH peer validation uses attacker-supplied `q`.
     ([CVE-2026-42770])

+  * Fixed possible out of bounds read in `X509_VERIFY_PARAM_set1_email()`.
+    ([CVE-2026-42771])
+
   * Fixed incorrect tag processing for empty messages in AES-GCM-SIV
     and AES-SIV modes.
     ([CVE-2026-45446])

   * Fixed excessive allocation of the handshake message buffer (aka HollowByte).

-### Major changes between OpenSSL 3.5.5 and OpenSSL 3.5.6 [7 Apr 2026]
+  * Fixed a regression introduced in 4.0.0 that led to a `openssl pkey`
+    command crash when it was invoked to encrypt a private key with password
+    being provided interactively.
+
+  * Fixed a regression introduced in 4.0.0 that led to `openssl s_client -adv`
+    command prematurely terminating a session when reading input of 16384 bytes
+    in one `read()` call.
+
+### Major changes between OpenSSL 3.6 and OpenSSL 4.0.0 [14 Apr 2026]
+
+OpenSSL 4.0.0 is a feature release adding significant new functionality
+to OpenSSL.
+
+This release incorporates the following potentially significant or incompatible
+changes:
+
+  * Removed extra leading '00:' when printing key data such as an RSA modulus
+    in hexadecimal format where the first (most significant) byte is >= 0x80.
+
+  * Standardized the width of hexadecimal dumps to 24 bytes for signatures
+    (to stay within the 80 characters limit) and 16 bytes for everything else.
+
+  * Lower bounds checks are now enforced when using `PKCS5_PBKDF2_HMAC` API
+    with FIPS provider.
+
+  * Added AKID verification checks when `X509_V_FLAG_X509_STRICT` is set.
+
+  * Augmented CRL verification process with several additional checks.
+
+  * `libcrypto` no longer cleans up globally allocated data via `atexit()`.
+
+  * `BIO_snprintf()` now uses `snprintf()` provided by libc instead of internal
+    implementation.

-OpenSSL 3.5.6 is a security patch release. The most severe CVE fixed in this
+  * `OPENSSL_cleanup()` now runs in a global destructor, or not at all
+    by default.
+
+  * `ASN1_STRING` has been made opaque.
+
+  * Signatures of numerous API functions, including those that are related
+    to X509 processing, are changed to include `const` qualifiers for argument
+    and return types, where suitable.
+
+  * Deprecated `X509_cmp_time()`, `X509_cmp_current_time()`,
+    and `X509_cmp_timeframe()` in favor of `X509_check_certificate_times()`.
+
+  * Removed support for the SSLv2 Client Hello.
+
+  * Removed support for SSLv3.  SSLv3 has been deprecated since 2015,
+    and OpenSSL had it disabled by default since version 1.1.0 (2016).
+
+  * Removed support for engines.  The `no-engine` build option
+    and the `OPENSSL_NO_ENGINE` macro are always present.
+
+  * Support of deprecated elliptic curves in TLS according to [RFC 8422] was
+    disabled at compile-time by default. To enable it, use the
+    `enable-tls-deprecated-ec` configuration option.
+
+  * Support of explicit EC curves was disabled at compile-time by default.
+    To enable it, use the `enable-ec_explicit_curves` configuration option.
+
+  * Removed `c_rehash` script tool.  Use `openssl rehash` instead.
+
+  * Removed the deprecated `msie-hack` option from the `openssl ca` command.
+
+  * Removed `BIO_f_reliable()` implementation without replacement.
+    It was broken since 3.0 release without any complaints.
+
+  * Removed deprecated support for custom `EVP_CIPHER`, `EVP_MD`, `EVP_PKEY`,
+    and `EVP_PKEY_ASN1` methods.
+
+  * Removed deprecated fixed SSL/TLS version method functions.
+
+  * Removed deprecated functions `ERR_get_state()`, `ERR_remove_state()`
+    and `ERR_remove_thread_state()`. The `ERR_STATE` object is now always
+    opaque.
+
+  * Dropped `darwin-i386{,-cc}` and `darwin-ppc{,64}{,-cc}` targets
+    from Configurations.
+
+This release adds the following new features:
+
+  * Support for Encrypted Client Hello (ECH, [RFC 9849]).
+    See `doc/designs/ech-api.md` for details.
+
+  * Support for [RFC 8998], signature algorithm `sm2sig_sm3`, key exchange
+    group `curveSM2`, and [tls-hybrid-sm2-mlkem] post-quantum group
+    `curveSM2MLKEM768`.
+
+  * cSHAKE function support as per [SP 800-185].
+
+  * "ML-DSA-MU" digest algorithm support.
+
+  * Support for SNMP KDF and SRTP KDF.
+
+  * FIPS self tests can now be deferred and run as needed when installing
+    the FIPS module with the `-defer_tests` option of the `openssl fipsinstall`
+    command.
+
+  * Support for using either static or dynamic VC runtime linkage
+    on Windows.
+
+  * Support for negotiated FFDHE key exchange in TLS 1.2 in accordance
+    with [RFC 7919].
+
+OpenSSL 3.6
+-----------
+
+### Major changes between OpenSSL 3.6.1 and OpenSSL 3.6.2 [7 Apr 2026]
+
+OpenSSL 3.6.2 is a security patch release. The most severe CVE fixed in this
 release is Moderate.

 This release incorporates the following bug fixes and mitigations:
@@ -188,6 +402,9 @@ This release incorporates the following bug fixes and mitigations:
     is used in the server-side configuration of the key-agreement group list.
     ([CVE-2026-2673])

+  * Fixed out-of-bounds read in AES-CFB-128 on x86-64 CPUs with AVX-512 support.
+    ([CVE-2026-28386])
+
   * Fixed potential use-after-free in DANE client code.
     ([CVE-2026-28387])

@@ -204,9 +421,9 @@ This release incorporates the following bug fixes and mitigations:
   * Fixed heap buffer overflow in hexadecimal conversion.
     ([CVE-2026-31789])

-### Major changes between OpenSSL 3.5.4 and OpenSSL 3.5.5 [27 Jan 2026]
+### Major changes between OpenSSL 3.6.0 and OpenSSL 3.6.1 [27 Jan 2026]

-OpenSSL 3.5.5 is a security patch release. The most severe CVE fixed in this
+OpenSSL 3.6.1 is a security patch release. The most severe CVE fixed in this
 release is High.

 This release incorporates the following bug fixes and mitigations:
@@ -250,6 +467,45 @@ This release incorporates the following bug fixes and mitigations:
     function.
     ([CVE-2026-22796])

+  * Fixed a regression in `X509_V_FLAG_CRL_CHECK_ALL` flag handling by
+    restoring its pre-3.6.0 behaviour.
+
+  * Fixed a regression in handling stapled OCSP responses causing handshake
+    failures for OpenSSL 3.6.0 servers with various client implementations.
+
+### Major changes between OpenSSL 3.5 and OpenSSL 3.6.0 [1 Oct 2025]
+
+OpenSSL 3.6.0 is a feature release adding significant new functionality
+to OpenSSL.
+
+This release incorporates the following potentially significant or incompatible
+changes:
+
+  * Added NIST security categories for PKEY objects.
+
+  * Added support for `EVP_SKEY` opaque symmetric key objects to the key
+    derivation and key exchange provider methods. Added `EVP_KDF_CTX_set_SKEY()`,
+    `EVP_KDF_derive_SKEY()`, and `EVP_PKEY_derive_SKEY()` functions.
+
+  * Added LMS signature verification support as per [SP 800-208].
+    This support is present in both the FIPS and default providers.
+
+  * An ANSI-C toolchain is no longer sufficient for building OpenSSL.
+    The code should be built using compilers supporting C-99 features.
+
+  * Support for the VxWorks platforms has been removed.
+
+  * Added an `openssl configutl` utility for processing the OpenSSL
+    configuration file and dumping the equal configuration file.
+
+  * Added support for FIPS 186-5 deterministic ECDSA signature
+    generation to the FIPS provider.
+
+  * Deprecated `EVP_PKEY_ASN1_METHOD`-related functions.
+
+OpenSSL 3.5
+-----------
+
 ### Major changes between OpenSSL 3.5.3 and OpenSSL 3.5.4 [30 Sep 2025]

 OpenSSL 3.5.4 is a security patch release. The most severe CVE fixed in this
@@ -2368,6 +2624,7 @@ OpenSSL 0.9.x
 [CVE-2026-18798]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-18798
 [CVE-2026-22795]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-22795
 [CVE-2026-22796]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-22796
+[CVE-2026-28386]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28386
 [CVE-2026-28387]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28387
 [CVE-2026-28388]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28388
 [CVE-2026-28389]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28389
@@ -2378,14 +2635,17 @@ OpenSSL 0.9.x
 [CVE-2026-34181]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-34181
 [CVE-2026-34182]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-34182
 [CVE-2026-34183]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-34183
+[CVE-2026-35188]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-35188
 [CVE-2026-35189]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-35189
 [CVE-2026-35191]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-35191
 [CVE-2026-42764]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42764
+[CVE-2026-42765]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42765
 [CVE-2026-42766]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42766
 [CVE-2026-42767]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42767
 [CVE-2026-42768]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42768
 [CVE-2026-42769]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42769
 [CVE-2026-42770]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42770
+[CVE-2026-42771]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42771
 [CVE-2026-42772]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42772
 [CVE-2026-45445]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-45445
 [CVE-2026-45446]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-45446
@@ -2394,6 +2654,7 @@ OpenSSL 0.9.x
 [CVE-2026-54873]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54873
 [CVE-2026-54874]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54874
 [CVE-2026-54875]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54875
+[CVE-2026-54876]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54876
 [CVE-2026-63072]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63072
 [CVE-2026-63073]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63073
 [CVE-2026-63074]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63074
@@ -2406,9 +2667,18 @@ OpenSSL 0.9.x
 [CVE-2026-75806]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-75806
 [CVE-2026-77696]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-77696
 [CVE-2026-84782]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-84782
+[CVE-2026-84783]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-84783
 [CVE-2026-84784]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-84784
 [ESV]: https://csrc.nist.gov/Projects/cryptographic-module-validation-program/entropy-validations
-[OpenSSL Guide]: https://www.openssl.org/docs/manmaster/man7/ossl-guide-introduction.html
+[OpenSSL Guide]: https://docs.openssl.org/master/man7/ossl-guide-introduction
 [README-QUIC.md]: ./README-QUIC.md
+[RFC 7919]: https://datatracker.ietf.org/doc/html/rfc7919
+[RFC 8422]: https://datatracker.ietf.org/doc/html/rfc8422
+[RFC 8701]: https://datatracker.ietf.org/doc/html/rfc8701
+[RFC 8998]: https://datatracker.ietf.org/doc/html/rfc8998#name-iana-considerations
+[RFC 9147]: https://datatracker.ietf.org/doc/html/rfc9147
+[RFC 9849]: https://datatracker.ietf.org/doc/html/rfc9849
+[SP 800-185]: https://csrc.nist.gov/pubs/sp/800/185/final
+[SP 800-208]: https://csrc.nist.gov/pubs/sp/800/208/final
 [issue tracker]: https://github.com/openssl/openssl/issues
 [jitterentropy-library]: https://github.com/smuellerDD/jitterentropy-library
diff --git a/deps/openssl/openssl/NOTES-ANDROID.md b/deps/openssl/openssl/NOTES-ANDROID.md
index b71365fe731..8716de128fb 100644
--- a/deps/openssl/openssl/NOTES-ANDROID.md
+++ b/deps/openssl/openssl/NOTES-ANDROID.md
@@ -42,6 +42,12 @@ Notes for Android platforms
     ./Configure android-arm64 -D__ANDROID_API__=29
     make

+**Note**: 64-bit devices running Android 15 (API Level 35) and above may require
+native libraries with a 16 KB page size. OpenSSL libraries with a 16 KB
+page size are built by default on version 3.6.0 and above. For prior
+versions of OpenSSL, you can pass the argument `-Wl,-z,max-page-size=16384`
+to Configure while building OpenSSL for 64-bit devices.
+
  Older versions of the NDK have GCC under their common prebuilt tools
  directory, so the bin path will be slightly different. EG: to compile
  for ICS on ARM with NDK 10d:
diff --git a/deps/openssl/openssl/NOTES-ANSI.md b/deps/openssl/openssl/NOTES-ANSI.md
deleted file mode 100644
index feeb5434855..00000000000
--- a/deps/openssl/openssl/NOTES-ANSI.md
+++ /dev/null
@@ -1,33 +0,0 @@
-Notes on ANSI C
-===============
-
-When building for pure ANSI C (C89/C90), you must configure with at least
-the following configuration settings:
-
--   `no-asm`
-
-    There are cases of `asm()` calls in our C source, which isn't supported
-    in pure ANSI C.
-
--   `no-secure-memory`
-
-    The secure memory calls aren't supported with ANSI C.
-
--   `-D_XOPEN_SOURCE=1`
-
-    This macro enables the use of the following types, functions and global
-    variables:
-
-    -   `timezone`
-
--   `-D_POSIX_C_SOURCE=200809L`
-
-    This macro enables the use of the following types, functions and global
-    variables:
-
-    -   `ssize_t`
-    -   `strdup()`
-
-It's arguable that with gcc and clang, all of these issues are removed when
-defining the macro `_DEFAULT_SOURCE`.  However, that effectively sets the C
-language level to C99, which isn't ANSI C.
diff --git a/deps/openssl/openssl/NOTES-C99.md b/deps/openssl/openssl/NOTES-C99.md
new file mode 100644
index 00000000000..59bf502daf7
--- /dev/null
+++ b/deps/openssl/openssl/NOTES-C99.md
@@ -0,0 +1,49 @@
+Notes on C-99
+=============
+
+This file contains a list of C-99 features we don't allow for OpenSSL.
+Starting with 3.6 OpenSSL project is going to gradually adopt C-99 features.
+The plan is to bring those features in small steps. Either with new
+code where particular C-99 construct makes sense (think of designated initializers),
+or when refactoring existing code and using C-99 language feature improves
+readability/maintainability of the code.  C-99 seems to be implemented by major
+compilers ([clang](https://clang.llvm.org/c_status.html#c99), [gcc](https://gcc.gnu.org/c99status.html), [msvc](https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170)), therefore we can opt
+for permissive policy to adopt C-99 standard. This approach means OpenSSL
+project accepts all C-99 features except those explicitly listed here.
+The list here is going to be updated by features we either
+
+   - find not useful (or not a good match) for OpenSSL
+
+   - the feature is not implemented by some non-mainstream compiler which
+     we need to keep supported for benefit of OpenSSL users
+
+The list of C-99 features we don't support in OpenSSL project follows:
+
+   - do not use `//` for comments, stick to `/* ... */`
+
+   - do not use `<complex.h>`. MSVC doesn't quite implement it to standard.
+
+   - do not use variable length arrays, i.e. arrays where the size is
+     determined by another variable.  MSVC doesn't implement it at all.
+     For clarity, this is an example of such an array:
+
+     ``` C
+     int fun(size_t n)
+     {
+         char s[n]; /* variable size array */
+         ...
+     }
+     ```
+
+Exit status macros (`EXIT_SUCCESS`, `EXIT_FAILURE`)
+---------------------------------------------------
+
+These macros from `<stdlib.h>` represent *process* exit status.  Do not use
+them as return values from internal APIs (any function that is not `main()`).
+Use them only as the return value from `main()` or as the argument to
+`exit(3)` (or equivalent, such as `_exit()`).
+
+Elsewhere, be consistent with the rest of the codebase: return a positive
+value for success (often `1`), and `0` or a non-positive value for failure,
+or `bool` when that improves clarity.  See
+<https://github.com/openssl/openssl/issues/30562>.
diff --git a/deps/openssl/openssl/NOTES-NONSTOP.md b/deps/openssl/openssl/NOTES-NONSTOP.md
index a2d485132da..b41758da20e 100644
--- a/deps/openssl/openssl/NOTES-NONSTOP.md
+++ b/deps/openssl/openssl/NOTES-NONSTOP.md
@@ -55,26 +55,6 @@ option to `./Configure`.
 TNS/E has moved to a limited support state, so fixes for this platform will not
 be guaranteed in future.

-Linking and Loading Considerations
-----------------------------------
-
-Because of how the NonStop Common Runtime Environment (CRE) works, there are
-restrictions on how programs can link and load with OpenSSL libraries.
-On current NonStop platforms, programs cannot both statically link OpenSSL
-libraries and dynamically load OpenSSL shared libraries concurrently. If this
-is done, there is a high probability of encountering a SIGSEGV condition
-relating to `atexit()` processing when a shared library is unloaded and when
-the program terminates. This limitation applies to all OpenSSL shared library
-components.
-
-A control has been added as of 3.3.x to disable calls to `atexit()` within the
-`libcrypto` builds (specifically in `crypto/init.c`). This switch can be
-controlled using `disable-atexit` or `enable-atexit`, and is disabled by default
-for NonStop builds. If you need to have `atexit()` functionality, set
-`enabled-atexit` when configuring OpenSSL to enable the `atexit()` call to
-register `OPENSSL_cleanup()` automatically. Preferably, you can explicitly call
-`OPENSSL_cleanup()` from your application.
-
 Secure Memory
 -------------

@@ -187,7 +167,7 @@ the following variables. The following set of compiler defines are required:
 ### Optional Build Variables

     DBGFLAG="--debug"
-    CIPHENABLES="enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers enable-rc4"
+    CIPHENABLES="enable-weak-ssl-ciphers enable-rc4"

 ### Internal Known TNS/X to TNS/E Cross Compile Variables

diff --git a/deps/openssl/openssl/NOTES-PERL.md b/deps/openssl/openssl/NOTES-PERL.md
index 3a91f09c2d5..928b67b5ff6 100644
--- a/deps/openssl/openssl/NOTES-PERL.md
+++ b/deps/openssl/openssl/NOTES-PERL.md
@@ -6,7 +6,7 @@ Notes on Perl
  - [Perl on VMS](#perl-on-vms)
  - [Perl on NonStop](#perl-on-nonstop)
  - [Required Perl modules](#required-perl-modules)
- - [Notes on installing a Perl module](#notes-on-installing-a-perl-module])
+ - [Notes on installing a Perl module](#notes-on-installing-a-perl-module)

 General Notes
 -------------
diff --git a/deps/openssl/openssl/NOTES-SANITIZERS.md b/deps/openssl/openssl/NOTES-SANITIZERS.md
new file mode 100644
index 00000000000..854a95dd6ae
--- /dev/null
+++ b/deps/openssl/openssl/NOTES-SANITIZERS.md
@@ -0,0 +1,149 @@
+Notes on Sanitizers
+===================
+
+Compiler sanitizers are tools that can be enabled during compilation to detect
+various types of bugs at runtime. OpenSSL supports three sanitizers:
+
+- **AddressSanitizer (ASan)**: Detects memory errors such as use-after-free,
+  buffer overflows, and memory leaks.
+- **UndefinedBehaviorSanitizer (UBSan)**: Detects undefined behavior such as
+  integer overflow, null pointer dereference, and type mismatches.
+- **MemorySanitizer (MSan)**: Detects use of uninitialized memory.
+
+Sanitizers are generally faster than Valgrind and can detect certain issues
+that Valgrind cannot, making them a useful complement to Valgrind-based testing.
+
+Requirements
+------------
+
+1. GCC or Clang compiler with sanitizer support
+   - GCC 4.8+ or Clang 3.1+ for ASan and UBSan
+   - Clang only for MSan (GCC does not implement MemorySanitizer)
+2. Linux, macOS, or other supported platform
+   - Note: MSan is only supported on Linux
+   - Note: Leak detection (LSan) is not yet supported on macOS
+
+Building with Sanitizers
+------------------------
+
+OpenSSL provides configuration options to enable sanitizers:
+
+### AddressSanitizer (ASan)
+
+    $ ./config enable-asan
+    $ make
+
+### UndefinedBehaviorSanitizer (UBSan)
+
+    $ ./config enable-ubsan
+    $ make
+
+### MemorySanitizer (MSan)
+
+MSan is only implemented by Clang, so the compiler must be set to clang:
+
+    $ CC=clang ./config enable-msan
+    $ make
+
+Note: MSan requires that all code, including libraries, be compiled with MSan.
+This makes it more difficult to use than ASan or UBSan.
+
+### Combining Sanitizers
+
+ASan and UBSan can be used together:
+
+    $ ./config enable-asan enable-ubsan
+    $ make
+
+Note: ASan and MSan cannot be used together as they are mutually exclusive.
+
+Running Tests
+-------------
+
+After building with sanitizers enabled, run the tests normally:
+
+    $ make test
+
+The sanitizers will automatically detect issues during test execution and
+report them to stderr. If a sanitizer detects an error, the test will fail.
+
+### Running Specific Tests
+
+To run a specific test with verbose output:
+
+    $ make test TESTS=test_name VERBOSE=1
+
+### Sanitizer Environment Variables
+
+Sanitizer behavior can be controlled via environment variables:
+
+#### ASAN_OPTIONS
+
+Controls AddressSanitizer behavior. Common options:
+
+    # Allow malloc to return NULL instead of aborting
+    ASAN_OPTIONS=allocator_may_return_null=1
+
+    # Disable leak detection (LSan runs as part of ASan by default)
+    ASAN_OPTIONS=detect_leaks=0
+
+    # Get more detailed stack traces
+    ASAN_OPTIONS=fast_unwind_on_malloc=0
+
+#### UBSAN_OPTIONS
+
+Controls UndefinedBehaviorSanitizer behavior:
+
+    # Print stack traces for UBSan errors
+    UBSAN_OPTIONS=print_stacktrace=1
+
+#### MSAN_OPTIONS
+
+Controls MemorySanitizer behavior:
+
+    # Allow malloc to return NULL instead of aborting
+    MSAN_OPTIONS=allocator_may_return_null=1
+
+Example with environment variables:
+
+    $ ASAN_OPTIONS=detect_leaks=1 make test TESTS=test_name
+
+Interpreting Results
+--------------------
+
+When a sanitizer detects an issue, it will print a detailed error report
+including:
+
+- The type of error (e.g., "heap-buffer-overflow", "use-after-free")
+- Stack trace showing where the error occurred
+- Stack trace showing where the memory was allocated (for memory errors)
+- Information about the memory region involved
+
+Example ASan output:
+
+    ==12345==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x...
+        #0 0x... in function_name file.c:123
+        #1 0x... in caller_function file.c:456
+        ...
+
+Comparison with Valgrind
+------------------------
+
+| Feature                    | Sanitizers        | Valgrind          |
+|----------------------------|-------------------|-------------------|
+| Performance                | ~2x slowdown      | ~10-50x slowdown  |
+| Requires recompilation     | Yes               | No                |
+| Memory leak detection      | ASan (with LSan)  | Yes               |
+| Uninitialized memory       | MSan              | Yes               |
+| Buffer overflow detection  | ASan              | Yes               |
+| Undefined behavior         | UBSan             | Limited           |
+| Platform support           | Linux, macOS      | Linux, macOS, etc |
+
+See Also
+--------
+
+- [NOTES-VALGRIND.md](NOTES-VALGRIND.md) - Running tests with Valgrind
+- [test/README.md](test/README.md) - General test documentation
+- [AddressSanitizer documentation](https://clang.llvm.org/docs/AddressSanitizer.html)
+- [UndefinedBehaviorSanitizer documentation](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html)
+- [MemorySanitizer documentation](https://clang.llvm.org/docs/MemorySanitizer.html)
diff --git a/deps/openssl/openssl/NOTES-VALGRIND.md b/deps/openssl/openssl/NOTES-VALGRIND.md
index 96f0df1d194..cd82d01fdc4 100644
--- a/deps/openssl/openssl/NOTES-VALGRIND.md
+++ b/deps/openssl/openssl/NOTES-VALGRIND.md
@@ -70,3 +70,76 @@ with the `VERBOSE` or `VF` or `VFP` options to gather additional information.

     $ make test VERBOSE=1 TESTS=test_test EXE_SHELL="$(/bin/pwd)/util/wrap.pl \
        valgrind --error-exitcode=1 --leak-check=full -q" OPENSSL_ia32cap=":0"
+
+Still reachable memory
+======================
+
+OpenSSL 4.0 no longer arms `OPENSSL_cleanup()` function as an `atexit(3)`
+handler. So, unless the application explicitly calls `OPENSSL_cleanup()`, valgrind and
+similar memory leak detectors may report `still reachable` memory blocks
+as memory leaks. An example of a valgrind report reads as follows:
+
+    # valgrind ./pkeyread -f pem -k dh 8
+    ==280439== Memcheck, a memory error detector
+    ==280439== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
+    ==280439== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info
+    ==280439== Command: ./pkeyread -f pem -k dh 8
+    ==280439==
+    Average time per pem(dh) call: 506329.113924us
+    ==280439==
+    ==280439== HEAP SUMMARY:
+    ==280439==     in use at exit: 239,521 bytes in 4,137 blocks
+    ==280439==   total heap usage: 21,841 allocs, 17,704 frees, 4,089,104 bytes allocated
+    ==280439==
+    ==280439== LEAK SUMMARY:
+    ==280439==    definitely lost: 0 bytes in 0 blocks
+    ==280439==    indirectly lost: 0 bytes in 0 blocks
+    ==280439==      possibly lost: 0 bytes in 0 blocks
+    ==280439==    still reachable: 239,521 bytes in 4,137 blocks
+    ==280439==         suppressed: 0 bytes in 0 blocks
+    ==280439== Rerun with --leak-check=full to see details of leaked memory
+    ==280439==
+    ==280439== For lists of detected and suppressed errors, rerun with: -s
+    ==280439== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
+
+The valgrind output above reports there are 239,521 of reachable memory
+when process exits. That memory is not regarded as a true memory leak
+as the OS will reclaim that memory on process exit, rendering calls to libc
+`free()` within `OPENSSL_cleanup()` useless. Also calling `OPENSSL_cleanup()`
+is discouraged when libcrypto is being linked with process to satisfy more
+than one dependency paths. If it is the case then calling `OPENSSL_cleanup()`
+may lead to spurious application crashes during exit.
+
+If memory leaks caused by _still reachable memory_ are still an issue,
+then preferred way is to suppress those reports using the suppression
+file [1] instead of changing exiting code by adding a call to `OPENSSL_cleanup()`.
+The suppression file for OpenSSL is shipped within the OpenSSL sources and
+can be found at`$OPENSSL_SRCS/util/valgrind.suppressions` where `OPENSSL_SRCS`
+is an environment variable containing path to the OpenSSL source
+tree. To use it, just add `--suppressions` option to the valgrind command:
+`valgrind --suppressions="$OPENSSL_SRCS/util/valgrind.suppression" ...`
+For `pkeyread` the command and output reads as follows:
+
+    # valgrind --suppressions=$OPENSSL_SRCS/util/valgrind.suppression  ./pkeyread -f pem -k dh 8
+    ==280896== Memcheck, a memory error detector
+    ==280896== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
+    ==280896== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info
+    ==280896== Command: ./pkeyread -f pem -k dh 8
+    ==280896==
+    Average time per pem(dh) call: 476190.476190us
+    ==280896==
+    ==280896== HEAP SUMMARY:
+    ==280896==     in use at exit: 239,521 bytes in 4,137 blocks
+    ==280896==   total heap usage: 22,816 allocs, 18,679 frees, 4,325,714 bytes allocated
+    ==280896==
+    ==280896== LEAK SUMMARY:
+    ==280896==    definitely lost: 0 bytes in 0 blocks
+    ==280896==    indirectly lost: 0 bytes in 0 blocks
+    ==280896==      possibly lost: 0 bytes in 0 blocks
+    ==280896==    still reachable: 0 bytes in 0 blocks
+    ==280896==         suppressed: 239,521 bytes in 4,137 blocks
+    ==280896==
+    ==280896== For lists of detected and suppressed errors, rerun with: -s
+    ==280896== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
+
+[1] <https://valgrind.org/docs/manual/manual-core.html#manual-core.suppress>
diff --git a/deps/openssl/openssl/NOTES-WINDOWS.md b/deps/openssl/openssl/NOTES-WINDOWS.md
index 5d6287a8e8f..a7889cd3d20 100644
--- a/deps/openssl/openssl/NOTES-WINDOWS.md
+++ b/deps/openssl/openssl/NOTES-WINDOWS.md
@@ -7,6 +7,8 @@ Notes for Windows platforms
  - [Native builds using MinGW](#native-builds-using-mingw)
  - [Linking native applications](#linking-native-applications)
  - [Hosted builds using Cygwin](#hosted-builds-using-cygwin)
+ - [Hosted builds using Windows Subsystem for Linux (WSL)](
+   #hosted-builds-using-windows-subsystem-for-linux-wsl)

 There are various options to build and run OpenSSL on the Windows platforms.

@@ -23,7 +25,7 @@ or

 "Hosted" OpenSSL relies on an external POSIX compatibility layer
 for building (using GNU/Unix shell, compiler, and tools) and at run time.
-For this option, you can use Cygwin.
+For this option, you can use Cygwin or the Windows Subsystem for Linux (WSL).

 Native builds using Visual C++
 ==============================
@@ -85,6 +87,8 @@ Quick start
        on the Universal CRT or
     - `perl Configure VC-WIN64A-HYBRIDCRT` if you want 64-bit OpenSSL dependent
        on the Universal CRT or
+    - `perl Configure VC-WIN64-ARM-HYBRIDCRT` if you want Windows on Arm
+       (win-arm64) OpenSSL dependent on the Universal CRT or
     - `perl Configure`              to let Configure figure out the platform

     a. If you don't plan to develop OpenSSL yourself and don't need to rebuild,
@@ -92,6 +96,13 @@ Quick start
        dependency feature can speed up build times by up to 50%:
        `perl Configure no-makedepend`

+    b. If you want the OpenSSL binaries to be "self contained", usable on any
+       computer running MS Windows, use 'perl Configure enable-static-vcruntime'.
+       Otherwise, build will produce binaries that depend on the VC runtime
+       libraries being installed and available, and will not work on computers
+       that do not have them.  (This option adds 1 MB to the total size of the
+       two dll's.)
+
  6. `nmake`

  7. `nmake test`
@@ -112,11 +123,10 @@ install it to a variety of locations.
 The following keys:

     `\\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\OpenSSL-<version>-<ctx>\OPENSSLDIR`
-    `\\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\OpenSSL-<version>-<ctx>\ENGINESDIR`
     `\\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\OpenSSL-<version>-<ctx>\MODULESDIR`

 Can be administratively set, and openssl will take the paths found there as the
-values for OPENSSLDIR, ENGINESDIR and MODULESDIR respectively.
+values for OPENSSLDIR and MODULESDIR respectively.

 To enable the reading of registry keys from windows builds, add
 `-DOSSL_WINCTX=<string>`to the Configure command line.  This define is used
@@ -288,3 +298,71 @@ NOTE: `make test` and normal file operations may fail in directories
 mounted as text (i.e. `mount -t c:\somewhere /home`) due to Cygwin
 stripping of carriage returns. To avoid this, ensure that a binary
 mount is used, e.g. `mount -b c:\somewhere /home`.
+
+Hosted builds using Windows Subsystem for Linux (WSL)
+======================================================
+
+WSL provides a Linux-compatible environment directly on Windows, allowing
+OpenSSL to be built using standard GNU/Unix tools. The resulting OpenSSL
+runs within the WSL environment and relies on the WSL compatibility layer
+at run time.
+
+ 1. Install WSL and a Linux distribution (e.g. Ubuntu), see
+    <https://learn.microsoft.com/windows/wsl/install>
+
+ 2. Ensure your distribution is up to date:
+
+        sudo apt update && sudo apt upgrade
+
+ 3. Install the required build dependencies. On Debian/Ubuntu-based
+    distributions:
+
+        sudo apt install build-essential perl make
+
+ 4. Optionally install the NASM assembler for optimised assembly routines:
+
+        sudo apt install nasm
+
+ 5. Run the WSL shell (e.g. Ubuntu) from the Start menu or by running
+    `wsl` from a Windows command prompt
+
+ 6. From the root of the OpenSSL source directory, configure the build:
+
+        ./Configure
+
+    or specify a prefix and openssldir explicitly:
+
+        ./Configure --prefix=/usr/local/ssl --openssldir=/usr/local/ssl
+
+ 7. Build, test, and install:
+
+        make
+        make test
+        make install
+
+Apart from the setup steps above, follow the Unix / Linux instructions
+in INSTALL.md and the shared library path guidance in NOTES-UNIX.md.
+
+NOTE: The OpenSSL source tree should reside on the Linux filesystem
+(e.g. under `~/`) rather than on a mounted Windows path such as
+`/mnt/c/`. Building from a mounted Windows path can result in
+significantly slower build times and occasional failures due to
+filesystem permission and interoperability differences between NTFS
+and the Linux layer. If your source is on the Windows filesystem,
+copy it into the WSL home directory first:
+
+    cp -r /mnt/c/path/to/openssl ~/openssl
+
+NOTE: If you do build from a mounted Windows path (e.g. /mnt/c/), be aware
+that Windows line endings (CRLF) in source or script files can cause
+configure and build scripts to fail. In this case, run dos2unix on the
+affected files before building:
+
+    dos2unix Configure   # removes all \r (carriage return) characters
+    dos2unix config      # does the same, but for the config script
+    dos2unix *.sh        # runs dos2unix on all shell scripts in the directory,
+                         # ensuring every .sh file has correct Unix line endings
+
+dos2unix can be installed via:
+
+    sudo apt install dos2unix
diff --git a/deps/openssl/openssl/README-ENGINES.md b/deps/openssl/openssl/README-ENGINES.md
deleted file mode 100644
index 24ec748fe56..00000000000
--- a/deps/openssl/openssl/README-ENGINES.md
+++ /dev/null
@@ -1,317 +0,0 @@
-Engines
-=======
-
-Deprecation Note
-----------------
-
-The ENGINE API was introduced in OpenSSL version 0.9.6 as a low level
-interface for adding alternative implementations of cryptographic
-primitives, most notably for integrating hardware crypto devices.
-
-The ENGINE interface has its limitations and it has been superseded
-by the [PROVIDER API](README-PROVIDERS.md), it is deprecated in OpenSSL
-version 3.0. The following documentation is retained as an aid for
-users who need to maintain or support existing ENGINE implementations.
-Support for new hardware devices or new algorithms should be added
-via providers, and existing engines should be converted to providers
-as soon as possible.
-
-Built-in ENGINE implementations
--------------------------------
-
-There are currently built-in ENGINE implementations for the following
-crypto devices:
-
-- Microsoft CryptoAPI
-- VIA Padlock
-- nCipher CHIL
-
-In addition, dynamic binding to external ENGINE implementations is now
-provided by a special ENGINE called "dynamic". See the "DYNAMIC ENGINE"
-section below for details.
-
-At this stage, a number of things are still needed and are being worked on:
-
-1. Integration of EVP support.
-2. Configuration support.
-3. Documentation!
-
-Integration of EVP support
---------------------------
-
-With respect to EVP, this relates to support for ciphers and digests in
-the ENGINE model so that alternative implementations of existing
-algorithms/modes (or previously unimplemented ones) can be provided by
-ENGINE implementations.
-
-Configuration support
----------------------
-
-Configuration support currently exists in the ENGINE API itself, in the
-form of "control commands". These allow an application to expose to the
-user/admin the set of commands and parameter types a given ENGINE
-implementation supports, and for an application to directly feed string
-based input to those ENGINEs, in the form of name-value pairs. This is an
-extensible way for ENGINEs to define their own "configuration" mechanisms
-that are specific to a given ENGINE (eg. for a particular hardware
-device) but that should be consistent across *all* OpenSSL-based
-applications when they use that ENGINE. Work is in progress (or at least
-in planning) for supporting these control commands from the CONF (or
-NCONF) code so that applications using OpenSSL's existing configuration
-file format can have ENGINE settings specified in much the same way.
-Presently however, applications must use the ENGINE API itself to provide
-such functionality. To see first hand the types of commands available
-with the various compiled-in ENGINEs (see further down for dynamic
-ENGINEs), use the "engine" openssl utility with full verbosity, i.e.:
-
-    openssl engine -vvvv
-
-Documentation
--------------
-
-Documentation? Volunteers welcome! The source code is reasonably well
-self-documenting, but some summaries and usage instructions are needed -
-moreover, they are needed in the same POD format the existing OpenSSL
-documentation is provided in. Any complete or incomplete contributions
-would help make this happen.
-
-STABILITY & BUG-REPORTS
-=======================
-
-What already exists is fairly stable as far as it has been tested, but
-the test base has been a bit small most of the time. For the most part,
-the vendors of the devices these ENGINEs support have contributed to the
-development and/or testing of the implementations, and *usually* (with no
-guarantees) have experience in using the ENGINE support to drive their
-devices from common OpenSSL-based applications. Bugs and/or inexplicable
-behaviour in using a specific ENGINE implementation should be sent to the
-author of that implementation (if it is mentioned in the corresponding C
-file), and in the case of implementations for commercial hardware
-devices, also through whatever vendor support channels are available. If
-none of this is possible, or the problem seems to be something about the
-ENGINE API itself (ie. not necessarily specific to a particular ENGINE
-implementation) then you should mail complete details to the relevant
-OpenSSL mailing list. For a definition of "complete details", refer to
-the OpenSSL "README" file. As for which list to send it to:
-
-- openssl-users: if you are *using* the ENGINE abstraction, either in an
-  pre-compiled application or in your own application code.
-
-- openssl-dev: if you are discussing problems with OpenSSL source code.
-
-USAGE
-=====
-
-The default "openssl" ENGINE is always chosen when performing crypto
-operations unless you specify otherwise. You must actively tell the
-openssl utility commands to use anything else through a new command line
-switch called "-engine". Also, if you want to use the ENGINE support in
-your own code to do something similar, you must likewise explicitly
-select the ENGINE implementation you want.
-
-Depending on the type of hardware, system, and configuration, "settings"
-may need to be applied to an ENGINE for it to function as expected/hoped.
-The recommended way of doing this is for the application to support
-ENGINE "control commands" so that each ENGINE implementation can provide
-whatever configuration primitives it might require and the application
-can allow the user/admin (and thus the hardware vendor's support desk
-also) to provide any such input directly to the ENGINE implementation.
-This way, applications do not need to know anything specific to any
-device, they only need to provide the means to carry such user/admin
-input through to the ENGINE in question. Ie. this connects *you* (and
-your helpdesk) to the specific ENGINE implementation (and device), and
-allows application authors to not get buried in hassle supporting
-arbitrary devices they know (and care) nothing about.
-
-A new "openssl" utility, "openssl engine", has been added in that allows
-for testing and examination of ENGINE implementations. Basic usage
-instructions are available by specifying the "-?" command line switch.
-
-DYNAMIC ENGINES
-===============
-
-The new "dynamic" ENGINE provides a low-overhead way to support ENGINE
-implementations that aren't pre-compiled and linked into OpenSSL-based
-applications. This could be because existing compiled-in implementations
-have known problems and you wish to use a newer version with an existing
-application. It could equally be because the application (or OpenSSL
-library) you are using simply doesn't have support for the ENGINE you
-wish to use, and the ENGINE provider (eg. hardware vendor) is providing
-you with a self-contained implementation in the form of a shared-library.
-The other use-case for "dynamic" is with applications that wish to
-maintain the smallest foot-print possible and so do not link in various
-ENGINE implementations from OpenSSL, but instead leaves you to provide
-them, if you want them, in the form of "dynamic"-loadable
-shared-libraries. It should be possible for hardware vendors to provide
-their own shared-libraries to support arbitrary hardware to work with
-applications based on OpenSSL 0.9.7 or later. If you're using an
-application based on 0.9.7 (or later) and the support you desire is only
-announced for versions later than the one you need, ask the vendor to
-backport their ENGINE to the version you need.
-
-How does "dynamic" work?
-------------------------
-
-The dynamic ENGINE has a special flag in its implementation such that
-every time application code asks for the 'dynamic' ENGINE, it in fact
-gets its own copy of it. As such, multi-threaded code (or code that
-multiplexes multiple uses of 'dynamic' in a single application in any
-way at all) does not get confused by 'dynamic' being used to do many
-independent things. Other ENGINEs typically don't do this so there is
-only ever 1 ENGINE structure of its type (and reference counts are used
-to keep order). The dynamic ENGINE itself provides absolutely no
-cryptographic functionality, and any attempt to "initialise" the ENGINE
-automatically fails. All it does provide are a few "control commands"
-that can be used to control how it will load an external ENGINE
-implementation from a shared-library. To see these control commands,
-use the command-line;
-
-    openssl engine -vvvv dynamic
-
-The "SO_PATH" control command should be used to identify the
-shared-library that contains the ENGINE implementation, and "NO_VCHECK"
-might possibly be useful if there is a minor version conflict and you
-(or a vendor helpdesk) is convinced you can safely ignore it.
-"ID" is probably only needed if a shared-library implements
-multiple ENGINEs, but if you know the engine id you expect to be using,
-it doesn't hurt to specify it (and this provides a sanity check if
-nothing else). "LIST_ADD" is only required if you actually wish the
-loaded ENGINE to be discoverable by application code later on using the
-ENGINE's "id". For most applications, this isn't necessary - but some
-application authors may have nifty reasons for using it. The "LOAD"
-command is the only one that takes no parameters and is the command
-that uses the settings from any previous commands to actually *load*
-the shared-library ENGINE implementation. If this command succeeds, the
-(copy of the) 'dynamic' ENGINE will magically morph into the ENGINE
-that has been loaded from the shared-library. As such, any control
-commands supported by the loaded ENGINE could then be executed as per
-normal. For instance, if ENGINE "foo" is implemented in the shared-library
-"libfoo.so" and it supports some special control command "CMD_FOO", the
-following code would load and use it (NB: obviously this code has no
-error checking);
-
-    ENGINE *e = ENGINE_by_id("dynamic");
-    ENGINE_ctrl_cmd_string(e, "SO_PATH", "/lib/libfoo.so", 0);
-    ENGINE_ctrl_cmd_string(e, "ID", "foo", 0);
-    ENGINE_ctrl_cmd_string(e, "LOAD", NULL, 0);
-    ENGINE_ctrl_cmd_string(e, "CMD_FOO", "some input data", 0);
-
-For testing, the "openssl engine" utility can be useful for this sort
-of thing. For example the above code excerpt would achieve much the
-same result as;
-
-    openssl engine dynamic \
-              -pre SO_PATH:/lib/libfoo.so \
-              -pre ID:foo \
-              -pre LOAD \
-              -pre "CMD_FOO:some input data"
-
-Or to simply see the list of commands supported by the "foo" ENGINE;
-
-    openssl engine -vvvv dynamic \
-              -pre SO_PATH:/lib/libfoo.so \
-              -pre ID:foo \
-              -pre LOAD
-
-Applications that support the ENGINE API and more specifically, the
-"control commands" mechanism, will provide some way for you to pass
-such commands through to ENGINEs. As such, you would select "dynamic"
-as the ENGINE to use, and the parameters/commands you pass would
-control the *actual* ENGINE used. Each command is actually a name-value
-pair and the value can sometimes be omitted (eg. the "LOAD" command).
-Whilst the syntax demonstrated in "openssl engine" uses a colon to
-separate the command name from the value, applications may provide
-their own syntax for making that separation (eg. a win32 registry
-key-value pair may be used by some applications). The reason for the
-"-pre" syntax in the "openssl engine" utility is that some commands
-might be issued to an ENGINE *after* it has been initialised for use.
-Eg. if an ENGINE implementation requires a smart-card to be inserted
-during initialisation (or a PIN to be typed, or whatever), there may be
-a control command you can issue afterwards to "forget" the smart-card
-so that additional initialisation is no longer possible. In
-applications such as web-servers, where potentially volatile code may
-run on the same host system, this may provide some arguable security
-value. In such a case, the command would be passed to the ENGINE after
-it has been initialised for use, and so the "-post" switch would be
-used instead. Applications may provide a different syntax for
-supporting this distinction, and some may simply not provide it at all
-("-pre" is almost always what you're after, in reality).
-
-How do I build a "dynamic" ENGINE?
-----------------------------------
-
-This question is trickier - currently OpenSSL bundles various ENGINE
-implementations that are statically built in, and any application that
-calls the "ENGINE_load_builtin_engines()" function will automatically
-have all such ENGINEs available (and occupying memory). Applications
-that don't call that function have no ENGINEs available like that and
-would have to use "dynamic" to load any such ENGINE - but on the other
-hand such applications would only have the memory footprint of any
-ENGINEs explicitly loaded using user/admin provided control commands.
-The main advantage of not statically linking ENGINEs and only using
-"dynamic" for hardware support is that any installation using no
-"external" ENGINE suffers no unnecessary memory footprint from unused
-ENGINEs. Likewise, installations that do require an ENGINE incur the
-overheads from only *that* ENGINE once it has been loaded.
-
-Sounds good? Maybe, but currently building an ENGINE implementation as
-a shared-library that can be loaded by "dynamic" isn't automated in
-OpenSSL's build process. It can be done manually quite easily however.
-Such a shared-library can either be built with any OpenSSL code it
-needs statically linked in, or it can link dynamically against OpenSSL
-if OpenSSL itself is built as a shared library. The instructions are
-the same in each case, but in the former (statically linked any
-dependencies on OpenSSL) you must ensure OpenSSL is built with
-position-independent code ("PIC"). The default OpenSSL compilation may
-already specify the relevant flags to do this, but you should consult
-with your compiler documentation if you are in any doubt.
-
-This example will show building the "atalla" ENGINE in the
-crypto/engine/ directory as a shared-library for use via the "dynamic"
-ENGINE.
-
-1.  "cd" to the crypto/engine/ directory of a pre-compiled OpenSSL
-    source tree.
-
-2.  Recompile at least one source file so you can see all the compiler
-    flags (and syntax) being used to build normally. Eg;
-
-        touch hw_atalla.c ; make
-
-    will rebuild "hw_atalla.o" using all such flags.
-
-3.  Manually enter the same compilation line to compile the
-    "hw_atalla.c" file but with the following two changes;
-
-    - add "-DENGINE_DYNAMIC_SUPPORT" to the command line switches,
-    - change the output file from "hw_atalla.o" to something new,
-      eg. "tmp_atalla.o"
-
-4.  Link "tmp_atalla.o" into a shared-library using the top-level
-    OpenSSL libraries to resolve any dependencies. The syntax for doing
-    this depends heavily on your system/compiler and is a nightmare
-    known well to anyone who has worked with shared-library portability
-    before. 'gcc' on Linux, for example, would use the following syntax;
-
-        gcc -shared -o dyn_atalla.so tmp_atalla.o -L../.. -lcrypto
-
-5.  Test your shared library using "openssl engine" as explained in the
-    previous section. Eg. from the top-level directory, you might try
-
-        apps/openssl engine -vvvv dynamic \
-              -pre SO_PATH:./crypto/engine/dyn_atalla.so -pre LOAD
-
-If the shared-library loads successfully, you will see both "-pre"
-commands marked as "SUCCESS" and the list of control commands
-displayed (because of "-vvvv") will be the control commands for the
-*atalla* ENGINE (ie. *not* the 'dynamic' ENGINE). You can also add
-the "-t" switch to the utility if you want it to try and initialise
-the atalla ENGINE for use to test any possible hardware/driver issues.
-
-PROBLEMS
-========
-
-It seems like the ENGINE part doesn't work too well with CryptoSwift on Win32.
-A quick test done right before the release showed that trying "openssl speed
--engine cswift" generated errors. If the DSO gets enabled, an attempt is made
-to write at memory address 0x00000002.
diff --git a/deps/openssl/openssl/README-FIPS.md b/deps/openssl/openssl/README-FIPS.md
index feb6892a2c4..8b923892bb5 100644
--- a/deps/openssl/openssl/README-FIPS.md
+++ b/deps/openssl/openssl/README-FIPS.md
@@ -18,7 +18,7 @@ See <https://www.openssl.org/source/> for information related to OpenSSL
 FIPS certificates and Security Policies.

 Newer OpenSSL Releases that include security or bug fixes can be used to build
-all other components (such as the core API's, TLS and the default, base and
+all other components (such as the core APIs, TLS and the default, base and
 legacy providers) without any restrictions, but the FIPS provider must be built
 as specified in the Security Policy (normally with a different version of the
 source code).
@@ -113,19 +113,19 @@ which versions are FIPS validated. For this example we use OpenSSL 3.1.2.
 Download and build the latest release of OpenSSL
 ------------------------------------------------

-We use OpenSSL 3.5.0 here, (but you could also use the latest 3.5.X)
+We use OpenSSL 3.6.0 here, (but you could also use the latest 3.6.X)

-    $ wget https://www.openssl.org/source/openssl-3.5.0.tar.gz
-    $ tar -xf openssl-3.5.0.tar.gz
-    $ cd openssl-3.5.0
+    $ wget https://www.openssl.org/source/openssl-3.6.0.tar.gz
+    $ tar -xf openssl-3.6.0.tar.gz
+    $ cd openssl-3.6.0
     $ ./Configure enable-fips
     $ make

 Use the OpenSSL FIPS provider for testing
 -----------------------------------------

-We do this by replacing the artifact for the OpenSSL 3.5.0 FIPS provider.
-Note that the OpenSSL 3.5.0 FIPS provider has not been validated
+We do this by replacing the artifact for the OpenSSL 3.6.0 FIPS provider.
+Note that the OpenSSL 3.6.0 FIPS provider has not been validated
 so it must not be used for FIPS purposes.

     $ cp ../openssl-3.1.2/providers/fips.so providers/.
@@ -151,7 +151,7 @@ Copy the FIPS provider artifacts (`fips.so` & `fipsmodule.cnf`) to known locatio
 Check that the correct FIPS provider is being used
 --------------------------------------------------

-    $ cd ../openssl-3.5.0
+    $ cd ../openssl-3.6.0
     $./util/wrap.pl -fips apps/openssl list -provider-path providers \
     -provider fips -providers

@@ -159,7 +159,7 @@ Check that the correct FIPS provider is being used
     Providers:
       base
         name: OpenSSL Base Provider
-        version: 3.5.0
+        version: 3.6.0
         status: active
       fips
         name: OpenSSL FIPS Provider
@@ -172,7 +172,7 @@ Using the FIPS Module in applications
 Documentation about using the FIPS module is available on the [fips_module(7)]
 manual page.

- [fips_module(7)]: https://www.openssl.org/docs/manmaster/man7/fips_module.html
+ [fips_module(7)]: https://docs.openssl.org/master/man7/fips_module

 Entropy Source
 ==============
diff --git a/deps/openssl/openssl/README-PROVIDERS.md b/deps/openssl/openssl/README-PROVIDERS.md
index 3b5476831b2..159a2cb3bb4 100644
--- a/deps/openssl/openssl/README-PROVIDERS.md
+++ b/deps/openssl/openssl/README-PROVIDERS.md
@@ -20,7 +20,7 @@ distribute their own providers which can be added to OpenSSL dynamically.
 Documentation about writing providers is available on the [provider(7)]
 manual page.

- [provider(7)]: https://www.openssl.org/docs/manmaster/man7/provider.html
+ [provider(7)]: https://docs.openssl.org/master/man7/provider

 The Default Provider
 --------------------
@@ -88,7 +88,7 @@ Providers to be loaded can be specified in the OpenSSL config file.
 See the [config(5)] manual page for information about how to configure
 providers via the config file, and how to automatically activate them.

- [config(5)]: https://www.openssl.org/docs/manmaster/man5/config.html
+ [config(5)]: https://docs.openssl.org/master/man5/config

 The following is a minimal config file example to load and activate both
 the legacy and the default provider in the default library context.
diff --git a/deps/openssl/openssl/README-QUIC.md b/deps/openssl/openssl/README-QUIC.md
index 5b70464e5db..451c15d5240 100644
--- a/deps/openssl/openssl/README-QUIC.md
+++ b/deps/openssl/openssl/README-QUIC.md
@@ -12,7 +12,7 @@ some of the following resources:
 - The [OpenSSL Guide] incorporates various code samples. The complete source
   for these can be [found in the source tree under `demos/guide`](./demos/guide/).
 - The [openssl-quic(7) manual page], which provides a basic reference overview
-  of QUIC functionality and how use of QUIC differs from use of TLS with regard
+  of QUIC functionality and how the use of QUIC differs from the use of TLS with regard
   to our API.
 - The [Demo-Driven Design (DDD)][DDD] demos, which demonstrate the use of QUIC
   using simple examples. These can be [found in the source tree under
@@ -61,7 +61,7 @@ $ openssl s_client -quic -alpn myalpn -connect host:port

 In the above example replace `host` with the hostname of the server (e.g.
 `www.example.com`) and `port` with the port for the server (e.g. `443`). Replace
-`myalpn` with the Application Layer Protocol to use (e.g.`h3` represents
+`myalpn` with the Application Layer Protocol to use (e.g. `h3` represents
 HTTP/3). IANA maintains a standard list of [ALPN ids] that can be used.

 This example connects to a QUIC server and opens a single bidirectional stream.
@@ -98,11 +98,11 @@ use this dedicated server example instead.
 For more information about implementing QUIC servers with OpenSSL, refer to the
 [OpenSSL Guide] and the [openssl-quic(7) manual page].

-[openssl-quic(7) manual page]: https://www.openssl.org/docs/manmaster/man7/openssl-quic.html
-[OpenSSL Guide]: https://www.openssl.org/docs/manmaster/man7/ossl-guide-introduction.html
+[openssl-quic(7) manual page]: https://docs.openssl.org/master/man7/openssl-quic
+[OpenSSL Guide]: https://docs.openssl.org/master/man7/ossl-guide-introduction
 [DDD]: https://github.com/openssl/openssl/tree/master/doc/designs/ddd
 [found in the source tree under `doc/designs/ddd`]: ./doc/designs/ddd/
 [demo found in `demos/http3`]: ./demos/http3/
-[QUIC Introduction]: https://www.openssl.org/docs/manmaster/man7/ossl-guide-quic-introduction.html
+[QUIC Introduction]: https://docs.openssl.org/master/man7/ossl-guide-quic-introduction
 [RFC 9114]: https://tools.ietf.org/html/rfc9114
 [ALPN ids]: https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
diff --git a/deps/openssl/openssl/README.md b/deps/openssl/openssl/README.md
index d3f79363d50..97e804076a7 100644
--- a/deps/openssl/openssl/README.md
+++ b/deps/openssl/openssl/README.md
@@ -4,13 +4,14 @@ Welcome to the OpenSSL Project
 [![openssl logo]][www.openssl.org]

 [![github actions ci badge]][github actions ci]
-![Nightly OS Zoo ci badge](https://github.com/openssl/openssl/actions/workflows/os-zoo.yml/badge.svg)
-![Provider Compatibility](https://github.com/openssl/openssl/actions/workflows/provider-compatibility.yml/badge.svg)
-![Quic Interop](https://github.com/openssl/openssl/actions/workflows/run_quic_interop.yml/badge.svg)
-![Daily checks](https://github.com/openssl/openssl/actions/workflows/run-checker-daily.yml/badge.svg)
+[![Nightly OS Zoo ci badge](https://github.com/openssl/openssl/actions/workflows/os-zoo.yml/badge.svg)](https://github.com/openssl/openssl/actions/workflows/os-zoo.yml)
+[![Provider Compatibility](https://github.com/openssl/openssl/actions/workflows/provider-compatibility.yml/badge.svg)](https://github.com/openssl/openssl/actions/workflows/provider-compatibility.yml)
+[![Quic Interop](https://github.com/openssl/openssl/actions/workflows/run_quic_interop.yml/badge.svg)](https://github.com/openssl/openssl/actions/workflows/run_quic_interop.yml)
+[![Daily checks](https://github.com/openssl/openssl/actions/workflows/run-checker-daily.yml/badge.svg)](https://github.com/openssl/openssl/actions/workflows/run-checker-daily.yml)
+[![LFX Health Score](https://insights.linuxfoundation.org/api/badge/health-score?project=openssl)](https://insights.linuxfoundation.org/project/openssl)

 OpenSSL is a robust, commercial-grade, full-featured Open Source Toolkit
-for the TLS (formerly SSL), DTLS and QUIC protocols.
+for the Transport Layer Security (TLS, formerly SSL), Datagram TLS (DTLS), and QUIC protocols.

 The protocol implementations are based on a full-strength general purpose
 cryptographic library, which can also be used stand-alone. Also included is a
@@ -40,7 +41,7 @@ The OpenSSL toolkit includes:

 - **libssl**
   an implementation of all TLS protocol versions up to TLSv1.3 ([RFC 8446]),
-  DTLS protocol versions up to DTLSv1.2 ([RFC 6347]) and
+  DTLS protocol versions up to DTLSv1.3 ([RFC 9147]) and
   the QUIC version 1 protocol ([RFC 9000]).

 - **libcrypto**
@@ -48,7 +49,7 @@ The OpenSSL toolkit includes:
   basis of the TLS implementation, but can also be used independently.

 - **openssl**
-  the OpenSSL command line tool, a swiss army knife for cryptographic tasks,
+  the OpenSSL command line tool, a Swiss Army knife for cryptographic tasks,
   testing and analyzing. It can be used for
   - creation of key parameters
   - creation of X.509 certificates, CSRs and CRLs
@@ -135,7 +136,6 @@ containing additional information on specific topics.
  * [Information about the OpenSSL QUIC protocol implementation](README-QUIC.md)
  * [Information about the OpenSSL Provider architecture](README-PROVIDERS.md)
  * [Information about using the OpenSSL FIPS validated module](README-FIPS.md)
- * [Information about the legacy OpenSSL Engine architecture](README-ENGINES.md)

 The OpenSSL Guide
 -----------------
@@ -149,10 +149,12 @@ Manual Pages
 The manual pages for the master branch and all current stable releases are
 available online.

-- [OpenSSL master](https://www.openssl.org/docs/manmaster)
-- [OpenSSL 3.0](https://www.openssl.org/docs/man3.0)
-- [OpenSSL 3.1](https://www.openssl.org/docs/man3.1)
-- [OpenSSL 3.2](https://www.openssl.org/docs/man3.2)
+- [OpenSSL master](https://docs.openssl.org/master/)
+- [OpenSSL 4.0](https://docs.openssl.org/4.0/)
+- [OpenSSL 3.6](https://docs.openssl.org/3.6/)
+- [OpenSSL 3.5](https://docs.openssl.org/3.5/)
+- [OpenSSL 3.4](https://docs.openssl.org/3.4/)
+- [OpenSSL 3.0](https://docs.openssl.org/3.0/)

 Demos
 -----
@@ -217,7 +219,7 @@ All rights reserved.
     "OpenSSL Wiki"

 [ossl-guide-migration(7ossl)]:
-    <https://www.openssl.org/docs/manmaster/man7/ossl-guide-migration.html>
+    <https://docs.openssl.org/master/man7/ossl-guide-migration>
     "OpenSSL Migration Guide"

 [RFC 8446]:
@@ -229,12 +231,15 @@ All rights reserved.
 [RFC 9000]:
      <https://tools.ietf.org/html/rfc9000>

+[RFC 9147]:
+    <https://tools.ietf.org/html/rfc9147>
+
 [Binaries]:
     <https://github.com/openssl/openssl/wiki/Binaries>
     "List of third party OpenSSL binaries"

 [OpenSSL Guide]:
-    <https://www.openssl.org/docs/manmaster/man7/ossl-guide-introduction.html>
+    <https://docs.openssl.org/master/man7/ossl-guide-introduction>
     "An introduction to OpenSSL"

 <!-- Logos and Badges -->
@@ -248,7 +253,7 @@ All rights reserved.
     "GitHub Actions CI Status"

 [github actions ci]:
-    <https://github.com/openssl/openssl/actions?query=workflow%3A%22GitHub+CI%22>
+    <https://github.com/openssl/openssl/actions/workflows/ci.yml>
     "GitHub Actions CI"

 [appveyor badge]:
diff --git a/deps/openssl/openssl/STYLE.md b/deps/openssl/openssl/STYLE.md
new file mode 100644
index 00000000000..2bedc42a5af
--- /dev/null
+++ b/deps/openssl/openssl/STYLE.md
@@ -0,0 +1,1133 @@
+OpenSSL Style Guide
+===================
+
+Applicability
+-------------
+
+New code in OpenSSL is expected to follow the conventions in this
+guide. Existing code does not uniformly comply and is being brought
+up to standard gradually; non-trivial changes to existing code
+should bring the affected area into compliance.
+
+When bringing an area into compliance as part of a larger change,
+do so in a separate commit -- typically one that lands first, so
+that the substantive change then operates on already-compliant
+code. Combining a compliance sweep with a behaviour change in one
+commit makes the diff hard to review and hard to revert.
+
+Do not bring code into compliance as part of a bug fix. Make the
+minimal change that fixes the bug. This holds for any bug fix, and
+especially for one that may be backported to a stable release
+branch -- and at the time of the fix you often cannot know whether
+it will be. Mixing compliance changes into a fix complicates
+backporting and makes the change larger than it needs to be. Leave
+any compliance work for a separate change.
+
+The language is C99 (ISO/IEC 9899:1999). More modern C versions
+are not yet supported on every platform OpenSSL targets and
+should be avoided.
+
+Formatting
+----------
+
+OpenSSL follows the
+[WebKit coding style for C code](https://webkit.org/code-style-guidelines/).
+In cases where the WebKit guide gives different rules for C and C++,
+OpenSSL uses the C variant.
+
+Whitespace, indentation, brace placement, line wrapping, alignment and
+the other mechanical aspects of formatting are enforced by `clang-format`
+using the [`.clang-format`](.clang-format) file at the top of this
+repository. The configuration is the WebKit C style with a small set
+of OpenSSL-specific customisations (notably the list of project
+typedefs, the `STACK_OF` / `LHASH_OF` type macros, and the list of
+statement-shaped macros).
+
+Run `clang-format` on your changes before submitting; the output of
+`clang-format` is deemed correct. See
+[CONTRIBUTING.md](CONTRIBUTING.md) for the tooling (`.pre-commit-config.yaml`,
+the `util/reformat-patches.sh` helper, and editor integrations).
+
+In rare situations it may be necessary to disable `clang-format` on a
+piece of code. This may be done with paired comments:
+
+```c
+/* clang-format off */
+I am doing something nasty here.
+Reviewers should be triggered.
+/* clang-format on */
+```
+
+This should be used sparingly, and should not be used if there is any
+other way to do what you are doing.
+
+Multi-line comment blocks have an additional clang-format opt-out
+via the `/**` and `/*-` markers; see [Comments](#comments).
+
+Naming
+------
+
+### Functions and variables
+
+A name describes what the identifier holds or what it does.
+Match the name to its role: a variable holding an `X509 *` is
+typically `cert`; one holding an `X509_STORE_CTX *` is typically
+`ctx`; a function that counts the number of active users is
+called `count_active_users()`, not `cntusr()`. Use whole words
+when there is no established short form, and reuse the same
+name across the codebase for the same concept rather than
+inventing synonyms.
+
+Names use lowercase with underscores (snake_case). For public
+functions, snake_case applies to the portion of the name after
+the uppercase subsystem prefix (see below). Do not begin a
+name with an underscore; identifiers starting with an
+underscore are reserved by the C standard in various contexts
+and can collide with toolchain or system identifiers.
+
+For variables, OpenSSL has well-established short forms that
+are fine to use without further qualification: `ctx`, `ptr`,
+`len`, `buf`, `cert`, `key`, `pkey`, `ret`, `tmp`, and similar.
+Use these in preference to longer forms; do not coin a new
+variant when one of these already covers the meaning. Use the
+suffix `_count` for a number of items, `_len` for a byte length,
+and `_size` for a size in bytes; do not invent variants like
+`num_X`, `X_length`, or `X_bytes` when one of these already
+applies.
+
+A variable that mirrors notation from a standard, RFC, paper,
+or other authoritative specification being implemented may use
+whatever name the spec uses (for example, `n`, `e`, `d` for RSA
+parameters, or `salt` and `info` for HKDF). Document the spec
+citation and which variables come from it in the function or
+file doxygen comment; see [Doxygen comments](#doxygen-comments)
+for the form.
+
+Outside spec-mirroring, single letters are appropriate only as
+loop counters (`i`, `j`, `k`).
+
+For functions, OpenSSL names follow a `PREFIX_[OBJECT_]action()`
+shape: an uppercase subsystem prefix; then, where the function
+operates on a particular object or context, that object -- usually
+the uppercase or mixed-case type name; then the action, in
+lowercase with underscores. Where the prefix already identifies
+the object, or the function is a general subsystem utility, there
+is no separate object element.
+Examples: `EVP_KDF_CTX_get0_kdf` (prefix `EVP`, object `KDF_CTX`,
+action `get0_kdf`), `EVP_PKEY_sign`, `OSSL_CMP_validate_msg`,
+`SSL_CTX_set_verify`; and, with no object element, `BIO_eof` and
+`CRYPTO_malloc`.
+
+This shape is aspirational and describes the direction for new
+code. Much of the existing API predates it and carries years of
+naming baggage, so it does not uniformly conform. Do not rename
+existing public functions to fit it -- that breaks the API.
+
+Public (API) functions use the uppercase subsystem prefix.
+Internal functions use the lowercase `ossl_` prefix unless they
+are static (i.e., local to the source file); static functions
+need no prefix.
+
+Functions that return a pointer disclose ownership of the
+returned value via a `0` or `1` suffix on the name:
+
+- `get0_X()` returns a non-owning pointer.
+- `get1_X()` returns an owning pointer; the caller is the new
+  owner, of either a fresh allocation or an up-ref.
+
+The same convention applies in reverse for setters and
+pushers that take a pointer:
+
+- `set0_X(obj, p)` and `push0_X(coll, p)` transfer ownership
+  of `p` to `obj` or `coll`.
+- `set1_X(obj, p)` and `push1_X(coll, p)` leave ownership
+  with the caller; the callee stores a copy or up-ref.
+
+Use these forms rather than a bare `get_` / `set_` / `push_`
+whenever a pointer crosses the API boundary.
+
+A function extended from an existing form takes an `_ex`
+suffix (`_ex2` for a second extension, `_ex3` for a third,
+and so on). See [Extending existing functions](#extending-existing-functions)
+for when to add an extended form and how to handle the
+parameter list.
+
+### Typedefs
+
+OpenSSL uses typedefs extensively. Struct typedefs are named in
+`ALL_CAPS_WITH_UNDERSCORES`, with a subsystem prefix, and the
+underlying struct tag is the lowercase form of the typedef name
+suffixed `_st`:
+
+```c
+typedef struct evp_pkey_st EVP_PKEY;
+```
+
+For more examples, look in `<openssl/types.h>`.
+
+When a typedef'd enum is used (see [Structs and typedefs](#structs-and-typedefs)
+below for the policy on enums), the enum type name is lowercase
+and the values are uppercase.
+
+Function-pointer and callback typedefs use one of two
+suffixes:
+
+- `_cb` for typedefs that are user-supplied callbacks
+  (`X509_STORE_CTX_verify_cb`, `pem_password_cb`).
+- `_fn` for function pointers in an internal interface or
+  dispatch table (`OSSL_provider_init_fn`,
+  `X509_STORE_CTX_verify_fn`).
+
+When introducing a new type, consider that a bare or generic
+name may collide with system or third-party headers; OpenSSL
+has historically used unprefixed names like `X509` and these
+now collide with Windows headers in places. Prefix new type
+names (for example `EVP_PKEY`, `OSSL_PARAM`) to avoid this.
+
+### Macros and enum labels
+
+Macros and labels in enums should be named in
+`ALL_CAPS_WITH_UNDERSCORES`. This convention helps distinguish
+macros from functions and variables.
+
+```c
+#define OPENSSL_MAGIC_FOO 0x12345
+```
+
+Error reason codes follow a `SUBSYSTEM_R_REASON` pattern,
+where `_R_` is the infix marking the macro as an error reason:
+`X509_R_INVALID_TRUST`, `SSL_R_NO_SHARED_CIPHER`,
+`ERR_R_MALLOC_FAILURE`.
+
+Feature-disable macros follow `OPENSSL_NO_<FEATURE>` -- for
+example, `OPENSSL_NO_SOCK` (no socket support),
+`OPENSSL_NO_RSA` (no RSA), `OPENSSL_NO_DEPRECATED_<MAJOR>_<MINOR>`
+(no APIs deprecated as of that version). When defined, the
+corresponding feature's headers and implementations are
+conditionally compiled out.
+
+Comments
+--------
+
+This section describes the form and style of code comments.
+[DOCUMENTATION.md](DOCUMENTATION.md) is the companion document that
+describes the policy: when a comment is required, the *trivial*
+exception, and the per-field commenting requirement on structures.
+
+Use the classic `/* ... */` comment markers. Do not use `// ...`
+markers.
+
+Comments should describe *what* the code does and *why*. Do not
+parrot the effect of each statement; well-written code is its own
+description of *how*. As the complexity of the code increases, the
+size and detail of comments should also increase. Err in favour of
+more comments rather than fewer: code that is *obvious* to you
+today will not necessarily be obvious to someone else two years
+later.
+
+### Multi-line comment blocks
+
+The preferred style for long (multi-line) comments is:
+
+```c
+/*-
+ * This is the preferred style for multi-line
+ * comments in the OpenSSL source code.
+ * Please use it consistently.
+ *
+ * Description:  A column of asterisks on the left side,
+ * with beginning and ending almost-blank lines.
+ */
+```
+
+Both `/*-` and `/**` are recognised by the `CommentPragmas` setting
+in [`.clang-format`](.clang-format) and cause the block to be left
+exactly as written. Use `/*-` for plain prose comments whose layout
+you want to preserve, and `/**` for doxygen blocks (see below).
+
+### TODO and FIXME markers
+
+Use `/* TODO: <short description> */` to mark work that should be
+done later. Use `/* FIXME: <short description> */` to mark a known
+incorrectness, hack, or workaround that needs to be addressed. If
+a marker is worth adding, the underlying work is worth tracking:
+ensure a GitHub issue is opened for it and include the issue's
+full URL in the marker (e.g., `/* TODO: <short description>
+(https://github.com/openssl/openssl/issues/1234) */`). Use the URL
+form because OpenSSL has issue trackers in multiple repositories.
+
+### Doxygen comments
+
+OpenSSL code uses doxygen-style comments on functions, data
+structures, and macros to make the source easier to navigate and to
+translate into reference documentation. The internal-function,
+struct-field, and other in-source documentation requirements set out
+in [DOCUMENTATION.md](DOCUMENTATION.md) must be satisfied with
+doxygen-style comments using the conventions described below.
+
+Use the `@` form of doxygen markers (`@brief`, `@param`, `@returns`,
+`@file`, `@def`, `@struct`, and so on). Do not use the `\` form
+(`\brief`, `\param`, etc.).
+
+For the full set of recognised tags and their semantics, see the
+Doxygen manual: the [commands list](https://www.doxygen.nl/manual/commands.html)
+is the practical reference for what you can write inside a doxygen
+block; the chapter on
+[documenting the code](https://www.doxygen.nl/manual/docblocks.html)
+explains the block forms and where comments attach.
+
+The following sample illustrates the convention:
+
+```c
+/**
+ * @file doxysample.c
+ * This is a brief file description that you may add.
+ * Subsequent lines contain more detailed information about what you
+ * will find defined in this file.  It is not currently required that
+ * you add a file description, but it is available if you like.
+ */
+
+/**
+ * @def MAX(x, y)
+ * Document a macro that returns the maximum of two inputs.
+ * @param x integer input value
+ * @param y integer input value
+ * @returns the maximum of x and y
+ */
+#define MAX(x, y) ((x) > (y) ? (x) : (y))
+
+/**
+ * @struct foo_st
+ * @brief Description of the foo_st struct.
+ * Optional more detailed description here.
+ */
+typedef struct foo_st {
+    int a; /**< Describe the a field here */
+    char b; /**< Describe the b field here */
+} FOO;
+
+/**
+ * @brief Describe the function ossl_add briefly.
+ * Add a more detailed description here, like sums two inputs and
+ * returns the result.
+ * @param a input integer to add
+ * @param b input integer to add
+ * @returns the sum of a and b
+ */
+int ossl_add(int a, int b);
+```
+
+#### Spec-mirroring variables
+
+When a function uses variable names taken from a specification
+(see [Functions and variables](#functions-and-variables) in the
+Naming section), the doxygen block cites the spec and identifies
+each spec-derived variable:
+
+```c
+/**
+ * @brief Transmogrify Calvin into Hobbes per RFC 31337 section 1.2.3.
+ *
+ * Variable naming follows the spec:
+ * - Calvin: input to be transmogrified
+ * - Hobbes: transmogrified output (caller-allocated)
+ *
+ * @param Calvin pointer to the input bytes to transmogrify
+ * @param Calvin_len the number of bytes available at Calvin
+ * @param Hobbes pointer to the caller-allocated output buffer
+ * @param Hobbes_len the number of bytes available at Hobbes
+ * @returns 1 on success, 0 on failure
+ * @see https://www.example.org/rfc/rfc31337.html#section-1.2.3
+ * @see https://calvinandhobbes.fandom.com/wiki/Transmogrifier
+ */
+int ossl_transmogrify(const uint8_t *Calvin, size_t Calvin_len,
+    uint8_t *Hobbes, size_t Hobbes_len);
+```
+
+#### Public functions: link the manual page
+
+Every public function declaration in a public header must carry a
+doxygen block that includes an `@see` referencing the function's
+manual page in the standard `name(3)` form. This in-source comment
+is a navigation aid; the canonical reference documentation lives in
+the POD file under `doc/man3/` (see [DOCUMENTATION.md](DOCUMENTATION.md)).
+
+The cross-reference is to the function name, not the POD file
+name; the build emits a man-page entry per function name, so
+`man X509_verify_cert` resolves regardless of which POD file
+currently documents it.
+
+```c
+/**
+ * @brief One-line summary of what the function does.
+ * @see X509_verify_cert(3)
+ */
+int X509_verify_cert(X509_STORE_CTX *ctx);
+```
+
+Additional `@see` entries may be added for any manual page a caller
+needs in order to use the function correctly, such as pages
+documenting argument types, the flag families that affect the
+function's behaviour, or closely related functions. List them
+comma-separated on a single `@see`, matching the form used in POD's
+`SEE ALSO` section:
+
+```c
+/**
+ * @brief One-line summary of what the function does.
+ * @see X509_verify_cert(3), X509_STORE_CTX_new(3),
+ *      X509_VERIFY_PARAM_set_flags(3)
+ */
+int X509_verify_cert(X509_STORE_CTX *ctx);
+```
+
+The doxygen comment should not duplicate the POD content. Two
+copies of "what this function does" inevitably diverge; the POD is
+the source of truth. Keep the doxygen block to a short summary and
+the `@see` references.
+
+Structs and typedefs
+--------------------
+
+See [Typedefs](#typedefs) under Naming for naming conventions.
+
+Typedef'd enums are used much less often than struct typedefs;
+consider not using a typedef for an enum at all. A typedef'd
+enum hides the integer-ness of the type from the caller, which
+makes the implementation-defined underlying type easier to
+forget.
+
+Enum arguments to public functions are not permitted. C's `enum`
+underlying type is implementation-defined, and adding values to
+an enum can change its ABI; use `int` and document the allowed
+values instead.
+
+OpenSSL has historically made all struct definitions public, which
+caused problems with maintaining binary compatibility and adding
+features. New structs are opaque and expose only pointers in the
+API; the struct definition is placed in a local header file that
+is not exported. Legacy structs that are still part of the public
+ABI are exempt; do not add new public struct definitions.
+
+In practice, the opaque pattern is to forward-declare the typedef
+in the public header (`typedef struct foo_st FOO;`, with no struct
+body) and place the `struct foo_st { ... };` definition in a local
+header that is not exported. Callers see only the pointer type.
+
+Bitfield layout is implementation-defined and varies across
+compilers and ABIs. Where that layout is observable -- in structs
+that are part of the public ABI or that mirror a wire or file
+format -- avoid bitfields and use explicit shifts and masks on a
+regular integer instead.
+
+Flexible array members (C99 trailing `[]`) are permitted and
+preferred over the older `[1]` "struct hack" for variable-length
+trailing data. Remember that `sizeof(struct)` does not include the
+flexible member; allocate the trailing data explicitly when the
+struct is created.
+
+C99 designated initializers (`{ .field = value }`) are encouraged
+for struct initialisation, particularly where they make the field
+assignments self-documenting.
+
+A trailing comma in an initializer list is a layout hint to
+`clang-format`: with it the list is kept one element per line;
+without it the formatter may pack the list onto fewer lines.
+Most of the time you do not want a trailing comma; omit it
+unless you specifically want to lock the one-per-line layout
+(for example, in a multi-row table of values).
+
+Integers
+--------
+
+Prefer explicitly-sized integers over generic C ones where the
+size matters. To represent a byte use `uint8_t`, not
+`unsigned char`; for a two-byte field, `uint16_t` rather than
+`unsigned short`.
+
+Avoid `long` and `long long` specifically. `long` is 32 bits on
+64-bit Windows and 64 bits on 64-bit Linux; using it for "at
+least 32 bits" produces code that works inconsistently across
+platforms. Use `int32_t`, `int64_t`, `size_t`, or another
+`<stdint.h>` type as appropriate.
+
+Sizes are `size_t`. When converting to or from `int` for legacy
+reasons, check for overflow and underflow.
+
+Add an integer literal suffix when the literal participates in a
+shift or appears in an expression involving a wider type --
+without a suffix the literal is `int`. Use `U` for unsigned
+semantics (`1U << 31`) and the `UINT8_C` through `UINT64_C`
+macros from `<stdint.h>` for explicit widths (`UINT32_C(1) << 31`,
+`UINT64_C(1) << 63`). Avoid `UL` and `ULL`, for the same reason
+as `long` / `long long`: their widths vary by platform.
+
+Bit shifts should be performed on unsigned operands.
+Left-shifting a signed value is undefined behaviour when the
+operand is negative or when the result reaches the sign bit;
+right-shifting a signed negative value is implementation-defined.
+Combined with the literal-suffix rule above, shifts of constants
+typically take the form `UINT32_C(1) << n` or `(uint32_t)x << n`.
+
+In structs that are retained across the lifetime of a connection,
+new integer fields whose value range is known should use a smaller
+integer type (`uint8_t`, `uint16_t`) where doing so is
+straightforward. This reduces per-connection memory in server
+processes. Do not make code significantly more complex to achieve
+it, and continue to bounds-check at the struct boundary.
+
+This narrowing should not propagate to local variables or function
+parameters; those use the conventional integer types so callers
+are not forced to deal with narrow types.
+
+Do not retroactively narrow existing integer fields in legacy
+structs; this risks ABI breakage.
+
+When doing arithmetic, account for overflow.
+
+Use `int` with `0` / `1` for boolean values, both in public API
+and internal code. Do not introduce `<stdbool.h>` for new code;
+the public API convention is `int`, and using `bool` internally
+just to convert to `int` at the API boundary adds friction
+without enough benefit.
+
+Except in platform-specific code, do not use `ssize_t`; MSVC lacks
+it. Use `size_t` and signal errors out-of-band (see
+[Return values in new code](#return-values-in-new-code)).
+
+Preprocessor directives
+-----------------------
+
+Headers use traditional include guards in the `#if defined()`
+form rather than `#pragma once`, which is non-standard:
+
+```c
+#if !defined(OPENSSL_FOO_H)
+#define OPENSSL_FOO_H
+
+/* ... header contents ... */
+
+#endif /* defined(OPENSSL_FOO_H) */
+```
+
+Prefer `#if defined(FOO)` and `#if !defined(FOO)` to `#ifdef` and
+`#ifndef`. This allows logical operations when conditional
+compilation is dependent on more than one variable, without
+nesting multiple blocks.
+
+All `#endif` blocks must have a comment matching their `#if`:
+
+```c
+#if defined(OPENSSL_LINUX) && (!defined(OPENSSL_NO_HOOBLA) || !defined(OPENSSL_BULA))
+...
+#endif /* defined(OPENSSL_LINUX) && (!defined(OPENSSL_NO_HOOBLA) || !defined(OPENSSL_BULA)) */
+```
+
+Minimise the footprint of conditional compilation in source
+code: the more conditional code is concentrated and confined,
+the easier the unconditional flow is to read.
+
+Concentrate conditional compilation rather than dispersing it.
+Do not duplicate the same OS-dispatch ladder across the
+codebase:
+
+```c
+#if defined(OPENSSL_OS_FOO) || defined(OPENSSL_OS_BAR)
+    stuff the way foo or bar does it;
+#elif defined(OPENSSL_OS_BLAH) || defined(OPENSSL_OS_WOOF)
+    stuff the way blah or woof does it;
+#endif /* defined(OPENSSL_OS_FOO) || defined(OPENSSL_OS_BAR) */
+```
+
+For OS-dependent code in particular, put the directives inside
+a single function that wraps the OS-dependent work, so callers
+see a clean interface. When the OS-dependent implementations
+are large, put them in separate files (`stuff_foo.c`,
+`stuff_blah.c`) implementing a common function and select the
+appropriate file via the build process; this lets non-mainstream
+platforms add an implementation file without patching shared
+code.
+
+When a feature can be compiled out, prefer to provide a no-op
+stub implementation of its functions in the disabled case
+rather than wrapping every call site in `#if`. Callers then
+invoke the functions unconditionally and the compiler discards
+the stubs:
+
+```c
+#if defined(OPENSSL_NO_FOO)
+static ossl_inline int ossl_foo_init(void) { return 1; }
+static ossl_inline void ossl_foo_cleanup(void) { }
+#else
+int ossl_foo_init(void);
+void ossl_foo_cleanup(void);
+#endif /* defined(OPENSSL_NO_FOO) */
+```
+
+Macros and enums
+----------------
+
+**Just use a function, not a macro.** OpenSSL has historically
+used macros heavily to avoid function-call overhead, but modern
+compilers inline well; the trade-offs that justified that pattern
+no longer apply. Where a macro is genuinely unavoidable, the
+rules below apply.
+
+For the naming convention used for macros and enum labels, see the
+[Macros and enum labels](#macros-and-enum-labels) subsection of
+Naming above.
+
+Enums are preferred when defining several related constants.
+Enum arguments to public functions are not permitted, because
+C's `enum` underlying type is implementation-defined and adding
+values can change ABI; see
+[Structs and typedefs](#structs-and-typedefs) for the rule and
+the canonical alternative (use `int` and document the allowed
+values).
+
+Where the constants need a fixed underlying width (for ABI or
+wire-format reasons), use `#define` or `static const` with an
+explicit-width type from `<stdint.h>` instead, since enum width
+is implementation-defined.
+
+### Avoid complex macros
+
+Avoid complex or clever macros: they are hard to read, debug, and
+maintain. Do not nest macros calling other macros.
+
+### Avoid function-like macros
+
+Prefer functions over function-like macros. Do not optimise for
+function-call overhead without first measuring with a function
+implementation; if the function is hot enough to need inlining,
+mark it `ossl_inline` rather than converting it to a macro.
+
+### Macro parenthesisation
+
+Always parenthesise arguments in function-like macros to prevent
+operator-precedence issues during expansion. Enclose the entire
+macro definition in parentheses if it expands to an expression, so
+the expansion evaluates correctly inside larger expressions. For
+example:
+
+```c
+#define BOB(blah) ((blah) + 42 - 23)
+```
+
+### Multi-statement macros
+
+Enclose multi-statement macros in a `do { } while (0)` block. Do
+not include a semicolon at the end, and do not use bare braces
+(which fail when followed by `else`). For example:
+
+```c
+/* This is bad. */
+#define KERMIT(x) muppet((x)); frog((x)); green((x))
+if (something)
+    KERMIT(bob);
+else /* This now breaks. */
+
+/* This is also bad, because now you have to omit the semicolon. */
+#define KERMIT(x) { muppet((x)); frog((x)); green((x)) }
+if (something)
+    KERMIT(bob)  /* No semicolon. */
+else
+
+/* This works. */
+#define KERMIT(x) do { muppet((x)); frog((x)); green((x)) } while (0)
+if (something)
+    KERMIT(bob);
+else
+
+/*
+ * But just use a function -- now we know that x is an integer that
+ * has something to do with frogginess and we gain some type safety.
+ */
+static void kermit(int frogginess)
+{
+    muppet(frogginess);
+    frog(frogginess);
+    green(frogginess);
+}
+if (something)
+    kermit(bob);
+else
+```
+
+### Do not include files as multi-line macros
+
+Do not put code in a file and include it inline:
+
+```c
+    ...
+    printf("Yolo\n");
+#include "./abagfullofcode.inc"
+    printf("That was fun\n");
+    ...
+```
+
+Either make a function out of the code and call it, or put the code
+in place.
+
+### Be careful with macro arguments that have side effects
+
+Be careful when writing a function-like macro that could be called
+with arguments that have side effects. Because a macro may expand an
+argument more than once, a side-effecting argument (`n++`, a function
+call, a volatile access) can then be evaluated more than once, with
+unexpected results:
+
+```c
+#define SQUARE(x) ((x) * (x))
+
+int n = 1;
+int result = SQUARE(n++); /* expands to ((n++) * (n++)) -- evaluates twice */
+```
+
+Where it can reasonably be avoided, prefer a form that expands each
+argument exactly once -- a function, or an `ossl_inline` function
+for a fixed type. If there is any doubt that your function-like
+macro could be called with arguments that have side effects, treat
+that as a sign to follow the advice in
+[Avoid function-like macros](#avoid-function-like-macros) and make
+it a real function. Some macros cannot avoid it: a type-generic macro
+such as `MAX` must name each operand and so evaluates it more than
+once. When that is unavoidable, say so at the definition and avoid
+passing side-effecting expressions at the call site.
+
+### Avoid macros that depend on magic names
+
+Do not write macros that rely on a particular variable name being
+in scope at the call site:
+
+```c
+#define FOO(val) bar(index, (val)) /* requires `index' to exist */
+```
+
+This is confusing to the reader and prone to breakage from
+seemingly innocent changes.
+
+### Avoid macros that expand to l-values
+
+Do not write a macro that expands to something assignable:
+
+```c
+#define FIELD(p) (((struct foo *)(p))->field)
+
+FIELD(x) = y; /* legal C, but the macro hides the assignment */
+```
+
+Use an accessor function or expose the field directly through a
+typed pointer.
+
+### Avoid macros that affect control flow
+
+Do not write macros that `return`, `goto`, `break`, or `continue`
+out of their expansion. Such macros hide control flow from a
+reader at the call site, who sees what looks like a function
+call but which may exit the surrounding function or jump out of
+a loop:
+
+```c
+#define RETURN_IF_NULL(p) do { if ((p) == NULL) return -1; } while (0)
+
+int ossl_frobnicate(void *p)
+{
+    RETURN_IF_NULL(p); /* may return from ossl_frobnicate() -- not visible at the call site */
+    /* ... */
+}
+```
+
+### Avoid `#` and `##` in new code
+
+The stringification (`#`) and token-pasting (`##`) operators are
+forbidden in new code. Existing macros that use them (notably the
+`DECLARE_*` and `IMPLEMENT_*` macro families) are not retroactively
+changed; new code should achieve the same effect through
+functions.
+
+### Use variadic macros sparingly
+
+Variadic macros (`__VA_ARGS__`) are permitted but should be used
+sparingly: prefer a function or a small set of helper functions
+where possible. They are harder to reason about and debug than
+functions, and the rules around zero variadic arguments and
+`__VA_ARGS__` forwarding are subtle.
+
+Functions
+---------
+
+A function should do one thing and be short enough that a
+reader can hold its behaviour in their head while reading it.
+Length follows from complexity, not the other way around: a
+long but flat function (for example, a single switch dispatching
+to many cases) is fine; a short function with three levels of
+nested control flow is not.
+
+When complexity grows, factor out helpers with descriptive
+names. A large number of local variables is a signal that this
+factoring is overdue; consider splitting before reaching for a
+comment to explain the variables. Performance-critical helpers
+can be marked `inline`; see
+[Avoid function-like macros](#avoid-function-like-macros) for
+why this is preferable to a macro.
+
+In function prototypes, include parameter names alongside their
+types. C does not require this, but it carries useful information
+for the reader; the name in the prototype should match the name
+in the definition.
+
+### Functions with no arguments
+
+A function that takes no arguments must declare so explicitly
+with `void` in its parameter list: `int f(void);`, not
+`int f();`. The latter declares the parameter list as
+unspecified and prevents the compiler from checking calls.
+
+### Internal linkage
+
+Functions that are local to a single source file are declared
+`static`. Static functions need no `ossl_` prefix (see
+[Naming](#functions-and-variables) above) and do not appear in
+the symbol table of the resulting object file.
+
+### Parameter ordering
+
+In OpenSSL's API style, a context parameter (an `SSL_CTX *`,
+`EVP_PKEY_CTX *`, `OSSL_LIB_CTX *`, or similar) is the first
+parameter. The order of the remaining parameters is at the
+function's discretion but should be consistent with similar
+functions in the same subsystem.
+
+### `const`-correctness
+
+Pointer parameters that are not modified by the function should
+be declared `const`; likewise, pointer return values that the
+caller must not modify should be declared `const`. The
+return-side rule pairs with the `get0_X()` ownership convention:
+a non-owning pointer is typically a read-only view, while an
+owning pointer returned by `get1_X()` is non-`const` because the
+caller controls it. The `const` qualifier documents the contract,
+allows callers to pass or receive `const`-qualified data without
+casts, and lets the compiler catch accidental modification.
+
+### Return values in legacy code
+
+Historically, functions in OpenSSL can return values of many different
+kinds, and one of the most common is a value indicating whether the
+function succeeded or failed. Usually this is:
+
+- `1`: success
+- `0`: failure
+
+Other patterns appear in legacy code:
+
+- `-1` indicates a serious error (internal error or memory
+  allocation failure), and in some subsystems (BIO, SSL, etc.)
+  means "should retry"
+- `>= 1` indicates success with the value carrying additional
+  information; `<= 0` indicates failure with the value indicating
+  the reason
+
+Functions that return a computed value (not a success/failure
+indicator) are exempt.
+
+**Read the existing return-value contract carefully before
+modifying legacy code.** OpenSSL's legacy return-value
+conventions are not uniform -- a function may use values,
+overloadings, or semantics outside the patterns above -- and
+bugs have been introduced into OpenSSL when contributors
+assumed a function followed a familiar pattern when it did not.
+The contract is part of the API, not just a stylistic choice.
+
+### Return values in new code
+
+For new code, functions should return `int` with `1` on success
+and `0` on error. Do not overload the return value to both
+signal success/failure and output an integer. For example:
+
+```c
+/**
+ * @brief ossl_snuffle_thingamabob snuffles a thingamabob from bytes of input.
+ * If a valid thingamabob is snuffled, the result is stored in
+ * *out_thingamabob. On failure a snuffling error code is stored
+ * in *out_err.
+ * @param input pointer to the bytes to snuffle
+ * @param input_len the number of bytes available to snuffle from input
+ * @param out_err pointer to an integer to store an error code
+ * @param out_thingamabob pointer to a thingamabob to store the output
+ * @returns 1 if a thingamabob was snuffled and stored, 0 otherwise.
+ */
+int ossl_snuffle_thingamabob(const uint8_t *input, size_t input_len,
+    int *out_err, thingamabob *out_thingamabob);
+```
+
+If a function outputs a single pointer and no other values,
+return the pointer directly, with `NULL` on error.
+
+### Checking function arguments
+
+A public function must verify that its arguments are sensible
+and return its documented failure value if they are not.
+Typical checks include:
+
+- non-optional pointer arguments are not NULL;
+- numeric arguments are within their expected ranges.
+
+Public-API callers are outside the OpenSSL development envelope.
+The contract cannot be enforced through code review, so a NULL
+non-optional pointer or an out-of-range integer is a possibility
+that must be handled defensively at the boundary. Failing with a
+documented error code on the error stack is preferable to a
+SIGSEGV in the calling application's process.
+
+For NULL pointer arguments, the canonical pattern is:
+
+```c
+if (arg == NULL) {
+    ERR_raise(ERR_LIB_<lib>, ERR_R_PASSED_NULL_PARAMETER);
+    return 0;
+}
+```
+
+Use the function's documented failure value in place of `0`
+where it differs (`NULL` for pointer-returning functions, `-1`
+for functions that may return `-1`, and so on).
+
+Internal functions must not repeat these checks. Their callers
+are us; the contract is enforceable in code review, and a NULL
+or out-of-range argument is a programmer error of the same
+character as the impossibilities discussed under
+[Assertions](#assertions). A runtime check at an internal call
+site is dead on any correct execution, and the untested branch
+is itself attack surface. Use `assert()` instead where you want
+to document an internal invariant.
+
+### Extending existing functions
+
+When an existing public function needs additional parameters,
+keep the original and add a new function with the same name plus
+an `_ex` suffix (`RAND_bytes_ex` extends `RAND_bytes`). Further
+extensions use `_ex2`, `_ex3`, and so on.
+
+The extended function preserves the existing parameters in their
+existing order. New parameters may be inserted at any position
+(they do not have to be at the end); parameters that are no
+longer needed may be removed.
+
+### Centralised exiting of functions
+
+When a function exits from multiple locations and some common
+work (such as cleanup) has to be done at every exit, use `goto`
+to a single exit label. Return directly when there is no cleanup
+to do. The rationale:
+
+- a single exit point is easier to read and follow;
+- it reduces excessive control structures and nesting;
+- it avoids errors caused by failing to update multiple exit
+  points when the code changes;
+- it lets the compiler avoid emitting redundant cleanup code.
+
+For example:
+
+```c
+int ossl_do_thing(const uint8_t *in, size_t in_len)
+{
+    int ret = 0;
+    uint8_t *buf = OPENSSL_malloc(in_len);
+
+    if (buf == NULL)
+        return 0;
+
+    if (!ossl_step1(in, in_len, buf))
+        goto out;
+    if (!ossl_step2(buf, in_len))
+        goto out;
+
+    ret = 1;
+out:
+    OPENSSL_free(buf);
+    return ret;
+}
+```
+
+Error reporting
+---------------
+
+OpenSSL surfaces errors through a per-thread error stack; see
+`ERR_raise(3)` for the calls and `include/openssl/err.h` for the
+available reason codes. This section describes the conventions
+for using them.
+
+Raise at the leaf. The function that detects the failure pushes
+the error; intermediate wrappers that propagate the failure
+value must not re-raise. Re-raising on each frame floods the
+stack with duplicates and obscures the originating condition.
+
+Use the `ERR_LIB_<subsystem>` corresponding to the function's
+home directory (`ERR_LIB_X509` in code under `crypto/x509/`, and
+so on). Use a cross-library reason (`ERR_R_PASSED_NULL_PARAMETER`,
+`ERR_R_MALLOC_FAILURE`, `ERR_R_INTERNAL_ERROR`, and others) for
+portable failure modes; use a `SUBSYSTEM_R_REASON`
+(`X509_R_INVALID_TRUST`, etc.) for domain-specific ones.
+
+Do not call `ERR_clear_error` at function entry; the error stack
+belongs to the caller, who may have pushed errors before
+invoking you that they intend to inspect.
+
+Use `ERR_set_mark` / `ERR_pop_to_mark` to suppress error-stack
+pollution from operations expected to fail sometimes (a
+speculative parse, a capability probe), leaving earlier errors
+intact.
+
+Allocating memory
+-----------------
+
+Use the `OPENSSL_malloc` family for general allocation; see
+`OPENSSL_malloc(3)` for the full set of calls. Do not mix these
+with the C standard library's `malloc()` / `free()` family;
+allocations made with one set must be released with the matching
+set, and OpenSSL can be built with custom allocator hooks that
+the C library does not know about.
+
+For arrays, use `OPENSSL_malloc_array()` and
+`OPENSSL_realloc_array()`, which take the element size and
+element count separately and check for integer overflow.
+
+Memory holding sensitive material (key bytes, plaintext,
+internal state of cryptographic primitives) must be cleansed
+before release. `OPENSSL_clear_free()` combines cleansing and
+freeing; `OPENSSL_cleanse()` wipes without freeing. For
+long-lived sensitive data, use the `OPENSSL_secure_malloc()`
+family (`OPENSSL_secure_malloc(3)`), which allocates from a
+separate non-pageable secure heap, and release with
+`OPENSSL_secure_clear_free()`.
+
+An API that owns internal state requires both an initialisation
+function to set it up and a completion function to release it.
+This is the standard constructor/destructor pair for opaque
+types; see [Structs and typedefs](#structs-and-typedefs).
+
+Processor-specific code
+-----------------------
+
+The only reason for processor-specific code in OpenSSL is
+performance. Every processor-specific path must have a
+platform-neutral pure-C implementation as a fallback, because
+not every target architecture or build configuration enables
+the processor-specific path. OpenSSL selects between
+implementations at runtime via the CPU-capability detection in
+`OPENSSL_cpuid_setup` and the `OPENSSL_*` capability flags;
+processor-specific code must integrate with this dispatch.
+
+Cryptographic primitives operating on secret data must execute
+in time independent of those secrets. Avoid secret-dependent
+branches, secret-indexed memory accesses, and variable-time
+arithmetic (such as variable-time multiplication or division)
+on words derived from secrets. Hand-coded asm is sometimes used
+specifically to force a particular sequence of constant-time
+operations that a compiler might otherwise rewrite.
+
+Short processor-specific operations are typically written as
+inline assembly. Use a `static inline` function when the asm
+constraints permit it. When the asm requires a compile-time
+constant operand (an `i` constraint), use a statement-expression
+macro instead, because a function parameter does not satisfy the
+immediate-constant constraint. When `asm()` has side effects the
+compiler cannot see, mark it `volatile`; do not mark `volatile`
+unnecessarily as that limits optimisation.
+
+When writing a single inline assembly statement containing
+multiple instructions, put each instruction on a separate line
+in a separate quoted string, and end each string except the
+last with `\n\t` to properly indent the next instruction in the
+assembly output:
+
+```c
+asm("magic %reg1, #42\n\t"
+    "more_magic %reg2, %reg3"
+    : /* outputs */ : /* inputs */ : /* clobbers */);
+```
+
+Large, non-trivial assembly functions go in pure assembly
+modules, with corresponding C prototypes. The preferred way to
+generate these is *perlasm*: a Perl script that generates a
+`.s` file. Perlasm allows symbolic names for variables
+(registers and stack-allocated locals) that are independent of
+the specific assembler, and supports multiple ABIs and
+assemblers from a single source by adhering to its coding
+rules. See `crypto/perlasm/x86_64-xlate.pl` for an example.
+
+Compiler intrinsics are permitted but used sparingly. They are
+appropriate for self-contained SIMD acceleration where the
+intrinsic vocabulary is well-supported across our target
+compilers and the code does not need to span multiple ABIs --
+`crypto/evp/enc_b64_avx2.c` (AVX2 base64) is an example.
+Intrinsics are not appropriate for cryptographic primitives
+where constant-time execution is required (the compiler may
+reorder, branch, or otherwise alter the timing), or where an
+existing perlasm implementation already covers the multi-ABI
+case.
+
+Assertions
+----------
+
+Assertions check programmer errors -- invariants, preconditions, and
+postconditions that must hold in any correctly-functioning build.
+They are not for runtime conditions such as allocation failure, I/O
+errors, or malformed input from callers; those are errors the
+surrounding code must handle and propagate.
+
+OpenSSL provides three assertion forms, which differ in their
+behaviour depending on whether `NDEBUG` is defined (release) or not
+(debug):
+
+| Form | Failure (debug) | Failure (release) | Success |
+|---|---|---|---|
+| `assert(e)` | abort | `e` not evaluated | no effect |
+| `ossl_assert(e)` | abort | returns 0 | returns 1 |
+| `OPENSSL_assert(e)` | abort | abort | no effect |
+
+Choosing between these forms is a trade-off, not a default. Each
+form pays a cost somewhere:
+
+- `OPENSSL_assert()` terminates the host process when an invariant
+  fails, which is hostile to applications that link against
+  OpenSSL.
+- `ossl_assert()` returns failure in release builds so the host
+  process survives, but the caller must then handle a failure for
+  a condition that, by definition, cannot occur in correct code.
+  That handling code is dead on any correct execution and cannot
+  be exercised by ordinary tests; untested branches accumulate
+  their own bugs and become part of the attack surface.
+- `assert()` is silently dropped in release builds, so an invariant
+  violation in production passes through to downstream code that
+  may then operate on inconsistent state.
+
+Use `ossl_assert()` when the surrounding function already returns
+success/failure and the recovery path collapses naturally into the
+function's existing error path: push an internal error and return
+the function's failure value. The recovery code is then colocated
+with tested error handling and is not a structurally new branch:
+
+```c
+if (!ossl_assert(invariant_holds)) {
+    ERR_raise(ERR_LIB_..., ERR_R_INTERNAL_ERROR);
+    return 0;
+}
+```
+
+Use `assert()` for impossible cases in internal code -- typically
+`switch` defaults, unreachable branches in helpers, and invariants
+local to a function whose contract makes the violation strictly
+impossible. The release-build behaviour ("do nothing") is the
+right choice here, because the alternative is untested recovery
+code for a case that cannot occur, and that code is itself a
+hazard. The assertion expression must be free of side effects,
+because `assert()` does not evaluate it in release builds.
+
+Use `OPENSSL_assert()` only when continued execution would be more
+dangerous than termination -- typically when global library state
+is irrecoverably corrupted -- or in applications, test programs,
+and fuzzers where termination on a failed check is desired.
+`OPENSSL_assert()` aborts in all builds, including production.
diff --git a/deps/openssl/openssl/VERSION.dat b/deps/openssl/openssl/VERSION.dat
index 5a9d96f9a63..b4d468b383e 100644
--- a/deps/openssl/openssl/VERSION.dat
+++ b/deps/openssl/openssl/VERSION.dat
@@ -1,7 +1,7 @@
-MAJOR=3
-MINOR=5
-PATCH=9
+MAJOR=4
+MINOR=1
+PATCH=0
 PRE_RELEASE_TAG=
 BUILD_METADATA=
-RELEASE_DATE="29 Sep 2026"
-SHLIB_VERSION=3
+RELEASE_DATE="23 Oct 2026"
+SHLIB_VERSION=4
diff --git a/deps/openssl/openssl/VMS/VMSify-conf.pl b/deps/openssl/openssl/VMS/VMSify-conf.pl
index a3844e505c2..231ef7d36d1 100644
--- a/deps/openssl/openssl/VMS/VMSify-conf.pl
+++ b/deps/openssl/openssl/VMS/VMSify-conf.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -10,7 +10,7 @@
 use strict;
 use warnings;

-my @directory_vars = ( "dir", "certs", "crl_dir", "new_certs_dir" );
+my @directory_vars = ( "dir", "certs", "new_certs_dir" );
 my @file_vars = ( "database", "certificate", "serial", "crlnumber",
 		  "crl", "private_key", "RANDFILE" );
 while(<STDIN>) {
diff --git a/deps/openssl/openssl/VMS/openssl_utils.com.in b/deps/openssl/openssl/VMS/openssl_utils.com.in
index 900d0462c5a..4369711a214 100644
--- a/deps/openssl/openssl/VMS/openssl_utils.com.in
+++ b/deps/openssl/openssl/VMS/openssl_utils.com.in
@@ -5,10 +5,3 @@ $	v    := {- sprintf "%02d", split(/\./, $config{version}) -}
 $
 $	OPENSSL'v'	:== $OSSL$EXE:OPENSSL'v'
 $	OPENSSL		:== $OSSL$EXE:OPENSSL'v'
-$
-$	IF F$TYPE(PERL) .EQS. "STRING"
-$	THEN
-$	    C_REHASH	:== 'PERL' OSSL$EXE:c_rehash.pl
-$	ELSE
-$	    WRITE SYS$ERROR "NOTE: no perl => no C_REHASH"
-$	ENDIF
diff --git a/deps/openssl/openssl/apps/asn1parse.c b/deps/openssl/openssl/apps/asn1parse.c
index fbd9d7c3349..3f8623edafa 100644
--- a/deps/openssl/openssl/apps/asn1parse.c
+++ b/deps/openssl/openssl/apps/asn1parse.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -82,8 +82,9 @@ int asn1parse_main(int argc, char **argv)
     const unsigned char *ctmpbuf;
     int indent = 0, noout = 0, dump = 0, informat = FORMAT_PEM;
     int offset = 0, ret = 1, i, j;
-    long num, tmplen;
-    unsigned char *tmpbuf;
+    long num;
+    size_t tmplen;
+    const unsigned char *tmpbuf;
     unsigned int length = 0;
     OPTION_CHOICE o;
     const ASN1_ITEM *it = NULL;
@@ -192,7 +193,7 @@ int asn1parse_main(int argc, char **argv)
         goto end;
     if (genconf == NULL && genstr == NULL && informat == FORMAT_PEM) {
         if (PEM_read_bio(in, &name, &header, &str, &num) != 1) {
-            BIO_printf(bio_err, "Error reading PEM file\n");
+            BIO_puts(bio_err, "Error reading PEM file\n");
             ERR_print_errors(bio_err);
             goto end;
         }
@@ -241,12 +242,12 @@ int asn1parse_main(int argc, char **argv)

     if (sk_OPENSSL_STRING_num(osk)) {
         tmpbuf = str;
-        tmplen = num;
+        tmplen = (size_t)num;
         for (i = 0; i < sk_OPENSSL_STRING_num(osk); i++) {
             ASN1_TYPE *atmp;
             int typ;
             j = strtol(sk_OPENSSL_STRING_value(osk, i), NULL, 0);
-            if (j <= 0 || j >= tmplen) {
+            if (j <= 0 || (size_t)j >= tmplen) {
                 BIO_printf(bio_err, "'%s' is out of range\n",
                     sk_OPENSSL_STRING_value(osk, i));
                 continue;
@@ -255,10 +256,10 @@ int asn1parse_main(int argc, char **argv)
             tmplen -= j;
             atmp = at;
             ctmpbuf = tmpbuf;
-            at = d2i_ASN1_TYPE(NULL, &ctmpbuf, tmplen);
+            at = d2i_ASN1_TYPE(NULL, &ctmpbuf, (long)tmplen);
             ASN1_TYPE_free(atmp);
             if (!at) {
-                BIO_printf(bio_err, "Error parsing structure\n");
+                BIO_puts(bio_err, "Error parsing structure\n");
                 ERR_print_errors(bio_err);
                 goto end;
             }
@@ -271,15 +272,21 @@ int asn1parse_main(int argc, char **argv)
                 goto end;
             }
             /* hmm... this is a little evil but it works */
-            tmpbuf = at->value.asn1_string->data;
-            tmplen = at->value.asn1_string->length;
+            tmpbuf = ASN1_STRING_get0_data(at->value.asn1_string);
+            tmplen = ASN1_STRING_get_length(at->value.asn1_string);
+            if (tmplen > INT_MAX) {
+                BIO_puts(bio_err, "ASN.1 string length exceeds INT_MAX\n");
+                ERR_print_errors(bio_err);
+                goto end;
+            }
         }
-        str = tmpbuf;
-        num = tmplen;
+        /* XXX casts away const */
+        str = (unsigned char *)tmpbuf;
+        num = (int)tmplen;
     }

     if (offset < 0 || offset >= num) {
-        BIO_printf(bio_err, "Error: offset out of range\n");
+        BIO_puts(bio_err, "Error: offset out of range\n");
         goto end;
     }

@@ -289,7 +296,7 @@ int asn1parse_main(int argc, char **argv)
         length = (unsigned int)num;
     if (derout != NULL) {
         if (BIO_write(derout, str + offset, length) != (int)length) {
-            BIO_printf(bio_err, "Error writing output\n");
+            BIO_puts(bio_err, "Error writing output\n");
             ERR_print_errors(bio_err);
             goto end;
         }
diff --git a/deps/openssl/openssl/apps/build.info b/deps/openssl/openssl/apps/build.info
index e9565c45ee6..5b550b836ed 100644
--- a/deps/openssl/openssl/apps/build.info
+++ b/deps/openssl/openssl/apps/build.info
@@ -12,12 +12,13 @@ ENDIF
 # Source for the 'openssl' program
 $OPENSSLSRC=\
         openssl.c \
-        asn1parse.c ca.c ciphers.c crl.c crl2pkcs7.c dgst.c \
+        asn1parse.c ca.c ciphers.c configutl.c crl.c crl2pkcs7.c dgst.c \
         enc.c errstr.c \
         genpkey.c kdf.c mac.c nseq.c passwd.c pkcs7.c \
         pkcs8.c pkey.c pkeyparam.c pkeyutl.c prime.c rand.c req.c \
         s_client.c s_server.c s_time.c sess_id.c skeyutl.c smime.c speed.c \
         spkac.c verify.c version.c x509.c rehash.c storeutl.c \
+        ech.c \
         list.c info.c fipsinstall.c pkcs12.c
 IF[{- !$disabled{'ec'} -}]
   $OPENSSLSRC=$OPENSSLSRC ec.c ecparam.c
@@ -37,9 +38,6 @@ ENDIF
 IF[{- !$disabled{'dsa'} -}]
 $OPENSSLSRC=$OPENSSLSRC dsa.c dsaparam.c gendsa.c
 ENDIF
-IF[{- !$disabled{'engine'} -}]
-$OPENSSLSRC=$OPENSSLSRC engine.c
-ENDIF
 IF[{- !$disabled{'rsa'} -}]
 $OPENSSLSRC=$OPENSSLSRC rsa.c genrsa.c
 ENDIF
diff --git a/deps/openssl/openssl/apps/ca.c b/deps/openssl/openssl/apps/ca.c
index 02b00c7c03e..15a8c6c3543 100644
--- a/deps/openssl/openssl/apps/ca.c
+++ b/deps/openssl/openssl/apps/ca.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -25,6 +25,8 @@
 #include <openssl/ocsp.h>
 #include <openssl/pem.h>

+#include <crypto/asn1.h>
+
 #ifndef W_OK
 #ifdef OPENSSL_SYS_VMS
 #include <unistd.h>
@@ -70,7 +72,6 @@
 #define ENV_POLICY "policy"
 #define ENV_EXTENSIONS "x509_extensions"
 #define ENV_CRLEXT "crl_extensions"
-#define ENV_MSIE_HACK "msie_hack"
 #define ENV_NAMEOPT "name_opt"
 #define ENV_CERTOPT "cert_opt"
 #define ENV_EXTCOPY "copy_extensions"
@@ -141,11 +142,9 @@ static void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext);

 static CONF *extfile_conf = NULL;
 static int preserve = 0;
-static int msie_hack = 0;

 typedef enum OPTION_choice {
     OPT_COMMON,
-    OPT_ENGINE,
     OPT_VERBOSE,
     OPT_CONFIG,
     OPT_NAME,
@@ -177,7 +176,6 @@ typedef enum OPTION_choice {
     OPT_PRESERVEDN,
     OPT_NOEMAILDN,
     OPT_GENCRL,
-    OPT_MSIE_HACK,
     OPT_CRL_LASTUPDATE,
     OPT_CRL_NEXTUPDATE,
     OPT_CRLDAYS,
@@ -222,14 +220,9 @@ const OPTIONS ca_options[] = {
     { "dateopt", OPT_DATEOPT, 's', "Datetime format used for printing. (rfc_822/iso_8601). Default is rfc_822." },
     { "notext", OPT_NOTEXT, '-', "Do not print the generated certificate" },
     { "batch", OPT_BATCH, '-', "Don't ask questions" },
-    { "msie_hack", OPT_MSIE_HACK, '-',
-        "msie modifications to handle all Universal Strings" },
     { "ss_cert", OPT_SS_CERT, '<', "File contains a self signed cert to sign" },
     { "spkac", OPT_SPKAC, '<',
         "File contains DN and signed public key and challenge" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif

     OPT_SECTION("Configuration"),
     { "config", OPT_CONFIG, 's', "A config file" },
@@ -263,8 +256,7 @@ const OPTIONS ca_options[] = {
     OPT_SECTION("Signing"),
     { "md", OPT_MD, 's', "Digest to use, such as sha256" },
     { "keyfile", OPT_KEYFILE, 's', "The CA private key" },
-    { "keyform", OPT_KEYFORM, 'f',
-        "Private key file format (ENGINE, other values ignored)" },
+    { "keyform", OPT_KEYFORM, 'f', "Private key file format (DER/PEM)" },
     { "passin", OPT_PASSIN, 's', "Key and cert input file pass phrase source" },
     { "key", OPT_KEY, 's',
         "Key to decrypt the private key or cert files if encrypted. Better use -passin" },
@@ -311,7 +303,6 @@ const OPTIONS ca_options[] = {
 int ca_main(int argc, char **argv)
 {
     CONF *conf = NULL;
-    ENGINE *e = NULL;
     BIGNUM *crlnumber = NULL, *serial = NULL;
     EVP_PKEY *pkey = NULL;
     BIO *in = NULL, *out = NULL, *Sout = NULL;
@@ -417,7 +408,7 @@ int ca_main(int argc, char **argv)
             enddate = opt_arg();
             break;
         case OPT_DAYS:
-            days = atoi(opt_arg());
+            days = opt_int_arg();
             break;
         case OPT_MD:
             dgst = opt_arg();
@@ -486,9 +477,6 @@ int ca_main(int argc, char **argv)
         case OPT_GENCRL:
             gencrl = 1;
             break;
-        case OPT_MSIE_HACK:
-            msie_hack = 1;
-            break;
         case OPT_CRL_LASTUPDATE:
             crl_lastupdate = opt_arg();
             break;
@@ -496,13 +484,16 @@ int ca_main(int argc, char **argv)
             crl_nextupdate = opt_arg();
             break;
         case OPT_CRLDAYS:
-            crldays = atol(opt_arg());
+            if (!opt_long(opt_arg(), &crldays))
+                goto opthelp;
             break;
         case OPT_CRLHOURS:
-            crlhours = atol(opt_arg());
+            if (!opt_long(opt_arg(), &crlhours))
+                goto opthelp;
             break;
         case OPT_CRLSEC:
-            crlsec = atol(opt_arg());
+            if (!opt_long(opt_arg(), &crlsec))
+                goto opthelp;
             break;
         case OPT_INFILES:
             req = 1;
@@ -545,9 +536,6 @@ int ca_main(int argc, char **argv)
             rev_arg = opt_arg();
             rev_type = (o - OPT_CRL_REASON) + REV_CRL_REASON;
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         }
     }

@@ -632,11 +620,11 @@ end_of_options:
     if (passin == NULL) {
         free_passin = 1;
         if (!app_passwd(passinarg, NULL, &passin, NULL)) {
-            BIO_printf(bio_err, "Error getting password\n");
+            BIO_puts(bio_err, "Error getting password\n");
             goto end;
         }
     }
-    pkey = load_key(keyfile, keyformat, 0, passin, e, "CA private key");
+    pkey = load_key(keyfile, keyformat, 0, passin, "CA private key");
     cleanse(passin);
     if (pkey == NULL)
         /* load_key() has already printed an appropriate message */
@@ -654,7 +642,7 @@ end_of_options:
             goto end;

         if (!X509_check_private_key(x509, pkey)) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "CA certificate and CA private key do not match\n");
             goto end;
         }
@@ -665,9 +653,6 @@ end_of_options:
     f = app_conf_try_string(conf, BASE_SECTION, ENV_PRESERVE);
     if (f != NULL && (*f == 'y' || *f == 'Y'))
         preserve = 1;
-    f = app_conf_try_string(conf, BASE_SECTION, ENV_MSIE_HACK);
-    if (f != NULL && (*f == 'y' || *f == 'Y'))
-        msie_hack = 1;

     f = app_conf_try_string(conf, section, ENV_NAMEOPT);
     if (f != NULL) {
@@ -701,7 +686,7 @@ end_of_options:

         outdir = NCONF_get_string(conf, section, ENV_NEW_CERTS_DIR);
         if (outdir == NULL) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "there needs to be defined a directory for new certificate to be placed in\n");
             goto end;
         }
@@ -751,7 +736,7 @@ end_of_options:
             goto end;
         }
         p = pp[DB_serial];
-        j = strlen(p);
+        j = (int)strlen(p);
         if (*p == '-') {
             p++;
             j--;
@@ -774,7 +759,7 @@ end_of_options:
         TXT_DB_write(bio_out, db->db);
         BIO_printf(bio_err, "%d entries loaded from the database\n",
             sk_OPENSSL_PSTRING_num(db->db->data));
-        BIO_printf(bio_err, "generating index\n");
+        BIO_puts(bio_err, "generating index\n");
     }

     if (index_index(db) <= 0)
@@ -788,11 +773,11 @@ end_of_options:

         i = do_updatedb(db, NULL);
         if (i == -1) {
-            BIO_printf(bio_err, "Malloc failure\n");
+            BIO_puts(bio_err, "Malloc failure\n");
             goto end;
         } else if (i == 0) {
             if (verbose)
-                BIO_printf(bio_err, "No entries found to mark expired\n");
+                BIO_puts(bio_err, "No entries found to mark expired\n");
         } else {
             if (!save_index(dbfile, "new", db))
                 goto end;
@@ -889,11 +874,8 @@ end_of_options:
             X509V3_CTX ctx;

             X509V3_set_ctx_test(&ctx);
-            X509V3_set_nconf(&ctx, extfile_conf);
-            if (!X509V3_EXT_add_nconf(extfile_conf, &ctx, extensions, NULL)) {
-                BIO_printf(bio_err,
-                    "Error checking certificate extensions from extfile section %s\n",
-                    extensions);
+            if (!do_EXT_add_nconf(extfile_conf, extfile_conf, &ctx, NULL,
+                    "Error checking certificate extensions from extfile section %s\n", extensions)) {
                 ret = 1;
                 goto end;
             }
@@ -909,11 +891,8 @@ end_of_options:
                 X509V3_CTX ctx;

                 X509V3_set_ctx_test(&ctx);
-                X509V3_set_nconf(&ctx, conf);
-                if (!X509V3_EXT_add_nconf(conf, &ctx, extensions, NULL)) {
-                    BIO_printf(bio_err,
-                        "Error checking certificate extension config section %s\n",
-                        extensions);
+                if (!do_EXT_add_nconf(conf, conf, &ctx, NULL,
+                        "Error checking certificate extension config section %s\n", extensions)) {
                     ret = 1;
                     goto end;
                 }
@@ -929,27 +908,27 @@ end_of_options:
                 days = 0;
         }
         if (enddate == NULL && days == 0) {
-            BIO_printf(bio_err, "cannot lookup how many days to certify for\n");
+            BIO_puts(bio_err, "cannot lookup how many days to certify for\n");
             goto end;
         }
         if (days != 0 && enddate != NULL)
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Warning: -enddate or -not_after option overriding -days option\n");

         if (rand_ser) {
             if ((serial = BN_new()) == NULL || !rand_serial(serial, NULL)) {
-                BIO_printf(bio_err, "error generating serial number\n");
+                BIO_puts(bio_err, "error generating serial number\n");
                 goto end;
             }
         } else {
             serial = load_serial(serialfile, NULL, create_ser, NULL);
             if (serial == NULL) {
-                BIO_printf(bio_err, "error while loading serial number\n");
+                BIO_puts(bio_err, "error while loading serial number\n");
                 goto end;
             }
             if (verbose) {
                 if (BN_is_zero(serial)) {
-                    BIO_printf(bio_err, "next serial number is 00\n");
+                    BIO_puts(bio_err, "next serial number is 00\n");
                 } else {
                     if ((f = BN_bn2hex(serial)) == NULL)
                         goto end;
@@ -965,7 +944,7 @@ end_of_options:
         }

         if ((cert_sk = sk_X509_new_null()) == NULL) {
-            BIO_printf(bio_err, "Memory allocation failure\n");
+            BIO_puts(bio_err, "Memory allocation failure\n");
             goto end;
         }
         if (spkac_file != NULL) {
@@ -979,11 +958,11 @@ end_of_options:
                 goto end;
             if (j > 0) {
                 total_done++;
-                BIO_printf(bio_err, "\n");
+                BIO_puts(bio_err, "\n");
                 if (!BN_add_word(serial, 1))
                     goto end;
                 if (!sk_X509_push(cert_sk, x)) {
-                    BIO_printf(bio_err, "Memory allocation failure\n");
+                    BIO_puts(bio_err, "Memory allocation failure\n");
                     goto end;
                 }
             }
@@ -1000,11 +979,11 @@ end_of_options:
                 goto end;
             if (j > 0) {
                 total_done++;
-                BIO_printf(bio_err, "\n");
+                BIO_puts(bio_err, "\n");
                 if (!BN_add_word(serial, 1))
                     goto end;
                 if (!sk_X509_push(cert_sk, x)) {
-                    BIO_printf(bio_err, "Memory allocation failure\n");
+                    BIO_puts(bio_err, "Memory allocation failure\n");
                     goto end;
                 }
             }
@@ -1020,11 +999,11 @@ end_of_options:
                 goto end;
             if (j > 0) {
                 total_done++;
-                BIO_printf(bio_err, "\n");
+                BIO_puts(bio_err, "\n");
                 if (!BN_add_word(serial, 1))
                     goto end;
                 if (!sk_X509_push(cert_sk, x)) {
-                    BIO_printf(bio_err, "Memory allocation failure\n");
+                    BIO_puts(bio_err, "Memory allocation failure\n");
                     goto end;
                 }
             }
@@ -1041,13 +1020,13 @@ end_of_options:
                 goto end;
             if (j > 0) {
                 total_done++;
-                BIO_printf(bio_err, "\n");
+                BIO_puts(bio_err, "\n");
                 if (!BN_add_word(serial, 1)) {
                     X509_free(x);
                     goto end;
                 }
                 if (!sk_X509_push(cert_sk, x)) {
-                    BIO_printf(bio_err, "Memory allocation failure\n");
+                    BIO_puts(bio_err, "Memory allocation failure\n");
                     X509_free(x);
                     goto end;
                 }
@@ -1066,12 +1045,12 @@ end_of_options:
                 (void)BIO_flush(bio_err);
                 tmp[0] = '\0';
                 if (fgets(tmp, sizeof(tmp), stdin) == NULL) {
-                    BIO_printf(bio_err, "CERTIFICATION CANCELED: I/O error\n");
+                    BIO_puts(bio_err, "CERTIFICATION CANCELED: I/O error\n");
                     ret = 0;
                     goto end;
                 }
                 if (tmp[0] != 'y' && tmp[0] != 'Y') {
-                    BIO_printf(bio_err, "CERTIFICATION CANCELED\n");
+                    BIO_puts(bio_err, "CERTIFICATION CANCELED\n");
                     ret = 0;
                     goto end;
                 }
@@ -1094,26 +1073,26 @@ end_of_options:
 #endif

         if (verbose)
-            BIO_printf(bio_err, "writing new certificates\n");
+            BIO_puts(bio_err, "writing new certificates\n");

         for (i = 0; i < sk_X509_num(cert_sk); i++) {
             BIO *Cout = NULL;
             X509 *xi = sk_X509_value(cert_sk, i);
             const ASN1_INTEGER *serialNumber = X509_get0_serialNumber(xi);
             const unsigned char *psn = ASN1_STRING_get0_data(serialNumber);
-            const int snl = ASN1_STRING_length(serialNumber);
-            const int filen_len = 2 * (snl > 0 ? snl : 1) + sizeof(".pem");
+            const size_t snl = ASN1_STRING_get_length(serialNumber);
+            const size_t filen_len = 2 * (snl > 0 ? snl : 1) + sizeof(".pem");
             char *n = new_cert + outdirlen;

             if (outdirlen + filen_len > PATH_MAX) {
-                BIO_printf(bio_err, "certificate file name too long\n");
+                BIO_puts(bio_err, "certificate file name too long\n");
                 goto end;
             }

             if (snl > 0) {
                 static const char HEX_DIGITS[] = "0123456789ABCDEF";

-                for (j = 0; j < snl; j++, psn++) {
+                for (j = 0; (size_t)j < snl; j++, psn++) {
                     *n++ = HEX_DIGITS[*psn >> 4];
                     *n++ = HEX_DIGITS[*psn & 0x0F];
                 }
@@ -1155,7 +1134,7 @@ end_of_options:
             if (!rotate_index(dbfile, "new", "old"))
                 goto end;

-            BIO_printf(bio_err, "Database updated\n");
+            BIO_puts(bio_err, "Database updated\n");
         }
     }

@@ -1170,10 +1149,8 @@ end_of_options:
             X509V3_CTX ctx;

             X509V3_set_ctx_test(&ctx);
-            X509V3_set_nconf(&ctx, conf);
-            if (!X509V3_EXT_add_nconf(conf, &ctx, crl_ext, NULL)) {
-                BIO_printf(bio_err,
-                    "Error checking CRL extension section %s\n", crl_ext);
+            if (!do_EXT_add_nconf(conf, conf, &ctx, NULL,
+                    "Error checking CRL extension section %s\n", crl_ext)) {
                 ret = 1;
                 goto end;
             }
@@ -1183,7 +1160,7 @@ end_of_options:
         if (crlnumberfile != NULL) {
             if ((crlnumber = load_serial(crlnumberfile, NULL, 0, NULL))
                 == NULL) {
-                BIO_printf(bio_err, "error while loading CRL number\n");
+                BIO_puts(bio_err, "error while loading CRL number\n");
                 goto end;
             }
         }
@@ -1197,13 +1174,13 @@ end_of_options:
                 crlhours = 0;
         }
         if ((crl_nextupdate == NULL) && (crldays == 0) && (crlhours == 0) && (crlsec == 0)) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "cannot lookup how long until the next CRL is issued\n");
             goto end;
         }

         if (verbose)
-            BIO_printf(bio_err, "making CRL\n");
+            BIO_puts(bio_err, "making CRL\n");
         if ((crl = X509_CRL_new_ex(app_get0_libctx(), app_get0_propq())) == NULL)
             goto end;
         if (!X509_CRL_set_issuer_name(crl, X509_get_subject_name(x509)))
@@ -1252,7 +1229,7 @@ end_of_options:

         /* we now have a CRL */
         if (verbose)
-            BIO_printf(bio_err, "signing CRL\n");
+            BIO_puts(bio_err, "signing CRL\n");

         /* Add any extensions asked for */

@@ -1262,12 +1239,11 @@ end_of_options:
             X509V3_set_ctx(&crlctx, x509, NULL, NULL, crl, 0);
             X509V3_set_nconf(&crlctx, conf);

-            if (crl_ext != NULL)
-                if (!X509V3_EXT_CRL_add_nconf(conf, &crlctx, crl_ext, crl)) {
-                    BIO_printf(bio_err,
-                        "Error adding CRL extensions from section %s\n", crl_ext);
-                    goto end;
-                }
+            if (crl_ext != NULL && !X509V3_EXT_CRL_add_nconf(conf, &crlctx, crl_ext, crl)) {
+                BIO_printf(bio_err,
+                    "Error adding CRL extensions from section %s\n", crl_ext);
+                goto end;
+            }
             if (crlnumberfile != NULL) {
                 tmpser = BN_to_ASN1_INTEGER(crlnumber, NULL);
                 if (!tmpser)
@@ -1310,7 +1286,7 @@ end_of_options:
     /*****************************************************************/
     if (dorevoke) {
         if (infile == NULL) {
-            BIO_printf(bio_err, "no input files\n");
+            BIO_puts(bio_err, "no input files\n");
             goto end;
         } else {
             X509 *revcert;
@@ -1332,7 +1308,7 @@ end_of_options:
             if (!rotate_index(dbfile, "new", "old"))
                 goto end;

-            BIO_printf(bio_err, "Database updated\n");
+            BIO_puts(bio_err, "Database updated\n");
         }
     }
     ret = 0;
@@ -1358,7 +1334,6 @@ end:
     X509_CRL_free(crl);
     NCONF_free(conf);
     NCONF_free(extfile_conf);
-    release_engine(e);
     return ret;
 }

@@ -1391,31 +1366,31 @@ static int certify(X509 **xret, const char *infile, int informat,
     if (req == NULL)
         goto end;
     if ((pktmp = X509_REQ_get0_pubkey(req)) == NULL) {
-        BIO_printf(bio_err, "Error unpacking public key\n");
+        BIO_puts(bio_err, "Error unpacking public key\n");
         goto end;
     }
     if (verbose)
         X509_REQ_print_ex(bio_err, req, nameopt, X509_FLAG_COMPAT);

-    BIO_printf(bio_err, "Check that the request matches the signature\n");
+    BIO_puts(bio_err, "Check that the request matches the signature\n");
     ok = 0;

     if (selfsign && !X509_REQ_check_private_key(req, pkey)) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Certificate request and CA private key do not match\n");
         goto end;
     }
     i = do_X509_REQ_verify(req, pktmp, vfyopts);
     if (i < 0) {
-        BIO_printf(bio_err, "Signature verification problems...\n");
+        BIO_puts(bio_err, "Signature verification problems...\n");
         goto end;
     }
     if (i == 0) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Signature did not match the certificate request\n");
         goto end;
     }
-    BIO_printf(bio_err, "Signature ok\n");
+    BIO_puts(bio_err, "Signature ok\n");

     ok = do_body(xret, pkey, x509, dgst, sigopts, policy, db, serial, subj,
         chtype, multirdn, email_dn, startdate, enddate, days, batch,
@@ -1452,24 +1427,24 @@ static int certify_cert(X509 **xret, const char *infile, int certformat,
     if (verbose)
         X509_print(bio_err, template_cert);

-    BIO_printf(bio_err, "Check that the request matches the signature\n");
+    BIO_puts(bio_err, "Check that the request matches the signature\n");

     if ((pktmp = X509_get0_pubkey(template_cert)) == NULL) {
-        BIO_printf(bio_err, "error unpacking public key\n");
+        BIO_puts(bio_err, "error unpacking public key\n");
         goto end;
     }
     i = do_X509_verify(template_cert, pktmp, vfyopts);
     if (i < 0) {
         ok = 0;
-        BIO_printf(bio_err, "Signature verification problems....\n");
+        BIO_puts(bio_err, "Signature verification problems....\n");
         goto end;
     }
     if (i == 0) {
         ok = 0;
-        BIO_printf(bio_err, "Signature did not match the certificate\n");
+        BIO_puts(bio_err, "Signature did not match the certificate\n");
         goto end;
     } else {
-        BIO_printf(bio_err, "Signature ok\n");
+        BIO_puts(bio_err, "Signature ok\n");
     }

     if ((rreq = X509_to_X509_REQ(template_cert, NULL, NULL)) == NULL)
@@ -1498,10 +1473,10 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
     const X509_NAME *name = NULL;
     X509_NAME *CAname = NULL, *subject = NULL;
     const ASN1_TIME *tm;
-    ASN1_STRING *str, *str2;
-    ASN1_OBJECT *obj;
+    const ASN1_STRING *str, *str2;
+    const ASN1_OBJECT *obj;
     X509 *ret = NULL;
-    X509_NAME_ENTRY *ne, *tne;
+    const X509_NAME_ENTRY *ne, *tne;
     EVP_PKEY *pktmp;
     int ok = -1, i, j, last, nid;
     const char *p;
@@ -1517,52 +1492,49 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,

     if (subj) {
         X509_NAME *n = parse_name(subj, chtype, multirdn, "subject");
+        int ok_local;

         if (!n)
             goto end;
-        X509_REQ_set_subject_name(req, n);
+
+        ok_local = X509_REQ_set_subject_name(req, n);
         X509_NAME_free(n);
+        if (ok_local == 0)
+            goto end;
     }

     if (default_op)
-        BIO_printf(bio_err, "The Subject's Distinguished Name is as follows\n");
+        BIO_puts(bio_err, "The Subject's Distinguished Name is as follows\n");

     name = X509_REQ_get_subject_name(req);
     for (i = 0; i < X509_NAME_entry_count(name); i++) {
+        int type;
         ne = X509_NAME_get_entry(name, i);
         str = X509_NAME_ENTRY_get_data(ne);
         obj = X509_NAME_ENTRY_get_object(ne);
         nid = OBJ_obj2nid(obj);
-
-        if (msie_hack) {
-            /* assume all type should be strings */
-
-            if (str->type == V_ASN1_UNIVERSALSTRING)
-                ASN1_UNIVERSALSTRING_to_string(str);
-
-            if (str->type == V_ASN1_IA5STRING && nid != NID_pkcs9_emailAddress)
-                str->type = V_ASN1_T61STRING;
-
-            if (nid == NID_pkcs9_emailAddress
-                && str->type == V_ASN1_PRINTABLESTRING)
-                str->type = V_ASN1_IA5STRING;
-        }
+        type = ASN1_STRING_type(str);

         /* If no EMAIL is wanted in the subject */
         if (nid == NID_pkcs9_emailAddress && !email_dn)
             continue;

         /* check some things */
-        if (nid == NID_pkcs9_emailAddress && str->type != V_ASN1_IA5STRING) {
-            BIO_printf(bio_err,
+        if (nid == NID_pkcs9_emailAddress && type != V_ASN1_IA5STRING) {
+            BIO_puts(bio_err,
                 "\nemailAddress type needs to be of type IA5STRING\n");
             goto end;
         }
-        if (str->type != V_ASN1_BMPSTRING && str->type != V_ASN1_UTF8STRING) {
-            j = ASN1_PRINTABLE_type(str->data, str->length);
-            if ((j == V_ASN1_T61STRING && str->type != V_ASN1_T61STRING) || (j == V_ASN1_IA5STRING && str->type == V_ASN1_PRINTABLESTRING)) {
-                BIO_printf(bio_err,
-                    "\nThe string contains characters that are illegal for the ASN.1 type\n");
+        if (type != V_ASN1_BMPSTRING && type != V_ASN1_UTF8STRING) {
+            size_t tmp = ASN1_STRING_get_length(str);
+            if (tmp > INT_MAX)
+                goto end;
+            j = ASN1_PRINTABLE_type(ASN1_STRING_get0_data(str), (int)tmp);
+            if ((j == V_ASN1_T61STRING && type != V_ASN1_T61STRING)
+                || (j == V_ASN1_IA5STRING && type == V_ASN1_PRINTABLESTRING)) {
+                BIO_puts(bio_err,
+                    "\nThe string contains characters that are illegal for the"
+                    " ASN.1 type\n");
                 goto end;
             }
         }
@@ -1573,7 +1545,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,

     /* Ok, now we check the 'policy' stuff. */
     if ((subject = X509_NAME_new()) == NULL) {
-        BIO_printf(bio_err, "Memory allocation failure\n");
+        BIO_puts(bio_err, "Memory allocation failure\n");
         goto end;
     }

@@ -1598,7 +1570,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,

         last = -1;
         for (;;) {
-            X509_NAME_ENTRY *push = NULL;
+            const X509_NAME_ENTRY *push = NULL;

             /* lookup the object in the supplied name list */
             j = X509_NAME_get_index_by_OBJ(name, obj, last);
@@ -1656,10 +1628,18 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
                 if (j < 0) {
                     BIO_printf(bio_err,
                         "The %s field is different between\n"
-                        "CA certificate (%s) and the request (%s)\n",
-                        cv->name,
-                        ((str2 == NULL) ? "NULL" : (char *)str2->data),
-                        ((str == NULL) ? "NULL" : (char *)str->data));
+                        "CA certificate (",
+                        cv->name);
+                    if (str2 == NULL)
+                        BIO_puts(bio_err, "NULL");
+                    else
+                        ASN1_STRING_print_ex(bio_err, str2, ASN1_STRFLGS_RFC2253);
+                    BIO_puts(bio_err, ") and the request (");
+                    if (str == NULL)
+                        BIO_puts(bio_err, "NULL");
+                    else
+                        ASN1_STRING_print_ex(bio_err, str, ASN1_STRFLGS_RFC2253);
+                    BIO_puts(bio_err, ")\n");
                     goto end;
                 }
             } else {
@@ -1671,7 +1651,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,

             if (push != NULL) {
                 if (!X509_NAME_add_entry(subject, push, -1, 0)) {
-                    BIO_printf(bio_err, "Memory allocation failure\n");
+                    BIO_puts(bio_err, "Memory allocation failure\n");
                     goto end;
                 }
             }
@@ -1690,7 +1670,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,

     /* We are now totally happy, lets make and sign the certificate */
     if (verbose)
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Everything appears to be ok, creating and signing the certificate\n");

     if ((ret = X509_new_ex(app_get0_libctx(), app_get0_propq())) == NULL)
@@ -1734,7 +1714,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
         if (!X509V3_set_issuer_pkey(&ext_ctx, pkey))
             goto end;
         if (!cert_matches_key(ret, pkey))
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Warning: Signature key and public key of cert do not match\n");
     }

@@ -1742,34 +1722,24 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
     if (ext_sect) {
         if (extfile_conf != NULL) {
             if (verbose)
-                BIO_printf(bio_err, "Extra configuration file found\n");
+                BIO_puts(bio_err, "Extra configuration file found\n");

             /* Use the extfile_conf configuration db LHASH */
-            X509V3_set_nconf(&ext_ctx, extfile_conf);
-
             /* Adds exts contained in the configuration file */
-            if (!X509V3_EXT_add_nconf(extfile_conf, &ext_ctx, ext_sect, ret)) {
-                BIO_printf(bio_err,
-                    "Error adding certificate extensions from extfile section %s\n",
-                    ext_sect);
+            if (!do_EXT_add_nconf(extfile_conf, extfile_conf, &ext_ctx, ret,
+                    "Error adding certificate extensions from extfile section %s\n", ext_sect))
                 goto end;
-            }
             if (verbose)
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "Successfully added extensions from file.\n");
         } else if (ext_sect) {
             /* We found extensions to be set from config file */
-            X509V3_set_nconf(&ext_ctx, lconf);
-
-            if (!X509V3_EXT_add_nconf(lconf, &ext_ctx, ext_sect, ret)) {
-                BIO_printf(bio_err,
-                    "Error adding certificate extensions from config section %s\n",
-                    ext_sect);
+            if (!do_EXT_add_nconf(lconf, lconf, &ext_ctx, ret,
+                    "Error adding certificate extensions from config section %s\n", ext_sect))
                 goto end;
-            }

             if (verbose)
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "Successfully added extensions from config\n");
         }
     }
@@ -1777,12 +1747,12 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
     /* Copy extensions from request (if any) */

     if (!copy_extensions(ret, req, ext_copy)) {
-        BIO_printf(bio_err, "ERROR: adding extensions from request\n");
+        BIO_puts(bio_err, "ERROR: adding extensions from request\n");
         goto end;
     }

     if (verbose)
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "The subject name appears to be ok, checking database for clashes\n");

     /* Build the correct Subject if no e-mail is wanted in the subject. */
@@ -1795,7 +1765,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
          * because this retains its structure.
          */
         if ((dn_subject = X509_NAME_dup(subject)) == NULL) {
-            BIO_printf(bio_err, "Memory allocation failure\n");
+            BIO_puts(bio_err, "Memory allocation failure\n");
             goto end;
         }
         i = -1;
@@ -1816,7 +1786,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,

     row[DB_name] = X509_NAME_oneline(X509_get_subject_name(ret), NULL, 0);
     if (row[DB_name] == NULL) {
-        BIO_printf(bio_err, "Memory allocation failure\n");
+        BIO_puts(bio_err, "Memory allocation failure\n");
         goto end;
     }

@@ -1825,7 +1795,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
     else
         row[DB_serial] = BN_bn2hex(serial);
     if (row[DB_serial] == NULL) {
-        BIO_printf(bio_err, "Memory allocation failure\n");
+        BIO_puts(bio_err, "Memory allocation failure\n");
         goto end;
     }

@@ -1838,7 +1808,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
         OPENSSL_free(row[DB_name]);
         row[DB_name] = OPENSSL_strdup(row[DB_serial]);
         if (row[DB_name] == NULL) {
-            BIO_printf(bio_err, "Memory allocation failure\n");
+            BIO_puts(bio_err, "Memory allocation failure\n");
             goto end;
         }
     }
@@ -1859,13 +1829,13 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
             BIO_printf(bio_err,
                 "ERROR:Serial number %s has already been issued,\n",
                 row[DB_serial]);
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "      check the database/serial_file for corruption\n");
         }
     }

     if (rrow != NULL) {
-        BIO_printf(bio_err, "The matching entry has the following details\n");
+        BIO_puts(bio_err, "The matching entry has the following details\n");
         if (rrow[DB_type][0] == DB_TYPE_EXP)
             p = "Expired";
         else if (rrow[DB_type][0] == DB_TYPE_REV)
@@ -1902,7 +1872,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
     }

     if (!default_op) {
-        BIO_printf(bio_err, "Certificate Details:\n");
+        BIO_puts(bio_err, "Certificate Details:\n");
         /*
          * Never print signature details because signature not present
          */
@@ -1910,25 +1880,25 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
         X509_print_ex(bio_err, ret, nameopt, certopt);
     }

-    BIO_printf(bio_err, "Certificate is to be certified until ");
+    BIO_puts(bio_err, "Certificate is to be certified until ");
     ASN1_TIME_print_ex(bio_err, X509_get0_notAfter(ret), dateopt);
     if (days)
         BIO_printf(bio_err, " (%ld days)", days);
-    BIO_printf(bio_err, "\n");
+    BIO_puts(bio_err, "\n");

     if (!batch) {

-        BIO_printf(bio_err, "Sign the certificate? [y/n]:");
+        BIO_puts(bio_err, "Sign the certificate? [y/n]:");
         (void)BIO_flush(bio_err);
         buf[0] = '\0';
         if (fgets(buf, sizeof(buf), stdin) == NULL) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "CERTIFICATE WILL NOT BE CERTIFIED: I/O error\n");
             ok = 0;
             goto end;
         }
         if (!(buf[0] == 'y' || buf[0] == 'Y')) {
-            BIO_printf(bio_err, "CERTIFICATE WILL NOT BE CERTIFIED\n");
+            BIO_puts(bio_err, "CERTIFICATE WILL NOT BE CERTIFIED\n");
             ok = 0;
             goto end;
         }
@@ -1944,25 +1914,26 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
     /* We now just add it to the database as DB_TYPE_VAL('V') */
     row[DB_type] = OPENSSL_strdup("V");
     tm = X509_get0_notAfter(ret);
-    row[DB_exp_date] = app_malloc(tm->length + 1, "row expdate");
-    memcpy(row[DB_exp_date], tm->data, tm->length);
-    row[DB_exp_date][tm->length] = '\0';
+    row[DB_exp_date] = app_malloc(ASN1_STRING_get_length(tm) + 1, "row expdate");
+    memcpy(row[DB_exp_date], ASN1_STRING_get0_data(tm), ASN1_STRING_get_length(tm));
+    row[DB_exp_date][ASN1_STRING_get_length(tm)] = '\0';
     row[DB_rev_date] = NULL;
     row[DB_file] = OPENSSL_strdup("unknown");
     if ((row[DB_type] == NULL) || (row[DB_file] == NULL)
         || (row[DB_name] == NULL)) {
-        BIO_printf(bio_err, "Memory allocation failure\n");
+        BIO_puts(bio_err, "Memory allocation failure\n");
         goto end;
     }

-    irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row space");
+    irow = app_malloc_array(DB_NUMBER + 1, sizeof(*irow), "row space");
     for (i = 0; i < DB_NUMBER; i++)
         irow[i] = row[i];
     irow[DB_NUMBER] = NULL;

     if (!TXT_DB_insert(db->db, irow)) {
-        BIO_printf(bio_err, "failed to update database\n");
-        BIO_printf(bio_err, "TXT_DB error number %ld\n", db->db->error);
+        BIO_printf(bio_err, "failed to update database\n"
+                            "TXT_DB error number %ld\n",
+            db->db->error);
         goto end;
     }
     irow = NULL;
@@ -2049,7 +2020,9 @@ static int certify_spkac(X509 **xret, const char *infile, EVP_PKEY *pkey,
     /*
      * Build up the subject name set.
      */
-    n = X509_REQ_get_subject_name(req);
+    n = X509_NAME_new();
+    if (n == NULL)
+        goto end;

     for (i = 0;; i++) {
         if (sk_CONF_VALUE_num(sk) <= i)
@@ -2073,7 +2046,7 @@ static int certify_spkac(X509 **xret, const char *infile, EVP_PKEY *pkey,
             if (strcmp(type, "SPKAC") == 0) {
                 spki = NETSCAPE_SPKI_b64_decode(cv->value, -1);
                 if (spki == NULL) {
-                    BIO_printf(bio_err,
+                    BIO_puts(bio_err,
                         "unable to load Netscape SPKAC structure\n");
                     goto end;
                 }
@@ -2091,25 +2064,28 @@ static int certify_spkac(X509 **xret, const char *infile, EVP_PKEY *pkey,
         goto end;
     }

+    if (!X509_REQ_set_subject_name(req, n))
+        goto end;
+
     /*
      * Now extract the key from the SPKI structure.
      */

-    BIO_printf(bio_err, "Check that the SPKAC request matches the signature\n");
+    BIO_puts(bio_err, "Check that the SPKAC request matches the signature\n");

     if ((pktmp = NETSCAPE_SPKI_get_pubkey(spki)) == NULL) {
-        BIO_printf(bio_err, "error unpacking SPKAC public key\n");
+        BIO_puts(bio_err, "error unpacking SPKAC public key\n");
         goto end;
     }

     j = NETSCAPE_SPKI_verify(spki, pktmp);
     if (j <= 0) {
         EVP_PKEY_free(pktmp);
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "signature verification failed on SPKAC public key\n");
         goto end;
     }
-    BIO_printf(bio_err, "Signature ok\n");
+    BIO_puts(bio_err, "Signature ok\n");

     X509_REQ_set_pubkey(req, pktmp);
     EVP_PKEY_free(pktmp);
@@ -2119,6 +2095,7 @@ static int certify_spkac(X509 **xret, const char *infile, EVP_PKEY *pkey,
         ext_copy, 0, dateopt);
 end:
     X509_REQ_free(req);
+    X509_NAME_free(n);
     CONF_free(parms);
     NETSCAPE_SPKI_free(spki);
     X509_NAME_ENTRY_free(ne);
@@ -2157,7 +2134,7 @@ static int do_revoke(X509 *x509, CA_DB *db, REVINFO_TYPE rev_type,
         row[DB_name] = OPENSSL_strdup(row[DB_serial]);
     }
     if ((row[DB_name] == NULL) || (row[DB_serial] == NULL)) {
-        BIO_printf(bio_err, "Memory allocation failure\n");
+        BIO_puts(bio_err, "Memory allocation failure\n");
         goto end;
     }
     /*
@@ -2173,25 +2150,26 @@ static int do_revoke(X509 *x509, CA_DB *db, REVINFO_TYPE rev_type,
         /* We now just add it to the database as DB_TYPE_REV('V') */
         row[DB_type] = OPENSSL_strdup("V");
         tm = X509_get0_notAfter(x509);
-        row[DB_exp_date] = app_malloc(tm->length + 1, "row exp_data");
-        memcpy(row[DB_exp_date], tm->data, tm->length);
-        row[DB_exp_date][tm->length] = '\0';
+        row[DB_exp_date] = app_malloc(ASN1_STRING_get_length(tm) + 1, "row exp_data");
+        memcpy(row[DB_exp_date], ASN1_STRING_get0_data(tm), ASN1_STRING_get_length(tm));
+        row[DB_exp_date][ASN1_STRING_get_length(tm)] = '\0';
         row[DB_rev_date] = NULL;
         row[DB_file] = OPENSSL_strdup("unknown");

         if (row[DB_type] == NULL || row[DB_file] == NULL) {
-            BIO_printf(bio_err, "Memory allocation failure\n");
+            BIO_puts(bio_err, "Memory allocation failure\n");
             goto end;
         }

-        irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row ptr");
+        irow = app_malloc_array(DB_NUMBER + 1, sizeof(*irow), "row ptr");
         for (i = 0; i < DB_NUMBER; i++)
             irow[i] = row[i];
         irow[DB_NUMBER] = NULL;

         if (!TXT_DB_insert(db->db, irow)) {
-            BIO_printf(bio_err, "failed to update database\n");
-            BIO_printf(bio_err, "TXT_DB error number %ld\n", db->db->error);
+            BIO_printf(bio_err, "failed to update database\n"
+                                "TXT_DB error number %ld\n",
+                db->db->error);
             OPENSSL_free(irow);
             goto end;
         }
@@ -2223,7 +2201,7 @@ static int do_revoke(X509 *x509, CA_DB *db, REVINFO_TYPE rev_type,
         BIO_printf(bio_err, "Revoking Certificate %s.\n", rrow[DB_serial]);
         rev_str = make_revocation_str(rev_type, value);
         if (!rev_str) {
-            BIO_printf(bio_err, "Error in revocation arguments\n");
+            BIO_puts(bio_err, "Error in revocation arguments\n");
             goto end;
         }
         rrow[DB_type][0] = DB_TYPE_REV;
@@ -2304,7 +2282,7 @@ end:
     return ok;
 }

-int do_updatedb(CA_DB *db, time_t *now)
+int do_updatedb(CA_DB *db, const time_t *now)
 {
     ASN1_TIME *a_tm = NULL;
     int i, cnt = 0;
@@ -2354,7 +2332,7 @@ int do_updatedb(CA_DB *db, time_t *now)
     return cnt;
 }

-static const char *crl_reasons[] = {
+static const char *const crl_reasons[] = {
     /* CRL reason strings */
     "unspecified",
     "keyCompromise",
@@ -2385,7 +2363,7 @@ static char *make_revocation_str(REVINFO_TYPE rev_type, const char *rev_arg)
     const char *reason = NULL, *other = NULL;
     ASN1_OBJECT *otmp;
     ASN1_UTCTIME *revtm = NULL;
-    int i;
+    size_t i;

     switch (rev_type) {
     case REV_NONE:
@@ -2442,7 +2420,7 @@ static char *make_revocation_str(REVINFO_TYPE rev_type, const char *rev_arg)
     if (!revtm)
         return NULL;

-    i = revtm->length + 1;
+    i = ASN1_STRING_get_length(revtm) + 1;

     if (reason)
         i += strlen(reason) + 1;
@@ -2450,7 +2428,8 @@ static char *make_revocation_str(REVINFO_TYPE rev_type, const char *rev_arg)
         i += strlen(other) + 1;

     str = app_malloc(i, "revocation reason");
-    OPENSSL_strlcpy(str, (char *)revtm->data, i);
+    snprintf(str, i, "%.*s", (int)ASN1_STRING_get_length(revtm),
+        (const char *)ASN1_STRING_get0_data(revtm));
     if (reason) {
         OPENSSL_strlcat(str, ",", i);
         OPENSSL_strlcat(str, reason, i);
@@ -2527,40 +2506,41 @@ static int old_entry_print(const ASN1_OBJECT *obj, const ASN1_STRING *str)
 {
     char buf[25], *pbuf;
     const char *p;
-    int j;
+    int i;
+    size_t j;

-    j = i2a_ASN1_OBJECT(bio_err, obj);
+    i = i2a_ASN1_OBJECT(bio_err, obj);
     pbuf = buf;
-    for (j = 22 - j; j > 0; j--)
+    for (i = 22 - i; i > 0; i--)
         *(pbuf++) = ' ';
     *(pbuf++) = ':';
     *(pbuf++) = '\0';
     BIO_puts(bio_err, buf);

-    if (str->type == V_ASN1_PRINTABLESTRING)
-        BIO_printf(bio_err, "PRINTABLE:'");
-    else if (str->type == V_ASN1_T61STRING)
-        BIO_printf(bio_err, "T61STRING:'");
-    else if (str->type == V_ASN1_IA5STRING)
-        BIO_printf(bio_err, "IA5STRING:'");
-    else if (str->type == V_ASN1_UNIVERSALSTRING)
-        BIO_printf(bio_err, "UNIVERSALSTRING:'");
+    if (ASN1_STRING_type(str) == V_ASN1_PRINTABLESTRING)
+        BIO_puts(bio_err, "PRINTABLE:'");
+    else if (ASN1_STRING_type(str) == V_ASN1_T61STRING)
+        BIO_puts(bio_err, "T61STRING:'");
+    else if (ASN1_STRING_type(str) == V_ASN1_IA5STRING)
+        BIO_puts(bio_err, "IA5STRING:'");
+    else if (ASN1_STRING_type(str) == V_ASN1_UNIVERSALSTRING)
+        BIO_puts(bio_err, "UNIVERSALSTRING:'");
     else
-        BIO_printf(bio_err, "ASN.1 %2d:'", str->type);
+        BIO_printf(bio_err, "ASN.1 %2d:'", ASN1_STRING_type(str));

-    p = (const char *)str->data;
-    for (j = str->length; j > 0; j--) {
+    p = (const char *)ASN1_STRING_get0_data(str);
+    for (j = ASN1_STRING_get_length(str); j > 0; j--) {
         if ((*p >= ' ') && (*p <= '~'))
             BIO_printf(bio_err, "%c", *p);
         else if (*p & 0x80)
             BIO_printf(bio_err, "\\0x%02X", *p);
         else if ((unsigned char)*p == 0xf7)
-            BIO_printf(bio_err, "^?");
+            BIO_puts(bio_err, "^?");
         else
             BIO_printf(bio_err, "^%c", *p + '@');
         p++;
     }
-    BIO_printf(bio_err, "'\n");
+    BIO_puts(bio_err, "'\n");
     return 1;
 }

@@ -2577,7 +2557,7 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,

     tmp = OPENSSL_strdup(str);
     if (!tmp) {
-        BIO_printf(bio_err, "memory allocation failure\n");
+        BIO_puts(bio_err, "memory allocation failure\n");
         goto end;
     }

@@ -2599,7 +2579,7 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
     if (prevtm) {
         *prevtm = ASN1_UTCTIME_new();
         if (*prevtm == NULL) {
-            BIO_printf(bio_err, "memory allocation failure\n");
+            BIO_puts(bio_err, "memory allocation failure\n");
             goto end;
         }
         if (!ASN1_UTCTIME_set_string(*prevtm, rtime_str)) {
@@ -2623,7 +2603,7 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
             reason_code = OCSP_REVOKED_STATUS_REMOVEFROMCRL;
         } else if (reason_code == 8) { /* Hold instruction */
             if (!arg_str) {
-                BIO_printf(bio_err, "missing hold instruction\n");
+                BIO_puts(bio_err, "missing hold instruction\n");
                 goto end;
             }
             reason_code = OCSP_REVOKED_STATUS_CERTIFICATEHOLD;
@@ -2639,12 +2619,12 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
                 ASN1_OBJECT_free(hold);
         } else if ((reason_code == 9) || (reason_code == 10)) {
             if (!arg_str) {
-                BIO_printf(bio_err, "missing compromised time\n");
+                BIO_puts(bio_err, "missing compromised time\n");
                 goto end;
             }
             comp_time = ASN1_GENERALIZEDTIME_new();
             if (comp_time == NULL) {
-                BIO_printf(bio_err, "memory allocation failure\n");
+                BIO_puts(bio_err, "memory allocation failure\n");
                 goto end;
             }
             if (!ASN1_GENERALIZEDTIME_set_string(comp_time, arg_str)) {
diff --git a/deps/openssl/openssl/apps/ciphers.c b/deps/openssl/openssl/apps/ciphers.c
index dc52b9f912a..4dbdd41f8af 100644
--- a/deps/openssl/openssl/apps/ciphers.c
+++ b/deps/openssl/openssl/apps/ciphers.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,7 +20,6 @@ typedef enum OPTION_choice {
     OPT_COMMON,
     OPT_STDNAME,
     OPT_CONVERT,
-    OPT_SSL3,
     OPT_TLS1,
     OPT_TLS1_1,
     OPT_TLS1_2,
@@ -48,9 +47,6 @@ const OPTIONS ciphers_options[] = {

     OPT_SECTION("Cipher specification"),
     { "s", OPT_S, '-', "Only supported ciphers" },
-#ifndef OPENSSL_NO_SSL3
-    { "ssl3", OPT_SSL3, '-', "Ciphers compatible with SSL3" },
-#endif
 #ifndef OPENSSL_NO_TLS1
     { "tls1", OPT_TLS1, '-', "Ciphers compatible with TLS1" },
 #endif
@@ -135,10 +131,6 @@ int ciphers_main(int argc, char **argv)
         case OPT_CONVERT:
             convert = opt_arg();
             break;
-        case OPT_SSL3:
-            min_version = SSL3_VERSION;
-            max_version = SSL3_VERSION;
-            break;
         case OPT_TLS1:
             min_version = TLS1_VERSION;
             max_version = TLS1_VERSION;
@@ -207,13 +199,13 @@ int ciphers_main(int argc, char **argv)
 #endif

     if (ciphersuites != NULL && !SSL_CTX_set_ciphersuites(ctx, ciphersuites)) {
-        BIO_printf(bio_err, "Error setting TLSv1.3 ciphersuites\n");
+        BIO_puts(bio_err, "Error setting TLSv1.3 ciphersuites\n");
         goto err;
     }

     if (ciphers != NULL) {
         if (!SSL_CTX_set_cipher_list(ctx, ciphers)) {
-            BIO_printf(bio_err, "Error in cipher list\n");
+            BIO_puts(bio_err, "Error in cipher list\n");
             goto err;
         }
     }
@@ -237,10 +229,10 @@ int ciphers_main(int argc, char **argv)
             if (p == NULL)
                 break;
             if (i != 0)
-                BIO_printf(bio_out, ":");
-            BIO_printf(bio_out, "%s", p);
+                BIO_puts(bio_out, ":");
+            BIO_puts(bio_out, p);
         }
-        BIO_printf(bio_out, "\n");
+        BIO_puts(bio_out, "\n");
     } else {

         for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) {
diff --git a/deps/openssl/openssl/apps/cmp.c b/deps/openssl/openssl/apps/cmp.c
index 2fe7c18669b..f094b7f465c 100644
--- a/deps/openssl/openssl/apps/cmp.c
+++ b/deps/openssl/openssl/apps/cmp.c
@@ -12,8 +12,9 @@
 /* This app is disabled when OPENSSL_NO_CMP is defined. */
 #include "internal/e_os.h"

-#include <string.h>
 #include <ctype.h>
+#include <stdio.h>
+#include <string.h>

 #include "apps.h"
 #include "http_server.h"
@@ -87,6 +88,8 @@ static char *opt_srvcert = NULL;
 static char *opt_expect_sender = NULL;
 static int opt_ignore_keyusage = 0;
 static int opt_unprotected_errors = 0;
+static int opt_nonmatched_error_nonces = 0;
+static int opt_ta_in_ip_extracerts = 0;
 static int opt_no_cache_extracerts = 0;
 static char *opt_srvcertout = NULL;
 static char *opt_extracertsout = NULL;
@@ -160,7 +163,6 @@ static int opt_crlform = FORMAT_ASN1;
 static char *opt_keyform_s = NULL;
 static int opt_keyform = FORMAT_UNDEF;
 static char *opt_otherpass = NULL;
-static char *opt_engine = NULL;

 #if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
 /* TLS connection */
@@ -282,6 +284,8 @@ typedef enum OPTION_choice {
     OPT_EXPECT_SENDER,
     OPT_IGNORE_KEYUSAGE,
     OPT_UNPROTECTED_ERRORS,
+    OPT_NONMATCHED_ERROR_NONCES,
+    OPT_TA_IN_IP_EXTRACERTS,
     OPT_NO_CACHE_EXTRACERTS,
     OPT_SRVCERTOUT,
     OPT_EXTRACERTSOUT,
@@ -309,9 +313,6 @@ typedef enum OPTION_choice {
     OPT_CRLFORM,
     OPT_KEYFORM,
     OPT_OTHERPASS,
-#ifndef OPENSSL_NO_ENGINE
-    OPT_ENGINE,
-#endif
     OPT_PROV_ENUM,
     OPT_R_ENUM,

@@ -474,13 +475,13 @@ const OPTIONS cmp_options[] = {
         "NOTE: -server, -proxy, and -no_proxy not supported due to no-sock/no-http build" },
 #else
     { "server", OPT_SERVER, 's',
-        "[http[s]://]address[:port][/path] of CMP server. Default port 80 or 443." },
+        "[http[s]://]host[:port][/path] of CMP server to use. Default port 80 or 443." },
     { OPT_MORE_STR, 0, 0,
-        "address may be a DNS name or an IP address; path can be overridden by -path" },
+        "host may be a DNS name or an IP address; path can be overridden by -path" },
     { "proxy", OPT_PROXY, 's',
-        "[http[s]://]address[:port][/path] of HTTP(S) proxy to use; path is ignored" },
+        "[http[s]://]host[:port][/path] of HTTP(S) proxy to use; path is ignored" },
     { "no_proxy", OPT_NO_PROXY, 's',
-        "List of addresses of servers not to use HTTP(S) proxy for" },
+        "List of servers not to use HTTP(S) proxy for" },
     { OPT_MORE_STR, 0, 0,
         "Default from environment variable 'no_proxy', else 'NO_PROXY', else none" },
 #endif
@@ -513,6 +514,14 @@ const OPTIONS cmp_options[] = {
         "certificate responses (ip/cp/kup), revocation responses (rp), and PKIConf" },
     { OPT_MORE_STR, 0, 0,
         "WARNING: This setting leads to behavior allowing violation of RFC 9810" },
+    { "nonmatched_error_nonces", OPT_NONMATCHED_ERROR_NONCES, '-',
+        "Accept missing or non-matching transactionID or recipNonce in error messages" },
+    { "ta_in_ip_extracerts", OPT_TA_IN_IP_EXTRACERTS, '-',
+        "Permit using self-issued certificates from the extraCerts in an IP message" },
+    { OPT_MORE_STR, 0, 0,
+        "as trust anchors under conditions defined by 3GPP TS 33.310" },
+    { OPT_MORE_STR, 0, 0,
+        "WARNING: This setting leads to behavior allowing violation of RFC 9810" },
     { "no_cache_extracerts", OPT_NO_CACHE_EXTRACERTS, '-',
         "Do not keep certificates received in the extraCerts CMP message field" },
     { "srvcertout", OPT_SRVCERTOUT, 's',
@@ -530,9 +539,9 @@ const OPTIONS cmp_options[] = {
     { "oldwithnew", OPT_OLDWITHNEW, 's',
         "File to save OldWithNew cert received in genp of type rootCaKeyUpdate" },
     { "crlcert", OPT_CRLCERT, 's',
-        "certificate to request a CRL for in genm of type crlStatusList" },
+        "certificate to take CRL source data from in genm of type crlStatusList" },
     { "oldcrl", OPT_OLDCRL, 's',
-        "CRL to request update for in genm of type crlStatusList" },
+        "CRL to obtain an update for in genm of type crlStatusList" },
     { "crlout", OPT_CRLOUT, 's',
         "File to save new CRL received in genp of type 'crls'" },

@@ -568,16 +577,9 @@ const OPTIONS cmp_options[] = {
         "Format (PEM or DER) to use when saving a certificate to a file. Default PEM" },
     { "crlform", OPT_CRLFORM, 's',
         "Format (PEM or DER) to use when saving a CRL to a file. Default DER" },
-    { "keyform", OPT_KEYFORM, 's',
-        "Format of the key input (ENGINE, other values ignored)" },
+    { "keyform", OPT_KEYFORM, 's', "Format of the key input (DER/PEM/P12)" },
     { "otherpass", OPT_OTHERPASS, 's',
         "Pass phrase source potentially needed for loading certificates of others" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's',
-        "Use crypto engine with given identifier, possibly a hardware device." },
-    { OPT_MORE_STR, 0, 0,
-        "Engines may also be defined in OpenSSL config file engine section." },
-#endif
     OPT_PROV_OPTIONS,
     OPT_R_OPTIONS,

@@ -587,7 +589,7 @@ const OPTIONS cmp_options[] = {
         "NOTE: -tls_used and all other TLS options not supported due to no-sock/no-http build" },
 #else
     { "tls_used", OPT_TLS_USED, '-',
-        "Enable using TLS (also when other TLS options are not set)" },
+        "Require using TLS for HTTP (also when other TLS options are not set)" },
     { "tls_cert", OPT_TLS_CERT, 's',
         "Client's TLS certificate. May include chain to be provided to TLS server" },
     { "tls_key", OPT_TLS_KEY, 's',
@@ -600,7 +602,7 @@ const OPTIONS cmp_options[] = {
         "Trusted certificates to use for verifying the TLS server certificate;" },
     { OPT_MORE_STR, 0, 0, "this implies hostname validation" },
     { "tls_host", OPT_TLS_HOST, 's',
-        "Address to be checked (rather than -server) during TLS hostname validation" },
+        "Host name/address (rather than -server) to verify in TLS server cert" },
 #endif

     OPT_SECTION("Client-side debugging"),
@@ -649,7 +651,7 @@ const OPTIONS cmp_options[] = {
         "Trusted certificates for client authentication" },
     { "srv_untrusted", OPT_SRV_UNTRUSTED, 's',
         "Intermediate certs that may be useful for verifying CMP protection" },
-    { "ref_cert", OPT_RSP_CERT, 's',
+    { "ref_cert", OPT_REF_CERT, 's',
         "Certificate to be expected for rr and any oldCertID in kur messages" },
     { "rsp_cert", OPT_RSP_CERT, 's',
         "Certificate to be returned as mock enrollment result" },
@@ -738,6 +740,8 @@ static varref cmp_vars[] = { /* must be in same order as enumerated above! */
     { &opt_trusted }, { &opt_untrusted }, { &opt_srvcert },
     { &opt_expect_sender },
     { (char **)&opt_ignore_keyusage }, { (char **)&opt_unprotected_errors },
+    { (char **)&opt_nonmatched_error_nonces },
+    { (char **)&opt_ta_in_ip_extracerts },
     { (char **)&opt_no_cache_extracerts },
     { &opt_srvcertout }, { &opt_extracertsout }, { &opt_cacertsout },
     { &opt_oldwithold }, { &opt_newwithnew }, { &opt_newwithold }, { &opt_oldwithnew },
@@ -750,9 +754,6 @@ static varref cmp_vars[] = { /* must be in same order as enumerated above! */

     { &opt_certform_s }, { &opt_crlform_s }, { &opt_keyform_s },
     { &opt_otherpass },
-#ifndef OPENSSL_NO_ENGINE
-    { &opt_engine },
-#endif

 #if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
     { (char **)&opt_tls_used }, { &opt_tls_cert }, { &opt_tls_key },
@@ -838,27 +839,39 @@ static int set_verbosity(int level)
     return 1;
 }

+static EVP_PKEY *load_pubkey_pwd(const char *uri, int format, const char *source, const char *desc)
+{
+    char *pass = get_passwd(source, desc);
+    EVP_PKEY *pkey = load_pubkey(uri, format, 0, pass, desc);
+
+    clear_free(pass);
+    return pkey;
+}
+
 static EVP_PKEY *load_key_pwd(const char *uri, int format,
-    const char *pass, ENGINE *eng, const char *desc)
+    const char *source, const char *desc)
 {
-    char *pass_string = get_passwd(pass, desc);
-    EVP_PKEY *pkey = load_key(uri, format, 0, pass_string, eng, desc);
+    char *pass = get_passwd(source, desc);
+    EVP_PKEY *pkey = load_key(uri, format, 0, pass, desc);

-    clear_free(pass_string);
+    clear_free(pass);
     return pkey;
 }

-static X509 *load_cert_pwd(const char *uri, const char *pass, const char *desc)
+static X509 *load_cert_pwd(const char *uri, const char *source, const char *desc)
 {
-    X509 *cert;
-    char *pass_string = get_passwd(pass, desc);
+    char *pass = get_passwd(source, desc);
+    X509 *cert = load_cert_pass(uri, FORMAT_UNDEF, 0, pass, desc);

-    cert = load_cert_pass(uri, FORMAT_UNDEF, 0, pass_string, desc);
-    clear_free(pass_string);
+    clear_free(pass);
     return cert;
 }

-/* set expected hostname/IP addr and clears the email addr in the given ts */
+/*
+ * Set expected hostname/IP address and clears any email address in the given ts.
+ * If the host is NULL, host name/address verification is disabled.
+ * It is interpreted as an IP address when possible, otherwise as a domain name.
+ */
 static int truststore_set_host_etc(X509_STORE *ts, const char *host)
 {
     X509_VERIFY_PARAM *ts_vpm = X509_STORE_get0_param(ts);
@@ -868,10 +881,14 @@ static int truststore_set_host_etc(X509_STORE *ts, const char *host)
         || !X509_VERIFY_PARAM_set1_ip(ts_vpm, NULL, 0)
         || !X509_VERIFY_PARAM_set1_email(ts_vpm, NULL, 0))
         return 0;
+    if (host == NULL)
+        return 1;
+
     X509_VERIFY_PARAM_set_hostflags(ts_vpm,
         X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT | X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS);
-    return (host != NULL && X509_VERIFY_PARAM_set1_ip_asc(ts_vpm, host))
-        || X509_VERIFY_PARAM_set1_host(ts_vpm, host, 0);
+    return host_is_ip_address(host)
+        ? X509_VERIFY_PARAM_set1_ip_asc(ts_vpm, host)
+        : X509_VERIFY_PARAM_set1_host(ts_vpm, host, 0);
 }

 /* write OSSL_CMP_MSG DER-encoded to the specified file name item */
@@ -884,14 +901,14 @@ static int write_PKIMESSAGE(const OSSL_CMP_MSG *msg, char **filenames)
         return 0;
     }
     if (*filenames == NULL) {
-        CMP_err("not enough file names provided for writing PKIMessage");
-        return 0;
+        CMP_warn("Too few file names provided for writing PKIMessage");
+        return 1;
     }

     file = *filenames;
     *filenames = next_item(file);
     if (OSSL_CMP_MSG_write(file, msg) < 0) {
-        CMP_err1("cannot write PKIMessage to file '%s'", file);
+        CMP_err1("Cannot write PKIMessage to file '%s'", file);
         return 0;
     }
     return 1;
@@ -908,7 +925,7 @@ static OSSL_CMP_MSG *read_PKIMESSAGE(const char *desc, char **filenames)
         return NULL;
     }
     if (*filenames == NULL) {
-        CMP_err("not enough file names provided for reading PKIMessage");
+        CMP_err("Too few file names provided for reading PKIMessage");
         return NULL;
     }

@@ -917,7 +934,7 @@ static OSSL_CMP_MSG *read_PKIMESSAGE(const char *desc, char **filenames)

     ret = OSSL_CMP_MSG_read(file, app_get0_libctx(), app_get0_propq());
     if (ret == NULL)
-        CMP_err1("cannot read PKIMessage from file '%s'", file);
+        CMP_err1("Cannot read PKIMessage from file '%s'", file);
     else
         CMP_info2("%s %s", desc, file);
     return ret;
@@ -939,7 +956,7 @@ static OSSL_CMP_MSG *read_write_req_resp(OSSL_CMP_CTX *ctx,

     if (opt_reqout_only != NULL) {
         if (OSSL_CMP_MSG_write(opt_reqout_only, req) < 0)
-            CMP_err1("cannot write request PKIMessage to file '%s'",
+            CMP_err1("Cannot write request PKIMessage to file '%s'",
                 opt_reqout_only);
         else
             reqout_only_done = 1;
@@ -971,19 +988,20 @@ static OSSL_CMP_MSG *read_write_req_resp(OSSL_CMP_CTX *ctx,
         res = read_PKIMESSAGE("actually using", &opt_rspin);
     } else {
         const OSSL_CMP_MSG *actual_req = req_new != NULL ? req_new : req;
+        const char *const msg = "Too few -rspin filename arguments; resorting to";

         if (opt_use_mock_srv) {
             if (rspin_in_use)
-                CMP_warn("too few -rspin filename arguments; resorting to using mock server");
+                CMP_warn1("%s using mock server", msg);
             res = OSSL_CMP_CTX_server_perform(ctx, actual_req);
         } else {
 #if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
             if (opt_server == NULL) {
-                CMP_err("missing -server or -use_mock_srv option, or too few -rspin filename arguments");
+                CMP_err("Missing -server or -use_mock_srv option, or too few -rspin filename arguments");
                 goto err;
             }
             if (rspin_in_use)
-                CMP_warn("too few -rspin filename arguments; resorting to contacting server");
+                CMP_warn1("%s contacting server", msg);
             res = OSSL_CMP_MSG_http_perform(ctx, actual_req);
 #else
             CMP_err("-server not supported on no-sock/no-http build; missing -use_mock_srv option or too few -rspin filename arguments");
@@ -1031,7 +1049,7 @@ static int set_name(const char *str,
             return 0;
         if (!(*set_fn)(ctx, n)) {
             X509_NAME_free(n);
-            CMP_err("out of memory");
+            CMP_err("Out of memory");
             return 0;
         }
         X509_NAME_free(n);
@@ -1065,12 +1083,12 @@ static int set_gennames(OSSL_CMP_CTX *ctx, char *names, const char *desc)
         (void)ERR_pop_to_mark();

         if (n == NULL) {
-            CMP_err2("bad syntax of %s '%s'", desc, names);
+            CMP_err2("Bad syntax of %s '%s'", desc, names);
             return 0;
         }
         if (!OSSL_CMP_CTX_push1_subjectAltName(ctx, n)) {
             GENERAL_NAME_free(n);
-            CMP_err("out of memory");
+            CMP_err("Out of memory");
             return 0;
         }
         GENERAL_NAME_free(n);
@@ -1112,6 +1130,22 @@ static int setup_cert(void *ctx, const char *file, const char *pass,
     return ok;
 }

+typedef int (*add_X509_fn_srv_t)(OSSL_CMP_SRV_CTX *ctx, X509 *cert);
+static int setup_cert_srv(OSSL_CMP_SRV_CTX *ctx, const char *file, const char *pass,
+    const char *desc, add_X509_fn_srv_t set1_fn)
+{
+    X509 *cert;
+    int ok;
+
+    if (file == NULL)
+        return 1;
+    if ((cert = load_cert_pwd(file, pass, desc)) == NULL)
+        return 0;
+    ok = (*set1_fn)(ctx, cert);
+    X509_free(cert);
+    return ok;
+}
+
 typedef int (*add_X509_stack_fn_t)(void *ctx, const STACK_OF(X509) *certs);
 static int setup_certs(char *files, const char *desc, void *ctx,
     add_X509_stack_fn_t set1_fn)
@@ -1128,6 +1162,22 @@ static int setup_certs(char *files, const char *desc, void *ctx,
     return ok;
 }

+typedef int (*add_X509_stack_fn_srv_t)(OSSL_CMP_SRV_CTX *ctx, STACK_OF(X509) *certs);
+static int setup_certs_srv(char *files, const char *desc, OSSL_CMP_SRV_CTX *ctx,
+    add_X509_stack_fn_srv_t set1_fn)
+{
+    STACK_OF(X509) *certs;
+    int ok;
+
+    if (files == NULL)
+        return 1;
+    if ((certs = load_certs_multifile(files, opt_otherpass, desc, vpm)) == NULL)
+        return 0;
+    ok = (*set1_fn)(ctx, certs);
+    OSSL_STACK_OF_X509_free(certs);
+    return ok;
+}
+
 static int setup_mock_crlout(void *ctx, const char *file, const char *desc)
 {
     X509_CRL *crl;
@@ -1161,23 +1211,19 @@ static int transform_opts(void)
         } else if (!strcmp(opt_cmd_s, "genm")) {
             opt_cmd = CMP_GENM;
         } else {
-            CMP_err1("unknown cmp command '%s'", opt_cmd_s);
+            CMP_err1("Unknown cmp command '%s'", opt_cmd_s);
             return 0;
         }
     } else {
-        CMP_err("no cmp command to execute");
+        CMP_err("No cmp command to execute");
         return 0;
     }

-#ifndef OPENSSL_NO_ENGINE
-#define FORMAT_OPTIONS (OPT_FMT_PEMDER | OPT_FMT_PKCS12 | OPT_FMT_ENGINE)
-#else
 #define FORMAT_OPTIONS (OPT_FMT_PEMDER | OPT_FMT_PKCS12)
-#endif

     if (opt_keyform_s != NULL
         && !opt_format(opt_keyform_s, FORMAT_OPTIONS, &opt_keyform)) {
-        CMP_err("unknown option given for key loading format");
+        CMP_err("Unknown option given for key loading format");
         return 0;
     }

@@ -1185,19 +1231,19 @@ static int transform_opts(void)

     if (opt_certform_s != NULL
         && !opt_format(opt_certform_s, OPT_FMT_PEMDER, &opt_certform)) {
-        CMP_err("unknown option given for certificate storing format");
+        CMP_err("Unknown option given for certificate storing format");
         return 0;
     }
     if (opt_crlform_s != NULL
         && !opt_format(opt_crlform_s, OPT_FMT_PEMDER, &opt_crlform)) {
-        CMP_err("unknown option given for CRL storing format");
+        CMP_err("Unknown option given for CRL storing format");
         return 0;
     }

     return 1;
 }

-static OSSL_CMP_SRV_CTX *setup_srv_ctx(ENGINE *engine)
+static OSSL_CMP_SRV_CTX *setup_srv_ctx(void)
 {
     OSSL_CMP_CTX *ctx; /* extra CMP (client) ctx partly used by server */
     OSSL_CMP_SRV_CTX *srv_ctx = ossl_cmp_mock_srv_new(app_get0_libctx(),
@@ -1210,12 +1256,12 @@ static OSSL_CMP_SRV_CTX *setup_srv_ctx(ENGINE *engine)
     if (opt_srv_ref == NULL) {
         if (opt_srv_cert == NULL) {
             /* opt_srv_cert should determine the sender */
-            CMP_err("must give -srv_ref for mock server if no -srv_cert given");
+            CMP_err("Must give -srv_ref for mock server if no -srv_cert given");
             goto err;
         }
     } else {
         if (!OSSL_CMP_CTX_set1_referenceValue(ctx, (unsigned char *)opt_srv_ref,
-                strlen(opt_srv_ref)))
+                (int)strlen(opt_srv_ref)))
             goto err;
     }

@@ -1226,13 +1272,13 @@ static OSSL_CMP_SRV_CTX *setup_srv_ctx(ENGINE *engine)
         if (pass_str != NULL) {
             cleanse(opt_srv_secret);
             res = OSSL_CMP_CTX_set1_secretValue(ctx, (unsigned char *)pass_str,
-                strlen(pass_str));
+                (int)strlen(pass_str));
             clear_free(pass_str);
             if (res == 0)
                 goto err;
         }
     } else if (opt_srv_cert == NULL) {
-        CMP_err("server credentials (-srv_secret or -srv_cert) must be given if -use_mock_srv or -port is used");
+        CMP_err("Server credentials (-srv_secret or -srv_cert) must be given if -use_mock_srv or -port is used");
         goto err;
     } else {
         CMP_warn("server will not be able to handle PBM-protected requests since -srv_secret is not given");
@@ -1240,7 +1286,7 @@ static OSSL_CMP_SRV_CTX *setup_srv_ctx(ENGINE *engine)

     if (opt_srv_secret == NULL
         && ((opt_srv_cert == NULL) != (opt_srv_key == NULL))) {
-        CMP_err("must give both -srv_cert and -srv_key options or neither");
+        CMP_err("Must give both -srv_cert and -srv_key options or neither");
         goto err;
     }
     if (!setup_cert(ctx, opt_srv_cert, opt_srv_keypass,
@@ -1250,7 +1296,7 @@ static OSSL_CMP_SRV_CTX *setup_srv_ctx(ENGINE *engine)
     if (opt_srv_key != NULL) {
         EVP_PKEY *pkey = load_key_pwd(opt_srv_key, opt_keyform,
             opt_srv_keypass,
-            engine, "private key for mock server cert");
+            "private key for mock server cert");

         if (pkey == NULL || !OSSL_CMP_CTX_set1_pkey(ctx, pkey)) {
             EVP_PKEY_free(pkey);
@@ -1275,21 +1321,21 @@ static OSSL_CMP_SRV_CTX *setup_srv_ctx(ENGINE *engine)
             (add_X509_stack_fn_t)OSSL_CMP_CTX_set1_untrusted))
         goto err;

-    if (!setup_cert(srv_ctx, opt_ref_cert, opt_otherpass,
+    if (!setup_cert_srv(srv_ctx, opt_ref_cert, opt_otherpass,
             "reference cert to be expected by the mock server",
-            (add_X509_fn_t)ossl_cmp_mock_srv_set1_refCert))
+            ossl_cmp_mock_srv_set1_refCert))
         goto err;
     if (opt_rsp_cert == NULL) {
         CMP_warn("no -rsp_cert given for mock server");
     } else {
-        if (!setup_cert(srv_ctx, opt_rsp_cert, opt_rsp_keypass,
+        if (!setup_cert_srv(srv_ctx, opt_rsp_cert, opt_rsp_keypass,
                 "cert the mock server returns on certificate requests",
-                (add_X509_fn_t)ossl_cmp_mock_srv_set1_certOut))
+                ossl_cmp_mock_srv_set1_certOut))
             goto err;
     }
     if (opt_rsp_key != NULL) {
         EVP_PKEY *pkey = load_key_pwd(opt_rsp_key, opt_keyform,
-            opt_rsp_keypass, engine,
+            opt_rsp_keypass,
             "private key for enrollment cert");

         if (pkey == NULL
@@ -1304,22 +1350,22 @@ static OSSL_CMP_SRV_CTX *setup_srv_ctx(ENGINE *engine)
     if (!setup_mock_crlout(srv_ctx, opt_rsp_crl,
             "CRL to be returned by the mock server"))
         goto err;
-    if (!setup_certs(opt_rsp_extracerts,
+    if (!setup_certs_srv(opt_rsp_extracerts,
             "CMP extra certificates for mock server", srv_ctx,
-            (add_X509_stack_fn_t)ossl_cmp_mock_srv_set1_chainOut))
+            ossl_cmp_mock_srv_set1_chainOut))
         goto err;
-    if (!setup_certs(opt_rsp_capubs, "caPubs for mock server", srv_ctx,
-            (add_X509_stack_fn_t)ossl_cmp_mock_srv_set1_caPubsOut))
+    if (!setup_certs_srv(opt_rsp_capubs, "caPubs for mock server", srv_ctx,
+            ossl_cmp_mock_srv_set1_caPubsOut))
         goto err;
-    if (!setup_cert(srv_ctx, opt_rsp_newwithnew, opt_otherpass,
+    if (!setup_cert_srv(srv_ctx, opt_rsp_newwithnew, opt_otherpass,
             "NewWithNew cert the mock server returns in rootCaKeyUpdate",
-            (add_X509_fn_t)ossl_cmp_mock_srv_set1_newWithNew)
-        || !setup_cert(srv_ctx, opt_rsp_newwithold, opt_otherpass,
+            ossl_cmp_mock_srv_set1_newWithNew)
+        || !setup_cert_srv(srv_ctx, opt_rsp_newwithold, opt_otherpass,
             "NewWithOld cert the mock server returns in rootCaKeyUpdate",
-            (add_X509_fn_t)ossl_cmp_mock_srv_set1_newWithOld)
-        || !setup_cert(srv_ctx, opt_rsp_oldwithnew, opt_otherpass,
+            ossl_cmp_mock_srv_set1_newWithOld)
+        || !setup_cert_srv(srv_ctx, opt_rsp_oldwithnew, opt_otherpass,
             "OldWithNew cert the mock server returns in rootCaKeyUpdate",
-            (add_X509_fn_t)ossl_cmp_mock_srv_set1_oldWithNew))
+            ossl_cmp_mock_srv_set1_oldWithNew))
         goto err;
     (void)ossl_cmp_mock_srv_set_pollCount(srv_ctx, opt_poll_count);
     (void)ossl_cmp_mock_srv_set_checkAfterTime(srv_ctx, opt_check_after);
@@ -1409,6 +1455,12 @@ static int setup_verification_ctx(OSSL_CMP_CTX *ctx)

     if (opt_unprotected_errors)
         (void)OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_UNPROTECTED_ERRORS, 1);
+    if (opt_nonmatched_error_nonces)
+        (void)OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_NONMATCHED_ERROR_NONCES, 1);
+    if (opt_ta_in_ip_extracerts) {
+        (void)OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR, 1);
+        CMP_warn("permitting non-authenticated trust anchors in IP extracerts according to 3GPP TS 33.310");
+    }

     if (opt_out_trusted != NULL) { /* for use in OSSL_CMP_certConf_cb() */
         X509_VERIFY_PARAM *out_vpm = NULL;
@@ -1441,8 +1493,7 @@ static int setup_verification_ctx(OSSL_CMP_CTX *ctx)
  * set up ssl_ctx for the OSSL_CMP_CTX based on options from config file/CLI.
  * Returns pointer on success, NULL on error
  */
-static SSL_CTX *setup_ssl_ctx(OSSL_CMP_CTX *ctx, const char *host,
-    ENGINE *engine)
+static SSL_CTX *setup_ssl_ctx(OSSL_CMP_CTX *ctx, const char *host)
 {
     STACK_OF(X509) *untrusted = OSSL_CMP_CTX_get0_untrusted(ctx);
     EVP_PKEY *pkey = NULL;
@@ -1483,7 +1534,7 @@ static SSL_CTX *setup_ssl_ctx(OSSL_CMP_CTX *ctx, const char *host,
          * the chain to be provided with the TLS client cert to the TLS server.
          */
         if (!ok || !SSL_CTX_set0_chain(ssl_ctx, certs)) {
-            CMP_err1("unable to use client TLS certificate file '%s'",
+            CMP_err1("Unable to use client TLS certificate file '%s'",
                 opt_tls_cert);
             OSSL_STACK_OF_X509_free(certs);
             goto err;
@@ -1491,7 +1542,7 @@ static SSL_CTX *setup_ssl_ctx(OSSL_CMP_CTX *ctx, const char *host,
         for (i = 0; i < sk_X509_num(untrusted); i++) {
             cert = sk_X509_value(untrusted, i);
             if (!SSL_CTX_add1_chain_cert(ssl_ctx, cert)) {
-                CMP_err("could not add untrusted cert to TLS client cert chain");
+                CMP_err("Could not add untrusted cert to TLS client cert chain");
                 goto err;
             }
         }
@@ -1510,10 +1561,10 @@ static SSL_CTX *setup_ssl_ctx(OSSL_CMP_CTX *ctx, const char *host,
                         | X509_V_FLAG_PARTIAL_CHAIN
                         | X509_V_FLAG_POLICY_CHECK));
             }
-            CMP_debug("trying to build cert chain for own TLS cert");
+            CMP_debug("Trying to build cert chain for own TLS cert");
             if (SSL_CTX_build_cert_chain(ssl_ctx,
                     SSL_BUILD_CHAIN_FLAG_UNTRUSTED | SSL_BUILD_CHAIN_FLAG_NO_ROOT)) {
-                CMP_debug("success building cert chain for own TLS cert");
+                CMP_debug("Success building cert chain for own TLS cert");
             } else {
                 OSSL_CMP_CTX_print_errors(ctx);
                 CMP_warn("could not build cert chain for own TLS cert");
@@ -1541,13 +1592,13 @@ static SSL_CTX *setup_ssl_ctx(OSSL_CMP_CTX *ctx, const char *host,
             }
             sk_X509_free(tls_extra);
             if (res == 0) {
-                BIO_printf(bio_err, "error: unable to add TLS extra certs\n");
+                BIO_puts(bio_err, "error: unable to add TLS extra certs\n");
                 goto err;
             }
         }

         pkey = load_key_pwd(opt_tls_key, opt_keyform, opt_tls_keypass,
-            engine, "TLS client private key");
+            "TLS client private key");
         cleanse(opt_tls_keypass);
         if (pkey == NULL)
             goto err;
@@ -1565,7 +1616,7 @@ static SSL_CTX *setup_ssl_ctx(OSSL_CMP_CTX *ctx, const char *host,
             goto err;
         }
         if (SSL_CTX_use_PrivateKey(ssl_ctx, pkey) <= 0) {
-            CMP_err1("unable to use TLS client private key '%s'", opt_tls_key);
+            CMP_err1("Unable to use TLS client private key '%s'", opt_tls_key);
             EVP_PKEY_free(pkey);
             pkey = NULL; /* otherwise, for some reason double free! */
             goto err;
@@ -1580,8 +1631,7 @@ static SSL_CTX *setup_ssl_ctx(OSSL_CMP_CTX *ctx, const char *host,
          * If we did this before checking our own TLS cert
          * the expected hostname would mislead the check.
          */
-        if (!truststore_set_host_etc(trust_store,
-                opt_tls_host != NULL ? opt_tls_host : host))
+        if (!truststore_set_host_etc(trust_store, host))
             goto err;
     }
     return ssl_ctx;
@@ -1596,10 +1646,10 @@ err:
  * file/CLI while parsing options and checking their consistency.
  * Returns 1 on success, 0 on error
  */
-static int setup_protection_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
+static int setup_protection_ctx(OSSL_CMP_CTX *ctx)
 {
     if (!opt_unprotected_requests && opt_secret == NULL && opt_key == NULL) {
-        CMP_err("must give -key or -secret unless -unprotected_requests is used");
+        CMP_err("Must give -key or -secret unless -unprotected_requests is used");
         return 0;
     }

@@ -1609,7 +1659,7 @@ static int setup_protection_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
         return 0;
     }
     if (opt_secret == NULL && ((opt_cert == NULL) != (opt_key == NULL))) {
-        CMP_err("must give both -cert and -key options or neither");
+        CMP_err("Must give both -cert and -key options or neither");
         return 0;
     }
     if (opt_secret != NULL) {
@@ -1620,7 +1670,7 @@ static int setup_protection_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
             cleanse(opt_secret);
             res = OSSL_CMP_CTX_set1_secretValue(ctx,
                 (unsigned char *)pass_string,
-                strlen(pass_string));
+                (int)strlen(pass_string));
             clear_free(pass_string);
             if (res == 0)
                 return 0;
@@ -1630,11 +1680,11 @@ static int setup_protection_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
     }
     if (opt_ref != NULL
         && !OSSL_CMP_CTX_set1_referenceValue(ctx, (unsigned char *)opt_ref,
-            strlen(opt_ref)))
+            (int)strlen(opt_ref)))
         return 0;

     if (opt_key != NULL) {
-        EVP_PKEY *pkey = load_key_pwd(opt_key, opt_keyform, opt_keypass, engine,
+        EVP_PKEY *pkey = load_key_pwd(opt_key, opt_keyform, opt_keypass,
             "private key for CMP client certificate");

         if (pkey == NULL || !OSSL_CMP_CTX_set1_pkey(ctx, pkey)) {
@@ -1660,7 +1710,7 @@ static int setup_protection_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
         ok = OSSL_CMP_CTX_set1_cert(ctx, cert);
         X509_free(cert);
         if (!ok) {
-            CMP_err("out of memory");
+            CMP_err("Out of memory");
         } else {
             if (opt_own_trusted != NULL) {
                 own_trusted = load_trusted(opt_own_trusted, 0,
@@ -1689,12 +1739,12 @@ static int setup_protection_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
         int digest = OBJ_ln2nid(opt_digest);

         if (digest == NID_undef) {
-            CMP_err1("digest algorithm name not recognized: '%s'", opt_digest);
+            CMP_err1("Digest algorithm name not recognized: '%s'", opt_digest);
             return 0;
         }
         if (!OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_DIGEST_ALGNID, digest)
             || !OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_OWF_ALGNID, digest)) {
-            CMP_err1("digest algorithm name not supported: '%s'", opt_digest);
+            CMP_err1("Digest algorithm name not supported: '%s'", opt_digest);
             return 0;
         }
     }
@@ -1716,8 +1766,7 @@ static int set_fallback_pubkey(OSSL_CMP_CTX *ctx)
     char *file = opt_reqin, *end = file, bak;
     OSSL_CMP_MSG *req;
     const X509_PUBKEY *pubkey;
-    EVP_PKEY *pkey;
-    EVP_PKEY *pkey1;
+    EVP_PKEY *pkey, *pkey1;
     int res = 0;

     /* temporarily separate first file name in opt_reqin */
@@ -1729,21 +1778,18 @@ static int set_fallback_pubkey(OSSL_CMP_CTX *ctx)
     *end = bak;

     if (req == NULL) {
-        CMP_err1("failed to load ir/cr/kur file '%s' attempting to get fallback public key",
-            file);
+        CMP_err1("Failed to load ir/cr/kur file '%s' attempting to get fallback public key", file);
         return 0;
     }
     if ((pubkey = OSSL_CMP_MSG_get0_certreq_publickey(req)) == NULL
         || (pkey = X509_PUBKEY_get0(pubkey)) == NULL) {
-        CMP_err1("failed to get fallback public key from ir/cr/kur file '%s'",
-            file);
+        CMP_err1("Failed to get fallback public key from ir/cr/kur file '%s'", file);
         goto err;
     }
     pkey1 = EVP_PKEY_dup(pkey);
-    if (pkey == NULL || !OSSL_CMP_CTX_set0_newPkey(ctx, 0 /* priv */, pkey1)) {
+    if (pkey1 == NULL || !OSSL_CMP_CTX_set0_newPkey(ctx, 0 /* priv */, pkey1)) {
         EVP_PKEY_free(pkey1);
-        CMP_err1("failed to get fallback public key obtained from ir/cr/kur file '%s'",
-            file);
+        CMP_err1("Failed to set fallback public key obtained from ir/cr/kur file '%s'", file);
         goto err;
     }
     res = 1;
@@ -1758,7 +1804,7 @@ err:
  * based on options from CLI and/or config file.
  * Returns 1 on success, 0 on error
  */
-static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
+static int setup_request_ctx(OSSL_CMP_CTX *ctx)
 {
     X509_REQ *csr = NULL;
     X509_EXTENSIONS *exts = NULL;
@@ -1774,7 +1820,7 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
     if (opt_cmd == CMP_IR || opt_cmd == CMP_CR || opt_cmd == CMP_KUR) {
         if (opt_reqin == NULL && opt_newkey == NULL && !opt_centralkeygen
             && opt_key == NULL && opt_csr == NULL && opt_oldcert == NULL) {
-            CMP_err("missing -newkey (or -key) to be certified and no -csr, -oldcert, -cert, or -reqin option given, which could provide fallback public key."
+            CMP_err("Missing -newkey (or -key) to be certified and no -csr, -oldcert, -cert, or -reqin option given, which could provide fallback public key."
                     " Neither central key generation is requested.");
             return 0;
         }
@@ -1797,14 +1843,14 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
             && opt_popo != OSSL_CRMF_POPO_NONE
             && opt_popo != OSSL_CRMF_POPO_RAVERIFIED) {
             if (opt_csr != NULL) {
-                CMP_err1("no -newkey option given with private key for POPO, -csr option provides just public key%s",
+                CMP_err1("No -newkey option given with private key for POPO, -csr option provides just public key%s",
                     opt_key == NULL ? "" : ", and -key option superseded by -csr");
                 if (opt_reqin != NULL)
                     CMP_info("since -reqin is used, may use -popo -1 or -popo 0 to disable the needless generation of a POPO");
                 return 0;
             }
             if (opt_key == NULL) {
-                CMP_err("missing -newkey (or -key) option for key to be certified and for POPO");
+                CMP_err("Missing -newkey (or -key) option for key to be certified and for POPO");
                 return 0;
             }
         }
@@ -1860,21 +1906,21 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
         char *ref_cert = opt_oldcert != NULL ? opt_oldcert : opt_cert;

         if (ref_cert == NULL && opt_csr == NULL) {
-            CMP_err("missing -oldcert for certificate to be updated and no -csr given");
+            CMP_err("Missing -oldcert for certificate to be updated and no -csr given");
             return 0;
         }
         if (opt_subject != NULL)
-            CMP_warn2("given -subject '%s' overrides the subject of '%s' for KUR",
+            CMP_warn2("Given -subject '%s' overrides the subject of '%s' for KUR",
                 opt_subject, ref_cert != NULL ? ref_cert : opt_csr);
     }
     if (opt_cmd == CMP_RR) {
         if (opt_issuer == NULL && opt_serial == NULL) {
             if (opt_oldcert == NULL && opt_csr == NULL) {
-                CMP_err("missing -oldcert or -issuer and -serial for certificate to be revoked and no -csr given");
+                CMP_err("Missing -oldcert or -issuer and -serial for certificate to be revoked and no -csr given");
                 return 0;
             }
             if (opt_oldcert != NULL && opt_csr != NULL)
-                CMP_warn("ignoring -csr since certificate to be revoked is given");
+                CMP_warn("Ignoring -csr since certificate to be revoked is given");
         } else {
 #define OSSL_CMP_RR_MSG "since -issuer and -serial is given for command 'rr'"
             if (opt_issuer == NULL || opt_serial == NULL) {
@@ -1890,12 +1936,12 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
             ASN1_INTEGER *sno;

             if ((sno = s2i_ASN1_INTEGER(NULL, opt_serial)) == NULL) {
-                CMP_err1("cannot read serial number: '%s'", opt_serial);
+                CMP_err1("Cannot read serial number: '%s'", opt_serial);
                 return 0;
             }
             if (!OSSL_CMP_CTX_set1_serialNumber(ctx, sno)) {
                 ASN1_INTEGER_free(sno);
-                CMP_err("out of memory");
+                CMP_err("Out of memory");
                 return 0;
             }
             ASN1_INTEGER_free(sno);
@@ -1908,13 +1954,13 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
             CMP_warn("Ignoring -serial for command other than 'rr'");
     }
     if (opt_cmd == CMP_P10CR && opt_csr == NULL) {
-        CMP_err("missing PKCS#10 CSR for p10cr");
+        CMP_err("Missing PKCS#10 CSR for p10cr");
         return 0;
     }

     if (opt_recipient == NULL && opt_srvcert == NULL && opt_issuer == NULL
         && opt_oldcert == NULL && opt_cert == NULL)
-        CMP_warn("missing -recipient, -srvcert, -issuer, -oldcert or -cert; recipient for any requests not covered by -reqin will be set to \"NULL-DN\"");
+        CMP_warn("Missing -recipient, -srvcert, -issuer, -oldcert or -cert; recipient for any requests not covered by -reqin will be set to \"NULL-DN\"");

     if (opt_cmd == CMP_P10CR || opt_cmd == CMP_RR || opt_cmd == CMP_GENM) {
         const char *msg = "option is ignored for 'p10cr', 'rr', and 'genm' commands";
@@ -1927,8 +1973,8 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
             CMP_warn1("-days %s", msg);
         if (opt_popo != OSSL_CRMF_POPO_NONE - 1)
             CMP_warn1("-popo %s", msg);
-        if (opt_out_trusted != NULL)
-            CMP_warn1("-out_trusted %s", msg);
+        if (opt_cmd != CMP_P10CR && opt_out_trusted != NULL)
+            CMP_warn("-out_trusted is ignored for 'rr' and 'genm' commands");
     } else if (opt_newkey != NULL) {
         const char *file = opt_newkey;
         const int format = opt_keyform;
@@ -1939,14 +1985,14 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
         BIO *bio_bak = bio_err;

         bio_err = NULL; /* suppress diagnostics on first try loading key */
-        pkey = load_key_pwd(file, format, pass, engine, desc);
+        pkey = load_key_pwd(file, format, pass, desc);
         bio_err = bio_bak;
         if (pkey == NULL) {
             ERR_clear_error();
             desc = opt_csr == NULL
                 ? "fallback public key for cert to be enrolled"
                 : "public key for checking cert resulting from p10cr";
-            pkey = load_pubkey(file, format, 0, pass, engine, desc);
+            pkey = load_pubkey_pwd(file, format, pass, desc);
             priv = 0;
         }

@@ -1962,14 +2008,13 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
     }

     if (opt_days > 0
-        && !OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_VALIDITY_DAYS,
-            opt_days)) {
-        CMP_err("could not set requested cert validity period");
+        && !OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_VALIDITY_DAYS, opt_days)) {
+        CMP_err("Could not set requested cert validity period");
         return 0;
     }

     if (opt_policies != NULL && opt_policy_oids != NULL) {
-        CMP_err("cannot have policies both via -policies and via -policy_oids");
+        CMP_err("Cannot have policies both via -policies and via -policy_oids");
         return 0;
     }

@@ -1991,14 +2036,12 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
         X509V3_set_nconf(&ext_ctx, conf);
         if (opt_reqexts != NULL
             && !X509V3_EXT_add_nconf_sk(conf, &ext_ctx, opt_reqexts, &exts)) {
-            CMP_err1("cannot load certificate request extension section '%s'",
-                opt_reqexts);
+            CMP_err1("Cannot load certificate request extension section '%s'", opt_reqexts);
             goto exts_err;
         }
         if (opt_policies != NULL
             && !X509V3_EXT_add_nconf_sk(conf, &ext_ctx, opt_policies, &exts)) {
-            CMP_err1("cannot load policy cert request extension section '%s'",
-                opt_policies);
+            CMP_err1("Cannot load policy cert request extension section '%s'", opt_policies);
             goto exts_err;
         }
         OSSL_CMP_CTX_set0_reqExtensions(ctx, exts);
@@ -2007,7 +2050,7 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
     /* After here, must not goto oom/exts_err */

     if (OSSL_CMP_CTX_reqExtensions_have_SAN(ctx) && opt_sans != NULL) {
-        CMP_err("cannot have Subject Alternative Names both via -reqexts and via -sans");
+        CMP_err("Cannot have Subject Alternative Names both via -reqexts and via -sans");
         return 0;
     }
     if (!set_gennames(ctx, opt_sans, "Subject Alternative Name"))
@@ -2045,7 +2088,7 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
         pinfo->policyid = policy;

         if (!OSSL_CMP_CTX_push0_policy(ctx, pinfo)) {
-            CMP_err1("cannot add policy with OID '%s'", opt_policy_oids);
+            CMP_err1("Cannot add policy with OID '%s'", opt_policy_oids);
             POLICYINFO_free(pinfo);
             return 0;
         }
@@ -2054,6 +2097,13 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
     if (opt_popo >= OSSL_CRMF_POPO_NONE)
         (void)OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_POPO_METHOD, opt_popo);

+    if (opt_cmd != CMP_RR) {
+        if (opt_revreason != CRL_REASON_NONE)
+            CMP_warn("-revreason option is ignored for commands other than 'rr'");
+        if (opt_cmd != CMP_KUR && opt_oldcert != NULL)
+            CMP_warn("-oldcert option used only as reference cert");
+    }
+
     if (opt_oldcert != NULL) {
         if (opt_cmd == CMP_GENM) {
             CMP_warn("-oldcert option is ignored for 'genm' command");
@@ -2071,7 +2121,7 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
     return 1;

 oom:
-    CMP_err("out of memory");
+    CMP_err("Out of memory");
 exts_err:
     sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free);
     X509_REQ_free(csr);
@@ -2091,7 +2141,7 @@ static int add_certProfile(OSSL_CMP_CTX *ctx, const char *name)
         return 0;
     if ((utf8string = ASN1_UTF8STRING_new()) == NULL)
         goto err;
-    if (!ASN1_STRING_set(utf8string, name, (int)strlen(name))) {
+    if (!ASN1_STRING_set1_string(utf8string, name)) {
         ASN1_STRING_free(utf8string);
         goto err;
     }
@@ -2166,7 +2216,7 @@ static int handle_opt_geninfo(OSSL_CMP_CTX *ctx)
             else
                 *end++ = '\0';
             if ((text = ASN1_UTF8STRING_new()) == NULL
-                || !ASN1_STRING_set(text, ptr, -1))
+                || !ASN1_STRING_set1_string(text, ptr))
                 goto oom;
             ptr = end;
             ASN1_TYPE_set(type, V_ASN1_UTF8STRING, text);
@@ -2193,7 +2243,7 @@ static int handle_opt_geninfo(OSSL_CMP_CTX *ctx)
     return 1;

 oom:
-    CMP_err("out of memory");
+    CMP_err("Out of memory");
 err:
     ASN1_OBJECT_free(obj);
     ASN1_TYPE_free(type);
@@ -2208,7 +2258,7 @@ err:
  * Prints reason for error to bio_err.
  * Returns 1 on success, 0 on error
  */
-static int setup_client_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
+static int setup_client_ctx(OSSL_CMP_CTX *ctx)
 {
     int ret = 0;
     char *host = NULL, *port = NULL, *path = NULL, *used_path = opt_path;
@@ -2225,26 +2275,25 @@ static int setup_client_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
     if (!opt_use_mock_srv && opt_rspin == NULL) { /* note: -port is not given */
 #if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
         if (opt_server == NULL && opt_reqout_only == NULL) {
-            CMP_err("missing -server or -use_mock_srv or -rspin option");
+            CMP_err("Missing -server or -use_mock_srv or -rspin option");
             goto err;
         }
 #else
-        CMP_err("missing -use_mock_srv or -rspin option; -server option is not supported due to no-sock build");
+        CMP_err("Missing -use_mock_srv or -rspin option; -server option is not supported due to no-sock build");
         goto err;
 #endif
     }
 #if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
     if (opt_server == NULL) {
         if (opt_proxy != NULL)
-            CMP_warn("ignoring -proxy option since -server is not given");
+            CMP_warn("Ignoring -proxy option since -server is not given");
         if (opt_no_proxy != NULL)
-            CMP_warn("ignoring -no_proxy option since -server is not given");
+            CMP_warn("Ignoring -no_proxy option since -server is not given");
         goto set_path;
     }
     if (!OSSL_HTTP_parse_url(opt_server, &use_ssl, NULL /* user */,
-            &host, &port, &portnum,
-            &path, NULL /* q */, NULL /* frag */)) {
-        CMP_err1("cannot parse -server URL: %s", opt_server);
+            &host, &port, &portnum, &path, NULL /* q */, NULL /* frag */)) {
+        CMP_err1("Cannot parse -server URL: %s", opt_server);
         goto err;
     }
     if (use_ssl && !opt_tls_used) {
@@ -2254,7 +2303,7 @@ static int setup_client_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
     if (!OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_USE_TLS, opt_tls_used))
         goto err;

-    BIO_snprintf(server_port, sizeof(server_port), "%s", port);
+    snprintf(server_port, sizeof(server_port), "%s", port);
     if (opt_path == NULL)
         used_path = path;
     if (!OSSL_CMP_CTX_set1_server(ctx, host)
@@ -2264,13 +2313,13 @@ static int setup_client_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
         goto oom;
     if (opt_no_proxy != NULL && !OSSL_CMP_CTX_set1_no_proxy(ctx, opt_no_proxy))
         goto oom;
-    (void)BIO_snprintf(server_buf, sizeof(server_buf), "http%s://%s:%s/%s",
+    (void)snprintf(server_buf, sizeof(server_buf), "http%s://%s:%s/%s",
         opt_tls_used ? "s" : "", host, port,
         *used_path == '/' ? used_path + 1 : used_path);

     proxy_host = OSSL_HTTP_adapt_proxy(opt_proxy, opt_no_proxy, host, use_ssl);
     if (proxy_host != NULL)
-        (void)BIO_snprintf(proxy_buf, sizeof(proxy_buf), " via %s", proxy_host);
+        (void)snprintf(proxy_buf, sizeof(proxy_buf), " via %s", proxy_host);

 set_path:
 #endif
@@ -2290,7 +2339,7 @@ set_path:

         strncat(id_buf, opt_infotype_s, sizeof(id_buf) - strlen(id_buf) - 1);
         if ((opt_infotype = OBJ_sn2nid(id_buf)) == NID_undef) {
-            CMP_err("unknown OID name in -infotype option");
+            CMP_err("Unknown OID name in -infotype option");
             goto err;
         }
     }
@@ -2315,7 +2364,7 @@ set_path:
             CMP_warn1("-keyspec %s", msg);
     } else {
         if (opt_template == NULL)
-            CMP_err("missing -template option for genm with infotype certReqTemplate");
+            CMP_err("Missing -template option for genm with infotype certReqTemplate");
     }

     if (!setup_verification_ctx(ctx))
@@ -2355,10 +2404,10 @@ set_path:
         if (opt_tls_cert != NULL
             || opt_tls_key != NULL || opt_tls_keypass != NULL) {
             if (opt_tls_key == NULL) {
-                CMP_err("missing -tls_key option");
+                CMP_err("Missing -tls_key option");
                 goto err;
             } else if (opt_tls_cert == NULL) {
-                CMP_err("missing -tls_cert option");
+                CMP_err("Missing -tls_cert option");
                 goto err;
             }
         }
@@ -2367,9 +2416,9 @@ set_path:
             goto err;
         APP_HTTP_TLS_INFO_free(OSSL_CMP_CTX_get_http_cb_arg(ctx));
         (void)OSSL_CMP_CTX_set_http_cb_arg(ctx, info);
-        info->ssl_ctx = setup_ssl_ctx(ctx, host, engine);
+        info->ssl_ctx = setup_ssl_ctx(ctx, opt_tls_host != NULL ? opt_tls_host : host);
         info->server = host;
-        host = NULL; /* prevent deallocation */
+        host = NULL; /* ownership has been transferred to info structure */
         if ((info->port = OPENSSL_strdup(server_port)) == NULL)
             goto err;
         /* workaround for callback design flaw, see #17088: */
@@ -2382,10 +2431,10 @@ set_path:
     }
 #endif

-    if (!setup_protection_ctx(ctx, engine))
+    if (!setup_protection_ctx(ctx))
         goto err;

-    if (!setup_request_ctx(ctx, engine))
+    if (!setup_request_ctx(ctx))
         goto err;

     if (!set_name(opt_recipient, OSSL_CMP_CTX_set1_recipient, ctx, "recipient")
@@ -2399,9 +2448,11 @@ set_path:
         goto err;

     /* not printing earlier, to minimize confusion in case setup fails before */
-    if (opt_reqout_only == NULL)
-        CMP_info3("will contact %s%s%s ", server_buf, proxy_buf,
-            opt_rspin == NULL ? "" : " only if -rspin argument gives too few filenames");
+    if (opt_reqout_only != NULL)
+        CMP_info("Will not contact any server");
+    else
+        CMP_info3("Will contact %s%s%s ", server_buf, proxy_buf,
+            opt_rspin == NULL ? "" : " only if -rspin argument does not give enough filenames");

     ret = 1;

@@ -2411,7 +2462,7 @@ err:
     OPENSSL_free(path);
     return ret;
 oom:
-    CMP_err("out of memory");
+    CMP_err("Out of memory");
     goto err;
 }

@@ -2464,14 +2515,13 @@ static int save_free_certs(STACK_OF(X509) *certs,
     if (file == NULL)
         goto end;
     if (certs != NULL)
-        CMP_info3("received %d %s certificate(s), saving to file '%s'",
-            n, desc, file);
+        CMP_info3("Received %d %s certificate(s), saving to file '%s'", n, desc, file);
     if (n > 1 && opt_certform != FORMAT_PEM)
-        CMP_warn("saving more than one certificate in non-PEM format");
+        CMP_warn("Saving more than one certificate in non-PEM format");

     if ((bio = BIO_new(BIO_s_file())) == NULL
         || !BIO_write_filename(bio, (char *)file)) {
-        CMP_err3("could not open file '%s' for %s %s certificate(s)",
+        CMP_err3("Could not open file '%s' for %s %s certificate(s)",
             file, certs == NULL ? "deleting" : "writing", desc);
         n = -1;
         goto end;
@@ -2479,7 +2529,7 @@ static int save_free_certs(STACK_OF(X509) *certs,

     for (i = 0; i < n; i++) {
         if (!write_cert(bio, sk_X509_value(certs, i))) {
-            CMP_err2("cannot write %s certificate to file '%s'", desc, file);
+            CMP_err2("Cannot write %s certificate to file '%s'", desc, file);
             n = -1;
             goto end;
         }
@@ -2500,17 +2550,16 @@ static int save_crl(X509_CRL *crl,
     if (file == NULL)
         return 1;
     if (crl != NULL)
-        CMP_info2("received %s, saving to file '%s'", desc, file);
+        CMP_info2("Received %s, saving to file '%s'", desc, file);

     if ((bio = BIO_new(BIO_s_file())) == NULL
         || !BIO_write_filename(bio, (char *)file)) {
-        CMP_err2("could not open file '%s' for writing %s",
-            file, desc);
+        CMP_err2("Could not open file '%s' for writing %s", file, desc);
         goto end;
     }

     if (!write_crl(bio, crl)) {
-        CMP_err2("cannot write %s to file '%s'", desc, file);
+        CMP_err2("Cannot write %s to file '%s'", desc, file);
         goto end;
     }
     res = 1;
@@ -2540,7 +2589,7 @@ static int save_cert_or_delete(X509 *cert, const char *file, const char *desc)
     if (cert == NULL) {
         char desc_cert[80];

-        BIO_snprintf(desc_cert, sizeof(desc_cert), "%s certificate", desc);
+        snprintf(desc_cert, sizeof(desc_cert), "%s certificate", desc);
         return delete_file(file, desc_cert);
     } else {
         STACK_OF(X509) *certs = sk_X509_new_null();
@@ -2565,18 +2614,15 @@ static int save_template(const char *file, const OSSL_CRMF_CERTTEMPLATE *tmpl)
     BIO *bio = BIO_new_file(file, "wb");

     if (bio == NULL) {
-        CMP_err1("error saving certTemplate from genp: cannot open file %s",
-            file);
+        CMP_err1("Error saving certTemplate from genp: cannot open file %s", file);
         return 0;
     }
-    if (!ASN1_i2d_bio_of(OSSL_CRMF_CERTTEMPLATE, i2d_OSSL_CRMF_CERTTEMPLATE,
-            bio, tmpl)) {
-        CMP_err1("error saving certTemplate from genp: cannot write file %s",
-            file);
+    if (!ASN1_i2d_bio_of(OSSL_CRMF_CERTTEMPLATE, i2d_OSSL_CRMF_CERTTEMPLATE, bio, tmpl)) {
+        CMP_err1("Error saving certTemplate from genp: cannot write file %s", file);
         BIO_free(bio);
         return 0;
     } else {
-        CMP_info1("stored certTemplate from genp to file '%s'", file);
+        CMP_info1("Stored certTemplate from genp to file '%s'", file);
     }
     BIO_free(bio);
     return 1;
@@ -2587,16 +2633,16 @@ static int save_keyspec(const char *file, const OSSL_CMP_ATAVS *keyspec)
     BIO *bio = BIO_new_file(file, "wb");

     if (bio == NULL) {
-        CMP_err1("error saving keySpec from genp: cannot open file %s", file);
+        CMP_err1("Error saving keySpec from genp: cannot open file %s", file);
         return 0;
     }

     if (!ASN1_i2d_bio_of(OSSL_CMP_ATAVS, i2d_OSSL_CMP_ATAVS, bio, keyspec)) {
-        CMP_err1("error saving keySpec from genp: cannot write file %s", file);
+        CMP_err1("Error saving keySpec from genp: cannot write file %s", file);
         BIO_free(bio);
         return 0;
     } else {
-        CMP_info1("stored keySpec from genp to file '%s'", file);
+        CMP_info1("Stored keySpec from genp to file '%s'", file);
     }
     BIO_free(bio);
     return 1;
@@ -2629,12 +2675,12 @@ static int print_itavs(const STACK_OF(OSSL_CMP_ITAV) *itavs)
         char name[80];

         if (itav == NULL) {
-            CMP_err1("could not get ITAV #%d from genp", i);
+            CMP_err1("Could not get ITAV #%d from genp", i);
             ret = 0;
             continue;
         }
         if (i2t_ASN1_OBJECT(name, sizeof(name), type) <= 0) {
-            CMP_err1("error parsing type of ITAV #%d from genp", i);
+            CMP_err1("Error parsing type of ITAV #%d from genp", i);
             ret = 0;
         } else {
             CMP_info2("ITAV #%d from genp infoType=%s", i, name);
@@ -2662,7 +2708,7 @@ static const char *prev_item(const char *opt, const char *end)
     }
     len = end - beg;
     if (len > SECTION_NAME_MAX) {
-        CMP_warn3("using only first %d characters of section name starting with \"%.*s\"",
+        CMP_warn3("Using only first %d characters of section name starting with \"%.*s\"",
             SECTION_NAME_MAX, SECTION_NAME_MAX, beg);
         len = SECTION_NAME_MAX;
     }
@@ -2783,8 +2829,7 @@ static int read_config(void)
             }
             break;
         default:
-            CMP_err2("internal: unsupported type '%c' for option '%s'",
-                opt->valtype, opt->name);
+            CMP_err2("Internal: unsupported type '%c' for option '%s'", opt->valtype, opt->name);
             return 0;
             break;
         }
@@ -2793,7 +2838,7 @@ static int read_config(void)
             char *conf_argv[3];
             char arg1[82];

-            BIO_snprintf(arg1, 81, "-%s", (char *)opt->name);
+            snprintf(arg1, 81, "-%s", (char *)opt->name);
             conf_argv[0] = prog;
             conf_argv[1] = arg1;
             if (opt->valtype == '-') {
@@ -2810,8 +2855,7 @@ static int read_config(void)
                 if (provider_option
                         ? !opt_provider(opt_next())
                         : !opt_verify(opt_next(), vpm)) {
-                    CMP_err2("for option '%s' in config file section '%s'",
-                        opt->name, opt_section);
+                    CMP_err2("For option '%s' in config file section '%s'", opt->name, opt_section);
                     return 0;
                 }
             }
@@ -2985,6 +3029,12 @@ static int get_opts(int argc, char **argv)
         case OPT_UNPROTECTED_ERRORS:
             opt_unprotected_errors = 1;
             break;
+        case OPT_NONMATCHED_ERROR_NONCES:
+            opt_nonmatched_error_nonces = 1;
+            break;
+        case OPT_TA_IN_IP_EXTRACERTS:
+            opt_ta_in_ip_extracerts = 1;
+            break;
         case OPT_NO_CACHE_EXTRACERTS:
             opt_no_cache_extracerts = 1;
             break;
@@ -3081,7 +3131,7 @@ static int get_opts(int argc, char **argv)
             opt_popo = opt_int_arg();
             if (opt_popo < OSSL_CRMF_POPO_NONE
                 || opt_popo > OSSL_CRMF_POPO_KEYENC) {
-                CMP_err("invalid popo spec. Valid values are -1 .. 2");
+                CMP_err("Invalid popo spec. Valid values are -1 .. 2");
                 goto opthelp;
             }
             break;
@@ -3111,7 +3161,7 @@ static int get_opts(int argc, char **argv)
             if (opt_revreason < CRL_REASON_NONE
                 || opt_revreason > CRL_REASON_AA_COMPROMISE
                 || opt_revreason == 7) {
-                CMP_err("invalid revreason. Valid values are -1 .. 6, 8 .. 10");
+                CMP_err("Invalid revreason. Valid values are -1 .. 6, 8 .. 10");
                 goto opthelp;
             }
             break;
@@ -3133,11 +3183,6 @@ static int get_opts(int argc, char **argv)
         case OPT_OTHERPASS:
             opt_otherpass = opt_str();
             break;
-#ifndef OPENSSL_NO_ENGINE
-        case OPT_ENGINE:
-            opt_engine = opt_str();
-            break;
-#endif
         case OPT_PROV_CASES:
             if (!opt_provider(o))
                 goto opthelp;
@@ -3320,8 +3365,7 @@ static int cmp_server(OSSL_CMP_CTX *srv_cmp_ctx)
         if (req != NULL) {
             if (strcmp(path, "") != 0 && strcmp(path, "pkix/") != 0) {
                 (void)http_server_send_status(prog, cbio, 404, "Not Found");
-                CMP_err1("expecting empty path or 'pkix/' but got '%s'",
-                    path);
+                CMP_err1("Expecting empty path or 'pkix/' but got '%s'", path);
                 OPENSSL_free(path);
                 OSSL_CMP_MSG_free(req);
                 goto next;
@@ -3400,12 +3444,12 @@ static void print_keyspec(OSSL_CMP_ATAVS *keySpec)
             }

             X509_ALGOR_get0(&oid, &paramtype, &param, alg);
-            BIO_printf(mem, "Key algorithm: ");
+            BIO_puts(mem, "Key algorithm: ");
             i2a_ASN1_OBJECT(mem, oid);
             if (paramtype == V_ASN1_UNDEF || alg->parameter == NULL) {
-                BIO_printf(mem, "\n");
+                BIO_puts(mem, "\n");
             } else {
-                BIO_printf(mem, " - ");
+                BIO_puts(mem, " - ");
                 ASN1_item_print(mem, (ASN1_VALUE *)alg,
                     0, ASN1_ITEM_rptr(X509_ALGOR), NULL);
             }
@@ -3474,7 +3518,7 @@ static int do_genm(OSSL_CMP_CTX *ctx)

         /* could check authorization of sender/origin at this point */
         if (cacerts == NULL) {
-            CMP_warn("no CA certificates provided by server");
+            CMP_warn("No CA certificates provided by server");
         } else if (save_free_certs(cacerts, opt_cacertsout, "CA") < 0) {
             CMP_err1("Failed to store CA certificates from genp in %s",
                 opt_cacertsout);
@@ -3506,9 +3550,9 @@ static int do_genm(OSSL_CMP_CTX *ctx)
         /* At this point might check authorization of response sender/origin */

         if (newwithnew == NULL)
-            CMP_info("no root CA certificate update available");
+            CMP_info("No root CA certificate update available");
         else if (oldwithold == NULL && oldwithnew != NULL)
-            CMP_warn("oldWithNew certificate received in genp for verifying oldWithOld, but oldWithOld was not provided");
+            CMP_warn("OldWithNew certificate received in genp for verifying oldWithOld, but oldWithOld was not provided");

         if (save_cert_or_delete(newwithnew, opt_newwithnew,
                 "NewWithNew cert from genp")
@@ -3564,7 +3608,7 @@ static int do_genm(OSSL_CMP_CTX *ctx)
             goto end_crlupd;

         if (crl == NULL)
-            CMP_info("no CRL update available");
+            CMP_info("No CRL update available");
         if (!save_crl_or_delete(crl, opt_crlout, desc))
             goto end_crlupd;

@@ -3585,7 +3629,7 @@ static int do_genm(OSSL_CMP_CTX *ctx)
             return 0;

         if (certTemplate == NULL) {
-            CMP_warn("no certificate request template available");
+            CMP_warn("No certificate request template available");
             if (!delete_file(opt_template, "certTemplate from genp"))
                 return 0;
             if (opt_keyspec != NULL
@@ -3599,7 +3643,7 @@ static int do_genm(OSSL_CMP_CTX *ctx)
         print_keyspec(keySpec);
         if (opt_keyspec != NULL) {
             if (keySpec == NULL) {
-                CMP_warn("no key specifications available");
+                CMP_warn("No key specifications available");
                 if (!delete_file(opt_keyspec, "keySpec from genp"))
                     goto tmpl_end;
             } else if (!save_keyspec(opt_keyspec, keySpec)) {
@@ -3628,7 +3672,10 @@ static int do_genm(OSSL_CMP_CTX *ctx)
             }
         }

-        if ((itavs = OSSL_CMP_exec_GENM_ses(ctx)) != NULL) {
+        itavs = OSSL_CMP_exec_GENM_ses(ctx);
+        if (reqout_only_done && OSSL_CMP_CTX_get_status(ctx) == OSSL_CMP_PKISTATUS_trans)
+            return 1; /* not checking response as we did not send request */
+        if (itavs != NULL) {
             int res = print_itavs(itavs);

             sk_OSSL_CMP_ITAV_pop_free(itavs, OSSL_CMP_ITAV_free);
@@ -3660,9 +3707,13 @@ static int handle_opts_upfront(int argc, char **argv)
                 opt_section = argv[++i];
             else if (strcmp(argv[i] + 1,
                          cmp_options[OPT_VERBOSITY - OPT_HELP].name)
-                    == 0
-                && !set_verbosity(atoi(argv[++i])))
-                return 0;
+                == 0) {
+                int level;
+
+                ++i;
+                if (!opt_int(argv[i], &level) || !set_verbosity(level))
+                    return 0;
+            }
         }
     }
     if (opt_section[0] == '\0') /* empty string */
@@ -3675,7 +3726,6 @@ int cmp_main(int argc, char **argv)
     char *configfile = NULL;
     int i;
     X509 *newcert = NULL;
-    ENGINE *engine = NULL;
     int ret = 0; /* default: failure */

     if (!handle_opts_upfront(argc, argv))
@@ -3683,7 +3733,7 @@ int cmp_main(int argc, char **argv)

     vpm = X509_VERIFY_PARAM_new();
     if (vpm == NULL) {
-        CMP_err("out of memory");
+        CMP_err("Out of memory");
         goto err;
     }

@@ -3692,7 +3742,7 @@ int cmp_main(int argc, char **argv)
     if (configfile != NULL && configfile[0] != '\0' /* non-empty string */
         && (configfile != default_config_file
             || access(configfile, F_OK) != -1)) {
-        CMP_info2("using section(s) '%s' of OpenSSL configuration file '%s'",
+        CMP_info2("Using section(s) '%s' of OpenSSL configuration file '%s'",
             opt_section, configfile);
         conf = app_load_config(configfile);
         if (conf == NULL) {
@@ -3700,7 +3750,7 @@ int cmp_main(int argc, char **argv)
         } else {
             if (strcmp(opt_section, CMP_SECTION) == 0) { /* default */
                 if (!NCONF_get_section(conf, opt_section))
-                    CMP_info2("no [%s] section found in config file '%s';"
+                    CMP_info2("No [%s] section found in config file '%s';"
                               " will thus use just [default] and unnamed section if present",
                         opt_section, configfile);
             } else {
@@ -3708,8 +3758,7 @@ int cmp_main(int argc, char **argv)

                 while ((end = prev_item(opt_section, end)) != NULL) {
                     if (!NCONF_get_section(conf, opt_item)) {
-                        CMP_err2("no [%s] section found in config file '%s'",
-                            opt_item, configfile);
+                        CMP_err2("No [%s] section found in config file '%s'", opt_item, configfile);
                         goto err;
                     }
                 }
@@ -3719,7 +3768,7 @@ int cmp_main(int argc, char **argv)
                 ret = -1;
             if (ret <= 0) {
                 if (ret == -1)
-                    BIO_printf(bio_err, "Use -help for summary.\n");
+                    BIO_puts(bio_err, "Use -help for summary.\n");
                 goto err;
             }
         }
@@ -3741,18 +3790,9 @@ int cmp_main(int argc, char **argv)
     if (opt_batch)
         set_base_ui_method(UI_null());

-    if (opt_engine != NULL) {
-        engine = setup_engine_methods(opt_engine,
-            0 /* not: ENGINE_METHOD_ALL */, 0);
-        if (engine == NULL) {
-            CMP_err1("cannot load engine %s", opt_engine);
-            goto err;
-        }
-    }
-
     OSSL_CMP_CTX_set_log_verbosity(cmp_ctx, opt_verbosity);
     if (!OSSL_CMP_CTX_set_log_cb(cmp_ctx, print_to_bio_out)) {
-        CMP_err1("cannot set up error reporting and logging for %s", prog);
+        CMP_err1("Cannot set up error reporting and logging for %s", prog);
         goto err;
     }

@@ -3761,9 +3801,9 @@ int cmp_main(int argc, char **argv)
         && opt_tls_extra == NULL && opt_tls_trusted == NULL
         && opt_tls_host == NULL) {
         if (opt_tls_used)
-            CMP_warn("-tls_used given without any other TLS options");
+            CMP_warn("-tls_used is active without any other TLS options");
     } else if (!opt_tls_used) {
-        CMP_warn("ignoring TLS options(s) since -tls_used is not given");
+        CMP_warn("Ignoring TLS options(s) since -tls_used is not active");
     }
     if (opt_port != NULL) {
         if (opt_tls_used) {
@@ -3785,11 +3825,11 @@ int cmp_main(int argc, char **argv)
     }

     if (opt_server != NULL && opt_use_mock_srv) {
-        CMP_err("cannot use both -server and -use_mock_srv options");
+        CMP_err("Cannot use both -server and -use_mock_srv options");
         goto err;
     }
     if ((opt_server == NULL || opt_use_mock_srv) && opt_tls_used) {
-        CMP_warn("ignoring -tls_used option since -server is not given or -use_mock_srv is given");
+        CMP_warn("Ignoring -tls_used option since -server is not given or -use_mock_srv is given");
         opt_tls_used = 0;
     }

@@ -3808,16 +3848,20 @@ int cmp_main(int argc, char **argv)
         OSSL_CMP_SRV_CTX *srv_ctx;
         OSSL_CMP_CTX *srv_cmp_ctx;

-        if ((srv_ctx = setup_srv_ctx(engine)) == NULL)
+        if ((srv_ctx = setup_srv_ctx()) == NULL)
             goto err;
         OSSL_CMP_CTX_set_transfer_cb_arg(cmp_ctx /* of client */, srv_ctx);

         srv_cmp_ctx = OSSL_CMP_SRV_CTX_get0_cmp_ctx(srv_ctx);
         if (!OSSL_CMP_CTX_set_log_cb(srv_cmp_ctx, print_to_bio_err)) {
-            CMP_err1("cannot set up server-side error reporting and logging for %s", prog);
+            CMP_err1("Cannot set up server-side error reporting and logging for %s", prog);
             goto err;
         }
         OSSL_CMP_CTX_set_log_verbosity(srv_cmp_ctx, opt_verbosity);
+        if (opt_ignore_keyusage)
+            (void)OSSL_CMP_CTX_set_option(srv_cmp_ctx, OSSL_CMP_OPT_IGNORE_KEYUSAGE, 1);
+        if (opt_no_cache_extracerts)
+            (void)OSSL_CMP_CTX_set_option(srv_cmp_ctx, OSSL_CMP_OPT_NO_CACHE_EXTRACERTS, 1);

 #if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
         if (opt_port != NULL) { /* act as very basic CMP HTTP server only */
@@ -3837,11 +3881,20 @@ int cmp_main(int argc, char **argv)
             CMP_err("the -reqout_only client option does not combine with -port implying server behavior");
             goto err;
         }
-        if (opt_server != NULL)
+        if (opt_server != NULL) {
             CMP_warn1("-server %s", msg);
+            opt_server = NULL;
+        }
 #endif
-        if (opt_use_mock_srv)
+        if (opt_path != NULL) {
+            CMP_warn1("-path %s", msg);
+            opt_path = NULL;
+        }
+
+        if (opt_use_mock_srv) {
             CMP_warn1("-use_mock_srv %s", msg);
+            opt_use_mock_srv = 0;
+        }
         if (opt_reqout != NULL)
             CMP_warn1("-reqout %s", msg);
         if (opt_rspin != NULL)
@@ -3850,17 +3903,21 @@ int cmp_main(int argc, char **argv)
             CMP_warn1("-rspout %s", msg);
         opt_reqout = opt_reqout_only;
     }
+#if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
+    if (opt_server == NULL && !opt_use_mock_srv && opt_port == NULL)
+        CMP_info("Will not contact any server");
+#endif
     if (opt_rspin != NULL) {
 #if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
         if (opt_server != NULL)
-            CMP_warn("-server option is not used if enough filenames given for -rspin");
+            CMP_warn("-server option etc. are not used if enough filenames given for -rspin");
 #endif
         if (opt_use_mock_srv)
             CMP_warn("-use_mock_srv option is not used if enough filenames given for -rspin");
     }

-    if (!setup_client_ctx(cmp_ctx, engine)) {
-        CMP_err("cannot set up CMP context");
+    if (!setup_client_ctx(cmp_ctx)) {
+        CMP_err("Cannot set up CMP context");
         goto err;
     }
     for (i = 0; i < opt_repeat; i++) {
@@ -3952,7 +4009,7 @@ int cmp_main(int argc, char **argv)
                     cipher = EVP_CIPHER_fetch(app_get0_libctx(), SN_aes_256_cbc, app_get0_propq());
                 }

-                CMP_info1("saving centrally generated key to file '%s'", opt_newkeyout);
+                CMP_info1("Saving centrally generated key to file '%s'", opt_newkeyout);
                 if (PEM_write_bio_PrivateKey(out, new_key, cipher, NULL, 0, NULL,
                         (void *)pass_string)
                     <= 0)
@@ -3996,15 +4053,10 @@ err:
         /* cannot free info already here, as it may be used indirectly by: */
         OSSL_CMP_CTX_free(cmp_ctx);
 #if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
-        if (info != NULL) {
-            OPENSSL_free((char *)info->server);
-            OPENSSL_free((char *)info->port);
-            APP_HTTP_TLS_INFO_free(info);
-        }
+        APP_HTTP_TLS_INFO_free(info);
 #endif
     }
     X509_VERIFY_PARAM_free(vpm);
-    release_engine(engine);

     NCONF_free(conf); /* must not do as long as opt_... variables are used */
     OSSL_CMP_log_close();
diff --git a/deps/openssl/openssl/apps/cms.c b/deps/openssl/openssl/apps/cms.c
index 214eea5bcb0..ee59b9faa07 100644
--- a/deps/openssl/openssl/apps/cms.c
+++ b/deps/openssl/openssl/apps/cms.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -52,6 +52,7 @@ static int cms_set_pkey_param(EVP_PKEY_CTX *pctx,
 static int verify_err = 0;

 typedef struct cms_key_param_st cms_key_param;
+typedef struct cms_recip_opt_st cms_recip_opt;

 struct cms_key_param_st {
     int idx;
@@ -59,6 +60,14 @@ struct cms_key_param_st {
     cms_key_param *next;
 };

+struct cms_recip_opt_st {
+    int idx;
+    const char *kdf;
+    unsigned char *ukm_data;
+    long ukm_data_length;
+    cms_recip_opt *next;
+};
+
 typedef enum OPTION_choice {
     OPT_COMMON,
     OPT_INFORM,
@@ -72,6 +81,7 @@ typedef enum OPTION_choice {
     OPT_SIGN_RECEIPT,
     OPT_RESIGN,
     OPT_VERIFY,
+    OPT_VERIFY_PARTIAL,
     OPT_VERIFY_RETCODE,
     OPT_VERIFY_RECEIPT,
     OPT_CMSOUT,
@@ -139,13 +149,15 @@ typedef enum OPTION_choice {
     OPT_AES256_WRAP,
     OPT_3DES_WRAP,
     OPT_WRAP,
-    OPT_ENGINE,
     OPT_R_ENUM,
     OPT_PROV_ENUM,
     OPT_CONFIG,
     OPT_V_ENUM,
     OPT_CIPHER,
-    OPT_ORIGINATOR
+    OPT_KEKCIPHER,
+    OPT_ORIGINATOR,
+    OPT_RECIP_UKM,
+    OPT_RECIP_KDF
 } OPTION_CHOICE;

 const OPTIONS cms_options[] = {
@@ -209,33 +221,33 @@ const OPTIONS cms_options[] = {
         "Input private key (if not signer or recipient)" },
     { "passin", OPT_PASSIN, 's', "Input file pass phrase source" },
     { "keyopt", OPT_KEYOPT, 's', "Set public key parameters as n:v pairs" },
-    { "keyform", OPT_KEYFORM, 'f',
-        "Input private key format (ENGINE, other values ignored)" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device" },
-#endif
+    { "keyform", OPT_KEYFORM, 'f', "Input private key format (DER/PEM)" },
     OPT_PROV_OPTIONS,
     OPT_R_OPTIONS,

     OPT_SECTION("Encryption and decryption"),
-    { "originator", OPT_ORIGINATOR, 's', "Originator certificate file" },
-    { "recip", OPT_RECIP, '<', "Recipient cert file" },
+    { "originator", OPT_ORIGINATOR, 's', "Originator certificate" },
+    { "recip", OPT_RECIP, '<', "Recipient cert" },
     { "cert...", OPT_PARAM, '.',
         "Recipient certs (optional; used only when encrypting)" },
     { "", OPT_CIPHER, '-',
         "The encryption algorithm to use (any supported cipher)" },
+    { "kekcipher", OPT_KEKCIPHER, 's',
+        "The key encryption algorithm to use" },
     { "wrap", OPT_WRAP, 's',
-        "Key wrap algorithm to use when encrypting with key agreement" },
+        "Key wrap algorithm to use when encrypting with key agreement or key encapsulation" },
     { "aes128-wrap", OPT_AES128_WRAP, '-', "Use AES128 to wrap key" },
     { "aes192-wrap", OPT_AES192_WRAP, '-', "Use AES192 to wrap key" },
     { "aes256-wrap", OPT_AES256_WRAP, '-', "Use AES256 to wrap key" },
     { "des3-wrap", OPT_3DES_WRAP, '-', "Use 3DES-EDE to wrap key" },
     { "debug_decrypt", OPT_DEBUG_DECRYPT, '-',
         "Disable MMA protection, return error if no recipient found (see doc)" },
+    { "recip_kdf", OPT_RECIP_KDF, 's', "Set KEMRecipientInfo KDF for current recipient" },
+    { "recip_ukm", OPT_RECIP_UKM, 's', "KEMRecipientInfo user keying material for current recipient, in hex notation" },

     OPT_SECTION("Signing"),
     { "md", OPT_MD, 's', "Digest algorithm to use" },
-    { "signer", OPT_SIGNER, 's', "Signer certificate input file" },
+    { "signer", OPT_SIGNER, 's', "Signer certificate input" },
     { "certfile", OPT_CERTFILE, '<',
         "Extra signer and intermediate CA certificates to include when signing" },
     { OPT_MORE_STR, 0, 0,
@@ -271,11 +283,13 @@ const OPTIONS cms_options[] = {
     { "nointern", OPT_NOINTERN, '-',
         "Don't search certificates in message for signer" },
     { "cades", OPT_DUP, '-', "Check signingCertificate (CAdES-BES)" },
+    { "verify_partial", OPT_VERIFY_PARTIAL, '-',
+        "Return success if at least one signature can be verified" },
     { "verify_retcode", OPT_VERIFY_RETCODE, '-',
-        "Exit non-zero on verification failure" },
-    { "CAfile", OPT_CAFILE, '<', "Trusted certificates file" },
-    { "CApath", OPT_CAPATH, '/', "Trusted certificates directory" },
-    { "CAstore", OPT_CASTORE, ':', "Trusted certificates store URI" },
+        "Exit non-zero on verification failure (depends on -verify_partial etc.)" },
+    { "CAfile", OPT_CAFILE, '<', "File in PEM format with trusted CA certs" },
+    { "CApath", OPT_CAPATH, '/', "Dir with trusted CA cert files in PEM format" },
+    { "CAstore", OPT_CASTORE, ':', "URI of store with trusted CA certs" },
     { "no-CAfile", OPT_NOCAFILE, '-',
         "Do not load the default certificates file" },
     { "no-CApath", OPT_NOCAPATH, '-',
@@ -312,7 +326,7 @@ static CMS_ContentInfo *load_content_info(int informat, BIO *in, int flags,

     ret = CMS_ContentInfo_new_ex(app_get0_libctx(), app_get0_propq());
     if (ret == NULL) {
-        BIO_printf(bio_err, "Error allocating CMS_contentinfo\n");
+        BIO_puts(bio_err, "Error allocating CMS_contentinfo\n");
         return NULL;
     }
     switch (informat) {
@@ -339,6 +353,19 @@ err:
     return NULL;
 }

+static cms_recip_opt *alloc_recip_opt(int recipidx)
+{
+    cms_recip_opt *opt;
+
+    opt = app_malloc(sizeof(*opt), "recipient options buffer");
+    opt->idx = recipidx;
+    opt->next = NULL;
+    opt->kdf = NULL;
+    opt->ukm_data = NULL;
+    opt->ukm_data_length = 0;
+    return opt;
+}
+
 int cms_main(int argc, char **argv)
 {
     CONF *conf = NULL;
@@ -346,9 +373,8 @@ int cms_main(int argc, char **argv)
     BIO *in = NULL, *out = NULL, *indata = NULL, *rctin = NULL;
     CMS_ContentInfo *cms = NULL, *rcms = NULL;
     CMS_ReceiptRequest *rr = NULL;
-    ENGINE *e = NULL;
     EVP_PKEY *key = NULL;
-    EVP_CIPHER *cipher = NULL, *wrap_cipher = NULL;
+    EVP_CIPHER *cipher = NULL, *wrap_cipher = NULL, *kekcipher = NULL;
     EVP_MD *sign_md = NULL;
     STACK_OF(OPENSSL_STRING) *rr_to = NULL, *rr_from = NULL;
     STACK_OF(OPENSSL_STRING) *sksigners = NULL, *skkeys = NULL;
@@ -365,7 +391,8 @@ int cms_main(int argc, char **argv)
     long digestlen = 0;
     char *infile = NULL, *outfile = NULL, *rctfile = NULL;
     char *passinarg = NULL, *passin = NULL, *signerfile = NULL;
-    char *originatorfile = NULL, *recipfile = NULL, *ciphername = NULL;
+    char *originatorfile = NULL, *recipfile = NULL;
+    char *ciphername = NULL, *kekciphername = NULL;
     char *to = NULL, *from = NULL, *subject = NULL, *prog;
     cms_key_param *key_first = NULL, *key_param = NULL;
     int flags = CMS_DETACHED, binary_files = 0;
@@ -376,6 +403,8 @@ int cms_main(int argc, char **argv)
     size_t secret_keylen = 0, secret_keyidlen = 0;
     unsigned char *pwri_pass = NULL, *pwri_tmp = NULL;
     unsigned char *secret_key = NULL, *secret_keyid = NULL;
+    cms_recip_opt *recip_first = NULL, *recip_opt = NULL;
+    int recipidx = -1;
     long ltmp;
     const char *mime_eol = "\n";
     OPTION_CHOICE o;
@@ -431,6 +460,9 @@ int cms_main(int argc, char **argv)
             operation = SMIME_VERIFY_RECEIPT;
             rctfile = opt_arg();
             break;
+        case OPT_VERIFY_PARTIAL:
+            flags |= CMS_VERIFY_PARTIAL;
+            break;
         case OPT_VERIFY_RETCODE:
             verify_retcode = 1;
             break;
@@ -482,6 +514,10 @@ int cms_main(int argc, char **argv)
             break;
         case OPT_NOCERTS:
             flags |= CMS_NOCERTS;
+            /*
+             * Note that this does not affect certificates in variable 'other'
+             * containing extra certs loaded according to the -certfile option.
+             */
             break;
         case OPT_NOATTR:
             flags |= CMS_NOATTR;
@@ -629,9 +665,6 @@ int cms_main(int argc, char **argv)
                 goto opthelp;
             }
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_PASSIN:
             passinarg = opt_arg();
             break;
@@ -710,9 +743,52 @@ int cms_main(int argc, char **argv)
                 recipfile = opt_arg();
             }
             break;
+        case OPT_RECIP_KDF:
+        case OPT_RECIP_UKM:
+            recipidx = -1;
+            if (operation == SMIME_ENCRYPT) {
+                if (sk_X509_num(encerts) > 0)
+                    recipidx += sk_X509_num(encerts);
+            }
+            if (recipidx < 0) {
+                BIO_printf(bio_err, "No recipient specified\n");
+                goto opthelp;
+            }
+            if (recip_opt == NULL || recip_opt->idx != recipidx) {
+                cms_recip_opt *nopt;
+
+                nopt = alloc_recip_opt(recipidx);
+                if (recip_first == NULL)
+                    recip_first = nopt;
+                else
+                    recip_opt->next = nopt;
+                recip_opt = nopt;
+            }
+            if (o == OPT_RECIP_KDF) {
+                if (recip_opt->kdf != NULL) {
+                    BIO_puts(bio_err, "Illegal multiple -recip_kdf for one -recip\n");
+                    goto end;
+                }
+                recip_opt->kdf = opt_arg();
+            } else {
+                if (recip_opt->ukm_data != NULL) {
+                    BIO_puts(bio_err, "Illegal multiple -recip_ukm for one -recip\n");
+                    goto end;
+                }
+                recip_opt->ukm_data = OPENSSL_hexstr2buf(opt_arg(),
+                    &recip_opt->ukm_data_length);
+                if (recip_opt->ukm_data == NULL) {
+                    BIO_printf(bio_err, "Invalid hex value after -recip_ukm\n");
+                    goto end;
+                }
+            }
+            break;
         case OPT_CIPHER:
             ciphername = opt_unknown();
             break;
+        case OPT_KEKCIPHER:
+            kekciphername = opt_arg();
+            break;
         case OPT_KEYOPT:
             keyidx = -1;
             if (operation == SMIME_ENCRYPT) {
@@ -725,7 +801,7 @@ int cms_main(int argc, char **argv)
                     keyidx += sk_OPENSSL_STRING_num(skkeys);
             }
             if (keyidx < 0) {
-                BIO_printf(bio_err, "No key specified\n");
+                BIO_puts(bio_err, "No key specified\n");
                 goto opthelp;
             }
             if (key_param == NULL || key_param->idx != keyidx) {
@@ -784,6 +860,8 @@ int cms_main(int argc, char **argv)
     }
     if (!opt_cipher_any(ciphername, &cipher))
         goto end;
+    if (kekciphername != NULL && !opt_cipher_any(kekciphername, &kekcipher))
+        goto end;
     if (wrapname != NULL) {
         if (!opt_cipher_any(wrapname, &wrap_cipher))
             goto end;
@@ -840,7 +918,7 @@ int cms_main(int argc, char **argv)
                 goto end;
         }
         if (sksigners == NULL) {
-            BIO_printf(bio_err, "No signer certificate specified\n");
+            BIO_puts(bio_err, "No signer certificate specified\n");
             goto opthelp;
         }
         signerfile = NULL;
@@ -848,23 +926,23 @@ int cms_main(int argc, char **argv)
     } else if (operation == SMIME_DECRYPT) {
         if (recipfile == NULL && keyfile == NULL
             && secret_key == NULL && pwri_pass == NULL) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "No recipient certificate or key specified\n");
             goto opthelp;
         }
     } else if (operation == SMIME_ENCRYPT) {
         if (*argv == NULL && secret_key == NULL
             && pwri_pass == NULL && sk_X509_num(encerts) <= 0) {
-            BIO_printf(bio_err, "No recipient(s) certificate(s) specified\n");
+            BIO_puts(bio_err, "No recipient(s) certificate(s) specified\n");
             goto opthelp;
         }
     } else if (!operation) {
-        BIO_printf(bio_err, "No operation option (-encrypt|-decrypt|-sign|-verify|...) specified.\n");
+        BIO_puts(bio_err, "No operation option (-encrypt|-decrypt|-sign|-verify|...) specified.\n");
         goto opthelp;
     }

     if (!app_passwd(passinarg, NULL, &passin, NULL)) {
-        BIO_printf(bio_err, "Error getting password\n");
+        BIO_puts(bio_err, "Error getting password\n");
         goto end;
     }

@@ -872,17 +950,20 @@ int cms_main(int argc, char **argv)

     if ((operation & SMIME_SIGNERS) == 0) {
         if ((flags & CMS_DETACHED) == 0)
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Warning: -nodetach option is ignored for non-signing operation\n");

         flags &= ~CMS_DETACHED;
     }
     if ((operation & SMIME_IP) == 0 && contfile != NULL)
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Warning: -contfile option is ignored for the given operation\n");
     if (operation != SMIME_ENCRYPT && *argv != NULL)
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Warning: recipient certificate file parameters ignored for operation other than -encrypt\n");
+    if (operation != SMIME_ENCRYPT && recip_first != NULL)
+        BIO_puts(bio_err,
+            "Warning: -recip_kdf and -recip_ukm parameters ignored for operation other than -encrypt\n");

     if ((flags & CMS_BINARY) != 0) {
         if (!(operation & SMIME_OP))
@@ -899,13 +980,13 @@ int cms_main(int argc, char **argv)
         if (!cipher)
             cipher = (EVP_CIPHER *)EVP_aes_256_cbc();
         if (secret_key && !secret_keyid) {
-            BIO_printf(bio_err, "No secret key id\n");
+            BIO_puts(bio_err, "No secret key id\n");
             goto end;
         }

         for (; *argv != NULL; argv++) {
             cert = load_cert(*argv, FORMAT_UNDEF,
-                "recipient certificate file");
+                "recipient certificate");
             if (cert == NULL)
                 goto end;
             if (!sk_X509_push(encerts, cert))
@@ -914,39 +995,27 @@ int cms_main(int argc, char **argv)
         }
     }

-    if (certfile != NULL) {
-        if (!load_certs(certfile, 0, &other, NULL, "certificate file")) {
-            ERR_print_errors(bio_err);
-            goto end;
-        }
-    }
+    if (certfile != NULL
+        && !load_certs(certfile, 0, &other, NULL, "extra certificates"))
+        goto end;

-    if (recipfile != NULL && (operation == SMIME_DECRYPT)) {
-        if ((recip = load_cert(recipfile, FORMAT_UNDEF,
-                 "recipient certificate file"))
-            == NULL) {
-            ERR_print_errors(bio_err);
-            goto end;
-        }
-    }
+    if (recipfile != NULL && (operation == SMIME_DECRYPT)
+        && (recip = load_cert(recipfile, FORMAT_UNDEF,
+                "recipient certificate file"))
+            == NULL)
+        goto end;

-    if (originatorfile != NULL) {
-        if ((originator = load_cert(originatorfile, FORMAT_UNDEF,
-                 "originator certificate file"))
-            == NULL) {
-            ERR_print_errors(bio_err);
-            goto end;
-        }
-    }
+    if (originatorfile != NULL
+        && (originator = load_cert(originatorfile, FORMAT_UNDEF,
+                "originator certificate file"))
+            == NULL)
+        goto end;

-    if (operation == SMIME_SIGN_RECEIPT) {
-        if ((signer = load_cert(signerfile, FORMAT_UNDEF,
-                 "receipt signer certificate file"))
-            == NULL) {
-            ERR_print_errors(bio_err);
-            goto end;
-        }
-    }
+    if (operation == SMIME_SIGN_RECEIPT
+        && (signer = load_cert(signerfile, FORMAT_UNDEF,
+                "receipt signer certificate file"))
+            == NULL)
+        goto end;

     if ((operation == SMIME_DECRYPT) || (operation == SMIME_ENCRYPT)) {
         if (keyfile == NULL)
@@ -959,27 +1028,27 @@ int cms_main(int argc, char **argv)
     }

     if (keyfile != NULL) {
-        key = load_key(keyfile, keyform, 0, passin, e, "signing key");
+        key = load_key(keyfile, keyform, 0, passin, "signing key");
         if (key == NULL)
             goto end;
     }

     if (digesthex != NULL) {
         if (operation != SMIME_SIGN) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Cannot use -digest for non-signing operation\n");
             goto end;
         }
         if (infile != NULL
             || (flags & CMS_DETACHED) == 0
             || (flags & CMS_STREAM) != 0) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Cannot use -digest when -in, -nodetach or streaming is used\n");
             goto end;
         }
         digestbin = OPENSSL_hexstr2buf(digesthex, &digestlen);
         if (digestbin == NULL) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Invalid hex value after -digest\n");
             goto end;
         }
@@ -1058,7 +1127,9 @@ int cms_main(int argc, char **argv)
             goto end;
         for (i = 0; i < sk_X509_num(encerts); i++) {
             CMS_RecipientInfo *ri;
+            int ri_type;
             cms_key_param *kparam;
+            cms_recip_opt *ropt;
             int tflags = flags | CMS_KEY_PARAM;
             /* This flag enforces allocating the EVP_PKEY_CTX for the recipient here */
             EVP_PKEY_CTX *pctx;
@@ -1066,14 +1137,19 @@ int cms_main(int argc, char **argv)
             int res;

             for (kparam = key_first; kparam; kparam = kparam->next) {
-                if (kparam->idx == i) {
+                if (kparam->idx == i)
+                    break;
+            }
+            for (ropt = recip_first; ropt; ropt = ropt->next) {
+                if (ropt->idx == i)
                     break;
-                }
             }
             ri = CMS_add1_recipient(cms, x, key, originator, tflags);
             if (ri == NULL)
                 goto end;

+            ri_type = CMS_RecipientInfo_type(ri);
+
             pctx = CMS_RecipientInfo_get0_pkey_ctx(ri);
             if (pctx != NULL && kparam != NULL) {
                 if (!cms_set_pkey_param(pctx, kparam->param))
@@ -1082,16 +1158,43 @@ int cms_main(int argc, char **argv)

             res = EVP_PKEY_CTX_ctrl(pctx, -1, -1,
                 EVP_PKEY_CTRL_CIPHER,
-                EVP_CIPHER_get_nid(cipher), NULL);
+                EVP_CIPHER_get_nid(cipher), cipher);
             if (res <= 0 && res != -2)
                 goto end;

-            if (CMS_RecipientInfo_type(ri) == CMS_RECIPINFO_AGREE
-                && wrap_cipher != NULL) {
-                EVP_CIPHER_CTX *wctx;
-                wctx = CMS_RecipientInfo_kari_get0_ctx(ri);
-                if (EVP_EncryptInit_ex(wctx, wrap_cipher, NULL, NULL, NULL) != 1)
-                    goto end;
+            if (wrap_cipher != NULL) {
+                EVP_CIPHER_CTX *wctx = NULL;
+
+                if (ri_type == CMS_RECIPINFO_AGREE)
+                    wctx = CMS_RecipientInfo_kari_get0_ctx(ri);
+                else if (ri_type == CMS_RECIPINFO_KEM)
+                    wctx = CMS_RecipientInfo_kemri_get0_ctx(ri);
+                if (wctx != NULL) {
+                    if (EVP_EncryptInit_ex(wctx, wrap_cipher, NULL, NULL, NULL) != 1)
+                        goto end;
+                }
+            }
+
+            if (ropt != NULL && ri_type == CMS_RECIPINFO_KEM) {
+                if (ropt->ukm_data != NULL) {
+                    if (!CMS_RecipientInfo_kemri_set_ukm(ri, ropt->ukm_data,
+                            (int)ropt->ukm_data_length))
+                        goto end;
+                }
+                if (ropt->kdf != NULL) {
+                    X509_ALGOR *kdf_algo;
+                    ASN1_OBJECT *kdf_obj;
+
+                    kdf_algo = CMS_RecipientInfo_kemri_get0_kdf_alg(ri);
+                    kdf_obj = OBJ_txt2obj(ropt->kdf, 0);
+                    if (kdf_obj == NULL) {
+                        BIO_printf(bio_err, "Unknown KDF %s\n", ropt->kdf);
+                        goto end;
+                    }
+                    /* Only works for OIDs without params */
+                    if (!X509_ALGOR_set0(kdf_algo, kdf_obj, V_ASN1_UNDEF, NULL))
+                        goto end;
+                }
             }
         }

@@ -1109,9 +1212,8 @@ int cms_main(int argc, char **argv)
             pwri_tmp = (unsigned char *)OPENSSL_strdup((char *)pwri_pass);
             if (pwri_tmp == NULL)
                 goto end;
-            if (CMS_add0_recipient_password(cms,
-                    -1, NID_undef, NID_undef,
-                    pwri_tmp, -1, NULL)
+            if (CMS_add0_recipient_password(cms, -1, NID_undef, NID_undef,
+                    pwri_tmp, -1, kekcipher)
                 == NULL)
                 goto end;
             pwri_tmp = NULL;
@@ -1121,7 +1223,7 @@ int cms_main(int argc, char **argv)
                 if (originator != NULL
                     && ERR_GET_REASON(ERR_peek_error())
                         == CMS_R_ERROR_UNSUPPORTED_STATIC_KEY_AGREEMENT) {
-                    BIO_printf(bio_err, "Cannot use originator for encryption\n");
+                    BIO_puts(bio_err, "Cannot use originator for encryption\n");
                     goto end;
                 }
                 goto end;
@@ -1158,8 +1260,10 @@ int cms_main(int argc, char **argv)
             }
             flags |= CMS_PARTIAL;
             cms = CMS_sign_ex(NULL, NULL, other, in, flags, libctx, app_get0_propq());
-            if (cms == NULL)
+            if (cms == NULL) {
+                BIO_puts(bio_err, "CMS SignedData Creation Error\n");
                 goto end;
+            }
             if (econtent_type != NULL)
                 CMS_set1_eContentType(cms, econtent_type);

@@ -1184,7 +1288,7 @@ int cms_main(int argc, char **argv)
                 ret = 2;
                 goto end;
             }
-            key = load_key(keyfile, keyform, 0, passin, e, "signing key");
+            key = load_key(keyfile, keyform, 0, passin, "signing key");
             if (key == NULL) {
                 ret = 2;
                 goto end;
@@ -1197,35 +1301,43 @@ int cms_main(int argc, char **argv)
                 }
             }
             si = CMS_add1_signer(cms, signer, key, sign_md, tflags);
-            if (si == NULL)
+            if (si == NULL) {
+                BIO_printf(bio_err, "Error adding SignerInfo with key from %s\n", keyfile);
                 goto end;
+            }
+
             if (kparam != NULL) {
-                EVP_PKEY_CTX *pctx;
-                pctx = CMS_SignerInfo_get0_pkey_ctx(si);
+                EVP_PKEY_CTX *pctx = CMS_SignerInfo_get0_pkey_ctx(si);
+
                 if (!cms_set_pkey_param(pctx, kparam->param))
                     goto end;
             }
-            if (rr != NULL && !CMS_add1_ReceiptRequest(si, rr))
+            if (rr != NULL && !CMS_add1_ReceiptRequest(si, rr)) {
+                BIO_puts(bio_err, "Error adding CMS ReceiptRequest\n");
                 goto end;
+            }
             X509_free(signer);
             signer = NULL;
             EVP_PKEY_free(key);
             key = NULL;
         }
         /* If not streaming or resigning finalize structure */
-        if (operation == SMIME_SIGN && digestbin != NULL
-            && (flags & CMS_STREAM) == 0) {
-            /* Use pre-computed digest instead of content */
-            if (!CMS_final_digest(cms, digestbin, digestlen, NULL, flags))
-                goto end;
-        } else if (operation == SMIME_SIGN && (flags & CMS_STREAM) == 0) {
-            if (!CMS_final(cms, in, NULL, flags))
+        if (operation == SMIME_SIGN && (flags & CMS_STREAM) == 0) {
+            int res;
+
+            if (digestbin != NULL) /* Use pre-computed digest instead of content */
+                res = CMS_final_digest(cms, digestbin, digestlen, NULL, flags);
+            else
+                res = CMS_final(cms, in, NULL, flags);
+            if (!res) {
+                BIO_puts(bio_err, "Error finalizing CMS structure\n");
                 goto end;
+            }
         }
     }

     if (cms == NULL) {
-        BIO_printf(bio_err, "Error creating CMS structure\n");
+        BIO_puts(bio_err, "Error creating CMS structure\n");
         goto end;
     }

@@ -1258,7 +1370,7 @@ int cms_main(int argc, char **argv)
         }

         if (!CMS_decrypt(cms, NULL, NULL, indata, out, flags)) {
-            BIO_printf(bio_err, "Error decrypting CMS structure\n");
+            BIO_puts(bio_err, "Error decrypting CMS structure\n");
             goto end;
         }
     } else if (operation == SMIME_DATA_OUT) {
@@ -1269,9 +1381,9 @@ int cms_main(int argc, char **argv)
             goto end;
     } else if (operation == SMIME_DIGEST_VERIFY) {
         if (CMS_digest_verify(cms, indata, out, flags) > 0) {
-            BIO_printf(bio_err, "Verification successful\n");
+            BIO_puts(bio_err, "Verification successful\n");
         } else {
-            BIO_printf(bio_err, "Verification failure\n");
+            BIO_puts(bio_err, "Verification failure\n");
             goto end;
         }
     } else if (operation == SMIME_ENCRYPTED_DECRYPT) {
@@ -1289,6 +1401,35 @@ int cms_main(int argc, char **argv)
                 ret = verify_err + 32;
             goto end;
         }
+        if ((flags & CMS_VERIFY_PARTIAL) != 0) {
+            int i;
+            STACK_OF(CMS_SignerInfo) *sinfos = CMS_get0_SignerInfos(cms);
+
+            for (i = 0; i < sk_CMS_SignerInfo_num(sinfos); i++) {
+                CMS_SignerInfo *si = sk_CMS_SignerInfo_value(sinfos, i);
+                X509 *si_signer = CMS_SignerInfo_get0_signer_cert(si);
+                const X509_NAME *si_subject = NULL;
+
+                if (si_signer == NULL) {
+                    BIO_printf(bio_err, "Signer %d: no certificate\n", i);
+                    continue;
+                }
+
+                si_subject = X509_get_subject_name(si_signer);
+                if (si_subject == NULL) {
+                    BIO_printf(bio_err, "Signer %d: no subject name\n", i);
+                    continue;
+                }
+
+                BIO_printf(bio_err, "Signer %d: ", i);
+                X509_NAME_print_ex(bio_err, si_subject, 0, XN_FLAG_ONELINE);
+                BIO_printf(bio_err, "\n  Verification %s (cert: %s, attrs: %s, content: %s)\n",
+                    CMS_SignerInfo_get_verification_result(si, CMS_VERIFY_RESULT) ? "successful" : "failed",
+                    CMS_SignerInfo_get_verification_result(si, CMS_VERIFY_CERT) ? "success" : "failure or not verified",
+                    CMS_SignerInfo_get_verification_result(si, CMS_VERIFY_ATTR) ? "success" : "failure or not verified",
+                    CMS_SignerInfo_get_verification_result(si, CMS_VERIFY_CONTENT) ? "success" : "failure or not verified");
+            }
+        }
         if (signerfile != NULL) {
             STACK_OF(X509) *signers = CMS_get0_signers(cms);

@@ -1305,12 +1446,13 @@ int cms_main(int argc, char **argv)

     } else if (operation == SMIME_VERIFY_RECEIPT) {
         if (CMS_verify_receipt(rcms, cms, other, store, flags) > 0) {
-            BIO_printf(bio_err, "Verification successful\n");
+            BIO_puts(bio_err, "Verification successful\n");
         } else {
-            BIO_printf(bio_err, "Verification failure\n");
+            BIO_puts(bio_err, "Verification failure\n");
             goto end;
         }
     } else {
+        /* within this block, ret > 0 means 'ok' */
         if (noout) {
             if (print) {
                 ASN1_PCTX *pctx = NULL;
@@ -1325,13 +1467,14 @@ int cms_main(int argc, char **argv)
                 CMS_ContentInfo_print_ctx(out, cms, 0, pctx);
                 ASN1_PCTX_free(pctx);
             }
+            ret = 1;
         } else if (outformat == FORMAT_SMIME) {
-            if (to)
-                BIO_printf(out, "To: %s%s", to, mime_eol);
-            if (from)
-                BIO_printf(out, "From: %s%s", from, mime_eol);
-            if (subject)
-                BIO_printf(out, "Subject: %s%s", subject, mime_eol);
+            if (to != NULL && BIO_printf(out, "To: %s%s", to, mime_eol) < 0)
+                goto end;
+            if (from != NULL && BIO_printf(out, "From: %s%s", from, mime_eol) < 0)
+                goto end;
+            if (subject != NULL && BIO_printf(out, "Subject: %s%s", subject, mime_eol) < 0)
+                goto end;
             if (operation == SMIME_RESIGN)
                 ret = SMIME_write_CMS(out, cms, indata, flags);
             else
@@ -1341,18 +1484,18 @@ int cms_main(int argc, char **argv)
         } else if (outformat == FORMAT_ASN1) {
             ret = i2d_CMS_bio_stream(out, cms, in, flags);
         } else {
-            BIO_printf(bio_err, "Bad output format for CMS file\n");
+            BIO_puts(bio_err, "Bad output format for CMS file\n");
             goto end;
         }
         if (ret <= 0) {
-            BIO_printf(bio_err, "Error writing CMS output\n");
+            BIO_puts(bio_err, "Error writing CMS output\n");
             ret = 6;
             goto end;
         }
     }
     ret = 0;
 end:
-    if (ret)
+    if (ret != 0)
         ERR_print_errors(bio_err);
     OSSL_STACK_OF_X509_free(encerts);
     OSSL_STACK_OF_X509_free(other);
@@ -1373,6 +1516,14 @@ end:
         OPENSSL_free(key_param);
         key_param = tparam;
     }
+    for (recip_opt = recip_first; recip_opt != NULL;) {
+        cms_recip_opt *topt;
+
+        OPENSSL_free(recip_opt->ukm_data);
+        topt = recip_opt->next;
+        OPENSSL_free(recip_opt);
+        recip_opt = topt;
+    }
     X509_STORE_free(store);
     X509_free(cert);
     X509_free(recip);
@@ -1380,11 +1531,11 @@ end:
     X509_free(originator);
     EVP_PKEY_free(key);
     EVP_CIPHER_free(cipher);
+    EVP_CIPHER_free(kekcipher);
     EVP_CIPHER_free(wrap_cipher);
     EVP_MD_free(sign_md);
     CMS_ContentInfo_free(cms);
     CMS_ContentInfo_free(rcms);
-    release_engine(e);
     BIO_free(rctin);
     BIO_free(in);
     BIO_free(indata);
@@ -1468,13 +1619,15 @@ static void receipt_request_print(CMS_ContentInfo *cms)
             ERR_print_errors(bio_err);
         } else {
             const char *id;
-            int idlen;
+            size_t idlen;
             CMS_ReceiptRequest_get0_values(rr, &scid, &allorfirst,
                 &rlist, &rto);
             BIO_puts(bio_err, "  Signed Content ID:\n");
-            idlen = ASN1_STRING_length(scid);
+            idlen = ASN1_STRING_get_length(scid);
+            if (idlen > INT_MAX)
+                idlen = INT_MAX;
             id = (const char *)ASN1_STRING_get0_data(scid);
-            BIO_dump_indent(bio_err, id, idlen, 4);
+            BIO_dump_indent(bio_err, id, (int)idlen, 4);
             BIO_puts(bio_err, "  Receipts From");
             if (rlist != NULL) {
                 BIO_puts(bio_err, " List:\n");
@@ -1564,8 +1717,7 @@ static int cms_set_pkey_param(EVP_PKEY_CTX *pctx,
     for (i = 0; i < sk_OPENSSL_STRING_num(param); i++) {
         keyopt = sk_OPENSSL_STRING_value(param, i);
         if (pkey_ctrl_string(pctx, keyopt) <= 0) {
-            BIO_printf(bio_err, "parameter error \"%s\"\n", keyopt);
-            ERR_print_errors(bio_err);
+            BIO_printf(bio_err, "Error setting CMS key parameter \"%s\"\n", keyopt);
             return 0;
         }
     }
diff --git a/deps/openssl/openssl/apps/configutl.c b/deps/openssl/openssl/apps/configutl.c
new file mode 100644
index 00000000000..d1bee103e3d
--- /dev/null
+++ b/deps/openssl/openssl/apps/configutl.c
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/conf.h>
+#include <openssl/err.h>
+#include <openssl/safestack.h>
+
+#include "apps.h"
+#include "progs.h"
+
+/**
+ * Print the given value escaped for the OpenSSL configuration file format.
+ */
+static void print_escaped_value(BIO *out, const char *value)
+{
+    const char *p;
+
+    for (p = value; *p != '\0'; p++) {
+        switch (*p) {
+        case '"':
+        case '\'':
+        case '#':
+        case '\\':
+        case '$':
+            BIO_puts(out, "\\");
+            BIO_write(out, p, 1);
+            break;
+        case '\n':
+            BIO_puts(out, "\\n");
+            break;
+        case '\r':
+            BIO_puts(out, "\\r");
+            break;
+        case '\b':
+            BIO_puts(out, "\\b");
+            break;
+        case '\t':
+            BIO_puts(out, "\\t");
+            break;
+        case ' ':
+            if (p == value || p[1] == '\0') {
+                /*
+                 * Quote spaces if they are the first or last char of the
+                 * value. We could quote the entire string (and it would
+                 * certainly produce nicer output), but in quoted strings
+                 * the escape sequences for \n, \r, \t, and \b do not work.
+                 * To make sure we're producing correct results we'd thus
+                 * have to selectively not use those in quoted strings and
+                 * close and re-open the quotes if they appear, which is
+                 * more trouble than adding the quotes just around the
+                 * first and last leading and trailing space.
+                 */
+                BIO_puts(out, "\" \"");
+                break;
+            }
+            /* FALLTHROUGH */
+        default:
+            BIO_write(out, p, 1);
+            break;
+        }
+    }
+}
+
+/**
+ * Print all values in the configuration section identified by section_name
+ */
+static void print_section(BIO *out, const CONF *cnf, OPENSSL_CSTRING section_name)
+{
+    STACK_OF(CONF_VALUE) *values = NCONF_get_section(cnf, section_name);
+    int idx;
+
+    for (idx = 0; idx < sk_CONF_VALUE_num(values); idx++) {
+        CONF_VALUE *value = sk_CONF_VALUE_value(values, idx);
+
+        BIO_printf(out, "%s = ", value->name);
+        print_escaped_value(out, value->value);
+        BIO_puts(out, "\n");
+    }
+}
+
+typedef enum OPTION_choice {
+    OPT_COMMON,
+    OPT_OUT,
+    OPT_NOHEADER,
+    OPT_CONFIG
+} OPTION_CHOICE;
+
+const OPTIONS configutl_options[] = {
+    OPT_SECTION("General"),
+    { "help", OPT_HELP, '-', "Display this summary" },
+    { "config", OPT_CONFIG, 's', "Config file to deal with (the default one if omitted)" },
+    OPT_SECTION("Output"),
+    { "out", OPT_OUT, '>', "Output to filename rather than stdout" },
+    { "noheader", OPT_NOHEADER, '-', "Don't print the information about original config" },
+    { NULL }
+};
+
+/**
+ * Parse the passed OpenSSL configuration file (or the default one/specified in the
+ * OPENSSL_CONF environment variable) and write it back in
+ * a canonical format with all includes and variables expanded.
+ */
+int configutl_main(int argc, char *argv[])
+{
+    int ret = 1;
+    char *prog, *configfile = NULL;
+    OPTION_CHOICE o;
+    CONF *cnf = NULL;
+    long eline = 0;
+    int default_section_idx, idx;
+    int no_header = 0;
+    STACK_OF(OPENSSL_CSTRING) *sections = NULL;
+    BIO *out = NULL;
+    const char *outfile = NULL;
+
+    prog = opt_init(argc, argv, configutl_options);
+    while ((o = opt_next()) != OPT_EOF) {
+        switch (o) {
+        case OPT_HELP:
+            opt_help(configutl_options);
+            ret = 0;
+            goto end;
+            break;
+        case OPT_NOHEADER:
+            no_header = 1;
+            break;
+        case OPT_CONFIG:
+            /*
+             * In case multiple OPT_CONFIG options are passed, we need to free
+             * the previous one before assigning the new one.
+             */
+            OPENSSL_free(configfile);
+            configfile = OPENSSL_strdup(opt_arg());
+            break;
+        case OPT_OUT:
+            outfile = opt_arg();
+            break;
+        case OPT_ERR:
+        /*
+         * default needed for OPT_EOF which might never happen.
+         */
+        default:
+            BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+            goto end;
+        }
+    }
+
+    out = bio_open_default(outfile, 'w', FORMAT_TEXT);
+    if (out == NULL)
+        goto end;
+
+    if (configfile == NULL)
+        configfile = CONF_get1_default_config_file();
+
+    if (configfile == NULL)
+        goto end;
+
+    if ((cnf = NCONF_new(NULL)) == NULL)
+        goto end;
+
+    if (NCONF_load(cnf, configfile, &eline) == 0) {
+        BIO_printf(bio_err, "Error on line %ld of configuration file\n", eline + 1);
+        goto end;
+    }
+
+    if ((sections = NCONF_get_section_names(cnf)) == NULL)
+        goto end;
+
+    if (no_header == 0)
+        BIO_printf(out, "# This configuration file was linearized and expanded from %s\n",
+            configfile);
+
+    default_section_idx = sk_OPENSSL_CSTRING_find(sections, "default");
+    if (default_section_idx != -1)
+        print_section(out, cnf, "default");
+
+    for (idx = 0; idx < sk_OPENSSL_CSTRING_num(sections); idx++) {
+        OPENSSL_CSTRING section_name = sk_OPENSSL_CSTRING_value(sections, idx);
+
+        if (idx == default_section_idx)
+            continue;
+
+        BIO_printf(out, "\n[%s]\n", section_name);
+        print_section(out, cnf, section_name);
+    }
+
+    ret = 0;
+
+end:
+    ERR_print_errors(bio_err);
+    BIO_free(out);
+    OPENSSL_free(configfile);
+    NCONF_free(cnf);
+    sk_OPENSSL_CSTRING_free(sections);
+    return ret;
+}
diff --git a/deps/openssl/openssl/apps/crl.c b/deps/openssl/openssl/apps/crl.c
index cba5883dd6d..ba0f323a6ba 100644
--- a/deps/openssl/openssl/apps/crl.c
+++ b/deps/openssl/openssl/apps/crl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -84,9 +84,9 @@ const OPTIONS crl_options[] = {
     { "gendelta", OPT_GENDELTA, '<', "Other CRL to compare/diff to the Input one" },

     OPT_SECTION("Certificate"),
-    { "CApath", OPT_CAPATH, '/', "Verify CRL using certificates in dir" },
-    { "CAfile", OPT_CAFILE, '<', "Verify CRL using certificates in file name" },
-    { "CAstore", OPT_CASTORE, ':', "Verify CRL using certificates in store URI" },
+    { "CAfile", OPT_CAFILE, '<', "File in PEM format with trusted CA certs" },
+    { "CApath", OPT_CAPATH, '/', "Dir with trusted CA cert files in PEM format" },
+    { "CAstore", OPT_CASTORE, ':', "URI of store with trusted CA certs" },
     { "no-CAfile", OPT_NOCAFILE, '-',
         "Do not load the default certificates file" },
     { "no-CApath", OPT_NOCAPATH, '-',
@@ -252,20 +252,20 @@ int crl_main(int argc, char **argv)
             goto end;
         ctx = X509_STORE_CTX_new();
         if (ctx == NULL || !X509_STORE_CTX_init(ctx, store, NULL, NULL)) {
-            BIO_printf(bio_err, "Error initialising X509 store\n");
+            BIO_puts(bio_err, "Error initialising X509 store\n");
             goto end;
         }

         xobj = X509_STORE_CTX_get_obj_by_subject(ctx, X509_LU_X509,
             X509_CRL_get_issuer(x));
         if (xobj == NULL) {
-            BIO_printf(bio_err, "Error getting CRL issuer certificate\n");
+            BIO_puts(bio_err, "Error getting CRL issuer certificate\n");
             goto end;
         }
         pkey = X509_get_pubkey(X509_OBJECT_get0_X509(xobj));
         X509_OBJECT_free(xobj);
         if (pkey == NULL) {
-            BIO_printf(bio_err, "Error getting CRL issuer public key\n");
+            BIO_puts(bio_err, "Error getting CRL issuer public key\n");
             goto end;
         }
         i = X509_CRL_verify(x, pkey);
@@ -273,10 +273,10 @@ int crl_main(int argc, char **argv)
         if (i < 0)
             goto end;
         if (i == 0) {
-            BIO_printf(bio_err, "verify failure\n");
+            BIO_puts(bio_err, "verify failure\n");
             goto end;
         } else
-            BIO_printf(bio_err, "verify OK\n");
+            BIO_puts(bio_err, "verify OK\n");
     }

     if (crldiff != NULL) {
@@ -288,7 +288,7 @@ int crl_main(int argc, char **argv)
         newcrl = load_crl(crldiff, informat, 0, "other CRL");
         if (!newcrl)
             goto end;
-        pkey = load_key(keyfile, keyformat, 0, NULL, NULL, "CRL signing key");
+        pkey = load_key(keyfile, keyformat, 0, NULL, "CRL signing key");
         if (pkey == NULL) {
             X509_CRL_free(newcrl);
             goto end;
@@ -309,7 +309,11 @@ int crl_main(int argc, char **argv)
         const ASN1_BIT_STRING *sig;

         X509_CRL_get0_signature(x, &sig, NULL);
-        corrupt_signature(sig);
+        /* XXX Casts away const, because it mutates the value! */
+        if (!corrupt_signature((ASN1_BIT_STRING *)sig)) {
+            BIO_puts(bio_err, "Error corrupting signature\n");
+            goto end;
+        }
     }

     if (num) {
@@ -321,7 +325,7 @@ int crl_main(int argc, char **argv)
                 ASN1_INTEGER *crlnum;

                 crlnum = X509_CRL_get_ext_d2i(x, NID_crl_number, NULL, NULL);
-                BIO_printf(bio_out, "crlNumber=");
+                BIO_puts(bio_out, "crlNumber=");
                 if (crlnum) {
                     BIO_puts(bio_out, "0x");
                     i2a_ASN1_INTEGER(bio_out, crlnum);
@@ -329,7 +333,7 @@ int crl_main(int argc, char **argv)
                 } else {
                     BIO_puts(bio_out, "<NONE>");
                 }
-                BIO_printf(bio_out, "\n");
+                BIO_puts(bio_out, "\n");
             }
             if (hash == i) {
                 int ok;
@@ -337,7 +341,7 @@ int crl_main(int argc, char **argv)
                     app_get0_propq(), &ok);

                 if (num > 1)
-                    BIO_printf(bio_out, "issuer name hash=");
+                    BIO_puts(bio_out, "issuer name hash=");
                 if (ok) {
                     BIO_printf(bio_out, "%08lx\n", hash_value);
                 } else {
@@ -348,23 +352,23 @@ int crl_main(int argc, char **argv)
 #ifndef OPENSSL_NO_MD5
             if (hash_old == i) {
                 if (num > 1)
-                    BIO_printf(bio_out, "issuer name old hash=");
+                    BIO_puts(bio_out, "issuer name old hash=");
                 BIO_printf(bio_out, "%08lx\n",
                     X509_NAME_hash_old(X509_CRL_get_issuer(x)));
             }
 #endif
             if (lastupdate == i) {
-                BIO_printf(bio_out, "lastUpdate=");
+                BIO_puts(bio_out, "lastUpdate=");
                 ASN1_TIME_print_ex(bio_out, X509_CRL_get0_lastUpdate(x), dateopt);
-                BIO_printf(bio_out, "\n");
+                BIO_puts(bio_out, "\n");
             }
             if (nextupdate == i) {
-                BIO_printf(bio_out, "nextUpdate=");
+                BIO_puts(bio_out, "nextUpdate=");
                 if (X509_CRL_get0_nextUpdate(x))
                     ASN1_TIME_print_ex(bio_out, X509_CRL_get0_nextUpdate(x), dateopt);
                 else
-                    BIO_printf(bio_out, "NONE");
-                BIO_printf(bio_out, "\n");
+                    BIO_puts(bio_out, "NONE");
+                BIO_puts(bio_out, "\n");
             }
             if (fingerprint == i) {
                 int j;
@@ -372,7 +376,7 @@ int crl_main(int argc, char **argv)
                 unsigned char md[EVP_MAX_MD_SIZE];

                 if (!X509_CRL_digest(x, digest, md, &n)) {
-                    BIO_printf(bio_err, "out of memory\n");
+                    BIO_puts(bio_err, "out of memory\n");
                     goto end;
                 }
                 BIO_printf(bio_out, "%s Fingerprint=",
@@ -400,7 +404,7 @@ int crl_main(int argc, char **argv)
     else
         i = PEM_write_bio_X509_CRL(out, x);
     if (!i) {
-        BIO_printf(bio_err, "unable to write CRL\n");
+        BIO_puts(bio_err, "unable to write CRL\n");
         goto end;
     }
     ret = 0;
diff --git a/deps/openssl/openssl/apps/crl2pkcs7.c b/deps/openssl/openssl/apps/crl2pkcs7.c
index 72d385250ac..8b61a37e459 100644
--- a/deps/openssl/openssl/apps/crl2pkcs7.c
+++ b/deps/openssl/openssl/apps/crl2pkcs7.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -121,7 +121,7 @@ int crl2pkcs7_main(int argc, char **argv)
         else if (informat == FORMAT_PEM)
             crl = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL);
         if (crl == NULL) {
-            BIO_printf(bio_err, "unable to load CRL\n");
+            BIO_puts(bio_err, "unable to load CRL\n");
             ERR_print_errors(bio_err);
             goto end;
         }
@@ -156,7 +156,7 @@ int crl2pkcs7_main(int argc, char **argv)
         for (i = 0; i < sk_OPENSSL_STRING_num(certflst); i++) {
             certfile = sk_OPENSSL_STRING_value(certflst, i);
             if (add_certs_from_file(cert_stack, certfile) < 0) {
-                BIO_printf(bio_err, "error loading certificates\n");
+                BIO_puts(bio_err, "error loading certificates\n");
                 ERR_print_errors(bio_err);
                 goto end;
             }
@@ -172,7 +172,7 @@ int crl2pkcs7_main(int argc, char **argv)
     else if (outformat == FORMAT_PEM)
         i = PEM_write_bio_PKCS7(out, p7);
     if (!i) {
-        BIO_printf(bio_err, "unable to write pkcs7 object\n");
+        BIO_puts(bio_err, "unable to write pkcs7 object\n");
         ERR_print_errors(bio_err);
         goto end;
     }
diff --git a/deps/openssl/openssl/apps/dgst.c b/deps/openssl/openssl/apps/dgst.c
index 623564e5610..9185307cda5 100644
--- a/deps/openssl/openssl/apps/dgst.c
+++ b/deps/openssl/openssl/apps/dgst.c
@@ -7,10 +7,10 @@
  * https://www.openssl.org/source/license.html
  */

+#include "apps.h"
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include "apps.h"
 #include "progs.h"
 #include <openssl/bio.h>
 #include <openssl/err.h>
@@ -20,6 +20,7 @@
 #include <openssl/pem.h>
 #include <openssl/hmac.h>
 #include <ctype.h>
+#include <sys/stat.h>

 #undef BUFSIZE
 #define BUFSIZE 1024 * 8
@@ -50,13 +51,13 @@ typedef enum OPTION_choice {
     OPT_PRVERIFY,
     OPT_SIGNATURE,
     OPT_KEYFORM,
-    OPT_ENGINE,
-    OPT_ENGINE_IMPL,
     OPT_HEX,
     OPT_BINARY,
     OPT_DEBUG,
     OPT_FIPS_FINGERPRINT,
     OPT_HMAC,
+    OPT_HMAC_ENV,
+    OPT_HMAC_STDIN,
     OPT_MAC,
     OPT_SIGOPT,
     OPT_MACOPT,
@@ -72,18 +73,13 @@ const OPTIONS dgst_options[] = {
     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
     { "list", OPT_LIST, '-', "List digests" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device" },
-    { "engine_impl", OPT_ENGINE_IMPL, '-',
-        "Also use engine given by -engine for digest operations" },
-#endif
     { "passin", OPT_PASSIN, 's', "Input file pass phrase source" },

     OPT_SECTION("Output"),
     { "c", OPT_C, '-', "Print the digest with separating colons" },
     { "r", OPT_R, '-', "Print the digest in coreutils format" },
     { "out", OPT_OUT, '>', "Output to filename rather than stdout" },
-    { "keyform", OPT_KEYFORM, 'f', "Key file format (ENGINE, other values ignored)" },
+    { "keyform", OPT_KEYFORM, 'f', "Key file format (DER/PEM)" },
     { "hex", OPT_HEX, '-', "Print as hex dump" },
     { "binary", OPT_BINARY, '-', "Print in binary form" },
     { "xoflen", OPT_XOFLEN, 'p', "Output length for XOF algorithms. To obtain the maximum security strength set this to 32 (or greater) for SHAKE128, and 64 (or greater) for SHAKE256" },
@@ -97,6 +93,8 @@ const OPTIONS dgst_options[] = {
     { "sigopt", OPT_SIGOPT, 's', "Signature parameter in n:v form" },
     { "signature", OPT_SIGNATURE, '<', "File with signature to verify" },
     { "hmac", OPT_HMAC, 's', "Create hashed MAC with key" },
+    { "hmac-env", OPT_HMAC_ENV, 's', "Create hashed MAC with key from environment variable" },
+    { "hmac-stdin", OPT_HMAC_STDIN, '-', "Create hashed MAC with key from stdin" },
     { "mac", OPT_MAC, 's', "Create MAC (not necessarily HMAC)" },
     { "macopt", OPT_MACOPT, 's', "MAC algorithm parameters in n:v form or key" },
     { "", OPT_DIGEST, '-', "Any supported digest" },
@@ -114,7 +112,6 @@ const OPTIONS dgst_options[] = {
 int dgst_main(int argc, char **argv)
 {
     BIO *in = NULL, *inp = NULL, *bmd = NULL, *out = NULL;
-    ENGINE *e = NULL, *impl = NULL;
     EVP_PKEY *sigkey = NULL;
     STACK_OF(OPENSSL_STRING) *sigopts = NULL, *macopts = NULL;
     char *hmac_key = NULL;
@@ -124,18 +121,20 @@ int dgst_main(int argc, char **argv)
     const char *outfile = NULL, *keyfile = NULL, *prog = NULL;
     const char *sigfile = NULL;
     const char *md_name = NULL;
+    char *env_var = NULL;
+    char *new_opt = NULL;
+    char *key_from_stdin = NULL;
     OPTION_CHOICE o;
     int separator = 0, debug = 0, keyform = FORMAT_UNDEF, siglen = 0;
     int i, ret = EXIT_FAILURE, out_bin = -1, want_pub = 0, do_verify = 0;
     int xoflen = 0;
     unsigned char *buf = NULL, *sigbuf = NULL;
-    int engine_impl = 0;
     struct doall_dgst_digests dec;
     EVP_MD_CTX *signctx = NULL;
     int oneshot_sign = 0;

     buf = app_malloc(BUFSIZE, "I/O buffer");
-    md = (EVP_MD *)EVP_get_digestbyname(argv[0]);
+    md = EVP_MD_fetch(app_get0_libctx(), argv[0], app_get0_propq());
     if (md != NULL)
         digestname = argv[0];

@@ -153,12 +152,12 @@ int dgst_main(int argc, char **argv)
             ret = EXIT_SUCCESS;
             goto end;
         case OPT_LIST:
-            BIO_printf(bio_out, "Supported digests:\n");
+            BIO_puts(bio_out, "Supported digests:\n");
             dec.bio = bio_out;
             dec.n = 0;
             OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_MD_METH,
                 show_digests, &dec);
-            BIO_printf(bio_out, "\n");
+            BIO_puts(bio_out, "\n");
             ret = EXIT_SUCCESS;
             goto end;
         case OPT_C:
@@ -195,12 +194,6 @@ int dgst_main(int argc, char **argv)
             if (!opt_format(opt_arg(), OPT_FMT_ANY, &keyform))
                 goto opthelp;
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
-        case OPT_ENGINE_IMPL:
-            engine_impl = 1;
-            break;
         case OPT_HEX:
             out_bin = 0;
             break;
@@ -208,7 +201,7 @@ int dgst_main(int argc, char **argv)
             out_bin = 1;
             break;
         case OPT_XOFLEN:
-            xoflen = atoi(opt_arg());
+            xoflen = opt_int_arg();
             break;
         case OPT_DEBUG:
             debug = 1;
@@ -219,6 +212,29 @@ int dgst_main(int argc, char **argv)
         case OPT_HMAC:
             hmac_key = opt_arg();
             break;
+        case OPT_HMAC_ENV:
+            env_var = opt_arg();
+            hmac_key = getenv(env_var);
+            if (hmac_key == NULL) {
+                BIO_printf(bio_err, "No environment variable %s\n", env_var);
+                ret = EXIT_FAILURE;
+                goto end;
+            }
+            break;
+        case OPT_HMAC_STDIN:
+            if (key_from_stdin == NULL)
+                key_from_stdin = get_str_from_file(NULL);
+            if (key_from_stdin == NULL) {
+                ret = EXIT_FAILURE;
+                goto end;
+            }
+            if (strlen(key_from_stdin) == 0) {
+                BIO_printf(bio_err, "Empty key\n");
+                ret = EXIT_FAILURE;
+                goto end;
+            }
+            hmac_key = key_from_stdin;
+            break;
         case OPT_MAC:
             mac_name = opt_arg();
             break;
@@ -229,10 +245,17 @@ int dgst_main(int argc, char **argv)
                 goto opthelp;
             break;
         case OPT_MACOPT:
+            new_opt = process_additional_mac_key_arguments(opt_arg());
+            if (new_opt == NULL) {
+                ret = EXIT_FAILURE;
+                goto end;
+            }
             if (!macopts)
                 macopts = sk_OPENSSL_STRING_new_null();
-            if (!macopts || !sk_OPENSSL_STRING_push(macopts, opt_arg()))
+            if (!macopts || !sk_OPENSSL_STRING_push(macopts, new_opt)) {
+                clear_free(new_opt);
                 goto opthelp;
+            }
             break;
         case OPT_DIGEST:
             digestname = opt_unknown();
@@ -260,12 +283,10 @@ int dgst_main(int argc, char **argv)
     }

     if (do_verify && sigfile == NULL) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "No signature to verify: use the -signature option\n");
         goto end;
     }
-    if (engine_impl)
-        impl = e;

     in = BIO_new(BIO_s_file());
     bmd = BIO_new(BIO_f_md());
@@ -279,7 +300,7 @@ int dgst_main(int argc, char **argv)
     }

     if (!app_passwd(passinarg, NULL, &passin, NULL)) {
-        BIO_printf(bio_err, "Error getting password\n");
+        BIO_puts(bio_err, "Error getting password\n");
         goto end;
     }

@@ -295,15 +316,15 @@ int dgst_main(int argc, char **argv)
         goto end;

     if ((!(mac_name == NULL) + !(keyfile == NULL) + !(hmac_key == NULL)) > 1) {
-        BIO_printf(bio_err, "MAC and signing key cannot both be specified\n");
+        BIO_puts(bio_err, "MAC and signing key cannot both be specified\n");
         goto end;
     }

     if (keyfile != NULL) {
         if (want_pub)
-            sigkey = load_pubkey(keyfile, keyform, 0, NULL, e, "public key");
+            sigkey = load_pubkey(keyfile, keyform, 0, NULL, "public key");
         else
-            sigkey = load_key(keyfile, keyform, 0, passin, e, "private key");
+            sigkey = load_key(keyfile, keyform, 0, passin, "private key");
         if (sigkey == NULL) {
             /*
              * load_[pub]key() has already printed an appropriate message
@@ -327,7 +348,7 @@ int dgst_main(int argc, char **argv)
     if (mac_name != NULL) {
         EVP_PKEY_CTX *mac_ctx = NULL;

-        if (!init_gen_str(&mac_ctx, mac_name, impl, 0, NULL, NULL))
+        if (!init_gen_str(&mac_ctx, mac_name, 0, NULL, NULL))
             goto end;
         if (macopts != NULL) {
             for (i = 0; i < sk_OPENSSL_STRING_num(macopts); i++) {
@@ -342,7 +363,6 @@ int dgst_main(int argc, char **argv)
         }

         sigkey = app_keygen(mac_ctx, mac_name, 0, 0 /* not verbose */);
-        /* Verbose output would make external-tests gost-engine fail */
         EVP_PKEY_CTX_free(mac_ctx);
         if (sigkey == NULL)
             goto end;
@@ -353,7 +373,7 @@ int dgst_main(int argc, char **argv)
             md = (EVP_MD *)EVP_sha256();
             digestname = SN_sha256;
         }
-        sigkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, impl,
+        sigkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, NULL,
             (unsigned char *)hmac_key,
             strlen(hmac_key));
         if (sigkey == NULL)
@@ -368,24 +388,19 @@ int dgst_main(int argc, char **argv)
         if (oneshot_sign) {
             mctx = signctx;
         } else if (BIO_get_md_ctx(bmd, &mctx) <= 0) {
-            BIO_printf(bio_err, "Error getting context\n");
+            BIO_puts(bio_err, "Error getting context\n");
             goto end;
         }
         if (do_verify)
-            if (impl == NULL)
-                res = EVP_DigestVerifyInit_ex(mctx, &pctx, digestname,
-                    app_get0_libctx(),
-                    app_get0_propq(), sigkey, NULL);
-            else
-                res = EVP_DigestVerifyInit(mctx, &pctx, md, impl, sigkey);
-        else if (impl == NULL)
-            res = EVP_DigestSignInit_ex(mctx, &pctx, digestname,
+            res = EVP_DigestVerifyInit_ex(mctx, &pctx, digestname,
                 app_get0_libctx(),
                 app_get0_propq(), sigkey, NULL);
         else
-            res = EVP_DigestSignInit(mctx, &pctx, md, impl, sigkey);
+            res = EVP_DigestSignInit_ex(mctx, &pctx, digestname,
+                app_get0_libctx(),
+                app_get0_propq(), sigkey, NULL);
         if (res == 0) {
-            BIO_printf(bio_err, "Error setting context\n");
+            BIO_puts(bio_err, "Error setting context\n");
             goto end;
         }
         if (sigopts != NULL) {
@@ -405,17 +420,17 @@ int dgst_main(int argc, char **argv)
         EVP_MD_CTX *mctx = NULL;

         if (oneshot_sign) {
-            BIO_printf(bio_err, "Oneshot algorithms don't use a digest\n");
+            BIO_puts(bio_err, "Oneshot algorithms don't use a digest\n");
             goto end;
         }
         if (BIO_get_md_ctx(bmd, &mctx) <= 0) {
-            BIO_printf(bio_err, "Error getting context\n");
+            BIO_puts(bio_err, "Error getting context\n");
             goto end;
         }
         if (md == NULL)
             md = (EVP_MD *)EVP_sha256();
-        if (!EVP_DigestInit_ex(mctx, md, impl)) {
-            BIO_printf(bio_err, "Error setting digest\n");
+        if (!EVP_DigestInit_ex(mctx, md, NULL)) {
+            BIO_puts(bio_err, "Error setting digest\n");
             goto end;
         }
     }
@@ -450,7 +465,7 @@ int dgst_main(int argc, char **argv)
     }
     if (xoflen > 0) {
         if (!EVP_MD_xof(md)) {
-            BIO_printf(bio_err, "Length can only be specified for XOF\n");
+            BIO_puts(bio_err, "Length can only be specified for XOF\n");
             goto end;
         }
         /*
@@ -459,7 +474,7 @@ int dgst_main(int argc, char **argv)
          * and verify_final methods.
          */
         if (sigkey != NULL) {
-            BIO_printf(bio_err, "Signing key cannot be specified for XOF\n");
+            BIO_puts(bio_err, "Signing key cannot be specified for XOF\n");
             goto end;
         }
     }
@@ -468,10 +483,14 @@ int dgst_main(int argc, char **argv)
         BIO_set_fp(in, stdin, BIO_NOCLOSE);
         if (oneshot_sign)
             ret = do_fp_oneshot_sign(out, signctx, in, separator, out_bin,
-                sigkey, sigbuf, siglen, NULL, "stdin");
+                      sigkey, sigbuf, siglen, NULL, NULL)
+                ? EXIT_SUCCESS
+                : EXIT_FAILURE;
         else
             ret = do_fp(out, buf, inp, separator, out_bin, xoflen,
-                sigkey, sigbuf, siglen, NULL, md_name, "stdin");
+                      sigkey, sigbuf, siglen, NULL, md_name, "stdin")
+                ? EXIT_SUCCESS
+                : EXIT_FAILURE;
     } else {
         const char *sig_name = NULL;

@@ -487,12 +506,12 @@ int dgst_main(int argc, char **argv)
                 continue;
             } else {
                 if (oneshot_sign) {
-                    if (do_fp_oneshot_sign(out, signctx, in, separator, out_bin,
+                    if (!do_fp_oneshot_sign(out, signctx, in, separator, out_bin,
                             sigkey, sigbuf, siglen, sig_name,
                             argv[i]))
                         ret = EXIT_FAILURE;
                 } else {
-                    if (do_fp(out, buf, inp, separator, out_bin, xoflen,
+                    if (!do_fp(out, buf, inp, separator, out_bin, xoflen,
                             sigkey, sigbuf, siglen, sig_name, md_name, argv[i]))
                         ret = EXIT_FAILURE;
                 }
@@ -504,6 +523,8 @@ end:
     if (ret != EXIT_SUCCESS)
         ERR_print_errors(bio_err);
     OPENSSL_clear_free(buf, BUFSIZE);
+    if (key_from_stdin != NULL)
+        clear_free(key_from_stdin);
     BIO_free(in);
     OPENSSL_free(passin);
     BIO_free_all(out);
@@ -511,10 +532,9 @@ end:
     EVP_PKEY_free(sigkey);
     EVP_MD_CTX_free(signctx);
     sk_OPENSSL_STRING_free(sigopts);
-    sk_OPENSSL_STRING_free(macopts);
+    sk_OPENSSL_STRING_pop_free(macopts, clear_free);
     OPENSSL_free(sigbuf);
     BIO_free(bmd);
-    release_engine(e);
     return ret;
 }

@@ -532,17 +552,15 @@ static void show_digests(const OBJ_NAME *name, void *arg)

     /* Filter out message digests that we cannot use */
     md = EVP_MD_fetch(app_get0_libctx(), name->name, app_get0_propq());
-    if (md == NULL) {
-        if (EVP_get_digestbyname(name->name) == NULL)
-            return;
-    }
+    if (md == NULL)
+        return;

     BIO_printf(dec->bio, "-%-25s", name->name);
     if (++dec->n == 3) {
-        BIO_printf(dec->bio, "\n");
+        BIO_puts(dec->bio, "\n");
         dec->n = 0;
     } else {
-        BIO_printf(dec->bio, " ");
+        BIO_puts(dec->bio, " ");
     }

     EVP_MD_free(md);
@@ -593,7 +611,7 @@ static void print_out(BIO *out, unsigned char *buf, size_t len,
     int i, backslash = 0;

     if (binout) {
-        BIO_write(out, buf, len);
+        BIO_write(out, buf, (int)len);
     } else if (sep == 2) {
         file = newline_escape_filename(file, &backslash);

@@ -618,30 +636,34 @@ static void print_out(BIO *out, unsigned char *buf, size_t len,
         }
         for (i = 0; i < (int)len; i++) {
             if (sep && (i != 0))
-                BIO_printf(out, ":");
+                BIO_puts(out, ":");
             BIO_printf(out, "%02x", buf[i]);
         }
-        BIO_printf(out, "\n");
+        BIO_puts(out, "\n");
     }
 }

 static void print_verify_result(BIO *out, int i)
 {
     if (i > 0)
-        BIO_printf(out, "Verified OK\n");
+        BIO_puts(out, "Verified OK\n");
     else if (i == 0)
-        BIO_printf(out, "Verification failure\n");
+        BIO_puts(out, "Verification failure\n");
     else
-        BIO_printf(bio_err, "Error verifying data\n");
+        BIO_puts(bio_err, "Error verifying data\n");
 }

+/*
+ * Returns 1 on success, 0 on failure.  Do not use EXIT_SUCCESS / EXIT_FAILURE
+ * here; reserve those for main() and exit(3) (issue #30562).
+ */
 int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, int xoflen,
     EVP_PKEY *key, unsigned char *sigin, int siglen,
     const char *sig_name, const char *md_name,
     const char *file)
 {
     size_t len = BUFSIZE;
-    int i, ret = EXIT_FAILURE;
+    int i, ret = 0;
     unsigned char *allocated_buf = NULL;

     while (BIO_pending(bp) || !BIO_eof(bp)) {
@@ -659,7 +681,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, int xoflen
         i = EVP_DigestVerifyFinal(ctx, sigin, (unsigned int)siglen);
         print_verify_result(out, i);
         if (i > 0)
-            ret = EXIT_SUCCESS;
+            ret = 1;
         goto end;
     }
     if (key != NULL) {
@@ -668,7 +690,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, int xoflen

         BIO_get_md_ctx(bp, &ctx);
         if (!EVP_DigestSignFinal(ctx, NULL, &tmplen)) {
-            BIO_printf(bio_err, "Error getting maximum length of signed data\n");
+            BIO_puts(bio_err, "Error getting maximum length of signed data\n");
             goto end;
         }
         if (tmplen > BUFSIZE) {
@@ -677,7 +699,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, int xoflen
             buf = allocated_buf;
         }
         if (!EVP_DigestSignFinal(ctx, buf, &len)) {
-            BIO_printf(bio_err, "Error signing data\n");
+            BIO_puts(bio_err, "Error signing data\n");
             goto end;
         }
     } else if (xoflen > 0) {
@@ -692,7 +714,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, int xoflen
         BIO_get_md_ctx(bp, &ctx);

         if (!EVP_DigestFinalXOF(ctx, buf, len)) {
-            BIO_printf(bio_err, "Error Digesting Data\n");
+            BIO_puts(bio_err, "Error Digesting Data\n");
             goto end;
         }
     } else {
@@ -701,7 +723,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, int xoflen
             goto end;
     }
     print_out(out, buf, len, sep, binout, sig_name, md_name, file);
-    ret = EXIT_SUCCESS;
+    ret = 1;
 end:
     if (allocated_buf != NULL)
         OPENSSL_clear_free(allocated_buf, len);
@@ -709,53 +731,87 @@ end:
     return ret;
 }

+/*
+ * Perform one-shot verify or sign on a contiguous data buffer.
+ * Returns 0 on failure, 1 on success.
+ */
+static int do_oneshot_verify_sign(EVP_MD_CTX *ctx, BIO *out,
+    unsigned char *sigin, int siglen, EVP_PKEY *key,
+    const unsigned char *data, size_t len,
+    int sep, int binout, const char *sig_name, const char *file)
+{
+    int res;
+    size_t siglen_out = 0;
+    unsigned char *sig = NULL;
+
+    if (sigin != NULL) {
+        res = EVP_DigestVerify(ctx, sigin, siglen, data, len);
+        print_verify_result(out, res);
+        return res > 0;
+    }
+    if (key != NULL) {
+        if (EVP_DigestSign(ctx, NULL, &siglen_out, data, len) != 1) {
+            BIO_puts(bio_err, "Error getting maximum length of signed data\n");
+            return 0;
+        }
+        sig = app_malloc(siglen_out, "Signature buffer");
+        if (EVP_DigestSign(ctx, sig, &siglen_out, data, len) != 1) {
+            BIO_puts(bio_err, "Error signing data\n");
+            OPENSSL_free(sig);
+            return 0;
+        }
+        print_out(out, sig, siglen_out, sep, binout, sig_name, NULL, file);
+        OPENSSL_free(sig);
+        return 1;
+    }
+    BIO_puts(bio_err, "key must be set for one-shot algorithms\n");
+    return 0;
+}
+
 /*
  * Some new algorithms only support one shot operations.
  * For these we need to buffer all input and then do the sign on the
  * total buffered input. These algorithms set a NULL digest name which is
  * then used inside EVP_DigestVerify() and EVP_DigestSign().
+ * Returns 1 on success, 0 on failure.  Do not use EXIT_SUCCESS / EXIT_FAILURE
+ * here; reserve those for main() and exit(3) (issue #30562).
  */
 static int do_fp_oneshot_sign(BIO *out, EVP_MD_CTX *ctx, BIO *in, int sep, int binout,
     EVP_PKEY *key, unsigned char *sigin, int siglen,
     const char *sig_name, const char *file)
 {
-    int res, ret = EXIT_FAILURE;
-    size_t len = 0;
+    int ret = 0;
     size_t buflen = 0;
     size_t maxlen = 16 * 1024 * 1024;
-    uint8_t *buf = NULL, *sig = NULL;
-
-    if (!bio_to_mem(&buf, &buflen, maxlen, in)) {
-        BIO_printf(bio_err, "Read error in %s\n", file);
-        return ret;
-    }
-    if (sigin != NULL) {
-        res = EVP_DigestVerify(ctx, sigin, siglen, buf, buflen);
-        print_verify_result(out, res);
-        if (res > 0)
-            ret = EXIT_SUCCESS;
-        goto end;
-    }
-    if (key != NULL) {
-        if (EVP_DigestSign(ctx, NULL, &len, buf, buflen) != 1) {
-            BIO_printf(bio_err, "Error getting maximum length of signed data\n");
-            goto end;
-        }
-        sig = app_malloc(len, "Signature buffer");
-        if (EVP_DigestSign(ctx, sig, &len, buf, buflen) != 1) {
-            BIO_printf(bio_err, "Error signing data\n");
-            goto end;
+    uint8_t *buf = NULL;
+
+#if defined(OPENSSL_SYS_UNIX) && defined(_POSIX_MAPPED_FILES) && _POSIX_MAPPED_FILES > 0
+    if (file != NULL) {
+        const unsigned char *data = NULL;
+        size_t filesize = 0;
+        int r = app_mmap_file(file, bio_err, (size_t)-1, &data, &filesize);
+
+        if (r == 1) {
+            ret = do_oneshot_verify_sign(ctx, out, sigin, siglen, key, data,
+                filesize, sep, binout, sig_name, file);
+            munmap((void *)data, filesize);
+            return ret;
         }
-        print_out(out, sig, len, sep, binout, sig_name, NULL, file);
-        ret = EXIT_SUCCESS;
-    } else {
-        BIO_printf(bio_err, "key must be set for one-shot algorithms\n");
-        goto end;
+        if (r == -1)
+            return 0; /* error already printed */
+        /* r == 0: empty file, fall through to buffer path */
     }
+#endif

-end:
-    OPENSSL_free(sig);
-    OPENSSL_clear_free(buf, buflen);
+    {
+        const char *display_file = file != NULL ? file : "stdin";
+
+        if (!bio_to_mem(&buf, &buflen, maxlen, in))
+            return 0;
+        ret = do_oneshot_verify_sign(ctx, out, sigin, siglen, key, buf, buflen,
+            sep, binout, sig_name, display_file);
+        OPENSSL_clear_free(buf, buflen);
+    }

     return ret;
 }
diff --git a/deps/openssl/openssl/apps/dhparam.c b/deps/openssl/openssl/apps/dhparam.c
index f8838abe63d..3c78ac377b8 100644
--- a/deps/openssl/openssl/apps/dhparam.c
+++ b/deps/openssl/openssl/apps/dhparam.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -40,7 +40,6 @@ typedef enum OPTION_choice {
     OPT_OUTFORM,
     OPT_IN,
     OPT_OUT,
-    OPT_ENGINE,
     OPT_CHECK,
     OPT_TEXT,
     OPT_NOOUT,
@@ -64,9 +63,6 @@ const OPTIONS dhparam_options[] = {
     { "dsaparam", OPT_DSAPARAM, '-',
         "Read or generate DSA parameters, convert to DH" },
 #endif
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device" },
-#endif

     OPT_SECTION("Input"),
     { "in", OPT_IN, '<', "Input file" },
@@ -97,7 +93,6 @@ int dhparam_main(int argc, char **argv)
     EVP_PKEY *pkey = NULL, *tmppkey = NULL;
     EVP_PKEY_CTX *ctx = NULL;
     char *infile = NULL, *outfile = NULL, *prog;
-    ENGINE *e = NULL;
     int dsaparam = 0;
     int text = 0, ret = 1, num = 0, g = 0;
     int informat = FORMAT_PEM, outformat = FORMAT_PEM, check = 0, noout = 0;
@@ -129,9 +124,6 @@ int dhparam_main(int argc, char **argv)
         case OPT_OUT:
             outfile = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_CHECK:
             check = 1;
             break;
@@ -186,7 +178,7 @@ int dhparam_main(int argc, char **argv)
         num = DEFBITS;

     if (dsaparam && g) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Error, generator may not be chosen for DSA parameters\n");
         goto end;
     }
@@ -226,16 +218,16 @@ int dhparam_main(int argc, char **argv)

         if (dsaparam) {
             if (EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, num) <= 0) {
-                BIO_printf(bio_err, "Error, unable to set DSA prime length\n");
+                BIO_puts(bio_err, "Error, unable to set DSA prime length\n");
                 goto end;
             }
         } else {
             if (EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, num) <= 0) {
-                BIO_printf(bio_err, "Error, unable to set DH prime length\n");
+                BIO_puts(bio_err, "Error, unable to set DH prime length\n");
                 goto end;
             }
             if (EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, g) <= 0) {
-                BIO_printf(bio_err, "Error, unable to set generator\n");
+                BIO_puts(bio_err, "Error, unable to set generator\n");
                 goto end;
             }
         }
@@ -309,13 +301,13 @@ int dhparam_main(int argc, char **argv)
             OSSL_DECODER_CTX_free(decoderctx);
         } while (!done);
         if (tmppkey == NULL) {
-            BIO_printf(bio_err, "Error, unable to load parameters\n");
+            BIO_puts(bio_err, "Error, unable to load parameters\n");
             goto end;
         }

         if (dsaparam) {
             if (!EVP_PKEY_is_a(tmppkey, "DSA")) {
-                BIO_printf(bio_err, "Error, unable to load DSA parameters\n");
+                BIO_puts(bio_err, "Error, unable to load DSA parameters\n");
                 goto end;
             }
             pkey = dsa_to_dh(tmppkey);
@@ -324,7 +316,7 @@ int dhparam_main(int argc, char **argv)
         } else {
             if (!EVP_PKEY_is_a(tmppkey, "DH")
                 && !EVP_PKEY_is_a(tmppkey, "DHX")) {
-                BIO_printf(bio_err, "Error, unable to load DH parameters\n");
+                BIO_puts(bio_err, "Error, unable to load DH parameters\n");
                 goto end;
             }
             pkey = tmppkey;
@@ -342,14 +334,14 @@ int dhparam_main(int argc, char **argv)
     if (check) {
         ctx = EVP_PKEY_CTX_new_from_pkey(app_get0_libctx(), pkey, app_get0_propq());
         if (ctx == NULL) {
-            BIO_printf(bio_err, "Error, failed to check DH parameters\n");
+            BIO_puts(bio_err, "Error, failed to check DH parameters\n");
             goto end;
         }
         if (EVP_PKEY_param_check(ctx) <= 0) {
-            BIO_printf(bio_err, "Error, invalid parameters generated\n");
+            BIO_puts(bio_err, "Error, invalid parameters generated\n");
             goto end;
         }
-        BIO_printf(bio_err, "DH parameters appear to be ok.\n");
+        BIO_puts(bio_err, "DH parameters appear to be ok.\n");
     }

     if (!noout) {
@@ -362,7 +354,7 @@ int dhparam_main(int argc, char **argv)

         if (ectx == NULL || !OSSL_ENCODER_to_bio(ectx, out)) {
             OSSL_ENCODER_CTX_free(ectx);
-            BIO_printf(bio_err, "Error, unable to write DH parameters\n");
+            BIO_puts(bio_err, "Error, unable to write DH parameters\n");
             goto end;
         }
         OSSL_ENCODER_CTX_free(ectx);
@@ -376,7 +368,6 @@ end:
     EVP_PKEY_free(pkey);
     EVP_PKEY_free(tmppkey);
     EVP_PKEY_CTX_free(ctx);
-    release_engine(e);
     return ret;
 }

@@ -396,7 +387,7 @@ static EVP_PKEY *dsa_to_dh(EVP_PKEY *dh)
     if (!EVP_PKEY_get_bn_param(dh, OSSL_PKEY_PARAM_FFC_P, &bn_p)
         || !EVP_PKEY_get_bn_param(dh, OSSL_PKEY_PARAM_FFC_Q, &bn_q)
         || !EVP_PKEY_get_bn_param(dh, OSSL_PKEY_PARAM_FFC_G, &bn_g)) {
-        BIO_printf(bio_err, "Error, failed to set DH parameters\n");
+        BIO_puts(bio_err, "Error, failed to set DH parameters\n");
         goto err;
     }

@@ -408,7 +399,7 @@ static EVP_PKEY *dsa_to_dh(EVP_PKEY *dh)
         || !OSSL_PARAM_BLD_push_BN(tmpl, OSSL_PKEY_PARAM_FFC_G,
             bn_g)
         || (params = OSSL_PARAM_BLD_to_param(tmpl)) == NULL) {
-        BIO_printf(bio_err, "Error, failed to set DH parameters\n");
+        BIO_puts(bio_err, "Error, failed to set DH parameters\n");
         goto err;
     }

@@ -416,7 +407,7 @@ static EVP_PKEY *dsa_to_dh(EVP_PKEY *dh)
     if (ctx == NULL
         || EVP_PKEY_fromdata_init(ctx) <= 0
         || EVP_PKEY_fromdata(ctx, &pkey, EVP_PKEY_KEY_PARAMETERS, params) <= 0) {
-        BIO_printf(bio_err, "Error, failed to set DH parameters\n");
+        BIO_puts(bio_err, "Error, failed to set DH parameters\n");
         goto err;
     }

diff --git a/deps/openssl/openssl/apps/dsa.c b/deps/openssl/openssl/apps/dsa.c
index fc2ef99adb3..95a1b432cc8 100644
--- a/deps/openssl/openssl/apps/dsa.c
+++ b/deps/openssl/openssl/apps/dsa.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -38,7 +38,6 @@ typedef enum OPTION_choice {
     OPT_OUTFORM,
     OPT_IN,
     OPT_OUT,
-    OPT_ENGINE,
     /* Do not change the order here; see case statements below */
     OPT_PVK_NONE,
     OPT_PVK_WEAK,
@@ -63,9 +62,6 @@ const OPTIONS dsa_options[] = {
     { "pvk-weak", OPT_PVK_WEAK, '-', "Enable 'Weak' PVK encoding level" },
     { "pvk-none", OPT_PVK_NONE, '-', "Don't enforce PVK encoding" },
 #endif
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device" },
-#endif

     OPT_SECTION("Input"),
     { "in", OPT_IN, 's', "Input key" },
@@ -89,7 +85,6 @@ const OPTIONS dsa_options[] = {
 int dsa_main(int argc, char **argv)
 {
     BIO *out = NULL;
-    ENGINE *e = NULL;
     EVP_PKEY *pkey = NULL;
     EVP_CIPHER *enc = NULL;
     char *infile = NULL, *outfile = NULL, *prog;
@@ -132,9 +127,6 @@ int dsa_main(int argc, char **argv)
         case OPT_OUT:
             outfile = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_PASSIN:
             passinarg = opt_arg();
             break;
@@ -182,23 +174,23 @@ int dsa_main(int argc, char **argv)
     private = !pubin && (!pubout || text);

     if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
-        BIO_printf(bio_err, "Error getting passwords\n");
+        BIO_puts(bio_err, "Error getting passwords\n");
         goto end;
     }

-    BIO_printf(bio_err, "read DSA key\n");
+    BIO_puts(bio_err, "read DSA key\n");
     if (pubin)
-        pkey = load_pubkey(infile, informat, 1, passin, e, "public key");
+        pkey = load_pubkey(infile, informat, 1, passin, "public key");
     else
-        pkey = load_key(infile, informat, 1, passin, e, "private key");
+        pkey = load_key(infile, informat, 1, passin, "private key");

     if (pkey == NULL) {
-        BIO_printf(bio_err, "unable to load Key\n");
+        BIO_puts(bio_err, "unable to load Key\n");
         ERR_print_errors(bio_err);
         goto end;
     }
     if (!EVP_PKEY_is_a(pkey, "DSA")) {
-        BIO_printf(bio_err, "Not a DSA key\n");
+        BIO_puts(bio_err, "Not a DSA key\n");
         goto end;
     }

@@ -223,9 +215,9 @@ int dsa_main(int argc, char **argv)
             ERR_print_errors(bio_err);
             goto end;
         }
-        BIO_printf(out, "Public Key=");
+        BIO_puts(out, "Public Key=");
         BN_print(out, pub_key);
-        BIO_printf(out, "\n");
+        BIO_puts(out, "\n");
         BN_free(pub_key);
     }

@@ -233,7 +225,7 @@ int dsa_main(int argc, char **argv)
         ret = 0;
         goto end;
     }
-    BIO_printf(bio_err, "writing DSA key\n");
+    BIO_puts(bio_err, "writing DSA key\n");
     if (outformat == FORMAT_ASN1) {
         output_type = "DER";
     } else if (outformat == FORMAT_PEM) {
@@ -242,12 +234,12 @@ int dsa_main(int argc, char **argv)
         output_type = "MSBLOB";
     } else if (outformat == FORMAT_PVK) {
         if (pubin) {
-            BIO_printf(bio_err, "PVK form impossible with public key input\n");
+            BIO_puts(bio_err, "PVK form impossible with public key input\n");
             goto end;
         }
         output_type = "PVK";
     } else {
-        BIO_printf(bio_err, "bad output format specified for outfile\n");
+        BIO_puts(bio_err, "bad output format specified for outfile\n");
         goto end;
     }

@@ -295,13 +287,13 @@ int dsa_main(int argc, char **argv)

         params[0] = OSSL_PARAM_construct_int("encrypt-level", &pvk_encr);
         if (!OSSL_ENCODER_CTX_set_params(ectx, params)) {
-            BIO_printf(bio_err, "invalid PVK encryption level\n");
+            BIO_puts(bio_err, "invalid PVK encryption level\n");
             goto end;
         }
     }

     if (!OSSL_ENCODER_to_bio(ectx, out)) {
-        BIO_printf(bio_err, "unable to write key\n");
+        BIO_puts(bio_err, "unable to write key\n");
         goto end;
     }
     ret = 0;
@@ -312,7 +304,6 @@ end:
     BIO_free_all(out);
     EVP_PKEY_free(pkey);
     EVP_CIPHER_free(enc);
-    release_engine(e);
     OPENSSL_free(passin);
     OPENSSL_free(passout);
     return ret;
diff --git a/deps/openssl/openssl/apps/dsaparam.c b/deps/openssl/openssl/apps/dsaparam.c
index 24e0f2c0fdb..8b07e5efea8 100644
--- a/deps/openssl/openssl/apps/dsaparam.c
+++ b/deps/openssl/openssl/apps/dsaparam.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -33,7 +33,6 @@ typedef enum OPTION_choice {
     OPT_TEXT,
     OPT_NOOUT,
     OPT_GENKEY,
-    OPT_ENGINE,
     OPT_VERBOSE,
     OPT_QUIET,
     OPT_R_ENUM,
@@ -45,9 +44,6 @@ const OPTIONS dsaparam_options[] = {

     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device" },
-#endif

     OPT_SECTION("Input"),
     { "in", OPT_IN, '<', "Input file" },
@@ -73,7 +69,6 @@ const OPTIONS dsaparam_options[] = {

 int dsaparam_main(int argc, char **argv)
 {
-    ENGINE *e = NULL;
     BIO *out = NULL;
     EVP_PKEY *params = NULL, *pkey = NULL;
     EVP_PKEY_CTX *ctx = NULL;
@@ -109,9 +104,6 @@ int dsaparam_main(int argc, char **argv)
         case OPT_OUT:
             outfile = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_TEXT:
             text = 1;
             break;
@@ -161,7 +153,7 @@ int dsaparam_main(int argc, char **argv)

     ctx = EVP_PKEY_CTX_new_from_name(app_get0_libctx(), "DSA", app_get0_propq());
     if (ctx == NULL) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Error, DSA parameter generation context allocation failed\n");
         goto end;
     }
@@ -175,23 +167,23 @@ int dsaparam_main(int argc, char **argv)
         EVP_PKEY_CTX_set_app_data(ctx, bio_err);
         if (verbose) {
             EVP_PKEY_CTX_set_cb(ctx, progress_cb);
-            BIO_printf(bio_err, "Generating DSA parameters, %d bit long prime\n",
+            BIO_printf(bio_err, "Generating DSA parameters, %d bit long prime\n"
+                                "This could take some time\n",
                 num);
-            BIO_printf(bio_err, "This could take some time\n");
         }
         if (EVP_PKEY_paramgen_init(ctx) <= 0) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Error, DSA key generation paramgen init failed\n");
             goto end;
         }
         if (EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, num) <= 0) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Error, DSA key generation setting bit length failed\n");
             goto end;
         }
         if (numqbits > 0) {
             if (EVP_PKEY_CTX_set_dsa_paramgen_q_bits(ctx, numqbits) <= 0) {
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "Error, DSA key generation setting subprime bit length failed\n");
                 goto end;
             }
@@ -222,7 +214,7 @@ int dsaparam_main(int argc, char **argv)
         else
             i = PEM_write_bio_Parameters(out, params);
         if (!i) {
-            BIO_printf(bio_err, "Error, unable to write DSA parameters\n");
+            BIO_puts(bio_err, "Error, unable to write DSA parameters\n");
             goto end;
         }
     }
@@ -236,7 +228,7 @@ int dsaparam_main(int argc, char **argv)
             goto end;
         }
         if (EVP_PKEY_keygen_init(ctx) <= 0) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Error, unable to initialise for key generation\n");
             goto end;
         }
@@ -248,6 +240,11 @@ int dsaparam_main(int argc, char **argv)
             i = i2d_PrivateKey_bio(out, pkey);
         else
             i = PEM_write_bio_PrivateKey(out, pkey, NULL, NULL, 0, NULL, NULL);
+        if (i <= 0) {
+            BIO_printf(bio_err,
+                "Error, unable to write DSA private key\n");
+            goto end;
+        }
     }
     ret = 0;
 end:
@@ -257,6 +254,5 @@ end:
     EVP_PKEY_CTX_free(ctx);
     EVP_PKEY_free(pkey);
     EVP_PKEY_free(params);
-    release_engine(e);
     return ret;
 }
diff --git a/deps/openssl/openssl/apps/ec.c b/deps/openssl/openssl/apps/ec.c
index dee1ef48e7e..8ed452a153b 100644
--- a/deps/openssl/openssl/apps/ec.c
+++ b/deps/openssl/openssl/apps/ec.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -25,7 +25,6 @@ typedef enum OPTION_choice {
     OPT_COMMON,
     OPT_INFORM,
     OPT_OUTFORM,
-    OPT_ENGINE,
     OPT_IN,
     OPT_OUT,
     OPT_NOOUT,
@@ -46,19 +45,16 @@ typedef enum OPTION_choice {
 const OPTIONS ec_options[] = {
     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif

     OPT_SECTION("Input"),
     { "in", OPT_IN, 's', "Input file" },
-    { "inform", OPT_INFORM, 'f', "Input format (DER/PEM/P12/ENGINE)" },
+    { "inform", OPT_INFORM, 'f', "Input format (DER/PEM/P12)" },
     { "pubin", OPT_PUBIN, '-', "Expect a public key in input file" },
     { "passin", OPT_PASSIN, 's', "Input file pass phrase source" },
     { "check", OPT_CHECK, '-', "check key consistency" },
     { "", OPT_CIPHER, '-', "Any supported cipher" },
     { "param_enc", OPT_PARAM_ENC, 's',
-        "Specifies the way the ec parameters are encoded" },
+        "Selects between named_curve and explicit EC parameter encoding" },
     { "conv_form", OPT_CONV_FORM, 's', "Specifies the point conversion form " },

     OPT_SECTION("Output"),
@@ -82,7 +78,6 @@ int ec_main(int argc, char **argv)
     EVP_PKEY_CTX *pctx = NULL;
     EVP_PKEY *eckey = NULL;
     BIO *out = NULL;
-    ENGINE *e = NULL;
     EVP_CIPHER *enc = NULL;
     char *infile = NULL, *outfile = NULL, *ciphername = NULL, *prog;
     char *passin = NULL, *passout = NULL, *passinarg = NULL, *passoutarg = NULL;
@@ -142,9 +137,6 @@ int ec_main(int argc, char **argv)
         case OPT_PASSOUT:
             passoutarg = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_CIPHER:
             ciphername = opt_unknown();
             break;
@@ -180,19 +172,17 @@ int ec_main(int argc, char **argv)
     private = !pubin && (text || (!param_out && !pubout));

     if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
-        BIO_printf(bio_err, "Error getting passwords\n");
+        BIO_puts(bio_err, "Error getting passwords\n");
         goto end;
     }

-    BIO_printf(bio_err, "read EC key\n");
-
     if (pubin)
-        eckey = load_pubkey(infile, informat, 1, passin, e, "public key");
+        eckey = load_pubkey(infile, informat, 1, passin, "public key");
     else
-        eckey = load_key(infile, informat, 1, passin, e, "private key");
+        eckey = load_key(infile, informat, 1, passin, "private key");

     if (eckey == NULL) {
-        BIO_printf(bio_err, "unable to load Key\n");
+        BIO_puts(bio_err, "unable to load Key\n");
         goto end;
     }

@@ -204,25 +194,25 @@ int ec_main(int argc, char **argv)
         && !EVP_PKEY_set_utf8_string_param(
             eckey, OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT,
             point_format)) {
-        BIO_printf(bio_err, "unable to set point conversion format\n");
+        BIO_puts(bio_err, "unable to set point conversion format\n");
         goto end;
     }

     if (asn1_encoding != NULL
         && !EVP_PKEY_set_utf8_string_param(
             eckey, OSSL_PKEY_PARAM_EC_ENCODING, asn1_encoding)) {
-        BIO_printf(bio_err, "unable to set asn1 encoding format\n");
+        BIO_puts(bio_err, "unable to set asn1 encoding format\n");
         goto end;
     }

     if (no_public) {
         if (!EVP_PKEY_set_int_param(eckey, OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, 0)) {
-            BIO_printf(bio_err, "unable to disable public key encoding\n");
+            BIO_puts(bio_err, "unable to disable public key encoding\n");
             goto end;
         }
     } else {
         if (!EVP_PKEY_set_int_param(eckey, OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, 1)) {
-            BIO_printf(bio_err, "unable to enable public key encoding\n");
+            BIO_puts(bio_err, "unable to enable public key encoding\n");
             goto end;
         }
     }
@@ -231,7 +221,7 @@ int ec_main(int argc, char **argv)
         assert(pubin || private);
         if ((pubin && EVP_PKEY_print_public(out, eckey, 0, NULL) <= 0)
             || (!pubin && EVP_PKEY_print_private(out, eckey, 0, NULL) <= 0)) {
-            BIO_printf(bio_err, "unable to print EC key\n");
+            BIO_puts(bio_err, "unable to print EC key\n");
             goto end;
         }
     }
@@ -239,13 +229,13 @@ int ec_main(int argc, char **argv)
     if (check) {
         pctx = EVP_PKEY_CTX_new_from_pkey(NULL, eckey, NULL);
         if (pctx == NULL) {
-            BIO_printf(bio_err, "unable to check EC key\n");
+            BIO_puts(bio_err, "unable to check EC key\n");
             goto end;
         }
         if (EVP_PKEY_check(pctx) <= 0)
-            BIO_printf(bio_err, "EC Key Invalid!\n");
+            BIO_puts(bio_err, "EC Key Invalid!\n");
         else
-            BIO_printf(bio_err, "EC Key valid.\n");
+            BIO_puts(bio_err, "EC Key valid.\n");
         ERR_print_errors(bio_err);
     }

@@ -254,7 +244,6 @@ int ec_main(int argc, char **argv)
         const char *output_type = outformat == FORMAT_ASN1 ? "DER" : "PEM";
         const char *output_structure = "type-specific";

-        BIO_printf(bio_err, "writing EC key\n");
         if (param_out) {
             selection = OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS;
         } else if (pubin || pubout) {
@@ -280,7 +269,7 @@ int ec_main(int argc, char **argv)
                     strlen(passout));
         }
         if (!OSSL_ENCODER_to_bio(ectx, out)) {
-            BIO_printf(bio_err, "unable to write EC key\n");
+            BIO_puts(bio_err, "unable to write EC key\n");
             goto end;
         }
     }
@@ -295,7 +284,6 @@ end:
     OSSL_ENCODER_CTX_free(ectx);
     OSSL_DECODER_CTX_free(dctx);
     EVP_PKEY_CTX_free(pctx);
-    release_engine(e);
     if (passin != NULL)
         OPENSSL_clear_free(passin, strlen(passin));
     if (passout != NULL)
diff --git a/deps/openssl/openssl/apps/ech.c b/deps/openssl/openssl/apps/ech.c
new file mode 100644
index 00000000000..fd037a3817e
--- /dev/null
+++ b/deps/openssl/openssl/apps/ech.c
@@ -0,0 +1,283 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "apps.h"
+#include "progs.h"
+#include <openssl/ssl.h>
+#include <openssl/bio.h>
+#include <openssl/evp.h>
+#include <openssl/err.h>
+#include <openssl/bn.h>
+#include <openssl/pem.h>
+#include <openssl/rand.h>
+#include <openssl/hpke.h>
+
+#include <openssl/objects.h>
+#include <openssl/x509.h>
+
+#ifndef OPENSSL_NO_ECH
+
+#define OSSL_ECH_KEYGEN_MODE 0 /* default: generate a key pair/ECHConfig */
+#define OSSL_ECH_SELPRINT_MODE 1 /* we can print/down-select ECHConfigList */
+#define OSSL_ECH_MAXINFILES 5 /* we'll only take this many inputs */
+
+typedef enum OPTION_choice {
+    /* standard openssl options */
+    OPT_ERR = -1,
+    OPT_EOF = 0,
+    OPT_HELP,
+    OPT_VERBOSE,
+    OPT_TEXT,
+    OPT_OUT,
+    OPT_IN,
+    /* ECHConfig specifics */
+    OPT_PUBLICNAME,
+    OPT_ECHVERSION,
+    OPT_MAXNAMELENGTH,
+    OPT_HPKESUITE,
+    OPT_SELECT
+} OPTION_CHOICE;
+
+const OPTIONS ech_options[] = {
+    OPT_SECTION("General options"),
+    { "help", OPT_HELP, '-', "Display this summary" },
+    { "verbose", OPT_VERBOSE, '-', "Provide additional output" },
+    { "text", OPT_TEXT, '-', "Provide human-readable output" },
+    OPT_SECTION("Key generation"),
+    { "out", OPT_OUT, '>',
+        "Private key and/or ECHConfig [default: echconfig.pem]" },
+    { "public_name", OPT_PUBLICNAME, 's', "public_name value" },
+    { "max_name_len", OPT_MAXNAMELENGTH, 'n',
+        "Maximum host name length value [default: 0]" },
+    { "suite", OPT_HPKESUITE, 's', "HPKE ciphersuite: e.g. \"0x20,1,3\"" },
+    { "ech_version", OPT_ECHVERSION, 'n',
+        "ECHConfig version [default: 0xff0d (13)]" },
+    OPT_SECTION("ECH PEM file downselect/display"),
+    { "in", OPT_IN, '<', "An ECH PEM file" },
+    { "select", OPT_SELECT, 'n', "Downselect to the numbered ECH config" },
+    { NULL }
+};
+
+/**
+ * @brief map version string like 0xff01 or 65291 to uint16_t
+ * @param arg is the version string, from command line
+ * @return is the uint16_t value (with zero for error cases)
+ */
+static uint16_t verstr2us(char *arg)
+{
+    long lv = strtol(arg, NULL, 0);
+    uint16_t rv = 0;
+
+    if (lv < 0xffff && lv > 0)
+        rv = (uint16_t)lv;
+    return rv;
+}
+
+int ech_main(int argc, char **argv)
+{
+    char *prog = NULL;
+    OPTION_CHOICE o;
+    int i, rv = 1, verbose = 0, text = 0, outsupp = 0;
+    int select = OSSL_ECHSTORE_ALL, numinfiles = 0;
+    char *outfile = NULL, *infile = NULL;
+    char *infiles[OSSL_ECH_MAXINFILES] = { NULL };
+    char *public_name = NULL, *suitestr = NULL;
+    uint16_t ech_version = OSSL_ECH_CURRENT_VERSION;
+    uint8_t max_name_length = 0;
+    OSSL_HPKE_SUITE hpke_suite = OSSL_HPKE_SUITE_DEFAULT;
+    int mode = OSSL_ECH_KEYGEN_MODE; /* key generation */
+    OSSL_ECHSTORE *es = NULL;
+    BIO *ecf = NULL;
+
+    prog = opt_init(argc, argv, ech_options);
+    while ((o = opt_next()) != OPT_EOF) {
+        switch (o) {
+        case OPT_EOF:
+        case OPT_ERR:
+            BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+            goto end;
+        case OPT_HELP:
+            opt_help(ech_options);
+            rv = 0;
+            goto end;
+        case OPT_VERBOSE:
+            verbose = 1;
+            break;
+        case OPT_TEXT:
+            text = 1;
+            break;
+        case OPT_SELECT:
+            mode = OSSL_ECH_SELPRINT_MODE;
+            select = strtol(opt_arg(), NULL, 10);
+            break;
+        case OPT_OUT:
+            outfile = opt_arg();
+            outsupp = 1;
+            break;
+        case OPT_IN:
+            mode = OSSL_ECH_SELPRINT_MODE;
+            infile = opt_arg();
+            if (numinfiles >= OSSL_ECH_MAXINFILES) {
+                BIO_printf(bio_err, "too many input files, only %d allowed\n",
+                    OSSL_ECH_MAXINFILES);
+                goto opthelp;
+            }
+            infiles[numinfiles] = infile;
+            numinfiles++;
+            break;
+        case OPT_PUBLICNAME:
+            public_name = opt_arg();
+            break;
+        case OPT_ECHVERSION:
+            ech_version = verstr2us(opt_arg());
+            break;
+        case OPT_MAXNAMELENGTH: {
+            long tmp = strtol(opt_arg(), NULL, 10);
+
+            if (tmp < 0 || tmp > OSSL_ECH_MAX_MAXNAMELEN) {
+                BIO_printf(bio_err,
+                    "max name length out of range [0,%d] (%ld)\n",
+                    OSSL_ECH_MAX_MAXNAMELEN, tmp);
+                goto opthelp;
+            } else {
+                max_name_length = (uint8_t)tmp;
+            }
+        } break;
+        case OPT_HPKESUITE:
+            suitestr = opt_arg();
+            break;
+        }
+    }
+    argc = opt_num_rest();
+    argv = opt_rest();
+    if (argc != 0) {
+        BIO_printf(bio_err, "%s: Unknown parameter %s\n", prog, argv[0]);
+        goto opthelp;
+    }
+    /* Check ECH-specific inputs */
+    switch (ech_version) {
+    case OSSL_ECH_RFC9849_VERSION: /* fall through */
+    case 13:
+        ech_version = OSSL_ECH_RFC9849_VERSION;
+        break;
+    default:
+        BIO_printf(bio_err, "Un-supported version (0x%04x)\n", ech_version);
+        goto end;
+    }
+    if (suitestr != NULL) {
+        if (OSSL_HPKE_str2suite(suitestr, &hpke_suite) != 1) {
+            BIO_printf(bio_err, "Bad OSSL_HPKE_SUITE (%s)\n", suitestr);
+            ERR_print_errors(bio_err);
+            goto end;
+        }
+    }
+    /* Set default if needed */
+    if (outfile == NULL)
+        outfile = "echconfig.pem";
+    es = OSSL_ECHSTORE_new(NULL, NULL);
+    if (es == NULL)
+        goto end;
+    if (mode == OSSL_ECH_KEYGEN_MODE) {
+        if (public_name == NULL) {
+            BIO_printf(bio_err, "public_name required\n");
+            goto end;
+        }
+        if (verbose)
+            BIO_printf(bio_err, "Calling OSSL_ECHSTORE_new_config\n");
+        if ((ecf = bio_open_owner(outfile, FORMAT_PEM, 1)) == NULL
+            || OSSL_ECHSTORE_new_config(es, ech_version, max_name_length,
+                   public_name, hpke_suite)
+                != 1
+            || OSSL_ECHSTORE_write_pem(es, 0, ecf) != 1) {
+            BIO_printf(bio_err, "OSSL_ECHSTORE_new_config error\n");
+            goto end;
+        }
+        if (verbose)
+            BIO_printf(bio_err, "OSSL_ECHSTORE_new_config success\n");
+        rv = 0;
+    }
+    if (mode == OSSL_ECH_SELPRINT_MODE) {
+        if (numinfiles == 0)
+            goto opthelp;
+        for (i = 0; i != numinfiles; i++) {
+            if ((ecf = BIO_new_file(infiles[i], "r")) == NULL
+                || OSSL_ECHSTORE_read_pem(es, ecf, OSSL_ECH_FOR_RETRY) != 1) {
+                BIO_printf(bio_err, "OSSL_ECHSTORE_read_pem error: %s\n",
+                    infiles[i]);
+                goto end;
+            }
+            BIO_free(ecf);
+            ecf = NULL;
+        }
+        if (verbose)
+            BIO_printf(bio_err, "Success reading %d files\n", numinfiles);
+        if (outsupp == 1) {
+            /* write result to that, with downselection if required */
+            if (verbose)
+                BIO_printf(bio_err, "Will write to %s\n", outfile);
+            if (verbose && select != OSSL_ECHSTORE_ALL)
+                BIO_printf(bio_err, "Selected entry: %d\n", select);
+            if ((ecf = BIO_new_file(outfile, "w")) == NULL
+                || OSSL_ECHSTORE_write_pem(es, select, ecf) != 1) {
+                BIO_printf(bio_err, "OSSL_ECHSTORE_write_pem error: %s\n",
+                    outfile);
+                goto end;
+            }
+            if (verbose)
+                BIO_printf(bio_err, "Success writing to %s\n", outfile);
+        }
+        rv = 0;
+    }
+    if (text) {
+        int oi_ind, oi_cnt = 0;
+
+        if (OSSL_ECHSTORE_num_entries(es, &oi_cnt) != 1)
+            goto end;
+        if (verbose)
+            BIO_printf(bio_err, "Printing %d ECHConfig values\n", oi_cnt);
+        for (oi_ind = 0; oi_ind != oi_cnt; oi_ind++) {
+            time_t secs = 0;
+            char *pn = NULL, *ec = NULL;
+            int has_priv, for_retry;
+
+            if (OSSL_ECHSTORE_get1_info(es, oi_ind, &secs, &pn, &ec,
+                    &has_priv, &for_retry)
+                != 1) {
+                OPENSSL_free(pn); /* just in case */
+                OPENSSL_free(ec);
+                goto end;
+            }
+            BIO_printf(bio_err, "ECH entry: %d public_name: %s age: %lld%s%s\n",
+                oi_ind, pn, (long long)secs,
+                has_priv ? " (has private key)" : "",
+                for_retry ? " (will be sent in retry-configs)" : "");
+            BIO_printf(bio_err, "\t%s\n", ec);
+            OPENSSL_free(pn);
+            OPENSSL_free(ec);
+        }
+        if (verbose)
+            BIO_printf(bio_err, "Success printing %d ECHConfigList\n", oi_cnt);
+        rv = 0;
+    }
+end:
+    OSSL_ECHSTORE_free(es);
+    BIO_free_all(ecf);
+    return rv;
+opthelp:
+    BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+    BIO_printf(bio_err, "\tup to %d -in instances allowed\n", OSSL_ECH_MAXINFILES);
+    OSSL_ECHSTORE_free(es);
+    BIO_free_all(ecf);
+    return rv;
+}
+
+#endif
diff --git a/deps/openssl/openssl/apps/ecparam.c b/deps/openssl/openssl/apps/ecparam.c
index 017dc7568d8..aece2cb81de 100644
--- a/deps/openssl/openssl/apps/ecparam.c
+++ b/deps/openssl/openssl/apps/ecparam.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -36,7 +36,6 @@ typedef enum OPTION_choice {
     OPT_CONV_FORM,
     OPT_PARAM_ENC,
     OPT_GENKEY,
-    OPT_ENGINE,
     OPT_CHECK_NAMED,
     OPT_R_ENUM,
     OPT_PROV_ENUM
@@ -47,9 +46,6 @@ const OPTIONS ecparam_options[] = {
     { "help", OPT_HELP, '-', "Display this summary" },
     { "list_curves", OPT_LIST_CURVES, '-',
         "Prints a list of all curve 'short names'" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif

     { "genkey", OPT_GENKEY, '-', "Generate ec key" },
     { "in", OPT_IN, '<', "Input file  - default stdin" },
@@ -61,7 +57,7 @@ const OPTIONS ecparam_options[] = {
     { "text", OPT_TEXT, '-', "Print the ec parameters in text form" },
     { "noout", OPT_NOOUT, '-', "Do not print the ec parameter" },
     { "param_enc", OPT_PARAM_ENC, 's',
-        "Specifies the way the ec parameters are encoded" },
+        "Selects between named_curve and explicit EC parameter encoding" },

     OPT_SECTION("Parameter"),
     { "check", OPT_CHECK, '-', "Validate the ec parameters" },
@@ -83,7 +79,7 @@ static int list_builtin_curves(BIO *out)
     EC_builtin_curve *curves = NULL;
     size_t n, crv_len = EC_get_builtin_curves(NULL, 0);

-    curves = app_malloc((int)sizeof(*curves) * crv_len, "list curves");
+    curves = app_malloc_array(crv_len, sizeof(*curves), "list curves");
     EC_get_builtin_curves(curves, crv_len);

     for (n = 0; n < crv_len; n++) {
@@ -95,8 +91,7 @@ static int list_builtin_curves(BIO *out)
         if (sname == NULL)
             sname = "";

-        BIO_printf(out, "  %-10s: ", sname);
-        BIO_printf(out, "%s\n", comment);
+        BIO_printf(out, "  %-10s: %s\n", sname, comment);
     }
     OPENSSL_free(curves);
     return 1;
@@ -108,7 +103,6 @@ int ecparam_main(int argc, char **argv)
     EVP_PKEY *params_key = NULL, *key = NULL;
     OSSL_ENCODER_CTX *ectx_key = NULL, *ectx_params = NULL;
     OSSL_DECODER_CTX *dctx_params = NULL;
-    ENGINE *e = NULL;
     BIO *out = NULL;
     char *curve_name = NULL;
     char *asn1_encoding = NULL;
@@ -188,9 +182,6 @@ int ecparam_main(int argc, char **argv)
             if (!opt_provider(o))
                 goto end;
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         }
     }

@@ -218,11 +209,11 @@ int ecparam_main(int argc, char **argv)
         OSSL_PARAM *p = params;

         if (strcmp(curve_name, "secp192r1") == 0) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "using curve name prime192v1 instead of secp192r1\n");
             curve_name = SN_X9_62_prime192v1;
         } else if (strcmp(curve_name, "secp256r1") == 0) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "using curve name prime256v1 instead of secp256r1\n");
             curve_name = SN_X9_62_prime256v1;
         }
@@ -247,7 +238,7 @@ int ecparam_main(int argc, char **argv)
             || EVP_PKEY_keygen_init(gctx_params) <= 0
             || EVP_PKEY_CTX_set_params(gctx_params, params) <= 0
             || EVP_PKEY_keygen(gctx_params, &params_key) <= 0) {
-            BIO_printf(bio_err, "unable to generate key\n");
+            BIO_puts(bio_err, "unable to generate key\n");
             goto end;
         }
     } else {
@@ -266,14 +257,14 @@ int ecparam_main(int argc, char **argv)
             && !EVP_PKEY_set_utf8_string_param(
                 params_key, OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT,
                 point_format)) {
-            BIO_printf(bio_err, "unable to set point conversion format\n");
+            BIO_puts(bio_err, "unable to set point conversion format\n");
             goto end;
         }

         if (asn1_encoding != NULL
             && !EVP_PKEY_set_utf8_string_param(
                 params_key, OSSL_PKEY_PARAM_EC_ENCODING, asn1_encoding)) {
-            BIO_printf(bio_err, "unable to set asn1 encoding format\n");
+            BIO_puts(bio_err, "unable to set asn1 encoding format\n");
             goto end;
         }
     }
@@ -281,7 +272,7 @@ int ecparam_main(int argc, char **argv)
     if (no_seed
         && !EVP_PKEY_set_octet_string_param(params_key, OSSL_PKEY_PARAM_EC_SEED,
             NULL, 0)) {
-        BIO_printf(bio_err, "unable to clear seed\n");
+        BIO_puts(bio_err, "unable to clear seed\n");
         goto end;
     }

@@ -291,27 +282,27 @@ int ecparam_main(int argc, char **argv)

     if (text
         && EVP_PKEY_print_params(out, params_key, 0, NULL) <= 0) {
-        BIO_printf(bio_err, "unable to print params\n");
+        BIO_puts(bio_err, "unable to print params\n");
         goto end;
     }

     if (check || check_named) {
-        BIO_printf(bio_err, "checking elliptic curve parameters: ");
+        BIO_puts(bio_err, "checking elliptic curve parameters: ");

         if (check_named
             && !EVP_PKEY_set_utf8_string_param(params_key,
                 OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE,
                 OSSL_PKEY_EC_GROUP_CHECK_NAMED)) {
-            BIO_printf(bio_err, "unable to set check_type\n");
+            BIO_puts(bio_err, "unable to set check_type\n");
             goto end;
         }
         pctx = EVP_PKEY_CTX_new_from_pkey(app_get0_libctx(), params_key,
             app_get0_propq());
         if (pctx == NULL || EVP_PKEY_param_check(pctx) <= 0) {
-            BIO_printf(bio_err, "failed\n");
+            BIO_puts(bio_err, "failed\n");
             goto end;
         }
-        BIO_printf(bio_err, "ok\n");
+        BIO_puts(bio_err, "ok\n");
     }

     if (outformat == FORMAT_ASN1 && genkey)
@@ -322,7 +313,7 @@ int ecparam_main(int argc, char **argv)
             params_key, OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS,
             outformat == FORMAT_ASN1 ? "DER" : "PEM", NULL, NULL);
         if (!OSSL_ENCODER_to_bio(ectx_params, out)) {
-            BIO_printf(bio_err, "unable to write elliptic curve parameters\n");
+            BIO_puts(bio_err, "unable to write elliptic curve parameters\n");
             goto end;
         }
     }
@@ -340,7 +331,7 @@ int ecparam_main(int argc, char **argv)
             app_get0_propq());
         if (EVP_PKEY_keygen_init(gctx_key) <= 0
             || EVP_PKEY_keygen(gctx_key, &key) <= 0) {
-            BIO_printf(bio_err, "unable to generate key\n");
+            BIO_puts(bio_err, "unable to generate key\n");
             goto end;
         }
         assert(private);
@@ -348,8 +339,8 @@ int ecparam_main(int argc, char **argv)
             key, OSSL_KEYMGMT_SELECT_ALL,
             outformat == FORMAT_ASN1 ? "DER" : "PEM", NULL, NULL);
         if (!OSSL_ENCODER_to_bio(ectx_key, out)) {
-            BIO_printf(bio_err, "unable to write elliptic "
-                                "curve parameters\n");
+            BIO_puts(bio_err, "unable to write elliptic "
+                              "curve parameters\n");
             goto end;
         }
     }
@@ -358,7 +349,6 @@ int ecparam_main(int argc, char **argv)
 end:
     if (ret != 0)
         ERR_print_errors(bio_err);
-    release_engine(e);
     EVP_PKEY_free(params_key);
     EVP_PKEY_free(key);
     EVP_PKEY_CTX_free(pctx);
diff --git a/deps/openssl/openssl/apps/enc.c b/deps/openssl/openssl/apps/enc.c
index 1b186cd245c..87e6f9530ec 100644
--- a/deps/openssl/openssl/apps/enc.c
+++ b/deps/openssl/openssl/apps/enc.c
@@ -24,6 +24,7 @@
 #include <openssl/comp.h>
 #endif
 #include <ctype.h>
+#include <inttypes.h>

 #undef SIZE
 #undef BSIZE
@@ -49,7 +50,6 @@ typedef enum OPTION_choice {
     OPT_IN,
     OPT_OUT,
     OPT_PASS,
-    OPT_ENGINE,
     OPT_D,
     OPT_P,
     OPT_V,
@@ -76,7 +76,9 @@ typedef enum OPTION_choice {
     OPT_R_ENUM,
     OPT_PROV_ENUM,
     OPT_SKEYOPT,
-    OPT_SKEYMGMT
+    OPT_SKEYMGMT,
+    OPT_SKEYURI,
+    OPT_PASSIN
 } OPTION_CHOICE;

 const OPTIONS enc_options[] = {
@@ -90,18 +92,12 @@ const OPTIONS enc_options[] = {
     { "d", OPT_D, '-', "Decrypt" },
     { "p", OPT_P, '-', "Print the iv/key" },
     { "P", OPT_UPPER_P, '-', "Print the iv/key and exit" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif

     OPT_SECTION("Input"),
     { "in", OPT_IN, '<', "Input file" },
-    { "k", OPT_K, 's', "Passphrase" },
-    { "kfile", OPT_KFILE, '<', "Read passphrase from file" },

     OPT_SECTION("Output"),
     { "out", OPT_OUT, '>', "Output file" },
-    { "pass", OPT_PASS, 's', "Passphrase source" },
     { "v", OPT_V, '-', "Verbose output" },
     { "a", OPT_A, '-', "Base64 encode/decode, depending on encryption flag" },
     { "base64", OPT_A, '-', "Same as option -a" },
@@ -119,6 +115,9 @@ const OPTIONS enc_options[] = {
     { "S", OPT_UPPER_S, 's', "Salt, in hex" },
     { "iv", OPT_IV, 's', "IV in hex" },
     { "md", OPT_MD, 's', "Use specified digest to create a key from the passphrase" },
+    { "k", OPT_K, 's', "Passphrase (Deprecated)" },
+    { "kfile", OPT_KFILE, '<', "Read passphrase from file (Deprecated)" },
+    { "pass", OPT_PASS, 's', "Passphrase source" },
     { "iter", OPT_ITER, 'p',
         "Specify the iteration count and force the use of PBKDF2" },
     { OPT_MORE_STR, 0, 0, "Default: " STR(PBKDF2_ITER_DEFAULT) },
@@ -134,6 +133,8 @@ const OPTIONS enc_options[] = {
 #endif
     { "skeyopt", OPT_SKEYOPT, 's', "Key options as opt:value for opaque symmetric key handling" },
     { "skeymgmt", OPT_SKEYMGMT, 's', "Symmetric key management name for opaque symmetric key handling" },
+    { "skeyuri", OPT_SKEYURI, 's', "Symmetric key object URI" },
+    { "storepass", OPT_PASSIN, 's', "Store pass phrase source when skeyuri is used (optional)" },
     { "", OPT_CIPHER, '-', "Any supported cipher" },

     OPT_R_OPTIONS,
@@ -141,11 +142,37 @@ const OPTIONS enc_options[] = {
     { NULL }
 };

+static EVP_SKEY *skey_from_params(const EVP_CIPHER *cipher, const char *skeymgmt,
+    STACK_OF(OPENSSL_STRING) *opts)
+{
+    EVP_SKEY *skey = NULL;
+    EVP_SKEYMGMT *mgmt = NULL;
+    OSSL_PARAM *params = NULL;
+
+    mgmt = EVP_SKEYMGMT_fetch(app_get0_libctx(),
+        skeymgmt != NULL ? skeymgmt : EVP_CIPHER_name(cipher),
+        app_get0_propq());
+    if (mgmt == NULL)
+        return NULL;
+
+    params = app_params_new_from_opts(opts, EVP_SKEYMGMT_get0_imp_settable_params(mgmt));
+    if (params == NULL) {
+        EVP_SKEYMGMT_free(mgmt);
+        return NULL;
+    }
+
+    skey = EVP_SKEY_import(app_get0_libctx(), EVP_SKEYMGMT_get0_name(mgmt),
+        app_get0_propq(), OSSL_SKEYMGMT_SELECT_ALL, params);
+    app_params_free(params);
+    EVP_SKEYMGMT_free(mgmt);
+
+    return skey;
+}
+
 int enc_main(int argc, char **argv)
 {
     static char buf[128];
     static const char magic[] = "Salted__";
-    ENGINE *e = NULL;
     BIO *in = NULL, *out = NULL, *b64 = NULL, *benc = NULL, *rbio = NULL, *wbio = NULL;
     EVP_CIPHER_CTX *ctx = NULL;
     EVP_CIPHER *cipher = NULL;
@@ -154,6 +181,7 @@ int enc_main(int argc, char **argv)
     char *hkey = NULL, *hiv = NULL, *hsalt = NULL, *p;
     char *infile = NULL, *outfile = NULL, *prog;
     char *str = NULL, *passarg = NULL, *pass = NULL, *strbuf = NULL;
+    char *storepassarg = NULL;
     const char *ciphername = NULL;
     char mbuf[sizeof(magic) - 1];
     OPTION_CHOICE o;
@@ -181,8 +209,8 @@ int enc_main(int argc, char **argv)
     BIO *bzstd = NULL;
     STACK_OF(OPENSSL_STRING) *skeyopts = NULL;
     const char *skeymgmt = NULL;
+    const char *skeyuri = NULL;
     EVP_SKEY *skey = NULL;
-    EVP_SKEYMGMT *mgmt = NULL;

     /* first check the command name */
     if (strcmp(argv[0], "base64") == 0)
@@ -216,12 +244,12 @@ int enc_main(int argc, char **argv)
             ret = 0;
             goto end;
         case OPT_LIST:
-            BIO_printf(bio_out, "Supported ciphers:\n");
+            BIO_puts(bio_out, "Supported ciphers:\n");
             dec.bio = bio_out;
             dec.n = 0;
             OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH,
                 show_ciphers, &dec);
-            BIO_printf(bio_out, "\n");
+            BIO_puts(bio_out, "\n");
             ret = 0;
             goto end;
         case OPT_E:
@@ -236,8 +264,8 @@ int enc_main(int argc, char **argv)
         case OPT_PASS:
             passarg = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
+        case OPT_PASSIN:
+            storepassarg = opt_arg();
             break;
         case OPT_D:
             enc = 0;
@@ -354,6 +382,9 @@ int enc_main(int argc, char **argv)
         case OPT_SKEYMGMT:
             skeymgmt = opt_arg();
             break;
+        case OPT_SKEYURI:
+            skeyuri = opt_arg();
+            break;
         case OPT_R_CASES:
             if (!opt_rand(o))
                 goto end;
@@ -394,7 +425,7 @@ int enc_main(int argc, char **argv)
     if (base64 && bsize < 80)
         bsize = 80;
     if (verbose)
-        BIO_printf(bio_err, "bufsize=%d\n", bsize);
+        BIO_printf(bio_out, "bufsize=%d\n", bsize);

 #ifndef OPENSSL_NO_ZLIB
     if (do_zlib)
@@ -417,7 +448,7 @@ int enc_main(int argc, char **argv)

     if (infile == NULL) {
         if (!streamable && printkey != 2) { /* if just print key and exit, it's ok */
-            BIO_printf(bio_err, "Unstreamable cipher mode\n");
+            BIO_puts(bio_err, "Unstreamable cipher mode\n");
             goto end;
         }
         in = dup_bio_in(informat);
@@ -429,19 +460,20 @@ int enc_main(int argc, char **argv)

     if (str == NULL && passarg != NULL) {
         if (!app_passwd(passarg, NULL, &pass, NULL)) {
-            BIO_printf(bio_err, "Error getting password\n");
+            BIO_puts(bio_err, "Error getting password\n");
             goto end;
         }
         str = pass;
     }

-    if ((str == NULL) && (cipher != NULL) && (hkey == NULL) && (skeyopts == NULL)) {
+    if ((str == NULL) && (cipher != NULL) && (hkey == NULL)
+        && (skeyopts == NULL) && (skeyuri == NULL)) {
         if (1) {
 #ifndef OPENSSL_NO_UI_CONSOLE
             for (;;) {
                 char prompt[200];

-                BIO_snprintf(prompt, sizeof(prompt), "enter %s %s password:",
+                snprintf(prompt, sizeof(prompt), "enter %s %s password:",
                     EVP_CIPHER_get0_name(cipher),
                     (enc) ? "encryption" : "decryption");
                 strbuf[0] = '\0';
@@ -455,13 +487,13 @@ int enc_main(int argc, char **argv)
                     break;
                 }
                 if (i < 0) {
-                    BIO_printf(bio_err, "bad password read\n");
+                    BIO_puts(bio_err, "bad password read\n");
                     goto end;
                 }
             }
         } else {
 #endif
-            BIO_printf(bio_err, "password required\n");
+            BIO_puts(bio_err, "password required\n");
             goto end;
         }
     }
@@ -552,13 +584,13 @@ int enc_main(int argc, char **argv)
                 sptr = NULL;
             } else {
                 if (hsalt != NULL && !set_hex(hsalt, salt, saltlen)) {
-                    BIO_printf(bio_err, "invalid hex salt value\n");
+                    BIO_puts(bio_err, "invalid hex salt value\n");
                     goto end;
                 }
                 if (enc) { /* encryption */
                     if (hsalt == NULL) {
                         if (RAND_bytes(salt, saltlen) <= 0) {
-                            BIO_printf(bio_err, "RAND_bytes failed\n");
+                            BIO_puts(bio_err, "RAND_bytes failed\n");
                             goto end;
                         }
                         /*
@@ -573,25 +605,25 @@ int enc_main(int argc, char **argv)
                                        (char *)salt,
                                        saltlen)
                                     != saltlen)) {
-                            BIO_printf(bio_err, "error writing output file\n");
+                            BIO_puts(bio_err, "error writing output file\n");
                             goto end;
                         }
                     }
                 } else { /* decryption */
                     if (hsalt == NULL) {
                         if (BIO_read(rbio, mbuf, sizeof(mbuf)) != sizeof(mbuf)) {
-                            BIO_printf(bio_err, "error reading input file\n");
+                            BIO_puts(bio_err, "error reading input file\n");
                             goto end;
                         }
                         if (memcmp(mbuf, magic, sizeof(mbuf)) == 0) { /* file IS salted */
                             if (BIO_read(rbio, salt,
                                     saltlen)
                                 != saltlen) {
-                                BIO_printf(bio_err, "error reading input file\n");
+                                BIO_puts(bio_err, "error reading input file\n");
                                 goto end;
                             }
                         } else { /* file is NOT salted, NO salt available */
-                            BIO_printf(bio_err, "bad magic number\n");
+                            BIO_puts(bio_err, "bad magic number\n");
                             goto end;
                         }
                     }
@@ -610,9 +642,9 @@ int enc_main(int argc, char **argv)
                 /* not needed if HASH_UPDATE() is fixed : */
                 int islen = (sptr != NULL ? saltlen : 0);

-                if (!PKCS5_PBKDF2_HMAC(str, str_len, sptr, islen,
+                if (!PKCS5_PBKDF2_HMAC(str, (int)str_len, sptr, islen,
                         iter, dgst, iklen + ivlen, tmpkeyiv)) {
-                    BIO_printf(bio_err, "PKCS5_PBKDF2_HMAC failed\n");
+                    BIO_puts(bio_err, "PKCS5_PBKDF2_HMAC failed\n");
                     goto end;
                 }
                 /* split and move data back to global buffer */
@@ -620,13 +652,13 @@ int enc_main(int argc, char **argv)
                 memcpy(iv, tmpkeyiv + iklen, ivlen);
                 rawkey_set = 1;
             } else {
-                BIO_printf(bio_err, "*** WARNING : "
-                                    "deprecated key derivation used.\n"
-                                    "Using -iter or -pbkdf2 would be better.\n");
+                BIO_puts(bio_err, "*** WARNING : "
+                                  "deprecated key derivation used.\n"
+                                  "Using -iter or -pbkdf2 would be better.\n");
                 if (!EVP_BytesToKey(cipher, dgst, sptr,
-                        (unsigned char *)str, str_len,
+                        (unsigned char *)str, (int)str_len,
                         1, key, iv)) {
-                    BIO_printf(bio_err, "EVP_BytesToKey failed\n");
+                    BIO_puts(bio_err, "EVP_BytesToKey failed\n");
                     goto end;
                 }
                 rawkey_set = 1;
@@ -644,9 +676,9 @@ int enc_main(int argc, char **argv)
             int siz = EVP_CIPHER_get_iv_length(cipher);

             if (siz == 0) {
-                BIO_printf(bio_err, "warning: iv not used by this cipher\n");
+                BIO_puts(bio_err, "warning: iv not used by this cipher\n");
             } else if (!set_hex(hiv, iv, siz)) {
-                BIO_printf(bio_err, "invalid hex iv value\n");
+                BIO_puts(bio_err, "invalid hex iv value\n");
                 goto end;
             }
         }
@@ -657,12 +689,12 @@ int enc_main(int argc, char **argv)
              * No IV was explicitly set and no IV was generated.
              * Hence the IV is undefined, making correct decryption impossible.
              */
-            BIO_printf(bio_err, "iv undefined\n");
+            BIO_puts(bio_err, "iv undefined\n");
             goto end;
         }
         if (hkey != NULL) {
             if (!set_hex(hkey, key, EVP_CIPHER_get_key_length(cipher))) {
-                BIO_printf(bio_err, "invalid hex key value\n");
+                BIO_puts(bio_err, "invalid hex key value\n");
                 goto end;
             }
             /* wiping secret data as we no longer need it */
@@ -674,8 +706,8 @@ int enc_main(int argc, char **argv)
          * At this moment we know whether we trying to use raw bytes as the key
          * or an opaque symmetric key. We do not allow both options simultaneously.
          */
-        if (rawkey_set > 0 && skeyopts != NULL) {
-            BIO_printf(bio_err, "Either a raw key or the 'skeyopt' args must be used.\n");
+        if (rawkey_set > 0 && (skeyopts != NULL || skeyuri != NULL)) {
+            BIO_puts(bio_err, "Either a raw key or the skeyopt/skeyuri args must be used.\n");
             goto end;
         }

@@ -693,35 +725,34 @@ int enc_main(int argc, char **argv)
             EVP_CIPHER_CTX_set_flags(ctx, EVP_CIPHER_CTX_FLAG_WRAP_ALLOW);

         if (rawkey_set) {
-            if (!EVP_CipherInit_ex(ctx, cipher, e, key,
+            if (!EVP_CipherInit_ex(ctx, cipher, NULL, key,
                     (hiv == NULL && wrap == 1 ? NULL : iv), enc)) {
                 BIO_printf(bio_err, "Error setting cipher %s\n",
                     EVP_CIPHER_get0_name(cipher));
-                ERR_print_errors(bio_err);
                 goto end;
             }
         } else {
-            OSSL_PARAM *params = NULL;
+            if (skeyuri != NULL) {
+                char *storepass = NULL;

-            mgmt = EVP_SKEYMGMT_fetch(app_get0_libctx(),
-                skeymgmt != NULL ? skeymgmt : EVP_CIPHER_name(cipher),
-                app_get0_propq());
-            if (mgmt == NULL)
-                goto end;
-
-            params = app_params_new_from_opts(skeyopts,
-                EVP_SKEYMGMT_get0_imp_settable_params(mgmt));
-            if (params == NULL)
-                goto end;
+                if (!app_passwd(storepassarg, NULL, &storepass, NULL)) {
+                    BIO_puts(bio_err,
+                        "Error getting store password from 'storepass' argument\n");
+                }

-            skey = EVP_SKEY_import(app_get0_libctx(), EVP_SKEYMGMT_get0_name(mgmt),
-                app_get0_propq(), OSSL_SKEYMGMT_SELECT_ALL, params);
-            app_params_free(params);
-            if (skey == NULL) {
-                BIO_printf(bio_err, "Error creating opaque key object for skeymgmt %s\n",
-                    skeymgmt ? skeymgmt : EVP_CIPHER_name(cipher));
-                ERR_print_errors(bio_err);
-                goto end;
+                skey = load_skey(skeyuri, FORMAT_UNDEF, 0, storepass, 0);
+                OPENSSL_free(storepass);
+                if (skey == NULL) {
+                    BIO_printf(bio_err, "Error loading opaque key object from URI %s\n", skeyuri);
+                    goto end;
+                }
+            } else {
+                skey = skey_from_params(cipher, skeymgmt, skeyopts);
+                if (skey == NULL) {
+                    BIO_printf(bio_err, "Error creating opaque key object for skeymgmt %s\n",
+                        skeymgmt ? skeymgmt : EVP_CIPHER_name(cipher));
+                    goto end;
+                }
             }

             if (!EVP_CipherInit_SKEY(ctx, cipher, skey,
@@ -729,7 +760,6 @@ int enc_main(int argc, char **argv)
                     EVP_CIPHER_get_iv_length(cipher), enc, NULL)) {
                 BIO_printf(bio_err, "Error setting an opaque key for cipher %s\n",
                     EVP_CIPHER_get0_name(cipher));
-                ERR_print_errors(bio_err);
                 goto end;
             }
         }
@@ -777,11 +807,11 @@ int enc_main(int argc, char **argv)
         if (inl <= 0)
             break;
         if (!streamable && !BIO_eof(rbio)) { /* do not output data */
-            BIO_printf(bio_err, "Unstreamable cipher mode\n");
+            BIO_puts(bio_err, "Unstreamable cipher mode\n");
             goto end;
         }
         if (BIO_write(wbio, (char *)buff, inl) != inl) {
-            BIO_printf(bio_err, "error writing output file\n");
+            BIO_puts(bio_err, "error writing output file\n");
             goto end;
         }
         if (!streamable)
@@ -789,21 +819,21 @@ int enc_main(int argc, char **argv)
     }
     if (!BIO_flush(wbio)) {
         if (enc)
-            BIO_printf(bio_err, "bad encrypt\n");
+            BIO_puts(bio_err, "bad encrypt\n");
         else
-            BIO_printf(bio_err, "bad decrypt\n");
+            BIO_puts(bio_err, "bad decrypt\n");
         goto end;
     }

     ret = 0;
     if (verbose) {
-        BIO_printf(bio_err, "bytes read   : %8ju\n", BIO_number_read(in));
-        BIO_printf(bio_err, "bytes written: %8ju\n", BIO_number_written(out));
+        BIO_printf(bio_err, "bytes read   : %8" PRIu64 "\n"
+                            "bytes written: %8" PRIu64 "\n",
+            BIO_number_read(in), BIO_number_written(out));
     }
 end:
     ERR_print_errors(bio_err);
     sk_OPENSSL_STRING_free(skeyopts);
-    EVP_SKEYMGMT_free(mgmt);
     EVP_SKEY_free(skey);
     OPENSSL_free(strbuf);
     OPENSSL_free(buff);
@@ -818,7 +848,6 @@ end:
 #endif
     BIO_free(bbrot);
     BIO_free(bzstd);
-    release_engine(e);
     OPENSSL_free(pass);
     return ret;
 }
@@ -826,24 +855,29 @@ end:
 static void show_ciphers(const OBJ_NAME *name, void *arg)
 {
     struct doall_enc_ciphers *dec = (struct doall_enc_ciphers *)arg;
-    const EVP_CIPHER *cipher;
+    EVP_CIPHER *cipher;

     if (!islower((unsigned char)*name->name))
         return;

     /* Filter out ciphers that we cannot use */
-    cipher = EVP_get_cipherbyname(name->name);
+    cipher = EVP_CIPHER_fetch(app_get0_libctx(), name->name, app_get0_propq());
     if (cipher == NULL
         || (EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) != 0
-        || EVP_CIPHER_get_mode(cipher) == EVP_CIPH_XTS_MODE)
+        || (EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_ENC_THEN_MAC) != 0
+        || EVP_CIPHER_get_mode(cipher) == EVP_CIPH_XTS_MODE) {
+        EVP_CIPHER_free(cipher);
         return;
+    }

     BIO_printf(dec->bio, "-%-25s", name->name);
     if (++dec->n == 3) {
-        BIO_printf(dec->bio, "\n");
+        BIO_puts(dec->bio, "\n");
         dec->n = 0;
     } else
-        BIO_printf(dec->bio, " ");
+        BIO_puts(dec->bio, " ");
+
+    EVP_CIPHER_free(cipher);
 }

 static int set_hex(const char *in, unsigned char *out, int size)
@@ -852,19 +886,19 @@ static int set_hex(const char *in, unsigned char *out, int size)
     unsigned char j;

     i = size * 2;
-    n = strlen(in);
+    n = (int)strlen(in);
     if (n > i) {
-        BIO_printf(bio_err, "hex string is too long, ignoring excess\n");
+        BIO_puts(bio_err, "hex string is too long, ignoring excess\n");
         n = i; /* ignore exceeding part */
     } else if (n < i) {
-        BIO_printf(bio_err, "hex string is too short, padding with zero bytes to length\n");
+        BIO_puts(bio_err, "hex string is too short, padding with zero bytes to length\n");
     }

     memset(out, 0, size);
     for (i = 0; i < n; i++) {
         j = (unsigned char)*in++;
         if (!isxdigit(j)) {
-            BIO_printf(bio_err, "non-hex digit\n");
+            BIO_puts(bio_err, "non-hex digit\n");
             return 0;
         }
         j = (unsigned char)OPENSSL_hexchar2int(j);
diff --git a/deps/openssl/openssl/apps/engine.c b/deps/openssl/openssl/apps/engine.c
deleted file mode 100644
index 1b8eac4dc8b..00000000000
--- a/deps/openssl/openssl/apps/engine.c
+++ /dev/null
@@ -1,507 +0,0 @@
-/*
- * Copyright 2000-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include <openssl/opensslconf.h>
-
-#include "apps.h"
-#include "progs.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <openssl/err.h>
-#include <openssl/engine.h>
-#include <openssl/ssl.h>
-#include <openssl/store.h>
-
-typedef enum OPTION_choice {
-    OPT_COMMON,
-    OPT_C,
-    OPT_T,
-    OPT_TT,
-    OPT_PRE,
-    OPT_POST,
-    OPT_V = 100,
-    OPT_VV,
-    OPT_VVV,
-    OPT_VVVV
-} OPTION_CHOICE;
-
-const OPTIONS engine_options[] = {
-    { OPT_HELP_STR, 1, '-', "Usage: %s [options] engine...\n" },
-
-    OPT_SECTION("General"),
-    { "help", OPT_HELP, '-', "Display this summary" },
-    { "t", OPT_T, '-', "Check that specified engine is available" },
-    { "pre", OPT_PRE, 's', "Run command against the ENGINE before loading it" },
-    { "post", OPT_POST, 's', "Run command against the ENGINE after loading it" },
-
-    OPT_SECTION("Output"),
-    { "v", OPT_V, '-', "List 'control commands' For each specified engine" },
-    { "vv", OPT_VV, '-', "Also display each command's description" },
-    { "vvv", OPT_VVV, '-', "Also add the input flags for each command" },
-    { "vvvv", OPT_VVVV, '-', "Also show internal input flags" },
-    { "c", OPT_C, '-', "List the capabilities of specified engine" },
-    { "tt", OPT_TT, '-', "Display error trace for unavailable engines" },
-    { OPT_MORE_STR, OPT_EOF, 1,
-        "Commands are like \"SO_PATH:/lib/libdriver.so\"" },
-
-    OPT_PARAMETERS(),
-    { "engine", 0, 0, "ID of engine(s) to load" },
-    { NULL }
-};
-
-static int append_buf(char **buf, int *size, const char *s)
-{
-    const int expand = 256;
-    int len = strlen(s) + 1;
-    char *p = *buf;
-
-    if (p == NULL) {
-        *size = ((len + expand - 1) / expand) * expand;
-        p = *buf = app_malloc(*size, "engine buffer");
-    } else {
-        const int blen = strlen(p);
-
-        if (blen > 0)
-            len += 2 + blen;
-
-        if (len > *size) {
-            *size = ((len + expand - 1) / expand) * expand;
-            p = OPENSSL_realloc(p, *size);
-            if (p == NULL) {
-                OPENSSL_free(*buf);
-                *buf = NULL;
-                return 0;
-            }
-            *buf = p;
-        }
-
-        if (blen > 0) {
-            p += blen;
-            *p++ = ',';
-            *p++ = ' ';
-        }
-    }
-
-    strcpy(p, s);
-    return 1;
-}
-
-static int util_flags(BIO *out, unsigned int flags, const char *indent)
-{
-    int started = 0, err = 0;
-    /* Indent before displaying input flags */
-    BIO_printf(out, "%s%s(input flags): ", indent, indent);
-    if (flags == 0) {
-        BIO_printf(out, "<no flags>\n");
-        return 1;
-    }
-    /*
-     * If the object is internal, mark it in a way that shows instead of
-     * having it part of all the other flags, even if it really is.
-     */
-    if (flags & ENGINE_CMD_FLAG_INTERNAL) {
-        BIO_printf(out, "[Internal] ");
-    }
-
-    if (flags & ENGINE_CMD_FLAG_NUMERIC) {
-        BIO_printf(out, "NUMERIC");
-        started = 1;
-    }
-    /*
-     * Now we check that no combinations of the mutually exclusive NUMERIC,
-     * STRING, and NO_INPUT flags have been used. Future flags that can be
-     * OR'd together with these would need to added after these to preserve
-     * the testing logic.
-     */
-    if (flags & ENGINE_CMD_FLAG_STRING) {
-        if (started) {
-            BIO_printf(out, "|");
-            err = 1;
-        }
-        BIO_printf(out, "STRING");
-        started = 1;
-    }
-    if (flags & ENGINE_CMD_FLAG_NO_INPUT) {
-        if (started) {
-            BIO_printf(out, "|");
-            err = 1;
-        }
-        BIO_printf(out, "NO_INPUT");
-        started = 1;
-    }
-    /* Check for unknown flags */
-    flags = flags & ~ENGINE_CMD_FLAG_NUMERIC & ~ENGINE_CMD_FLAG_STRING & ~ENGINE_CMD_FLAG_NO_INPUT & ~ENGINE_CMD_FLAG_INTERNAL;
-    if (flags) {
-        if (started)
-            BIO_printf(out, "|");
-        BIO_printf(out, "<0x%04X>", flags);
-    }
-    if (err)
-        BIO_printf(out, "  <illegal flags!>");
-    BIO_printf(out, "\n");
-    return 1;
-}
-
-static int util_verbose(ENGINE *e, int verbose, BIO *out, const char *indent)
-{
-    static const int line_wrap = 78;
-    int num;
-    int ret = 0;
-    char *name = NULL;
-    char *desc = NULL;
-    int flags;
-    int xpos = 0;
-    STACK_OF(OPENSSL_STRING) *cmds = NULL;
-    if (!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) || ((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE, 0, NULL, NULL)) <= 0)) {
-        return 1;
-    }
-
-    cmds = sk_OPENSSL_STRING_new_null();
-    if (cmds == NULL)
-        goto err;
-
-    do {
-        int len;
-        /* Get the command input flags */
-        if ((flags = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FLAGS, num,
-                 NULL, NULL))
-            < 0)
-            goto err;
-        if (!(flags & ENGINE_CMD_FLAG_INTERNAL) || verbose >= 4) {
-            /* Get the command name */
-            if ((len = ENGINE_ctrl(e, ENGINE_CTRL_GET_NAME_LEN_FROM_CMD, num,
-                     NULL, NULL))
-                <= 0)
-                goto err;
-            name = app_malloc(len + 1, "name buffer");
-            if (ENGINE_ctrl(e, ENGINE_CTRL_GET_NAME_FROM_CMD, num, name,
-                    NULL)
-                <= 0)
-                goto err;
-            /* Get the command description */
-            if ((len = ENGINE_ctrl(e, ENGINE_CTRL_GET_DESC_LEN_FROM_CMD, num,
-                     NULL, NULL))
-                < 0)
-                goto err;
-            if (len > 0) {
-                desc = app_malloc(len + 1, "description buffer");
-                if (ENGINE_ctrl(e, ENGINE_CTRL_GET_DESC_FROM_CMD, num, desc,
-                        NULL)
-                    <= 0)
-                    goto err;
-            }
-            /* Now decide on the output */
-            if (xpos == 0)
-                /* Do an indent */
-                xpos = BIO_puts(out, indent);
-            else
-                /* Otherwise prepend a ", " */
-                xpos += BIO_printf(out, ", ");
-            if (verbose == 1) {
-                /*
-                 * We're just listing names, comma-delimited
-                 */
-                if ((xpos > (int)strlen(indent)) && (xpos + (int)strlen(name) > line_wrap)) {
-                    BIO_printf(out, "\n");
-                    xpos = BIO_puts(out, indent);
-                }
-                xpos += BIO_printf(out, "%s", name);
-            } else {
-                /* We're listing names plus descriptions */
-                BIO_printf(out, "%s: %s\n", name,
-                    (desc == NULL) ? "<no description>" : desc);
-                /* ... and sometimes input flags */
-                if ((verbose >= 3) && !util_flags(out, flags, indent))
-                    goto err;
-                xpos = 0;
-            }
-        }
-        OPENSSL_free(name);
-        name = NULL;
-        OPENSSL_free(desc);
-        desc = NULL;
-        /* Move to the next command */
-        num = ENGINE_ctrl(e, ENGINE_CTRL_GET_NEXT_CMD_TYPE, num, NULL, NULL);
-    } while (num > 0);
-    if (xpos > 0)
-        BIO_printf(out, "\n");
-    ret = 1;
-err:
-    sk_OPENSSL_STRING_free(cmds);
-    OPENSSL_free(name);
-    OPENSSL_free(desc);
-    return ret;
-}
-
-static void util_do_cmds(ENGINE *e, STACK_OF(OPENSSL_STRING) *cmds,
-    BIO *out, const char *indent)
-{
-    int loop, res, num = sk_OPENSSL_STRING_num(cmds);
-
-    if (num < 0) {
-        BIO_printf(out, "[Error]: internal stack error\n");
-        return;
-    }
-    for (loop = 0; loop < num; loop++) {
-        char buf[256];
-        const char *cmd, *arg;
-        cmd = sk_OPENSSL_STRING_value(cmds, loop);
-        res = 1; /* assume success */
-        /* Check if this command has no ":arg" */
-        if ((arg = strchr(cmd, ':')) == NULL) {
-            if (!ENGINE_ctrl_cmd_string(e, cmd, NULL, 0))
-                res = 0;
-        } else {
-            if ((int)(arg - cmd) > 254) {
-                BIO_printf(out, "[Error]: command name too long\n");
-                return;
-            }
-            memcpy(buf, cmd, (int)(arg - cmd));
-            buf[arg - cmd] = '\0';
-            arg++; /* Move past the ":" */
-            /* Call the command with the argument */
-            if (!ENGINE_ctrl_cmd_string(e, buf, arg, 0))
-                res = 0;
-        }
-        if (res) {
-            BIO_printf(out, "[Success]: %s\n", cmd);
-        } else {
-            BIO_printf(out, "[Failure]: %s\n", cmd);
-            ERR_print_errors(out);
-        }
-    }
-}
-
-struct util_store_cap_data {
-    ENGINE *engine;
-    char **cap_buf;
-    int *cap_size;
-    int ok;
-};
-static void util_store_cap(const OSSL_STORE_LOADER *loader, void *arg)
-{
-    struct util_store_cap_data *ctx = arg;
-
-    if (OSSL_STORE_LOADER_get0_engine(loader) == ctx->engine) {
-        char buf[256];
-        BIO_snprintf(buf, sizeof(buf), "STORE(%s)",
-            OSSL_STORE_LOADER_get0_scheme(loader));
-        if (!append_buf(ctx->cap_buf, ctx->cap_size, buf))
-            ctx->ok = 0;
-    }
-}
-
-int engine_main(int argc, char **argv)
-{
-    int ret = 1, i;
-    int verbose = 0, list_cap = 0, test_avail = 0, test_avail_noise = 0;
-    ENGINE *e;
-    STACK_OF(OPENSSL_CSTRING) *engines = sk_OPENSSL_CSTRING_new_null();
-    STACK_OF(OPENSSL_STRING) *pre_cmds = sk_OPENSSL_STRING_new_null();
-    STACK_OF(OPENSSL_STRING) *post_cmds = sk_OPENSSL_STRING_new_null();
-    BIO *out;
-    const char *indent = "     ";
-    OPTION_CHOICE o;
-    char *prog;
-    char *argv1;
-
-    out = dup_bio_out(FORMAT_TEXT);
-    if (engines == NULL || pre_cmds == NULL || post_cmds == NULL)
-        goto end;
-
-    /* Remember the original command name, parse/skip any leading engine
-     * names, and then setup to parse the rest of the line as flags. */
-    prog = argv[0];
-    while ((argv1 = argv[1]) != NULL && *argv1 != '-') {
-        if (!sk_OPENSSL_CSTRING_push(engines, argv1))
-            goto end;
-        argc--;
-        argv++;
-    }
-    argv[0] = prog;
-    opt_init(argc, argv, engine_options);
-
-    while ((o = opt_next()) != OPT_EOF) {
-        switch (o) {
-        case OPT_EOF:
-        case OPT_ERR:
-            BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
-            goto end;
-        case OPT_HELP:
-            opt_help(engine_options);
-            ret = 0;
-            goto end;
-        case OPT_VVVV:
-        case OPT_VVV:
-        case OPT_VV:
-        case OPT_V:
-            /* Convert to an integer from one to four. */
-            i = (int)(o - OPT_V) + 1;
-            if (verbose < i)
-                verbose = i;
-            break;
-        case OPT_C:
-            list_cap = 1;
-            break;
-        case OPT_TT:
-            test_avail_noise++;
-            /* fall through */
-        case OPT_T:
-            test_avail++;
-            break;
-        case OPT_PRE:
-            if (sk_OPENSSL_STRING_push(pre_cmds, opt_arg()) <= 0)
-                goto end;
-            break;
-        case OPT_POST:
-            if (sk_OPENSSL_STRING_push(post_cmds, opt_arg()) <= 0)
-                goto end;
-            break;
-        }
-    }
-
-    /* Any remaining arguments are engine names. */
-    argc = opt_num_rest();
-    argv = opt_rest();
-    for (; *argv; argv++) {
-        if (**argv == '-') {
-            BIO_printf(bio_err, "%s: Cannot mix flags and engine names.\n",
-                prog);
-            BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
-            goto end;
-        }
-        if (!sk_OPENSSL_CSTRING_push(engines, *argv))
-            goto end;
-    }
-
-    if (sk_OPENSSL_CSTRING_num(engines) == 0) {
-        for (e = ENGINE_get_first(); e != NULL; e = ENGINE_get_next(e)) {
-            if (!sk_OPENSSL_CSTRING_push(engines, ENGINE_get_id(e)))
-                goto end;
-        }
-    }
-
-    ret = 0;
-    for (i = 0; i < sk_OPENSSL_CSTRING_num(engines); i++) {
-        const char *id = sk_OPENSSL_CSTRING_value(engines, i);
-        if ((e = ENGINE_by_id(id)) != NULL) {
-            const char *name = ENGINE_get_name(e);
-            /*
-             * Do "id" first, then "name". Easier to auto-parse.
-             */
-            BIO_printf(out, "(%s) %s\n", id, name);
-            util_do_cmds(e, pre_cmds, out, indent);
-            if (strcmp(ENGINE_get_id(e), id) != 0) {
-                BIO_printf(out, "Loaded: (%s) %s\n",
-                    ENGINE_get_id(e), ENGINE_get_name(e));
-            }
-            if (list_cap) {
-                int cap_size = 256;
-                char *cap_buf = NULL;
-                int k, n;
-                const int *nids;
-                ENGINE_CIPHERS_PTR fn_c;
-                ENGINE_DIGESTS_PTR fn_d;
-                ENGINE_PKEY_METHS_PTR fn_pk;
-
-                if (ENGINE_get_RSA(e) != NULL
-                    && !append_buf(&cap_buf, &cap_size, "RSA"))
-                    goto end;
-                if (ENGINE_get_EC(e) != NULL
-                    && !append_buf(&cap_buf, &cap_size, "EC"))
-                    goto end;
-                if (ENGINE_get_DSA(e) != NULL
-                    && !append_buf(&cap_buf, &cap_size, "DSA"))
-                    goto end;
-                if (ENGINE_get_DH(e) != NULL
-                    && !append_buf(&cap_buf, &cap_size, "DH"))
-                    goto end;
-                if (ENGINE_get_RAND(e) != NULL
-                    && !append_buf(&cap_buf, &cap_size, "RAND"))
-                    goto end;
-
-                fn_c = ENGINE_get_ciphers(e);
-                if (fn_c == NULL)
-                    goto skip_ciphers;
-                n = fn_c(e, NULL, &nids, 0);
-                for (k = 0; k < n; ++k)
-                    if (!append_buf(&cap_buf, &cap_size, OBJ_nid2sn(nids[k])))
-                        goto end;
-
-            skip_ciphers:
-                fn_d = ENGINE_get_digests(e);
-                if (fn_d == NULL)
-                    goto skip_digests;
-                n = fn_d(e, NULL, &nids, 0);
-                for (k = 0; k < n; ++k)
-                    if (!append_buf(&cap_buf, &cap_size, OBJ_nid2sn(nids[k])))
-                        goto end;
-
-            skip_digests:
-                fn_pk = ENGINE_get_pkey_meths(e);
-                if (fn_pk == NULL)
-                    goto skip_pmeths;
-                n = fn_pk(e, NULL, &nids, 0);
-                for (k = 0; k < n; ++k)
-                    if (!append_buf(&cap_buf, &cap_size, OBJ_nid2sn(nids[k])))
-                        goto end;
-            skip_pmeths: {
-                struct util_store_cap_data store_ctx;
-
-                store_ctx.engine = e;
-                store_ctx.cap_buf = &cap_buf;
-                store_ctx.cap_size = &cap_size;
-                store_ctx.ok = 1;
-
-                OSSL_STORE_do_all_loaders(util_store_cap, &store_ctx);
-                if (!store_ctx.ok)
-                    goto end;
-            }
-                if (cap_buf != NULL && (*cap_buf != '\0'))
-                    BIO_printf(out, " [%s]\n", cap_buf);
-
-                OPENSSL_free(cap_buf);
-            }
-            if (test_avail) {
-                BIO_printf(out, "%s", indent);
-                if (ENGINE_init(e)) {
-                    BIO_printf(out, "[ available ]\n");
-                    util_do_cmds(e, post_cmds, out, indent);
-                    ENGINE_finish(e);
-                } else {
-                    BIO_printf(out, "[ unavailable ]\n");
-                    if (test_avail_noise)
-                        ERR_print_errors_fp(stdout);
-                    ERR_clear_error();
-                }
-            }
-            if ((verbose > 0) && !util_verbose(e, verbose, out, indent))
-                goto end;
-            ENGINE_free(e);
-        } else {
-            ERR_print_errors(bio_err);
-            /* because exit codes above 127 have special meaning on Unix */
-            if (++ret > 127)
-                ret = 127;
-        }
-    }
-
-end:
-
-    ERR_print_errors(bio_err);
-    sk_OPENSSL_CSTRING_free(engines);
-    sk_OPENSSL_STRING_free(pre_cmds);
-    sk_OPENSSL_STRING_free(post_cmds);
-    BIO_free_all(out);
-    return ret;
-}
diff --git a/deps/openssl/openssl/apps/fipsinstall.c b/deps/openssl/openssl/apps/fipsinstall.c
index dcc09a5ed7f..b9b66e42b70 100644
--- a/deps/openssl/openssl/apps/fipsinstall.c
+++ b/deps/openssl/openssl/apps/fipsinstall.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -77,7 +77,8 @@ typedef enum OPTION_choice {
     OPT_NO_PBKDF2_LOWER_BOUND_CHECK,
     OPT_ECDH_COFACTOR_CHECK,
     OPT_SELF_TEST_ONLOAD,
-    OPT_SELF_TEST_ONINSTALL
+    OPT_SELF_TEST_ONINSTALL,
+    OPT_DEFER_TESTS
 } OPTION_CHOICE;

 const OPTIONS fipsinstall_options[] = {
@@ -150,6 +151,7 @@ const OPTIONS fipsinstall_options[] = {
         "Disable lower bound check for PBKDF2" },
     { "ecdh_cofactor_check", OPT_ECDH_COFACTOR_CHECK, '-',
         "Enable Cofactor check for ECDH" },
+    { "defer_tests", OPT_DEFER_TESTS, '-', "Enables test deferral" },
     OPT_SECTION("Input"),
     { "in", OPT_IN, '<', "Input config file, used when verifying" },

@@ -197,6 +199,7 @@ typedef struct {
     unsigned int x942kdf_key_check : 1;
     unsigned int pbkdf2_lower_bound_check : 1;
     unsigned int ecdh_cofactor_check : 1;
+    unsigned int defer_tests : 1;
 } FIPS_OPTS;

 /* Pedantic FIPS compliance */
@@ -231,6 +234,7 @@ static const FIPS_OPTS pedantic_opts = {
     1, /* x942kdf_key_check */
     1, /* pbkdf2_lower_bound_check */
     1, /* ecdh_cofactor_check */
+    0, /* defer_tests */
 };

 /* Default FIPS settings for backward compatibility */
@@ -265,6 +269,7 @@ static FIPS_OPTS fips_opts = {
     0, /* x942kdf_key_check */
     1, /* pbkdf2_lower_bound_check */
     0, /* ecdh_cofactor_check */
+    0, /* defer_tests */
 };

 static int check_non_pedantic_fips(int pedantic, const char *name)
@@ -309,7 +314,7 @@ static int load_fips_prov_and_run_self_test(const char *prov_name,

     prov = OSSL_PROVIDER_load(NULL, prov_name);
     if (prov == NULL) {
-        BIO_printf(bio_err, "Failed to load FIPS module\n");
+        BIO_puts(bio_err, "Failed to load FIPS module\n");
         goto end;
     }
     if (!quiet) {
@@ -321,7 +326,7 @@ static int load_fips_prov_and_run_self_test(const char *prov_name,
             &build, sizeof(build));
         *p = OSSL_PARAM_construct_end();
         if (!OSSL_PROVIDER_get_params(prov, params)) {
-            BIO_printf(bio_err, "Failed to query FIPS module parameters\n");
+            BIO_puts(bio_err, "Failed to query FIPS module parameters\n");
             goto end;
         }
         if (OSSL_PARAM_modified(params))
@@ -335,7 +340,7 @@ static int load_fips_prov_and_run_self_test(const char *prov_name,
             &vers, sizeof(vers));
         *p = OSSL_PARAM_construct_end();
         if (!OSSL_PROVIDER_get_params(prov, params)) {
-            BIO_printf(bio_err, "Failed to query FIPS module parameters\n");
+            BIO_puts(bio_err, "Failed to query FIPS module parameters\n");
             goto end;
         }
     }
@@ -363,11 +368,13 @@ static int print_mac(BIO *bio, const char *label, const unsigned char *mac,
 static int write_config_header(BIO *out, const char *prov_name,
     const char *section)
 {
-    return BIO_printf(out, "openssl_conf = openssl_init\n\n")
-        && BIO_printf(out, "[openssl_init]\n")
-        && BIO_printf(out, "providers = provider_section\n\n")
-        && BIO_printf(out, "[provider_section]\n")
-        && BIO_printf(out, "%s = %s\n\n", prov_name, section);
+    return (BIO_printf(out, "openssl_conf = openssl_init\n\n"
+                            "[openssl_init]\n"
+                            "providers = provider_section\n\n"
+                            "[provider_section]\n"
+                            "%s = %s\n\n",
+                prov_name, section)
+        > 0);
 }

 /*
@@ -386,109 +393,75 @@ static int write_config_fips_section(BIO *out, const char *section,
 {
     int ret = 0;

-    if (BIO_printf(out, "[%s]\n", section) <= 0
-        || BIO_printf(out, "activate = 1\n") <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_FIPS_PARAM_INSTALL_VERSION,
-               VERSION_VAL)
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_FIPS_PARAM_CONDITIONAL_ERRORS,
-               opts->conditional_errors ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_SECURITY_CHECKS,
-               opts->security_checks ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_HMAC_KEY_CHECK,
-               opts->hmac_key_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_KMAC_KEY_CHECK,
-               opts->kmac_key_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_TLS1_PRF_EMS_CHECK,
-               opts->tls_prf_ems_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_NO_SHORT_MAC,
-               opts->no_short_mac ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_DRBG_TRUNC_DIGEST,
-               opts->drgb_no_trunc_dgst ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_SIGNATURE_DIGEST_CHECK,
-               opts->signature_digest_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_HKDF_DIGEST_CHECK,
-               opts->hkdf_digest_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n",
-               OSSL_PROV_PARAM_TLS13_KDF_DIGEST_CHECK,
-               opts->tls13_kdf_digest_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n",
-               OSSL_PROV_PARAM_TLS1_PRF_DIGEST_CHECK,
-               opts->tls1_prf_digest_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n",
-               OSSL_PROV_PARAM_SSHKDF_DIGEST_CHECK,
-               opts->sshkdf_digest_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_SSKDF_DIGEST_CHECK,
-               opts->sskdf_digest_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n",
-               OSSL_PROV_PARAM_X963KDF_DIGEST_CHECK,
-               opts->x963kdf_digest_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_DSA_SIGN_DISABLED,
-               opts->dsa_sign_disabled ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_TDES_ENCRYPT_DISABLED,
-               opts->tdes_encrypt_disabled ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n",
-               OSSL_PROV_PARAM_RSA_PKCS15_PAD_DISABLED,
-               opts->rsa_pkcs15_padding_disabled ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n",
-               OSSL_PROV_PARAM_RSA_PSS_SALTLEN_CHECK,
-               opts->rsa_pss_saltlen_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n",
-               OSSL_PROV_PARAM_RSA_SIGN_X931_PAD_DISABLED,
-               opts->sign_x931_padding_disabled ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_HKDF_KEY_CHECK,
-               opts->hkdf_key_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_KBKDF_KEY_CHECK,
-               opts->kbkdf_key_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n",
-               OSSL_PROV_PARAM_TLS13_KDF_KEY_CHECK,
-               opts->tls13_kdf_key_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_TLS1_PRF_KEY_CHECK,
-               opts->tls1_prf_key_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_SSHKDF_KEY_CHECK,
-               opts->sshkdf_key_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_SSKDF_KEY_CHECK,
-               opts->sskdf_key_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_X963KDF_KEY_CHECK,
-               opts->x963kdf_key_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_X942KDF_KEY_CHECK,
-               opts->x942kdf_key_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n",
-               OSSL_PROV_PARAM_PBKDF2_LOWER_BOUND_CHECK,
-               opts->pbkdf2_lower_bound_check ? "1" : "0")
-            <= 0
-        || BIO_printf(out, "%s = %s\n", OSSL_PROV_PARAM_ECDH_COFACTOR_CHECK,
-               opts->ecdh_cofactor_check ? "1" : "0")
+    if (BIO_printf(out, "[%s]\n"
+                        "activate = 1\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n"
+                        "%s = %s\n",
+            section,
+            OSSL_PROV_FIPS_PARAM_INSTALL_VERSION, VERSION_VAL,
+            OSSL_PROV_FIPS_PARAM_CONDITIONAL_ERRORS, opts->conditional_errors ? "1" : "0",
+            OSSL_PROV_PARAM_SECURITY_CHECKS, opts->security_checks ? "1" : "0",
+            OSSL_PROV_PARAM_HMAC_KEY_CHECK, opts->hmac_key_check ? "1" : "0",
+            OSSL_PROV_PARAM_KMAC_KEY_CHECK, opts->kmac_key_check ? "1" : "0",
+            OSSL_PROV_PARAM_TLS1_PRF_EMS_CHECK, opts->tls_prf_ems_check ? "1" : "0",
+            OSSL_PROV_PARAM_NO_SHORT_MAC, opts->no_short_mac ? "1" : "0",
+            OSSL_PROV_PARAM_DRBG_TRUNC_DIGEST, opts->drgb_no_trunc_dgst ? "1" : "0",
+            OSSL_PROV_PARAM_SIGNATURE_DIGEST_CHECK, opts->signature_digest_check ? "1" : "0",
+            OSSL_PROV_PARAM_HKDF_DIGEST_CHECK, opts->hkdf_digest_check ? "1" : "0",
+            OSSL_PROV_PARAM_TLS13_KDF_DIGEST_CHECK, opts->tls13_kdf_digest_check ? "1" : "0",
+            OSSL_PROV_PARAM_TLS1_PRF_DIGEST_CHECK, opts->tls1_prf_digest_check ? "1" : "0",
+            OSSL_PROV_PARAM_SSHKDF_DIGEST_CHECK, opts->sshkdf_digest_check ? "1" : "0",
+            OSSL_PROV_PARAM_SSKDF_DIGEST_CHECK, opts->sskdf_digest_check ? "1" : "0",
+            OSSL_PROV_PARAM_X963KDF_DIGEST_CHECK, opts->x963kdf_digest_check ? "1" : "0",
+            OSSL_PROV_PARAM_DSA_SIGN_DISABLED, opts->dsa_sign_disabled ? "1" : "0",
+            OSSL_PROV_PARAM_TDES_ENCRYPT_DISABLED, opts->tdes_encrypt_disabled ? "1" : "0",
+            OSSL_PROV_PARAM_RSA_PKCS15_PAD_DISABLED, opts->rsa_pkcs15_padding_disabled ? "1" : "0",
+            OSSL_PROV_PARAM_RSA_PSS_SALTLEN_CHECK, opts->rsa_pss_saltlen_check ? "1" : "0",
+            OSSL_PROV_PARAM_RSA_SIGN_X931_PAD_DISABLED, opts->sign_x931_padding_disabled ? "1" : "0",
+            OSSL_PROV_PARAM_HKDF_KEY_CHECK, opts->hkdf_key_check ? "1" : "0",
+            OSSL_PROV_PARAM_KBKDF_KEY_CHECK, opts->kbkdf_key_check ? "1" : "0",
+            OSSL_PROV_PARAM_TLS13_KDF_KEY_CHECK, opts->tls13_kdf_key_check ? "1" : "0",
+            OSSL_PROV_PARAM_TLS1_PRF_KEY_CHECK, opts->tls1_prf_key_check ? "1" : "0",
+            OSSL_PROV_PARAM_SSHKDF_KEY_CHECK, opts->sshkdf_key_check ? "1" : "0",
+            OSSL_PROV_PARAM_SSKDF_KEY_CHECK, opts->sskdf_key_check ? "1" : "0",
+            OSSL_PROV_PARAM_X963KDF_KEY_CHECK, opts->x963kdf_key_check ? "1" : "0",
+            OSSL_PROV_PARAM_X942KDF_KEY_CHECK, opts->x942kdf_key_check ? "1" : "0",
+            OSSL_PROV_PARAM_PBKDF2_LOWER_BOUND_CHECK, opts->pbkdf2_lower_bound_check ? "1" : "0",
+            OSSL_PROV_PARAM_ECDH_COFACTOR_CHECK, opts->ecdh_cofactor_check ? "1" : "0")
             <= 0
         || !print_mac(out, OSSL_PROV_FIPS_PARAM_MODULE_MAC, module_mac,
-            module_mac_len))
+            module_mac_len)
+        || BIO_printf(out, "%s = %s\n", OSSL_PROV_FIPS_PARAM_DEFER_TESTS,
+               opts->defer_tests ? "1" : "0")
+            <= 0)
         goto end;

     if (install_mac != NULL
@@ -572,37 +545,37 @@ static int verify_config(const char *infile, const char *section,

     s = NCONF_get_string(conf, section, OSSL_PROV_FIPS_PARAM_INSTALL_VERSION);
     if (s == NULL || strcmp(s, VERSION_VAL) != 0) {
-        BIO_printf(bio_err, "version not found\n");
+        BIO_puts(bio_err, "version not found\n");
         goto end;
     }
     s = NCONF_get_string(conf, section, OSSL_PROV_FIPS_PARAM_MODULE_MAC);
     if (s == NULL) {
-        BIO_printf(bio_err, "Module integrity MAC not found\n");
+        BIO_puts(bio_err, "Module integrity MAC not found\n");
         goto end;
     }
     buf1 = OPENSSL_hexstr2buf(s, &len);
     if (buf1 == NULL
         || (size_t)len != module_mac_len
         || memcmp(module_mac, buf1, module_mac_len) != 0) {
-        BIO_printf(bio_err, "Module integrity mismatch\n");
+        BIO_puts(bio_err, "Module integrity mismatch\n");
         goto end;
     }
     if (install_mac != NULL && install_mac_len > 0) {
         s = NCONF_get_string(conf, section, OSSL_PROV_FIPS_PARAM_INSTALL_STATUS);
         if (s == NULL || strcmp(s, INSTALL_STATUS_VAL) != 0) {
-            BIO_printf(bio_err, "install status not found\n");
+            BIO_puts(bio_err, "install status not found\n");
             goto end;
         }
         s = NCONF_get_string(conf, section, OSSL_PROV_FIPS_PARAM_INSTALL_MAC);
         if (s == NULL) {
-            BIO_printf(bio_err, "Install indicator MAC not found\n");
+            BIO_puts(bio_err, "Install indicator MAC not found\n");
             goto end;
         }
         buf2 = OPENSSL_hexstr2buf(s, &len);
         if (buf2 == NULL
             || (size_t)len != install_mac_len
             || memcmp(install_mac, buf2, install_mac_len) != 0) {
-            BIO_printf(bio_err, "Install indicator status mismatch\n");
+            BIO_puts(bio_err, "Install indicator status mismatch\n");
             goto end;
         }
     }
@@ -802,6 +775,9 @@ int fipsinstall_main(int argc, char **argv)
             set_selftest_onload_option = 1;
             fips_opts.self_test_onload = 0;
             break;
+        case OPT_DEFER_TESTS:
+            fips_opts.defer_tests = 1;
+            break;
         }
     }

@@ -850,7 +826,7 @@ int fipsinstall_main(int argc, char **argv)

     module_bio = bio_open_default(module_fname, 'r', FORMAT_BINARY);
     if (module_bio == NULL) {
-        BIO_printf(bio_err, "Failed to open module file\n");
+        BIO_puts(bio_err, "Failed to open module file\n");
         goto end;
     }

@@ -866,7 +842,7 @@ int fipsinstall_main(int argc, char **argv)

     ctx = EVP_MAC_CTX_new(mac);
     if (ctx == NULL) {
-        BIO_printf(bio_err, "Unable to create MAC CTX for module check\n");
+        BIO_puts(bio_err, "Unable to create MAC CTX for module check\n");
         goto end;
     }

@@ -878,7 +854,7 @@ int fipsinstall_main(int argc, char **argv)
             goto end;

         if (!EVP_MAC_CTX_set_params(ctx, params)) {
-            BIO_printf(bio_err, "MAC parameter error\n");
+            BIO_puts(bio_err, "MAC parameter error\n");
             ERR_print_errors(bio_err);
             ok = 0;
         }
@@ -889,7 +865,7 @@ int fipsinstall_main(int argc, char **argv)

     ctx2 = EVP_MAC_CTX_dup(ctx);
     if (ctx2 == NULL) {
-        BIO_printf(bio_err, "Unable to create MAC CTX for install indicator\n");
+        BIO_puts(bio_err, "Unable to create MAC CTX for install indicator\n");
         goto end;
     }

@@ -898,9 +874,9 @@ int fipsinstall_main(int argc, char **argv)

     /* Calculate the MAC for the indicator status - it may not be used */
     mem_bio = BIO_new_mem_buf((const void *)INSTALL_STATUS_VAL,
-        strlen(INSTALL_STATUS_VAL));
+        (int)strlen(INSTALL_STATUS_VAL));
     if (mem_bio == NULL) {
-        BIO_printf(bio_err, "Unable to create memory BIO\n");
+        BIO_puts(bio_err, "Unable to create memory BIO\n");
         goto end;
     }
     if (!do_mac(ctx2, read_buffer, mem_bio, install_mac, &install_mac_len))
@@ -913,7 +889,7 @@ int fipsinstall_main(int argc, char **argv)
                 install_mac, install_mac_len))
             goto end;
         if (!quiet)
-            BIO_printf(bio_err, "VERIFY PASSED\n");
+            BIO_puts(bio_err, "VERIFY PASSED\n");
     } else {
         conf = generate_config_and_load(prov_name, section_name, module_mac,
             module_mac_len, &fips_opts);
@@ -936,7 +912,7 @@ int fipsinstall_main(int argc, char **argv)
         fout = out_fname == NULL ? dup_bio_out(FORMAT_TEXT)
                                  : bio_open_default(out_fname, 'w', FORMAT_TEXT);
         if (fout == NULL) {
-            BIO_printf(bio_err, "Failed to open file\n");
+            BIO_puts(bio_err, "Failed to open file\n");
             goto end;
         }

@@ -945,7 +921,7 @@ int fipsinstall_main(int argc, char **argv)
                 install_mac, install_mac_len))
             goto end;
         if (!quiet)
-            BIO_printf(bio_err, "INSTALL PASSED\n");
+            BIO_puts(bio_err, "INSTALL PASSED\n");
     }

     ret = 0;
diff --git a/deps/openssl/openssl/apps/gendsa.c b/deps/openssl/openssl/apps/gendsa.c
index f0f8c383dc3..43f9194f5ec 100644
--- a/deps/openssl/openssl/apps/gendsa.c
+++ b/deps/openssl/openssl/apps/gendsa.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -26,7 +26,6 @@ typedef enum OPTION_choice {
     OPT_COMMON,
     OPT_OUT,
     OPT_PASSOUT,
-    OPT_ENGINE,
     OPT_CIPHER,
     OPT_VERBOSE,
     OPT_QUIET,
@@ -39,9 +38,6 @@ const OPTIONS gendsa_options[] = {

     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif

     OPT_SECTION("Output"),
     { "out", OPT_OUT, '>', "Output the key to the specified file" },
@@ -59,7 +55,6 @@ const OPTIONS gendsa_options[] = {

 int gendsa_main(int argc, char **argv)
 {
-    ENGINE *e = NULL;
     BIO *out = NULL, *in = NULL;
     EVP_PKEY *pkey = NULL;
     EVP_PKEY_CTX *ctx = NULL;
@@ -88,9 +83,6 @@ int gendsa_main(int argc, char **argv)
         case OPT_PASSOUT:
             passoutarg = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_R_CASES:
             if (!opt_rand(o))
                 goto end;
@@ -125,7 +117,7 @@ int gendsa_main(int argc, char **argv)
     private = 1;

     if (!app_passwd(NULL, passoutarg, NULL, &passout)) {
-        BIO_printf(bio_err, "Error getting password\n");
+        BIO_puts(bio_err, "Error getting password\n");
         goto end;
     }

@@ -144,13 +136,13 @@ int gendsa_main(int argc, char **argv)

     ctx = EVP_PKEY_CTX_new_from_pkey(app_get0_libctx(), pkey, app_get0_propq());
     if (ctx == NULL) {
-        BIO_printf(bio_err, "unable to create PKEY context\n");
+        BIO_puts(bio_err, "unable to create PKEY context\n");
         goto end;
     }
     EVP_PKEY_free(pkey);
     pkey = NULL;
     if (EVP_PKEY_keygen_init(ctx) <= 0) {
-        BIO_printf(bio_err, "unable to set up for key generation\n");
+        BIO_puts(bio_err, "unable to set up for key generation\n");
         goto end;
     }
     pkey = app_keygen(ctx, "DSA", nbits, verbose);
@@ -159,7 +151,7 @@ int gendsa_main(int argc, char **argv)

     assert(private);
     if (!PEM_write_bio_PrivateKey(out, pkey, enc, NULL, 0, NULL, passout)) {
-        BIO_printf(bio_err, "unable to output generated key\n");
+        BIO_puts(bio_err, "unable to output generated key\n");
         goto end;
     }
     ret = 0;
@@ -172,7 +164,6 @@ end2:
     EVP_PKEY_free(pkey);
     EVP_PKEY_CTX_free(ctx);
     EVP_CIPHER_free(enc);
-    release_engine(e);
     OPENSSL_free(passout);
     return ret;
 }
diff --git a/deps/openssl/openssl/apps/genpkey.c b/deps/openssl/openssl/apps/genpkey.c
index 50d088126f3..a6d1786d567 100644
--- a/deps/openssl/openssl/apps/genpkey.c
+++ b/deps/openssl/openssl/apps/genpkey.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,14 +15,14 @@
 #include <openssl/err.h>
 #include <openssl/evp.h>

-static int verbose = 1;
+static int verbose = 0;

-static int init_keygen_file(EVP_PKEY_CTX **pctx, const char *file, ENGINE *e,
+static int init_keygen_file(EVP_PKEY_CTX **pctx, const char *file,
     OSSL_LIB_CTX *libctx, const char *propq);
 typedef enum OPTION_choice {
     OPT_COMMON,
-    OPT_ENGINE,
     OPT_OUTFORM,
+    OPT_ENCOPT,
     OPT_OUT,
     OPT_PASS,
     OPT_PARAMFILE,
@@ -42,9 +42,6 @@ typedef enum OPTION_choice {
 const OPTIONS genpkey_options[] = {
     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif
     { "paramfile", OPT_PARAMFILE, '<', "Parameters file" },
     { "algorithm", OPT_ALGORITHM, 's', "The public key algorithm" },
     { "verbose", OPT_VERBOSE, '-', "Output status while generating keys" },
@@ -57,6 +54,7 @@ const OPTIONS genpkey_options[] = {
     { "out", OPT_OUT, '>', "Output (private key) file" },
     { "outpubkey", OPT_OUTPUBKEY, '>', "Output public key file" },
     { "outform", OPT_OUTFORM, 'F', "output format (DER or PEM)" },
+    { "encopt", OPT_ENCOPT, 's', "Private key encoder parameter" },
     { "pass", OPT_PASS, 's', "Output file pass phrase source" },
     { "genparam", OPT_GENPARAM, '-', "Generate parameters, not key" },
     { "text", OPT_TEXT, '-', "Print the private key in text" },
@@ -110,7 +108,7 @@ static void show_gen_pkeyopt(const char *algname, OSSL_LIB_CTX *libctx, const ch
     if (params == NULL)
         goto cleanup;

-    BIO_printf(bio_err, "\nThe possible -pkeyopt arguments are:\n");
+    BIO_puts(bio_err, "\nThe possible -pkeyopt arguments are:\n");
     for (i = 0; params[i].key != NULL; ++i) {
         const char *name = param_datatype_2name(params[i].data_type, &ishex);

@@ -125,7 +123,6 @@ int genpkey_main(int argc, char **argv)
 {
     CONF *conf = NULL;
     BIO *mem_out = NULL, *mem_outpubkey = NULL;
-    ENGINE *e = NULL;
     EVP_PKEY *pkey = NULL;
     EVP_PKEY_CTX *ctx = NULL;
     char *outfile = NULL, *passarg = NULL, *pass = NULL, *prog, *p;
@@ -135,6 +132,7 @@ int genpkey_main(int argc, char **argv)
     OPTION_CHOICE o;
     int outformat = FORMAT_PEM, text = 0, ret = 1, rv, do_param = 0;
     int private = 0, i;
+    STACK_OF(OPENSSL_STRING) *encopt = NULL;
     OSSL_LIB_CTX *libctx = app_get0_libctx();
     STACK_OF(OPENSSL_STRING) *keyopt = NULL;

@@ -159,6 +157,12 @@ int genpkey_main(int argc, char **argv)
             if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &outformat))
                 goto opthelp;
             break;
+        case OPT_ENCOPT:
+            if (encopt == NULL)
+                encopt = sk_OPENSSL_STRING_new_null();
+            if (!sk_OPENSSL_STRING_push(encopt, opt_arg()))
+                goto end;
+            break;
         case OPT_OUT:
             outfile = opt_arg();
             break;
@@ -168,9 +172,6 @@ int genpkey_main(int argc, char **argv)
         case OPT_PASS:
             passarg = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_PARAMFILE:
             if (do_param == 1)
                 goto opthelp;
@@ -223,11 +224,11 @@ int genpkey_main(int argc, char **argv)

     /* Fetch cipher, etc. */
     if (paramfile != NULL) {
-        if (!init_keygen_file(&ctx, paramfile, e, libctx, app_get0_propq()))
+        if (!init_keygen_file(&ctx, paramfile, libctx, app_get0_propq()))
             goto end;
     }
     if (algname != NULL) {
-        if (!init_gen_str(&ctx, algname, e, do_param, libctx, app_get0_propq()))
+        if (!init_gen_str(&ctx, algname, do_param, libctx, app_get0_propq()))
             goto end;
     }
     if (ctx == NULL)
@@ -244,7 +245,7 @@ int genpkey_main(int argc, char **argv)
     if (!opt_cipher(ciphername, &cipher))
         goto opthelp;
     if (ciphername != NULL && do_param == 1) {
-        BIO_printf(bio_err, "Cannot use cipher with -genparam option\n");
+        BIO_puts(bio_err, "Cannot use cipher with -genparam option\n");
         goto opthelp;
     }

@@ -272,7 +273,7 @@ int genpkey_main(int argc, char **argv)
     EVP_PKEY_CTX_set_app_data(ctx, bio_err);

     pkey = do_param ? app_paramgen(ctx, algname)
-                    : app_keygen(ctx, algname, 0, 0 /* not verbose */);
+                    : app_keygen(ctx, algname, 0, verbose);
     if (pkey == NULL)
         goto end;

@@ -280,16 +281,16 @@ int genpkey_main(int argc, char **argv)
         rv = PEM_write_bio_Parameters(mem_out, pkey);
     } else if (outformat == FORMAT_PEM) {
         assert(private);
-        rv = PEM_write_bio_PrivateKey(mem_out, pkey, cipher, NULL, 0, NULL, pass);
+        rv = encode_private_key(mem_out, "PEM", pkey, encopt, cipher, pass);
         if (rv > 0 && mem_outpubkey != NULL)
             rv = PEM_write_bio_PUBKEY(mem_outpubkey, pkey);
     } else if (outformat == FORMAT_ASN1) {
         assert(private);
-        rv = i2d_PrivateKey_bio(mem_out, pkey);
+        rv = encode_private_key(mem_out, "DER", pkey, encopt, cipher, pass);
         if (rv > 0 && mem_outpubkey != NULL)
             rv = i2d_PUBKEY_bio(mem_outpubkey, pkey);
     } else {
-        BIO_printf(bio_err, "Bad format specified for key\n");
+        BIO_puts(bio_err, "Bad format specified for key\n");
         goto end;
     }

@@ -330,18 +331,18 @@ end:
                     outfile, strerror(errno));
         }
     }
+    sk_OPENSSL_STRING_free(encopt);
     EVP_PKEY_free(pkey);
     EVP_PKEY_CTX_free(ctx);
     EVP_CIPHER_free(cipher);
     BIO_free_all(mem_out);
     BIO_free_all(mem_outpubkey);
-    release_engine(e);
     OPENSSL_free(pass);
     NCONF_free(conf);
     return ret;
 }

-static int init_keygen_file(EVP_PKEY_CTX **pctx, const char *file, ENGINE *e,
+static int init_keygen_file(EVP_PKEY_CTX **pctx, const char *file,
     OSSL_LIB_CTX *libctx, const char *propq)
 {
     BIO *pbio;
@@ -366,10 +367,7 @@ static int init_keygen_file(EVP_PKEY_CTX **pctx, const char *file, ENGINE *e,
         return 0;
     }

-    if (e != NULL)
-        ctx = EVP_PKEY_CTX_new(pkey, e);
-    else
-        ctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, propq);
+    ctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, propq);
     if (ctx == NULL)
         goto err;
     if (EVP_PKEY_keygen_init(ctx) <= 0)
@@ -387,22 +385,17 @@ err:
 }

 int init_gen_str(EVP_PKEY_CTX **pctx,
-    const char *algname, ENGINE *e, int do_param,
+    const char *algname, int do_param,
     OSSL_LIB_CTX *libctx, const char *propq)
 {
     EVP_PKEY_CTX *ctx = NULL;
-    int pkey_id;

     if (*pctx) {
         BIO_puts(bio_err, "Algorithm already set!\n");
         return 0;
     }

-    pkey_id = get_legacy_pkey_id(libctx, algname, e);
-    if (pkey_id != NID_undef)
-        ctx = EVP_PKEY_CTX_new_id(pkey_id, e);
-    else
-        ctx = EVP_PKEY_CTX_new_from_name(libctx, algname, propq);
+    ctx = EVP_PKEY_CTX_new_from_name(libctx, algname, propq);

     if (ctx == NULL)
         goto err;
diff --git a/deps/openssl/openssl/apps/genrsa.c b/deps/openssl/openssl/apps/genrsa.c
index 3dce82beca1..6150f59a871 100644
--- a/deps/openssl/openssl/apps/genrsa.c
+++ b/deps/openssl/openssl/apps/genrsa.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -35,7 +35,6 @@ typedef enum OPTION_choice {
     OPT_3,
 #endif
     OPT_F4,
-    OPT_ENGINE,
     OPT_OUT,
     OPT_PASSOUT,
     OPT_CIPHER,
@@ -52,9 +51,6 @@ const OPTIONS genrsa_options[] = {

     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif

     OPT_SECTION("Input"),
 #ifndef OPENSSL_NO_DEPRECATED_3_0
@@ -84,7 +80,6 @@ const OPTIONS genrsa_options[] = {
 int genrsa_main(int argc, char **argv)
 {
     BN_GENCB *cb = BN_GENCB_new();
-    ENGINE *eng = NULL;
     BIGNUM *bn = BN_new();
     BIO *out = NULL;
     EVP_PKEY *pkey = NULL;
@@ -124,9 +119,6 @@ int genrsa_main(int argc, char **argv)
         case OPT_OUT:
             outfile = opt_arg();
             break;
-        case OPT_ENGINE:
-            eng = setup_engine(opt_arg(), 0);
-            break;
         case OPT_R_CASES:
             if (!opt_rand(o))
                 goto end;
@@ -161,8 +153,12 @@ int genrsa_main(int argc, char **argv)
     argv = opt_rest();

     if (argc == 1) {
-        if (!opt_int(argv[0], &num) || num <= 0)
+        if (!opt_int(argv[0], &num))
             goto end;
+        if (num <= 0) {
+            BIO_printf(bio_err, "%s: Invalid number of bits: %d\n", prog, num);
+            goto end;
+        }
         if (num > OPENSSL_RSA_MAX_MODULUS_BITS)
             BIO_printf(bio_err,
                 "Warning: It is not recommended to use more than %d bit for RSA keys.\n"
@@ -179,7 +175,7 @@ int genrsa_main(int argc, char **argv)
     if (!opt_cipher(ciphername, &enc))
         goto end;
     if (!app_passwd(NULL, passoutarg, NULL, &passout)) {
-        BIO_printf(bio_err, "Error getting password\n");
+        BIO_puts(bio_err, "Error getting password\n");
         goto end;
     }

@@ -187,7 +183,7 @@ int genrsa_main(int argc, char **argv)
     if (out == NULL)
         goto end;

-    if (!init_gen_str(&ctx, "RSA", eng, 0, app_get0_libctx(),
+    if (!init_gen_str(&ctx, "RSA", 0, app_get0_libctx(),
             app_get0_propq()))
         goto end;

@@ -196,19 +192,19 @@ int genrsa_main(int argc, char **argv)
     EVP_PKEY_CTX_set_app_data(ctx, bio_err);

     if (EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, num) <= 0) {
-        BIO_printf(bio_err, "Error setting RSA length\n");
+        BIO_puts(bio_err, "Error setting RSA length\n");
         goto end;
     }
     if (!BN_set_word(bn, f4)) {
-        BIO_printf(bio_err, "Error allocating RSA public exponent\n");
+        BIO_puts(bio_err, "Error allocating RSA public exponent\n");
         goto end;
     }
     if (EVP_PKEY_CTX_set1_rsa_keygen_pubexp(ctx, bn) <= 0) {
-        BIO_printf(bio_err, "Error setting RSA public exponent\n");
+        BIO_puts(bio_err, "Error setting RSA public exponent\n");
         goto end;
     }
     if (EVP_PKEY_CTX_set_rsa_keygen_primes(ctx, primes) <= 0) {
-        BIO_printf(bio_err, "Error setting number of primes\n");
+        BIO_puts(bio_err, "Error setting number of primes\n");
         goto end;
     }
     pkey = app_keygen(ctx, "RSA", num, verbose);
@@ -221,7 +217,7 @@ int genrsa_main(int argc, char **argv)
         /* Every RSA key has an 'e' */
         EVP_PKEY_get_bn_param(pkey, "e", &e);
         if (e == NULL) {
-            BIO_printf(bio_err, "Error cannot access RSA e\n");
+            BIO_puts(bio_err, "Error cannot access RSA e\n");
             goto end;
         }
         hexe = BN_bn2hex(e);
@@ -250,7 +246,6 @@ end:
     EVP_PKEY_free(pkey);
     EVP_CIPHER_free(enc);
     BIO_free_all(out);
-    release_engine(eng);
     OPENSSL_free(passout);
     if (ret != 0)
         ERR_print_errors(bio_err);
diff --git a/deps/openssl/openssl/apps/include/app_params.h b/deps/openssl/openssl/apps/include/app_params.h
index 20caf737d4d..c76323a007d 100644
--- a/deps/openssl/openssl/apps/include/app_params.h
+++ b/deps/openssl/openssl/apps/include/app_params.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,7 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_APPS_INCLUDE_APP_PARAMS_H)
+#define OSSL_APPS_INCLUDE_APP_PARAMS_H
+
 #include <openssl/core.h>

 int print_param_types(const char *thing, const OSSL_PARAM *pdefs, int indent);
 void print_param_value(const OSSL_PARAM *p, int indent);
+
+#endif /* !defined(OSSL_APPS_INCLUDE_APP_PARAMS_H) */
diff --git a/deps/openssl/openssl/apps/include/apps.h b/deps/openssl/openssl/apps/include/apps.h
index 06ba38a5851..80bd775ffb0 100644
--- a/deps/openssl/openssl/apps/include/apps.h
+++ b/deps/openssl/openssl/apps/include/apps.h
@@ -10,6 +10,16 @@
 #ifndef OSSL_APPS_H
 #define OSSL_APPS_H

+#if defined(__linux__) || defined(__sun__) || defined(__hpux)
+/*
+ * Allow open() and stat() to work with files larger than 2GB on 32-bit
+ * systems.  See crypto/o_fopen.c and crypto/bio/bss_file.c.
+ */
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
+#endif
+
 #include "internal/common.h" /* for HAS_PREFIX */
 #include "internal/nelem.h"
 #include <assert.h>
@@ -22,12 +32,24 @@
 #endif

 #include <openssl/e_os2.h>
+#if defined(OPENSSL_SYS_UNIX) && defined(_POSIX_MAPPED_FILES) && _POSIX_MAPPED_FILES > 0
+#include <sys/mman.h>
+#include <unistd.h>
+/*
+ * Map a file read-only into memory.  Returns 1 on success (*out_data and
+ * *out_size set; caller must munmap when done), 0 when file size is 0 (no
+ * error, caller may use buffer path), or -1 on error (message printed to
+ * bio_err).  known_size: (size_t)-1 = stat to get size; 0 = do not map
+ * (return 0); > 0 = use this size (caller obtained it from stat of same path).
+ */
+int app_mmap_file(const char *path, BIO *err_bio, size_t known_size,
+    const unsigned char **out_data, size_t *out_size);
+#endif
 #include <openssl/types.h>
 #include <openssl/bio.h>
 #include <openssl/x509.h>
 #include <openssl/conf.h>
 #include <openssl/txt_db.h>
-#include <openssl/engine.h>
 #include <openssl/ocsp.h>
 #include <openssl/http.h>
 #include <signal.h>
@@ -35,7 +57,6 @@
 #include "opt.h"
 #include "fmt.h"
 #include "platform.h"
-#include "engine_loader.h"
 #include "app_libctx.h"

 /*
@@ -80,7 +101,7 @@ void wait_for_async(SSL *s);
 int has_stdin_waiting(void);
 #endif

-void corrupt_signature(const ASN1_STRING *signature);
+int corrupt_signature(ASN1_STRING *signature);

 /* Helpers for setting X509v3 certificate fields notBefore and notAfter */
 int check_cert_time_string(const char *time, const char *desc);
@@ -104,6 +125,10 @@ int wrap_password_callback(char *buf, int bufsiz, int verify, void *cb_data);
 int progress_cb(EVP_PKEY_CTX *ctx);

 void dump_cert_text(BIO *out, X509 *x);
+int encode_private_key(
+    BIO *out, const char *output_type, const EVP_PKEY *pkey,
+    const STACK_OF(OPENSSL_STRING) *encopt, const EVP_CIPHER *cipher,
+    const char *pass);
 void print_name(BIO *out, const char *title, const X509_NAME *nm);
 void print_bignum_var(BIO *, const BIGNUM *, const char *,
     int, unsigned char *);
@@ -129,23 +154,24 @@ X509_CRL *load_crl(const char *uri, int format, int maybe_stdin,
 void cleanse(char *str);
 void clear_free(char *str);
 EVP_PKEY *load_key(const char *uri, int format, int maybe_stdin,
-    const char *pass, ENGINE *e, const char *desc);
+    const char *pass, const char *desc);
 /* first try reading public key, on failure resort to loading private key */
 EVP_PKEY *load_pubkey(const char *uri, int format, int maybe_stdin,
-    const char *pass, ENGINE *e, const char *desc);
+    const char *pass, const char *desc);
 EVP_PKEY *load_keyparams(const char *uri, int format, int maybe_stdin,
     const char *keytype, const char *desc);
 EVP_PKEY *load_keyparams_suppress(const char *uri, int format, int maybe_stdin,
     const char *keytype, const char *desc,
     int suppress_decode_errors);
 char *next_item(char *opt); /* in list separated by comma and/or space */
+char *process_additional_mac_key_arguments(const char *arg);
+char *get_str_from_file(const char *filename);
 int load_cert_certs(const char *uri,
     X509 **pcert, STACK_OF(X509) **pcerts,
-    int exclude_http, const char *pass, const char *desc,
-    X509_VERIFY_PARAM *vpm);
-STACK_OF(X509) *load_certs_multifile(char *files, const char *pass,
+    int exclude_http, const char *pass, const char *desc, X509_VERIFY_PARAM *vpm);
+STACK_OF(X509) *load_certs_multifile(char *files, const char *source,
     const char *desc, X509_VERIFY_PARAM *vpm);
-X509_STORE *load_certstore(char *input, const char *pass, const char *desc,
+X509_STORE *load_certstore(char *input, const char *source, const char *desc,
     X509_VERIFY_PARAM *vpm);
 int load_certs(const char *uri, int maybe_stdin, STACK_OF(X509) **certs,
     const char *pass, const char *desc);
@@ -156,7 +182,11 @@ int load_key_certs_crls(const char *uri, int format, int maybe_stdin,
     EVP_PKEY **ppkey, EVP_PKEY **ppubkey,
     EVP_PKEY **pparams,
     X509 **pcert, STACK_OF(X509) **pcerts,
-    X509_CRL **pcrl, STACK_OF(X509_CRL) **pcrls);
+    X509_CRL **pcrl, STACK_OF(X509_CRL) **pcrls,
+    EVP_SKEY **pskey);
+EVP_SKEY *load_skey(const char *uri, int format, int maybe_stdin,
+    const char *pass, int quiet);
+int load_rpk_file(SSL *ssl, const char *file);
 X509_STORE *setup_verify(const char *CAfile, int noCAfile,
     const char *CApath, int noCApath,
     const char *CAstore, int noCAstore);
@@ -176,17 +206,6 @@ __owur int ctx_set_ctlog_list_file(SSL_CTX *ctx, const char *path);

 #endif

-ENGINE *setup_engine_methods(const char *id, unsigned int methods, int debug);
-#define setup_engine(e, debug) setup_engine_methods(e, (unsigned int)-1, debug)
-void release_engine(ENGINE *e);
-int init_engine(ENGINE *e);
-int finish_engine(ENGINE *e);
-char *make_engine_uri(ENGINE *e, const char *key_id, const char *desc);
-
-int get_legacy_pkey_id(OSSL_LIB_CTX *libctx, const char *algname, ENGINE *e);
-const EVP_MD *get_digest_from_engine(const char *name);
-const EVP_CIPHER *get_cipher_from_engine(const char *name);
-
 #ifndef OPENSSL_NO_OCSP
 OCSP_RESPONSE *process_responder(OCSP_REQUEST *req, const char *host,
     const char *port, const char *path,
@@ -224,10 +243,29 @@ typedef struct ca_db_st {
 #endif
 } CA_DB;

-extern int do_updatedb(CA_DB *db, time_t *now);
+extern int do_updatedb(CA_DB *db, const time_t *now);

 void app_bail_out(char *fmt, ...);
+/**
+ * OPENSSL_malloc() wrapper that bails out with a meaningful message on failure.
+ *
+ * @param sz   Number of bytes to allocate.
+ * @param what Description of the object being allocated.
+ * @return On success, returns a pointer to the newly allocated memory.
+ *         on failure, calls app_bail_out() to terminate the program.
+ */
 void *app_malloc(size_t sz, const char *what);
+/**
+ * OPENSSL_malloc_array() wrapper that bails out with a meaningful message
+ * on failure.
+ *
+ * @param n    Number of objects to allocate memory for.
+ * @param sz   Size in bytes of each object to be allocated.
+ * @param what Description of the array being allocated.
+ * @return On success, returns a pointer to the newly allocated memory;
+ *         on failure, calls app_bail_out() to terminate the program.
+ */
+void *app_malloc_array(size_t n, size_t sz, const char *what);

 /* load_serial, save_serial, and rotate_serial are also used for CRL numbers */
 BIGNUM *load_serial(const char *serialfile, int *exists, int create,
@@ -258,9 +296,13 @@ int pkey_ctrl_string(EVP_PKEY_CTX *ctx, const char *value);
 int x509_ctrl_string(X509 *x, const char *value);
 int x509_req_ctrl_string(X509_REQ *x, const char *value);
 int init_gen_str(EVP_PKEY_CTX **pctx,
-    const char *algname, ENGINE *e, int do_param,
+    const char *algname, int do_param,
     OSSL_LIB_CTX *libctx, const char *propq);
 int cert_matches_key(const X509 *cert, const EVP_PKEY *pkey);
+int do_EXT_add_nconf(CONF *conf1, CONF *conf2, X509V3_CTX *ctx,
+    X509 *cert, const char *msg, const char *sect);
+int do_EXT_REQ_add_nconf(CONF *conf1, CONF *conf2, X509V3_CTX *ctx,
+    X509_REQ *req, const char *msg, const char *sect);
 int do_X509_sign(X509 *x, int force_v1, EVP_PKEY *pkey, const char *md,
     STACK_OF(OPENSSL_STRING) *sigopts, X509V3_CTX *ext_ctx);
 int do_X509_verify(X509 *x, EVP_PKEY *pkey, STACK_OF(OPENSSL_STRING) *vfyopts);
@@ -275,12 +317,14 @@ extern char *psk_key;

 unsigned char *next_protos_parse(size_t *outlen, const char *in);

-int check_cert_attributes(BIO *bio, X509 *x,
+int check_cert_might_be_valid(BIO *bio, BIO *bio_err, X509 *x,
     const char *checkhost, const char *checkemail,
-    const char *checkip, int print);
+    const char *checkip);

 void store_setup_crl_download(X509_STORE *st);

+int host_is_ip_address(const char *host);
+
 typedef struct app_http_tls_info_st {
     const char *server;
     const char *port;
diff --git a/deps/openssl/openssl/apps/include/apps_ui.h b/deps/openssl/openssl/apps/include/apps_ui.h
index ea41c092f4d..a6ad39de461 100644
--- a/deps/openssl/openssl/apps/include/apps_ui.h
+++ b/deps/openssl/openssl/apps/include/apps_ui.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -10,6 +10,9 @@
 #ifndef OSSL_APPS_UI_H
 #define OSSL_APPS_UI_H

+#include <openssl/types.h>
+#include <openssl/ui.h>
+
 #define PW_MIN_LENGTH 4
 typedef struct pw_cb_data {
     const void *password;
diff --git a/deps/openssl/openssl/apps/include/configuration.h.in b/deps/openssl/openssl/apps/include/configuration.h.in
new file mode 100644
index 00000000000..71b6ff434ed
--- /dev/null
+++ b/deps/openssl/openssl/apps/include/configuration.h.in
@@ -0,0 +1,44 @@
+/*
+ * {- join("\n * ", @autowarntext) -}
+ *
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef APPS_CONFIGURATION_H
+#define APPS_CONFIGURATION_H
+
+/* clang-format off */
+{-
+    my $generate_openssl_disable_array = sub {
+      my ($key) = @_;
+      my $data = $config{$key};
+      my $res = "static const char * const ${key}[] = {\n";
+
+      $res .= "\t\"\",\n";
+
+      if ($data && @$data) {
+
+          foreach (@$data) {
+              $res .= "\t\"$_\",\n";
+          }
+      }
+
+      $res .= "};\n";
+
+      return $res;
+    };
+
+    $OUT .= $generate_openssl_disable_array->('openssl_disabled_protocols');
+    $OUT .= "\n";
+    $OUT .= $generate_openssl_disable_array->('openssl_disabled_algorithms');
+    $OUT .= "\n";
+    $OUT .= $generate_openssl_disable_array->('openssl_disabled_features');
+-}
+/* clang-format on */
+
+#endif
diff --git a/deps/openssl/openssl/apps/include/ec_common.h b/deps/openssl/openssl/apps/include/ec_common.h
index f5711657a29..ac050f2e219 100644
--- a/deps/openssl/openssl/apps/include/ec_common.h
+++ b/deps/openssl/openssl/apps/include/ec_common.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,7 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(APPS_INCLUDE_EC_COMMON_H)
+#define APPS_INCLUDE_EC_COMMON_H
+
 #ifndef OPENSSL_NO_EC
+#include <stddef.h>
+
 static const char *point_format_options[] = {
     "uncompressed",
     "compressed",
@@ -21,3 +26,5 @@ static const char *asn1_encoding_options[] = {
     NULL
 };
 #endif
+
+#endif /* !defined(APPS_INCLUDE_EC_COMMON_H) */
diff --git a/deps/openssl/openssl/apps/include/engine_loader.h b/deps/openssl/openssl/apps/include/engine_loader.h
deleted file mode 100644
index 759d94ef597..00000000000
--- a/deps/openssl/openssl/apps/include/engine_loader.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright 2018-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-#ifndef HEADER_ENGINE_LOADER_H
-#define HEADER_ENGINE_LOADER_H
-
-#include <openssl/store.h>
-
-/* this is a private URI scheme */
-#define ENGINE_SCHEME "org.openssl.engine"
-#define ENGINE_SCHEME_COLON ENGINE_SCHEME ":"
-
-int setup_engine_loader(void);
-void destroy_engine_loader(void);
-
-#endif
diff --git a/deps/openssl/openssl/apps/include/fmt.h b/deps/openssl/openssl/apps/include/fmt.h
index 3cb2dc80823..a799b0f0036 100644
--- a/deps/openssl/openssl/apps/include/fmt.h
+++ b/deps/openssl/openssl/apps/include/fmt.h
@@ -32,7 +32,6 @@
 #define FORMAT_PEM (5 | B_FORMAT_TEXT)
 #define FORMAT_PKCS12 6
 #define FORMAT_SMIME (7 | B_FORMAT_TEXT)
-#define FORMAT_ENGINE 8 /* Not really a file format */
 #define FORMAT_PEMRSA (9 | B_FORMAT_TEXT) /* PEM RSAPublicKey format */
 #define FORMAT_ASN1RSA 10 /* DER RSAPublicKey format */
 #define FORMAT_MSBLOB 11 /* MS Key blob format */
diff --git a/deps/openssl/openssl/apps/include/names.h b/deps/openssl/openssl/apps/include/names.h
index bf47459ade5..a9f81756f33 100644
--- a/deps/openssl/openssl/apps/include/names.h
+++ b/deps/openssl/openssl/apps/include/names.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,7 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_APPS_INCLUDE_NAMES_H)
+#define OSSL_APPS_INCLUDE_NAMES_H
+
+#include <openssl/evp.h>
 #include <openssl/safestack.h>
+#include <openssl/types.h>

 /* Standard comparing function for names */
 int name_cmp(const char *const *a, const char *const *b);
@@ -15,3 +20,5 @@ int name_cmp(const char *const *a, const char *const *b);
 void collect_names(const char *name, void *vdata);
 /* Sorts and prints a stack of names to |out| */
 void print_names(BIO *out, STACK_OF(OPENSSL_CSTRING) *names);
+
+#endif /* !defined(OSSL_APPS_INCLUDE_NAMES_H) */
diff --git a/deps/openssl/openssl/apps/include/opt.h b/deps/openssl/openssl/apps/include/opt.h
index 3b467c0d47a..1023bfe601f 100644
--- a/deps/openssl/openssl/apps/include/opt.h
+++ b/deps/openssl/openssl/apps/include/opt.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -39,9 +39,9 @@
         { "purpose", OPT_V_PURPOSE, 's',                                                   \
             "certificate chain purpose" },                                                 \
         { "verify_name", OPT_V_VERIFY_NAME, 's', "verification policy name" },             \
-        { "verify_depth", OPT_V_VERIFY_DEPTH, 'n',                                         \
+        { "verify_depth", OPT_V_VERIFY_DEPTH, 'N',                                         \
             "chain depth limit" },                                                         \
-        { "auth_level", OPT_V_VERIFY_AUTH_LEVEL, 'n',                                      \
+        { "auth_level", OPT_V_VERIFY_AUTH_LEVEL, 'N',                                      \
             "chain authentication security level" },                                       \
         { "attime", OPT_V_ATTIME, 'M', "verification epoch time" },                        \
         { "verify_hostname", OPT_V_VERIFY_HOSTNAME, 's',                                   \
@@ -220,12 +220,12 @@
             "Groups to advertise (colon-separated list)" },                                                     \
         { "named_curve", OPT_S_NAMEDCURVE, 's',                                                                 \
             "Elliptic curve used for ECDHE (server-side only)" },                                               \
-        { "cipher", OPT_S_CIPHER, 's', "Specify TLSv1.2 and below cipher list to be used" },                    \
-        { "ciphersuites", OPT_S_CIPHERSUITES, 's', "Specify TLSv1.3 ciphersuites to be used" },                 \
+        { "cipher", OPT_S_CIPHER, 's', "Specify (D)TLSv1.2 and below cipher list to be used" },                 \
+        { "ciphersuites", OPT_S_CIPHERSUITES, 's', "Specify (D)TLSv1.3 ciphersuites to be used" },              \
         { "min_protocol", OPT_S_MINPROTO, 's', "Specify the minimum protocol version to be used" },             \
         { "max_protocol", OPT_S_MAXPROTO, 's', "Specify the maximum protocol version to be used" },             \
         { "record_padding", OPT_S_RECORD_PADDING, 's',                                                          \
-            "Block size to pad TLS 1.3 records to." },                                                          \
+            "Block size to pad (D)TLS 1.3 records to." },                                                       \
         { "debug_broken_protocol", OPT_S_DEBUGBROKE, '-',                                                       \
             "Perform all sorts of protocol violations for testing purposes" },                                  \
         { "no_middlebox", OPT_S_NO_MIDDLEBOX, '-',                                                              \
@@ -341,8 +341,9 @@ typedef struct options_st {
      * value type:
      *
      *   '-' no value (also the value zero)
-     *   'n' number (type 'int')
-     *   'p' positive number (type 'int')
+     *   'n' any number (type 'int')
+     *   'p' positive number (type 'int', value > 0)
+     *   'N' is a non-negative number (type 'int', value >= 0)
      *   'u' unsigned number (type 'unsigned long')
      *   'l' number (type 'unsigned long')
      *   'M' number (type 'intmax_t')
@@ -354,10 +355,9 @@ typedef struct options_st {
      *   'f' any format                    [OPT_FMT_ANY]
      *   'F' der/pem format                [OPT_FMT_PEMDER]
      *   'A' any ASN1, der/pem/b64 format  [OPT_FMT_ASN1]
-     *   'E' der/pem/engine format         [OPT_FMT_PDE]
      *   'c' pem/der/smime format          [OPT_FMT_PDS]
      *
-     * The 'l', 'n' and 'u' value types include the values zero,
+     * The 'l', 'n', 'N' and 'u' value types include the values zero,
      * the 'p' value type does not.
      */
     int valtype;
@@ -383,7 +383,6 @@ typedef struct string_int_pair_st {
 #define OPT_FMT_B64 (1L << 3)
 #define OPT_FMT_PKCS12 (1L << 4)
 #define OPT_FMT_SMIME (1L << 5)
-#define OPT_FMT_ENGINE (1L << 6)
 #define OPT_FMT_MSBLOB (1L << 7)
 #define OPT_FMT_NSS (1L << 8)
 #define OPT_FMT_TEXT (1L << 9)
@@ -392,10 +391,8 @@ typedef struct string_int_pair_st {

 #define OPT_FMT_PEMDER (OPT_FMT_PEM | OPT_FMT_DER)
 #define OPT_FMT_ASN1 (OPT_FMT_PEM | OPT_FMT_DER | OPT_FMT_B64)
-#define OPT_FMT_PDE (OPT_FMT_PEMDER | OPT_FMT_ENGINE)
 #define OPT_FMT_PDS (OPT_FMT_PEMDER | OPT_FMT_SMIME)
-#define OPT_FMT_ANY ( \
-    OPT_FMT_PEM | OPT_FMT_DER | OPT_FMT_B64 | OPT_FMT_PKCS12 | OPT_FMT_SMIME | OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NSS | OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK)
+#define OPT_FMT_ANY (OPT_FMT_PEM | OPT_FMT_DER | OPT_FMT_B64 | OPT_FMT_PKCS12 | OPT_FMT_SMIME | OPT_FMT_MSBLOB | OPT_FMT_NSS | OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK)

 /* Divide options into sections when displaying usage */
 #define OPT_SECTION(sec) { OPT_SECTION_STR, 1, '-', sec " options:\n" }
@@ -445,7 +442,4 @@ char **opt_rest(void);
 int opt_num_rest(void);
 int opt_check_rest_arg(const char *expected);

-/* Returns non-zero if legacy paths are still available */
-int opt_legacy_okay(void);
-
 #endif /* OSSL_APPS_OPT_H */
diff --git a/deps/openssl/openssl/apps/include/platform.h b/deps/openssl/openssl/apps/include/platform.h
index ec12a41af7c..ca0d856e96b 100644
--- a/deps/openssl/openssl/apps/include/platform.h
+++ b/deps/openssl/openssl/apps/include/platform.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -29,4 +29,18 @@ char **copy_argv(int *argc, char *argv[]);
 void win32_utf8argv(int *argc, char **argv[]);
 #endif

+/*
+ * MSVC versions earlier than Visual Studio 2015 (_MSC_VER < 1900) do not
+ * declare or define C99 snprintf or vsnprintf.  Definitions are supplied
+ * by crypto/msvc2013_snprintf.c, which is built only on the matching
+ * Configure target variants.
+ */
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#include <stdarg.h>
+int msvc_translate_printf_format(const char *format, const char **out,
+    char **tmp);
+int snprintf(char *buf, size_t n, const char *fmt, ...);
+int vsnprintf(char *buf, size_t n, const char *fmt, va_list args);
+#endif
+
 #endif
diff --git a/deps/openssl/openssl/apps/include/s_apps.h b/deps/openssl/openssl/apps/include/s_apps.h
index c6a9a890c21..a8761e66963 100644
--- a/deps/openssl/openssl/apps/include/s_apps.h
+++ b/deps/openssl/openssl/apps/include/s_apps.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_APPS_INCLUDE_S_APPS_H)
+#define OSSL_APPS_INCLUDE_S_APPS_H
+
 #include <openssl/opensslconf.h>

 #include <openssl/ssl.h>
@@ -15,8 +18,9 @@
 #define PORT "4433"
 #define PROTOCOL "tcp"

-#define SSL_VERSION_ALLOWS_RENEGOTIATION(s) \
-    (SSL_is_dtls(s) || (SSL_version(s) < TLS1_3_VERSION))
+#define SSL_VERSION_ALLOWS_RENEGOTIATION(s)                                                    \
+    ((SSL_is_dtls(s) && (SSL_version(s) > DTLS1_3_VERSION || SSL_version(s) == DTLS1_BAD_VER)) \
+        || (!SSL_is_dtls(s) && SSL_version(s) < TLS1_3_VERSION))

 typedef int (*do_server_cb)(int s, int stype, int prot, unsigned char *context);
 void get_sock_info_address(int asock, char **hostname, char **service);
@@ -37,7 +41,7 @@ int ssl_print_tmp_key(BIO *out, SSL *s);
 int init_client(int *sock, const char *host, const char *port,
     const char *bindhost, const char *bindport,
     int family, int type, int protocol, int tfo, int doconn,
-    BIO_ADDR **ba_ret);
+    BIO_ADDR **ba_ret, int c_quiet);
 int should_retry(int i);
 void do_ssl_shutdown(SSL *ssl);

@@ -110,5 +114,8 @@ typedef struct srpsrvparm_st {

 int set_up_srp_verifier_file(SSL_CTX *ctx, srpsrvparm *srp_callback_parm,
     char *srpuserseed, char *srp_verifier_file);
+void cleanup_srp(srpsrvparm *srp_callback_parm);
 void lookup_srp_user(srpsrvparm *srp_callback_parm, BIO *bio_s_out);
 #endif /* OPENSSL_NO_SRP */
+
+#endif /* !defined(OSSL_APPS_INCLUDE_S_APPS_H) */
diff --git a/deps/openssl/openssl/apps/info.c b/deps/openssl/openssl/apps/info.c
index 779a02937d9..15316c1eb00 100644
--- a/deps/openssl/openssl/apps/info.c
+++ b/deps/openssl/openssl/apps/info.c
@@ -14,7 +14,6 @@
 typedef enum OPTION_choice {
     OPT_COMMON,
     OPT_CONFIGDIR,
-    OPT_ENGINESDIR,
     OPT_MODULESDIR,
     OPT_DSOEXT,
     OPT_DIRNAMESEP,
@@ -31,7 +30,6 @@ const OPTIONS info_options[] = {

     OPT_SECTION("Output"),
     { "configdir", OPT_CONFIGDIR, '-', "Default configuration file directory" },
-    { "enginesdir", OPT_ENGINESDIR, '-', "Default engine module directory" },
     { "modulesdir", OPT_MODULESDIR, '-',
         "Default module directory (other than engine modules)" },
     { "dsoext", OPT_DSOEXT, '-', "Configured extension for modules" },
@@ -65,10 +63,6 @@ int info_main(int argc, char **argv)
             type = OPENSSL_INFO_CONFIG_DIR;
             dirty++;
             break;
-        case OPT_ENGINESDIR:
-            type = OPENSSL_INFO_ENGINES_DIR;
-            dirty++;
-            break;
         case OPT_MODULESDIR:
             type = OPENSSL_INFO_MODULES_DIR;
             dirty++;
diff --git a/deps/openssl/openssl/apps/kdf.c b/deps/openssl/openssl/apps/kdf.c
index 222979f7a97..c8674afec53 100644
--- a/deps/openssl/openssl/apps/kdf.c
+++ b/deps/openssl/openssl/apps/kdf.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,7 @@
  * https://www.openssl.org/source/license.html
  */

+#include <stdio.h>
 #include <string.h>

 #include "apps.h"
@@ -39,7 +40,7 @@ const OPTIONS kdf_options[] = {
     { "digest", OPT_DIGEST, 's', "Digest" },
     { "mac", OPT_MAC, 's', "MAC" },
     { OPT_MORE_STR, 1, '-', "See 'Supported Controls' in the EVP_KDF_ docs\n" },
-    { "keylen", OPT_KEYLEN, 's', "The size of the output derived key" },
+    { "keylen", OPT_KEYLEN, 'p', "The size of the output derived key" },

     OPT_SECTION("Output"),
     { "out", OPT_OUT, '>', "Output to filename rather than stdout" },
@@ -65,7 +66,7 @@ static char *alloc_kdf_algorithm_name(STACK_OF(OPENSSL_STRING) **optp,
         return NULL;

     res = app_malloc(len, "algorithm name");
-    BIO_snprintf(res, len, "%s:%s", name, arg);
+    snprintf(res, len, "%s:%s", name, arg);
     if (sk_OPENSSL_STRING_push(*optp, res))
         return res;
     OPENSSL_free(res);
@@ -80,7 +81,7 @@ int kdf_main(int argc, char **argv)
     char *prog, *hexout = NULL;
     const char *outfile = NULL;
     unsigned char *dkm_bytes = NULL;
-    size_t dkm_len = 0;
+    int dkm_len = 0;
     BIO *out = NULL;
     EVP_KDF *kdf = NULL;
     EVP_KDF_CTX *ctx = NULL;
@@ -101,7 +102,7 @@ int kdf_main(int argc, char **argv)
             out_bin = 1;
             break;
         case OPT_KEYLEN:
-            dkm_len = (size_t)atoi(opt_arg());
+            dkm_len = opt_int_arg();
             break;
         case OPT_OUT:
             outfile = opt_arg();
@@ -162,7 +163,7 @@ int kdf_main(int argc, char **argv)
             goto err;

         if (!EVP_KDF_CTX_set_params(ctx, params)) {
-            BIO_printf(bio_err, "KDF parameter error\n");
+            BIO_puts(bio_err, "KDF parameter error\n");
             ERR_print_errors(bio_err);
             ok = 0;
         }
@@ -176,7 +177,7 @@ int kdf_main(int argc, char **argv)
         goto err;

     if (dkm_len <= 0) {
-        BIO_printf(bio_err, "Invalid derived key length.\n");
+        BIO_puts(bio_err, "Derived key length is mandatory!\n");
         goto err;
     }
     dkm_bytes = app_malloc(dkm_len, "out buffer");
@@ -184,7 +185,7 @@ int kdf_main(int argc, char **argv)
         goto err;

     if (!EVP_KDF_derive(ctx, dkm_bytes, dkm_len, NULL)) {
-        BIO_printf(bio_err, "EVP_KDF_derive failed\n");
+        BIO_puts(bio_err, "EVP_KDF_derive failed\n");
         goto err;
     }

@@ -193,7 +194,7 @@ int kdf_main(int argc, char **argv)
     } else {
         hexout = OPENSSL_buf2hexstr(dkm_bytes, dkm_len);
         if (hexout == NULL) {
-            BIO_printf(bio_err, "Memory allocation failure\n");
+            BIO_puts(bio_err, "Memory allocation failure\n");
             goto err;
         }
         BIO_printf(out, "%s\n\n", hexout);
diff --git a/deps/openssl/openssl/apps/lib/app_params.c b/deps/openssl/openssl/apps/lib/app_params.c
index a428afe8f38..e9dee852af4 100644
--- a/deps/openssl/openssl/apps/lib/app_params.c
+++ b/deps/openssl/openssl/apps/lib/app_params.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,9 +7,14 @@
  * https://www.openssl.org/source/license.html
  */

+#include <stdio.h>
+
 #include "apps.h"
 #include "app_params.h"

+/* Maximum number of bytes that will be output for an octet string body */
+#define MAX_OCTET_STRING_OUTPUT_BYTES 24
+
 static int describe_param_type(char *buf, size_t bufsz, const OSSL_PARAM *param)
 {
     const char *type_mod = "";
@@ -42,29 +47,29 @@ static int describe_param_type(char *buf, size_t bufsz, const OSSL_PARAM *param)
         break;
     }

-    printed_len = BIO_snprintf(buf, bufsz, "%s: ", param->key);
-    if (printed_len > 0) {
+    printed_len = snprintf(buf, bufsz, "%s: ", param->key);
+    if (printed_len > 0 && (size_t)printed_len < bufsz) {
         buf += printed_len;
         bufsz -= printed_len;
     }
-    printed_len = BIO_snprintf(buf, bufsz, "%s%s", type_mod, type);
-    if (printed_len > 0) {
+    printed_len = snprintf(buf, bufsz, "%s%s", type_mod, type);
+    if (printed_len > 0 && (size_t)printed_len < bufsz) {
         buf += printed_len;
         bufsz -= printed_len;
     }
     if (show_type_number) {
-        printed_len = BIO_snprintf(buf, bufsz, " [%d]", param->data_type);
-        if (printed_len > 0) {
+        printed_len = snprintf(buf, bufsz, " [%u]", param->data_type);
+        if (printed_len > 0 && (size_t)printed_len < bufsz) {
             buf += printed_len;
             bufsz -= printed_len;
         }
     }
     if (param->data_size == 0)
-        printed_len = BIO_snprintf(buf, bufsz, " (arbitrary size)");
+        printed_len = snprintf(buf, bufsz, " (arbitrary size)");
     else
-        printed_len = BIO_snprintf(buf, bufsz, " (max %zu bytes large)",
+        printed_len = snprintf(buf, bufsz, " (max %zu bytes large)",
             param->data_size);
-    if (printed_len > 0) {
+    if (printed_len > 0 && (size_t)printed_len < bufsz) {
         buf += printed_len;
         bufsz -= printed_len;
     }
@@ -94,6 +99,56 @@ int print_param_types(const char *thing, const OSSL_PARAM *pdefs, int indent)
     return 1;
 }

+/* Output the body of a UTF8 string which might not be zero terminated */
+static void print_param_utf8(const char **s_ptr, size_t len)
+{
+    const char *s;
+
+    if (s_ptr == NULL) {
+        BIO_puts(bio_out, " ptr null\n");
+        return;
+    }
+    if ((s = *s_ptr) == NULL) {
+        BIO_puts(bio_out, " null\n");
+        return;
+    }
+    BIO_puts(bio_out, "'");
+    if (len > 0)
+        BIO_write(bio_out, s, (int)len);
+    BIO_puts(bio_out, "'\n");
+}
+
+/* Output the body of an OCTET string */
+static void print_param_octet(const unsigned char **bytes_ptr, size_t len)
+{
+    size_t i;
+    const char *tail = "\n";
+    const unsigned char *bytes;
+
+    BIO_printf(bio_out, "<%zu bytes>", len);
+    if (bytes_ptr == NULL) {
+        BIO_puts(bio_out, " ptr null\n");
+        return;
+    }
+    if ((bytes = *bytes_ptr) == NULL) {
+        BIO_puts(bio_out, " null\n");
+        return;
+    }
+    if (len == 0) {
+        BIO_puts(bio_out, "\n");
+        return;
+    }
+
+    if (len > MAX_OCTET_STRING_OUTPUT_BYTES) {
+        len = MAX_OCTET_STRING_OUTPUT_BYTES;
+        tail = "...\n";
+    }
+    BIO_puts(bio_out, " ");
+    for (i = 0; i < len; i++)
+        BIO_printf(bio_out, "%02x", bytes[i]);
+    BIO_puts(bio_out, tail);
+}
+
 void print_param_value(const OSSL_PARAM *p, int indent)
 {
     int64_t i;
@@ -105,27 +160,29 @@ void print_param_value(const OSSL_PARAM *p, int indent)
         if (OSSL_PARAM_get_uint64(p, &u))
             BIO_printf(bio_out, "%llu\n", (unsigned long long int)u);
         else
-            BIO_printf(bio_out, "error getting value\n");
+            BIO_puts(bio_out, "error getting value\n");
         break;
     case OSSL_PARAM_INTEGER:
         if (OSSL_PARAM_get_int64(p, &i))
             BIO_printf(bio_out, "%lld\n", (long long int)i);
         else
-            BIO_printf(bio_out, "error getting value\n");
+            BIO_puts(bio_out, "error getting value\n");
         break;
     case OSSL_PARAM_UTF8_PTR:
-        BIO_printf(bio_out, "'%s'\n", *(char **)(p->data));
+        print_param_utf8((const char **)p->data, p->return_size);
         break;
     case OSSL_PARAM_UTF8_STRING:
-        BIO_printf(bio_out, "'%s'\n", (char *)p->data);
+        print_param_utf8((const char **)&p->data, p->return_size);
         break;
     case OSSL_PARAM_OCTET_PTR:
+        print_param_octet((const unsigned char **)p->data, p->return_size);
+        break;
     case OSSL_PARAM_OCTET_STRING:
-        BIO_printf(bio_out, "<%zu bytes>\n", p->data_size);
+        print_param_octet((const unsigned char **)&p->data, p->return_size);
         break;
     default:
         BIO_printf(bio_out, "unknown type (%u) of %zu bytes\n",
-            p->data_type, p->data_size);
+            p->data_type, p->return_size);
         break;
     }
 }
diff --git a/deps/openssl/openssl/apps/lib/app_rand.c b/deps/openssl/openssl/apps/lib/app_rand.c
index 061211a0b64..7d50feeb77e 100644
--- a/deps/openssl/openssl/apps/lib/app_rand.c
+++ b/deps/openssl/openssl/apps/lib/app_rand.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -84,7 +84,7 @@ int app_RAND_write(void)
     if (save_rand_file == NULL)
         return 1;
     if (RAND_write_file(save_rand_file) == -1) {
-        BIO_printf(bio_err, "Cannot write random bytes:\n");
+        BIO_puts(bio_err, "Cannot write random bytes:\n");
         ERR_print_errors(bio_err);
         ret = 0;
     }
diff --git a/deps/openssl/openssl/apps/lib/app_x509.c b/deps/openssl/openssl/apps/lib/app_x509.c
index 11cb3fa342d..b396dbef945 100644
--- a/deps/openssl/openssl/apps/lib/app_x509.c
+++ b/deps/openssl/openssl/apps/lib/app_x509.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -25,7 +25,7 @@ static ASN1_OCTET_STRING *mk_octet_string(void *value, size_t value_n)
     ASN1_OCTET_STRING *v = ASN1_OCTET_STRING_new();

     if (v == NULL) {
-        BIO_printf(bio_err, "error: allocation failed\n");
+        BIO_puts(bio_err, "error: allocation failed\n");
     } else if (!ASN1_OCTET_STRING_set(v, value, (int)value_n)) {
         ASN1_OCTET_STRING_free(v);
         v = NULL;
@@ -42,7 +42,7 @@ static int x509_ctrl(void *object, int cmd, void *value, size_t value_n)
         ASN1_OCTET_STRING *v = mk_octet_string(value, value_n);

         if (v == NULL) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "error: setting distinguishing ID in certificate failed\n");
             return 0;
         }
@@ -65,7 +65,7 @@ static int x509_req_ctrl(void *object, int cmd, void *value, size_t value_n)
         ASN1_OCTET_STRING *v = mk_octet_string(value, value_n);

         if (v == NULL) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "error: setting distinguishing ID in certificate signing request failed\n");
             return 0;
         }
diff --git a/deps/openssl/openssl/apps/lib/apps.c b/deps/openssl/openssl/apps/lib/apps.c
index 29dd6514f6d..f4584975c8d 100644
--- a/deps/openssl/openssl/apps/lib/apps.c
+++ b/deps/openssl/openssl/apps/lib/apps.c
@@ -15,12 +15,6 @@
 #define _POSIX_C_SOURCE 2
 #endif

-#ifndef OPENSSL_NO_ENGINE
-/* We need to use some deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-#include <openssl/engine.h>
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -45,6 +39,8 @@
 #include <openssl/bn.h>
 #include <openssl/ssl.h>
 #include <openssl/core_names.h>
+#include <openssl/encoder.h>
+#include <openssl/decoder.h>
 #include "s_apps.h"
 #include "apps.h"

@@ -91,6 +87,22 @@ int app_init(long mesgwin)
 }
 #endif

+static int maybe_printf(BIO *bio, const char *format, ...)
+{
+    va_list args;
+    int ret = 0;
+
+    if (bio != NULL) {
+        va_start(args, format);
+
+        ret = BIO_vprintf(bio, format, args);
+
+        va_end(args);
+    }
+
+    return ret;
+}
+
 int ctx_set_verify_locations(SSL_CTX *ctx,
     const char *CAfile, int noCAfile,
     const char *CApath, int noCApath,
@@ -168,7 +180,7 @@ char *get_passwd(const char *pass, const char *desc)
     if (!app_passwd(pass, NULL, &result, NULL))
         BIO_printf(bio_err, "Error getting password for %s\n", desc);
     if (pass != NULL && result == NULL) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Trying plain input string (better precede with 'pass:')\n");
         result = OPENSSL_strdup(pass);
         if (result == NULL)
@@ -240,10 +252,8 @@ static char *app_get_pass(const char *arg, int keepbio)
         } else if (CHECK_AND_SKIP_PREFIX(arg, "fd:")) {
             BIO *btmp;

-            i = atoi(arg);
-            if (i >= 0)
-                pwdbio = BIO_new_fd(i, BIO_NOCLOSE);
-            if ((i < 0) || pwdbio == NULL) {
+            if (!opt_int(arg, &i) || i < 0
+                || (pwdbio = BIO_new_fd(i, BIO_NOCLOSE)) == NULL) {
                 BIO_printf(bio_err, "Can't access file descriptor %s\n", arg);
                 return NULL;
             }
@@ -254,7 +264,7 @@ static char *app_get_pass(const char *arg, int keepbio)
             if (btmp == NULL) {
                 BIO_free_all(pwdbio);
                 pwdbio = NULL;
-                BIO_printf(bio_err, "Out of memory\n");
+                BIO_puts(bio_err, "Out of memory\n");
                 return NULL;
             }
             pwdbio = BIO_push(btmp, pwdbio);
@@ -263,7 +273,7 @@ static char *app_get_pass(const char *arg, int keepbio)
             unbuffer(stdin);
             pwdbio = dup_bio_in(FORMAT_TEXT);
             if (pwdbio == NULL) {
-                BIO_printf(bio_err, "Can't open BIO for stdin\n");
+                BIO_puts(bio_err, "Can't open BIO for stdin\n");
                 return NULL;
             }
         } else {
@@ -286,7 +296,7 @@ static char *app_get_pass(const char *arg, int keepbio)
         pwdbio = NULL;
     }
     if (i <= 0) {
-        BIO_printf(bio_err, "Error reading password from BIO\n");
+        BIO_puts(bio_err, "Error reading password from BIO\n");
         return NULL;
     }
     tmp = strchr(tpass, '\n');
@@ -342,7 +352,7 @@ CONF *app_load_config_bio(BIO *in, const char *filename)
     if (filename != NULL)
         BIO_printf(bio_err, "config file \"%s\"\n", filename);
     else
-        BIO_printf(bio_err, "config input");
+        BIO_puts(bio_err, "config input");

     NCONF_free(conf);
     return NULL;
@@ -352,7 +362,7 @@ CONF *app_load_config_verbose(const char *filename, int verbose)
 {
     if (verbose) {
         if (*filename == '\0')
-            BIO_printf(bio_err, "No configuration used\n");
+            BIO_puts(bio_err, "No configuration used\n");
         else
             BIO_printf(bio_err, "Using configuration from %s\n", filename);
     }
@@ -386,7 +396,7 @@ int app_load_modules(const CONF *config)
         return 1;

     if (CONF_modules_load(config, NULL, 0) <= 0) {
-        BIO_printf(bio_err, "Error configuring OpenSSL modules\n");
+        BIO_puts(bio_err, "Error configuring OpenSSL modules\n");
         ERR_print_errors(bio_err);
         NCONF_free(to_free);
         return 0;
@@ -454,7 +464,7 @@ X509 *load_cert_pass(const char *uri, int format, int maybe_stdin,
         }
     } else {
         (void)load_key_certs_crls(uri, format, maybe_stdin, pass, desc, 0,
-            NULL, NULL, NULL, &cert, NULL, NULL, NULL);
+            NULL, NULL, NULL, &cert, NULL, NULL, NULL, NULL);
     }
     return cert;
 }
@@ -476,7 +486,7 @@ X509_CRL *load_crl(const char *uri, int format, int maybe_stdin,
         }
     } else {
         (void)load_key_certs_crls(uri, format, maybe_stdin, NULL, desc, 0,
-            NULL, NULL, NULL, NULL, NULL, &crl, NULL);
+            NULL, NULL, NULL, NULL, NULL, &crl, NULL, NULL);
     }
     return crl;
 }
@@ -559,41 +569,33 @@ void clear_free(char *str)
 }

 EVP_PKEY *load_key(const char *uri, int format, int may_stdin,
-    const char *pass, ENGINE *e, const char *desc)
+    const char *pass, const char *desc)
 {
     EVP_PKEY *pkey = NULL;
-    char *allocated_uri = NULL;

     if (desc == NULL)
         desc = "private key";

-    if (format == FORMAT_ENGINE)
-        uri = allocated_uri = make_engine_uri(e, uri, desc);
     (void)load_key_certs_crls(uri, format, may_stdin, pass, desc, 0,
-        &pkey, NULL, NULL, NULL, NULL, NULL, NULL);
+        &pkey, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

-    OPENSSL_free(allocated_uri);
     return pkey;
 }

 /* first try reading public key, on failure resort to loading private key */
 EVP_PKEY *load_pubkey(const char *uri, int format, int maybe_stdin,
-    const char *pass, ENGINE *e, const char *desc)
+    const char *pass, const char *desc)
 {
     EVP_PKEY *pkey = NULL;
-    char *allocated_uri = NULL;

     if (desc == NULL)
         desc = "public key";

-    if (format == FORMAT_ENGINE)
-        uri = allocated_uri = make_engine_uri(e, uri, desc);
     (void)load_key_certs_crls(uri, format, maybe_stdin, pass, desc, 1,
-        NULL, &pkey, NULL, NULL, NULL, NULL, NULL);
+        NULL, &pkey, NULL, NULL, NULL, NULL, NULL, NULL);
     if (pkey == NULL)
         (void)load_key_certs_crls(uri, format, maybe_stdin, pass, desc, 0,
-            &pkey, NULL, NULL, NULL, NULL, NULL, NULL);
-    OPENSSL_free(allocated_uri);
+            &pkey, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
     return pkey;
 }

@@ -602,20 +604,46 @@ EVP_PKEY *load_keyparams_suppress(const char *uri, int format, int maybe_stdin,
     int suppress_decode_errors)
 {
     EVP_PKEY *params = NULL;
+    OSSL_DECODER_CTX *dctx = NULL;
+    BIO *file_bio = BIO_new_file(uri, "rb");
+    OSSL_LIB_CTX *libctx = app_get0_libctx();
+    const char *propq = app_get0_propq();

     if (desc == NULL)
         desc = "key parameters";
-    (void)load_key_certs_crls(uri, format, maybe_stdin, NULL, desc,
-        suppress_decode_errors,
-        NULL, NULL, &params, NULL, NULL, NULL, NULL);
-    if (params != NULL && keytype != NULL && !EVP_PKEY_is_a(params, keytype)) {
-        ERR_print_errors(bio_err);
-        BIO_printf(bio_err,
-            "Unable to load %s from %s (unexpected parameters type)\n",
-            desc, uri);
-        EVP_PKEY_free(params);
-        params = NULL;
+    /*
+     * Use the store lookup path for anything that is not DER/ASN1 format
+     * Or if we are unable to opens the uri as a file.
+     */
+    if (format != FORMAT_ASN1 || file_bio == NULL) {
+        (void)load_key_certs_crls(uri, format, maybe_stdin, NULL, desc,
+            suppress_decode_errors,
+            NULL, NULL, &params, NULL, NULL, NULL, NULL, NULL);
+        if (params != NULL && keytype != NULL && !EVP_PKEY_is_a(params, keytype)) {
+            ERR_print_errors(bio_err);
+            BIO_printf(bio_err,
+                "Unable to load %s from %s (unexpected parameters type)\n",
+                desc, uri);
+            EVP_PKEY_free(params);
+            params = NULL;
+        }
+    } else {
+        dctx = OSSL_DECODER_CTX_new_for_pkey(&params, NULL, NULL, keytype,
+            OSSL_KEYMGMT_SELECT_ALL_PARAMETERS,
+            libctx, propq);
+        if (dctx == NULL) {
+            ERR_print_errors(bio_err);
+            BIO_printf(bio_err, "Unable to allocate decoder context\n");
+        } else {
+            if (!OSSL_DECODER_from_bio(dctx, file_bio)) {
+                ERR_print_errors(bio_err);
+                BIO_printf(bio_err, "Unable to decode file %s\n", uri);
+            }
+        }
     }
+
+    BIO_free(file_bio);
+    OSSL_DECODER_CTX_free(dctx);
     return params;
 }

@@ -625,6 +653,17 @@ EVP_PKEY *load_keyparams(const char *uri, int format, int maybe_stdin,
     return load_keyparams_suppress(uri, format, maybe_stdin, keytype, desc, 0);
 }

+EVP_SKEY *load_skey(const char *uri, int format, int may_stdin,
+    const char *pass, int quiet)
+{
+    EVP_SKEY *skey = NULL;
+
+    (void)load_key_certs_crls(uri, format, may_stdin, pass, NULL, 0,
+        NULL, NULL, NULL, NULL, NULL, NULL, NULL, &skey);
+
+    return skey;
+}
+
 void app_bail_out(char *fmt, ...)
 {
     va_list args;
@@ -646,16 +685,29 @@ void *app_malloc(size_t sz, const char *what)
     return vp;
 }

-char *next_item(char *opt) /* in list separated by comma and/or space */
+void *app_malloc_array(size_t n, size_t sz, const char *what)
+{
+    void *vp = OPENSSL_malloc_array(n, sz);
+
+    if (vp == NULL)
+        app_bail_out("%s: Could not allocate %zu*%zu bytes for %s\n",
+            opt_getprog(), n, sz, what);
+    return vp;
+}
+
+char *next_item(char *opt) /* in list separated by comma and/or spaces */
 {
     /* advance to separator (comma or whitespace), if any */
-    while (*opt != ',' && !isspace(_UC(*opt)) && *opt != '\0')
+    while (*opt != '\0' && *opt != ',' && !isspace(_UC(*opt)))
         opt++;
     if (*opt != '\0') {
+        int found_comma = *opt == ',';
+
         /* terminate current item */
         *opt++ = '\0';
-        /* skip over any whitespace after separator */
-        while (isspace(_UC(*opt)))
+        /* skip over any further separators, but only one comma */
+        while ((!found_comma && (found_comma = (*opt == ',')))
+            || isspace(_UC(*opt)))
             opt++;
     }
     return *opt == '\0' ? NULL : opt; /* NULL indicates end of input */
@@ -673,12 +725,12 @@ static void warn_cert_msg(const char *uri, X509 *cert, const char *msg)
 static void warn_cert(const char *uri, X509 *cert, int warn_EE,
     X509_VERIFY_PARAM *vpm)
 {
+    int error;
     uint32_t ex_flags = X509_get_extension_flags(cert);
-    int res = X509_cmp_timeframe(vpm, X509_get0_notBefore(cert),
-        X509_get0_notAfter(cert));

-    if (res != 0)
-        warn_cert_msg(uri, cert, res > 0 ? "has expired" : "not yet valid");
+    if (!X509_check_certificate_times(vpm, cert, &error))
+        warn_cert_msg(uri, cert, X509_verify_cert_error_string(error));
+
     if (warn_EE && (ex_flags & EXFLAG_V1) == 0 && (ex_flags & EXFLAG_CA) == 0)
         warn_cert_msg(uri, cert, "is not a CA cert");
 }
@@ -708,7 +760,7 @@ int load_cert_certs(const char *uri,
     }
     pass_string = get_passwd(pass, desc);
     ret = load_key_certs_crls(uri, FORMAT_UNDEF, 0, pass_string, desc, 0,
-        NULL, NULL, NULL, pcert, pcerts, NULL, NULL);
+        NULL, NULL, NULL, pcert, pcerts, NULL, NULL, NULL);
     clear_free(pass_string);

     if (ret) {
@@ -716,18 +768,14 @@ int load_cert_certs(const char *uri,
             warn_cert(uri, *pcert, 0, vpm);
         if (pcerts != NULL)
             warn_certs(uri, *pcerts, 1, vpm);
-    } else {
-        if (pcerts != NULL) {
-            OSSL_STACK_OF_X509_free(*pcerts);
-            *pcerts = NULL;
-        }
     }
     return ret;
 }

-STACK_OF(X509) *load_certs_multifile(char *files, const char *pass,
+STACK_OF(X509) *load_certs_multifile(char *files, const char *source,
     const char *desc, X509_VERIFY_PARAM *vpm)
 {
+    char *pass = get_passwd(source, desc);
     STACK_OF(X509) *certs = NULL;
     STACK_OF(X509) *result = sk_X509_new_null();

@@ -748,11 +796,13 @@ STACK_OF(X509) *load_certs_multifile(char *files, const char *pass,
         certs = NULL;
         files = next;
     }
+    clear_free(pass);
     return result;

 oom:
-    BIO_printf(bio_err, "out of memory\n");
+    BIO_puts(bio_err, "out of memory\n");
 err:
+    clear_free(pass);
     OSSL_STACK_OF_X509_free(certs);
     OSSL_STACK_OF_X509_free(result);
     return NULL;
@@ -780,9 +830,10 @@ static X509_STORE *sk_X509_to_store(X509_STORE *store /* may be NULL */,
  * Create cert store structure with certificates read from given file(s).
  * Returns pointer to created X509_STORE on success, NULL on error.
  */
-X509_STORE *load_certstore(char *input, const char *pass, const char *desc,
+X509_STORE *load_certstore(char *input, const char *source, const char *desc,
     X509_VERIFY_PARAM *vpm)
 {
+    char *pass = get_passwd(source, desc);
     X509_STORE *store = NULL;
     STACK_OF(X509) *certs = NULL;

@@ -792,15 +843,19 @@ X509_STORE *load_certstore(char *input, const char *pass, const char *desc,

         if (!load_cert_certs(input, NULL, &certs, 1, pass, desc, vpm)) {
             X509_STORE_free(store);
-            return NULL;
+            store = NULL;
+            goto end;
         }
         ok = (store = sk_X509_to_store(store, certs)) != NULL;
         OSSL_STACK_OF_X509_free(certs);
         certs = NULL;
         if (!ok)
-            return NULL;
+            goto end;
         input = next;
     }
+
+end:
+    clear_free(pass);
     return store;
 }

@@ -811,18 +866,10 @@ X509_STORE *load_certstore(char *input, const char *pass, const char *desc,
 int load_certs(const char *uri, int maybe_stdin, STACK_OF(X509) **certs,
     const char *pass, const char *desc)
 {
-    int ret, was_NULL = *certs == NULL;
-
     if (desc == NULL)
         desc = "certificates";
-    ret = load_key_certs_crls(uri, FORMAT_UNDEF, maybe_stdin, pass, desc, 0,
-        NULL, NULL, NULL, NULL, certs, NULL, NULL);
-
-    if (!ret && was_NULL) {
-        OSSL_STACK_OF_X509_free(*certs);
-        *certs = NULL;
-    }
-    return ret;
+    return load_key_certs_crls(uri, FORMAT_UNDEF, maybe_stdin, pass, desc, 0,
+        NULL, NULL, NULL, NULL, certs, NULL, NULL, NULL);
 }

 /*
@@ -832,18 +879,10 @@ int load_certs(const char *uri, int maybe_stdin, STACK_OF(X509) **certs,
 int load_crls(const char *uri, STACK_OF(X509_CRL) **crls,
     const char *pass, const char *desc)
 {
-    int ret, was_NULL = *crls == NULL;
-
     if (desc == NULL)
         desc = "CRLs";
-    ret = load_key_certs_crls(uri, FORMAT_UNDEF, 0, pass, desc, 0,
-        NULL, NULL, NULL, NULL, NULL, NULL, crls);
-
-    if (!ret && was_NULL) {
-        sk_X509_CRL_pop_free(*crls, X509_CRL_free);
-        *crls = NULL;
-    }
-    return ret;
+    return load_key_certs_crls(uri, FORMAT_UNDEF, 0, pass, desc, 0,
+        NULL, NULL, NULL, NULL, NULL, NULL, crls, NULL);
 }

 static const char *format2string(int format)
@@ -877,34 +916,36 @@ static const char *format2string(int format)
             : pcerts != NULL                         ? "certificates"   \
             : pcrl != NULL                           ? "CRL"            \
             : pcrls != NULL                          ? "CRLs"           \
+            : pskey != NULL                          ? "symmetric key"  \
                                                      : NULL)
 /*
  * Load those types of credentials for which the result pointer is not NULL.
  * Reads from stdin if 'uri' is NULL and 'maybe_stdin' is nonzero.
  * 'format' parameter may be FORMAT_PEM, FORMAT_ASN1, or 0 for no hint.
  * desc may contain more detail on the credential(s) to be loaded for error msg
- * For non-NULL ppkey, pcert, and pcrl the first suitable value found is loaded.
+ * For non-NULL ppkey, pcert, pcrl, and pskey the first suitable value found is loaded.
  * If pcerts is non-NULL and *pcerts == NULL then a new cert list is allocated.
  * If pcerts is non-NULL then all available certificates are appended to *pcerts
  * except any certificate assigned to *pcert.
  * If pcrls is non-NULL and *pcrls == NULL then a new list of CRLs is allocated.
- * If pcrls is non-NULL then all available CRLs are appended to *pcerts
+ * If pcrls is non-NULL then all available CRLs are appended to *pcrls
  * except any CRL assigned to *pcrl.
- * In any case (also on error) the caller is responsible for freeing all members
- * of *pcerts and *pcrls (as far as they are not NULL).
+ * On error, any contents of non-NULL credential pointers are freed.
  */
+
 int load_key_certs_crls(const char *uri, int format, int maybe_stdin,
     const char *pass, const char *desc, int quiet,
     EVP_PKEY **ppkey, EVP_PKEY **ppubkey,
     EVP_PKEY **pparams,
     X509 **pcert, STACK_OF(X509) **pcerts,
-    X509_CRL **pcrl, STACK_OF(X509_CRL) **pcrls)
+    X509_CRL **pcrl, STACK_OF(X509_CRL) **pcrls,
+    EVP_SKEY **pskey)
 {
-    PW_CB_DATA uidata;
+    PW_CB_DATA uidata = { pass, uri };
     OSSL_STORE_CTX *ctx = NULL;
     OSSL_LIB_CTX *libctx = app_get0_libctx();
     const char *propq = app_get0_propq();
-    int ncerts = 0, ncrls = 0, expect = -1;
+    int ncerts = 0, ncrls = 0, nskeys = 0, expect = -1;
     const char *failed = FAIL_NAME;
     const char *input_type;
     OSSL_PARAM itp[2];
@@ -924,9 +965,10 @@ int load_key_certs_crls(const char *uri, int format, int maybe_stdin,
     SET_EXPECT1(ppubkey, OSSL_STORE_INFO_PUBKEY);
     SET_EXPECT1(pparams, OSSL_STORE_INFO_PARAMS);
     SET_EXPECT1(pcert, OSSL_STORE_INFO_CERT);
+    SET_EXPECT1(pskey, OSSL_STORE_INFO_SKEY);
     /*
      * Up to here, the following holds.
-     * If just one of the ppkey, ppubkey, pparams, and pcert function parameters
+     * If just one of the ppkey, ppubkey, pparams, pcert, and pskey function parameters
      * is nonzero, expect > 0 indicates which type of credential is expected.
      * If expect == 0, more than one of them is nonzero (multiple types expected).
      */
@@ -934,7 +976,7 @@ int load_key_certs_crls(const char *uri, int format, int maybe_stdin,
     if (pcerts != NULL) {
         if (*pcerts == NULL && (*pcerts = sk_X509_new_null()) == NULL) {
             if (!quiet)
-                BIO_printf(bio_err, "Out of memory loading");
+                BIO_puts(bio_err, "Out of memory loading");
             goto end;
         }
         /*
@@ -948,7 +990,7 @@ int load_key_certs_crls(const char *uri, int format, int maybe_stdin,
     if (pcrls != NULL) {
         if (*pcrls == NULL && (*pcrls = sk_X509_CRL_new_null()) == NULL) {
             if (!quiet)
-                BIO_printf(bio_err, "Out of memory loading");
+                BIO_puts(bio_err, "Out of memory loading");
             goto end;
         }
         /*
@@ -959,9 +1001,6 @@ int load_key_certs_crls(const char *uri, int format, int maybe_stdin,
         SET_EXPECT(OSSL_STORE_INFO_CRL);
     }

-    uidata.password = pass;
-    uidata.prompt_info = uri;
-
     if ((input_type = format2string(format)) != NULL) {
         itp[0] = OSSL_PARAM_construct_utf8_string(OSSL_STORE_PARAM_INPUT_TYPE,
             (char *)input_type, 0);
@@ -974,7 +1013,7 @@ int load_key_certs_crls(const char *uri, int format, int maybe_stdin,

         if (!maybe_stdin) {
             if (!quiet)
-                BIO_printf(bio_err, "No filename or uri specified for loading\n");
+                BIO_puts(bio_err, "No filename or uri specified for loading\n");
             goto end;
         }
         uri = "<stdin>";
@@ -992,13 +1031,14 @@ int load_key_certs_crls(const char *uri, int format, int maybe_stdin,
     }
     if (ctx == NULL) {
         if (!quiet)
-            BIO_printf(bio_err, "Could not open file or uri for loading");
+            BIO_puts(bio_err, "Could not open file or uri for loading");
         goto end;
     }
+
     /* expect == 0 means here multiple types of credentials are to be loaded */
     if (expect > 0 && !OSSL_STORE_expect(ctx, expect)) {
         if (!quiet)
-            BIO_printf(bio_err, "Internal error trying to load");
+            BIO_puts(bio_err, "Internal error trying to load");
         goto end;
     }

@@ -1006,7 +1046,8 @@ int load_key_certs_crls(const char *uri, int format, int maybe_stdin,
     /* from here, failed != NULL only if actually an error has been detected */

     while ((ppkey != NULL || ppubkey != NULL || pparams != NULL
-               || pcert != NULL || pcerts != NULL || pcrl != NULL || pcrls != NULL)
+               || pcert != NULL || pcerts != NULL || pcrl != NULL || pcrls != NULL
+               || pskey != NULL)
         && !OSSL_STORE_eof(ctx)) {
         OSSL_STORE_INFO *info = OSSL_STORE_load(ctx);
         int type, ok = 1;
@@ -1080,6 +1121,14 @@ int load_key_certs_crls(const char *uri, int format, int maybe_stdin,
             }
             ncrls += ok;
             break;
+        case OSSL_STORE_INFO_SKEY:
+            if (pskey != NULL) {
+                ok = (*pskey = OSSL_STORE_INFO_get1_SKEY(info)) != NULL;
+                if (ok)
+                    pskey = NULL;
+            }
+            nskeys += ok;
+            break;
         default:
             /* skip any other type; ok stays == 1 */
             break;
@@ -1088,7 +1137,7 @@ int load_key_certs_crls(const char *uri, int format, int maybe_stdin,
         if (!ok) {
             failed = OSSL_STORE_INFO_type_string(type);
             if (!quiet)
-                BIO_printf(bio_err, "Error reading");
+                BIO_puts(bio_err, "Error reading");
             break;
         }
     }
@@ -1102,9 +1151,11 @@ end:
             pcerts = NULL;
         if (ncrls > 0)
             pcrls = NULL;
+        if (nskeys > 0)
+            pskey = NULL;
         failed = FAIL_NAME;
         if (failed != NULL && !quiet)
-            BIO_printf(bio_err, "Could not find");
+            BIO_puts(bio_err, "Could not find or decode");
     }

     if (failed != NULL && !quiet) {
@@ -1126,15 +1177,151 @@ end:
             ERR_pop_to_mark();
             ERR_set_mark();
         }
-        BIO_printf(bio_err, "\n");
+        BIO_puts(bio_err, "\n");
         ERR_print_errors(bio_err);
-    }
-    if (quiet || failed == NULL)
+        ERR_clear_last_mark();
+    } else {
         /* clear any suppressed or spurious errors */
         ERR_pop_to_mark();
-    else
-        ERR_clear_last_mark();
-    return failed == NULL;
+    }
+    if (failed != NULL) {
+        if (ppkey != NULL) {
+            EVP_PKEY_free(*ppkey);
+            *ppkey = NULL;
+        }
+        if (ppubkey != NULL) {
+            EVP_PKEY_free(*ppubkey);
+            *ppubkey = NULL;
+        }
+        if (pparams != NULL) {
+            EVP_PKEY_free(*pparams);
+            *pparams = NULL;
+        }
+        if (pcert != NULL) {
+            X509_free(*pcert);
+            *pcert = NULL;
+        }
+        if (pcerts != NULL) {
+            sk_X509_pop_free(*pcerts, X509_free);
+            *pcerts = NULL;
+        }
+        if (pcrl != NULL) {
+            X509_CRL_free(*pcrl);
+            *pcrl = NULL;
+        }
+        if (pcrls != NULL) {
+            sk_X509_CRL_pop_free(*pcrls, X509_CRL_free);
+            *pcrls = NULL;
+        }
+        return 0;
+    }
+    return 1;
+}
+
+int load_rpk_file(SSL *ssl, const char *file)
+{
+    BIO *in = BIO_new_file(file, "r");
+    char *name = NULL;
+    char *header = NULL;
+    unsigned char *buf = NULL;
+    long buflen;
+    int ret = 1;
+    int found = 0;
+
+    if (in == NULL)
+        return ret;
+
+    ERR_set_mark();
+    while (ret != 0) {
+        PKCS8_PRIV_KEY_INFO *p8;
+        EVP_PKEY *pkey = NULL;
+        X509 *cert = NULL;
+        const unsigned char *p;
+        int pkey_type = NID_undef;
+        X509 *(*d2i)(X509 **, const unsigned char **, long);
+
+        OPENSSL_free(name);
+        OPENSSL_free(header);
+        OPENSSL_free(buf);
+        name = header = NULL;
+        buf = NULL;
+
+        if (!PEM_read_bio(in, &name, &header, &buf, &buflen)) {
+            if (ERR_GET_REASON(ERR_peek_last_error()) != PEM_R_NO_START_LINE)
+                ret = 0;
+            break;
+        }
+        p = buf;
+
+#define WHEN_PEM_X509(name, f)                \
+    ((d2i = f),                               \
+        (strcmp((name), PEM_STRING_X509) == 0 \
+            || strcmp((name), PEM_STRING_X509_OLD) == 0))
+
+#define WHEN_PEM_X509_AUX(name, f) \
+    ((d2i = f),                    \
+        (strcmp((name), PEM_STRING_X509_TRUSTED) == 0))
+
+#define WHEN_PKEY_TYPE(name, str, type) \
+    ((pkey_type = type), (strcmp((name), str) == 0))
+
+        if (strcmp(name, PEM_STRING_PUBLIC) == 0) {
+            pkey = d2i_PUBKEY(NULL, &p, buflen);
+            if (p - buf != buflen || pkey == NULL) {
+                BIO_printf(bio_err, "Error reading %s in %s\n", name, file);
+                ret = 0;
+            } else if (!SSL_add_expected_rpk(ssl, pkey)) {
+                BIO_printf(bio_err, "Error adding RPK from %s in %s\n", name, file);
+                ret = 0;
+            } else {
+                found = 1;
+            }
+            EVP_PKEY_free(pkey);
+        } else if (WHEN_PEM_X509(name, d2i_X509)
+            || WHEN_PEM_X509_AUX(name, d2i_X509_AUX)) {
+            cert = d2i(NULL, &p, buflen);
+            if (p - buf != buflen || cert == NULL) {
+                BIO_printf(bio_err, "Error reading %s in %s\n", name, file);
+                ret = 0;
+            } else if ((pkey = X509_get0_pubkey(cert)) == NULL
+                || !SSL_add_expected_rpk(ssl, pkey)) {
+                BIO_printf(bio_err, "Error adding RPK from %s in %s\n", name, file);
+                ret = 0;
+            } else {
+                found = 1;
+            }
+            X509_free(cert);
+        } else if (WHEN_PKEY_TYPE(name, PEM_STRING_PKCS8INF, NID_undef) == 0
+            || WHEN_PKEY_TYPE(name, PEM_STRING_RSA, EVP_PKEY_RSA)
+            || WHEN_PKEY_TYPE(name, PEM_STRING_ECPRIVATEKEY, EVP_PKEY_EC)
+            || WHEN_PKEY_TYPE(name, PEM_STRING_DSA, EVP_PKEY_DSA)) {
+            if (pkey_type != NID_undef) {
+                pkey = d2i_PrivateKey(pkey_type, 0, &p, buflen);
+            } else {
+                if ((p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, buflen)) != NULL) {
+                    pkey = EVP_PKCS82PKEY(p8);
+                    PKCS8_PRIV_KEY_INFO_free(p8);
+                }
+            }
+            if (p - buf != buflen || pkey == NULL) {
+                BIO_printf(bio_err, "Error reading %s in %s\n", name, file);
+                ret = 0;
+            } else if (!SSL_add_expected_rpk(ssl, pkey)) {
+                BIO_printf(bio_err, "Error adding RPK from %s in %s\n", name, file);
+                ret = 0;
+            } else {
+                found = 1;
+            }
+            EVP_PKEY_free(pkey);
+        }
+    }
+
+    OPENSSL_free(name);
+    OPENSSL_free(header);
+    OPENSSL_free(buf);
+    ERR_pop_to_mark();
+    BIO_free(in);
+    return found && ret;
 }

 #define X509V3_EXT_UNKNOWN_MASK (0xfL << 16)
@@ -1248,8 +1435,8 @@ int copy_extensions(X509 *x, X509_REQ *req, int copy_type)
     exts = X509_REQ_get_extensions(req);

     for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) {
-        X509_EXTENSION *ext = sk_X509_EXTENSION_value(exts, i);
-        ASN1_OBJECT *obj = X509_EXTENSION_get_object(ext);
+        const X509_EXTENSION *ext = sk_X509_EXTENSION_value(exts, i);
+        const ASN1_OBJECT *obj = X509_EXTENSION_get_object(ext);
         int idx = X509_get_ext_by_OBJ(x, obj, -1);

         /* Does extension exist in target? */
@@ -1339,8 +1526,7 @@ void print_name(BIO *out, const char *title, const X509_NAME *nm)
     }
     if (lflags == XN_FLAG_COMPAT) {
         buf = X509_NAME_oneline(nm, 0, 0);
-        BIO_puts(out, buf);
-        BIO_puts(out, "\n");
+        BIO_printf(out, "%s\n", buf);
         OPENSSL_free(buf);
     } else {
         if (mline)
@@ -1355,20 +1541,20 @@ void print_bignum_var(BIO *out, const BIGNUM *in, const char *var,
 {
     BIO_printf(out, "    static unsigned char %s_%d[] = {", var, len);
     if (BN_is_zero(in)) {
-        BIO_printf(out, "\n        0x00");
+        BIO_puts(out, "\n        0x00");
     } else {
         int i, l;

         l = BN_bn2bin(in, buffer);
         for (i = 0; i < l; i++) {
-            BIO_printf(out, (i % 10) == 0 ? "\n        " : " ");
+            BIO_printf(out, (i % 16) == 0 ? "\n        " : " ");
             if (i < l - 1)
                 BIO_printf(out, "0x%02X,", buffer[i]);
             else
                 BIO_printf(out, "0x%02X", buffer[i]);
         }
     }
-    BIO_printf(out, "\n    };\n");
+    BIO_puts(out, "\n    };\n");
 }

 void print_array(BIO *out, const char *title, int len, const unsigned char *d)
@@ -1378,13 +1564,13 @@ void print_array(BIO *out, const char *title, int len, const unsigned char *d)
     BIO_printf(out, "unsigned char %s[%d] = {", title, len);
     for (i = 0; i < len; i++) {
         if ((i % 10) == 0)
-            BIO_printf(out, "\n    ");
+            BIO_puts(out, "\n    ");
         if (i < len - 1)
             BIO_printf(out, "0x%02X, ", d[i]);
         else
             BIO_printf(out, "0x%02X", d[i]);
     }
-    BIO_printf(out, "\n};\n");
+    BIO_puts(out, "\n};\n");
 }

 X509_STORE *setup_verify(const char *CAfile, int noCAfile,
@@ -1520,7 +1706,7 @@ BIGNUM *load_serial(const char *serialfile, int *exists, int create,
         ERR_clear_error();
         ret = BN_new();
         if (ret == NULL) {
-            BIO_printf(bio_err, "Out of memory\n");
+            BIO_puts(bio_err, "Out of memory\n");
         } else if (!rand_serial(ret, ai)) {
             BIO_printf(bio_err, "Error creating random number to store in %s\n",
                 serialfile);
@@ -1535,7 +1721,7 @@ BIGNUM *load_serial(const char *serialfile, int *exists, int create,
         }
         ret = ASN1_INTEGER_to_BN(ai, NULL);
         if (ret == NULL) {
-            BIO_printf(bio_err, "Error converting number from bin to BIGNUM\n");
+            BIO_puts(bio_err, "Error converting number from bin to BIGNUM\n");
             goto err;
         }
     }
@@ -1552,6 +1738,16 @@ err:
     return ret;
 }

+/*
+ * Character that separates a filename from its suffix in the file-rotation
+ * helpers below.  On VMS, '.' is structural so we use '-' instead.
+ */
+#ifndef OPENSSL_SYS_VMS
+#define SUFFIX_SEP '.'
+#else
+#define SUFFIX_SEP '-'
+#endif
+
 int save_serial(const char *serialfile, const char *suffix,
     const BIGNUM *serial, ASN1_INTEGER **retai)
 {
@@ -1559,25 +1755,16 @@ int save_serial(const char *serialfile, const char *suffix,
     BIO *out = NULL;
     int ret = 0;
     ASN1_INTEGER *ai = NULL;
-    int j;
-
-    if (suffix == NULL)
-        j = strlen(serialfile);
-    else
-        j = strlen(serialfile) + strlen(suffix) + 1;
-    if (j >= BSIZE) {
-        BIO_printf(bio_err, "File name too long\n");
-        goto err;
-    }

     if (suffix == NULL) {
-        OPENSSL_strlcpy(buf[0], serialfile, BSIZE);
+        if (OPENSSL_strlcpy(buf[0], serialfile, BSIZE) >= BSIZE)
+            goto too_long;
     } else {
-#ifndef OPENSSL_SYS_VMS
-        BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", serialfile, suffix);
-#else
-        BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", serialfile, suffix);
-#endif
+        int n = snprintf(buf[0], sizeof(buf[0]), "%s%c%s",
+            serialfile, SUFFIX_SEP, suffix);
+
+        if (n < 0 || (size_t)n >= sizeof(buf[0]))
+            goto too_long;
     }
     out = BIO_new_file(buf[0], "w");
     if (out == NULL) {
@@ -1585,7 +1772,7 @@ int save_serial(const char *serialfile, const char *suffix,
     }

     if ((ai = BN_to_ASN1_INTEGER(serial, NULL)) == NULL) {
-        BIO_printf(bio_err, "error converting serial to ASN.1 format\n");
+        BIO_puts(bio_err, "error converting serial to ASN.1 format\n");
         goto err;
     }
     i2a_ASN1_INTEGER(out, ai);
@@ -1595,6 +1782,9 @@ int save_serial(const char *serialfile, const char *suffix,
         *retai = ai;
         ai = NULL;
     }
+    goto err;
+too_long:
+    BIO_puts(bio_err, "File name too long\n");
 err:
     if (!ret)
         ERR_print_errors(bio_err);
@@ -1607,23 +1797,16 @@ int rotate_serial(const char *serialfile, const char *new_suffix,
     const char *old_suffix)
 {
     char buf[2][BSIZE];
-    int i, j;
-
-    i = strlen(serialfile) + strlen(old_suffix);
-    j = strlen(serialfile) + strlen(new_suffix);
-    if (i > j)
-        j = i;
-    if (j + 1 >= BSIZE) {
-        BIO_printf(bio_err, "File name too long\n");
-        goto err;
-    }
-#ifndef OPENSSL_SYS_VMS
-    BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", serialfile, new_suffix);
-    BIO_snprintf(buf[1], sizeof(buf[1]), "%s.%s", serialfile, old_suffix);
-#else
-    BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", serialfile, new_suffix);
-    BIO_snprintf(buf[1], sizeof(buf[1]), "%s-%s", serialfile, old_suffix);
-#endif
+    int n;
+
+    n = snprintf(buf[0], sizeof(buf[0]), "%s%c%s",
+        serialfile, SUFFIX_SEP, new_suffix);
+    if (n < 0 || (size_t)n >= sizeof(buf[0]))
+        goto too_long;
+    n = snprintf(buf[1], sizeof(buf[1]), "%s%c%s",
+        serialfile, SUFFIX_SEP, old_suffix);
+    if (n < 0 || (size_t)n >= sizeof(buf[1]))
+        goto too_long;
     if (rename(serialfile, buf[1]) < 0 && errno != ENOENT
 #ifdef ENOTDIR
         && errno != ENOTDIR
@@ -1642,6 +1825,8 @@ int rotate_serial(const char *serialfile, const char *new_suffix,
         goto err;
     }
     return 1;
+too_long:
+    BIO_puts(bio_err, "File name too long\n");
 err:
     ERR_print_errors(bio_err);
     return 0;
@@ -1706,11 +1891,7 @@ CA_DB *load_index(const char *dbfile, DB_ATTR *db_attr)
     if ((tmpdb = TXT_DB_read(in, DB_NUMBER)) == NULL)
         goto err;

-#ifndef OPENSSL_SYS_VMS
-    BIO_snprintf(buf, sizeof(buf), "%s.attr", dbfile);
-#else
-    BIO_snprintf(buf, sizeof(buf), "%s-attr", dbfile);
-#endif
+    snprintf(buf, sizeof(buf), "%s%cattr", dbfile, SUFFIX_SEP);
     dbattr_conf = app_load_config_quiet(buf);

     retdb = app_malloc(sizeof(*retdb), "new DB");
@@ -1782,22 +1963,20 @@ int save_index(const char *dbfile, const char *suffix, CA_DB *db)
 {
     char buf[3][BSIZE];
     BIO *out;
-    int j;
-
-    j = strlen(dbfile) + strlen(suffix);
-    if (j + 6 >= BSIZE) {
-        BIO_printf(bio_err, "File name too long\n");
-        goto err;
-    }
-#ifndef OPENSSL_SYS_VMS
-    BIO_snprintf(buf[2], sizeof(buf[2]), "%s.attr", dbfile);
-    BIO_snprintf(buf[1], sizeof(buf[1]), "%s.attr.%s", dbfile, suffix);
-    BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", dbfile, suffix);
-#else
-    BIO_snprintf(buf[2], sizeof(buf[2]), "%s-attr", dbfile);
-    BIO_snprintf(buf[1], sizeof(buf[1]), "%s-attr-%s", dbfile, suffix);
-    BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", dbfile, suffix);
-#endif
+    int j, n;
+
+    n = snprintf(buf[2], sizeof(buf[2]), "%s%cattr",
+        dbfile, SUFFIX_SEP);
+    if (n < 0 || (size_t)n >= sizeof(buf[2]))
+        goto too_long;
+    n = snprintf(buf[1], sizeof(buf[1]), "%s%cattr%c%s",
+        dbfile, SUFFIX_SEP, SUFFIX_SEP, suffix);
+    if (n < 0 || (size_t)n >= sizeof(buf[1]))
+        goto too_long;
+    n = snprintf(buf[0], sizeof(buf[0]), "%s%c%s",
+        dbfile, SUFFIX_SEP, suffix);
+    if (n < 0 || (size_t)n >= sizeof(buf[0]))
+        goto too_long;
     out = BIO_new_file(buf[0], "w");
     if (out == NULL) {
         perror(dbfile);
@@ -1820,6 +1999,8 @@ int save_index(const char *dbfile, const char *suffix, CA_DB *db)
     BIO_free(out);

     return 1;
+too_long:
+    BIO_puts(bio_err, "File name too long\n");
 err:
     ERR_print_errors(bio_err);
     return 0;
@@ -1829,29 +2010,28 @@ int rotate_index(const char *dbfile, const char *new_suffix,
     const char *old_suffix)
 {
     char buf[5][BSIZE];
-    int i, j;
-
-    i = strlen(dbfile) + strlen(old_suffix);
-    j = strlen(dbfile) + strlen(new_suffix);
-    if (i > j)
-        j = i;
-    if (j + 6 >= BSIZE) {
-        BIO_printf(bio_err, "File name too long\n");
-        goto err;
-    }
-#ifndef OPENSSL_SYS_VMS
-    BIO_snprintf(buf[4], sizeof(buf[4]), "%s.attr", dbfile);
-    BIO_snprintf(buf[3], sizeof(buf[3]), "%s.attr.%s", dbfile, old_suffix);
-    BIO_snprintf(buf[2], sizeof(buf[2]), "%s.attr.%s", dbfile, new_suffix);
-    BIO_snprintf(buf[1], sizeof(buf[1]), "%s.%s", dbfile, old_suffix);
-    BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", dbfile, new_suffix);
-#else
-    BIO_snprintf(buf[4], sizeof(buf[4]), "%s-attr", dbfile);
-    BIO_snprintf(buf[3], sizeof(buf[3]), "%s-attr-%s", dbfile, old_suffix);
-    BIO_snprintf(buf[2], sizeof(buf[2]), "%s-attr-%s", dbfile, new_suffix);
-    BIO_snprintf(buf[1], sizeof(buf[1]), "%s-%s", dbfile, old_suffix);
-    BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", dbfile, new_suffix);
-#endif
+    int n;
+
+    n = snprintf(buf[4], sizeof(buf[4]), "%s%cattr",
+        dbfile, SUFFIX_SEP);
+    if (n < 0 || (size_t)n >= sizeof(buf[4]))
+        goto too_long;
+    n = snprintf(buf[3], sizeof(buf[3]), "%s%cattr%c%s",
+        dbfile, SUFFIX_SEP, SUFFIX_SEP, old_suffix);
+    if (n < 0 || (size_t)n >= sizeof(buf[3]))
+        goto too_long;
+    n = snprintf(buf[2], sizeof(buf[2]), "%s%cattr%c%s",
+        dbfile, SUFFIX_SEP, SUFFIX_SEP, new_suffix);
+    if (n < 0 || (size_t)n >= sizeof(buf[2]))
+        goto too_long;
+    n = snprintf(buf[1], sizeof(buf[1]), "%s%c%s",
+        dbfile, SUFFIX_SEP, old_suffix);
+    if (n < 0 || (size_t)n >= sizeof(buf[1]))
+        goto too_long;
+    n = snprintf(buf[0], sizeof(buf[0]), "%s%c%s",
+        dbfile, SUFFIX_SEP, new_suffix);
+    if (n < 0 || (size_t)n >= sizeof(buf[0]))
+        goto too_long;
     if (rename(dbfile, buf[1]) < 0 && errno != ENOENT
 #ifdef ENOTDIR
         && errno != ENOTDIR
@@ -1887,6 +2067,8 @@ int rotate_index(const char *dbfile, const char *new_suffix,
         goto err;
     }
     return 1;
+too_long:
+    BIO_puts(bio_err, "File name too long\n");
 err:
     ERR_print_errors(bio_err);
     return 0;
@@ -2016,7 +2198,7 @@ X509_NAME *parse_name(const char *cp, int chtype, int canmulti,
             continue;
         }
         if (!X509_NAME_add_entry_by_NID(n, nid, chtype,
-                valstr, strlen((char *)valstr),
+                valstr, (int)strlen((char *)valstr),
                 -1, ismulti ? -1 : 0)) {
             ERR_print_errors(bio_err);
             BIO_printf(bio_err,
@@ -2077,6 +2259,71 @@ int bio_to_mem(unsigned char **out, size_t *outlen, size_t maxlen, BIO *in)
     return 1;
 }

+#if defined(OPENSSL_SYS_UNIX) && defined(_POSIX_MAPPED_FILES) && _POSIX_MAPPED_FILES > 0
+int app_mmap_file(const char *path, BIO *err_bio, size_t known_size,
+    const unsigned char **out_data, size_t *out_size)
+{
+    struct stat st;
+    size_t filesize;
+    int fd;
+    int ret = -1;
+    void *p;
+
+    *out_data = NULL;
+    *out_size = 0;
+
+    if (known_size == 0)
+        return 0;
+
+    fd = open(path, O_RDONLY);
+    if (fd < 0) {
+        BIO_puts(err_bio, "Error opening file for memory mapping\n");
+        return -1;
+    }
+
+    if (known_size == (size_t)-1) {
+        if (fstat(fd, &st) != 0 || st.st_size < 0) {
+            BIO_printf(err_bio, "Error: failed to get size of file '%s'\n", path);
+            goto err;
+        }
+        if (!S_ISREG(st.st_mode)) {
+            /*
+             * mmap() is only for regular files. Directories and other non-regular
+             * paths can report st_size == 0; do not treat those like empty files
+             * and fall back to the buffer path in callers.
+             */
+            BIO_puts(err_bio, "Error: failed to use memory-mapped file\n");
+            goto err;
+        }
+        filesize = (size_t)st.st_size;
+        if ((off_t)filesize != st.st_size) {
+            BIO_puts(err_bio, "Error: failed to convert file size, likely too big\n");
+            goto err;
+        }
+        if (filesize == 0) {
+            ret = 0;
+            goto err;
+        }
+    } else {
+        filesize = known_size;
+    }
+
+    p = mmap(NULL, filesize, PROT_READ, MAP_PRIVATE, fd, 0);
+    (void)close(fd);
+    if (p == MAP_FAILED) {
+        BIO_puts(err_bio, "Error: failed to use memory-mapped file\n");
+        return -1;
+    }
+    *out_data = (const unsigned char *)p;
+    *out_size = filesize;
+    return 1;
+
+err:
+    close(fd);
+    return ret;
+}
+#endif
+
 int pkey_ctrl_string(EVP_PKEY_CTX *ctx, const char *value)
 {
     int rv = 0;
@@ -2098,6 +2345,69 @@ err:
     return rv;
 }

+static int
+encoder_ctrl_string(OSSL_ENCODER_CTX *ctx, const char *value)
+{
+    int rv = 0;
+    char *stmp, *vtmp = NULL;
+
+    stmp = OPENSSL_strdup(value);
+    if (stmp == NULL)
+        return -1;
+    vtmp = strchr(stmp, ':');
+    if (vtmp == NULL) {
+        BIO_printf(bio_err,
+            "Missing encoder option value: %s\n", value);
+        goto end;
+    }
+
+    *vtmp = 0;
+    vtmp++;
+    rv = OSSL_ENCODER_CTX_ctrl_string(ctx, stmp, vtmp);
+
+end:
+    OPENSSL_free(stmp);
+    return rv;
+}
+
+int encode_private_key(BIO *out, const char *output_type, const EVP_PKEY *pkey,
+    const STACK_OF(OPENSSL_STRING) *encopt,
+    const EVP_CIPHER *cipher, const char *pass)
+{
+    int ret = 0;
+    OSSL_ENCODER_CTX *ectx = OSSL_ENCODER_CTX_new_for_pkey(pkey, EVP_PKEY_PRIVATE_KEY,
+        output_type, "PrivateKeyInfo", NULL);
+
+    if (ectx == NULL)
+        return 0;
+
+    if (cipher != NULL) {
+        if (!OSSL_ENCODER_CTX_set_cipher(ectx, EVP_CIPHER_get0_name(cipher), NULL))
+            goto end;
+        OSSL_ENCODER_CTX_set_passphrase_ui(ectx, get_ui_method(), NULL);
+        if (pass != NULL
+            && !OSSL_ENCODER_CTX_set_passphrase(ectx,
+                (const unsigned char *)pass, strlen(pass)))
+            goto end;
+    }
+
+    if (encopt != NULL) {
+        int i, n = sk_OPENSSL_STRING_num(encopt);
+
+        for (i = 0; i < n; ++i) {
+            const char *opt = sk_OPENSSL_STRING_value(encopt, i);
+
+            if (encoder_ctrl_string(ectx, opt) <= 0)
+                goto end;
+        }
+    }
+
+    ret = OSSL_ENCODER_to_bio(ectx, out);
+end:
+    OSSL_ENCODER_CTX_free(ectx);
+    return ret;
+}
+
 static void nodes_print(const char *name, STACK_OF(X509_POLICY_NODE) *nodes)
 {
     X509_POLICY_NODE *node;
@@ -2187,42 +2497,131 @@ unsigned char *next_protos_parse(size_t *outlen, const char *in)
     return out;
 }

-int check_cert_attributes(BIO *bio, X509 *x, const char *checkhost,
-    const char *checkemail, const char *checkip,
-    int print)
+int check_cert_might_be_valid(BIO *bio, BIO *b_err, X509 *x, const char *checkhost,
+    const char *checkemail, const char *checkip)
 {
-    int valid_host = 0;
-    int valid_mail = 0;
-    int valid_ip = 0;
-    int ret = 1;
+    int ret = 0;
+    int error;
+    X509_STORE_CTX *ctx = NULL;
+    X509_STORE *store = NULL;
+    X509_VERIFY_PARAM *vpm = NULL;

-    if (x == NULL)
-        return 0;
+    if (x == NULL) {
+        maybe_printf(b_err, "Internal error, NULL certificate\n");
+        goto err;
+    }

-    if (checkhost != NULL) {
-        valid_host = X509_check_host(x, checkhost, 0, 0, NULL);
-        if (print)
-            BIO_printf(bio, "Hostname %s does%s match certificate\n",
-                checkhost, valid_host == 1 ? "" : " NOT");
-        ret = ret && valid_host > 0;
+    if ((store = X509_STORE_new()) == NULL) {
+        maybe_printf(b_err, "Malloc failed or internal error\n");
+        goto err;
     }

-    if (checkemail != NULL) {
-        valid_mail = X509_check_email(x, checkemail, 0, 0);
-        if (print)
-            BIO_printf(bio, "Email %s does%s match certificate\n",
-                checkemail, valid_mail ? "" : " NOT");
-        ret = ret && valid_mail > 0;
+    if (!X509_STORE_add_cert(store, x)) {
+        maybe_printf(b_err, "Malloc failed or internal error\n");
+        goto err;
+    }
+
+    if ((vpm = X509_STORE_get0_param(store)) == NULL) {
+        maybe_printf(b_err, "Malloc failed or internal error\n");
+        goto err;
     }

-    if (checkip != NULL) {
-        valid_ip = X509_check_ip_asc(x, checkip, 0);
-        if (print)
-            BIO_printf(bio, "IP %s does%s match certificate\n",
-                checkip, valid_ip ? "" : " NOT");
-        ret = ret && valid_ip > 0;
+    if ((ctx = X509_STORE_CTX_new()) == NULL) {
+        maybe_printf(b_err, "Malloc failed or internal error\n");
+        goto err;
+    }
+
+    /*
+     * As this is "might verify":
+     *
+     * We don't care about the verification time.
+     * We are trusting ourselves.
+     * We are very liberal in what we allow.
+     *
+     * Needless to say these flags should normally not be used in a
+     * for real verification.
+     */
+    X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_NO_CHECK_TIME);
+    X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_PARTIAL_CHAIN);
+    X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_IGNORE_CRITICAL);
+    X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_ALLOW_PROXY_CERTS);
+
+    if (!X509_VERIFY_PARAM_set1_ip_asc(vpm, checkip)) {
+        maybe_printf(b_err, "Invalid IP address: %s\n", checkip);
+        goto err;
     }

+    if (!X509_VERIFY_PARAM_set1_host(vpm, checkhost, 0)) {
+        maybe_printf(b_err, "Invalid host name: %s\n", checkhost);
+        goto err;
+    }
+
+    if (!X509_VERIFY_PARAM_set1_email(vpm, checkemail, 0)) {
+        maybe_printf(b_err, "Invalid email address: %s\n", checkemail);
+        goto err;
+    }
+
+    if (!X509_VERIFY_PARAM_set1_ip_asc(vpm, checkip)) {
+        maybe_printf(b_err, "Invalid IP address: %s\n", checkip);
+        goto err;
+    }
+
+    if (!X509_STORE_CTX_init(ctx, store, x, NULL)) {
+        maybe_printf(b_err, "Malloc failed or internal error\n");
+        goto err;
+    }
+
+    /* We might be verifying for ANY purpose ... */
+    if (!X509_STORE_CTX_set_purpose(ctx, X509_PURPOSE_ANY)) {
+        maybe_printf(b_err, "Malloc failed or internal error\n");
+        goto err;
+    }
+
+    ret = X509_verify_cert(ctx);
+    error = X509_STORE_CTX_get_error(ctx);
+    if (!ret) {
+
+        maybe_printf(bio, "Certificate may not verify: error %s\n",
+            X509_verify_cert_error_string(error));
+
+        if (checkhost != NULL && error == X509_V_ERR_HOSTNAME_MISMATCH)
+            maybe_printf(bio, "Hostname %s does NOT match certificate\n",
+                checkhost);
+        else if (checkemail != NULL && error == X509_V_ERR_EMAIL_MISMATCH)
+            maybe_printf(bio, "Email %s does NOT match certificate\n",
+                checkemail);
+        else if (checkip != NULL && error == X509_V_ERR_IP_ADDRESS_MISMATCH)
+            maybe_printf(bio, "IP %s does NOT match certificate\n",
+                checkip);
+        else {
+            /* Originally, we only cared about the above failures */
+            /*
+             * Suppress trust rejection errors, we don't care, because
+             * we don't really know what this might be used for if
+             * this was for real.
+             */
+            if (error == X509_V_ERR_CERT_REJECTED) {
+                maybe_printf(bio, "Ignoring certificate rejection error\n");
+                ret = 1;
+            }
+        }
+    } else {
+        if (checkhost != NULL)
+            maybe_printf(bio, "Hostname %s does match certificate\n",
+                checkhost);
+        if (checkemail != NULL)
+            maybe_printf(bio, "Email %s does match certificate\n",
+                checkemail);
+        if (checkip != NULL)
+            maybe_printf(bio, "IP %s does match certificate\n",
+                checkip);
+    }
+    X509_STORE_CTX_cleanup(ctx);
+
+err:
+    ERR_print_errors(b_err);
+    X509_STORE_free(store);
+    X509_STORE_CTX_free(ctx);
     return ret;
 }

@@ -2309,32 +2708,24 @@ static int do_sign_init(EVP_MD_CTX *ctx, EVP_PKEY *pkey,
         && do_pkey_ctx_init(pkctx, sigopts);
 }

-static int adapt_keyid_ext(X509 *cert, X509V3_CTX *ext_ctx,
-    const char *name, const char *value, int add_default)
+int do_EXT_add_nconf(CONF *conf1, CONF *conf2, X509V3_CTX *ctx,
+    X509 *cert, const char *msg, const char *sect)
 {
-    const STACK_OF(X509_EXTENSION) *exts = X509_get0_extensions(cert);
-    X509_EXTENSION *new_ext = X509V3_EXT_nconf(NULL, ext_ctx, name, value);
-    int idx, rv = 0;
-
-    if (new_ext == NULL)
-        return rv;
-
-    idx = X509v3_get_ext_by_OBJ(exts, X509_EXTENSION_get_object(new_ext), -1);
-    if (idx >= 0) {
-        X509_EXTENSION *found_ext = X509v3_get_ext(exts, idx);
-        ASN1_OCTET_STRING *encoded = X509_EXTENSION_get_data(found_ext);
-        int disabled = ASN1_STRING_length(encoded) <= 2; /* indicating "none" */
+    X509V3_set_nconf(ctx, conf1);
+    if (X509V3_EXT_add_nconf(conf2, ctx, sect != NULL ? sect : "default", cert))
+        return 1;
+    BIO_printf(bio_err, msg, sect);
+    return 0;
+}

-        if (disabled) {
-            X509_delete_ext(cert, idx);
-            X509_EXTENSION_free(found_ext);
-        } /* else keep existing key identifier, which might be outdated */
-        rv = 1;
-    } else {
-        rv = !add_default || X509_add_ext(cert, new_ext, -1);
-    }
-    X509_EXTENSION_free(new_ext);
-    return rv;
+int do_EXT_REQ_add_nconf(CONF *conf1, CONF *conf2, X509V3_CTX *ctx,
+    X509_REQ *req, const char *msg, const char *sect)
+{
+    X509V3_set_nconf(ctx, conf1);
+    if (X509V3_EXT_REQ_add_nconf(conf2, ctx, sect, req))
+        return 1;
+    BIO_printf(bio_err, msg, sect);
+    return 0;
 }

 int cert_matches_key(const X509 *cert, const EVP_PKEY *pkey)
@@ -2351,32 +2742,14 @@ int cert_matches_key(const X509 *cert, const EVP_PKEY *pkey)
 int do_X509_sign(X509 *cert, int force_v1, EVP_PKEY *pkey, const char *md,
     STACK_OF(OPENSSL_STRING) *sigopts, X509V3_CTX *ext_ctx)
 {
-    EVP_MD_CTX *mctx = EVP_MD_CTX_new();
-    int self_sign;
+    EVP_MD_CTX *mctx;
     int rv = 0;

-    if (!force_v1) {
-        if (!X509_set_version(cert, X509_VERSION_3))
-            goto end;
-
-        /*
-         * Add default SKID before AKID such that AKID can make use of it
-         * in case the certificate is self-signed
-         */
-        /* Prevent X509_V_ERR_MISSING_SUBJECT_KEY_IDENTIFIER */
-        if (!adapt_keyid_ext(cert, ext_ctx, "subjectKeyIdentifier", "hash", 1))
-            goto end;
-        /* Prevent X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIER */
-        self_sign = cert_matches_key(cert, pkey);
-        if (!adapt_keyid_ext(cert, ext_ctx, "authorityKeyIdentifier",
-                "keyid, issuer", !self_sign))
-            goto end;
-    }
-    /* May add further measures for ensuring RFC 5280 compliance, see #19805 */
-
-    if (mctx != NULL && do_sign_init(mctx, pkey, md, sigopts) > 0)
+    if (!force_v1 && !X509_set_version(cert, X509_VERSION_3))
+        return 0;
+    if ((mctx = EVP_MD_CTX_new()) != NULL
+        && do_sign_init(mctx, pkey, md, sigopts) > 0)
         rv = (X509_sign_ctx(cert, mctx) > 0);
-end:
     EVP_MD_CTX_free(mctx);
     return rv;
 }
@@ -2440,7 +2813,7 @@ int do_X509_REQ_verify(X509_REQ *x, EVP_PKEY *pkey,

 /* Get first http URL from a DIST_POINT structure */

-static const char *get_dp_url(DIST_POINT *dp)
+static char *get_dp_url(DIST_POINT *dp)
 {
     GENERAL_NAMES *gens;
     GENERAL_NAME *gen;
@@ -2453,11 +2826,13 @@ static const char *get_dp_url(DIST_POINT *dp)
     for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
         gen = sk_GENERAL_NAME_value(gens, i);
         uri = GENERAL_NAME_get0_value(gen, &gtype);
-        if (gtype == GEN_URI && ASN1_STRING_length(uri) > 6) {
+        if (gtype == GEN_URI && ASN1_STRING_get_length(uri) > 6) {
             const char *uptr = (const char *)ASN1_STRING_get0_data(uri);
+            char *ret = OPENSSL_strndup(uptr, ASN1_STRING_get_length(uri));

-            if (IS_HTTP(uptr)) /* can/should not use HTTPS here */
-                return uptr;
+            if (ret != NULL && IS_HTTP(ret))
+                return ret;
+            OPENSSL_free(ret);
         }
     }
     return NULL;
@@ -2471,14 +2846,18 @@ static const char *get_dp_url(DIST_POINT *dp)
 static X509_CRL *load_crl_crldp(STACK_OF(DIST_POINT) *crldp)
 {
     int i;
-    const char *urlptr = NULL;
+    char *urlptr = NULL;

     for (i = 0; i < sk_DIST_POINT_num(crldp); i++) {
         DIST_POINT *dp = sk_DIST_POINT_value(crldp, i);

         urlptr = get_dp_url(dp);
-        if (urlptr != NULL)
-            return load_crl(urlptr, FORMAT_UNDEF, 0, "CRL via CDP");
+        if (urlptr != NULL) {
+            X509_CRL *crl = load_crl(urlptr, FORMAT_UNDEF, 0, "CRL via CDP");
+
+            OPENSSL_free(urlptr);
+            return crl;
+        }
     }
     return NULL;
 }
@@ -2491,7 +2870,7 @@ static X509_CRL *load_crl_crldp(STACK_OF(DIST_POINT) *crldp)
 static STACK_OF(X509_CRL) *crls_http_cb(const X509_STORE_CTX *ctx,
     const X509_NAME *nm)
 {
-    X509 *x;
+    const X509 *x;
     STACK_OF(X509_CRL) *crls = NULL;
     X509_CRL *crl;
     STACK_OF(DIST_POINT) *crldp;
@@ -2528,6 +2907,34 @@ void store_setup_crl_download(X509_STORE *st)
     X509_STORE_set_lookup_crls_cb(st, crls_http_cb);
 }

+int host_is_ip_address(const char *host)
+{
+#ifndef INET6_ADDRSTRLEN /* not defined on OPENSSL_NO_SOCK */
+#define INET6_ADDRSTRLEN 46
+#endif
+    char stripped_host_ipv6[INET6_ADDRSTRLEN + 1];
+    ASN1_OCTET_STRING *str;
+    int ret;
+
+    if (host == NULL)
+        return 0;
+
+    if (host[0] == '[') { /* OSSL_parse_url() returns IPv6 addresses enclosed in [ and ] */
+        size_t len = strlen(++host);
+        if (len == 0 || len > sizeof(stripped_host_ipv6) || host[--len] != ']')
+            return 0;
+        strncpy(stripped_host_ipv6, host, sizeof(stripped_host_ipv6));
+        stripped_host_ipv6[len] = '\0';
+        host = stripped_host_ipv6;
+    }
+    ERR_set_mark();
+    str = a2i_IPADDRESS(host);
+    ret = str != NULL;
+    ERR_pop_to_mark();
+    ASN1_OCTET_STRING_free(str);
+    return ret;
+}
+
 #if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
 static const char *tls_error_hint(void)
 {
@@ -2577,15 +2984,12 @@ BIO *app_http_tls_cb(BIO *bio, void *arg, int connect, int detail)
 {
     APP_HTTP_TLS_INFO *info = (APP_HTTP_TLS_INFO *)arg;
     SSL_CTX *ssl_ctx = info->ssl_ctx;
+    BIO *sbio = NULL;

     if (ssl_ctx == NULL) /* not using TLS */
         return bio;
     if (connect) {
         SSL *ssl;
-        BIO *sbio = NULL;
-        X509_STORE *ts = SSL_CTX_get_cert_store(ssl_ctx);
-        X509_VERIFY_PARAM *vpm = X509_STORE_get0_param(ts);
-        const char *host = vpm == NULL ? NULL : X509_VERIFY_PARAM_get0_host(vpm, 0 /* first hostname */);

         /* adapt after fixing callback design flaw, see #17088 */
         if ((info->use_proxy
@@ -2595,27 +2999,35 @@ BIO *app_http_tls_cb(BIO *bio, void *arg, int connect, int detail)
             || (sbio = BIO_new(BIO_f_ssl())) == NULL) {
             return NULL;
         }
-        if ((ssl = SSL_new(ssl_ctx)) == NULL) {
-            BIO_free(sbio);
-            return NULL;
-        }
-
-        if (vpm != NULL)
-            SSL_set_tlsext_host_name(ssl, host /* may be NULL */);
+        if ((ssl = SSL_new(ssl_ctx)) == NULL)
+            goto err;

         SSL_set_connect_state(ssl);
-        BIO_set_ssl(sbio, ssl, BIO_CLOSE);
+        if (BIO_set_ssl(sbio, ssl, BIO_CLOSE) <= 0) {
+            SSL_free(ssl);
+            goto err;
+        }
+        if (!host_is_ip_address(info->server)) {
+            if (!SSL_set_tlsext_host_name(ssl, info->server)) /* set SNI */
+                goto err;
+        }

         bio = BIO_push(sbio, bio);
     } else { /* disconnect from TLS */
         bio = http_tls_shutdown(bio);
     }
     return bio;
+
+err:
+    BIO_free(sbio);
+    return NULL;
 }

 void APP_HTTP_TLS_INFO_free(APP_HTTP_TLS_INFO *info)
 {
     if (info != NULL) {
+        OPENSSL_free((char *)info->server);
+        OPENSSL_free((char *)info->port);
         SSL_CTX_free(info->ssl_ctx);
         OPENSSL_free(info);
     }
@@ -2738,14 +3150,10 @@ static int WIN32_rename(const char *from, const char *to)
         if (tfrom == NULL)
             goto err;
         tto = tfrom + flen;
-#if !defined(_WIN32_WCE) || _WIN32_WCE >= 101
-        if (!MultiByteToWideChar(CP_ACP, 0, from, flen, (WCHAR *)tfrom, flen))
-#endif
+        if (!MultiByteToWideChar(CP_ACP, 0, from, (int)flen, (WCHAR *)tfrom, (int)flen))
             for (i = 0; i < flen; i++)
                 tfrom[i] = (TCHAR)from[i];
-#if !defined(_WIN32_WCE) || _WIN32_WCE >= 101
-        if (!MultiByteToWideChar(CP_ACP, 0, to, tlen, (WCHAR *)tto, tlen))
-#endif
+        if (!MultiByteToWideChar(CP_ACP, 0, to, (int)tlen, (WCHAR *)tto, (int)tlen))
             for (i = 0; i < tlen; i++)
                 tto[i] = (TCHAR)to[i];
     }
@@ -2804,8 +3212,8 @@ double app_tminterval(int stop, int usertime)
         SYSTEMTIME systime;

         if (usertime && warning) {
-            BIO_printf(bio_err, "To get meaningful results, run "
-                                "this program on idle system.\n");
+            BIO_puts(bio_err, "To get meaningful results, run "
+                              "this program on idle system.\n");
             warning = 0;
         }
         GetSystemTime(&systime);
@@ -2842,8 +3250,8 @@ double app_tminterval(int stop, int usertime)
     static int warning = 1;

     if (usertime && warning) {
-        BIO_printf(bio_err, "To get meaningful results, run "
-                            "this program on idle system.\n");
+        BIO_puts(bio_err, "To get meaningful results, run "
+                          "this program on idle system.\n");
         warning = 0;
     }
 #ifdef CLOCK_REALTIME
@@ -3022,21 +3430,18 @@ BIO *dup_bio_out(int format)
 {
     BIO *b = BIO_new_fp(stdout,
         BIO_NOCLOSE | (FMT_istext(format) ? BIO_FP_TEXT : 0));
-    void *prefix = NULL;
-
-    if (b == NULL)
-        return NULL;

 #ifdef OPENSSL_SYS_VMS
-    if (FMT_istext(format))
-        b = BIO_push(BIO_new(BIO_f_linebuffer()), b);
-#endif
+    if (b != NULL && FMT_istext(format)) {
+        BIO *btmp = BIO_new(BIO_f_linebuffer());

-    if (FMT_istext(format)
-        && (prefix = getenv("HARNESS_OSSL_PREFIX")) != NULL) {
-        b = BIO_push(BIO_new(BIO_f_prefix()), b);
-        BIO_set_prefix(b, prefix);
+        if (btmp == NULL) {
+            BIO_free(b);
+            return NULL;
+        }
+        b = BIO_push(btmp, b);
     }
+#endif

     return b;
 }
@@ -3047,8 +3452,15 @@ BIO *dup_bio_err(int format)
         BIO_NOCLOSE | (FMT_istext(format) ? BIO_FP_TEXT : 0));

 #ifdef OPENSSL_SYS_VMS
-    if (b != NULL && FMT_istext(format))
-        b = BIO_push(BIO_new(BIO_f_linebuffer()), b);
+    if (b != NULL && FMT_istext(format)) {
+        BIO *btmp = BIO_new(BIO_f_linebuffer());
+
+        if (btmp == NULL) {
+            BIO_free(b);
+            return NULL;
+        }
+        b = BIO_push(btmp, b);
+    }
 #endif
     return b;
 }
@@ -3231,7 +3643,7 @@ int mem_bio_to_file(BIO *in, const char *filename, int format, int private)
     out = bio_open_owner(filename, format, private);
     if (out == NULL)
         goto end;
-    rv = BIO_write(out, mem_buffer->data, mem_buffer->length);
+    rv = BIO_write(out, mem_buffer->data, (int)mem_buffer->length);
     if (rv < 0 || (size_t)rv != mem_buffer->length)
         BIO_printf(bio_err, "Error writing to output file: '%s'\n", filename);
     else
@@ -3257,7 +3669,7 @@ void wait_for_async(SSL *s)
         return;
     if (numfds == 0)
         return;
-    fds = app_malloc(sizeof(OSSL_ASYNC_FD) * numfds, "allocate async fds");
+    fds = app_malloc_array(numfds, sizeof(*fds), "allocate async fds");
     if (!SSL_get_all_async_fds(s, fds, &numfds)) {
         OPENSSL_free(fds);
         return;
@@ -3302,12 +3714,23 @@ int has_stdin_waiting(void)
 }
 #endif

-/* Corrupt a signature by modifying final byte */
-void corrupt_signature(const ASN1_STRING *signature)
+/*
+ * Corrupt a signature by modifying final byte
+ * (mutates signature)
+ */
+int corrupt_signature(ASN1_STRING *signature)
 {
-    unsigned char *s = signature->data;
+    const unsigned char *valid = ASN1_STRING_get0_data(signature);
+    size_t length = ASN1_STRING_get_length(signature);
+    unsigned char *s = OPENSSL_memdup(valid, length);
+
+    if (s == NULL)
+        return 0;
+
+    s[length - 1] ^= 0x1;

-    s[signature->length - 1] ^= 0x1;
+    ASN1_STRING_set0(signature, s, (int)length);
+    return 1;
 }

 int check_cert_time_string(const char *time, const char *desc)
@@ -3330,12 +3753,12 @@ int set_cert_times(X509 *x, const char *startdate, const char *enddate,
         return 0;
     if (startdate == NULL || strcmp(startdate, "today") == 0) {
         if (X509_gmtime_adj(X509_getm_notBefore(x), 0) == NULL) {
-            BIO_printf(bio_err, "Error setting notBefore certificate field\n");
+            BIO_puts(bio_err, "Error setting notBefore certificate field\n");
             return 0;
         }
     } else {
         if (!ASN1_TIME_set_string_X509(X509_getm_notBefore(x), startdate)) {
-            BIO_printf(bio_err, "Error setting notBefore certificate field\n");
+            BIO_puts(bio_err, "Error setting notBefore certificate field\n");
             return 0;
         }
     }
@@ -3345,11 +3768,11 @@ int set_cert_times(X509 *x, const char *startdate, const char *enddate,
     }
     if (enddate == NULL) {
         if (X509_time_adj_ex(X509_getm_notAfter(x), days, 0, NULL) == NULL) {
-            BIO_printf(bio_err, "Error setting notAfter certificate field\n");
+            BIO_puts(bio_err, "Error setting notAfter certificate field\n");
             return 0;
         }
     } else if (!ASN1_TIME_set_string_X509(X509_getm_notAfter(x), enddate)) {
-        BIO_printf(bio_err, "Error setting notAfter certificate field\n");
+        BIO_puts(bio_err, "Error setting notAfter certificate field\n");
         return 0;
     }
     if (ASN1_TIME_compare(X509_get0_notAfter(x), X509_get0_notBefore(x)) < 0) {
@@ -3432,7 +3855,7 @@ OSSL_PARAM *app_params_new_from_opts(STACK_OF(OPENSSL_STRING) *opts,
     if (opts == NULL)
         return NULL;

-    params = OPENSSL_zalloc(sizeof(OSSL_PARAM) * (sz + 1));
+    params = OPENSSL_calloc(sz + 1, sizeof(OSSL_PARAM));
     if (params == NULL)
         return NULL;

@@ -3481,11 +3904,11 @@ EVP_PKEY *app_keygen(EVP_PKEY_CTX *ctx, const char *alg, int bits, int verbose)
         if (bits > 0)
             BIO_printf(bio_err, " with %d bits\n", bits);
         else
-            BIO_printf(bio_err, "\n");
+            BIO_puts(bio_err, "\n");
     }
     if (!RAND_status())
-        BIO_printf(bio_err, "Warning: generating random key material may take a long time\n"
-                            "if the system has a poor entropy source\n");
+        BIO_puts(bio_err, "Warning: generating random key material may take a long time\n"
+                          "if the system has a poor entropy source\n");
     if (EVP_PKEY_keygen(ctx, &res) <= 0)
         BIO_printf(bio_err, "%s: Error generating %s key\n", opt_getprog(),
             alg != NULL ? alg : "asymmetric");
@@ -3497,29 +3920,165 @@ EVP_PKEY *app_paramgen(EVP_PKEY_CTX *ctx, const char *alg)
     EVP_PKEY *res = NULL;

     if (!RAND_status())
-        BIO_printf(bio_err, "Warning: generating random key parameters may take a long time\n"
-                            "if the system has a poor entropy source\n");
+        BIO_puts(bio_err, "Warning: generating random key parameters may take a long time\n"
+                          "if the system has a poor entropy source\n");
     if (EVP_PKEY_paramgen(ctx, &res) <= 0)
         BIO_printf(bio_err, "%s: Generating %s key parameters failed\n",
             opt_getprog(), alg != NULL ? alg : "asymmetric");
     return res;
 }

+#define MAX_KEY_SIZE 2048 /* Hope nobody needs mac key longer than 2048 bytes */
+
 /*
- * Return non-zero if the legacy path is still an option.
- * This decision is based on the global command line operations and the
- * behaviour thus far.
+ * Implementations of mac algorithms only support getting a key via the
+ * key and hexkey parameters. This function processes additional parameters
+ * for reading a key from an environment variable or from a file or stdin
+ * and forms a key or hexkey parameter with the read key.
+ * Leaves other parameters unchanged.
+ * Allocates a string with a new parameter and returns a pointer to this
+ * string, the calling code must free this string by calling OPENSSL_clear_free.
+ * Returns NULL in case of an error.
  */
-int opt_legacy_okay(void)
+char *process_additional_mac_key_arguments(const char *arg)
+{
+    static BIO *keybio = NULL;
+    char *val = NULL, *inbuf = NULL, *outbuf = NULL;
+    int total_read = 0;
+    int n;
+    char dummy;
+    int too_long;
+
+    if (CHECK_AND_SKIP_PREFIX(arg, "keyenv:")) {
+        if (strlen(arg) == 0) {
+            BIO_printf(bio_err, "Empty environment variable name\n");
+            return NULL;
+        }
+        val = getenv(arg);
+        if (val == NULL) {
+            BIO_printf(bio_err, "No environment variable %s\n", arg);
+            return NULL;
+        }
+        outbuf = app_malloc(strlen("key:") + strlen(val) + 1, "MACOPT KEYENV");
+        strcpy(outbuf, "key:");
+        strcat(outbuf, val);
+        return outbuf;
+    }
+
+    if (CHECK_AND_SKIP_PREFIX(arg, "keyenvhex:")) {
+        if (strlen(arg) == 0) {
+            BIO_printf(bio_err, "Empty environment variable name\n");
+            return NULL;
+        }
+        val = getenv(arg);
+        if (val == NULL) {
+            BIO_printf(bio_err, "No environment variable %s\n", arg);
+            return NULL;
+        }
+        outbuf = app_malloc(strlen("hexkey:") + strlen(val) + 1, "MACOPT KEYENVHEX");
+        strcpy(outbuf, "hexkey:");
+        strcat(outbuf, val);
+        return outbuf;
+    }
+
+    if (CHECK_AND_SKIP_PREFIX(arg, "keyfile:")) {
+        if (strlen(arg) == 0) {
+            BIO_printf(bio_err, "Empty key file name\n");
+            return NULL;
+        }
+        keybio = BIO_new_file(arg, "rb");
+        if (keybio == NULL) {
+            BIO_printf(bio_err, "Can't open file %s\n", arg);
+            return NULL;
+        }
+        inbuf = app_malloc(MAX_KEY_SIZE, "MACOPT KEYFILE");
+        while (total_read < MAX_KEY_SIZE) {
+            n = BIO_read(keybio, inbuf + total_read, MAX_KEY_SIZE - total_read);
+            if (n < 0) {
+                BIO_printf(bio_err, "Can't read file %s\n", arg);
+                OPENSSL_clear_free(inbuf, MAX_KEY_SIZE);
+                BIO_free(keybio);
+                return NULL;
+            }
+            if (n == 0) /* EOF */
+                break;
+            total_read += n;
+        }
+        too_long = (total_read == MAX_KEY_SIZE && BIO_read(keybio, &dummy, 1) > 0);
+        BIO_free(keybio);
+        if (total_read == 0 || too_long) {
+            /* File is empty or longer than MAX_KEY_SIZE */
+            BIO_printf(bio_err, (too_long) ? "File %s is too long\n" : "File %s is empty\n", arg);
+            OPENSSL_clear_free(inbuf, MAX_KEY_SIZE);
+            return NULL;
+        }
+        outbuf = app_malloc(strlen("hexkey:") + total_read * 2 + 1, "MACOPT KEYFILE");
+        strcpy(outbuf, "hexkey:");
+        OPENSSL_buf2hexstr_ex(outbuf + strlen("hexkey:"), total_read * 2 + 1,
+            NULL, (unsigned char *)inbuf, total_read, '\0');
+        OPENSSL_clear_free(inbuf, MAX_KEY_SIZE);
+        return outbuf;
+    }
+
+    if (strcmp(arg, "keystdin") == 0) {
+        inbuf = get_str_from_file(NULL);
+        if (inbuf == NULL)
+            return NULL;
+        if (strlen(inbuf) == 0) {
+            BIO_printf(bio_err, "Empty key\n");
+            clear_free(inbuf);
+            return NULL;
+        }
+        outbuf = app_malloc(strlen("key:") + strlen(inbuf) + 1, "MACOPT KEYSTDIN");
+        strcpy(outbuf, "key:");
+        strcat(outbuf, inbuf);
+        clear_free(inbuf);
+        return outbuf;
+    }
+
+    return OPENSSL_strdup(arg);
+}
+
+/*
+ * Read one line from file.
+ * Allocates a string with the data read and returns a pointer to this
+ * string, the calling code must free this string.
+ * If filename == NULL, read from standard input.
+ * Returns NULL in case of any error.
+ */
+char *get_str_from_file(const char *filename)
 {
-    int provider_options = opt_provider_option_given();
-    int libctx = app_get0_libctx() != NULL || app_get0_propq() != NULL;
+    static BIO *bio = NULL;
+    int n;
+    char *buf = NULL;
+    char *tmp;

-    /*
-     * Having a provider option specified or a custom library context or
-     * property query, is a sure sign we're not using legacy.
-     */
-    if (provider_options || libctx)
-        return 0;
-    return 1;
+    if (filename == NULL) {
+        unbuffer(stdin);
+        bio = dup_bio_in(FORMAT_TEXT);
+        if (bio == NULL) {
+            BIO_printf(bio_err, "Can't open BIO for stdin\n");
+            return NULL;
+        }
+    } else {
+        bio = BIO_new_file(filename, "r");
+        if (bio == NULL) {
+            BIO_printf(bio_err, "Can't open file %s\n", filename);
+            return NULL;
+        }
+    }
+    buf = app_malloc(MAX_KEY_SIZE, "get_str_from_file");
+    memset(buf, 0, MAX_KEY_SIZE);
+    n = BIO_gets(bio, buf, MAX_KEY_SIZE - 1);
+    BIO_free_all(bio);
+    bio = NULL;
+    if (n <= 0) {
+        BIO_printf(bio_err, "Error reading from %s\n", filename);
+        OPENSSL_clear_free(buf, MAX_KEY_SIZE);
+        return NULL;
+    }
+    tmp = strchr(buf, '\n');
+    if (tmp != NULL)
+        *tmp = 0;
+    return buf;
 }
diff --git a/deps/openssl/openssl/apps/lib/apps_ui.c b/deps/openssl/openssl/apps/lib/apps_ui.c
index aa2230381f3..6388dae6171 100644
--- a/deps/openssl/openssl/apps/lib/apps_ui.c
+++ b/deps/openssl/openssl/apps/lib/apps_ui.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -171,7 +171,7 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_data)
         prompt_info = cb_data->prompt_info;
     prompt = UI_construct_prompt(ui, "pass phrase", prompt_info);
     if (prompt == NULL) {
-        BIO_printf(bio_err, "Out of memory\n");
+        BIO_puts(bio_err, "Out of memory\n");
         UI_free(ui);
         return 0;
     }
@@ -198,15 +198,15 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_data)
     OPENSSL_clear_free(buff, (unsigned int)bufsiz);

     if (ok >= 0)
-        res = strlen(buf);
+        res = (int)strlen(buf);
     if (ok == -1) {
-        BIO_printf(bio_err, "User interface error\n");
+        BIO_puts(bio_err, "User interface error\n");
         ERR_print_errors(bio_err);
         OPENSSL_cleanse(buf, (unsigned int)bufsiz);
         res = 0;
     }
     if (ok == -2) {
-        BIO_printf(bio_err, "aborted!\n");
+        BIO_puts(bio_err, "aborted!\n");
         OPENSSL_cleanse(buf, (unsigned int)bufsiz);
         res = 0;
     }
diff --git a/deps/openssl/openssl/apps/lib/build.info b/deps/openssl/openssl/apps/lib/build.info
index f0df6087340..9512a43b763 100644
--- a/deps/openssl/openssl/apps/lib/build.info
+++ b/deps/openssl/openssl/apps/lib/build.info
@@ -10,7 +10,7 @@ ENDIF
 # Source for libapps
 $LIBAPPSSRC=apps.c apps_ui.c log.c opt.c fmt.c s_cb.c s_socket.c app_rand.c \
         columns.c app_params.c names.c app_provider.c app_x509.c http_server.c \
-        engine.c engine_loader.c app_libctx.c apps_opt_printf.c
+        app_libctx.c apps_opt_printf.c

 IF[{- !$disabled{apps} -}]
   LIBS{noinst}=../libapps.a
@@ -21,3 +21,7 @@ ENDIF
 IF[{- !$disabled{srp} -}]
   SOURCE[../libapps.a]=tlssrp_depr.c
 ENDIF
+
+IF[{- $target{needs_c99_snprintf_compat} -}]
+  SOURCE[../libapps.a]=../../crypto/msvc2013_snprintf.c
+ENDIF
diff --git a/deps/openssl/openssl/apps/lib/cmp_mock_srv.c b/deps/openssl/openssl/apps/lib/cmp_mock_srv.c
index 09b69ff4cf5..c538c04d287 100644
--- a/deps/openssl/openssl/apps/lib/cmp_mock_srv.c
+++ b/deps/openssl/openssl/apps/lib/cmp_mock_srv.c
@@ -345,7 +345,7 @@ static OSSL_CMP_PKISI *process_cert_request(OSSL_CMP_SRV_CTX *srv_ctx,
             STACK_OF(ASN1_UTF8STRING) *strs;
             ASN1_UTF8STRING *str;
             const char *data;
-            int len;
+            size_t len;

             if (OBJ_obj2nid(obj) == NID_id_it_certProfile) {
                 if (!OSSL_CMP_ITAV_get0_certProfile(itav, &strs))
@@ -360,7 +360,7 @@ static OSSL_CMP_PKISI *process_cert_request(OSSL_CMP_SRV_CTX *srv_ctx,
                     ERR_raise(ERR_LIB_CMP, ERR_R_PASSED_INVALID_ARGUMENT);
                     return NULL;
                 }
-                if (((len = ASN1_STRING_length(str)) != (int)sizeof("profile1") - 1)
+                if (((len = ASN1_STRING_get_length(str)) != sizeof("profile1") - 1)
                     || memcmp(data, "profile1", len) != 0) {
                     ERR_raise(ERR_LIB_CMP, CMP_R_UNEXPECTED_CERTPROFILE);
                     return NULL;
@@ -633,10 +633,10 @@ static void process_error(OSSL_CMP_SRV_CTX *srv_ctx, const OSSL_CMP_MSG *error,
         return;
     }

-    BIO_printf(bio_err, "mock server received error:\n");
+    BIO_puts(bio_err, "mock server received error:\n");

     if (statusInfo == NULL) {
-        BIO_printf(bio_err, "pkiStatusInfo absent\n");
+        BIO_puts(bio_err, "pkiStatusInfo absent\n");
     } else {
         sibuf = OSSL_CMP_snprint_PKIStatusInfo(statusInfo, buf, sizeof(buf));
         BIO_printf(bio_err, "pkiStatusInfo: %s\n",
@@ -644,22 +644,22 @@ static void process_error(OSSL_CMP_SRV_CTX *srv_ctx, const OSSL_CMP_MSG *error,
     }

     if (errorCode == NULL)
-        BIO_printf(bio_err, "errorCode absent\n");
+        BIO_puts(bio_err, "errorCode absent\n");
     else
         BIO_printf(bio_err, "errorCode: %ld\n", ASN1_INTEGER_get(errorCode));

     if (sk_ASN1_UTF8STRING_num(errorDetails) <= 0) {
-        BIO_printf(bio_err, "errorDetails absent\n");
+        BIO_puts(bio_err, "errorDetails absent\n");
     } else {
-        BIO_printf(bio_err, "errorDetails: ");
+        BIO_puts(bio_err, "errorDetails: ");
         for (i = 0; i < sk_ASN1_UTF8STRING_num(errorDetails); i++) {
             if (i > 0)
-                BIO_printf(bio_err, ", ");
+                BIO_puts(bio_err, ", ");
             ASN1_STRING_print_ex(bio_err,
                 sk_ASN1_UTF8STRING_value(errorDetails, i),
                 ASN1_STRFLGS_ESC_QUOTE);
         }
-        BIO_printf(bio_err, "\n");
+        BIO_puts(bio_err, "\n");
     }
 }

diff --git a/deps/openssl/openssl/apps/lib/columns.c b/deps/openssl/openssl/apps/lib/columns.c
index 3dd86600e70..86d57dff947 100644
--- a/deps/openssl/openssl/apps/lib/columns.c
+++ b/deps/openssl/openssl/apps/lib/columns.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2019 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -18,7 +18,7 @@ void calculate_columns(FUNCTION *functions, DISPLAY_COLUMNS *dc)

     for (f = functions; f->name != NULL; ++f)
         if (f->type == FT_general || f->type == FT_md || f->type == FT_cipher)
-            if ((len = strlen(f->name)) > maxlen)
+            if ((len = (int)strlen(f->name)) > maxlen)
                 maxlen = len;

     dc->width = maxlen + 2;
diff --git a/deps/openssl/openssl/apps/lib/engine.c b/deps/openssl/openssl/apps/lib/engine.c
deleted file mode 100644
index c486a10513e..00000000000
--- a/deps/openssl/openssl/apps/lib/engine.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * Here is a set of wrappers for the ENGINE API, which are no-ops when the
- * ENGINE API is disabled / removed.
- * We need to suppress deprecation warnings to make this work.
- */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include <string.h> /* strcmp */
-
-#include <openssl/types.h> /* Ensure we have the ENGINE type, regardless */
-#include <openssl/err.h>
-#ifndef OPENSSL_NO_ENGINE
-#include <openssl/engine.h>
-#endif
-#include "apps.h"
-
-#ifndef OPENSSL_NO_ENGINE
-/* Try to load an engine in a shareable library */
-static ENGINE *try_load_engine(const char *engine)
-{
-    ENGINE *e = NULL;
-
-    if ((e = ENGINE_by_id("dynamic")) != NULL) {
-        if (!ENGINE_ctrl_cmd_string(e, "SO_PATH", engine, 0)
-            || !ENGINE_ctrl_cmd_string(e, "LOAD", NULL, 0)) {
-            ENGINE_free(e);
-            e = NULL;
-        }
-    }
-    return e;
-}
-#endif
-
-ENGINE *setup_engine_methods(const char *id, unsigned int methods, int debug)
-{
-    ENGINE *e = NULL;
-
-#ifndef OPENSSL_NO_ENGINE
-    if (id != NULL) {
-        if (strcmp(id, "auto") == 0) {
-            BIO_printf(bio_err, "Enabling auto ENGINE support\n");
-            ENGINE_register_all_complete();
-            return NULL;
-        }
-        if ((e = ENGINE_by_id(id)) == NULL
-            && (e = try_load_engine(id)) == NULL) {
-            BIO_printf(bio_err, "Invalid engine \"%s\"\n", id);
-            ERR_print_errors(bio_err);
-            return NULL;
-        }
-        if (debug)
-            (void)ENGINE_ctrl(e, ENGINE_CTRL_SET_LOGSTREAM, 0, bio_err, 0);
-        if (!ENGINE_ctrl_cmd(e, "SET_USER_INTERFACE", 0,
-                (void *)get_ui_method(), 0, 1)
-            || !ENGINE_set_default(e, methods)) {
-            BIO_printf(bio_err, "Cannot use engine \"%s\"\n", ENGINE_get_id(e));
-            ERR_print_errors(bio_err);
-            ENGINE_free(e);
-            return NULL;
-        }
-
-        BIO_printf(bio_err, "Engine \"%s\" set.\n", ENGINE_get_id(e));
-    }
-#endif
-    return e;
-}
-
-void release_engine(ENGINE *e)
-{
-#ifndef OPENSSL_NO_ENGINE
-    /* Free our "structural" reference. */
-    ENGINE_free(e);
-#endif
-}
-
-int init_engine(ENGINE *e)
-{
-    int rv = 1;
-
-#ifndef OPENSSL_NO_ENGINE
-    rv = ENGINE_init(e);
-#endif
-    return rv;
-}
-
-int finish_engine(ENGINE *e)
-{
-    int rv = 1;
-
-#ifndef OPENSSL_NO_ENGINE
-    rv = ENGINE_finish(e);
-#endif
-    return rv;
-}
-
-char *make_engine_uri(ENGINE *e, const char *key_id, const char *desc)
-{
-    char *new_uri = NULL;
-
-#ifndef OPENSSL_NO_ENGINE
-    if (e == NULL) {
-        BIO_printf(bio_err, "No engine specified for loading %s\n", desc);
-    } else if (key_id == NULL) {
-        BIO_printf(bio_err, "No engine key id specified for loading %s\n", desc);
-    } else {
-        const char *engineid = ENGINE_get_id(e);
-        size_t uri_sz = sizeof(ENGINE_SCHEME_COLON) - 1
-            + strlen(engineid)
-            + 1 /* : */
-            + strlen(key_id)
-            + 1 /* \0 */
-            ;
-
-        new_uri = OPENSSL_malloc(uri_sz);
-        if (new_uri != NULL) {
-            OPENSSL_strlcpy(new_uri, ENGINE_SCHEME_COLON, uri_sz);
-            OPENSSL_strlcat(new_uri, engineid, uri_sz);
-            OPENSSL_strlcat(new_uri, ":", uri_sz);
-            OPENSSL_strlcat(new_uri, key_id, uri_sz);
-        }
-    }
-#else
-    BIO_printf(bio_err, "Engines not supported for loading %s\n", desc);
-#endif
-    return new_uri;
-}
-
-int get_legacy_pkey_id(OSSL_LIB_CTX *libctx, const char *algname, ENGINE *e)
-{
-    const EVP_PKEY_ASN1_METHOD *ameth;
-    ENGINE *tmpeng = NULL;
-    int pkey_id = NID_undef;
-
-    ERR_set_mark();
-    ameth = EVP_PKEY_asn1_find_str(&tmpeng, algname, -1);
-
-#if !defined(OPENSSL_NO_ENGINE)
-    ENGINE_finish(tmpeng);
-
-    if (ameth == NULL && e != NULL)
-        ameth = ENGINE_get_pkey_asn1_meth_str(e, algname, -1);
-    else
-#endif
-        /* We're only interested if it comes from an ENGINE */
-        if (tmpeng == NULL)
-            ameth = NULL;
-
-    ERR_pop_to_mark();
-    if (ameth == NULL)
-        return NID_undef;
-
-    EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, ameth);
-
-    return pkey_id;
-}
-
-const EVP_MD *get_digest_from_engine(const char *name)
-{
-#ifndef OPENSSL_NO_ENGINE
-    ENGINE *eng;
-
-    eng = ENGINE_get_digest_engine(OBJ_sn2nid(name));
-    if (eng != NULL) {
-        ENGINE_finish(eng);
-        return EVP_get_digestbyname(name);
-    }
-#endif
-    return NULL;
-}
-
-const EVP_CIPHER *get_cipher_from_engine(const char *name)
-{
-#ifndef OPENSSL_NO_ENGINE
-    ENGINE *eng;
-
-    eng = ENGINE_get_cipher_engine(OBJ_sn2nid(name));
-    if (eng != NULL) {
-        ENGINE_finish(eng);
-        return EVP_get_cipherbyname(name);
-    }
-#endif
-    return NULL;
-}
diff --git a/deps/openssl/openssl/apps/lib/engine_loader.c b/deps/openssl/openssl/apps/lib/engine_loader.c
deleted file mode 100644
index dd391bafe4f..00000000000
--- a/deps/openssl/openssl/apps/lib/engine_loader.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright 2018-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * Here is an STORE loader for ENGINE backed keys.  It relies on deprecated
- * functions, and therefore need to have deprecation warnings suppressed.
- * This file is not compiled at all in a '--api=3 no-deprecated' configuration.
- */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "internal/e_os.h"
-#include "apps.h"
-
-#ifndef OPENSSL_NO_ENGINE
-
-#include <stdarg.h>
-#include <string.h>
-#include <openssl/engine.h>
-#include <openssl/store.h>
-
-/*
- * Support for legacy private engine keys via the 'org.openssl.engine:' scheme
- *
- * org.openssl.engine:{engineid}:{keyid}
- *
- * Note: we ONLY support ENGINE_load_private_key() and ENGINE_load_public_key()
- * Note 2: This scheme has a precedent in code in PKIX-SSH. for exactly
- * this sort of purpose.
- */
-
-/* Local definition of OSSL_STORE_LOADER_CTX */
-struct ossl_store_loader_ctx_st {
-    ENGINE *e; /* Structural reference */
-    char *keyid;
-    int expected;
-    int loaded; /* 0 = key not loaded yet, 1 = key loaded */
-};
-
-static OSSL_STORE_LOADER_CTX *OSSL_STORE_LOADER_CTX_new(ENGINE *e, char *keyid)
-{
-    OSSL_STORE_LOADER_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
-
-    if (ctx != NULL) {
-        ctx->e = e;
-        ctx->keyid = keyid;
-    }
-    return ctx;
-}
-
-static void OSSL_STORE_LOADER_CTX_free(OSSL_STORE_LOADER_CTX *ctx)
-{
-    if (ctx != NULL) {
-        ENGINE_free(ctx->e);
-        OPENSSL_free(ctx->keyid);
-        OPENSSL_free(ctx);
-    }
-}
-
-static OSSL_STORE_LOADER_CTX *engine_open(const OSSL_STORE_LOADER *loader,
-    const char *uri,
-    const UI_METHOD *ui_method,
-    void *ui_data)
-{
-    const char *p = uri, *q;
-    ENGINE *e = NULL;
-    char *keyid = NULL;
-    OSSL_STORE_LOADER_CTX *ctx = NULL;
-
-    if (!CHECK_AND_SKIP_CASE_PREFIX(p, ENGINE_SCHEME_COLON))
-        return NULL;
-
-    /* Look for engine ID */
-    q = strchr(p, ':');
-    if (q != NULL /* There is both an engine ID and a key ID */
-        && p[0] != ':' /* The engine ID is at least one character */
-        && q[1] != '\0') { /* The key ID is at least one character */
-        char engineid[256];
-        size_t engineid_l = q - p;
-
-        strncpy(engineid, p, engineid_l);
-        engineid[engineid_l] = '\0';
-        e = ENGINE_by_id(engineid);
-
-        keyid = OPENSSL_strdup(q + 1);
-    }
-
-    if (e != NULL && keyid != NULL)
-        ctx = OSSL_STORE_LOADER_CTX_new(e, keyid);
-
-    if (ctx == NULL) {
-        OPENSSL_free(keyid);
-        ENGINE_free(e);
-    }
-
-    return ctx;
-}
-
-static int engine_expect(OSSL_STORE_LOADER_CTX *ctx, int expected)
-{
-    if (expected == 0
-        || expected == OSSL_STORE_INFO_PUBKEY
-        || expected == OSSL_STORE_INFO_PKEY) {
-        ctx->expected = expected;
-        return 1;
-    }
-    return 0;
-}
-
-static OSSL_STORE_INFO *engine_load(OSSL_STORE_LOADER_CTX *ctx,
-    const UI_METHOD *ui_method, void *ui_data)
-{
-    EVP_PKEY *pkey = NULL, *pubkey = NULL;
-    OSSL_STORE_INFO *info = NULL;
-
-    if (ctx->loaded == 0) {
-        if (ENGINE_init(ctx->e)) {
-            if (ctx->expected == 0
-                || ctx->expected == OSSL_STORE_INFO_PKEY)
-                pkey = ENGINE_load_private_key(ctx->e, ctx->keyid,
-                    (UI_METHOD *)ui_method, ui_data);
-            if ((pkey == NULL && ctx->expected == 0)
-                || ctx->expected == OSSL_STORE_INFO_PUBKEY)
-                pubkey = ENGINE_load_public_key(ctx->e, ctx->keyid,
-                    (UI_METHOD *)ui_method, ui_data);
-            ENGINE_finish(ctx->e);
-        }
-    }
-
-    ctx->loaded = 1;
-
-    if (pubkey != NULL)
-        info = OSSL_STORE_INFO_new_PUBKEY(pubkey);
-    else if (pkey != NULL)
-        info = OSSL_STORE_INFO_new_PKEY(pkey);
-    if (info == NULL) {
-        EVP_PKEY_free(pkey);
-        EVP_PKEY_free(pubkey);
-    }
-    return info;
-}
-
-static int engine_eof(OSSL_STORE_LOADER_CTX *ctx)
-{
-    return ctx->loaded != 0;
-}
-
-static int engine_error(OSSL_STORE_LOADER_CTX *ctx)
-{
-    return 0;
-}
-
-static int engine_close(OSSL_STORE_LOADER_CTX *ctx)
-{
-    OSSL_STORE_LOADER_CTX_free(ctx);
-    return 1;
-}
-
-int setup_engine_loader(void)
-{
-    OSSL_STORE_LOADER *loader = NULL;
-
-    if ((loader = OSSL_STORE_LOADER_new(NULL, ENGINE_SCHEME)) == NULL
-        || !OSSL_STORE_LOADER_set_open(loader, engine_open)
-        || !OSSL_STORE_LOADER_set_expect(loader, engine_expect)
-        || !OSSL_STORE_LOADER_set_load(loader, engine_load)
-        || !OSSL_STORE_LOADER_set_eof(loader, engine_eof)
-        || !OSSL_STORE_LOADER_set_error(loader, engine_error)
-        || !OSSL_STORE_LOADER_set_close(loader, engine_close)
-        || !OSSL_STORE_register_loader(loader)) {
-        OSSL_STORE_LOADER_free(loader);
-        loader = NULL;
-    }
-
-    return loader != NULL;
-}
-
-void destroy_engine_loader(void)
-{
-    OSSL_STORE_LOADER *loader = OSSL_STORE_unregister_loader(ENGINE_SCHEME);
-    OSSL_STORE_LOADER_free(loader);
-}
-
-#else /* !OPENSSL_NO_ENGINE */
-
-int setup_engine_loader(void)
-{
-    return 0;
-}
-
-void destroy_engine_loader(void)
-{
-}
-
-#endif
diff --git a/deps/openssl/openssl/apps/lib/http_server.c b/deps/openssl/openssl/apps/lib/http_server.c
index 9b2c45a8645..c4086e3ad45 100644
--- a/deps/openssl/openssl/apps/lib/http_server.c
+++ b/deps/openssl/openssl/apps/lib/http_server.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -18,6 +18,7 @@
 #endif

 #include <ctype.h>
+#include <stdio.h>
 #include "internal/e_os.h"
 #include "http_server.h"
 #include "internal/sockets.h" /* for openssl_fdset() */
@@ -92,7 +93,8 @@ void spawn_loop(const char *prog)
             strerror(errno));
         exit(1);
     }
-    kidpids = app_malloc(n_responders * sizeof(*kidpids), "child PID array");
+    kidpids = app_malloc_array(n_responders, sizeof(*kidpids),
+        "child PID array");
     for (i = 0; i < n_responders; ++i)
         kidpids[i] = 0;

@@ -196,7 +198,7 @@ BIO *http_server_init(const char *prog, const char *port, int verb)
     int port_num;
     char name[40];

-    BIO_snprintf(name, sizeof(name), "*:%s", port); /* port may be "0" */
+    snprintf(name, sizeof(name), "*:%s", port); /* port may be "0" */
     if (verb >= 0 && !log_set_verbosity(prog, verb))
         return NULL;
     bufbio = BIO_new(BIO_f_buffer());
@@ -505,9 +507,9 @@ int http_server_send_asn1_resp(const char *prog, BIO *cbio, int keep_alive,
     const ASN1_ITEM *it, const ASN1_VALUE *resp)
 {
     char buf[200], *p;
-    int ret = BIO_snprintf(buf, sizeof(buf), HTTP_1_0 " 200 OK\r\n%s"
-                                                      "Content-type: %s\r\n"
-                                                      "Content-Length: %d\r\n",
+    int ret = snprintf(buf, sizeof(buf), HTTP_1_0 " 200 OK\r\n%s"
+                                                  "Content-type: %s\r\n"
+                                                  "Content-Length: %d\r\n",
         keep_alive ? "Connection: keep-alive\r\n" : "",
         content_type,
         ASN1_item_i2d(resp, NULL, it));
@@ -531,7 +533,7 @@ int http_server_send_status(const char *prog, BIO *cbio,
     int status, const char *reason)
 {
     char buf[200];
-    int ret = BIO_snprintf(buf, sizeof(buf), HTTP_1_0 " %d %s\r\n\r\n",
+    int ret = snprintf(buf, sizeof(buf), HTTP_1_0 " %d %s\r\n\r\n",
         /* This implicitly cancels keep-alive */
         status, reason);

diff --git a/deps/openssl/openssl/apps/lib/log.c b/deps/openssl/openssl/apps/lib/log.c
index e2a531883b5..63a7655df9a 100644
--- a/deps/openssl/openssl/apps/lib/log.c
+++ b/deps/openssl/openssl/apps/lib/log.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,8 @@
  * https://www.openssl.org/source/license.html
  */

+#include <stdio.h>
+
 #include <openssl/trace.h>
 #include "apps.h"
 #include "log.h"
@@ -46,11 +48,14 @@ static void log_with_prefix(const char *prog, const char *fmt, va_list ap)
     char prefix[80];
     BIO *bio, *pre = BIO_new(BIO_f_prefix());

-    (void)BIO_snprintf(prefix, sizeof(prefix), "%s: ", prog);
+    if (pre == NULL)
+        return;
+
+    (void)snprintf(prefix, sizeof(prefix), "%s: ", prog);
     (void)BIO_set_prefix(pre, prefix);
     bio = BIO_push(pre, bio_err);
     (void)BIO_vprintf(bio, fmt, ap);
-    (void)BIO_printf(bio, "\n");
+    (void)BIO_puts(bio, "\n");
     (void)BIO_flush(bio);
     (void)BIO_pop(pre);
     BIO_free(pre);
@@ -89,7 +94,7 @@ void trace_log_message(int category,
 #else
         (void)BIO_vprintf(out, fmt, ap);
 #endif
-        (void)BIO_printf(out, "\n");
+        (void)BIO_puts(out, "\n");
         OSSL_trace_end(category, out);
     }
     if (verbosity < level) {
diff --git a/deps/openssl/openssl/apps/lib/names.c b/deps/openssl/openssl/apps/lib/names.c
index 24a146819b0..dbce9a1b0c9 100644
--- a/deps/openssl/openssl/apps/lib/names.c
+++ b/deps/openssl/openssl/apps/lib/names.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -33,14 +33,14 @@ void print_names(BIO *out, STACK_OF(OPENSSL_CSTRING) *names)

     sk_OPENSSL_CSTRING_sort(names);
     if (i > 1)
-        BIO_printf(out, "{ ");
+        BIO_puts(out, "{ ");
     for (j = 0; j < i; j++) {
         const char *name = sk_OPENSSL_CSTRING_value(names, j);

         if (j > 0)
-            BIO_printf(out, ", ");
+            BIO_puts(out, ", ");
         BIO_printf(out, "%s", name);
     }
     if (i > 1)
-        BIO_printf(out, " }");
+        BIO_puts(out, " }");
 }
diff --git a/deps/openssl/openssl/apps/lib/opt.c b/deps/openssl/openssl/apps/lib/opt.c
index f9135f4549b..f28eeaa4f0b 100644
--- a/deps/openssl/openssl/apps/lib/opt.c
+++ b/deps/openssl/openssl/apps/lib/opt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,6 +15,7 @@
 #include "app_libctx.h"
 #include "internal/nelem.h"
 #include "internal/numbers.h"
+#include <stdio.h>
 #include <string.h>
 #if !defined(OPENSSL_SYS_MSDOS)
 #include <unistd.h>
@@ -36,7 +37,6 @@ const char OPT_PARAM_STR[] = "-P";

 /* Our state */
 static char **argv;
-static int argc;
 static int opt_index;
 static char *arg;
 static char *flag;
@@ -148,7 +148,7 @@ char *opt_appname(const char *argv0)
     size_t len = strlen(prog);

     if (argv0 != NULL)
-        BIO_snprintf(prog + len, sizeof(prog) - len - 1, " %s", argv0);
+        snprintf(prog + len, sizeof(prog) - len - 1, " %s", argv0);
     return prog;
 }

@@ -161,7 +161,6 @@ char *opt_getprog(void)
 char *opt_init(int ac, char **av, const OPTIONS *o)
 {
     /* Store state. */
-    argc = ac;
     argv = av;
     opt_begin();
     opts = o;
@@ -196,7 +195,6 @@ char *opt_init(int ac, char **av, const OPTIONS *o)
         case '/':
         case '<':
         case '>':
-        case 'E':
         case 'F':
         case 'M':
         case 'U':
@@ -245,7 +243,6 @@ static OPT_PAIR formats[] = {
     { "b64", OPT_FMT_B64 },
     { "pkcs12", OPT_FMT_PKCS12 },
     { "smime", OPT_FMT_SMIME },
-    { "engine", OPT_FMT_ENGINE },
     { "msblob", OPT_FMT_MSBLOB },
     { "nss", OPT_FMT_NSS },
     { "text", OPT_FMT_TEXT },
@@ -324,12 +321,6 @@ int opt_format(const char *s, unsigned long flags, int *result)
             return opt_format_error(s, flags);
         *result = FORMAT_MSBLOB;
         break;
-    case 'E':
-    case 'e':
-        if ((flags & OPT_FMT_ENGINE) == 0)
-            return opt_format_error(s, flags);
-        *result = FORMAT_ENGINE;
-        break;
     case 'H':
     case 'h':
         if ((flags & OPT_FMT_HTTP) == 0)
@@ -383,8 +374,6 @@ static const char *format2str(int format)
         return "SMIME";
     case FORMAT_MSBLOB:
         return "MSBLOB";
-    case FORMAT_ENGINE:
-        return "ENGINE";
     case FORMAT_HTTP:
         return "HTTP";
     case FORMAT_PKCS12:
@@ -411,9 +400,7 @@ int opt_cipher_silent(const char *name, EVP_CIPHER **cipherp)
     ERR_set_mark();
     if ((c = EVP_CIPHER_fetch(app_get0_libctx(), name,
              app_get0_propq()))
-            != NULL
-        || (opt_legacy_okay()
-            && (c = (EVP_CIPHER *)EVP_get_cipherbyname(name)) != NULL)) {
+        != NULL) {
         ERR_pop_to_mark();
         if (cipherp != NULL) {
             EVP_CIPHER_free(*cipherp);
@@ -453,6 +440,8 @@ int opt_cipher(const char *name, EVP_CIPHER **cipherp)
             opt_printf_stderr("%s XTS ciphers not supported\n", prog);
         } else if ((flags & EVP_CIPH_FLAG_AEAD_CIPHER) != 0) {
             opt_printf_stderr("%s: AEAD ciphers not supported\n", prog);
+        } else if ((flags & EVP_CIPH_FLAG_ENC_THEN_MAC) != 0) {
+            opt_printf_stderr("%s: ENC-then-MAC cipher not supported\n", prog);
         } else {
             ret = 1;
             if (cipherp != NULL)
@@ -470,9 +459,7 @@ int opt_md_silent(const char *name, EVP_MD **mdp)
     EVP_MD *md;

     ERR_set_mark();
-    if ((md = EVP_MD_fetch(app_get0_libctx(), name, app_get0_propq())) != NULL
-        || (opt_legacy_okay()
-            && (md = (EVP_MD *)EVP_get_digestbyname(name)) != NULL)) {
+    if ((md = EVP_MD_fetch(app_get0_libctx(), name, app_get0_propq())) != NULL) {
         ERR_pop_to_mark();
         if (mdp != NULL) {
             EVP_MD_free(*mdp);
@@ -700,7 +687,7 @@ int opt_ulong(const char *value, unsigned long *result)
     l = strtoul(value, &endptr, 0);
     if (*endptr
         || endptr == value
-        || ((l == ULONG_MAX) && errno == ERANGE)
+        || (l == ULONG_MAX && errno == ERANGE)
         || (l == 0 && errno != 0)) {
         opt_number_error(value);
         errno = oerrno;
@@ -777,12 +764,12 @@ int opt_verify(int opt, X509_VERIFY_PARAM *vpm)
         X509_VERIFY_PARAM_set1(vpm, vtmp);
         break;
     case OPT_V_VERIFY_DEPTH:
-        i = atoi(opt_arg());
+        i = opt_int_arg();
         if (i >= 0)
             X509_VERIFY_PARAM_set_depth(vpm, i);
         break;
     case OPT_V_VERIFY_AUTH_LEVEL:
-        i = atoi(opt_arg());
+        i = opt_int_arg();
         if (i >= 0)
             X509_VERIFY_PARAM_set_auth_level(vpm, i);
         break;
@@ -1000,14 +987,12 @@ int opt_next(void)
                 return -1;
             break;
         case 'c':
-        case 'E':
         case 'F':
         case 'f':
         case 'A':
         case 'a':
             if (opt_format(arg,
-                    o->valtype == 'c' ? OPT_FMT_PDS : o->valtype == 'E' ? OPT_FMT_PDE
-                        : o->valtype == 'F'                             ? OPT_FMT_PEMDER
+                    o->valtype == 'c' ? OPT_FMT_PDS : o->valtype == 'F' ? OPT_FMT_PEMDER
                         : o->valtype == 'A'                             ? OPT_FMT_ASN1
                                                                         : OPT_FMT_ANY,
                     &ival))
@@ -1124,8 +1109,6 @@ static const char *valtype2param(const OPTIONS *o)
         return "long";
     case 'u':
         return "ulong";
-    case 'E':
-        return "PEM|DER|ENGINE";
     case 'F':
         return "PEM|DER";
     case 'f':
@@ -1216,7 +1199,7 @@ void opt_help(const OPTIONS *list)

         i = 2 + (int)strlen(o->name);
         if (o->valtype != '-')
-            i += 1 + strlen(valtype2param(o));
+            i += 1 + (int)strlen(valtype2param(o));

         if (i > width)
             width = i;
@@ -1252,9 +1235,7 @@ int opt_isdir(const char *name)
     if (len_0 > MAX_PATH)
         return -1;

-#if !defined(_WIN32_WCE) || _WIN32_WCE >= 101
-    if (!MultiByteToWideChar(CP_ACP, 0, name, len_0, tempname, MAX_PATH))
-#endif
+    if (!MultiByteToWideChar(CP_ACP, 0, name, (int)len_0, tempname, MAX_PATH))
         for (i = 0; i < len_0; i++)
             tempname[i] = (WCHAR)name[i];

diff --git a/deps/openssl/openssl/apps/lib/s_cb.c b/deps/openssl/openssl/apps/lib/s_cb.c
index 760ad010988..8c014fca8ca 100644
--- a/deps/openssl/openssl/apps/lib/s_cb.c
+++ b/deps/openssl/openssl/apps/lib/s_cb.c
@@ -47,7 +47,7 @@ static const char *lookup(int val, const STRINT_PAIR *list, const char *def)

 int verify_callback(int ok, X509_STORE_CTX *ctx)
 {
-    X509 *err_cert;
+    const X509 *err_cert;
     int err, depth;

     err_cert = X509_STORE_CTX_get_current_cert(ctx);
@@ -89,23 +89,27 @@ int verify_callback(int ok, X509_STORE_CTX *ctx)
     case X509_V_ERR_CERT_NOT_YET_VALID:
     case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
         if (err_cert != NULL) {
-            BIO_printf(bio_err, "notBefore=");
+            BIO_puts(bio_err, "notBefore=");
             ASN1_TIME_print(bio_err, X509_get0_notBefore(err_cert));
-            BIO_printf(bio_err, "\n");
+            BIO_puts(bio_err, "\n");
         }
         break;
     case X509_V_ERR_CERT_HAS_EXPIRED:
     case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD:
         if (err_cert != NULL) {
-            BIO_printf(bio_err, "notAfter=");
+            BIO_puts(bio_err, "notAfter=");
             ASN1_TIME_print(bio_err, X509_get0_notAfter(err_cert));
-            BIO_printf(bio_err, "\n");
+            BIO_puts(bio_err, "\n");
         }
         break;
     case X509_V_ERR_NO_EXPLICIT_POLICY:
         if (!verify_args.quiet)
             policies_print(ctx);
         break;
+    case X509_V_ERR_OCSP_NO_RESPONSE:
+        if (!verify_args.quiet)
+            BIO_printf(bio_err, "no OCSP response(s) for certificate(s) found.\n");
+        break;
     }
     if (err == X509_V_OK && ok == 2 && !verify_args.quiet)
         policies_print(ctx);
@@ -144,7 +148,7 @@ int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file)
          * context
          */
         if (!SSL_CTX_check_private_key(ctx)) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Private key does not match the certificate public key\n");
             return 0;
         }
@@ -160,13 +164,13 @@ int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key,
     if (cert == NULL)
         return 1;
     if (SSL_CTX_use_certificate(ctx, cert) <= 0) {
-        BIO_printf(bio_err, "error setting certificate\n");
+        BIO_puts(bio_err, "error setting certificate\n");
         ERR_print_errors(bio_err);
         return 0;
     }

     if (SSL_CTX_use_PrivateKey(ctx, key) <= 0) {
-        BIO_printf(bio_err, "error setting private key\n");
+        BIO_puts(bio_err, "error setting private key\n");
         ERR_print_errors(bio_err);
         return 0;
     }
@@ -175,17 +179,17 @@ int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key,
      * Now we know that a key and cert have been set against the SSL context
      */
     if (!SSL_CTX_check_private_key(ctx)) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Private key does not match the certificate public key\n");
         return 0;
     }
     if (chain && !SSL_CTX_set1_chain(ctx, chain)) {
-        BIO_printf(bio_err, "error setting certificate chain\n");
+        BIO_puts(bio_err, "error setting certificate chain\n");
         ERR_print_errors(bio_err);
         return 0;
     }
     if (build_chain && !SSL_CTX_build_cert_chain(ctx, chflags)) {
-        BIO_printf(bio_err, "error building certificate chain\n");
+        BIO_puts(bio_err, "error building certificate chain\n");
         ERR_print_errors(bio_err);
         return 0;
     }
@@ -270,9 +274,9 @@ static int do_print_sigalgs(BIO *out, SSL *s, int shared)

     client = SSL_is_server(s) ? 0 : 1;
     if (shared)
-        nsig = SSL_get_shared_sigalgs(s, 0, NULL, NULL, NULL, NULL, NULL);
+        nsig = SSL_get0_shared_sigalg(s, -1, NULL, NULL);
     else
-        nsig = SSL_get_sigalgs(s, -1, NULL, NULL, NULL, NULL, NULL);
+        nsig = SSL_get0_sigalg(s, -1, NULL, NULL);
     if (nsig == 0)
         return 1;

@@ -283,45 +287,19 @@ static int do_print_sigalgs(BIO *out, SSL *s, int shared)
         BIO_puts(out, "Requested ");
     BIO_puts(out, "Signature Algorithms: ");
     for (i = 0; i < nsig; i++) {
-        int hash_nid, sign_nid;
-        unsigned char rhash, rsign;
-        const char *sstr = NULL;
+        const char *name = NULL;
+        unsigned int codepoint;
+
         if (shared)
-            SSL_get_shared_sigalgs(s, i, &sign_nid, &hash_nid, NULL,
-                &rsign, &rhash);
+            SSL_get0_shared_sigalg(s, i, &codepoint, &name);
         else
-            SSL_get_sigalgs(s, i, &sign_nid, &hash_nid, NULL, &rsign, &rhash);
-        if (i)
+            SSL_get0_sigalg(s, i, &codepoint, &name);
+        if (i > 0)
             BIO_puts(out, ":");
-        switch (rsign | rhash << 8) {
-        case 0x0809:
-            BIO_puts(out, "rsa_pss_pss_sha256");
-            continue;
-        case 0x080a:
-            BIO_puts(out, "rsa_pss_pss_sha384");
-            continue;
-        case 0x080b:
-            BIO_puts(out, "rsa_pss_pss_sha512");
-            continue;
-        case 0x081a:
-            BIO_puts(out, "ecdsa_brainpoolP256r1_sha256");
-            continue;
-        case 0x081b:
-            BIO_puts(out, "ecdsa_brainpoolP384r1_sha384");
-            continue;
-        case 0x081c:
-            BIO_puts(out, "ecdsa_brainpoolP512r1_sha512");
-            continue;
-        }
-        sstr = get_sigtype(sign_nid);
-        if (sstr)
-            BIO_printf(out, "%s", sstr);
+        if (name != NULL)
+            BIO_puts(out, name);
         else
-            BIO_printf(out, "0x%02X", (int)rsign);
-        if (hash_nid != NID_undef)
-            BIO_printf(out, "+%s", OBJ_nid2sn(hash_nid));
-        else if (sstr == NULL)
-            BIO_printf(out, "+0x%02X", (int)rhash);
+            BIO_printf(out, "0x%04X", codepoint);
     }
     BIO_puts(out, "\n");
     return 1;
@@ -387,7 +365,7 @@ int ssl_print_groups(BIO *out, SSL *s, int noshared)
     ngroups = SSL_get1_groups(s, NULL);
     if (ngroups <= 0)
         return 1;
-    groups = app_malloc(ngroups * sizeof(int), "groups to print");
+    groups = app_malloc_array(ngroups, sizeof(*groups), "groups to print");
     SSL_get1_groups(s, groups);

     BIO_puts(out, "Supported groups: ");
@@ -395,7 +373,11 @@ int ssl_print_groups(BIO *out, SSL *s, int noshared)
         if (i)
             BIO_puts(out, ":");
         nid = groups[i];
-        BIO_printf(out, "%s", SSL_group_to_name(s, nid));
+        const char *name = SSL_group_to_name(s, nid);
+        if (name == NULL)
+            BIO_printf(out, "NID %d", nid);
+        else
+            BIO_puts(out, name);
     }
     OPENSSL_free(groups);
     if (noshared) {
@@ -408,7 +390,11 @@ int ssl_print_groups(BIO *out, SSL *s, int noshared)
         if (i)
             BIO_puts(out, ":");
         nid = SSL_get_shared_group(s, i);
-        BIO_printf(out, "%s", SSL_group_to_name(s, nid));
+        const char *name = SSL_group_to_name(s, nid);
+        if (name == NULL)
+            BIO_printf(out, "%d", nid);
+        else
+            BIO_puts(out, name);
     }
     if (ngroups == 0)
         BIO_puts(out, "NONE");
@@ -423,9 +409,15 @@ int ssl_print_tmp_key(BIO *out, SSL *s)
     EVP_PKEY *key;

     if (!SSL_get_peer_tmp_key(s, &key)) {
-        if (SSL_version(s) == TLS1_3_VERSION)
-            BIO_printf(out, "Negotiated TLS1.3 group: %s\n",
-                SSL_group_to_name(s, SSL_get_negotiated_group(s)));
+        if (SSL_version(s) == TLS1_3_VERSION) {
+            int nid = SSL_get_negotiated_group(s);
+            const char *name = SSL_group_to_name(s, nid);
+
+            if (name == NULL)
+                BIO_printf(out, "Negotiated TLS1.3 group NID: %d\n", nid);
+            else
+                BIO_printf(out, "Negotiated TLS1.3 group: %s\n", name);
+        }
         return 1;
     }

@@ -467,7 +459,7 @@ long bio_dump_callback(BIO *bio, int cmd, const char *argp, size_t len,
     int argi, long argl, int ret, size_t *processed)
 {
     BIO *out;
-    BIO_MMSG_CB_ARGS *mmsgargs;
+    const BIO_MMSG_CB_ARGS *mmsgargs;
     size_t i;

     out = (BIO *)BIO_get_callback_arg(bio);
@@ -498,42 +490,44 @@ long bio_dump_callback(BIO *bio, int cmd, const char *argp, size_t len,
         break;

     case (BIO_CB_RECVMMSG | BIO_CB_RETURN):
-        mmsgargs = (BIO_MMSG_CB_ARGS *)argp;
+        mmsgargs = (const BIO_MMSG_CB_ARGS *)argp;
         if (ret > 0) {
             for (i = 0; i < *(mmsgargs->msgs_processed); i++) {
                 BIO_MSG *msg = (BIO_MSG *)((char *)mmsgargs->msg
                     + (i * mmsgargs->stride));

                 BIO_printf(out, "read from %p [%p] (%zu bytes => %zu (0x%zX))\n",
-                    (void *)bio, (void *)msg->data, msg->data_len,
+                    (void *)bio, msg->data, msg->data_len,
                     msg->data_len, msg->data_len);
-                BIO_dump(out, msg->data, msg->data_len);
+                if (msg->data_len <= INT_MAX)
+                    BIO_dump(out, msg->data, (int)msg->data_len);
             }
         } else if (mmsgargs->num_msg > 0) {
             BIO_MSG *msg = mmsgargs->msg;

             BIO_printf(out, "read from %p [%p] (%zu bytes => %d)\n",
-                (void *)bio, (void *)msg->data, msg->data_len, ret);
+                (void *)bio, msg->data, msg->data_len, ret);
         }
         break;

     case (BIO_CB_SENDMMSG | BIO_CB_RETURN):
-        mmsgargs = (BIO_MMSG_CB_ARGS *)argp;
+        mmsgargs = (const BIO_MMSG_CB_ARGS *)argp;
         if (ret > 0) {
             for (i = 0; i < *(mmsgargs->msgs_processed); i++) {
                 BIO_MSG *msg = (BIO_MSG *)((char *)mmsgargs->msg
                     + (i * mmsgargs->stride));

                 BIO_printf(out, "write to %p [%p] (%zu bytes => %zu (0x%zX))\n",
-                    (void *)bio, (void *)msg->data, msg->data_len,
+                    (void *)bio, msg->data, msg->data_len,
                     msg->data_len, msg->data_len);
-                BIO_dump(out, msg->data, msg->data_len);
+                if (msg->data_len <= INT_MAX)
+                    BIO_dump(out, msg->data, (int)msg->data_len);
             }
         } else if (mmsgargs->num_msg > 0) {
             BIO_MSG *msg = mmsgargs->msg;

             BIO_printf(out, "write to %p [%p] (%zu bytes => %d)\n",
-                (void *)bio, (void *)msg->data, msg->data_len, ret);
+                (void *)bio, msg->data, msg->data_len, ret);
         }
         break;

@@ -577,12 +571,13 @@ void apps_ssl_info_callback(const SSL *s, int where, int ret)
 }

 static STRINT_PAIR ssl_versions[] = {
-    { "SSL 3.0", SSL3_VERSION },
     { "TLS 1.0", TLS1_VERSION },
     { "TLS 1.1", TLS1_1_VERSION },
     { "TLS 1.2", TLS1_2_VERSION },
     { "TLS 1.3", TLS1_3_VERSION },
     { "DTLS 1.0", DTLS1_VERSION },
+    { "DTLS 1.2", DTLS1_2_VERSION },
+    { "DTLS 1.3", DTLS1_3_VERSION },
     { "DTLS 1.0 (bad)", DTLS1_BAD_VER },
     { NULL }
 };
@@ -660,12 +655,16 @@ void msg_cb(int write_p, int version, int content_type, const void *buf,
     const char *str_version, *str_content_type = "", *str_details1 = "", *str_details2 = "";
     const unsigned char *bp = buf;

-    if (version == SSL3_VERSION || version == TLS1_VERSION || version == TLS1_1_VERSION || version == TLS1_2_VERSION || version == TLS1_3_VERSION || version == DTLS1_VERSION || version == DTLS1_BAD_VER) {
+    if (version == TLS1_VERSION || version == TLS1_1_VERSION
+        || version == TLS1_2_VERSION || version == TLS1_3_VERSION
+        || version == DTLS1_VERSION || version == DTLS1_2_VERSION
+        || version == DTLS1_3_VERSION || version == DTLS1_BAD_VER) {
         str_version = lookup(version, ssl_versions, "???");
         switch (content_type) {
         case SSL3_RT_CHANGE_CIPHER_SPEC:
             /* type 20 */
-            str_content_type = ", ChangeCipherSpec";
+            if (version != DTLS1_3_VERSION)
+                str_content_type = ", ChangeCipherSpec";
             break;
         case SSL3_RT_ALERT:
             /* type 21 */
@@ -694,6 +693,11 @@ void msg_cb(int write_p, int version, int content_type, const void *buf,
             /* type 23 */
             str_content_type = ", ApplicationData";
             break;
+        case SSL3_RT_ACK:
+            /* type 26 */
+            if (version == DTLS1_3_VERSION)
+                str_content_type = ", ACK";
+            break;
         case SSL3_RT_HEADER:
             /* type 256 */
             str_content_type = ", RecordHeader";
@@ -703,31 +707,35 @@ void msg_cb(int write_p, int version, int content_type, const void *buf,
             str_content_type = ", InnerContent";
             break;
         default:
-            BIO_snprintf(tmpbuf, sizeof(tmpbuf) - 1, ", Unknown (content_type=%d)", content_type);
+            break;
+        }
+
+        if (str_content_type[0] == '\0') {
+            snprintf(tmpbuf, sizeof(tmpbuf) - 1, ", Unknown (content_type=%d)", content_type);
             str_content_type = tmpbuf;
         }
     } else {
-        BIO_snprintf(tmpbuf, sizeof(tmpbuf) - 1, "Not TLS data or unknown version (version=%d, content_type=%d)", version, content_type);
+        snprintf(tmpbuf, sizeof(tmpbuf) - 1, "Not TLS data or unknown version (version=%d, content_type=%d)", version, content_type);
         str_version = tmpbuf;
     }

-    BIO_printf(bio, "%s %s%s [length %04lx]%s%s\n", str_write_p, str_version,
-        str_content_type, (unsigned long)len, str_details1,
+    BIO_printf(bio, "%s %s%s [length %04zx]%s%s\n", str_write_p, str_version,
+        str_content_type, len, str_details1,
         str_details2);

     if (len > 0) {
         size_t num, i;

-        BIO_printf(bio, "   ");
+        BIO_puts(bio, "   ");
         num = len;
         for (i = 0; i < num; i++) {
             if (i % 16 == 0 && i > 0)
-                BIO_printf(bio, "\n   ");
+                BIO_puts(bio, "\n   ");
             BIO_printf(bio, " %02x", ((const unsigned char *)buf)[i]);
         }
         if (i < len)
-            BIO_printf(bio, " ...");
-        BIO_printf(bio, "\n");
+            BIO_puts(bio, " ...");
+        BIO_puts(bio, "\n");
     }
     (void)BIO_flush(bio);
 }
@@ -775,11 +783,15 @@ static const STRINT_PAIR tlsext_types[] = {
     { "certificate authorities", TLSEXT_TYPE_certificate_authorities },
     { "post handshake auth", TLSEXT_TYPE_post_handshake_auth },
     { "early_data", TLSEXT_TYPE_early_data },
+#ifndef OPENSSL_NO_ECH
+    { "encrypted ClientHello (draft-13)", TLSEXT_TYPE_ech },
+    { "outer exts", TLSEXT_TYPE_outer_extensions },
+#endif
     { NULL }
 };

-/* from rfc8446 4.2.3. + gost (https://tools.ietf.org/id/draft-smyshlyaev-tls12-gost-suites-04.html) */
 static STRINT_PAIR signature_tls13_scheme_list[] = {
+    /* RFC 8446 4.2.3 */
     { "rsa_pkcs1_sha1", 0x0201 /* TLSEXT_SIGALG_rsa_pkcs1_sha1 */ },
     { "ecdsa_sha1", 0x0203 /* TLSEXT_SIGALG_ecdsa_sha1 */ },
     /*  {"rsa_pkcs1_sha224",       0x0301    TLSEXT_SIGALG_rsa_pkcs1_sha224}, not in rfc8446 */
@@ -798,9 +810,59 @@ static STRINT_PAIR signature_tls13_scheme_list[] = {
     { "rsa_pss_pss_sha256", 0x0809 /* TLSEXT_SIGALG_rsa_pss_pss_sha256 */ },
     { "rsa_pss_pss_sha384", 0x080a /* TLSEXT_SIGALG_rsa_pss_pss_sha384 */ },
     { "rsa_pss_pss_sha512", 0x080b /* TLSEXT_SIGALG_rsa_pss_pss_sha512 */ },
+
+    /* RFC 8734 */
+    { "ecdsa_brainpoolP256r1tls13_sha256", 0x81a },
+    { "ecdsa_brainpoolP256r1tls13_sha384", 0x81b },
+    { "ecdsa_brainpoolP256r1tls13_sha512", 0x81c },
+
+    /* RFC 8998 */
+    { "sm2sig_sm3", 0x0708 /* TLSEXT_SIGALG_sm2sig_sm3 */ },
+
+    /* RFC 9367 */
+    { "gostr34102012_256a", 0x709 },
+    { "gostr34102012_256b", 0x70a },
+    { "gostr34102012_256c", 0x70b },
+    { "gostr34102012_256d", 0x70c },
+    { "gostr34102012_512a", 0x70d },
+    { "gostr34102012_512b", 0x70e },
+    { "gostr34102012_512c", 0x70f },
+
+    /* RFC 9963 */
+    { "rsa_pkcs1_sha256_legacy", 0x0420 },
+    { "rsa_pkcs1_sha384_legacy", 0x0520 },
+    { "rsa_pkcs1_sha512_legacy", 0x0620 },
+
+    /* IBS (https://datatracker.ietf.org/doc/html/draft-wang-tls-raw-public-key-with-ibc-02) */
+    { "eccsi_sha256", 0x0704 },
+    { "iso_ibs1", 0x0705 },
+    { "iso_ibs2", 0x0706 },
+    { "iso_chinese_ibs", 0x0707 },
+
+    /* ML-DSA (https://datatracker.ietf.org/doc/html/draft-ietf-tls-mldsa-00) */
+    { "mldsa44", 0x0904 },
+    { "mldsa65", 0x0905 },
+    { "mldsa87", 0x0906 },
+
+    /* SLH-DSA (https://datatracker.ietf.org/doc/html/draft-reddy-tls-slhdsa-01) */
+    { "slhdsa_sha2_128s", 0x0911 },
+    { "slhdsa_sha2_128f", 0x0912 },
+    { "slhdsa_sha2_192s", 0x0913 },
+    { "slhdsa_sha2_192f", 0x0914 },
+    { "slhdsa_sha2_256s", 0x0915 },
+    { "slhdsa_sha2_256f", 0x0916 },
+    { "slhdsa_shake_128s", 0x0917 },
+    { "slhdsa_shake_128f", 0x0918 },
+    { "slhdsa_shake_192s", 0x0919 },
+    { "slhdsa_shake_192f", 0x091a },
+    { "slhdsa_shake_256s", 0x091b },
+    { "slhdsa_shake_256f", 0x091c },
+
+    /* GOST (https://tools.ietf.org/id/draft-smyshlyaev-tls12-gost-suites-04.html) */
     { "gostr34102001", 0xeded /* TLSEXT_SIGALG_gostr34102001_gostr3411 */ },
     { "gostr34102012_256", 0xeeee /* TLSEXT_SIGALG_gostr34102012_256_gostr34112012_256 */ },
     { "gostr34102012_512", 0xefef /* TLSEXT_SIGALG_gostr34102012_512_gostr34112012_512 */ },
+
     { NULL }
 };

@@ -850,7 +912,7 @@ int generate_stateless_cookie_callback(SSL *ssl, unsigned char *cookie,
     /* Initialize a random secret */
     if (!cookie_initialized) {
         if (RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH) <= 0) {
-            BIO_printf(bio_err, "error setting random cookie secret\n");
+            BIO_puts(bio_err, "error setting random cookie secret\n");
             return 0;
         }
         cookie_initialized = 1;
@@ -859,7 +921,7 @@ int generate_stateless_cookie_callback(SSL *ssl, unsigned char *cookie,
     if (SSL_is_dtls(ssl)) {
         lpeer = peer = BIO_ADDR_new();
         if (peer == NULL) {
-            BIO_printf(bio_err, "memory full\n");
+            BIO_puts(bio_err, "memory full\n");
             return 0;
         }

@@ -871,7 +933,7 @@ int generate_stateless_cookie_callback(SSL *ssl, unsigned char *cookie,

     /* Create buffer with peer's address and port */
     if (!BIO_ADDR_rawaddress(peer, NULL, &length)) {
-        BIO_printf(bio_err, "Failed getting peer address\n");
+        BIO_puts(bio_err, "Failed getting peer address\n");
         BIO_ADDR_free(lpeer);
         return 0;
     }
@@ -888,7 +950,7 @@ int generate_stateless_cookie_callback(SSL *ssl, unsigned char *cookie,
             cookie_secret, COOKIE_SECRET_LENGTH, buffer, length,
             cookie, DTLS1_COOKIE_LENGTH, cookie_len)
         == NULL) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Error calculating HMAC-SHA1 of buffer with secret\n");
         goto end;
     }
@@ -978,11 +1040,11 @@ static void print_chain_flags(SSL *s, int flags)
         BIO_printf(bio_err, "\t%s: %s\n",
             pp->name,
             (flags & pp->retval) ? "OK" : "NOT OK");
-    BIO_printf(bio_err, "\tSuite B: ");
+    BIO_puts(bio_err, "\tSuite B: ");
     if (SSL_set_cert_flags(s, 0) & SSL_CERT_FLAG_SUITEB_128_LOS)
         BIO_puts(bio_err, flags & CERT_PKEY_SUITEB ? "OK\n" : "NOT OK\n");
     else
-        BIO_printf(bio_err, "not tested\n");
+        BIO_puts(bio_err, "not tested\n");
 }

 /*
@@ -1104,7 +1166,7 @@ int load_excert(SSL_EXCERT **pexc)
     }
     for (; exc; exc = exc->next) {
         if (exc->certfile == NULL) {
-            BIO_printf(bio_err, "Missing filename\n");
+            BIO_puts(bio_err, "Missing filename\n");
             return 0;
         }
         exc->cert = load_cert(exc->certfile, exc->certform,
@@ -1113,10 +1175,10 @@ int load_excert(SSL_EXCERT **pexc)
             return 0;
         if (exc->keyfile != NULL) {
             exc->key = load_key(exc->keyfile, exc->keyform,
-                0, NULL, NULL, "server key");
+                0, NULL, "server key");
         } else {
             exc->key = load_key(exc->certfile, exc->certform,
-                0, NULL, NULL, "server key");
+                0, NULL, "server key");
         }
         if (exc->key == NULL)
             return 0;
@@ -1259,7 +1321,7 @@ void print_verify_detail(SSL *s, BIO *bio)
     if (verify_err == X509_V_OK) {
         const char *peername = SSL_get0_peername(s);

-        BIO_printf(bio, "Verification: OK\n");
+        BIO_puts(bio, "Verification: OK\n");
         if (peername != NULL)
             BIO_printf(bio, "Verified peername: %s\n", peername);
     } else {
@@ -1297,7 +1359,7 @@ void print_verify_detail(SSL *s, BIO *bio)
                                                             : "matched the EE",
                 mdpth);
         else
-            BIO_printf(bio, "matched the peer raw public key\n");
+            BIO_puts(bio, "matched the peer raw public key\n");
         OPENSSL_free(hexdata);
     }
 }
@@ -1308,6 +1370,7 @@ void print_ssl_summary(SSL *s)
     const SSL_CIPHER *c;
     X509 *peer = SSL_get0_peer_certificate(s);
     EVP_PKEY *peer_rpk = SSL_get0_peer_rpk(s);
+    const char *local_sigalg = NULL;
     int nid;

     BIO_printf(bio_err, "Protocol version: %s\n", SSL_get_version(s));
@@ -1315,6 +1378,9 @@ void print_ssl_summary(SSL *s)
     c = SSL_get_current_cipher(s);
     BIO_printf(bio_err, "Ciphersuite: %s\n", SSL_CIPHER_get_name(c));
     do_print_sigalgs(bio_err, s, 0);
+    if (SSL_get0_signature_name(s, &local_sigalg) > 0
+        && local_sigalg != NULL)
+        BIO_printf(bio_err, "Own signature type: %s\n", local_sigalg);
     if (peer != NULL) {
         BIO_puts(bio_err, "Peer certificate: ");
         X509_NAME_print_ex(bio_err, X509_get_subject_name(peer),
@@ -1326,7 +1392,7 @@ void print_ssl_summary(SSL *s)
             BIO_printf(bio_err, "Signature type: %s\n", sigalg);
         print_verify_detail(s, bio_err);
     } else if (peer_rpk != NULL) {
-        BIO_printf(bio_err, "Peer used raw public key\n");
+        BIO_puts(bio_err, "Peer used raw public key\n");
         if (SSL_get0_peer_signature_name(s, &sigalg))
             BIO_printf(bio_err, "Signature type: %s\n", sigalg);
         print_verify_detail(s, bio_err);
@@ -1404,12 +1470,18 @@ int ssl_load_stores(SSL_CTX *ctx,
         vfy = X509_STORE_new();
         if (vfy == NULL)
             goto err;
-        if (vfyCAfile != NULL && !X509_STORE_load_file(vfy, vfyCAfile))
+        if (vfyCAfile != NULL && !X509_STORE_load_file(vfy, vfyCAfile)) {
+            BIO_printf(bio_err, "Error loading trusted peer verification cert file %s\n", vfyCAfile);
             goto err;
-        if (vfyCApath != NULL && !X509_STORE_load_path(vfy, vfyCApath))
+        }
+        if (vfyCApath != NULL && !X509_STORE_load_path(vfy, vfyCApath)) {
+            BIO_printf(bio_err, "Error adding trusted peer verification certs directory %s\n", vfyCApath);
             goto err;
-        if (vfyCAstore != NULL && !X509_STORE_load_store(vfy, vfyCAstore))
+        }
+        if (vfyCAstore != NULL && !X509_STORE_load_store(vfy, vfyCAstore)) {
+            BIO_printf(bio_err, "Error adding trusted peer verification cert store file %s\n", vfyCAstore);
             goto err;
+        }
         add_crls_store(vfy, crls);
         if (SSL_CTX_set1_verify_cert_store(ctx, vfy) == 0)
             goto err;
@@ -1420,12 +1492,18 @@ int ssl_load_stores(SSL_CTX *ctx,
         ch = X509_STORE_new();
         if (ch == NULL)
             goto err;
-        if (chCAfile != NULL && !X509_STORE_load_file(ch, chCAfile))
+        if (chCAfile != NULL && !X509_STORE_load_file(ch, chCAfile)) {
+            BIO_printf(bio_err, "Error loading trusted chain building cert file %s\n", chCAfile);
             goto err;
-        if (chCApath != NULL && !X509_STORE_load_path(ch, chCApath))
+        }
+        if (chCApath != NULL && !X509_STORE_load_path(ch, chCApath)) {
+            BIO_printf(bio_err, "Error adddng trusted chain building cert directory %s\n", chCApath);
             goto err;
-        if (chCAstore != NULL && !X509_STORE_load_store(ch, chCAstore))
+        }
+        if (chCAstore != NULL && !X509_STORE_load_store(ch, chCAstore)) {
+            BIO_printf(bio_err, "Error adddng trusted chain building cert store file %s\n", chCAstore);
             goto err;
+        }
         if (SSL_CTX_set1_chain_cert_store(ctx, ch) == 0)
             goto err;
     }
@@ -1533,12 +1611,9 @@ static int security_callback_debug(const SSL *s, const SSL_CTX *ctx,
             if (pkey == NULL) {
                 BIO_printf(sdb->out, "Public key missing");
             } else {
-                const char *algname = "";
-
-                EVP_PKEY_asn1_get0_info(NULL, NULL, NULL, NULL,
-                    &algname, EVP_PKEY_get0_asn1(pkey));
                 BIO_printf(sdb->out, "%s, bits=%d",
-                    algname, EVP_PKEY_get_bits(pkey));
+                    EVP_PKEY_get0_type_name(pkey),
+                    EVP_PKEY_get_bits(pkey));
             }
         }
         break;
@@ -1591,7 +1666,7 @@ void ssl_ctx_security_debug(SSL_CTX *ctx, int verbose)
 static void keylog_callback(const SSL *ssl, const char *line)
 {
     if (bio_keylog == NULL) {
-        BIO_printf(bio_err, "Keylog callback is invoked without valid file!\n");
+        BIO_puts(bio_err, "Keylog callback is invoked without valid file!\n");
         return;
     }

@@ -1660,7 +1735,7 @@ void ssl_print_secure_renegotiation_notes(BIO *bio, SSL *s)
         BIO_printf(bio, "Secure Renegotiation IS%s supported\n",
             SSL_get_secure_renegotiation_support(s) ? "" : " NOT");
     } else {
-        BIO_printf(bio, "This TLS version forbids renegotiation.\n");
+        BIO_puts(bio, "This TLS version forbids renegotiation.\n");
     }
 }

diff --git a/deps/openssl/openssl/apps/lib/s_socket.c b/deps/openssl/openssl/apps/lib/s_socket.c
index 6f9cf23f5e5..cfddd269072 100644
--- a/deps/openssl/openssl/apps/lib/s_socket.c
+++ b/deps/openssl/openssl/apps/lib/s_socket.c
@@ -75,7 +75,7 @@ BIO_ADDR *ourpeer = NULL;
 int init_client(int *sock, const char *host, const char *port,
     const char *bindhost, const char *bindport,
     int family, int type, int protocol, int tfo, int doconn,
-    BIO_ADDR **ba_ret)
+    BIO_ADDR **ba_ret, int c_quiet)
 {
     BIO_ADDRINFO *res = NULL;
     BIO_ADDRINFO *bindaddr = NULL;
@@ -139,7 +139,7 @@ int init_client(int *sock, const char *host, const char *port,
                     BIO_SOCK_REUSEADDR)) {
                 BIO_closesocket(*sock);
                 *sock = INVALID_SOCKET;
-                break;
+                continue;
             }
         }

@@ -176,7 +176,7 @@ int init_client(int *sock, const char *host, const char *port,
         /* Save the address */
         if (tfo || !doconn) {
             if (ba_ret == NULL) {
-                BIO_printf(bio_err, "Internal error\n");
+                BIO_puts(bio_err, "Internal error\n");
                 BIO_closesocket(*sock);
                 *sock = INVALID_SOCKET;
                 goto out;
@@ -208,10 +208,12 @@ int init_client(int *sock, const char *host, const char *port,
     } else {
         char *hostname = NULL;

-        hostname = BIO_ADDR_hostname_string(BIO_ADDRINFO_address(ai), 1);
-        if (hostname != NULL) {
-            BIO_printf(bio_err, "Connecting to %s\n", hostname);
-            OPENSSL_free(hostname);
+        if (!c_quiet) {
+            hostname = BIO_ADDR_hostname_string(BIO_ADDRINFO_address(ai), 1);
+            if (hostname != NULL) {
+                BIO_printf(bio_err, "Connecting to %s\n", hostname);
+                OPENSSL_free(hostname);
+            }
         }
         /* Remove any stale errors from previous connection attempts */
         ERR_clear_error();
@@ -248,7 +250,7 @@ int report_server_accept(BIO *out, int asock, int with_address, int with_pid)
 {
     int success = 1;

-    if (BIO_printf(out, "ACCEPT") <= 0)
+    if (BIO_puts(out, "ACCEPT") <= 0)
         return 0;
     if (with_address) {
         char *hostname, *service;
@@ -263,13 +265,13 @@ int report_server_accept(BIO *out, int asock, int with_address, int with_pid)
                           hostname, service)
                 > 0;
         else
-            (void)BIO_printf(out, "unknown:error\n");
+            (void)BIO_puts(out, "unknown:error\n");
         OPENSSL_free(hostname);
         OPENSSL_free(service);
     }
     if (with_pid)
         success *= BIO_printf(out, " PID=%d", getpid()) > 0;
-    success *= BIO_printf(out, "\n") > 0;
+    success *= BIO_puts(out, "\n") > 0;
     (void)BIO_flush(out);

     return success;
diff --git a/deps/openssl/openssl/apps/lib/tlssrp_depr.c b/deps/openssl/openssl/apps/lib/tlssrp_depr.c
index 058f47b90f1..eb9f3a18145 100644
--- a/deps/openssl/openssl/apps/lib/tlssrp_depr.c
+++ b/deps/openssl/openssl/apps/lib/tlssrp_depr.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2005 Nokia. All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -65,12 +65,12 @@ static int ssl_srp_verify_param_cb(SSL *s, void *arg)
     if (((N = SSL_get_srp_N(s)) == NULL) || ((g = SSL_get_srp_g(s)) == NULL))
         return 0;
     if (srp_arg->debug || srp_arg->msg || srp_arg->amp == 1) {
-        BIO_printf(bio_err, "SRP parameters:\n");
-        BIO_printf(bio_err, "\tN=");
+        BIO_puts(bio_err, "SRP parameters:\n"
+                          "\tN=");
         BN_print(bio_err, N);
-        BIO_printf(bio_err, "\n\tg=");
+        BIO_puts(bio_err, "\n\tg=");
         BN_print(bio_err, g);
-        BIO_printf(bio_err, "\n");
+        BIO_puts(bio_err, "\n");
     }

     if (SRP_check_known_gN_param(g, N))
@@ -78,7 +78,7 @@ static int ssl_srp_verify_param_cb(SSL *s, void *arg)

     if (srp_arg->amp == 1) {
         if (srp_arg->debug)
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "SRP param N and g are not known params, going to check deeper.\n");

         /*
@@ -89,7 +89,7 @@ static int ssl_srp_verify_param_cb(SSL *s, void *arg)
         if (BN_num_bits(g) <= BN_BITS && srp_Verify_N_and_g(N, g))
             return 1;
     }
-    BIO_printf(bio_err, "SRP param N and g rejected.\n");
+    BIO_puts(bio_err, "SRP param N and g rejected.\n");
     return 0;
 }

@@ -105,7 +105,7 @@ static char *ssl_give_srp_client_pwd_cb(SSL *s, void *arg)
     cb_tmp.password = (char *)srp_arg->srppassin;
     cb_tmp.prompt_info = "SRP user";
     if ((l = password_callback(pass, PWD_STRLEN, 0, &cb_tmp)) < 0) {
-        BIO_printf(bio_err, "Can't read Password\n");
+        BIO_puts(bio_err, "Can't read Password\n");
         OPENSSL_free(pass);
         return NULL;
     }
@@ -118,7 +118,7 @@ int set_up_srp_arg(SSL_CTX *ctx, SRP_ARG *srp_arg, int srp_lateuser, int c_msg,
     int c_debug)
 {
     if (!srp_lateuser && !SSL_CTX_set_srp_username(ctx, srp_arg->srplogin)) {
-        BIO_printf(bio_err, "Unable to set SRP username\n");
+        BIO_puts(bio_err, "Unable to set SRP username\n");
         return 0;
     }
     srp_arg->msg = c_msg;
@@ -194,7 +194,7 @@ int set_up_srp_verifier_file(SSL_CTX *ctx, srpsrvparm *srp_callback_parm,
     srp_callback_parm->login = NULL;

     if (srp_callback_parm->vb == NULL) {
-        BIO_printf(bio_err, "Failed to initialize SRP verifier file\n");
+        BIO_puts(bio_err, "Failed to initialize SRP verifier file\n");
         return 0;
     }
     if ((ret = SRP_VBASE_init(srp_callback_parm->vb,
@@ -203,6 +203,8 @@ int set_up_srp_verifier_file(SSL_CTX *ctx, srpsrvparm *srp_callback_parm,
         BIO_printf(bio_err,
             "Cannot initialize SRP verifier file \"%s\":ret=%d\n",
             srp_verifier_file, ret);
+        SRP_VBASE_free(srp_callback_parm->vb);
+        srp_callback_parm->vb = NULL;
         return 0;
     }
     SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, verify_callback);
@@ -222,5 +224,13 @@ void lookup_srp_user(srpsrvparm *srp_callback_parm, BIO *bio_s_out)
         BIO_printf(bio_s_out, "LOOKUP done %s\n",
             srp_callback_parm->user->info);
     else
-        BIO_printf(bio_s_out, "LOOKUP not successful\n");
+        BIO_puts(bio_s_out, "LOOKUP not successful\n");
+}
+
+void cleanup_srp(srpsrvparm *srp_callback_parm)
+{
+    SRP_user_pwd_free(srp_callback_parm->user);
+    srp_callback_parm->user = NULL;
+    SRP_VBASE_free(srp_callback_parm->vb);
+    srp_callback_parm->vb = NULL;
 }
diff --git a/deps/openssl/openssl/apps/lib/vms_decc_argv.c b/deps/openssl/openssl/apps/lib/vms_decc_argv.c
index 5976bcc9e4e..a3963a0c76d 100644
--- a/deps/openssl/openssl/apps/lib/vms_decc_argv.c
+++ b/deps/openssl/openssl/apps/lib/vms_decc_argv.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -56,7 +56,7 @@ char **copy_argv(int *argc, char *argv[])
      * get them when linking with all of libapps.a.
      * See comment in test/build.info.
      */
-    newargv = OPENSSL_malloc(sizeof(*newargv) * (count + 1));
+    newargv = OPENSSL_malloc_array(count + 1, sizeof(*newargv));
     if (newargv == NULL)
         return NULL;

diff --git a/deps/openssl/openssl/apps/lib/vms_term_sock.c b/deps/openssl/openssl/apps/lib/vms_term_sock.c
index 15bc6665694..b73393c80b6 100644
--- a/deps/openssl/openssl/apps/lib/vms_term_sock.c
+++ b/deps/openssl/openssl/apps/lib/vms_term_sock.c
@@ -368,7 +368,7 @@ static int CreateSocketPair(int SocketFamily,
     /*
     ** Get the binary (64-bit) time of the specified timeout value
     */
-    BIO_snprintf(AscTimeBuff, sizeof(AscTimeBuff), "0 0:0:%02d.00", SOCKET_PAIR_TIMEOUT_VALUE);
+    snprintf(AscTimeBuff, sizeof(AscTimeBuff), "0 0:0:%02d.00", SOCKET_PAIR_TIMEOUT_VALUE);
     AscTimeDesc.dsc$w_length = strlen(AscTimeBuff);
     AscTimeDesc.dsc$a_pointer = AscTimeBuff;
     status = sys$bintim(&AscTimeDesc, BinTimeBuff);
@@ -497,7 +497,7 @@ static int CreateSocketPair(int SocketFamily,
     SocketPair[0] = SockDesc2;
     SocketPair[1] = socket_fd(TcpDeviceChan);

-    return (0);
+    return 0;
 }

 /*----------------------------------------------------------------------------*/
@@ -579,7 +579,7 @@ static void LogMessage(char *msg, ...)
     /*
     ** Format the message buffer
     */
-    BIO_snprintf(MsgBuff, sizeof(MsgBuff), "%02d-%s-%04d %02d:%02d:%02d [%08X] %s\n",
+    snprintf(MsgBuff, sizeof(MsgBuff), "%02d-%s-%04d %02d:%02d:%02d [%08X] %s\n",
         LocTime->tm_mday, Month[LocTime->tm_mon],
         (LocTime->tm_year + 1900), LocTime->tm_hour, LocTime->tm_min,
         LocTime->tm_sec, pid, msg);
diff --git a/deps/openssl/openssl/apps/lib/win32_init.c b/deps/openssl/openssl/apps/lib/win32_init.c
index 0ea2048283c..37a1f3ec229 100644
--- a/deps/openssl/openssl/apps/lib/win32_init.c
+++ b/deps/openssl/openssl/apps/lib/win32_init.c
@@ -10,6 +10,7 @@
 #include <windows.h>
 #include <stdlib.h>
 #include <string.h>
+#include "platform.h"

 #if defined(CP_UTF8)

@@ -158,9 +159,9 @@ void win32_utf8argv(int *argc, char **argv[])
     /*
      * make a copy of the command line, since we might have to modify it...
      */
-    wlen = wcslen(wcmdline);
+    wlen = (int)wcslen(wcmdline);
     p = _alloca((wlen + 1) * sizeof(WCHAR));
-    wcscpy(p, wcmdline);
+    memcpy(p, wcmdline, (wlen + 1) * sizeof(WCHAR));

     while (*p != L'\0') {
         int in_quote = 0;
@@ -204,14 +205,12 @@ void win32_utf8argv(int *argc, char **argv[])
                  */
                 {
                     const WCHAR *q = p;
-                    int i;
+                    size_t i;

                     while (*p == L'\\')
                         p++;

                     if (*p == L'"') {
-                        int i;
-
                         for (i = (p - q) / 2; i > 0; i--)
                             *wend++ = L'\\';

@@ -247,7 +246,7 @@ void win32_utf8argv(int *argc, char **argv[])
             }
         }

-        wlen = wend - warg;
+        wlen = (int)(wend - warg);

         if (wlen == 0 || !process_glob(warg, wlen)) {
             if (!validate_argv(newargc + 1)) {
diff --git a/deps/openssl/openssl/apps/list.c b/deps/openssl/openssl/apps/list.c
index faf92306052..a9a55fadee5 100644
--- a/deps/openssl/openssl/apps/list.c
+++ b/deps/openssl/openssl/apps/list.c
@@ -8,6 +8,8 @@
  */

 /* We need to use some deprecated APIs */
+#include "internal/nelem.h"
+#include "openssl/bio.h"
 #define OPENSSL_SUPPRESS_DEPRECATED

 #include "internal/e_os.h"
@@ -31,6 +33,7 @@
 #include "progs.h"
 #include "opt.h"
 #include "names.h"
+#include "configuration.h"

 static int verbose = 0;
 static const char *select_name = NULL;
@@ -52,6 +55,21 @@ static const char *select_name = NULL;
         TYPE##_free(impl);                            \
         return 1;                                     \
     }
+
+#define OPENSSL_HAS_DISABLED(name) (OSSL_NELEM(openssl_disabled_##name) > 1)
+
+#define OPENSSL_PRINT_DISABLED(bio, name, str)                                 \
+    do {                                                                       \
+        if (OPENSSL_HAS_DISABLED(name)) {                                      \
+            BIO_puts((bio), "Disabled " str "(s):\n");                         \
+            for (size_t i = 1; i < OSSL_NELEM(openssl_disabled_##name); i++) { \
+                BIO_printf((bio), "\t- %s\n", openssl_disabled_##name[i]);     \
+            }                                                                  \
+        } else {                                                               \
+            BIO_puts((bio), "No disabled " str "s.\n");                        \
+        }                                                                      \
+    } while (0);
+
 IS_FETCHABLE(cipher, EVP_CIPHER)
 IS_FETCHABLE(digest, EVP_MD)
 IS_FETCHABLE(mac, EVP_MAC)
@@ -115,7 +133,7 @@ static void list_ciphers(const char *prefix)
     int i;

     if (ciphers == NULL) {
-        BIO_printf(bio_err, "ERROR: Memory allocation\n");
+        BIO_puts(bio_err, "ERROR: Memory allocation\n");
         return;
     }
 #ifndef OPENSSL_NO_DEPRECATED_3_0
@@ -137,7 +155,7 @@ static void list_ciphers(const char *prefix)

         names = sk_OPENSSL_CSTRING_new(name_cmp);
         if (names != NULL && EVP_CIPHER_names_do_all(c, collect_names, names)) {
-            BIO_printf(bio_out, "  ");
+            BIO_puts(bio_out, "  ");
             print_names(bio_out, names);

             BIO_printf(bio_out, " @ %s\n",
@@ -200,7 +218,7 @@ static void list_digests(const char *prefix)
     int i;

     if (digests == NULL) {
-        BIO_printf(bio_err, "ERROR: Memory allocation\n");
+        BIO_puts(bio_err, "ERROR: Memory allocation\n");
         return;
     }
 #ifndef OPENSSL_NO_DEPRECATED_3_0
@@ -222,7 +240,7 @@ static void list_digests(const char *prefix)

         names = sk_OPENSSL_CSTRING_new(name_cmp);
         if (names != NULL && EVP_MD_names_do_all(m, collect_names, names)) {
-            BIO_printf(bio_out, "  ");
+            BIO_puts(bio_out, "  ");
             print_names(bio_out, names);

             BIO_printf(bio_out, " @ %s\n",
@@ -268,10 +286,10 @@ static void list_macs(void)
     int i;

     if (macs == NULL) {
-        BIO_printf(bio_err, "ERROR: Memory allocation\n");
+        BIO_puts(bio_err, "ERROR: Memory allocation\n");
         return;
     }
-    BIO_printf(bio_out, "Provided MACs:\n");
+    BIO_puts(bio_out, "Provided MACs:\n");
     EVP_MAC_do_all_provided(app_get0_libctx(), collect_macs, macs);
     sk_EVP_MAC_sort(macs);
     for (i = 0; i < sk_EVP_MAC_num(macs); i++) {
@@ -283,7 +301,7 @@ static void list_macs(void)

         names = sk_OPENSSL_CSTRING_new(name_cmp);
         if (names != NULL && EVP_MAC_names_do_all(m, collect_names, names)) {
-            BIO_printf(bio_out, "  ");
+            BIO_puts(bio_out, "  ");
             print_names(bio_out, names);

             BIO_printf(bio_out, " @ %s\n",
@@ -333,10 +351,10 @@ static void list_kdfs(void)
     int i;

     if (kdfs == NULL) {
-        BIO_printf(bio_err, "ERROR: Memory allocation\n");
+        BIO_puts(bio_err, "ERROR: Memory allocation\n");
         return;
     }
-    BIO_printf(bio_out, "Provided KDFs and PDFs:\n");
+    BIO_puts(bio_out, "Provided KDFs and PDFs:\n");
     EVP_KDF_do_all_provided(app_get0_libctx(), collect_kdfs, kdfs);
     sk_EVP_KDF_sort(kdfs);
     for (i = 0; i < sk_EVP_KDF_num(kdfs); i++) {
@@ -348,7 +366,7 @@ static void list_kdfs(void)

         names = sk_OPENSSL_CSTRING_new(name_cmp);
         if (names != NULL && EVP_KDF_names_do_all(k, collect_names, names)) {
-            BIO_printf(bio_out, "  ");
+            BIO_puts(bio_out, "  ");
             print_names(bio_out, names);

             BIO_printf(bio_out, " @ %s\n",
@@ -404,10 +422,10 @@ static void list_random_generators(void)
     int i;

     if (rands == NULL) {
-        BIO_printf(bio_err, "ERROR: Memory allocation\n");
+        BIO_puts(bio_err, "ERROR: Memory allocation\n");
         return;
     }
-    BIO_printf(bio_out, "Provided RNGs and seed sources:\n");
+    BIO_puts(bio_out, "Provided RNGs and seed sources:\n");
     EVP_RAND_do_all_provided(app_get0_libctx(), collect_rands, rands);
     sk_EVP_RAND_sort(rands);
     for (i = 0; i < sk_EVP_RAND_num(rands); i++) {
@@ -416,8 +434,7 @@ static void list_random_generators(void)
         if (select_name != NULL
             && OPENSSL_strcasecmp(EVP_RAND_get0_name(m), select_name) != 0)
             continue;
-        BIO_printf(bio_out, "  %s", EVP_RAND_get0_name(m));
-        BIO_printf(bio_out, " @ %s\n",
+        BIO_printf(bio_out, "  %s @ %s\n", EVP_RAND_get0_name(m),
             OSSL_PROVIDER_get0_name(EVP_RAND_get0_provider(m)));

         if (verbose) {
@@ -449,8 +466,7 @@ static void display_random(const char *name, EVP_RAND_CTX *drbg)
     if (drbg != NULL) {
         rand = EVP_RAND_CTX_get0_rand(drbg);

-        BIO_printf(bio_out, "  %s", EVP_RAND_get0_name(rand));
-        BIO_printf(bio_out, " @ %s\n",
+        BIO_printf(bio_out, "  %s @ %s\n", EVP_RAND_get0_name(rand),
             OSSL_PROVIDER_get0_name(EVP_RAND_get0_provider(rand)));

         switch (EVP_RAND_get_state(drbg)) {
@@ -532,10 +548,10 @@ static void list_encoders(void)

     encoders = sk_OSSL_ENCODER_new(encoder_cmp);
     if (encoders == NULL) {
-        BIO_printf(bio_err, "ERROR: Memory allocation\n");
+        BIO_puts(bio_err, "ERROR: Memory allocation\n");
         return;
     }
-    BIO_printf(bio_out, "Provided ENCODERs:\n");
+    BIO_puts(bio_out, "Provided ENCODERs:\n");
     OSSL_ENCODER_do_all_provided(app_get0_libctx(), collect_encoders,
         encoders);
     sk_OSSL_ENCODER_sort(encoders);
@@ -549,7 +565,7 @@ static void list_encoders(void)

         names = sk_OPENSSL_CSTRING_new(name_cmp);
         if (names != NULL && OSSL_ENCODER_names_do_all(k, collect_names, names)) {
-            BIO_printf(bio_out, "  ");
+            BIO_puts(bio_out, "  ");
             print_names(bio_out, names);

             BIO_printf(bio_out, " @ %s (%s)\n",
@@ -598,10 +614,10 @@ static void list_decoders(void)

     decoders = sk_OSSL_DECODER_new(decoder_cmp);
     if (decoders == NULL) {
-        BIO_printf(bio_err, "ERROR: Memory allocation\n");
+        BIO_puts(bio_err, "ERROR: Memory allocation\n");
         return;
     }
-    BIO_printf(bio_out, "Provided DECODERs:\n");
+    BIO_puts(bio_out, "Provided DECODERs:\n");
     OSSL_DECODER_do_all_provided(app_get0_libctx(), collect_decoders,
         decoders);
     sk_OSSL_DECODER_sort(decoders);
@@ -615,7 +631,7 @@ static void list_decoders(void)

         names = sk_OPENSSL_CSTRING_new(name_cmp);
         if (names != NULL && OSSL_DECODER_names_do_all(k, collect_names, names)) {
-            BIO_printf(bio_out, "  ");
+            BIO_puts(bio_out, "  ");
             print_names(bio_out, names);

             BIO_printf(bio_out, " @ %s (%s)\n",
@@ -674,14 +690,14 @@ static void list_keymanagers(void)
         if (names != NULL && EVP_KEYMGMT_names_do_all(k, collect_names, names)) {
             const char *desc = EVP_KEYMGMT_get0_description(k);

-            BIO_printf(bio_out, "  Name: ");
+            BIO_puts(bio_out, "  Name: ");
             if (desc != NULL)
-                BIO_printf(bio_out, "%s", desc);
+                BIO_puts(bio_out, desc);
             else
-                BIO_printf(bio_out, "%s", sk_OPENSSL_CSTRING_value(names, 0));
-            BIO_printf(bio_out, "\n");
-            BIO_printf(bio_out, "    Type: Provider Algorithm\n");
-            BIO_printf(bio_out, "    IDs: ");
+                BIO_puts(bio_out, sk_OPENSSL_CSTRING_value(names, 0));
+            BIO_puts(bio_out, "\n"
+                              "    Type: Provider Algorithm\n"
+                              "    IDs: ");
             print_names(bio_out, names);
             BIO_printf(bio_out, " @ %s\n",
                 OSSL_PROVIDER_get0_name(EVP_KEYMGMT_get0_provider(k)));
@@ -737,14 +753,14 @@ static void list_skeymanagers(void)
         if (names != NULL && EVP_SKEYMGMT_names_do_all(k, collect_names, names)) {
             const char *desc = EVP_SKEYMGMT_get0_description(k);

-            BIO_printf(bio_out, "  Name: ");
+            BIO_puts(bio_out, "  Name: ");
             if (desc != NULL)
-                BIO_printf(bio_out, "%s", desc);
+                BIO_puts(bio_out, desc);
             else
-                BIO_printf(bio_out, "%s", sk_OPENSSL_CSTRING_value(names, 0));
-            BIO_printf(bio_out, "\n");
-            BIO_printf(bio_out, "    Type: Provider Algorithm\n");
-            BIO_printf(bio_out, "    IDs: ");
+                BIO_puts(bio_out, sk_OPENSSL_CSTRING_value(names, 0));
+            BIO_puts(bio_out, "\n");
+            BIO_puts(bio_out, "    Type: Provider Algorithm\n");
+            BIO_puts(bio_out, "    IDs: ");
             print_names(bio_out, names);
             BIO_printf(bio_out, " @ %s\n",
                 OSSL_PROVIDER_get0_name(EVP_SKEYMGMT_get0_provider(k)));
@@ -791,7 +807,7 @@ static void list_signatures(void)
         names = sk_OPENSSL_CSTRING_new(name_cmp);
         if (names != NULL && EVP_SIGNATURE_names_do_all(k, collect_names, names)) {
             count++;
-            BIO_printf(bio_out, "  ");
+            BIO_puts(bio_out, "  ");
             print_names(bio_out, names);

             BIO_printf(bio_out, " @ %s\n",
@@ -812,7 +828,7 @@ static void list_signatures(void)
     }
     sk_EVP_SIGNATURE_pop_free(sig_stack, EVP_SIGNATURE_free);
     if (count == 0)
-        BIO_printf(bio_out, " -\n");
+        BIO_puts(bio_out, " -\n");
 }

 static int list_provider_tls_sigalgs(const OSSL_PARAM params[], void *data)
@@ -823,8 +839,8 @@ static int list_provider_tls_sigalgs(const OSSL_PARAM params[], void *data)
     p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_IANA_NAME);
     if (p != NULL && p->data_type == OSSL_PARAM_UTF8_STRING) {
         if (*((int *)data) > 0)
-            BIO_printf(bio_out, ":");
-        BIO_printf(bio_out, "%s", (char *)(p->data));
+            BIO_puts(bio_out, ":");
+        BIO_puts(bio_out, (p->data != NULL) ? (char *)(p->data) : "(null)");
         /* mark presence of a provider-based sigalg */
         *((int *)data) = 2;
     }
@@ -846,23 +862,23 @@ static void list_tls_groups(int version, int all)
 {
     SSL_CTX *ctx = NULL;
     STACK_OF(OPENSSL_CSTRING) *groups;
-    size_t i, num;
+    int i, num;

     if ((groups = sk_OPENSSL_CSTRING_new_null()) == NULL) {
-        BIO_printf(bio_err, "ERROR: Memory allocation\n");
+        BIO_puts(bio_err, "ERROR: Memory allocation\n");
         return;
     }
     if ((ctx = SSL_CTX_new(TLS_method())) == NULL) {
-        BIO_printf(bio_err, "ERROR: Memory allocation\n");
+        BIO_puts(bio_err, "ERROR: Memory allocation\n");
         goto err;
     }
     if (!SSL_CTX_set_min_proto_version(ctx, version)
         || !SSL_CTX_set_max_proto_version(ctx, version)) {
-        BIO_printf(bio_err, "ERROR: setting TLS protocol version\n");
+        BIO_puts(bio_err, "ERROR: setting TLS protocol version\n");
         goto err;
     }
     if (!SSL_CTX_get0_implemented_groups(ctx, all, groups)) {
-        BIO_printf(bio_err, "ERROR: getting implemented TLS group list\n");
+        BIO_puts(bio_err, "ERROR: getting implemented TLS group list\n");
         goto err;
     }
     num = sk_OPENSSL_CSTRING_num(groups);
@@ -884,19 +900,19 @@ static void list_tls_signatures(void)

     if (builtin_sigalgs != NULL) {
         if (builtin_sigalgs[0] != 0) {
-            BIO_printf(bio_out, "%s", builtin_sigalgs);
+            BIO_puts(bio_out, builtin_sigalgs);
             tls_sigalg_listed = 1;
         }
         OPENSSL_free(builtin_sigalgs);
     }

     if (!OSSL_PROVIDER_do_all(NULL, list_tls_sigalg_caps, &tls_sigalg_listed))
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "ERROR: could not list all provider signature algorithms\n");
     if (tls_sigalg_listed < 2)
         BIO_printf(bio_out,
             "\nNo TLS sig algs registered by currently active providers");
-    BIO_printf(bio_out, "\n");
+    BIO_puts(bio_out, "\n");
 }

 DEFINE_STACK_OF(EVP_KEM)
@@ -935,7 +951,7 @@ static void list_kems(void)
         names = sk_OPENSSL_CSTRING_new(name_cmp);
         if (names != NULL && EVP_KEM_names_do_all(k, collect_names, names)) {
             count++;
-            BIO_printf(bio_out, "  ");
+            BIO_puts(bio_out, "  ");
             print_names(bio_out, names);

             BIO_printf(bio_out, " @ %s\n",
@@ -956,7 +972,7 @@ static void list_kems(void)
     }
     sk_EVP_KEM_pop_free(kem_stack, EVP_KEM_free);
     if (count == 0)
-        BIO_printf(bio_out, " -\n");
+        BIO_puts(bio_out, " -\n");
 }

 DEFINE_STACK_OF(EVP_ASYM_CIPHER)
@@ -997,7 +1013,7 @@ static void list_asymciphers(void)
         if (names != NULL
             && EVP_ASYM_CIPHER_names_do_all(k, collect_names, names)) {
             count++;
-            BIO_printf(bio_out, "  ");
+            BIO_puts(bio_out, "  ");
             print_names(bio_out, names);

             BIO_printf(bio_out, " @ %s\n",
@@ -1018,7 +1034,7 @@ static void list_asymciphers(void)
     }
     sk_EVP_ASYM_CIPHER_pop_free(asymciph_stack, EVP_ASYM_CIPHER_free);
     if (count == 0)
-        BIO_printf(bio_out, " -\n");
+        BIO_puts(bio_out, " -\n");
 }

 DEFINE_STACK_OF(EVP_KEYEXCH)
@@ -1057,7 +1073,7 @@ static void list_keyexchanges(void)
         names = sk_OPENSSL_CSTRING_new(name_cmp);
         if (names != NULL && EVP_KEYEXCH_names_do_all(k, collect_names, names)) {
             count++;
-            BIO_printf(bio_out, "  ");
+            BIO_puts(bio_out, "  ");
             print_names(bio_out, names);

             BIO_printf(bio_out, " @ %s\n",
@@ -1078,7 +1094,7 @@ static void list_keyexchanges(void)
     }
     sk_EVP_KEYEXCH_pop_free(kex_stack, EVP_KEYEXCH_free);
     if (count == 0)
-        BIO_printf(bio_out, " -\n");
+        BIO_puts(bio_out, " -\n");
 }

 static void list_objects(void)
@@ -1115,7 +1131,7 @@ static void list_objects(void)
         if (n > oid_size) {
             oid_buf = OPENSSL_realloc(oid_buf, n + 1);
             if (oid_buf == NULL) {
-                BIO_printf(bio_err, "ERROR: Memory allocation\n");
+                BIO_puts(bio_err, "ERROR: Memory allocation\n");
                 break; /* Error */
             }
             oid_size = n + 1;
@@ -1162,7 +1178,7 @@ static void list_options_for_command(const char *command)
         BIO_printf(bio_out, "%s %c\n", o->name, c == '\0' ? '-' : c);
     }
     /* Always output the -- marker since it is sometimes documented. */
-    BIO_printf(bio_out, "- -\n");
+    BIO_puts(bio_out, "- -\n");
 }

 static int is_md_available(const char *name)
@@ -1179,7 +1195,7 @@ static int is_md_available(const char *name)
         return 1;
     }

-    return propq != NULL || get_digest_from_engine(name) == NULL ? 0 : 1;
+    return 0;
 }

 static int is_cipher_available(const char *name)
@@ -1196,7 +1212,7 @@ static int is_cipher_available(const char *name)
         return 1;
     }

-    return propq != NULL || get_cipher_from_engine(name) == NULL ? 0 : 1;
+    return 0;
 }

 static void list_type(FUNC_TYPE ft, int one)
@@ -1228,77 +1244,32 @@ static void list_type(FUNC_TYPE ft, int one)
             BIO_printf(bio_out, "%s\n", fp->name);
         } else {
             if (i % dc.columns == 0 && i > 0)
-                BIO_printf(bio_out, "\n");
+                BIO_puts(bio_out, "\n");
             BIO_printf(bio_out, "%-*s", dc.width, fp->name);
             i++;
         }
     }
     if (!one)
-        BIO_printf(bio_out, "\n\n");
+        BIO_puts(bio_out, "\n\n");
 }

 static void list_pkey(void)
 {
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-    int i;
-
-    if (select_name == NULL && include_legacy()) {
-        BIO_printf(bio_out, "Legacy:\n");
-        for (i = 0; i < EVP_PKEY_asn1_get_count(); i++) {
-            const EVP_PKEY_ASN1_METHOD *ameth;
-            int pkey_id, pkey_base_id, pkey_flags;
-            const char *pinfo, *pem_str;
-            ameth = EVP_PKEY_asn1_get0(i);
-            EVP_PKEY_asn1_get0_info(&pkey_id, &pkey_base_id, &pkey_flags,
-                &pinfo, &pem_str, ameth);
-            if (pkey_flags & ASN1_PKEY_ALIAS) {
-                BIO_printf(bio_out, " Name: %s\n", OBJ_nid2ln(pkey_id));
-                BIO_printf(bio_out, "\tAlias for: %s\n",
-                    OBJ_nid2ln(pkey_base_id));
-            } else {
-                BIO_printf(bio_out, " Name: %s\n", pinfo);
-                BIO_printf(bio_out, "\tType: %s Algorithm\n",
-                    pkey_flags & ASN1_PKEY_DYNAMIC ? "External" : "Builtin");
-                BIO_printf(bio_out, "\tOID: %s\n", OBJ_nid2ln(pkey_id));
-                if (pem_str == NULL)
-                    pem_str = "(none)";
-                BIO_printf(bio_out, "\tPEM string: %s\n", pem_str);
-            }
-        }
-    }
-#endif
-    BIO_printf(bio_out, "Provided:\n");
-    BIO_printf(bio_out, " Key Managers:\n");
+    BIO_puts(bio_out, "Provided:\n"
+                      " Key Managers:\n");
     list_keymanagers();
 }

 static void list_pkey_meth(void)
 {
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-    size_t i;
-    size_t meth_count = EVP_PKEY_meth_get_count();
-
-    if (select_name == NULL && include_legacy()) {
-        BIO_printf(bio_out, "Legacy:\n");
-        for (i = 0; i < meth_count; i++) {
-            const EVP_PKEY_METHOD *pmeth = EVP_PKEY_meth_get0(i);
-            int pkey_id, pkey_flags;
-
-            EVP_PKEY_meth_get0_info(&pkey_id, &pkey_flags, pmeth);
-            BIO_printf(bio_out, " %s\n", OBJ_nid2ln(pkey_id));
-            BIO_printf(bio_out, "\tType: %s Algorithm\n",
-                pkey_flags & ASN1_PKEY_DYNAMIC ? "External" : "Builtin");
-        }
-    }
-#endif
-    BIO_printf(bio_out, "Provided:\n");
-    BIO_printf(bio_out, " Encryption:\n");
+    BIO_puts(bio_out, "Provided:\n"
+                      " Encryption:\n");
     list_asymciphers();
-    BIO_printf(bio_out, " Key Exchange:\n");
+    BIO_puts(bio_out, " Key Exchange:\n");
     list_keyexchanges();
-    BIO_printf(bio_out, " Signatures:\n");
+    BIO_puts(bio_out, " Signatures:\n");
     list_signatures();
-    BIO_printf(bio_out, " Key encapsulation:\n");
+    BIO_puts(bio_out, " Key encapsulation:\n");
     list_kems();
 }

@@ -1325,27 +1296,36 @@ static void list_store_loaders(void)
     int i;

     if (stores == NULL) {
-        BIO_printf(bio_err, "ERROR: Memory allocation\n");
+        BIO_puts(bio_err, "ERROR: Memory allocation\n");
         return;
     }
-    BIO_printf(bio_out, "Provided STORE LOADERs:\n");
+    BIO_puts(bio_out, "Provided STORE LOADERs:\n");
     OSSL_STORE_LOADER_do_all_provided(app_get0_libctx(), collect_store_loaders,
         stores);
     sk_OSSL_STORE_LOADER_sort(stores);
     for (i = 0; i < sk_OSSL_STORE_LOADER_num(stores); i++) {
-        const OSSL_STORE_LOADER *m = sk_OSSL_STORE_LOADER_value(stores, i);
+        const OSSL_STORE_LOADER *l = sk_OSSL_STORE_LOADER_value(stores, i);
         STACK_OF(OPENSSL_CSTRING) *names = NULL;

-        if (select_name != NULL && !OSSL_STORE_LOADER_is_a(m, select_name))
+        if (select_name != NULL && !OSSL_STORE_LOADER_is_a(l, select_name))
             continue;

         names = sk_OPENSSL_CSTRING_new(name_cmp);
-        if (names != NULL && OSSL_STORE_LOADER_names_do_all(m, collect_names, names)) {
-            BIO_printf(bio_out, "  ");
+        if (names != NULL && OSSL_STORE_LOADER_names_do_all(l, collect_names, names)) {
+            BIO_puts(bio_out, "  ");
             print_names(bio_out, names);

             BIO_printf(bio_out, " @ %s\n",
-                OSSL_PROVIDER_get0_name(OSSL_STORE_LOADER_get0_provider(m)));
+                OSSL_PROVIDER_get0_name(OSSL_STORE_LOADER_get0_provider(l)));
+
+            if (verbose) {
+                const char *desc = OSSL_STORE_LOADER_get0_description(l);
+
+                if (desc != NULL)
+                    BIO_printf(bio_out, "    description: %s\n", desc);
+                print_param_types("settable operation parameters",
+                    OSSL_STORE_LOADER_settable_ctx_params(l), 4);
+            }
         }
         sk_OPENSSL_CSTRING_free(names);
     }
@@ -1379,17 +1359,17 @@ static void list_provider_info(void)
     int i;

     if (providers == NULL) {
-        BIO_printf(bio_err, "ERROR: Memory allocation\n");
+        BIO_puts(bio_err, "ERROR: Memory allocation\n");
         return;
     }

     if (OSSL_PROVIDER_do_all(NULL, &collect_providers, providers) != 1) {
         sk_OSSL_PROVIDER_free(providers);
-        BIO_printf(bio_err, "ERROR: Memory allocation\n");
+        BIO_puts(bio_err, "ERROR: Memory allocation\n");
         return;
     }

-    BIO_printf(bio_out, "Providers:\n");
+    BIO_puts(bio_out, "Providers:\n");
     sk_OSSL_PROVIDER_sort(providers);
     for (i = 0; i < sk_OSSL_PROVIDER_num(providers); i++) {
         const OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(providers, i);
@@ -1430,180 +1410,11 @@ static void list_provider_info(void)
     sk_OSSL_PROVIDER_free(providers);
 }

-#ifndef OPENSSL_NO_DEPRECATED_3_0
-static void list_engines(void)
-{
-#ifndef OPENSSL_NO_ENGINE
-    ENGINE *e;
-
-    BIO_puts(bio_out, "Engines:\n");
-    e = ENGINE_get_first();
-    while (e) {
-        BIO_printf(bio_out, "%s\n", ENGINE_get_id(e));
-        e = ENGINE_get_next(e);
-    }
-#else
-    BIO_puts(bio_out, "Engine support is disabled.\n");
-#endif
-}
-#endif
-
 static void list_disabled(void)
 {
-    BIO_puts(bio_out, "Disabled algorithms:\n");
-#ifdef OPENSSL_NO_ARGON2
-    BIO_puts(bio_out, "ARGON2\n");
-#endif
-#ifdef OPENSSL_NO_ARIA
-    BIO_puts(bio_out, "ARIA\n");
-#endif
-#ifdef OPENSSL_NO_BF
-    BIO_puts(bio_out, "BF\n");
-#endif
-#ifdef OPENSSL_NO_BLAKE2
-    BIO_puts(bio_out, "BLAKE2\n");
-#endif
-#ifdef OPENSSL_NO_CAMELLIA
-    BIO_puts(bio_out, "CAMELLIA\n");
-#endif
-#ifdef OPENSSL_NO_CAST
-    BIO_puts(bio_out, "CAST\n");
-#endif
-#ifdef OPENSSL_NO_CMAC
-    BIO_puts(bio_out, "CMAC\n");
-#endif
-#ifdef OPENSSL_NO_CMS
-    BIO_puts(bio_out, "CMS\n");
-#endif
-#ifdef OPENSSL_NO_COMP
-    BIO_puts(bio_out, "COMP\n");
-#endif
-#ifdef OPENSSL_NO_DES
-    BIO_puts(bio_out, "DES\n");
-#endif
-#ifdef OPENSSL_NO_DGRAM
-    BIO_puts(bio_out, "DGRAM\n");
-#endif
-#ifdef OPENSSL_NO_DH
-    BIO_puts(bio_out, "DH\n");
-#endif
-#ifdef OPENSSL_NO_DSA
-    BIO_puts(bio_out, "DSA\n");
-#endif
-#ifdef OPENSSL_NO_SIPHASH
-    BIO_puts(bio_out, "SIPHASH\n");
-#endif
-#if defined(OPENSSL_NO_DTLS)
-    BIO_puts(bio_out, "DTLS\n");
-#endif
-#if defined(OPENSSL_NO_DTLS1)
-    BIO_puts(bio_out, "DTLS1\n");
-#endif
-#if defined(OPENSSL_NO_DTLS1_2)
-    BIO_puts(bio_out, "DTLS1_2\n");
-#endif
-#ifdef OPENSSL_NO_EC
-    BIO_puts(bio_out, "EC\n");
-#endif
-#ifdef OPENSSL_NO_ECX
-    BIO_puts(bio_out, "ECX\n");
-#endif
-#ifdef OPENSSL_NO_EC2M
-    BIO_puts(bio_out, "EC2M\n");
-#endif
-#if defined(OPENSSL_NO_ENGINE) && !defined(OPENSSL_NO_DEPRECATED_3_0)
-    BIO_puts(bio_out, "ENGINE\n");
-#endif
-#ifdef OPENSSL_NO_GOST
-    BIO_puts(bio_out, "GOST\n");
-#endif
-#ifdef OPENSSL_NO_IDEA
-    BIO_puts(bio_out, "IDEA\n");
-#endif
-#ifdef OPENSSL_NO_MD2
-    BIO_puts(bio_out, "MD2\n");
-#endif
-#ifdef OPENSSL_NO_MD4
-    BIO_puts(bio_out, "MD4\n");
-#endif
-#ifdef OPENSSL_NO_MD5
-    BIO_puts(bio_out, "MD5\n");
-#endif
-#ifdef OPENSSL_NO_MDC2
-    BIO_puts(bio_out, "MDC2\n");
-#endif
-#ifdef OPENSSL_NO_OCB
-    BIO_puts(bio_out, "OCB\n");
-#endif
-#ifdef OPENSSL_NO_OCSP
-    BIO_puts(bio_out, "OCSP\n");
-#endif
-#ifdef OPENSSL_NO_PSK
-    BIO_puts(bio_out, "PSK\n");
-#endif
-#ifdef OPENSSL_NO_RC2
-    BIO_puts(bio_out, "RC2\n");
-#endif
-#ifdef OPENSSL_NO_RC4
-    BIO_puts(bio_out, "RC4\n");
-#endif
-#ifdef OPENSSL_NO_RC5
-    BIO_puts(bio_out, "RC5\n");
-#endif
-#ifdef OPENSSL_NO_RMD160
-    BIO_puts(bio_out, "RMD160\n");
-#endif
-#ifdef OPENSSL_NO_SCRYPT
-    BIO_puts(bio_out, "SCRYPT\n");
-#endif
-#ifdef OPENSSL_NO_SCTP
-    BIO_puts(bio_out, "SCTP\n");
-#endif
-#ifdef OPENSSL_NO_SEED
-    BIO_puts(bio_out, "SEED\n");
-#endif
-#ifdef OPENSSL_NO_SM2
-    BIO_puts(bio_out, "SM2\n");
-#endif
-#ifdef OPENSSL_NO_SM3
-    BIO_puts(bio_out, "SM3\n");
-#endif
-#ifdef OPENSSL_NO_SM4
-    BIO_puts(bio_out, "SM4\n");
-#endif
-#ifdef OPENSSL_NO_SOCK
-    BIO_puts(bio_out, "SOCK\n");
-#endif
-#ifdef OPENSSL_NO_SRP
-    BIO_puts(bio_out, "SRP\n");
-#endif
-#ifdef OPENSSL_NO_SRTP
-    BIO_puts(bio_out, "SRTP\n");
-#endif
-#ifdef OPENSSL_NO_SSL3
-    BIO_puts(bio_out, "SSL3\n");
-#endif
-#ifdef OPENSSL_NO_TLS1
-    BIO_puts(bio_out, "TLS1\n");
-#endif
-#ifdef OPENSSL_NO_TLS1_1
-    BIO_puts(bio_out, "TLS1_1\n");
-#endif
-#ifdef OPENSSL_NO_TLS1_2
-    BIO_puts(bio_out, "TLS1_2\n");
-#endif
-#ifdef OPENSSL_NO_WHIRLPOOL
-    BIO_puts(bio_out, "WHIRLPOOL\n");
-#endif
-#ifdef OPENSSL_NO_ZLIB
-    BIO_puts(bio_out, "ZLIB\n");
-#endif
-#ifdef OPENSSL_NO_BROTLI
-    BIO_puts(bio_out, "BROTLI\n");
-#endif
-#ifdef OPENSSL_NO_ZSTD
-    BIO_puts(bio_out, "ZSTD\n");
-#endif
+    OPENSSL_PRINT_DISABLED(bio_out, protocols, "protocol");
+    OPENSSL_PRINT_DISABLED(bio_out, algorithms, "algorithm");
+    OPENSSL_PRINT_DISABLED(bio_out, features, "feature");
 }

 /* Unified enum for help and list commands. */
@@ -1647,9 +1458,6 @@ typedef enum HELPLIST_CHOICE {
 #if !defined(OPENSSL_NO_TLS1_3)
     OPT_TLS1_3,
 #endif
-#endif
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-    OPT_ENGINES,
 #endif
     OPT_PROV_ENUM
 } HELPLIST_CHOICE;
@@ -1722,11 +1530,7 @@ const OPTIONS list_options[] = {
 #endif
     { "providers", OPT_PROVIDER_INFO, '-',
         "List of provider information" },
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-    { "engines", OPT_ENGINES, '-',
-        "List of loaded engines" },
-#endif
-    { "disabled", OPT_DISABLED, '-', "List of disabled features" },
+    { "disabled", OPT_DISABLED, '-', "List of disabled features, algorithms, and protocols." },
     { "options", OPT_OPTIONS, 's',
         "List options for specified command" },
     { "objects", OPT_OBJECTS, '-',
@@ -1775,9 +1579,6 @@ int list_main(int argc, char **argv)
         unsigned int pk_method : 1;
         unsigned int store_loaders : 1;
         unsigned int provider_info : 1;
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-        unsigned int engines : 1;
-#endif
         unsigned int disabled : 1;
         unsigned int objects : 1;
         unsigned int options : 1;
@@ -1889,11 +1690,6 @@ int list_main(int argc, char **argv)
         case OPT_PROVIDER_INFO:
             todo.provider_info = 1;
             break;
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-        case OPT_ENGINES:
-            todo.engines = 1;
-            break;
-#endif
         case OPT_DISABLED:
             todo.disabled = 1;
             break;
@@ -1921,12 +1717,12 @@ int list_main(int argc, char **argv)
     if (!opt_check_rest_arg(NULL))
         goto opthelp;

-#define MAYBE_ADD_NL(cmd)              \
-    do {                               \
-        if (print_newline++) {         \
-            BIO_printf(bio_out, "\n"); \
-        }                              \
-        cmd;                           \
+#define MAYBE_ADD_NL(cmd)            \
+    do {                             \
+        if (print_newline++) {       \
+            BIO_puts(bio_out, "\n"); \
+        }                            \
+        cmd;                         \
     } while (0)

     if (todo.commands)
@@ -1934,31 +1730,31 @@ int list_main(int argc, char **argv)
     if (todo.all_algorithms) {
         MAYBE_ADD_NL({});

-        BIO_printf(bio_out, "Digests:\n");
+        BIO_puts(bio_out, "Digests:\n");
         list_digests(" ");
-        BIO_printf(bio_out, "\nSymmetric Ciphers:\n");
+        BIO_puts(bio_out, "\nSymmetric Ciphers:\n");
         list_ciphers(" ");
-        BIO_printf(bio_out, "\n");
+        BIO_puts(bio_out, "\n");
         list_kdfs();
-        BIO_printf(bio_out, "\n");
+        BIO_puts(bio_out, "\n");
         list_macs();

-        BIO_printf(bio_out, "\nProvided Asymmetric Encryption:\n");
+        BIO_puts(bio_out, "\nProvided Asymmetric Encryption:\n");
         list_asymciphers();
-        BIO_printf(bio_out, "\nProvided Key Exchange:\n");
+        BIO_puts(bio_out, "\nProvided Key Exchange:\n");
         list_keyexchanges();
-        BIO_printf(bio_out, "\nProvided Signatures:\n");
+        BIO_puts(bio_out, "\nProvided Signatures:\n");
         list_signatures();
-        BIO_printf(bio_out, "\nProvided Key encapsulation:\n");
+        BIO_puts(bio_out, "\nProvided Key encapsulation:\n");
         list_kems();
-        BIO_printf(bio_out, "\nProvided Key managers:\n");
+        BIO_puts(bio_out, "\nProvided Key managers:\n");
         list_keymanagers();

-        BIO_printf(bio_out, "\n");
+        BIO_puts(bio_out, "\n");
         list_encoders();
-        BIO_printf(bio_out, "\n");
+        BIO_puts(bio_out, "\n");
         list_decoders();
-        BIO_printf(bio_out, "\n");
+        BIO_puts(bio_out, "\n");
         list_store_loaders();
     }
     if (todo.random_instances)
@@ -2007,10 +1803,6 @@ int list_main(int argc, char **argv)
         MAYBE_ADD_NL(list_store_loaders());
     if (todo.provider_info)
         MAYBE_ADD_NL(list_provider_info());
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-    if (todo.engines)
-        MAYBE_ADD_NL(list_engines());
-#endif
     if (todo.disabled)
         MAYBE_ADD_NL(list_disabled());
     if (todo.objects)
diff --git a/deps/openssl/openssl/apps/mac.c b/deps/openssl/openssl/apps/mac.c
index 9e0f4d8ede5..daa22a3bd94 100644
--- a/deps/openssl/openssl/apps/mac.c
+++ b/deps/openssl/openssl/apps/mac.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,7 @@
  * https://www.openssl.org/source/license.html
  */

+#include <stdio.h>
 #include <string.h>

 #include "apps.h"
@@ -68,7 +69,7 @@ static char *alloc_mac_algorithm_name(STACK_OF(OPENSSL_STRING) **optp,
         return NULL;

     res = app_malloc(len, "algorithm name");
-    BIO_snprintf(res, len, "%s:%s", name, arg);
+    snprintf(res, len, "%s:%s", name, arg);
     if (sk_OPENSSL_STRING_push(*optp, res))
         return res;
     OPENSSL_free(res);
@@ -93,6 +94,7 @@ int mac_main(int argc, char **argv)
     int inform = FORMAT_BINARY;
     char *digest = NULL, *cipher = NULL;
     OSSL_PARAM *params = NULL;
+    char *new_opt = NULL;

     prog = opt_init(argc, argv, mac_options);
     buf = app_malloc(BUFSIZE, "I/O buffer");
@@ -116,10 +118,17 @@ int mac_main(int argc, char **argv)
             outfile = opt_arg();
             break;
         case OPT_MACOPT:
+            new_opt = process_additional_mac_key_arguments(opt_arg());
+            if (new_opt == NULL) {
+                ret = 1;
+                goto err;
+            }
             if (opts == NULL)
                 opts = sk_OPENSSL_STRING_new_null();
-            if (opts == NULL || !sk_OPENSSL_STRING_push(opts, opt_arg()))
+            if (opts == NULL || !sk_OPENSSL_STRING_push(opts, new_opt)) {
+                clear_free(new_opt);
                 goto opthelp;
+            }
             break;
         case OPT_CIPHER:
             OPENSSL_free(cipher);
@@ -164,7 +173,7 @@ int mac_main(int argc, char **argv)
             goto err;

         if (!EVP_MAC_CTX_set_params(ctx, params)) {
-            BIO_printf(bio_err, "MAC parameter error\n");
+            BIO_puts(bio_err, "MAC parameter error\n");
             ERR_print_errors(bio_err);
             ok = 0;
         }
@@ -182,7 +191,7 @@ int mac_main(int argc, char **argv)
         goto err;

     if (!EVP_MAC_init(ctx, NULL, 0, NULL)) {
-        BIO_printf(bio_err, "EVP_MAC_Init failed\n");
+        BIO_puts(bio_err, "EVP_MAC_Init failed\n");
         goto err;
     }

@@ -196,32 +205,32 @@ int mac_main(int argc, char **argv)
         if (i == 0)
             break;
         if (!EVP_MAC_update(ctx, buf, i)) {
-            BIO_printf(bio_err, "EVP_MAC_update failed\n");
+            BIO_puts(bio_err, "EVP_MAC_update failed\n");
             goto err;
         }
     }

     if (!EVP_MAC_final(ctx, NULL, &len, 0)) {
-        BIO_printf(bio_err, "EVP_MAC_final failed\n");
+        BIO_puts(bio_err, "EVP_MAC_final failed\n");
         goto err;
     }
     if (len > BUFSIZE) {
-        BIO_printf(bio_err, "output len is too large\n");
+        BIO_puts(bio_err, "output len is too large\n");
         goto err;
     }

     if (!EVP_MAC_final(ctx, buf, &len, BUFSIZE)) {
-        BIO_printf(bio_err, "EVP_MAC_final failed\n");
+        BIO_puts(bio_err, "EVP_MAC_final failed\n");
         goto err;
     }

     if (out_bin) {
-        BIO_write(out, buf, len);
+        BIO_write(out, buf, (int)len);
     } else {
         for (i = 0; i < (int)len; ++i)
             BIO_printf(out, "%02X", buf[i]);
         if (outfile == NULL)
-            BIO_printf(out, "\n");
+            BIO_puts(out, "\n");
     }

     ret = 0;
@@ -229,9 +238,7 @@ err:
     if (ret != 0)
         ERR_print_errors(bio_err);
     OPENSSL_clear_free(buf, BUFSIZE);
-    OPENSSL_free(cipher);
-    OPENSSL_free(digest);
-    sk_OPENSSL_STRING_free(opts);
+    sk_OPENSSL_STRING_pop_free(opts, clear_free);
     BIO_free(in);
     BIO_free(out);
     EVP_MAC_CTX_free(ctx);
diff --git a/deps/openssl/openssl/apps/ocsp.c b/deps/openssl/openssl/apps/ocsp.c
index e490ec43f8a..e302c1cf6b0 100644
--- a/deps/openssl/openssl/apps/ocsp.c
+++ b/deps/openssl/openssl/apps/ocsp.c
@@ -38,7 +38,7 @@
 int setpgid(pid_t pid, pid_t pgid)
 {
     errno = ENOSYS;
-    return 0;
+    return 0; /* no error if setpgid() is not provided by platform */
 }
 /* not supported */
 pid_t fork(void)
@@ -74,7 +74,7 @@ static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio,
 static int send_ocsp_response(BIO *cbio, const OCSP_RESPONSE *resp);
 static char *prog;

-#ifdef HTTP_DAEMON
+#ifndef OPENSSL_NO_POSIX_IO
 static int index_changed(CA_DB *);
 #endif

@@ -152,9 +152,9 @@ const OPTIONS ocsp_options[] = {
     { "help", OPT_HELP, '-', "Display this summary" },
     { "ignore_err", OPT_IGNORE_ERR, '-',
         "Ignore error on OCSP request or response and continue running" },
-    { "CAfile", OPT_CAFILE, '<', "Trusted certificates file" },
-    { "CApath", OPT_CAPATH, '<', "Trusted certificates directory" },
-    { "CAstore", OPT_CASTORE, ':', "Trusted certificates store URI" },
+    { "CAfile", OPT_CAFILE, '<', "File in PEM format with trusted CA certs" },
+    { "CApath", OPT_CAPATH, '/', "Dir with trusted CA cert files in PEM format" },
+    { "CAstore", OPT_CASTORE, ':', "URI of store with trusted CA certs" },
     { "no-CAfile", OPT_NOCAFILE, '-',
         "Do not load the default certificates file" },
     { "no-CApath", OPT_NOCAPATH, '-',
@@ -319,7 +319,7 @@ int ocsp_main(int argc, char **argv)
             break;
         case OPT_TIMEOUT:
 #ifndef OPENSSL_NO_SOCK
-            req_timeout = atoi(opt_arg());
+            req_timeout = opt_int_arg();
 #endif
             break;
         case OPT_URL:
@@ -519,7 +519,7 @@ int ocsp_main(int argc, char **argv)
             accept_count = opt_int_arg();
             break;
         case OPT_NDAYS:
-            ndays = atoi(opt_arg());
+            ndays = opt_int_arg();
             break;
         case OPT_RSIGNER:
             rsignfile = opt_arg();
@@ -547,7 +547,7 @@ int ocsp_main(int argc, char **argv)
             header = opt_arg();
             value = strchr(header, '=');
             if (value == NULL) {
-                BIO_printf(bio_err, "Missing = in header key=value\n");
+                BIO_puts(bio_err, "Missing = in header key=value\n");
                 goto opthelp;
             }
             *value++ = '\0';
@@ -571,7 +571,7 @@ int ocsp_main(int argc, char **argv)
             break;
         case OPT_MULTI:
 #ifdef HTTP_DAEMON
-            n_responders = atoi(opt_arg());
+            n_responders = opt_int_arg();
 #endif
             break;
         case OPT_PROV_CASES:
@@ -611,7 +611,7 @@ int ocsp_main(int argc, char **argv)
         req = d2i_OCSP_REQUEST_bio(derbio, NULL);
         BIO_free(derbio);
         if (req == NULL) {
-            BIO_printf(bio_err, "Error reading OCSP request\n");
+            BIO_puts(bio_err, "Error reading OCSP request\n");
             goto end;
         }
     }
@@ -622,7 +622,7 @@ int ocsp_main(int argc, char **argv)
         if (acbio == NULL)
             goto end;
 #else
-        BIO_printf(bio_err, "Cannot act as server - sockets not supported\n");
+        BIO_puts(bio_err, "Cannot act as server - sockets not supported\n");
         goto end;
 #endif
     }
@@ -632,7 +632,7 @@ int ocsp_main(int argc, char **argv)
             rkeyfile = rsignfile;
         rsigner = load_cert(rsignfile, FORMAT_UNDEF, "responder certificate");
         if (rsigner == NULL) {
-            BIO_printf(bio_err, "Error loading responder certificate\n");
+            BIO_puts(bio_err, "Error loading responder certificate\n");
             goto end;
         }
         if (!load_certs(rca_filename, 0, &rca_certs, NULL, "CA certificates"))
@@ -643,10 +643,10 @@ int ocsp_main(int argc, char **argv)
                 goto end;
         }
         if (!app_passwd(passinarg, NULL, &passin, NULL)) {
-            BIO_printf(bio_err, "Error getting password\n");
+            BIO_puts(bio_err, "Error getting password\n");
             goto end;
         }
-        rkey = load_key(rkeyfile, FORMAT_UNDEF, 0, passin, NULL,
+        rkey = load_key(rkeyfile, FORMAT_UNDEF, 0, passin,
             "responder private key");
         if (rkey == NULL)
             goto end;
@@ -654,7 +654,7 @@ int ocsp_main(int argc, char **argv)

     if (ridx_filename != NULL
         && (rkey == NULL || rsigner == NULL || rca_certs == NULL)) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Responder mode requires certificate, key, and CA.\n");
         goto end;
     }
@@ -684,7 +684,7 @@ int ocsp_main(int argc, char **argv)
 redo_accept:

     if (acbio != NULL) {
-#ifdef HTTP_DAEMON
+#ifndef OPENSSL_NO_POSIX_IO
         if (index_changed(rdb)) {
             CA_DB *newrdb = load_index(ridx_filename, NULL);

@@ -719,7 +719,7 @@ redo_accept:
     if (req == NULL
         && (signfile != NULL || reqout != NULL
             || host != NULL || add_nonce || ridx_filename != NULL)) {
-        BIO_printf(bio_err, "Need an OCSP request for this operation!\n");
+        BIO_puts(bio_err, "Need an OCSP request for this operation!\n");
         goto end;
     }

@@ -733,7 +733,7 @@ redo_accept:
             keyfile = signfile;
         signer = load_cert(signfile, FORMAT_UNDEF, "signer certificate");
         if (signer == NULL) {
-            BIO_printf(bio_err, "Error loading signer certificate\n");
+            BIO_puts(bio_err, "Error loading signer certificate\n");
             goto end;
         }
         if (sign_certfile != NULL) {
@@ -741,14 +741,14 @@ redo_accept:
                     "signer certificates"))
                 goto end;
         }
-        key = load_key(keyfile, FORMAT_UNDEF, 0, NULL, NULL,
+        key = load_key(keyfile, FORMAT_UNDEF, 0, NULL,
             "signer private key");
         if (key == NULL)
             goto end;

         if (!OCSP_request_sign(req, signer, key, NULL,
                 sign_other, sign_flags)) {
-            BIO_printf(bio_err, "Error signing OCSP request\n");
+            BIO_puts(bio_err, "Error signing OCSP request\n");
             goto end;
         }
     }
@@ -783,7 +783,7 @@ redo_accept:
         if (resp == NULL)
             goto end;
 #else
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Error creating connect BIO - sockets not supported\n");
         goto end;
 #endif
@@ -794,7 +794,7 @@ redo_accept:
         resp = d2i_OCSP_RESPONSE_bio(derbio, NULL);
         BIO_free(derbio);
         if (resp == NULL) {
-            BIO_printf(bio_err, "Error reading OCSP response\n");
+            BIO_puts(bio_err, "Error reading OCSP response\n");
             goto end;
         }
     } else {
@@ -861,7 +861,7 @@ done_resp:

     bs = OCSP_response_get1_basic(resp);
     if (bs == NULL) {
-        BIO_printf(bio_err, "Error parsing response\n");
+        BIO_puts(bio_err, "Error parsing response\n");
         goto end;
     }

@@ -870,9 +870,9 @@ done_resp:
     if (!noverify) {
         if (req != NULL && ((i = OCSP_check_nonce(req, bs)) <= 0)) {
             if (i == -1)
-                BIO_printf(bio_err, "WARNING: no nonce in response\n");
+                BIO_puts(bio_err, "WARNING: no nonce in response\n");
             else {
-                BIO_printf(bio_err, "Nonce Verify error\n");
+                BIO_puts(bio_err, "Nonce Verify error\n");
                 ret = 1;
                 goto end;
             }
@@ -885,11 +885,11 @@ done_resp:
                 ERR_clear_error();
         }
         if (i <= 0) {
-            BIO_printf(bio_err, "Response Verify Failure\n");
+            BIO_puts(bio_err, "Response Verify Failure\n");
             ERR_print_errors(bio_err);
             ret = 1;
         } else {
-            BIO_printf(bio_err, "Response verify OK\n");
+            BIO_puts(bio_err, "Response verify OK\n");
         }
     }

@@ -930,7 +930,7 @@ end:
     return ret;
 }

-#ifdef HTTP_DAEMON
+#ifndef OPENSSL_NO_POSIX_IO

 static int index_changed(CA_DB *rdb)
 {
@@ -941,7 +941,11 @@ static int index_changed(CA_DB *rdb)
             || rdb->dbst.st_ctime != sb.st_ctime
             || rdb->dbst.st_ino != sb.st_ino
             || rdb->dbst.st_dev != sb.st_dev) {
+#ifdef HTTP_DAEMON
             syslog(LOG_INFO, "index file changed, reloading");
+#else
+            BIO_printf(bio_err, "%s: index file changed, reloading\n", prog);
+#endif
             return 1;
         }
     }
@@ -954,10 +958,10 @@ static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert,
     const EVP_MD *cert_id_md, X509 *issuer,
     STACK_OF(OCSP_CERTID) *ids)
 {
-    OCSP_CERTID *id;
+    OCSP_CERTID *id = NULL;

     if (issuer == NULL) {
-        BIO_printf(bio_err, "No issuer certificate specified\n");
+        BIO_puts(bio_err, "No issuer certificate specified\n");
         return 0;
     }
     if (*req == NULL)
@@ -967,12 +971,15 @@ static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert,
     id = OCSP_cert_to_id(cert_id_md, cert, issuer);
     if (id == NULL || !sk_OCSP_CERTID_push(ids, id))
         goto err;
-    if (!OCSP_request_add0_id(*req, id))
+    if (!OCSP_request_add0_id(*req, id)) {
+        id = NULL;
         goto err;
+    }
     return 1;

 err:
-    BIO_printf(bio_err, "Error Creating OCSP request\n");
+    OCSP_CERTID_free(id);
+    BIO_puts(bio_err, "Error Creating OCSP request\n");
     return 0;
 }

@@ -980,13 +987,13 @@ static int add_ocsp_serial(OCSP_REQUEST **req, char *serial,
     const EVP_MD *cert_id_md, X509 *issuer,
     STACK_OF(OCSP_CERTID) *ids)
 {
-    OCSP_CERTID *id;
+    OCSP_CERTID *id = NULL;
     const X509_NAME *iname;
-    ASN1_BIT_STRING *ikey;
+    const ASN1_BIT_STRING *ikey;
     ASN1_INTEGER *sno;

     if (issuer == NULL) {
-        BIO_printf(bio_err, "No issuer certificate specified\n");
+        BIO_puts(bio_err, "No issuer certificate specified\n");
         return 0;
     }
     if (*req == NULL)
@@ -1004,12 +1011,15 @@ static int add_ocsp_serial(OCSP_REQUEST **req, char *serial,
     ASN1_INTEGER_free(sno);
     if (id == NULL || !sk_OCSP_CERTID_push(ids, id))
         goto err;
-    if (!OCSP_request_add0_id(*req, id))
+    if (!OCSP_request_add0_id(*req, id)) {
+        id = NULL;
         goto err;
+    }
     return 1;

 err:
-    BIO_printf(bio_err, "Error Creating OCSP request\n");
+    OCSP_CERTID_free(id);
+    BIO_puts(bio_err, "Error Creating OCSP request\n");
     return 0;
 }

@@ -1050,9 +1060,10 @@ static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
             BIO_puts(out, "WARNING: Status times invalid.\n");
             ERR_print_errors(out);
         }
-        BIO_printf(out, "%s\n", OCSP_cert_status_str(status));
+        BIO_printf(out, "%s\n"
+                        "\tThis Update: ",
+            OCSP_cert_status_str(status));

-        BIO_puts(out, "\tThis Update: ");
         ASN1_GENERALIZEDTIME_print(out, thisupd);
         BIO_puts(out, "\n");

@@ -1114,7 +1125,7 @@ static void make_ocsp_response(BIO *err, OCSP_RESPONSE **resp, OCSP_REQUEST *req
         int jj;
         int found = 0;
         ASN1_OBJECT *cert_id_md_oid;
-        const EVP_MD *cert_id_md;
+        EVP_MD *cert_id_md;
         OCSP_CERTID *cid_resp_md = NULL;

         one = OCSP_request_onereq_get0(req, i);
@@ -1122,7 +1133,8 @@ static void make_ocsp_response(BIO *err, OCSP_RESPONSE **resp, OCSP_REQUEST *req

         OCSP_id_get0_info(NULL, &cert_id_md_oid, NULL, NULL, cid);

-        cert_id_md = EVP_get_digestbyobj(cert_id_md_oid);
+        cert_id_md = EVP_MD_fetch(app_get0_libctx(), OBJ_nid2sn(OBJ_obj2nid(cert_id_md_oid)),
+            app_get0_propq());
         if (cert_id_md == NULL) {
             *resp = OCSP_response_create(OCSP_RESPONSE_STATUS_INTERNALERROR,
                 NULL);
@@ -1135,6 +1147,7 @@ static void make_ocsp_response(BIO *err, OCSP_RESPONSE **resp, OCSP_REQUEST *req
             if (ca_id == NULL) {
                 *resp = OCSP_response_create(OCSP_RESPONSE_STATUS_INTERNALERROR,
                     NULL);
+                EVP_MD_free(cert_id_md);
                 goto end;
             }

@@ -1145,6 +1158,7 @@ static void make_ocsp_response(BIO *err, OCSP_RESPONSE **resp, OCSP_REQUEST *req
             }
             OCSP_CERTID_free(ca_id);
         }
+        EVP_MD_free(cert_id_md);
         OCSP_id_get0_info(NULL, NULL, NULL, &serial, cid);
         inf = lookup_serial(db, serial);

@@ -1220,7 +1234,9 @@ static void make_ocsp_response(BIO *err, OCSP_RESPONSE **resp, OCSP_REQUEST *req

     if (badsig) {
         const ASN1_OCTET_STRING *sig = OCSP_resp_get0_signature(bs);
-        corrupt_signature(sig);
+        /* XXX Casts away const, because it mutates the value! */
+        if (!corrupt_signature((ASN1_STRING *)sig))
+            goto end;
     }

     *resp = OCSP_response_create(OCSP_RESPONSE_STATUS_SUCCESSFUL, bs);
@@ -1264,7 +1280,7 @@ static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio,
         NULL /* found_keep_alive */,
         prog, 1 /* accept_get */, timeout);
 #else
-    BIO_printf(bio_err,
+    BIO_puts(bio_err,
         "Error getting OCSP request - sockets not supported\n");
     *preq = NULL;
     return 0;
@@ -1280,7 +1296,7 @@ static int send_ocsp_response(BIO *cbio, const OCSP_RESPONSE *resp)
         ASN1_ITEM_rptr(OCSP_RESPONSE),
         (const ASN1_VALUE *)resp);
 #else
-    BIO_printf(bio_err,
+    BIO_puts(bio_err,
         "Error sending OCSP response - sockets not supported\n");
     return 0;
 #endif
@@ -1299,7 +1315,7 @@ OCSP_RESPONSE *process_responder(OCSP_REQUEST *req, const char *host,
     if (use_ssl == 1) {
         ctx = SSL_CTX_new(TLS_client_method());
         if (ctx == NULL) {
-            BIO_printf(bio_err, "Error creating SSL context.\n");
+            BIO_puts(bio_err, "Error creating SSL context.\n");
             goto end;
         }
     }
@@ -1312,7 +1328,7 @@ OCSP_RESPONSE *process_responder(OCSP_REQUEST *req, const char *host,
             req_timeout, ASN1_ITEM_rptr(OCSP_RESPONSE));

     if (resp == NULL)
-        BIO_printf(bio_err, "Error querying OCSP responder\n");
+        BIO_puts(bio_err, "Error querying OCSP responder\n");

 end:
     SSL_CTX_free(ctx);
diff --git a/deps/openssl/openssl/apps/openssl-vms.cnf b/deps/openssl/openssl/apps/openssl-vms.cnf
index 768291e4ee8..cc465c420e6 100644
--- a/deps/openssl/openssl/apps/openssl-vms.cnf
+++ b/deps/openssl/openssl/apps/openssl-vms.cnf
@@ -23,12 +23,22 @@ config_diagnostics = 1
 # oid_file       = $ENV::HOME/.oid
 oid_section = new_oids

-# To use this configuration file with the "-extfile" option of the
-# "openssl x509" utility, name here the section containing the
-# X.509v3 extensions to use:
-# extensions		=
-# (Alternatively, use a configuration file that has only
-# X.509v3 extensions in its main [= default] section.)
+# When present, The `extensions` setting of the default configuration file is
+# used by the `openssl-x509(1)` "mini-CA" as a list of extensions to add to
+# each newly signed certificate.  See the descriptions of the `-extfile` and
+# `-extensions` options for details in the documentation.
+#
+# The below setting arranges for `openssl-x509(1)` to add
+# subjectKeyIdentifier and authorityKeyIdentifier extensions by default.
+#
+extensions = default_skid_akid
+
+[ default_skid_akid ]
+# Always a subjectKeyIdentifier
+subjectKeyIdentifier = hash
+# Only if the certificate is not self-signed, with the issuer+serial only as a
+# fallback if no issuer keyid is available.
+authorityKeyIdentifier = keyid:nonss,issuer:nonss

 [ new_oids ]
 # We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
@@ -81,7 +91,6 @@ default_ca	= CA_default		# The default ca section

 dir		= sys\$disk:[.demoCA		# Where everything is kept
 certs		= $dir.certs]		# Where the issued certs are kept
-crl_dir		= $dir.crl]		# Where the issued crl are kept
 database	= $dir]index.txt	# database index file.
 #unique_subject	= no			# Set to 'no' to allow creation of
 					# several certs with same subject.
@@ -213,7 +222,7 @@ basicConstraints=CA:FALSE

 # PKIX recommendations harmless if included in all certificates.
 subjectKeyIdentifier=hash
-authorityKeyIdentifier=keyid,issuer
+authorityKeyIdentifier=keyid:nonss,issuer:nonss

 # This stuff is for subjectAltName and issuerAltname.
 # Import the email address.
@@ -236,16 +245,11 @@ basicConstraints = CA:FALSE
 keyUsage = nonRepudiation, digitalSignature, keyEncipherment

 [ v3_ca ]
-
-
 # Extensions for a typical CA

-
 # PKIX recommendation.
-
 subjectKeyIdentifier=hash
-
-authorityKeyIdentifier=keyid:always,issuer
+authorityKeyIdentifier=keyid:nonss,issuer:nonss

 basicConstraints = critical,CA:true

@@ -286,7 +290,8 @@ basicConstraints=CA:FALSE

 # PKIX recommendations harmless if included in all certificates.
 subjectKeyIdentifier=hash
-authorityKeyIdentifier=keyid,issuer
+# The issuer of a proxy certificate should have SKID.
+authorityKeyIdentifier=keyid:always

 # This stuff is for subjectAltName and issuerAltname.
 # Import the email address.
@@ -311,7 +316,6 @@ default_tsa = tsa_config1	# the default TSA section
 # These are used by the TSA reply generation only.
 dir		= sys\$disk:[.demoCA		# TSA root directory
 serial		= $dir]tsaserial.	# The current serial number (mandatory)
-crypto_device	= builtin		# OpenSSL engine to use for signing
 signer_cert	= $dir/tsacert.pem 	# The TSA signing certificate
 					# (optional)
 certs		= $dir.cacert.pem]	# Certificate chain to include in reply
diff --git a/deps/openssl/openssl/apps/openssl.c b/deps/openssl/openssl/apps/openssl.c
index 01ff8e24972..1b48e63bdc6 100644
--- a/deps/openssl/openssl/apps/openssl.c
+++ b/deps/openssl/openssl/apps/openssl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,10 +20,16 @@
 #include <openssl/x509.h>
 #include <openssl/pem.h>
 #include <openssl/ssl.h>
-#ifndef OPENSSL_NO_ENGINE
-#include <openssl/engine.h>
-#endif
 #include <openssl/err.h>
+
+#if defined __has_include
+/* Any compiler you're going to run valgrind on has this */
+#if __has_include(<valgrind/valgrind.h>)
+#include <valgrind/valgrind.h>
+#define OPENSSL_VALGRIND_H_INCLUDED
+#endif
+#endif /* defined(__has_include) */
+
 /* Needed to get the other O_xxx flags. */
 #ifdef OPENSSL_SYS_VMS
 #include <unixio.h>
@@ -54,7 +60,7 @@ static void warn_deprecated(const FUNCTION *fp)
         BIO_printf(bio_err, "The command %s is deprecated.", fp->name);
     if (strcmp(fp->deprecated_alternative, DEPRECATED_NO_ALTERNATIVE) != 0)
         BIO_printf(bio_err, " Use '%s' instead.", fp->deprecated_alternative);
-    BIO_printf(bio_err, "\n");
+    BIO_puts(bio_err, "\n");
 }

 static int apps_startup(void)
@@ -65,13 +71,10 @@ static int apps_startup(void)
 #endif

     /* Set non-default library initialisation settings */
-    if (!OPENSSL_init_ssl(OPENSSL_INIT_ENGINE_ALL_BUILTIN
-                | OPENSSL_INIT_LOAD_CONFIG,
-            NULL))
+    if (!OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, NULL))
         return 0;

     (void)setup_ui_method();
-    (void)setup_engine_loader();

     /*
      * NOTE: This is an undocumented feature required for testing only.
@@ -93,7 +96,6 @@ static void apps_shutdown(void)
 {
     app_providers_cleanup();
     OSSL_LIB_CTX_free(app_get0_libctx());
-    destroy_engine_loader();
     destroy_ui_method();
 }

@@ -114,14 +116,14 @@ static size_t internal_trace_cb(const char *buf, size_t cnt,
     switch (cmd) {
     case OSSL_TRACE_CTRL_BEGIN:
         if (trace_data->ingroup) {
-            BIO_printf(bio_err, "ERROR: tracing already started\n");
+            BIO_puts(bio_err, "ERROR: tracing already started\n");
             return 0;
         }
         trace_data->ingroup = 1;

         tid = CRYPTO_THREAD_get_current_id();
         hex = OPENSSL_buf2hexstr((const unsigned char *)&tid, sizeof(tid));
-        BIO_snprintf(buffer, sizeof(buffer), "TRACE[%s]:%s: ",
+        snprintf(buffer, sizeof(buffer), "TRACE[%s]:%s: ",
             hex == NULL ? "<null>" : hex,
             OSSL_trace_get_category_name(category));
         OPENSSL_free(hex);
@@ -129,15 +131,17 @@ static size_t internal_trace_cb(const char *buf, size_t cnt,
         break;
     case OSSL_TRACE_CTRL_WRITE:
         if (!trace_data->ingroup) {
-            BIO_printf(bio_err, "ERROR: writing when tracing not started\n");
+            BIO_puts(bio_err, "ERROR: writing when tracing not started\n");
             return 0;
         }
+        if (cnt > INT_MAX)
+            cnt = INT_MAX;

-        ret = BIO_write(trace_data->bio, buf, cnt);
+        ret = BIO_write(trace_data->bio, buf, (int)cnt);
         break;
     case OSSL_TRACE_CTRL_END:
         if (!trace_data->ingroup) {
-            BIO_printf(bio_err, "ERROR: finishing when tracing not started\n");
+            BIO_puts(bio_err, "ERROR: finishing when tracing not started\n");
             return 0;
         }
         trace_data->ingroup = 0;
@@ -191,6 +195,7 @@ static void setup_trace_category(int category)

         OSSL_trace_set_callback(category, NULL, NULL);
         BIO_free_all(channel);
+        OPENSSL_free(trace_data);
     }
 }

@@ -245,6 +250,10 @@ int main(int argc, char *argv[])
     int global_help = 0;
     int global_version = 0;
     int ret = 0;
+    char *sec_mem_char = NULL;
+#ifndef OPENSSL_NO_SECURE_MEMORY
+    char *sec_mem_minsize_char = NULL;
+#endif

     arg.argv = NULL;
     arg.size = 0;
@@ -265,6 +274,54 @@ int main(int argc, char *argv[])
     setup_trace(getenv("OPENSSL_TRACE"));
 #endif

+    sec_mem_char = getenv("OPENSSL_SEC_MEM");
+    if (sec_mem_char != NULL) {
+#ifndef OPENSSL_NO_SECURE_MEMORY
+        long sec_mem = 0;
+        long sec_mem_minsize = 0;
+        char *end = NULL;
+
+        errno = 0;
+        sec_mem = strtol(sec_mem_char, &end, 0);
+        if (errno != 0 || *end != 0 || end == sec_mem_char) {
+            BIO_printf(bio_err,
+                "FATAL: could not convert OPENSSL_SEC_MEM (%s) to number\n",
+                sec_mem_char);
+            ret = EXIT_FAILURE;
+            goto end;
+        }
+
+        /*
+         * Try to fetch the minsize if given, if not use the default value.
+         */
+        sec_mem_minsize_char = getenv("OPENSSL_SEC_MEM_MINSIZE");
+        if (sec_mem_minsize_char != NULL) {
+            errno = 0;
+            sec_mem_minsize = strtol(sec_mem_minsize_char, &end, 0);
+            if (errno != 0 || *end != 0 || end == sec_mem_minsize_char) {
+                BIO_printf(bio_err,
+                    "FATAL: could not convert OPENSSL_SEC_MEM_MINSIZE (%s) to number\n",
+                    sec_mem_minsize_char);
+                ret = 1;
+                goto end;
+            }
+        }
+
+        ret = CRYPTO_secure_malloc_init(sec_mem, sec_mem_minsize);
+        if (ret != 1) {
+            BIO_printf(bio_err,
+                "FATAL: could not initialize secure memory\n");
+            ERR_print_errors(bio_err);
+            ret = 1;
+            goto end;
+        }
+#else
+        BIO_printf(bio_err,
+            "FATAL: OPENSSL_SEC_MEM environment variable was set, but "
+            "openssl was compiled without secure memory support.\n");
+#endif
+    }
+
     if ((fname = "apps_startup", !apps_startup())
         || (fname = "prog_init", (prog = prog_init()) == NULL)) {
         BIO_printf(bio_err,
@@ -321,6 +378,35 @@ end:
     BIO_free_all(bio_out);
     apps_shutdown();
     BIO_free_all(bio_err);
+#ifndef OPENSSL_NO_SECURE_MEMORY
+    CRYPTO_secure_malloc_done();
+#endif
+
+#if defined(OPENSSL_VALGRIND_TEST)
+#if defined(OPENSSL_VALGRIND_H_INCLUDED)
+#if defined(RUNNING_ON_VALGRIND)
+    /*
+     * Enable special behaviour if we are compiled with
+     * OPENSSL_VALGRIND_TEST defined.
+     *
+     * Somewhat paradoxically, we do *NOT* want to clean up normally
+     * when running our tests using valgrind in order to test the
+     * suppression file which we will ship with the distribution. We
+     * set the OSSL_USE_VALGRIND environment variable for this
+     * purpose, but we only want to dodge cleanup when running under
+     * valgrind, *and* that environment variable is set. If you run
+     * this under valgrind without that environment variable set, it
+     * will still call OPENSSL_cleanup normally.
+     *
+     */
+    if (RUNNING_ON_VALGRIND && getenv("OSSL_USE_VALGRIND") != NULL)
+        EXIT(ret);
+#endif /* defined(RUNNING_ON_VALGRIND) */
+#else
+#error "OPENSSL_VALGRIND_TEST is defined, but <valgrind/valgrind.h> could not be included!"
+#endif /* defined(OPENSSL_VALGRIND_H_INCLUDED) */
+#endif /* defined(OPENSSL_VALGRIND_TEST) */
+    OPENSSL_cleanup();
     EXIT(ret);
 }

@@ -383,26 +469,26 @@ int help_main(int argc, char **argv)
     for (fp = functions; fp->name != NULL; fp++) {
         nl = 0;
         if (i++ % dc.columns == 0) {
-            BIO_printf(bio_err, "\n");
+            BIO_puts(bio_err, "\n");
             nl = 1;
         }
         if (fp->type != tp) {
             tp = fp->type;
             if (!nl)
-                BIO_printf(bio_err, "\n");
+                BIO_puts(bio_err, "\n");
             if (tp == FT_md) {
                 i = 1;
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "\nMessage Digest commands (see the `dgst' command for more details)\n");
             } else if (tp == FT_cipher) {
                 i = 1;
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "\nCipher commands (see the `enc' command for more details)\n");
             }
         }
         BIO_printf(bio_err, "%-*s", dc.width, fp->name);
     }
-    BIO_printf(bio_err, "\n\n");
+    BIO_puts(bio_err, "\n\n");
     return 0;
 }

@@ -416,11 +502,18 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
     f.name = argv[0];
     fp = lh_FUNCTION_retrieve(prog, &f);
     if (fp == NULL) {
-        if (EVP_get_digestbyname(argv[0])) {
+        EVP_MD *md = NULL;
+        EVP_CIPHER *cipher = NULL;
+
+        if ((md = EVP_MD_fetch(app_get0_libctx(), argv[0], app_get0_propq())) != NULL) {
+            EVP_MD_free(md);
+            md = NULL;
             f.type = FT_md;
             f.func = dgst_main;
             fp = &f;
-        } else if (EVP_get_cipherbyname(argv[0])) {
+        } else if ((cipher = EVP_CIPHER_fetch(app_get0_libctx(), argv[0], app_get0_propq())) != NULL) {
+            EVP_CIPHER_free(cipher);
+            cipher = NULL;
             f.type = FT_cipher;
             f.func = enc_main;
             fp = &f;
diff --git a/deps/openssl/openssl/apps/openssl.cnf b/deps/openssl/openssl/apps/openssl.cnf
index abace0ea7f1..03429af34a1 100644
--- a/deps/openssl/openssl/apps/openssl.cnf
+++ b/deps/openssl/openssl/apps/openssl.cnf
@@ -23,12 +23,22 @@ config_diagnostics = 1
 # oid_file       = $ENV::HOME/.oid
 oid_section = new_oids

-# To use this configuration file with the "-extfile" option of the
-# "openssl x509" utility, name here the section containing the
-# X.509v3 extensions to use:
-# extensions		=
-# (Alternatively, use a configuration file that has only
-# X.509v3 extensions in its main [= default] section.)
+# When present, The `extensions` setting of the default configuration file is
+# used by the `openssl-x509(1)` "mini-CA" as a list of extensions to add to
+# each newly signed certificate.  See the descriptions of the `-extfile` and
+# `-extensions` options for details in the documentation.
+#
+# The below setting arranges for `openssl-x509(1)` to add
+# subjectKeyIdentifier and authorityKeyIdentifier extensions by default.
+#
+extensions = default_skid_akid
+
+[ default_skid_akid ]
+# Always a subjectKeyIdentifier
+subjectKeyIdentifier = hash
+# Only if the certificate is not self-signed, with the issuer+serial only as a
+# fallback if no issuer keyid is available.
+authorityKeyIdentifier = keyid:nonss,issuer:nonss

 [ new_oids ]
 # We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
@@ -81,7 +91,6 @@ default_ca	= CA_default		# The default ca section

 dir		= ./demoCA		# Where everything is kept
 certs		= $dir/certs		# Where the issued certs are kept
-crl_dir		= $dir/crl		# Where the issued crl are kept
 database	= $dir/index.txt	# database index file.
 #unique_subject	= no			# Set to 'no' to allow creation of
 					# several certs with same subject.
@@ -213,7 +222,7 @@ basicConstraints=CA:FALSE

 # PKIX recommendations harmless if included in all certificates.
 subjectKeyIdentifier=hash
-authorityKeyIdentifier=keyid,issuer
+authorityKeyIdentifier=keyid:nonss,issuer:nonss

 # This stuff is for subjectAltName and issuerAltname.
 # Import the email address.
@@ -236,16 +245,11 @@ basicConstraints = CA:FALSE
 keyUsage = nonRepudiation, digitalSignature, keyEncipherment

 [ v3_ca ]
-
-
 # Extensions for a typical CA

-
 # PKIX recommendation.
-
 subjectKeyIdentifier=hash
-
-authorityKeyIdentifier=keyid:always,issuer
+authorityKeyIdentifier=keyid:nonss,issuer:nonss

 basicConstraints = critical,CA:true

@@ -286,7 +290,8 @@ basicConstraints=CA:FALSE

 # PKIX recommendations harmless if included in all certificates.
 subjectKeyIdentifier=hash
-authorityKeyIdentifier=keyid,issuer
+# The issuer of a proxy certificate should have SKID.
+authorityKeyIdentifier=keyid:always

 # This stuff is for subjectAltName and issuerAltname.
 # Import the email address.
@@ -311,7 +316,6 @@ default_tsa = tsa_config1	# the default TSA section
 # These are used by the TSA reply generation only.
 dir		= ./demoCA		# TSA root directory
 serial		= $dir/tsaserial	# The current serial number (mandatory)
-crypto_device	= builtin		# OpenSSL engine to use for signing
 signer_cert	= $dir/tsacert.pem 	# The TSA signing certificate
 					# (optional)
 certs		= $dir/cacert.pem	# Certificate chain to include in reply
diff --git a/deps/openssl/openssl/apps/passwd.c b/deps/openssl/openssl/apps/passwd.c
index fd4725b2a43..a2fff324aaf 100644
--- a/deps/openssl/openssl/apps/passwd.c
+++ b/deps/openssl/openssl/apps/passwd.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,7 @@
  * https://www.openssl.org/source/license.html
  */

+#include <stdio.h>
 #include <string.h>

 #include "apps.h"
@@ -196,7 +197,6 @@ int passwd_main(int argc, char **argv)
     }

     /* All remaining arguments are the password text */
-    argc = opt_num_rest();
     argv = opt_rest();
     if (*argv != NULL) {
         if (pw_source_defined)
@@ -249,7 +249,7 @@ int passwd_main(int argc, char **argv)

             passwds = passwds_static;
             if (in == NULL) {
-                if (EVP_read_pw_string(passwd_malloc, passwd_malloc_size, "Password: ",
+                if (EVP_read_pw_string(passwd_malloc, (int)passwd_malloc_size, "Password: ",
                         !(passed_salt || in_noverify))
                     != 0)
                     goto end;
@@ -257,7 +257,7 @@ int passwd_main(int argc, char **argv)
             passwds[0] = passwd_malloc;
         } else {
 #endif
-            BIO_printf(bio_err, "password required\n");
+            BIO_puts(bio_err, "password required\n");
             goto end;
         }
     }
@@ -278,7 +278,7 @@ int passwd_main(int argc, char **argv)

         assert(passwd != NULL);
         do {
-            int r = BIO_gets(in, passwd, pw_maxlen + 1);
+            int r = BIO_gets(in, passwd, (int)(pw_maxlen + 1));
             if (r > 0) {
                 char *c = (strchr(passwd, '\n'));
                 if (c != NULL) {
@@ -403,14 +403,14 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
         || !EVP_DigestFinal_ex(md2, buf, NULL))
         goto err;

-    for (i = passwd_len; i > sizeof(buf); i -= sizeof(buf)) {
+    for (i = (unsigned int)passwd_len; i > sizeof(buf); i -= sizeof(buf)) {
         if (!EVP_DigestUpdate(md, buf, sizeof(buf)))
             goto err;
     }
     if (!EVP_DigestUpdate(md, buf, i))
         goto err;

-    n = passwd_len;
+    n = (int)passwd_len;
     while (n) {
         if (!EVP_DigestUpdate(md, (n & 1) ? "\0" : passwd, 1))
             goto err;
@@ -595,7 +595,7 @@ static char *shacrypt(const char *passwd, const char *magic, const char *salt)
     if (rounds_custom) {
         char tmp_buf[80]; /* "rounds=999999999" */

-        BIO_snprintf(tmp_buf, sizeof(tmp_buf), "rounds=%u", rounds);
+        snprintf(tmp_buf, sizeof(tmp_buf), "rounds=%u", rounds);
 #ifdef CHARSET_EBCDIC
         /* In case we're really on a ASCII based platform and just pretend */
         if (tmp_buf[0] != 0x72) /* ASCII 'r' */
@@ -803,7 +803,7 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,

         if (*salt_malloc_p == NULL)
             *salt_p = *salt_malloc_p = app_malloc(saltlen + 1, "salt buffer");
-        if (RAND_bytes((unsigned char *)*salt_p, saltlen) <= 0)
+        if (RAND_bytes((unsigned char *)*salt_p, (int)saltlen) <= 0)
             goto end;

         for (i = 0; i < saltlen; i++)
diff --git a/deps/openssl/openssl/apps/pkcs12.c b/deps/openssl/openssl/apps/pkcs12.c
index 2c83e43845d..2deb87a1f87 100644
--- a/deps/openssl/openssl/apps/pkcs12.c
+++ b/deps/openssl/openssl/apps/pkcs12.c
@@ -51,7 +51,7 @@ int dump_certs_pkeys_bag(BIO *out, const PKCS12_SAFEBAG *bags,
 void print_attribute(BIO *out, const ASN1_TYPE *av);
 int print_attribs(BIO *out, const STACK_OF(X509_ATTRIBUTE) *attrlst,
     const char *name);
-void hex_prin(BIO *out, unsigned char *buf, int len);
+static void hex_print(BIO *out, const unsigned char *buf, int len);
 static int alg_print(const X509_ALGOR *alg);
 int cert_load(BIO *in, STACK_OF(X509) *sk);
 static int set_pbe(int *ppbe, const char *str);
@@ -105,7 +105,6 @@ typedef enum OPTION_choice {
     OPT_NOCAPATH,
     OPT_NOCAFILE,
     OPT_NOCASTORE,
-    OPT_ENGINE,
     OPT_R_ENUM,
     OPT_PROV_ENUM,
     OPT_JDKTRUST,
@@ -136,9 +135,6 @@ const OPTIONS pkcs12_options[] = {
         "Use legacy encryption: 3DES_CBC for keys, RC2_CBC for certs"
 #endif
     },
-#endif
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
 #endif
     OPT_PROV_OPTIONS,
     OPT_R_OPTIONS,
@@ -161,9 +157,9 @@ const OPTIONS pkcs12_options[] = {
     { OPT_MORE_STR, 0, 0,
         "which is the 1st cert from -in matching the private key (if given)" },
     { "untrusted", OPT_UNTRUSTED, '<', "Untrusted certificates for chain building" },
-    { "CAfile", OPT_CAFILE, '<', "PEM-format file of CA's" },
-    { "CApath", OPT_CAPATH, '/', "PEM-format directory of CA's" },
-    { "CAstore", OPT_CASTORE, ':', "URI to store of CA's" },
+    { "CAfile", OPT_CAFILE, '<', "File in PEM format with trusted CA certs" },
+    { "CApath", OPT_CAPATH, '/', "Dir with trusted CA cert files in PEM format" },
+    { "CAstore", OPT_CASTORE, ':', "URI of store with trusted CA certs" },
     { "no-CAfile", OPT_NOCAFILE, '-',
         "Do not load the default certificates file" },
     { "no-CApath", OPT_NOCAPATH, '-',
@@ -223,7 +219,6 @@ int pkcs12_main(int argc, char **argv)
     char *cpass = NULL, *mpass = NULL, *badpass = NULL;
     const char *CApath = NULL, *CAfile = NULL, *CAstore = NULL, *prog;
     int noCApath = 0, noCAfile = 0, noCAstore = 0;
-    ENGINE *e = NULL;
     BIO *in = NULL, *out = NULL;
     PKCS12 *p12 = NULL;
     STACK_OF(OPENSSL_STRING) *canames = NULL;
@@ -404,9 +399,6 @@ int pkcs12_main(int argc, char **argv)
         case OPT_NOCAFILE:
             noCAfile = 1;
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
 #ifndef OPENSSL_NO_DES
         case OPT_LEGACY_ALG:
             use_legacy = 1;
@@ -521,7 +513,7 @@ int pkcs12_main(int argc, char **argv)
     private = 1;

     if (!app_passwd(passcertsarg, NULL, &passcerts, NULL)) {
-        BIO_printf(bio_err, "Error getting certificate file password\n");
+        BIO_puts(bio_err, "Error getting certificate file password\n");
         goto end;
     }

@@ -533,7 +525,7 @@ int pkcs12_main(int argc, char **argv)
     }

     if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
-        BIO_printf(bio_err, "Error getting passwords\n");
+        BIO_puts(bio_err, "Error getting passwords\n");
         goto end;
     }

@@ -549,9 +541,9 @@ int pkcs12_main(int argc, char **argv)
         noprompt = 1;
         if (twopass) {
             if (export_pkcs12)
-                BIO_printf(bio_err, "Option -twopass cannot be used with -passout or -password\n");
+                BIO_puts(bio_err, "Option -twopass cannot be used with -passout or -password\n");
             else
-                BIO_printf(bio_err, "Option -twopass cannot be used with -passin or -password\n");
+                BIO_puts(bio_err, "Option -twopass cannot be used with -passin or -password\n");
             goto end;
         }
     } else {
@@ -565,12 +557,12 @@ int pkcs12_main(int argc, char **argv)
 #ifndef OPENSSL_NO_UI_CONSOLE
             if (EVP_read_pw_string(
                     macpass, sizeof(macpass), "Enter MAC Password:", export_pkcs12)) {
-                BIO_printf(bio_err, "Can't read Password\n");
+                BIO_puts(bio_err, "Can't read Password\n");
                 goto end;
             }
         } else {
 #endif
-            BIO_printf(bio_err, "Unsupported option -twopass\n");
+            BIO_puts(bio_err, "Unsupported option -twopass\n");
             goto end;
         }
     }
@@ -586,18 +578,18 @@ int pkcs12_main(int argc, char **argv)
         ASN1_OBJECT *obj = NULL;

         if ((options & (NOCERTS | NOKEYS)) == (NOCERTS | NOKEYS)) {
-            BIO_printf(bio_err, "Nothing to export due to -noout or -nocerts and -nokeys\n");
+            BIO_puts(bio_err, "Nothing to export due to -noout or -nocerts and -nokeys\n");
             goto export_end;
         }

         if ((options & NOCERTS) != 0) {
             chain = 0;
-            BIO_printf(bio_err, "Warning: -chain option ignored with -nocerts\n");
+            BIO_puts(bio_err, "Warning: -chain option ignored with -nocerts\n");
         }

         if (!(options & NOKEYS)) {
             key = load_key(keyname ? keyname : infile,
-                FORMAT_PEM, 1, passin, e,
+                FORMAT_PEM, 1, passin,
                 keyname ? "private key from -inkey file" : "private key from -in file");
             if (key == NULL)
                 goto export_end;
@@ -655,7 +647,7 @@ int pkcs12_main(int argc, char **argv)
                 ee_cert_tmp = sk_X509_value(certs, 0);

             if (ee_cert_tmp == NULL) {
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "No end entity certificate to check with -chain\n");
                 goto export_end;
             }
@@ -712,12 +704,12 @@ int pkcs12_main(int argc, char **argv)
 #ifndef OPENSSL_NO_UI_CONSOLE
                 if (EVP_read_pw_string(pass, sizeof(pass),
                         "Enter Export Password:", 1)) {
-                    BIO_printf(bio_err, "Can't read Password\n");
+                    BIO_puts(bio_err, "Can't read Password\n");
                     goto export_end;
                 }
             } else {
 #endif
-                BIO_printf(bio_err, "Password required\n");
+                BIO_puts(bio_err, "Password required\n");
                 goto export_end;
             }
         }
@@ -750,14 +742,13 @@ int pkcs12_main(int argc, char **argv)
                 if (!PKCS12_set_pbmac1_pbkdf2(p12, mpass, -1, NULL,
                         macsaltlen, maciter,
                         macmd, pbmac1_pbkdf2_md)) {
-                    BIO_printf(bio_err, "Error creating PBMAC1\n");
+                    BIO_puts(bio_err, "Error creating PBMAC1\n");
                     goto export_end;
                 }
             } else {
                 if (!PKCS12_set_mac(p12, mpass, -1, NULL, macsaltlen, maciter, macmd)) {
-                    BIO_printf(bio_err, "Error creating PKCS12 MAC; no PKCS12KDF support?\n");
-                    BIO_printf(bio_err,
-                        "Use -nomac or -pbmac1_pbkdf2 if PKCS12KDF support not available\n");
+                    BIO_puts(bio_err, "Error creating PKCS12 MAC; no PKCS12KDF support?\n"
+                                      "Use -nomac or -pbmac1_pbkdf2 if PKCS12KDF support not available\n");
                     goto export_end;
                 }
             }
@@ -803,12 +794,12 @@ int pkcs12_main(int argc, char **argv)
 #ifndef OPENSSL_NO_UI_CONSOLE
             if (EVP_read_pw_string(pass, sizeof(pass), "Enter Import Password:",
                     0)) {
-                BIO_printf(bio_err, "Can't read Password\n");
+                BIO_puts(bio_err, "Can't read Password\n");
                 goto end;
             }
         } else {
 #endif
-            BIO_printf(bio_err, "Password required\n");
+            BIO_puts(bio_err, "Password required\n");
             goto end;
         }
     }
@@ -833,7 +824,7 @@ int pkcs12_main(int argc, char **argv)
             PBKDF2PARAM *pbkdf2_param = PBMAC1_get1_pbkdf2_param(macalgid);

             if (pbkdf2_param == NULL) {
-                BIO_printf(bio_err, ", Unsupported KDF or params for PBMAC1\n");
+                BIO_puts(bio_err, ", Unsupported KDF or params for PBMAC1\n");
             } else {
                 const ASN1_OBJECT *prfobj;
                 int prfnid;
@@ -842,7 +833,7 @@ int pkcs12_main(int argc, char **argv)
                     ASN1_INTEGER_get(pbkdf2_param->iter));
                 BIO_printf(bio_err, "Key length: %ld, Salt length: %d\n",
                     ASN1_INTEGER_get(pbkdf2_param->keylength),
-                    ASN1_STRING_length(pbkdf2_param->salt->value.octet_string));
+                    (int)ASN1_STRING_get_length(pbkdf2_param->salt->value.octet_string));
                 if (pbkdf2_param->prf == NULL) {
                     prfnid = NID_hmacWithSHA1;
                 } else {
@@ -856,8 +847,8 @@ int pkcs12_main(int argc, char **argv)
             BIO_printf(bio_err, ", Iteration %ld\n",
                 tmaciter != NULL ? ASN1_INTEGER_get(tmaciter) : 1L);
             BIO_printf(bio_err, "MAC length: %ld, salt length: %ld\n",
-                tmac != NULL ? ASN1_STRING_length(tmac) : 0L,
-                tsalt != NULL ? ASN1_STRING_length(tsalt) : 0L);
+                tmac != NULL ? (long)ASN1_STRING_get_length(tmac) : 0L,
+                tsalt != NULL ? (long)ASN1_STRING_get_length(tsalt) : 0L);
         }
     }

@@ -868,7 +859,7 @@ int pkcs12_main(int argc, char **argv)
         PKCS12_get0_mac(NULL, &macalgid, NULL, NULL, p12);

         if (macalgid == NULL) {
-            BIO_printf(bio_err, "Warning: MAC is absent!\n");
+            BIO_puts(bio_err, "Warning: MAC is absent!\n");
             goto dump;
         }

@@ -880,8 +871,8 @@ int pkcs12_main(int argc, char **argv)
             pkcs12kdf = EVP_KDF_fetch(app_get0_libctx(), "PKCS12KDF",
                 app_get0_propq());
             if (pkcs12kdf == NULL) {
-                BIO_printf(bio_err, "Error verifying PKCS12 MAC; no PKCS12KDF support.\n");
-                BIO_printf(bio_err, "Use -nomacver if MAC verification is not required.\n");
+                BIO_puts(bio_err, "Error verifying PKCS12 MAC; no PKCS12KDF support.\n");
+                BIO_puts(bio_err, "Use -nomacver if MAC verification is not required.\n");
                 goto end;
             }
             EVP_KDF_free(pkcs12kdf);
@@ -904,7 +895,7 @@ int pkcs12_main(int argc, char **argv)

             if (ERR_GET_LIB(err) == ERR_LIB_PKCS12
                 && ERR_GET_REASON(err) == PKCS12_R_MAC_ABSENT) {
-                BIO_printf(bio_err, "Warning: MAC is absent!\n");
+                BIO_puts(bio_err, "Warning: MAC is absent!\n");
                 goto dump;
             }

@@ -919,12 +910,13 @@ int pkcs12_main(int argc, char **argv)
                 goto end;
             }
             OPENSSL_free(utmp);
-            if (!PKCS12_verify_mac(p12, badpass, -1)) {
-                BIO_printf(bio_err, "Mac verify error: invalid password?\n");
+            if (strcmp(mpass, badpass) == 0 || !PKCS12_verify_mac(p12, badpass, -1)) {
+                if (ERR_peek_error() == 0)
+                    BIO_puts(bio_err, "Mac verify error: invalid password?\n");
                 ERR_print_errors(bio_err);
                 goto end;
             } else {
-                BIO_printf(bio_err, "Warning: using broken algorithm\n");
+                BIO_puts(bio_err, "Warning: using broken algorithm\n");
                 if (!twopass)
                     cpass = badpass;
             }
@@ -939,14 +931,13 @@ dump:
         goto end;

     if (!dump_certs_keys_p12(out, p12, cpass, -1, options, passout, enc)) {
-        BIO_printf(bio_err, "Error outputting keys and certificates\n");
+        BIO_puts(bio_err, "Error outputting keys and certificates\n");
         ERR_print_errors(bio_err);
         goto end;
     }
     ret = 0;
 end:
     PKCS12_free(p12);
-    release_engine(e);
     BIO_free(in);
     BIO_free_all(out);
     sk_OPENSSL_STRING_free(canames);
@@ -1001,12 +992,12 @@ int dump_certs_keys_p12(BIO *out, const PKCS12 *p12, const char *pass,
         if (bagnid == NID_pkcs7_data) {
             bags = PKCS12_unpack_p7data(p7);
             if (options & INFO)
-                BIO_printf(bio_err, "PKCS7 Data\n");
+                BIO_puts(bio_err, "PKCS7 Data\n");
         } else if (bagnid == NID_pkcs7_encrypted) {
             if (options & INFO) {
-                BIO_printf(bio_err, "PKCS7 Encrypted data: ");
+                BIO_puts(bio_err, "PKCS7 Encrypted data: ");
                 if (p7->d.encrypted == NULL) {
-                    BIO_printf(bio_err, "<no data>\n");
+                    BIO_puts(bio_err, "<no data>\n");
                 } else {
                     alg_print(p7->d.encrypted->enc_data->algorithm);
                 }
@@ -1061,7 +1052,7 @@ int dump_certs_pkeys_bag(BIO *out, const PKCS12_SAFEBAG *bag,
     switch (PKCS12_SAFEBAG_get_nid(bag)) {
     case NID_keyBag:
         if (options & INFO)
-            BIO_printf(bio_err, "Key bag\n");
+            BIO_puts(bio_err, "Key bag\n");
         if (options & NOKEYS)
             return 1;
         print_attribs(out, attrs, "Bag Attributes");
@@ -1078,7 +1069,7 @@ int dump_certs_pkeys_bag(BIO *out, const PKCS12_SAFEBAG *bag,
             const X509_SIG *tp8;
             const X509_ALGOR *tp8alg;

-            BIO_printf(bio_err, "Shrouded Keybag: ");
+            BIO_puts(bio_err, "Shrouded Keybag: ");
             tp8 = PKCS12_SAFEBAG_get0_pkcs8(bag);
             X509_SIG_get0(tp8, &tp8alg, NULL);
             alg_print(tp8alg);
@@ -1100,7 +1091,7 @@ int dump_certs_pkeys_bag(BIO *out, const PKCS12_SAFEBAG *bag,

     case NID_certBag:
         if (options & INFO)
-            BIO_printf(bio_err, "Certificate bag\n");
+            BIO_puts(bio_err, "Certificate bag\n");
         if (options & NOCERTS)
             return 1;
         if (PKCS12_SAFEBAG_get0_attr(bag, NID_localKeyID)) {
@@ -1120,25 +1111,25 @@ int dump_certs_pkeys_bag(BIO *out, const PKCS12_SAFEBAG *bag,

     case NID_secretBag:
         if (options & INFO)
-            BIO_printf(bio_err, "Secret bag\n");
+            BIO_puts(bio_err, "Secret bag\n");
         print_attribs(out, attrs, "Bag Attributes");
-        BIO_printf(bio_err, "Bag Type: ");
+        BIO_puts(bio_err, "Bag Type: ");
         i2a_ASN1_OBJECT(bio_err, PKCS12_SAFEBAG_get0_bag_type(bag));
-        BIO_printf(bio_err, "\nBag Value: ");
+        BIO_puts(bio_err, "\nBag Value: ");
         print_attribute(out, PKCS12_SAFEBAG_get0_bag_obj(bag));
         return 1;

     case NID_safeContentsBag:
         if (options & INFO)
-            BIO_printf(bio_err, "Safe Contents bag\n");
+            BIO_puts(bio_err, "Safe Contents bag\n");
         print_attribs(out, attrs, "Bag Attributes");
         return dump_certs_pkeys_bags(out, PKCS12_SAFEBAG_get0_safes(bag),
             pass, passlen, options, pempass, enc);

     default:
-        BIO_printf(bio_err, "Warning unsupported bag type: ");
+        BIO_puts(bio_err, "Warning unsupported bag type: ");
         i2a_ASN1_OBJECT(bio_err, PKCS12_SAFEBAG_get0_type(bag));
-        BIO_printf(bio_err, "\n");
+        BIO_puts(bio_err, "\n");
         return 1;
     }
     return ret;
@@ -1186,7 +1177,8 @@ static int alg_print(const X509_ALGOR *alg)

     pbenid = OBJ_obj2nid(aoid);

-    BIO_printf(bio_err, "%s", OBJ_nid2ln(pbenid));
+    const char *ln = OBJ_nid2ln(pbenid);
+    BIO_puts(bio_err, (ln != NULL) ? ln : "(null)");

     /*
      * If PBE algorithm is PBES2 decode algorithm parameters
@@ -1239,7 +1231,7 @@ static int alg_print(const X509_ALGOR *alg)
             }
             BIO_printf(bio_err, ", Salt length: %d, Cost(N): %ld, "
                                 "Block size(r): %ld, Parallelism(p): %ld",
-                ASN1_STRING_length(kdf->salt),
+                (int)ASN1_STRING_get_length(kdf->salt),
                 ASN1_INTEGER_get(kdf->costParameter),
                 ASN1_INTEGER_get(kdf->blockSize),
                 ASN1_INTEGER_get(kdf->parallelizationParameter));
@@ -1289,27 +1281,29 @@ void print_attribute(BIO *out, const ASN1_TYPE *av)

     switch (av->type) {
     case V_ASN1_BMPSTRING:
-        value = OPENSSL_uni2asc(av->value.bmpstring->data,
-            av->value.bmpstring->length);
+        value = OPENSSL_uni2asc(ASN1_STRING_get0_data(av->value.bmpstring),
+            (int)ASN1_STRING_get_length(av->value.bmpstring));
         BIO_printf(out, "%s\n", value);
         OPENSSL_free(value);
         break;

     case V_ASN1_UTF8STRING:
-        BIO_printf(out, "%.*s\n", av->value.utf8string->length,
-            av->value.utf8string->data);
+        BIO_printf(out, "%.*s\n", (int)ASN1_STRING_get_length(av->value.utf8string),
+            ASN1_STRING_get_length(av->value.utf8string)
+                ? ASN1_STRING_get0_data(av->value.utf8string)
+                : (const unsigned char *)"");
         break;

     case V_ASN1_OCTET_STRING:
-        hex_prin(out, av->value.octet_string->data,
-            av->value.octet_string->length);
-        BIO_printf(out, "\n");
+        hex_print(out, ASN1_STRING_get0_data(av->value.octet_string),
+            (int)ASN1_STRING_get_length(av->value.octet_string));
+        BIO_puts(out, "\n");
         break;

     case V_ASN1_BIT_STRING:
-        hex_prin(out, av->value.bit_string->data,
-            av->value.bit_string->length);
-        BIO_printf(out, "\n");
+        hex_print(out, ASN1_STRING_get0_data(av->value.bit_string),
+            (int)ASN1_STRING_get_length(av->value.bit_string));
+        BIO_puts(out, "\n");
         break;

     case V_ASN1_OBJECT:
@@ -1317,8 +1311,7 @@ void print_attribute(BIO *out, const ASN1_TYPE *av)
         if (!ln)
             ln = "";
         OBJ_obj2txt(objbuf, sizeof(objbuf), av->value.object, 1);
-        BIO_printf(out, "%s (%s)", ln, objbuf);
-        BIO_printf(out, "\n");
+        BIO_printf(out, "%s (%s)\n", ln, objbuf);
         break;

     default:
@@ -1333,7 +1326,7 @@ int print_attribs(BIO *out, const STACK_OF(X509_ATTRIBUTE) *attrlst,
     const char *name)
 {
     X509_ATTRIBUTE *attr;
-    ASN1_TYPE *av;
+    const ASN1_TYPE *av;
     int i, j, attr_nid;
     if (!attrlst) {
         BIO_printf(out, "%s: <No Attributes>\n", name);
@@ -1345,14 +1338,14 @@ int print_attribs(BIO *out, const STACK_OF(X509_ATTRIBUTE) *attrlst,
     }
     BIO_printf(out, "%s\n", name);
     for (i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
-        ASN1_OBJECT *attr_obj;
+        const ASN1_OBJECT *attr_obj;
         attr = sk_X509_ATTRIBUTE_value(attrlst, i);
         attr_obj = X509_ATTRIBUTE_get0_object(attr);
         attr_nid = OBJ_obj2nid(attr_obj);
-        BIO_printf(out, "    ");
+        BIO_puts(out, "    ");
         if (attr_nid == NID_undef) {
             i2a_ASN1_OBJECT(out, attr_obj);
-            BIO_printf(out, ": ");
+            BIO_puts(out, ": ");
         } else {
             BIO_printf(out, "%s: ", OBJ_nid2ln(attr_nid));
         }
@@ -1363,13 +1356,13 @@ int print_attribs(BIO *out, const STACK_OF(X509_ATTRIBUTE) *attrlst,
                 print_attribute(out, av);
             }
         } else {
-            BIO_printf(out, "<No Values>\n");
+            BIO_puts(out, "<No Values>\n");
         }
     }
     return 1;
 }

-void hex_prin(BIO *out, unsigned char *buf, int len)
+static void hex_print(BIO *out, const unsigned char *buf, int len)
 {
     int i;
     for (i = 0; i < len; i++)
diff --git a/deps/openssl/openssl/apps/pkcs7.c b/deps/openssl/openssl/apps/pkcs7.c
index 26f8d48fc24..ce652cbe762 100644
--- a/deps/openssl/openssl/apps/pkcs7.c
+++ b/deps/openssl/openssl/apps/pkcs7.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -31,16 +31,12 @@ typedef enum OPTION_choice {
     OPT_PRINT,
     OPT_PRINT_CERTS,
     OPT_QUIET,
-    OPT_ENGINE,
     OPT_PROV_ENUM
 } OPTION_CHOICE;

 const OPTIONS pkcs7_options[] = {
     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif

     OPT_SECTION("Input"),
     { "in", OPT_IN, '<', "Input file" },
@@ -63,7 +59,6 @@ const OPTIONS pkcs7_options[] = {

 int pkcs7_main(int argc, char **argv)
 {
-    ENGINE *e = NULL;
     PKCS7 *p7 = NULL, *p7i;
     BIO *in = NULL, *out = NULL;
     int informat = FORMAT_PEM, outformat = FORMAT_PEM;
@@ -113,9 +108,6 @@ int pkcs7_main(int argc, char **argv)
         case OPT_QUIET:
             quiet = 1;
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_PROV_CASES:
             if (!opt_provider(o))
                 goto end;
@@ -133,7 +125,7 @@ int pkcs7_main(int argc, char **argv)

     p7 = PKCS7_new_ex(libctx, app_get0_propq());
     if (p7 == NULL) {
-        BIO_printf(bio_err, "unable to allocate PKCS7 object\n");
+        BIO_puts(bio_err, "unable to allocate PKCS7 object\n");
         ERR_print_errors(bio_err);
         goto end;
     }
@@ -143,7 +135,7 @@ int pkcs7_main(int argc, char **argv)
     else
         p7i = PEM_read_bio_PKCS7(in, &p7, NULL, NULL);
     if (p7i == NULL) {
-        BIO_printf(bio_err, "unable to load PKCS7 object\n");
+        BIO_puts(bio_err, "unable to load PKCS7 object\n");
         ERR_print_errors(bio_err);
         goto end;
     }
@@ -217,7 +209,7 @@ int pkcs7_main(int argc, char **argv)
             i = PEM_write_bio_PKCS7(out, p7);

         if (!i) {
-            BIO_printf(bio_err, "unable to write pkcs7 object\n");
+            BIO_puts(bio_err, "unable to write pkcs7 object\n");
             ERR_print_errors(bio_err);
             goto end;
         }
@@ -225,7 +217,6 @@ int pkcs7_main(int argc, char **argv)
     ret = 0;
 end:
     PKCS7_free(p7);
-    release_engine(e);
     BIO_free(in);
     BIO_free_all(out);
     return ret;
diff --git a/deps/openssl/openssl/apps/pkcs8.c b/deps/openssl/openssl/apps/pkcs8.c
index a47f05de58f..e792bedfeb3 100644
--- a/deps/openssl/openssl/apps/pkcs8.c
+++ b/deps/openssl/openssl/apps/pkcs8.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -24,7 +24,6 @@ typedef enum OPTION_choice {
     OPT_COMMON,
     OPT_INFORM,
     OPT_OUTFORM,
-    OPT_ENGINE,
     OPT_IN,
     OPT_OUT,
     OPT_TOPK8,
@@ -51,9 +50,6 @@ typedef enum OPTION_choice {
 const OPTIONS pkcs8_options[] = {
     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif
     { "v1", OPT_V1, 's', "Use PKCS#5 v1.5 and cipher" },
     { "v2", OPT_V2, 's', "Use PKCS#5 v2.0 and cipher" },
     { "v2prf", OPT_V2PRF, 's', "Set the PRF algorithm to use with PKCS#5 v2.0" },
@@ -90,7 +86,6 @@ const OPTIONS pkcs8_options[] = {
 int pkcs8_main(int argc, char **argv)
 {
     BIO *in = NULL, *out = NULL;
-    ENGINE *e = NULL;
     EVP_PKEY *pkey = NULL;
     PKCS8_PRIV_KEY_INFO *p8inf = NULL;
     X509_SIG *p8 = NULL;
@@ -186,9 +181,6 @@ int pkcs8_main(int argc, char **argv)
         case OPT_PASSOUT:
             passoutarg = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
 #ifndef OPENSSL_NO_SCRYPT
         case OPT_SCRYPT:
             scrypt_N = 16384;
@@ -231,7 +223,7 @@ int pkcs8_main(int argc, char **argv)
     }

     if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
-        BIO_printf(bio_err, "Error getting passwords\n");
+        BIO_puts(bio_err, "Error getting passwords\n");
         goto end;
     }

@@ -244,11 +236,11 @@ int pkcs8_main(int argc, char **argv)
         goto end;

     if (topk8) {
-        pkey = load_key(infile, informat, 1, passin, e, "key");
+        pkey = load_key(infile, informat, 1, passin, "key");
         if (pkey == NULL)
             goto end;
         if ((p8inf = EVP_PKEY2PKCS8(pkey)) == NULL) {
-            BIO_printf(bio_err, "Error converting key\n");
+            BIO_puts(bio_err, "Error converting key\n");
             ERR_print_errors(bio_err);
             goto end;
         }
@@ -261,7 +253,7 @@ int pkcs8_main(int argc, char **argv)
             } else if (outformat == FORMAT_ASN1) {
                 i2d_PKCS8_PRIV_KEY_INFO_bio(out, p8inf);
             } else {
-                BIO_printf(bio_err, "Bad format specified for key\n");
+                BIO_puts(bio_err, "Bad format specified for key\n");
                 goto end;
             }
         } else {
@@ -279,7 +271,7 @@ int pkcs8_main(int argc, char **argv)
                 pbe = PKCS5_pbe_set(pbe_nid, iter, NULL, saltlen);
             }
             if (pbe == NULL) {
-                BIO_printf(bio_err, "Error setting PBE algorithm\n");
+                BIO_puts(bio_err, "Error setting PBE algorithm\n");
                 ERR_print_errors(bio_err);
                 goto end;
             }
@@ -295,13 +287,13 @@ int pkcs8_main(int argc, char **argv)
                 }
             } else {
 #endif
-                BIO_printf(bio_err, "Password required\n");
+                BIO_puts(bio_err, "Password required\n");
                 goto end;
             }
-            p8 = PKCS8_set0_pbe(p8pass, strlen(p8pass), p8inf, pbe);
+            p8 = PKCS8_set0_pbe(p8pass, (int)strlen(p8pass), p8inf, pbe);
             if (p8 == NULL) {
                 X509_ALGOR_free(pbe);
-                BIO_printf(bio_err, "Error encrypting key\n");
+                BIO_puts(bio_err, "Error encrypting key\n");
                 ERR_print_errors(bio_err);
                 goto end;
             }
@@ -311,7 +303,7 @@ int pkcs8_main(int argc, char **argv)
             else if (outformat == FORMAT_ASN1)
                 i2d_PKCS8_bio(out, p8);
             else {
-                BIO_printf(bio_err, "Bad format specified for key\n");
+                BIO_puts(bio_err, "Bad format specified for key\n");
                 goto end;
             }
         }
@@ -326,7 +318,7 @@ int pkcs8_main(int argc, char **argv)
         } else if (informat == FORMAT_ASN1) {
             p8inf = d2i_PKCS8_PRIV_KEY_INFO_bio(in, NULL);
         } else {
-            BIO_printf(bio_err, "Bad format specified for key\n");
+            BIO_puts(bio_err, "Bad format specified for key\n");
             goto end;
         }
     } else {
@@ -335,12 +327,12 @@ int pkcs8_main(int argc, char **argv)
         } else if (informat == FORMAT_ASN1) {
             p8 = d2i_PKCS8_bio(in, NULL);
         } else {
-            BIO_printf(bio_err, "Bad format specified for key\n");
+            BIO_puts(bio_err, "Bad format specified for key\n");
             goto end;
         }

         if (p8 == NULL) {
-            BIO_printf(bio_err, "Error reading key\n");
+            BIO_puts(bio_err, "Error reading key\n");
             ERR_print_errors(bio_err);
             goto end;
         }
@@ -350,25 +342,25 @@ int pkcs8_main(int argc, char **argv)
 #ifndef OPENSSL_NO_UI_CONSOLE
             p8pass = pass;
             if (EVP_read_pw_string(pass, sizeof(pass), "Enter Password:", 0)) {
-                BIO_printf(bio_err, "Can't read Password\n");
+                BIO_puts(bio_err, "Can't read Password\n");
                 goto end;
             }
         } else {
 #endif
-            BIO_printf(bio_err, "Password required\n");
+            BIO_puts(bio_err, "Password required\n");
             goto end;
         }
-        p8inf = PKCS8_decrypt(p8, p8pass, strlen(p8pass));
+        p8inf = PKCS8_decrypt(p8, p8pass, (int)strlen(p8pass));
     }

     if (p8inf == NULL) {
-        BIO_printf(bio_err, "Error decrypting key\n");
+        BIO_puts(bio_err, "Error decrypting key\n");
         ERR_print_errors(bio_err);
         goto end;
     }

     if ((pkey = EVP_PKCS82PKEY(p8inf)) == NULL) {
-        BIO_printf(bio_err, "Error converting key\n");
+        BIO_puts(bio_err, "Error converting key\n");
         ERR_print_errors(bio_err);
         goto end;
     }
@@ -386,7 +378,7 @@ int pkcs8_main(int argc, char **argv)
     } else if (outformat == FORMAT_ASN1) {
         i2d_PrivateKey_bio(out, pkey);
     } else {
-        BIO_printf(bio_err, "Bad format specified for key\n");
+        BIO_puts(bio_err, "Bad format specified for key\n");
         goto end;
     }
     ret = 0;
@@ -396,7 +388,6 @@ end:
     PKCS8_PRIV_KEY_INFO_free(p8inf);
     EVP_PKEY_free(pkey);
     EVP_CIPHER_free(cipher);
-    release_engine(e);
     BIO_free_all(out);
     BIO_free(in);
     OPENSSL_free(passin);
diff --git a/deps/openssl/openssl/apps/pkey.c b/deps/openssl/openssl/apps/pkey.c
index 9c7b776f780..868e4118206 100644
--- a/deps/openssl/openssl/apps/pkey.c
+++ b/deps/openssl/openssl/apps/pkey.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,6 +14,7 @@
 #include "ec_common.h"
 #include <openssl/pem.h>
 #include <openssl/err.h>
+#include <openssl/encoder.h>
 #include <openssl/evp.h>
 #include <openssl/core_names.h>

@@ -21,9 +22,9 @@ typedef enum OPTION_choice {
     OPT_COMMON,
     OPT_INFORM,
     OPT_OUTFORM,
+    OPT_ENCOPT,
     OPT_PASSIN,
     OPT_PASSOUT,
-    OPT_ENGINE,
     OPT_IN,
     OPT_OUT,
     OPT_PUBIN,
@@ -43,9 +44,6 @@ typedef enum OPTION_choice {
 const OPTIONS pkey_options[] = {
     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif
     OPT_PROV_OPTIONS,

     { "check", OPT_CHECK, '-', "Check key consistency" },
@@ -53,8 +51,7 @@ const OPTIONS pkey_options[] = {

     OPT_SECTION("Input"),
     { "in", OPT_IN, 's', "Input key" },
-    { "inform", OPT_INFORM, 'f',
-        "Key input format (ENGINE, other values ignored)" },
+    { "inform", OPT_INFORM, 'f', "Key input format (DER/PEM)" },
     { "passin", OPT_PASSIN, 's', "Key input pass phrase source" },
     { "pubin", OPT_PUBIN, '-',
         "Read only public components from key input" },
@@ -62,6 +59,7 @@ const OPTIONS pkey_options[] = {
     OPT_SECTION("Output"),
     { "out", OPT_OUT, '>', "Output file for encoded and/or text output" },
     { "outform", OPT_OUTFORM, 'F', "Output encoding format (DER or PEM)" },
+    { "encopt", OPT_ENCOPT, 's', "Private key encoder parameter" },
     { "", OPT_CIPHER, '-', "Any supported cipher to be used for encryption" },
     { "passout", OPT_PASSOUT, 's', "Output PEM file pass phrase source" },
     { "traditional", OPT_TRADITIONAL, '-',
@@ -74,7 +72,7 @@ const OPTIONS pkey_options[] = {
     { "ec_conv_form", OPT_EC_CONV_FORM, 's',
         "Specifies the EC point conversion form in the encoding" },
     { "ec_param_enc", OPT_EC_PARAM_ENC, 's',
-        "Specifies the way the EC parameters are encoded" },
+        "Selects between named_curve and explicit EC parameter encoding" },

     { NULL }
 };
@@ -82,7 +80,6 @@ const OPTIONS pkey_options[] = {
 int pkey_main(int argc, char **argv)
 {
     BIO *out = NULL;
-    ENGINE *e = NULL;
     EVP_PKEY *pkey = NULL;
     EVP_PKEY_CTX *ctx = NULL;
     EVP_CIPHER *cipher = NULL;
@@ -92,6 +89,7 @@ int pkey_main(int argc, char **argv)
     int informat = FORMAT_UNDEF, outformat = FORMAT_PEM;
     int pubin = 0, pubout = 0, text_pub = 0, text = 0, noout = 0, ret = 1;
     int private = 0, traditional = 0, check = 0, pub_check = 0;
+    STACK_OF(OPENSSL_STRING) *encopt = NULL;
 #ifndef OPENSSL_NO_EC
     char *asn1_encoding = NULL;
     char *point_format = NULL;
@@ -118,15 +116,18 @@ int pkey_main(int argc, char **argv)
             if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &outformat))
                 goto opthelp;
             break;
+        case OPT_ENCOPT:
+            if (encopt == NULL)
+                encopt = sk_OPENSSL_STRING_new_null();
+            if (!sk_OPENSSL_STRING_push(encopt, opt_arg()))
+                goto end;
+            break;
         case OPT_PASSIN:
             passinarg = opt_arg();
             break;
         case OPT_PASSOUT:
             passoutarg = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_IN:
             infile = opt_arg();
             break;
@@ -190,11 +191,11 @@ int pkey_main(int argc, char **argv)
         goto opthelp;

     if (text && text_pub)
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Warning: The -text option is ignored with -text_pub\n");
-    if (traditional && (noout || outformat != FORMAT_PEM))
-        BIO_printf(bio_err,
-            "Warning: The -traditional is ignored since there is no PEM output\n");
+    if (traditional && (noout || pubout))
+        BIO_puts(bio_err,
+            "Warning: -traditional is ignored with no private key output\n");

     /* -pubout and -text is the same as -text_pub */
     if (!text_pub && pubout && text) {
@@ -208,24 +209,35 @@ int pkey_main(int argc, char **argv)
         goto opthelp;
     if (cipher == NULL) {
         if (passoutarg != NULL)
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Warning: The -passout option is ignored without a cipher option\n");
+    } else if (noout) {
+        EVP_CIPHER_free(cipher);
+        cipher = NULL;
     } else {
-        if (noout || outformat != FORMAT_PEM) {
-            BIO_printf(bio_err,
-                "Error: Cipher options are supported only for PEM output\n");
+        switch (outformat) {
+        case FORMAT_PEM:
+            break;
+        case FORMAT_ASN1:
+            if (!traditional)
+                break;
+            /* FALLTHROUGH */
+        default:
+            BIO_puts(bio_err,
+                "Error: Cipher options are supported only in PEM "
+                "and non-traditional DER output forms\n");
             goto end;
         }
     }
     if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
-        BIO_printf(bio_err, "Error getting passwords\n");
+        BIO_puts(bio_err, "Error getting passwords\n");
         goto end;
     }

     if (pubin)
-        pkey = load_pubkey(infile, informat, 1, passin, e, "Public Key");
+        pkey = load_pubkey(infile, informat, 1, passin, "Public Key");
     else
-        pkey = load_key(infile, informat, 1, passin, e, "key");
+        pkey = load_key(infile, informat, 1, passin, "key");
     if (pkey == NULL)
         goto end;

@@ -256,7 +268,7 @@ int pkey_main(int argc, char **argv)
     if (check || pub_check) {
         int r;

-        ctx = EVP_PKEY_CTX_new(pkey, e);
+        ctx = EVP_PKEY_CTX_new(pkey, NULL);
         if (ctx == NULL) {
             ERR_print_errors(bio_err);
             goto end;
@@ -268,13 +280,13 @@ int pkey_main(int argc, char **argv)
             r = EVP_PKEY_public_check(ctx);

         if (r == 1) {
-            BIO_printf(out, "Key is valid\n");
+            BIO_puts(out, "Key is valid\n");
         } else {
             /*
              * Note: at least for RSA keys if this function returns
              * -1, there will be no error reasons.
              */
-            BIO_printf(bio_err, "Key is invalid\n");
+            BIO_puts(bio_err, "Key is invalid\n");
             ERR_print_errors(bio_err);
             goto end;
         }
@@ -293,14 +305,13 @@ int pkey_main(int argc, char **argv)
                             passout))
                         goto end;
                 } else {
-                    if (!PEM_write_bio_PrivateKey(out, pkey, cipher,
-                            NULL, 0, NULL, passout))
+                    if (!encode_private_key(out, "PEM", pkey, encopt, cipher, passout))
                         goto end;
                 }
             }
         } else if (outformat == FORMAT_ASN1) {
             if (text || text_pub) {
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "Error: Text output cannot be combined with DER output\n");
                 goto end;
             }
@@ -309,11 +320,16 @@ int pkey_main(int argc, char **argv)
                     goto end;
             } else {
                 assert(private);
-                if (!i2d_PrivateKey_bio(out, pkey))
-                    goto end;
+                if (traditional) {
+                    if (!i2d_PrivateKey_bio(out, pkey))
+                        goto end;
+                } else {
+                    if (!encode_private_key(out, "DER", pkey, encopt, cipher, passout))
+                        goto end;
+                }
             }
         } else {
-            BIO_printf(bio_err, "Bad format specified for key\n");
+            BIO_puts(bio_err, "Bad format specified for key\n");
             goto end;
         }
     }
@@ -332,10 +348,10 @@ int pkey_main(int argc, char **argv)
 end:
     if (ret != 0)
         ERR_print_errors(bio_err);
+    sk_OPENSSL_STRING_free(encopt);
     EVP_PKEY_CTX_free(ctx);
     EVP_PKEY_free(pkey);
     EVP_CIPHER_free(cipher);
-    release_engine(e);
     BIO_free_all(out);
     OPENSSL_free(passin);
     OPENSSL_free(passout);
diff --git a/deps/openssl/openssl/apps/pkeyparam.c b/deps/openssl/openssl/apps/pkeyparam.c
index 3c8fc740863..5aff95dae18 100644
--- a/deps/openssl/openssl/apps/pkeyparam.c
+++ b/deps/openssl/openssl/apps/pkeyparam.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -22,7 +22,6 @@ typedef enum OPTION_choice {
     OPT_OUT,
     OPT_TEXT,
     OPT_NOOUT,
-    OPT_ENGINE,
     OPT_CHECK,
     OPT_PROV_ENUM
 } OPTION_CHOICE;
@@ -30,9 +29,6 @@ typedef enum OPTION_choice {
 const OPTIONS pkeyparam_options[] = {
     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif
     { "check", OPT_CHECK, '-', "Check key param consistency" },

     OPT_SECTION("Input"),
@@ -49,7 +45,6 @@ const OPTIONS pkeyparam_options[] = {

 int pkeyparam_main(int argc, char **argv)
 {
-    ENGINE *e = NULL;
     BIO *in = NULL, *out = NULL;
     EVP_PKEY *pkey = NULL;
     EVP_PKEY_CTX *ctx = NULL;
@@ -75,9 +70,6 @@ int pkeyparam_main(int argc, char **argv)
         case OPT_OUT:
             outfile = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_TEXT:
             text = 1;
             break;
@@ -104,7 +96,7 @@ int pkeyparam_main(int argc, char **argv)
     pkey = PEM_read_bio_Parameters_ex(in, NULL, app_get0_libctx(),
         app_get0_propq());
     if (pkey == NULL) {
-        BIO_printf(bio_err, "Error reading parameters\n");
+        BIO_puts(bio_err, "Error reading parameters\n");
         ERR_print_errors(bio_err);
         goto end;
     }
@@ -113,11 +105,8 @@ int pkeyparam_main(int argc, char **argv)
         goto end;

     if (check) {
-        if (e == NULL)
-            ctx = EVP_PKEY_CTX_new_from_pkey(app_get0_libctx(), pkey,
-                app_get0_propq());
-        else
-            ctx = EVP_PKEY_CTX_new(pkey, e);
+        ctx = EVP_PKEY_CTX_new_from_pkey(app_get0_libctx(), pkey,
+            app_get0_propq());
         if (ctx == NULL) {
             ERR_print_errors(bio_err);
             goto end;
@@ -126,13 +115,13 @@ int pkeyparam_main(int argc, char **argv)
         r = EVP_PKEY_param_check(ctx);

         if (r == 1) {
-            BIO_printf(out, "Parameters are valid\n");
+            BIO_puts(out, "Parameters are valid\n");
         } else {
             /*
              * Note: at least for RSA keys if this function returns
              * -1, there will be no error reasons.
              */
-            BIO_printf(bio_err, "Parameters are invalid\n");
+            BIO_puts(bio_err, "Parameters are invalid\n");
             ERR_print_errors(bio_err);
             goto end;
         }
@@ -149,7 +138,6 @@ int pkeyparam_main(int argc, char **argv)
 end:
     EVP_PKEY_CTX_free(ctx);
     EVP_PKEY_free(pkey);
-    release_engine(e);
     BIO_free_all(out);
     BIO_free(in);

diff --git a/deps/openssl/openssl/apps/pkeyutl.c b/deps/openssl/openssl/apps/pkeyutl.c
index 6b6a5d625ee..3d7cce54c14 100644
--- a/deps/openssl/openssl/apps/pkeyutl.c
+++ b/deps/openssl/openssl/apps/pkeyutl.c
@@ -9,6 +9,8 @@

 #include "apps.h"
 #include "progs.h"
+#include <limits.h>
+#include <stdio.h>
 #include <string.h>
 #include <openssl/err.h>
 #include <openssl/pem.h>
@@ -22,16 +24,14 @@

 static EVP_PKEY *get_pkey(const char *kdfalg,
     const char *keyfile, int keyform, int key_type,
-    char *passinarg, int pkey_op, ENGINE *e);
+    char *passinarg, int pkey_op);
 static EVP_PKEY_CTX *init_ctx(const char *kdfalg, int *pkeysize,
-    int pkey_op, ENGINE *e,
-    const int engine_impl, int rawin,
+    int pkey_op, int rawin,
     EVP_PKEY *pkey /* ownership is passed to ctx */,
     EVP_MD_CTX *mctx, const char *digestname,
     const char *kemop, OSSL_LIB_CTX *libctx, const char *propq);

-static int setup_peer(EVP_PKEY_CTX *ctx, int peerform, const char *file,
-    ENGINE *e);
+static int setup_peer(EVP_PKEY_CTX *ctx, int peerform, const char *file);

 static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
     unsigned char *out, size_t *poutlen,
@@ -39,8 +39,8 @@ static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
     unsigned char *secret, size_t *psecretlen);

 static int do_raw_keyop(int pkey_op, EVP_MD_CTX *mctx,
-    EVP_PKEY *pkey, BIO *in,
-    int filesize, unsigned char *sig, size_t siglen,
+    EVP_PKEY *pkey, BIO *in, const char *infile,
+    size_t filesize, unsigned char *sig, size_t siglen,
     unsigned char **out, size_t *poutlen);

 static int only_nomd(EVP_PKEY *pkey)
@@ -56,8 +56,6 @@ static int only_nomd(EVP_PKEY *pkey)

 typedef enum OPTION_choice {
     OPT_COMMON,
-    OPT_ENGINE,
-    OPT_ENGINE_IMPL,
     OPT_IN,
     OPT_OUT,
     OPT_PUBIN,
@@ -95,11 +93,6 @@ typedef enum OPTION_choice {
 const OPTIONS pkeyutl_options[] = {
     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-    { "engine_impl", OPT_ENGINE_IMPL, '-',
-        "Also use engine given by -engine for crypto operations" },
-#endif
     { "sign", OPT_SIGN, '-', "Sign input data with private key" },
     { "verify", OPT_VERIFY, '-', "Verify with public key" },
     { "encrypt", OPT_ENCRYPT, '-', "Encrypt input data with public key" },
@@ -115,11 +108,11 @@ const OPTIONS pkeyutl_options[] = {
     { "pubin", OPT_PUBIN, '-', "Input key is a public key" },
     { "passin", OPT_PASSIN, 's', "Input file pass phrase source" },
     { "peerkey", OPT_PEERKEY, 's', "Peer key file used in key derivation" },
-    { "peerform", OPT_PEERFORM, 'E', "Peer key format (DER/PEM/P12/ENGINE)" },
+    { "peerform", OPT_PEERFORM, 'f', "Peer key format (DER/PEM/P12)" },
     { "certin", OPT_CERTIN, '-', "Input is a cert with a public key" },
     { "rev", OPT_REV, '-', "Reverse the order of the input buffer" },
     { "sigfile", OPT_SIGFILE, '<', "Signature file (verify operation only)" },
-    { "keyform", OPT_KEYFORM, 'E', "Private key format (ENGINE, other values ignored)" },
+    { "keyform", OPT_KEYFORM, 'f', "Private key format (DER/PEM)" },

     OPT_SECTION("Output"),
     { "out", OPT_OUT, '>', "Output file - default stdout" },
@@ -151,7 +144,6 @@ int pkeyutl_main(int argc, char **argv)
 {
     CONF *conf = NULL;
     BIO *in = NULL, *out = NULL, *secout = NULL;
-    ENGINE *e = NULL;
     EVP_PKEY_CTX *ctx = NULL;
     EVP_PKEY *pkey = NULL;
     char *infile = NULL, *outfile = NULL, *secoutfile = NULL, *sigfile = NULL, *passinarg = NULL;
@@ -161,7 +153,6 @@ int pkeyutl_main(int argc, char **argv)
     size_t buf_inlen = 0, siglen = 0;
     int keyform = FORMAT_UNDEF, peerform = FORMAT_UNDEF;
     int keysize = -1, pkey_op = EVP_PKEY_OP_SIGN, key_type = KEY_PRIVKEY;
-    int engine_impl = 0;
     int ret = 1, rv = -1;
     size_t buf_outlen = 0, secretlen = 0;
     const char *inkey = NULL;
@@ -173,7 +164,7 @@ int pkeyutl_main(int argc, char **argv)
     int rawin = 0;
     EVP_MD_CTX *mctx = NULL;
     EVP_MD *md = NULL;
-    int filesize = -1;
+    size_t filesize = (size_t)-1; /* (size_t)-1 means unknown */
     OSSL_LIB_CTX *libctx = app_get0_libctx();

     prog = opt_init(argc, argv, pkeyutl_options);
@@ -200,9 +191,6 @@ int pkeyutl_main(int argc, char **argv)
         case OPT_SIGFILE:
             sigfile = opt_arg();
             break;
-        case OPT_ENGINE_IMPL:
-            engine_impl = 1;
-            break;
         case OPT_INKEY:
             inkey = opt_arg();
             break;
@@ -233,9 +221,6 @@ int pkeyutl_main(int argc, char **argv)
             if (!opt_provider(o))
                 goto end;
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_PUBIN:
             key_type = KEY_PUBKEY;
             break;
@@ -282,7 +267,7 @@ int pkeyutl_main(int argc, char **argv)
             kdfalg = opt_arg();
             break;
         case OPT_KDFLEN:
-            kdflen = atoi(opt_arg());
+            kdflen = opt_int_arg();
             break;
         case OPT_REV:
             rev = 1;
@@ -338,7 +323,7 @@ int pkeyutl_main(int argc, char **argv)
         goto opthelp;
     }

-    pkey = get_pkey(kdfalg, inkey, keyform, key_type, passinarg, pkey_op, e);
+    pkey = get_pkey(kdfalg, inkey, keyform, key_type, passinarg, pkey_op);
     if (key_type != KEY_NONE && pkey == NULL) {
         BIO_printf(bio_err, "%s: Error loading key\n", prog);
         goto end;
@@ -374,17 +359,17 @@ int pkeyutl_main(int argc, char **argv)

     if (rawin) {
         if ((mctx = EVP_MD_CTX_new()) == NULL) {
-            BIO_printf(bio_err, "Error: out of memory\n");
+            BIO_puts(bio_err, "Error: out of memory\n");
             goto end;
         }
     }
-    ctx = init_ctx(kdfalg, &keysize, pkey_op, e, engine_impl, rawin, pkey,
+    ctx = init_ctx(kdfalg, &keysize, pkey_op, rawin, pkey,
         mctx, digestname, kemop, libctx, app_get0_propq());
     if (ctx == NULL) {
         BIO_printf(bio_err, "%s: Error initializing context\n", prog);
         goto end;
     }
-    if (peerkey != NULL && !setup_peer(ctx, peerform, peerkey, e)) {
+    if (peerkey != NULL && !setup_peer(ctx, peerform, peerkey)) {
         BIO_printf(bio_err, "%s: Error setting up peer key\n", prog);
         goto end;
     }
@@ -416,7 +401,7 @@ int pkeyutl_main(int argc, char **argv)
                 char passwd_buf[4096];
                 int r;

-                BIO_snprintf(passwd_buf, sizeof(passwd_buf), "Enter %s: ", opt);
+                snprintf(passwd_buf, sizeof(passwd_buf), "Enter %s: ", opt);
                 r = EVP_read_pw_string(passwd_buf, sizeof(passwd_buf) - 1,
                     passwd_buf, 0);
                 if (r < 0) {
@@ -471,8 +456,11 @@ int pkeyutl_main(int argc, char **argv)
         if (infile != NULL) {
             struct stat st;

-            if (stat(infile, &st) == 0 && st.st_size <= INT_MAX)
-                filesize = (int)st.st_size;
+            if (stat(infile, &st) == 0 && st.st_size >= 0) {
+                filesize = (size_t)st.st_size;
+                if ((off_t)filesize != st.st_size)
+                    filesize = (size_t)-1;
+            }
         }
         if (in == NULL)
             goto end;
@@ -496,8 +484,8 @@ int pkeyutl_main(int argc, char **argv)
     if (pkey_op == EVP_PKEY_OP_ENCAPSULATE
         || pkey_op == EVP_PKEY_OP_DECAPSULATE) {
         if (secoutfile == NULL && pkey_op == EVP_PKEY_OP_ENCAPSULATE) {
-            BIO_printf(bio_err, "KEM-based shared-secret derivation requires "
-                                "the '-secret <file>' option\n");
+            BIO_puts(bio_err, "KEM-based shared-secret derivation requires "
+                              "the '-secret <file>' option\n");
             goto end;
         }
         /* For backwards compatibility, default decap secrets to the output */
@@ -516,7 +504,7 @@ int pkeyutl_main(int argc, char **argv)
         }
         if (!bio_to_mem(&sig, &siglen, maxsiglen, sigbio)) {
             BIO_free(sigbio);
-            BIO_printf(bio_err, "Error reading signature data\n");
+            BIO_puts(bio_err, "Error reading signature data\n");
             goto end;
         }
         BIO_free(sigbio);
@@ -526,7 +514,7 @@ int pkeyutl_main(int argc, char **argv)
     if (in != NULL && !rawin) {
         /* Read the input data */
         if (!bio_to_mem(&buf_in, &buf_inlen, 0, in)) {
-            BIO_printf(bio_err, "Error reading input Data\n");
+            BIO_puts(bio_err, "Error reading input Data\n");
             goto end;
         }
         if (rev) {
@@ -556,7 +544,7 @@ int pkeyutl_main(int argc, char **argv)

     if (pkey_op == EVP_PKEY_OP_VERIFY) {
         if (rawin) {
-            rv = do_raw_keyop(pkey_op, mctx, pkey, in, filesize, sig, siglen,
+            rv = do_raw_keyop(pkey_op, mctx, pkey, in, infile, filesize, sig, siglen,
                 NULL, 0);
         } else {
             rv = EVP_PKEY_verify(ctx, sig, siglen, buf_in, buf_inlen);
@@ -571,8 +559,8 @@ int pkeyutl_main(int argc, char **argv)
     }
     if (rawin) {
         /* rawin allocates the buffer in do_raw_keyop() */
-        rv = do_raw_keyop(pkey_op, mctx, pkey, in, filesize, NULL, 0,
-            &buf_out, (size_t *)&buf_outlen);
+        rv = do_raw_keyop(pkey_op, mctx, pkey, in, infile, filesize, NULL, 0,
+            &buf_out, &buf_outlen);
     } else {
         if (kdflen != 0) {
             buf_outlen = kdflen;
@@ -604,16 +592,16 @@ int pkeyutl_main(int argc, char **argv)
     ret = 0;

     if (asn1parse) {
-        if (!ASN1_parse_dump(out, buf_out, buf_outlen, 1, -1))
+        if (!ASN1_parse_dump(out, buf_out, (long)buf_outlen, 1, -1))
             ERR_print_errors(bio_err); /* but still return success */
     } else if (hexdump) {
-        BIO_dump(out, (char *)buf_out, buf_outlen);
+        BIO_dump(out, (char *)buf_out, (int)buf_outlen);
     } else {
-        BIO_write(out, buf_out, buf_outlen);
+        BIO_write(out, buf_out, (int)buf_outlen);
     }
     /* Backwards compatible decap output fallback */
     if (secretlen > 0)
-        BIO_write(secout ? secout : out, secret, secretlen);
+        BIO_write(secout ? secout : out, secret, (int)secretlen);

 end:
     if (ret != 0)
@@ -622,7 +610,6 @@ end:
     EVP_PKEY_CTX_free(ctx);
     EVP_PKEY_free(pkey);
     EVP_MD_free(md);
-    release_engine(e);
     BIO_free(in);
     BIO_free_all(out);
     BIO_free_all(secout);
@@ -638,7 +625,7 @@ end:

 static EVP_PKEY *get_pkey(const char *kdfalg,
     const char *keyfile, int keyform, int key_type,
-    char *passinarg, int pkey_op, ENGINE *e)
+    char *passinarg, int pkey_op)
 {
     EVP_PKEY *pkey = NULL;
     char *passin = NULL;
@@ -647,20 +634,20 @@ static EVP_PKEY *get_pkey(const char *kdfalg,
     if (((pkey_op == EVP_PKEY_OP_SIGN) || (pkey_op == EVP_PKEY_OP_DECRYPT)
             || (pkey_op == EVP_PKEY_OP_DERIVE))
         && (key_type != KEY_PRIVKEY && kdfalg == NULL)) {
-        BIO_printf(bio_err, "A private key is needed for this operation\n");
+        BIO_puts(bio_err, "A private key is needed for this operation\n");
         return NULL;
     }
     if (!app_passwd(passinarg, NULL, &passin, NULL)) {
-        BIO_printf(bio_err, "Error getting password\n");
+        BIO_puts(bio_err, "Error getting password\n");
         return NULL;
     }
     switch (key_type) {
     case KEY_PRIVKEY:
-        pkey = load_key(keyfile, keyform, 0, passin, e, "private key");
+        pkey = load_key(keyfile, keyform, 0, passin, "private key");
         break;

     case KEY_PUBKEY:
-        pkey = load_pubkey(keyfile, keyform, 0, NULL, e, "public key");
+        pkey = load_pubkey(keyfile, keyform, 0, NULL, "public key");
         break;

     case KEY_CERT:
@@ -679,21 +666,14 @@ static EVP_PKEY *get_pkey(const char *kdfalg,
 }

 static EVP_PKEY_CTX *init_ctx(const char *kdfalg, int *pkeysize,
-    int pkey_op, ENGINE *e,
-    const int engine_impl, int rawin,
+    int pkey_op, int rawin,
     EVP_PKEY *pkey /* ownership is passed to ctx */,
     EVP_MD_CTX *mctx, const char *digestname,
     const char *kemop, OSSL_LIB_CTX *libctx, const char *propq)
 {
     EVP_PKEY_CTX *ctx = NULL;
-    ENGINE *impl = NULL;
     int rv = -1;

-#ifndef OPENSSL_NO_ENGINE
-    if (engine_impl)
-        impl = e;
-#endif
-
     if (kdfalg != NULL) {
         int kdfnid = OBJ_sn2nid(kdfalg);

@@ -705,19 +685,13 @@ static EVP_PKEY_CTX *init_ctx(const char *kdfalg, int *pkeysize,
                 return NULL;
             }
         }
-        if (impl != NULL)
-            ctx = EVP_PKEY_CTX_new_id(kdfnid, impl);
-        else
-            ctx = EVP_PKEY_CTX_new_from_name(libctx, kdfalg, propq);
+        ctx = EVP_PKEY_CTX_new_from_name(libctx, kdfalg, propq);
     } else {
         if (pkey == NULL)
             return NULL;

         *pkeysize = EVP_PKEY_get_size(pkey);
-        if (impl != NULL)
-            ctx = EVP_PKEY_CTX_new(pkey, impl);
-        else
-            ctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, propq);
+        ctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, propq);
     }

     if (ctx == NULL)
@@ -786,17 +760,13 @@ static EVP_PKEY_CTX *init_ctx(const char *kdfalg, int *pkeysize,
     return ctx;
 }

-static int setup_peer(EVP_PKEY_CTX *ctx, int peerform, const char *file,
-    ENGINE *e)
+static int setup_peer(EVP_PKEY_CTX *ctx, int peerform, const char *file)
 {
     EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(ctx);
     EVP_PKEY *peer = NULL;
-    ENGINE *engine = NULL;
     int ret = 1;

-    if (peerform == FORMAT_ENGINE)
-        engine = e;
-    peer = load_pubkey(file, peerform, 0, NULL, engine, "peer key");
+    peer = load_pubkey(file, peerform, 0, NULL, "peer key");
     if (peer == NULL) {
         BIO_printf(bio_err, "Error reading peer key %s\n", file);
         return 0;
@@ -856,8 +826,8 @@ static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
 #define TBUF_MAXSIZE 2048

 static int do_raw_keyop(int pkey_op, EVP_MD_CTX *mctx,
-    EVP_PKEY *pkey, BIO *in,
-    int filesize, unsigned char *sig, size_t siglen,
+    EVP_PKEY *pkey, BIO *in, const char *infile,
+    size_t filesize, unsigned char *sig, size_t siglen,
     unsigned char **out, size_t *poutlen)
 {
     int rv = 0;
@@ -867,31 +837,72 @@ static int do_raw_keyop(int pkey_op, EVP_MD_CTX *mctx,

     /* Some algorithms only support oneshot digests */
     if (only_nomd(pkey)) {
-        if (filesize < 0) {
+        if (filesize == (size_t)-1) {
             BIO_printf(bio_err,
-                "Error: unable to determine file size for oneshot operation\n");
+                "Error: unable to determine size of file '%s' for oneshot operation\n",
+                infile);
+            goto end;
+        }
+#if defined(OPENSSL_SYS_UNIX) && defined(_POSIX_MAPPED_FILES) && _POSIX_MAPPED_FILES > 0
+        if (infile != NULL) {
+            struct stat st;
+
+            if (stat(infile, &st) == 0 && !S_ISREG(st.st_mode)) {
+                BIO_puts(bio_err, "Error: failed to use memory-mapped file\n");
+                goto end;
+            }
+        }
+        if (filesize > 0 && infile != NULL) {
+            const unsigned char *data = NULL;
+            size_t mapped_size = 0;
+
+            if (app_mmap_file(infile, bio_err, filesize, &data, &mapped_size) == 1) {
+                switch (pkey_op) {
+                case EVP_PKEY_OP_VERIFY:
+                    rv = EVP_DigestVerify(mctx, sig, siglen, data, mapped_size);
+                    break;
+                case EVP_PKEY_OP_SIGN:
+                    rv = EVP_DigestSign(mctx, NULL, poutlen, data, mapped_size);
+                    if (rv == 1 && out != NULL) {
+                        *out = app_malloc(*poutlen, "buffer output");
+                        rv = EVP_DigestSign(mctx, *out, poutlen, data, mapped_size);
+                    }
+                    break;
+                default:
+                    break;
+                }
+                munmap((void *)data, mapped_size);
+            }
+            /* Success or mmap failure: do not fall back to buffer path */
+            goto end;
+        }
+#endif
+        if (filesize > INT_MAX) {
+            BIO_puts(bio_err,
+                "Error: file too large for oneshot operation without memory mapping\n");
             goto end;
         }
-        mbuf = app_malloc(filesize, "oneshot sign/verify buffer");
+        if (filesize > 0)
+            mbuf = app_malloc(filesize, "oneshot sign/verify buffer");
         switch (pkey_op) {
         case EVP_PKEY_OP_VERIFY:
-            buf_len = BIO_read(in, mbuf, filesize);
-            if (buf_len != filesize) {
-                BIO_printf(bio_err, "Error reading raw input data\n");
+            buf_len = BIO_read(in, mbuf, (int)filesize);
+            if (buf_len < 0 || (size_t)buf_len != filesize) {
+                BIO_puts(bio_err, "Error reading raw input data\n");
                 goto end;
             }
-            rv = EVP_DigestVerify(mctx, sig, siglen, mbuf, buf_len);
+            rv = EVP_DigestVerify(mctx, sig, siglen, mbuf, filesize);
             break;
         case EVP_PKEY_OP_SIGN:
-            buf_len = BIO_read(in, mbuf, filesize);
-            if (buf_len != filesize) {
-                BIO_printf(bio_err, "Error reading raw input data\n");
+            buf_len = BIO_read(in, mbuf, (int)filesize);
+            if (buf_len < 0 || (size_t)buf_len != filesize) {
+                BIO_puts(bio_err, "Error reading raw input data\n");
                 goto end;
             }
-            rv = EVP_DigestSign(mctx, NULL, poutlen, mbuf, buf_len);
+            rv = EVP_DigestSign(mctx, NULL, poutlen, mbuf, filesize);
             if (rv == 1 && out != NULL) {
                 *out = app_malloc(*poutlen, "buffer output");
-                rv = EVP_DigestSign(mctx, *out, poutlen, mbuf, buf_len);
+                rv = EVP_DigestSign(mctx, *out, poutlen, mbuf, filesize);
             }
             break;
         }
@@ -905,12 +916,12 @@ static int do_raw_keyop(int pkey_op, EVP_MD_CTX *mctx,
             if (buf_len == 0)
                 break;
             if (buf_len < 0) {
-                BIO_printf(bio_err, "Error reading raw input data\n");
+                BIO_puts(bio_err, "Error reading raw input data\n");
                 goto end;
             }
             rv = EVP_DigestVerifyUpdate(mctx, tbuf, (size_t)buf_len);
             if (rv != 1) {
-                BIO_printf(bio_err, "Error verifying raw input data\n");
+                BIO_puts(bio_err, "Error verifying raw input data\n");
                 goto end;
             }
         }
@@ -922,12 +933,12 @@ static int do_raw_keyop(int pkey_op, EVP_MD_CTX *mctx,
             if (buf_len == 0)
                 break;
             if (buf_len < 0) {
-                BIO_printf(bio_err, "Error reading raw input data\n");
+                BIO_puts(bio_err, "Error reading raw input data\n");
                 goto end;
             }
             rv = EVP_DigestSignUpdate(mctx, tbuf, (size_t)buf_len);
             if (rv != 1) {
-                BIO_printf(bio_err, "Error signing raw input data\n");
+                BIO_puts(bio_err, "Error signing raw input data\n");
                 goto end;
             }
         }
diff --git a/deps/openssl/openssl/apps/prime.c b/deps/openssl/openssl/apps/prime.c
index 8f373c5e79d..f4572e1afbb 100644
--- a/deps/openssl/openssl/apps/prime.c
+++ b/deps/openssl/openssl/apps/prime.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,6 +13,9 @@
 #include "progs.h"
 #include <openssl/bn.h>

+/* Consistent with RSA modulus size limit and the size of plausible individual primes */
+#define BUFSIZE 4098
+
 typedef enum OPTION_choice {
     OPT_COMMON,
     OPT_HEX,
@@ -20,7 +23,8 @@ typedef enum OPTION_choice {
     OPT_BITS,
     OPT_SAFE,
     OPT_CHECKS,
-    OPT_PROV_ENUM
+    OPT_PROV_ENUM,
+    OPT_IN_FILE
 } OPTION_CHOICE;

 static int check_num(const char *s, const int is_hex)
@@ -43,6 +47,33 @@ static int check_num(const char *s, const int is_hex)
     return s[i] == 0;
 }

+static void process_num(const char *s, const int is_hex)
+{
+    int r;
+    BIGNUM *bn = NULL;
+
+    r = check_num(s, is_hex);
+
+    if (r)
+        r = is_hex ? BN_hex2bn(&bn, s) : BN_dec2bn(&bn, s);
+
+    if (!r) {
+        BIO_printf(bio_err, "Failed to process value (%s)\n", s);
+        BN_free(bn);
+        return;
+    }
+
+    BN_print(bio_out, bn);
+    r = BN_check_prime(bn, NULL, NULL);
+    BN_free(bn);
+    if (r < 0) {
+        BIO_puts(bio_err, "Error checking prime\n");
+        return;
+    }
+
+    BIO_printf(bio_out, " (%s) %s prime\n", s, r == 1 ? "is" : "is not");
+}
+
 const OPTIONS prime_options[] = {
     { OPT_HELP_STR, 1, '-', "Usage: %s [options] [number...]\n" },

@@ -50,9 +81,11 @@ const OPTIONS prime_options[] = {
     { "help", OPT_HELP, '-', "Display this summary" },
     { "bits", OPT_BITS, 'p', "Size of number in bits" },
     { "checks", OPT_CHECKS, 'p', "Number of checks" },
+    { "hex", OPT_HEX, '-',
+        "Enables hex format for output from prime generation or input to primality checking" },
+    { "in", OPT_IN_FILE, '-', "Provide file names containing numbers for primality checking" },

     OPT_SECTION("Output"),
-    { "hex", OPT_HEX, '-', "Hex output" },
     { "generate", OPT_GENERATE, '-', "Generate a prime" },
     { "safe", OPT_SAFE, '-',
         "When used with -generate, generate a safe prime" },
@@ -67,9 +100,11 @@ const OPTIONS prime_options[] = {
 int prime_main(int argc, char **argv)
 {
     BIGNUM *bn = NULL;
-    int hex = 0, generate = 0, bits = 0, safe = 0, ret = 1;
+    int hex = 0, generate = 0, bits = 0, safe = 0, ret = 1, in_file = 0;
     char *prog;
     OPTION_CHOICE o;
+    char file_read_buf[BUFSIZE] = { 0 };
+    BIO *in = NULL;

     prog = opt_init(argc, argv, prime_options);
     while ((o = opt_next()) != OPT_EOF) {
@@ -90,7 +125,7 @@ int prime_main(int argc, char **argv)
             generate = 1;
             break;
         case OPT_BITS:
-            bits = atoi(opt_arg());
+            bits = opt_int_arg();
             break;
         case OPT_SAFE:
             safe = 1;
@@ -103,6 +138,9 @@ int prime_main(int argc, char **argv)
             if (!opt_provider(o))
                 goto end;
             break;
+        case OPT_IN_FILE:
+            in_file = 1;
+            break;
         }
     }

@@ -112,7 +150,7 @@ int prime_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
     if (!generate && argc == 0) {
-        BIO_printf(bio_err, "Missing number (s) to check\n");
+        BIO_puts(bio_err, "Missing number (s) to check\n");
         goto opthelp;
     }

@@ -120,46 +158,61 @@ int prime_main(int argc, char **argv)
         char *s;

         if (!bits) {
-            BIO_printf(bio_err, "Specify the number of bits.\n");
+            BIO_puts(bio_err, "Specify the number of bits.\n");
             goto end;
         }
         bn = BN_new();
         if (bn == NULL) {
-            BIO_printf(bio_err, "Out of memory.\n");
+            BIO_puts(bio_err, "Out of memory.\n");
             goto end;
         }
         if (!BN_generate_prime_ex(bn, bits, safe, NULL, NULL, NULL)) {
-            BIO_printf(bio_err, "Failed to generate prime.\n");
+            BIO_puts(bio_err, "Failed to generate prime.\n");
             goto end;
         }
         s = hex ? BN_bn2hex(bn) : BN_bn2dec(bn);
         if (s == NULL) {
-            BIO_printf(bio_err, "Out of memory.\n");
+            BIO_puts(bio_err, "Out of memory.\n");
             goto end;
         }
         BIO_printf(bio_out, "%s\n", s);
         OPENSSL_free(s);
     } else {
         for (; *argv; argv++) {
-            int r = check_num(argv[0], hex);
-
-            if (r)
-                r = hex ? BN_hex2bn(&bn, argv[0]) : BN_dec2bn(&bn, argv[0]);
-
-            if (!r) {
-                BIO_printf(bio_err, "Failed to process value (%s)\n", argv[0]);
-                goto end;
-            }
-
-            BN_print(bio_out, bn);
-            r = BN_check_prime(bn, NULL, NULL);
-            if (r < 0) {
-                BIO_printf(bio_err, "Error checking prime\n");
-                goto end;
+            int bytes_read = 0;
+
+            if (!in_file) {
+                process_num(argv[0], hex);
+            } else {
+                in = bio_open_default_quiet(argv[0], 'r', 0);
+                if (in == NULL) {
+                    BIO_printf(bio_err, "Error opening file %s\n", argv[0]);
+                    continue;
+                }
+
+                while ((bytes_read = BIO_get_line(in, file_read_buf, BUFSIZE)) > 0) {
+                    size_t valid_digits_length;
+
+                    /* Number is too long. Discard remainder of the line */
+                    if (bytes_read == BUFSIZE - 1 && file_read_buf[BUFSIZE - 2] != '\n') {
+                        BIO_printf(bio_err, "Value in %s is over the maximum size (%d digits)\n",
+                            argv[0], BUFSIZE - 2);
+                        while (BIO_get_line(in, file_read_buf, BUFSIZE) == BUFSIZE - 1)
+                            ;
+                        continue;
+                    }
+
+                    valid_digits_length = strspn(file_read_buf, "1234567890abcdefABCDEF");
+                    file_read_buf[valid_digits_length] = '\0';
+
+                    process_num(file_read_buf, hex);
+                }
+
+                if (bytes_read < 0)
+                    BIO_printf(bio_err, "Read error in %s\n", argv[0]);
+
+                BIO_free(in);
             }
-            BIO_printf(bio_out, " (%s) %s prime\n",
-                argv[0],
-                r == 1 ? "is" : "is not");
         }
     }

diff --git a/deps/openssl/openssl/apps/progs.pl b/deps/openssl/openssl/apps/progs.pl
index b0ad006c07e..be796bf343d 100644
--- a/deps/openssl/openssl/apps/progs.pl
+++ b/deps/openssl/openssl/apps/progs.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -60,6 +60,9 @@ if ($opt eq '-H') {
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_APPS_PROGS_H)
+#define OSSL_APPS_PROGS_H
+
 #include "function.h"

 EOF
@@ -74,6 +77,7 @@ EOF
     }
     print "\n";
     print "extern FUNCTION functions[];\n";
+    print "\n#endif /* !defined(OSSL_APPS_PROGS_H) */\n";
 }

 if ($opt eq '-C') {
@@ -96,7 +100,6 @@ EOF

     my %cmd_disabler = (
         ciphers  => "sock",
-        genrsa   => "rsa",
         gendsa   => "dsa",
         dsaparam => "dsa",
         gendh    => "dh",
@@ -110,7 +113,7 @@ EOF
 #   [2] = preprocessor conditional for excluding irrespective of deprecation
 #        rsa      => [ "pkey",      "3_0", "rsa" ],
 #        genrsa   => [ "genpkey",   "3_0", "rsa" ],
-        rsautl   => [ "pkeyutl",   "3_0", "rsa" ],
+        rsautl   => [ "pkeyutl",   "3_0", "" ],
 #        dhparam  => [ "pkeyparam", "3_0", "dh"  ],
 #        dsaparam => [ "pkeyparam", "3_0", "dsa" ],
 #        dsa      => [ "pkey",      "3_0", "dsa" ],
diff --git a/deps/openssl/openssl/apps/rand.c b/deps/openssl/openssl/apps/rand.c
index fa2dd2401d0..3b1647d9b19 100644
--- a/deps/openssl/openssl/apps/rand.c
+++ b/deps/openssl/openssl/apps/rand.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1998-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -21,9 +21,9 @@
 typedef enum OPTION_choice {
     OPT_COMMON,
     OPT_OUT,
-    OPT_ENGINE,
     OPT_BASE64,
     OPT_HEX,
+    OPT_NO_NEWLINE,
     OPT_R_ENUM,
     OPT_PROV_ENUM
 } OPTION_CHOICE;
@@ -33,14 +33,12 @@ const OPTIONS rand_options[] = {

     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif

     OPT_SECTION("Output"),
     { "out", OPT_OUT, '>', "Output file" },
     { "base64", OPT_BASE64, '-', "Base64 encode output" },
     { "hex", OPT_HEX, '-', "Hex encode output" },
+    { "n", OPT_NO_NEWLINE, '-', "Do not output the trailing newline" },

     OPT_R_OPTIONS,
     OPT_PROV_OPTIONS,
@@ -52,11 +50,10 @@ const OPTIONS rand_options[] = {

 int rand_main(int argc, char **argv)
 {
-    ENGINE *e = NULL;
     BIO *out = NULL;
     char *outfile = NULL, *prog;
     OPTION_CHOICE o;
-    int format = FORMAT_BINARY, r, i, ret = 1;
+    int format = FORMAT_BINARY, r, i, ret = 1, newline = 1;
     size_t buflen = (1 << 16); /* max rand chunk size is 2^16 bytes */
     long num = -1;
     uint64_t scaled_num = 0;
@@ -77,9 +74,6 @@ int rand_main(int argc, char **argv)
         case OPT_OUT:
             outfile = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_R_CASES:
             if (!opt_rand(o))
                 goto end;
@@ -90,6 +84,9 @@ int rand_main(int argc, char **argv)
         case OPT_HEX:
             format = FORMAT_TEXT;
             break;
+        case OPT_NO_NEWLINE:
+            newline = 0;
+            break;
         case OPT_PROV_CASES:
             if (!opt_provider(o))
                 goto end;
@@ -167,13 +164,13 @@ int rand_main(int argc, char **argv)
         if (shift != 0) {
             /* check for overflow */
             if ((UINT64_MAX >> shift) < (size_t)num) {
-                BIO_printf(bio_err, "%lu bytes with suffix overflows\n",
+                BIO_printf(bio_err, "%ld bytes with suffix overflows\n",
                     num);
                 goto opthelp;
             }
             scaled_num = num << shift;
             if (scaled_num > (UINT64_MAX >> 3)) {
-                BIO_printf(bio_err, "Request exceeds max allowed output\n");
+                BIO_puts(bio_err, "Request exceeds max allowed output\n");
                 goto opthelp;
             }
         } else {
@@ -216,7 +213,7 @@ int rand_main(int argc, char **argv)
         }
         scaled_num -= chunk;
     }
-    if (format == FORMAT_TEXT)
+    if (newline && format == FORMAT_TEXT)
         BIO_puts(out, "\n");
     if (BIO_flush(out) <= 0)
         goto end;
@@ -227,7 +224,6 @@ end:
     if (ret != 0)
         ERR_print_errors(bio_err);
     OPENSSL_free(buf);
-    release_engine(e);
     BIO_free_all(out);
     return ret;
 }
diff --git a/deps/openssl/openssl/apps/rehash.c b/deps/openssl/openssl/apps/rehash.c
index e2083fa76bf..5755d2b8a5e 100644
--- a/deps/openssl/openssl/apps/rehash.c
+++ b/deps/openssl/openssl/apps/rehash.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2013-2014 Timo Teräs <timo.teras@gmail.com>
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -168,7 +168,7 @@ static int add_entry(enum Type type, unsigned int hash, const char *filename,
         if (ep->filename == NULL) {
             OPENSSL_free(ep);
             ep = NULL;
-            BIO_printf(bio_err, "out of memory\n");
+            BIO_puts(bio_err, "out of memory\n");
             return 1;
         }
         if (bp->last_entry)
@@ -235,12 +235,12 @@ static int handle_symlink(const char *filename, const char *fullpath)
 static int do_file(const char *filename, const char *fullpath, enum Hash h)
 {
     STACK_OF(X509_INFO) *inf = NULL;
-    X509_INFO *x;
+    X509_INFO *x = NULL, *tmp;
     const X509_NAME *name = NULL;
     BIO *b;
     const char *ext;
     unsigned char digest[EVP_MAX_MD_SIZE];
-    int type, errs = 0;
+    int type, j, num = 0, errs = 0;
     size_t i;

     /* Does it end with a recognized extension? */
@@ -265,34 +265,42 @@ static int do_file(const char *filename, const char *fullpath, enum Hash h)
     if (inf == NULL)
         goto end;

-    if (sk_X509_INFO_num(inf) != 1) {
+    /* Count the number of certs and CRLs and make x point to the last X509_INFO */
+    for (j = 0; j < sk_X509_INFO_num(inf); j++) {
+        tmp = sk_X509_INFO_value(inf, j);
+        if (tmp->x509 != NULL) {
+            x = tmp;
+            num++;
+        }
+        if (tmp->crl != NULL) {
+            x = tmp;
+            num++;
+        }
+    }
+    if (num != 1) {
         BIO_printf(bio_err,
             "%s: warning: skipping %s, "
-            "it does not contain exactly one certificate or CRL\n",
+            "it does not contain exactly one certificate or CRL in PEM format\n",
             opt_getprog(), filename);
         /* This is not an error. */
         goto end;
     }
-    x = sk_X509_INFO_value(inf, 0);
     if (x->x509 != NULL) {
         type = TYPE_CERT;
         name = X509_get_subject_name(x->x509);
         if (!X509_digest(x->x509, evpmd, digest, NULL)) {
-            BIO_printf(bio_err, "out of memory\n");
+            BIO_puts(bio_err, "out of memory\n");
             ++errs;
             goto end;
         }
-    } else if (x->crl != NULL) {
+    } else {
         type = TYPE_CRL;
         name = X509_CRL_get_issuer(x->crl);
         if (!X509_CRL_digest(x->crl, evpmd, digest, NULL)) {
-            BIO_printf(bio_err, "out of memory\n");
+            BIO_puts(bio_err, "out of memory\n");
             ++errs;
             goto end;
         }
-    } else {
-        ++errs;
-        goto end;
     }
     if (name != NULL) {
         if (h == HASH_NEW || h == HASH_BOTH) {
@@ -400,7 +408,7 @@ static int do_dir(const char *dirname, enum Hash h)
     numfiles = sk_OPENSSL_STRING_num(files);
     for (n = 0; n < numfiles; ++n) {
         filename = sk_OPENSSL_STRING_value(files, n);
-        if (BIO_snprintf(buf, buflen, "%s%s%s",
+        if (snprintf(buf, buflen, "%s%s%s",
                 dirname, pathsep, filename)
             >= buflen)
             continue;
@@ -424,7 +432,7 @@ static int do_dir(const char *dirname, enum Hash h)
                 nextep = ep->next;
                 if (ep->old_id < bp->num_needed) {
                     /* Link exists, and is used as-is */
-                    BIO_snprintf(buf, buflen, "%08x.%s%d", bp->hash,
+                    snprintf(buf, buflen, "%08x.%s%d", bp->hash,
                         suffixes[bp->type], ep->old_id);
                     if (verbose)
                         BIO_printf(bio_out, "link %s -> %s\n",
@@ -434,7 +442,7 @@ static int do_dir(const char *dirname, enum Hash h)
                     while (bit_isset(idmask, nextid))
                         nextid++;

-                    BIO_snprintf(buf, buflen, "%s%s%08x.%s%d",
+                    snprintf(buf, buflen, "%s%s%08x.%s%d",
                         dirname, pathsep, bp->hash,
                         suffixes[bp->type], nextid);
                     if (verbose)
@@ -456,7 +464,7 @@ static int do_dir(const char *dirname, enum Hash h)
                     bit_set(idmask, nextid);
                 } else if (remove_links) {
                     /* Link to be deleted */
-                    BIO_snprintf(buf, buflen, "%s%s%08x.%s%d",
+                    snprintf(buf, buflen, "%s%s%08x.%s%d",
                         dirname, pathsep, bp->hash,
                         suffixes[bp->type], ep->old_id);
                     if (verbose)
@@ -550,7 +558,6 @@ int rehash_main(int argc, char **argv)
     }

     /* Optional arguments are directories to scan. */
-    argc = opt_num_rest();
     argv = opt_rest();

     evpmd = EVP_sha1();
@@ -588,7 +595,7 @@ const OPTIONS rehash_options[] = {

 int rehash_main(int argc, char **argv)
 {
-    BIO_printf(bio_err, "Not available; use c_rehash script\n");
+    BIO_puts(bio_err, "Not available\n");
     return 1;
 }

diff --git a/deps/openssl/openssl/apps/req.c b/deps/openssl/openssl/apps/req.c
index 1dad6abcc75..19933ea3520 100644
--- a/deps/openssl/openssl/apps/req.c
+++ b/deps/openssl/openssl/apps/req.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -48,7 +48,7 @@
 #define UNSET_DAYS -2 /* -1 may be used for testing expiration checks */
 #define EXT_COPY_UNSET -1

-static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, X509_NAME *fsubj,
+static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, const X509_NAME *fsubj,
     int mutlirdn, int attribs, unsigned long chtype);
 static int prompt_info(X509_REQ *req,
     STACK_OF(CONF_VALUE) *dn_sk, const char *dn_sect,
@@ -71,8 +71,7 @@ static int check_end(const char *str, const char *end);
 static int join(char buf[], size_t buf_size, const char *name,
     const char *tail, const char *desc);
 static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr,
-    char **pkeytype, long *pkeylen,
-    ENGINE *keygen_engine);
+    char **pkeytype, long *pkeylen);

 static const char *section = "req";
 static CONF *req_conf = NULL;
@@ -84,8 +83,6 @@ typedef enum OPTION_choice {
     OPT_CIPHER,
     OPT_INFORM,
     OPT_OUTFORM,
-    OPT_ENGINE,
-    OPT_KEYGEN_ENGINE,
     OPT_KEY,
     OPT_PUBKEY,
     OPT_NEW,
@@ -139,11 +136,6 @@ const OPTIONS req_options[] = {
     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
     { "cipher", OPT_CIPHER, 's', "Specify the cipher for private key encryption" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-    { "keygen_engine", OPT_KEYGEN_ENGINE, 's',
-        "Specify engine to be used for key generation operations" },
-#endif
     { "in", OPT_IN, '<', "X.509 request input file (default stdin)" },
     { "inform", OPT_INFORM, 'F',
         "CSR input format to use (PEM or DER; by default try PEM first)" },
@@ -186,7 +178,7 @@ const OPTIONS req_options[] = {

     OPT_SECTION("Keys and Signing"),
     { "key", OPT_KEY, 's', "Key for signing, and to include unless -in given" },
-    { "keyform", OPT_KEYFORM, 'f', "Key file format (ENGINE, other values ignored)" },
+    { "keyform", OPT_KEYFORM, 'f', "Key file format (DER/PEM)" },
     { "pubkey", OPT_PUBKEY, '-', "Output public key" },
     { "keyout", OPT_KEYOUT, '>', "File to write private key to" },
     { "passin", OPT_PASSIN, 's', "Private key and certificate password source" },
@@ -248,7 +240,7 @@ static int duplicated(LHASH_OF(OPENSSL_STRING) *addexts, char *kv)
     while (isspace(_UC(*kv)))
         kv++;
     if ((p = strchr(kv, '=')) == NULL) {
-        BIO_printf(bio_err, "Parse error on -addext: missing '='\n");
+        BIO_puts(bio_err, "Parse error on -addext: missing '='\n");
         return -2;
     }
     off = p - kv;
@@ -260,7 +252,7 @@ static int duplicated(LHASH_OF(OPENSSL_STRING) *addexts, char *kv)
         if (!isspace(_UC(p[-1])))
             break;
     if (p == kv) {
-        BIO_printf(bio_err, "Parse error on -addext: missing key\n");
+        BIO_puts(bio_err, "Parse error on -addext: missing key\n");
         OPENSSL_free(kv);
         return -2;
     }
@@ -284,7 +276,6 @@ int req_main(int argc, char **argv)
 {
     ASN1_INTEGER *serial = NULL;
     BIO *out = NULL;
-    ENGINE *e = NULL, *gen_eng = NULL;
     EVP_PKEY *pkey = NULL, *CAkey = NULL;
     EVP_PKEY_CTX *genctx = NULL;
     STACK_OF(OPENSSL_STRING) *pkeyopts = NULL, *sigopts = NULL, *vfyopts = NULL;
@@ -301,7 +292,7 @@ int req_main(int argc, char **argv)
     char *passin = NULL, *passout = NULL;
     char *nofree_passin = NULL, *nofree_passout = NULL;
     char *subj = NULL;
-    X509_NAME *fsubj = NULL;
+    const X509_NAME *fsubj = NULL;
     char *template = default_config_file, *keyout = NULL;
     const char *keyalg = NULL;
     OPTION_CHOICE o;
@@ -337,18 +328,6 @@ int req_main(int argc, char **argv)
             if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &outformat))
                 goto opthelp;
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
-        case OPT_KEYGEN_ENGINE:
-#ifndef OPENSSL_NO_ENGINE
-            gen_eng = setup_engine(opt_arg(), 0);
-            if (gen_eng == NULL) {
-                BIO_printf(bio_err, "Can't find keygen engine %s\n", *argv);
-                goto opthelp;
-            }
-#endif
-            break;
         case OPT_KEY:
             keyfile = opt_arg();
             break;
@@ -475,7 +454,7 @@ int req_main(int argc, char **argv)
             not_after = opt_arg();
             break;
         case OPT_DAYS:
-            days = atoi(opt_arg());
+            days = opt_int_arg();
             if (days <= UNSET_DAYS) {
                 BIO_printf(bio_err, "%s: -days parameter arg must be >= -1\n",
                     prog);
@@ -484,7 +463,7 @@ int req_main(int argc, char **argv)
             break;
         case OPT_SET_SERIAL:
             if (serial != NULL) {
-                BIO_printf(bio_err, "Serial number supplied twice\n");
+                BIO_puts(bio_err, "Serial number supplied twice\n");
                 goto opthelp;
             }
             serial = s2i_ASN1_INTEGER(NULL, opt_arg());
@@ -552,24 +531,24 @@ int req_main(int argc, char **argv)

     if (!gen_x509) {
         if (days != UNSET_DAYS)
-            BIO_printf(bio_err, "Warning: Ignoring -days without -x509; not generating a certificate\n");
+            BIO_puts(bio_err, "Warning: Ignoring -days without -x509; not generating a certificate\n");
         if (not_before != NULL)
-            BIO_printf(bio_err, "Warning: Ignoring -not_before without -x509; not generating a certificate\n");
+            BIO_puts(bio_err, "Warning: Ignoring -not_before without -x509; not generating a certificate\n");
         if (not_after != NULL)
-            BIO_printf(bio_err, "Warning: Ignoring -not_after without -x509; not generating a certificate\n");
+            BIO_puts(bio_err, "Warning: Ignoring -not_after without -x509; not generating a certificate\n");
         if (ext_copy == EXT_COPY_NONE)
-            BIO_printf(bio_err, "Warning: Ignoring -copy_extensions 'none' when -x509 is not given\n");
+            BIO_puts(bio_err, "Warning: Ignoring -copy_extensions 'none' when -x509 is not given\n");
     }
     if (infile == NULL) {
         if (gen_x509)
             newreq = 1;
         else if (!newreq && isatty(fileno_stdin()))
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Warning: Will read cert request from stdin since no -in option is given\n");
     }

     if (!app_passwd(passargin, passargout, &passin, &passout)) {
-        BIO_printf(bio_err, "Error getting passwords\n");
+        BIO_puts(bio_err, "Error getting passwords\n");
         goto end;
     }

@@ -577,7 +556,7 @@ int req_main(int argc, char **argv)
         goto end;
     if (addext_bio != NULL) {
         if (verbose)
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Using additional configuration from -addext options\n");
         if ((addext_conf = app_load_config_bio(addext_bio, NULL)) == NULL)
             goto end;
@@ -614,7 +593,7 @@ int req_main(int argc, char **argv)
             digest = p;
     }

-    if (extsect == NULL)
+    if (extsect == NULL && !x509v1)
         extsect = app_conf_try_string(req_conf, section,
             gen_x509 ? V3_EXTENSIONS : REQ_EXTENSIONS);
     if (extsect != NULL) {
@@ -622,24 +601,21 @@ int req_main(int argc, char **argv)
         X509V3_CTX ctx;

         X509V3_set_ctx_test(&ctx);
-        X509V3_set_nconf(&ctx, req_conf);
-        if (!X509V3_EXT_add_nconf(req_conf, &ctx, extsect, NULL)) {
-            BIO_printf(bio_err,
-                "Error checking %s extension section %s\n",
-                gen_x509 ? "x509" : "request", extsect);
+        if (!do_EXT_add_nconf(req_conf, req_conf, &ctx, NULL,
+                !gen_x509
+                    ? "Error checking request extension section %s\n"
+                    : "Error checking x509 extension section %s\n",
+                extsect))
             goto end;
-        }
     }
     if (addext_conf != NULL) {
         /* Check syntax of command line extensions */
         X509V3_CTX ctx;

         X509V3_set_ctx_test(&ctx);
-        X509V3_set_nconf(&ctx, req_conf);
-        if (!X509V3_EXT_add_nconf(addext_conf, &ctx, "default", NULL)) {
-            BIO_printf(bio_err, "Error checking extensions defined using -addext\n");
+        if (!do_EXT_add_nconf(req_conf, addext_conf, &ctx, NULL,
+                "Error checking x509 extensions defined via -addext\n", NULL))
             goto end;
-        }
     }

     if (passin == NULL)
@@ -661,13 +637,13 @@ int req_main(int argc, char **argv)
     }

     if (keyfile != NULL) {
-        pkey = load_key(keyfile, keyform, 0, passin, e, "private key");
+        pkey = load_key(keyfile, keyform, 0, passin, "private key");
         if (pkey == NULL)
             goto end;
         app_RAND_load_conf(req_conf, section);
     }
     if (keyalg != NULL && pkey != NULL) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Warning: Not generating key via given -newkey option since -key is given\n");
         /* Better throw an error in this case */
     }
@@ -677,7 +653,7 @@ int req_main(int argc, char **argv)
         if (!app_conf_try_number(req_conf, section, BITS, &newkey_len))
             newkey_len = DEFAULT_KEY_LENGTH;

-        genctx = set_keygen_ctx(keyalg, &keyalgstr, &newkey_len, gen_eng);
+        genctx = set_keygen_ctx(keyalg, &keyalgstr, &newkey_len);
         if (genctx == NULL)
             goto end;

@@ -734,11 +710,11 @@ int req_main(int argc, char **argv)

     if (pkey != NULL && (keyfile == NULL || keyout != NULL)) {
         if (verbose) {
-            BIO_printf(bio_err, "Writing private key to ");
+            BIO_puts(bio_out, "Writing private key to ");
             if (keyout == NULL)
-                BIO_printf(bio_err, "stdout\n");
+                BIO_puts(bio_out, "stdout\n");
             else
-                BIO_printf(bio_err, "'%s'\n", keyout);
+                BIO_printf(bio_out, "'%s'\n", keyout);
         }
         out = bio_open_owner(keyout, outformat, 1);
         if (out == NULL)
@@ -765,7 +741,7 @@ int req_main(int argc, char **argv)
         }
         BIO_free_all(out);
         out = NULL;
-        BIO_printf(bio_err, "-----\n");
+        BIO_puts(bio_err, "-----\n");
     }

     /*
@@ -778,14 +754,14 @@ int req_main(int argc, char **argv)

     if (!newreq) {
         if (keyfile != NULL)
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Warning: Not placing -key in cert or request since request is used\n");
         req = load_csr_autofmt(infile /* if NULL, reads from stdin */,
             informat, vfyopts, "X509 request");
         if (req == NULL)
             goto end;
     } else if (infile != NULL) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Warning: Ignoring -in option since -new or -newkey or -precert is given\n");
         /* Better throw an error in this case, as done in the x509 app */
     }
@@ -794,11 +770,11 @@ int req_main(int argc, char **argv)
         CAkeyfile = CAfile;
     if (CAkeyfile != NULL) {
         if (CAfile == NULL) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Warning: Ignoring -CAkey option since no -CA option is given\n");
         } else {
             if ((CAkey = load_key(CAkeyfile, FORMAT_UNDEF,
-                     0, passin, e,
+                     0, passin,
                      CAkeyfile != CAfile
                          ? "issuer private key from -CAkey arg"
                          : "issuer private key from -CA arg"))
@@ -812,15 +788,15 @@ int req_main(int argc, char **argv)
             == NULL)
             goto end;
         if (!X509_check_private_key(CAcert, CAkey)) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Issuer CA certificate and key do not match\n");
             goto end;
         }
     }
     if (newreq || gen_x509) {
         if (CAcert == NULL && pkey == NULL) {
-            BIO_printf(bio_err, "Must provide a signature key using -key or"
-                                " provide -CA / -CAkey\n");
+            BIO_puts(bio_err, "Must provide a signature key using -key or"
+                              " provide -CA / -CAkey\n");
             goto end;
         }

@@ -831,7 +807,7 @@ int req_main(int argc, char **argv)
             }

             if (!make_REQ(req, pkey, fsubj, multirdn, !gen_x509, chtype)) {
-                BIO_printf(bio_err, "Error making certificate request\n");
+                BIO_puts(bio_err, "Error making certificate request\n");
                 goto end;
             }
             /* Note that -x509 can take over -key and -subj option values. */
@@ -840,11 +816,12 @@ int req_main(int argc, char **argv)
             EVP_PKEY *pub_key = X509_REQ_get0_pubkey(req);
             EVP_PKEY *issuer_key = CAcert != NULL ? CAkey : pkey;
             X509V3_CTX ext_ctx;
-            X509_NAME *issuer = CAcert != NULL ? X509_get_subject_name(CAcert) : X509_REQ_get_subject_name(req);
-            X509_NAME *n_subj = fsubj != NULL ? fsubj : X509_REQ_get_subject_name(req);

+            const X509_NAME *n_subj = fsubj != NULL ? fsubj : X509_REQ_get_subject_name(req);
+            const X509_NAME *issuer = CAcert != NULL ? X509_get_subject_name(CAcert)
+                                                     : X509_REQ_get_subject_name(req);
             if (CAcert != NULL && keyfile != NULL)
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "Warning: Not using -key or -newkey for signing since -CA option is given\n");

             if ((new_x509 = X509_new_ex(app_get0_libctx(),
@@ -865,7 +842,7 @@ int req_main(int argc, char **argv)
             if (days == UNSET_DAYS)
                 days = DEFAULT_DAYS;
             else if (not_after != NULL)
-                BIO_printf(bio_err, "Warning: -not_after option overriding -days option\n");
+                BIO_puts(bio_err, "Warning: -not_after option overriding -days option\n");
             if (!set_cert_times(new_x509, not_before, not_after, days, 1))
                 goto end;
             if (!X509_set_subject_name(new_x509, n_subj))
@@ -874,45 +851,41 @@ int req_main(int argc, char **argv)
                 goto end;
             if (ext_copy == EXT_COPY_UNSET) {
                 if (infile != NULL)
-                    BIO_printf(bio_err, "Warning: No -copy_extensions given; ignoring any extensions in the request\n");
+                    BIO_puts(bio_err, "Warning: No -copy_extensions given; ignoring any extensions in the request\n");
             } else if (!copy_extensions(new_x509, req, ext_copy)) {
-                BIO_printf(bio_err, "Error copying extensions from request\n");
+                BIO_puts(bio_err, "Error copying extensions from request\n");
                 goto end;
             }

             /* Set up V3 context struct */
             X509V3_set_ctx(&ext_ctx, CAcert != NULL ? CAcert : new_x509,
                 new_x509, NULL, NULL, X509V3_CTX_REPLACE);
+
             /* prepare fallback for AKID, but only if issuer cert == new_x509 */
             if (CAcert == NULL) {
                 if (!X509V3_set_issuer_pkey(&ext_ctx, issuer_key))
                     goto end;
                 if (!cert_matches_key(new_x509, issuer_key))
-                    BIO_printf(bio_err,
+                    BIO_puts(bio_err,
                         "Warning: Signature key and public key of cert do not match\n");
             }
-            X509V3_set_nconf(&ext_ctx, req_conf);

             /* Add extensions */
             if (extsect != NULL
-                && !X509V3_EXT_add_nconf(req_conf, &ext_ctx, extsect, new_x509)) {
-                BIO_printf(bio_err, "Error adding x509 extensions from section %s\n",
-                    extsect);
+                && !do_EXT_add_nconf(req_conf, req_conf, &ext_ctx, new_x509,
+                    "Error adding x509 extensions from section %s\n", extsect))
                 goto end;
-            }
             if (addext_conf != NULL
-                && !X509V3_EXT_add_nconf(addext_conf, &ext_ctx, "default",
-                    new_x509)) {
-                BIO_printf(bio_err, "Error adding x509 extensions defined via -addext\n");
+                && !do_EXT_add_nconf(addext_conf, addext_conf, &ext_ctx, new_x509,
+                    "Error adding x509 extensions defined via -addext\n", NULL))
                 goto end;
-            }

             /* If a pre-cert was requested, we need to add a poison extension */
             if (precert) {
                 if (X509_add1_ext_i2d(new_x509, NID_ct_precert_poison,
                         NULL, 1, 0)
                     != 1) {
-                    BIO_printf(bio_err, "Error adding poison extension\n");
+                    BIO_puts(bio_err, "Error adding poison extension\n");
                     goto end;
                 }
             }
@@ -925,26 +898,21 @@ int req_main(int argc, char **argv)
             X509V3_CTX ext_ctx;

             if (precert) {
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "Warning: Ignoring -precert flag since no cert is produced\n");
             }
             /* Set up V3 context struct */
             X509V3_set_ctx(&ext_ctx, NULL, NULL, req, NULL, X509V3_CTX_REPLACE);
-            X509V3_set_nconf(&ext_ctx, req_conf);

             /* Add extensions */
             if (extsect != NULL
-                && !X509V3_EXT_REQ_add_nconf(req_conf, &ext_ctx, extsect, req)) {
-                BIO_printf(bio_err, "Error adding request extensions from section %s\n",
-                    extsect);
+                && !do_EXT_REQ_add_nconf(req_conf, req_conf, &ext_ctx, req,
+                    "Error adding request extensions from section %s\n", extsect))
                 goto end;
-            }
             if (addext_conf != NULL
-                && !X509V3_EXT_REQ_add_nconf(addext_conf, &ext_ctx, "default",
-                    req)) {
-                BIO_printf(bio_err, "Error adding request extensions defined via -addext\n");
+                && !do_EXT_REQ_add_nconf(req_conf, addext_conf, &ext_ctx, req,
+                    "Error adding request extensions defined via -addext\n", "default"))
                 goto end;
-            }
             i = do_X509_REQ_sign(req, pkey, digest, sigopts);
             if (!i)
                 goto end;
@@ -953,12 +921,12 @@ int req_main(int argc, char **argv)

     if (subj != NULL && !newreq && !gen_x509) {
         if (verbose) {
-            BIO_printf(out, "Modifying subject of certificate request\n");
+            BIO_puts(out, "Modifying subject of certificate request\n");
             print_name(out, "Old subject=", X509_REQ_get_subject_name(req));
         }

         if (!X509_REQ_set_subject_name(req, fsubj)) {
-            BIO_printf(bio_err, "Error modifying subject of certificate request\n");
+            BIO_puts(bio_err, "Error modifying subject of certificate request\n");
             goto end;
         }

@@ -981,10 +949,11 @@ int req_main(int argc, char **argv)
         if (i < 0)
             goto end;
         if (i == 0) {
-            BIO_printf(bio_err, "Certificate request self-signature verify failure\n");
+            BIO_puts(bio_err, "Certificate request self-signature verify failure\n");
             goto end;
-        } else /* i > 0 */
-            BIO_printf(bio_out, "Certificate request self-signature verify OK\n");
+        } else /* i > 0 */ {
+            BIO_puts(bio_out, "Certificate request self-signature verify OK\n");
+        }
     }

     if (noout && !text && !modulus && !subject && !pubkey) {
@@ -1002,7 +971,7 @@ int req_main(int argc, char **argv)
         EVP_PKEY *tpubkey = X509_REQ_get0_pubkey(req);

         if (tpubkey == NULL) {
-            BIO_printf(bio_err, "Error getting public key\n");
+            BIO_puts(bio_err, "Error getting public key\n");
             goto end;
         }
         PEM_write_bio_PUBKEY(out, tpubkey);
@@ -1016,9 +985,9 @@ int req_main(int argc, char **argv)

         if (ret == 0) {
             if (gen_x509)
-                BIO_printf(bio_err, "Error printing certificate\n");
+                BIO_puts(bio_err, "Error printing certificate\n");
             else
-                BIO_printf(bio_err, "Error printing certificate request\n");
+                BIO_puts(bio_err, "Error printing certificate request\n");
             goto end;
         }
     }
@@ -1060,7 +1029,7 @@ int req_main(int argc, char **argv)
         else
             i = PEM_write_bio_X509_REQ(out, req);
         if (!i) {
-            BIO_printf(bio_err, "Unable to write certificate request\n");
+            BIO_puts(bio_err, "Unable to write certificate request\n");
             goto end;
         }
     }
@@ -1070,7 +1039,7 @@ int req_main(int argc, char **argv)
         else
             i = PEM_write_bio_X509(out, new_x509);
         if (!i) {
-            BIO_printf(bio_err, "Unable to write X509 certificate\n");
+            BIO_puts(bio_err, "Unable to write X509 certificate\n");
             goto end;
         }
     }
@@ -1090,17 +1059,13 @@ end:
     sk_OPENSSL_STRING_free(vfyopts);
     lh_OPENSSL_STRING_doall(addexts, exts_cleanup);
     lh_OPENSSL_STRING_free(addexts);
-#ifndef OPENSSL_NO_ENGINE
-    release_engine(gen_eng);
-#endif
     OPENSSL_free(keyalgstr);
     X509_REQ_free(req);
-    X509_NAME_free(fsubj);
+    X509_NAME_free((X509_NAME *)fsubj);
     X509_free(new_x509);
     X509_free(CAcert);
     EVP_PKEY_free(CAkey);
     ASN1_INTEGER_free(serial);
-    release_engine(e);
     if (passin != nofree_passin)
         OPENSSL_free(passin);
     if (passout != nofree_passout)
@@ -1108,7 +1073,7 @@ end:
     return ret;
 }

-static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, X509_NAME *fsubj,
+static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, const X509_NAME *fsubj,
     int multirdn, int attribs, unsigned long chtype)
 {
     int ret = 0, i;
@@ -1173,21 +1138,25 @@ static int prompt_info(X509_REQ *req,
     char *type, *value;
     const char *def;
     CONF_VALUE *v;
-    X509_NAME *subj = X509_REQ_get_subject_name(req);
+    X509_NAME *subj;
+    int ret = 0;
+
+    if ((subj = X509_NAME_new()) == NULL)
+        goto err;

     if (!batch) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "You are about to be asked to enter information that will be incorporated\n");
-        BIO_printf(bio_err, "into your certificate request.\n");
-        BIO_printf(bio_err,
+        BIO_puts(bio_err, "into your certificate request.\n");
+        BIO_puts(bio_err,
             "What you are about to enter is what is called a Distinguished Name or a DN.\n");
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "There are quite a few fields but you can leave some blank\n");
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "For some fields there will be a default value,\n");
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "If you enter '.', the field will be left blank.\n");
-        BIO_printf(bio_err, "-----\n");
+        BIO_puts(bio_err, "-----\n");
     }

     if (sk_CONF_VALUE_num(dn_sk)) {
@@ -1224,40 +1193,44 @@ static int prompt_info(X509_REQ *req,
             if ((nid = OBJ_txt2nid(type)) == NID_undef)
                 goto start;
             if (!join(buf, sizeof(buf), v->name, "_default", "Name"))
-                return 0;
+                goto err;
             if ((def = app_conf_try_string(req_conf, dn_sect, buf)) == NULL)
                 def = "";

             if (!join(buf, sizeof(buf), v->name, "_value", "Name"))
-                return 0;
+                goto err;
             if ((value = app_conf_try_string(req_conf, dn_sect, buf)) == NULL)
                 value = NULL;

             if (!join(buf, sizeof(buf), v->name, "_min", "Name"))
-                return 0;
+                goto err;
             if (!app_conf_try_number(req_conf, dn_sect, buf, &n_min))
                 n_min = -1;

             if (!join(buf, sizeof(buf), v->name, "_max", "Name"))
-                return 0;
+                goto err;
             if (!app_conf_try_number(req_conf, dn_sect, buf, &n_max))
                 n_max = -1;

             if (!add_DN_object(subj, v->value, def, value, nid,
                     n_min, n_max, chtype, mval))
-                return 0;
+                goto err;
         }
         if (X509_NAME_entry_count(subj) == 0) {
-            BIO_printf(bio_err, "Error: No objects specified in config file\n");
-            return 0;
+            BIO_puts(bio_err, "Error: No objects specified in config file\n");
+            goto err;
+        }
+
+        if (X509_REQ_set_subject_name(req, subj) == 0) {
+            BIO_printf(bio_err, "Error: Can't set subject name\n");
+            goto err;
         }

         if (attribs) {
             if ((attr_sk != NULL) && (sk_CONF_VALUE_num(attr_sk) > 0)
                 && (!batch)) {
-                BIO_printf(bio_err,
-                    "\nPlease enter the following 'extra' attributes\n");
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
+                    "\nPlease enter the following 'extra' attributes\n"
                     "to be sent with your certificate request\n");
             }

@@ -1280,31 +1253,34 @@ static int prompt_info(X509_REQ *req,
                     def = "";

                 if (!join(buf, sizeof(buf), type, "_value", "Name"))
-                    return 0;
+                    goto err;
                 value = app_conf_try_string(req_conf, attr_sect, buf);

                 if (!join(buf, sizeof(buf), type, "_min", "Name"))
-                    return 0;
+                    goto err;
                 if (!app_conf_try_number(req_conf, attr_sect, buf, &n_min))
                     n_min = -1;

                 if (!join(buf, sizeof(buf), type, "_max", "Name"))
-                    return 0;
+                    goto err;
                 if (!app_conf_try_number(req_conf, attr_sect, buf, &n_max))
                     n_max = -1;
-
                 if (!add_attribute_object(req,
                         v->value, def, value, nid, n_min,
                         n_max, chtype))
-                    return 0;
+                    goto err;
             }
         }
     } else {
-        BIO_printf(bio_err, "No template, please set one up.\n");
-        return 0;
+        BIO_puts(bio_err, "No template, please set one up.\n");
+        goto err;
     }

-    return 1;
+    ret = 1;
+
+err:
+    X509_NAME_free(subj);
+    return ret;
 }

 static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
@@ -1316,8 +1292,10 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
     char *type;
     CONF_VALUE *v;
     X509_NAME *subj;
+    int ret = 0;

-    subj = X509_REQ_get_subject_name(req);
+    if ((subj = X509_NAME_new()) == NULL)
+        goto err;

     for (i = 0; i < sk_CONF_VALUE_num(dn_sk); i++) {
         int mval;
@@ -1355,11 +1333,11 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
         if (!X509_NAME_add_entry_by_txt(subj, type, chtype,
                 (unsigned char *)v->value, -1, -1,
                 mval))
-            return 0;
+            goto err;
     }

     if (!X509_NAME_entry_count(subj)) {
-        BIO_printf(bio_err, "Error: No objects specified in config file\n");
+        BIO_puts(bio_err, "Error: No objects specified in config file\n");
         return 0;
     }
     if (attribs) {
@@ -1367,10 +1345,20 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
             v = sk_CONF_VALUE_value(attr_sk, i);
             if (!X509_REQ_add1_attr_by_txt(req, v->name, chtype,
                     (unsigned char *)v->value, -1))
-                return 0;
+                goto err;
         }
     }
-    return 1;
+
+    if (X509_REQ_set_subject_name(req, subj) == 0) {
+        BIO_printf(bio_err, "Error: Can't set subject name\n");
+        goto err;
+    }
+
+    ret = 1;
+
+err:
+    X509_NAME_free(subj);
+    return ret;
 }

 static int add_DN_object(X509_NAME *n, char *text, const char *def,
@@ -1408,7 +1396,7 @@ static int add_attribute_object(X509_REQ *req, char *text, const char *def,

     if (!X509_REQ_add1_attr_by_NID(req, nid, chtype,
             (unsigned char *)buf, -1)) {
-        BIO_printf(bio_err, "Error adding attribute\n");
+        BIO_puts(bio_err, "Error adding attribute\n");
         ret = 0;
     }

@@ -1450,9 +1438,9 @@ start:
         return 1;
     }

-    i = strlen(buf);
+    i = (int)strlen(buf);
     if (buf[i - 1] != '\n') {
-        BIO_printf(bio_err, "Missing newline at end of input\n");
+        BIO_puts(bio_err, "Missing newline at end of input\n");
         return 0;
     }
     buf[--i] = '\0';
@@ -1515,8 +1503,7 @@ static int join(char buf[], size_t buf_size, const char *name,
 }

 static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr,
-    char **pkeytype, long *pkeylen,
-    ENGINE *keygen_engine)
+    char **pkeytype, long *pkeylen)
 {
     EVP_PKEY_CTX *gctx = NULL;
     EVP_PKEY *param = NULL;
@@ -1544,9 +1531,9 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr,
         int len;

         if (p != NULL)
-            len = p - gstr;
+            len = (int)(p - gstr);
         else
-            len = strlen(gstr);
+            len = (int)strlen(gstr);

         if (strncmp(gstr, "param", len) == 0) {
             expect_paramfile = 1;
@@ -1570,10 +1557,12 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr,
     /* Treat the second part of gstr, if there is one */
     if (gstr != NULL) {
         /* If the second part starts with a digit, we assume it's a size */
-        if (!expect_paramfile && gstr[0] >= '0' && gstr[0] <= '9')
-            keylen = atol(gstr);
-        else
+        if (!expect_paramfile && gstr[0] >= '0' && gstr[0] <= '9') {
+            if (!opt_long(gstr, &keylen))
+                return NULL;
+        } else {
             paramfile = gstr;
+        }
     }

     if (paramfile != NULL) {
@@ -1617,7 +1606,7 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr,
         *pkeytype = OPENSSL_strdup(keytype);

     if (*pkeytype == NULL) {
-        BIO_printf(bio_err, "Out of memory\n");
+        BIO_puts(bio_err, "Out of memory\n");
         EVP_PKEY_free(param);
         return NULL;
     }
@@ -1627,29 +1616,18 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr,

     if (param != NULL) {
         if (!EVP_PKEY_is_a(param, *pkeytype)) {
-            BIO_printf(bio_err, "Key type does not match parameters\n");
+            BIO_puts(bio_err, "Key type does not match parameters\n");
             EVP_PKEY_free(param);
             return NULL;
         }

-        if (keygen_engine != NULL)
-            gctx = EVP_PKEY_CTX_new(param, keygen_engine);
-        else
-            gctx = EVP_PKEY_CTX_new_from_pkey(app_get0_libctx(),
-                param, app_get0_propq());
+        gctx = EVP_PKEY_CTX_new_from_pkey(app_get0_libctx(),
+            param, app_get0_propq());
         *pkeylen = EVP_PKEY_get_bits(param);
         EVP_PKEY_free(param);
     } else {
-        if (keygen_engine != NULL) {
-            int pkey_id = get_legacy_pkey_id(app_get0_libctx(), *pkeytype,
-                keygen_engine);
-
-            if (pkey_id != NID_undef)
-                gctx = EVP_PKEY_CTX_new_id(pkey_id, keygen_engine);
-        } else {
-            gctx = EVP_PKEY_CTX_new_from_name(app_get0_libctx(),
-                *pkeytype, app_get0_propq());
-        }
+        gctx = EVP_PKEY_CTX_new_from_name(app_get0_libctx(),
+            *pkeytype, app_get0_propq());
     }

     if (gctx == NULL) {
diff --git a/deps/openssl/openssl/apps/rsa.c b/deps/openssl/openssl/apps/rsa.c
index 780f990ab5d..c6eea728b4b 100644
--- a/deps/openssl/openssl/apps/rsa.c
+++ b/deps/openssl/openssl/apps/rsa.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -43,7 +43,6 @@ typedef enum OPTION_choice {
     OPT_COMMON,
     OPT_INFORM,
     OPT_OUTFORM,
-    OPT_ENGINE,
     OPT_IN,
     OPT_OUT,
     OPT_PUBIN,
@@ -70,13 +69,10 @@ const OPTIONS rsa_options[] = {
     { "help", OPT_HELP, '-', "Display this summary" },
     { "check", OPT_CHECK, '-', "Verify key consistency" },
     { "", OPT_CIPHER, '-', "Any supported cipher" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif

     OPT_SECTION("Input"),
     { "in", OPT_IN, 's', "Input file" },
-    { "inform", OPT_INFORM, 'f', "Input format (DER/PEM/P12/ENGINE)" },
+    { "inform", OPT_INFORM, 'f', "Input format (DER/PEM/P12)" },
     { "pubin", OPT_PUBIN, '-', "Expect a public key in input file" },
     { "RSAPublicKey_in", OPT_RSAPUBKEY_IN, '-', "Input is an RSAPublicKey" },
     { "passin", OPT_PASSIN, 's', "Input file pass phrase source" },
@@ -136,7 +132,6 @@ static int try_legacy_encoding(EVP_PKEY *pkey, int outformat, int pubout,

 int rsa_main(int argc, char **argv)
 {
-    ENGINE *e = NULL;
     BIO *out = NULL;
     EVP_PKEY *pkey = NULL;
     EVP_PKEY_CTX *pctx;
@@ -187,9 +182,6 @@ int rsa_main(int argc, char **argv)
         case OPT_PASSOUT:
             passoutarg = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_PUBIN:
             pubin = 1;
             break;
@@ -241,11 +233,11 @@ int rsa_main(int argc, char **argv)
     private = (text && !pubin) || (!pubout && !noout);

     if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
-        BIO_printf(bio_err, "Error getting passwords\n");
+        BIO_puts(bio_err, "Error getting passwords\n");
         goto end;
     }
     if (check && pubin) {
-        BIO_printf(bio_err, "Only private keys can be checked\n");
+        BIO_puts(bio_err, "Only private keys can be checked\n");
         goto end;
     }

@@ -261,9 +253,9 @@ int rsa_main(int argc, char **argv)
             tmpformat = informat;
         }

-        pkey = load_pubkey(infile, tmpformat, 1, passin, e, "public key");
+        pkey = load_pubkey(infile, tmpformat, 1, passin, "public key");
     } else {
-        pkey = load_key(infile, informat, 1, passin, e, "private key");
+        pkey = load_key(infile, informat, 1, passin, "private key");
     }

     if (pkey == NULL) {
@@ -271,7 +263,7 @@ int rsa_main(int argc, char **argv)
         goto end;
     }
     if (!EVP_PKEY_is_a(pkey, "RSA") && !EVP_PKEY_is_a(pkey, "RSA-PSS")) {
-        BIO_printf(bio_err, "Not an RSA key\n");
+        BIO_puts(bio_err, "Not an RSA key\n");
         goto end;
     }

@@ -294,9 +286,9 @@ int rsa_main(int argc, char **argv)

         /* Every RSA key has an 'n' */
         EVP_PKEY_get_bn_param(pkey, "n", &n);
-        BIO_printf(out, "Modulus=");
+        BIO_puts(out, "Modulus=");
         BN_print(out, n);
-        BIO_printf(out, "\n");
+        BIO_puts(out, "\n");
         BN_free(n);
     }

@@ -305,7 +297,7 @@ int rsa_main(int argc, char **argv)

         pctx = EVP_PKEY_CTX_new_from_pkey(NULL, pkey, NULL);
         if (pctx == NULL) {
-            BIO_printf(bio_err, "RSA unable to create PKEY context\n");
+            BIO_puts(bio_err, "RSA unable to create PKEY context\n");
             ERR_print_errors(bio_err);
             goto end;
         }
@@ -313,9 +305,9 @@ int rsa_main(int argc, char **argv)
         EVP_PKEY_CTX_free(pctx);

         if (r == 1) {
-            BIO_printf(out, "RSA key ok\n");
+            BIO_puts(out, "RSA key ok\n");
         } else if (r == 0) {
-            BIO_printf(bio_err, "RSA key not ok\n");
+            BIO_puts(bio_err, "RSA key not ok\n");
             ERR_print_errors(bio_err);
         } else if (r < 0) {
             ERR_print_errors(bio_err);
@@ -327,7 +319,7 @@ int rsa_main(int argc, char **argv)
         ret = 0;
         goto end;
     }
-    BIO_printf(bio_err, "writing RSA key\n");
+    BIO_puts(bio_err, "writing RSA key\n");

     /* Choose output type for the format */
     if (outformat == FORMAT_ASN1) {
@@ -338,12 +330,12 @@ int rsa_main(int argc, char **argv)
         output_type = "MSBLOB";
     } else if (outformat == FORMAT_PVK) {
         if (pubin) {
-            BIO_printf(bio_err, "PVK form impossible with public key input\n");
+            BIO_puts(bio_err, "PVK form impossible with public key input\n");
             goto end;
         }
         output_type = "PVK";
     } else {
-        BIO_printf(bio_err, "bad output format specified for outfile\n");
+        BIO_puts(bio_err, "bad output format specified for outfile\n");
         goto end;
     }

@@ -405,20 +397,19 @@ int rsa_main(int argc, char **argv)

         params[0] = OSSL_PARAM_construct_int("encrypt-level", &pvk_encr);
         if (!OSSL_ENCODER_CTX_set_params(ectx, params)) {
-            BIO_printf(bio_err, "invalid PVK encryption level\n");
+            BIO_puts(bio_err, "invalid PVK encryption level\n");
             goto end;
         }
     }

     if (!OSSL_ENCODER_to_bio(ectx, out)) {
-        BIO_printf(bio_err, "unable to write key\n");
+        BIO_puts(bio_err, "unable to write key\n");
         ERR_print_errors(bio_err);
         goto end;
     }
     ret = 0;
 end:
     OSSL_ENCODER_CTX_free(ectx);
-    release_engine(e);
     BIO_free_all(out);
     EVP_PKEY_free(pkey);
     EVP_CIPHER_free(enc);
diff --git a/deps/openssl/openssl/apps/rsautl.c b/deps/openssl/openssl/apps/rsautl.c
index 3c1194c1a58..8bbce5c83ac 100644
--- a/deps/openssl/openssl/apps/rsautl.c
+++ b/deps/openssl/openssl/apps/rsautl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -27,7 +27,6 @@

 typedef enum OPTION_choice {
     OPT_COMMON,
-    OPT_ENGINE,
     OPT_IN,
     OPT_OUT,
     OPT_ASN1PARSE,
@@ -57,14 +56,11 @@ const OPTIONS rsautl_options[] = {
     { "verify", OPT_VERIFY, '-', "Verify with public key" },
     { "encrypt", OPT_ENCRYPT, '-', "Encrypt with public key" },
     { "decrypt", OPT_DECRYPT, '-', "Decrypt with private key" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif

     OPT_SECTION("Input"),
     { "in", OPT_IN, '<', "Input file" },
     { "inkey", OPT_INKEY, 's', "Input key, by default an RSA private key" },
-    { "keyform", OPT_KEYFORM, 'E', "Private key format (ENGINE, other values ignored)" },
+    { "keyform", OPT_KEYFORM, 'f', "Private key format (DER/PEM)" },
     { "pubin", OPT_PUBIN, '-', "Input key is an RSA public pkey" },
     { "certin", OPT_CERTIN, '-', "Input is a cert carrying an RSA public key" },
     { "rev", OPT_REV, '-', "Reverse the order of the input buffer" },
@@ -88,7 +84,6 @@ const OPTIONS rsautl_options[] = {
 int rsautl_main(int argc, char **argv)
 {
     BIO *in = NULL, *out = NULL;
-    ENGINE *e = NULL;
     EVP_PKEY *pkey = NULL;
     EVP_PKEY_CTX *ctx = NULL;
     X509 *x;
@@ -123,9 +118,6 @@ int rsautl_main(int argc, char **argv)
         case OPT_OUT:
             outfile = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_ASN1PARSE:
             asn1parse = 1;
             break;
@@ -192,22 +184,22 @@ int rsautl_main(int argc, char **argv)
         goto end;

     if (need_priv && (key_type != KEY_PRIVKEY)) {
-        BIO_printf(bio_err, "A private key is needed for this operation\n");
+        BIO_puts(bio_err, "A private key is needed for this operation\n");
         goto end;
     }

     if (!app_passwd(passinarg, NULL, &passin, NULL)) {
-        BIO_printf(bio_err, "Error getting password\n");
+        BIO_puts(bio_err, "Error getting password\n");
         goto end;
     }

     switch (key_type) {
     case KEY_PRIVKEY:
-        pkey = load_key(keyfile, keyformat, 0, passin, e, "private key");
+        pkey = load_key(keyfile, keyformat, 0, passin, "private key");
         break;

     case KEY_PUBKEY:
-        pkey = load_pubkey(keyfile, keyformat, 0, NULL, e, "public key");
+        pkey = load_pubkey(keyfile, keyformat, 0, NULL, "public key");
         break;

     case KEY_CERT:
@@ -231,14 +223,14 @@ int rsautl_main(int argc, char **argv)

     keysize = EVP_PKEY_get_size(pkey);

-    rsa_in = app_malloc(keysize * 2, "hold rsa key");
+    rsa_in = app_malloc_array(2, keysize, "hold rsa key");
     rsa_out = app_malloc(keysize, "output rsa key");
     rsa_outlen = keysize;

     /* Read the input data */
     rv = BIO_read(in, rsa_in, keysize * 2);
     if (rv < 0) {
-        BIO_printf(bio_err, "Error reading input Data\n");
+        BIO_puts(bio_err, "Error reading input Data\n");
         goto end;
     }
     rsa_inlen = rv;
@@ -282,24 +274,23 @@ int rsautl_main(int argc, char **argv)
     }

     if (!rv) {
-        BIO_printf(bio_err, "RSA operation error\n");
+        BIO_puts(bio_err, "RSA operation error\n");
         ERR_print_errors(bio_err);
         goto end;
     }
     ret = 0;
     if (asn1parse) {
-        if (!ASN1_parse_dump(out, rsa_out, rsa_outlen, 1, -1)) {
+        if (!ASN1_parse_dump(out, rsa_out, (long)rsa_outlen, 1, -1)) {
             ERR_print_errors(bio_err);
         }
     } else if (hexdump) {
-        BIO_dump(out, (char *)rsa_out, rsa_outlen);
+        BIO_dump(out, (char *)rsa_out, (int)rsa_outlen);
     } else {
-        BIO_write(out, rsa_out, rsa_outlen);
+        BIO_write(out, rsa_out, (int)rsa_outlen);
     }
 end:
     EVP_PKEY_CTX_free(ctx);
     EVP_PKEY_free(pkey);
-    release_engine(e);
     BIO_free(in);
     BIO_free_all(out);
     OPENSSL_free(rsa_in);
diff --git a/deps/openssl/openssl/apps/s_client.c b/deps/openssl/openssl/apps/s_client.c
index b3f333a6993..9207230cec3 100644
--- a/deps/openssl/openssl/apps/s_client.c
+++ b/deps/openssl/openssl/apps/s_client.c
@@ -9,11 +9,13 @@
  */

 #include "internal/e_os.h"
+#include <inttypes.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+#include <limits.h>
 #include <openssl/e_os2.h>
 #include "internal/nelem.h"
 #include "internal/sockets.h" /* for openssl_fdset() */
@@ -107,11 +109,20 @@ static int keymatexportlen = 20;
 static BIO *bio_c_out = NULL;
 static int c_quiet = 0;
 static char *sess_out = NULL;
+#ifndef OPENSSL_NO_ECH
+static char *ech_config_list = NULL, *ech_grease_suite = NULL;
+static const char *sni_outer_name = NULL;
+static int ech_grease = 0, ech_ignore_cid = 0;
+static int ech_select = OSSL_ECHSTORE_ALL;
+static int ech_grease_type = OSSL_ECH_CURRENT_VERSION;
+static int ech_no_outer_sni = 0;
+#endif
 static SSL_SESSION *psksess = NULL;

 static void print_stuff(BIO *berr, SSL *con, int full);
 #ifndef OPENSSL_NO_OCSP
 static int ocsp_resp_cb(SSL *s, void *arg);
+static void print_ocsp_response(BIO *bp, OCSP_RESPONSE *rsp);
 #endif
 static int ldap_ExtendedResponse_parse(const char *buf, long rem);
 static int is_dNS_name(const char *host);
@@ -148,11 +159,11 @@ static unsigned int psk_client_cb(SSL *ssl, const char *hint, char *identity,
     unsigned char *key;

     if (c_debug)
-        BIO_printf(bio_c_out, "psk_client_cb\n");
+        BIO_puts(bio_c_out, "psk_client_cb\n");
     if (!hint) {
         /* no ServerKeyExchange message */
         if (c_debug)
-            BIO_printf(bio_c_out,
+            BIO_puts(bio_c_out,
                 "NULL received PSK identity hint, continuing anyway\n");
     } else if (c_debug) {
         BIO_printf(bio_c_out, "Received PSK identity hint '%s'\n", hint);
@@ -161,8 +172,8 @@ static unsigned int psk_client_cb(SSL *ssl, const char *hint, char *identity,
     /*
      * lookup PSK identity and PSK key based on the given identity hint here
      */
-    ret = BIO_snprintf(identity, max_identity_len, "%s", psk_identity);
-    if (ret < 0 || (unsigned int)ret > max_identity_len)
+    ret = snprintf(identity, max_identity_len, "%s", psk_identity);
+    if (ret < 0 || (unsigned int)ret >= max_identity_len)
         goto out_err;
     if (c_debug)
         BIO_printf(bio_c_out, "created identity '%s' len=%d\n", identity,
@@ -177,7 +188,7 @@ static unsigned int psk_client_cb(SSL *ssl, const char *hint, char *identity,
     }
     if (max_psk_len > INT_MAX || key_len > (long)max_psk_len) {
         BIO_printf(bio_err,
-            "psk buffer of callback is too small (%d) for key (%ld)\n",
+            "psk buffer of callback is too small (%u) for key (%ld)\n",
             max_psk_len, key_len);
         OPENSSL_free(key);
         return 0;
@@ -192,7 +203,7 @@ static unsigned int psk_client_cb(SSL *ssl, const char *hint, char *identity,
     return key_len;
 out_err:
     if (c_debug)
-        BIO_printf(bio_err, "Error in PSK client callback\n");
+        BIO_puts(bio_err, "Error in PSK client callback\n");
     return 0;
 }
 #endif
@@ -206,6 +217,7 @@ static int psk_use_session_cb(SSL *s, const EVP_MD *md,
 {
     SSL_SESSION *usesess = NULL;
     const SSL_CIPHER *cipher = NULL;
+    const int version1_3 = SSL_is_dtls(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;

     if (psksess != NULL) {
         if (!SSL_SESSION_up_ref(psksess))
@@ -224,7 +236,7 @@ static int psk_use_session_cb(SSL *s, const EVP_MD *md,
         /* We default to SHA-256 */
         cipher = SSL_CIPHER_find(s, tls13_aes128gcmsha256_id);
         if (cipher == NULL) {
-            BIO_printf(bio_err, "Error finding suitable ciphersuite\n");
+            BIO_puts(bio_err, "Error finding suitable ciphersuite\n");
             OPENSSL_free(key);
             return 0;
         }
@@ -233,7 +245,7 @@ static int psk_use_session_cb(SSL *s, const EVP_MD *md,
         if (usesess == NULL
             || !SSL_SESSION_set1_master_key(usesess, key, key_len)
             || !SSL_SESSION_set_cipher(usesess, cipher)
-            || !SSL_SESSION_set_protocol_version(usesess, TLS1_3_VERSION)) {
+            || !SSL_SESSION_set_protocol_version(usesess, version1_3)) {
             OPENSSL_free(key);
             goto err;
         }
@@ -276,7 +288,7 @@ static int ssl_servername_cb(SSL *s, int *ad, void *arg)
     if (SSL_get_servername_type(s) != -1)
         p->ack = !SSL_session_reused(s) && hn != NULL;
     else
-        BIO_printf(bio_err, "Can't use SSL_get_servername\n");
+        BIO_puts(bio_err, "Can't use SSL_get_servername\n");

     return SSL_TLSEXT_ERR_OK;
 }
@@ -300,7 +312,7 @@ static int next_proto_cb(SSL *s, unsigned char **out, unsigned char *outlen,
     if (!c_quiet) {
         /* We can assume that |in| is syntactically valid. */
         unsigned i;
-        BIO_printf(bio_c_out, "Protocols advertised by server: ");
+        BIO_puts(bio_c_out, "Protocols advertised by server: ");
         for (i = 0; i < inlen;) {
             if (i)
                 BIO_write(bio_c_out, ", ", 2);
@@ -310,7 +322,8 @@ static int next_proto_cb(SSL *s, unsigned char **out, unsigned char *outlen,
         BIO_write(bio_c_out, "\n", 1);
     }

-    ctx->status = SSL_select_next_proto(out, outlen, in, inlen, ctx->data, ctx->len);
+    ctx->status = SSL_select_next_proto(out, outlen, in, inlen,
+        ctx->data, (unsigned int)ctx->len);
     return SSL_TLSEXT_ERR_OK;
 }
 #endif /* ndef OPENSSL_NO_NEXTPROTONEG */
@@ -330,9 +343,9 @@ static int serverinfo_cli_parse_cb(SSL *s, unsigned int ext_type,
     ext_buf[3] = (unsigned char)(inlen);
     memcpy(ext_buf + 4, in, inlen);

-    BIO_snprintf(pem_name, sizeof(pem_name), "SERVERINFO FOR EXTENSION %d",
+    snprintf(pem_name, sizeof(pem_name), "SERVERINFO FOR EXTENSION %u",
         ext_type);
-    PEM_write_bio(bio_c_out, pem_name, "", ext_buf, 4 + inlen);
+    PEM_write_bio(bio_c_out, pem_name, "", ext_buf, (long)(4 + inlen));
     return 1;
 }

@@ -344,15 +357,22 @@ static ossl_ssize_t hexdecode(const char **inptr, void *result)
 {
     unsigned char **out = (unsigned char **)result;
     const char *in = *inptr;
-    unsigned char *ret = app_malloc(strlen(in) / 2, "hexdecode");
-    unsigned char *cp = ret;
+    size_t retlen = strlen(in) / 2;
+    unsigned char *ret = NULL, *cp;
     uint8_t byte;
     int nibble = 0;

-    if (ret == NULL)
+    if (retlen > 0) {
+        if ((ret = app_malloc(retlen, "hexdecode")) == NULL)
+            return -1;
+    } else if (*in == '\0') {
+        *out = NULL;
+        return 0;
+    } else {
         return -1;
+    }

-    for (byte = 0; *in; ++in) {
+    for (cp = ret, byte = 0; *in; ++in) {
         int x;

         if (isspace(_UC(*in)))
@@ -423,9 +443,7 @@ static int tlsa_import_rr(SSL *con, const char *rrdata)
         { &selector, "selector", checked_uint8 },
         { &mtype, "mtype", checked_uint8 },
         { &data, "data", hexdecode },
-        {
-            NULL,
-        }
+        { NULL, NULL, NULL },
     };
     struct tlsa_field *f;
     int ret;
@@ -500,16 +518,18 @@ typedef enum OPTION_choice {
     OPT_CRLF,
     OPT_QUIET,
     OPT_NBIO,
-    OPT_SSL_CLIENT_ENGINE,
     OPT_IGN_EOF,
     OPT_NO_IGN_EOF,
     OPT_DEBUG,
     OPT_TLSEXTDEBUG,
-    OPT_STATUS,
     OPT_WDEBUG,
+#ifndef OPENSSL_NO_OCSP
+    OPT_STATUS,
+    OPT_STATUS_OCSP_CHECK_LEAF,
+    OPT_STATUS_OCSP_CHECK_ALL,
+#endif
     OPT_MSG,
     OPT_MSGFILE,
-    OPT_ENGINE,
     OPT_TRACE,
     OPT_SECURITY_DEBUG,
     OPT_SECURITY_DEBUG_VERBOSE,
@@ -526,7 +546,6 @@ typedef enum OPTION_choice {
     OPT_SRP_LATEUSER,
     OPT_SRP_MOREGROUPS,
 #endif
-    OPT_SSL3,
     OPT_SSL_CONFIG,
     OPT_TLS1_3,
     OPT_TLS1_2,
@@ -535,6 +554,7 @@ typedef enum OPTION_choice {
     OPT_DTLS,
     OPT_DTLS1,
     OPT_DTLS1_2,
+    OPT_DTLS1_3,
     OPT_QUIC,
     OPT_SCTP,
     OPT_TIMEOUT,
@@ -582,6 +602,7 @@ typedef enum OPTION_choice {
     OPT_S_ENUM,
     OPT_IGNORE_UNEXPECTED_EOF,
     OPT_FALLBACKSCSV,
+    OPT_GREASE,
     OPT_NOCMDS,
     OPT_ADV,
     OPT_PROXY,
@@ -598,8 +619,20 @@ typedef enum OPTION_choice {
     OPT_ENABLE_PHA,
     OPT_ENABLE_SERVER_RPK,
     OPT_ENABLE_CLIENT_RPK,
+    OPT_EXPECTED_RPK,
     OPT_SCTP_LABEL_BUG,
     OPT_KTLS,
+#ifndef OPENSSL_NO_ECH
+    OPT_ECHCONFIGLIST,
+    OPT_SNIOUTER,
+    OPT_ALPN_OUTER,
+    OPT_ECH_SELECT,
+    OPT_ECH_IGNORE_CONFIG_ID,
+    OPT_ECH_GREASE,
+    OPT_ECH_GREASE_SUITE,
+    OPT_ECH_GREASE_TYPE,
+    OPT_ECH_NO_OUTER_SNI,
+#endif
     OPT_R_ENUM,
     OPT_PROV_ENUM
 } OPTION_CHOICE;
@@ -609,11 +642,6 @@ const OPTIONS s_client_options[] = {

     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-    { "ssl_client_engine", OPT_SSL_CLIENT_ENGINE, 's',
-        "Specify engine to be used for client certificate operations" },
-#endif
     { "ssl_config", OPT_SSL_CONFIG, 's', "Use specified section for SSL_CTX configuration" },
 #ifndef OPENSSL_NO_CT
     { "ct", OPT_CT, '-', "Request and parse SCTs (also enables OCSP stapling)" },
@@ -648,6 +676,7 @@ const OPTIONS s_client_options[] = {
     { "read_buf", OPT_READ_BUF, 'p',
         "Default read buffer size to be used for connections" },
     { "fallback_scsv", OPT_FALLBACKSCSV, '-', "Send the fallback SCSV" },
+    { "grease", OPT_GREASE, '-', "Send GREASE values in ClientHello (RFC 8701)" },

     OPT_SECTION("Identity"),
     { "cert", OPT_CERT, '<', "Client certificate file to use" },
@@ -657,13 +686,13 @@ const OPTIONS s_client_options[] = {
         "Client certificate chain file (in PEM format)" },
     { "build_chain", OPT_BUILD_CHAIN, '-', "Build client certificate chain" },
     { "key", OPT_KEY, 's', "Private key file to use; default: -cert file" },
-    { "keyform", OPT_KEYFORM, 'E', "Key format (ENGINE, other values ignored)" },
+    { "keyform", OPT_KEYFORM, 'f', "Key format (DER/PEM)" },
     { "pass", OPT_PASS, 's', "Private key and cert file pass phrase source" },
-    { "verify", OPT_VERIFY, 'p', "Turn on peer certificate verification" },
+    { "verify", OPT_VERIFY, 'p', "Turn on peer certificate verification, set depth" },
     { "nameopt", OPT_NAMEOPT, 's', "Certificate subject/issuer name printing options" },
-    { "CApath", OPT_CAPATH, '/', "PEM format directory of CA's" },
-    { "CAfile", OPT_CAFILE, '<', "PEM format file of CA's" },
-    { "CAstore", OPT_CASTORE, ':', "URI to store of CA's" },
+    { "CAfile", OPT_CAFILE, '<', "File in PEM format with trusted CA certs" },
+    { "CApath", OPT_CAPATH, '/', "Dir with trusted CA cert files in PEM format" },
+    { "CAstore", OPT_CASTORE, ':', "URI of store with trusted CA certs" },
     { "no-CAfile", OPT_NOCAFILE, '-',
         "Do not load the default certificates file" },
     { "no-CApath", OPT_NOCAPATH, '-',
@@ -672,6 +701,8 @@ const OPTIONS s_client_options[] = {
         "Do not load certificates from the default certificates store" },
     { "requestCAfile", OPT_REQCAFILE, '<',
         "PEM format file of CA names to send to the server" },
+    { "expected-rpks", OPT_EXPECTED_RPK, '<',
+        "PEM file with expected server public key(s)" },
 #if defined(TCP_FASTOPEN) && !defined(OPENSSL_NO_TFO)
     { "tfo", OPT_TFO, '-', "Connect using TCP Fast Open" },
 #endif
@@ -708,6 +739,17 @@ const OPTIONS s_client_options[] = {
     { "no-interactive", OPT_NO_INTERACTIVE, '-',
         "Don't run the client in the interactive mode" },

+#ifndef OPENSSL_NO_OCSP
+    OPT_SECTION("OCSP stapling"),
+    { "status", OPT_STATUS, '-',
+        "Sends a certificate status request to the server (OCSP stapling) "
+        "The server response (if any) will be printed out." },
+    { "ocsp_check_leaf", OPT_STATUS_OCSP_CHECK_LEAF, '-',
+        "Require checking leaf certificate status, attempting to use OCSP stapling first" },
+    { "ocsp_check_all", OPT_STATUS_OCSP_CHECK_ALL, '-',
+        "Require checking status of full chain, attempting to use OCSP stapling first" },
+#endif
+
     OPT_SECTION("Debug"),
     { "showcerts", OPT_SHOWCERTS, '-',
         "Show all certificates sent by the server" },
@@ -742,9 +784,6 @@ const OPTIONS s_client_options[] = {
         "Hex dump of all TLS extensions received" },
     { "ignore_unexpected_eof", OPT_IGNORE_UNEXPECTED_EOF, '-',
         "Do not treat lack of close_notify from a peer as an error" },
-#ifndef OPENSSL_NO_OCSP
-    { "status", OPT_STATUS, '-', "Request certificate status from server" },
-#endif
     { "serverinfo", OPT_SERVERINFO, 's',
         "types  Send empty ClientHello extensions (comma-separated numbers)" },
     { "alpn", OPT_ALPN, 's',
@@ -753,9 +792,6 @@ const OPTIONS s_client_options[] = {
     { "nbio", OPT_NBIO, '-', "Use non-blocking IO" },

     OPT_SECTION("Protocol and version"),
-#ifndef OPENSSL_NO_SSL3
-    { "ssl3", OPT_SSL3, '-', "Just use SSLv3" },
-#endif
 #ifndef OPENSSL_NO_TLS1
     { "tls1", OPT_TLS1, '-', "Just use TLSv1" },
 #endif
@@ -781,6 +817,9 @@ const OPTIONS s_client_options[] = {
 #ifndef OPENSSL_NO_DTLS1_2
     { "dtls1_2", OPT_DTLS1_2, '-', "Just use DTLSv1.2" },
 #endif
+#ifndef OPENSSL_NO_DTLS1_3
+    { "dtls1_3", OPT_DTLS1_3, '-', "Just use DTLSv1.3" },
+#endif
 #ifndef OPENSSL_NO_SCTP
     { "sctp", OPT_SCTP, '-', "Use SCTP" },
     { "sctp_label_bug", OPT_SCTP_LABEL_BUG, '-', "Enable SCTP label length bug" },
@@ -797,6 +836,27 @@ const OPTIONS s_client_options[] = {
     { "use_srtp", OPT_USE_SRTP, 's',
         "Offer SRTP key management with a colon-separated profile list" },
 #endif
+
+#ifndef OPENSSL_NO_ECH
+    { "ech_config_list", OPT_ECHCONFIGLIST, 's',
+        "Set ECHConfigList, value is base64-encoded ECHConfigList" },
+    { "ech_outer_alpn", OPT_ALPN_OUTER, 's',
+        "Specify outer ALPN value, when using ECH (comma-separated list)" },
+    { "ech_outer_sni", OPT_SNIOUTER, 's',
+        "The name to put in the outer CH when overriding the server's choice" },
+    { "ech_no_outer_sni", OPT_ECH_NO_OUTER_SNI, '-',
+        "Do not send the server name (SNI) extension in the outer ClientHello" },
+    { "ech_select", OPT_ECH_SELECT, 'n',
+        "Select one ECHConfig from the set provided via -ech_config_list" },
+    { "ech_grease", OPT_ECH_GREASE, '-',
+        "Send GREASE values when not really using ECH" },
+    { "ech_grease_suite", OPT_ECH_GREASE_SUITE, 's',
+        "Use this HPKE suite for GREASE values when not really using ECH" },
+    { "ech_grease_type", OPT_ECH_GREASE_TYPE, 'n',
+        "Use this TLS extension type for GREASE values when not really using ECH" },
+    { "ech_ignore_cid", OPT_ECH_IGNORE_CONFIG_ID, '-',
+        "Ignore the server-chosen ECH config ID and send a random value" },
+#endif
 #ifndef OPENSSL_NO_SRP
     { "srpuser", OPT_SRPUSER, 's', "(deprecated) SRP authentication for 'user'" },
     { "srppass", OPT_SRPPASS, 's', "(deprecated) Password for 'user'" },
@@ -821,17 +881,21 @@ const OPTIONS s_client_options[] = {
         "Close connection on verification error" },
     { "verify_quiet", OPT_VERIFY_QUIET, '-', "Restrict verify output to errors" },
     { "chainCAfile", OPT_CHAINCAFILE, '<',
-        "CA file for certificate chain (PEM format)" },
+        "File in PEM format with trusted CA certs to build own cert chain" },
     { "chainCApath", OPT_CHAINCAPATH, '/',
-        "Use dir as certificate store path to build CA certificate chain" },
+        "Dir with trusted CA cert files in PEM format to build own cert chain" },
     { "chainCAstore", OPT_CHAINCASTORE, ':',
-        "CA store URI for certificate chain" },
+        "URI of trusted CA cert store to build own cert chain" },
+    { OPT_MORE_STR, 0, 0,
+        "NOTE: these override -CApath, -CAfile, and -CAstore for client chain building" },
     { "verifyCAfile", OPT_VERIFYCAFILE, '<',
-        "CA file for certificate verification (PEM format)" },
+        "File in PEM format with trusted CA certs for server cert verification" },
     { "verifyCApath", OPT_VERIFYCAPATH, '/',
-        "Use dir as certificate store path to verify CA certificate" },
+        "Dir with trusted CA cert files in PEM format for server cert verification" },
     { "verifyCAstore", OPT_VERIFYCASTORE, ':',
-        "CA store URI for certificate verification" },
+        "URI of trusted CA cert store for server cert verification" },
+    { OPT_MORE_STR, 0, 0,
+        "NOTE: these override -CApath, -CAfile, and -CAstore for server cert verification" },
     OPT_X_OPTIONS,
     OPT_PROV_OPTIONS,

@@ -881,9 +945,9 @@ static const OPT_PAIR services[] = {
 #define IS_UNIX_FLAG(o) (o == OPT_UNIX)

 #define IS_PROT_FLAG(o)                                                           \
-    (o == OPT_SSL3 || o == OPT_TLS1 || o == OPT_TLS1_1 || o == OPT_TLS1_2         \
+    (o == OPT_TLS1 || o == OPT_TLS1_1 || o == OPT_TLS1_2                          \
         || o == OPT_TLS1_3 || o == OPT_DTLS || o == OPT_DTLS1 || o == OPT_DTLS1_2 \
-        || o == OPT_QUIC)
+        || o == OPT_DTLS1_3 || o == OPT_QUIC)

 /* Free |*dest| and optionally set it to a copy of |source|. */
 static void freeandcopy(char **dest, const char *source)
@@ -896,6 +960,7 @@ static void freeandcopy(char **dest, const char *source)

 static int new_session_cb(SSL *s, SSL_SESSION *sess)
 {
+    const int version1_3 = SSL_is_dtls(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;

     if (sess_out != NULL) {
         BIO *stmp = BIO_new_file(sess_out, "w");
@@ -909,14 +974,14 @@ static int new_session_cb(SSL *s, SSL_SESSION *sess)
     }

     /*
-     * Session data gets dumped on connection for TLSv1.2 and below, and on
-     * arrival of the NewSessionTicket for TLSv1.3.
+     * Session data gets dumped on connection for (D)TLSv1.2 and below, and on
+     * arrival of the NewSessionTicket for (D)TLSv1.3.
      */
-    if (SSL_version(s) == TLS1_3_VERSION) {
-        BIO_printf(bio_c_out,
+    if (SSL_version(s) == version1_3) {
+        BIO_puts(bio_c_out,
             "---\nPost-Handshake New Session Ticket arrived:\n");
         SSL_SESSION_print(bio_c_out, sess);
-        BIO_printf(bio_c_out, "---\n");
+        BIO_puts(bio_c_out, "---\n");
     }

     /*
@@ -938,6 +1003,7 @@ int s_client_main(int argc, char **argv)
     SSL_EXCERT *exc = NULL;
     SSL_CONF_CTX *cctx = NULL;
     STACK_OF(OPENSSL_STRING) *ssl_args = NULL;
+    STACK_OF(OPENSSL_STRING) *rpk_files = NULL;
     char *dane_tlsa_domain = NULL;
     STACK_OF(OPENSSL_STRING) *dane_tlsa_rrset = NULL;
     int dane_ee_no_name = 0;
@@ -979,22 +1045,24 @@ int s_client_main(int argc, char **argv)
 #endif
     int read_buf_len = 0;
     int fallback_scsv = 0;
+    int grease = 0;
     OPTION_CHOICE o;
 #ifndef OPENSSL_NO_DTLS
     int enable_timeouts = 0;
     long socket_mtu = 0;
 #endif
-#ifndef OPENSSL_NO_ENGINE
-    ENGINE *ssl_client_engine = NULL;
-#endif
-    ENGINE *e = NULL;
 #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
     struct timeval tv;
 #endif
-    const char *servername = NULL;
+    char *servername = NULL;
     char *sname_alloc = NULL;
     int noservername = 0;
     const char *alpn_in = NULL;
+#ifndef OPENSSL_NO_ECH
+    const char *alpn_outer_in = NULL;
+    int rv = 0;
+    OSSL_ECHSTORE *es = NULL;
+#endif
     tlsextctx tlsextcbp = { NULL, 0 };
     const char *ssl_config = NULL;
 #define MAX_SI_TYPES 100
@@ -1014,6 +1082,9 @@ int s_client_main(int argc, char **argv)
 #ifndef OPENSSL_NO_CT
     char *ctlog_file = NULL;
     int ct_validation = 0;
+#endif
+#ifndef OPENSSL_NO_NEXTPROTONEG
+    int version1_3;
 #endif
     int min_version = 0, max_version = 0, prot_opt = 0, no_prot_opt = 0;
     int async = 0;
@@ -1094,13 +1165,13 @@ int s_client_main(int argc, char **argv)
         }

         if (IS_PROT_FLAG(o) && ++prot_opt > 1) {
-            BIO_printf(bio_err, "Cannot supply multiple protocol flags\n");
+            BIO_puts(bio_err, "Cannot supply multiple protocol flags\n");
             goto end;
         }
         if (IS_NO_PROT_FLAG(o))
             no_prot_opt++;
         if (prot_opt == 1 && no_prot_opt) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Cannot supply both a protocol flag and '-no_<prot>'\n");
             goto end;
         }
@@ -1165,7 +1236,7 @@ int s_client_main(int argc, char **argv)
             break;
         case OPT_VERIFY:
             verify = SSL_VERIFY_PEER;
-            verify_args.depth = atoi(opt_arg());
+            verify_args.depth = opt_int_arg();
             if (!c_quiet)
                 BIO_printf(bio_err, "verify depth is %d\n", verify_args.depth);
             break;
@@ -1238,7 +1309,7 @@ int s_client_main(int argc, char **argv)
             crlf = 1;
             break;
         case OPT_QUIET:
-            c_quiet = c_ign_eof = 1;
+            verify_args.quiet = c_quiet = c_ign_eof = 1;
             break;
         case OPT_NBIO:
             c_nbio = 1;
@@ -1249,18 +1320,6 @@ int s_client_main(int argc, char **argv)
         case OPT_ADV:
             cmdmode = USER_DATA_MODE_ADVANCED;
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 1);
-            break;
-        case OPT_SSL_CLIENT_ENGINE:
-#ifndef OPENSSL_NO_ENGINE
-            ssl_client_engine = setup_engine(opt_arg(), 0);
-            if (ssl_client_engine == NULL) {
-                BIO_printf(bio_err, "Error getting client auth engine\n");
-                goto opthelp;
-            }
-#endif
-            break;
         case OPT_R_CASES:
             if (!opt_rand(o))
                 goto end;
@@ -1281,11 +1340,22 @@ int s_client_main(int argc, char **argv)
         case OPT_TLSEXTDEBUG:
             c_tlsextdebug = 1;
             break;
-        case OPT_STATUS:
 #ifndef OPENSSL_NO_OCSP
+        case OPT_STATUS:
             c_status_req = 1;
-#endif
             break;
+        case OPT_STATUS_OCSP_CHECK_LEAF:
+            c_status_req = 1;
+            X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_OCSP_RESP_CHECK);
+            vpmtouched++;
+            break;
+        case OPT_STATUS_OCSP_CHECK_ALL:
+            c_status_req = 1;
+            X509_VERIFY_PARAM_set_flags(vpm,
+                X509_V_FLAG_OCSP_RESP_CHECK | X509_V_FLAG_OCSP_RESP_CHECK_ALL);
+            vpmtouched++;
+            break;
+#endif
         case OPT_WDEBUG:
 #ifdef WATT32
             dbug_init();
@@ -1347,7 +1417,7 @@ int s_client_main(int argc, char **argv)
                 min_version = TLS1_VERSION;
             break;
         case OPT_SRP_STRENGTH:
-            srp_arg.strength = atoi(opt_arg());
+            srp_arg.strength = opt_int_arg();
             BIO_printf(bio_err, "SRP minimal length for N is %d\n",
                 srp_arg.strength);
             if (min_version < TLS1_VERSION)
@@ -1367,15 +1437,6 @@ int s_client_main(int argc, char **argv)
         case OPT_SSL_CONFIG:
             ssl_config = opt_arg();
             break;
-        case OPT_SSL3:
-            min_version = SSL3_VERSION;
-            max_version = SSL3_VERSION;
-            socket_type = SOCK_STREAM;
-#ifndef OPENSSL_NO_DTLS
-            isdtls = 0;
-#endif
-            isquic = 0;
-            break;
         case OPT_TLS1_3:
             min_version = TLS1_3_VERSION;
             max_version = TLS1_3_VERSION;
@@ -1438,6 +1499,18 @@ int s_client_main(int argc, char **argv)
             socket_type = SOCK_DGRAM;
             isdtls = 1;
             isquic = 0;
+#endif
+            break;
+        case OPT_DTLS1_3:
+#ifndef OPENSSL_NO_DTLS1_3
+            meth = DTLS_client_method();
+            min_version = DTLS1_3_VERSION;
+            max_version = DTLS1_3_VERSION;
+            socket_type = SOCK_DGRAM;
+            isdtls = 1;
+#ifndef OPENSS_NO_QUIC
+            isquic = 0;
+#endif
 #endif
             break;
         case OPT_QUIC:
@@ -1469,12 +1542,16 @@ int s_client_main(int argc, char **argv)
             break;
         case OPT_MTU:
 #ifndef OPENSSL_NO_DTLS
-            socket_mtu = atol(opt_arg());
+            if (!opt_long(opt_arg(), &socket_mtu))
+                goto opthelp;
 #endif
             break;
         case OPT_FALLBACKSCSV:
             fallback_scsv = 1;
             break;
+        case OPT_GREASE:
+            grease = 1;
+            break;
         case OPT_KEYFORM:
             if (!opt_format(opt_arg(), OPT_FMT_ANY, &key_format))
                 goto opthelp;
@@ -1568,10 +1645,23 @@ int s_client_main(int argc, char **argv)
             break;
         case OPT_SERVERINFO:
             p = opt_arg();
-            len = strlen(p);
+            len = (int)strlen(p);
             for (start = 0, i = 0; i <= len; ++i) {
                 if (i == len || p[i] == ',') {
-                    serverinfo_types[serverinfo_count] = atoi(p + start);
+                    char *end;
+                    unsigned long ul;
+
+                    /*
+                     * Parse only the current comma-separated component.
+                     * OPENSSL_strtoul() with an endptr consumes the leading
+                     * digits; we require it to stop exactly at the delimiter
+                     * (or NUL) and to fit in an unsigned short.
+                     */
+                    if (!OPENSSL_strtoul(p + start, &end, 10, &ul)
+                        || end != p + i
+                        || ul > USHRT_MAX)
+                        goto opthelp;
+                    serverinfo_types[serverinfo_count] = (unsigned short)ul;
                     if (++serverinfo_count == MAX_SI_TYPES)
                         break;
                     start = i + 1;
@@ -1588,6 +1678,41 @@ int s_client_main(int argc, char **argv)
         case OPT_SERVERNAME:
             servername = opt_arg();
             break;
+#ifndef OPENSSL_NO_ECH
+        case OPT_ECHCONFIGLIST:
+            ech_config_list = opt_arg();
+            break;
+        case OPT_ALPN_OUTER:
+            alpn_outer_in = opt_arg();
+            break;
+        case OPT_SNIOUTER:
+            sni_outer_name = opt_arg();
+            break;
+        case OPT_ECH_SELECT:
+            ech_select = opt_int_arg();
+            break;
+        case OPT_ECH_GREASE:
+            ech_grease = 1;
+            break;
+        case OPT_ECH_GREASE_SUITE:
+            ech_grease_suite = opt_arg();
+            break;
+        case OPT_ECH_GREASE_TYPE:
+            ech_grease_type = opt_int_arg();
+            if (ech_grease_type != (ech_grease_type & 0xFFFF)) {
+                BIO_printf(bio_err,
+                    "%s: invalid GREASE ECH type 0x%8x\n permitted values are 0-FFFF",
+                    prog, ech_grease_type);
+                goto opthelp;
+            }
+            break;
+        case OPT_ECH_IGNORE_CONFIG_ID:
+            ech_ignore_cid = 1;
+            break;
+        case OPT_ECH_NO_OUTER_SNI:
+            ech_no_outer_sni = 1;
+            break;
+#endif
         case OPT_NOSERVERNAME:
             noservername = 1;
             break;
@@ -1600,13 +1725,13 @@ int s_client_main(int argc, char **argv)
             keymatexportlabel = opt_arg();
             break;
         case OPT_KEYMATEXPORTLEN:
-            keymatexportlen = atoi(opt_arg());
+            keymatexportlen = opt_int_arg();
             break;
         case OPT_ASYNC:
             async = 1;
             break;
         case OPT_MAXFRAGLEN:
-            len = atoi(opt_arg());
+            len = opt_int_arg();
             switch (len) {
             case 512:
                 maxfraglen = TLSEXT_max_fragment_length_512;
@@ -1622,22 +1747,22 @@ int s_client_main(int argc, char **argv)
                 break;
             default:
                 BIO_printf(bio_err,
-                    "%s: Max Fragment Len %u is out of permitted values",
+                    "%s: Max Fragment Len %d is out of permitted values",
                     prog, len);
                 goto opthelp;
             }
             break;
         case OPT_MAX_SEND_FRAG:
-            max_send_fragment = atoi(opt_arg());
+            max_send_fragment = opt_int_arg();
             break;
         case OPT_SPLIT_SEND_FRAG:
-            split_send_fragment = atoi(opt_arg());
+            split_send_fragment = opt_int_arg();
             break;
         case OPT_MAX_PIPELINES:
-            max_pipelines = atoi(opt_arg());
+            max_pipelines = opt_int_arg();
             break;
         case OPT_READ_BUF:
-            read_buf_len = atoi(opt_arg());
+            read_buf_len = opt_int_arg();
             break;
         case OPT_KEYLOG_FILE:
             keylog_file = opt_arg();
@@ -1659,9 +1784,20 @@ int s_client_main(int argc, char **argv)
         case OPT_ENABLE_CLIENT_RPK:
             enable_client_rpk = 1;
             break;
+        case OPT_EXPECTED_RPK:
+            if ((rpk_files == NULL
+                    && (rpk_files = sk_OPENSSL_STRING_new_null()) == NULL)
+                || !sk_OPENSSL_STRING_push(rpk_files, opt_arg()))
+                goto end;
+            enable_server_rpk = 1;
+            break;
         }
     }

+#ifndef OPENSSL_NO_NEXTPROTONEG
+    version1_3 = isdtls ? DTLS1_3_VERSION : TLS1_3_VERSION;
+#endif
+
     /* Optional argument is connect string if -connect not used. */
     if (opt_num_rest() == 1) {
         /* Don't allow -connect and a separate argument. */
@@ -1700,10 +1836,20 @@ int s_client_main(int argc, char **argv)
             goto opthelp;
         }
     }
-
+#ifndef OPENSSL_NO_ECH
+    if ((alpn_outer_in != NULL || sni_outer_name != NULL
+            || ech_no_outer_sni == 1)
+        && ech_config_list == NULL) {
+        BIO_printf(bio_err, "%s: Can't use -ech_outer_sni nor "
+                            "-ech_outer_alpn nor -no_ech_outer_sni without "
+                            "-ech_config_list\n",
+            prog);
+        goto opthelp;
+    }
+#endif
 #ifndef OPENSSL_NO_NEXTPROTONEG
-    if (min_version == TLS1_3_VERSION && next_proto_neg_in != NULL) {
-        BIO_printf(bio_err, "Cannot supply -nextprotoneg with TLSv1.3\n");
+    if (min_version == version1_3 && next_proto_neg_in != NULL) {
+        BIO_puts(bio_err, "Cannot supply -nextprotoneg with TLSv1.3\n");
         goto opthelp;
     }
 #endif
@@ -1782,7 +1928,7 @@ int s_client_main(int argc, char **argv)

 #ifdef AF_UNIX
     if (socket_family == AF_UNIX && socket_type != SOCK_STREAM) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Can't use unix sockets and datagrams together\n");
         goto end;
     }
@@ -1791,7 +1937,7 @@ int s_client_main(int argc, char **argv)
 #ifndef OPENSSL_NO_SCTP
     if (protocol == IPPROTO_SCTP) {
         if (socket_type != SOCK_DGRAM) {
-            BIO_printf(bio_err, "Can't use -sctp without DTLS\n");
+            BIO_puts(bio_err, "Can't use -sctp without DTLS\n");
             goto end;
         }
         /* SCTP is unusual. It uses DTLS over a SOCK_STREAM protocol */
@@ -1804,7 +1950,7 @@ int s_client_main(int argc, char **argv)
     if (next_proto_neg_in) {
         next_proto.data = next_protos_parse(&next_proto.len, next_proto_neg_in);
         if (next_proto.data == NULL) {
-            BIO_printf(bio_err, "Error parsing -nextprotoneg argument\n");
+            BIO_puts(bio_err, "Error parsing -nextprotoneg argument\n");
             goto end;
         }
     } else
@@ -1812,17 +1958,17 @@ int s_client_main(int argc, char **argv)
 #endif

     if (!app_passwd(passarg, NULL, &pass, NULL)) {
-        BIO_printf(bio_err, "Error getting private key password\n");
+        BIO_puts(bio_err, "Error getting private key password\n");
         goto end;
     }

     if (!app_passwd(proxypassarg, NULL, &proxypass, NULL)) {
-        BIO_printf(bio_err, "Error getting proxy password\n");
+        BIO_puts(bio_err, "Error getting proxy password\n");
         goto end;
     }

     if (proxypass != NULL && proxyuser == NULL) {
-        BIO_printf(bio_err, "Error: Must specify proxy_user with proxy_pass\n");
+        BIO_puts(bio_err, "Error: Must specify proxy_user with proxy_pass\n");
         goto end;
     }

@@ -1830,7 +1976,7 @@ int s_client_main(int argc, char **argv)
         key_file = cert_file;

     if (key_file != NULL) {
-        key = load_key(key_file, key_format, 0, pass, e,
+        key = load_key(key_file, key_format, 0, pass,
             "client certificate private key");
         if (key == NULL)
             goto end;
@@ -1856,7 +2002,6 @@ int s_client_main(int argc, char **argv)
         crls = sk_X509_CRL_new_null();
         if (crls == NULL || !sk_X509_CRL_push(crls, crl)) {
             BIO_puts(bio_err, "Error adding CRL\n");
-            ERR_print_errors(bio_err);
             X509_CRL_free(crl);
             goto end;
         }
@@ -1871,7 +2016,7 @@ int s_client_main(int argc, char **argv)
             if (c_msg && bio_c_msg == NULL) {
                 bio_c_msg = dup_bio_out(FORMAT_TEXT);
                 if (bio_c_msg == NULL) {
-                    BIO_printf(bio_err, "Out of memory\n");
+                    BIO_puts(bio_err, "Out of memory\n");
                     goto end;
                 }
             }
@@ -1880,22 +2025,20 @@ int s_client_main(int argc, char **argv)
         }

         if (bio_c_out == NULL) {
-            BIO_printf(bio_err, "Unable to create BIO\n");
+            BIO_puts(bio_err, "Unable to create BIO\n");
             goto end;
         }
     }
 #ifndef OPENSSL_NO_SRP
     if (!app_passwd(srppass, NULL, &srp_arg.srppassin, NULL)) {
-        BIO_printf(bio_err, "Error getting password\n");
+        BIO_puts(bio_err, "Error getting password\n");
         goto end;
     }
 #endif

     ctx = SSL_CTX_new_ex(app_get0_libctx(), app_get0_propq(), meth);
-    if (ctx == NULL) {
-        ERR_print_errors(bio_err);
+    if (ctx == NULL)
         goto end;
-    }

     SSL_CTX_clear_mode(ctx, SSL_MODE_AUTO_RETRY);

@@ -1909,7 +2052,6 @@ int s_client_main(int argc, char **argv)
         if (SSL_CTX_config(ctx, ssl_config) == 0) {
             BIO_printf(bio_err, "Error using configuration \"%s\"\n",
                 ssl_config);
-            ERR_print_errors(bio_err);
             goto end;
         }
     }
@@ -1933,9 +2075,15 @@ int s_client_main(int argc, char **argv)
         SSL_CTX_set_options(ctx, SSL_OP_ENABLE_KTLS);
 #endif

+#ifndef OPENSSL_NO_ECH
+    if (ech_grease != 0)
+        SSL_CTX_set_options(ctx, SSL_OP_ECH_GREASE);
+    if (ech_ignore_cid != 0)
+        SSL_CTX_set_options(ctx, SSL_OP_ECH_IGNORE_CID);
+#endif
+
     if (vpmtouched && !SSL_CTX_set1_param(ctx, vpm)) {
-        BIO_printf(bio_err, "Error setting verify params\n");
-        ERR_print_errors(bio_err);
+        BIO_puts(bio_err, "Error setting verify params\n");
         goto end;
     }

@@ -1981,8 +2129,7 @@ int s_client_main(int argc, char **argv)
             vfyCApath, vfyCAfile, vfyCAstore,
             chCApath, chCAfile, chCAstore,
             crls, crl_download)) {
-        BIO_printf(bio_err, "Error loading store locations\n");
-        ERR_print_errors(bio_err);
+        BIO_puts(bio_err, "Error loading store locations for server cert verification and client cert chain building\n");
         goto end;
     }
     if (ReqCAfile != NULL) {
@@ -1990,28 +2137,16 @@ int s_client_main(int argc, char **argv)

         if (nm == NULL || !SSL_add_file_cert_subjects_to_stack(nm, ReqCAfile)) {
             sk_X509_NAME_pop_free(nm, X509_NAME_free);
-            BIO_printf(bio_err, "Error loading CA names\n");
-            ERR_print_errors(bio_err);
+            BIO_puts(bio_err, "Error loading CA names\n");
             goto end;
         }
         SSL_CTX_set0_CA_list(ctx, nm);
     }
-#ifndef OPENSSL_NO_ENGINE
-    if (ssl_client_engine) {
-        if (!SSL_CTX_set_client_cert_engine(ctx, ssl_client_engine)) {
-            BIO_puts(bio_err, "Error setting client auth engine\n");
-            ERR_print_errors(bio_err);
-            release_engine(ssl_client_engine);
-            goto end;
-        }
-        release_engine(ssl_client_engine);
-    }
-#endif

 #ifndef OPENSSL_NO_PSK
     if (psk_key != NULL) {
         if (c_debug)
-            BIO_printf(bio_c_out, "PSK key given, setting client callback\n");
+            BIO_puts(bio_c_out, "PSK key given, setting client callback\n");
         SSL_CTX_set_psk_client_callback(ctx, psk_client_cb);
     }
 #endif
@@ -2020,14 +2155,12 @@ int s_client_main(int argc, char **argv)

         if (stmp == NULL) {
             BIO_printf(bio_err, "Can't open PSK session file %s\n", psksessf);
-            ERR_print_errors(bio_err);
             goto end;
         }
         psksess = PEM_read_bio_SSL_SESSION(stmp, NULL, 0, NULL);
         BIO_free(stmp);
         if (psksess == NULL) {
             BIO_printf(bio_err, "Can't read PSK session file %s\n", psksessf);
-            ERR_print_errors(bio_err);
             goto end;
         }
     }
@@ -2038,8 +2171,7 @@ int s_client_main(int argc, char **argv)
     if (srtp_profiles != NULL) {
         /* Returns 0 on success! */
         if (SSL_CTX_set_tlsext_use_srtp(ctx, srtp_profiles) != 0) {
-            BIO_printf(bio_err, "Error setting SRTP profile\n");
-            ERR_print_errors(bio_err);
+            BIO_puts(bio_err, "Error setting SRTP profile\n");
             goto end;
         }
     }
@@ -2057,12 +2189,12 @@ int s_client_main(int argc, char **argv)
         unsigned char *alpn = next_protos_parse(&alpn_len, alpn_in);

         if (alpn == NULL) {
-            BIO_printf(bio_err, "Error parsing -alpn argument\n");
+            BIO_puts(bio_err, "Error parsing -alpn argument\n");
             goto end;
         }
         /* Returns 0 on success! */
-        if (SSL_CTX_set_alpn_protos(ctx, alpn, alpn_len) != 0) {
-            BIO_printf(bio_err, "Error setting ALPN\n");
+        if (SSL_CTX_set_alpn_protos(ctx, alpn, (unsigned int)alpn_len) != 0) {
+            BIO_puts(bio_err, "Error setting ALPN\n");
             goto end;
         }
         OPENSSL_free(alpn);
@@ -2085,15 +2217,12 @@ int s_client_main(int argc, char **argv)
 #ifndef OPENSSL_NO_CT
     /* Enable SCT processing, without early connection termination */
     if (ct_validation && !SSL_CTX_enable_ct(ctx, SSL_CT_VALIDATION_PERMISSIVE)) {
-        ERR_print_errors(bio_err);
         goto end;
     }

     if (!ctx_set_ctlog_list_file(ctx, ctlog_file)) {
-        if (ct_validation) {
-            ERR_print_errors(bio_err);
+        if (ct_validation)
             goto end;
-        }

         /*
          * If CT validation is not enabled, the log list isn't needed so don't
@@ -2109,7 +2238,7 @@ int s_client_main(int argc, char **argv)

     if (!ctx_set_verify_locations(ctx, CAfile, noCAfile, CApath, noCApath,
             CAstore, noCAstore)) {
-        ERR_print_errors(bio_err);
+        BIO_puts(bio_err, "Error setting default locations for trusted certificates\n");
         goto end;
     }

@@ -2131,10 +2260,12 @@ int s_client_main(int argc, char **argv)

     if (dane_tlsa_domain != NULL) {
         if (SSL_CTX_dane_enable(ctx) <= 0) {
-            BIO_printf(bio_err,
-                "%s: Error enabling DANE TLSA authentication.\n",
-                prog);
-            ERR_print_errors(bio_err);
+            BIO_printf(bio_err, "%s: Error enabling DANE TLSA authentication.\n", prog);
+            goto end;
+        }
+    } else if (rpk_files != NULL) {
+        if (SSL_CTX_dane_enable(ctx) <= 0) {
+            BIO_printf(bio_err, "%s: Error enabling RPK verification\n", prog);
             goto end;
         }
     }
@@ -2150,6 +2281,27 @@ int s_client_main(int argc, char **argv)
     if (set_keylog_file(ctx, keylog_file))
         goto end;

+#ifndef OPENSSL_NO_ECH
+    if (alpn_outer_in != NULL) {
+        size_t alpn_outer_len;
+        unsigned char *alpn_outer = NULL;
+
+        alpn_outer = next_protos_parse(&alpn_outer_len, alpn_outer_in);
+        if (alpn_outer == NULL) {
+            BIO_printf(bio_err, "Error parsing -ech_outer_alpn argument\n");
+            goto end;
+        }
+        if (SSL_CTX_ech_set1_outer_alpn_protos(ctx, alpn_outer,
+                alpn_outer_len)
+            != 1) {
+            BIO_printf(bio_err, "Error setting ALPN-OUTER\n");
+            OPENSSL_free(alpn_outer);
+            goto end;
+        }
+        OPENSSL_free(alpn_outer);
+    }
+#endif
+
     con = SSL_new(ctx);
     if (con == NULL)
         goto end;
@@ -2157,36 +2309,52 @@ int s_client_main(int argc, char **argv)
     if (enable_pha)
         SSL_set_post_handshake_auth(con, 1);

-    if (enable_client_rpk)
-        if (!SSL_set1_client_cert_type(con, cert_type_rpk, sizeof(cert_type_rpk))) {
-            BIO_printf(bio_err, "Error setting client certificate types\n");
+    if (enable_client_rpk
+        && !SSL_set1_client_cert_type(con, cert_type_rpk, sizeof(cert_type_rpk))) {
+        BIO_puts(bio_err, "Error setting client certificate types\n");
+        goto end;
+    }
+    if (enable_server_rpk
+        && !SSL_set1_server_cert_type(con, cert_type_rpk, sizeof(cert_type_rpk))) {
+        BIO_puts(bio_err, "Error setting server certificate types\n");
+        goto end;
+    }
+
+#ifndef OPENSSL_NO_ECH
+    if (ech_grease_suite != NULL) {
+        if (SSL_ech_set1_grease_suite(con, ech_grease_suite) != 1) {
+            ERR_print_errors(bio_err);
             goto end;
         }
-    if (enable_server_rpk) {
-        if (!SSL_set1_server_cert_type(con, cert_type_rpk, sizeof(cert_type_rpk))) {
-            BIO_printf(bio_err, "Error setting server certificate types\n");
+    }
+    /* no point in setting to our default */
+    if (ech_grease_type != OSSL_ECH_CURRENT_VERSION) {
+        BIO_printf(bio_err, "Setting GREASE ECH type 0x%4x\n", ech_grease_type);
+        if (SSL_ech_set_grease_type(con, ech_grease_type) != 1) {
+            BIO_printf(bio_err, "Can't set GREASE ECH type 0x%4x\n",
+                ech_grease_type);
+            ERR_print_errors(bio_err);
             goto end;
         }
     }
+#endif

     if (sess_in != NULL) {
         SSL_SESSION *sess;
         BIO *stmp = BIO_new_file(sess_in, "r");
         if (stmp == NULL) {
             BIO_printf(bio_err, "Can't open session file %s\n", sess_in);
-            ERR_print_errors(bio_err);
             goto end;
         }
         sess = PEM_read_bio_SSL_SESSION(stmp, NULL, 0, NULL);
         BIO_free(stmp);
         if (sess == NULL) {
             BIO_printf(bio_err, "Can't open session file %s\n", sess_in);
-            ERR_print_errors(bio_err);
             goto end;
         }
         if (!SSL_set_session(con, sess)) {
-            BIO_printf(bio_err, "Can't set session\n");
-            ERR_print_errors(bio_err);
+            SSL_SESSION_free(sess);
+            BIO_puts(bio_err, "Can't set session\n");
             goto end;
         }

@@ -2195,6 +2363,8 @@ int s_client_main(int argc, char **argv)

     if (fallback_scsv)
         SSL_set_mode(con, SSL_MODE_SEND_FALLBACK_SCSV);
+    if (grease)
+        SSL_set_options(con, SSL_OP_GREASE);

     if (!noservername && (servername != NULL || dane_tlsa_domain == NULL)) {
         if (servername == NULL) {
@@ -2202,40 +2372,97 @@ int s_client_main(int argc, char **argv)
                 servername = (host == NULL) ? "localhost" : host;
         }
         if (servername != NULL && !SSL_set_tlsext_host_name(con, servername)) {
-            BIO_printf(bio_err, "Unable to set TLS servername extension.\n");
+            BIO_puts(bio_err, "Unable to set TLS servername extension.\n");
+            goto end;
+        }
+    }
+
+#ifndef OPENSSL_NO_ECH
+    if (ech_config_list != NULL) {
+        if (SSL_set1_ech_config_list(con, (unsigned char *)ech_config_list,
+                strlen(ech_config_list))
+            != 1) {
+            BIO_printf(bio_err, "%s: error setting ECHConfigList.\n", prog);
+            goto end;
+        }
+        if (ech_no_outer_sni == 1) {
+            if (sni_outer_name != NULL) {
+                BIO_printf(bio_err, "%s: can't set -ech_no_outer_sni and "
+                                    "-ech_outer_sni together.\n",
+                    prog);
+                goto end;
+            }
+            if (SSL_ech_set1_outer_server_name(con, NULL, 1) != 1) {
+                BIO_printf(bio_err, "%s: setting no ECH outer name failed.\n",
+                    prog);
+                ERR_print_errors(bio_err);
+                goto end;
+            }
+        }
+        if (sni_outer_name != NULL) {
+            rv = SSL_ech_set1_outer_server_name(con, sni_outer_name, 0);
+            if (rv != 1) {
+                BIO_printf(bio_err, "%s: setting ECH outer name to %s failed.\n",
+                    prog, sni_outer_name);
+                ERR_print_errors(bio_err);
+                goto end;
+            }
+        }
+    }
+    if (ech_select != OSSL_ECHSTORE_ALL) {
+        if ((es = SSL_get1_echstore(con)) == NULL
+            || OSSL_ECHSTORE_downselect(es, ech_select) != 1
+            || SSL_set1_echstore(con, es) != 1) {
+            BIO_printf(bio_err, "%s: ECH downselect to (%d) failed.\n",
+                prog, ech_select);
             ERR_print_errors(bio_err);
             goto end;
         }
+        OSSL_ECHSTORE_free(es);
+        es = NULL;
     }
+#endif

     if (dane_tlsa_domain != NULL) {
         if (SSL_dane_enable(con, dane_tlsa_domain) <= 0) {
             BIO_printf(bio_err, "%s: Error enabling DANE TLSA "
                                 "authentication.\n",
                 prog);
-            ERR_print_errors(bio_err);
             goto end;
         }
-        if (dane_tlsa_rrset == NULL) {
+        if (dane_tlsa_rrset != NULL) {
+            if (tlsa_import_rrset(con, dane_tlsa_rrset) <= 0) {
+                BIO_printf(bio_err, "%s: Failed to import any TLSA "
+                                    "records.\n",
+                    prog);
+                goto end;
+            }
+        } else if (rpk_files == NULL) {
             BIO_printf(bio_err, "%s: DANE TLSA authentication requires at "
-                                "least one -dane_tlsa_rrdata option.\n",
-                prog);
-            goto end;
-        }
-        if (tlsa_import_rrset(con, dane_tlsa_rrset) <= 0) {
-            BIO_printf(bio_err, "%s: Failed to import any TLSA "
-                                "records.\n",
+                                "least one -dane_tlsa_rrdata option, or else "
+                                "at least one -expected_rpks option.\n",
                 prog);
             goto end;
         }
         if (dane_ee_no_name)
             SSL_dane_set_flags(con, DANE_FLAG_NO_DANE_EE_NAMECHECKS);
-    } else if (dane_tlsa_rrset != NULL) {
+    } else if (rpk_files == NULL && dane_tlsa_rrset != NULL) {
         BIO_printf(bio_err, "%s: DANE TLSA authentication requires the "
                             "-dane_tlsa_domain option.\n",
             prog);
         goto end;
     }
+
+    if (rpk_files != NULL) {
+        if (dane_tlsa_domain == NULL
+            && !SSL_dane_enable(con, noservername ? NULL : servername)) {
+            BIO_puts(bio_err, "Error enabling server RPK verification\n");
+            goto end;
+        }
+        for (i = 0; i < sk_OPENSSL_STRING_num(rpk_files); ++i)
+            if (!load_rpk_file(con, sk_OPENSSL_STRING_value(rpk_files, i)))
+                goto end;
+    }
 #ifndef OPENSSL_NO_DTLS
     if (isdtls && tfo) {
         BIO_printf(bio_err, "%s: DTLS does not support the -tfo option\n", prog);
@@ -2254,13 +2481,13 @@ int s_client_main(int argc, char **argv)
 #endif

     if (tfo)
-        BIO_printf(bio_c_out, "Connecting via TFO\n");
+        BIO_puts(bio_c_out, "Connecting via TFO\n");
 re_start:
     /* peer_addr might be set from previous connections */
     BIO_ADDR_free(peer_addr);
     peer_addr = NULL;
     if (init_client(&sock, host, port, bindhost, bindport, socket_family,
-            socket_type, protocol, tfo, !isquic, &peer_addr)
+            socket_type, protocol, tfo, !isquic, &peer_addr, c_quiet)
         == 0) {
         BIO_printf(bio_err, "connect:errno=%d\n", get_last_socket_error());
         BIO_closesocket(sock);
@@ -2273,14 +2500,12 @@ re_start:
      * non-blocking mode at the SSL level
      */
     if (c_nbio || isquic) {
-        if (!BIO_socket_nbio(sock, 1)) {
-            ERR_print_errors(bio_err);
+        if (!BIO_socket_nbio(sock, 1))
             goto end;
-        }
         if (c_nbio) {
             if (isquic && !SSL_set_blocking_mode(con, 0))
                 goto end;
-            BIO_printf(bio_c_out, "Turned on non blocking io\n");
+            BIO_puts(bio_c_out, "Turned on non blocking io\n");
         }
     }
 #ifndef OPENSSL_NO_DTLS
@@ -2295,7 +2520,7 @@ re_start:
             sbio = BIO_new_dgram(sock, BIO_NOCLOSE);

         if (sbio == NULL || (peer_info.addr = BIO_ADDR_new()) == NULL) {
-            BIO_printf(bio_err, "memory allocation failure\n");
+            BIO_puts(bio_err, "memory allocation failure\n");
             BIO_free(sbio);
             BIO_closesocket(sock);
             goto end;
@@ -2332,7 +2557,7 @@ re_start:
             }
             SSL_set_options(con, SSL_OP_NO_QUERY_MTU);
             if (!DTLS_set_link_mtu(con, socket_mtu)) {
-                BIO_printf(bio_err, "Failed to set MTU\n");
+                BIO_puts(bio_err, "Failed to set MTU\n");
                 BIO_free(sbio);
                 goto shut;
             }
@@ -2346,7 +2571,7 @@ re_start:
         if (isquic) {
         sbio = BIO_new_dgram(sock, BIO_NOCLOSE);
         if (!SSL_set1_initial_peer_addr(con, peer_addr)) {
-            BIO_printf(bio_err, "Failed to set the initial peer address\n");
+            BIO_puts(bio_err, "Failed to set the initial peer address\n");
             goto shut;
         }
     } else
@@ -2354,8 +2579,7 @@ re_start:
         sbio = BIO_new_socket(sock, BIO_NOCLOSE);

     if (sbio == NULL) {
-        BIO_printf(bio_err, "Unable to create BIO\n");
-        ERR_print_errors(bio_err);
+        BIO_puts(bio_err, "Unable to create BIO\n");
         BIO_closesocket(sock);
         goto end;
     }
@@ -2371,7 +2595,7 @@ re_start:

         test = BIO_new(BIO_f_nbio_test());
         if (test == NULL) {
-            BIO_printf(bio_err, "Unable to create BIO\n");
+            BIO_puts(bio_err, "Unable to create BIO\n");
             BIO_free(sbio);
             goto shut;
         }
@@ -2451,7 +2675,7 @@ re_start:
         BIO *fbio = BIO_new(BIO_f_buffer());

         if (fbio == NULL) {
-            BIO_printf(bio_err, "Unable to create BIO\n");
+            BIO_puts(bio_err, "Unable to create BIO\n");
             goto shut;
         }
         BIO_push(fbio, sbio);
@@ -2479,18 +2703,18 @@ re_start:
         BIO_pop(fbio);
         BIO_free(fbio);
         if (!foundit)
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Didn't find STARTTLS in server response,"
                 " trying anyway...\n");
-        BIO_printf(sbio, "STARTTLS\r\n");
+        BIO_puts(sbio, "STARTTLS\r\n");
         BIO_read(sbio, sbuf, BUFSIZZ);
     } break;
     case PROTO_POP3: {
         BIO_read(sbio, mbuf, BUFSIZZ);
-        BIO_printf(sbio, "STLS\r\n");
+        BIO_puts(sbio, "STLS\r\n");
         mbuf_len = BIO_read(sbio, sbuf, BUFSIZZ);
         if (mbuf_len < 0) {
-            BIO_printf(bio_err, "BIO_read failed\n");
+            BIO_puts(bio_err, "BIO_read failed\n");
             goto end;
         }
     } break;
@@ -2499,7 +2723,7 @@ re_start:
         BIO *fbio = BIO_new(BIO_f_buffer());

         if (fbio == NULL) {
-            BIO_printf(bio_err, "Unable to create BIO\n");
+            BIO_puts(bio_err, "Unable to create BIO\n");
             goto shut;
         }
         BIO_push(fbio, sbio);
@@ -2527,7 +2751,7 @@ re_start:
         BIO *fbio = BIO_new(BIO_f_buffer());

         if (fbio == NULL) {
-            BIO_printf(bio_err, "Unable to create BIO\n");
+            BIO_puts(bio_err, "Unable to create BIO\n");
             goto shut;
         }
         BIO_push(fbio, sbio);
@@ -2565,11 +2789,11 @@ re_start:

             mbuf[seen] = '\0';
         }
-        BIO_printf(sbio,
+        BIO_puts(sbio,
             "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>");
         seen = BIO_read(sbio, sbuf, BUFSIZZ - 1);
         if (seen < 0) {
-            BIO_printf(bio_err, "BIO_read failed\n");
+            BIO_puts(bio_err, "BIO_read failed\n");
             goto shut;
         }
         sbuf[seen] = '\0';
@@ -2610,7 +2834,7 @@ re_start:
         BIO *fbio = BIO_new(BIO_f_buffer());

         if (fbio == NULL) {
-            BIO_printf(bio_err, "Unable to create BIO\n");
+            BIO_puts(bio_err, "Unable to create BIO\n");
             goto end;
         }
         BIO_push(fbio, sbio);
@@ -2656,7 +2880,6 @@ re_start:
             }
             if (numeric == 691) {
                 BIO_printf(bio_err, "STARTTLS negotiation failed: ");
-                ERR_print_errors(bio_err);
                 break;
             }
         } while (numeric != 670);
@@ -2690,10 +2913,10 @@ re_start:
         int bytes = 0;
         int ssl_flg = 0x800;
         int pos;
-        const unsigned char *packet = (const unsigned char *)sbuf;
+        unsigned char *packet = (unsigned char *)sbuf;

         /* Receiving Initial Handshake packet. */
-        bytes = BIO_read(sbio, (void *)packet, BUFSIZZ);
+        bytes = BIO_read(sbio, packet, BUFSIZZ);
         if (bytes < 0) {
             BIO_printf(bio_err, "BIO_read failed\n");
             goto shut;
@@ -2724,21 +2947,21 @@ re_start:

         /* make sure we have at least 15 bytes left in the packet */
         if (pos + 15 > bytes) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "MySQL server handshake packet is broken.\n");
             goto shut;
         }

         pos += 12; /* skip over conn id[4] + SALT[8] */
         if (packet[pos++] != '\0') { /* verify filler */
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "MySQL packet is broken.\n");
             goto shut;
         }

         /* capability flags[2] */
         if (!((packet[pos] + (packet[pos + 1] << 8)) & ssl_flg)) {
-            BIO_printf(bio_err, "MySQL server does not support SSL.\n");
+            BIO_puts(bio_err, "MySQL server does not support SSL.\n");
             goto shut;
         }

@@ -2767,13 +2990,13 @@ re_start:
         BIO *fbio = BIO_new(BIO_f_buffer());

         if (fbio == NULL) {
-            BIO_printf(bio_err, "Unable to create BIO\n");
+            BIO_puts(bio_err, "Unable to create BIO\n");
             goto end;
         }
         BIO_push(fbio, sbio);
         BIO_gets(fbio, mbuf, BUFSIZZ);
         /* STARTTLS command requires CAPABILITIES... */
-        BIO_printf(fbio, "CAPABILITIES\r\n");
+        BIO_puts(fbio, "CAPABILITIES\r\n");
         (void)BIO_flush(fbio);
         BIO_gets(fbio, mbuf, BUFSIZZ);
         /* no point in trying to parse the CAPABILITIES response if there is none */
@@ -2789,13 +3012,13 @@ re_start:
         BIO_pop(fbio);
         BIO_free(fbio);
         if (!foundit)
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Didn't find STARTTLS in server response,"
                 " trying anyway...\n");
-        BIO_printf(sbio, "STARTTLS\r\n");
+        BIO_puts(sbio, "STARTTLS\r\n");
         mbuf_len = BIO_read(sbio, mbuf, BUFSIZZ - 1);
         if (mbuf_len < 0) {
-            BIO_printf(bio_err, "BIO_read failed\n");
+            BIO_puts(bio_err, "BIO_read failed\n");
             goto end;
         }
         mbuf[mbuf_len] = '\0';
@@ -2809,7 +3032,7 @@ re_start:
         BIO *fbio = BIO_new(BIO_f_buffer());

         if (fbio == NULL) {
-            BIO_printf(bio_err, "Unable to create BIO\n");
+            BIO_puts(bio_err, "Unable to create BIO\n");
             goto end;
         }
         BIO_push(fbio, sbio);
@@ -2830,13 +3053,13 @@ re_start:
         BIO_pop(fbio);
         BIO_free(fbio);
         if (!foundit)
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Didn't find STARTTLS in server response,"
                 " trying anyway...\n");
-        BIO_printf(sbio, "STARTTLS\r\n");
+        BIO_puts(sbio, "STARTTLS\r\n");
         mbuf_len = BIO_read(sbio, mbuf, BUFSIZZ - 1);
         if (mbuf_len < 0) {
-            BIO_printf(bio_err, "BIO_read failed\n");
+            BIO_puts(bio_err, "BIO_read failed\n");
             goto end;
         }
         mbuf[mbuf_len] = '\0';
@@ -2866,6 +3089,7 @@ re_start:
         ASN1_TYPE *atyp = NULL;
         BIO *ldapbio = BIO_new(BIO_s_mem());
         CONF *cnf = NCONF_new(NULL);
+        size_t ssl_request_len;

         if (ldapbio == NULL || cnf == NULL) {
             BIO_free(ldapbio);
@@ -2877,7 +3101,7 @@ re_start:
             BIO_free(ldapbio);
             NCONF_free(cnf);
             if (errline <= 0) {
-                BIO_printf(bio_err, "NCONF_load_bio failed\n");
+                BIO_puts(bio_err, "NCONF_load_bio failed\n");
                 goto end;
             } else {
                 BIO_printf(bio_err, "Error on line %ld\n", errline);
@@ -2888,32 +3112,39 @@ re_start:
         genstr = NCONF_get_string(cnf, "default", "asn1");
         if (genstr == NULL) {
             NCONF_free(cnf);
-            BIO_printf(bio_err, "NCONF_get_string failed\n");
+            BIO_puts(bio_err, "NCONF_get_string failed\n");
             goto end;
         }
         atyp = ASN1_generate_nconf(genstr, cnf);
         if (atyp == NULL || atyp->type != V_ASN1_SEQUENCE) {
             NCONF_free(cnf);
             ASN1_TYPE_free(atyp);
-            BIO_printf(bio_err, "ASN1_generate_nconf failed\n");
+            BIO_puts(bio_err, "ASN1_generate_nconf failed\n");
+            goto end;
+        }
+        ssl_request_len = ASN1_STRING_get_length(atyp->value.sequence);
+        if (ssl_request_len > INT_MAX) {
+            NCONF_free(cnf);
+            ASN1_TYPE_free(atyp);
+            BIO_puts(bio_err, "generated NCONF size is too large\n");
             goto end;
         }
         NCONF_free(cnf);

         /* Send SSLRequest packet */
-        BIO_write(sbio, atyp->value.sequence->data,
-            atyp->value.sequence->length);
+        BIO_write(sbio, ASN1_STRING_get0_data(atyp->value.sequence),
+            (int)ssl_request_len);
         (void)BIO_flush(sbio);
         ASN1_TYPE_free(atyp);

         mbuf_len = BIO_read(sbio, mbuf, BUFSIZZ);
         if (mbuf_len < 0) {
-            BIO_printf(bio_err, "BIO_read failed\n");
+            BIO_puts(bio_err, "BIO_read failed\n");
             goto end;
         }
         result = ldap_ExtendedResponse_parse(mbuf, mbuf_len);
         if (result < 0) {
-            BIO_printf(bio_err, "ldap_ExtendedResponse_parse failed\n");
+            BIO_puts(bio_err, "ldap_ExtendedResponse_parse failed\n");
             goto shut;
         } else if (result > 0) {
             BIO_printf(bio_err, "STARTTLS failed, LDAP Result Code: %i\n",
@@ -2934,7 +3165,7 @@ re_start:
         int finish = 0;

         if (edfile == NULL) {
-            BIO_printf(bio_err, "Cannot open early data file\n");
+            BIO_puts(bio_err, "Cannot open early data file\n");
             goto shut;
         }

@@ -2950,9 +3181,8 @@ re_start:
                     /* Just keep trying - busy waiting */
                     continue;
                 default:
-                    BIO_printf(bio_err, "Error writing early data\n");
+                    BIO_puts(bio_err, "Error writing early data\n");
                     BIO_free(edfile);
-                    ERR_print_errors(bio_err);
                     goto shut;
                 }
             }
@@ -2999,7 +3229,7 @@ re_start:

                 if (reconnect) {
                     reconnect--;
-                    BIO_printf(bio_c_out,
+                    BIO_puts(bio_c_out,
                         "drop connection and then reconnect\n");
                     do_ssl_shutdown(con);
                     SSL_set_connect_state(con);
@@ -3013,7 +3243,7 @@ re_start:
             do {
                 switch (user_data_process(&user_data, &cbuf_len, &cbuf_off)) {
                 default:
-                    BIO_printf(bio_err, "ERROR\n");
+                    BIO_puts(bio_err, "ERROR\n");
                     /* fall through */
                 case USER_DATA_PROCESS_SHUT:
                     ret = 0;
@@ -3126,7 +3356,7 @@ re_start:
             if (isdtls
                 && !FD_ISSET(SSL_get_fd(con), &readfds)
                 && !FD_ISSET(SSL_get_fd(con), &writefds))
-                BIO_printf(bio_err, "TIMEOUT occurred\n");
+                BIO_puts(bio_err, "TIMEOUT occurred\n");
         }

         if (!ssl_pending
@@ -3150,28 +3380,28 @@ re_start:
                 }
                 break;
             case SSL_ERROR_WANT_WRITE:
-                BIO_printf(bio_c_out, "write W BLOCK\n");
+                BIO_puts(bio_c_out, "write W BLOCK\n");
                 write_ssl = 1;
                 read_tty = 0;
                 break;
             case SSL_ERROR_WANT_ASYNC:
-                BIO_printf(bio_c_out, "write A BLOCK\n");
+                BIO_puts(bio_c_out, "write A BLOCK\n");
                 wait_for_async(con);
                 write_ssl = 1;
                 read_tty = 0;
                 break;
             case SSL_ERROR_WANT_READ:
-                BIO_printf(bio_c_out, "write R BLOCK\n");
+                BIO_puts(bio_c_out, "write R BLOCK\n");
                 write_tty = 0;
                 read_ssl = 1;
                 write_ssl = 0;
                 break;
             case SSL_ERROR_WANT_X509_LOOKUP:
-                BIO_printf(bio_c_out, "write X BLOCK\n");
+                BIO_puts(bio_c_out, "write X BLOCK\n");
                 break;
             case SSL_ERROR_ZERO_RETURN:
                 if (cbuf_len != 0) {
-                    BIO_printf(bio_c_out, "shutdown\n");
+                    BIO_puts(bio_c_out, "shutdown\n");
                     ret = 0;
                     goto shut;
                 } else {
@@ -3196,7 +3426,6 @@ re_start:
             case SSL_ERROR_WANT_ASYNC_JOB:
                 /* This shouldn't ever happen in s_client - treat as an error */
             case SSL_ERROR_SSL:
-                ERR_print_errors(bio_err);
                 goto shut;
             }
         }
@@ -3213,7 +3442,7 @@ re_start:
             i = raw_write_stdout(&(sbuf[sbuf_off]), sbuf_len);

             if (i <= 0) {
-                BIO_printf(bio_c_out, "DONE\n");
+                BIO_puts(bio_c_out, "DONE\n");
                 ret = 0;
                 goto shut;
             }
@@ -3226,15 +3455,6 @@ re_start:
             }
         } else if (ssl_pending
             || (!isquic && FD_ISSET(SSL_get_fd(con), &readfds))) {
-#ifdef RENEG
-            {
-                static int iiii;
-                if (++iiii == 52) {
-                    SSL_renegotiate(con);
-                    iiii = 0;
-                }
-            }
-#endif
             k = SSL_read(con, sbuf, BUFSIZZ);

             switch (SSL_get_error(con, k)) {
@@ -3248,7 +3468,7 @@ re_start:
                 write_tty = 1;
                 break;
             case SSL_ERROR_WANT_ASYNC:
-                BIO_printf(bio_c_out, "read A BLOCK\n");
+                BIO_puts(bio_c_out, "read A BLOCK\n");
                 wait_for_async(con);
                 write_tty = 0;
                 read_ssl = 1;
@@ -3256,19 +3476,19 @@ re_start:
                     write_ssl = 1;
                 break;
             case SSL_ERROR_WANT_WRITE:
-                BIO_printf(bio_c_out, "read W BLOCK\n");
+                BIO_puts(bio_c_out, "read W BLOCK\n");
                 write_ssl = 1;
                 read_tty = 0;
                 break;
             case SSL_ERROR_WANT_READ:
-                BIO_printf(bio_c_out, "read R BLOCK\n");
+                BIO_puts(bio_c_out, "read R BLOCK\n");
                 write_tty = 0;
                 read_ssl = 1;
                 if ((read_tty == 0) && (write_ssl == 0))
                     write_ssl = 1;
                 break;
             case SSL_ERROR_WANT_X509_LOOKUP:
-                BIO_printf(bio_c_out, "read X BLOCK\n");
+                BIO_puts(bio_c_out, "read X BLOCK\n");
                 break;
             case SSL_ERROR_SYSCALL:
                 ret = get_last_socket_error();
@@ -3278,13 +3498,12 @@ re_start:
                     BIO_printf(bio_err, "read:errno=%d\n", ret);
                 goto shut;
             case SSL_ERROR_ZERO_RETURN:
-                BIO_printf(bio_c_out, "closed\n");
+                BIO_puts(bio_c_out, "closed\n");
                 ret = 0;
                 goto shut;
             case SSL_ERROR_WANT_ASYNC_JOB:
                 /* This shouldn't ever happen in s_client. Treat as an error */
             case SSL_ERROR_SSL:
-                ERR_print_errors(bio_err);
                 goto shut;
             }
         }
@@ -3328,7 +3547,7 @@ re_start:
 #endif

             if (!c_ign_eof && i <= 0) {
-                BIO_printf(bio_err, "DONE\n");
+                BIO_puts(bio_err, "DONE\n");
                 ret = 0;
                 goto shut;
             }
@@ -3343,6 +3562,8 @@ re_start:
     }

 shut:
+    if (ret > 0)
+        ERR_print_errors(bio_err); /* show any errors accumulated so far */
     if (in_init)
         print_stuff(bio_c_out, con, full_log);
     do_ssl_shutdown(con);
@@ -3376,6 +3597,8 @@ shut:

     BIO_closesocket(SSL_get_fd(con));
 end:
+    if (ret > 0)
+        ERR_print_errors(bio_err); /* show any new or remaining errors */
     if (con != NULL) {
         if (prexit != 0)
             print_stuff(bio_c_out, con, 1);
@@ -3408,17 +3631,20 @@ end:
     X509_VERIFY_PARAM_free(vpm);
     ssl_excert_free(exc);
     sk_OPENSSL_STRING_free(ssl_args);
+    sk_OPENSSL_STRING_free(rpk_files);
     sk_OPENSSL_STRING_free(dane_tlsa_rrset);
     SSL_CONF_CTX_free(cctx);
     OPENSSL_clear_free(cbuf, BUFSIZZ);
     OPENSSL_clear_free(sbuf, BUFSIZZ);
     OPENSSL_clear_free(mbuf, BUFSIZZ);
     clear_free(proxypass);
-    release_engine(e);
     BIO_free(bio_c_out);
     bio_c_out = NULL;
     BIO_free(bio_c_msg);
     bio_c_msg = NULL;
+#ifndef OPENSSL_NO_ECH
+    OSSL_ECHSTORE_free(es);
+#endif
     return ret;
 }

@@ -3461,12 +3687,112 @@ static void print_cert_key_info(BIO *bio, X509 *cert)
     OPENSSL_free(curve);
 }

+#ifndef OPENSSL_NO_ECH
+static void print_ech_retry_configs(BIO *bio, SSL *s)
+{
+    int ind, cnt = 0, has_priv, for_retry;
+    OSSL_ECHSTORE *es = NULL;
+    time_t secs = 0;
+    char *pn = NULL, *ec = NULL;
+    size_t rtlen = 0;
+    unsigned char *rtval = NULL;
+    BIO *biom = NULL;
+
+    if (SSL_ech_get1_retry_config(s, &rtval, &rtlen) != 1) {
+        BIO_puts(bio, "ECH: Error getting retry-configs\n");
+        return;
+    }
+    /*
+     * print nicely, note that any non-supported versions
+     * sent by server will have been filtered out by now
+     */
+    if (rtlen > INT_MAX
+        || (biom = BIO_new(BIO_s_mem())) == NULL
+        || BIO_write(biom, rtval, (int)rtlen) <= 0
+        || (es = OSSL_ECHSTORE_new(NULL, NULL)) == NULL
+        || OSSL_ECHSTORE_read_echconfiglist(es, biom) != 1) {
+        BIO_puts(bio, "ECH: Error loading retry-configs\n");
+        goto end;
+    }
+    if (OSSL_ECHSTORE_num_entries(es, &cnt) != 1)
+        goto end;
+    BIO_printf(bio, "ECH: Got %d retry-configs\n", cnt);
+    for (ind = 0; ind != cnt; ind++) {
+        if (OSSL_ECHSTORE_get1_info(es, ind, &secs, &pn, &ec,
+                &has_priv, &for_retry)
+            != 1) {
+            BIO_printf(bio, "ECH: Error getting retry-config %d.\n", ind);
+            goto end;
+        }
+        BIO_printf(bio, "ECH: entry: %d public_name: %s age: %lld%s\n",
+            ind, pn, (long long)secs,
+            has_priv ? " (has private key)" : "");
+        BIO_printf(bio, "ECH: \t%s\n", ec);
+        OPENSSL_free(pn);
+        pn = NULL;
+        OPENSSL_free(ec);
+        ec = NULL;
+    }
+end:
+    BIO_free_all(biom);
+    OPENSSL_free(rtval);
+    OPENSSL_free(pn);
+    OPENSSL_free(ec);
+    OSSL_ECHSTORE_free(es);
+    return;
+}
+
+/* outcomes marked as "odd" shouldn't happen in s_client */
+static void print_ech_status(BIO *bio, SSL *s, int estat)
+{
+    switch (estat) {
+    case SSL_ECH_STATUS_NOT_TRIED:
+        BIO_printf(bio, "ECH: not tried: %d\n", estat);
+        break;
+    case SSL_ECH_STATUS_FAILED:
+        BIO_printf(bio, "ECH: tried but failed: %d\n", estat);
+        break;
+    case SSL_ECH_STATUS_FAILED_ECH:
+        BIO_printf(bio, "ECH: failed+retry-configs: %d\n", estat);
+        break;
+    case SSL_ECH_STATUS_SUCCESS:
+        BIO_printf(bio, "ECH: success: %d\n", estat);
+        break;
+    case SSL_ECH_STATUS_GREASE_ECH:
+        BIO_printf(bio, "ECH: GREASE+retry-configs: %d\n", estat);
+        break;
+    case SSL_ECH_STATUS_BACKEND:
+        BIO_printf(bio, "ECH: BACKEND: %d\n", estat);
+        break;
+    case SSL_ECH_STATUS_GREASE:
+        BIO_printf(bio, "ECH: GREASE: %d\n", estat);
+        break;
+    case SSL_ECH_STATUS_BAD_CALL:
+        BIO_printf(bio, "ECH: BAD CALL: %d\n", estat);
+        break;
+    case SSL_ECH_STATUS_BAD_NAME:
+        BIO_printf(bio, "ECH: BAD NAME: %d\n", estat);
+        break;
+    case SSL_ECH_STATUS_NOT_CONFIGURED:
+        BIO_printf(bio, "ECH: NOT CONFIGURED: %d\n", estat);
+        break;
+    case SSL_ECH_STATUS_FAILED_ECH_BAD_NAME:
+        BIO_printf(bio, "ECH: failed+retry-configs: %d\n", estat);
+        break;
+    default:
+        BIO_printf(bio, "ECH: unexpected status: %d\n", estat);
+    }
+    return;
+}
+#endif
+
 static void print_stuff(BIO *bio, SSL *s, int full)
 {
     X509 *peer = NULL;
     STACK_OF(X509) *sk;
     const SSL_CIPHER *c;
-    int i, istls13 = (SSL_version(s) == TLS1_3_VERSION);
+    const int version1_3 = SSL_is_dtls(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;
+    int i;
     long verify_result;
 #ifndef OPENSSL_NO_COMP
     const COMP_METHOD *comp, *expansion;
@@ -3475,6 +3801,10 @@ static void print_stuff(BIO *bio, SSL *s, int full)
 #ifndef OPENSSL_NO_CT
     const SSL_CTX *ctx = SSL_get_SSL_CTX(s);
 #endif
+#ifndef OPENSSL_NO_ECH
+    char *inner = NULL, *outer = NULL;
+    int estat = 0;
+#endif

     if (full) {
         int got_a_chain = 0;
@@ -3483,20 +3813,19 @@ static void print_stuff(BIO *bio, SSL *s, int full)
         if (sk != NULL) {
             got_a_chain = 1;

-            BIO_printf(bio, "---\nCertificate chain\n");
+            BIO_puts(bio, "---\nCertificate chain\n");
             for (i = 0; i < sk_X509_num(sk); i++) {
                 X509 *chain_cert = sk_X509_value(sk, i);

                 BIO_printf(bio, "%2d s:", i);
                 X509_NAME_print_ex(bio, X509_get_subject_name(chain_cert), 0, get_nameopt());
-                BIO_puts(bio, "\n");
-                BIO_printf(bio, "   i:");
+                BIO_puts(bio, "\n   i:");
                 X509_NAME_print_ex(bio, X509_get_issuer_name(chain_cert), 0, get_nameopt());
                 BIO_puts(bio, "\n");
                 print_cert_key_info(bio, chain_cert);
-                BIO_printf(bio, "   v:NotBefore: ");
+                BIO_puts(bio, "   v:NotBefore: ");
                 ASN1_TIME_print(bio, X509_get0_notBefore(chain_cert));
-                BIO_printf(bio, "; NotAfter: ");
+                BIO_puts(bio, "; NotAfter: ");
                 ASN1_TIME_print(bio, X509_get0_notAfter(chain_cert));
                 BIO_puts(bio, "\n");
                 if (c_showcerts)
@@ -3504,32 +3833,32 @@ static void print_stuff(BIO *bio, SSL *s, int full)
             }
         }

-        BIO_printf(bio, "---\n");
+        BIO_puts(bio, "---\n");
         peer = SSL_get0_peer_certificate(s);
         if (peer != NULL) {
-            BIO_printf(bio, "Server certificate\n");
+            BIO_puts(bio, "Server certificate\n");

             /* Redundant if we showed the whole chain */
             if (!(c_showcerts && got_a_chain))
                 PEM_write_bio_X509(bio, peer);
             dump_cert_text(bio, peer);
         } else {
-            BIO_printf(bio, "no peer certificate available\n");
+            BIO_puts(bio, "no peer certificate available\n");
         }

         /* Only display RPK information if configured */
         if (SSL_get_negotiated_client_cert_type(s) == TLSEXT_cert_type_rpk)
-            BIO_printf(bio, "Client-to-server raw public key negotiated\n");
+            BIO_puts(bio, "Client-to-server raw public key negotiated\n");
         if (SSL_get_negotiated_server_cert_type(s) == TLSEXT_cert_type_rpk)
-            BIO_printf(bio, "Server-to-client raw public key negotiated\n");
+            BIO_puts(bio, "Server-to-client raw public key negotiated\n");
         if (enable_server_rpk) {
             EVP_PKEY *peer_rpk = SSL_get0_peer_rpk(s);

             if (peer_rpk != NULL) {
-                BIO_printf(bio, "Server raw public key\n");
+                BIO_puts(bio, "Server raw public key\n");
                 EVP_PKEY_print_public(bio, peer_rpk, 2, NULL);
             } else {
-                BIO_printf(bio, "no peer rpk available\n");
+                BIO_puts(bio, "no peer rpk available\n");
             }
         }

@@ -3556,7 +3885,7 @@ static void print_stuff(BIO *bio, SSL *s, int full)
             if (sct_count > 0) {
                 const CTLOG_STORE *log_store = SSL_CTX_get0_ctlog_store(ctx);

-                BIO_printf(bio, "---\n");
+                BIO_puts(bio, "---\n");
                 for (i = 0; i < sct_count; ++i) {
                     SCT *sct = sk_SCT_value(scts, i);

@@ -3564,16 +3893,16 @@ static void print_stuff(BIO *bio, SSL *s, int full)
                         SCT_validation_status_string(sct));
                     SCT_print(sct, bio, 0, log_store);
                     if (i < sct_count - 1)
-                        BIO_printf(bio, "\n---\n");
+                        BIO_puts(bio, "\n---\n");
                 }
-                BIO_printf(bio, "\n");
+                BIO_puts(bio, "\n");
             }
         }
 #endif

         BIO_printf(bio,
-            "---\nSSL handshake has read %ju bytes "
-            "and written %ju bytes\n",
+            "---\nSSL handshake has read %" PRIu64 " bytes "
+            "and written %" PRIu64 " bytes\n",
             BIO_number_read(SSL_get_rbio(s)),
             BIO_number_written(SSL_get_wbio(s)));
     }
@@ -3596,16 +3925,16 @@ static void print_stuff(BIO *bio, SSL *s, int full)
 #ifndef OPENSSL_NO_COMP
     comp = SSL_get_current_compression(s);
     expansion = SSL_get_current_expansion(s);
-    BIO_printf(bio, "Compression: %s\n",
-        comp ? SSL_COMP_get_name(comp) : "NONE");
-    BIO_printf(bio, "Expansion: %s\n",
+    BIO_printf(bio, "Compression: %s\n"
+                    "Expansion: %s\n",
+        comp ? SSL_COMP_get_name(comp) : "NONE",
         expansion ? SSL_COMP_get_name(expansion) : "NONE");
 #endif
 #ifndef OPENSSL_NO_KTLS
     if (BIO_get_ktls_send(SSL_get_wbio(s)))
-        BIO_printf(bio_err, "Using Kernel TLS for sending\n");
+        BIO_puts(bio_err, "Using Kernel TLS for sending\n");
     if (BIO_get_ktls_recv(SSL_get_rbio(s)))
-        BIO_printf(bio_err, "Using Kernel TLS for receiving\n");
+        BIO_puts(bio_err, "Using Kernel TLS for receiving\n");
 #endif

     if (OSSL_TRACE_ENABLED(TLS)) {
@@ -3637,11 +3966,11 @@ static void print_stuff(BIO *bio, SSL *s, int full)
         unsigned int proto_len;
         SSL_get0_alpn_selected(s, &proto, &proto_len);
         if (proto_len > 0) {
-            BIO_printf(bio, "ALPN protocol: ");
+            BIO_puts(bio, "ALPN protocol: ");
             BIO_write(bio, proto, proto_len);
             BIO_write(bio, "\n", 1);
         } else
-            BIO_printf(bio, "No ALPN negotiated\n");
+            BIO_puts(bio, "No ALPN negotiated\n");
     }

 #ifndef OPENSSL_NO_SRTP
@@ -3654,18 +3983,18 @@ static void print_stuff(BIO *bio, SSL *s, int full)
     }
 #endif

-    if (istls13) {
+    if (SSL_version(s) == version1_3) {
         switch (SSL_get_early_data_status(s)) {
         case SSL_EARLY_DATA_NOT_SENT:
-            BIO_printf(bio, "Early data was not sent\n");
+            BIO_puts(bio, "Early data was not sent\n");
             break;

         case SSL_EARLY_DATA_REJECTED:
-            BIO_printf(bio, "Early data was rejected\n");
+            BIO_puts(bio, "Early data was rejected\n");
             break;

         case SSL_EARLY_DATA_ACCEPTED:
-            BIO_printf(bio, "Early data was accepted\n");
+            BIO_puts(bio, "Early data was accepted\n");
             break;
         }

@@ -3683,9 +4012,11 @@ static void print_stuff(BIO *bio, SSL *s, int full)
     }

     if (SSL_get_session(s) != NULL && keymatexportlabel != NULL) {
-        BIO_printf(bio, "Keying material exporter:\n");
-        BIO_printf(bio, "    Label: '%s'\n", keymatexportlabel);
-        BIO_printf(bio, "    Length: %i bytes\n", keymatexportlen);
+        BIO_printf(bio, "Keying material exporter:\n"
+                        "    Label: '%s'\n"
+                        "    Length: %i bytes\n",
+            keymatexportlabel,
+            keymatexportlen);
         exportedkeymat = app_malloc(keymatexportlen, "export key");
         if (SSL_export_keying_material(s, exportedkeymat,
                 keymatexportlen,
@@ -3693,16 +4024,31 @@ static void print_stuff(BIO *bio, SSL *s, int full)
                 strlen(keymatexportlabel),
                 NULL, 0, 0)
             <= 0) {
-            BIO_printf(bio, "    Error\n");
+            BIO_puts(bio, "    Error\n");
         } else {
-            BIO_printf(bio, "    Keying material: ");
+            BIO_puts(bio, "    Keying material: ");
             for (i = 0; i < keymatexportlen; i++)
                 BIO_printf(bio, "%02X", exportedkeymat[i]);
-            BIO_printf(bio, "\n");
+            BIO_puts(bio, "\n");
         }
         OPENSSL_free(exportedkeymat);
     }
-    BIO_printf(bio, "---\n");
+    BIO_puts(bio, "---\n");
+#ifndef OPENSSL_NO_ECH
+    estat = SSL_ech_get1_status(s, &inner, &outer);
+    print_ech_status(bio, s, estat);
+    if (estat == SSL_ECH_STATUS_SUCCESS) {
+        BIO_printf(bio, "ECH: inner: %s\n", inner == NULL ? "<NULL>" : inner);
+        BIO_printf(bio, "ECH: outer: %s\n", outer == NULL ? "<NULL>" : outer);
+    }
+    if (estat == SSL_ECH_STATUS_FAILED_ECH
+        || estat == SSL_ECH_STATUS_FAILED_ECH_BAD_NAME)
+        print_ech_retry_configs(bio, s);
+    OPENSSL_free(inner);
+    OPENSSL_free(outer);
+    BIO_puts(bio, "---\n");
+#endif
+
     /* flush, or debugging output gets mixed with http response */
     (void)BIO_flush(bio);
 }
@@ -3710,26 +4056,58 @@ static void print_stuff(BIO *bio, SSL *s, int full)
 #ifndef OPENSSL_NO_OCSP
 static int ocsp_resp_cb(SSL *s, void *arg)
 {
-    const unsigned char *p;
-    int len;
+    int num, i;
+    STACK_OF(OCSP_RESPONSE) *sk_resp = NULL;
     OCSP_RESPONSE *rsp;
-    len = SSL_get_tlsext_status_ocsp_resp(s, &p);
-    BIO_puts(arg, "OCSP response: ");
-    if (p == NULL) {
-        BIO_puts(arg, "no response sent\n");
-        return 1;
+
+    if ((!SSL_is_dtls(s) && SSL_version(s) >= TLS1_3_VERSION)
+        || (SSL_is_dtls(s) && SSL_version(s) <= DTLS1_3_VERSION)) {
+        (void)SSL_get0_tlsext_status_ocsp_resp_ex(s, &sk_resp);
+
+        BIO_puts(arg, "OCSP responses: ");
+
+        if (sk_resp == NULL) {
+            BIO_puts(arg, "no responses sent\n");
+            return 1;
+        }
+
+        num = sk_OCSP_RESPONSE_num(sk_resp);
+
+        BIO_printf(arg, "number of responses: %d", num);
+        for (i = 0; i < num; i++)
+            print_ocsp_response(arg, sk_OCSP_RESPONSE_value(sk_resp, i));
+    } else {
+        const unsigned char *p;
+        int len = SSL_get_tlsext_status_ocsp_resp(s, &p);
+
+        BIO_puts(arg, "OCSP response: ");
+        if (p == NULL) {
+            BIO_puts(arg, "no OCSP response received\n");
+            return 1;
+        }
+        rsp = d2i_OCSP_RESPONSE(NULL, &p, len);
+        if (rsp == NULL) {
+            BIO_puts(arg, "OCSP response parse error\n");
+            BIO_dump_indent(arg, p, len, 4);
+            return 0;
+        }
+        print_ocsp_response(arg, rsp);
+        OCSP_RESPONSE_free(rsp);
     }
-    rsp = d2i_OCSP_RESPONSE(NULL, &p, len);
+
+    return 1;
+}
+
+static void print_ocsp_response(BIO *bp, OCSP_RESPONSE *rsp)
+{
     if (rsp == NULL) {
-        BIO_puts(arg, "response parse error\n");
-        BIO_dump_indent(arg, (char *)p, len, 4);
-        return 0;
+        BIO_puts(bp, "no OCSP response to print\n");
+        return;
     }
-    BIO_puts(arg, "\n======================================\n");
-    OCSP_RESPONSE_print(arg, rsp, 0);
-    BIO_puts(arg, "======================================\n");
-    OCSP_RESPONSE_free(rsp);
-    return 1;
+
+    BIO_puts(bp, "\n======================================\n");
+    OCSP_RESPONSE_print(bp, rsp, 0);
+    BIO_puts(bp, "\n======================================\n");
 }
 #endif

@@ -3771,8 +4149,8 @@ static int ldap_ExtendedResponse_parse(const char *buf, long rem)

     /* pull SEQUENCE */
     inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);
-    if (inf != V_ASN1_CONSTRUCTED || tag != V_ASN1_SEQUENCE || (rem = end - cur, len > rem)) {
-        BIO_printf(bio_err, "Unexpected LDAP response\n");
+    if (inf != V_ASN1_CONSTRUCTED || tag != V_ASN1_SEQUENCE || (rem = (long)(end - cur), len > rem)) {
+        BIO_puts(bio_err, "Unexpected LDAP response\n");
         goto end;
     }

@@ -3780,26 +4158,26 @@ static int ldap_ExtendedResponse_parse(const char *buf, long rem)

     /* pull MessageID */
     inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);
-    if (inf != V_ASN1_UNIVERSAL || tag != V_ASN1_INTEGER || (rem = end - cur, len > rem)) {
-        BIO_printf(bio_err, "No MessageID\n");
+    if (inf != V_ASN1_UNIVERSAL || tag != V_ASN1_INTEGER || (rem = (long)(end - cur), len > rem)) {
+        BIO_puts(bio_err, "No MessageID\n");
         goto end;
     }

     cur += len; /* shall we check for MessageId match or just skip? */

     /* pull [APPLICATION 24] */
-    rem = end - cur;
+    rem = (long)(end - cur);
     inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);
     if (inf != V_ASN1_CONSTRUCTED || xclass != V_ASN1_APPLICATION || tag != 24) {
-        BIO_printf(bio_err, "Not ExtendedResponse\n");
+        BIO_puts(bio_err, "Not ExtendedResponse\n");
         goto end;
     }

     /* pull resultCode */
-    rem = end - cur;
+    rem = (long)(end - cur);
     inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);
-    if (inf != V_ASN1_UNIVERSAL || tag != V_ASN1_ENUMERATED || len == 0 || (rem = end - cur, len > rem)) {
-        BIO_printf(bio_err, "Not LDAPResult\n");
+    if (inf != V_ASN1_UNIVERSAL || tag != V_ASN1_ENUMERATED || len == 0 || (rem = (long)(end - cur), len > rem)) {
+        BIO_puts(bio_err, "Not LDAPResult\n");
         goto end;
     }

@@ -3915,42 +4293,44 @@ static int user_data_add(struct user_data_st *user_data, size_t i)

 static int user_data_execute(struct user_data_st *user_data, int cmd, char *arg)
 {
+    const int version1_3 = SSL_is_dtls(user_data->con) ? DTLS1_3_VERSION : TLS1_3_VERSION;
+
     switch (cmd) {
     case USER_COMMAND_HELP:
         /* This only ever occurs in advanced mode, so just emit advanced help */
-        BIO_printf(bio_err, "Enter text to send to the peer followed by <enter>\n");
-        BIO_printf(bio_err, "To issue a command insert {cmd} or {cmd:arg} anywhere in the text\n");
-        BIO_printf(bio_err, "Entering {{ will send { to the peer\n");
-        BIO_printf(bio_err, "The following commands are available\n");
-        BIO_printf(bio_err, "  {help}: Get this help text\n");
-        BIO_printf(bio_err, "  {quit}: Close the connection to the peer\n");
-        BIO_printf(bio_err, "  {reconnect}: Reconnect to the peer\n");
+        BIO_puts(bio_err, "Enter text to send to the peer followed by <enter>\n"
+                          "To issue a command insert {cmd} or {cmd:arg} anywhere in the text\n"
+                          "Entering {{ will send { to the peer\n"
+                          "The following commands are available\n"
+                          "  {help}: Get this help text\n"
+                          "  {quit}: Close the connection to the peer\n"
+                          "  {reconnect}: Reconnect to the peer\n");
         if (SSL_is_quic(user_data->con)) {
-            BIO_printf(bio_err, "  {fin}: Send FIN on the stream. No further writing is possible\n");
-        } else if (SSL_version(user_data->con) == TLS1_3_VERSION) {
-            BIO_printf(bio_err, "  {keyup:req|noreq}: Send a Key Update message\n");
-            BIO_printf(bio_err, "                     Arguments:\n");
-            BIO_printf(bio_err, "                     req   = peer update requested (default)\n");
-            BIO_printf(bio_err, "                     noreq = peer update not requested\n");
+            BIO_puts(bio_err, "  {fin}: Send FIN on the stream. No further writing is possible\n");
+        } else if (SSL_version(user_data->con) == version1_3) {
+            BIO_puts(bio_err, "  {keyup:req|noreq}: Send a Key Update message\n"
+                              "                     Arguments:\n"
+                              "                     req   = peer update requested (default)\n"
+                              "                     noreq = peer update not requested\n");
         } else {
-            BIO_printf(bio_err, "  {reneg}: Attempt to renegotiate\n");
+            BIO_puts(bio_err, "  {reneg}: Attempt to renegotiate\n");
         }
-        BIO_printf(bio_err, "\n");
+        BIO_puts(bio_err, "\n");
         return USER_DATA_PROCESS_NO_DATA;

     case USER_COMMAND_QUIT:
-        BIO_printf(bio_err, "DONE\n");
+        BIO_puts(bio_err, "DONE\n");
         return USER_DATA_PROCESS_SHUT;

     case USER_COMMAND_RECONNECT:
-        BIO_printf(bio_err, "RECONNECTING\n");
+        BIO_puts(bio_err, "RECONNECTING\n");
         do_ssl_shutdown(user_data->con);
         SSL_set_connect_state(user_data->con);
         BIO_closesocket(SSL_get_fd(user_data->con));
         return USER_DATA_PROCESS_RESTART;

     case USER_COMMAND_RENEGOTIATE:
-        BIO_printf(bio_err, "RENEGOTIATING\n");
+        BIO_puts(bio_err, "RENEGOTIATING\n");
         if (!SSL_renegotiate(user_data->con))
             break;
         return USER_DATA_PROCESS_CONTINUE;
@@ -3964,7 +4344,7 @@ static int user_data_execute(struct user_data_st *user_data, int cmd, char *arg)
             updatetype = SSL_KEY_UPDATE_NOT_REQUESTED;
         else
             return USER_DATA_PROCESS_BAD_ARGUMENT;
-        BIO_printf(bio_err, "KEYUPDATE\n");
+        BIO_puts(bio_err, "KEYUPDATE\n");
         if (!SSL_key_update(user_data->con, updatetype))
             break;
         return USER_DATA_PROCESS_CONTINUE;
@@ -3980,9 +4360,7 @@ static int user_data_execute(struct user_data_st *user_data, int cmd, char *arg)
         break;
     }

-    BIO_printf(bio_err, "ERROR\n");
-    ERR_print_errors(bio_err);
-
+    BIO_puts(bio_err, "ERROR\n");
     return USER_DATA_PROCESS_SHUT;
 }

@@ -3991,6 +4369,7 @@ static int user_data_process(struct user_data_st *user_data, size_t *len,
 {
     char *buf_start = user_data->buf + user_data->bufoff;
     size_t outlen = user_data->buflen;
+    const int version1_3 = SSL_is_dtls(user_data->con) ? DTLS1_3_VERSION : TLS1_3_VERSION;

     if (user_data->buflen == 0) {
         *len = 0;
@@ -4077,7 +4456,7 @@ static int user_data_process(struct user_data_st *user_data, size_t *len,
                 if (OPENSSL_strcasecmp(cmd_start, "fin") == 0)
                     cmd = USER_COMMAND_FIN;
             }
-            if (SSL_version(user_data->con) == TLS1_3_VERSION) {
+            if (SSL_version(user_data->con) == version1_3) {
                 if (OPENSSL_strcasecmp(cmd_start, "keyup") == 0) {
                     cmd = USER_COMMAND_KEY_UPDATE;
                     if (arg_start == NULL)
diff --git a/deps/openssl/openssl/apps/s_server.c b/deps/openssl/openssl/apps/s_server.c
index da8d001bc42..13b46c613e5 100644
--- a/deps/openssl/openssl/apps/s_server.c
+++ b/deps/openssl/openssl/apps/s_server.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  * Copyright 2005 Nokia. All rights reserved.
  *
@@ -19,6 +19,9 @@
 /* Included before async.h to avoid some warnings */
 #include <windows.h>
 #endif
+#if !defined(OPENSSL_NO_ECH) && !defined(PATH_MAX)
+#define PATH_MAX 4096
+#endif

 #include <openssl/e_os2.h>
 #include <openssl/async.h>
@@ -26,6 +29,27 @@
 #include <openssl/decoder.h>
 #include "internal/sockets.h" /* for openssl_fdset() */

+#ifndef OPENSSL_NO_ECH
+/* to use tracing, if configured and requested */
+#ifndef OPENSSL_NO_SSL_TRACE
+#include <openssl/trace.h>
+#endif
+/* sockaddr stuff  */
+#if defined(_WIN32)
+#include <winsock.h>
+#include <ws2ipdef.h>
+#include <ws2tcpip.h>
+#else
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#endif
+/* for timing in some TRACE statements */
+#include <time.h>
+#include "internal/o_dir.h" /* for OPENSSL_DIR_read */
+#endif
+
 #ifndef OPENSSL_NO_SOCK

 /*
@@ -57,6 +81,13 @@ typedef unsigned int u_int;
 #include <openssl/ebcdic.h>
 #endif
 #include "internal/sockets.h"
+#include "internal/statem.h"
+#include "ssl/ssl_local.h"
+
+#ifndef OPENSSL_NO_ECH
+/* needed for X509_check_host in some CI builds "no-http" */
+#include <openssl/x509v3.h>
+#endif

 static int not_resumable_sess_cb(SSL *s, int is_forward_secure);
 static int sv_body(int s, int stype, int prot, unsigned char *context);
@@ -71,6 +102,10 @@ static void init_session_cache_ctx(SSL_CTX *sctx);
 static void free_sessions(void);
 static void print_connection_info(SSL *con);

+#ifndef OPENSSL_NO_ECH
+static unsigned int ech_print_cb(SSL *s, const char *str);
+#endif
+
 static const int bufsize = 16 * 1024;
 static int accept_socket = -1;

@@ -82,6 +117,7 @@ static int s_nbio_test = 0;
 static int s_crlf = 0;
 static SSL_CTX *ctx = NULL;
 static SSL_CTX *ctx2 = NULL;
+static STACK_OF(OPENSSL_STRING) *rpk_files = NULL;
 static int www = 0;

 static BIO *bio_s_out = NULL;
@@ -98,8 +134,10 @@ static int keymatexportlen = 20;

 static int async = 0;

-static int use_sendfile = 0;
-static int use_zc_sendfile = 0;
+#ifndef OPENSSL_NO_KTLS
+static int use_sendfile;
+static int use_zc_sendfile;
+#endif

 static const char *session_id_prefix = NULL;

@@ -133,27 +171,28 @@ static unsigned int psk_server_cb(SSL *ssl, const char *identity,
 {
     long key_len = 0;
     unsigned char *key;
+    const int version1_3 = SSL_is_dtls(ssl) ? DTLS1_3_VERSION : TLS1_3_VERSION;

     if (s_debug)
-        BIO_printf(bio_s_out, "psk_server_cb\n");
+        BIO_puts(bio_s_out, "psk_server_cb\n");

-    if (!SSL_is_dtls(ssl) && SSL_version(ssl) >= TLS1_3_VERSION) {
+    if (PROTOCOL_VERSION_CMP(SSL_is_dtls(ssl), SSL_version(ssl), version1_3) >= 0) {
         /*
          * This callback is designed for use in (D)TLSv1.2 (or below). It is
          * possible to use a single callback for all protocol versions - but it
-         * is preferred to use a dedicated callback for TLSv1.3. For TLSv1.3 we
-         * have psk_find_session_cb.
+         * is preferred to use a dedicated callback for (D)TLSv1.3. For
+         * (D)TLSv1.3 we have psk_find_session_cb.
          */
         return 0;
     }

     if (identity == NULL) {
-        BIO_printf(bio_err, "Error: client did not send PSK identity\n");
+        BIO_puts(bio_err, "Error: client did not send PSK identity\n");
         goto out_err;
     }
     if (s_debug)
-        BIO_printf(bio_s_out, "identity_len=%d identity=%s\n",
-            (int)strlen(identity), identity);
+        BIO_printf(bio_s_out, "identity_len=%zu identity=%s\n",
+            strlen(identity), identity);

     /* here we could lookup the given identity e.g. from a database */
     if (strcmp(identity, psk_identity) != 0) {
@@ -162,7 +201,7 @@ static unsigned int psk_server_cb(SSL *ssl, const char *identity,
             identity, psk_identity);
     } else {
         if (s_debug)
-            BIO_printf(bio_s_out, "PSK client identity found\n");
+            BIO_puts(bio_s_out, "PSK client identity found\n");
     }

     /* convert the PSK key to binary */
@@ -174,7 +213,7 @@ static unsigned int psk_server_cb(SSL *ssl, const char *identity,
     }
     if (key_len > (int)max_psk_len) {
         BIO_printf(bio_err,
-            "psk buffer of callback is too small (%d) for key (%ld)\n",
+            "psk buffer of callback is too small (%u) for key (%ld)\n",
             max_psk_len, key_len);
         OPENSSL_free(key);
         return 0;
@@ -188,7 +227,7 @@ static unsigned int psk_server_cb(SSL *ssl, const char *identity,
     return key_len;
 out_err:
     if (s_debug)
-        BIO_printf(bio_err, "Error in PSK server callback\n");
+        BIO_puts(bio_err, "Error in PSK server callback\n");
     (void)BIO_flush(bio_err);
     (void)BIO_flush(bio_s_out);
     return 0;
@@ -227,7 +266,7 @@ static int psk_find_session_cb(SSL *ssl, const unsigned char *identity,
     /* We default to SHA256 */
     cipher = SSL_CIPHER_find(ssl, tls13_aes128gcmsha256_id);
     if (cipher == NULL) {
-        BIO_printf(bio_err, "Error finding suitable ciphersuite\n");
+        BIO_puts(bio_err, "Error finding suitable ciphersuite\n");
         OPENSSL_free(key);
         return 0;
     }
@@ -420,8 +459,206 @@ typedef struct tlsextctx_st {
     char *servername;
     BIO *biodebug;
     int extension_error;
+    X509 *scert; /* ECH needs 2nd cert for testing */
 } tlsextctx;

+#ifndef OPENSSL_NO_ECH
+static unsigned int ech_print_cb(SSL *s, const char *str)
+{
+    if (str != NULL)
+        BIO_printf(bio_s_out, "ECH Server callback printing:\n%s\n", str);
+    return 1;
+}
+
+/*
+ * The server has possibly 2 TLS server names basically in ctx and ctx2.  So we
+ * need to check if any client-supplied SNI in the inner/outer matches either
+ * and serve whichever is appropriate.  X509_check_host is the way to do that,
+ * given an X509* pointer.
+ *
+ * We default to the "main" ctx if the client-supplied SNI does not match the
+ * ctx2 certificate.  We don't fail if the client-supplied SNI matches neither,
+ * but just continue with the "main" ctx.  If the client-supplied SNI matches
+ * both ctx and ctx2, then we'll switch to ctx2 anyway - we don't try for a
+ * "best" match in that case.
+ *
+ * Note that since we attempt ECH decryption whenever configured to do that,
+ * the only way to get the "outer" SNI is via SSL_ech_get1_status.
+ */
+
+/* apparently 26 is all we need, but round it up to 32 to be on the safe side */
+#define ECH_TIME_STR_LEN 32
+
+static int ssl_ech_servername_cb(SSL *s, int *ad, void *arg)
+{
+    tlsextctx *p = (tlsextctx *)arg;
+    time_t now = time(0); /* For a bit of basic logging */
+    int sockfd = 0, res = 0, echrv = 0;
+    size_t srv = 0;
+    struct sockaddr_storage ss;
+    socklen_t salen = sizeof(ss);
+    struct sockaddr *sa;
+    char clientip[INET6_ADDRSTRLEN], lstr[ECH_TIME_STR_LEN];
+    const char *servername = NULL;
+    char *inner_sni = NULL, *outer_sni = NULL;
+    struct tm local;
+#if !defined(OPENSSL_SYS_WINDOWS)
+    struct tm *local_p = NULL;
+#else
+    errno_t grv;
+#endif
+
+#if !defined(OPENSSL_SYS_WINDOWS)
+    local_p = gmtime_r(&now, &local);
+    if (local_p != &local) {
+        strcpy(lstr, "sometime");
+    } else {
+        srv = strftime(lstr, ECH_TIME_STR_LEN, "%c", &local);
+        if (srv == 0)
+            strcpy(lstr, "sometime");
+    }
+#else
+    grv = gmtime_s(&local, &now);
+    if (grv != 0) {
+        strcpy(lstr, "sometime");
+    } else {
+        srv = strftime(lstr, ECH_TIME_STR_LEN, "%c", &local);
+        if (srv == 0)
+            strcpy(lstr, "sometime");
+    }
+#endif
+    memset(clientip, 0, INET6_ADDRSTRLEN);
+    strncpy(clientip, "unknown", INET6_ADDRSTRLEN);
+    memset(&ss, 0, salen);
+    sa = (struct sockaddr *)&ss;
+    res = BIO_get_fd(SSL_get_wbio(s), &sockfd);
+    if (res != -1) {
+#if !defined(_WIN32)
+        res = getpeername(sockfd, sa, &salen);
+#else
+        res = getpeername(sockfd, sa, (int *)&salen);
+#endif
+        if (res == 0)
+            res = getnameinfo(sa, salen, clientip, INET6_ADDRSTRLEN,
+                0, 0, NI_NUMERICHOST);
+    }
+    /* Name that matches "main" ctx */
+    servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
+    echrv = SSL_ech_get1_status(s, &inner_sni, &outer_sni);
+    if (p->biodebug != NULL) {
+        /* spit out basic logging */
+        BIO_printf(p->biodebug,
+            "ssl_ech_servername_cb: connection from %s at %s\n",
+            clientip, lstr);
+        /* Client supplied SNI from inner and outer */
+        switch (echrv) {
+        case SSL_ECH_STATUS_BACKEND:
+            BIO_printf(p->biodebug,
+                "ssl_ech_servername_cb: ECH backend got inner ECH\n");
+            break;
+        case SSL_ECH_STATUS_NOT_CONFIGURED:
+            BIO_printf(p->biodebug,
+                "ssl_ech_servername_cb: ECH not configured\n");
+            break;
+        case SSL_ECH_STATUS_GREASE:
+            BIO_printf(p->biodebug,
+                "ssl_ech_servername_cb: attempt we think is GREASE\n");
+            break;
+        case SSL_ECH_STATUS_NOT_TRIED:
+            BIO_printf(p->biodebug,
+                "ssl_ech_servername_cb: not attempted\n");
+            break;
+        case SSL_ECH_STATUS_FAILED:
+            BIO_printf(p->biodebug,
+                "ssl_ech_servername_cb: tried but failed\n");
+            break;
+        case SSL_ECH_STATUS_BAD_CALL:
+            BIO_printf(p->biodebug,
+                "ssl_ech_servername_cb: bad input to API\n");
+            break;
+        case SSL_ECH_STATUS_BAD_NAME:
+            BIO_printf(p->biodebug,
+                "ssl_ech_servername_cb: worked but bad name\n");
+            break;
+        case SSL_ECH_STATUS_SUCCESS:
+            BIO_printf(p->biodebug,
+                "ssl_ech_servername_cb: success: outer %s, inner: %s\n",
+                (outer_sni == NULL ? "none" : outer_sni),
+                (inner_sni == NULL ? "none" : inner_sni));
+            break;
+        default:
+            BIO_printf(p->biodebug,
+                "ssl_ech_servername_cb: Error getting ECH status\n");
+            break;
+        }
+    }
+    OPENSSL_free(inner_sni);
+    OPENSSL_free(outer_sni);
+    if (servername != NULL && p->biodebug != NULL) {
+        const char *cp = servername;
+        unsigned char uc;
+
+        BIO_printf(p->biodebug,
+            "ssl_ech_servername_cb: Hostname in TLS extension: \"");
+        while ((uc = *cp++) != 0)
+            BIO_printf(p->biodebug,
+                isascii(uc) && isprint(uc) ? "%c" : "\\x%02x", uc);
+        BIO_printf(p->biodebug, "\"\n");
+        if (p->servername != NULL)
+            BIO_printf(p->biodebug,
+                "ssl_ech_servername_cb: ctx servername: %s\n",
+                p->servername);
+        else
+            BIO_printf(p->biodebug,
+                "ssl_ech_servername_cb: ctx servername is NULL\n");
+        if (p->scert == NULL)
+            BIO_printf(p->biodebug,
+                "ssl_ech_servername_cb: No 2nd cert! That's bad.\n");
+    }
+    if (p->servername == NULL)
+        return SSL_TLSEXT_ERR_NOACK;
+    if (p->scert == NULL)
+        return SSL_TLSEXT_ERR_NOACK;
+    if (echrv == SSL_ECH_STATUS_SUCCESS && servername != NULL) {
+        if (ctx2 != NULL) {
+            int check_host = check_cert_might_be_valid(p->biodebug,
+                p->biodebug, p->scert, servername, NULL, NULL);
+
+            if (check_host == 1) {
+                if (p->biodebug != NULL)
+                    BIO_printf(p->biodebug,
+                        "ssl_ech_servername_cb: Switching context.\n");
+                SSL_set_SSL_CTX(s, ctx2);
+            } else {
+                if (p->biodebug != NULL)
+                    BIO_printf(p->biodebug,
+                        "ssl_ech_servername_cb: Not switching context "
+                        "- no name match (%d).\n",
+                        check_host);
+                if (OPENSSL_strcasecmp(servername, p->servername) != 0)
+                    return p->extension_error;
+            }
+        }
+    } else {
+        if (p->biodebug != NULL)
+            BIO_printf(p->biodebug,
+                "ssl_ech_servername_cb: Not switching context "
+                "- no ECH SUCCESS\n");
+        if (servername != NULL) {
+            if (OPENSSL_strcasecmp(servername, p->servername))
+                return p->extension_error;
+            if (ctx2 != NULL) {
+                BIO_puts(p->biodebug, "Switching server context.\n");
+                SSL_set_SSL_CTX(s, ctx2);
+            }
+        }
+    }
+    return SSL_TLSEXT_ERR_OK;
+}
+/* Below is the "original" ssl_servername_cb, before ECH */
+
+#else
+
 static int ssl_servername_cb(SSL *s, int *ad, void *arg)
 {
     tlsextctx *p = (tlsextctx *)arg;
@@ -431,11 +668,11 @@ static int ssl_servername_cb(SSL *s, int *ad, void *arg)
         const char *cp = servername;
         unsigned char uc;

-        BIO_printf(p->biodebug, "Hostname in TLS extension: \"");
+        BIO_puts(p->biodebug, "Hostname in TLS extension: \"");
         while ((uc = *cp++) != 0)
             BIO_printf(p->biodebug,
                 (((uc) & ~127) == 0) && isprint(uc) ? "%c" : "\\x%02x", uc);
-        BIO_printf(p->biodebug, "\"\n");
+        BIO_puts(p->biodebug, "\"\n");
     }

     if (p->servername == NULL)
@@ -445,26 +682,32 @@ static int ssl_servername_cb(SSL *s, int *ad, void *arg)
         if (OPENSSL_strcasecmp(servername, p->servername))
             return p->extension_error;
         if (ctx2 != NULL) {
-            BIO_printf(p->biodebug, "Switching server context.\n");
+            BIO_puts(p->biodebug, "Switching server context.\n");
             SSL_set_SSL_CTX(s, ctx2);
         }
     }
     return SSL_TLSEXT_ERR_OK;
 }

+#endif
+
 /* Structure passed to cert status callback */
 typedef struct tlsextstatusctx_st {
     int timeout;
-    /* File to load OCSP Response from (or NULL if no file) */
-    char *respin;
+    /*
+     * List of filenames, from which we are loading each OCSP Response to
+     * staple during handshake (or NULL if no file)
+     */
+    STACK_OF(OPENSSL_STRING) *sk_resp_in;
     /* Default responder to use */
     char *host, *path, *port;
     char *proxy, *no_proxy;
     int use_ssl;
     int verbose;
+    int status_all;
 } tlsextstatusctx;

-static tlsextstatusctx tlscstatp = { -1 };
+static tlsextstatusctx tlscstatp = { -1, NULL };

 #ifndef OPENSSL_NO_OCSP

@@ -475,15 +718,16 @@ static tlsextstatusctx tlscstatp = { -1 };
  * the OCSP certificate IDs and minimise the number of OCSP responses by caching
  * them until they were considered "expired".
  */
-static int get_ocsp_resp_from_responder(SSL *s, tlsextstatusctx *srctx,
+static int get_ocsp_resp_from_responder_single(SSL *s, X509 *x,
+    tlsextstatusctx *srctx,
     OCSP_RESPONSE **resp)
 {
     char *host = NULL, *port = NULL, *path = NULL;
     char *proxy = NULL, *no_proxy = NULL;
     int use_ssl;
     STACK_OF(OPENSSL_STRING) *aia = NULL;
-    X509 *x = NULL, *cert;
-    X509_NAME *iname;
+    X509 *cert;
+    const X509_NAME *iname;
     STACK_OF(X509) *chain = NULL;
     SSL_CTX *ssl_ctx;
     X509_STORE_CTX *inctx = NULL;
@@ -495,7 +739,6 @@ static int get_ocsp_resp_from_responder(SSL *s, tlsextstatusctx *srctx,
     int i;

     /* Build up OCSP query from server certificate */
-    x = SSL_get_certificate(s);
     iname = X509_get_issuer_name(x);
     aia = X509_get1_ocsp(x);
     if (aia != NULL) {
@@ -560,6 +803,7 @@ static int get_ocsp_resp_from_responder(SSL *s, tlsextstatusctx *srctx,
     SSL_get_tlsext_status_exts(s, &exts);
     for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) {
         X509_EXTENSION *ext = sk_X509_EXTENSION_value(exts, i);
+
         if (!OCSP_REQUEST_add_ext(req, ext, -1))
             goto err;
     }
@@ -592,57 +836,270 @@ done:
     return ret;
 }

+static int bring_ocsp_resp_in_correct_order(SSL *s, tlsextstatusctx *srctx,
+    STACK_OF(OCSP_RESPONSE) *sk_resp_unordered,
+    STACK_OF(OCSP_RESPONSE) **sk_resp)
+{
+    STACK_OF(X509) *server_chain = NULL;
+    X509 *ssl_cert = NULL;
+    X509 *issuer = NULL;
+    OCSP_RESPONSE *resp = NULL;
+    OCSP_BASICRESP *bs = NULL;
+    OCSP_CERTID *cert_id = NULL;
+    int found = -1;
+    int i, j, num = 1;
+
+    if (*sk_resp != NULL)
+        sk_OCSP_RESPONSE_pop_free(*sk_resp, OCSP_RESPONSE_free);
+
+    SSL_get0_chain_certs(s, &server_chain);
+
+    if (server_chain != NULL && srctx->status_all && ((!SSL_is_dtls(s) && SSL_version(s) >= TLS1_3_VERSION) || (SSL_is_dtls(s) && SSL_version(s) <= DTLS1_3_VERSION))) {
+        /* certificate chain is available */
+        num = sk_X509_num(server_chain) + 1;
+    }
+
+    /* get OCSP response for server certificate first */
+    ssl_cert = SSL_get_certificate(s);
+
+    /*
+     * OpenSSL servers with TLS < 1.3 can be configured with no certificate
+     */
+    if (ssl_cert == NULL)
+        return SSL_TLSEXT_ERR_OK;
+
+    /* reserve enough space so the pushes to the stack would not fail */
+    *sk_resp = sk_OCSP_RESPONSE_new_reserve(NULL, num);
+
+    if (*sk_resp == NULL)
+        return SSL_TLSEXT_ERR_ALERT_FATAL;
+
+    for (i = 0; i < num; i++) {
+        if (i != 0) /* for each certificate in chain (except root) get the OCSP response */
+            ssl_cert = sk_X509_value(server_chain, i - 1);
+
+        /* issuer certificate is next in chain */
+        issuer = sk_X509_value(server_chain, i);
+
+        /*
+         * in the case the root CA certificate is not included in the chain
+         * we assume that the last remaining response is issued by it
+         */
+        if (issuer == NULL && i == (num - 1) && sk_OCSP_RESPONSE_num(sk_resp_unordered) == 1) {
+            resp = sk_OCSP_RESPONSE_value(sk_resp_unordered, 0);
+            (void)sk_OCSP_RESPONSE_push(*sk_resp, resp);
+            sk_OCSP_RESPONSE_delete(sk_resp_unordered, 0);
+            continue;
+        }
+
+        if (issuer == NULL
+            || (cert_id = OCSP_cert_to_id(NULL, ssl_cert, issuer)) == NULL) {
+            sk_OCSP_RESPONSE_push(*sk_resp, NULL);
+            continue;
+        }
+
+        /* find the correct OCSP response for the requested certificate */
+        found = -1;
+        for (j = 0; j < sk_OCSP_RESPONSE_num(sk_resp_unordered); j++) {
+            if ((resp = sk_OCSP_RESPONSE_value(sk_resp_unordered, j)) == NULL)
+                continue;
+            if ((bs = OCSP_response_get1_basic(resp)) == NULL)
+                continue;
+            found = OCSP_resp_find(bs, cert_id, -1);
+            OCSP_BASICRESP_free(bs);
+            if (found > -1) {
+                /* remove the found OCSP response to prevent freeing it with the remaining list */
+                sk_OCSP_RESPONSE_delete(sk_resp_unordered, j);
+                break;
+            }
+        }
+        if (found < 0)
+            resp = NULL;
+
+        OCSP_CERTID_free(cert_id);
+
+        /* add response to stack; also insert null response */
+        (void)sk_OCSP_RESPONSE_push(*sk_resp, resp);
+    }
+
+    return SSL_TLSEXT_ERR_OK;
+}
+
 /*
- * Certificate Status callback. This is called when a client includes a
- * certificate status request extension. The response is either obtained from a
- * file, or from an OCSP responder.
+ * Helper function to get a list OCSP_RESPONSE from the files specified using
+ * -status_file options for the server certificate and the chain certificates,
+ * in the same order as the list of certs returned by SSL_get0_chain_certs().
+ * In case of a missing entry, the respective list element will be NULL.
  */
-static int cert_status_cb(SSL *s, void *arg)
+static int get_ocsp_resp_from_files(SSL *s, tlsextstatusctx *srctx,
+    STACK_OF(OCSP_RESPONSE) **sk_resp)
 {
-    tlsextstatusctx *srctx = arg;
+    STACK_OF(OCSP_RESPONSE) *sk_resp_unordered = NULL;
+    char *respfile = NULL;
     OCSP_RESPONSE *resp = NULL;
-    unsigned char *rspder = NULL;
-    int rspderlen;
-    int ret = SSL_TLSEXT_ERR_ALERT_FATAL;
+    BIO *derbio;
+    int i;
+    int num = sk_OPENSSL_STRING_num(srctx->sk_resp_in);
+    int ret = SSL_TLSEXT_ERR_OK;

-    if (srctx->verbose)
-        BIO_puts(bio_err, "cert_status: callback called\n");
+    sk_resp_unordered = sk_OCSP_RESPONSE_new_reserve(NULL, num);
+
+    if (sk_resp_unordered == NULL) {
+        BIO_puts(bio_err, "cert_status: Cannot reserve memory for OCSP responses\n");
+        return SSL_TLSEXT_ERR_ALERT_FATAL;
+    }
+
+    /* reading as many responses as files given */
+    for (i = 0; i < num; i++) {
+        respfile = sk_OPENSSL_STRING_value(srctx->sk_resp_in, i);
+
+        derbio = bio_open_default(respfile, 'r', FORMAT_ASN1);

-    if (srctx->respin != NULL) {
-        BIO *derbio = bio_open_default(srctx->respin, 'r', FORMAT_ASN1);
         if (derbio == NULL) {
-            BIO_puts(bio_err, "cert_status: Cannot open OCSP response file\n");
+            BIO_printf(bio_err, "cert_status: Cannot open OCSP response file %s\n", respfile);
+            ret = SSL_TLSEXT_ERR_ALERT_FATAL;
             goto err;
         }
+
         resp = d2i_OCSP_RESPONSE_bio(derbio, NULL);
         BIO_free(derbio);
         if (resp == NULL) {
-            BIO_puts(bio_err, "cert_status: Error reading OCSP response\n");
+            BIO_printf(bio_err, "cert_status: Error reading OCSP response from file %s\n",
+                respfile);
+            ret = SSL_TLSEXT_ERR_ALERT_FATAL;
             goto err;
         }
+
+        sk_OCSP_RESPONSE_push(sk_resp_unordered, resp);
+    }
+
+    ret = bring_ocsp_resp_in_correct_order(s, srctx, sk_resp_unordered, sk_resp);
+
+err:
+    /* free the unordered list, including all remaining OCSP responses */
+    sk_OCSP_RESPONSE_pop_free(sk_resp_unordered, OCSP_RESPONSE_free);
+
+    return ret;
+}
+
+/*
+ * Helper function to get a list of OCSP_RESPONSE from a responder
+ * for the server certificate and the chain certificates
+ * in the same order as the list of certs returned by SSL_get0_chain_certs().
+ * The function get_ocsp_resp_from_responder_single is called for each
+ * certificate.
+ * In case of a missing response, the respective list element will be NULL.
+ * This is a simplified version. It examines certificates each time and
+ * makes one OCSP responder query for each request. A full version would
+ * store details such as the OCSP certificate IDs and minimise the number of
+ * OCSP queries by caching responses until they were considered "expired".
+ */
+static int get_ocsp_resp_from_responder(SSL *s, tlsextstatusctx *srctx,
+    STACK_OF(OCSP_RESPONSE) **sk_resp)
+{
+    X509 *ssl_cert = NULL;
+    int i, num = 0;
+    STACK_OF(X509) *server_chain = NULL;
+    OCSP_RESPONSE *resp = NULL;
+
+    if (*sk_resp != NULL) {
+        sk_OCSP_RESPONSE_pop_free(*sk_resp, OCSP_RESPONSE_free);
+        *sk_resp = NULL;
+    }
+
+    SSL_get0_chain_certs(s, &server_chain);
+
+    if (server_chain != NULL && srctx->status_all && ((!SSL_is_dtls(s) && SSL_version(s) >= TLS1_3_VERSION) || (SSL_is_dtls(s) && SSL_version(s) <= DTLS1_3_VERSION))) {
+        /* certificate chain is available */
+        num = sk_X509_num(server_chain) + 1;
     } else {
-        ret = get_ocsp_resp_from_responder(s, srctx, &resp);
-        if (ret != SSL_TLSEXT_ERR_OK)
-            goto err;
+        /*
+         * certificate chain is not available,
+         * set num to 1 for server certificate
+         */
+        num = 1;
     }

-    rspderlen = i2d_OCSP_RESPONSE(resp, &rspder);
-    if (rspderlen <= 0)
-        goto err;
+    ssl_cert = SSL_get_certificate(s);
+
+    /*
+     * OpenSSL servers with TLS < 1.3 can be configured with no certificate
+     */
+    if (ssl_cert == NULL)
+        return SSL_TLSEXT_ERR_OK;
+
+    *sk_resp = sk_OCSP_RESPONSE_new_reserve(NULL, num);
+
+    if (*sk_resp == NULL)
+        return SSL_TLSEXT_ERR_ALERT_FATAL;
+
+    /* for each certificate in chain (except root) get the OCSP response */
+    for (i = 0; i < num; i++) {
+        if (i != 0) /* get OCSP response for server certificate first */
+            ssl_cert = sk_X509_value(server_chain, i - 1);
+
+        resp = NULL;
+        if (get_ocsp_resp_from_responder_single(s, ssl_cert, srctx, &resp) != SSL_TLSEXT_ERR_OK)
+            resp = NULL;
+
+        /* add response to stack; also insert null response */
+        sk_OCSP_RESPONSE_push(*sk_resp, resp);
+    }
+
+    return SSL_TLSEXT_ERR_OK;
+}
+
+/*
+ * Certificate Status callback. This is called when a client includes a
+ * certificate status request extension. The response is either obtained from a
+ * file, or from an OCSP responder.
+ */
+static int cert_status_cb(SSL *s, void *arg)
+{
+    tlsextstatusctx *srctx = arg;
+    OCSP_RESPONSE *resp = NULL;
+    STACK_OF(OCSP_RESPONSE) *sk_resp = NULL;
+    int ret = SSL_TLSEXT_ERR_ALERT_FATAL;
+    int i;
+
+    if (srctx->verbose)
+        BIO_puts(bio_err, "cert_status: callback called\n");
+
+    SSL_get0_tlsext_status_ocsp_resp_ex(s, &sk_resp);
+
+    if (sk_resp == NULL || sk_OCSP_RESPONSE_num(sk_resp) <= 0) {
+        if (srctx->sk_resp_in != NULL) {
+            get_ocsp_resp_from_files(s, srctx, &sk_resp);
+        } else {
+            ret = get_ocsp_resp_from_responder(s, srctx, &sk_resp);
+            if (ret != SSL_TLSEXT_ERR_OK)
+                goto err;
+        }
+
+        (void)SSL_set0_tlsext_status_ocsp_resp_ex(s, sk_resp);
+    }

-    SSL_set_tlsext_status_ocsp_resp(s, rspder, rspderlen);
     if (srctx->verbose) {
-        BIO_puts(bio_err, "cert_status: ocsp response sent:\n");
-        OCSP_RESPONSE_print(bio_err, resp, 2);
+        BIO_printf(bio_err, "cert_status: ocsp response sent:\n"
+                            "cert_status: number of responses: %d\n",
+            sk_OCSP_RESPONSE_num(sk_resp));
+        for (i = 0; i < sk_OCSP_RESPONSE_num(sk_resp); i++) {
+            resp = sk_OCSP_RESPONSE_value(sk_resp, i);
+            if (resp != NULL)
+                OCSP_RESPONSE_print(bio_err, resp, 2);
+            else
+                BIO_printf(bio_err,
+                    "cert_status: no ocsp response for certificate with index %d\n", i);
+        }
     }

     ret = SSL_TLSEXT_ERR_OK;

 err:
-    if (ret != SSL_TLSEXT_ERR_OK)
+    if (ret != SSL_TLSEXT_ERR_OK) {
         ERR_print_errors(bio_err);
-
-    OCSP_RESPONSE_free(resp);
+        sk_OCSP_RESPONSE_pop_free(sk_resp, OCSP_RESPONSE_free);
+    }

     return ret;
 }
@@ -661,7 +1118,7 @@ static int next_proto_cb(SSL *s, const unsigned char **data,
     tlsextnextprotoctx *next_proto = arg;

     *data = next_proto->data;
-    *len = next_proto->len;
+    *len = (unsigned int)next_proto->len;

     return SSL_TLSEXT_ERR_OK;
 }
@@ -681,7 +1138,8 @@ static int alpn_cb(SSL *s, const unsigned char **out, unsigned char *outlen,
     if (!s_quiet) {
         /* We can assume that |in| is syntactically valid. */
         unsigned int i;
-        BIO_printf(bio_s_out, "ALPN protocols advertised by the client: ");
+
+        BIO_puts(bio_s_out, "ALPN protocols advertised by the client: ");
         for (i = 0; i < inlen;) {
             if (i)
                 BIO_write(bio_s_out, ", ", 2);
@@ -691,14 +1149,13 @@ static int alpn_cb(SSL *s, const unsigned char **out, unsigned char *outlen,
         BIO_write(bio_s_out, "\n", 1);
     }

-    if (SSL_select_next_proto((unsigned char **)out, outlen, alpn_ctx->data, alpn_ctx->len, in,
-            inlen)
-        != OPENSSL_NPN_NEGOTIATED) {
+    if (SSL_select_next_proto((unsigned char **)out, outlen, alpn_ctx->data,
+            (unsigned int)alpn_ctx->len, in, inlen)
+        != OPENSSL_NPN_NEGOTIATED)
         return SSL_TLSEXT_ERR_ALERT_FATAL;
-    }

     if (!s_quiet) {
-        BIO_printf(bio_s_out, "ALPN protocols selected: ");
+        BIO_puts(bio_s_out, "ALPN protocols selected: ");
         BIO_write(bio_s_out, *out, *outlen);
         BIO_write(bio_s_out, "\n", 1);
     }
@@ -714,7 +1171,6 @@ static int not_resumable_sess_cb(SSL *s, int is_forward_secure)

 typedef enum OPTION_choice {
     OPT_COMMON,
-    OPT_ENGINE,
     OPT_4,
     OPT_6,
     OPT_ACCEPT,
@@ -768,6 +1224,7 @@ typedef enum OPTION_choice {
     OPT_DEBUG,
     OPT_TLSEXTDEBUG,
     OPT_STATUS,
+    OPT_STATUS_ALL,
     OPT_STATUS_VERBOSE,
     OPT_STATUS_TIMEOUT,
     OPT_PROXY,
@@ -801,7 +1258,6 @@ typedef enum OPTION_choice {
     OPT_SPLIT_SEND_FRAG,
     OPT_MAX_PIPELINES,
     OPT_READ_BUF,
-    OPT_SSL3,
     OPT_TLS1_3,
     OPT_TLS1_2,
     OPT_TLS1_1,
@@ -809,6 +1265,7 @@ typedef enum OPTION_choice {
     OPT_DTLS,
     OPT_DTLS1,
     OPT_DTLS1_2,
+    OPT_DTLS1_3,
     OPT_SCTP,
     OPT_TIMEOUT,
     OPT_MTU,
@@ -842,6 +1299,14 @@ typedef enum OPTION_choice {
     OPT_CERT_COMP,
     OPT_ENABLE_SERVER_RPK,
     OPT_ENABLE_CLIENT_RPK,
+    OPT_EXPECTED_RPK,
+#ifndef OPENSSL_NO_ECH
+    OPT_ECH_PEM,
+    OPT_ECH_DIR,
+    OPT_ECH_NORETRY,
+    OPT_ECH_TRIALDECRYPT,
+    OPT_ECH_GREASE_RT,
+#endif
     OPT_R_ENUM,
     OPT_S_ENUM,
     OPT_V_ENUM,
@@ -857,9 +1322,6 @@ const OPTIONS s_server_options[] = {
 #ifndef OPENSSL_NO_SSL_TRACE
     { "trace", OPT_TRACE, '-', "trace protocol messages" },
 #endif
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif

     OPT_SECTION("Network"),
     { "port", OPT_PORT, 'p',
@@ -878,9 +1340,9 @@ const OPTIONS s_server_options[] = {

     OPT_SECTION("Identity"),
     { "context", OPT_CONTEXT, 's', "Set session ID context" },
-    { "CAfile", OPT_CAFILE, '<', "PEM format file of CA's" },
-    { "CApath", OPT_CAPATH, '/', "PEM format directory of CA's" },
-    { "CAstore", OPT_CASTORE, ':', "URI to store of CA's" },
+    { "CAfile", OPT_CAFILE, '<', "File in PEM format with trusted CA certs" },
+    { "CApath", OPT_CAPATH, '/', "Dir with trusted CA cert files in PEM format" },
+    { "CAstore", OPT_CASTORE, ':', "URI of store with trusted CA certs" },
     { "no-CAfile", OPT_NOCAFILE, '-',
         "Do not load the default certificates file" },
     { "no-CApath", OPT_NOCAPATH, '-',
@@ -888,9 +1350,9 @@ const OPTIONS s_server_options[] = {
     { "no-CAstore", OPT_NOCASTORE, '-',
         "Do not load certificates from the default certificates store URI" },
     { "nocert", OPT_NOCERT, '-', "Don't use any certificates (Anon-DH)" },
-    { "verify", OPT_VERIFY, 'n', "Turn on peer certificate verification" },
-    { "Verify", OPT_UPPER_V_VERIFY, 'n',
-        "Turn on peer certificate verification, must have a cert" },
+    { "verify", OPT_VERIFY, 'p', "Turn on peer certificate verification, set depth" },
+    { "Verify", OPT_UPPER_V_VERIFY, 'p',
+        "Turn on peer certificate verification, must have a cert, set depth" },
     { "nameopt", OPT_NAMEOPT, 's', "Certificate subject/issuer name printing options" },
     { "cert", OPT_CERT, '<', "Server certificate file to use; default " TEST_CERT },
     { "cert2", OPT_CERT2, '<',
@@ -906,7 +1368,7 @@ const OPTIONS s_server_options[] = {
         "Private key file to use; default is -cert file or else" TEST_CERT },
     { "key2", OPT_KEY2, '<',
         "-Private Key file to use for servername if not in -cert2" },
-    { "keyform", OPT_KEYFORM, 'f', "Key format (ENGINE, other values ignored)" },
+    { "keyform", OPT_KEYFORM, 'f', "Key format (DER/PEM)" },
     { "pass", OPT_PASS, 's', "Private key and cert file pass phrase source" },
     { "dcert", OPT_DCERT, '<',
         "Second server certificate file to use (usually for DSA)" },
@@ -916,8 +1378,7 @@ const OPTIONS s_server_options[] = {
         "second server certificate chain file in PEM format" },
     { "dkey", OPT_DKEY, '<',
         "Second private key file to use (usually for DSA)" },
-    { "dkeyform", OPT_DKEYFORM, 'f',
-        "Second key file format (ENGINE, other values ignored)" },
+    { "dkeyform", OPT_DKEYFORM, 'f', "Second key file format (DER/PEM)" },
     { "dpass", OPT_DPASS, 's',
         "Second private key and cert file pass phrase source" },
     { "dhparam", OPT_DHPARAM, '<', "DH parameters file to use" },
@@ -948,17 +1409,23 @@ const OPTIONS s_server_options[] = {
     { "crl_download", OPT_CRL_DOWNLOAD, '-',
         "Download CRLs from distribution points in certificate CDP entries" },
     { "chainCAfile", OPT_CHAINCAFILE, '<',
-        "CA file for certificate chain (PEM format)" },
+        "File in PEM format with trusted CA certs to build own cert chain" },
     { "chainCApath", OPT_CHAINCAPATH, '/',
-        "use dir as certificate store path to build CA certificate chain" },
+        "Dir with trusted CA cert files in PEM format to build own cert chain" },
     { "chainCAstore", OPT_CHAINCASTORE, ':',
-        "use URI as certificate store to build CA certificate chain" },
+        "URI of trusted CA cert store to build own cert chain" },
+    { OPT_MORE_STR, 0, 0,
+        "NOTE: these override -CApath, -CAfile, and -CAstore for server chain building" },
     { "verifyCAfile", OPT_VERIFYCAFILE, '<',
-        "CA file for certificate verification (PEM format)" },
+        "File in PEM format with trusted CA certs for client cert verification" },
     { "verifyCApath", OPT_VERIFYCAPATH, '/',
-        "use dir as certificate store path to verify CA certificate" },
+        "Dir with trusted CA cert files in PEM format for client cert verification" },
     { "verifyCAstore", OPT_VERIFYCASTORE, ':',
-        "use URI as certificate store to verify CA certificate" },
+        "URI of trusted CA cert store for client cert verification" },
+    { OPT_MORE_STR, 0, 0,
+        "NOTE: these override -CApath, -CAfile, and -CAstore for client cert verification" },
+    { "expected-rpks", OPT_EXPECTED_RPK, '<',
+        "PEM file with expected client public key(s)" },
     { "no_cache", OPT_NO_CACHE, '-', "Disable session cache" },
     { "ext_cache", OPT_EXT_CACHE, '-',
         "Disable internal cache, set up and use external cache" },
@@ -974,10 +1441,13 @@ const OPTIONS s_server_options[] = {

 #ifndef OPENSSL_NO_OCSP
     OPT_SECTION("OCSP"),
-    { "status", OPT_STATUS, '-', "Request certificate status from server" },
+    { "status", OPT_STATUS, '-',
+        "Provide certificate status response if requested, for server cert only" },
+    { "status_all", OPT_STATUS_ALL, '-',
+        "Provide certificate status response(s) if requested, for the whole chain" },
     { "status_verbose", OPT_STATUS_VERBOSE, '-',
         "Print more output in certificate status callback" },
-    { "status_timeout", OPT_STATUS_TIMEOUT, 'n',
+    { "status_timeout", OPT_STATUS_TIMEOUT, 'N',
         "Status request responder timeout" },
     { "status_url", OPT_STATUS_URL, 's', "Status request fallback URL" },
     { "proxy", OPT_PROXY, 's',
@@ -987,7 +1457,7 @@ const OPTIONS s_server_options[] = {
     { OPT_MORE_STR, 0, 0,
         "Default from environment variable 'no_proxy', else 'NO_PROXY', else none" },
     { "status_file", OPT_STATUS_FILE, '<',
-        "File containing DER encoded OCSP Response" },
+        "File containing DER encoded OCSP Response (can be specified multiple times)" },
 #endif

     OPT_SECTION("Debug"),
@@ -1034,22 +1504,19 @@ const OPTIONS s_server_options[] = {
 #endif

     OPT_SECTION("Protocol and version"),
-    { "max_early_data", OPT_MAX_EARLY, 'n',
+    { "max_early_data", OPT_MAX_EARLY, 'N',
         "The maximum number of bytes of early data as advertised in tickets" },
-    { "recv_max_early_data", OPT_RECV_MAX_EARLY, 'n',
+    { "recv_max_early_data", OPT_RECV_MAX_EARLY, 'N',
         "The maximum number of bytes of early data (hard limit)" },
     { "early_data", OPT_EARLY_DATA, '-', "Attempt to read early data" },
     { "num_tickets", OPT_S_NUM_TICKETS, 'n',
-        "The number of TLSv1.3 session tickets that a server will automatically issue" },
+        "The number of (D)TLSv1.3 session tickets that a server will automatically issue" },
     { "anti_replay", OPT_ANTI_REPLAY, '-', "Switch on anti-replay protection (default)" },
     { "no_anti_replay", OPT_NO_ANTI_REPLAY, '-', "Switch off anti-replay protection" },
     { "http_server_binmode", OPT_HTTP_SERVER_BINMODE, '-', "opening files in binary mode when acting as http server (-WWW and -HTTP)" },
     { "no_ca_names", OPT_NOCANAMES, '-',
         "Disable TLS Extension CA Names" },
     { "stateless", OPT_STATELESS, '-', "Require TLSv1.3 cookies" },
-#ifndef OPENSSL_NO_SSL3
-    { "ssl3", OPT_SSL3, '-', "Just talk SSLv3" },
-#endif
 #ifndef OPENSSL_NO_TLS1
     { "tls1", OPT_TLS1, '-', "Just talk TLSv1" },
 #endif
@@ -1073,6 +1540,9 @@ const OPTIONS s_server_options[] = {
 #ifndef OPENSSL_NO_DTLS1_2
     { "dtls1_2", OPT_DTLS1_2, '-', "Just talk DTLSv1.2" },
 #endif
+#ifndef OPENSSL_NO_DTLS1_3
+    { "dtls1_3", OPT_DTLS1_3, '-', "Just talk DTLSv1.3" },
+#endif
 #ifndef OPENSSL_NO_SCTP
     { "sctp", OPT_SCTP, '-', "Use SCTP" },
     { "sctp_label_bug", OPT_SCTP_LABEL_BUG, '-', "Enable SCTP label length bug" },
@@ -1088,6 +1558,19 @@ const OPTIONS s_server_options[] = {
 #endif
     { "alpn", OPT_ALPN, 's',
         "Set the advertised protocols for the ALPN extension (comma-separated list)" },
+
+#ifndef OPENSSL_NO_ECH
+    { "ech_key", OPT_ECH_PEM, 's', "Load ECH PEM-formatted key pair" },
+    { "ech_dir", OPT_ECH_DIR, 's', "Load ECH key pairs (for retries) "
+                                   "from the specified directory" },
+    { "ech_noretry_dir", OPT_ECH_NORETRY, 's', "Load ECH key pairs (not "
+                                               "for retry) from the specified directory" },
+    { "ech_trialdecrypt", OPT_ECH_TRIALDECRYPT, '-',
+        "Do trial decryption even if ECH record_digest matching fails" },
+    { "ech_greaseretries", OPT_ECH_GREASE_RT, '-',
+        "Set server to GREASE retry_config values" },
+#endif
+
 #ifndef OPENSSL_NO_KTLS
     { "ktls", OPT_KTLS, '-', "Enable Kernel TLS for sending and receiving" },
     { "sendfile", OPT_SENDFILE, '-', "Use sendfile to response file with -WWW" },
@@ -1103,13 +1586,93 @@ const OPTIONS s_server_options[] = {
     { NULL }
 };

-#define IS_PROT_FLAG(o)                                                   \
-    (o == OPT_SSL3 || o == OPT_TLS1 || o == OPT_TLS1_1 || o == OPT_TLS1_2 \
-        || o == OPT_TLS1_3 || o == OPT_DTLS || o == OPT_DTLS1 || o == OPT_DTLS1_2)
+#ifndef OPENSSL_NO_ECH
+static int ech_load_dir(SSL_CTX *lctx, const char *thedir,
+    int for_retry, int *nloaded)
+{
+    size_t elen = strlen(thedir);
+    OPENSSL_DIR_CTX *d = NULL;
+    const char *thisfile = NULL;
+    OSSL_ECHSTORE *es = NULL;
+    int loaded = 0;
+    int ret = 0;
+
+    /*
+     * If you change the output to bio_s_out here you may
+     * also need to change test/recipes/82-test_ech_client_server.t
+     * as that test checks the server's stdout to decide if the
+     * server started ok or not. Text sent to stderr won't affect
+     * that test.
+     */
+    if ((elen + 7) >= PATH_MAX) { /* too long, go away */
+        BIO_printf(bio_err, "'%s' too long - exiting\n", thedir);
+        return 0;
+    }
+    if (app_isdir(thedir) <= 0) { /* if not a directory, ignore it */
+        BIO_printf(bio_err, "'%s' not a directory - exiting\n", thedir);
+        return 0;
+    }
+    if ((es = SSL_CTX_get1_echstore(lctx)) == NULL
+        && (es = OSSL_ECHSTORE_new(app_get0_libctx(),
+                app_get0_propq()))
+            == NULL) {
+        BIO_puts(bio_err, "ECH: Internal error\n");
+        return 0;
+    }
+    while ((thisfile = OPENSSL_DIR_read(&d, thedir))) {
+        char filepath[PATH_MAX];
+        BIO *in = NULL;
+        int r;
+
+#ifdef OPENSSL_SYS_VMS
+        r = snprintf(filepath, sizeof(filepath), "%s%s", thedir, thisfile);
+#else
+        r = snprintf(filepath, sizeof(filepath), "%s/%s", thedir, thisfile);
+#endif
+        if (r < 0 || (size_t)r >= sizeof(filepath))
+            continue;
+        if (app_isdir(filepath) > 0) {
+            if (s_debug)
+                BIO_printf(bio_err, "Skipping directory: %s\n", filepath);
+            continue;
+        }
+        if ((in = BIO_new_file(filepath, "r")) == NULL
+            || OSSL_ECHSTORE_read_pem(es, in, for_retry) != 1) {
+            BIO_free_all(in);
+            BIO_printf(bio_err, "Failed reading from: %s\n", filepath);
+            continue;
+        }
+        BIO_free_all(in);
+        if (bio_s_out != NULL)
+            BIO_printf(bio_s_out, "Added ECH key pair from: %s\n", thisfile);
+        loaded++;
+    }
+    OPENSSL_DIR_end(&d);
+
+    if (SSL_CTX_set1_echstore(lctx, es) != 1) {
+        BIO_puts(bio_err, "ECH: Internal error\n");
+        goto end;
+    }
+    if (bio_s_out != NULL)
+        BIO_printf(bio_s_out, "Added %d ECH key pairs from: %s\n",
+            loaded, thedir);
+    *nloaded = loaded;
+    ret = 1;
+
+end:
+    OSSL_ECHSTORE_free(es);
+
+    return ret;
+}
+#endif
+
+#define IS_PROT_FLAG(o)                                                           \
+    (o == OPT_TLS1 || o == OPT_TLS1_1 || o == OPT_TLS1_2                          \
+        || o == OPT_TLS1_3 || o == OPT_DTLS || o == OPT_DTLS1 || o == OPT_DTLS1_2 \
+        || o == OPT_DTLS1_3)

 int s_server_main(int argc, char *argv[])
 {
-    ENGINE *engine = NULL;
     EVP_PKEY *s_key = NULL, *s_dkey = NULL;
     SSL_CONF_CTX *cctx = NULL;
     const SSL_METHOD *meth = TLS_server_method();
@@ -1145,7 +1708,7 @@ int s_server_main(int argc, char *argv[])
     OPTION_CHOICE o;
     EVP_PKEY *s_key2 = NULL;
     X509 *s_cert2 = NULL;
-    tlsextctx tlsextcbp = { NULL, NULL, SSL_TLSEXT_ERR_ALERT_WARNING };
+    tlsextctx tlsextcbp = { NULL, NULL, SSL_TLSEXT_ERR_ALERT_WARNING, NULL };
     const char *ssl_config = NULL;
     int read_buf_len = 0;
 #ifndef OPENSSL_NO_NEXTPROTONEG
@@ -1165,6 +1728,9 @@ int s_server_main(int argc, char *argv[])
 #endif
 #ifndef OPENSSL_NO_SRTP
     char *srtp_profiles = NULL;
+#endif
+#if !(defined(OPENSSL_NO_NEXTPROTONEG) && defined(OPENSSL_NO_PSK))
+    int version1_3;
 #endif
     int min_version = 0, max_version = 0, prot_opt = 0, no_prot_opt = 0;
     int s_server_verify = SSL_VERIFY_NONE;
@@ -1183,6 +1749,14 @@ int s_server_main(int argc, char *argv[])
     int max_early_data = -1, recv_max_early_data = -1;
     char *psksessf = NULL;
     int no_ca_names = 0;
+#ifndef OPENSSL_NO_ECH
+    char *echkeyfile = NULL;
+    char *echkeydir = NULL;
+    char *echnoretrydir = NULL;
+    int ech_files_loaded = 0;
+    int echtrialdecrypt = 0; /* trial decryption off by default */
+    int echgrease_rc = 0; /* retry_config GREASEing off by default */
+#endif
 #ifndef OPENSSL_NO_SCTP
     int sctp_label_bug = 0;
 #endif
@@ -1207,8 +1781,10 @@ int s_server_main(int argc, char *argv[])
     s_quiet = 0;
     s_brief = 0;
     async = 0;
+#ifndef OPENSSL_NO_KTLS
     use_sendfile = 0;
     use_zc_sendfile = 0;
+#endif

     port = OPENSSL_strdup(PORT);
     cctx = SSL_CONF_CTX_new();
@@ -1221,13 +1797,13 @@ int s_server_main(int argc, char *argv[])
     prog = opt_init(argc, argv, s_server_options);
     while ((o = opt_next()) != OPT_EOF) {
         if (IS_PROT_FLAG(o) && ++prot_opt > 1) {
-            BIO_printf(bio_err, "Cannot supply multiple protocol flags\n");
+            BIO_puts(bio_err, "Cannot supply multiple protocol flags\n");
             goto end;
         }
         if (IS_NO_PROT_FLAG(o))
             no_prot_opt++;
         if (prot_opt == 1 && no_prot_opt) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Cannot supply both a protocol flag and '-no_<prot>'\n");
             goto end;
         }
@@ -1320,17 +1896,17 @@ int s_server_main(int argc, char *argv[])
             break;
 #endif
         case OPT_NACCEPT:
-            naccept = atol(opt_arg());
+            naccept = opt_int_arg();
             break;
         case OPT_VERIFY:
             s_server_verify = SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE;
-            verify_args.depth = atoi(opt_arg());
+            verify_args.depth = opt_int_arg();
             if (!s_quiet)
                 BIO_printf(bio_err, "verify depth is %d\n", verify_args.depth);
             break;
         case OPT_UPPER_V_VERIFY:
             s_server_verify = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT | SSL_VERIFY_CLIENT_ONCE;
-            verify_args.depth = atoi(opt_arg());
+            verify_args.depth = opt_int_arg();
             if (!s_quiet)
                 BIO_printf(bio_err,
                     "verify depth is %d, must return a certificate\n",
@@ -1455,6 +2031,7 @@ int s_server_main(int argc, char *argv[])
                 goto end;
             break;
         case OPT_VERIFY_RET_ERROR:
+            s_server_verify |= SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE;
             verify_args.return_error = 1;
             break;
         case OPT_VERIFY_QUIET:
@@ -1496,8 +2073,15 @@ int s_server_main(int argc, char *argv[])
         case OPT_STATUS:
 #ifndef OPENSSL_NO_OCSP
             s_tlsextstatus = 1;
+            tlscstatp.status_all = 0;
+#endif
+            break;
+        case OPT_STATUS_ALL:
+#ifndef OPENSSL_NO_OCSP
+            s_tlsextstatus = tlscstatp.status_all = 1;
 #endif
             break;
+
         case OPT_STATUS_VERBOSE:
 #ifndef OPENSSL_NO_OCSP
             s_tlsextstatus = tlscstatp.verbose = 1;
@@ -1506,7 +2090,7 @@ int s_server_main(int argc, char *argv[])
         case OPT_STATUS_TIMEOUT:
 #ifndef OPENSSL_NO_OCSP
             s_tlsextstatus = 1;
-            tlscstatp.timeout = atoi(opt_arg());
+            tlscstatp.timeout = opt_int_arg();
 #endif
             break;
         case OPT_PROXY:
@@ -1525,7 +2109,7 @@ int s_server_main(int argc, char *argv[])
             if (!OSSL_HTTP_parse_url(opt_arg(), &tlscstatp.use_ssl, NULL,
                     &tlscstatp.host, &tlscstatp.port, NULL,
                     &tlscstatp.path, NULL, NULL)) {
-                BIO_printf(bio_err, "Error parsing -status_url argument\n");
+                BIO_puts(bio_err, "Error parsing -status_url argument\n");
                 goto end;
             }
 #endif
@@ -1533,7 +2117,10 @@ int s_server_main(int argc, char *argv[])
         case OPT_STATUS_FILE:
 #ifndef OPENSSL_NO_OCSP
             s_tlsextstatus = 1;
-            tlscstatp.respin = opt_arg();
+            if (tlscstatp.sk_resp_in == NULL
+                && (tlscstatp.sk_resp_in = sk_OPENSSL_STRING_new_null()) == NULL)
+                goto end;
+            sk_OPENSSL_STRING_push(tlscstatp.sk_resp_in, opt_arg());
 #endif
             break;
         case OPT_MSG:
@@ -1623,10 +2210,6 @@ int s_server_main(int argc, char *argv[])
         case OPT_SSL_CONFIG:
             ssl_config = opt_arg();
             break;
-        case OPT_SSL3:
-            min_version = SSL3_VERSION;
-            max_version = SSL3_VERSION;
-            break;
         case OPT_TLS1_3:
             min_version = TLS1_3_VERSION;
             max_version = TLS1_3_VERSION;
@@ -1663,6 +2246,14 @@ int s_server_main(int argc, char *argv[])
             min_version = DTLS1_2_VERSION;
             max_version = DTLS1_2_VERSION;
             socket_type = SOCK_DGRAM;
+#endif
+            break;
+        case OPT_DTLS1_3:
+#ifndef OPENSSL_NO_DTLS
+            meth = DTLS_server_method();
+            min_version = DTLS1_3_VERSION;
+            max_version = DTLS1_3_VERSION;
+            socket_type = SOCK_DGRAM;
 #endif
             break;
         case OPT_SCTP:
@@ -1682,7 +2273,8 @@ int s_server_main(int argc, char *argv[])
             break;
         case OPT_MTU:
 #ifndef OPENSSL_NO_DTLS
-            socket_mtu = atol(opt_arg());
+            if (!opt_long(opt_arg(), &socket_mtu))
+                goto opthelp;
 #endif
             break;
         case OPT_LISTEN:
@@ -1696,11 +2288,6 @@ int s_server_main(int argc, char *argv[])
         case OPT_ID_PREFIX:
             session_id_prefix = opt_arg();
             break;
-        case OPT_ENGINE:
-#ifndef OPENSSL_NO_ENGINE
-            engine = setup_engine(opt_arg(), s_debug);
-#endif
-            break;
         case OPT_R_CASES:
             if (!opt_rand(o))
                 goto end;
@@ -1738,37 +2325,37 @@ int s_server_main(int argc, char *argv[])
             keymatexportlabel = opt_arg();
             break;
         case OPT_KEYMATEXPORTLEN:
-            keymatexportlen = atoi(opt_arg());
+            keymatexportlen = opt_int_arg();
             break;
         case OPT_ASYNC:
             async = 1;
             break;
         case OPT_MAX_SEND_FRAG:
-            max_send_fragment = atoi(opt_arg());
+            max_send_fragment = opt_int_arg();
             break;
         case OPT_SPLIT_SEND_FRAG:
-            split_send_fragment = atoi(opt_arg());
+            split_send_fragment = opt_int_arg();
             break;
         case OPT_MAX_PIPELINES:
-            max_pipelines = atoi(opt_arg());
+            max_pipelines = opt_int_arg();
             break;
         case OPT_READ_BUF:
-            read_buf_len = atoi(opt_arg());
+            read_buf_len = opt_int_arg();
             break;
         case OPT_KEYLOG_FILE:
             keylog_file = opt_arg();
             break;
         case OPT_MAX_EARLY:
-            max_early_data = atoi(opt_arg());
+            max_early_data = opt_int_arg();
             if (max_early_data < 0) {
-                BIO_printf(bio_err, "Invalid value for max_early_data\n");
+                BIO_puts(bio_err, "Invalid value for max_early_data\n");
                 goto end;
             }
             break;
         case OPT_RECV_MAX_EARLY:
-            recv_max_early_data = atoi(opt_arg());
+            recv_max_early_data = opt_int_arg();
             if (recv_max_early_data < 0) {
-                BIO_printf(bio_err, "Invalid value for recv_max_early_data\n");
+                BIO_puts(bio_err, "Invalid value for recv_max_early_data\n");
                 goto end;
             }
             break;
@@ -1780,6 +2367,23 @@ int s_server_main(int argc, char *argv[])
         case OPT_HTTP_SERVER_BINMODE:
             http_server_binmode = 1;
             break;
+#ifndef OPENSSL_NO_ECH
+        case OPT_ECH_PEM:
+            echkeyfile = opt_arg();
+            break;
+        case OPT_ECH_DIR:
+            echkeydir = opt_arg();
+            break;
+        case OPT_ECH_NORETRY:
+            echnoretrydir = opt_arg();
+            break;
+        case OPT_ECH_TRIALDECRYPT:
+            echtrialdecrypt = 1;
+            break;
+        case OPT_ECH_GREASE_RT:
+            echgrease_rc = 1;
+            break;
+#endif
         case OPT_NOCANAMES:
             no_ca_names = 1;
             break;
@@ -1813,9 +2417,20 @@ int s_server_main(int argc, char *argv[])
         case OPT_ENABLE_CLIENT_RPK:
             enable_client_rpk = 1;
             break;
+        case OPT_EXPECTED_RPK:
+            if ((rpk_files == NULL
+                    && (rpk_files = sk_OPENSSL_STRING_new_null()) == NULL)
+                || !sk_OPENSSL_STRING_push(rpk_files, opt_arg()))
+                goto end;
+            enable_client_rpk = 1;
+            break;
         }
     }

+#if !(defined(OPENSSL_NO_NEXTPROTONEG) && defined(OPENSSL_NO_PSK))
+    version1_3 = (socket_type == SOCK_DGRAM) ? DTLS1_3_VERSION : TLS1_3_VERSION;
+#endif
+
     /* No extra arguments. */
     if (!opt_check_rest_arg(NULL))
         goto opthelp;
@@ -1824,47 +2439,47 @@ int s_server_main(int argc, char *argv[])
         goto end;

 #ifndef OPENSSL_NO_NEXTPROTONEG
-    if (min_version == TLS1_3_VERSION && next_proto_neg_in != NULL) {
-        BIO_printf(bio_err, "Cannot supply -nextprotoneg with TLSv1.3\n");
+    if (min_version == version1_3 && next_proto_neg_in != NULL) {
+        BIO_puts(bio_err, "Cannot supply -nextprotoneg with TLSv1.3\n");
         goto opthelp;
     }
 #endif
 #ifndef OPENSSL_NO_DTLS
     if (www && socket_type == SOCK_DGRAM) {
-        BIO_printf(bio_err, "Can't use -HTTP, -www or -WWW with DTLS\n");
+        BIO_puts(bio_err, "Can't use -HTTP, -www or -WWW with DTLS\n");
         goto end;
     }

     if (dtlslisten && socket_type != SOCK_DGRAM) {
-        BIO_printf(bio_err, "Can only use -listen with DTLS\n");
+        BIO_puts(bio_err, "Can only use -listen with DTLS\n");
         goto end;
     }

     if (rev && socket_type == SOCK_DGRAM) {
-        BIO_printf(bio_err, "Can't use -rev with DTLS\n");
+        BIO_puts(bio_err, "Can't use -rev with DTLS\n");
         goto end;
     }
 #endif

     if (tfo && socket_type != SOCK_STREAM) {
-        BIO_printf(bio_err, "Can only use -tfo with TLS\n");
+        BIO_puts(bio_err, "Can only use -tfo with TLS\n");
         goto end;
     }

     if (stateless && socket_type != SOCK_STREAM) {
-        BIO_printf(bio_err, "Can only use --stateless with TLS\n");
+        BIO_puts(bio_err, "Can only use --stateless with TLS\n");
         goto end;
     }

 #ifdef AF_UNIX
     if (socket_family == AF_UNIX && socket_type != SOCK_STREAM) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Can't use unix sockets and datagrams together\n");
         goto end;
     }
 #endif
     if (early_data && rev) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Can't use -early_data in combination with -rev\n");
         goto end;
     }
@@ -1872,7 +2487,7 @@ int s_server_main(int argc, char *argv[])
 #ifndef OPENSSL_NO_SCTP
     if (protocol == IPPROTO_SCTP) {
         if (socket_type != SOCK_DGRAM) {
-            BIO_printf(bio_err, "Can't use -sctp without DTLS\n");
+            BIO_puts(bio_err, "Can't use -sctp without DTLS\n");
             goto end;
         }
         /* SCTP is unusual. It uses DTLS over a SOCK_STREAM protocol */
@@ -1882,23 +2497,23 @@ int s_server_main(int argc, char *argv[])

 #ifndef OPENSSL_NO_KTLS
     if (use_zc_sendfile && !use_sendfile) {
-        BIO_printf(bio_out, "Warning: -zerocopy_sendfile depends on -sendfile, enabling -sendfile now.\n");
+        BIO_puts(bio_err, "Warning: -zerocopy_sendfile depends on -sendfile, enabling -sendfile now.\n");
         use_sendfile = 1;
     }

     if (use_sendfile && enable_ktls == 0) {
-        BIO_printf(bio_out, "Warning: -sendfile depends on -ktls, enabling -ktls now.\n");
+        BIO_puts(bio_err, "Warning: -sendfile depends on -ktls, enabling -ktls now.\n");
         enable_ktls = 1;
     }

     if (use_sendfile && www <= 1) {
-        BIO_printf(bio_err, "Can't use -sendfile without -WWW or -HTTP\n");
+        BIO_puts(bio_err, "Can't use -sendfile without -WWW or -HTTP\n");
         goto end;
     }
 #endif

     if (!app_passwd(passarg, dpassarg, &pass, &dpass)) {
-        BIO_printf(bio_err, "Error getting password\n");
+        BIO_puts(bio_err, "Error getting password\n");
         goto end;
     }

@@ -1912,7 +2527,7 @@ int s_server_main(int argc, char *argv[])
         goto end;

     if (nocert == 0) {
-        s_key = load_key(s_key_file, s_key_format, 0, pass, engine,
+        s_key = load_key(s_key_file, s_key_format, 0, pass,
             "server certificate private key");
         if (s_key == NULL)
             goto end;
@@ -1929,7 +2544,7 @@ int s_server_main(int argc, char *argv[])
         }

         if (tlsextcbp.servername != NULL) {
-            s_key2 = load_key(s_key_file2, s_key_format, 0, pass, engine,
+            s_key2 = load_key(s_key_file2, s_key_format, 0, pass,
                 "second server certificate private key");
             if (s_key2 == NULL)
                 goto end;
@@ -1939,6 +2554,9 @@ int s_server_main(int argc, char *argv[])

             if (s_cert2 == NULL)
                 goto end;
+#ifndef OPENSSL_NO_ECH
+            tlsextcbp.scert = s_cert2;
+#endif
         }
     }
 #if !defined(OPENSSL_NO_NEXTPROTONEG)
@@ -1975,7 +2593,7 @@ int s_server_main(int argc, char *argv[])
             s_dkey_file = s_dcert_file;

         s_dkey = load_key(s_dkey_file, s_dkey_format,
-            0, dpass, engine, "second certificate private key");
+            0, dpass, "second certificate private key");
         if (s_dkey == NULL)
             goto end;

@@ -1999,7 +2617,7 @@ int s_server_main(int argc, char *argv[])
             if (s_msg && bio_s_msg == NULL) {
                 bio_s_msg = dup_bio_out(FORMAT_TEXT);
                 if (bio_s_msg == NULL) {
-                    BIO_printf(bio_err, "Out of memory\n");
+                    BIO_puts(bio_err, "Out of memory\n");
                     goto end;
                 }
             }
@@ -2056,10 +2674,10 @@ int s_server_main(int argc, char *argv[])

     if (session_id_prefix) {
         if (strlen(session_id_prefix) >= 32)
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "warning: id_prefix is too long, only one new session will be possible\n");
         if (!SSL_CTX_set_generate_session_id(ctx, generate_session_id)) {
-            BIO_printf(bio_err, "error setting 'id_prefix'\n");
+            BIO_puts(bio_err, "error setting 'id_prefix'\n");
             ERR_print_errors(bio_err);
             goto end;
         }
@@ -2121,7 +2739,7 @@ int s_server_main(int argc, char *argv[])
     if (srtp_profiles != NULL) {
         /* Returns 0 on success! */
         if (SSL_CTX_set_tlsext_use_srtp(ctx, srtp_profiles) != 0) {
-            BIO_printf(bio_err, "Error setting SRTP profile\n");
+            BIO_puts(bio_err, "Error setting SRTP profile\n");
             ERR_print_errors(bio_err);
             goto end;
         }
@@ -2134,7 +2752,7 @@ int s_server_main(int argc, char *argv[])
         goto end;
     }
     if (vpmtouched && !SSL_CTX_set1_param(ctx, vpm)) {
-        BIO_printf(bio_err, "Error setting verify params\n");
+        BIO_puts(bio_err, "Error setting verify params\n");
         ERR_print_errors(bio_err);
         goto end;
     }
@@ -2145,31 +2763,90 @@ int s_server_main(int argc, char *argv[])
             vfyCApath, vfyCAfile, vfyCAstore,
             chCApath, chCAfile, chCAstore,
             crls, crl_download)) {
-        BIO_printf(bio_err, "Error loading store locations\n");
+        BIO_puts(bio_err, "Error loading store locations\n");
         ERR_print_errors(bio_err);
         goto end;
     }

+#ifndef OPENSSL_NO_ECH
+    if (echtrialdecrypt != 0)
+        SSL_CTX_set_options(ctx, SSL_OP_ECH_TRIALDECRYPT);
+    if (echgrease_rc != 0)
+        SSL_CTX_set_options(ctx, SSL_OP_ECH_GREASE_RETRY_CONFIG);
+    if (echkeyfile != NULL) {
+        OSSL_ECHSTORE *es = NULL;
+        BIO *in = NULL;
+
+        if ((in = BIO_new_file(echkeyfile, "r")) == NULL
+            || (es = OSSL_ECHSTORE_new(app_get0_libctx(),
+                    app_get0_propq()))
+                == NULL
+            || OSSL_ECHSTORE_read_pem(es, in, OSSL_ECH_FOR_RETRY) != 1
+            || SSL_CTX_set1_echstore(ctx, es) != 1) {
+            BIO_printf(bio_err, "Failed reading: %s\n", echkeyfile);
+            OSSL_ECHSTORE_free(es);
+            BIO_free_all(in);
+            goto end;
+        }
+        OSSL_ECHSTORE_free(es);
+        BIO_free_all(in);
+        if (bio_s_out != NULL)
+            BIO_printf(bio_s_out, "Added ECH key pair from: %s\n", echkeyfile);
+        ech_files_loaded++;
+    }
+    if (echkeydir != NULL) {
+        int nloaded = 0;
+
+        if (ech_load_dir(ctx, echkeydir, OSSL_ECH_FOR_RETRY, &nloaded) != 1) {
+            BIO_printf(bio_err, "error loading from %s\n", echkeydir);
+            goto end;
+        }
+        ech_files_loaded += nloaded;
+    }
+    if (echnoretrydir != NULL) {
+        int nloaded = 0;
+
+        if (ech_load_dir(ctx, echnoretrydir, OSSL_ECH_NO_RETRY,
+                &nloaded)
+            != 1) {
+            BIO_printf(bio_err, "error loading from %s\n", echnoretrydir);
+            goto end;
+        }
+        ech_files_loaded += nloaded;
+    }
+    if ((echkeyfile != NULL || echkeydir != NULL || echnoretrydir != NULL)
+        && bio_s_out != NULL) {
+        BIO_printf(bio_s_out, "Loaded %d ECH key pairs in total\n",
+            ech_files_loaded);
+    }
+#endif
+
     if (s_cert2) {
         ctx2 = SSL_CTX_new_ex(app_get0_libctx(), app_get0_propq(), meth);
         if (ctx2 == NULL) {
             ERR_print_errors(bio_err);
             goto end;
         }
+#ifndef OPENSSL_NO_ECH
+        if (echtrialdecrypt != 0)
+            SSL_CTX_set_options(ctx2, SSL_OP_ECH_TRIALDECRYPT);
+        if (echgrease_rc != 0)
+            SSL_CTX_set_options(ctx, SSL_OP_ECH_GREASE_RETRY_CONFIG);
+#endif
     }

     if (ctx2 != NULL) {
-        BIO_printf(bio_s_out, "Setting secondary ctx parameters\n");
+        BIO_puts(bio_s_out, "Setting secondary ctx parameters\n");

         if (sdebug)
             ssl_ctx_security_debug(ctx2, sdebug);

         if (session_id_prefix) {
             if (strlen(session_id_prefix) >= 32)
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "warning: id_prefix is too long, only one new session will be possible\n");
             if (!SSL_CTX_set_generate_session_id(ctx2, generate_session_id)) {
-                BIO_printf(bio_err, "error setting 'id_prefix'\n");
+                BIO_puts(bio_err, "error setting 'id_prefix'\n");
                 ERR_print_errors(bio_err);
                 goto end;
             }
@@ -2197,7 +2874,7 @@ int s_server_main(int argc, char *argv[])
             goto end;
         }
         if (vpmtouched && !SSL_CTX_set1_param(ctx2, vpm)) {
-            BIO_printf(bio_err, "Error setting verify params\n");
+            BIO_puts(bio_err, "Error setting verify params\n");
             ERR_print_errors(bio_err);
             goto end;
         }
@@ -2214,6 +2891,13 @@ int s_server_main(int argc, char *argv[])
     if (alpn_ctx.data)
         SSL_CTX_set_alpn_select_cb(ctx, alpn_cb, &alpn_ctx);

+    /*
+     * If we have a 2nd context to which we might switch, then set
+     * the same alpn callback for that too.
+     */
+    if (s_cert2 != NULL && alpn_ctx.data != NULL)
+        SSL_CTX_set_alpn_select_cb(ctx2, alpn_cb, &alpn_ctx);
+
     if (!no_dhe) {
         EVP_PKEY *dhpkey = NULL;

@@ -2224,9 +2908,9 @@ int s_server_main(int argc, char *argv[])
                 "DH parameters", 1);

         if (dhpkey != NULL) {
-            BIO_printf(bio_s_out, "Setting temp DH parameters\n");
+            BIO_puts(bio_s_out, "Setting temp DH parameters\n");
         } else {
-            BIO_printf(bio_s_out, "Using default temp DH parameters\n");
+            BIO_puts(bio_s_out, "Using default temp DH parameters\n");
         }
         (void)BIO_flush(bio_s_out);

@@ -2259,7 +2943,7 @@ int s_server_main(int argc, char *argv[])
                     "DH parameters", 1);

                 if (dhpkey2 != NULL) {
-                    BIO_printf(bio_s_out, "Setting temp DH parameters\n");
+                    BIO_puts(bio_s_out, "Setting temp DH parameters\n");
                     (void)BIO_flush(bio_s_out);

                     EVP_PKEY_free(dhpkey);
@@ -2288,9 +2972,21 @@ int s_server_main(int argc, char *argv[])
         goto end;
     }

+#ifndef OPENSSL_NO_ECH
+    /*
+     * Giving the same chain to the 2nd key pair works for our tests.
+     * It would be better to supply s_chain_file2 as a new CLA in case
+     * the paths are very different but as that's not needed for tests,
+     * I didn't do it.
+     */
+    if (ctx2 != NULL
+        && !set_cert_key_stuff(ctx2, s_cert2, s_key2, s_chain, build_chain))
+        goto end;
+#else
     if (ctx2 != NULL
         && !set_cert_key_stuff(ctx2, s_cert2, s_key2, NULL, build_chain))
         goto end;
+#endif

     if (s_dcert != NULL) {
         if (!set_cert_key_stuff(ctx, s_dcert, s_dkey, s_dchain, build_chain))
@@ -2308,16 +3004,16 @@ int s_server_main(int argc, char *argv[])
 #ifndef OPENSSL_NO_PSK
     if (psk_key != NULL) {
         if (s_debug)
-            BIO_printf(bio_s_out, "PSK key given, setting server callback\n");
+            BIO_puts(bio_s_out, "PSK key given, setting server callback\n");
         SSL_CTX_set_psk_server_callback(ctx, psk_server_cb);
     }

     if (psk_identity_hint != NULL) {
-        if (min_version == TLS1_3_VERSION) {
-            BIO_printf(bio_s_out, "PSK warning: there is NO identity hint in TLSv1.3\n");
+        if (min_version == version1_3) {
+            BIO_puts(bio_s_out, "PSK warning: there is NO identity hint in TLSv1.3\n");
         } else {
             if (!SSL_CTX_use_psk_identity_hint(ctx, psk_identity_hint)) {
-                BIO_printf(bio_err, "error setting PSK identity hint to context\n");
+                BIO_puts(bio_err, "error setting PSK identity hint to context\n");
                 ERR_print_errors(bio_err);
                 goto end;
             }
@@ -2348,7 +3044,7 @@ int s_server_main(int argc, char *argv[])
     if (!SSL_CTX_set_session_id_context(ctx,
             (void *)&s_server_session_id_context,
             sizeof(s_server_session_id_context))) {
-        BIO_printf(bio_err, "error setting session id context\n");
+        BIO_puts(bio_err, "error setting session id context\n");
         ERR_print_errors(bio_err);
         goto end;
     }
@@ -2366,15 +3062,28 @@ int s_server_main(int argc, char *argv[])
         if (!SSL_CTX_set_session_id_context(ctx2,
                 (void *)&s_server_session_id_context,
                 sizeof(s_server_session_id_context))) {
-            BIO_printf(bio_err, "error setting session id context\n");
+            BIO_puts(bio_err, "error setting session id context\n");
             ERR_print_errors(bio_err);
             goto end;
         }
+        SSL_CTX_set_cookie_generate_cb(ctx2, generate_cookie_callback);
+        SSL_CTX_set_cookie_verify_cb(ctx2, verify_cookie_callback);
+        SSL_CTX_set_stateless_cookie_generate_cb(ctx2, generate_stateless_cookie_callback);
+        SSL_CTX_set_stateless_cookie_verify_cb(ctx2, verify_stateless_cookie_callback);
         tlsextcbp.biodebug = bio_s_out;
+#ifndef OPENSSL_NO_ECH
+        SSL_CTX_set_tlsext_servername_callback(ctx2, ssl_ech_servername_cb);
+        SSL_CTX_set_tlsext_servername_arg(ctx2, &tlsextcbp);
+        SSL_CTX_set_tlsext_servername_callback(ctx, ssl_ech_servername_cb);
+        SSL_CTX_set_tlsext_servername_arg(ctx, &tlsextcbp);
+        SSL_CTX_ech_set_callback(ctx2, ech_print_cb);
+        SSL_CTX_ech_set_callback(ctx, ech_print_cb);
+#else
         SSL_CTX_set_tlsext_servername_callback(ctx2, ssl_servername_cb);
         SSL_CTX_set_tlsext_servername_arg(ctx2, &tlsextcbp);
         SSL_CTX_set_tlsext_servername_callback(ctx, ssl_servername_cb);
         SSL_CTX_set_tlsext_servername_arg(ctx, &tlsextcbp);
+#endif
     }

 #ifndef OPENSSL_NO_SRP
@@ -2402,6 +3111,11 @@ int s_server_main(int argc, char *argv[])
 #endif
     if (set_keylog_file(ctx, keylog_file))
         goto end;
+#ifndef OPENSSL_NO_ECH
+    /* not really an ECH issue but needed */
+    if (ctx2 != NULL && set_keylog_file(ctx2, keylog_file))
+        goto end;
+#endif

     if (max_early_data >= 0)
         SSL_CTX_set_max_early_data(ctx, max_early_data);
@@ -2409,22 +3123,26 @@ int s_server_main(int argc, char *argv[])
         SSL_CTX_set_recv_max_early_data(ctx, recv_max_early_data);

     if (cert_comp) {
-        BIO_printf(bio_s_out, "Compressing certificates\n");
+        BIO_puts(bio_s_out, "Compressing certificates\n");
         if (!SSL_CTX_compress_certs(ctx, 0))
-            BIO_printf(bio_s_out, "Error compressing certs on ctx\n");
+            BIO_puts(bio_s_out, "Error compressing certs on ctx\n");
         if (ctx2 != NULL && !SSL_CTX_compress_certs(ctx2, 0))
-            BIO_printf(bio_s_out, "Error compressing certs on ctx2\n");
+            BIO_puts(bio_s_out, "Error compressing certs on ctx2\n");
+    }
+    if (enable_server_rpk
+        && !SSL_CTX_set1_server_cert_type(ctx, cert_type_rpk, sizeof(cert_type_rpk))) {
+        BIO_puts(bio_err, "Error setting server certificate types\n");
+        goto end;
+    }
+    if (enable_client_rpk
+        && !SSL_CTX_set1_client_cert_type(ctx, cert_type_rpk, sizeof(cert_type_rpk))) {
+        BIO_puts(bio_err, "Error setting client certificate types\n");
+        goto end;
+    }
+    if (rpk_files != NULL && SSL_CTX_dane_enable(ctx) <= 0) {
+        BIO_puts(bio_err, "Error enabling RPK verification\n");
+        goto end;
     }
-    if (enable_server_rpk)
-        if (!SSL_CTX_set1_server_cert_type(ctx, cert_type_rpk, sizeof(cert_type_rpk))) {
-            BIO_printf(bio_s_out, "Error setting server certificate types\n");
-            goto end;
-        }
-    if (enable_client_rpk)
-        if (!SSL_CTX_set1_client_cert_type(ctx, cert_type_rpk, sizeof(cert_type_rpk))) {
-            BIO_printf(bio_s_out, "Error setting server certificate types\n");
-            goto end;
-        }

     if (rev)
         server_cb = rev_body;
@@ -2438,13 +3156,16 @@ int s_server_main(int argc, char *argv[])
         unlink(host);
 #endif
     if (tfo)
-        BIO_printf(bio_s_out, "Listening for TFO\n");
+        BIO_puts(bio_s_out, "Listening for TFO\n");
     do_server(&accept_socket, host, port, socket_family, socket_type, protocol,
         server_cb, context, naccept, bio_s_out, tfo);
     print_stats(bio_s_out, ctx);
     ret = 0;
 end:
     SSL_CTX_free(ctx);
+#ifndef OPENSSL_NO_SRP
+    cleanup_srp(&srp_callback_parm);
+#endif
     SSL_SESSION_free(psksess);
     set_keylog_file(NULL, NULL);
     X509_free(s_cert);
@@ -2460,6 +3181,7 @@ end:
     OPENSSL_free(port);
     X509_VERIFY_PARAM_free(vpm);
     free_sessions();
+    sk_OPENSSL_STRING_free(tlscstatp.sk_resp_in);
     OPENSSL_free(tlscstatp.host);
     OPENSSL_free(tlscstatp.port);
     OPENSSL_free(tlscstatp.path);
@@ -2472,8 +3194,8 @@ end:
     OPENSSL_free(alpn_ctx.data);
     ssl_excert_free(exc);
     sk_OPENSSL_STRING_free(ssl_args);
+    sk_OPENSSL_STRING_free(rpk_files);
     SSL_CONF_CTX_free(cctx);
-    release_engine(engine);
     BIO_free(bio_s_out);
     bio_s_out = NULL;
     BIO_free(bio_s_msg);
@@ -2486,28 +3208,29 @@ end:

 static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
 {
-    BIO_printf(bio, "%4ld items in the session cache\n",
-        SSL_CTX_sess_number(ssl_ctx));
-    BIO_printf(bio, "%4ld client connects (SSL_connect())\n",
-        SSL_CTX_sess_connect(ssl_ctx));
-    BIO_printf(bio, "%4ld client renegotiates (SSL_connect())\n",
-        SSL_CTX_sess_connect_renegotiate(ssl_ctx));
-    BIO_printf(bio, "%4ld client connects that finished\n",
-        SSL_CTX_sess_connect_good(ssl_ctx));
-    BIO_printf(bio, "%4ld server accepts (SSL_accept())\n",
-        SSL_CTX_sess_accept(ssl_ctx));
-    BIO_printf(bio, "%4ld server renegotiates (SSL_accept())\n",
-        SSL_CTX_sess_accept_renegotiate(ssl_ctx));
-    BIO_printf(bio, "%4ld server accepts that finished\n",
-        SSL_CTX_sess_accept_good(ssl_ctx));
-    BIO_printf(bio, "%4ld session cache hits\n", SSL_CTX_sess_hits(ssl_ctx));
-    BIO_printf(bio, "%4ld session cache misses\n",
-        SSL_CTX_sess_misses(ssl_ctx));
-    BIO_printf(bio, "%4ld session cache timeouts\n",
-        SSL_CTX_sess_timeouts(ssl_ctx));
-    BIO_printf(bio, "%4ld callback cache hits\n",
-        SSL_CTX_sess_cb_hits(ssl_ctx));
-    BIO_printf(bio, "%4ld cache full overflows (%ld allowed)\n",
+    BIO_printf(bio, "%4ld items in the session cache\n"
+                    "%4ld client connects (SSL_connect())\n"
+                    "%4ld client renegotiates (SSL_connect())\n"
+                    "%4ld client connects that finished\n"
+                    "%4ld server accepts (SSL_accept())\n"
+                    "%4ld server renegotiates (SSL_accept())\n"
+                    "%4ld server accepts that finished\n"
+                    "%4ld session cache hits\n"
+                    "%4ld session cache misses\n"
+                    "%4ld session cache timeouts\n"
+                    "%4ld callback cache hits\n"
+                    "%4ld cache full overflows (%ld allowed)\n",
+        SSL_CTX_sess_number(ssl_ctx),
+        SSL_CTX_sess_connect(ssl_ctx),
+        SSL_CTX_sess_connect_renegotiate(ssl_ctx),
+        SSL_CTX_sess_connect_good(ssl_ctx),
+        SSL_CTX_sess_accept(ssl_ctx),
+        SSL_CTX_sess_accept_renegotiate(ssl_ctx),
+        SSL_CTX_sess_accept_good(ssl_ctx),
+        SSL_CTX_sess_hits(ssl_ctx),
+        SSL_CTX_sess_misses(ssl_ctx),
+        SSL_CTX_sess_timeouts(ssl_ctx),
+        SSL_CTX_sess_cb_hits(ssl_ctx),
         SSL_CTX_sess_cache_full(ssl_ctx),
         SSL_CTX_sess_get_cache_size(ssl_ctx));
 }
@@ -2536,6 +3259,19 @@ static long int count_reads_callback(BIO *bio, int cmd, const char *argp, size_t
     return ret;
 }

+static int rpk_enable(SSL *con)
+{
+    if (!SSL_dane_enable(con, NULL))
+        return 0;
+    for (int i = 0; i < sk_OPENSSL_STRING_num(rpk_files); ++i) {
+        const char *file = sk_OPENSSL_STRING_value(rpk_files, i);
+
+        if (!load_rpk_file(con, file))
+            return 0;
+    }
+    return 1;
+}
+
 static int sv_body(int s, int stype, int prot, unsigned char *context)
 {
     char *buf = NULL;
@@ -2562,7 +3298,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
         if (!BIO_socket_nbio(s, 1))
             ERR_print_errors(bio_err);
         else if (!s_quiet)
-            BIO_printf(bio_err, "Turned on non blocking io\n");
+            BIO_puts(bio_err, "Turned on non blocking io\n");
     }

     con = SSL_new(ctx);
@@ -2578,17 +3314,24 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)

     if (context != NULL
         && !SSL_set_session_id_context(con, context,
-            strlen((char *)context))) {
-        BIO_printf(bio_err, "Error setting session id context\n");
+            (unsigned int)strlen((char *)context))) {
+        BIO_puts(bio_err, "Error setting session id context\n");
         ret = -1;
         goto err;
     }

     if (!SSL_clear(con)) {
-        BIO_printf(bio_err, "Error clearing SSL connection\n");
+        BIO_puts(bio_err, "Error clearing SSL connection\n");
+        ret = -1;
+        goto err;
+    }
+
+    if (rpk_files != NULL && !rpk_enable(con)) {
+        BIO_puts(bio_err, "Error enabling client RPK verification\n");
         ret = -1;
         goto err;
     }
+
 #ifndef OPENSSL_NO_DTLS
     if (isdtls) {
 #ifndef OPENSSL_NO_SCTP
@@ -2598,7 +3341,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
 #endif
             sbio = BIO_new_dgram(s, BIO_NOCLOSE);
         if (sbio == NULL) {
-            BIO_printf(bio_err, "Unable to create BIO\n");
+            BIO_puts(bio_err, "Unable to create BIO\n");
             ERR_print_errors(bio_err);
             goto err;
         }
@@ -2623,7 +3366,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
             }
             SSL_set_options(con, SSL_OP_NO_QUERY_MTU);
             if (!DTLS_set_link_mtu(con, socket_mtu)) {
-                BIO_printf(bio_err, "Failed to set MTU\n");
+                BIO_puts(bio_err, "Failed to set MTU\n");
                 ret = -1;
                 BIO_free(sbio);
                 goto err;
@@ -2642,7 +3385,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
         sbio = BIO_new_socket(s, BIO_NOCLOSE);

     if (sbio == NULL) {
-        BIO_printf(bio_err, "Unable to create BIO\n");
+        BIO_puts(bio_err, "Unable to create BIO\n");
         ERR_print_errors(bio_err);
         goto err;
     }
@@ -2652,7 +3395,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)

         test = BIO_new(BIO_f_nbio_test());
         if (test == NULL) {
-            BIO_printf(bio_err, "Unable to create BIO\n");
+            BIO_puts(bio_err, "Unable to create BIO\n");
             ret = -1;
             BIO_free(sbio);
             goto err;
@@ -2697,14 +3440,14 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
                     /* Just keep trying - busy waiting */
                     continue;
                 default:
-                    BIO_printf(bio_err, "Error reading early data\n");
+                    BIO_puts(bio_err, "Error reading early data\n");
                     ERR_print_errors(bio_err);
                     goto err;
                 }
             }
             if (readbytes > 0) {
                 if (write_header) {
-                    BIO_printf(bio_s_out, "Early data received:\n");
+                    BIO_puts(bio_s_out, "Early data received:\n");
                     write_header = 0;
                 }
                 raw_write_stdout(buf, (unsigned int)readbytes);
@@ -2713,11 +3456,11 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
         }
         if (write_header) {
             if (SSL_get_early_data_status(con) == SSL_EARLY_DATA_NOT_SENT)
-                BIO_printf(bio_s_out, "No early data received\n");
+                BIO_puts(bio_s_out, "No early data received\n");
             else
-                BIO_printf(bio_s_out, "Early data was rejected\n");
+                BIO_puts(bio_s_out, "Early data was rejected\n");
         } else {
-            BIO_printf(bio_s_out, "\nEnd of early data\n");
+            BIO_puts(bio_s_out, "\nEnd of early data\n");
         }
         if (SSL_is_init_finished(con))
             print_connection_info(con);
@@ -2772,7 +3515,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
             i = select(width, (void *)&readfds, NULL, NULL, timeoutp);

             if ((SSL_is_dtls(con)) && DTLSv1_handle_timeout(con) > 0)
-                BIO_printf(bio_err, "TIMEOUT occurred\n");
+                BIO_puts(bio_err, "TIMEOUT occurred\n");

             if (i <= 0)
                 continue;
@@ -2807,7 +3550,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)

             if (!s_quiet && !s_brief) {
                 if ((i <= 0) || (buf[0] == 'Q')) {
-                    BIO_printf(bio_s_out, "DONE\n");
+                    BIO_puts(bio_s_out, "DONE\n");
                     (void)BIO_flush(bio_s_out);
                     BIO_closesocket(s);
                     close_accept_socket();
@@ -2815,7 +3558,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
                     goto err;
                 }
                 if ((i <= 0) || (buf[0] == 'q')) {
-                    BIO_printf(bio_s_out, "DONE\n");
+                    BIO_puts(bio_s_out, "DONE\n");
                     (void)BIO_flush(bio_s_out);
                     if (SSL_version(con) != DTLS1_VERSION)
                         BIO_closesocket(s);
@@ -2872,17 +3615,10 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
             l = k = 0;
             for (;;) {
                 /* should do a select for the write */
-#ifdef RENEG
-                static count = 0;
-                if (++count == 100) {
-                    count = 0;
-                    SSL_renegotiate(con);
-                }
-#endif
                 k = SSL_write(con, &(buf[l]), (unsigned int)i);
 #ifndef OPENSSL_NO_SRP
                 while (SSL_get_error(con, k) == SSL_ERROR_WANT_X509_LOOKUP) {
-                    BIO_printf(bio_s_out, "LOOKUP renego during write\n");
+                    BIO_puts(bio_s_out, "LOOKUP renego during write\n");

                     lookup_srp_user(&srp_callback_parm, bio_s_out);

@@ -2893,14 +3629,14 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
                 case SSL_ERROR_NONE:
                     break;
                 case SSL_ERROR_WANT_ASYNC:
-                    BIO_printf(bio_s_out, "Write BLOCK (Async)\n");
+                    BIO_puts(bio_s_out, "Write BLOCK (Async)\n");
                     (void)BIO_flush(bio_s_out);
                     wait_for_async(con);
                     break;
                 case SSL_ERROR_WANT_WRITE:
                 case SSL_ERROR_WANT_READ:
                 case SSL_ERROR_WANT_X509_LOOKUP:
-                    BIO_printf(bio_s_out, "Write BLOCK\n");
+                    BIO_puts(bio_s_out, "Write BLOCK\n");
                     (void)BIO_flush(bio_s_out);
                     break;
                 case SSL_ERROR_WANT_ASYNC_JOB:
@@ -2909,14 +3645,14 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
                      */
                 case SSL_ERROR_SYSCALL:
                 case SSL_ERROR_SSL:
-                    BIO_printf(bio_s_out, "ERROR\n");
+                    BIO_puts(bio_s_out, "ERROR\n");
                     (void)BIO_flush(bio_s_out);
                     ERR_print_errors(bio_err);
                     ret = 1;
                     goto err;
                     /* break; */
                 case SSL_ERROR_ZERO_RETURN:
-                    BIO_printf(bio_s_out, "DONE\n");
+                    BIO_puts(bio_s_out, "DONE\n");
                     (void)BIO_flush(bio_s_out);
                     ret = 1;
                     goto err;
@@ -2968,7 +3704,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
                 i = SSL_read(con, (char *)buf, bufsize);
 #ifndef OPENSSL_NO_SRP
                 while (SSL_get_error(con, i) == SSL_ERROR_WANT_X509_LOOKUP) {
-                    BIO_printf(bio_s_out, "LOOKUP renego during read\n");
+                    BIO_puts(bio_s_out, "LOOKUP renego during read\n");

                     lookup_srp_user(&srp_callback_parm, bio_s_out);

@@ -2986,13 +3722,13 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
                         goto again;
                     break;
                 case SSL_ERROR_WANT_ASYNC:
-                    BIO_printf(bio_s_out, "Read BLOCK (Async)\n");
+                    BIO_puts(bio_s_out, "Read BLOCK (Async)\n");
                     (void)BIO_flush(bio_s_out);
                     wait_for_async(con);
                     break;
                 case SSL_ERROR_WANT_WRITE:
                 case SSL_ERROR_WANT_READ:
-                    BIO_printf(bio_s_out, "Read BLOCK\n");
+                    BIO_puts(bio_s_out, "Read BLOCK\n");
                     (void)BIO_flush(bio_s_out);
                     break;
                 case SSL_ERROR_WANT_ASYNC_JOB:
@@ -3001,13 +3737,13 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
                      */
                 case SSL_ERROR_SYSCALL:
                 case SSL_ERROR_SSL:
-                    BIO_printf(bio_s_out, "ERROR\n");
+                    BIO_puts(bio_s_out, "ERROR\n");
                     (void)BIO_flush(bio_s_out);
                     ERR_print_errors(bio_err);
                     ret = 1;
                     goto err;
                 case SSL_ERROR_ZERO_RETURN:
-                    BIO_printf(bio_s_out, "DONE\n");
+                    BIO_puts(bio_s_out, "DONE\n");
                     (void)BIO_flush(bio_s_out);
                     ret = 1;
                     goto err;
@@ -3017,18 +3753,18 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
     }
 err:
     if (con != NULL) {
-        BIO_printf(bio_s_out, "shutting down SSL\n");
+        BIO_puts(bio_s_out, "shutting down SSL\n");
         do_ssl_shutdown(con);
         SSL_free(con);
     }
-    BIO_printf(bio_s_out, "CONNECTION CLOSED\n");
+    BIO_puts(bio_s_out, "CONNECTION CLOSED\n");
     OPENSSL_clear_free(buf, bufsize);
     return ret;
 }

 static void close_accept_socket(void)
 {
-    BIO_printf(bio_err, "shutdown accept socket\n");
+    BIO_puts(bio_err, "shutdown accept socket\n");
     if (accept_socket >= 0) {
         BIO_closesocket(accept_socket);
     }
@@ -3055,7 +3791,7 @@ static int init_ssl_connection(SSL *con)

         if (dtlslisten) {
             if ((client = BIO_ADDR_new()) == NULL) {
-                BIO_printf(bio_err, "ERROR - memory\n");
+                BIO_puts(bio_err, "ERROR - memory\n");
                 return 0;
             }
             i = DTLSv1_listen(con, client);
@@ -3073,7 +3809,7 @@ static int init_ssl_connection(SSL *con)
                 }

                 if (!wbio || BIO_connect(fd, client, 0) == 0) {
-                    BIO_printf(bio_err, "ERROR - unable to connect\n");
+                    BIO_puts(bio_err, "ERROR - unable to connect\n");
                     BIO_ADDR_free(client);
                     return 0;
                 }
@@ -3099,7 +3835,7 @@ static int init_ssl_connection(SSL *con)
                 while (i <= 0
                     && SSL_get_error(con, i) == SSL_ERROR_WANT_X509_LOOKUP
                     && SSL_get_state(con) == TLS_ST_SR_CLNT_HELLO) {
-                    BIO_printf(bio_err,
+                    BIO_puts(bio_err,
                         "LOOKUP from certificate callback during accept\n");
                     i = SSL_accept(con);
                     if (i <= 0)
@@ -3127,11 +3863,11 @@ static int init_ssl_connection(SSL *con)
     if (i <= 0) {
         if (((dtlslisten || stateless) && i == 0)
             || (!dtlslisten && !stateless && retry)) {
-            BIO_printf(bio_s_out, "DELAY\n");
+            BIO_puts(bio_s_out, "DELAY\n");
             return 1;
         }

-        BIO_printf(bio_err, "ERROR\n");
+        BIO_puts(bio_err, "ERROR\n");

         verify_err = SSL_get_verify_result(con);
         if (verify_err != X509_V_OK) {
@@ -3166,21 +3902,21 @@ static void print_connection_info(SSL *con)

     peer = SSL_get0_peer_certificate(con);
     if (peer != NULL) {
-        BIO_printf(bio_s_out, "Client certificate\n");
+        BIO_puts(bio_s_out, "Client certificate\n");
         PEM_write_bio_X509(bio_s_out, peer);
         dump_cert_text(bio_s_out, peer);
         peer = NULL;
     }
     /* Only display RPK information if configured */
     if (SSL_get_negotiated_server_cert_type(con) == TLSEXT_cert_type_rpk)
-        BIO_printf(bio_s_out, "Server-to-client raw public key negotiated\n");
+        BIO_puts(bio_s_out, "Server-to-client raw public key negotiated\n");
     if (SSL_get_negotiated_client_cert_type(con) == TLSEXT_cert_type_rpk)
-        BIO_printf(bio_s_out, "Client-to-server raw public key negotiated\n");
+        BIO_puts(bio_s_out, "Client-to-server raw public key negotiated\n");
     if (enable_client_rpk) {
         EVP_PKEY *client_rpk = SSL_get0_peer_rpk(con);

         if (client_rpk != NULL) {
-            BIO_printf(bio_s_out, "Client raw public key\n");
+            BIO_puts(bio_s_out, "Client raw public key\n");
             EVP_PKEY_print_public(bio_s_out, client_rpk, 2, NULL);
         }
     }
@@ -3199,9 +3935,9 @@ static void print_connection_info(SSL *con)
 #if !defined(OPENSSL_NO_NEXTPROTONEG)
     SSL_get0_next_proto_negotiated(con, &next_proto_neg, &next_proto_neg_len);
     if (next_proto_neg) {
-        BIO_printf(bio_s_out, "NEXTPROTO is ");
+        BIO_puts(bio_s_out, "NEXTPROTO is ");
         BIO_write(bio_s_out, next_proto_neg, next_proto_neg_len);
-        BIO_printf(bio_s_out, "\n");
+        BIO_puts(bio_s_out, "\n");
     }
 #endif
 #ifndef OPENSSL_NO_SRTP
@@ -3215,17 +3951,19 @@ static void print_connection_info(SSL *con)
     }
 #endif
     if (SSL_session_reused(con))
-        BIO_printf(bio_s_out, "Reused session-id\n");
+        BIO_puts(bio_s_out, "Reused session-id\n");

     ssl_print_secure_renegotiation_notes(bio_s_out, con);

     if ((SSL_get_options(con) & SSL_OP_NO_RENEGOTIATION))
-        BIO_printf(bio_s_out, "Renegotiation is DISABLED\n");
-
-    if (keymatexportlabel != NULL) {
-        BIO_printf(bio_s_out, "Keying material exporter:\n");
-        BIO_printf(bio_s_out, "    Label: '%s'\n", keymatexportlabel);
-        BIO_printf(bio_s_out, "    Length: %i bytes\n", keymatexportlen);
+        BIO_puts(bio_s_out, "Renegotiation is DISABLED\n");
+
+    if (keymatexportlabel != NULL && keymatexportlen > 0) {
+        BIO_printf(bio_s_out, "Keying material exporter:\n"
+                              "    Label: '%s'\n"
+                              "    Length: %i bytes\n",
+            keymatexportlabel,
+            keymatexportlen);
         exportedkeymat = app_malloc(keymatexportlen, "export key");
         if (SSL_export_keying_material(con, exportedkeymat,
                 keymatexportlen,
@@ -3233,20 +3971,20 @@ static void print_connection_info(SSL *con)
                 strlen(keymatexportlabel),
                 NULL, 0, 0)
             <= 0) {
-            BIO_printf(bio_s_out, "    Error\n");
+            BIO_puts(bio_s_out, "    Error\n");
         } else {
-            BIO_printf(bio_s_out, "    Keying material: ");
+            BIO_puts(bio_s_out, "    Keying material: ");
             for (i = 0; i < keymatexportlen; i++)
                 BIO_printf(bio_s_out, "%02X", exportedkeymat[i]);
-            BIO_printf(bio_s_out, "\n");
+            BIO_puts(bio_s_out, "\n");
         }
         OPENSSL_free(exportedkeymat);
     }
 #ifndef OPENSSL_NO_KTLS
     if (BIO_get_ktls_send(SSL_get_wbio(con)))
-        BIO_printf(bio_err, "Using Kernel TLS for sending\n");
+        BIO_puts(bio_err, "Using Kernel TLS for sending\n");
     if (BIO_get_ktls_recv(SSL_get_rbio(con)))
-        BIO_printf(bio_err, "Using Kernel TLS for receiving\n");
+        BIO_puts(bio_err, "Using Kernel TLS for receiving\n");
 #endif

     (void)BIO_flush(bio_s_out);
@@ -3260,9 +3998,6 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
     SSL *con;
     const SSL_CIPHER *c;
     BIO *io, *ssl_bio, *sbio, *edio;
-#ifdef RENEG
-    int total_bytes = 0;
-#endif
     int width;
 #ifndef OPENSSL_NO_KTLS
     int use_sendfile_for_req = use_sendfile;
@@ -3289,7 +4024,7 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
         if (!BIO_socket_nbio(s, 1))
             ERR_print_errors(bio_err);
         else if (!s_quiet)
-            BIO_printf(bio_err, "Turned on non blocking io\n");
+            BIO_puts(bio_err, "Turned on non blocking io\n");
     }

     /* lets make the output buffer a reasonable size */
@@ -3306,7 +4041,13 @@ static int www_body(int s, int stype, int prot, unsigned char *context)

     if (context != NULL
         && !SSL_set_session_id_context(con, context,
-            strlen((char *)context))) {
+            (unsigned int)strlen((char *)context))) {
+        SSL_free(con);
+        goto err;
+    }
+
+    if (rpk_files != NULL && !rpk_enable(con)) {
+        BIO_puts(bio_err, "Error enabling client RPK verification\n");
         SSL_free(con);
         goto err;
     }
@@ -3381,7 +4122,7 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
                     /* Just keep trying - busy waiting */
                     continue;
                 default:
-                    BIO_printf(bio_err, "Error reading early data\n");
+                    BIO_puts(bio_err, "Error reading early data\n");
                     ERR_print_errors(bio_err);
                     goto err;
                 }
@@ -3399,11 +4140,11 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
                     ERR_print_errors(bio_err);
                 goto err;
             } else {
-                BIO_printf(bio_s_out, "read R BLOCK\n");
+                BIO_puts(bio_s_out, "read R BLOCK\n");
 #ifndef OPENSSL_NO_SRP
                 if (BIO_should_io_special(io)
                     && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
-                    BIO_printf(bio_s_out, "LOOKUP renego during read\n");
+                    BIO_puts(bio_s_out, "LOOKUP renego during read\n");

                     lookup_srp_user(&srp_callback_parm, bio_s_out);

@@ -3424,6 +4165,10 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
             X509 *peer = NULL;
             STACK_OF(SSL_CIPHER) *sk;
             static const char *space = "                          ";
+#ifndef OPENSSL_NO_ECH
+            char *ech_inner = NULL, *ech_outer = NULL;
+            int echrv = 0;
+#endif

             if (www == 1 && HAS_PREFIX(buf, "GET /reneg")) {
                 if (HAS_PREFIX(buf, "GET /renegcert"))
@@ -3445,7 +4190,7 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
                 openssl_fdset(s, &readfds);
                 i = select(width, (void *)&readfds, NULL, NULL, NULL);
                 if (i <= 0 || !FD_ISSET(s, &readfds)) {
-                    BIO_printf(bio_s_out,
+                    BIO_puts(bio_s_out,
                         "Error waiting for client response\n");
                     ERR_print_errors(bio_err);
                     goto err;
@@ -3460,9 +4205,9 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
             }

             BIO_puts(io,
-                "HTTP/1.0 200 ok\r\nContent-type: text/html\r\n\r\n");
-            BIO_puts(io, "<HTML><BODY BGCOLOR=\"#ffffff\">\n");
-            BIO_puts(io, "<pre>\n");
+                "HTTP/1.0 200 ok\r\nContent-type: text/html\r\n\r\n"
+                "<HTML><BODY BGCOLOR=\"#ffffff\">\n"
+                "<pre>\n");
             /* BIO_puts(io, OpenSSL_version(OPENSSL_VERSION)); */
             BIO_puts(io, "\n");
             for (i = 0; i < local_argc; i++) {
@@ -3487,12 +4232,86 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
             }
             BIO_puts(io, "\n");

+#ifndef OPENSSL_NO_ECH
+            /* Customise output a bit to show ECH info at top */
+            BIO_puts(io, "<h1>OpenSSL with ECH</h1>\n");
+            BIO_puts(io, "<h2>\n");
+            echrv = SSL_ech_get1_status(con, &ech_inner, &ech_outer);
+            switch (echrv) {
+            case SSL_ECH_STATUS_NOT_TRIED:
+                BIO_puts(io, "ECH not attempted\n");
+                break;
+            case SSL_ECH_STATUS_FAILED:
+                BIO_puts(io, "ECH tried but failed\n");
+                break;
+            case SSL_ECH_STATUS_FAILED_ECH:
+                BIO_puts(io, "ECH tried but we got ECH which is weird\n");
+                break;
+            case SSL_ECH_STATUS_BAD_NAME:
+                BIO_puts(io, "ECH worked but bad name\n");
+                break;
+            case SSL_ECH_STATUS_BACKEND:
+                BIO_printf(io, "ECH acting as backend\n");
+                break;
+            case SSL_ECH_STATUS_NOT_CONFIGURED:
+                BIO_printf(io, "ECH not configured\n");
+                break;
+            case SSL_ECH_STATUS_GREASE:
+                BIO_printf(io, "ECH attempt we interpret as GREASE\n");
+                break;
+            case SSL_ECH_STATUS_GREASE_ECH:
+                BIO_printf(io, "ECH attempt we interpret as GREASE, + ECH\n");
+                break;
+            case SSL_ECH_STATUS_BAD_CALL:
+                BIO_printf(io, "ECH bad input to API\n");
+                break;
+            case SSL_ECH_STATUS_SUCCESS:
+                BIO_printf(io, "ECH success: outer sni: %s, inner sni: %s\n",
+                    (ech_outer == NULL ? "none" : ech_outer),
+                    (ech_inner == NULL ? "none" : ech_inner));
+                break;
+            default:
+                BIO_printf(io, " Error getting ECH status\n");
+                break;
+            }
+            BIO_puts(io, "</h2>\n");
+            BIO_puts(io, "<h2>TLS Session details</h2>\n");
+            BIO_puts(io, "<pre>\n");
+            /*
+             * also dump session info to server stdout for debugging
+             */
+            SSL_SESSION_print(bio_s_out, SSL_get_session(con));
+            BIO_puts(io, "<pre>\n");
+            BIO_puts(io, "\n");
+            for (i = 0; i < local_argc; i++) {
+                const char *myp;
+
+                for (myp = local_argv[i]; *myp; myp++)
+                    switch (*myp) {
+                    case '<':
+                        BIO_puts(io, "&lt;");
+                        break;
+                    case '>':
+                        BIO_puts(io, "&gt;");
+                        break;
+                    case '&':
+                        BIO_puts(io, "&amp;");
+                        break;
+                    default:
+                        BIO_write(io, myp, 1);
+                        break;
+                    }
+                BIO_write(io, " ", 1);
+            }
+            BIO_puts(io, "\n");
+#endif
+
             ssl_print_secure_renegotiation_notes(io, con);

             /*
              * The following is evil and should not really be done
              */
-            BIO_printf(io, "Ciphers supported in s_server binary\n");
+            BIO_puts(io, "Ciphers supported in s_server binary\n");
             sk = SSL_get_ciphers(con);
             j = sk_SSL_CIPHER_num(sk);
             for (i = 0; i < j; i++) {
@@ -3505,7 +4324,7 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
             BIO_puts(io, "\n");
             p = SSL_get_shared_ciphers(con, buf, bufsize);
             if (p != NULL) {
-                BIO_printf(io,
+                BIO_puts(io,
                     "---\nCiphers common between both SSL end points:\n");
                 j = i = 0;
                 while (*p) {
@@ -3532,12 +4351,12 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
             BIO_printf(io, "%s, Cipher is %s\n",
                 SSL_CIPHER_get_version(c), SSL_CIPHER_get_name(c));
             SSL_SESSION_print(io, SSL_get_session(con));
-            BIO_printf(io, "---\n");
+            BIO_puts(io, "---\n");
             print_stats(io, SSL_get_SSL_CTX(con));
-            BIO_printf(io, "---\n");
+            BIO_puts(io, "---\n");
             peer = SSL_get0_peer_certificate(con);
             if (peer != NULL) {
-                BIO_printf(io, "Client certificate\n");
+                BIO_puts(io, "Client certificate\n");
                 X509_print(io, peer);
                 PEM_write_bio_X509(io, peer);
                 peer = NULL;
@@ -3580,35 +4399,30 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
                                               * component */

             if (*e == '\0') {
-                BIO_puts(io, text);
-                BIO_printf(io, "'%s' is an invalid file name\r\n", p);
+                BIO_printf(io, "%s'%s' is an invalid file name\r\n", text, p);
                 break;
             }
             *e = '\0';

             if (dot) {
-                BIO_puts(io, text);
-                BIO_printf(io, "'%s' contains '..' or ':'\r\n", p);
+                BIO_printf(io, "%s'%s' contains '..' or ':'\r\n", text, p);
                 break;
             }

             if (*p == '/' || *p == '\\') {
-                BIO_puts(io, text);
-                BIO_printf(io, "'%s' is an invalid path\r\n", p);
+                BIO_printf(io, "%s'%s' is an invalid path\r\n", text, p);
                 break;
             }

             /* if a directory, do the index thang */
             if (app_isdir(p) > 0) {
-                BIO_puts(io, text);
-                BIO_printf(io, "'%s' is a directory\r\n", p);
+                BIO_printf(io, "%s'%s' is a directory\r\n", text, p);
                 break;
             }

             opmode = (http_server_binmode == 1) ? "rb" : "r";
             if ((file = BIO_new_file(p, opmode)) == NULL) {
-                BIO_puts(io, text);
-                BIO_printf(io, "Error opening '%s' mode='%s'\r\n", p, opmode);
+                BIO_printf(io, "%sError opening '%s' mode='%s'\r\n", text, p, opmode);
                 ERR_print_errors(io);
                 break;
             }
@@ -3617,7 +4431,7 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
                 BIO_printf(bio_err, "FILE:%s\n", p);

             if (www == 2) {
-                i = strlen(p);
+                i = (int)strlen(p);
                 if (((i > 5) && (strcmp(&(p[i - 5]), ".html") == 0)) || ((i > 4) && (strcmp(&(p[i - 4]), ".php") == 0)) || ((i > 4) && (strcmp(&(p[i - 4]), ".htm") == 0)))
                     BIO_puts(io,
                         "HTTP/1.0 200 ok\r\nContent-type: text/html\r\n\r\n");
@@ -3628,7 +4442,7 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
             /* send the file */
 #ifndef OPENSSL_NO_KTLS
             if (use_sendfile_for_req && !BIO_get_ktls_send(SSL_get_wbio(con))) {
-                BIO_printf(bio_err, "Warning: sendfile requested but KTLS is not available\n");
+                BIO_puts(bio_err, "Warning: sendfile requested but KTLS is not available\n");
                 use_sendfile_for_req = 0;
             }
             if (use_sendfile_for_req) {
@@ -3676,29 +4490,14 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
                     if (i <= 0)
                         break;

-#ifdef RENEG
-                    total_bytes += i;
-                    BIO_printf(bio_err, "%d\n", i);
-                    if (total_bytes > 3 * 1024) {
-                        total_bytes = 0;
-                        BIO_printf(bio_err, "RENEGOTIATE\n");
-                        SSL_renegotiate(con);
-                    }
-#endif
-
                     for (j = 0; j < i;) {
-#ifdef RENEG
-                        static count = 0;
-                        if (++count == 13)
-                            SSL_renegotiate(con);
-#endif
                         k = BIO_write(io, &(buf[j]), i - j);
                         if (k <= 0) {
                             if (!BIO_should_retry(io)
                                 && !SSL_waiting_for_async(con)) {
                                 goto write_error;
                             } else {
-                                BIO_printf(bio_s_out, "rwrite W BLOCK\n");
+                                BIO_puts(bio_s_out, "rwrite W BLOCK\n");
                             }
                         } else {
                             j += k;
@@ -3764,12 +4563,19 @@ static int rev_body(int s, int stype, int prot, unsigned char *context)
     }
     if (context != NULL
         && !SSL_set_session_id_context(con, context,
-            strlen((char *)context))) {
+            (unsigned int)strlen((char *)context))) {
         SSL_free(con);
         ERR_print_errors(bio_err);
         goto err;
     }

+    if (rpk_files != NULL && !rpk_enable(con)) {
+        BIO_puts(bio_err, "Error enabling client RPK verification\n");
+        ERR_print_errors(bio_err);
+        SSL_free(con);
+        goto err;
+    }
+
     sbio = BIO_new_socket(s, BIO_NOCLOSE);
     if (sbio == NULL) {
         SSL_free(con);
@@ -3818,7 +4624,7 @@ static int rev_body(int s, int stype, int prot, unsigned char *context)
 #ifndef OPENSSL_NO_SRP
         if (BIO_should_io_special(io)
             && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
-            BIO_printf(bio_s_out, "LOOKUP renego during accept\n");
+            BIO_puts(bio_s_out, "LOOKUP renego during accept\n");

             lookup_srp_user(&srp_callback_parm, bio_s_out);

@@ -3826,7 +4632,7 @@ static int rev_body(int s, int stype, int prot, unsigned char *context)
         }
 #endif
     }
-    BIO_printf(bio_err, "CONNECTION ESTABLISHED\n");
+    BIO_puts(bio_err, "CONNECTION ESTABLISHED\n");
     print_ssl_summary(con);

     for (;;) {
@@ -3837,11 +4643,11 @@ static int rev_body(int s, int stype, int prot, unsigned char *context)
                     ERR_print_errors(bio_err);
                 goto err;
             } else {
-                BIO_printf(bio_s_out, "read R BLOCK\n");
+                BIO_puts(bio_s_out, "read R BLOCK\n");
 #ifndef OPENSSL_NO_SRP
                 if (BIO_should_io_special(io)
                     && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
-                    BIO_printf(bio_s_out, "LOOKUP renego during read\n");
+                    BIO_puts(bio_s_out, "LOOKUP renego during read\n");

                     lookup_srp_user(&srp_callback_parm, bio_s_out);

@@ -3853,7 +4659,7 @@ static int rev_body(int s, int stype, int prot, unsigned char *context)
             }
         } else if (i == 0) { /* end of input */
             ret = 1;
-            BIO_printf(bio_err, "CONNECTION CLOSED\n");
+            BIO_puts(bio_err, "CONNECTION CLOSED\n");
             goto end;
         } else {
             char *p = buf + i - 1;
@@ -3863,7 +4669,7 @@ static int rev_body(int s, int stype, int prot, unsigned char *context)
             }
             if (!s_ign_eof && i == 5 && HAS_PREFIX(buf, "CLOSE")) {
                 ret = 1;
-                BIO_printf(bio_err, "CONNECTION CLOSED\n");
+                BIO_puts(bio_err, "CONNECTION CLOSED\n");
                 goto end;
             }
             BUF_reverse((unsigned char *)buf, NULL, i);
@@ -3895,7 +4701,7 @@ static int generate_session_id(SSL *ssl, unsigned char *id,
     unsigned int *id_len)
 {
     unsigned int count = 0;
-    unsigned int session_id_prefix_len = strlen(session_id_prefix);
+    unsigned int session_id_prefix_len = (unsigned int)strlen(session_id_prefix);

     do {
         if (RAND_bytes(id, *id_len) <= 0)
@@ -3939,8 +4745,8 @@ static int add_session(SSL *ssl, SSL_SESSION *session)

     SSL_SESSION_get_id(session, &sess->idlen);
     sess->derlen = i2d_SSL_SESSION(session, NULL);
-    if (sess->derlen < 0) {
-        BIO_printf(bio_err, "Error encoding session\n");
+    if (sess->derlen <= 0) {
+        BIO_puts(bio_err, "Error encoding session\n");
         OPENSSL_free(sess);
         return 0;
     }
@@ -3948,7 +4754,7 @@ static int add_session(SSL *ssl, SSL_SESSION *session)
     sess->id = OPENSSL_memdup(SSL_SESSION_get_id(session, NULL), sess->idlen);
     sess->der = app_malloc(sess->derlen, "get session buffer");
     if (!sess->id) {
-        BIO_printf(bio_err, "Out of memory adding to external cache\n");
+        BIO_puts(bio_err, "Out of memory adding to external cache\n");
         OPENSSL_free(sess->id);
         OPENSSL_free(sess->der);
         OPENSSL_free(sess);
@@ -3958,7 +4764,7 @@ static int add_session(SSL *ssl, SSL_SESSION *session)

     /* Assume it still works. */
     if (i2d_SSL_SESSION(session, &p) != sess->derlen) {
-        BIO_printf(bio_err, "Unexpected session encoding length\n");
+        BIO_puts(bio_err, "Unexpected session encoding length\n");
         OPENSSL_free(sess->id);
         OPENSSL_free(sess->der);
         OPENSSL_free(sess);
@@ -3967,7 +4773,7 @@ static int add_session(SSL *ssl, SSL_SESSION *session)

     sess->next = first;
     first = sess;
-    BIO_printf(bio_err, "New session added to external cache\n");
+    BIO_puts(bio_err, "New session added to external cache\n");
     return 0;
 }

@@ -3979,12 +4785,12 @@ static SSL_SESSION *get_session(SSL *ssl, const unsigned char *id, int idlen,
     for (sess = first; sess; sess = sess->next) {
         if (idlen == (int)sess->idlen && !memcmp(sess->id, id, idlen)) {
             const unsigned char *p = sess->der;
-            BIO_printf(bio_err, "Lookup session: cache hit\n");
+            BIO_puts(bio_err, "Lookup session: cache hit\n");
             return d2i_SSL_SESSION_ex(NULL, &p, sess->derlen, app_get0_libctx(),
                 app_get0_propq());
         }
     }
-    BIO_printf(bio_err, "Lookup session: cache miss\n");
+    BIO_puts(bio_err, "Lookup session: cache miss\n");
     return NULL;
 }

diff --git a/deps/openssl/openssl/apps/s_time.c b/deps/openssl/openssl/apps/s_time.c
index 6bdd9e23cee..9a2a967f5e3 100644
--- a/deps/openssl/openssl/apps/s_time.c
+++ b/deps/openssl/openssl/apps/s_time.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -61,18 +61,19 @@ typedef enum OPTION_choice {
     OPT_BUGS,
     OPT_VERIFY,
     OPT_TIME,
-    OPT_SSL3,
     OPT_WWW,
     OPT_TLS1,
     OPT_TLS1_1,
     OPT_TLS1_2,
     OPT_TLS1_3,
+    OPT_TESTMODE,
     OPT_PROV_ENUM
 } OPTION_CHOICE;

 const OPTIONS s_time_options[] = {
     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
+    { "testmode", OPT_TESTMODE, '-', "Run the s_time command in test mode" },

     OPT_SECTION("Connection"),
     { "connect", OPT_CONNECT, 's',
@@ -83,9 +84,6 @@ const OPTIONS s_time_options[] = {
     { "cipher", OPT_CIPHER, 's', "TLSv1.2 and below cipher list to be used" },
     { "ciphersuites", OPT_CIPHERSUITES, 's',
         "Specify TLSv1.3 ciphersuites to be used" },
-#ifndef OPENSSL_NO_SSL3
-    { "ssl3", OPT_SSL3, '-', "Just use SSLv3" },
-#endif
 #ifndef OPENSSL_NO_TLS1
     { "tls1", OPT_TLS1, '-', "Just use TLSv1.0" },
 #endif
@@ -107,10 +105,10 @@ const OPTIONS s_time_options[] = {
     { "nameopt", OPT_NAMEOPT, 's', "Certificate subject/issuer name printing options" },
     { "cert", OPT_CERT, '<', "Cert file to use, PEM format assumed" },
     { "key", OPT_KEY, '<', "File with key, PEM; default is -cert file" },
-    { "cafile", OPT_CAFILE, '<', "PEM format file of CA's" },
-    { "CAfile", OPT_CAFILE, '<', "PEM format file of CA's" },
-    { "CApath", OPT_CAPATH, '/', "PEM format directory of CA's" },
-    { "CAstore", OPT_CASTORE, ':', "URI to store of CA's" },
+    { "cafile", OPT_CAFILE, '<', "Deprecated alias of -CAfile" },
+    { "CAfile", OPT_CAFILE, '<', "File in PEM format with trusted CA certs" },
+    { "CApath", OPT_CAPATH, '/', "Dir with trusted CA cert files in PEM format" },
+    { "CAstore", OPT_CASTORE, ':', "URI of store with trusted CA certs" },
     { "no-CAfile", OPT_NOCAFILE, '-',
         "Do not load the default certificates file" },
     { "no-CApath", OPT_NOCAPATH, '-',
@@ -146,6 +144,7 @@ int s_time_main(int argc, char **argv)
     long bytes_read = 0, finishtime = 0;
     OPTION_CHOICE o;
     int min_version = 0, max_version = 0, ver, buf_len, fd;
+    int want_verify = 0, testmode = 0;
     size_t buf_size;

     meth = TLS_client_method();
@@ -173,6 +172,7 @@ int s_time_main(int argc, char **argv)
             break;
         case OPT_VERIFY:
             verify_args.depth = opt_int_arg();
+            want_verify = 1;
             BIO_printf(bio_err, "%s: verify depth is %d\n",
                 prog, verify_args.depth);
             break;
@@ -224,10 +224,6 @@ int s_time_main(int argc, char **argv)
                 goto end;
             }
             break;
-        case OPT_SSL3:
-            min_version = SSL3_VERSION;
-            max_version = SSL3_VERSION;
-            break;
         case OPT_TLS1:
             min_version = TLS1_VERSION;
             max_version = TLS1_VERSION;
@@ -244,6 +240,9 @@ int s_time_main(int argc, char **argv)
             min_version = TLS1_3_VERSION;
             max_version = TLS1_3_VERSION;
             break;
+        case OPT_TESTMODE:
+            testmode = 1;
+            break;
         case OPT_PROV_CASES:
             if (!opt_provider(o))
                 goto end;
@@ -281,9 +280,19 @@ int s_time_main(int argc, char **argv)
         ERR_print_errors(bio_err);
         goto end;
     }
+
+    if (want_verify) {
+        X509_VERIFY_PARAM *vpm;
+        SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, verify_callback);
+        vpm = SSL_CTX_get0_param(ctx);
+        if (vpm != NULL && verify_args.depth >= 0)
+            X509_VERIFY_PARAM_set_depth(vpm, verify_args.depth);
+    }
+
     if (!(perform & 1))
         goto next;
-    printf("Collecting connection statistics for %d seconds\n", maxtime);
+    if (!testmode)
+        printf("Collecting connection statistics for %d seconds\n", maxtime);

     /* Loop and time how long it takes to make connections */

@@ -291,16 +300,17 @@ int s_time_main(int argc, char **argv)
     finishtime = (long)time(NULL) + maxtime;
     tm_Time_F(START);
     for (;;) {
-        if (finishtime < (long)time(NULL))
+        if (testmode ? nConn >= 1 : finishtime < (long)time(NULL))
             break;

         if ((scon = doConnection(NULL, host, ctx)) == NULL)
             goto end;

         if (www_path != NULL) {
-            buf_len = BIO_snprintf(buf, sizeof(buf), fmt_http_get_cmd,
+            buf_len = snprintf(buf, sizeof(buf), fmt_http_get_cmd,
                 www_path);
-            if (buf_len <= 0 || SSL_write(scon, buf, buf_len) <= 0)
+            if (buf_len <= 0 || (size_t)buf_len >= sizeof(buf)
+                || SSL_write(scon, buf, buf_len) <= 0)
                 goto end;
             while ((i = SSL_read(scon, buf, sizeof(buf))) > 0)
                 bytes_read += i;
@@ -315,8 +325,6 @@ int s_time_main(int argc, char **argv)
             ver = SSL_version(scon);
             if (ver == TLS1_VERSION)
                 ver = 't';
-            else if (ver == SSL3_VERSION)
-                ver = '3';
             else
                 ver = '*';
         }
@@ -343,17 +351,19 @@ next:
         ret = 0;
         goto end;
     }
-    printf("\n\nNow timing with session id reuse.\n");
+    if (!testmode)
+        printf("\n\nNow timing with session id reuse.\n");

     /* Get an SSL object so we can reuse the session id */
     if ((scon = doConnection(NULL, host, ctx)) == NULL) {
-        BIO_printf(bio_err, "Unable to get connection\n");
+        BIO_puts(bio_err, "Unable to get connection\n");
         goto end;
     }

     if (www_path != NULL) {
-        buf_len = BIO_snprintf(buf, sizeof(buf), fmt_http_get_cmd, www_path);
-        if (buf_len <= 0 || SSL_write(scon, buf, buf_len) <= 0)
+        buf_len = snprintf(buf, sizeof(buf), fmt_http_get_cmd, www_path);
+        if (buf_len <= 0 || (size_t)buf_len >= sizeof(buf)
+            || SSL_write(scon, buf, buf_len) <= 0)
             goto end;
         while (SSL_read(scon, buf, sizeof(buf)) > 0)
             continue;
@@ -367,21 +377,23 @@ next:

     finishtime = (long)time(NULL) + maxtime;

-    printf("starting\n");
+    if (!testmode)
+        printf("starting\n");
     bytes_read = 0;
     tm_Time_F(START);

     for (;;) {
-        if (finishtime < (long)time(NULL))
+        if (testmode ? nConn >= 2 : finishtime < (long)time(NULL))
             break;

         if ((doConnection(scon, host, ctx)) == NULL)
             goto end;

         if (www_path != NULL) {
-            buf_len = BIO_snprintf(buf, sizeof(buf), fmt_http_get_cmd,
+            buf_len = snprintf(buf, sizeof(buf), fmt_http_get_cmd,
                 www_path);
-            if (buf_len <= 0 || SSL_write(scon, buf, buf_len) <= 0)
+            if (buf_len <= 0 || (size_t)buf_len >= sizeof(buf)
+                || SSL_write(scon, buf, buf_len) <= 0)
                 goto end;
             while ((i = SSL_read(scon, buf, sizeof(buf))) > 0)
                 bytes_read += i;
@@ -397,8 +409,6 @@ next:
             ver = SSL_version(scon);
             if (ver == TLS1_VERSION)
                 ver = 't';
-            else if (ver == SSL3_VERSION)
-                ver = '3';
             else
                 ver = '*';
         }
@@ -467,7 +477,7 @@ static SSL *doConnection(SSL *scon, const char *host, SSL_CTX *ctx)
     /* ok, lets connect */
     i = SSL_connect(serverCon);
     if (i <= 0) {
-        BIO_printf(bio_err, "ERROR\n");
+        BIO_puts(bio_err, "ERROR\n");
         if (verify_args.error != X509_V_OK)
             BIO_printf(bio_err, "verify error:%s\n",
                 X509_verify_cert_error_string(verify_args.error));
diff --git a/deps/openssl/openssl/apps/sess_id.c b/deps/openssl/openssl/apps/sess_id.c
index 715b6538338..0d3d35a3bcb 100644
--- a/deps/openssl/openssl/apps/sess_id.c
+++ b/deps/openssl/openssl/apps/sess_id.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -116,12 +116,12 @@ int sess_id_main(int argc, char **argv)
     if (context != NULL) {
         size_t ctx_len = strlen(context);
         if (ctx_len > SSL_MAX_SID_CTX_LENGTH) {
-            BIO_printf(bio_err, "Context too long\n");
+            BIO_puts(bio_err, "Context too long\n");
             goto end;
         }
         if (!SSL_SESSION_set1_id_context(x, (unsigned char *)context,
-                ctx_len)) {
-            BIO_printf(bio_err, "Error setting id context\n");
+                (unsigned int)ctx_len)) {
+            BIO_puts(bio_err, "Error setting id context\n");
             goto end;
         }
     }
@@ -151,11 +151,11 @@ int sess_id_main(int argc, char **argv)
         } else if (outformat == FORMAT_NSS) {
             i = SSL_SESSION_print_keylog(out, x);
         } else {
-            BIO_printf(bio_err, "bad output format specified for outfile\n");
+            BIO_puts(bio_err, "bad output format specified for outfile\n");
             goto end;
         }
         if (!i) {
-            BIO_printf(bio_err, "unable to write SSL_SESSION\n");
+            BIO_puts(bio_err, "unable to write SSL_SESSION\n");
             goto end;
         }
     } else if (!noout && (peer != NULL)) { /* just print the certificate */
@@ -164,11 +164,11 @@ int sess_id_main(int argc, char **argv)
         } else if (outformat == FORMAT_PEM) {
             i = PEM_write_bio_X509(out, peer);
         } else {
-            BIO_printf(bio_err, "bad output format specified for outfile\n");
+            BIO_puts(bio_err, "bad output format specified for outfile\n");
             goto end;
         }
         if (!i) {
-            BIO_printf(bio_err, "unable to write X509\n");
+            BIO_puts(bio_err, "unable to write X509\n");
             goto end;
         }
     }
@@ -192,7 +192,7 @@ static SSL_SESSION *load_sess_id(char *infile, int format)
     else
         x = PEM_read_bio_SSL_SESSION(in, NULL, NULL, NULL);
     if (x == NULL) {
-        BIO_printf(bio_err, "unable to load SSL_SESSION\n");
+        BIO_puts(bio_err, "unable to load SSL_SESSION\n");
         ERR_print_errors(bio_err);
         goto end;
     }
diff --git a/deps/openssl/openssl/apps/skeyutl.c b/deps/openssl/openssl/apps/skeyutl.c
index 8f81ea15fc1..cb9a8131de0 100644
--- a/deps/openssl/openssl/apps/skeyutl.c
+++ b/deps/openssl/openssl/apps/skeyutl.c
@@ -88,7 +88,7 @@ int skeyutl_main(int argc, char **argv)
         goto opthelp;

     if (cipher == NULL && skeymgmt == NULL) {
-        BIO_printf(bio_err, "Either -skeymgmt -or -cipher option should be specified\n");
+        BIO_puts(bio_err, "Either -skeymgmt -or -cipher option should be specified\n");
         goto end;
     }

@@ -102,6 +102,9 @@ int skeyutl_main(int argc, char **argv)
             goto end;
         params = app_params_new_from_opts(skeyopts,
             EVP_SKEYMGMT_get0_gen_settable_params(mgmt));
+        /* A NULL return is an error only if key options were given */
+        if (skeyopts != NULL && params == NULL)
+            goto end;

         skey = EVP_SKEY_generate(app_get0_libctx(),
             skeymgmt ? skeymgmt : EVP_CIPHER_name(cipher),
@@ -114,15 +117,17 @@ int skeyutl_main(int argc, char **argv)
         } else {
             const char *key_name = EVP_SKEY_get0_key_id(skey);

-            BIO_printf(bio_out, "An opaque key identified by %s is created\n",
-                key_name ? key_name : "<unknown>");
-            BIO_printf(bio_out, "Provider: %s\n", EVP_SKEY_get0_provider_name(skey));
-            BIO_printf(bio_out, "Key management: %s\n", EVP_SKEY_get0_skeymgmt_name(skey));
+            BIO_printf(bio_out, "An opaque key identified by %s is created\n"
+                                "Provider: %s\n"
+                                "Key management: %s\n",
+                key_name ? key_name : "<unknown>",
+                EVP_SKEY_get0_provider_name(skey),
+                EVP_SKEY_get0_skeymgmt_name(skey));
             ret = 0;
         }
         goto end;
     } else {
-        BIO_printf(bio_err, "Key generation is the only supported operation as of now\n");
+        BIO_puts(bio_err, "Key generation is the only supported operation as of now\n");
     }

 end:
diff --git a/deps/openssl/openssl/apps/smime.c b/deps/openssl/openssl/apps/smime.c
index 328022ce9d0..fd817ca98bf 100644
--- a/deps/openssl/openssl/apps/smime.c
+++ b/deps/openssl/openssl/apps/smime.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -54,7 +54,6 @@ typedef enum OPTION_choice {
     OPT_INDEF,
     OPT_NOINDEF,
     OPT_CRLFEOL,
-    OPT_ENGINE,
     OPT_PASSIN,
     OPT_TO,
     OPT_FROM,
@@ -95,10 +94,7 @@ const OPTIONS smime_options[] = {
         "Output format SMIME (default), PEM or DER" },
     { "inkey", OPT_INKEY, 's',
         "Input private key (if not signer or recipient)" },
-    { "keyform", OPT_KEYFORM, 'f', "Input private key format (ENGINE, other values ignored)" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif
+    { "keyform", OPT_KEYFORM, 'f', "Input private key format (DER/PEM)" },
     { "stream", OPT_STREAM, '-', "Enable CMS streaming" },
     { "indef", OPT_INDEF, '-', "Same as -stream" },
     { "noindef", OPT_NOINDEF, '-', "Disable CMS streaming" },
@@ -121,7 +117,7 @@ const OPTIONS smime_options[] = {
     { "nodetach", OPT_NODETACH, '-', "Use opaque signing" },
     { "noattr", OPT_NOATTR, '-', "Don't include any signed attributes" },
     { "binary", OPT_BINARY, '-', "Don't translate message to text" },
-    { "signer", OPT_SIGNER, 's', "Signer certificate file" },
+    { "signer", OPT_SIGNER, 's', "Signer certificate" },
     { "content", OPT_CONTENT, '<',
         "Supply or override content for detached signature" },
     { "nocerts", OPT_NOCERTS, '-',
@@ -131,11 +127,7 @@ const OPTIONS smime_options[] = {
     { "nosigs", OPT_NOSIGS, '-', "Don't verify message signature" },
     { "noverify", OPT_NOVERIFY, '-', "Don't verify signers certificate" },

-    { "certfile", OPT_CERTFILE, '<',
-        "Extra signer and intermediate CA certificates to include when signing" },
-    { OPT_MORE_STR, 0, 0,
-        "or to use as preferred signer certs and for chain building when verifying" },
-    { "recip", OPT_RECIP, '<', "Recipient certificate file for decryption" },
+    { "recip", OPT_RECIP, '<', "Recipient certificate for decryption" },

     OPT_SECTION("Email"),
     { "to", OPT_TO, 's', "To address" },
@@ -145,9 +137,13 @@ const OPTIONS smime_options[] = {
     { "nosmimecap", OPT_NOSMIMECAP, '-', "Omit the SMIMECapabilities attribute" },

     OPT_SECTION("Certificate chain"),
-    { "CApath", OPT_CAPATH, '/', "Trusted certificates directory" },
-    { "CAfile", OPT_CAFILE, '<', "Trusted certificates file" },
-    { "CAstore", OPT_CASTORE, ':', "Trusted certificates store URI" },
+    { "certfile", OPT_CERTFILE, '<',
+        "Extra signer and intermediate CA certificates to include when signing" },
+    { OPT_MORE_STR, 0, 0,
+        "or to use as preferred signer certs and for chain building when verifying" },
+    { "CAfile", OPT_CAFILE, '<', "File in PEM format with trusted CA certs" },
+    { "CApath", OPT_CAPATH, '/', "Dir with trusted CA cert files in PEM format" },
+    { "CAstore", OPT_CASTORE, ':', "URI of store with trusted CA certs" },
     { "no-CAfile", OPT_NOCAFILE, '-',
         "Do not load the default certificates file" },
     { "no-CApath", OPT_NOCAPATH, '-',
@@ -155,8 +151,8 @@ const OPTIONS smime_options[] = {
     { "no-CAstore", OPT_NOCASTORE, '-',
         "Do not load certificates from the default certificates store" },
     { "nochain", OPT_NOCHAIN, '-',
-        "set PKCS7_NOCHAIN so certificates contained in the message are not used as untrusted CAs" },
-    { "crlfeol", OPT_CRLFEOL, '-', "Use CRLF as EOL termination instead of LF only" },
+        "Do not use certs contained in the message as untrusted CAs for chain building" },
+    { "crlfeol", OPT_CRLFEOL, '-', "Use CRLF as EOL termination (instead of LF only)" },

     OPT_R_OPTIONS,
     OPT_V_OPTIONS,
@@ -215,7 +211,6 @@ int smime_main(int argc, char **argv)
     int flags = PKCS7_DETACHED, operation = 0, ret = 0, indef = 0;
     int informat = FORMAT_SMIME, outformat = FORMAT_SMIME, keyform = FORMAT_UNDEF;
     int vpmtouched = 0, rv = 0;
-    ENGINE *e = NULL;
     const char *mime_eol = "\n";
     OSSL_LIB_CTX *libctx = app_get0_libctx();

@@ -327,9 +322,6 @@ int smime_main(int argc, char **argv)
             if (conf == NULL)
                 goto end;
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_PASSIN:
             passinarg = opt_arg();
             break;
@@ -471,26 +463,26 @@ int smime_main(int argc, char **argv)
                 goto end;
         }
         if (sksigners == NULL) {
-            BIO_printf(bio_err, "No signer certificate specified\n");
+            BIO_puts(bio_err, "No signer certificate specified\n");
             goto opthelp;
         }
         signerfile = NULL;
         keyfile = NULL;
     } else if (operation == SMIME_DECRYPT) {
         if (recipfile == NULL && keyfile == NULL) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "No recipient certificate or key specified\n");
             goto opthelp;
         }
     } else if (operation == SMIME_ENCRYPT) {
         if (argc == 0) {
-            BIO_printf(bio_err, "No recipient(s) certificate(s) specified\n");
+            BIO_puts(bio_err, "No recipient(s) certificate(s) specified\n");
             goto opthelp;
         }
     }

     if (!app_passwd(passinarg, NULL, &passin, NULL)) {
-        BIO_printf(bio_err, "Error getting password\n");
+        BIO_puts(bio_err, "Error getting password\n");
         goto end;
     }

@@ -528,7 +520,7 @@ int smime_main(int argc, char **argv)
     }

     if (certfile != NULL) {
-        if (!load_certs(certfile, 0, &other, NULL, "certificates")) {
+        if (!load_certs(certfile, 0, &other, NULL, "extra certificates")) {
             ERR_print_errors(bio_err);
             goto end;
         }
@@ -554,7 +546,7 @@ int smime_main(int argc, char **argv)
     }

     if (keyfile != NULL) {
-        key = load_key(keyfile, keyform, 0, passin, e, "signing key");
+        key = load_key(keyfile, keyform, 0, passin, "signing key");
         if (key == NULL)
             goto end;
     }
@@ -568,7 +560,7 @@ int smime_main(int argc, char **argv)

         p7 = PKCS7_new_ex(libctx, app_get0_propq());
         if (p7 == NULL) {
-            BIO_printf(bio_err, "Error allocating PKCS7 object\n");
+            BIO_puts(bio_err, "Error allocating PKCS7 object\n");
             goto end;
         }
         if (informat == FORMAT_SMIME) {
@@ -578,12 +570,12 @@ int smime_main(int argc, char **argv)
         } else if (informat == FORMAT_ASN1) {
             p7_in = d2i_PKCS7_bio(in, &p7);
         } else {
-            BIO_printf(bio_err, "Bad input format for PKCS#7 file\n");
+            BIO_puts(bio_err, "Bad input format for PKCS#7 file\n");
             goto end;
         }

         if (p7_in == NULL) {
-            BIO_printf(bio_err, "Error reading S/MIME message\n");
+            BIO_puts(bio_err, "Error reading S/MIME message\n");
             goto end;
         }
         if (contfile != NULL) {
@@ -632,7 +624,7 @@ int smime_main(int argc, char **argv)
             p7 = PKCS7_sign_ex(NULL, NULL, other, in, flags, libctx, app_get0_propq());
             if (p7 == NULL)
                 goto end;
-            if (flags & PKCS7_NOCERTS) {
+            if ((flags & PKCS7_NOCERTS) != 0) { /* still add list given via -certfile */
                 for (i = 0; i < sk_X509_num(other); i++) {
                     X509 *x = sk_X509_value(other, i);
                     PKCS7_add_certificate(p7, x);
@@ -647,7 +639,7 @@ int smime_main(int argc, char **argv)
             signer = load_cert(signerfile, FORMAT_UNDEF, "signer certificate");
             if (signer == NULL)
                 goto end;
-            key = load_key(keyfile, keyform, 0, passin, e, "signing key");
+            key = load_key(keyfile, keyform, 0, passin, "signing key");
             if (key == NULL)
                 goto end;

@@ -666,22 +658,22 @@ int smime_main(int argc, char **argv)
     }

     if (p7 == NULL) {
-        BIO_printf(bio_err, "Error creating PKCS#7 structure\n");
+        BIO_puts(bio_err, "Error creating PKCS#7 structure\n");
         goto end;
     }

     ret = 4;
     if (operation == SMIME_DECRYPT) {
         if (!PKCS7_decrypt(p7, key, recip, out, flags)) {
-            BIO_printf(bio_err, "Error decrypting PKCS#7 structure\n");
+            BIO_puts(bio_err, "Error decrypting PKCS#7 structure\n");
             goto end;
         }
     } else if (operation == SMIME_VERIFY) {
         STACK_OF(X509) *signers;
         if (PKCS7_verify(p7, other, store, indata, out, flags))
-            BIO_printf(bio_err, "Verification successful\n");
+            BIO_puts(bio_err, "Verification successful\n");
         else {
-            BIO_printf(bio_err, "Verification failure\n");
+            BIO_puts(bio_err, "Verification failure\n");
             goto end;
         }
         signers = PKCS7_get0_signers(p7, other, flags);
@@ -710,11 +702,11 @@ int smime_main(int argc, char **argv)
         } else if (outformat == FORMAT_ASN1) {
             rv = i2d_PKCS7_bio_stream(out, p7, in, flags);
         } else {
-            BIO_printf(bio_err, "Bad output format for PKCS#7 file\n");
+            BIO_puts(bio_err, "Bad output format for PKCS#7 file\n");
             goto end;
         }
         if (rv == 0) {
-            BIO_printf(bio_err, "Error writing output\n");
+            BIO_puts(bio_err, "Error writing output\n");
             ret = 3;
             goto end;
         }
@@ -736,7 +728,6 @@ end:
     EVP_MD_free(sign_md);
     EVP_CIPHER_free(cipher);
     PKCS7_free(p7);
-    release_engine(e);
     BIO_free(in);
     BIO_free(indata);
     BIO_free_all(out);
diff --git a/deps/openssl/openssl/apps/speed.c b/deps/openssl/openssl/apps/speed.c
index 6cf9748902c..d121dfe076d 100644
--- a/deps/openssl/openssl/apps/speed.c
+++ b/deps/openssl/openssl/apps/speed.c
@@ -16,8 +16,6 @@
 #define DSA_SECONDS PKEY_SECONDS
 #define ECDSA_SECONDS PKEY_SECONDS
 #define ECDH_SECONDS PKEY_SECONDS
-#define EdDSA_SECONDS PKEY_SECONDS
-#define SM2_SECONDS PKEY_SECONDS
 #define FFDH_SECONDS PKEY_SECONDS
 #define KEM_SECONDS PKEY_SECONDS
 #define SIG_SECONDS PKEY_SECONDS
@@ -43,6 +41,7 @@
 #include <openssl/objects.h>
 #include <openssl/core_names.h>
 #include <openssl/async.h>
+#include <openssl/prov_ssl.h>
 #include <openssl/provider.h>
 #if !defined(OPENSSL_SYS_MSDOS)
 #include <unistd.h>
@@ -107,8 +106,6 @@ typedef struct openssl_speed_sec_st {
     int dsa;
     int ecdsa;
     int ecdh;
-    int eddsa;
-    int sm2;
     int ffdh;
     int kem;
     int sig;
@@ -220,6 +217,9 @@ static int opt_found(const char *name, unsigned int *result,
 {
     unsigned int idx;

+    if (*name == '\0')
+        return 0;
+
     for (idx = 0; idx < nbelem; ++idx, pairs++)
         if (strcmp(name, pairs->name) == 0) {
             *result = pairs->retval;
@@ -236,7 +236,6 @@ typedef enum OPTION_choice {
     OPT_EVP,
     OPT_HMAC,
     OPT_DECRYPT,
-    OPT_ENGINE,
     OPT_MULTI,
     OPT_MR,
     OPT_MB,
@@ -273,9 +272,6 @@ const OPTIONS speed_options[] = {
 #ifndef OPENSSL_NO_ASYNC
     { "async_jobs", OPT_ASYNCJOBS, 'p',
         "Enable async mode and start specified number of jobs" },
-#endif
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
 #endif
     { "primes", OPT_PRIMES, 'p', "Specify number of primes (for RSA only)" },
     { "mlock", OPT_MLOCK, '-', "Lock memory for better result determinism" },
@@ -482,10 +478,26 @@ enum ec_curves_t {
     R_EC_BRP384T1,
     R_EC_BRP512R1,
     R_EC_BRP512T1,
-    ECDSA_NUM
+    ECBASE_NUM,
+#ifndef OPENSSL_NO_ECX
+    R_Ed25519 = ECBASE_NUM,
+    R_Ed448,
+    R_X25519,
+    R_X448,
+    ECX_NUM,
+#else
+    ECX_NUM = ECBASE_NUM,
+#endif
+#ifndef OPENSSL_NO_SM2
+    R_SM2 = ECX_NUM,
+    R_curveSM2,
+    EC_NUM,
+#else
+    EC_NUM = ECX_NUM,
+#endif
 };
 /* list of ecdsa curves */
-static const OPT_PAIR ecdsa_choices[ECDSA_NUM] = {
+static const OPT_PAIR ecdsa_choices[EC_NUM] = {
     { "ecdsap160", R_EC_P160 },
     { "ecdsap192", R_EC_P192 },
     { "ecdsap224", R_EC_P224 },
@@ -509,15 +521,16 @@ static const OPT_PAIR ecdsa_choices[ECDSA_NUM] = {
     { "ecdsabrp384r1", R_EC_BRP384R1 },
     { "ecdsabrp384t1", R_EC_BRP384T1 },
     { "ecdsabrp512r1", R_EC_BRP512R1 },
-    { "ecdsabrp512t1", R_EC_BRP512T1 }
-};
-enum {
+    { "ecdsabrp512t1", R_EC_BRP512T1 },
 #ifndef OPENSSL_NO_ECX
-    R_EC_X25519 = ECDSA_NUM,
-    R_EC_X448,
-    EC_NUM
-#else
-    EC_NUM = ECDSA_NUM
+    { "ed25519", R_Ed25519 },
+    { "ed448", R_Ed448 },
+    { "", -1 },
+    { "", -1 },
+#endif
+#ifndef OPENSSL_NO_SM2
+    { "sm2", R_SM2 },
+    { "", -1 },
 #endif
 };
 /* list of ecdh curves, extension of |ecdsa_choices| list above */
@@ -547,36 +560,19 @@ static const OPT_PAIR ecdh_choices[EC_NUM] = {
     { "ecdhbrp512r1", R_EC_BRP512R1 },
     { "ecdhbrp512t1", R_EC_BRP512T1 },
 #ifndef OPENSSL_NO_ECX
-    { "ecdhx25519", R_EC_X25519 },
-    { "ecdhx448", R_EC_X448 }
+    { "", -1 },
+    { "", -1 },
+    { "ecdhx25519", R_X25519 },
+    { "ecdhx448", R_X448 },
+#endif
+#ifndef OPENSSL_NO_SM2
+    { "", -1 },
+    { "curveSM2", R_curveSM2 },
 #endif
 };

 static double ecdh_results[EC_NUM][1]; /* 1 op: derivation */
-static double ecdsa_results[ECDSA_NUM][2]; /* 2 ops: sign then verify */
-
-#ifndef OPENSSL_NO_ECX
-enum { R_EC_Ed25519,
-    R_EC_Ed448,
-    EdDSA_NUM };
-static const OPT_PAIR eddsa_choices[EdDSA_NUM] = {
-    { "ed25519", R_EC_Ed25519 },
-    { "ed448", R_EC_Ed448 }
-
-};
-static double eddsa_results[EdDSA_NUM][2]; /* 2 ops: sign then verify */
-#endif /* OPENSSL_NO_ECX */
-
-#ifndef OPENSSL_NO_SM2
-enum { R_EC_CURVESM2,
-    SM2_NUM };
-static const OPT_PAIR sm2_choices[SM2_NUM] = {
-    { "curveSM2", R_EC_CURVESM2 }
-};
-#define SM2_ID "TLSv1.3+GM+Cipher+Suite"
-#define SM2_ID_LEN sizeof("TLSv1.3+GM+Cipher+Suite") - 1
-static double sm2_results[SM2_NUM][2]; /* 2 ops: sign then verify */
-#endif /* OPENSSL_NO_SM2 */
+static double ecdsa_results[EC_NUM][2]; /* 2 ops: sign then verify */

 #define MAX_KEM_NUM 111
 static size_t kems_algs_len = 0;
@@ -619,18 +615,12 @@ typedef struct loopargs_st {
     EVP_PKEY_CTX *dsa_sign_ctx[DSA_NUM];
     EVP_PKEY_CTX *dsa_verify_ctx[DSA_NUM];
 #endif
-    EVP_PKEY_CTX *ecdsa_sign_ctx[ECDSA_NUM];
-    EVP_PKEY_CTX *ecdsa_verify_ctx[ECDSA_NUM];
+    const char *curve_name[EC_NUM];
     EVP_PKEY_CTX *ecdh_ctx[EC_NUM];
-#ifndef OPENSSL_NO_ECX
-    EVP_MD_CTX *eddsa_ctx[EdDSA_NUM];
-    EVP_MD_CTX *eddsa_ctx2[EdDSA_NUM];
-#endif /* OPENSSL_NO_ECX */
-#ifndef OPENSSL_NO_SM2
-    EVP_MD_CTX *sm2_ctx[SM2_NUM];
-    EVP_MD_CTX *sm2_vfy_ctx[SM2_NUM];
-    EVP_PKEY *sm2_pkey[SM2_NUM];
-#endif
+    EVP_PKEY_CTX *pk_sign_ctx[EC_NUM];
+    EVP_PKEY_CTX *pk_verify_ctx[EC_NUM];
+    EVP_MD_CTX *md_sign_ctx[EC_NUM];
+    EVP_MD_CTX *md_verify_ctx[EC_NUM];
     unsigned char *secret_a;
     unsigned char *secret_b;
     size_t outlen[EC_NUM];
@@ -984,7 +974,7 @@ static int EVP_Update_loop(void *args)
         rc = EVP_EncryptFinal_ex(ctx, buf, &outl);

     if (rc == 0)
-        BIO_printf(bio_err, "Error finalizing cipher loop\n");
+        BIO_puts(bio_err, "Error finalizing cipher loop\n");
     return count;
 }

@@ -1009,7 +999,7 @@ static int EVP_Update_loop_aead_enc(void *args)
         if (mode_op != EVP_CIPH_SIV_MODE) {
             if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN,
                     sizeof(aead_iv), NULL)) {
-                BIO_printf(bio_err, "\nFailed to set iv length\n");
+                BIO_puts(bio_err, "\nFailed to set iv length\n");
                 dofail();
                 exit(1);
             }
@@ -1020,13 +1010,13 @@ static int EVP_Update_loop_aead_enc(void *args)
             && mode_op != EVP_CIPH_GCM_SIV_MODE) {
             if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG,
                     TAG_LEN, NULL)) {
-                BIO_printf(bio_err, "\nFailed to set tag length\n");
+                BIO_puts(bio_err, "\nFailed to set tag length\n");
                 dofail();
                 exit(1);
             }
         }
         if (!EVP_CipherInit_ex(ctx, NULL, NULL, key, aead_iv, -1)) {
-            BIO_printf(bio_err, "\nFailed to set key and iv\n");
+            BIO_puts(bio_err, "\nFailed to set key and iv\n");
             dofail();
             exit(1);
         }
@@ -1034,20 +1024,20 @@ static int EVP_Update_loop_aead_enc(void *args)
         if (mode_op == EVP_CIPH_CCM_MODE) {
             if (!EVP_EncryptUpdate(ctx, NULL, &outl,
                     NULL, lengths[testnum])) {
-                BIO_printf(bio_err, "\nCouldn't set input text length\n");
+                BIO_puts(bio_err, "\nCouldn't set input text length\n");
                 dofail();
                 exit(1);
             }
         }
         if (aead) {
             if (!EVP_EncryptUpdate(ctx, NULL, &outl, aad, sizeof(aad))) {
-                BIO_printf(bio_err, "\nCouldn't insert AAD when encrypting\n");
+                BIO_puts(bio_err, "\nCouldn't insert AAD when encrypting\n");
                 dofail();
                 exit(1);
             }
         }
         if (!EVP_EncryptUpdate(ctx, buf, &outl, buf, lengths[testnum])) {
-            BIO_printf(bio_err, "\nFailed to encrypt the data\n");
+            BIO_puts(bio_err, "\nFailed to encrypt the data\n");
             dofail();
             exit(1);
         }
@@ -1081,7 +1071,7 @@ static int EVP_Update_loop_aead_dec(void *args)
         if (mode_op != EVP_CIPH_SIV_MODE) {
             if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN,
                     sizeof(aead_iv), NULL)) {
-                BIO_printf(bio_err, "\nFailed to set iv length\n");
+                BIO_puts(bio_err, "\nFailed to set iv length\n");
                 dofail();
                 exit(1);
             }
@@ -1093,20 +1083,20 @@ static int EVP_Update_loop_aead_dec(void *args)
             && mode_op != EVP_CIPH_GCM_SIV_MODE) {
             if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG,
                     TAG_LEN, NULL)) {
-                BIO_printf(bio_err, "\nFailed to set tag length\n");
+                BIO_puts(bio_err, "\nFailed to set tag length\n");
                 dofail();
                 exit(1);
             }
         }
         if (!EVP_CipherInit_ex(ctx, NULL, NULL, key, aead_iv, -1)) {
-            BIO_printf(bio_err, "\nFailed to set key and iv\n");
+            BIO_puts(bio_err, "\nFailed to set key and iv\n");
             dofail();
             exit(1);
         }
         /* Set iv before decryption (Doesn't apply to SIV mode) */
         if (mode_op != EVP_CIPH_SIV_MODE) {
             if (!EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, aead_iv)) {
-                BIO_printf(bio_err, "\nFailed to set iv\n");
+                BIO_puts(bio_err, "\nFailed to set iv\n");
                 dofail();
                 exit(1);
             }
@@ -1115,7 +1105,7 @@ static int EVP_Update_loop_aead_dec(void *args)

         if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG,
                 TAG_LEN, tag)) {
-            BIO_printf(bio_err, "\nFailed to set tag\n");
+            BIO_puts(bio_err, "\nFailed to set tag\n");
             dofail();
             exit(1);
         }
@@ -1123,20 +1113,20 @@ static int EVP_Update_loop_aead_dec(void *args)
         if (mode_op == EVP_CIPH_CCM_MODE) {
             if (!EVP_DecryptUpdate(ctx, NULL, &outl,
                     NULL, lengths[testnum])) {
-                BIO_printf(bio_err, "\nCouldn't set cipher text length\n");
+                BIO_puts(bio_err, "\nCouldn't set cipher text length\n");
                 dofail();
                 exit(1);
             }
         }
         if (aead) {
             if (!EVP_DecryptUpdate(ctx, NULL, &outl, aad, sizeof(aad))) {
-                BIO_printf(bio_err, "\nCouldn't insert AAD when decrypting\n");
+                BIO_puts(bio_err, "\nCouldn't insert AAD when decrypting\n");
                 dofail();
                 exit(1);
             }
         }
         if (!EVP_DecryptUpdate(ctx, outbuf, &outl, buf, lengths[testnum])) {
-            BIO_printf(bio_err, "\nFailed to decrypt the data\n");
+            BIO_puts(bio_err, "\nFailed to decrypt the data\n");
             dofail();
             exit(1);
         }
@@ -1159,7 +1149,7 @@ static int RSA_sign_loop(void *args)
         *rsa_num = tempargs->buflen;
         ret = EVP_PKEY_sign(rsa_sign_ctx[testnum], buf2, rsa_num, buf, 36);
         if (ret <= 0) {
-            BIO_printf(bio_err, "RSA sign failure\n");
+            BIO_puts(bio_err, "RSA sign failure\n");
             dofail();
             count = -1;
             break;
@@ -1180,7 +1170,7 @@ static int RSA_verify_loop(void *args)
     for (count = 0; COND(rsa_c[testnum][1]); count++) {
         ret = EVP_PKEY_verify(rsa_verify_ctx[testnum], buf2, rsa_num, buf, 36);
         if (ret <= 0) {
-            BIO_printf(bio_err, "RSA verify failure\n");
+            BIO_puts(bio_err, "RSA verify failure\n");
             dofail();
             count = -1;
             break;
@@ -1202,7 +1192,7 @@ static int RSA_encrypt_loop(void *args)
         *rsa_num = tempargs->buflen;
         ret = EVP_PKEY_encrypt(rsa_encrypt_ctx[testnum], buf2, rsa_num, buf, 36);
         if (ret <= 0) {
-            BIO_printf(bio_err, "RSA encrypt failure\n");
+            BIO_puts(bio_err, "RSA encrypt failure\n");
             dofail();
             count = -1;
             break;
@@ -1224,7 +1214,7 @@ static int RSA_decrypt_loop(void *args)
         rsa_num = tempargs->buflen;
         ret = EVP_PKEY_decrypt(rsa_decrypt_ctx[testnum], buf, &rsa_num, buf2, tempargs->encsize);
         if (ret <= 0) {
-            BIO_printf(bio_err, "RSA decrypt failure\n");
+            BIO_puts(bio_err, "RSA decrypt failure\n");
             dofail();
             count = -1;
             break;
@@ -1266,7 +1256,7 @@ static int DSA_sign_loop(void *args)
         *dsa_num = tempargs->buflen;
         ret = EVP_PKEY_sign(dsa_sign_ctx[testnum], buf2, dsa_num, buf, 20);
         if (ret <= 0) {
-            BIO_printf(bio_err, "DSA sign failure\n");
+            BIO_puts(bio_err, "DSA sign failure\n");
             dofail();
             count = -1;
             break;
@@ -1287,7 +1277,7 @@ static int DSA_verify_loop(void *args)
     for (count = 0; COND(dsa_c[testnum][1]); count++) {
         ret = EVP_PKEY_verify(dsa_verify_ctx[testnum], buf2, dsa_num, buf, 20);
         if (ret <= 0) {
-            BIO_printf(bio_err, "DSA verify failure\n");
+            BIO_puts(bio_err, "DSA verify failure\n");
             dofail();
             count = -1;
             break;
@@ -1302,15 +1292,21 @@ static int ECDSA_sign_loop(void *args)
     loopargs_t *tempargs = *(loopargs_t **)args;
     unsigned char *buf = tempargs->buf;
     unsigned char *buf2 = tempargs->buf2;
-    size_t *ecdsa_num = &tempargs->sigsize;
-    EVP_PKEY_CTX **ecdsa_sign_ctx = tempargs->ecdsa_sign_ctx;
+    size_t *sigsize = &tempargs->sigsize;
+    EVP_PKEY_CTX *pctx = tempargs->pk_sign_ctx[testnum];
+    EVP_MD_CTX *mctx = tempargs->md_sign_ctx[testnum];
+    const char *curve_name = tempargs->curve_name[testnum];
     int ret, count;

     for (count = 0; COND(ecdsa_c[testnum][0]); count++) {
-        *ecdsa_num = tempargs->buflen;
-        ret = EVP_PKEY_sign(ecdsa_sign_ctx[testnum], buf2, ecdsa_num, buf, 20);
+        *sigsize = tempargs->buflen;
+        if (pctx != NULL)
+            ret = EVP_PKEY_sign(pctx, buf2, sigsize, buf, 20);
+        else
+            ret = EVP_DigestSignInit_ex(mctx, NULL, NULL, NULL, NULL, NULL, NULL)
+                && EVP_DigestSign(mctx, buf2, sigsize, buf, 20);
         if (ret <= 0) {
-            BIO_printf(bio_err, "ECDSA sign failure\n");
+            BIO_printf(bio_err, "%s sign failure\n", curve_name);
             dofail();
             count = -1;
             break;
@@ -1324,15 +1320,20 @@ static int ECDSA_verify_loop(void *args)
     loopargs_t *tempargs = *(loopargs_t **)args;
     unsigned char *buf = tempargs->buf;
     unsigned char *buf2 = tempargs->buf2;
-    size_t ecdsa_num = tempargs->sigsize;
-    EVP_PKEY_CTX **ecdsa_verify_ctx = tempargs->ecdsa_verify_ctx;
+    size_t sigsize = tempargs->sigsize;
+    EVP_PKEY_CTX *pctx = tempargs->pk_verify_ctx[testnum];
+    EVP_MD_CTX *mctx = tempargs->md_verify_ctx[testnum];
+    const char *curve_name = tempargs->curve_name[testnum];
     int ret, count;

     for (count = 0; COND(ecdsa_c[testnum][1]); count++) {
-        ret = EVP_PKEY_verify(ecdsa_verify_ctx[testnum], buf2, ecdsa_num,
-            buf, 20);
+        if (pctx != NULL)
+            ret = EVP_PKEY_verify(pctx, buf2, sigsize, buf, 20);
+        else
+            ret = EVP_DigestVerifyInit_ex(mctx, NULL, NULL, NULL, NULL, NULL, NULL)
+                && EVP_DigestVerify(mctx, buf2, sigsize, buf, 20);
         if (ret <= 0) {
-            BIO_printf(bio_err, "ECDSA verify failure\n");
+            BIO_printf(bio_err, "%s verify failure\n", curve_name);
             dofail();
             count = -1;
             break;
@@ -1357,132 +1358,6 @@ static int ECDH_EVP_derive_key_loop(void *args)
     return count;
 }

-#ifndef OPENSSL_NO_ECX
-static int EdDSA_sign_loop(void *args)
-{
-    loopargs_t *tempargs = *(loopargs_t **)args;
-    unsigned char *buf = tempargs->buf;
-    EVP_MD_CTX **edctx = tempargs->eddsa_ctx;
-    unsigned char *eddsasig = tempargs->buf2;
-    size_t *eddsasigsize = &tempargs->sigsize;
-    int ret, count;
-
-    for (count = 0; COND(eddsa_c[testnum][0]); count++) {
-        ret = EVP_DigestSignInit(edctx[testnum], NULL, NULL, NULL, NULL);
-        if (ret == 0) {
-            BIO_printf(bio_err, "EdDSA sign init failure\n");
-            dofail();
-            count = -1;
-            break;
-        }
-        ret = EVP_DigestSign(edctx[testnum], eddsasig, eddsasigsize, buf, 20);
-        if (ret == 0) {
-            BIO_printf(bio_err, "EdDSA sign failure\n");
-            dofail();
-            count = -1;
-            break;
-        }
-    }
-    return count;
-}
-
-static int EdDSA_verify_loop(void *args)
-{
-    loopargs_t *tempargs = *(loopargs_t **)args;
-    unsigned char *buf = tempargs->buf;
-    EVP_MD_CTX **edctx = tempargs->eddsa_ctx2;
-    unsigned char *eddsasig = tempargs->buf2;
-    size_t eddsasigsize = tempargs->sigsize;
-    int ret, count;
-
-    for (count = 0; COND(eddsa_c[testnum][1]); count++) {
-        ret = EVP_DigestVerifyInit(edctx[testnum], NULL, NULL, NULL, NULL);
-        if (ret == 0) {
-            BIO_printf(bio_err, "EdDSA verify init failure\n");
-            dofail();
-            count = -1;
-            break;
-        }
-        ret = EVP_DigestVerify(edctx[testnum], eddsasig, eddsasigsize, buf, 20);
-        if (ret != 1) {
-            BIO_printf(bio_err, "EdDSA verify failure\n");
-            dofail();
-            count = -1;
-            break;
-        }
-    }
-    return count;
-}
-#endif /* OPENSSL_NO_ECX */
-
-#ifndef OPENSSL_NO_SM2
-static int SM2_sign_loop(void *args)
-{
-    loopargs_t *tempargs = *(loopargs_t **)args;
-    unsigned char *buf = tempargs->buf;
-    EVP_MD_CTX **sm2ctx = tempargs->sm2_ctx;
-    unsigned char *sm2sig = tempargs->buf2;
-    size_t sm2sigsize;
-    int ret, count;
-    EVP_PKEY **sm2_pkey = tempargs->sm2_pkey;
-    const size_t max_size = EVP_PKEY_get_size(sm2_pkey[testnum]);
-
-    for (count = 0; COND(sm2_c[testnum][0]); count++) {
-        sm2sigsize = max_size;
-
-        if (!EVP_DigestSignInit(sm2ctx[testnum], NULL, EVP_sm3(),
-                NULL, sm2_pkey[testnum])) {
-            BIO_printf(bio_err, "SM2 init sign failure\n");
-            dofail();
-            count = -1;
-            break;
-        }
-        ret = EVP_DigestSign(sm2ctx[testnum], sm2sig, &sm2sigsize,
-            buf, 20);
-        if (ret == 0) {
-            BIO_printf(bio_err, "SM2 sign failure\n");
-            dofail();
-            count = -1;
-            break;
-        }
-        /* update the latest returned size and always use the fixed buffer size */
-        tempargs->sigsize = sm2sigsize;
-    }
-
-    return count;
-}
-
-static int SM2_verify_loop(void *args)
-{
-    loopargs_t *tempargs = *(loopargs_t **)args;
-    unsigned char *buf = tempargs->buf;
-    EVP_MD_CTX **sm2ctx = tempargs->sm2_vfy_ctx;
-    unsigned char *sm2sig = tempargs->buf2;
-    size_t sm2sigsize = tempargs->sigsize;
-    int ret, count;
-    EVP_PKEY **sm2_pkey = tempargs->sm2_pkey;
-
-    for (count = 0; COND(sm2_c[testnum][1]); count++) {
-        if (!EVP_DigestVerifyInit(sm2ctx[testnum], NULL, EVP_sm3(),
-                NULL, sm2_pkey[testnum])) {
-            BIO_printf(bio_err, "SM2 verify init failure\n");
-            dofail();
-            count = -1;
-            break;
-        }
-        ret = EVP_DigestVerify(sm2ctx[testnum], sm2sig, sm2sigsize,
-            buf, 20);
-        if (ret != 1) {
-            BIO_printf(bio_err, "SM2 verify failure\n");
-            dofail();
-            count = -1;
-            break;
-        }
-    }
-    return count;
-}
-#endif /* OPENSSL_NO_SM2 */
-
 static int KEM_keygen_loop(void *args)
 {
     loopargs_t *tempargs = *(loopargs_t **)args;
@@ -1611,7 +1486,7 @@ static int check_block_size(EVP_CIPHER_CTX *ctx, int length)
     int blocksize = EVP_CIPHER_CTX_get_block_size(ctx);

     if (ciph == NULL || blocksize <= 0) {
-        BIO_printf(bio_err, "\nInvalid cipher!\n");
+        BIO_puts(bio_err, "\nInvalid cipher!\n");
         return 0;
     }
     if (length % blocksize != 0) {
@@ -1657,7 +1532,7 @@ static int run_benchmark(int async_jobs,
             break;
         case ASYNC_NO_JOBS:
         case ASYNC_ERR:
-            BIO_printf(bio_err, "Failure in the job\n");
+            BIO_puts(bio_err, "Failure in the job\n");
             dofail();
             error = 1;
             break;
@@ -1680,7 +1555,7 @@ static int run_benchmark(int async_jobs,

             if (!ASYNC_WAIT_CTX_get_all_fds(loopargs[i].wait_ctx, NULL, &num_job_fds)
                 || num_job_fds > 1) {
-                BIO_printf(bio_err, "Too many fds in ASYNC_WAIT_CTX\n");
+                BIO_puts(bio_err, "Too many fds in ASYNC_WAIT_CTX\n");
                 dofail();
                 error = 1;
                 break;
@@ -1707,7 +1582,7 @@ static int run_benchmark(int async_jobs,
             continue;

         if (select_result == -1) {
-            BIO_printf(bio_err, "Failure in the select\n");
+            BIO_puts(bio_err, "Failure in the select\n");
             dofail();
             error = 1;
             break;
@@ -1723,7 +1598,7 @@ static int run_benchmark(int async_jobs,

             if (!ASYNC_WAIT_CTX_get_all_fds(loopargs[i].wait_ctx, NULL, &num_job_fds)
                 || num_job_fds > 1) {
-                BIO_printf(bio_err, "Too many fds in ASYNC_WAIT_CTX\n");
+                BIO_puts(bio_err, "Too many fds in ASYNC_WAIT_CTX\n");
                 dofail();
                 error = 1;
                 break;
@@ -1761,7 +1636,7 @@ static int run_benchmark(int async_jobs,
             case ASYNC_ERR:
                 --num_inprogress;
                 loopargs[i].inprogress_job = NULL;
-                BIO_printf(bio_err, "Failure in the job\n");
+                BIO_puts(bio_err, "Failure in the job\n");
                 dofail();
                 error = 1;
                 break;
@@ -1773,79 +1648,33 @@ static int run_benchmark(int async_jobs,
 }

 typedef struct ec_curve_st {
-    const char *name;
-    unsigned int nid;
+    const char *algor;
+    char *group_name;
+    size_t group_name_size;
+    int mdsig;
     unsigned int bits;
-    size_t sigsize; /* only used for EdDSA curves */
 } EC_CURVE;

+#define EC_CURVE_NAME(c) ((c).group_name ? (c).group_name : (c).algor)
+
 static EVP_PKEY *get_ecdsa(const EC_CURVE *curve)
 {
     EVP_PKEY_CTX *kctx = NULL;
     EVP_PKEY *key = NULL;
+    OSSL_PARAM param[] = {
+        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME, NULL, 0),
+        OSSL_PARAM_END,
+    };

-    /* Ensure that the error queue is empty */
-    if (ERR_peek_error()) {
-        BIO_printf(bio_err,
-            "WARNING: the error queue contains previous unhandled errors.\n");
-        dofail();
-    }
-
-    /*
-     * Let's try to create a ctx directly from the NID: this works for
-     * curves like Curve25519 that are not implemented through the low
-     * level EC interface.
-     * If this fails we try creating a EVP_PKEY_EC generic param ctx,
-     * then we set the curve by NID before deriving the actual keygen
-     * ctx for that specific curve.
-     */
-    kctx = EVP_PKEY_CTX_new_id(curve->nid, NULL);
-    if (kctx == NULL) {
-        EVP_PKEY_CTX *pctx = NULL;
-        EVP_PKEY *params = NULL;
-        /*
-         * If we reach this code EVP_PKEY_CTX_new_id() failed and a
-         * "int_ctx_new:unsupported algorithm" error was added to the
-         * error queue.
-         * We remove it from the error queue as we are handling it.
-         */
-        unsigned long error = ERR_peek_error();
-
-        if (error == ERR_peek_last_error() /* oldest and latest errors match */
-            /* check that the error origin matches */
-            && ERR_GET_LIB(error) == ERR_LIB_EVP
-            && (ERR_GET_REASON(error) == EVP_R_UNSUPPORTED_ALGORITHM
-                || ERR_GET_REASON(error) == ERR_R_UNSUPPORTED))
-            ERR_get_error(); /* pop error from queue */
-        if (ERR_peek_error()) {
-            BIO_printf(bio_err,
-                "Unhandled error in the error queue during EC key setup.\n");
-            dofail();
-            return NULL;
-        }
-
-        /* Create the context for parameter generation */
-        if ((pctx = EVP_PKEY_CTX_new_from_name(NULL, "EC", NULL)) == NULL
-            || EVP_PKEY_paramgen_init(pctx) <= 0
-            || EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx,
-                   curve->nid)
-                <= 0
-            || EVP_PKEY_paramgen(pctx, &params) <= 0) {
-            BIO_printf(bio_err, "EC params init failure.\n");
-            dofail();
-            EVP_PKEY_CTX_free(pctx);
-            return NULL;
-        }
-        EVP_PKEY_CTX_free(pctx);
+    param[0].data = curve->group_name;
+    param[0].data_size = curve->group_name_size;

-        /* Create the context for the key generation */
-        kctx = EVP_PKEY_CTX_new(params, NULL);
-        EVP_PKEY_free(params);
-    }
-    if (kctx == NULL
+    /* Create the context for parameter generation */
+    if ((kctx = EVP_PKEY_CTX_new_from_name(NULL, curve->algor, NULL)) == NULL
         || EVP_PKEY_keygen_init(kctx) <= 0
+        || (param[0].data_size > 0 && !EVP_PKEY_CTX_set_params(kctx, param))
         || EVP_PKEY_keygen(kctx, &key) <= 0) {
-        BIO_printf(bio_err, "EC key generation failure.\n");
+        BIO_printf(bio_err, "%s key generation failure.\n", curve->group_name);
         dofail();
         key = NULL;
     }
@@ -1899,6 +1728,8 @@ static void collect_kem(EVP_KEM *kem, void *stack)
 static int kem_locate(const char *algo, unsigned int *idx)
 {
     unsigned int i;
+    EVP_KEM *kem;
+    const char *canonical_name;

     for (i = 0; i < kems_algs_len; i++) {
         if (strcmp(kems_algname[i], algo) == 0) {
@@ -1906,6 +1737,20 @@ static int kem_locate(const char *algo, unsigned int *idx)
             return 1;
         }
     }
+    ERR_set_mark();
+    kem = EVP_KEM_fetch(app_get0_libctx(), algo, app_get0_propq());
+    ERR_pop_to_mark();
+    if (kem != NULL) {
+        canonical_name = EVP_KEM_get0_name(kem);
+        for (i = 0; i < kems_algs_len; i++) {
+            if (strcmp(kems_algname[i], canonical_name) == 0) {
+                *idx = i;
+                EVP_KEM_free(kem);
+                return 1;
+            }
+        }
+        EVP_KEM_free(kem);
+    }
     return 0;
 }

@@ -1931,6 +1776,8 @@ static void collect_signatures(EVP_SIGNATURE *sig, void *stack)
 static int sig_locate(const char *algo, unsigned int *idx)
 {
     unsigned int i;
+    EVP_SIGNATURE *sig;
+    const char *canonical_name;

     for (i = 0; i < sigs_algs_len; i++) {
         if (strcmp(sigs_algname[i], algo) == 0) {
@@ -1938,6 +1785,20 @@ static int sig_locate(const char *algo, unsigned int *idx)
             return 1;
         }
     }
+    ERR_set_mark();
+    sig = EVP_SIGNATURE_fetch(app_get0_libctx(), algo, app_get0_propq());
+    ERR_pop_to_mark();
+    if (sig != NULL) {
+        canonical_name = EVP_SIGNATURE_get0_name(sig);
+        for (i = 0; i < sigs_algs_len; i++) {
+            if (strcmp(sigs_algname[i], canonical_name) == 0) {
+                *idx = i;
+                EVP_SIGNATURE_free(sig);
+                return 1;
+            }
+        }
+        EVP_SIGNATURE_free(sig);
+    }
     return 0;
 }

@@ -1955,10 +1816,8 @@ static int get_max(const uint8_t doit[], size_t algs_len)
 int speed_main(int argc, char **argv)
 {
     CONF *conf = NULL;
-    ENGINE *e = NULL;
     loopargs_t *loopargs = NULL;
     const char *prog;
-    const char *engine_id = NULL;
     EVP_CIPHER *evp_cipher = NULL;
     EVP_MAC *mac = NULL;
     double d = 0.0;
@@ -1981,11 +1840,16 @@ int speed_main(int argc, char **argv)
     int multi = 0;
 #endif
     long op_count = 1;
-    openssl_speed_sec_t seconds = { SECONDS, RSA_SECONDS, DSA_SECONDS,
-        ECDSA_SECONDS, ECDH_SECONDS,
-        EdDSA_SECONDS, SM2_SECONDS,
-        FFDH_SECONDS, KEM_SECONDS,
-        SIG_SECONDS };
+    openssl_speed_sec_t seconds = {
+        SECONDS,
+        RSA_SECONDS,
+        DSA_SECONDS,
+        ECDSA_SECONDS,
+        ECDH_SECONDS,
+        FFDH_SECONDS,
+        KEM_SECONDS,
+        SIG_SECONDS,
+    };

     static const unsigned char key32[32] = {
         0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
@@ -2040,58 +1904,47 @@ int speed_main(int argc, char **argv)
      * the following arrays and increase the |ecdh_choices| and |ecdsa_choices|
      * lists accordingly.
      */
+#define STRSZ(lit) (lit), (sizeof(lit))
     static const EC_CURVE ec_curves[EC_NUM] = {
         /* Prime Curves */
-        { "secp160r1", NID_secp160r1, 160 },
-        { "nistp192", NID_X9_62_prime192v1, 192 },
-        { "nistp224", NID_secp224r1, 224 },
-        { "nistp256", NID_X9_62_prime256v1, 256 },
-        { "nistp384", NID_secp384r1, 384 },
-        { "nistp521", NID_secp521r1, 521 },
+        { "EC", STRSZ("secp160r1"), 0, 160 },
+        { "EC", STRSZ("prime192v1"), 0, 192 },
+        { "EC", STRSZ("secp224r1"), 0, 224 },
+        { "EC", STRSZ("prime256v1"), 0, 256 },
+        { "EC", STRSZ("secp384r1"), 0, 384 },
+        { "EC", STRSZ("secp521r1"), 0, 521 },
 #ifndef OPENSSL_NO_EC2M
         /* Binary Curves */
-        { "nistk163", NID_sect163k1, 163 },
-        { "nistk233", NID_sect233k1, 233 },
-        { "nistk283", NID_sect283k1, 283 },
-        { "nistk409", NID_sect409k1, 409 },
-        { "nistk571", NID_sect571k1, 571 },
-        { "nistb163", NID_sect163r2, 163 },
-        { "nistb233", NID_sect233r1, 233 },
-        { "nistb283", NID_sect283r1, 283 },
-        { "nistb409", NID_sect409r1, 409 },
-        { "nistb571", NID_sect571r1, 571 },
+        { "EC", STRSZ("sect163k1"), 0, 163 },
+        { "EC", STRSZ("sect233k1"), 0, 233 },
+        { "EC", STRSZ("sect283k1"), 0, 283 },
+        { "EC", STRSZ("sect409k1"), 0, 409 },
+        { "EC", STRSZ("sect571k1"), 0, 571 },
+        { "EC", STRSZ("sect163r2"), 0, 163 },
+        { "EC", STRSZ("sect233r1"), 0, 233 },
+        { "EC", STRSZ("sect283r1"), 0, 283 },
+        { "EC", STRSZ("sect409r1"), 0, 409 },
+        { "EC", STRSZ("sect571r1"), 0, 571 },
 #endif
-        { "brainpoolP256r1", NID_brainpoolP256r1, 256 },
-        { "brainpoolP256t1", NID_brainpoolP256t1, 256 },
-        { "brainpoolP384r1", NID_brainpoolP384r1, 384 },
-        { "brainpoolP384t1", NID_brainpoolP384t1, 384 },
-        { "brainpoolP512r1", NID_brainpoolP512r1, 512 },
-        { "brainpoolP512t1", NID_brainpoolP512t1, 512 },
+        { "EC", STRSZ("brainpoolP256r1"), 0, 256 },
+        { "EC", STRSZ("brainpoolP256t1"), 0, 256 },
+        { "EC", STRSZ("brainpoolP384r1"), 0, 384 },
+        { "EC", STRSZ("brainpoolP384t1"), 0, 384 },
+        { "EC", STRSZ("brainpoolP512r1"), 0, 512 },
+        { "EC", STRSZ("brainpoolP512t1"), 0, 512 },
 #ifndef OPENSSL_NO_ECX
-        /* Other and ECDH only ones */
-        { "X25519", NID_X25519, 253 },
-        { "X448", NID_X448, 448 }
+        { "Ed25519", NULL, 0, 1, 253 },
+        { "Ed448", NULL, 0, 1, 456 },
+        { "X25519", NULL, 0, -1, 253 },
+        { "X448", NULL, 0, -1, 448 },
 #endif
-    };
-#ifndef OPENSSL_NO_ECX
-    static const EC_CURVE ed_curves[EdDSA_NUM] = {
-        /* EdDSA */
-        { "Ed25519", NID_ED25519, 253, 64 },
-        { "Ed448", NID_ED448, 456, 114 }
-    };
-#endif /* OPENSSL_NO_ECX */
 #ifndef OPENSSL_NO_SM2
-    static const EC_CURVE sm2_curves[SM2_NUM] = {
-        /* SM2 */
-        { "CurveSM2", NID_sm2, 256 }
-    };
-    uint8_t sm2_doit[SM2_NUM] = { 0 };
+        { "SM2", STRSZ("SM2"), 1, 256 },
+        { "curveSM2", STRSZ("SM2"), -1, 256 },
 #endif
-    uint8_t ecdsa_doit[ECDSA_NUM] = { 0 };
+    };
+    uint8_t ecdsa_doit[EC_NUM] = { 0 };
     uint8_t ecdh_doit[EC_NUM] = { 0 };
-#ifndef OPENSSL_NO_ECX
-    uint8_t eddsa_doit[EdDSA_NUM] = { 0 };
-#endif /* OPENSSL_NO_ECX */

     uint8_t kems_doit[MAX_KEM_NUM] = { 0 };
     uint8_t sigs_doit[MAX_SIG_NUM] = { 0 };
@@ -2099,23 +1952,6 @@ int speed_main(int argc, char **argv)
     uint8_t do_kems = 0;
     uint8_t do_sigs = 0;

-    /* checks declared curves against choices list. */
-#ifndef OPENSSL_NO_ECX
-    OPENSSL_assert(ed_curves[EdDSA_NUM - 1].nid == NID_ED448);
-    OPENSSL_assert(strcmp(eddsa_choices[EdDSA_NUM - 1].name, "ed448") == 0);
-
-    OPENSSL_assert(ec_curves[EC_NUM - 1].nid == NID_X448);
-    OPENSSL_assert(strcmp(ecdh_choices[EC_NUM - 1].name, "ecdhx448") == 0);
-
-    OPENSSL_assert(ec_curves[ECDSA_NUM - 1].nid == NID_brainpoolP512t1);
-    OPENSSL_assert(strcmp(ecdsa_choices[ECDSA_NUM - 1].name, "ecdsabrp512t1") == 0);
-#endif /* OPENSSL_NO_ECX */
-
-#ifndef OPENSSL_NO_SM2
-    OPENSSL_assert(sm2_curves[SM2_NUM - 1].nid == NID_sm2);
-    OPENSSL_assert(strcmp(sm2_choices[SM2_NUM - 1].name, "curveSM2") == 0);
-#endif
-
     prog = opt_init(argc, argv, speed_options);
     while ((o = opt_next()) != OPT_EOF) {
         switch (o) {
@@ -2172,14 +2008,6 @@ int speed_main(int argc, char **argv)
         case OPT_DECRYPT:
             decrypt = 1;
             break;
-        case OPT_ENGINE:
-            /*
-             * In a forked execution, an engine might need to be
-             * initialised by each child process, not by the parent.
-             * So store the name here and run setup_engine() later on.
-             */
-            engine_id = opt_arg();
-            break;
         case OPT_MULTI:
 #ifndef NO_FORK
             multi = opt_int_arg();
@@ -2245,9 +2073,8 @@ int speed_main(int argc, char **argv)
             break;
         case OPT_SECONDS:
             seconds.sym = seconds.rsa = seconds.dsa = seconds.ecdsa
-                = seconds.ecdh = seconds.eddsa
-                = seconds.sm2 = seconds.ffdh
-                = seconds.kem = seconds.sig = opt_int_arg();
+                = seconds.ecdh = seconds.ffdh = seconds.kem
+                = seconds.sig = opt_int_arg();
             break;
         case OPT_BYTES:
             lengths_single = opt_int_arg();
@@ -2289,7 +2116,7 @@ int speed_main(int argc, char **argv)

         if (strcmp(EVP_KEM_get0_name(kem), "RSA") == 0) {
             if (kems_algs_len + OSSL_NELEM(rsa_choices) >= MAX_KEM_NUM) {
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "Too many KEMs registered. Change MAX_KEM_NUM.\n");
                 goto end;
             }
@@ -2299,7 +2126,7 @@ int speed_main(int argc, char **argv)
             }
         } else if (strcmp(EVP_KEM_get0_name(kem), "EC") == 0) {
             if (kems_algs_len + 3 >= MAX_KEM_NUM) {
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "Too many KEMs registered. Change MAX_KEM_NUM.\n");
                 goto end;
             }
@@ -2311,7 +2138,7 @@ int speed_main(int argc, char **argv)
             kems_algname[kems_algs_len++] = OPENSSL_strdup("ECP-521");
         } else {
             if (kems_algs_len + 1 >= MAX_KEM_NUM) {
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "Too many KEMs registered. Change MAX_KEM_NUM.\n");
                 goto end;
             }
@@ -2334,7 +2161,7 @@ int speed_main(int argc, char **argv)

         if (strcmp(sig_name, "RSA") == 0) {
             if (sigs_algs_len + OSSL_NELEM(rsa_choices) >= MAX_SIG_NUM) {
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "Too many signatures registered. Change MAX_SIG_NUM.\n");
                 goto end;
             }
@@ -2346,7 +2173,7 @@ int speed_main(int argc, char **argv)
 #ifndef OPENSSL_NO_DSA
         else if (strcmp(sig_name, "DSA") == 0) {
             if (sigs_algs_len + DSA_NUM >= MAX_SIG_NUM) {
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "Too many signatures registered. Change MAX_SIG_NUM.\n");
                 goto end;
             }
@@ -2357,9 +2184,18 @@ int speed_main(int argc, char **argv)
         }
 #endif /* OPENSSL_NO_DSA */
         /* skipping these algs as tested elsewhere - and b/o setup is a pain */
-        else if (strncmp(sig_name, "RSA", 3) && strncmp(sig_name, "DSA", 3) && strncmp(sig_name, "ED25519", 7) && strncmp(sig_name, "ED448", 5) && strncmp(sig_name, "ECDSA", 5) && strcmp(sig_name, "HMAC") && strcmp(sig_name, "SIPHASH") && strcmp(sig_name, "POLY1305") && strcmp(sig_name, "CMAC") && strcmp(sig_name, "SM2")) { /* skip alg */
+        else if (strncmp(sig_name, "RSA", 3)
+            && strncmp(sig_name, "DSA", 3)
+            && strncmp(sig_name, "ED25519", 7)
+            && strncmp(sig_name, "ED448", 5)
+            && strncmp(sig_name, "ECDSA", 5)
+            && strcmp(sig_name, "HMAC")
+            && strcmp(sig_name, "SIPHASH")
+            && strcmp(sig_name, "POLY1305")
+            && strcmp(sig_name, "CMAC")
+            && strcmp(sig_name, "SM2")) { /* skip alg */
             if (sigs_algs_len + 1 >= MAX_SIG_NUM) {
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "Too many signatures registered. Change MAX_SIG_NUM.\n");
                 goto end;
             }
@@ -2440,46 +2276,37 @@ int speed_main(int argc, char **argv)
             doit[D_CBC_128_CML] = doit[D_CBC_192_CML] = doit[D_CBC_256_CML] = 1;
             algo_found = 1;
         }
-        if (HAS_PREFIX(algo, "ecdsa")) {
-            if (algo[sizeof("ecdsa") - 1] == '\0') {
-                memset(ecdsa_doit, 1, sizeof(ecdsa_doit));
-                algo_found = 1;
-            }
-            if (opt_found(algo, ecdsa_choices, &i)) {
-                ecdsa_doit[i] = 2;
-                algo_found = 1;
-            }
-        }
-        if (HAS_PREFIX(algo, "ecdh")) {
-            if (algo[sizeof("ecdh") - 1] == '\0') {
-                memset(ecdh_doit, 1, sizeof(ecdh_doit));
-                algo_found = 1;
-            }
-            if (opt_found(algo, ecdh_choices, &i)) {
-                ecdh_doit[i] = 2;
-                algo_found = 1;
-            }
+        if (strcmp(algo, "ecdsa") == 0) {
+            memset(ecdsa_doit, 1, sizeof(ecdsa_doit));
+            algo_found = 1;
         }
-#ifndef OPENSSL_NO_ECX
-        if (strcmp(algo, "eddsa") == 0) {
-            memset(eddsa_doit, 1, sizeof(eddsa_doit));
+        if (strcmp(algo, "ecdh") == 0) {
+            memset(ecdh_doit, 1, sizeof(ecdh_doit));
             algo_found = 1;
         }
-        if (opt_found(algo, eddsa_choices, &i)) {
-            eddsa_doit[i] = 2;
+        for (i = 0; i < EC_NUM; i++) {
+            /* Negative values are ECDH-only curves */
+            if (ec_curves[i].mdsig < 0)
+                ecdsa_doit[i] = 0;
+            /* Positive values are signature-only curves */
+            if (ec_curves[i].mdsig > 0)
+                ecdh_doit[i] = 0;
+        }
+        if (opt_found(algo, ecdsa_choices, &i)) {
+            ecdsa_doit[i] = 2;
             algo_found = 1;
         }
-#endif /* OPENSSL_NO_ECX */
-#ifndef OPENSSL_NO_SM2
-        if (strcmp(algo, "sm2") == 0) {
-            memset(sm2_doit, 1, sizeof(sm2_doit));
+#ifndef OPENSSL_NO_ECX
+        if (strcmp(algo, "eddsa") == 0) {
             algo_found = 1;
+            ecdsa_doit[R_Ed25519] = 2;
+            ecdsa_doit[R_Ed448] = 2;
         }
-        if (opt_found(algo, sm2_choices, &i)) {
-            sm2_doit[i] = 2;
+#endif /* OPENSSL_NO_ECX */
+        if (opt_found(algo, ecdh_choices, &i)) {
+            ecdh_doit[i] = 2;
             algo_found = 1;
         }
-#endif
         if (kem_locate(algo, &idx)) {
             kems_doit[idx]++;
             do_kems = 1;
@@ -2508,7 +2335,7 @@ int speed_main(int argc, char **argv)
     /* Sanity checks */
     if (aead) {
         if (evp_cipher == NULL) {
-            BIO_printf(bio_err, "-aead can be used only with an AEAD cipher\n");
+            BIO_puts(bio_err, "-aead can be used only with an AEAD cipher\n");
             goto end;
         } else if (!(EVP_CIPHER_get_flags(evp_cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)) {
             BIO_printf(bio_err, "%s is not an AEAD cipher\n",
@@ -2540,15 +2367,15 @@ int speed_main(int argc, char **argv)
     }
     if (multiblock) {
         if (evp_cipher == NULL) {
-            BIO_printf(bio_err, "-mb can be used only with a multi-block"
-                                " capable cipher\n");
+            BIO_puts(bio_err, "-mb can be used only with a multi-block"
+                              " capable cipher\n");
             goto end;
         } else if (!(EVP_CIPHER_get_flags(evp_cipher) & EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK)) {
             BIO_printf(bio_err, "%s is not a multi-block capable\n",
                 EVP_CIPHER_get0_name(evp_cipher));
             goto end;
         } else if (async_jobs > 0) {
-            BIO_printf(bio_err, "Async mode is not supported with -mb");
+            BIO_puts(bio_err, "Async mode is not supported with -mb");
             goto end;
         }
     }
@@ -2557,20 +2384,20 @@ int speed_main(int argc, char **argv)
     if (async_jobs > 0) {
         async_init = ASYNC_init_thread(async_jobs, async_jobs);
         if (!async_init) {
-            BIO_printf(bio_err, "Error creating the ASYNC job pool\n");
+            BIO_puts(bio_err, "Error creating the ASYNC job pool\n");
             goto end;
         }
     }

     loopargs_len = (async_jobs == 0 ? 1 : async_jobs);
-    loopargs = app_malloc(loopargs_len * sizeof(loopargs_t), "array of loopargs");
+    loopargs = app_malloc_array(loopargs_len, sizeof(loopargs_t), "array of loopargs");
     memset(loopargs, 0, loopargs_len * sizeof(loopargs_t));

     buflen = lengths[size_num - 1];
     if (buflen < 36) /* size of random vector in RSA benchmark */
         buflen = 36;
     if (INT_MAX - (MAX_MISALIGNMENT + 1) < buflen) {
-        BIO_printf(bio_err, "Error: buffer size too large\n");
+        BIO_puts(bio_err, "Error: buffer size too large\n");
         goto end;
     }
     buflen += MAX_MISALIGNMENT + 1;
@@ -2578,7 +2405,7 @@ int speed_main(int argc, char **argv)
         if (async_jobs > 0) {
             loopargs[i].wait_ctx = ASYNC_WAIT_CTX_new();
             if (loopargs[i].wait_ctx == NULL) {
-                BIO_printf(bio_err, "Error creating the ASYNC_WAIT_CTX\n");
+                BIO_puts(bio_err, "Error creating the ASYNC_WAIT_CTX\n");
                 goto end;
             }
         }
@@ -2618,9 +2445,6 @@ int speed_main(int argc, char **argv)
         memset(loopargs[i].buf2_malloc, 0, buflen);
     }

-    /* Initialize the engine after the fork */
-    e = setup_engine(engine_id, 0);
-
     /* No parameters; turn on everything. */
     if (argc == 0 && !doit[D_EVP] && !doit[D_HMAC]
         && !doit[D_EVP_CMAC] && !do_kems && !do_sigs) {
@@ -2662,11 +2486,7 @@ int speed_main(int argc, char **argv)
 #ifndef OPENSSL_NO_ECX
         memset(ecdsa_doit, 1, sizeof(ecdsa_doit));
         memset(ecdh_doit, 1, sizeof(ecdh_doit));
-        memset(eddsa_doit, 1, sizeof(eddsa_doit));
 #endif /* OPENSSL_NO_ECX */
-#ifndef OPENSSL_NO_SM2
-        memset(sm2_doit, 1, sizeof(sm2_doit));
-#endif
         memset(kems_doit, 1, sizeof(kems_doit));
         do_kems = 1;
         memset(sigs_doit, 1, sizeof(sigs_doit));
@@ -2677,7 +2497,7 @@ int speed_main(int argc, char **argv)
             pr_header++;

     if (usertime == 0 && !mr)
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "You have chosen to measure elapsed time "
             "instead of user CPU time.\n");

@@ -2795,14 +2615,14 @@ int speed_main(int argc, char **argv)

     if (doit[D_HMAC]) {
         static const char hmac_key[] = "This is a key...";
-        int len = strlen(hmac_key);
+        int len = (int)strlen(hmac_key);
         size_t hmac_name_len = sizeof("hmac()") + strlen(evp_mac_mdname);
         OSSL_PARAM params[3];

         if (evp_mac_mdname == NULL)
             goto end;
         evp_hmac_name = app_malloc(hmac_name_len, "HMAC name");
-        BIO_snprintf(evp_hmac_name, hmac_name_len, "hmac(%s)", evp_mac_mdname);
+        snprintf(evp_hmac_name, hmac_name_len, "hmac(%s)", evp_mac_mdname);
         names[D_HMAC] = evp_hmac_name;

         params[0] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST,
@@ -3035,7 +2855,7 @@ int speed_main(int argc, char **argv)
                 for (k = 0; k < loopargs_len; k++) {
                     loopargs[k].ctx = EVP_CIPHER_CTX_new();
                     if (loopargs[k].ctx == NULL) {
-                        BIO_printf(bio_err, "\nEVP_CIPHER_CTX_new failure\n");
+                        BIO_puts(bio_err, "\nEVP_CIPHER_CTX_new failure\n");
                         exit(1);
                     }

@@ -3047,7 +2867,7 @@ int speed_main(int argc, char **argv)
                      */
                     if (!EVP_CipherInit_ex(loopargs[k].ctx, evp_cipher, NULL,
                             NULL, NULL, ae_mode ? 1 : !decrypt)) {
-                        BIO_printf(bio_err, "\nCouldn't init the context\n");
+                        BIO_puts(bio_err, "\nCouldn't init the context\n");
                         dofail();
                         exit(1);
                     }
@@ -3062,7 +2882,7 @@ int speed_main(int argc, char **argv)
                     if (!ae_mode) {
                         if (!EVP_CipherInit_ex(loopargs[k].ctx, NULL, NULL,
                                 loopargs[k].key, iv, -1)) {
-                            BIO_printf(bio_err, "\nFailed to set the key\n");
+                            BIO_puts(bio_err, "\nFailed to set the key\n");
                             dofail();
                             exit(1);
                         }
@@ -3077,7 +2897,7 @@ int speed_main(int argc, char **argv)
                             if (!EVP_CIPHER_CTX_ctrl(loopargs[k].ctx,
                                     EVP_CTRL_AEAD_SET_IVLEN,
                                     sizeof(aead_iv), NULL)) {
-                                BIO_printf(bio_err, "\nFailed to set iv length\n");
+                                BIO_puts(bio_err, "\nFailed to set iv length\n");
                                 dofail();
                                 exit(1);
                             }
@@ -3089,7 +2909,7 @@ int speed_main(int argc, char **argv)
                             if (!EVP_CIPHER_CTX_ctrl(loopargs[k].ctx,
                                     EVP_CTRL_AEAD_SET_TAG,
                                     TAG_LEN, NULL)) {
-                                BIO_printf(bio_err,
+                                BIO_puts(bio_err,
                                     "\nFailed to set tag length\n");
                                 dofail();
                                 exit(1);
@@ -3097,7 +2917,7 @@ int speed_main(int argc, char **argv)
                         }
                         if (!EVP_CipherInit_ex(loopargs[k].ctx, NULL, NULL,
                                 loopargs[k].key, aead_iv, -1)) {
-                            BIO_printf(bio_err, "\nFailed to set the key\n");
+                            BIO_puts(bio_err, "\nFailed to set the key\n");
                             dofail();
                             exit(1);
                         }
@@ -3106,7 +2926,7 @@ int speed_main(int argc, char **argv)
                             if (!EVP_EncryptUpdate(loopargs[k].ctx, NULL,
                                     &outlen, NULL,
                                     lengths[testnum])) {
-                                BIO_printf(bio_err,
+                                BIO_puts(bio_err,
                                     "\nCouldn't set input text length\n");
                                 dofail();
                                 exit(1);
@@ -3115,7 +2935,7 @@ int speed_main(int argc, char **argv)
                         if (aead) {
                             if (!EVP_EncryptUpdate(loopargs[k].ctx, NULL,
                                     &outlen, aad, sizeof(aad))) {
-                                BIO_printf(bio_err,
+                                BIO_puts(bio_err,
                                     "\nCouldn't insert AAD when encrypting\n");
                                 dofail();
                                 exit(1);
@@ -3124,15 +2944,15 @@ int speed_main(int argc, char **argv)
                         if (!EVP_EncryptUpdate(loopargs[k].ctx, loopargs[k].buf,
                                 &outlen, loopargs[k].buf,
                                 lengths[testnum])) {
-                            BIO_printf(bio_err,
-                                "\nFailed to to encrypt the data\n");
+                            BIO_puts(bio_err,
+                                "\nFailed to encrypt the data\n");
                             dofail();
                             exit(1);
                         }

                         if (!EVP_EncryptFinal_ex(loopargs[k].ctx,
                                 loopargs[k].buf, &outlen)) {
-                            BIO_printf(bio_err,
+                            BIO_puts(bio_err,
                                 "\nFailed finalize the encryption\n");
                             dofail();
                             exit(1);
@@ -3141,7 +2961,7 @@ int speed_main(int argc, char **argv)
                         if (EVP_CIPHER_CTX_ctrl(loopargs[k].ctx, EVP_CTRL_AEAD_GET_TAG,
                                 TAG_LEN, &loopargs[k].tag)
                             <= 0) {
-                            BIO_printf(bio_err, "\nFailed to get the tag\n");
+                            BIO_puts(bio_err, "\nFailed to get the tag\n");
                             dofail();
                             exit(1);
                         }
@@ -3149,7 +2969,7 @@ int speed_main(int argc, char **argv)
                         EVP_CIPHER_CTX_free(loopargs[k].ctx);
                         loopargs[k].ctx = EVP_CIPHER_CTX_new();
                         if (loopargs[k].ctx == NULL) {
-                            BIO_printf(bio_err,
+                            BIO_puts(bio_err,
                                 "\nEVP_CIPHER_CTX_new failure\n");
                             exit(1);
                         }
@@ -3206,11 +3026,11 @@ int speed_main(int argc, char **argv)
         keylen = EVP_CIPHER_get_key_length(cipher);
         EVP_CIPHER_free(cipher);
         if (keylen <= 0 || keylen > (int)sizeof(key32)) {
-            BIO_printf(bio_err, "\nRequested CMAC cipher with unsupported key length.\n");
+            BIO_puts(bio_err, "\nRequested CMAC cipher with unsupported key length.\n");
             goto end;
         }
         evp_cmac_name = app_malloc(len, "CMAC name");
-        BIO_snprintf(evp_cmac_name, len, "cmac(%s)", evp_mac_ciphername);
+        snprintf(evp_cmac_name, len, "cmac(%s)", evp_mac_ciphername);
         names[D_EVP_CMAC] = evp_cmac_name;

         params[0] = OSSL_PARAM_construct_utf8_string(OSSL_ALG_PARAM_CIPHER,
@@ -3291,7 +3111,7 @@ int speed_main(int argc, char **argv)
             bn = BN_new();
             st = bn != NULL
                 && BN_set_word(bn, RSA_F4)
-                && init_gen_str(&genctx, "RSA", NULL, 0, NULL, NULL)
+                && init_gen_str(&genctx, "RSA", 0, NULL, NULL)
                 && EVP_PKEY_CTX_set_rsa_keygen_bits(genctx, rsa_keys[testnum].bits) > 0
                 && EVP_PKEY_CTX_set1_rsa_keygen_pubexp(genctx, bn) > 0
                 && EVP_PKEY_CTX_set_rsa_keygen_primes(genctx, primes) > 0
@@ -3321,7 +3141,7 @@ int speed_main(int argc, char **argv)
                 st = 0;
         }
         if (!st) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "RSA sign setup failure.  No RSA sign will be done.\n");
             dofail();
             op_count = 1;
@@ -3333,8 +3153,7 @@ int speed_main(int argc, char **argv)
             count = run_benchmark(async_jobs, RSA_sign_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R1:%ld:%d:%.2f\n"
-                   : "%ld %u bits private RSA sign ops in %.2fs\n",
+                mr ? "+R1:%ld:%d:%.2f\n" : "%ld %u bits private RSA sign ops in %.2fs\n",
                 count, rsa_keys[testnum].bits, d);
             rsa_results[testnum][0] = (double)count / d;
             op_count = count;
@@ -3353,7 +3172,7 @@ int speed_main(int argc, char **argv)
                 st = 0;
         }
         if (!st) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "RSA verify setup failure.  No RSA verify will be done.\n");
             dofail();
             rsa_doit[testnum] = 0;
@@ -3364,8 +3183,7 @@ int speed_main(int argc, char **argv)
             count = run_benchmark(async_jobs, RSA_verify_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R2:%ld:%d:%.2f\n"
-                   : "%ld %u bits public RSA verify ops in %.2fs\n",
+                mr ? "+R2:%ld:%d:%.2f\n" : "%ld %u bits public RSA verify ops in %.2fs\n",
                 count, rsa_keys[testnum].bits, d);
             rsa_results[testnum][1] = (double)count / d;
         }
@@ -3383,7 +3201,7 @@ int speed_main(int argc, char **argv)
                 st = 0;
         }
         if (!st) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "RSA encrypt setup failure.  No RSA encrypt will be done.\n");
             dofail();
             op_count = 1;
@@ -3395,8 +3213,7 @@ int speed_main(int argc, char **argv)
             count = run_benchmark(async_jobs, RSA_encrypt_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R3:%ld:%d:%.2f\n"
-                   : "%ld %u bits public RSA encrypt ops in %.2fs\n",
+                mr ? "+R3:%ld:%d:%.2f\n" : "%ld %u bits public RSA encrypt ops in %.2fs\n",
                 count, rsa_keys[testnum].bits, d);
             rsa_results[testnum][2] = (double)count / d;
             op_count = count;
@@ -3416,7 +3233,7 @@ int speed_main(int argc, char **argv)
                 st = 0;
         }
         if (!st) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "RSA decrypt setup failure.  No RSA decrypt will be done.\n");
             dofail();
             op_count = 1;
@@ -3428,8 +3245,7 @@ int speed_main(int argc, char **argv)
             count = run_benchmark(async_jobs, RSA_decrypt_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R4:%ld:%d:%.2f\n"
-                   : "%ld %u bits private RSA decrypt ops in %.2fs\n",
+                mr ? "+R4:%ld:%d:%.2f\n" : "%ld %u bits private RSA decrypt ops in %.2fs\n",
                 count, rsa_keys[testnum].bits, d);
             rsa_results[testnum][3] = (double)count / d;
             op_count = count;
@@ -3466,7 +3282,7 @@ int speed_main(int argc, char **argv)
                 st = 0;
         }
         if (!st) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "DSA sign setup failure.  No DSA sign will be done.\n");
             dofail();
             op_count = 1;
@@ -3477,8 +3293,7 @@ int speed_main(int argc, char **argv)
             count = run_benchmark(async_jobs, DSA_sign_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R5:%ld:%u:%.2f\n"
-                   : "%ld %u bits DSA sign ops in %.2fs\n",
+                mr ? "+R5:%ld:%u:%.2f\n" : "%ld %u bits DSA sign ops in %.2fs\n",
                 count, dsa_bits[testnum], d);
             dsa_results[testnum][0] = (double)count / d;
             op_count = count;
@@ -3497,7 +3312,7 @@ int speed_main(int argc, char **argv)
                 st = 0;
         }
         if (!st) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "DSA verify setup failure.  No DSA verify will be done.\n");
             dofail();
             dsa_doit[testnum] = 0;
@@ -3508,8 +3323,7 @@ int speed_main(int argc, char **argv)
             count = run_benchmark(async_jobs, DSA_verify_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R6:%ld:%u:%.2f\n"
-                   : "%ld %u bits DSA verify ops in %.2fs\n",
+                mr ? "+R6:%ld:%u:%.2f\n" : "%ld %u bits DSA verify ops in %.2fs\n",
                 count, dsa_bits[testnum], d);
             dsa_results[testnum][1] = (double)count / d;
         }
@@ -3522,74 +3336,110 @@ int speed_main(int argc, char **argv)
     }
 #endif /* OPENSSL_NO_DSA */

-    for (testnum = 0; testnum < ECDSA_NUM; testnum++) {
-        EVP_PKEY *ecdsa_key = NULL;
+    for (testnum = 0; testnum < EC_NUM; testnum++) {
+        EVP_PKEY *pkey = NULL;
         int st;
+        int mdsig = ec_curves[testnum].mdsig > 0;

         if (!ecdsa_doit[testnum])
             continue;

-        st = (ecdsa_key = get_ecdsa(&ec_curves[testnum])) != NULL;
+        st = (pkey = get_ecdsa(&ec_curves[testnum])) != NULL;

         for (i = 0; st && i < loopargs_len; i++) {
-            loopargs[i].ecdsa_sign_ctx[testnum] = EVP_PKEY_CTX_new(ecdsa_key,
-                NULL);
             loopargs[i].sigsize = loopargs[i].buflen;
-            if (loopargs[i].ecdsa_sign_ctx[testnum] == NULL
-                || EVP_PKEY_sign_init(loopargs[i].ecdsa_sign_ctx[testnum]) <= 0
-                || EVP_PKEY_sign(loopargs[i].ecdsa_sign_ctx[testnum],
-                       loopargs[i].buf2,
-                       &loopargs[i].sigsize,
-                       loopargs[i].buf, 20)
-                    <= 0)
-                st = 0;
+            loopargs[i].curve_name[testnum] = EC_CURVE_NAME(ec_curves[testnum]);
+            if (!mdsig) {
+                EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new(pkey, NULL);
+
+                if ((loopargs[i].pk_sign_ctx[testnum] = pctx) == NULL
+                    || EVP_PKEY_sign_init(pctx) <= 0
+                    || EVP_PKEY_sign(pctx, loopargs[i].buf2,
+                           &loopargs[i].sigsize, loopargs[i].buf, 20)
+                        <= 0)
+                    st = 0;
+            } else {
+                OSSL_PARAM params[2] = {
+                    OSSL_PARAM_uint(OSSL_SIGNATURE_PARAM_TLS_VERSION, NULL),
+                    OSSL_PARAM_END,
+                };
+                EVP_MD_CTX *mctx = EVP_MD_CTX_new();
+                int v = TLS1_3_VERSION;
+
+                /*
+                 * Emulate TLS signature code, the TLS version is needed for
+                 * SM2 to infer the correct "distinguishing identifier".
+                 */
+                params[0].data = &v;
+                if ((loopargs[i].md_sign_ctx[testnum] = mctx) == NULL
+                    || !EVP_DigestSignInit_ex(mctx, NULL, NULL, NULL, NULL, pkey, params))
+                    st = 0;
+            }
         }
         if (!st) {
             BIO_printf(bio_err,
-                "ECDSA sign setup failure.  No ECDSA sign will be done.\n");
+                "%s sign setup failure.  No %s signing will be done.\n",
+                EC_CURVE_NAME(ec_curves[testnum]),
+                EC_CURVE_NAME(ec_curves[testnum]));
             dofail();
             op_count = 1;
         } else {
-            pkey_print_message("sign", "ecdsa",
+            pkey_print_message("sign", EC_CURVE_NAME(ec_curves[testnum]),
                 ec_curves[testnum].bits, seconds.ecdsa);
             Time_F(START);
             count = run_benchmark(async_jobs, ECDSA_sign_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R7:%ld:%u:%.2f\n"
-                   : "%ld %u bits ECDSA sign ops in %.2fs\n",
-                count, ec_curves[testnum].bits, d);
+                mr ? "+R7:%ld:%s:%.2f\n" : "%ld %s sign ops in %.2fs\n",
+                count, EC_CURVE_NAME(ec_curves[testnum]), d);
             ecdsa_results[testnum][0] = (double)count / d;
             op_count = count;
         }

         for (i = 0; st && i < loopargs_len; i++) {
-            loopargs[i].ecdsa_verify_ctx[testnum] = EVP_PKEY_CTX_new(ecdsa_key,
-                NULL);
-            if (loopargs[i].ecdsa_verify_ctx[testnum] == NULL
-                || EVP_PKEY_verify_init(loopargs[i].ecdsa_verify_ctx[testnum]) <= 0
-                || EVP_PKEY_verify(loopargs[i].ecdsa_verify_ctx[testnum],
-                       loopargs[i].buf2,
-                       loopargs[i].sigsize,
-                       loopargs[i].buf, 20)
-                    <= 0)
-                st = 0;
+            if (!mdsig) {
+                EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new(pkey, NULL);
+
+                if ((loopargs[i].pk_verify_ctx[testnum] = pctx) == NULL
+                    || EVP_PKEY_verify_init(pctx) <= 0
+                    || EVP_PKEY_verify(pctx, loopargs[i].buf2,
+                           loopargs[i].sigsize, loopargs[i].buf, 20)
+                        <= 0)
+                    st = 0;
+            } else {
+                OSSL_PARAM params[2] = {
+                    OSSL_PARAM_uint(OSSL_SIGNATURE_PARAM_TLS_VERSION, NULL),
+                    OSSL_PARAM_END,
+                };
+                EVP_MD_CTX *mctx = EVP_MD_CTX_new();
+                int v = TLS1_3_VERSION;
+
+                /*
+                 * Emulate TLS signature code, the TLS version is needed for
+                 * SM2 to infer the correct "distinguishing identifier".
+                 */
+                params[0].data = &v;
+                if ((loopargs[i].md_verify_ctx[testnum] = mctx) == NULL
+                    || !EVP_DigestVerifyInit_ex(mctx, NULL, NULL, NULL, NULL, pkey, params))
+                    st = 0;
+            }
         }
         if (!st) {
             BIO_printf(bio_err,
-                "ECDSA verify setup failure.  No ECDSA verify will be done.\n");
+                "%s verify setup failure.  No %s verification will be done.\n",
+                EC_CURVE_NAME(ec_curves[testnum]),
+                EC_CURVE_NAME(ec_curves[testnum]));
             dofail();
             ecdsa_doit[testnum] = 0;
         } else {
-            pkey_print_message("verify", "ecdsa",
+            pkey_print_message("verify", EC_CURVE_NAME(ec_curves[testnum]),
                 ec_curves[testnum].bits, seconds.ecdsa);
             Time_F(START);
             count = run_benchmark(async_jobs, ECDSA_verify_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R8:%ld:%u:%.2f\n"
-                   : "%ld %u bits ECDSA verify ops in %.2fs\n",
-                count, ec_curves[testnum].bits, d);
+                mr ? "+R8:%ld:%s:%.2f\n" : "%ld %s verify ops in %.2fs\n",
+                count, EC_CURVE_NAME(ec_curves[testnum]), d);
             ecdsa_results[testnum][1] = (double)count / d;
         }

@@ -3597,7 +3447,7 @@ int speed_main(int argc, char **argv)
             /* if longer than 10s, don't do any more */
             stop_it(ecdsa_doit, testnum);
         }
-        EVP_PKEY_free(ecdsa_key);
+        EVP_PKEY_free(pkey);
     }

     for (testnum = 0; testnum < EC_NUM; testnum++) {
@@ -3623,7 +3473,7 @@ int speed_main(int argc, char **argv)
                 || outlen == 0 /* ensure outlen is a valid size */
                 || outlen > MAX_ECDH_SIZE /* avoid buffer overflow */) {
                 ecdh_checks = 0;
-                BIO_printf(bio_err, "ECDH key generation failure.\n");
+                BIO_puts(bio_err, "ECDH key generation failure.\n");
                 dofail();
                 op_count = 1;
                 break;
@@ -3643,7 +3493,7 @@ int speed_main(int argc, char **argv)
                 || EVP_PKEY_derive(test_ctx, loopargs[i].secret_b, &test_outlen) <= 0 /* compute b*A */
                 || test_outlen != outlen /* compare output length */) {
                 ecdh_checks = 0;
-                BIO_printf(bio_err, "ECDH computation failure.\n");
+                BIO_puts(bio_err, "ECDH computation failure.\n");
                 dofail();
                 op_count = 1;
                 break;
@@ -3653,7 +3503,7 @@ int speed_main(int argc, char **argv)
             if (CRYPTO_memcmp(loopargs[i].secret_a,
                     loopargs[i].secret_b, outlen)) {
                 ecdh_checks = 0;
-                BIO_printf(bio_err, "ECDH computations don't match.\n");
+                BIO_puts(bio_err, "ECDH computations don't match.\n");
                 dofail();
                 op_count = 1;
                 break;
@@ -3668,14 +3518,14 @@ int speed_main(int argc, char **argv)
             test_ctx = NULL;
         }
         if (ecdh_checks != 0) {
-            pkey_print_message("", "ecdh",
+            pkey_print_message("", EC_CURVE_NAME(ec_curves[testnum]),
                 ec_curves[testnum].bits, seconds.ecdh);
             Time_F(START);
             count = run_benchmark(async_jobs, ECDH_EVP_derive_key_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R9:%ld:%d:%.2f\n" : "%ld %u-bits ECDH ops in %.2fs\n", count,
-                ec_curves[testnum].bits, d);
+                mr ? "+R9:%ld:%s:%.2f\n" : "%ld %s ops in %.2fs\n",
+                count, EC_CURVE_NAME(ec_curves[testnum]), d);
             ecdh_results[testnum][0] = (double)count / d;
             op_count = count;
         }
@@ -3686,254 +3536,6 @@ int speed_main(int argc, char **argv)
         }
     }

-#ifndef OPENSSL_NO_ECX
-    for (testnum = 0; testnum < EdDSA_NUM; testnum++) {
-        int st = 1;
-        EVP_PKEY *ed_pkey = NULL;
-        EVP_PKEY_CTX *ed_pctx = NULL;
-
-        if (!eddsa_doit[testnum])
-            continue; /* Ignore Curve */
-        for (i = 0; i < loopargs_len; i++) {
-            loopargs[i].eddsa_ctx[testnum] = EVP_MD_CTX_new();
-            if (loopargs[i].eddsa_ctx[testnum] == NULL) {
-                st = 0;
-                break;
-            }
-            loopargs[i].eddsa_ctx2[testnum] = EVP_MD_CTX_new();
-            if (loopargs[i].eddsa_ctx2[testnum] == NULL) {
-                st = 0;
-                break;
-            }
-
-            if ((ed_pctx = EVP_PKEY_CTX_new_id(ed_curves[testnum].nid,
-                     NULL))
-                    == NULL
-                || EVP_PKEY_keygen_init(ed_pctx) <= 0
-                || EVP_PKEY_keygen(ed_pctx, &ed_pkey) <= 0) {
-                st = 0;
-                EVP_PKEY_CTX_free(ed_pctx);
-                break;
-            }
-            EVP_PKEY_CTX_free(ed_pctx);
-
-            if (!EVP_DigestSignInit(loopargs[i].eddsa_ctx[testnum], NULL, NULL,
-                    NULL, ed_pkey)) {
-                st = 0;
-                EVP_PKEY_free(ed_pkey);
-                break;
-            }
-            if (!EVP_DigestVerifyInit(loopargs[i].eddsa_ctx2[testnum], NULL,
-                    NULL, NULL, ed_pkey)) {
-                st = 0;
-                EVP_PKEY_free(ed_pkey);
-                break;
-            }
-
-            EVP_PKEY_free(ed_pkey);
-            ed_pkey = NULL;
-        }
-        if (st == 0) {
-            BIO_printf(bio_err, "EdDSA failure.\n");
-            dofail();
-            op_count = 1;
-        } else {
-            for (i = 0; i < loopargs_len; i++) {
-                /* Perform EdDSA signature test */
-                loopargs[i].sigsize = ed_curves[testnum].sigsize;
-                st = EVP_DigestSign(loopargs[i].eddsa_ctx[testnum],
-                    loopargs[i].buf2, &loopargs[i].sigsize,
-                    loopargs[i].buf, 20);
-                if (st == 0)
-                    break;
-            }
-            if (st == 0) {
-                BIO_printf(bio_err,
-                    "EdDSA sign failure.  No EdDSA sign will be done.\n");
-                dofail();
-                op_count = 1;
-            } else {
-                pkey_print_message("sign", ed_curves[testnum].name,
-                    ed_curves[testnum].bits, seconds.eddsa);
-                Time_F(START);
-                count = run_benchmark(async_jobs, EdDSA_sign_loop, loopargs);
-                d = Time_F(STOP);
-
-                BIO_printf(bio_err,
-                    mr ? "+R10:%ld:%u:%s:%.2f\n" : "%ld %u bits %s sign ops in %.2fs \n",
-                    count, ed_curves[testnum].bits,
-                    ed_curves[testnum].name, d);
-                eddsa_results[testnum][0] = (double)count / d;
-                op_count = count;
-            }
-            /* Perform EdDSA verification test */
-            for (i = 0; i < loopargs_len; i++) {
-                st = EVP_DigestVerify(loopargs[i].eddsa_ctx2[testnum],
-                    loopargs[i].buf2, loopargs[i].sigsize,
-                    loopargs[i].buf, 20);
-                if (st != 1)
-                    break;
-            }
-            if (st != 1) {
-                BIO_printf(bio_err,
-                    "EdDSA verify failure.  No EdDSA verify will be done.\n");
-                dofail();
-                eddsa_doit[testnum] = 0;
-            } else {
-                pkey_print_message("verify", ed_curves[testnum].name,
-                    ed_curves[testnum].bits, seconds.eddsa);
-                Time_F(START);
-                count = run_benchmark(async_jobs, EdDSA_verify_loop, loopargs);
-                d = Time_F(STOP);
-                BIO_printf(bio_err,
-                    mr ? "+R11:%ld:%u:%s:%.2f\n"
-                       : "%ld %u bits %s verify ops in %.2fs\n",
-                    count, ed_curves[testnum].bits,
-                    ed_curves[testnum].name, d);
-                eddsa_results[testnum][1] = (double)count / d;
-            }
-
-            if (op_count <= 1) {
-                /* if longer than 10s, don't do any more */
-                stop_it(eddsa_doit, testnum);
-            }
-        }
-    }
-#endif /* OPENSSL_NO_ECX */
-
-#ifndef OPENSSL_NO_SM2
-    for (testnum = 0; testnum < SM2_NUM; testnum++) {
-        int st = 1;
-        EVP_PKEY *sm2_pkey = NULL;
-
-        if (!sm2_doit[testnum])
-            continue; /* Ignore Curve */
-        /* Init signing and verification */
-        for (i = 0; i < loopargs_len; i++) {
-            EVP_PKEY_CTX *sm2_pctx = NULL;
-            EVP_PKEY_CTX *sm2_vfy_pctx = NULL;
-            EVP_PKEY_CTX *pctx = NULL;
-            st = 0;
-
-            loopargs[i].sm2_ctx[testnum] = EVP_MD_CTX_new();
-            loopargs[i].sm2_vfy_ctx[testnum] = EVP_MD_CTX_new();
-            if (loopargs[i].sm2_ctx[testnum] == NULL
-                || loopargs[i].sm2_vfy_ctx[testnum] == NULL)
-                break;
-
-            sm2_pkey = NULL;
-
-            st = !((pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_SM2, NULL)) == NULL
-                || EVP_PKEY_keygen_init(pctx) <= 0
-                || EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx,
-                       sm2_curves[testnum].nid)
-                    <= 0
-                || EVP_PKEY_keygen(pctx, &sm2_pkey) <= 0);
-            EVP_PKEY_CTX_free(pctx);
-            if (st == 0)
-                break;
-
-            st = 0; /* set back to zero */
-            /* attach it sooner to rely on main final cleanup */
-            loopargs[i].sm2_pkey[testnum] = sm2_pkey;
-            loopargs[i].sigsize = EVP_PKEY_get_size(sm2_pkey);
-
-            sm2_pctx = EVP_PKEY_CTX_new(sm2_pkey, NULL);
-            sm2_vfy_pctx = EVP_PKEY_CTX_new(sm2_pkey, NULL);
-            if (sm2_pctx == NULL || sm2_vfy_pctx == NULL) {
-                EVP_PKEY_CTX_free(sm2_vfy_pctx);
-                break;
-            }
-
-            /* attach them directly to respective ctx */
-            EVP_MD_CTX_set_pkey_ctx(loopargs[i].sm2_ctx[testnum], sm2_pctx);
-            EVP_MD_CTX_set_pkey_ctx(loopargs[i].sm2_vfy_ctx[testnum], sm2_vfy_pctx);
-
-            /*
-             * No need to allow user to set an explicit ID here, just use
-             * the one defined in the 'draft-yang-tls-tl13-sm-suites' I-D.
-             */
-            if (EVP_PKEY_CTX_set1_id(sm2_pctx, SM2_ID, SM2_ID_LEN) != 1
-                || EVP_PKEY_CTX_set1_id(sm2_vfy_pctx, SM2_ID, SM2_ID_LEN) != 1)
-                break;
-
-            if (!EVP_DigestSignInit(loopargs[i].sm2_ctx[testnum], NULL,
-                    EVP_sm3(), NULL, sm2_pkey))
-                break;
-            if (!EVP_DigestVerifyInit(loopargs[i].sm2_vfy_ctx[testnum], NULL,
-                    EVP_sm3(), NULL, sm2_pkey))
-                break;
-            st = 1; /* mark loop as succeeded */
-        }
-        if (st == 0) {
-            BIO_printf(bio_err, "SM2 init failure.\n");
-            dofail();
-            op_count = 1;
-        } else {
-            for (i = 0; i < loopargs_len; i++) {
-                /* Perform SM2 signature test */
-                st = EVP_DigestSign(loopargs[i].sm2_ctx[testnum],
-                    loopargs[i].buf2, &loopargs[i].sigsize,
-                    loopargs[i].buf, 20);
-                if (st == 0)
-                    break;
-            }
-            if (st == 0) {
-                BIO_printf(bio_err,
-                    "SM2 sign failure.  No SM2 sign will be done.\n");
-                dofail();
-                op_count = 1;
-            } else {
-                pkey_print_message("sign", sm2_curves[testnum].name,
-                    sm2_curves[testnum].bits, seconds.sm2);
-                Time_F(START);
-                count = run_benchmark(async_jobs, SM2_sign_loop, loopargs);
-                d = Time_F(STOP);
-
-                BIO_printf(bio_err,
-                    mr ? "+R12:%ld:%u:%s:%.2f\n" : "%ld %u bits %s sign ops in %.2fs \n",
-                    count, sm2_curves[testnum].bits,
-                    sm2_curves[testnum].name, d);
-                sm2_results[testnum][0] = (double)count / d;
-                op_count = count;
-            }
-
-            /* Perform SM2 verification test */
-            for (i = 0; i < loopargs_len; i++) {
-                st = EVP_DigestVerify(loopargs[i].sm2_vfy_ctx[testnum],
-                    loopargs[i].buf2, loopargs[i].sigsize,
-                    loopargs[i].buf, 20);
-                if (st != 1)
-                    break;
-            }
-            if (st != 1) {
-                BIO_printf(bio_err,
-                    "SM2 verify failure.  No SM2 verify will be done.\n");
-                dofail();
-                sm2_doit[testnum] = 0;
-            } else {
-                pkey_print_message("verify", sm2_curves[testnum].name,
-                    sm2_curves[testnum].bits, seconds.sm2);
-                Time_F(START);
-                count = run_benchmark(async_jobs, SM2_verify_loop, loopargs);
-                d = Time_F(STOP);
-                BIO_printf(bio_err,
-                    mr ? "+R13:%ld:%u:%s:%.2f\n"
-                       : "%ld %u bits %s verify ops in %.2fs\n",
-                    count, sm2_curves[testnum].bits,
-                    sm2_curves[testnum].name, d);
-                sm2_results[testnum][1] = (double)count / d;
-            }
-
-            if (op_count <= 1) {
-                /* if longer than 10s, don't do any more */
-                for (testnum++; testnum < SM2_NUM; testnum++)
-                    sm2_doit[testnum] = 0;
-            }
-        }
-    }
-#endif /* OPENSSL_NO_SM2 */
-
 #ifndef OPENSSL_NO_DH
     for (testnum = 0; testnum < FFDH_NUM; testnum++) {
         int ffdh_checks = 1;
@@ -3951,14 +3553,14 @@ int speed_main(int argc, char **argv)

             /* Ensure that the error queue is empty */
             if (ERR_peek_error()) {
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "WARNING: the error queue contains previous unhandled errors.\n");
                 dofail();
             }

             pkey_A = EVP_PKEY_new();
             if (!pkey_A) {
-                BIO_printf(bio_err, "Error while initialising EVP_PKEY (out of memory?).\n");
+                BIO_puts(bio_err, "Error while initialising EVP_PKEY (out of memory?).\n");
                 dofail();
                 op_count = 1;
                 ffdh_checks = 0;
@@ -3966,7 +3568,7 @@ int speed_main(int argc, char **argv)
             }
             pkey_B = EVP_PKEY_new();
             if (!pkey_B) {
-                BIO_printf(bio_err, "Error while initialising EVP_PKEY (out of memory?).\n");
+                BIO_puts(bio_err, "Error while initialising EVP_PKEY (out of memory?).\n");
                 dofail();
                 op_count = 1;
                 ffdh_checks = 0;
@@ -3975,7 +3577,7 @@ int speed_main(int argc, char **argv)

             ffdh_ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_DH, NULL);
             if (!ffdh_ctx) {
-                BIO_printf(bio_err, "Error while allocating EVP_PKEY_CTX.\n");
+                BIO_puts(bio_err, "Error while allocating EVP_PKEY_CTX.\n");
                 dofail();
                 op_count = 1;
                 ffdh_checks = 0;
@@ -3983,14 +3585,14 @@ int speed_main(int argc, char **argv)
             }

             if (EVP_PKEY_keygen_init(ffdh_ctx) <= 0) {
-                BIO_printf(bio_err, "Error while initialising EVP_PKEY_CTX.\n");
+                BIO_puts(bio_err, "Error while initialising EVP_PKEY_CTX.\n");
                 dofail();
                 op_count = 1;
                 ffdh_checks = 0;
                 break;
             }
             if (EVP_PKEY_CTX_set_dh_nid(ffdh_ctx, ffdh_params[testnum].nid) <= 0) {
-                BIO_printf(bio_err, "Error setting DH key size for keygen.\n");
+                BIO_puts(bio_err, "Error setting DH key size for keygen.\n");
                 dofail();
                 op_count = 1;
                 ffdh_checks = 0;
@@ -3998,7 +3600,7 @@ int speed_main(int argc, char **argv)
             }

             if (EVP_PKEY_keygen(ffdh_ctx, &pkey_A) <= 0 || EVP_PKEY_keygen(ffdh_ctx, &pkey_B) <= 0) {
-                BIO_printf(bio_err, "FFDH key generation failure.\n");
+                BIO_puts(bio_err, "FFDH key generation failure.\n");
                 dofail();
                 op_count = 1;
                 ffdh_checks = 0;
@@ -4014,35 +3616,35 @@ int speed_main(int argc, char **argv)
              */
             ffdh_ctx = EVP_PKEY_CTX_new(pkey_A, NULL);
             if (ffdh_ctx == NULL) {
-                BIO_printf(bio_err, "Error while allocating EVP_PKEY_CTX.\n");
+                BIO_puts(bio_err, "Error while allocating EVP_PKEY_CTX.\n");
                 dofail();
                 op_count = 1;
                 ffdh_checks = 0;
                 break;
             }
             if (EVP_PKEY_derive_init(ffdh_ctx) <= 0) {
-                BIO_printf(bio_err, "FFDH derivation context init failure.\n");
+                BIO_puts(bio_err, "FFDH derivation context init failure.\n");
                 dofail();
                 op_count = 1;
                 ffdh_checks = 0;
                 break;
             }
             if (EVP_PKEY_derive_set_peer(ffdh_ctx, pkey_B) <= 0) {
-                BIO_printf(bio_err, "Assigning peer key for derivation failed.\n");
+                BIO_puts(bio_err, "Assigning peer key for derivation failed.\n");
                 dofail();
                 op_count = 1;
                 ffdh_checks = 0;
                 break;
             }
             if (EVP_PKEY_derive(ffdh_ctx, NULL, &secret_size) <= 0) {
-                BIO_printf(bio_err, "Checking size of shared secret failed.\n");
+                BIO_puts(bio_err, "Checking size of shared secret failed.\n");
                 dofail();
                 op_count = 1;
                 ffdh_checks = 0;
                 break;
             }
             if (secret_size > MAX_FFDH_SIZE) {
-                BIO_printf(bio_err, "Assertion failure: shared secret too large.\n");
+                BIO_puts(bio_err, "Assertion failure: shared secret too large.\n");
                 op_count = 1;
                 ffdh_checks = 0;
                 break;
@@ -4051,7 +3653,7 @@ int speed_main(int argc, char **argv)
                     loopargs[i].secret_ff_a,
                     &secret_size)
                 <= 0) {
-                BIO_printf(bio_err, "Shared secret derive failure.\n");
+                BIO_puts(bio_err, "Shared secret derive failure.\n");
                 dofail();
                 op_count = 1;
                 ffdh_checks = 0;
@@ -4060,14 +3662,14 @@ int speed_main(int argc, char **argv)
             /* Now check from side B */
             test_ctx = EVP_PKEY_CTX_new(pkey_B, NULL);
             if (!test_ctx) {
-                BIO_printf(bio_err, "Error while allocating EVP_PKEY_CTX.\n");
+                BIO_puts(bio_err, "Error while allocating EVP_PKEY_CTX.\n");
                 dofail();
                 op_count = 1;
                 ffdh_checks = 0;
                 break;
             }
             if (EVP_PKEY_derive_init(test_ctx) <= 0 || EVP_PKEY_derive_set_peer(test_ctx, pkey_A) <= 0 || EVP_PKEY_derive(test_ctx, NULL, &test_out) <= 0 || EVP_PKEY_derive(test_ctx, loopargs[i].secret_ff_b, &test_out) <= 0 || test_out != secret_size) {
-                BIO_printf(bio_err, "FFDH computation failure.\n");
+                BIO_puts(bio_err, "FFDH computation failure.\n");
                 op_count = 1;
                 ffdh_checks = 0;
                 break;
@@ -4076,7 +3678,7 @@ int speed_main(int argc, char **argv)
             /* compare the computed secrets */
             if (CRYPTO_memcmp(loopargs[i].secret_ff_a,
                     loopargs[i].secret_ff_b, secret_size)) {
-                BIO_printf(bio_err, "FFDH computations don't match.\n");
+                BIO_puts(bio_err, "FFDH computations don't match.\n");
                 dofail();
                 op_count = 1;
                 ffdh_checks = 0;
@@ -4150,7 +3752,7 @@ int speed_main(int argc, char **argv)
                 kem_type = 0;

             if (ERR_peek_error()) {
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "WARNING: the error queue contains previous unhandled errors.\n");
                 dofail();
             }
@@ -4179,7 +3781,7 @@ int speed_main(int argc, char **argv)
                 goto kem_err_break;
             }
             if (EVP_PKEY_keygen(kem_gen_ctx, &pkey) <= 0) {
-                BIO_printf(bio_err, "Error while generating KEM EVP_PKEY.\n");
+                BIO_puts(bio_err, "Error while generating KEM EVP_PKEY.\n");
                 goto kem_err_break;
             }
             /* Now prepare encaps data structs */
@@ -4273,8 +3875,8 @@ int speed_main(int argc, char **argv)
             count = run_benchmark(async_jobs, KEM_keygen_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R15:%ld:%s:%.2f\n" : "%ld %s KEM keygen ops in %.2fs\n", count,
-                kem_name, d);
+                mr ? "+R15:%ld:%s:%.2f\n" : "%ld %s KEM keygen ops in %.2fs\n",
+                count, kem_name, d);
             kems_results[testnum][0] = (double)count / d;
             op_count = count;
             kskey_print_message(kem_name, "encaps", seconds.kem);
@@ -4282,8 +3884,8 @@ int speed_main(int argc, char **argv)
             count = run_benchmark(async_jobs, KEM_encaps_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R16:%ld:%s:%.2f\n" : "%ld %s KEM encaps ops in %.2fs\n", count,
-                kem_name, d);
+                mr ? "+R16:%ld:%s:%.2f\n" : "%ld %s KEM encaps ops in %.2fs\n",
+                count, kem_name, d);
             kems_results[testnum][1] = (double)count / d;
             op_count = count;
             kskey_print_message(kem_name, "decaps", seconds.kem);
@@ -4291,8 +3893,8 @@ int speed_main(int argc, char **argv)
             count = run_benchmark(async_jobs, KEM_decaps_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R17:%ld:%s:%.2f\n" : "%ld %s KEM decaps ops in %.2fs\n", count,
-                kem_name, d);
+                mr ? "+R17:%ld:%s:%.2f\n" : "%ld %s KEM decaps ops in %.2fs\n",
+                count, kem_name, d);
             kems_results[testnum][2] = (double)count / d;
             op_count = count;
         }
@@ -4330,7 +3932,7 @@ int speed_main(int argc, char **argv)
             memset(md, 0, SHA256_DIGEST_LENGTH);

             if (ERR_peek_error()) {
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "WARNING: the error queue contains previous unhandled errors.\n");
                 dofail();
             }
@@ -4344,11 +3946,15 @@ int speed_main(int argc, char **argv)
             }

             if (strncmp(sig_name, "dsa", 3) == 0) {
+                int dsa_nbits = 0;
+
+                if (!opt_int(sig_name + 3, &dsa_nbits))
+                    goto sig_err_break;
                 ctx_params = EVP_PKEY_CTX_new_id(EVP_PKEY_DSA, NULL);
                 if (ctx_params == NULL
                     || EVP_PKEY_paramgen_init(ctx_params) <= 0
                     || EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx_params,
-                           atoi(sig_name + 3))
+                           dsa_nbits)
                         <= 0
                     || EVP_PKEY_paramgen(ctx_params, &pkey_params) <= 0
                     || (sig_gen_ctx = EVP_PKEY_CTX_new(pkey_params, NULL)) == NULL
@@ -4484,8 +4090,8 @@ int speed_main(int argc, char **argv)
             count = run_benchmark(async_jobs, SIG_keygen_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R18:%ld:%s:%.2f\n" : "%ld %s signature keygen ops in %.2fs\n", count,
-                sig_name, d);
+                mr ? "+R18:%ld:%s:%.2f\n" : "%ld %s signature keygen ops in %.2fs\n",
+                count, sig_name, d);
             sigs_results[testnum][0] = (double)count / d;
             op_count = count;
             kskey_print_message(sig_name, "signs", seconds.sig);
@@ -4493,8 +4099,8 @@ int speed_main(int argc, char **argv)
             count = run_benchmark(async_jobs, SIG_sign_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R19:%ld:%s:%.2f\n" : "%ld %s signature sign ops in %.2fs\n", count,
-                sig_name, d);
+                mr ? "+R19:%ld:%s:%.2f\n" : "%ld %s signature sign ops in %.2fs\n",
+                count, sig_name, d);
             sigs_results[testnum][1] = (double)count / d;
             op_count = count;

@@ -4503,8 +4109,8 @@ int speed_main(int argc, char **argv)
             count = run_benchmark(async_jobs, SIG_verify_loop, loopargs);
             d = Time_F(STOP);
             BIO_printf(bio_err,
-                mr ? "+R20:%ld:%s:%.2f\n" : "%ld %s signature verify ops in %.2fs\n", count,
-                sig_name, d);
+                mr ? "+R20:%ld:%s:%.2f\n" : "%ld %s signature verify ops in %.2fs\n",
+                count, sig_name, d);
             sigs_results[testnum][2] = (double)count / d;
             op_count = count;
         }
@@ -4612,8 +4218,8 @@ show_res:
                 k, ec_curves[k].bits,
                 ecdsa_results[k][0], ecdsa_results[k][1]);
         else
-            printf("%4u bits ecdsa (%s) %8.4fs %8.4fs %8.1f %8.1f\n",
-                ec_curves[k].bits, ec_curves[k].name,
+            printf("%4u bits EC (%s) %8.4fs %8.4fs %8.1f %8.1f\n",
+                ec_curves[k].bits, EC_CURVE_NAME(ec_curves[k]),
                 1.0 / ecdsa_results[k][0], 1.0 / ecdsa_results[k][1],
                 ecdsa_results[k][0], ecdsa_results[k][1]);
     }
@@ -4633,53 +4239,10 @@ show_res:

         else
             printf("%4u bits ecdh (%s) %8.4fs %8.1f\n",
-                ec_curves[k].bits, ec_curves[k].name,
+                ec_curves[k].bits, EC_CURVE_NAME(ec_curves[k]),
                 1.0 / ecdh_results[k][0], ecdh_results[k][0]);
     }

-#ifndef OPENSSL_NO_ECX
-    testnum = 1;
-    for (k = 0; k < OSSL_NELEM(eddsa_doit); k++) {
-        if (!eddsa_doit[k])
-            continue;
-        if (testnum && !mr) {
-            printf("%30ssign    verify    sign/s verify/s\n", " ");
-            testnum = 0;
-        }
-
-        if (mr)
-            printf("+F6:%u:%u:%s:%f:%f\n",
-                k, ed_curves[k].bits, ed_curves[k].name,
-                eddsa_results[k][0], eddsa_results[k][1]);
-        else
-            printf("%4u bits EdDSA (%s) %8.4fs %8.4fs %8.1f %8.1f\n",
-                ed_curves[k].bits, ed_curves[k].name,
-                1.0 / eddsa_results[k][0], 1.0 / eddsa_results[k][1],
-                eddsa_results[k][0], eddsa_results[k][1]);
-    }
-#endif /* OPENSSL_NO_ECX */
-
-#ifndef OPENSSL_NO_SM2
-    testnum = 1;
-    for (k = 0; k < OSSL_NELEM(sm2_doit); k++) {
-        if (!sm2_doit[k])
-            continue;
-        if (testnum && !mr) {
-            printf("%30ssign    verify    sign/s verify/s\n", " ");
-            testnum = 0;
-        }
-
-        if (mr)
-            printf("+F7:%u:%u:%s:%f:%f\n",
-                k, sm2_curves[k].bits, sm2_curves[k].name,
-                sm2_results[k][0], sm2_results[k][1]);
-        else
-            printf("%4u bits SM2 (%s) %8.4fs %8.4fs %8.1f %8.1f\n",
-                sm2_curves[k].bits, sm2_curves[k].name,
-                1.0 / sm2_results[k][0], 1.0 / sm2_results[k][1],
-                sm2_results[k][0], sm2_results[k][1]);
-    }
-#endif
 #ifndef OPENSSL_NO_DH
     testnum = 1;
     for (k = 0; k < FFDH_NUM; k++) {
@@ -4690,7 +4253,7 @@ show_res:
             testnum = 0;
         }
         if (mr)
-            printf("+F8:%u:%u:%f:%f\n",
+            printf("+F7:%u:%u:%f:%f\n",
                 k, ffdh_params[k].bits,
                 ffdh_results[k][0], 1.0 / ffdh_results[k][0]);

@@ -4712,7 +4275,7 @@ show_res:
             testnum = 0;
         }
         if (mr)
-            printf("+F9:%u:%f:%f:%f\n",
+            printf("+F8:%u:%f:%f:%f\n",
                 k, kems_results[k][0], kems_results[k][1],
                 kems_results[k][2]);
         else
@@ -4734,7 +4297,7 @@ show_res:
             testnum = 0;
         }
         if (mr)
-            printf("+F10:%u:%f:%f:%f\n",
+            printf("+F9:%u:%f:%f:%f\n",
                 k, sigs_results[k][0], sigs_results[k][1],
                 sigs_results[k][2]);
         else
@@ -4773,36 +4336,12 @@ end:
             EVP_PKEY_CTX_free(loopargs[i].dsa_verify_ctx[k]);
         }
 #endif
-        for (k = 0; k < ECDSA_NUM; k++) {
-            EVP_PKEY_CTX_free(loopargs[i].ecdsa_sign_ctx[k]);
-            EVP_PKEY_CTX_free(loopargs[i].ecdsa_verify_ctx[k]);
+        for (k = 0; k < EC_NUM; k++) {
+            EVP_PKEY_CTX_free(loopargs[i].pk_sign_ctx[k]);
+            EVP_PKEY_CTX_free(loopargs[i].pk_verify_ctx[k]);
         }
         for (k = 0; k < EC_NUM; k++)
             EVP_PKEY_CTX_free(loopargs[i].ecdh_ctx[k]);
-#ifndef OPENSSL_NO_ECX
-        for (k = 0; k < EdDSA_NUM; k++) {
-            EVP_MD_CTX_free(loopargs[i].eddsa_ctx[k]);
-            EVP_MD_CTX_free(loopargs[i].eddsa_ctx2[k]);
-        }
-#endif /* OPENSSL_NO_ECX */
-#ifndef OPENSSL_NO_SM2
-        for (k = 0; k < SM2_NUM; k++) {
-            EVP_PKEY_CTX *pctx = NULL;
-
-            /* free signing ctx */
-            if (loopargs[i].sm2_ctx[k] != NULL
-                && (pctx = EVP_MD_CTX_get_pkey_ctx(loopargs[i].sm2_ctx[k])) != NULL)
-                EVP_PKEY_CTX_free(pctx);
-            EVP_MD_CTX_free(loopargs[i].sm2_ctx[k]);
-            /* free verification ctx */
-            if (loopargs[i].sm2_vfy_ctx[k] != NULL
-                && (pctx = EVP_MD_CTX_get_pkey_ctx(loopargs[i].sm2_vfy_ctx[k])) != NULL)
-                EVP_PKEY_CTX_free(pctx);
-            EVP_MD_CTX_free(loopargs[i].sm2_vfy_ctx[k]);
-            /* free pkey */
-            EVP_PKEY_free(loopargs[i].sm2_pkey[k]);
-        }
-#endif
         for (k = 0; k < kems_algs_len; k++) {
             EVP_PKEY_CTX_free(loopargs[i].kem_gen_ctx[k]);
             EVP_PKEY_CTX_free(loopargs[i].kem_encaps_ctx[k]);
@@ -4840,7 +4379,6 @@ end:
         ASYNC_cleanup_thread();
     }
     OPENSSL_free(loopargs);
-    release_engine(e);
     EVP_CIPHER_free(evp_cipher);
     EVP_MAC_free(mac);
     NCONF_free(conf);
@@ -4850,8 +4388,7 @@ end:
 static void print_message(const char *s, int length, int tm)
 {
     BIO_printf(bio_err,
-        mr ? "+DT:%s:%d:%d\n"
-           : "Doing %s ops for %ds on %d size blocks: ",
+        mr ? "+DT:%s:%d:%d\n" : "Doing %s ops for %ds on %d size blocks: ",
         s, tm, length);
     (void)BIO_flush(bio_err);
     run = 1;
@@ -4862,8 +4399,7 @@ static void pkey_print_message(const char *str, const char *str2, unsigned int b
     int tm)
 {
     BIO_printf(bio_err,
-        mr ? "+DTP:%d:%s:%s:%d\n"
-           : "Doing %u bits %s %s ops for %ds: ",
+        mr ? "+DTP:%d:%s:%s:%d\n" : "Doing %u bits %s %s ops for %ds: ",
         bits, str, str2, tm);
     (void)BIO_flush(bio_err);
     run = 1;
@@ -4873,8 +4409,7 @@ static void pkey_print_message(const char *str, const char *str2, unsigned int b
 static void kskey_print_message(const char *str, const char *str2, int tm)
 {
     BIO_printf(bio_err,
-        mr ? "+DTP:%s:%s:%d\n"
-           : "Doing %s %s ops for %ds: ",
+        mr ? "+DTP:%s:%s:%d\n" : "Doing %s %s ops for %ds: ",
         str, str2, tm);
     (void)BIO_flush(bio_err);
     run = 1;
@@ -4889,8 +4424,7 @@ static void print_result(int alg, int run_no, int count, double time_used)
         return;
     }
     BIO_printf(bio_err,
-        mr ? "+R:%d:%s:%f\n"
-           : "%d %s ops in %.2fs\n",
+        mr ? "+R:%d:%s:%f\n" : "%d %s ops in %.2fs\n",
         count, names[alg], time_used);
     results[alg][run_no] = ((double)count) / time_used * lengths[run_no];
 }
@@ -4945,10 +4479,10 @@ static int do_multi(int multi, int size_num)
     int status;
     static char sep[] = ":";

-    fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
+    fds = app_malloc_array(multi, sizeof(*fds), "fd buffer for do_multi");
     for (n = 0; n < multi; ++n) {
         if (pipe(fd) == -1) {
-            BIO_printf(bio_err, "pipe failure\n");
+            BIO_puts(bio_err, "pipe failure\n");
             exit(1);
         }
         fflush(stdout);
@@ -4960,7 +4494,7 @@ static int do_multi(int multi, int size_num)
             close(fd[0]);
             close(1);
             if (dup(fd[1]) == -1) {
-                BIO_printf(bio_err, "dup failed\n");
+                BIO_puts(bio_err, "dup failed\n");
                 exit(1);
             }
             close(fd[1]);
@@ -5057,36 +4591,8 @@ static int do_multi(int multi, int size_num)
                     d = atof(sstrsep(&p, sep));
                     ecdh_results[k][0] += d;
                 }
-#ifndef OPENSSL_NO_ECX
-            } else if (CHECK_AND_SKIP_PREFIX(p, "+F6:")) {
-                tk = sstrsep(&p, sep);
-                if (strtoint(tk, 0, OSSL_NELEM(eddsa_results), &k)) {
-                    sstrsep(&p, sep);
-                    sstrsep(&p, sep);
-
-                    d = atof(sstrsep(&p, sep));
-                    eddsa_results[k][0] += d;
-
-                    d = atof(sstrsep(&p, sep));
-                    eddsa_results[k][1] += d;
-                }
-#endif /* OPENSSL_NO_ECX */
-#ifndef OPENSSL_NO_SM2
-            } else if (CHECK_AND_SKIP_PREFIX(p, "+F7:")) {
-                tk = sstrsep(&p, sep);
-                if (strtoint(tk, 0, OSSL_NELEM(sm2_results), &k)) {
-                    sstrsep(&p, sep);
-                    sstrsep(&p, sep);
-
-                    d = atof(sstrsep(&p, sep));
-                    sm2_results[k][0] += d;
-
-                    d = atof(sstrsep(&p, sep));
-                    sm2_results[k][1] += d;
-                }
-#endif /* OPENSSL_NO_SM2 */
 #ifndef OPENSSL_NO_DH
-            } else if (CHECK_AND_SKIP_PREFIX(p, "+F8:")) {
+            } else if (CHECK_AND_SKIP_PREFIX(p, "+F7:")) {
                 tk = sstrsep(&p, sep);
                 if (strtoint(tk, 0, OSSL_NELEM(ffdh_results), &k)) {
                     sstrsep(&p, sep);
@@ -5095,7 +4601,7 @@ static int do_multi(int multi, int size_num)
                     ffdh_results[k][0] += d;
                 }
 #endif /* OPENSSL_NO_DH */
-            } else if (CHECK_AND_SKIP_PREFIX(p, "+F9:")) {
+            } else if (CHECK_AND_SKIP_PREFIX(p, "+F8:")) {
                 tk = sstrsep(&p, sep);
                 if (strtoint(tk, 0, OSSL_NELEM(kems_results), &k)) {
                     d = atof(sstrsep(&p, sep));
@@ -5107,7 +4613,7 @@ static int do_multi(int multi, int size_num)
                     d = atof(sstrsep(&p, sep));
                     kems_results[k][2] += d;
                 }
-            } else if (CHECK_AND_SKIP_PREFIX(p, "+F10:")) {
+            } else if (CHECK_AND_SKIP_PREFIX(p, "+F9:")) {
                 tk = sstrsep(&p, sep);
                 if (strtoint(tk, 0, OSSL_NELEM(sigs_results), &k)) {
                     d = atof(sstrsep(&p, sep));
@@ -5131,7 +4637,7 @@ static int do_multi(int multi, int size_num)
     for (n = 0; n < multi; ++n) {
         while (wait(&status) == -1)
             if (errno != EINTR) {
-                BIO_printf(bio_err, "Waitng for child failed with 0x%x\n",
+                BIO_printf(bio_err, "Waiting for child failed with 0x%x\n",
                     errno);
                 return 1;
             }
@@ -5228,13 +4734,13 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher, int lengths_single,
                 aad[12] = (unsigned char)(len);
                 pad = EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_TLS1_AAD,
                     EVP_AEAD_TLS1_AAD_LEN, aad);
-                ciph_success = EVP_Cipher(ctx, out, inp, len + pad);
+                ciph_success = EVP_Cipher(ctx, out, inp, (unsigned int)(len + pad));
             }
         }
         d = Time_F(STOP);
         BIO_printf(bio_err, mr ? "+R:%d:%s:%f\n" : "%d %s ops in %.2fs\n", count, "evp", d);
         if ((ciph_success <= 0) && (mr == 0))
-            BIO_printf(bio_err, "Error performing cipher op\n");
+            BIO_puts(bio_err, "Error performing cipher op\n");
         results[D_EVP][j] = ((double)count) / d * mblengths[j];
     }

diff --git a/deps/openssl/openssl/apps/spkac.c b/deps/openssl/openssl/apps/spkac.c
index 47387219429..9f2d0d0d076 100644
--- a/deps/openssl/openssl/apps/spkac.c
+++ b/deps/openssl/openssl/apps/spkac.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -27,7 +27,6 @@ typedef enum OPTION_choice {
     OPT_VERIFY,
     OPT_IN,
     OPT_OUT,
-    OPT_ENGINE,
     OPT_KEY,
     OPT_CHALLENGE,
     OPT_PASSIN,
@@ -43,14 +42,11 @@ const OPTIONS spkac_options[] = {
     { "help", OPT_HELP, '-', "Display this summary" },
     { "spksect", OPT_SPKSECT, 's',
         "Specify the name of an SPKAC-dedicated section of configuration" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif

     OPT_SECTION("Input"),
     { "in", OPT_IN, '<', "Input file" },
     { "key", OPT_KEY, '<', "Create SPKAC using private key" },
-    { "keyform", OPT_KEYFORM, 'f', "Private key file format (ENGINE, other values ignored)" },
+    { "keyform", OPT_KEYFORM, 'f', "Private key file format (DER/PEM)" },
     { "passin", OPT_PASSIN, 's', "Input file pass phrase source" },
     { "challenge", OPT_CHALLENGE, 's', "Challenge string" },
     { "spkac", OPT_SPKAC, 's', "Alternative SPKAC name" },
@@ -70,7 +66,6 @@ int spkac_main(int argc, char **argv)
 {
     BIO *out = NULL;
     CONF *conf = NULL;
-    ENGINE *e = NULL;
     EVP_PKEY *pkey = NULL;
     NETSCAPE_SPKI *spki = NULL;
     char *challenge = NULL, *keyfile = NULL;
@@ -132,9 +127,6 @@ int spkac_main(int argc, char **argv)
         case OPT_DIGEST:
             digest = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_PROV_CASES:
             if (!opt_provider(o))
                 goto end;
@@ -147,7 +139,7 @@ int spkac_main(int argc, char **argv)
         goto opthelp;

     if (!app_passwd(passinarg, NULL, &passin, NULL)) {
-        BIO_printf(bio_err, "Error getting password\n");
+        BIO_puts(bio_err, "Error getting password\n");
         goto end;
     }

@@ -156,23 +148,23 @@ int spkac_main(int argc, char **argv)
             goto end;

         pkey = load_key(strcmp(keyfile, "-") ? keyfile : NULL,
-            keyformat, 1, passin, e, "private key");
+            keyformat, 1, passin, "private key");
         if (pkey == NULL)
             goto end;
         spki = NETSCAPE_SPKI_new();
         if (spki == NULL)
             goto end;
         if (challenge != NULL
-            && !ASN1_STRING_set(spki->spkac->challenge,
-                challenge, (int)strlen(challenge)))
+            && !ASN1_STRING_set1_string(spki->spkac->challenge,
+                challenge))
             goto end;
         if (!NETSCAPE_SPKI_set_pubkey(spki, pkey)) {
-            BIO_printf(bio_err, "Error setting public key\n");
+            BIO_puts(bio_err, "Error setting public key\n");
             goto end;
         }
         i = NETSCAPE_SPKI_sign(spki, pkey, md);
         if (i <= 0) {
-            BIO_printf(bio_err, "Error signing SPKAC\n");
+            BIO_puts(bio_err, "Error signing SPKAC\n");
             goto end;
         }
         spkstr = NETSCAPE_SPKI_b64_encode(spki);
@@ -204,7 +196,7 @@ int spkac_main(int argc, char **argv)
     spki = NETSCAPE_SPKI_b64_decode(spkstr, -1);

     if (spki == NULL) {
-        BIO_printf(bio_err, "Error loading SPKAC\n");
+        BIO_puts(bio_err, "Error loading SPKAC\n");
         ERR_print_errors(bio_err);
         goto end;
     }
@@ -219,9 +211,9 @@ int spkac_main(int argc, char **argv)
     if (verify) {
         i = NETSCAPE_SPKI_verify(spki, pkey);
         if (i > 0) {
-            BIO_printf(bio_err, "Signature OK\n");
+            BIO_puts(bio_err, "Signature OK\n");
         } else {
-            BIO_printf(bio_err, "Signature Failure\n");
+            BIO_puts(bio_err, "Signature Failure\n");
             ERR_print_errors(bio_err);
             goto end;
         }
@@ -237,7 +229,6 @@ end:
     NETSCAPE_SPKI_free(spki);
     BIO_free_all(out);
     EVP_PKEY_free(pkey);
-    release_engine(e);
     OPENSSL_free(passin);
     return ret;
 }
diff --git a/deps/openssl/openssl/apps/srp.c b/deps/openssl/openssl/apps/srp.c
index ac0e15f49c0..2ae7b9e9572 100644
--- a/deps/openssl/openssl/apps/srp.c
+++ b/deps/openssl/openssl/apps/srp.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2004, EdelKey Project. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -95,13 +95,13 @@ static int update_index(CA_DB *db, char **row)
     char **irow;
     int i;

-    irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
+    irow = app_malloc_array(DB_NUMBER + 1, sizeof(*irow), "row pointers");
     for (i = 0; i < DB_NUMBER; i++)
         irow[i] = row[i];
     irow[DB_NUMBER] = NULL;

     if (!TXT_DB_insert(db->db, irow)) {
-        BIO_printf(bio_err, "failed to update srpvfile\n");
+        BIO_puts(bio_err, "failed to update srpvfile\n");
         BIO_printf(bio_err, "TXT_DB error number %ld\n", db->db->error);
         OPENSSL_free(irow);
         return 0;
@@ -144,7 +144,7 @@ static char *srp_verify_user(const char *user, const char *srp_verifier,
         if ((gNid = SRP_create_verifier(user, password, &srp_usersalt,
                  &verifier, N, g))
             == NULL) {
-            BIO_printf(bio_err, "Internal error validating SRP verifier\n");
+            BIO_puts(bio_err, "Internal error validating SRP verifier\n");
         } else {
             if (strcmp(verifier, srp_verifier))
                 gNid = NULL;
@@ -176,7 +176,7 @@ static char *srp_create_user(char *user, char **srp_verifier,
         if ((gNid = SRP_create_verifier(user, password, &salt,
                  srp_verifier, N, g))
             == NULL) {
-            BIO_printf(bio_err, "Internal error creating SRP verifier\n");
+            BIO_puts(bio_err, "Internal error creating SRP verifier\n");
         } else {
             *srp_usersalt = salt;
         }
@@ -202,7 +202,6 @@ typedef enum OPTION_choice {
     OPT_USERINFO,
     OPT_PASSIN,
     OPT_PASSOUT,
-    OPT_ENGINE,
     OPT_R_ENUM,
     OPT_PROV_ENUM
 } OPTION_CHOICE;
@@ -215,9 +214,6 @@ const OPTIONS srp_options[] = {
     { "verbose", OPT_VERBOSE, '-', "Talk a lot while doing things" },
     { "config", OPT_CONFIG, '<', "A config file" },
     { "name", OPT_NAME, 's', "The particular srp definition to use" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif

     OPT_SECTION("Action"),
     { "add", OPT_ADD, '-', "Add a user and SRP verifier" },
@@ -242,7 +238,6 @@ const OPTIONS srp_options[] = {

 int srp_main(int argc, char **argv)
 {
-    ENGINE *e = NULL;
     CA_DB *db = NULL;
     CONF *conf = NULL;
     int gNindex = -1, maxgN = -1, ret = 1, errors = 0, verbose = 0, i;
@@ -302,9 +297,6 @@ int srp_main(int argc, char **argv)
         case OPT_PASSOUT:
             passoutarg = opt_arg();
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_R_CASES:
             if (!opt_rand(o))
                 goto end;
@@ -324,30 +316,30 @@ int srp_main(int argc, char **argv)
         goto end;

     if (srpvfile != NULL && configfile != NULL) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "-srpvfile and -configfile cannot be specified together.\n");
         goto end;
     }
     if (mode == OPT_ERR) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "Exactly one of the options -add, -delete, -modify -list must be specified.\n");
         goto opthelp;
     }
     if (mode == OPT_DELETE || mode == OPT_MODIFY || mode == OPT_ADD) {
         if (argc == 0) {
-            BIO_printf(bio_err, "Need at least one user.\n");
+            BIO_puts(bio_err, "Need at least one user.\n");
             goto opthelp;
         }
         user = *argv++;
     }
     if ((passinarg != NULL || passoutarg != NULL) && argc != 1) {
-        BIO_printf(bio_err,
+        BIO_puts(bio_err,
             "-passin, -passout arguments only valid with one user.\n");
         goto opthelp;
     }

     if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
-        BIO_printf(bio_err, "Error getting passwords\n");
+        BIO_puts(bio_err, "Error getting passwords\n");
         goto end;
     }

@@ -409,7 +401,7 @@ int srp_main(int argc, char **argv)
     }

     if (verbose)
-        BIO_printf(bio_err, "Database initialised\n");
+        BIO_puts(bio_err, "Database initialised\n");

     if (gNindex >= 0) {
         gNrow = sk_OPENSSL_PSTRING_value(db->db->data, gNindex);
@@ -419,12 +411,12 @@ int srp_main(int argc, char **argv)
         goto end;
     } else {
         if (verbose)
-            BIO_printf(bio_err, "Database has no g N information.\n");
+            BIO_puts(bio_err, "Database has no g N information.\n");
         gNrow = NULL;
     }

     if (verbose > 1)
-        BIO_printf(bio_err, "Starting user processing\n");
+        BIO_puts(bio_err, "Starting user processing\n");

     while (mode == OPT_LIST || user != NULL) {
         int userindex = -1;
@@ -436,7 +428,7 @@ int srp_main(int argc, char **argv)

         if (mode == OPT_LIST) {
             if (user == NULL) {
-                BIO_printf(bio_err, "List all users\n");
+                BIO_puts(bio_err, "List all users\n");

                 for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++)
                     print_user(db, i, 1);
@@ -586,7 +578,7 @@ int srp_main(int argc, char **argv)
     }

     if (verbose)
-        BIO_printf(bio_err, "User procession done.\n");
+        BIO_puts(bio_err, "User procession done.\n");

     if (doupdatedb) {
         /* Lets check some fields */
@@ -600,17 +592,17 @@ int srp_main(int argc, char **argv)
         }

         if (verbose)
-            BIO_printf(bio_err, "Trying to update srpvfile.\n");
+            BIO_puts(bio_err, "Trying to update srpvfile.\n");
         if (!save_index(srpvfile, "new", db))
             goto end;

         if (verbose)
-            BIO_printf(bio_err, "Temporary srpvfile created.\n");
+            BIO_puts(bio_err, "Temporary srpvfile created.\n");
         if (!rotate_index(srpvfile, "new", "old"))
             goto end;

         if (verbose)
-            BIO_printf(bio_err, "srpvfile updated.\n");
+            BIO_puts(bio_err, "srpvfile updated.\n");
     }

     ret = (errors != 0);
@@ -628,6 +620,5 @@ end:
         ERR_print_errors(bio_err);
     NCONF_free(conf);
     free_index(db);
-    release_engine(e);
     return ret;
 }
diff --git a/deps/openssl/openssl/apps/storeutl.c b/deps/openssl/openssl/apps/storeutl.c
index 27cbe69dbaa..5f2727808ea 100644
--- a/deps/openssl/openssl/apps/storeutl.c
+++ b/deps/openssl/openssl/apps/storeutl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -25,7 +25,6 @@ static BIO *out = NULL;

 typedef enum OPTION_choice {
     OPT_COMMON,
-    OPT_ENGINE,
     OPT_OUT,
     OPT_PASSIN,
     OPT_NOOUT,
@@ -34,6 +33,7 @@ typedef enum OPTION_choice {
     OPT_SEARCHFOR_CERTS,
     OPT_SEARCHFOR_KEYS,
     OPT_SEARCHFOR_CRLS,
+    OPT_SEARCHFOR_SKEYS,
     OPT_CRITERION_SUBJECT,
     OPT_CRITERION_ISSUER,
     OPT_CRITERION_SERIAL,
@@ -49,14 +49,12 @@ const OPTIONS storeutl_options[] = {
     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
     { "", OPT_MD, '-', "Any supported digest" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif

     OPT_SECTION("Search"),
     { "certs", OPT_SEARCHFOR_CERTS, '-', "Search for certificates only" },
     { "keys", OPT_SEARCHFOR_KEYS, '-', "Search for keys only" },
     { "crls", OPT_SEARCHFOR_CRLS, '-', "Search for CRLs only" },
+    { "skeys", OPT_SEARCHFOR_SKEYS, '-', "Search for symmetric keys only" },
     { "subject", OPT_CRITERION_SUBJECT, 's', "Search by subject" },
     { "issuer", OPT_CRITERION_ISSUER, 's', "Search by issuer and serial, issuer name" },
     { "serial", OPT_CRITERION_SERIAL, 's', "Search by issuer and serial, serial number" },
@@ -83,7 +81,6 @@ int storeutl_main(int argc, char *argv[])
 {
     int ret = 1, noout = 0, text = 0, recursive = 0;
     char *outfile = NULL, *passin = NULL, *passinarg = NULL;
-    ENGINE *e = NULL;
     OPTION_CHOICE o;
     char *prog;
     PW_CB_DATA pw_cb_data;
@@ -129,6 +126,7 @@ int storeutl_main(int argc, char *argv[])
         case OPT_SEARCHFOR_CERTS:
         case OPT_SEARCHFOR_KEYS:
         case OPT_SEARCHFOR_CRLS:
+        case OPT_SEARCHFOR_SKEYS:
             if (expected != 0) {
                 BIO_printf(bio_err, "%s: only one search type can be given.\n",
                     prog);
@@ -142,6 +140,7 @@ int storeutl_main(int argc, char *argv[])
                     { OPT_SEARCHFOR_CERTS, OSSL_STORE_INFO_CERT },
                     { OPT_SEARCHFOR_KEYS, OSSL_STORE_INFO_PKEY },
                     { OPT_SEARCHFOR_CRLS, OSSL_STORE_INFO_CRL },
+                    { OPT_SEARCHFOR_SKEYS, OSSL_STORE_INFO_SKEY },
                 };
                 size_t i;

@@ -253,9 +252,6 @@ int storeutl_main(int argc, char *argv[])
                 goto end;
             }
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_MD:
             digestname = opt_unknown();
             break;
@@ -314,7 +310,7 @@ int storeutl_main(int argc, char *argv[])
     }

     if (!app_passwd(passinarg, NULL, &passin, NULL)) {
-        BIO_printf(bio_err, "Error getting passwords\n");
+        BIO_puts(bio_err, "Error getting passwords\n");
         goto end;
     }
     pw_cb_data.password = passin;
@@ -334,29 +330,17 @@ end:
     OSSL_STORE_SEARCH_free(search);
     BIO_free_all(out);
     OPENSSL_free(passin);
-    release_engine(e);
     return ret;
 }

-static int indent_printf(int indent, BIO *bio, const char *format, ...)
+static void indent_printf(int indent, BIO *bio, const char *format, ...)
 {
     va_list args;
-    int ret, vret;
-
-    ret = BIO_printf(bio, "%*s", indent, "");
-    if (ret < 0)
-        return ret;

+    BIO_printf(bio, "%*s", indent, "");
     va_start(args, format);
-    vret = BIO_vprintf(bio, format, args);
+    BIO_vprintf(bio, format, args);
     va_end(args);
-
-    if (vret < 0)
-        return vret;
-    if (vret > INT_MAX - ret)
-        return INT_MAX;
-
-    return ret + vret;
 }

 static int process(const char *uri, const UI_METHOD *uimeth, PW_CB_DATA *uidata,
@@ -419,10 +403,10 @@ static int process(const char *uri, const UI_METHOD *uimeth, PW_CB_DATA *uidata,
             if (OSSL_STORE_eof(store_ctx))
                 break;

-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "ERROR: OSSL_STORE_load() returned NULL without "
                 "eof or error indications\n");
-            BIO_printf(bio_err, "       This is an error in the loader\n");
+            BIO_puts(bio_err, "       This is an error in the loader\n");
             ERR_print_errors(bio_err);
             ret++;
             break;
@@ -496,8 +480,11 @@ static int process(const char *uri, const UI_METHOD *uimeth, PW_CB_DATA *uidata,
             if (!noout)
                 PEM_write_bio_X509_CRL(out, OSSL_STORE_INFO_get0_CRL(info));
             break;
+        case OSSL_STORE_INFO_SKEY:
+            /* Currently there is no universal API allowing to print smth, so no output */
+            break;
         default:
-            BIO_printf(bio_err, "!!! Unknown code\n");
+            BIO_puts(bio_err, "!!! Unknown code\n");
             ret++;
             break;
         }
diff --git a/deps/openssl/openssl/apps/testdsa.h b/deps/openssl/openssl/apps/testdsa.h
index 31f8e74a9cf..120cdc8e9af 100644
--- a/deps/openssl/openssl/apps/testdsa.h
+++ b/deps/openssl/openssl/apps/testdsa.h
@@ -7,6 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_APPS_TESTDSA_H)
+#define OSSL_APPS_TESTDSA_H
+
+#include <openssl/core_names.h>
+#include <openssl/evp.h>
+#include <openssl/params.h>
 #include <openssl/param_build.h>

 /* used by speed.c */
@@ -297,3 +303,5 @@ err:
     EVP_PKEY_CTX_free(pctx);
     return pkey;
 }
+
+#endif /* !defined(OSSL_APPS_TESTDSA_H) */
diff --git a/deps/openssl/openssl/apps/testrsa.h b/deps/openssl/openssl/apps/testrsa.h
index 5117bc175eb..058471e4f70 100644
--- a/deps/openssl/openssl/apps/testrsa.h
+++ b/deps/openssl/openssl/apps/testrsa.h
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_APPS_TESTRSA_H)
+#define OSSL_APPS_TESTRSA_H
+
 static unsigned char test512[] = {
     0x30, 0x82, 0x01, 0x3a, 0x02, 0x01, 0x00, 0x02, 0x41, 0x00,
     0xd6, 0x33, 0xb9, 0xc8, 0xfb, 0x4f, 0x3c, 0x7d, 0xc0, 0x01,
@@ -1958,3 +1961,5 @@ static unsigned char test15360[] = {
     0x91, 0x29, 0x6e, 0x08, 0x37, 0xd6, 0xaa, 0xd2, 0xf8, 0x4f,
     0x5e, 0x00, 0x16, 0x52
 };
+
+#endif /* !defined(OSSL_APPS_TESTRSA_H) */
diff --git a/deps/openssl/openssl/apps/ts.c b/deps/openssl/openssl/apps/ts.c
index af355bfc05e..4d5016fcca5 100644
--- a/deps/openssl/openssl/apps/ts.c
+++ b/deps/openssl/openssl/apps/ts.c
@@ -44,13 +44,13 @@ static int create_digest(BIO *input, const char *digest,
 static ASN1_INTEGER *create_nonce(int bits);

 /* Reply related functions. */
-static int reply_command(CONF *conf, const char *section, const char *engine,
+static int reply_command(CONF *conf, const char *section,
     const char *queryfile, const char *passin, const char *inkey,
     const EVP_MD *md, const char *signer, const char *chain,
     const char *policy, const char *in, int token_in,
     const char *out, int token_out, int text);
 static TS_RESP *read_PKCS7(BIO *in_bio);
-static TS_RESP *create_response(CONF *conf, const char *section, const char *engine,
+static TS_RESP *create_response(CONF *conf, const char *section,
     const char *queryfile, const char *passin,
     const char *inkey, const EVP_MD *md, const char *signer,
     const char *chain, const char *policy);
@@ -76,7 +76,6 @@ static int verify_cb(int ok, X509_STORE_CTX *ctx);

 typedef enum OPTION_choice {
     OPT_COMMON,
-    OPT_ENGINE,
     OPT_CONFIG,
     OPT_SECTION,
     OPT_QUERY,
@@ -112,15 +111,12 @@ const OPTIONS ts_options[] = {
     { "help", OPT_HELP, '-', "Display this summary" },
     { "config", OPT_CONFIG, '<', "Configuration file" },
     { "section", OPT_SECTION, 's', "Section to use within config file" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif
     { "inkey", OPT_INKEY, 's', "File with private key for reply" },
     { "signer", OPT_SIGNER, 's', "Signer certificate file" },
     { "chain", OPT_CHAIN, '<', "File with signer CA chain" },
-    { "CAfile", OPT_CAFILE, '<', "File with trusted CA certs" },
-    { "CApath", OPT_CAPATH, '/', "Path to trusted CA files" },
-    { "CAstore", OPT_CASTORE, ':', "URI to trusted CA store" },
+    { "CAfile", OPT_CAFILE, '<', "File in PEM format with trusted CA certs" },
+    { "CApath", OPT_CAPATH, '/', "Dir with trusted CA cert files in PEM format" },
+    { "CAstore", OPT_CASTORE, ':', "URI of store with trusted CA certs" },
     { "untrusted", OPT_UNTRUSTED, '<', "Extra untrusted certs" },
     { "token_in", OPT_TOKEN_IN, '-', "Input is a PKCS#7 file" },
     { "token_out", OPT_TOKEN_OUT, '-', "Output is a PKCS#7 file" },
@@ -164,11 +160,7 @@ static char *opt_helplist[] = {
     "    [-signer tsa_cert.pem] [-inkey private_key.pem]",
     "    [-chain certs_file.pem] [-tspolicy oid]",
     "    [-in file] [-token_in] [-out file] [-token_out]",
-#ifndef OPENSSL_NO_ENGINE
-    "    [-text] [-engine id]",
-#else
     "    [-text]",
-#endif
     "",
     " openssl ts -verify -CApath dir -CAfile root-cert.pem -CAstore uri",
     "   -untrusted extra-certs.pem [-data file] [-digest hexstring]",
@@ -181,7 +173,7 @@ int ts_main(int argc, char **argv)
     CONF *conf = NULL;
     const char *CAfile = NULL, *prog;
     char *untrusted = NULL;
-    const char *configfile = default_config_file, *engine = NULL;
+    const char *configfile = default_config_file;
     const char *section = NULL, *digestname = NULL;
     char **helpp;
     char *password = NULL;
@@ -297,9 +289,6 @@ int ts_main(int argc, char **argv)
         case OPT_UNTRUSTED:
             untrusted = opt_arg();
             break;
-        case OPT_ENGINE:
-            engine = opt_arg();
-            break;
         case OPT_MD:
             digestname = opt_unknown();
             break;
@@ -322,10 +311,12 @@ int ts_main(int argc, char **argv)
     if (!app_RAND_load())
         goto end;

+    if (digestname == NULL)
+        digestname = "sha256";
     if (!opt_md(digestname, &md))
         goto opthelp;
     if (mode == OPT_REPLY && passin && !app_passwd(passin, NULL, &password, NULL)) {
-        BIO_printf(bio_err, "Error getting password.\n");
+        BIO_puts(bio_err, "Error getting password.\n");
         goto end;
     }

@@ -351,7 +342,7 @@ int ts_main(int argc, char **argv)
             if (conf == NULL || token_in != 0 || queryfile == NULL)
                 goto opthelp;
         }
-        ret = !reply_command(conf, section, engine, queryfile,
+        ret = !reply_command(conf, section, queryfile,
             password, inkey, md, signer, chain, policy,
             in, token_in, out, token_out, text);

@@ -473,8 +464,6 @@ static TS_REQ *create_query(BIO *data_bio, const char *digest, const EVP_MD *md,
     ASN1_OBJECT *policy_obj = NULL;
     ASN1_INTEGER *nonce_asn1 = NULL;

-    if (md == NULL && (md = EVP_get_digestbyname("sha256")) == NULL)
-        goto err;
     if ((ts_req = TS_REQ_new()) == NULL)
         goto err;
     if (!TS_REQ_set_version(ts_req, 1))
@@ -514,7 +503,7 @@ err:
     if (!ret) {
         TS_REQ_free(ts_req);
         ts_req = NULL;
-        BIO_printf(bio_err, "could not create query\n");
+        BIO_puts(bio_err, "could not create query\n");
         ERR_print_errors(bio_err);
     }
     TS_MSG_IMPRINT_free(msg_imprint);
@@ -578,37 +567,40 @@ err:
 static ASN1_INTEGER *create_nonce(int bits)
 {
     unsigned char buf[20];
+    ASN1_INTEGER *ret = NULL;
     ASN1_INTEGER *nonce = NULL;
     int len = (bits - 1) / 8 + 1;
-    int i;

     if (len > (int)sizeof(buf))
         goto err;
-    if (RAND_bytes(buf, len) <= 0)
-        goto err;

-    /* Find the first non-zero byte and creating ASN1_INTEGER object. */
-    for (i = 0; i < len && !buf[i]; ++i)
-        continue;
+    /* Make a random nonce with a non-zero first byte */
+    do {
+        if (RAND_bytes(buf, len) <= 0)
+            goto err;
+    } while (!buf[0]);
+
     if ((nonce = ASN1_INTEGER_new()) == NULL)
         goto err;
-    OPENSSL_free(nonce->data);
-    nonce->length = len - i;
-    nonce->data = app_malloc(nonce->length + 1, "nonce buffer");
-    memcpy(nonce->data, buf + i, nonce->length);
-    return nonce;
+
+    if (!ASN1_STRING_set1_data(nonce, buf, len))
+        goto err;
+
+    ret = nonce;
+    nonce = NULL;

 err:
-    BIO_printf(bio_err, "could not create nonce\n");
+    if (ret == NULL)
+        BIO_puts(bio_err, "could not create nonce\n");
     ASN1_INTEGER_free(nonce);
-    return NULL;
+    return ret;
 }

 /*
  * Reply-related method definitions.
  */

-static int reply_command(CONF *conf, const char *section, const char *engine,
+static int reply_command(CONF *conf, const char *section,
     const char *queryfile, const char *passin, const char *inkey,
     const EVP_MD *md, const char *signer, const char *chain,
     const char *policy, const char *in, int token_in,
@@ -631,12 +623,12 @@ static int reply_command(CONF *conf, const char *section, const char *engine,
             response = d2i_TS_RESP_bio(in_bio, NULL);
         }
     } else {
-        response = create_response(conf, section, engine, queryfile,
+        response = create_response(conf, section, queryfile,
             passin, inkey, md, signer, chain, policy);
         if (response != NULL)
-            BIO_printf(bio_err, "Response has been generated.\n");
+            BIO_puts(bio_err, "Response has been generated.\n");
         else
-            BIO_printf(bio_err, "Response is not generated.\n");
+            BIO_puts(bio_err, "Response is not generated.\n");
     }
     if (response == NULL)
         goto end;
@@ -716,7 +708,7 @@ end:
     return resp;
 }

-static TS_RESP *create_response(CONF *conf, const char *section, const char *engine,
+static TS_RESP *create_response(CONF *conf, const char *section,
     const char *queryfile, const char *passin,
     const char *inkey, const EVP_MD *md, const char *signer,
     const char *chain, const char *policy)
@@ -734,10 +726,6 @@ static TS_RESP *create_response(CONF *conf, const char *section, const char *eng
         goto end;
     if (!TS_CONF_set_serial(conf, section, serial_cb, resp_ctx))
         goto end;
-#ifndef OPENSSL_NO_ENGINE
-    if (!TS_CONF_set_crypto_device(conf, section, engine))
-        goto end;
-#endif
     if (!TS_CONF_set_signer_cert(conf, section, signer, resp_ctx))
         goto end;
     if (!TS_CONF_set_certs(conf, section, chain, resp_ctx))
@@ -951,7 +939,7 @@ static TS_VERIFY_CTX *create_verify_ctx(const char *data, const char *digest,
             unsigned char *hexstr = OPENSSL_hexstr2buf(digest, &imprint_len);
             f |= TS_VFY_IMPRINT;
             if (!TS_VERIFY_CTX_set0_imprint(ctx, hexstr, imprint_len)) {
-                BIO_printf(bio_err, "invalid digest string\n");
+                BIO_puts(bio_err, "invalid digest string\n");
                 goto err;
             }
         }
@@ -1003,14 +991,14 @@ static X509_STORE *create_cert_store(const char *CApath, const char *CAfile,

     cert_ctx = X509_STORE_new();
     if (cert_ctx == NULL) {
-        BIO_printf(bio_err, "memory allocation failure\n");
+        BIO_puts(bio_err, "memory allocation failure\n");
         return NULL;
     }
     X509_STORE_set_verify_cb(cert_ctx, verify_cb);
     if (CApath != NULL) {
         lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_hash_dir());
         if (lookup == NULL) {
-            BIO_printf(bio_err, "memory allocation failure\n");
+            BIO_puts(bio_err, "memory allocation failure\n");
             goto err;
         }
         if (X509_LOOKUP_add_dir(lookup, CApath, X509_FILETYPE_PEM) <= 0) {
@@ -1022,7 +1010,7 @@ static X509_STORE *create_cert_store(const char *CApath, const char *CAfile,
     if (CAfile != NULL) {
         lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_file());
         if (lookup == NULL) {
-            BIO_printf(bio_err, "memory allocation failure\n");
+            BIO_puts(bio_err, "memory allocation failure\n");
             goto err;
         }
         if (X509_LOOKUP_load_file_ex(lookup, CAfile, X509_FILETYPE_PEM, libctx,
@@ -1036,7 +1024,7 @@ static X509_STORE *create_cert_store(const char *CApath, const char *CAfile,
     if (CAstore != NULL) {
         lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_store());
         if (lookup == NULL) {
-            BIO_printf(bio_err, "memory allocation failure\n");
+            BIO_puts(bio_err, "memory allocation failure\n");
             goto err;
         }
         if (X509_LOOKUP_add_store_ex(lookup, CAstore, libctx, propq) <= 0) {
diff --git a/deps/openssl/openssl/apps/tsget.in b/deps/openssl/openssl/apps/tsget.in
index 8eab6a8f1f5..311ad2ed5ec 100644
--- a/deps/openssl/openssl/apps/tsget.in
+++ b/deps/openssl/openssl/apps/tsget.in
@@ -1,5 +1,5 @@
 #!{- $config{HASHBANGPERL} -}
-# Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
 # Copyright (c) 2002 The OpenTSA Project. All rights reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -8,58 +8,42 @@
 # https://www.openssl.org/source/license.html

 use strict;
+use warnings;
 use IO::Handle;
 use Getopt::Std;
 use File::Basename;
-use WWW::Curl::Easy;
+use File::Temp qw(tempfile);
+use Net::Curl::Easy qw(:constants);

 use vars qw(%options);

-# Callback for reading the body.
-sub read_body {
-    my ($maxlength, $state) = @_;
-    my $return_data = "";
-    my $data_len = length ${$state->{data}};
-    if ($state->{bytes} < $data_len) {
-        $data_len = $data_len - $state->{bytes};
-        $data_len = $maxlength if $data_len > $maxlength;
-        $return_data = substr ${$state->{data}}, $state->{bytes}, $data_len;
-        $state->{bytes} += $data_len;
-    }
-    return $return_data;
+sub usage {
+    print STDERR "usage: $0 -h <server_url> [-e <extension>] [-o <output>] ";
+    print STDERR "[-v] [-d] [-k <private_key.pem>] [-p <key_password>] ";
+    print STDERR "[-c <client_cert.pem>] [-C <CA_certs.pem>] [-P <CA_path>] ";
+    print STDERR "[-r <file:file...>] [-g <EGD_socket>] [<request>]...\n";
+    exit 1;
 }

-# Callback for writing the body into a variable.
-sub write_body {
-    my ($data, $pointer) = @_;
-    ${$pointer} .= $data;
-    return length($data);
+sub progress {
+    return unless $options{v};
+    STDERR->printflush(@_);
 }

 # Initialise a new Curl object.
 sub create_curl {
-    my $url = shift;
+    my ($url) = @_;

-    # Create Curl object.
-    my $curl = WWW::Curl::Easy::new();
+    my $curl = Net::Curl::Easy->new();

-    # Error-handling related options.
     $curl->setopt(CURLOPT_VERBOSE, 1) if $options{d};
     $curl->setopt(CURLOPT_FAILONERROR, 1);
     $curl->setopt(CURLOPT_USERAGENT,
         "OpenTSA tsget.pl/openssl-{- $config{full_version} -}");

-    # Options for POST method.
-    $curl->setopt(CURLOPT_UPLOAD, 1);
-    $curl->setopt(CURLOPT_CUSTOMREQUEST, "POST");
     $curl->setopt(CURLOPT_HTTPHEADER,
         ["Content-Type: application/timestamp-query",
         "Accept: application/timestamp-reply,application/timestamp-response"]);
-    $curl->setopt(CURLOPT_READFUNCTION, \&read_body);
-    $curl->setopt(CURLOPT_HEADERFUNCTION, sub { return length($_[0]); });
-
-    # Options for getting the result.
-    $curl->setopt(CURLOPT_WRITEFUNCTION, \&write_body);

     # SSL related options.
     $curl->setopt(CURLOPT_SSLKEYTYPE, "PEM");
@@ -70,6 +54,9 @@ sub create_curl {
     $curl->setopt(CURLOPT_SSLCERT, $options{c}) if defined($options{c});
     $curl->setopt(CURLOPT_CAINFO, $options{C}) if defined($options{C});
     $curl->setopt(CURLOPT_CAPATH, $options{P}) if defined($options{P});
+
+    # CURLOPT_RANDOM_FILE and CURLOPT_EGDSOCKET are deprecated no-ops in libcurl;
+    # they still exist as constants and return success, so no eval is needed.
     $curl->setopt(CURLOPT_RANDOM_FILE, $options{r}) if defined($options{r});
     $curl->setopt(CURLOPT_EGDSOCKET, $options{g}) if defined($options{g});

@@ -79,122 +66,121 @@ sub create_curl {
     return $curl;
 }

-# Send a request and returns the body back.
-sub get_timestamp {
-    my $curl = shift;
-    my $body = shift;
-    my $ts_body;
-    local $::error_buf;
-
-    # Error-handling related options.
-    $curl->setopt(CURLOPT_ERRORBUFFER, "::error_buf");
-
-    # Options for POST method.
-    $curl->setopt(CURLOPT_INFILE, {data => $body, bytes => 0});
-    $curl->setopt(CURLOPT_INFILESIZE, length(${$body}));
-
-    # Options for getting the result.
-    $curl->setopt(CURLOPT_FILE, \$ts_body);
-
-    # Send the request...
-    my $error_code = $curl->perform();
-    my $error_string;
-    if ($error_code != 0) {
-        my $http_code = $curl->getinfo(CURLINFO_HTTP_CODE);
-        $error_string = "could not get timestamp";
-        $error_string .= ", http code: $http_code" unless $http_code == 0;
-        $error_string .= ", curl code: $error_code";
-        $error_string .= " ($::error_buf)" if defined($::error_buf);
-    } else {
-        my $ct = $curl->getinfo(CURLINFO_CONTENT_TYPE);
-        if (lc($ct) ne "application/timestamp-reply"
-            && lc($ct) ne "application/timestamp-response") {
-            $error_string = "unexpected content type returned: $ct";
-        }
+# Send a request, writing the response to the given filehandle.
+# Returns an error string on network/protocol failure, undef on success.
+sub send_request {
+    my ($curl, $body, $out_fh) = @_;
+
+    $curl->setopt(CURLOPT_POST, 1);
+    $curl->setopt(CURLOPT_POSTFIELDS, $body);
+    $curl->setopt(CURLOPT_POSTFIELDSIZE, length($body));
+    $curl->setopt(CURLOPT_WRITEDATA, $out_fh);
+
+    my $ok = eval { $curl->perform(); 1; };
+
+    if (!$ok) {
+        my $http_code = eval { $curl->getinfo(CURLINFO_HTTP_CODE) } // 0;
+        my $curl_err  = eval { $curl->error() } // "";
+        my $err = "could not get timestamp";
+        $err .= ", http code: $http_code" if $http_code != 0;
+        $err .= " ($curl_err)" if length($curl_err);
+        return $err;
     }
-    return ($ts_body, $error_string);

-}
+    my $downloaded = $curl->getinfo(CURLINFO_SIZE_DOWNLOAD);
+    if (!defined($downloaded) || $downloaded == 0) {
+        return "empty response received";
+    }

-# Print usage information and exists.
-sub usage {
+    my $ct = $curl->getinfo(CURLINFO_CONTENT_TYPE);
+    if (!defined($ct)
+            || (lc($ct) ne "application/timestamp-reply"
+                && lc($ct) ne "application/timestamp-response")) {
+        return "unexpected content type returned: "
+            . (defined($ct) ? $ct : "(none)");
+    }

-    print STDERR "usage: $0 -h <server_url> [-e <extension>] [-o <output>] ";
-    print STDERR "[-v] [-d] [-k <private_key.pem>] [-p <key_password>] ";
-    print STDERR "[-c <client_cert.pem>] [-C <CA_certs.pem>] [-P <CA_path>] ";
-    print STDERR "[-r <file:file...>] [-g <EGD_socket>] [<request>]...\n";
-    exit 1;
+    return undef;
 }

-# ----------------------------------------------------------------------
-#   Main program
-# ----------------------------------------------------------------------
+my $getopt_arg = "h:e:o:vdk:p:c:C:P:r:g:";

 # Getting command-line options (default comes from TSGET environment variable).
-my $getopt_arg =  "h:e:o:vdk:p:c:C:P:r:g:";
 if (exists $ENV{TSGET}) {
-    my @old_argv = @ARGV;
+    my @saved_argv = @ARGV;
     @ARGV = split /\s+/, $ENV{TSGET};
     getopts($getopt_arg, \%options) or usage;
-    @ARGV = @old_argv;
+    @ARGV = @saved_argv;
 }
 getopts($getopt_arg, \%options) or usage;

-# Checking argument consistency.
-if (!exists($options{h}) || (@ARGV == 0 && !exists($options{o}))
-    || (@ARGV > 1 && exists($options{o}))) {
+if (!defined($options{h}) || (@ARGV == 0 && !defined($options{o}))
+    || (@ARGV > 1 && defined($options{o}))) {
     print STDERR "Inconsistent command line options.\n";
     usage;
 }
-# Setting defaults.
-@ARGV = ("-") unless @ARGV != 0;
+@ARGV = ("-") unless @ARGV;
 $options{e} = ".tsr" unless defined($options{e});

-# Processing requests.
-my $curl = create_curl $options{h};
-undef $/;   # For reading whole files.
-REQUEST: foreach (@ARGV) {
-    my $input = $_;
+my $curl = create_curl($options{h});
+undef $/;
+
+REQUEST: for my $input (@ARGV) {
     my ($base, $path) = fileparse($input, '\.[^.]*');
-    my $output_base = $base . $options{e};
-    my $output = defined($options{o}) ? $options{o} : $path . $output_base;
+    my $output = defined($options{o}) ? $options{o} : $path . $base . $options{e};

-    STDERR->printflush("$input: ") if $options{v};
-    # Read request.
+    progress("$input: ");
     my $body;
     if ($input eq "-") {
-        # Read the request from STDIN;
+        binmode STDIN;
         $body = <STDIN>;
     } else {
-        # Read the request from file.
-        open INPUT, "<" . $input
+        open my $in, '<', $input
             or warn("$input: could not open input file: $!\n"), next REQUEST;
-        $body = <INPUT>;
-        close INPUT
+        binmode $in;
+        $body = <$in>;
+        close $in
             or warn("$input: could not close input file: $!\n"), next REQUEST;
     }

-    # Send request.
-    STDERR->printflush("sending request") if $options{v};
-
-    my ($ts_body, $error) = get_timestamp $curl, \$body;
-    if (defined($error)) {
-        die "$input: fatal error: $error\n";
-    }
-    STDERR->printflush(", reply received") if $options{v};
+    progress("sending request");

-    # Write response.
+    my $error;
     if ($output eq "-") {
-        # Write to STDOUT.
-        print $ts_body;
+        # Write to STDOUT directly.
+        binmode STDOUT;
+        $error = send_request($curl, $body, \*STDOUT);
+        die "$input: fatal error: $error\n" if defined($error);
     } else {
-        # Write to file.
-        open OUTPUT, ">", $output
-            or warn("$output: could not open output file: $!\n"), next REQUEST;
-        print OUTPUT $ts_body;
-        close OUTPUT
-            or warn("$output: could not close output file: $!\n"), next REQUEST;
+        # Write to a temp file first; rename to $output only on success so
+        # that a pre-existing output file is not clobbered on failure.
+        # Preserve the existing file's permissions; fall back to umask defaults.
+        my @st = stat($output);
+        my $mode = @st ? ($st[2] & 07777) : (0666 & ~umask());
+        my ($tmp_fh, $tmp_path) = eval {
+            tempfile(DIR => dirname($output), UNLINK => 1);
+        };
+        if (!defined($tmp_fh)) {
+            warn("$output: could not create temp file: $@\n");
+            next REQUEST;
+        }
+        chmod($mode, $tmp_path);
+        binmode $tmp_fh;
+
+        $error = send_request($curl, $body, $tmp_fh);
+        close $tmp_fh;
+
+        if (defined($error)) {
+            unlink $tmp_path;
+            die "$input: fatal error: $error\n";
+        }
+
+        rename($tmp_path, $output)
+            or do { unlink $tmp_path;
+                    warn("$output: could not rename temp file: $!\n");
+                    next REQUEST; };
     }
-    STDERR->printflush(", $output written.\n") if $options{v};
+
+    progress(", reply received");
+    progress(", $output written.\n");
 }
-$curl->cleanup();
diff --git a/deps/openssl/openssl/apps/verify.c b/deps/openssl/openssl/apps/verify.c
index 13185e605d3..d16ccbaac05 100644
--- a/deps/openssl/openssl/apps/verify.c
+++ b/deps/openssl/openssl/apps/verify.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -27,7 +27,6 @@ static int v_verbose = 0, vflags = 0;

 typedef enum OPTION_choice {
     OPT_COMMON,
-    OPT_ENGINE,
     OPT_CAPATH,
     OPT_CAFILE,
     OPT_CASTORE,
@@ -51,18 +50,15 @@ const OPTIONS verify_options[] = {

     OPT_SECTION("General"),
     { "help", OPT_HELP, '-', "Display this summary" },
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif
     { "verbose", OPT_VERBOSE, '-',
         "Print extra information about the operations being performed." },
     { "nameopt", OPT_NAMEOPT, 's', "Certificate subject/issuer name printing options" },

     OPT_SECTION("Certificate chain"),
     { "trusted", OPT_TRUSTED, '<', "A file of trusted certificates" },
-    { "CAfile", OPT_CAFILE, '<', "A file of trusted certificates" },
-    { "CApath", OPT_CAPATH, '/', "A directory of files with trusted certificates" },
-    { "CAstore", OPT_CASTORE, ':', "URI to a store of trusted certificates" },
+    { "CAfile", OPT_CAFILE, '<', "File in PEM format with trusted CA certs" },
+    { "CApath", OPT_CAPATH, '/', "Dir with trusted CA cert files in PEM format" },
+    { "CAstore", OPT_CASTORE, ':', "URI of store with trusted CA certs" },
     { "no-CAfile", OPT_NOCAFILE, '-',
         "Do not load the default trusted certificates file" },
     { "no-CApath", OPT_NOCAPATH, '-',
@@ -89,7 +85,6 @@ const OPTIONS verify_options[] = {

 int verify_main(int argc, char **argv)
 {
-    ENGINE *e = NULL;
     STACK_OF(X509) *untrusted = NULL, *trusted = NULL;
     STACK_OF(X509_CRL) *crls = NULL;
     STACK_OF(OPENSSL_STRING) *vfyopts = NULL;
@@ -113,7 +108,7 @@ int verify_main(int argc, char **argv)
             goto end;
         case OPT_HELP:
             opt_help(verify_options);
-            BIO_printf(bio_err, "\nRecognized certificate chain purposes:\n");
+            BIO_puts(bio_err, "\nRecognized certificate chain purposes:\n");
             for (i = 0; i < X509_PURPOSE_get_count(); i++) {
                 X509_PURPOSE *ptmp = X509_PURPOSE_get0(i);

@@ -122,7 +117,7 @@ int verify_main(int argc, char **argv)
                     X509_PURPOSE_get0_name(ptmp));
             }

-            BIO_printf(bio_err, "Recognized certificate policy names:\n");
+            BIO_puts(bio_err, "Recognized certificate policy names:\n");
             for (i = 0; i < X509_VERIFY_PARAM_get_count(); i++) {
                 const X509_VERIFY_PARAM *vptmp = X509_VERIFY_PARAM_get0(i);

@@ -176,12 +171,6 @@ int verify_main(int argc, char **argv)
         case OPT_CRL_DOWNLOAD:
             crl_download = 1;
             break;
-        case OPT_ENGINE:
-            if ((e = setup_engine(opt_arg(), 0)) == NULL) {
-                /* Failure message already displayed */
-                goto end;
-            }
-            break;
         case OPT_SHOW_CHAIN:
             show_chain = 1;
             break;
@@ -252,7 +241,6 @@ end:
     OSSL_STACK_OF_X509_free(trusted);
     sk_X509_CRL_pop_free(crls, X509_CRL_free);
     sk_OPENSSL_STRING_free(vfyopts);
-    release_engine(e);
     return (ret < 0 ? 2 : ret);
 }

@@ -311,7 +299,7 @@ static int check(X509_STORE *ctx, const char *file,

             chain = X509_STORE_CTX_get1_chain(csc);
             num_untrusted = X509_STORE_CTX_get_num_untrusted(csc);
-            BIO_printf(bio_out, "Chain:\n");
+            BIO_puts(bio_out, "Chain:\n");
             for (j = 0; j < sk_X509_num(chain); j++) {
                 X509 *cert = sk_X509_value(chain, j);
                 BIO_printf(bio_out, "depth=%d: ", j);
@@ -319,8 +307,8 @@ static int check(X509_STORE *ctx, const char *file,
                     X509_get_subject_name(cert),
                     0, get_nameopt());
                 if (j < num_untrusted)
-                    BIO_printf(bio_out, " (untrusted)");
-                BIO_printf(bio_out, "\n");
+                    BIO_puts(bio_out, " (untrusted)");
+                BIO_puts(bio_out, "\n");
             }
             OSSL_STACK_OF_X509_free(chain);
         }
@@ -342,14 +330,14 @@ end:
 static int cb(int ok, X509_STORE_CTX *ctx)
 {
     int cert_error = X509_STORE_CTX_get_error(ctx);
-    X509 *current_cert = X509_STORE_CTX_get_current_cert(ctx);
+    const X509 *current_cert = X509_STORE_CTX_get_current_cert(ctx);

     if (!ok) {
         if (current_cert != NULL) {
             X509_NAME_print_ex(bio_err,
                 X509_get_subject_name(current_cert),
                 0, get_nameopt());
-            BIO_printf(bio_err, "\n");
+            BIO_puts(bio_err, "\n");
         }
         BIO_printf(bio_err, "%serror %d at %d depth lookup: %s\n",
             X509_STORE_CTX_get0_parent_ctx(ctx) ? "[CRL path] " : "",
diff --git a/deps/openssl/openssl/apps/version.c b/deps/openssl/openssl/apps/version.c
index 4d876aef3f0..8bd1b31e4f8 100644
--- a/deps/openssl/openssl/apps/version.c
+++ b/deps/openssl/openssl/apps/version.c
@@ -20,7 +20,6 @@ typedef enum OPTION_choice {
     OPT_COMMON,
     OPT_B,
     OPT_D,
-    OPT_E,
     OPT_M,
     OPT_F,
     OPT_O,
@@ -43,7 +42,6 @@ const OPTIONS version_options[] = {
     { "a", OPT_A, '-', "Show all data" },
     { "b", OPT_B, '-', "Show build date" },
     { "d", OPT_D, '-', "Show configuration directory" },
-    { "e", OPT_E, '-', "Show engines directory" },
     { "m", OPT_M, '-', "Show modules directory" },
     { "f", OPT_F, '-', "Show compiler flags used" },
     { "o", OPT_O, '-', "Show some internal datatype options" },
@@ -61,7 +59,7 @@ int version_main(int argc, char **argv)
 {
     int ret = 1, dirty = 0, seed = 0;
     int cflags = 0, version = 0, date = 0, options = 0, platform = 0, dir = 0;
-    int engdir = 0, moddir = 0, cpuinfo = 0;
+    int moddir = 0, cpuinfo = 0;
 #if defined(_WIN32)
     int windows = 0;
 #endif
@@ -86,9 +84,6 @@ int version_main(int argc, char **argv)
         case OPT_D:
             dirty = dir = 1;
             break;
-        case OPT_E:
-            dirty = engdir = 1;
-            break;
         case OPT_M:
             dirty = moddir = 1;
             break;
@@ -117,7 +112,7 @@ int version_main(int argc, char **argv)
 #endif
         case OPT_A:
             seed = options = cflags = version = date = platform
-                = dir = engdir = moddir = cpuinfo
+                = dir = moddir = cpuinfo
                 = 1;
             break;
         }
@@ -146,8 +141,6 @@ int version_main(int argc, char **argv)
         printf("%s\n", OpenSSL_version(OPENSSL_CFLAGS));
     if (dir)
         printf("%s\n", OpenSSL_version(OPENSSL_DIR));
-    if (engdir)
-        printf("%s\n", OpenSSL_version(OPENSSL_ENGINES_DIR));
     if (moddir)
         printf("%s\n", OpenSSL_version(OPENSSL_MODULES_DIR));
     if (seed) {
diff --git a/deps/openssl/openssl/apps/x509.c b/deps/openssl/openssl/apps/x509.c
index eb7737a1330..c8cd9229f4c 100644
--- a/deps/openssl/openssl/apps/x509.c
+++ b/deps/openssl/openssl/apps/x509.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -76,6 +76,7 @@ typedef enum OPTION_choice {
     OPT_SERIAL,
     OPT_NEXT_SERIAL,
     OPT_MODULUS,
+    OPT_MULTI,
     OPT_PUBKEY,
     OPT_X509TOREQ,
     OPT_TEXT,
@@ -105,7 +106,6 @@ typedef enum OPTION_choice {
     OPT_COPY_EXTENSIONS,
     OPT_BADSIG,
     OPT_MD,
-    OPT_ENGINE,
     OPT_NOCERT,
     OPT_PRESERVE_DATES,
     OPT_NOT_BEFORE,
@@ -135,8 +135,7 @@ const OPTIONS x509_options[] = {
         "Key for signing, and to include unless using -force_pubkey" },
     { "signkey", OPT_SIGNKEY, 's',
         "Same as -key" },
-    { "keyform", OPT_KEYFORM, 'E',
-        "Key input format (ENGINE, other values ignored)" },
+    { "keyform", OPT_KEYFORM, 'f', "Key input format (DER/PEM)" },
     { "out", OPT_OUT, '>', "Output file - default stdout" },
     { "outform", OPT_OUTFORM, 'f',
         "Output format (DER or PEM) - default PEM" },
@@ -179,6 +178,7 @@ const OPTIONS x509_options[] = {
     { "purpose", OPT_PURPOSE, '-', "Print out certificate purposes" },
     { "pubkey", OPT_PUBKEY, '-', "Print the public key in PEM format" },
     { "modulus", OPT_MODULUS, '-', "Print the RSA key modulus" },
+    { "multi", OPT_MULTI, '-', "Process multiple certificates" },

     OPT_SECTION("Certificate checking"),
     { "checkend", OPT_CHECKEND, 'M',
@@ -197,7 +197,7 @@ const OPTIONS x509_options[] = {
         "[CC]YYMMDDHHMMSSZ value for notBefore certificate field" },
     { "not_after", OPT_NOT_AFTER, 's',
         "[CC]YYMMDDHHMMSSZ value for notAfter certificate field, overrides -days" },
-    { "days", OPT_DAYS, 'n',
+    { "days", OPT_DAYS, 'p',
         "Number of days until newly generated certificate expires - default 30" },
     { "preserve_dates", OPT_PRESERVE_DATES, '-',
         "Preserve existing validity dates" },
@@ -221,8 +221,7 @@ const OPTIONS x509_options[] = {
         "Use the given CA certificate, conflicts with -key" },
     { "CAform", OPT_CAFORM, 'F', "CA cert format (PEM/DER/P12); has no effect" },
     { "CAkey", OPT_CAKEY, 's', "The corresponding CA key; default is -CA arg" },
-    { "CAkeyform", OPT_CAKEYFORM, 'E',
-        "CA key format (ENGINE, other values ignored)" },
+    { "CAkeyform", OPT_CAKEYFORM, 'f', "CA key format (DER/PEM)" },
     { "CAserial", OPT_CASERIAL, 's',
         "File that keeps track of CA-generated serial number" },
     { "CAcreateserial", OPT_CACREATESERIAL, '-',
@@ -239,9 +238,6 @@ const OPTIONS x509_options[] = {
         "Reject certificate for a given purpose" },

     OPT_R_OPTIONS,
-#ifndef OPENSSL_NO_ENGINE
-    { "engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device" },
-#endif
     OPT_PROV_OPTIONS,
     { NULL }
 };
@@ -278,7 +274,7 @@ static X509_REQ *x509_to_req(X509 *cert, int ext_copy, const char *names)
         goto err;
     for (i = 0; i < n; i++) {
         X509_EXTENSION *ex = sk_X509_EXTENSION_value(cert_exts, i);
-        ASN1_OBJECT *obj = X509_EXTENSION_get_object(ex);
+        const ASN1_OBJECT *obj = X509_EXTENSION_get_object(ex);

         if (OBJ_cmp(obj, skid) != 0 && OBJ_cmp(obj, akid) != 0
             && !sk_X509_EXTENSION_push(exts, ex))
@@ -288,7 +284,7 @@ static X509_REQ *x509_to_req(X509 *cert, int ext_copy, const char *names)
     if (sk_X509_EXTENSION_num(exts) > 0) {
         if (ext_copy != EXT_COPY_UNSET && ext_copy != EXT_COPY_NONE
             && !X509_REQ_add_extensions(req, exts)) {
-            BIO_printf(bio_err, "Error copying extensions from certificate\n");
+            BIO_puts(bio_err, "Error copying extensions from certificate\n");
             goto err;
         }
     }
@@ -307,7 +303,7 @@ static int self_signed(X509_STORE *ctx, X509 *cert)
     int ret = 0;

     if (xsc == NULL || !X509_STORE_CTX_init(xsc, ctx, cert, NULL)) {
-        BIO_printf(bio_err, "Error initialising X509 store\n");
+        BIO_puts(bio_err, "Error initialising X509 store\n");
     } else {
         X509_STORE_CTX_set_flags(xsc, X509_V_FLAG_CHECK_SS_SIGNATURE);
         ret = X509_verify_cert(xsc) > 0;
@@ -316,17 +312,68 @@ static int self_signed(X509_STORE *ctx, X509 *cert)
     return ret;
 }

+static int add_object(STACK_OF(ASN1_OBJECT) **sk, const char *name,
+    const char *desc, const char *prog)
+{
+    ASN1_OBJECT *obj = NULL;
+
+    if (*sk == NULL && (*sk = sk_ASN1_OBJECT_new_null()) == NULL)
+        return 0;
+    if ((obj = OBJ_txt2obj(name, 0)) == NULL) {
+        BIO_printf(bio_err, "%s: Unknown %s object value: %s\n", prog, desc, name);
+        return 0;
+    }
+    if (sk_ASN1_OBJECT_push(*sk, obj) != 0)
+        return 1;
+
+    ASN1_OBJECT_free(obj);
+    return 0;
+}
+
+static CONF *load_ext_conf(const char *file, const char *sect, int quiet)
+{
+    BIO *bio = NULL;
+    CONF *conf;
+
+    if (file == NULL)
+        file = default_config_file;
+    if (file != NULL && *file != '\0')
+        bio = bio_open_default_quiet(file, 'r', FORMAT_TEXT);
+    else if (!quiet) {
+        BIO_puts(bio_err, "The -extfile option, or else the default "
+                          "configuration filename must be nonempty");
+        return NULL;
+    }
+
+    if (bio == NULL) {
+        if (!quiet)
+            BIO_printf(bio_err, "Error opening: %s\n", file);
+        return NULL;
+    }
+
+    conf = NCONF_new_ex(app_get0_libctx(), NULL);
+    if (conf != NULL && NCONF_load_bio(conf, bio, NULL) <= 0) {
+        NCONF_free(conf);
+        conf = NULL;
+    }
+    BIO_free(bio);
+    if (conf != NULL)
+        return conf;
+    if (!quiet)
+        BIO_printf(bio_err, "Error loading configuration from: %s\n", file);
+    return conf;
+}
+
 int x509_main(int argc, char **argv)
 {
     ASN1_INTEGER *sno = NULL;
-    ASN1_OBJECT *objtmp = NULL;
     BIO *out = NULL;
     CONF *extconf = NULL;
     int ext_copy = EXT_COPY_UNSET;
     X509V3_CTX ext_ctx;
     EVP_PKEY *privkey = NULL, *CAkey = NULL, *pubkey = NULL;
     EVP_PKEY *pkey;
-    int newcert = 0;
+    int newcert = 0, newout = 0;
     char *issu = NULL, *subj = NULL, *digest = NULL;
     X509_NAME *fissu = NULL, *fsubj = NULL;
     const unsigned long chtype = MBSTRING_ASC;
@@ -338,12 +385,13 @@ int x509_main(int argc, char **argv)
     X509_STORE *ctx = NULL;
     char *CAkeyfile = NULL, *CAserial = NULL, *pubkeyfile = NULL, *alias = NULL;
     char *checkhost = NULL, *checkemail = NULL, *checkip = NULL;
+    STACK_OF(X509) *certs = NULL;
     char *ext_names = NULL;
     char *extsect = NULL, *extfile = NULL, *passin = NULL, *passinarg = NULL;
     char *infile = NULL, *outfile = NULL, *privkeyfile = NULL, *CAfile = NULL;
     char *prog, *not_before = NULL, *not_after = NULL;
     int days = UNSET_DAYS; /* not explicitly set */
-    int x509toreq = 0, modulus = 0, print_pubkey = 0, pprint = 0;
+    int x509toreq = 0, modulus = 0, multi = 0, print_pubkey = 0, pprint = 0;
     int CAformat = FORMAT_UNDEF, CAkeyformat = FORMAT_UNDEF;
     unsigned long dateopt = ASN1_DTFLGS_RFC822;
     int fingerprint = 0, reqfile = 0, checkend = 0;
@@ -351,14 +399,13 @@ int x509_main(int argc, char **argv)
     int next_serial = 0, subject_hash = 0, issuer_hash = 0, ocspid = 0;
     int noout = 0, CA_createserial = 0, email = 0;
     int ocsp_uri = 0, trustout = 0, clrtrust = 0, clrreject = 0, aliasout = 0;
-    int ret = 1, i, j, num = 0, badsig = 0, clrext = 0, nocert = 0;
+    int ret = 1, i, j, k = 0, num = 0, badsig = 0, clrext = 0, nocert = 0;
     int text = 0, serial = 0, subject = 0, issuer = 0, startdate = 0, ext = 0;
     int enddate = 0;
     time_t checkoffset = 0;
     unsigned long certflag = 0;
     int preserve_dates = 0;
     OPTION_CHOICE o;
-    ENGINE *e = NULL;
 #ifndef OPENSSL_NO_MD5
     int subject_hash_old = 0, issuer_hash_old = 0;
 #endif
@@ -445,7 +492,7 @@ int x509_main(int argc, char **argv)
             not_after = opt_arg();
             break;
         case OPT_DAYS:
-            days = atoi(opt_arg());
+            days = opt_int_arg();
             if (days <= UNSET_DAYS) {
                 BIO_printf(bio_err, "%s: -days parameter arg must be >= -1\n",
                     prog);
@@ -484,7 +531,7 @@ int x509_main(int argc, char **argv)
             break;
         case OPT_SET_SERIAL:
             if (sno != NULL) {
-                BIO_printf(bio_err, "Serial number supplied twice\n");
+                BIO_puts(bio_err, "Serial number supplied twice\n");
                 goto opthelp;
             }
             if ((sno = s2i_ASN1_INTEGER(NULL, opt_arg())) == NULL)
@@ -503,27 +550,13 @@ int x509_main(int argc, char **argv)
             subj = opt_arg();
             break;
         case OPT_ADDTRUST:
-            if (trust == NULL && (trust = sk_ASN1_OBJECT_new_null()) == NULL)
-                goto err;
-            if ((objtmp = OBJ_txt2obj(opt_arg(), 0)) == NULL) {
-                BIO_printf(bio_err, "%s: Invalid trust object value %s\n",
-                    prog, opt_arg());
-                goto opthelp;
-            }
-            if (!sk_ASN1_OBJECT_push(trust, objtmp))
-                goto err;
+            if (!add_object(&trust, opt_arg(), "trust", prog))
+                goto end;
             trustout = 1;
             break;
         case OPT_ADDREJECT:
-            if (reject == NULL && (reject = sk_ASN1_OBJECT_new_null()) == NULL)
-                goto err;
-            if ((objtmp = OBJ_txt2obj(opt_arg(), 0)) == NULL) {
-                BIO_printf(bio_err, "%s: Invalid reject object value %s\n",
-                    prog, opt_arg());
-                goto opthelp;
-            }
-            if (!sk_ASN1_OBJECT_push(reject, objtmp))
-                goto err;
+            if (!add_object(&reject, opt_arg(), "reject", prog))
+                goto end;
             trustout = 1;
             break;
         case OPT_SETALIAS:
@@ -538,9 +571,6 @@ int x509_main(int argc, char **argv)
             if (!set_nameopt(opt_arg()))
                 goto opthelp;
             break;
-        case OPT_ENGINE:
-            e = setup_engine(opt_arg(), 0);
-            break;
         case OPT_EMAIL:
             email = ++num;
             break;
@@ -556,6 +586,9 @@ int x509_main(int argc, char **argv)
         case OPT_MODULUS:
             modulus = ++num;
             break;
+        case OPT_MULTI:
+            multi = 1;
+            break;
         case OPT_PUBKEY:
             print_pubkey = ++num;
             break;
@@ -680,25 +713,48 @@ int x509_main(int argc, char **argv)
     if (!opt_check_md(digest))
         goto opthelp;

+    if (reqfile || newcert || privkeyfile != NULL || CAfile != NULL)
+        newout = 1;
+    else if (sno != NULL
+        || not_before != NULL
+        || not_after != NULL
+        || days != UNSET_DAYS
+        || preserve_dates
+        || issu != NULL
+        || subj != NULL
+        || pubkeyfile != NULL
+        || clrext
+        || extfile != NULL
+        || extsect != NULL
+        || sigopts != NULL) {
+        BIO_printf(bio_err,
+            "The %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s and %s "
+            "options are only valid when signing a new certificate\n",
+            "set_serial", "not_before", "not_after", "days",
+            "preserve_dates", "set_issuer", "set_subject", "subj",
+            "force_pubkey", "clrext", "extfile", "extensions", "sigopt");
+        goto err;
+    }
+
     if (preserve_dates && not_before != NULL) {
-        BIO_printf(bio_err, "Cannot use -preserve_dates with -not_before option\n");
+        BIO_puts(bio_err, "Cannot use -preserve_dates with -not_before option\n");
         goto err;
     }
     if (preserve_dates && not_after != NULL) {
-        BIO_printf(bio_err, "Cannot use -preserve_dates with -not_after option\n");
+        BIO_puts(bio_err, "Cannot use -preserve_dates with -not_after option\n");
         goto err;
     }
     if (preserve_dates && days != UNSET_DAYS) {
-        BIO_printf(bio_err, "Cannot use -preserve_dates with -days option\n");
+        BIO_puts(bio_err, "Cannot use -preserve_dates with -days option\n");
         goto err;
     }
     if (days == UNSET_DAYS)
         days = DEFAULT_DAYS;
     else if (not_after != NULL)
-        BIO_printf(bio_err, "Warning: -not_after option overriding -days option\n");
+        BIO_puts(bio_err, "Warning: -not_after option overriding -days option\n");

     if (!app_passwd(passinarg, NULL, &passin, NULL)) {
-        BIO_printf(bio_err, "Error getting password\n");
+        BIO_puts(bio_err, "Error getting password\n");
         goto err;
     }

@@ -707,20 +763,20 @@ int x509_main(int argc, char **argv)
         goto err;

     if (newcert && infile != NULL) {
-        BIO_printf(bio_err, "The -in option cannot be used with -new\n");
+        BIO_puts(bio_err, "The -in option cannot be used with -new\n");
         goto err;
     }
     if (newcert && reqfile) {
-        BIO_printf(bio_err, "The -req option cannot be used with -new\n");
+        BIO_puts(bio_err, "The -req option cannot be used with -new\n");
         goto err;
     }
     if (privkeyfile != NULL) {
-        privkey = load_key(privkeyfile, keyformat, 0, passin, e, "private key");
+        privkey = load_key(privkeyfile, keyformat, 0, passin, "private key");
         if (privkey == NULL)
             goto err;
     }
     if (pubkeyfile != NULL) {
-        if ((pubkey = load_pubkey(pubkeyfile, keyformat, 0, NULL, e,
+        if ((pubkey = load_pubkey(pubkeyfile, keyformat, 0, NULL,
                  "explicitly set public key"))
             == NULL)
             goto err;
@@ -728,12 +784,12 @@ int x509_main(int argc, char **argv)

     if (newcert) {
         if (subj == NULL) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "The -new option requires a subject to be set using -subj\n");
             goto err;
         }
         if (privkeyfile == NULL && pubkeyfile == NULL) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "The -new option requires using the -key or -force_pubkey option\n");
             goto err;
         }
@@ -749,11 +805,11 @@ int x509_main(int argc, char **argv)
         CAkeyfile = CAfile;
     if (CAfile != NULL) {
         if (privkeyfile != NULL) {
-            BIO_printf(bio_err, "Cannot use both -key/-signkey and -CA option\n");
+            BIO_puts(bio_err, "Cannot use both -key/-signkey and -CA option\n");
             goto err;
         }
     } else {
-#define WARN_NO_CA(opt) BIO_printf(bio_err, \
+#define WARN_NO_CA(opt) BIO_puts(bio_err, \
     "Warning: ignoring " opt " option since -CA option is not given\n");
         if (CAkeyfile != NULL)
             WARN_NO_CA("-CAkey");
@@ -767,32 +823,47 @@ int x509_main(int argc, char **argv)
             WARN_NO_CA("-CAcreateserial");
     }

-    if (extfile == NULL) {
-        if (extsect != NULL)
-            BIO_printf(bio_err,
-                "Warning: ignoring -extensions option without -extfile\n");
-    } else {
+    /*
+     * Failure to find or process the default config file is silent, when no
+     * `-extensions` was specified.  Otherwise, the requested extensions
+     * section must be present.
+     */
+    int confquiet = extsect == NULL && extfile == NULL;
+    if (newout)
+        extconf = load_ext_conf(extfile, extsect, confquiet);
+
+    if (extconf != NULL) {
         X509V3_CTX ctx2;

-        if ((extconf = app_load_config(extfile)) == NULL)
-            goto err;
         if (extsect == NULL) {
             extsect = app_conf_try_string(extconf, "default", "extensions");
-            if (extsect == NULL)
+            /*
+             * If neither -extfile nor -extensions is provided, and the default
+             * config file's default section doesn't contain the "extensions"
+             * config option, extsect is left as NULL, which is then used
+             * as an indicator to avoid trying to load extensions.
+             */
+            if (extfile != NULL && extsect == NULL)
                 extsect = "default";
         }
-        X509V3_set_ctx_test(&ctx2);
-        X509V3_set_nconf(&ctx2, extconf);
-        if (!X509V3_EXT_add_nconf(extconf, &ctx2, extsect, NULL)) {
-            BIO_printf(bio_err,
-                "Error checking extension section %s\n", extsect);
-            goto err;
+        if (extsect != NULL) {
+            X509V3_set_ctx_test(&ctx2);
+            if (!do_EXT_add_nconf(extconf, extconf, &ctx2, NULL,
+                    "Error checking extension section %s\n", extsect))
+                goto err;
         }
+    } else if (newout && !confquiet) {
+        goto err;
+    }
+
+    if (multi && (reqfile || newcert)) {
+        BIO_puts(bio_err, "Error: -multi cannot be used with -req or -new\n");
+        goto err;
     }

     if (reqfile) {
         if (infile == NULL && isatty(fileno_stdin()))
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Warning: Reading cert request from stdin since no -in option is given\n");
         req = load_csr_autofmt(infile, informat, vfyopts,
             "certificate request input");
@@ -800,28 +871,28 @@ int x509_main(int argc, char **argv)
             goto err;

         if ((pkey = X509_REQ_get0_pubkey(req)) == NULL) {
-            BIO_printf(bio_err, "Error unpacking public key from CSR\n");
+            BIO_puts(bio_err, "Error unpacking public key from CSR\n");
             goto err;
         }
         i = do_X509_REQ_verify(req, pkey, vfyopts);
         if (i <= 0) {
-            BIO_printf(bio_err, i < 0 ? "Error while verifying certificate request self-signature\n" : "Certificate request self-signature did not match the contents\n");
+            BIO_puts(bio_err, i < 0 ? "Error while verifying certificate request self-signature\n" : "Certificate request self-signature did not match the contents\n");
             goto err;
         }
-        BIO_printf(bio_err, "Certificate request self-signature ok\n");
+        BIO_puts(bio_err, "Certificate request self-signature ok\n");

         print_name(bio_err, "subject=", X509_REQ_get_subject_name(req));
     } else if (!x509toreq && ext_copy != EXT_COPY_UNSET) {
-        BIO_printf(bio_err, "Warning: ignoring -copy_extensions since neither -x509toreq nor -req is given\n");
+        BIO_puts(bio_err, "Warning: ignoring -copy_extensions since neither -x509toreq nor -req is given\n");
     }

     if (reqfile || newcert) {
         if (preserve_dates)
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Warning: ignoring -preserve_dates option with -req or -new\n");
         preserve_dates = 0;
         if (privkeyfile == NULL && CAkeyfile == NULL) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "We need a private key to sign with, use -key or -CAkey or -CA with private key\n");
             goto err;
         }
@@ -834,21 +905,40 @@ int x509_main(int argc, char **argv)
         }
         if (req != NULL && ext_copy != EXT_COPY_UNSET) {
             if (clrext && ext_copy != EXT_COPY_NONE) {
-                BIO_printf(bio_err, "Must not use -clrext together with -copy_extensions\n");
+                BIO_puts(bio_err, "Must not use -clrext together with -copy_extensions\n");
                 goto err;
             } else if (!copy_extensions(x, req, ext_copy)) {
-                BIO_printf(bio_err, "Error copying extensions from request\n");
+                BIO_puts(bio_err, "Error copying extensions from request\n");
                 goto err;
             }
         }
     } else {
         if (infile == NULL && isatty(fileno_stdin()))
-            BIO_printf(bio_err,
-                "Warning: Reading certificate from stdin since no -in or -new option is given\n");
-        x = load_cert_pass(infile, informat, 1, passin, "certificate");
-        if (x == NULL)
-            goto err;
+            BIO_puts(bio_err,
+                "Warning: Reading certificate(s) from stdin since no -in or -new option is given\n");
+        if (multi) {
+            certs = sk_X509_new_null();
+            if (certs == NULL)
+                goto err;
+            if (!load_certs(infile, 1, &certs, passin, NULL))
+                goto err;
+            if (sk_X509_num(certs) <= 0)
+                goto err;
+        } else {
+            x = load_cert_pass(infile, informat, 1, passin, "certificate");
+            if (x == NULL)
+                goto err;
+        }
     }
+
+    out = bio_open_default(outfile, 'w', outformat);
+    if (out == NULL)
+        goto err;
+
+cert_loop:
+    if (multi)
+        x = sk_X509_value(certs, k);
+
     if ((fsubj != NULL || req != NULL)
         && !X509_set_subject_name(x, fsubj != NULL ? fsubj : X509_REQ_get_subject_name(req)))
         goto err;
@@ -863,10 +953,6 @@ int x509_main(int argc, char **argv)
             goto err;
     }

-    out = bio_open_default(outfile, 'w', outformat);
-    if (out == NULL)
-        goto err;
-
     if (alias)
         X509_alias_set1(x, (unsigned char *)alias, -1);

@@ -886,9 +972,9 @@ int x509_main(int argc, char **argv)
     }

     if (clrext && ext_names != NULL)
-        BIO_printf(bio_err, "Warning: Ignoring -ext since -clrext is given\n");
+        BIO_puts(bio_err, "Warning: Ignoring -ext since -clrext is given\n");
     for (i = X509_get_ext_count(x) - 1; i >= 0; i--) {
-        X509_EXTENSION *ex = X509_get_ext(x, i);
+        const X509_EXTENSION *ex = X509_get_ext(x, i);
         const char *sn = OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(ex)));

         if (clrext || (ext_names != NULL && strstr(ext_names, sn) == NULL))
@@ -906,7 +992,7 @@ int x509_main(int argc, char **argv)
             goto err;
     } else {
         if (privkey != NULL && !cert_matches_key(x, privkey))
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "Warning: Signature key and public key of cert do not match\n");
     }

@@ -931,41 +1017,35 @@ int x509_main(int argc, char **argv)
         if (!X509V3_set_issuer_pkey(&ext_ctx, privkey))
             goto err;
     }
-    if (extconf != NULL && !x509toreq) {
-        X509V3_set_nconf(&ext_ctx, extconf);
-        if (!X509V3_EXT_add_nconf(extconf, &ext_ctx, extsect, x)) {
-            BIO_printf(bio_err,
-                "Error adding extensions from section %s\n", extsect);
+    if (extconf != NULL && !x509toreq && extsect != NULL) {
+        if (!do_EXT_add_nconf(extconf, extconf, &ext_ctx, x,
+                "Error adding extensions from section %s\n", extsect))
             goto err;
-        }
     }

     /* At this point the contents of the certificate x have been finished. */

     pkey = X509_get0_pubkey(x);
     if ((print_pubkey != 0 || modulus != 0) && pkey == NULL) {
-        BIO_printf(bio_err, "Error getting public key\n");
+        BIO_puts(bio_err, "Error getting public key\n");
         goto err;
     }

     if (x509toreq) { /* also works in conjunction with -req */
         if (privkey == NULL) {
-            BIO_printf(bio_err, "Must specify request signing key using -key\n");
+            BIO_puts(bio_err, "Must specify request signing key using -key\n");
             goto err;
         }
         if (clrext && ext_copy != EXT_COPY_NONE) {
-            BIO_printf(bio_err, "Must not use -clrext together with -copy_extensions\n");
+            BIO_puts(bio_err, "Must not use -clrext together with -copy_extensions\n");
             goto err;
         }
         if ((rq = x509_to_req(x, ext_copy, ext_names)) == NULL)
             goto err;
-        if (extconf != NULL) {
-            X509V3_set_nconf(&ext_ctx, extconf);
-            if (!X509V3_EXT_REQ_add_nconf(extconf, &ext_ctx, extsect, rq)) {
-                BIO_printf(bio_err,
-                    "Error adding request extensions from section %s\n", extsect);
+        if (extconf != NULL && extsect != NULL) {
+            if (!do_EXT_REQ_add_nconf(extconf, extconf, &ext_ctx, rq,
+                    "Error adding request extensions from section %s\n", extsect))
                 goto err;
-            }
         }
         if (!do_X509_REQ_sign(rq, privkey, digest, sigopts))
             goto err;
@@ -977,7 +1057,7 @@ int x509_main(int argc, char **argv)
                 i = PEM_write_bio_X509_REQ(out, rq);
             }
             if (!i) {
-                BIO_printf(bio_err,
+                BIO_puts(bio_err,
                     "Unable to write certificate request\n");
                 goto err;
             }
@@ -985,11 +1065,11 @@ int x509_main(int argc, char **argv)
         noout = 1;
     } else if (CAfile != NULL) {
         if ((CAkey = load_key(CAkeyfile, CAkeyformat,
-                 0, passin, e, "CA private key"))
+                 0, passin, "CA private key"))
             == NULL)
             goto err;
         if (!X509_check_private_key(xca, CAkey)) {
-            BIO_printf(bio_err,
+            BIO_puts(bio_err,
                 "CA certificate and CA private key do not match\n");
             goto err;
         }
@@ -1004,7 +1084,9 @@ int x509_main(int argc, char **argv)
         const ASN1_BIT_STRING *signature;

         X509_get0_signature(&signature, NULL, x);
-        corrupt_signature(signature);
+        /* XXX Casts away const, because it mutates the value! */
+        if (!corrupt_signature(((ASN1_STRING *)signature)))
+            goto err;
     }

     /* Process print options in the given order, as indicated by index i */
@@ -1014,9 +1096,9 @@ int x509_main(int argc, char **argv)
         } else if (i == subject) {
             print_name(out, "subject=", X509_get_subject_name(x));
         } else if (i == serial) {
-            BIO_printf(out, "serial=");
+            BIO_puts(out, "serial=");
             i2a_ASN1_INTEGER(out, X509_get0_serialNumber(x));
-            BIO_printf(out, "\n");
+            BIO_puts(out, "\n");
         } else if (i == next_serial) {
             ASN1_INTEGER *ser;
             BIGNUM *bnser = ASN1_INTEGER_to_BN(X509_get0_serialNumber(x), NULL);
@@ -1039,7 +1121,7 @@ int x509_main(int argc, char **argv)
                 BIO_printf(out, "%s\n", sk_OPENSSL_STRING_value(emlst, j));
             X509_email_free(emlst);
         } else if (i == aliasout) {
-            unsigned char *alstr = X509_alias_get0(x, NULL);
+            const unsigned char *alstr = X509_alias_get0(x, NULL);

             if (alstr)
                 BIO_printf(out, "%s\n", alstr);
@@ -1058,11 +1140,11 @@ int x509_main(int argc, char **argv)
             BIO_printf(out, "%08lx\n", X509_issuer_name_hash_old(x));
 #endif
         } else if (i == pprint) {
-            BIO_printf(out, "Certificate purposes:\n");
+            BIO_puts(out, "Certificate purposes:\n");
             for (j = 0; j < X509_PURPOSE_get_count(); j++)
                 purpose_print(out, x, X509_PURPOSE_get0(j));
         } else if (i == modulus) {
-            BIO_printf(out, "Modulus=");
+            BIO_puts(out, "Modulus=");
             if (EVP_PKEY_is_a(pkey, "RSA") || EVP_PKEY_is_a(pkey, "RSA-PSS")) {
                 BIGNUM *n = NULL;

@@ -1078,9 +1160,9 @@ int x509_main(int argc, char **argv)
                 BN_print(out, dsapub);
                 BN_free(dsapub);
             } else {
-                BIO_printf(out, "No modulus for this public key type");
+                BIO_puts(out, "No modulus for this public key type");
             }
-            BIO_printf(out, "\n");
+            BIO_puts(out, "\n");
         } else if (i == print_pubkey) {
             PEM_write_bio_PUBKEY(out, pkey);
         } else if (i == text) {
@@ -1106,13 +1188,13 @@ int x509_main(int argc, char **argv)
             if ((fdig = EVP_MD_fetch(app_get0_libctx(), fdigname,
                      app_get0_propq()))
                 == NULL) {
-                BIO_printf(bio_err, "Unknown digest\n");
+                BIO_puts(bio_err, "Unknown digest\n");
                 goto err;
             }
             digres = X509_digest(x, fdig, md, &n);
             EVP_MD_free(fdig);
             if (!digres) {
-                BIO_printf(bio_err, "Out of memory\n");
+                BIO_puts(bio_err, "Out of memory\n");
                 goto err;
             }

@@ -1127,22 +1209,45 @@ int x509_main(int argc, char **argv)
     }

     if (checkend) {
+        X509_VERIFY_PARAM *vpm;
         time_t tcheck = time(NULL) + checkoffset;
+        int expired = 0;
+        int error;
+
+        if ((vpm = X509_VERIFY_PARAM_new()) == NULL) {
+            BIO_puts(out, "Malloc failed\n");
+            goto end_cert_loop;
+        }
+        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_USE_CHECK_TIME);
+        X509_VERIFY_PARAM_set_time(vpm, tcheck);

-        ret = X509_cmp_time(X509_get0_notAfter(x), &tcheck) < 0;
-        if (ret)
-            BIO_printf(out, "Certificate will expire\n");
+        if (!X509_check_certificate_times(vpm, x, &error)) {
+            if (error == X509_V_ERR_CERT_HAS_EXPIRED) {
+                BIO_puts(out, "Certificate will expire\n");
+                expired = 1;
+            }
+        } else {
+            BIO_puts(out, "Certificate will not expire\n");
+        }
+        if (multi && k > 0)
+            ret |= expired;
         else
-            BIO_printf(out, "Certificate will not expire\n");
-        goto end;
+            ret = expired;
+
+        X509_VERIFY_PARAM_free(vpm);
+        if (multi && k < sk_X509_num(certs) - 1)
+            goto end_cert_loop;
+        else
+            goto end;
     }

-    if (!check_cert_attributes(out, x, checkhost, checkemail, checkip, 1))
+    if (!check_cert_might_be_valid(out, bio_err, x, checkhost, checkemail,
+            checkip))
         goto err;

     if (noout || nocert) {
         ret = 0;
-        goto end;
+        goto end_cert_loop;
     }

     if (outformat == FORMAT_ASN1) {
@@ -1153,21 +1258,31 @@ int x509_main(int argc, char **argv)
         else
             i = PEM_write_bio_X509(out, x);
     } else {
-        BIO_printf(bio_err, "Bad output format specified for outfile\n");
+        BIO_puts(bio_err, "Bad output format specified for outfile\n");
         goto err;
     }
     if (!i) {
-        BIO_printf(bio_err, "Unable to write certificate\n");
+        BIO_puts(bio_err, "Unable to write certificate\n");
         goto err;
     }

+end_cert_loop:
+    if (multi && ++k < sk_X509_num(certs))
+        goto cert_loop;
+
     ret = 0;
     goto end;

 err:
+    /* Every path reaching this label is a failure path */
+    ret = 1;
     ERR_print_errors(bio_err);

 end:
+    if (multi) {
+        sk_X509_pop_free(certs, X509_free);
+        x = NULL;
+    }
     NCONF_free(extconf);
     BIO_free_all(out);
     X509_STORE_free(ctx);
@@ -1185,7 +1300,6 @@ end:
     ASN1_INTEGER_free(sno);
     sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);
     sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
-    release_engine(e);
     clear_free(passin);
     return ret;
 }
@@ -1214,7 +1328,7 @@ static ASN1_INTEGER *x509_load_serial(const char *CAfile,
         goto end;

     if (!BN_add_word(serial, 1)) {
-        BIO_printf(bio_err, "Serial number increment failure\n");
+        BIO_puts(bio_err, "Serial number increment failure\n");
         goto end;
     }

@@ -1232,7 +1346,7 @@ end:
 static int callb(int ok, X509_STORE_CTX *ctx)
 {
     int err;
-    X509 *err_cert;
+    const X509 *err_cert;

     /*
      * It is ok to use a self-signed certificate. This case will catch both
@@ -1265,9 +1379,9 @@ static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt)
         idret = X509_check_purpose(cert, id, i);
         BIO_printf(bio, "%s%s : ", pname, i ? " CA" : "");
         if (idret == 1)
-            BIO_printf(bio, "Yes\n");
+            BIO_puts(bio, "Yes\n");
         else if (idret == 0)
-            BIO_printf(bio, "No\n");
+            BIO_puts(bio, "No\n");
         else
             BIO_printf(bio, "Yes (WARNING code=%d)\n", idret);
     }
@@ -1280,7 +1394,7 @@ static int parse_ext_names(char *names, const char **result)
     int cnt = 0, len = 0;

     p = q = names;
-    len = strlen(names);
+    len = (int)strlen(names);

     while (q - names <= len) {
         if (*q != ',' && *q != '\0') {
@@ -1306,14 +1420,14 @@ static int print_x509v3_exts(BIO *bio, X509 *x, const char *ext_names)
     const STACK_OF(X509_EXTENSION) *exts = NULL;
     STACK_OF(X509_EXTENSION) *exts2 = NULL;
     X509_EXTENSION *ext = NULL;
-    ASN1_OBJECT *obj;
+    const ASN1_OBJECT *obj;
     int i, j, ret = 0, num, nn = 0;
     const char *sn, **names = NULL;
     char *tmp_ext_names = NULL;

     exts = X509_get0_extensions(x);
     if ((num = sk_X509_EXTENSION_num(exts)) <= 0) {
-        BIO_printf(bio_err, "No extensions in certificate\n");
+        BIO_puts(bio_err, "No extensions in certificate\n");
         ret = 1;
         goto end;
     }
@@ -1325,7 +1439,7 @@ static int print_x509v3_exts(BIO *bio, X509 *x, const char *ext_names)
         BIO_printf(bio, "Invalid extension names: %s\n", ext_names);
         goto end;
     }
-    if ((names = OPENSSL_malloc(sizeof(char *) * nn)) == NULL)
+    if ((names = OPENSSL_malloc_array(nn, sizeof(char *))) == NULL)
         goto end;
     parse_ext_names(tmp_ext_names, names);

diff --git a/deps/openssl/openssl/build.info b/deps/openssl/openssl/build.info
index 144efbbe20f..0f119268db8 100644
--- a/deps/openssl/openssl/build.info
+++ b/deps/openssl/openssl/build.info
@@ -1,16 +1,43 @@
 # Note that some of these directories are filtered in Configure.  Look for
 # %skipdir there for further explanations.
+{- use File::Spec::Functions;

-SUBDIRS=crypto ssl apps util tools fuzz providers doc
+   # The L table in crypto/err/openssl.ec names, for each error library,
+   # the files mkerr.pl emits for it: fields three onwards, with NONE
+   # where there is nothing to emit.
+   our @err_files = ();
+   my $ec = catfile($sourcedir, "crypto", "err", "openssl.ec");
+
+   open my $fh, "<", $ec or die "Can't read $ec, $!\n";
+   while (<$fh>) {
+       s|\R$||;
+       next unless m|^L\s|;
+       my @field = split /\s+/;
+       push @err_files, grep { $_ ne "NONE" } @field[2 .. $#field];
+   }
+   close $fh;
+
+   our $err_headers = join(" \\\n         ", grep { m|\.h$| } @err_files);
+   our $err_rules =
+       join("", map {
+                "GENERATE[$_]=util/mkerr.pl -internal \\\n"
+                . "    -conf \$(SRCDIR)/crypto/err/openssl.ec -emit $_\n"
+                . "DEPEND[$_]=crypto/err/openssl.ec crypto/err/openssl.txt\n"
+            } @err_files);
+
+   # Adding a library to the table above changes the rules below, so the
+   # configuration has to be redone when it changes.
+   push @{$config{build_infos}}, $ec;
+   ""
+-}
+
+SUBDIRS=crypto ssl apps util fuzz providers doc
 IF[{- !$disabled{tests} -}]
   SUBDIRS=test
 ENDIF
 IF[{- !$disabled{demos} -}]
   SUBDIRS=demos
 ENDIF
-IF[{- !$disabled{'deprecated-3.0'} -}]
-  SUBDIRS=engines
-ENDIF
 SUBDIRS=exporters

 LIBS=libcrypto libssl
@@ -35,6 +62,8 @@ DEPEND[]=include/openssl/asn1.h \
          include/openssl/ess.h \
          include/openssl/fipskey.h \
          include/openssl/lhash.h \
+         {- $err_headers -} \
+         include/openssl/obj_mac.h \
          include/openssl/opensslv.h \
          include/openssl/ocsp.h \
          include/openssl/pkcs12.h \
@@ -47,10 +76,117 @@ DEPEND[]=include/openssl/asn1.h \
          include/openssl/x509v3.h \
          include/openssl/x509_acert.h \
          include/openssl/x509_vfy.h \
-         include/crypto/bn_conf.h include/crypto/dso_conf.h \
-         include/internal/param_names.h crypto/params_idx.c
+         include/crypto/dso_conf.h \
+         include/crypto/ec_params.h \
+         include/crypto/rsa_params.h \
+         providers/implementations/asymciphers/rsa_enc.inc \
+         providers/implementations/asymciphers/sm2_enc.inc \
+         providers/implementations/exchange/dh_exch.inc \
+         providers/implementations/exchange/ecdh_exch.inc \
+         providers/implementations/exchange/ecx_exch.inc \
+         providers/implementations/encode_decode/decode_der2key.inc \
+         providers/implementations/encode_decode/decode_epki2pki.inc \
+         providers/implementations/encode_decode/decode_pem2der.inc \
+         providers/implementations/encode_decode/decode_pvk2key.inc \
+         providers/implementations/encode_decode/decode_spki2typespki.inc \
+         providers/implementations/encode_decode/encode_key2any.inc \
+         providers/implementations/encode_decode/encode_key2ms.inc \
+         providers/implementations/kdfs/argon2.inc \
+         providers/implementations/kdfs/hkdf.inc \
+         providers/implementations/kdfs/hmacdrbg_kdf.inc \
+         providers/implementations/kdfs/ikev2kdf.inc \
+         providers/implementations/kdfs/kbkdf.inc \
+         providers/implementations/kdfs/krb5kdf.inc \
+         providers/implementations/kdfs/pbkdf1.inc \
+         providers/implementations/kdfs/pbkdf2.inc \
+         providers/implementations/kdfs/pkcs12kdf.inc \
+         providers/implementations/kdfs/pvkkdf.inc \
+         providers/implementations/kdfs/scrypt.inc \
+         providers/implementations/kdfs/snmpkdf.inc \
+         providers/implementations/kdfs/srtpkdf.inc \
+         providers/implementations/kdfs/sshkdf.inc \
+         providers/implementations/kdfs/sskdf.inc \
+         providers/implementations/kdfs/tls1_prf.inc \
+         providers/implementations/kdfs/x942kdf.inc \
+         providers/implementations/kdfs/x963kdf.inc \
+         providers/implementations/kem/ec_kem.inc \
+         providers/implementations/kem/ecx_kem.inc \
+         providers/implementations/kem/ml_kem_kem.inc \
+         providers/implementations/kem/mlx_kem.inc \
+         providers/implementations/kem/rsa_kem.inc \
+         providers/implementations/keymgmt/dh_kmgmt.inc \
+         providers/implementations/keymgmt/dsa_kmgmt.inc \
+         providers/implementations/keymgmt/ecx_kmgmt.inc \
+         providers/implementations/keymgmt/keymgmtcommon.inc \
+         providers/implementations/keymgmt/lms_kmgmt.inc \
+         providers/implementations/keymgmt/mac_legacy_kmgmt.inc \
+         providers/implementations/keymgmt/ml_dsa_kmgmt.inc \
+         providers/implementations/keymgmt/ml_kem_kmgmt.inc \
+         providers/implementations/keymgmt/mlx_kmgmt.inc \
+         providers/implementations/keymgmt/slh_dsa_kmgmt.inc \
+         providers/implementations/keymgmt/template_kmgmt.inc \
+         providers/implementations/signature/dsa_sig.inc \
+         providers/implementations/signature/ecdsa_sig.inc \
+         providers/implementations/signature/eddsa_sig.inc \
+         providers/implementations/signature/lms_signature.inc \
+         providers/implementations/signature/mac_legacy_sig.inc \
+         providers/implementations/signature/ml_dsa_sig.inc \
+         providers/implementations/signature/rsa_sig.inc \
+         providers/implementations/signature/slh_dsa_sig.inc \
+         providers/implementations/signature/sm2_sig.inc \
+         providers/implementations/skeymgmt/generic.inc \
+         providers/implementations/storemgmt/file_store_any2obj.inc \
+         providers/implementations/storemgmt/file_store.inc \
+         providers/implementations/storemgmt/winstore_store.inc \
+         providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc \
+         providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.inc \
+         providers/implementations/ciphers/cipher_aes_gcm_siv.inc \
+         providers/implementations/ciphers/cipher_aes_ocb.inc \
+         providers/implementations/ciphers/cipher_aes_siv.inc \
+         providers/implementations/ciphers/cipher_aes_wrp.inc \
+         providers/implementations/ciphers/cipher_aes_xts.inc \
+         providers/implementations/ciphers/ciphercommon.inc \
+         providers/implementations/ciphers/ciphercommon_ccm.inc \
+         providers/implementations/ciphers/ciphercommon_gcm.inc \
+         providers/implementations/ciphers/cipher_chacha20.inc \
+         providers/implementations/ciphers/cipher_chacha20_poly1305.inc \
+         providers/implementations/ciphers/cipher_cts.inc \
+         providers/implementations/ciphers/cipher_des.inc \
+         providers/implementations/ciphers/cipher_null.inc \
+         providers/implementations/ciphers/cipher_rc2.inc \
+         providers/implementations/ciphers/cipher_rc4_hmac_md5.inc \
+         providers/implementations/ciphers/cipher_rc5.inc \
+         providers/implementations/ciphers/cipher_sm4_xts.inc \
+         providers/implementations/ciphers/cipher_tdes.inc \
+         providers/implementations/digests/blake2_prov.inc \
+         providers/implementations/digests/digestcommon.inc \
+         providers/implementations/digests/mdc2_prov.inc \
+         providers/implementations/digests/sha2_prov.inc \
+         providers/implementations/digests/sha3_prov.inc \
+         providers/implementations/digests/ml_dsa_mu_prov.inc \
+         providers/implementations/digests/cshake_prov.inc \
+         providers/implementations/include/prov/blake2_params.inc \
+         providers/implementations/macs/cmac_prov.inc \
+         providers/implementations/macs/gmac_prov.inc \
+         providers/implementations/macs/hmac_prov.inc \
+         providers/implementations/macs/kmac_prov.inc \
+         providers/implementations/macs/poly1305_prov.inc \
+         providers/implementations/macs/siphash_prov.inc \
+         providers/implementations/rands/drbg_ctr.inc \
+         providers/implementations/rands/drbg_hash.inc \
+         providers/implementations/rands/drbg_hmac.inc \
+         providers/implementations/rands/fips_crng_test.inc \
+         providers/implementations/rands/seed_src.inc \
+         providers/implementations/rands/seed_src_jitter.inc \
+         providers/implementations/rands/test_rng.inc

 GENERATE[include/openssl/asn1.h]=include/openssl/asn1.h.in
+
+{- $err_rules -}GENERATE[include/openssl/obj_mac.h]=crypto/objects/objects.pl \
+    -a $(SRCDIR)/crypto/objects/obj_compat.h \
+    $(SRCDIR)/crypto/objects/objects.txt $(SRCDIR)/crypto/objects/obj_mac.num
+DEPEND[include/openssl/obj_mac.h]=crypto/objects/objects.txt \
+    crypto/objects/obj_mac.num crypto/objects/obj_compat.h
 GENERATE[include/openssl/asn1t.h]=include/openssl/asn1t.h.in
 GENERATE[include/openssl/bio.h]=include/openssl/bio.h.in
 GENERATE[include/openssl/cmp.h]=include/openssl/cmp.h.in
@@ -80,14 +216,316 @@ GENERATE[include/openssl/x509.h]=include/openssl/x509.h.in
 GENERATE[include/openssl/x509v3.h]=include/openssl/x509v3.h.in
 GENERATE[include/openssl/x509_acert.h]=include/openssl/x509_acert.h.in
 GENERATE[include/openssl/x509_vfy.h]=include/openssl/x509_vfy.h.in
-GENERATE[include/crypto/bn_conf.h]=include/crypto/bn_conf.h.in
 GENERATE[include/crypto/dso_conf.h]=include/crypto/dso_conf.h.in

-DEPEND[crypto/params_idx.c \
-       include/internal/param_names.h \
+DEPEND[providers/implementations/asymciphers/rsa_enc.inc \
+       providers/implementations/asymciphers/sm2_enc.inc \
+       providers/implementations/exchange/dh_exch.inc \
+       providers/implementations/exchange/ecdh_exch.inc \
+       providers/implementations/exchange/ecx_exch.inc \
+       providers/implementations/encode_decode/decode_der2key.inc \
+       providers/implementations/encode_decode/decode_epki2pki.inc \
+       providers/implementations/encode_decode/decode_pem2der.inc \
+       providers/implementations/encode_decode/decode_pvk2key.inc \
+       providers/implementations/encode_decode/decode_spki2typespki.inc \
+       providers/implementations/encode_decode/encode_key2any.inc \
+       providers/implementations/encode_decode/encode_key2ms.inc \
+       providers/implementations/kdfs/argon2.inc \
+       providers/implementations/kdfs/hkdf.inc \
+       providers/implementations/kdfs/hmacdrbg_kdf.inc \
+       providers/implementations/kdfs/ikev2kdf.inc \
+       providers/implementations/kdfs/kbkdf.inc \
+       providers/implementations/kdfs/krb5kdf.inc \
+       providers/implementations/kdfs/pbkdf1.inc \
+       providers/implementations/kdfs/pbkdf2.inc \
+       providers/implementations/kdfs/pkcs12kdf.inc \
+       providers/implementations/kdfs/pvkkdf.inc \
+       providers/implementations/kdfs/scrypt.inc \
+       providers/implementations/kdfs/snmpkdf.inc \
+       providers/implementations/kdfs/srtpkdf.inc \
+       providers/implementations/kdfs/sshkdf.inc \
+       providers/implementations/kdfs/sskdf.inc \
+       providers/implementations/kdfs/tls1_prf.inc \
+       providers/implementations/kdfs/x942kdf.inc \
+       providers/implementations/kdfs/x963kdf.inc \
+       providers/implementations/kem/ec_kem.inc \
+       providers/implementations/kem/ecx_kem.inc \
+       providers/implementations/kem/ml_kem_kem.inc \
+       providers/implementations/kem/mlx_kem.inc \
+       providers/implementations/kem/rsa_kem.inc \
+       providers/implementations/keymgmt/dh_kmgmt.inc \
+       providers/implementations/keymgmt/dsa_kmgmt.inc \
+       providers/implementations/keymgmt/ecx_kmgmt.inc \
+       providers/implementations/keymgmt/keymgmtcommon.inc \
+       providers/implementations/keymgmt/lms_kmgmt.inc \
+       providers/implementations/keymgmt/mac_legacy_kmgmt.inc \
+       providers/implementations/keymgmt/ml_dsa_kmgmt.inc \
+       providers/implementations/keymgmt/ml_kem_kmgmt.inc \
+       providers/implementations/keymgmt/mlx_kmgmt.inc \
+       providers/implementations/keymgmt/slh_dsa_kmgmt.inc \
+       providers/implementations/keymgmt/template_kmgmt.inc \
+       providers/implementations/signature/dsa_sig.inc \
+       providers/implementations/signature/ecdsa_sig.inc \
+       providers/implementations/signature/eddsa_sig.inc \
+       providers/implementations/signature/lms_signature.inc \
+       providers/implementations/signature/mac_legacy_sig.inc \
+       providers/implementations/signature/ml_dsa_sig.inc \
+       providers/implementations/signature/rsa_sig.inc \
+       providers/implementations/signature/slh_dsa_sig.inc \
+       providers/implementations/signature/sm2_sig.inc \
+       providers/implementations/skeymgmt/generic.inc \
+       providers/implementations/storemgmt/file_store_any2obj.inc \
+       providers/implementations/storemgmt/file_store.inc \
+       providers/implementations/storemgmt/winstore_store.inc \
+       providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc \
+       providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.inc \
+       providers/implementations/ciphers/cipher_aes_gcm_siv.inc \
+       providers/implementations/ciphers/cipher_aes_ocb.inc \
+       providers/implementations/ciphers/cipher_aes_siv.inc \
+       providers/implementations/ciphers/cipher_aes_wrp.inc \
+       providers/implementations/ciphers/cipher_aes_xts.inc \
+       providers/implementations/ciphers/ciphercommon.inc \
+       providers/implementations/ciphers/ciphercommon_ccm.inc \
+       providers/implementations/ciphers/ciphercommon_gcm.inc \
+       providers/implementations/ciphers/cipher_chacha20.inc \
+       providers/implementations/ciphers/cipher_chacha20_poly1305.inc \
+       providers/implementations/ciphers/cipher_cts.inc \
+       providers/implementations/ciphers/cipher_des.inc \
+       providers/implementations/ciphers/cipher_null.inc \
+       providers/implementations/ciphers/cipher_rc2.inc \
+       providers/implementations/ciphers/cipher_rc4_hmac_md5.inc \
+       providers/implementations/ciphers/cipher_rc5.inc \
+       providers/implementations/ciphers/cipher_sm4_xts.inc \
+       providers/implementations/ciphers/cipher_tdes.inc \
+       providers/implementations/digests/blake2_prov.inc \
+       providers/implementations/digests/ml_dsa_mu_prov.inc \
+       providers/implementations/digests/digestcommon.inc \
+       providers/implementations/digests/mdc2_prov.inc \
+       providers/implementations/digests/sha2_prov.inc \
+       providers/implementations/digests/sha3_prov.inc \
+       providers/implementations/digests/cshake_prov.inc \
+       providers/implementations/include/prov/blake2_params.inc \
+       providers/implementations/macs/cmac_prov.inc \
+       providers/implementations/macs/gmac_prov.inc \
+       providers/implementations/macs/hmac_prov.inc \
+       providers/implementations/macs/kmac_prov.inc \
+       providers/implementations/macs/poly1305_prov.inc \
+       providers/implementations/macs/siphash_prov.inc \
+       providers/implementations/rands/drbg_ctr.inc \
+       providers/implementations/rands/drbg_hash.inc \
+       providers/implementations/rands/drbg_hmac.inc \
+       providers/implementations/rands/fips_crng_test.inc \
+       providers/implementations/rands/seed_src.inc \
+       providers/implementations/rands/seed_src_jitter.inc \
+       providers/implementations/rands/test_rng.inc \
+       include/crypto/ec_params.h \
+       include/crypto/rsa_params.h \
        include/openssl/core_names.h]=util/perl|OpenSSL/paramnames.pm
-GENERATE[crypto/params_idx.c]=crypto/params_idx.c.in
-GENERATE[include/internal/param_names.h]=include/internal/param_names.h.in
+
+GENERATE[include/crypto/ec_params.h]=\
+    include/crypto/ec_params.h.in
+GENERATE[include/crypto/rsa_params.h]=\
+    include/crypto/rsa_params.h.in
+GENERATE[providers/implementations/asymciphers/rsa_enc.inc]=\
+    providers/implementations/asymciphers/rsa_enc.inc.in
+GENERATE[providers/implementations/asymciphers/sm2_enc.inc]=\
+    providers/implementations/asymciphers/sm2_enc.inc.in
+GENERATE[providers/implementations/exchange/dh_exch.inc]=\
+    providers/implementations/exchange/dh_exch.inc.in
+GENERATE[providers/implementations/exchange/ecdh_exch.inc]=\
+    providers/implementations/exchange/ecdh_exch.inc.in
+GENERATE[providers/implementations/exchange/ecx_exch.inc]=\
+    providers/implementations/exchange/ecx_exch.inc.in
+GENERATE[providers/implementations/encode_decode/decode_der2key.inc]=\
+    providers/implementations/encode_decode/decode_der2key.inc.in
+GENERATE[providers/implementations/encode_decode/decode_epki2pki.inc]=\
+    providers/implementations/encode_decode/decode_epki2pki.inc.in
+GENERATE[providers/implementations/encode_decode/decode_pem2der.inc]=\
+    providers/implementations/encode_decode/decode_pem2der.inc.in
+GENERATE[providers/implementations/encode_decode/decode_pvk2key.inc]=\
+    providers/implementations/encode_decode/decode_pvk2key.inc.in
+GENERATE[providers/implementations/encode_decode/decode_spki2typespki.inc]=\
+    providers/implementations/encode_decode/decode_spki2typespki.inc.in
+GENERATE[providers/implementations/encode_decode/encode_key2any.inc]=\
+    providers/implementations/encode_decode/encode_key2any.inc.in
+GENERATE[providers/implementations/encode_decode/encode_key2ms.inc]=\
+    providers/implementations/encode_decode/encode_key2ms.inc.in
+GENERATE[providers/implementations/kdfs/argon2.inc]=\
+    providers/implementations/kdfs/argon2.inc.in
+GENERATE[providers/implementations/kdfs/hkdf.inc]=\
+    providers/implementations/kdfs/hkdf.inc.in
+GENERATE[providers/implementations/kdfs/hmacdrbg_kdf.inc]=\
+    providers/implementations/kdfs/hmacdrbg_kdf.inc.in
+GENERATE[providers/implementations/kdfs/ikev2kdf.inc]=\
+    providers/implementations/kdfs/ikev2kdf.inc.in
+GENERATE[providers/implementations/kdfs/kbkdf.inc]=\
+    providers/implementations/kdfs/kbkdf.inc.in
+GENERATE[providers/implementations/kdfs/krb5kdf.inc]=\
+    providers/implementations/kdfs/krb5kdf.inc.in
+GENERATE[providers/implementations/kdfs/pbkdf1.inc]=\
+    providers/implementations/kdfs/pbkdf1.inc.in
+GENERATE[providers/implementations/kdfs/pbkdf2.inc]=\
+    providers/implementations/kdfs/pbkdf2.inc.in
+GENERATE[providers/implementations/kdfs/pkcs12kdf.inc]=\
+    providers/implementations/kdfs/pkcs12kdf.inc.in
+GENERATE[providers/implementations/kdfs/pvkkdf.inc]=\
+    providers/implementations/kdfs/pvkkdf.inc.in
+GENERATE[providers/implementations/kdfs/scrypt.inc]=\
+    providers/implementations/kdfs/scrypt.inc.in
+GENERATE[providers/implementations/kdfs/snmpkdf.inc]=\
+    providers/implementations/kdfs/snmpkdf.inc.in
+GENERATE[providers/implementations/kdfs/srtpkdf.inc]=\
+    providers/implementations/kdfs/srtpkdf.inc.in
+GENERATE[providers/implementations/kdfs/sshkdf.inc]=\
+    providers/implementations/kdfs/sshkdf.inc.in
+GENERATE[providers/implementations/kdfs/sskdf.inc]=\
+    providers/implementations/kdfs/sskdf.inc.in
+GENERATE[providers/implementations/kdfs/tls1_prf.inc]=\
+    providers/implementations/kdfs/tls1_prf.inc.in
+GENERATE[providers/implementations/kdfs/x942kdf.inc]=\
+    providers/implementations/kdfs/x942kdf.inc.in
+GENERATE[providers/implementations/kdfs/x963kdf.inc]=\
+    providers/implementations/kdfs/x963kdf.inc.in
+GENERATE[providers/implementations/kem/ec_kem.inc]=\
+    providers/implementations/kem/ec_kem.inc.in
+GENERATE[providers/implementations/kem/ecx_kem.inc]=\
+    providers/implementations/kem/ecx_kem.inc.in
+GENERATE[providers/implementations/kem/ml_kem_kem.inc]=\
+    providers/implementations/kem/ml_kem_kem.inc.in
+GENERATE[providers/implementations/kem/mlx_kem.inc]=\
+    providers/implementations/kem/mlx_kem.inc.in
+GENERATE[providers/implementations/kem/rsa_kem.inc]=\
+    providers/implementations/kem/rsa_kem.inc.in
+GENERATE[providers/implementations/keymgmt/dh_kmgmt.inc]=\
+    providers/implementations/keymgmt/dh_kmgmt.inc.in
+GENERATE[providers/implementations/keymgmt/dsa_kmgmt.inc]=\
+    providers/implementations/keymgmt/dsa_kmgmt.inc.in
+GENERATE[providers/implementations/keymgmt/ecx_kmgmt.inc]=\
+    providers/implementations/keymgmt/ecx_kmgmt.inc.in
+GENERATE[providers/implementations/keymgmt/keymgmtcommon.inc]=\
+    providers/implementations/keymgmt/keymgmtcommon.inc.in
+GENERATE[providers/implementations/keymgmt/lms_kmgmt.inc]=\
+    providers/implementations/keymgmt/lms_kmgmt.inc.in
+GENERATE[providers/implementations/keymgmt/mac_legacy_kmgmt.inc]=\
+    providers/implementations/keymgmt/mac_legacy_kmgmt.inc.in
+GENERATE[providers/implementations/keymgmt/ml_dsa_kmgmt.inc]=\
+    providers/implementations/keymgmt/ml_dsa_kmgmt.inc.in
+GENERATE[providers/implementations/keymgmt/ml_kem_kmgmt.inc]=\
+    providers/implementations/keymgmt/ml_kem_kmgmt.inc.in
+GENERATE[providers/implementations/keymgmt/mlx_kmgmt.inc]=\
+    providers/implementations/keymgmt/mlx_kmgmt.inc.in
+GENERATE[providers/implementations/keymgmt/slh_dsa_kmgmt.inc]=\
+    providers/implementations/keymgmt/slh_dsa_kmgmt.inc.in
+GENERATE[providers/implementations/keymgmt/template_kmgmt.inc]=\
+    providers/implementations/keymgmt/template_kmgmt.inc.in
+GENERATE[providers/implementations/signature/dsa_sig.inc]=\
+    providers/implementations/signature/dsa_sig.inc.in
+GENERATE[providers/implementations/signature/ecdsa_sig.inc]=\
+    providers/implementations/signature/ecdsa_sig.inc.in
+GENERATE[providers/implementations/signature/eddsa_sig.inc]=\
+    providers/implementations/signature/eddsa_sig.inc.in
+GENERATE[providers/implementations/signature/lms_signature.inc]=\
+    providers/implementations/signature/lms_signature.inc.in
+GENERATE[providers/implementations/signature/mac_legacy_sig.inc]=\
+    providers/implementations/signature/mac_legacy_sig.inc.in
+GENERATE[providers/implementations/signature/ml_dsa_sig.inc]=\
+    providers/implementations/signature/ml_dsa_sig.inc.in
+GENERATE[providers/implementations/signature/rsa_sig.inc]=\
+    providers/implementations/signature/rsa_sig.inc.in
+GENERATE[providers/implementations/signature/slh_dsa_sig.inc]=\
+    providers/implementations/signature/slh_dsa_sig.inc.in
+GENERATE[providers/implementations/signature/sm2_sig.inc]=\
+    providers/implementations/signature/sm2_sig.inc.in
+GENERATE[providers/implementations/skeymgmt/generic.inc]=\
+    providers/implementations/skeymgmt/generic.inc.in
+GENERATE[providers/implementations/storemgmt/file_store_any2obj.inc]=\
+    providers/implementations/storemgmt/file_store_any2obj.inc.in
+GENERATE[providers/implementations/storemgmt/file_store.inc]=\
+    providers/implementations/storemgmt/file_store.inc.in
+GENERATE[providers/implementations/storemgmt/winstore_store.inc]=\
+    providers/implementations/storemgmt/winstore_store.inc.in
+GENERATE[providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc]=\
+    providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc.in
+GENERATE[providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.inc]=\
+    providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.inc.in
+GENERATE[providers/implementations/ciphers/cipher_aes_gcm_siv.inc]=\
+    providers/implementations/ciphers/cipher_aes_gcm_siv.inc.in
+GENERATE[providers/implementations/ciphers/cipher_aes_ocb.inc]=\
+    providers/implementations/ciphers/cipher_aes_ocb.inc.in
+GENERATE[providers/implementations/ciphers/cipher_aes_siv.inc]=\
+    providers/implementations/ciphers/cipher_aes_siv.inc.in
+GENERATE[providers/implementations/ciphers/cipher_aes_wrp.inc]=\
+    providers/implementations/ciphers/cipher_aes_wrp.inc.in
+GENERATE[providers/implementations/ciphers/cipher_aes_xts.inc]=\
+    providers/implementations/ciphers/cipher_aes_xts.inc.in
+GENERATE[providers/implementations/ciphers/ciphercommon.inc]=\
+    providers/implementations/ciphers/ciphercommon.inc.in
+GENERATE[providers/implementations/ciphers/ciphercommon_ccm.inc]=\
+    providers/implementations/ciphers/ciphercommon_ccm.inc.in
+GENERATE[providers/implementations/ciphers/ciphercommon_gcm.inc]=\
+    providers/implementations/ciphers/ciphercommon_gcm.inc.in
+GENERATE[providers/implementations/ciphers/cipher_chacha20.inc]=\
+    providers/implementations/ciphers/cipher_chacha20.inc.in
+GENERATE[providers/implementations/ciphers/cipher_chacha20_poly1305.inc]=\
+    providers/implementations/ciphers/cipher_chacha20_poly1305.inc.in
+GENERATE[providers/implementations/ciphers/cipher_cts.inc]=\
+    providers/implementations/ciphers/cipher_cts.inc.in
+GENERATE[providers/implementations/ciphers/cipher_des.inc]=\
+    providers/implementations/ciphers/cipher_des.inc.in
+GENERATE[providers/implementations/ciphers/cipher_null.inc]=\
+    providers/implementations/ciphers/cipher_null.inc.in
+GENERATE[providers/implementations/ciphers/cipher_rc2.inc]=\
+    providers/implementations/ciphers/cipher_rc2.inc.in
+GENERATE[providers/implementations/ciphers/cipher_rc4_hmac_md5.inc]=\
+    providers/implementations/ciphers/cipher_rc4_hmac_md5.inc.in
+GENERATE[providers/implementations/ciphers/cipher_rc5.inc]=\
+    providers/implementations/ciphers/cipher_rc5.inc.in
+GENERATE[providers/implementations/ciphers/cipher_sm4_xts.inc]=\
+    providers/implementations/ciphers/cipher_sm4_xts.inc.in
+GENERATE[providers/implementations/ciphers/cipher_tdes.inc]=\
+    providers/implementations/ciphers/cipher_tdes.inc.in
+GENERATE[providers/implementations/digests/blake2_prov.inc]=\
+    providers/implementations/digests/blake2_prov.inc.in
+GENERATE[providers/implementations/digests/digestcommon.inc]=\
+    providers/implementations/digests/digestcommon.inc.in
+GENERATE[providers/implementations/digests/mdc2_prov.inc]=\
+    providers/implementations/digests/mdc2_prov.inc.in
+GENERATE[providers/implementations/digests/sha2_prov.inc]=\
+    providers/implementations/digests/sha2_prov.inc.in
+GENERATE[providers/implementations/digests/sha3_prov.inc]=\
+    providers/implementations/digests/sha3_prov.inc.in
+GENERATE[providers/implementations/digests/cshake_prov.inc]=\
+    providers/implementations/digests/cshake_prov.inc.in
+GENERATE[providers/implementations/include/prov/blake2_params.inc]=\
+    providers/implementations/include/prov/blake2_params.inc.in
+GENERATE[providers/implementations/digests/ml_dsa_mu_prov.inc]=\
+    providers/implementations/digests/ml_dsa_mu_prov.inc.in
+GENERATE[providers/implementations/macs/cmac_prov.inc]=\
+    providers/implementations/macs/cmac_prov.inc.in
+GENERATE[providers/implementations/macs/gmac_prov.inc]=\
+    providers/implementations/macs/gmac_prov.inc.in
+GENERATE[providers/implementations/macs/hmac_prov.inc]=\
+    providers/implementations/macs/hmac_prov.inc.in
+GENERATE[providers/implementations/macs/kmac_prov.inc]=\
+    providers/implementations/macs/kmac_prov.inc.in
+GENERATE[providers/implementations/macs/poly1305_prov.inc]=\
+    providers/implementations/macs/poly1305_prov.inc.in
+GENERATE[providers/implementations/macs/siphash_prov.inc]=\
+    providers/implementations/macs/siphash_prov.inc.in
+GENERATE[providers/implementations/rands/drbg_ctr.inc]=\
+    providers/implementations/rands/drbg_ctr.inc.in
+GENERATE[providers/implementations/rands/drbg_hash.inc]=\
+    providers/implementations/rands/drbg_hash.inc.in
+GENERATE[providers/implementations/rands/drbg_hmac.inc]=\
+    providers/implementations/rands/drbg_hmac.inc.in
+GENERATE[providers/implementations/rands/fips_crng_test.inc]=\
+    providers/implementations/rands/fips_crng_test.inc.in
+GENERATE[providers/implementations/rands/seed_src.inc]=\
+    providers/implementations/rands/seed_src.inc.in
+GENERATE[providers/implementations/rands/seed_src_jitter.inc]=\
+    providers/implementations/rands/seed_src_jitter.inc.in
+GENERATE[providers/implementations/rands/test_rng.inc]=\
+    providers/implementations/rands/test_rng.inc.in
 GENERATE[include/openssl/core_names.h]=include/openssl/core_names.h.in

 IF[{- defined $target{shared_defflag} -}]
@@ -135,7 +573,8 @@ GENERATE[builddata.pm]=util/mkinstallvars.pl \
     COMMENT="This file should be used when building against this OpenSSL build, and should never be installed" \
     PREFIX=. BINDIR=apps APPLINKDIR=ms \
     LIBDIR= INCLUDEDIR=include "INCLUDEDIR=$(SRCDIR)/include" \
-    ENGINESDIR=engines MODULESDIR=providers \
+    MODULESDIR=providers \
+    libdir= CMAKECONFIGDIR= PKGCONFIGDIR= \
     "VERSION=$(VERSION)" "LDLIBS=$(LIB_EX_LIBS)"

 DEPEND[""]=openssl.pc
diff --git a/deps/openssl/openssl/configdata.pm.in b/deps/openssl/openssl/configdata.pm.in
index fea6004d6c9..a21fe686d96 100644
--- a/deps/openssl/openssl/configdata.pm.in
+++ b/deps/openssl/openssl/configdata.pm.in
@@ -151,55 +151,75 @@ _____
             or die "Trying to rename $buildfile.new to $buildfile: $!";
         print 'Created ',$buildfile,"\n";

+        my $create_configuration = sub {
+          my ($configuration_file, $configuration_file_in) = @_;
+
+          open CONFIGURATION, ">${configuration_file}.new"
+              or die "Trying to create ${configuration_file_in}.new: $!";
+          $tmpl = OpenSSL::Template->new(TYPE => 'FILE',
+                                        SOURCE => $configuration_file_in);
+          $tmpl->fill_in(FILENAME => $_,
+                        OUTPUT => \*CONFIGURATION,
+                        HASH => \%gendata,
+                        PREPEND => $prepend,
+                        # To ensure that global variables and functions
+                        # defined in one template stick around for the
+                        # next, making them combinable
+                        PACKAGE => 'OpenSSL::safe')
+              or die $OpenSSL::Template::ERROR;
+          close CONFIGURATION;
+        };
+
+        my $update_configuration = sub {
+          # When using stat() on Windows, we can get it to perform better by
+          # avoid some data.  This doesn't affect the mtime field, so we're not
+          # losing anything...
+          ${^WIN32_SLOPPY_STAT} = 1;
+
+          my ($configuration_file, $configuration_file_in) = @_;
+          my $update_configuration_file = 0;
+
+          if (-f $configuration_file) {
+              my $configuration_file_mtime = (stat($configuration_file))[9];
+              my $configuration_file_in_mtime = (stat($configuration_file_in))[9];
+
+              # If configuration.h.in was updated after the last configuration.h,
+              # or if configuration.h.new differs configuration.h, we update
+              # configuration.h
+              if ($configuration_file_mtime < $configuration_file_in_mtime
+                  || compare_text("${configuration_file}.new", $configuration_file) != 0) {
+                  $update_configuration_file = 1;
+              } else {
+                  # If nothing has changed, let's just drop the new one and
+                  # pretend like nothing happened
+                  unlink "${configuration_file}.new"
+              }
+          } else {
+              $update_configuration_file = 1;
+          }
+
+          if ($update_configuration_file) {
+              rename("${configuration_file}.new", $configuration_file)
+                  or die "Trying to rename ${configuration_file}.new to $configuration_file: $!";
+              print 'Created ',$configuration_file,"\n";
+          }
+        };
+
         my $configuration_h =
             catfile('include', 'openssl', 'configuration.h');
         my $configuration_h_in =
             catfile($config{sourcedir}, 'include', 'openssl', 'configuration.h.in');
-        open CONFIGURATION_H, ">${configuration_h}.new"
-            or die "Trying to create ${configuration_h}.new: $!";
-        $tmpl = OpenSSL::Template->new(TYPE => 'FILE',
-                                       SOURCE => $configuration_h_in);
-        $tmpl->fill_in(FILENAME => $_,
-                       OUTPUT => \*CONFIGURATION_H,
-                       HASH => \%gendata,
-                       PREPEND => $prepend,
-                       # To ensure that global variables and functions
-                       # defined in one template stick around for the
-                       # next, making them combinable
-                       PACKAGE => 'OpenSSL::safe')
-            or die $OpenSSL::Template::ERROR;
-        close CONFIGURATION_H;
-
-        # When using stat() on Windows, we can get it to perform better by
-        # avoid some data.  This doesn't affect the mtime field, so we're not
-        # losing anything...
-        ${^WIN32_SLOPPY_STAT} = 1;
-
-        my $update_configuration_h = 0;
-        if (-f $configuration_h) {
-            my $configuration_h_mtime = (stat($configuration_h))[9];
-            my $configuration_h_in_mtime = (stat($configuration_h_in))[9];
-
-            # If configuration.h.in was updated after the last configuration.h,
-            # or if configuration.h.new differs configuration.h, we update
-            # configuration.h
-            if ($configuration_h_mtime < $configuration_h_in_mtime
-                || compare_text("${configuration_h}.new", $configuration_h) != 0) {
-                $update_configuration_h = 1;
-            } else {
-                # If nothing has changed, let's just drop the new one and
-                # pretend like nothing happened
-                unlink "${configuration_h}.new"
-            }
-        } else {
-            $update_configuration_h = 1;
-        }

-        if ($update_configuration_h) {
-            rename("${configuration_h}.new", $configuration_h)
-                or die "Trying to rename ${configuration_h}.new to $configuration_h: $!";
-            print 'Created ',$configuration_h,"\n";
-        }
+        my $apps_configuration_h =
+            catfile('apps', 'include', 'configuration.h');
+        my $apps_configuration_h_in =
+            catfile($config{sourcedir}, 'apps', 'include', 'configuration.h.in');
+
+        $create_configuration->($configuration_h, $configuration_h_in);
+        $update_configuration->($configuration_h, $configuration_h_in);
+
+        $create_configuration->($apps_configuration_h, $apps_configuration_h_in);
+        $update_configuration->($apps_configuration_h, $apps_configuration_h_in);

         exit(0);
     }
@@ -485,3 +505,4 @@ Verbose output.
 =cut

 EOF
+#define PRINT_ENABLED(type)
diff --git a/deps/openssl/openssl/crypto/LPdir_win.c b/deps/openssl/openssl/crypto/LPdir_win.c
index 0b7504ce9de..2d05e93eb7d 100644
--- a/deps/openssl/openssl/crypto/LPdir_win.c
+++ b/deps/openssl/openssl/crypto/LPdir_win.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -36,25 +36,13 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */

-#include <windows.h>
 #include <tchar.h>
+#include "internal/e_os.h"
 #include "internal/numbers.h"
 #ifndef LPDIR_H
 #include "LPdir.h"
 #endif

-/*
- * We're most likely overcautious here, but let's reserve for broken WinCE
- * headers and explicitly opt for UNICODE call. Keep in mind that our WinCE
- * builds are compiled with -DUNICODE [as well as -D_UNICODE].
- */
-#if defined(LP_SYS_WINCE) && !defined(FindFirstFile)
-#define FindFirstFile FindFirstFileW
-#endif
-#if defined(LP_SYS_WINCE) && !defined(FindNextFile)
-#define FindNextFile FindNextFileW
-#endif
-
 #ifndef NAME_MAX
 #define NAME_MAX 255
 #endif
@@ -105,14 +93,14 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
             do {
 #ifdef CP_UTF8
                 if ((sz = MultiByteToWideChar((cp = CP_UTF8), 0,
-                         directory, len_0,
+                         directory, (int)len_0,
                          NULL, 0))
                         > 0
                     || GetLastError() != ERROR_NO_UNICODE_TRANSLATION)
                     break;
 #endif
                 sz = MultiByteToWideChar((cp = CP_ACP), 0,
-                    directory, len_0,
+                    directory, (int)len_0,
                     NULL, 0);
             } while (0);

@@ -122,7 +110,7 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
                  * concatenate asterisk, |sz| covers trailing '\0'!
                  */
                 wdir = _alloca((sz + 2) * sizeof(TCHAR));
-                if (!MultiByteToWideChar(cp, 0, directory, len_0,
+                if (!MultiByteToWideChar(cp, 0, directory, (int)len_0,
                         (WCHAR *)wdir, sz)) {
                     free(*ctx);
                     *ctx = NULL;
@@ -132,7 +120,7 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
             } else
 #endif
             {
-                sz = len_0;
+                sz = (int)len_0;
                 /*
                  * allocate two additional characters in case we need to
                  * concatenate asterisk, |sz| covers trailing '\0'!
@@ -187,7 +175,7 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
         len_0++;

 #ifdef LP_MULTIBYTE_AVAILABLE
-        if (!WideCharToMultiByte(CP_DEFAULT, 0, (WCHAR *)wdir, len_0,
+        if (!WideCharToMultiByte(CP_DEFAULT, 0, (WCHAR *)wdir, (int)len_0,
                 (*ctx)->entry_name,
                 sizeof((*ctx)->entry_name), NULL, 0))
 #endif
diff --git a/deps/openssl/openssl/crypto/LPdir_wince.c b/deps/openssl/openssl/crypto/LPdir_wince.c
deleted file mode 100644
index e4c883dcefe..00000000000
--- a/deps/openssl/openssl/crypto/LPdir_wince.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * This file is dual-licensed and is also available under the following
- * terms:
- *
- * Copyright (c) 2004, Richard Levitte <richard@levitte.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#define LP_SYS_WINCE
-/*
- * We might want to define LP_MULTIBYTE_AVAILABLE here.  It's currently under
- * investigation what the exact conditions would be
- */
-/* clang-format off */
-#include "LPdir_win.c"
-/* clang-format on */
diff --git a/deps/openssl/openssl/crypto/aes/aes_cbc_vaes_intrinsic.c b/deps/openssl/openssl/crypto/aes/aes_cbc_vaes_intrinsic.c
new file mode 100644
index 00000000000..a49b0550c8d
--- /dev/null
+++ b/deps/openssl/openssl/crypto/aes/aes_cbc_vaes_intrinsic.c
@@ -0,0 +1,393 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright (C) 2026, Advanced Micro Devices, all rights reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ *
+ * Implements AES-CBC128/192/256 decryption with VAES (AVX-512)
+ *
+ * CBC encryption is inherently serial (each ciphertext block depends
+ * on the previous one), so VAES provides no benefit there -- the
+ * encrypt path falls back to the aesni_cbc_encrypt assembly routine.
+ *
+ * CBC decryption IS parallel: all blocks can be independently decrypted,
+ * then XORed with the preceding ciphertext block (or IV for the first).
+ * This implementation processes 4x4=16 blocks per iteration using four
+ * ZMM registers, falling back to 8, 4, then single-block processing.
+ */
+
+#include "internal/deprecated.h"
+
+#include <openssl/opensslconf.h>
+#include "internal/cryptlib.h"
+#include <openssl/aes.h>
+#include "crypto/modes.h"
+#include "crypto/aes_platform.h"
+
+#if VAES_CBC_ELIGIBLE
+
+/* Function prototypes */
+void ossl_aes_cbc_vaes_decrypt(const unsigned char *in, unsigned char *out,
+    size_t len, const void *key,
+    unsigned char ivec[16], int enc);
+int ossl_aes_cbc_vaes_eligible(void);
+
+#include <openssl/modes.h>
+
+/* Forward declarations -- defined in aesni-x86_64.pl assembly        */
+void aesni_cbc_encrypt(const unsigned char *in, unsigned char *out,
+    size_t len, const AES_KEY *key,
+    unsigned char *ivec, int enc);
+void aesni_decrypt(const unsigned char *in, unsigned char *out,
+    const AES_KEY *key);
+
+/*
+ * Keep the cleanup out of line in assembly. Its opacity to C and LTO
+ * optimizers is what prevents the cleanup call and stores from being
+ * eliminated as dead. Do not replace it with a compiler-visible C function.
+ */
+void ossl_aes_cbc_vaes_cleanup(void *key_schedule, size_t num_keys);
+int ossl_aes_cbc_vaes_cleanup_eligible(void);
+
+/* Portable compiler abstractions for inlining and ISA target selection */
+#define STRINGIFY_IMPL_(a) #a
+#define STRINGIFY_(a) STRINGIFY_IMPL_(a)
+
+#ifdef __clang__
+#define OPENSSL_TARGET_VAES512                                         \
+    _Pragma(STRINGIFY_(clang attribute push(                           \
+        __attribute__((target("avx512f,avx512dq,avx512bw,vaes,aes"))), \
+        apply_to = function)))
+#define OPENSSL_UNTARGET_VAES512 _Pragma("clang attribute pop")
+#elif defined(__GNUC__)
+#define OPENSSL_TARGET_VAES512  \
+    _Pragma("GCC push_options") \
+        _Pragma(STRINGIFY_(GCC target("avx512f,avx512dq,avx512bw,vaes,aes")))
+#define OPENSSL_UNTARGET_VAES512 _Pragma("GCC pop_options")
+#else
+/* MSVC: all intrinsics are always available via <immintrin.h>. */
+#define OPENSSL_TARGET_VAES512
+#define OPENSSL_UNTARGET_VAES512
+#endif
+
+#if defined(__GNUC__) || defined(__clang__)
+#define OSSL_FUNC_ALWAYS_INLINE static inline __attribute__((always_inline))
+#define OSSL_FUNC_NOINLINE __attribute__((noinline))
+#elif defined(_MSC_VER)
+#define OSSL_FUNC_ALWAYS_INLINE static __forceinline
+#define OSSL_FUNC_NOINLINE __declspec(noinline)
+#else
+#define OSSL_FUNC_ALWAYS_INLINE static inline
+#define OSSL_FUNC_NOINLINE
+#endif
+
+#include <immintrin.h>
+
+OPENSSL_TARGET_VAES512
+
+/* ------------------------------------------------------------------ */
+/* AES decryption helpers: 1x, 2x, 4x parallel 512-bit blocks         */
+/* Each 512-bit register holds 4 independent 128-bit AES blocks.      */
+/* always_inline guarantees the compiler keeps keys in ZMM regs.      */
+/* ------------------------------------------------------------------ */
+
+#define DEFINE_AES_DECRYPT_FUNCS(ROUNDS)                    \
+    OSSL_FUNC_ALWAYS_INLINE                                 \
+    void AesDec_4x512_##ROUNDS(                             \
+        __m512i *b1, __m512i *b2, __m512i *b3, __m512i *b4, \
+        const __m512i *rk)                                  \
+    {                                                       \
+        *b1 = _mm512_xor_si512(*b1, rk[0]);                 \
+        *b2 = _mm512_xor_si512(*b2, rk[0]);                 \
+        *b3 = _mm512_xor_si512(*b3, rk[0]);                 \
+        *b4 = _mm512_xor_si512(*b4, rk[0]);                 \
+        for (int i = 1; i < ROUNDS; i++) {                  \
+            *b1 = _mm512_aesdec_epi128(*b1, rk[i]);         \
+            *b2 = _mm512_aesdec_epi128(*b2, rk[i]);         \
+            *b3 = _mm512_aesdec_epi128(*b3, rk[i]);         \
+            *b4 = _mm512_aesdec_epi128(*b4, rk[i]);         \
+        }                                                   \
+        *b1 = _mm512_aesdeclast_epi128(*b1, rk[ROUNDS]);    \
+        *b2 = _mm512_aesdeclast_epi128(*b2, rk[ROUNDS]);    \
+        *b3 = _mm512_aesdeclast_epi128(*b3, rk[ROUNDS]);    \
+        *b4 = _mm512_aesdeclast_epi128(*b4, rk[ROUNDS]);    \
+    }                                                       \
+                                                            \
+    OSSL_FUNC_ALWAYS_INLINE                                 \
+    void AesDec_2x512_##ROUNDS(                             \
+        __m512i *b1, __m512i *b2, const __m512i *rk)        \
+    {                                                       \
+        *b1 = _mm512_xor_si512(*b1, rk[0]);                 \
+        *b2 = _mm512_xor_si512(*b2, rk[0]);                 \
+        for (int i = 1; i < ROUNDS; i++) {                  \
+            *b1 = _mm512_aesdec_epi128(*b1, rk[i]);         \
+            *b2 = _mm512_aesdec_epi128(*b2, rk[i]);         \
+        }                                                   \
+        *b1 = _mm512_aesdeclast_epi128(*b1, rk[ROUNDS]);    \
+        *b2 = _mm512_aesdeclast_epi128(*b2, rk[ROUNDS]);    \
+    }                                                       \
+                                                            \
+    OSSL_FUNC_ALWAYS_INLINE                                 \
+    void AesDec_1x512_##ROUNDS(                             \
+        __m512i *b1, const __m512i *rk)                     \
+    {                                                       \
+        *b1 = _mm512_xor_si512(*b1, rk[0]);                 \
+        for (int i = 1; i < ROUNDS; i++)                    \
+            *b1 = _mm512_aesdec_epi128(*b1, rk[i]);         \
+        *b1 = _mm512_aesdeclast_epi128(*b1, rk[ROUNDS]);    \
+    }
+
+DEFINE_AES_DECRYPT_FUNCS(10) /* AES-128 */
+DEFINE_AES_DECRYPT_FUNCS(12) /* AES-192 */
+DEFINE_AES_DECRYPT_FUNCS(14) /* AES-256 */
+
+/* ------------------------------------------------------------------ */
+/* CBC-mode decryption -- templated per round count                   */
+/*                                                                    */
+/* Processes as many full blocks as possible:                         */
+/*   16 blocks at a time (4 x zmm = 4 x 4 = 16 blocks)                */
+/*    8 blocks at a time (2 x zmm)                                    */
+/*    4 blocks at a time (1 x zmm)                                    */
+/*    1 block at a time for the remaining 0-3 blocks                  */
+/*                                                                    */
+/* The chaining vector b1 packs [prev_ct[last] | ct[0] | ct[1]        */
+/* | ct[2]] so that a single XOR after decryption applies the CBC     */
+/* feedback to all four lanes simultaneously.                         */
+/* ------------------------------------------------------------------ */
+
+#define DEFINE_CBC_DECRYPT(NR)                                                      \
+    OSSL_FUNC_NOINLINE                                                              \
+    static void cbc_decrypt_##NR(                                                   \
+        const unsigned char *in, unsigned char *out, size_t len,                    \
+        const AES_KEY *key, unsigned char *iv)                                      \
+    {                                                                               \
+        const unsigned char *rk_bytes = (const unsigned char *)key->rd_key;         \
+        __m512i rk[NR + 1];                                                         \
+        for (int i = 0; i <= NR; i++) {                                             \
+            __m128i t = _mm_loadu_si128((const __m128i *)(rk_bytes + i * 16));      \
+            rk[i] = _mm512_broadcast_i32x4(t);                                      \
+        }                                                                           \
+                                                                                    \
+        __m512i a1, a2, a3, a4;                                                     \
+        __m512i b1, b2, b3, b4;                                                     \
+                                                                                    \
+        const __m128i *pa = (const __m128i *)in;                                    \
+        __m512i *po = (__m512i *)out;                                               \
+        size_t blocks = len / AES_BLOCK_SIZE;                                       \
+                                                                                    \
+        /* Save last ciphertext block for IV update (in-place safe)             */  \
+        __m128i saved_iv = _mm_setzero_si128();                                     \
+        int has_blocks = (blocks > 0);                                              \
+        if (has_blocks)                                                             \
+            saved_iv = _mm_loadu_si128(pa + blocks - 1);                            \
+                                                                                    \
+        if (blocks >= 4) {                                                          \
+            /* Build b1 = [IV | ct[0] | ct[1] | ct[2]]                          */  \
+            __m512i idx = _mm512_set_epi64(5, 4, 3, 2, 1, 0, 0, 0);                 \
+            __m512i ct0;                                                            \
+                                                                                    \
+            /* CBC C[0]=IV; 0x03 loads one 128-bit block (two 64-bit lanes). */     \
+            b1 = _mm512_maskz_loadu_epi64(0x03, iv);                                \
+            ct0 = _mm512_loadu_si512(pa);                                           \
+            ct0 = _mm512_permutexvar_epi64(idx, ct0);                               \
+            b1 = _mm512_mask_blend_epi64(0xFC, b1, ct0);                            \
+                                                                                    \
+            /* --- 16-block (4 x zmm) main loop ---                             */  \
+            while (blocks >= 16) {                                                  \
+                __m128i last;                                                       \
+                                                                                    \
+                a1 = _mm512_loadu_si512(pa);                                        \
+                a2 = _mm512_loadu_si512(pa + 4);                                    \
+                a3 = _mm512_loadu_si512(pa + 8);                                    \
+                a4 = _mm512_loadu_si512(pa + 12);                                   \
+                                                                                    \
+                b2 = _mm512_loadu_si512(pa + 3);                                    \
+                b3 = _mm512_loadu_si512(pa + 7);                                    \
+                b4 = _mm512_loadu_si512(pa + 11);                                   \
+                                                                                    \
+                last = _mm_loadu_si128(pa + 15);                                    \
+                                                                                    \
+                AesDec_4x512_##NR(&a1, &a2, &a3, &a4, rk);                          \
+                                                                                    \
+                a1 = _mm512_xor_si512(a1, b1);                                      \
+                a2 = _mm512_xor_si512(a2, b2);                                      \
+                a3 = _mm512_xor_si512(a3, b3);                                      \
+                a4 = _mm512_xor_si512(a4, b4);                                      \
+                                                                                    \
+                _mm512_storeu_si512(po, a1);                                        \
+                _mm512_storeu_si512(po + 1, a2);                                    \
+                _mm512_storeu_si512(po + 2, a3);                                    \
+                _mm512_storeu_si512(po + 3, a4);                                    \
+                                                                                    \
+                /* Build next b1 from last ciphertext block                     */  \
+                b1 = _mm512_maskz_loadu_epi64(0x03, &last);                         \
+                if (blocks > 16) {                                                  \
+                    size_t rem = blocks - 16;                                       \
+                    /* Load only available lookahead blocks to avoid OOB read. */   \
+                    /* One AES block is 16 bytes, it maps to two 64-bit lanes. */   \
+                    /* 0x03 (00000011) for 1 block (2 lanes), */                    \
+                    /* 0x0F (00001111) for 2 blocks (4 lanes), */                   \
+                    /* 0x3F (00111111) for 3 or more blocks (6 lanes). */           \
+                    __mmask8 nxmask = (rem >= 3) ? 0x3F : (rem == 2 ? 0x0F : 0x03); \
+                    __m512i nx = _mm512_maskz_loadu_epi64(nxmask, pa + 16);         \
+                    nx = _mm512_permutexvar_epi64(idx, nx);                         \
+                    b1 = _mm512_mask_blend_epi64(0xFC, b1, nx);                     \
+                }                                                                   \
+                                                                                    \
+                pa += 16;                                                           \
+                po += 4;                                                            \
+                blocks -= 16;                                                       \
+            }                                                                       \
+                                                                                    \
+            /* --- 8-block (2 x zmm) ---                                        */  \
+            if (blocks >= 8) {                                                      \
+                __m128i last8;                                                      \
+                                                                                    \
+                a1 = _mm512_loadu_si512(pa);                                        \
+                a2 = _mm512_loadu_si512(pa + 4);                                    \
+                b2 = _mm512_loadu_si512(pa + 3);                                    \
+                last8 = _mm_loadu_si128(pa + 7);                                    \
+                                                                                    \
+                AesDec_2x512_##NR(&a1, &a2, rk);                                    \
+                a1 = _mm512_xor_si512(a1, b1);                                      \
+                a2 = _mm512_xor_si512(a2, b2);                                      \
+                                                                                    \
+                _mm512_storeu_si512(po, a1);                                        \
+                _mm512_storeu_si512(po + 1, a2);                                    \
+                                                                                    \
+                b1 = _mm512_maskz_loadu_epi64(0x03, &last8);                        \
+                pa += 8;                                                            \
+                po += 2;                                                            \
+                blocks -= 8;                                                        \
+                                                                                    \
+                if (blocks >= 4) {                                                  \
+                    __m512i nx = _mm512_loadu_si512(pa);                            \
+                    nx = _mm512_permutexvar_epi64(idx, nx);                         \
+                    b1 = _mm512_mask_blend_epi64(0xFC, b1, nx);                     \
+                }                                                                   \
+            }                                                                       \
+                                                                                    \
+            /* --- 4-block (1 x zmm) ---                                        */  \
+            if (blocks >= 4) {                                                      \
+                __m128i last4;                                                      \
+                                                                                    \
+                a1 = _mm512_loadu_si512(pa);                                        \
+                last4 = _mm_loadu_si128(pa + 3);                                    \
+                                                                                    \
+                AesDec_1x512_##NR(&a1, rk);                                         \
+                a1 = _mm512_xor_si512(a1, b1);                                      \
+                _mm512_storeu_si512(po, a1);                                        \
+                                                                                    \
+                b1 = _mm512_maskz_loadu_epi64(0x03, &last4);                        \
+                pa += 4;                                                            \
+                po += 1;                                                            \
+                blocks -= 4;                                                        \
+            }                                                                       \
+                                                                                    \
+            /* --- Remaining 1-3 blocks ---                                     */  \
+            {                                                                       \
+                __m128i *po128 = (__m128i *)po;                                     \
+                while (blocks > 0) {                                                \
+                    __m128i ct = _mm_loadu_si128(pa);                               \
+                    a1 = _mm512_maskz_loadu_epi64(0x03, pa);                        \
+                    AesDec_1x512_##NR(&a1, rk);                                     \
+                    a1 = _mm512_xor_si512(a1, b1);                                  \
+                    _mm512_mask_storeu_epi64(po128, 0x03, a1);                      \
+                    b1 = _mm512_maskz_loadu_epi64(0x03, &ct);                       \
+                    pa++;                                                           \
+                    po128++;                                                        \
+                    blocks--;                                                       \
+                }                                                                   \
+            }                                                                       \
+        } else {                                                                    \
+            /* Less than 4 blocks -- process individually                       */  \
+            __m128i *po128 = (__m128i *)po;                                         \
+            b1 = _mm512_maskz_loadu_epi64(0x03, iv);                                \
+            while (blocks > 0) {                                                    \
+                __m128i ct = _mm_loadu_si128(pa);                                   \
+                a1 = _mm512_maskz_loadu_epi64(0x03, pa);                            \
+                AesDec_1x512_##NR(&a1, rk);                                         \
+                a1 = _mm512_xor_si512(a1, b1);                                      \
+                _mm512_mask_storeu_epi64(po128, 0x03, a1);                          \
+                b1 = _mm512_maskz_loadu_epi64(0x03, &ct);                           \
+                pa++;                                                               \
+                po128++;                                                            \
+                blocks--;                                                           \
+            }                                                                       \
+        }                                                                           \
+                                                                                    \
+        if (has_blocks)                                                             \
+            _mm_storeu_si128((__m128i *)iv, saved_iv);                              \
+                                                                                    \
+        /* Erase the broadcast schedule and the volatile vector register bank. */   \
+        ossl_aes_cbc_vaes_cleanup(rk, NR + 1);                                      \
+    }
+
+DEFINE_CBC_DECRYPT(10) /* AES-128 */
+DEFINE_CBC_DECRYPT(12) /* AES-192 */
+DEFINE_CBC_DECRYPT(14) /* AES-256 */
+
+/* ------------------------------------------------------------------ */
+/* Public entry point                                                 */
+/* ------------------------------------------------------------------ */
+
+void ossl_aes_cbc_vaes_decrypt(const unsigned char *in, unsigned char *out,
+    size_t len, const void *key,
+    unsigned char ivec[16], int enc)
+{
+    size_t full_bytes;
+    int nr = ((const AES_KEY *)key)->rounds + 1;
+
+    if (len == 0)
+        return;
+
+    /* VAES path only optimises decryption; encrypt falls back to asm */
+    if (enc) {
+        aesni_cbc_encrypt(in, out, len, (const AES_KEY *)key, ivec, enc);
+        return;
+    }
+
+    full_bytes = (len / AES_BLOCK_SIZE) * AES_BLOCK_SIZE;
+    if (full_bytes > 0) {
+        switch (nr) {
+        case 10:
+            cbc_decrypt_10(in, out, full_bytes, (const AES_KEY *)key, ivec);
+            break;
+        case 12:
+            cbc_decrypt_12(in, out, full_bytes, (const AES_KEY *)key, ivec);
+            break;
+        case 14:
+            cbc_decrypt_14(in, out, full_bytes, (const AES_KEY *)key, ivec);
+            break;
+        default: /* invalid key size */
+            aesni_cbc_encrypt(in, out, len, (const AES_KEY *)key, ivec, 0);
+            break;
+        }
+    }
+}
+
+/* ------------------------------------------------------------------ */
+/* CPU feature check                                                  */
+/* ------------------------------------------------------------------ */
+
+int ossl_aes_cbc_vaes_eligible(void)
+{
+    return ossl_aes_cbc_vaes_cleanup_eligible()
+        && (OPENSSL_ia32cap_P[2] & (1 << 16)) /* AVX512F            */
+        && (OPENSSL_ia32cap_P[2] & (1 << 17)) /* AVX512DQ           */
+        && (OPENSSL_ia32cap_P[2] & (1 << 30)) /* AVX512BW           */
+        && (OPENSSL_ia32cap_P[3] & (1 << 9)); /* AVX512VAES         */
+}
+
+OPENSSL_UNTARGET_VAES512
+
+#undef OPENSSL_TARGET_VAES512
+#undef OPENSSL_UNTARGET_VAES512
+#undef STRINGIFY_IMPL_
+#undef STRINGIFY_
+#undef OSSL_FUNC_ALWAYS_INLINE
+#undef OSSL_FUNC_NOINLINE
+#endif /* VAES_CBC_ELIGIBLE */
diff --git a/deps/openssl/openssl/crypto/aes/aes_cfb.c b/deps/openssl/openssl/crypto/aes/aes_cfb.c
index e6a184a19f5..3026208a0ba 100644
--- a/deps/openssl/openssl/crypto/aes/aes_cfb.c
+++ b/deps/openssl/openssl/crypto/aes/aes_cfb.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -24,7 +24,7 @@

 void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const AES_KEY *key,
-    unsigned char *ivec, int *num, const int enc)
+    unsigned char *ivec, int *num, int enc)
 {

     CRYPTO_cfb128_encrypt(in, out, length, key, ivec, num, enc,
@@ -34,7 +34,7 @@ void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
 /* N.B. This expects the input to be packed, MS bit first */
 void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const AES_KEY *key,
-    unsigned char *ivec, int *num, const int enc)
+    unsigned char *ivec, int *num, int enc)
 {
     CRYPTO_cfb128_1_encrypt(in, out, length, key, ivec, num, enc,
         (block128_f)AES_encrypt);
@@ -42,7 +42,7 @@ void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,

 void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const AES_KEY *key,
-    unsigned char *ivec, int *num, const int enc)
+    unsigned char *ivec, int *num, int enc)
 {
     CRYPTO_cfb128_8_encrypt(in, out, length, key, ivec, num, enc,
         (block128_f)AES_encrypt);
diff --git a/deps/openssl/openssl/crypto/aes/aes_core.c b/deps/openssl/openssl/crypto/aes/aes_core.c
index b376e7e47d5..66577ba39ad 100644
--- a/deps/openssl/openssl/crypto/aes/aes_core.c
+++ b/deps/openssl/openssl/crypto/aes/aes_core.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -62,17 +62,17 @@

 typedef union {
     unsigned char b[8];
-    u32 w[2];
-    u64 d;
+    uint32_t w[2];
+    uint64_t d;
 } uni;

 /*
  * Compute w := (w * x) mod (x^8 + x^4 + x^3 + x^1 + 1)
  * Therefore the name "xtime".
  */
-static void XtimeWord(u32 *w)
+static void XtimeWord(uint32_t *w)
 {
-    u32 a, b;
+    uint32_t a, b;

     a = *w;
     b = a & 0x80808080u;
@@ -83,9 +83,9 @@ static void XtimeWord(u32 *w)
     *w = b;
 }

-static void XtimeLong(u64 *w)
+static void XtimeLong(uint64_t *w)
 {
-    u64 a, b;
+    uint64_t a, b;

     a = *w;
     b = a & U64(0x8080808080808080);
@@ -142,9 +142,9 @@ static void XtimeLong(u64 *w)
  *   return [b0,b1];
  * The non-linear multiplies (*) can be done in parallel at no extra cost.
  */
-static void SubWord(u32 *w)
+static void SubWord(uint32_t *w)
 {
-    u32 x, y, a1, a2, a3, a4, a5, a6;
+    uint32_t x, y, a1, a2, a3, a4, a5, a6;

     x = *w;
     y = ((x & 0xFEFEFEFEu) >> 1) | ((x & 0x01010101u) << 7);
@@ -190,7 +190,7 @@ static void SubWord(u32 *w)
     a2 = a3;
     a2 ^= (a3 & 0x0C0C0C0Cu) >> 2;
     a4 = a3 & a2;
-    a4 ^= (a4 & 0x0A0A0A0A0Au) >> 1;
+    a4 ^= (a4 & 0x0A0A0A0Au) >> 1;
     a4 ^= (((a3 << 1) & a2) ^ ((a2 << 1) & a3)) & 0x0A0A0A0Au;
     a5 = a4 & 0x08080808u;
     a5 |= a5 >> 1;
@@ -233,9 +233,9 @@ static void SubWord(u32 *w)
     *w = x;
 }

-static void SubLong(u64 *w)
+static void SubLong(uint64_t *w)
 {
-    u64 x, y, a1, a2, a3, a4, a5, a6;
+    uint64_t x, y, a1, a2, a3, a4, a5, a6;

     x = *w;
     y = ((x & U64(0xFEFEFEFEFEFEFEFE)) >> 1) | ((x & U64(0x0101010101010101)) << 7);
@@ -327,9 +327,9 @@ static void SubLong(u64 *w)
 /*
  * This computes w := (S^-1 * (w + c))^-1
  */
-static void InvSubLong(u64 *w)
+static void InvSubLong(uint64_t *w)
 {
-    u64 x, y, a1, a2, a3, a4, a5, a6;
+    uint64_t x, y, a1, a2, a3, a4, a5, a6;

     x = *w;
     x ^= U64(0x6363636363636363);
@@ -422,7 +422,7 @@ static void InvSubLong(u64 *w)
     *w = x;
 }

-static void ShiftRows(u64 *state)
+static void ShiftRows(uint64_t *state)
 {
     unsigned char s[4];
     unsigned char *s0;
@@ -441,7 +441,7 @@ static void ShiftRows(u64 *state)
     }
 }

-static void InvShiftRows(u64 *state)
+static void InvShiftRows(uint64_t *state)
 {
     unsigned char s[4];
     unsigned char *s0;
@@ -460,7 +460,7 @@ static void InvShiftRows(u64 *state)
     }
 }

-static void MixColumns(u64 *state)
+static void MixColumns(uint64_t *state)
 {
     uni s1;
     uni s;
@@ -488,7 +488,7 @@ static void MixColumns(u64 *state)
     }
 }

-static void InvMixColumns(u64 *state)
+static void InvMixColumns(uint64_t *state)
 {
     uni s1;
     uni s;
@@ -524,16 +524,16 @@ static void InvMixColumns(u64 *state)
     }
 }

-static void AddRoundKey(u64 *state, const u64 *w)
+static void AddRoundKey(uint64_t *state, const uint64_t *w)
 {
     state[0] ^= w[0];
     state[1] ^= w[1];
 }

 static void Cipher(const unsigned char *in, unsigned char *out,
-    const u64 *w, int nr)
+    const uint64_t *w, int nr)
 {
-    u64 state[2];
+    uint64_t state[2];
     int i;

     memcpy(state, in, 16);
@@ -557,10 +557,10 @@ static void Cipher(const unsigned char *in, unsigned char *out,
 }

 static void InvCipher(const unsigned char *in, unsigned char *out,
-    const u64 *w, int nr)
+    const uint64_t *w, int nr)

 {
-    u64 state[2];
+    uint64_t state[2];
     int i;

     memcpy(state, in, 16);
@@ -583,7 +583,7 @@ static void InvCipher(const unsigned char *in, unsigned char *out,
     memcpy(out, state, 16);
 }

-static void RotWord(u32 *x)
+static void RotWord(uint32_t *x)
 {
     unsigned char *w0;
     unsigned char tmp;
@@ -596,12 +596,12 @@ static void RotWord(u32 *x)
     w0[3] = tmp;
 }

-static void KeyExpansion(const unsigned char *key, u64 *w,
+static void KeyExpansion(const unsigned char *key, uint64_t *w,
     int nr, int nk)
 {
-    u32 rcon;
+    uint32_t rcon;
     uni prev;
-    u32 temp;
+    uint32_t temp;
     int i, n;

     memcpy(w, key, nk * 4);
@@ -628,17 +628,17 @@ static void KeyExpansion(const unsigned char *key, u64 *w,
 /**
  * Expand the cipher key into the encryption key schedule.
  */
-int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
+int AES_set_encrypt_key(const unsigned char *userKey, int bits,
     AES_KEY *key)
 {
-    u64 *rk;
+    uint64_t *rk;

     if (!userKey || !key)
         return -1;
     if (bits != 128 && bits != 192 && bits != 256)
         return -2;

-    rk = (u64 *)key->rd_key;
+    rk = (uint64_t *)key->rd_key;

     if (bits == 128)
         key->rounds = 10;
@@ -654,7 +654,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
 /**
  * Expand the cipher key into the decryption key schedule.
  */
-int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
+int AES_set_decrypt_key(const unsigned char *userKey, int bits,
     AES_KEY *key)
 {
     return AES_set_encrypt_key(userKey, bits, key);
@@ -667,10 +667,10 @@ int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
 void AES_encrypt(const unsigned char *in, unsigned char *out,
     const AES_KEY *key)
 {
-    const u64 *rk;
+    const uint64_t *rk;

     assert(in && out && key);
-    rk = (u64 *)key->rd_key;
+    rk = (uint64_t *)key->rd_key;

     Cipher(in, out, rk, key->rounds);
 }
@@ -682,10 +682,10 @@ void AES_encrypt(const unsigned char *in, unsigned char *out,
 void AES_decrypt(const unsigned char *in, unsigned char *out,
     const AES_KEY *key)
 {
-    const u64 *rk;
+    const uint64_t *rk;

     assert(in && out && key);
-    rk = (u64 *)key->rd_key;
+    rk = (uint64_t *)key->rd_key;

     InvCipher(in, out, rk, key->rounds);
 }
@@ -703,2352 +703,586 @@ Td3[x] = Si[x].[09, 0d, 0b, 0e];
 Td4[x] = Si[x].[01];
 */

-static const u32 Te0[256] = {
-    0xc66363a5U,
-    0xf87c7c84U,
-    0xee777799U,
-    0xf67b7b8dU,
-    0xfff2f20dU,
-    0xd66b6bbdU,
-    0xde6f6fb1U,
-    0x91c5c554U,
-    0x60303050U,
-    0x02010103U,
-    0xce6767a9U,
-    0x562b2b7dU,
-    0xe7fefe19U,
-    0xb5d7d762U,
-    0x4dababe6U,
-    0xec76769aU,
-    0x8fcaca45U,
-    0x1f82829dU,
-    0x89c9c940U,
-    0xfa7d7d87U,
-    0xeffafa15U,
-    0xb25959ebU,
-    0x8e4747c9U,
-    0xfbf0f00bU,
-    0x41adadecU,
-    0xb3d4d467U,
-    0x5fa2a2fdU,
-    0x45afafeaU,
-    0x239c9cbfU,
-    0x53a4a4f7U,
-    0xe4727296U,
-    0x9bc0c05bU,
-    0x75b7b7c2U,
-    0xe1fdfd1cU,
-    0x3d9393aeU,
-    0x4c26266aU,
-    0x6c36365aU,
-    0x7e3f3f41U,
-    0xf5f7f702U,
-    0x83cccc4fU,
-    0x6834345cU,
-    0x51a5a5f4U,
-    0xd1e5e534U,
-    0xf9f1f108U,
-    0xe2717193U,
-    0xabd8d873U,
-    0x62313153U,
-    0x2a15153fU,
-    0x0804040cU,
-    0x95c7c752U,
-    0x46232365U,
-    0x9dc3c35eU,
-    0x30181828U,
-    0x379696a1U,
-    0x0a05050fU,
-    0x2f9a9ab5U,
-    0x0e070709U,
-    0x24121236U,
-    0x1b80809bU,
-    0xdfe2e23dU,
-    0xcdebeb26U,
-    0x4e272769U,
-    0x7fb2b2cdU,
-    0xea75759fU,
-    0x1209091bU,
-    0x1d83839eU,
-    0x582c2c74U,
-    0x341a1a2eU,
-    0x361b1b2dU,
-    0xdc6e6eb2U,
-    0xb45a5aeeU,
-    0x5ba0a0fbU,
-    0xa45252f6U,
-    0x763b3b4dU,
-    0xb7d6d661U,
-    0x7db3b3ceU,
-    0x5229297bU,
-    0xdde3e33eU,
-    0x5e2f2f71U,
-    0x13848497U,
-    0xa65353f5U,
-    0xb9d1d168U,
-    0x00000000U,
-    0xc1eded2cU,
-    0x40202060U,
-    0xe3fcfc1fU,
-    0x79b1b1c8U,
-    0xb65b5bedU,
-    0xd46a6abeU,
-    0x8dcbcb46U,
-    0x67bebed9U,
-    0x7239394bU,
-    0x944a4adeU,
-    0x984c4cd4U,
-    0xb05858e8U,
-    0x85cfcf4aU,
-    0xbbd0d06bU,
-    0xc5efef2aU,
-    0x4faaaae5U,
-    0xedfbfb16U,
-    0x864343c5U,
-    0x9a4d4dd7U,
-    0x66333355U,
-    0x11858594U,
-    0x8a4545cfU,
-    0xe9f9f910U,
-    0x04020206U,
-    0xfe7f7f81U,
-    0xa05050f0U,
-    0x783c3c44U,
-    0x259f9fbaU,
-    0x4ba8a8e3U,
-    0xa25151f3U,
-    0x5da3a3feU,
-    0x804040c0U,
-    0x058f8f8aU,
-    0x3f9292adU,
-    0x219d9dbcU,
-    0x70383848U,
-    0xf1f5f504U,
-    0x63bcbcdfU,
-    0x77b6b6c1U,
-    0xafdada75U,
-    0x42212163U,
-    0x20101030U,
-    0xe5ffff1aU,
-    0xfdf3f30eU,
-    0xbfd2d26dU,
-    0x81cdcd4cU,
-    0x180c0c14U,
-    0x26131335U,
-    0xc3ecec2fU,
-    0xbe5f5fe1U,
-    0x359797a2U,
-    0x884444ccU,
-    0x2e171739U,
-    0x93c4c457U,
-    0x55a7a7f2U,
-    0xfc7e7e82U,
-    0x7a3d3d47U,
-    0xc86464acU,
-    0xba5d5de7U,
-    0x3219192bU,
-    0xe6737395U,
-    0xc06060a0U,
-    0x19818198U,
-    0x9e4f4fd1U,
-    0xa3dcdc7fU,
-    0x44222266U,
-    0x542a2a7eU,
-    0x3b9090abU,
-    0x0b888883U,
-    0x8c4646caU,
-    0xc7eeee29U,
-    0x6bb8b8d3U,
-    0x2814143cU,
-    0xa7dede79U,
-    0xbc5e5ee2U,
-    0x160b0b1dU,
-    0xaddbdb76U,
-    0xdbe0e03bU,
-    0x64323256U,
-    0x743a3a4eU,
-    0x140a0a1eU,
-    0x924949dbU,
-    0x0c06060aU,
-    0x4824246cU,
-    0xb85c5ce4U,
-    0x9fc2c25dU,
-    0xbdd3d36eU,
-    0x43acacefU,
-    0xc46262a6U,
-    0x399191a8U,
-    0x319595a4U,
-    0xd3e4e437U,
-    0xf279798bU,
-    0xd5e7e732U,
-    0x8bc8c843U,
-    0x6e373759U,
-    0xda6d6db7U,
-    0x018d8d8cU,
-    0xb1d5d564U,
-    0x9c4e4ed2U,
-    0x49a9a9e0U,
-    0xd86c6cb4U,
-    0xac5656faU,
-    0xf3f4f407U,
-    0xcfeaea25U,
-    0xca6565afU,
-    0xf47a7a8eU,
-    0x47aeaee9U,
-    0x10080818U,
-    0x6fbabad5U,
-    0xf0787888U,
-    0x4a25256fU,
-    0x5c2e2e72U,
-    0x381c1c24U,
-    0x57a6a6f1U,
-    0x73b4b4c7U,
-    0x97c6c651U,
-    0xcbe8e823U,
-    0xa1dddd7cU,
-    0xe874749cU,
-    0x3e1f1f21U,
-    0x964b4bddU,
-    0x61bdbddcU,
-    0x0d8b8b86U,
-    0x0f8a8a85U,
-    0xe0707090U,
-    0x7c3e3e42U,
-    0x71b5b5c4U,
-    0xcc6666aaU,
-    0x904848d8U,
-    0x06030305U,
-    0xf7f6f601U,
-    0x1c0e0e12U,
-    0xc26161a3U,
-    0x6a35355fU,
-    0xae5757f9U,
-    0x69b9b9d0U,
-    0x17868691U,
-    0x99c1c158U,
-    0x3a1d1d27U,
-    0x279e9eb9U,
-    0xd9e1e138U,
-    0xebf8f813U,
-    0x2b9898b3U,
-    0x22111133U,
-    0xd26969bbU,
-    0xa9d9d970U,
-    0x078e8e89U,
-    0x339494a7U,
-    0x2d9b9bb6U,
-    0x3c1e1e22U,
-    0x15878792U,
-    0xc9e9e920U,
-    0x87cece49U,
-    0xaa5555ffU,
-    0x50282878U,
-    0xa5dfdf7aU,
-    0x038c8c8fU,
-    0x59a1a1f8U,
-    0x09898980U,
-    0x1a0d0d17U,
-    0x65bfbfdaU,
-    0xd7e6e631U,
-    0x844242c6U,
-    0xd06868b8U,
-    0x824141c3U,
-    0x299999b0U,
-    0x5a2d2d77U,
-    0x1e0f0f11U,
-    0x7bb0b0cbU,
-    0xa85454fcU,
-    0x6dbbbbd6U,
-    0x2c16163aU,
+static const uint32_t Te0[256] = {
+    0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
+    0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
+    0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU,
+    0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU,
+    0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U,
+    0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU,
+    0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU,
+    0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU,
+    0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU,
+    0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU,
+    0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U,
+    0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU,
+    0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU,
+    0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U,
+    0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU,
+    0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU,
+    0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU,
+    0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU,
+    0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU,
+    0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U,
+    0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU,
+    0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU,
+    0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU,
+    0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU,
+    0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U,
+    0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U,
+    0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U,
+    0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U,
+    0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU,
+    0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U,
+    0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U,
+    0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU,
+    0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU,
+    0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U,
+    0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U,
+    0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U,
+    0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU,
+    0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U,
+    0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU,
+    0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U,
+    0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU,
+    0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U,
+    0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U,
+    0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU,
+    0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U,
+    0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U,
+    0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U,
+    0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U,
+    0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U,
+    0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U,
+    0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U,
+    0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U,
+    0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU,
+    0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U,
+    0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U,
+    0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U,
+    0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U,
+    0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U,
+    0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U,
+    0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU,
+    0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U,
+    0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U,
+    0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U,
+    0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU
 };
-static const u32 Te1[256] = {
-    0xa5c66363U,
-    0x84f87c7cU,
-    0x99ee7777U,
-    0x8df67b7bU,
-    0x0dfff2f2U,
-    0xbdd66b6bU,
-    0xb1de6f6fU,
-    0x5491c5c5U,
-    0x50603030U,
-    0x03020101U,
-    0xa9ce6767U,
-    0x7d562b2bU,
-    0x19e7fefeU,
-    0x62b5d7d7U,
-    0xe64dababU,
-    0x9aec7676U,
-    0x458fcacaU,
-    0x9d1f8282U,
-    0x4089c9c9U,
-    0x87fa7d7dU,
-    0x15effafaU,
-    0xebb25959U,
-    0xc98e4747U,
-    0x0bfbf0f0U,
-    0xec41adadU,
-    0x67b3d4d4U,
-    0xfd5fa2a2U,
-    0xea45afafU,
-    0xbf239c9cU,
-    0xf753a4a4U,
-    0x96e47272U,
-    0x5b9bc0c0U,
-    0xc275b7b7U,
-    0x1ce1fdfdU,
-    0xae3d9393U,
-    0x6a4c2626U,
-    0x5a6c3636U,
-    0x417e3f3fU,
-    0x02f5f7f7U,
-    0x4f83ccccU,
-    0x5c683434U,
-    0xf451a5a5U,
-    0x34d1e5e5U,
-    0x08f9f1f1U,
-    0x93e27171U,
-    0x73abd8d8U,
-    0x53623131U,
-    0x3f2a1515U,
-    0x0c080404U,
-    0x5295c7c7U,
-    0x65462323U,
-    0x5e9dc3c3U,
-    0x28301818U,
-    0xa1379696U,
-    0x0f0a0505U,
-    0xb52f9a9aU,
-    0x090e0707U,
-    0x36241212U,
-    0x9b1b8080U,
-    0x3ddfe2e2U,
-    0x26cdebebU,
-    0x694e2727U,
-    0xcd7fb2b2U,
-    0x9fea7575U,
-    0x1b120909U,
-    0x9e1d8383U,
-    0x74582c2cU,
-    0x2e341a1aU,
-    0x2d361b1bU,
-    0xb2dc6e6eU,
-    0xeeb45a5aU,
-    0xfb5ba0a0U,
-    0xf6a45252U,
-    0x4d763b3bU,
-    0x61b7d6d6U,
-    0xce7db3b3U,
-    0x7b522929U,
-    0x3edde3e3U,
-    0x715e2f2fU,
-    0x97138484U,
-    0xf5a65353U,
-    0x68b9d1d1U,
-    0x00000000U,
-    0x2cc1ededU,
-    0x60402020U,
-    0x1fe3fcfcU,
-    0xc879b1b1U,
-    0xedb65b5bU,
-    0xbed46a6aU,
-    0x468dcbcbU,
-    0xd967bebeU,
-    0x4b723939U,
-    0xde944a4aU,
-    0xd4984c4cU,
-    0xe8b05858U,
-    0x4a85cfcfU,
-    0x6bbbd0d0U,
-    0x2ac5efefU,
-    0xe54faaaaU,
-    0x16edfbfbU,
-    0xc5864343U,
-    0xd79a4d4dU,
-    0x55663333U,
-    0x94118585U,
-    0xcf8a4545U,
-    0x10e9f9f9U,
-    0x06040202U,
-    0x81fe7f7fU,
-    0xf0a05050U,
-    0x44783c3cU,
-    0xba259f9fU,
-    0xe34ba8a8U,
-    0xf3a25151U,
-    0xfe5da3a3U,
-    0xc0804040U,
-    0x8a058f8fU,
-    0xad3f9292U,
-    0xbc219d9dU,
-    0x48703838U,
-    0x04f1f5f5U,
-    0xdf63bcbcU,
-    0xc177b6b6U,
-    0x75afdadaU,
-    0x63422121U,
-    0x30201010U,
-    0x1ae5ffffU,
-    0x0efdf3f3U,
-    0x6dbfd2d2U,
-    0x4c81cdcdU,
-    0x14180c0cU,
-    0x35261313U,
-    0x2fc3ececU,
-    0xe1be5f5fU,
-    0xa2359797U,
-    0xcc884444U,
-    0x392e1717U,
-    0x5793c4c4U,
-    0xf255a7a7U,
-    0x82fc7e7eU,
-    0x477a3d3dU,
-    0xacc86464U,
-    0xe7ba5d5dU,
-    0x2b321919U,
-    0x95e67373U,
-    0xa0c06060U,
-    0x98198181U,
-    0xd19e4f4fU,
-    0x7fa3dcdcU,
-    0x66442222U,
-    0x7e542a2aU,
-    0xab3b9090U,
-    0x830b8888U,
-    0xca8c4646U,
-    0x29c7eeeeU,
-    0xd36bb8b8U,
-    0x3c281414U,
-    0x79a7dedeU,
-    0xe2bc5e5eU,
-    0x1d160b0bU,
-    0x76addbdbU,
-    0x3bdbe0e0U,
-    0x56643232U,
-    0x4e743a3aU,
-    0x1e140a0aU,
-    0xdb924949U,
-    0x0a0c0606U,
-    0x6c482424U,
-    0xe4b85c5cU,
-    0x5d9fc2c2U,
-    0x6ebdd3d3U,
-    0xef43acacU,
-    0xa6c46262U,
-    0xa8399191U,
-    0xa4319595U,
-    0x37d3e4e4U,
-    0x8bf27979U,
-    0x32d5e7e7U,
-    0x438bc8c8U,
-    0x596e3737U,
-    0xb7da6d6dU,
-    0x8c018d8dU,
-    0x64b1d5d5U,
-    0xd29c4e4eU,
-    0xe049a9a9U,
-    0xb4d86c6cU,
-    0xfaac5656U,
-    0x07f3f4f4U,
-    0x25cfeaeaU,
-    0xafca6565U,
-    0x8ef47a7aU,
-    0xe947aeaeU,
-    0x18100808U,
-    0xd56fbabaU,
-    0x88f07878U,
-    0x6f4a2525U,
-    0x725c2e2eU,
-    0x24381c1cU,
-    0xf157a6a6U,
-    0xc773b4b4U,
-    0x5197c6c6U,
-    0x23cbe8e8U,
-    0x7ca1ddddU,
-    0x9ce87474U,
-    0x213e1f1fU,
-    0xdd964b4bU,
-    0xdc61bdbdU,
-    0x860d8b8bU,
-    0x850f8a8aU,
-    0x90e07070U,
-    0x427c3e3eU,
-    0xc471b5b5U,
-    0xaacc6666U,
-    0xd8904848U,
-    0x05060303U,
-    0x01f7f6f6U,
-    0x121c0e0eU,
-    0xa3c26161U,
-    0x5f6a3535U,
-    0xf9ae5757U,
-    0xd069b9b9U,
-    0x91178686U,
-    0x5899c1c1U,
-    0x273a1d1dU,
-    0xb9279e9eU,
-    0x38d9e1e1U,
-    0x13ebf8f8U,
-    0xb32b9898U,
-    0x33221111U,
-    0xbbd26969U,
-    0x70a9d9d9U,
-    0x89078e8eU,
-    0xa7339494U,
-    0xb62d9b9bU,
-    0x223c1e1eU,
-    0x92158787U,
-    0x20c9e9e9U,
-    0x4987ceceU,
-    0xffaa5555U,
-    0x78502828U,
-    0x7aa5dfdfU,
-    0x8f038c8cU,
-    0xf859a1a1U,
-    0x80098989U,
-    0x171a0d0dU,
-    0xda65bfbfU,
-    0x31d7e6e6U,
-    0xc6844242U,
-    0xb8d06868U,
-    0xc3824141U,
-    0xb0299999U,
-    0x775a2d2dU,
-    0x111e0f0fU,
-    0xcb7bb0b0U,
-    0xfca85454U,
-    0xd66dbbbbU,
-    0x3a2c1616U,
+static const uint32_t Te1[256] = {
+    0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU,
+    0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U,
+    0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU,
+    0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U,
+    0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU,
+    0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U,
+    0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU,
+    0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U,
+    0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U,
+    0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU,
+    0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U,
+    0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U,
+    0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U,
+    0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU,
+    0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U,
+    0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U,
+    0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU,
+    0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U,
+    0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U,
+    0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U,
+    0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU,
+    0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU,
+    0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U,
+    0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU,
+    0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU,
+    0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U,
+    0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU,
+    0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U,
+    0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU,
+    0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U,
+    0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U,
+    0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U,
+    0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU,
+    0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U,
+    0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU,
+    0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U,
+    0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU,
+    0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U,
+    0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U,
+    0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU,
+    0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU,
+    0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU,
+    0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U,
+    0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U,
+    0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU,
+    0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U,
+    0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU,
+    0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U,
+    0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU,
+    0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U,
+    0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU,
+    0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU,
+    0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U,
+    0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU,
+    0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U,
+    0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU,
+    0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U,
+    0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U,
+    0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U,
+    0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU,
+    0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU,
+    0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U,
+    0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU,
+    0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U
 };
-static const u32 Te2[256] = {
-    0x63a5c663U,
-    0x7c84f87cU,
-    0x7799ee77U,
-    0x7b8df67bU,
-    0xf20dfff2U,
-    0x6bbdd66bU,
-    0x6fb1de6fU,
-    0xc55491c5U,
-    0x30506030U,
-    0x01030201U,
-    0x67a9ce67U,
-    0x2b7d562bU,
-    0xfe19e7feU,
-    0xd762b5d7U,
-    0xabe64dabU,
-    0x769aec76U,
-    0xca458fcaU,
-    0x829d1f82U,
-    0xc94089c9U,
-    0x7d87fa7dU,
-    0xfa15effaU,
-    0x59ebb259U,
-    0x47c98e47U,
-    0xf00bfbf0U,
-    0xadec41adU,
-    0xd467b3d4U,
-    0xa2fd5fa2U,
-    0xafea45afU,
-    0x9cbf239cU,
-    0xa4f753a4U,
-    0x7296e472U,
-    0xc05b9bc0U,
-    0xb7c275b7U,
-    0xfd1ce1fdU,
-    0x93ae3d93U,
-    0x266a4c26U,
-    0x365a6c36U,
-    0x3f417e3fU,
-    0xf702f5f7U,
-    0xcc4f83ccU,
-    0x345c6834U,
-    0xa5f451a5U,
-    0xe534d1e5U,
-    0xf108f9f1U,
-    0x7193e271U,
-    0xd873abd8U,
-    0x31536231U,
-    0x153f2a15U,
-    0x040c0804U,
-    0xc75295c7U,
-    0x23654623U,
-    0xc35e9dc3U,
-    0x18283018U,
-    0x96a13796U,
-    0x050f0a05U,
-    0x9ab52f9aU,
-    0x07090e07U,
-    0x12362412U,
-    0x809b1b80U,
-    0xe23ddfe2U,
-    0xeb26cdebU,
-    0x27694e27U,
-    0xb2cd7fb2U,
-    0x759fea75U,
-    0x091b1209U,
-    0x839e1d83U,
-    0x2c74582cU,
-    0x1a2e341aU,
-    0x1b2d361bU,
-    0x6eb2dc6eU,
-    0x5aeeb45aU,
-    0xa0fb5ba0U,
-    0x52f6a452U,
-    0x3b4d763bU,
-    0xd661b7d6U,
-    0xb3ce7db3U,
-    0x297b5229U,
-    0xe33edde3U,
-    0x2f715e2fU,
-    0x84971384U,
-    0x53f5a653U,
-    0xd168b9d1U,
-    0x00000000U,
-    0xed2cc1edU,
-    0x20604020U,
-    0xfc1fe3fcU,
-    0xb1c879b1U,
-    0x5bedb65bU,
-    0x6abed46aU,
-    0xcb468dcbU,
-    0xbed967beU,
-    0x394b7239U,
-    0x4ade944aU,
-    0x4cd4984cU,
-    0x58e8b058U,
-    0xcf4a85cfU,
-    0xd06bbbd0U,
-    0xef2ac5efU,
-    0xaae54faaU,
-    0xfb16edfbU,
-    0x43c58643U,
-    0x4dd79a4dU,
-    0x33556633U,
-    0x85941185U,
-    0x45cf8a45U,
-    0xf910e9f9U,
-    0x02060402U,
-    0x7f81fe7fU,
-    0x50f0a050U,
-    0x3c44783cU,
-    0x9fba259fU,
-    0xa8e34ba8U,
-    0x51f3a251U,
-    0xa3fe5da3U,
-    0x40c08040U,
-    0x8f8a058fU,
-    0x92ad3f92U,
-    0x9dbc219dU,
-    0x38487038U,
-    0xf504f1f5U,
-    0xbcdf63bcU,
-    0xb6c177b6U,
-    0xda75afdaU,
-    0x21634221U,
-    0x10302010U,
-    0xff1ae5ffU,
-    0xf30efdf3U,
-    0xd26dbfd2U,
-    0xcd4c81cdU,
-    0x0c14180cU,
-    0x13352613U,
-    0xec2fc3ecU,
-    0x5fe1be5fU,
-    0x97a23597U,
-    0x44cc8844U,
-    0x17392e17U,
-    0xc45793c4U,
-    0xa7f255a7U,
-    0x7e82fc7eU,
-    0x3d477a3dU,
-    0x64acc864U,
-    0x5de7ba5dU,
-    0x192b3219U,
-    0x7395e673U,
-    0x60a0c060U,
-    0x81981981U,
-    0x4fd19e4fU,
-    0xdc7fa3dcU,
-    0x22664422U,
-    0x2a7e542aU,
-    0x90ab3b90U,
-    0x88830b88U,
-    0x46ca8c46U,
-    0xee29c7eeU,
-    0xb8d36bb8U,
-    0x143c2814U,
-    0xde79a7deU,
-    0x5ee2bc5eU,
-    0x0b1d160bU,
-    0xdb76addbU,
-    0xe03bdbe0U,
-    0x32566432U,
-    0x3a4e743aU,
-    0x0a1e140aU,
-    0x49db9249U,
-    0x060a0c06U,
-    0x246c4824U,
-    0x5ce4b85cU,
-    0xc25d9fc2U,
-    0xd36ebdd3U,
-    0xacef43acU,
-    0x62a6c462U,
-    0x91a83991U,
-    0x95a43195U,
-    0xe437d3e4U,
-    0x798bf279U,
-    0xe732d5e7U,
-    0xc8438bc8U,
-    0x37596e37U,
-    0x6db7da6dU,
-    0x8d8c018dU,
-    0xd564b1d5U,
-    0x4ed29c4eU,
-    0xa9e049a9U,
-    0x6cb4d86cU,
-    0x56faac56U,
-    0xf407f3f4U,
-    0xea25cfeaU,
-    0x65afca65U,
-    0x7a8ef47aU,
-    0xaee947aeU,
-    0x08181008U,
-    0xbad56fbaU,
-    0x7888f078U,
-    0x256f4a25U,
-    0x2e725c2eU,
-    0x1c24381cU,
-    0xa6f157a6U,
-    0xb4c773b4U,
-    0xc65197c6U,
-    0xe823cbe8U,
-    0xdd7ca1ddU,
-    0x749ce874U,
-    0x1f213e1fU,
-    0x4bdd964bU,
-    0xbddc61bdU,
-    0x8b860d8bU,
-    0x8a850f8aU,
-    0x7090e070U,
-    0x3e427c3eU,
-    0xb5c471b5U,
-    0x66aacc66U,
-    0x48d89048U,
-    0x03050603U,
-    0xf601f7f6U,
-    0x0e121c0eU,
-    0x61a3c261U,
-    0x355f6a35U,
-    0x57f9ae57U,
-    0xb9d069b9U,
-    0x86911786U,
-    0xc15899c1U,
-    0x1d273a1dU,
-    0x9eb9279eU,
-    0xe138d9e1U,
-    0xf813ebf8U,
-    0x98b32b98U,
-    0x11332211U,
-    0x69bbd269U,
-    0xd970a9d9U,
-    0x8e89078eU,
-    0x94a73394U,
-    0x9bb62d9bU,
-    0x1e223c1eU,
-    0x87921587U,
-    0xe920c9e9U,
-    0xce4987ceU,
-    0x55ffaa55U,
-    0x28785028U,
-    0xdf7aa5dfU,
-    0x8c8f038cU,
-    0xa1f859a1U,
-    0x89800989U,
-    0x0d171a0dU,
-    0xbfda65bfU,
-    0xe631d7e6U,
-    0x42c68442U,
-    0x68b8d068U,
-    0x41c38241U,
-    0x99b02999U,
-    0x2d775a2dU,
-    0x0f111e0fU,
-    0xb0cb7bb0U,
-    0x54fca854U,
-    0xbbd66dbbU,
-    0x163a2c16U,
+static const uint32_t Te2[256] = {
+    0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU,
+    0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U,
+    0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU,
+    0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U,
+    0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU,
+    0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U,
+    0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU,
+    0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U,
+    0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U,
+    0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU,
+    0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U,
+    0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U,
+    0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U,
+    0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU,
+    0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U,
+    0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U,
+    0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU,
+    0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U,
+    0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U,
+    0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U,
+    0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU,
+    0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU,
+    0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U,
+    0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU,
+    0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU,
+    0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U,
+    0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU,
+    0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U,
+    0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU,
+    0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U,
+    0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U,
+    0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U,
+    0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU,
+    0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U,
+    0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU,
+    0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U,
+    0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU,
+    0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U,
+    0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U,
+    0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU,
+    0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU,
+    0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU,
+    0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U,
+    0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U,
+    0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU,
+    0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U,
+    0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU,
+    0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U,
+    0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU,
+    0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U,
+    0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU,
+    0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU,
+    0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U,
+    0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU,
+    0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U,
+    0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU,
+    0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U,
+    0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U,
+    0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U,
+    0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU,
+    0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU,
+    0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U,
+    0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU,
+    0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U
 };
-static const u32 Te3[256] = {
-    0x6363a5c6U,
-    0x7c7c84f8U,
-    0x777799eeU,
-    0x7b7b8df6U,
-    0xf2f20dffU,
-    0x6b6bbdd6U,
-    0x6f6fb1deU,
-    0xc5c55491U,
-    0x30305060U,
-    0x01010302U,
-    0x6767a9ceU,
-    0x2b2b7d56U,
-    0xfefe19e7U,
-    0xd7d762b5U,
-    0xababe64dU,
-    0x76769aecU,
-    0xcaca458fU,
-    0x82829d1fU,
-    0xc9c94089U,
-    0x7d7d87faU,
-    0xfafa15efU,
-    0x5959ebb2U,
-    0x4747c98eU,
-    0xf0f00bfbU,
-    0xadadec41U,
-    0xd4d467b3U,
-    0xa2a2fd5fU,
-    0xafafea45U,
-    0x9c9cbf23U,
-    0xa4a4f753U,
-    0x727296e4U,
-    0xc0c05b9bU,
-    0xb7b7c275U,
-    0xfdfd1ce1U,
-    0x9393ae3dU,
-    0x26266a4cU,
-    0x36365a6cU,
-    0x3f3f417eU,
-    0xf7f702f5U,
-    0xcccc4f83U,
-    0x34345c68U,
-    0xa5a5f451U,
-    0xe5e534d1U,
-    0xf1f108f9U,
-    0x717193e2U,
-    0xd8d873abU,
-    0x31315362U,
-    0x15153f2aU,
-    0x04040c08U,
-    0xc7c75295U,
-    0x23236546U,
-    0xc3c35e9dU,
-    0x18182830U,
-    0x9696a137U,
-    0x05050f0aU,
-    0x9a9ab52fU,
-    0x0707090eU,
-    0x12123624U,
-    0x80809b1bU,
-    0xe2e23ddfU,
-    0xebeb26cdU,
-    0x2727694eU,
-    0xb2b2cd7fU,
-    0x75759feaU,
-    0x09091b12U,
-    0x83839e1dU,
-    0x2c2c7458U,
-    0x1a1a2e34U,
-    0x1b1b2d36U,
-    0x6e6eb2dcU,
-    0x5a5aeeb4U,
-    0xa0a0fb5bU,
-    0x5252f6a4U,
-    0x3b3b4d76U,
-    0xd6d661b7U,
-    0xb3b3ce7dU,
-    0x29297b52U,
-    0xe3e33eddU,
-    0x2f2f715eU,
-    0x84849713U,
-    0x5353f5a6U,
-    0xd1d168b9U,
-    0x00000000U,
-    0xeded2cc1U,
-    0x20206040U,
-    0xfcfc1fe3U,
-    0xb1b1c879U,
-    0x5b5bedb6U,
-    0x6a6abed4U,
-    0xcbcb468dU,
-    0xbebed967U,
-    0x39394b72U,
-    0x4a4ade94U,
-    0x4c4cd498U,
-    0x5858e8b0U,
-    0xcfcf4a85U,
-    0xd0d06bbbU,
-    0xefef2ac5U,
-    0xaaaae54fU,
-    0xfbfb16edU,
-    0x4343c586U,
-    0x4d4dd79aU,
-    0x33335566U,
-    0x85859411U,
-    0x4545cf8aU,
-    0xf9f910e9U,
-    0x02020604U,
-    0x7f7f81feU,
-    0x5050f0a0U,
-    0x3c3c4478U,
-    0x9f9fba25U,
-    0xa8a8e34bU,
-    0x5151f3a2U,
-    0xa3a3fe5dU,
-    0x4040c080U,
-    0x8f8f8a05U,
-    0x9292ad3fU,
-    0x9d9dbc21U,
-    0x38384870U,
-    0xf5f504f1U,
-    0xbcbcdf63U,
-    0xb6b6c177U,
-    0xdada75afU,
-    0x21216342U,
-    0x10103020U,
-    0xffff1ae5U,
-    0xf3f30efdU,
-    0xd2d26dbfU,
-    0xcdcd4c81U,
-    0x0c0c1418U,
-    0x13133526U,
-    0xecec2fc3U,
-    0x5f5fe1beU,
-    0x9797a235U,
-    0x4444cc88U,
-    0x1717392eU,
-    0xc4c45793U,
-    0xa7a7f255U,
-    0x7e7e82fcU,
-    0x3d3d477aU,
-    0x6464acc8U,
-    0x5d5de7baU,
-    0x19192b32U,
-    0x737395e6U,
-    0x6060a0c0U,
-    0x81819819U,
-    0x4f4fd19eU,
-    0xdcdc7fa3U,
-    0x22226644U,
-    0x2a2a7e54U,
-    0x9090ab3bU,
-    0x8888830bU,
-    0x4646ca8cU,
-    0xeeee29c7U,
-    0xb8b8d36bU,
-    0x14143c28U,
-    0xdede79a7U,
-    0x5e5ee2bcU,
-    0x0b0b1d16U,
-    0xdbdb76adU,
-    0xe0e03bdbU,
-    0x32325664U,
-    0x3a3a4e74U,
-    0x0a0a1e14U,
-    0x4949db92U,
-    0x06060a0cU,
-    0x24246c48U,
-    0x5c5ce4b8U,
-    0xc2c25d9fU,
-    0xd3d36ebdU,
-    0xacacef43U,
-    0x6262a6c4U,
-    0x9191a839U,
-    0x9595a431U,
-    0xe4e437d3U,
-    0x79798bf2U,
-    0xe7e732d5U,
-    0xc8c8438bU,
-    0x3737596eU,
-    0x6d6db7daU,
-    0x8d8d8c01U,
-    0xd5d564b1U,
-    0x4e4ed29cU,
-    0xa9a9e049U,
-    0x6c6cb4d8U,
-    0x5656faacU,
-    0xf4f407f3U,
-    0xeaea25cfU,
-    0x6565afcaU,
-    0x7a7a8ef4U,
-    0xaeaee947U,
-    0x08081810U,
-    0xbabad56fU,
-    0x787888f0U,
-    0x25256f4aU,
-    0x2e2e725cU,
-    0x1c1c2438U,
-    0xa6a6f157U,
-    0xb4b4c773U,
-    0xc6c65197U,
-    0xe8e823cbU,
-    0xdddd7ca1U,
-    0x74749ce8U,
-    0x1f1f213eU,
-    0x4b4bdd96U,
-    0xbdbddc61U,
-    0x8b8b860dU,
-    0x8a8a850fU,
-    0x707090e0U,
-    0x3e3e427cU,
-    0xb5b5c471U,
-    0x6666aaccU,
-    0x4848d890U,
-    0x03030506U,
-    0xf6f601f7U,
-    0x0e0e121cU,
-    0x6161a3c2U,
-    0x35355f6aU,
-    0x5757f9aeU,
-    0xb9b9d069U,
-    0x86869117U,
-    0xc1c15899U,
-    0x1d1d273aU,
-    0x9e9eb927U,
-    0xe1e138d9U,
-    0xf8f813ebU,
-    0x9898b32bU,
-    0x11113322U,
-    0x6969bbd2U,
-    0xd9d970a9U,
-    0x8e8e8907U,
-    0x9494a733U,
-    0x9b9bb62dU,
-    0x1e1e223cU,
-    0x87879215U,
-    0xe9e920c9U,
-    0xcece4987U,
-    0x5555ffaaU,
-    0x28287850U,
-    0xdfdf7aa5U,
-    0x8c8c8f03U,
-    0xa1a1f859U,
-    0x89898009U,
-    0x0d0d171aU,
-    0xbfbfda65U,
-    0xe6e631d7U,
-    0x4242c684U,
-    0x6868b8d0U,
-    0x4141c382U,
-    0x9999b029U,
-    0x2d2d775aU,
-    0x0f0f111eU,
-    0xb0b0cb7bU,
-    0x5454fca8U,
-    0xbbbbd66dU,
-    0x16163a2cU,
+static const uint32_t Te3[256] = {
+    0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U,
+    0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U,
+    0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U,
+    0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU,
+    0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU,
+    0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU,
+    0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U,
+    0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU,
+    0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU,
+    0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U,
+    0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U,
+    0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU,
+    0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU,
+    0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU,
+    0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU,
+    0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU,
+    0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U,
+    0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU,
+    0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU,
+    0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U,
+    0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U,
+    0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U,
+    0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U,
+    0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U,
+    0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU,
+    0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U,
+    0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU,
+    0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU,
+    0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U,
+    0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U,
+    0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U,
+    0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU,
+    0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U,
+    0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU,
+    0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU,
+    0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U,
+    0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U,
+    0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU,
+    0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U,
+    0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU,
+    0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U,
+    0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U,
+    0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U,
+    0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U,
+    0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU,
+    0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U,
+    0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU,
+    0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U,
+    0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU,
+    0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U,
+    0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU,
+    0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU,
+    0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU,
+    0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU,
+    0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U,
+    0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U,
+    0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U,
+    0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U,
+    0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U,
+    0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U,
+    0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU,
+    0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U,
+    0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU,
+    0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU
 };

-static const u32 Td0[256] = {
-    0x51f4a750U,
-    0x7e416553U,
-    0x1a17a4c3U,
-    0x3a275e96U,
-    0x3bab6bcbU,
-    0x1f9d45f1U,
-    0xacfa58abU,
-    0x4be30393U,
-    0x2030fa55U,
-    0xad766df6U,
-    0x88cc7691U,
-    0xf5024c25U,
-    0x4fe5d7fcU,
-    0xc52acbd7U,
-    0x26354480U,
-    0xb562a38fU,
-    0xdeb15a49U,
-    0x25ba1b67U,
-    0x45ea0e98U,
-    0x5dfec0e1U,
-    0xc32f7502U,
-    0x814cf012U,
-    0x8d4697a3U,
-    0x6bd3f9c6U,
-    0x038f5fe7U,
-    0x15929c95U,
-    0xbf6d7aebU,
-    0x955259daU,
-    0xd4be832dU,
-    0x587421d3U,
-    0x49e06929U,
-    0x8ec9c844U,
-    0x75c2896aU,
-    0xf48e7978U,
-    0x99583e6bU,
-    0x27b971ddU,
-    0xbee14fb6U,
-    0xf088ad17U,
-    0xc920ac66U,
-    0x7dce3ab4U,
-    0x63df4a18U,
-    0xe51a3182U,
-    0x97513360U,
-    0x62537f45U,
-    0xb16477e0U,
-    0xbb6bae84U,
-    0xfe81a01cU,
-    0xf9082b94U,
-    0x70486858U,
-    0x8f45fd19U,
-    0x94de6c87U,
-    0x527bf8b7U,
-    0xab73d323U,
-    0x724b02e2U,
-    0xe31f8f57U,
-    0x6655ab2aU,
-    0xb2eb2807U,
-    0x2fb5c203U,
-    0x86c57b9aU,
-    0xd33708a5U,
-    0x302887f2U,
-    0x23bfa5b2U,
-    0x02036abaU,
-    0xed16825cU,
-    0x8acf1c2bU,
-    0xa779b492U,
-    0xf307f2f0U,
-    0x4e69e2a1U,
-    0x65daf4cdU,
-    0x0605bed5U,
-    0xd134621fU,
-    0xc4a6fe8aU,
-    0x342e539dU,
-    0xa2f355a0U,
-    0x058ae132U,
-    0xa4f6eb75U,
-    0x0b83ec39U,
-    0x4060efaaU,
-    0x5e719f06U,
-    0xbd6e1051U,
-    0x3e218af9U,
-    0x96dd063dU,
-    0xdd3e05aeU,
-    0x4de6bd46U,
-    0x91548db5U,
-    0x71c45d05U,
-    0x0406d46fU,
-    0x605015ffU,
-    0x1998fb24U,
-    0xd6bde997U,
-    0x894043ccU,
-    0x67d99e77U,
-    0xb0e842bdU,
-    0x07898b88U,
-    0xe7195b38U,
-    0x79c8eedbU,
-    0xa17c0a47U,
-    0x7c420fe9U,
-    0xf8841ec9U,
-    0x00000000U,
-    0x09808683U,
-    0x322bed48U,
-    0x1e1170acU,
-    0x6c5a724eU,
-    0xfd0efffbU,
-    0x0f853856U,
-    0x3daed51eU,
-    0x362d3927U,
-    0x0a0fd964U,
-    0x685ca621U,
-    0x9b5b54d1U,
-    0x24362e3aU,
-    0x0c0a67b1U,
-    0x9357e70fU,
-    0xb4ee96d2U,
-    0x1b9b919eU,
-    0x80c0c54fU,
-    0x61dc20a2U,
-    0x5a774b69U,
-    0x1c121a16U,
-    0xe293ba0aU,
-    0xc0a02ae5U,
-    0x3c22e043U,
-    0x121b171dU,
-    0x0e090d0bU,
-    0xf28bc7adU,
-    0x2db6a8b9U,
-    0x141ea9c8U,
-    0x57f11985U,
-    0xaf75074cU,
-    0xee99ddbbU,
-    0xa37f60fdU,
-    0xf701269fU,
-    0x5c72f5bcU,
-    0x44663bc5U,
-    0x5bfb7e34U,
-    0x8b432976U,
-    0xcb23c6dcU,
-    0xb6edfc68U,
-    0xb8e4f163U,
-    0xd731dccaU,
-    0x42638510U,
-    0x13972240U,
-    0x84c61120U,
-    0x854a247dU,
-    0xd2bb3df8U,
-    0xaef93211U,
-    0xc729a16dU,
-    0x1d9e2f4bU,
-    0xdcb230f3U,
-    0x0d8652ecU,
-    0x77c1e3d0U,
-    0x2bb3166cU,
-    0xa970b999U,
-    0x119448faU,
-    0x47e96422U,
-    0xa8fc8cc4U,
-    0xa0f03f1aU,
-    0x567d2cd8U,
-    0x223390efU,
-    0x87494ec7U,
-    0xd938d1c1U,
-    0x8ccaa2feU,
-    0x98d40b36U,
-    0xa6f581cfU,
-    0xa57ade28U,
-    0xdab78e26U,
-    0x3fadbfa4U,
-    0x2c3a9de4U,
-    0x5078920dU,
-    0x6a5fcc9bU,
-    0x547e4662U,
-    0xf68d13c2U,
-    0x90d8b8e8U,
-    0x2e39f75eU,
-    0x82c3aff5U,
-    0x9f5d80beU,
-    0x69d0937cU,
-    0x6fd52da9U,
-    0xcf2512b3U,
-    0xc8ac993bU,
-    0x10187da7U,
-    0xe89c636eU,
-    0xdb3bbb7bU,
-    0xcd267809U,
-    0x6e5918f4U,
-    0xec9ab701U,
-    0x834f9aa8U,
-    0xe6956e65U,
-    0xaaffe67eU,
-    0x21bccf08U,
-    0xef15e8e6U,
-    0xbae79bd9U,
-    0x4a6f36ceU,
-    0xea9f09d4U,
-    0x29b07cd6U,
-    0x31a4b2afU,
-    0x2a3f2331U,
-    0xc6a59430U,
-    0x35a266c0U,
-    0x744ebc37U,
-    0xfc82caa6U,
-    0xe090d0b0U,
-    0x33a7d815U,
-    0xf104984aU,
-    0x41ecdaf7U,
-    0x7fcd500eU,
-    0x1791f62fU,
-    0x764dd68dU,
-    0x43efb04dU,
-    0xccaa4d54U,
-    0xe49604dfU,
-    0x9ed1b5e3U,
-    0x4c6a881bU,
-    0xc12c1fb8U,
-    0x4665517fU,
-    0x9d5eea04U,
-    0x018c355dU,
-    0xfa877473U,
-    0xfb0b412eU,
-    0xb3671d5aU,
-    0x92dbd252U,
-    0xe9105633U,
-    0x6dd64713U,
-    0x9ad7618cU,
-    0x37a10c7aU,
-    0x59f8148eU,
-    0xeb133c89U,
-    0xcea927eeU,
-    0xb761c935U,
-    0xe11ce5edU,
-    0x7a47b13cU,
-    0x9cd2df59U,
-    0x55f2733fU,
-    0x1814ce79U,
-    0x73c737bfU,
-    0x53f7cdeaU,
-    0x5ffdaa5bU,
-    0xdf3d6f14U,
-    0x7844db86U,
-    0xcaaff381U,
-    0xb968c43eU,
-    0x3824342cU,
-    0xc2a3405fU,
-    0x161dc372U,
-    0xbce2250cU,
-    0x283c498bU,
-    0xff0d9541U,
-    0x39a80171U,
-    0x080cb3deU,
-    0xd8b4e49cU,
-    0x6456c190U,
-    0x7bcb8461U,
-    0xd532b670U,
-    0x486c5c74U,
-    0xd0b85742U,
+static const uint32_t Td0[256] = {
+    0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
+    0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
+    0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U,
+    0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU,
+    0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U,
+    0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U,
+    0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU,
+    0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U,
+    0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU,
+    0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U,
+    0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U,
+    0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U,
+    0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U,
+    0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU,
+    0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U,
+    0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU,
+    0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U,
+    0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU,
+    0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U,
+    0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U,
+    0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U,
+    0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU,
+    0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U,
+    0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU,
+    0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U,
+    0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU,
+    0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U,
+    0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU,
+    0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU,
+    0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U,
+    0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU,
+    0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U,
+    0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU,
+    0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U,
+    0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U,
+    0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U,
+    0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU,
+    0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U,
+    0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U,
+    0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU,
+    0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U,
+    0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U,
+    0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U,
+    0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U,
+    0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U,
+    0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU,
+    0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U,
+    0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U,
+    0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U,
+    0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U,
+    0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U,
+    0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU,
+    0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU,
+    0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU,
+    0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU,
+    0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U,
+    0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U,
+    0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU,
+    0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU,
+    0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U,
+    0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU,
+    0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U,
+    0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U,
+    0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U
 };
-static const u32 Td1[256] = {
-    0x5051f4a7U,
-    0x537e4165U,
-    0xc31a17a4U,
-    0x963a275eU,
-    0xcb3bab6bU,
-    0xf11f9d45U,
-    0xabacfa58U,
-    0x934be303U,
-    0x552030faU,
-    0xf6ad766dU,
-    0x9188cc76U,
-    0x25f5024cU,
-    0xfc4fe5d7U,
-    0xd7c52acbU,
-    0x80263544U,
-    0x8fb562a3U,
-    0x49deb15aU,
-    0x6725ba1bU,
-    0x9845ea0eU,
-    0xe15dfec0U,
-    0x02c32f75U,
-    0x12814cf0U,
-    0xa38d4697U,
-    0xc66bd3f9U,
-    0xe7038f5fU,
-    0x9515929cU,
-    0xebbf6d7aU,
-    0xda955259U,
-    0x2dd4be83U,
-    0xd3587421U,
-    0x2949e069U,
-    0x448ec9c8U,
-    0x6a75c289U,
-    0x78f48e79U,
-    0x6b99583eU,
-    0xdd27b971U,
-    0xb6bee14fU,
-    0x17f088adU,
-    0x66c920acU,
-    0xb47dce3aU,
-    0x1863df4aU,
-    0x82e51a31U,
-    0x60975133U,
-    0x4562537fU,
-    0xe0b16477U,
-    0x84bb6baeU,
-    0x1cfe81a0U,
-    0x94f9082bU,
-    0x58704868U,
-    0x198f45fdU,
-    0x8794de6cU,
-    0xb7527bf8U,
-    0x23ab73d3U,
-    0xe2724b02U,
-    0x57e31f8fU,
-    0x2a6655abU,
-    0x07b2eb28U,
-    0x032fb5c2U,
-    0x9a86c57bU,
-    0xa5d33708U,
-    0xf2302887U,
-    0xb223bfa5U,
-    0xba02036aU,
-    0x5ced1682U,
-    0x2b8acf1cU,
-    0x92a779b4U,
-    0xf0f307f2U,
-    0xa14e69e2U,
-    0xcd65daf4U,
-    0xd50605beU,
-    0x1fd13462U,
-    0x8ac4a6feU,
-    0x9d342e53U,
-    0xa0a2f355U,
-    0x32058ae1U,
-    0x75a4f6ebU,
-    0x390b83ecU,
-    0xaa4060efU,
-    0x065e719fU,
-    0x51bd6e10U,
-    0xf93e218aU,
-    0x3d96dd06U,
-    0xaedd3e05U,
-    0x464de6bdU,
-    0xb591548dU,
-    0x0571c45dU,
-    0x6f0406d4U,
-    0xff605015U,
-    0x241998fbU,
-    0x97d6bde9U,
-    0xcc894043U,
-    0x7767d99eU,
-    0xbdb0e842U,
-    0x8807898bU,
-    0x38e7195bU,
-    0xdb79c8eeU,
-    0x47a17c0aU,
-    0xe97c420fU,
-    0xc9f8841eU,
-    0x00000000U,
-    0x83098086U,
-    0x48322bedU,
-    0xac1e1170U,
-    0x4e6c5a72U,
-    0xfbfd0effU,
-    0x560f8538U,
-    0x1e3daed5U,
-    0x27362d39U,
-    0x640a0fd9U,
-    0x21685ca6U,
-    0xd19b5b54U,
-    0x3a24362eU,
-    0xb10c0a67U,
-    0x0f9357e7U,
-    0xd2b4ee96U,
-    0x9e1b9b91U,
-    0x4f80c0c5U,
-    0xa261dc20U,
-    0x695a774bU,
-    0x161c121aU,
-    0x0ae293baU,
-    0xe5c0a02aU,
-    0x433c22e0U,
-    0x1d121b17U,
-    0x0b0e090dU,
-    0xadf28bc7U,
-    0xb92db6a8U,
-    0xc8141ea9U,
-    0x8557f119U,
-    0x4caf7507U,
-    0xbbee99ddU,
-    0xfda37f60U,
-    0x9ff70126U,
-    0xbc5c72f5U,
-    0xc544663bU,
-    0x345bfb7eU,
-    0x768b4329U,
-    0xdccb23c6U,
-    0x68b6edfcU,
-    0x63b8e4f1U,
-    0xcad731dcU,
-    0x10426385U,
-    0x40139722U,
-    0x2084c611U,
-    0x7d854a24U,
-    0xf8d2bb3dU,
-    0x11aef932U,
-    0x6dc729a1U,
-    0x4b1d9e2fU,
-    0xf3dcb230U,
-    0xec0d8652U,
-    0xd077c1e3U,
-    0x6c2bb316U,
-    0x99a970b9U,
-    0xfa119448U,
-    0x2247e964U,
-    0xc4a8fc8cU,
-    0x1aa0f03fU,
-    0xd8567d2cU,
-    0xef223390U,
-    0xc787494eU,
-    0xc1d938d1U,
-    0xfe8ccaa2U,
-    0x3698d40bU,
-    0xcfa6f581U,
-    0x28a57adeU,
-    0x26dab78eU,
-    0xa43fadbfU,
-    0xe42c3a9dU,
-    0x0d507892U,
-    0x9b6a5fccU,
-    0x62547e46U,
-    0xc2f68d13U,
-    0xe890d8b8U,
-    0x5e2e39f7U,
-    0xf582c3afU,
-    0xbe9f5d80U,
-    0x7c69d093U,
-    0xa96fd52dU,
-    0xb3cf2512U,
-    0x3bc8ac99U,
-    0xa710187dU,
-    0x6ee89c63U,
-    0x7bdb3bbbU,
-    0x09cd2678U,
-    0xf46e5918U,
-    0x01ec9ab7U,
-    0xa8834f9aU,
-    0x65e6956eU,
-    0x7eaaffe6U,
-    0x0821bccfU,
-    0xe6ef15e8U,
-    0xd9bae79bU,
-    0xce4a6f36U,
-    0xd4ea9f09U,
-    0xd629b07cU,
-    0xaf31a4b2U,
-    0x312a3f23U,
-    0x30c6a594U,
-    0xc035a266U,
-    0x37744ebcU,
-    0xa6fc82caU,
-    0xb0e090d0U,
-    0x1533a7d8U,
-    0x4af10498U,
-    0xf741ecdaU,
-    0x0e7fcd50U,
-    0x2f1791f6U,
-    0x8d764dd6U,
-    0x4d43efb0U,
-    0x54ccaa4dU,
-    0xdfe49604U,
-    0xe39ed1b5U,
-    0x1b4c6a88U,
-    0xb8c12c1fU,
-    0x7f466551U,
-    0x049d5eeaU,
-    0x5d018c35U,
-    0x73fa8774U,
-    0x2efb0b41U,
-    0x5ab3671dU,
-    0x5292dbd2U,
-    0x33e91056U,
-    0x136dd647U,
-    0x8c9ad761U,
-    0x7a37a10cU,
-    0x8e59f814U,
-    0x89eb133cU,
-    0xeecea927U,
-    0x35b761c9U,
-    0xede11ce5U,
-    0x3c7a47b1U,
-    0x599cd2dfU,
-    0x3f55f273U,
-    0x791814ceU,
-    0xbf73c737U,
-    0xea53f7cdU,
-    0x5b5ffdaaU,
-    0x14df3d6fU,
-    0x867844dbU,
-    0x81caaff3U,
-    0x3eb968c4U,
-    0x2c382434U,
-    0x5fc2a340U,
-    0x72161dc3U,
-    0x0cbce225U,
-    0x8b283c49U,
-    0x41ff0d95U,
-    0x7139a801U,
-    0xde080cb3U,
-    0x9cd8b4e4U,
-    0x906456c1U,
-    0x617bcb84U,
-    0x70d532b6U,
-    0x74486c5cU,
-    0x42d0b857U,
+static const uint32_t Td1[256] = {
+    0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU,
+    0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U,
+    0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU,
+    0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U,
+    0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U,
+    0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U,
+    0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U,
+    0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U,
+    0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U,
+    0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU,
+    0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU,
+    0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU,
+    0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U,
+    0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU,
+    0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U,
+    0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U,
+    0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U,
+    0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU,
+    0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU,
+    0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U,
+    0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU,
+    0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U,
+    0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU,
+    0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU,
+    0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U,
+    0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U,
+    0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U,
+    0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU,
+    0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U,
+    0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU,
+    0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U,
+    0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U,
+    0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U,
+    0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU,
+    0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U,
+    0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U,
+    0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U,
+    0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U,
+    0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U,
+    0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U,
+    0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU,
+    0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU,
+    0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U,
+    0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU,
+    0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U,
+    0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU,
+    0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU,
+    0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U,
+    0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU,
+    0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U,
+    0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U,
+    0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U,
+    0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U,
+    0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U,
+    0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U,
+    0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U,
+    0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU,
+    0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U,
+    0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U,
+    0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU,
+    0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U,
+    0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U,
+    0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U,
+    0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U
 };
-static const u32 Td2[256] = {
-    0xa75051f4U,
-    0x65537e41U,
-    0xa4c31a17U,
-    0x5e963a27U,
-    0x6bcb3babU,
-    0x45f11f9dU,
-    0x58abacfaU,
-    0x03934be3U,
-    0xfa552030U,
-    0x6df6ad76U,
-    0x769188ccU,
-    0x4c25f502U,
-    0xd7fc4fe5U,
-    0xcbd7c52aU,
-    0x44802635U,
-    0xa38fb562U,
-    0x5a49deb1U,
-    0x1b6725baU,
-    0x0e9845eaU,
-    0xc0e15dfeU,
-    0x7502c32fU,
-    0xf012814cU,
-    0x97a38d46U,
-    0xf9c66bd3U,
-    0x5fe7038fU,
-    0x9c951592U,
-    0x7aebbf6dU,
-    0x59da9552U,
-    0x832dd4beU,
-    0x21d35874U,
-    0x692949e0U,
-    0xc8448ec9U,
-    0x896a75c2U,
-    0x7978f48eU,
-    0x3e6b9958U,
-    0x71dd27b9U,
-    0x4fb6bee1U,
-    0xad17f088U,
-    0xac66c920U,
-    0x3ab47dceU,
-    0x4a1863dfU,
-    0x3182e51aU,
-    0x33609751U,
-    0x7f456253U,
-    0x77e0b164U,
-    0xae84bb6bU,
-    0xa01cfe81U,
-    0x2b94f908U,
-    0x68587048U,
-    0xfd198f45U,
-    0x6c8794deU,
-    0xf8b7527bU,
-    0xd323ab73U,
-    0x02e2724bU,
-    0x8f57e31fU,
-    0xab2a6655U,
-    0x2807b2ebU,
-    0xc2032fb5U,
-    0x7b9a86c5U,
-    0x08a5d337U,
-    0x87f23028U,
-    0xa5b223bfU,
-    0x6aba0203U,
-    0x825ced16U,
-    0x1c2b8acfU,
-    0xb492a779U,
-    0xf2f0f307U,
-    0xe2a14e69U,
-    0xf4cd65daU,
-    0xbed50605U,
-    0x621fd134U,
-    0xfe8ac4a6U,
-    0x539d342eU,
-    0x55a0a2f3U,
-    0xe132058aU,
-    0xeb75a4f6U,
-    0xec390b83U,
-    0xefaa4060U,
-    0x9f065e71U,
-    0x1051bd6eU,
-    0x8af93e21U,
-    0x063d96ddU,
-    0x05aedd3eU,
-    0xbd464de6U,
-    0x8db59154U,
-    0x5d0571c4U,
-    0xd46f0406U,
-    0x15ff6050U,
-    0xfb241998U,
-    0xe997d6bdU,
-    0x43cc8940U,
-    0x9e7767d9U,
-    0x42bdb0e8U,
-    0x8b880789U,
-    0x5b38e719U,
-    0xeedb79c8U,
-    0x0a47a17cU,
-    0x0fe97c42U,
-    0x1ec9f884U,
-    0x00000000U,
-    0x86830980U,
-    0xed48322bU,
-    0x70ac1e11U,
-    0x724e6c5aU,
-    0xfffbfd0eU,
-    0x38560f85U,
-    0xd51e3daeU,
-    0x3927362dU,
-    0xd9640a0fU,
-    0xa621685cU,
-    0x54d19b5bU,
-    0x2e3a2436U,
-    0x67b10c0aU,
-    0xe70f9357U,
-    0x96d2b4eeU,
-    0x919e1b9bU,
-    0xc54f80c0U,
-    0x20a261dcU,
-    0x4b695a77U,
-    0x1a161c12U,
-    0xba0ae293U,
-    0x2ae5c0a0U,
-    0xe0433c22U,
-    0x171d121bU,
-    0x0d0b0e09U,
-    0xc7adf28bU,
-    0xa8b92db6U,
-    0xa9c8141eU,
-    0x198557f1U,
-    0x074caf75U,
-    0xddbbee99U,
-    0x60fda37fU,
-    0x269ff701U,
-    0xf5bc5c72U,
-    0x3bc54466U,
-    0x7e345bfbU,
-    0x29768b43U,
-    0xc6dccb23U,
-    0xfc68b6edU,
-    0xf163b8e4U,
-    0xdccad731U,
-    0x85104263U,
-    0x22401397U,
-    0x112084c6U,
-    0x247d854aU,
-    0x3df8d2bbU,
-    0x3211aef9U,
-    0xa16dc729U,
-    0x2f4b1d9eU,
-    0x30f3dcb2U,
-    0x52ec0d86U,
-    0xe3d077c1U,
-    0x166c2bb3U,
-    0xb999a970U,
-    0x48fa1194U,
-    0x642247e9U,
-    0x8cc4a8fcU,
-    0x3f1aa0f0U,
-    0x2cd8567dU,
-    0x90ef2233U,
-    0x4ec78749U,
-    0xd1c1d938U,
-    0xa2fe8ccaU,
-    0x0b3698d4U,
-    0x81cfa6f5U,
-    0xde28a57aU,
-    0x8e26dab7U,
-    0xbfa43fadU,
-    0x9de42c3aU,
-    0x920d5078U,
-    0xcc9b6a5fU,
-    0x4662547eU,
-    0x13c2f68dU,
-    0xb8e890d8U,
-    0xf75e2e39U,
-    0xaff582c3U,
-    0x80be9f5dU,
-    0x937c69d0U,
-    0x2da96fd5U,
-    0x12b3cf25U,
-    0x993bc8acU,
-    0x7da71018U,
-    0x636ee89cU,
-    0xbb7bdb3bU,
-    0x7809cd26U,
-    0x18f46e59U,
-    0xb701ec9aU,
-    0x9aa8834fU,
-    0x6e65e695U,
-    0xe67eaaffU,
-    0xcf0821bcU,
-    0xe8e6ef15U,
-    0x9bd9bae7U,
-    0x36ce4a6fU,
-    0x09d4ea9fU,
-    0x7cd629b0U,
-    0xb2af31a4U,
-    0x23312a3fU,
-    0x9430c6a5U,
-    0x66c035a2U,
-    0xbc37744eU,
-    0xcaa6fc82U,
-    0xd0b0e090U,
-    0xd81533a7U,
-    0x984af104U,
-    0xdaf741ecU,
-    0x500e7fcdU,
-    0xf62f1791U,
-    0xd68d764dU,
-    0xb04d43efU,
-    0x4d54ccaaU,
-    0x04dfe496U,
-    0xb5e39ed1U,
-    0x881b4c6aU,
-    0x1fb8c12cU,
-    0x517f4665U,
-    0xea049d5eU,
-    0x355d018cU,
-    0x7473fa87U,
-    0x412efb0bU,
-    0x1d5ab367U,
-    0xd25292dbU,
-    0x5633e910U,
-    0x47136dd6U,
-    0x618c9ad7U,
-    0x0c7a37a1U,
-    0x148e59f8U,
-    0x3c89eb13U,
-    0x27eecea9U,
-    0xc935b761U,
-    0xe5ede11cU,
-    0xb13c7a47U,
-    0xdf599cd2U,
-    0x733f55f2U,
-    0xce791814U,
-    0x37bf73c7U,
-    0xcdea53f7U,
-    0xaa5b5ffdU,
-    0x6f14df3dU,
-    0xdb867844U,
-    0xf381caafU,
-    0xc43eb968U,
-    0x342c3824U,
-    0x405fc2a3U,
-    0xc372161dU,
-    0x250cbce2U,
-    0x498b283cU,
-    0x9541ff0dU,
-    0x017139a8U,
-    0xb3de080cU,
-    0xe49cd8b4U,
-    0xc1906456U,
-    0x84617bcbU,
-    0xb670d532U,
-    0x5c74486cU,
-    0x5742d0b8U,
+static const uint32_t Td2[256] = {
+    0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U,
+    0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U,
+    0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U,
+    0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U,
+    0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU,
+    0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U,
+    0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U,
+    0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U,
+    0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U,
+    0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU,
+    0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U,
+    0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U,
+    0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU,
+    0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U,
+    0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U,
+    0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U,
+    0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U,
+    0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U,
+    0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U,
+    0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU,
+    0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U,
+    0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U,
+    0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U,
+    0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U,
+    0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U,
+    0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU,
+    0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU,
+    0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U,
+    0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU,
+    0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U,
+    0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU,
+    0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU,
+    0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU,
+    0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU,
+    0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U,
+    0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U,
+    0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U,
+    0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U,
+    0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U,
+    0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U,
+    0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U,
+    0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU,
+    0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU,
+    0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U,
+    0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U,
+    0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU,
+    0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU,
+    0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U,
+    0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U,
+    0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U,
+    0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U,
+    0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U,
+    0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U,
+    0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U,
+    0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU,
+    0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U,
+    0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U,
+    0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U,
+    0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U,
+    0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U,
+    0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U,
+    0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU,
+    0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U,
+    0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U
 };
-static const u32 Td3[256] = {
-    0xf4a75051U,
-    0x4165537eU,
-    0x17a4c31aU,
-    0x275e963aU,
-    0xab6bcb3bU,
-    0x9d45f11fU,
-    0xfa58abacU,
-    0xe303934bU,
-    0x30fa5520U,
-    0x766df6adU,
-    0xcc769188U,
-    0x024c25f5U,
-    0xe5d7fc4fU,
-    0x2acbd7c5U,
-    0x35448026U,
-    0x62a38fb5U,
-    0xb15a49deU,
-    0xba1b6725U,
-    0xea0e9845U,
-    0xfec0e15dU,
-    0x2f7502c3U,
-    0x4cf01281U,
-    0x4697a38dU,
-    0xd3f9c66bU,
-    0x8f5fe703U,
-    0x929c9515U,
-    0x6d7aebbfU,
-    0x5259da95U,
-    0xbe832dd4U,
-    0x7421d358U,
-    0xe0692949U,
-    0xc9c8448eU,
-    0xc2896a75U,
-    0x8e7978f4U,
-    0x583e6b99U,
-    0xb971dd27U,
-    0xe14fb6beU,
-    0x88ad17f0U,
-    0x20ac66c9U,
-    0xce3ab47dU,
-    0xdf4a1863U,
-    0x1a3182e5U,
-    0x51336097U,
-    0x537f4562U,
-    0x6477e0b1U,
-    0x6bae84bbU,
-    0x81a01cfeU,
-    0x082b94f9U,
-    0x48685870U,
-    0x45fd198fU,
-    0xde6c8794U,
-    0x7bf8b752U,
-    0x73d323abU,
-    0x4b02e272U,
-    0x1f8f57e3U,
-    0x55ab2a66U,
-    0xeb2807b2U,
-    0xb5c2032fU,
-    0xc57b9a86U,
-    0x3708a5d3U,
-    0x2887f230U,
-    0xbfa5b223U,
-    0x036aba02U,
-    0x16825cedU,
-    0xcf1c2b8aU,
-    0x79b492a7U,
-    0x07f2f0f3U,
-    0x69e2a14eU,
-    0xdaf4cd65U,
-    0x05bed506U,
-    0x34621fd1U,
-    0xa6fe8ac4U,
-    0x2e539d34U,
-    0xf355a0a2U,
-    0x8ae13205U,
-    0xf6eb75a4U,
-    0x83ec390bU,
-    0x60efaa40U,
-    0x719f065eU,
-    0x6e1051bdU,
-    0x218af93eU,
-    0xdd063d96U,
-    0x3e05aeddU,
-    0xe6bd464dU,
-    0x548db591U,
-    0xc45d0571U,
-    0x06d46f04U,
-    0x5015ff60U,
-    0x98fb2419U,
-    0xbde997d6U,
-    0x4043cc89U,
-    0xd99e7767U,
-    0xe842bdb0U,
-    0x898b8807U,
-    0x195b38e7U,
-    0xc8eedb79U,
-    0x7c0a47a1U,
-    0x420fe97cU,
-    0x841ec9f8U,
-    0x00000000U,
-    0x80868309U,
-    0x2bed4832U,
-    0x1170ac1eU,
-    0x5a724e6cU,
-    0x0efffbfdU,
-    0x8538560fU,
-    0xaed51e3dU,
-    0x2d392736U,
-    0x0fd9640aU,
-    0x5ca62168U,
-    0x5b54d19bU,
-    0x362e3a24U,
-    0x0a67b10cU,
-    0x57e70f93U,
-    0xee96d2b4U,
-    0x9b919e1bU,
-    0xc0c54f80U,
-    0xdc20a261U,
-    0x774b695aU,
-    0x121a161cU,
-    0x93ba0ae2U,
-    0xa02ae5c0U,
-    0x22e0433cU,
-    0x1b171d12U,
-    0x090d0b0eU,
-    0x8bc7adf2U,
-    0xb6a8b92dU,
-    0x1ea9c814U,
-    0xf1198557U,
-    0x75074cafU,
-    0x99ddbbeeU,
-    0x7f60fda3U,
-    0x01269ff7U,
-    0x72f5bc5cU,
-    0x663bc544U,
-    0xfb7e345bU,
-    0x4329768bU,
-    0x23c6dccbU,
-    0xedfc68b6U,
-    0xe4f163b8U,
-    0x31dccad7U,
-    0x63851042U,
-    0x97224013U,
-    0xc6112084U,
-    0x4a247d85U,
-    0xbb3df8d2U,
-    0xf93211aeU,
-    0x29a16dc7U,
-    0x9e2f4b1dU,
-    0xb230f3dcU,
-    0x8652ec0dU,
-    0xc1e3d077U,
-    0xb3166c2bU,
-    0x70b999a9U,
-    0x9448fa11U,
-    0xe9642247U,
-    0xfc8cc4a8U,
-    0xf03f1aa0U,
-    0x7d2cd856U,
-    0x3390ef22U,
-    0x494ec787U,
-    0x38d1c1d9U,
-    0xcaa2fe8cU,
-    0xd40b3698U,
-    0xf581cfa6U,
-    0x7ade28a5U,
-    0xb78e26daU,
-    0xadbfa43fU,
-    0x3a9de42cU,
-    0x78920d50U,
-    0x5fcc9b6aU,
-    0x7e466254U,
-    0x8d13c2f6U,
-    0xd8b8e890U,
-    0x39f75e2eU,
-    0xc3aff582U,
-    0x5d80be9fU,
-    0xd0937c69U,
-    0xd52da96fU,
-    0x2512b3cfU,
-    0xac993bc8U,
-    0x187da710U,
-    0x9c636ee8U,
-    0x3bbb7bdbU,
-    0x267809cdU,
-    0x5918f46eU,
-    0x9ab701ecU,
-    0x4f9aa883U,
-    0x956e65e6U,
-    0xffe67eaaU,
-    0xbccf0821U,
-    0x15e8e6efU,
-    0xe79bd9baU,
-    0x6f36ce4aU,
-    0x9f09d4eaU,
-    0xb07cd629U,
-    0xa4b2af31U,
-    0x3f23312aU,
-    0xa59430c6U,
-    0xa266c035U,
-    0x4ebc3774U,
-    0x82caa6fcU,
-    0x90d0b0e0U,
-    0xa7d81533U,
-    0x04984af1U,
-    0xecdaf741U,
-    0xcd500e7fU,
-    0x91f62f17U,
-    0x4dd68d76U,
-    0xefb04d43U,
-    0xaa4d54ccU,
-    0x9604dfe4U,
-    0xd1b5e39eU,
-    0x6a881b4cU,
-    0x2c1fb8c1U,
-    0x65517f46U,
-    0x5eea049dU,
-    0x8c355d01U,
-    0x877473faU,
-    0x0b412efbU,
-    0x671d5ab3U,
-    0xdbd25292U,
-    0x105633e9U,
-    0xd647136dU,
-    0xd7618c9aU,
-    0xa10c7a37U,
-    0xf8148e59U,
-    0x133c89ebU,
-    0xa927eeceU,
-    0x61c935b7U,
-    0x1ce5ede1U,
-    0x47b13c7aU,
-    0xd2df599cU,
-    0xf2733f55U,
-    0x14ce7918U,
-    0xc737bf73U,
-    0xf7cdea53U,
-    0xfdaa5b5fU,
-    0x3d6f14dfU,
-    0x44db8678U,
-    0xaff381caU,
-    0x68c43eb9U,
-    0x24342c38U,
-    0xa3405fc2U,
-    0x1dc37216U,
-    0xe2250cbcU,
-    0x3c498b28U,
-    0x0d9541ffU,
-    0xa8017139U,
-    0x0cb3de08U,
-    0xb4e49cd8U,
-    0x56c19064U,
-    0xcb84617bU,
-    0x32b670d5U,
-    0x6c5c7448U,
-    0xb85742d0U,
+static const uint32_t Td3[256] = {
+    0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU,
+    0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU,
+    0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U,
+    0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U,
+    0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU,
+    0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU,
+    0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U,
+    0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU,
+    0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U,
+    0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU,
+    0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U,
+    0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U,
+    0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U,
+    0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U,
+    0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U,
+    0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU,
+    0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU,
+    0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U,
+    0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U,
+    0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU,
+    0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU,
+    0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U,
+    0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U,
+    0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U,
+    0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U,
+    0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU,
+    0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U,
+    0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U,
+    0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU,
+    0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU,
+    0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U,
+    0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U,
+    0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U,
+    0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU,
+    0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U,
+    0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U,
+    0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U,
+    0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U,
+    0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U,
+    0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U,
+    0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U,
+    0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU,
+    0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U,
+    0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U,
+    0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU,
+    0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU,
+    0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U,
+    0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU,
+    0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U,
+    0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U,
+    0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U,
+    0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U,
+    0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U,
+    0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U,
+    0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU,
+    0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU,
+    0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU,
+    0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU,
+    0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U,
+    0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U,
+    0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U,
+    0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU,
+    0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
+    0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U
 };
-static const u8 Td4[256] = {
-    0x52U,
-    0x09U,
-    0x6aU,
-    0xd5U,
-    0x30U,
-    0x36U,
-    0xa5U,
-    0x38U,
-    0xbfU,
-    0x40U,
-    0xa3U,
-    0x9eU,
-    0x81U,
-    0xf3U,
-    0xd7U,
-    0xfbU,
-    0x7cU,
-    0xe3U,
-    0x39U,
-    0x82U,
-    0x9bU,
-    0x2fU,
-    0xffU,
-    0x87U,
-    0x34U,
-    0x8eU,
-    0x43U,
-    0x44U,
-    0xc4U,
-    0xdeU,
-    0xe9U,
-    0xcbU,
-    0x54U,
-    0x7bU,
-    0x94U,
-    0x32U,
-    0xa6U,
-    0xc2U,
-    0x23U,
-    0x3dU,
-    0xeeU,
-    0x4cU,
-    0x95U,
-    0x0bU,
-    0x42U,
-    0xfaU,
-    0xc3U,
-    0x4eU,
-    0x08U,
-    0x2eU,
-    0xa1U,
-    0x66U,
-    0x28U,
-    0xd9U,
-    0x24U,
-    0xb2U,
-    0x76U,
-    0x5bU,
-    0xa2U,
-    0x49U,
-    0x6dU,
-    0x8bU,
-    0xd1U,
-    0x25U,
-    0x72U,
-    0xf8U,
-    0xf6U,
-    0x64U,
-    0x86U,
-    0x68U,
-    0x98U,
-    0x16U,
-    0xd4U,
-    0xa4U,
-    0x5cU,
-    0xccU,
-    0x5dU,
-    0x65U,
-    0xb6U,
-    0x92U,
-    0x6cU,
-    0x70U,
-    0x48U,
-    0x50U,
-    0xfdU,
-    0xedU,
-    0xb9U,
-    0xdaU,
-    0x5eU,
-    0x15U,
-    0x46U,
-    0x57U,
-    0xa7U,
-    0x8dU,
-    0x9dU,
-    0x84U,
-    0x90U,
-    0xd8U,
-    0xabU,
-    0x00U,
-    0x8cU,
-    0xbcU,
-    0xd3U,
-    0x0aU,
-    0xf7U,
-    0xe4U,
-    0x58U,
-    0x05U,
-    0xb8U,
-    0xb3U,
-    0x45U,
-    0x06U,
-    0xd0U,
-    0x2cU,
-    0x1eU,
-    0x8fU,
-    0xcaU,
-    0x3fU,
-    0x0fU,
-    0x02U,
-    0xc1U,
-    0xafU,
-    0xbdU,
-    0x03U,
-    0x01U,
-    0x13U,
-    0x8aU,
-    0x6bU,
-    0x3aU,
-    0x91U,
-    0x11U,
-    0x41U,
-    0x4fU,
-    0x67U,
-    0xdcU,
-    0xeaU,
-    0x97U,
-    0xf2U,
-    0xcfU,
-    0xceU,
-    0xf0U,
-    0xb4U,
-    0xe6U,
-    0x73U,
-    0x96U,
-    0xacU,
-    0x74U,
-    0x22U,
-    0xe7U,
-    0xadU,
-    0x35U,
-    0x85U,
-    0xe2U,
-    0xf9U,
-    0x37U,
-    0xe8U,
-    0x1cU,
-    0x75U,
-    0xdfU,
-    0x6eU,
-    0x47U,
-    0xf1U,
-    0x1aU,
-    0x71U,
-    0x1dU,
-    0x29U,
-    0xc5U,
-    0x89U,
-    0x6fU,
-    0xb7U,
-    0x62U,
-    0x0eU,
-    0xaaU,
-    0x18U,
-    0xbeU,
-    0x1bU,
-    0xfcU,
-    0x56U,
-    0x3eU,
-    0x4bU,
-    0xc6U,
-    0xd2U,
-    0x79U,
-    0x20U,
-    0x9aU,
-    0xdbU,
-    0xc0U,
-    0xfeU,
-    0x78U,
-    0xcdU,
-    0x5aU,
-    0xf4U,
-    0x1fU,
-    0xddU,
-    0xa8U,
-    0x33U,
-    0x88U,
-    0x07U,
-    0xc7U,
-    0x31U,
-    0xb1U,
-    0x12U,
-    0x10U,
-    0x59U,
-    0x27U,
-    0x80U,
-    0xecU,
-    0x5fU,
-    0x60U,
-    0x51U,
-    0x7fU,
-    0xa9U,
-    0x19U,
-    0xb5U,
-    0x4aU,
-    0x0dU,
-    0x2dU,
-    0xe5U,
-    0x7aU,
-    0x9fU,
-    0x93U,
-    0xc9U,
-    0x9cU,
-    0xefU,
-    0xa0U,
-    0xe0U,
-    0x3bU,
-    0x4dU,
-    0xaeU,
-    0x2aU,
-    0xf5U,
-    0xb0U,
-    0xc8U,
-    0xebU,
-    0xbbU,
-    0x3cU,
-    0x83U,
-    0x53U,
-    0x99U,
-    0x61U,
-    0x17U,
-    0x2bU,
-    0x04U,
-    0x7eU,
-    0xbaU,
-    0x77U,
-    0xd6U,
-    0x26U,
-    0xe1U,
-    0x69U,
-    0x14U,
-    0x63U,
-    0x55U,
-    0x21U,
-    0x0cU,
-    0x7dU,
+static const uint8_t Td4[256] = {
+    0x52U, 0x09U, 0x6aU, 0xd5U, 0x30U, 0x36U, 0xa5U, 0x38U,
+    0xbfU, 0x40U, 0xa3U, 0x9eU, 0x81U, 0xf3U, 0xd7U, 0xfbU,
+    0x7cU, 0xe3U, 0x39U, 0x82U, 0x9bU, 0x2fU, 0xffU, 0x87U,
+    0x34U, 0x8eU, 0x43U, 0x44U, 0xc4U, 0xdeU, 0xe9U, 0xcbU,
+    0x54U, 0x7bU, 0x94U, 0x32U, 0xa6U, 0xc2U, 0x23U, 0x3dU,
+    0xeeU, 0x4cU, 0x95U, 0x0bU, 0x42U, 0xfaU, 0xc3U, 0x4eU,
+    0x08U, 0x2eU, 0xa1U, 0x66U, 0x28U, 0xd9U, 0x24U, 0xb2U,
+    0x76U, 0x5bU, 0xa2U, 0x49U, 0x6dU, 0x8bU, 0xd1U, 0x25U,
+    0x72U, 0xf8U, 0xf6U, 0x64U, 0x86U, 0x68U, 0x98U, 0x16U,
+    0xd4U, 0xa4U, 0x5cU, 0xccU, 0x5dU, 0x65U, 0xb6U, 0x92U,
+    0x6cU, 0x70U, 0x48U, 0x50U, 0xfdU, 0xedU, 0xb9U, 0xdaU,
+    0x5eU, 0x15U, 0x46U, 0x57U, 0xa7U, 0x8dU, 0x9dU, 0x84U,
+    0x90U, 0xd8U, 0xabU, 0x00U, 0x8cU, 0xbcU, 0xd3U, 0x0aU,
+    0xf7U, 0xe4U, 0x58U, 0x05U, 0xb8U, 0xb3U, 0x45U, 0x06U,
+    0xd0U, 0x2cU, 0x1eU, 0x8fU, 0xcaU, 0x3fU, 0x0fU, 0x02U,
+    0xc1U, 0xafU, 0xbdU, 0x03U, 0x01U, 0x13U, 0x8aU, 0x6bU,
+    0x3aU, 0x91U, 0x11U, 0x41U, 0x4fU, 0x67U, 0xdcU, 0xeaU,
+    0x97U, 0xf2U, 0xcfU, 0xceU, 0xf0U, 0xb4U, 0xe6U, 0x73U,
+    0x96U, 0xacU, 0x74U, 0x22U, 0xe7U, 0xadU, 0x35U, 0x85U,
+    0xe2U, 0xf9U, 0x37U, 0xe8U, 0x1cU, 0x75U, 0xdfU, 0x6eU,
+    0x47U, 0xf1U, 0x1aU, 0x71U, 0x1dU, 0x29U, 0xc5U, 0x89U,
+    0x6fU, 0xb7U, 0x62U, 0x0eU, 0xaaU, 0x18U, 0xbeU, 0x1bU,
+    0xfcU, 0x56U, 0x3eU, 0x4bU, 0xc6U, 0xd2U, 0x79U, 0x20U,
+    0x9aU, 0xdbU, 0xc0U, 0xfeU, 0x78U, 0xcdU, 0x5aU, 0xf4U,
+    0x1fU, 0xddU, 0xa8U, 0x33U, 0x88U, 0x07U, 0xc7U, 0x31U,
+    0xb1U, 0x12U, 0x10U, 0x59U, 0x27U, 0x80U, 0xecU, 0x5fU,
+    0x60U, 0x51U, 0x7fU, 0xa9U, 0x19U, 0xb5U, 0x4aU, 0x0dU,
+    0x2dU, 0xe5U, 0x7aU, 0x9fU, 0x93U, 0xc9U, 0x9cU, 0xefU,
+    0xa0U, 0xe0U, 0x3bU, 0x4dU, 0xaeU, 0x2aU, 0xf5U, 0xb0U,
+    0xc8U, 0xebU, 0xbbU, 0x3cU, 0x83U, 0x53U, 0x99U, 0x61U,
+    0x17U, 0x2bU, 0x04U, 0x7eU, 0xbaU, 0x77U, 0xd6U, 0x26U,
+    0xe1U, 0x69U, 0x14U, 0x63U, 0x55U, 0x21U, 0x0cU, 0x7dU
 };
-static const u32 rcon[] = {
-    0x01000000,
-    0x02000000,
-    0x04000000,
-    0x08000000,
-    0x10000000,
-    0x20000000,
-    0x40000000,
-    0x80000000,
-    0x1B000000,
-    0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
+static const uint32_t rcon[] = {
+    0x01000000, 0x02000000, 0x04000000, 0x08000000,
+    0x10000000, 0x20000000, 0x40000000, 0x80000000,
+    0x1B000000, 0x36000000
+    /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
 };

 /**
  * Expand the cipher key into the encryption key schedule.
  */
-int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
+int AES_set_encrypt_key(const unsigned char *userKey, int bits,
     AES_KEY *key)
 {

-    u32 *rk;
+    uint32_t *rk;
     int i = 0;
-    u32 temp;
+    uint32_t temp;

     if (!userKey || !key)
         return -1;
@@ -3125,13 +1359,13 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
 /**
  * Expand the cipher key into the decryption key schedule.
  */
-int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
+int AES_set_decrypt_key(const unsigned char *userKey, int bits,
     AES_KEY *key)
 {

-    u32 *rk;
+    uint32_t *rk;
     int i, j, status;
-    u32 temp;
+    uint32_t temp;

     /* first, start with an encryption schedule */
     status = AES_set_encrypt_key(userKey, bits, key);
@@ -3174,8 +1408,8 @@ void AES_encrypt(const unsigned char *in, unsigned char *out,
     const AES_KEY *key)
 {

-    const u32 *rk;
-    u32 s0, s1, s2, s3, t0, t1, t2, t3;
+    const uint32_t *rk;
+    uint32_t s0, s1, s2, s3, t0, t1, t2, t3;
 #ifndef FULL_UNROLL
     int r;
 #endif /* ?FULL_UNROLL */
@@ -3306,8 +1540,8 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
     const AES_KEY *key)
 {

-    const u32 *rk;
-    u32 s0, s1, s2, s3, t0, t1, t2, t3;
+    const uint32_t *rk;
+    uint32_t s0, s1, s2, s3, t0, t1, t2, t3;
 #ifndef FULL_UNROLL
     int r;
 #endif /* ?FULL_UNROLL */
@@ -3420,19 +1654,19 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
      * apply last round and
      * map cipher state to byte array block:
      */
-    s0 = ((u32)Td4[(t0 >> 24)] << 24) ^ ((u32)Td4[(t3 >> 16) & 0xff] << 16) ^ ((u32)Td4[(t2 >> 8) & 0xff] << 8) ^ ((u32)Td4[(t1) & 0xff]) ^ rk[0];
+    s0 = ((uint32_t)Td4[(t0 >> 24)] << 24) ^ ((uint32_t)Td4[(t3 >> 16) & 0xff] << 16) ^ ((uint32_t)Td4[(t2 >> 8) & 0xff] << 8) ^ ((uint32_t)Td4[(t1) & 0xff]) ^ rk[0];
     PUTU32(out, s0);
-    s1 = ((u32)Td4[(t1 >> 24)] << 24) ^ ((u32)Td4[(t0 >> 16) & 0xff] << 16) ^ ((u32)Td4[(t3 >> 8) & 0xff] << 8) ^ ((u32)Td4[(t2) & 0xff]) ^ rk[1];
+    s1 = ((uint32_t)Td4[(t1 >> 24)] << 24) ^ ((uint32_t)Td4[(t0 >> 16) & 0xff] << 16) ^ ((uint32_t)Td4[(t3 >> 8) & 0xff] << 8) ^ ((uint32_t)Td4[(t2) & 0xff]) ^ rk[1];
     PUTU32(out + 4, s1);
-    s2 = ((u32)Td4[(t2 >> 24)] << 24) ^ ((u32)Td4[(t1 >> 16) & 0xff] << 16) ^ ((u32)Td4[(t0 >> 8) & 0xff] << 8) ^ ((u32)Td4[(t3) & 0xff]) ^ rk[2];
+    s2 = ((uint32_t)Td4[(t2 >> 24)] << 24) ^ ((uint32_t)Td4[(t1 >> 16) & 0xff] << 16) ^ ((uint32_t)Td4[(t0 >> 8) & 0xff] << 8) ^ ((uint32_t)Td4[(t3) & 0xff]) ^ rk[2];
     PUTU32(out + 8, s2);
-    s3 = ((u32)Td4[(t3 >> 24)] << 24) ^ ((u32)Td4[(t2 >> 16) & 0xff] << 16) ^ ((u32)Td4[(t1 >> 8) & 0xff] << 8) ^ ((u32)Td4[(t0) & 0xff]) ^ rk[3];
+    s3 = ((uint32_t)Td4[(t3 >> 24)] << 24) ^ ((uint32_t)Td4[(t2 >> 16) & 0xff] << 16) ^ ((uint32_t)Td4[(t1 >> 8) & 0xff] << 8) ^ ((uint32_t)Td4[(t0) & 0xff]) ^ rk[3];
     PUTU32(out + 12, s3);
 }

 #else /* AES_ASM */

-static const u8 Te4[256] = {
+static const uint8_t Te4[256] = {
     0x63U, 0x7cU, 0x77U, 0x7bU, 0xf2U, 0x6bU, 0x6fU, 0xc5U,
     0x30U, 0x01U, 0x67U, 0x2bU, 0xfeU, 0xd7U, 0xabU, 0x76U,
     0xcaU, 0x82U, 0xc9U, 0x7dU, 0xfaU, 0x59U, 0x47U, 0xf0U,
@@ -3466,28 +1700,22 @@ static const u8 Te4[256] = {
     0x8cU, 0xa1U, 0x89U, 0x0dU, 0xbfU, 0xe6U, 0x42U, 0x68U,
     0x41U, 0x99U, 0x2dU, 0x0fU, 0xb0U, 0x54U, 0xbbU, 0x16U
 };
-static const u32 rcon[] = {
-    0x01000000,
-    0x02000000,
-    0x04000000,
-    0x08000000,
-    0x10000000,
-    0x20000000,
-    0x40000000,
-    0x80000000,
-    0x1B000000,
-    0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
+static const uint32_t rcon[] = {
+    0x01000000, 0x02000000, 0x04000000, 0x08000000,
+    0x10000000, 0x20000000, 0x40000000, 0x80000000,
+    0x1B000000, 0x36000000
+    /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
 };

 /**
  * Expand the cipher key into the encryption key schedule.
  */
-int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
+int AES_set_encrypt_key(const unsigned char *userKey, int bits,
     AES_KEY *key)
 {
-    u32 *rk;
+    uint32_t *rk;
     int i = 0;
-    u32 temp;
+    uint32_t temp;

     if (!userKey || !key)
         return -1;
@@ -3510,7 +1738,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
     if (bits == 128) {
         while (1) {
             temp = rk[3];
-            rk[4] = rk[0] ^ ((u32)Te4[(temp >> 16) & 0xff] << 24) ^ ((u32)Te4[(temp >> 8) & 0xff] << 16) ^ ((u32)Te4[(temp) & 0xff] << 8) ^ ((u32)Te4[(temp >> 24)]) ^ rcon[i];
+            rk[4] = rk[0] ^ ((uint32_t)Te4[(temp >> 16) & 0xff] << 24) ^ ((uint32_t)Te4[(temp >> 8) & 0xff] << 16) ^ ((uint32_t)Te4[(temp) & 0xff] << 8) ^ ((uint32_t)Te4[(temp >> 24)]) ^ rcon[i];
             rk[5] = rk[1] ^ rk[4];
             rk[6] = rk[2] ^ rk[5];
             rk[7] = rk[3] ^ rk[6];
@@ -3525,7 +1753,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
     if (bits == 192) {
         while (1) {
             temp = rk[5];
-            rk[6] = rk[0] ^ ((u32)Te4[(temp >> 16) & 0xff] << 24) ^ ((u32)Te4[(temp >> 8) & 0xff] << 16) ^ ((u32)Te4[(temp) & 0xff] << 8) ^ ((u32)Te4[(temp >> 24)]) ^ rcon[i];
+            rk[6] = rk[0] ^ ((uint32_t)Te4[(temp >> 16) & 0xff] << 24) ^ ((uint32_t)Te4[(temp >> 8) & 0xff] << 16) ^ ((uint32_t)Te4[(temp) & 0xff] << 8) ^ ((uint32_t)Te4[(temp >> 24)]) ^ rcon[i];
             rk[7] = rk[1] ^ rk[6];
             rk[8] = rk[2] ^ rk[7];
             rk[9] = rk[3] ^ rk[8];
@@ -3542,7 +1770,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
     if (bits == 256) {
         while (1) {
             temp = rk[7];
-            rk[8] = rk[0] ^ ((u32)Te4[(temp >> 16) & 0xff] << 24) ^ ((u32)Te4[(temp >> 8) & 0xff] << 16) ^ ((u32)Te4[(temp) & 0xff] << 8) ^ ((u32)Te4[(temp >> 24)]) ^ rcon[i];
+            rk[8] = rk[0] ^ ((uint32_t)Te4[(temp >> 16) & 0xff] << 24) ^ ((uint32_t)Te4[(temp >> 8) & 0xff] << 16) ^ ((uint32_t)Te4[(temp) & 0xff] << 8) ^ ((uint32_t)Te4[(temp >> 24)]) ^ rcon[i];
             rk[9] = rk[1] ^ rk[8];
             rk[10] = rk[2] ^ rk[9];
             rk[11] = rk[3] ^ rk[10];
@@ -3550,7 +1778,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
                 return 0;
             }
             temp = rk[11];
-            rk[12] = rk[4] ^ ((u32)Te4[(temp >> 24)] << 24) ^ ((u32)Te4[(temp >> 16) & 0xff] << 16) ^ ((u32)Te4[(temp >> 8) & 0xff] << 8) ^ ((u32)Te4[(temp) & 0xff]);
+            rk[12] = rk[4] ^ ((uint32_t)Te4[(temp >> 24)] << 24) ^ ((uint32_t)Te4[(temp >> 16) & 0xff] << 16) ^ ((uint32_t)Te4[(temp >> 8) & 0xff] << 8) ^ ((uint32_t)Te4[(temp) & 0xff]);
             rk[13] = rk[5] ^ rk[12];
             rk[14] = rk[6] ^ rk[13];
             rk[15] = rk[7] ^ rk[14];
@@ -3564,13 +1792,13 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
 /**
  * Expand the cipher key into the decryption key schedule.
  */
-int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
+int AES_set_decrypt_key(const unsigned char *userKey, int bits,
     AES_KEY *key)
 {

-    u32 *rk;
+    uint32_t *rk;
     int i, j, status;
-    u32 temp;
+    uint32_t temp;

     /* first, start with an encryption schedule */
     status = AES_set_encrypt_key(userKey, bits, key);
@@ -3598,7 +1826,7 @@ int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
     for (i = 1; i < (key->rounds); i++) {
         rk += 4;
         for (j = 0; j < 4; j++) {
-            u32 tp1, tp2, tp4, tp8, tp9, tpb, tpd, tpe, m;
+            uint32_t tp1, tp2, tp4, tp8, tp9, tpb, tpd, tpe, m;

             tp1 = rk[j];
             m = tp1 & 0x80808080;
diff --git a/deps/openssl/openssl/crypto/aes/aes_ige.c b/deps/openssl/openssl/crypto/aes/aes_ige.c
index 0308f3f2256..93f7ffd4569 100644
--- a/deps/openssl/openssl/crypto/aes/aes_ige.c
+++ b/deps/openssl/openssl/crypto/aes/aes_ige.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -47,7 +47,7 @@ typedef struct {
 /*  Use of this function is deprecated. */
 void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const AES_KEY *key,
-    unsigned char *ivec, const int enc)
+    unsigned char *ivec, int enc)
 {
     size_t n;
     size_t len = length / AES_BLOCK_SIZE;
@@ -180,7 +180,7 @@ void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
 void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const AES_KEY *key,
     const AES_KEY *key2, const unsigned char *ivec,
-    const int enc)
+    int enc)
 {
     size_t n;
     size_t len = length;
diff --git a/deps/openssl/openssl/crypto/aes/aes_local.h b/deps/openssl/openssl/crypto/aes/aes_local.h
index 71f9f5c648b..12386b3b84e 100644
--- a/deps/openssl/openssl/crypto/aes/aes_local.h
+++ b/deps/openssl/openssl/crypto/aes/aes_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,31 +17,22 @@

 #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))
 #define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00)
-#define GETU32(p) SWAP(*((u32 *)(p)))
-#define PUTU32(ct, st)               \
-    {                                \
-        *((u32 *)(ct)) = SWAP((st)); \
+#define GETU32(p) SWAP(*((uint32_t *)(p)))
+#define PUTU32(ct, st)                    \
+    {                                     \
+        *((uint32_t *)(ct)) = SWAP((st)); \
     }
 #else
-#define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] << 8) ^ ((u32)(pt)[3]))
-#define PUTU32(ct, st)              \
-    {                               \
-        (ct)[0] = (u8)((st) >> 24); \
-        (ct)[1] = (u8)((st) >> 16); \
-        (ct)[2] = (u8)((st) >> 8);  \
-        (ct)[3] = (u8)(st);         \
+#define GETU32(pt) (((uint32_t)(pt)[0] << 24) ^ ((uint32_t)(pt)[1] << 16) ^ ((uint32_t)(pt)[2] << 8) ^ ((uint32_t)(pt)[3]))
+#define PUTU32(ct, st)                   \
+    {                                    \
+        (ct)[0] = (uint8_t)((st) >> 24); \
+        (ct)[1] = (uint8_t)((st) >> 16); \
+        (ct)[2] = (uint8_t)((st) >> 8);  \
+        (ct)[3] = (uint8_t)(st);         \
     }
 #endif

-typedef uint64_t u64;
-#ifdef AES_LONG
-typedef unsigned long u32;
-#else
-typedef unsigned int u32;
-#endif
-typedef unsigned short u16;
-typedef unsigned char u8;
-
 #define MAXKC (256 / 32)
 #define MAXKB (256 / 8)
 #define MAXNR 14
diff --git a/deps/openssl/openssl/crypto/aes/aes_wrap.c b/deps/openssl/openssl/crypto/aes/aes_wrap.c
index 6b372c67a85..8059620c685 100644
--- a/deps/openssl/openssl/crypto/aes/aes_wrap.c
+++ b/deps/openssl/openssl/crypto/aes/aes_wrap.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2008-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -21,13 +21,13 @@ int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
     unsigned char *out,
     const unsigned char *in, unsigned int inlen)
 {
-    return CRYPTO_128_wrap(key, iv, out, in, inlen, (block128_f)AES_encrypt);
+    return (int)CRYPTO_128_wrap(key, iv, out, in, inlen, (block128_f)AES_encrypt);
 }

 int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
     unsigned char *out,
     const unsigned char *in, unsigned int inlen)
 {
-    return CRYPTO_128_unwrap(key, iv, out, in, inlen,
+    return (int)CRYPTO_128_unwrap(key, iv, out, in, inlen,
         (block128_f)AES_decrypt);
 }
diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-586.pl b/deps/openssl/openssl/crypto/aes/asm/aes-586.pl
index 7b4f9e1672f..6f2bad2a819 100755
--- a/deps/openssl/openssl/crypto/aes/asm/aes-586.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-586.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2004-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Version 4.3.
@@ -2022,7 +2022,7 @@ sub declast()

 # void AES_cbc_encrypt (const void char *inp, unsigned char *out,
 #			size_t length, const AES_KEY *key,
-#			unsigned char *ivp,const int enc);
+#			unsigned char *ivp, int enc);
 {
 # stack frame layout
 #             -4(%esp)		# return address	 0(%esp)
@@ -2870,8 +2870,7 @@ sub enckey()
     &set_label("exit");
 &function_end("_x86_AES_set_encrypt_key");

-# int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
-#                        AES_KEY *key)
+# int AES_set_encrypt_key(const unsigned char *userKey, int bits, AES_KEY *key)
 &function_begin_B("AES_set_encrypt_key");
 	&call	("_x86_AES_set_encrypt_key");
 	&ret	();
@@ -2932,8 +2931,7 @@ sub deckey()
 	&mov	(&DWP(4*$i,$key),$tp1);
 }

-# int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
-#                        AES_KEY *key)
+# int AES_set_decrypt_key(const unsigned char *userKey, int bits, AES_KEY *key)
 &function_begin_B("AES_set_decrypt_key");
 	&call	("_x86_AES_set_encrypt_key");
 	&cmp	("eax",0);
@@ -2991,7 +2989,7 @@ sub deckey()

 	&xor	("eax","eax");			# return success
 &function_end("AES_set_decrypt_key");
-&asciz("AES for x86, CRYPTOGAMS by <appro\@openssl.org>");
+&asciz("AES for x86, CRYPTOGAMS by <https://github.com/dot-asm>");

 &asm_finish();

diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-armv4.pl b/deps/openssl/openssl/crypto/aes/asm/aes-armv4.pl
index fc9ff7d3e4e..a1c3397cb9d 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aes-armv4.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-armv4.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # AES for ARMv4
@@ -73,7 +73,7 @@ $rounds="r12";

 $code=<<___;
 #ifndef __KERNEL__
-# include "arm_arch.h"
+# include "arch/arm_arch.h"
 #else
 # define __ARM_ARCH__ __LINUX_ARM_ARCH__
 #endif
@@ -1229,7 +1229,7 @@ _armv4_AES_decrypt:
 	sub	$tbl,$tbl,#1024
 	ldr	pc,[sp],#4		@ pop and return
 .size	_armv4_AES_decrypt,.-_armv4_AES_decrypt
-.asciz	"AES for ARMv4, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"AES for ARMv4, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2
 ___

diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-c64xplus.pl b/deps/openssl/openssl/crypto/aes/asm/aes-c64xplus.pl
index fa9a132d90f..58fa915db06 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aes-c64xplus.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-c64xplus.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2012-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2012-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # [Endian-neutral] AES for C64x+.
@@ -1373,7 +1373,7 @@ AES_Td4:
 	.byte	0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61
 	.byte	0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26
 	.byte	0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
-	.cstring "AES for C64x+, CRYPTOGAMS by <appro\@openssl.org>"
+	.cstring "AES for C64x+, CRYPTOGAMS by <https://github.com/dot-asm>"
 	.align	4
 ___

diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-cbc-vaes-x86_64.pl b/deps/openssl/openssl/crypto/aes/asm/aes-cbc-vaes-x86_64.pl
new file mode 100644
index 00000000000..8bd84d838fc
--- /dev/null
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-cbc-vaes-x86_64.pl
@@ -0,0 +1,184 @@
+#! /usr/bin/env perl
+# Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+# Erase the temporary broadcast key schedule used by the AES-CBC VAES
+# intrinsic implementation and clear its caller-clobbered register state.
+
+$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+$win64 = 0;
+$win64 = 1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/);
+
+$avx512vaes = 0;
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/;
+$dir = $1;
+($xlate = "${dir}x86_64-xlate.pl" and -f $xlate)
+    or ($xlate = "${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate)
+    or die "can't locate x86_64-xlate.pl";
+
+if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`
+        =~ /GNU assembler version ([2-9]\.[0-9]+)/) {
+    $avx512vaes = ($1 >= 2.30);
+}
+
+if (!$avx512vaes && $win64
+        && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/)
+        && `nasm -v 2>&1`
+            =~ /NASM version ([2-9]\.[0-9]+)(?:\.([0-9]+))?/) {
+    $avx512vaes = ($1 == 2.13 && $2 >= 3) + ($1 >= 2.14);
+}
+
+if (!$avx512vaes && $win64
+        && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/)
+        && `ml64 2>&1` =~ /Version ([0-9]+\.[0-9]+)\./) {
+    $avx512vaes = ($1 >= 14.16);
+}
+
+if (!$avx512vaes && `$ENV{CC} -v 2>&1`
+        =~ /(Apple)?\s*((?:clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)\.([0-9]+)?/) {
+    $ver = $3 + $4 / 100.0 + $5 / 10000.0;
+    if ($1) {
+        $avx512vaes = ($ver >= 10.0001);
+    } else {
+        $avx512vaes = ($ver >= 7.0);
+    }
+}
+
+if (!$avx512vaes && `$ENV{CC} -x c /dev/null -dM -E 2>/dev/null`
+        =~ /#define __clang_major__\s+([0-9]+)/) {
+    $avx512vaes = ($1 >= 11); # icx started with clang 11
+}
+
+open OUT, "| \"$^X\" \"$xlate\" $flavour \"$output\""
+    or die "can't call $xlate: $!";
+*STDOUT = *OUT;
+
+$key_schedule = $win64 ? "%rcx" : "%rdi";
+$num_keys = $win64 ? "%rdx" : "%rsi";
+
+$code = <<___;
+.text
+
+.globl  ossl_aes_cbc_vaes_cleanup_eligible
+.hidden ossl_aes_cbc_vaes_cleanup_eligible
+.type   ossl_aes_cbc_vaes_cleanup_eligible,\@abi-omnipotent
+.align  16
+ossl_aes_cbc_vaes_cleanup_eligible:
+.cfi_startproc
+    endbranch
+___
+
+if ($avx512vaes) {
+    $code .= <<___;
+    mov \$1,%eax
+    ret
+.cfi_endproc
+.size ossl_aes_cbc_vaes_cleanup_eligible,.-ossl_aes_cbc_vaes_cleanup_eligible
+
+# void ossl_aes_cbc_vaes_cleanup(void *key_schedule, size_t num_keys);
+#
+# num_keys counts 64-byte broadcast round keys. The caller invokes this only
+# after VAES use, so AVX-512 instructions are already safe to execute.
+# On Win64, the caller's epilogue restores the ABI-preserved low 128 bits of
+# XMM6-XMM15 if it used them. Their volatile upper lanes are cleared here.
+.globl  ossl_aes_cbc_vaes_cleanup
+.hidden ossl_aes_cbc_vaes_cleanup
+.type   ossl_aes_cbc_vaes_cleanup,\@abi-omnipotent
+.align  32
+ossl_aes_cbc_vaes_cleanup:
+.cfi_startproc
+    endbranch
+    vpxord %zmm0,%zmm0,%zmm0
+    test $num_keys,$num_keys
+    jz .Lvaes_cbc_clear_registers
+
+.Lvaes_cbc_clear_keys:
+    vmovdqu64 %zmm0,($key_schedule)
+    add \$64,$key_schedule
+    dec $num_keys
+    jnz .Lvaes_cbc_clear_keys
+
+.Lvaes_cbc_clear_registers:
+___
+
+    if ($win64) {
+        $code .= <<___;
+    # The low 128 bits of XMM6-XMM15 are nonvolatile on Win64. Preserve
+    # them, while clearing all of ZMM0-ZMM5 here.
+___
+        for ($i = 0; $i <= 5; $i++) {
+            $code .= "    vpxor %xmm$i,%xmm$i,%xmm$i\n";
+        }
+    }
+
+    for ($i = 16; $i <= 31; $i++) {
+        $code .= "    vpxord %zmm$i,%zmm$i,%zmm$i\n";
+    }
+
+    if ($win64) {
+        $code .= <<___;
+    # Clear the volatile upper lanes of ZMM6-ZMM15 last.
+    vzeroupper
+
+    # Clear the Win64 volatile general-purpose registers used by the caller.
+    xor %eax,%eax
+    xor %ecx,%ecx
+    xor %edx,%edx
+    xor %r8d,%r8d
+    xor %r9d,%r9d
+    xor %r10d,%r10d
+    xor %r11d,%r11d
+___
+    } else {
+        $code .= <<___;
+    # VZEROALL clears ZMM0-ZMM15, but does not affect ZMM16-ZMM31.
+    vzeroall
+
+    # Clear the SysV volatile general-purpose registers used by the caller.
+    xor %eax,%eax
+    xor %ecx,%ecx
+    xor %edx,%edx
+    xor %esi,%esi
+    xor %edi,%edi
+    xor %r8d,%r8d
+    xor %r9d,%r9d
+    xor %r10d,%r10d
+    xor %r11d,%r11d
+___
+    }
+
+    $code .= <<___;
+    ret
+.cfi_endproc
+.size ossl_aes_cbc_vaes_cleanup,.-ossl_aes_cbc_vaes_cleanup
+___
+} else {
+    $code .= <<___;
+    xor %eax,%eax
+    ret
+.cfi_endproc
+.size ossl_aes_cbc_vaes_cleanup_eligible,.-ossl_aes_cbc_vaes_cleanup_eligible
+
+.globl  ossl_aes_cbc_vaes_cleanup
+.hidden ossl_aes_cbc_vaes_cleanup
+.type   ossl_aes_cbc_vaes_cleanup,\@abi-omnipotent
+ossl_aes_cbc_vaes_cleanup:
+.cfi_startproc
+    endbranch
+    .byte 0x0f,0x0b                # ud2
+    ret
+.cfi_endproc
+.size ossl_aes_cbc_vaes_cleanup,.-ossl_aes_cbc_vaes_cleanup
+___
+}
+
+print $code;
+
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-cfb-avx512.pl b/deps/openssl/openssl/crypto/aes/asm/aes-cfb-avx512.pl
new file mode 100644
index 00000000000..3a1b512c214
--- /dev/null
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-cfb-avx512.pl
@@ -0,0 +1,1040 @@
+#! /usr/bin/env perl
+# Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright (c) 2025, Intel Corporation. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+#
+# Implements AES-CFB128 encryption and decryption with Intel(R) VAES
+
+$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+$win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/);
+
+$avx512vaes=0; # will be non-zero if tooling supports Intel AVX-512 and VAES
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
+( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or
+( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
+die "can't locate x86_64-xlate.pl";
+
+if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`
+        =~ /GNU assembler version ([2-9]\.[0-9]+)/) {
+    $avx512vaes = ($1>=2.30);
+}
+
+if (!$avx512vaes && $win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&
+       `nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)(?:\.([0-9]+))?/) {
+    $avx512vaes = ($1==2.13 && $2>=3) + ($1>=2.14);
+}
+
+if (!$avx512vaes && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
+       `ml64 2>&1` =~ /Version ([0-9]+\.[0-9]+)\./) {
+    $avx512vaes = ($1>=14.16);
+}
+
+if (!$avx512vaes && `$ENV{CC} -v 2>&1`
+    =~ /(Apple)?\s*((?:clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)\.([0-9]+)?/) {
+    my $ver = $3 + $4/100.0 + $5/10000.0; # 3.1.0->3.01, 3.10.1->3.1001
+    if ($1) {
+        # Apple conditions, they use a different version series, see
+        # https://en.wikipedia.org/wiki/Xcode#Xcode_7.0_-_10.x_(since_Free_On-Device_Development)_2
+        # clang 7.0.0 is Apple clang 10.0.1
+        $avx512vaes = ($ver>=10.0001)
+    } else {
+        $avx512vaes = ($ver>=7.0);
+    }
+}
+
+if (!$avx512vaes && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+    =~ /#define __clang_major__.([0-9]+)/) {
+    if ($1) {
+        $avx512vaes = ($1>=11); #icx started with clang 11
+    }
+}
+
+open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
+    or die "can't call $xlate: $!";
+*STDOUT=*OUT;
+
+##################################################################
+
+$code=".text\n";
+
+if ($avx512vaes) {
+
+$code.=<<___;
+.extern  OPENSSL_ia32cap_P
+
+#################################################################
+# Signature:
+#
+# int ossl_aes_cfb128_vaes_eligible(void);
+#
+# Detects if the underlying hardware supports all the features
+# required to run the Intel AVX-512 implementations of AES-CFB128 algorithms.
+#
+# Returns: non zero if all the required features are detected, 0 otherwise
+#################################################################
+
+.globl   ossl_aes_cfb128_vaes_eligible
+.type    ossl_aes_cfb128_vaes_eligible,\@abi-omnipotent
+.balign  64
+
+ossl_aes_cfb128_vaes_eligible:
+.cfi_startproc
+    endbranch
+
+    mov OPENSSL_ia32cap_P+8(%rip),%ecx
+    xor %eax,%eax
+
+    # Check 3rd 32-bit word of OPENSSL_ia32cap_P for the feature bit(s):
+    # AVX512BW (bit 30) + AVX512DQ (bit 17) + AVX512F (bit 16)
+
+    and \$0x40030000,%ecx                 # mask is 1<<30|1<<17|1<<16
+    cmp \$0x40030000,%ecx
+    jne .Laes_cfb128_vaes_eligible_done
+
+    mov OPENSSL_ia32cap_P+12(%rip),%ecx
+
+    # Check 4th 32-bit word of OPENSSL_ia32cap_P for the feature bit(s):
+    # AVX512VAES (bit 9)
+
+    and \$0x200,%ecx                      # mask is 1<<9
+    cmp \$0x200,%ecx
+    cmove %ecx,%eax
+
+.Laes_cfb128_vaes_eligible_done:
+    ret
+.cfi_endproc
+.size   ossl_aes_cfb128_vaes_eligible, .-ossl_aes_cfb128_vaes_eligible
+___
+
+#################################################################
+#
+# AES subroutines for:
+# - preloading the AES key schedule into AVX registers
+# - single-block AES encryption used by CFB encryption and decryption
+# - multiple-block AES encryption used by CFB decryption
+#
+# The CFB mode only uses block cipher encryption.
+#
+# The AES encryption step is described in Section 5.1 Cipher() of
+# FIPS 197 https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197-upd1.pdf
+# and implemented with Intel(R) AES-NI and VAES instructions:
+#
+# - AESKEYGENASSIST for key expansion, elsewhere in aesni_set_encrypt_key()
+# - VPXORD for AES pre-whitening
+# - VAESENC for performing one AES encryption round
+# - VAESENCLAST for performing the last AES encryption round
+#
+# For more information please consult:
+# - the Intel(R) 64 and IA-32 Architectures Optimization Reference Manual,
+# Chapter 21: Cryptography & Finite Field Arithmetic Instructions
+# https://www.intel.com/content/www/us/en/developer/articles/technical/intel64-and-ia32-architectures-optimization.html
+# - the Intel(R) Advanced Encryption Standard (AES) New Instructions Set Whitepaper
+# https://www.intel.com/content/dam/doc/white-paper/advanced-encryption-standard-new-instructions-set-paper.pdf
+#
+#################################################################
+
+# expects the key schedule address in $key_original
+sub load_aes_key_schedule_1x() {
+$code.=<<___;
+    vmovdqu8   0($key_original),%xmm17  # schedule  0 whitening
+    vmovdqu8  16($key_original),%xmm18  #           1
+    vmovdqu8  32($key_original),%xmm19  #           2
+    vmovdqu8  48($key_original),%xmm20  #           3
+    vmovdqu8  64($key_original),%xmm21  #           4
+    vmovdqu8  80($key_original),%xmm22  #           5
+    vmovdqu8  96($key_original),%xmm23  #           6
+    vmovdqu8 112($key_original),%xmm24  #           7
+    vmovdqu8 128($key_original),%xmm25  #           8
+    vmovdqu8 144($key_original),%xmm26  #           9
+    vmovdqu8 160($key_original),%xmm27  #          10 last for AES-128
+    vmovdqu8 176($key_original),%xmm28  #          11
+    vmovdqu8 192($key_original),%xmm29  #          12 last for AES-192
+    vmovdqu8 208($key_original),%xmm30  #          13
+    vmovdqu8 224($key_original),%xmm31  #          14 last for AES-256
+
+    mov 240($key_original),$rounds      # load AES rounds
+                                        # 240 is the byte-offset of the rounds field in AES_KEY
+___
+}
+
+
+# expects the key schedule address in $key_original
+sub load_aes_key_schedule_4x() {
+$code.=<<___;
+    vbroadcasti32x4   0($key_original),%zmm17  # schedule  0 whitening
+    vbroadcasti32x4  16($key_original),%zmm18  #           1
+    vbroadcasti32x4  32($key_original),%zmm19  #           2
+    vbroadcasti32x4  48($key_original),%zmm20  #           3
+    vbroadcasti32x4  64($key_original),%zmm21  #           4
+    vbroadcasti32x4  80($key_original),%zmm22  #           5
+    vbroadcasti32x4  96($key_original),%zmm23  #           6
+    vbroadcasti32x4 112($key_original),%zmm24  #           7
+    vbroadcasti32x4 128($key_original),%zmm25  #           8
+    vbroadcasti32x4 144($key_original),%zmm26  #           9
+    vbroadcasti32x4 160($key_original),%zmm27  #          10 last for AES-128
+    vbroadcasti32x4 176($key_original),%zmm28  #          11
+    vbroadcasti32x4 192($key_original),%zmm29  #          12 last for AES-192
+    vbroadcasti32x4 208($key_original),%zmm30  #          13
+    vbroadcasti32x4 224($key_original),%zmm31  #          14 last for AES-256
+
+    mov 240($key_original),$rounds             # load AES rounds
+                                               # 240 is the byte-offset of the rounds field in AES_KEY
+___
+}
+
+# Performs AES encryption of 1 128-bit block
+# Expects iv in $temp, non-final AES rounds in $rounds and key schedule in xmm17..31
+sub vaes_encrypt_block_1x() {
+    my ($label_prefix)=@_;
+$code.=<<___;
+    vpxord  %xmm17,$temp,$temp     # AES pre-whitening
+    vaesenc %xmm18,$temp,$temp
+    vaesenc %xmm19,$temp,$temp
+    vaesenc %xmm20,$temp,$temp
+    vaesenc %xmm21,$temp,$temp
+    vaesenc %xmm22,$temp,$temp
+    vaesenc %xmm23,$temp,$temp
+    vaesenc %xmm24,$temp,$temp
+    vaesenc %xmm25,$temp,$temp
+    vaesenc %xmm26,$temp,$temp
+
+    cmp \$0x09,$rounds
+    ja ${label_prefix}_192_256
+
+    vaesenclast %xmm27,$temp,$temp # last AES-128 encryption round
+    jmp ${label_prefix}_end
+
+.balign 32
+${label_prefix}_192_256:
+
+    vaesenc %xmm27,$temp,$temp
+    vaesenc %xmm28,$temp,$temp
+
+    cmp \$0x0B,$rounds
+    ja ${label_prefix}_256
+
+    vaesenclast %xmm29,$temp,$temp # last AES-192 encryption round
+    jmp ${label_prefix}_end
+
+.balign 32
+${label_prefix}_256:
+
+    vaesenc %xmm29,$temp,$temp
+    vaesenc %xmm30,$temp,$temp
+    vaesenclast %xmm31,$temp,$temp # last AES-256 encryption round
+
+.balign 32
+${label_prefix}_end:
+___
+}
+
+
+# Performs parallel AES encryption of 4 128-bit blocks
+# Expects iv in $temp_4x, non-final AES rounds in $rounds and key schedule in zmm17..31
+sub vaes_encrypt_block_4x() {
+    my ($label_prefix)=@_;
+$code.=<<___;
+    vpxord  %zmm17,$temp_4x,$temp_4x     # AES pre-whitening
+    vaesenc %zmm18,$temp_4x,$temp_4x
+    vaesenc %zmm19,$temp_4x,$temp_4x
+    vaesenc %zmm20,$temp_4x,$temp_4x
+    vaesenc %zmm21,$temp_4x,$temp_4x
+    vaesenc %zmm22,$temp_4x,$temp_4x
+    vaesenc %zmm23,$temp_4x,$temp_4x
+    vaesenc %zmm24,$temp_4x,$temp_4x
+    vaesenc %zmm25,$temp_4x,$temp_4x
+    vaesenc %zmm26,$temp_4x,$temp_4x
+
+    cmp \$0x09,$rounds
+    ja ${label_prefix}_192_256
+
+    vaesenclast %zmm27,$temp_4x,$temp_4x # last AES-128 encryption round
+    jmp ${label_prefix}_end
+
+.balign 32
+${label_prefix}_192_256:
+
+    vaesenc %zmm27,$temp_4x,$temp_4x
+    vaesenc %zmm28,$temp_4x,$temp_4x
+
+    cmp \$0x0B,$rounds
+    ja ${label_prefix}_256
+
+    vaesenclast %zmm29,$temp_4x,$temp_4x # last AES-192 encryption round
+    jmp ${label_prefix}_end
+
+.balign 32
+${label_prefix}_256:
+
+    vaesenc %zmm29,$temp_4x,$temp_4x
+    vaesenc %zmm30,$temp_4x,$temp_4x
+    vaesenclast %zmm31,$temp_4x,$temp_4x # last AES-256 encryption round
+
+.balign 32
+${label_prefix}_end:
+___
+}
+
+
+# Performs parallel AES encryption of 16 128-bit blocks
+# Expects input in $temp_*x, non-final AES rounds in $rounds and key schedule in zmm17..31
+sub vaes_encrypt_block_16x() {
+    my ($label_prefix)=@_;
+$code.=<<___;
+    vpxord %zmm17,$temp_4x, $temp_4x       # parallel AES pre-whitening
+    vpxord %zmm17,$temp_8x, $temp_8x
+    vpxord %zmm17,$temp_12x,$temp_12x
+    vpxord %zmm17,$temp_16x,$temp_16x
+
+    vaesenc %zmm18,$temp_4x, $temp_4x
+    vaesenc %zmm18,$temp_8x, $temp_8x
+    vaesenc %zmm18,$temp_12x,$temp_12x
+    vaesenc %zmm18,$temp_16x,$temp_16x
+
+    vaesenc %zmm19,$temp_4x, $temp_4x
+    vaesenc %zmm19,$temp_8x, $temp_8x
+    vaesenc %zmm19,$temp_12x,$temp_12x
+    vaesenc %zmm19,$temp_16x,$temp_16x
+
+    vaesenc %zmm20,$temp_4x, $temp_4x
+    vaesenc %zmm20,$temp_8x, $temp_8x
+    vaesenc %zmm20,$temp_12x,$temp_12x
+    vaesenc %zmm20,$temp_16x,$temp_16x
+
+    vaesenc %zmm21,$temp_4x, $temp_4x
+    vaesenc %zmm21,$temp_8x, $temp_8x
+    vaesenc %zmm21,$temp_12x,$temp_12x
+    vaesenc %zmm21,$temp_16x,$temp_16x
+
+    vaesenc %zmm22,$temp_4x, $temp_4x
+    vaesenc %zmm22,$temp_8x, $temp_8x
+    vaesenc %zmm22,$temp_12x,$temp_12x
+    vaesenc %zmm22,$temp_16x,$temp_16x
+
+    vaesenc %zmm23,$temp_4x, $temp_4x
+    vaesenc %zmm23,$temp_8x, $temp_8x
+    vaesenc %zmm23,$temp_12x,$temp_12x
+    vaesenc %zmm23,$temp_16x,$temp_16x
+
+    vaesenc %zmm24,$temp_4x, $temp_4x
+    vaesenc %zmm24,$temp_8x, $temp_8x
+    vaesenc %zmm24,$temp_12x,$temp_12x
+    vaesenc %zmm24,$temp_16x,$temp_16x
+
+    vaesenc %zmm25,$temp_4x, $temp_4x
+    vaesenc %zmm25,$temp_8x, $temp_8x
+    vaesenc %zmm25,$temp_12x,$temp_12x
+    vaesenc %zmm25,$temp_16x,$temp_16x
+
+    vaesenc %zmm26,$temp_4x, $temp_4x
+    vaesenc %zmm26,$temp_8x, $temp_8x
+    vaesenc %zmm26,$temp_12x,$temp_12x
+    vaesenc %zmm26,$temp_16x,$temp_16x
+
+    cmp \$0x09,$rounds
+    ja ${label_prefix}_192_256
+
+    vaesenclast %zmm27,$temp_4x, $temp_4x  # last AES-128 encryption round
+    vaesenclast %zmm27,$temp_8x, $temp_8x
+    vaesenclast %zmm27,$temp_12x,$temp_12x
+    vaesenclast %zmm27,$temp_16x,$temp_16x
+    jmp ${label_prefix}_end
+
+.balign 32
+${label_prefix}_192_256:
+
+    vaesenc %zmm27,$temp_4x, $temp_4x
+    vaesenc %zmm27,$temp_8x, $temp_8x
+    vaesenc %zmm27,$temp_12x,$temp_12x
+    vaesenc %zmm27,$temp_16x,$temp_16x
+
+    vaesenc %zmm28,$temp_4x, $temp_4x
+    vaesenc %zmm28,$temp_8x, $temp_8x
+    vaesenc %zmm28,$temp_12x,$temp_12x
+    vaesenc %zmm28,$temp_16x,$temp_16x
+
+    cmp \$0x0B,$rounds
+    ja ${label_prefix}_256
+
+    vaesenclast %zmm29,$temp_4x, $temp_4x  # last AES-192 encryption round
+    vaesenclast %zmm29,$temp_8x, $temp_8x
+    vaesenclast %zmm29,$temp_12x,$temp_12x
+    vaesenclast %zmm29,$temp_16x,$temp_16x
+    jmp ${label_prefix}_end
+
+.balign 32
+${label_prefix}_256:
+
+    vaesenc %zmm29,$temp_4x, $temp_4x
+    vaesenc %zmm29,$temp_8x, $temp_8x
+    vaesenc %zmm29,$temp_12x,$temp_12x
+    vaesenc %zmm29,$temp_16x,$temp_16x
+
+    vaesenc %zmm30,$temp_4x, $temp_4x
+    vaesenc %zmm30,$temp_8x, $temp_8x
+    vaesenc %zmm30,$temp_12x,$temp_12x
+    vaesenc %zmm30,$temp_16x,$temp_16x
+
+    vaesenclast %zmm31,$temp_4x, $temp_4x  # last AES-256 encryption round
+    vaesenclast %zmm31,$temp_8x, $temp_8x
+    vaesenclast %zmm31,$temp_12x,$temp_12x
+    vaesenclast %zmm31,$temp_16x,$temp_16x
+
+.balign 32
+${label_prefix}_end:
+___
+}
+
+#################################################################
+# Signature:
+#
+# void ossl_aes_cfb128_vaes_enc(
+#     const unsigned char *in,
+#     unsigned char *out,
+#     size_t len,
+#     const AES_KEY *ks,
+#     const unsigned char ivec[16],
+#     /*in-out*/ ossl_ssize_t *num);
+#
+# Preconditions:
+# - all pointers are valid (not NULL...)
+# - AES key schedule and rounds in `ks` are precomputed
+#
+# Invariants:
+# - `*num` is between 0 and 15 (inclusive)
+#
+#################################################################
+#
+# The implementation follows closely the encryption half of CRYPTO_cfb128_encrypt:
+# - "pre" step: processes the last bytes of a partial block
+# - "mid" step: processes complete blocks
+# - "post" step: processes the first bytes of a partial block
+#
+# To obtain the next ciphertext block `cipher <N>` from
+# the plaintext block `plain <N>`, the previous ciphertext
+# block `cipher <N-1>` is required as input.
+#
+# The dependency on previous encryption outputs (ciphertexts)
+# makes CFB encryption inherently serial.
+#
+#                  +----+                       +----------+
+#                  | iv |       +---------------> cipher 0 |
+#                  +--+-+       |               +----------+
+#                     |         |                     |
+#                     |         |                     |
+#              +------v------+  |              +------v------+
+#              | AES encrypt |  |              | AES encrypt |
+#              |  with  key  |  |              |  with  key  |
+#              +------+------+  |              +------+------+
+#                     |         |                     |
+#                     |         |                     |
+#   +---------+    +--v--+      |   +---------+    +--v--+
+#   | plain 0 +----> XOR |      |   | plain 1 +----> XOR |
+#   +---------+    +--+--+      |   +---------+    +--+--+
+#                     |         |                     |
+#                     |         |                     |
+#               +-----v----+    |               +-----v----+
+#               | cipher 0 +----+               | cipher 1 |
+#               +----------+                    +----------+
+#
+#################################################################
+
+$code.=<<___;
+.globl   ossl_aes_cfb128_vaes_enc
+.type    ossl_aes_cfb128_vaes_enc,\@function,6
+.balign  64
+ossl_aes_cfb128_vaes_enc:
+.cfi_startproc
+    endbranch
+___
+
+$inp="%rdi";          # arg0
+$out="%rsi";          # arg1
+$len="%rdx";          # arg2
+
+$key_original="%rcx"; # arg3
+$key_backup="%r10";
+
+$ivp="%r8";           # arg4
+$nump="%r9";          # arg5
+
+$num="%r11";
+$left="%rcx";
+$mask="%rax";
+
+$rounds="%r11d";
+
+$temp="%xmm2";
+$plain="%xmm3";
+
+$code.=<<___;
+
+    mov ($nump),$num                 # $num is the current byte index in the first partial block
+                                     # $num belongs to 0..15; non-zero means a partial first block
+
+    test $len,$len                   # return early if $len==0, unlikely to occur
+    jz .Laes_cfb128_vaes_enc_done
+
+    test $num,$num                   # check if the first block is partial
+    jz .Laes_cfb128_enc_mid          # if not, jump to processing full blocks
+
+###########################################################
+# first partial block pre-processing
+###########################################################
+
+    mov $key_original,$key_backup    # make room for variable shl with cl
+
+    mov \$0x10,$left                 # first block is partial
+    sub $num,$left                   # calculate how many bytes $left to process in the block
+    cmp $len,$left                   #
+    cmova $len,$left                 # $left = min(16-$num,$len)
+
+    mov \$1,$mask                    # build a mask with the least significant $left bits set
+    shlq %cl,$mask                   # $left is left shift counter
+    dec $mask                        # $mask is 2^$left-1
+    kmovq $mask,%k1
+
+    mov $num,%rax                    # keep in-out $num in %al
+    add $left,%rax                   # advance $num
+    and \$0x0F,%al                   # wrap-around $num in a 16-byte block
+
+    leaq ($num,$ivp),%r11            # process $left iv bytes
+    vmovdqu8 (%r11),%xmm0{%k1}{z}
+    vmovdqu8 ($inp),%xmm1{%k1}{z}    # process $left input bytes
+    vpxor %xmm0,%xmm1,%xmm2          # CipherFeedBack XOR
+    vmovdqu8 %xmm2,($out){%k1}       # write $left output bytes
+    vmovdqu8 %xmm2,(%r11){%k1}       # blend $left output bytes into iv
+
+    add $left,$inp                   # advance pointers
+    add $left,$out
+    sub $left,$len
+    jz .Laes_cfb128_enc_zero_pre     # return early if no AES encryption required
+
+    mov $key_backup,$key_original    # restore "key_original" as arg3
+
+.Laes_cfb128_enc_mid:
+___
+
+    &load_aes_key_schedule_1x();
+
+$code.=<<___;
+###########################################################
+# inner full blocks processing
+###########################################################
+
+    vmovdqu ($ivp),$temp             # load iv
+
+    cmp \$0x10,$len                  # is there a full plaintext block left (128 bits) ?
+    jb .Laes_cfb128_enc_post
+
+.balign 32
+.Loop_aes_cfb128_enc_main:
+    sub \$0x10,$len
+
+    vmovdqu ($inp),$plain            # load plaintext block
+    lea 16($inp),$inp                # $inp points to next plaintext
+___
+
+    &vaes_encrypt_block_1x(".Laes_cfb128_enc_mid");
+
+$code.=<<___;
+
+    vpxor $plain,$temp,$temp         # CipherFeedBack XOR
+    cmp \$0x10,$len
+    vmovdqu $temp,($out)             # write ciphertext
+    lea 16($out),$out                # $out points to the next output block
+    jae .Loop_aes_cfb128_enc_main
+
+    xor %eax,%eax                    # reset num when processing full blocks
+
+    vmovdqu $temp,($ivp)             # latest ciphertext block is next encryption input
+
+.Laes_cfb128_enc_post:
+
+###########################################################
+# last partial block post-processing
+###########################################################
+
+    test $len,$len                   # check if the last block is partial
+    jz .Laes_cfb128_enc_zero_all
+___
+
+    &vaes_encrypt_block_1x(".Laes_cfb128_enc_post");
+
+$code.=<<___;
+
+    mov $len,%rax                    # num=$len
+
+    mov \$1,%r11                     # build a mask with the least significant $len bits set
+    mov %dl,%cl                      # $len is left shift counter less than 16
+    shlq %cl,%r11
+    dec %r11                         # mask is 2^$len-1
+    kmovq %r11,%k1
+
+    vmovdqu8 ($inp),%xmm1{%k1}{z}    # read $len input bytes, zero the rest to not impact XOR
+    vpxor $temp,%xmm1,%xmm0          # CipherFeedBack XOR
+    vmovdqu8 %xmm0,($out){%k1}       # write $len output bytes
+    vmovdqu8 %xmm0,($ivp)            # write chained/streaming iv
+
+    # clear registers
+
+.Laes_cfb128_enc_zero_all:
+    vpxord %xmm17,%xmm17,%xmm17      # clear the AES key schedule
+    vpxord %xmm18,%xmm18,%xmm18
+    vpxord %xmm19,%xmm19,%xmm19
+    vpxord %xmm20,%xmm20,%xmm20
+    vpxord %xmm21,%xmm21,%xmm21
+    vpxord %xmm22,%xmm22,%xmm22
+    vpxord %xmm23,%xmm23,%xmm23
+    vpxord %xmm24,%xmm24,%xmm24
+    vpxord %xmm25,%xmm25,%xmm25
+    vpxord %xmm26,%xmm26,%xmm26
+    vpxord %xmm27,%xmm27,%xmm27
+    vpxord %xmm28,%xmm28,%xmm28
+    vpxord %xmm29,%xmm29,%xmm29
+    vpxord %xmm30,%xmm30,%xmm30
+    vpxord %xmm31,%xmm31,%xmm31
+
+    vpxor %xmm3,%xmm3,%xmm3          # clear registers used during AES encryption
+
+.Laes_cfb128_enc_zero_pre:
+    vpxor %xmm0,%xmm0,%xmm0          # clear the rest of the registers
+    vpxor %xmm1,%xmm1,%xmm1
+    vpxor %xmm2,%xmm2,%xmm2
+
+    mov %rax,($nump)                 # num is in/out, update for future/chained calls
+
+    vzeroupper
+
+.Laes_cfb128_vaes_enc_done:
+    ret
+.cfi_endproc
+.size ossl_aes_cfb128_vaes_enc,.-ossl_aes_cfb128_vaes_enc
+___
+
+
+#################################################################
+# Signature:
+#
+# void ossl_aes_cfb128_vaes_dec(
+#     const unsigned char *in,
+#     unsigned char *out,
+#     size_t len,
+#     const AES_KEY *ks,
+#     const unsigned char ivec[16],
+#     /*in-out*/ ossl_ssize_t *num);
+#
+# Preconditions:
+# - all pointers are valid (not NULL...)
+# - AES key schedule and rounds in `ks` are precomputed
+#
+# Invariants:
+# - `*num` is between 0 and 15 (inclusive)
+#
+#################################################################
+#
+# The implementation follows closely the decryption half of CRYPTO_cfb128_encrypt:
+#
+# - "pre" step: processes the last bytes of a partial block
+# - "mid" step: processes complete blocks using an unrolled approach:
+#   - processes 16 blocks in parallel until fewer than 16 blocks remain
+#   - processes  4 blocks in parallel until fewer than  4 blocks remain
+#   - processes  1 block  in series   until none are left
+# - "post" step: processes the first bytes of a partial block
+#
+# To obtain the next plaintext block `plain <N>` from
+# its ciphertext block `cipher <N>`, the previous ciphertext
+# block `cipher <N-1>` is required as input.
+#
+# Since CFB decryption for the current block only depends on
+# iv and ciphertext blocks (already available as inputs)
+# and not on plaintext blocks, it can be efficiently parallelized.
+#
+#     +----+                    +----------+                +----------+                +----------+
+#     | iv |                    | cipher 0 |                | cipher 1 |                | cipher 2 |
+#     +--+-+                    +----+-----+                +----+-----+                +----+-----+
+#        |                           |                           |                           |
+#        |                           |                           |                           |
+# +------v------+             +------v------+             +------v------+             +------v------+
+# | AES encrypt |             | AES encrypt |             | AES encrypt |             | AES encrypt |
+# |  with  key  |             |  with  key  |             |  with  key  |             |  with  key  |
+# +------+------+             +------+------+             +------+------+             +------+------+
+#        |                           |                           |                           |
+#        |                           |                           |                           |
+#     +--v--+     +----------+    +--v--+     +----------+    +--v--+     +----------+    +--v--+     +----------+
+#     | XOR <-----+ cipher 0 |    | XOR <-----+ cipher 1 |    | XOR <-----+ cipher 2 |    | XOR <-----+ cipher 3 |
+#     +--+--+     +----------+    +--+--+     +----------+    +--+--+     +----------+    +--+--+     +----------+
+#        |                           |                           |                           |
+#        |                           |                           |                           |
+#   +----v----+                 +----v----+                 +----v----+                 +----v----+
+#   | plain 0 |                 | plain 1 |                 | plain 2 |                 | plain 3 |
+#   +---------+                 +---------+                 +---------+                 +---------+
+#
+# To produce N (4 in the diagram above) output/plaintext blocks we require as inputs:
+# - iv
+# - N ciphertext blocks
+# The N-th ciphertext block is not encrypted and becomes the next iv input.
+#
+#################################################################
+
+$code.=<<___;
+.globl   ossl_aes_cfb128_vaes_dec
+.type    ossl_aes_cfb128_vaes_dec,\@function,6
+.balign  64
+ossl_aes_cfb128_vaes_dec:
+.cfi_startproc
+    endbranch
+___
+
+$inp="%rdi";          # arg0
+$out="%rsi";          # arg1
+$len="%rdx";          # arg2
+
+$key_original="%rcx"; # arg3
+$key_backup="%r10";
+
+$ivp="%r8";           # arg4
+$nump="%r9";          # arg5
+
+$num="%r11";
+$left="%rcx";
+$mask="%rax";
+
+$rounds="%r11d";
+
+$temp="%xmm2";
+$temp_4x="%zmm2";
+$temp_8x="%zmm4";
+$temp_12x="%zmm0";
+$temp_16x="%zmm6";
+
+$cipher="%xmm3";
+$cipher_4x="%zmm3";
+$cipher_8x="%zmm5";
+$cipher_12x="%zmm1";
+$cipher_16x="%zmm16";
+
+$code.=<<___;
+
+    mov ($nump),$num                  # $num is the current byte index in the first partial block
+                                      # $num belongs to 0..15; non-zero means a partial first block
+
+    test $len,$len                    # return early if $len==0, unlikely to occur
+    jz .Laes_cfb128_vaes_dec_done
+___
+
+$code.=<<___ if($win64);
+    sub \$0x10,%rsp
+.cfi_adjust_cfa_offset 16
+    vmovdqu %xmm6,(%rsp)              # xmm6 needs to be maintained for Windows
+___
+
+$code.=<<___;
+    test $num,$num                    # check if the first block is partial
+    jz .Laes_cfb128_dec_mid           # if not, jump to processing full blocks
+
+###########################################################
+# first partial block pre-processing
+###########################################################
+
+    mov $key_original,$key_backup     # make room for variable shl with cl
+
+    mov \$0x10,$left                  # first block is partial
+    sub $num,$left                    # calculate how many bytes $left to process in the block
+    cmp $len,$left                    #
+    cmova $len,$left                  # $left = min(16-$num,$len)
+
+    mov \$1,$mask                     # build a mask with the least significant $left bits set
+    shlq %cl,$mask                    # $left is left shift counter
+    dec $mask                         # $mask is 2^$left-1
+    kmovq $mask,%k1
+
+    lea ($num,$left),%rax             # keep in-out num in %al, advance by $left
+    and \$0x0F,%al                    # wrap-around in a 16-byte block
+
+    leaq ($num,$ivp),%r11             # process $left iv bytes
+    vmovdqu8 (%r11),%xmm0{%k1}{z}
+    vmovdqu8 ($inp),%xmm1{%k1}{z}     # process $left input bytes
+    vpxor %xmm0,%xmm1,%xmm2           # CipherFeedBack XOR
+    vmovdqu8 %xmm2,($out){%k1}        # write $left output bytes
+    vmovdqu8 %xmm1,(%r11){%k1}        # blend $left input bytes into iv
+
+    add $left,$inp                    # advance pointers
+    add $left,$out
+    sub $left,$len
+    jz .Laes_cfb128_dec_zero_pre      # return early if no AES encryption required
+
+    mov $key_backup,$key_original     # restore "key_original" as arg3
+
+.Laes_cfb128_dec_mid:
+___
+
+    &load_aes_key_schedule_4x();
+
+$code.=<<___;
+###########################################################
+# inner full blocks processing
+###########################################################
+
+    # $temp_4x is "iv | iv | iv | iv"
+    vbroadcasti32x4 ($ivp),$temp_4x             # load iv
+
+    cmp \$0x100,$len                            # are there 16 ciphertext blocks left (2048 bits) ?
+    jb .Laes_cfb128_dec_check_4x
+
+###########################################################
+# decrypt groups of 16 128-bit blocks in parallel
+# behaves as 16x loop unroll
+###########################################################
+
+.balign 32
+.Loop_aes_cfb128_dec_mid_16x:
+    sub \$0x100,$len
+
+    # load 16 ciphertext blocks
+
+    # $cipher_4x  is "ciphertext  0 | ciphertext  1 | ciphertext  2 | ciphertext  3"
+    vmovdqu32 ($inp),$cipher_4x
+    # $cipher_8x  is "ciphertext  4 | ciphertext  5 | ciphertext  6 | ciphertext  7"
+    vmovdqu32 64($inp),$cipher_8x
+    # $cipher_12x is "ciphertext  8 | ciphertext  9 | ciphertext 10 | ciphertext 11"
+    vmovdqu32 128($inp),$cipher_12x
+    # $cipher_16x is "ciphertext 12 | ciphertext 13 | ciphertext 14 | ciphertext 15"
+    vmovdqu32 192($inp),$cipher_16x
+
+    # $temp_4x  is   "iv            | ciphertext  0 | ciphertext  1 | ciphertext  2"
+    valignq \$6,$temp_4x,$cipher_4x,$temp_4x
+    # $temp_8x  is   "ciphertext  3 | ciphertext  4 | ciphertext  5 | ciphertext  6"
+    valignq \$6,$cipher_4x,$cipher_8x,$temp_8x
+    # $temp_12x is   "ciphertext  7 | ciphertext  8 | ciphertext  9 | ciphertext 10"
+    valignq \$6,$cipher_8x,$cipher_12x,$temp_12x
+    # $temp_16x is   "ciphertext 11 | ciphertext 12 | ciphertext 13 | ciphertext 14"
+    valignq \$6,$cipher_12x,$cipher_16x,$temp_16x
+
+    lea 256($inp),$inp                          # $inp points to next ciphertext
+___
+
+    &vaes_encrypt_block_16x(".Laes_cfb128_dec_mid_16x");
+
+$code.=<<___;
+
+    vpxord $cipher_4x,$temp_4x,$temp_4x         # CipherFeedBack XOR of 16 blocks
+    vpxord $cipher_8x,$temp_8x,$temp_8x
+    vpxord $cipher_12x,$temp_12x,$temp_12x
+    vpxord $cipher_16x,$temp_16x,$temp_16x
+
+    cmp \$0x100,$len
+
+    vmovdqu32 $temp_4x,($out)                   # write 16 plaintext blocks
+    vmovdqu32 $temp_8x,64($out)
+    vmovdqu32 $temp_12x,128($out)
+    vmovdqu32 $temp_16x,192($out)
+
+    vmovdqu8 $cipher_16x,$temp_4x
+
+    lea 256($out),$out                          # $out points to the next output block
+
+    jae .Loop_aes_cfb128_dec_mid_16x
+
+    vextracti64x2 \$3,$cipher_16x,$temp         # latest ciphertext block is next decryption iv
+    vinserti32x4 \$3,$temp,$temp_4x,$temp_4x    # move ciphertext3 to positions 0 and 3 in preparation for next shuffle
+
+    xor %eax,%eax                               # reset $num when processing full blocks
+
+    vmovdqu $temp,($ivp)                        # latest plaintext block is next decryption iv
+
+.Laes_cfb128_dec_check_4x:
+    cmp \$0x40,$len                             # are there 4 ciphertext blocks left (512 bits) ?
+    jb .Laes_cfb128_dec_check_1x
+
+###########################################################
+# decrypt groups of 4 128-bit blocks in parallel
+# behaves as 4x loop unroll
+###########################################################
+
+# expects $temp_4x to contain "iv" in the 3rd (most significant) lane
+
+.balign 32
+.Loop_aes_cfb128_dec_mid_4x:
+    sub \$0x40,$len
+
+    # $cipher_4x is "ciphertext0 | ciphertext1 | ciphertext 2 | ciphertext 3"
+    vmovdqu32 ($inp),$cipher_4x                 # load 4 ciphertext blocks
+
+    # $temp_4x is   "iv          | ciphertext0 | ciphertext 1 | ciphertext 2"
+    valignq \$6,$temp_4x,$cipher_4x,$temp_4x
+
+    lea 64($inp),$inp                           # $inp points to next ciphertext
+___
+
+    &vaes_encrypt_block_4x(".Laes_cfb128_dec_mid_4x");
+
+$code.=<<___;
+    vpxord $cipher_4x,$temp_4x,$temp_4x         # CipherFeedBack XOR of 4 blocks
+    cmp \$0x40,$len
+    vmovdqu32 $temp_4x,($out)                   # write 4 plaintext blocks
+    vmovdqu8 $cipher_4x,$temp_4x
+    lea 64($out),$out                           # $out points to the next output block
+
+    jae .Loop_aes_cfb128_dec_mid_4x
+
+    vextracti64x2 \$3,$temp_4x,$temp            # latest ciphertext block is next decryption iv
+                                                # move ciphertext3 to position 0 in preparation for next step
+
+    xor %eax,%eax                               # reset $num when processing full blocks
+
+    vmovdqu $temp,($ivp)                        # latest plaintext block is next decryption iv
+
+.Laes_cfb128_dec_check_1x:
+    cmp \$0x10,$len                             # are there full ciphertext blocks left (128 bits) ?
+    jb .Laes_cfb128_dec_post
+
+###########################################################
+# decrypt the rest of full 128-bit blocks in series
+###########################################################
+
+# expects $temp to contain iv
+
+.balign 32
+.Loop_aes_cfb128_dec_mid_1x:
+    sub \$0x10,$len
+
+    vmovdqu ($inp),$cipher            # load ciphertext block
+    lea 16($inp),$inp                 # $inp points to next ciphertext
+___
+
+    &vaes_encrypt_block_1x(".Loop_aes_cfb128_dec_mid_1x_inner");
+
+$code.=<<___;
+    vpxor $cipher,$temp,$temp         # CipherFeedBack XOR
+    cmp \$0x10,$len
+    vmovdqu $temp,($out)              # write plaintext
+    vmovdqu8 $cipher,$temp
+    lea 16($out),$out                 # $out points to the next output block
+    jae .Loop_aes_cfb128_dec_mid_1x
+
+    xor %eax,%eax                     # reset $num when processing full blocks
+
+    vmovdqu $temp,($ivp)              # latest plaintext block is next decryption input
+
+.Laes_cfb128_dec_post:
+
+###########################################################
+# last partial block post-processing
+###########################################################
+
+    test $len,$len                     # check if the last block is partial
+    jz .Laes_cfb128_dec_zero_all
+___
+
+    &vaes_encrypt_block_1x(".Loop_aes_cfb128_dec_post");
+
+$code.=<<___;
+
+    mov $len,%rax                      # num=$len
+    mov \$1,%r11                       # build a mask with the least significant $len bits set
+    mov %dl,%cl                        # $len is left shift counter less than 16
+    shlq %cl,%r11
+    dec %r11                           # mask is 2^$len-1
+    kmovq %r11,%k1
+
+    vmovdqu8 ($inp),%xmm1{%k1}{z}      # read $len input bytes, zero the rest to not impact XOR
+    vpxor $temp,%xmm1,%xmm0            # CipherFeedBack XOR
+    vmovdqu8 %xmm0,($out){%k1}         # write $len output bytes
+    vpblendmb %xmm1,$temp,${temp}{%k1} # blend $len input bytes into iv
+
+    vmovdqu8 $temp,($ivp)              # write chained/streaming iv
+
+    # clear registers
+
+.Laes_cfb128_dec_zero_all:
+    vpxord %xmm17,%xmm17,%xmm17        # clear the AES key schedule
+    vpxord %xmm18,%xmm18,%xmm18        # zero the upper lanes of zmm registers
+    vpxord %xmm19,%xmm19,%xmm19
+    vpxord %xmm20,%xmm20,%xmm20
+    vpxord %xmm21,%xmm21,%xmm21
+    vpxord %xmm22,%xmm22,%xmm22
+    vpxord %xmm23,%xmm23,%xmm23
+    vpxord %xmm24,%xmm24,%xmm24
+    vpxord %xmm25,%xmm25,%xmm25
+    vpxord %xmm26,%xmm26,%xmm26
+    vpxord %xmm27,%xmm27,%xmm27
+    vpxord %xmm28,%xmm28,%xmm28
+    vpxord %xmm29,%xmm29,%xmm29
+    vpxord %xmm30,%xmm30,%xmm30
+    vpxord %xmm31,%xmm31,%xmm31
+
+    vpxord %xmm3,%xmm3,%xmm3           # clear registers used during AES encryption
+    vpxord %xmm4,%xmm4,%xmm4
+    vpxord %xmm5,%xmm5,%xmm5
+    vpxord %xmm6,%xmm6,%xmm6
+    vpxord %xmm16,%xmm16,%xmm16
+
+.Laes_cfb128_dec_zero_pre:
+
+    vpxord %xmm0,%xmm0,%xmm0           # clear the rest of the registers
+    vpxord %xmm1,%xmm1,%xmm1
+    vpxord %xmm2,%xmm2,%xmm2
+
+    vzeroupper
+___
+
+$code.=<<___ if($win64);
+    vmovdqu (%rsp),%xmm6               # xmm6 needs to be maintained for Windows
+    add \$16,%rsp
+.cfi_adjust_cfa_offset -16
+___
+
+$code.=<<___;
+    mov %rax,($nump)                   # num is in/out, update for future/chained calls
+
+.Laes_cfb128_vaes_dec_done:
+    ret
+.cfi_endproc
+.size ossl_aes_cfb128_vaes_dec,.-ossl_aes_cfb128_vaes_dec
+___
+
+} else {
+
+$code .= <<___;
+.globl     ossl_aes_cfb128_vaes_enc
+.globl     ossl_aes_cfb128_vaes_dec
+
+# Mock implementations of AES-CFB128 encryption/decryption
+# that always fail. Should not be executed under normal circumstances.
+
+ossl_aes_cfb128_vaes_enc:
+ossl_aes_cfb128_vaes_dec:
+    .byte 0x0f,0x0b                # Undefined Instruction in the Intel architecture
+                                   # Raises the Invalid Opcode exception
+    ret
+
+#################################################################
+# Signature:
+#
+# int ossl_aes_cfb128_vaes_eligible(void);
+#
+# Always returns 0 (not eligible), meaning that tooling does not support
+# the Intel AVX-512 extensions. Signals higher level code to fallback
+# to an alternative implementation.
+#################################################################
+
+.globl     ossl_aes_cfb128_vaes_eligible
+.type      ossl_aes_cfb128_vaes_eligible,\@abi-omnipotent
+ossl_aes_cfb128_vaes_eligible:
+    xor %eax,%eax
+    ret
+.size ossl_aes_cfb128_vaes_eligible, .-ossl_aes_cfb128_vaes_eligible
+___
+}
+
+print $code;
+
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-ia64.S b/deps/openssl/openssl/crypto/aes/asm/aes-ia64.S
index ad9e466bbc1..a9889af2a1e 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aes-ia64.S
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-ia64.S
@@ -1,4 +1,4 @@
-// Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
+// Copyright 2004-2025 The OpenSSL Project Authors. All Rights Reserved.
 //
 // Licensed under the Apache License 2.0 (the "License").  You may not use
 // this file except in compliance with the License.  You can obtain a copy
@@ -6,7 +6,7 @@
 // https://www.openssl.org/source/license.html
 //
 // ====================================================================
-// Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+// Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 // project. Rights for redistribution and usage in source and binary
 // forms are granted according to the License.
 // ====================================================================
@@ -33,7 +33,7 @@
 // 64 bytes line size and L2 - 128 bytes...

 .ident	"aes-ia64.S, version 1.2"
-.ident	"IA-64 ISA artwork by Andy Polyakov <appro@openssl.org>"
+.ident	"IA-64 ISA artwork by Andy Polyakov <https://github.com/dot-asm>"
 .explicit
 .text

diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-mips.pl b/deps/openssl/openssl/crypto/aes/asm/aes-mips.pl
index 290621acc2c..c58b76f0ea6 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aes-mips.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-mips.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2010-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # AES for MIPS
@@ -93,7 +93,7 @@ if ($flavour =~ /64|n32/i) {
 }
 $pf = ($flavour =~ /nubi/i) ? $t0 : $t2;
 #
-# <appro@openssl.org>
+# <https://github.com/dot-asm>
 #
 ######################################################################

@@ -107,7 +107,7 @@ my ($MSB,$LSB)=(0,3);	# automatically converted to little-endian
 $output and open STDOUT,">$output";

 $code.=<<___;
-#include "mips_arch.h"
+#include "arch/mips_arch.h"

 .text
 #if !defined(__mips_eabi) && (!defined(__vxworks) || defined(__pic__))
diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-parisc.pl b/deps/openssl/openssl/crypto/aes/asm/aes-parisc.pl
index 3d55eec9bb3..1ae85ca00d0 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aes-parisc.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-parisc.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2009-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # AES for PA-RISC.
@@ -1012,7 +1012,7 @@ L\$AES_Td
 	.BYTE	0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61
 	.BYTE	0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26
 	.BYTE	0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
-	.STRINGZ "AES for PA-RISC, CRYPTOGAMS by <appro\@openssl.org>"
+	.STRINGZ "AES for PA-RISC, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`
diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-ppc.pl b/deps/openssl/openssl/crypto/aes/asm/aes-ppc.pl
index 595182c89bf..a8dd05e6f61 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aes-ppc.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-ppc.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # Needs more work: key setup, CBC routine...
@@ -1454,7 +1454,7 @@ Ldec_compact_done:
 	.byte	0,12,0x14,0,0,0,0,0
 .size	.AES_decrypt,.-.AES_decrypt

-.asciz	"AES for PPC, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"AES for PPC, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	7
 ___

diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zvbb-zvkg-zvkned.pl b/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zvbb-zvkg-zvkned.pl
index 5fb2cc33f34..7365a369769 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zvbb-zvkg-zvkned.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zvbb-zvkg-zvkned.pl
@@ -2,7 +2,7 @@
 # This file is dual-licensed, meaning that you can use it under your
 # choice of either of the following two licenses:
 #
-# Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License"). You can obtain
 # a copy in the file LICENSE in the source distribution or at
@@ -633,7 +633,7 @@ aes_xts_dec_128:
     @{[aes_128_dec]}
     @{[vxor_vv $V24, $V24, $V28]}

-    # store second to last block plaintext
+    # store last block plaintext
     @{[vse32_v $V24, $OUTPUT]}

     ret
@@ -697,7 +697,7 @@ aes_xts_dec_256:
     @{[aes_256_dec]}
     @{[vxor_vv $V24, $V24, $V28]}

-    # store second to last block plaintext
+    # store last block plaintext
     @{[vse32_v $V24, $OUTPUT]}

     ret
diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zvkned.pl b/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zvkned.pl
index 014fa6807d3..f057b53ccf3 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zvkned.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zvkned.pl
@@ -475,24 +475,50 @@ ___
 $code .= <<___;
 .p2align 3
 L_cbc_dec_128:
-    # Load all 11 round keys to v1-v11 registers.
-    @{[aes_128_load_key $KEYP]}
-
+    @{[vsetivli "zero", 4, "e32", "m1", "ta", "ma"]}
     # Load IV.
     @{[vle32_v $V16, $IVP]}

+.Lcbc_dec_loop:
+    li $T0, 10
+    addi $KEYP, $KEYP, 160
+    @{[vle32_v $V11, $KEYP]}
+    addi $KEYP, $KEYP, -16
+    @{[vle32_v $V10, $KEYP]}
+    li $T1, 64
+    bgeu $LEN, $T1, .Lcbc_check_64
+
     @{[vle32_v $V24, $INP]}
     @{[vmv_v_v $V17, $V24]}
     j 2f

 1:
+    li $T0, 10
+    addi $KEYP, $KEYP, 160
+    @{[vle32_v $V11, $KEYP]}
+    addi $KEYP, $KEYP, -16
+    @{[vle32_v $V10, $KEYP]}
     @{[vle32_v $V24, $INP]}
     @{[vmv_v_v $V17, $V24]}
     addi $OUTP, $OUTP, 16

 2:
     # AES body
-    @{[aes_128_decrypt]}
+    @{[vaesz_vs $V24, $V11]}   # with round key w[40,43]
+    addi $T0, $T0, -2
+3:
+    addi $KEYP, $KEYP, -16
+    @{[vle32_v $V11, $KEYP]}
+    @{[vaesdm_vs $V24, $V10]}  # with round key w[36,39]
+    addi $KEYP, $KEYP, -16
+    @{[vle32_v $V10, $KEYP]}
+    @{[vaesdm_vs $V24, $V11]}   # with round key w[32,35]
+    addi $T0, $T0, -2
+    bnez $T0, 3b
+    addi $KEYP, $KEYP, -16
+    @{[vle32_v $V11, $KEYP]}
+    @{[vaesdm_vs $V24, $V10]}   # with round key w[ 4, 7]
+    @{[vaesdf_vs $V24, $V11]}   # with round key w[ 0, 3]

     @{[vxor_vv $V24, $V24, $V16]}
     @{[vse32_v $V24, $OUTP]}
@@ -505,6 +531,221 @@ L_cbc_dec_128:

     @{[vse32_v $V16, $IVP]}

+    ret
+
+# =====================================================
+# If data 128bytes > length ≥ 64 bytes, process in batches of 4 blocks:
+# 4-block CBC decryption process:
+#   1. Load 4 ciphertext blocks
+#   2. Back up the ciphertext blocks
+#   3. Decrypt each data block
+#   4. Reload ciphertext blocks into registers v17-v20 for XOR
+#   5. XOR with previous ciphertext block (CBC chain)
+#   6. Update IV and store plaintext
+# If the data length is less than 64 bytes, process it block by block using the Lcbc_dec_loop function
+# =====================================================
+.Lcbc_check_64:
+    li $T1, 128
+    bgeu $LEN, $T1, .Lcbc_check_128
+
+    @{[vle32_v $V24, $INP]}
+    addi $INP, $INP, 16
+    @{[vle32_v $V25, $INP]}
+    addi $INP, $INP, 16
+    @{[vle32_v $V26, $INP]}
+    addi $INP, $INP, 16
+    @{[vle32_v $V27, $INP]}
+    @{[vle32_v $V20, $INP]}
+    addi $INP, $INP, -16
+    @{[vle32_v $V19, $INP]}
+
+    @{[vaesz_vs $V24, $V11]}   # with round key w[40,43]
+    @{[vaesz_vs $V25, $V11]}   # with round key w[40,43]
+    @{[vaesz_vs $V26, $V11]}   # with round key w[40,43]
+    @{[vaesz_vs $V27, $V11]}   # with round key w[40,43]
+    addi $T0, $T0, -2
+4:
+    addi $KEYP, $KEYP, -16
+    @{[vle32_v $V11, $KEYP]}
+    @{[vaesdm_vs $V24, $V10]}  # with round key w[36,39]
+    @{[vaesdm_vs $V25, $V10]}  # with round key w[36,39]
+    @{[vaesdm_vs $V26, $V10]}  # with round key w[36,39]
+    @{[vaesdm_vs $V27, $V10]}  # with round key w[36,39]
+    addi $KEYP, $KEYP, -16
+    @{[vle32_v $V10, $KEYP]}
+    @{[vaesdm_vs $V24, $V11]}   # with round key w[32,35]
+    @{[vaesdm_vs $V25, $V11]}   # with round key w[32,35]
+    @{[vaesdm_vs $V26, $V11]}   # with round key w[32,35]
+    @{[vaesdm_vs $V27, $V11]}   # with round key w[32,35]
+    addi $T0, $T0, -2
+    bnez $T0, 4b
+    addi $KEYP, $KEYP, -16
+    @{[vle32_v $V11, $KEYP]}
+    addi $INP, $INP, -16
+    @{[vle32_v $V18, $INP]}
+    addi $INP, $INP, -16
+    @{[vle32_v $V17, $INP]}
+
+    @{[vaesdm_vs $V24, $V10]}   # with round key w[ 4, 7]
+    @{[vaesdm_vs $V25, $V10]}   # with round key w[ 4, 7]
+    @{[vaesdm_vs $V26, $V10]}   # with round key w[ 4, 7]
+    @{[vaesdm_vs $V27, $V10]}   # with round key w[ 4, 7]
+
+    @{[vaesdf_vs $V24, $V11]}   # with round key w[ 0, 3]
+    @{[vaesdf_vs $V25, $V11]}   # with round key w[ 0, 3]
+    @{[vaesdf_vs $V26, $V11]}   # with round key w[ 0, 3]
+    @{[vaesdf_vs $V27, $V11]}   # with round key w[ 0, 3]
+
+    @{[vxor_vv $V24, $V24, $V16]}
+    @{[vxor_vv $V25, $V25, $V17]}
+    @{[vxor_vv $V26, $V26, $V18]}
+    @{[vxor_vv $V27, $V27, $V19]}
+
+    @{[vse32_v $V24, $OUTP]}
+    addi $OUTP, $OUTP, 16
+    @{[vse32_v $V25, $OUTP]}
+    addi $OUTP, $OUTP, 16
+    @{[vse32_v $V26, $OUTP]}
+    addi $OUTP, $OUTP, 16
+    @{[vse32_v $V27, $OUTP]}
+    addi $OUTP, $OUTP, 16
+
+    @{[vmv_v_v $V16, $V20]}
+
+    addi $LEN, $LEN, -64
+    addi $INP, $INP, 64
+    bnez $LEN, .Lcbc_dec_loop
+    @{[vse32_v $V16, $IVP]}
+
+    ret
+
+# =====================================================
+# If data length ≥ 128 bytes, process 8 blocks in batch:
+# 8-block CBC decryption pipeline:
+#   1. Load 8 ciphertext blocks
+#   2. Back up the ciphertext blocks
+#   3. Decrypt each data block
+#   4. Reload ciphertext blocks into registers v17-v23 and v15 for XOR
+#   5. XOR with previous ciphertext block (CBC chain)
+#   6. Update IV and store plaintext
+# =====================================================
+.Lcbc_check_128:
+    @{[vle32_v $V24, $INP]}
+    addi $INP, $INP, 16
+    @{[vle32_v $V25, $INP]}
+    addi $INP, $INP, 16
+    @{[vle32_v $V26, $INP]}
+    addi $INP, $INP, 16
+    @{[vle32_v $V27, $INP]}
+    addi $INP, $INP, 16
+    @{[vle32_v $V28, $INP]}
+    addi $INP, $INP, 16
+    @{[vle32_v $V29, $INP]}
+    addi $INP, $INP, 16
+    @{[vle32_v $V30, $INP]}
+    addi $INP, $INP, 16
+    @{[vle32_v $V31, $INP]}
+    @{[vle32_v $V15, $INP]}
+    addi $INP, $INP, -16
+    @{[vle32_v $V23, $INP]}
+
+    @{[vaesz_vs $V24, $V11]}   # with round key w[40,43]
+    @{[vaesz_vs $V25, $V11]}   # with round key w[40,43]
+    @{[vaesz_vs $V26, $V11]}   # with round key w[40,43]
+    @{[vaesz_vs $V27, $V11]}   # with round key w[40,43]
+    @{[vaesz_vs $V28, $V11]}   # with round key w[40,43]
+    @{[vaesz_vs $V29, $V11]}   # with round key w[40,43]
+    @{[vaesz_vs $V30, $V11]}   # with round key w[40,43]
+    @{[vaesz_vs $V31, $V11]}   # with round key w[40,43]
+    addi $INP, $INP, -16
+    @{[vle32_v $V22, $INP]}
+    addi $INP, $INP, -16
+    @{[vle32_v $V21, $INP]}
+    addi $T0, $T0, -2
+4:
+    addi $KEYP, $KEYP, -16
+    @{[vle32_v $V11, $KEYP]}
+    @{[vaesdm_vs $V24, $V10]}  # with round key w[36,39]
+    @{[vaesdm_vs $V25, $V10]}  # with round key w[36,39]
+    @{[vaesdm_vs $V26, $V10]}  # with round key w[36,39]
+    @{[vaesdm_vs $V27, $V10]}  # with round key w[36,39]
+    @{[vaesdm_vs $V28, $V10]}  # with round key w[36,39]
+    @{[vaesdm_vs $V29, $V10]}  # with round key w[36,39]
+    @{[vaesdm_vs $V30, $V10]}  # with round key w[36,39]
+    @{[vaesdm_vs $V31, $V10]}  # with round key w[36,39]
+    addi $KEYP, $KEYP, -16
+    @{[vle32_v $V10, $KEYP]}
+    @{[vaesdm_vs $V24, $V11]}   # with round key w[32,35]
+    @{[vaesdm_vs $V25, $V11]}   # with round key w[32,35]
+    @{[vaesdm_vs $V26, $V11]}   # with round key w[32,35]
+    @{[vaesdm_vs $V27, $V11]}   # with round key w[32,35]
+    @{[vaesdm_vs $V28, $V11]}   # with round key w[32,35]
+    @{[vaesdm_vs $V29, $V11]}   # with round key w[32,35]
+    @{[vaesdm_vs $V30, $V11]}   # with round key w[32,35]
+    @{[vaesdm_vs $V31, $V11]}   # with round key w[32,35]
+    addi $T0, $T0, -2
+    bnez $T0, 4b
+    addi $KEYP, $KEYP, -16
+    @{[vle32_v $V11, $KEYP]}
+    addi $INP, $INP, -16
+    @{[vle32_v $V20, $INP]}
+    addi $INP, $INP, -16
+    @{[vle32_v $V19, $INP]}
+    addi $INP, $INP, -16
+    @{[vle32_v $V18, $INP]}
+    addi $INP, $INP, -16
+    @{[vle32_v $V17, $INP]}
+    @{[vaesdm_vs $V24, $V10]}   # with round key w[ 4, 7]
+    @{[vaesdm_vs $V25, $V10]}   # with round key w[ 4, 7]
+    @{[vaesdm_vs $V26, $V10]}   # with round key w[ 4, 7]
+    @{[vaesdm_vs $V27, $V10]}   # with round key w[ 4, 7]
+    @{[vaesdm_vs $V28, $V10]}   # with round key w[ 4, 7]
+    @{[vaesdm_vs $V29, $V10]}   # with round key w[ 4, 7]
+    @{[vaesdm_vs $V30, $V10]}   # with round key w[ 4, 7]
+    @{[vaesdm_vs $V31, $V10]}   # with round key w[ 4, 7]
+
+    @{[vaesdf_vs $V24, $V11]}   # with round key w[ 0, 3]
+    @{[vaesdf_vs $V25, $V11]}   # with round key w[ 0, 3]
+    @{[vaesdf_vs $V26, $V11]}   # with round key w[ 0, 3]
+    @{[vaesdf_vs $V27, $V11]}   # with round key w[ 0, 3]
+    @{[vaesdf_vs $V28, $V11]}   # with round key w[ 0, 3]
+    @{[vaesdf_vs $V29, $V11]}   # with round key w[ 0, 3]
+    @{[vaesdf_vs $V30, $V11]}   # with round key w[ 0, 3]
+    @{[vaesdf_vs $V31, $V11]}   # with round key w[ 0, 3]
+
+    @{[vxor_vv $V24, $V24, $V16]}
+    @{[vxor_vv $V25, $V25, $V17]}
+    @{[vxor_vv $V26, $V26, $V18]}
+    @{[vxor_vv $V27, $V27, $V19]}
+    @{[vxor_vv $V28, $V28, $V20]}
+    @{[vxor_vv $V29, $V29, $V21]}
+    @{[vxor_vv $V30, $V30, $V22]}
+    @{[vxor_vv $V31, $V31, $V23]}
+
+    @{[vse32_v $V24, $OUTP]}
+    addi $OUTP, $OUTP, 16
+    @{[vse32_v $V25, $OUTP]}
+    addi $OUTP, $OUTP, 16
+    @{[vse32_v $V26, $OUTP]}
+    addi $OUTP, $OUTP, 16
+    @{[vse32_v $V27, $OUTP]}
+    addi $OUTP, $OUTP, 16
+    @{[vse32_v $V28, $OUTP]}
+    addi $OUTP, $OUTP, 16
+    @{[vse32_v $V29, $OUTP]}
+    addi $OUTP, $OUTP, 16
+    @{[vse32_v $V30, $OUTP]}
+    addi $OUTP, $OUTP, 16
+    @{[vse32_v $V31, $OUTP]}
+    addi $OUTP, $OUTP, 16
+
+    @{[vmv_v_v $V16, $V15]}
+
+    addi $LEN, $LEN, -128
+    addi $INP, $INP, 128
+    bnez $LEN, .Lcbc_dec_loop
+    @{[vse32_v $V16, $IVP]}
+
     ret
 .size L_cbc_dec_128,.-L_cbc_dec_128
 ___
diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-s390x.pl b/deps/openssl/openssl/crypto/aes/asm/aes-s390x.pl
index 2345d4574a4..04a7a1cf616 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aes-s390x.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-s390x.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # AES for s390x.
@@ -131,7 +131,7 @@ sub _data_word()
 }

 $code=<<___;
-#include "s390x_arch.h"
+#include "arch/s390x_arch.h"

 .text

@@ -2279,7 +2279,7 @@ $code.=<<___;
 ___
 }
 $code.=<<___;
-.string	"AES for s390x, CRYPTOGAMS by <appro\@openssl.org>"
+.string	"AES for s390x, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 $code =~ s/\`([^\`]*)\`/eval $1/gem;
diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-sha1-armv8.pl b/deps/openssl/openssl/crypto/aes/asm/aes-sha1-armv8.pl
new file mode 100644
index 00000000000..65ee03a59f4
--- /dev/null
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-sha1-armv8.pl
@@ -0,0 +1,4324 @@
+#! /usr/bin/env perl
+
+# Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright (C) Cavium networks Ltd. 2016.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+#========================================================================
+# Derived from following files in
+# https://github.com/ARM-software/AArch64cryptolib
+# AArch64cryptolib_opt_big/aes_cbc_sha1/aes128cbc_sha1_hmac.S
+# AArch64cryptolib_opt_big/aes_cbc_sha1/sha1_hmac_aes128cbc_dec.S
+#========================================================================
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
+( $xlate="${dir}arm-xlate.pl" and -f $xlate ) or
+( $xlate="${dir}../../perlasm/arm-xlate.pl" and -f $xlate) or
+die "can't locate arm-xlate.pl";
+
+open OUT,"| \"$^X\" $xlate $flavour \"$output\""
+    or die "can't call $xlate: $!";
+*STDOUT=*OUT;
+
+$code=<<___;
+#include "arch/arm_arch.h"
+
+/* These are offsets into the CIPH_DIGEST struct */
+#define CIPHER_KEY	0
+#define CIPHER_KEY_ROUNDS	8
+#define CIPHER_IV	16
+#define HMAC_IKEYPAD	24
+#define HMAC_OKEYPAD	32
+
+.text
+.arch armv8-a+crypto
+___
+
+sub aes192_aes256_handle () {
+	my $compare = shift;
+	my $label = shift;
+	my $i = shift;
+	my $load_rk10 = shift;
+
+	if($compare == 1) {
+$code.=<<___;
+	cmp	x16,#12
+___
+	}
+$code.=<<___;
+	b.lt	.Laes128_${label}_$i
+.Laes192_${label}_$i:
+	ldp	q30,q31,[x17],32	/* rk[10],rk[11] */
+	aese	v$i.16b,v17.16b
+	aesmc	v$i.16b,v$i.16b
+	aese	v$i.16b,v30.16b
+	aesmc	v$i.16b,v$i.16b
+	b.gt	.Laes256_${label}_$i
+	ld1	{v30.16b},[x17]		/* rk[12] */
+	aese	v$i.16b,v31.16b
+	eor	v$i.16b,v$i.16b,v30.16b
+	sub	x17, x17, #32		/* rewind x17 */
+	b	1f
+.Laes256_${label}_$i:
+	aese	v$i.16b,v31.16b
+	aesmc	v$i.16b,v$i.16b
+	ldp	q30,q31,[x17],32	/* rk[12],rk[13] */
+	aese	v$i.16b,v30.16b
+	aesmc	v$i.16b,v$i.16b
+	ld1	{v30.16b},[x17]		/* rk[14] */
+	aese	v$i.16b,v31.16b
+	eor	v$i.16b,v$i.16b,v30.16b
+	sub	x17, x17, #64		/* rewind x17 */
+	b	1f
+.Laes128_${label}_$i:
+___
+	if ($load_rk10 == 1) {
+$code.=<<___;
+	ld1	{v18.16b},[x9]
+___
+	}
+$code.=<<___;
+	aese	v$i.16b,v17.16b
+	eor	v$i.16b,v$i.16b,v18.16b	/* res 0 */
+1:
+___
+}
+
+sub aes192_aes256_dec_handle () {
+	my $compare = shift;
+	my $label = shift;
+	my $i = shift;
+	my $load_rk10 = shift;
+
+	if($compare == 1) {
+$code.=<<___;
+	cmp	x16,#12
+___
+	}
+$code.=<<___;
+	b.lt	.Laes128_${label}_$i
+.Laes192_${label}_$i:
+	stp	q19,q23,[sp, #-32]!
+	ld1	{v19.16b},[x17],16	/* rk[10] */
+	ld1	{v23.16b},[x17],16	/* rk[11] */
+	aesd	v$i.16b,v17.16b
+	aesimc	v$i.16b,v$i.16b
+	aesd	v$i.16b,v19.16b
+	aesimc	v$i.16b,v$i.16b
+	b.gt	.Laes256_${label}_$i
+	ld1	{v19.16b},[x17]		/* rk[12] */
+	aesd	v$i.16b,v23.16b
+	eor	v$i.16b,v$i.16b,v19.16b
+	sub	x17, x17, #32		/* rewind x17 */
+	ldp	q19,q23,[sp], #32
+	b	1f
+.Laes256_${label}_$i:
+	aesd	v$i.16b,v23.16b
+	aesimc	v$i.16b,v$i.16b
+	ld1	{v19.16b},[x17],16	/* rk[12] */
+	ld1	{v23.16b},[x17],16	/* rk[13] */
+	aesd	v$i.16b,v19.16b
+	aesimc	v$i.16b,v$i.16b
+	ld1	{v19.16b},[x17]		/* rk[14] */
+	aesd	v$i.16b,v23.16b
+	eor	v$i.16b,v$i.16b,v19.16b
+	sub	x17, x17, #64		/* rewind x17 */
+	ldp	q19,q23,[sp], #32
+	b	1f
+.Laes128_${label}_$i:
+___
+	if ($load_rk10 == 1) {
+$code.=<<___;
+	ld1	{v18.16b},[x9]
+___
+	}
+$code.=<<___;
+	aesd	v$i.16b,v17.16b
+	eor	v$i.16b,v$i.16b,v18.16b	/* res 0 */
+1:
+___
+}
+
+$code.=<<___;
+/*
+ * Description:
+ *
+ * Combined Enc/Auth Primitive = aes128cbc/sha1_hmac
+ *
+ * Operations:
+ *
+ * out = encrypt-AES128CBC(in)
+ * return_hash_ptr = SHA1(o_key_pad | SHA1(i_key_pad | out))
+ *
+ * Prototype:
+ * int asm_aescbc_sha1_hmac(uint8_t *csrc, uint8_t *cdst, uint64_t clen,
+ *			uint8_t *dsrc, uint8_t *ddst, uint64_t dlen,
+ *			CIPH_DIGEST *arg)
+ *
+ * Registers used:
+ *
+ * asm_aescbc_sha1_hmac(
+ *	csrc,	x0	(cipher src address)
+ *	cdst,	x1	(cipher dst address)
+ *	clen	x2	(cipher length)
+ *	dsrc,	x3	(digest src address)
+ *	ddst,	x4	(digest dst address)
+ *	dlen,	x5	(digest length)
+ *	arg	x6:
+ *		arg->cipher.key			(round keys)
+ *		arg->cipher.key_rounds		(key rounds)
+ *		arg->cipher.iv			(initialization vector)
+ *		arg->digest.hmac.i_key_pad	(partially hashed i_key_pad)
+ *		arg->digest.hmac.o_key_pad	(partially hashed o_key_pad)
+ *	)
+ *
+ * Routine register definitions:
+ *
+ * v0 - v3 -- aes results
+ * v4 - v7 -- round consts for sha
+ * v8 - v18 -- round keys
+ * v19 -- temp register for SHA1
+ * v20 -- ABCD copy (q20)
+ * v21 -- sha working state (q21)
+ * v22 -- sha working state (q22)
+ * v23 -- temp register for SHA1
+ * v24 -- sha state ABCD
+ * v25 -- sha state E
+ * v26 -- sha block 0
+ * v27 -- sha block 1
+ * v28 -- sha block 2
+ * v29 -- sha block 3
+ * v30 -- reserved
+ * v31 -- reserved
+ *
+ * Constraints:
+ *
+ * The variable "clen" must be a multiple of 16, otherwise results are not
+ * defined. For AES partial blocks the user is required to pad the input
+ * to modulus 16 = 0.
+ * The variable "dlen" must be a multiple of 8 and greater or equal
+ * to "clen". This constraint is strictly related to the needs of the IPSec
+ * ESP packet. Encrypted payload is hashed along with the 8 byte ESP header,
+ * forming ICV. Speed gain is achieved by doing both things at the same time,
+ * hence lengths are required to match at least at the cipher level.
+ *
+ * Short lengths are not optimized at < 12 AES blocks
+ */
+
+.global asm_aescbc_sha1_hmac
+.type	asm_aescbc_sha1_hmac,%function
+
+.rodata
+.align	4
+.Lrcon:
+	.word	0x5a827999, 0x5a827999, 0x5a827999, 0x5a827999
+	.word	0x6ed9eba1, 0x6ed9eba1, 0x6ed9eba1, 0x6ed9eba1
+	.word	0x8f1bbcdc, 0x8f1bbcdc, 0x8f1bbcdc, 0x8f1bbcdc
+	.word	0xca62c1d6, 0xca62c1d6, 0xca62c1d6, 0xca62c1d6
+.text
+
+.align	4
+asm_aescbc_sha1_hmac:
+	AARCH64_VALID_CALL_TARGET
+	/* protect registers */
+	stp		d8,d9,[sp,#-64]!
+	/* fetch args */
+	ldr		x7, [x6, #HMAC_IKEYPAD]
+	/* init ABCD, E */
+	ldr		q24, [x7]
+	eor		v25.16b, v25.16b, v25.16b
+	ldr		s25, [x7, #16]
+	/* save pointer to o_key_pad partial hash */
+	ldr		x7, [x6, #HMAC_OKEYPAD]
+
+	stp		d10,d11,[sp,#16]
+
+	prfm		PLDL1KEEP,[x0,0]	/* pref next aes_ptr_in */
+	prfm		PLDL1KEEP,[x1,0]	/* pref next aes_ptr_out */
+	lsr		x10,x2,4		/* aes_blocks = len/16 */
+
+	stp		d12,d13,[sp,#32]
+	stp		d14,d15,[sp,#48]
+
+	ldr		x9, [x6, #CIPHER_KEY]
+	ldr		x16, [x6, #CIPHER_KEY_ROUNDS]
+	ldr		x6, [x6, #CIPHER_IV]
+	add		x17, x9, #160		/* point to the last 5 rounds keys */
+
+	/*
+	 * init sha state, prefetch, check for small cases.
+	 * Note that the output is prefetched as a load, for the in-place case
+ 	*/
+	cmp		x10,12			/* no main loop if <12 */
+	b.lt		.Lenc_short_cases	/* branch if < 12 */
+
+	/* proceed */
+	ld1		{v3.16b},[x6]		/* get 1st ivec */
+	/* read first aes block, bump aes_ptr_in */
+	ld1		{v0.16b},[x0],16
+	mov		x11,x2			/* len -> x11 needed at end */
+	lsr		x12,x11,6		/* total_blocks */
+	/*
+ 	 * now we can do the loop prolog, 1st aes sequence of 4 blocks
+ 	 */
+	ldp		q8,q9,[x9],32		/* rk[0],rk[1] */
+	eor		v0.16b,v0.16b,v3.16b	/* xor w/ ivec (modeop) */
+
+	/* aes xform 0 */
+	aese		v0.16b,v8.16b
+	aesmc		v0.16b,v0.16b
+	ldp		q10,q11,[x9],32		/* rk[2],rk[3] */
+	prfm		PLDL1KEEP,[x0,64]	/* pref next aes_ptr_in */
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+	aese		v0.16b,v9.16b
+	aesmc		v0.16b,v0.16b
+	prfm		PLDL1KEEP,[x1,64]	/* pref next aes_ptr_out  */
+	ldp		q12,q13,[x9],32		/* rk[4],rk[5] */
+	aese		v0.16b,v10.16b
+	aesmc		v0.16b,v0.16b
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v1.16b},[x0],16
+	aese		v0.16b,v11.16b
+	aesmc		v0.16b,v0.16b
+	ldp		q14,q15,[x9],32		/* rk[6],rk[7] */
+	aese		v0.16b,v12.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v13.16b
+	aesmc		v0.16b,v0.16b
+	ldp		q16,q17,[x9],32		/* rk[8],rk[9] */
+	aese		v0.16b,v14.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v15.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v16.16b
+	aesmc		v0.16b,v0.16b
+___
+	&aes192_aes256_handle(1, "enc_prolog", 0, 1);
+$code.=<<___;
+	eor		v1.16b,v1.16b,v0.16b	/* xor w/ ivec (modeop) */
+
+	/* aes xform 1 */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v2.16b},[x0],16
+	aese		v1.16b,v8.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v9.16b
+	aesmc		v1.16b,v1.16b
+	prfm		PLDL1KEEP,[x8,0*64]	/* rcon */
+	aese		v1.16b,v10.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v11.16b
+	aesmc		v1.16b,v1.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v0.16b},[x1],16
+	ld1		{v26.16b},[x3],16
+	prfm		PLDL1KEEP,[x8,2*64]	/* rcon */
+	aese		v1.16b,v12.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v13.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v14.16b
+	aesmc		v1.16b,v1.16b
+	prfm		PLDL1KEEP,[x8,4*64]	/* rcon */
+	aese		v1.16b,v15.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v16.16b
+	aesmc		v1.16b,v1.16b
+	prfm		PLDL1KEEP,[x8,6*64]	/* rcon */
+___
+	&aes192_aes256_handle(0, "enc_prolog", 1, 0);
+$code.=<<___;
+	prfm		PLDL1KEEP,[x8,8*64]	/* rcon */
+	eor		v2.16b,v2.16b,v1.16b	/* xor w/ivec (modeop) */
+
+	/* aes xform 2 */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v3.16b},[x0],16
+	aese		v2.16b,v8.16b
+	aesmc		v2.16b,v2.16b
+	mov		x9,x0			/* lead_ptr = aes_ptr_in */
+	aese		v2.16b,v9.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v10.16b
+	aesmc		v2.16b,v2.16b
+	prfm		PLDL1KEEP,[x8,10*64]	/* rcon */
+	aese		v2.16b,v11.16b
+	aesmc		v2.16b,v2.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v1.16b},[x1],16
+	ld1		{v27.16b},[x3],16
+	aese		v2.16b,v12.16b
+	aesmc		v2.16b,v2.16b
+	prfm		PLDL1KEEP,[x8,12*64]	/* rcon */
+	aese		v2.16b,v13.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v14.16b
+	aesmc		v2.16b,v2.16b
+	prfm		PLDL1KEEP,[x8,14*64]	/* rcon */
+	aese		v2.16b,v15.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v16.16b
+	aesmc		v2.16b,v2.16b
+___
+	&aes192_aes256_handle(0, "enc_prolog", 2, 0);
+$code.=<<___;
+	eor		v3.16b,v3.16b,v2.16b	/* xor w/ ivec (modeop) */
+
+	/* aes xform 3 */
+	aese		v3.16b,v8.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v9.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v10.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v11.16b
+	aesmc		v3.16b,v3.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v2.16b},[x1],16
+	ld1		{v28.16b},[x3],16
+	aese		v3.16b,v12.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v13.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v14.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v15.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v16.16b
+	aesmc		v3.16b,v3.16b
+	/* main_blocks = total_blocks - 1 */
+	sub		x15,x12,1
+	and		x13,x10,3		/* aes_blocks_left */
+___
+	&aes192_aes256_handle(0, "enc_prolog", 3, 0);
+$code.=<<___;
+    ldp		q4,q5,[x8],32		/* key0,key1 */
+	/*
+	 * Note, aes_blocks_left := number after
+	 * the main (sha) block is done. Can be 0
+	 */
+
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+	ld1		{v29.16b},[x3],16
+
+	ldp		q6,q7,[x8]		/* key2,key3 */
+
+	/* get outstanding bytes of the digest */
+	sub		x8,x5,x2
+	/* subtract loaded bytes */
+	sub		x5,x5,64
+	/*
+	 * main combined loop CBC
+	 */
+.Lenc_main_loop:
+	/*
+	 * because both mov, rev32 and eor have a busy cycle, this takes longer
+	 * than it looks.
+	 * That's OK since there are 6 cycles before we can use the load anyway;
+	 * so this goes as fast as it can without SW pipelining (too complicated
+	 * given the code size)
+	 */
+	rev32		v26.16b,v26.16b
+	/* next aes block, update aes_ptr_in */
+	ld1		{v0.16b},[x0],16
+	mov		v20.16b,v24.16b		/* working ABCD <- ABCD */
+	prfm		PLDL1KEEP,[x9,64]	/* pref next lead_ptr */
+	rev32		v27.16b,v27.16b
+	/* pref next aes_ptr_out, streaming  */
+	prfm		PLDL1KEEP,[x1,64]
+	eor		v0.16b,v0.16b,v3.16b	/* xor w/ prev value */
+
+	/* aes xform 0, sha quad 0 */
+	aese		v0.16b,v8.16b
+	aesmc		v0.16b,v0.16b
+	rev32		v28.16b,v28.16b
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v1.16b},[x0],16
+	aese		v0.16b,v9.16b
+	aesmc		v0.16b,v0.16b
+	add		v19.4s,v4.4s,v26.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	aese		v0.16b,v10.16b
+	aesmc		v0.16b,v0.16b
+	sha1h		s22,s24
+	aese		v0.16b,v11.16b
+	aesmc		v0.16b,v0.16b
+	add		v23.4s,v4.4s,v27.4s
+	/* no place to get rid of this stall */
+	rev32		v29.16b,v29.16b
+	sha1c		q24,s25,v19.4s
+	aese		v0.16b,v12.16b
+	aesmc		v0.16b,v0.16b
+	sha1su1		v26.4s,v29.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+	aese		v0.16b,v13.16b
+	aesmc		v0.16b,v0.16b
+	sha1h		s21,s24
+	add		v19.4s,v4.4s,v28.4s
+	sha1c		q24,s22,v23.4s
+	aese		v0.16b,v14.16b
+	aesmc		v0.16b,v0.16b
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v27.4s,v26.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	aese		v0.16b,v15.16b
+	aesmc		v0.16b,v0.16b
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	aese		v0.16b,v16.16b
+	aesmc		v0.16b,v0.16b
+	sha1su1		v28.4s,v27.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+___
+    &aes192_aes256_handle(1, "enc_mainloop", 0, 0);
+$code.=<<___;
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	sha1su1		v26.4s,v29.4s
+	/* aes xform 1, sha quad 1 */
+	eor		v1.16b,v1.16b,v0.16b	/* mode op 1 xor w/prev value */
+	/* save aes res, bump aes_out_ptr */
+	st1		{v0.16b},[x1],16
+	aese		v1.16b,v8.16b
+	aesmc		v1.16b,v1.16b
+	add		v19.4s,v5.4s,v28.4s
+	aese		v1.16b,v9.16b
+	aesmc		v1.16b,v1.16b
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	aese		v1.16b,v10.16b
+	aesmc		v1.16b,v1.16b
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v2.16b},[x0],16
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v27.4s,v26.4s
+	aese		v1.16b,v11.16b
+	aesmc		v1.16b,v1.16b
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	aese		v1.16b,v12.16b
+	aesmc		v1.16b,v1.16b
+	sha1p		q24,s21,v19.4s
+	sha1su1		v28.4s,v27.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	aese		v1.16b,v13.16b
+	aesmc		v1.16b,v1.16b
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	aese		v1.16b,v14.16b
+	aesmc		v1.16b,v1.16b
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+	add		x9,x9,64		/* bump lead_ptr */
+	sha1su0		v26.4s,v27.4s,v28.4s
+	aese		v1.16b,v15.16b
+	aesmc		v1.16b,v1.16b
+	sha1h		s22,s24
+	add		v23.4s,v5.4s,v27.4s
+	sha1p		q24,s21,v19.4s
+	aese		v1.16b,v16.16b
+	aesmc		v1.16b,v1.16b
+	sha1su1		v26.4s,v29.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+___
+    &aes192_aes256_handle(0, "enc_mainloop", 1, 0);
+$code.=<<___;
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v27.4s,v26.4s
+
+	/* mode op 2 */
+	eor		v2.16b,v2.16b,v1.16b	/* mode of 2 xor w/prev value */
+
+	/* aes xform 2, sha quad 2 */
+	aese		v2.16b,v8.16b
+	aesmc		v2.16b,v2.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v1.16b},[x1],16
+
+	add		v19.4s,v6.4s,v28.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	aese		v2.16b,v9.16b
+	aesmc		v2.16b,v2.16b
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	aese		v2.16b,v10.16b
+	aesmc		v2.16b,v2.16b
+	sha1su1		v28.4s,v27.4s
+	aese		v2.16b,v11.16b
+	aesmc		v2.16b,v2.16b
+	add		v19.4s,v6.4s,v26.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	aese		v2.16b,v12.16b
+	aesmc		v2.16b,v2.16b
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	aese		v2.16b,v13.16b
+	aesmc		v2.16b,v2.16b
+	sha1su1		v29.4s,v28.4s
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v3.16b},[x0],16
+	aese		v2.16b,v14.16b
+	aesmc		v2.16b,v2.16b
+	add		v23.4s,v6.4s,v27.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	aese		v2.16b,v15.16b
+	aesmc		v2.16b,v2.16b
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	aese		v2.16b,v16.16b
+	aesmc		v2.16b,v2.16b
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v26.4s,v29.4s
+___
+    &aes192_aes256_handle(0, "enc_mainloop", 2, 0);
+$code.=<<___;
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v27.4s,v26.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+
+	/* mode op 3 */
+	eor		v3.16b,v3.16b,v2.16b	/* xor w/prev value */
+
+	sha1su1		v28.4s,v27.4s
+
+	/* aes xform 3, sha quad 3 */
+	aese		v3.16b,v8.16b
+	aesmc		v3.16b,v3.16b
+	sha1su0		v29.4s,v26.4s,v27.4s
+	/* save aes res, bump aes_out_ptr */
+	st1		{v2.16b},[x1],16
+	aese		v3.16b,v9.16b
+	aesmc		v3.16b,v3.16b
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	aese		v3.16b,v10.16b
+	aesmc		v3.16b,v3.16b
+	sha1su1		v29.4s,v28.4s
+	add		v19.4s,v7.4s,v26.4s
+	aese		v3.16b,v11.16b
+	aesmc		v3.16b,v3.16b
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	aese		v3.16b,v12.16b
+	aesmc		v3.16b,v3.16b
+	add		v23.4s,v7.4s,v27.4s
+	aese		v3.16b,v13.16b
+	aesmc		v3.16b,v3.16b
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	aese		v3.16b,v14.16b
+	aesmc		v3.16b,v3.16b
+	sub		x15,x15,1		/* dec block count */
+	add		v19.4s,v7.4s,v28.4s
+	aese		v3.16b,v15.16b
+	aesmc		v3.16b,v3.16b
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	aese		v3.16b,v16.16b
+	aesmc		v3.16b,v3.16b
+	add		v23.4s,v7.4s,v29.4s
+___
+    &aes192_aes256_handle(0, "enc_mainloop", 3, 0);
+$code.=<<___;
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	ldp		q26,q27,[x3],32
+
+	add		v25.4s,v25.4s,v21.4s
+	add		v24.4s,v24.4s,v20.4s
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+
+	ldp		q28,q29,[x3],32
+
+	sub		x5,x5,64
+	cbnz		x15,.Lenc_main_loop	/* loop if more to do */
+
+	mov		w15,0x80		/* that's the 1 of the pad */
+	/*
+	 * epilog, process remaining aes blocks and b-2 sha block
+	 * do this inline (no loop) to overlap with the sha part
+	 * note there are 0-3 aes blocks left.
+	 */
+	rev32		v26.16b,v26.16b		/* fix endian w0 */
+	rev32		v27.16b,v27.16b		/* fix endian w1 */
+	rev32		v28.16b,v28.16b		/* fix endian w2 */
+	rev32		v29.16b,v29.16b		/* fix endian w3 */
+	mov		v20.16b,v24.16b		/* working ABCD <- ABCD */
+	cbz		x13, .Lbm2fromQ0	/* skip if none left */
+
+	/*
+	 * mode op 0
+	 * read next aes block, update aes_ptr_in
+	 */
+	ld1		{v0.16b},[x0],16
+	eor		v0.16b,v0.16b,v3.16b	/* xor w/ prev value */
+
+	/* aes xform 0, sha quad 0 */
+	add		v19.4s,v4.4s,v26.4s
+	aese		v0.16b,v8.16b
+	aesmc		v0.16b,v0.16b
+	add		v23.4s,v4.4s,v27.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	aese		v0.16b,v9.16b
+	aesmc		v0.16b,v0.16b
+	sha1h		s22,s24
+	sha1c		q24,s25,v19.4s
+	aese		v0.16b,v10.16b
+	aesmc		v0.16b,v0.16b
+	sha1su1		v26.4s,v29.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+	aese		v0.16b,v11.16b
+	aesmc		v0.16b,v0.16b
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	aese		v0.16b,v12.16b
+	aesmc		v0.16b,v0.16b
+	sha1su1		v27.4s,v26.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	aese		v0.16b,v13.16b
+	aesmc		v0.16b,v0.16b
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	aese		v0.16b,v14.16b
+	aesmc		v0.16b,v0.16b
+	sha1su1		v28.4s,v27.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	aese		v0.16b,v15.16b
+	aesmc		v0.16b,v0.16b
+	sha1h		s21,s24
+	aese		v0.16b,v16.16b
+	aesmc		v0.16b,v0.16b
+	sha1c		q24,s22,v23.4s
+	sha1su1		v29.4s,v28.4s
+___
+    &aes192_aes256_handle(1, "enc_epilog", 0, 0);
+$code.=<<___;
+	/* local copy of aes_blocks_left */
+	subs		x14,x13,1
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+	/* save aes res, bump aes_out_ptr */
+	st1		{v0.16b},[x1],16
+	/* if aes_blocks_left_count == 0 */
+	beq		.Lbm2fromQ1
+	/*
+	 * mode op 1
+	 * read next aes block, update aes_ptr_in
+	 */
+	ld1		{v1.16b},[x0],16
+
+	eor		v1.16b,v1.16b,v0.16b	/* xor w/ prev value */
+
+	/* aes xform 1, sha quad 1 */
+	aese		v1.16b,v8.16b
+	aesmc		v1.16b,v1.16b
+	add		v19.4s,v5.4s,v28.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+	aese		v1.16b,v9.16b
+	aesmc		v1.16b,v1.16b
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	aese		v1.16b,v10.16b
+	aesmc		v1.16b,v1.16b
+	sha1su1		v27.4s,v26.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	aese		v1.16b,v11.16b
+	aesmc		v1.16b,v1.16b
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	aese		v1.16b,v12.16b
+	aesmc		v1.16b,v1.16b
+	sha1su1		v28.4s,v27.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	aese		v1.16b,v13.16b
+	aesmc		v1.16b,v1.16b
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	aese		v1.16b,v14.16b
+	aesmc		v1.16b,v1.16b
+	sha1su1		v29.4s,v28.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	aese		v1.16b,v15.16b
+	aesmc		v1.16b,v1.16b
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	aese		v1.16b,v16.16b
+	aesmc		v1.16b,v1.16b
+	sha1su1		v26.4s,v29.4s
+___
+	&aes192_aes256_handle(1, "enc_epilog", 1, 0);
+$code.=<<___;
+	subs		x14,x14,1		/* dec counter */
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+	/* save aes res, bump aes_out_ptr */
+	st1		{v1.16b},[x1],16
+	/* if aes_blocks_left_count == 0 */
+	beq		.Lbm2fromQ2
+
+	/*
+	 * mode op 2
+	 * read next aes block, update aes_ptr_in
+	 */
+	ld1		{v2.16b},[x0],16
+	eor		v2.16b,v2.16b,v1.16b	/* xor w/ prev value */
+
+	/* aes xform 2, sha quad 2 */
+	aese		v2.16b,v8.16b
+	aesmc		v2.16b,v2.16b
+	add		v23.4s,v6.4s,v29.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	aese		v2.16b,v9.16b
+	aesmc		v2.16b,v2.16b
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	aese		v2.16b,v10.16b
+	aesmc		v2.16b,v2.16b
+	sha1su1		v28.4s,v27.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	aese		v2.16b,v11.16b
+	aesmc		v2.16b,v2.16b
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	aese		v2.16b,v12.16b
+	aesmc		v2.16b,v2.16b
+	sha1su1		v29.4s,v28.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	aese		v2.16b,v13.16b
+	aesmc		v2.16b,v2.16b
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	aese		v2.16b,v14.16b
+	aesmc		v2.16b,v2.16b
+	sha1su1		v26.4s,v29.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+	aese		v2.16b,v15.16b
+	aesmc		v2.16b,v2.16b
+	sha1h		s21,s24
+	aese		v2.16b,v16.16b
+	aesmc		v2.16b,v2.16b
+	sha1m		q24,s22,v23.4s
+	sha1su1		v27.4s,v26.4s
+___
+	&aes192_aes256_handle(1, "enc_epilog", 2, 0);
+$code.=<<___;
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+	/* save aes res, bump aes_out_ptr */
+	st1		{v2.16b},[x1],16
+	/* join common code at Quad 3 */
+	b		.Lbm2fromQ3
+
+	/*
+	 * now there is the b-2 sha block before the final one. Execution takes over
+	 * in the appropriate part of this depending on how many aes blocks were left.
+	 * If there were none, the whole thing is executed.
+	 */
+.Lbm2fromQ0:
+	add		v19.4s,v4.4s,v26.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s25,v19.4s
+	add		v23.4s,v4.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+.Lbm2fromQ1:
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+.Lbm2fromQ2:
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+.Lbm2fromQ3:
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v23.4s,v7.4s,v27.4s
+	sha1h		s21,s24
+	eor		v26.16b,v26.16b,v26.16b		/* zero reg */
+	sha1p		q24,s22,v23.4s
+
+	add		v19.4s,v7.4s,v28.4s
+	sha1h		s22,s24
+	eor		v27.16b,v27.16b,v27.16b		/* zero reg */
+	sha1p		q24,s21,v19.4s
+
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s21,s24
+	eor		v28.16b,v28.16b,v28.16b		/* zero reg */
+	sha1p		q24,s22,v23.4s
+
+	add		v25.4s,v25.4s,v21.4s
+	add		v24.4s,v24.4s,v20.4s
+
+	/* Process remaining 0-3 AES blocks here */
+	eor		v29.16b,v29.16b,v29.16b		/* zero sha src 3 */
+
+	cbz		x13,.Lpost_long_Q0
+
+	/* 1st remaining AES block */
+	ld1		{v26.16b},[x3],16
+	sub		x5,x5,16
+	rev32		v26.16b,v26.16b
+	subs		x14,x13,1
+	b.eq		.Lpost_long_Q1
+
+	/* 2nd remaining AES block */
+	ld1		{v27.16b},[x3],16
+	sub		x5,x5,16
+	rev32		v27.16b,v27.16b
+	subs		x14,x14,1
+	b.eq		.Lpost_long_Q2
+
+	/* 3rd remaining AES block */
+	ld1		{v28.16b},[x3],16
+	sub		x5,x5,16
+	rev32		v28.16b,v28.16b
+	/* Allow for filling this sha1 block with the remaining digest src */
+	b		.Lpost_long_Q3
+	/*
+	 * Process remaining 8B blocks of the digest
+	 */
+.Lpost_long_Q0:
+	/* blk 0,1 */
+	/* assume final block */
+	mov		v26.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_long_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v26 value (0x80) */
+	mov		v26.d[0],x2
+	/* assume this was final block */
+	mov		v26.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_long_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	mov		v26.d[1],x2
+
+.Lpost_long_Q1:
+	/* blk 2,3 */
+	/* assume this is final block */
+	mov		v27.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_long_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v27 value (0x80) */
+	mov		v27.d[0],x2
+	/* assume this was final block */
+	mov		v27.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_long_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	mov		v27.d[1],x2
+
+.Lpost_long_Q2:
+	/* blk 4,5 */
+	/* assume this was final block */
+	mov		v28.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_long_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v28 value (0x80) */
+	mov		v28.d[0],x2
+	/* assume this was final block */
+	mov		v28.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_long_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	mov		v28.d[1],x2
+
+.Lpost_long_Q3:
+	/* blk 6,7 */
+	/* assume this was final block */
+	mov		v29.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_long_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v29 value (0x80) */
+	mov		v29.d[0],x2
+	/* assume this was final block */
+	mov		v29.b[11],w15
+	/*
+	 * Outstanding 8B blocks left.
+	 * Since there has to be another sha block with padding,
+	 * we need to calculate hash without padding here.
+	 */
+	cbz		x5,1f
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	rev32		x2,x2
+	/*
+	 * Don't decrease x5 here.
+	 * Use it to indicate necessity of constructing "1" padding at the end.
+	 */
+	mov		v29.d[1],x2
+	/*
+	 * That is enough of blocks, we allow up to 64 bytes in total.
+	 * Now we have the sha1 to do for these 4 16B blocks
+	 */
+1:
+	mov		v20.16b,v24.16b		/* working ABCD <- ABCD */
+	add		v19.4s,v4.4s,v26.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s25,v19.4s
+	add		v23.4s,v4.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v23.4s,v7.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v19.4s,v7.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v25.4s,v25.4s,v21.4s
+	add		v24.4s,v24.4s,v20.4s
+
+	eor		v26.16b,v26.16b,v26.16b		/* zero sha src 0 */
+	eor		v27.16b,v27.16b,v27.16b		/* zero sha src 1 */
+	eor		v28.16b,v28.16b,v28.16b		/* zero sha src 2 */
+	eor		v29.16b,v29.16b,v29.16b		/* zero sha src 3 */
+
+	/* this was final block */
+	cbz		x5,.Lpost_long_loop
+	subs		x5,x5,8
+	/* loop if hash is not finished */
+	b.ne		.Lpost_long_Q0
+	/* set "1" of the padding if this was a final block */
+	mov		v26.b[3],w15
+
+.Lpost_long_loop:
+	/* Add outstanding bytes of digest source */
+	add		x11,x11,x8
+	/* Add one SHA-1 block since hash is calculated including i_key_pad */
+	add		x11,x11, #64
+	lsr		x12,x11,32			/* len_hi */
+	and		x13,x11,0xffffffff		/* len_lo */
+	lsl		x12,x12,3			/* len_hi in bits */
+	lsl		x13,x13,3			/* len_lo in bits */
+
+	mov		v29.s[3],w13			/* len_lo */
+	mov		v29.s[2],w12			/* len_hi */
+
+	/* do last sha of pad block */
+	mov		v20.16b,v24.16b			/* working ABCD <- ABCD */
+	add		v19.4s,v4.4s,v26.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s25,v19.4s
+	add		v23.4s,v4.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v23.4s,v7.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v19.4s,v7.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v26.4s,v24.4s,v20.4s
+	add		v27.4s,v25.4s,v21.4s
+
+	/* Calculate final HMAC */
+	eor		v28.16b, v28.16b, v28.16b
+	eor		v29.16b, v29.16b, v29.16b
+	/* load o_key_pad partial hash */
+	ldr		q24, [x7]
+	eor		v25.16b, v25.16b, v25.16b
+	ldr		s25, [x7, #16]
+
+	mov		v20.16b,v24.16b		/* working ABCD <- ABCD */
+
+	/* Set padding 1 to the first reg */
+	mov		w11, #0x80		/* that's the 1 of the pad */
+	mov		v27.b[7], w11
+
+	mov		x11, #64+20		/* size of o_key_pad + inner hash */
+	lsl		x11, x11, 3
+	/* move length to the end of the block */
+	mov		v29.s[3], w11
+	lsr		x11, x11, 32
+	mov		v29.s[2], w11		/* and the higher part */
+
+	add		v19.4s,v4.4s,v26.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s25,v19.4s
+	add		v23.4s,v4.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v23.4s,v7.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v19.4s,v7.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	ldp		d10,d11,[sp,#16]
+	ldp		d12,d13,[sp,#32]
+
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	ldp		d14,d15,[sp,#48]
+	ldp		d8,d9,[sp],#64
+
+	mov		x0, xzr
+
+	add		v24.4s,v24.4s,v20.4s
+	add		v25.4s,v25.4s,v21.4s
+	rev32		v24.16b, v24.16b
+	rev32		v25.16b, v25.16b
+
+	st1		{v24.16b}, [x4],16
+	st1		{v25.s}[0], [x4]
+
+	ret
+
+/*
+ * These are the short cases (less efficient), here used for 1-11 aes blocks.
+ * x10 = aes_blocks
+ */
+.Lenc_short_cases:
+	ldp		q8,q9,[x9],32
+	adrp		x8,.Lrcon			/* rcon */
+	add		x8,x8,:lo12:.Lrcon
+	mov		w15,0x80			/* sha padding word */
+	ldp		q10,q11,[x9],32
+	lsl		x11,x10,4			/* len = aes_blocks*16 */
+	eor		v26.16b,v26.16b,v26.16b		/* zero sha src 0 */
+	ldp		q12,q13,[x9],32
+	eor		v27.16b,v27.16b,v27.16b		/* zero sha src 1 */
+	eor		v28.16b,v28.16b,v28.16b		/* zero sha src 2 */
+	ldp		q14,q15,[x9],32
+	eor		v29.16b,v29.16b,v29.16b		/* zero sha src 3 */
+	ldp		q4,q5,[x8],32			/* key0, key1 */
+	ldp		q16,q17,[x9],32
+	ld1		{v3.16b},[x6]			/* get ivec */
+	ldp		q6,q7,[x8]			/* key2, key3 */
+	/* get outstanding bytes of the digest */
+	sub		x8,x5,x2
+	/*
+	 * the idea in the short loop (at least 1) is to break out with the padding
+	 * already in place excepting the final word.
+	 */
+.Lenc_short_loop:
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v0.16b},[x0],16
+	eor		v0.16b,v0.16b,v3.16b		/* xor w/ prev value */
+
+	/* aes xform 0 */
+	aese		v0.16b,v8.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v9.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v10.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v11.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v12.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v13.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v14.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v15.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v16.16b
+	aesmc		v0.16b,v0.16b
+___
+    &aes192_aes256_handle(1, "enc_short", 0, 1);
+$code.=<<___;
+	/* save aes res, bump aes_out_ptr */
+	st1		{v0.16b},[x1],16
+	/* load next 16 bytes for SHA-1 */
+	ld1		{v26.16b},[x3],16
+	/* dec number of bytes of the hash input */
+	sub		x5,x5,16
+	sub		x10,x10,1			/* dec num_blocks */
+	/* load res to sha 0, endian swap */
+	rev32	v26.16b,v26.16b
+	cbz		x10,.Lpost_short_Q1		/* break if no more */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v1.16b},[x0],16
+	eor		v1.16b,v1.16b,v0.16b		/* xor w/ prev value */
+
+	/* aes xform 1 */
+	aese		v1.16b,v8.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v9.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v10.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v11.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v12.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v13.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v14.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v15.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v16.16b
+	aesmc		v1.16b,v1.16b
+___
+    &aes192_aes256_handle(1, "enc_short", 1, 0);
+$code.=<<___;
+	/* save aes res, bump aes_out_ptr */
+	st1		{v1.16b},[x1],16
+	/* load next 16 bytes for SHA-1 */
+	ld1		{v27.16b},[x3],16
+	/* dec number of bytes of the hash input */
+	sub		x5,x5,16
+	sub		x10,x10,1			/* dec num_blocks */
+	/* load res to sha 0, endian swap */
+	rev32	v27.16b,v27.16b
+	cbz		x10,.Lpost_short_Q2		/* break if no more */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v2.16b},[x0],16
+	eor		v2.16b,v2.16b,v1.16b		/* xor w/ prev value */
+
+	/* aes xform 2 */
+	aese		v2.16b,v8.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v9.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v10.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v11.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v12.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v13.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v14.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v15.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v16.16b
+	aesmc		v2.16b,v2.16b
+___
+    &aes192_aes256_handle(1, "enc_short", 2, 0);
+$code.=<<___;
+	/* save aes res, bump aes_out_ptr */
+	st1		{v2.16b},[x1],16
+	/* load next 16 bytes for SHA-1 */
+	ld1		{v28.16b},[x3],16
+	/* dec number of bytes of the hash input */
+	sub		x5,x5,16
+	sub		x10,x10,1			/* dec num_blocks */
+	/* load res to sha 0, endian swap */
+	rev32	v28.16b,v28.16b
+	cbz		x10,.Lpost_short_Q3		/* break if no more */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v3.16b},[x0],16
+	eor		v3.16b,v3.16b,v2.16b		/* xor w/prev value */
+
+	/* aes xform 3 */
+	aese		v3.16b,v8.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v9.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v10.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v11.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v12.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v13.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v14.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v15.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v16.16b
+	aesmc		v3.16b,v3.16b
+___
+    &aes192_aes256_handle(1, "enc_short", 3, 0);
+$code.=<<___;
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+	/* load next 16 bytes for SHA-1 */
+	ld1		{v29.16b},[x3],16
+	/* dec number of bytes of the hash input */
+	sub		x5,x5,16
+	mov		v20.16b,v24.16b			/* working ABCD <- ABCD */
+	/* load res to sha 0, endian swap */
+	rev32	v29.16b,v29.16b
+	/*
+	 * now we have the sha1 to do for these 4 aes blocks
+	 */
+	add		v19.4s,v4.4s,v26.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s25,v19.4s
+	add		v23.4s,v4.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v23.4s,v7.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v19.4s,v7.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v25.4s,v25.4s,v21.4s
+	add		v24.4s,v24.4s,v20.4s
+
+	eor		v26.16b,v26.16b,v26.16b		/* zero sha src 0 */
+	eor		v27.16b,v27.16b,v27.16b		/* zero sha src 1 */
+	eor		v28.16b,v28.16b,v28.16b		/* zero sha src 2 */
+	eor		v29.16b,v29.16b,v29.16b		/* zero sha src 3 */
+
+	sub		x10,x10,1			/* dec num_blocks */
+	cbnz		x10,.Lenc_short_loop		/* keep looping if more */
+
+.Lpost_short_Q0:
+	/* assume this was final block */
+	mov		v26.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_short_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v26 value (0x80) */
+	mov		v26.d[0],x2
+	/* assume this was final block */
+	mov		v26.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_short_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	mov		v26.d[1],x2
+.Lpost_short_Q1:
+	/* zero out vectors */
+	eor		v27.16b,v27.16b,v27.16b
+	eor		v28.16b,v28.16b,v28.16b
+	eor		v29.16b,v29.16b,v29.16b
+	/* assume this is final block */
+	mov		v27.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_short_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v27 value (0x80) */
+	mov		v27.d[0],x2
+	/* assume this was final block */
+	mov		v27.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_short_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	mov		v27.d[1],x2
+.Lpost_short_Q2:
+	/* zero out vectors (repeated if came from Q0) */
+	eor		v28.16b,v28.16b,v28.16b
+	eor		v29.16b,v29.16b,v29.16b
+	/* assume this was final block */
+	mov		v28.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_short_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v28 value (0x80) */
+	mov		v28.d[0],x2
+	/* assume this was final block */
+	mov		v28.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_short_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	mov		v28.d[1],x2
+.Lpost_short_Q3:
+	/* zero out vector (repeated if came from Q1) */
+	eor		v29.16b,v29.16b,v29.16b
+	/* assume this was final block */
+	mov		v29.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_short_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v29 value (0x80) */
+	mov		v29.d[0],x2
+	/* assume this was final block */
+	mov		v29.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,1f
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	rev32		x2,x2
+	mov		v29.d[1],x2
+	/*
+	 * That is enough of blocks, we allow up to 64 bytes in total.
+	 * Now we have the sha1 to do for these 4 16B blocks
+	 */
+1:
+	mov		v20.16b,v24.16b		/* working ABCD <- ABCD */
+
+	add		v19.4s,v4.4s,v26.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s25,v19.4s
+	add		v23.4s,v4.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v23.4s,v7.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v19.4s,v7.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v25.4s,v25.4s,v21.4s
+	add		v24.4s,v24.4s,v20.4s
+
+	eor		v26.16b,v26.16b,v26.16b		/* zero sha src 0 */
+	eor		v27.16b,v27.16b,v27.16b		/* zero sha src 1 */
+	eor		v28.16b,v28.16b,v28.16b		/* zero sha src 2 */
+	eor		v29.16b,v29.16b,v29.16b		/* zero sha src 3 */
+
+	/* this was final block */
+	cbz		x5,.Lpost_short_loop
+	subs		x5,x5,8
+	/* loop if hash is not finished */
+	b.ne		.Lpost_short_Q0
+	/* set "1" of the padding if this was a final block */
+	mov		v26.b[3],w15
+
+/*
+ * there are between 0 and 3 aes blocks in the final sha1 blocks
+ */
+.Lpost_short_loop:
+	/* Add outstanding bytes of digest source */
+	add		x11,x11,x8
+	/* Add one SHA-1 block since hash is calculated including i_key_pad */
+	add		x11,x11, #64
+	lsr		x12,x11,32			/* len_hi */
+	and		x13,x11,0xffffffff		/* len_lo */
+	lsl		x12,x12,3			/* len_hi in bits */
+	lsl		x13,x13,3			/* len_lo in bits */
+
+	mov		v29.s[3],w13			/* len_lo */
+	mov		v29.s[2],w12			/* len_hi */
+
+	/* do final block */
+	mov		v20.16b,v24.16b			/* working ABCD <- ABCD */
+	add		v19.4s,v4.4s,v26.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s25,v19.4s
+	add		v23.4s,v4.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v23.4s,v7.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v19.4s,v7.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v26.4s,v24.4s,v20.4s
+	add		v27.4s,v25.4s,v21.4s
+
+	/* Calculate final HMAC */
+	eor		v28.16b, v28.16b, v28.16b
+	eor		v29.16b, v29.16b, v29.16b
+	/* load o_key_pad partial hash */
+	ldr		q24, [x7]
+	eor		v25.16b, v25.16b, v25.16b
+	ldr		s25, [x7, #16]
+	/* Set padding 1 to the first reg */
+	mov		w11, #0x80		/* that's the 1 of the pad */
+	mov		v27.b[7], w11
+
+	mov		v20.16b,v24.16b		/* working ABCD <- ABCD */
+
+	mov		x11, #64+20		/* size of o_key_pad + inner hash */
+	lsl		x11, x11, 3
+	/* move length to the end of the block */
+	mov		v29.s[3], w11
+	lsr		x11, x11, 32
+	mov		v29.s[2], w11		/* and the higher part */
+	add		v19.4s,v4.4s,v26.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s25,v19.4s
+	add		v23.4s,v4.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v23.4s,v7.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v19.4s,v7.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	ldp		d10,d11,[sp,#16]
+	ldp		d12,d13,[sp,#32]
+
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	ldp		d14,d15,[sp,#48]
+	ldp		d8,d9,[sp],#64
+
+	mov		x0, xzr
+
+	add		v24.4s,v24.4s,v20.4s
+	add		v25.4s,v25.4s,v21.4s
+	rev32		v24.16b, v24.16b
+	rev32		v25.16b, v25.16b
+
+	st1		{v24.16b}, [x4],16
+	st1		{v25.s}[0], [x4]
+
+	ret
+
+.size	asm_aescbc_sha1_hmac, .-asm_aescbc_sha1_hmac
+
+/*
+ * Description:
+ *
+ * Combined Auth/Dec Primitive = sha1_hmac/aes128cbc
+ *
+ * Operations:
+ *
+ * out = decrypt-AES128CBC(in)
+ * return_ash_ptr = SHA1(o_key_pad | SHA1(i_key_pad | in))
+ *
+ * Prototype:
+ * asm_sha1_hmac_aescbc_dec(uint8_t *csrc, uint8_t *cdst, uint64_t clen,
+ *			uint8_t *dsrc, uint8_t *ddst, uint64_t dlen,
+ *			CIPH_DIGEST  *arg)
+ *
+ * Registers used:
+ *
+ * asm_sha1_hmac_aescbc_dec(
+ *	csrc,	x0	(cipher src address)
+ *	cdst,	x1	(cipher dst address)
+ *	clen	x2	(cipher length)
+ *	dsrc,	x3	(digest src address)
+ *	ddst,	x4	(digest dst address)
+ *	dlen,	x5	(digest length)
+ *	arg	x6	:
+ *		arg->cipher.key			(round keys)
+ *		arg->cipher.key_rounds		(key rounds)
+ *		arg->cipher.iv			(initialization vector)
+ *		arg->digest.hmac.i_key_pad	(partially hashed i_key_pad)
+ *		arg->digest.hmac.o_key_pad	(partially hashed o_key_pad)
+ *
+ *
+ * Routine register definitions:
+ *
+ * v0 - v3 -- aes results
+ * v4 - v7 -- round consts for sha
+ * v8 - v18 -- round keys
+ * v19 -- temp register for SHA1
+ * v20 -- ABCD copy (q20)
+ * v21 -- sha working state (q21)
+ * v22 -- sha working state (q22)
+ * v23 -- temp register for SHA1
+ * v24 -- sha state ABCD
+ * v25 -- sha state E
+ * v26 -- sha block 0
+ * v27 -- sha block 1
+ * v28 -- sha block 2
+ * v29 -- sha block 3
+ * v30 -- reserved
+ * v31 -- reserved
+ *
+ *
+ * Constraints:
+ *
+ * The variable "clen" must be a multiple of 16, otherwise results are not
+ * defined. For AES partial blocks the user is required to pad the input
+ * to modulus 16 = 0.
+ *
+ * The variable "dlen" must be a multiple of 8 and greater or equal to "clen".
+ * The maximum difference between "dlen" and "clen" cannot exceed 64 bytes.
+ * This constrain is strictly related to the needs of the IPSec ESP packet.
+ * Short lengths are less optimized at < 16 AES blocks, however they are
+ * somewhat optimized, and more so than the enc/auth versions.
+ */
+
+.global asm_sha1_hmac_aescbc_dec
+.type	asm_sha1_hmac_aescbc_dec,%function
+.align 4
+
+asm_sha1_hmac_aescbc_dec:
+	AARCH64_VALID_CALL_TARGET
+	/* protect registers */
+	stp		d8,d9,[sp,#-64]!
+	/* fetch args */
+	ldr		x7, [x6, #HMAC_IKEYPAD]
+	/* init ABCD, E */
+	ldr		q24, [x7]
+	eor		v25.16b, v25.16b, v25.16b
+	ldr		s25, [x7, #16]
+	/* save pointer to o_key_pad partial hash */
+	ldr		x7, [x6, #HMAC_OKEYPAD]
+
+	stp		d10,d11,[sp,#16]
+
+	prfm		PLDL1KEEP,[x0,0]	/* pref next aes_ptr_in */
+	prfm		PLDL1KEEP,[x1,0]	/* pref next aes_ptr_out */
+	lsr		x10,x2,4		/* aes_blocks = len/16 */
+
+	stp		d12,d13,[sp,#32]
+	stp		d14,d15,[sp,#48]
+
+	ldr		x9, [x6, #CIPHER_KEY]
+	ldr		x16, [x6, #CIPHER_KEY_ROUNDS]
+	ldr		x6, [x6, #CIPHER_IV]
+	add		x17, x9, #160           /* point to the last 5 rounds keys */
+	/*
+	 * init sha state, prefetch, check for small cases.
+	 * Note that the output is prefetched as a load, for the in-place case
+	 */
+	cmp		x10,16			/* no main loop if <16 */
+	blt		.Ldec_short_cases	/* branch if < 12 */
+
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+	ldp		q4,q5,[x8],32		/* key0,key1 */
+	ldp		q6,q7,[x8],32		/* key2,key3 */
+
+	/* get outstanding bytes of the digest */
+	sub		x8,x5,x2
+
+	mov		x11,x2			/* len -> x11 needed at end */
+	ld1		{v30.16b},[x6]		/* get 1st ivec */
+	lsr		x12,x11,6		/* total_blocks (sha) */
+	ldp		q26,q27,[x3],32		/* next w0,w1 */
+	rev32		v26.16b,v26.16b		/* endian swap w0 */
+	rev32		v27.16b,v27.16b		/* endian swap w1 */
+	ldp		q28,q29,[x3],32		/* next w1,w2 */
+	rev32		v28.16b,v28.16b		/* endian swap w2 */
+	rev32		v29.16b,v29.16b		/* endian swap w3 */
+
+	/* subtract loaded bytes */
+	sub		x5,x5,64
+	/*
+	 * now we can do the loop prolog, 1st sha1 block
+	 */
+	prfm		PLDL1KEEP,[x0,64]	/* pref next aes_ptr_in */
+	prfm		PLDL1KEEP,[x1,64]	/* pref next aes_ptr_out */
+	/*
+	 * do the first sha1 block on the plaintext
+	 */
+	mov		v20.16b,v24.16b		/* init working ABCD */
+
+	add		v19.4s,v4.4s,v26.4s
+	add		v23.4s,v4.4s,v27.4s
+	/* quad 0 */
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	ld1		{v8.16b},[x9],16	/* rk[0] */
+	sha1c		q24,s25,v19.4s
+	sha1su1		v26.4s,v29.4s
+	ld1		{v9.16b},[x9],16	/* rk[1] */
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	add		v19.4s,v4.4s,v28.4s
+	ld1		{v10.16b},[x9],16	/* rk[2] */
+	sha1c		q24,s22,v23.4s
+	sha1su1		v27.4s,v26.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	ld1		{v11.16b},[x9],16	/* rk[3] */
+	sha1c		q24,s21,v19.4s
+	sha1su1		v28.4s,v27.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	ld1		{v12.16b},[x9],16	/* rk[4] */
+	sha1c		q24,s21,v19.4s
+	add		v19.4s,v5.4s,v28.4s
+	sha1su1		v26.4s,v29.4s
+	ld1		{v13.16b},[x9],16	/* rk[5] */
+	/* quad 1 */
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	ld1		{v14.16b},[x9],16	/* rk[6] */
+	sha1p		q24,s22,v23.4s
+	sha1su1		v27.4s,v26.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	ld1		{v15.16b},[x9],16	/* rk[7] */
+	sha1p		q24,s21,v19.4s
+	sha1su1		v28.4s,v27.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	ld1		{v16.16b},[x9],16	/* rk[8] */
+	sha1p		q24,s21,v19.4s
+	sha1su1		v26.4s,v29.4s
+	ld1		{v17.16b},[x9],16	/* rk[9] */
+	add		v19.4s,v6.4s,v28.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	ld1		{v18.16b},[x9],16	/* rk[10] */
+	sha1p		q24,s22,v23.4s
+	sha1su1		v27.4s,v26.4s
+	/* quad 2 */
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v26.4s,v29.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v27.4s,v26.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	sha1su1		v28.4s,v27.4s
+	/* quad 3 */
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+	sha1h		s22,s24
+	ld1		{v26.16b},[x3],16	/* next w0 */
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v27.4s
+	sha1h		s21,s24
+	ld1		{v27.16b},[x3],16	/* next w1 */
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v28.4s
+	sha1h		s22,s24
+	ld1		{v28.16b},[x3],16	/* next w2 */
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s21,s24
+	ld1		{v29.16b},[x3],16	/* next w3 */
+	sha1p		q24,s22,v23.4s
+
+	/* subtract loaded bytes */
+	sub		x5,x5,64
+	/*
+	 * aes_blocks_left := number after the main (sha) block is done.
+	 * can be 0 note we account for the extra unwind in main_blocks
+	 */
+	sub		x15,x12,2		/* main_blocks=total_blocks-5 */
+	add		v24.4s,v24.4s,v20.4s
+	and		x13,x10,3		/* aes_blocks_left */
+	ld1		{v0.16b},[x0]		/* next aes block, no update */
+	add		v25.4s,v25.4s,v21.4s
+	/* next aes block, update aes_ptr_in */
+	ld1		{v31.16b},[x0],16
+
+	/* indicate AES blocks to write back */
+	mov		x9,xzr
+	/*
+	 * main combined loop CBC, can be used by auth/enc version
+	 */
+.Ldec_main_loop:
+	/*
+	 * Because both mov, rev32 and eor have a busy cycle,
+	 * this takes longer than it looks.
+	 */
+	rev32		v26.16b,v26.16b		/* fix endian w0 */
+	mov		v20.16b,v24.16b		/* working ABCD <- ABCD */
+	rev32		v27.16b,v27.16b		/* fix endian w1 */
+	/* pref next aes_ptr_out, streaming */
+	prfm		PLDL1KEEP,[x1,64]
+	/* aes xform 0, sha quad 0 */
+	aesd		v0.16b,v8.16b
+	aesimc		v0.16b,v0.16b
+	rev32		v28.16b,v28.16b		/* fix endian w2 */
+	aesd		v0.16b,v9.16b
+	aesimc		v0.16b,v0.16b
+	add		v19.4s,v4.4s,v26.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	aesd		v0.16b,v10.16b
+	aesimc		v0.16b,v0.16b
+	sha1h		s22,s24
+	aesd		v0.16b,v11.16b
+	aesimc		v0.16b,v0.16b
+	add		v23.4s,v4.4s,v27.4s
+	rev32		v29.16b,v29.16b		/* fix endian w3 */
+	/* read next aes block, no update */
+	ld1		{v1.16b},[x0]
+	sha1c		q24,s25,v19.4s
+	aesd		v0.16b,v12.16b
+	aesimc		v0.16b,v0.16b
+	sha1su1		v26.4s,v29.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+	aesd		v0.16b,v13.16b
+	aesimc		v0.16b,v0.16b
+	sha1h		s21,s24
+	add		v19.4s,v4.4s,v28.4s
+	sha1c		q24,s22,v23.4s
+	aesd		v0.16b,v14.16b
+	aesimc		v0.16b,v0.16b
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v27.4s,v26.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	aesd		v0.16b,v15.16b
+	aesimc		v0.16b,v0.16b
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	aesd		v0.16b,v16.16b
+	aesimc		v0.16b,v0.16b
+	sha1su1		v28.4s,v27.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_mainloop",0,0);
+$code.=<<___;
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+	eor		v0.16b,v0.16b,v30.16b	/* xor w/ prev value */
+	/* get next aes block, with update */
+	ld1		{v30.16b},[x0],16
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+	/* aes xform 1, sha quad 1 */
+	sha1su0		v27.4s,v28.4s,v29.4s
+	/* save aes res, bump aes_out_ptr */
+	st1		{v0.16b},[x1],16
+	aesd		v1.16b,v8.16b
+	aesimc		v1.16b,v1.16b
+	sha1h		s21,s24
+	add		v19.4s,v5.4s,v28.4s
+	sha1p		q24,s22,v23.4s
+	sha1su1		v27.4s,v26.4s
+	aesd		v1.16b,v9.16b
+	aesimc		v1.16b,v1.16b
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	aesd		v1.16b,v10.16b
+	aesimc		v1.16b,v1.16b
+	/* read next aes block, no update */
+	ld1		{v2.16b},[x0]
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+	aesd		v1.16b,v11.16b
+	aesimc		v1.16b,v1.16b
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	aesd		v1.16b,v12.16b
+	aesimc		v1.16b,v1.16b
+	sha1p		q24,s22,v23.4s
+	sha1su1		v29.4s,v28.4s
+	aesd		v1.16b,v13.16b
+	aesimc		v1.16b,v1.16b
+	sha1h		s22,s24
+	add		v19.4s,v5.4s,v26.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1p		q24,s21,v19.4s
+	aesd		v1.16b,v14.16b
+	aesimc		v1.16b,v1.16b
+	sha1su1		v26.4s,v29.4s
+	aesd		v1.16b,v15.16b
+	aesimc		v1.16b,v1.16b
+	add		v23.4s,v5.4s,v27.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	aesd		v1.16b,v16.16b
+	aesimc		v1.16b,v1.16b
+	sha1su1		v27.4s,v26.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_mainloop",1,0);
+$code.=<<___;
+	add		v19.4s,v6.4s,v28.4s
+	add		v23.4s,v6.4s,v29.4s
+	eor		v1.16b,v1.16b,v31.16b	/* mode op 1 xor w/prev value */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v31.16b},[x0],16
+	/* aes xform 2, sha quad 2 */
+	sha1su0		v28.4s,v29.4s,v26.4s
+	aesd		v2.16b,v8.16b
+	aesimc		v2.16b,v2.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v1.16b},[x1],16
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	aesd		v2.16b,v9.16b
+	aesimc		v2.16b,v2.16b
+	sha1su1		v28.4s,v27.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	aesd		v2.16b,v10.16b
+	aesimc		v2.16b,v2.16b
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	aesd		v2.16b,v11.16b
+	aesimc		v2.16b,v2.16b
+	sha1su1		v29.4s,v28.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	aesd		v2.16b,v12.16b
+	aesimc		v2.16b,v2.16b
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	aesd		v2.16b,v13.16b
+	aesimc		v2.16b,v2.16b
+	sha1su1		v26.4s,v29.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+	/* read next aes block, no update */
+	ld1		{v3.16b},[x0]
+	aesd		v2.16b,v14.16b
+	aesimc		v2.16b,v2.16b
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	aesd		v2.16b,v15.16b
+	aesimc		v2.16b,v2.16b
+	sha1su1		v27.4s,v26.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1h		s22,s24
+	aesd		v2.16b,v16.16b
+	aesimc		v2.16b,v2.16b
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1m		q24,s21,v19.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_mainloop",2,0);
+$code.=<<___;
+	sha1su1		v28.4s,v27.4s
+	add		v23.4s,v7.4s,v29.4s
+	add		v19.4s,v7.4s,v26.4s
+	eor		v2.16b,v2.16b,v30.16b	/* mode of 2 xor w/prev value */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v30.16b},[x0],16
+	/* aes xform 3, sha quad 3 */
+	aesd		v3.16b,v8.16b
+	aesimc		v3.16b,v3.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v2.16b},[x1],16
+	sha1h		s21,s24
+	aesd		v3.16b,v9.16b
+	aesimc		v3.16b,v3.16b
+	sha1su0		v29.4s,v26.4s,v27.4s
+	aesd		v3.16b,v10.16b
+	aesimc		v3.16b,v3.16b
+	sha1p		q24,s22,v23.4s
+	sha1su1		v29.4s,v28.4s
+	aesd		v3.16b,v11.16b
+	aesimc		v3.16b,v3.16b
+	sha1h		s22,s24
+	ld1		{v26.16b},[x3],16	/* next w0 */
+	sha1p		q24,s21,v19.4s
+	aesd		v3.16b,v12.16b
+	aesimc		v3.16b,v3.16b
+	add		v23.4s,v7.4s,v27.4s
+	aesd		v3.16b,v13.16b
+	aesimc		v3.16b,v3.16b
+	sha1h		s21,s24
+	ld1		{v27.16b},[x3],16	/* next w1 */
+	sha1p		q24,s22,v23.4s
+	aesd		v3.16b,v14.16b
+	aesimc		v3.16b,v3.16b
+	sub		x15,x15,1		/* dec block count */
+	add		v19.4s,v7.4s,v28.4s
+	aesd		v3.16b,v15.16b
+	aesimc		v3.16b,v3.16b
+	ld1		{v0.16b},[x0]		/* next aes block, no update */
+	sha1h		s22,s24
+	ld1		{v28.16b},[x3],16	/* next w2 */
+	sha1p		q24,s21,v19.4s
+	aesd		v3.16b,v16.16b
+	aesimc		v3.16b,v3.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_mainloop",3,0);
+$code.=<<___;
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s21,s24
+	ld1		{v29.16b},[x3],16	/* next w3 */
+	sha1p		q24,s22,v23.4s
+	add		v24.4s,v24.4s,v20.4s
+	eor		v3.16b,v3.16b,v31.16b	/* xor w/ prev value */
+	/* next aes block, update aes_ptr_in */
+	ld1		{v31.16b},[x0],16
+	add		v25.4s,v25.4s,v21.4s
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+	/* subtract loaded bytes */
+	sub		x5,x5,64
+	/* loop if more to do */
+	cbnz		x15,.Ldec_main_loop
+	/*
+	 * Now the loop epilog. Since the reads for sha have already been done
+	 * in advance, we have to have an extra unwind.
+	 * This is why the test for the short cases is 16 and not 12.
+	 *
+	 * The unwind, which is just the main loop without the tests or final reads.
+	 */
+	rev32		v26.16b,v26.16b		/* fix endian w0 */
+	mov		v20.16b,v24.16b		/* working ABCD <- ABCD */
+	rev32		v27.16b,v27.16b		/* fix endian w1 */
+	/* pref next aes_ptr_out, streaming */
+	prfm		PLDL1KEEP,[x1,64]
+	/* aes xform 0, sha quad 0 */
+	aesd		v0.16b,v8.16b
+	aesimc		v0.16b,v0.16b
+	add		v19.4s,v4.4s,v26.4s
+	rev32		v28.16b,v28.16b		/* fix endian w2 */
+	sha1su0		v26.4s,v27.4s,v28.4s
+	/* read next aes block, no update */
+	ld1		{v1.16b},[x0]
+	aesd		v0.16b,v9.16b
+	aesimc		v0.16b,v0.16b
+	sha1h		s22,s24
+	aesd		v0.16b,v10.16b
+	aesimc		v0.16b,v0.16b
+	add		v23.4s,v4.4s,v27.4s
+	sha1c		q24,s25,v19.4s
+	aesd		v0.16b,v11.16b
+	aesimc		v0.16b,v0.16b
+	rev32		v29.16b,v29.16b		/* fix endian w3 */
+	sha1su1		v26.4s,v29.4s
+	aesd		v0.16b,v12.16b
+	aesimc		v0.16b,v0.16b
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	add		v19.4s,v4.4s,v28.4s
+	aesd		v0.16b,v13.16b
+	aesimc		v0.16b,v0.16b
+	sha1c		q24,s22,v23.4s
+	aesd		v0.16b,v14.16b
+	aesimc		v0.16b,v0.16b
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v27.4s,v26.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	aesd		v0.16b,v15.16b
+	aesimc		v0.16b,v0.16b
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	aesd		v0.16b,v16.16b
+	aesimc		v0.16b,v0.16b
+	sha1su1		v28.4s,v27.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_epilog",0,0);
+$code.=<<___;
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+	add		v23.4s,v5.4s,v27.4s
+	eor		v0.16b,v0.16b,v30.16b	/* xor w/ prev value */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v30.16b},[x0],16
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	sha1su1		v26.4s,v29.4s
+	/* aes xform 1, sha quad 1 */
+	/* save aes res, bump aes_out_ptr */
+	st1		{v0.16b},[x1],16
+	sha1su0		v27.4s,v28.4s,v29.4s
+	aesd		v1.16b,v8.16b
+	aesimc		v1.16b,v1.16b
+	sha1h		s21,s24
+	add		v19.4s,v5.4s,v28.4s
+	sha1p		q24,s22,v23.4s
+	aesd		v1.16b,v9.16b
+	aesimc		v1.16b,v1.16b
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v27.4s,v26.4s
+	aesd		v1.16b,v10.16b
+	aesimc		v1.16b,v1.16b
+	sha1su0		v28.4s,v29.4s,v26.4s
+	/* read next aes block, no update */
+	ld1		{v2.16b},[x0]
+	sha1h		s22,s24
+	aesd		v1.16b,v11.16b
+	aesimc		v1.16b,v1.16b
+	sha1p		q24,s21,v19.4s
+	aesd		v1.16b,v12.16b
+	aesimc		v1.16b,v1.16b
+	sha1su1		v28.4s,v27.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	aesd		v1.16b,v13.16b
+	aesimc		v1.16b,v1.16b
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	aesd		v1.16b,v14.16b
+	aesimc		v1.16b,v1.16b
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+	aesd		v1.16b,v15.16b
+	aesimc		v1.16b,v1.16b
+	add		v23.4s,v5.4s,v27.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	aesd		v1.16b,v16.16b
+	aesimc		v1.16b,v1.16b
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	sha1su1		v26.4s,v29.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_epilog",1,0);
+$code.=<<___;
+	eor		v1.16b,v1.16b,v31.16b	/* mode op 1 xor w/prev value */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v31.16b},[x0],16
+	add		v19.4s,v6.4s,v28.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v27.4s,v26.4s
+	/* mode op 2 */
+	/* aes xform 2, sha quad 2 */
+	aesd		v2.16b,v8.16b
+	aesimc		v2.16b,v2.16b
+	sha1su0		v28.4s,v29.4s,v26.4s
+	/* save aes res, bump aes_out_ptr */
+	st1		{v1.16b},[x1],16
+	aesd		v2.16b,v9.16b
+	aesimc		v2.16b,v2.16b
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	aesd		v2.16b,v10.16b
+	aesimc		v2.16b,v2.16b
+	sha1su1		v28.4s,v27.4s
+	add		v19.4s,v6.4s,v26.4s
+	aesd		v2.16b,v11.16b
+	aesimc		v2.16b,v2.16b
+	sha1su0		v29.4s,v26.4s,v27.4s
+	aesd		v2.16b,v12.16b
+	aesimc		v2.16b,v2.16b
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	aesd		v2.16b,v13.16b
+	aesimc		v2.16b,v2.16b
+	sha1su1		v29.4s,v28.4s
+	/* read next aes block, no update */
+	ld1		{v3.16b},[x0]
+	aesd		v2.16b,v14.16b
+	aesimc		v2.16b,v2.16b
+	add		v23.4s,v6.4s,v27.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	aesd		v2.16b,v15.16b
+	aesimc		v2.16b,v2.16b
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	aesd		v2.16b,v16.16b
+	aesimc		v2.16b,v2.16b
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v26.4s,v29.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	sha1su1		v27.4s,v26.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_epilog",2,0);
+$code.=<<___;
+	eor		v2.16b,v2.16b,v30.16b	/* mode of 2 xor w/prev value */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v30.16b},[x0],16
+	sha1su1		v28.4s,v27.4s
+	add		v23.4s,v7.4s,v29.4s
+	/* mode op 3 */
+	/* aes xform 3, sha quad 3 */
+	aesd		v3.16b,v8.16b
+	aesimc		v3.16b,v3.16b
+	sha1su0		v29.4s,v26.4s,v27.4s
+	/* save aes res, bump aes_out_ptr */
+	st1		{v2.16b},[x1],16
+	aesd		v3.16b,v9.16b
+	aesimc		v3.16b,v3.16b
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	aesd		v3.16b,v10.16b
+	aesimc		v3.16b,v3.16b
+	sha1su1		v29.4s,v28.4s
+	add		v19.4s,v7.4s,v26.4s
+	aesd		v3.16b,v11.16b
+	aesimc		v3.16b,v3.16b
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	aesd		v3.16b,v12.16b
+	aesimc		v3.16b,v3.16b
+	/* read first aes block, no bump */
+	ld1		{v0.16b},[x0]
+	add		v23.4s,v7.4s,v27.4s
+	aesd		v3.16b,v13.16b
+	aesimc		v3.16b,v3.16b
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v28.4s
+	aesd		v3.16b,v14.16b
+	aesimc		v3.16b,v3.16b
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	aesd		v3.16b,v15.16b
+	aesimc		v3.16b,v3.16b
+	add		v23.4s,v7.4s,v29.4s
+	aesd		v3.16b,v16.16b
+	aesimc		v3.16b,v3.16b
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_epilog",3,0);
+$code.=<<___;
+	eor		v3.16b,v3.16b,v31.16b	/* xor w/ prev value */
+	/* read first aes block, bump aes_ptr_in */
+	ld1		{v31.16b},[x0],16
+
+	add		v25.4s,v25.4s,v21.4s
+	add		v24.4s,v24.4s,v20.4s
+
+	/*
+	 * now we have to do the 4 aes blocks (b-2) that catch up to where sha is
+	 */
+
+	/* aes xform 0 */
+	aesd		v0.16b,v8.16b
+	aesimc		v0.16b,v0.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+	aesd		v0.16b,v9.16b
+	aesimc		v0.16b,v0.16b
+	/* read next aes block, no update */
+	ld1		{v1.16b},[x0]
+	aesd		v0.16b,v10.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v11.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v12.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v13.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v14.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v15.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v16.16b
+	aesimc		v0.16b,v0.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_catchup",0,0);
+$code.=<<___;
+	eor		v0.16b,v0.16b,v30.16b	/* xor w/ ivec (modeop) */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v30.16b},[x0],16
+
+	/* aes xform 1 */
+	aesd		v1.16b,v8.16b
+	aesimc		v1.16b,v1.16b
+	/* read next aes block, no update */
+	ld1		{v2.16b},[x0]
+	aesd		v1.16b,v9.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v10.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v11.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v12.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v13.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v14.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v15.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v16.16b
+	aesimc		v1.16b,v1.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_catchup",1,0);
+$code.=<<___;
+	eor		v1.16b,v1.16b,v31.16b	/* xor w/ ivec (modeop) */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v31.16b},[x0],16
+
+	/* aes xform 2 */
+	aesd		v2.16b,v8.16b
+	aesimc		v2.16b,v2.16b
+	/* read next aes block, no update */
+	ld1		{v3.16b},[x0]
+	aesd		v2.16b,v9.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v10.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v11.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v12.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v13.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v14.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v15.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v16.16b
+	aesimc		v2.16b,v2.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_catchup",2,0);
+$code.=<<___;
+	eor		v2.16b,v2.16b,v30.16b	/* xor w/ ivec (modeop) */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v30.16b},[x0],16
+
+	/* aes xform 3 */
+	aesd		v3.16b,v8.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v9.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v10.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v11.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v12.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v13.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v14.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v15.16b
+	aesimc		v3.16b,v3.16b
+	eor		v26.16b,v26.16b,v26.16b		/* zero the rest */
+	eor		v27.16b,v27.16b,v27.16b		/* zero the rest */
+	aesd		v3.16b,v16.16b
+	aesimc		v3.16b,v3.16b
+	eor		v28.16b,v28.16b,v28.16b		/* zero the rest */
+	eor		v29.16b,v29.16b,v29.16b		/* zero the rest */
+___
+	&aes192_aes256_dec_handle(1,"dec_catchup",3,0);
+$code.=<<___;
+	eor		v3.16b,v3.16b,v31.16b	/* xor w/ ivec (modeop) */
+
+	add		x9,x9,4
+
+/*
+ * Now, there is the final b-1 sha1 padded block.
+ * This contains between 0-3 aes blocks. We take some pains to avoid read spill
+ * by only reading the blocks that are actually defined.
+ * this is also the final sha block code for the short_cases.
+ */
+.Ljoin_common:
+	mov		w15,0x80	/* that's the 1 of the pad */
+.Lpost_loop_Q0:
+	/* assume this was final block */
+	mov		v26.b[0],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	/* overwrite previous v26 value (0x80) */
+	mov		v26.d[0],x2
+	/* assume this was final block */
+	mov		v26.b[8],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	mov		v26.d[1],x2
+.Lpost_loop_Q1:
+	/* assume this is final block */
+	mov		v27.b[0],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	/* overwrite previous v27 value (0x80) */
+	mov		v27.d[0],x2
+	/* assume this was final block */
+	mov		v27.b[8],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	mov		v27.d[1],x2
+.Lpost_loop_Q2:
+	/* assume this was final block */
+	mov		v28.b[0],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	/* overwrite previous v28 value (0x80) */
+	mov		v28.d[0],x2
+	/* assume this was final block */
+	mov		v28.b[8],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	mov		v28.d[1],x2
+.Lpost_loop_Q3:
+	/* assume this was final block */
+	mov		v29.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v29 value (0x80) */
+	mov		v29.d[0],x2
+	/* assume this was final block */
+	mov		v29.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,1f
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	rev32		x2,x2
+	mov		v29.d[1],x2
+
+/*
+ * That is enough of blocks, we allow up to 64 bytes in total.
+ * Now we have the sha1 to do for these 4 16B blocks
+ */
+1:
+	rev32		v26.16b,v26.16b
+	rev32		v27.16b,v27.16b
+	rev32		v28.16b,v28.16b
+	//rev32		v29.16b,v29.16b
+
+	mov		v20.16b,v24.16b		/* working ABCD <- ABCD */
+
+	add		v19.4s,v4.4s,v26.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s25,v19.4s
+	add		v23.4s,v4.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	add		v23.4s,v7.4s,v27.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v19.4s,v7.4s,v28.4s
+	sha1h		s21,s24
+	eor		v26.16b,v26.16b,v26.16b		/* zero sha src 0 */
+	sha1p		q24,s22,v23.4s
+
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s22,s24
+	eor		v27.16b,v27.16b,v27.16b		/* zero sha src 1 */
+	sha1p		q24,s21,v19.4s
+
+	sha1h		s21,s24
+	eor		v28.16b,v28.16b,v28.16b		/* zero sha src 2 */
+	sha1p		q24,s22,v23.4s
+
+	add		v25.4s,v25.4s,v21.4s
+	eor		v29.16b,v29.16b,v29.16b		/* zero sha src 3 */
+	add		v24.4s,v24.4s,v20.4s
+
+	/* this was final block */
+	cbz		x5,.Lpost_loop
+	subs		x5,x5,8
+	/* loop if hash is not finished */
+	b.ne		.Lpost_loop_Q0
+	/* set "1" of the padding if this was a final block */
+	mov		v26.b[0],w15
+
+.Lpost_loop:
+	/* Add outstanding bytes of digest source */
+	add		x11,x11,x8
+	/* Add one SHA-1 block since hash is calculated including i_key_pad */
+	add		x11,x11,#64
+	lsr		x12,x11,32		/* len_hi */
+	and		x14,x11,0xffffffff	/* len_lo */
+	lsl		x12,x12,3		/* len_hi in bits */
+	lsl		x14,x14,3		/* len_lo in bits */
+
+	rev32		v26.16b,v26.16b		/* fix endian w0 */
+	mov		v29.s[3],w14		/* len_lo */
+	rev32		v27.16b,v27.16b		/* fix endian w1 */
+	mov		v29.s[2],w12		/* len_hi */
+	rev32		v28.16b,v28.16b		/* fix endian w2 */
+
+	mov		v20.16b,v24.16b		/* working ABCD <- ABCD */
+	/* skip write back if there were less than 4 AES blocks */
+	cbz		x9,1f
+	/*
+	 * At this point all data should be fetched for SHA.
+	 * Save remaining blocks without danger of overwriting SHA source.
+	 */
+	stp		q0,q1,[x1],32
+	stp		q2,q3,[x1],32
+1:
+	/*
+	 * final sha block
+	 * The strategy is to combine the 0-3 aes blocks, which is faster but
+	 * a little gourmand on code space.
+	 */
+	cbz		x13,.Lzero_aes_blocks_left	/* none to do */
+	/* read first aes block, bump aes_ptr_in */
+	ld1		{v0.16b},[x0]
+	ld1		{v31.16b},[x0],16
+	aesd		v0.16b,v8.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v9.16b
+	aesimc		v0.16b,v0.16b
+	add		v19.4s,v4.4s,v26.4s
+	aesd		v0.16b,v10.16b
+	aesimc		v0.16b,v0.16b
+	add		v23.4s,v4.4s,v27.4s
+	aesd		v0.16b,v11.16b
+	aesimc		v0.16b,v0.16b
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	aesd		v0.16b,v12.16b
+	aesimc		v0.16b,v0.16b
+	sha1c		q24,s25,v19.4s
+	sha1su1		v26.4s,v29.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+	aesd		v0.16b,v13.16b
+	aesimc		v0.16b,v0.16b
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	aesd		v0.16b,v14.16b
+	aesimc		v0.16b,v0.16b
+	sha1su1		v27.4s,v26.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	aesd		v0.16b,v15.16b
+	aesimc		v0.16b,v0.16b
+	sha1c		q24,s21,v19.4s
+	sha1su1		v28.4s,v27.4s
+	add		v23.4s,v4.4s,v29.4s
+	aesd		v0.16b,v16.16b
+	aesimc		v0.16b,v0.16b
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_final1",0,0);
+$code.=<<___;
+	sha1su1		v29.4s,v28.4s
+	eor		v3.16b,v0.16b,v30.16b	/* xor w/ ivec (modeop) */
+	add		v19.4s,v4.4s,v26.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+	sha1su1		v26.4s,v29.4s
+	/* dec counter */
+	sub		x13,x13,1
+	cbz		x13,.Lfrmquad1
+
+	/* aes xform 1 */
+	/* read first aes block, bump aes_ptr_in */
+	ld1		{v0.16b},[x0]
+	ld1		{v30.16b},[x0],16
+	add		v23.4s,v5.4s,v27.4s
+	aesd		v0.16b,v8.16b
+	aesimc		v0.16b,v0.16b
+	add		v19.4s,v5.4s,v28.4s
+	aesd		v0.16b,v9.16b
+	aesimc		v0.16b,v0.16b
+	sha1su0		v27.4s,v28.4s,v29.4s
+	aesd		v0.16b,v10.16b
+	aesimc		v0.16b,v0.16b
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	aesd		v0.16b,v11.16b
+	aesimc		v0.16b,v0.16b
+	sha1su1		v27.4s,v26.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	aesd		v0.16b,v12.16b
+	aesimc		v0.16b,v0.16b
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	aesd		v0.16b,v13.16b
+	aesimc		v0.16b,v0.16b
+	sha1su1		v28.4s,v27.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	aesd		v0.16b,v14.16b
+	aesimc		v0.16b,v0.16b
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	aesd		v0.16b,v15.16b
+	aesimc		v0.16b,v0.16b
+	sha1su1		v29.4s,v28.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	aesd		v0.16b,v16.16b
+	aesimc		v0.16b,v0.16b
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_final2",0,0);
+$code.=<<___;
+	sha1su1		v26.4s,v29.4s
+	eor		v3.16b,v0.16b,v31.16b	/* xor w/ ivec (modeop) */
+	add		v23.4s,v5.4s,v27.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+	sha1su1		v27.4s,v26.4s
+
+	sub		x13,x13,1		/* dec counter */
+	cbz		x13,.Lfrmquad2
+
+	/* aes xform 2 */
+	/* read first aes block, bump aes_ptr_in */
+	ld1		{v0.16b},[x0],16
+	add		v19.4s,v6.4s,v28.4s
+	aesd		v0.16b,v8.16b
+	aesimc		v0.16b,v0.16b
+	add		v23.4s,v6.4s,v29.4s
+	aesd		v0.16b,v9.16b
+	aesimc		v0.16b,v0.16b
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	aesd		v0.16b,v10.16b
+	aesimc		v0.16b,v0.16b
+	sha1m		q24,s21,v19.4s
+	sha1su1		v28.4s,v27.4s
+	aesd		v0.16b,v11.16b
+	aesimc		v0.16b,v0.16b
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	aesd		v0.16b,v12.16b
+	aesimc		v0.16b,v0.16b
+	sha1m		q24,s22,v23.4s
+	sha1su1		v29.4s,v28.4s
+	aesd		v0.16b,v13.16b
+	aesimc		v0.16b,v0.16b
+	add		v19.4s,v6.4s,v26.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	aesd		v0.16b,v14.16b
+	aesimc		v0.16b,v0.16b
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	aesd		v0.16b,v15.16b
+	aesimc		v0.16b,v0.16b
+	sha1su1		v26.4s,v29.4s
+	add		v23.4s,v6.4s,v27.4s
+	aesd		v0.16b,v16.16b
+	aesimc		v0.16b,v0.16b
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_final3",0,0);
+$code.=<<___;
+	sha1su1		v27.4s,v26.4s
+	eor		v3.16b,v0.16b,v30.16b	/* xor w/ ivec (modeop) */
+	add		v19.4s,v6.4s,v28.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+	sha1su1		v28.4s,v27.4s
+	b		.Lfrmquad3
+
+/*
+ * The final block with no aes component, i.e from here there were zero blocks
+ */
+.Lzero_aes_blocks_left:
+
+	add		v19.4s,v4.4s,v26.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s25,v19.4s
+	add		v23.4s,v4.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	sha1su1		v26.4s,v29.4s
+
+/* quad 1 */
+.Lfrmquad1:
+	add		v23.4s,v5.4s,v27.4s
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	sha1su1		v27.4s,v26.4s
+
+/* quad 2 */
+.Lfrmquad2:
+	add		v19.4s,v6.4s,v28.4s
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	sha1su1		v28.4s,v27.4s
+
+/* quad 3 */
+.Lfrmquad3:
+	add		v23.4s,v7.4s,v29.4s
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	add		v23.4s,v7.4s,v27.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v19.4s,v7.4s,v28.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v26.4s,v24.4s,v20.4s
+	add		v27.4s,v25.4s,v21.4s
+
+	/* calculate final HMAC */
+	eor		v28.16b, v28.16b, v28.16b
+	eor		v29.16b, v29.16b, v29.16b
+	/* load o_key_pad partial hash */
+	ldr		q24, [x7]
+	eor		v25.16b, v25.16b, v25.16b
+	ldr		s25, [x7, #16]
+	/* working ABCD <- ABCD */
+	mov		v20.16b,v24.16b
+
+	/* set padding 1 to the first reg */
+	mov		w11, #0x80		/* that's the 1 of the pad */
+	mov		v27.b[7], w11
+	/* size of o_key_pad + inner hash */
+	mov		x11, #64+20
+	/* move length to the end of the block */
+	lsl		x11, x11, 3
+	mov		v29.s[3], w11
+	lsr		x11, x11, 32
+	mov		v29.s[2], w11		/* and the higher part */
+
+	add		v19.4s,v4.4s,v26.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s25,v19.4s
+	add		v23.4s,v4.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	add		v23.4s,v7.4s,v27.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v19.4s,v7.4s,v28.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	ldp		d10,d11,[sp,#16]
+	ldp		d12,d13,[sp,#32]
+
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	ldp		d14,d15,[sp,#48]
+	ldp		d8,d9,[sp],#64
+
+	mov		x0, xzr
+
+	add		v24.4s,v24.4s,v20.4s
+	add		v25.4s,v25.4s,v21.4s
+
+	rev32		v24.16b, v24.16b
+	rev32		v25.16b, v25.16b
+
+	st1		{v24.16b}, [x4],16
+	st1		{v25.s}[0], [x4]
+
+	ret
+
+/*
+ * These are the short cases (less efficient), here used for 1-11 aes blocks.
+ * x10 = aes_blocks
+ */
+.Ldec_short_cases:
+	ldp		q8,q9,[x9],32
+	adrp		x8,.Lrcon		/* rcon */
+	add		x8,x8,:lo12:.Lrcon
+	ldp		q10,q11,[x9],32
+	lsl		x11,x10,4		/* len = aes_blocks*16 */
+
+	ldp		q12,q13,[x9],32
+	ldp		q4,q5,[x8],32		/* key0, key1 */
+	ldp		q14,q15,[x9],32
+	ld1		{v30.16b},[x6]		/* get ivec */
+	ldp		q16,q17,[x9],32
+	ldp		q6,q7,[x8]		/* key2, key3 */
+	ld1		{v18.16b},[x9]
+
+	/* get outstanding bytes of the digest */
+	sub		x8,x5,x2
+
+	/* indicate AES blocks to write back */
+	mov		x9,xzr
+
+	mov		x2,x0
+	/*
+	 * Digest source has to be at least of cipher source length
+	 * therefore it is safe to use x10 to indicate whether we can
+	 * overtake cipher processing by 4 AES block here.
+	 */
+	cmp		x10,4			/* check if 4 or more */
+	/* if less, bail to last block */
+	blt		.Llast_sha_block
+
+	ldp		q26,q27,[x3],32
+	rev32	v26.16b,v26.16b
+	rev32	v27.16b,v27.16b
+	ldp		q28,q29,[x3],32
+	rev32	v28.16b,v28.16b
+	rev32	v29.16b,v29.16b
+
+	sub		x5,x5,64
+
+	mov		v20.16b,v24.16b		/* working ABCD <- ABCD */
+
+	/* quad 0 */
+	add		v19.4s,v4.4s,v26.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s25,v19.4s
+	add		v23.4s,v4.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	/* quad 1 */
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	/* quad 2 */
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	/* quad 3 */
+	add		v23.4s,v7.4s,v27.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v19.4s,v7.4s,v28.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v25.4s,v25.4s,v21.4s
+	add		v24.4s,v24.4s,v20.4s
+
+	/* there were at least 4 AES blocks to process */
+	b		.Lshort_loop_no_store
+
+.Ldec_short_loop:
+	cmp		x10,4			/* check if 4 or more */
+	/* if less, bail to last block */
+	blt		.Llast_sha_block
+
+	stp		q0,q1,[x1],32
+	stp		q2,q3,[x1],32
+
+	sub		x9,x9,4
+
+.Lshort_loop_no_store:
+
+	ld1		{v31.16b},[x2]		/* next w no update */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v0.16b},[x2],16
+
+	add		x0,x0,64
+
+	/* aes xform 0 */
+	aesd		v0.16b,v8.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v9.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v10.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v11.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v12.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v13.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v14.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v15.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v16.16b
+	aesimc		v0.16b,v0.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_short",0,0);
+$code.=<<___;
+	eor		v0.16b,v0.16b,v30.16b	/* xor w/ prev value */
+
+	ld1		{v30.16b},[x2]		/* read no update */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v1.16b},[x2],16
+
+	/* aes xform 1 */
+	aesd		v1.16b,v8.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v9.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v10.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v11.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v12.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v13.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v14.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v15.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v16.16b
+	aesimc		v1.16b,v1.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_short",1,0);
+$code.=<<___;
+	eor		v1.16b,v1.16b,v31.16b	/* xor w/ prev value */
+
+	ld1		{v31.16b},[x2]		/* read no update */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v2.16b},[x2],16
+
+	/* aes xform 2 */
+	aesd		v2.16b,v8.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v9.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v10.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v11.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v12.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v13.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v14.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v15.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v16.16b
+	aesimc		v2.16b,v2.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_short",2,0);
+$code.=<<___;
+	eor		v2.16b,v2.16b,v30.16b	/* xor w/ prev value */
+
+	ld1		{v30.16b},[x2]		/* read no update */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v3.16b},[x2],16
+
+	/* aes xform 3 */
+	aesd		v3.16b,v8.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v9.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v10.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v11.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v12.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v13.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v14.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v15.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v16.16b
+	aesimc		v3.16b,v3.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_short",3,0);
+$code.=<<___;
+	eor		v3.16b,v3.16b,v31.16b	/* xor w/ prev value */
+
+	add		x9,x9,4
+
+	sub		x10,x10,4		/* 4 less */
+	cmp		x5,64
+	b.lt		.Ldec_short_loop	/* keep looping */
+
+	ldp		q26,q27,[x3],32
+	rev32		v26.16b,v26.16b
+	rev32		v27.16b,v27.16b
+	ldp		q28,q29,[x3],32
+	rev32		v28.16b,v28.16b
+	rev32		v29.16b,v29.16b
+
+	sub		x5,x5,64
+
+	mov		v20.16b,v24.16b		/* working ABCD <- ABCD */
+
+	/* quad 0 */
+	add		v19.4s,v4.4s,v26.4s
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s25,v19.4s
+	add		v23.4s,v4.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v4.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1c		q24,s22,v23.4s
+	add		v19.4s,v4.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1c		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	/* quad 1 */
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v5.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+	add		v23.4s,v5.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	/* quad 2 */
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	sha1su0		v26.4s,v27.4s,v28.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v6.4s,v27.4s
+	sha1su1		v26.4s,v29.4s
+
+	sha1su0		v27.4s,v28.4s,v29.4s
+	sha1h		s21,s24
+	sha1m		q24,s22,v23.4s
+	add		v19.4s,v6.4s,v28.4s
+	sha1su1		v27.4s,v26.4s
+
+	sha1su0		v28.4s,v29.4s,v26.4s
+	sha1h		s22,s24
+	sha1m		q24,s21,v19.4s
+	add		v23.4s,v7.4s,v29.4s
+	sha1su1		v28.4s,v27.4s
+
+	/* quad 3 */
+	sha1su0		v29.4s,v26.4s,v27.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+	add		v19.4s,v7.4s,v26.4s
+	sha1su1		v29.4s,v28.4s
+
+	add		v23.4s,v7.4s,v27.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	add		v19.4s,v7.4s,v28.4s
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v23.4s,v7.4s,v29.4s
+	sha1h		s22,s24
+	sha1p		q24,s21,v19.4s
+
+	sha1h		s21,s24
+	sha1p		q24,s22,v23.4s
+
+	add		v25.4s,v25.4s,v21.4s
+	add		v24.4s,v24.4s,v20.4s
+
+	b		.Ldec_short_loop		/* keep looping */
+/*
+ * This is arranged so that we can join the common unwind code
+ * that does the last sha block and the final 0-3 aes blocks
+ */
+.Llast_sha_block:
+	eor		v26.16b,v26.16b,v26.16b		/* zero the rest */
+	eor		v27.16b,v27.16b,v27.16b		/* zero the rest */
+	eor		v28.16b,v28.16b,v28.16b		/* zero the rest */
+	eor		v29.16b,v29.16b,v29.16b		/* zero the rest */
+
+	mov		x13,x10			/* copy aes blocks for common */
+	b		.Ljoin_common		/* join common code */
+
+.size	asm_sha1_hmac_aescbc_dec, .-asm_sha1_hmac_aescbc_dec
+___
+
+if ($flavour =~ /64/) {
+	foreach(split("\n",$code)) {
+	s/\`([^\`]*)\`/eval($1)/geo;
+	print $_,"\n";
+	}
+}
+
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-sha256-armv8.pl b/deps/openssl/openssl/crypto/aes/asm/aes-sha256-armv8.pl
new file mode 100644
index 00000000000..51eba2e1adf
--- /dev/null
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-sha256-armv8.pl
@@ -0,0 +1,4659 @@
+#! /usr/bin/env perl
+
+# Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright (C) Cavium networks Ltd. 2016.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+#========================================================================
+# Derived from following files in
+# https://github.com/ARM-software/AArch64cryptolib
+# AArch64cryptolib_opt_big/aes_cbc_sha256/aes128cbc_sha256_hmac.S
+# AArch64cryptolib_opt_big/aes_cbc_sha256/sha256_hmac_aes128cbc_dec.S
+#========================================================================
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
+( $xlate="${dir}arm-xlate.pl" and -f $xlate ) or
+( $xlate="${dir}../../perlasm/arm-xlate.pl" and -f $xlate) or
+die "can't locate arm-xlate.pl";
+
+open OUT,"| \"$^X\" $xlate $flavour \"$output\""
+    or die "can't call $xlate: $!";
+*STDOUT=*OUT;
+
+$code=<<___;
+#include "arch/arm_arch.h"
+
+/* These are offsets into the CIPH_DIGEST struct */
+#define CIPHER_KEY	0
+#define CIPHER_KEY_ROUNDS	8
+#define CIPHER_IV	16
+#define HMAC_IKEYPAD	24
+#define HMAC_OKEYPAD	32
+
+.text
+.arch armv8-a+crypto
+___
+
+sub aes192_aes256_handle () {
+	my $compare = shift;
+	my $label = shift;
+	my $i = shift;
+	my $load_rk10 = shift;
+
+	if($compare == 1) {
+$code.=<<___;
+	cmp	x16,#12
+___
+	}
+$code.=<<___;
+	b.lt	.Laes128_${label}_$i
+.Laes192_${label}_$i:
+	ldp	q30,q31,[x17],32	/* rk[10],rk[11] */
+	aese	v$i.16b,v17.16b
+	aesmc	v$i.16b,v$i.16b
+	aese	v$i.16b,v30.16b
+	aesmc	v$i.16b,v$i.16b
+	b.gt	.Laes256_${label}_$i
+	ld1	{v30.16b},[x17]		/* rk[12] */
+	aese	v$i.16b,v31.16b
+	eor	v$i.16b,v$i.16b,v30.16b
+	sub	x17, x17, #32		/* rewind x17 */
+	b	1f
+.Laes256_${label}_$i:
+	aese	v$i.16b,v31.16b
+	aesmc	v$i.16b,v$i.16b
+	ldp	q30,q31,[x17],32	/* rk[12],rk[13] */
+	aese	v$i.16b,v30.16b
+	aesmc	v$i.16b,v$i.16b
+	ld1	{v30.16b},[x17]		/* rk[14] */
+	aese	v$i.16b,v31.16b
+	eor	v$i.16b,v$i.16b,v30.16b
+	sub	x17, x17, #64		/* rewind x17 */
+	b	1f
+.Laes128_${label}_$i:
+___
+	if ($load_rk10 == 1) {
+$code.=<<___;
+	ld1	{v18.16b},[x9]
+___
+	}
+$code.=<<___;
+	aese	v$i.16b,v17.16b
+	eor	v$i.16b,v$i.16b,v18.16b	/* res 0 */
+1:
+___
+}
+
+sub aes192_aes256_dec_handle () {
+	my $compare = shift;
+	my $label = shift;
+	my $i = shift;
+	my $load_rk10 = shift;
+
+	if($compare == 1) {
+$code.=<<___;
+	cmp	x16,#12
+___
+	}
+$code.=<<___;
+	b.lt	.Laes128_${label}_$i
+.Laes192_${label}_$i:
+	stp	q19,q23,[sp, #-32]!
+	ld1	{v19.16b},[x17],16	/* rk[10] */
+	ld1	{v23.16b},[x17],16	/* rk[11] */
+	aesd	v$i.16b,v17.16b
+	aesimc	v$i.16b,v$i.16b
+	aesd	v$i.16b,v19.16b
+	aesimc	v$i.16b,v$i.16b
+	b.gt	.Laes256_${label}_$i
+	ld1	{v19.16b},[x17]		/* rk[12] */
+	aesd	v$i.16b,v23.16b
+	eor	v$i.16b,v$i.16b,v19.16b
+	sub	x17, x17, #32		/* rewind x17 */
+	ldp	q19,q23,[sp], #32
+	b	1f
+.Laes256_${label}_$i:
+	aesd	v$i.16b,v23.16b
+	aesimc	v$i.16b,v$i.16b
+	ld1	{v19.16b},[x17],16	/* rk[12] */
+	ld1	{v23.16b},[x17],16	/* rk[13] */
+	aesd	v$i.16b,v19.16b
+	aesimc	v$i.16b,v$i.16b
+	ld1	{v19.16b},[x17]		/* rk[14] */
+	aesd	v$i.16b,v23.16b
+	eor	v$i.16b,v$i.16b,v19.16b
+	sub	x17, x17, #64		/* rewind x17 */
+	ldp	q19,q23,[sp], #32
+	b	1f
+.Laes128_${label}_$i:
+___
+	if ($load_rk10 == 1) {
+$code.=<<___;
+	ld1	{v18.16b},[x9]
+___
+	}
+$code.=<<___;
+	aesd	v$i.16b,v17.16b
+	eor	v$i.16b,v$i.16b,v18.16b	/* res 0 */
+1:
+___
+}
+
+$code.=<<___;
+/*
+ * Description:
+ *
+ * Combined Enc/Auth Primitive = aes128cbc/sha256_hmac
+ *
+ * Operations:
+ *
+ * out = encrypt-AES128CBC(in)
+ * return_hash_ptr = SHA256(o_key_pad | SHA256(i_key_pad | out))
+ *
+ * Prototype:
+ * void asm_aescbc_sha256_hmac(uint8_t *csrc, uint8_t *cdst, uint64_t clen,
+ *			uint8_t *dsrc, uint8_t *ddst, uint64_t dlen,
+ *			CIPH_DIGEST *arg)
+ *
+ * Registers used:
+ *
+ * asm_aescbc_sha256_hmac(
+ *	csrc,	x0	(cipher src address)
+ *	cdst,	x1	(cipher dst address)
+ *	clen	x2	(cipher length)
+ *	dsrc,	x3	(digest src address)
+ *	ddst,	x4	(digest dst address)
+ *	dlen,	x5	(digest length)
+ *	arg	x6	:
+ *		arg->cipher.key			(round keys)
+ *		arg->cipher.key_rounds		(key rounds)
+ *		arg->cipher.iv			(initialization vector)
+ *		arg->digest.hmac.i_key_pad	(partially hashed i_key_pad)
+ *		arg->digest.hmac.o_key_pad	(partially hashed o_key_pad)
+ *	)
+ *
+ * Routine register definitions:
+ *
+ * v0  -- v3 -- aes results
+ * v4  -- v7 -- round consts for sha
+ * v8  -- v18 -- round keys
+ * v19 -- v20 -- round keys
+ * v21 -- ABCD tmp
+ * v22 -- sha working state ABCD (q22)
+ * v23 -- sha working state EFGH (q23)
+ * v24 -- sha state ABCD
+ * v25 -- sha state EFGH
+ * v26 -- sha block 0
+ * v27 -- sha block 1
+ * v28 -- sha block 2
+ * v29 -- sha block 3
+ * v30 -- reserved
+ * v31 -- reserved
+ *
+ * Constraints:
+ *
+ * The variable "clen" must be a multiple of 16, otherwise results
+ * are not defined. For AES partial blocks the user is required
+ * to pad the input to modulus 16 = 0.
+ * The variable "dlen" must be a multiple of 8 and greater or equal
+ * to "clen". This constrain is strictly related to the needs of the IPSec
+ * ESP packet. Encrypted payload is hashed along with the 8 byte ESP header,
+ * forming ICV. Speed gain is achieved by doing both things at the same time,
+ * hence lengths are required to match at least at the cipher level.
+ *
+ * Short lengths are not optimized at < 12 AES blocks
+ */
+
+.global	asm_aescbc_sha256_hmac
+.type	asm_aescbc_sha256_hmac,%function
+
+.rodata
+.align	4
+.Lrcon:
+	.word	0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5
+	.word	0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5
+	.word	0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3
+	.word	0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174
+	.word	0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc
+	.word	0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da
+	.word	0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7
+	.word	0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967
+	.word	0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13
+	.word	0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85
+	.word	0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3
+	.word	0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070
+	.word	0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5
+	.word	0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3
+	.word	0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208
+	.word	0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
+
+.Linit_sha_state:
+	.word	0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a
+	.word	0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
+.text
+
+asm_aescbc_sha256_hmac:
+	AARCH64_VALID_CALL_TARGET
+	/* protect registers */
+	stp		d8,d9,[sp,#-64]!
+	/* fetch args */
+	ldr		x7, [x6, #HMAC_IKEYPAD]
+	/* init ABCD, EFGH. */
+	ldp		q24,q25,[x7]
+	/* save pointer to o_key_pad partial hash */
+	ldr		x7, [x6, #HMAC_OKEYPAD]
+
+	stp		d10,d11,[sp,#16]
+
+	/* address of sha init state consts */
+	adrp		x12,.Linit_sha_state
+	add		x12,x12,:lo12:.Linit_sha_state
+	prfm		PLDL1KEEP,[x1,0]	/* pref next aes_ptr_out */
+	lsr		x10,x2,4		/* aes_blocks = len/16 */
+
+	stp		d12,d13,[sp,#32]
+	stp		d14,d15,[sp,#48]
+
+	ldr		x9, [x6, #CIPHER_KEY]
+	ldr		x16, [x6, #CIPHER_KEY_ROUNDS]
+	ldr		x6, [x6, #CIPHER_IV]
+	add		x17, x9, #160		/* point to the last 5 rounds keys */
+
+	/*
+	 * Init sha state, prefetch, check for small cases.
+	 * Note that the output is prefetched as a load, for the in-place case
+ 	*/
+	prfm		PLDL1KEEP,[x0,0]	/* pref next aes_ptr_in */
+	cmp		x10,12			/* no main loop if <12 */
+	b.lt		.Lenc_short_cases	/* branch if < 12 */
+
+	/* proceed */
+	ld1		{v3.16b},[x6]		/* get 1st ivec */
+	/* read first aes block, bump aes_ptr_in */
+	ld1		{v0.16b},[x0],16
+	mov		x11,x2			/* len -> x11 needed at end */
+	lsr		x12,x11,6		/* total_blocks */
+	/*
+	 * now we can do the loop prolog, 1st aes sequence of 4 blocks
+	 */
+	ld1		{v8.16b},[x9],16	/* rk[0] */
+	ld1		{v9.16b},[x9],16	/* rk[1] */
+	eor		v0.16b,v0.16b,v3.16b	/* xor w/ ivec (modeop) */
+	ld1		{v10.16b},[x9],16	/* rk[2] */
+
+	/* aes xform 0 */
+	aese		v0.16b,v8.16b
+	aesmc		v0.16b,v0.16b
+	prfm		PLDL1KEEP,[x0,64]	/* pref next aes_ptr_in */
+	ld1		{v11.16b},[x9],16	/* rk[3] */
+	aese		v0.16b,v9.16b
+	aesmc		v0.16b,v0.16b
+	prfm		PLDL1KEEP,[x1,64]	/* pref next aes_ptr_out  */
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+	ld1		{v12.16b},[x9],16	/* rk[4] */
+	aese		v0.16b,v10.16b
+	aesmc		v0.16b,v0.16b
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v1.16b},[x0],16
+	ld1		{v13.16b},[x9],16	/* rk[5] */
+	aese		v0.16b,v11.16b
+	aesmc		v0.16b,v0.16b
+	ld1		{v14.16b},[x9],16	/* rk[6] */
+	aese		v0.16b,v12.16b
+	aesmc		v0.16b,v0.16b
+	ld1		{v15.16b},[x9],16	/* rk[7] */
+	aese		v0.16b,v13.16b
+	aesmc		v0.16b,v0.16b
+	ld1		{v16.16b},[x9],16	/* rk[8] */
+	aese		v0.16b,v14.16b
+	aesmc		v0.16b,v0.16b
+	ld1		{v17.16b},[x9],16	/* rk[9] */
+	aese		v0.16b,v15.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v16.16b
+	aesmc		v0.16b,v0.16b
+___
+	&aes192_aes256_handle(1, "enc_prolog", 0, 1);
+$code.=<<___;
+	eor		v1.16b,v1.16b,v0.16b	/* xor w/ ivec (modeop) */
+
+/* aes xform 1 */
+	aese		v1.16b,v8.16b
+	aesmc		v1.16b,v1.16b
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v2.16b},[x0],16
+	aese		v1.16b,v9.16b
+	aesmc		v1.16b,v1.16b
+	prfm		PLDL1KEEP,[x8,0*64]	/* rcon */
+	aese		v1.16b,v10.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v11.16b
+	aesmc		v1.16b,v1.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v0.16b},[x1],16
+	ld1		{v26.16b},[x3],16
+	aese		v1.16b,v12.16b
+	aesmc		v1.16b,v1.16b
+	prfm		PLDL1KEEP,[x8,2*64]	/* rcon */
+	aese		v1.16b,v13.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v14.16b
+	aesmc		v1.16b,v1.16b
+	prfm		PLDL1KEEP,[x8,4*64]	/* rcon */
+	aese		v1.16b,v15.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v16.16b
+	aesmc		v1.16b,v1.16b
+	prfm		PLDL1KEEP,[x8,6*64]	/* rcon */
+___
+    &aes192_aes256_handle(0, "enc_prolog", 1, 0);
+$code.=<<___;
+	prfm		PLDL1KEEP,[x8,8*64]	/* rcon */
+	eor		v2.16b,v2.16b,v1.16b	/* xor w/ ivec (modeop) */
+
+	/* aes xform 2 */
+	aese		v2.16b,v8.16b
+	aesmc		v2.16b,v2.16b
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v3.16b},[x0],16
+	aese		v2.16b,v9.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v10.16b
+	aesmc		v2.16b,v2.16b
+	prfm		PLDL1KEEP,[x8,10*64]	/* rcon */
+	aese		v2.16b,v11.16b
+	aesmc		v2.16b,v2.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v1.16b},[x1],16
+	ld1		{v27.16b},[x3],16
+	aese		v2.16b,v12.16b
+	aesmc		v2.16b,v2.16b
+	prfm		PLDL1KEEP,[x8,12*64]	/* rcon */
+	aese		v2.16b,v13.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v14.16b
+	aesmc		v2.16b,v2.16b
+	prfm		PLDL1KEEP,[x8,14*64]	/* rcon */
+	aese		v2.16b,v15.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v16.16b
+	aesmc		v2.16b,v2.16b
+___
+    &aes192_aes256_handle(0, "enc_prolog", 2, 0);
+$code.=<<___;
+	eor		v3.16b,v3.16b,v2.16b	/* xor w/ivec (modeop) */
+
+	/* aes xform 3 */
+	aese		v3.16b,v8.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v9.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v10.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v11.16b
+	aesmc		v3.16b,v3.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v2.16b},[x1],16
+	ld1		{v28.16b},[x3],16
+	aese		v3.16b,v12.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v13.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v14.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v15.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v16.16b
+	aesmc		v3.16b,v3.16b
+	sub		x15,x12,1		/* main_blocks = total_blocks - 1 */
+	and		x13,x10,3		/* aes_blocks_left */
+___
+    &aes192_aes256_handle(0, "enc_prolog", 3, 0);
+$code.=<<___;
+	/*
+	 * Note, aes_blocks_left := number after the main (sha)
+	 * block is done. Can be 0
+	 */
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+	ld1		{v29.16b},[x3],16
+
+	/* get outstanding bytes of the digest */
+	sub		x12,x5,x2
+	/* subtract loaded bytes */
+	sub		x5,x5,64
+
+	/*
+	 * main combined loop CBC
+	 */
+.Lenc_main_loop:
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+	/*
+	 * Because both mov, rev32 and eor have a busy cycle,this takes longer
+	 * than it looks. That's OK since there are 6 cycles before we can use
+	 * the load anyway; so this goes as fast as it can without SW
+	 * pipelining(too complicated given the code size)
+	 */
+	rev32		v26.16b,v26.16b
+	/* next aes block, update aes_ptr_in */
+	ld1		{v0.16b},[x0],16
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	prfm		PLDL1KEEP,[x9,64]	/* pref next lead_ptr */
+	rev32		v27.16b,v27.16b
+	/* pref next aes_ptr_out, streaming  */
+	prfm		PLDL1KEEP,[x1,64]
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	ld1		{v4.16b},[x8],16	/* key0 */
+	eor		v0.16b,v0.16b,v3.16b	/* xor w/ prev value */
+	ld1		{v5.16b},[x8],16	/* key1 */
+	/*
+	 * aes xform 0, sha quad 0
+	 */
+	aese		v0.16b,v8.16b
+	aesmc		v0.16b,v0.16b
+	ld1		{v6.16b},[x8],16	/* key2 */
+	rev32		v28.16b,v28.16b
+	ld1		{v7.16b},[x8],16	/* key3  */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v1.16b},[x0],16
+	aese		v0.16b,v9.16b
+	aesmc		v0.16b,v0.16b
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su0	v26.4s,v27.4s
+	aese		v0.16b,v10.16b
+	aesmc		v0.16b,v0.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	aese		v0.16b,v11.16b
+	aesmc		v0.16b,v0.16b
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	/* no place to get rid of this stall */
+	rev32		v29.16b,v29.16b
+	sha256h2	q23, q21, v4.4s
+	aese		v0.16b,v12.16b
+	aesmc		v0.16b,v0.16b
+	sha256su1	v26.4s,v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	ld1		{v4.16b},[x8],16	/* key4 */
+	sha256su0	v27.4s,v28.4s
+	aese		v0.16b,v13.16b
+	aesmc		v0.16b,v0.16b
+	sha256h		q22, q23, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256h2	q23, q21, v5.4s
+	aese		v0.16b,v14.16b
+	aesmc		v0.16b,v0.16b
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+	sha256su0	v28.4s,v29.4s
+	aese		v0.16b,v15.16b
+	aesmc		v0.16b,v0.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	aese		v0.16b,v16.16b
+	aesmc		v0.16b,v0.16b
+	sha256su1	v28.4s,v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256su0	v29.4s,v26.4s
+	sha256h		q22, q23, v7.4s
+___
+	&aes192_aes256_handle(1, "enc_mainloop", 0, 0);
+$code.=<<___;
+	sha256h2	q23, q21, v7.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+
+	/* aes xform 1, sha quad 1 */
+	sha256su0	v26.4s,v27.4s
+	eor		v1.16b,v1.16b,v0.16b	/* mode op 1 xor w/prev value */
+	ld1		{v7.16b},[x8],16	/* key7  */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	/* save aes res, bump aes_out_ptr */
+	st1		{v0.16b},[x1],16
+	aese		v1.16b,v8.16b
+	aesmc		v1.16b,v1.16b
+	sha256h		q22, q23, v4.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256h2	q23, q21, v4.4s
+	sha256su1	v26.4s,v28.4s,v29.4s
+	aese		v1.16b,v9.16b
+	aesmc		v1.16b,v1.16b
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	aese		v1.16b,v10.16b
+	aesmc		v1.16b,v1.16b
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v2.16b},[x0],16
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	aese		v1.16b,v11.16b
+	aesmc		v1.16b,v1.16b
+	ld1		{v5.16b},[x8],16	/* key5 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256su0	v28.4s,v29.4s
+	sha256h		q22, q23, v6.4s
+	aese		v1.16b,v12.16b
+	aesmc		v1.16b,v1.16b
+	sha256h2	q23, q21, v6.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+	sha256su0	v29.4s,v26.4s
+	aese		v1.16b,v13.16b
+	aesmc		v1.16b,v1.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	aese		v1.16b,v14.16b
+	aesmc		v1.16b,v1.16b
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+	aese		v1.16b,v15.16b
+	aesmc		v1.16b,v1.16b
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	aese		v1.16b,v16.16b
+	aesmc		v1.16b,v1.16b
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+___
+	&aes192_aes256_handle(0, "enc_mainloop", 1, 0);
+$code.=<<___;
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+
+	/* mode op 2 */
+	eor		v2.16b,v2.16b,v1.16b	/* mode of 2 xor w/prev value */
+
+	/* aes xform 2, sha quad 2 */
+	sha256su0	v26.4s,v27.4s
+	aese		v2.16b,v8.16b
+	aesmc		v2.16b,v2.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v1.16b},[x1],16
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	aese		v2.16b,v9.16b
+	aesmc		v2.16b,v2.16b
+	sha256su1	v26.4s,v28.4s,v29.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	sha256su0	v27.4s,v28.4s
+	aese		v2.16b,v10.16b
+	aesmc		v2.16b,v2.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	aese		v2.16b,v11.16b
+	aesmc		v2.16b,v2.16b
+	sha256su1	v27.4s,v29.4s,v26.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	sha256su0	v28.4s,v29.4s
+	aese		v2.16b,v12.16b
+	aesmc		v2.16b,v2.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	aese		v2.16b,v13.16b
+	aesmc		v2.16b,v2.16b
+	sha256su1	v28.4s,v26.4s,v27.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su0	v29.4s,v26.4s
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v3.16b},[x0],16
+	aese		v2.16b,v14.16b
+	aesmc		v2.16b,v2.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	aese		v2.16b,v15.16b
+	aesmc		v2.16b,v2.16b
+	sha256su1	v29.4s,v27.4s,v28.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	ld1		{v6.16b},[x8],16	/* key6 */
+	ld1		{v7.16b},[x8],16	/* key7 */
+	aese		v2.16b,v16.16b
+	aesmc		v2.16b,v2.16b
+___
+	&aes192_aes256_handle(0, "enc_mainloop", 2, 0);
+$code.=<<___;
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+
+	/* mode op 3 */
+	eor		v3.16b,v3.16b,v2.16b	/* xor w/prev value */
+
+	/* aes xform 3, sha quad 3 (hash only) */
+	aese		v3.16b,v8.16b
+	aesmc		v3.16b,v3.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v2.16b},[x1],16
+	aese		v3.16b,v9.16b
+	aesmc		v3.16b,v3.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	aese		v3.16b,v10.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v11.16b
+	aesmc		v3.16b,v3.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	aese		v3.16b,v12.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v13.16b
+	aesmc		v3.16b,v3.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	aese		v3.16b,v14.16b
+	aesmc		v3.16b,v3.16b
+	sub		x15,x15,1		/* dec block count */
+	aese		v3.16b,v15.16b
+	aesmc		v3.16b,v3.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	aese		v3.16b,v16.16b
+	aesmc		v3.16b,v3.16b
+___
+	&aes192_aes256_handle(0, "enc_mainloop", 3, 0);
+$code.=<<___;
+	add		v24.4s,v24.4s,v22.4s	/* ABCD += working copy */
+	add		v25.4s,v25.4s,v23.4s	/* EFGH += working copy */
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+
+	ldp		q26,q27,[x3],32
+	ldp		q28,q29,[x3],32
+	sub		x5,x5,64
+
+	cbnz		x15,.Lenc_main_loop	/* loop if more to do */
+
+	mov		w15,0x80		/* that's the 1 of the pad */
+	/*
+	 * epilog, process remaining aes blocks and b-2 sha block
+	 * do this inline (no loop) to overlap with the sha part
+	 * note there are 0-3 aes blocks left.
+	 */
+	rev32		v26.16b,v26.16b		/* fix endian w0 */
+	rev32		v27.16b,v27.16b		/* fix endian w1 */
+	rev32		v28.16b,v28.16b		/* fix endian w2 */
+	rev32		v29.16b,v29.16b		/* fix endian w3 */
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	cbz		x13, .Lbm2fromQ0	/* skip if none left */
+
+	/*
+	 * mode op 0
+	 * read next aes block, update aes_ptr_in
+	 */
+	ld1		{v0.16b},[x0],16
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+	ld1		{v4.16b},[x8],16	/* key0 */
+	ld1		{v5.16b},[x8],16	/* key1 */
+	ld1		{v6.16b},[x8],16	/* key2 */
+	ld1		{v7.16b},[x8],16	/* key3  */
+	eor		v0.16b,v0.16b,v3.16b	/* xor w/ prev value */
+
+	/* aes xform 0, sha quad 0 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	aese		v0.16b,v8.16b
+	aesmc		v0.16b,v0.16b
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su0	v26.4s,v27.4s
+	aese		v0.16b,v9.16b
+	aesmc		v0.16b,v0.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	aese		v0.16b,v10.16b
+	aesmc		v0.16b,v0.16b
+	sha256su1	v26.4s,v28.4s,v29.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su0	v27.4s,v28.4s
+	aese		v0.16b,v11.16b
+	aesmc		v0.16b,v0.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	aese		v0.16b,v12.16b
+	aesmc		v0.16b,v0.16b
+	sha256su1	v27.4s,v29.4s,v26.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su0	v28.4s,v29.4s
+	aese		v0.16b,v13.16b
+	aesmc		v0.16b,v0.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	aese		v0.16b,v14.16b
+	aesmc		v0.16b,v0.16b
+	sha256su1	v28.4s,v26.4s,v27.4s
+	sha256su0	v29.4s,v26.4s
+	aese		v0.16b,v15.16b
+	aesmc		v0.16b,v0.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	aese		v0.16b,v16.16b
+	aesmc		v0.16b,v0.16b
+	sha256h2	q23, q21, v7.4s
+	sha256su1	v29.4s,v27.4s,v28.4s
+___
+	&aes192_aes256_handle(1, "enc_epilog", 0, 0);
+$code.=<<___;
+	subs		x14,x13,1		/* local copy of aes_blocks_left */
+	/* save aes res, bump aes_out_ptr */
+	st1		{v0.16b},[x1],16
+	/* if aes_blocks_left_count == 0 */
+	beq		.Lbm2fromQ1
+	/*
+	 * mode op 1
+	 * read next aes block, update aes_ptr_in
+	 */
+	ld1		{v1.16b},[x0],16
+	ld1		{v4.16b},[x8],16	/* key4 */
+	ld1		{v5.16b},[x8],16	/* key5 */
+	ld1		{v6.16b},[x8],16	/* key6 */
+	ld1		{v7.16b},[x8],16	/* key7 */
+
+	eor		v1.16b,v1.16b,v0.16b	/* xor w/prev value */
+
+	/* aes xform 1, sha quad 1 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	aese		v1.16b,v8.16b
+	aesmc		v1.16b,v1.16b
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su0	v26.4s,v27.4s
+	aese		v1.16b,v9.16b
+	aesmc		v1.16b,v1.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	aese		v1.16b,v10.16b
+	aesmc		v1.16b,v1.16b
+	sha256su1	v26.4s,v28.4s,v29.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su0	v27.4s,v28.4s
+	aese		v1.16b,v11.16b
+	aesmc		v1.16b,v1.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	aese		v1.16b,v12.16b
+	aesmc		v1.16b,v1.16b
+	sha256su1	v27.4s,v29.4s,v26.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su0	v28.4s,v29.4s
+	aese		v1.16b,v13.16b
+	aesmc		v1.16b,v1.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	aese		v1.16b,v14.16b
+	aesmc		v1.16b,v1.16b
+	sha256su1	v28.4s,v26.4s,v27.4s
+	sha256su0	v29.4s,v26.4s
+	aese		v1.16b,v15.16b
+	aesmc		v1.16b,v1.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	aese		v1.16b,v16.16b
+	aesmc		v1.16b,v1.16b
+	sha256su1	v29.4s,v27.4s,v28.4s
+___
+	&aes192_aes256_handle(1, "enc_epilog", 1, 0);
+$code.=<<___;
+	subs		x14,x14,1		/* dec counter */
+	/* save aes res, bump aes_out_ptr */
+	st1		{v1.16b},[x1],16
+	/* if aes_blocks_left_count == 0 */
+	beq		.Lbm2fromQ2
+	/*
+	 * mode op 2
+	 * read next aes block, update aes_ptr_in
+	 */
+	ld1		{v2.16b},[x0],16
+	ld1		{v4.16b},[x8],16	/* key4 */
+	ld1		{v5.16b},[x8],16	/* key5 */
+	ld1		{v6.16b},[x8],16	/* key6 */
+	ld1		{v7.16b},[x8],16	/* key7 */
+	eor		v2.16b,v2.16b,v1.16b	/* xor w/prev value */
+
+	/* aes xform 2, sha quad 2 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	aese		v2.16b,v8.16b
+	aesmc		v2.16b,v2.16b
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su0	v26.4s,v27.4s
+	aese		v2.16b,v9.16b
+	aesmc		v2.16b,v2.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	aese		v2.16b,v10.16b
+	aesmc		v2.16b,v2.16b
+	sha256su1	v26.4s,v28.4s,v29.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su0	v27.4s,v28.4s
+	aese		v2.16b,v11.16b
+	aesmc		v2.16b,v2.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	aese		v2.16b,v12.16b
+	aesmc		v2.16b,v2.16b
+	sha256su1	v27.4s,v29.4s,v26.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su0	v28.4s,v29.4s
+	aese		v2.16b,v13.16b
+	aesmc		v2.16b,v2.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	aese		v2.16b,v14.16b
+	aesmc		v2.16b,v2.16b
+	sha256su1	v28.4s,v26.4s,v27.4s
+	sha256su0	v29.4s,v26.4s
+	aese		v2.16b,v15.16b
+	aesmc		v2.16b,v2.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	aese		v2.16b,v16.16b
+	aesmc		v2.16b,v2.16b
+	sha256h2	q23, q21, v7.4s
+	sha256su1	v29.4s,v27.4s,v28.4s
+___
+	&aes192_aes256_handle(1, "enc_epilog", 2, 0);
+$code.=<<___;
+	/* save aes res, bump aes_out_ptr */
+	st1		{v2.16b},[x1],16
+	/* join common code at Quad 3 */
+	b		.Lbm2fromQ3
+/*
+ * Now there is the b-2 sha block before the final one.  Execution takes over
+ * in the appropriate part of this depending on how many aes blocks were left.
+ * If there were none, the whole thing is executed.
+ */
+/* quad 0 */
+.Lbm2fromQ0:
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+
+	ld1		{v4.16b},[x8],16	/* key0 */
+	ld1		{v5.16b},[x8],16	/* key1 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key2 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key3 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+/* quad 1 */
+.Lbm2fromQ1:
+	ld1		{v4.16b},[x8],16	/* key4 */
+	ld1		{v5.16b},[x8],16	/* key5 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+/* quad 2 */
+.Lbm2fromQ2:
+	ld1		{v4.16b},[x8],16	/* key4 */
+	ld1		{v5.16b},[x8],16	/* key5 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+/* quad 3 */
+.Lbm2fromQ3:
+	ld1		{v4.16b},[x8],16	/* key4 */
+	ld1		{v5.16b},[x8],16	/* key5 */
+	ld1		{v6.16b},[x8],16	/* key6 */
+	ld1		{v7.16b},[x8],16	/* key7 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256h2	q23, q21, v4.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	eor		v26.16b,v26.16b,v26.16b	/* zero reg */
+	sha256h2	q23, q21, v5.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	eor		v27.16b,v27.16b,v27.16b	/* zero reg */
+	sha256h2	q23, q21, v6.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	eor		v28.16b,v28.16b,v28.16b	/* zero reg */
+	sha256h2	q23, q21, v7.4s
+
+	add		v24.4s,v24.4s,v22.4s	/* ABCD += working copy */
+	add		v25.4s,v25.4s,v23.4s	/* EFGH += working copy */
+
+	/* Process remaining 0-3 AES blocks here */
+	eor		v29.16b,v29.16b,v29.16b	/* zero sha src 3 */
+
+	cbz		x13,.Lpost_long_Q0
+
+	/* 1st remaining AES block */
+	ld1		{v26.16b},[x3],16
+	sub		x5,x5,16
+	rev32		v26.16b,v26.16b
+	subs		x14,x13,1
+	b.eq		.Lpost_long_Q1
+
+	/* 2nd remaining AES block */
+	ld1		{v27.16b},[x3],16
+	sub		x5,x5,16
+	rev32		v27.16b,v27.16b
+	subs		x14,x14,1
+	b.eq		.Lpost_long_Q2
+
+	/* 3rd remaining AES block */
+	ld1		{v28.16b},[x3],16
+	sub		x5,x5,16
+	rev32		v28.16b,v28.16b
+	/* Allow for filling this sha256 block with the remaining digest src */
+	b		.Lpost_long_Q3
+/*
+ * Process remaining 8B blocks of the digest
+ */
+.Lpost_long_Q0:
+/* blk 0,1 */
+	/* assume final block */
+	mov		v26.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_long_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v26 value (0x80) */
+	mov		v26.d[0],x2
+	/* assume this was final block */
+	mov		v26.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_long_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	mov		v26.d[1],x2
+
+.Lpost_long_Q1:
+/* blk 2,3 */
+	/* assume this is final block */
+	mov		v27.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_long_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v27 value (0x80) */
+	mov		v27.d[0],x2
+	/* assume this was final block */
+	mov		v27.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_long_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	mov		v27.d[1],x2
+
+.Lpost_long_Q2:
+/* blk 4,5 */
+	/* assume this was final block */
+	mov		v28.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_long_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v28 value (0x80) */
+	mov		v28.d[0],x2
+	/* assume this was final block */
+	mov		v28.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_long_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	mov		v28.d[1],x2
+
+.Lpost_long_Q3:
+/* blk 6,7 */
+	/* assume this was final block */
+	mov		v29.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_long_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v29 value (0x80) */
+	mov		v29.d[0],x2
+	/* assume this was final block */
+	mov		v29.b[11],w15
+	/*
+	 * Outstanding 8B blocks left.
+	 * Since there has to be another sha block with padding,
+	 * we need to calculate hash without padding here.
+	 */
+	cbz		x5,1f
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	rev32		x2,x2
+	/*
+	 * Don't decrease x5 here.
+	 * Use it to indicate necessity of constructing "1" padding at the end.
+	 */
+	mov		v29.d[1],x2
+
+/*
+ * That is enough of blocks, we allow up to 64 bytes in total.
+ * Now we have the sha256 to do for these 4 16B blocks
+ */
+1:
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+
+	ld1		{v4.16b},[x8],16	/* key0 */
+	ld1		{v5.16b},[x8],16	/* key1 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key2 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key3 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+
+	eor		v26.16b,v26.16b,v26.16b		/* zero sha src 0 */
+	add		v24.4s,v24.4s,v22.4s		/* ABCD += working copy */
+	eor		v27.16b,v27.16b,v27.16b		/* zero sha src 1 */
+	add		v25.4s,v25.4s,v23.4s		/* EFGH += working copy */
+	eor		v28.16b,v28.16b,v28.16b		/* zero sha src 2 */
+	eor		v29.16b,v29.16b,v29.16b		/* zero sha src 3 */
+
+	/* this was final block */
+	cbz		x5,.Lpost_long_loop
+	subs		x5,x5,8
+	/* loop if hash is not finished */
+	b.ne		.Lpost_long_Q0
+	/* set "1" of the padding if this was a final block */
+	mov		v26.b[3],w15
+
+.Lpost_long_loop:
+	/* Add outstanding bytes of digest source */
+	add		x11,x11,x12
+	/* Add one SHA-256 block since hash is calculated including i_key_pad */
+	add		x11,x11, #64
+	lsr		x12,x11,32		/* len_hi */
+	and		x13,x11,0xffffffff	/* len_lo */
+	lsl		x12,x12,3		/* len_hi in bits */
+	lsl		x13,x13,3		/* len_lo in bits */
+
+	mov		v29.s[3],w13		/* len_lo */
+	mov		v29.s[2],w12		/* len_hi */
+
+	/*
+	 * do last sha of pad block
+	 */
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+
+	/* quad 0 */
+	ld1		{v4.16b},[x8],16	/* key0 */
+	ld1		{v5.16b},[x8],16	/* key1 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key2 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key3 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 1 */
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 2 */
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 3 */
+	ldp		q6,q7,[x8],32		/* key6,key7 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+
+	sha256h		q22, q23, v4.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256h2	q23, q21, v4.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+
+	add		v26.4s,v24.4s,v22.4s	/* ABCD += working copy */
+	add		v27.4s,v25.4s,v23.4s	/* EFGH += working copy */
+
+	/* Calculate final HMAC */
+	eor		v28.16b, v28.16b, v28.16b
+	eor		v29.16b, v29.16b, v29.16b
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+	/* load o_key_pad partial hash */
+	ldp		q24,q25,[x7]
+
+	/* Set padding 1 to the first reg */
+	mov		w11, #0x80		/* that's the 1 of the pad */
+	mov		v28.b[3], w11
+	/* size of o_key_pad + inner hash */
+	mov		x11, #64+32
+	lsl		x11, x11, 3
+	/* move length to the end of the block */
+	mov		v29.s[3], w11
+	ldp		q4,q5,[x8],32		/* key0,key1 */
+	lsr		x11, x11, 32
+	mov		v29.s[2], w11		/* and the higher part */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key2 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key3 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	ldp		q6,q7,[x8],32		/* key6,key7 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+
+	sha256h		q22, q23, v4.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256h2	q23, q21, v4.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+
+	ldp		d10,d11,[sp,#16]
+	ldp		d12,d13,[sp,#32]
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+
+	ldp		d14,d15,[sp,#48]
+	ldp		d8,d9,[sp],#64
+
+	mov		x0, xzr
+
+	add		v24.4s,v24.4s,v22.4s	/* ABCD += working copy */
+	add		v25.4s,v25.4s,v23.4s	/* EFGH += working copy */
+
+	rev32		v24.16b, v24.16b
+	rev32		v25.16b, v25.16b
+
+	stp		q24,q25,[x4]		/* save them both */
+
+	ret
+
+/*
+ * These are the short cases (less efficient), here used for 1-11 aes blocks.
+ * x10 = aes_blocks
+ */
+.Lenc_short_cases:
+	ld1		{v3.16b},[x6]			/* get ivec */
+	ldp		q8,q9,[x9],32			/* rk[0-1] */
+	eor		v26.16b,v26.16b,v26.16b		/* zero sha src 0 */
+	ldp		q10,q11,[x9],32			/* rk[2-3] */
+	eor		v27.16b,v27.16b,v27.16b		/* zero sha src 1 */
+	ldp		q12,q13,[x9],32			/* rk[3-4] */
+	eor		v28.16b,v28.16b,v28.16b		/* zero sha src 2 */
+	ldp		q14,q15,[x9],32			/* rk[5-6] */
+	eor		v29.16b,v29.16b,v29.16b		/* zero sha src 3 */
+	ldp		q16,q17,[x9],32			/* rk[7-8] */
+	mov		w15,0x80			/* sha padding word */
+	lsl		x11,x10,4			/* len = aes_blocks*16 */
+	ld1		{v18.16b},[x9]			/* rk[9] */
+
+	/* get outstanding bytes of the digest */
+	sub		x12,x5,x2
+/*
+ * the idea in the short loop (at least 1) is to break out with the padding
+ * already in place excepting the final word.
+ */
+.Lenc_short_loop:
+	adrp		x8,.Lrcon			/* rcon */
+	add		x8,x8,:lo12:.Lrcon
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v0.16b},[x0],16
+	eor		v0.16b,v0.16b,v3.16b		/* xor w/prev value */
+
+	/* aes xform 0 */
+	aese		v0.16b,v8.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v9.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v10.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v11.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v12.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v13.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v14.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v15.16b
+	aesmc		v0.16b,v0.16b
+	aese		v0.16b,v16.16b
+	aesmc		v0.16b,v0.16b
+___
+	&aes192_aes256_handle(1, "enc_short", 0, 1);
+$code.=<<___;
+	/* save aes res, bump aes_out_ptr */
+	st1		{v0.16b},[x1],16
+	/* load next 16 bytes for SHA-256 */
+	ld1		{v26.16b},[x3],16
+	/* dec number of bytes of the hash input */
+	sub		x5,x5,16
+	rev32		v26.16b,v26.16b	/* load res to sha 0, endian swap */
+	sub		x10,x10,1		/* dec num_blocks */
+	cbz		x10,.Lpost_short_Q1	/* break if no more */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v1.16b},[x0],16
+	eor		v1.16b,v1.16b,v0.16b	/* xor w/prev value */
+
+	/* aes xform 1 */
+	aese		v1.16b,v8.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v9.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v10.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v11.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v12.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v13.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v14.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v15.16b
+	aesmc		v1.16b,v1.16b
+	aese		v1.16b,v16.16b
+	aesmc		v1.16b,v1.16b
+___
+	&aes192_aes256_handle(1, "enc_short", 1, 0);
+$code.=<<___;
+	/* save aes res, bump aes_out_ptr */
+	st1		{v1.16b},[x1],16
+	/* load next 16 bytes for SHA-256 */
+	ld1		{v27.16b},[x3],16
+	/* dec number of bytes of the hash input */
+	sub		x5,x5,16
+	rev32		v27.16b,v27.16b	/* load res to sha 0, endian swap */
+	sub		x10,x10,1		/* dec num_blocks */
+	cbz		x10,.Lpost_short_Q2	/* break if no more */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v2.16b},[x0],16
+	eor		v2.16b,v2.16b,v1.16b	/* xor w/prev value */
+
+	/* aes xform 2 */
+	aese		v2.16b,v8.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v9.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v10.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v11.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v12.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v13.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v14.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v15.16b
+	aesmc		v2.16b,v2.16b
+	aese		v2.16b,v16.16b
+	aesmc		v2.16b,v2.16b
+___
+	&aes192_aes256_handle(1, "enc_short", 2, 0);
+$code.=<<___;
+	/* save aes res, bump aes_out_ptr */
+	st1		{v2.16b},[x1],16
+	/* load next 16 bytes for SHA-256 */
+	ld1		{v28.16b},[x3],16
+	/* dec number of bytes of the hash input */
+	sub		x5,x5,16
+	rev32		v28.16b,v28.16b		/* load res to sha 0, endian swap */
+	sub		x10,x10,1		/* dec num_blocks */
+	cbz		x10,.Lpost_short_Q3	/* break if no more */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v3.16b},[x0],16
+	eor		v3.16b,v3.16b,v2.16b	/* xor w/ prev value */
+
+	/* aes xform 3 */
+	aese		v3.16b,v8.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v9.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v10.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v11.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v12.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v13.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v14.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v15.16b
+	aesmc		v3.16b,v3.16b
+	aese		v3.16b,v16.16b
+	aesmc		v3.16b,v3.16b
+___
+	&aes192_aes256_handle(1, "enc_short", 3, 0);
+$code.=<<___;
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+	/* load next 16 bytes for SHA-256 */
+	ld1		{v29.16b},[x3],16
+	/* dec number of bytes of the hash input */
+	sub		x5,x5,16
+	/* load res to sha 0, endian swap */
+	rev32		v29.16b,v29.16b
+	/*
+	 * now we have the sha256 to do for these 4 aes blocks
+	 */
+
+	/* quad 0 */
+	ld1		{v4.16b},[x8],16	/* key0 */
+	ld1		{v5.16b},[x8],16	/* key1 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key2 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key3 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 1 */
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 2 */
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 3 */
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+
+	eor		v26.16b,v26.16b,v26.16b		/* zero sha src 0 */
+	add		v24.4s,v24.4s,v22.4s		/* ABCD += working copy */
+	eor		v27.16b,v27.16b,v27.16b		/* zero sha src 1 */
+	add		v25.4s,v25.4s,v23.4s		/* EFGH += working copy */
+	eor		v28.16b,v28.16b,v28.16b		/* zero sha src 2 */
+	sub		x10,x10,1			/* dec num_blocks */
+	eor		v29.16b,v29.16b,v29.16b		/* zero sha src 3 */
+
+	cbnz		x10,.Lenc_short_loop		/* keep looping if more */
+
+.Lpost_short_Q0:
+	/* assume this was final block */
+	mov		v26.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_short_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v26 value (0x80) */
+	mov		v26.d[0],x2
+	/* assume this was final block */
+	mov		v26.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_short_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	mov		v26.d[1],x2
+.Lpost_short_Q1:
+	/* zero out vectors */
+	eor		v27.16b,v27.16b,v27.16b
+	eor		v28.16b,v28.16b,v28.16b
+	eor		v29.16b,v29.16b,v29.16b
+	/* assume this is final block */
+	mov		v27.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_short_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v27 value (0x80) */
+	mov		v27.d[0],x2
+	/* assume this was final block */
+	mov		v27.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_short_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	mov		v27.d[1],x2
+.Lpost_short_Q2:
+	/* zero out vectors (repeated if came from Q0) */
+	eor		v28.16b,v28.16b,v28.16b
+	eor		v29.16b,v29.16b,v29.16b
+	/* assume this was final block */
+	mov		v28.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_short_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v28 value (0x80) */
+	mov		v28.d[0],x2
+	/* assume this was final block */
+	mov		v28.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_short_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	mov		v28.d[1],x2
+.Lpost_short_Q3:
+	/* zero out vector (repeated if came from Q1) */
+	eor		v29.16b,v29.16b,v29.16b
+	/* assume this was final block */
+	mov		v29.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_short_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v29 value (0x80) */
+	mov		v29.d[0],x2
+	/* assume this was final block */
+	mov		v29.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,1f
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	rev32		x2,x2
+	mov		v29.d[1],x2
+
+/*
+ * That is enough of blocks, we allow up to 64 bytes in total.
+ * Now we have the sha256 to do for these 4 16B blocks
+ */
+1:
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+
+	ld1		{v4.16b},[x8],16	/* key0 */
+	ld1		{v5.16b},[x8],16	/* key1 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key2 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key3 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+
+	eor		v26.16b,v26.16b,v26.16b		/* zero sha src 0 */
+	add		v24.4s,v24.4s,v22.4s		/* ABCD += working copy */
+	eor		v27.16b,v27.16b,v27.16b		/* zero sha src 1 */
+	add		v25.4s,v25.4s,v23.4s		/* EFGH += working copy */
+	eor		v28.16b,v28.16b,v28.16b		/* zero sha src 2 */
+	eor		v29.16b,v29.16b,v29.16b		/* zero sha src 3 */
+
+	/* this was final block */
+	cbz		x5,.Lpost_short_loop
+	subs		x5,x5,8
+	/* loop if hash is not finished */
+	b.ne		.Lpost_short_Q0
+	/* set "1" of the padding if this was a final block */
+	mov		v26.b[3],w15
+
+/*
+ * there are between 0 and 3 aes blocks in the final sha256 blocks
+ */
+.Lpost_short_loop:
+	/* Add outstanding bytes of digest source */
+	add		x11,x11,x12
+	/* Add one SHA-256 block since hash is calculated including i_key_pad */
+	add		x11,x11, #64
+	lsr		x12,x11,32		/* len_hi */
+	and		x13,x11,0xffffffff	/* len_lo */
+	lsl		x12,x12,3		/* len_hi in bits */
+	lsl		x13,x13,3		/* len_lo in bits */
+
+	mov		v29.s[3],w13		/* len_lo */
+	mov		v29.s[2],w12		/* len_hi */
+
+	/* do final block */
+
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon		/* top of rcon */
+	add		x8,x8,:lo12:.Lrcon
+
+	/* quad 0 */
+	ld1		{v4.16b},[x8],16	/* key0 */
+	ld1		{v5.16b},[x8],16	/* key1 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key2 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key3 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 1 */
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 2 */
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 3 */
+	ldp		q6,q7,[x8],32		/* key6,key7 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+
+	sha256h		q22, q23, v4.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256h2	q23, q21, v4.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+
+	add		v26.4s,v24.4s,v22.4s	/* ABCD += working copy */
+	add		v27.4s,v25.4s,v23.4s	/* EFGH += working copy */
+
+	/* Calculate final HMAC */
+	eor		v28.16b, v28.16b, v28.16b
+	eor		v29.16b, v29.16b, v29.16b
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+	/* load o_key_pad partial hash */
+	ldp		q24,q25,[x7]
+
+	/* Set padding 1 to the first reg */
+	mov		w11, #0x80		/* that's the 1 of the pad */
+	mov		v28.b[3], w11
+	/* size of o_key_pad + inner hash */
+	mov		x11, #64+32
+	lsl		x11, x11, 3
+	/* move length to the end of the block */
+	mov		v29.s[3], w11
+	ldp		q4,q5,[x8],32		/* key0,key1 */
+	lsr		x11, x11, 32
+	mov		v29.s[2], w11		/* and the higher part */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key2 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key3 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	ldp		q6,q7,[x8],32		/* key6,key7 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+
+	sha256h		q22, q23, v4.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256h2	q23, q21, v4.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+
+	ldp		d10,d11,[sp,#16]
+	ldp		d12,d13,[sp,#32]
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+
+	ldp		d14,d15,[sp,#48]
+	ldp		d8,d9,[sp],#64
+
+	mov		x0, xzr
+
+	add		v24.4s,v24.4s,v22.4s	/* ABCD += working copy */
+	add		v25.4s,v25.4s,v23.4s	/* EFGH += working copy */
+
+	rev32		v24.16b, v24.16b
+	rev32		v25.16b, v25.16b
+
+	stp		q24,q25,[x4]		/* save them both */
+
+	ret
+
+.size	asm_aescbc_sha256_hmac, .-asm_aescbc_sha256_hmac
+
+/*
+ * Description:
+ *
+ * Combined Auth/Dec Primitive = sha256_hmac/aes128cbc
+ *
+ * Operations:
+ *
+ * out = decrypt-AES128CBC(in)
+ * return_ash_ptr = SHA256(o_key_pad | SHA256(i_key_pad | in))
+ *
+ * Prototype:
+ *
+ * void asm_sha256_hmac_aescbc_dec(uint8_t *csrc, uint8_t *cdst, uint64_t clen,
+ *			uint8_t *dsrc, uint8_t *ddst, uint64_t dlen,
+ *			CIPH_DIGEST *arg)
+ *
+ * Registers used:
+ *
+ * asm_sha256_hmac_aescbc_dec(
+ *	csrc,	x0	(cipher src address)
+ *	cdst,	x1	(cipher dst address)
+ *	clen	x2	(cipher length)
+ *	dsrc,	x3	(digest src address)
+ *	ddst,	x4	(digest dst address)
+ *	dlen,	x5	(digest length)
+ *	arg	x6:
+ *		arg->cipher.key			(round keys)
+ *		arg->cipher.key_rounds		(key rounds)
+ *		arg->cipher.iv			(initialization vector)
+ *		arg->digest.hmac.i_key_pad	(partially hashed i_key_pad)
+ *		arg->digest.hmac.o_key_pad	(partially hashed o_key_pad)
+ *	)
+ *
+ * Routine register definitions:
+ *
+ * v0 - v3 -- aes results
+ * v4 - v7 -- round consts for sha
+ * v8 - v18 -- round keys
+ * v19 - v20 -- round keys
+ * v21 -- ABCD tmp
+ * v22 -- sha working state ABCD (q22)
+ * v23 -- sha working state EFGH (q23)
+ * v24 -- sha state ABCD
+ * v25 -- sha state EFGH
+ * v26 -- sha block 0
+ * v27 -- sha block 1
+ * v28 -- sha block 2
+ * v29 -- sha block 3
+ * v30 -- reserved
+ * v31 -- reserved
+ *
+ *
+ * Constraints:
+ *
+ * The variable "clen" must be a multiple of 16, otherwise results are not
+ * defined For AES partial blocks the user is required to pad the input to
+ * modulus 16 = 0.
+ *
+ * The variable "dlen" must be a multiple of 8 and greater or equal to "clen".
+ * The maximum difference between "dlen" and "clen" cannot exceed 64 bytes.
+ * This constrain is strictly related to the needs of the IPSec ESP packet.
+ * Short lengths are less optimized at < 16 AES blocks, however they are
+ * somewhat optimized, and more so than the enc/auth versions.
+ */
+
+.global	asm_sha256_hmac_aescbc_dec
+.type	asm_sha256_hmac_aescbc_dec,%function
+.align  4
+
+asm_sha256_hmac_aescbc_dec:
+	AARCH64_VALID_CALL_TARGET
+	/* protect registers */
+	stp		d8,d9,[sp, #-80]!
+
+	/* fetch args */
+	ldr		x7, [x6, #HMAC_IKEYPAD]
+	/* init ABCD, EFGH */
+	ldp		q24,q25,[x7]
+	/* save pointer to o_key_pad partial hash */
+	ldr		x7, [x6, #HMAC_OKEYPAD]
+
+	stp		d10,d11,[sp,#16]
+
+	prfm		PLDL1KEEP,[x0,0]	/* pref next aes_ptr_in */
+	stp		d12,d13,[sp,#32]
+	prfm		PLDL1KEEP,[x1,0]	/* pref next aes_ptr_out */
+	lsr		x10,x2,4		/* aes_blocks = len/16 */
+	stp		d14,d15,[sp,#48]
+	/* address of sha init state consts */
+	adrp		x12,.Linit_sha_state
+	add		x12,x12,:lo12:.Linit_sha_state
+	stp		x19,x20,[sp,#64]
+
+	ldr		x9, [x6, #CIPHER_KEY]
+	ldr		x16, [x6, #CIPHER_KEY_ROUNDS]
+	ldr		x6, [x6, #CIPHER_IV]
+	add		x17, x9, #160		/* point to the last 5 rounds keys */
+	/*
+	 * Init sha state, prefetch, check for small cases.
+	 * Note that the output is prefetched as a load, for the in-place case.
+	 */
+	cmp		x10,16			/* no main loop if <16 */
+	blt		.Ldec_short_cases	/* branch if < 12 */
+
+	/* get outstanding bytes of the digest */
+	sub		x20,x5,x2
+
+	mov		x11,x2			/* len -> x11 needed at end */
+	ld1		{v30.16b},[x6]		/* get 1st ivec */
+	lsr		x12,x11,6		/* total_blocks (sha) */
+
+	ldp		q26,q27,[x3],32
+	rev32		v26.16b,v26.16b		/* endian swap w0 */
+	rev32		v27.16b,v27.16b		/* endian swap w1 */
+	ldp		q28,q29,[x3],32
+	rev32		v28.16b,v28.16b		/* endian swap w2 */
+	rev32		v29.16b,v29.16b		/* endian swap w3 */
+
+	/* subtract loaded bytes */
+	sub		x5,x5,64
+	/*
+	 * now we can do the loop prolog, 1st sha256 block
+	 */
+	prfm		PLDL1KEEP,[x0,64]	/* pref next aes_ptr_in */
+	prfm		PLDL1KEEP,[x1,64]	/* pref next aes_ptr_out */
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+	/*
+	 * do the first sha256 block on the plaintext
+	 */
+	mov		v22.16b,v24.16b		/* init working ABCD */
+	mov		v23.16b,v25.16b		/* init working EFGH */
+
+	/* quad 0 */
+	ld1		{v4.16b},[x8],16	/* key0 */
+	ld1		{v5.16b},[x8],16	/* key1 */
+	ld1		{v6.16b},[x8],16	/* key2 */
+	ld1		{v7.16b},[x8],16	/* key3 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v8.16b},[x9],16	/* rk[0] */
+	sha256h2	q23, q21, v4.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+	ld1		{v9.16b},[x9],16	/* rk[1] */
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v10.16b},[x9],16	/* rk[2] */
+	sha256h2	q23, q21, v5.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256h2	q23, q21, v6.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+	ld1		{v11.16b},[x9],16	/* rk[3] */
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256h2	q23, q21, v7.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 1 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v12.16b},[x9],16	/* rk[4] */
+	sha256h2	q23, q21, v4.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+	ld1		{v13.16b},[x9],16	/* rk[5] */
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v14.16b},[x9],16	/* rk[6] */
+	sha256h2	q23, q21, v5.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256h2	q23, q21, v6.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+	ld1		{v15.16b},[x9],16	/* rk[7] */
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256h2	q23, q21, v7.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 2 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v16.16b},[x9],16	/* rk[8] */
+	sha256h2	q23, q21, v4.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+	ld1		{v17.16b},[x9],16	/* rk[9] */
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v18.16b},[x9],16	/* rk[10] */
+	sha256h2	q23, q21, v5.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256h2	q23, q21, v6.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256h2	q23, q21, v7.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 3 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256h2	q23, q21, v4.4s
+	ld1		{v26.16b},[x3],16	/* next w0 */
+	ld1		{v27.16b},[x3],16	/* next w1 */
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256h2	q23, q21, v5.4s
+	ld1		{v28.16b},[x3],16	/* next w2 */
+	ld1		{v29.16b},[x3],16	/* next w3 */
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+
+	/* subtract loaded bytes */
+	sub		x5,x5,64
+
+	/*
+	 * aes_blocks_left := number after the main (sha) block is done.
+	 * can be 0 note we account for the extra unwind in main_blocks
+	 */
+	sub		x15,x12,2		/* main_blocks=total_blocks-5 */
+
+	add		v24.4s,v24.4s,v22.4s	/* ABCD += working copy */
+	and		x13,x10,3		/* aes_blocks_left */
+	ld1		{v0.16b},[x0]		/* next aes block, no update */
+	add		v25.4s,v25.4s,v23.4s	/* EFGH += working copy */
+	add		x9,x0,128		/* lead_ptr = *in */
+	/* next aes block, update aes_ptr_in */
+	ld1		{v31.16b},[x0],16
+
+	/* indicate AES blocks to write back */
+	mov		x19,xzr
+/*
+ * main combined loop CBC, can be used by auth/enc version
+ */
+.Ldec_main_loop:
+	/*
+	 * Because both mov, rev32 and eor have a busy cycle, this takes longer
+	 * than it looks.
+	 */
+	rev32		v26.16b,v26.16b		/* fix endian w0 */
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	prfm		PLDL1KEEP,[x9,64]	/* pref next lead_ptr */
+	rev32		v27.16b,v27.16b		/* fix endian w1 */
+	/* pref next aes_ptr_out, streaming */
+	prfm		PLDL1KEEP,[x1,64]
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+
+	/*
+	 * aes xform 0, sha quad 0
+	 */
+	aesd		v0.16b,v8.16b
+	aesimc		v0.16b,v0.16b
+	ld1		{v4.16b},[x8],16	/* key0 */
+	rev32		v28.16b,v28.16b		/* fix endian w2 */
+
+	aesd		v0.16b,v9.16b
+	aesimc		v0.16b,v0.16b
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	ld1		{v5.16b},[x8],16	/* key1 */
+	sha256su0	v26.4s,v27.4s
+	aesd		v0.16b,v10.16b
+	aesimc		v0.16b,v0.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	aesd		v0.16b,v11.16b
+	aesimc		v0.16b,v0.16b
+	ld1		{v6.16b},[x8],16	/* key2 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	ld1		{v7.16b},[x8],16	/* key3 */
+	rev32		v29.16b,v29.16b		/* fix endian w3 */
+	/* read next aes block, no update */
+	ld1		{v1.16b},[x0]
+	sha256h2	q23, q21, v4.4s
+	aesd		v0.16b,v12.16b
+	aesimc		v0.16b,v0.16b
+	sha256su1	v26.4s,v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	ld1		{v4.16b},[x8],16	/* key4 */
+	sha256su0	v27.4s,v28.4s
+	aesd		v0.16b,v13.16b
+	aesimc		v0.16b,v0.16b
+	sha256h		q22, q23, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256h2	q23, q21, v5.4s
+	aesd		v0.16b,v14.16b
+	aesimc		v0.16b,v0.16b
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+	sha256su0	v28.4s,v29.4s
+	aesd		v0.16b,v15.16b
+	aesimc		v0.16b,v0.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	aesd		v0.16b,v16.16b
+	aesimc		v0.16b,v0.16b
+	sha256su1	v28.4s,v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256su0	v29.4s,v26.4s
+	sha256h		q22, q23, v7.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_mainloop",0,0);
+$code.=<<___;
+	sha256h2	q23, q21, v7.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	eor		v0.16b,v0.16b,v30.16b	/* xor w/ prev value */
+	/* get next aes block, with update */
+	ld1		{v30.16b},[x0],16
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+
+	/* aes xform 1, sha quad 1 */
+	sha256su0	v26.4s,v27.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	/* save aes res, bump aes_out_ptr */
+	st1		{v0.16b},[x1],16
+	aesd		v1.16b,v8.16b
+	aesimc		v1.16b,v1.16b
+	sha256h		q22, q23, v4.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256h2	q23, q21, v4.4s
+	sha256su1	v26.4s,v28.4s,v29.4s
+	aesd		v1.16b,v9.16b
+	aesimc		v1.16b,v1.16b
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	aesd		v1.16b,v10.16b
+	aesimc		v1.16b,v1.16b
+	/* read next aes block, no update */
+	ld1		{v2.16b},[x0]
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	aesd		v1.16b,v11.16b
+	aesimc		v1.16b,v1.16b
+	ld1		{v5.16b},[x8],16	/* key5 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256su0	v28.4s,v29.4s
+	sha256h		q22, q23, v6.4s
+	aesd		v1.16b,v12.16b
+	aesimc		v1.16b,v1.16b
+	sha256h2	q23, q21, v6.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+	sha256su0	v29.4s,v26.4s
+	aesd		v1.16b,v13.16b
+	aesimc		v1.16b,v1.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	aesd		v1.16b,v14.16b
+	aesimc		v1.16b,v1.16b
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+	aesd		v1.16b,v15.16b
+	aesimc		v1.16b,v1.16b
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	aesd		v1.16b,v16.16b
+	aesimc		v1.16b,v1.16b
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+___
+	&aes192_aes256_dec_handle(1,"dec_mainloop",1,0);
+$code.=<<___;
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	eor		v1.16b,v1.16b,v31.16b	/* mode op 1 xor w/prev value */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v31.16b},[x0],16
+
+	/* aes xform 2, sha quad 2 */
+	sha256su0	v26.4s,v27.4s
+	aesd		v2.16b,v8.16b
+	aesimc		v2.16b,v2.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v1.16b},[x1],16
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	aesd		v2.16b,v9.16b
+	aesimc		v2.16b,v2.16b
+	sha256su1	v26.4s,v28.4s,v29.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	sha256su0	v27.4s,v28.4s
+	aesd		v2.16b,v10.16b
+	aesimc		v2.16b,v2.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	aesd		v2.16b,v11.16b
+	aesimc		v2.16b,v2.16b
+	sha256su1	v27.4s,v29.4s,v26.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	sha256su0	v28.4s,v29.4s
+	aesd		v2.16b,v12.16b
+	aesimc		v2.16b,v2.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	aesd		v2.16b,v13.16b
+	aesimc		v2.16b,v2.16b
+	sha256su1	v28.4s,v26.4s,v27.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su0	v29.4s,v26.4s
+	/* read next aes block, no update */
+	ld1		{v3.16b},[x0]
+	aesd		v2.16b,v14.16b
+	aesimc		v2.16b,v2.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	aesd		v2.16b,v15.16b
+	aesimc		v2.16b,v2.16b
+	sha256su1	v29.4s,v27.4s,v28.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	ld1		{v6.16b},[x8],16	/* key6 */
+	ld1		{v7.16b},[x8],16	/* key7 */
+	aesd		v2.16b,v16.16b
+	aesimc		v2.16b,v2.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_mainloop",2,0);
+$code.=<<___;
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	eor		v2.16b,v2.16b,v30.16b	/* mode of 2 xor w/prev value */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v30.16b},[x0],16
+
+	/* aes xform 3, sha quad 3 (hash only) */
+	aesd		v3.16b,v8.16b
+	aesimc		v3.16b,v3.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v2.16b},[x1],16
+	aesd		v3.16b,v9.16b
+	aesimc		v3.16b,v3.16b
+	ld1		{v26.16b},[x3],16	/* next w0 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	aesd		v3.16b,v10.16b
+	aesimc		v3.16b,v3.16b
+	ld1		{v27.16b},[x3],16	/* next w1 */
+	aesd		v3.16b,v11.16b
+	aesimc		v3.16b,v3.16b
+	ld1		{v28.16b},[x3],16	/* next w2 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	aesd		v3.16b,v12.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v13.16b
+	aesimc		v3.16b,v3.16b
+	ld1		{v29.16b},[x3],16	/* next w3 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	aesd		v3.16b,v14.16b
+	aesimc		v3.16b,v3.16b
+	sub		x15,x15,1		/* dec block count */
+	aesd		v3.16b,v15.16b
+	aesimc		v3.16b,v3.16b
+	ld1		{v0.16b},[x0]		/* next aes block, no update */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	aesd		v3.16b,v16.16b
+	aesimc		v3.16b,v3.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_mainloop",3,0);
+$code.=<<___;
+	add		v24.4s,v24.4s,v22.4s	/* ABCD += working copy */
+	eor		v3.16b,v3.16b,v31.16b	/* xor w/ prev value */
+	/* next aes block, update aes_ptr_in */
+	ld1		{v31.16b},[x0],16
+	add		v25.4s,v25.4s,v23.4s	/* EFGH += working copy */
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+	/* subtract loaded bytes */
+	sub		x5,x5,64
+	cbnz		x15,.Ldec_main_loop	/* loop if more to do */
+	/*
+	 * Now the loop epilog. Since the reads for sha have already been done
+	 * in advance, we have to have an extra unwind.
+	 * This is why the test for the short cases is 16 and not 12.
+	 *
+	 * The unwind, which is just the main loop without the tests or final reads.
+	 */
+
+	rev32		v26.16b,v26.16b		/* fix endian w0 */
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	rev32		v27.16b,v27.16b		/* fix endian w1 */
+	/* pref next aes_ptr_out, streaming */
+	prfm		PLDL1KEEP,[x1,64]
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+	ld1		{v4.16b},[x8],16	/* key0 */
+	ld1		{v5.16b},[x8],16	/* key1 */
+
+	/*
+	 * aes xform 0, sha quad 0
+	 */
+	aesd		v0.16b,v8.16b
+	aesimc		v0.16b,v0.16b
+	ld1		{v6.16b},[x8],16	/* key2 */
+	rev32		v28.16b,v28.16b		/* fix endian w2 */
+	ld1		{v7.16b},[x8],16	/* key3 */
+	/* read next aes block, no update */
+	ld1		{v1.16b},[x0]
+	aesd		v0.16b,v9.16b
+	aesimc		v0.16b,v0.16b
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su0	v26.4s,v27.4s
+	aesd		v0.16b,v10.16b
+	aesimc		v0.16b,v0.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	aesd		v0.16b,v11.16b
+	aesimc		v0.16b,v0.16b
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	rev32		v29.16b,v29.16b		/* fix endian w3 */
+	sha256h2	q23, q21, v4.4s
+	aesd		v0.16b,v12.16b
+	aesimc		v0.16b,v0.16b
+	sha256su1	v26.4s,v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	ld1		{v4.16b},[x8],16	/* key4 */
+	sha256su0	v27.4s,v28.4s
+	aesd		v0.16b,v13.16b
+	aesimc		v0.16b,v0.16b
+	sha256h		q22, q23, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256h2	q23, q21, v5.4s
+	aesd		v0.16b,v14.16b
+	aesimc		v0.16b,v0.16b
+	ld1		{v5.16b},[x8],16	/* key5 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+	sha256su0	v28.4s,v29.4s
+	aesd		v0.16b,v15.16b
+	aesimc		v0.16b,v0.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	aesd		v0.16b,v16.16b
+	aesimc		v0.16b,v0.16b
+	sha256su1	v28.4s,v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256su0	v29.4s,v26.4s
+	sha256h		q22, q23, v7.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_epilog",0,0);
+$code.=<<___;
+	sha256h2	q23, q21, v7.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	eor		v0.16b,v0.16b,v30.16b	/* xor w/ prev value */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v30.16b},[x0],16
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+
+	/* aes xform 1, sha quad 1 */
+	sha256su0	v26.4s,v27.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	/* save aes res, bump aes_out_ptr */
+	st1		{v0.16b},[x1],16
+	aesd		v1.16b,v8.16b
+	aesimc		v1.16b,v1.16b
+	sha256h		q22, q23, v4.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256h2	q23, q21, v4.4s
+	sha256su1	v26.4s,v28.4s,v29.4s
+	aesd		v1.16b,v9.16b
+	aesimc		v1.16b,v1.16b
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	aesd		v1.16b,v10.16b
+	aesimc		v1.16b,v1.16b
+	/* read next aes block, no update */
+	ld1		{v2.16b},[x0]
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	ld1		{v4.16b},[x8],16	/* key4 */
+	aesd		v1.16b,v11.16b
+	aesimc		v1.16b,v1.16b
+	ld1		{v5.16b},[x8],16	/* key5 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256su0	v28.4s,v29.4s
+	sha256h		q22, q23, v6.4s
+	aesd		v1.16b,v12.16b
+	aesimc		v1.16b,v1.16b
+	sha256h2	q23, q21, v6.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+	sha256su0	v29.4s,v26.4s
+	aesd		v1.16b,v13.16b
+	aesimc		v1.16b,v1.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	aesd		v1.16b,v14.16b
+	aesimc		v1.16b,v1.16b
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+	aesd		v1.16b,v15.16b
+	aesimc		v1.16b,v1.16b
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	aesd		v1.16b,v16.16b
+	aesimc		v1.16b,v1.16b
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+___
+	&aes192_aes256_dec_handle(1,"dec_epilog",1,0);
+$code.=<<___;
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	eor		v1.16b,v1.16b,v31.16b	/* mode op 1 xor w/prev value */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v31.16b},[x0],16
+
+	/* mode op 2 */
+
+	/* aes xform 2, sha quad 2 */
+	sha256su0	v26.4s,v27.4s
+	aesd		v2.16b,v8.16b
+	aesimc		v2.16b,v2.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v1.16b},[x1],16
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	aesd		v2.16b,v9.16b
+	aesimc		v2.16b,v2.16b
+	sha256su1	v26.4s,v28.4s,v29.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	sha256su0	v27.4s,v28.4s
+	aesd		v2.16b,v10.16b
+	aesimc		v2.16b,v2.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	aesd		v2.16b,v11.16b
+	aesimc		v2.16b,v2.16b
+	sha256su1	v27.4s,v29.4s,v26.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	sha256su0	v28.4s,v29.4s
+	aesd		v2.16b,v12.16b
+	aesimc		v2.16b,v2.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	aesd		v2.16b,v13.16b
+	aesimc		v2.16b,v2.16b
+	sha256su1	v28.4s,v26.4s,v27.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su0	v29.4s,v26.4s
+	/* read next aes block, no update */
+	ld1		{v3.16b},[x0]
+	aesd		v2.16b,v14.16b
+	aesimc		v2.16b,v2.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	aesd		v2.16b,v15.16b
+	aesimc		v2.16b,v2.16b
+	sha256su1	v29.4s,v27.4s,v28.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	ld1		{v6.16b},[x8],16	/* key6 */
+	ld1		{v7.16b},[x8],16	/* key7 */
+	aesd		v2.16b,v16.16b
+	aesimc		v2.16b,v2.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_epilog",2,0);
+$code.=<<___;
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	eor		v2.16b,v2.16b,v30.16b	/* mode of 2 xor w/prev value */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v30.16b},[x0],16
+
+	/* mode op 3 */
+
+	/* aes xform 3, sha quad 3 (hash only) */
+	aesd		v3.16b,v8.16b
+	aesimc		v3.16b,v3.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v2.16b},[x1],16
+	aesd		v3.16b,v9.16b
+	aesimc		v3.16b,v3.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	aesd		v3.16b,v10.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v11.16b
+	aesimc		v3.16b,v3.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	aesd		v3.16b,v12.16b
+	aesimc		v3.16b,v3.16b
+	/* read first aes block, no bump */
+	ld1		{v0.16b},[x0]
+	aesd		v3.16b,v13.16b
+	aesimc		v3.16b,v3.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	aesd		v3.16b,v14.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v15.16b
+	aesimc		v3.16b,v3.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	aesd		v3.16b,v16.16b
+	aesimc		v3.16b,v3.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_epilog",3,0);
+$code.=<<___;
+	add		v24.4s,v24.4s,v22.4s	/* ABCD += working copy */
+	add		v25.4s,v25.4s,v23.4s	/* EFGH += working copy */
+	eor		v3.16b,v3.16b,v31.16b	/* xor w/prev value */
+	/* read first aes block, bump aes_ptr_in */
+	ld1		{v31.16b},[x0],16
+
+
+	/*
+	 * now we have to do the 4 aes blocks (b-2) that catch up to where sha is
+	 */
+
+	/* aes xform 0 */
+	aesd		v0.16b,v8.16b
+	aesimc		v0.16b,v0.16b
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+	aesd		v0.16b,v9.16b
+	aesimc		v0.16b,v0.16b
+	/* read next aes block, no update */
+	ld1		{v1.16b},[x0]
+	aesd		v0.16b,v10.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v11.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v12.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v13.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v14.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v15.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v16.16b
+	aesimc		v0.16b,v0.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_catchup",0,0);
+$code.=<<___;
+	eor		v0.16b,v0.16b,v30.16b	/* xor w/ ivec (modeop) */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v30.16b},[x0],16
+
+	/* aes xform 1 */
+	/* read next aes block, no update */
+	ld1		{v2.16b},[x0]
+	aesd		v1.16b,v8.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v9.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v10.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v11.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v12.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v13.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v14.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v15.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v16.16b
+	aesimc		v1.16b,v1.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_catchup",1,0);
+$code.=<<___;
+	eor		v1.16b,v1.16b,v31.16b	/* xor w/ ivec (modeop) */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v31.16b},[x0],16
+
+	/* aes xform 2 */
+	aesd		v2.16b,v8.16b
+	aesimc		v2.16b,v2.16b
+	/* read next aes block, no update */
+	ld1		{v3.16b},[x0]
+	aesd		v2.16b,v9.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v10.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v11.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v12.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v13.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v14.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v15.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v16.16b
+	aesimc		v2.16b,v2.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_catchup",2,0);
+$code.=<<___;
+	eor		v2.16b,v2.16b,v30.16b	/* xor w/ ivec (modeop) */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v30.16b},[x0],16
+
+	/* aes xform 3 */
+	aesd		v3.16b,v8.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v9.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v10.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v11.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v12.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v13.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v14.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v15.16b
+	aesimc		v3.16b,v3.16b
+	eor		v26.16b,v26.16b,v26.16b
+	eor		v27.16b,v27.16b,v27.16b
+	aesd		v3.16b,v16.16b
+	aesimc		v3.16b,v3.16b
+	eor		v28.16b,v28.16b,v28.16b
+	eor		v29.16b,v29.16b,v29.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_catchup",3,0);
+$code.=<<___;
+	eor		v3.16b,v3.16b,v31.16b	/* xor w/ ivec (modeop) */
+
+	add		x19,x19,4
+/*
+ * Now, there is the final b-1 sha256 padded block.
+ * This contains between 0-3 aes blocks. We take some pains to avoid read spill
+ * by only reading the blocks that are actually defined.
+ * This is also the final sha block code for the shortCases.
+ */
+.Ljoin_common:
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+	mov		w15,0x80	/* that's the 1 of the pad */
+.Lpost_loop_Q0:
+	/* assume this was final block */
+	mov		v26.b[0],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	/* overwrite previous v26 value (0x80) */
+	mov		v26.d[0],x2
+	/* assume this was final block */
+	mov		v26.b[8],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	mov		v26.d[1],x2
+.Lpost_loop_Q1:
+	/* assume this is final block */
+	mov		v27.b[0],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	/* overwrite previous v27 value (0x80) */
+	mov		v27.d[0],x2
+	/* assume this was final block */
+	mov		v27.b[8],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	mov		v27.d[1],x2
+.Lpost_loop_Q2:
+	/* assume this was final block */
+	mov		v28.b[0],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	/* overwrite previous v28 value (0x80) */
+	mov		v28.d[0],x2
+	/* assume this was final block */
+	mov		v28.b[8],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	mov		v28.d[1],x2
+.Lpost_loop_Q3:
+	/* assume this was final block */
+	mov		v29.b[3],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,.Lpost_loop
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	sub		x5,x5,8
+	rev32		x2,x2
+	/* overwrite previous v29 value (0x80) */
+	mov		v29.d[0],x2
+	/* assume this was final block */
+	mov		v29.b[11],w15
+	/* outstanding 8B blocks left */
+	cbz		x5,1f
+	/* at least 8B left to go, it is safe to fetch this data */
+	ldr		x2,[x3],8
+	rev32		x2,x2
+	mov		v29.d[1],x2
+
+/*
+ * That is enough of blocks, we allow up to 64 bytes in total.
+ * Now we have the sha256 to do for these 4 16B blocks.
+ */
+1:
+	mov		x9,x8
+	rev32		v26.16b,v26.16b
+	ld1		{v4.16b},[x9],16	/* key0 */
+	rev32		v27.16b,v27.16b
+	rev32		v28.16b,v28.16b
+	ld1		{v5.16b},[x9],16	/* key1 */
+	//rev32		v29.16b,v29.16b
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x9],16	/* key2 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x9],16	/* key3 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	ld1		{v4.16b},[x9],16	/* key4 */
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	ld1		{v5.16b},[x9],16	/* key5 */
+	sha256h2	q23, q21, v7.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 1 */
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x9],16	/* key6 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x9],16	/* key7 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	ld1		{v4.16b},[x9],16	/* key4 */
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x9],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 2 */
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x9],16	/* key6 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x9],16	/* key7 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	ld1		{v4.16b},[x9],16	/* key4 */
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	ld1		{v5.16b},[x9],16	/* key5 */
+	sha256h2	q23, q21, v7.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 3 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x9],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	eor		v26.16b,v26.16b,v26.16b	/* zero sha src 0 */
+	sha256h2	q23, q21, v4.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x9],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	eor		v27.16b,v27.16b,v27.16b	/* zero sha src 1 */
+	sha256h2	q23, q21, v5.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	eor		v28.16b,v28.16b,v28.16b	/* zero sha src 2 */
+	sha256h2	q23, q21, v6.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	eor		v29.16b,v29.16b,v29.16b	/* zero sha src 3 */
+	sha256h2	q23, q21, v7.4s
+
+	add		v24.4s,v24.4s,v22.4s	/* ABCD += working copy */
+	add		v25.4s,v25.4s,v23.4s	/* EFGH += working copy */
+
+	/* this was final block */
+	cbz		x5,.Lpost_loop
+	subs		x5,x5,8
+	/* loop if hash is not finished */
+	b.ne		.Lpost_loop_Q0
+	/* set "1" of the padding if this was a final block */
+	mov		v26.b[0],w15
+
+.Lpost_loop:
+	/* Add outstanding bytes of digest source */
+	add		x11,x11,x20
+	/* Add one SHA-2 block since hash is calculated including i_key_pad */
+	add		x11,x11,#64
+	lsr		x12,x11,32		/* len_hi */
+	and		x14,x11,0xffffffff	/* len_lo */
+	lsl		x12,x12,3		/* len_hi in bits */
+	lsl		x14,x14,3		/* len_lo in bits */
+
+	mov		v29.s[3],w14		/* len_lo */
+	mov		v29.s[2],w12		/* len_hi */
+
+	rev32		v26.16b,v26.16b		/* fix endian w0 */
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	rev32		v27.16b,v27.16b		/* fix endian w1 */
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	rev32		v28.16b,v28.16b		/* fix endian w2 */
+
+	/* skip write back if there were less than 4 AES blocks */
+	cbz		x19,1f
+	/*
+	 * At this point all data should be fetched for SHA.
+	 * Save remaining blocks without danger of overwriting SHA source.
+	 */
+	stp		q0,q1,[x1],32
+	stp		q2,q3,[x1],32
+1:
+	/*
+	 * final sha block
+	 * the strategy is to combine the 0-3 aes blocks, which is faster but
+	 * a little gourmand on code space.
+	 */
+	cbz		x13,.Lzero_aes_blocks_left	/* none to do */
+	/* read first aes block, bump aes_ptr_in */
+	ld1		{v0.16b},[x0]
+	ld1		{v31.16b},[x0],16
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+	ld1		{v4.16b},[x8],16	/* key0 */
+	aesd		v0.16b,v8.16b
+	aesimc		v0.16b,v0.16b
+	ld1		{v5.16b},[x8],16	/* key1 */
+	ld1		{v6.16b},[x8],16	/* key2 */
+	aesd		v0.16b,v9.16b
+	aesimc		v0.16b,v0.16b
+	ld1		{v7.16b},[x8],16	/* key3 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	aesd		v0.16b,v10.16b
+	aesimc		v0.16b,v0.16b
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	aesd		v0.16b,v11.16b
+	aesimc		v0.16b,v0.16b
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	aesd		v0.16b,v12.16b
+	aesimc		v0.16b,v0.16b
+	sha256h2	q23, q21, v4.4s
+	sha256su1	v26.4s,v28.4s,v29.4s
+	sha256su0	v27.4s,v28.4s
+	aesd		v0.16b,v13.16b
+	aesimc		v0.16b,v0.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	aesd		v0.16b,v14.16b
+	aesimc		v0.16b,v0.16b
+	sha256su1	v27.4s,v29.4s,v26.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	aesd		v0.16b,v15.16b
+	aesimc		v0.16b,v0.16b
+	sha256h2	q23, q21, v6.4s
+	sha256su1	v28.4s,v26.4s,v27.4s
+	aesd		v0.16b,v16.16b
+	aesimc		v0.16b,v0.16b
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_final1",0,0);
+$code.=<<___;
+	sha256su1	v29.4s,v27.4s,v28.4s
+	eor		v3.16b,v0.16b,v30.16b	/* xor w/ ivec (modeop) */
+
+	sub		x13,x13,1		/* dec counter */
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+	cbz		x13,.Lfrmquad1
+
+	/* aes xform 1 */
+
+	/* read first aes block, bump aes_ptr_in */
+	ld1		{v0.16b},[x0]
+	ld1		{v30.16b},[x0],16
+	ld1		{v4.16b},[x8],16	/* key4 */
+	ld1		{v5.16b},[x8],16	/* key5 */
+	ld1		{v6.16b},[x8],16	/* key6 */
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	aesd		v0.16b,v8.16b
+	aesimc		v0.16b,v0.16b
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	aesd		v0.16b,v9.16b
+	aesimc		v0.16b,v0.16b
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	aesd		v0.16b,v10.16b
+	aesimc		v0.16b,v0.16b
+	sha256h		q22, q23, v4.4s
+	sha256h2	q23, q21, v4.4s
+	aesd		v0.16b,v11.16b
+	aesimc		v0.16b,v0.16b
+	sha256su1	v26.4s,v28.4s,v29.4s
+	sha256su0	v27.4s,v28.4s
+	aesd		v0.16b,v12.16b
+	aesimc		v0.16b,v0.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	sha256h2	q23, q21, v5.4s
+	aesd		v0.16b,v13.16b
+	aesimc		v0.16b,v0.16b
+	sha256su1	v27.4s,v29.4s,v26.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su0	v28.4s,v29.4s
+	aesd		v0.16b,v14.16b
+	aesimc		v0.16b,v0.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	aesd		v0.16b,v15.16b
+	aesimc		v0.16b,v0.16b
+	sha256su1	v28.4s,v26.4s,v27.4s
+	sha256su0	v29.4s,v26.4s
+	aesd		v0.16b,v16.16b
+	aesimc		v0.16b,v0.16b
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_final2",0,0);
+$code.=<<___;
+	sha256su1	v29.4s,v27.4s,v28.4s
+	eor		v3.16b,v0.16b,v31.16b	/* xor w/ ivec (modeop) */
+
+	sub		x13,x13,1		/* dec counter */
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+	cbz		x13,.Lfrmquad2
+
+	/* aes xform 2 */
+
+	/* read first aes block, bump aes_ptr_in */
+	ld1		{v0.16b},[x0],16
+	ld1		{v4.16b},[x8],16	/* key4 */
+	ld1		{v5.16b},[x8],16	/* key5 */
+	ld1		{v6.16b},[x8],16	/* key6 */
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	aesd		v0.16b,v8.16b
+	aesimc		v0.16b,v0.16b
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	aesd		v0.16b,v9.16b
+	aesimc		v0.16b,v0.16b
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	aesd		v0.16b,v10.16b
+	aesimc		v0.16b,v0.16b
+	sha256h2	q23, q21, v4.4s
+	sha256su1	v26.4s,v28.4s,v29.4s
+	aesd		v0.16b,v11.16b
+	aesimc		v0.16b,v0.16b
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	aesd		v0.16b,v12.16b
+	aesimc		v0.16b,v0.16b
+	sha256h2	q23, q21, v5.4s
+	sha256su1	v27.4s,v29.4s,v26.4s
+	aesd		v0.16b,v13.16b
+	aesimc		v0.16b,v0.16b
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	aesd		v0.16b,v14.16b
+	aesimc		v0.16b,v0.16b
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	aesd		v0.16b,v15.16b
+	aesimc		v0.16b,v0.16b
+	sha256su1	v28.4s,v26.4s,v27.4s
+	aesd		v0.16b,v16.16b
+	aesimc		v0.16b,v0.16b
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+___
+	&aes192_aes256_dec_handle(1,"dec_final3",0,0);
+$code.=<<___;
+	sha256h2	q23, q21, v7.4s
+	sha256su1	v29.4s,v27.4s,v28.4s
+	eor		v3.16b,v0.16b,v30.16b	/* xor w/ ivec (modeop) */
+	/* save aes res, bump aes_out_ptr */
+	st1		{v3.16b},[x1],16
+	b		.Lfrmquad3
+/*
+ * the final block with no aes component, i.e from here there were zero blocks
+ */
+
+.Lzero_aes_blocks_left:
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+	ld1		{v4.16b},[x8],16	/* key0 */
+	ld1		{v5.16b},[x8],16	/* key1 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x8],16	/* key2 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x8],16	/* key3 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+/* quad 1 */
+.Lfrmquad1:
+	ld1		{v4.16b},[x8],16	/* key4 */
+	ld1		{v5.16b},[x8],16	/* key5 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+/* quad 2 */
+.Lfrmquad2:
+	ld1		{v4.16b},[x8],16	/* key4 */
+	ld1		{v5.16b},[x8],16	/* key5 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+/* quad 3 */
+.Lfrmquad3:
+	ld1		{v4.16b},[x8],16	/* key4 */
+	ld1		{v5.16b},[x8],16	/* key5 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256h2	q23, q21, v4.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	eor		v26.16b,v26.16b,v26.16b	/* zero reg */
+	sha256h2	q23, q21, v5.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	eor		v27.16b,v27.16b,v27.16b	/* zero reg */
+	sha256h2	q23, q21, v6.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	eor		v28.16b,v28.16b,v28.16b	/* zero reg */
+	sha256h2	q23, q21, v7.4s
+
+	add		v26.4s,v24.4s,v22.4s	/* ABCD += working copy */
+	eor		v29.16b,v29.16b,v29.16b	/* zero reg */
+	add		v27.4s,v25.4s,v23.4s	/* EFGH += working copy */
+
+	/*
+	 * Calculate final HMAC
+	 */
+	/* base address for sha round consts */
+	adrp		x8,.Lrcon
+	add		x8,x8,:lo12:.Lrcon
+	/* load o_key_pad partial hash */
+	ld1		{v24.16b},[x7],16
+	ld1		{v25.16b},[x7]
+
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+
+	/* Set padding 1 to the first reg */
+	mov		w11, #0x80		/* that's the 1 of the pad */
+	mov		v28.b[3], w11
+	/* size of o_key_pad + inner hash */
+	mov		x11, #64+32
+	lsl		x11, x11, 3
+	/* move length to the end of the block */
+	mov		v29.s[3], w11
+	lsr		x11, x11, 32
+	mov		v29.s[2], w11		/* and the higher part */
+
+	ld1		{v4.16b},[x8],16	/* key0 */
+	ld1		{v5.16b},[x8],16	/* key1 */
+
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x8],16	/* key2 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x8],16	/* key3 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	ld1		{v4.16b},[x8],16	/* key4 */
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	ld1		{v5.16b},[x8],16	/* key5 */
+	sha256h2	q23, q21, v7.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x8],16	/* key6 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x8],16	/* key7 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	ld1		{v4.16b},[x8],16	/* key8 */
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	ld1		{v5.16b},[x8],16	/* key9 */
+	sha256h2	q23, q21, v7.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key8+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x8],16	/* key10 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key9+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x8],16	/* key11 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key10+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	ld1		{v4.16b},[x8],16	/* key12 */
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key11+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	ld1		{v5.16b},[x8],16	/* key13 */
+	sha256h2	q23, q21, v7.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key12+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x8],16	/* key14 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key13+w1 */
+	sha256h2	q23, q21, v4.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x8],16	/* key15 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key14+w2 */
+
+	sha256h2	q23, q21, v5.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+
+	sha256h		q22, q23, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key15+w3 */
+	ldp		d10,d11,[sp,#16]
+	sha256h2	q23, q21, v6.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+
+	sha256h		q22, q23, v7.4s
+	ldp		d12,d13,[sp,#32]
+	sha256h2	q23, q21, v7.4s
+
+	add		v24.4s,v24.4s,v22.4s	/* ABCD += working copy */
+	ldp		d14,d15,[sp,#48]
+	add		v25.4s,v25.4s,v23.4s	/* EFGH += working copy */
+
+	rev32		v24.16b, v24.16b
+	ldp		x19,x20,[sp,#64]
+	ldp		d8,d9,[sp],#80
+	rev32		v25.16b, v25.16b
+	st1		{v24.4s},[x4],16
+	mov		x0, xzr
+	st1		{v25.4s},[x4]
+
+	ret
+
+/*
+ * These are the short cases (less efficient), here used for 1-11 aes blocks.
+ * x10 = aes_blocks
+ */
+.Ldec_short_cases:
+	ldp		q8,q9,[x9],32
+	adrp		x8,.Lrcon		/* rcon */
+	add		x8,x8,:lo12:.Lrcon
+	ldp		q10,q11,[x9],32
+	lsl		x11,x10,4		/* len=aes_blocks*16 */
+
+	ldp		q12,q13,[x9],32
+	ldp		q14,q15,[x9],32
+	ld1		{v30.16b},[x6]		/* get ivec */
+	ldp		q16,q17,[x9],32
+	ld1		{v18.16b},[x9]
+
+	/* get outstanding bytes of the digest */
+	sub		x20,x5,x2
+
+	/* indicate AES blocks to write back */
+	mov		x19,xzr
+
+	mov		x2,x0
+
+	/*
+	 * Digest source has to be at least of cipher source length
+	 * therefore it is safe to use x10 to indicate whether we can
+	 * overtake cipher processing by 4 AES block here.
+	 */
+	cmp		x10,4			/* check if 4 or more */
+	/* if less, bail to last block */
+	blt		.Llast_sha_block
+
+	sub		x5,x5,64
+
+	mov		x9,x8			/* top of rcon */
+
+	/* quad 0 */
+	ld1		{v26.16b},[x3],16
+	ld1		{v4.16b},[x9],16	/* key0 */
+	ld1		{v27.16b},[x3],16
+	rev32		v26.16b,v26.16b
+	ld1		{v28.16b},[x3],16
+	rev32		v27.16b,v27.16b
+	ld1		{v29.16b},[x3],16
+	rev32		v28.16b,v28.16b
+	ld1		{v5.16b},[x9],16	/* key1 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	rev32		v29.16b,v29.16b
+
+	sha256su0	v26.4s,v27.4s
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x9],16	/* key2 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x9],16	/* key3 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	ld1		{v4.16b},[x9],16	/* key4 */
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	ld1		{v5.16b},[x9],16	/* key5 */
+	sha256h2	q23, q21, v7.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 1 */
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x9],16	/* key6 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x9],16	/* key7 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	ld1		{v4.16b},[x9],16	/* key4 */
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	ld1		{v5.16b},[x9],16	/* key5 */
+	sha256h2	q23, q21, v7.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 2 */
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x9],16	/* key6 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x9],16	/* key7 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	ld1		{v4.16b},[x9],16	/* key4 */
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	ld1		{v5.16b},[x9],16	/* key5 */
+	sha256h2	q23, q21, v7.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 3 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x9],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256h2	q23, q21, v4.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x9],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256h2	q23, q21, v5.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256h2	q23, q21, v6.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+
+	add		v24.4s,v24.4s,v22.4s	/* ABCD += working copy */
+	add		v25.4s,v25.4s,v23.4s	/* EFGH += working copy */
+
+	/* there were at least 4 AES blocks to process */
+	b		.Lshort_loop_no_store
+
+.Ldec_short_loop:
+	cmp		x10,4			/* check if 4 or more */
+	/* if less, bail to last block */
+	blt		.Llast_sha_block
+	stp		q0,q1,[x1],32
+	stp		q2,q3,[x1],32
+
+	sub		x19,x19,4
+
+.Lshort_loop_no_store:
+	ld1		{v31.16b},[x2]		/* next w no update */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v0.16b},[x2],16
+
+	add		x0,x0,64
+
+	/* aes xform 0 */
+	aesd		v0.16b,v8.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v9.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v10.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v11.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v12.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v13.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v14.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v15.16b
+	aesimc		v0.16b,v0.16b
+	aesd		v0.16b,v16.16b
+	aesimc		v0.16b,v0.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_short",0,0);
+$code.=<<___;
+	eor		v0.16b,v0.16b,v30.16b	/* xor w/prev value */
+
+	ld1		{v30.16b},[x2]		/* read no update */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v1.16b},[x2],16
+
+	/* aes xform 1 */
+	aesd		v1.16b,v8.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v9.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v10.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v11.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v12.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v13.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v14.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v15.16b
+	aesimc		v1.16b,v1.16b
+	aesd		v1.16b,v16.16b
+	aesimc		v1.16b,v1.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_short",1,0);
+$code.=<<___;
+	eor		v1.16b,v1.16b,v31.16b	/* xor w/prev value */
+
+	ld1		{v31.16b},[x2]		/* read no update */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v2.16b},[x2],16
+
+	/* aes xform 2 */
+	aesd		v2.16b,v8.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v9.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v10.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v11.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v12.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v13.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v14.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v15.16b
+	aesimc		v2.16b,v2.16b
+	aesd		v2.16b,v16.16b
+	aesimc		v2.16b,v2.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_short",2,0);
+$code.=<<___;
+	eor		v2.16b,v2.16b,v30.16b		/* xor w/prev value */
+
+	ld1		{v30.16b},[x2]			/* read no update */
+	/* read next aes block, update aes_ptr_in */
+	ld1		{v3.16b},[x2],16
+
+	/* aes xform 3 */
+	aesd		v3.16b,v8.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v9.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v10.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v11.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v12.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v13.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v14.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v15.16b
+	aesimc		v3.16b,v3.16b
+	aesd		v3.16b,v16.16b
+	aesimc		v3.16b,v3.16b
+___
+	&aes192_aes256_dec_handle(1,"dec_short",3,0);
+$code.=<<___;
+	eor		v3.16b,v3.16b,v31.16b	/* xor w/prev value */
+
+	add		x19,x19,4
+
+	sub		x10,x10,4		/* 4 less */
+	cmp		x5,64
+	b.lt		.Ldec_short_loop	/* keep looping */
+
+	sub		x5,x5,64
+
+	mov		x9,x8			/* top of rcon */
+
+	/* quad 0 */
+	ld1		{v26.16b},[x3],16
+	ld1		{v4.16b},[x9],16	/* key0 */
+	ld1		{v27.16b},[x3],16
+	rev32		v26.16b,v26.16b
+	ld1		{v28.16b},[x3],16
+	rev32		v27.16b,v27.16b
+	ld1		{v29.16b},[x3],16
+	rev32		v28.16b,v28.16b
+	ld1		{v5.16b},[x9],16	/* key1 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	rev32		v29.16b,v29.16b
+
+	sha256su0	v26.4s,v27.4s
+	mov		v22.16b,v24.16b		/* working ABCD <- ABCD */
+	mov		v23.16b,v25.16b		/* working EFGH <- EFGH */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x9],16	/* key2 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x9],16	/* key3 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	ld1		{v4.16b},[x9],16	/* key4 */
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	ld1		{v5.16b},[x9],16	/* key5 */
+	sha256h2	q23, q21, v7.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 1 */
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x9],16	/* key6 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x9],16	/* key7 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	ld1		{v4.16b},[x9],16	/* key4 */
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+	ld1		{v5.16b},[x9],16	/* key5 */
+	add		v4.4s,v4.4s,v26.4s	/* wk = key4+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 2 */
+	sha256su0	v26.4s,v27.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x9],16	/* key6 */
+	sha256h2	q23, q21, v4.4s
+	add		v5.4s,v5.4s,v27.4s	/* wk = key5+w1 */
+	sha256su1	v26.4s,v28.4s,v29.4s
+
+	sha256su0	v27.4s,v28.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x9],16	/* key7 */
+	sha256h2	q23, q21, v5.4s
+	add		v6.4s,v6.4s,v28.4s	/* wk = key6+w2 */
+	sha256su1	v27.4s,v29.4s,v26.4s
+
+	sha256su0	v28.4s,v29.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	ld1		{v4.16b},[x9],16	/* key4 */
+	sha256h2	q23, q21, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key7+w3 */
+	sha256su1	v28.4s,v26.4s,v27.4s
+
+	sha256su0	v29.4s,v26.4s
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	ld1		{v5.16b},[x9],16	/* key5 */
+	sha256h2	q23, q21, v7.4s
+	add		v4.4s,v4.4s,v26.4s	/* wk = key0+w0 */
+	sha256su1	v29.4s,v27.4s,v28.4s
+
+	/* quad 3 */
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v4.4s
+	ld1		{v6.16b},[x9],16	/* key6 */
+	add		v5.4s,v5.4s,v27.4s	/* wk = key1+w1 */
+	sha256h2	q23, q21, v4.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v5.4s
+	ld1		{v7.16b},[x9],16	/* key7 */
+	add		v6.4s,v6.4s,v28.4s	/* wk = key2+w2 */
+	sha256h2	q23, q21, v5.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v6.4s
+	add		v7.4s,v7.4s,v29.4s	/* wk = key3+w3 */
+	sha256h2	q23, q21, v6.4s
+
+	mov		v21.16b, v22.16b	/* copy abcd */
+	sha256h		q22, q23, v7.4s
+	sha256h2	q23, q21, v7.4s
+
+	add		v24.4s,v24.4s,v22.4s	/* ABCD += working copy */
+	add		v25.4s,v25.4s,v23.4s	/* EFGH += working copy */
+
+	b		.Ldec_short_loop	/* keep looping */
+/*
+ * This is arranged so that we can join the common unwind code that does
+ * the last sha block and the final 0-3 aes blocks.
+ */
+.Llast_sha_block:
+	eor		v26.16b,v26.16b,v26.16b		/* zero the rest */
+	eor		v27.16b,v27.16b,v27.16b		/* zero the rest */
+	eor		v28.16b,v28.16b,v28.16b		/* zero the rest */
+	eor		v29.16b,v29.16b,v29.16b		/* zero the rest */
+
+	mov		x13,x10			/* copy aes blocks for common */
+	b		.Ljoin_common		/* join common code */
+
+.size	asm_sha256_hmac_aescbc_dec, .-asm_sha256_hmac_aescbc_dec
+___
+
+if ($flavour =~ /64/) {
+	foreach(split("\n",$code)) {
+	s/\`([^\`]*)\`/eval($1)/geo;
+	print $_,"\n";
+	}
+}
+
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-sha512-armv8.pl b/deps/openssl/openssl/crypto/aes/asm/aes-sha512-armv8.pl
new file mode 100644
index 00000000000..7d5385bbffc
--- /dev/null
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-sha512-armv8.pl
@@ -0,0 +1,2971 @@
+#! /usr/bin/env perl
+
+# Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
+( $xlate="${dir}arm-xlate.pl" and -f $xlate ) or
+( $xlate="${dir}../../perlasm/arm-xlate.pl" and -f $xlate) or
+die "can't locate arm-xlate.pl";
+
+open OUT,"| \"$^X\" $xlate $flavour \"$output\""
+    or die "can't call $xlate: $!";
+*STDOUT=*OUT;
+
+$code=<<___;
+#include "arch/arm_arch.h"
+
+/* These are offsets into the CIPH_DIGEST struct */
+#define CIPHER_KEY	0
+#define CIPHER_KEY_ROUNDS	8
+#define CIPHER_IV	16
+#define HMAC_IKEYPAD	24
+#define HMAC_OKEYPAD	32
+
+.text
+.arch armv8-a+crypto
+___
+
+sub aes_block_9_rounds() {
+	my $i = shift;
+$code.=<<___;
+	/* aes block $i */
+	aese		v$i.16b, v8.16b
+	aesmc		v$i.16b, v$i.16b
+	aese		v$i.16b, v9.16b
+	aesmc		v$i.16b, v$i.16b
+	aese		v$i.16b, v10.16b
+	aesmc		v$i.16b, v$i.16b
+	aese		v$i.16b, v11.16b
+	aesmc		v$i.16b, v$i.16b
+	aese		v$i.16b, v12.16b
+	aesmc		v$i.16b, v$i.16b
+	aese		v$i.16b, v13.16b
+	aesmc		v$i.16b, v$i.16b
+	aese		v$i.16b, v14.16b
+	aesmc		v$i.16b, v$i.16b
+	aese		v$i.16b, v15.16b
+	aesmc		v$i.16b, v$i.16b
+	aese		v$i.16b, v16.16b
+	aesmc		v$i.16b, v$i.16b
+___
+}
+
+sub aes_block_last_rounds () {
+	my $compare = shift;
+	my $label = shift;
+	my $i = shift;
+	my $load_rk10 = shift;
+
+	if($compare == 1) {
+$code.=<<___;
+	cmp		x9, #12		/* tell 128,192,256 apart */
+___
+	}
+$code.=<<___;
+	b.lt		.Laes128_${label}_$i
+.Laes192_${label}_$i:
+	ldp		q18,q19,[x7],32		/* rk[10],rk[11] */
+	aese		v$i.16b,v17.16b
+	aesmc		v$i.16b,v$i.16b
+	aese		v$i.16b,v18.16b
+	aesmc		v$i.16b,v$i.16b
+	b.gt		.Laes256_${label}_$i
+	ld1		{v18.16b},[x7]		/* rk[12] */
+	aese		v$i.16b,v19.16b
+	eor		v$i.16b,v$i.16b,v18.16b
+	sub		x7, x7, #32		/* rewind x7 */
+	b		1f
+.Laes256_${label}_$i:
+	aese		v$i.16b,v19.16b
+	aesmc		v$i.16b,v$i.16b
+	ldp		q18,q19,[x7],32		/* rk[12],rk[13] */
+	aese		v$i.16b,v18.16b
+	aesmc		v$i.16b,v$i.16b
+	ld1		{v18.16b},[x7]		/* rk[14] */
+	aese		v$i.16b,v19.16b
+	eor		v$i.16b,v$i.16b,v18.16b
+	sub		x7, x7, #64		/* rewind x7 */
+	b		1f
+.Laes128_${label}_$i:
+___
+	if ($load_rk10 == 1) {
+$code.=<<___;
+	ld1		{v18.16b},[x7]
+___
+	}
+$code.=<<___;
+	aese		v$i.16b,v17.16b
+	eor		v$i.16b,v$i.16b,v18.16b	/* res */
+1:
+___
+}
+
+sub aes_block_dec_9_rounds() {
+	my $i = shift;
+$code.=<<___;
+	/* aes block $i */
+	aesd		v$i.16b, v8.16b
+	aesimc		v$i.16b, v$i.16b
+	aesd		v$i.16b, v9.16b
+	aesimc		v$i.16b, v$i.16b
+	aesd		v$i.16b, v10.16b
+	aesimc		v$i.16b, v$i.16b
+	aesd		v$i.16b, v11.16b
+	aesimc		v$i.16b, v$i.16b
+	aesd		v$i.16b, v12.16b
+	aesimc		v$i.16b, v$i.16b
+	aesd		v$i.16b, v13.16b
+	aesimc		v$i.16b, v$i.16b
+	aesd		v$i.16b, v14.16b
+	aesimc		v$i.16b, v$i.16b
+	aesd		v$i.16b, v15.16b
+	aesimc		v$i.16b, v$i.16b
+	aesd		v$i.16b, v16.16b
+	aesimc		v$i.16b, v$i.16b
+___
+}
+
+sub aes_block_dec_last_rounds () {
+	my $compare = shift;
+	my $label = shift;
+	my $i = shift;
+	my $load_rk10 = shift;
+
+	if($compare == 1) {
+$code.=<<___;
+	cmp		x9, #12			/* tell 128,192,256 apart */
+___
+	}
+$code.=<<___;
+	b.lt		.Laes128_${label}_$i
+.Laes192_${label}_$i:
+	ldp		q18,q19,[x7],32			/* rk[10],rk[11] */
+	aesd		v$i.16b,v17.16b
+	aesimc		v$i.16b,v$i.16b
+	aesd		v$i.16b,v18.16b
+	aesimc		v$i.16b,v$i.16b
+	b.gt		.Laes256_${label}_$i
+	ld1		{v18.16b},[x7]			/* rk[12] */
+	aesd		v$i.16b,v19.16b
+	eor		v$i.16b,v$i.16b,v18.16b
+	sub		x7, x7, #32			/* rewind x7 */
+	b		1f
+.Laes256_${label}_$i:
+	aesd		v$i.16b,v19.16b
+	aesimc		v$i.16b,v$i.16b
+	ldp		q18,q19,[x7],32			/* rk[12],rk[13] */
+	aesd		v$i.16b,v18.16b
+	aesimc		v$i.16b,v$i.16b
+	ld1		{v18.16b},[x7]			/* rk[14] */
+	aesd		v$i.16b,v19.16b
+	eor		v$i.16b,v$i.16b,v18.16b
+	sub		x7, x7, #64			/* rewind x7 */
+	b		1f
+.Laes128_${label}_$i:
+___
+	if ($load_rk10 == 1) {
+$code.=<<___;
+	ld1	{v18.16b},[x7]
+___
+	}
+$code.=<<___;
+	aesd		v$i.16b,v17.16b
+	eor		v$i.16b,v$i.16b,v18.16b		/* res */
+1:
+___
+}
+
+sub sha512_block() {
+	my @H = map("v$_",(24..28));
+	my @QH = map("q$_",(24..28));
+	my ($FG, $DE) = map("v$_",(29..30));
+	my ($QFG, $QDE) = map("q$_",(29..30));
+	my $M9_10 = "v31";
+	my @MSG = map("v$_", (0..7));
+	my ($W0, $W1) = ("v8", "v9");
+	my ($AB, $CD, $EF, $GH) = map("v$_",(20..23));
+	my $need_revert = shift;
+
+	if($need_revert == 1) {
+$code.=<<___;
+	rev64		@MSG[0].16b, @MSG[0].16b
+	rev64		@MSG[1].16b, @MSG[1].16b
+	rev64		@MSG[2].16b, @MSG[2].16b
+	rev64		@MSG[3].16b, @MSG[3].16b
+	rev64		@MSG[4].16b, @MSG[4].16b
+	rev64		@MSG[5].16b, @MSG[5].16b
+	rev64		@MSG[6].16b, @MSG[6].16b
+	rev64		@MSG[7].16b, @MSG[7].16b
+___
+	}
+$code.=<<___;
+	/* load const k */
+	ld1		{$W0.2d}, [x10], #16
+
+	/* backup ABCDEFGH */
+	mov		$AB.16b, @H[0].16b
+	mov		$CD.16b, @H[1].16b
+	mov		$EF.16b, @H[2].16b
+	mov		$GH.16b, @H[3].16b
+___
+for($i = 0; $i < 32; $i++) {
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16)*/
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+}
+for(;$i<40;$i++) {
+$code.=<<___	if ($i<39);
+	ld1		{$W1.2d},[x10],#16
+___
+$code.=<<___	if ($i==39);
+	sub		x10, x10, #80*8	// rewind
+___
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+}
+$code.=<<___;
+	add		@H[0].2d, @H[0].2d, $AB.2d
+	add		@H[1].2d, @H[1].2d, $CD.2d
+	add		@H[2].2d, @H[2].2d, $EF.2d
+	add		@H[3].2d, @H[3].2d, $GH.2d
+___
+}
+
+{
+	my @H = map("v$_",(24..28));
+	my @QH = map("q$_",(24..28));
+	my ($FG, $DE) = map("v$_",(29..30));
+	my ($QFG, $QDE) = map("q$_",(29..30));
+	my $M9_10 = "v31";
+	my @MSG = map("v$_", (0..7));
+	my ($W0, $W1) = ("v14", "v15");
+	my ($AB, $CD, $EF, $GH) = map("v$_",(20..23));
+
+$code.=<<___;
+/*
+ * asm_aescbc_sha512_hmac(
+ *	csrc,	x0	(cipher src address)
+ *	cdst,	x1	(cipher dst address)
+ *	clen	x2	(cipher length)
+ *	dsrc,	x3	(digest src address)
+ *	ddst,	x4	(digest dst address)
+ *	dlen,	x5	(digest length)
+ *	arg	x6	:
+ *		arg->cipher.key			(round keys)
+ *		arg->cipher.key_rounds		(key rounds)
+ *		arg->cipher.iv			(initialization vector)
+ *		arg->digest.hmac.i_key_pad	(partially hashed i_key_pad)
+ *		arg->digest.hmac.o_key_pad	(partially hashed o_key_pad)
+ *	)
+ */
+
+.global asm_aescbc_sha512_hmac
+.type	asm_aescbc_sha512_hmac,%function
+
+.rodata
+.align 6
+.LK512:
+	.quad	0x428a2f98d728ae22,0x7137449123ef65cd
+	.quad	0xb5c0fbcfec4d3b2f,0xe9b5dba58189dbbc
+	.quad	0x3956c25bf348b538,0x59f111f1b605d019
+	.quad	0x923f82a4af194f9b,0xab1c5ed5da6d8118
+	.quad	0xd807aa98a3030242,0x12835b0145706fbe
+	.quad	0x243185be4ee4b28c,0x550c7dc3d5ffb4e2
+	.quad	0x72be5d74f27b896f,0x80deb1fe3b1696b1
+	.quad	0x9bdc06a725c71235,0xc19bf174cf692694
+	.quad	0xe49b69c19ef14ad2,0xefbe4786384f25e3
+	.quad	0x0fc19dc68b8cd5b5,0x240ca1cc77ac9c65
+	.quad	0x2de92c6f592b0275,0x4a7484aa6ea6e483
+	.quad	0x5cb0a9dcbd41fbd4,0x76f988da831153b5
+	.quad	0x983e5152ee66dfab,0xa831c66d2db43210
+	.quad	0xb00327c898fb213f,0xbf597fc7beef0ee4
+	.quad	0xc6e00bf33da88fc2,0xd5a79147930aa725
+	.quad	0x06ca6351e003826f,0x142929670a0e6e70
+	.quad	0x27b70a8546d22ffc,0x2e1b21385c26c926
+	.quad	0x4d2c6dfc5ac42aed,0x53380d139d95b3df
+	.quad	0x650a73548baf63de,0x766a0abb3c77b2a8
+	.quad	0x81c2c92e47edaee6,0x92722c851482353b
+	.quad	0xa2bfe8a14cf10364,0xa81a664bbc423001
+	.quad	0xc24b8b70d0f89791,0xc76c51a30654be30
+	.quad	0xd192e819d6ef5218,0xd69906245565a910
+	.quad	0xf40e35855771202a,0x106aa07032bbd1b8
+	.quad	0x19a4c116b8d2d0c8,0x1e376c085141ab53
+	.quad	0x2748774cdf8eeb99,0x34b0bcb5e19b48a8
+	.quad	0x391c0cb3c5c95a63,0x4ed8aa4ae3418acb
+	.quad	0x5b9cca4f7763e373,0x682e6ff3d6b2b8a3
+	.quad	0x748f82ee5defb2fc,0x78a5636f43172f60
+	.quad	0x84c87814a1f0ab72,0x8cc702081a6439ec
+	.quad	0x90befffa23631e28,0xa4506cebde82bde9
+	.quad	0xbef9a3f7b2c67915,0xc67178f2e372532b
+	.quad	0xca273eceea26619c,0xd186b8c721c0c207
+	.quad	0xeada7dd6cde0eb1e,0xf57d4f7fee6ed178
+	.quad	0x06f067aa72176fba,0x0a637dc5a2c898a6
+	.quad	0x113f9804bef90dae,0x1b710b35131c471b
+	.quad	0x28db77f523047d84,0x32caab7b40c72493
+	.quad	0x3c9ebe0a15c9bebc,0x431d67c49c100d4c
+	.quad	0x4cc5d4becb3e42b6,0x597f299cfc657e2a
+	.quad	0x5fcb6fab3ad6faec,0x6c44198c4a475817
+	.quad	0	// terminator
+
+.text
+	.align	4
+asm_aescbc_sha512_hmac:
+	AARCH64_VALID_CALL_TARGET
+	/* save callee save register */
+	stp		d8, d9, [sp,#-64]!
+	stp		d10, d11, [sp,#16]
+	stp		d12, d13, [sp,#32]
+	stp		d14, d15, [sp,#48]
+
+	/* load ABCDEFGH */
+	ldr		x7, [x6, #HMAC_IKEYPAD]
+	ld1		{v24.2d, v25.2d, v26.2d, v27.2d}, [x7]
+
+	ldr		x7, [x6, #CIPHER_KEY]
+	ldr		x8, [x6, #CIPHER_IV]
+	ldr		x9, [x6, #CIPHER_KEY_ROUNDS]
+	mov		x12, x7				/* backup x7 */
+
+	adrp		x10, .LK512
+	add		x10, x10, :lo12:.LK512
+
+	lsr		x11, x2, #4			/* aes_block = len/16 */
+	cbz		x11, .Lret			/* return if aes_block = 0 */
+
+	cmp		x11, #16
+	b.lt		.Lenc_short_case
+
+	ld1		{v0.16b}, [x0], #16		/* load plaintext */
+	ld1		{v1.16b}, [x8]			/* load iv */
+
+	eor		v0.16b, v0.16b, v1.16b	/* iv xor plaintext */
+
+	ldp		q8, q9, [x7], #32		/* rk0, rk1 */
+	/* block 0 */
+	aese		v0.16b, v8.16b
+	aesmc		v0.16b, v0.16b
+	ldp		q10, q11, [x7], #32		/* rk2, rk3 */
+	aese		v0.16b, v9.16b
+	aesmc		v0.16b, v0.16b
+	aese		v0.16b, v10.16b
+	aesmc		v0.16b, v0.16b
+	ldp		q12, q13, [x7], #32		/* rk4, rk5 */
+	aese		v0.16b, v11.16b
+	aesmc		v0.16b, v0.16b
+	aese		v0.16b, v12.16b
+	aesmc		v0.16b, v0.16b
+	ldp		q14, q15, [x7], #32		/* rk6, rk7 */
+	aese		v0.16b, v13.16b
+	aesmc		v0.16b, v0.16b
+	aese		v0.16b, v14.16b
+	aesmc		v0.16b, v0.16b
+	ldp		q16, q17, [x7], #32		/* rk8, rk9 */
+	aese		v0.16b, v15.16b
+	aesmc		v0.16b, v0.16b
+	aese		v0.16b, v16.16b
+	aesmc		v0.16b, v0.16b
+	ld1		{v18.16b}, [x7]			/* rk10 */
+___
+&aes_block_last_rounds(1, "enc_prelog", 0, 0);
+$code.=<<___;
+	str		q0, [x1], #16			/* store cipher result */
+	ld1		{v1.16b}, [x0], #16		/* load next block */
+	eor		v1.16b, v1.16b, v0.16b		/* output xor block */
+___
+# process aes blocks from 1 to 7
+for($i = 1; $i < 8; $i = $i + 1) {
+	&aes_block_9_rounds($i);
+	&aes_block_last_rounds(0, "enc_prelog", $i, 0);
+	if($i != 7) {
+		$next = $i + 1;
+$code.=<<___;
+	/* load next block */
+	ld1		{v$next.16b}, [x0], #16
+	/* output xor block */
+	eor		v$next.16b, v$next.16b, v$i.16b
+___
+	}
+$code.=<<___;
+	str		q$i, [x1], #16				/* store cipher result */
+___
+}
+$code.=<<___;
+	sub		x11, x11, #8
+
+.Lenc_main_loop:
+	mov		x7, x12
+	mov		x14, x1
+	/* aes block 0 */
+	ldp		q8, q9, [x7], #32			/* rk0, rk1 */
+	ldp		q10, q11, [x7], #32			/* rk2, rk3 */
+
+	ld1		{v12.16b}, [x0], #16
+	eor		v12.16b, v12.16b, v7.16b
+
+	/* reverse message */
+	rev64		@MSG[0].16b, @MSG[0].16b
+	rev64		@MSG[1].16b, @MSG[1].16b
+	rev64		@MSG[2].16b, @MSG[2].16b
+	rev64		@MSG[3].16b, @MSG[3].16b
+	rev64		@MSG[4].16b, @MSG[4].16b
+	rev64		@MSG[5].16b, @MSG[5].16b
+	rev64		@MSG[6].16b, @MSG[6].16b
+	rev64		@MSG[7].16b, @MSG[7].16b
+	ld1		{$W0.2d}, [x10], #16			/* load const k*/
+
+	/* backup ABCDEFGH */
+	mov		$AB.16b, @H[0].16b
+	mov		$CD.16b, @H[1].16b
+	mov		$EF.16b, @H[2].16b
+	mov		$GH.16b, @H[3].16b
+
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q8, q9, [x7], #32			/* rk4, rk5 */
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	ldp		q10, q11, [x7], #32			/* rk6, rk7 */
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	ldp		q8, q9, [x7], #32			/* rk8, rk9 */
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	cmp		x9, #12
+	b.lt		.Lenc_main_loop_aes128_0
+.Lenc_main_loop_aes192_0:
+	ldp		q10, q11, [x7], #32			/* rk10, rk11 */
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	b.gt		.Lenc_main_loop_aes256_0
+	ld1		{v8.16b},[x7]				/* rk12 */
+	aese		v12.16b, v11.16b
+	eor		v12.16b, v12.16b, v8.16b
+	b		1f
+.Lenc_main_loop_aes256_0:
+	ldp		q8, q9, [x7], #32			/* rk12, rk13 */
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	ld1		{v10.16b},[x7]				/* rk14 */
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+	b		1f
+.Lenc_main_loop_aes128_0:
+	ld1		{v10.16b},[x7]				/* rk10 */
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+1:
+	st1		{v12.16b}, [x1], #16
+	/* aes block 1 */
+	mov		x7, x12
+	ldp		q8, q9, [x7], #32			/* rk0, rk1 */
+	ldp		q10, q11, [x7], #32			/* rk2, rk3 */
+
+	ld1		{v13.16b}, [x0], #16
+	eor		v12.16b, v12.16b, v13.16b
+
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	ldp		q8, q9, [x7], #32			/* rk4, rk5 */
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q10, q11, [x7], #32			/* rk6, rk7 */
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	ldp		q8, q9, [x7], #32			/* rk8, rk9 */
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	cmp		x9, #12
+	b.lt		.Lenc_main_loop_aes128_1
+.Lenc_main_loop_aes192_1:
+	ldp		q10, q11, [x7], #32			/* rk10, rk11 */
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	b.gt		.Lenc_main_loop_aes256_1
+	ld1		{v8.16b},[x7]				/* rk12 */
+	aese		v12.16b, v11.16b
+	eor		v12.16b, v12.16b, v8.16b
+	b		1f
+.Lenc_main_loop_aes256_1:
+	ldp		q8, q9, [x7], #32			/* rk12, rk13 */
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	ld1		{v10.16b},[x7]				/* rk14 */
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+	b		1f
+.Lenc_main_loop_aes128_1:
+	ld1		{v10.16b},[x7]				/* rk10 */
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+1:
+	st1		{v12.16b}, [x1], #16
+	/* aes block 2 */
+	mov		x7, x12
+	ldp		q8, q9, [x7], #32			/* rk0, rk1 */
+	ldp		q10, q11, [x7], #32			/* rk2, rk3 */
+
+	ld1		{v13.16b}, [x0], #16
+	eor		v12.16b, v12.16b, v13.16b
+
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	ldp		q8, q9, [x7], #32			/* rk4, rk5 */
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	ldp		q10, q11, [x7], #32			/* rk6, rk7 */
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q8, q9, [x7], #32			/* rk8, rk9 */
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	cmp		x9, #12
+	b.lt		.Lenc_main_loop_aes128_2
+.Lenc_main_loop_aes192_2:
+	ldp		q10, q11, [x7], #32			/* rk10, rk11 */
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	b.gt		.Lenc_main_loop_aes256_2
+	ld1		{v8.16b},[x7]				/* rk12 */
+	aese		v12.16b, v11.16b
+	eor		v12.16b, v12.16b, v8.16b
+	b		1f
+.Lenc_main_loop_aes256_2:
+	ldp		q8, q9, [x7], #32			/* rk12, rk13 */
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	ld1		{v10.16b},[x7]				/* rk14 */
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+	b		1f
+.Lenc_main_loop_aes128_2:
+	ld1		{v10.16b},[x7]				/* rk10 */
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+1:
+	st1		{v12.16b}, [x1], #16
+	/* aes block 3 */
+	mov		x7, x12
+	ldp		q8, q9, [x7], #32			/* rk0, rk1 */
+	ldp		q10, q11, [x7], #32			/* rk2, rk3 */
+
+	ld1		{v13.16b}, [x0], #16
+	eor		v12.16b, v12.16b, v13.16b
+
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	ldp		q8, q9, [x7], #32			/* rk4, rk5 */
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q10, q11, [x7], #32			/* rk6, rk7 */
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q8, q9, [x7], #32			/* rk8, rk9 */
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	cmp		x9, #12
+	b.lt		.Lenc_main_loop_aes128_3
+.Lenc_main_loop_aes192_3:
+	ldp		q10, q11, [x7], #32			/* rk10, rk11 */
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	b.gt		.Lenc_main_loop_aes256_3
+	ld1		{v8.16b},[x7]				/* rk12 */
+	aese		v12.16b, v11.16b
+	eor		v12.16b, v12.16b, v8.16b
+	b		1f
+.Lenc_main_loop_aes256_3:
+	ldp		q8, q9, [x7], #32			/* rk12, rk13 */
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	ld1		{v10.16b},[x7]				/* rk14 */
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+	b		1f
+.Lenc_main_loop_aes128_3:
+	ld1		{v10.16b},[x7]				/* rk10 */
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+1:
+	st1		{v12.16b}, [x1], #16
+	/* aes block 4 */
+	mov		x7, x12
+	ldp		q8, q9, [x7], #32			/* rk0, rk1 */
+	ldp		q10, q11, [x7], #32			/* rk2, rk3 */
+
+	ld1		{v13.16b}, [x0], #16
+	eor		v12.16b, v12.16b, v13.16b
+
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q8, q9, [x7], #32			/* rk4, rk5 */
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q10, q11, [x7], #32			/* rk6, rk7 */
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q8, q9, [x7], #32			/* rk8, rk9 */
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	cmp		x9, #12
+	b.lt		.Lenc_main_loop_aes128_4
+.Lenc_main_loop_aes192_4:
+	ldp		q10, q11, [x7], #32			/* rk10, rk11 */
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	b.gt		.Lenc_main_loop_aes256_4
+	ld1		{v8.16b},[x7]				/* rk12 */
+	aese		v12.16b, v11.16b
+	eor		v12.16b, v12.16b, v8.16b
+	b		1f
+.Lenc_main_loop_aes256_4:
+	ldp		q8, q9, [x7], #32			/* rk12, rk13 */
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	ld1		{v10.16b},[x7]				/* rk14 */
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+	b		1f
+.Lenc_main_loop_aes128_4:
+	ld1		{v10.16b},[x7]				/* rk10 */
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+1:
+	st1		{v12.16b}, [x1], #16
+	/* aes block 5 */
+	mov		x7, x12
+	ldp		q8, q9, [x7], #32			/* rk0, rk1 */
+	ldp		q10, q11, [x7], #32			/* rk2, rk3 */
+
+	ld1		{v13.16b}, [x0], #16
+	eor		v12.16b, v12.16b, v13.16b
+
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q8, q9, [x7], #32			/* rk4, rk5 */
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q10, q11, [x7], #32			/* rk6, rk7 */
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q8, q9, [x7], #32			/* rk8, rk9 */
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	cmp		x9, #12
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	b.lt		.Lenc_main_loop_aes128_5
+.Lenc_main_loop_aes192_5:
+	ldp		q10, q11, [x7], #32			/* rk10, rk11 */
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	b.gt		.Lenc_main_loop_aes256_5
+	ld1		{v8.16b},[x7]				/* rk12 */
+	aese		v12.16b, v11.16b
+	eor		v12.16b, v12.16b, v8.16b
+	b		1f
+.Lenc_main_loop_aes256_5:
+	ldp		q8, q9, [x7], #32			/* rk12, rk13 */
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	ld1		{v10.16b},[x7]				/* rk14 */
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+	b		1f
+.Lenc_main_loop_aes128_5:
+	ld1		{v10.16b},[x7]				/* rk10 */
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+1:
+	st1		{v12.16b}, [x1], #16
+	/* aes block 6 */
+	mov		x7, x12
+	ldp		q8, q9, [x7], #32			/* rk0, rk1 */
+	ldp		q10, q11, [x7], #32			/* rk2, rk3 */
+
+	ld1		{v13.16b}, [x0], #16
+	eor		v12.16b, v12.16b, v13.16b
+
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ld1		{$W1.2d}, [x10], #16			/* load const k*/
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	ext		$M9_10.16b, @MSG[4].16b, @MSG[5].16b, #8
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q8, q9, [x7], #32			/* rk4, rk5 */
+	/* Wt_PART1 = SSIG0(W(t-15)) + W(t-16) */
+	sha512su0	@MSG[0].2d, @MSG[1].2d
+	/* Wt = SSIG1(W(t-2)) + W(t-7) + Wt_PART1 */
+	sha512su1	@MSG[0].2d, @MSG[7].2d, $M9_10.2d
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	ld1		{$W1.2d},[x10],#16
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q10, q11, [x7], #32			/* rk6, rk7 */
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	ld1		{$W1.2d},[x10],#16
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q8, q9, [x7], #32			/* rk8, rk9 */
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	ld1		{$W1.2d},[x10],#16
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	cmp		x9, #12
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	b.lt		.Lenc_main_loop_aes128_6
+.Lenc_main_loop_aes192_6:
+	ldp		q10, q11, [x7], #32			/* rk10, rk11 */
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	b.gt		.Lenc_main_loop_aes256_6
+	ld1		{v8.16b},[x7]				/* rk12 */
+	aese		v12.16b, v11.16b
+	eor		v12.16b, v12.16b, v8.16b
+	b		1f
+.Lenc_main_loop_aes256_6:
+	ldp		q8, q9, [x7], #32			/* rk12, rk13 */
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	ld1		{v10.16b},[x7]				/* rk14 */
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+	b		1f
+.Lenc_main_loop_aes128_6:
+	ld1		{v10.16b},[x7]				/* rk10 */
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+1:
+	st1		{v12.16b}, [x1], #16
+	/* aes block 7 */
+	mov		x7, x12
+	ldp		q8, q9, [x7], #32			/* rk0, rk1 */
+	ldp		q10, q11, [x7], #32			/* rk2, rk3 */
+
+	ld1		{v13.16b}, [x0], #16
+	eor		v12.16b, v12.16b, v13.16b
+
+	ld1		{$W1.2d},[x10],#16
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	ld1		{$W1.2d},[x10],#16
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q8, q9, [x7], #32			/* rk4, rk5 */
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	ld1		{$W1.2d},[x10],#16
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q10, q11, [x7], #32			/* rk6, rk7 */
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	ld1		{$W1.2d},[x10],#16
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	ldp		q8, q9, [x7], #32			/* rk8, rk9 */
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	sub		x10, x10, #80*8	// rewind
+	add		$W0.2d, $W0.2d, $MSG[0].2d		/* Kt + Wt */
+	ext		$W0.16b, $W0.16b, $W0.16b, #8
+	ext		$FG.16b, @H[2].16b, @H[3].16b, #8
+	ext		$DE.16b, @H[1].16b, @H[2].16b, #8
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	/* T1 = h + Kt + Wt*/
+	add		@H[3].2d, @H[3].2d, $W0.2d
+	/* T1 = T1 + BSIG1(e) + CH(e,f,g) */
+	sha512h		@QH[3], $QFG, $DE.2d
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	cmp		x9, #12
+	add		@H[4].2d, @H[1].2d, @H[3].2d		/* d + T1 */
+	/* T2 = BSIG0(a) + MAJ(a,b,c), T1 + T2 */
+	sha512h2	@QH[3], @QH[1], @H[0].2d
+___
+	($W0,$W1)=($W1,$W0);	push(@MSG,shift(@MSG));
+	# h=g, g=f,f=e,e=d+T1,d=c,c=b,b=a,a=T1+T2
+	@H = (@H[3],@H[0],@H[4],@H[2],@H[1]);
+	@QH = (@QH[3],@QH[0],@QH[4],@QH[2],@QH[1]);
+$code.=<<___;
+	b.lt		.Lenc_main_loop_aes128_7
+.Lenc_main_loop_aes192_7:
+	ldp		q10, q11, [x7], #32		/* rk10, rk11 */
+	aese		v12.16b, v9.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v10.16b
+	aesmc		v12.16b, v12.16b
+	b.gt		.Lenc_main_loop_aes256_7
+	ld1		{v8.16b},[x7]			/* rk12 */
+	aese		v12.16b, v11.16b
+	eor		v12.16b, v12.16b, v8.16b
+	b		1f
+.Lenc_main_loop_aes256_7:
+	ldp		q8, q9, [x7], #32		/* rk12, rk13 */
+	aese		v12.16b, v11.16b
+	aesmc		v12.16b, v12.16b
+	ld1		{v10.16b},[x7]			/* rk14 */
+	aese		v12.16b, v8.16b
+	aesmc		v12.16b, v12.16b
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+	b		1f
+.Lenc_main_loop_aes128_7:
+	ld1		{v10.16b},[x7]			/* rk10 */
+	aese		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+1:
+	add		@H[0].2d, @H[0].2d, $AB.2d
+	add		@H[1].2d, @H[1].2d, $CD.2d
+	add		@H[2].2d, @H[2].2d, $EF.2d
+	add		@H[3].2d, @H[3].2d, $GH.2d
+
+	st1		{v12.16b}, [x1], #16
+
+	ld1		{v0.16b, v1.16b, v2.16b, v3.16b}, [x14], #64
+	ld1		{v4.16b, v5.16b, v6.16b, v7.16b}, [x14]
+
+	sub		x11, x11, #8
+	cmp		x11, #8
+	b.ge	.Lenc_main_loop
+
+	/* epilog - process sha block */
+___
+	&sha512_block(1);
+$code.=<<___;
+	mov		x7, x12
+	ld1		{v0.16b}, [x0], #16		/* load plaintext */
+	ldr		q1, [x14, #48]			/* load the last output of aes block */
+	eor		v0.16b, v0.16b, v1.16b
+
+	ldp		q8, q9, [x7], #32		/* rk0, rk1 */
+	ldp		q10, q11, [x7], #32		/* rk2, rk3 */
+	ldp		q12, q13, [x7], #32		/* rk4, rk5 */
+	ldp		q14, q15, [x7], #32		/* rk6, rk7 */
+	ldp		q16, q17, [x7], #32		/* rk8, rk9 */
+	ld1		{v18.16b}, [x7]			/* rk10 */
+
+	mov		w12, #0x80				/* sha padding 0b10000000 */
+	b		.Lenc_less_than_8_block
+
+	/* aes_block < 16 */
+.Lenc_short_case:
+	ld1		{v0.16b}, [x0], #16		/* load plaintext */
+	ld1		{v1.16b}, [x8]			/* load iv */
+	ldp		q8, q9, [x7], #32		/* rk0, rk1 */
+	ldp		q10, q11, [x7], #32		/* rk2, rk3 */
+	ldp		q12, q13, [x7], #32		/* rk4, rk5 */
+	ldp		q14, q15, [x7], #32		/* rk6, rk7 */
+	ldp		q16, q17, [x7], #32		/* rk8, rk9 */
+	ld1		{v18.16b}, [x7]			/* rk10 */
+	mov		w12, #0x80				/* sha padding 0b10000000 */
+
+	eor		v0.16b, v0.16b, v1.16b	/* iv xor plaintext */
+
+	cmp		x11, #8
+	b.lt		.Lenc_less_than_8_block
+___
+# process 8 aes blocks
+for($i = 0; $i < 8; $i = $i + 1) {
+	&aes_block_9_rounds($i);
+	# only tell 128/192/256 at the first time
+	&aes_block_last_rounds(($i == 0)?1:0, "enc_short", $i, 0);
+	if($i != 7) {
+		$next = $i + 1;
+$code.=<<___;
+	/* load next block */
+	ld1		{v$next.16b}, [x0], #16
+	/* output xor block */
+	eor		v$next.16b, v$next.16b, v$i.16b
+___
+	}
+}
+$code.=<<___;
+	/* store 8 blocks of ciphertext */
+	stp		q0, q1, [x1], #32
+	stp		q2, q3, [x1], #32
+	stp		q4, q5, [x1], #32
+	stp		q6, q7, [x1], #32
+
+	sub		x11, x11, #8
+___
+	# now we have a whole sha512 block
+	&sha512_block(1);
+$code.=<<___;
+	ldr		x7, [x6, #CIPHER_KEY]
+	ldp		q8, q9, [x7]			/* restore clobbered rk0, rk1 */
+	add		x7, x7, #160			/* x7 point to rk10 */
+	cbz		x11, .Lenc_short_no_more_aes_block
+	ld1		{v0.16b}, [x0], #16		/* load plaintext */
+	ldr		q1, [x1, -16]
+	eor		v0.16b, v0.16b, v1.16b
+.Lenc_less_than_8_block:
+	cbz		x11, .Lenc_short_no_more_aes_block
+___
+# process remained aes blocks (<= 7)
+for($i = 0; $i < 7; $i = $i + 1) {
+	&aes_block_9_rounds($i);
+	&aes_block_last_rounds(($i == 0)?1:0, "enc_short_partial", $i, 0);
+$code.=<<___;
+	str		q$i, [x1], #16
+	sub		x11, x11, #1
+	cbz		x11, .Lenc_short_post_Q$i
+___
+	if($i != 6) {
+		$next = $i + 1;
+$code.=<<___;
+	/* load next block*/
+	ld1		{v$next.16b}, [x0], #16
+	/* output xor block */
+	eor		v$next.16b, v$next.16b, v$i.16b
+___
+	}
+}
+$code.=<<___;
+.Lenc_short_no_more_aes_block:
+	eor		v0.16b, v0.16b, v0.16b
+	eor		v1.16b, v1.16b, v1.16b
+	eor		v2.16b, v2.16b, v2.16b
+	eor		v3.16b, v3.16b, v3.16b
+	eor		v4.16b, v4.16b, v4.16b
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v0.b[0], w12
+	b		.Lenc_short_post_sha
+.Lenc_short_post_Q0:
+	eor		v1.16b, v1.16b, v1.16b
+	eor		v2.16b, v2.16b, v2.16b
+	eor		v3.16b, v3.16b, v3.16b
+	eor		v4.16b, v4.16b, v4.16b
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v1.b[0], w12
+	b		.Lenc_short_post_sha
+.Lenc_short_post_Q1:
+	eor		v2.16b, v2.16b, v2.16b
+	eor		v3.16b, v3.16b, v3.16b
+	eor		v4.16b, v4.16b, v4.16b
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v2.b[0], w12
+	b		.Lenc_short_post_sha
+.Lenc_short_post_Q2:
+	eor		v3.16b, v3.16b, v3.16b
+	eor		v4.16b, v4.16b, v4.16b
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v3.b[0], w12
+	b		.Lenc_short_post_sha
+.Lenc_short_post_Q3:
+	eor		v4.16b, v4.16b, v4.16b
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v4.b[0], w12
+	b		.Lenc_short_post_sha
+.Lenc_short_post_Q4:
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v5.b[0], w12
+	b		.Lenc_short_post_sha
+.Lenc_short_post_Q5:
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v6.b[0], w12
+	b		.Lenc_short_post_sha
+.Lenc_short_post_Q6:
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v7.b[0], w12
+	/* we have one padded sha512 block now, process it and
+	   then employ another one to host sha length */
+___
+&sha512_block(1);
+$code.=<<___;
+	eor		v0.16b, v0.16b, v0.16b
+	eor		v1.16b, v1.16b, v1.16b
+	eor		v2.16b, v2.16b, v2.16b
+	eor		v3.16b, v3.16b, v3.16b
+	eor		v4.16b, v4.16b, v4.16b
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+.Lenc_short_post_sha:
+	/* we have last padded sha512 block now */
+	eor		x13, x13, x13			/* length_lo */
+	eor		x14, x14, x14			/* length_hi */
+
+	adds		x13, x13, x2, lsl #3		/* add len in bits */
+	lsr		x15, x2, #61
+	adc		x14, x14, x15
+
+	adds		x13, x13, #1024			/* add i_key_pad 1024 bits */
+	adc		x14, x14, xzr
+
+	mov		v7.d[0], x14
+	mov		v7.d[1], x13
+	rev64		v7.16b, v7.16b
+___
+&sha512_block(1);
+$code.=<<___;
+	/* Final HMAC - opad part */
+	mov		v0.16b, v24.16b
+	mov		v1.16b, v25.16b
+	mov		v2.16b, v26.16b
+	mov		v3.16b, v27.16b
+	eor		v4.16b, v4.16b, v4.16b
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+
+	mov		v4.b[7], w12			/* padding 1 */
+	mov		x13, #1024+512			/* length in bits */
+	mov		v7.d[1], x13
+
+	/* load ABCDEFGH for opad */
+	ldr		x7, [x6, #HMAC_OKEYPAD]
+	ld1		{v24.2d, v25.2d, v26.2d, v27.2d}, [x7]
+___
+&sha512_block(0);
+$code.=<<___;
+.Lret:
+	mov		x0, xzr				/* return 0 */
+
+	rev64		v24.16b, v24.16b
+	rev64		v25.16b, v25.16b
+	rev64		v26.16b, v26.16b
+	rev64		v27.16b, v27.16b
+
+	/* store hash result */
+	st1		{v24.2d,v25.2d,v26.2d,v27.2d},[x4]
+
+	/* restore callee save register */
+	ldp		d10, d11, [sp,#16]
+	ldp		d12, d13, [sp,#32]
+	ldp		d14, d15, [sp,#48]
+	ldp		d8, d9, [sp], #64
+	ret
+.size asm_aescbc_sha512_hmac, .-asm_aescbc_sha512_hmac
+___
+}
+
+{
+	my @H = map("v$_",(24..28));
+	my @QH = map("q$_",(24..28));
+	my ($FG, $DE) = map("v$_",(29..30));
+	my ($QFG, $QDE) = map("q$_",(29..30));
+	my $M9_10 = "v31";
+	my @MSG = map("v$_", (0..7));
+	my ($W0, $W1) = ("v14", "v15");
+	my ($AB, $CD, $EF, $GH) = map("v$_",(20..23));
+
+$code.=<<___;
+/*
+ * asm_sha512_hmac_aescbc_dec(
+ *	csrc,	x0	(cipher src address)
+ *	cdst,	x1	(cipher dst address)
+ *	clen	x2	(cipher length)
+ *	dsrc,	x3	(digest src address)
+ *	ddst,	x4	(digest dst address)
+ *	dlen,	x5	(digest length)
+ *	arg	x6	:
+ *		arg->cipher.key			(round keys)
+ *		arg->cipher.key_rounds		(key rounds)
+ *		arg->cipher.iv			(initialization vector)
+ *		arg->digest.hmac.i_key_pad	(partially hashed i_key_pad)
+ *		arg->digest.hmac.o_key_pad	(partially hashed o_key_pad)
+ *	)
+ */
+
+.global asm_sha512_hmac_aescbc_dec
+.type	asm_sha512_hmac_aescbc_dec,%function
+
+.align	4
+asm_sha512_hmac_aescbc_dec:
+	AARCH64_VALID_CALL_TARGET
+	/* save callee save register */
+	stp		d8, d9, [sp,#-64]!
+	stp		d10, d11, [sp,#16]
+	stp		d12, d13, [sp,#32]
+	stp		d14, d15, [sp,#48]
+
+	/* load ABCDEFGH */
+	ldr		x7, [x6, #HMAC_IKEYPAD]
+	ld1		{v24.2d, v25.2d, v26.2d, v27.2d}, [x7]
+
+	ldr		x7, [x6, #CIPHER_KEY]
+	ldr		x8, [x6, #CIPHER_IV]
+	ldr		x9, [x6, #CIPHER_KEY_ROUNDS]
+	mov		x12, x7			/* backup x7 */
+
+	adrp		x10, .LK512
+	add		x10, x10, :lo12:.LK512
+
+	lsr		x11, x2, #4		/* aes_block = len/16 */
+	cbz		x11, .Ldec_ret		/* return if aes_block = 0 */
+
+	ld1		{v20.16b}, [x8]		/* load iv */
+	cmp		x11, #8
+	b.lt		.Ldec_short_case
+.Ldec_main_loop:
+	ldp		q12, q13, [x0], #32
+	ldp		q14, q15, [x0], #32
+	ldp		q16, q17, [x0], #32
+	ldp		q18, q19, [x0], #32
+
+	ldp		q8, q9, [x7], #32	/* rk0, rk1 */
+	ldp		q10, q11, [x7], #32	/* rk2, rk3 */
+
+	mov		v0.16b, v12.16b
+	mov		v1.16b, v13.16b
+	mov		v2.16b, v14.16b
+	mov		v3.16b, v15.16b
+	mov		v4.16b, v16.16b
+	mov		v5.16b, v17.16b
+	mov		v6.16b, v18.16b
+	mov		v7.16b, v19.16b
+
+	/* 1 round */
+	aesd		v12.16b, v8.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v8.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v8.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v8.16b
+	aesimc		v15.16b, v15.16b
+	aesd		v16.16b, v8.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v17.16b, v8.16b
+	aesimc		v17.16b, v17.16b
+	aesd		v18.16b, v8.16b
+	aesimc		v18.16b, v18.16b
+	aesd		v19.16b, v8.16b
+	aesimc		v19.16b, v19.16b
+
+	/* 2 round */
+	aesd		v12.16b, v9.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v9.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v9.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v9.16b
+	aesimc		v15.16b, v15.16b
+	aesd		v16.16b, v9.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v17.16b, v9.16b
+	aesimc		v17.16b, v17.16b
+	aesd		v18.16b, v9.16b
+	aesimc		v18.16b, v18.16b
+	aesd		v19.16b, v9.16b
+	aesimc		v19.16b, v19.16b
+
+	ldp		q8, q9, [x7], #32	/* rk4, rk5 */
+
+	/* 3 round */
+	aesd		v12.16b, v10.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v10.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v10.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v10.16b
+	aesimc		v15.16b, v15.16b
+	aesd		v16.16b, v10.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v17.16b, v10.16b
+	aesimc		v17.16b, v17.16b
+	aesd		v18.16b, v10.16b
+	aesimc		v18.16b, v18.16b
+	aesd		v19.16b, v10.16b
+	aesimc		v19.16b, v19.16b
+
+	/* 4 round */
+	aesd		v12.16b, v11.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v11.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v11.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v11.16b
+	aesimc		v15.16b, v15.16b
+	aesd		v16.16b, v11.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v17.16b, v11.16b
+	aesimc		v17.16b, v17.16b
+	aesd		v18.16b, v11.16b
+	aesimc		v18.16b, v18.16b
+	aesd		v19.16b, v11.16b
+	aesimc		v19.16b, v19.16b
+
+	ldp		q10, q11, [x7], #32	/* rk6, rk7 */
+
+	/* 5 round */
+	aesd		v12.16b, v8.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v8.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v8.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v8.16b
+	aesimc		v15.16b, v15.16b
+	aesd		v16.16b, v8.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v17.16b, v8.16b
+	aesimc		v17.16b, v17.16b
+	aesd		v18.16b, v8.16b
+	aesimc		v18.16b, v18.16b
+	aesd		v19.16b, v8.16b
+	aesimc		v19.16b, v19.16b
+
+	/* 6 round */
+	aesd		v12.16b, v9.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v9.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v9.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v9.16b
+	aesimc		v15.16b, v15.16b
+	aesd		v16.16b, v9.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v17.16b, v9.16b
+	aesimc		v17.16b, v17.16b
+	aesd		v18.16b, v9.16b
+	aesimc		v18.16b, v18.16b
+	aesd		v19.16b, v9.16b
+	aesimc		v19.16b, v19.16b
+
+	ldp		q8, q9, [x7], #32	/* rk8, rk9 */
+
+	/* 7 round */
+	aesd		v12.16b, v10.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v10.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v10.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v10.16b
+	aesimc		v15.16b, v15.16b
+	aesd		v16.16b, v10.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v17.16b, v10.16b
+	aesimc		v17.16b, v17.16b
+	aesd		v18.16b, v10.16b
+	aesimc		v18.16b, v18.16b
+	aesd		v19.16b, v10.16b
+	aesimc		v19.16b, v19.16b
+
+	/* 8 round */
+	aesd		v12.16b, v11.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v11.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v11.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v11.16b
+	aesimc		v15.16b, v15.16b
+	aesd		v16.16b, v11.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v17.16b, v11.16b
+	aesimc		v17.16b, v17.16b
+	aesd		v18.16b, v11.16b
+	aesimc		v18.16b, v18.16b
+	aesd		v19.16b, v11.16b
+	aesimc		v19.16b, v19.16b
+
+	/* 9 round */
+	aesd		v12.16b, v8.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v8.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v8.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v8.16b
+	aesimc		v15.16b, v15.16b
+	aesd		v16.16b, v8.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v17.16b, v8.16b
+	aesimc		v17.16b, v17.16b
+	aesd		v18.16b, v8.16b
+	aesimc		v18.16b, v18.16b
+	aesd		v19.16b, v8.16b
+	aesimc		v19.16b, v19.16b
+
+	cmp		x9, #12			/* tell 128,192,256 apart */
+
+	b.lt		.Laes128_dec_main
+.Laes192_dec_main:
+	ldp		q10,q11,[x7],32		/* rk10,rk11 */
+	/* 10 round */
+	aesd		v12.16b, v9.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v9.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v9.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v9.16b
+	aesimc		v15.16b, v15.16b
+	aesd		v16.16b, v9.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v17.16b, v9.16b
+	aesimc		v17.16b, v17.16b
+	aesd		v18.16b, v9.16b
+	aesimc		v18.16b, v18.16b
+	aesd		v19.16b, v9.16b
+	aesimc		v19.16b, v19.16b
+
+	/* 11 round */
+	aesd		v12.16b, v10.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v10.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v10.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v10.16b
+	aesimc		v15.16b, v15.16b
+	aesd		v16.16b, v10.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v17.16b, v10.16b
+	aesimc		v17.16b, v17.16b
+	aesd		v18.16b, v10.16b
+	aesimc		v18.16b, v18.16b
+	aesd		v19.16b, v10.16b
+	aesimc		v19.16b, v19.16b
+	b.gt		.Laes256_dec_main
+
+	ld1		{v8.16b},[x7]		/* rk12 */
+
+	/*12 round */
+	aesd		v12.16b, v11.16b
+	eor		v12.16b, v12.16b, v8.16b
+	aesd		v13.16b, v11.16b
+	eor		v13.16b, v13.16b, v8.16b
+	aesd		v14.16b, v11.16b
+	eor		v14.16b, v14.16b, v8.16b
+	aesd		v15.16b, v11.16b
+	eor		v15.16b, v15.16b, v8.16b
+	aesd		v16.16b, v11.16b
+	eor		v16.16b, v16.16b, v8.16b
+	aesd		v17.16b, v11.16b
+	eor		v17.16b, v17.16b, v8.16b
+	aesd		v18.16b, v11.16b
+	eor		v18.16b, v18.16b, v8.16b
+	aesd		v19.16b, v11.16b
+	eor		v19.16b, v19.16b, v8.16b
+
+	sub		x7, x7, #192		/* rewind x7 */
+	b		1f
+.Laes256_dec_main:
+	ldp		q8,q9,[x7],32		/* rk12,rk13 */
+	/* 12 round */
+	aesd		v12.16b, v11.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v11.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v11.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v11.16b
+	aesimc		v15.16b, v15.16b
+	aesd		v16.16b, v11.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v17.16b, v11.16b
+	aesimc		v17.16b, v17.16b
+	aesd		v18.16b, v11.16b
+	aesimc		v18.16b, v18.16b
+	aesd		v19.16b, v11.16b
+	aesimc		v19.16b, v19.16b
+
+	/* 13 round */
+	aesd		v12.16b, v8.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v8.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v8.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v8.16b
+	aesimc		v15.16b, v15.16b
+	aesd		v16.16b, v8.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v17.16b, v8.16b
+	aesimc		v17.16b, v17.16b
+	aesd		v18.16b, v8.16b
+	aesimc		v18.16b, v18.16b
+	aesd		v19.16b, v8.16b
+	aesimc		v19.16b, v19.16b
+
+	ld1		{v10.16b},[x7]			/* rk14 */
+
+	/* 14 round */
+	aesd		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+	aesd		v13.16b, v9.16b
+	eor		v13.16b, v13.16b, v10.16b
+	aesd		v14.16b, v9.16b
+	eor		v14.16b, v14.16b, v10.16b
+	aesd		v15.16b, v9.16b
+	eor		v15.16b, v15.16b, v10.16b
+	aesd		v16.16b, v9.16b
+	eor		v16.16b, v16.16b, v10.16b
+	aesd		v17.16b, v9.16b
+	eor		v17.16b, v17.16b, v10.16b
+	aesd		v18.16b, v9.16b
+	eor		v18.16b, v18.16b, v10.16b
+	aesd		v19.16b, v9.16b
+	eor		v19.16b, v19.16b, v10.16b
+
+	sub		x7, x7, #224
+	b		1f
+.Laes128_dec_main:
+	ld1		{v10.16b},[x7]			/* rk10 */
+	aesd		v12.16b,v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+	aesd		v13.16b,v9.16b
+	eor		v13.16b, v13.16b, v10.16b
+	aesd		v14.16b,v9.16b
+	eor		v14.16b, v14.16b, v10.16b
+	aesd		v15.16b,v9.16b
+	eor		v15.16b, v15.16b, v10.16b
+	aesd		v16.16b,v9.16b
+	eor		v16.16b, v16.16b, v10.16b
+	aesd		v17.16b,v9.16b
+	eor		v17.16b, v17.16b, v10.16b
+	aesd		v18.16b,v9.16b
+	eor		v18.16b, v18.16b, v10.16b
+	aesd		v19.16b,v9.16b
+	eor		v19.16b, v19.16b, v10.16b
+	sub		x7, x7, #160
+
+1:
+	eor		v12.16b, v12.16b, v20.16b
+	eor		v13.16b, v13.16b, v0.16b
+	eor		v14.16b, v14.16b, v1.16b
+	eor		v15.16b, v15.16b, v2.16b
+	eor		v16.16b, v16.16b, v3.16b
+	eor		v17.16b, v17.16b, v4.16b
+	eor		v18.16b, v18.16b, v5.16b
+	eor		v19.16b, v19.16b, v6.16b
+
+	stp		q12,q13, [x1], #32
+	ldr		q12, [x0, #-16]		/* load last cipher */
+	stp		q14,q15, [x1], #32
+	stp		q16,q17, [x1], #32
+	stp		q18,q19, [x1], #32
+___
+	&sha512_block(1);
+$code.=<<___;
+	mov		v20.16b, v12.16b	/* load last cipher */
+	sub		x11, x11, #8
+	cmp		x11, #8
+	b.ge		.Ldec_main_loop
+
+	/* aes_block < 8 */
+.Ldec_short_case:
+	mov		w12, #0x80		/* sha padding 0b10000000 */
+	cbnz		x11, 1f
+	eor		v0.16b, v0.16b, v0.16b
+	eor		v1.16b, v1.16b, v1.16b
+	eor		v2.16b, v2.16b, v2.16b
+	eor		v3.16b, v3.16b, v3.16b
+	eor		v4.16b, v4.16b, v4.16b
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v0.b[0], w12
+	b		.Ldec_short_post_sha
+1:
+	cmp		x11, #4
+	b.lt		.Ldec_less_than_4_block
+
+	ldp		q8, q9, [x7], #32	/* rk0, rk1 */
+	ldp		q10, q11, [x7], #32	/* rk2, rk3 */
+
+	ldp		q12, q13, [x0], #32
+	ldp		q14, q15, [x0], #32
+
+	mov		v0.16b, v12.16b
+	mov		v1.16b, v13.16b
+	mov		v2.16b, v14.16b
+	mov		v3.16b, v15.16b
+
+	/* 1 round */
+	aesd		v12.16b, v8.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v8.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v8.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v8.16b
+	aesimc		v15.16b, v15.16b
+
+	/* 2 round */
+	aesd		v12.16b, v9.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v9.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v9.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v9.16b
+	aesimc		v15.16b, v15.16b
+
+	ldp		q8, q9, [x7], #32	/* rk4, rk5 */
+
+	/* 3 round */
+	aesd		v12.16b, v10.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v10.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v10.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v10.16b
+	aesimc		v15.16b, v15.16b
+
+	/* 4 round */
+	aesd		v12.16b, v11.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v11.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v11.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v11.16b
+	aesimc		v15.16b, v15.16b
+
+	ldp		q10, q11, [x7], #32	/* rk6, rk7 */
+
+	/* 5 round */
+	aesd		v12.16b, v8.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v8.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v8.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v8.16b
+	aesimc		v15.16b, v15.16b
+
+	/* 6 round */
+	aesd		v12.16b, v9.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v9.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v9.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v9.16b
+	aesimc		v15.16b, v15.16b
+
+	ldp		q8, q9, [x7], #32	/* rk8, rk9 */
+
+	/* 7 round */
+	aesd		v12.16b, v10.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v10.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v10.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v10.16b
+	aesimc		v15.16b, v15.16b
+
+	/* 8 round */
+	aesd		v12.16b, v11.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v11.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v11.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v11.16b
+	aesimc		v15.16b, v15.16b
+
+	/* 9 round */
+	aesd		v12.16b, v8.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v8.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v8.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v8.16b
+	aesimc		v15.16b, v15.16b
+
+	cmp		x9, #12			/* tell 128,192,256 apart */
+
+	b.lt		.Laes128_dec_short
+.Laes192_dec_short:
+	ldp		q10,q11,[x7],32		/* rk10,rk11 */
+
+	/* 10 round */
+	aesd		v12.16b, v9.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v9.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v9.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v9.16b
+	aesimc		v15.16b, v15.16b
+
+	/* 11 round */
+	aesd		v12.16b, v10.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v10.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v10.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v10.16b
+	aesimc		v15.16b, v15.16b
+	b.gt		.Laes256_dec_short
+
+	ld1		{v8.16b},[x7]			/* rk12 */
+
+	/*12 round */
+	aesd		v12.16b, v11.16b
+	eor		v12.16b, v12.16b, v8.16b
+	aesd		v13.16b, v11.16b
+	eor		v13.16b, v13.16b, v8.16b
+	aesd		v14.16b, v11.16b
+	eor		v14.16b, v14.16b, v8.16b
+	aesd		v15.16b, v11.16b
+	eor		v15.16b, v15.16b, v8.16b
+
+	sub		x7, x7, #192			/* rewind x7 */
+	b		1f
+.Laes256_dec_short:
+	ldp		q8,q9,[x7],32			/* rk12,rk13 */
+	/* 12 round */
+	aesd		v12.16b, v11.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v11.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v11.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v11.16b
+	aesimc		v15.16b, v15.16b
+
+	/* 13 round */
+	aesd		v12.16b, v8.16b
+	aesimc		v12.16b, v12.16b
+	aesd		v13.16b, v8.16b
+	aesimc		v13.16b, v13.16b
+	aesd		v14.16b, v8.16b
+	aesimc		v14.16b, v14.16b
+	aesd		v15.16b, v8.16b
+	aesimc		v15.16b, v15.16b
+
+	ld1		{v10.16b},[x7]			/* rk14 */
+
+	/* 14 round */
+	aesd		v12.16b, v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+	aesd		v13.16b, v9.16b
+	eor		v13.16b, v13.16b, v10.16b
+	aesd		v14.16b, v9.16b
+	eor		v14.16b, v14.16b, v10.16b
+	aesd		v15.16b, v9.16b
+	eor		v15.16b, v15.16b, v10.16b
+
+	sub		x7, x7, #224
+	b		1f
+.Laes128_dec_short:
+	ld1		{v10.16b},[x7]			/* rk10 */
+	aesd		v12.16b,v9.16b
+	eor		v12.16b, v12.16b, v10.16b
+	aesd		v13.16b,v9.16b
+	eor		v13.16b, v13.16b, v10.16b
+	aesd		v14.16b,v9.16b
+	eor		v14.16b, v14.16b, v10.16b
+	aesd		v15.16b,v9.16b
+	eor		v15.16b, v15.16b, v10.16b
+	sub		x7, x7, #160
+1:
+	eor		v12.16b, v12.16b, v20.16b
+	eor		v13.16b, v13.16b, v0.16b
+	eor		v14.16b, v14.16b, v1.16b
+	eor		v15.16b, v15.16b, v2.16b
+	ldr		q20, [x0, #-16]
+
+	sub		x11, x11, #4
+
+	stp		q12,q13, [x1], #32
+	stp		q14,q15, [x1], #32
+	cbz		x11, .Ldec_short_post_Q3
+___
+for($i = 0; $i < 3; $i = $i + 1) {
+	$block = $i + 4;
+$code.=<<___;
+	ld1		{v16.16b}, [x0], #16
+	mov		v$block.16b, v16.16b
+
+	ldp		q8, q9, [x7], #32		/* rk0, rk1 */
+	ldp		q10, q11, [x7], #32		/* rk2, rk3 */
+
+	aesd		v16.16b, v8.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v16.16b, v9.16b
+	aesimc		v16.16b, v16.16b
+	ldp		q8, q9, [x7], #32		/* rk4, rk5 */
+	aesd		v16.16b, v10.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v16.16b, v11.16b
+	aesimc		v16.16b, v16.16b
+	ldp		q10, q11, [x7], #32		/* rk6, rk7 */
+	aesd		v16.16b, v8.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v16.16b, v9.16b
+	aesimc		v16.16b, v16.16b
+	ldp		q8, q9, [x7], #32		/* rk8, rk9 */
+	aesd		v16.16b, v10.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v16.16b, v11.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v16.16b, v8.16b
+	aesimc		v16.16b, v16.16b
+	cmp		x9, #12			/* tell 128,192,256 apart */
+	b.lt		.Laes128_dec_short_$block
+.Laes192_dec_short_$block:
+	ldp		q10,q11,[x7],32			/* rk10,rk11 */
+	aesd		v16.16b, v9.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v16.16b, v10.16b
+	aesimc		v16.16b, v16.16b
+	b.gt		.Laes256_dec_short_$block
+	ld1		{v8.16b},[x7]			/* rk12 */
+	aesd		v16.16b, v11.16b
+	eor		v16.16b, v16.16b, v8.16b
+	sub		x7, x7, #192			/* rewind x7 */
+	b		1f
+.Laes256_dec_short_$block:
+	ldp		q8,q9,[x7],32			/* rk12,rk13 */
+	aesd		v16.16b, v11.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v16.16b, v8.16b
+	aesimc		v16.16b, v16.16b
+	ld1		{v10.16b},[x7]			/* rk14 */
+	aesd		v16.16b, v9.16b
+	eor		v16.16b, v16.16b, v10.16b
+	sub		x7, x7, #224
+	b		1f
+.Laes128_dec_short_$block:
+	ld1		{v10.16b},[x7]			/* rk10 */
+	aesd		v16.16b,v9.16b
+	eor		v16.16b, v16.16b, v10.16b
+	sub		x7, x7, #160
+1:
+	sub		x11, x11, 1
+	eor		v16.16b, v16.16b, v20.16b
+	ldr		q20, [x0, #-16]
+	st1		{v16.16b}, [x1], #16
+	cbz		x11, .Ldec_short_post_Q$block
+___
+}
+$code.=<<___;
+.Ldec_short_post_Q3:
+	eor		v4.16b, v4.16b, v4.16b
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v4.b[0], w12
+	b		.Ldec_short_post_sha
+.Ldec_short_post_Q4:
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v5.b[0], w12
+	b		.Ldec_short_post_sha
+.Ldec_short_post_Q5:
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v6.b[0], w12
+	b		.Ldec_short_post_sha
+.Ldec_short_post_Q6:
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v7.b[0], w12
+	/* we have one padded sha512 block now, process it and
+	   then employ another one to host sha length */
+___
+&sha512_block(1);
+$code.=<<___;
+	eor		v0.16b, v0.16b, v0.16b
+	eor		v1.16b, v1.16b, v1.16b
+	eor		v2.16b, v2.16b, v2.16b
+	eor		v3.16b, v3.16b, v3.16b
+	eor		v4.16b, v4.16b, v4.16b
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	b		.Ldec_short_post_sha
+
+.Ldec_less_than_4_block:
+___
+for($i = 0; $i < 3; $i = $i + 1) {
+$code.=<<___;
+	ld1		{v16.16b}, [x0], #16
+	mov		v$i.16b, v16.16b
+
+	ldp		q8, q9, [x7], #32		/* rk0, rk1 */
+	ldp		q10, q11, [x7], #32		/* rk2, rk3 */
+
+	aesd		v16.16b, v8.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v16.16b, v9.16b
+	aesimc		v16.16b, v16.16b
+	ldp		q8, q9, [x7], #32		/* rk4, rk5 */
+	aesd		v16.16b, v10.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v16.16b, v11.16b
+	aesimc		v16.16b, v16.16b
+	ldp		q10, q11, [x7], #32		/* rk6, rk7 */
+	aesd		v16.16b, v8.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v16.16b, v9.16b
+	aesimc		v16.16b, v16.16b
+	ldp		q8, q9, [x7], #32		/* rk8, rk9 */
+	aesd		v16.16b, v10.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v16.16b, v11.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v16.16b, v8.16b
+	aesimc		v16.16b, v16.16b
+	cmp		x9, #12				/* tell 128,192,256 apart */
+	b.lt		.Laes128_dec_short_less_than_4_$i
+.Laes192_dec_short_less_than_4_$i:
+	ldp		q10,q11,[x7],32			/* rk10,rk11 */
+	aesd		v16.16b, v9.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v16.16b, v10.16b
+	aesimc		v16.16b, v16.16b
+	b.gt		.Laes256_dec_short_less_than_4_$i
+	ld1		{v8.16b},[x7]			/* rk12 */
+	aesd		v16.16b, v11.16b
+	eor		v16.16b, v16.16b, v8.16b
+	sub		x7, x7, #192			/* rewind x7 */
+	b		1f
+.Laes256_dec_short_less_than_4_$i:
+	ldp		q8,q9,[x7],32			/* rk12,rk13 */
+	aesd		v16.16b, v11.16b
+	aesimc		v16.16b, v16.16b
+	aesd		v16.16b, v8.16b
+	aesimc		v16.16b, v16.16b
+	ld1		{v10.16b},[x7]			/* rk14 */
+	aesd		v16.16b, v9.16b
+	eor		v16.16b, v16.16b, v10.16b
+	sub		x7, x7, #224
+	b		1f
+.Laes128_dec_short_less_than_4_$i:
+	ld1		{v10.16b},[x7]			/* rk10 */
+	aesd		v16.16b,v9.16b
+	eor		v16.16b, v16.16b, v10.16b
+	sub		x7, x7, #160
+1:
+	sub		x11, x11, 1
+	eor		v16.16b, v16.16b, v20.16b
+	ldr		q20, [x0, #-16]
+	st1		{v16.16b}, [x1], #16
+	cbz		x11, .Ldec_short_post_Q$i
+___
+}
+$code.=<<___;
+.Ldec_short_post_Q0:
+	eor		v1.16b, v1.16b, v1.16b
+	eor		v2.16b, v2.16b, v2.16b
+	eor		v3.16b, v3.16b, v3.16b
+	eor		v4.16b, v4.16b, v4.16b
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v1.b[0], w12
+	b		.Ldec_short_post_sha
+.Ldec_short_post_Q1:
+	eor		v2.16b, v2.16b, v2.16b
+	eor		v3.16b, v3.16b, v3.16b
+	eor		v4.16b, v4.16b, v4.16b
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v2.b[0], w12
+	b		.Ldec_short_post_sha
+.Ldec_short_post_Q2:
+	eor		v3.16b, v3.16b, v3.16b
+	eor		v4.16b, v4.16b, v4.16b
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+	mov		v3.b[0], w12
+	b		.Ldec_short_post_sha
+.Ldec_short_post_sha:
+	/* we have last padded sha512 block now */
+	eor		x13, x13, x13		/* length_lo */
+	eor		x14, x14, x14		/* length_hi */
+
+	adds		x13, x13, x2, lsl #3	/* add len in bits */
+	lsr		x15, x2, #61
+	adc		x14, x14, x15
+
+	adds		x13, x13, #1024		/* add i_key_pad 1024 bits */
+	adc		x14, x14, xzr
+
+	mov		v7.d[0], x14
+	mov		v7.d[1], x13
+	rev64		v7.16b, v7.16b
+___
+&sha512_block(1);
+$code.=<<___;
+	/* Final HMAC - opad part */
+	mov		v0.16b, v24.16b
+	mov		v1.16b, v25.16b
+	mov		v2.16b, v26.16b
+	mov		v3.16b, v27.16b
+	eor		v4.16b, v4.16b, v4.16b
+	eor		v5.16b, v5.16b, v5.16b
+	eor		v6.16b, v6.16b, v6.16b
+	eor		v7.16b, v7.16b, v7.16b
+
+	mov		v4.b[7], w12		/* padding 1 */
+	mov		x13, #1024+512		/* length in bits */
+	mov		v7.d[1], x13
+
+	/* load ABCDEFGH for opad */
+	ldr		x7, [x6, #HMAC_OKEYPAD]
+	ld1		{v24.2d, v25.2d, v26.2d, v27.2d}, [x7]
+___
+&sha512_block(0);
+$code.=<<___;
+.Ldec_ret:
+	mov		x0, xzr			/* return 0 */
+
+	rev64		v24.16b, v24.16b
+	rev64		v25.16b, v25.16b
+	rev64		v26.16b, v26.16b
+	rev64		v27.16b, v27.16b
+
+	/* store hash result */
+	st1		{v24.2d,v25.2d,v26.2d,v27.2d},[x4]
+
+	/* restore callee save register */
+	ldp		d10, d11, [sp,#16]
+	ldp		d12, d13, [sp,#32]
+	ldp		d14, d15, [sp,#48]
+	ldp		d8, d9, [sp], #64
+	ret
+.size asm_sha512_hmac_aescbc_dec, .-asm_sha512_hmac_aescbc_dec
+___
+}
+#########################################
+{	my  %opcode = (
+	"sha512h"	=> 0xce608000,	"sha512h2"	=> 0xce608400,
+	"sha512su0"	=> 0xcec08000,	"sha512su1"	=> 0xce608800	);
+
+	sub unsha512 {
+	my ($mnemonic,$arg)=@_;
+
+	$arg =~ m/[qv]([0-9]+)[^,]*,\s*[qv]([0-9]+)[^,]*(?:,\s*[qv]([0-9]+))?/o
+	&&
+	sprintf ".inst\t0x%08x\t//%s %s",
+			$opcode{$mnemonic}|$1|($2<<5)|($3<<16),
+			$mnemonic,$arg;
+	}
+}
+
+open SELF,$0;
+while(<SELF>) {
+	next if (/^#!/);
+	last if (!s/^#/\/\// and !/^$/);
+	print;
+}
+close SELF;
+
+foreach(split("\n",$code)) {
+	s/\`([^\`]*)\`/eval($1)/ge;
+	s/\b(sha512\w+)\s+([qv].*)/unsha512($1,$2)/ge;
+	print $_,"\n";
+}
+
+close STDOUT or die "error closing STDOUT: $!";
\ No newline at end of file
diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-sparcv9.pl b/deps/openssl/openssl/crypto/aes/asm/aes-sparcv9.pl
index d15640e3d76..26703760fb5 100755
--- a/deps/openssl/openssl/crypto/aes/asm/aes-sparcv9.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-sparcv9.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,7 +8,7 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. Rights for redistribution and usage in source and binary
 # forms are granted according to the License.
 # ====================================================================
@@ -85,7 +85,7 @@ $code.=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #ifdef  __arch64__
 .register	%g2,#scratch
diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-x86_64.pl b/deps/openssl/openssl/crypto/aes/asm/aes-x86_64.pl
index 8c7b205a051..b8995603195 100755
--- a/deps/openssl/openssl/crypto/aes/asm/aes-x86_64.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aes-x86_64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2005-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Version 2.1.
@@ -1337,8 +1337,7 @@ $code.=<<___;
 ___
 }

-# int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
-#                        AES_KEY *key)
+# int AES_set_encrypt_key(const unsigned char *userKey, int bits, AES_KEY *key)
 $code.=<<___;
 .globl	AES_set_encrypt_key
 .type	AES_set_encrypt_key,\@function,3
@@ -1618,8 +1617,7 @@ $code.=<<___;
 ___
 }

-# int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
-#                        AES_KEY *key)
+# int AES_set_decrypt_key(const unsigned char *userKey, int bits, AES_KEY *key)
 $code.=<<___;
 .globl	AES_set_decrypt_key
 .type	AES_set_decrypt_key,\@function,3
@@ -1715,7 +1713,7 @@ ___

 # void AES_cbc_encrypt (const void char *inp, unsigned char *out,
 #			size_t length, const AES_KEY *key,
-#			unsigned char *ivp,const int enc);
+#			unsigned char *ivp, int enc);
 {
 # stack frame layout
 # -8(%rsp)		return address
@@ -2642,7 +2640,7 @@ ___
 $code.=<<___;
 	.long	0x80808080, 0x80808080, 0xfefefefe, 0xfefefefe
 	.long	0x1b1b1b1b, 0x1b1b1b1b, 0, 0
-.asciz  "AES for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz  "AES for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	64
 .previous
 ___
diff --git a/deps/openssl/openssl/crypto/aes/asm/aesfx-sparcv9.pl b/deps/openssl/openssl/crypto/aes/asm/aesfx-sparcv9.pl
index 372778e424e..b02ebb2cb59 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aesfx-sparcv9.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aesfx-sparcv9.pl
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # March 2016
@@ -42,7 +42,7 @@ $code.=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #define LOCALS (STACK_BIAS+STACK_FRAME)

@@ -1142,7 +1142,7 @@ aes_fx_ctr32_encrypt_blocks:
 	.byte	0, 0, 56,  8,	0, 56,  8, -56
 .Lone:
 	.word	0, 1
-.asciz	"AES for Fujitsu SPARC64 X, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"AES for Fujitsu SPARC64 X, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	4
 ___
 }
diff --git a/deps/openssl/openssl/crypto/aes/asm/aesni-mb-x86_64.pl b/deps/openssl/openssl/crypto/aes/asm/aesni-mb-x86_64.pl
index 87ed95cdf33..ee425eea00f 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aesni-mb-x86_64.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aesni-mb-x86_64.pl
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # Multi-buffer AES-NI procedures process several independent buffers
diff --git a/deps/openssl/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl b/deps/openssl/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl
index bc08da94606..b2c6c71a6fb 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # June 2011
@@ -1751,7 +1751,7 @@ K_XX_XX:
 .long	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f	# pbswap mask
 .byte	0xf,0xe,0xd,0xc,0xb,0xa,0x9,0x8,0x7,0x6,0x5,0x4,0x3,0x2,0x1,0x0

-.asciz	"AESNI-CBC+SHA1 stitch for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"AESNI-CBC+SHA1 stitch for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	64
 .previous
 ___
diff --git a/deps/openssl/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl b/deps/openssl/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl
index 6715ba2e11a..fbf203489fb 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # January 2013
@@ -216,7 +216,7 @@ $TABLE:
 	.long	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
 	.long	0,0,0,0,   0,0,0,0,   -1,-1,-1,-1
 	.long	0,0,0,0,   0,0,0,0
-	.asciz	"AESNI-CBC+SHA256 stitch for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+	.asciz	"AESNI-CBC+SHA256 stitch for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	64
 .previous
 ___
diff --git a/deps/openssl/openssl/crypto/aes/asm/aesni-x86.pl b/deps/openssl/openssl/crypto/aes/asm/aesni-x86.pl
index 7cf838db170..3f1bb47ab01 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aesni-x86.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aesni-x86.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2009-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # This module implements support for Intel AES-NI extension. In
@@ -3406,7 +3406,7 @@ my ($l_,$block,$i1,$i3,$i5) = ($rounds_,$key_,$rounds,$len,$out);
 &data_word(0x04070605,0x04070605,0x04070605,0x04070605);
 &data_word(1,1,1,1);
 &data_word(0x1b,0x1b,0x1b,0x1b);
-&asciz("AES for Intel AES-NI, CRYPTOGAMS by <appro\@openssl.org>");
+&asciz("AES for Intel AES-NI, CRYPTOGAMS by <https://github.com/dot-asm>");

 &asm_finish();

diff --git a/deps/openssl/openssl/crypto/aes/asm/aesni-x86_64.pl b/deps/openssl/openssl/crypto/aes/asm/aesni-x86_64.pl
index bff33f2b8dc..06b8ff8c8b9 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aesni-x86_64.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aesni-x86_64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2009-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2009-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # This module implements support for Intel AES-NI extension. In
@@ -4764,7 +4764,7 @@ $code.=<<___;
 .Lkey_rcon1b:
 	.long	0x1b,0x1b,0x1b,0x1b

-.asciz  "AES for Intel AES-NI, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz  "AES for Intel AES-NI, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	64
 .previous
 ___
diff --git a/deps/openssl/openssl/crypto/aes/asm/aesni-xts-avx512.pl b/deps/openssl/openssl/crypto/aes/asm/aesni-xts-avx512.pl
index 16f2bbe7896..8cd755172ab 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aesni-xts-avx512.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aesni-xts-avx512.pl
@@ -1,7 +1,8 @@
 #! /usr/bin/env perl
+# Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
 # Copyright (C) 2023 Intel Corporation
 #
-# Licensed under the OpenSSL license (the "License").  You may not use
+# Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
 # in the file LICENSE in the source distribution or at
 # https://www.openssl.org/source/license.html
diff --git a/deps/openssl/openssl/crypto/aes/asm/aesp8-ppc.pl b/deps/openssl/openssl/crypto/aes/asm/aesp8-ppc.pl
index 38b9405a283..b7d1fe2f8af 100755
--- a/deps/openssl/openssl/crypto/aes/asm/aesp8-ppc.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aesp8-ppc.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2014-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # This module implements support for AES instructions as per PowerISA
@@ -109,7 +109,7 @@ Lconsts:
 	blr
 	.long	0
 	.byte	0,12,0x14,0,0,0,0,0
-.asciz	"AES for PowerISA 2.07, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"AES for PowerISA 2.07, CRYPTOGAMS by <https://github.com/dot-asm>"

 .globl	.${prefix}_set_encrypt_key
 .align	5
diff --git a/deps/openssl/openssl/crypto/aes/asm/aest4-sparcv9.pl b/deps/openssl/openssl/crypto/aes/asm/aest4-sparcv9.pl
index c04b5f3cdaf..877d83ad94d 100644
--- a/deps/openssl/openssl/crypto/aes/asm/aest4-sparcv9.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aest4-sparcv9.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2012-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2012-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -94,7 +94,7 @@ $code.=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #ifdef	__arch64__
 .register	%g2,#scratch
diff --git a/deps/openssl/openssl/crypto/aes/asm/aesv8-armx.pl b/deps/openssl/openssl/crypto/aes/asm/aesv8-armx.pl
index af501f8ff57..1516ba115e6 100755
--- a/deps/openssl/openssl/crypto/aes/asm/aesv8-armx.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/aesv8-armx.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2014-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2014-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # This module implements support for ARMv8 AES instructions. The
@@ -75,7 +75,7 @@ $prefix="aes_v8";
 $_byte = ($flavour =~ /win/ ? "DCB" : ".byte");

 $code=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 #if __ARM_MAX_ARCH__>=7
 ___
diff --git a/deps/openssl/openssl/crypto/aes/asm/bsaes-armv7.pl b/deps/openssl/openssl/crypto/aes/asm/bsaes-armv7.pl
index 6cbd00e2c67..86d8cb5b7ce 100644
--- a/deps/openssl/openssl/crypto/aes/asm/bsaes-armv7.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/bsaes-armv7.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2012-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2012-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 #
 # Specific modes and adaptation for Linux kernel by Ard Biesheuvel
 # of Linaro.
@@ -33,8 +33,7 @@
 # key conv.	440  cycles per 128-bit key/0.18 of 8x block
 #
 # Snapdragon S4 encrypts byte in 17.6 cycles and decrypts in 19.7,
-# which is [much] worse than anticipated (for further details see
-# http://www.openssl.org/~appro/Snapdragon-S4.html).
+# which is [much] worse than anticipated
 #
 # Cortex-A15 manages in 14.2/16.1 cycles [when integer-only code
 # manages in 20.0 cycles].
@@ -45,7 +44,7 @@
 # results keep in mind key schedule conversion overhead (see
 # bsaes-x86_64.pl for further details)...
 #
-#						<appro@openssl.org>
+#						<https://github.com/dot-asm>

 # April-August 2013
 # Add CBC, CTR and XTS subroutines and adapt for kernel use; courtesy of Ard.
@@ -707,7 +706,7 @@ ___

 $code.=<<___;
 #ifndef __KERNEL__
-# include "arm_arch.h"
+# include "arch/arm_arch.h"

 # define VFP_ABI_PUSH	vstmdb	sp!,{d8-d15}
 # define VFP_ABI_POP	vldmia	sp!,{d8-d15}
@@ -835,7 +834,7 @@ _bsaes_const:
 	.quad	0x02060a0e03070b0f, 0x0004080c0105090d
 .LREVM0SR:
 	.quad	0x090d01050c000408, 0x03070b0f060a0e02
-.asciz	"Bit-sliced AES for NEON, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Bit-sliced AES for NEON, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	6
 .size	_bsaes_const,.-_bsaes_const

diff --git a/deps/openssl/openssl/crypto/aes/asm/bsaes-armv8.pl b/deps/openssl/openssl/crypto/aes/asm/bsaes-armv8.pl
index 912538622b3..f7cfa7677d8 100644
--- a/deps/openssl/openssl/crypto/aes/asm/bsaes-armv8.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/bsaes-armv8.pl
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -32,17 +32,16 @@ sub data
 }

 __END__
-// Copyright 2021-2025 The OpenSSL Project Authors. All Rights Reserved.
+// Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
 //
-// Licensed under the OpenSSL license (the "License").  You may not use
+// Licensed under the Apache License 2.0 (the "License").  You may not use
 // this file except in compliance with the License.  You can obtain a copy
 // in the file LICENSE in the source distribution or at
 // https://www.openssl.org/source/license.html
 //
 // ====================================================================
 // Written by Ben Avison <bavison@riscosopen.org> for the OpenSSL
-// project. Rights for redistribution and usage in source and binary
-// forms are granted according to the OpenSSL license.
+// project.
 // ====================================================================
 //
 // This implementation is a translation of bsaes-armv7 for AArch64.
@@ -56,7 +55,7 @@ __END__
 // up in Perl, and it is presented as pure assembly.


-#include "crypto/arm_arch.h"
+#include "arch/arm_arch.h"

 .text

diff --git a/deps/openssl/openssl/crypto/aes/asm/bsaes-x86_64.pl b/deps/openssl/openssl/crypto/aes/asm/bsaes-x86_64.pl
index 7230f760856..e04d2aaaf4d 100644
--- a/deps/openssl/openssl/crypto/aes/asm/bsaes-x86_64.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/bsaes-x86_64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2011-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2011-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -95,7 +95,7 @@
 # Add bsaes_xts_[en|de]crypt. Less-than-80-bytes-block performance is
 # suboptimal, but XTS is meant to be used with larger blocks...
 #
-#						<appro@openssl.org>
+#						<https://github.com/dot-asm>

 # $output is the last argument if it looks like a file (it has an extension)
 # $flavour is the first argument if it doesn't look like a file
diff --git a/deps/openssl/openssl/crypto/aes/asm/vpaes-armv8.pl b/deps/openssl/openssl/crypto/aes/asm/vpaes-armv8.pl
index 78c8d90ba48..cca6460a998 100755
--- a/deps/openssl/openssl/crypto/aes/asm/vpaes-armv8.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/vpaes-armv8.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2015-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -18,7 +18,7 @@
 ## http://crypto.stanford.edu/vpaes/.
 ##
 ######################################################################
-# ARMv8 NEON adaptation by <appro@openssl.org>
+# ARMv8 NEON adaptation by <https://github.com/dot-asm>
 #
 # Reason for undertaken effort is that there is at least one popular
 # SoC based on Cortex-A53 that doesn't have crypto extensions.
@@ -53,7 +53,7 @@ open OUT,"| \"$^X\" $xlate $flavour \"$output\""
 *STDOUT=*OUT;

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 .rodata

@@ -1254,48 +1254,6 @@ vpaes_ecb_encrypt:
 	AARCH64_VALIDATE_LINK_REGISTER
 	ret
 .size	vpaes_ecb_encrypt,.-vpaes_ecb_encrypt
-
-.globl	vpaes_ecb_decrypt
-.type	vpaes_ecb_decrypt,%function
-.align	4
-vpaes_ecb_decrypt:
-	AARCH64_SIGN_LINK_REGISTER
-	stp	x29,x30,[sp,#-16]!
-	add	x29,sp,#0
-	stp	d8,d9,[sp,#-16]!	// ABI spec says so
-	stp	d10,d11,[sp,#-16]!
-	stp	d12,d13,[sp,#-16]!
-	stp	d14,d15,[sp,#-16]!
-
-	mov	x17, $len
-	mov	x2,  $key
-	bl	_vpaes_decrypt_preheat
-	tst	x17, #16
-	b.eq	.Lecb_dec_loop
-
-	ld1	{v7.16b}, [$inp],#16
-	bl	_vpaes_encrypt_core
-	st1	{v0.16b}, [$out],#16
-	subs	x17, x17, #16
-	b.ls	.Lecb_dec_done
-
-.align	4
-.Lecb_dec_loop:
-	ld1	{v14.16b,v15.16b}, [$inp], #32
-	bl	_vpaes_decrypt_2x
-	st1	{v0.16b,v1.16b}, [$out], #32
-	subs	x17, x17, #32
-	b.hi	.Lecb_dec_loop
-
-.Lecb_dec_done:
-	ldp	d14,d15,[sp],#16
-	ldp	d12,d13,[sp],#16
-	ldp	d10,d11,[sp],#16
-	ldp	d8,d9,[sp],#16
-	ldp	x29,x30,[sp],#16
-	AARCH64_VALIDATE_LINK_REGISTER
-	ret
-.size	vpaes_ecb_decrypt,.-vpaes_ecb_decrypt
 ___
 }	}
 print $code;
diff --git a/deps/openssl/openssl/crypto/aes/asm/vpaes-ppc.pl b/deps/openssl/openssl/crypto/aes/asm/vpaes-ppc.pl
index 7af47c630e7..0d931a3c3b0 100644
--- a/deps/openssl/openssl/crypto/aes/asm/vpaes-ppc.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/vpaes-ppc.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2013-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2013-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -160,6 +160,7 @@ Lk_deskew:	# deskew tables: inverts the sbox's "skew"
 	.long	0x0069ea83, 0xdcb5365f, 0x771e9df4, 0xabc24128	?rev
 .align	5
 Lconsts:
+vpaes_const_fn:
 	mflr	r0
 	bcl	20,31,\$+4
 	mflr	r12	#vvvvv "distance between . and _vpaes_consts
@@ -190,7 +191,7 @@ $code.=<<___;
 .align	4
 _vpaes_encrypt_preheat:
 	mflr	r8
-	bl	Lconsts
+	bl      vpaes_const_fn
 	mtlr	r8
 	li	r11, 0xc0		# Lk_inv
 	li	r10, 0xd0
@@ -407,7 +408,7 @@ Lenc_done:
 .align	4
 _vpaes_decrypt_preheat:
 	mflr	r8
-	bl	Lconsts
+	bl      vpaes_const_fn
 	mtlr	r8
 	li	r11, 0xc0		# Lk_inv
 	li	r10, 0xd0
@@ -878,7 +879,7 @@ $code.=<<___;
 .align	4
 _vpaes_key_preheat:
 	mflr	r8
-	bl	Lconsts
+	bl      vpaes_const_fn
 	mtlr	r8
 	li	r11, 0xc0		# Lk_inv
 	li	r10, 0xd0
diff --git a/deps/openssl/openssl/crypto/aes/asm/vpaes-x86.pl b/deps/openssl/openssl/crypto/aes/asm/vpaes-x86.pl
index b206e934b48..b4e2e148fd5 100644
--- a/deps/openssl/openssl/crypto/aes/asm/vpaes-x86.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/vpaes-x86.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2011-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -52,7 +52,7 @@
 #	and +15% on Atom (as implied, over "hyper-threading-safe"
 #	code path).
 #
-#						<appro@openssl.org>
+#						<https://github.com/dot-asm>

 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
diff --git a/deps/openssl/openssl/crypto/aes/asm/vpaes-x86_64.pl b/deps/openssl/openssl/crypto/aes/asm/vpaes-x86_64.pl
index f6281884152..8e1484b6f45 100644
--- a/deps/openssl/openssl/crypto/aes/asm/vpaes-x86_64.pl
+++ b/deps/openssl/openssl/crypto/aes/asm/vpaes-x86_64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2011-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2011-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -52,7 +52,7 @@
 #	pshufb,	yet it's respectable +36%/62% improvement on Core 2
 #	(as implied, over "hyper-threading-safe" code path).
 #
-#						<appro@openssl.org>
+#						<https://github.com/dot-asm>

 # $output is the last argument if it looks like a file (it has an extension)
 # $flavour is the first argument if it doesn't look like a file
diff --git a/deps/openssl/openssl/crypto/aes/build.info b/deps/openssl/openssl/crypto/aes/build.info
index 11d27d0451c..47d6bcdd787 100644
--- a/deps/openssl/openssl/crypto/aes/build.info
+++ b/deps/openssl/openssl/crypto/aes/build.info
@@ -10,7 +10,7 @@ IF[{- !$disabled{asm} -}]
   $AESASM_x86_64=\
         aes-x86_64.s vpaes-x86_64.s bsaes-x86_64.s aesni-x86_64.s \
         aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-mb-x86_64.s \
-        aesni-xts-avx512.s
+        aesni-xts-avx512.s aes-cfb-avx512.s aes-cbc-vaes-x86_64.s
   $AESDEF_x86_64=AES_ASM VPAES_ASM BSAES_ASM

   $AESASM_ia64=aes_core.c aes_cbc.c aes-ia64.s
@@ -31,7 +31,9 @@ IF[{- !$disabled{asm} -}]

   $AESASM_armv4=aes_cbc.c aes-armv4.S bsaes-armv7.S aesv8-armx.S
   $AESDEF_armv4=AES_ASM BSAES_ASM
-  $AESASM_aarch64=aes_core.c aes_cbc.c aesv8-armx.S bsaes-armv8.S vpaes-armv8.S
+  $AESASM_aarch64=\
+        aes_core.c aes_cbc.c aesv8-armx.S bsaes-armv8.S vpaes-armv8.S \
+        aes-sha1-armv8.S aes-sha256-armv8.S aes-sha512-armv8.S
   $AESDEF_aarch64=BSAES_ASM VPAES_ASM

   $AESASM_parisc11=aes_core.c aes_cbc.c aes-parisc.s
@@ -72,11 +74,11 @@ IF[{- !$disabled{asm} -}]
 ENDIF

 $COMMON=aes_misc.c aes_ecb.c $AESASM
-SOURCE[../../libcrypto]=$COMMON aes_cfb.c aes_ofb.c aes_wrap.c
+SOURCE[../../libcrypto]=$COMMON aes_cfb.c aes_ofb.c aes_wrap.c aes_cbc_vaes_intrinsic.c
 IF[{- !$disabled{'deprecated-3.0'} -}]
   SOURCE[../../libcrypto]=aes_ige.c
 ENDIF
-SOURCE[../../providers/libfips.a]=$COMMON
+SOURCE[../../providers/libfips.a]=$COMMON aes_cbc_vaes_intrinsic.c

 # Implementations are now spread across several libraries, so the defines
 # need to be applied to all affected libraries and modules.
@@ -105,6 +107,8 @@ GENERATE[aes-x86_64.s]=asm/aes-x86_64.pl
 GENERATE[vpaes-x86_64.s]=asm/vpaes-x86_64.pl
 GENERATE[bsaes-x86_64.s]=asm/bsaes-x86_64.pl
 GENERATE[aesni-x86_64.s]=asm/aesni-x86_64.pl
+GENERATE[aes-cfb-avx512.s]=asm/aes-cfb-avx512.pl
+GENERATE[aes-cbc-vaes-x86_64.s]=asm/aes-cbc-vaes-x86_64.pl
 GENERATE[aesni-sha1-x86_64.s]=asm/aesni-sha1-x86_64.pl
 GENERATE[aesni-sha256-x86_64.s]=asm/aesni-sha256-x86_64.pl
 GENERATE[aesni-mb-x86_64.s]=asm/aesni-mb-x86_64.pl
@@ -137,6 +141,12 @@ GENERATE[aesv8-armx.S]=asm/aesv8-armx.pl
 INCLUDE[aesv8-armx.o]=..
 GENERATE[vpaes-armv8.S]=asm/vpaes-armv8.pl
 INCLUDE[vpaes-armv8.o]=..
+GENERATE[aes-sha1-armv8.S]=asm/aes-sha1-armv8.pl
+INCLUDE[aes-sha1-armv8.o]=..
+GENERATE[aes-sha256-armv8.S]=asm/aes-sha256-armv8.pl
+INCLUDE[aes-sha256-armv8.o]=..
+GENERATE[aes-sha512-armv8.S]=asm/aes-sha512-armv8.pl
+INCLUDE[aes-sha512-armv8.o]=..

 GENERATE[aes-armv4.S]=asm/aes-armv4.pl
 INCLUDE[aes-armv4.o]=..
diff --git a/deps/openssl/openssl/crypto/aligned_alloc.c b/deps/openssl/openssl/crypto/aligned_alloc.c
new file mode 100644
index 00000000000..639286ea6e3
--- /dev/null
+++ b/deps/openssl/openssl/crypto/aligned_alloc.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "internal/e_os.h"
+#include "internal/cryptlib.h"
+#include "internal/mem_alloc_utils.h"
+#include "crypto/cryptlib.h"
+#include <stdlib.h>
+
+void *ossl_malloc_align(size_t num, size_t alignment, void **freeptr,
+    const char *file, int line)
+{
+    size_t alloc_bytes;
+    void *ret;
+
+    *freeptr = NULL;
+
+    /* Ensure that alignment is a power of two no larger than 65536 */
+    if (alignment == 0 || (alignment & (alignment - 1)) != 0
+        || alignment > 65536) {
+        ossl_report_alloc_err_inv(file, line);
+        return NULL;
+    }
+
+    /*
+     * Note: Windows supports an _aligned_malloc call, but we choose
+     * not to use it here, because allocations from that function
+     * require that they be freed via _aligned_free.  Given that
+     * we can't differentiate plain malloc blocks from blocks obtained
+     * via _aligned_malloc, just avoid its use entirely
+     */
+
+    if (ossl_unlikely(!ossl_size_add(num, alignment, &alloc_bytes, file, line)))
+        return NULL;
+
+    /*
+     * Step 1: Allocate an amount of memory that is <alignment>
+     * bytes bigger than requested
+     */
+    *freeptr = CRYPTO_malloc(alloc_bytes, file, line);
+    if (*freeptr == NULL)
+        return NULL;
+
+    /*
+     * Step 2: Add <alignment - 1> bytes to the pointer
+     * This will cross the alignment boundary that is
+     * requested
+     */
+    ret = (void *)((char *)*freeptr + (alignment - 1));
+
+    /*
+     * Step 3: Use the alignment as a mask to translate the
+     * least significant bits of the allocation at the alignment
+     * boundary to 0.  ret now holds a pointer to the memory
+     * buffer at the requested alignment
+     * NOTE: It is a documented requirement that alignment be a
+     * power of 2, which is what allows this to work
+     */
+    ret = (void *)((uintptr_t)ret & (uintptr_t)(~(alignment - 1)));
+
+    return ret;
+}
diff --git a/deps/openssl/openssl/crypto/alphacpuid.pl b/deps/openssl/openssl/crypto/alphacpuid.pl
index b9697503806..039c08c3da2 100644
--- a/deps/openssl/openssl/crypto/alphacpuid.pl
+++ b/deps/openssl/openssl/crypto/alphacpuid.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2010-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -22,59 +22,6 @@ OPENSSL_cpuid_setup:
 	ret	($26)
 .end	OPENSSL_cpuid_setup

-.globl	OPENSSL_wipe_cpu
-.ent	OPENSSL_wipe_cpu
-OPENSSL_wipe_cpu:
-	.frame	$30,0,$26
-	.prologue 0
-	clr	$1
-	clr	$2
-	clr	$3
-	clr	$4
-	clr	$5
-	clr	$6
-	clr	$7
-	clr	$8
-	clr	$16
-	clr	$17
-	clr	$18
-	clr	$19
-	clr	$20
-	clr	$21
-	clr	$22
-	clr	$23
-	clr	$24
-	clr	$25
-	clr	$27
-	clr	$at
-	clr	$29
-	fclr	$f0
-	fclr	$f1
-	fclr	$f10
-	fclr	$f11
-	fclr	$f12
-	fclr	$f13
-	fclr	$f14
-	fclr	$f15
-	fclr	$f16
-	fclr	$f17
-	fclr	$f18
-	fclr	$f19
-	fclr	$f20
-	fclr	$f21
-	fclr	$f22
-	fclr	$f23
-	fclr	$f24
-	fclr	$f25
-	fclr	$f26
-	fclr	$f27
-	fclr	$f28
-	fclr	$f29
-	fclr	$f30
-	mov	$sp,$0
-	ret	($26)
-.end	OPENSSL_wipe_cpu
-
 .globl	OPENSSL_atomic_add
 .ent	OPENSSL_atomic_add
 OPENSSL_atomic_add:
diff --git a/deps/openssl/openssl/crypto/arm64cpuid.pl b/deps/openssl/openssl/crypto/arm64cpuid.pl
index 8dc06dd52a8..6a8700a633d 100755
--- a/deps/openssl/openssl/crypto/arm64cpuid.pl
+++ b/deps/openssl/openssl/crypto/arm64cpuid.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -22,7 +22,7 @@ open OUT,"| \"$^X\" $xlate $flavour \"$output\""
 *STDOUT=*OUT;

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 .text
 .arch	armv8-a+crypto
@@ -120,6 +120,14 @@ _armv8_sve2_probe:
 	ret
 .size	_armv8_sve2_probe,.-_armv8_sve2_probe

+.globl	_armv8_sve_get_vl_bytes
+.type	_armv8_sve_get_vl_bytes,%function
+_armv8_sve_get_vl_bytes:
+	AARCH64_VALID_CALL_TARGET
+	.inst	0x0420e3e0	// cntb x0
+	ret
+.size	_armv8_sve_get_vl_bytes,.-_armv8_sve_get_vl_bytes
+
 .globl	_armv8_cpuid_probe
 .type	_armv8_cpuid_probe,%function
 _armv8_cpuid_probe:
diff --git a/deps/openssl/openssl/crypto/armcap.c b/deps/openssl/openssl/crypto/armcap.c
index 3005d295cfd..f4f6b0d7f9b 100644
--- a/deps/openssl/openssl/crypto/armcap.c
+++ b/deps/openssl/openssl/crypto/armcap.c
@@ -19,16 +19,23 @@
 #endif
 #include "internal/cryptlib.h"
 #ifdef _WIN32
-#include <windows.h>
+#include "internal/e_os.h"
 #else
 #include <unistd.h>
 #endif
-#include "arm_arch.h"
+#include "arch/arm_arch.h"
+#ifdef __aarch64__
+#include <stdint.h>
+#endif

 unsigned int OPENSSL_armcap_P = 0;
 unsigned int OPENSSL_arm_midr = 0;
 unsigned int OPENSSL_armv8_rsa_neonized = 0;

+#ifdef __aarch64__
+uint64_t _armv8_sve_get_vl_bytes(void);
+#endif
+
 #ifdef _WIN32
 void OPENSSL_cpuid_setup(void)
 {
@@ -62,7 +69,7 @@ uint32_t OPENSSL_rdtsc(void)

 /* First determine if getauxval() is available (OSSL_IMPLEMENT_GETAUXVAL) */

-#if defined(__GNUC__) && __GNUC__ >= 2
+#if defined(__GNUC__)
 void OPENSSL_cpuid_setup(void) __attribute__((constructor));
 #endif

@@ -80,7 +87,7 @@ void OPENSSL_cpuid_setup(void) __attribute__((constructor));
 #endif
 #if defined(__FreeBSD__) || defined(__OpenBSD__)
 #include <sys/param.h>
-#if (defined(__FreeBSD__) && __FreeBSD_version >= 1200000) || (defined(__OpenBSD__) && OpenBSD >= 202409)
+#if (defined(__FreeBSD__) && __FreeBSD_version >= 1104000) || (defined(__OpenBSD__) && OpenBSD >= 202409)
 #include <sys/auxv.h>
 #define OSSL_IMPLEMENT_GETAUXVAL

@@ -296,7 +303,7 @@ void OPENSSL_cpuid_setup(void)
             char uarch[64];

             size_t len = sizeof(uarch);
-            if ((sysctlbyname("machdep.cpu.brand_string", uarch, &len, NULL, 0) == 0) && ((strncmp(uarch, "Apple M1", 8) == 0) || (strncmp(uarch, "Apple M2", 8) == 0) || (strncmp(uarch, "Apple M3", 8) == 0) || (strncmp(uarch, "Apple M4", 8) == 0))) {
+            if ((sysctlbyname("machdep.cpu.brand_string", uarch, &len, NULL, 0) == 0) && ((strncmp(uarch, "Apple M1", 8) == 0) || (strncmp(uarch, "Apple M2", 8) == 0) || (strncmp(uarch, "Apple M3", 8) == 0) || (strncmp(uarch, "Apple M4", 8) == 0) || (strncmp(uarch, "Apple M5", 8) == 0))) {
                 OPENSSL_armcap_P |= ARMV8_UNROLL8_EOR3;
                 OPENSSL_armcap_P |= ARMV8_HAVE_SHA3_AND_WORTH_USING;
             }
@@ -344,7 +351,7 @@ void OPENSSL_cpuid_setup(void)
         OPENSSL_armcap_P |= ARMV8_SVE;

     if (getauxval(OSSL_HWCAP2) & OSSL_HWCAP2_SVE2)
-        OPENSSL_armcap_P |= ARMV8_SVE2;
+        OPENSSL_armcap_P |= ARMV9_SVE2;

     if (getauxval(OSSL_HWCAP2) & OSSL_HWCAP2_RNG)
         OPENSSL_armcap_P |= ARMV8_RNG;
@@ -389,7 +396,7 @@ void OPENSSL_cpuid_setup(void)
     }
 #ifdef __aarch64__
     OPENSSL_armcap_P |= arm_probe_for(_armv8_sve_probe, ARMV8_SVE);
-    OPENSSL_armcap_P |= arm_probe_for(_armv8_sve2_probe, ARMV8_SVE2);
+    OPENSSL_armcap_P |= arm_probe_for(_armv8_sve2_probe, ARMV9_SVE2);
     OPENSSL_armcap_P |= arm_probe_for(_armv8_rng_probe, ARMV8_RNG);
 #endif

@@ -416,15 +423,25 @@ void OPENSSL_cpuid_setup(void)
     if ((OPENSSL_armcap_P & ARMV8_SHA3)
         && (MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V1)
             || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_N2)
+            || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_QCOMM, QCOM_CPU_PART_ORYON_X1)
             || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_MICROSOFT, MICROSOFT_CPU_PART_COBALT_100)
             || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V2)
-            || MIDR_IMPLEMENTER(OPENSSL_arm_midr) == ARM_CPU_IMP_AMPERE))
+            || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_N3)
+            || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V3_AE)
+            || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V3)
+            || MIDR_IMPLEMENTER(OPENSSL_arm_midr) == ARM_CPU_IMP_AMPERE
+            || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_OLYMPUS)))
         OPENSSL_armcap_P |= ARMV8_UNROLL8_EOR3;

     if ((OPENSSL_armcap_P & ARMV8_SHA3)
         && (MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V1)
             || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V2)
-            || MIDR_IMPLEMENTER(OPENSSL_arm_midr) == ARM_CPU_IMP_AMPERE))
+            || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V3_AE)
+            || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V3)
+            || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_N2)
+            || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_N3)
+            || MIDR_IMPLEMENTER(OPENSSL_arm_midr) == ARM_CPU_IMP_AMPERE
+            || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_OLYMPUS)))
         OPENSSL_armcap_P |= ARMV8_UNROLL12_EOR3;

     if ((OPENSSL_armcap_P & ARMV8_SHA3)
@@ -439,8 +456,22 @@ void OPENSSL_cpuid_setup(void)
             || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M2_AVALANCHE_PRO)
             || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M2_BLIZZARD_PRO)
             || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M2_AVALANCHE_MAX)
-            || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M2_BLIZZARD_MAX)))
+            || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M2_BLIZZARD_MAX)
+            || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_QCOMM, QCOM_CPU_PART_ORYON_X1)
+            || MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_OLYMPUS)))
         OPENSSL_armcap_P |= ARMV8_HAVE_SHA3_AND_WORTH_USING;
+
+    if (OPENSSL_armcap_P & ARMV9_SVE2) {
+        uint64_t vl_bytes = _armv8_sve_get_vl_bytes();
+
+        if (vl_bytes > 16 && (vl_bytes & (vl_bytes - 1)) == 0) {
+            /*
+             * This implementation faster if vector length > 128 bits
+             * But vector length must be a power of 2 (e.g. 256, 512 bits)
+             */
+            OPENSSL_armcap_P |= ARMV9_SVE2_POLY1305;
+        }
+    }
 #endif
 }
 #endif /* _WIN32, __ARM_MAX_ARCH__ >= 7 */
diff --git a/deps/openssl/openssl/crypto/armv4cpuid.pl b/deps/openssl/openssl/crypto/armv4cpuid.pl
index 9b933c70c4d..8441b7dde62 100644
--- a/deps/openssl/openssl/crypto/armv4cpuid.pl
+++ b/deps/openssl/openssl/crypto/armv4cpuid.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2015-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -22,7 +22,7 @@ open OUT,"| \"$^X\" $xlate $flavour \"$output\""
 *STDOUT=*OUT;

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 #if defined(__thumb2__) && !defined(__APPLE__)
 .syntax	unified
@@ -73,6 +73,7 @@ OPENSSL_atomic_add:

 .global	OPENSSL_cleanse
 .type	OPENSSL_cleanse,%function
+.align	5
 OPENSSL_cleanse:
 	eor	ip,ip,ip
 	cmp	r1,#7
@@ -112,7 +113,7 @@ OPENSSL_cleanse:

 .global	CRYPTO_memcmp
 .type	CRYPTO_memcmp,%function
-.align	4
+.align	5
 CRYPTO_memcmp:
 	eor	ip,ip,ip
 	cmp	r2,#0
@@ -154,6 +155,7 @@ _armv7_neon_probe:

 .global	_armv7_tick
 .type	_armv7_tick,%function
+.align	5
 _armv7_tick:
 #ifdef	__APPLE__
 	mrrc	p15,0,r0,r1,c14		@ CNTPCT
@@ -165,6 +167,7 @@ _armv7_tick:

 .global	_armv8_aes_probe
 .type	_armv8_aes_probe,%function
+.align	5
 _armv8_aes_probe:
 #if defined(__thumb2__) && !defined(__APPLE__)
 	.byte	0xb0,0xff,0x00,0x03	@ aese.8	q0,q0
@@ -176,6 +179,7 @@ _armv8_aes_probe:

 .global	_armv8_sha1_probe
 .type	_armv8_sha1_probe,%function
+.align	5
 _armv8_sha1_probe:
 #if defined(__thumb2__) && !defined(__APPLE__)
 	.byte	0x00,0xef,0x40,0x0c	@ sha1c.32	q0,q0,q0
@@ -187,6 +191,7 @@ _armv8_sha1_probe:

 .global	_armv8_sha256_probe
 .type	_armv8_sha256_probe,%function
+.align	5
 _armv8_sha256_probe:
 #if defined(__thumb2__) && !defined(__APPLE__)
 	.byte	0x00,0xff,0x40,0x0c	@ sha256h.32	q0,q0,q0
@@ -197,6 +202,7 @@ _armv8_sha256_probe:
 .size	_armv8_sha256_probe,.-_armv8_sha256_probe
 .global	_armv8_pmull_probe
 .type	_armv8_pmull_probe,%function
+.align	5
 _armv8_pmull_probe:
 #if defined(__thumb2__) && !defined(__APPLE__)
 	.byte	0xa0,0xef,0x00,0x0e	@ vmull.p64	q0,d0,d0
@@ -207,49 +213,9 @@ _armv8_pmull_probe:
 .size	_armv8_pmull_probe,.-_armv8_pmull_probe
 #endif

-.global	OPENSSL_wipe_cpu
-.type	OPENSSL_wipe_cpu,%function
-OPENSSL_wipe_cpu:
-#if __ARM_MAX_ARCH__>=7
-	ldr	r0,.LOPENSSL_armcap
-	adr	r1,.LOPENSSL_armcap
-	ldr	r0,[r1,r0]
-#ifdef	__APPLE__
-	ldr	r0,[r0]
-#endif
-#endif
-	eor	r2,r2,r2
-	eor	r3,r3,r3
-	eor	ip,ip,ip
-#if __ARM_MAX_ARCH__>=7
-	tst	r0,#1
-	beq	.Lwipe_done
-	veor	q0, q0, q0
-	veor	q1, q1, q1
-	veor	q2, q2, q2
-	veor	q3, q3, q3
-	veor	q8, q8, q8
-	veor	q9, q9, q9
-	veor	q10, q10, q10
-	veor	q11, q11, q11
-	veor	q12, q12, q12
-	veor	q13, q13, q13
-	veor	q14, q14, q14
-	veor	q15, q15, q15
-.Lwipe_done:
-#endif
-	mov	r0,sp
-#if __ARM_ARCH__>=5
-	bx	lr
-#else
-	tst	lr,#1
-	moveq	pc,lr
-	.word	0xe12fff1e	@ bx	lr
-#endif
-.size	OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu
-
 .global	OPENSSL_instrument_bus
 .type	OPENSSL_instrument_bus,%function
+.align	5
 OPENSSL_instrument_bus:
 	eor	r0,r0,r0
 #if __ARM_ARCH__>=5
@@ -263,6 +229,7 @@ OPENSSL_instrument_bus:

 .global	OPENSSL_instrument_bus2
 .type	OPENSSL_instrument_bus2,%function
+.align	5
 OPENSSL_instrument_bus2:
 	eor	r0,r0,r0
 #if __ARM_ARCH__>=5
diff --git a/deps/openssl/openssl/crypto/array_alloc.c b/deps/openssl/openssl/crypto/array_alloc.c
new file mode 100644
index 00000000000..cb10b9ac3b5
--- /dev/null
+++ b/deps/openssl/openssl/crypto/array_alloc.c
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * This file provides implementation of various array allocation routines that
+ * perform integer overflow checking for size calculation.
+ */
+
+#include "internal/mem_alloc_utils.h"
+#include <openssl/crypto.h>
+
+void *CRYPTO_malloc_array(size_t num, size_t size, const char *file, int line)
+{
+    size_t bytes;
+
+    if (ossl_unlikely(!ossl_size_mul(num, size, &bytes, file, line)))
+        return NULL;
+
+    return CRYPTO_malloc(bytes, file, line);
+}
+
+void *CRYPTO_calloc(size_t num, size_t size, const char *file, int line)
+{
+    size_t bytes;
+
+    if (ossl_unlikely(!ossl_size_mul(num, size, &bytes, file, line)))
+        return NULL;
+
+    return CRYPTO_zalloc(bytes, file, line);
+}
+
+void *CRYPTO_aligned_alloc_array(size_t num, size_t size, size_t align,
+    void **freeptr, const char *file, int line)
+{
+    size_t bytes;
+
+    if (ossl_unlikely(!ossl_size_mul(num, size, &bytes, file, line))) {
+        *freeptr = NULL;
+
+        return NULL;
+    }
+
+    return CRYPTO_aligned_alloc(bytes, align, freeptr, file, line);
+}
+
+void *CRYPTO_realloc_array(void *addr, size_t num, size_t size,
+    const char *file, int line)
+{
+    size_t bytes;
+
+    if (ossl_unlikely(!ossl_size_mul(num, size, &bytes, file, line)))
+        return NULL;
+
+    return CRYPTO_realloc(addr, bytes, file, line);
+}
+
+void *CRYPTO_clear_realloc_array(void *addr, size_t old_num, size_t num,
+    size_t size, const char *file, int line)
+{
+    size_t old_bytes, bytes = 0;
+
+    if (ossl_unlikely(!ossl_size_mul(old_num, size, &old_bytes, file, line)
+            || !ossl_size_mul(num, size, &bytes, file, line)))
+        return NULL;
+
+    return CRYPTO_clear_realloc(addr, old_bytes, bytes, file, line);
+}
+
+void *CRYPTO_secure_malloc_array(size_t num, size_t size,
+    const char *file, int line)
+{
+    size_t bytes;
+
+    if (ossl_unlikely(!ossl_size_mul(num, size, &bytes, file, line)))
+        return NULL;
+
+    return CRYPTO_secure_malloc(bytes, file, line);
+}
+
+void *CRYPTO_secure_calloc(size_t num, size_t size, const char *file, int line)
+{
+    size_t bytes;
+
+    if (ossl_unlikely(!ossl_size_mul(num, size, &bytes, file, line)))
+        return NULL;
+
+    return CRYPTO_secure_zalloc(bytes, file, line);
+}
diff --git a/deps/openssl/openssl/crypto/asn1/a_bitstr.c b/deps/openssl/openssl/crypto/asn1/a_bitstr.c
index 223efc2bb14..02180541ea2 100644
--- a/deps/openssl/openssl/crypto/asn1/a_bitstr.c
+++ b/deps/openssl/openssl/crypto/asn1/a_bitstr.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,60 +13,33 @@
 #include <openssl/asn1.h>
 #include "asn1_local.h"

+#include <crypto/asn1.h>
+
+#ifndef OPENSSL_NO_DEPRECATED_4_1
 int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len)
 {
-    return ASN1_STRING_set(x, d, len);
+    return ossl_asn1_string_set_internal(x, d, len, /*add_nul_byte=*/0);
 }
+#endif

-int ossl_i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
+int ossl_i2c_ASN1_BIT_STRING(const ASN1_BIT_STRING *a, unsigned char **pp)
 {
-    int ret, j, bits, len;
+    int ret = 0, bits = 0, len;
     unsigned char *p, *d;

     if (a == NULL)
-        return 0;
+        goto err;

     len = a->length;

-    if (len > 0) {
-        if (a->flags & ASN1_STRING_FLAG_BITS_LEFT) {
-            bits = (int)a->flags & 0x07;
-        } else {
-            for (; len > 0; len--) {
-                if (a->data[len - 1])
-                    break;
-            }
-
-            if (len == 0) {
-                bits = 0;
-            } else {
-                j = a->data[len - 1];
-                if (j & 0x01)
-                    bits = 0;
-                else if (j & 0x02)
-                    bits = 1;
-                else if (j & 0x04)
-                    bits = 2;
-                else if (j & 0x08)
-                    bits = 3;
-                else if (j & 0x10)
-                    bits = 4;
-                else if (j & 0x20)
-                    bits = 5;
-                else if (j & 0x40)
-                    bits = 6;
-                else if (j & 0x80)
-                    bits = 7;
-                else
-                    bits = 0; /* should not happen */
-            }
-        }
-    } else
-        bits = 0;
+    if (len > INT_MAX - 1 || len < 0)
+        goto err;
+
+    if ((len > 0) && (a->flags & ASN1_STRING_FLAG_BITS_LEFT))
+        bits = (int)a->flags & 0x07;

-    ret = 1 + len;
     if (pp == NULL)
-        return ret;
+        goto done;

     p = *pp;

@@ -78,6 +51,11 @@ int ossl_i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
         p[-1] &= (0xff << bits);
     }
     *pp = p;
+
+done:
+    ret = len + 1;
+
+err:
     return ret;
 }

@@ -115,7 +93,7 @@ ASN1_BIT_STRING *ossl_c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
      * We do this to preserve the settings.  If we modify the settings, via
      * the _set_bit function, we will recalculate on output
      */
-    ossl_asn1_string_set_bits_left(ret, i);
+    ossl_asn1_bit_string_set_unused_bits(ret, i);

     if (len-- > 1) { /* using one because of the bits left byte */
         s = OPENSSL_malloc((int)len);
@@ -176,8 +154,24 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
         a->length = w + 1;
     }
     a->data[w] = ((a->data[w]) & iv) | v;
+
     while ((a->length > 0) && (a->data[a->length - 1] == 0))
         a->length--;
+
+    if (a->length > 0) {
+        uint8_t u8 = a->data[a->length - 1];
+        uint8_t unused_bits = 7;
+
+        /* Only keep least significant bit; count trailing zeroes. */
+        u8 &= 0x100 - u8;
+        if ((u8 & 0x0f) != 0)
+            unused_bits -= 4;
+        if ((u8 & 0x33) != 0)
+            unused_bits -= 2;
+        if ((u8 & 0x55) != 0)
+            unused_bits -= 1;
+        ossl_asn1_bit_string_set_unused_bits(a, unused_bits);
+    }
     return 1;
 }

@@ -220,3 +214,61 @@ int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a,
     }
     return ok;
 }
+
+int ASN1_BIT_STRING_get_length(const ASN1_BIT_STRING *abs, size_t *out_length,
+    int *out_unused_bits)
+{
+    size_t length;
+    int unused_bits;
+
+    if (abs == NULL || abs->type != V_ASN1_BIT_STRING)
+        return 0;
+
+    if (out_length == NULL || out_unused_bits == NULL || abs->length < 0)
+        return 0;
+
+    length = abs->length;
+    unused_bits = 0;
+
+    if ((abs->flags & ASN1_STRING_FLAG_BITS_LEFT) != 0)
+        unused_bits = abs->flags & 0x07;
+
+    if (length == 0 && unused_bits != 0)
+        return 0;
+
+    if (unused_bits != 0) {
+        unsigned char mask = (1 << unused_bits) - 1;
+        if ((abs->data[length - 1] & mask) != 0)
+            return 0;
+    }
+
+    *out_length = length;
+    *out_unused_bits = unused_bits;
+
+    return 1;
+}
+
+int ASN1_BIT_STRING_set1(ASN1_BIT_STRING *abs, const uint8_t *data, size_t length,
+    int unused_bits)
+{
+    if (abs == NULL)
+        return 0;
+
+    if (length > INT_MAX || unused_bits < 0 || unused_bits > 7)
+        return 0;
+
+    if (length == 0 && unused_bits != 0)
+        return 0;
+
+    if (length > 0 && (data[length - 1] & ((1 << unused_bits) - 1)) != 0)
+        return 0;
+
+    if (!ossl_asn1_string_set_internal(abs, data, (int)length, /*add_nul_byte=*/0))
+        return 0;
+
+    abs->type = V_ASN1_BIT_STRING;
+
+    ossl_asn1_bit_string_set_unused_bits(abs, unused_bits);
+
+    return 1;
+}
diff --git a/deps/openssl/openssl/crypto/asn1/a_d2i_fp.c b/deps/openssl/openssl/crypto/asn1/a_d2i_fp.c
index 19595683ef9..41491b92a1b 100644
--- a/deps/openssl/openssl/crypto/asn1/a_d2i_fp.c
+++ b/deps/openssl/openssl/crypto/asn1/a_d2i_fp.c
@@ -86,7 +86,7 @@ void *ASN1_item_d2i_fp_ex(const ASN1_ITEM *it, FILE *in, void *x,
     OSSL_LIB_CTX *libctx, const char *propq)
 {
     BIO *b;
-    char *ret;
+    void *ret;

     if ((b = BIO_new(BIO_s_file())) == NULL) {
         ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
@@ -110,7 +110,6 @@ int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
 {
     BUF_MEM *b;
     unsigned char *p;
-    int i;
     size_t want = HEADER_SIZE;
     uint32_t eos = 0;
     size_t off = 0;
@@ -131,13 +130,16 @@ int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
     for (;;) {
         diff = len - off;
         if (want >= diff) {
+            int i;
+
             want -= diff;

             if (len + want < len || !BUF_MEM_grow_clean(b, len + want)) {
                 ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
                 goto err;
             }
-            i = BIO_read(in, &(b->data[len]), want);
+            i = BIO_read(in, &(b->data[len]), (int)want);
+
             if (i <= 0) {
                 /*
                  * A read error (i < 0), an EOF in the middle of an object
@@ -155,6 +157,7 @@ int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
                     ERR_raise(ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA);
                 goto err;
             }
+
             if (i > 0) {
                 if (len + i < len) {
                     ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
@@ -179,15 +182,15 @@ int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)

         diff--;
         if ((*(q++) & V_ASN1_PRIMITIVE_TAG) == V_ASN1_PRIMITIVE_TAG) {
-            unsigned int n = 0;
+            unsigned int i = 0;
             /* Multi-byte tag.  See if we have the whole thing yet */
             do {
-                if (n > 4) {
+                if (i > 4) {
                     /* The tag value must fit into int */
                     ERR_raise(ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG);
                     goto err;
                 }
-                ++n;
+                ++i;
                 diff--;
             } while (diff > 0 && *(q++) & 0x80);

@@ -207,14 +210,14 @@ int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
         /* Check the length.  This should also work for indefinite length */
         diff--;
         if (*q & 0x80) {
-            unsigned int n = *q & 0x7f;
+            unsigned int i = *q & 0x7f;

-            if (n > sizeof(long)) {
+            if (i > sizeof(long)) {
                 ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
                 goto err;
             }
-            if (n > diff) {
-                want = q - p + n + 1;
+            if (i > diff) {
+                want = q - p + i + 1;
                 continue;
             }
         }
@@ -271,6 +274,7 @@ int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
                      * in one go.
                      */
                     size_t chunk = want > chunk_max ? chunk_max : want;
+                    int i;

                     if (!BUF_MEM_grow_clean(b, len + chunk)) {
                         ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
@@ -278,7 +282,7 @@ int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
                     }
                     want -= chunk;
                     while (chunk > 0) {
-                        i = BIO_read(in, &(b->data[len]), chunk);
+                        i = BIO_read(in, &(b->data[len]), (int)chunk);
                         if (i <= 0) {
                             ERR_raise(ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA);
                             goto err;
@@ -313,7 +317,7 @@ int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)

     *pb = b;
     ERR_clear_last_mark();
-    return off;
+    return (int)off;
 err:
     ERR_clear_last_mark();
     BUF_MEM_free(b);
diff --git a/deps/openssl/openssl/crypto/asn1/a_digest.c b/deps/openssl/openssl/crypto/asn1/a_digest.c
index c172eef3ea8..c9348ce5673 100644
--- a/deps/openssl/openssl/crypto/asn1/a_digest.c
+++ b/deps/openssl/openssl/crypto/asn1/a_digest.c
@@ -7,16 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
 #include <stdio.h>
 #include <time.h>
 #include <sys/types.h>

 #include "internal/cryptlib.h"

-#include <openssl/engine.h>
 #include <openssl/err.h>
 #include <openssl/evp.h>
 #include <openssl/buffer.h>
@@ -63,16 +59,8 @@ int ossl_asn1_item_digest_ex(const ASN1_ITEM *it, const EVP_MD *md, void *asn,
     if (i < 0 || str == NULL)
         return 0;

-    if (EVP_MD_get0_provider(md) == NULL) {
-#if !defined(OPENSSL_NO_ENGINE)
-        ENGINE *tmpeng = ENGINE_get_digest_engine(EVP_MD_get_type(md));
-
-        if (tmpeng != NULL)
-            ENGINE_finish(tmpeng);
-        else
-#endif
-            fetched_md = EVP_MD_fetch(libctx, EVP_MD_get0_name(md), propq);
-    }
+    if (EVP_MD_get0_provider(md) == NULL)
+        fetched_md = EVP_MD_fetch(libctx, EVP_MD_get0_name(md), propq);
     if (fetched_md == NULL)
         goto err;

diff --git a/deps/openssl/openssl/crypto/asn1/a_gentm.c b/deps/openssl/openssl/crypto/asn1/a_gentm.c
index 49e6f2470d8..89a957b0b1a 100644
--- a/deps/openssl/openssl/crypto/asn1/a_gentm.c
+++ b/deps/openssl/openssl/crypto/asn1/a_gentm.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -38,9 +38,13 @@ int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *d)
 int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)
 {
     ASN1_GENERALIZEDTIME t;
+    size_t len;
+
+    if ((len = strlen(str)) >= INT_MAX)
+        return 0;

     t.type = V_ASN1_GENERALIZEDTIME;
-    t.length = strlen(str);
+    t.length = (int)len;
     t.data = (unsigned char *)str;
     t.flags = 0;

diff --git a/deps/openssl/openssl/crypto/asn1/a_int.c b/deps/openssl/openssl/crypto/asn1/a_int.c
index 3205802c09d..5dd12058626 100644
--- a/deps/openssl/openssl/crypto/asn1/a_int.c
+++ b/deps/openssl/openssl/crypto/asn1/a_int.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -206,7 +206,16 @@ static size_t c2i_ibuf(unsigned char *b, int *pneg,

 int ossl_i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
 {
-    return i2c_ibuf(a->data, a->length, a->type & V_ASN1_NEG, pp);
+    unsigned char *ptr = pp != NULL ? *pp : NULL;
+    size_t ret = i2c_ibuf(a->data, a->length, a->type & V_ASN1_NEG, &ptr);
+
+    if (ret > INT_MAX) {
+        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
+        return 0;
+    }
+    if (pp != NULL)
+        *pp = ptr;
+    return (int)ret;
 }

 /* Convert big endian buffer into uint64_t, return 0 on error */
@@ -307,7 +316,7 @@ ASN1_INTEGER *ossl_c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp,
     } else
         ret = *a;

-    if (ASN1_STRING_set(ret, NULL, r) == 0) {
+    if (ossl_asn1_string_set1_data(ret, NULL, r) == 0) {
         ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
         goto err;
     }
@@ -362,7 +371,7 @@ static int asn1_string_set_int64(ASN1_STRING *a, int64_t r, int itype)
         off = asn1_put_uint64(tbuf, r);
         a->type &= ~V_ASN1_NEG;
     }
-    return ASN1_STRING_set(a, tbuf + off, sizeof(tbuf) - off);
+    return ossl_asn1_string_set1_data(a, tbuf + off, (sizeof(tbuf) - off));
 }

 static int asn1_string_get_uint64(uint64_t *pr, const ASN1_STRING *a,
@@ -390,7 +399,7 @@ static int asn1_string_set_uint64(ASN1_STRING *a, uint64_t r, int itype)

     a->type = itype;
     off = asn1_put_uint64(tbuf, r);
-    return ASN1_STRING_set(a, tbuf + off, sizeof(tbuf) - off);
+    return ossl_asn1_string_set1_data(a, tbuf + off, (sizeof(tbuf) - off));
 }

 /*
@@ -432,11 +441,17 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
         i = ASN1_R_ILLEGAL_NEGATIVE_VALUE;
         goto err;
     }
+#if INT_MAX < LONG_MAX
+    if (len > INT_MAX - 1) {
+        i = ASN1_R_TOO_LARGE;
+        goto err;
+    }
+#endif
     /*
      * We must OPENSSL_malloc stuff, even for 0 bytes otherwise it signifies
      * a missing NULL parameter.
      */
-    s = OPENSSL_malloc((int)len + 1);
+    s = OPENSSL_malloc(len == 0 ? 1 : (size_t)len);
     if (s == NULL)
         goto err;
     ret->type = V_ASN1_INTEGER;
@@ -445,11 +460,11 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
             p++;
             len--;
         }
-        memcpy(s, p, (int)len);
+        memcpy(s, p, (size_t)len);
         p += len;
     }

-    ASN1_STRING_set0(ret, s, (int)len);
+    ASN1_STRING_set0(ret, s, (int)len); /* len <= INT_MAX checked above */
     if (a != NULL)
         (*a) = ret;
     *pp = p;
@@ -488,7 +503,7 @@ static ASN1_STRING *bn_to_asn1_string(const BIGNUM *bn, ASN1_STRING *ai,
     if (len == 0)
         len = 1;

-    if (ASN1_STRING_set(ret, NULL, len) == 0) {
+    if (ossl_asn1_string_set1_data(ret, NULL, len) == 0) {
         ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
         goto err;
     }
@@ -642,5 +657,5 @@ int ossl_i2c_uint64_int(unsigned char *p, uint64_t r, int neg)
     size_t off;

     off = asn1_put_uint64(buf, r);
-    return i2c_ibuf(buf + off, sizeof(buf) - off, neg, &p);
+    return (int)i2c_ibuf(buf + off, sizeof(buf) - off, neg, &p);
 }
diff --git a/deps/openssl/openssl/crypto/asn1/a_mbstr.c b/deps/openssl/openssl/crypto/asn1/a_mbstr.c
index 9a61f7f1e05..f4ec953f019 100644
--- a/deps/openssl/openssl/crypto/asn1/a_mbstr.c
+++ b/deps/openssl/openssl/crypto/asn1/a_mbstr.c
@@ -12,17 +12,20 @@
 #include "internal/cryptlib.h"
 #include "internal/unicode.h"
 #include <openssl/asn1.h>
+#include <openssl/byteorder.h>
+
+#include <crypto/asn1.h>

 static int traverse_string(const unsigned char *p, int len, int inform,
-    int (*rfunc)(unsigned long value, void *in),
+    int (*rfunc)(uint32_t value, void *in),
     void *arg);
-static int in_utf8(unsigned long value, void *arg);
-static int out_utf8(unsigned long value, void *arg);
-static int type_str(unsigned long value, void *arg);
-static int cpy_asc(unsigned long value, void *arg);
-static int cpy_bmp(unsigned long value, void *arg);
-static int cpy_univ(unsigned long value, void *arg);
-static int cpy_utf8(unsigned long value, void *arg);
+static int in_utf8(uint32_t value, void *arg);
+static int out_utf8(uint32_t value, void *arg);
+static int type_str(uint32_t value, void *arg);
+static int cpy_asc(uint32_t value, void *arg);
+static int cpy_bmp(uint32_t value, void *arg);
+static int cpy_univ(uint32_t value, void *arg);
+static int cpy_utf8(uint32_t value, void *arg);

 /*
  * These functions take a string in UTF8, ASCII or multibyte form and a mask
@@ -40,7 +43,7 @@ int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
 }

 int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
-    int inform, unsigned long mask,
+    int inform, unsigned long mask_in,
     long minsize, long maxsize)
 {
     int str_type;
@@ -50,7 +53,8 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
     ASN1_STRING *dest;
     unsigned char *p;
     int nchar;
-    int (*cpyfunc)(unsigned long, void *) = NULL;
+    uint32_t mask = (uint32_t)mask_in;
+    int (*cpyfunc)(uint32_t, void *) = NULL;
     if (len == -1) {
         size_t len_s = strlen((const char *)in);

@@ -167,14 +171,18 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
     }
     /* If both the same type just copy across */
     if (inform == outform) {
-        if (!ASN1_STRING_set(dest, in, len)) {
+        if ((p = OPENSSL_malloc((size_t)len + 1)) == NULL) {
             if (free_out) {
                 ASN1_STRING_free(dest);
                 *out = NULL;
             }
-            ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
             return -1;
         }
+        if (len > 0)
+            memcpy(p, in, (size_t)len);
+        p[len] = '\0';
+        dest->data = p;
+        dest->length = len;
         return str_type;
     }

@@ -244,27 +252,25 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
  */

 static int traverse_string(const unsigned char *p, int len, int inform,
-    int (*rfunc)(unsigned long value, void *in),
+    int (*rfunc)(uint32_t value, void *in),
     void *arg)
 {
-    unsigned long value;
+    uint32_t value;
     int ret;
     while (len) {
         if (inform == MBSTRING_ASC) {
             value = *p++;
             len--;
         } else if (inform == MBSTRING_BMP) {
-            value = *p++ << 8;
-            value |= *p++;
+            uint16_t tmp;
+            p = OPENSSL_load_u16_be(&tmp, p);
+            value = tmp;
             len -= 2;
         } else if (inform == MBSTRING_UNIV) {
-            value = ((unsigned long)*p++) << 24;
-            value |= ((unsigned long)*p++) << 16;
-            value |= *p++ << 8;
-            value |= *p++;
+            p = OPENSSL_load_u32_be(&value, p);
             len -= 4;
         } else {
-            ret = UTF8_getc(p, len, &value);
+            ret = ossl_utf8_getc_internal(p, len, &value);
             if (ret < 0)
                 return -1;
             len -= ret;
@@ -283,7 +289,7 @@ static int traverse_string(const unsigned char *p, int len, int inform,

 /* Just count number of characters */

-static int in_utf8(unsigned long value, void *arg)
+static int in_utf8(uint32_t value, void *arg)
 {
     int *nchar;

@@ -296,11 +302,11 @@ static int in_utf8(unsigned long value, void *arg)

 /* Determine size of output as a UTF8 String */

-static int out_utf8(unsigned long value, void *arg)
+static int out_utf8(uint32_t value, void *arg)
 {
     int *outlen, len;

-    len = UTF8_putc(NULL, -1, value);
+    len = ossl_utf8_putc_internal(NULL, -1, value);
     if (len <= 0) {
         ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING);
         return len;
@@ -319,10 +325,10 @@ static int out_utf8(unsigned long value, void *arg)
  * "mask".
  */

-static int type_str(unsigned long value, void *arg)
+static int type_str(uint32_t value, void *arg)
 {
-    unsigned long usable_types = *((unsigned long *)arg);
-    unsigned long types = usable_types;
+    uint32_t usable_types = *((uint32_t *)arg);
+    uint32_t types = usable_types;
     const int native = value > INT_MAX ? INT_MAX : ossl_fromascii(value);

     /*
@@ -358,13 +364,13 @@ static int type_str(unsigned long value, void *arg)
         types &= ~B_ASN1_UTF8STRING;
     if (!types)
         return -1;
-    *((unsigned long *)arg) = types;
+    *((uint32_t *)arg) = types;
     return 1;
 }

 /* Copy one byte per character ASCII like strings */

-static int cpy_asc(unsigned long value, void *arg)
+static int cpy_asc(uint32_t value, void *arg)
 {
     unsigned char **p, *q;
     p = arg;
@@ -376,7 +382,7 @@ static int cpy_asc(unsigned long value, void *arg)

 /* Copy two byte per character BMPStrings */

-static int cpy_bmp(unsigned long value, void *arg)
+static int cpy_bmp(uint32_t value, void *arg)
 {
     unsigned char **p, *q;
     p = arg;
@@ -389,7 +395,7 @@ static int cpy_bmp(unsigned long value, void *arg)

 /* Copy four byte per character UniversalStrings */

-static int cpy_univ(unsigned long value, void *arg)
+static int cpy_univ(uint32_t value, void *arg)
 {
     unsigned char **p, *q;
     p = arg;
@@ -404,13 +410,13 @@ static int cpy_univ(unsigned long value, void *arg)

 /* Copy to a UTF8String */

-static int cpy_utf8(unsigned long value, void *arg)
+static int cpy_utf8(uint32_t value, void *arg)
 {
     unsigned char **p;
     int ret;
     p = arg;
     /* We already know there is enough room so pass 0xff as the length */
-    ret = UTF8_putc(*p, 0xff, value);
+    ret = ossl_utf8_putc_internal(*p, 0xff, value);
     if (ret < 0)
         return ret;
     *p += ret;
diff --git a/deps/openssl/openssl/crypto/asn1/a_object.c b/deps/openssl/openssl/crypto/asn1/a_object.c
index 1c7aa31e83f..126636dfd52 100644
--- a/deps/openssl/openssl/crypto/asn1/a_object.c
+++ b/deps/openssl/openssl/crypto/asn1/a_object.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -50,17 +50,25 @@ int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp)

 int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
 {
-    int i, first, len = 0, c, use_bn;
+    int i, first, len = 0, use_bn;
+    char c;
     char ftmp[24], *tmp = ftmp;
     int tmpsize = sizeof(ftmp);
     const char *p;
     unsigned long l;
     BIGNUM *bl = NULL;

-    if (num == 0)
+    if (num == 0) {
         return 0;
-    else if (num == -1)
-        num = strlen(buf);
+    } else if (num == -1) {
+        size_t num_s = strlen(buf);
+
+        if (num_s >= INT_MAX) {
+            ERR_raise(ERR_LIB_ASN1, ASN1_R_LENGTH_TOO_LONG);
+            goto err;
+        }
+        num = (int)num_s;
+    }

     p = buf;
     c = *(p++);
@@ -285,7 +293,7 @@ ASN1_OBJECT *ossl_c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
     }

     if ((a == NULL) || ((*a) == NULL) || !((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC)) {
-        if ((ret = ASN1_OBJECT_new()) == NULL)
+        if ((ret = ossl_asn1_object_new()) == NULL)
             return NULL;
     } else {
         ret = (*a);
@@ -330,7 +338,14 @@ err:
     return NULL;
 }

+#ifndef OPENSSL_NO_DEPRECATED_4_0
 ASN1_OBJECT *ASN1_OBJECT_new(void)
+{
+    return NULL;
+}
+#endif /* OPENSSL_NO_DEPRECATED_4_0 */
+
+ASN1_OBJECT *ossl_asn1_object_new(void)
 {
     ASN1_OBJECT *ret;

diff --git a/deps/openssl/openssl/crypto/asn1/a_octet.c b/deps/openssl/openssl/crypto/asn1/a_octet.c
index 4efb8ec5178..ebafaa72b4d 100644
--- a/deps/openssl/openssl/crypto/asn1/a_octet.c
+++ b/deps/openssl/openssl/crypto/asn1/a_octet.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -10,6 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/asn1.h>
+#include "crypto/asn1.h"

 ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *x)
 {
@@ -25,5 +26,11 @@ int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a,
 int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d,
     int len)
 {
-    return ASN1_STRING_set(x, d, len);
+    if (len < -1) {
+        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
+        return 0;
+    }
+    if (len == -1)
+        return ossl_asn1_string_set1_string(x, (const char *)d);
+    return ossl_asn1_string_set1_data(x, d, len);
 }
diff --git a/deps/openssl/openssl/crypto/asn1/a_print.c b/deps/openssl/openssl/crypto/asn1/a_print.c
index c570e52fbde..2935c4008f0 100644
--- a/deps/openssl/openssl/crypto/asn1/a_print.c
+++ b/deps/openssl/openssl/crypto/asn1/a_print.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,20 +12,28 @@
 #include "internal/cryptlib.h"
 #include <openssl/asn1.h>

-int ASN1_PRINTABLE_type(const unsigned char *s, int len)
+#include <crypto/asn1.h>
+
+/**
+ * @brief Determine the narrowest ASN.1 string type that can represent bytes.
+ *
+ * Unlike ASN1_PRINTABLE_type() this requires an explicit length and has no
+ * legacy path that treats its input as a NUL terminated C string, so it may
+ * be called on ASN1_STRING data.
+ *
+ * @param s pointer to the bytes to classify
+ * @param len the number of bytes available at s
+ * @returns V_ASN1_T61STRING, V_ASN1_IA5STRING or V_ASN1_PRINTABLESTRING
+ */
+static int printable_type(const unsigned char *s, size_t len)
 {
-    int c;
     int ia5 = 0;
     int t61 = 0;
+    size_t i;

-    if (s == NULL)
-        return V_ASN1_PRINTABLESTRING;
-
-    if (len < 0)
-        len = strlen((const char *)s);
+    for (i = 0; i < len; i++) {
+        int c = s[i];

-    while (len-- > 0) {
-        c = *(s++);
         if (!ossl_isasn1print(c))
             ia5 = 1;
         if (!ossl_isascii(c))
@@ -38,6 +46,17 @@ int ASN1_PRINTABLE_type(const unsigned char *s, int len)
     return V_ASN1_PRINTABLESTRING;
 }

+int ASN1_PRINTABLE_type(const unsigned char *s, int len)
+{
+    if (s == NULL)
+        return V_ASN1_PRINTABLESTRING;
+
+    if (len < 0)
+        len = (int)strlen((const char *)s);
+
+    return printable_type(s, (size_t)len);
+}
+
 int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s)
 {
     int i;
@@ -45,7 +64,7 @@ int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s)

     if (s->type != V_ASN1_UNIVERSALSTRING)
         return 0;
-    if ((s->length % 4) != 0)
+    if (s->length < 0 || (s->length % 4) != 0)
         return 0;
     p = s->data;
     for (i = 0; i < s->length; i += 4) {
@@ -60,9 +79,10 @@ int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s)
     for (i = 3; i < s->length; i += 4) {
         *(p++) = s->data[i];
     }
-    *(p) = '\0';
+    if (s->length > 0)
+        *p = '\0';
     s->length /= 4;
-    s->type = ASN1_PRINTABLE_type(s->data, s->length);
+    s->type = printable_type(s->data, (size_t)s->length);
     return 1;
 }

diff --git a/deps/openssl/openssl/crypto/asn1/a_sign.c b/deps/openssl/openssl/crypto/asn1/a_sign.c
index a85f70d3b71..58d58f81ffa 100644
--- a/deps/openssl/openssl/crypto/asn1/a_sign.c
+++ b/deps/openssl/openssl/crypto/asn1/a_sign.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -47,7 +47,7 @@ int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2,
             continue;
         if (type->pkey_type == NID_dsaWithSHA1) {
             /*
-             * special case: RFC 2459 tells us to omit 'parameters' with
+             * special case: RFC 3370 tells us to omit 'parameters' with
              * id-dsa-with-sha1
              */
             ASN1_TYPE_free(a->parameter);
@@ -100,7 +100,7 @@ int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2,
      * In the interests of compatibility, I'll make sure that the bit string
      * has a 'not-used bits' value of 0
      */
-    ossl_asn1_string_set_bits_left(signature, 0);
+    ossl_asn1_bit_string_set_unused_bits(signature, 0);
 err:
     EVP_MD_CTX_free(ctx);
     OPENSSL_clear_free((char *)buf_in, inll);
@@ -143,11 +143,27 @@ err:
     return rv;
 }

+static int replace_algor_contents_from_DER(X509_ALGOR *algor, const unsigned char *aid, size_t len)
+{
+    /* as a workaround for d2i_*() freeing its first argument, using NULL instead: */
+    X509_ALGOR *alg = d2i_X509_ALGOR(NULL, &aid, (long)len);
+    int ret;
+
+    if (alg == NULL) {
+        ERR_raise(ERR_LIB_ASN1, ASN1_R_DECODE_ERROR);
+        return 0;
+    }
+    ret = X509_ALGOR_copy(algor, alg);
+    X509_ALGOR_free(alg);
+    return ret;
+}
+
 int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1,
     X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
     const void *data, EVP_MD_CTX *ctx)
 {
     const EVP_MD *md;
+    EVP_PKEY_CTX *pctx;
     EVP_PKEY *pkey;
     unsigned char *buf_in = NULL, *buf_out = NULL;
     size_t inl = 0, outl = 0, outll = 0;
@@ -155,7 +171,14 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1,
     int rv, pkey_id;

     md = EVP_MD_CTX_get0_md(ctx);
-    pkey = EVP_PKEY_CTX_get0_pkey(EVP_MD_CTX_get_pkey_ctx(ctx));
+    pctx = EVP_MD_CTX_get_pkey_ctx(ctx);
+
+    if (pctx == NULL) {
+        ERR_raise(ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED);
+        goto err;
+    }
+
+    pkey = EVP_PKEY_CTX_get0_pkey(pctx);

     if (pkey == NULL) {
         ERR_raise(ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED);
@@ -163,13 +186,11 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1,
     }

     if (pkey->ameth == NULL) {
-        EVP_PKEY_CTX *pctx = EVP_MD_CTX_get_pkey_ctx(ctx);
         OSSL_PARAM params[2];
         unsigned char aid[128];
         size_t aid_len = 0;

-        if (pctx == NULL
-            || !EVP_PKEY_CTX_IS_SIGNATURE_OP(pctx)) {
+        if (!EVP_PKEY_CTX_IS_SIGNATURE_OP(pctx)) {
             ERR_raise(ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED);
             goto err;
         }
@@ -186,23 +207,10 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1,
             goto err;
         }

-        if (algor1 != NULL) {
-            const unsigned char *pp = aid;
-
-            if (d2i_X509_ALGOR(&algor1, &pp, aid_len) == NULL) {
-                ERR_raise(ERR_LIB_ASN1, ERR_R_INTERNAL_ERROR);
-                goto err;
-            }
-        }
-
-        if (algor2 != NULL) {
-            const unsigned char *pp = aid;
-
-            if (d2i_X509_ALGOR(&algor2, &pp, aid_len) == NULL) {
-                ERR_raise(ERR_LIB_ASN1, ERR_R_INTERNAL_ERROR);
-                goto err;
-            }
-        }
+        if (algor1 != NULL && !replace_algor_contents_from_DER(algor1, aid, aid_len))
+            goto err;
+        if (algor2 != NULL && !replace_algor_contents_from_DER(algor2, aid, aid_len))
+            goto err;

         rv = 3;
     } else if (pkey->ameth->item_sign) {
@@ -274,15 +282,15 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1,
         ERR_raise(ERR_LIB_ASN1, ERR_R_EVP_LIB);
         goto err;
     }
-    ASN1_STRING_set0(signature, buf_out, outl);
+    ASN1_STRING_set0(signature, buf_out, (int)outl);
     buf_out = NULL;
     /*
      * In the interests of compatibility, I'll make sure that the bit string
      * has a 'not-used bits' value of 0
      */
-    ossl_asn1_string_set_bits_left(signature, 0);
+    ossl_asn1_bit_string_set_unused_bits(signature, 0);
 err:
     OPENSSL_clear_free((char *)buf_in, inl);
     OPENSSL_clear_free((char *)buf_out, outll);
-    return outl;
+    return (int)outl;
 }
diff --git a/deps/openssl/openssl/crypto/asn1/a_strex.c b/deps/openssl/openssl/crypto/asn1/a_strex.c
index a908ac898c8..a6b022ad50b 100644
--- a/deps/openssl/openssl/crypto/asn1/a_strex.c
+++ b/deps/openssl/openssl/crypto/asn1/a_strex.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,10 +11,14 @@
 #include <string.h>
 #include "internal/cryptlib.h"
 #include "internal/sizes.h"
+#include "internal/unicode.h"
+#include "internal/safe_math.h"
 #include "crypto/asn1.h"
+#include <openssl/byteorder.h>
 #include <openssl/crypto.h>
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
+#include <inttypes.h>

 #include "charmap.h"

@@ -28,6 +32,8 @@

 #define ESC_FLAGS (ASN1_STRFLGS_ESC_2253 | ASN1_STRFLGS_ESC_2254 | ASN1_STRFLGS_ESC_QUOTE | ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB)

+OSSL_SAFE_MATH_SIGNED(int, int)
+
 /*
  * Three IO functions for sending data to memory, a BIO and a FILE
  * pointer.
@@ -56,27 +62,27 @@ typedef int char_io(void *arg, const void *buf, int len);

 /*
  * This function handles display of strings, one character at a time. It is
- * passed an unsigned long for each character because it could come from 2 or
+ * passed a uint32_t for each character because it could come from 2 or
  * even 4 byte forms.
  */

-static int do_esc_char(unsigned long c, unsigned short flags, char *do_quotes,
+static int do_esc_char(uint32_t c, unsigned short flags, char *do_quotes,
     char_io *io_ch, void *arg)
 {
     unsigned short chflgs;
     unsigned char chtmp;
     char tmphex[HEX_SIZE(long) + 3];

-    if (c > 0xffffffffL)
+    if (c > UNICODE_MAX)
         return -1;
     if (c > 0xffff) {
-        BIO_snprintf(tmphex, sizeof(tmphex), "\\W%08lX", c);
+        snprintf(tmphex, sizeof(tmphex), "\\W%08" PRIX32, c);
         if (!io_ch(arg, tmphex, 10))
             return -1;
         return 10;
     }
     if (c > 0xff) {
-        BIO_snprintf(tmphex, sizeof(tmphex), "\\U%04lX", c);
+        snprintf(tmphex, sizeof(tmphex), "\\U%04" PRIX32, c);
         if (!io_ch(arg, tmphex, 6))
             return -1;
         return 6;
@@ -102,7 +108,7 @@ static int do_esc_char(unsigned long c, unsigned short flags, char *do_quotes,
         return 2;
     }
     if (chflgs & (ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | ASN1_STRFLGS_ESC_2254)) {
-        BIO_snprintf(tmphex, 11, "\\%02X", chtmp);
+        snprintf(tmphex, 11, "\\%02X", chtmp);
         if (!io_ch(arg, tmphex, 3))
             return -1;
         return 3;
@@ -130,15 +136,19 @@ static int do_esc_char(unsigned long c, unsigned short flags, char *do_quotes,
  * appropriate.
  */

-static int do_buf(unsigned char *buf, int buflen,
+static int do_buf(const unsigned char *buf, int buflen,
     int type, unsigned short flags, char *quotes, char_io *io_ch,
     void *arg)
 {
     int i, outlen, len, charwidth;
     unsigned short orflags;
-    unsigned char *p, *q;
-    unsigned long c;
+    const unsigned char *p, *q;
+    uint32_t c;

+    if (buflen < 0)
+        return -1;
+    if (buflen == 0)
+        return 0;
     p = buf;
     q = buf + buflen;
     outlen = 0;
@@ -162,6 +172,8 @@ static int do_buf(unsigned char *buf, int buflen,
     }

     while (p != q) {
+        uint16_t tmp;
+
         if (p == buf && flags & ASN1_STRFLGS_ESC_2253)
             orflags = CHARTYPE_FIRST_ESC_2253;
         else
@@ -169,15 +181,12 @@ static int do_buf(unsigned char *buf, int buflen,

         switch (charwidth) {
         case 4:
-            c = ((unsigned long)*p++) << 24;
-            c |= ((unsigned long)*p++) << 16;
-            c |= ((unsigned long)*p++) << 8;
-            c |= *p++;
+            p = OPENSSL_load_u32_be(&c, p);
             break;

         case 2:
-            c = ((unsigned long)*p++) << 8;
-            c |= *p++;
+            p = OPENSSL_load_u16_be(&tmp, p);
+            c = tmp;
             break;

         case 1:
@@ -185,7 +194,7 @@ static int do_buf(unsigned char *buf, int buflen,
             break;

         case 0:
-            i = UTF8_getc(p, buflen, &c);
+            i = ossl_utf8_getc_internal(p, buflen, &c);
             if (i < 0)
                 return -1; /* Invalid UTF8String */
             buflen -= i;
@@ -198,7 +207,7 @@ static int do_buf(unsigned char *buf, int buflen,
             orflags = CHARTYPE_LAST_ESC_2253;
         if (type & BUF_TYPE_CONVUTF8) {
             unsigned char utfbuf[6];
-            int utflen = UTF8_putc(utfbuf, sizeof(utfbuf), c);
+            int utflen = ossl_utf8_putc_internal(utfbuf, sizeof(utfbuf), c);

             if (utflen < 0)
                 return -1; /* error happened with UTF8 */
@@ -234,6 +243,10 @@ static int do_hex_dump(char_io *io_ch, void *arg, unsigned char *buf,
     unsigned char *p, *q;
     char hextmp[2];

+    if (buflen < 0)
+        return -1;
+    if (buflen == 0)
+        return 0;
     if (arg) {
         p = buf;
         q = buf + buflen;
@@ -422,12 +435,13 @@ static int do_name_ex(char_io *io_ch, void *arg, const X509_NAME *n,
 {
     int i, prev = -1, orflags, cnt;
     int fn_opt, fn_nid;
-    ASN1_OBJECT *fn;
+    const ASN1_OBJECT *fn;
     const ASN1_STRING *val;
     const X509_NAME_ENTRY *ent;
     char objtmp[80];
     const char *objbuf;
     int outlen, len;
+    int err = 0;
     char *sep_dn, *sep_mv, *sep_eq;
     int sep_dn_len, sep_mv_len, sep_eq_len;
     if (indent < 0)
@@ -491,14 +505,20 @@ static int do_name_ex(char_io *io_ch, void *arg, const X509_NAME *n,
             if (prev == X509_NAME_ENTRY_set(ent)) {
                 if (!io_ch(arg, sep_mv, sep_mv_len))
                     return -1;
-                outlen += sep_mv_len;
+                outlen = safe_add_int(outlen, sep_mv_len, &err);
+                if (err != 0)
+                    return -1;
             } else {
                 if (!io_ch(arg, sep_dn, sep_dn_len))
                     return -1;
-                outlen += sep_dn_len;
+                outlen = safe_add_int(outlen, sep_dn_len, &err);
+                if (err != 0)
+                    return -1;
                 if (!do_indent(io_ch, arg, indent))
                     return -1;
-                outlen += indent;
+                outlen = safe_add_int(outlen, indent, &err);
+                if (err != 0)
+                    return -1;
             }
         }
         prev = X509_NAME_ENTRY_set(ent);
@@ -523,17 +543,24 @@ static int do_name_ex(char_io *io_ch, void *arg, const X509_NAME *n,
                     objbuf = "";
                 }
             }
-            objlen = strlen(objbuf);
+            objlen = (int)strlen(objbuf);
             if (!io_ch(arg, objbuf, objlen))
                 return -1;
             if ((objlen < fld_len) && (flags & XN_FLAG_FN_ALIGN)) {
                 if (!do_indent(io_ch, arg, fld_len - objlen))
                     return -1;
-                outlen += fld_len - objlen;
+                outlen = safe_add_int(outlen, fld_len - objlen, &err);
+                if (err != 0)
+                    return -1;
             }
             if (!io_ch(arg, sep_eq, sep_eq_len))
                 return -1;
-            outlen += objlen + sep_eq_len;
+            outlen = safe_add_int(outlen, objlen, &err);
+            if (err != 0)
+                return -1;
+            outlen = safe_add_int(outlen, sep_eq_len, &err);
+            if (err != 0)
+                return -1;
         }
         /*
          * If the field name is unknown then fix up the DER dump flag. We
@@ -548,7 +575,9 @@ static int do_name_ex(char_io *io_ch, void *arg, const X509_NAME *n,
         len = do_print_ex(io_ch, arg, flags | orflags, val);
         if (len < 0)
             return -1;
-        outlen += len;
+        outlen = safe_add_int(outlen, len, &err);
+        if (err != 0)
+            return -1;
     }
     return outlen;
 }
@@ -618,6 +647,7 @@ int ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in)
         B_ASN1_UTF8STRING);
     if (ret < 0)
         return ret;
+    /* ASN1_mbstring_copy() guarantees the data it produced is NUL terminated */
     *out = stmp.data;
     return stmp.length;
 }
diff --git a/deps/openssl/openssl/crypto/asn1/a_strnid.c b/deps/openssl/openssl/crypto/asn1/a_strnid.c
index e6b8d4c79ef..68953027058 100644
--- a/deps/openssl/openssl/crypto/asn1/a_strnid.c
+++ b/deps/openssl/openssl/crypto/asn1/a_strnid.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,7 @@
 #include "internal/cryptlib.h"
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
+#include "tbl_standard.h"

 static STACK_OF(ASN1_STRING_TABLE) *stable = NULL;
 static void st_free(ASN1_STRING_TABLE *tbl);
@@ -41,7 +42,7 @@ unsigned long ASN1_STRING_get_default_mask(void)
  * MASK:XXXX : a numerical mask value.
  * default   : use Printable, IA5, T61, BMP, and UTF8 string types
  * nombstr   : any string type except variable-sized BMPStrings or UTF8Strings
- * pkix      : PKIX recommendation in RFC2459
+ * pkix      : PKIX recommendation in RFC 5280
  * utf8only  : this is the default, use UTF8Strings
  */

@@ -107,8 +108,6 @@ ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out,
  * Now the tables and helper functions for the string table:
  */

-#include "tbl_standard.h"
-
 static int sk_table_cmp(const ASN1_STRING_TABLE *const *a,
     const ASN1_STRING_TABLE *const *b)
 {
@@ -129,6 +128,11 @@ ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid)
     int idx;
     ASN1_STRING_TABLE fnd;

+    if (nid <= 0) {
+        ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_INVALID_ARGUMENT);
+        return NULL;
+    }
+
 #ifndef OPENSSL_NO_AUTOLOAD_CONFIG
     /* "stable" can be impacted by config, so load the config file first */
     OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
@@ -190,6 +194,11 @@ int ASN1_STRING_TABLE_add(int nid,
 {
     ASN1_STRING_TABLE *tmp;

+    if (nid <= 0 || (minsize >= 0 && maxsize >= 0 && minsize > maxsize)) {
+        ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+
     tmp = stable_get(nid);
     if (tmp == NULL) {
         ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
diff --git a/deps/openssl/openssl/crypto/asn1/a_time.c b/deps/openssl/openssl/crypto/asn1/a_time.c
index 2472b81ebb1..5a1207dc85f 100644
--- a/deps/openssl/openssl/crypto/asn1/a_time.c
+++ b/deps/openssl/openssl/crypto/asn1/a_time.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -79,33 +79,20 @@ int ossl_asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d)
     static const int max[9] = { 99, 99, 12, 31, 23, 59, 59, 12, 59 };
     static const int mdays[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
     char *a;
-    int n, i, i2, l, o, min_l, strict = 0, end = 6, btz = 5, md;
+    int n, i, i2, l, o, min_l, end = 6, btz = 5, md;
     struct tm tmp;
 #if defined(CHARSET_EBCDIC)
     const char upper_z = 0x5A, num_zero = 0x30, period = 0x2E, minus = 0x2D, plus = 0x2B;
 #else
     const char upper_z = 'Z', num_zero = '0', period = '.', minus = '-', plus = '+';
 #endif
-    /*
-     * ASN1_STRING_FLAG_X509_TIME is used to enforce RFC 5280
-     * time string format, in which:
-     *
-     * 1. "seconds" is a 'MUST'
-     * 2. "Zulu" timezone is a 'MUST'
-     * 3. "+|-" is not allowed to indicate a timezone
-     */
+
     if (d->type == V_ASN1_UTCTIME) {
         min_l = 13;
-        if (d->flags & ASN1_STRING_FLAG_X509_TIME) {
-            strict = 1;
-        }
     } else if (d->type == V_ASN1_GENERALIZEDTIME) {
         end = 7;
         btz = 6;
         min_l = 15;
-        if (d->flags & ASN1_STRING_FLAG_X509_TIME) {
-            strict = 1;
-        }
     } else {
         return 0;
     }
@@ -124,7 +111,7 @@ int ossl_asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d)
     if (l < min_l)
         goto err;
     for (i = 0; i < end; i++) {
-        if (!strict && (i == btz) && ((a[o] == upper_z) || (a[o] == plus) || (a[o] == minus))) {
+        if ((i == btz) && ((a[o] == upper_z) || (a[o] == plus) || (a[o] == minus))) {
             i++;
             break;
         }
@@ -190,9 +177,6 @@ int ossl_asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d)
      * digits.
      */
     if (d->type == V_ASN1_GENERALIZEDTIME && a[o] == period) {
-        if (strict)
-            /* RFC 5280 forbids fractional seconds */
-            goto err;
         if (++o == l)
             goto err;
         i = o;
@@ -213,7 +197,7 @@ int ossl_asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d)
      */
     if (a[o] == upper_z) {
         o++;
-    } else if (!strict && ((a[o] == plus) || (a[o] == minus))) {
+    } else if (((a[o] == plus) || (a[o] == minus))) {
         int offsign = a[o] == minus ? 1 : -1;
         int offset = 0;

@@ -249,7 +233,7 @@ int ossl_asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d)
         if (offset && !OPENSSL_gmtime_adj(&tmp, 0, offset * offsign))
             goto err;
     } else {
-        /* not Z, or not +/- in non-strict mode */
+        /* not Z, or not +/- */
         goto err;
     }
     if (o == l) {
@@ -266,7 +250,8 @@ ASN1_TIME *ossl_asn1_time_from_tm(ASN1_TIME *s, struct tm *ts, int type)
 {
     char *p;
     ASN1_TIME *tmps = NULL;
-    const size_t len = 20;
+    const int len = 20;
+    int ret;

     if (type == V_ASN1_UNDEF) {
         if (is_utc(ts->tm_year))
@@ -287,7 +272,7 @@ ASN1_TIME *ossl_asn1_time_from_tm(ASN1_TIME *s, struct tm *ts, int type)
     if (tmps == NULL)
         return NULL;

-    if (!ASN1_STRING_set(tmps, NULL, len))
+    if (!ossl_asn1_string_set1_data(tmps, NULL, len))
         goto err;

     tmps->type = type;
@@ -299,16 +284,19 @@ ASN1_TIME *ossl_asn1_time_from_tm(ASN1_TIME *s, struct tm *ts, int type)
     if (type == V_ASN1_GENERALIZEDTIME) {
         if (ts->tm_year > INT_MAX - 1900)
             goto err;
-        tmps->length = BIO_snprintf(p, len, "%04d%02d%02d%02d%02d%02dZ",
+        ret = snprintf(p, len, "%04d%02d%02d%02d%02d%02dZ",
             ts->tm_year + 1900, ts->tm_mon + 1,
             ts->tm_mday, ts->tm_hour, ts->tm_min,
             ts->tm_sec);
     } else {
-        tmps->length = BIO_snprintf(p, len, "%02d%02d%02d%02d%02d%02dZ",
+        ret = snprintf(p, len, "%02d%02d%02d%02d%02d%02dZ",
             ts->tm_year % 100, ts->tm_mon + 1,
             ts->tm_mday, ts->tm_hour, ts->tm_min,
             ts->tm_sec);
     }
+    if (ret < 0 || ret >= len)
+        goto err;
+    tmps->length = ret;

 #ifdef CHARSET_EBCDIC
     ebcdic2ascii(tmps->data, tmps->data, tmps->length);
@@ -385,59 +373,53 @@ int ASN1_TIME_set_string_X509(ASN1_TIME *s, const char *str)
 {
     ASN1_TIME t;
     struct tm tm;
-    int rv = 0;
-
-    t.length = strlen(str);
-    t.data = (unsigned char *)str;
-    t.flags = ASN1_STRING_FLAG_X509_TIME;
-
-    t.type = V_ASN1_UTCTIME;
-
-    if (!ASN1_TIME_check(&t)) {
+    size_t len;
+
+    /* RFC 5280 4.1.2.5: Valid RFC5280 times must be either length 13 or 15. */
+    len = strlen(str);
+    switch (len) {
+    case 13:
+        t.type = V_ASN1_UTCTIME;
+        break;
+    case 15:
         t.type = V_ASN1_GENERALIZEDTIME;
-        if (!ASN1_TIME_check(&t))
-            goto out;
+        break;
+    default:
+        return 0;
     }

+    /* RFC 5280 4.1.2.5 Valid RFC5280 times must end in 'Z'. */
+    if (str[len - 1] != 0x5A)
+        return 0;
+
+    t.length = (int)len;
+    t.data = (unsigned char *)str;
+
     /*
-     * Per RFC 5280 (section 4.1.2.5.), the valid input time
-     * strings should be encoded with the following rules:
-     *
-     * 1. UTC: YYMMDDHHMMSSZ, if YY < 50 (20YY) --> UTC: YYMMDDHHMMSSZ
-     * 2. UTC: YYMMDDHHMMSSZ, if YY >= 50 (19YY) --> UTC: YYMMDDHHMMSSZ
-     * 3. G'd: YYYYMMDDHHMMSSZ, if YYYY >= 2050 --> G'd: YYYYMMDDHHMMSSZ
-     * 4. G'd: YYYYMMDDHHMMSSZ, if YYYY < 2050 --> UTC: YYMMDDHHMMSSZ
-     *
-     * Only strings of the 4th rule should be reformatted, but since a
-     * UTC can only present [1950, 2050), so if the given time string
-     * is less than 1950 (e.g. 19230419000000Z), we do nothing...
+     * RFC 5280 Section 4.1.2.5 The following function is permissive
+     * and allows time zone offsets and time zones not Z, etc. As we
+     * have already failed and excluded anything not the correct length
+     * for the type, and anything not ending in a 'Z', Our time may
+     * not be any of these other cases, and still parse as a time.
      */
+    if (!ossl_asn1_time_to_tm(&tm, &t))
+        return 0;

-    if (s != NULL && t.type == V_ASN1_GENERALIZEDTIME) {
-        if (!ossl_asn1_time_to_tm(&tm, &t))
-            goto out;
-        if (is_utc(tm.tm_year)) {
-            t.length -= 2;
-            /*
-             * it's OK to let original t.data go since that's assigned
-             * to a piece of memory allocated outside of this function.
-             * new t.data would be freed after ASN1_STRING_copy is done.
-             */
-            t.data = OPENSSL_zalloc(t.length + 1);
-            if (t.data == NULL)
-                goto out;
-            memcpy(t.data, str + 2, t.length);
-            t.type = V_ASN1_UTCTIME;
-        }
-    }
+    if (s != NULL) {
+        /*
+         * Unlike every other type of nonconforming to RFC5280 time
+         * string, which causes this function to fail, a 15 character
+         * input string that ends up being in the UTC time range is not
+         * rejected. Instead, two digits of the year is removed from
+         * start of the input string so the result is a UTC time.
+         */
+        if (is_utc(tm.tm_year) && len == 15)
+            return ASN1_TIME_set_string(s, str + 2);

-    if (s == NULL || ASN1_STRING_copy((ASN1_STRING *)s, (ASN1_STRING *)&t))
-        rv = 1;
+        return ASN1_TIME_set_string(s, str);
+    }

-    if (t.data != (unsigned char *)str)
-        OPENSSL_free(t.data);
-out:
-    return rv;
+    return 1;
 }

 int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm)
diff --git a/deps/openssl/openssl/crypto/asn1/a_time_posix.c b/deps/openssl/openssl/crypto/asn1/a_time_posix.c
new file mode 100644
index 00000000000..4e748007d07
--- /dev/null
+++ b/deps/openssl/openssl/crypto/asn1/a_time_posix.c
@@ -0,0 +1,282 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * Time conversion to/from POSIX time_t and struct tm, with no support
+ * for time zones other than UTC
+ */
+
+#include <inttypes.h>
+#include <limits.h>
+#include <stdint.h>
+#include <string.h>
+#include <time.h>
+
+#include <openssl/asn1.h>
+#include <openssl/posix_time.h>
+
+#include <crypto/x509.h>
+#include "asn1_local.h"
+
+#define SECS_PER_HOUR (int64_t)(60 * 60)
+#define SECS_PER_DAY (int64_t)(24 * SECS_PER_HOUR)
+
+/*
+ * Is a year/month/day combination valid, in the range from year 0000
+ * to 9999?
+ */
+static int is_valid_date(int64_t year, int64_t month, int64_t day)
+{
+    int days_in_month;
+
+    if (day < 1 || year < 0 || year > 9999)
+        return 0;
+    switch (month) {
+    case 1:
+    case 3:
+    case 5:
+    case 7:
+    case 8:
+    case 10:
+    case 12:
+        days_in_month = 31;
+        break;
+    case 4:
+    case 6:
+    case 9:
+    case 11:
+        days_in_month = 30;
+        break;
+    case 2:
+        if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
+            days_in_month = 29;
+        else
+            days_in_month = 28;
+        break;
+    default:
+        return 0;
+    }
+    return day <= days_in_month;
+}
+
+/*
+ * Is a time valid? Leap seconds of 60 are not considered valid, as
+ * the POSIX time in seconds does not include them.
+ */
+static int is_valid_time(int64_t hours, int64_t minutes, int64_t seconds)
+{
+    return hours >= 0 && minutes >= 0 && seconds >= 0 && hours <= 23 && minutes <= 59 && seconds <= 59;
+}
+
+/* 0000-01-01 00:00:00 UTC */
+#define MIN_POSIX_TIME INT64_C(-62167219200)
+/* 9999-12-31 23:59:59 UTC */
+#define MAX_POSIX_TIME INT64_C(253402300799)
+
+/* Is a int64 time representing a time within our expected range? */
+static int is_valid_posix_time(int64_t time)
+{
+    return MIN_POSIX_TIME <= time && time <= MAX_POSIX_TIME;
+}
+
+/*
+ * Inspired by algorithms presented in
+ * https://howardhinnant.github.io/date_algorithms.html
+ * (Public Domain)
+ */
+static int posix_time_from_utc(int64_t year, int64_t month, int64_t day,
+    int64_t hours, int64_t minutes, int64_t seconds,
+    int64_t *out_time)
+{
+    int64_t era, year_of_era, day_of_year, day_of_era, posix_days;
+
+    if (!is_valid_date(year, month, day) || !is_valid_time(hours, minutes, seconds))
+        return 0;
+    if (month <= 2)
+        year--; /* Start years on Mar 1, so leap days end a year. */
+
+    /* At this point year will be in the range -1 and 9999. */
+    era = (year >= 0 ? year : year - 399) / 400;
+    year_of_era = year - era * 400;
+    day_of_year = (153 * (month > 2 ? month - 3 : month + 9) + 2) / 5 + day - 1;
+    day_of_era = year_of_era * 365 + year_of_era / 4 - year_of_era / 100 + day_of_year;
+    posix_days = era * 146097 + day_of_era - 719468;
+    *out_time = posix_days * SECS_PER_DAY + hours * SECS_PER_HOUR + minutes * 60 + seconds;
+
+    return 1;
+}
+
+/*
+ * Inspired by algorithms presented in
+ * https://howardhinnant.github.io/date_algorithms.html
+ * (Public Domain)
+ */
+static int utc_from_posix_time(int64_t time, int *out_year, int *out_month,
+    int *out_day, int *out_hours, int *out_minutes,
+    int *out_seconds)
+{
+    int64_t days, leftover_seconds, era, day_of_era, year_of_era, day_of_year;
+    int64_t month_of_year;
+
+    if (!is_valid_posix_time(time))
+        return 0;
+
+    days = time / SECS_PER_DAY;
+    leftover_seconds = time % SECS_PER_DAY;
+    if (leftover_seconds < 0) {
+        days--;
+        leftover_seconds += SECS_PER_DAY;
+    }
+    days += 719468; /*  Shift to starting epoch of Mar 1 0000. */
+
+    /* At this point, days will be in the range -61 and 3652364. */
+    era = (days > 0 ? days : days - 146096) / 146097;
+    day_of_era = days - era * 146097;
+    year_of_era = (day_of_era - day_of_era / 1460 + day_of_era / 36524 - day_of_era / 146096) / 365;
+    *out_year = (int)(year_of_era + era * 400); /* Year starts on Mar 1 */
+    day_of_year = day_of_era - (365 * year_of_era + year_of_era / 4 - year_of_era / 100);
+    month_of_year = (5 * day_of_year + 2) / 153;
+    *out_month = (int)(month_of_year < 10 ? month_of_year + 3 : month_of_year - 9);
+    if (*out_month <= 2)
+        (*out_year)++; /* Adjust year back to Jan 1 start of year. */
+
+    *out_day = (int)(day_of_year - (153 * month_of_year + 2) / 5 + 1);
+    *out_hours = (int)leftover_seconds / SECS_PER_HOUR;
+    leftover_seconds %= SECS_PER_HOUR;
+    *out_minutes = (int)leftover_seconds / 60;
+    *out_seconds = (int)leftover_seconds % 60;
+
+    return 1;
+}
+
+int OPENSSL_tm_to_posix(const struct tm *tm, int64_t *out)
+{
+    return posix_time_from_utc(tm->tm_year + (int64_t)1900,
+        tm->tm_mon + (int64_t)1, tm->tm_mday,
+        tm->tm_hour, tm->tm_min, tm->tm_sec, out);
+}
+
+int OPENSSL_posix_to_tm(int64_t time, struct tm *out_tm)
+{
+    struct tm tmp_tm = { 0 };
+
+    memset(out_tm, 0, sizeof(*out_tm));
+
+    if (!utc_from_posix_time(time, &tmp_tm.tm_year, &tmp_tm.tm_mon,
+            &tmp_tm.tm_mday, &tmp_tm.tm_hour,
+            &tmp_tm.tm_min, &tmp_tm.tm_sec))
+        return 0;
+
+    tmp_tm.tm_year -= 1900;
+    tmp_tm.tm_mon -= 1;
+
+    *out_tm = tmp_tm;
+
+    return 1;
+}
+
+int ossl_asn1_time_tm_to_time_t(const struct tm *tm, time_t *out)
+{
+    int64_t posix_time;
+    time_t test_t = -1;
+    int bad_idea_bears = (test_t > 0); /* time_t is unsigned */
+
+    if (!OPENSSL_tm_to_posix(tm, &posix_time))
+        return 0;
+
+    if (sizeof(time_t) == sizeof(int32_t)
+        && ((!bad_idea_bears && (posix_time > INT32_MAX || posix_time < INT32_MIN))
+            || (bad_idea_bears && (posix_time > UINT32_MAX || posix_time < 0))))
+        return 0;
+
+    *out = posix_time;
+    return 1;
+}
+
+int ossl_asn1_time_time_t_to_tm(const time_t *time, struct tm *out_tm)
+{
+    int64_t posix_time = *time;
+
+    return OPENSSL_posix_to_tm(posix_time, out_tm);
+}
+
+int OPENSSL_timegm(const struct tm *tm, time_t *out)
+{
+    return ossl_asn1_time_tm_to_time_t(tm, out);
+}
+
+struct tm *OPENSSL_gmtime(const time_t *time, struct tm *out_tm)
+{
+    if (!ossl_asn1_time_time_t_to_tm(time, out_tm))
+        return NULL;
+    return out_tm;
+}
+
+/* LibreSSL and BoringSSL use int64_t instead of long. */
+int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec)
+{
+    int64_t posix_time;
+
+    if (!OPENSSL_tm_to_posix(tm, &posix_time))
+        return 0;
+
+    OPENSSL_assert(INT_MAX <= INT64_MAX / SECS_PER_DAY);
+    OPENSSL_assert(MAX_POSIX_TIME <= INT64_MAX - INT_MAX * SECS_PER_DAY);
+    OPENSSL_assert(MIN_POSIX_TIME >= INT64_MIN - INT_MIN * SECS_PER_DAY);
+
+    posix_time += offset_day * SECS_PER_DAY;
+
+    if (posix_time > 0 && offset_sec > INT64_MAX - posix_time)
+        return 0;
+    if (posix_time < 0 && offset_sec < INT64_MIN - posix_time)
+        return 0;
+    posix_time += offset_sec;
+
+    if (!OPENSSL_posix_to_tm(posix_time, tm))
+        return 0;
+
+    return 1;
+}
+
+int OPENSSL_gmtime_diff(int *out_days, int *out_secs, const struct tm *from,
+    const struct tm *to)
+{
+    int64_t time_to, time_from, timediff, daydiff;
+
+    if (!OPENSSL_tm_to_posix(to, &time_to) || !OPENSSL_tm_to_posix(from, &time_from))
+        return 0;
+
+    /* Times are in range, so these calculations cannot overflow. */
+    OPENSSL_assert(SECS_PER_DAY <= INT_MAX);
+    OPENSSL_assert((MAX_POSIX_TIME - MIN_POSIX_TIME) / SECS_PER_DAY <= INT_MAX);
+
+    timediff = time_to - time_from;
+    daydiff = timediff / SECS_PER_DAY;
+    timediff %= SECS_PER_DAY;
+
+    if (out_secs != NULL)
+        *out_secs = (int)timediff;
+    if (out_days != NULL)
+        *out_days = (int)daydiff;
+
+    return 1;
+}
+
+int ossl_posix_to_asn1_time(int64_t posix_time, ASN1_TIME **out_time)
+{
+    struct tm ts;
+
+    if (!OPENSSL_posix_to_tm(posix_time, &ts))
+        return 0;
+
+    if ((*out_time = ossl_asn1_time_from_tm(*out_time, &ts, V_ASN1_UNDEF)) == NULL)
+        return 0;
+
+    return 1;
+}
diff --git a/deps/openssl/openssl/crypto/asn1/a_utctm.c b/deps/openssl/openssl/crypto/asn1/a_utctm.c
index 27eeb179328..e5b801cc43f 100644
--- a/deps/openssl/openssl/crypto/asn1/a_utctm.c
+++ b/deps/openssl/openssl/crypto/asn1/a_utctm.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -34,9 +34,12 @@ int ASN1_UTCTIME_check(const ASN1_UTCTIME *d)
 int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str)
 {
     ASN1_UTCTIME t;
+    size_t len;

+    if ((len = strlen(str)) >= INT_MAX)
+        return 0;
     t.type = V_ASN1_UTCTIME;
-    t.length = strlen(str);
+    t.length = (int)len;
     t.data = (unsigned char *)str;
     t.flags = 0;

diff --git a/deps/openssl/openssl/crypto/asn1/a_utf8.c b/deps/openssl/openssl/crypto/asn1/a_utf8.c
index fb5999fa7f1..2b479ea22ce 100644
--- a/deps/openssl/openssl/crypto/asn1/a_utf8.c
+++ b/deps/openssl/openssl/crypto/asn1/a_utf8.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,7 @@
 #include "internal/cryptlib.h"
 #include "internal/unicode.h"
 #include <openssl/asn1.h>
+#include <crypto/asn1.h>

 /* UTF8 utilities */

@@ -25,10 +26,10 @@
  * -4 = character encoded incorrectly (not minimal length).
  */

-int UTF8_getc(const unsigned char *str, int len, unsigned long *val)
+int ossl_utf8_getc_internal(const unsigned char *str, int len, uint32_t *val)
 {
     const unsigned char *p;
-    unsigned long value;
+    uint32_t value;
     int ret;
     if (len <= 0)
         return 0;
@@ -82,6 +83,21 @@ int UTF8_getc(const unsigned char *str, int len, unsigned long *val)
     return ret;
 }

+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+int UTF8_getc(const unsigned char *str, int len, unsigned long *val)
+{
+    uint32_t value = 0;
+    int ret;
+
+    ret = ossl_utf8_getc_internal(str, len, &value);
+
+    if (ret)
+        *val = (unsigned long)value;
+
+    return ret;
+}
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_1) */
+
 /*
  * This takes a character 'value' and writes the UTF8 encoded value in 'str'
  * where 'str' is a buffer containing 'len' characters. Returns the number of
@@ -90,7 +106,7 @@ int UTF8_getc(const unsigned char *str, int len, unsigned long *val)
  * characters. It will need at most 4 characters.
  */

-int UTF8_putc(unsigned char *str, int len, unsigned long value)
+int ossl_utf8_putc_internal(unsigned char *str, int len, uint32_t value)
 {
     if (!str)
         len = 4; /* Maximum we will need */
@@ -135,3 +151,10 @@ int UTF8_putc(unsigned char *str, int len, unsigned long value)
     }
     return -2;
 }
+
+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+int UTF8_putc(unsigned char *str, int len, unsigned long value)
+{
+    return ossl_utf8_putc_internal(str, len, (uint32_t)value);
+}
+#endif
diff --git a/deps/openssl/openssl/crypto/asn1/a_verify.c b/deps/openssl/openssl/crypto/asn1/a_verify.c
index 55f86ee83ff..5dae9e9c759 100644
--- a/deps/openssl/openssl/crypto/asn1/a_verify.c
+++ b/deps/openssl/openssl/crypto/asn1/a_verify.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -28,7 +28,7 @@ int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature,
     char *data, EVP_PKEY *pkey)
 {
     EVP_MD_CTX *ctx = EVP_MD_CTX_new();
-    const EVP_MD *type;
+    EVP_MD *type = NULL;
     unsigned char *p, *buf_in = NULL;
     int ret = -1, i, inl;

@@ -37,7 +37,7 @@ int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature,
         goto err;
     }
     i = OBJ_obj2nid(a->algorithm);
-    type = EVP_get_digestbyname(OBJ_nid2sn(i));
+    type = EVP_MD_fetch(NULL, OBJ_nid2sn(i), NULL);
     if (type == NULL) {
         ERR_raise(ERR_LIB_ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM);
         goto err;
@@ -79,46 +79,33 @@ int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature,
     }
     ret = 1;
 err:
+    EVP_MD_free(type);
     EVP_MD_CTX_free(ctx);
     return ret;
 }

 #endif

-int ASN1_item_verify(const ASN1_ITEM *it, const X509_ALGOR *alg,
+static int item_verify(const ASN1_ITEM *it, const X509_ALGOR *alg,
     const ASN1_BIT_STRING *signature, const void *data,
-    EVP_PKEY *pkey)
-{
-    return ASN1_item_verify_ex(it, alg, signature, data, NULL, pkey, NULL, NULL);
-}
-
-int ASN1_item_verify_ex(const ASN1_ITEM *it, const X509_ALGOR *alg,
-    const ASN1_BIT_STRING *signature, const void *data,
-    const ASN1_OCTET_STRING *id, EVP_PKEY *pkey,
-    OSSL_LIB_CTX *libctx, const char *propq)
-{
-    EVP_MD_CTX *ctx;
-    int rv = -1;
-
-    if ((ctx = evp_md_ctx_new_ex(pkey, id, libctx, propq)) != NULL) {
-        rv = ASN1_item_verify_ctx(it, alg, signature, data, ctx);
-        EVP_PKEY_CTX_free(EVP_MD_CTX_get_pkey_ctx(ctx));
-        EVP_MD_CTX_free(ctx);
-    }
-    return rv;
-}
-
-int ASN1_item_verify_ctx(const ASN1_ITEM *it, const X509_ALGOR *alg,
-    const ASN1_BIT_STRING *signature, const void *data,
-    EVP_MD_CTX *ctx)
+    EVP_MD_CTX *ctx, OSSL_LIB_CTX *libctx, const char *propq)
 {
+    EVP_PKEY_CTX *pctx;
     EVP_PKEY *pkey;
+    EVP_MD *type = NULL;
     unsigned char *buf_in = NULL;
     int ret = -1, inl = 0;
     int mdnid, pknid;
     size_t inll = 0;

-    pkey = EVP_PKEY_CTX_get0_pkey(EVP_MD_CTX_get_pkey_ctx(ctx));
+    pctx = EVP_MD_CTX_get_pkey_ctx(ctx);
+
+    if (pctx == NULL) {
+        ERR_raise(ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED);
+        return -1;
+    }
+
+    pkey = EVP_PKEY_CTX_get0_pkey(pctx);

     if (pkey == NULL) {
         ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);
@@ -153,8 +140,6 @@ int ASN1_item_verify_ctx(const ASN1_ITEM *it, const X509_ALGOR *alg,
         if (ret <= 1)
             goto err;
     } else {
-        const EVP_MD *type = NULL;
-
         /*
          * We don't yet have the ability for providers to be able to handle
          * X509_ALGOR style parameters. Fortunately the only one that needs this
@@ -179,7 +164,7 @@ int ASN1_item_verify_ctx(const ASN1_ITEM *it, const X509_ALGOR *alg,
             }

             if (mdnid != NID_undef) {
-                type = EVP_get_digestbynid(mdnid);
+                type = EVP_MD_fetch(libctx, OBJ_nid2sn(mdnid), propq);
                 if (type == NULL) {
                     ERR_raise_data(ERR_LIB_ASN1,
                         ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM,
@@ -221,6 +206,37 @@ int ASN1_item_verify_ctx(const ASN1_ITEM *it, const X509_ALGOR *alg,
     }
     ret = 1;
 err:
+    EVP_MD_free(type);
     OPENSSL_clear_free(buf_in, inll);
     return ret;
 }
+
+int ASN1_item_verify(const ASN1_ITEM *it, const X509_ALGOR *alg,
+    const ASN1_BIT_STRING *signature, const void *data,
+    EVP_PKEY *pkey)
+{
+    return ASN1_item_verify_ex(it, alg, signature, data, NULL, pkey, NULL, NULL);
+}
+
+int ASN1_item_verify_ex(const ASN1_ITEM *it, const X509_ALGOR *alg,
+    const ASN1_BIT_STRING *signature, const void *data,
+    const ASN1_OCTET_STRING *id, EVP_PKEY *pkey,
+    OSSL_LIB_CTX *libctx, const char *propq)
+{
+    EVP_MD_CTX *ctx;
+    int rv = -1;
+
+    if ((ctx = evp_md_ctx_new_ex(pkey, id, libctx, propq)) != NULL) {
+        rv = item_verify(it, alg, signature, data, ctx, libctx, propq);
+        EVP_PKEY_CTX_free(EVP_MD_CTX_get_pkey_ctx(ctx));
+        EVP_MD_CTX_free(ctx);
+    }
+    return rv;
+}
+
+int ASN1_item_verify_ctx(const ASN1_ITEM *it, const X509_ALGOR *alg,
+    const ASN1_BIT_STRING *signature, const void *data,
+    EVP_MD_CTX *ctx)
+{
+    return item_verify(it, alg, signature, data, ctx, NULL, NULL);
+}
diff --git a/deps/openssl/openssl/crypto/asn1/ameth_lib.c b/deps/openssl/openssl/crypto/asn1/ameth_lib.c
index 14813e60af3..a015203583b 100644
--- a/deps/openssl/openssl/crypto/asn1/ameth_lib.c
+++ b/deps/openssl/openssl/crypto/asn1/ameth_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,21 +7,16 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
 #include "internal/cryptlib.h"
 #include <stdio.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
-#include <openssl/engine.h>
 #include "crypto/asn1.h"
 #include "crypto/evp.h"

 #include "standard_methods.h"

 typedef int sk_cmp_fn_type(const char *const *a, const char *const *b);
-static STACK_OF(EVP_PKEY_ASN1_METHOD) *app_methods = NULL;

 DECLARE_OBJ_BSEARCH_CMP_FN(const EVP_PKEY_ASN1_METHOD *,
     const EVP_PKEY_ASN1_METHOD *, ameth);
@@ -35,23 +30,20 @@ static int ameth_cmp(const EVP_PKEY_ASN1_METHOD *const *a,
 IMPLEMENT_OBJ_BSEARCH_CMP_FN(const EVP_PKEY_ASN1_METHOD *,
     const EVP_PKEY_ASN1_METHOD *, ameth);

-int EVP_PKEY_asn1_get_count(void)
+int evp_pkey_asn1_get_count(void)
 {
     int num = OSSL_NELEM(standard_methods);
-    if (app_methods)
-        num += sk_EVP_PKEY_ASN1_METHOD_num(app_methods);
     return num;
 }

-const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx)
+const EVP_PKEY_ASN1_METHOD *evp_pkey_asn1_get0(int idx)
 {
     int num = OSSL_NELEM(standard_methods);
-    if (idx < 0)
+
+    if (idx < 0 || idx >= num)
         return NULL;
-    if (idx < num)
-        return standard_methods[idx];
-    idx -= num;
-    return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
+
+    return standard_methods[idx];
 }

 static const EVP_PKEY_ASN1_METHOD *pkey_asn1_find(int type)
@@ -60,12 +52,6 @@ static const EVP_PKEY_ASN1_METHOD *pkey_asn1_find(int type)
     const EVP_PKEY_ASN1_METHOD *t = &tmp, **ret;

     tmp.pkey_id = type;
-    if (app_methods) {
-        int idx;
-        idx = sk_EVP_PKEY_ASN1_METHOD_find(app_methods, &tmp);
-        if (idx >= 0)
-            return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
-    }
     ret = OBJ_bsearch_ameth(&t, standard_methods, OSSL_NELEM(standard_methods));
     if (ret == NULL || *ret == NULL)
         return NULL;
@@ -73,12 +59,11 @@ static const EVP_PKEY_ASN1_METHOD *pkey_asn1_find(int type)
 }

 /*
- * Find an implementation of an ASN1 algorithm. If 'pe' is not NULL also
- * search through engines and set *pe to a functional reference to the engine
- * implementing 'type' or NULL if no engine implements it.
+ * Return ASN1 method for desired `type`, returns NULL if no method is found for
+ * `type`. If pe is not NULL, the function will set *pe to NULL to indicate no
+ * engine is used.
  */
-
-const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type)
+const EVP_PKEY_ASN1_METHOD *evp_pkey_asn1_find(int type)
 {
     const EVP_PKEY_ASN1_METHOD *t;

@@ -88,48 +73,18 @@ const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type)
             break;
         type = t->pkey_base_id;
     }
-    if (pe) {
-#ifndef OPENSSL_NO_ENGINE
-        ENGINE *e;
-        /* type will contain the final unaliased type */
-        e = ENGINE_get_pkey_asn1_meth_engine(type);
-        if (e) {
-            *pe = e;
-            return ENGINE_get_pkey_asn1_meth(e, type);
-        }
-#endif
-        *pe = NULL;
-    }
     return t;
 }

-const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,
-    const char *str, int len)
+const EVP_PKEY_ASN1_METHOD *evp_pkey_asn1_find_str(const char *str, int len)
 {
     int i;
     const EVP_PKEY_ASN1_METHOD *ameth = NULL;

     if (len == -1)
-        len = strlen(str);
-    if (pe) {
-#ifndef OPENSSL_NO_ENGINE
-        ENGINE *e;
-        ameth = ENGINE_pkey_asn1_find_str(&e, str, len);
-        if (ameth) {
-            /*
-             * Convert structural into functional reference
-             */
-            if (!ENGINE_init(e))
-                ameth = NULL;
-            ENGINE_free(e);
-            *pe = e;
-            return ameth;
-        }
-#endif
-        *pe = NULL;
-    }
-    for (i = EVP_PKEY_asn1_get_count(); i-- > 0;) {
-        ameth = EVP_PKEY_asn1_get0(i);
+        len = (int)strlen(str);
+    for (i = evp_pkey_asn1_get_count(); i-- > 0;) {
+        ameth = evp_pkey_asn1_get0(i);
         if (ameth->pkey_flags & ASN1_PKEY_ALIAS)
             continue;
         if ((int)strlen(ameth->pem_str) == len
@@ -139,62 +94,7 @@ const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,
     return NULL;
 }

-int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth)
-{
-    EVP_PKEY_ASN1_METHOD tmp = {
-        0,
-    };
-
-    /*
-     * One of the following must be true:
-     *
-     * pem_str == NULL AND ASN1_PKEY_ALIAS is set
-     * pem_str != NULL AND ASN1_PKEY_ALIAS is clear
-     *
-     * Anything else is an error and may lead to a corrupt ASN1 method table
-     */
-    if (!((ameth->pem_str == NULL
-              && (ameth->pkey_flags & ASN1_PKEY_ALIAS) != 0)
-            || (ameth->pem_str != NULL
-                && (ameth->pkey_flags & ASN1_PKEY_ALIAS) == 0))) {
-        ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_INVALID_ARGUMENT);
-        return 0;
-    }
-
-    if (app_methods == NULL) {
-        app_methods = sk_EVP_PKEY_ASN1_METHOD_new(ameth_cmp);
-        if (app_methods == NULL)
-            return 0;
-    }
-
-    tmp.pkey_id = ameth->pkey_id;
-    if (sk_EVP_PKEY_ASN1_METHOD_find(app_methods, &tmp) >= 0) {
-        ERR_raise(ERR_LIB_EVP,
-            EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED);
-        return 0;
-    }
-
-    if (!sk_EVP_PKEY_ASN1_METHOD_push(app_methods, ameth))
-        return 0;
-    sk_EVP_PKEY_ASN1_METHOD_sort(app_methods);
-    return 1;
-}
-
-int EVP_PKEY_asn1_add_alias(int to, int from)
-{
-    EVP_PKEY_ASN1_METHOD *ameth;
-    ameth = EVP_PKEY_asn1_new(from, ASN1_PKEY_ALIAS, NULL, NULL);
-    if (ameth == NULL)
-        return 0;
-    ameth->pkey_base_id = to;
-    if (!EVP_PKEY_asn1_add0(ameth)) {
-        EVP_PKEY_asn1_free(ameth);
-        return 0;
-    }
-    return 1;
-}
-
-int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *ppkey_base_id,
+int evp_pkey_asn1_get0_info(int *ppkey_id, int *ppkey_base_id,
     int *ppkey_flags, const char **pinfo,
     const char **ppem_str,
     const EVP_PKEY_ASN1_METHOD *ameth)
@@ -214,223 +114,7 @@ int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *ppkey_base_id,
     return 1;
 }

-const EVP_PKEY_ASN1_METHOD *EVP_PKEY_get0_asn1(const EVP_PKEY *pkey)
+const EVP_PKEY_ASN1_METHOD *evp_pkey_get0_asn1(const EVP_PKEY *pkey)
 {
     return pkey->ameth;
 }
-
-EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags,
-    const char *pem_str, const char *info)
-{
-    EVP_PKEY_ASN1_METHOD *ameth = OPENSSL_zalloc(sizeof(*ameth));
-
-    if (ameth == NULL)
-        return NULL;
-
-    ameth->pkey_id = id;
-    ameth->pkey_base_id = id;
-    ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC;
-
-    if (info) {
-        ameth->info = OPENSSL_strdup(info);
-        if (ameth->info == NULL)
-            goto err;
-    }
-
-    if (pem_str) {
-        ameth->pem_str = OPENSSL_strdup(pem_str);
-        if (ameth->pem_str == NULL)
-            goto err;
-    }
-
-    return ameth;
-
-err:
-    EVP_PKEY_asn1_free(ameth);
-    return NULL;
-}
-
-void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,
-    const EVP_PKEY_ASN1_METHOD *src)
-{
-    int pkey_id = dst->pkey_id;
-    int pkey_base_id = dst->pkey_base_id;
-    unsigned long pkey_flags = dst->pkey_flags;
-    char *pem_str = dst->pem_str;
-    char *info = dst->info;
-
-    *dst = *src;
-
-    /* We only copy the function pointers so restore the other values */
-    dst->pkey_id = pkey_id;
-    dst->pkey_base_id = pkey_base_id;
-    dst->pkey_flags = pkey_flags;
-    dst->pem_str = pem_str;
-    dst->info = info;
-}
-
-void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth)
-{
-    if (ameth && (ameth->pkey_flags & ASN1_PKEY_DYNAMIC)) {
-        OPENSSL_free(ameth->pem_str);
-        OPENSSL_free(ameth->info);
-        OPENSSL_free(ameth);
-    }
-}
-
-void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*pub_decode)(EVP_PKEY *pk,
-        const X509_PUBKEY *pub),
-    int (*pub_encode)(X509_PUBKEY *pub,
-        const EVP_PKEY *pk),
-    int (*pub_cmp)(const EVP_PKEY *a,
-        const EVP_PKEY *b),
-    int (*pub_print)(BIO *out,
-        const EVP_PKEY *pkey,
-        int indent, ASN1_PCTX *pctx),
-    int (*pkey_size)(const EVP_PKEY *pk),
-    int (*pkey_bits)(const EVP_PKEY *pk))
-{
-    ameth->pub_decode = pub_decode;
-    ameth->pub_encode = pub_encode;
-    ameth->pub_cmp = pub_cmp;
-    ameth->pub_print = pub_print;
-    ameth->pkey_size = pkey_size;
-    ameth->pkey_bits = pkey_bits;
-}
-
-void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*priv_decode)(EVP_PKEY *pk,
-        const PKCS8_PRIV_KEY_INFO
-            *p8inf),
-    int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8,
-        const EVP_PKEY *pk),
-    int (*priv_print)(BIO *out,
-        const EVP_PKEY *pkey,
-        int indent,
-        ASN1_PCTX *pctx))
-{
-    ameth->priv_decode = priv_decode;
-    ameth->priv_encode = priv_encode;
-    ameth->priv_print = priv_print;
-}
-
-void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*param_decode)(EVP_PKEY *pkey,
-        const unsigned char **pder,
-        int derlen),
-    int (*param_encode)(const EVP_PKEY *pkey,
-        unsigned char **pder),
-    int (*param_missing)(const EVP_PKEY *pk),
-    int (*param_copy)(EVP_PKEY *to,
-        const EVP_PKEY *from),
-    int (*param_cmp)(const EVP_PKEY *a,
-        const EVP_PKEY *b),
-    int (*param_print)(BIO *out,
-        const EVP_PKEY *pkey,
-        int indent, ASN1_PCTX *pctx))
-{
-    ameth->param_decode = param_decode;
-    ameth->param_encode = param_encode;
-    ameth->param_missing = param_missing;
-    ameth->param_copy = param_copy;
-    ameth->param_cmp = param_cmp;
-    ameth->param_print = param_print;
-}
-
-void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,
-    void (*pkey_free)(EVP_PKEY *pkey))
-{
-    ameth->pkey_free = pkey_free;
-}
-
-void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*pkey_ctrl)(EVP_PKEY *pkey, int op,
-        long arg1, void *arg2))
-{
-    ameth->pkey_ctrl = pkey_ctrl;
-}
-
-void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*pkey_security_bits)(const EVP_PKEY
-            *pk))
-{
-    ameth->pkey_security_bits = pkey_security_bits;
-}
-
-void EVP_PKEY_asn1_set_item(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*item_verify)(EVP_MD_CTX *ctx,
-        const ASN1_ITEM *it,
-        const void *data,
-        const X509_ALGOR *a,
-        const ASN1_BIT_STRING *sig,
-        EVP_PKEY *pkey),
-    int (*item_sign)(EVP_MD_CTX *ctx,
-        const ASN1_ITEM *it,
-        const void *data,
-        X509_ALGOR *alg1,
-        X509_ALGOR *alg2,
-        ASN1_BIT_STRING *sig))
-{
-    ameth->item_sign = item_sign;
-    ameth->item_verify = item_verify;
-}
-
-void EVP_PKEY_asn1_set_siginf(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*siginf_set)(X509_SIG_INFO *siginf,
-        const X509_ALGOR *alg,
-        const ASN1_STRING *sig))
-{
-    ameth->siginf_set = siginf_set;
-}
-
-void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*pkey_check)(const EVP_PKEY *pk))
-{
-    ameth->pkey_check = pkey_check;
-}
-
-void EVP_PKEY_asn1_set_public_check(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*pkey_pub_check)(const EVP_PKEY *pk))
-{
-    ameth->pkey_public_check = pkey_pub_check;
-}
-
-void EVP_PKEY_asn1_set_param_check(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*pkey_param_check)(const EVP_PKEY *pk))
-{
-    ameth->pkey_param_check = pkey_param_check;
-}
-
-void EVP_PKEY_asn1_set_set_priv_key(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*set_priv_key)(EVP_PKEY *pk,
-        const unsigned char
-            *priv,
-        size_t len))
-{
-    ameth->set_priv_key = set_priv_key;
-}
-
-void EVP_PKEY_asn1_set_set_pub_key(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*set_pub_key)(EVP_PKEY *pk,
-        const unsigned char *pub,
-        size_t len))
-{
-    ameth->set_pub_key = set_pub_key;
-}
-
-void EVP_PKEY_asn1_set_get_priv_key(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*get_priv_key)(const EVP_PKEY *pk,
-        unsigned char *priv,
-        size_t *len))
-{
-    ameth->get_priv_key = get_priv_key;
-}
-
-void EVP_PKEY_asn1_set_get_pub_key(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*get_pub_key)(const EVP_PKEY *pk,
-        unsigned char *pub,
-        size_t *len))
-{
-    ameth->get_pub_key = get_pub_key;
-}
diff --git a/deps/openssl/openssl/crypto/asn1/asn1_err.c b/deps/openssl/openssl/crypto/asn1/asn1_err.c
deleted file mode 100644
index 81ac09bba3c..00000000000
--- a/deps/openssl/openssl/crypto/asn1/asn1_err.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/asn1err.h>
-#include "crypto/asn1err.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA ASN1_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ADDING_OBJECT), "adding object" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ASN1_PARSE_ERROR), "asn1 parse error" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ASN1_SIG_PARSE_ERROR),
-        "asn1 sig parse error" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_AUX_ERROR), "aux error" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_BAD_OBJECT_HEADER), "bad object header" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_BAD_TEMPLATE), "bad template" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_BMPSTRING_IS_WRONG_LENGTH),
-        "bmpstring is wrong length" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_BN_LIB), "bn lib" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_BOOLEAN_IS_WRONG_LENGTH),
-        "boolean is wrong length" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_BUFFER_TOO_SMALL), "buffer too small" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER),
-        "cipher has no object identifier" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_CONTEXT_NOT_INITIALISED),
-        "context not initialised" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_DATA_IS_WRONG), "data is wrong" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_DECODE_ERROR), "decode error" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_DEPTH_EXCEEDED), "depth exceeded" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED),
-        "digest and key type not supported" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ENCODE_ERROR), "encode error" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ERROR_GETTING_TIME),
-        "error getting time" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ERROR_LOADING_SECTION),
-        "error loading section" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ERROR_SETTING_CIPHER_PARAMS),
-        "error setting cipher params" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_EXPECTING_AN_INTEGER),
-        "expecting an integer" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_EXPECTING_AN_OBJECT),
-        "expecting an object" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_EXPLICIT_LENGTH_MISMATCH),
-        "explicit length mismatch" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED),
-        "explicit tag not constructed" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_FIELD_MISSING), "field missing" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_FIRST_NUM_TOO_LARGE),
-        "first num too large" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_GENERALIZEDTIME_IS_TOO_SHORT),
-        "generalizedtime is too short" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_HEADER_TOO_LONG), "header too long" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_BITSTRING_FORMAT),
-        "illegal bitstring format" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_BOOLEAN), "illegal boolean" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_CHARACTERS),
-        "illegal characters" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_FORMAT), "illegal format" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_HEX), "illegal hex" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_IMPLICIT_TAG),
-        "illegal implicit tag" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_INTEGER), "illegal integer" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_NEGATIVE_VALUE),
-        "illegal negative value" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_NESTED_TAGGING),
-        "illegal nested tagging" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_NULL), "illegal null" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_NULL_VALUE),
-        "illegal null value" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_OBJECT), "illegal object" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_OPTIONAL_ANY),
-        "illegal optional any" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE),
-        "illegal options on item template" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_PADDING), "illegal padding" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_TAGGED_ANY),
-        "illegal tagged any" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_TIME_VALUE),
-        "illegal time value" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ILLEGAL_ZERO_CONTENT),
-        "illegal zero content" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INTEGER_NOT_ASCII_FORMAT),
-        "integer not ascii format" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG),
-        "integer too large for long" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INVALID_BIT_STRING_BITS_LEFT),
-        "invalid bit string bits left" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INVALID_BMPSTRING_LENGTH),
-        "invalid bmpstring length" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INVALID_DIGIT), "invalid digit" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INVALID_MIME_TYPE), "invalid mime type" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INVALID_MODIFIER), "invalid modifier" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INVALID_NUMBER), "invalid number" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INVALID_OBJECT_ENCODING),
-        "invalid object encoding" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INVALID_SCRYPT_PARAMETERS),
-        "invalid scrypt parameters" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INVALID_SEPARATOR), "invalid separator" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INVALID_STRING_TABLE_VALUE),
-        "invalid string table value" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH),
-        "invalid universalstring length" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INVALID_UTF8STRING),
-        "invalid utf8string" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_INVALID_VALUE), "invalid value" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_LENGTH_TOO_LONG), "length too long" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_LIST_ERROR), "list error" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_MIME_NO_CONTENT_TYPE),
-        "mime no content type" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_MIME_PARSE_ERROR), "mime parse error" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_MIME_SIG_PARSE_ERROR),
-        "mime sig parse error" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_MISSING_EOC), "missing eoc" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_MISSING_SECOND_NUMBER),
-        "missing second number" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_MISSING_VALUE), "missing value" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_MSTRING_NOT_UNIVERSAL),
-        "mstring not universal" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_MSTRING_WRONG_TAG), "mstring wrong tag" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_NESTED_ASN1_STRING),
-        "nested asn1 string" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_NESTED_TOO_DEEP), "nested too deep" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_NON_HEX_CHARACTERS),
-        "non hex characters" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_NOT_ASCII_FORMAT), "not ascii format" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_NOT_ENOUGH_DATA), "not enough data" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_NO_CONTENT_TYPE), "no content type" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_NO_MATCHING_CHOICE_TYPE),
-        "no matching choice type" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_NO_MULTIPART_BODY_FAILURE),
-        "no multipart body failure" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_NO_MULTIPART_BOUNDARY),
-        "no multipart boundary" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_NO_SIG_CONTENT_TYPE),
-        "no sig content type" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_NULL_IS_WRONG_LENGTH),
-        "null is wrong length" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_OBJECT_NOT_ASCII_FORMAT),
-        "object not ascii format" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_ODD_NUMBER_OF_CHARS),
-        "odd number of chars" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_SECOND_NUMBER_TOO_LARGE),
-        "second number too large" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_SEQUENCE_LENGTH_MISMATCH),
-        "sequence length mismatch" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_SEQUENCE_NOT_CONSTRUCTED),
-        "sequence not constructed" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG),
-        "sequence or set needs config" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_SHORT_LINE), "short line" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_SIG_INVALID_MIME_TYPE),
-        "sig invalid mime type" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_STREAMING_NOT_SUPPORTED),
-        "streaming not supported" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_STRING_TOO_LONG), "string too long" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_STRING_TOO_SHORT), "string too short" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD),
-        "the asn1 object identifier is not known for this md" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_TIME_NOT_ASCII_FORMAT),
-        "time not ascii format" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_TOO_LARGE), "too large" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_TOO_LONG), "too long" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_TOO_SMALL), "too small" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_TYPE_NOT_CONSTRUCTED),
-        "type not constructed" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_TYPE_NOT_PRIMITIVE),
-        "type not primitive" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_UNEXPECTED_EOC), "unexpected eoc" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH),
-        "universalstring is wrong length" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_UNKNOWN_DIGEST), "unknown digest" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_UNKNOWN_FORMAT), "unknown format" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM),
-        "unknown message digest algorithm" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_UNKNOWN_OBJECT_TYPE),
-        "unknown object type" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE),
-        "unknown public key type" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM),
-        "unknown signature algorithm" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_UNKNOWN_TAG), "unknown tag" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE),
-        "unsupported any defined by type" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_UNSUPPORTED_CIPHER),
-        "unsupported cipher" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE),
-        "unsupported public key type" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_UNSUPPORTED_TYPE), "unsupported type" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_UTCTIME_IS_TOO_SHORT),
-        "utctime is too short" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_WRONG_INTEGER_TYPE),
-        "wrong integer type" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_WRONG_PUBLIC_KEY_TYPE),
-        "wrong public key type" },
-    { ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_WRONG_TAG), "wrong tag" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_ASN1_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(ASN1_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(ASN1_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/asn1/asn1_gen.c b/deps/openssl/openssl/crypto/asn1/asn1_gen.c
index 69fbd6f89e5..351bdafe7fb 100644
--- a/deps/openssl/openssl/crypto/asn1/asn1_gen.c
+++ b/deps/openssl/openssl/crypto/asn1/asn1_gen.c
@@ -163,7 +163,7 @@ static ASN1_TYPE *generate_v3(const char *str, X509V3_CTX *cnf, int depth,
         if (r & 0x80)
             goto err;
         /* Update copy length */
-        cpy_len -= cpy_start - orig_der;
+        cpy_len -= (int)(cpy_start - orig_der);
         /*
          * For IMPLICIT tagging the length should match the original length
          * and constructed flag should be consistent.
@@ -263,8 +263,8 @@ static int asn1_cb(const char *elem, int len, void *bitstr)
         /* Look for the ':' in name value pairs */
         if (*p == ':') {
             vstart = p + 1;
-            vlen = len - (vstart - elem);
-            len = p - elem;
+            vlen = len - (int)(vstart - elem);
+            len = (int)(p - elem);
             break;
         }
     }
@@ -368,7 +368,7 @@ static int parse_tagging(const char *vstart, int vlen, int *ptag, int *pclass)
     *ptag = tag_num;
     /* If we have non numeric characters, parse them */
     if (eptr)
-        vlen -= eptr - vstart;
+        vlen -= (int)(eptr - vstart);
     else
         vlen = 0;
     if (vlen) {
@@ -447,8 +447,11 @@ static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf,
         goto bad;
     if ((ret = ASN1_TYPE_new()) == NULL)
         goto bad;
-    if ((ret->value.asn1_string = ASN1_STRING_type_new(utype)) == NULL)
+    if ((ret->value.asn1_string = ASN1_STRING_type_new(utype)) == NULL) {
+        ASN1_TYPE_free(ret);
+        ret = NULL;
         goto bad;
+    }

     ret->type = utype;
     ret->value.asn1_string->data = der;
@@ -568,7 +571,7 @@ static int asn1_str2tag(const char *tagstr, int len)
     };

     if (len == -1)
-        len = strlen(tagstr);
+        len = (int)strlen(tagstr);

     tntmp = tnst;
     for (i = 0; i < OSSL_NELEM(tnst); i++, tntmp++) {
@@ -654,7 +657,7 @@ static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype)
             ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
             goto bad_str;
         }
-        if (!ASN1_STRING_set(atmp->value.asn1_string, str, -1)) {
+        if (!ossl_asn1_string_set1_string(atmp->value.asn1_string, str)) {
             ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
             goto bad_str;
         }
@@ -709,7 +712,7 @@ static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype)
             atmp->value.asn1_string->length = rdlen;
             atmp->value.asn1_string->type = utype;
         } else if (format == ASN1_GEN_FORMAT_ASCII) {
-            if (!ASN1_STRING_set(atmp->value.asn1_string, str, -1)) {
+            if (!ossl_asn1_string_set1_string(atmp->value.asn1_string, str)) {
                 ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
                 goto bad_str;
             }
@@ -727,7 +730,7 @@ static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype)
         }

         if ((utype == V_ASN1_BIT_STRING) && no_unused)
-            ossl_asn1_string_set_bits_left(atmp->value.asn1_string, 0);
+            ossl_asn1_bit_string_set_unused_bits(atmp->value.asn1_string, 0);

         break;

diff --git a/deps/openssl/openssl/crypto/asn1/asn1_item_list.c b/deps/openssl/openssl/crypto/asn1/asn1_item_list.c
index 2b57694e336..0eaf5fa1284 100644
--- a/deps/openssl/openssl/crypto/asn1/asn1_item_list.c
+++ b/deps/openssl/openssl/crypto/asn1/asn1_item_list.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -23,7 +23,180 @@
 #include <openssl/x509v3.h>
 #include <openssl/x509_acert.h>

-#include "asn1_item_list.h"
+static ASN1_ITEM_EXP *asn1_item_list[] = {
+
+    ASN1_ITEM_ref(ACCESS_DESCRIPTION),
+#ifndef OPENSSL_NO_RFC3779
+    ASN1_ITEM_ref(ASIdOrRange),
+    ASN1_ITEM_ref(ASIdentifierChoice),
+    ASN1_ITEM_ref(ASIdentifiers),
+#endif
+    ASN1_ITEM_ref(ASN1_ANY),
+    ASN1_ITEM_ref(ASN1_BIT_STRING),
+    ASN1_ITEM_ref(ASN1_BMPSTRING),
+    ASN1_ITEM_ref(ASN1_BOOLEAN),
+    ASN1_ITEM_ref(ASN1_ENUMERATED),
+    ASN1_ITEM_ref(ASN1_FBOOLEAN),
+    ASN1_ITEM_ref(ASN1_GENERALIZEDTIME),
+    ASN1_ITEM_ref(ASN1_GENERALSTRING),
+    ASN1_ITEM_ref(ASN1_IA5STRING),
+    ASN1_ITEM_ref(ASN1_INTEGER),
+    ASN1_ITEM_ref(ASN1_NULL),
+    ASN1_ITEM_ref(ASN1_OBJECT),
+    ASN1_ITEM_ref(ASN1_OCTET_STRING_NDEF),
+    ASN1_ITEM_ref(ASN1_OCTET_STRING),
+    ASN1_ITEM_ref(ASN1_PRINTABLESTRING),
+    ASN1_ITEM_ref(ASN1_PRINTABLE),
+    ASN1_ITEM_ref(ASN1_SEQUENCE_ANY),
+    ASN1_ITEM_ref(ASN1_SEQUENCE),
+    ASN1_ITEM_ref(ASN1_SET_ANY),
+    ASN1_ITEM_ref(ASN1_T61STRING),
+    ASN1_ITEM_ref(ASN1_TBOOLEAN),
+    ASN1_ITEM_ref(ASN1_TIME),
+    ASN1_ITEM_ref(ASN1_UNIVERSALSTRING),
+    ASN1_ITEM_ref(ASN1_UTCTIME),
+    ASN1_ITEM_ref(ASN1_UTF8STRING),
+    ASN1_ITEM_ref(ASN1_VISIBLESTRING),
+#ifndef OPENSSL_NO_RFC3779
+    ASN1_ITEM_ref(ASRange),
+#endif
+    ASN1_ITEM_ref(AUTHORITY_INFO_ACCESS),
+    ASN1_ITEM_ref(AUTHORITY_KEYID),
+    ASN1_ITEM_ref(BASIC_CONSTRAINTS),
+    ASN1_ITEM_ref(BIGNUM),
+    ASN1_ITEM_ref(CBIGNUM),
+    ASN1_ITEM_ref(CERTIFICATEPOLICIES),
+#ifndef OPENSSL_NO_CMS
+    ASN1_ITEM_ref(CMS_ContentInfo),
+    ASN1_ITEM_ref(CMS_EnvelopedData),
+    ASN1_ITEM_ref(CMS_ReceiptRequest),
+#endif
+    ASN1_ITEM_ref(CRL_DIST_POINTS),
+#ifndef OPENSSL_NO_DH
+    ASN1_ITEM_ref(DHparams),
+#endif
+    ASN1_ITEM_ref(DIRECTORYSTRING),
+    ASN1_ITEM_ref(DISPLAYTEXT),
+    ASN1_ITEM_ref(DIST_POINT_NAME),
+    ASN1_ITEM_ref(DIST_POINT),
+#ifndef OPENSSL_NO_EC
+#ifndef OPENSSL_NO_DEPRECATED_3_0
+    ASN1_ITEM_ref(ECPARAMETERS),
+    ASN1_ITEM_ref(ECPKPARAMETERS),
+#endif
+#endif
+    ASN1_ITEM_ref(EDIPARTYNAME),
+    ASN1_ITEM_ref(EXTENDED_KEY_USAGE),
+    ASN1_ITEM_ref(GENERAL_NAMES),
+    ASN1_ITEM_ref(GENERAL_NAME),
+    ASN1_ITEM_ref(GENERAL_SUBTREE),
+#ifndef OPENSSL_NO_RFC3779
+    ASN1_ITEM_ref(IPAddressChoice),
+    ASN1_ITEM_ref(IPAddressFamily),
+    ASN1_ITEM_ref(IPAddressOrRange),
+    ASN1_ITEM_ref(IPAddressRange),
+#endif
+    ASN1_ITEM_ref(ISSUING_DIST_POINT),
+#ifndef OPENSSL_NO_DEPRECATED_3_0
+    ASN1_ITEM_ref(LONG),
+#endif
+    ASN1_ITEM_ref(NAME_CONSTRAINTS),
+    ASN1_ITEM_ref(NETSCAPE_CERT_SEQUENCE),
+    ASN1_ITEM_ref(NETSCAPE_SPKAC),
+    ASN1_ITEM_ref(NETSCAPE_SPKI),
+    ASN1_ITEM_ref(NOTICEREF),
+#ifndef OPENSSL_NO_OCSP
+    ASN1_ITEM_ref(OCSP_BASICRESP),
+    ASN1_ITEM_ref(OCSP_CERTID),
+    ASN1_ITEM_ref(OCSP_CERTSTATUS),
+    ASN1_ITEM_ref(OCSP_CRLID),
+    ASN1_ITEM_ref(OCSP_ONEREQ),
+    ASN1_ITEM_ref(OCSP_REQINFO),
+    ASN1_ITEM_ref(OCSP_REQUEST),
+    ASN1_ITEM_ref(OCSP_RESPBYTES),
+    ASN1_ITEM_ref(OCSP_RESPDATA),
+    ASN1_ITEM_ref(OCSP_RESPID),
+    ASN1_ITEM_ref(OCSP_RESPONSE),
+    ASN1_ITEM_ref(OCSP_REVOKEDINFO),
+    ASN1_ITEM_ref(OCSP_SERVICELOC),
+    ASN1_ITEM_ref(OCSP_SIGNATURE),
+    ASN1_ITEM_ref(OCSP_SINGLERESP),
+#endif
+    ASN1_ITEM_ref(OTHERNAME),
+    ASN1_ITEM_ref(PBE2PARAM),
+    ASN1_ITEM_ref(PBEPARAM),
+    ASN1_ITEM_ref(PBKDF2PARAM),
+    ASN1_ITEM_ref(PKCS12_AUTHSAFES),
+    ASN1_ITEM_ref(PKCS12_BAGS),
+    ASN1_ITEM_ref(PKCS12_MAC_DATA),
+    ASN1_ITEM_ref(PKCS12_SAFEBAGS),
+    ASN1_ITEM_ref(PKCS12_SAFEBAG),
+    ASN1_ITEM_ref(PKCS12),
+    ASN1_ITEM_ref(PKCS7_ATTR_SIGN),
+    ASN1_ITEM_ref(PKCS7_ATTR_VERIFY),
+    ASN1_ITEM_ref(PKCS7_DIGEST),
+    ASN1_ITEM_ref(PKCS7_ENCRYPT),
+    ASN1_ITEM_ref(PKCS7_ENC_CONTENT),
+    ASN1_ITEM_ref(PKCS7_ENVELOPE),
+    ASN1_ITEM_ref(PKCS7_ISSUER_AND_SERIAL),
+    ASN1_ITEM_ref(PKCS7_RECIP_INFO),
+    ASN1_ITEM_ref(PKCS7_SIGNED),
+    ASN1_ITEM_ref(PKCS7_SIGNER_INFO),
+    ASN1_ITEM_ref(PKCS7_SIGN_ENVELOPE),
+    ASN1_ITEM_ref(PKCS7),
+    ASN1_ITEM_ref(PKCS8_PRIV_KEY_INFO),
+    ASN1_ITEM_ref(PKEY_USAGE_PERIOD),
+    ASN1_ITEM_ref(POLICYINFO),
+    ASN1_ITEM_ref(POLICYQUALINFO),
+    ASN1_ITEM_ref(POLICY_CONSTRAINTS),
+    ASN1_ITEM_ref(POLICY_MAPPINGS),
+    ASN1_ITEM_ref(POLICY_MAPPING),
+    ASN1_ITEM_ref(PROXY_CERT_INFO_EXTENSION),
+    ASN1_ITEM_ref(PROXY_POLICY),
+#ifndef OPENSSL_NO_DEPRECATED_3_0
+    ASN1_ITEM_ref(RSAPrivateKey),
+    ASN1_ITEM_ref(RSAPublicKey),
+    ASN1_ITEM_ref(RSA_OAEP_PARAMS),
+    ASN1_ITEM_ref(RSA_PSS_PARAMS),
+#endif
+#ifndef OPENSSL_NO_SCRYPT
+    ASN1_ITEM_ref(SCRYPT_PARAMS),
+#endif
+    ASN1_ITEM_ref(SXNETID),
+    ASN1_ITEM_ref(SXNET),
+    ASN1_ITEM_ref(ISSUER_SIGN_TOOL),
+    ASN1_ITEM_ref(USERNOTICE),
+    ASN1_ITEM_ref(X509_ACERT),
+    ASN1_ITEM_ref(X509_ALGORS),
+    ASN1_ITEM_ref(X509_ALGOR),
+    ASN1_ITEM_ref(X509_ATTRIBUTE),
+    ASN1_ITEM_ref(X509_CERT_AUX),
+    ASN1_ITEM_ref(X509_CINF),
+    ASN1_ITEM_ref(X509_CRL_INFO),
+    ASN1_ITEM_ref(X509_CRL),
+    ASN1_ITEM_ref(X509_EXTENSIONS),
+    ASN1_ITEM_ref(X509_EXTENSION),
+    ASN1_ITEM_ref(X509_NAME_ENTRY),
+    ASN1_ITEM_ref(X509_NAME),
+    ASN1_ITEM_ref(X509_PUBKEY),
+    ASN1_ITEM_ref(X509_REQ_INFO),
+    ASN1_ITEM_ref(X509_REQ),
+    ASN1_ITEM_ref(X509_REVOKED),
+    ASN1_ITEM_ref(X509_SIG),
+    ASN1_ITEM_ref(X509_VAL),
+    ASN1_ITEM_ref(X509),
+#ifndef OPENSSL_NO_DEPRECATED_3_0
+    ASN1_ITEM_ref(ZLONG),
+#endif
+    ASN1_ITEM_ref(INT32),
+    ASN1_ITEM_ref(UINT32),
+    ASN1_ITEM_ref(ZINT32),
+    ASN1_ITEM_ref(ZUINT32),
+    ASN1_ITEM_ref(INT64),
+    ASN1_ITEM_ref(UINT64),
+    ASN1_ITEM_ref(ZINT64),
+    ASN1_ITEM_ref(ZUINT64),
+};

 const ASN1_ITEM *ASN1_ITEM_lookup(const char *name)
 {
diff --git a/deps/openssl/openssl/crypto/asn1/asn1_item_list.h b/deps/openssl/openssl/crypto/asn1/asn1_item_list.h
deleted file mode 100644
index f26954ecb71..00000000000
--- a/deps/openssl/openssl/crypto/asn1/asn1_item_list.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright 2000-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-static ASN1_ITEM_EXP *asn1_item_list[] = {
-
-    ASN1_ITEM_ref(ACCESS_DESCRIPTION),
-#ifndef OPENSSL_NO_RFC3779
-    ASN1_ITEM_ref(ASIdOrRange),
-    ASN1_ITEM_ref(ASIdentifierChoice),
-    ASN1_ITEM_ref(ASIdentifiers),
-#endif
-    ASN1_ITEM_ref(ASN1_ANY),
-    ASN1_ITEM_ref(ASN1_BIT_STRING),
-    ASN1_ITEM_ref(ASN1_BMPSTRING),
-    ASN1_ITEM_ref(ASN1_BOOLEAN),
-    ASN1_ITEM_ref(ASN1_ENUMERATED),
-    ASN1_ITEM_ref(ASN1_FBOOLEAN),
-    ASN1_ITEM_ref(ASN1_GENERALIZEDTIME),
-    ASN1_ITEM_ref(ASN1_GENERALSTRING),
-    ASN1_ITEM_ref(ASN1_IA5STRING),
-    ASN1_ITEM_ref(ASN1_INTEGER),
-    ASN1_ITEM_ref(ASN1_NULL),
-    ASN1_ITEM_ref(ASN1_OBJECT),
-    ASN1_ITEM_ref(ASN1_OCTET_STRING_NDEF),
-    ASN1_ITEM_ref(ASN1_OCTET_STRING),
-    ASN1_ITEM_ref(ASN1_PRINTABLESTRING),
-    ASN1_ITEM_ref(ASN1_PRINTABLE),
-    ASN1_ITEM_ref(ASN1_SEQUENCE_ANY),
-    ASN1_ITEM_ref(ASN1_SEQUENCE),
-    ASN1_ITEM_ref(ASN1_SET_ANY),
-    ASN1_ITEM_ref(ASN1_T61STRING),
-    ASN1_ITEM_ref(ASN1_TBOOLEAN),
-    ASN1_ITEM_ref(ASN1_TIME),
-    ASN1_ITEM_ref(ASN1_UNIVERSALSTRING),
-    ASN1_ITEM_ref(ASN1_UTCTIME),
-    ASN1_ITEM_ref(ASN1_UTF8STRING),
-    ASN1_ITEM_ref(ASN1_VISIBLESTRING),
-#ifndef OPENSSL_NO_RFC3779
-    ASN1_ITEM_ref(ASRange),
-#endif
-    ASN1_ITEM_ref(AUTHORITY_INFO_ACCESS),
-    ASN1_ITEM_ref(AUTHORITY_KEYID),
-    ASN1_ITEM_ref(BASIC_CONSTRAINTS),
-    ASN1_ITEM_ref(BIGNUM),
-    ASN1_ITEM_ref(CBIGNUM),
-    ASN1_ITEM_ref(CERTIFICATEPOLICIES),
-#ifndef OPENSSL_NO_CMS
-    ASN1_ITEM_ref(CMS_ContentInfo),
-    ASN1_ITEM_ref(CMS_EnvelopedData),
-    ASN1_ITEM_ref(CMS_ReceiptRequest),
-#endif
-    ASN1_ITEM_ref(CRL_DIST_POINTS),
-#ifndef OPENSSL_NO_DH
-    ASN1_ITEM_ref(DHparams),
-#endif
-    ASN1_ITEM_ref(DIRECTORYSTRING),
-    ASN1_ITEM_ref(DISPLAYTEXT),
-    ASN1_ITEM_ref(DIST_POINT_NAME),
-    ASN1_ITEM_ref(DIST_POINT),
-#ifndef OPENSSL_NO_EC
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-    ASN1_ITEM_ref(ECPARAMETERS),
-    ASN1_ITEM_ref(ECPKPARAMETERS),
-#endif
-#endif
-    ASN1_ITEM_ref(EDIPARTYNAME),
-    ASN1_ITEM_ref(EXTENDED_KEY_USAGE),
-    ASN1_ITEM_ref(GENERAL_NAMES),
-    ASN1_ITEM_ref(GENERAL_NAME),
-    ASN1_ITEM_ref(GENERAL_SUBTREE),
-#ifndef OPENSSL_NO_RFC3779
-    ASN1_ITEM_ref(IPAddressChoice),
-    ASN1_ITEM_ref(IPAddressFamily),
-    ASN1_ITEM_ref(IPAddressOrRange),
-    ASN1_ITEM_ref(IPAddressRange),
-#endif
-    ASN1_ITEM_ref(ISSUING_DIST_POINT),
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-    ASN1_ITEM_ref(LONG),
-#endif
-    ASN1_ITEM_ref(NAME_CONSTRAINTS),
-    ASN1_ITEM_ref(NETSCAPE_CERT_SEQUENCE),
-    ASN1_ITEM_ref(NETSCAPE_SPKAC),
-    ASN1_ITEM_ref(NETSCAPE_SPKI),
-    ASN1_ITEM_ref(NOTICEREF),
-#ifndef OPENSSL_NO_OCSP
-    ASN1_ITEM_ref(OCSP_BASICRESP),
-    ASN1_ITEM_ref(OCSP_CERTID),
-    ASN1_ITEM_ref(OCSP_CERTSTATUS),
-    ASN1_ITEM_ref(OCSP_CRLID),
-    ASN1_ITEM_ref(OCSP_ONEREQ),
-    ASN1_ITEM_ref(OCSP_REQINFO),
-    ASN1_ITEM_ref(OCSP_REQUEST),
-    ASN1_ITEM_ref(OCSP_RESPBYTES),
-    ASN1_ITEM_ref(OCSP_RESPDATA),
-    ASN1_ITEM_ref(OCSP_RESPID),
-    ASN1_ITEM_ref(OCSP_RESPONSE),
-    ASN1_ITEM_ref(OCSP_REVOKEDINFO),
-    ASN1_ITEM_ref(OCSP_SERVICELOC),
-    ASN1_ITEM_ref(OCSP_SIGNATURE),
-    ASN1_ITEM_ref(OCSP_SINGLERESP),
-#endif
-    ASN1_ITEM_ref(OTHERNAME),
-    ASN1_ITEM_ref(PBE2PARAM),
-    ASN1_ITEM_ref(PBEPARAM),
-    ASN1_ITEM_ref(PBKDF2PARAM),
-    ASN1_ITEM_ref(PKCS12_AUTHSAFES),
-    ASN1_ITEM_ref(PKCS12_BAGS),
-    ASN1_ITEM_ref(PKCS12_MAC_DATA),
-    ASN1_ITEM_ref(PKCS12_SAFEBAGS),
-    ASN1_ITEM_ref(PKCS12_SAFEBAG),
-    ASN1_ITEM_ref(PKCS12),
-    ASN1_ITEM_ref(PKCS7_ATTR_SIGN),
-    ASN1_ITEM_ref(PKCS7_ATTR_VERIFY),
-    ASN1_ITEM_ref(PKCS7_DIGEST),
-    ASN1_ITEM_ref(PKCS7_ENCRYPT),
-    ASN1_ITEM_ref(PKCS7_ENC_CONTENT),
-    ASN1_ITEM_ref(PKCS7_ENVELOPE),
-    ASN1_ITEM_ref(PKCS7_ISSUER_AND_SERIAL),
-    ASN1_ITEM_ref(PKCS7_RECIP_INFO),
-    ASN1_ITEM_ref(PKCS7_SIGNED),
-    ASN1_ITEM_ref(PKCS7_SIGNER_INFO),
-    ASN1_ITEM_ref(PKCS7_SIGN_ENVELOPE),
-    ASN1_ITEM_ref(PKCS7),
-    ASN1_ITEM_ref(PKCS8_PRIV_KEY_INFO),
-    ASN1_ITEM_ref(PKEY_USAGE_PERIOD),
-    ASN1_ITEM_ref(POLICYINFO),
-    ASN1_ITEM_ref(POLICYQUALINFO),
-    ASN1_ITEM_ref(POLICY_CONSTRAINTS),
-    ASN1_ITEM_ref(POLICY_MAPPINGS),
-    ASN1_ITEM_ref(POLICY_MAPPING),
-    ASN1_ITEM_ref(PROXY_CERT_INFO_EXTENSION),
-    ASN1_ITEM_ref(PROXY_POLICY),
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-    ASN1_ITEM_ref(RSAPrivateKey),
-    ASN1_ITEM_ref(RSAPublicKey),
-    ASN1_ITEM_ref(RSA_OAEP_PARAMS),
-    ASN1_ITEM_ref(RSA_PSS_PARAMS),
-#endif
-#ifndef OPENSSL_NO_SCRYPT
-    ASN1_ITEM_ref(SCRYPT_PARAMS),
-#endif
-    ASN1_ITEM_ref(SXNETID),
-    ASN1_ITEM_ref(SXNET),
-    ASN1_ITEM_ref(ISSUER_SIGN_TOOL),
-    ASN1_ITEM_ref(USERNOTICE),
-    ASN1_ITEM_ref(X509_ACERT),
-    ASN1_ITEM_ref(X509_ALGORS),
-    ASN1_ITEM_ref(X509_ALGOR),
-    ASN1_ITEM_ref(X509_ATTRIBUTE),
-    ASN1_ITEM_ref(X509_CERT_AUX),
-    ASN1_ITEM_ref(X509_CINF),
-    ASN1_ITEM_ref(X509_CRL_INFO),
-    ASN1_ITEM_ref(X509_CRL),
-    ASN1_ITEM_ref(X509_EXTENSIONS),
-    ASN1_ITEM_ref(X509_EXTENSION),
-    ASN1_ITEM_ref(X509_NAME_ENTRY),
-    ASN1_ITEM_ref(X509_NAME),
-    ASN1_ITEM_ref(X509_PUBKEY),
-    ASN1_ITEM_ref(X509_REQ_INFO),
-    ASN1_ITEM_ref(X509_REQ),
-    ASN1_ITEM_ref(X509_REVOKED),
-    ASN1_ITEM_ref(X509_SIG),
-    ASN1_ITEM_ref(X509_VAL),
-    ASN1_ITEM_ref(X509),
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-    ASN1_ITEM_ref(ZLONG),
-#endif
-    ASN1_ITEM_ref(INT32),
-    ASN1_ITEM_ref(UINT32),
-    ASN1_ITEM_ref(ZINT32),
-    ASN1_ITEM_ref(ZUINT32),
-    ASN1_ITEM_ref(INT64),
-    ASN1_ITEM_ref(UINT64),
-    ASN1_ITEM_ref(ZINT64),
-    ASN1_ITEM_ref(ZUINT64),
-};
diff --git a/deps/openssl/openssl/crypto/asn1/asn1_lib.c b/deps/openssl/openssl/crypto/asn1/asn1_lib.c
index 39a6d63f4c9..a216525f8df 100644
--- a/deps/openssl/openssl/crypto/asn1/asn1_lib.c
+++ b/deps/openssl/openssl/crypto/asn1/asn1_lib.c
@@ -13,6 +13,32 @@
 #include <openssl/asn1.h>
 #include "asn1_local.h"

+#if defined(__has_feature)
+#if __has_feature(address_sanitizer)
+#define ASN1_HAVE_ASAN 1
+#endif
+#if __has_feature(memory_sanitizer)
+#define ASN1_HAVE_MSAN 1
+#endif
+#endif /* defined(__has_feature) */
+#if defined(__SANITIZE_ADDRESS__) && !defined(ASN1_HAVE_ASAN)
+#define ASN1_HAVE_ASAN 1
+#endif
+#if defined(ASN1_HAVE_ASAN)
+#include <sanitizer/asan_interface.h>
+#endif
+#if defined(ASN1_HAVE_MSAN)
+#include <sanitizer/msan_interface.h>
+#endif
+#if !defined OPENSSL_NO_VALGRIND_CHECK && defined __has_include
+/* Any compiler you're going to run valgrind on has this */
+#if __has_include(<valgrind/memcheck.h>)
+#include <valgrind/memcheck.h>
+#include "internal/thread_once.h"
+#define ASN1_HAVE_VALGRIND 1
+#endif
+#endif /* defined(__has_include) */
+
 static int asn1_get_length(const unsigned char **pp, int *inf, long *rl,
     long max);
 static void asn1_put_length(unsigned char **pp, int length);
@@ -248,18 +274,25 @@ int ASN1_object_size(int constructed, int length, int tag)
     return ret + length;
 }

-void ossl_asn1_string_set_bits_left(ASN1_STRING *str, unsigned int num)
+void ossl_asn1_bit_string_clear_unused_bits(ASN1_STRING *str)
 {
     str->flags &= ~0x07;
+    str->flags &= ~ASN1_STRING_FLAG_BITS_LEFT;
+}
+
+void ossl_asn1_bit_string_set_unused_bits(ASN1_STRING *str, unsigned int num)
+{
+    ossl_asn1_bit_string_clear_unused_bits(str);
     str->flags |= ASN1_STRING_FLAG_BITS_LEFT | (num & 0x07);
 }

 int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str)
 {
-    if (str == NULL)
+    if (str == NULL || str->length < 0)
         return 0;
     dst->type = str->type;
-    if (!ASN1_STRING_set(dst, str->data, str->length))
+    if (!ossl_asn1_string_set_internal(dst, str->data, str->length,
+            /*add_nul_byte=*/1))
         return 0;
     /* Copy flags but preserve embed value */
     dst->flags &= ASN1_STRING_FLAG_EMBED;
@@ -283,64 +316,210 @@ ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *str)
     return ret;
 }

-int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len_in)
+#if defined(ASN1_HAVE_VALGRIND)
+static CRYPTO_ONCE valgrind_once = CRYPTO_ONCE_STATIC_INIT;
+static int valgrind_present = 0;
+
+DEFINE_RUN_ONCE_STATIC(detect_valgrind)
+{
+    valgrind_present = RUNNING_ON_VALGRIND != 0;
+    return 1;
+}
+
+static int under_valgrind(void)
 {
-    unsigned char *c;
-    const char *data = _data;
-    size_t len;
+    return RUN_ONCE(&valgrind_once, detect_valgrind) && valgrind_present;
+}
+#endif /* defined(ASN1_HAVE_VALGRIND) */
+
+/**
+ * @brief Mark the NUL terminator at p as inaccessible to memory checkers.
+ * Under AddressSanitizer, MemorySanitizer and Valgrind memcheck a read of
+ * the byte is reported as an error, so C-string use of ASN1_STRING data is
+ * caught while the byte stays present for builds without a checker. The
+ * Valgrind client requests are compiled in wherever its header is found and
+ * are issued only when the process is running under Valgrind.
+ * A poisoned byte needs no unpoisoning before free(): every checker marks
+ * the whole block on free without regard to its previous state.
+ * @param p the terminator byte
+ */
+static void poison_terminator(uint8_t *p)
+{
+#if defined(ASN1_HAVE_ASAN)
+    ASAN_POISON_MEMORY_REGION(p, 1);
+#endif
+#if defined(ASN1_HAVE_MSAN)
+    __msan_poison(p, 1);
+#endif
+#if defined(ASN1_HAVE_VALGRIND)
+    if (under_valgrind())
+        VALGRIND_MAKE_MEM_NOACCESS(p, 1);
+#endif
+}
+
+/**
+ * @brief Make the byte at p accessible again before it is written.
+ * @param p the byte about to hold a NUL terminator
+ */
+static void unpoison_terminator(uint8_t *p)
+{
+#if defined(ASN1_HAVE_ASAN)
+    ASAN_UNPOISON_MEMORY_REGION(p, 1);
+#endif
+#if defined(ASN1_HAVE_MSAN)
+    __msan_unpoison(p, 1);
+#endif
+#if defined(ASN1_HAVE_VALGRIND)
+    if (under_valgrind())
+        VALGRIND_MAKE_MEM_UNDEFINED(p, 1);
+#endif
+}

-    if (len_in < 0) {
+static void unpoison_buffer(uint8_t *buf, size_t buf_len)
+{
+#if defined(ASN1_HAVE_VALGRIND)
+    if (under_valgrind())
+        VALGRIND_MAKE_MEM_UNDEFINED(buf, buf_len);
+#endif
+}
+
+int ossl_asn1_string_set_internal(ASN1_STRING *str, const uint8_t *data,
+    int len_in, int add_nul_byte)
+{
+    size_t len, alloc_len;
+
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+    /*
+     * Force no NUL byte for callers that are requesting it
+     * 0 length object data will be NULL
+     */
+    add_nul_byte = 0;
+#endif
+    if (len_in < -1) {
+        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
+        return 0;
+    }
+    if (len_in == -1) {
         if (data == NULL)
             return 0;
-        len = strlen(data);
+        len = strlen((const char *)data);
     } else {
         len = (size_t)len_in;
     }
     /*
-     * Verify that the length fits within an integer for assignment to
-     * str->length below.  The additional 1 is subtracted to allow for the
-     * '\0' terminator even though this isn't strictly necessary.
+     * Add one to the length to allow for adding an a '\0' terminator
+     * "even though this isn't strictly necessary".
      */
-    if (len > INT_MAX - 1) {
+    alloc_len = add_nul_byte ? len + 1 : len;
+
+    if (alloc_len > INT_MAX) {
         ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
         return 0;
     }
-    if ((size_t)str->length <= len || str->data == NULL) {
-        c = str->data;
-#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
-        /* No NUL terminator in fuzzing builds */
-        str->data = OPENSSL_realloc(c, len != 0 ? len : 1);
-#else
-        str->data = OPENSSL_realloc(c, len + 1);
-#endif
-        if (str->data == NULL) {
-            str->data = c;
+
+    if ((str->flags & ASN1_STRING_FLAG_DATA_NOT_OWNED)) {
+        str->data = NULL;
+        str->length = 0;
+        str->flags &= ~ASN1_STRING_FLAG_DATA_NOT_OWNED;
+    }
+
+    /* Ensure copying a 0 length data field is defined. */
+    if (alloc_len == 0) {
+        OPENSSL_free(str->data);
+        str->data = NULL;
+        str->length = 0;
+        return 1;
+    }
+
+    if ((size_t)str->length != alloc_len) {
+        uint8_t *c;
+        c = OPENSSL_realloc(str->length == 0 ? NULL : str->data, alloc_len);
+        if (c == NULL)
             return 0;
-        }
+        str->data = c;
+        unpoison_buffer(str->data, alloc_len);
     }
-    str->length = len;
-    if (data != NULL) {
+    /* length never includes the added \0 byte */
+    str->length = (int)len;
+
+    if (data != NULL && str->data != NULL)
         memcpy(str->data, data, len);
-#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
-        /* Set the unused byte to something non NUL and printable. */
-        if (len == 0)
-            str->data[len] = '~';
-#else
+    if (add_nul_byte) {
         /*
-         * Add a NUL terminator. This should not be necessary - but we add it as
-         * a safety precaution
+         * The terminator byte lies beyond str->length. It is written only
+         * when data is supplied, and is inaccessible to memory checkers
+         * either way; see poison_terminator().
          */
-        str->data[len] = '\0';
-#endif
+        unpoison_terminator(&str->data[len]);
+        if (data != NULL)
+            str->data[len] = '\0';
+        poison_terminator(&str->data[len]);
     }
+    ossl_asn1_bit_string_clear_unused_bits(str);
+
     return 1;
 }

+#ifndef OPENSSL_NO_DEPRECATED_4_1
+int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len_in)
+{
+    return ossl_asn1_string_set_internal(str, (const uint8_t *)_data, len_in,
+        /*add_nul_byte=*/1);
+}
+#endif
+
 void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len)
 {
-    OPENSSL_free(str->data);
+    if (!(str->flags & ASN1_STRING_FLAG_DATA_NOT_OWNED)) {
+        if (str->length > 0)
+            OPENSSL_clear_free(str->data, str->length);
+        else
+            OPENSSL_free(str->data);
+    }
+    str->flags &= ~ASN1_STRING_FLAG_DATA_NOT_OWNED;
     str->data = data;
-    str->length = len;
+    str->length = len < 0 ? 0 : len;
+}
+
+int ASN1_STRING_set1_data(ASN1_STRING *str, const uint8_t *data, size_t len_in)
+{
+    if (str->type == V_ASN1_BIT_STRING) {
+        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT);
+        return 0;
+    }
+    /* This will go away once ASN1_STRING can size_t internally */
+    if (len_in > INT_MAX) {
+        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
+        return 0;
+    }
+    return ossl_asn1_string_set_internal(str, data, (int)len_in, /*add_nul_byte=*/0);
+}
+
+int ASN1_STRING_set1_string(ASN1_STRING *str, const char *c_string)
+{
+    return ASN1_STRING_set1_data(str, (const uint8_t *)c_string,
+        strlen(c_string));
+}
+
+int ossl_asn1_string_set1_data(ASN1_STRING *str, const uint8_t *data,
+    size_t len_in)
+{
+    if (str->type == V_ASN1_BIT_STRING) {
+        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT);
+        return 0;
+    }
+    /* This will go away once ASN1_STRING can size_t internally */
+    if (len_in > INT_MAX) {
+        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
+        return 0;
+    }
+    return ossl_asn1_string_set_internal(str, data, (int)len_in, /*add_nul_byte=*/1);
+}
+
+int ossl_asn1_string_set1_string(ASN1_STRING *str, const char *c_string)
+{
+    return ossl_asn1_string_set1_data(str, (const uint8_t *)c_string,
+        strlen(c_string));
 }

 ASN1_STRING *ASN1_STRING_new(void)
@@ -359,30 +538,75 @@ ASN1_STRING *ASN1_STRING_type_new(int type)
     return ret;
 }

-void ossl_asn1_string_embed_free(ASN1_STRING *a, int embed)
+ASN1_STRING *ASN1_STRING_new_not_owned(int type, const uint8_t *data,
+    size_t length)
+{
+    ASN1_STRING *ret;
+
+    if (type == V_ASN1_BIT_STRING)
+        return NULL;
+
+    if (data == NULL || length == 0)
+        return NULL;
+
+    if (length > INT_MAX)
+        return NULL;
+
+    ret = OPENSSL_zalloc(sizeof(*ret));
+    if (ret == NULL)
+        return NULL;
+
+    ret->type = type;
+    ret->data = (unsigned char *)data;
+    ret->length = (int)length;
+    ret->flags |= ASN1_STRING_FLAG_DATA_NOT_OWNED;
+
+    return ret;
+}
+
+void ossl_asn1_string_free_internal(ASN1_STRING *a, int clear, int embed)
 {
     if (a == NULL)
         return;
-    if (!(a->flags & ASN1_STRING_FLAG_NDEF))
-        OPENSSL_free(a->data);
-    if (embed == 0)
-        OPENSSL_free(a);
+
+    if ((a->flags & ASN1_STRING_FLAG_DATA_NOT_OWNED)) {
+        a->data = NULL;
+        a->length = 0;
+        a->flags &= ~ASN1_STRING_FLAG_DATA_NOT_OWNED;
+    }
+
+    if (!(a->flags & ASN1_STRING_FLAG_NDEF)) {
+        if (clear && a->length > 0)
+            OPENSSL_clear_free(a->data, a->length);
+        else
+            OPENSSL_free(a->data);
+    }
+    /*
+     * TODO(beck): Add an assert here to verify that the embed arg is
+     * always set to match the flag, and then get rid of the arg.
+     */
+    if (!embed && !(a->flags & ASN1_STRING_FLAG_EMBED)) {
+        if (clear)
+            OPENSSL_clear_free(a, sizeof(*a));
+        else
+            OPENSSL_free(a);
+    }
 }

 void ASN1_STRING_free(ASN1_STRING *a)
 {
     if (a == NULL)
         return;
-    ossl_asn1_string_embed_free(a, a->flags & ASN1_STRING_FLAG_EMBED);
+
+    ossl_asn1_string_free_internal(a, 0, a->flags & ASN1_STRING_FLAG_EMBED);
 }

 void ASN1_STRING_clear_free(ASN1_STRING *a)
 {
     if (a == NULL)
         return;
-    if (a->data && !(a->flags & ASN1_STRING_FLAG_NDEF))
-        OPENSSL_cleanse(a->data, a->length);
-    ASN1_STRING_free(a);
+
+    ossl_asn1_string_free_internal(a, 1, a->flags & ASN1_STRING_FLAG_EMBED);
 }

 int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
@@ -402,10 +626,17 @@ int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
     }
 }

+#ifndef OPENSSL_NO_DEPRECATED_4_1
 int ASN1_STRING_length(const ASN1_STRING *x)
 {
     return x->length;
 }
+#endif
+
+size_t ASN1_STRING_get_length(const ASN1_STRING *x)
+{
+    return x->length >= 0 ? (size_t)x->length : 0U;
+}

 #ifndef OPENSSL_NO_DEPRECATED_3_0
 void ASN1_STRING_length_set(ASN1_STRING *x, int len)
@@ -424,14 +655,6 @@ const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x)
     return x->data;
 }

-#ifndef OPENSSL_NO_DEPRECATED_1_1_0
-unsigned char *ASN1_STRING_data(ASN1_STRING *x)
-{
-    return x->data;
-}
-#endif
-
-/* |max_len| excludes NUL terminator and may be 0 to indicate no restriction */
 char *ossl_sk_ASN1_UTF8STRING2text(STACK_OF(ASN1_UTF8STRING) *text,
     const char *sep, size_t max_len)
 {
@@ -449,7 +672,7 @@ char *ossl_sk_ASN1_UTF8STRING2text(STACK_OF(ASN1_UTF8STRING) *text,
         current = sk_ASN1_UTF8STRING_value(text, i);
         if (i > 0)
             length += sep_len;
-        length += ASN1_STRING_length(current);
+        length += ASN1_STRING_get_length(current);
         if (max_len != 0 && length > max_len)
             return NULL;
     }
@@ -459,13 +682,15 @@ char *ossl_sk_ASN1_UTF8STRING2text(STACK_OF(ASN1_UTF8STRING) *text,
     p = result;
     for (i = 0; i < sk_ASN1_UTF8STRING_num(text); i++) {
         current = sk_ASN1_UTF8STRING_value(text, i);
-        length = ASN1_STRING_length(current);
+        length = ASN1_STRING_get_length(current);
         if (i > 0 && sep_len > 0) {
-            strncpy(p, sep, sep_len + 1); /* using + 1 to silence gcc warning */
+            memcpy(p, sep, sep_len);
             p += sep_len;
         }
-        strncpy(p, (const char *)ASN1_STRING_get0_data(current), length);
-        p += length;
+        if (length > 0) {
+            memcpy(p, ASN1_STRING_get0_data(current), length);
+            p += length;
+        }
     }
     *p = '\0';

diff --git a/deps/openssl/openssl/crypto/asn1/asn1_local.h b/deps/openssl/openssl/crypto/asn1/asn1_local.h
index fe9228977df..6f3ee7983cf 100644
--- a/deps/openssl/openssl/crypto/asn1/asn1_local.h
+++ b/deps/openssl/openssl/crypto/asn1/asn1_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -9,6 +9,10 @@

 /* Internal ASN1 structures and functions: not for application use */

+#if !defined(OSSL_LIBCRYPTO_ASN1_ASN1_LOCAL_H)
+#define OSSL_LIBCRYPTO_ASN1_ASN1_LOCAL_H
+
+#include <openssl/asn1t.h>
 #include "crypto/asn1.h"

 typedef const ASN1_VALUE const_ASN1_VALUE;
@@ -47,7 +51,7 @@ DEFINE_STACK_OF(MIME_PARAM)
 typedef struct mime_header_st MIME_HEADER;
 DEFINE_STACK_OF(MIME_HEADER)

-void ossl_asn1_string_embed_free(ASN1_STRING *a, int embed);
+void ossl_asn1_string_free_internal(ASN1_STRING *a, int clear, int embed);

 int ossl_asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it);
 int ossl_asn1_get_choice_selector_const(const ASN1_VALUE **pval,
@@ -63,13 +67,15 @@ const ASN1_TEMPLATE *ossl_asn1_do_adb(const ASN1_VALUE *val,
     const ASN1_TEMPLATE *tt,
     int nullerr);

+ASN1_OBJECT *ossl_asn1_object_new(void);
+
 int ossl_asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it);

 void ossl_asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it);
 void ossl_asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
 int ossl_asn1_enc_restore(int *len, unsigned char **out, const ASN1_VALUE **pval,
     const ASN1_ITEM *it);
-int ossl_asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen,
+int ossl_asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, long inlen,
     const ASN1_ITEM *it);

 void ossl_asn1_item_embed_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed);
@@ -78,7 +84,7 @@ void ossl_asn1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);

 ASN1_OBJECT *ossl_c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
     long length);
-int ossl_i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp);
+int ossl_i2c_ASN1_BIT_STRING(const ASN1_BIT_STRING *a, unsigned char **pp);
 ASN1_BIT_STRING *ossl_c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
     const unsigned char **pp, long length);
 int ossl_i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp);
@@ -90,7 +96,13 @@ int ossl_c2i_uint64_int(uint64_t *ret, int *neg, const unsigned char **pp,
     long len);
 int ossl_i2c_uint64_int(unsigned char *p, uint64_t r, int neg);

-ASN1_TIME *ossl_asn1_time_from_tm(ASN1_TIME *s, struct tm *ts, int type);
-
 int ossl_asn1_item_ex_new_intern(ASN1_VALUE **pval, const ASN1_ITEM *it,
     OSSL_LIB_CTX *libctx, const char *propq);
+int ossl_asn1_time_time_t_to_tm(const time_t *time, struct tm *out_tm);
+int ossl_asn1_time_tm_to_time_t(const struct tm *tm, time_t *out);
+int ossl_asn1_call_aux_cb(const ASN1_AUX *aux, int operation,
+    const ASN1_VALUE **in, const ASN1_ITEM *it, void *exarg);
+int ossl_asn1_string_set_internal(ASN1_STRING *str, const uint8_t *data,
+    int len_in, int add_nul_byte);
+
+#endif /* !defined(OSSL_LIBCRYPTO_ASN1_ASN1_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/asn1/asn1_parse.c b/deps/openssl/openssl/crypto/asn1/asn1_parse.c
index 4feb161e33b..9a602267b71 100644
--- a/deps/openssl/openssl/crypto/asn1/asn1_parse.c
+++ b/deps/openssl/openssl/crypto/asn1/asn1_parse.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,6 +17,8 @@
 #define ASN1_PARSE_MAXDEPTH 128
 #endif

+#include <crypto/asn1.h>
+
 static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
     int offset, int depth, int indent, int dump);
 static int asn1_print_info(BIO *bp, long offset, int depth, int hl, long len,
@@ -26,7 +28,7 @@ static int asn1_print_info(BIO *bp, long offset, int depth, int hl, long len,
     const char *p;
     int pop_f_prefix = 0;
     long saved_indent = -1;
-    int i = 0;
+    int i = 0, n;
     BIO *bio = NULL;

     if (constructed & V_ASN1_CONSTRUCTED)
@@ -34,16 +36,14 @@ static int asn1_print_info(BIO *bp, long offset, int depth, int hl, long len,
     else
         p = "prim: ";
     if (constructed != (V_ASN1_CONSTRUCTED | 1)) {
-        if (BIO_snprintf(str, sizeof(str), "%5ld:d=%-2d hl=%ld l=%4ld %s",
-                offset, depth, (long)hl, len, p)
-            <= 0)
-            goto err;
+        n = snprintf(str, sizeof(str), "%5ld:d=%-2d hl=%ld l=%4ld %s",
+            offset, depth, (long)hl, len, p);
     } else {
-        if (BIO_snprintf(str, sizeof(str), "%5ld:d=%-2d hl=%ld l=inf  %s",
-                offset, depth, (long)hl, p)
-            <= 0)
-            goto err;
+        n = snprintf(str, sizeof(str), "%5ld:d=%-2d hl=%ld l=inf  %s",
+            offset, depth, (long)hl, p);
     }
+    if (n <= 0 || (size_t)n >= sizeof(str))
+        goto err;
     if (bp != NULL) {
         if (BIO_set_prefix(bp, str) <= 0) {
             if ((bio = BIO_new(BIO_f_prefix())) == NULL
@@ -62,13 +62,13 @@ static int asn1_print_info(BIO *bp, long offset, int depth, int hl, long len,
      */
     p = str;
     if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
-        BIO_snprintf(str, sizeof(str), "priv [ %d ] ", tag);
+        snprintf(str, sizeof(str), "priv [ %d ] ", tag);
     else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
-        BIO_snprintf(str, sizeof(str), "cont [ %d ]", tag);
+        snprintf(str, sizeof(str), "cont [ %d ]", tag);
     else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
-        BIO_snprintf(str, sizeof(str), "appl [ %d ]", tag);
+        snprintf(str, sizeof(str), "appl [ %d ]", tag);
     else if (tag > 30)
-        BIO_snprintf(str, sizeof(str), "<ASN1 %d>", tag);
+        snprintf(str, sizeof(str), "<ASN1 %d>", tag);
     else
         p = ASN1_tag2str(tag);

@@ -122,7 +122,7 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
             BIO_puts(bp, "Error in encoding\n");
             goto end;
         }
-        hl = (p - op);
+        hl = (int)(p - op);
         length -= hl;
         /*
          * if j == 0x21 it is a constructed indefinite length object
@@ -143,12 +143,12 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
             if ((j == 0x21) && (len == 0)) {
                 for (;;) {
                     r = asn1_parse2(bp, &p, (long)(tot - p),
-                        offset + (p - *pp), depth + 1,
+                        offset + (int)(p - *pp), depth + 1,
                         indent, dump);
                     if (r == 0)
                         goto end;
                     if ((r == 2) || (p >= tot)) {
-                        len = p - sp;
+                        len = (long)(p - sp);
                         break;
                     }
                 }
@@ -158,11 +158,11 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
                 while (p < ep) {
                     sp = p;
                     r = asn1_parse2(bp, &p, tmp,
-                        offset + (p - *pp), depth + 1,
+                        offset + (int)(p - *pp), depth + 1,
                         indent, dump);
                     if (r == 0)
                         goto end;
-                    tmp -= p - sp;
+                    tmp -= (long)(p - sp);
                 }
             }
         } else if (xclass != 0) {
@@ -358,7 +358,7 @@ const char *ASN1_tag2str(int tag)
         "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL",
         /* 10-13 */
         "ENUMERATED", "<ASN1 11>", "UTF8STRING", "<ASN1 13>",
-        /* 15-17 */
+        /* 14-17 */
         "<ASN1 14>", "<ASN1 15>", "SEQUENCE", "SET",
         /* 18-20 */
         "NUMERICSTRING", "PRINTABLESTRING", "T61STRING",
diff --git a/deps/openssl/openssl/crypto/asn1/asn_mime.c b/deps/openssl/openssl/crypto/asn1/asn_mime.c
index 8007b52d153..2316618744d 100644
--- a/deps/openssl/openssl/crypto/asn1/asn_mime.c
+++ b/deps/openssl/openssl/crypto/asn1/asn_mime.c
@@ -81,9 +81,9 @@ int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
         }
         if (!SMIME_crlf_copy(in, bio, flags)) {
             rv = 0;
+        } else if (BIO_flush(bio) <= 0) {
+            rv = 0;
         }
-
-        (void)BIO_flush(bio);
         /* Free up successive BIOs until we hit the old output BIO */
         do {
             tbio = BIO_pop(bio);
@@ -128,11 +128,9 @@ static int B64_write_ASN1(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
 int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
     const char *hdr, const ASN1_ITEM *it)
 {
-    int r;
-    BIO_printf(out, "-----BEGIN %s-----\n", hdr);
-    r = B64_write_ASN1(out, val, in, flags, it);
-    BIO_printf(out, "-----END %s-----\n", hdr);
-    return r;
+    return BIO_printf(out, "-----BEGIN %s-----\n", hdr) >= 0
+        && B64_write_ASN1(out, val, in, flags, it)
+        && BIO_printf(out, "-----END %s-----\n", hdr) >= 0;
 }

 static ASN1_VALUE *b64_read_asn1(BIO *bio, const ASN1_ITEM *it, ASN1_VALUE **x,
@@ -159,13 +157,12 @@ static ASN1_VALUE *b64_read_asn1(BIO *bio, const ASN1_ITEM *it, ASN1_VALUE **x,

 static int asn1_write_micalg(BIO *out, STACK_OF(X509_ALGOR) *mdalgs)
 {
-    const EVP_MD *md;
     int i, have_unknown = 0, write_comma, ret = 0, md_nid;
     have_unknown = 0;
     write_comma = 0;
     for (i = 0; i < sk_X509_ALGOR_num(mdalgs); i++) {
-        if (write_comma)
-            BIO_write(out, ",", 1);
+        if (write_comma && BIO_puts(out, ",") < 0)
+            goto err;
         write_comma = 1;
         md_nid = OBJ_obj2nid(sk_X509_ALGOR_value(mdalgs, i)->algorithm);

@@ -181,57 +178,53 @@ static int asn1_write_micalg(BIO *out, STACK_OF(X509_ALGOR) *mdalgs)
             continue;
         }

-        md = EVP_get_digestbynid(md_nid);
-        if (md && md->md_ctrl) {
-            int rv;
-            char *micstr;
-            rv = md->md_ctrl(NULL, EVP_MD_CTRL_MICALG, 0, &micstr);
-            if (rv > 0) {
-                BIO_puts(out, micstr);
-                OPENSSL_free(micstr);
-                continue;
-            }
-            if (rv != -2)
-                goto err;
-        }
         switch (md_nid) {
         case NID_sha1:
-            BIO_puts(out, "sha1");
+            if (BIO_puts(out, "sha1") < 0)
+                goto err;
             break;

         case NID_md5:
-            BIO_puts(out, "md5");
+            if (BIO_puts(out, "md5") < 0)
+                goto err;
             break;

         case NID_sha256:
-            BIO_puts(out, "sha-256");
+            if (BIO_puts(out, "sha-256") < 0)
+                goto err;
             break;

         case NID_sha384:
-            BIO_puts(out, "sha-384");
+            if (BIO_puts(out, "sha-384") < 0)
+                goto err;
             break;

         case NID_sha512:
-            BIO_puts(out, "sha-512");
+            if (BIO_puts(out, "sha-512") < 0)
+                goto err;
             break;

         case NID_id_GostR3411_94:
-            BIO_puts(out, "gostr3411-94");
+            if (BIO_puts(out, "gostr3411-94") < 0)
+                goto err;
             break;

         case NID_id_GostR3411_2012_256:
-            BIO_puts(out, "gostr3411-2012-256");
+            if (BIO_puts(out, "gostr3411-2012-256") < 0)
+                goto err;
             break;

         case NID_id_GostR3411_2012_512:
-            BIO_puts(out, "gostr3411-2012-512");
+            if (BIO_puts(out, "gostr3411-2012-512") < 0)
+                goto err;
             break;

         default:
             if (have_unknown) {
                 write_comma = 0;
             } else {
-                BIO_puts(out, "unknown");
+                if (BIO_puts(out, "unknown") < 0)
+                    goto err;
                 have_unknown = 1;
             }
             break;
@@ -279,32 +272,40 @@ int SMIME_write_ASN1_ex(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
             bound[i] = c;
         }
         bound[32] = 0;
-        BIO_printf(bio, "MIME-Version: 1.0%s", mime_eol);
-        BIO_printf(bio, "Content-Type: multipart/signed;");
-        BIO_printf(bio, " protocol=\"%ssignature\";", mime_prefix);
-        BIO_puts(bio, " micalg=\"");
+        if (BIO_printf(bio, "MIME-Version: 1.0%s"
+                            "Content-Type: multipart/signed; protocol=\"%ssignature\";"
+                            " micalg=\"", /* not 'macalg', seee RFC 2311 section 3.4.3.2 */
+                mime_eol, mime_prefix)
+            < 0)
+            return 0;
         if (!asn1_write_micalg(bio, mdalgs))
             return 0;
-        BIO_printf(bio, "\"; boundary=\"----%s\"%s%s",
-            bound, mime_eol, mime_eol);
-        BIO_printf(bio, "This is an S/MIME signed message%s%s",
-            mime_eol, mime_eol);
-        /* Now write out the first part */
-        BIO_printf(bio, "------%s%s", bound, mime_eol);
+        if (BIO_printf(bio, "\"; boundary=\"----%s\"%s%s"
+                            "This is an S/MIME signed message%s%s"
+                            /* Now comes the first part */
+                            "------%s%s",
+                bound, mime_eol, mime_eol,
+                mime_eol, mime_eol,
+                bound, mime_eol)
+            < 0)
+            return 0;
         if (!asn1_output_data(bio, data, val, flags, it))
             return 0;
-        BIO_printf(bio, "%s------%s%s", mime_eol, bound, mime_eol);
+        if (BIO_printf(bio, "%s------%s%s", mime_eol, bound, mime_eol) < 0)
+            return 0;

         /* Headers for signature */

-        BIO_printf(bio, "Content-Type: %ssignature;", mime_prefix);
-        BIO_printf(bio, " name=\"smime.p7s\"%s", mime_eol);
-        BIO_printf(bio, "Content-Transfer-Encoding: base64%s", mime_eol);
-        BIO_printf(bio, "Content-Disposition: attachment;");
-        BIO_printf(bio, " filename=\"smime.p7s\"%s%s", mime_eol, mime_eol);
-        B64_write_ASN1(bio, val, NULL, 0, it);
-        BIO_printf(bio, "%s------%s--%s%s", mime_eol, bound,
-            mime_eol, mime_eol);
+        if (BIO_printf(bio, "Content-Type: %ssignature; name=\"smime.p7s\"%s"
+                            "Content-Transfer-Encoding: base64%s"
+                            "Content-Disposition: attachment; filename=\"smime.p7s\"%s%s",
+                mime_prefix, mime_eol,
+                mime_eol, mime_eol, mime_eol)
+            < 0)
+            return 0;
+        if (!B64_write_ASN1(bio, val, NULL, 0, it)
+            || BIO_printf(bio, "%s------%s--%s%s", mime_eol, bound, mime_eol, mime_eol) < 0)
+            return 0;
         return 1;
     }

@@ -317,7 +318,7 @@ int SMIME_write_ASN1_ex(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
     } else if (ctype_nid == NID_pkcs7_signed) {
         if (econt_nid == NID_id_smime_ct_receipt)
             msg_type = "signed-receipt";
-        else if (sk_X509_ALGOR_num(mdalgs) >= 0)
+        else if (mdalgs != NULL && sk_X509_ALGOR_num(mdalgs) > 0)
             msg_type = "signed-data";
         else
             msg_type = "certs-only";
@@ -326,19 +327,24 @@ int SMIME_write_ASN1_ex(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
         cname = "smime.p7z";
     }
     /* MIME headers */
-    BIO_printf(bio, "MIME-Version: 1.0%s", mime_eol);
-    BIO_printf(bio, "Content-Disposition: attachment;");
-    BIO_printf(bio, " filename=\"%s\"%s", cname, mime_eol);
-    BIO_printf(bio, "Content-Type: %smime;", mime_prefix);
-    if (msg_type)
-        BIO_printf(bio, " smime-type=%s;", msg_type);
-    BIO_printf(bio, " name=\"%s\"%s", cname, mime_eol);
-    BIO_printf(bio, "Content-Transfer-Encoding: base64%s%s",
-        mime_eol, mime_eol);
+    if (BIO_printf(bio, "MIME-Version: 1.0%s"
+                        "Content-Disposition: attachment;"
+                        " filename=\"%s\"%s",
+            mime_eol, cname, mime_eol)
+        < 0)
+        return 0;
+    if (BIO_printf(bio, "Content-Type: %smime;", mime_prefix) < 0)
+        return 0;
+    if (msg_type != NULL && BIO_printf(bio, " smime-type=%s;", msg_type) < 0)
+        return 0;
+    if (BIO_printf(bio, " name=\"%s\"%s"
+                        "Content-Transfer-Encoding: base64%s%s",
+            cname, mime_eol, mime_eol, mime_eol)
+        < 0)
+        return 0;
     if (!B64_write_ASN1(bio, val, data, flags, it))
         return 0;
-    BIO_printf(bio, "%s", mime_eol);
-    return 1;
+    return BIO_printf(bio, "%s", mime_eol) >= 0;
 }

 int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
@@ -526,7 +532,7 @@ int SMIME_crlf_copy(BIO *in, BIO *out, int flags)
     char eol;
     int len;
     char linebuf[MAX_SMLEN];
-    int ret;
+    int ret = 0;

     if (in == NULL || out == NULL) {
         ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);
@@ -544,12 +550,16 @@ int SMIME_crlf_copy(BIO *in, BIO *out, int flags)
     }
     out = BIO_push(bf, out);
     if (flags & SMIME_BINARY) {
-        while ((len = BIO_read(in, linebuf, MAX_SMLEN)) > 0)
-            BIO_write(out, linebuf, len);
+        while ((len = BIO_read(in, linebuf, MAX_SMLEN)) > 0) {
+            if (BIO_write(out, linebuf, len) != len)
+                goto err;
+        }
     } else {
         int eolcnt = 0;
-        if (flags & SMIME_TEXT)
-            BIO_printf(out, "Content-Type: text/plain\r\n\r\n");
+
+        if ((flags & SMIME_TEXT) != 0
+            && BIO_puts(out, "Content-Type: text/plain\r\n\r\n") < 0)
+            goto err;
         while ((len = BIO_gets(in, linebuf, MAX_SMLEN)) > 0) {
             eol = strip_eol(linebuf, &len, flags);
             if (len > 0) {
@@ -557,26 +567,29 @@ int SMIME_crlf_copy(BIO *in, BIO *out, int flags)
                 if (flags & SMIME_ASCIICRLF) {
                     int i;
                     for (i = 0; i < eolcnt; i++)
-                        BIO_write(out, "\r\n", 2);
+                        if (BIO_puts(out, "\r\n") < 0)
+                            goto err;
                     eolcnt = 0;
                 }
-                BIO_write(out, linebuf, len);
-                if (eol)
-                    BIO_write(out, "\r\n", 2);
+                if (BIO_write(out, linebuf, len) != len)
+                    goto err;
+                if (eol && BIO_puts(out, "\r\n") < 0)
+                    goto err;
             } else if (flags & SMIME_ASCIICRLF) {
                 eolcnt++;
             } else if (eol) {
-                BIO_write(out, "\r\n", 2);
+                if (BIO_puts(out, "\r\n") < 0)
+                    goto err;
             }
         }
     }
-    ret = BIO_flush(out);
+    ret = 1;
+
+err:
+    ret = BIO_flush(out) > 0 && ret;
     BIO_pop(out);
     BIO_free(bf);
-    if (ret <= 0)
-        return 0;
-
-    return 1;
+    return ret;
 }

 /* Strip off headers if they are text/plain */
@@ -605,10 +618,9 @@ int SMIME_text(BIO *in, BIO *out)
     }
     sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
     while ((len = BIO_read(in, iobuf, sizeof(iobuf))) > 0)
-        BIO_write(out, iobuf, len);
-    if (len < 0)
-        return 0;
-    return 1;
+        if (out != NULL && BIO_write(out, iobuf, len) != len)
+            return 0;
+    return len >= 0;
 }

 /*
@@ -620,12 +632,15 @@ static int multi_split(BIO *bio, int flags, const char *bound, STACK_OF(BIO) **r
 {
     char linebuf[MAX_SMLEN];
     int len, blen;
+    size_t blen_s = strlen(bound);
     int eol = 0, next_eol = 0;
     BIO *bpart = NULL;
     STACK_OF(BIO) *parts;
     char state, part, first;

-    blen = strlen(bound);
+    if (blen_s > MAX_SMLEN)
+        return 0;
+    blen = (int)blen_s;
     part = 0;
     state = 0;
     first = 1;
@@ -639,10 +654,14 @@ static int multi_split(BIO *bio, int flags, const char *bound, STACK_OF(BIO) **r
             first = 1;
             part++;
         } else if (state == 2) {
-            if (!sk_BIO_push(parts, bpart)) {
-                BIO_free(bpart);
-                return 0;
+            if (bpart == NULL) {
+                bpart = BIO_new(BIO_s_mem());
+                if (bpart == NULL)
+                    return 0;
+                BIO_set_mem_eof_return(bpart, 0);
             }
+            if (!sk_BIO_push(parts, bpart))
+                goto err;
             return 1;
         } else if (part != 0) {
             /* Strip (possibly CR +) LF from linebuf */
@@ -650,10 +669,8 @@ static int multi_split(BIO *bio, int flags, const char *bound, STACK_OF(BIO) **r
             if (first) {
                 first = 0;
                 if (bpart)
-                    if (!sk_BIO_push(parts, bpart)) {
-                        BIO_free(bpart);
-                        return 0;
-                    }
+                    if (!sk_BIO_push(parts, bpart))
+                        goto err;
                 bpart = BIO_new(BIO_s_mem());
                 if (bpart == NULL)
                     return 0;
@@ -666,13 +683,15 @@ static int multi_split(BIO *bio, int flags, const char *bound, STACK_OF(BIO) **r
                     1
 #endif
                     || (flags & SMIME_CRLFEOL) != 0) {
-                    if (BIO_write(bpart, "\r\n", 2) < 2)
+                    if (BIO_puts(bpart, "\r\n") < 0)
                         goto err;
-                } else if (BIO_write(bpart, "\n", 1) < 1)
-                    goto err;
+                } else {
+                    if (BIO_puts(bpart, "\n") < 0)
+                        goto err;
+                }
             }
             eol = next_eol;
-            if (len > 0 && BIO_write(bpart, linebuf, len) < len)
+            if (len > 0 && BIO_write(bpart, linebuf, len) != len)
                 goto err;
         }
     }
@@ -846,7 +865,7 @@ static char *strip_start(char *name)
 static char *strip_end(char *name)
 {
     char *p, c;
-    if (!name)
+    if (!name || *name == '\0')
         return NULL;
     /* Look for first non whitespace or quote */
     for (p = name + strlen(name) - 1; p >= name; p--) {
@@ -1000,10 +1019,8 @@ static void mime_param_free(MIME_PARAM *param)
  */
 static int mime_bound_check(char *line, int linelen, const char *bound, int blen)
 {
-    if (linelen == -1)
-        linelen = strlen(line);
-    if (blen == -1)
-        blen = strlen(bound);
+    if (linelen < 0 || blen < 0)
+        return 0;
     /* Quickly eliminate if line length too short */
     if (blen + 2 > linelen)
         return 0;
@@ -1019,6 +1036,11 @@ static int strip_eol(char *linebuf, int *plen, int flags)
     char *p, c;
     int is_eol = 0;

+    if (len <= 0) {
+        *plen = 0;
+        return 0;
+    }
+
 #ifndef OPENSSL_NO_CMS
     if ((flags & CMS_BINARY) != 0) {
         if (len <= 0 || linebuf[len - 1] != '\n')
diff --git a/deps/openssl/openssl/crypto/asn1/asn_pack.c b/deps/openssl/openssl/crypto/asn1/asn_pack.c
index e8b93030a28..3084993a34b 100644
--- a/deps/openssl/openssl/crypto/asn1/asn_pack.c
+++ b/deps/openssl/openssl/crypto/asn1/asn_pack.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,8 @@
 #include "internal/cryptlib.h"
 #include <openssl/asn1.h>

+#include <crypto/asn1.h>
+
 /* ASN1 packing and unpacking functions */

 ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct)
diff --git a/deps/openssl/openssl/crypto/asn1/bio_asn1.c b/deps/openssl/openssl/crypto/asn1/bio_asn1.c
index a5f423b41cf..547faa5165c 100644
--- a/deps/openssl/openssl/crypto/asn1/bio_asn1.c
+++ b/deps/openssl/openssl/crypto/asn1/bio_asn1.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -252,11 +252,16 @@ static int asn1_bio_flush_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx,
     asn1_ps_func *cleanup, asn1_bio_state_t next)
 {
     int ret;
+    BIO *next_bio = BIO_next(b);

     if (ctx->ex_len <= 0)
         return 1;
+    if (next_bio == NULL)
+        return 0;
     for (;;) {
-        ret = BIO_write(BIO_next(b), ctx->ex_buf + ctx->ex_pos, ctx->ex_len);
+        ret = BIO_write(next_bio, ctx->ex_buf + ctx->ex_pos, ctx->ex_len);
+        BIO_clear_retry_flags(b);
+        BIO_copy_next_retry(b);
         if (ret <= 0)
             break;
         ctx->ex_len -= ret;
@@ -291,23 +296,36 @@ static int asn1_bio_setup_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx,

 static int asn1_bio_read(BIO *b, char *in, int inl)
 {
+    int ret = 0;
     BIO *next = BIO_next(b);
     if (next == NULL)
         return 0;
-    return BIO_read(next, in, inl);
+    ret = BIO_read(next, in, inl);
+    BIO_clear_retry_flags(b);
+    BIO_copy_next_retry(b);
+    return ret;
 }

 static int asn1_bio_puts(BIO *b, const char *str)
 {
-    return asn1_bio_write(b, str, strlen(str));
+    size_t len = strlen(str);
+
+    if (len > INT_MAX)
+        return -1;
+
+    return asn1_bio_write(b, str, (int)len);
 }

 static int asn1_bio_gets(BIO *b, char *str, int size)
 {
+    int ret = 0;
     BIO *next = BIO_next(b);
     if (next == NULL)
         return 0;
-    return BIO_gets(next, str, size);
+    ret = BIO_gets(next, str, size);
+    BIO_clear_retry_flags(b);
+    BIO_copy_next_retry(b);
+    return ret;
 }

 static long asn1_bio_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
@@ -363,6 +381,14 @@ static long asn1_bio_ctrl(BIO *b, int cmd, long arg1, void *arg2)
         *(void **)arg2 = ctx->ex_arg;
         break;

+    case BIO_C_DO_STATE_MACHINE:
+        if (next == NULL)
+            return 0;
+        BIO_clear_retry_flags(b);
+        ret = BIO_ctrl(next, cmd, arg1, arg2);
+        BIO_copy_next_retry(b);
+        break;
+
     case BIO_CTRL_FLUSH:
         if (next == NULL)
             return 0;
@@ -381,13 +407,24 @@ static long asn1_bio_ctrl(BIO *b, int cmd, long arg1, void *arg2)
                 return ret;
         }

-        if (ctx->state == ASN1_STATE_DONE)
-            return BIO_ctrl(next, cmd, arg1, arg2);
-        else {
-            BIO_clear_retry_flags(b);
+        BIO_clear_retry_flags(b);
+        if (ctx->state == ASN1_STATE_DONE) {
+            ret = BIO_ctrl(next, cmd, arg1, arg2);
+            BIO_copy_next_retry(b);
+            return ret;
+        } else {
             return 0;
         }

+    case BIO_CTRL_EOF:
+        /*
+         * If there is no next BIO, BIO_read() returns 0, which means EOF.
+         * BIO_eof() should return 1 in this case.
+         */
+        if (next == NULL)
+            return 1;
+        return BIO_ctrl(next, cmd, arg1, arg2);
+
     default:
         if (next == NULL)
             return 0;
diff --git a/deps/openssl/openssl/crypto/asn1/bio_ndef.c b/deps/openssl/openssl/crypto/asn1/bio_ndef.c
index 62d936d76b1..9986affae3d 100644
--- a/deps/openssl/openssl/crypto/asn1/bio_ndef.c
+++ b/deps/openssl/openssl/crypto/asn1/bio_ndef.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,7 @@
 #include <openssl/asn1t.h>
 #include <openssl/bio.h>
 #include <openssl/err.h>
+#include "crypto/asn1.h"

 #include <stdio.h>

@@ -36,8 +37,11 @@ typedef struct ndef_aux_st {
     BIO *ndef_bio;
     /* Output BIO */
     BIO *out;
-    /* Boundary where content is inserted */
-    unsigned char **boundary;
+    /*
+     * Content octet string in which the encoder records where the content
+     * belongs.  Borrowed from the caller.
+     */
+    ASN1_STRING *content;
     /* DER buffer start */
     unsigned char *derbuf;
 } NDEF_SUPPORT;
@@ -52,8 +56,6 @@ static int ndef_suffix_free(BIO *b, unsigned char **pbuf, int *plen,
 /*
  * On success, the returned BIO owns the input BIO as part of its BIO chain.
  * On failure, NULL is returned and the input BIO is owned by the caller.
- *
- * Unfortunately cannot constify this due to CMS_stream() and PKCS7_stream()
  */
 BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it)
 {
@@ -62,6 +64,7 @@ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it)
     const ASN1_AUX *aux = it->funcs;
     ASN1_STREAM_ARG sarg;
     BIO *pop_bio = NULL;
+    ASN1_STRING *content = NULL;

     if (!aux || !aux->asn1_cb) {
         ERR_raise(ERR_LIB_ASN1, ASN1_R_STREAMING_NOT_SUPPORTED);
@@ -105,6 +108,12 @@ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it)
         goto err;
     }

+    if (aux->asn1_cb(ASN1_OP_GET0_STREAM_CONTENT, &val, it, &content) > 0
+        && content != NULL)
+        content->flags |= ASN1_STRING_FLAG_NDEF;
+    else
+        content = NULL; /* Don't leave a junk borrowed pointer to play with */
+
     /*
      * We must not fail now because the callback has prepended additional
      * BIOs to the chain
@@ -113,7 +122,7 @@ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it)
     ndef_aux->val = val;
     ndef_aux->it = it;
     ndef_aux->ndef_bio = sarg.ndef_bio;
-    ndef_aux->boundary = sarg.boundary;
+    ndef_aux->content = content;
     ndef_aux->out = out;

     return sarg.ndef_bio;
@@ -130,7 +139,7 @@ static int ndef_prefix(BIO *b, unsigned char **pbuf, int *plen, void *parg)
 {
     NDEF_SUPPORT *ndef_aux;
     unsigned char *p;
-    int derlen;
+    int derlen, outlen;

     if (parg == NULL)
         return 0;
@@ -145,12 +154,14 @@ static int ndef_prefix(BIO *b, unsigned char **pbuf, int *plen, void *parg)

     ndef_aux->derbuf = p;
     *pbuf = p;
-    ASN1_item_ndef_i2d(ndef_aux->val, &p, ndef_aux->it);
+    outlen = ASN1_item_ndef_i2d(ndef_aux->val, &p, ndef_aux->it);
+    if (outlen != derlen || p != *pbuf + derlen)
+        return 0;

-    if (*ndef_aux->boundary == NULL)
+    if (ndef_aux->content == NULL || ndef_aux->content->data == NULL)
         return 0;

-    *plen = *ndef_aux->boundary - *pbuf;
+    *plen = (int)(ndef_aux->content->data - *pbuf);

     return 1;
 }
@@ -191,7 +202,7 @@ static int ndef_suffix(BIO *b, unsigned char **pbuf, int *plen, void *parg)
 {
     NDEF_SUPPORT *ndef_aux;
     unsigned char *p;
-    int derlen;
+    int derlen, outlen;
     const ASN1_AUX *aux;
     ASN1_STREAM_ARG sarg;

@@ -205,7 +216,7 @@ static int ndef_suffix(BIO *b, unsigned char **pbuf, int *plen, void *parg)
     /* Finalize structures */
     sarg.ndef_bio = ndef_aux->ndef_bio;
     sarg.out = ndef_aux->out;
-    sarg.boundary = ndef_aux->boundary;
+    sarg.boundary = NULL;
     if (aux->asn1_cb(ASN1_OP_STREAM_POST,
             &ndef_aux->val, ndef_aux->it, &sarg)
         <= 0)
@@ -219,12 +230,14 @@ static int ndef_suffix(BIO *b, unsigned char **pbuf, int *plen, void *parg)

     ndef_aux->derbuf = p;
     *pbuf = p;
-    derlen = ASN1_item_ndef_i2d(ndef_aux->val, &p, ndef_aux->it);
+    outlen = ASN1_item_ndef_i2d(ndef_aux->val, &p, ndef_aux->it);
+    if (outlen != derlen || p != *pbuf + derlen)
+        return 0;

-    if (*ndef_aux->boundary == NULL)
+    if (ndef_aux->content == NULL || ndef_aux->content->data == NULL)
         return 0;
-    *pbuf = *ndef_aux->boundary;
-    *plen = derlen - (*ndef_aux->boundary - ndef_aux->derbuf);
+    *pbuf = ndef_aux->content->data;
+    *plen = derlen - (int)(ndef_aux->content->data - ndef_aux->derbuf);

     return 1;
 }
diff --git a/deps/openssl/openssl/crypto/asn1/build.info b/deps/openssl/openssl/crypto/asn1/build.info
index 33b86fdd31f..38e883174af 100644
--- a/deps/openssl/openssl/crypto/asn1/build.info
+++ b/deps/openssl/openssl/crypto/asn1/build.info
@@ -14,10 +14,14 @@ SOURCE[../../libcrypto]=\
         asn1_gen.c asn1_parse.c asn1_lib.c asn1_err.c a_strnid.c \
         evp_asn1.c asn_pack.c p5_pbe.c p5_pbev2.c p5_scrypt.c p8_pkey.c \
         asn_moid.c asn_mstbl.c asn1_item_list.c \
-        d2i_param.c
+        d2i_param.c a_time_posix.c
 IF[{- !$disabled{'rsa'} and !$disabled{'rc4'} -}]
   SOURCE[../../libcrypto]=n_pkey.c
 ENDIF
 IF[{- !$disabled{'deprecated-3.0'} -}]
   SOURCE[../../libcrypto]=x_long.c
 ENDIF
+
+DEPEND[a_strex.o]=charmap.h
+GENERATE[charmap.h]=charmap.pl
+INCLUDE[a_strex.o]=.
diff --git a/deps/openssl/openssl/crypto/asn1/charmap.h b/deps/openssl/openssl/crypto/asn1/charmap.h
deleted file mode 100644
index ac1eb076cc2..00000000000
--- a/deps/openssl/openssl/crypto/asn1/charmap.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * WARNING: do not edit!
- * Generated by crypto/asn1/charmap.pl
- *
- * Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#define CHARTYPE_HOST_ANY 4096
-#define CHARTYPE_HOST_DOT 8192
-#define CHARTYPE_HOST_HYPHEN 16384
-#define CHARTYPE_HOST_WILD 32768
-
-/*
- * Mask of various character properties
- */
-
-static const unsigned short char_type[] = {
-    1026,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
-       2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
-       2,    2,    2,    2,    2,    2,    2,    2,  120,    0,    1,   40,
-       0,    0,    0,   16, 1040, 1040, 33792,   25,   25, 16400, 8208,   16,
-    4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112,   16,    9,
-       9,   16,    9,   16,    0, 4112, 4112, 4112, 4112, 4112, 4112, 4112,
-    4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112,
-    4112, 4112, 4112, 4112, 4112, 4112, 4112,    0, 1025,    0,    0,    0,
-       0, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112,
-    4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112,
-    4112, 4112, 4112,    0,    0,    0,    0,    2
-};
diff --git a/deps/openssl/openssl/crypto/asn1/charmap.pl b/deps/openssl/openssl/crypto/asn1/charmap.pl
index 78053dee15f..a2a03d76a8b 100644
--- a/deps/openssl/openssl/crypto/asn1/charmap.pl
+++ b/deps/openssl/openssl/crypto/asn1/charmap.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -101,6 +101,10 @@ print <<EOF;
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_ASN1_CHARMAP_H)
+#define OSSL_LIBCRYPTO_ASN1_CHARMAP_H
+
+/* clang-format off */
 #define CHARTYPE_HOST_ANY $HOST_ANY
 #define CHARTYPE_HOST_DOT $HOST_DOT
 #define CHARTYPE_HOST_HYPHEN $HOST_HYPHEN
@@ -120,4 +124,7 @@ for($i = 0; $i < 128; $i++) {
 	print(",") if ($i != 127);
 }
 print("\n};\n");
+print "/* clang-format on */\n";
+print "\n#endif /* !defined(OSSL_LIBCRYPTO_ASN1_CHARMAP_H) */\n";
+

diff --git a/deps/openssl/openssl/crypto/asn1/d2i_pr.c b/deps/openssl/openssl/crypto/asn1/d2i_pr.c
index 2546050c6af..59ba8f909b8 100644
--- a/deps/openssl/openssl/crypto/asn1/d2i_pr.c
+++ b/deps/openssl/openssl/crypto/asn1/d2i_pr.c
@@ -7,16 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/bn.h>
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/decoder.h>
-#include <openssl/engine.h>
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
 #include "crypto/asn1.h"
@@ -49,7 +45,7 @@ d2i_PrivateKey_decoder(int keytype, EVP_PKEY **a, const unsigned char **pp,

     /* This is just a probe. It might fail, so we ignore errors */
     ERR_set_mark();
-    p8info = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, len);
+    p8info = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, length);
     ERR_pop_to_mark();
     if (p8info != NULL) {
         int64_t v;
@@ -112,10 +108,6 @@ ossl_d2i_PrivateKey_legacy(int keytype, EVP_PKEY **a, const unsigned char **pp,
         }
     } else {
         ret = *a;
-#ifndef OPENSSL_NO_ENGINE
-        ENGINE_finish(ret->engine);
-        ret->engine = NULL;
-#endif
     }

     if (!EVP_PKEY_set_type(ret, keytype)) {
diff --git a/deps/openssl/openssl/crypto/asn1/evp_asn1.c b/deps/openssl/openssl/crypto/asn1/evp_asn1.c
index 2d50dc657ba..6edcfa7440a 100644
--- a/deps/openssl/openssl/crypto/asn1/evp_asn1.c
+++ b/deps/openssl/openssl/crypto/asn1/evp_asn1.c
@@ -34,6 +34,7 @@ int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len)
 int ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, int max_len)
 {
     int ret, num;
+    size_t tmp;
     const unsigned char *p;

     if ((a->type != V_ASN1_OCTET_STRING) || (a->value.octet_string == NULL)) {
@@ -41,7 +42,13 @@ int ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, int max_l
         return -1;
     }
     p = ASN1_STRING_get0_data(a->value.octet_string);
-    ret = ASN1_STRING_length(a->value.octet_string);
+    tmp = ASN1_STRING_get_length(a->value.octet_string);
+    if (tmp > INT_MAX) {
+        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
+        return -1;
+    }
+    ret = (int)tmp;
+
     if (ret < max_len)
         num = ret;
     else
@@ -69,17 +76,25 @@ static ossl_inline void asn1_type_init_oct(ASN1_OCTET_STRING *oct,
 static int asn1_type_get_int_oct(ASN1_OCTET_STRING *oct, int32_t anum,
     long *num, unsigned char *data, int max_len)
 {
-    int ret = ASN1_STRING_length(oct), n;
+    int ret, n;
+    size_t tmp;

     if (num != NULL)
         *num = anum;

+    tmp = ASN1_STRING_get_length(oct);
+
+    if (tmp > INT_MAX)
+        tmp = INT_MAX;
+
+    ret = (int)tmp;
+
     if (max_len > ret)
         n = ret;
     else
         n = max_len;

-    if (data != NULL)
+    if (data != NULL && n > 0)
         memcpy(data, ASN1_STRING_get0_data(oct), n);

     return ret;
diff --git a/deps/openssl/openssl/crypto/asn1/f_int.c b/deps/openssl/openssl/crypto/asn1/f_int.c
index b1fd3f9467c..c6d8bfd0341 100644
--- a/deps/openssl/openssl/crypto/asn1/f_int.c
+++ b/deps/openssl/openssl/crypto/asn1/f_int.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,6 +13,8 @@
 #include <openssl/buffer.h>
 #include <openssl/asn1.h>

+#include <crypto/asn1.h>
+
 int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a)
 {
     int i, n = 0;
diff --git a/deps/openssl/openssl/crypto/asn1/f_string.c b/deps/openssl/openssl/crypto/asn1/f_string.c
index 9fb34f495e1..3b96f91cfc3 100644
--- a/deps/openssl/openssl/crypto/asn1/f_string.c
+++ b/deps/openssl/openssl/crypto/asn1/f_string.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,6 +13,8 @@
 #include <openssl/buffer.h>
 #include <openssl/asn1.h>

+#include <crypto/asn1.h>
+
 int i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type)
 {
     int i, n = 0;
diff --git a/deps/openssl/openssl/crypto/asn1/i2d_evp.c b/deps/openssl/openssl/crypto/asn1/i2d_evp.c
index 92f7158cffd..fc219e230e9 100644
--- a/deps/openssl/openssl/crypto/asn1/i2d_evp.c
+++ b/deps/openssl/openssl/crypto/asn1/i2d_evp.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -93,22 +93,27 @@ int i2d_KeyParams_bio(BIO *bp, const EVP_PKEY *pkey)
     return ASN1_i2d_bio_of(EVP_PKEY, i2d_KeyParams, bp, pkey);
 }

-int i2d_PrivateKey(const EVP_PKEY *a, unsigned char **pp)
+static int
+i2d_PrivateKey_impl(const EVP_PKEY *a, unsigned char **pp, int traditional)
 {
     if (evp_pkey_is_provided(a)) {
-        static const struct type_and_structure_st output_info[] = {
+        static const struct type_and_structure_st trad_output_info[] = {
             { "DER", "type-specific" },
             { "DER", "PrivateKeyInfo" },
             {
                 NULL,
             }
         };
+        const struct type_and_structure_st *oi = trad_output_info;

-        return i2d_provided(a, EVP_PKEY_KEYPAIR, output_info, pp);
+        if (!traditional)
+            ++oi;
+        return i2d_provided(a, EVP_PKEY_KEYPAIR, oi, pp);
     }
-    if (a->ameth != NULL && a->ameth->old_priv_encode != NULL) {
+
+    if (traditional && a->ameth != NULL && a->ameth->old_priv_encode != NULL)
         return a->ameth->old_priv_encode(a, pp);
-    }
+
     if (a->ameth != NULL && a->ameth->priv_encode != NULL) {
         PKCS8_PRIV_KEY_INFO *p8 = EVP_PKEY2PKCS8(a);
         int ret = 0;
@@ -123,6 +128,16 @@ int i2d_PrivateKey(const EVP_PKEY *a, unsigned char **pp)
     return -1;
 }

+int i2d_PrivateKey(const EVP_PKEY *a, unsigned char **pp)
+{
+    return i2d_PrivateKey_impl(a, pp, 1);
+}
+
+int i2d_PKCS8PrivateKey(const EVP_PKEY *a, unsigned char **pp)
+{
+    return i2d_PrivateKey_impl(a, pp, 0);
+}
+
 int i2d_PublicKey(const EVP_PKEY *a, unsigned char **pp)
 {
     if (evp_pkey_is_provided(a)) {
diff --git a/deps/openssl/openssl/crypto/asn1/n_pkey.c b/deps/openssl/openssl/crypto/asn1/n_pkey.c
index 47f3a9802f8..a8ce8ccc46f 100644
--- a/deps/openssl/openssl/crypto/asn1/n_pkey.c
+++ b/deps/openssl/openssl/crypto/asn1/n_pkey.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/crypto/asn1/p5_scrypt.c b/deps/openssl/openssl/crypto/asn1/p5_scrypt.c
index 532740aab8a..6d4ef040d91 100644
--- a/deps/openssl/openssl/crypto/asn1/p5_scrypt.c
+++ b/deps/openssl/openssl/crypto/asn1/p5_scrypt.c
@@ -17,6 +17,8 @@
 #include <openssl/rand.h>
 #include "crypto/evp.h"

+#include <crypto/asn1.h>
+
 #ifndef OPENSSL_NO_SCRYPT
 /* PKCS#5 scrypt password based encryption structures */

@@ -30,7 +32,7 @@ ASN1_SEQUENCE(SCRYPT_PARAMS) = {

 IMPLEMENT_ASN1_FUNCTIONS(SCRYPT_PARAMS)

-static X509_ALGOR *pkcs5_scrypt_set(const unsigned char *salt, size_t saltlen,
+static X509_ALGOR *pkcs5_scrypt_set(const unsigned char *salt, int saltlen,
     size_t keylen, uint64_t N, uint64_t r,
     uint64_t p);

@@ -155,7 +157,7 @@ err:
     return NULL;
 }

-static X509_ALGOR *pkcs5_scrypt_set(const unsigned char *salt, size_t saltlen,
+static X509_ALGOR *pkcs5_scrypt_set(const unsigned char *salt, int saltlen,
     size_t keylen, uint64_t N, uint64_t r,
     uint64_t p)
 {
@@ -171,7 +173,7 @@ static X509_ALGOR *pkcs5_scrypt_set(const unsigned char *salt, size_t saltlen,
         saltlen = PKCS5_DEFAULT_PBE2_SALT_LEN;

     /* This will either copy salt or grow the buffer */
-    if (ASN1_STRING_set(sparam->salt, salt, saltlen) == 0) {
+    if (ossl_asn1_string_set1_data(sparam->salt, salt, saltlen) == 0) {
         ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
         goto err;
     }
diff --git a/deps/openssl/openssl/crypto/asn1/p8_pkey.c b/deps/openssl/openssl/crypto/asn1/p8_pkey.c
index 143f503dea3..e2f23f4e13c 100644
--- a/deps/openssl/openssl/crypto/asn1/p8_pkey.c
+++ b/deps/openssl/openssl/crypto/asn1/p8_pkey.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -72,11 +72,13 @@ int PKCS8_pkey_get0(const ASN1_OBJECT **ppkalg,
     const unsigned char **pk, int *ppklen,
     const X509_ALGOR **pa, const PKCS8_PRIV_KEY_INFO *p8)
 {
+    if (ASN1_STRING_get_length(p8->pkey) > INT_MAX)
+        return 0;
     if (ppkalg)
         *ppkalg = p8->pkeyalg->algorithm;
     if (pk) {
         *pk = ASN1_STRING_get0_data(p8->pkey);
-        *ppklen = ASN1_STRING_length(p8->pkey);
+        *ppklen = (int)ASN1_STRING_get_length(p8->pkey);
     }
     if (pa)
         *pa = p8->pkeyalg;
diff --git a/deps/openssl/openssl/crypto/asn1/standard_methods.h b/deps/openssl/openssl/crypto/asn1/standard_methods.h
index 0d81a2d4634..b5f038969bc 100644
--- a/deps/openssl/openssl/crypto/asn1/standard_methods.h
+++ b/deps/openssl/openssl/crypto/asn1/standard_methods.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,12 +7,19 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_CRYPTO_ASN1_STANDARD_METHODS_H)
+#define OSSL_CRYPTO_ASN1_STANDARD_METHODS_H
+
+#include <openssl/types.h>
+
+#include <crypto/asn1.h>
+
 /*
  * This table MUST be kept in ascending order of the NID each method
  * represents (corresponding to the pkey_id field) as OBJ_bsearch
  * is used to search it.
  */
-static const EVP_PKEY_ASN1_METHOD *standard_methods[] = {
+static const EVP_PKEY_ASN1_METHOD *const standard_methods[] = {
     &ossl_rsa_asn1_meths[0],
     &ossl_rsa_asn1_meths[1],
 #ifndef OPENSSL_NO_DH
@@ -41,3 +48,4 @@ static const EVP_PKEY_ASN1_METHOD *standard_methods[] = {
     &ossl_sm2_asn1_meth,
 #endif
 };
+#endif /* !defined(OSSL_CRYPTO_ASN1_STANDARD_METHODS_H) */
diff --git a/deps/openssl/openssl/crypto/asn1/t_bitst.c b/deps/openssl/openssl/crypto/asn1/t_bitst.c
index a02df91fc2e..6862c0f4c81 100644
--- a/deps/openssl/openssl/crypto/asn1/t_bitst.c
+++ b/deps/openssl/openssl/crypto/asn1/t_bitst.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,21 +12,38 @@
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>

+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+OSSL_BEGIN_ALLOW_DEPRECATED
 int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
     BIT_STRING_BITNAME *tbl, int indent)
 {
     BIT_STRING_BITNAME *bnam;
     char first = 1;
-    BIO_printf(out, "%*s", indent, "");
+    int last_seen_bit = -1;
+
+    if (BIO_printf(out, "%*s", indent, "") < 0)
+        return 0;
     for (bnam = tbl; bnam->lname; bnam++) {
+        /*
+         * Skip duplicate entries for the same bit in the BIT_STRING_BITNAME
+         * table. Those are aliases, but we only want to print the first entry
+         * when converting to a string.
+         */
+        if (last_seen_bit == bnam->bitnum)
+            continue;
+        last_seen_bit = bnam->bitnum;
+
         if (ASN1_BIT_STRING_get_bit(bs, bnam->bitnum)) {
             if (!first)
-                BIO_puts(out, ", ");
-            BIO_puts(out, bnam->lname);
+                if (BIO_puts(out, ", ") < 1)
+                    return 0;
+            if (BIO_puts(out, bnam->lname) < 1)
+                return 0;
             first = 0;
         }
     }
-    BIO_puts(out, "\n");
+    if (BIO_puts(out, "\n") < 1)
+        return 0;
     return 1;
 }

@@ -54,3 +71,5 @@ int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl)
     }
     return -1;
 }
+OSSL_END_ALLOW_DEPRECATED
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_1) */
diff --git a/deps/openssl/openssl/crypto/asn1/t_pkey.c b/deps/openssl/openssl/crypto/asn1/t_pkey.c
index 45becc58d09..b02f43cfbef 100644
--- a/deps/openssl/openssl/crypto/asn1/t_pkey.c
+++ b/deps/openssl/openssl/crypto/asn1/t_pkey.c
@@ -14,7 +14,7 @@
 #include "crypto/bn.h"

 /* Number of octets per line */
-#define ASN1_BUF_PRINT_WIDTH 15
+#define ASN1_BUF_PRINT_WIDTH 16
 /* Maximum indent */
 #define ASN1_PRINT_MAX_INDENT 128

@@ -48,7 +48,7 @@ int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num,
 {
     int n, rv = 0;
     const char *neg;
-    unsigned char *buf = NULL, *tmp = NULL;
+    unsigned char *buf = NULL;
     int buflen;

     if (num == NULL)
@@ -71,23 +71,17 @@ int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num,
         return 1;
     }

-    buflen = BN_num_bytes(num) + 1;
-    buf = tmp = OPENSSL_malloc(buflen);
+    buflen = BN_num_bytes(num);
+    buf = OPENSSL_malloc(buflen);
     if (buf == NULL)
         goto err;
-    buf[0] = 0;
     if (BIO_printf(bp, "%s%s\n", number,
             (neg[0] == '-') ? " (Negative)" : "")
         <= 0)
         goto err;
-    n = BN_bn2bin(num, buf + 1);
+    n = BN_bn2bin(num, buf);

-    if (buf[1] & 0x80)
-        n++;
-    else
-        tmp++;
-
-    if (ASN1_buf_print(bp, tmp, n, indent + 4) == 0)
+    if (ASN1_buf_print(bp, buf, n, indent + 4) == 0)
         goto err;
     rv = 1;
 err:
diff --git a/deps/openssl/openssl/crypto/asn1/t_spki.c b/deps/openssl/openssl/crypto/asn1/t_spki.c
index c0c647a0e52..d313f102dfa 100644
--- a/deps/openssl/openssl/crypto/asn1/t_spki.c
+++ b/deps/openssl/openssl/crypto/asn1/t_spki.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,9 +15,11 @@
 #include <openssl/dsa.h>
 #include <openssl/bn.h>

+#include <crypto/asn1.h>
+
 /* Print out an SPKI */

-int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki)
+int NETSCAPE_SPKI_print(BIO *out, const NETSCAPE_SPKI *spki)
 {
     EVP_PKEY *pkey;
     ASN1_IA5STRING *chal;
@@ -46,7 +48,7 @@ int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki)
     n = spki->signature->length;
     s = (char *)spki->signature->data;
     for (i = 0; i < n; i++) {
-        if ((i % 18) == 0)
+        if ((i % 24) == 0)
             BIO_write(out, "\n      ", 7);
         BIO_printf(out, "%02x%s", (unsigned char)s[i],
             ((i + 1) == n) ? "" : ":");
diff --git a/deps/openssl/openssl/crypto/asn1/tasn_dec.c b/deps/openssl/openssl/crypto/asn1/tasn_dec.c
index 2916faa931a..f1a08d27b10 100644
--- a/deps/openssl/openssl/crypto/asn1/tasn_dec.c
+++ b/deps/openssl/openssl/crypto/asn1/tasn_dec.c
@@ -377,7 +377,7 @@ int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
         } else if (ret == -1)
             return -1;
         if (aux && (aux->flags & ASN1_AFLG_BROKEN)) {
-            len = tmplen - (p - *in);
+            len = tmplen - (long)(p - *in);
             seq_nolen = 1;
         }
         /* If indefinite we don't do a length check */
@@ -427,7 +427,7 @@ int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
                     ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
                     goto err;
                 }
-                len -= p - q;
+                len -= (long)(p - q);
                 seq_eoc = 0;
                 break;
             }
@@ -458,7 +458,7 @@ int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
                 continue;
             }
             /* Update length */
-            len -= p - q;
+            len -= (long)(p - q);
         }

         /* Check for EOC if expecting one */
@@ -493,7 +493,7 @@ int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
             }
         }
         /* Save encoding */
-        if (!ossl_asn1_enc_save(pval, *in, p - *in, it))
+        if (!ossl_asn1_enc_save(pval, *in, (long)(p - *in), it))
             goto auxerr;
         if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
             goto auxerr;
@@ -564,7 +564,7 @@ static int asn1_template_ex_d2i(ASN1_VALUE **val,
             return 0;
         }
         /* We read the field in OK so update length */
-        len -= p - q;
+        len -= (long)(p - q);
         if (exp_eoc) {
             /* If NDEF we must have an EOC here */
             if (!asn1_check_eoc(&p, len)) {
@@ -669,7 +669,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
                     ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
                     goto err;
                 }
-                len -= p - q;
+                len -= (long)(p - q);
                 sk_eoc = 0;
                 break;
             }
@@ -683,7 +683,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
                 ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item));
                 goto err;
             }
-            len -= p - q;
+            len -= (long)(p - q);
             if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val, skfield)) {
                 ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
                 ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item));
@@ -802,9 +802,9 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval,
         if (inf) {
             if (!asn1_find_end(&p, plen, inf))
                 goto err;
-            len = p - cont;
+            len = (long)(p - cont);
         } else {
-            len = p - cont + plen;
+            len = (long)(p - cont) + plen;
             p += plen;
         }
     } else if (cst) {
@@ -826,7 +826,7 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval,
         if (!asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL, 0)) {
             goto err;
         }
-        len = buf.length;
+        len = (long)buf.length;
         /* Append a final null to string */
         if (!BUF_MEM_grow_clean(&buf, len + 1)) {
             ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
@@ -983,7 +983,7 @@ static int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, long len,
             ASN1_STRING_set0(stmp, (unsigned char *)cont /* UGLY CAST! */, ilen);
             *free_cont = 0;
         } else {
-            if (!ASN1_STRING_set(stmp, cont, ilen)) {
+            if (!ossl_asn1_string_set1_data(stmp, cont, len)) {
                 ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
                 ASN1_STRING_free(stmp);
                 *pval = NULL;
@@ -1054,7 +1054,7 @@ static int asn1_find_end(const unsigned char **in, long len, char inf)
         } else {
             p += plen;
         }
-        len -= p - q;
+        len -= (long)(p - q);
     }
     if (expected_eoc) {
         ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
@@ -1127,7 +1127,7 @@ static int asn1_collect(BUF_MEM *buf, const unsigned char **in, long len,
                 return 0;
         } else if (plen && !collect_data(buf, &p, plen))
             return 0;
-        len -= p - q;
+        len -= (long)(p - q);
     }
     if (inf) {
         ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
@@ -1139,9 +1139,14 @@ static int asn1_collect(BUF_MEM *buf, const unsigned char **in, long len,

 static int collect_data(BUF_MEM *buf, const unsigned char **p, long plen)
 {
-    int len;
+    long len;
     if (buf) {
-        len = buf->length;
+        len = (long)buf->length;
+        if (len + plen < 0) {
+            /* resulting buffer length will not fit into long */
+            ERR_raise(ERR_LIB_ASN1, ASN1_R_LENGTH_TOO_LONG);
+            return 0;
+        }
         if (!BUF_MEM_grow_clean(buf, len + plen)) {
             ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
             return 0;
@@ -1204,7 +1209,7 @@ static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass,
             ctx->plen = plen;
             ctx->pclass = pclass;
             ctx->ptag = ptag;
-            ctx->hdrlen = p - q;
+            ctx->hdrlen = (int)(p - q);
             ctx->valid = 1;
             /*
              * If definite length, and no error, length + header can't exceed
@@ -1239,7 +1244,7 @@ static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass,
     }

     if ((i & 1) != 0)
-        plen = len - (p - q);
+        plen = len - (long)(p - q);

     if (inf != NULL)
         *inf = i & 1;
diff --git a/deps/openssl/openssl/crypto/asn1/tasn_enc.c b/deps/openssl/openssl/crypto/asn1/tasn_enc.c
index 8dea9f36539..3307392a84e 100644
--- a/deps/openssl/openssl/crypto/asn1/tasn_enc.c
+++ b/deps/openssl/openssl/crypto/asn1/tasn_enc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -57,7 +57,7 @@ static int asn1_item_flags_i2d(const ASN1_VALUE *val, unsigned char **out,
 {
     if (out != NULL && *out == NULL) {
         unsigned char *p, *buf;
-        int len;
+        int len, outlen;

         len = ASN1_item_ex_i2d(&val, NULL, it, -1, flags);
         if (len <= 0)
@@ -65,7 +65,11 @@ static int asn1_item_flags_i2d(const ASN1_VALUE *val, unsigned char **out,
         if ((buf = OPENSSL_malloc(len)) == NULL)
             return -1;
         p = buf;
-        ASN1_item_ex_i2d(&val, &p, it, -1, flags);
+        outlen = ASN1_item_ex_i2d(&val, &p, it, -1, flags);
+        if (outlen != len || p != buf + len) {
+            OPENSSL_free(buf);
+            return -1;
+        }
         *out = buf;
         return len;
     }
@@ -85,16 +89,10 @@ int ASN1_item_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
     int i, seqcontlen, seqlen, ndef = 1;
     const ASN1_EXTERN_FUNCS *ef;
     const ASN1_AUX *aux = it->funcs;
-    ASN1_aux_const_cb *asn1_cb = NULL;

     if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
         return 0;

-    if (aux != NULL) {
-        asn1_cb = ((aux->flags & ASN1_AFLG_CONST_CB) != 0) ? aux->asn1_const_cb
-                                                           : (ASN1_aux_const_cb *)aux->asn1_cb; /* backward compatibility */
-    }
-
     switch (it->itype) {

     case ASN1_ITYPE_PRIMITIVE:
@@ -123,7 +121,7 @@ int ASN1_item_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
             ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE);
             return -1;
         }
-        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
+        if (!ossl_asn1_call_aux_cb(aux, ASN1_OP_I2D_PRE, pval, it, NULL))
             return 0;
         i = ossl_asn1_get_choice_selector_const(pval, it);
         if ((i >= 0) && (i < it->tcount)) {
@@ -134,7 +132,7 @@ int ASN1_item_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
             return asn1_template_ex_i2d(pchval, out, chtt, -1, aclass);
         }
         /* Fixme: error condition if selector out of range */
-        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL))
+        if (!ossl_asn1_call_aux_cb(aux, ASN1_OP_I2D_POST, pval, it, NULL))
             return 0;
         break;

@@ -166,7 +164,7 @@ int ASN1_item_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
             aclass = (aclass & ~ASN1_TFLG_TAG_CLASS)
                 | V_ASN1_UNIVERSAL;
         }
-        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
+        if (!ossl_asn1_call_aux_cb(aux, ASN1_OP_I2D_PRE, pval, it, NULL))
             return 0;
         /* First work out sequence content length */
         for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
@@ -178,7 +176,7 @@ int ASN1_item_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
                 return 0;
             pseqval = ossl_asn1_get_const_field_ptr(pval, seqtt);
             tmplen = asn1_template_ex_i2d(pseqval, NULL, seqtt, -1, aclass);
-            if (tmplen == -1 || (tmplen > INT_MAX - seqcontlen))
+            if (tmplen < 0 || (tmplen > INT_MAX - seqcontlen))
                 return -1;
             seqcontlen += tmplen;
         }
@@ -191,16 +189,19 @@ int ASN1_item_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
         for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
             const ASN1_TEMPLATE *seqtt;
             const ASN1_VALUE **pseqval;
+            int tmplen;
+
             seqtt = ossl_asn1_do_adb(*pval, tt, 1);
             if (!seqtt)
                 return 0;
             pseqval = ossl_asn1_get_const_field_ptr(pval, seqtt);
-            /* FIXME: check for errors in enhanced version */
-            asn1_template_ex_i2d(pseqval, out, seqtt, -1, aclass);
+            tmplen = asn1_template_ex_i2d(pseqval, out, seqtt, -1, aclass);
+            if (tmplen < 0)
+                return -1;
         }
         if (ndef == 2)
             ASN1_put_eoc(out);
-        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL))
+        if (!ossl_asn1_call_aux_cb(aux, ASN1_OP_I2D_POST, pval, it, NULL))
             return 0;
         return seqlen;

@@ -216,6 +217,7 @@ static int asn1_template_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
     const int flags = tt->flags;
     int i, ret, ttag, tclass, ndef, len;
     const ASN1_VALUE *tval;
+    unsigned char *p;

     /*
      * If field is embedded then val needs fixing so it is a pointer to
@@ -303,7 +305,7 @@ static int asn1_template_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
             skitem = sk_const_ASN1_VALUE_value(sk, i);
             len = ASN1_item_ex_i2d(&skitem, NULL, ASN1_ITEM_ptr(tt->item),
                 -1, iclass);
-            if (len == -1 || (skcontlen > INT_MAX - len))
+            if (len < 0 || (skcontlen > INT_MAX - len))
                 return -1;
             if (len == 0 && (tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
                 ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
@@ -330,8 +332,9 @@ static int asn1_template_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
         /* SET or SEQUENCE and IMPLICIT tag */
         ASN1_put_object(out, ndef, skcontlen, sktag, skaclass);
         /* And the stuff itself */
-        asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item),
-            isset, iclass);
+        if (!asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item),
+                isset, iclass))
+            return -1;
         if (ndef == 2) {
             ASN1_put_eoc(out);
             if (flags & ASN1_TFLG_EXPTAG)
@@ -345,6 +348,8 @@ static int asn1_template_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
         /* EXPLICIT tagging */
         /* Find length of tagged item */
         i = ASN1_item_ex_i2d(pval, NULL, ASN1_ITEM_ptr(tt->item), -1, iclass);
+        if (i < 0)
+            return -1;
         if (i == 0) {
             if ((tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
                 ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
@@ -357,7 +362,11 @@ static int asn1_template_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
         if (out && ret != -1) {
             /* Output tag and item */
             ASN1_put_object(out, ndef, i, ttag, tclass);
-            ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, iclass);
+            p = *out;
+            len = ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1,
+                iclass);
+            if (len != i || *out != p + i)
+                return -1;
             if (ndef == 2)
                 ASN1_put_eoc(out);
         }
@@ -423,7 +432,8 @@ static int asn1_set_seq_out(STACK_OF(const_ASN1_VALUE) *sk,
     if (!do_sort) {
         for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) {
             skitem = sk_const_ASN1_VALUE_value(sk, i);
-            ASN1_item_ex_i2d(&skitem, out, item, -1, iclass);
+            if (ASN1_item_ex_i2d(&skitem, out, item, -1, iclass) <= 0)
+                return 0;
         }
         return 1;
     }
@@ -434,6 +444,8 @@ static int asn1_set_seq_out(STACK_OF(const_ASN1_VALUE) *sk,
         skitem = sk_const_ASN1_VALUE_value(sk, i);
         tder->data = p;
         tder->length = ASN1_item_ex_i2d(&skitem, &p, item, -1, iclass);
+        if (tder->length <= 0)
+            goto err;
         tder->field = skitem;
     }

@@ -590,7 +602,7 @@ static int asn1_ex_i2c(const ASN1_VALUE **pval, unsigned char *cout, int *putype
         break;

     case V_ASN1_BIT_STRING:
-        return ossl_i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval,
+        return ossl_i2c_ASN1_BIT_STRING((const ASN1_BIT_STRING *)*pval,
             cout ? &cout : NULL);

     case V_ASN1_INTEGER:
diff --git a/deps/openssl/openssl/crypto/asn1/tasn_fre.c b/deps/openssl/openssl/crypto/asn1/tasn_fre.c
index f8068832ab6..711435dea26 100644
--- a/deps/openssl/openssl/crypto/asn1/tasn_fre.c
+++ b/deps/openssl/openssl/crypto/asn1/tasn_fre.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -205,7 +205,7 @@ void ossl_asn1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed)
         break;

     default:
-        ossl_asn1_string_embed_free((ASN1_STRING *)*pval, embed);
+        ossl_asn1_string_free_internal((ASN1_STRING *)*pval, 0, embed);
         break;
     }
     *pval = NULL;
diff --git a/deps/openssl/openssl/crypto/asn1/tasn_prn.c b/deps/openssl/openssl/crypto/asn1/tasn_prn.c
index 080b5623e42..1cc548650b6 100644
--- a/deps/openssl/openssl/crypto/asn1/tasn_prn.c
+++ b/deps/openssl/openssl/crypto/asn1/tasn_prn.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -138,15 +138,12 @@ static int asn1_item_print_ctx(BIO *out, const ASN1_VALUE **fld, int indent,
     const ASN1_EXTERN_FUNCS *ef;
     const ASN1_VALUE **tmpfld;
     const ASN1_AUX *aux = it->funcs;
-    ASN1_aux_const_cb *asn1_cb = NULL;
     ASN1_PRINT_ARG parg;
     int i;
     if (aux != NULL) {
         parg.out = out;
         parg.indent = indent;
         parg.pctx = pctx;
-        asn1_cb = ((aux->flags & ASN1_AFLG_CONST_CB) != 0) ? aux->asn1_const_cb
-                                                           : (ASN1_aux_const_cb *)aux->asn1_cb; /* backward compatibility */
     }

     if (((it->itype != ASN1_ITYPE_PRIMITIVE)
@@ -220,13 +217,11 @@ static int asn1_item_print_ctx(BIO *out, const ASN1_VALUE **fld, int indent,
             }
         }

-        if (asn1_cb) {
-            i = asn1_cb(ASN1_OP_PRINT_PRE, fld, it, &parg);
-            if (i == 0)
-                return 0;
-            if (i == 2)
-                return 1;
-        }
+        i = ossl_asn1_call_aux_cb(aux, ASN1_OP_PRINT_PRE, fld, it, &parg);
+        if (i == 0)
+            return 0;
+        if (i == 2)
+            return 1;

         /* Print each field entry */
         for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
@@ -244,11 +239,9 @@ static int asn1_item_print_ctx(BIO *out, const ASN1_VALUE **fld, int indent,
                 return 0;
         }

-        if (asn1_cb) {
-            i = asn1_cb(ASN1_OP_PRINT_POST, fld, it, &parg);
-            if (i == 0)
-                return 0;
-        }
+        i = ossl_asn1_call_aux_cb(aux, ASN1_OP_PRINT_POST, fld, it, &parg);
+        if (i == 0)
+            return 0;
         break;

     default:
diff --git a/deps/openssl/openssl/crypto/asn1/tasn_typ.c b/deps/openssl/openssl/crypto/asn1/tasn_typ.c
index 0e25b75b9f0..20d17fc914a 100644
--- a/deps/openssl/openssl/crypto/asn1/tasn_typ.c
+++ b/deps/openssl/openssl/crypto/asn1/tasn_typ.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,8 @@
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>

+#include <crypto/asn1.h>
+
 /* Declarations for string types */

 #define IMPLEMENT_ASN1_STRING_FUNCTIONS(sname)                 \
diff --git a/deps/openssl/openssl/crypto/asn1/tasn_utl.c b/deps/openssl/openssl/crypto/asn1/tasn_utl.c
index 48a1f36de87..ab1bb67b304 100644
--- a/deps/openssl/openssl/crypto/asn1/tasn_utl.c
+++ b/deps/openssl/openssl/crypto/asn1/tasn_utl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -161,7 +161,7 @@ void ossl_asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
     }
 }

-int ossl_asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen,
+int ossl_asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, long inlen,
     const ASN1_ITEM *it)
 {
     ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
@@ -170,8 +170,10 @@ int ossl_asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen,
         return 1;

     OPENSSL_free(enc->enc);
-    if (inlen <= 0)
+    if (inlen <= 0) {
+        enc->enc = NULL;
         return 0;
+    }
     if ((enc->enc = OPENSSL_malloc(inlen)) == NULL)
         return 0;
     memcpy(enc->enc, in, inlen);
@@ -286,3 +288,19 @@ err:
         ERR_raise(ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE);
     return NULL;
 }
+
+int ossl_asn1_call_aux_cb(const ASN1_AUX *aux, int operation,
+    const ASN1_VALUE **in, const ASN1_ITEM *it, void *exarg)
+{
+    if (aux == NULL)
+        return 1;
+
+    if ((aux->flags & ASN1_AFLG_CONST_CB) != 0) {
+        if (aux->asn1_const_cb != NULL)
+            return aux->asn1_const_cb(operation, in, it, exarg);
+    } else if (aux->asn1_cb != NULL) {
+        return aux->asn1_cb(operation, (ASN1_VALUE **)in, it, exarg);
+    }
+
+    return 1;
+}
diff --git a/deps/openssl/openssl/crypto/asn1/tbl_standard.h b/deps/openssl/openssl/crypto/asn1/tbl_standard.h
index da9c299bed8..e08f3cd7611 100644
--- a/deps/openssl/openssl/crypto/asn1/tbl_standard.h
+++ b/deps/openssl/openssl/crypto/asn1/tbl_standard.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_ASN1_TBL_STANDARD_H)
+#define OSSL_LIBCRYPTO_ASN1_TBL_STANDARD_H
+
 /* size limits: this stuff is taken straight from RFC3280 */

+#include <openssl/asn1.h>
+#include <openssl/obj_mac.h>
+
 #define ub_name 32768
 #define ub_common_name 64
 #define ub_locality_name 128
@@ -59,3 +65,5 @@ static const ASN1_STRING_TABLE tbl_standard[] = {
     { NID_dnsName, 0, -1, B_ASN1_UTF8STRING, STABLE_NO_MASK },
     { NID_id_on_SmtpUTF8Mailbox, 1, ub_email_address, B_ASN1_UTF8STRING, STABLE_NO_MASK }
 };
+
+#endif /* !defined(OSSL_LIBCRYPTO_ASN1_TBL_STANDARD_H) */
diff --git a/deps/openssl/openssl/crypto/asn1/x_algor.c b/deps/openssl/openssl/crypto/asn1/x_algor.c
index f8faf7209b1..4d7e5f6a0a2 100644
--- a/deps/openssl/openssl/crypto/asn1/x_algor.c
+++ b/deps/openssl/openssl/crypto/asn1/x_algor.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1998-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -85,12 +85,27 @@ void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype,
 }

 /* Set up an X509_ALGOR DigestAlgorithmIdentifier from an EVP_MD */
-void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md)
+int X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md)
 {
-    int type = md->flags & EVP_MD_FLAG_DIGALGID_ABSENT ? V_ASN1_UNDEF
-                                                       : V_ASN1_NULL;
+    int type, md_type;
+    ASN1_OBJECT *obj;

-    (void)X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_get_type(md)), type, NULL);
+    if (alg == NULL || md == NULL)
+        return 0;
+
+    type = md->flags & EVP_MD_FLAG_DIGALGID_ABSENT ? V_ASN1_UNDEF
+                                                   : V_ASN1_NULL;
+    md_type = EVP_MD_type(md);
+
+    obj = (md_type == NID_undef) ? OBJ_txt2obj(EVP_MD_get0_name(md), 0)
+                                 : OBJ_nid2obj(md_type);
+    if (obj == NULL)
+        return 0;
+    if (!X509_ALGOR_set0(alg, obj, type, NULL)) {
+        ASN1_OBJECT_free(obj);
+        return 0;
+    }
+    return 1;
 }

 int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b)
@@ -148,7 +163,10 @@ int ossl_x509_algor_new_from_md(X509_ALGOR **palg, const EVP_MD *md)
         return 1;
     if ((alg = X509_ALGOR_new()) == NULL)
         return 0;
-    X509_ALGOR_set_md(alg, md);
+    if (!X509_ALGOR_set_md(alg, md)) {
+        X509_ALGOR_free(alg);
+        return 0;
+    }
     *palg = alg;
     return 1;
 }
diff --git a/deps/openssl/openssl/crypto/asn1/x_bignum.c b/deps/openssl/openssl/crypto/asn1/x_bignum.c
index efa2ade30fa..aff286a563a 100644
--- a/deps/openssl/openssl/crypto/asn1/x_bignum.c
+++ b/deps/openssl/openssl/crypto/asn1/x_bignum.c
@@ -114,13 +114,21 @@ static int bn_i2c(const ASN1_VALUE **pval, unsigned char *cont, int *putype,
 static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
     int utype, char *free_cont, const ASN1_ITEM *it)
 {
+    int allocated = 0;
     BIGNUM *bn;

-    if (*pval == NULL && !bn_new(pval, it))
+    /* Reject encodings that imply a negative number. */
+    if (len == 0 || (*cont & 0x80) != 0) {
+        ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_VALUE);
+        return 0;
+    }
+
+    if (*pval == NULL && (allocated = bn_new(pval, it)) == 0)
         return 0;
     bn = (BIGNUM *)*pval;
     if (!BN_bin2bn(cont, len, bn)) {
-        bn_free(pval, it);
+        if (allocated != 0)
+            bn_free(pval, it);
         return 0;
     }
     return 1;
@@ -129,15 +137,19 @@ static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
 static int bn_secure_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
     int utype, char *free_cont, const ASN1_ITEM *it)
 {
-    int ret;
+    int ret, allocated = 0;
     BIGNUM *bn;

-    if (*pval == NULL && !bn_secure_new(pval, it))
+    if (*pval == NULL && (allocated = bn_secure_new(pval, it)) == 0)
         return 0;

     ret = bn_c2i(pval, cont, len, utype, free_cont, it);
-    if (!ret)
+    if (!ret) {
+        if (allocated != 0)
+            bn_free(pval, it);
+
         return 0;
+    }

     /* Set constant-time flag for all secure BIGNUMS */
     bn = (BIGNUM *)*pval;
diff --git a/deps/openssl/openssl/crypto/asn1/x_int64.c b/deps/openssl/openssl/crypto/asn1/x_int64.c
index f7cd7cbd95e..715e9fad42c 100644
--- a/deps/openssl/openssl/crypto/asn1/x_int64.c
+++ b/deps/openssl/openssl/crypto/asn1/x_int64.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -8,6 +8,7 @@
  */

 #include <stdio.h>
+#include <inttypes.h>
 #include "internal/cryptlib.h"
 #include "internal/numbers.h"
 #include <openssl/asn1t.h>
@@ -113,8 +114,8 @@ static int uint64_print(BIO *out, const ASN1_VALUE **pval, const ASN1_ITEM *it,
     int indent, const ASN1_PCTX *pctx)
 {
     if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED)
-        return BIO_printf(out, "%jd\n", **(int64_t **)pval);
-    return BIO_printf(out, "%ju\n", **(uint64_t **)pval);
+        return BIO_printf(out, "%" PRId64 "\n", **(int64_t **)pval);
+    return BIO_printf(out, "%" PRIu64 "\n", **(uint64_t **)pval);
 }

 /* 32-bit variants */
diff --git a/deps/openssl/openssl/crypto/async/arch/async_null.h b/deps/openssl/openssl/crypto/async/arch/async_null.h
deleted file mode 100644
index 6be0b96f9e6..00000000000
--- a/deps/openssl/openssl/crypto/async/arch/async_null.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/async.h>
-
-/*
- * If we haven't managed to detect any other async architecture then we default
- * to NULL.
- */
-#ifndef ASYNC_ARCH
-#define ASYNC_NULL
-#define ASYNC_ARCH
-
-typedef struct async_fibre_st {
-    int dummy;
-} async_fibre;
-
-#define async_fibre_swapcontext(o, n, r) 0
-#define async_fibre_makecontext(c) 0
-#define async_fibre_free(f)
-#define async_fibre_init_dispatcher(f)
-#define async_local_init() 1
-#define async_local_deinit()
-
-#endif
diff --git a/deps/openssl/openssl/crypto/async/arch/async_posix.c b/deps/openssl/openssl/crypto/async/arch/async_posix.c
index 46e2ce7559c..4f6db7e5be3 100644
--- a/deps/openssl/openssl/crypto/async/arch/async_posix.c
+++ b/deps/openssl/openssl/crypto/async/arch/async_posix.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -116,7 +116,11 @@ int async_fibre_makecontext(async_fibre *fibre)
         if (fibre->fibre.uc_stack.ss_sp != NULL) {
             fibre->fibre.uc_stack.ss_size = num;
             fibre->fibre.uc_link = NULL;
+#ifndef __e2k__
             makecontext(&fibre->fibre, async_start_func, 0);
+#else
+            makecontext_e2k(&fibre->fibre, async_start_func, 0);
+#endif
             return 1;
         }
     } else {
@@ -129,6 +133,9 @@ void async_fibre_free(async_fibre *fibre)
 {
     stack_free_impl(fibre->fibre.uc_stack.ss_sp);
     fibre->fibre.uc_stack.ss_sp = NULL;
+#ifdef __e2k__
+    freecontext_e2k(&fibre->fibre);
+#endif
 }

 #endif
diff --git a/deps/openssl/openssl/crypto/async/arch/async_posix.h b/deps/openssl/openssl/crypto/async/arch/async_posix.h
deleted file mode 100644
index 449ca27d222..00000000000
--- a/deps/openssl/openssl/crypto/async/arch/async_posix.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_ASYNC_POSIX_H
-#define OSSL_CRYPTO_ASYNC_POSIX_H
-#include <openssl/e_os2.h>
-
-#if defined(OPENSSL_SYS_UNIX)                                 \
-    && defined(OPENSSL_THREADS) && !defined(OPENSSL_NO_ASYNC) \
-    && !defined(__ANDROID__) && !defined(__OpenBSD__)         \
-    && !defined(OPENSSL_SYS_TANDEM)
-
-#include <unistd.h>
-
-#if _POSIX_VERSION >= 200112L \
-    && (_POSIX_VERSION < 200809L || defined(__GLIBC__) || defined(__FreeBSD__))
-
-#include <pthread.h>
-
-#define ASYNC_POSIX
-#define ASYNC_ARCH
-
-#if defined(__CET__) || defined(__ia64__)
-/*
- * When Intel CET is enabled, makecontext will create a different
- * shadow stack for each context.  async_fibre_swapcontext cannot
- * use _longjmp.  It must call swapcontext to swap shadow stack as
- * well as normal stack.
- * On IA64 the register stack engine is not saved across setjmp/longjmp. Here
- * swapcontext() performs correctly.
- */
-#define USE_SWAPCONTEXT
-#endif
-#if defined(__aarch64__) && defined(__clang__) \
-    && defined(__ARM_FEATURE_BTI_DEFAULT) && __ARM_FEATURE_BTI_DEFAULT == 1
-/*
- * setjmp/longjmp don't currently work with BTI on all libc implementations
- * when compiled by clang. This is because clang doesn't put a BTI after the
- * call to setjmp where it returns the second time. This then fails on libc
- * implementations - notably glibc - which use an indirect jump to there.
- * So use the swapcontext implementation, which does work.
- * See https://github.com/llvm/llvm-project/issues/48888.
- */
-#define USE_SWAPCONTEXT
-#endif
-#if defined(OPENSSL_SYS_TANDEM)
-#include <tdmsig.h>
-#else
-#include <ucontext.h>
-#endif
-#ifndef USE_SWAPCONTEXT
-#include <setjmp.h>
-#endif
-
-typedef struct async_fibre_st {
-    ucontext_t fibre;
-#ifndef USE_SWAPCONTEXT
-    jmp_buf env;
-    int env_init;
-#endif
-} async_fibre;
-
-int async_local_init(void);
-void async_local_deinit(void);
-
-static ossl_inline int async_fibre_swapcontext(async_fibre *o, async_fibre *n, int r)
-{
-#ifdef USE_SWAPCONTEXT
-    swapcontext(&o->fibre, &n->fibre);
-#else
-    o->env_init = 1;
-
-    if (!r || !_setjmp(o->env)) {
-        if (n->env_init)
-            _longjmp(n->env, 1);
-        else
-            setcontext(&n->fibre);
-    }
-#endif
-
-    return 1;
-}
-
-#define async_fibre_init_dispatcher(d)
-
-int async_fibre_makecontext(async_fibre *fibre);
-void async_fibre_free(async_fibre *fibre);
-
-#endif
-#endif
-#endif /* OSSL_CRYPTO_ASYNC_POSIX_H */
diff --git a/deps/openssl/openssl/crypto/async/arch/async_win.c b/deps/openssl/openssl/crypto/async/arch/async_win.c
index 849da5c3c41..67137ce7f51 100644
--- a/deps/openssl/openssl/crypto/async/arch/async_win.c
+++ b/deps/openssl/openssl/crypto/async/arch/async_win.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,7 +12,7 @@

 #ifdef ASYNC_WIN

-#include <windows.h>
+#include "internal/e_os.h"
 #include "internal/cryptlib.h"

 int ASYNC_is_capable(void)
diff --git a/deps/openssl/openssl/crypto/async/arch/async_win.h b/deps/openssl/openssl/crypto/async/arch/async_win.h
deleted file mode 100644
index ef134f53ab2..00000000000
--- a/deps/openssl/openssl/crypto/async/arch/async_win.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * This is the same detection used in cryptlib to set up the thread local
- * storage that we depend on, so just copy that
- */
-#if defined(_WIN32) && !defined(OPENSSL_NO_ASYNC)
-#include <openssl/async.h>
-#define ASYNC_WIN
-#define ASYNC_ARCH
-
-#include <windows.h>
-#include "internal/cryptlib.h"
-
-typedef struct async_fibre_st {
-    LPVOID fibre;
-    int converted;
-} async_fibre;
-
-#define async_fibre_swapcontext(o, n, r) \
-    (SwitchToFiber((n)->fibre), 1)
-
-#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600
-#define async_fibre_makecontext(c)                             \
-    ((c)->fibre = CreateFiberEx(0, 0, FIBER_FLAG_FLOAT_SWITCH, \
-         async_start_func_win, 0))
-#else
-#define async_fibre_makecontext(c) \
-    ((c)->fibre = CreateFiber(0, async_start_func_win, 0))
-#endif
-
-#define async_fibre_free(f) (DeleteFiber((f)->fibre))
-#define async_local_init() 1
-#define async_local_deinit()
-
-int async_fibre_init_dispatcher(async_fibre *fibre);
-VOID CALLBACK async_start_func_win(PVOID unused);
-
-#endif
diff --git a/deps/openssl/openssl/crypto/async/async.c b/deps/openssl/openssl/crypto/async/async.c
index dfd7a14a0b2..45853903428 100644
--- a/deps/openssl/openssl/crypto/async/async.c
+++ b/deps/openssl/openssl/crypto/async/async.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,6 +17,7 @@

 /* This must be the first #include file */
 #include "async_local.h"
+#include "internal/threads_common.h"

 #include <openssl/err.h>
 #include "crypto/cryptlib.h"
@@ -27,9 +28,6 @@
 #define ASYNC_JOB_PAUSED 2
 #define ASYNC_JOB_STOPPING 3

-static CRYPTO_THREAD_LOCAL ctxkey;
-static CRYPTO_THREAD_LOCAL poolkey;
-
 static void async_delete_thread_state(void *arg);

 static async_ctx *async_ctx_new(void)
@@ -46,7 +44,8 @@ static async_ctx *async_ctx_new(void)
     async_fibre_init_dispatcher(&nctx->dispatcher);
     nctx->currjob = NULL;
     nctx->blocked = 0;
-    if (!CRYPTO_THREAD_set_local(&ctxkey, nctx))
+    if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ASYNC_CTX_KEY,
+            CRYPTO_THREAD_NO_CONTEXT, nctx))
         goto err;

     return nctx;
@@ -58,7 +57,8 @@ err:

 async_ctx *async_get_ctx(void)
 {
-    return (async_ctx *)CRYPTO_THREAD_get_local(&ctxkey);
+    return (async_ctx *)CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_ASYNC_CTX_KEY,
+        CRYPTO_THREAD_NO_CONTEXT);
 }

 static int async_ctx_free(void)
@@ -67,7 +67,8 @@ static int async_ctx_free(void)

     ctx = async_get_ctx();

-    if (!CRYPTO_THREAD_set_local(&ctxkey, NULL))
+    if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ASYNC_CTX_KEY,
+            CRYPTO_THREAD_NO_CONTEXT, NULL))
         return 0;

     OPENSSL_free(ctx);
@@ -102,7 +103,8 @@ static ASYNC_JOB *async_get_pool_job(void)
     ASYNC_JOB *job;
     async_pool *pool;

-    pool = (async_pool *)CRYPTO_THREAD_get_local(&poolkey);
+    pool = (async_pool *)CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_ASYNC_POOL_KEY,
+        CRYPTO_THREAD_NO_CONTEXT);
     if (pool == NULL) {
         /*
          * Pool has not been initialised, so init with the defaults, i.e.
@@ -110,7 +112,8 @@ static ASYNC_JOB *async_get_pool_job(void)
          */
         if (ASYNC_init_thread(0, 0) == 0)
             return NULL;
-        pool = (async_pool *)CRYPTO_THREAD_get_local(&poolkey);
+        pool = (async_pool *)CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_ASYNC_POOL_KEY,
+            CRYPTO_THREAD_NO_CONTEXT);
     }

     job = sk_ASYNC_JOB_pop(pool->jobs);
@@ -135,7 +138,8 @@ static void async_release_job(ASYNC_JOB *job)
 {
     async_pool *pool;

-    pool = (async_pool *)CRYPTO_THREAD_get_local(&poolkey);
+    pool = (async_pool *)CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_ASYNC_POOL_KEY,
+        CRYPTO_THREAD_NO_CONTEXT);
     if (pool == NULL) {
         ERR_raise(ERR_LIB_ASYNC, ERR_R_INTERNAL_ERROR);
         return;
@@ -330,21 +334,11 @@ static void async_empty_pool(async_pool *pool)

 int async_init(void)
 {
-    if (!CRYPTO_THREAD_init_local(&ctxkey, NULL))
-        return 0;
-
-    if (!CRYPTO_THREAD_init_local(&poolkey, NULL)) {
-        CRYPTO_THREAD_cleanup_local(&ctxkey);
-        return 0;
-    }
-
     return async_local_init();
 }

 void async_deinit(void)
 {
-    CRYPTO_THREAD_cleanup_local(&ctxkey);
-    CRYPTO_THREAD_cleanup_local(&poolkey);
     async_local_deinit();
 }

@@ -353,7 +347,7 @@ int ASYNC_init_thread(size_t max_size, size_t init_size)
     async_pool *pool;
     size_t curr_size = 0;

-    if (init_size > max_size) {
+    if (init_size > max_size || max_size > INT_MAX) {
         ERR_raise(ERR_LIB_ASYNC, ASYNC_R_INVALID_POOL_SIZE);
         return 0;
     }
@@ -368,7 +362,7 @@ int ASYNC_init_thread(size_t max_size, size_t init_size)
     if (pool == NULL)
         return 0;

-    pool->jobs = sk_ASYNC_JOB_new_reserve(NULL, init_size);
+    pool->jobs = sk_ASYNC_JOB_new_reserve(NULL, (int)init_size);
     if (pool->jobs == NULL) {
         ERR_raise(ERR_LIB_ASYNC, ERR_R_CRYPTO_LIB);
         OPENSSL_free(pool);
@@ -394,7 +388,8 @@ int ASYNC_init_thread(size_t max_size, size_t init_size)
         curr_size++;
     }
     pool->curr_size = curr_size;
-    if (!CRYPTO_THREAD_set_local(&poolkey, pool)) {
+    if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ASYNC_POOL_KEY,
+            CRYPTO_THREAD_NO_CONTEXT, pool)) {
         ERR_raise(ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SET_POOL);
         goto err;
     }
@@ -409,13 +404,15 @@ err:

 static void async_delete_thread_state(void *arg)
 {
-    async_pool *pool = (async_pool *)CRYPTO_THREAD_get_local(&poolkey);
+    async_pool *pool = (async_pool *)CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_ASYNC_POOL_KEY,
+        CRYPTO_THREAD_NO_CONTEXT);

     if (pool != NULL) {
         async_empty_pool(pool);
         sk_ASYNC_JOB_free(pool->jobs);
         OPENSSL_free(pool);
-        CRYPTO_THREAD_set_local(&poolkey, NULL);
+        CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ASYNC_POOL_KEY,
+            CRYPTO_THREAD_NO_CONTEXT, NULL);
     }
     async_local_cleanup();
     async_ctx_free();
diff --git a/deps/openssl/openssl/crypto/async/async_err.c b/deps/openssl/openssl/crypto/async/async_err.c
deleted file mode 100644
index 1e28eb78234..00000000000
--- a/deps/openssl/openssl/crypto/async/async_err.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/asyncerr.h>
-#include "crypto/asyncerr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA ASYNC_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_ASYNC, 0, ASYNC_R_FAILED_TO_SET_POOL),
-        "failed to set pool" },
-    { ERR_PACK(ERR_LIB_ASYNC, 0, ASYNC_R_FAILED_TO_SWAP_CONTEXT),
-        "failed to swap context" },
-    { ERR_PACK(ERR_LIB_ASYNC, 0, ASYNC_R_INIT_FAILED), "init failed" },
-    { ERR_PACK(ERR_LIB_ASYNC, 0, ASYNC_R_INVALID_POOL_SIZE),
-        "invalid pool size" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_ASYNC_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(ASYNC_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(ASYNC_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/async/async_local.h b/deps/openssl/openssl/crypto/async/async_local.h
index 9690adbb1e9..ce9e082fb85 100644
--- a/deps/openssl/openssl/crypto/async/async_local.h
+++ b/deps/openssl/openssl/crypto/async/async_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,24 +11,150 @@
  * Must do this before including any header files, because on MacOS/X <stlib.h>
  * includes <signal.h> which includes <ucontext.h>
  */
+#if !defined(OSSL_LIBCRYPTO_ASYNC_ASYNC_LOCAL_H)
+#define OSSL_LIBCRYPTO_ASYNC_ASYNC_LOCAL_H
+
 #if defined(__APPLE__) && defined(__MACH__) && !defined(_XOPEN_SOURCE)
 #define _XOPEN_SOURCE /* Otherwise incomplete ucontext_t structure */
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif

-#if defined(_WIN32)
-#include <windows.h>
-#endif
-
-#include "crypto/async.h"
 #include <openssl/crypto.h>
+#include <openssl/e_os2.h>
+#include <internal/e_os.h>

 typedef struct async_ctx_st async_ctx;
 typedef struct async_pool_st async_pool;

-#include "arch/async_win.h"
-#include "arch/async_posix.h"
-#include "arch/async_null.h"
+#if defined(_WIN32)
+#define ASYNC_WIN
+#define ASYNC_ARCH
+
+#include "internal/cryptlib.h"
+
+typedef struct async_fibre_st {
+    LPVOID fibre;
+    int converted;
+} async_fibre;
+
+#define async_fibre_swapcontext(o, n, r) \
+    (SwitchToFiber((n)->fibre), 1)
+
+#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600
+#define async_fibre_makecontext(c)                             \
+    ((c)->fibre = CreateFiberEx(0, 0, FIBER_FLAG_FLOAT_SWITCH, \
+         async_start_func_win, 0))
+#else
+#define async_fibre_makecontext(c) \
+    ((c)->fibre = CreateFiber(0, async_start_func_win, 0))
+#endif
+
+#define async_fibre_free(f) (DeleteFiber((f)->fibre))
+#define async_local_init() 1
+#define async_local_deinit()
+
+int async_fibre_init_dispatcher(async_fibre *fibre);
+VOID CALLBACK async_start_func_win(PVOID unused);
+
+#elif defined(OPENSSL_SYS_UNIX)                               \
+    && defined(OPENSSL_THREADS) && !defined(OPENSSL_NO_ASYNC) \
+    && !defined(__ANDROID__) && !defined(__OpenBSD__)         \
+    && !defined(OPENSSL_SYS_TANDEM)
+
+#include <unistd.h>
+
+#if _POSIX_VERSION >= 200112L \
+    && (_POSIX_VERSION < 200809L || defined(__GLIBC__) || defined(__FreeBSD__))
+
+#include <pthread.h>
+
+#define ASYNC_POSIX
+#define ASYNC_ARCH
+
+#if defined(__CET__) || defined(__ia64__)
+/*
+ * When Intel CET is enabled, makecontext will create a different
+ * shadow stack for each context.  async_fibre_swapcontext cannot
+ * use _longjmp.  It must call swapcontext to swap shadow stack as
+ * well as normal stack.
+ * On IA64 the register stack engine is not saved across setjmp/longjmp. Here
+ * swapcontext() performs correctly.
+ */
+#define USE_SWAPCONTEXT
+#endif
+#if defined(__aarch64__) && defined(__clang__) \
+    && defined(__ARM_FEATURE_BTI_DEFAULT) && __ARM_FEATURE_BTI_DEFAULT == 1
+/*
+ * setjmp/longjmp don't currently work with BTI on all libc implementations
+ * when compiled by clang. This is because clang doesn't put a BTI after the
+ * call to setjmp where it returns the second time. This then fails on libc
+ * implementations - notably glibc - which use an indirect jump to there.
+ * So use the swapcontext implementation, which does work.
+ * See https://github.com/llvm/llvm-project/issues/48888.
+ */
+#define USE_SWAPCONTEXT
+#endif
+#include <ucontext.h>
+#ifndef USE_SWAPCONTEXT
+#include <setjmp.h>
+#endif
+
+typedef struct async_fibre_st {
+    ucontext_t fibre;
+#ifndef USE_SWAPCONTEXT
+    jmp_buf env;
+    int env_init;
+#endif
+} async_fibre;
+
+int async_local_init(void);
+void async_local_deinit(void);
+
+static ossl_inline int async_fibre_swapcontext(async_fibre *o, async_fibre *n, int r)
+{
+#ifdef USE_SWAPCONTEXT
+    swapcontext(&o->fibre, &n->fibre);
+#else
+    o->env_init = 1;
+
+    if (!r || !_setjmp(o->env)) {
+        if (n->env_init)
+            _longjmp(n->env, 1);
+        else
+            setcontext(&n->fibre);
+    }
+#endif
+
+    return 1;
+}
+
+#define async_fibre_init_dispatcher(d)
+
+int async_fibre_makecontext(async_fibre *fibre);
+void async_fibre_free(async_fibre *fibre);
+
+#endif
+#endif /* UNIX */
+
+#ifndef ASYNC_ARCH
+#define ASYNC_NULL
+#define ASYNC_ARCH
+
+typedef struct async_fibre_st {
+    int dummy;
+} async_fibre;
+
+#define async_fibre_swapcontext(o, n, r) 0
+#define async_fibre_makecontext(c) 0
+#define async_fibre_free(f)
+#define async_fibre_init_dispatcher(f)
+#define async_local_init() 1
+#define async_local_deinit()
+#endif
+
+/* needs to be included after windows.h */
+#include <openssl/async.h>
+#include "crypto/async.h"

 struct async_ctx_st {
     async_fibre dispatcher;
@@ -78,3 +204,5 @@ void async_start_func(void);
 async_ctx *async_get_ctx(void);

 void async_wait_ctx_reset_counts(ASYNC_WAIT_CTX *ctx);
+
+#endif /* !defined(OSSL_LIBCRYPTO_ASYNC_ASYNC_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/bf/bf_local.h b/deps/openssl/openssl/crypto/bf/bf_local.h
index 8634a57ceb7..8185dc6fc36 100644
--- a/deps/openssl/openssl/crypto/bf/bf_local.h
+++ b/deps/openssl/openssl/crypto/bf/bf_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -9,82 +9,9 @@

 #ifndef OSSL_CRYPTO_BF_LOCAL_H
 #define OSSL_CRYPTO_BF_LOCAL_H
-#include <openssl/opensslconf.h>
-
-/* NOTE - c is not incremented as per n2l */
-#define n2ln(c, l1, l2, n)                           \
-    {                                                \
-        c += n;                                      \
-        l1 = l2 = 0;                                 \
-        switch (n) {                                 \
-        case 8:                                      \
-            l2 = ((unsigned long)(*(--(c))));        \
-        /* fall through */                           \
-        case 7:                                      \
-            l2 |= ((unsigned long)(*(--(c)))) << 8;  \
-        /* fall through */                           \
-        case 6:                                      \
-            l2 |= ((unsigned long)(*(--(c)))) << 16; \
-        /* fall through */                           \
-        case 5:                                      \
-            l2 |= ((unsigned long)(*(--(c)))) << 24; \
-        /* fall through */                           \
-        case 4:                                      \
-            l1 = ((unsigned long)(*(--(c))));        \
-        /* fall through */                           \
-        case 3:                                      \
-            l1 |= ((unsigned long)(*(--(c)))) << 8;  \
-        /* fall through */                           \
-        case 2:                                      \
-            l1 |= ((unsigned long)(*(--(c)))) << 16; \
-        /* fall through */                           \
-        case 1:                                      \
-            l1 |= ((unsigned long)(*(--(c)))) << 24; \
-        }                                            \
-    }
-
-/* NOTE - c is not incremented as per l2n */
-#define l2nn(l1, l2, c, n)                                   \
-    {                                                        \
-        c += n;                                              \
-        switch (n) {                                         \
-        case 8:                                              \
-            *(--(c)) = (unsigned char)(((l2)) & 0xff);       \
-        /* fall through */                                   \
-        case 7:                                              \
-            *(--(c)) = (unsigned char)(((l2) >> 8) & 0xff);  \
-        /* fall through */                                   \
-        case 6:                                              \
-            *(--(c)) = (unsigned char)(((l2) >> 16) & 0xff); \
-        /* fall through */                                   \
-        case 5:                                              \
-            *(--(c)) = (unsigned char)(((l2) >> 24) & 0xff); \
-        /* fall through */                                   \
-        case 4:                                              \
-            *(--(c)) = (unsigned char)(((l1)) & 0xff);       \
-        /* fall through */                                   \
-        case 3:                                              \
-            *(--(c)) = (unsigned char)(((l1) >> 8) & 0xff);  \
-        /* fall through */                                   \
-        case 2:                                              \
-            *(--(c)) = (unsigned char)(((l1) >> 16) & 0xff); \
-        /* fall through */                                   \
-        case 1:                                              \
-            *(--(c)) = (unsigned char)(((l1) >> 24) & 0xff); \
-        }                                                    \
-    }

-#undef n2l
-#define n2l(c, l) (l = ((unsigned long)(*((c)++))) << 24L, \
-    l |= ((unsigned long)(*((c)++))) << 16L,               \
-    l |= ((unsigned long)(*((c)++))) << 8L,                \
-    l |= ((unsigned long)(*((c)++))))
-
-#undef l2n
-#define l2n(l, c) (*((c)++) = (unsigned char)(((l) >> 24L) & 0xff), \
-    *((c)++) = (unsigned char)(((l) >> 16L) & 0xff),                \
-    *((c)++) = (unsigned char)(((l) >> 8L) & 0xff),                 \
-    *((c)++) = (unsigned char)(((l)) & 0xff))
+#include <openssl/opensslconf.h>
+#include "internal/common.h"

 /*
  * This is actually a big endian algorithm, the most significant byte is used
diff --git a/deps/openssl/openssl/crypto/bf/bf_pi.h b/deps/openssl/openssl/crypto/bf/bf_pi.h
index ffb3b3e9b35..1396a0e194b 100644
--- a/deps/openssl/openssl/crypto/bf/bf_pi.h
+++ b/deps/openssl/openssl/crypto/bf/bf_pi.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,11 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_BF_BF_PI_H)
+#define OSSL_LIBCRYPTO_BF_BF_PI_H
+
+#include <openssl/blowfish.h>
+
 static const BF_KEY bf_init = {
     { 0x243f6a88L, 0x85a308d3L, 0x13198a2eL, 0x03707344L,
         0xa4093822L, 0x299f31d0L, 0x082efa98L, 0xec4e6c89L,
@@ -1040,3 +1045,5 @@ static const BF_KEY bf_init = {
         0x3ac372e6L,
     }
 };
+
+#endif /* !defined(OSSL_LIBCRYPTO_BF_BF_PI_H) */
diff --git a/deps/openssl/openssl/crypto/bio/bf_buff.c b/deps/openssl/openssl/crypto/bio/bf_buff.c
index 604c327fa70..9ad00826ae2 100644
--- a/deps/openssl/openssl/crypto/bio/bf_buff.c
+++ b/deps/openssl/openssl/crypto/bio/bf_buff.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,6 +20,12 @@ static long buffer_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int buffer_new(BIO *h);
 static int buffer_free(BIO *data);
 static long buffer_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
+static int buffer_sendmmsg(BIO *b, BIO_MSG *msg, size_t stride,
+    size_t num_msg, uint64_t flags,
+    size_t *msgs_processed);
+static int buffer_send_next(BIO *b, BIO_F_BUFFER_CTX *ctx,
+    const char *data, int len);
+
 #define DEFAULT_BUFFER_SIZE 4096

 static const BIO_METHOD methods_buffer = {
@@ -35,6 +41,7 @@ static const BIO_METHOD methods_buffer = {
     buffer_new,
     buffer_free,
     buffer_callback_ctrl,
+    buffer_sendmmsg,
 };

 const BIO_METHOD *BIO_f_buffer(void)
@@ -77,6 +84,9 @@ static int buffer_free(BIO *a)
     b = (BIO_F_BUFFER_CTX *)a->ptr;
     OPENSSL_free(b->ibuf);
     OPENSSL_free(b->obuf);
+#ifndef OPENSSL_NO_SOCK
+    BIO_ADDR_free(b->peer);
+#endif
     OPENSSL_free(a->ptr);
     a->ptr = NULL;
     a->init = 0;
@@ -187,7 +197,7 @@ start:
         }
         /* we now have a full buffer needing flushing */
         for (;;) {
-            i = BIO_write(b->next_bio, &(ctx->obuf[ctx->obuf_off]),
+            i = buffer_send_next(b, ctx, &(ctx->obuf[ctx->obuf_off]),
                 ctx->obuf_len);
             if (i <= 0) {
                 BIO_copy_next_retry(b);
@@ -211,7 +221,7 @@ start:

     /* we now have inl bytes to write */
     while (inl >= ctx->obuf_size) {
-        i = BIO_write(b->next_bio, in, inl);
+        i = buffer_send_next(b, ctx, in, inl);
         if (i <= 0) {
             BIO_copy_next_retry(b);
             if (i < 0)
@@ -249,6 +259,10 @@ static long buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
         ctx->ibuf_len = 0;
         ctx->obuf_off = 0;
         ctx->obuf_len = 0;
+#ifndef OPENSSL_NO_SOCK
+        BIO_ADDR_free(ctx->peer);
+        ctx->peer = NULL;
+#endif
         if (b->next_bio == NULL)
             return 0;
         ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
@@ -256,6 +270,12 @@ static long buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
     case BIO_CTRL_EOF:
         if (ctx->ibuf_len > 0)
             return 0;
+        /*
+         * If there is no next BIO, BIO_read() returns 0, which means EOF,
+         * BIO_eof() should return 1 in this case.
+         */
+        if (b->next_bio == NULL)
+            return 1;
         ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
         break;
     case BIO_CTRL_INFO:
@@ -345,6 +365,10 @@ static long buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
             ctx->obuf_off = 0;
             ctx->obuf_len = 0;
             ctx->obuf_size = obs;
+#ifndef OPENSSL_NO_SOCK
+            BIO_ADDR_free(ctx->peer);
+            ctx->peer = NULL;
+#endif
         }
         break;
     case BIO_C_DO_STATE_MACHINE:
@@ -367,8 +391,8 @@ static long buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
         for (;;) {
             BIO_clear_retry_flags(b);
             if (ctx->obuf_len > 0) {
-                r = BIO_write(b->next_bio,
-                    &(ctx->obuf[ctx->obuf_off]), ctx->obuf_len);
+                r = buffer_send_next(b, ctx, &(ctx->obuf[ctx->obuf_off]),
+                    ctx->obuf_len);
                 BIO_copy_next_retry(b);
                 if (r <= 0)
                     return (long)r;
@@ -382,6 +406,10 @@ static long buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
         }
         ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
         BIO_copy_next_retry(b);
+#ifndef OPENSSL_NO_SOCK
+        BIO_ADDR_free(ctx->peer);
+        ctx->peer = NULL;
+#endif
         break;
     case BIO_CTRL_DUP:
         dbio = (BIO *)ptr;
@@ -464,5 +492,111 @@ static int buffer_gets(BIO *b, char *buf, int size)

 static int buffer_puts(BIO *b, const char *str)
 {
-    return buffer_write(b, str, strlen(str));
+    size_t len = strlen(str);
+
+    if (len > INT_MAX)
+        return -1;
+    return buffer_write(b, str, (int)len);
+}
+
+/*
+ * buffer_send_next - write one chunk of buffered output to the next BIO.
+ *
+ * For listener-created datagram connections a peer address has been recorded and
+ * such connections share a single network BIO, so the data must be sent with
+ * BIO_sendmmsg() carrying the explicit peer address rather than BIO_write().
+ *
+ * Returns the number of bytes sent - the full len for the datagram case, which
+ * is all-or-nothing - or 0 / a negative value on a transient or fatal error.
+ */
+static int buffer_send_next(BIO *b, BIO_F_BUFFER_CTX *ctx,
+    const char *data, int len)
+{
+#ifndef OPENSSL_NO_SOCK
+    if (ctx->peer != NULL) {
+        BIO_MSG msg;
+        size_t processed = 0;
+
+        memset(&msg, 0, sizeof(msg));
+        msg.data = (void *)data;
+        msg.data_len = (size_t)len;
+        msg.peer = ctx->peer;
+
+        /* Datagrams are all-or-nothing: either the whole chunk goes or none. */
+        if (!BIO_sendmmsg(b->next_bio, &msg, sizeof(msg), 1, 0, &processed)
+            || processed != 1)
+            return -1;
+        return len;
+    }
+#endif
+    return BIO_write(b->next_bio, data, len);
+}
+
+/*
+ * buffer_sendmmsg - accumulate a message into the buffer BIO.
+ *
+ * Listener-created DTLS connections share a single network BIO and so cannot
+ * use BIO_write(). Instead the record layer sends each record via BIO_sendmmsg(),
+ * which lands here. We record the peer address and then buffer the data exactly
+ * like buffer_write() does, so that multiple handshake records accumulate and are
+ * packed into a single datagram when the state machine flushes.
+ */
+static int buffer_sendmmsg(BIO *b, BIO_MSG *msg, size_t stride,
+    size_t num_msg, uint64_t flags,
+    size_t *msgs_processed)
+{
+#ifndef OPENSSL_NO_SOCK
+    BIO_F_BUFFER_CTX *ctx;
+    size_t i;
+
+    *msgs_processed = 0;
+
+    if (b == NULL || b->next_bio == NULL)
+        return 0;
+
+    ctx = (BIO_F_BUFFER_CTX *)b->ptr;
+    if (ctx == NULL || msg == NULL || num_msg == 0)
+        return 0;
+
+    /*
+     * Record the peer address on the first write so the flush path knows
+     * where to send the accumulated data. The address is cleared after each
+     * flush so it can be set again for the next batch.
+     */
+    if (ctx->peer == NULL) {
+        if (msg->peer == NULL)
+            return 0;
+        ctx->peer = BIO_ADDR_new();
+        if (ctx->peer == NULL)
+            return 0;
+        if (!BIO_ADDR_copy(ctx->peer, msg->peer)) {
+            BIO_ADDR_free(ctx->peer);
+            ctx->peer = NULL;
+            return 0;
+        }
+    }
+
+    for (i = 0; i < num_msg; i++) {
+        BIO_MSG *m = (BIO_MSG *)((char *)msg + i * stride);
+        int ret;
+
+        /*
+         * Buffer the message data. buffer_write() takes an int length, so
+         * guard against an oversized datagram (this mirrors buffer_puts()).
+         */
+        if (m->data_len > INT_MAX)
+            break;
+
+        ret = buffer_write(b, m->data, (int)m->data_len);
+        if (ret <= 0)
+            break;
+
+        ++(*msgs_processed);
+    }
+
+    return (*msgs_processed > 0) ? 1 : 0;
+#else
+    *msgs_processed = 0;
+    return 0;
+#endif
 }
diff --git a/deps/openssl/openssl/crypto/bio/bf_lbuf.c b/deps/openssl/openssl/crypto/bio/bf_lbuf.c
index 8eb6d64a653..6514f083375 100644
--- a/deps/openssl/openssl/crypto/bio/bf_lbuf.c
+++ b/deps/openssl/openssl/crypto/bio/bf_lbuf.c
@@ -134,14 +134,15 @@ static int linebuffer_write(BIO *b, const char *in, int inl)
         while ((foundnl || p - in > ctx->obuf_size - ctx->obuf_len)
             && ctx->obuf_len > 0) {
             int orig_olen = ctx->obuf_len;
+            int llen = (int)(p - in);

             i = ctx->obuf_size - ctx->obuf_len;
-            if (p - in > 0) {
-                if (i >= p - in) {
-                    memcpy(&(ctx->obuf[ctx->obuf_len]), in, p - in);
-                    ctx->obuf_len += p - in;
-                    inl -= p - in;
-                    num += p - in;
+            if (llen > 0) {
+                if (i >= llen) {
+                    memcpy(&(ctx->obuf[ctx->obuf_len]), in, llen);
+                    ctx->obuf_len += llen;
+                    inl -= llen;
+                    num += llen;
                     in = p;
                 } else {
                     memcpy(&(ctx->obuf[ctx->obuf_len]), in, i);
@@ -171,7 +172,7 @@ static int linebuffer_write(BIO *b, const char *in, int inl)
          * if a NL was found and there is anything to write.
          */
         if ((foundnl || p - in > ctx->obuf_size) && p - in > 0) {
-            i = BIO_write(b->next_bio, in, p - in);
+            i = BIO_write(b->next_bio, in, (int)(p - in));
             if (i <= 0) {
                 BIO_copy_next_retry(b);
                 if (i < 0)
@@ -306,6 +307,15 @@ static long linebuffer_ctrl(BIO *b, int cmd, long num, void *ptr)
         if (BIO_set_write_buffer_size(dbio, ctx->obuf_size) <= 0)
             ret = 0;
         break;
+    case BIO_CTRL_EOF:
+        /*
+         * If there is no next BIO, BIO_read() returns 0, which means EOF.
+         * BIO_eof() should return 1 in this case.
+         */
+        if (b->next_bio == NULL)
+            return 1;
+        ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
+        break;
     default:
         if (b->next_bio == NULL)
             return 0;
@@ -324,12 +334,21 @@ static long linebuffer_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)

 static int linebuffer_gets(BIO *b, char *buf, int size)
 {
+    int ret = 0;
+
     if (b->next_bio == NULL)
         return 0;
-    return BIO_gets(b->next_bio, buf, size);
+    ret = BIO_gets(b->next_bio, buf, size);
+    BIO_clear_retry_flags(b);
+    BIO_copy_next_retry(b);
+    return ret;
 }

 static int linebuffer_puts(BIO *b, const char *str)
 {
-    return linebuffer_write(b, str, strlen(str));
+    size_t len = strlen(str);
+
+    if (len > INT_MAX)
+        return -1;
+    return linebuffer_write(b, str, (int)len);
 }
diff --git a/deps/openssl/openssl/crypto/bio/bf_nbio.c b/deps/openssl/openssl/crypto/bio/bf_nbio.c
index 01138729b00..52d3bbec777 100644
--- a/deps/openssl/openssl/crypto/bio/bf_nbio.c
+++ b/deps/openssl/openssl/crypto/bio/bf_nbio.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -149,9 +149,14 @@ static long nbiof_ctrl(BIO *b, int cmd, long num, void *ptr)
 {
     long ret;

+    /*
+     * If there is no next BIO, BIO_read() returns 0, which means EOF.
+     * BIO_eof() should return 1 in this case.
+     */
     if (b->next_bio == NULL)
-        return 0;
+        return cmd == BIO_CTRL_EOF;
     switch (cmd) {
+    case BIO_CTRL_FLUSH:
     case BIO_C_DO_STATE_MACHINE:
         BIO_clear_retry_flags(b);
         ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
@@ -176,14 +181,22 @@ static long nbiof_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)

 static int nbiof_gets(BIO *bp, char *buf, int size)
 {
+    int ret = 0;
     if (bp->next_bio == NULL)
         return 0;
-    return BIO_gets(bp->next_bio, buf, size);
+    ret = BIO_gets(bp->next_bio, buf, size);
+    BIO_clear_retry_flags(bp);
+    BIO_copy_next_retry(bp);
+    return ret;
 }

 static int nbiof_puts(BIO *bp, const char *str)
 {
+    int ret = 0;
     if (bp->next_bio == NULL)
         return 0;
-    return BIO_puts(bp->next_bio, str);
+    ret = BIO_puts(bp->next_bio, str);
+    BIO_clear_retry_flags(bp);
+    BIO_copy_next_retry(bp);
+    return ret;
 }
diff --git a/deps/openssl/openssl/crypto/bio/bf_null.c b/deps/openssl/openssl/crypto/bio/bf_null.c
index 7add76a4ca5..8c13a7bb63d 100644
--- a/deps/openssl/openssl/crypto/bio/bf_null.c
+++ b/deps/openssl/openssl/crypto/bio/bf_null.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -74,9 +74,14 @@ static long nullf_ctrl(BIO *b, int cmd, long num, void *ptr)
 {
     long ret;

+    /*
+     * If there is no next BIO, BIO_read() returns 0, which means EOF.
+     * BIO_eof() should return 1 in this case.
+     */
     if (b->next_bio == NULL)
-        return 0;
+        return cmd == BIO_CTRL_EOF;
     switch (cmd) {
+    case BIO_CTRL_FLUSH:
     case BIO_C_DO_STATE_MACHINE:
         BIO_clear_retry_flags(b);
         ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
@@ -100,14 +105,24 @@ static long nullf_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)

 static int nullf_gets(BIO *bp, char *buf, int size)
 {
+    int ret = 0;
+
     if (bp->next_bio == NULL)
         return 0;
-    return BIO_gets(bp->next_bio, buf, size);
+    ret = BIO_gets(bp->next_bio, buf, size);
+    BIO_clear_retry_flags(bp);
+    BIO_copy_next_retry(bp);
+    return ret;
 }

 static int nullf_puts(BIO *bp, const char *str)
 {
+    int ret = 0;
+
     if (bp->next_bio == NULL)
         return 0;
-    return BIO_puts(bp->next_bio, str);
+    ret = BIO_puts(bp->next_bio, str);
+    BIO_clear_retry_flags(bp);
+    BIO_copy_next_retry(bp);
+    return ret;
 }
diff --git a/deps/openssl/openssl/crypto/bio/bf_prefix.c b/deps/openssl/openssl/crypto/bio/bf_prefix.c
index 9eebbdca568..d8c32e1c654 100644
--- a/deps/openssl/openssl/crypto/bio/bf_prefix.c
+++ b/deps/openssl/openssl/crypto/bio/bf_prefix.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -203,5 +203,9 @@ static int prefix_gets(BIO *b, char *buf, int size)

 static int prefix_puts(BIO *b, const char *str)
 {
-    return BIO_write(b, str, strlen(str));
+    size_t len = strlen(str);
+
+    if (len > INT_MAX)
+        return -1;
+    return BIO_write(b, str, (int)len);
 }
diff --git a/deps/openssl/openssl/crypto/bio/bio_addr.c b/deps/openssl/openssl/crypto/bio/bio_addr.c
index 02f83eb2bf8..f1adbf99b44 100644
--- a/deps/openssl/openssl/crypto/bio/bio_addr.c
+++ b/deps/openssl/openssl/crypto/bio/bio_addr.c
@@ -22,6 +22,7 @@
 #undef UNICODE

 #include <assert.h>
+#include <stdio.h>
 #include <string.h>

 #include "bio_local.h"
@@ -265,7 +266,7 @@ static int addr_strings(const BIO_ADDR *ap, int numeric,
          * didn't go the way one might expect.
          */
         if (serv[0] == '\0') {
-            BIO_snprintf(serv, sizeof(serv), "%d",
+            snprintf(serv, sizeof(serv), "%d",
                 ntohs(BIO_ADDR_rawport(ap)));
         }

@@ -279,7 +280,7 @@ static int addr_strings(const BIO_ADDR *ap, int numeric,
             *hostname = OPENSSL_strdup(inet_ntoa(ap->s_in.sin_addr));
         if (service != NULL) {
             char serv[6]; /* port is 16 bits => max 5 decimal digits */
-            BIO_snprintf(serv, sizeof(serv), "%d", ntohs(ap->s_in.sin_port));
+            snprintf(serv, sizeof(serv), "%d", ntohs(ap->s_in.sin_port));
             *service = OPENSSL_strdup(serv);
         }
     }
@@ -428,7 +429,7 @@ int BIO_ADDRINFO_protocol(const BIO_ADDRINFO *bai)
 socklen_t BIO_ADDRINFO_sockaddr_size(const BIO_ADDRINFO *bai)
 {
     if (bai != NULL)
-        return bai->bai_addrlen;
+        return (socklen_t)bai->bai_addrlen;
     return 0;
 }

diff --git a/deps/openssl/openssl/crypto/bio/bio_cb.c b/deps/openssl/openssl/crypto/bio/bio_cb.c
index 274adef6ed7..c95545c9117 100644
--- a/deps/openssl/openssl/crypto/bio/bio_cb.c
+++ b/deps/openssl/openssl/crypto/bio/bio_cb.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -30,88 +30,88 @@ long BIO_debug_callback_ex(BIO *bio, int cmd, const char *argp, size_t len,
     if (processed != NULL)
         l = *processed;

-    left = BIO_snprintf(buf, sizeof(buf), "BIO[%p]: ", (void *)bio);
+    left = snprintf(buf, sizeof(buf), "BIO[%p]: ", (void *)bio);

     /* Ignore errors and continue printing the other information. */
-    if (left < 0)
+    if (left < 0 || (size_t)left >= sizeof(buf))
         left = 0;
     p = buf + left;
     left = sizeof(buf) - left;

     switch (cmd) {
     case BIO_CB_FREE:
-        BIO_snprintf(p, left, "Free - %s\n", bio->method->name);
+        snprintf(p, left, "Free - %s\n", bio->method->name);
         break;
     case BIO_CB_READ:
         if (bio->method->type & BIO_TYPE_DESCRIPTOR)
-            BIO_snprintf(p, left, "read(%d,%zu) - %s fd=%d\n",
+            snprintf(p, left, "read(%d,%zu) - %s fd=%d\n",
                 bio->num, len,
                 bio->method->name, bio->num);
         else
-            BIO_snprintf(p, left, "read(%d,%zu) - %s\n",
+            snprintf(p, left, "read(%d,%zu) - %s\n",
                 bio->num, len, bio->method->name);
         break;
     case BIO_CB_WRITE:
         if (bio->method->type & BIO_TYPE_DESCRIPTOR)
-            BIO_snprintf(p, left, "write(%d,%zu) - %s fd=%d\n",
+            snprintf(p, left, "write(%d,%zu) - %s fd=%d\n",
                 bio->num, len,
                 bio->method->name, bio->num);
         else
-            BIO_snprintf(p, left, "write(%d,%zu) - %s\n",
+            snprintf(p, left, "write(%d,%zu) - %s\n",
                 bio->num, len, bio->method->name);
         break;
     case BIO_CB_PUTS:
-        BIO_snprintf(p, left, "puts() - %s\n", bio->method->name);
+        snprintf(p, left, "puts() - %s\n", bio->method->name);
         break;
     case BIO_CB_GETS:
-        BIO_snprintf(p, left, "gets(%zu) - %s\n", len,
+        snprintf(p, left, "gets(%zu) - %s\n", len,
             bio->method->name);
         break;
     case BIO_CB_CTRL:
-        BIO_snprintf(p, left, "ctrl(%d) - %s\n", argi,
+        snprintf(p, left, "ctrl(%d) - %s\n", argi,
             bio->method->name);
         break;
     case BIO_CB_RECVMMSG:
         args = (BIO_MMSG_CB_ARGS *)argp;
-        BIO_snprintf(p, left, "recvmmsg(%zu) - %s",
+        snprintf(p, left, "recvmmsg(%zu) - %s",
             args->num_msg, bio->method->name);
         break;
     case BIO_CB_SENDMMSG:
         args = (BIO_MMSG_CB_ARGS *)argp;
-        BIO_snprintf(p, left, "sendmmsg(%zu) - %s",
+        snprintf(p, left, "sendmmsg(%zu) - %s",
             args->num_msg, bio->method->name);
         break;
     case BIO_CB_RETURN | BIO_CB_READ:
-        BIO_snprintf(p, left, "read return %d processed: %zu\n", ret, l);
+        snprintf(p, left, "read return %d processed: %zu\n", ret, l);
         break;
     case BIO_CB_RETURN | BIO_CB_WRITE:
-        BIO_snprintf(p, left, "write return %d processed: %zu\n", ret, l);
+        snprintf(p, left, "write return %d processed: %zu\n", ret, l);
         break;
     case BIO_CB_RETURN | BIO_CB_GETS:
-        BIO_snprintf(p, left, "gets return %d processed: %zu\n", ret, l);
+        snprintf(p, left, "gets return %d processed: %zu\n", ret, l);
         break;
     case BIO_CB_RETURN | BIO_CB_PUTS:
-        BIO_snprintf(p, left, "puts return %d processed: %zu\n", ret, l);
+        snprintf(p, left, "puts return %d processed: %zu\n", ret, l);
         break;
     case BIO_CB_RETURN | BIO_CB_CTRL:
-        BIO_snprintf(p, left, "ctrl return %d\n", ret);
+        snprintf(p, left, "ctrl return %d\n", ret);
         break;
     case BIO_CB_RETURN | BIO_CB_RECVMMSG:
-        BIO_snprintf(p, left, "recvmmsg processed: %zu\n", len);
+        snprintf(p, left, "recvmmsg processed: %zu\n", len);
         ret_ = (long)len;
         break;
     case BIO_CB_RETURN | BIO_CB_SENDMMSG:
-        BIO_snprintf(p, left, "sendmmsg processed: %zu\n", len);
+        snprintf(p, left, "sendmmsg processed: %zu\n", len);
         ret_ = (long)len;
         break;
     default:
-        BIO_snprintf(p, left, "bio callback - unknown type (%d)\n", cmd);
+        snprintf(p, left, "bio callback - unknown type (%d)\n", cmd);
         break;
     }

     b = (BIO *)bio->cb_arg;
     if (b != NULL)
-        BIO_write(b, buf, strlen(buf));
+        BIO_write(b, buf, (int)strlen(buf));
 #if !defined(OPENSSL_NO_STDIO)
     else
         fputs(buf, stderr);
diff --git a/deps/openssl/openssl/crypto/bio/bio_dump.c b/deps/openssl/openssl/crypto/bio/bio_dump.c
index c117998df65..aa1daf71efb 100644
--- a/deps/openssl/openssl/crypto/bio/bio_dump.c
+++ b/deps/openssl/openssl/crypto/bio/bio_dump.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -45,9 +45,9 @@ int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
     if ((rows * dump_width) < len)
         rows++;
     for (i = 0; i < rows; i++) {
-        n = BIO_snprintf(buf, sizeof(buf), "%*s%04x - ", indent, "",
+        n = snprintf(buf, sizeof(buf), "%*s%04x - ", indent, "",
             i * dump_width);
-        if (n < 0)
+        if (n < 0 || (size_t)n >= sizeof(buf))
             return -1;
         for (j = 0; j < dump_width; j++) {
             if (SPACE(buf, n, 3)) {
@@ -55,7 +55,7 @@ int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
                     strcpy(buf + n, "   ");
                 } else {
                     ch = *(s + i * dump_width + j) & 0xff;
-                    BIO_snprintf(buf + n, 4, "%02x%c", ch,
+                    snprintf(buf + n, 4, "%02x%c", ch,
                         j == 7 ? '-' : ' ');
                 }
                 n += 3;
@@ -99,7 +99,7 @@ int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
 #ifndef OPENSSL_NO_STDIO
 static int write_fp(const void *data, size_t len, void *fp)
 {
-    return UP_fwrite(data, len, 1, fp);
+    return (int)UP_fwrite(data, len, 1, fp);
 }

 int BIO_dump_fp(FILE *fp, const void *s, int len)
@@ -115,7 +115,9 @@ int BIO_dump_indent_fp(FILE *fp, const void *s, int len, int indent)

 static int write_bio(const void *data, size_t len, void *bp)
 {
-    return BIO_write((BIO *)bp, (const char *)data, len);
+    if (len > INT_MAX)
+        return -1;
+    return BIO_write((BIO *)bp, (const char *)data, (int)len);
 }

 int BIO_dump(BIO *bp, const void *s, int len)
diff --git a/deps/openssl/openssl/crypto/bio/bio_err.c b/deps/openssl/openssl/crypto/bio/bio_err.c
deleted file mode 100644
index 5883c9b3c12..00000000000
--- a/deps/openssl/openssl/crypto/bio/bio_err.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/bioerr.h>
-#include "crypto/bioerr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA BIO_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_ACCEPT_ERROR), "accept error" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET),
-        "addrinfo addr is not af inet" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_AMBIGUOUS_HOST_OR_SERVICE),
-        "ambiguous host or service" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_BAD_FOPEN_MODE), "bad fopen mode" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_BROKEN_PIPE), "broken pipe" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_CONNECT_ERROR), "connect error" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_CONNECT_TIMEOUT), "connect timeout" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET),
-        "gethostbyname addr is not af inet" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_GETSOCKNAME_ERROR), "getsockname error" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS),
-        "getsockname truncated address" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_GETTING_SOCKTYPE), "getting socktype" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_INVALID_ARGUMENT), "invalid argument" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_INVALID_SOCKET), "invalid socket" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_IN_USE), "in use" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_LENGTH_TOO_LONG), "length too long" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_LISTEN_V6_ONLY), "listen v6 only" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_LOOKUP_RETURNED_NOTHING),
-        "lookup returned nothing" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_MALFORMED_HOST_OR_SERVICE),
-        "malformed host or service" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NBIO_CONNECT_ERROR), "nbio connect error" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED),
-        "no accept addr or service specified" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED),
-        "no hostname or service specified" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NO_PORT_DEFINED), "no port defined" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NO_SUCH_FILE), "no such file" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_PORT_MISMATCH), "port mismatch" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_TFO_DISABLED), "tfo disabled" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_TFO_NO_KERNEL_SUPPORT),
-        "tfo no kernel support" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_TRANSFER_ERROR), "transfer error" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_TRANSFER_TIMEOUT), "transfer timeout" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_BIND_SOCKET),
-        "unable to bind socket" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_CREATE_SOCKET),
-        "unable to create socket" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_KEEPALIVE),
-        "unable to keepalive" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_LISTEN_SOCKET),
-        "unable to listen socket" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_NODELAY), "unable to nodelay" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_REUSEADDR),
-        "unable to reuseaddr" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_TFO), "unable to tfo" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNAVAILABLE_IP_FAMILY),
-        "unavailable ip family" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNINITIALIZED), "uninitialized" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNKNOWN_INFO_TYPE), "unknown info type" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNSUPPORTED_IP_FAMILY),
-        "unsupported ip family" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNSUPPORTED_METHOD), "unsupported method" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNSUPPORTED_PROTOCOL_FAMILY),
-        "unsupported protocol family" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_WRITE_TO_READ_ONLY_BIO),
-        "write to read only BIO" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_WSASTARTUP), "WSAStartup" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_LOCAL_ADDR_NOT_AVAILABLE),
-        "local address not available" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_PEER_ADDR_NOT_AVAILABLE),
-        "peer address not available" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NON_FATAL),
-        "non-fatal or transient error" },
-    { ERR_PACK(ERR_LIB_BIO, 0, BIO_R_PORT_MISMATCH),
-        "port mismatch" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_BIO_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(BIO_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(BIO_str_reasons);
-#endif
-    return 1;
-}
-
-#ifndef OPENSSL_NO_SOCK
-
-int BIO_err_is_non_fatal(unsigned int errcode)
-{
-    if (ERR_SYSTEM_ERROR(errcode))
-        return BIO_sock_non_fatal_error(ERR_GET_REASON(errcode));
-    else if (ERR_GET_LIB(errcode) == ERR_LIB_BIO
-        && ERR_GET_REASON(errcode) == BIO_R_NON_FATAL)
-        return 1;
-    else
-        return 0;
-}
-
-#endif
diff --git a/deps/openssl/openssl/crypto/bio/bio_lib.c b/deps/openssl/openssl/crypto/bio/bio_lib.c
index 8617ccb1b08..6066cc0d8c1 100644
--- a/deps/openssl/openssl/crypto/bio/bio_lib.c
+++ b/deps/openssl/openssl/crypto/bio/bio_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -65,7 +65,7 @@ static long bio_call_callback(BIO *b, int oper, const char *argp, size_t len,
     if (inret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) {
         if (*processed > INT_MAX)
             return -1;
-        inret = *processed;
+        inret = (long)*processed;
     }

     ret = b->callback(b, oper, argp, argi, argl, inret);
@@ -116,24 +116,22 @@ BIO *BIO_new(const BIO_METHOD *method)
     return BIO_new_ex(NULL, method);
 }

-int BIO_free(BIO *a)
+static int BIO_free_int(BIO *a, int *ret)
 {
-    int ret;

     if (a == NULL)
         return 0;

-    if (CRYPTO_DOWN_REF(&a->references, &ret) <= 0)
+    if (CRYPTO_DOWN_REF(&a->references, ret) <= 0)
         return 0;

-    REF_PRINT_COUNT("BIO", ret, a);
-    if (ret > 0)
+    REF_PRINT_COUNT("BIO", *ret, a);
+    if (*ret > 0)
         return 1;
-    REF_ASSERT_ISNT(ret < 0);
+    REF_ASSERT_ISNT(*ret < 0);

     if (HAS_CALLBACK(a)) {
-        ret = (int)bio_call_callback(a, BIO_CB_FREE, NULL, 0, 0, 0L, 1L, NULL);
-        if (ret <= 0)
+        if ((int)bio_call_callback(a, BIO_CB_FREE, NULL, 0, 0, 0L, 1L, NULL) <= 0)
             return 0;
     }

@@ -149,6 +147,13 @@ int BIO_free(BIO *a)
     return 1;
 }

+int BIO_free(BIO *b)
+{
+    int ref;
+
+    return BIO_free_int(b, &ref);
+}
+
 void BIO_set_data(BIO *a, void *ptr)
 {
     a->ptr = ptr;
@@ -188,7 +193,7 @@ int BIO_up_ref(BIO *a)
 {
     int i;

-    if (CRYPTO_UP_REF(&a->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&a->references, &i))
         return 0;

     REF_PRINT_COUNT("BIO", i, a);
@@ -211,6 +216,11 @@ void BIO_set_flags(BIO *b, int flags)
     b->flags |= flags;
 }

+long BIO_set_send_flags(BIO *b, int flags)
+{
+    return BIO_ctrl(b, BIO_C_SET_SEND_FLAGS, (long)flags, NULL);
+}
+
 #ifndef OPENSSL_NO_DEPRECATED_3_0
 BIO_callback_fn BIO_get_callback(const BIO *b)
 {
@@ -254,10 +264,14 @@ int BIO_method_type(const BIO *b)
 }

 /*
- * This is essentially the same as BIO_read_ex() except that it allows
- * 0 or a negative value to indicate failure (retryable or not) in the return.
- * This is for compatibility with the old style BIO_read(), where existing code
- * may make assumptions about the return value that it might get.
+ * Internal BIO read function. Attempts to read dlen bytes from BIO b and
+ * places them in data. If any bytes were successfully read, then the number
+ * of bytes read is stored in readbytes.
+ * For compatibility with the old-style BIO_read() API, the function uses a
+ * return-value convention where a positive value indicates success,
+ * 0 indicates end-of-file, and a negative value indicates an error
+ * (including retryable errors).
+ * It also returns 0 if dlen==0.
  */
 static int bio_read_intern(BIO *b, void *data, size_t dlen, size_t *readbytes)
 {
@@ -285,6 +299,13 @@ static int bio_read_intern(BIO *b, void *data, size_t dlen, size_t *readbytes)
     if (ret > 0)
         b->num_read += (uint64_t)*readbytes;

+    /*
+     * If method->bread() returned 0 when dlen>0, it can be either EOF or
+     * an error, and we should distinguish them
+     */
+    if (ret == 0 && dlen > 0 && BIO_eof(b) == 0)
+        ret = -1;
+
     if (HAS_CALLBACK(b))
         ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, data,
             dlen, 0, 0L, ret, readbytes);
@@ -303,8 +324,10 @@ int BIO_read(BIO *b, void *data, int dlen)
     size_t readbytes;
     int ret;

-    if (dlen < 0)
-        return 0;
+    if (dlen < 0) {
+        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_INVALID_ARGUMENT);
+        return -1;
+    }

     ret = bio_read_intern(b, data, (size_t)dlen, &readbytes);

@@ -431,7 +454,7 @@ int BIO_sendmmsg(BIO *b, BIO_MSG *msg,
         ret = (size_t)bio_call_callback(b, BIO_CB_SENDMMSG | BIO_CB_RETURN,
             (void *)&args, ret, 0, 0, (long)ret, msgs_processed);

-    return ret;
+    return ret > 0;
 }

 int BIO_recvmmsg(BIO *b, BIO_MSG *msg,
@@ -478,7 +501,7 @@ int BIO_recvmmsg(BIO *b, BIO_MSG *msg,
         ret = (size_t)bio_call_callback(b, BIO_CB_RECVMMSG | BIO_CB_RETURN,
             (void *)&args, ret, 0, 0, (long)ret, msgs_processed);

-    return ret;
+    return ret > 0;
 }

 int BIO_get_rpoll_descriptor(BIO *b, BIO_POLL_DESCRIPTOR *desc)
@@ -620,7 +643,7 @@ int BIO_get_line(BIO *bio, char *buf, int size)
         if (*ptr++ == '\n')
             break;
     *ptr = '\0';
-    return ret > 0 || BIO_eof(bio) ? ptr - buf : ret;
+    return ret > 0 || BIO_eof(bio) ? (int)(ptr - buf) : ret;
 }

 int BIO_indent(BIO *b, int indent, int max)
@@ -679,6 +702,13 @@ long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
     return ret;
 }

+int BIO_eof(BIO *b)
+{
+    if ((b->flags & BIO_FLAGS_AUTO_EOF) != 0)
+        return 1;
+    return (int)BIO_ctrl(b, BIO_CTRL_EOF, 0, NULL);
+}
+
 long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     long ret;
@@ -849,11 +879,11 @@ void BIO_free_all(BIO *bio)

     while (bio != NULL) {
         b = bio;
-        CRYPTO_GET_REF(&b->references, &ref);
         bio = bio->next_bio;
-        BIO_free(b);
-        /* Since ref count > 1, don't free anyone else. */
-        if (ref > 1)
+        ref = 0;
+        BIO_free_int(b, &ref);
+        /* Since ref count > 0, don't free anyone else. */
+        if (ref > 0)
             break;
     }
 }
@@ -1076,3 +1106,18 @@ retry:

     return rv;
 }
+
+#ifndef OPENSSL_NO_SOCK
+
+int BIO_err_is_non_fatal(unsigned int errcode)
+{
+    if (ERR_SYSTEM_ERROR(errcode))
+        return BIO_sock_non_fatal_error(ERR_GET_REASON(errcode));
+    else if (ERR_GET_LIB(errcode) == ERR_LIB_BIO
+        && ERR_GET_REASON(errcode) == BIO_R_NON_FATAL)
+        return 1;
+    else
+        return 0;
+}
+
+#endif
diff --git a/deps/openssl/openssl/crypto/bio/bio_local.h b/deps/openssl/openssl/crypto/bio/bio_local.h
index 60fb944928c..d710b3a559d 100644
--- a/deps/openssl/openssl/crypto/bio/bio_local.h
+++ b/deps/openssl/openssl/crypto/bio/bio_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_BIO_BIO_LOCAL_H)
+#define OSSL_LIBCRYPTO_BIO_BIO_LOCAL_H
+
 #include "internal/e_os.h"
 #include "internal/sockets.h"
 #include "internal/bio_addr.h"
@@ -71,6 +74,7 @@ struct bio_addrinfo_st {
 #include "internal/cryptlib.h"
 #include "internal/bio.h"
 #include "internal/refcount.h"
+#include "internal/time.h"

 typedef struct bio_f_buffer_ctx_struct {
     /*-
@@ -93,6 +97,9 @@ typedef struct bio_f_buffer_ctx_struct {
     char *obuf; /* the char array */
     int obuf_len; /* how many bytes are in it */
     int obuf_off; /* write/read offset */
+#ifndef OPENSSL_NO_SOCK
+    BIO_ADDR *peer;
+#endif
 } BIO_F_BUFFER_CTX;

 struct bio_st {
@@ -119,6 +126,87 @@ struct bio_st {
 };

 #ifndef OPENSSL_NO_SOCK
+
+typedef struct bio_connect_st {
+    int state;
+    int connect_family;
+    int connect_sock_type;
+    char *param_hostname;
+    char *param_service;
+    int connect_mode;
+#ifndef OPENSSL_NO_KTLS
+    unsigned char record_type;
+#endif
+    int tfo_first;
+
+    BIO_ADDRINFO *addr_first;
+    const BIO_ADDRINFO *addr_iter;
+    /*
+     * int socket; this will be kept in bio->num so that it is compatible
+     * with the bss_sock bio
+     */
+    /*
+     * called when the connection is initially made callback(BIO,state,ret);
+     * The callback should return 'ret'.  state is for compatibility with the
+     * ssl info_callback
+     */
+    BIO_info_cb *info_callback;
+    /*
+     * Used when connect_sock_type is SOCK_DGRAM. Owned by us; we forward
+     * read/write(mmsg) calls to this if present.
+     */
+    BIO *dgram_bio;
+} BIO_CONNECT;
+
+typedef struct bio_accept_st {
+    int state;
+    int accept_family;
+    int bind_mode; /* Socket mode for BIO_listen */
+    int accepted_mode; /* Socket mode for BIO_accept (set on accepted sock) */
+    char *param_addr;
+    char *param_serv;
+
+    int accept_sock;
+
+    BIO_ADDRINFO *addr_first;
+    const BIO_ADDRINFO *addr_iter;
+    BIO_ADDR cache_accepting_addr; /* Useful if we asked for port 0 */
+    char *cache_accepting_name, *cache_accepting_serv;
+    BIO_ADDR cache_peer_addr;
+    char *cache_peer_name, *cache_peer_serv;
+
+    BIO *bio_chain;
+} BIO_ACCEPT;
+
+#ifndef OPENSSL_NO_DGRAM
+typedef struct bio_dgram_data_st {
+    BIO_ADDR peer;
+    BIO_ADDR local_addr;
+    unsigned int connected;
+    unsigned int _errno;
+    unsigned int mtu;
+    OSSL_TIME next_timeout;
+    OSSL_TIME socket_timeout;
+    unsigned int peekmode;
+    char local_addr_enabled;
+} bio_dgram_data;
+#endif
+
+#define BIO_CONN_S_BEFORE 1
+#define BIO_CONN_S_GET_ADDR 2
+#define BIO_CONN_S_CREATE_SOCKET 3
+#define BIO_CONN_S_CONNECT 4
+#define BIO_CONN_S_OK 5
+#define BIO_CONN_S_BLOCKED_CONNECT 6
+#define BIO_CONN_S_CONNECT_ERROR 7
+
+#define BIO_ACPT_S_BEFORE 1
+#define BIO_ACPT_S_GET_ADDR 2
+#define BIO_ACPT_S_CREATE_SOCKET 3
+#define BIO_ACPT_S_LISTEN 4
+#define BIO_ACPT_S_ACCEPT 5
+#define BIO_ACPT_S_OK 6
+
 #ifdef OPENSSL_SYS_VMS
 typedef unsigned int socklen_t;
 #endif
@@ -178,3 +266,5 @@ void bio_sock_cleanup_int(void);
 #endif

 #endif
+
+#endif /* !defined(OSSL_LIBCRYPTO_BIO_BIO_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/bio/bio_meth.c b/deps/openssl/openssl/crypto/bio/bio_meth.c
index 0cab60491e7..e97e51a7204 100644
--- a/deps/openssl/openssl/crypto/bio/bio_meth.c
+++ b/deps/openssl/openssl/crypto/bio/bio_meth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -121,12 +121,25 @@ int bread_conv(BIO *bio, char *data, size_t datal, size_t *readbytes)
 {
     int ret;

+    if (datal == 0) {
+        *readbytes = 0;
+        return 1;
+    }
+
     if (datal > INT_MAX)
         datal = INT_MAX;

     ret = bio->method->bread_old(bio, data, (int)datal);

-    if (ret <= 0) {
+    bio->flags &= ~BIO_FLAGS_AUTO_EOF;
+    if (ret == 0) {
+        if (BIO_ctrl(bio, BIO_CTRL_EOF, 0, NULL) == 0)
+            bio->flags |= BIO_FLAGS_AUTO_EOF;
+        *readbytes = 0;
+        return 0;
+    }
+
+    if (ret < 0) {
         *readbytes = 0;
         return ret;
     }
diff --git a/deps/openssl/openssl/crypto/bio/bio_print.c b/deps/openssl/openssl/crypto/bio/bio_print.c
index b04496a10ba..3585481ee4c 100644
--- a/deps/openssl/openssl/crypto/bio/bio_print.c
+++ b/deps/openssl/openssl/crypto/bio/bio_print.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,914 +15,78 @@
 #include <openssl/bio.h>
 #include <openssl/configuration.h>

-/*
- * Copyright Patrick Powell 1995
- * This code is based on code written by Patrick Powell <papowell@astart.com>
- * It may be used for any purpose as long as this notice remains intact
- * on all source code distributions.
- */
-
-#ifdef HAVE_LONG_DOUBLE
-#define LDOUBLE long double
-#else
-#define LDOUBLE double
-#endif
-
-static int fmtstr(char **, char **, size_t *, size_t *,
-    const char *, int, int, int);
-static int fmtint(char **, char **, size_t *, size_t *,
-    int64_t, int, int, int, int);
-#ifndef OPENSSL_SYS_UEFI
-static int fmtfp(char **, char **, size_t *, size_t *,
-    LDOUBLE, int, int, int, int);
-#endif
-static int doapr_outch(char **, char **, size_t *, size_t *, int);
-static int _dopr(char **sbuffer, char **buffer,
-    size_t *maxlen, size_t *retlen, int *truncated,
-    const char *format, va_list args);
-
-/* format read states */
-#define DP_S_DEFAULT 0
-#define DP_S_FLAGS 1
-#define DP_S_MIN 2
-#define DP_S_DOT 3
-#define DP_S_MAX 4
-#define DP_S_MOD 5
-#define DP_S_CONV 6
-#define DP_S_DONE 7
-
-/* format flags - Bits */
-/* left-aligned padding */
-#define DP_F_MINUS (1 << 0)
-/* print an explicit '+' for a value with positive sign */
-#define DP_F_PLUS (1 << 1)
-/* print an explicit ' ' for a value with positive sign */
-#define DP_F_SPACE (1 << 2)
-/* print 0/0x prefix for octal/hex and decimal point for floating point */
-#define DP_F_NUM (1 << 3)
-/* print leading zeroes */
-#define DP_F_ZERO (1 << 4)
-/* print HEX in UPPERcase */
-#define DP_F_UP (1 << 5)
-/* treat value as unsigned */
-#define DP_F_UNSIGNED (1 << 6)
+int BIO_printf(BIO *bio, const char *format, ...)
+{
+    va_list args;
+    int ret;

-/* conversion flags */
-#define DP_C_SHORT 1
-#define DP_C_LONG 2
-#define DP_C_LDOUBLE 3
-#define DP_C_LLONG 4
-#define DP_C_SIZE 5
+    va_start(args, format);

-/* Floating point formats */
-#define F_FORMAT 0
-#define E_FORMAT 1
-#define G_FORMAT 2
+    ret = BIO_vprintf(bio, format, args);

-/* some handy macros */
-#define char_to_int(p) (p - '0')
-#define OSSL_MAX(p, q) ((p >= q) ? p : q)
+    va_end(args);
+    return ret;
+}

-static int
-_dopr(char **sbuffer,
-    char **buffer,
-    size_t *maxlen,
-    size_t *retlen, int *truncated, const char *format, va_list args)
+int BIO_vprintf(BIO *bio, const char *format, va_list args)
 {
-    char ch;
-    int64_t value;
-#ifndef OPENSSL_SYS_UEFI
-    LDOUBLE fvalue;
+    va_list cp_args;
+    int sz;
+    int ret = -1;
+    char buf[512];
+    char *abuf;
+#if defined(_MSC_VER) && _MSC_VER < 1900
+    char *msvc_fmt_alloc = NULL;
 #endif
-    char *strvalue;
-    int min;
-    int max;
-    int state;
-    int flags;
-    int cflags;
-    size_t currlen;
-
-    state = DP_S_DEFAULT;
-    flags = currlen = cflags = min = 0;
-    max = -1;
-    ch = *format++;
-
-    while (state != DP_S_DONE) {
-        if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
-            state = DP_S_DONE;
+    const char *fmt;

-        switch (state) {
-        case DP_S_DEFAULT:
-            if (ch == '%')
-                state = DP_S_FLAGS;
-            else if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
-                return 0;
-            ch = *format++;
-            break;
-        case DP_S_FLAGS:
-            switch (ch) {
-            case '-':
-                flags |= DP_F_MINUS;
-                ch = *format++;
-                break;
-            case '+':
-                flags |= DP_F_PLUS;
-                ch = *format++;
-                break;
-            case ' ':
-                flags |= DP_F_SPACE;
-                ch = *format++;
-                break;
-            case '#':
-                flags |= DP_F_NUM;
-                ch = *format++;
-                break;
-            case '0':
-                flags |= DP_F_ZERO;
-                ch = *format++;
-                break;
-            default:
-                state = DP_S_MIN;
-                break;
-            }
-            break;
-        case DP_S_MIN:
-            if (ossl_isdigit(ch)) {
-                min = 10 * min + char_to_int(ch);
-                ch = *format++;
-            } else if (ch == '*') {
-                min = va_arg(args, int);
-                ch = *format++;
-                state = DP_S_DOT;
-            } else
-                state = DP_S_DOT;
-            break;
-        case DP_S_DOT:
-            if (ch == '.') {
-                state = DP_S_MAX;
-                ch = *format++;
-            } else
-                state = DP_S_MOD;
-            break;
-        case DP_S_MAX:
-            if (ossl_isdigit(ch)) {
-                if (max < 0)
-                    max = 0;
-                max = 10 * max + char_to_int(ch);
-                ch = *format++;
-            } else if (ch == '*') {
-                max = va_arg(args, int);
-                ch = *format++;
-                state = DP_S_MOD;
-            } else
-                state = DP_S_MOD;
-            break;
-        case DP_S_MOD:
-            switch (ch) {
-            case 'h':
-                cflags = DP_C_SHORT;
-                ch = *format++;
-                break;
-            case 'l':
-                if (*format == 'l') {
-                    cflags = DP_C_LLONG;
-                    format++;
-                } else
-                    cflags = DP_C_LONG;
-                ch = *format++;
-                break;
-            case 'q':
-            case 'j':
-                cflags = DP_C_LLONG;
-                ch = *format++;
-                break;
-            case 'L':
-                cflags = DP_C_LDOUBLE;
-                ch = *format++;
-                break;
-            case 'z':
-                cflags = DP_C_SIZE;
-                ch = *format++;
-                break;
-            default:
-                break;
-            }
-            state = DP_S_CONV;
-            break;
-        case DP_S_CONV:
-            switch (ch) {
-            case 'd':
-            case 'i':
-                switch (cflags) {
-                case DP_C_SHORT:
-                    value = (short int)va_arg(args, int);
-                    break;
-                case DP_C_LONG:
-                    value = va_arg(args, long int);
-                    break;
-                case DP_C_LLONG:
-                    value = va_arg(args, int64_t);
-                    break;
-                case DP_C_SIZE:
-                    value = va_arg(args, ossl_ssize_t);
-                    break;
-                default:
-                    value = va_arg(args, int);
-                    break;
-                }
-                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min,
-                        max, flags))
-                    return 0;
-                break;
-            case 'X':
-                flags |= DP_F_UP;
-                /* FALLTHROUGH */
-            case 'x':
-            case 'o':
-            case 'u':
-                flags |= DP_F_UNSIGNED;
-                switch (cflags) {
-                case DP_C_SHORT:
-                    value = (unsigned short int)va_arg(args, unsigned int);
-                    break;
-                case DP_C_LONG:
-                    value = va_arg(args, unsigned long int);
-                    break;
-                case DP_C_LLONG:
-                    value = va_arg(args, uint64_t);
-                    break;
-                case DP_C_SIZE:
-                    value = va_arg(args, size_t);
-                    break;
-                default:
-                    value = va_arg(args, unsigned int);
-                    break;
-                }
-                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value,
-                        ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
-                        min, max, flags))
-                    return 0;
-                break;
-#ifndef OPENSSL_SYS_UEFI
-            case 'f':
-                if (cflags == DP_C_LDOUBLE)
-                    fvalue = va_arg(args, LDOUBLE);
-                else
-                    fvalue = va_arg(args, double);
-                if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
-                        flags, F_FORMAT))
-                    return 0;
-                break;
-            case 'E':
-                flags |= DP_F_UP;
-                /* fall through */
-            case 'e':
-                if (cflags == DP_C_LDOUBLE)
-                    fvalue = va_arg(args, LDOUBLE);
-                else
-                    fvalue = va_arg(args, double);
-                if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
-                        flags, E_FORMAT))
-                    return 0;
-                break;
-            case 'G':
-                flags |= DP_F_UP;
-                /* fall through */
-            case 'g':
-                if (cflags == DP_C_LDOUBLE)
-                    fvalue = va_arg(args, LDOUBLE);
-                else
-                    fvalue = va_arg(args, double);
-                if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
-                        flags, G_FORMAT))
-                    return 0;
-                break;
+#if defined(_MSC_VER) && _MSC_VER < 1900
+    /* Fix MSVC 2013 format to accept C99 format strings */
+    if (!msvc_translate_printf_format(format, &fmt, &msvc_fmt_alloc))
+        goto done;
 #else
-            case 'f':
-            case 'E':
-            case 'e':
-            case 'G':
-            case 'g':
-                /* not implemented for UEFI */
-                ERR_raise(ERR_LIB_BIO, ERR_R_UNSUPPORTED);
-                return 0;
+    fmt = format;
 #endif
-            case 'c':
-                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen,
-                        va_arg(args, int)))
-                    return 0;
-                break;
-            case 's':
-                strvalue = va_arg(args, char *);
-                if (max < 0) {
-                    if (buffer)
-                        max = INT_MAX;
-                    else
-                        max = *maxlen;
-                }
-                if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
-                        flags, min, max))
-                    return 0;
-                break;
-            case 'p':
-                value = (size_t)va_arg(args, void *);
-                if (!fmtint(sbuffer, buffer, &currlen, maxlen,
-                        value, 16, min, max, flags | DP_F_NUM))
-                    return 0;
-                break;
-            case 'n': {
-                int *num;
-                num = va_arg(args, int *);
-                *num = currlen;
-            } break;
-            case '%':
-                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
-                    return 0;
-                break;
-            case 'w':
-                /* not supported yet, treat as next char */
-                format++;
-                break;
-            default:
-                /* unknown, skip */
-                break;
-            }
-            ch = *format++;
-            state = DP_S_DEFAULT;
-            flags = cflags = min = 0;
-            max = -1;
-            break;
-        case DP_S_DONE:
-            break;
-        default:
-            break;
-        }
-    }
-    /*
-     * We have to truncate if there is no dynamic buffer and we have filled the
-     * static buffer.
-     */
-    if (buffer == NULL) {
-        *truncated = (currlen > *maxlen - 1);
-        if (*truncated)
-            currlen = *maxlen - 1;
-    }
-    if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
-        return 0;
-    *retlen = currlen - 1;
-    return 1;
-}
-
-static int
-fmtstr(char **sbuffer,
-    char **buffer,
-    size_t *currlen,
-    size_t *maxlen, const char *value, int flags, int min, int max)
-{
-    int padlen;
-    size_t strln;
-    int cnt = 0;
-
-    if (value == 0)
-        value = "<NULL>";
-
-    strln = OPENSSL_strnlen(value, max < 0 ? SIZE_MAX : (size_t)max);
-
-    padlen = min - strln;
-    if (min < 0 || padlen < 0)
-        padlen = 0;
-    if (max >= 0) {
-        /*
-         * Calculate the maximum output including padding.
-         * Make sure max doesn't overflow into negativity
-         */
-        if (max < INT_MAX - padlen)
-            max += padlen;
-        else
-            max = INT_MAX;
-    }
-    if (flags & DP_F_MINUS)
-        padlen = -padlen;
-
-    while ((padlen > 0) && (max < 0 || cnt < max)) {
-        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
-            return 0;
-        --padlen;
-        ++cnt;
-    }
-    while (strln > 0 && (max < 0 || cnt < max)) {
-        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++))
-            return 0;
-        --strln;
-        ++cnt;
-    }
-    while ((padlen < 0) && (max < 0 || cnt < max)) {
-        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
-            return 0;
-        ++padlen;
-        ++cnt;
-    }
-    return 1;
-}
-
-static int
-fmtint(char **sbuffer,
-    char **buffer,
-    size_t *currlen,
-    size_t *maxlen, int64_t value, int base, int min, int max, int flags)
-{
-    int signvalue = 0;
-    const char *prefix = "";
-    uint64_t uvalue;
-    char convert[DECIMAL_SIZE(value) + 3];
-    int place = 0;
-    int spadlen = 0;
-    int zpadlen = 0;
-    int caps = 0;
-
-    if (max < 0)
-        max = 0;
-    uvalue = value;
-    if (!(flags & DP_F_UNSIGNED)) {
-        if (value < 0) {
-            signvalue = '-';
-            uvalue = 0 - (uint64_t)value;
-        } else if (flags & DP_F_PLUS)
-            signvalue = '+';
-        else if (flags & DP_F_SPACE)
-            signvalue = ' ';
-    }
-    if (flags & DP_F_NUM) {
-        if (base == 8)
-            prefix = "0";
-        if (base == 16)
-            prefix = "0x";
-    }
-    if (flags & DP_F_UP)
-        caps = 1;
-    do {
-        convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
-            [uvalue % (unsigned)base];
-        uvalue = (uvalue / (unsigned)base);
-    } while (uvalue && (place < (int)sizeof(convert)));
-    if (place == sizeof(convert))
-        place--;
-    convert[place] = 0;
-
-    zpadlen = max - place;
-    spadlen = min - OSSL_MAX(max, place) - (signvalue ? 1 : 0) - strlen(prefix);
-    if (zpadlen < 0)
-        zpadlen = 0;
-    if (spadlen < 0)
-        spadlen = 0;
-    if (flags & DP_F_ZERO) {
-        zpadlen = OSSL_MAX(zpadlen, spadlen);
-        spadlen = 0;
-    }
-    if (flags & DP_F_MINUS)
-        spadlen = -spadlen;
-
-    /* spaces */
-    while (spadlen > 0) {
-        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
-            return 0;
-        --spadlen;
-    }
-
-    /* sign */
-    if (signvalue)
-        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
-            return 0;
-
-    /* prefix */
-    while (*prefix) {
-        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *prefix))
-            return 0;
-        prefix++;
-    }
-
-    /* zeros */
-    if (zpadlen > 0) {
-        while (zpadlen > 0) {
-            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
-                return 0;
-            --zpadlen;
-        }
-    }
-    /* digits */
-    while (place > 0) {
-        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]))
-            return 0;
-    }
-
-    /* left justified spaces */
-    while (spadlen < 0) {
-        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
-            return 0;
-        ++spadlen;
-    }
-    return 1;
-}
-
-#ifndef OPENSSL_SYS_UEFI
-
-static LDOUBLE abs_val(LDOUBLE value)
-{
-    LDOUBLE result = value;
-    if (value < 0)
-        result = -value;
-    if (result > 0 && result / 2 == result) /* INF */
-        result = 0;
-    else if (result != result) /* NAN */
-        result = 0;
-    return result;
-}
-
-static LDOUBLE pow_10(int in_exp)
-{
-    LDOUBLE result = 1;
-    while (in_exp) {
-        result *= 10;
-        in_exp--;
-    }
-    return result;
-}
-
-static long roundv(LDOUBLE value)
-{
-    long intpart;
-    intpart = (long)value;
-    value = value - intpart;
-    if (value >= 0.5)
-        intpart++;
-    return intpart;
-}
-
-static int
-fmtfp(char **sbuffer,
-    char **buffer,
-    size_t *currlen,
-    size_t *maxlen, LDOUBLE fvalue, int min, int max, int flags, int style)
-{
-    int signvalue = 0;
-    LDOUBLE ufvalue;
-    LDOUBLE tmpvalue;
-    char iconvert[20];
-    char fconvert[20];
-    char econvert[20];
-    int iplace = 0;
-    int fplace = 0;
-    int eplace = 0;
-    int padlen = 0;
-    int zpadlen = 0;
-    long exp = 0;
-    unsigned long intpart;
-    unsigned long fracpart;
-    unsigned long max10;
-    int realstyle;
-
-    if (max < 0)
-        max = 6;

-    if (fvalue < 0)
-        signvalue = '-';
-    else if (flags & DP_F_PLUS)
-        signvalue = '+';
-    else if (flags & DP_F_SPACE)
-        signvalue = ' ';
-    ufvalue = abs_val(fvalue);
-    if (ufvalue == 0 && fvalue != 0) /* INF or NAN? */
-        signvalue = '?';
+    va_copy(cp_args, args);

     /*
-     * G_FORMAT sometimes prints like E_FORMAT and sometimes like F_FORMAT
-     * depending on the number to be printed. Work out which one it is and use
-     * that from here on.
+     * some compilers modify va_list, hence each call to v*printf()
+     * should operate with its own instance of va_list. The first
+     * call to vsnprintf() here uses args we got in function argument.
+     * The second call is going to use cp_args we made earlier.
      */
-    if (style == G_FORMAT) {
-        if (ufvalue == 0.0) {
-            realstyle = F_FORMAT;
-        } else if (ufvalue < 0.0001) {
-            realstyle = E_FORMAT;
-        } else if ((max == 0 && ufvalue >= 10)
-            || (max > 0 && ufvalue >= pow_10(max))) {
-            realstyle = E_FORMAT;
-        } else {
-            realstyle = F_FORMAT;
-        }
-    } else {
-        realstyle = style;
-    }
-
-    if (style != F_FORMAT) {
-        tmpvalue = ufvalue;
-        /* Calculate the exponent */
-        if (ufvalue != 0.0) {
-            while (tmpvalue < 1) {
-                tmpvalue *= 10;
-                exp--;
-            }
-            while (tmpvalue > 10) {
-                tmpvalue /= 10;
-                exp++;
-            }
-        }
-        if (style == G_FORMAT) {
-            /*
-             * In G_FORMAT the "precision" represents significant digits. We
-             * always have at least 1 significant digit.
-             */
-            if (max == 0)
-                max = 1;
-            /* Now convert significant digits to decimal places */
-            if (realstyle == F_FORMAT) {
-                max -= (exp + 1);
-                if (max < 0) {
-                    /*
-                     * Should not happen. If we're in F_FORMAT then exp < max?
-                     */
-                    (void)doapr_outch(sbuffer, buffer, currlen, maxlen, '\0');
-                    return 0;
-                }
+    sz = vsnprintf(buf, sizeof(buf), fmt, args);
+    if (sz >= 0) {
+        if ((size_t)sz >= sizeof(buf)) {
+            sz += 1;
+            abuf = (char *)OPENSSL_malloc(sz);
+            if (abuf == NULL) {
+                ret = -1;
             } else {
-                /*
-                 * In E_FORMAT there is always one significant digit in front
-                 * of the decimal point, so:
-                 * significant digits == 1 + decimal places
-                 */
-                max--;
-            }
-        }
-        if (realstyle == E_FORMAT)
-            ufvalue = tmpvalue;
-    }
-
-    /*
-     * By subtracting 65535 (2^16-1) we cancel the low order 15 bits
-     * of ULONG_MAX to avoid using imprecise floating point values.
-     */
-    if (ufvalue >= (double)(ULONG_MAX - 65535) + 65536.0) {
-        /* Number too big */
-        (void)doapr_outch(sbuffer, buffer, currlen, maxlen, '\0');
-        return 0;
-    }
-    intpart = (unsigned long)ufvalue;
-
-    /*
-     * sorry, we only support 9 digits past the decimal because of our
-     * conversion method
-     */
-    if (max > 9)
-        max = 9;
-
-    /*
-     * we "cheat" by converting the fractional part to integer by multiplying
-     * by a factor of 10
-     */
-    max10 = roundv(pow_10(max));
-    fracpart = roundv(pow_10(max) * (ufvalue - intpart));
-
-    if (fracpart >= max10) {
-        intpart++;
-        fracpart -= max10;
-    }
-
-    /* convert integer part */
-    do {
-        iconvert[iplace++] = "0123456789"[intpart % 10];
-        intpart = (intpart / 10);
-    } while (intpart && (iplace < (int)sizeof(iconvert)));
-    if (iplace == sizeof(iconvert))
-        iplace--;
-    iconvert[iplace] = 0;
-
-    /* convert fractional part */
-    while (fplace < max) {
-        if (style == G_FORMAT && fplace == 0 && (fracpart % 10) == 0) {
-            /* We strip trailing zeros in G_FORMAT */
-            max--;
-            fracpart = fracpart / 10;
-            if (fplace < max)
-                continue;
-            break;
-        }
-        fconvert[fplace++] = "0123456789"[fracpart % 10];
-        fracpart = (fracpart / 10);
-    }
-
-    fconvert[fplace] = 0;
-
-    /* convert exponent part */
-    if (realstyle == E_FORMAT) {
-        int tmpexp;
-        if (exp < 0)
-            tmpexp = -exp;
-        else
-            tmpexp = exp;
-
-        do {
-            econvert[eplace++] = "0123456789"[tmpexp % 10];
-            tmpexp = (tmpexp / 10);
-        } while (tmpexp > 0 && eplace < (int)sizeof(econvert));
-        /* Exponent is huge!! Too big to print */
-        if (tmpexp > 0) {
-            (void)doapr_outch(sbuffer, buffer, currlen, maxlen, '\0');
-            return 0;
-        }
-        /* Add a leading 0 for single digit exponents */
-        if (eplace == 1)
-            econvert[eplace++] = '0';
-    }
-
-    /*
-     * -1 for decimal point (if we have one, i.e. max > 0),
-     * another -1 if we are printing a sign
-     */
-    padlen = min - iplace - max - (max > 0 ? 1 : 0) - ((signvalue) ? 1 : 0);
-    /* Take some off for exponent prefix "+e" and exponent */
-    if (realstyle == E_FORMAT)
-        padlen -= 2 + eplace;
-    zpadlen = max - fplace;
-    if (zpadlen < 0)
-        zpadlen = 0;
-    if (padlen < 0)
-        padlen = 0;
-    if (flags & DP_F_MINUS)
-        padlen = -padlen;
-
-    if ((flags & DP_F_ZERO) && (padlen > 0)) {
-        if (signvalue) {
-            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
-                return 0;
-            --padlen;
-            signvalue = 0;
-        }
-        while (padlen > 0) {
-            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
-                return 0;
-            --padlen;
-        }
-    }
-    while (padlen > 0) {
-        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
-            return 0;
-        --padlen;
-    }
-    if (signvalue && !doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
-        return 0;
-
-    while (iplace > 0) {
-        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, iconvert[--iplace]))
-            return 0;
-    }
-
-    /*
-     * Decimal point. This should probably use locale to find the correct
-     * char to print out.
-     */
-    if (max > 0 || (flags & DP_F_NUM)) {
-        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '.'))
-            return 0;
-
-        while (fplace > 0) {
-            if (!doapr_outch(sbuffer, buffer, currlen, maxlen,
-                    fconvert[--fplace]))
-                return 0;
-        }
-    }
-    while (zpadlen > 0) {
-        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
-            return 0;
-        --zpadlen;
-    }
-    if (realstyle == E_FORMAT) {
-        char ech;
-
-        if ((flags & DP_F_UP) == 0)
-            ech = 'e';
-        else
-            ech = 'E';
-        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ech))
-            return 0;
-        if (exp < 0) {
-            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '-'))
-                return 0;
-        } else {
-            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '+'))
-                return 0;
-        }
-        while (eplace > 0) {
-            if (!doapr_outch(sbuffer, buffer, currlen, maxlen,
-                    econvert[--eplace]))
-                return 0;
-        }
-    }
-
-    while (padlen < 0) {
-        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
-            return 0;
-        ++padlen;
-    }
-    return 1;
-}
-
-#endif /* OPENSSL_SYS_UEFI */
-
-#define BUFFER_INC 1024
-
-static int
-doapr_outch(char **sbuffer,
-    char **buffer, size_t *currlen, size_t *maxlen, int c)
-{
-    /* If we haven't at least one buffer, someone has done a big booboo */
-    if (!ossl_assert(*sbuffer != NULL || buffer != NULL))
-        return 0;
-
-    /* |currlen| must always be <= |*maxlen| */
-    if (!ossl_assert(*currlen <= *maxlen))
-        return 0;
-
-    if (buffer && *currlen == *maxlen) {
-        if (*maxlen > INT_MAX - BUFFER_INC)
-            return 0;
-
-        *maxlen += BUFFER_INC;
-        if (*buffer == NULL) {
-            if ((*buffer = OPENSSL_malloc(*maxlen)) == NULL)
-                return 0;
-            if (*currlen > 0) {
-                if (!ossl_assert(*sbuffer != NULL))
-                    return 0;
-                memcpy(*buffer, *sbuffer, *currlen);
+                sz = vsnprintf(abuf, sz, fmt, cp_args);
+                ret = BIO_write(bio, abuf, sz);
+                OPENSSL_free(abuf);
             }
-            *sbuffer = NULL;
         } else {
-            char *tmpbuf;
-
-            tmpbuf = OPENSSL_realloc(*buffer, *maxlen);
-            if (tmpbuf == NULL)
-                return 0;
-            *buffer = tmpbuf;
+            /* vsnprintf returns length not including nul-terminator */
+            ret = BIO_write(bio, buf, sz);
         }
     }
-
-    if (*currlen < *maxlen) {
-        if (*sbuffer)
-            (*sbuffer)[(*currlen)++] = (char)c;
-        else
-            (*buffer)[(*currlen)++] = (char)c;
-    }
-
-    return 1;
-}
-
-/***************************************************************************/
-
-int BIO_printf(BIO *bio, const char *format, ...)
-{
-    va_list args;
-    int ret;
-
-    va_start(args, format);
-
-    ret = BIO_vprintf(bio, format, args);
-
-    va_end(args);
-    return ret;
-}
-
-int BIO_vprintf(BIO *bio, const char *format, va_list args)
-{
-    int ret;
-    size_t retlen;
-    char hugebuf[1024 * 2]; /* Was previously 10k, which is unreasonable
-                             * in small-stack environments, like threads
-                             * or DOS programs. */
-    char *hugebufp = hugebuf;
-    size_t hugebufsize = sizeof(hugebuf);
-    char *dynbuf = NULL;
-    int ignored;
-
-    dynbuf = NULL;
-    if (!_dopr(&hugebufp, &dynbuf, &hugebufsize, &retlen, &ignored, format,
-            args)) {
-        OPENSSL_free(dynbuf);
-        return -1;
-    }
-    if (dynbuf) {
-        ret = BIO_write(bio, dynbuf, (int)retlen);
-        OPENSSL_free(dynbuf);
-    } else {
-        ret = BIO_write(bio, hugebuf, (int)retlen);
-    }
+    va_end(cp_args);
+#if defined(_MSC_VER) && _MSC_VER < 1900
+done:
+    OPENSSL_free(msvc_fmt_alloc);
+#endif
     return ret;
 }

+#ifndef OPENSSL_NO_DEPRECATED_4_1
 /*
- * As snprintf is not available everywhere, we provide our own
- * implementation. This function has nothing to do with BIOs, but it's
- * closely related to BIO_printf, and we need *some* name prefix ... (XXX the
- * function should be renamed, but to what?)
+ * For historical reasons BIO_snprintf and friends return -1 on truncation
+ * instead of the C99 snprintf semantic of returning the number of characters
+ * that would have been written.  Deprecated in 4.1; new code should call
+ * snprintf() / vsnprintf() directly.
  */
 int BIO_snprintf(char *buf, size_t n, const char *format, ...)
 {
@@ -931,27 +95,22 @@ int BIO_snprintf(char *buf, size_t n, const char *format, ...)

     va_start(args, format);

-    ret = BIO_vsnprintf(buf, n, format, args);
-
+    ret = vsnprintf(buf, n, format, args);
+    if ((size_t)ret >= n)
+        ret = -1;
     va_end(args);
+
     return ret;
 }

 int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
 {
-    size_t retlen;
-    int truncated;
+    int ret;

-    if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
-        return -1;
+    ret = vsnprintf(buf, n, format, args);
+    if ((size_t)ret >= n)
+        ret = -1;

-    if (truncated)
-        /*
-         * In case of truncation, return -1 like traditional snprintf.
-         * (Current drafts for ISO/IEC 9899 say snprintf should return the
-         * number of characters that would have been written, had the buffer
-         * been large enough.)
-         */
-        return -1;
-    return (retlen <= INT_MAX) ? (int)retlen : -1;
+    return ret;
 }
+#endif /* OPENSSL_NO_DEPRECATED_4_1 */
diff --git a/deps/openssl/openssl/crypto/bio/bio_sock.c b/deps/openssl/openssl/crypto/bio/bio_sock.c
index 5b793b9af1d..ef8376eb1b8 100644
--- a/deps/openssl/openssl/crypto/bio/bio_sock.c
+++ b/deps/openssl/openssl/crypto/bio/bio_sock.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -437,7 +437,7 @@ int BIO_socket_wait(int fd, int for_read, time_t max_time)
     time_t now;

 #ifdef _WIN32
-    if ((SOCKET)fd == INVALID_SOCKET)
+    if (fd == (int)INVALID_SOCKET)
 #else
     if (fd < 0 || fd >= FD_SETSIZE)
 #endif
@@ -473,4 +473,41 @@ int BIO_socket_wait(int fd, int for_read, time_t max_time)
     return poll(&confds, 1, (int)(max_time - now) * 1000);
 #endif
 }
+
+/*
+ * Check if fd is ready for reading or writing without blocking.
+ * If for_read == 0 then check for writing, else check for reading.
+ * Returns -1 on error, 0 if not ready, and 1 if ready.
+ */
+int BIO_socket_ready(int fd, int for_read)
+{
+#if defined(OPENSSL_SYS_WINDOWS) || !defined(POLLIN)
+    fd_set confds;
+    struct timeval tv;
+
+#ifdef _WIN32
+    if (fd == (int)INVALID_SOCKET)
+#else
+    if (fd < 0 || fd >= FD_SETSIZE)
+#endif
+        return -1;
+
+    FD_ZERO(&confds);
+    openssl_fdset(fd, &confds);
+    tv.tv_sec = 0;
+    tv.tv_usec = 0;
+    return select(fd + 1, for_read ? &confds : NULL,
+        for_read ? NULL : &confds, NULL, &tv);
+#else
+    struct pollfd confds;
+
+    if (fd < 0)
+        return -1;
+
+    confds.fd = fd;
+    confds.events = for_read ? POLLIN : POLLOUT;
+    confds.revents = 0;
+    return poll(&confds, 1, 0);
+#endif
+}
 #endif /* !defined(OPENSSL_NO_SOCK) */
diff --git a/deps/openssl/openssl/crypto/bio/bss_acpt.c b/deps/openssl/openssl/crypto/bio/bss_acpt.c
index 14bc36d2d87..c9cdba041a4 100644
--- a/deps/openssl/openssl/crypto/bio/bss_acpt.c
+++ b/deps/openssl/openssl/crypto/bio/bss_acpt.c
@@ -15,26 +15,6 @@

 #ifndef OPENSSL_NO_SOCK

-typedef struct bio_accept_st {
-    int state;
-    int accept_family;
-    int bind_mode; /* Socket mode for BIO_listen */
-    int accepted_mode; /* Socket mode for BIO_accept (set on accepted sock) */
-    char *param_addr;
-    char *param_serv;
-
-    int accept_sock;
-
-    BIO_ADDRINFO *addr_first;
-    const BIO_ADDRINFO *addr_iter;
-    BIO_ADDR cache_accepting_addr; /* Useful if we asked for port 0 */
-    char *cache_accepting_name, *cache_accepting_serv;
-    BIO_ADDR cache_peer_addr;
-    char *cache_peer_name, *cache_peer_serv;
-
-    BIO *bio_chain;
-} BIO_ACCEPT;
-
 static int acpt_write(BIO *h, const char *buf, int num);
 static int acpt_read(BIO *h, char *buf, int size);
 static int acpt_puts(BIO *h, const char *str);
@@ -46,13 +26,6 @@ static void acpt_close_socket(BIO *data);
 static BIO_ACCEPT *BIO_ACCEPT_new(void);
 static void BIO_ACCEPT_free(BIO_ACCEPT *a);

-#define ACPT_S_BEFORE 1
-#define ACPT_S_GET_ADDR 2
-#define ACPT_S_CREATE_SOCKET 3
-#define ACPT_S_LISTEN 4
-#define ACPT_S_ACCEPT 5
-#define ACPT_S_OK 6
-
 static const BIO_METHOD methods_acceptp = {
     BIO_TYPE_ACCEPT,
     "socket accept",
@@ -83,7 +56,7 @@ static int acpt_new(BIO *bi)
     if ((ba = BIO_ACCEPT_new()) == NULL)
         return 0;
     bi->ptr = (char *)ba;
-    ba->state = ACPT_S_BEFORE;
+    ba->state = BIO_ACPT_S_BEFORE;
     bi->shutdown = 1;
     return 1;
 }
@@ -152,7 +125,7 @@ static int acpt_state(BIO *b, BIO_ACCEPT *c)

     for (;;) {
         switch (c->state) {
-        case ACPT_S_BEFORE:
+        case BIO_ACPT_S_BEFORE:
             if (c->param_addr == NULL && c->param_serv == NULL) {
                 ERR_raise_data(ERR_LIB_BIO,
                     BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED,
@@ -174,10 +147,10 @@ static int acpt_state(BIO *b, BIO_ACCEPT *c)
             OPENSSL_free(c->cache_peer_serv);
             c->cache_peer_serv = NULL;

-            c->state = ACPT_S_GET_ADDR;
+            c->state = BIO_ACPT_S_GET_ADDR;
             break;

-        case ACPT_S_GET_ADDR: {
+        case BIO_ACPT_S_GET_ADDR: {
             int family = AF_UNSPEC;
             switch (c->accept_family) {
             case BIO_FAMILY_IPV6:
@@ -213,10 +186,10 @@ static int acpt_state(BIO *b, BIO_ACCEPT *c)
                 goto exit_loop;
             }
             c->addr_iter = c->addr_first;
-            c->state = ACPT_S_CREATE_SOCKET;
+            c->state = BIO_ACPT_S_CREATE_SOCKET;
             break;

-        case ACPT_S_CREATE_SOCKET:
+        case BIO_ACPT_S_CREATE_SOCKET:
             ERR_set_mark();
             s = BIO_socket(BIO_ADDRINFO_family(c->addr_iter),
                 BIO_ADDRINFO_socktype(c->addr_iter),
@@ -238,11 +211,11 @@ static int acpt_state(BIO *b, BIO_ACCEPT *c)
             }
             c->accept_sock = s;
             b->num = s;
-            c->state = ACPT_S_LISTEN;
+            c->state = BIO_ACPT_S_LISTEN;
             s = -1;
             break;

-        case ACPT_S_LISTEN: {
+        case BIO_ACPT_S_LISTEN: {
             if (!BIO_listen(c->accept_sock,
                     BIO_ADDRINFO_address(c->addr_iter),
                     c->bind_mode)) {
@@ -271,14 +244,14 @@ static int acpt_state(BIO *b, BIO_ACCEPT *c)
             OPENSSL_free(c->cache_accepting_serv);
             c->cache_accepting_name = BIO_ADDR_hostname_string(&c->cache_accepting_addr, 1);
             c->cache_accepting_serv = BIO_ADDR_service_string(&c->cache_accepting_addr, 1);
-            c->state = ACPT_S_ACCEPT;
+            c->state = BIO_ACPT_S_ACCEPT;
             s = -1;
             ret = 1;
             goto end;

-        case ACPT_S_ACCEPT:
+        case BIO_ACPT_S_ACCEPT:
             if (b->next_bio != NULL) {
-                c->state = ACPT_S_OK;
+                c->state = BIO_ACPT_S_OK;
                 break;
             }
             BIO_clear_retry_flags(b);
@@ -334,14 +307,14 @@ static int acpt_state(BIO *b, BIO_ACCEPT *c)

             c->cache_peer_name = BIO_ADDR_hostname_string(&c->cache_peer_addr, 1);
             c->cache_peer_serv = BIO_ADDR_service_string(&c->cache_peer_addr, 1);
-            c->state = ACPT_S_OK;
+            c->state = BIO_ACPT_S_OK;
             bio = NULL;
             ret = 1;
             goto end;

-        case ACPT_S_OK:
+        case BIO_ACPT_S_OK:
             if (b->next_bio == NULL) {
-                c->state = ACPT_S_ACCEPT;
+                c->state = BIO_ACPT_S_ACCEPT;
                 break;
             }
             ret = 1;
@@ -412,7 +385,7 @@ static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr)
     switch (cmd) {
     case BIO_CTRL_RESET:
         ret = 0;
-        data->state = ACPT_S_BEFORE;
+        data->state = BIO_ACPT_S_BEFORE;
         acpt_close_socket(b);
         BIO_ADDRINFO_free(data->addr_first);
         data->addr_first = NULL;
@@ -474,7 +447,7 @@ static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr)
     case BIO_C_SET_FD:
         b->num = *((int *)ptr);
         data->accept_sock = b->num;
-        data->state = ACPT_S_ACCEPT;
+        data->state = BIO_ACPT_S_ACCEPT;
         b->shutdown = (int)num;
         b->init = 1;
         break;
@@ -558,10 +531,12 @@ static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr)

 static int acpt_puts(BIO *bp, const char *str)
 {
-    int n, ret;
+    int ret;
+    size_t n = strlen(str);

-    n = strlen(str);
-    ret = acpt_write(bp, str, n);
+    if (n > INT_MAX)
+        return -1;
+    ret = acpt_write(bp, str, (int)n);
     return ret;
 }

diff --git a/deps/openssl/openssl/crypto/bio/bss_bio.c b/deps/openssl/openssl/crypto/bio/bss_bio.c
index 54de5d3f67c..8f7c0fcb3df 100644
--- a/deps/openssl/openssl/crypto/bio/bss_bio.c
+++ b/deps/openssl/openssl/crypto/bio/bss_bio.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -112,6 +112,9 @@ static int bio_read(BIO *bio, char *buf, int size_)
     size_t rest;
     struct bio_bio_st *b, *peer_b;

+    if (buf == NULL || size_ <= 0)
+        return 0;
+
     BIO_clear_retry_flags(bio);

     if (!bio->init)
@@ -126,9 +129,6 @@ static int bio_read(BIO *bio, char *buf, int size_)

     peer_b->request = 0; /* will be set in "retry_read" situation */

-    if (buf == NULL || size == 0)
-        return 0;
-
     if (peer_b->len == 0) {
         if (peer_b->closed)
             return 0; /* writer has closed, and no data is left */
@@ -182,7 +182,7 @@ static int bio_read(BIO *bio, char *buf, int size_)
         rest -= chunk;
     } while (rest);

-    return size;
+    return (int)size;
 }

 /*-
@@ -330,7 +330,7 @@ static int bio_write(BIO *bio, const char *buf, int num_)
         buf += chunk;
     } while (rest);

-    return num;
+    return (int)num;
 }

 /*-
@@ -470,7 +470,7 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr)
         if (b->peer == NULL || b->closed)
             ret = 0;
         else
-            ret = (long)b->size - b->len;
+            ret = (long)(b->size - b->len);
         break;

     case BIO_C_GET_READ_REQUEST:
@@ -596,7 +596,11 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr)

 static int bio_puts(BIO *bio, const char *str)
 {
-    return bio_write(bio, str, strlen(str));
+    size_t len = strlen(str);
+
+    if (len > INT_MAX)
+        return -1;
+    return bio_write(bio, str, (int)len);
 }

 static int bio_make_pair(BIO *bio1, BIO *bio2)
@@ -679,6 +683,9 @@ int BIO_new_bio_pair(BIO **bio1_p, size_t writebuf1,
     long r;
     int ret = 0;

+    if (writebuf1 > LONG_MAX || writebuf2 > LONG_MAX)
+        goto err;
+
     bio1 = BIO_new(BIO_s_bio());
     if (bio1 == NULL)
         goto err;
@@ -687,12 +694,12 @@ int BIO_new_bio_pair(BIO **bio1_p, size_t writebuf1,
         goto err;

     if (writebuf1) {
-        r = BIO_set_write_buf_size(bio1, writebuf1);
+        r = BIO_set_write_buf_size(bio1, (long)writebuf1);
         if (!r)
             goto err;
     }
     if (writebuf2) {
-        r = BIO_set_write_buf_size(bio2, writebuf2);
+        r = BIO_set_write_buf_size(bio2, (long)writebuf2);
         if (!r)
             goto err;
     }
diff --git a/deps/openssl/openssl/crypto/bio/bss_conn.c b/deps/openssl/openssl/crypto/bio/bss_conn.c
index 335704ee318..c4355392e4d 100644
--- a/deps/openssl/openssl/crypto/bio/bss_conn.c
+++ b/deps/openssl/openssl/crypto/bio/bss_conn.c
@@ -16,37 +16,6 @@

 #ifndef OPENSSL_NO_SOCK

-typedef struct bio_connect_st {
-    int state;
-    int connect_family;
-    int connect_sock_type;
-    char *param_hostname;
-    char *param_service;
-    int connect_mode;
-#ifndef OPENSSL_NO_KTLS
-    unsigned char record_type;
-#endif
-    int tfo_first;
-
-    BIO_ADDRINFO *addr_first;
-    const BIO_ADDRINFO *addr_iter;
-    /*
-     * int socket; this will be kept in bio->num so that it is compatible
-     * with the bss_sock bio
-     */
-    /*
-     * called when the connection is initially made callback(BIO,state,ret);
-     * The callback should return 'ret'.  state is for compatibility with the
-     * ssl info_callback
-     */
-    BIO_info_cb *info_callback;
-    /*
-     * Used when connect_sock_type is SOCK_DGRAM. Owned by us; we forward
-     * read/write(mmsg) calls to this if present.
-     */
-    BIO *dgram_bio;
-} BIO_CONNECT;
-
 static int conn_write(BIO *h, const char *buf, int num);
 static int conn_read(BIO *h, char *buf, int size);
 static int conn_puts(BIO *h, const char *str);
@@ -65,14 +34,6 @@ static void conn_close_socket(BIO *data);
 static BIO_CONNECT *BIO_CONNECT_new(void);
 static void BIO_CONNECT_free(BIO_CONNECT *a);

-#define BIO_CONN_S_BEFORE 1
-#define BIO_CONN_S_GET_ADDR 2
-#define BIO_CONN_S_CREATE_SOCKET 3
-#define BIO_CONN_S_CONNECT 4
-#define BIO_CONN_S_OK 5
-#define BIO_CONN_S_BLOCKED_CONNECT 6
-#define BIO_CONN_S_CONNECT_ERROR 7
-
 static const BIO_METHOD methods_connectp = {
     BIO_TYPE_CONNECT,
     "socket connect",
@@ -373,8 +334,9 @@ static int conn_read(BIO *b, char *out, int outl)
         return ret;
     }

-    if (out != NULL) {
+    if (out != NULL && outl > 0) {
         clear_socket_error();
+        b->flags &= ~BIO_FLAGS_IN_EOF;
 #ifndef OPENSSL_NO_KTLS
         if (BIO_get_ktls_recv(b))
             ret = ktls_read_record(b->num, out, outl);
@@ -414,7 +376,7 @@ static int conn_write(BIO *b, const char *in, int inl)
     clear_socket_error();
 #ifndef OPENSSL_NO_KTLS
     if (BIO_should_ktls_ctrl_msg_flag(b)) {
-        ret = ktls_send_ctrl_message(b->num, data->record_type, in, inl);
+        ret = ktls_send_ctrl_message(b->num, data->record_type, in, inl, 0);
         if (ret >= 0) {
             ret = inl;
             BIO_clear_ktls_ctrl_msg_flag(b);
@@ -735,10 +697,12 @@ static long conn_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)

 static int conn_puts(BIO *bp, const char *str)
 {
-    int n, ret;
+    int ret;
+    size_t n = strlen(str);

-    n = strlen(str);
-    ret = conn_write(bp, str, n);
+    if (n > INT_MAX)
+        return -1;
+    ret = conn_write(bp, str, (int)n);
     return ret;
 }

@@ -775,6 +739,7 @@ int conn_gets(BIO *bio, char *buf, int size)
     }

     clear_socket_error();
+    bio->flags &= ~BIO_FLAGS_IN_EOF;
     while (size-- > 1) {
 #ifndef OPENSSL_NO_KTLS
         if (BIO_get_ktls_recv(bio))
@@ -794,7 +759,7 @@ int conn_gets(BIO *bio, char *buf, int size)
             break;
     }
     *ptr = '\0';
-    return ret > 0 || (bio->flags & BIO_FLAGS_IN_EOF) != 0 ? ptr - buf : ret;
+    return ret > 0 || (bio->flags & BIO_FLAGS_IN_EOF) != 0 ? (int)(ptr - buf) : ret;
 }

 static int conn_sendmmsg(BIO *bio, BIO_MSG *msg, size_t stride, size_t num_msgs,
diff --git a/deps/openssl/openssl/crypto/bio/bss_dgram.c b/deps/openssl/openssl/crypto/bio/bss_dgram.c
index 968104a0620..0ef973c195d 100644
--- a/deps/openssl/openssl/crypto/bio/bss_dgram.c
+++ b/deps/openssl/openssl/crypto/bio/bss_dgram.c
@@ -14,7 +14,6 @@
 #include <stdio.h>
 #include <errno.h>

-#include "internal/time.h"
 #include "bio_local.h"
 #ifndef OPENSSL_NO_DGRAM

@@ -213,21 +212,7 @@ static const BIO_METHOD methods_dgramp_sctp = {
     NULL, /* sendmmsg */
     NULL, /* recvmmsg */
 };
-#endif
-
-typedef struct bio_dgram_data_st {
-    BIO_ADDR peer;
-    BIO_ADDR local_addr;
-    unsigned int connected;
-    unsigned int _errno;
-    unsigned int mtu;
-    OSSL_TIME next_timeout;
-    OSSL_TIME socket_timeout;
-    unsigned int peekmode;
-    char local_addr_enabled;
-} bio_dgram_data;

-#ifndef OPENSSL_NO_SCTP
 typedef struct bio_dgram_sctp_save_message_st {
     BIO *bio;
     char *data;
@@ -427,7 +412,7 @@ static int dgram_read(BIO *b, char *out, int outl)
     BIO_ADDR peer;
     socklen_t len = sizeof(peer);

-    if (out != NULL) {
+    if (out != NULL && outl > 0) {
         clear_socket_error();
         BIO_ADDR_clear(&peer);
         dgram_adjust_rcv_timeout(b);
@@ -1049,10 +1034,12 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)

 static int dgram_puts(BIO *bp, const char *str)
 {
-    int n, ret;
+    int ret;
+    size_t n = strlen(str);

-    n = strlen(str);
-    ret = dgram_write(bp, str, n);
+    if (n > INT_MAX)
+        return -1;
+    ret = dgram_write(bp, str, (int)n);
     return ret;
 }

@@ -1345,7 +1332,7 @@ static int dgram_sendmmsg(BIO *b, BIO_MSG *msg, size_t stride,
     size_t i;
     struct mmsghdr mh[BIO_MAX_MSGS_PER_CALL];
     struct iovec iov[BIO_MAX_MSGS_PER_CALL];
-    unsigned char control[BIO_MAX_MSGS_PER_CALL][BIO_CMSG_ALLOC_LEN];
+    unsigned char control[BIO_MAX_MSGS_PER_CALL][BIO_CMSG_ALLOC_LEN] = { { 0 } };
     int have_local_enabled = data->local_addr_enabled;
 #elif M_METHOD == M_METHOD_RECVMSG
     int sysflags;
@@ -1353,7 +1340,7 @@ static int dgram_sendmmsg(BIO *b, BIO_MSG *msg, size_t stride,
     ossl_ssize_t l;
     struct msghdr mh;
     struct iovec iov;
-    unsigned char control[BIO_CMSG_ALLOC_LEN];
+    unsigned char control[BIO_CMSG_ALLOC_LEN] = { 0 };
     int have_local_enabled = data->local_addr_enabled;
 #elif M_METHOD == M_METHOD_WSARECVMSG
     bio_dgram_data *data = (bio_dgram_data *)b->ptr;
@@ -1361,7 +1348,7 @@ static int dgram_sendmmsg(BIO *b, BIO_MSG *msg, size_t stride,
     WSAMSG wmsg;
     WSABUF wbuf;
     DWORD num_bytes_sent = 0;
-    unsigned char control[BIO_CMSG_ALLOC_LEN];
+    unsigned char control[BIO_CMSG_ALLOC_LEN] = { 0 };
 #endif
 #if M_METHOD == M_METHOD_RECVFROM || M_METHOD == M_METHOD_WSARECVMSG
     int sysflags;
@@ -2819,6 +2806,9 @@ int BIO_dgram_non_fatal_error(int err)
 {
     switch (err) {
 #if defined(OPENSSL_SYS_WINDOWS)
+#if defined(WSAETIMEDOUT)
+    case WSAETIMEDOUT:
+#endif
 #if defined(WSAEWOULDBLOCK)
     case WSAEWOULDBLOCK:
 #endif
diff --git a/deps/openssl/openssl/crypto/bio/bss_dgram_pair.c b/deps/openssl/openssl/crypto/bio/bss_dgram_pair.c
index 057f6737474..7e404a7260f 100644
--- a/deps/openssl/openssl/crypto/bio/bss_dgram_pair.c
+++ b/deps/openssl/openssl/crypto/bio/bss_dgram_pair.c
@@ -619,7 +619,7 @@ static int dgram_pair_ctrl_get_mtu(BIO *bio)
 {
     struct bio_dgram_pair_st *b = bio->ptr;

-    return b->mtu;
+    return (int)b->mtu;
 }

 /* BIO_dgram_set_mtu (BIO_CTRL_DGRAM_SET_MTU) */
@@ -806,6 +806,9 @@ int BIO_new_bio_dgram_pair(BIO **pbio1, size_t writebuf1,
     long r;
     BIO *bio1 = NULL, *bio2 = NULL;

+    if (writebuf1 > LONG_MAX || writebuf2 > LONG_MAX)
+        goto err;
+
     bio1 = BIO_new(BIO_s_dgram_pair());
     if (bio1 == NULL)
         goto err;
@@ -815,13 +818,13 @@ int BIO_new_bio_dgram_pair(BIO **pbio1, size_t writebuf1,
         goto err;

     if (writebuf1 > 0) {
-        r = BIO_set_write_buf_size(bio1, writebuf1);
+        r = BIO_set_write_buf_size(bio1, (long)writebuf1);
         if (r == 0)
             goto err;
     }

     if (writebuf2 > 0) {
-        r = BIO_set_write_buf_size(bio2, writebuf2);
+        r = BIO_set_write_buf_size(bio2, (long)writebuf2);
         if (r == 0)
             goto err;
     }
@@ -1036,7 +1039,7 @@ static int dgram_pair_read(BIO *bio, char *buf, int sz_)
     l = dgram_pair_read_actual(bio, buf, (size_t)sz_, NULL, NULL, 0);
     if (l < 0) {
         if (l != -BIO_R_NON_FATAL)
-            ERR_raise(ERR_LIB_BIO, -l);
+            ERR_raise(ERR_LIB_BIO, (int)-l);
         ret = -1;
     } else {
         ret = (int)l;
@@ -1089,7 +1092,7 @@ static int dgram_pair_recvmmsg(BIO *bio, BIO_MSG *msg,
             if (i > 0) {
                 ret = 1;
             } else {
-                ERR_raise(ERR_LIB_BIO, -l);
+                ERR_raise(ERR_LIB_BIO, (int)-l);
                 ret = 0;
             }
             goto out;
@@ -1126,7 +1129,7 @@ static int dgram_mem_read(BIO *bio, char *buf, int sz_)
     l = dgram_pair_read_actual(bio, buf, (size_t)sz_, NULL, NULL, 0);
     if (l < 0) {
         if (l != -BIO_R_NON_FATAL)
-            ERR_raise(ERR_LIB_BIO, -l);
+            ERR_raise(ERR_LIB_BIO, (int)-l);
         ret = -1;
     } else {
         ret = (int)l;
@@ -1288,7 +1291,7 @@ static int dgram_pair_write(BIO *bio, const char *buf, int sz_)

     l = dgram_pair_write_actual(bio, buf, (size_t)sz_, NULL, NULL, 0);
     if (l < 0) {
-        ERR_raise(ERR_LIB_BIO, -l);
+        ERR_raise(ERR_LIB_BIO, (int)-l);
         ret = -1;
     } else {
         ret = (int)l;
@@ -1303,10 +1306,11 @@ static int dgram_pair_sendmmsg(BIO *bio, BIO_MSG *msg,
     size_t stride, size_t num_msg,
     uint64_t flags, size_t *num_processed)
 {
-    ossl_ssize_t ret, l;
+    ossl_ssize_t l;
     BIO_MSG *m;
     size_t i;
     struct bio_dgram_pair_st *b = bio->ptr;
+    int ret = 0;

     if (num_msg == 0) {
         *num_processed = 0;
@@ -1328,8 +1332,7 @@ static int dgram_pair_sendmmsg(BIO *bio, BIO_MSG *msg,
             if (i > 0) {
                 ret = 1;
             } else {
-                ERR_raise(ERR_LIB_BIO, -l);
-                ret = 0;
+                ERR_raise(ERR_LIB_BIO, (int)-l);
             }
             goto out;
         }
diff --git a/deps/openssl/openssl/crypto/bio/bss_fd.c b/deps/openssl/openssl/crypto/bio/bss_fd.c
index 6046dd8582e..910da5e8b6e 100644
--- a/deps/openssl/openssl/crypto/bio/bss_fd.c
+++ b/deps/openssl/openssl/crypto/bio/bss_fd.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -114,9 +114,10 @@ static int fd_read(BIO *b, char *out, int outl)
 {
     int ret = 0;

-    if (out != NULL) {
+    if (out != NULL && outl > 0) {
         clear_sys_error();
-        ret = UP_read(b->num, out, outl);
+        b->flags &= ~BIO_FLAGS_IN_EOF;
+        ret = (int)UP_read(b->num, out, outl);
         BIO_clear_retry_flags(b);
         if (ret <= 0) {
             if (BIO_fd_should_retry(ret))
@@ -132,7 +133,7 @@ static int fd_write(BIO *b, const char *in, int inl)
 {
     int ret;
     clear_sys_error();
-    ret = UP_write(b->num, in, inl);
+    ret = (int)UP_write(b->num, in, inl);
     BIO_clear_retry_flags(b);
     if (ret <= 0) {
         if (BIO_fd_should_retry(ret))
@@ -198,10 +199,12 @@ static long fd_ctrl(BIO *b, int cmd, long num, void *ptr)

 static int fd_puts(BIO *bp, const char *str)
 {
-    int n, ret;
+    int ret;
+    size_t n = strlen(str);

-    n = strlen(str);
-    ret = fd_write(bp, str, n);
+    if (n > INT_MAX)
+        return -1;
+    ret = fd_write(bp, str, (int)n);
     return ret;
 }

@@ -219,7 +222,7 @@ static int fd_gets(BIO *bp, char *buf, int size)
     ptr[0] = '\0';

     if (buf[0] != '\0')
-        ret = strlen(buf);
+        ret = (int)strlen(buf);
     return ret;
 }

diff --git a/deps/openssl/openssl/crypto/bio/bss_file.c b/deps/openssl/openssl/crypto/bio/bss_file.c
index 023bb458ce5..e01cd3ba998 100644
--- a/deps/openssl/openssl/crypto/bio/bss_file.c
+++ b/deps/openssl/openssl/crypto/bio/bss_file.c
@@ -57,12 +57,18 @@ static const BIO_METHOD methods_filep = {
 BIO *BIO_new_file(const char *filename, const char *mode)
 {
     BIO *ret;
-    FILE *file = openssl_fopen(filename, mode);
+    FILE *file;
     int fp_flags = BIO_CLOSE;

     if (strchr(mode, 'b') == NULL)
         fp_flags |= BIO_FP_TEXT;

+    if (filename == NULL) {
+        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
+        return NULL;
+    }
+
+    file = openssl_fopen(filename, mode);
     if (file == NULL) {
         ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
             "calling fopen(%s, %s)",
@@ -137,11 +143,11 @@ static int file_read(BIO *b, char *out, int outl)
 {
     int ret = 0;

-    if (b->init && (out != NULL)) {
+    if (b->init != 0 && out != NULL && outl > 0) {
         if (b->flags & BIO_FLAGS_UPLINK_INTERNAL)
-            ret = UP_fread(out, 1, (int)outl, b->ptr);
+            ret = (int)UP_fread(out, 1, outl, b->ptr);
         else
-            ret = fread(out, 1, (int)outl, (FILE *)b->ptr);
+            ret = (int)fread(out, 1, outl, (FILE *)b->ptr);
         if (ret == 0
             && (b->flags & BIO_FLAGS_UPLINK_INTERNAL
                     ? UP_ferror((FILE *)b->ptr)
@@ -157,23 +163,16 @@ static int file_read(BIO *b, char *out, int outl)

 static int file_write(BIO *b, const char *in, int inl)
 {
-    int ret = 0;
+    size_t ret = 0;

-    if (b->init && (in != NULL)) {
+    if (inl < INT_MAX && inl >= 0 && b->init && (in != NULL)) {
         if (b->flags & BIO_FLAGS_UPLINK_INTERNAL)
-            ret = UP_fwrite(in, (int)inl, 1, b->ptr);
+            ret = (int)UP_fwrite(in, 1, (size_t)inl, b->ptr);
         else
-            ret = fwrite(in, (int)inl, 1, (FILE *)b->ptr);
-        if (ret)
-            ret = inl;
-        /* ret=fwrite(in,1,(int)inl,(FILE *)b->ptr); */
-        /*
-         * according to Tim Hudson <tjh@openssl.org>, the commented out
-         * version above can cause 'inl' write calls under some stupid stdio
-         * implementations (VMS)
-         */
+            ret = fwrite(in, 1, (size_t)inl, (FILE *)b->ptr);
     }
-    return ret;
+
+    return (int)ret;
 }

 static long file_ctrl(BIO *b, int cmd, long num, void *ptr)
@@ -183,6 +182,9 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr)
     FILE **fpp;
     char p[4];
     int st;
+#if defined(OPENSSL_SYS_WINDOWS)
+    int oldErr;
+#endif

     switch (cmd) {
     case BIO_C_FILE_SEEK:
@@ -193,10 +195,32 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr)
             ret = (long)fseek(fp, num, 0);
         break;
     case BIO_CTRL_EOF:
+        /*
+         * NOTE feof returns 0 if we're not in an eof condition
+         * and a non-zero value if we are (i.e. any non-zero value
+         * so we map the 0:non-0 return value here to 0:1 with a
+         * double negation
+         */
+#if defined(OPENSSL_SYS_WINDOWS)
+        oldErr = errno;
+        errno = 0;
+#endif
         if (b->flags & BIO_FLAGS_UPLINK_INTERNAL)
-            ret = (long)UP_feof(fp);
+            ret = !!(long)UP_feof(fp);
         else
-            ret = (long)feof(fp);
+            ret = !!(long)feof(fp);
+#if defined(OPENSSL_SYS_WINDOWS)
+        /*
+         * Windows gives us an extra issue to contend with.
+         * In windows feof may return 0 if it is passed an invalid
+         * stream.  In this event, feof sets errno to EINVAL.
+         * Check for that here, and set ret to -EINVAL if its the case.
+         */
+        if (ret == 0 && errno == EINVAL)
+            ret = -EINVAL;
+        else if (errno == 0)
+            errno = oldErr;
+#endif
         break;
     case BIO_C_FILE_TELL:
     case BIO_CTRL_INFO:
@@ -294,6 +318,11 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr)
         if (!(num & BIO_FP_TEXT))
             OPENSSL_strlcat(p, "b", sizeof(p));
 #endif
+        if (ptr == NULL) {
+            ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
+            ret = 0;
+            break;
+        }
         fp = openssl_fopen(ptr, p);
         if (fp == NULL) {
             ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
@@ -366,17 +395,19 @@ static int file_gets(BIO *bp, char *buf, int size)
             goto err;
     }
     if (buf[0] != '\0')
-        ret = strlen(buf);
+        ret = (int)strlen(buf);
 err:
     return ret;
 }

 static int file_puts(BIO *bp, const char *str)
 {
-    int n, ret;
+    int ret;
+    size_t n = strlen(str);

-    n = strlen(str);
-    ret = file_write(bp, str, n);
+    if (n > INT_MAX)
+        return -1;
+    ret = file_write(bp, str, (int)n);
     return ret;
 }

diff --git a/deps/openssl/openssl/crypto/bio/bss_log.c b/deps/openssl/openssl/crypto/bio/bss_log.c
index 8f8e180468e..5eb5d9c130b 100644
--- a/deps/openssl/openssl/crypto/bio/bss_log.c
+++ b/deps/openssl/openssl/crypto/bio/bss_log.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -22,8 +22,7 @@
 #include "bio_local.h"
 #include "internal/cryptlib.h"

-#if defined(OPENSSL_SYS_WINCE)
-#elif defined(OPENSSL_SYS_WIN32)
+#if defined(OPENSSL_SYS_WIN32)
 #elif defined(__wasi__)
 #define NO_SYSLOG
 #elif defined(OPENSSL_SYS_VMS)
@@ -91,10 +90,10 @@ static const BIO_METHOD methods_slg = {
     "syslog",
     bwrite_conv,
     slg_write,
-    NULL, /* slg_write_old,    */
-    NULL, /* slg_read,         */
+    NULL, /* slg_read          */
+    NULL, /* slg_read_old      */
     slg_puts,
-    NULL,
+    NULL, /* slg_gets          */
     slg_ctrl,
     slg_new,
     slg_free,
@@ -241,7 +240,7 @@ static void xsyslog(BIO *bp, int priority, const char *string)
         break;
     }

-    BIO_snprintf(pidbuf, sizeof(pidbuf), "[%lu] ", GetCurrentProcessId());
+    snprintf(pidbuf, sizeof(pidbuf), "[%lu] ", GetCurrentProcessId());
     lpszStrings[0] = pidbuf;
     lpszStrings[1] = string;

diff --git a/deps/openssl/openssl/crypto/bio/bss_mem.c b/deps/openssl/openssl/crypto/bio/bss_mem.c
index 4b21025c38b..b39f186d9d9 100644
--- a/deps/openssl/openssl/crypto/bio/bss_mem.c
+++ b/deps/openssl/openssl/crypto/bio/bss_mem.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -125,6 +125,7 @@ static int mem_init(BIO *bi, unsigned long flags)
     bi->shutdown = 1;
     bi->init = 1;
     bi->num = -1;
+    bi->flags |= BIO_FLAGS_MEM_LEGACY_EOF;
     bi->ptr = (char *)bb;
     return 1;
 }
@@ -214,7 +215,7 @@ static int mem_read(BIO *b, char *out, int outl)
 static int mem_write(BIO *b, const char *in, int inl)
 {
     int ret = -1;
-    int blen;
+    size_t blen;
     BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;

     if (b->flags & BIO_FLAGS_MEM_RDONLY) {
@@ -222,7 +223,7 @@ static int mem_write(BIO *b, const char *in, int inl)
         goto end;
     }
     BIO_clear_retry_flags(b);
-    if (inl == 0)
+    if (inl <= 0)
         return 0;
     if (in == NULL) {
         ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
@@ -245,7 +246,7 @@ static long mem_ctrl(BIO *b, int cmd, long num, void *ptr)
     char **pptr;
     BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
     BUF_MEM *bm, *bo; /* bio_mem, bio_other */
-    long off, remain;
+    ossl_ssize_t off, remain;

     if (b->flags & BIO_FLAGS_MEM_RDONLY) {
         bm = bbm->buf;
@@ -280,16 +281,22 @@ static long mem_ctrl(BIO *b, int cmd, long num, void *ptr)
         bm->data = (num != 0) ? bo->data + num : bo->data;
         bm->length = bo->length - num;
         bm->max = bo->max - num;
-        off = num;
+        off = (ossl_ssize_t)num;
         /* FALLTHRU */
     case BIO_C_FILE_TELL:
-        ret = off;
+        ret = (long)off;
+        if (off > LONG_MAX)
+            ret = -1;
         break;
     case BIO_CTRL_EOF:
-        ret = (long)(bm->length == 0);
+        if (b->num == 0 || (b->flags & BIO_FLAGS_MEM_LEGACY_EOF) != 0)
+            ret = (long)(bm->length == 0);
+        else
+            ret = 0;
         break;
     case BIO_C_SET_BUF_MEM_EOF_RETURN:
         b->num = (int)num;
+        b->flags &= ~BIO_FLAGS_MEM_LEGACY_EOF;
         break;
     case BIO_CTRL_INFO:
         ret = (long)bm->length;
@@ -349,7 +356,7 @@ static int mem_gets(BIO *bp, char *buf, int size)
     if (bp->flags & BIO_FLAGS_MEM_RDONLY)
         bm = bbm->buf;
     BIO_clear_retry_flags(bp);
-    j = bm->length;
+    j = bm->length < INT_MAX ? (int)bm->length : INT_MAX;
     if ((size - 1) < j)
         j = size - 1;
     if (j <= 0) {
@@ -378,10 +385,12 @@ static int mem_gets(BIO *bp, char *buf, int size)

 static int mem_puts(BIO *bp, const char *str)
 {
-    int n, ret;
+    int ret;
+    size_t n = strlen(str);

-    n = strlen(str);
-    ret = mem_write(bp, str, n);
+    if (n > INT_MAX)
+        return -1;
+    ret = mem_write(bp, str, (int)n);
     /* memory semantics is that it will always work */
     return ret;
 }
diff --git a/deps/openssl/openssl/crypto/bio/bss_null.c b/deps/openssl/openssl/crypto/bio/bss_null.c
index 96ecdabcc4e..ba51be7a0c3 100644
--- a/deps/openssl/openssl/crypto/bio/bss_null.c
+++ b/deps/openssl/openssl/crypto/bio/bss_null.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -79,7 +79,12 @@ static int null_gets(BIO *bp, char *buf, int size)

 static int null_puts(BIO *bp, const char *str)
 {
+    size_t n;
+
     if (str == NULL)
         return 0;
-    return strlen(str);
+    n = strlen(str);
+    if (n > INT_MAX)
+        return -1;
+    return (int)n;
 }
diff --git a/deps/openssl/openssl/crypto/bio/bss_sock.c b/deps/openssl/openssl/crypto/bio/bss_sock.c
index 70a538c2a50..ef25ccada5c 100644
--- a/deps/openssl/openssl/crypto/bio/bss_sock.c
+++ b/deps/openssl/openssl/crypto/bio/bss_sock.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -34,6 +34,7 @@ struct bss_sock_st {
 #ifndef OPENSSL_NO_KTLS
     unsigned char ktls_record_type;
 #endif
+    int sflags;
 };

 static int sock_write(BIO *h, const char *buf, int num);
@@ -106,8 +107,9 @@ static int sock_read(BIO *b, char *out, int outl)
 {
     int ret = 0;

-    if (out != NULL) {
+    if (out != NULL && outl > 0) {
         clear_socket_error();
+        b->flags &= ~BIO_FLAGS_IN_EOF;
 #ifndef OPENSSL_NO_KTLS
         if (BIO_get_ktls_recv(b))
             ret = ktls_read_record(b->num, out, outl);
@@ -116,10 +118,10 @@ static int sock_read(BIO *b, char *out, int outl)
             ret = readsocket(b->num, out, outl);
         BIO_clear_retry_flags(b);
         if (ret <= 0) {
-            if (BIO_sock_should_retry(ret))
-                BIO_set_retry_read(b);
-            else if (ret == 0)
+            if (ret == 0)
                 b->flags |= BIO_FLAGS_IN_EOF;
+            else if (BIO_sock_should_retry(ret))
+                BIO_set_retry_read(b);
         }
     }
     return ret;
@@ -128,15 +130,13 @@ static int sock_read(BIO *b, char *out, int outl)
 static int sock_write(BIO *b, const char *in, int inl)
 {
     int ret = 0;
-#if !defined(OPENSSL_NO_KTLS) || defined(OSSL_TFO_SENDTO)
     struct bss_sock_st *data = (struct bss_sock_st *)b->ptr;
-#endif

     clear_socket_error();
 #ifndef OPENSSL_NO_KTLS
     if (BIO_should_ktls_ctrl_msg_flag(b)) {
         unsigned char record_type = data->ktls_record_type;
-        ret = ktls_send_ctrl_message(b->num, record_type, in, inl);
+        ret = ktls_send_ctrl_message(b->num, record_type, in, inl, data->sflags);
         if (ret >= 0) {
             ret = inl;
             BIO_clear_ktls_ctrl_msg_flag(b);
@@ -145,15 +145,14 @@ static int sock_write(BIO *b, const char *in, int inl)
 #endif
 #if defined(OSSL_TFO_SENDTO)
         if (data->tfo_first) {
-        struct bss_sock_st *data = (struct bss_sock_st *)b->ptr;
         socklen_t peerlen = BIO_ADDR_sockaddr_size(&data->tfo_peer);

-        ret = sendto(b->num, in, inl, OSSL_TFO_SENDTO,
+        ret = sendto(b->num, in, inl, OSSL_TFO_SENDTO | data->sflags,
             BIO_ADDR_sockaddr(&data->tfo_peer), peerlen);
         data->tfo_first = 0;
     } else
 #endif
-        ret = writesocket(b->num, in, inl);
+        ret = writesocket_ex(b->num, in, inl, data->sflags);
     BIO_clear_retry_flags(b);
     if (ret <= 0) {
         if (BIO_sock_should_retry(ret))
@@ -264,6 +263,20 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr)
             ret = 0;
         }
         break;
+    case BIO_C_SET_SEND_FLAGS:
+        if (num > INT_MAX || num < INT_MIN) {
+            ERR_raise(ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT);
+            return 0;
+        }
+#if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_TANDEM)
+        if (num != 0) {
+            ERR_raise(ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT);
+            return 0;
+        }
+#endif
+        data->sflags = (int)num;
+        ret = 1;
+        break;
     default:
         ret = 0;
         break;
@@ -273,10 +286,12 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr)

 static int sock_puts(BIO *bp, const char *str)
 {
-    int n, ret;
+    int ret;
+    size_t n = strlen(str);

-    n = strlen(str);
-    ret = sock_write(bp, str, n);
+    if (n > INT_MAX)
+        return -1;
+    ret = sock_write(bp, str, (int)n);
     return ret;
 }

@@ -294,53 +309,26 @@ int BIO_sock_should_retry(int i)

 int BIO_sock_non_fatal_error(int err)
 {
-    switch (err) {
 #if defined(OPENSSL_SYS_WINDOWS)
-#if defined(WSAEWOULDBLOCK)
-    case WSAEWOULDBLOCK:
-#endif
-#endif
-
-#ifdef EWOULDBLOCK
-#ifdef WSAEWOULDBLOCK
-#if WSAEWOULDBLOCK != EWOULDBLOCK
-    case EWOULDBLOCK:
-#endif
-#else
-    case EWOULDBLOCK:
-#endif
-#endif
-
-#if defined(ENOTCONN)
-    case ENOTCONN:
-#endif
-
-#ifdef EINTR
-    case EINTR:
-#endif
-
-#ifdef EAGAIN
-#if EWOULDBLOCK != EAGAIN
-    case EAGAIN:
-#endif
-#endif
-
-#ifdef EPROTO
-    case EPROTO:
+    return err == WSAEWOULDBLOCK
+        || err == WSAENOTCONN
+        || err == WSAEINTR
+        || err == WSAEINPROGRESS
+        || err == WSAEALREADY;
+#else /* POSIX.1-2001 */
+    return err == EWOULDBLOCK
+        || err == EAGAIN
+        || err == ENOTCONN
+        || err == EINTR
+#if !defined(__DJGPP__) && !defined(OPENSSL_SYS_TANDEM)
+        || err == EPROTO
 #endif
-
-#ifdef EINPROGRESS
-    case EINPROGRESS:
+#ifdef __FreeBSD__
+        || err == EBUSY
 #endif
-
-#ifdef EALREADY
-    case EALREADY:
+        || err == EINPROGRESS
+        || err == EALREADY;
 #endif
-        return 1;
-    default:
-        break;
-    }
-    return 0;
 }

 #endif /* #ifndef OPENSSL_NO_SOCK */
diff --git a/deps/openssl/openssl/crypto/bn/asm/alpha-mont.pl b/deps/openssl/openssl/crypto/bn/asm/alpha-mont.pl
index 9d362a6f65e..0f93139f170 100644
--- a/deps/openssl/openssl/crypto/bn/asm/alpha-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/alpha-mont.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # On 21264 RSA sign performance improves by 70/35/20/15 percent for
@@ -319,7 +319,7 @@ bn_mul_mont:
 	lda	sp,48(sp)
 	ret	(ra)
 .end	bn_mul_mont
-.ascii	"Montgomery Multiplication for Alpha, CRYPTOGAMS by <appro\@openssl.org>"
+.ascii	"Montgomery Multiplication for Alpha, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2
 ___

diff --git a/deps/openssl/openssl/crypto/bn/asm/armv4-gf2m.pl b/deps/openssl/openssl/crypto/bn/asm/armv4-gf2m.pl
index 923e6d4464d..e1b06422759 100644
--- a/deps/openssl/openssl/crypto/bn/asm/armv4-gf2m.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/armv4-gf2m.pl
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # May 2011
@@ -57,7 +57,7 @@ if ($flavour && $flavour ne "void") {
 }

 $code=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 #if defined(__thumb2__)
 .syntax	unified
@@ -321,7 +321,7 @@ $code.=<<___;
 .word	OPENSSL_armcap_P-.
 # endif
 #endif
-.asciz	"GF(2^m) Multiplication for ARMv4/NEON, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"GF(2^m) Multiplication for ARMv4/NEON, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	5

 #if __ARM_MAX_ARCH__>=7
diff --git a/deps/openssl/openssl/crypto/bn/asm/armv4-mont.pl b/deps/openssl/openssl/crypto/bn/asm/armv4-mont.pl
index 6e839d845ca..08b7ab487c0 100644
--- a/deps/openssl/openssl/crypto/bn/asm/armv4-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/armv4-mont.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # January 2007.
@@ -97,7 +97,7 @@ $_n0="$num,#14*4";
 $_num="$num,#15*4";	$_bpend=$_num;

 $code=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 #if defined(__thumb2__)
 .syntax	unified
@@ -684,7 +684,7 @@ $code.=<<___;

 	vst1.32	{${temp}[0]}, [$toutptr, :32]		@ top-most bit
 	sub	$nptr,$nptr,$num,lsl#2			@ rewind $nptr
-	subs	$aptr,sp,#0				@ clear carry flag
+	subs	$aptr,sp,#0				@ set carry flag
 	add	$bptr,sp,$num,lsl#2

 .LNEON_sub:
@@ -746,7 +746,7 @@ $code.=<<___;
 ___
 }
 $code.=<<___;
-.asciz	"Montgomery multiplication for ARMv4/NEON, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Montgomery multiplication for ARMv4/NEON, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2
 #if __ARM_MAX_ARCH__>=7
 .extern	OPENSSL_armcap_P
diff --git a/deps/openssl/openssl/crypto/bn/asm/armv8-mont.pl b/deps/openssl/openssl/crypto/bn/asm/armv8-mont.pl
index 83129d6a2d6..72839210398 100755
--- a/deps/openssl/openssl/crypto/bn/asm/armv8-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/armv8-mont.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2015-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # March 2015
@@ -67,7 +67,7 @@ $n0="x4";	# const BN_ULONG *n0,
 $num="x5";	# int num);

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"
 #ifndef	__KERNEL__
 .extern OPENSSL_armv8_rsa_neonized
 .hidden OPENSSL_armv8_rsa_neonized
@@ -587,7 +587,7 @@ $code.=<<___;

 	st1	{$temp.s}[0], [$toutptr],#4	// top-most bit
 	sub	$nptr,$nptr,$num,lsl#2		// rewind $nptr
-	subs	$aptr,sp,#0			// clear carry flag
+	subs	$aptr,sp,#0			// set carry flag
 	add	$bptr,sp,$num,lsl#2

 .LNEON_sub:
@@ -780,7 +780,7 @@ __bn_sqr8x_mont:
 	umulh	$t2,$a4,$a0
 	stp	$acc0,$acc1,[$tp],#8*2	// t[0..1]
 	adc	$acc0,xzr,xzr		// t[8]
-	adds	$acc2,$acc2,$t3		// t[2]+lo(a[1]*a[0])
+	adds	$acc2,$acc2,$t3		// t[2]+hi(a[1]*a[0])
 	umulh	$t3,$a5,$a0
 	adcs	$acc3,$acc3,$t0
 	umulh	$t0,$a6,$a0
@@ -1901,7 +1901,7 @@ ___
 }
 $code.=<<___;
 .rodata
-.asciz	"Montgomery Multiplication for ARMv8, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Montgomery Multiplication for ARMv8, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	4
 ___

diff --git a/deps/openssl/openssl/crypto/bn/asm/bn-c64xplus.asm b/deps/openssl/openssl/crypto/bn/asm/bn-c64xplus.asm
index e273d37c1fc..9902ab46007 100644
--- a/deps/openssl/openssl/crypto/bn/asm/bn-c64xplus.asm
+++ b/deps/openssl/openssl/crypto/bn/asm/bn-c64xplus.asm
@@ -1,4 +1,4 @@
-;; Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved.
+;; Copyright 2012-2025 The OpenSSL Project Authors. All Rights Reserved.
 ;;
 ;; Licensed under the Apache License 2.0 (the "License").  You may not use
 ;; this file except in compliance with the License.  You can obtain a copy
@@ -6,7 +6,7 @@
 ;; https://www.openssl.org/source/license.html
 ;;
 ;;====================================================================
-;; Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+;; Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 ;; project.
 ;;
 ;; Rights for redistribution and usage in source and binary forms are
diff --git a/deps/openssl/openssl/crypto/bn/asm/c64xplus-gf2m.pl b/deps/openssl/openssl/crypto/bn/asm/c64xplus-gf2m.pl
index 5b58f3ac547..97d3af7b777 100644
--- a/deps/openssl/openssl/crypto/bn/asm/c64xplus-gf2m.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/c64xplus-gf2m.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2012-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2012-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # February 2012
diff --git a/deps/openssl/openssl/crypto/bn/asm/e2k-bn-asm.c b/deps/openssl/openssl/crypto/bn/asm/e2k-bn-asm.c
new file mode 100644
index 00000000000..2a21a30af01
--- /dev/null
+++ b/deps/openssl/openssl/crypto/bn/asm/e2k-bn-asm.c
@@ -0,0 +1,825 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "../bn_local.h"
+
+#include <assert.h>
+#include <e2kbuiltin.h>
+
+/*
+ * E2Kv5+ BIGNUM accelerator
+ *
+ * Implemented by Alexander Troosh <trush@yandex.ru>
+ *
+ */
+
+#undef mul_add
+#undef mul
+#undef sqr
+
+#if __iset__ < 5
+#define mul_add(r, a, w, c)                  \
+    {                                        \
+        BN_ULONG high, low, ret, tmp = (a);  \
+        ret = (r);                           \
+        high = __builtin_e2k_umulhd(w, tmp); \
+        ret += (c);                          \
+        low = (w) * tmp;                     \
+        (c) = (ret < (c)) ? 1 : 0;           \
+        (c) += high;                         \
+        ret += low;                          \
+        (c) += (ret < low) ? 1 : 0;          \
+        (r) = ret;                           \
+    }
+
+#define mul(r, a, w, c)                     \
+    {                                       \
+        BN_ULONG high, low, ret, ta = (a);  \
+        low = (w) * ta;                     \
+        high = __builtin_e2k_umulhd(w, ta); \
+        ret = low + (c);                    \
+        (c) = high;                         \
+        (c) += (ret < low) ? 1 : 0;         \
+        (r) = ret;                          \
+    }
+#else
+/* { c_out[64], r_out[64] } = (r[64] + c[64]) + a[64]*w[64] */
+#define mul_add(r, a, w, c)                             \
+    {                                                   \
+        BN_ULONG high, low, ret, ta = (a), tc = (c), q; \
+        ret = (r);                                      \
+        high = __builtin_e2k_umulhd(w, ta);             \
+        low = (w) * ta;                                 \
+        q = __builtin_e2k_addcd_c(ret, tc, 0);          \
+        ret += tc;                                      \
+        c = __builtin_e2k_addcd_c(ret, low, 0);         \
+        r = ret + low;                                  \
+        c += high + q;                                  \
+    }
+
+#define mul(r, a, w, c)                       \
+    {                                         \
+        BN_ULONG high, low, q, ta = (a);      \
+        low = (w) * ta;                       \
+        high = __builtin_e2k_umulhd(w, ta);   \
+        q = __builtin_e2k_addcd_c(low, c, 0); \
+        r = low + (c);                        \
+        c = high + q;                         \
+    }
+#endif
+
+#define sqr(r0, r1, a)                         \
+    {                                          \
+        BN_ULONG tmp = (a);                    \
+        (r0) = tmp * tmp;                      \
+        (r1) = __builtin_e2k_umulhd(tmp, tmp); \
+    }
+
+BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num,
+    BN_ULONG w)
+{
+    BN_ULONG c1 = 0;
+
+    assert(num >= 0);
+    if (num <= 0)
+        return c1;
+
+#ifndef OPENSSL_SMALL_FOOTPRINT
+    while (num & ~3) {
+        mul_add(rp[0], ap[0], w, c1);
+        mul_add(rp[1], ap[1], w, c1);
+        mul_add(rp[2], ap[2], w, c1);
+        mul_add(rp[3], ap[3], w, c1);
+        ap += 4;
+        rp += 4;
+        num -= 4;
+    }
+#endif
+    while (num) {
+        mul_add(rp[0], ap[0], w, c1);
+        ap++;
+        rp++;
+        num--;
+    }
+
+    return c1;
+}
+
+BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w)
+{
+    BN_ULONG c1 = 0;
+
+    assert(num >= 0);
+    if (num <= 0)
+        return c1;
+
+#ifndef OPENSSL_SMALL_FOOTPRINT
+    while (num & ~3) {
+        mul(rp[0], ap[0], w, c1);
+        mul(rp[1], ap[1], w, c1);
+        mul(rp[2], ap[2], w, c1);
+        mul(rp[3], ap[3], w, c1);
+        ap += 4;
+        rp += 4;
+        num -= 4;
+    }
+#endif
+    while (num) {
+        mul(rp[0], ap[0], w, c1);
+        ap++;
+        rp++;
+        num--;
+    }
+    return c1;
+}
+
+void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int n)
+{
+    assert(n >= 0);
+    if (n <= 0)
+        return;
+
+#ifndef OPENSSL_SMALL_FOOTPRINT
+    while (n & ~3) {
+        sqr(r[0], r[1], a[0]);
+        sqr(r[2], r[3], a[1]);
+        sqr(r[4], r[5], a[2]);
+        sqr(r[6], r[7], a[3]);
+        a += 4;
+        r += 8;
+        n -= 4;
+    }
+#endif
+    while (n) {
+        sqr(r[0], r[1], a[0]);
+        a++;
+        r += 2;
+        n--;
+    }
+}
+
+/* Divide h,l by d and return the result. */
+BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
+{
+    BN_ULONG dh, dl, q, ret = 0, th, tl, t;
+    int i, count = 2;
+
+    if (d == 0)
+        return BN_MASK2;
+
+    i = BN_num_bits_word(d);
+    assert((i == BN_BITS2) || (h <= (BN_ULONG)1 << i));
+
+    i = BN_BITS2 - i;
+    if (h >= d)
+        h -= d;
+
+    if (i) {
+        d <<= i;
+        h = (h << i) | (l >> (BN_BITS2 - i));
+        l <<= i;
+    }
+    dh = (d & BN_MASK2h) >> BN_BITS4;
+    dl = (d & BN_MASK2l);
+    for (;;) {
+        if ((h >> BN_BITS4) == dh)
+            q = BN_MASK2l;
+        else
+            q = h / dh;
+
+        th = q * dh;
+        tl = dl * q;
+        for (;;) {
+            t = h - th;
+            if ((t & BN_MASK2h) || ((tl) <= ((t << BN_BITS4) | ((l & BN_MASK2h) >> BN_BITS4))))
+                break;
+            q--;
+            th -= dh;
+            tl -= dl;
+        }
+        t = (tl >> BN_BITS4);
+        tl = (tl << BN_BITS4) & BN_MASK2h;
+        th += t;
+
+        if (l < tl)
+            th++;
+        l -= tl;
+        if (h < th) {
+            h += d;
+            q--;
+        }
+        h -= th;
+
+        if (--count == 0)
+            break;
+
+        ret = q << BN_BITS4;
+        h = ((h << BN_BITS4) | (l >> BN_BITS4)) & BN_MASK2;
+        l = (l & BN_MASK2l) << BN_BITS4;
+    }
+    ret |= q;
+    return ret;
+}
+
+BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b,
+    int n)
+{
+    BN_ULONG c, l, t;
+
+    assert(n >= 0);
+    if (n <= 0)
+        return (BN_ULONG)0;
+
+    c = 0;
+#ifndef OPENSSL_SMALL_FOOTPRINT
+    while (n & ~3) {
+#if __iset__ < 5
+        t = a[0];
+        t = (t + c) & BN_MASK2;
+        c = (t < c);
+        l = (t + b[0]) & BN_MASK2;
+        c += (l < t);
+        r[0] = l;
+        t = a[1];
+        t = (t + c) & BN_MASK2;
+        c = (t < c);
+        l = (t + b[1]) & BN_MASK2;
+        c += (l < t);
+        r[1] = l;
+        t = a[2];
+        t = (t + c) & BN_MASK2;
+        c = (t < c);
+        l = (t + b[2]) & BN_MASK2;
+        c += (l < t);
+        r[2] = l;
+        t = a[3];
+        t = (t + c) & BN_MASK2;
+        c = (t < c);
+        l = (t + b[3]) & BN_MASK2;
+        c += (l < t);
+        r[3] = l;
+#else
+        BN_ULONG t = __builtin_e2k_addcd_c(a[0], b[0], c);
+        r[0] = __builtin_e2k_addcd(a[0], b[0], c);
+        c = t;
+        t = __builtin_e2k_addcd_c(a[1], b[1], c);
+        r[1] = __builtin_e2k_addcd(a[1], b[1], c);
+        c = t;
+        t = __builtin_e2k_addcd_c(a[2], b[2], c);
+        r[2] = __builtin_e2k_addcd(a[2], b[2], c);
+        c = t;
+        t = __builtin_e2k_addcd_c(a[3], b[3], c);
+        r[3] = __builtin_e2k_addcd(a[3], b[3], c);
+        c = t;
+#endif
+        a += 4;
+        b += 4;
+        r += 4;
+        n -= 4;
+    }
+#endif
+    while (n) {
+#if __iset__ < 5
+        t = a[0];
+        t = (t + c) & BN_MASK2;
+        c = (t < c);
+        l = (t + b[0]) & BN_MASK2;
+        c += (l < t);
+        r[0] = l;
+#else
+        BN_ULONG t = __builtin_e2k_addcd_c(a[0], b[0], c);
+        r[0] = __builtin_e2k_addcd(a[0], b[0], c);
+        c = t;
+#endif
+        a++;
+        b++;
+        r++;
+        n--;
+    }
+    return (BN_ULONG)c;
+}
+
+BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b,
+    int n)
+{
+#if __iset__ < 5
+    BN_ULONG t1, t2;
+#endif
+    int c = 0;
+
+    assert(n >= 0);
+    if (n <= 0)
+        return (BN_ULONG)0;
+
+#ifndef OPENSSL_SMALL_FOOTPRINT
+    while (n & ~3) {
+#if __iset__ < 5
+        t1 = a[0];
+        t2 = (t1 - c) & BN_MASK2;
+        c = (t2 > t1);
+        t1 = b[0];
+        t1 = (t2 - t1) & BN_MASK2;
+        r[0] = t1;
+        c += (t1 > t2);
+        t1 = a[1];
+        t2 = (t1 - c) & BN_MASK2;
+        c = (t2 > t1);
+        t1 = b[1];
+        t1 = (t2 - t1) & BN_MASK2;
+        r[1] = t1;
+        c += (t1 > t2);
+        t1 = a[2];
+        t2 = (t1 - c) & BN_MASK2;
+        c = (t2 > t1);
+        t1 = b[2];
+        t1 = (t2 - t1) & BN_MASK2;
+        r[2] = t1;
+        c += (t1 > t2);
+        t1 = a[3];
+        t2 = (t1 - c) & BN_MASK2;
+        c = (t2 > t1);
+        t1 = b[3];
+        t1 = (t2 - t1) & BN_MASK2;
+        r[3] = t1;
+        c += (t1 > t2);
+#else
+        BN_ULONG t = __builtin_e2k_subcd_c(a[0], b[0], c);
+        r[0] = __builtin_e2k_subcd(a[0], b[0], c);
+        c = t;
+        t = __builtin_e2k_subcd_c(a[1], b[1], c);
+        r[1] = __builtin_e2k_subcd(a[1], b[1], c);
+        c = t;
+        t = __builtin_e2k_subcd_c(a[2], b[2], c);
+        r[2] = __builtin_e2k_subcd(a[2], b[2], c);
+        c = t;
+        t = __builtin_e2k_subcd_c(a[3], b[3], c);
+        r[3] = __builtin_e2k_subcd(a[3], b[3], c);
+        c = t;
+#endif
+        a += 4;
+        b += 4;
+        r += 4;
+        n -= 4;
+    }
+#endif
+    while (n) {
+#if __iset__ < 5
+        t1 = a[0];
+        t2 = (t1 - c) & BN_MASK2;
+        c = (t2 > t1);
+        t1 = b[0];
+        t1 = (t2 - t1) & BN_MASK2;
+        r[0] = t1;
+        c += (t1 > t2);
+#else
+        BN_ULONG t = __builtin_e2k_subcd_c(a[0], b[0], c);
+        r[0] = __builtin_e2k_subcd(a[0], b[0], c);
+        c = t;
+#endif
+        a++;
+        b++;
+        r++;
+        n--;
+    }
+    return c;
+}
+
+#ifndef OPENSSL_SMALL_FOOTPRINT
+
+/* mul_add_c(a,b,c0,c1,c2)  -- c+=a*b for three word number c=(c2,c1,c0) */
+/* mul_add_c2(a,b,c0,c1,c2) -- c+=2*a*b for three word number c=(c2,c1,c0) */
+/* sqr_add_c(a,i,c0,c1,c2)  -- c+=a[i]^2 for three word number c=(c2,c1,c0) */
+/*
+ * sqr_add_c2(a,i,c0,c1,c2) -- c+=2*a[i]*a[j] for three word number
+ * c=(c2,c1,c0)
+ */
+
+#if __iset__ < 5
+/*
+ * Keep in mind that carrying into high part of multiplication result
+ * can not overflow, because it cannot be all-ones.
+ */
+#define mul_add_c(a, b, c0, c1, c2)    \
+    do {                               \
+        BN_ULONG ta = (a), tb = (b);   \
+        BN_ULONG lo, hi;               \
+        BN_UMULT_LOHI(lo, hi, ta, tb); \
+        c0 += lo;                      \
+        hi += (c0 < lo);               \
+        c1 += hi;                      \
+        c2 += (c1 < hi);               \
+    } while (0)
+
+#define mul_add_c2(a, b, c0, c1, c2)   \
+    do {                               \
+        BN_ULONG ta = (a), tb = (b);   \
+        BN_ULONG lo, hi, tt;           \
+        BN_UMULT_LOHI(lo, hi, ta, tb); \
+        c0 += lo;                      \
+        tt = hi + (c0 < lo);           \
+        c1 += tt;                      \
+        c2 += (c1 < tt);               \
+        c0 += lo;                      \
+        hi += (c0 < lo);               \
+        c1 += hi;                      \
+        c2 += (c1 < hi);               \
+    } while (0)
+
+#define sqr_add_c(a, i, c0, c1, c2)    \
+    do {                               \
+        BN_ULONG ta = (a)[i];          \
+        BN_ULONG lo, hi;               \
+        BN_UMULT_LOHI(lo, hi, ta, ta); \
+        c0 += lo;                      \
+        hi += (c0 < lo);               \
+        c1 += hi;                      \
+        c2 += (c1 < hi);               \
+    } while (0)
+#else /* __iset__ >= 5 */
+#define mul_add_c(a, b, c0, c1, c2)             \
+    do {                                        \
+        BN_ULONG ta = (a), tb = (b);            \
+        BN_ULONG lo, hi;                        \
+        int q;                                  \
+        lo = ta * tb;                           \
+        hi = __builtin_e2k_umulhd(ta, tb);      \
+        q = __builtin_e2k_addcd_c(c0, lo, 0);   \
+        c0 += lo;                               \
+        c2 += __builtin_e2k_addcd_c(c1, hi, q); \
+        c1 = __builtin_e2k_addcd(c1, hi, q);    \
+    } while (0)
+
+#define mul_add_c2(a, b, c0, c1, c2)                \
+    do {                                            \
+        BN_ULONG ta = (a), tb = (b);                \
+        BN_ULONG lo, hi, lo_msb;                    \
+        int q;                                      \
+        lo = ta * tb;                               \
+        hi = __builtin_e2k_umulhd(ta, tb);          \
+                                                    \
+        lo_msb = lo >> 63;                          \
+        lo <<= 1;                                   \
+        c2 += hi >> 63;                             \
+        hi = __builtin_e2k_insfd(hi, 0x7f, lo_msb); \
+                                                    \
+        q = __builtin_e2k_addcd_c(c0, lo, 0);       \
+        c0 += lo;                                   \
+        c2 += __builtin_e2k_addcd_c(c1, hi, q);     \
+        c1 = __builtin_e2k_addcd(c1, hi, q);        \
+    } while (0)
+
+#define sqr_add_c(a, i, c0, c1, c2)             \
+    do {                                        \
+        BN_ULONG ta = (a)[i];                   \
+        BN_ULONG lo, hi;                        \
+        int q;                                  \
+        lo = ta * ta;                           \
+        hi = __builtin_e2k_umulhd(ta, ta);      \
+        q = __builtin_e2k_addcd_c(c0, lo, 0);   \
+        c0 += lo;                               \
+        c2 += __builtin_e2k_addcd_c(c1, hi, q); \
+        c1 = __builtin_e2k_addcd(c1, hi, q);    \
+    } while (0)
+#endif /* __iset__ */
+
+#define sqr_add_c2(a, i, j, c0, c1, c2) \
+    mul_add_c2((a)[i], (a)[j], c0, c1, c2)
+
+void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
+{
+    BN_ULONG c1, c2, c3;
+
+    c1 = 0;
+    c2 = 0;
+    c3 = 0;
+    mul_add_c(a[0], b[0], c1, c2, c3);
+    r[0] = c1;
+    c1 = 0;
+    mul_add_c(a[0], b[1], c2, c3, c1);
+    mul_add_c(a[1], b[0], c2, c3, c1);
+    r[1] = c2;
+    c2 = 0;
+    mul_add_c(a[2], b[0], c3, c1, c2);
+    mul_add_c(a[1], b[1], c3, c1, c2);
+    mul_add_c(a[0], b[2], c3, c1, c2);
+    r[2] = c3;
+    c3 = 0;
+    mul_add_c(a[0], b[3], c1, c2, c3);
+    mul_add_c(a[1], b[2], c1, c2, c3);
+    mul_add_c(a[2], b[1], c1, c2, c3);
+    mul_add_c(a[3], b[0], c1, c2, c3);
+    r[3] = c1;
+    c1 = 0;
+    mul_add_c(a[4], b[0], c2, c3, c1);
+    mul_add_c(a[3], b[1], c2, c3, c1);
+    mul_add_c(a[2], b[2], c2, c3, c1);
+    mul_add_c(a[1], b[3], c2, c3, c1);
+    mul_add_c(a[0], b[4], c2, c3, c1);
+    r[4] = c2;
+    c2 = 0;
+    mul_add_c(a[0], b[5], c3, c1, c2);
+    mul_add_c(a[1], b[4], c3, c1, c2);
+    mul_add_c(a[2], b[3], c3, c1, c2);
+    mul_add_c(a[3], b[2], c3, c1, c2);
+    mul_add_c(a[4], b[1], c3, c1, c2);
+    mul_add_c(a[5], b[0], c3, c1, c2);
+    r[5] = c3;
+    c3 = 0;
+    mul_add_c(a[6], b[0], c1, c2, c3);
+    mul_add_c(a[5], b[1], c1, c2, c3);
+    mul_add_c(a[4], b[2], c1, c2, c3);
+    mul_add_c(a[3], b[3], c1, c2, c3);
+    mul_add_c(a[2], b[4], c1, c2, c3);
+    mul_add_c(a[1], b[5], c1, c2, c3);
+    mul_add_c(a[0], b[6], c1, c2, c3);
+    r[6] = c1;
+    c1 = 0;
+    mul_add_c(a[0], b[7], c2, c3, c1);
+    mul_add_c(a[1], b[6], c2, c3, c1);
+    mul_add_c(a[2], b[5], c2, c3, c1);
+    mul_add_c(a[3], b[4], c2, c3, c1);
+    mul_add_c(a[4], b[3], c2, c3, c1);
+    mul_add_c(a[5], b[2], c2, c3, c1);
+    mul_add_c(a[6], b[1], c2, c3, c1);
+    mul_add_c(a[7], b[0], c2, c3, c1);
+    r[7] = c2;
+    c2 = 0;
+    mul_add_c(a[7], b[1], c3, c1, c2);
+    mul_add_c(a[6], b[2], c3, c1, c2);
+    mul_add_c(a[5], b[3], c3, c1, c2);
+    mul_add_c(a[4], b[4], c3, c1, c2);
+    mul_add_c(a[3], b[5], c3, c1, c2);
+    mul_add_c(a[2], b[6], c3, c1, c2);
+    mul_add_c(a[1], b[7], c3, c1, c2);
+    r[8] = c3;
+    c3 = 0;
+    mul_add_c(a[2], b[7], c1, c2, c3);
+    mul_add_c(a[3], b[6], c1, c2, c3);
+    mul_add_c(a[4], b[5], c1, c2, c3);
+    mul_add_c(a[5], b[4], c1, c2, c3);
+    mul_add_c(a[6], b[3], c1, c2, c3);
+    mul_add_c(a[7], b[2], c1, c2, c3);
+    r[9] = c1;
+    c1 = 0;
+    mul_add_c(a[7], b[3], c2, c3, c1);
+    mul_add_c(a[6], b[4], c2, c3, c1);
+    mul_add_c(a[5], b[5], c2, c3, c1);
+    mul_add_c(a[4], b[6], c2, c3, c1);
+    mul_add_c(a[3], b[7], c2, c3, c1);
+    r[10] = c2;
+    c2 = 0;
+    mul_add_c(a[4], b[7], c3, c1, c2);
+    mul_add_c(a[5], b[6], c3, c1, c2);
+    mul_add_c(a[6], b[5], c3, c1, c2);
+    mul_add_c(a[7], b[4], c3, c1, c2);
+    r[11] = c3;
+    c3 = 0;
+    mul_add_c(a[7], b[5], c1, c2, c3);
+    mul_add_c(a[6], b[6], c1, c2, c3);
+    mul_add_c(a[5], b[7], c1, c2, c3);
+    r[12] = c1;
+    c1 = 0;
+    mul_add_c(a[6], b[7], c2, c3, c1);
+    mul_add_c(a[7], b[6], c2, c3, c1);
+    r[13] = c2;
+    c2 = 0;
+    mul_add_c(a[7], b[7], c3, c1, c2);
+    r[14] = c3;
+    r[15] = c1;
+}
+
+void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
+{
+    BN_ULONG c1, c2, c3;
+
+    c1 = 0;
+    c2 = 0;
+    c3 = 0;
+    mul_add_c(a[0], b[0], c1, c2, c3);
+    r[0] = c1;
+    c1 = 0;
+    mul_add_c(a[0], b[1], c2, c3, c1);
+    mul_add_c(a[1], b[0], c2, c3, c1);
+    r[1] = c2;
+    c2 = 0;
+    mul_add_c(a[2], b[0], c3, c1, c2);
+    mul_add_c(a[1], b[1], c3, c1, c2);
+    mul_add_c(a[0], b[2], c3, c1, c2);
+    r[2] = c3;
+    c3 = 0;
+    mul_add_c(a[0], b[3], c1, c2, c3);
+    mul_add_c(a[1], b[2], c1, c2, c3);
+    mul_add_c(a[2], b[1], c1, c2, c3);
+    mul_add_c(a[3], b[0], c1, c2, c3);
+    r[3] = c1;
+    c1 = 0;
+    mul_add_c(a[3], b[1], c2, c3, c1);
+    mul_add_c(a[2], b[2], c2, c3, c1);
+    mul_add_c(a[1], b[3], c2, c3, c1);
+    r[4] = c2;
+    c2 = 0;
+    mul_add_c(a[2], b[3], c3, c1, c2);
+    mul_add_c(a[3], b[2], c3, c1, c2);
+    r[5] = c3;
+    c3 = 0;
+    mul_add_c(a[3], b[3], c1, c2, c3);
+    r[6] = c1;
+    r[7] = c2;
+}
+
+void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a)
+{
+    BN_ULONG c1, c2, c3;
+
+    c1 = 0;
+    c2 = 0;
+    c3 = 0;
+    sqr_add_c(a, 0, c1, c2, c3);
+    r[0] = c1;
+    c1 = 0;
+    sqr_add_c2(a, 1, 0, c2, c3, c1);
+    r[1] = c2;
+    c2 = 0;
+    sqr_add_c(a, 1, c3, c1, c2);
+    sqr_add_c2(a, 2, 0, c3, c1, c2);
+    r[2] = c3;
+    c3 = 0;
+    sqr_add_c2(a, 3, 0, c1, c2, c3);
+    sqr_add_c2(a, 2, 1, c1, c2, c3);
+    r[3] = c1;
+    c1 = 0;
+    sqr_add_c(a, 2, c2, c3, c1);
+    sqr_add_c2(a, 3, 1, c2, c3, c1);
+    sqr_add_c2(a, 4, 0, c2, c3, c1);
+    r[4] = c2;
+    c2 = 0;
+    sqr_add_c2(a, 5, 0, c3, c1, c2);
+    sqr_add_c2(a, 4, 1, c3, c1, c2);
+    sqr_add_c2(a, 3, 2, c3, c1, c2);
+    r[5] = c3;
+    c3 = 0;
+    sqr_add_c(a, 3, c1, c2, c3);
+    sqr_add_c2(a, 4, 2, c1, c2, c3);
+    sqr_add_c2(a, 5, 1, c1, c2, c3);
+    sqr_add_c2(a, 6, 0, c1, c2, c3);
+    r[6] = c1;
+    c1 = 0;
+    sqr_add_c2(a, 7, 0, c2, c3, c1);
+    sqr_add_c2(a, 6, 1, c2, c3, c1);
+    sqr_add_c2(a, 5, 2, c2, c3, c1);
+    sqr_add_c2(a, 4, 3, c2, c3, c1);
+    r[7] = c2;
+    c2 = 0;
+    sqr_add_c(a, 4, c3, c1, c2);
+    sqr_add_c2(a, 5, 3, c3, c1, c2);
+    sqr_add_c2(a, 6, 2, c3, c1, c2);
+    sqr_add_c2(a, 7, 1, c3, c1, c2);
+    r[8] = c3;
+    c3 = 0;
+    sqr_add_c2(a, 7, 2, c1, c2, c3);
+    sqr_add_c2(a, 6, 3, c1, c2, c3);
+    sqr_add_c2(a, 5, 4, c1, c2, c3);
+    r[9] = c1;
+    c1 = 0;
+    sqr_add_c(a, 5, c2, c3, c1);
+    sqr_add_c2(a, 6, 4, c2, c3, c1);
+    sqr_add_c2(a, 7, 3, c2, c3, c1);
+    r[10] = c2;
+    c2 = 0;
+    sqr_add_c2(a, 7, 4, c3, c1, c2);
+    sqr_add_c2(a, 6, 5, c3, c1, c2);
+    r[11] = c3;
+    c3 = 0;
+    sqr_add_c(a, 6, c1, c2, c3);
+    sqr_add_c2(a, 7, 5, c1, c2, c3);
+    r[12] = c1;
+    c1 = 0;
+    sqr_add_c2(a, 7, 6, c2, c3, c1);
+    r[13] = c2;
+    c2 = 0;
+    sqr_add_c(a, 7, c3, c1, c2);
+    r[14] = c3;
+    r[15] = c1;
+}
+
+void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a)
+{
+    BN_ULONG c1, c2, c3;
+
+    c1 = 0;
+    c2 = 0;
+    c3 = 0;
+    sqr_add_c(a, 0, c1, c2, c3);
+    r[0] = c1;
+    c1 = 0;
+    sqr_add_c2(a, 1, 0, c2, c3, c1);
+    r[1] = c2;
+    c2 = 0;
+    sqr_add_c(a, 1, c3, c1, c2);
+    sqr_add_c2(a, 2, 0, c3, c1, c2);
+    r[2] = c3;
+    c3 = 0;
+    sqr_add_c2(a, 3, 0, c1, c2, c3);
+    sqr_add_c2(a, 2, 1, c1, c2, c3);
+    r[3] = c1;
+    c1 = 0;
+    sqr_add_c(a, 2, c2, c3, c1);
+    sqr_add_c2(a, 3, 1, c2, c3, c1);
+    r[4] = c2;
+    c2 = 0;
+    sqr_add_c2(a, 3, 2, c3, c1, c2);
+    r[5] = c3;
+    c3 = 0;
+    sqr_add_c(a, 3, c1, c2, c3);
+    r[6] = c1;
+    r[7] = c2;
+}
+
+#include <alloca.h>
+/*
+ * This is essentially reference implementation, which may or may not
+ * result in performance improvement. E.g. on IA-32 this routine was
+ * observed to give 40% faster rsa1024 private key operations and 10%
+ * faster rsa4096 ones, while on AMD64 it improves rsa1024 sign only
+ * by 10% and *worsens* rsa4096 sign by 15%. Once again, it's a
+ * reference implementation, one to be used as starting point for
+ * platform-specific assembler. Mentioned numbers apply to compiler
+ * generated code compiled with and without -DOPENSSL_BN_ASM_MONT and
+ * can vary not only from platform to platform, but even for compiler
+ * versions. Assembler vs. assembler improvement coefficients can
+ * [and are known to] differ and are to be documented elsewhere.
+ */
+int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
+    const BN_ULONG *np, const BN_ULONG *n0p, int num)
+{
+    BN_ULONG c0, c1, ml, *tp, n0;
+    volatile BN_ULONG *vp;
+    int i = 0, j;
+
+#if 0 /* template for platform-specific \
+       * implementation */
+    if (ap == bp)
+        return bn_sqr_mont(rp, ap, np, n0p, num);
+#endif
+    vp = tp = alloca((num + 2) * sizeof(BN_ULONG));
+
+    n0 = *n0p;
+
+    c0 = 0;
+    ml = bp[0];
+
+    for (j = 0; j < num; ++j)
+        mul(tp[j], ap[j], ml, c0);
+
+    tp[num] = c0;
+    tp[num + 1] = 0;
+    goto enter;
+
+    for (i = 0; i < num; i++) {
+        c0 = 0;
+        ml = bp[i];
+
+        for (j = 0; j < num; ++j)
+            mul_add(tp[j], ap[j], ml, c0);
+
+        c1 = (tp[num] + c0) & BN_MASK2;
+        tp[num] = c1;
+        tp[num + 1] = (c1 < c0 ? 1 : 0);
+    enter:
+        c1 = tp[0];
+        ml = (c1 * n0) & BN_MASK2;
+        c0 = 0;
+
+        mul_add(c1, ml, np[0], c0);
+
+        for (j = 1; j < num; j++) {
+            c1 = tp[j];
+            mul_add(c1, ml, np[j], c0);
+            tp[j - 1] = c1 & BN_MASK2;
+        }
+        c1 = (tp[num] + c0) & BN_MASK2;
+        tp[num - 1] = c1;
+        tp[num] = tp[num + 1] + (c1 < c0 ? 1 : 0);
+    }
+
+    if (tp[num] != 0 || tp[num - 1] >= np[num - 1]) {
+        c0 = bn_sub_words(rp, tp, np, num);
+        if (tp[num] != 0 || c0 == 0) {
+            for (i = 0; i < num + 2; i++)
+                vp[i] = 0;
+            return 1;
+        }
+    }
+    for (i = 0; i < num; i++)
+        rp[i] = tp[i], vp[i] = 0;
+    vp[num] = 0;
+    vp[num + 1] = 0;
+    return 1;
+}
+#endif /* !OPENSSL_SMALL_FOOTPRINT */
diff --git a/deps/openssl/openssl/crypto/bn/asm/e2kv6-gf2m.c b/deps/openssl/openssl/crypto/bn/asm/e2kv6-gf2m.c
new file mode 100644
index 00000000000..83c2729a0ba
--- /dev/null
+++ b/deps/openssl/openssl/crypto/bn/asm/e2kv6-gf2m.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <e2kintrin.h>
+
+#include "../bn_local.h"
+
+void bn_GF2m_mul_2x2(BN_ULONG *r, const BN_ULONG a1, const BN_ULONG a0,
+    const BN_ULONG b1, const BN_ULONG b0)
+{
+    BN_ULONG m1, m0;
+
+    r[3] = __builtin_e2k_clmulh(a1, b1);
+    r[2] = __builtin_e2k_clmull(a1, b1);
+
+    r[1] = __builtin_e2k_clmulh(a0, b0);
+    r[0] = __builtin_e2k_clmull(a0, b0);
+
+    m1 = __builtin_e2k_clmulh(a0 ^ a1, b0 ^ b1);
+    m0 = __builtin_e2k_clmull(a0 ^ a1, b0 ^ b1);
+
+    r[2] ^= __builtin_e2k_plog(0x96, m1, r[1], r[3]);
+    r[1] = __builtin_e2k_plog(0x96, r[3], r[2], __builtin_e2k_plog(0x96, r[0], m1, m0));
+}
diff --git a/deps/openssl/openssl/crypto/bn/asm/ia64-mont.pl b/deps/openssl/openssl/crypto/bn/asm/ia64-mont.pl
index ab0ad9d1b39..15b33f5e5c4 100644
--- a/deps/openssl/openssl/crypto/bn/asm/ia64-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/ia64-mont.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2010-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # January 2010
@@ -853,7 +853,7 @@ bn_mul_mont_8:

 .type	copyright#,\@object
 copyright:
-stringz	"Montgomery multiplication for IA-64, CRYPTOGAMS by <appro\@openssl.org>"
+stringz	"Montgomery multiplication for IA-64, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 open STDOUT,">$output" if $output;
diff --git a/deps/openssl/openssl/crypto/bn/asm/ia64.S b/deps/openssl/openssl/crypto/bn/asm/ia64.S
index 0d64e98c48b..f3a20282437 100644
--- a/deps/openssl/openssl/crypto/bn/asm/ia64.S
+++ b/deps/openssl/openssl/crypto/bn/asm/ia64.S
@@ -1,9 +1,9 @@
 .explicit
 .text
 .ident	"ia64.S, Version 2.1"
-.ident	"IA-64 ISA artwork by Andy Polyakov <appro@openssl.org>"
+.ident	"IA-64 ISA artwork by Andy Polyakov <https://github.com/dot-asm>"

-// Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
+// Copyright 2001-2025 The OpenSSL Project Authors. All Rights Reserved.
 //
 // Licensed under the Apache License 2.0 (the "License").  You may not use
 // this file except in compliance with the License.  You can obtain a copy
@@ -12,7 +12,7 @@

 //
 // ====================================================================
-// Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+// Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 // project.
 //
 // Rights for redistribution and usage in source and binary forms are
diff --git a/deps/openssl/openssl/crypto/bn/asm/mips-mont.pl b/deps/openssl/openssl/crypto/bn/asm/mips-mont.pl
index 687cc90928b..2aeb927ee99 100644
--- a/deps/openssl/openssl/crypto/bn/asm/mips-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/mips-mont.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2010-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # This module doesn't present direct interest for OpenSSL, because it
@@ -74,7 +74,7 @@ if ($flavour =~ /64|n32/i) {
 }
 $SAVED_REGS_MASK = ($flavour =~ /nubi/i) ? 0x00fff000 : 0x00ff0000;
 #
-# <appro@openssl.org>
+# <https://github.com/dot-asm>
 #
 ######################################################################

@@ -124,7 +124,7 @@ $m1=$s11;
 $FRAMESIZE=14;

 $code=<<___;
-#include "mips_arch.h"
+#include "arch/mips_arch.h"

 .text

@@ -427,7 +427,7 @@ $code.=<<___;
 	$PTR_ADD $sp,$FRAMESIZE*$SZREG
 .end	bn_mul_mont_internal
 .rdata
-.asciiz	"Montgomery Multiplication for MIPS, CRYPTOGAMS by <appro\@openssl.org>"
+.asciiz	"Montgomery Multiplication for MIPS, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 $code =~ s/\`([^\`]*)\`/eval $1/gem;
diff --git a/deps/openssl/openssl/crypto/bn/asm/mips.pl b/deps/openssl/openssl/crypto/bn/asm/mips.pl
index 44a6f10d4db..bec55b954e8 100644
--- a/deps/openssl/openssl/crypto/bn/asm/mips.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/mips.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2010-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2010-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,7 +8,7 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project.
 #
 # Rights for redistribution and usage in source and binary forms are
@@ -41,7 +41,7 @@
 # Performance improvement is astonishing! 'apps/openssl speed rsa dsa'
 # goes way over 3 times faster!
 #
-#					<appro@openssl.org>
+#					<https://github.com/dot-asm>

 # October 2010
 #
@@ -111,7 +111,7 @@ $gp=$v1 if ($flavour =~ /nubi/i);
 $minus4=$v1;

 $code.=<<___;
-#include "mips_arch.h"
+#include "arch/mips_arch.h"

 #if defined(_MIPS_ARCH_MIPS64R6)
 # define ddivu(rs,rt)
@@ -129,7 +129,7 @@ $code.=<<___;

 .rdata
 .asciiz	"mips3.s, Version 1.2"
-.asciiz	"MIPS II/III/IV ISA artwork by Andy Polyakov <appro\@fy.chalmers.se>"
+.asciiz	"MIPS II/III/IV ISA artwork by Andy Polyakov <https://github.com/dot-asm>"

 .text
 .set	noat
@@ -1089,7 +1089,7 @@ $code.=<<___;
 				# bug)" warning. If anybody out there
 				# has a clue about how to circumvent
 				# this do send me a note.
-				#		<appro\@fy.chalmers.se>
+				#		<https://github.com/dot-asm>

 	$LD	$b_0,0($a2)
 	$LD	$a_1,$BNSZ($a1)
diff --git a/deps/openssl/openssl/crypto/bn/asm/parisc-mont.pl b/deps/openssl/openssl/crypto/bn/asm/parisc-mont.pl
index d6ca83c40ba..bbe23bde7d4 100644
--- a/deps/openssl/openssl/crypto/bn/asm/parisc-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/parisc-mont.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2009-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # On PA-7100LC this module performs ~90-50% better, less for longer
@@ -890,7 +890,7 @@ L\$abort
 	.EXIT
 	$POPMB	-$FRAME(%sp),%r3
 	.PROCEND
-	.STRINGZ "Montgomery Multiplication for PA-RISC, CRYPTOGAMS by <appro\@openssl.org>"
+	.STRINGZ "Montgomery Multiplication for PA-RISC, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 # Explicitly encode PA-RISC 2.0 instructions used in this module, so
diff --git a/deps/openssl/openssl/crypto/bn/asm/ppc-mont.pl b/deps/openssl/openssl/crypto/bn/asm/ppc-mont.pl
index c3072f0d5f8..65d9bf8e237 100644
--- a/deps/openssl/openssl/crypto/bn/asm/ppc-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/ppc-mont.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # April 2006
@@ -1986,7 +1986,7 @@ $code.=<<___;
 ___
 }
 $code.=<<___;
-.asciz  "Montgomery Multiplication for PPC, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz  "Montgomery Multiplication for PPC, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 $code =~ s/\`([^\`]*)\`/eval $1/gem;
diff --git a/deps/openssl/openssl/crypto/bn/asm/ppc64-mont.pl b/deps/openssl/openssl/crypto/bn/asm/ppc64-mont.pl
index 59fae341e07..bc27e93e41f 100644
--- a/deps/openssl/openssl/crypto/bn/asm/ppc64-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/ppc64-mont.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # December 2007
@@ -1648,7 +1648,7 @@ $code.=<<___;
 	.long	0
 .size	.$fname,.-.$fname

-.asciz  "Montgomery Multiplication for PPC64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz  "Montgomery Multiplication for PPC64, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 $code =~ s/\`([^\`]*)\`/eval $1/gem;
diff --git a/deps/openssl/openssl/crypto/bn/asm/riscv64-mont.pl b/deps/openssl/openssl/crypto/bn/asm/riscv64-mont.pl
new file mode 100644
index 00000000000..098ae6b960b
--- /dev/null
+++ b/deps/openssl/openssl/crypto/bn/asm/riscv64-mont.pl
@@ -0,0 +1,1879 @@
+#! /usr/bin/env perl
+# Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+use strict;
+use warnings;
+
+use FindBin qw($Bin);
+use lib "$Bin";
+use lib "$Bin/../../perlasm";
+use riscv;
+
+my $output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+my $flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+$output and open STDOUT,">$output";
+
+################################################################################
+# Utility functions to help with keeping track of which registers to stack/
+# unstack when entering / exiting routines.
+################################################################################
+{
+    # Callee-saved registers
+    my @callee_saved = map("x$_",(2,8,9,18..27));
+    # Caller-saved registers
+    my @caller_saved = map("x$_",(1,5..7,10..17,28..31));
+    my @must_save;
+    sub use_reg {
+        my $reg = shift;
+        if (grep(/^$reg$/, @callee_saved)) {
+            push(@must_save, $reg);
+        } elsif (!grep(/^$reg$/, @caller_saved)) {
+            # Register is not usable!
+            die("Unusable register ".$reg);
+        }
+        return $reg;
+    }
+    sub use_regs {
+        return map(use_reg("x$_"), @_);
+    }
+    sub save_regs {
+        my $ret = '';
+        my $stack_reservation = ($#must_save + 1) * 8;
+        my $stack_offset = $stack_reservation;
+        if ($stack_reservation % 16) {
+            $stack_reservation += 8;
+        }
+        $ret.="    addi    sp,sp,-$stack_reservation\n";
+        foreach (@must_save) {
+            $stack_offset -= 8;
+            $ret.="    sd      $_,$stack_offset(sp)\n";
+        }
+        return $ret;
+    }
+    sub load_regs {
+        my $ret = '';
+        my $stack_reservation = ($#must_save + 1) * 8;
+        my $stack_offset = $stack_reservation;
+        if ($stack_reservation % 16) {
+            $stack_reservation += 8;
+        }
+        foreach (@must_save) {
+            $stack_offset -= 8;
+            $ret.="    ld      $_,$stack_offset(sp)\n";
+        }
+        $ret.="    addi    sp,sp,$stack_reservation\n";
+        return $ret;
+    }
+    sub clear_regs {
+        @must_save = ();
+    }
+}
+
+################################################################################
+# Register assignment
+################################################################################
+
+# Function arguments
+#      RISC-V    ABI
+# $rp   x10     a0  # BN_ULONG *rp
+# $ap   x11     a1  # const BN_ULONG *ap
+# $bp   x12     a2  # const BN_ULONG *bp
+# $np   x13     a3  # const BN_ULONG *np
+# $n0   x14     a4  # const BN_ULONG *n0
+# $num  x15     a5  # int num
+my ($rp,$ap,$bp,$np,$n0,$num) = use_regs(10,11,12,13,14,15);
+
+# Return address and Frame pointer
+#      RISC-V    ABI
+# $ra   x1       ra
+# $fp   x8       s0
+my ($ra,$fp) = use_regs(1,8);
+
+# Temporary variable allocation
+#      RISC-V    ABI
+# $lo0  x5     t0    the sum of partial products of a and b
+# $hi0  x6     t1    the high word of partial product of a and b + Carry
+# $aj   x7     t2    ap[j]
+# $m0   x28    t3    bp[i]
+# $alo  x29    t4    the low word of partial product
+# $ahi  x30    t5    the high word of partial product
+# $lo1  x31    t6    partial product + reduction term
+# $hi1  x18    s2    the high word of reduction term + Carry
+# $nj   x19    s3    np[j],modulus
+# $m1   x20    s4    montgomery reduction coefficient
+# $nlo  x21    s5    the low word of reduction term
+# $nhi  x22    s6    the high word of reduction term
+# $ovf  x23    s7    highest carry bit,overflow flag
+# $i    x24    s8    outer loop index
+# $j    x25    s9    inner loop index
+# $tp   x26    s10   temporary result storage
+# $tj   x27    s11   tp[j],temporary result value
+# $temp x9     s1
+my ($lo0,$hi0,$aj,$m0,$alo,$ahi,$lo1,$hi1,$nj,$m1,$nlo,$nhi,$ovf,$i,$j,$tp,$tj,$temp) = use_regs(5..7,28..31,18..27,9);
+
+# Carry variable
+# $carry1 x16      a6
+# $carry2 x17      a7
+my ($carry1,$carry2,$numtst) = use_regs(16,17,17);
+
+my $code .= <<___;
+.text
+.balign 32
+.globl bn_mul_mont
+.type bn_mul_mont,\@function
+bn_mul_mont:
+    andi  $numtst, $num, 7
+    beqz  $numtst, bn_sqr8x_mont
+.Lmul_mont:
+___
+
+$code .= save_regs();
+
+$code .= <<___;
+    mv $fp, sp
+___
+
+$code .= <<___;
+    ld $m0, 0($bp)    # bp[0]
+    addi $bp, $bp,8
+    ld $hi0, 0($ap)    # ap[0]
+    slli $num, $num, 3
+    sub $tp, sp, $num
+    ld $aj, 8($ap)    # ap[1]
+    addi $ap, $ap, 16
+    ld $n0, 0($n0)    # n0,precomputed modular inverse
+    andi $tp, $tp, -16    # address alignment
+    ld $hi1, 0($np)    # np[0]
+    mv sp, $tp    # alloca
+    ld $nj, 8($np)    # np[1]
+    addi $np, $np, 16
+
+
+    mul $lo0, $hi0, $m0    # ap[0]*bp[0]
+    addi $j, $num, -16    # $j=(num-2)*8
+    mulhu $hi0, $hi0, $m0
+    mul $alo, $aj, $m0    # ap[1]*bp[0]
+    mulhu $ahi, $aj, $m0
+
+    mul $m1, $lo0, $n0    # montgomery reduction coefficient tp[0]*n0
+    # montgomery optimization: np[0]*m1 ensures (np[0]*m1+lo0) has zero lower bits
+    # only carry status needed, not full lo1 result
+    # eliminates mul/adds instructions → Saves cycles & power
+    # mul $lo1, $hi1, $m1   // np[0]*m1
+    # adds $lo1, $lo1, $lo0   // discarded
+    mulhu $hi1, $hi1, $m1
+    snez $carry1, $lo0
+    mul $nlo, $nj, $m1    # np[1]*m1
+    add $hi1, $hi1, $carry1
+    mulhu $nhi, $nj, $m1
+    beqz $j, .L1st_last_entry
+
+.L1st:
+    ld $aj, 0($ap)
+    addi $ap, $ap, 8
+
+    # compute the sum of partial products of a and b
+    add $lo0, $alo, $hi0    # {ap[j-1]*bp[0],low}+{ap[j-2]*bp[0],high}, j ranges from 2 to num-1
+    sltu $carry1, $lo0, $alo
+    add $hi0, $ahi, $carry1    # {ap[j-1]*bp[0],high}+C_lo0, j ranges from 2 to num-1
+
+    addi $j, $j, -8    # $j--, $j ranges from (num-2)*8 to 0
+    ld $nj, 0($np)
+    addi $np, $np, 8
+
+    # compute the sum of reduction term
+    add $lo1, $nlo, $hi1    # {np[j-1]*m1,low}+{np[j-2]*m1,high}, j ranges from 2 to num-1
+    sltu $carry1, $lo1, $nlo
+    mul $alo, $aj, $m0    # ap[j]*bp[0], j ranges from 2 to num-1
+    add $hi1, $nhi, $carry1    # {np[j-1]*m1,high}+C_lo1, j ranges from 2 to num-1
+    mulhu $ahi, $aj, $m0
+    # partial product + reduction term
+    add $lo1, $lo1, $lo0
+    sltu $carry1, $lo1, $lo0
+    mul $nlo, $nj, $m1    # np[j]*m1, j ranges from 2 to num-1
+    add $hi1, $hi1, $carry1
+    mulhu $nhi, $nj, $m1
+    sd $lo1, 0($tp)    # tp[j-2], j ranges from 2 to num-1
+    addi $tp, $tp, 8
+
+    bnez $j, .L1st
+
+.L1st_last_entry:
+    # last partial product
+    add $lo0, $alo, $hi0    # {ap[j]*bp[0],low}+{ap[j-1]*bp[0],high}, j is num-1
+    sltu $carry1, $lo0, $alo
+    sub $ap, $ap, $num    # rewind $ap
+    add $hi0, $ahi, $carry1    # {ap[j]*bp[0],high}+C_lo0, j is num-1
+
+    # last reduction term
+    add $lo1, $nlo, $hi1    # {np[j]*m1,low}+{np[j-1]*m1,high}, j is num-1
+    sltu $carry1, $lo1, $nlo
+    sub $np, $np, $num    # rewind $np
+    add $hi1, $nhi, $carry1    # {np[j]*m1,high}+C_lo1, j is num-1
+
+    # last partial product + last reduction term
+    add $lo1, $lo1, $lo0
+    sltu $carry1, $lo1, $lo0
+
+    add $hi1, $hi1, $hi0
+    sltu $carry2, $hi1, $hi0
+    add $hi1, $hi1, $carry1
+    sltu $ovf, $hi1, $carry1
+    or $carry1, $carry2, $ovf    # carry2 and ovf are mutually exclusive, both cannot be 1 simultaneously
+
+    mv $ovf, $carry1    # upmost overflow bit
+
+    addi $i, $num, -8    # $i=(num-1)*8
+
+    sd $lo1, 0($tp) # tp[j-1], j is num-1
+    sd $hi1, 8($tp) # tp[j], j is num-1
+
+.Louter:
+    ld $m0, 0($bp)    # bp[i], i ranges from 1 to num-1
+    addi $bp, $bp, 8
+    ld $hi0, 0($ap)
+    ld $aj, 8($ap)
+    addi $ap, $ap, 16
+    ld $tj, 0(sp)    # tp[0]
+    addi $tp, sp, 8    # tp[1]
+
+    mul $lo0, $hi0, $m0    # ap[0]*bp[i], i ranges from 1 to num-1
+    addi $j, $num,-16    # $j=(num-2)*8
+    mulhu $hi0, $hi0, $m0
+    ld $hi1, 0($np)
+    ld $nj, 8($np)
+    addi $np, $np, 16
+
+    mul $alo, $aj, $m0    # ap[1]*bp[i], i ranges from 1 to num-1
+    add $lo0, $lo0, $tj    # ap[0]*bp[i] + last_tp[0] , i ranges from 1 to num-1
+    sltu $carry1, $lo0, $tj
+    mulhu $ahi, $aj, $m0
+    add $hi0, $hi0, $carry1    # $hi0 will not overflow
+
+    # compute the modular reduction coefficient
+    mul $m1, $lo0, $n0
+
+    addi $i, $i, -8    # $i--, $i ranges from (num-1)*8 to 0
+
+    mulhu $hi1, $hi1, $m1
+    snez $carry1, $lo0
+    mul $nlo, $nj, $m1    # np[1]*m1
+    mulhu $nhi, $nj, $m1
+
+    beqz $j, .Linner_last_entry
+
+.Linner:
+    ld $aj, 0($ap)
+    addi $ap, $ap, 8
+    add $hi1, $hi1, $carry1
+
+    ld $tj, 0($tp)    # tp[j-1], j is 2 to num-1
+    addi $tp, $tp, 8
+
+    # compute the sum of partial products of a and b
+    add $lo0, $alo, $hi0    # {ap[j-1]*bp[i],low}+{ap[j-2]*bp[i],high}, j ranges from 2 to num-1, i ranges from 1 to num-1
+    sltu $carry1, $lo0, $alo
+    add $hi0, $ahi, $carry1    # {ap[j-1]*bp[i],high}+C_lo0, j ranges from 2 to num-1, i ranges from 1 to num-1
+
+    addi $j, $j, -8    # $j--, $j ranges from (num-2)*8 to 0
+
+    # compute the sum of reduction term
+    add $lo1, $nlo, $hi1    # {np[j-1]*m1,low}+{np[j-2]*m1,high}, j ranges from 2 to num-1
+    sltu $carry1, $lo1, $nlo
+    add $hi1, $nhi, $carry1    # {np[j-1]*m1}+C_lo1, j ranges from 2 to num-1
+
+    ld $nj, 0($np)
+    addi $np, $np, 8
+
+    mul $alo, $aj, $m0    # ap[j]*bp[i], j ranges from 2 to num-1, i ranges from 1 to num-1
+    # partial product + reduction term
+    add $lo0, $lo0, $tj
+    sltu $carry1, $lo0, $tj
+    mulhu $ahi, $aj, $m0
+    add $hi0, $hi0, $carry1
+
+    mul $nlo, $nj, $m1    # np[j]*m1, j ranges from 2 to num-1
+    add $lo1, $lo1, $lo0
+    sltu $carry1, $lo1, $lo0
+    mulhu $nhi, $nj, $m1
+    sd $lo1, -16($tp)    # tp[j-2], j ranges from 2 to num-1
+
+    bnez $j, .Linner
+
+.Linner_last_entry:
+    ld $tj, 0($tp)    # tp[j], j is num-1
+    addi $tp, $tp, 8
+    add $hi1, $hi1, $carry1
+
+    # last partial product
+    add $lo0, $alo, $hi0    # {ap[j]*bp[i],low}+{ap[j-1]*bp[i],high}, j is num-1, i ranges from 1 to num-1
+    sltu $carry1, $lo0, $alo
+    sub $ap, $ap, $num    # rewind $ap
+    add $hi0, $ahi, $carry1    # {ap[j]*bp[i],high}+C_lo0, j is num-1, i ranges from 1 to num-1
+
+    # last reduction term
+    add $lo1, $nlo, $hi1    # {np[j]*m1,low}+{np[j-1]*m1,high}, j is num-1
+    sltu $carry1, $lo1, $nlo
+
+    sub $np, $np, $num    # rewind $np
+
+    add $hi1, $nhi, $ovf
+    sltu $carry2, $hi1, $ovf
+    add $hi1, $hi1, $carry1    # {np[j]*m1,high}+C_lo1, j is num-1
+    sltu $ovf, $hi1, $carry1
+    or $carry1, $carry2, $ovf
+
+    mv $ovf, $carry1    # update the upmost overflow bit
+
+    # last partial product + last reduction term
+    add $lo0, $lo0, $tj
+    sltu $carry1, $lo0, $tj
+    add $hi0, $hi0, $carry1
+
+    add $lo1, $lo1, $lo0
+    sltu $carry1, $lo1, $lo0
+
+    add $hi1, $hi1, $hi0
+    sltu $carry2, $hi1, $hi0
+    add $hi1, $hi1, $carry1
+    sltu $carry1, $hi1, $carry1
+    or $carry1, $carry2, $carry1
+
+    add $ovf, $ovf, $carry1    # upmost overflow bit
+
+    sd $lo1, -16($tp)    # tp[j-1], j is num-1
+    sd $hi1, -8($tp)    # tp[j], j is num-1
+    bnez $i, .Louter
+
+    ld $tj, 0(sp)    # tp[0]
+    addi $tp, sp, 8
+    ld $nj, 0($np)    # np[0]
+    addi $np, $np, 8
+    addi $j, $num, -8    # $j=(num-1)*8 and clear borrow
+
+    li $carry1,0   # Custom, no borrow, C=0 (normal case, with borrow C=1)
+    mv $ap, $rp
+.Lsub:
+    # tp[j]-np[j], j ranges from 0 to num-2, set carry flag
+    sub $temp, $tj, $nj
+    sltu $carry2, $tj, $temp
+    sub $aj, $temp, $carry1
+    sltu $carry1, $temp, $aj
+    or $carry1, $carry2, $carry1
+
+    ld $tj, 0($tp)    # tp[j], j ranges from 1 to num-1
+    addi $tp, $tp, 8
+    addi $j, $j, -8    # $j--, $j ranges from (num-1)*8 to 0
+    ld $nj, 0($np)
+    addi $np, $np, 8
+
+    sd $aj, 0($ap)    # rp[j]=tp[j]-np[j], j ranges from 0 to num-2
+    addi $ap, $ap, 8
+    bnez $j, .Lsub
+
+    # process the last word, tp[j]-np[j], j is num-1
+    sub $temp, $tj, $nj
+    sltu $carry2, $tj, $temp
+    sub $aj, $temp, $carry1
+    sltu $carry1, $temp, $aj
+    or $carry1, $carry2, $carry1
+
+    # whether there is a borrow
+    sub $temp, $ovf, $carry1
+    sltu $carry1, $ovf, $temp
+    xori $carry1, $carry1, 1
+
+    sd $aj, 0($ap)    # rp[j], j is num-1
+    addi $ap, $ap, 8
+
+    # conditional result copying and cleanup
+    ld $tj, 0(sp)    # tp[0]
+    addi $tp, sp, 8
+    ld $aj, 0($rp)    # rp[0]
+    addi $rp, $rp, 8
+    addi $num, $num, -8    # num--
+    nop
+.Lcond_copy:
+    addi $num,$num, -8    # num--
+    # conditionally selects value based on borrow flag:
+    # when borrow occurs (borrow flag set): nj = tj (original t value)
+    snez $carry1, $carry1
+    sub $carry1, zero, $carry1
+    xor $nj, $tj, $aj
+    and $nj, $nj, $carry1
+    xor $nj, $tj, $nj
+
+    ld $tj, 0($tp)
+    addi $tp, $tp, 8
+    ld $aj, 0($rp)
+    addi $rp, $rp, 8
+    sd zero, -16($tp)    # wipe tp
+    sd $nj, -16($rp)    # result
+    bnez $num, .Lcond_copy
+
+    # process the last word
+    snez $carry1, $carry1
+    sub $carry1, zero, $carry1
+    xor $nj, $tj, $aj
+    and $nj, $nj, $carry1
+    xor $nj, $tj, $nj
+
+    sd zero, -8($tp)    # wipe tp
+    sd $nj, -8($rp)
+___
+
+$code .= <<___;
+    mv sp, $fp
+    li $rp, 1
+___
+
+$code .= load_regs();
+
+$code .= <<___;
+    ret
+.size bn_mul_mont,.-bn_mul_mont
+___
+
+{
+# Following is RISCV64 adaptation of __bn_sqr8x_mont from armv8-mont module.
+
+# Return address and Frame pointer
+#      RISC-V    ABI
+# $ra   x1       ra
+# $fp   x8       s0
+my ($ra,$fp) = use_regs(1,8);
+
+# Temporary variable allocation
+#      RISC-V    ABI
+# $a0   x5     t0
+# $a1   x6     t1
+# $a2   x7     t2
+# $a3   x28    t3
+# $a4   x9     s1
+# $a5   x18    s2
+# $a6   x19    s3
+# $a7   x20    s4
+my ($a0,$a1,$a2,$a3,$a4,$a5,$a6,$a7) = use_regs(5,6,7,28,9,18,19,20);
+
+# $t0   x16     a6
+# $t1   x17     a7
+# $t2   x29     t4
+# $t3   x30     t5
+my ($t0,$t1,$t2,$t3) = use_regs(16,17,29,30);
+
+# $acc0 x21    s5
+# $acc1 x22    s6
+# $acc2 x23    s7
+# $acc3 x24    s8
+# $acc4 x25    s9
+# $acc5 x31    t6
+# $acc6 x27    s11
+# $acc7 x26    s10
+my ($acc0,$acc1,$acc2,$acc3,$acc4,$acc5,$acc6,$acc7) = use_regs(21,22,23,24,25,31,27,26);
+
+# $temp   x14    a4<n0>
+# $carry1 x15    a5<num>
+# $carry2 x10    a0<rp>
+# $carry  x1     ra
+my ($temp, $carry1, $carry2, $carry) = use_regs(14,15,10,1);
+
+# $tp     x12    a2<bp>
+# $na0    x1     ra
+my ($tp,$na0) = use_regs(12,1);
+
+# Stack variables
+# rp       fp+96
+# np       fp+104
+# num      fp+112
+# n0       fp+120
+# ra       fp+128
+# cnt      fp+136
+# ap_end   fp+144
+# np_end   fp+152
+# topmost  fp+160
+
+# My_function
+sub adds {
+    # Simulate ARM 'adds':add with carry flag set
+    # (1) Final sum: dst = src1 + b, no input carry
+    # (2) Output carry, if src1 + b overflowed, carry = 1. src1 + b < b ? carry1=1 : carry1=0
+    my ($dst, $src1, $b) = @_;
+    my $code=<<___;
+    add $dst, $src1, $b
+    sltu $carry1, $dst, $b
+___
+    return $code;
+}
+
+sub adcs {
+    # Simulate ARM 'adcs': add with input carry and set output carry
+    # (1) Temp sum. dst = src1 + b, ignore input carry
+    # (2) Temp1 carry. if src1 + b overflowed, carry2 = 1. src1 + b < b ? carry2=1 : carry2=0
+    # (3) Final sum: dst += carry1 (input carry)
+    # (4) Temp2 carry. if adding input carry overflowed, carry1 = 1. dst + carry1 < carry1 ? carry1=1 : carry1=0
+    # (5) Final carry. carry1(carry_out) = carry2 | carry1
+    my ($dst, $src1, $b) = @_;
+    my $code=<<___;
+    add $dst, $src1, $b
+    sltu $carry2, $dst, $b
+    add $dst, $dst, $carry1
+    sltu $carry1, $dst, $carry1
+    or $carry1, $carry2, $carry1
+___
+    return $code;
+}
+
+sub adc {
+    # (1) Simulate ARM 'adc': add with input carry1, no flags
+    # (2) Temp sum: dst = src1 + b, ignore input carry
+    # (3) Final sum: dst += carry1 (input carry), ignore output carry
+    my ($dst, $src1, $b) = @_;
+    my $code=<<___;
+    add $dst,$src1,$b
+    add $dst,$dst,$carry1
+___
+    return $code;
+}
+
+sub extr {
+    # Simulate ARM 'extr': extract high bit and shift
+    # (1) carry2 = b >> 63 (extract highest bit of b)
+    # (2) dst = src1 << 1 (shift src1 left by 1, dst = src1*2)
+    # (3) dst |= carry2 (combine: insert b's high bit as dst's LSB, dst= carry2 + src1*2 )
+    my ($dst, $src1, $b) = @_;
+    my $code=<<___;
+    srli $carry2, $b, 63
+    slli $dst, $src1, 1
+    or   $dst, $dst, $carry2
+___
+    return $code;
+}
+
+sub subs{
+    # Simulate ARM 'subs': subtract with borrow flag set.
+    # (1) dst = src1 - b
+    # (2) if src1 < dst, set borrow flag,carry1 = 1
+    my ($dst, $src1, $b) = @_;
+    my $code=<<___;
+    sub $dst, $src1, $b
+    sltu $carry1, $src1, $dst
+___
+    return $code;
+}
+
+sub sbcs{
+    # Simulate ARM 'sbcs': subtract with input borrow (carry1) and set output borrow.
+    # (1) temp = src1 - b
+    # (2) if src1 < temp, set borrow flag, carry2 = 1
+    # (3) dst = temp - carry1 (borrow_in)
+    # (4) if temp < dst, set borrow flag, carry1 = 1
+    # (5) carry1 (borrow_out) = carry2 | carry1
+    my ($dst, $src1, $b) = @_;
+    my $code=<<___;
+    sub $temp, $src1, $b
+    sltu $carry2, $src1, $temp
+    sub $dst, $temp, $carry1
+    sltu $carry1, $temp, $dst
+    or $carry1, $carry2, $carry1
+___
+    return $code;
+}
+
+sub csel{
+    # Simulate ARM 'csel': conditional select based on carry
+    # Assumes carry1 is input condition, 1 if true/select b, 0 if false/select src1.
+    # dst = (carry1 == 0) ? src1 : b
+    # Uses bitwise ops for branchless execution
+    # (1) Normalize carry1: carry1 !=0 ? carry1 = 1 : carry1 = 0
+    # (2) Create mask: carry1 = 0 - carry1; yields -1 (all 1s) if 1 (true), 0 if false carry1 = -carry1 (0 or -1 mask)
+    # (3) Compute diff: dst = src1 ^ b (bitwise XOR highlights differing bits)
+    # (4) Mask diff: dst = diff & mask; yields diff if -1 (true), 0 if 0 (false)
+    # (5) Select: dst = src1 ^ dst; yields b if dst=diff (true), src1 if dst=0 (false)
+    my ($dst, $src1, $b) = @_;
+    my $code=<<___;
+    snez $carry1, $carry1
+    sub $carry1, zero, $carry1
+    xor $dst, $src1, $b
+    and $dst, $dst, $carry1
+    xor $dst, $src1, $dst
+___
+    return $code;
+}
+
+## store
+sub sd_rp{
+    my ($src1,$dst) = @_;
+    my $code=<<___;
+    sd $src1,96($dst)
+___
+    return $code;
+}
+
+sub sd_np{
+    my ($src1,$dst) = @_;
+    my $code=<<___;
+    sd $src1,104($dst)
+___
+    return $code;
+}
+
+sub sd_num{
+    my ($src1,$dst) = @_;
+    my $code=<<___;
+    sd $src1,112($dst)
+___
+    return $code;
+}
+
+sub sd_n0{
+    my ($src1,$dst) = @_;
+    my $code=<<___;
+    sd $src1,120($dst)
+___
+    return $code;
+}
+
+sub sd_ra{
+    my ($src1,$dst) = @_;
+    my $code=<<___;
+    sd $src1,128($dst)
+___
+    return $code;
+}
+
+sub sd_cnt{
+    my ($src1,$dst) = @_;
+    my $code=<<___;
+    sd $src1,136($dst)
+___
+    return $code;
+}
+
+sub sd_apend{
+    my ($src1,$dst) = @_;
+    my $code=<<___;
+    sd $src1,144($dst)
+___
+    return $code;
+}
+
+sub sd_npend{
+    my ($src1,$dst) = @_;
+    my $code=<<___;
+    sd $src1,152($dst)
+___
+    return $code;
+}
+
+sub sd_topmost{
+    my ($src1,$dst) = @_;
+    my $code=<<___;
+    sd $src1,160($dst)
+___
+    return $code;
+}
+
+## load
+sub ld_rp{
+    my ($dst,$src1) = @_;
+    my $code=<<___;
+    ld $dst,96($src1)
+___
+    return $code;
+}
+
+sub ld_np{
+    my ($dst,$src1) = @_;
+    my $code=<<___;
+    ld $dst,104($src1)
+___
+    return $code;
+}
+
+sub ld_num{
+    my ($dst,$src1) = @_;
+    my $code=<<___;
+    ld $dst,112($src1)
+___
+    return $code;
+}
+
+sub ld_n0{
+    my ($dst,$src1) = @_;
+    my $code=<<___;
+    ld $dst,120($src1)
+___
+    return $code;
+}
+
+sub ld_ra{
+    my ($dst,$src1) = @_;
+    my $code=<<___;
+    ld $dst,128($src1)
+___
+    return $code;
+}
+
+sub ld_cnt{
+    my ($dst,$src1) = @_;
+    my $code=<<___;
+    ld $dst,136($src1)
+___
+    return $code;
+}
+
+sub ld_apend{
+    my ($dst,$src1) = @_;
+    my $code=<<___;
+    ld $dst,144($src1)
+___
+    return $code;
+}
+
+sub ld_npend{
+    my ($dst,$src1) = @_;
+    my $code=<<___;
+    ld $dst,152($src1)
+___
+    return $code;
+}
+
+sub ld_topmost{
+    my ($dst,$src1) = @_;
+    my $code=<<___;
+    ld $dst,160($src1)
+___
+    return $code;
+}
+
+$code.=<<___;
+.type   bn_sqr8x_mont,%function
+.balign 32
+bn_sqr8x_mont:
+    # If ap != bp, -> normal multiplication, jump to .Lmul_mont
+    # If ap == bp, -> continue with optimized sqr8x path
+    bne $ap,$bp, .Lmul_mont
+___
+$code .= <<___;
+    addi    sp,sp,-168
+    sd      s0,88(sp)
+    sd      s1,80(sp)
+    sd      s2,72(sp)
+    sd      s3,64(sp)
+    sd      s4,56(sp)
+    sd      s5,48(sp)
+    sd      s6,40(sp)
+    sd      s7,32(sp)
+    sd      s8,24(sp)
+    sd      s9,16(sp)
+    sd      s11,8(sp)
+    sd      s10,0(sp)
+    mv $fp, sp
+___
+$code .= <<___;
+.Lsqr8x_mont:
+    ld $a0, 0($ap)    # load a[0-7]
+    ld $a1, 8($ap)
+    ld $a2, 16($ap)
+    ld $a3, 24($ap)
+    ld $a4, 32($ap)
+    ld $a5, 40($ap)
+    ld $a6, 48($ap)
+    ld $a7, 56($ap)
+
+    slli $t0, $num, 4
+    sub $tp, sp, $t0    # alloca sp-num*16
+    slli $num, $num, 3
+    ld $n0, 0($n0)    # n0, precomputed modular inverse
+    mv sp, $tp    # alloca
+
+    # Save temporary values to stack to release registers for subsequent operations
+    addi $t1,$num,-64    # number of bytes remaining to be zeroed
+    @{[sd_cnt $t1,$fp]}    # offload cnt
+    @{[sd_rp $rp,$fp]}    # offload rp
+    @{[sd_np $np,$fp]}    # offload np
+    @{[sd_num $num,$fp]}    # offload num
+    @{[sd_n0 $n0,$fp]}    # offload n0
+    @{[sd_ra $ra,$fp]}    # offload ra
+
+    j .Lsqr8x_zero_start
+
+
+    # Clear tp buffer to store partial products
+    # Zero 128 bytes per iteration until cache cleared
+.Lsqr8x_zero:
+    addi $carry2,$carry2,-64    # cnt=cnt-64
+    @{[sd_cnt $carry2,$fp]}
+
+    sd zero, 0($tp)
+    sd zero, 8($tp)
+    sd zero, 16($tp)
+    sd zero, 24($tp)
+    sd zero, 32($tp)
+    sd zero, 40($tp)
+    sd zero, 48($tp)
+    sd zero, 56($tp)
+
+.Lsqr8x_zero_start:
+    sd zero, 64($tp)
+    sd zero, 72($tp)
+    sd zero, 80($tp)
+    sd zero, 88($tp)
+    sd zero, 96($tp)
+    sd zero, 104($tp)
+    sd zero, 112($tp)
+    sd zero, 120($tp)
+    addi $tp,$tp,128
+
+    @{[ld_cnt $carry2,$fp]}
+    bnez $carry2,.Lsqr8x_zero    # cnt != 0 -> Lsqr8x_zero
+
+    @{[ld_num $temp,$fp]}
+    add $temp,$ap,$temp    # ap_end = ap + num
+    @{[sd_apend $temp,$fp]} # offload ap_end, the last element of ap
+    addi $ap,$ap,64    # ap += 64, skip initial 8 64-bit words
+    mv $acc0, zero
+    mv $acc1, zero
+    mv $acc2, zero
+    mv $acc3, zero
+    mv $acc4, zero
+    mv $acc5, zero
+    mv $acc6, zero
+    mv $acc7, zero
+    mv $tp,sp    # points to buffer start
+
+    # Multiply everything but a[i]*a[i]
+.balign 16
+.Lsqr8x_outer_loop:
+    # Compute cross products: a[j] * a[i] for all < j
+    #                                                 a[1]a[0]  (i)
+    #                                             a[2]a[0]
+    #                                         a[3]a[0]
+    #                                     a[4]a[0]
+    #                                 a[5]a[0]
+    #                             a[6]a[0]
+    #                         a[7]a[0]
+    #                                         a[2]a[1]  (ii)
+    #                                     a[3]a[1]
+    #                                 a[4]a[1]
+    #                             a[5]a[1]
+    #                         a[6]a[1]
+    #                     a[7]a[1]
+    #                                 a[3]a[2]  (iii)
+    #                             a[4]a[2]
+    #                         a[5]a[2]
+    #                     a[6]a[2]
+    #                 a[7]a[2]
+    #                         a[4]a[3]  (iv)
+    #                     a[5]a[3]
+    #                 a[6]a[3]
+    #             a[7]a[3]
+    #                 a[5]a[4]  (v)
+    #             a[6]a[4]
+    #         a[7]a[4]
+    #         a[6]a[5]  (vi)
+    #     a[7]a[5]
+    # a[7]a[6]  (vii)
+    mul $t0,$a1,$a0    # lo(a[1..7]*a[0])  (i)
+    mul $t1,$a2,$a0
+    mul $t2,$a3,$a0
+    mul $t3,$a4,$a0
+
+    @{[adds $acc1, $acc1, $t0]}    # t[1]+lo(a[1]*a[0])
+    mul $t0,$a5,$a0
+    @{[adcs $acc2, $acc2, $t1]}    # t[2]+lo(a[2]*a[0])
+    mul $t1,$a6,$a0
+    @{[adcs $acc3, $acc3, $t2]}    # t[3]+lo(a[3]*a[0])
+    mul $t2,$a7,$a0
+    @{[adcs $acc4, $acc4, $t3]}    # t[4]+lo(a[4]*a[0])
+
+    mulhu $t3,$a1,$a0    # hi(a[1..7]*a[0])
+    @{[adcs $acc5, $acc5, $t0]}    # t[5]+lo(a[5]*a[0])
+    mulhu $t0,$a2,$a0
+    @{[adcs $acc6, $acc6, $t1]}    # t[6]+lo(a[6]*a[0])
+    mulhu $t1,$a3,$a0
+    @{[adcs $acc7, $acc7, $t2]}    # t[7]+lo(a[7]*a[0])
+    mulhu $t2,$a4,$a0
+    sd $acc0, 0($tp)    # offload acc0, store t[0]
+    add $acc0,zero,$carry1    # t[8]=0+c_pre{t[7]+lo(a[7]*a[0])}
+    sd $acc1, 8($tp)    # offload acc1, store t[1]
+    addi $tp,$tp,16    # tp=tp+16,advance buffer pointer by 16 bytes
+
+    @{[adds $acc2, $acc2, $t3]}    # t[2]+hi(a[1]*a[0])
+    mulhu $t3,$a5,$a0
+    @{[adcs $acc3, $acc3, $t0]}    # t[3]+hi(a[2]*a[0])
+    mulhu $t0,$a6,$a0
+    @{[adcs $acc4, $acc4, $t1]}    # t[4]+hi(a[3]*a[0])
+    mulhu $t1,$a7,$a0
+    @{[adcs $acc5, $acc5, $t2]}    # t[5]+hi(a[4]*a[0])
+
+    mul $t2,$a2,$a1    # lo(a[2..7]*a[1])  (ii)
+    @{[adcs $acc6, $acc6, $t3]}    # t[6]+hi(a[5]*a[0])
+    mul $t3,$a3,$a1
+    @{[adcs $acc7, $acc7, $t0]}    # t[7]+hi(a[6]*a[0])
+    mul $t0,$a4,$a1
+    @{[adc $acc0, $acc0, $t1]}    # t[8]+hi(a[7]*a[0])
+    mul $t1,$a5,$a1
+
+    @{[adds $acc3, $acc3, $t2]}    # t[3]+ lo(a[2]*a[1])
+    mul $t2,$a6,$a1
+    @{[adcs $acc4, $acc4, $t3]}    # t[4]+ lo(a[3]*a[1])
+    mul $t3,$a7,$a1
+    @{[adcs $acc5, $acc5, $t0]}    # t[5]+ lo(a[4]*a[1])
+    mulhu $t0,$a2,$a1    # hi(a[2..7]*a[1])
+    @{[adcs $acc6,$acc6, $t1]}    # t[6]+ lo(a[5]*a[1])
+    mulhu $t1,$a3,$a1
+    @{[adcs $acc7, $acc7, $t2]}    # t[7]+ lo(a[6]*a[1])
+    mulhu $t2,$a4,$a1
+    @{[adcs $acc0, $acc0, $t3]}    # t[8]+ lo(a[7]*a[1])
+    mulhu $t3,$a5,$a1
+    sd $acc2,0($tp)    # offload acc2, store t[2]
+    add $acc1,zero,$carry1    # t[9]=0+c_pre{t[8]+ lo(a[7]*a[1])}
+    sd $acc3,8($tp)    # offload acc3, store t[3]
+    addi $tp,$tp,16    # tp=tp+16,advance buffer pointer by 16 bytes
+
+    @{[adds $acc4, $acc4, $t0]}    # t[4]+ hi(a[2]*a[1])
+    mulhu $t0,$a6,$a1
+    @{[adcs $acc5, $acc5, $t1]}    # t[5]+ hi(a[3]*a[1])
+    mulhu $t1,$a7,$a1
+    @{[adcs $acc6, $acc6, $t2]}    # t[6]+ hi(a[4]*a[1])
+    mul $t2,$a3,$a2    # lo(a[3..7]*a[2])  (iii)
+    @{[adcs $acc7, $acc7, $t3]}    # t[7]+ hi(a[5]*a[1])
+    mul $t3,$a4,$a2
+    @{[adcs $acc0, $acc0, $t0]}    # t[8]+ hi(a[6]*a[1])
+    mul $t0,$a5,$a2
+    @{[adc  $acc1, $acc1, $t1]}    # t[9]+ hi(a[7]*a[1])
+    mul $t1,$a6,$a2
+    @{[adds $acc5, $acc5, $t2]}    # t[5]+ lo(a[3]*a[2])
+    mul $t2,$a7,$a2
+    @{[adcs $acc6, $acc6, $t3]}    # t[6]+ lo(a[4]*a[2])
+    mulhu $t3,$a3,$a2    # hi(a[3..7]*a[2])
+    @{[adcs $acc7, $acc7, $t0]}    # t[7]+ lo(a[5]*a[2])
+    mulhu $t0,$a4,$a2
+    @{[adcs $acc0, $acc0, $t1]}    # t[8]+ lo(a[6]*a[2])
+    mulhu $t1,$a5,$a2
+    @{[adcs $acc1, $acc1, $t2]}    # t[9]+ lo(a[7]*a[2])
+    mulhu $t2,$a6,$a2
+    sd $acc4,0($tp)    # offload acc4, store t[4]
+    add $acc2,zero,$carry1    # t[10]=0+c_pre{t[9]+ lo(a[7]*a[2])}
+    sd $acc5,8($tp)    # offload acc5, store t[5]
+    addi $tp,$tp,16    # tp=tp+16,advance buffer pointer by 16 bytes
+
+    @{[adds $acc6, $acc6, $t3]}    # t[6]+ hi(a[3]*a[2])
+    mulhu $t3,$a7,$a2
+    @{[adcs $acc7, $acc7, $t0]}    # t[7]+ hi(a4]*a[2])
+    mul $t0,$a4,$a3  # lo(a[4..7]*a[3])  (iv)
+    @{[adcs $acc0, $acc0, $t1]}    # t[8]+ hi(a5]*a[2])
+    mul $t1,$a5,$a3
+    @{[adcs $acc1, $acc1, $t2]}    # t[9]+ hi(a6]*a[2])
+    mul $t2,$a6,$a3
+    @{[adc  $acc2, $acc2, $t3]}    # t[10]+ hi(a7]*a[2])
+    mul $t3,$a7,$a3
+
+    @{[adds $acc7, $acc7, $t0]}    # t[7]+ lo(a[4]*a[3])
+    mulhu $t0,$a4,$a3   # hi(a[4..7]*a[3])
+    @{[adcs $acc0, $acc0, $t1]}    # t[8]+ lo(a[5]*a[3])
+    mulhu $t1,$a5,$a3
+    @{[adcs $acc1, $acc1, $t2]}    # t[9]+ lo(a[6]*a[3])
+    mulhu $t2,$a6,$a3
+    @{[adcs $acc2, $acc2, $t3]}    # t[10]+ lo(a[7]*a[3])
+    mulhu $t3,$a7,$a3
+    sd $acc6,0($tp)    # offload acc6, store t[6]
+    add $acc3,zero,$carry1    # t[11]=0+c_pre{t[10]+ lo(a[7]*a[3])}
+    sd $acc7,8($tp)    # offload acc7, store t[7]
+    addi $tp,$tp,16    # tp=tp+16, advance buffer pointer by 16 bytes
+
+    @{[adds $acc0, $acc0, $t0]}    # t[8]+ hi(a[4]*a[3])
+    mul $t0,$a5,$a4    # lo(a[5..7]*a[4])  (v)
+    @{[adcs $acc1, $acc1, $t1]}    # t[9]+ hi(a[5]*a[3])
+    mul $t1,$a6,$a4
+    @{[adcs $acc2, $acc2, $t2]}    # t[10]+ hi(a[6]*a[3])
+    mul $t2,$a7,$a4
+    @{[adc  $acc3, $acc3, $t3]}    # t[11]+ hi(a[7]*a[3])
+
+    mulhu $t3,$a5,$a4    # hi(a[5..7]*a[4])
+    @{[adds $acc1, $acc1, $t0]}    # t[9]+ lo(a[5]*a[4])
+    mulhu $t0,$a6,$a4
+    @{[adcs $acc2, $acc2, $t1]}    # t[10]+ lo(a[6]*a[4])
+    mulhu $t1,$a7,$a4
+    @{[adcs $acc3, $acc3, $t2]}    # t[11]+ lo(a[7]*a[4])
+    mul $t2,$a6,$a5    # lo(a[6..7]*a[5])  (vi)
+    add $acc4,zero,$carry1    # t[12]=0+c_pre{t[11]+ lo(a[7]*a[4])}
+
+    @{[adds $acc2, $acc2, $t3]}    # t[10]+ hi(a[5]*a[4])
+    mul $t3,$a7,$a5
+    @{[adcs $acc3, $acc3, $t0]}    # t[11]+ hi(a[6]*a[4])
+    mulhu $t0,$a6,$a5    # hi(a[6..7]*a[5])
+    @{[adc $acc4, $acc4, $t1]}    # t[12]+ hi(a[7]*a[4])
+    mulhu $t1,$a7,$a5
+
+    @{[adds $acc3, $acc3, $t2]}    # t[11]+ lo(a[6]*a[5])
+    mul $t2,$a7,$a6    # lo(a[7]*a[6])  (vii)
+    @{[adcs $acc4,$acc4, $t3]}    # t[12]+ lo(a[7]*a[5])
+    mulhu $t3,$a7,$a6    # hi(a[7]*a[6])
+    add $acc5,zero,$carry1    # t[13] =0+c_pre{t[12]+lo(a[7]*a[5])}
+
+    @{[adds $acc4, $acc4, $t0]}    # t[12]+ hi(a[6]*a[5])
+
+    @{[ld_apend $temp,$fp]} # load ap_end
+    sub $temp,$temp,$ap    # cnt = ap_end-ap, done yet?
+    @{[sd_cnt $temp,$fp]}
+
+    @{[adc $acc5, $acc5, $t1]}    # t[13]+ hi(a[7]*a[5])
+
+    @{[adds $acc5, $acc5, $t2]}     # t[13]+ lo(a[7]*a[6])
+    @{[ld_num $temp,$fp]}
+    @{[ld_apend $carry2,$fp]}
+    sub $t0, $carry2, $temp    # rewinded ap
+    add $acc6,zero,$carry1    # t[14]=0+c_pre{t[13]+ lo(a[7]*a[6])}
+    add $acc6,$acc6,$t3    # t[14] + hi(a[7]*a[6])
+
+    # Check if we have processed all elements of a:
+    # If no remaining elements, jump to next step Lsqr8x_outer_break
+    # Otherwise, load previous partial product from temp buffer,
+    # add new a product, and continue inner loop .Lsqr8x_mul.
+    @{[ld_cnt $temp,$fp]}  # load cnt, cnt = ap_end-ap
+    beqz $temp, .Lsqr8x_outer_break
+
+    mv $temp,$a0    # a0->temp,reuse register'temp'
+    # loads next batch of data from temporary buffer
+    ld $a0,0($tp)
+    ld $a1,8($tp)
+    ld $a2,16($tp)
+    ld $a3,24($tp)
+    ld $a4,32($tp)
+    ld $a5,40($tp)
+    ld $a6,48($tp)
+    ld $a7,56($tp)
+
+    # accumulate new data
+    @{[adds $acc0, $acc0, $a0]}    # t[8]~t[14]...
+    ld $a0,0($ap)    # load new data, a[8..15]...
+    @{[adcs $acc1, $acc1, $a1]}
+    ld $a1,8($ap)
+    @{[adcs $acc2, $acc2, $a2]}
+    ld $a2,16($ap)
+    @{[adcs $acc3, $acc3, $a3]}
+    ld $a3,24($ap)
+    @{[adcs $acc4, $acc4, $a4]}
+    ld $a4,32($ap)
+    @{[adcs $acc5, $acc5, $a5]}
+    ld $a5,40($ap)
+    @{[adcs $acc6, $acc6, $a6]}
+    ld $a6,48($ap)
+
+    mv $np,$ap    # ap->np,reuse register'np',a[8]
+    @{[adcs $acc7, "zero", $a7]}    # t[7]...
+    ld $a7,56($ap)
+    add $ap,$ap,64    # move pointer forward by 64 bits (8 bytes),a[16]
+
+    li $carry2,-64    # cnt=-64, set loop count
+    @{[sd_cnt $carry2,$fp]}
+
+    # Compute cross products: (current 8 elements) x (remaining a)
+    # Accumulate results in RAX (accumulator)
+    #
+    #                                                         a[8]a[0]
+    #                                                     a[9]a[0]
+    #                                                 a[a]a[0]
+    #                                             a[b]a[0]
+    #                                         a[c]a[0]
+    #                                     a[d]a[0]
+    #                                 a[e]a[0]
+    #                             a[f]a[0]
+    #                                                     a[8]a[1]
+    #                         a[f]a[1]........................
+    #                                                 a[8]a[2]
+    #                     a[f]a[2]........................
+    #                                             a[8]a[3]
+    #                 a[f]a[3]........................
+    #                                         a[8]a[4]
+    #             a[f]a[4]........................
+    #                                     a[8]a[5]
+    #         a[f]a[5]........................
+    #                                 a[8]a[6]
+    #     a[f]a[6]........................
+    #                             a[8]a[7]
+    # a[f]a[7]........................
+ .Lsqr8x_mul:
+    mul $t0,$a0,$temp    # lo(a[i+8..i+15]*a[i]),..,lo(a[i+8..i+15]*a[i+7])
+    add $carry,zero,$carry1    # carry bit
+    mul $t1,$a1,$temp
+
+    @{[ld_cnt $carry2,$fp]}
+    add $carry2,$carry2,8    # cnt=cnt+8
+    @{[sd_cnt $carry2,$fp]}
+
+    mul $t2,$a2,$temp
+    mul $t3,$a3,$temp
+    @{[adds $acc0,$acc0,$t0]}
+    mul $t0,$a4,$temp
+    @{[adcs $acc1,$acc1,$t1]}
+    mul $t1,$a5,$temp
+    @{[adcs $acc2,$acc2,$t2]}
+    mul $t2,$a6,$temp
+    @{[adcs $acc3, $acc3, $t3]}
+    mul $t3,$a7,$temp
+    @{[adcs $acc4, $acc4, $t0]}
+    mulhu $t0,$a0,$temp    # hi(a[i+8..i+15]*a[i]),..,lo(a[i+8..i+15]*a[i+7])
+    @{[adcs $acc5, $acc5, $t1]}
+    mulhu $t1,$a1,$temp
+    @{[adcs $acc6, $acc6, $t2]}
+    mulhu $t2,$a2,$temp
+    @{[adcs $acc7, $acc7, $t3]}
+    mulhu $t3,$a3,$temp
+    add $carry,$carry,$carry1
+    sd $acc0,0($tp)
+    addi $tp,$tp,8    # move pointer forward by 8 bits (1 bytes)
+
+    @{[adds $acc0, $acc1, $t0]}
+    mulhu $t0,$a4,$temp
+    @{[adcs $acc1, $acc2, $t1]}
+    mulhu $t1,$a5,$temp
+    @{[adcs $acc2, $acc3, $t2]}
+    mulhu $t2,$a6,$temp
+    @{[adcs $acc3, $acc4, $t3]}
+    mulhu $t3,$a7,$temp
+
+    @{[ld_cnt $carry2,$fp]}
+    add $carry2,$np,$carry2    # carry2 = np + cnt
+    ld $temp,0($carry2)    # a[i+1],..,a[i+7],i=0
+    @{[adcs $acc4, $acc5, $t0]}
+    @{[adcs $acc5, $acc6, $t1]}
+    @{[adcs $acc6, $acc7, $t2]}
+    @{[adcs $acc7, $carry, $t3]}
+
+    # Process current 8 elements:
+    #  - If not finished: continue inner loop, .Lsqr8x_mul
+    #  - If finished: check remaining a elements
+    #     - If none: break out,jump to .Lsqr8x_break
+    #     - Else: load new data and restart inner loop, .Lsqr8x_mul
+    @{[ld_cnt $carry2,$fp]}
+    bnez $carry2,.Lsqr8x_mul
+
+    @{[ld_apend $carry2,$fp]}
+    beq $ap, $carry2, .Lsqr8x_break    # done yet?
+
+    # loads next batch of data from temporary buffer
+    ld $a0,0($tp)
+    ld $a1,8($tp)
+    ld $a2,16($tp)
+    ld $a3,24($tp)
+    ld $a4,32($tp)
+    ld $a5,40($tp)
+    ld $a6,48($tp)
+    ld $a7,56($tp)
+
+    # accumulate new data
+    # load new data, a[16..23]...
+    @{[adds $acc0, $acc0, $a0]}
+    ld $a0,0($ap)
+    ld $temp, -64($np)    # return to start of current 8 elements, a[0]、a[8]...
+    @{[adcs $acc1, $acc1, $a1]}
+    ld $a1,8($ap)
+    @{[adcs $acc2, $acc2, $a2]}
+    ld $a2,16($ap)
+    @{[adcs $acc3, $acc3, $a3]}
+    ld $a3,24($ap)
+    @{[adcs $acc4, $acc4, $a4]}
+    ld $a4,32($ap)
+    @{[adcs $acc5, $acc5, $a5]}
+    ld $a5,40($ap)
+    @{[adcs $acc6, $acc6, $a6]}
+    ld $a6,48($ap)
+    li $carry2,-64    # set loop count, cnt=-64, 8 times
+    @{[sd_cnt $carry2,$fp]}
+    @{[adcs $acc7, $acc7, $a7]}
+    ld $a7,56($ap)
+    add $ap,$ap,64    # move pointer forward by 64 bytes, a[24]...
+    j .Lsqr8x_mul
+
+    # Outer iteration completion:
+    #    - Fetch next data chunk for upcoming iteration
+    #    - Determine if this is the final iteration
+    #    - Update pointer positions and buffer offsets
+.balign 16
+.Lsqr8x_break:
+    ld $a0,0($np)
+    ld $a1,8($np)
+    add $ap,$np,64
+    ld $a2,16($np)
+    ld $a3,24($np)
+    @{[ld_apend $carry2,$fp]}
+    sub $t0,$carry2,$ap    # is it last iteration?
+    ld $a4,32($np)
+    ld $a5,40($np)
+    sub $t1,$tp,$t0
+    ld $a6,48($np)
+    ld $a7,56($np)
+    beqz $t0, .Lsqr8x_outer_loop
+
+    sd $acc0,0($tp)
+    sd $acc1,8($tp)
+    ld $acc0,0($t1)
+    ld $acc1,8($t1)
+    sd $acc2,16($tp)
+    sd $acc3,24($tp)
+    ld $acc2,16($t1)
+    ld $acc3,24($t1)
+    sd $acc4,32($tp)
+    sd $acc5,40($tp)
+    ld $acc4,32($t1)
+    ld $acc5,40($t1)
+    sd $acc6,48($tp)
+    sd $acc7,56($tp)
+    mv $tp,$t1
+    ld $acc6,48($t1)
+    ld $acc7,56($t1)
+
+    j .Lsqr8x_outer_loop
+    # Squaring algorithm:
+    # 1.Reload input
+    # 2.Compute diagonal squares, a[n-1]*a[n-1]|...|a[0]*a[0]
+    # 3.Cross terms x 2: first via lsl#1, rest via extr chain (128-bit << 1)
+    # 4.Merge diagonal + cross terms x 2
+.balign 16
+.Lsqr8x_outer_break:
+    ld $a1,0($t0)    # recall that $t0 is &a[0], load a[0 1 2 3]
+    ld $a3,8($t0)
+    ld $t1,8(sp)    # load previously computed cross product term from buffer
+    ld $t2,16(sp)
+    ld $a5,16($t0)
+    ld $a7,24($t0)
+
+    add $ap,$t0,32    # a[4]
+    ld $t3,24(sp)
+    sd $acc0,0($tp)
+    ld $t0,32(sp)
+    sd $acc1,8($tp)
+
+    mul $acc0,$a1,$a1    # lo(a[0]*a[0])
+    sd $acc2,16($tp)
+    sd $acc3,24($tp)
+    mulhu $a1,$a1,$a1    # hi(a[0]*a[0])
+    sd $acc4,32($tp)
+    sd $acc5,40($tp)
+    mul $a2,$a3,$a3    # lo(a[1]*a[1])
+    sd $acc6,48($tp)
+    sd $acc7,56($tp)
+    mv $tp,sp
+    mulhu $a3,$a3,$a3    # hi(a[1]*a[1])
+
+    slli $carry2,$t1,1    # cross terms x 2
+    @{[adds $acc1, $a1, $carry2]}    # (t1 << 1) + hi(a[0]*a[0])
+    @{[extr $t1, $t2, $t1]}    # t1 = (t2 << 1) + high(t1), cross term multiplied by 2
+
+    @{[ld_num $carry2,$fp]}
+    addi $carry2,$carry2,-32    # set loop count, cnt=num-32
+    @{[sd_cnt $carry2,$fp]}
+
+    # Loop processing 4 diagonal elements per iteration:
+    #  - Compute a[i]*a[i] for 4 elements
+    #  - Accumulate left-shifted cross product terms
+.Lsqr4x_shift_n_add:
+    @{[adcs $acc2, $a2, $t1]}    # t1+ lo(a[1]*a[1])
+    @{[extr $t2, $t3, $t2]}    # t2 = (t3 << 1) + high(t2), cross term multiplied by 2
+
+    @{[ld_cnt $carry2,$fp]}
+    addi $carry2,$carry2,-32    # cnt=cnt-32
+    @{[sd_cnt $carry2,$fp]}
+
+    @{[adcs $acc3, $a3, $t2]}    # t2+ hi(a[1]*a[1])
+    ld $t1,40($tp)
+    ld $t2,48($tp)
+    mul $a4,$a5,$a5    # lo(a[2]*a[2])
+    ld $a1,0($ap)    # a[4 5]
+    ld $a3,8($ap)
+    addi $ap,$ap,16
+    mulhu $a5,$a5,$a5    # hi(a[2]*a[2])
+    @{[extr $t3, $t0, $t3]}    # t3 = (t0 << 1) + high(t3), cross term multiplied by 2
+    sd $acc0,0($tp)
+    sd $acc1,8($tp)
+    mul $a6,$a7,$a7    # lo(a[3]*a[3])
+    mulhu $a7,$a7,$a7    # hi(a[3]*a[3])
+    @{[adcs $acc4, $a4, $t3]}    # t3 + lo(a[2]*a[2])
+    @{[extr $t0, $t1, $t0]}    # t0 = (t1 << 1) + high(t0), cross term multiplied by 2
+    sd $acc2,16($tp)
+    sd $acc3,24($tp)
+    @{[adcs $acc5, $a5, $t0]}    # t0 + hi(a[2]*a[2])
+    ld $t3,56($tp)
+    ld $t0,64($tp)
+    @{[extr $t1, $t2, $t1]}    # t1 = (t2 << 1) + high(t1), cross term multiplied by 2
+    @{[adcs $acc6, $a6, $t1]}    # t1 + lo(a[3]*a[3])
+    @{[extr $t2, $t3, $t2]}    # t2 = (t3 << 1) + high(t2), cross term multiplied by 2
+    @{[adcs $acc7, $a7, $t2]}    # t2 + hi(a[3]*a[3])
+    ld $t1,72($tp)
+    ld $t2,80($tp)
+    mul $a0,$a1,$a1    # lo(a[4]*a[4])
+    ld $a5,0($ap)    # a[6 7]
+    ld $a7,8($ap)
+    addi $ap,$ap,16    # move forward by two elements
+    mulhu $a1,$a1,$a1    # hi(a[4]*a[4])
+    sd $acc4,32($tp)
+    sd $acc5,40($tp)
+    mul $a2,$a3,$a3    # lo(a[5]*a[5])
+    mulhu $a3,$a3,$a3    # hi(a[5]*a[5])
+    @{[extr $t3, $t0, $t3]}    # t3 = (t0 << 1) + high(t3), cross term multiplied by 2
+    sd $acc6,48($tp)
+    sd $acc7,56($tp)
+    addi $tp,$tp,64
+    @{[adcs $acc0, $a0, $t3]}    # t3 + lo(a[4]*a[4])
+    @{[extr $t0, $t1, $t0]}    # t0 = (t1 << 1) + high(t0), cross term multiplied by 2
+    @{[adcs $acc1, $a1, $t0]}    # t0 + hi(a[4]*a[4])
+    ld $t3,24($tp)
+    ld $t0,32($tp)
+    @{[extr $t1, $t2, $t1]}    # t1 = (t2 << 1) + high(t1), cross term multiplied by 2
+
+    @{[ld_cnt $carry2,$fp]}
+    bnez $carry2,.Lsqr4x_shift_n_add    # if cnt!=0, jump to .Lsqr4x_shift_n_add
+___
+my ($np,$np_temp) = use_regs(11,13);
+$code.=<<___;
+    # Tail element handling for square computation
+    @{[ld_np $np,$fp]}    # load np, N
+    @{[ld_n0 $n0,$fp]} # load n0, n0`
+    @{[adcs $acc2, $a2, $t1]}    # t1 + lo(a[n-3]*a[n-3])
+    @{[extr $t2, $t3, $t2]}    # t2 = (t3 << 1) + high(t2), cross term multiplied by 2
+    @{[adcs $acc3, $a3, $t2]}    # t2 + hi(a[n-3]*a[n-3])
+    ld $t1,40($tp)
+    ld $t2,48($tp)
+    mul $a4,$a5,$a5    # lo(a[n-2]*a[n-2])
+    mulhu $a5,$a5,$a5    # hi(a[n-2]*a[n-2])
+    sd $acc0,0($tp)
+    sd $acc1,8($tp)
+    mul $a6,$a7,$a7    # lo(a[n-1]*a[n-1])
+    mulhu $a7,$a7,$a7    # hi(a[n-1]*a[n-1])
+    sd $acc2,16($tp)
+    sd $acc3,24($tp)
+    @{[extr $t3, $t0, $t3]}    # t3 = (t0 << 1) + high(t3), cross term multiplied by 2
+    @{[adcs $acc4, $a4, $t3]}    # t3 + lo(a[n-2]*a[n-2])
+    @{[extr $t0, $t1, $t0]}    # t0 = (t1 << 1) + high(t0), cross term multiplied by 2
+    ld $acc0,0(sp)
+    ld $acc1,8(sp)
+    @{[adcs $acc5, $a5, $t0]}    # t0 + hi(a[n-2]*a[n-2])
+    @{[extr $t1, $t2, $t1]}    # t1 = (t2 << 1) + high(t1), cross term multiplied by 2
+    ld $a0,0($np)    # load N[0..7]
+    ld $a1,8($np)
+    @{[adcs $acc6, $a6, $t1]}    # t1 + lo(a[n-1]*a[n-1])
+    @{[extr $t2, "zero", $t2]}    # t2 = high(t2)
+    ld $a2,16($np)
+    ld $a3,24($np)
+    @{[adc $acc7, $a7, $t2]}     # t2 + hi(a[n-1]*a[n-1])
+    ld $a4,32($np)
+    ld $a5,40($np)
+
+    # Reduce by 512 bits per iteration
+    mul $na0,$n0,$acc0    # t[0]*n0, the modular reduction coefficient
+    ld $a6,48($np)
+    ld $a7,56($np)
+    @{[ld_num $carry2,$fp]}
+    add $carry2,$np,$carry2    # np_end=np+num
+    @{[sd_npend $carry2,$fp]}
+    ld $acc2,16(sp)
+    ld $acc3,24(sp)
+    sd $acc4,32($tp)
+    sd $acc5,40($tp)
+    ld $acc4,32(sp)
+    ld $acc5,40(sp)
+    sd $acc6,48($tp)
+    sd $acc7,56($tp)
+    ld $acc6,48(sp)
+    ld $acc7,56(sp)
+    add $np,$np,64    # move pointer forward by 64 bytes, 8 elements
+    mv $tp,sp
+    li $carry2,0
+    @{[sd_topmost $carry2,$fp]} # initial topmost carry as 0
+    li $carry2,8    # set loop count, cnt=8
+    @{[sd_cnt $carry2,$fp]}
+
+    # Montgomery reduction, t = t + m * N / 2^64
+    # m = t[i] * n0 mod 2^64
+    # single-round reduction process:Lsqr8x_reduction ——>Lsqr8x_tail->Lsqr8x_tail_break
+    #                                                 |__Lsqr8x8_post_condition
+    # after one round of reduction completes,
+    # process the current m[i..i+7]*N+t until
+    # all tp in the buffer have been reduced
+ .Lsqr8x_reduction:
+    # mul $t0,$a0,$na0    # discarded
+    mul $t1,$a1,$na0    # lo(n[1-7])*lo(t[0]*n0)
+
+    @{[ld_cnt $carry2,$fp]}
+    addi $carry2,$carry2,-1    # cnt=cnt-1
+    @{[sd_cnt $carry2,$fp]}
+
+    mul $t2,$a2,$na0
+    sd $na0,0($tp)    # put aside "na0=t[0]*n0" for tail processing
+    addi $tp,$tp,8    # tp=tp+8
+    mul $t3,$a3,$na0
+
+    # low64 partial product + reduction term
+    snez $carry1, $acc0        # only carry status needed, not full lo1 result
+    mul $t0,$a4,$na0
+    @{[adcs $acc0, $acc1, $t1]}
+    mul $t1,$a5,$na0
+    @{[adcs $acc1, $acc2, $t2]}
+    mul $t2,$a6,$na0
+    @{[adcs $acc2, $acc3, $t3]}
+    mul $t3,$a7,$na0
+    @{[adcs $acc3, $acc4, $t0]}
+    mulhu $t0,$a0,$na0    # hi(n[0-7])*lo(t[0]*n0)
+    @{[adcs $acc4, $acc5, $t1]}
+    mulhu $t1,$a1,$na0
+    @{[adcs $acc5, $acc6, $t2]}
+    mulhu $t2,$a2,$na0
+    @{[adcs $acc6, $acc7, $t3]}
+    mulhu $t3,$a3,$na0
+    add $acc7,zero,$carry1
+
+    # high64 partial product + reduction term
+    @{[adds $acc0, $acc0, $t0]}
+    mulhu $t0,$a4,$na0
+    @{[adcs $acc1, $acc1, $t1]}
+    mulhu $t1,$a5,$na0
+    @{[adcs $acc2, $acc2, $t2]}
+    mulhu $t2,$a6,$na0
+    @{[adcs $acc3, $acc3, $t3]}
+    mulhu $t3,$a7,$na0
+    mul $na0,$n0,$acc0    # next na0
+    @{[adcs $acc4, $acc4, $t0]}
+    @{[adcs $acc5, $acc5, $t1]}
+    @{[adcs $acc6, $acc6, $t2]}
+    @{[adc  $acc7, $acc7, $t3]}
+
+    @{[ld_cnt $carry2,$fp]}
+    bnez $carry2,.Lsqr8x_reduction    # 8 iteration done?
+
+    ld $t0,0($tp)
+    ld $t1,8($tp)
+    ld $t2,16($tp)
+    ld $t3,24($tp)
+    mv $np_temp,$tp
+    @{[ld_npend $carry2,$fp]}
+    sub $carry2,$carry2,$np    # cnt=np_end-np, done yet?
+    @{[sd_cnt $carry2,$fp]}
+
+    @{[adds $acc0, $acc0, $t0]}
+    @{[adcs $acc1, $acc1, $t1]}
+    ld $t0,32($tp)
+    ld $t1,40($tp)
+    @{[adcs $acc2, $acc2, $t2]}
+    @{[adcs $acc3, $acc3, $t3]}
+    ld $t2,48($tp)
+    ld $t3,56($tp)
+    @{[adcs $acc4, $acc4, $t0]}
+    @{[adcs $acc5, $acc5, $t1]}
+    @{[adcs $acc6, $acc6, $t2]}
+    @{[adcs $acc7, $acc7, $t3]}
+
+    # check whether N has finished iteration.
+    # If completed, proceed to the special scenario '8' for processing;
+    # otherwise, continue with the reduction Lsqr8x_tail.
+    @{[ld_cnt $carry2,$fp]}
+    beqz $carry2,.Lsqr8x8_post_condition
+
+    ld $n0,-64($tp)    # load the previous na0
+    ld $a0,0($np)    # load next N[0..7]
+    ld $a1,8($np)
+    ld $a2,16($np)
+    ld $a3,24($np)
+    ld $a4,32($np)
+    ld $a5,40($np)
+    li $carry2,-64
+    @{[sd_cnt $carry2,$fp]}  # set loop cnt,cnt=-64
+    ld $a6,48($np)
+    ld $a7,56($np)
+    add $np,$np,64    # move pointer forward by next 8 elements
+
+.Lsqr8x_tail:
+    mul $t0,$a0,$n0
+    add $carry,zero,$carry1    # carry bit, modulo-scheduled
+    mul $t1,$a1,$n0
+
+    @{[ld_cnt $carry2,$fp]}
+    addi $carry2,$carry2,8    # cnt=cnt+8
+    @{[sd_cnt $carry2,$fp]}
+
+    mul $t2,$a2,$n0
+    mul $t3,$a3,$n0
+    # low64 partial product + reduction term
+    @{[adds $acc0, $acc0, $t0]}
+    mul $t0,$a4,$n0
+    @{[adcs $acc1, $acc1, $t1]}
+    mul $t1,$a5,$n0
+    @{[adcs $acc2, $acc2, $t2]}
+    mul $t2,$a6,$n0
+    @{[adcs $acc3, $acc3, $t3]}
+    mul $t3,$a7,$n0
+    @{[adcs $acc4, $acc4, $t0]}
+    mulhu $t0,$a0,$n0
+    @{[adcs $acc5, $acc5, $t1]}
+    mulhu $t1,$a1,$n0
+    @{[adcs $acc6, $acc6, $t2]}
+    mulhu $t2,$a2,$n0
+    @{[adcs $acc7, $acc7, $t3]}
+    mulhu $t3,$a3,$n0
+    add $carry,$carry,$carry1
+    sd $acc0,0($tp)
+    addi $tp,$tp,8    # move pointer forward by next 8 elements
+
+    # high64 partial product + reduction term
+    @{[adds $acc0, $acc1, $t0]}
+    mulhu $t0,$a4,$n0
+    @{[adcs $acc1, $acc2, $t1]}
+    mulhu $t1,$a5,$n0
+    @{[adcs $acc2, $acc3, $t2]}
+    mulhu $t2,$a6,$n0
+    @{[adcs $acc3, $acc4, $t3]}
+    mulhu $t3,$a7,$n0
+
+    @{[ld_cnt $carry2,$fp]}
+    add $carry2,$np_temp,$carry2
+    ld $n0,0($carry2)    # next n0, ld 0(np_temp+cnt)
+
+    @{[adcs $acc4, $acc5, $t0]}
+    @{[adcs $acc5, $acc6, $t1]}
+    @{[adcs $acc6, $acc7, $t2]}
+    @{[adcs $acc7, $carry, $t3]}
+    @{[ld_cnt $carry2,$fp]}
+    bnez $carry2,.Lsqr8x_tail    # 8 iteration done?
+
+    ld $a0,0($tp)
+    ld $a1,8($tp)
+    @{[ld_npend $carry2,$fp]}
+    sub $carry2,$carry2,$np    # done yet? cnt=np_end-np
+    @{[sd_cnt $carry2,$fp]}
+
+    @{[ld_npend $t0,$fp]}
+    @{[ld_num $t1,$fp]}
+    sub $t2, $t0, $t1    # rewinded np, t2=np_end-num
+    ld $a2,16($tp)
+    ld $a3,24($tp)
+    ld $a4,32($tp)
+    ld $a5,40($tp)
+    ld $a6,48($tp)
+    ld $a7,56($tp)
+
+    @{[ld_cnt $carry2,$fp]}
+    beqz $carry2,.Lsqr8x_tail_break    # exit loop when np=np_end
+
+    ld $n0,-64($np_temp)    # load the previous n0 value
+    @{[adds $acc0, $acc0, $a0]}
+    @{[adcs $acc1, $acc1, $a1]}
+    ld $a0,0($np)    # next N[0..7]
+    ld $a1,8($np)
+    @{[adcs $acc2, $acc2, $a2]}
+    @{[adcs $acc3, $acc3, $a3]}
+    ld $a2,16($np)
+    ld $a3,24($np)
+    @{[adcs $acc4, $acc4, $a4]}
+    @{[adcs $acc5, $acc5, $a5]}
+    ld $a4,32($np)
+    ld $a5,40($np)
+    @{[adcs $acc6, $acc6, $a6]}
+
+    li $carry2,-64    # set loop cnt,cnt=-64
+    @{[sd_cnt $carry2,$fp]}
+
+    @{[adcs $acc7, $acc7, $a7]}
+    ld $a6,48($np)
+    ld $a7,56($np)
+    add $np,$np,64
+    j .Lsqr8x_tail
+
+.balign 16
+.Lsqr8x_tail_break:
+    @{[ld_n0 $n0,$fp]}    # load n0
+    addi $carry2,$tp,64    # cnt=cnt+64
+    @{[sd_cnt $carry2,$fp]}
+    @{[ld_topmost $carry2,$fp]} # load topmost
+
+    snez $carry1, $carry2    # "move" topmost carry to carry bit
+    @{[adcs $t0, $acc0, $a0]}
+    @{[adcs $t1, $acc1, $a1]}
+    ld $acc0,0($np_temp)    # load the current t[0..7] from tp
+    ld $acc1,8($np_temp)
+    @{[adcs $acc2, $acc2, $a2]}
+    ld $a0,0($t2)    # recall that $t2 is &n[0], initialize, load N[0..7]
+    ld $a1,8($t2)
+    @{[adcs $acc3, $acc3, $a3]}
+    ld $a2,16($t2)
+    ld $a3,24($t2)
+    @{[adcs $acc4, $acc4, $a4]}
+    @{[adcs $acc5, $acc5, $a5]}
+    ld $a4,32($t2)
+    ld $a5,40($t2)
+    @{[adcs $acc6, $acc6, $a6]}
+    @{[adcs $acc7, $acc7, $a7]}
+    ld $a6,48($t2)
+    ld $a7,56($t2)
+    addi $np,$t2,64    # np=np+64, move pointer forward by next 8 elements
+
+    @{[ld_topmost $carry2,$fp]}
+    add $carry2,zero,$carry1    # topmost carry
+    @{[sd_topmost $carry2,$fp]} # offload topmost
+
+    mul $na0,$n0,$acc0    # na0=n0*t[0]
+    sd $t0,0($tp)
+    sd $t1,8($tp)
+    sd $acc2,16($tp)
+    sd $acc3,24($tp)
+    ld $acc2,16($np_temp)
+    ld $acc3,24($np_temp)
+    sd $acc4,32($tp)
+    sd $acc5,40($tp)
+    ld $acc4,32($np_temp)
+    ld $acc5,40($np_temp)
+    @{[ld_cnt $t1,$fp]}    # load cnt, t1<-cnt
+    sd $acc6,48($tp)
+    sd $acc7,56($tp)
+    mv $tp,$np_temp    # update tp<-np_temp
+    ld $acc6,48($np_temp)
+    ld $acc7,56($np_temp)
+    li $carry2,8    #  set loop cnt, cnt=8
+    @{[sd_cnt $carry2,$fp]}
+    bne $t1,$fp, .Lsqr8x_reduction    # if t1!=fp,jump to the next round of reduction and
+                                      # continue with the reduction of the next set of na0.
+
+    @{[sd_n0 $n0,$fp]}    # offload n0
+    @{[ld_rp $carry,$fp]}
+    add $tp,$tp,64
+    @{[subs  $t0, $acc0, $a0]}
+    @{[sbcs  $t1, $acc1, $a1]}
+    @{[ld_num $t2,$fp]}
+    addi $t3,$t2,-64    # cnt=num-64
+    @{[sd_cnt $t3,$fp]}
+    mv $carry2,$carry    # ap_end=rp, rp copy
+    @{[sd_apend $carry2,$fp]}
+
+    # conditional subtraction, compute T-N
+    # If T < N (borrow occurs), set t = T;
+    # If T >= N (no borrow), set t = T-N
+    # Process 8 elements per loop iteration.
+.Lsqr8x_sub:
+    @{[sbcs  $t2, $acc2, $a2]}    # t=t-N
+    ld $a0,0($np)
+    ld $a1,8($np)
+    @{[sbcs  $t3, $acc3, $a3]}
+    sd $t0,0($carry)    # sd result
+    sd $t1,8($carry)
+    @{[sbcs  $t0, $acc4, $a4]}
+    ld $a2,16($np)
+    ld $a3,24($np)
+    @{[sbcs  $t1, $acc5, $a5]}
+    sd $t2,16($carry)
+    sd $t3,24($carry)
+    @{[sbcs  $t2, $acc6, $a6]}
+    ld $a4,32($np)
+    ld $a5,40($np)
+    @{[sbcs  $t3, $acc7, $a7]}
+    ld $a6,48($np)
+    ld $a7,56($np)
+    add $np,$np,64
+    ld $acc0,0($tp)    # ld t[0..7]
+    ld $acc1,8($tp)
+
+    @{[ld_cnt $carry2,$fp]}
+    addi $carry2,$carry2,-64    # cnt=cnt-64
+    @{[sd_cnt $carry2,$fp]}
+
+    ld $acc2,16($tp)
+    ld $acc3,24($tp)
+    ld $acc4,32($tp)
+    ld $acc5,40($tp)
+    ld $acc6,48($tp)
+    ld $acc7,56($tp)
+    add $tp,$tp,64    # move pointer forward by next 8 elements
+    sd $t0,32($carry)
+    sd $t1,40($carry)
+    @{[sbcs  $t0, $acc0, $a0]}
+    sd $t2,48($carry)
+    sd $t3,56($carry)
+    add $carry,$carry,64
+    @{[sbcs  $t1, $acc1, $a1]}
+
+    @{[ld_cnt $carry2,$fp]}
+    bnez $carry2,.Lsqr8x_sub    # # if cnt!=0, jump to Lsqr8x_sub
+
+    @{[sbcs  $t2, $acc2, $a2]}
+    mv $tp,sp
+    @{[ld_num $carry2,$fp]}
+    add $ap,sp,$carry2    # ap=sp-num
+
+    @{[ld_apend $carry2,$fp]}
+    ld $a0,0($carry2)    # ld 0(ap_end)
+    ld $a1,8($carry2)
+
+    @{[sbcs  $t3, $acc3, $a3]}
+    sd $t0,0($carry)
+    sd $t1,8($carry)
+    @{[sbcs  $t0, $acc4, $a4]}
+    @{[ld_apend $carry2,$fp]}
+    ld $a2,16($carry2)
+    ld $a3,24($carry2)
+    @{[sbcs  $t1, $acc5, $a5]}
+    sd $t2,16($carry)
+    sd $t3,24($carry)
+    @{[sbcs  $t2, $acc6, $a6]}
+    ld $acc0,0($ap)
+    ld $acc1,8($ap)
+    @{[sbcs  $t3, $acc7, $a7]}
+    ld $acc2,16($ap)
+    ld $acc3,24($ap)
+
+    @{[ld_topmost $temp,$fp]}
+    sub $carry2, $temp, $carry1    # did it borrow?
+    sltu $carry1, $temp, $carry2
+    xori $carry1, $carry1, 1
+
+    sd $t0,32($carry)
+    sd $t1,40($carry)
+    sd $t2,48($carry)
+    sd $t3,56($carry)
+
+    @{[ld_num $carry2,$fp]}
+    addi $carry2,$carry2,-32    # cnt=num-32
+    @{[sd_cnt $carry2,$fp]}
+    @{[ld_ra $ra,$fp]}    # offload ra
+
+
+    # The csel conditional instruction selects the result based on the borrow flag.
+    # If there is a borrow (C=0), select the original value acc
+    # If there is no borrow (C=1), select the subtracted value a
+    # Process 4 elements per loop iteration.
+.Lsqr4x_cond_copy:
+    @{[ld_cnt $carry2,$fp]}
+    addi $carry2,$carry2,-32    # cnt=cnt_pre-32=num-32-32
+    @{[sd_cnt $carry2,$fp]}
+
+    @{[csel  $t0, $acc0, $a0]}    # when pre_borrow occurs, t0 = acc0
+    sd zero,0($tp)
+    sd zero,8($tp)
+    @{[csel  $t1, $acc1, $a1]}
+    @{[ld_apend $carry2,$fp]}
+    ld $a0,32($carry2)
+    ld $a1,40($carry2)
+    ld $acc0,32($ap)
+    ld $acc1,40($ap)
+    @{[csel  $t2, $acc2, $a2]}
+    sd zero,16($tp)
+    sd zero,24($tp)
+    add $tp,$tp,32
+    @{[csel  $t3, $acc3, $a3]}
+    ld $a2,48($carry2)
+    ld $a3,56($carry2)
+    ld $acc2,48($ap)
+    ld $acc3,56($ap)
+    add $ap,$ap,32
+    sd $t0,0($carry2)
+    sd $t1,8($carry2)
+    sd $t2,16($carry2)
+    sd $t3,24($carry2)
+    add $carry2,$carry2,32    # ap_end=ap_end+32
+    @{[sd_apend $carry2,$fp]}
+    sd zero,0($ap)
+    sd zero,8($ap)
+    sd zero,16($ap)
+    sd zero,24($ap)
+
+    @{[ld_cnt $carry2,$fp]}
+    bnez $carry2,.Lsqr4x_cond_copy    # if cnt!=0, jump to Lsqr4x_cond_copy
+
+    @{[csel  $t0, $acc0, $a0]}
+    sd zero,0($tp)
+    sd zero,8($tp)
+    @{[csel  $t1, $acc1, $a1]}
+    sd zero,16($tp)
+    sd zero,24($tp)
+    @{[csel  $t2, $acc2, $a2]}
+    @{[csel  $t3, $acc3, $a3]}
+    @{[ld_apend $carry2,$fp]}
+    sd $t0,0($carry2)
+    sd $t1,8($carry2)
+    sd $t2,16($carry2)
+    sd $t3,24($carry2)
+    j .Lsqr8x_done
+
+# process special case for 8-word boundary
+.balign 16
+.Lsqr8x8_post_condition:
+    add $carry,zero,$carry1
+    @{[subs  $a0, $acc0, $a0]}    # acc0-7,carry hold result, a0-7 hold modulus
+    @{[ld_rp $ap,$fp]}    # pull rp
+    @{[sbcs  $a1, $acc1, $a1]}
+    sd zero,0(sp)
+    sd zero,8(sp)
+    @{[sbcs  $a2, $acc2, $a2]}
+    sd zero,16(sp)
+    sd zero,24(sp)
+    @{[sbcs  $a3, $acc3, $a3]}
+    sd zero,32(sp)
+    sd zero,40(sp)
+    @{[sbcs  $a4, $acc4, $a4]}
+    sd zero,48(sp)
+    sd zero,56(sp)
+    @{[sbcs  $a5, $acc5, $a5]}
+    sd zero,64(sp)
+    sd zero,72(sp)
+    @{[sbcs  $a6, $acc6, $a6]}
+    sd zero,80(sp)
+    sd zero,88(sp)
+    @{[sbcs  $a7, $acc7, $a7]}
+    sd zero,96(sp)
+    sd zero,104(sp)
+    @{[sbcs  $carry, $carry, "zero"]}    # did it borrow?
+    xori $carry1, $carry1, 1
+    sd zero,112(sp)
+    sd zero,120(sp)
+
+    # a0-7 hold result-modulus
+    @{[csel  $a0, $acc0, $a0]}
+    @{[csel  $a1, $acc1, $a1]}
+    @{[csel  $a2, $acc2, $a2]}
+    @{[csel  $a3, $acc3, $a3]}
+    sd $a0,0($ap)
+    sd $a1,8($ap)
+    @{[csel  $a4, $acc4, $a4]}
+    @{[csel  $a5, $acc5, $a5]}
+    sd $a2,16($ap)
+    sd $a3,24($ap)
+    @{[csel  $a6, $acc6, $a6]}
+    @{[csel  $a7, $acc7, $a7]}
+    sd $a4,32($ap)
+    sd $a5,40($ap)
+    sd $a6,48($ap)
+    sd $a7,56($ap)
+
+    @{[ld_ra $ra,$fp]}    # pull ra return address
+.Lsqr8x_done:
+    mv sp, $fp
+    li $rp, 1
+___
+$code .= <<___;
+    ld      s0,88(sp)
+    ld      s1,80(sp)
+    ld      s2,72(sp)
+    ld      s3,64(sp)
+    ld      s4,56(sp)
+    ld      s5,48(sp)
+    ld      s6,40(sp)
+    ld      s7,32(sp)
+    ld      s8,24(sp)
+    ld      s9,16(sp)
+    ld      s11,8(sp)
+    ld      s10,0(sp)
+    addi    sp,sp,168
+    ret
+.size bn_sqr8x_mont,.-bn_sqr8x_mont
+___
+}
+print $code;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/bn/asm/rsaz-avx2.pl b/deps/openssl/openssl/crypto/bn/asm/rsaz-avx2.pl
index 29243a7c0b7..72e4afe2dfc 100755
--- a/deps/openssl/openssl/crypto/bn/asm/rsaz-avx2.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/rsaz-avx2.pl
@@ -26,7 +26,7 @@
 #     on AVX2 capable x86_64 platforms",
 #     http://rt.openssl.org/Ticket/Display.html?id=2850&user=guest&pass=guest
 #
-# +13% improvement over original submission by <appro@openssl.org>
+# +13% improvement over original submission by <https://github.com/dot-asm>
 #
 # rsa2048 sign/sec	OpenSSL 1.0.1	scalar(*)	this
 # 2.3GHz Haswell	621		765/+23%	1113/+79%
diff --git a/deps/openssl/openssl/crypto/bn/asm/rsaz-x86_64.pl b/deps/openssl/openssl/crypto/bn/asm/rsaz-x86_64.pl
index 3ceacea1d33..faa360af2b8 100755
--- a/deps/openssl/openssl/crypto/bn/asm/rsaz-x86_64.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/rsaz-x86_64.pl
@@ -34,7 +34,7 @@
 # to more modular mixture of C and assembly. And it's optimized even
 # for processors other than Intel Core family (see table below for
 # improvement coefficients).
-# 						<appro@openssl.org>
+# 						<https://github.com/dot-asm>
 #
 # RSA1024 sign/sec	this/original	|this/rsax(*)	this/fips(*)
 #			----------------+---------------------------
diff --git a/deps/openssl/openssl/crypto/bn/asm/s390x-gf2m.pl b/deps/openssl/openssl/crypto/bn/asm/s390x-gf2m.pl
index 038a6bc9744..7c152854def 100644
--- a/deps/openssl/openssl/crypto/bn/asm/s390x-gf2m.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/s390x-gf2m.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2011-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # May 2011
@@ -222,7 +222,7 @@ $code.=<<___;
 	lm${g}	%r6,%r15,`$stdframe+128+6*$SIZE_T`($sp)
 	br	$ra
 .size	bn_GF2m_mul_2x2,.-bn_GF2m_mul_2x2
-.string	"GF(2^m) Multiplication for s390x, CRYPTOGAMS by <appro\@openssl.org>"
+.string	"GF(2^m) Multiplication for s390x, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 $code =~ s/\`([^\`]*)\`/eval($1)/gem;
diff --git a/deps/openssl/openssl/crypto/bn/asm/s390x-mont.pl b/deps/openssl/openssl/crypto/bn/asm/s390x-mont.pl
index af088ccae10..ae13b61a1f2 100644
--- a/deps/openssl/openssl/crypto/bn/asm/s390x-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/s390x-mont.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # April 2007.
@@ -275,7 +275,7 @@ $code.=<<___;
 	lghi	%r2,1		# signal "processed"
 	br	%r14
 .size	bn_mul_mont,.-bn_mul_mont
-.string	"Montgomery Multiplication for s390x, CRYPTOGAMS by <appro\@openssl.org>"
+.string	"Montgomery Multiplication for s390x, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 foreach (split("\n",$code)) {
diff --git a/deps/openssl/openssl/crypto/bn/asm/sparct4-mont.pl b/deps/openssl/openssl/crypto/bn/asm/sparct4-mont.pl
index 8a3bedc9af4..341959035b7 100755
--- a/deps/openssl/openssl/crypto/bn/asm/sparct4-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/sparct4-mont.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2012-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2012-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -89,7 +89,7 @@ $code.=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #ifdef	__arch64__
 .register	%g2,#scratch
diff --git a/deps/openssl/openssl/crypto/bn/asm/sparcv8.S b/deps/openssl/openssl/crypto/bn/asm/sparcv8.S
index e5402cc4e26..30fb4abd285 100644
--- a/deps/openssl/openssl/crypto/bn/asm/sparcv8.S
+++ b/deps/openssl/openssl/crypto/bn/asm/sparcv8.S
@@ -1,9 +1,9 @@
 .ident	"sparcv8.s, Version 1.4"
-.ident	"SPARC v8 ISA artwork by Andy Polyakov <appro@openssl.org>"
+.ident	"SPARC v8 ISA artwork by Andy Polyakov <https://github.com/dot-asm>"

 /*
  * ====================================================================
- * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -16,7 +16,7 @@
  * This is my modest contribution to OpenSSL project (see
  * http://www.openssl.org/ for more information about it) and is
  * a drop-in SuperSPARC ISA replacement for crypto/bn/bn_asm.c
- * module. For updates see http://fy.chalmers.se/~appro/hpe/.
+ * module.
  *
  * See bn_asm.sparc.v8plus.S for more details.
  */
diff --git a/deps/openssl/openssl/crypto/bn/asm/sparcv8plus.S b/deps/openssl/openssl/crypto/bn/asm/sparcv8plus.S
index 8a936f1c72e..10f7e155973 100644
--- a/deps/openssl/openssl/crypto/bn/asm/sparcv8plus.S
+++ b/deps/openssl/openssl/crypto/bn/asm/sparcv8plus.S
@@ -1,9 +1,9 @@
 .ident	"sparcv8plus.s, Version 1.4"
-.ident	"SPARC v9 ISA artwork by Andy Polyakov <appro@openssl.org>"
+.ident	"SPARC v9 ISA artwork by Andy Polyakov <https://github.com/dot-asm>"

 /*
  * ====================================================================
- * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -16,7 +16,7 @@
  * This is my modest contribution to OpenSSL project (see
  * http://www.openssl.org/ for more information about it) and is
  * a drop-in UltraSPARC ISA replacement for crypto/bn/bn_asm.c
- * module. For updates see http://fy.chalmers.se/~appro/hpe/.
+ * module.
  *
  * Questions-n-answers.
  *
diff --git a/deps/openssl/openssl/crypto/bn/asm/sparcv9-gf2m.pl b/deps/openssl/openssl/crypto/bn/asm/sparcv9-gf2m.pl
index 9f773f183c9..5ef817457f5 100644
--- a/deps/openssl/openssl/crypto/bn/asm/sparcv9-gf2m.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/sparcv9-gf2m.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2012-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2012-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # October 2012
@@ -41,7 +41,7 @@ $code.=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #ifdef __arch64__
 .register	%g2,#scratch
@@ -193,7 +193,7 @@ $code.=<<___;
 	restore
 .type	bn_GF2m_mul_2x2,#function
 .size	bn_GF2m_mul_2x2,.-bn_GF2m_mul_2x2
-.asciz	"GF(2^m) Multiplication for SPARCv9, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"GF(2^m) Multiplication for SPARCv9, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	4
 ___

diff --git a/deps/openssl/openssl/crypto/bn/asm/sparcv9-mont.pl b/deps/openssl/openssl/crypto/bn/asm/sparcv9-mont.pl
index d438af56264..4578f523a68 100644
--- a/deps/openssl/openssl/crypto/bn/asm/sparcv9-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/sparcv9-mont.pl
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # December 2005
@@ -86,7 +86,7 @@ $code=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 .section	".text",#alloc,#execinstr

@@ -614,7 +614,7 @@ $code.=<<___;
 	add	$tp,8,$tp
 .type	$fname,#function
 .size	$fname,(.-$fname)
-.asciz	"Montgomery Multiplication for SPARCv9, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Montgomery Multiplication for SPARCv9, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	32
 ___
 $code =~ s/\`([^\`]*)\`/eval($1)/gem;
diff --git a/deps/openssl/openssl/crypto/bn/asm/sparcv9a-mont.pl b/deps/openssl/openssl/crypto/bn/asm/sparcv9a-mont.pl
index 08773bc7583..6b6393be07a 100755
--- a/deps/openssl/openssl/crypto/bn/asm/sparcv9a-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/sparcv9a-mont.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # October 2005
@@ -129,7 +129,7 @@ $code=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 .section	".text",#alloc,#execinstr

@@ -870,7 +870,7 @@ $fname:
 	restore
 .type   $fname,#function
 .size	$fname,(.-$fname)
-.asciz	"Montgomery Multiplication for UltraSPARC, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Montgomery Multiplication for UltraSPARC, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	32
 ___

diff --git a/deps/openssl/openssl/crypto/bn/asm/via-mont.pl b/deps/openssl/openssl/crypto/bn/asm/via-mont.pl
index 365dc652fe5..7ebd99daec3 100644
--- a/deps/openssl/openssl/crypto/bn/asm/via-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/via-mont.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Wrapper around 'rep montmul', VIA-specific instruction accessing
@@ -243,7 +243,7 @@ $sp=&DWP(28,"esp");
 &set_label("leave");
 &function_end($func);

-&asciz("Padlock Montgomery Multiplication, CRYPTOGAMS by <appro\@openssl.org>");
+&asciz("Padlock Montgomery Multiplication, CRYPTOGAMS by <https://github.com/dot-asm>");

 &asm_finish();

diff --git a/deps/openssl/openssl/crypto/bn/asm/vis3-mont.pl b/deps/openssl/openssl/crypto/bn/asm/vis3-mont.pl
index f7e6c38635a..5181ba4a4d2 100644
--- a/deps/openssl/openssl/crypto/bn/asm/vis3-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/vis3-mont.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2012-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2012-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # October 2012.
@@ -34,7 +34,7 @@ $code.=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #ifdef	__arch64__
 .register	%g2,#scratch
@@ -340,7 +340,7 @@ $code.=<<___;
 	restore
 .type	bn_mul_mont_vis3, #function
 .size	bn_mul_mont_vis3, .-bn_mul_mont_vis3
-.asciz  "Montgomery Multiplication for SPARCv9 VIS3, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz  "Montgomery Multiplication for SPARCv9 VIS3, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	4
 ___

diff --git a/deps/openssl/openssl/crypto/bn/asm/x86-gf2m.pl b/deps/openssl/openssl/crypto/bn/asm/x86-gf2m.pl
index 469effd39e5..79f4a1a08ea 100644
--- a/deps/openssl/openssl/crypto/bn/asm/x86-gf2m.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/x86-gf2m.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2011-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # May 2011
@@ -317,7 +317,7 @@ if ($sse2) {
 	&ret	();
 &function_end_B("bn_GF2m_mul_2x2");

-&asciz	("GF(2^m) Multiplication for x86, CRYPTOGAMS by <appro\@openssl.org>");
+&asciz	("GF(2^m) Multiplication for x86, CRYPTOGAMS by <https://github.com/dot-asm>");

 &asm_finish();

diff --git a/deps/openssl/openssl/crypto/bn/asm/x86-mont.pl b/deps/openssl/openssl/crypto/bn/asm/x86-mont.pl
index 8fff9e1d368..7c8f78bfc8f 100755
--- a/deps/openssl/openssl/crypto/bn/asm/x86-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/x86-mont.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2005-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2005-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # October 2005
@@ -623,7 +623,7 @@ $sbit=$num;
 &set_label("just_leave");
 &function_end("bn_mul_mont");

-&asciz("Montgomery Multiplication for x86, CRYPTOGAMS by <appro\@openssl.org>");
+&asciz("Montgomery Multiplication for x86, CRYPTOGAMS by <https://github.com/dot-asm>");

 &asm_finish();

diff --git a/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c b/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c
index 1e123ede773..c9081d35d84 100644
--- a/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c
+++ b/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -8,7 +8,7 @@
  */

 #include "../bn_local.h"
-#if !(defined(__GNUC__) && __GNUC__ >= 2)
+#if !defined(__GNUC__)
 /* clang-format off */
 # include "../bn_asm.c"         /* kind of dirty hack for Sun Studio */
 /* clang-format on */
@@ -16,7 +16,7 @@
 /*-
  * x86_64 BIGNUM accelerator version 0.1, December 2002.
  *
- * Implemented by Andy Polyakov <appro@openssl.org> for the OpenSSL
+ * Implemented by Andy Polyakov <https://github.com/dot-asm> for the OpenSSL
  * project.
  *
  * Rights for redistribution and usage in source and binary forms are
diff --git a/deps/openssl/openssl/crypto/bn/asm/x86_64-gf2m.pl b/deps/openssl/openssl/crypto/bn/asm/x86_64-gf2m.pl
index 4c4dfc41ffe..17d680f016a 100644
--- a/deps/openssl/openssl/crypto/bn/asm/x86_64-gf2m.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/x86_64-gf2m.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2011-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # May 2011
@@ -305,7 +305,7 @@ $code.=<<___;
 .Lend_mul_2x2:
 .cfi_endproc
 .size	bn_GF2m_mul_2x2,.-bn_GF2m_mul_2x2
-.asciz	"GF(2^m) Multiplication for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"GF(2^m) Multiplication for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	16
 ___

diff --git a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl
index 9c7b3091f43..c40fa0c69c9 100755
--- a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # October 2005.
@@ -1407,7 +1407,7 @@ $code.=<<___;
 ___
 }}}
 $code.=<<___;
-.asciz	"Montgomery Multiplication for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Montgomery Multiplication for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	16
 ___

diff --git a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl
index 52f95a48531..6bc91b550cd 100755
--- a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl
+++ b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # August 2011.
@@ -3591,7 +3591,7 @@ $code.=<<___;
 .Linc:
 	.long	0,0, 1,1
 	.long	2,2, 2,2
-.asciz	"Montgomery Multiplication with scatter/gather for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Montgomery Multiplication with scatter/gather for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .previous
 ___

diff --git a/deps/openssl/openssl/crypto/bn/bn_add.c b/deps/openssl/openssl/crypto/bn/bn_add.c
index 9c028269840..501e88c0735 100644
--- a/deps/openssl/openssl/crypto/bn/bn_add.c
+++ b/deps/openssl/openssl/crypto/bn/bn_add.c
@@ -116,7 +116,7 @@ int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
         carry &= (t2 == 0);
     }
     *rp = carry;
-    r->top += carry;
+    r->top += (int)carry;

 end:
     r->neg = 0;
diff --git a/deps/openssl/openssl/crypto/bn/bn_asm.c b/deps/openssl/openssl/crypto/bn/bn_asm.c
index 0a77f1b070e..e667702143d 100644
--- a/deps/openssl/openssl/crypto/bn/bn_asm.c
+++ b/deps/openssl/openssl/crypto/bn/bn_asm.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -429,7 +429,7 @@ BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b,
     return c;
 }

-#if defined(BN_MUL_COMBA) && !defined(OPENSSL_SMALL_FOOTPRINT)
+#ifndef OPENSSL_SMALL_FOOTPRINT

 /* mul_add_c(a,b,c0,c1,c2)  -- c+=a*b for three word number c=(c2,c1,c0) */
 /* mul_add_c2(a,b,c0,c1,c2) -- c+=2*a*b for three word number c=(c2,c1,c0) */
@@ -991,7 +991,7 @@ int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
 #endif /* OPENSSL_BN_ASM_MONT */
 #endif

-#else /* !BN_MUL_COMBA */
+#else /* OPENSSL_SMALL_FOOTPRINT */

 /* hmm... is it faster just to do a multiply? */
 void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a)
@@ -1078,4 +1078,4 @@ int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
 #endif /* OPENSSL_BN_ASM_MONT */
 #endif

-#endif /* !BN_MUL_COMBA */
+#endif /* !OPENSSL_SMALL_FOOTPRINT */
diff --git a/deps/openssl/openssl/crypto/bn/bn_blind.c b/deps/openssl/openssl/crypto/bn/bn_blind.c
index 73592ee96bb..7722ed1e481 100644
--- a/deps/openssl/openssl/crypto/bn/bn_blind.c
+++ b/deps/openssl/openssl/crypto/bn/bn_blind.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1998-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -185,7 +185,7 @@ int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b,
             }
             mask = (BN_ULONG)0 - ((rtop - ntop) >> (8 * sizeof(ntop) - 1));
             /* always true, if (rtop >= ntop) n->top = r->top; */
-            n->top = (int)(rtop & ~mask) | (ntop & mask);
+            n->top = (int)((rtop & ~mask) | (ntop & mask));
             n->flags |= (BN_FLG_FIXED_TOP & ~mask);
         }
         ret = bn_mul_mont_fixed_top(n, n, r, b->m_ctx, ctx);
diff --git a/deps/openssl/openssl/crypto/bn/bn_conv.c b/deps/openssl/openssl/crypto/bn/bn_conv.c
index 6b095238b77..47e7dcd8b14 100644
--- a/deps/openssl/openssl/crypto/bn/bn_conv.c
+++ b/deps/openssl/openssl/crypto/bn/bn_conv.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,8 @@
  * https://www.openssl.org/source/license.html
  */

+#include <stdio.h>
+
 #include <openssl/err.h>
 #include "crypto/ctype.h"
 #include "bn_local.h"
@@ -63,7 +65,7 @@ char *BN_bn2dec(const BIGNUM *a)
     num = (i / 10 + i / 1000 + 1) + 1;
     tbytes = num + 3; /* negative and terminator and one spare? */
     bn_data_num = num / BN_DEC_NUM + 1;
-    bn_data = OPENSSL_malloc(bn_data_num * sizeof(BN_ULONG));
+    bn_data = OPENSSL_malloc_array(bn_data_num, sizeof(BN_ULONG));
     buf = OPENSSL_malloc(tbytes);
     if (buf == NULL || bn_data == NULL)
         goto err;
@@ -93,14 +95,14 @@ char *BN_bn2dec(const BIGNUM *a)
          * the last one needs truncation. The blocks need to be reversed in
          * order.
          */
-        n = BIO_snprintf(p, tbytes - (size_t)(p - buf), BN_DEC_FMT1, *lp);
-        if (n < 0)
+        n = snprintf(p, tbytes - (size_t)(p - buf), BN_DEC_FMT1, *lp);
+        if (n < 0 || (size_t)n >= tbytes - (size_t)(p - buf))
             goto err;
         p += n;
         while (lp != bn_data) {
             lp--;
-            n = BIO_snprintf(p, tbytes - (size_t)(p - buf), BN_DEC_FMT2, *lp);
-            if (n < 0)
+            n = snprintf(p, tbytes - (size_t)(p - buf), BN_DEC_FMT2, *lp);
+            if (n < 0 || (size_t)n >= tbytes - (size_t)(p - buf))
                 goto err;
             p += n;
         }
diff --git a/deps/openssl/openssl/crypto/bn/bn_ctx.c b/deps/openssl/openssl/crypto/bn/bn_ctx.c
index 90ac7cee60d..201b3565617 100644
--- a/deps/openssl/openssl/crypto/bn/bn_ctx.c
+++ b/deps/openssl/openssl/crypto/bn/bn_ctx.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -270,7 +270,7 @@ static int BN_STACK_push(BN_STACK *st, unsigned int idx)
         unsigned int newsize = st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES;
         unsigned int *newitems;

-        if ((newitems = OPENSSL_malloc(sizeof(*newitems) * newsize)) == NULL)
+        if ((newitems = OPENSSL_malloc_array(newsize, sizeof(*newitems))) == NULL)
             return 0;
         if (st->depth)
             memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth);
diff --git a/deps/openssl/openssl/crypto/bn/bn_dh.c b/deps/openssl/openssl/crypto/bn/bn_dh.c
index d069481e981..1630be9191d 100644
--- a/deps/openssl/openssl/crypto/bn/bn_dh.c
+++ b/deps/openssl/openssl/crypto/bn/bn_dh.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014-2026 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2014-2021 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/crypto/bn/bn_div.c b/deps/openssl/openssl/crypto/bn/bn_div.c
index fc61d70a9da..bcc483ac61e 100644
--- a/deps/openssl/openssl/crypto/bn/bn_div.c
+++ b/deps/openssl/openssl/crypto/bn/bn_div.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -160,7 +160,7 @@ static int bn_left_align(BIGNUM *num)

 #if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) \
     && !defined(PEDANTIC) && !defined(BN_DIV3W)
-#if defined(__GNUC__) && __GNUC__ >= 2
+#if defined(__GNUC__)
 #if defined(__i386) || defined(__i386__)
 /*-
  * There were two reasons for implementing this template:
@@ -288,7 +288,7 @@ int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
         goto err;

     /* First we normalise the numbers */
-    if (!BN_copy(sdiv, divisor))
+    if (BN_copy(sdiv, divisor) == NULL)
         goto err;
     norm_shift = bn_left_align(sdiv);
     sdiv->neg = 0;
diff --git a/deps/openssl/openssl/crypto/bn/bn_err.c b/deps/openssl/openssl/crypto/bn/bn_err.c
deleted file mode 100644
index 84aaf75b529..00000000000
--- a/deps/openssl/openssl/crypto/bn/bn_err.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/bnerr.h>
-#include "crypto/bnerr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA BN_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_ARG2_LT_ARG3), "arg2 lt arg3" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_BAD_RECIPROCAL), "bad reciprocal" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_BIGNUM_TOO_LONG), "bignum too long" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_BITS_TOO_SMALL), "bits too small" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_CALLED_WITH_EVEN_MODULUS),
-        "called with even modulus" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_DIV_BY_ZERO), "div by zero" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_ENCODING_ERROR), "encoding error" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA),
-        "expand on static bignum data" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_INPUT_NOT_REDUCED), "input not reduced" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_INVALID_LENGTH), "invalid length" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_INVALID_RANGE), "invalid range" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_INVALID_SHIFT), "invalid shift" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_NOT_A_SQUARE), "not a square" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_NOT_INITIALIZED), "not initialized" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_NO_INVERSE), "no inverse" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_NO_PRIME_CANDIDATE), "no prime candidate" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_NO_SOLUTION), "no solution" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_NO_SUITABLE_DIGEST), "no suitable digest" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_PRIVATE_KEY_TOO_LARGE),
-        "private key too large" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_P_IS_NOT_PRIME), "p is not prime" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_TOO_MANY_ITERATIONS), "too many iterations" },
-    { ERR_PACK(ERR_LIB_BN, 0, BN_R_TOO_MANY_TEMPORARY_VARIABLES),
-        "too many temporary variables" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_BN_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(BN_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(BN_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/bn/bn_exp.c b/deps/openssl/openssl/crypto/bn/bn_exp.c
index ddcd89e2d4b..535d2d1f523 100644
--- a/deps/openssl/openssl/crypto/bn/bn_exp.c
+++ b/deps/openssl/openssl/crypto/bn/bn_exp.c
@@ -29,7 +29,7 @@

 #undef SPARC_T4_MONT
 #if defined(OPENSSL_BN_ASM_MONT) && (defined(__sparc__) || defined(__sparc))
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"
 #define SPARC_T4_MONT
 #endif

@@ -206,7 +206,7 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,

     if (m->neg) {
         /* ignore sign of 'm' */
-        if (!BN_copy(aa, m))
+        if (BN_copy(aa, m) == NULL)
             goto err;
         aa->neg = 0;
         if (BN_RECP_CTX_set(&recp, aa, ctx) <= 0)
@@ -755,6 +755,7 @@ int bn_mod_exp_mont_fixed_top(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
         for (i = 1; i < top; i++)
             tmp.d[i] = (~m->d[i]) & BN_MASK2;
         tmp.top = top;
+        tmp.flags |= BN_FLG_FIXED_TOP;
     } else
 #endif
         if (!bn_to_mont_fixed_top(&tmp, BN_value_one(), mont, ctx))
diff --git a/deps/openssl/openssl/crypto/bn/bn_gcd.c b/deps/openssl/openssl/crypto/bn/bn_gcd.c
index b93ded08db5..5d7c076d9b5 100644
--- a/deps/openssl/openssl/crypto/bn/bn_gcd.c
+++ b/deps/openssl/openssl/crypto/bn/bn_gcd.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -167,7 +167,7 @@ static ossl_inline BIGNUM *bn_mod_inverse_no_branch(BIGNUM *in,
     if (BN_is_one(A)) {
         /* Y*a == 1  (mod |n|) */
         if (!Y->neg && BN_ucmp(Y, n) < 0) {
-            if (!BN_copy(R, Y))
+            if (BN_copy(R, Y) == NULL)
                 goto err;
         } else {
             if (!BN_nnmod(R, Y, n, ctx))
@@ -456,7 +456,7 @@ BIGNUM *int_bn_mod_inverse(BIGNUM *in,
                     if (!BN_lshift(tmp, X, 2))
                         goto err;
                 } else if (D->top == 1) {
-                    if (!BN_copy(tmp, X))
+                    if (BN_copy(tmp, X) == NULL)
                         goto err;
                     if (!BN_mul_word(tmp, D->d[0]))
                         goto err;
@@ -492,7 +492,7 @@ BIGNUM *int_bn_mod_inverse(BIGNUM *in,
     if (BN_is_one(A)) {
         /* Y*a == 1  (mod |n|) */
         if (!Y->neg && BN_ucmp(Y, n) < 0) {
-            if (!BN_copy(R, Y))
+            if (BN_copy(R, Y) == NULL)
                 goto err;
         } else {
             if (!BN_nnmod(R, Y, n, ctx))
@@ -618,7 +618,7 @@ int BN_gcd(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx)
         pow2_numbits_temp = r->d[i] | g->d[i];
         pow2_condition_mask = constant_time_is_zero_bn(pow2_flag);
         pow2_flag &= constant_time_is_zero_bn(pow2_numbits_temp);
-        pow2_shifts += pow2_flag;
+        pow2_shifts += (int)pow2_flag;
         pow2_numbits = constant_time_select_bn(pow2_condition_mask,
             pow2_numbits, pow2_numbits_temp);
     }
@@ -627,7 +627,7 @@ int BN_gcd(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx)
     pow2_flag = 1;
     for (j = 0; j < BN_BITS2; j++) {
         pow2_flag &= pow2_numbits;
-        pow2_shifts += pow2_flag;
+        pow2_shifts += (int)pow2_flag;
         pow2_numbits >>= 1;
     }

@@ -653,7 +653,8 @@ int BN_gcd(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx)

     for (i = 0; i < m; i++) {
         /* conditionally flip signs if delta is positive and g is odd */
-        cond = ((unsigned int)-delta >> (8 * sizeof(delta) - 1)) & g->d[0] & 1
+        cond = ((unsigned int)-delta >> (8 * sizeof(delta) - 1))
+            & (unsigned int)g->d[0] & 1
             /* make sure g->top > 0 (i.e. if top == 0 then g == 0 always) */
             & (~((unsigned int)(g->top - 1) >> (sizeof(g->top) * 8 - 1)));
         delta = (-cond & -delta) | ((cond - 1) & delta);
@@ -665,7 +666,7 @@ int BN_gcd(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx)
         delta++;
         if (!BN_add(temp, g, r))
             goto err;
-        BN_consttime_swap(g->d[0] & 1 /* g is odd */
+        BN_consttime_swap((unsigned int)g->d[0] & 1 /* g is odd */
                 /* make sure g->top > 0 (i.e. if top == 0 then g == 0 always) */
                 & (~((unsigned int)(g->top - 1) >> (sizeof(g->top) * 8 - 1))),
             g, temp, top);
diff --git a/deps/openssl/openssl/crypto/bn/bn_gf2m.c b/deps/openssl/openssl/crypto/bn/bn_gf2m.c
index 0fbce8edb6d..0ecfac021b7 100644
--- a/deps/openssl/openssl/crypto/bn/bn_gf2m.c
+++ b/deps/openssl/openssl/crypto/bn/bn_gf2m.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -335,7 +335,7 @@ int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[])
         d0 = p[0] % BN_BITS2;
         d1 = BN_BITS2 - d0;
         z[j - n] ^= (zz >> d0);
-        if (d0)
+        if (ossl_likely(d0))
             z[j - n - 1] ^= (zz << d1);
     }

@@ -349,7 +349,7 @@ int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[])
         d1 = BN_BITS2 - d0;

         /* clear up the top d1 bits */
-        if (d0)
+        if (ossl_likely(d0))
             z[dN] = (z[dN] << d1) >> d1;
         else
             z[dN] = 0;
@@ -464,7 +464,7 @@ int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
     bn_check_top(b);
     bn_check_top(p);

-    arr = OPENSSL_malloc(sizeof(*arr) * max);
+    arr = OPENSSL_malloc_array(max, sizeof(*arr));
     if (arr == NULL)
         return 0;
     ret = BN_GF2m_poly2arr(p, arr, max);
@@ -524,7 +524,7 @@ int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
     bn_check_top(a);
     bn_check_top(p);

-    arr = OPENSSL_malloc(sizeof(*arr) * max);
+    arr = OPENSSL_malloc_array(max, sizeof(*arr));
     if (arr == NULL)
         return 0;
     ret = BN_GF2m_poly2arr(p, arr, max);
@@ -568,7 +568,7 @@ static int BN_GF2m_mod_inv_vartime(BIGNUM *r, const BIGNUM *a,
     if (BN_is_zero(u))
         goto err;

-    if (!BN_copy(v, p))
+    if (BN_copy(v, p) == NULL)
         goto err;
 #if 0
     if (!BN_one(b))
@@ -696,7 +696,7 @@ static int BN_GF2m_mod_inv_vartime(BIGNUM *r, const BIGNUM *a,
     }
 #endif

-    if (!BN_copy(r, b))
+    if (BN_copy(r, b) == NULL)
         goto err;
     bn_check_top(r);
     ret = 1;
@@ -881,7 +881,7 @@ int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
                 goto err;
         }
     }
-    if (!BN_copy(r, u))
+    if (BN_copy(r, u) == NULL)
         goto err;
     bn_check_top(r);
     ret = 1;
@@ -907,7 +907,7 @@ int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
     bn_check_top(b);
     bn_check_top(p);

-    arr = OPENSSL_malloc(sizeof(*arr) * max);
+    arr = OPENSSL_malloc_array(max, sizeof(*arr));
     if (arr == NULL)
         return 0;
     ret = BN_GF2m_poly2arr(p, arr, max);
@@ -969,7 +969,7 @@ int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
     bn_check_top(a);
     bn_check_top(p);

-    arr = OPENSSL_malloc(sizeof(*arr) * max);
+    arr = OPENSSL_malloc_array(max, sizeof(*arr));
     if (arr == NULL)
         return 0;
     ret = BN_GF2m_poly2arr(p, arr, max);
@@ -1020,7 +1020,7 @@ int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a_, const int p[],

     if (p[0] & 0x1) { /* m is odd */
         /* compute half-trace of a */
-        if (!BN_copy(z, a))
+        if (BN_copy(z, a) == NULL)
             goto err;
         for (j = 1; j <= (p[0] - 1) / 2; j++) {
             if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx))
@@ -1045,7 +1045,7 @@ int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a_, const int p[],
             if (!BN_GF2m_mod_arr(rho, rho, p))
                 goto err;
             BN_zero(z);
-            if (!BN_copy(w, rho))
+            if (BN_copy(w, rho) == NULL)
                 goto err;
             for (j = 1; j <= p[0] - 1; j++) {
                 if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx))
@@ -1076,7 +1076,7 @@ int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a_, const int p[],
         goto err;
     }

-    if (!BN_copy(r, z))
+    if (BN_copy(r, z) == NULL)
         goto err;
     bn_check_top(r);

@@ -1103,7 +1103,7 @@ int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
     bn_check_top(a);
     bn_check_top(p);

-    arr = OPENSSL_malloc(sizeof(*arr) * max);
+    arr = OPENSSL_malloc_array(max, sizeof(*arr));
     if (arr == NULL)
         goto err;
     ret = BN_GF2m_poly2arr(p, arr, max);
diff --git a/deps/openssl/openssl/crypto/bn/bn_intern.c b/deps/openssl/openssl/crypto/bn/bn_intern.c
index 547738761cf..17216c61bb8 100644
--- a/deps/openssl/openssl/crypto/bn/bn_intern.c
+++ b/deps/openssl/openssl/crypto/bn/bn_intern.c
@@ -115,7 +115,7 @@ signed char *bn_compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len)
         r[j++] = sign * digit;

         window_val >>= 1;
-        window_val += bit * BN_is_bit_set(scalar, j + w);
+        window_val += bit * BN_is_bit_set(scalar, (int)(j + w));

         if (window_val > next_bit) {
             ERR_raise(ERR_LIB_BN, ERR_R_INTERNAL_ERROR);
diff --git a/deps/openssl/openssl/crypto/bn/bn_kron.c b/deps/openssl/openssl/crypto/bn/bn_kron.c
index b24bdd1c07c..177d674f988 100644
--- a/deps/openssl/openssl/crypto/bn/bn_kron.c
+++ b/deps/openssl/openssl/crypto/bn/bn_kron.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -38,10 +38,10 @@ int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
     if (B == NULL)
         goto end;

-    err = !BN_copy(A, a);
+    err = (BN_copy(A, a) == NULL);
     if (err)
         goto end;
-    err = !BN_copy(B, b);
+    err = (BN_copy(B, b) == NULL);
     if (err)
         goto end;

diff --git a/deps/openssl/openssl/crypto/bn/bn_lib.c b/deps/openssl/openssl/crypto/bn/bn_lib.c
index 7961906f9ae..494561b0fab 100644
--- a/deps/openssl/openssl/crypto/bn/bn_lib.c
+++ b/deps/openssl/openssl/crypto/bn/bn_lib.c
@@ -28,13 +28,9 @@
  * 8 - 256 == 8192
  */
 static int bn_limit_bits = 0;
-static int bn_limit_num = 8; /* (1<<bn_limit_bits) */
 static int bn_limit_bits_low = 0;
-static int bn_limit_num_low = 8; /* (1<<bn_limit_bits_low) */
 static int bn_limit_bits_high = 0;
-static int bn_limit_num_high = 8; /* (1<<bn_limit_bits_high) */
 static int bn_limit_bits_mont = 0;
-static int bn_limit_num_mont = 8; /* (1<<bn_limit_bits_mont) */

 void BN_set_params(int mult, int high, int low, int mont)
 {
@@ -42,25 +38,21 @@ void BN_set_params(int mult, int high, int low, int mont)
         if (mult > (int)(sizeof(int) * 8) - 1)
             mult = sizeof(int) * 8 - 1;
         bn_limit_bits = mult;
-        bn_limit_num = 1 << mult;
     }
     if (high >= 0) {
         if (high > (int)(sizeof(int) * 8) - 1)
             high = sizeof(int) * 8 - 1;
         bn_limit_bits_high = high;
-        bn_limit_num_high = 1 << high;
     }
     if (low >= 0) {
         if (low > (int)(sizeof(int) * 8) - 1)
             low = sizeof(int) * 8 - 1;
         bn_limit_bits_low = low;
-        bn_limit_num_low = 1 << low;
     }
     if (mont >= 0) {
         if (mont > (int)(sizeof(int) * 8) - 1)
             mont = sizeof(int) * 8 - 1;
         bn_limit_bits_mont = mont;
-        bn_limit_num_mont = 1 << mont;
     }
 }

@@ -89,15 +81,7 @@ const BIGNUM *BN_value_one(void)
     return &const_one;
 }

-/*
- * Old Visual Studio ARM compiler miscompiles BN_num_bits_word()
- * https://mta.openssl.org/pipermail/openssl-users/2018-August/008465.html
- */
-#if defined(_MSC_VER) && defined(_ARM_) && defined(_WIN32_WCE) \
-    && _MSC_VER >= 1400 && _MSC_VER < 1501
-#define MS_BROKEN_BN_num_bits_word
-#pragma optimize("", off)
-#endif
+#ifndef __e2k__
 int BN_num_bits_word(BN_ULONG l)
 {
     BN_ULONG x, mask;
@@ -142,9 +126,20 @@ int BN_num_bits_word(BN_ULONG l)

     return bits;
 }
-#ifdef MS_BROKEN_BN_num_bits_word
-#pragma optimize("", on)
+#else /* __e2k__ */
+#include <x86gprintrin.h>
+int BN_num_bits_word(BN_ULONG l)
+{
+    /* clz(0) is well-defined on e2k, hence no if (l == 0) return 0;
+     * is required here.
+     */
+#if BN_BITS2 > 32
+    return 64 - __builtin_clzll(l);
+#else
+    return 32 - __builtin_clz(l);
 #endif
+}
+#endif /* __e2k__ */

 /*
  * This function still leaks `a->dmax`: it's caller's responsibility to
@@ -193,7 +188,7 @@ int BN_num_bits(const BIGNUM *a)
         return bn_num_bits_consttime(a);
     }

-    if (BN_is_zero(a))
+    if (ossl_unlikely(BN_is_zero(a)))
         return 0;

     return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
@@ -265,19 +260,19 @@ static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
 {
     BN_ULONG *a = NULL;

-    if (words > (INT_MAX / (4 * BN_BITS2))) {
+    if (ossl_unlikely(words > (INT_MAX / (4 * BN_BITS2)))) {
         ERR_raise(ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG);
         return NULL;
     }
-    if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
+    if (ossl_unlikely(BN_get_flags(b, BN_FLG_STATIC_DATA))) {
         ERR_raise(ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
         return NULL;
     }
     if (BN_get_flags(b, BN_FLG_SECURE))
-        a = OPENSSL_secure_zalloc(words * sizeof(*a));
+        a = OPENSSL_secure_calloc(words, sizeof(*a));
     else
-        a = OPENSSL_zalloc(words * sizeof(*a));
-    if (a == NULL)
+        a = OPENSSL_calloc(words, sizeof(*a));
+    if (ossl_unlikely(a == NULL))
         return NULL;

     assert(b->top <= words);
@@ -297,9 +292,10 @@ static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)

 BIGNUM *bn_expand2(BIGNUM *b, int words)
 {
-    if (words > b->dmax) {
+    if (ossl_likely(words > b->dmax)) {
         BN_ULONG *a = bn_expand_internal(b, words);
-        if (!a)
+
+        if (ossl_unlikely(!a))
             return NULL;
         if (b->d != NULL)
             bn_free_d(b, 1);
@@ -321,7 +317,7 @@ BIGNUM *BN_dup(const BIGNUM *a)
     t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new();
     if (t == NULL)
         return NULL;
-    if (!BN_copy(t, a)) {
+    if (BN_copy(t, a) == NULL) {
         BN_free(t);
         return NULL;
     }
@@ -337,12 +333,12 @@ BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)

     bn_words = BN_get_flags(b, BN_FLG_CONSTTIME) ? b->dmax : b->top;

-    if (a == b)
+    if (ossl_unlikely(a == b))
         return a;
-    if (bn_wexpand(a, bn_words) == NULL)
+    if (ossl_unlikely(bn_wexpand(a, bn_words) == NULL))
         return NULL;

-    if (b->top > 0)
+    if (ossl_likely(b->top > 0))
         memcpy(a->d, b->d, sizeof(b->d[0]) * bn_words);

     a->neg = b->neg;
@@ -724,9 +720,9 @@ int BN_ucmp(const BIGNUM *a, const BIGNUM *b)
         int min_top = a->top < b->top ? a->top : b->top;

         for (i = 0; i < min_top; i++) {
-            res = constant_time_select_int(constant_time_lt_bn(ap[i], bp[i]),
+            res = constant_time_select_int((int)constant_time_lt_bn(ap[i], bp[i]),
                 -1, res);
-            res = constant_time_select_int(constant_time_lt_bn(bp[i], ap[i]),
+            res = constant_time_select_int((int)constant_time_lt_bn(bp[i], ap[i]),
                 1, res);
         }

@@ -850,11 +846,11 @@ int BN_is_bit_set(const BIGNUM *a, int n)
     int i, j;

     bn_check_top(a);
-    if (n < 0)
+    if (ossl_unlikely(n < 0))
         return 0;
     i = n / BN_BITS2;
     j = n % BN_BITS2;
-    if (a->top <= i)
+    if (ossl_unlikely(a->top <= i))
         return 0;
     return (int)(((a->d[i]) >> j) & ((BN_ULONG)1));
 }
@@ -904,12 +900,12 @@ int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
     int i;
     BN_ULONG aa, bb;

-    if (n == 0)
+    if (ossl_unlikely(n == 0))
         return 0;

     aa = a[n - 1];
     bb = b[n - 1];
-    if (aa != bb)
+    if (ossl_likely(aa != bb))
         return ((aa > bb) ? 1 : -1);
     for (i = n - 2; i >= 0; i--) {
         aa = a[i];
@@ -975,12 +971,15 @@ void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
     b->neg ^= t;

     /*-
-     * BN_FLG_STATIC_DATA: indicates that data may not be written to. Intention
-     * is actually to treat it as it's read-only data, and some (if not most)
-     * of it does reside in read-only segment. In other words observation of
-     * BN_FLG_STATIC_DATA in BN_consttime_swap should be treated as fatal
-     * condition. It would either cause SEGV or effectively cause data
-     * corruption.
+     * BN_FLG_STATIC_DATA: indicates that d points to a buffer that this
+     * BIGNUM does not own, so it must never be reallocated or freed through
+     * the BIGNUM. The flag by itself does not forbid writing to the words,
+     * but much of the data marked this way is compiled-in and does reside in
+     * a read-only segment. Since BN_consttime_swap writes to d, observing
+     * BN_FLG_STATIC_DATA here should be treated as a fatal condition: it
+     * would either cause SEGV or effectively cause data corruption. The flag
+     * is therefore never swapped, as it describes the storage of each d
+     * buffer, which is not exchanged.
      *
      * BN_FLG_MALLOCED: refers to BN structure itself, and hence must be
      * preserved.
@@ -1072,10 +1071,10 @@ int ossl_bn_is_word_fixed_top(const BIGNUM *a, const BN_ULONG w)
     if (a->neg || a->top == 0)
         return 0;

-    res = constant_time_select_int(constant_time_eq_bn(ap[0], w), 1, 0);
+    res = constant_time_select_int((int)constant_time_eq_bn(ap[0], w), 1, 0);

     for (i = 1; i < a->top; i++)
-        res = constant_time_select_int(constant_time_is_zero_bn(ap[i]),
+        res = constant_time_select_int((int)constant_time_is_zero_bn(ap[i]),
             res, 0);
     return res;
 }
@@ -1191,7 +1190,7 @@ void bn_correct_top(BIGNUM *a)
     BN_ULONG *ftl;
     int tmp_top = a->top;

-    if (tmp_top > 0) {
+    if (ossl_likely(tmp_top > 0)) {
         for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) {
             ftl--;
             if (*ftl != 0)
diff --git a/deps/openssl/openssl/crypto/bn/bn_local.h b/deps/openssl/openssl/crypto/bn/bn_local.h
index 9ebadfd76e7..506fcaa2b85 100644
--- a/deps/openssl/openssl/crypto/bn/bn_local.h
+++ b/deps/openssl/openssl/crypto/bn/bn_local.h
@@ -10,20 +10,10 @@
 #ifndef OSSL_CRYPTO_BN_LOCAL_H
 #define OSSL_CRYPTO_BN_LOCAL_H

-/*
- * The EDK2 build doesn't use bn_conf.h; it sets THIRTY_TWO_BIT or
- * SIXTY_FOUR_BIT in its own environment since it doesn't re-run our
- * Configure script and needs to support both 32-bit and 64-bit.
- */
 #include <openssl/opensslconf.h>
-
-#if !defined(OPENSSL_SYS_UEFI)
-#include "crypto/bn_conf.h"
-#endif
-
-#include "crypto/bn.h"
 #include "internal/cryptlib.h"
 #include "internal/numbers.h"
+#include "crypto/bn.h"

 /*
  * These preprocessor symbols control various aspects of the bignum headers
@@ -62,12 +52,6 @@
 #define BN_SOFT_LIMIT (4096 / BN_BYTES)
 #endif

-#ifndef OPENSSL_SMALL_FOOTPRINT
-#define BN_MUL_COMBA
-#define BN_SQR_COMBA
-#define BN_RECURSION
-#endif
-
 /*
  * This next option uses the C libraries (2 word)/(1 word) function. If it is
  * not defined, I use my C version (which is slower). The reason for this
@@ -88,7 +72,7 @@
  * 64-bit processor with LP64 ABI
  */
 #ifdef SIXTY_FOUR_BIT_LONG
-#define BN_ULLONG unsigned long long
+typedef unsigned long long BN_ULLONG;
 #define BN_BITS4 32
 #define BN_MASK2 (0xffffffffffffffffL)
 #define BN_MASK2l (0xffffffffL)
@@ -120,9 +104,9 @@
 #ifdef THIRTY_TWO_BIT
 #ifdef BN_LLONG
 #if defined(_WIN32) && !defined(__GNUC__)
-#define BN_ULLONG unsigned __int64
+typedef unsigned __int64 BN_ULLONG;
 #else
-#define BN_ULLONG unsigned long long
+typedef unsigned long long BN_ULLONG;
 #endif
 #endif
 #define BN_BITS4 16
@@ -166,6 +150,10 @@
  */

 #ifdef BN_DEBUG
+
+/* ossl_assert() isn't fit for BN_DEBUG purposes, use assert() instead */
+#include <assert.h>
+
 /*
  * The new BN_FLG_FIXED_TOP flag marks vectors that were not treated with
  * bn_correct_top, in other words such vectors are permitted to have zeros
@@ -195,14 +183,18 @@
 #else
 #define bn_pollute(a)
 #endif
-#define bn_check_top(a)                                                                                                                   \
-    do {                                                                                                                                  \
-        const BIGNUM *_bnum2 = (a);                                                                                                       \
-        if (_bnum2 != NULL) {                                                                                                             \
-            int _top = _bnum2->top;                                                                                                       \
-            (void)ossl_assert((_top == 0 && !_bnum2->neg) || (_top && ((_bnum2->flags & BN_FLG_FIXED_TOP) || _bnum2->d[_top - 1] != 0))); \
-            bn_pollute(_bnum2);                                                                                                           \
-        }                                                                                                                                 \
+#define bn_check_top(a)                                           \
+    do {                                                          \
+        const BIGNUM *_bnum2 = (a);                               \
+        if (_bnum2 != NULL) {                                     \
+            int _top = _bnum2->top;                               \
+            if (_top == 0) {                                      \
+                assert(!_bnum2->neg);                             \
+            } else if ((_bnum2->flags & BN_FLG_FIXED_TOP) == 0) { \
+                assert(_bnum2->d[_top - 1] != 0);                 \
+            }                                                     \
+            bn_pollute(_bnum2);                                   \
+        }                                                         \
     } while (0)

 #define bn_fix_top(a) bn_check_top(a)
@@ -252,7 +244,6 @@ struct bignum_st {

 /* Used for montgomery multiplication */
 struct bn_mont_ctx_st {
-    int ri; /* number of bits in R */
     BIGNUM RR; /* used to convert to montgomery form,
                   possibly zero-padded */
     BIGNUM N; /* The modulus */
@@ -261,6 +252,7 @@ struct bn_mont_ctx_st {
     BN_ULONG n0[2]; /* least significant word(s) of Ni; (type
                      * changed with 0.9.9, was "BN_ULONG n0;"
                      * before) */
+    int ri; /* number of bits in R */
     int flags;
 };

@@ -388,7 +380,7 @@ struct bn_gencb_st {
 #if defined(__DECC)
 #include <c_asm.h>
 #define BN_UMULT_HIGH(a, b) (BN_ULONG)asm("umulh %a0,%a1,%v0", (a), (b))
-#elif defined(__GNUC__) && __GNUC__ >= 2
+#elif defined(__GNUC__)
 #define BN_UMULT_HIGH(a, b) ({     \
         register BN_ULONG ret;          \
         asm ("umulh     %1,%2,%0"       \
@@ -397,7 +389,7 @@ struct bn_gencb_st {
         ret; })
 #endif /* compiler */
 #elif defined(_ARCH_PPC64) && defined(SIXTY_FOUR_BIT_LONG)
-#if defined(__GNUC__) && __GNUC__ >= 2
+#if defined(__GNUC__)
 #define BN_UMULT_HIGH(a, b) ({     \
         register BN_ULONG ret;          \
         asm ("mulhdu    %0,%1,%2"       \
@@ -406,7 +398,7 @@ struct bn_gencb_st {
         ret; })
 #endif /* compiler */
 #elif (defined(__x86_64) || defined(__x86_64__)) && (defined(SIXTY_FOUR_BIT_LONG) || defined(SIXTY_FOUR_BIT))
-#if defined(__GNUC__) && __GNUC__ >= 2
+#if defined(__GNUC__)
 #define BN_UMULT_HIGH(a, b) ({     \
         register BN_ULONG ret,discard;  \
         asm ("mulq      %3"             \
@@ -430,7 +422,7 @@ unsigned __int64 _umul128(unsigned __int64 a, unsigned __int64 b,
 #define BN_UMULT_LOHI(low, high, a, b) ((low) = _umul128((a), (b), &(high)))
 #endif
 #elif defined(__mips) && (defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG))
-#if defined(__GNUC__) && __GNUC__ >= 2
+#if defined(__GNUC__)
 #define BN_UMULT_HIGH(a, b) ({       \
         register BN_ULONG ret;          \
         asm ("dmultu    %1,%2"          \
@@ -443,7 +435,7 @@ unsigned __int64 _umul128(unsigned __int64 a, unsigned __int64 b,
         : "r"(a), "r"(b));
 #endif
 #elif defined(__aarch64__) && defined(SIXTY_FOUR_BIT_LONG)
-#if defined(__GNUC__) && __GNUC__ >= 2
+#if defined(__GNUC__)
 #define BN_UMULT_HIGH(a, b) ({     \
         register BN_ULONG ret;          \
         asm ("umulh     %0,%1,%2"       \
@@ -451,6 +443,8 @@ unsigned __int64 _umul128(unsigned __int64 a, unsigned __int64 b,
              : "r"(a), "r"(b));         \
         ret; })
 #endif
+#elif defined(__e2k__) && __iset__ >= 5
+#define BN_UMULT_HIGH(a, b) __builtin_e2k_umulhd(a, b)
 #endif /* cpu */
 #endif /* OPENSSL_NO_ASM */

diff --git a/deps/openssl/openssl/crypto/bn/bn_mod.c b/deps/openssl/openssl/crypto/bn/bn_mod.c
index 5cee896cd9d..236543ce8d9 100644
--- a/deps/openssl/openssl/crypto/bn/bn_mod.c
+++ b/deps/openssl/openssl/crypto/bn/bn_mod.c
@@ -59,11 +59,11 @@ int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
     BN_ULONG carry, temp, mask, *rp, *tp = storage;
     const BN_ULONG *ap, *bp;

-    if (bn_wexpand(r, mtop) == NULL)
+    if (bn_wexpand(r, (int)mtop) == NULL)
         return 0;

     if (mtop > OSSL_NELEM(storage)) {
-        tp = OPENSSL_malloc(mtop * sizeof(BN_ULONG));
+        tp = OPENSSL_malloc_array(mtop, sizeof(BN_ULONG));
         if (tp == NULL)
             return 0;
     }
@@ -85,12 +85,12 @@ int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
         bi += (i - b->dmax) >> (8 * sizeof(i) - 1);
     }
     rp = r->d;
-    carry -= bn_sub_words(rp, tp, m->d, mtop);
+    carry -= bn_sub_words(rp, tp, m->d, (int)mtop);
     for (i = 0; i < mtop; i++) {
         rp[i] = (carry & tp[i]) | (~carry & rp[i]);
         ((volatile BN_ULONG *)tp)[i] = 0;
     }
-    r->top = mtop;
+    r->top = (int)mtop;
     r->flags |= BN_FLG_FIXED_TOP;
     r->neg = 0;

@@ -140,7 +140,7 @@ int bn_mod_sub_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
     BN_ULONG borrow, carry, ta, tb, mask, *rp;
     const BN_ULONG *ap, *bp;

-    if (bn_wexpand(r, mtop) == NULL)
+    if (bn_wexpand(r, (int)mtop) == NULL)
         return 0;

     rp = r->d;
@@ -176,7 +176,7 @@ int bn_mod_sub_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
         carry += (rp[i] < ta);
     }

-    r->top = mtop;
+    r->top = (int)mtop;
     r->flags |= BN_FLG_FIXED_TOP;
     r->neg = 0;

diff --git a/deps/openssl/openssl/crypto/bn/bn_mont.c b/deps/openssl/openssl/crypto/bn/bn_mont.c
index 72e935c52fb..e2f30931fc7 100644
--- a/deps/openssl/openssl/crypto/bn/bn_mont.c
+++ b/deps/openssl/openssl/crypto/bn/bn_mont.c
@@ -191,7 +191,7 @@ int bn_from_mont_fixed_top(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont,
     if (t2 == NULL)
         goto err;

-    if (!BN_copy(t1, a))
+    if (BN_copy(t1, a) == NULL)
         goto err;
     BN_mask_bits(t1, mont->ri);

@@ -269,7 +269,7 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
     if ((Ri = BN_CTX_get(ctx)) == NULL)
         goto err;
     R = &(mont->RR); /* grab RR as a temp */
-    if (!BN_copy(&(mont->N), mod))
+    if (BN_copy(&(mont->N), mod) == NULL)
         goto err; /* Set N */
     if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
         BN_set_flags(&(mont->N), BN_FLG_CONSTTIME);
@@ -410,11 +410,11 @@ BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from)
     if (to == from)
         return to;

-    if (!BN_copy(&(to->RR), &(from->RR)))
+    if (BN_copy(&(to->RR), &(from->RR)) == NULL)
         return NULL;
-    if (!BN_copy(&(to->N), &(from->N)))
+    if (BN_copy(&(to->N), &(from->N)) == NULL)
         return NULL;
-    if (!BN_copy(&(to->Ni), &(from->Ni)))
+    if (BN_copy(&(to->Ni), &(from->Ni)) == NULL)
         return NULL;
     to->ri = from->ri;
     to->n0[0] = from->n0[0];
@@ -466,7 +466,7 @@ BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_RWLOCK *lock,
 }

 int ossl_bn_mont_ctx_set(BN_MONT_CTX *ctx, const BIGNUM *modulus, int ri, const unsigned char *rr,
-    size_t rrlen, uint32_t nlo, uint32_t nhi)
+    int rrlen, uint32_t nlo, uint32_t nhi)
 {
     if (BN_copy(&ctx->N, modulus) == NULL)
         return 0;
diff --git a/deps/openssl/openssl/crypto/bn/bn_mul.c b/deps/openssl/openssl/crypto/bn/bn_mul.c
index ff4bf2ca256..aefc3359238 100644
--- a/deps/openssl/openssl/crypto/bn/bn_mul.c
+++ b/deps/openssl/openssl/crypto/bn/bn_mul.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -154,7 +154,7 @@ BN_ULONG bn_sub_part_words(BN_ULONG *r,
 }
 #endif

-#ifdef BN_RECURSION
+#ifndef OPENSSL_SMALL_FOOTPRINT
 /*
  * Karatsuba recursive multiplication algorithm (cf. Knuth, The Art of
  * Computer Programming, Vol. 2)
@@ -180,13 +180,6 @@ void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
     unsigned int neg, zero;
     BN_ULONG ln, lo, *p;

-#ifdef BN_MUL_COMBA
-#if 0
-    if (n2 == 4) {
-        bn_mul_comba4(r, a, b);
-        return;
-    }
-#endif
     /*
      * Only call bn_mul_comba 8 if n2 == 8 and the two arrays are complete
      * [steve]
@@ -195,7 +188,7 @@ void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
         bn_mul_comba8(r, a, b);
         return;
     }
-#endif /* BN_MUL_COMBA */
+
     /* Else do normal multiply */
     if (n2 < BN_MUL_RECURSIVE_SIZE_NORMAL) {
         bn_mul_normal(r, a, n2 + dna, b, n2 + dnb);
@@ -240,7 +233,6 @@ void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
         break;
     }

-#ifdef BN_MUL_COMBA
     if (n == 4 && dna == 0 && dnb == 0) { /* XXX: bn_mul_comba4 could take
                                            * extra args to do this well */
         if (!zero)
@@ -260,9 +252,7 @@ void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,

         bn_mul_comba8(r, a, b);
         bn_mul_comba8(&(r[n2]), &(a[n]), &(b[n]));
-    } else
-#endif /* BN_MUL_COMBA */
-    {
+    } else {
         p = &(t[n2 * 2]);
         if (!zero)
             bn_mul_recursive(&(t[n2]), t, &(t[n]), n, 0, 0, p);
@@ -492,7 +482,7 @@ void bn_mul_low_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
         bn_add_words(&(r[n]), &(r[n]), &(t[n]), n);
     }
 }
-#endif /* BN_RECURSION */
+#endif /* OPENSSL_SMALL_FOOTPRINT */

 int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 {
@@ -509,10 +499,8 @@ int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
     int ret = 0;
     int top, al, bl;
     BIGNUM *rr;
-#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
+#if !defined(OPENSSL_SMALL_FOOTPRINT)
     int i;
-#endif
-#ifdef BN_RECURSION
     BIGNUM *t = NULL;
     int j = 0, k;
 #endif
@@ -537,10 +525,9 @@ int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
     } else
         rr = r;

-#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
+#if !defined(OPENSSL_SMALL_FOOTPRINT)
     i = al - bl;
-#endif
-#ifdef BN_MUL_COMBA
+
     if (i == 0) {
 #if 0
         if (al == 4) {
@@ -559,8 +546,7 @@ int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
             goto end;
         }
     }
-#endif /* BN_MUL_COMBA */
-#ifdef BN_RECURSION
+
     if ((al >= BN_MULL_SIZE_NORMAL) && (bl >= BN_MULL_SIZE_NORMAL)) {
         if (i >= -1 && i <= 1) {
             /*
@@ -598,13 +584,13 @@ int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
             goto end;
         }
     }
-#endif /* BN_RECURSION */
+#endif /* OPENSSL_SMALL_FOOTPRINT */
     if (bn_wexpand(rr, top) == NULL)
         goto err;
     rr->top = top;
     bn_mul_normal(rr->d, a->d, al, b->d, bl);

-#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
+#if !defined(OPENSSL_SMALL_FOOTPRINT)
 end:
 #endif
     rr->neg = a->neg ^ b->neg;
diff --git a/deps/openssl/openssl/crypto/bn/bn_nist.c b/deps/openssl/openssl/crypto/bn/bn_nist.c
index aa084996e47..8573df2bc1d 100644
--- a/deps/openssl/openssl/crypto/bn/bn_nist.c
+++ b/deps/openssl/openssl/crypto/bn/bn_nist.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -281,8 +281,8 @@ static void nist_cp_bn(BN_ULONG *dst, const BN_ULONG *src, int top)
 }

 #if BN_BITS2 == 64
-#define bn_cp_64(to, n, from, m) (to)[n] = (m >= 0) ? ((from)[m]) : 0;
-#define bn_64_set_0(to, n) (to)[n] = (BN_ULONG)0;
+#define bn_cp_64(to, n, from, m) ((to)[n] = ((m) >= 0) ? ((from)[m]) : 0)
+#define bn_64_set_0(to, n) (to)[n] = (BN_ULONG)0
 /*
  * two following macros are implemented under assumption that they
  * are called in a sequence with *ascending* n, i.e. as they are...
@@ -309,7 +309,7 @@ static void nist_cp_bn(BN_ULONG *dst, const BN_ULONG *src, int top)
         bn_32_set_0(to, (n) * 2);     \
         bn_32_set_0(to, (n) * 2 + 1); \
     }
-#define bn_cp_32(to, n, from, m) (to)[n] = (m >= 0) ? ((from)[m]) : 0;
+#define bn_cp_32(to, n, from, m) ((to)[n] = ((m) >= 0) ? ((from)[m]) : 0)
 #define bn_32_set_0(to, n) (to)[n] = (BN_ULONG)0;
 #if defined(_WIN32) && !defined(__GNUC__)
 #define NIST_INT64 __int64
@@ -340,11 +340,11 @@ static ossl_inline void store_lo32(void *ptr, NIST_INT64 val)
 }
 #endif /* NIST_INT64 */

-#define nist_set_192(to, from, a1, a2, a3)      \
-    {                                           \
-        bn_cp_64(to, 0, from, (a3) - 3)         \
-            bn_cp_64(to, 1, from, (a2) - 3)     \
-                bn_cp_64(to, 2, from, (a1) - 3) \
+#define nist_set_192(to, from, a1, a2, a3) \
+    {                                      \
+        bn_cp_64(to, 0, from, (a3) - 3);   \
+        bn_cp_64(to, 1, from, (a2) - 3);   \
+        bn_cp_64(to, 2, from, (a1) - 3);   \
     }

 int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
@@ -471,15 +471,15 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
 typedef BN_ULONG (*bn_addsub_f)(BN_ULONG *, const BN_ULONG *,
     const BN_ULONG *, int);

-#define nist_set_224(to, from, a1, a2, a3, a4, a5, a6, a7)      \
-    {                                                           \
-        bn_cp_32(to, 0, from, (a7) - 7)                         \
-            bn_cp_32(to, 1, from, (a6) - 7)                     \
-                bn_cp_32(to, 2, from, (a5) - 7)                 \
-                    bn_cp_32(to, 3, from, (a4) - 7)             \
-                        bn_cp_32(to, 4, from, (a3) - 7)         \
-                            bn_cp_32(to, 5, from, (a2) - 7)     \
-                                bn_cp_32(to, 6, from, (a1) - 7) \
+#define nist_set_224(to, from, a1, a2, a3, a4, a5, a6, a7) \
+    {                                                      \
+        bn_cp_32(to, 0, from, (a7) - 7);                   \
+        bn_cp_32(to, 1, from, (a6) - 7);                   \
+        bn_cp_32(to, 2, from, (a5) - 7);                   \
+        bn_cp_32(to, 3, from, (a4) - 7);                   \
+        bn_cp_32(to, 4, from, (a3) - 7);                   \
+        bn_cp_32(to, 5, from, (a2) - 7);                   \
+        bn_cp_32(to, 6, from, (a1) - 7);                   \
     }

 int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
@@ -585,9 +585,6 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
         rp[6] = (unsigned int)acc;

         carry = (int)(acc >> 32);
-#if BN_BITS2 == 64
-        rp[7] = carry;
-#endif
     }
 #else
     {
@@ -639,16 +636,16 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
     return 1;
 }

-#define nist_set_256(to, from, a1, a2, a3, a4, a5, a6, a7, a8)      \
-    {                                                               \
-        bn_cp_32(to, 0, from, (a8) - 8)                             \
-            bn_cp_32(to, 1, from, (a7) - 8)                         \
-                bn_cp_32(to, 2, from, (a6) - 8)                     \
-                    bn_cp_32(to, 3, from, (a5) - 8)                 \
-                        bn_cp_32(to, 4, from, (a4) - 8)             \
-                            bn_cp_32(to, 5, from, (a3) - 8)         \
-                                bn_cp_32(to, 6, from, (a2) - 8)     \
-                                    bn_cp_32(to, 7, from, (a1) - 8) \
+#define nist_set_256(to, from, a1, a2, a3, a4, a5, a6, a7, a8) \
+    {                                                          \
+        bn_cp_32(to, 0, from, (a8) - 8);                       \
+        bn_cp_32(to, 1, from, (a7) - 8);                       \
+        bn_cp_32(to, 2, from, (a6) - 8);                       \
+        bn_cp_32(to, 3, from, (a5) - 8);                       \
+        bn_cp_32(to, 4, from, (a4) - 8);                       \
+        bn_cp_32(to, 5, from, (a3) - 8);                       \
+        bn_cp_32(to, 6, from, (a2) - 8);                       \
+        bn_cp_32(to, 7, from, (a1) - 8);                       \
     }

 int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
@@ -868,20 +865,20 @@ int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
     return 1;
 }

-#define nist_set_384(to, from, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12)     \
-    {                                                                                 \
-        bn_cp_32(to, 0, from, (a12) - 12)                                             \
-            bn_cp_32(to, 1, from, (a11) - 12)                                         \
-                bn_cp_32(to, 2, from, (a10) - 12)                                     \
-                    bn_cp_32(to, 3, from, (a9) - 12)                                  \
-                        bn_cp_32(to, 4, from, (a8) - 12)                              \
-                            bn_cp_32(to, 5, from, (a7) - 12)                          \
-                                bn_cp_32(to, 6, from, (a6) - 12)                      \
-                                    bn_cp_32(to, 7, from, (a5) - 12)                  \
-                                        bn_cp_32(to, 8, from, (a4) - 12)              \
-                                            bn_cp_32(to, 9, from, (a3) - 12)          \
-                                                bn_cp_32(to, 10, from, (a2) - 12)     \
-                                                    bn_cp_32(to, 11, from, (a1) - 12) \
+#define nist_set_384(to, from, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) \
+    {                                                                             \
+        bn_cp_32(to, 0, from, (a12) - 12);                                        \
+        bn_cp_32(to, 1, from, (a11) - 12);                                        \
+        bn_cp_32(to, 2, from, (a10) - 12);                                        \
+        bn_cp_32(to, 3, from, (a9) - 12);                                         \
+        bn_cp_32(to, 4, from, (a8) - 12);                                         \
+        bn_cp_32(to, 5, from, (a7) - 12);                                         \
+        bn_cp_32(to, 6, from, (a6) - 12);                                         \
+        bn_cp_32(to, 7, from, (a5) - 12);                                         \
+        bn_cp_32(to, 8, from, (a4) - 12);                                         \
+        bn_cp_32(to, 9, from, (a3) - 12);                                         \
+        bn_cp_32(to, 10, from, (a2) - 12);                                        \
+        bn_cp_32(to, 11, from, (a1) - 12);                                        \
     }

 int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
diff --git a/deps/openssl/openssl/crypto/bn/bn_ppc.c b/deps/openssl/openssl/crypto/bn/bn_ppc.c
index 8ef52a30c1a..82b8c1ee61d 100644
--- a/deps/openssl/openssl/crypto/bn/bn_ppc.c
+++ b/deps/openssl/openssl/crypto/bn/bn_ppc.c
@@ -9,7 +9,7 @@

 #include <openssl/crypto.h>
 #include <openssl/bn.h>
-#include "crypto/ppc_arch.h"
+#include "arch/ppc_arch.h"
 #include "bn_local.h"

 int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
diff --git a/deps/openssl/openssl/crypto/bn/bn_prime.c b/deps/openssl/openssl/crypto/bn/bn_prime.c
index 08f889e5979..7074fadcbc4 100644
--- a/deps/openssl/openssl/crypto/bn/bn_prime.c
+++ b/deps/openssl/openssl/crypto/bn/bn_prime.c
@@ -144,7 +144,7 @@ int BN_generate_prime_ex2(BIGNUM *ret, int bits, int safe,
         return 0;
     }

-    mods = OPENSSL_zalloc(sizeof(*mods) * NUMPRIMES);
+    mods = OPENSSL_calloc(NUMPRIMES, sizeof(*mods));
     if (mods == NULL)
         return 0;

@@ -420,7 +420,7 @@ int ossl_bn_miller_rabin_is_prime(const BIGNUM *w, int iterations, BN_CTX *ctx,
         /* (Step 4.7) for j = 1 to a-1 */
         for (j = 1; j < a; ++j) {
             /* (Step 4.7.1 - 4.7.2) x = z. z = x^2 mod w */
-            if (!BN_copy(x, z) || !BN_mod_mul(z, x, x, w, ctx))
+            if (BN_copy(x, z) == NULL || !BN_mod_mul(z, x, x, w, ctx))
                 goto err;
             /* (Step 4.7.3) */
             if (BN_cmp(z, w1) == 0)
@@ -431,13 +431,13 @@ int ossl_bn_miller_rabin_is_prime(const BIGNUM *w, int iterations, BN_CTX *ctx,
         }
         /* At this point z = b^((w-1)/2) mod w */
         /* (Steps 4.8 - 4.9) x = z, z = x^2 mod w */
-        if (!BN_copy(x, z) || !BN_mod_mul(z, x, x, w, ctx))
+        if (BN_copy(x, z) == NULL || !BN_mod_mul(z, x, x, w, ctx))
             goto err;
         /* (Step 4.10) */
         if (BN_is_one(z))
             goto composite;
         /* (Step 4.11) x = b^(w-1) mod w */
-        if (!BN_copy(x, z))
+        if (BN_copy(x, z) == NULL)
             goto err;
     composite:
         if (enhanced) {
diff --git a/deps/openssl/openssl/crypto/bn/bn_prime.h b/deps/openssl/openssl/crypto/bn/bn_prime.h
deleted file mode 100644
index 8a859ac02e2..00000000000
--- a/deps/openssl/openssl/crypto/bn/bn_prime.h
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * WARNING: do not edit!
- * Generated by crypto/bn/bn_prime.pl
- *
- * Copyright 1998-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-typedef unsigned short prime_t;
-# define NUMPRIMES 2048
-
-static const prime_t primes[2048] = {
-        2,     3,     5,     7,    11,    13,    17,    19,
-       23,    29,    31,    37,    41,    43,    47,    53,
-       59,    61,    67,    71,    73,    79,    83,    89,
-       97,   101,   103,   107,   109,   113,   127,   131,
-      137,   139,   149,   151,   157,   163,   167,   173,
-      179,   181,   191,   193,   197,   199,   211,   223,
-      227,   229,   233,   239,   241,   251,   257,   263,
-      269,   271,   277,   281,   283,   293,   307,   311,
-      313,   317,   331,   337,   347,   349,   353,   359,
-      367,   373,   379,   383,   389,   397,   401,   409,
-      419,   421,   431,   433,   439,   443,   449,   457,
-      461,   463,   467,   479,   487,   491,   499,   503,
-      509,   521,   523,   541,   547,   557,   563,   569,
-      571,   577,   587,   593,   599,   601,   607,   613,
-      617,   619,   631,   641,   643,   647,   653,   659,
-      661,   673,   677,   683,   691,   701,   709,   719,
-      727,   733,   739,   743,   751,   757,   761,   769,
-      773,   787,   797,   809,   811,   821,   823,   827,
-      829,   839,   853,   857,   859,   863,   877,   881,
-      883,   887,   907,   911,   919,   929,   937,   941,
-      947,   953,   967,   971,   977,   983,   991,   997,
-     1009,  1013,  1019,  1021,  1031,  1033,  1039,  1049,
-     1051,  1061,  1063,  1069,  1087,  1091,  1093,  1097,
-     1103,  1109,  1117,  1123,  1129,  1151,  1153,  1163,
-     1171,  1181,  1187,  1193,  1201,  1213,  1217,  1223,
-     1229,  1231,  1237,  1249,  1259,  1277,  1279,  1283,
-     1289,  1291,  1297,  1301,  1303,  1307,  1319,  1321,
-     1327,  1361,  1367,  1373,  1381,  1399,  1409,  1423,
-     1427,  1429,  1433,  1439,  1447,  1451,  1453,  1459,
-     1471,  1481,  1483,  1487,  1489,  1493,  1499,  1511,
-     1523,  1531,  1543,  1549,  1553,  1559,  1567,  1571,
-     1579,  1583,  1597,  1601,  1607,  1609,  1613,  1619,
-     1621,  1627,  1637,  1657,  1663,  1667,  1669,  1693,
-     1697,  1699,  1709,  1721,  1723,  1733,  1741,  1747,
-     1753,  1759,  1777,  1783,  1787,  1789,  1801,  1811,
-     1823,  1831,  1847,  1861,  1867,  1871,  1873,  1877,
-     1879,  1889,  1901,  1907,  1913,  1931,  1933,  1949,
-     1951,  1973,  1979,  1987,  1993,  1997,  1999,  2003,
-     2011,  2017,  2027,  2029,  2039,  2053,  2063,  2069,
-     2081,  2083,  2087,  2089,  2099,  2111,  2113,  2129,
-     2131,  2137,  2141,  2143,  2153,  2161,  2179,  2203,
-     2207,  2213,  2221,  2237,  2239,  2243,  2251,  2267,
-     2269,  2273,  2281,  2287,  2293,  2297,  2309,  2311,
-     2333,  2339,  2341,  2347,  2351,  2357,  2371,  2377,
-     2381,  2383,  2389,  2393,  2399,  2411,  2417,  2423,
-     2437,  2441,  2447,  2459,  2467,  2473,  2477,  2503,
-     2521,  2531,  2539,  2543,  2549,  2551,  2557,  2579,
-     2591,  2593,  2609,  2617,  2621,  2633,  2647,  2657,
-     2659,  2663,  2671,  2677,  2683,  2687,  2689,  2693,
-     2699,  2707,  2711,  2713,  2719,  2729,  2731,  2741,
-     2749,  2753,  2767,  2777,  2789,  2791,  2797,  2801,
-     2803,  2819,  2833,  2837,  2843,  2851,  2857,  2861,
-     2879,  2887,  2897,  2903,  2909,  2917,  2927,  2939,
-     2953,  2957,  2963,  2969,  2971,  2999,  3001,  3011,
-     3019,  3023,  3037,  3041,  3049,  3061,  3067,  3079,
-     3083,  3089,  3109,  3119,  3121,  3137,  3163,  3167,
-     3169,  3181,  3187,  3191,  3203,  3209,  3217,  3221,
-     3229,  3251,  3253,  3257,  3259,  3271,  3299,  3301,
-     3307,  3313,  3319,  3323,  3329,  3331,  3343,  3347,
-     3359,  3361,  3371,  3373,  3389,  3391,  3407,  3413,
-     3433,  3449,  3457,  3461,  3463,  3467,  3469,  3491,
-     3499,  3511,  3517,  3527,  3529,  3533,  3539,  3541,
-     3547,  3557,  3559,  3571,  3581,  3583,  3593,  3607,
-     3613,  3617,  3623,  3631,  3637,  3643,  3659,  3671,
-     3673,  3677,  3691,  3697,  3701,  3709,  3719,  3727,
-     3733,  3739,  3761,  3767,  3769,  3779,  3793,  3797,
-     3803,  3821,  3823,  3833,  3847,  3851,  3853,  3863,
-     3877,  3881,  3889,  3907,  3911,  3917,  3919,  3923,
-     3929,  3931,  3943,  3947,  3967,  3989,  4001,  4003,
-     4007,  4013,  4019,  4021,  4027,  4049,  4051,  4057,
-     4073,  4079,  4091,  4093,  4099,  4111,  4127,  4129,
-     4133,  4139,  4153,  4157,  4159,  4177,  4201,  4211,
-     4217,  4219,  4229,  4231,  4241,  4243,  4253,  4259,
-     4261,  4271,  4273,  4283,  4289,  4297,  4327,  4337,
-     4339,  4349,  4357,  4363,  4373,  4391,  4397,  4409,
-     4421,  4423,  4441,  4447,  4451,  4457,  4463,  4481,
-     4483,  4493,  4507,  4513,  4517,  4519,  4523,  4547,
-     4549,  4561,  4567,  4583,  4591,  4597,  4603,  4621,
-     4637,  4639,  4643,  4649,  4651,  4657,  4663,  4673,
-     4679,  4691,  4703,  4721,  4723,  4729,  4733,  4751,
-     4759,  4783,  4787,  4789,  4793,  4799,  4801,  4813,
-     4817,  4831,  4861,  4871,  4877,  4889,  4903,  4909,
-     4919,  4931,  4933,  4937,  4943,  4951,  4957,  4967,
-     4969,  4973,  4987,  4993,  4999,  5003,  5009,  5011,
-     5021,  5023,  5039,  5051,  5059,  5077,  5081,  5087,
-     5099,  5101,  5107,  5113,  5119,  5147,  5153,  5167,
-     5171,  5179,  5189,  5197,  5209,  5227,  5231,  5233,
-     5237,  5261,  5273,  5279,  5281,  5297,  5303,  5309,
-     5323,  5333,  5347,  5351,  5381,  5387,  5393,  5399,
-     5407,  5413,  5417,  5419,  5431,  5437,  5441,  5443,
-     5449,  5471,  5477,  5479,  5483,  5501,  5503,  5507,
-     5519,  5521,  5527,  5531,  5557,  5563,  5569,  5573,
-     5581,  5591,  5623,  5639,  5641,  5647,  5651,  5653,
-     5657,  5659,  5669,  5683,  5689,  5693,  5701,  5711,
-     5717,  5737,  5741,  5743,  5749,  5779,  5783,  5791,
-     5801,  5807,  5813,  5821,  5827,  5839,  5843,  5849,
-     5851,  5857,  5861,  5867,  5869,  5879,  5881,  5897,
-     5903,  5923,  5927,  5939,  5953,  5981,  5987,  6007,
-     6011,  6029,  6037,  6043,  6047,  6053,  6067,  6073,
-     6079,  6089,  6091,  6101,  6113,  6121,  6131,  6133,
-     6143,  6151,  6163,  6173,  6197,  6199,  6203,  6211,
-     6217,  6221,  6229,  6247,  6257,  6263,  6269,  6271,
-     6277,  6287,  6299,  6301,  6311,  6317,  6323,  6329,
-     6337,  6343,  6353,  6359,  6361,  6367,  6373,  6379,
-     6389,  6397,  6421,  6427,  6449,  6451,  6469,  6473,
-     6481,  6491,  6521,  6529,  6547,  6551,  6553,  6563,
-     6569,  6571,  6577,  6581,  6599,  6607,  6619,  6637,
-     6653,  6659,  6661,  6673,  6679,  6689,  6691,  6701,
-     6703,  6709,  6719,  6733,  6737,  6761,  6763,  6779,
-     6781,  6791,  6793,  6803,  6823,  6827,  6829,  6833,
-     6841,  6857,  6863,  6869,  6871,  6883,  6899,  6907,
-     6911,  6917,  6947,  6949,  6959,  6961,  6967,  6971,
-     6977,  6983,  6991,  6997,  7001,  7013,  7019,  7027,
-     7039,  7043,  7057,  7069,  7079,  7103,  7109,  7121,
-     7127,  7129,  7151,  7159,  7177,  7187,  7193,  7207,
-     7211,  7213,  7219,  7229,  7237,  7243,  7247,  7253,
-     7283,  7297,  7307,  7309,  7321,  7331,  7333,  7349,
-     7351,  7369,  7393,  7411,  7417,  7433,  7451,  7457,
-     7459,  7477,  7481,  7487,  7489,  7499,  7507,  7517,
-     7523,  7529,  7537,  7541,  7547,  7549,  7559,  7561,
-     7573,  7577,  7583,  7589,  7591,  7603,  7607,  7621,
-     7639,  7643,  7649,  7669,  7673,  7681,  7687,  7691,
-     7699,  7703,  7717,  7723,  7727,  7741,  7753,  7757,
-     7759,  7789,  7793,  7817,  7823,  7829,  7841,  7853,
-     7867,  7873,  7877,  7879,  7883,  7901,  7907,  7919,
-     7927,  7933,  7937,  7949,  7951,  7963,  7993,  8009,
-     8011,  8017,  8039,  8053,  8059,  8069,  8081,  8087,
-     8089,  8093,  8101,  8111,  8117,  8123,  8147,  8161,
-     8167,  8171,  8179,  8191,  8209,  8219,  8221,  8231,
-     8233,  8237,  8243,  8263,  8269,  8273,  8287,  8291,
-     8293,  8297,  8311,  8317,  8329,  8353,  8363,  8369,
-     8377,  8387,  8389,  8419,  8423,  8429,  8431,  8443,
-     8447,  8461,  8467,  8501,  8513,  8521,  8527,  8537,
-     8539,  8543,  8563,  8573,  8581,  8597,  8599,  8609,
-     8623,  8627,  8629,  8641,  8647,  8663,  8669,  8677,
-     8681,  8689,  8693,  8699,  8707,  8713,  8719,  8731,
-     8737,  8741,  8747,  8753,  8761,  8779,  8783,  8803,
-     8807,  8819,  8821,  8831,  8837,  8839,  8849,  8861,
-     8863,  8867,  8887,  8893,  8923,  8929,  8933,  8941,
-     8951,  8963,  8969,  8971,  8999,  9001,  9007,  9011,
-     9013,  9029,  9041,  9043,  9049,  9059,  9067,  9091,
-     9103,  9109,  9127,  9133,  9137,  9151,  9157,  9161,
-     9173,  9181,  9187,  9199,  9203,  9209,  9221,  9227,
-     9239,  9241,  9257,  9277,  9281,  9283,  9293,  9311,
-     9319,  9323,  9337,  9341,  9343,  9349,  9371,  9377,
-     9391,  9397,  9403,  9413,  9419,  9421,  9431,  9433,
-     9437,  9439,  9461,  9463,  9467,  9473,  9479,  9491,
-     9497,  9511,  9521,  9533,  9539,  9547,  9551,  9587,
-     9601,  9613,  9619,  9623,  9629,  9631,  9643,  9649,
-     9661,  9677,  9679,  9689,  9697,  9719,  9721,  9733,
-     9739,  9743,  9749,  9767,  9769,  9781,  9787,  9791,
-     9803,  9811,  9817,  9829,  9833,  9839,  9851,  9857,
-     9859,  9871,  9883,  9887,  9901,  9907,  9923,  9929,
-     9931,  9941,  9949,  9967,  9973, 10007, 10009, 10037,
-    10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099,
-    10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163,
-    10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247,
-    10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303,
-    10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369,
-    10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459,
-    10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531,
-    10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627,
-    10631, 10639, 10651, 10657, 10663, 10667, 10687, 10691,
-    10709, 10711, 10723, 10729, 10733, 10739, 10753, 10771,
-    10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859,
-    10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937,
-    10939, 10949, 10957, 10973, 10979, 10987, 10993, 11003,
-    11027, 11047, 11057, 11059, 11069, 11071, 11083, 11087,
-    11093, 11113, 11117, 11119, 11131, 11149, 11159, 11161,
-    11171, 11173, 11177, 11197, 11213, 11239, 11243, 11251,
-    11257, 11261, 11273, 11279, 11287, 11299, 11311, 11317,
-    11321, 11329, 11351, 11353, 11369, 11383, 11393, 11399,
-    11411, 11423, 11437, 11443, 11447, 11467, 11471, 11483,
-    11489, 11491, 11497, 11503, 11519, 11527, 11549, 11551,
-    11579, 11587, 11593, 11597, 11617, 11621, 11633, 11657,
-    11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731,
-    11743, 11777, 11779, 11783, 11789, 11801, 11807, 11813,
-    11821, 11827, 11831, 11833, 11839, 11863, 11867, 11887,
-    11897, 11903, 11909, 11923, 11927, 11933, 11939, 11941,
-    11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011,
-    12037, 12041, 12043, 12049, 12071, 12073, 12097, 12101,
-    12107, 12109, 12113, 12119, 12143, 12149, 12157, 12161,
-    12163, 12197, 12203, 12211, 12227, 12239, 12241, 12251,
-    12253, 12263, 12269, 12277, 12281, 12289, 12301, 12323,
-    12329, 12343, 12347, 12373, 12377, 12379, 12391, 12401,
-    12409, 12413, 12421, 12433, 12437, 12451, 12457, 12473,
-    12479, 12487, 12491, 12497, 12503, 12511, 12517, 12527,
-    12539, 12541, 12547, 12553, 12569, 12577, 12583, 12589,
-    12601, 12611, 12613, 12619, 12637, 12641, 12647, 12653,
-    12659, 12671, 12689, 12697, 12703, 12713, 12721, 12739,
-    12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821,
-    12823, 12829, 12841, 12853, 12889, 12893, 12899, 12907,
-    12911, 12917, 12919, 12923, 12941, 12953, 12959, 12967,
-    12973, 12979, 12983, 13001, 13003, 13007, 13009, 13033,
-    13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109,
-    13121, 13127, 13147, 13151, 13159, 13163, 13171, 13177,
-    13183, 13187, 13217, 13219, 13229, 13241, 13249, 13259,
-    13267, 13291, 13297, 13309, 13313, 13327, 13331, 13337,
-    13339, 13367, 13381, 13397, 13399, 13411, 13417, 13421,
-    13441, 13451, 13457, 13463, 13469, 13477, 13487, 13499,
-    13513, 13523, 13537, 13553, 13567, 13577, 13591, 13597,
-    13613, 13619, 13627, 13633, 13649, 13669, 13679, 13681,
-    13687, 13691, 13693, 13697, 13709, 13711, 13721, 13723,
-    13729, 13751, 13757, 13759, 13763, 13781, 13789, 13799,
-    13807, 13829, 13831, 13841, 13859, 13873, 13877, 13879,
-    13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933,
-    13963, 13967, 13997, 13999, 14009, 14011, 14029, 14033,
-    14051, 14057, 14071, 14081, 14083, 14087, 14107, 14143,
-    14149, 14153, 14159, 14173, 14177, 14197, 14207, 14221,
-    14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323,
-    14327, 14341, 14347, 14369, 14387, 14389, 14401, 14407,
-    14411, 14419, 14423, 14431, 14437, 14447, 14449, 14461,
-    14479, 14489, 14503, 14519, 14533, 14537, 14543, 14549,
-    14551, 14557, 14561, 14563, 14591, 14593, 14621, 14627,
-    14629, 14633, 14639, 14653, 14657, 14669, 14683, 14699,
-    14713, 14717, 14723, 14731, 14737, 14741, 14747, 14753,
-    14759, 14767, 14771, 14779, 14783, 14797, 14813, 14821,
-    14827, 14831, 14843, 14851, 14867, 14869, 14879, 14887,
-    14891, 14897, 14923, 14929, 14939, 14947, 14951, 14957,
-    14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073,
-    15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137,
-    15139, 15149, 15161, 15173, 15187, 15193, 15199, 15217,
-    15227, 15233, 15241, 15259, 15263, 15269, 15271, 15277,
-    15287, 15289, 15299, 15307, 15313, 15319, 15329, 15331,
-    15349, 15359, 15361, 15373, 15377, 15383, 15391, 15401,
-    15413, 15427, 15439, 15443, 15451, 15461, 15467, 15473,
-    15493, 15497, 15511, 15527, 15541, 15551, 15559, 15569,
-    15581, 15583, 15601, 15607, 15619, 15629, 15641, 15643,
-    15647, 15649, 15661, 15667, 15671, 15679, 15683, 15727,
-    15731, 15733, 15737, 15739, 15749, 15761, 15767, 15773,
-    15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859,
-    15877, 15881, 15887, 15889, 15901, 15907, 15913, 15919,
-    15923, 15937, 15959, 15971, 15973, 15991, 16001, 16007,
-    16033, 16057, 16061, 16063, 16067, 16069, 16073, 16087,
-    16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183,
-    16187, 16189, 16193, 16217, 16223, 16229, 16231, 16249,
-    16253, 16267, 16273, 16301, 16319, 16333, 16339, 16349,
-    16361, 16363, 16369, 16381, 16411, 16417, 16421, 16427,
-    16433, 16447, 16451, 16453, 16477, 16481, 16487, 16493,
-    16519, 16529, 16547, 16553, 16561, 16567, 16573, 16603,
-    16607, 16619, 16631, 16633, 16649, 16651, 16657, 16661,
-    16673, 16691, 16693, 16699, 16703, 16729, 16741, 16747,
-    16759, 16763, 16787, 16811, 16823, 16829, 16831, 16843,
-    16871, 16879, 16883, 16889, 16901, 16903, 16921, 16927,
-    16931, 16937, 16943, 16963, 16979, 16981, 16987, 16993,
-    17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053,
-    17077, 17093, 17099, 17107, 17117, 17123, 17137, 17159,
-    17167, 17183, 17189, 17191, 17203, 17207, 17209, 17231,
-    17239, 17257, 17291, 17293, 17299, 17317, 17321, 17327,
-    17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389,
-    17393, 17401, 17417, 17419, 17431, 17443, 17449, 17467,
-    17471, 17477, 17483, 17489, 17491, 17497, 17509, 17519,
-    17539, 17551, 17569, 17573, 17579, 17581, 17597, 17599,
-    17609, 17623, 17627, 17657, 17659, 17669, 17681, 17683,
-    17707, 17713, 17729, 17737, 17747, 17749, 17761, 17783,
-    17789, 17791, 17807, 17827, 17837, 17839, 17851, 17863,
-};
diff --git a/deps/openssl/openssl/crypto/bn/bn_prime.pl b/deps/openssl/openssl/crypto/bn/bn_prime.pl
index a7a764627b9..7535251be87 100644
--- a/deps/openssl/openssl/crypto/bn/bn_prime.pl
+++ b/deps/openssl/openssl/crypto/bn/bn_prime.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 1998-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1998-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -25,6 +25,10 @@ print <<"EOF";
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_BN_BN_PRIME_H)
+#define OSSL_LIBCRYPTO_BN_BN_PRIME_H
+
+/* clang-format off */
 EOF


@@ -50,3 +54,5 @@ for (my $i = 0; $i <= $#primes; $i++) {
     printf " %5d,", $primes[$i];
 }
 print "\n};\n";
+print "/* clang-format on */\n";
+print "\n#endif /* !defined(OSSL_LIBCRYPTO_BN_BN_PRIME_H) */\n"
diff --git a/deps/openssl/openssl/crypto/bn/bn_print.c b/deps/openssl/openssl/crypto/bn/bn_print.c
index a04e6cf0c2d..328e7421af7 100644
--- a/deps/openssl/openssl/crypto/bn/bn_print.c
+++ b/deps/openssl/openssl/crypto/bn/bn_print.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -61,10 +61,10 @@ char *BN_options(void)
     if (!init) {
         init++;
 #ifdef BN_LLONG
-        BIO_snprintf(data, sizeof(data), "bn(%zu,%zu)",
+        snprintf(data, sizeof(data), "bn(%zu,%zu)",
             sizeof(BN_ULLONG) * 8, sizeof(BN_ULONG) * 8);
 #else
-        BIO_snprintf(data, sizeof(data), "bn(%zu,%zu)",
+        snprintf(data, sizeof(data), "bn(%zu,%zu)",
             sizeof(BN_ULONG) * 8, sizeof(BN_ULONG) * 8);
 #endif
     }
diff --git a/deps/openssl/openssl/crypto/bn/bn_recp.c b/deps/openssl/openssl/crypto/bn/bn_recp.c
index 26fb737e251..46534ae965f 100644
--- a/deps/openssl/openssl/crypto/bn/bn_recp.c
+++ b/deps/openssl/openssl/crypto/bn/bn_recp.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -42,7 +42,7 @@ void BN_RECP_CTX_free(BN_RECP_CTX *recp)

 int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx)
 {
-    if (BN_is_zero(d) || !BN_copy(&(recp->N), d))
+    if (BN_is_zero(d) || BN_copy(&(recp->N), d) == NULL)
         return 0;
     BN_zero(&(recp->Nr));
     recp->num_bits = BN_num_bits(d);
@@ -95,7 +95,7 @@ int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,

     if (BN_ucmp(m, &(recp->N)) < 0) {
         BN_zero(d);
-        if (!BN_copy(r, m)) {
+        if (BN_copy(r, m) == NULL) {
             BN_CTX_end(ctx);
             return 0;
         }
diff --git a/deps/openssl/openssl/crypto/bn/bn_rsa_fips186_4.c b/deps/openssl/openssl/crypto/bn/bn_rsa_fips186_5.c
similarity index 81%
rename from deps/openssl/openssl/crypto/bn/bn_rsa_fips186_4.c
rename to deps/openssl/openssl/crypto/bn/bn_rsa_fips186_5.c
index 08def7f13c9..635f013f732 100644
--- a/deps/openssl/openssl/crypto/bn/bn_rsa_fips186_4.c
+++ b/deps/openssl/openssl/crypto/bn/bn_rsa_fips186_5.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2023 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2018-2019, Oracle and/or its affiliates.  All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -102,24 +102,29 @@ static int bn_rsa_fips186_5_aux_prime_min_size(int nbits)
  * (FIPS 186-5 has an entry for >= 4096 bits).
  * Params:
  *     nbits The key size in bits.
+ *     c If this is non zero then the probable prime is congruent to c mod 8
+ *       and is 3 bits smaller
  * Returns:
  *     The maximum length or 0 if nbits is invalid.
  */
-static int bn_rsa_fips186_5_aux_prime_max_sum_size_for_prob_primes(int nbits)
+static int bn_rsa_fips186_5_aux_prime_max_sum_size_for_prob_primes(int nbits,
+    uint32_t c)
 {
+    int reduce_bits = (c == 0) ? 0 : 3;
+
     if (nbits >= 4096)
-        return 2030;
+        return 2030 - reduce_bits;
     if (nbits >= 3072)
-        return 1518;
+        return 1518 - reduce_bits;
     if (nbits >= 2048)
-        return 1007;
+        return 1007 - reduce_bits;
     return 0;
 }

 /*
  * Find the first odd integer that is a probable prime.
  *
- * See section FIPS 186-4 B.3.6 (Steps 4.2/5.2).
+ * See section FIPS 186-5 A.1.6 (Steps 4.2/5.2).
  *
  * Params:
  *     Xp1 The passed in starting point to find a probably prime.
@@ -129,7 +134,7 @@ static int bn_rsa_fips186_5_aux_prime_max_sum_size_for_prob_primes(int nbits)
  *     cb An optional BIGNUM callback.
  * Returns: 1 on success otherwise it returns 0.
  */
-static int bn_rsa_fips186_4_find_aux_prob_prime(const BIGNUM *Xp1,
+static int bn_rsa_fips186_5_find_aux_prob_prime(const BIGNUM *Xp1,
     BIGNUM *p1, BN_CTX *ctx,
     int rounds,
     BN_GENCB *cb)
@@ -165,7 +170,7 @@ err:
 /*
  * Generate a probable prime (p or q).
  *
- * See FIPS 186-4 B.3.6 (Steps 4 & 5)
+ * See FIPS 186-5 A.1.6 (Steps 4 & 5)
  *
  * Params:
  *     p The returned probable prime.
@@ -179,14 +184,17 @@ err:
  *     e The public exponent.
  *     ctx A BN_CTX object.
  *     cb An optional BIGNUM callback.
+ *     c An optional number with a value of 0, 1, 3, 5 or 7 that may be used
+ *       to add the requirement p is congruent to c mod 8. The value is ignored
+ *       if it is zero.
  * Returns: 1 on success otherwise it returns 0.
  */
-int ossl_bn_rsa_fips186_4_gen_prob_primes(BIGNUM *p, BIGNUM *Xpout,
+int ossl_bn_rsa_fips186_5_gen_prob_primes(BIGNUM *p, BIGNUM *Xpout,
     BIGNUM *p1, BIGNUM *p2,
     const BIGNUM *Xp, const BIGNUM *Xp1,
     const BIGNUM *Xp2, int nlen,
     const BIGNUM *e, BN_CTX *ctx,
-    BN_GENCB *cb)
+    BN_GENCB *cb, uint32_t c)
 {
     int ret = 0;
     BIGNUM *p1i = NULL, *p2i = NULL, *Xp1i = NULL, *Xp2i = NULL;
@@ -225,15 +233,15 @@ int ossl_bn_rsa_fips186_4_gen_prob_primes(BIGNUM *p, BIGNUM *Xpout,
     }

     /* (Steps 4.2/5.2) - find first auxiliary probable primes */
-    if (!bn_rsa_fips186_4_find_aux_prob_prime(Xp1i, p1i, ctx, rounds, cb)
-        || !bn_rsa_fips186_4_find_aux_prob_prime(Xp2i, p2i, ctx, rounds, cb))
+    if (!bn_rsa_fips186_5_find_aux_prob_prime(Xp1i, p1i, ctx, rounds, cb)
+        || !bn_rsa_fips186_5_find_aux_prob_prime(Xp2i, p2i, ctx, rounds, cb))
         goto err;
     /* (FIPS 186-5 Table A.1) auxiliary prime Max length check */
-    if ((BN_num_bits(p1i) + BN_num_bits(p2i)) > bn_rsa_fips186_5_aux_prime_max_sum_size_for_prob_primes(nlen))
+    if ((BN_num_bits(p1i) + BN_num_bits(p2i)) >= bn_rsa_fips186_5_aux_prime_max_sum_size_for_prob_primes(nlen, c))
         goto err;
     /* (Steps 4.3/5.3) - generate prime */
-    if (!ossl_bn_rsa_fips186_4_derive_prime(p, Xpout, Xp, p1i, p2i, nlen, e,
-            ctx, cb))
+    if (!ossl_bn_rsa_fips186_5_derive_prime(p, Xpout, Xp, p1i, p2i, nlen, e,
+            ctx, cb, c))
         goto err;
     ret = 1;
 err:
@@ -250,12 +258,28 @@ err:
     return ret;
 }

+static ossl_inline int get_multiple_of_y_congruent_to_cmod8(BIGNUM *y, const BIGNUM *r1r2x2, int c)
+{
+    int i = 0;
+
+    for (i = 0; i < 3; ++i) {
+        /* Check for Y = c mod 8 */
+        if ((int)(*bn_get_words(y) & 7) == c)
+            return 1;
+        /* Y = Y + 2r1r2 */
+        if (!BN_add(y, y, r1r2x2))
+            return 0;
+    }
+    /* Fall through for y = y + 6 * r1r2 */
+    return 1;
+}
+
 /*
  * Constructs a probable prime (a candidate for p or q) using 2 auxiliary
  * prime numbers and the Chinese Remainder Theorem.
  *
- * See FIPS 186-4 C.9 "Compute a Probable Prime Factor Based on Auxiliary
- * Primes". Used by FIPS 186-4 B.3.6 Section (4.3) for p and Section (5.3) for q.
+ * See FIPS 186-5 B.9 "Compute a Probable Prime Factor Based on Auxiliary
+ * Primes". Used by FIPS 186-5 A.1.6 Section (4.3) for p and Section (5.3) for q.
  *
  * Params:
  *     Y The returned prime factor (private_prime_factor) of the modulus n.
@@ -267,20 +291,24 @@ err:
  *     e The public exponent.
  *     ctx A BN_CTX object.
  *     cb An optional BIGNUM callback object.
+ *     c An optional parameter from the set {0, 1, 3, 5, 7} that
+ *       may be used to add the further requirement that the computed
+ *       prime is congruent to c mod 8. A value of 0 indicates that the option
+ *       is ignored.
  * Returns: 1 on success otherwise it returns 0.
  * Assumptions:
  *     Y, X, r1, r2, e are not NULL.
  */
-int ossl_bn_rsa_fips186_4_derive_prime(BIGNUM *Y, BIGNUM *X, const BIGNUM *Xin,
+int ossl_bn_rsa_fips186_5_derive_prime(BIGNUM *Y, BIGNUM *X, const BIGNUM *Xin,
     const BIGNUM *r1, const BIGNUM *r2,
     int nlen, const BIGNUM *e,
-    BN_CTX *ctx, BN_GENCB *cb)
+    BN_CTX *ctx, BN_GENCB *cb, uint32_t c)
 {
     int ret = 0;
     int i, imax, rounds;
     int bits = nlen >> 1;
-    BIGNUM *tmp, *R, *r1r2x2, *y1, *r1x2;
-    BIGNUM *base, *range;
+    BIGNUM *tmp, *R, *r1r2x2, *r1r2x8, *y1, *r1x2;
+    BIGNUM *base, *range, *r1r2x2_step;

     BN_CTX_start(ctx);

@@ -289,6 +317,7 @@ int ossl_bn_rsa_fips186_4_derive_prime(BIGNUM *Y, BIGNUM *X, const BIGNUM *Xin,
     R = BN_CTX_get(ctx);
     tmp = BN_CTX_get(ctx);
     r1r2x2 = BN_CTX_get(ctx);
+    r1r2x8 = BN_CTX_get(ctx);
     y1 = BN_CTX_get(ctx);
     r1x2 = BN_CTX_get(ctx);
     if (r1x2 == NULL)
@@ -339,6 +368,14 @@ int ossl_bn_rsa_fips186_4_derive_prime(BIGNUM *Y, BIGNUM *X, const BIGNUM *Xin,
     if (BN_is_negative(R) && !BN_add(R, R, r1r2x2))
         goto err;

+    if (c == 0) {
+        r1r2x2_step = r1r2x2;
+    } else {
+        if (!BN_lshift(r1r2x8, r1r2x2, 2))
+            goto err;
+        r1r2x2_step = r1r2x8;
+    }
+
     /*
      * In FIPS 186-4 imax was set to 5 * nlen/2.
      * Analysis by Allen Roginsky
@@ -361,6 +398,15 @@ int ossl_bn_rsa_fips186_4_derive_prime(BIGNUM *Y, BIGNUM *X, const BIGNUM *Xin,
         /* (Step 4) Y = X + ((R - X) mod 2r1r2) */
         if (!BN_mod_sub(Y, R, X, r1r2x2, ctx) || !BN_add(Y, Y, X))
             goto err;
+        /*
+         * (Step 4.1) If there is an optional requirement that the
+         * computed prime is equal to c mod 8, then chose the value
+         * Y, Y + 2r1r2, Y + 4r1r2 OR Y + 6r1r2 that satisfies the requirement.
+         */
+        if (c != 0) {
+            if (!get_multiple_of_y_congruent_to_cmod8(Y, r1r2x2, c))
+                goto err;
+        }
         /* (Step 5) */
         i = 0;
         for (;;) {
@@ -391,7 +437,7 @@ int ossl_bn_rsa_fips186_4_derive_prime(BIGNUM *Y, BIGNUM *X, const BIGNUM *Xin,
                 ERR_raise(ERR_LIB_BN, BN_R_NO_PRIME_CANDIDATE);
                 goto err;
             }
-            if (!BN_add(Y, Y, r1r2x2))
+            if (!BN_add(Y, Y, r1r2x2_step))
                 goto err;
         }
     }
diff --git a/deps/openssl/openssl/crypto/bn/bn_s390x.c b/deps/openssl/openssl/crypto/bn/bn_s390x.c
index 641d5878bef..64842cf458b 100644
--- a/deps/openssl/openssl/crypto/bn/bn_s390x.c
+++ b/deps/openssl/openssl/crypto/bn/bn_s390x.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -8,7 +8,7 @@
  */

 #include "crypto/bn.h"
-#include "crypto/s390x_arch.h"
+#include "arch/s390x_arch.h"

 #ifdef S390X_MOD_EXP

@@ -20,18 +20,22 @@
 #include <unistd.h>
 #include <errno.h>

+/*
+ * Returns 1 for success, 0 for failure, and -1 to tell the caller to use the
+ * SW-fallback.
+ */
 static int s390x_mod_exp_hw(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
     const BIGNUM *m)
 {
     struct ica_rsa_modexpo me;
     unsigned char *buffer;
     size_t size;
-    int res = 0;
+    int res = -1;

     if (OPENSSL_s390xcex == -1 || OPENSSL_s390xcex_nodev)
-        return 0;
+        return -1;
     size = BN_num_bytes(m);
-    buffer = OPENSSL_zalloc(4 * size);
+    buffer = OPENSSL_calloc(size, 4);
     if (buffer == NULL)
         return 0;
     me.inputdata = buffer;
@@ -42,11 +46,15 @@ static int s390x_mod_exp_hw(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
     me.n_modulus = buffer + 3 * size;
     if (BN_bn2binpad(a, me.inputdata, size) == -1
         || BN_bn2binpad(p, me.b_key, size) == -1
-        || BN_bn2binpad(m, me.n_modulus, size) == -1)
+        || BN_bn2binpad(m, me.n_modulus, size) == -1) {
+        res = 0;
         goto dealloc;
+    }
     if (ioctl(OPENSSL_s390xcex, ICARSAMODEXPO, &me) != -1) {
         if (BN_bin2bn(me.outputdata, size, r) != NULL)
             res = 1;
+        else
+            res = 0;
     } else if (errno == EBADF || errno == ENOTTY) {
         /*
          * In this cases, someone (e.g. a sandbox) closed the fd.
@@ -71,27 +79,34 @@ dealloc:
 int s390x_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
     const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
 {
-    if (s390x_mod_exp_hw(r, a, p, m) == 1)
-        return 1;
-    return BN_mod_exp_mont(r, a, p, m, ctx, m_ctx);
+    int rc;
+
+    rc = s390x_mod_exp_hw(r, a, p, m);
+    if (rc < 0)
+        return BN_mod_exp_mont(r, a, p, m, ctx, m_ctx);
+    return rc;
 }

+/*
+ * Returns 1 for success, 0 for failure, and -1 to tell the caller to use the
+ * SW-fallback.
+ */
 int s390x_crt(BIGNUM *r, const BIGNUM *i, const BIGNUM *p, const BIGNUM *q,
     const BIGNUM *dmp, const BIGNUM *dmq, const BIGNUM *iqmp)
 {
     struct ica_rsa_modexpo_crt crt;
     unsigned char *buffer, *part;
     size_t size, plen, qlen;
-    int res = 0;
+    int res = -1;

     if (OPENSSL_s390xcex == -1 || OPENSSL_s390xcex_nodev)
-        return 0;
+        return -1;
     /*-
      * Hardware-accelerated CRT can only deal with p>q.  Fall back to
      * software in the (hopefully rare) other cases.
      */
     if (BN_ucmp(p, q) != 1)
-        return 0;
+        return -1;
     plen = BN_num_bytes(p);
     qlen = BN_num_bytes(q);
     size = (plen > qlen ? plen : qlen);
@@ -119,11 +134,15 @@ int s390x_crt(BIGNUM *r, const BIGNUM *i, const BIGNUM *p, const BIGNUM *q,
         || BN_bn2binpad(q, crt.nq_prime, size) == -1
         || BN_bn2binpad(dmp, crt.bp_key, size + 8) == -1
         || BN_bn2binpad(dmq, crt.bq_key, size) == -1
-        || BN_bn2binpad(iqmp, crt.u_mult_inv, size + 8) == -1)
+        || BN_bn2binpad(iqmp, crt.u_mult_inv, size + 8) == -1) {
+        res = 0;
         goto dealloc;
+    }
     if (ioctl(OPENSSL_s390xcex, ICARSACRT, &crt) != -1) {
         if (BN_bin2bn(crt.outputdata, crt.outputdatalength, r) != NULL)
             res = 1;
+        else
+            res = 0;
     } else if (errno == EBADF || errno == ENOTTY) {
         /*
          * In this cases, someone (e.g. a sandbox) closed the fd.
diff --git a/deps/openssl/openssl/crypto/bn/bn_shift.c b/deps/openssl/openssl/crypto/bn/bn_shift.c
index 577b7bc5b08..1ba635096e2 100644
--- a/deps/openssl/openssl/crypto/bn/bn_shift.c
+++ b/deps/openssl/openssl/crypto/bn/bn_shift.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -37,7 +37,7 @@ int BN_lshift1(BIGNUM *r, const BIGNUM *a)
         c = t >> (BN_BITS2 - 1);
     }
     *rp = c;
-    r->top += c;
+    r->top += (int)c;
     bn_check_top(r);
     return 1;
 }
diff --git a/deps/openssl/openssl/crypto/bn/bn_sparc.c b/deps/openssl/openssl/crypto/bn/bn_sparc.c
index 7c902191d77..48bafb5883c 100644
--- a/deps/openssl/openssl/crypto/bn/bn_sparc.c
+++ b/deps/openssl/openssl/crypto/bn/bn_sparc.c
@@ -10,7 +10,7 @@
 #include <stdlib.h>
 #include <openssl/bn.h>
 #include "internal/cryptlib.h"
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"
 #include "bn_local.h" /* for definition of bn_mul_mont */

 int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
diff --git a/deps/openssl/openssl/crypto/bn/bn_sqr.c b/deps/openssl/openssl/crypto/bn/bn_sqr.c
index 34b33a30a3b..807577bae50 100644
--- a/deps/openssl/openssl/crypto/bn/bn_sqr.c
+++ b/deps/openssl/openssl/crypto/bn/bn_sqr.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -50,21 +50,25 @@ int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
         goto err;

     if (al == 4) {
-#ifndef BN_SQR_COMBA
+#ifdef OPENSSL_SMALL_FOOTPRINT
         BN_ULONG t[8];
         bn_sqr_normal(rr->d, a->d, 4, t);
 #else
         bn_sqr_comba4(rr->d, a->d);
 #endif
     } else if (al == 8) {
-#ifndef BN_SQR_COMBA
+#ifdef OPENSSL_SMALL_FOOTPRINT
         BN_ULONG t[16];
         bn_sqr_normal(rr->d, a->d, 8, t);
 #else
         bn_sqr_comba8(rr->d, a->d);
 #endif
     } else {
-#if defined(BN_RECURSION)
+#ifdef OPENSSL_SMALL_FOOTPRINT
+        if (bn_wexpand(tmp, max) == NULL)
+            goto err;
+        bn_sqr_normal(rr->d, a->d, al, tmp->d);
+#else
         if (al < BN_SQR_RECURSIVE_SIZE_NORMAL) {
             BN_ULONG t[BN_SQR_RECURSIVE_SIZE_NORMAL * 2];
             bn_sqr_normal(rr->d, a->d, al, t);
@@ -84,10 +88,6 @@ int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
                 bn_sqr_normal(rr->d, a->d, al, tmp->d);
             }
         }
-#else
-        if (bn_wexpand(tmp, max) == NULL)
-            goto err;
-        bn_sqr_normal(rr->d, a->d, al, tmp->d);
 #endif
     }

@@ -141,7 +141,7 @@ void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
     bn_add_words(r, r, tmp, max);
 }

-#ifdef BN_RECURSION
+#ifndef OPENSSL_SMALL_FOOTPRINT
 /*-
  * r is 2*n words in size,
  * a and b are both n words in size.    (There's not actually a 'b' here ...)
@@ -160,18 +160,10 @@ void bn_sqr_recursive(BN_ULONG *r, const BN_ULONG *a, int n2, BN_ULONG *t)
     BN_ULONG ln, lo, *p;

     if (n2 == 4) {
-#ifndef BN_SQR_COMBA
-        bn_sqr_normal(r, a, 4, t);
-#else
         bn_sqr_comba4(r, a);
-#endif
         return;
     } else if (n2 == 8) {
-#ifndef BN_SQR_COMBA
-        bn_sqr_normal(r, a, 8, t);
-#else
         bn_sqr_comba8(r, a);
-#endif
         return;
     }
     if (n2 < BN_SQR_RECURSIVE_SIZE_NORMAL) {
diff --git a/deps/openssl/openssl/crypto/bn/bn_sqrt.c b/deps/openssl/openssl/crypto/bn/bn_sqrt.c
index 4b4bc7d5d11..5f8f8e4e894 100644
--- a/deps/openssl/openssl/crypto/bn/bn_sqrt.c
+++ b/deps/openssl/openssl/crypto/bn/bn_sqrt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -160,7 +160,7 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
         if (!BN_mod_mul(x, x, t, p, ctx))
             goto end;

-        if (!BN_copy(ret, x))
+        if (BN_copy(ret, x) == NULL)
             goto end;
         err = 0;
         goto vrfy;
@@ -170,7 +170,7 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
      * e > 2, so we really have to use the Tonelli/Shanks algorithm. First,
      * find some y that is not a square.
      */
-    if (!BN_copy(q, p))
+    if (BN_copy(q, p) == NULL)
         goto end; /* use 'q' as temp */
     q->neg = 0;
     i = 2;
@@ -297,7 +297,7 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
          */

         if (BN_is_one(b)) {
-            if (!BN_copy(ret, x))
+            if (BN_copy(ret, x) == NULL)
                 goto end;
             err = 0;
             goto vrfy;
@@ -323,7 +323,7 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
         }

         /* t := y^2^(e - i - 1) */
-        if (!BN_copy(t, y))
+        if (BN_copy(t, y) == NULL)
             goto end;
         for (j = e - i - 1; j > 0; j--) {
             if (!BN_mod_sqr(t, t, p, ctx))
diff --git a/deps/openssl/openssl/crypto/bn/bn_x931p.c b/deps/openssl/openssl/crypto/bn/bn_x931p.c
index 2a86f7391b1..7eb62957740 100644
--- a/deps/openssl/openssl/crypto/bn/bn_x931p.c
+++ b/deps/openssl/openssl/crypto/bn/bn_x931p.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -24,7 +24,7 @@ static int bn_x931_derive_pi(BIGNUM *pi, const BIGNUM *Xpi, BN_CTX *ctx,
     BN_GENCB *cb)
 {
     int i = 0, is_prime;
-    if (!BN_copy(pi, Xpi))
+    if (BN_copy(pi, Xpi) == NULL)
         return 0;
     if (!BN_is_odd(pi) && !BN_add_word(pi, 1))
         return 0;
@@ -121,7 +121,7 @@ int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
     for (;;) {
         int i = 1;
         BN_GENCB_call(cb, 0, i++);
-        if (!BN_copy(pm1, p))
+        if (BN_copy(pm1, p) == NULL)
             goto err;
         if (!BN_sub_word(pm1, 1))
             goto err;
diff --git a/deps/openssl/openssl/crypto/bn/build.info b/deps/openssl/openssl/crypto/bn/build.info
index a82271136cb..691fd514d8b 100644
--- a/deps/openssl/openssl/crypto/bn/build.info
+++ b/deps/openssl/openssl/crypto/bn/build.info
@@ -73,6 +73,9 @@ IF[{- !$disabled{asm} -}]
   $BNASM_aarch64=bn_asm.c armv8-mont.S
   $BNDEF_aarch64=OPENSSL_BN_ASM_MONT

+  $BNASM_riscv64=bn_asm.c riscv64-mont.S
+  $BNDEF_riscv64=OPENSSL_BN_ASM_MONT
+
   $BNASM_parisc11=bn_asm.c parisc-mont.s
   $BNDEF_parisc11=OPENSSL_BN_ASM_MONT
   $BNASM_parisc20_64=$BNASM_parisc11
@@ -87,6 +90,13 @@ IF[{- !$disabled{asm} -}]
   $BNASM_c64xplus_ec2m=c64xplus-gf2m.s
   $BNDEF_c64xplus_ec2m=OPENSSL_BN_ASM_GF2m

+  $BNASM_e2k=asm/e2k-bn-asm.c
+  $BNDEF_e2k=OPENSSL_BN_ASM_MONT
+  $BNASM_e2kv6=asm/e2kv6-gf2m.c $BNASM_e2k
+  $BNDEF_e2kv6=OPENSSL_BN_ASM_GF2m $BNDEF_e2k
+  $BNASM_e2kv7=asm/e2kv6-gf2m.c $BNASM_e2k
+  $BNDEF_e2kv7=OPENSSL_BN_ASM_GF2m $BNDEF_e2k
+
   # Now that we have defined all the arch specific variables, use the
   # appropriate ones, and define the appropriate macros
   IF[$BNASM_{- $target{asm_arch} -}]
@@ -106,7 +116,7 @@ $COMMON=bn_add.c bn_div.c bn_exp.c bn_lib.c bn_ctx.c bn_mul.c \
         bn_mod.c bn_conv.c bn_rand.c bn_shift.c bn_word.c bn_blind.c \
         bn_kron.c bn_sqrt.c bn_gcd.c bn_prime.c bn_sqr.c \
         bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c \
-        bn_intern.c bn_dh.c bn_rsa_fips186_4.c bn_const.c
+        bn_intern.c bn_dh.c bn_rsa_fips186_5.c bn_const.c
 SOURCE[../../libcrypto]=$COMMON $BNASM bn_print.c bn_err.c bn_srp.c
 DEFINE[../../libcrypto]=$BNDEF
 IF[{- !$disabled{'deprecated-0.9.8'} -}]
@@ -182,3 +192,9 @@ GENERATE[armv4-gf2m.S]=asm/armv4-gf2m.pl
 INCLUDE[armv4-gf2m.o]=..
 GENERATE[armv8-mont.S]=asm/armv8-mont.pl
 INCLUDE[armv8-mont.o]=..
+GENERATE[riscv64-mont.S]=asm/riscv64-mont.pl
+INCLUDE[riscv64-mont.o]=..
+
+DEPEND[bn_prime.o]=bn_prime.h
+GENERATE[bn_prime.h]=bn_prime.pl
+INCLUDE[bn_prime.o]=.
diff --git a/deps/openssl/openssl/crypto/bn/rsaz_exp.h b/deps/openssl/openssl/crypto/bn/rsaz_exp.h
index b3510c0a66e..65b66be0d35 100644
--- a/deps/openssl/openssl/crypto/bn/rsaz_exp.h
+++ b/deps/openssl/openssl/crypto/bn/rsaz_exp.h
@@ -60,7 +60,7 @@ static ossl_inline void bn_select_words(BN_ULONG *r, BN_ULONG mask,
     size_t i;

     for (i = 0; i < num; i++) {
-        r[i] = constant_time_select_64(mask, a[i], b[i]);
+        r[i] = constant_time_select_bn(mask, a[i], b[i]);
     }
 }

@@ -69,7 +69,7 @@ static ossl_inline BN_ULONG bn_reduce_once_in_place(BN_ULONG *r,
     const BN_ULONG *m,
     BN_ULONG *tmp, size_t num)
 {
-    carry -= bn_sub_words(tmp, r, m, num);
+    carry -= bn_sub_words(tmp, r, m, (int)num);
     bn_select_words(r, carry, r /* tmp < 0 */, tmp /* tmp >= 0 */, num);
     return carry;
 }
diff --git a/deps/openssl/openssl/crypto/bn/rsaz_exp_x2.c b/deps/openssl/openssl/crypto/bn/rsaz_exp_x2.c
index 70adf2294d0..b9368fc045b 100644
--- a/deps/openssl/openssl/crypto/bn/rsaz_exp_x2.c
+++ b/deps/openssl/openssl/crypto/bn/rsaz_exp_x2.c
@@ -155,7 +155,7 @@ static DAMM ossl_rsaz_amm52_x2[] = {
 typedef void (*DEXTRACT)(BN_ULONG *res, const BN_ULONG *red_table,
     int red_table_idx, int tbl_idx);

-static DEXTRACT ossl_extract_multiplier_win5[] = {
+static const DEXTRACT ossl_extract_multiplier_win5[] = {
     ossl_extract_multiplier_2x20_win5_avx,
     ossl_extract_multiplier_2x20_win5,
     ossl_extract_multiplier_2x30_win5_avx,
diff --git a/deps/openssl/openssl/crypto/bsearch.c b/deps/openssl/openssl/crypto/bsearch.c
index c2ab0b81259..201bc6e5f3e 100644
--- a/deps/openssl/openssl/crypto/bsearch.c
+++ b/deps/openssl/openssl/crypto/bsearch.c
@@ -10,8 +10,10 @@
 #include <stddef.h>
 #include "internal/cryptlib.h"

+typedef int (*cmpthunk_fn)(const void *, const void *);
 const void *ossl_bsearch(const void *key, const void *base, int num,
     int size, int (*cmp)(const void *, const void *),
+    int (*cmp_thunk)(cmpthunk_fn real_cmp_fn, const void *, const void *),
     int flags)
 {
     const char *base_ = base;
@@ -25,7 +27,10 @@ const void *ossl_bsearch(const void *key, const void *base, int num,
     while (l < h) {
         i = l + (h - l) / 2;
         p = &(base_[i * size]);
-        c = (*cmp)(key, p);
+        if (cmp_thunk != NULL)
+            c = cmp_thunk((cmpthunk_fn)cmp, key, (const void *)p);
+        else
+            c = cmp(key, p);
         if (c < 0)
             h = i;
         else if (c > 0)
@@ -36,8 +41,16 @@ const void *ossl_bsearch(const void *key, const void *base, int num,
     if (c != 0 && !(flags & OSSL_BSEARCH_VALUE_ON_NOMATCH))
         p = NULL;
     else if (c == 0 && (flags & OSSL_BSEARCH_FIRST_VALUE_ON_MATCH)) {
-        while (i > 0 && (*cmp)(key, &(base_[(i - 1) * size])) == 0)
+        while (i > 0) {
+            if (cmp_thunk != NULL) {
+                if (cmp_thunk((cmpthunk_fn)cmp, key, (const void *)&(base_[(i - 1) * size])))
+                    break;
+            } else {
+                if (cmp(key, &(base_[(i - 1) * size])))
+                    break;
+            }
             i--;
+        }
         p = &(base_[i * size]);
     }
     return p;
diff --git a/deps/openssl/openssl/crypto/buffer/buf_err.c b/deps/openssl/openssl/crypto/buffer/buf_err.c
deleted file mode 100644
index 32209c08298..00000000000
--- a/deps/openssl/openssl/crypto/buffer/buf_err.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/buffererr.h>
-#include "crypto/buffererr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA BUF_str_reasons[] = {
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_BUF_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(BUF_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(BUF_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/build.info b/deps/openssl/openssl/crypto/build.info
index 058bcc5c304..422f4aaf9c0 100644
--- a/deps/openssl/openssl/crypto/build.info
+++ b/deps/openssl/openssl/crypto/build.info
@@ -4,9 +4,9 @@ SUBDIRS=objects buffer bio stack lhash hashtable rand evp asn1 pem x509 conf \
         txt_db pkcs7 pkcs12 ui kdf store property \
         md2 md4 md5 sha mdc2 ml_kem hmac ripemd whrlpool poly1305 \
         siphash sm3 des aes rc2 rc4 rc5 idea aria bf cast camellia \
-        seed sm4 chacha modes bn ec rsa dsa dh sm2 dso engine \
+        seed sm4 chacha modes bn ec rsa dsa dh sm2 dso \
         err comp http ocsp cms ts srp cmac ct async ess crmf cmp encode_decode \
-        ffc hpke thread ml_dsa slh_dsa rbtree
+        ffc hpke thread lms ml_dsa slh_dsa rbtree

 LIBS=../libcrypto

@@ -16,7 +16,6 @@ IF[{- !$disabled{uplink} -}]
   $UPLINKSRC_common=../ms/uplink.c
   $UPLINKSRC_x86=$UPLINKSRC_common uplink-x86.S
   $UPLINKSRC_x86_64=$UPLINKSRC_common uplink-x86_64.s
-  $UPLINKSRC_ia64=$UPLINKSRC_common uplink-ia64.s

   IF[$UPLINKSRC_{- $target{uplink_arch} -}]
     $UPLINKSRC=$UPLINKSRC_{- $target{uplink_arch} -}
@@ -67,7 +66,6 @@ ENDIF
 # provider module that uses it.  ctype.c is included here because the CPUID
 # uses functions from there to parse magic environment variables.
 $CPUID_COMMON=$CPUIDASM cpuid.c ctype.c
-INCLUDE[cpuid.o]=..

 SOURCE[../libcrypto]=$CPUID_COMMON
 DEFINE[../libcrypto]=$CPUIDDEF
@@ -97,16 +95,16 @@ SOURCE[../providers/libfips.a]=$CORE_COMMON
 # Central utilities
 $UTIL_COMMON=\
         cryptlib.c params.c params_from_text.c bsearch.c ex_data.c o_str.c \
-        threads_pthread.c threads_win.c threads_none.c initthread.c \
-        context.c sparse_array.c asn1_dsa.c packet.c param_build.c \
-        param_build_set.c der_writer.c threads_lib.c params_dup.c \
-        time.c params_idx.c
+        threads_pthread.c threads_win.c threads_none.c threads_common.c \
+        initthread.c context.c sparse_array.c asn1_dsa.c packet.c \
+        param_build.c param_build_set.c der_writer.c threads_lib.c \
+        params_dup.c time.c array_alloc.c aligned_alloc.c deterministic_nonce.c

 SOURCE[../libcrypto]=$UTIL_COMMON \
         mem.c mem_sec.c \
-        comp_methods.c cversion.c info.c cpt_err.c ebcdic.c uid.c o_time.c \
+        comp_methods.c cversion.c info.c cpt_err.c ebcdic.c uid.c \
         o_dir.c o_fopen.c getenv.c o_init.c init.c trace.c provider.c \
-        provider_child.c punycode.c passphrase.c sleep.c deterministic_nonce.c \
+        provider_child.c punycode.c passphrase.c sleep.c \
         quic_vlint.c time.c defaults.c ssl_err.c
 SOURCE[../providers/libfips.a]=$UTIL_COMMON

@@ -119,7 +117,6 @@ GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "

 GENERATE[uplink-x86.S]=../ms/uplink-x86.pl
 GENERATE[uplink-x86_64.s]=../ms/uplink-x86_64.pl
-GENERATE[uplink-ia64.s]=../ms/uplink-ia64.pl

 GENERATE[x86cpuid.S]=x86cpuid.pl
 DEPEND[x86cpuid.s]=perlasm/x86asm.pl
@@ -143,3 +140,9 @@ GENERATE[loongarch64cpuid.s]=loongarch64cpuid.pl
 IF[{- $config{target} =~ /^(?:Cygwin|mingw|VC-|BC-)/ -}]
   SHARED_SOURCE[../libcrypto]=dllmain.c
 ENDIF
+
+INCLUDE[init.o]=.
+
+IF[{- $target{needs_c99_snprintf_compat} -}]
+  SOURCE[../libcrypto]=msvc2013_snprintf.c
+ENDIF
diff --git a/deps/openssl/openssl/crypto/c64xpluscpuid.pl b/deps/openssl/openssl/crypto/c64xpluscpuid.pl
index 20728c03bc6..aad396d5613 100644
--- a/deps/openssl/openssl/crypto/c64xpluscpuid.pl
+++ b/deps/openssl/openssl/crypto/c64xpluscpuid.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2012-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2012-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -20,7 +20,6 @@ $code.=<<___;
 	.asg	OPENSSL_cleanse,_OPENSSL_cleanse
 	.asg	CRYPTO_memcmp,_CRYPTO_memcmp
 	.asg	OPENSSL_atomic_add,_OPENSSL_atomic_add
-	.asg	OPENSSL_wipe_cpu,_OPENSSL_wipe_cpu
 	.asg	OPENSSL_instrument_bus,_OPENSSL_instrument_bus
 	.asg	OPENSSL_instrument_bus2,_OPENSSL_instrument_bus2
 	.endif
diff --git a/deps/openssl/openssl/crypto/camellia/asm/cmll-x86.pl b/deps/openssl/openssl/crypto/camellia/asm/cmll-x86.pl
index 284d31ca943..4db2911b07b 100644
--- a/deps/openssl/openssl/crypto/camellia/asm/cmll-x86.pl
+++ b/deps/openssl/openssl/crypto/camellia/asm/cmll-x86.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2008-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,14 +8,13 @@


 # ====================================================================
-# Copyright (c) 2008 Andy Polyakov <appro@openssl.org>
+# Copyright (c) 2008 Andy Polyakov <https://github.com/dot-asm>
 #
 # This module may be used under the terms of either the GNU General
 # Public License version 2 or later, the GNU Lesser General Public
 # License version 2.1 or later, the Mozilla Public License version
 # 1.1 or the BSD License. The exact terms of either license are
-# distributed along with this module. For further details see
-# http://www.openssl.org/~appro/camellia/.
+# distributed along with this module.
 # ====================================================================

 # Performance in cycles per processed byte (less is better) in
@@ -550,7 +549,7 @@ my $bias=int(@T[0])?shift(@T):0;
 }

 # void Camellia_Ekeygen(
-#		const int keyBitLength,
+#		int keyBitLength,
 #		const Byte *rawKey,
 #		KEY_TABLE_TYPE keyTable)
 &function_begin("Camellia_Ekeygen");
@@ -808,7 +807,7 @@ for ($i=0;$i<256;$i++) { &data_word(&S0222($i),&S3033($i)); }

 # void Camellia_cbc_encrypt (const void char *inp, unsigned char *out,
 #			size_t length, const CAMELLIA_KEY *key,
-#			unsigned char *ivp,const int enc);
+#			unsigned char *ivp, int enc);
 {
 # stack frame layout
 #             -4(%esp)		# return address	 0(%esp)
@@ -1142,7 +1141,7 @@ my ($s0,$s1,$s2,$s3) = @T;
 &function_end("Camellia_cbc_encrypt");
 }

-&asciz("Camellia for x86 by <appro\@openssl.org>");
+&asciz("Camellia for x86 by <https://github.com/dot-asm>");

 &asm_finish();

diff --git a/deps/openssl/openssl/crypto/camellia/asm/cmll-x86_64.pl b/deps/openssl/openssl/crypto/camellia/asm/cmll-x86_64.pl
index 43023a6986b..30cecff700b 100644
--- a/deps/openssl/openssl/crypto/camellia/asm/cmll-x86_64.pl
+++ b/deps/openssl/openssl/crypto/camellia/asm/cmll-x86_64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2008-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2008-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,14 +8,13 @@


 # ====================================================================
-# Copyright (c) 2008 Andy Polyakov <appro@openssl.org>
+# Copyright (c) 2008 Andy Polyakov <https://github.com/dot-asm>
 #
 # This module may be used under the terms of either the GNU General
 # Public License version 2 or later, the GNU Lesser General Public
 # License version 2.1 or later, the Mozilla Public License version
 # 1.1 or the BSD License. The exact terms of either license are
-# distributed along with this module. For further details see
-# http://www.openssl.org/~appro/camellia/.
+# distributed along with this module.
 # ====================================================================

 # Performance in cycles per processed byte (less is better) in
@@ -937,7 +936,7 @@ Camellia_cbc_encrypt:
 .cfi_endproc
 .size	Camellia_cbc_encrypt,.-Camellia_cbc_encrypt

-.asciz	"Camellia for x86_64 by <appro\@openssl.org>"
+.asciz	"Camellia for x86_64 by <https://github.com/dot-asm>"
 ___
 }

diff --git a/deps/openssl/openssl/crypto/camellia/asm/cmllt4-sparcv9.pl b/deps/openssl/openssl/crypto/camellia/asm/cmllt4-sparcv9.pl
index 86e38d65c47..8a892c573ee 100644
--- a/deps/openssl/openssl/crypto/camellia/asm/cmllt4-sparcv9.pl
+++ b/deps/openssl/openssl/crypto/camellia/asm/cmllt4-sparcv9.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2012-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2012-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -69,7 +69,7 @@ $code=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 .text

diff --git a/deps/openssl/openssl/crypto/camellia/camellia.c b/deps/openssl/openssl/crypto/camellia/camellia.c
index cd9521a019f..efe5d78899f 100644
--- a/deps/openssl/openssl/crypto/camellia/camellia.c
+++ b/deps/openssl/openssl/crypto/camellia/camellia.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -53,15 +53,15 @@
 #define RightRotate(x, s) (((x) >> (s)) + ((x) << (32 - s)))
 #define LeftRotate(x, s) (((x) << (s)) + ((x) >> (32 - s)))

-#define GETU32(p) (((u32)(p)[0] << 24) ^ ((u32)(p)[1] << 16) ^ ((u32)(p)[2] << 8) ^ ((u32)(p)[3]))
-#define PUTU32(p, v) ((p)[0] = (u8)((v) >> 24), (p)[1] = (u8)((v) >> 16), (p)[2] = (u8)((v) >> 8), (p)[3] = (u8)(v))
+#define GETU32(p) (((uint32_t)(p)[0] << 24) ^ ((uint32_t)(p)[1] << 16) ^ ((uint32_t)(p)[2] << 8) ^ ((uint32_t)(p)[3]))
+#define PUTU32(p, v) ((p)[0] = (uint8_t)((v) >> 24), (p)[1] = (uint8_t)((v) >> 16), (p)[2] = (uint8_t)((v) >> 8), (p)[3] = (uint8_t)(v))

 /* S-box data */
 #define SBOX1_1110 Camellia_SBOX[0]
 #define SBOX4_4404 Camellia_SBOX[1]
 #define SBOX2_0222 Camellia_SBOX[2]
 #define SBOX3_3033 Camellia_SBOX[3]
-static const u32 Camellia_SBOX[][256] = {
+static const uint32_t Camellia_SBOX[][256] = {
     { 0x70707000, 0x82828200, 0x2c2c2c00, 0xececec00, 0xb3b3b300, 0x27272700,
         0xc0c0c000, 0xe5e5e500, 0xe4e4e400, 0x85858500, 0x57575700, 0x35353500,
         0xeaeaea00, 0x0c0c0c00, 0xaeaeae00, 0x41414100, 0x23232300, 0xefefef00,
@@ -237,7 +237,7 @@ static const u32 Camellia_SBOX[][256] = {
 };

 /* Key generation constants */
-static const u32 SIGMA[] = {
+static const uint32_t SIGMA[] = {
     0xa09e667f, 0x3bcc908b, 0xb67ae858, 0x4caa73b2, 0xc6ef372f, 0xe94f82be,
     0x54ff53a5, 0xf1d36f1c, 0x10e527fa, 0xde682d1d, 0xb05688c2, 0xb3e6c1fd
 };
@@ -252,7 +252,7 @@ static const u32 SIGMA[] = {
  */
 #define Camellia_Feistel(_s0, _s1, _s2, _s3, _key) \
     do {                                           \
-        register u32 _t0, _t1, _t2, _t3;           \
+        register uint32_t _t0, _t1, _t2, _t3;      \
                                                    \
         _t0 = _s0 ^ (_key)[0];                     \
         _t3 = SBOX4_4404[_t0 & 0xff];              \
@@ -278,16 +278,16 @@ static const u32 SIGMA[] = {
  */
 #define RotLeft128(_s0, _s1, _s2, _s3, _n)      \
     do {                                        \
-        u32 _t0 = _s0 >> (32 - _n);             \
+        uint32_t _t0 = _s0 >> (32 - _n);        \
         _s0 = (_s0 << _n) | (_s1 >> (32 - _n)); \
         _s1 = (_s1 << _n) | (_s2 >> (32 - _n)); \
         _s2 = (_s2 << _n) | (_s3 >> (32 - _n)); \
         _s3 = (_s3 << _n) | _t0;                \
     } while (0)

-int Camellia_Ekeygen(int keyBitLength, const u8 *rawKey, KEY_TABLE_TYPE k)
+int Camellia_Ekeygen(int keyBitLength, const uint8_t *rawKey, KEY_TABLE_TYPE k)
 {
-    register u32 s0, s1, s2, s3;
+    register uint32_t s0, s1, s2, s3;

     k[0] = s0 = GETU32(rawKey);
     k[1] = s1 = GETU32(rawKey + 4);
@@ -402,12 +402,12 @@ int Camellia_Ekeygen(int keyBitLength, const u8 *rawKey, KEY_TABLE_TYPE k)
      */
 }

-void Camellia_EncryptBlock_Rounds(int grandRounds, const u8 plaintext[],
+void Camellia_EncryptBlock_Rounds(int grandRounds, const uint8_t plaintext[],
     const KEY_TABLE_TYPE keyTable,
-    u8 ciphertext[])
+    uint8_t ciphertext[])
 {
-    register u32 s0, s1, s2, s3;
-    const u32 *k = keyTable, *kend = keyTable + grandRounds * 16;
+    register uint32_t s0, s1, s2, s3;
+    const uint32_t *k = keyTable, *kend = keyTable + grandRounds * 16;

     s0 = GETU32(plaintext) ^ k[0];
     s1 = GETU32(plaintext + 4) ^ k[1];
@@ -448,19 +448,19 @@ void Camellia_EncryptBlock_Rounds(int grandRounds, const u8 plaintext[],
     PUTU32(ciphertext + 12, s1);
 }

-void Camellia_EncryptBlock(int keyBitLength, const u8 plaintext[],
-    const KEY_TABLE_TYPE keyTable, u8 ciphertext[])
+void Camellia_EncryptBlock(int keyBitLength, const uint8_t plaintext[],
+    const KEY_TABLE_TYPE keyTable, uint8_t ciphertext[])
 {
     Camellia_EncryptBlock_Rounds(keyBitLength == 128 ? 3 : 4,
         plaintext, keyTable, ciphertext);
 }

-void Camellia_DecryptBlock_Rounds(int grandRounds, const u8 ciphertext[],
+void Camellia_DecryptBlock_Rounds(int grandRounds, const uint8_t ciphertext[],
     const KEY_TABLE_TYPE keyTable,
-    u8 plaintext[])
+    uint8_t plaintext[])
 {
-    u32 s0, s1, s2, s3;
-    const u32 *k = keyTable + grandRounds * 16, *kend = keyTable + 4;
+    uint32_t s0, s1, s2, s3;
+    const uint32_t *k = keyTable + grandRounds * 16, *kend = keyTable + 4;

     s0 = GETU32(ciphertext) ^ k[0];
     s1 = GETU32(ciphertext + 4) ^ k[1];
@@ -501,8 +501,8 @@ void Camellia_DecryptBlock_Rounds(int grandRounds, const u8 ciphertext[],
     PUTU32(plaintext + 12, s1);
 }

-void Camellia_DecryptBlock(int keyBitLength, const u8 ciphertext[],
-    const KEY_TABLE_TYPE keyTable, u8 plaintext[])
+void Camellia_DecryptBlock(int keyBitLength, const uint8_t ciphertext[],
+    const KEY_TABLE_TYPE keyTable, uint8_t plaintext[])
 {
     Camellia_DecryptBlock_Rounds(keyBitLength == 128 ? 3 : 4,
         ciphertext, keyTable, plaintext);
diff --git a/deps/openssl/openssl/crypto/camellia/cmll_cbc.c b/deps/openssl/openssl/crypto/camellia/cmll_cbc.c
index 51d8310b48c..42324a3d86e 100644
--- a/deps/openssl/openssl/crypto/camellia/cmll_cbc.c
+++ b/deps/openssl/openssl/crypto/camellia/cmll_cbc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -18,7 +18,7 @@

 void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
     size_t len, const CAMELLIA_KEY *key,
-    unsigned char *ivec, const int enc)
+    unsigned char *ivec, int enc)
 {

     if (enc)
diff --git a/deps/openssl/openssl/crypto/camellia/cmll_cfb.c b/deps/openssl/openssl/crypto/camellia/cmll_cfb.c
index ea4ab67512b..693ff1a6ecb 100644
--- a/deps/openssl/openssl/crypto/camellia/cmll_cfb.c
+++ b/deps/openssl/openssl/crypto/camellia/cmll_cfb.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -24,7 +24,7 @@

 void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const CAMELLIA_KEY *key,
-    unsigned char *ivec, int *num, const int enc)
+    unsigned char *ivec, int *num, int enc)
 {

     CRYPTO_cfb128_encrypt(in, out, length, key, ivec, num, enc,
@@ -34,7 +34,7 @@ void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out,
 /* N.B. This expects the input to be packed, MS bit first */
 void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const CAMELLIA_KEY *key,
-    unsigned char *ivec, int *num, const int enc)
+    unsigned char *ivec, int *num, int enc)
 {
     CRYPTO_cfb128_1_encrypt(in, out, length, key, ivec, num, enc,
         (block128_f)Camellia_encrypt);
@@ -42,7 +42,7 @@ void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out,

 void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const CAMELLIA_KEY *key,
-    unsigned char *ivec, int *num, const int enc)
+    unsigned char *ivec, int *num, int enc)
 {
     CRYPTO_cfb128_8_encrypt(in, out, length, key, ivec, num, enc,
         (block128_f)Camellia_encrypt);
diff --git a/deps/openssl/openssl/crypto/camellia/cmll_ecb.c b/deps/openssl/openssl/crypto/camellia/cmll_ecb.c
index fddf7c7837e..2b2a02629bc 100644
--- a/deps/openssl/openssl/crypto/camellia/cmll_ecb.c
+++ b/deps/openssl/openssl/crypto/camellia/cmll_ecb.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,7 +17,7 @@
 #include "cmll_local.h"

 void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out,
-    const CAMELLIA_KEY *key, const int enc)
+    const CAMELLIA_KEY *key, int enc)
 {
     if (CAMELLIA_ENCRYPT == enc)
         Camellia_encrypt(in, out, key);
diff --git a/deps/openssl/openssl/crypto/camellia/cmll_local.h b/deps/openssl/openssl/crypto/camellia/cmll_local.h
index f585994ff9e..010bdf3d60b 100644
--- a/deps/openssl/openssl/crypto/camellia/cmll_local.h
+++ b/deps/openssl/openssl/crypto/camellia/cmll_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -25,19 +25,19 @@
 #ifndef OSSL_CRYPTO_CAMELLIA_CMLL_LOCAL_H
 #define OSSL_CRYPTO_CAMELLIA_CMLL_LOCAL_H

-typedef unsigned int u32;
-typedef unsigned char u8;
+#include <stdint.h>
+#include <openssl/camellia.h>

-int Camellia_Ekeygen(int keyBitLength, const u8 *rawKey,
+int Camellia_Ekeygen(int keyBitLength, const uint8_t *rawKey,
     KEY_TABLE_TYPE keyTable);
-void Camellia_EncryptBlock_Rounds(int grandRounds, const u8 plaintext[],
+void Camellia_EncryptBlock_Rounds(int grandRounds, const uint8_t plaintext[],
     const KEY_TABLE_TYPE keyTable,
-    u8 ciphertext[]);
-void Camellia_DecryptBlock_Rounds(int grandRounds, const u8 ciphertext[],
+    uint8_t ciphertext[]);
+void Camellia_DecryptBlock_Rounds(int grandRounds, const uint8_t ciphertext[],
     const KEY_TABLE_TYPE keyTable,
-    u8 plaintext[]);
-void Camellia_EncryptBlock(int keyBitLength, const u8 plaintext[],
-    const KEY_TABLE_TYPE keyTable, u8 ciphertext[]);
-void Camellia_DecryptBlock(int keyBitLength, const u8 ciphertext[],
-    const KEY_TABLE_TYPE keyTable, u8 plaintext[]);
+    uint8_t plaintext[]);
+void Camellia_EncryptBlock(int keyBitLength, const uint8_t plaintext[],
+    const KEY_TABLE_TYPE keyTable, uint8_t ciphertext[]);
+void Camellia_DecryptBlock(int keyBitLength, const uint8_t ciphertext[],
+    const KEY_TABLE_TYPE keyTable, uint8_t plaintext[]);
 #endif /* #ifndef OSSL_CRYPTO_CAMELLIA_CMLL_LOCAL_H */
diff --git a/deps/openssl/openssl/crypto/camellia/cmll_misc.c b/deps/openssl/openssl/crypto/camellia/cmll_misc.c
index 30db3a380c1..3b89fa2d83c 100644
--- a/deps/openssl/openssl/crypto/camellia/cmll_misc.c
+++ b/deps/openssl/openssl/crypto/camellia/cmll_misc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,7 +17,7 @@
 #include <openssl/camellia.h>
 #include "cmll_local.h"

-int Camellia_set_key(const unsigned char *userKey, const int bits,
+int Camellia_set_key(const unsigned char *userKey, int bits,
     CAMELLIA_KEY *key)
 {
     if (!userKey || !key)
diff --git a/deps/openssl/openssl/crypto/cast/cast_local.h b/deps/openssl/openssl/crypto/cast/cast_local.h
index f24b8bccdc0..192d718c3d9 100644
--- a/deps/openssl/openssl/crypto/cast/cast_local.h
+++ b/deps/openssl/openssl/crypto/cast/cast_local.h
@@ -1,91 +1,22 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
+#if !defined(OSSL_LIBCRYPTO_CAST_CAST_LOCAL_H)
+#define OSSL_LIBCRYPTO_CAST_CAST_LOCAL_H
+
+#include <openssl/cast.h>
+
+#include "internal/common.h"

 #ifdef OPENSSL_SYS_WIN32
 #include <stdlib.h>
 #endif

-/* NOTE - c is not incremented as per n2l */
-#define n2ln(c, l1, l2, n)                           \
-    {                                                \
-        c += n;                                      \
-        l1 = l2 = 0;                                 \
-        switch (n) {                                 \
-        case 8:                                      \
-            l2 = ((unsigned long)(*(--(c))));        \
-        /* fall through */                           \
-        case 7:                                      \
-            l2 |= ((unsigned long)(*(--(c)))) << 8;  \
-        /* fall through */                           \
-        case 6:                                      \
-            l2 |= ((unsigned long)(*(--(c)))) << 16; \
-        /* fall through */                           \
-        case 5:                                      \
-            l2 |= ((unsigned long)(*(--(c)))) << 24; \
-        /* fall through */                           \
-        case 4:                                      \
-            l1 = ((unsigned long)(*(--(c))));        \
-        /* fall through */                           \
-        case 3:                                      \
-            l1 |= ((unsigned long)(*(--(c)))) << 8;  \
-        /* fall through */                           \
-        case 2:                                      \
-            l1 |= ((unsigned long)(*(--(c)))) << 16; \
-        /* fall through */                           \
-        case 1:                                      \
-            l1 |= ((unsigned long)(*(--(c)))) << 24; \
-        }                                            \
-    }
-
-/* NOTE - c is not incremented as per l2n */
-#define l2nn(l1, l2, c, n)                                   \
-    {                                                        \
-        c += n;                                              \
-        switch (n) {                                         \
-        case 8:                                              \
-            *(--(c)) = (unsigned char)(((l2)) & 0xff);       \
-        /* fall through */                                   \
-        case 7:                                              \
-            *(--(c)) = (unsigned char)(((l2) >> 8) & 0xff);  \
-        /* fall through */                                   \
-        case 6:                                              \
-            *(--(c)) = (unsigned char)(((l2) >> 16) & 0xff); \
-        /* fall through */                                   \
-        case 5:                                              \
-            *(--(c)) = (unsigned char)(((l2) >> 24) & 0xff); \
-        /* fall through */                                   \
-        case 4:                                              \
-            *(--(c)) = (unsigned char)(((l1)) & 0xff);       \
-        /* fall through */                                   \
-        case 3:                                              \
-            *(--(c)) = (unsigned char)(((l1) >> 8) & 0xff);  \
-        /* fall through */                                   \
-        case 2:                                              \
-            *(--(c)) = (unsigned char)(((l1) >> 16) & 0xff); \
-        /* fall through */                                   \
-        case 1:                                              \
-            *(--(c)) = (unsigned char)(((l1) >> 24) & 0xff); \
-        }                                                    \
-    }
-
-#undef n2l
-#define n2l(c, l) (l = ((unsigned long)(*((c)++))) << 24L, \
-    l |= ((unsigned long)(*((c)++))) << 16L,               \
-    l |= ((unsigned long)(*((c)++))) << 8L,                \
-    l |= ((unsigned long)(*((c)++))))
-
-#undef l2n
-#define l2n(l, c) (*((c)++) = (unsigned char)(((l) >> 24L) & 0xff), \
-    *((c)++) = (unsigned char)(((l) >> 16L) & 0xff),                \
-    *((c)++) = (unsigned char)(((l) >> 8L) & 0xff),                 \
-    *((c)++) = (unsigned char)(((l)) & 0xff))
-
 #if defined(OPENSSL_SYS_WIN32) && defined(_MSC_VER)
 #define ROTL(a, n) (_lrotl(a, n))
 #else
@@ -166,3 +97,5 @@ extern const CAST_LONG CAST_S_table4[256];
 extern const CAST_LONG CAST_S_table5[256];
 extern const CAST_LONG CAST_S_table6[256];
 extern const CAST_LONG CAST_S_table7[256];
+
+#endif /* !defined(OSSL_LIBCRYPTO_CAST_CAST_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/cast/cast_s.h b/deps/openssl/openssl/crypto/cast/cast_s.h
index 5fc45eff8a4..e5abfeb6f2e 100644
--- a/deps/openssl/openssl/crypto/cast/cast_s.h
+++ b/deps/openssl/openssl/crypto/cast/cast_s.h
@@ -7,6 +7,11 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_CAST_CAST_S_H)
+#define OSSL_LIBCRYPTO_CAST_CAST_S_H
+
+#include <openssl/cast.h>
+
 const CAST_LONG CAST_S_table0[256] = {
     0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f, 0x9c004dd3, 0x6003e540, 0xcf9fc949,
     0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675, 0x6e63a0e0, 0x15c361d2, 0xc2e7661d, 0x22d4ff8e,
@@ -286,3 +291,5 @@ const CAST_LONG CAST_S_table7[256] = {
     0xe97625a5, 0x0614d1b7, 0x0e25244b, 0x0c768347, 0x589e8d82, 0x0d2059d1, 0xa466bb1e, 0xf8da0a82,
     0x04f19130, 0xba6e4ec0, 0x99265164, 0x1ee7230d, 0x50b2ad80, 0xeaee6801, 0x8db2a283, 0xea8bf59e
 };
+
+#endif /* !defined(OSSL_LIBCRYPTO_CAST_CAST_S_H) */
diff --git a/deps/openssl/openssl/crypto/chacha/asm/chacha-armv4.pl b/deps/openssl/openssl/crypto/chacha/asm/chacha-armv4.pl
index bb48b6eeb99..ee8fff32632 100755
--- a/deps/openssl/openssl/crypto/chacha/asm/chacha-armv4.pl
+++ b/deps/openssl/openssl/crypto/chacha/asm/chacha-armv4.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # December 2014
@@ -171,7 +171,7 @@ my @ret;
 }

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 #if defined(__thumb2__) || defined(__clang__)
 .syntax	unified
diff --git a/deps/openssl/openssl/crypto/chacha/asm/chacha-armv8-sve.pl b/deps/openssl/openssl/crypto/chacha/asm/chacha-armv8-sve.pl
index 62a8be6fe12..44c3b8d462d 100755
--- a/deps/openssl/openssl/crypto/chacha/asm/chacha-armv8-sve.pl
+++ b/deps/openssl/openssl/crypto/chacha/asm/chacha-armv8-sve.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2022-2025  The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2022-2026  The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -724,7 +724,7 @@ ___
 	my ($sve2flag) = ("x7");

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 .arch   armv8-a

@@ -756,7 +756,7 @@ ChaCha20_ctr32_sve:
 	mov	$sve2flag,0
 	adrp	$tmp,OPENSSL_armcap_P
 	ldr	$tmpw,[$tmp,#:lo12:OPENSSL_armcap_P]
-	tst	$tmpw,#ARMV8_SVE2
+	tst	$tmpw,#ARMV9_SVE2
 	b.eq	1f
 	mov	$sve2flag,1
 	b	2f
diff --git a/deps/openssl/openssl/crypto/chacha/asm/chacha-armv8.pl b/deps/openssl/openssl/crypto/chacha/asm/chacha-armv8.pl
index 8ed2a1a3264..05917805f33 100755
--- a/deps/openssl/openssl/crypto/chacha/asm/chacha-armv8.pl
+++ b/deps/openssl/openssl/crypto/chacha/asm/chacha-armv8.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # June 2015
@@ -132,7 +132,7 @@ my ($a3,$b3,$c3,$d3)=map(($_&~3)+(($_+1)&3),($a2,$b2,$c2,$d2));
 }

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"
 #ifndef	__KERNEL__
 .extern	OPENSSL_armcap_P
 .hidden	OPENSSL_armcap_P
diff --git a/deps/openssl/openssl/crypto/chacha/asm/chacha-c64xplus.pl b/deps/openssl/openssl/crypto/chacha/asm/chacha-c64xplus.pl
index a10f7c0aff3..7a4d59430d9 100755
--- a/deps/openssl/openssl/crypto/chacha/asm/chacha-c64xplus.pl
+++ b/deps/openssl/openssl/crypto/chacha/asm/chacha-c64xplus.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # ChaCha20 for C64x+.
@@ -917,7 +917,7 @@ $code.=<<___;
 	.endasmfunc

 	.sect	.const
-	.cstring "ChaCha20 for C64x+, CRYPTOGAMS by <appro\@openssl.org>"
+	.cstring "ChaCha20 for C64x+, CRYPTOGAMS by <https://github.com/dot-asm>"
 	.align	4
 ___

diff --git a/deps/openssl/openssl/crypto/chacha/asm/chacha-loongarch64.pl b/deps/openssl/openssl/crypto/chacha/asm/chacha-loongarch64.pl
index d608c909a6f..658c421b33a 100644
--- a/deps/openssl/openssl/crypto/chacha/asm/chacha-loongarch64.pl
+++ b/deps/openssl/openssl/crypto/chacha/asm/chacha-loongarch64.pl
@@ -1,6 +1,6 @@
 #! /usr/bin/env perl
 # Author: Min Zhou <zhoumin@loongson.cn>
-# Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -12,10 +12,10 @@ use strict;
 my $code;

 # Here is the scalar register layout for LoongArch.
-my ($zero,$ra,$tp,$sp,$fp)=map("\$r$_",(0..3,22));
-my ($a0,$a1,$a2,$a3,$a4,$a5,$a6,$a7)=map("\$r$_",(4..11));
-my ($t0,$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$x)=map("\$r$_",(12..21));
-my ($s0,$s1,$s2,$s3,$s4,$s5,$s6,$s7,$s8)=map("\$r$_",(23..31));
+my ($zero,$ra,$tp,$sp,$fp)=("\$zero", "\$ra", "\$tp", "\$sp", "\$fp");
+my ($a0,$a1,$a2,$a3,$a4,$a5,$a6,$a7)=map("\$a$_",(0..7));
+my ($t0,$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8)=map("\$t$_",(0..8));
+my ($s0,$s1,$s2,$s3,$s4,$s5,$s6,$s7,$s8)=map("\$s$_",(0..8));

 # The saved floating-point registers in the LP64D ABI.  In LoongArch
 # with vector extension, the low 64 bits of a vector register alias with
@@ -46,7 +46,7 @@ open STDOUT,">$output";
 my ($out, $inp, $len, $key, $counter) = ($a0, $a1, $a2, $a3, $a4);

 $code .= <<EOF;
-#include "loongarch_arch.h"
+#include "arch/loongarch_arch.h"

 .text

diff --git a/deps/openssl/openssl/crypto/chacha/asm/chacha-ppc.pl b/deps/openssl/openssl/crypto/chacha/asm/chacha-ppc.pl
index 60982dddb21..94539aa7026 100755
--- a/deps/openssl/openssl/crypto/chacha/asm/chacha-ppc.pl
+++ b/deps/openssl/openssl/crypto/chacha/asm/chacha-ppc.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # October 2015
@@ -1323,7 +1323,7 @@ $code.=<<___;
 	.long	0x79622d32,0x79622d32,0x79622d32,0x79622d32
 	.long	0x6b206574,0x6b206574,0x6b206574,0x6b206574
 	.long	0,1,2,3
-.asciz  "ChaCha20 for PowerPC/AltiVec, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz  "ChaCha20 for PowerPC/AltiVec, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2
 ___

diff --git a/deps/openssl/openssl/crypto/chacha/asm/chacha-s390x.pl b/deps/openssl/openssl/crypto/chacha/asm/chacha-s390x.pl
index 9e29ebccb59..099f2c15498 100755
--- a/deps/openssl/openssl/crypto/chacha/asm/chacha-s390x.pl
+++ b/deps/openssl/openssl/crypto/chacha/asm/chacha-s390x.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # December 2015
@@ -240,7 +240,7 @@ my $odd=@_[24];

 PERLASM_BEGIN($output);

-INCLUDE	("s390x_arch.h");
+INCLUDE	("arch/s390x_arch.h");
 TEXT	();

 ################
@@ -1050,7 +1050,7 @@ LONG	(0x3320646e,0x3320646e,0x3320646e,0x3320646e);
 LONG	(0x79622d32,0x79622d32,0x79622d32,0x79622d32);
 LONG	(0x6b206574,0x6b206574,0x6b206574,0x6b206574);

-ASCIZ	("\"ChaCha20 for s390x, CRYPTOGAMS by <appro\@openssl.org>\"");
+ASCIZ	("\"ChaCha20 for s390x, CRYPTOGAMS by <https://github.com/dot-asm>\"");
 ALIGN	(4);

 PERLASM_END();
diff --git a/deps/openssl/openssl/crypto/chacha/asm/chacha-x86.pl b/deps/openssl/openssl/crypto/chacha/asm/chacha-x86.pl
index b95d4df3797..7e28d6b1fe4 100755
--- a/deps/openssl/openssl/crypto/chacha/asm/chacha-x86.pl
+++ b/deps/openssl/openssl/crypto/chacha/asm/chacha-x86.pl
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # January 2015
@@ -789,7 +789,7 @@ sub SSSE3ROUND {	# critical path is 20 "SIMD ticks" per round
 &data_word(0,-1,-1,-1);
 &align	(64);
 }
-&asciz	("ChaCha20 for x86, CRYPTOGAMS by <appro\@openssl.org>");
+&asciz	("ChaCha20 for x86, CRYPTOGAMS by <https://github.com/dot-asm>");

 if ($ymm) {
 my ($xa,$xa_,$xb,$xb_,$xc,$xc_,$xd,$xd_)=map("xmm$_",(0..7));
diff --git a/deps/openssl/openssl/crypto/chacha/asm/chacha-x86_64.pl b/deps/openssl/openssl/crypto/chacha/asm/chacha-x86_64.pl
index 69e5319ad43..d991d407399 100755
--- a/deps/openssl/openssl/crypto/chacha/asm/chacha-x86_64.pl
+++ b/deps/openssl/openssl/crypto/chacha/asm/chacha-x86_64.pl
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # November 2014
@@ -141,7 +141,7 @@ $code.=<<___;
 .long	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
 .Lsigma:
 .asciz	"expand 32-byte k"
-.asciz	"ChaCha20 for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"ChaCha20 for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .previous
 ___

diff --git a/deps/openssl/openssl/crypto/chacha/asm/chachap10-ppc.pl b/deps/openssl/openssl/crypto/chacha/asm/chachap10-ppc.pl
index 9c508266888..823fd9300c3 100755
--- a/deps/openssl/openssl/crypto/chacha/asm/chachap10-ppc.pl
+++ b/deps/openssl/openssl/crypto/chacha/asm/chachap10-ppc.pl
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # October 2015
@@ -1303,7 +1303,7 @@ $code.=<<___;
 	.long	0x6b206574,0x6b206574,0x6b206574,0x6b206574
 	.long	0,1,2,3
         .long   0x03020100,0x07060504,0x0b0a0908,0x0f0e0d0c
-.asciz  "ChaCha20 for PowerPC/AltiVec, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz  "ChaCha20 for PowerPC/AltiVec, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2
 ___

diff --git a/deps/openssl/openssl/crypto/chacha/build.info b/deps/openssl/openssl/crypto/chacha/build.info
index c151e190429..41c22f7a981 100644
--- a/deps/openssl/openssl/crypto/chacha/build.info
+++ b/deps/openssl/openssl/crypto/chacha/build.info
@@ -25,6 +25,10 @@ IF[{- !$disabled{asm} -}]
   $CHACHAASM_riscv64=chacha_riscv.c chacha_enc.c chacha-riscv64-v-zbb.s chacha-riscv64-v-zbb-zvkb.s
   $CHACHADEF_riscv64=INCLUDE_C_CHACHA20

+  $CHACHAASM_e2k=chacha_e2k.c
+  $CHACHAASM_e2kv6=chacha_e2k.c
+  $CHACHAASM_e2kv7=chacha_e2k.c
+
   # Now that we have defined all the arch specific variables, use the
   # appropriate one
   IF[$CHACHAASM_{- $target{asm_arch} -}]
diff --git a/deps/openssl/openssl/crypto/chacha/chacha_e2k.c b/deps/openssl/openssl/crypto/chacha/chacha_e2k.c
new file mode 100644
index 00000000000..88ac0ab715f
--- /dev/null
+++ b/deps/openssl/openssl/crypto/chacha/chacha_e2k.c
@@ -0,0 +1,256 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <string.h>
+
+#include "internal/endian.h"
+#include "crypto/chacha.h"
+#include "crypto/ctype.h"
+
+typedef uint32_t u32;
+typedef uint8_t u8;
+
+#include <stdint.h>
+#include <e2kintrin.h>
+
+#if __iset__ >= 5 /* 128-bit SIMD */
+
+/* QUARTERROUND updates a, b, c, d with a ChaCha "quarter" round. */
+#define QUARTERROUND(a, b, c, d) (                                                                                  \
+    x[a] = __builtin_e2k_qpaddw(x[a], x[b]), x[d] = __builtin_e2k_qpsrcw(__builtin_e2k_qpxor(x[d], x[a]), 32 - 16), \
+    x[c] = __builtin_e2k_qpaddw(x[c], x[d]), x[b] = __builtin_e2k_qpsrcw(__builtin_e2k_qpxor(x[b], x[c]), 32 - 12), \
+    x[a] = __builtin_e2k_qpaddw(x[a], x[b]), x[d] = __builtin_e2k_qpsrcw(__builtin_e2k_qpxor(x[d], x[a]), 32 - 8),  \
+    x[c] = __builtin_e2k_qpaddw(x[c], x[d]), x[b] = __builtin_e2k_qpsrcw(__builtin_e2k_qpxor(x[b], x[c]), 32 - 7))
+
+/* chacha_core performs 20 rounds of ChaCha on the input words in
+ * |input| and writes the 64 output bytes to |output|.
+ */
+static inline __attribute__((__always_inline__)) void chacha20_core_x4(__v2di *output, const __v2di input[16])
+{
+    __v2di x[16];
+    int i;
+    memcpy(x, input, sizeof(x));
+
+    for (i = 20; i > 0; i -= 2) {
+        QUARTERROUND(0, 4, 8, 12);
+        QUARTERROUND(1, 5, 9, 13);
+        QUARTERROUND(2, 6, 10, 14);
+        QUARTERROUND(3, 7, 11, 15);
+        QUARTERROUND(0, 5, 10, 15);
+        QUARTERROUND(1, 6, 11, 12);
+        QUARTERROUND(2, 7, 8, 13);
+        QUARTERROUND(3, 4, 9, 14);
+    }
+
+    for (i = 0; i < 16; ++i)
+        output[i] = __builtin_e2k_qpaddw(x[i], input[i]);
+}
+
+void ChaCha20_ctr32(unsigned char *out, const unsigned char *inp, size_t len,
+    const unsigned int key[8], const unsigned int counter[4])
+{
+    u32 input[16];
+    __v2di input_x4[16];
+    __v2di buf[16];
+    size_t todo, i;
+
+    /* sigma constant "expand 32-byte k" in little-endian encoding */
+    input[0] = ((u32)('e')) | ((u32)('x') << 8) | ((u32)('p') << 16) | ((u32)('a') << 24);
+    input[1] = ((u32)('n')) | ((u32)('d') << 8) | ((u32)(' ') << 16) | ((u32)('3') << 24);
+    input[2] = ((u32)('2')) | ((u32)('-') << 8) | ((u32)('b') << 16) | ((u32)('y') << 24);
+    input[3] = ((u32)('t')) | ((u32)('e') << 8) | ((u32)(' ') << 16) | ((u32)('k') << 24);
+
+    input[4] = key[0];
+    input[5] = key[1];
+    input[6] = key[2];
+    input[7] = key[3];
+    input[8] = key[4];
+    input[9] = key[5];
+    input[10] = key[6];
+    input[11] = key[7];
+
+    input[12] = counter[0];
+    input[13] = counter[1];
+    input[14] = counter[2];
+    input[15] = counter[3];
+
+    for (i = 0; i < 16; i++) {
+        unsigned long long w = input[i] * 0x100000001LL;
+        input_x4[i] = __builtin_e2k_qppackdl(w, w);
+    }
+
+    input_x4[12] = __builtin_e2k_qpaddw(input_x4[12], (__v2di) { 0x100000000LL, 0x300000002LL });
+
+    while (len > 0) {
+        __v2di buf_tran[16];
+
+        chacha20_core_x4(buf, input_x4);
+
+        for (i = 0; i < 16; i += 4) {
+            const __v2di f1 = __builtin_e2k_qppackdl(0x1f1e1d1c0f0e0d0cLL, 0x1716151407060504LL);
+            const __v2di f0 = __builtin_e2k_qppackdl(0x1b1a19180b0a0908LL, 0x1312111003020100LL);
+
+            const __v2di f3 = __builtin_e2k_qppackdl(0x1f1e1d1c1b1a1918LL, 0x0f0e0d0c0b0a0908LL);
+            const __v2di f2 = __builtin_e2k_qppackdl(0x1716151413121110LL, 0x0706050403020100LL);
+
+            __v2di t0 = __builtin_e2k_qppermb(buf[i + 1], buf[i + 0], f0);
+            __v2di t1 = __builtin_e2k_qppermb(buf[i + 1], buf[i + 0], f1);
+            __v2di t2 = __builtin_e2k_qppermb(buf[i + 3], buf[i + 2], f0);
+            __v2di t3 = __builtin_e2k_qppermb(buf[i + 3], buf[i + 2], f1);
+
+            buf_tran[i / 4 + 0] = __builtin_e2k_qppermb(t2, t0, f2);
+            buf_tran[i / 4 + 4] = __builtin_e2k_qppermb(t3, t1, f2);
+            buf_tran[i / 4 + 8] = __builtin_e2k_qppermb(t2, t0, f3);
+            buf_tran[i / 4 + 12] = __builtin_e2k_qppermb(t3, t1, f3);
+        }
+
+        todo = sizeof(buf);
+        if (__builtin_expect(len < todo, 0)) {
+            todo = len & ~(size_t)15;
+
+            for (i = 0; i < todo; i += 16) {
+                *(__v2di *)&out[i] = __builtin_e2k_qpxor(*(__v2di *)&inp[i], buf_tran[i / 16]);
+            }
+            for (; i < len; i++) {
+                out[i] = inp[i] ^ ((u8 *)buf_tran)[i];
+            }
+            return;
+        }
+
+        for (i = 0; i < todo; i += 16) {
+            *(__v2di *)&out[i] = __builtin_e2k_qpxor(*(__v2di *)&inp[i], buf_tran[i / 16]);
+        }
+
+        /*
+         * Advance 32-bit counters. Note that as subroutine is so to
+         * say nonce-agnostic, this limited counter width doesn't
+         * prevent caller from implementing wider counter. It would
+         * simply take two calls split on counter overflow...
+         */
+        input_x4[12] = __builtin_e2k_qpaddw(input_x4[12], (__v2di) { 0x400000004LL, 0x400000004LL });
+
+        out += todo;
+        inp += todo;
+        len -= todo;
+    }
+}
+
+#else /* 64-bit SIMD */
+
+/* QUARTERROUND updates a, b, c, d with a ChaCha "quarter" round. */
+#define QUARTERROUND(a, b, c, d) (                                                                                                                                          \
+    x[a] = __builtin_e2k_paddw(x[a], x[b]), tt = __builtin_e2k_pxord(x[d], x[a]), x[d] = __builtin_e2k_pshufb(tt, tt, 0x0504070601000302ull),                               \
+    x[c] = __builtin_e2k_paddw(x[c], x[d]), tt = __builtin_e2k_pxord(x[b], x[c]), x[b] = __builtin_e2k_pord(__builtin_e2k_psllw(tt, 12), __builtin_e2k_psrlw(tt, 32 - 12)), \
+    x[a] = __builtin_e2k_paddw(x[a], x[b]), tt = __builtin_e2k_pxord(x[d], x[a]), x[d] = __builtin_e2k_pshufb(tt, tt, 0x0605040702010003ull),                               \
+    x[c] = __builtin_e2k_paddw(x[c], x[d]), tt = __builtin_e2k_pxord(x[b], x[c]), x[b] = __builtin_e2k_pord(__builtin_e2k_psllw(tt, 7), __builtin_e2k_psrlw(tt, 32 - 7)))
+
+/* chacha_core performs 20 rounds of ChaCha on the input words in *inp
+ * and writes the 64 output bytes to *out .
+ */
+void ChaCha20_ctr32(unsigned char *out, const unsigned char *inp,
+    size_t len, const unsigned int key[8],
+    const unsigned int counter[4])
+{
+    u32 input[16];
+    uint64_t input_x2[16];
+    uint64_t buf[16];
+    size_t todo, i;
+
+    /* sigma constant "expand 32-byte k" in little-endian encoding */
+    input[0] = ((u32)('e')) | ((u32)('x') << 8) | ((u32)('p') << 16) | ((u32)('a') << 24);
+    input[1] = ((u32)('n')) | ((u32)('d') << 8) | ((u32)(' ') << 16) | ((u32)('3') << 24);
+    input[2] = ((u32)('2')) | ((u32)('-') << 8) | ((u32)('b') << 16) | ((u32)('y') << 24);
+    input[3] = ((u32)('t')) | ((u32)('e') << 8) | ((u32)(' ') << 16) | ((u32)('k') << 24);
+
+    input[4] = key[0];
+    input[5] = key[1];
+    input[6] = key[2];
+    input[7] = key[3];
+    input[8] = key[4];
+    input[9] = key[5];
+    input[10] = key[6];
+    input[11] = key[7];
+
+    input[12] = counter[0];
+    input[13] = counter[1];
+    input[14] = counter[2];
+    input[15] = counter[3];
+
+#pragma unroll(16)
+    for (i = 0; i < 16; i++) {
+        input_x2[i] = input[i] * 0x100000001ull;
+    }
+
+    input_x2[12] = __builtin_e2k_paddw(input_x2[12], 0x100000000ull);
+
+    while (len > 0) {
+        uint64_t buf_tran[16];
+        uint64_t x[16], tt;
+        uint64_t *__restrict__ outw = (uint64_t *)out;
+
+        for (i = 0; i < 16; ++i)
+            x[i] = input_x2[i];
+
+        for (i = 20; i > 0; i -= 2) {
+            QUARTERROUND(0, 4, 8, 12);
+            QUARTERROUND(1, 5, 9, 13);
+            QUARTERROUND(2, 6, 10, 14);
+            QUARTERROUND(3, 7, 11, 15);
+            QUARTERROUND(0, 5, 10, 15);
+            QUARTERROUND(1, 6, 11, 12);
+            QUARTERROUND(2, 7, 8, 13);
+            QUARTERROUND(3, 4, 9, 14);
+        }
+
+        for (i = 0; i < 16; ++i)
+            buf[i] = __builtin_e2k_paddw(x[i], input_x2[i]);
+
+#pragma unroll(8)
+        for (i = 0; i < 16; i += 2) {
+            const uint64_t fmtl = 0x0b0a090803020100ull;
+            const uint64_t fmtr = 0x0f0e0d0c07060504ull;
+
+            buf_tran[i / 2 + 0] = __builtin_e2k_pshufb(buf[i + 1], buf[i + 0], fmtl);
+            buf_tran[i / 2 + 8] = __builtin_e2k_pshufb(buf[i + 1], buf[i + 0], fmtr);
+        }
+
+        todo = sizeof(buf);
+        if (__builtin_expect(len < todo, 0)) {
+            todo = len & ~(size_t)7;
+
+#pragma loop count(16)
+            for (i = 0; i < todo; i += 8) {
+                *(uint64_t *)&out[i] = __builtin_e2k_pxord(*(uint64_t *)&inp[i], buf_tran[i / 8]);
+            }
+#pragma loop count(7)
+            for (; i < len; i++) {
+                out[i] = inp[i] ^ ((u8 *)buf_tran)[i];
+            }
+            return;
+        }
+
+#pragma unroll(16)
+        for (i = 0; i < todo; i += 8) {
+            *outw++ = __builtin_e2k_pxord(*(uint64_t *)&inp[i], buf_tran[i / 8]);
+        }
+
+        /*
+         * Advance 32-bit counters. Note that as subroutine is so to
+         * say nonce-agnostic, this limited counter width doesn't
+         * prevent caller from implementing wider counter. It would
+         * simply take two calls split on counter overflow...
+         */
+        input_x2[12] = __builtin_e2k_paddw(input_x2[12], 0x200000002ull);
+
+        out += todo;
+        inp += todo;
+        len -= todo;
+    }
+}
+#endif
diff --git a/deps/openssl/openssl/crypto/chacha/chacha_enc.c b/deps/openssl/openssl/crypto/chacha/chacha_enc.c
index 3cd4f0188d3..8318f4fdf83 100644
--- a/deps/openssl/openssl/crypto/chacha/chacha_enc.c
+++ b/deps/openssl/openssl/crypto/chacha/chacha_enc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -9,34 +9,33 @@

 /* Adapted from the public domain code by D. Bernstein from SUPERCOP. */

+#include <stdint.h>
 #include <string.h>

 #include "internal/endian.h"
 #include "crypto/chacha.h"
 #include "crypto/ctype.h"

-typedef unsigned int u32;
-typedef unsigned char u8;
 typedef union {
-    u32 u[16];
-    u8 c[64];
+    uint32_t u[16];
+    uint8_t c[64];
 } chacha_buf;

 #define ROTATE(v, n) (((v) << (n)) | ((v) >> (32 - (n))))

 #ifndef PEDANTIC
-#if defined(__GNUC__) && __GNUC__ >= 2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
+#if defined(__GNUC__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 #if defined(__riscv_zbb) || defined(__riscv_zbkb)
 #if __riscv_xlen == 64
 #undef ROTATE
-#define ROTATE(x, n) ({ u32 ret;                   \
+#define ROTATE(x, n) ({ uint32_t ret;                   \
                         asm ("roriw %0, %1, %2"        \
                         : "=r"(ret)                    \
                         : "r"(x), "i"(32 - (n))); ret; })
 #endif
 #if __riscv_xlen == 32
 #undef ROTATE
-#define ROTATE(x, n) ({ u32 ret;                   \
+#define ROTATE(x, n) ({ uint32_t ret;                   \
                         asm ("rori %0, %1, %2"         \
                         : "=r"(ret)                    \
                         : "r"(x), "i"(32 - (n))); ret; })
@@ -45,12 +44,12 @@ typedef union {
 #endif
 #endif

-#define U32TO8_LITTLE(p, v)     \
-    do {                        \
-        (p)[0] = (u8)(v >> 0);  \
-        (p)[1] = (u8)(v >> 8);  \
-        (p)[2] = (u8)(v >> 16); \
-        (p)[3] = (u8)(v >> 24); \
+#define U32TO8_LITTLE(p, v)          \
+    do {                             \
+        (p)[0] = (uint8_t)(v >> 0);  \
+        (p)[1] = (uint8_t)(v >> 8);  \
+        (p)[2] = (uint8_t)(v >> 16); \
+        (p)[3] = (uint8_t)(v >> 24); \
     } while (0)

 /* QUARTERROUND updates a, b, c, d with a ChaCha "quarter" round. */
@@ -62,9 +61,9 @@ typedef union {

 /* chacha_core performs 20 rounds of ChaCha on the input words in
  * |input| and writes the 64 output bytes to |output|. */
-static void chacha20_core(chacha_buf *output, const u32 input[16])
+static void chacha20_core(chacha_buf *output, const uint32_t input[16])
 {
-    u32 x[16];
+    uint32_t x[16];
     int i;
     DECLARE_IS_ENDIAN;

@@ -98,23 +97,23 @@ void ChaCha20_ctr32(unsigned char *out, const unsigned char *inp, size_t len,
     const unsigned int key[8], const unsigned int counter[4])
 #endif
 {
-    u32 input[16];
+    uint32_t input[16];
     chacha_buf buf;
     size_t todo, i;

     /* sigma constant "expand 32-byte k" in little-endian encoding */
-    input[0] = ((u32)ossl_toascii('e')) | ((u32)ossl_toascii('x') << 8)
-        | ((u32)ossl_toascii('p') << 16)
-        | ((u32)ossl_toascii('a') << 24);
-    input[1] = ((u32)ossl_toascii('n')) | ((u32)ossl_toascii('d') << 8)
-        | ((u32)ossl_toascii(' ') << 16)
-        | ((u32)ossl_toascii('3') << 24);
-    input[2] = ((u32)ossl_toascii('2')) | ((u32)ossl_toascii('-') << 8)
-        | ((u32)ossl_toascii('b') << 16)
-        | ((u32)ossl_toascii('y') << 24);
-    input[3] = ((u32)ossl_toascii('t')) | ((u32)ossl_toascii('e') << 8)
-        | ((u32)ossl_toascii(' ') << 16)
-        | ((u32)ossl_toascii('k') << 24);
+    input[0] = ((uint32_t)ossl_toascii('e')) | ((uint32_t)ossl_toascii('x') << 8)
+        | ((uint32_t)ossl_toascii('p') << 16)
+        | ((uint32_t)ossl_toascii('a') << 24);
+    input[1] = ((uint32_t)ossl_toascii('n')) | ((uint32_t)ossl_toascii('d') << 8)
+        | ((uint32_t)ossl_toascii(' ') << 16)
+        | ((uint32_t)ossl_toascii('3') << 24);
+    input[2] = ((uint32_t)ossl_toascii('2')) | ((uint32_t)ossl_toascii('-') << 8)
+        | ((uint32_t)ossl_toascii('b') << 16)
+        | ((uint32_t)ossl_toascii('y') << 24);
+    input[3] = ((uint32_t)ossl_toascii('t')) | ((uint32_t)ossl_toascii('e') << 8)
+        | ((uint32_t)ossl_toascii(' ') << 16)
+        | ((uint32_t)ossl_toascii('k') << 24);

     input[4] = key[0];
     input[5] = key[1];
diff --git a/deps/openssl/openssl/crypto/chacha/chacha_ppc.c b/deps/openssl/openssl/crypto/chacha/chacha_ppc.c
index b36881a8336..b2149dab32c 100644
--- a/deps/openssl/openssl/crypto/chacha/chacha_ppc.c
+++ b/deps/openssl/openssl/crypto/chacha/chacha_ppc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2009-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,7 +12,7 @@

 #include <openssl/opensslconf.h>
 #include "crypto/chacha.h"
-#include "crypto/ppc_arch.h"
+#include "arch/ppc_arch.h"

 void ChaCha20_ctr32_int(unsigned char *out, const unsigned char *inp,
     size_t len, const unsigned int key[8],
diff --git a/deps/openssl/openssl/crypto/chacha/chacha_riscv.c b/deps/openssl/openssl/crypto/chacha/chacha_riscv.c
index c9f17b35d85..8c4d34fa65b 100644
--- a/deps/openssl/openssl/crypto/chacha/chacha_riscv.c
+++ b/deps/openssl/openssl/crypto/chacha/chacha_riscv.c
@@ -2,7 +2,7 @@
  * This file is dual-licensed, meaning that you can use it under your
  * choice of either of the following two licenses:
  *
- * Copyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -38,7 +38,7 @@

 #include <openssl/opensslconf.h>
 #include "crypto/chacha.h"
-#include "crypto/riscv_arch.h"
+#include "arch/riscv_arch.h"

 void ChaCha20_ctr32_v_zbb_zvkb(unsigned char *out, const unsigned char *inp,
     size_t len, const unsigned int key[8],
diff --git a/deps/openssl/openssl/crypto/cmac/cmac.c b/deps/openssl/openssl/crypto/cmac/cmac.c
index 03b127ebb92..f25524a2f64 100644
--- a/deps/openssl/openssl/crypto/cmac/cmac.c
+++ b/deps/openssl/openssl/crypto/cmac/cmac.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2010-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,6 +20,7 @@
 #include <openssl/cmac.h>
 #include <openssl/err.h>
 #include "crypto/cmac.h"
+#include "internal/common.h"

 #define LOCAL_BUF_SIZE 2048
 struct CMAC_CTX_st {
@@ -109,14 +110,13 @@ int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in)
 }

 int ossl_cmac_init(CMAC_CTX *ctx, const void *key, size_t keylen,
-    const EVP_CIPHER *cipher, ENGINE *impl,
-    const OSSL_PARAM param[])
+    const EVP_CIPHER *cipher, const OSSL_PARAM param[])
 {
     static const unsigned char zero_iv[EVP_MAX_BLOCK_LENGTH] = { 0 };
     int block_len;

     /* All zeros means restart */
-    if (!key && !cipher && !impl && keylen == 0) {
+    if (key == NULL && cipher == NULL && keylen == 0) {
         /* Not initialised */
         if (ctx->nlast_block == -1)
             return 0;
@@ -133,13 +133,8 @@ int ossl_cmac_init(CMAC_CTX *ctx, const void *key, size_t keylen,
     if (cipher != NULL) {
         /* Ensure we can't use this ctx until we also have a key */
         ctx->nlast_block = -1;
-        if (impl != NULL) {
-            if (!EVP_EncryptInit_ex(ctx->cctx, cipher, impl, NULL, NULL))
-                return 0;
-        } else {
-            if (!EVP_EncryptInit_ex2(ctx->cctx, cipher, NULL, NULL, param))
-                return 0;
-        }
+        if (!EVP_EncryptInit_ex2(ctx->cctx, cipher, NULL, NULL, param))
+            return 0;
     }
     /* Non-NULL key means initialisation complete */
     if (key != NULL) {
@@ -149,7 +144,8 @@ int ossl_cmac_init(CMAC_CTX *ctx, const void *key, size_t keylen,
         ctx->nlast_block = -1;
         if (EVP_CIPHER_CTX_get0_cipher(ctx->cctx) == NULL)
             return 0;
-        if (EVP_CIPHER_CTX_set_key_length(ctx->cctx, keylen) <= 0)
+        if (keylen > INT_MAX
+            || EVP_CIPHER_CTX_set_key_length(ctx->cctx, (int)keylen) <= 0)
             return 0;
         if (!EVP_EncryptInit_ex2(ctx->cctx, NULL, key, zero_iv, param))
             return 0;
@@ -173,7 +169,9 @@ int ossl_cmac_init(CMAC_CTX *ctx, const void *key, size_t keylen,
 int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
     const EVP_CIPHER *cipher, ENGINE *impl)
 {
-    return ossl_cmac_init(ctx, key, keylen, cipher, impl, NULL);
+    if (!ossl_assert(impl == NULL))
+        return 0;
+    return ossl_cmac_init(ctx, key, keylen, cipher, NULL);
 }

 int CMAC_Update(CMAC_CTX *ctx, const void *in, size_t dlen)
@@ -198,7 +196,7 @@ int CMAC_Update(CMAC_CTX *ctx, const void *in, size_t dlen)
             nleft = dlen;
         memcpy(ctx->last_block + ctx->nlast_block, data, nleft);
         dlen -= nleft;
-        ctx->nlast_block += nleft;
+        ctx->nlast_block += (int)nleft;
         /* If no more to process return */
         if (dlen == 0)
             return 1;
@@ -224,14 +222,14 @@ int CMAC_Update(CMAC_CTX *ctx, const void *in, size_t dlen)
         }
     } else {
         while (cipher_blocks > max_burst_blocks) {
-            if (EVP_Cipher(ctx->cctx, buf, data, max_burst_blocks * bl) <= 0)
+            if (EVP_Cipher(ctx->cctx, buf, data, (int)(max_burst_blocks * bl)) <= 0)
                 return 0;
             dlen -= max_burst_blocks * bl;
             data += max_burst_blocks * bl;
             cipher_blocks -= max_burst_blocks;
         }
         if (cipher_blocks > 0) {
-            if (EVP_Cipher(ctx->cctx, buf, data, cipher_blocks * bl) <= 0)
+            if (EVP_Cipher(ctx->cctx, buf, data, (int)(cipher_blocks * bl)) <= 0)
                 return 0;
             dlen -= cipher_blocks * bl;
             data += cipher_blocks * bl;
@@ -240,7 +238,7 @@ int CMAC_Update(CMAC_CTX *ctx, const void *in, size_t dlen)
     }
     /* Copy any data left to last block buffer */
     memcpy(ctx->last_block, data, dlen);
-    ctx->nlast_block = dlen;
+    ctx->nlast_block = (int)dlen;
     return 1;
 }

diff --git a/deps/openssl/openssl/crypto/cmp/cmp_client.c b/deps/openssl/openssl/crypto/cmp/cmp_client.c
index 0e0bff09f8f..ec09bcd4e35 100644
--- a/deps/openssl/openssl/crypto/cmp/cmp_client.c
+++ b/deps/openssl/openssl/crypto/cmp/cmp_client.c
@@ -9,16 +9,10 @@
  * https://www.openssl.org/source/license.html
  */

-#include "cmp_local.h"
-#include "internal/cryptlib.h"
+#include <stdio.h>

-/* explicit #includes not strictly needed since implied by the above: */
-#include <openssl/bio.h>
-#include <openssl/cmp.h>
-#include <openssl/err.h>
-#include <openssl/evp.h>
-#include <openssl/x509v3.h>
-#include <openssl/cmp_util.h>
+#include "cmp_local.h"
+#include <inttypes.h>

 #define IS_CREP(t) ((t) == OSSL_CMP_PKIBODY_IP || (t) == OSSL_CMP_PKIBODY_CP \
     || (t) == OSSL_CMP_PKIBODY_KUP)
@@ -239,7 +233,7 @@ static int send_receive_check(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *req,
                 != NULL)
             ERR_add_error_data(1, buf);
         if (emc->errorCode != NULL
-            && BIO_snprintf(buf, sizeof(buf), "; errorCode: %08lX",
+            && snprintf(buf, sizeof(buf), "; errorCode: %08lX",
                    ASN1_INTEGER_get(emc->errorCode))
                 > 0)
             ERR_add_error_data(1, buf);
@@ -318,7 +312,7 @@ static int poll_for_response(OSSL_CMP_CTX *ctx, int sleep, int rid,
             }
             if (check_after < 0 || (uint64_t)check_after > (sleep ? ULONG_MAX / 1000 : INT_MAX)) {
                 ERR_raise(ERR_LIB_CMP, CMP_R_CHECKAFTER_OUT_OF_RANGE);
-                if (BIO_snprintf(str, OSSL_CMP_PKISI_BUFLEN, "value = %jd",
+                if (snprintf(str, OSSL_CMP_PKISI_BUFLEN, "value = %" PRId64,
                         check_after)
                     >= 0)
                     ERR_add_error_data(1, str);
@@ -326,18 +320,21 @@ static int poll_for_response(OSSL_CMP_CTX *ctx, int sleep, int rid,
             }

             if (pollRep->reason == NULL
-                || (len = BIO_snprintf(str, OSSL_CMP_PKISI_BUFLEN,
+                || (len = snprintf(str, OSSL_CMP_PKISI_BUFLEN,
                         " with reason = '"))
-                    < 0) {
+                    < 0
+                || (size_t)len >= OSSL_CMP_PKISI_BUFLEN) {
                 *str = '\0';
             } else {
                 char *text = ossl_sk_ASN1_UTF8STRING2text(pollRep->reason, ", ",
                     sizeof(str) - len - 2);
+                int n;

                 if (text == NULL
-                    || BIO_snprintf(str + len, sizeof(str) - len,
-                           "%s'", text)
-                        < 0)
+                    || (n = snprintf(str + len, sizeof(str) - len,
+                            "%s'", text))
+                        < 0
+                    || (size_t)n >= sizeof(str) - len)
                     *str = '\0';
                 OPENSSL_free(text);
             }
diff --git a/deps/openssl/openssl/crypto/cmp/cmp_ctx.c b/deps/openssl/openssl/crypto/cmp/cmp_ctx.c
index 7fdc478cf8f..7e1c43a89c2 100644
--- a/deps/openssl/openssl/crypto/cmp/cmp_ctx.c
+++ b/deps/openssl/openssl/crypto/cmp/cmp_ctx.c
@@ -9,16 +9,10 @@
  * https://www.openssl.org/source/license.html
  */

-#include <openssl/trace.h>
-#include <openssl/bio.h>
-#include <openssl/ocsp.h> /* for OCSP_REVOKED_STATUS_* */
+#include <stdio.h>

 #include "cmp_local.h"
-
-/* explicit #includes not strictly needed since implied by the above: */
-#include <openssl/cmp.h>
-#include <openssl/crmf.h>
-#include <openssl/err.h>
+#include <openssl/ocsp.h> /* for OCSP_REVOKED_STATUS_* */

 #define DEFINE_OSSL_CMP_CTX_get0(FIELD, TYPE) \
     DEFINE_OSSL_CMP_CTX_get0_NAME(FIELD, FIELD, TYPE)
@@ -89,11 +83,18 @@ err:

 static int cmp_ctx_set_md(OSSL_CMP_CTX *ctx, EVP_MD **pmd, int nid)
 {
-    EVP_MD *md = EVP_MD_fetch(ctx->libctx, OBJ_nid2sn(nid), ctx->propq);
+    const char *name = OBJ_nid2sn(nid);
+    EVP_MD *md;
+
+    if (name == NULL) {
+        ERR_raise_data(ERR_LIB_CMP, CMP_R_UNKNOWN_ALGORITHM_ID, "nid=%d", nid);
+        return 0;
+    }
+    md = EVP_MD_fetch(ctx->libctx, name, ctx->propq);
     /* fetching in advance to be able to throw error early if unsupported */

     if (md == NULL) {
-        ERR_raise(ERR_LIB_CMP, CMP_R_UNSUPPORTED_ALGORITHM);
+        ERR_raise_data(ERR_LIB_CMP, CMP_R_UNSUPPORTED_ALGORITHM, "name=%s,nid=%d", name, nid);
         return 0;
     }
     EVP_MD_free(*pmd);
@@ -130,11 +131,20 @@ OSSL_CMP_CTX *OSSL_CMP_CTX_new(OSSL_LIB_CTX *libctx, const char *propq)
         goto err;
     }

+    /*
+     * https://www.rfc-editor.org/rfc/rfc9045.html#name-password-based-message-auth says:
+     * The salt SHOULD be at least 8 octets (64 bits) long.
+     */
     ctx->pbm_slen = 16;
     if (!cmp_ctx_set_md(ctx, &ctx->pbm_owf, NID_sha256))
         goto err;
-    ctx->pbm_itercnt = 500;
+    ctx->pbm_itercnt = 1024;
     ctx->pbm_mac = NID_hmac_sha1;
+    /*
+     * For maximal interoperability with existing deployments, by default using HMAC-SHA1
+     * as required in https://www.rfc-editor.org/rfc/rfc4211.html#section-4.4:
+     * All implementations MUST support SHA-1.
+     */

     if (!cmp_ctx_set_md(ctx, &ctx->digest, NID_sha256))
         goto err;
@@ -369,11 +379,11 @@ int ossl_cmp_print_log(OSSL_CMP_severity level, const OSSL_CMP_CTX *ctx,
     if (OSSL_TRACE_ENABLED(CMP)) {
         OSSL_TRACE_BEGIN(CMP)
         {
-            int printed = BIO_snprintf(hugebuf, sizeof(hugebuf),
+            int printed = snprintf(hugebuf, sizeof(hugebuf),
                 "%s:%s:%d:" OSSL_CMP_LOG_PREFIX "%s: ",
                 func, file, line, level_str);
             if (printed > 0 && (size_t)printed < sizeof(hugebuf)) {
-                if (BIO_vsnprintf(hugebuf + printed,
+                if (vsnprintf(hugebuf + printed,
                         sizeof(hugebuf) - printed, format, args)
                     > 0)
                     res = BIO_puts(trc_out, hugebuf) > 0;
@@ -383,7 +393,7 @@ int ossl_cmp_print_log(OSSL_CMP_severity level, const OSSL_CMP_CTX *ctx,
     }
 #else /* compensate for disabled trace API */
     {
-        if (BIO_vsnprintf(hugebuf, sizeof(hugebuf), format, args) > 0)
+        if (vsnprintf(hugebuf, sizeof(hugebuf), format, args) > 0)
             res = ctx->log_cb(func, file, line, level, hugebuf);
     }
 #endif
@@ -917,6 +927,9 @@ DEFINE_set1_ASN1_OCTET_STRING(OSSL_CMP_CTX, transactionID)
     case OSSL_CMP_OPT_UNPROTECTED_ERRORS:
         ctx->unprotectedErrors = val;
         break;
+    case OSSL_CMP_OPT_NONMATCHED_ERROR_NONCES:
+        ctx->nonmatchedErrorNonces = val;
+        break;
     case OSSL_CMP_OPT_NO_CACHE_EXTRACERTS:
         ctx->noCacheExtraCerts = val;
         break;
@@ -976,7 +989,7 @@ DEFINE_set1_ASN1_OCTET_STRING(OSSL_CMP_CTX, transactionID)
         ctx->revocationReason = val;
         break;
     default:
-        ERR_raise(ERR_LIB_CMP, CMP_R_INVALID_OPTION);
+        ERR_raise_data(ERR_LIB_CMP, CMP_R_INVALID_OPTION, "%d", opt);
         return 0;
     }

@@ -1005,6 +1018,8 @@ int OSSL_CMP_CTX_get_option(const OSSL_CMP_CTX *ctx, int opt)
         return ctx->unprotectedSend;
     case OSSL_CMP_OPT_UNPROTECTED_ERRORS:
         return ctx->unprotectedErrors;
+    case OSSL_CMP_OPT_NONMATCHED_ERROR_NONCES:
+        return ctx->nonmatchedErrorNonces;
     case OSSL_CMP_OPT_NO_CACHE_EXTRACERTS:
         return ctx->noCacheExtraCerts;
     case OSSL_CMP_OPT_VALIDITY_DAYS:
@@ -1038,7 +1053,7 @@ int OSSL_CMP_CTX_get_option(const OSSL_CMP_CTX *ctx, int opt)
     case OSSL_CMP_OPT_REVOCATION_REASON:
         return ctx->revocationReason;
     default:
-        ERR_raise(ERR_LIB_CMP, CMP_R_INVALID_OPTION);
+        ERR_raise_data(ERR_LIB_CMP, CMP_R_INVALID_OPTION, "%d", opt);
         return -1;
     }
 }
diff --git a/deps/openssl/openssl/crypto/cmp/cmp_err.c b/deps/openssl/openssl/crypto/cmp/cmp_err.c
deleted file mode 100644
index fe1d8b3d1d2..00000000000
--- a/deps/openssl/openssl/crypto/cmp/cmp_err.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/cmperr.h>
-#include "crypto/cmperr.h"
-
-#ifndef OPENSSL_NO_CMP
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA CMP_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ALGORITHM_NOT_SUPPORTED),
-        "algorithm not supported" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_BAD_CHECKAFTER_IN_POLLREP),
-        "bad checkafter in pollrep" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_BAD_REQUEST_ID), "bad request id" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_CERTHASH_UNMATCHED), "certhash unmatched" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_CERTID_NOT_FOUND), "certid not found" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_CERTIFICATE_NOT_ACCEPTED),
-        "certificate not accepted" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_CERTIFICATE_NOT_FOUND),
-        "certificate not found" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_CERTREQMSG_NOT_FOUND),
-        "certreqmsg not found" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_CERTRESPONSE_NOT_FOUND),
-        "certresponse not found" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_CERT_AND_KEY_DO_NOT_MATCH),
-        "cert and key do not match" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_CHECKAFTER_OUT_OF_RANGE),
-        "checkafter out of range" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ENCOUNTERED_KEYUPDATEWARNING),
-        "encountered keyupdatewarning" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ENCOUNTERED_WAITING),
-        "encountered waiting" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_CALCULATING_PROTECTION),
-        "error calculating protection" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_CREATING_CERTCONF),
-        "error creating certconf" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_CREATING_CERTREP),
-        "error creating certrep" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_CREATING_CERTREQ),
-        "error creating certreq" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_CREATING_ERROR),
-        "error creating error" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_CREATING_GENM),
-        "error creating genm" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_CREATING_GENP),
-        "error creating genp" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_CREATING_PKICONF),
-        "error creating pkiconf" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_CREATING_POLLREP),
-        "error creating pollrep" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_CREATING_POLLREQ),
-        "error creating pollreq" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_CREATING_RP), "error creating rp" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_CREATING_RR), "error creating rr" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_PARSING_PKISTATUS),
-        "error parsing pkistatus" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_PROCESSING_MESSAGE),
-        "error processing message" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_PROTECTING_MESSAGE),
-        "error protecting message" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_SETTING_CERTHASH),
-        "error setting certhash" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_UNEXPECTED_CERTCONF),
-        "error unexpected certconf" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_VALIDATING_PROTECTION),
-        "error validating protection" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_VALIDATING_SIGNATURE),
-        "error validating signature" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_EXPECTED_POLLREQ), "expected pollreq" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_FAILED_BUILDING_OWN_CHAIN),
-        "failed building own chain" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_FAILED_EXTRACTING_CENTRAL_GEN_KEY),
-        "failed extracting central gen key" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_FAILED_EXTRACTING_PUBKEY),
-        "failed extracting pubkey" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_FAILURE_OBTAINING_RANDOM),
-        "failure obtaining random" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_FAIL_INFO_OUT_OF_RANGE),
-        "fail info out of range" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_GENERATE_CERTREQTEMPLATE),
-        "generate certreqtemplate" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_GENERATE_CRLSTATUS),
-        "error creating crlstatus" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_GETTING_GENP), "getting genp" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_GET_ITAV), "get itav" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_INVALID_ARGS), "invalid args" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_INVALID_GENP), "invalid genp" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_INVALID_KEYSPEC), "invalid keyspec" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_INVALID_OPTION), "invalid option" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_INVALID_ROOTCAKEYUPDATE),
-        "invalid rootcakeyupdate" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_CENTRAL_GEN_KEY),
-        "missing central gen key" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_CERTID), "missing certid" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_KEY_INPUT_FOR_CREATING_PROTECTION),
-        "missing key input for creating protection" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_KEY_USAGE_DIGITALSIGNATURE),
-        "missing key usage digitalsignature" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_P10CSR), "missing p10csr" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_PBM_SECRET), "missing pbm secret" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_PRIVATE_KEY),
-        "missing private key" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_PRIVATE_KEY_FOR_POPO),
-        "missing private key for popo" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_PROTECTION), "missing protection" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_PUBLIC_KEY), "missing public key" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_REFERENCE_CERT),
-        "missing reference cert" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_SECRET), "missing secret" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_SENDER_IDENTIFICATION),
-        "missing sender identification" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_TRUST_ANCHOR),
-        "missing trust anchor" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_TRUST_STORE),
-        "missing trust store" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED),
-        "multiple requests not supported" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MULTIPLE_RESPONSES_NOT_SUPPORTED),
-        "multiple responses not supported" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MULTIPLE_SAN_SOURCES),
-        "multiple san sources" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_NO_STDIO), "no stdio" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_NO_SUITABLE_SENDER_CERT),
-        "no suitable sender cert" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_NULL_ARGUMENT), "null argument" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_PKIBODY_ERROR), "pkibody error" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_PKISTATUSINFO_NOT_FOUND),
-        "pkistatusinfo not found" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_POLLING_FAILED), "polling failed" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_POTENTIALLY_INVALID_CERTIFICATE),
-        "potentially invalid certificate" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_RECEIVED_ERROR), "received error" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_RECIPNONCE_UNMATCHED),
-        "recipnonce unmatched" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_REQUEST_NOT_ACCEPTED),
-        "request not accepted" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_REQUEST_REJECTED_BY_SERVER),
-        "request rejected by server" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED),
-        "sender generalname type not supported" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_SRVCERT_DOES_NOT_VALIDATE_MSG),
-        "srvcert does not validate msg" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_TOTAL_TIMEOUT), "total timeout" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_TRANSACTIONID_UNMATCHED),
-        "transactionid unmatched" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_TRANSFER_ERROR), "transfer error" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNCLEAN_CTX), "unclean ctx" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNEXPECTED_CENTRAL_GEN_KEY),
-        "unexpected central gen key" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNEXPECTED_CERTPROFILE),
-        "unexpected certprofile" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNEXPECTED_CRLSTATUSLIST),
-        "unexpected crlstatuslist" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNEXPECTED_PKIBODY), "unexpected pkibody" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNEXPECTED_PKISTATUS),
-        "unexpected pkistatus" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNEXPECTED_POLLREQ), "unexpected pollreq" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNEXPECTED_PVNO), "unexpected pvno" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNEXPECTED_SENDER), "unexpected sender" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNKNOWN_ALGORITHM_ID),
-        "unknown algorithm id" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNKNOWN_CERT_TYPE), "unknown cert type" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNKNOWN_CRL_ISSUER), "unknown crl issuer" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNKNOWN_PKISTATUS), "unknown pkistatus" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNSUPPORTED_ALGORITHM),
-        "unsupported algorithm" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNSUPPORTED_KEY_TYPE),
-        "unsupported key type" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNSUPPORTED_PKIBODY),
-        "unsupported pkibody" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC),
-        "unsupported protection alg dhbasedmac" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_VALUE_TOO_LARGE), "value too large" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_VALUE_TOO_SMALL), "value too small" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_WRONG_ALGORITHM_OID),
-        "wrong algorithm oid" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_WRONG_CERTID), "wrong certid" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_WRONG_CERTID_IN_RP), "wrong certid in rp" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_WRONG_PBM_VALUE), "wrong pbm value" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_WRONG_RP_COMPONENT_COUNT),
-        "wrong rp component count" },
-    { ERR_PACK(ERR_LIB_CMP, 0, CMP_R_WRONG_SERIAL_IN_RP), "wrong serial in rp" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_CMP_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(CMP_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(CMP_str_reasons);
-#endif
-    return 1;
-}
-#else
-NON_EMPTY_TRANSLATION_UNIT
-#endif
diff --git a/deps/openssl/openssl/crypto/cmp/cmp_genm.c b/deps/openssl/openssl/crypto/cmp/cmp_genm.c
index 4fecc01a324..241ea3d5c3d 100644
--- a/deps/openssl/openssl/crypto/cmp/cmp_genm.c
+++ b/deps/openssl/openssl/crypto/cmp/cmp_genm.c
@@ -36,14 +36,33 @@ static int ossl_X509_check(OSSL_CMP_CTX *ctx, const char *source, X509 *cert,
     int type_CA, const X509_VERIFY_PARAM *vpm)
 {
     uint32_t ex_flags = X509_get_extension_flags(cert);
-    int res = X509_cmp_timeframe(vpm, X509_get0_notBefore(cert),
-        X509_get0_notAfter(cert));
-    int ret = res == 0;
+    int ret, err;
     OSSL_CMP_severity level = vpm == NULL ? OSSL_CMP_LOG_WARNING : OSSL_CMP_LOG_ERR;

-    if (!ret)
+    ret = X509_check_certificate_times(vpm, cert, &err);
+    if (!ret) {
+        const char *msg;
+
+        switch (err) {
+        case X509_V_ERR_CERT_NOT_YET_VALID:
+            msg = "not yet valid";
+            break;
+        case X509_V_ERR_CERT_HAS_EXPIRED:
+            msg = "has expired";
+            break;
+        case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
+            msg = "has an invalid not before field";
+            break;
+        case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD:
+            msg = "has an invalid not after field";
+            break;
+        default:
+            msg = "is invalid for an unspecfied reason";
+            break;
+        }
         cert_msg(OPENSSL_FUNC, OPENSSL_FILE, OPENSSL_LINE, level, ctx,
-            source, cert, res > 0 ? "has expired" : "not yet valid");
+            source, cert, msg);
+    }
     if (type_CA >= 0 && (ex_flags & EXFLAG_V1) == 0) {
         int is_CA = (ex_flags & EXFLAG_CA) != 0;

@@ -93,7 +112,8 @@ static OSSL_CMP_ITAV *get_genm_itav(OSSL_CMP_CTX *ctx,
     req = NULL;
     itavs = OSSL_CMP_exec_GENM_ses(ctx);
     if (itavs == NULL) {
-        if (OSSL_CMP_CTX_get_status(ctx) != OSSL_CMP_PKISTATUS_request)
+        if (OSSL_CMP_CTX_get_status(ctx) != OSSL_CMP_PKISTATUS_request
+            && OSSL_CMP_CTX_get_status(ctx) != OSSL_CMP_PKISTATUS_rejection)
             ERR_raise_data(ERR_LIB_CMP, CMP_R_GETTING_GENP,
                 "with infoType %s", desc);
         return NULL;
@@ -130,7 +150,7 @@ static OSSL_CMP_ITAV *get_genm_itav(OSSL_CMP_CTX *ctx,
         OSSL_CMP_ITAV_free(itav);
     }
     ERR_raise_data(ERR_LIB_CMP, CMP_R_INVALID_GENP,
-        "could not find any ITAV for %s", desc);
+        "could not find any suitable ITAV for %s", desc);

 err:
     sk_OSSL_CMP_ITAV_free(itavs);
@@ -319,11 +339,14 @@ int OSSL_CMP_get1_rootCaKeyUpdate(OSSL_CMP_CTX *ctx,
         ERR_raise(ERR_LIB_CMP, CMP_R_INVALID_ROOTCAKEYUPDATE);
         goto end;
     }
-    if (oldWithOld != NULL && my_oldWithNew != NULL
-        && !verify_ss_cert_trans(ctx, *newWithNew, my_oldWithNew,
-            oldWithOld_copy, "oldWithOld")) {
-        ERR_raise(ERR_LIB_CMP, CMP_R_INVALID_ROOTCAKEYUPDATE);
-        goto end;
+    if (my_oldWithNew != NULL) {
+        if (oldWithOld == NULL) {
+            ossl_cmp_log(WARN, ctx, "oldWithNew certificate received in genp for verifying oldWithOld, but oldWithOld was not provided");
+        } else if (!verify_ss_cert_trans(ctx, *newWithNew, my_oldWithNew,
+                       oldWithOld_copy, "oldWithOld")) {
+            ERR_raise(ERR_LIB_CMP, CMP_R_INVALID_ROOTCAKEYUPDATE);
+            goto end;
+        }
     }

     if (!X509_up_ref(*newWithNew))
diff --git a/deps/openssl/openssl/crypto/cmp/cmp_hdr.c b/deps/openssl/openssl/crypto/cmp/cmp_hdr.c
index 7715861b9da..305ce108432 100644
--- a/deps/openssl/openssl/crypto/cmp/cmp_hdr.c
+++ b/deps/openssl/openssl/crypto/cmp/cmp_hdr.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright Nokia 2007-2019
  * Copyright Siemens AG 2015-2019
  *
@@ -12,13 +12,7 @@
 /* CMP functions for PKIHeader handling */

 #include "cmp_local.h"
-
-#include <openssl/rand.h>
-
-/* explicit #includes not strictly needed since implied by the above: */
-#include <openssl/asn1t.h>
-#include <openssl/cmp.h>
-#include <openssl/err.h>
+#include <openssl/rand.h> /* for RAND_bytes_ex() */

 int ossl_cmp_hdr_set_pvno(OSSL_CMP_PKIHEADER *hdr, int pvno)
 {
@@ -118,7 +112,7 @@ int ossl_cmp_hdr_update_messageTime(OSSL_CMP_PKIHEADER *hdr)
 }

 /* assign to *tgt a random byte array of given length */
-static int set_random(ASN1_OCTET_STRING **tgt, OSSL_CMP_CTX *ctx, size_t len)
+static int set_random(ASN1_OCTET_STRING **tgt, OSSL_CMP_CTX *ctx, int len)
 {
     unsigned char *bytes = OPENSSL_malloc(len);
     int res = 0;
diff --git a/deps/openssl/openssl/crypto/cmp/cmp_http.c b/deps/openssl/openssl/crypto/cmp/cmp_http.c
index 1e230721104..cb2d5d83401 100644
--- a/deps/openssl/openssl/crypto/cmp/cmp_http.c
+++ b/deps/openssl/openssl/crypto/cmp/cmp_http.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright Nokia 2007-2019
  * Copyright Siemens AG 2015-2019
  *
@@ -9,26 +9,13 @@
  * https://www.openssl.org/source/license.html
  */

-#include <string.h>
 #include <stdio.h>

-#include <openssl/asn1t.h>
-#include <openssl/http.h>
-
-#include <openssl/cmp.h>
 #include "cmp_local.h"

-/* explicit #includes not strictly needed since implied by the above: */
-#include <ctype.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <openssl/bio.h>
-#include <openssl/buffer.h>
-#include <openssl/err.h>
-
-static int keep_alive(int keep_alive, int body_type, BIO **bios)
+static int keep_alive(int want_keep_alive, int body_type, BIO **bios)
 {
-    if (keep_alive != 0 && bios == NULL
+    if (want_keep_alive != 0 && bios == NULL
         /*
          * Ask for persistent connection only if may need more round trips.
          * Do so even with disableConfirm because polling might be needed.
@@ -38,8 +25,8 @@ static int keep_alive(int keep_alive, int body_type, BIO **bios)
         && body_type != OSSL_CMP_PKIBODY_P10CR
         && body_type != OSSL_CMP_PKIBODY_KUR
         && body_type != OSSL_CMP_PKIBODY_POLLREQ)
-        keep_alive = 0;
-    return keep_alive;
+        want_keep_alive = 0;
+    return want_keep_alive;
 }

 /*
@@ -69,7 +56,7 @@ OSSL_CMP_MSG *OSSL_CMP_MSG_http_perform(OSSL_CMP_CTX *ctx,

     bios = OSSL_CMP_CTX_get_transfer_cb_arg(ctx);
     if (ctx->serverPort != 0)
-        BIO_snprintf(server_port, sizeof(server_port), "%d", ctx->serverPort);
+        snprintf(server_port, sizeof(server_port), "%d", ctx->serverPort);
     tls_used = ctx->tls_used >= 0 ? ctx->tls_used != 0
                                   : OSSL_CMP_CTX_get_http_cb_arg(ctx) != NULL; /* backward compat */
     if (ctx->http_ctx == NULL) { /* using existing connection or yet not set up own connection */
diff --git a/deps/openssl/openssl/crypto/cmp/cmp_local.h b/deps/openssl/openssl/crypto/cmp/cmp_local.h
index 3542256e0bc..ac892f62bd7 100644
--- a/deps/openssl/openssl/crypto/cmp/cmp_local.h
+++ b/deps/openssl/openssl/crypto/cmp/cmp_local.h
@@ -12,18 +12,9 @@
 #ifndef OSSL_CRYPTO_CMP_LOCAL_H
 #define OSSL_CRYPTO_CMP_LOCAL_H

-#include "internal/cryptlib.h"
-
 #include <openssl/cmp.h>
-#include <openssl/err.h>
-
-/* explicit #includes not strictly needed since implied by the above: */
-#include <openssl/crmf.h>
-#include <openssl/types.h>
-#include <openssl/safestack.h>
-#include <openssl/x509.h>
-#include <openssl/x509v3.h>
 #include "crypto/x509.h"
+#include "internal/cryptlib.h"

 #define IS_NULL_DN(name) (X509_NAME_get_entry(name, 0) == NULL)

@@ -64,6 +55,7 @@ struct ossl_cmp_ctx_st {
      * certificate responses (ip/cp/kup), revocation responses (rp), and PKIConf
      */
     int unprotectedErrors;
+    int nonmatchedErrorNonces; /* accept missing/wrong transactionID or recipNonce in error msgs */
     int noCacheExtraCerts;
     X509 *srvCert; /* certificate used to identify the server */
     X509 *validatedSrvCert; /* caches any already validated sender cert */
@@ -827,7 +819,7 @@ int ossl_cmp_X509_STORE_add1_certs(X509_STORE *store, STACK_OF(X509) *certs,
     int only_self_issued);
 STACK_OF(X509) *ossl_cmp_X509_STORE_get1_certs(X509_STORE *store);
 int ossl_cmp_sk_ASN1_UTF8STRING_push_str(STACK_OF(ASN1_UTF8STRING) *sk,
-    const char *text, int len);
+    const char *text, size_t len);
 int ossl_cmp_asn1_octet_string_set1(ASN1_OCTET_STRING **tgt,
     const ASN1_OCTET_STRING *src);
 int ossl_cmp_asn1_octet_string_set1_bytes(ASN1_OCTET_STRING **tgt,
@@ -954,7 +946,7 @@ OSSL_CMP_MSG *ossl_cmp_certrep_new(OSSL_CMP_CTX *ctx, int bodytype,
     int certReqId, const OSSL_CMP_PKISI *si,
     X509 *cert, const EVP_PKEY *pkey,
     const X509 *encryption_recip,
-    STACK_OF(X509) *chain, STACK_OF(X509) *caPubs,
+    const STACK_OF(X509) *chain, STACK_OF(X509) *caPubs,
     int unprotectedErrors);
 OSSL_CMP_MSG *ossl_cmp_rr_new(OSSL_CMP_CTX *ctx);
 OSSL_CMP_MSG *ossl_cmp_rp_new(OSSL_CMP_CTX *ctx, const OSSL_CMP_PKISI *si,
diff --git a/deps/openssl/openssl/crypto/cmp/cmp_msg.c b/deps/openssl/openssl/crypto/cmp/cmp_msg.c
index 0a501cf783b..abea670ce9c 100644
--- a/deps/openssl/openssl/crypto/cmp/cmp_msg.c
+++ b/deps/openssl/openssl/crypto/cmp/cmp_msg.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright Nokia 2007-2019
  * Copyright Siemens AG 2015-2019
  *
@@ -13,15 +13,7 @@

 #include "cmp_local.h"

-/* explicit #includes not strictly needed since implied by the above: */
-#include <openssl/asn1t.h>
-#include <openssl/cmp.h>
-#include <openssl/crmf.h>
-#include <openssl/err.h>
-#include <openssl/x509.h>
-#include <openssl/pem.h>
-#include <openssl/bio.h>
-#include <internal/cms.h>
+#include <internal/cms.h> /* for ossl_cms_sign_encrypt() */

 OSSL_CMP_MSG *OSSL_CMP_MSG_new(OSSL_LIB_CTX *libctx, const char *propq)
 {
@@ -73,7 +65,7 @@ OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg)

 const char *ossl_cmp_bodytype_to_string(int type)
 {
-    static const char *type_names[] = {
+    static const char *const type_names[] = {
         "IR",
         "IP",
         "CR",
@@ -512,7 +504,7 @@ OSSL_CMP_MSG *ossl_cmp_certrep_new(OSSL_CMP_CTX *ctx, int bodytype,
     int certReqId, const OSSL_CMP_PKISI *si,
     X509 *cert, const EVP_PKEY *pkey,
     const X509 *encryption_recip,
-    STACK_OF(X509) *chain, STACK_OF(X509) *caPubs,
+    const STACK_OF(X509) *chain, STACK_OF(X509) *caPubs,
     int unprotectedErrors)
 {
     OSSL_CMP_MSG *msg = NULL;
@@ -832,13 +824,13 @@ OSSL_CMP_MSG *ossl_cmp_error_new(OSSL_CMP_CTX *ctx, const OSSL_CMP_PKISI *si,
             goto err;
         msg->body->value.error->errorDetails = ft;
         if (lib != NULL && *lib != '\0'
-            && !ossl_cmp_sk_ASN1_UTF8STRING_push_str(ft, lib, -1))
+            && !ossl_cmp_sk_ASN1_UTF8STRING_push_str(ft, lib, strlen(lib)))
             goto err;
         if (reason != NULL && *reason != '\0'
-            && !ossl_cmp_sk_ASN1_UTF8STRING_push_str(ft, reason, -1))
+            && !ossl_cmp_sk_ASN1_UTF8STRING_push_str(ft, reason, strlen(reason)))
             goto err;
         if (details != NULL
-            && !ossl_cmp_sk_ASN1_UTF8STRING_push_str(ft, details, -1))
+            && !ossl_cmp_sk_ASN1_UTF8STRING_push_str(ft, details, strlen(details)))
             goto err;
     }

diff --git a/deps/openssl/openssl/crypto/cmp/cmp_protect.c b/deps/openssl/openssl/crypto/cmp/cmp_protect.c
index 110693b8403..428d163f816 100644
--- a/deps/openssl/openssl/crypto/cmp/cmp_protect.c
+++ b/deps/openssl/openssl/crypto/cmp/cmp_protect.c
@@ -10,14 +10,7 @@
  */

 #include "cmp_local.h"
-#include "crypto/asn1.h"
-
-/* explicit #includes not strictly needed since implied by the above: */
-#include <openssl/asn1t.h>
-#include <openssl/cmp.h>
-#include <openssl/crmf.h>
-#include <openssl/err.h>
-#include <openssl/x509.h>
+#include "crypto/asn1.h" /* for ossl_X509_ALGOR_from_nid() */

 /*
  * This function is also used by the internal verify_PBMAC() in cmp_vfy.c.
@@ -79,8 +72,12 @@ ASN1_BIT_STRING *ossl_cmp_calc_protection(const OSSL_CMP_CTX *ctx,
         prot_part_der_len = (size_t)len;

         pbm_str = (ASN1_STRING *)ppval;
-        pbm_str_uc = pbm_str->data;
-        pbm = d2i_OSSL_CRMF_PBMPARAMETER(NULL, &pbm_str_uc, pbm_str->length);
+        pbm_str_uc = ASN1_STRING_get0_data(pbm_str);
+        if (ASN1_STRING_get_length(pbm_str) > INT_MAX) {
+            ERR_raise(ERR_LIB_CMP, CMP_R_WRONG_ALGORITHM_OID);
+            goto end;
+        }
+        pbm = d2i_OSSL_CRMF_PBMPARAMETER(NULL, &pbm_str_uc, (long)ASN1_STRING_get_length(pbm_str));
         if (pbm == NULL) {
             ERR_raise(ERR_LIB_CMP, CMP_R_WRONG_ALGORITHM_OID);
             goto end;
@@ -88,15 +85,14 @@ ASN1_BIT_STRING *ossl_cmp_calc_protection(const OSSL_CMP_CTX *ctx,

         if (!OSSL_CRMF_pbm_new(ctx->libctx, ctx->propq,
                 pbm, prot_part_der, prot_part_der_len,
-                ctx->secretValue->data, ctx->secretValue->length,
+                ASN1_STRING_get0_data(ctx->secretValue), ASN1_STRING_get_length(ctx->secretValue),
                 &protection, &sig_len))
             goto end;

-        if ((prot = ASN1_BIT_STRING_new()) == NULL)
+        if (sig_len > INT_MAX || (prot = ASN1_BIT_STRING_new()) == NULL)
             goto end;
         /* OpenSSL by default encodes all bit strings as ASN.1 NamedBitList */
-        ossl_asn1_string_set_bits_left(prot, 0);
-        if (!ASN1_BIT_STRING_set(prot, protection, sig_len)) {
+        if (!ASN1_BIT_STRING_set1(prot, protection, (int)sig_len, 0)) {
             ASN1_BIT_STRING_free(prot);
             prot = NULL;
         }
@@ -123,7 +119,8 @@ ASN1_BIT_STRING *ossl_cmp_calc_protection(const OSSL_CMP_CTX *ctx,
         if (ASN1_item_sign_ex(ASN1_ITEM_rptr(OSSL_CMP_PROTECTEDPART),
                 msg->header->protectionAlg, /* sets X509_ALGOR */
                 NULL, prot, &prot_part, NULL, ctx->pkey, md,
-                ctx->libctx, ctx->propq))
+                ctx->libctx, ctx->propq)
+            != 0)
             return prot;
         ASN1_BIT_STRING_free(prot);
         return NULL;
@@ -209,7 +206,7 @@ static X509_ALGOR *pbmac_algor(const OSSL_CMP_CTX *ctx)
         goto err;
     if ((pbm_der_len = i2d_OSSL_CRMF_PBMPARAMETER(pbm, &pbm_der)) < 0)
         goto err;
-    if (!ASN1_STRING_set(pbm_str, pbm_der, pbm_der_len))
+    if (!ossl_asn1_string_set1_data(pbm_str, pbm_der, pbm_der_len))
         goto err;
     alg = ossl_X509_ALGOR_from_nid(NID_id_PasswordBasedMAC,
         V_ASN1_SEQUENCE, pbm_str);
diff --git a/deps/openssl/openssl/crypto/cmp/cmp_server.c b/deps/openssl/openssl/crypto/cmp/cmp_server.c
index b9c1b8c91de..56ca4d0c873 100644
--- a/deps/openssl/openssl/crypto/cmp/cmp_server.c
+++ b/deps/openssl/openssl/crypto/cmp/cmp_server.c
@@ -11,14 +11,8 @@

 /* general CMP server functions */

-#include <openssl/asn1t.h>
-
 #include "cmp_local.h"

-/* explicit #includes not strictly needed since implied by the above: */
-#include <openssl/cmp.h>
-#include <openssl/err.h>
-
 /* the context for the generic CMP server */
 struct ossl_cmp_srv_ctx_st {
     OSSL_CMP_CTX *ctx; /* CMP client context reused for transactionID etc. */
diff --git a/deps/openssl/openssl/crypto/cmp/cmp_status.c b/deps/openssl/openssl/crypto/cmp/cmp_status.c
index c32539ed61d..b052c912468 100644
--- a/deps/openssl/openssl/crypto/cmp/cmp_status.c
+++ b/deps/openssl/openssl/crypto/cmp/cmp_status.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright Nokia 2007-2019
  * Copyright Siemens AG 2015-2019
  *
@@ -11,21 +11,10 @@

 /* CMP functions for PKIStatusInfo handling and PKIMessage decomposition */

-#include <string.h>
+#include <stdio.h>

 #include "cmp_local.h"

-/* explicit #includes not strictly needed since implied by the above: */
-#include <time.h>
-#include <openssl/cmp.h>
-#include <openssl/crmf.h>
-#include <openssl/err.h> /* needed in case config no-deprecated */
-#include <openssl/engine.h>
-#include <openssl/evp.h>
-#include <openssl/objects.h>
-#include <openssl/x509.h>
-#include <openssl/asn1err.h> /* for ASN1_R_TOO_SMALL and ASN1_R_TOO_LARGE */
-
 /* CMP functions related to PKIStatus */

 int ossl_cmp_pkisi_get_status(const OSSL_CMP_PKISI *si)
@@ -189,7 +178,7 @@ static char *snprint_PKIStatusInfo_parts(int status, int fail_info,
     write_ptr += printed_chars;                                \
     bufsize -= printed_chars;

-    printed_chars = BIO_snprintf(write_ptr, bufsize, "%s", status_string);
+    printed_chars = snprintf(write_ptr, bufsize, "%s", status_string);
     ADVANCE_BUFFER;

     /*
@@ -197,13 +186,13 @@ static char *snprint_PKIStatusInfo_parts(int status, int fail_info,
      * if present, print failInfo before statusString because it is more concise
      */
     if (fail_info != -1 && fail_info != 0) {
-        printed_chars = BIO_snprintf(write_ptr, bufsize, "; PKIFailureInfo: ");
+        printed_chars = snprintf(write_ptr, bufsize, "; PKIFailureInfo: ");
         ADVANCE_BUFFER;
         for (failure = 0; failure <= OSSL_CMP_PKIFAILUREINFO_MAX; failure++) {
             if ((fail_info & (1 << failure)) != 0) {
                 failure_string = CMP_PKIFAILUREINFO_to_string(failure);
                 if (failure_string != NULL) {
-                    printed_chars = BIO_snprintf(write_ptr, bufsize, "%s%s",
+                    printed_chars = snprintf(write_ptr, bufsize, "%s%s",
                         failinfo_found ? ", " : "",
                         failure_string);
                     ADVANCE_BUFFER;
@@ -214,21 +203,22 @@ static char *snprint_PKIStatusInfo_parts(int status, int fail_info,
     }
     if (!failinfo_found && status != OSSL_CMP_PKISTATUS_accepted
         && status != OSSL_CMP_PKISTATUS_grantedWithMods) {
-        printed_chars = BIO_snprintf(write_ptr, bufsize, "; <no failure info>");
+        printed_chars = snprintf(write_ptr, bufsize, "; <no failure info>");
         ADVANCE_BUFFER;
     }

     /* statusString sequence is optional and may be empty */
     n_status_strings = sk_ASN1_UTF8STRING_num(status_strings);
     if (n_status_strings > 0) {
-        printed_chars = BIO_snprintf(write_ptr, bufsize, "; StatusString%s: ",
+        printed_chars = snprintf(write_ptr, bufsize, "; StatusString%s: ",
             n_status_strings > 1 ? "s" : "");
         ADVANCE_BUFFER;
         for (i = 0; i < n_status_strings; i++) {
             text = sk_ASN1_UTF8STRING_value(status_strings, i);
-            printed_chars = BIO_snprintf(write_ptr, bufsize, "\"%.*s\"%s",
-                ASN1_STRING_length(text),
-                ASN1_STRING_get0_data(text),
+            printed_chars = snprintf(write_ptr, bufsize, "\"%.*s\"%s",
+                (int)ASN1_STRING_get_length(text),
+                ASN1_STRING_get_length(text) ? ASN1_STRING_get0_data(text)
+                                             : (const unsigned char *)"",
                 i < n_status_strings - 1 ? ", " : "");
             ADVANCE_BUFFER;
         }
@@ -288,7 +278,7 @@ OSSL_CMP_PKISI *OSSL_CMP_STATUSINFO_new(int status, int fail_info,

     if (text != NULL) {
         if ((utf8_text = ASN1_UTF8STRING_new()) == NULL
-            || !ASN1_STRING_set(utf8_text, text, -1))
+            || !ossl_asn1_string_set1_string(utf8_text, text))
             goto err;
         if ((si->statusString = sk_ASN1_UTF8STRING_new_null()) == NULL)
             goto err;
diff --git a/deps/openssl/openssl/crypto/cmp/cmp_util.c b/deps/openssl/openssl/crypto/cmp/cmp_util.c
index 13308addd68..d32106266e5 100644
--- a/deps/openssl/openssl/crypto/cmp/cmp_util.c
+++ b/deps/openssl/openssl/crypto/cmp/cmp_util.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright Nokia 2007-2019
  * Copyright Siemens AG 2015-2019
  *
@@ -9,6 +9,7 @@
  * https://www.openssl.org/source/license.html
  */

+#include <stdio.h>
 #include <string.h>
 #include <openssl/cmp_util.h>
 #include "cmp_local.h" /* just for decls of internal functions defined here */
@@ -55,7 +56,7 @@ static OSSL_CMP_severity parse_level(const char *level)

     if (HAS_PREFIX(level, OSSL_CMP_LOG_PREFIX))
         level += strlen(OSSL_CMP_LOG_PREFIX);
-    len = end_level - level;
+    len = (int)(end_level - level);
     if (len > max_level_len)
         return -1;
     OPENSSL_strlcpy(level_copy, level, len + 1);
@@ -170,13 +171,13 @@ void OSSL_CMP_print_errors_cb(OSSL_CMP_log_cb_t log_fn)
         }
 #endif
         if (rs == NULL) {
-            BIO_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", reason);
+            snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", reason);
             rs = rsbuf;
         }
         if (data != NULL && (flags & ERR_TXT_STRING) != 0)
-            BIO_snprintf(msg, sizeof(msg), "%s:%s", rs, data);
+            snprintf(msg, sizeof(msg), "%s:%s", rs, data);
         else
-            BIO_snprintf(msg, sizeof(msg), "%s", rs);
+            snprintf(msg, sizeof(msg), "%s", rs);

         if (log_fn == NULL) {
 #ifndef OPENSSL_NO_STDIO
@@ -219,15 +220,16 @@ int ossl_cmp_X509_STORE_add1_certs(X509_STORE *store, STACK_OF(X509) *certs,
 }

 int ossl_cmp_sk_ASN1_UTF8STRING_push_str(STACK_OF(ASN1_UTF8STRING) *sk,
-    const char *text, int len)
+    const char *text, size_t len)
 {
     ASN1_UTF8STRING *utf8string;

-    if (!ossl_assert(sk != NULL && text != NULL))
+    /* text == NULL with len == 0 is the canonical empty string and is valid */
+    if (!ossl_assert(sk != NULL && (text != NULL || len == 0)))
         return 0;
     if ((utf8string = ASN1_UTF8STRING_new()) == NULL)
         return 0;
-    if (!ASN1_STRING_set(utf8string, text, len))
+    if (!ossl_asn1_string_set1_data(utf8string, (const uint8_t *)text, len))
         goto err;
     if (!sk_ASN1_UTF8STRING_push(sk, utf8string))
         goto err;
diff --git a/deps/openssl/openssl/crypto/cmp/cmp_vfy.c b/deps/openssl/openssl/crypto/cmp/cmp_vfy.c
index e79adb09d38..647dd044f21 100644
--- a/deps/openssl/openssl/crypto/cmp/cmp_vfy.c
+++ b/deps/openssl/openssl/crypto/cmp/cmp_vfy.c
@@ -12,14 +12,6 @@
 /* CMP functions for PKIMessage checking */

 #include "cmp_local.h"
-#include <openssl/cmp_util.h>
-
-/* explicit #includes not strictly needed since implied by the above: */
-#include <openssl/asn1t.h>
-#include <openssl/cmp.h>
-#include <openssl/crmf.h>
-#include <openssl/err.h>
-#include <openssl/x509.h>

 /* Verify a message protected by signature according to RFC section 5.1.3.3 */
 static int verify_signature(const OSSL_CMP_CTX *cmp_ctx,
@@ -255,7 +247,7 @@ static int cert_acceptable(const OSSL_CMP_CTX *ctx,
     int self_issued = X509_check_issued(cert, cert) == X509_V_OK;
     char *str;
     X509_VERIFY_PARAM *vpm = ts != NULL ? X509_STORE_get0_param(ts) : NULL;
-    int time_cmp;
+    int err;

     ossl_cmp_log3(INFO, ctx, " considering %s%s %s with..",
         self_issued ? "self-issued " : "", desc1, desc2);
@@ -275,13 +267,28 @@ static int cert_acceptable(const OSSL_CMP_CTX *ctx,
         return 0;
     }

-    time_cmp = X509_cmp_timeframe(vpm, X509_get0_notBefore(cert),
-        X509_get0_notAfter(cert));
-    if (time_cmp != 0) {
-        int err = time_cmp > 0 ? X509_V_ERR_CERT_HAS_EXPIRED
-                               : X509_V_ERR_CERT_NOT_YET_VALID;
+    if (!X509_check_certificate_times(vpm, cert, &err)) {
+        const char *message;

-        ossl_cmp_warn(ctx, time_cmp > 0 ? "cert has expired" : "cert is not yet valid");
+        switch (err) {
+        case X509_V_ERR_CERT_NOT_YET_VALID:
+            message = "cert is not yet valid";
+            break;
+        case X509_V_ERR_CERT_HAS_EXPIRED:
+            message = "cert has expired";
+            break;
+        case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
+            message = "cert has an invalid not before field";
+            break;
+        case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD:
+            message = "cert has an invalid not after field";
+            break;
+        default:
+            message = "cert is invalid for an unspecfied reason";
+            break;
+        }
+
+        ossl_cmp_warn(ctx, message);
         if (ctx->log_cb != NULL /* logging not temporarily disabled */
             && verify_cb_cert(ts, cert, err) <= 0)
             return 0;
@@ -322,21 +329,31 @@ static int check_cert_path(const OSSL_CMP_CTX *ctx, X509_STORE *store,
 /*
  * Exceptional handling for 3GPP TS 33.310 [3G/LTE Network Domain Security
  * (NDS); Authentication Framework (AF)], only to use for IP messages
- * and if the ctx option is explicitly set: use self-issued certificates
- * from extraCerts as trust anchor to validate sender cert -
- * provided it also can validate the newly enrolled certificate
+ * and if the ctx option is explicitly set: use self-issued certificates from
+ * extraCerts as trust anchors when validating the CMP message protection cert
+ * in this and any subsequent responses from the server in the same transaction,
+ * but only if these extraCerts can also be used as trust anchors for validating
+ * the newly enrolled certificate received in the IP message.
  */
 static int check_cert_path_3gpp(const OSSL_CMP_CTX *ctx,
     const OSSL_CMP_MSG *msg, X509 *scrt)
 {
     int valid = 0;
     X509_STORE *store;
+    STACK_OF(X509) *extraCerts;

     if (!ctx->permitTAInExtraCertsForIR)
         return 0;

+    /*
+     * Initially, use extraCerts from the IP message.
+     * For subsequent msgs (pollRep or PKIConf) in the same transaction,
+     * use extraCertsIn remembered from earlier message (typically, the IP message).
+     * The extraCertsIn field will be cleared by OSSL_CMP_CTX_reinit().
+     */
+    extraCerts = ctx->extraCertsIn == NULL ? msg->extraCerts : ctx->extraCertsIn;
     if ((store = X509_STORE_new()) == NULL
-        || !ossl_cmp_X509_STORE_add1_certs(store, msg->extraCerts,
+        || !ossl_cmp_X509_STORE_add1_certs(store, extraCerts,
             1 /* self-issued only */))
         goto err;

@@ -552,10 +569,11 @@ end:
  * (in this order) and is path is validated against ctx->trusted.
  * On success cache the found cert using ossl_cmp_ctx_set1_validatedSrvCert().
  *
- * If ctx->permitTAInExtraCertsForIR is true and when validating a CMP IP msg,
- * the trust anchor for validating the IP msg may be taken from msg->extraCerts
- * if a self-issued certificate is found there that can be used to
- * validate the enrolled certificate returned in the IP.
+ * If ctx->permitTAInExtraCertsForIR is true, when validating a CMP IP message,
+ * trust anchors for validating the IP message (and any subsequent responses
+ * by the server in the same transaction) may be taken from msg->extraCerts
+ * if self-issued certificates are found there that can also be used
+ * to validate the newly enrolled certificate returned in the IP msg.
  * This is according to the need given in 3GPP TS 33.310.
  *
  * Returns 1 on success, 0 on error or validation failed.
@@ -658,24 +676,35 @@ int OSSL_CMP_validate_msg(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg)
     return 0;
 }

-static int check_transactionID_or_nonce(ASN1_OCTET_STRING *expected,
-    ASN1_OCTET_STRING *actual, int reason)
+static int check_transactionID_or_nonce(OSSL_CMP_CTX *ctx, const ASN1_OCTET_STRING *expected,
+    const ASN1_OCTET_STRING *actual, int bodytype, int reason)
 {
     if (expected != NULL
         && (actual == NULL || ASN1_OCTET_STRING_cmp(expected, actual) != 0)) {
 #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
-        char *expected_str, *actual_str;
+        char *expected_str, *actual_str, *expected_msg, *actual_msg;
+        const int strict = bodytype != OSSL_CMP_PKIBODY_ERROR || !ctx->nonmatchedErrorNonces;
+        int res = 0;

+        if (reason == 0) /* at end of polling, overall check is not yet complete */
+            return res;
         expected_str = i2s_ASN1_OCTET_STRING(NULL, expected);
+        expected_msg = expected_str == NULL ? "?" : expected_str;
         actual_str = actual == NULL ? NULL : i2s_ASN1_OCTET_STRING(NULL, actual);
-        ERR_raise_data(ERR_LIB_CMP, reason,
-            "expected = %s, actual = %s",
-            expected_str == NULL ? "?" : expected_str,
-            actual == NULL ? "(none)" : actual_str == NULL ? "?"
-                                                           : actual_str);
+        actual_msg = actual == NULL ? "(none)" : actual_str == NULL ? "?"
+                                                                    : actual_str;
+        if (strict) {
+            ERR_raise_data(ERR_LIB_CMP, reason, "expected = %s, actual = %s",
+                expected_msg, actual_msg);
+        } else {
+            ossl_cmp_log3(WARN, ctx, "ignoring missing or non-matching %s of error message, expected = %s, actual = %s",
+                reason == CMP_R_TRANSACTIONID_UNMATCHED ? "transactionID" : "recipNonce",
+                expected_msg, actual_msg);
+            res = 1;
+        }
         OPENSSL_free(expected_str);
         OPENSSL_free(actual_str);
-        return 0;
+        return res;
 #endif
     }
     return 1;
@@ -706,11 +735,13 @@ int ossl_cmp_msg_check_update(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg,
 {
     OSSL_CMP_PKIHEADER *hdr;
     const X509_NAME *expected_sender;
+    int bodytype, end_of_polling;
     int num_untrusted, num_added, res;

     if (!ossl_assert(ctx != NULL && msg != NULL && msg->header != NULL))
         return 0;
     hdr = OSSL_CMP_MSG_get0_header(msg);
+    bodytype = OSSL_CMP_MSG_get_bodytype(msg);

     /* If expected_sender is given, validate sender name of received msg */
     expected_sender = ctx->expected_sender;
@@ -720,6 +751,11 @@ int ossl_cmp_msg_check_update(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg,
         const X509_NAME *actual_sender;
         char *str;

+        if (hdr->sender == NULL) {
+            ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_SENDER_IDENTIFICATION);
+            return 0;
+        }
+
         if (hdr->sender->type != GEN_DIRNAME) {
             ERR_raise(ERR_LIB_CMP, CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED);
             return 0;
@@ -739,6 +775,8 @@ int ossl_cmp_msg_check_update(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg,
             return 0;
         }
     }
+
+    /* Ignoring recipient */
     /* Note: if recipient was NULL-DN it could be learned here if needed */

     num_added = sk_X509_num(msg->extraCerts);
@@ -805,7 +843,7 @@ int ossl_cmp_msg_check_update(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg,
 #endif
     }

-    if (OSSL_CMP_MSG_get_bodytype(msg) < 0) {
+    if (bodytype < 0) {
 #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
         ERR_raise(ERR_LIB_CMP, CMP_R_PKIBODY_ERROR);
         return 0;
@@ -813,30 +851,25 @@ int ossl_cmp_msg_check_update(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg,
     }

     /* compare received transactionID with the expected one in previous msg */
-    if (!check_transactionID_or_nonce(ctx->transactionID, hdr->transactionID,
-            CMP_R_TRANSACTIONID_UNMATCHED))
+    if (!check_transactionID_or_nonce(ctx, ctx->transactionID, hdr->transactionID,
+            bodytype, CMP_R_TRANSACTIONID_UNMATCHED))
         return 0;

     /*
-     * enable clearing irrelevant errors
-     * in attempts to validate recipient nonce in case of delayed delivery.
+     * Compare received nonce with the one we sent last.
+     * When we received the final response at the end of polling,
+     * we allow also the nonce that we sent earlier with the original request,
+     * as specified in RFC 9483 section 5.1.5.
      */
-    (void)ERR_set_mark();
-    /* compare received nonce with the one we sent */
-    if (!check_transactionID_or_nonce(ctx->senderNonce, hdr->recipNonce,
-            CMP_R_RECIPNONCE_UNMATCHED)) {
-        /* check if we are polling and received final response */
-        if (ctx->first_senderNonce == NULL
-            || OSSL_CMP_MSG_get_bodytype(msg) == OSSL_CMP_PKIBODY_POLLREP
-            /* compare received nonce with our sender nonce at poll start */
-            || !check_transactionID_or_nonce(ctx->first_senderNonce,
-                hdr->recipNonce,
-                CMP_R_RECIPNONCE_UNMATCHED)) {
-            (void)ERR_clear_last_mark();
+    end_of_polling = ctx->first_senderNonce != NULL && bodytype != OSSL_CMP_PKIBODY_POLLREP;
+    if (!check_transactionID_or_nonce(ctx, ctx->senderNonce, hdr->recipNonce,
+            bodytype, end_of_polling ? 0 : CMP_R_RECIPNONCE_UNMATCHED)) {
+        if (!end_of_polling
+            /* otherwise, compare received nonce with our sender nonce at poll start: */
+            || !check_transactionID_or_nonce(ctx, ctx->first_senderNonce, hdr->recipNonce,
+                bodytype, CMP_R_RECIPNONCE_UNMATCHED))
             return 0;
-        }
     }
-    (void)ERR_pop_to_mark();

     /* if not yet present, learn transactionID */
     if (ctx->transactionID == NULL
@@ -858,7 +891,7 @@ int ossl_cmp_msg_check_update(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg,
          * the caPubs field may be directly trusted as a root CA
          * certificate by the initiator.'
          */
-        switch (OSSL_CMP_MSG_get_bodytype(msg)) {
+        switch (bodytype) {
         case OSSL_CMP_PKIBODY_IP:
         case OSSL_CMP_PKIBODY_CP:
         case OSSL_CMP_PKIBODY_KUP:
diff --git a/deps/openssl/openssl/crypto/cms/build.info b/deps/openssl/openssl/crypto/cms/build.info
index 5fabea7c53d..9ff76c8d852 100644
--- a/deps/openssl/openssl/crypto/cms/build.info
+++ b/deps/openssl/openssl/crypto/cms/build.info
@@ -2,4 +2,4 @@ LIBS=../../libcrypto
 SOURCE[../../libcrypto]= \
         cms_lib.c cms_asn1.c cms_att.c cms_io.c cms_smime.c cms_err.c \
         cms_sd.c cms_dd.c cms_cd.c cms_env.c cms_enc.c cms_ess.c \
-        cms_pwri.c cms_kari.c cms_rsa.c cms_dh.c cms_ec.c
+        cms_pwri.c cms_kari.c cms_rsa.c cms_dh.c cms_ec.c cms_kem.c cms_kemri.c
diff --git a/deps/openssl/openssl/crypto/cms/cms_asn1.c b/deps/openssl/openssl/crypto/cms/cms_asn1.c
index b3c10369903..4381651897f 100644
--- a/deps/openssl/openssl/crypto/cms/cms_asn1.c
+++ b/deps/openssl/openssl/crypto/cms/cms_asn1.c
@@ -13,6 +13,8 @@
 #include <openssl/cms.h>
 #include "cms_local.h"

+#include <crypto/asn1.h>
+
 ASN1_SEQUENCE(CMS_IssuerAndSerialNumber) = {
     ASN1_SIMPLE(CMS_IssuerAndSerialNumber, issuer, X509_NAME),
     ASN1_SIMPLE(CMS_IssuerAndSerialNumber, serialNumber, ASN1_INTEGER)
@@ -183,13 +185,55 @@ ASN1_SEQUENCE(CMS_PasswordRecipientInfo) = {
     ASN1_SIMPLE(CMS_PasswordRecipientInfo, encryptedKey, ASN1_OCTET_STRING)
 } ASN1_SEQUENCE_END(CMS_PasswordRecipientInfo)

+static int cms_kemri_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
+    void *exarg)
+{
+    CMS_KEMRecipientInfo *kemri = (CMS_KEMRecipientInfo *)*pval;
+
+    if (operation == ASN1_OP_NEW_POST) {
+        kemri->ctx = EVP_CIPHER_CTX_new();
+        if (kemri->ctx == NULL)
+            return 0;
+        EVP_CIPHER_CTX_set_flags(kemri->ctx, EVP_CIPHER_CTX_FLAG_WRAP_ALLOW);
+        kemri->pctx = NULL;
+    } else if (operation == ASN1_OP_FREE_POST) {
+        EVP_PKEY_CTX_free(kemri->pctx);
+        EVP_CIPHER_CTX_free(kemri->ctx);
+        ASN1_OCTET_STRING_free(kemri->ukm);
+    }
+    return 1;
+}
+
+ASN1_SEQUENCE_cb(CMS_KEMRecipientInfo, cms_kemri_cb) = {
+    ASN1_EMBED(CMS_KEMRecipientInfo, version, INT32),
+    ASN1_SIMPLE(CMS_KEMRecipientInfo, rid, CMS_SignerIdentifier),
+    ASN1_SIMPLE(CMS_KEMRecipientInfo, kem, X509_ALGOR),
+    ASN1_SIMPLE(CMS_KEMRecipientInfo, kemct, ASN1_OCTET_STRING),
+    ASN1_SIMPLE(CMS_KEMRecipientInfo, kdf, X509_ALGOR),
+    ASN1_EMBED(CMS_KEMRecipientInfo, kekLength, INT32),
+    ASN1_EXP_OPT(CMS_KEMRecipientInfo, ukm, ASN1_OCTET_STRING, 0),
+    ASN1_SIMPLE(CMS_KEMRecipientInfo, wrap, X509_ALGOR),
+    ASN1_SIMPLE(CMS_KEMRecipientInfo, encryptedKey, ASN1_OCTET_STRING)
+} ASN1_SEQUENCE_END_cb(CMS_KEMRecipientInfo, CMS_KEMRecipientInfo)
+
+ASN1_ADB_TEMPLATE(ori_def) = ASN1_SIMPLE(CMS_OtherRecipientInfo, d.other, ASN1_ANY);
+
+ASN1_ADB(CMS_OtherRecipientInfo) = {
+    ADB_ENTRY(NID_id_smime_ori_kem, ASN1_SIMPLE(CMS_OtherRecipientInfo, d.kemri, CMS_KEMRecipientInfo))
+} ASN1_ADB_END(CMS_OtherRecipientInfo, 0, oriType, 0, &ori_def_tt, NULL);
+
+DECLARE_ASN1_FUNCTIONS(CMS_OtherRecipientInfo)
+
 ASN1_SEQUENCE(CMS_OtherRecipientInfo) = {
     ASN1_SIMPLE(CMS_OtherRecipientInfo, oriType, ASN1_OBJECT),
-    ASN1_OPT(CMS_OtherRecipientInfo, oriValue, ASN1_ANY)
-} static_ASN1_SEQUENCE_END(CMS_OtherRecipientInfo)
+    ASN1_ADB_OBJECT(CMS_OtherRecipientInfo)
+} ASN1_SEQUENCE_END(CMS_OtherRecipientInfo)
+
+IMPLEMENT_ASN1_FUNCTIONS(CMS_OtherRecipientInfo)

 /* Free up RecipientInfo additional data */
-static int cms_ri_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
+static int cms_ri_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
+    void *exarg)
 {
     if (operation == ASN1_OP_FREE_PRE) {
         CMS_RecipientInfo *ri = (CMS_RecipientInfo *)*pval;
@@ -205,6 +249,23 @@ static int cms_ri_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void
             CMS_PasswordRecipientInfo *pwri = ri->d.pwri;
             OPENSSL_clear_free(pwri->pass, pwri->passlen);
         }
+    } else if (operation == ASN1_OP_D2I_POST) {
+        CMS_RecipientInfo *ri = (CMS_RecipientInfo *)*pval;
+
+        ri->type = ri->encoded_type;
+        if (ri->type == CMS_RECIPINFO_OTHER) {
+            int nid;
+
+            nid = OBJ_obj2nid(ri->d.ori->oriType);
+            /* For ORI, map NID to specific type */
+            if (nid == NID_id_smime_ori_kem)
+                ri->type = CMS_RECIPINFO_KEM;
+            /* Otherwise stay with generic CMS_RECIPINFO_OTHER type */
+        }
+    } else if (operation == ASN1_OP_NEW_POST) {
+        CMS_RecipientInfo *ri = (CMS_RecipientInfo *)*pval;
+
+        ri->type = ri->encoded_type;
     }
     return 1;
 }
@@ -215,7 +276,7 @@ ASN1_CHOICE_cb(CMS_RecipientInfo, cms_ri_cb) = {
     ASN1_IMP(CMS_RecipientInfo, d.kekri, CMS_KEKRecipientInfo, 2),
     ASN1_IMP(CMS_RecipientInfo, d.pwri, CMS_PasswordRecipientInfo, 3),
     ASN1_IMP(CMS_RecipientInfo, d.ori, CMS_OtherRecipientInfo, 4)
-} ASN1_CHOICE_END_cb(CMS_RecipientInfo, CMS_RecipientInfo, type)
+} ASN1_CHOICE_END_cb(CMS_RecipientInfo, CMS_RecipientInfo, encoded_type)

 ASN1_NDEF_SEQUENCE(CMS_EnvelopedData) = {
     ASN1_EMBED(CMS_EnvelopedData, version, INT32),
@@ -297,7 +358,7 @@ static int cms_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
     switch (operation) {

     case ASN1_OP_STREAM_PRE:
-        if (CMS_stream(&sarg->boundary, cms) <= 0)
+        if (ossl_cms_stream(cms) <= 0)
             return 0;
         /* fall through */
     case ASN1_OP_DETACHED_PRE:
@@ -312,6 +373,13 @@ static int cms_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
             return 0;
         break;

+    case ASN1_OP_GET0_STREAM_CONTENT: {
+        ASN1_STRING **content = exarg;
+        ASN1_OCTET_STRING **pos = CMS_get0_content(cms);
+
+        *content = pos == NULL ? NULL : *pos;
+    } break;
+
     case ASN1_OP_FREE_POST:
         OPENSSL_free(cms->ctx.propq);
         break;
@@ -403,3 +471,32 @@ int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg, ASN1_OCTET_S
     intsi.pecsi = &ecsi;
     return ASN1_item_i2d(intsi.a, pder, ASN1_ITEM_rptr(CMS_SharedInfo));
 }
+
+/*
+ * Utilities to encode the CMS_CMSORIforKEMOtherInfo structure used during key
+ * derivation.
+ */
+
+typedef struct {
+    X509_ALGOR *wrap;
+    uint32_t kekLength;
+    ASN1_OCTET_STRING *ukm;
+} CMS_CMSORIforKEMOtherInfo;
+
+ASN1_SEQUENCE(CMS_CMSORIforKEMOtherInfo) = {
+    ASN1_SIMPLE(CMS_CMSORIforKEMOtherInfo, wrap, X509_ALGOR),
+    ASN1_EMBED(CMS_CMSORIforKEMOtherInfo, kekLength, INT32),
+    ASN1_EXP_OPT(CMS_CMSORIforKEMOtherInfo, ukm, ASN1_OCTET_STRING, 0),
+} static_ASN1_SEQUENCE_END(CMS_CMSORIforKEMOtherInfo)
+
+int CMS_CMSORIforKEMOtherInfo_encode(unsigned char **pder, X509_ALGOR *wrap, ASN1_OCTET_STRING *ukm, int keylen)
+{
+    CMS_CMSORIforKEMOtherInfo kem_otherinfo;
+
+    kem_otherinfo.wrap = wrap;
+    kem_otherinfo.kekLength = keylen;
+    kem_otherinfo.ukm = ukm;
+
+    return ASN1_item_i2d((ASN1_VALUE *)&kem_otherinfo, pder,
+        ASN1_ITEM_rptr(CMS_CMSORIforKEMOtherInfo));
+}
diff --git a/deps/openssl/openssl/crypto/cms/cms_att.c b/deps/openssl/openssl/crypto/cms/cms_att.c
index 86852afda43..49894dce60b 100644
--- a/deps/openssl/openssl/crypto/cms/cms_att.c
+++ b/deps/openssl/openssl/crypto/cms/cms_att.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -113,7 +113,7 @@ int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,
     return 0;
 }

-void *CMS_signed_get0_data_by_OBJ(const CMS_SignerInfo *si,
+const void *CMS_signed_get0_data_by_OBJ(const CMS_SignerInfo *si,
     const ASN1_OBJECT *oid,
     int lastpos, int type)
 {
@@ -182,7 +182,7 @@ int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si,
     return 0;
 }

-void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
+const void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
     int lastpos, int type)
 {
     return X509at_get0_data_by_OBJ(si->unsignedAttrs, oid, lastpos, type);
diff --git a/deps/openssl/openssl/crypto/cms/cms_dd.c b/deps/openssl/openssl/crypto/cms/cms_dd.c
index aff9af63caf..6449bf83ea1 100644
--- a/deps/openssl/openssl/crypto/cms/cms_dd.c
+++ b/deps/openssl/openssl/crypto/cms/cms_dd.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,6 +15,8 @@
 #include <openssl/cms.h>
 #include "cms_local.h"

+#include <crypto/asn1.h>
+
 /* CMS DigestedData Utilities */

 CMS_ContentInfo *ossl_cms_DigestedData_create(const EVP_MD *md,
@@ -39,7 +41,8 @@ CMS_ContentInfo *ossl_cms_DigestedData_create(const EVP_MD *md,
     dd->version = 0;
     dd->encapContentInfo->eContentType = OBJ_nid2obj(NID_pkcs7_data);

-    X509_ALGOR_set_md(dd->digestAlgorithm, md);
+    if (!X509_ALGOR_set_md(dd->digestAlgorithm, md))
+        goto err;

     return cms;

@@ -89,7 +92,7 @@ int ossl_cms_DigestedData_do_final(const CMS_ContentInfo *cms, BIO *chain,
         else
             r = 1;
     } else {
-        if (!ASN1_STRING_set(dd->digest, md, mdlen))
+        if (!ossl_asn1_string_set1_data(dd->digest, md, mdlen))
             goto err;
         r = 1;
     }
diff --git a/deps/openssl/openssl/crypto/cms/cms_dh.c b/deps/openssl/openssl/crypto/cms/cms_dh.c
index 9c0b3c85e17..0548666524c 100644
--- a/deps/openssl/openssl/crypto/cms/cms_dh.c
+++ b/deps/openssl/openssl/crypto/cms/cms_dh.c
@@ -29,7 +29,7 @@ static int dh_cms_set_peerkey(EVP_PKEY_CTX *pctx,
     BIGNUM *bnpub = NULL;
     const unsigned char *p;
     unsigned char *buf = NULL;
-    int plen;
+    size_t plen;

     X509_ALGOR_get0(&aoid, &atype, &aval, alg);
     if (OBJ_obj2nid(aoid) != NID_dhpublicnumber)
@@ -43,29 +43,33 @@ static int dh_cms_set_peerkey(EVP_PKEY_CTX *pctx,
         goto err;

     /* Get public key */
-    plen = ASN1_STRING_length(pubkey);
+    plen = ASN1_STRING_get_length(pubkey);
+    if (plen > INT_MAX)
+        goto err;
     p = ASN1_STRING_get0_data(pubkey);
     if (p == NULL || plen == 0)
         goto err;

-    if ((public_key = d2i_ASN1_INTEGER(NULL, &p, plen)) == NULL)
+    if ((public_key = d2i_ASN1_INTEGER(NULL, &p, (int)plen)) == NULL)
         goto err;
     /*
      * Pad to full p parameter size as that is checked by
      * EVP_PKEY_set1_encoded_public_key()
      */
     plen = EVP_PKEY_get_size(pk);
+    if (plen > INT_MAX)
+        goto err;
     if ((bnpub = ASN1_INTEGER_to_BN(public_key, NULL)) == NULL)
         goto err;
     if ((buf = OPENSSL_malloc(plen)) == NULL)
         goto err;
-    if (BN_bn2binpad(bnpub, buf, plen) < 0)
+    if (BN_bn2binpad(bnpub, buf, (int)plen) < 0)
         goto err;

     pkpeer = EVP_PKEY_new();
     if (pkpeer == NULL
         || !EVP_PKEY_copy_parameters(pkpeer, pk)
-        || EVP_PKEY_set1_encoded_public_key(pkpeer, buf, plen) <= 0)
+        || EVP_PKEY_set1_encoded_public_key(pkpeer, buf, (int)plen) <= 0)
         goto err;

     if (EVP_PKEY_derive_set_peer(pctx, pkpeer) > 0)
@@ -86,7 +90,8 @@ static int dh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri)
     const unsigned char *p;
     unsigned char *dukm = NULL;
     size_t dukmlen = 0;
-    int keylen, plen;
+    int keylen;
+    size_t plen;
     EVP_CIPHER *kekcipher = NULL;
     EVP_CIPHER_CTX *kekctx;
     const ASN1_OBJECT *aoid;
@@ -116,8 +121,10 @@ static int dh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri)
         goto err;

     p = ASN1_STRING_get0_data(parameter);
-    plen = ASN1_STRING_length(parameter);
-    kekalg = d2i_X509_ALGOR(NULL, &p, plen);
+    plen = ASN1_STRING_get_length(parameter);
+    if (plen > INT_MAX)
+        goto err;
+    kekalg = d2i_X509_ALGOR(NULL, &p, (int)plen);
     if (kekalg == NULL)
         goto err;
     kekctx = CMS_RecipientInfo_kari_get0_ctx(ri);
@@ -146,13 +153,15 @@ static int dh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri)
         goto err;

     if (ukm != NULL) {
-        dukmlen = ASN1_STRING_length(ukm);
-        dukm = OPENSSL_memdup(ASN1_STRING_get0_data(ukm), dukmlen);
+        dukmlen = ASN1_STRING_get_length(ukm);
+        if (dukmlen > INT_MAX)
+            goto err;
+        dukm = OPENSSL_memdup(ASN1_STRING_get0_data(ukm), (int)dukmlen);
         if (dukm == NULL)
             goto err;
     }

-    if (EVP_PKEY_CTX_set0_dh_kdf_ukm(pctx, dukm, dukmlen) <= 0)
+    if (EVP_PKEY_CTX_set0_dh_kdf_ukm(pctx, dukm, (int)dukmlen) <= 0)
         goto err;
     dukm = NULL;

@@ -240,7 +249,7 @@ static int dh_cms_encrypt(CMS_RecipientInfo *ri)
         if (penclen <= 0)
             goto err;
         ASN1_STRING_set0(pubkey, penc, penclen);
-        ossl_asn1_string_set_bits_left(pubkey, 0);
+        ossl_asn1_bit_string_set_unused_bits(pubkey, 0);

         penc = NULL;
         (void)X509_ALGOR_set0(talg, OBJ_nid2obj(NID_dhpublicnumber),
@@ -298,13 +307,15 @@ static int dh_cms_encrypt(CMS_RecipientInfo *ri)
         goto err;

     if (ukm != NULL) {
-        dukmlen = ASN1_STRING_length(ukm);
+        dukmlen = ASN1_STRING_get_length(ukm);
+        if (dukmlen > INT_MAX)
+            goto err;
         dukm = OPENSSL_memdup(ASN1_STRING_get0_data(ukm), dukmlen);
         if (dukm == NULL)
             goto err;
     }

-    if (EVP_PKEY_CTX_set0_dh_kdf_ukm(pctx, dukm, dukmlen) <= 0)
+    if (EVP_PKEY_CTX_set0_dh_kdf_ukm(pctx, dukm, (int)dukmlen) <= 0)
         goto err;
     dukm = NULL;

diff --git a/deps/openssl/openssl/crypto/cms/cms_ec.c b/deps/openssl/openssl/crypto/cms/cms_ec.c
index 917bf784dae..29760229068 100644
--- a/deps/openssl/openssl/crypto/cms/cms_ec.c
+++ b/deps/openssl/openssl/crypto/cms/cms_ec.c
@@ -79,7 +79,7 @@ static int ecdh_cms_set_peerkey(EVP_PKEY_CTX *pctx,
     int rv = 0;
     EVP_PKEY *pkpeer = NULL;
     const unsigned char *p;
-    int plen;
+    size_t plen;

     X509_ALGOR_get0(&aoid, &atype, &aval, alg);
     if (OBJ_obj2nid(aoid) != NID_X9_62_id_ecPublicKey)
@@ -106,12 +106,14 @@ static int ecdh_cms_set_peerkey(EVP_PKEY_CTX *pctx,
             goto err;
     }
     /* We have parameters now set public key */
-    plen = ASN1_STRING_length(pubkey);
+    plen = ASN1_STRING_get_length(pubkey);
+    if (plen > INT_MAX)
+        goto err;
     p = ASN1_STRING_get0_data(pubkey);
     if (p == NULL || plen == 0)
         goto err;

-    if (EVP_PKEY_set1_encoded_public_key(pkpeer, p, plen) <= 0)
+    if (EVP_PKEY_set1_encoded_public_key(pkpeer, p, (int)plen) <= 0)
         goto err;

     if (EVP_PKEY_derive_set_peer(pctx, pkpeer) > 0)
@@ -163,7 +165,8 @@ static int ecdh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri)
     ASN1_OCTET_STRING *ukm;
     const unsigned char *p;
     unsigned char *der = NULL;
-    int plen, keylen;
+    int keylen, plen_i;
+    size_t plen;
     EVP_CIPHER *kekcipher = NULL;
     EVP_CIPHER_CTX *kekctx;
     const ASN1_OBJECT *aoid = NULL;
@@ -186,8 +189,10 @@ static int ecdh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri)
         return 0;

     p = ASN1_STRING_get0_data(parameter);
-    plen = ASN1_STRING_length(parameter);
-    kekalg = d2i_X509_ALGOR(NULL, &p, plen);
+    plen = ASN1_STRING_get_length(parameter);
+    if (plen > INT_MAX)
+        goto err;
+    kekalg = d2i_X509_ALGOR(NULL, &p, (int)plen);
     if (kekalg == NULL)
         goto err;
     kekctx = CMS_RecipientInfo_kari_get0_ctx(ri);
@@ -206,12 +211,12 @@ static int ecdh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri)
     if (EVP_PKEY_CTX_set_ecdh_kdf_outlen(pctx, keylen) <= 0)
         goto err;

-    plen = CMS_SharedInfo_encode(&der, kekalg, ukm, keylen);
+    plen_i = CMS_SharedInfo_encode(&der, kekalg, ukm, keylen);

-    if (plen <= 0)
+    if (plen_i <= 0)
         goto err;

-    if (EVP_PKEY_CTX_set0_ecdh_kdf_ukm(pctx, der, plen) <= 0)
+    if (EVP_PKEY_CTX_set0_ecdh_kdf_ukm(pctx, der, plen_i) <= 0)
         goto err;
     der = NULL;

@@ -288,7 +293,7 @@ static int ecdh_cms_encrypt(CMS_RecipientInfo *ri)
         if (enckeylen > INT_MAX || enckeylen == 0)
             goto err;
         ASN1_STRING_set0(pubkey, penc, (int)enckeylen);
-        ossl_asn1_string_set_bits_left(pubkey, 0);
+        ossl_asn1_bit_string_set_unused_bits(pubkey, 0);

         penc = NULL;
         (void)X509_ALGOR_set0(talg, OBJ_nid2obj(NID_X9_62_id_ecPublicKey),
diff --git a/deps/openssl/openssl/crypto/cms/cms_enc.c b/deps/openssl/openssl/crypto/cms/cms_enc.c
index 2aba01be3ef..087a7fe6387 100644
--- a/deps/openssl/openssl/crypto/cms/cms_enc.c
+++ b/deps/openssl/openssl/crypto/cms/cms_enc.c
@@ -17,6 +17,7 @@
 #include "crypto/evp.h"
 #include "crypto/asn1.h"
 #include "cms_local.h"
+#include "internal/sizes.h"

 /* CMS EncryptedData Utilities */

@@ -65,9 +66,13 @@ BIO *ossl_cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec,
     if (cipher != NULL) {
         fetched_ciph = EVP_CIPHER_fetch(libctx, EVP_CIPHER_get0_name(cipher),
             propq);
-        if (fetched_ciph != NULL)
-            cipher = fetched_ciph;
+    } else {
+        char txtoid[OSSL_MAX_NAME_SIZE];
+        if (OBJ_obj2txt(txtoid, sizeof(txtoid), calg->algorithm, 1) > 0)
+            fetched_ciph = EVP_CIPHER_fetch(libctx, txtoid, propq);
     }
+    if (fetched_ciph != NULL)
+        cipher = fetched_ciph;
     if (cipher == NULL) {
         (void)ERR_clear_last_mark();
         ERR_raise(ERR_LIB_CMS, CMS_R_UNKNOWN_CIPHER);
@@ -81,17 +86,19 @@ BIO *ossl_cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec,
     }

     if (enc) {
+        (void)ERR_set_mark();
         calg->algorithm = OBJ_nid2obj(EVP_CIPHER_CTX_get_type(ctx));
-        if (calg->algorithm == NULL || calg->algorithm->nid == NID_undef) {
+        (void)ERR_pop_to_mark();
+
+        if (calg->algorithm == NULL || calg->algorithm->nid == NID_undef)
+            calg->algorithm = OBJ_txt2obj(EVP_CIPHER_get0_name(cipher), 0);
+
+        if (calg->algorithm == NULL || OBJ_length(calg->algorithm) == 0) {
             ERR_raise(ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM);
             goto err;
         }
         /* Generate a random IV if we need one */
         ivlen = EVP_CIPHER_CTX_get_iv_length(ctx);
-        if (ivlen < 0) {
-            ERR_raise(ERR_LIB_CMS, ERR_R_EVP_LIB);
-            goto err;
-        }

         if (ivlen > 0) {
             if (RAND_bytes_ex(libctx, iv, ivlen, 0) <= 0)
@@ -146,7 +153,7 @@ BIO *ossl_cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec,

     if (ec->keylen != tkeylen) {
         /* If necessary set key length */
-        if (EVP_CIPHER_CTX_set_key_length(ctx, ec->keylen) <= 0) {
+        if (EVP_CIPHER_CTX_set_key_length(ctx, (int)ec->keylen) <= 0) {
             /*
              * Only reveal failure if debugging so we don't leak information
              * which may be useful in MMA.
@@ -176,15 +183,25 @@ BIO *ossl_cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec,
             goto err;
         }
         if ((EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)) {
-            memcpy(aparams.iv, piv, ivlen);
+            if (ivlen > EVP_MAX_IV_LENGTH || ivlen < 0) {
+                ERR_raise(ERR_LIB_CMS, ERR_R_EVP_LIB);
+                goto err;
+            }
+            if (ivlen != 0)
+                memcpy(aparams.iv, piv, ivlen);
             aparams.iv_len = ivlen;
             aparams.tag_len = EVP_CIPHER_CTX_get_tag_length(ctx);
-            if (aparams.tag_len <= 0)
+            if (aparams.tag_len <= 0) {
+                ASN1_TYPE_free(calg->parameter);
+                calg->parameter = NULL;
                 goto err;
+            }
         }

         if (evp_cipher_param_to_asn1_ex(ctx, calg->parameter, &aparams) <= 0) {
             ERR_raise(ERR_LIB_CMS, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR);
+            ASN1_TYPE_free(calg->parameter);
+            calg->parameter = NULL;
             goto err;
         }
         /* If parameter type not set omit parameter */
@@ -262,6 +279,7 @@ int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
 BIO *ossl_cms_EncryptedData_init_bio(const CMS_ContentInfo *cms)
 {
     CMS_EncryptedData *enc = cms->d.encryptedData;
+
     if (enc->encryptedContentInfo->cipher && enc->unprotectedAttrs)
         enc->version = 2;
     return ossl_cms_EncryptedContent_init_bio(enc->encryptedContentInfo,
diff --git a/deps/openssl/openssl/crypto/cms/cms_env.c b/deps/openssl/openssl/crypto/cms/cms_env.c
index ee86ae71d3e..d9ea9bdd7bc 100644
--- a/deps/openssl/openssl/crypto/cms/cms_env.c
+++ b/deps/openssl/openssl/crypto/cms/cms_env.c
@@ -7,6 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

+/*
+ * Low level key APIs (DH etc) are deprecated for public use, but still ok for
+ * internal use.
+ */
+#include "internal/deprecated.h"
+
 #include "internal/cryptlib.h"
 #include <openssl/asn1t.h>
 #include <openssl/pem.h>
@@ -14,6 +20,7 @@
 #include <openssl/err.h>
 #include <openssl/cms.h>
 #include <openssl/evp.h>
+#include <openssl/core_names.h>
 #include "internal/sizes.h"
 #include "crypto/asn1.h"
 #include "crypto/evp.h"
@@ -109,9 +116,12 @@ int ossl_cms_env_asn1_ctrl(CMS_RecipientInfo *ri, int cmd)
 {
     EVP_PKEY *pkey;
     int i;
-    if (ri->type == CMS_RECIPINFO_TRANS)
+
+    switch (ri->type) {
+    case CMS_RECIPINFO_TRANS:
         pkey = ri->d.ktri->pkey;
-    else if (ri->type == CMS_RECIPINFO_AGREE) {
+        break;
+    case CMS_RECIPINFO_AGREE: {
         EVP_PKEY_CTX *pctx = ri->d.kari->pctx;

         if (pctx == NULL)
@@ -119,8 +129,13 @@ int ossl_cms_env_asn1_ctrl(CMS_RecipientInfo *ri, int cmd)
         pkey = EVP_PKEY_CTX_get0_pkey(pctx);
         if (pkey == NULL)
             return 0;
-    } else
+        break;
+    }
+    case CMS_RECIPINFO_KEM:
+        return ossl_cms_kem_envelope(ri, cmd);
+    default:
         return 0;
+    }

     if (EVP_PKEY_is_a(pkey, "DHX") || EVP_PKEY_is_a(pkey, "DH"))
         return ossl_cms_dh_envelope(ri, cmd);
@@ -200,6 +215,9 @@ void ossl_cms_RecipientInfos_set_cmsctx(CMS_ContentInfo *cms)
             case CMS_RECIPINFO_PASS:
                 ri->d.pwri->cms_ctx = ctx;
                 break;
+            case CMS_RECIPINFO_KEM:
+                ri->d.ori->d.kemri->cms_ctx = ctx;
+                break;
             default:
                 break;
             }
@@ -218,6 +236,8 @@ EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri)
         return ri->d.ktri->pctx;
     else if (ri->type == CMS_RECIPINFO_AGREE)
         return ri->d.kari->pctx;
+    else if (ri->type == CMS_RECIPINFO_KEM)
+        return ri->d.ori->d.kemri->pctx;
     return NULL;
 }

@@ -258,12 +278,17 @@ BIO *CMS_EnvelopedData_decrypt(CMS_EnvelopedData *env, BIO *detached_data,
     CMS_ContentInfo *ci;
     BIO *bio = NULL;
     int res = 0;
+    size_t secret_len = 0;

     if (env == NULL) {
         ERR_raise(ERR_LIB_CMS, ERR_R_PASSED_NULL_PARAMETER);
         return NULL;
     }

+    if (secret != NULL
+        && (secret_len = ASN1_STRING_get_length(secret)) > INT_MAX)
+        return NULL;
+
     if ((ci = CMS_ContentInfo_new_ex(libctx, propq)) == NULL
         || (bio = BIO_new(BIO_s_mem())) == NULL)
         goto end;
@@ -271,7 +296,7 @@ BIO *CMS_EnvelopedData_decrypt(CMS_EnvelopedData *env, BIO *detached_data,
     ci->d.envelopedData = env;
     if (secret != NULL
         && CMS_decrypt_set1_password(ci, (unsigned char *)ASN1_STRING_get0_data(secret),
-               ASN1_STRING_length(secret))
+               (int)secret_len)
             != 1)
         goto end;
     res = CMS_decrypt(ci, secret == NULL ? pkey : NULL,
@@ -333,7 +358,7 @@ static int cms_RecipientInfo_ktri_init(CMS_RecipientInfo *ri, X509 *recip,
     ri->d.ktri = M_ASN1_new_of(CMS_KeyTransRecipientInfo);
     if (!ri->d.ktri)
         return 0;
-    ri->type = CMS_RECIPINFO_TRANS;
+    ri->encoded_type = ri->type = CMS_RECIPINFO_TRANS;

     ktri = ri->d.ktri;
     ktri->cms_ctx = ctx;
@@ -420,6 +445,11 @@ CMS_RecipientInfo *CMS_add1_recipient(CMS_ContentInfo *cms, X509 *recip,
             goto err;
         break;

+    case CMS_RECIPINFO_KEM:
+        if (!ossl_cms_RecipientInfo_kemri_init(ri, recip, pk, flags, ctx))
+            goto err;
+        break;
+
     default:
         ERR_raise(ERR_LIB_CMS, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE);
         goto err;
@@ -547,7 +577,7 @@ static int cms_RecipientInfo_ktri_encrypt(const CMS_ContentInfo *cms,
     if (EVP_PKEY_encrypt(pctx, ek, &eklen, ec->key, ec->keylen) <= 0)
         goto err;

-    ASN1_STRING_set0(ktri->encryptedKey, ek, eklen);
+    ASN1_STRING_set0(ktri->encryptedKey, ek, (int)eklen);
     ek = NULL;

     ret = 1;
@@ -689,7 +719,7 @@ CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
     CMS_KEKRecipientInfo *kekri;
     STACK_OF(CMS_RecipientInfo) *ris = CMS_get0_RecipientInfos(cms);

-    if (ris == NULL)
+    if (ris == NULL || idlen > INT_MAX)
         goto err;

     if (nid == NID_undef) {
@@ -738,7 +768,7 @@ CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
         ERR_raise(ERR_LIB_CMS, ERR_R_ASN1_LIB);
         goto err;
     }
-    ri->type = CMS_RECIPINFO_KEK;
+    ri->encoded_type = ri->type = CMS_RECIPINFO_KEK;

     kekri = ri->d.kekri;

@@ -762,7 +792,7 @@ CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
     kekri->key = key;
     kekri->keylen = keylen;

-    ASN1_STRING_set0(kekri->kekid->keyIdentifier, id, idlen);
+    ASN1_STRING_set0(kekri->kekid->keyIdentifier, id, (int)idlen);

     kekri->kekid->date = date;

@@ -896,7 +926,7 @@ static int cms_RecipientInfo_kekri_encrypt(const CMS_ContentInfo *cms,

     EVP_CIPHER_CTX_set_flags(ctx, EVP_CIPHER_CTX_FLAG_WRAP_ALLOW);
     if (!EVP_EncryptInit_ex(ctx, cipher, NULL, kekri->key, NULL)
-        || !EVP_EncryptUpdate(ctx, wkey, &wkeylen, ec->key, ec->keylen)
+        || !EVP_EncryptUpdate(ctx, wkey, &wkeylen, ec->key, (int)ec->keylen)
         || !EVP_EncryptFinal_ex(ctx, wkey + wkeylen, &outlen)) {
         ERR_raise(ERR_LIB_CMS, CMS_R_WRAP_ERROR);
         goto err;
@@ -1014,6 +1044,9 @@ int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri)
     case CMS_RECIPINFO_PASS:
         return ossl_cms_RecipientInfo_pwri_crypt(cms, ri, 0);

+    case CMS_RECIPINFO_KEM:
+        return ossl_cms_RecipientInfo_kemri_decrypt(cms, ri);
+
     default:
         ERR_raise(ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE);
         return 0;
@@ -1035,6 +1068,9 @@ int CMS_RecipientInfo_encrypt(const CMS_ContentInfo *cms, CMS_RecipientInfo *ri)
     case CMS_RECIPINFO_PASS:
         return ossl_cms_RecipientInfo_pwri_crypt(cms, ri, 1);

+    case CMS_RECIPINFO_KEM:
+        return ossl_cms_RecipientInfo_kemri_encrypt(cms, ri);
+
     default:
         ERR_raise(ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENT_TYPE);
         return 0;
@@ -1089,7 +1125,8 @@ static void cms_env_set_version(CMS_EnvelopedData *env)

     for (i = 0; i < sk_CMS_RecipientInfo_num(env->recipientInfos); i++) {
         ri = sk_CMS_RecipientInfo_value(env->recipientInfos, i);
-        if (ri->type == CMS_RECIPINFO_PASS || ri->type == CMS_RECIPINFO_OTHER) {
+        if (ri->type == CMS_RECIPINFO_PASS || ri->type == CMS_RECIPINFO_OTHER
+            || ri->type == CMS_RECIPINFO_KEM) {
             env->version = 3;
             return;
         } else if (ri->type != CMS_RECIPINFO_TRANS
@@ -1368,6 +1405,18 @@ err:
  */
 int ossl_cms_pkey_get_ri_type(EVP_PKEY *pk)
 {
+    int ri_type;
+    EVP_PKEY_CTX *ctx = NULL;
+
+    /*
+     * First check the provider for RecipientInfo support since a key may support
+     * multiple types, e.g. an RSA key and provider may support RSA key transport
+     * and/or RSA-KEM.
+     */
+    if (evp_pkey_is_provided(pk)
+        && EVP_PKEY_get_int_param(pk, OSSL_PKEY_PARAM_CMS_RI_TYPE, &ri_type))
+        return ri_type;
+
     /* Check types that we know about */
     if (EVP_PKEY_is_a(pk, "DH"))
         return CMS_RECIPINFO_AGREE;
@@ -1381,7 +1430,7 @@ int ossl_cms_pkey_get_ri_type(EVP_PKEY *pk)
         return CMS_RECIPINFO_TRANS;

     /*
-     * Otherwise this might ben an engine implementation, so see if we can get
+     * Otherwise this might be an engine implementation, so see if we can get
      * the type from the ameth.
      */
     if (pk->ameth && pk->ameth->pkey_ctrl) {
@@ -1390,7 +1439,25 @@ int ossl_cms_pkey_get_ri_type(EVP_PKEY *pk)
         if (i > 0)
             return r;
     }
-    return CMS_RECIPINFO_TRANS;
+
+    /*
+     * Otherwise try very hard to figure out what RecipientInfo the key supports.
+     */
+    ri_type = CMS_RECIPINFO_TRANS;
+    ctx = EVP_PKEY_CTX_new(pk, NULL);
+    if (ctx != NULL) {
+        ERR_set_mark();
+        if (EVP_PKEY_encrypt_init(ctx) > 0)
+            ri_type = CMS_RECIPINFO_TRANS;
+        else if (EVP_PKEY_derive_init(ctx) > 0)
+            ri_type = CMS_RECIPINFO_AGREE;
+        else if (EVP_PKEY_encapsulate_init(ctx, NULL) > 0)
+            ri_type = CMS_RECIPINFO_KEM;
+        ERR_pop_to_mark();
+    }
+    EVP_PKEY_CTX_free(ctx);
+
+    return ri_type;
 }

 int ossl_cms_pkey_is_ri_type_supported(EVP_PKEY *pk, int ri_type)
@@ -1412,3 +1479,66 @@ int ossl_cms_pkey_is_ri_type_supported(EVP_PKEY *pk, int ri_type)

     return (supportedRiType == ri_type);
 }
+
+int ossl_cms_RecipientInfo_wrap_init(CMS_RecipientInfo *ri,
+    const EVP_CIPHER *cipher)
+{
+    const CMS_CTX *cms_ctx;
+    EVP_CIPHER_CTX *ctx;
+    const EVP_CIPHER *kekcipher;
+    EVP_CIPHER *fetched_kekcipher;
+    const char *kekcipher_name;
+    int keylen;
+    int ret;
+
+    if (ri->type == CMS_RECIPINFO_AGREE) {
+        cms_ctx = ri->d.kari->cms_ctx;
+        ctx = ri->d.kari->ctx;
+    } else if (ri->type == CMS_RECIPINFO_KEM) {
+        cms_ctx = ri->d.ori->d.kemri->cms_ctx;
+        ctx = ri->d.ori->d.kemri->ctx;
+    } else {
+        ERR_raise(ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE);
+        return 0;
+    }
+
+    /* If a suitable wrap algorithm is already set nothing to do */
+    kekcipher = EVP_CIPHER_CTX_get0_cipher(ctx);
+    if (kekcipher != NULL) {
+        if (EVP_CIPHER_CTX_get_mode(ctx) != EVP_CIPH_WRAP_MODE)
+            return 0;
+        return 1;
+    }
+    if (cipher == NULL)
+        return 0;
+    keylen = EVP_CIPHER_get_key_length(cipher);
+    if (keylen <= 0) {
+        ERR_raise(ERR_LIB_CMS, CMS_R_INVALID_KEY_LENGTH);
+        return 0;
+    }
+
+    /*
+     * Pick a cipher based on content encryption cipher. If it is DES3 use
+     * DES3 wrap otherwise use AES wrap similar to key size.
+     */
+#ifndef OPENSSL_NO_DES
+    if (EVP_CIPHER_get_type(cipher) == NID_des_ede3_cbc)
+        kekcipher_name = SN_id_smime_alg_CMS3DESwrap;
+    else
+#endif
+        if (keylen <= 16)
+        kekcipher_name = SN_id_aes128_wrap;
+    else if (keylen <= 24)
+        kekcipher_name = SN_id_aes192_wrap;
+    else
+        kekcipher_name = SN_id_aes256_wrap;
+
+    fetched_kekcipher = EVP_CIPHER_fetch(ossl_cms_ctx_get0_libctx(cms_ctx),
+        kekcipher_name,
+        ossl_cms_ctx_get0_propq(cms_ctx));
+    if (fetched_kekcipher == NULL)
+        return 0;
+    ret = EVP_EncryptInit_ex(ctx, fetched_kekcipher, NULL, NULL, NULL);
+    EVP_CIPHER_free(fetched_kekcipher);
+    return ret;
+}
diff --git a/deps/openssl/openssl/crypto/cms/cms_err.c b/deps/openssl/openssl/crypto/cms/cms_err.c
deleted file mode 100644
index 1b0a0039f99..00000000000
--- a/deps/openssl/openssl/crypto/cms/cms_err.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/cmserr.h>
-#include "crypto/cmserr.h"
-
-#ifndef OPENSSL_NO_CMS
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA CMS_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ADD_SIGNER_ERROR), "add signer error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ATTRIBUTE_ERROR), "attribute error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CERTIFICATE_ALREADY_PRESENT),
-        "certificate already present" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CERTIFICATE_HAS_NO_KEYID),
-        "certificate has no keyid" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CERTIFICATE_VERIFY_ERROR),
-        "certificate verify error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CIPHER_AEAD_IN_ENVELOPED_DATA),
-        "cipher aead in enveloped data" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CIPHER_AEAD_SET_TAG_ERROR),
-        "cipher aead set tag error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CIPHER_GET_TAG), "cipher get tag" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CIPHER_INITIALISATION_ERROR),
-        "cipher initialisation error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR),
-        "cipher parameter initialisation error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CMS_DATAFINAL_ERROR),
-        "cms datafinal error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CMS_LIB), "cms lib" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CONTENTIDENTIFIER_MISMATCH),
-        "contentidentifier mismatch" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CONTENT_NOT_FOUND), "content not found" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CONTENT_TYPE_MISMATCH),
-        "content type mismatch" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA),
-        "content type not compressed data" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA),
-        "content type not enveloped data" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA),
-        "content type not signed data" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CONTENT_VERIFY_ERROR),
-        "content verify error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CTRL_ERROR), "ctrl error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_CTRL_FAILURE), "ctrl failure" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_DECODE_ERROR), "decode error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_DECRYPT_ERROR), "decrypt error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ERROR_GETTING_PUBLIC_KEY),
-        "error getting public key" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE),
-        "error reading messagedigest attribute" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ERROR_SETTING_KEY), "error setting key" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ERROR_SETTING_RECIPIENTINFO),
-        "error setting recipientinfo" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ERROR_UNSUPPORTED_STATIC_KEY_AGREEMENT),
-        "error unsupported static key agreement" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR),
-        "ess signing certid mismatch error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_INVALID_ENCRYPTED_KEY_LENGTH),
-        "invalid encrypted key length" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER),
-        "invalid key encryption parameter" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_INVALID_KEY_LENGTH), "invalid key length" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_INVALID_LABEL), "invalid label" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_INVALID_OAEP_PARAMETERS),
-        "invalid oaep parameters" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_KDF_PARAMETER_ERROR),
-        "kdf parameter error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_MD_BIO_INIT_ERROR), "md bio init error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH),
-        "messagedigest attribute wrong length" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_MESSAGEDIGEST_WRONG_LENGTH),
-        "messagedigest wrong length" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_MSGSIGDIGEST_ERROR), "msgsigdigest error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE),
-        "msgsigdigest verification failure" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_MSGSIGDIGEST_WRONG_LENGTH),
-        "msgsigdigest wrong length" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NEED_ONE_SIGNER), "need one signer" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_A_SIGNED_RECEIPT),
-        "not a signed receipt" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_ENCRYPTED_DATA), "not encrypted data" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_KEK), "not kek" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_KEY_AGREEMENT), "not key agreement" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_KEY_TRANSPORT), "not key transport" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_PWRI), "not pwri" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE),
-        "not supported for this key type" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_CIPHER), "no cipher" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_CONTENT), "no content" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_CONTENT_TYPE), "no content type" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_DEFAULT_DIGEST), "no default digest" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_DIGEST_SET), "no digest set" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_KEY), "no key" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_KEY_OR_CERT), "no key or cert" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_MATCHING_DIGEST), "no matching digest" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_MATCHING_RECIPIENT),
-        "no matching recipient" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_MATCHING_SIGNATURE),
-        "no matching signature" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_MSGSIGDIGEST), "no msgsigdigest" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_PASSWORD), "no password" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_PRIVATE_KEY), "no private key" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_PUBLIC_KEY), "no public key" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_RECEIPT_REQUEST), "no receipt request" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_NO_SIGNERS), "no signers" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_OPERATION_UNSUPPORTED),
-        "operation unsupported" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_PEER_KEY_ERROR), "peer key error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE),
-        "private key does not match certificate" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_RECEIPT_DECODE_ERROR),
-        "receipt decode error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_RECIPIENT_ERROR), "recipient error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_SHARED_INFO_ERROR), "shared info error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_SIGNER_CERTIFICATE_NOT_FOUND),
-        "signer certificate not found" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_SIGNFINAL_ERROR), "signfinal error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_SMIME_TEXT_ERROR), "smime text error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_STORE_INIT_ERROR), "store init error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_TYPE_NOT_COMPRESSED_DATA),
-        "type not compressed data" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_TYPE_NOT_DATA), "type not data" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_TYPE_NOT_DIGESTED_DATA),
-        "type not digested data" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_TYPE_NOT_ENCRYPTED_DATA),
-        "type not encrypted data" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_TYPE_NOT_ENVELOPED_DATA),
-        "type not enveloped data" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNABLE_TO_FINALIZE_CONTEXT),
-        "unable to finalize context" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNKNOWN_CIPHER), "unknown cipher" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNKNOWN_DIGEST_ALGORITHM),
-        "unknown digest algorithm" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNKNOWN_ID), "unknown id" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM),
-        "unsupported compression algorithm" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM),
-        "unsupported content encryption algorithm" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_CONTENT_TYPE),
-        "unsupported content type" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_ENCRYPTION_TYPE),
-        "unsupported encryption type" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_KEK_ALGORITHM),
-        "unsupported kek algorithm" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM),
-        "unsupported key encryption algorithm" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_LABEL_SOURCE),
-        "unsupported label source" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE),
-        "unsupported recipientinfo type" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_RECIPIENT_TYPE),
-        "unsupported recipient type" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_SIGNATURE_ALGORITHM),
-        "unsupported signature algorithm" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNSUPPORTED_TYPE), "unsupported type" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNWRAP_ERROR), "unwrap error" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_UNWRAP_FAILURE), "unwrap failure" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_VERIFICATION_FAILURE),
-        "verification failure" },
-    { ERR_PACK(ERR_LIB_CMS, 0, CMS_R_WRAP_ERROR), "wrap error" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_CMS_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(CMS_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(CMS_str_reasons);
-#endif
-    return 1;
-}
-#else
-NON_EMPTY_TRANSLATION_UNIT
-#endif
diff --git a/deps/openssl/openssl/crypto/cms/cms_ess.c b/deps/openssl/openssl/crypto/cms/cms_ess.c
index 480e1c8b1dd..cd4ab27eaad 100644
--- a/deps/openssl/openssl/crypto/cms/cms_ess.c
+++ b/deps/openssl/openssl/crypto/cms/cms_ess.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -25,7 +25,7 @@ IMPLEMENT_ASN1_FUNCTIONS(CMS_ReceiptRequest)

 int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr)
 {
-    ASN1_STRING *str;
+    const ASN1_STRING *str;
     CMS_ReceiptRequest *rr;
     ASN1_OBJECT *obj = OBJ_nid2obj(NID_id_smime_aa_receiptRequest);

@@ -52,7 +52,7 @@ int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr)
 static int ossl_cms_signerinfo_get_signing_cert(const CMS_SignerInfo *si,
     ESS_SIGNING_CERT **psc)
 {
-    ASN1_STRING *str;
+    const ASN1_STRING *str;
     ESS_SIGNING_CERT *sc;
     ASN1_OBJECT *obj = OBJ_nid2obj(NID_id_smime_aa_signingCertificate);

@@ -79,7 +79,7 @@ static int ossl_cms_signerinfo_get_signing_cert(const CMS_SignerInfo *si,
 static int ossl_cms_signerinfo_get_signing_cert_v2(const CMS_SignerInfo *si,
     ESS_SIGNING_CERT_V2 **psc)
 {
-    ASN1_STRING *str;
+    const ASN1_STRING *str;
     ESS_SIGNING_CERT_V2 *sc;
     ASN1_OBJECT *obj = OBJ_nid2obj(NID_id_smime_aa_signingCertificateV2);

@@ -106,7 +106,10 @@ int ossl_cms_check_signing_certs(const CMS_SignerInfo *si,
     ESS_SIGNING_CERT_V2 *ssv2 = NULL;
     int ret = ossl_cms_signerinfo_get_signing_cert(si, &ss) >= 0
         && ossl_cms_signerinfo_get_signing_cert_v2(si, &ssv2) >= 0
-        && OSSL_ESS_check_signing_certs(ss, ssv2, chain, 1) > 0;
+        && OSSL_ESS_check_signing_certs_ex(ss, ssv2, chain,
+               ossl_cms_ctx_get0_libctx(si->cms_ctx),
+               ossl_cms_ctx_get0_propq(si->cms_ctx), 1)
+            > 0;

     ESS_SIGNING_CERT_free(ss);
     ESS_SIGNING_CERT_V2_free(ssv2);
@@ -128,7 +131,7 @@ CMS_ReceiptRequest *CMS_ReceiptRequest_create0_ex(
     if (id)
         ASN1_STRING_set0(rr->signedContentIdentifier, id, idlen);
     else {
-        if (!ASN1_STRING_set(rr->signedContentIdentifier, NULL, 32)) {
+        if (!ossl_asn1_string_set1_data(rr->signedContentIdentifier, NULL, 32)) {
             ERR_raise(ERR_LIB_CMS, ERR_R_ASN1_LIB);
             goto err;
         }
@@ -257,8 +260,9 @@ int ossl_cms_Receipt_verify(CMS_ContentInfo *cms, CMS_ContentInfo *req_cms)
     CMS_Receipt *rct = NULL;
     STACK_OF(CMS_SignerInfo) *sis, *osis;
     CMS_SignerInfo *si, *osi = NULL;
-    ASN1_OCTET_STRING *msig, **pcont;
-    ASN1_OBJECT *octype;
+    const ASN1_OCTET_STRING *msig;
+    ASN1_OCTET_STRING **pcont;
+    const ASN1_OBJECT *octype;
     unsigned char dig[EVP_MAX_MD_SIZE];
     unsigned int diglen;

@@ -381,7 +385,7 @@ ASN1_OCTET_STRING *ossl_cms_encode_Receipt(CMS_SignerInfo *si)
 {
     CMS_Receipt rct;
     CMS_ReceiptRequest *rr = NULL;
-    ASN1_OBJECT *ctype;
+    const ASN1_OBJECT *ctype;
     ASN1_OCTET_STRING *os = NULL;

     /* Get original receipt request */
diff --git a/deps/openssl/openssl/crypto/cms/cms_io.c b/deps/openssl/openssl/crypto/cms/cms_io.c
index 14a758da5dc..fb948093cbb 100644
--- a/deps/openssl/openssl/crypto/cms/cms_io.c
+++ b/deps/openssl/openssl/crypto/cms/cms_io.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,8 +14,7 @@
 #include <openssl/cms.h>
 #include "cms_local.h"

-/* unfortunately cannot constify BIO_new_NDEF() due to this and PKCS7_stream() */
-int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms)
+int ossl_cms_stream(CMS_ContentInfo *cms)
 {
     ASN1_OCTET_STRING **pos;

@@ -25,15 +24,22 @@ int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms)
     if (*pos == NULL)
         *pos = ASN1_OCTET_STRING_new();
     if (*pos != NULL) {
-        (*pos)->flags |= ASN1_STRING_FLAG_NDEF;
-        (*pos)->flags &= ~ASN1_STRING_FLAG_CONT;
-        *boundary = &(*pos)->data;
+        cms->contentIncomplete = 0;
         return 1;
     }
     ERR_raise(ERR_LIB_CMS, ERR_R_CMS_LIB);
     return 0;
 }

+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms)
+{
+    if (boundary != NULL)
+        *boundary = NULL;
+    return ossl_cms_stream(cms);
+}
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_1) */
+
 CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms)
 {
     CMS_ContentInfo *ci;
diff --git a/deps/openssl/openssl/crypto/cms/cms_kari.c b/deps/openssl/openssl/crypto/cms/cms_kari.c
index 459991525f0..3e40691e100 100644
--- a/deps/openssl/openssl/crypto/cms/cms_kari.c
+++ b/deps/openssl/openssl/crypto/cms/cms_kari.c
@@ -7,12 +7,6 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * Low level key APIs (DH etc) are deprecated for public use, but still ok for
- * internal use.
- */
-#include "internal/deprecated.h"
-
 #include "internal/cryptlib.h"
 #include <openssl/asn1t.h>
 #include <openssl/pem.h>
@@ -221,7 +215,7 @@ static int cms_kek_cipher(unsigned char **pout, size_t *poutlen,
     size_t outsize;

     keklen = EVP_CIPHER_CTX_get_key_length(kari->ctx);
-    if (keklen > EVP_MAX_KEY_LENGTH)
+    if (keklen > EVP_MAX_KEY_LENGTH || inlen > INT_MAX)
         return 0;
     /* Derive KEK */
     if (EVP_PKEY_derive(kari->pctx, kek, &keklen) <= 0)
@@ -230,7 +224,7 @@ static int cms_kek_cipher(unsigned char **pout, size_t *poutlen,
     if (!EVP_CipherInit_ex(kari->ctx, NULL, NULL, kek, NULL, enc))
         goto err;
     /* obtain output length of ciphered key */
-    if (!EVP_CipherUpdate(kari->ctx, NULL, &outlen, in, inlen))
+    if (!EVP_CipherUpdate(kari->ctx, NULL, &outlen, in, (int)inlen))
         goto err;
     /*
      * On its integrity-failure paths that primitive writes and cleanses up to
@@ -358,7 +352,7 @@ int ossl_cms_RecipientInfo_kari_init(CMS_RecipientInfo *ri, X509 *recip,
     ri->d.kari = M_ASN1_new_of(CMS_KeyAgreeRecipientInfo);
     if (ri->d.kari == NULL)
         return 0;
-    ri->type = CMS_RECIPINFO_AGREE;
+    ri->encoded_type = ri->type = CMS_RECIPINFO_AGREE;

     kari = ri->d.kari;
     kari->version = 3;
@@ -421,67 +415,6 @@ int ossl_cms_RecipientInfo_kari_init(CMS_RecipientInfo *ri, X509 *recip,
     return 1;
 }

-static int cms_wrap_init(CMS_KeyAgreeRecipientInfo *kari,
-    const EVP_CIPHER *cipher)
-{
-    const CMS_CTX *cms_ctx = kari->cms_ctx;
-    EVP_CIPHER_CTX *ctx = kari->ctx;
-    const EVP_CIPHER *kekcipher;
-    EVP_CIPHER *fetched_kekcipher;
-    const char *kekcipher_name;
-    int keylen;
-    int ret;
-
-    /* If a suitable wrap algorithm is already set nothing to do */
-    kekcipher = EVP_CIPHER_CTX_get0_cipher(ctx);
-    if (kekcipher != NULL) {
-        if (EVP_CIPHER_CTX_get_mode(ctx) != EVP_CIPH_WRAP_MODE)
-            return 0;
-        return 1;
-    }
-    if (cipher == NULL)
-        return 0;
-    keylen = EVP_CIPHER_get_key_length(cipher);
-    if ((EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_GET_WRAP_CIPHER) != 0) {
-        ret = EVP_CIPHER_meth_get_ctrl(cipher)(NULL, EVP_CTRL_GET_WRAP_CIPHER,
-            0, &kekcipher);
-        if (ret <= 0)
-            return 0;
-
-        if (kekcipher != NULL) {
-            if (EVP_CIPHER_get_mode(kekcipher) != EVP_CIPH_WRAP_MODE)
-                return 0;
-            kekcipher_name = EVP_CIPHER_get0_name(kekcipher);
-            goto enc;
-        }
-    }
-
-    /*
-     * Pick a cipher based on content encryption cipher. If it is DES3 use
-     * DES3 wrap otherwise use AES wrap similar to key size.
-     */
-#ifndef OPENSSL_NO_DES
-    if (EVP_CIPHER_get_type(cipher) == NID_des_ede3_cbc)
-        kekcipher_name = SN_id_smime_alg_CMS3DESwrap;
-    else
-#endif
-        if (keylen <= 16)
-        kekcipher_name = SN_id_aes128_wrap;
-    else if (keylen <= 24)
-        kekcipher_name = SN_id_aes192_wrap;
-    else
-        kekcipher_name = SN_id_aes256_wrap;
-enc:
-    fetched_kekcipher = EVP_CIPHER_fetch(ossl_cms_ctx_get0_libctx(cms_ctx),
-        kekcipher_name,
-        ossl_cms_ctx_get0_propq(cms_ctx));
-    if (fetched_kekcipher == NULL)
-        return 0;
-    ret = EVP_EncryptInit_ex(ctx, fetched_kekcipher, NULL, NULL, NULL);
-    EVP_CIPHER_free(fetched_kekcipher);
-    return ret;
-}
-
 /* Encrypt content key in key agreement recipient info */

 int ossl_cms_RecipientInfo_kari_encrypt(const CMS_ContentInfo *cms,
@@ -501,7 +434,7 @@ int ossl_cms_RecipientInfo_kari_encrypt(const CMS_ContentInfo *cms,
     reks = kari->recipientEncryptedKeys;
     ec = ossl_cms_get0_env_enc_content(cms);
     /* Initialise wrap algorithm parameters */
-    if (!cms_wrap_init(kari, ec->cipher))
+    if (!ossl_cms_RecipientInfo_wrap_init(ri, ec->cipher))
         return 0;
     /*
      * If no originator key set up initialise for ephemeral key the public key
@@ -534,7 +467,7 @@ int ossl_cms_RecipientInfo_kari_encrypt(const CMS_ContentInfo *cms,
         if (!cms_kek_cipher(&enckey, &enckeylen, ec->key, ec->keylen,
                 kari, 1))
             return 0;
-        ASN1_STRING_set0(rek->encryptedKey, enckey, enckeylen);
+        ASN1_STRING_set0(rek->encryptedKey, enckey, (int)enckeylen);
     }

     return 1;
diff --git a/deps/openssl/openssl/crypto/cms/cms_kem.c b/deps/openssl/openssl/crypto/cms/cms_kem.c
new file mode 100644
index 00000000000..232ed562447
--- /dev/null
+++ b/deps/openssl/openssl/crypto/cms/cms_kem.c
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <assert.h>
+#include <limits.h>
+#include <openssl/cms.h>
+#include <openssl/core_names.h>
+#include <openssl/err.h>
+#include <openssl/decoder.h>
+#include "internal/sizes.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
+#include "cms_local.h"
+
+static int kem_cms_decrypt(CMS_RecipientInfo *ri)
+{
+    uint32_t *kekLength;
+    X509_ALGOR *wrap;
+    EVP_PKEY_CTX *pctx;
+    EVP_CIPHER_CTX *kekctx;
+    uint32_t cipher_length;
+    char name[OSSL_MAX_NAME_SIZE];
+    EVP_CIPHER *kekcipher = NULL;
+    int rv = 0;
+
+    if (!ossl_cms_RecipientInfo_kemri_get0_alg(ri, &kekLength, &wrap))
+        goto err;
+
+    pctx = CMS_RecipientInfo_get0_pkey_ctx(ri);
+    if (pctx == NULL)
+        goto err;
+
+    kekctx = CMS_RecipientInfo_kemri_get0_ctx(ri);
+    if (kekctx == NULL)
+        goto err;
+
+    OBJ_obj2txt(name, sizeof(name), wrap->algorithm, 0);
+    kekcipher = EVP_CIPHER_fetch(pctx->libctx, name, pctx->propquery);
+    if (kekcipher == NULL || EVP_CIPHER_get_mode(kekcipher) != EVP_CIPH_WRAP_MODE)
+        goto err;
+    if (!EVP_EncryptInit_ex(kekctx, kekcipher, NULL, NULL, NULL))
+        goto err;
+    if (EVP_CIPHER_asn1_to_param(kekctx, wrap->parameter) <= 0)
+        goto err;
+
+    cipher_length = EVP_CIPHER_CTX_get_key_length(kekctx);
+    if (cipher_length != *kekLength) {
+        ERR_raise(ERR_LIB_CMS, CMS_R_INVALID_KEY_LENGTH);
+        goto err;
+    }
+
+    rv = 1;
+err:
+    EVP_CIPHER_free(kekcipher);
+    return rv;
+}
+
+static int kem_cms_encrypt(CMS_RecipientInfo *ri)
+{
+    uint32_t *kekLength;
+    X509_ALGOR *wrap;
+    X509_ALGOR *kdf;
+    EVP_PKEY_CTX *pctx;
+    EVP_PKEY *pkey;
+    int security_bits;
+    const ASN1_OBJECT *kdf_obj = NULL;
+    unsigned char kemri_x509_algor[OSSL_MAX_ALGORITHM_ID_SIZE];
+    OSSL_PARAM params[2];
+    X509_ALGOR *x509_algor = NULL;
+    EVP_CIPHER_CTX *kekctx;
+    int wrap_nid;
+    int rv = 0;
+
+    if (!ossl_cms_RecipientInfo_kemri_get0_alg(ri, &kekLength, &wrap))
+        goto err;
+
+    kdf = CMS_RecipientInfo_kemri_get0_kdf_alg(ri);
+    if (kdf == NULL)
+        goto err;
+
+    pctx = CMS_RecipientInfo_get0_pkey_ctx(ri);
+    if (pctx == NULL)
+        goto err;
+
+    pkey = EVP_PKEY_CTX_get0_pkey(pctx);
+    if (pkey == NULL)
+        goto err;
+
+    security_bits = EVP_PKEY_get_security_bits(pkey);
+    if (security_bits == 0)
+        goto err;
+
+    X509_ALGOR_get0(&kdf_obj, NULL, NULL, kdf);
+    if (kdf_obj == NULL || OBJ_obj2nid(kdf_obj) == NID_undef) {
+        /*
+         * If the KDF OID hasn't already been set, then query the provider
+         * for a default KDF.
+         */
+        params[0] = OSSL_PARAM_construct_octet_string(OSSL_PKEY_PARAM_CMS_KEMRI_KDF_ALGORITHM,
+            kemri_x509_algor, sizeof(kemri_x509_algor));
+        params[1] = OSSL_PARAM_construct_end();
+        if (!EVP_PKEY_get_params(pkey, params))
+            goto err;
+        if (OSSL_PARAM_modified(&params[0])) {
+            const unsigned char *p = kemri_x509_algor;
+
+            x509_algor = d2i_X509_ALGOR(NULL, &p, (long)params[0].return_size);
+            if (x509_algor == NULL)
+                goto err;
+            if (!X509_ALGOR_copy(kdf, x509_algor))
+                goto err;
+        } else {
+            if (!X509_ALGOR_set0(kdf, OBJ_nid2obj(NID_HKDF_SHA256), V_ASN1_UNDEF, NULL))
+                return 0;
+        }
+    }
+
+    /* Get wrap NID */
+    kekctx = CMS_RecipientInfo_kemri_get0_ctx(ri);
+    if (kekctx == NULL)
+        goto err;
+    *kekLength = EVP_CIPHER_CTX_get_key_length(kekctx);
+    wrap_nid = EVP_CIPHER_CTX_get_type(kekctx);
+
+    /* Package wrap algorithm in an AlgorithmIdentifier */
+    ASN1_OBJECT_free(wrap->algorithm);
+    ASN1_TYPE_free(wrap->parameter);
+    wrap->algorithm = OBJ_nid2obj(wrap_nid);
+    wrap->parameter = ASN1_TYPE_new();
+    if (wrap->parameter == NULL)
+        goto err;
+    if (EVP_CIPHER_param_to_asn1(kekctx, wrap->parameter) <= 0) {
+        ASN1_TYPE_free(wrap->parameter);
+        wrap->parameter = NULL;
+        goto err;
+    }
+    if (ASN1_TYPE_get(wrap->parameter) == NID_undef) {
+        ASN1_TYPE_free(wrap->parameter);
+        wrap->parameter = NULL;
+    }
+
+    rv = 1;
+err:
+    X509_ALGOR_free(x509_algor);
+    return rv;
+}
+
+int ossl_cms_kem_envelope(CMS_RecipientInfo *ri, int decrypt)
+{
+    assert(decrypt == 0 || decrypt == 1);
+
+    if (decrypt == 1)
+        return kem_cms_decrypt(ri);
+
+    if (decrypt == 0)
+        return kem_cms_encrypt(ri);
+
+    ERR_raise(ERR_LIB_CMS, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE);
+    return 0;
+}
diff --git a/deps/openssl/openssl/crypto/cms/cms_kemri.c b/deps/openssl/openssl/crypto/cms/cms_kemri.c
new file mode 100644
index 00000000000..1a3ec8ddf46
--- /dev/null
+++ b/deps/openssl/openssl/crypto/cms/cms_kemri.c
@@ -0,0 +1,426 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/cms.h>
+#include <openssl/core_names.h>
+#include <openssl/crypto.h>
+#include <openssl/err.h>
+#include <openssl/evp.h>
+#include <openssl/kdf.h>
+#include <openssl/x509.h>
+#include "cms_local.h"
+#include "crypto/evp.h"
+#include "internal/sizes.h"
+
+#include <crypto/asn1.h>
+
+/* KEM Recipient Info (KEMRI) routines */
+
+int ossl_cms_RecipientInfo_kemri_get0_alg(CMS_RecipientInfo *ri,
+    uint32_t **pkekLength,
+    X509_ALGOR **pwrap)
+{
+    if (ri->type != CMS_RECIPINFO_KEM) {
+        ERR_raise(ERR_LIB_CMS, CMS_R_NOT_KEM);
+        return 0;
+    }
+    if (pkekLength)
+        *pkekLength = &ri->d.ori->d.kemri->kekLength;
+    if (pwrap)
+        *pwrap = ri->d.ori->d.kemri->wrap;
+    return 1;
+}
+
+int CMS_RecipientInfo_kemri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert)
+{
+    if (ri->type != CMS_RECIPINFO_KEM) {
+        ERR_raise(ERR_LIB_CMS, CMS_R_NOT_KEM);
+        return -2;
+    }
+    return ossl_cms_SignerIdentifier_cert_cmp(ri->d.ori->d.kemri->rid, cert);
+}
+
+int CMS_RecipientInfo_kemri_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk)
+{
+    EVP_PKEY_CTX *pctx = NULL;
+    CMS_KEMRecipientInfo *kemri;
+
+    if (ri->type != CMS_RECIPINFO_KEM) {
+        ERR_raise(ERR_LIB_CMS, CMS_R_NOT_KEM);
+        return 0;
+    }
+
+    kemri = ri->d.ori->d.kemri;
+
+    EVP_PKEY_CTX_free(kemri->pctx);
+    kemri->pctx = NULL;
+
+    if (pk != NULL) {
+        pctx = EVP_PKEY_CTX_new_from_pkey(ossl_cms_ctx_get0_libctx(kemri->cms_ctx), pk,
+            ossl_cms_ctx_get0_propq(kemri->cms_ctx));
+        if (pctx == NULL || EVP_PKEY_decapsulate_init(pctx, NULL) <= 0)
+            goto err;
+
+        kemri->pctx = pctx;
+    }
+
+    return 1;
+err:
+    EVP_PKEY_CTX_free(pctx);
+    return 0;
+}
+
+/* Initialise a kemri based on passed certificate and key */
+
+int ossl_cms_RecipientInfo_kemri_init(CMS_RecipientInfo *ri, X509 *recip,
+    EVP_PKEY *recipPubKey, unsigned int flags,
+    const CMS_CTX *ctx)
+{
+    CMS_OtherRecipientInfo *ori;
+    CMS_KEMRecipientInfo *kemri;
+    int idtype;
+    const X509_PUBKEY *x_pubkey;
+    X509_ALGOR *x_alg;
+
+    ri->d.ori = M_ASN1_new_of(CMS_OtherRecipientInfo);
+    if (ri->d.ori == NULL)
+        return 0;
+    ri->encoded_type = CMS_RECIPINFO_OTHER;
+    ri->type = CMS_RECIPINFO_KEM;
+
+    ori = ri->d.ori;
+    ori->oriType = OBJ_nid2obj(NID_id_smime_ori_kem);
+    if (ori->oriType == NULL)
+        return 0;
+    ori->d.kemri = M_ASN1_new_of(CMS_KEMRecipientInfo);
+    if (ori->d.kemri == NULL)
+        return 0;
+
+    kemri = ori->d.kemri;
+    kemri->version = 0;
+    kemri->cms_ctx = ctx;
+
+    /*
+     * Not a typo: RecipientIdentifier and SignerIdentifier are the same
+     * structure.
+     */
+
+    idtype = (flags & CMS_USE_KEYID) ? CMS_RECIPINFO_KEYIDENTIFIER : CMS_RECIPINFO_ISSUER_SERIAL;
+    if (!ossl_cms_set1_SignerIdentifier(kemri->rid, recip, idtype, ctx))
+        return 0;
+
+    x_pubkey = X509_get_X509_PUBKEY(recip);
+    if (x_pubkey == NULL)
+        return 0;
+    if (!X509_PUBKEY_get0_param(NULL, NULL, NULL, &x_alg, x_pubkey))
+        return 0;
+    if (!X509_ALGOR_copy(kemri->kem, x_alg))
+        return 0;
+
+    kemri->pctx = EVP_PKEY_CTX_new_from_pkey(ossl_cms_ctx_get0_libctx(ctx),
+        recipPubKey,
+        ossl_cms_ctx_get0_propq(ctx));
+    if (kemri->pctx == NULL)
+        return 0;
+    if (EVP_PKEY_encapsulate_init(kemri->pctx, NULL) <= 0)
+        return 0;
+
+    return 1;
+}
+
+EVP_CIPHER_CTX *CMS_RecipientInfo_kemri_get0_ctx(CMS_RecipientInfo *ri)
+{
+    if (ri->type == CMS_RECIPINFO_KEM)
+        return ri->d.ori->d.kemri->ctx;
+    return NULL;
+}
+
+X509_ALGOR *CMS_RecipientInfo_kemri_get0_kdf_alg(CMS_RecipientInfo *ri)
+{
+    if (ri->type == CMS_RECIPINFO_KEM)
+        return ri->d.ori->d.kemri->kdf;
+    return NULL;
+}
+
+int CMS_RecipientInfo_kemri_set_ukm(CMS_RecipientInfo *ri,
+    const unsigned char *ukm,
+    int ukmLength)
+{
+    CMS_KEMRecipientInfo *kemri;
+    ASN1_OCTET_STRING *ukm_str;
+
+    if (ri->type != CMS_RECIPINFO_KEM) {
+        ERR_raise(ERR_LIB_CMS, CMS_R_NOT_KEM);
+        return 0;
+    }
+
+    if (ukm == NULL && ukmLength != 0) {
+        ERR_raise(ERR_LIB_CMS, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+
+    kemri = ri->d.ori->d.kemri;
+
+    ukm_str = ASN1_OCTET_STRING_new();
+    if (ukm_str == NULL)
+        return 0;
+    if (!ASN1_OCTET_STRING_set(ukm_str, ukm, ukmLength)) {
+        ASN1_OCTET_STRING_free(ukm_str);
+        return 0;
+    }
+    ASN1_OCTET_STRING_free(kemri->ukm);
+    kemri->ukm = ukm_str;
+    return 1;
+}
+
+static EVP_KDF_CTX *create_kdf_ctx(CMS_KEMRecipientInfo *kemri)
+{
+    const ASN1_OBJECT *kdf_oid;
+    int ptype;
+    char kdf_alg[OSSL_MAX_NAME_SIZE];
+    EVP_KDF *kdf = NULL;
+    EVP_KDF_CTX *kctx = NULL;
+
+    /*
+     * KDFs with algorithm identifier parameters are not supported yet. To
+     * support this, EVP_KDF_CTX_set_algor_params from
+     * `doc/designs/passing-algorithmidentifier-parameters.md` needs to be
+     * implemented.
+     */
+    X509_ALGOR_get0(&kdf_oid, &ptype, NULL, kemri->kdf);
+    if (ptype != V_ASN1_UNDEF && ptype != V_ASN1_NULL) {
+        ERR_raise(ERR_LIB_CMS, CMS_R_UNSUPPORTED_KDF_ALGORITHM);
+        goto err;
+    }
+    if (OBJ_obj2txt(kdf_alg, sizeof(kdf_alg), kdf_oid, 1) < 0)
+        goto err;
+
+    kdf = EVP_KDF_fetch(ossl_cms_ctx_get0_libctx(kemri->cms_ctx), kdf_alg,
+        ossl_cms_ctx_get0_propq(kemri->cms_ctx));
+    if (kdf == NULL)
+        goto err;
+
+    kctx = EVP_KDF_CTX_new(kdf);
+err:
+    EVP_KDF_free(kdf);
+    return kctx;
+}
+
+static int kdf_derive(unsigned char *kek, size_t keklen,
+    const unsigned char *ss, size_t sslen,
+    CMS_KEMRecipientInfo *kemri)
+{
+    EVP_KDF_CTX *kctx = NULL;
+    OSSL_PARAM params[3];
+    unsigned char *infoder = NULL;
+    int infolen = 0;
+    int rv = 0;
+
+    infolen = CMS_CMSORIforKEMOtherInfo_encode(&infoder, kemri->wrap, kemri->ukm,
+        kemri->kekLength);
+    if (infolen <= 0)
+        goto err;
+
+    kctx = create_kdf_ctx(kemri);
+    if (kctx == NULL)
+        goto err;
+
+    params[0] = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_KEY,
+        (unsigned char *)ss, sslen);
+    params[1] = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_INFO,
+        (char *)infoder, infolen);
+    params[2] = OSSL_PARAM_construct_end();
+
+    if (EVP_KDF_derive(kctx, kek, keklen, params) <= 0)
+        goto err;
+
+    rv = 1;
+err:
+    OPENSSL_free(infoder);
+    EVP_KDF_CTX_free(kctx);
+
+    return rv;
+}
+
+/*
+ * Derive KEK and decrypt/encrypt with it to produce either the original CEK
+ * or the encrypted CEK.
+ */
+
+static int cms_kek_cipher(unsigned char **pout, size_t *poutlen,
+    const unsigned char *ss, size_t sslen,
+    const unsigned char *in, size_t inlen,
+    CMS_KEMRecipientInfo *kemri, int enc)
+{
+    /* Key encryption key */
+    unsigned char kek[EVP_MAX_KEY_LENGTH];
+    size_t keklen = kemri->kekLength;
+    unsigned char *out = NULL;
+    int outlen = 0;
+    int rv = 0;
+    size_t outsize;
+
+    if (keklen > sizeof(kek)) {
+        ERR_raise(ERR_LIB_CMS, CMS_R_INVALID_KEY_LENGTH);
+        return 0;
+    }
+
+    if (inlen > INT_MAX)
+        return 0;
+
+    if (!kdf_derive(kek, keklen, ss, sslen, kemri))
+        goto err;
+
+    /* Set KEK in context */
+    if (!EVP_CipherInit_ex(kemri->ctx, NULL, NULL, kek, NULL, enc))
+        goto err;
+    /* obtain output length of ciphered key */
+    if (!EVP_CipherUpdate(kemri->ctx, NULL, &outlen, in, (int)inlen))
+        goto err;
+    /*
+     * On its integrity-failure paths that primitive writes and cleanses up to
+     * inlen bytes of the output buffer. Size the buffer for that worst case so
+     * a failed unwrap cannot write past the allocation.
+     */
+    outsize = (size_t)outlen < inlen ? inlen : (size_t)outlen;
+    out = OPENSSL_malloc(outsize);
+    if (out == NULL)
+        goto err;
+    if (!EVP_CipherUpdate(kemri->ctx, out, &outlen, in, (int)inlen))
+        goto err;
+    *pout = out;
+    out = NULL;
+    *poutlen = (size_t)outlen;
+
+    rv = 1;
+err:
+    OPENSSL_free(out);
+    OPENSSL_cleanse(kek, sizeof(kek));
+    EVP_CIPHER_CTX_reset(kemri->ctx);
+    EVP_PKEY_CTX_free(kemri->pctx);
+    kemri->pctx = NULL;
+    return rv;
+}
+
+/* Encrypt content key in KEM recipient info */
+
+int ossl_cms_RecipientInfo_kemri_encrypt(const CMS_ContentInfo *cms,
+    CMS_RecipientInfo *ri)
+{
+    CMS_KEMRecipientInfo *kemri;
+    CMS_EncryptedContentInfo *ec;
+    unsigned char *kem_ct = NULL;
+    size_t kem_ct_len;
+    unsigned char *kem_secret = NULL;
+    size_t kem_secret_len = 0;
+    unsigned char *enckey;
+    size_t enckeylen;
+    int rv = 0;
+
+    if (ri->type != CMS_RECIPINFO_KEM) {
+        ERR_raise(ERR_LIB_CMS, CMS_R_NOT_KEM);
+        return 0;
+    }
+
+    kemri = ri->d.ori->d.kemri;
+
+    ec = ossl_cms_get0_env_enc_content(cms);
+    /* Initialise wrap algorithm parameters */
+    if (!ossl_cms_RecipientInfo_wrap_init(ri, ec->cipher))
+        return 0;
+
+    /* Initialise KDF algorithm */
+    if (!ossl_cms_env_asn1_ctrl(ri, 0))
+        return 0;
+
+    if (EVP_PKEY_encapsulate(kemri->pctx, NULL, &kem_ct_len, NULL, &kem_secret_len) <= 0)
+        return 0;
+    kem_ct = OPENSSL_malloc(kem_ct_len);
+    kem_secret = OPENSSL_malloc(kem_secret_len);
+    if (kem_ct == NULL || kem_secret == NULL)
+        goto err;
+
+    if (EVP_PKEY_encapsulate(kemri->pctx, kem_ct, &kem_ct_len, kem_secret, &kem_secret_len) <= 0)
+        goto err;
+
+    ASN1_STRING_set0(kemri->kemct, kem_ct, (int)kem_ct_len);
+    kem_ct = NULL;
+
+    if (!cms_kek_cipher(&enckey, &enckeylen, kem_secret, kem_secret_len, ec->key, ec->keylen,
+            kemri, 1))
+        goto err;
+    ASN1_STRING_set0(kemri->encryptedKey, enckey, (int)enckeylen);
+
+    rv = 1;
+err:
+    OPENSSL_free(kem_ct);
+    OPENSSL_clear_free(kem_secret, kem_secret_len);
+    return rv;
+}
+
+int ossl_cms_RecipientInfo_kemri_decrypt(const CMS_ContentInfo *cms,
+    CMS_RecipientInfo *ri)
+{
+    CMS_KEMRecipientInfo *kemri;
+    CMS_EncryptedContentInfo *ec;
+    const unsigned char *kem_ct = NULL;
+    size_t kem_ct_len;
+    unsigned char *kem_secret = NULL;
+    size_t kem_secret_len = 0;
+    unsigned char *enckey = NULL;
+    size_t enckeylen;
+    unsigned char *cek = NULL;
+    size_t ceklen;
+    int ret = 0;
+
+    if (ri->type != CMS_RECIPINFO_KEM) {
+        ERR_raise(ERR_LIB_CMS, CMS_R_NOT_KEM);
+        return 0;
+    }
+
+    kemri = ri->d.ori->d.kemri;
+
+    ec = ossl_cms_get0_env_enc_content(cms);
+
+    if (kemri->pctx == NULL) {
+        ERR_raise(ERR_LIB_CMS, CMS_R_NO_PRIVATE_KEY);
+        return 0;
+    }
+
+    /* Setup all parameters to derive KEK */
+    if (!ossl_cms_env_asn1_ctrl(ri, 1))
+        goto err;
+
+    kem_ct = ASN1_STRING_get0_data(kemri->kemct);
+    kem_ct_len = ASN1_STRING_get_length(kemri->kemct);
+
+    if (EVP_PKEY_decapsulate(kemri->pctx, NULL, &kem_secret_len, kem_ct, kem_ct_len) <= 0)
+        return 0;
+    kem_secret = OPENSSL_malloc(kem_secret_len);
+    if (kem_secret == NULL)
+        goto err;
+
+    if (EVP_PKEY_decapsulate(kemri->pctx, kem_secret, &kem_secret_len, kem_ct, kem_ct_len) <= 0)
+        goto err;
+
+    /* Attempt to decrypt CEK */
+    enckeylen = kemri->encryptedKey->length;
+    enckey = kemri->encryptedKey->data;
+    if (!cms_kek_cipher(&cek, &ceklen, kem_secret, kem_secret_len, enckey, enckeylen, kemri, 0))
+        goto err;
+    ec = ossl_cms_get0_env_enc_content(cms);
+    OPENSSL_clear_free(ec->key, ec->keylen);
+    ec->key = cek;
+    ec->keylen = ceklen;
+
+    ret = 1;
+err:
+    OPENSSL_clear_free(kem_secret, kem_secret_len);
+    return ret;
+}
diff --git a/deps/openssl/openssl/crypto/cms/cms_lib.c b/deps/openssl/openssl/crypto/cms/cms_lib.c
index e3fe76e206d..11aac8656e7 100644
--- a/deps/openssl/openssl/crypto/cms/cms_lib.c
+++ b/deps/openssl/openssl/crypto/cms/cms_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -35,7 +35,7 @@ CMS_ContentInfo *d2i_CMS_ContentInfo(CMS_ContentInfo **a,
     const CMS_CTX *ctx = ossl_cms_get0_cmsctx(a == NULL ? NULL : *a);

     ci = (CMS_ContentInfo *)ASN1_item_d2i_ex((ASN1_VALUE **)a, in, len,
-        (CMS_ContentInfo_it()),
+        ASN1_ITEM_rptr(CMS_ContentInfo),
         ossl_cms_ctx_get0_libctx(ctx),
         ossl_cms_ctx_get0_propq(ctx));
     if (ci != NULL) {
@@ -48,7 +48,7 @@ CMS_ContentInfo *d2i_CMS_ContentInfo(CMS_ContentInfo **a,

 int i2d_CMS_ContentInfo(const CMS_ContentInfo *a, unsigned char **out)
 {
-    return ASN1_item_i2d((const ASN1_VALUE *)a, out, (CMS_ContentInfo_it()));
+    return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(CMS_ContentInfo));
 }

 CMS_ContentInfo *CMS_ContentInfo_new_ex(OSSL_LIB_CTX *libctx, const char *propq)
@@ -137,7 +137,7 @@ BIO *ossl_cms_content_bio(CMS_ContentInfo *cms)
     /*
      * If content not detached and created return memory BIO
      */
-    if (*pos == NULL || ((*pos)->flags == ASN1_STRING_FLAG_CONT))
+    if (*pos == NULL || cms->contentIncomplete)
         return BIO_new(BIO_s_mem());
     /* Else content was read in: return read only BIO for it */
     return BIO_new_mem_buf((*pos)->data, (*pos)->length);
@@ -200,10 +200,15 @@ err:
 /* unfortunately cannot constify SMIME_write_ASN1() due to this function */
 int CMS_dataFinal(CMS_ContentInfo *cms, BIO *cmsbio)
 {
-    return ossl_cms_DataFinal(cms, cmsbio, NULL, 0);
+    return ossl_cms_DataFinal(cms, cmsbio, NULL, NULL, 0);
 }

-int ossl_cms_DataFinal(CMS_ContentInfo *cms, BIO *cmsbio,
+int CMS_dataFinal_ex(CMS_ContentInfo *cms, BIO *cmsbio, BIO *data)
+{
+    return ossl_cms_DataFinal(cms, cmsbio, data, NULL, 0);
+}
+
+int ossl_cms_DataFinal(CMS_ContentInfo *cms, BIO *cmsbio, BIO *data,
     const unsigned char *precomp_md,
     unsigned int precomp_mdlen)
 {
@@ -212,7 +217,7 @@ int ossl_cms_DataFinal(CMS_ContentInfo *cms, BIO *cmsbio,
     if (pos == NULL)
         return 0;
     /* If embedded content find memory BIO and set content */
-    if (*pos && ((*pos)->flags & ASN1_STRING_FLAG_CONT)) {
+    if (*pos && cms->contentIncomplete) {
         BIO *mbio;
         unsigned char *cont;
         long contlen;
@@ -226,7 +231,7 @@ int ossl_cms_DataFinal(CMS_ContentInfo *cms, BIO *cmsbio,
         BIO_set_flags(mbio, BIO_FLAGS_MEM_RDONLY);
         BIO_set_mem_eof_return(mbio, 0);
         ASN1_STRING_set0(*pos, cont, contlen);
-        (*pos)->flags &= ~ASN1_STRING_FLAG_CONT;
+        cms->contentIncomplete = 0;
     }

     switch (OBJ_obj2nid(cms->contentType)) {
@@ -244,7 +249,8 @@ int ossl_cms_DataFinal(CMS_ContentInfo *cms, BIO *cmsbio,
         return ossl_cms_AuthEnvelopedData_final(cms, cmsbio);

     case NID_pkcs7_signed:
-        return ossl_cms_SignedData_final(cms, cmsbio, precomp_md, precomp_mdlen);
+        return ossl_cms_SignedData_final(cms, cmsbio, data,
+            precomp_md, precomp_mdlen);

     case NID_pkcs7_digest:
         return ossl_cms_DigestedData_do_final(cms, cmsbio, 0);
@@ -381,15 +387,13 @@ int CMS_set_detached(CMS_ContentInfo *cms, int detached)
     if (detached) {
         ASN1_OCTET_STRING_free(*pos);
         *pos = NULL;
+        cms->contentIncomplete = 0;
         return 1;
     }
     if (*pos == NULL)
         *pos = ASN1_OCTET_STRING_new();
     if (*pos != NULL) {
-        /*
-         * NB: special flag to show content is created and not read in.
-         */
-        (*pos)->flags |= ASN1_STRING_FLAG_CONT;
+        cms->contentIncomplete = 1;
         return 1;
     }
     ERR_raise(ERR_LIB_CMS, ERR_R_ASN1_LIB);
@@ -403,28 +407,20 @@ BIO *ossl_cms_DigestAlgorithm_init_bio(X509_ALGOR *digestAlgorithm,
 {
     BIO *mdbio = NULL;
     const ASN1_OBJECT *digestoid;
-    const EVP_MD *digest = NULL;
-    EVP_MD *fetched_digest = NULL;
+    EVP_MD *digest = NULL;
     char alg[OSSL_MAX_NAME_SIZE];
     size_t xof_len = 0;

     X509_ALGOR_get0(&digestoid, NULL, NULL, digestAlgorithm);
     OBJ_obj2txt(alg, sizeof(alg), digestoid, 0);

-    (void)ERR_set_mark();
-    fetched_digest = EVP_MD_fetch(ossl_cms_ctx_get0_libctx(ctx), alg,
+    digest = EVP_MD_fetch(ossl_cms_ctx_get0_libctx(ctx), alg,
         ossl_cms_ctx_get0_propq(ctx));

-    if (fetched_digest != NULL)
-        digest = fetched_digest;
-    else
-        digest = EVP_get_digestbyobj(digestoid);
     if (digest == NULL) {
-        (void)ERR_clear_last_mark();
         ERR_raise(ERR_LIB_CMS, CMS_R_UNKNOWN_DIGEST_ALGORITHM);
         goto err;
     }
-    (void)ERR_pop_to_mark();

     mdbio = BIO_new(BIO_f_md());
     if (mdbio == NULL || BIO_set_md(mdbio, digest) <= 0) {
@@ -449,10 +445,10 @@ BIO *ossl_cms_DigestAlgorithm_init_bio(X509_ALGOR *digestAlgorithm,
                 goto err;
         }
     }
-    EVP_MD_free(fetched_digest);
+    EVP_MD_free(digest);
     return mdbio;
 err:
-    EVP_MD_free(fetched_digest);
+    EVP_MD_free(digest);
     BIO_free(mdbio);
     return NULL;
 }
@@ -475,7 +471,7 @@ int ossl_cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain,
             return 0;
         }
         BIO_get_md_ctx(chain, &mtmp);
-        if (EVP_MD_CTX_get_type(mtmp) == nid
+        if (EVP_MD_CTX_get_type(mtmp) == nid || OBJ_sn2nid(EVP_MD_CTX_get0_name(mtmp)) == nid
             /*
              * Workaround for broken implementations that use signature
              * algorithm OID instead of digest.
diff --git a/deps/openssl/openssl/crypto/cms/cms_local.h b/deps/openssl/openssl/crypto/cms/cms_local.h
index 55f41af054b..0b1f54834f3 100644
--- a/deps/openssl/openssl/crypto/cms/cms_local.h
+++ b/deps/openssl/openssl/crypto/cms/cms_local.h
@@ -10,6 +10,7 @@
 #ifndef OSSL_CRYPTO_CMS_LOCAL_H
 #define OSSL_CRYPTO_CMS_LOCAL_H

+#include <openssl/cms.h>
 #include <openssl/x509.h>

 /*
@@ -40,6 +41,7 @@ typedef struct CMS_KEKIdentifier_st CMS_KEKIdentifier;
 typedef struct CMS_KEKRecipientInfo_st CMS_KEKRecipientInfo;
 typedef struct CMS_PasswordRecipientInfo_st CMS_PasswordRecipientInfo;
 typedef struct CMS_OtherRecipientInfo_st CMS_OtherRecipientInfo;
+typedef struct CMS_KEMRecipientInfo_st CMS_KEMRecipientInfo;
 typedef struct CMS_ReceiptsFrom_st CMS_ReceiptsFrom;
 typedef struct CMS_CTX_st CMS_CTX;

@@ -64,6 +66,16 @@ struct CMS_ContentInfo_st {
         void *otherData;
     } d;
     CMS_CTX ctx;
+    /*-
+     * Set when the content octet string is empty and is to be filled at
+     * dataFinal time from the memory BIO ossl_cms_content_bio() returns.
+     * Cleared:
+     * - once the string has been filled;
+     * - when the content is detached;
+     * - when streaming is set up, where the encoder writes the content out
+     *   and records its position in the string rather than filling it.
+     */
+    int contentIncomplete;
 };

 DEFINE_STACK_OF(CMS_CertificateChoices)
@@ -72,6 +84,7 @@ struct CMS_SignedData_st {
     int32_t version;
     STACK_OF(X509_ALGOR) *digestAlgorithms;
     CMS_EncapsulatedContentInfo *encapContentInfo;
+    /* untrusted certificates for chain building, may include signer certs: */
     STACK_OF(CMS_CertificateChoices) *certificates;
     STACK_OF(CMS_RevocationInfoChoice) *crls;
     STACK_OF(CMS_SignerInfo) *signerInfos;
@@ -101,6 +114,11 @@ struct CMS_SignerInfo_st {
     const CMS_CTX *cms_ctx;
     /* Set to 1 if signing time attribute is to be omitted */
     int omit_signing_time;
+    /* Remember which aspects have been verified */
+    int verify_result; /* for this SignerInfo, all attempted verification aspects succeeded */
+    int cert_verified; /* the certificate was verified successfully */
+    int attr_verified; /* any given signed attributes were verified successfully */
+    int content_verified; /* the signature over the content was verified successfully */
 };

 struct CMS_SignerIdentifier_st {
@@ -141,7 +159,11 @@ struct CMS_EncryptedContentInfo_st {
 };

 struct CMS_RecipientInfo_st {
-    int type;
+    /*
+     * Type which the RecipientInfo is encoded with. OtherRecipientInfo
+     * encompasses different types, specified by 'type' below.
+     */
+    int encoded_type;
     union {
         CMS_KeyTransRecipientInfo *ktri;
         CMS_KeyAgreeRecipientInfo *kari;
@@ -149,6 +171,8 @@ struct CMS_RecipientInfo_st {
         CMS_PasswordRecipientInfo *pwri;
         CMS_OtherRecipientInfo *ori;
     } d;
+    /* internal type, including ORI types */
+    int type;
 };

 typedef CMS_SignerIdentifier CMS_RecipientIdentifier;
@@ -244,7 +268,29 @@ struct CMS_PasswordRecipientInfo_st {

 struct CMS_OtherRecipientInfo_st {
     ASN1_OBJECT *oriType;
-    ASN1_TYPE *oriValue;
+    union {
+        /* NID_id_smime_ori_kem */
+        CMS_KEMRecipientInfo *kemri;
+        /* anything else */
+        ASN1_TYPE *other;
+    } d;
+};
+
+struct CMS_KEMRecipientInfo_st {
+    int32_t version;
+    CMS_RecipientIdentifier *rid;
+    X509_ALGOR *kem;
+    ASN1_OCTET_STRING *kemct;
+    X509_ALGOR *kdf;
+    uint32_t kekLength;
+    ASN1_OCTET_STRING *ukm;
+    X509_ALGOR *wrap;
+    ASN1_OCTET_STRING *encryptedKey;
+    /* Public key context associated with current operation */
+    EVP_PKEY_CTX *pctx;
+    /* Cipher context for CEK wrapping */
+    EVP_CIPHER_CTX *ctx;
+    const CMS_CTX *cms_ctx;
 };

 struct CMS_DigestedData_st {
@@ -360,7 +406,7 @@ struct CMS_ReceiptsFrom_st {

 struct CMS_Receipt_st {
     int32_t version;
-    ASN1_OBJECT *contentType;
+    const ASN1_OBJECT *contentType;
     ASN1_OCTET_STRING *signedContentIdentifier;
     ASN1_OCTET_STRING *originatorSignatureValue;
 };
@@ -398,9 +444,17 @@ const char *ossl_cms_ctx_get0_propq(const CMS_CTX *ctx);
 void ossl_cms_resolve_libctx(CMS_ContentInfo *ci);

 CMS_ContentInfo *ossl_cms_Data_create(OSSL_LIB_CTX *ctx, const char *propq);
-int ossl_cms_DataFinal(CMS_ContentInfo *cms, BIO *cmsbio,
+int ossl_cms_DataFinal(CMS_ContentInfo *cms, BIO *cmsbio, BIO *data,
     const unsigned char *precomp_md,
     unsigned int precomp_mdlen);
+/**
+ * @brief Prepare the content of cms for indefinite-length streaming.
+ * The content octet string is created if it is not already present, and the
+ * content is recorded as created here rather than read in via d2i.
+ * @param cms the CMS_ContentInfo to prepare for streaming
+ * @returns 1 on success, 0 on failure
+ */
+int ossl_cms_stream(CMS_ContentInfo *cms);

 CMS_ContentInfo *ossl_cms_DigestedData_create(const EVP_MD *md,
     OSSL_LIB_CTX *libctx,
@@ -410,7 +464,7 @@ int ossl_cms_DigestedData_do_final(const CMS_ContentInfo *cms,
     BIO *chain, int verify);

 BIO *ossl_cms_SignedData_init_bio(CMS_ContentInfo *cms);
-int ossl_cms_SignedData_final(CMS_ContentInfo *cms, BIO *chain,
+int ossl_cms_SignedData_final(CMS_ContentInfo *cms, BIO *chain, BIO *data,
     const unsigned char *precomp_md,
     unsigned int precomp_mdlen);
 int ossl_cms_set1_SignerIdentifier(CMS_SignerIdentifier *sid, X509 *cert,
@@ -462,6 +516,7 @@ int ossl_cms_pkey_get_ri_type(EVP_PKEY *pk);
 int ossl_cms_pkey_is_ri_type_supported(EVP_PKEY *pk, int ri_type);

 void ossl_cms_RecipientInfos_set_cmsctx(CMS_ContentInfo *cms);
+int ossl_cms_RecipientInfo_wrap_init(CMS_RecipientInfo *ri, const EVP_CIPHER *cipher);

 /* KARI routines */
 int ossl_cms_RecipientInfo_kari_init(CMS_RecipientInfo *ri, X509 *recip,
@@ -472,6 +527,20 @@ int ossl_cms_RecipientInfo_kari_init(CMS_RecipientInfo *ri, X509 *recip,
 int ossl_cms_RecipientInfo_kari_encrypt(const CMS_ContentInfo *cms,
     CMS_RecipientInfo *ri);

+/* KEMRI routines */
+int ossl_cms_RecipientInfo_kemri_get0_alg(CMS_RecipientInfo *ri,
+    uint32_t **pkekLength,
+    X509_ALGOR **pwrap);
+int ossl_cms_RecipientInfo_kemri_init(CMS_RecipientInfo *ri, X509 *recip,
+    EVP_PKEY *recipPubKey, unsigned int flags,
+    const CMS_CTX *ctx);
+int ossl_cms_RecipientInfo_kemri_encrypt(const CMS_ContentInfo *cms,
+    CMS_RecipientInfo *ri);
+int ossl_cms_RecipientInfo_kemri_decrypt(const CMS_ContentInfo *cms,
+    CMS_RecipientInfo *ri);
+int CMS_CMSORIforKEMOtherInfo_encode(unsigned char **pder, X509_ALGOR *wrap,
+    ASN1_OCTET_STRING *ukm, int keylen);
+
 /* PWRI routines */
 int ossl_cms_RecipientInfo_pwri_crypt(const CMS_ContentInfo *cms,
     CMS_RecipientInfo *ri, int en_de);
@@ -487,6 +556,7 @@ int ossl_cms_dh_envelope(CMS_RecipientInfo *ri, int decrypt);
 int ossl_cms_ecdh_envelope(CMS_RecipientInfo *ri, int decrypt);
 int ossl_cms_rsa_envelope(CMS_RecipientInfo *ri, int decrypt);
 int ossl_cms_rsa_sign(CMS_SignerInfo *si, int verify);
+int ossl_cms_kem_envelope(CMS_RecipientInfo *ri, int decrypt);

 int ossl_cms_get1_certs_ex(CMS_ContentInfo *cms, STACK_OF(X509) **certs);
 int ossl_cms_get1_crls_ex(CMS_ContentInfo *cms, STACK_OF(X509_CRL) **crls);
@@ -497,10 +567,12 @@ DECLARE_ASN1_ITEM(CMS_EncryptedData)
 DECLARE_ASN1_ITEM(CMS_EnvelopedData)
 DECLARE_ASN1_ITEM(CMS_AuthEnvelopedData)
 DECLARE_ASN1_ITEM(CMS_KEKRecipientInfo)
+DECLARE_ASN1_ITEM(CMS_KEMRecipientInfo)
 DECLARE_ASN1_ITEM(CMS_KeyAgreeRecipientInfo)
 DECLARE_ASN1_ITEM(CMS_KeyTransRecipientInfo)
 DECLARE_ASN1_ITEM(CMS_OriginatorPublicKey)
 DECLARE_ASN1_ITEM(CMS_OtherKeyAttribute)
+DECLARE_ASN1_ITEM(CMS_OtherRecipientInfo)
 DECLARE_ASN1_ITEM(CMS_Receipt)
 DECLARE_ASN1_ITEM(CMS_ReceiptRequest)
 DECLARE_ASN1_ITEM(CMS_RecipientEncryptedKey)
diff --git a/deps/openssl/openssl/crypto/cms/cms_pwri.c b/deps/openssl/openssl/crypto/cms/cms_pwri.c
index de59c74fdd6..0950cc060bb 100644
--- a/deps/openssl/openssl/crypto/cms/cms_pwri.c
+++ b/deps/openssl/openssl/crypto/cms/cms_pwri.c
@@ -63,9 +63,6 @@ CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
     if (wrap_nid <= 0)
         wrap_nid = NID_id_alg_PWRI_KEK;

-    if (pbe_nid <= 0)
-        pbe_nid = NID_id_pbkdf2;
-
     /* Get from enveloped data */
     if (kekciph == NULL)
         kekciph = ec->cipher;
@@ -74,6 +71,10 @@ CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
         ERR_raise(ERR_LIB_CMS, CMS_R_NO_CIPHER);
         return NULL;
     }
+    if ((EVP_CIPHER_get_flags(kekciph) & EVP_CIPH_FLAG_AEAD_CIPHER) != 0) {
+        ERR_raise(ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEK_ALGORITHM);
+        return NULL;
+    }
     if (wrap_nid != NID_id_alg_PWRI_KEK) {
         ERR_raise(ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM);
         return NULL;
@@ -137,7 +138,7 @@ CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
         ERR_raise(ERR_LIB_CMS, ERR_R_ASN1_LIB);
         goto err;
     }
-    ri->type = CMS_RECIPINFO_PASS;
+    ri->encoded_type = ri->type = CMS_RECIPINFO_PASS;

     pwri = ri->d.pwri;
     pwri->cms_ctx = cms_ctx;
@@ -228,12 +229,12 @@ static int kek_unwrap_key(unsigned char *out, size_t *outlen,
         || !EVP_DecryptUpdate(ctx, tmp, &outl,
             tmp + inlen - blocklen, blocklen)
         /* Can now decrypt first n - 1 blocks */
-        || !EVP_DecryptUpdate(ctx, tmp, &outl, in, inlen - blocklen)
+        || !EVP_DecryptUpdate(ctx, tmp, &outl, in, (int)(inlen - blocklen))

         /* Reset IV to original value */
         || !EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL)
         /* Decrypt again */
-        || !EVP_DecryptUpdate(ctx, tmp, &outl, tmp, inlen))
+        || !EVP_DecryptUpdate(ctx, tmp, &outl, tmp, (int)inlen))
         goto err;
     /* Check check bytes */
     if (((tmp[1] ^ tmp[4]) & (tmp[2] ^ tmp[5]) & (tmp[3] ^ tmp[6])) != 0xff) {
@@ -291,8 +292,8 @@ static int kek_wrap_key(unsigned char *out, size_t *outlen,
                 <= 0)
             return 0;
         /* Encrypt twice */
-        if (!EVP_EncryptUpdate(ctx, out, &dummy, out, olen)
-            || !EVP_EncryptUpdate(ctx, out, &dummy, out, olen))
+        if (!EVP_EncryptUpdate(ctx, out, &dummy, out, (int)olen)
+            || !EVP_EncryptUpdate(ctx, out, &dummy, out, (int)olen))
             return 0;
     }

@@ -397,7 +398,7 @@ int ossl_cms_RecipientInfo_pwri_crypt(const CMS_ContentInfo *cms,
         if (!kek_wrap_key(key, &keylen, ec->key, ec->keylen, kekctx, cms_ctx))
             goto err;
         pwri->encryptedKey->data = key;
-        pwri->encryptedKey->length = keylen;
+        pwri->encryptedKey->length = (int)keylen;
     } else {
         key = OPENSSL_malloc(pwri->encryptedKey->length);
         if (key == NULL)
diff --git a/deps/openssl/openssl/crypto/cms/cms_rsa.c b/deps/openssl/openssl/crypto/cms/cms_rsa.c
index 9bf8284a827..c81e02aa40b 100644
--- a/deps/openssl/openssl/crypto/cms/cms_rsa.c
+++ b/deps/openssl/openssl/crypto/cms/cms_rsa.c
@@ -43,7 +43,7 @@ static int rsa_cms_decrypt(CMS_RecipientInfo *ri)
     int nid;
     int rv = -1;
     const unsigned char *label = NULL;
-    int labellen = 0;
+    size_t labellen = 0;
     const EVP_MD *mgf1md = NULL, *md = NULL;
     RSA_OAEP_PARAMS *oaep;
     const ASN1_OBJECT *aoid;
@@ -90,7 +90,9 @@ static int rsa_cms_decrypt(CMS_RecipientInfo *ri)
         }

         label = ASN1_STRING_get0_data(parameter);
-        labellen = ASN1_STRING_length(parameter);
+        labellen = ASN1_STRING_get_length(parameter);
+        if (labellen > INT_MAX)
+            goto err;
     }

     if (EVP_PKEY_CTX_set_rsa_padding(pkctx, RSA_PKCS1_OAEP_PADDING) <= 0)
@@ -105,7 +107,7 @@ static int rsa_cms_decrypt(CMS_RecipientInfo *ri)
         if (dup_label == NULL)
             goto err;

-        if (EVP_PKEY_CTX_set0_rsa_oaep_label(pkctx, dup_label, labellen) <= 0) {
+        if (EVP_PKEY_CTX_set0_rsa_oaep_label(pkctx, dup_label, (int)labellen) <= 0) {
             OPENSSL_free(dup_label);
             goto err;
         }
@@ -243,7 +245,7 @@ static int rsa_cms_sign(CMS_SignerInfo *si)
         return 0;
     if ((aid_len = params[0].return_size) == 0)
         return 0;
-    if (d2i_X509_ALGOR(&alg, &pp, aid_len) == NULL)
+    if (d2i_X509_ALGOR(&alg, &pp, (long)aid_len) == NULL)
         return 0;
     return 1;
 }
diff --git a/deps/openssl/openssl/crypto/cms/cms_sd.c b/deps/openssl/openssl/crypto/cms/cms_sd.c
index eb9859d7122..f0a2ee1229e 100644
--- a/deps/openssl/openssl/crypto/cms/cms_sd.c
+++ b/deps/openssl/openssl/crypto/cms/cms_sd.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -141,7 +141,7 @@ static int cms_copy_messageDigest(CMS_ContentInfo *cms, CMS_SignerInfo *si)

     sinfos = CMS_get0_SignerInfos(cms);
     for (i = 0; i < sk_CMS_SignerInfo_num(sinfos); i++) {
-        ASN1_OCTET_STRING *messageDigest;
+        const ASN1_OCTET_STRING *messageDigest;

         sitmp = sk_CMS_SignerInfo_value(sinfos, i);
         if (sitmp == si)
@@ -304,7 +304,7 @@ static int ossl_cms_add1_signing_cert(CMS_SignerInfo *si,

     p = pp;
     i2d_ESS_SIGNING_CERT(sc, &p);
-    if (!(seq = ASN1_STRING_new()) || !ASN1_STRING_set(seq, pp, len)) {
+    if (!(seq = ASN1_STRING_new()) || !ossl_asn1_string_set1_data(seq, pp, len)) {
         ASN1_STRING_free(seq);
         OPENSSL_free(pp);
         return 0;
@@ -329,7 +329,7 @@ static int ossl_cms_add1_signing_cert_v2(CMS_SignerInfo *si,

     p = pp;
     i2d_ESS_SIGNING_CERT_V2(sc, &p);
-    if (!(seq = ASN1_STRING_new()) || !ASN1_STRING_set(seq, pp, len)) {
+    if (!(seq = ASN1_STRING_new()) || !ossl_asn1_string_set1_data(seq, pp, len)) {
         ASN1_STRING_free(seq);
         OPENSSL_free(pp);
         return 0;
@@ -341,10 +341,243 @@ static int ossl_cms_add1_signing_cert_v2(CMS_SignerInfo *si,
     return ret;
 }

+static const struct {
+    const char *name;
+    int md_nid;
+    int md_a_must; /* md is a 'MUST' */
+    int noattr_md_nid; /* in case of 'without signed attributes' */
+    int noattr_md_a_must; /* noattr_md is a 'MUST' not a 'SHOULD' */
+} key2data[] = {
+    {
+        "ML-DSA-44",
+        NID_shake256,
+        0,
+        NID_sha512,
+        0,
+    },
+    {
+        "ML-DSA-65",
+        NID_shake256,
+        0,
+        NID_sha512,
+        0,
+    },
+    {
+        "ML-DSA-87",
+        NID_shake256,
+        0,
+        NID_sha512,
+        0,
+    },
+    {
+        "ED25519",
+        NID_sha512,
+        1,
+        NID_sha512,
+        1,
+    }, /* RFC 8419 */
+    /* RFC 8419 3.1 ED448: id-shake256-len MUST be used => NID_undef for now */
+    {
+        "ED448",
+        NID_undef,
+        1,
+        NID_shake256,
+        1,
+    },
+    {
+        "SLH-DSA-SHA2-128f",
+        NID_sha256,
+        0,
+        NID_sha256,
+        0,
+    }, /* RFC 9814 */
+    {
+        "SLH-DSA-SHA2-128s",
+        NID_sha256,
+        0,
+        NID_sha256,
+        0,
+    },
+    {
+        "SLH-DSA-SHA2-192f",
+        NID_sha512,
+        0,
+        NID_sha512,
+        0,
+    },
+    {
+        "SLH-DSA-SHA2-192s",
+        NID_sha512,
+        0,
+        NID_sha512,
+        0,
+    },
+    {
+        "SLH-DSA-SHA2-256f",
+        NID_sha512,
+        0,
+        NID_sha512,
+        0,
+    },
+    {
+        "SLH-DSA-SHA2-256s",
+        NID_sha512,
+        0,
+        NID_sha512,
+        0,
+    },
+    {
+        "SLH-DSA-SHAKE-128f",
+        NID_shake128,
+        0,
+        NID_shake128,
+        0,
+    },
+    {
+        "SLH-DSA-SHAKE-128s",
+        NID_shake128,
+        0,
+        NID_shake128,
+        0,
+    },
+    {
+        "SLH-DSA-SHAKE-192f",
+        NID_shake256,
+        0,
+        NID_shake256,
+        0,
+    },
+    {
+        "SLH-DSA-SHAKE-192s",
+        NID_shake256,
+        0,
+        NID_shake256,
+        0,
+    },
+    {
+        "SLH-DSA-SHAKE-256f",
+        NID_shake256,
+        0,
+        NID_shake256,
+        0,
+    },
+    {
+        "SLH-DSA-SHAKE-256s",
+        NID_shake256,
+        0,
+        NID_shake256,
+        0,
+    },
+    {
+        NULL,
+        NID_undef,
+        0,
+        NID_undef,
+        0,
+    } /* last */
+};
+
+static const char *cms_mdless_signing(EVP_PKEY *pkey)
+{
+    unsigned int i;
+    int def_nid = NID_undef;
+
+    for (i = 0; key2data[i].name != NULL; i++) {
+        if (EVP_PKEY_is_a(pkey, key2data[i].name))
+            return key2data[i].name;
+    }
+    if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) <= 0) {
+        /* Key doesn't have default digest, it's mdless */
+        return EVP_PKEY_get0_type_name(pkey);
+    }
+    return NULL;
+}
+
+static EVP_MD *ossl_cms_get_default_md(const CMS_CTX *ctx, EVP_PKEY *pk, int *md_a_must)
+{
+    EVP_MD *md = NULL;
+    unsigned int i;
+    int def_nid = NID_undef;
+
+    *md_a_must = 0;
+
+    for (i = 0; key2data[i].name != NULL; i++) {
+        if (EVP_PKEY_is_a(pk, key2data[i].name)) {
+            def_nid = key2data[i].md_nid;
+            *md_a_must = key2data[i].md_a_must;
+            break;
+        }
+    }
+
+    if (def_nid == NID_undef && EVP_PKEY_get_default_digest_nid(pk, &def_nid) <= 0) {
+        ERR_raise_data(ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST,
+            "pkey nid=%d", EVP_PKEY_get_id(pk));
+        return NULL;
+    }
+    md = EVP_MD_fetch(ossl_cms_ctx_get0_libctx(ctx), OBJ_nid2sn(def_nid), ossl_cms_ctx_get0_propq(ctx));
+    if (md == NULL)
+        ERR_raise_data(ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST,
+            "default md nid=%d", def_nid);
+    return md;
+}
+
+static EVP_MD *ossl_cms_get_noattr_md(const CMS_CTX *ctx, EVP_PKEY *pk, int *noattr_md_a_must)
+{
+    unsigned int i;
+
+    for (i = 0; key2data[i].name != NULL; i++) {
+        if (EVP_PKEY_is_a(pk, key2data[i].name)) {
+            *noattr_md_a_must = key2data[i].noattr_md_a_must;
+            return EVP_MD_fetch(ossl_cms_ctx_get0_libctx(ctx), OBJ_nid2sn(key2data[i].noattr_md_nid), ossl_cms_ctx_get0_propq(ctx));
+        }
+    }
+    return NULL;
+}
+
+static int ossl_cms_adjust_md(const CMS_CTX *ctx, EVP_PKEY *pk, const EVP_MD **md, EVP_MD **fetched_md, unsigned int flags)
+{
+    int md_a_must = 0;
+
+    while ((flags & CMS_NOATTR) != 0) {
+        /*
+         * Some key types require that a certain type of hash is being used in the
+         * case of signed attributes being absent, others have a suggested hash.
+         * In the latter case only use the suggested one if no hash is given.
+         */
+        int noattr_md_a_must = 0;
+
+        *fetched_md = ossl_cms_get_noattr_md(ctx, pk, &noattr_md_a_must);
+        if (*fetched_md == NULL)
+            break; /* key type not listed - use the default */
+
+        if (noattr_md_a_must)
+            *md = *fetched_md;
+        else if (*md == NULL)
+            *md = *fetched_md;
+        return 1;
+    }
+
+    if (*md != NULL)
+        (void)ERR_set_mark(); /* No error if no default md and user-supplied md is set */
+    *fetched_md = ossl_cms_get_default_md(ctx, pk, &md_a_must);
+    if (*md != NULL)
+        (void)ERR_pop_to_mark();
+    if (md_a_must)
+        *md = *fetched_md;
+    else if (*md == NULL)
+        *md = *fetched_md;
+
+    if (*md == NULL) /* ED448 case */
+        return 0;
+
+    return 1;
+}
+
 CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
     X509 *signer, EVP_PKEY *pk, const EVP_MD *md,
     unsigned int flags)
 {
+    EVP_MD *local_md = NULL;
     CMS_SignedData *sd;
     CMS_SignerInfo *si = NULL;
     X509_ALGOR *alg;
@@ -356,10 +589,10 @@ CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
         return NULL;
     }
     sd = cms_signed_data_init(cms);
-    if (!sd)
+    if (sd == NULL)
         goto err;
     si = M_ASN1_new_of(CMS_SignerInfo);
-    if (!si) {
+    if (si == NULL) {
         ERR_raise(ERR_LIB_CMS, ERR_R_ASN1_LIB);
         goto err;
     }
@@ -398,23 +631,11 @@ CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
     if (!ossl_cms_set1_SignerIdentifier(si->sid, signer, type, ctx))
         goto err;

-    if (md == NULL) {
-        int def_nid;
-
-        if (EVP_PKEY_get_default_digest_nid(pk, &def_nid) <= 0) {
-            ERR_raise_data(ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST,
-                "pkey nid=%d", EVP_PKEY_get_id(pk));
-            goto err;
-        }
-        md = EVP_get_digestbynid(def_nid);
-        if (md == NULL) {
-            ERR_raise_data(ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST,
-                "default md nid=%d", def_nid);
-            goto err;
-        }
-    }
+    if (ossl_cms_adjust_md(ctx, pk, &md, &local_md, flags) != 1)
+        goto err;

-    X509_ALGOR_set_md(si->digestAlgorithm, md);
+    if (!X509_ALGOR_set_md(si->digestAlgorithm, md))
+        goto err;

     /* See if digest is present in digestAlgorithms */
     for (i = 0; i < sk_X509_ALGOR_num(sd->digestAlgorithms); i++) {
@@ -427,20 +648,15 @@ CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
         if (EVP_MD_is_a(md, name))
             break;
     }
-
     if (i == sk_X509_ALGOR_num(sd->digestAlgorithms)) {
-        if ((alg = X509_ALGOR_new()) == NULL) {
-            ERR_raise(ERR_LIB_CMS, ERR_R_ASN1_LIB);
-            goto err;
-        }
-        X509_ALGOR_set_md(alg, md);
-        if (!sk_X509_ALGOR_push(sd->digestAlgorithms, alg)) {
+        if ((alg = X509_ALGOR_new()) == NULL
+            || !X509_ALGOR_set_md(alg, md)
+            || !sk_X509_ALGOR_push(sd->digestAlgorithms, alg)) {
             X509_ALGOR_free(alg);
             ERR_raise(ERR_LIB_CMS, ERR_R_CRYPTO_LIB);
             goto err;
         }
     }
-
     if (!(flags & CMS_KEY_PARAM) && !cms_sd_asn1_ctrl(si, 0)) {
         ERR_raise_data(ERR_LIB_CMS, CMS_R_UNSUPPORTED_SIGNATURE_ALGORITHM,
             "pkey nid=%d", EVP_PKEY_get_id(pk));
@@ -458,11 +674,11 @@ CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
                 goto err;
             }
         }
-
         if (!(flags & CMS_NOSMIMECAP)) {
             STACK_OF(X509_ALGOR) *smcap = NULL;

-            i = CMS_add_standard_smimecap(&smcap);
+            i = CMS_add_standard_smimecap_ex(&smcap, ossl_cms_ctx_get0_libctx(ctx),
+                ossl_cms_ctx_get0_propq(ctx));
             if (i)
                 i = CMS_add_smimecap(si, smcap);
             sk_X509_ALGOR_pop_free(smcap, X509_ALGOR_free);
@@ -484,7 +700,7 @@ CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
             ESS_SIGNING_CERT_V2 *sc2 = NULL;
             int add_sc;

-            if (md == NULL || EVP_MD_is_a(md, SN_sha1)) {
+            if (EVP_MD_is_a(md, SN_sha1)) {
                 if ((sc = OSSL_ESS_signing_cert_new_init(signer,
                          NULL, 1))
                     == NULL)
@@ -513,13 +729,11 @@ CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
     }

     if (!(flags & CMS_NOCERTS)) {
-        /* NB ignore -1 return for duplicate cert */
         if (!CMS_add1_cert(cms, signer)) {
             ERR_raise(ERR_LIB_CMS, ERR_R_CMS_LIB);
             goto err;
         }
     }
-
     if (flags & CMS_KEY_PARAM) {
         if (flags & CMS_NOATTR) {
             si->pctx = EVP_PKEY_CTX_new_from_pkey(ossl_cms_ctx_get0_libctx(ctx),
@@ -543,17 +757,17 @@ CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
             EVP_MD_CTX_set_flags(si->mctx, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX);
         }
     }
-
     if (sd->signerInfos == NULL)
         sd->signerInfos = sk_CMS_SignerInfo_new_null();
     if (sd->signerInfos == NULL || !sk_CMS_SignerInfo_push(sd->signerInfos, si)) {
         ERR_raise(ERR_LIB_CMS, ERR_R_CRYPTO_LIB);
         goto err;
     }
-
+    EVP_MD_free(local_md);
     return si;

 err:
+    EVP_MD_free(local_md);
     M_ASN1_free_of(si, CMS_SignerInfo);
     return NULL;
 }
@@ -633,7 +847,7 @@ STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms)
     sinfos = CMS_get0_SignerInfos(cms);
     for (i = 0; i < sk_CMS_SignerInfo_num(sinfos); i++) {
         si = sk_CMS_SignerInfo_value(sinfos, i);
-        if (si->signer != NULL) {
+        if (si->signer != NULL && si->verify_result) {
             if (!ossl_x509_add_cert_new(&signers, si->signer,
                     X509_ADD_FLAG_DEFAULT)) {
                 sk_X509_free(signers);
@@ -656,6 +870,11 @@ void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer)
     si->signer = signer;
 }

+X509 *CMS_SignerInfo_get0_signer_cert(const CMS_SignerInfo *si)
+{
+    return si->signer;
+}
+
 int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,
     ASN1_OCTET_STRING **keyid,
     X509_NAME **issuer, ASN1_INTEGER **sno)
@@ -668,7 +887,7 @@ int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert)
     return ossl_cms_SignerIdentifier_cert_cmp(si->sid, cert);
 }

-int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *scerts,
+int CMS_set1_signers_certs(CMS_ContentInfo *cms, const STACK_OF(X509) *scerts,
     unsigned int flags)
 {
     CMS_SignedData *sd;
@@ -688,6 +907,7 @@ int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *scerts,
         if (si->signer != NULL)
             continue;

+        /* If any certificates passed they take priority */
         for (j = 0; j < sk_X509_num(scerts); j++) {
             x = sk_X509_value(scerts, j);
             if (CMS_SignerInfo_cert_cmp(si, x) == 0) {
@@ -734,8 +954,134 @@ ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si)
     return si->signature;
 }

+static int cms_bio_read(BIO *in,
+    unsigned char **buffer, size_t *buffer_len)
+{
+    unsigned char *tmp;
+    size_t offset = 0;
+    int n;
+
+    if (BIO_seek(in, 0) < 0)
+        return -1;
+
+    *buffer = NULL;
+    *buffer_len = 0;
+
+    /* read data from BIO into memory */
+    do {
+        *buffer_len += 10240;
+        tmp = OPENSSL_realloc(*buffer, *buffer_len);
+        if (!tmp)
+            goto err;
+        *buffer = tmp;
+
+        if ((n = BIO_read(in, &(*buffer)[offset], 10240)) <= 0)
+            goto err;
+        offset += n;
+    } while (BIO_eof(in) != 1);
+
+    *buffer_len = offset;
+
+    return 1;
+
+err:
+    OPENSSL_free(*buffer);
+    *buffer = NULL;
+    return -1;
+}
+
+static int cms_EVP_PKEY_sign(EVP_PKEY_CTX *pctx, BIO *in,
+    unsigned char *sig, size_t *sig_len,
+    int has_msg_update)
+{
+    size_t buffer_len;
+    int ret;
+
+    if (!has_msg_update) {
+        unsigned char *buffer = NULL;
+
+        if (cms_bio_read(in, &buffer, &buffer_len) != 1)
+            return 0;
+        ret = EVP_PKEY_sign(pctx, sig, sig_len, buffer, buffer_len);
+        OPENSSL_free(buffer);
+    } else {
+        unsigned char buffer[1024];
+        int n;
+
+        if (BIO_seek(in, 0) < 0)
+            return 0;
+
+        do {
+            n = BIO_read(in, buffer, sizeof(buffer));
+            if (n <= 0)
+                break;
+            if (EVP_PKEY_sign_message_update(pctx, buffer, n) != 1)
+                return 0;
+        } while (!BIO_eof(in));
+        ret = EVP_PKEY_sign_message_final(pctx, sig, sig_len);
+    }
+    return ret;
+}
+
+static int cms_EVP_PKEY_verify(EVP_PKEY_CTX *pctx, BIO *in, unsigned char *sig,
+    size_t siglen, int has_msg_update)
+{
+    size_t buffer_len;
+    int ret;
+
+    if (!has_msg_update) {
+        unsigned char *buffer = NULL;
+
+        if (cms_bio_read(in, &buffer, &buffer_len) != 1)
+            return 0;
+
+        ret = EVP_PKEY_verify(pctx, sig, siglen, buffer, buffer_len);
+        OPENSSL_free(buffer);
+    } else {
+        unsigned char buffer[1024];
+        int n;
+
+        if (BIO_seek(in, 0) < 0)
+            return 0;
+
+        do {
+            n = BIO_read(in, buffer, sizeof(buffer));
+            if (n <= 0)
+                break;
+            if (EVP_PKEY_verify_message_update(pctx, buffer, n) != 1)
+                return 0;
+        } while (!BIO_eof(in));
+        if (EVP_PKEY_CTX_set_signature(pctx, sig, siglen) != 1)
+            return 0;
+        ret = EVP_PKEY_verify_message_final(pctx);
+    }
+    return ret;
+}
+
+int CMS_SignerInfo_get_verification_result(const CMS_SignerInfo *si, int type)
+{
+    switch (type) {
+    case CMS_VERIFY_RESULT:
+        return si->verify_result;
+
+    case CMS_VERIFY_CERT:
+        return si->cert_verified;
+
+    case CMS_VERIFY_ATTR:
+        return si->attr_verified;
+
+    case CMS_VERIFY_CONTENT:
+        return si->content_verified;
+
+    default:
+        ERR_raise(ERR_LIB_CMS, CMS_R_UNKNOWN_ID);
+        return 0;
+    }
+}
+
 static int cms_SignerInfo_content_sign(CMS_ContentInfo *cms,
     CMS_SignerInfo *si, BIO *chain,
+    BIO *data,
     const unsigned char *md,
     unsigned int mdlen)
 {
@@ -743,6 +1089,8 @@ static int cms_SignerInfo_content_sign(CMS_ContentInfo *cms,
     int r = 0;
     EVP_PKEY_CTX *pctx = NULL;
     const CMS_CTX *ctx = ossl_cms_get0_cmsctx(cms);
+    EVP_SIGNATURE *sig_alg = NULL;
+    unsigned char *sig = NULL;

     if (mctx == NULL) {
         ERR_raise(ERR_LIB_CMS, ERR_R_CMS_LIB);
@@ -781,7 +1129,6 @@ static int cms_SignerInfo_content_sign(CMS_ContentInfo *cms,
         if (!CMS_SignerInfo_sign(si))
             goto err;
     } else if (si->pctx) {
-        unsigned char *sig;
         size_t siglen;
         unsigned char computed_md[EVP_MAX_MD_SIZE];

@@ -795,14 +1142,15 @@ static int cms_SignerInfo_content_sign(CMS_ContentInfo *cms,
         siglen = EVP_PKEY_get_size(si->pkey);
         if (siglen == 0 || (sig = OPENSSL_malloc(siglen)) == NULL)
             goto err;
-        if (EVP_PKEY_sign(pctx, sig, &siglen, md, mdlen) <= 0) {
-            OPENSSL_free(sig);
+        if (EVP_PKEY_sign(pctx, sig, &siglen, md, mdlen) <= 0)
             goto err;
-        }
-        ASN1_STRING_set0(si->signature, sig, siglen);
+        ASN1_STRING_set0(si->signature, sig, (int)siglen);
+        sig = NULL;
     } else {
-        unsigned char *sig;
+        OSSL_LIB_CTX *libctx = ossl_cms_ctx_get0_libctx(ctx);
+        const char *algorithm;
         unsigned int siglen;
+        int has_msg_update;

         if (md != NULL) {
             ERR_raise(ERR_LIB_CMS, CMS_R_OPERATION_UNSUPPORTED);
@@ -811,25 +1159,55 @@ static int cms_SignerInfo_content_sign(CMS_ContentInfo *cms,
         siglen = EVP_PKEY_get_size(si->pkey);
         if (siglen == 0 || (sig = OPENSSL_malloc(siglen)) == NULL)
             goto err;
-        if (!EVP_SignFinal_ex(mctx, sig, &siglen, si->pkey,
-                ossl_cms_ctx_get0_libctx(ctx),
-                ossl_cms_ctx_get0_propq(ctx))) {
-            ERR_raise(ERR_LIB_CMS, CMS_R_SIGNFINAL_ERROR);
-            OPENSSL_free(sig);
-            goto err;
+
+        if ((algorithm = cms_mdless_signing(si->pkey)) != NULL) {
+            size_t sig_len;
+
+            if (!data) {
+                ERR_raise(ERR_LIB_CMS, CMS_R_NO_CONTENT);
+                goto err;
+            }
+
+            pctx = EVP_PKEY_CTX_new(si->pkey, NULL);
+            if (!pctx)
+                goto err;
+
+            sig_alg = EVP_SIGNATURE_fetch(libctx, algorithm, NULL);
+            if (!sig_alg)
+                goto err;
+
+            if (EVP_PKEY_sign_message_init(pctx, sig_alg, NULL) != 1)
+                goto err;
+
+            sig_len = siglen;
+            has_msg_update = EVP_SIGNATURE_has_message_update(sig_alg);
+            if (cms_EVP_PKEY_sign(pctx, data, sig, &sig_len,
+                    has_msg_update)
+                != 1)
+                goto err;
+            siglen = (unsigned int)sig_len;
+        } else {
+            if (!EVP_SignFinal_ex(mctx, sig, &siglen, si->pkey, libctx,
+                    ossl_cms_ctx_get0_propq(ctx))) {
+                ERR_raise(ERR_LIB_CMS, CMS_R_SIGNFINAL_ERROR);
+                goto err;
+            }
         }
         ASN1_STRING_set0(si->signature, sig, siglen);
+        sig = NULL;
     }

     r = 1;

 err:
+    OPENSSL_free(sig);
     EVP_MD_CTX_free(mctx);
     EVP_PKEY_CTX_free(pctx);
+    EVP_SIGNATURE_free(sig_alg);
     return r;
 }

-int ossl_cms_SignedData_final(CMS_ContentInfo *cms, BIO *chain,
+int ossl_cms_SignedData_final(CMS_ContentInfo *cms, BIO *chain, BIO *data,
     const unsigned char *precomp_md,
     unsigned int precomp_mdlen)
 {
@@ -840,7 +1218,7 @@ int ossl_cms_SignedData_final(CMS_ContentInfo *cms, BIO *chain,
     sinfos = CMS_get0_SignerInfos(cms);
     for (i = 0; i < sk_CMS_SignerInfo_num(sinfos); i++) {
         si = sk_CMS_SignerInfo_value(sinfos, i);
-        if (!cms_SignerInfo_content_sign(cms, si, chain,
+        if (!cms_SignerInfo_content_sign(cms, si, chain, data,
                 precomp_md, precomp_mdlen))
             return 0;
     }
@@ -912,7 +1290,7 @@ int CMS_SignerInfo_sign(CMS_SignerInfo *si)

     EVP_MD_CTX_reset(mctx);

-    ASN1_STRING_set0(si->signature, abuf, siglen);
+    ASN1_STRING_set0(si->signature, abuf, (int)siglen);

     return 1;

@@ -957,10 +1335,15 @@ int CMS_SignerInfo_verify(CMS_SignerInfo *si)
     (void)ERR_set_mark();
     fetched_md = EVP_MD_fetch(libctx, name, propq);

-    if (fetched_md != NULL)
+    if (fetched_md != NULL) {
         md = fetched_md;
-    else
+    } else {
         md = EVP_get_digestbyobj(si->digestAlgorithm->algorithm);
+        /* Reject aliases such as signature algorithm OIDs */
+        if (md != NULL
+            && EVP_MD_get_type(md) != OBJ_obj2nid(si->digestAlgorithm->algorithm))
+            md = NULL;
+    }
     if (md == NULL) {
         (void)ERR_clear_last_mark();
         ERR_raise(ERR_LIB_CMS, CMS_R_UNKNOWN_DIGEST_ALGORITHM);
@@ -1042,12 +1425,19 @@ err:

 int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain)
 {
-    ASN1_OCTET_STRING *os = NULL;
+    return CMS_SignerInfo_verify_ex(si, chain, NULL);
+}
+
+int CMS_SignerInfo_verify_ex(CMS_SignerInfo *si, BIO *chain, BIO *data)
+{
+    const ASN1_OCTET_STRING *os = NULL;
     EVP_MD_CTX *mctx = EVP_MD_CTX_new();
     EVP_PKEY_CTX *pkctx = NULL;
     int r = -1;
     unsigned char mval[EVP_MAX_MD_SIZE];
     unsigned int mlen;
+    EVP_SIGNATURE *sig_alg = NULL;
+    unsigned char *buffer = NULL;

     if (mctx == NULL) {
         ERR_raise(ERR_LIB_CMS, ERR_R_EVP_LIB);
@@ -1088,24 +1478,45 @@ int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain)
     } else {
         const EVP_MD *md = EVP_MD_CTX_get0_md(mctx);
         const CMS_CTX *ctx = si->cms_ctx;
+        OSSL_LIB_CTX *libctx = ossl_cms_ctx_get0_libctx(ctx);
+        const char *algorithm;
+        int has_msg_update;

-        pkctx = EVP_PKEY_CTX_new_from_pkey(ossl_cms_ctx_get0_libctx(ctx),
-            si->pkey,
+        pkctx = EVP_PKEY_CTX_new_from_pkey(libctx, si->pkey,
             ossl_cms_ctx_get0_propq(ctx));
         if (pkctx == NULL)
             goto err;
-        if (EVP_PKEY_verify_init(pkctx) <= 0)
-            goto err;
-        if (EVP_PKEY_CTX_set_signature_md(pkctx, md) <= 0)
-            goto err;
-        si->pctx = pkctx;
-        if (!cms_sd_asn1_ctrl(si, 1)) {
+
+        if ((algorithm = cms_mdless_signing(si->pkey)) != NULL) {
+            if (!data) {
+                ERR_raise(ERR_LIB_CMS, CMS_R_NO_CONTENT);
+                goto err;
+            }
+
+            sig_alg = EVP_SIGNATURE_fetch(libctx, algorithm, NULL);
+            if (!sig_alg)
+                goto err;
+            if (EVP_PKEY_verify_message_init(pkctx, sig_alg, NULL) != 1)
+                goto err;
+
+            has_msg_update = EVP_SIGNATURE_has_message_update(sig_alg);
+            r = cms_EVP_PKEY_verify(pkctx, data, si->signature->data,
+                si->signature->length, has_msg_update);
+        } else {
+            if (EVP_PKEY_verify_init(pkctx) <= 0)
+                goto err;
+            if (EVP_PKEY_CTX_set_signature_md(pkctx, md) <= 0)
+                goto err;
+            si->pctx = pkctx;
+            if (!cms_sd_asn1_ctrl(si, 1)) {
+                si->pctx = NULL;
+                goto err;
+            }
             si->pctx = NULL;
-            goto err;
+
+            r = EVP_PKEY_verify(pkctx, si->signature->data,
+                si->signature->length, mval, mlen);
         }
-        si->pctx = NULL;
-        r = EVP_PKEY_verify(pkctx, si->signature->data,
-            si->signature->length, mval, mlen);
         if (r <= 0) {
             ERR_raise(ERR_LIB_CMS, CMS_R_VERIFICATION_FAILURE);
             r = 0;
@@ -1115,12 +1526,15 @@ int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain)
 err:
     EVP_PKEY_CTX_free(pkctx);
     EVP_MD_CTX_free(mctx);
+    EVP_SIGNATURE_free(sig_alg);
+    OPENSSL_free(buffer);
     return r;
 }

 BIO *CMS_SignedData_verify(CMS_SignedData *sd, BIO *detached_data,
-    STACK_OF(X509) *scerts, X509_STORE *store,
-    STACK_OF(X509) *extra, STACK_OF(X509_CRL) *crls,
+    const STACK_OF(X509) *scerts, X509_STORE *store,
+    const STACK_OF(X509) *extra,
+    const STACK_OF(X509_CRL) *crls,
     unsigned int flags,
     OSSL_LIB_CTX *libctx, const char *propq)
 {
@@ -1202,34 +1616,53 @@ int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs,
 }

 /* Check to see if a cipher exists and if so add S/MIME capabilities */
-static int cms_add_cipher_smcap(STACK_OF(X509_ALGOR) **sk, int nid, int arg)
+static int cms_add_cipher_smcap(STACK_OF(X509_ALGOR) **sk, int nid, int arg,
+    OSSL_LIB_CTX *libctx, const char *propq)
 {
-    if (EVP_get_cipherbynid(nid))
+    EVP_CIPHER *cipher;
+
+    ERR_set_mark();
+    cipher = EVP_CIPHER_fetch(libctx, OBJ_nid2sn(nid), propq);
+    ERR_pop_to_mark();
+    if (cipher != NULL) {
+        EVP_CIPHER_free(cipher);
         return CMS_add_simple_smimecap(sk, nid, arg);
+    }
     return 1;
 }

-static int cms_add_digest_smcap(STACK_OF(X509_ALGOR) **sk, int nid, int arg)
+static int cms_add_digest_smcap(STACK_OF(X509_ALGOR) **sk, int nid, int arg,
+    OSSL_LIB_CTX *libctx, const char *propq)
 {
-    if (EVP_get_digestbynid(nid))
+    EVP_MD *md;
+
+    ERR_set_mark();
+    md = EVP_MD_fetch(libctx, OBJ_nid2sn(nid), propq);
+    ERR_pop_to_mark();
+    if (md != NULL) {
+        EVP_MD_free(md);
         return CMS_add_simple_smimecap(sk, nid, arg);
+    }
     return 1;
 }

-int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap)
+int CMS_add_standard_smimecap_ex(STACK_OF(X509_ALGOR) **smcap,
+    OSSL_LIB_CTX *libctx, const char *propq)
 {
-    if (!cms_add_cipher_smcap(smcap, NID_aes_256_cbc, -1)
-        || !cms_add_digest_smcap(smcap, NID_id_GostR3411_2012_256, -1)
-        || !cms_add_digest_smcap(smcap, NID_id_GostR3411_2012_512, -1)
-        || !cms_add_digest_smcap(smcap, NID_id_GostR3411_94, -1)
-        || !cms_add_cipher_smcap(smcap, NID_id_Gost28147_89, -1)
-        || !cms_add_cipher_smcap(smcap, NID_aes_192_cbc, -1)
-        || !cms_add_cipher_smcap(smcap, NID_aes_128_cbc, -1)
-        || !cms_add_cipher_smcap(smcap, NID_des_ede3_cbc, -1)
-        || !cms_add_cipher_smcap(smcap, NID_rc2_cbc, 128)
-        || !cms_add_cipher_smcap(smcap, NID_rc2_cbc, 64)
-        || !cms_add_cipher_smcap(smcap, NID_des_cbc, -1)
-        || !cms_add_cipher_smcap(smcap, NID_rc2_cbc, 40))
+    if (!cms_add_cipher_smcap(smcap, NID_aes_256_cbc, -1, libctx, propq)
+        || !cms_add_digest_smcap(smcap, NID_id_GostR3411_2012_256, -1, libctx, propq)
+        || !cms_add_digest_smcap(smcap, NID_id_GostR3411_2012_512, -1, libctx, propq)
+        || !cms_add_digest_smcap(smcap, NID_id_GostR3411_94, -1, libctx, propq)
+        || !cms_add_cipher_smcap(smcap, NID_id_Gost28147_89, -1, libctx, propq)
+        || !cms_add_cipher_smcap(smcap, NID_aes_192_cbc, -1, libctx, propq)
+        || !cms_add_cipher_smcap(smcap, NID_aes_128_cbc, -1, libctx, propq)
+        || !cms_add_cipher_smcap(smcap, NID_des_ede3_cbc, -1, libctx, propq)
+        || !cms_add_cipher_smcap(smcap, NID_rc2_cbc, 128, libctx, propq))
         return 0;
     return 1;
 }
+
+int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap)
+{
+    return CMS_add_standard_smimecap_ex(smcap, NULL, NULL);
+}
diff --git a/deps/openssl/openssl/crypto/cms/cms_smime.c b/deps/openssl/openssl/crypto/cms/cms_smime.c
index dea1df08476..028c3350050 100644
--- a/deps/openssl/openssl/crypto/cms/cms_smime.c
+++ b/deps/openssl/openssl/crypto/cms/cms_smime.c
@@ -341,7 +341,7 @@ err:
 }

 /* This strongly overlaps with PKCS7_verify() */
-int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
+int CMS_verify(CMS_ContentInfo *cms, const STACK_OF(X509) *certs,
     X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags)
 {
     CMS_SignerInfo *si;
@@ -350,13 +350,33 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
     STACK_OF(X509_CRL) *crls = NULL;
     STACK_OF(X509) **si_chains = NULL;
     X509 *signer;
-    int i, scount = 0, ret = 0;
+    int i, n = 0, scount = 0, ret = 0;
     BIO *cmsbio = NULL, *tmpin = NULL, *tmpout = NULL;
     int cadesVerify = (flags & CMS_CADES) != 0;
+    int partial = (flags & CMS_VERIFY_PARTIAL) != 0;
     const CMS_CTX *ctx = ossl_cms_get0_cmsctx(cms);

-    if (dcont == NULL && !check_content(cms))
+    if (dcont == NULL && !check_content(cms)) {
+        /*
+         * A CMS_ContentInfo can be verified more than once (e.g. retried
+         * with a different store).  If a previous call left verify_result
+         * == 1 ("so far, fine") or any of the *_verified flags set on a
+         * SignerInfo, this early failure must still be reflected there
+         * instead of silently keeping the stale "verified" state from the
+         * earlier call.
+         */
+        sinfos = CMS_get0_SignerInfos(cms);
+        for (i = 0; i < sk_CMS_SignerInfo_num(sinfos); i++) {
+            si = sk_CMS_SignerInfo_value(sinfos, i);
+            si->verify_result = 0;
+            si->cert_verified = 0;
+            si->attr_verified = 0;
+            si->content_verified = 0;
+        }
         return 0;
+    }
+    /* Set a mark so that we can clear any new errors on success. */
+    (void)ERR_set_mark();
     if (dcont != NULL && !(flags & CMS_BINARY)) {
         const ASN1_OBJECT *coid = CMS_get0_eContentType(cms);

@@ -378,6 +398,11 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
         CMS_SignerInfo_get0_algs(si, NULL, &signer, NULL, NULL);
         if (signer != NULL)
             scount++;
+        /* Reset verification results */
+        si->verify_result = 1; /* so far, fine */
+        si->cert_verified = 0;
+        si->attr_verified = 0;
+        si->content_verified = 0;
     }

     if (scount != sk_CMS_SignerInfo_num(sinfos))
@@ -394,7 +419,7 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
     if ((flags & CMS_NO_SIGNER_CERT_VERIFY) == 0 || cadesVerify) {
         if (cadesVerify) {
             /* Certificate trust chain is required to check CAdES signature */
-            si_chains = OPENSSL_zalloc(scount * sizeof(si_chains[0]));
+            si_chains = OPENSSL_calloc(scount, sizeof(si_chains[0]));
             if (si_chains == NULL)
                 goto err;
         }
@@ -413,8 +438,13 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,

             if (!cms_signerinfo_verify_cert(si, store, untrusted, crls,
                     si_chains ? &si_chains[i] : NULL,
-                    ctx))
-                goto err;
+                    ctx)) {
+                si->verify_result = 0;
+                if (!partial)
+                    goto err;
+                continue;
+            }
+            si->cert_verified = 1;
         }
     }

@@ -423,16 +453,29 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
     if ((flags & CMS_NO_ATTR_VERIFY) == 0 || cadesVerify) {
         for (i = 0; i < scount; i++) {
             si = sk_CMS_SignerInfo_value(sinfos, i);
-            if (CMS_signed_get_attr_count(si) < 0)
+            if (!si->verify_result)
                 continue;
-            if (CMS_SignerInfo_verify(si) <= 0)
-                goto err;
+            if (CMS_signed_get_attr_count(si) < 0) {
+                si->attr_verified = 1;
+                continue;
+            }
+            if (CMS_SignerInfo_verify(si) <= 0) {
+                si->verify_result = 0;
+                if (!partial)
+                    goto err;
+                continue;
+            }
             if (cadesVerify) {
                 STACK_OF(X509) *si_chain = si_chains ? si_chains[i] : NULL;

-                if (ossl_cms_check_signing_certs(si, si_chain) <= 0)
-                    goto err;
+                if (ossl_cms_check_signing_certs(si, si_chain) <= 0) {
+                    si->verify_result = 0;
+                    if (!partial)
+                        goto err;
+                    continue;
+                }
             }
+            si->attr_verified = 1;
         }
     }

@@ -451,7 +494,7 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
         tmpin = (len == 0) ? dcont : BIO_new_mem_buf(ptr, len);
         if (tmpin == NULL) {
             ERR_raise(ERR_LIB_CMS, ERR_R_BIO_LIB);
-            goto err2;
+            goto err;
         }
     } else {
         tmpin = dcont;
@@ -497,15 +540,37 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
     if (!(flags & CMS_NO_CONTENT_VERIFY)) {
         for (i = 0; i < sk_CMS_SignerInfo_num(sinfos); i++) {
             si = sk_CMS_SignerInfo_value(sinfos, i);
-            if (CMS_SignerInfo_verify_content(si, cmsbio) <= 0) {
+            if (!si->verify_result)
+                continue;
+            if (CMS_SignerInfo_verify_ex(si, cmsbio, tmpin) <= 0) {
                 ERR_raise(ERR_LIB_CMS, CMS_R_CONTENT_VERIFY_ERROR);
-                goto err;
+                si->verify_result = 0;
+                if (!partial)
+                    goto err;
+                continue;
             }
+            si->content_verified = 1;
         }
     }

-    ret = 1;
+    /* Determine overall result */
+    for (i = 0; i < scount; i++) {
+        if (sk_CMS_SignerInfo_value(sinfos, i)->verify_result)
+            n++;
+    }
+    if (partial)
+        ret = n > 0; /* One success is enough */
+    else
+        ret = n == scount; /* All must be successful */
 err:
+    /*
+     * On overall failure, verify_result must not stand at 1 ("so far, fine")
+     * for any SignerInfo.
+     */
+    if (!ret) {
+        for (i = 0; i < sk_CMS_SignerInfo_num(sinfos); i++)
+            sk_CMS_SignerInfo_value(sinfos, i)->verify_result = 0;
+    }
     if (!(flags & SMIME_BINARY) && dcont) {
         do_free_upto(cmsbio, tmpout);
         if (tmpin != dcont)
@@ -522,7 +587,6 @@ err:
     if (out != tmpout)
         BIO_free_all(tmpout);

-err2:
     if (si_chains != NULL) {
         for (i = 0; i < scount; ++i)
             OSSL_STACK_OF_X509_free(si_chains[i]);
@@ -531,11 +595,20 @@ err2:
     sk_X509_pop_free(untrusted, X509_free);
     sk_X509_CRL_pop_free(crls, X509_CRL_free);

+    /*
+     * On error, keep internal errors for inspection by the caller. Otherwise
+     * clear any new errors queued since the mark.
+     */
+    if (!ret)
+        ERR_clear_last_mark();
+    else
+        ERR_pop_to_mark();
+
     return ret;
 }

 int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
-    STACK_OF(X509) *certs,
+    const STACK_OF(X509) *certs,
     X509_STORE *store, unsigned int flags)
 {
     int r;
@@ -548,7 +621,7 @@ int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
 }

 CMS_ContentInfo *CMS_sign_ex(X509 *signcert, EVP_PKEY *pkey,
-    STACK_OF(X509) *certs, BIO *data,
+    const STACK_OF(X509) *certs, BIO *data,
     unsigned int flags, OSSL_LIB_CTX *libctx,
     const char *propq)
 {
@@ -595,15 +668,15 @@ err:
     return NULL;
 }

-CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
-    BIO *data, unsigned int flags)
+CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey,
+    const STACK_OF(X509) *certs, BIO *data, unsigned int flags)
 {
     return CMS_sign_ex(signcert, pkey, certs, data, flags, NULL, NULL);
 }

 CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si,
     X509 *signcert, EVP_PKEY *pkey,
-    STACK_OF(X509) *certs, unsigned int flags)
+    const STACK_OF(X509) *certs, unsigned int flags)
 {
     CMS_SignerInfo *rct_si;
     CMS_ContentInfo *cms = NULL;
@@ -673,7 +746,7 @@ err:
     return NULL;
 }

-CMS_ContentInfo *CMS_encrypt_ex(STACK_OF(X509) *certs, BIO *data,
+CMS_ContentInfo *CMS_encrypt_ex(const STACK_OF(X509) *certs, BIO *data,
     const EVP_CIPHER *cipher, unsigned int flags,
     OSSL_LIB_CTX *libctx, const char *propq)
 {
@@ -710,7 +783,7 @@ err:
     return NULL;
 }

-CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *data,
+CMS_ContentInfo *CMS_encrypt(const STACK_OF(X509) *certs, BIO *data,
     const EVP_CIPHER *cipher, unsigned int flags)
 {
     return CMS_encrypt_ex(certs, data, cipher, flags, NULL, NULL);
@@ -785,6 +858,14 @@ int CMS_decrypt_set1_pkey_and_peer(CMS_ContentInfo *cms, EVP_PKEY *pk,
                 return 1;
             if (r < 0)
                 return 0;
+        } else if (ri_type == CMS_RECIPINFO_KEM) {
+            if (cert == NULL || !CMS_RecipientInfo_kemri_cert_cmp(ri, cert)) {
+                CMS_RecipientInfo_kemri_set0_pkey(ri, pk);
+                r = CMS_RecipientInfo_decrypt(cms, ri);
+                CMS_RecipientInfo_kemri_set0_pkey(ri, NULL);
+                if (cert != NULL || r > 0)
+                    return r;
+            }
         }
         /* If we have a cert, try matching RecipientInfo, else try them all */
         else if (cert == NULL || !CMS_RecipientInfo_ktri_cert_cmp(ri, cert)) {
@@ -946,7 +1027,7 @@ int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags)

     (void)BIO_flush(cmsbio);

-    if (!CMS_dataFinal(cms, cmsbio)) {
+    if (!CMS_dataFinal_ex(cms, cmsbio, data)) {
         ERR_raise(ERR_LIB_CMS, CMS_R_CMS_DATAFINAL_ERROR);
         goto err;
     }
@@ -973,7 +1054,7 @@ int CMS_final_digest(CMS_ContentInfo *cms,

     (void)BIO_flush(cmsbio);

-    if (!ossl_cms_DataFinal(cms, cmsbio, md, mdlen)) {
+    if (!ossl_cms_DataFinal(cms, cmsbio, NULL, md, mdlen)) {
         ERR_raise(ERR_LIB_CMS, CMS_R_CMS_DATAFINAL_ERROR);
         goto err;
     }
diff --git a/deps/openssl/openssl/crypto/comp/c_brotli.c b/deps/openssl/openssl/crypto/comp/c_brotli.c
index 60f780a91a2..9ede56fa97a 100644
--- a/deps/openssl/openssl/crypto/comp/c_brotli.c
+++ b/deps/openssl/openssl/crypto/comp/c_brotli.c
@@ -13,6 +13,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <openssl/objects.h>
+#include "internal/e_os.h"
 #include "internal/comp.h"
 #include <openssl/err.h>
 #include "crypto/cryptlib.h"
@@ -46,10 +47,6 @@ static void brotli_free(void *opaque, void *address)
  * work.  Therefore, all BROTLI routines are loaded at run time
  * and we do not link to a .LIB file when BROTLI_SHARED is set.
  */
-#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
-#include <windows.h>
-#endif
-
 #ifdef BROTLI_SHARED
 #include "internal/dso.h"

@@ -557,10 +554,10 @@ static int bio_brotli_read(BIO *b, char *out, int outl)
          * No data in input buffer try to read some in, if an error then
          * return the total data read.
          */
-        ret = BIO_read(next, ctx->decode.buf, ctx->decode.bufsize);
+        ret = BIO_read(next, ctx->decode.buf, (int)ctx->decode.bufsize);
         if (ret <= 0) {
             /* Total data read */
-            int tot = outl - ctx->decode.avail_out;
+            int tot = outl - (int)ctx->decode.avail_out;

             BIO_copy_next_retry(b);
             if (ret < 0)
@@ -612,10 +609,10 @@ static int bio_brotli_write(BIO *b, const char *in, int inl)
     for (;;) {
         /* If data in output buffer write it first */
         while (ctx->encode.count > 0) {
-            ret = BIO_write(next, ctx->encode.ptr, ctx->encode.count);
+            ret = BIO_write(next, ctx->encode.ptr, (int)ctx->encode.count);
             if (ret <= 0) {
                 /* Total data written */
-                int tot = inl - ctx->encode.avail_in;
+                int tot = inl - (int)ctx->encode.avail_in;

                 BIO_copy_next_retry(b);
                 if (ret < 0)
@@ -668,7 +665,7 @@ static int bio_brotli_flush(BIO *b)
     for (;;) {
         /* If data in output buffer write it first */
         while (ctx->encode.count > 0) {
-            ret = BIO_write(next, ctx->encode.ptr, ctx->encode.count);
+            ret = BIO_write(next, ctx->encode.ptr, (int)ctx->encode.count);
             if (ret <= 0) {
                 BIO_copy_next_retry(b);
                 return ret;
diff --git a/deps/openssl/openssl/crypto/comp/c_zlib.c b/deps/openssl/openssl/crypto/comp/c_zlib.c
index 549bd4f0e5b..da073385372 100644
--- a/deps/openssl/openssl/crypto/comp/c_zlib.c
+++ b/deps/openssl/openssl/crypto/comp/c_zlib.c
@@ -11,6 +11,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <openssl/objects.h>
+#include "internal/e_os.h"
 #include "internal/comp.h"
 #include <openssl/err.h>
 #include "crypto/cryptlib.h"
@@ -40,7 +41,7 @@ static void *zlib_zalloc(void *opaque, unsigned int no, unsigned int size)
 {
     void *p;

-    p = OPENSSL_zalloc(no * size);
+    p = OPENSSL_calloc(no, size);
     return p;
 }

@@ -64,10 +65,6 @@ static COMP_METHOD zlib_stateful_method = {
  * work.  Therefore, all ZLIB routines are loaded at run time
  * and we do not link to a .LIB file when ZLIB_SHARED is set.
  */
-#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
-#include <windows.h>
-#endif /* !(OPENSSL_SYS_WINDOWS || \
-        * OPENSSL_SYS_WIN32) */

 #ifdef ZLIB_SHARED
 #include "internal/dso.h"
diff --git a/deps/openssl/openssl/crypto/comp/c_zstd.c b/deps/openssl/openssl/crypto/comp/c_zstd.c
index 18f75f92f45..6eaf2c362a5 100644
--- a/deps/openssl/openssl/crypto/comp/c_zstd.c
+++ b/deps/openssl/openssl/crypto/comp/c_zstd.c
@@ -16,6 +16,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <openssl/objects.h>
+#include "internal/e_os.h"
 #include "internal/comp.h"
 #include <openssl/err.h>
 #include "crypto/cryptlib.h"
@@ -62,16 +63,6 @@ static ZSTD_customMem zstd_mem_funcs = {
 };
 #endif

-/*
- * When OpenSSL is built on Windows, we do not want to require that
- * the LIBZSTD.DLL be available in order for the OpenSSL DLLs to
- * work.  Therefore, all ZSTD routines are loaded at run time
- * and we do not link to a .LIB file when ZSTD_SHARED is set.
- */
-#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
-#include <windows.h>
-#endif
-
 #ifdef ZSTD_SHARED
 #include "internal/dso.h"

@@ -620,19 +611,19 @@ static int bio_zstd_read(BIO *b, char *out, int outl)
             }
             /* No more output space */
             if (outBuf.pos == outBuf.size)
-                return outBuf.pos;
+                return (int)outBuf.pos;
         } while (ctx->decompress.inbuf.pos < ctx->decompress.inbuf.size);

         /*
          * No data in input buffer try to read some in, if an error then
          * return the total data read.
          */
-        ret = BIO_read(next, ctx->decompress.buffer, ctx->decompress.bufsize);
+        ret = BIO_read(next, ctx->decompress.buffer, (int)ctx->decompress.bufsize);
         if (ret <= 0) {
             BIO_copy_next_retry(b);
             if (ret < 0 && outBuf.pos == 0)
                 return ret;
-            return outBuf.pos;
+            return (int)outBuf.pos;
         }
         ctx->decompress.inbuf.size = ret;
         ctx->decompress.inbuf.pos = 0;
@@ -672,19 +663,19 @@ static int bio_zstd_write(BIO *b, const char *in, int inl)
         /* If data in output buffer write it first */
         while (ctx->compress.write_pos < ctx->compress.outbuf.pos) {
             ret = BIO_write(next, (unsigned char *)ctx->compress.outbuf.dst + ctx->compress.write_pos,
-                ctx->compress.outbuf.pos - ctx->compress.write_pos);
+                (int)(ctx->compress.outbuf.pos - ctx->compress.write_pos));
             if (ret <= 0) {
                 BIO_copy_next_retry(b);
                 if (ret < 0 && inBuf.pos == 0)
                     return ret;
-                return inBuf.pos;
+                return (int)inBuf.pos;
             }
             ctx->compress.write_pos += ret;
         }

         /* Have we consumed all supplied data? */
         if (done)
-            return inBuf.pos;
+            return (int)inBuf.pos;

         /* Reset buffer */
         ctx->compress.outbuf.pos = 0;
@@ -724,7 +715,7 @@ static int bio_zstd_flush(BIO *b)
         /* If data in output buffer write it first */
         while (ctx->compress.write_pos < ctx->compress.outbuf.pos) {
             ret = BIO_write(next, (unsigned char *)ctx->compress.outbuf.dst + ctx->compress.write_pos,
-                ctx->compress.outbuf.pos - ctx->compress.write_pos);
+                (int)(ctx->compress.outbuf.pos - ctx->compress.write_pos));
             if (ret <= 0) {
                 BIO_copy_next_retry(b);
                 return ret;
@@ -762,8 +753,19 @@ static long bio_zstd_ctrl(BIO *b, int cmd, long num, void *ptr)
     switch (cmd) {

     case BIO_CTRL_RESET:
+        /* reset decompressor */
+        ctx->decompress.inbuf.size = 0;
+        ctx->decompress.inbuf.pos = 0;
+        if (ctx->decompress.state != NULL)
+            ZSTD_initDStream(ctx->decompress.state);
+
+        /* reset compressor */
         ctx->compress.write_pos = 0;
-        ctx->compress.bufsize = 0;
+        ctx->compress.outbuf.pos = 0;
+        if (ctx->compress.state != NULL)
+            ZSTD_initCStream(ctx->compress.state, ZSTD_CLEVEL_DEFAULT);
+
+        /* keep existing bufsize, do not set it to 0 */
         ret = 1;
         break;

diff --git a/deps/openssl/openssl/crypto/comp/comp_err.c b/deps/openssl/openssl/crypto/comp/comp_err.c
deleted file mode 100644
index 0aa0dc63024..00000000000
--- a/deps/openssl/openssl/crypto/comp/comp_err.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/comperr.h>
-#include "crypto/comperr.h"
-
-#ifndef OPENSSL_NO_COMP
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA COMP_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_COMP, 0, COMP_R_BROTLI_DECODE_ERROR),
-        "brotli decode error" },
-    { ERR_PACK(ERR_LIB_COMP, 0, COMP_R_BROTLI_ENCODE_ERROR),
-        "brotli encode error" },
-    { ERR_PACK(ERR_LIB_COMP, 0, COMP_R_BROTLI_NOT_SUPPORTED),
-        "brotli not supported" },
-    { ERR_PACK(ERR_LIB_COMP, 0, COMP_R_ZLIB_DEFLATE_ERROR),
-        "zlib deflate error" },
-    { ERR_PACK(ERR_LIB_COMP, 0, COMP_R_ZLIB_INFLATE_ERROR),
-        "zlib inflate error" },
-    { ERR_PACK(ERR_LIB_COMP, 0, COMP_R_ZLIB_NOT_SUPPORTED),
-        "zlib not supported" },
-    { ERR_PACK(ERR_LIB_COMP, 0, COMP_R_ZSTD_COMPRESS_ERROR),
-        "zstd compress error" },
-    { ERR_PACK(ERR_LIB_COMP, 0, COMP_R_ZSTD_DECODE_ERROR), "zstd decode error" },
-    { ERR_PACK(ERR_LIB_COMP, 0, COMP_R_ZSTD_DECOMPRESS_ERROR),
-        "zstd decompress error" },
-    { ERR_PACK(ERR_LIB_COMP, 0, COMP_R_ZSTD_NOT_SUPPORTED),
-        "zstd not supported" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_COMP_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(COMP_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(COMP_str_reasons);
-#endif
-    return 1;
-}
-#else
-NON_EMPTY_TRANSLATION_UNIT
-#endif
diff --git a/deps/openssl/openssl/crypto/comp/comp_lib.c b/deps/openssl/openssl/crypto/comp/comp_lib.c
index 1254b37d31a..d0b0b227b5d 100644
--- a/deps/openssl/openssl/crypto/comp/comp_lib.c
+++ b/deps/openssl/openssl/crypto/comp/comp_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1998-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -68,7 +68,7 @@ int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
     if (ctx->meth->compress == NULL) {
         return -1;
     }
-    ret = ctx->meth->compress(ctx, out, olen, in, ilen);
+    ret = (int)ctx->meth->compress(ctx, out, olen, in, ilen);
     if (ret > 0) {
         ctx->compress_in += ilen;
         ctx->compress_out += ret;
@@ -84,7 +84,7 @@ int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
     if (ctx->meth->expand == NULL) {
         return -1;
     }
-    ret = ctx->meth->expand(ctx, out, olen, in, ilen);
+    ret = (int)ctx->meth->expand(ctx, out, olen, in, ilen);
     if (ret > 0) {
         ctx->expand_in += ilen;
         ctx->expand_out += ret;
diff --git a/deps/openssl/openssl/crypto/comp/comp_local.h b/deps/openssl/openssl/crypto/comp/comp_local.h
index fbc5ab318c1..41f47a66fee 100644
--- a/deps/openssl/openssl/crypto/comp/comp_local.h
+++ b/deps/openssl/openssl/crypto/comp/comp_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,11 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_COMP_COMP_LOCAL_H)
+#define OSSL_LIBCRYPTO_COMP_COMP_LOCAL_H
+
+#include <openssl/comp.h>
+
 struct comp_method_st {
     int type; /* NID for compression library */
     const char *name; /* A text string to identify the library */
@@ -28,3 +33,5 @@ struct comp_ctx_st {
     unsigned long expand_out;
     void *data;
 };
+
+#endif /* !defined(OSSL_LIBCRYPTO_COMP_COMP_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/conf/build.info b/deps/openssl/openssl/crypto/conf/build.info
index ff367994ea0..3f563dc9880 100644
--- a/deps/openssl/openssl/crypto/conf/build.info
+++ b/deps/openssl/openssl/crypto/conf/build.info
@@ -2,3 +2,7 @@ LIBS=../../libcrypto
 SOURCE[../../libcrypto]= \
         conf_err.c conf_lib.c conf_api.c conf_def.c conf_mod.c \
         conf_mall.c conf_sap.c conf_ssl.c
+
+DEPEND[conf_def.o]=conf_def.h
+GENERATE[conf_def.h]=keysets.pl
+INCLUDE[conf_def.o]=.
diff --git a/deps/openssl/openssl/crypto/conf/conf_api.c b/deps/openssl/openssl/crypto/conf/conf_api.c
index c615d007fba..0aacd6958d5 100644
--- a/deps/openssl/openssl/crypto/conf/conf_api.c
+++ b/deps/openssl/openssl/crypto/conf/conf_api.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -54,6 +54,11 @@ int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value)
         return 0;

     v = lh_CONF_VALUE_insert(conf->data, value);
+    if (lh_CONF_VALUE_error(conf->data)) {
+        (void)sk_CONF_VALUE_pop(ts);
+        return 0;
+    }
+
     if (v != NULL) {
         (void)sk_CONF_VALUE_delete_ptr(ts, v);
         OPENSSL_free(v->name);
@@ -192,7 +197,7 @@ CONF_VALUE *_CONF_new_section(CONF *conf, const char *section)
         goto err;
     if ((v = OPENSSL_malloc(sizeof(*v))) == NULL)
         goto err;
-    i = strlen(section) + 1;
+    i = (int)strlen(section) + 1;
     if ((v->section = OPENSSL_malloc(i)) == NULL)
         goto err;

diff --git a/deps/openssl/openssl/crypto/conf/conf_def.c b/deps/openssl/openssl/crypto/conf/conf_def.c
index d693ce43d1b..2312473675d 100644
--- a/deps/openssl/openssl/crypto/conf/conf_def.c
+++ b/deps/openssl/openssl/crypto/conf/conf_def.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -262,7 +262,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
         if (in != NULL && BIO_gets(in, p, CONFBUFSIZE - 1) < 0)
             goto err;
         p[CONFBUFSIZE - 1] = '\0';
-        ii = i = strlen(p);
+        ii = i = (int)strlen(p);
         if (first_call) {
             /* Other BOMs imply unsupported multibyte encoding,
              * so don't strip them and let the error raise */
@@ -587,7 +587,7 @@ err:
 #endif
     if (line != NULL)
         *line = eline;
-    BIO_snprintf(btmp, sizeof(btmp), "%ld", eline);
+    snprintf(btmp, sizeof(btmp), "%ld", eline);
     ERR_add_error_data(2, "line ", btmp);
     if (h != conf->data) {
         CONF_free(conf->data);
@@ -640,15 +640,14 @@ static void clear_comments(CONF *conf, char *p)

 static int str_copy(CONF *conf, char *section, char **pto, char *from)
 {
-    int q, r, rr = 0, to = 0, len = 0;
+    int q, r, rr = 0, to = 0;
     char *s, *e, *rp, *p, *rrp, *np, *cp, v;
     BUF_MEM *buf;

     if ((buf = BUF_MEM_new()) == NULL)
         return 0;

-    len = strlen(from) + 1;
-    if (!BUF_MEM_grow(buf, len))
+    if (!BUF_MEM_grow(buf, strlen(from) + 1))
         goto err;

     for (;;) {
@@ -770,11 +769,6 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
             while (*p)
                 buf->data[to++] = *(p++);

-            /*
-             * Since we change the pointer 'from', we also have to change the
-             * perceived length of the string it points at.  /RL
-             */
-            len -= e - from;
             from = e;

             /*
diff --git a/deps/openssl/openssl/crypto/conf/conf_def.h b/deps/openssl/openssl/crypto/conf/conf_def.h
deleted file mode 100644
index 1f66a58e092..00000000000
--- a/deps/openssl/openssl/crypto/conf/conf_def.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * WARNING: do not edit!
- * Generated by crypto/conf/keysets.pl
- *
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#define CONF_NUMBER       1
-#define CONF_UPPER        2
-#define CONF_LOWER        4
-#define CONF_UNDER        256
-#define CONF_PUNCT        512
-#define CONF_WS           16
-#define CONF_ESC          32
-#define CONF_QUOTE        64
-#define CONF_DQUOTE       1024
-#define CONF_COMMENT      128
-#define CONF_FCOMMENT     2048
-#define CONF_DOLLAR       4096
-#define CONF_EOF          8
-#define CONF_ALPHA        (CONF_UPPER|CONF_LOWER)
-#define CONF_ALNUM        (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
-#define CONF_ALNUM_PUNCT  (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT)
-
-
-#define IS_COMMENT(conf,c)     is_keytype(conf, c, CONF_COMMENT)
-#define IS_FCOMMENT(conf,c)    is_keytype(conf, c, CONF_FCOMMENT)
-#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
-#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
-#define IS_NUMBER(conf,c)      is_keytype(conf, c, CONF_NUMBER)
-#define IS_WS(conf,c)          is_keytype(conf, c, CONF_WS)
-#define IS_ALNUM(conf,c)       is_keytype(conf, c, CONF_ALNUM)
-#define IS_ALNUM_PUNCT(conf,c) is_keytype(conf, c, CONF_ALNUM_PUNCT)
-#define IS_QUOTE(conf,c)       is_keytype(conf, c, CONF_QUOTE)
-#define IS_DQUOTE(conf,c)      is_keytype(conf, c, CONF_DQUOTE)
-#define IS_DOLLAR(conf,c)      is_keytype(conf, c, CONF_DOLLAR)
-
-static const unsigned short CONF_type_default[128] = {
-    0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0010, 0x0010, 0x0000, 0x0000, 0x0010, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0010, 0x0200, 0x0040, 0x0080, 0x1000, 0x0200, 0x0200, 0x0040,
-    0x0000, 0x0000, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
-    0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
-    0x0001, 0x0001, 0x0000, 0x0200, 0x0000, 0x0000, 0x0000, 0x0200,
-    0x0200, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
-    0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
-    0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
-    0x0002, 0x0002, 0x0002, 0x0000, 0x0020, 0x0000, 0x0200, 0x0100,
-    0x0040, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004,
-    0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004,
-    0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004,
-    0x0004, 0x0004, 0x0004, 0x0000, 0x0200, 0x0000, 0x0200, 0x0000,
-};
-
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-static const unsigned short CONF_type_win32[128] = {
-    0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0010, 0x0010, 0x0000, 0x0000, 0x0010, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0010, 0x0200, 0x0400, 0x0000, 0x1000, 0x0200, 0x0200, 0x0000,
-    0x0000, 0x0000, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
-    0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
-    0x0001, 0x0001, 0x0000, 0x0A00, 0x0000, 0x0000, 0x0000, 0x0200,
-    0x0200, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
-    0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
-    0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
-    0x0002, 0x0002, 0x0002, 0x0000, 0x0000, 0x0000, 0x0200, 0x0100,
-    0x0000, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004,
-    0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004,
-    0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004,
-    0x0004, 0x0004, 0x0004, 0x0000, 0x0200, 0x0000, 0x0200, 0x0000,
-};
-#endif
diff --git a/deps/openssl/openssl/crypto/conf/conf_err.c b/deps/openssl/openssl/crypto/conf/conf_err.c
deleted file mode 100644
index 0dd42e0f43c..00000000000
--- a/deps/openssl/openssl/crypto/conf/conf_err.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/conferr.h>
-#include "crypto/conferr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA CONF_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_ERROR_LOADING_DSO), "error loading dso" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_INVALID_PRAGMA), "invalid pragma" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_LIST_CANNOT_BE_NULL),
-        "list cannot be null" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_MANDATORY_BRACES_IN_VARIABLE_EXPANSION),
-        "mandatory braces in variable expansion" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_MISSING_CLOSE_SQUARE_BRACKET),
-        "missing close square bracket" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_MISSING_EQUAL_SIGN),
-        "missing equal sign" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_MISSING_INIT_FUNCTION),
-        "missing init function" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_MODULE_INITIALIZATION_ERROR),
-        "module initialization error" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_CLOSE_BRACE), "no close brace" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_CONF), "no conf" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE),
-        "no conf or environment variable" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_SECTION), "no section" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_SUCH_FILE), "no such file" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_VALUE), "no value" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NUMBER_TOO_LARGE), "number too large" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION),
-        "openssl conf references missing section" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_RECURSIVE_DIRECTORY_INCLUDE),
-        "recursive directory include" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_RECURSIVE_SECTION_REFERENCE),
-        "recursive section reference" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_RELATIVE_PATH), "relative path" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_SSL_COMMAND_SECTION_EMPTY),
-        "ssl command section empty" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_SSL_COMMAND_SECTION_NOT_FOUND),
-        "ssl command section not found" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_SSL_SECTION_EMPTY), "ssl section empty" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_SSL_SECTION_NOT_FOUND),
-        "ssl section not found" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_UNABLE_TO_CREATE_NEW_SECTION),
-        "unable to create new section" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_UNKNOWN_MODULE_NAME),
-        "unknown module name" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_VARIABLE_EXPANSION_TOO_LONG),
-        "variable expansion too long" },
-    { ERR_PACK(ERR_LIB_CONF, 0, CONF_R_VARIABLE_HAS_NO_VALUE),
-        "variable has no value" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_CONF_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(CONF_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(CONF_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/conf/conf_local.h b/deps/openssl/openssl/crypto/conf/conf_local.h
index f3b16f11385..53e34c8aa80 100644
--- a/deps/openssl/openssl/crypto/conf/conf_local.h
+++ b/deps/openssl/openssl/crypto/conf/conf_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,5 +7,10 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_CONF_CONF_LOCAL_H)
+#define OSSL_LIBCRYPTO_CONF_CONF_LOCAL_H
+
 #include <openssl/conftypes.h>
 void ossl_config_add_ssl_module(void);
+
+#endif /* !defined(OSSL_LIBCRYPTO_CONF_CONF_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/conf/conf_mall.c b/deps/openssl/openssl/crypto/conf/conf_mall.c
index bad19c96cca..67ec97ec3c3 100644
--- a/deps/openssl/openssl/crypto/conf/conf_mall.c
+++ b/deps/openssl/openssl/crypto/conf/conf_mall.c
@@ -7,16 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
 #include <stdio.h>
 #include <openssl/crypto.h>
 #include "internal/cryptlib.h"
 #include <openssl/conf.h>
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
-#include <openssl/engine.h>
 #include "internal/provider.h"
 #include "crypto/rand.h"
 #include "conf_local.h"
@@ -28,9 +24,6 @@ void OPENSSL_load_builtin_modules(void)
     /* Add builtin modules here */
     ASN1_add_oid_module();
     ASN1_add_stable_module();
-#ifndef OPENSSL_NO_ENGINE
-    ENGINE_add_conf_module();
-#endif
     EVP_add_alg_module();
     ossl_config_add_ssl_module();
     ossl_provider_add_conf_module();
diff --git a/deps/openssl/openssl/crypto/conf/conf_mod.c b/deps/openssl/openssl/crypto/conf/conf_mod.c
index 4ed7d9fd76c..c71a7f07aa6 100644
--- a/deps/openssl/openssl/crypto/conf/conf_mod.c
+++ b/deps/openssl/openssl/crypto/conf/conf_mod.c
@@ -7,21 +7,18 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
 #include "internal/cryptlib.h"
 #include "internal/rcu.h"
 #include <stdio.h>
 #include <ctype.h>
 #include <openssl/crypto.h>
+#include <openssl/conf.h>
 #include "internal/conf.h"
 #include <openssl/conf_api.h>
 #include "internal/dso.h"
 #include "internal/thread_once.h"
 #include <openssl/x509.h>
 #include <openssl/trace.h>
-#include <openssl/engine.h>
 #include "conf_local.h"

 DEFINE_STACK_OF(CONF_MODULE)
@@ -30,39 +27,6 @@ DEFINE_STACK_OF(CONF_IMODULE)
 #define DSO_mod_init_name "OPENSSL_init"
 #define DSO_mod_finish_name "OPENSSL_finish"

-/*
- * This structure contains a data about supported modules. entries in this
- * table correspond to either dynamic or static modules.
- */
-
-struct conf_module_st {
-    /* DSO of this module or NULL if static */
-    DSO *dso;
-    /* Name of the module */
-    char *name;
-    /* Init function */
-    conf_init_func *init;
-    /* Finish function */
-    conf_finish_func *finish;
-    /* Number of successfully initialized modules */
-    int links;
-    void *usr_data;
-};
-
-/*
- * This structure contains information about modules that have been
- * successfully initialized. There may be more than one entry for a given
- * module.
- */
-
-struct conf_imodule_st {
-    CONF_MODULE *pmod;
-    char *name;
-    char *value;
-    unsigned long flags;
-    void *usr_data;
-};
-
 static CRYPTO_ONCE init_module_list_lock = CRYPTO_ONCE_STATIC_INIT;
 static CRYPTO_RCU_LOCK *module_list_lock = NULL;
 static STACK_OF(CONF_MODULE) *supported_modules = NULL; /* protected by lock */
@@ -249,10 +213,6 @@ int CONF_modules_load_file(const char *filename,
 DEFINE_RUN_ONCE_STATIC(do_load_builtin_modules)
 {
     OPENSSL_load_builtin_modules();
-#ifndef OPENSSL_NO_ENGINE
-    /* Need to load ENGINEs */
-    ENGINE_load_builtin_engines();
-#endif
     return 1;
 }

@@ -394,7 +354,8 @@ err:
 static CONF_MODULE *module_find(const char *name)
 {
     CONF_MODULE *tmod;
-    int i, nchar;
+    int i;
+    size_t nchar;
     const char *p;
     STACK_OF(CONF_MODULE) *mods;

@@ -408,7 +369,9 @@ static CONF_MODULE *module_find(const char *name)
     if (!RUN_ONCE(&init_module_list_lock, do_init_module_list_lock))
         return NULL;

-    ossl_rcu_read_lock(module_list_lock);
+    if (!ossl_rcu_read_lock(module_list_lock))
+        return NULL;
+
     mods = ossl_rcu_deref(&supported_modules);

     for (i = 0; i < sk_CONF_MODULE_num(mods); i++) {
@@ -442,6 +405,7 @@ static int module_init(CONF_MODULE *pmod, const char *name, const char *value,
     imod->name = OPENSSL_strdup(name);
     imod->value = OPENSSL_strdup(value);
     imod->usr_data = NULL;
+    imod->libctx = NULL;

     if (!imod->name || !imod->value)
         goto memerr;
@@ -708,7 +672,7 @@ char *CONF_get1_default_config_file(void)

     if (file == NULL)
         return NULL;
-    BIO_snprintf(file, size, "%s%s%s", t, sep, OPENSSL_CONF);
+    snprintf(file, size, "%s%s%s", t, sep, OPENSSL_CONF);

     return file;
 }
@@ -731,6 +695,11 @@ int CONF_parse_list(const char *list_, int sep, int nospc,
         ERR_raise(ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL);
         return 0;
     }
+    /* Reject separators whose byte value is NUL. */
+    if ((unsigned char)sep == '\0') {
+        ERR_raise(ERR_LIB_CONF, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }

     lstart = list_;
     for (;;) {
@@ -750,7 +719,7 @@ int CONF_parse_list(const char *list_, int sep, int nospc,
                 while (isspace((unsigned char)*tmpend))
                     tmpend--;
             }
-            ret = list_cb(lstart, tmpend - lstart + 1, arg);
+            ret = list_cb(lstart, (int)(tmpend - lstart + 1), arg);
         }
         if (ret <= 0)
             return ret;
@@ -759,3 +728,35 @@ int CONF_parse_list(const char *list_, int sep, int nospc,
         lstart = p + 1;
     }
 }
+
+/*
+ * Parse a boolean configuration value: 1, yes, true or on (in lower or
+ * uppercase) enables, 0, no, false or off disables.  Returns 0 when the
+ * value is missing or not recognised, without raising an error.
+ */
+int ossl_conf_parse_bool(const char *value, int *result)
+{
+    if (value == NULL)
+        return 0;
+    if (strcmp(value, "1") == 0
+        || strcmp(value, "yes") == 0
+        || strcmp(value, "YES") == 0
+        || strcmp(value, "true") == 0
+        || strcmp(value, "TRUE") == 0
+        || strcmp(value, "on") == 0
+        || strcmp(value, "ON") == 0) {
+        *result = 1;
+        return 1;
+    }
+    if (strcmp(value, "0") == 0
+        || strcmp(value, "no") == 0
+        || strcmp(value, "NO") == 0
+        || strcmp(value, "false") == 0
+        || strcmp(value, "FALSE") == 0
+        || strcmp(value, "off") == 0
+        || strcmp(value, "OFF") == 0) {
+        *result = 0;
+        return 1;
+    }
+    return 0;
+}
diff --git a/deps/openssl/openssl/crypto/conf/conf_sap.c b/deps/openssl/openssl/crypto/conf/conf_sap.c
index e0d66172066..e801c0d032d 100644
--- a/deps/openssl/openssl/crypto/conf/conf_sap.c
+++ b/deps/openssl/openssl/crypto/conf/conf_sap.c
@@ -14,7 +14,6 @@
 #include "conf_local.h"
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
-#include <openssl/engine.h>

 #if defined(_WIN32) && !defined(__BORLANDC__)
 #define strdup _strdup
diff --git a/deps/openssl/openssl/crypto/conf/conf_ssl.c b/deps/openssl/openssl/crypto/conf/conf_ssl.c
index c8796715c00..9ad57195d96 100644
--- a/deps/openssl/openssl/crypto/conf/conf_ssl.c
+++ b/deps/openssl/openssl/crypto/conf/conf_ssl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,51 +11,41 @@
 #include <string.h>
 #include <openssl/conf.h>
 #include <openssl/err.h>
-#include "internal/sslconf.h"
 #include "conf_local.h"
+#include "internal/sslconf.h"
+#include "internal/core.h"
+#include "internal/cryptlib.h"

-/*
- * SSL library configuration module placeholder. We load it here but defer
- * all decisions about its contents to libssl.
- */
-
-struct ssl_conf_name_st {
-    /* Name of this set of commands */
-    char *name;
-    /* List of commands */
-    SSL_CONF_CMD *cmds;
-    /* Number of commands */
-    size_t cmd_count;
-};
+typedef struct ssl_module_st SSL_MODULE;

-struct ssl_conf_cmd_st {
-    /* Command */
-    char *cmd;
-    /* Argument */
-    char *arg;
+struct ssl_module_st {
+    struct ssl_conf_name_st *names;
+    size_t names_count;
 };

-static struct ssl_conf_name_st *ssl_names;
-static size_t ssl_names_count;
-
 static void ssl_module_free(CONF_IMODULE *md)
 {
-    size_t i, j;
-    if (ssl_names == NULL)
+    SSL_MODULE *ssl = CONF_imodule_get_usr_data(md);
+
+    if (ssl == NULL)
         return;
-    for (i = 0; i < ssl_names_count; i++) {
-        struct ssl_conf_name_st *tname = ssl_names + i;
+
+    CONF_imodule_set_usr_data(md, NULL);
+    ossl_lib_ctx_detach_ssl_conf_imodule(NULL, md);
+
+    for (size_t i = 0; i < ssl->names_count; i++) {
+        struct ssl_conf_name_st *tname = ssl->names + i;

         OPENSSL_free(tname->name);
-        for (j = 0; j < tname->cmd_count; j++) {
+        for (size_t j = 0; j < tname->cmd_count; j++) {
             OPENSSL_free(tname->cmds[j].cmd);
             OPENSSL_free(tname->cmds[j].arg);
         }
         OPENSSL_free(tname->cmds);
     }
-    OPENSSL_free(ssl_names);
-    ssl_names = NULL;
-    ssl_names_count = 0;
+
+    OPENSSL_free(ssl->names);
+    OPENSSL_free(ssl);
 }

 static int ssl_module_init(CONF_IMODULE *md, const CONF *cnf)
@@ -64,6 +54,8 @@ static int ssl_module_init(CONF_IMODULE *md, const CONF *cnf)
     int rv = 0;
     const char *ssl_conf_section;
     STACK_OF(CONF_VALUE) *cmd_lists;
+    OSSL_LIB_CTX *libctx;
+    SSL_MODULE *ssl = NULL;

     ssl_conf_section = CONF_imodule_get_value(md);
     cmd_lists = NCONF_get_section(cnf, ssl_conf_section);
@@ -77,12 +69,21 @@ static int ssl_module_init(CONF_IMODULE *md, const CONF *cnf)
     }
     cnt = sk_CONF_VALUE_num(cmd_lists);
     ssl_module_free(md);
-    ssl_names = OPENSSL_zalloc(sizeof(*ssl_names) * cnt);
-    if (ssl_names == NULL)
+
+    ssl = OPENSSL_zalloc(sizeof(*ssl));
+    if (ssl == NULL)
         goto err;
-    ssl_names_count = cnt;
-    for (i = 0; i < ssl_names_count; i++) {
-        struct ssl_conf_name_st *ssl_name = ssl_names + i;
+    CONF_imodule_set_usr_data(md, ssl);
+
+    ssl->names = OPENSSL_calloc(cnt, sizeof(*ssl->names));
+    libctx = ossl_lib_ctx_get_concrete(cnf->libctx);
+    if (libctx == NULL || ssl->names == NULL)
+        goto err;
+
+    ossl_lib_ctx_attach_ssl_conf_imodule(libctx, md);
+    ssl->names_count = cnt;
+    for (i = 0; i < ssl->names_count; i++) {
+        struct ssl_conf_name_st *ssl_name = ssl->names + i;
         CONF_VALUE *sect = sk_CONF_VALUE_value(cmd_lists, (int)i);
         STACK_OF(CONF_VALUE) *cmds = NCONF_get_section(cnf, sect->value);

@@ -99,7 +100,7 @@ static int ssl_module_init(CONF_IMODULE *md, const CONF *cnf)
         if (ssl_name->name == NULL)
             goto err;
         cnt = sk_CONF_VALUE_num(cmds);
-        ssl_name->cmds = OPENSSL_zalloc(cnt * sizeof(struct ssl_conf_cmd_st));
+        ssl_name->cmds = OPENSSL_calloc(cnt, sizeof(struct ssl_conf_cmd_st));
         if (ssl_name->cmds == NULL)
             goto err;
         ssl_name->cmd_count = cnt;
@@ -132,11 +133,16 @@ err:
  * conf_ssl_name_find. Also stores the name of the set of commands in |*name|
  * and the number of commands in the set in |*cnt|.
  */
-const SSL_CONF_CMD *conf_ssl_get(size_t idx, const char **name, size_t *cnt)
+const SSL_CONF_CMD *conf_ssl_get(CONF_IMODULE *md, size_t idx, const char **name, size_t *cnt)
 {
-    *name = ssl_names[idx].name;
-    *cnt = ssl_names[idx].cmd_count;
-    return ssl_names[idx].cmds;
+    SSL_MODULE *ssl = md != NULL ? CONF_imodule_get_usr_data(md) : NULL;
+
+    if (ssl == NULL || ssl->names == NULL)
+        return NULL;
+
+    *name = ssl->names[idx].name;
+    *cnt = ssl->names[idx].cmd_count;
+    return ssl->names[idx].cmds;
 }

 /*
@@ -144,14 +150,16 @@ const SSL_CONF_CMD *conf_ssl_get(size_t idx, const char **name, size_t *cnt)
  * index for the command set in |*idx|.
  * Returns 1 on success or 0 on failure.
  */
-int conf_ssl_name_find(const char *name, size_t *idx)
+int conf_ssl_name_find(CONF_IMODULE *md, const char *name, size_t *idx)
 {
-    size_t i;
+    SSL_MODULE *ssl = md != NULL ? CONF_imodule_get_usr_data(md) : NULL;
     const struct ssl_conf_name_st *nm;
+    size_t i;

-    if (name == NULL)
+    if (ssl == NULL || ssl->names == NULL)
         return 0;
-    for (i = 0, nm = ssl_names; i < ssl_names_count; i++, nm++) {
+
+    for (i = 0, nm = ssl->names; i < ssl->names_count; i++, nm++) {
         if (strcmp(nm->name, name) == 0) {
             *idx = i;
             return 1;
diff --git a/deps/openssl/openssl/crypto/conf/keysets.pl b/deps/openssl/openssl/crypto/conf/keysets.pl
index 7e83d800501..9af08ead2e1 100644
--- a/deps/openssl/openssl/crypto/conf/keysets.pl
+++ b/deps/openssl/openssl/crypto/conf/keysets.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -73,7 +73,10 @@ print <<"EOF";
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
+#if !defined(OSSL_LIBCRYPTO_CONF_CONF_DEF_H)
+#define OSSL_LIBCRYPTO_CONF_CONF_DEF_H

+/* clang-format off */
 #define CONF_NUMBER       $NUMBER
 #define CONF_UPPER        $UPPER
 #define CONF_LOWER        $LOWER
@@ -123,3 +126,5 @@ for ($i = 0; $i < 128; $i++) {
 }
 print "\n};\n";
 print "#endif\n";
+print "/* clang-format on */\n";
+print "\n#endif /* !defined(OSSL_LIBCRYPTO_CONF_CONF_DEF_H) */\n";
diff --git a/deps/openssl/openssl/crypto/context.c b/deps/openssl/openssl/crypto/context.c
index 1ae88e42aa9..66d7e429556 100644
--- a/deps/openssl/openssl/crypto/context.c
+++ b/deps/openssl/openssl/crypto/context.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -16,13 +16,14 @@
 #include "internal/core.h"
 #include "internal/bio.h"
 #include "internal/provider.h"
+#include "internal/conf.h"
 #include "crypto/decoder.h"
 #include "crypto/context.h"

 struct ossl_lib_ctx_st {
     CRYPTO_RWLOCK *lock;
     OSSL_EX_DATA_GLOBAL global;
-
+    CONF_IMODULE *ssl_imod;
     void *property_string_data;
     void *evp_method_store;
     void *provider_store;
@@ -31,7 +32,6 @@ struct ossl_lib_ctx_st {
     void *global_properties;
     void *drbg;
     void *drbg_nonce;
-    CRYPTO_THREAD_LOCAL rcu_local_key;
 #ifndef FIPS_MODULE
     void *provider_conf;
     void *bio_core;
@@ -47,7 +47,6 @@ struct ossl_lib_ctx_st {
     void *threads;
 #endif
 #ifdef FIPS_MODULE
-    void *thread_event_handler;
     void *fips_prov;
 #endif
     STACK_OF(SSL_COMP) *comp_methods;
@@ -86,15 +85,40 @@ int ossl_lib_ctx_is_child(OSSL_LIB_CTX *ctx)
     return ctx->ischild;
 }

+int ossl_lib_ctx_attach_ssl_conf_imodule(OSSL_LIB_CTX *ctx, CONF_IMODULE *md)
+{
+    if (ctx == NULL || md == NULL || ctx->ssl_imod != NULL)
+        return 0;
+
+    ctx->ssl_imod = md;
+    md->libctx = ctx;
+    return 1;
+}
+
+int ossl_lib_ctx_detach_ssl_conf_imodule(OSSL_LIB_CTX *ctx, CONF_IMODULE *md)
+{
+    if (ctx != NULL && md != NULL)
+        return 0;
+
+    if (ctx != NULL && ctx->ssl_imod) {
+        ctx->ssl_imod->libctx = NULL;
+        ctx->ssl_imod = NULL;
+    }
+
+    if (md != NULL && md->libctx) {
+        md->libctx->ssl_imod = NULL;
+        md->libctx = NULL;
+    }
+
+    return 1;
+}
+
 static void context_deinit_objs(OSSL_LIB_CTX *ctx);

 static int context_init(OSSL_LIB_CTX *ctx)
 {
     int exdata_done = 0;

-    if (!CRYPTO_THREAD_init_local(&ctx->rcu_local_key, NULL))
-        return 0;
-
     ctx->lock = CRYPTO_THREAD_lock_new();
     if (ctx->lock == NULL)
         goto err;
@@ -187,8 +211,7 @@ static int context_init(OSSL_LIB_CTX *ctx)
 #endif

 #ifdef FIPS_MODULE
-    ctx->thread_event_handler = ossl_thread_event_ctx_new(ctx);
-    if (ctx->thread_event_handler == NULL)
+    if (!ossl_thread_event_ctx_new(ctx))
         goto err;

     ctx->fips_prov = ossl_fips_prov_ossl_ctx_new(ctx);
@@ -226,19 +249,12 @@ err:
         ossl_crypto_cleanup_all_ex_data_int(ctx);

     CRYPTO_THREAD_lock_free(ctx->lock);
-    CRYPTO_THREAD_cleanup_local(&ctx->rcu_local_key);
     memset(ctx, '\0', sizeof(*ctx));
     return 0;
 }

 static void context_deinit_objs(OSSL_LIB_CTX *ctx)
 {
-    /* P2. We want evp_method_store to be cleaned up before the provider store */
-    if (ctx->evp_method_store != NULL) {
-        ossl_method_store_free(ctx->evp_method_store);
-        ctx->evp_method_store = NULL;
-    }
-
     /* P2. */
     if (ctx->drbg != NULL) {
         ossl_rand_ctx_free(ctx->drbg);
@@ -256,14 +272,14 @@ static void context_deinit_objs(OSSL_LIB_CTX *ctx)
      * P2. We want decoder_store/decoder_cache to be cleaned up before the
      * provider store
      */
-    if (ctx->decoder_store != NULL) {
-        ossl_method_store_free(ctx->decoder_store);
-        ctx->decoder_store = NULL;
-    }
     if (ctx->decoder_cache != NULL) {
         ossl_decoder_cache_free(ctx->decoder_cache);
         ctx->decoder_cache = NULL;
     }
+    if (ctx->decoder_store != NULL) {
+        ossl_method_store_free(ctx->decoder_store);
+        ctx->decoder_store = NULL;
+    }

     /* P2. We want encoder_store to be cleaned up before the provider store */
     if (ctx->encoder_store != NULL) {
@@ -284,6 +300,12 @@ static void context_deinit_objs(OSSL_LIB_CTX *ctx)
         ctx->provider_store = NULL;
     }

+    /* P2. We want evp_method_store to be cleaned up before the provider store */
+    if (ctx->evp_method_store != NULL) {
+        ossl_method_store_free(ctx->evp_method_store);
+        ctx->evp_method_store = NULL;
+    }
+
     /* Default priority. */
     if (ctx->property_string_data != NULL) {
         ossl_property_string_data_free(ctx->property_string_data);
@@ -330,10 +352,7 @@ static void context_deinit_objs(OSSL_LIB_CTX *ctx)
 #endif

 #ifdef FIPS_MODULE
-    if (ctx->thread_event_handler != NULL) {
-        ossl_thread_event_ctx_free(ctx->thread_event_handler);
-        ctx->thread_event_handler = NULL;
-    }
+    ossl_thread_event_ctx_free(ctx);

     if (ctx->fips_prov != NULL) {
         ossl_fips_prov_ossl_ctx_free(ctx->fips_prov);
@@ -369,6 +388,8 @@ static int context_deinit(OSSL_LIB_CTX *ctx)
     if (ctx == NULL)
         return 1;

+    ossl_lib_ctx_detach_ssl_conf_imodule(ctx, NULL);
+
     ossl_ctx_thread_stop(ctx);

     context_deinit_objs(ctx);
@@ -377,7 +398,6 @@ static int context_deinit(OSSL_LIB_CTX *ctx)

     CRYPTO_THREAD_lock_free(ctx->lock);
     ctx->lock = NULL;
-    CRYPTO_THREAD_cleanup_local(&ctx->rcu_local_key);
     return 1;
 }

@@ -386,24 +406,24 @@ static int context_deinit(OSSL_LIB_CTX *ctx)
 static OSSL_LIB_CTX default_context_int;

 static CRYPTO_ONCE default_context_init = CRYPTO_ONCE_STATIC_INIT;
+static CRYPTO_ONCE default_context_thread_key_init = CRYPTO_ONCE_STATIC_INIT;
 static CRYPTO_THREAD_LOCAL default_context_thread_local;
 static int default_context_inited = 0;

-DEFINE_RUN_ONCE_STATIC(default_context_do_init)
+DEFINE_RUN_ONCE_STATIC(default_context_do_thread_key_init)
 {
     if (!CRYPTO_THREAD_init_local(&default_context_thread_local, NULL))
-        goto err;
+        return 0;
+    return 1;
+}

+DEFINE_RUN_ONCE_STATIC(default_context_do_init)
+{
     if (!context_init(&default_context_int))
-        goto deinit_thread;
+        return 0;

     default_context_inited = 1;
     return 1;
-
-deinit_thread:
-    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
-err:
-    return 0;
 }

 void ossl_lib_ctx_default_deinit(void)
@@ -417,12 +437,23 @@ void ossl_lib_ctx_default_deinit(void)

 static OSSL_LIB_CTX *get_thread_default_context(void)
 {
+    if (!RUN_ONCE(&default_context_thread_key_init, default_context_do_thread_key_init))
+        return NULL;
+
     if (!RUN_ONCE(&default_context_init, default_context_do_init))
         return NULL;

     return CRYPTO_THREAD_get_local(&default_context_thread_local);
 }

+static OSSL_LIB_CTX *check_thread_default_context(void)
+{
+    if (!RUN_ONCE(&default_context_thread_key_init, default_context_do_thread_key_init))
+        return NULL;
+
+    return CRYPTO_THREAD_get_local(&default_context_thread_local);
+}
+
 static OSSL_LIB_CTX *get_default_context(void)
 {
     OSSL_LIB_CTX *current_defctx = get_thread_default_context();
@@ -432,6 +463,15 @@ static OSSL_LIB_CTX *get_default_context(void)
     return current_defctx;
 }

+static OSSL_LIB_CTX *check_default_context(void)
+{
+    OSSL_LIB_CTX *current_defctx = check_thread_default_context();
+
+    if (current_defctx == NULL && default_context_inited)
+        current_defctx = &default_context_int;
+    return current_defctx;
+}
+
 static int set_default_context(OSSL_LIB_CTX *defctx)
 {
     if (defctx == &default_context_int)
@@ -494,7 +534,7 @@ int OSSL_LIB_CTX_load_config(OSSL_LIB_CTX *ctx, const char *config_file)

 void OSSL_LIB_CTX_free(OSSL_LIB_CTX *ctx)
 {
-    if (ctx == NULL || ossl_lib_ctx_is_default(ctx))
+    if (ctx == NULL || ossl_lib_ctx_is_default_nocreate(ctx))
         return;

 #ifndef FIPS_MODULE
@@ -508,6 +548,9 @@ void OSSL_LIB_CTX_free(OSSL_LIB_CTX *ctx)
 #ifndef FIPS_MODULE
 OSSL_LIB_CTX *OSSL_LIB_CTX_get0_global_default(void)
 {
+    if (!RUN_ONCE(&default_context_thread_key_init, default_context_do_thread_key_init))
+        return NULL;
+
     if (!RUN_ONCE(&default_context_init, default_context_do_init))
         return NULL;

@@ -555,6 +598,15 @@ int ossl_lib_ctx_is_default(OSSL_LIB_CTX *ctx)
     return 0;
 }

+int ossl_lib_ctx_is_default_nocreate(OSSL_LIB_CTX *ctx)
+{
+#ifndef FIPS_MODULE
+    if (ctx == NULL || ctx == check_default_context())
+        return 1;
+#endif
+    return 0;
+}
+
 int ossl_lib_ctx_is_global_default(OSSL_LIB_CTX *ctx)
 {
 #ifndef FIPS_MODULE
@@ -613,9 +665,6 @@ void *ossl_lib_ctx_get_data(OSSL_LIB_CTX *ctx, int index)
 #endif

 #ifdef FIPS_MODULE
-    case OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX:
-        return ctx->thread_event_handler;
-
     case OSSL_LIB_CTX_FIPS_PROV_INDEX:
         return ctx->fips_prov;
 #endif
@@ -623,6 +672,9 @@ void *ossl_lib_ctx_get_data(OSSL_LIB_CTX *ctx, int index)
     case OSSL_LIB_CTX_COMP_METHODS:
         return (void *)&ctx->comp_methods;

+    case OSSL_LIB_CTX_SSL_CONF_IMODULE:
+        return (void *)ctx->ssl_imod;
+
     default:
         return NULL;
     }
@@ -654,14 +706,6 @@ const char *ossl_lib_ctx_get_descriptor(OSSL_LIB_CTX *libctx)
 #endif
 }

-CRYPTO_THREAD_LOCAL *ossl_lib_ctx_get_rcukey(OSSL_LIB_CTX *libctx)
-{
-    libctx = ossl_lib_ctx_get_concrete(libctx);
-    if (libctx == NULL)
-        return NULL;
-    return &libctx->rcu_local_key;
-}
-
 int OSSL_LIB_CTX_get_conf_diagnostics(OSSL_LIB_CTX *libctx)
 {
     libctx = ossl_lib_ctx_get_concrete(libctx);
diff --git a/deps/openssl/openssl/crypto/core_fetch.c b/deps/openssl/openssl/crypto/core_fetch.c
index 3293f70372d..2abd32255c9 100644
--- a/deps/openssl/openssl/crypto/core_fetch.c
+++ b/deps/openssl/openssl/crypto/core_fetch.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -107,7 +107,7 @@ static void ossl_method_construct_this(OSSL_PROVIDER *provider,
     struct construct_data_st *data = cbdata;
     void *method = NULL;

-    if ((method = data->mcm->construct(algo, provider, data->mcm_data))
+    if ((method = data->mcm->construct(algo, provider, data->mcm_data, no_store))
         == NULL)
         return;

diff --git a/deps/openssl/openssl/crypto/core_namemap.c b/deps/openssl/openssl/crypto/core_namemap.c
index 8e646c3bcc4..7ba228bdc09 100644
--- a/deps/openssl/openssl/crypto/core_namemap.c
+++ b/deps/openssl/openssl/crypto/core_namemap.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,11 +12,13 @@
 #include "internal/hashtable.h"
 #include "internal/sizes.h"
 #include "crypto/context.h"
+#include "crypto/evp.h"

 #define NAMEMAP_HT_BUCKETS 512

+#define NAMEMAP_NAME_LEN 64
 HT_START_KEY_DEFN(namenum_key)
-HT_DEF_KEY_FIELD_CHAR_ARRAY(name, 64)
+HT_DEF_KEY_FIELD_CHAR_ARRAY(name, NAMEMAP_NAME_LEN)
 HT_END_KEY_DEFN(NAMENUM_KEY)

 /*-
@@ -139,28 +141,9 @@ int ossl_namemap_doall_names(const OSSL_NAMEMAP *namemap, int number,

 int ossl_namemap_name2num(const OSSL_NAMEMAP *namemap, const char *name)
 {
-    int number = 0;
-    HT_VALUE *val;
-    NAMENUM_KEY key;
-
-#ifndef FIPS_MODULE
-    if (namemap == NULL)
-        namemap = ossl_namemap_stored(NULL);
-#endif
-
-    if (namemap == NULL)
+    if (name == NULL)
         return 0;
-
-    HT_INIT_KEY(&key);
-    HT_SET_KEY_STRING_CASE(&key, name, name);
-
-    val = ossl_ht_get(namemap->namenum_ht, TO_HT_KEY(&key));
-
-    if (val != NULL)
-        /* We store a (small) int directly instead of a pointer to it. */
-        number = (int)(intptr_t)val->value;
-
-    return number;
+    return ossl_namemap_name2num_n(namemap, name, strlen(name));
 }

 int ossl_namemap_name2num_n(const OSSL_NAMEMAP *namemap,
@@ -178,8 +161,11 @@ int ossl_namemap_name2num_n(const OSSL_NAMEMAP *namemap,
     if (namemap == NULL)
         return 0;

-    HT_INIT_KEY(&key);
-    HT_SET_KEY_STRING_CASE_N(&key, name, name, name_len);
+    if (name_len > NAMEMAP_NAME_LEN)
+        name_len = NAMEMAP_NAME_LEN;
+
+    HT_INIT_RAW_KEY(&key);
+    HT_COPY_RAW_KEY_CASE(TO_HT_KEY(&key), name, name_len);

     val = ossl_ht_get(namemap->namenum_ht, TO_HT_KEY(&key));

@@ -191,7 +177,7 @@ int ossl_namemap_name2num_n(const OSSL_NAMEMAP *namemap,
 }

 const char *ossl_namemap_num2name(const OSSL_NAMEMAP *namemap, int number,
-    size_t idx)
+    int idx)
 {
     NAMES *names;
     const char *ret = NULL;
@@ -270,15 +256,17 @@ static int namemap_add_name(OSSL_NAMEMAP *namemap, int number,
     /* Using tsan_store alone here is safe since we're under lock */
     tsan_store(&namemap->max_number, number);

-    HT_INIT_KEY(&key);
-    HT_SET_KEY_STRING_CASE(&key, name, name);
+    HT_INIT_RAW_KEY(&key);
+    HT_COPY_RAW_KEY_CASE(TO_HT_KEY(&key), name, strlen(name));
+
     val.value = (void *)(intptr_t)number;
     ret = ossl_ht_insert(namemap->namenum_ht, TO_HT_KEY(&key), &val, NULL);
-    if (!ossl_assert(ret != 0)) /* cannot happen as we are under write lock */
-        return 0;
-    if (ret < 1) {
-        /* unable to insert due to too many collisions */
-        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_NAMES);
+    if (ret <= 0) {
+        /*
+         * We either got an allocation failure (INTERNAL_ERROR), or
+         * hit too many conflicts in the table (TOO_MANY_NAMES)
+         */
+        ERR_raise(ERR_LIB_CRYPTO, (ret < 0) ? CRYPTO_R_TOO_MANY_NAMES : ERR_R_INTERNAL_ERROR);
         return 0;
     }
     return number;
@@ -429,16 +417,17 @@ static void get_legacy_md_names(const OBJ_NAME *on, void *arg)
     const EVP_MD *md = (void *)OBJ_NAME_get(on->name, on->type);

     if (md != NULL)
-        get_legacy_evp_names(0, EVP_MD_get_type(md), NULL, arg);
+        get_legacy_evp_names(NID_undef, EVP_MD_get_type(md), NULL, arg);
 }

+#ifndef OPENSSL_NO_DEPRECATED_3_6
 static void get_legacy_pkey_meth_names(const EVP_PKEY_ASN1_METHOD *ameth,
     void *arg)
 {
     int nid = 0, base_nid = 0, flags = 0;
     const char *pem_name = NULL;

-    EVP_PKEY_asn1_get0_info(&nid, &base_nid, &flags, NULL, &pem_name, ameth);
+    evp_pkey_asn1_get0_info(&nid, &base_nid, &flags, NULL, &pem_name, ameth);
     if (nid != NID_undef) {
         if ((flags & ASN1_PKEY_ALIAS) == 0) {
             switch (nid) {
@@ -470,6 +459,7 @@ static void get_legacy_pkey_meth_names(const EVP_PKEY_ASN1_METHOD *ameth,
         }
     }
 }
+#endif /* OPENSSL_NO_DEPRECATED_3_6 */
 #endif

 /*-
@@ -497,7 +487,7 @@ OSSL_NAMEMAP *ossl_namemap_stored(OSSL_LIB_CTX *libctx)
         return NULL;
     }
     if (nms == 1) {
-        int i, end;
+        int num;

         /* Before pilfering, we make sure the legacy database is populated */
         OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS
@@ -509,9 +499,26 @@ OSSL_NAMEMAP *ossl_namemap_stored(OSSL_LIB_CTX *libctx)
         OBJ_NAME_do_all(OBJ_NAME_TYPE_MD_METH,
             get_legacy_md_names, namemap);

-        /* We also pilfer data from the legacy EVP_PKEY_ASN1_METHODs */
-        for (i = 0, end = EVP_PKEY_asn1_get_count(); i < end; i++)
-            get_legacy_pkey_meth_names(EVP_PKEY_asn1_get0(i), namemap);
+        /*
+         * Some old providers (<= 3.5) may not have the rsassaPSS alias which
+         * may cause problems in some cases. We add it manually here
+         */
+        num = ossl_namemap_add_name(namemap, 0, "RSA-PSS");
+        if (num != 0) {
+            ossl_namemap_add_name(namemap, num, "rsassaPss");
+            /* Add other RSA-PSS aliases as well */
+            ossl_namemap_add_name(namemap, num, "RSASSA-PSS");
+            ossl_namemap_add_name(namemap, num, "1.2.840.113549.1.1.10");
+        }
+#ifndef OPENSSL_NO_DEPRECATED_3_6
+        {
+            int i, end;
+
+            /* We also pilfer data from the legacy EVP_PKEY_ASN1_METHODs */
+            for (i = 0, end = evp_pkey_asn1_get_count(); i < end; i++)
+                get_legacy_pkey_meth_names(evp_pkey_asn1_get0(i), namemap);
+        }
+#endif
     }
 #endif

@@ -521,7 +528,7 @@ OSSL_NAMEMAP *ossl_namemap_stored(OSSL_LIB_CTX *libctx)
 OSSL_NAMEMAP *ossl_namemap_new(OSSL_LIB_CTX *libctx)
 {
     OSSL_NAMEMAP *namemap;
-    HT_CONFIG htconf = { NULL, NULL, NULL, NAMEMAP_HT_BUCKETS, 1, 1 };
+    HT_CONFIG htconf = { NULL, NULL, NULL, NAMEMAP_HT_BUCKETS, 1, 1, 0 };

     htconf.ctx = libctx;

diff --git a/deps/openssl/openssl/crypto/cpt_err.c b/deps/openssl/openssl/crypto/cpt_err.c
deleted file mode 100644
index e102782978b..00000000000
--- a/deps/openssl/openssl/crypto/cpt_err.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/cryptoerr.h>
-#include "crypto/cryptoerr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA CRYPTO_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_BAD_ALGORITHM_NAME),
-        "bad algorithm name" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_CONFLICTING_NAMES),
-        "conflicting names" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_HEX_STRING_TOO_SHORT),
-        "hex string too short" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_ILLEGAL_HEX_DIGIT),
-        "illegal hex digit" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_INSUFFICIENT_DATA_SPACE),
-        "insufficient data space" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_INSUFFICIENT_PARAM_SIZE),
-        "insufficient param size" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_INSUFFICIENT_SECURE_DATA_SPACE),
-        "insufficient secure data space" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_INTEGER_OVERFLOW),
-        "integer overflow" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_INVALID_NEGATIVE_VALUE),
-        "invalid negative value" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_INVALID_NULL_ARGUMENT),
-        "invalid null argument" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_INVALID_OSSL_PARAM_TYPE),
-        "invalid ossl param type" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_NO_PARAMS_TO_MERGE),
-        "no params to merge" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_NO_SPACE_FOR_TERMINATING_NULL),
-        "no space for terminating null" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_ODD_NUMBER_OF_DIGITS),
-        "odd number of digits" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY),
-        "param cannot be represented exactly" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_PARAM_NOT_INTEGER_TYPE),
-        "param not integer type" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE),
-        "param of incompatible type" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED),
-        "param unsigned integer negative value unsupported" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT),
-        "param unsupported floating point format" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION),
-        "param value too large for destination" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_PROVIDER_ALREADY_EXISTS),
-        "provider already exists" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_PROVIDER_SECTION_ERROR),
-        "provider section error" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_RANDOM_SECTION_ERROR),
-        "random section error" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_SECURE_MALLOC_FAILURE),
-        "secure malloc failure" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_STRING_TOO_LONG), "string too long" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_TOO_MANY_BYTES), "too many bytes" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_TOO_MANY_NAMES), "too many names" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_TOO_MANY_RECORDS),
-        "too many records" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_TOO_SMALL_BUFFER),
-        "too small buffer" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_UNKNOWN_NAME_IN_RANDOM_SECTION),
-        "unknown name in random section" },
-    { ERR_PACK(ERR_LIB_CRYPTO, 0, CRYPTO_R_ZERO_LENGTH_NUMBER),
-        "zero length number" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_CRYPTO_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(CRYPTO_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(CRYPTO_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/cpuid.c b/deps/openssl/openssl/crypto/cpuid.c
index d659135919d..83a5e0b57bd 100644
--- a/deps/openssl/openssl/crypto/cpuid.c
+++ b/deps/openssl/openssl/crypto/cpuid.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1998-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -193,6 +193,10 @@ void OPENSSL_cpuid_setup(void)
  * not volatile, but compilers do this in practice anyway.
  *
  * There are also assembler versions of this function.
+ *
+ * This C version and the per-architecture assembler versions are all verified
+ * to be constant-time under enable-ct-validation for Valgrind-supported
+ * architectures, currently x86_64 and aarch64.
  */
 #undef CRYPTO_memcmp
 int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len)
diff --git a/deps/openssl/openssl/crypto/crmf/crmf_asn.c b/deps/openssl/openssl/crypto/crmf/crmf_asn.c
index 75ab71b1eb5..f3cedefc561 100644
--- a/deps/openssl/openssl/crypto/crmf/crmf_asn.c
+++ b/deps/openssl/openssl/crypto/crmf/crmf_asn.c
@@ -12,12 +12,8 @@
  */

 #include <openssl/asn1t.h>
-
 #include "crmf_local.h"

-/* explicit #includes not strictly needed since implied by the above: */
-#include <openssl/crmf.h>
-
 ASN1_SEQUENCE(OSSL_CRMF_PRIVATEKEYINFO) = {
     ASN1_SIMPLE(OSSL_CRMF_PRIVATEKEYINFO, version, ASN1_INTEGER),
     ASN1_SIMPLE(OSSL_CRMF_PRIVATEKEYINFO, privateKeyAlgorithm, X509_ALGOR),
diff --git a/deps/openssl/openssl/crypto/crmf/crmf_err.c b/deps/openssl/openssl/crypto/crmf/crmf_err.c
deleted file mode 100644
index 11e4271ec60..00000000000
--- a/deps/openssl/openssl/crypto/crmf/crmf_err.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/crmferr.h>
-#include "crypto/crmferr.h"
-
-#ifndef OPENSSL_NO_CRMF
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA CRMF_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_BAD_PBM_ITERATIONCOUNT),
-        "bad pbm iterationcount" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_CMS_NOT_SUPPORTED), "cms not supported" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_CRMFERROR), "crmferror" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_ERROR), "error" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_ERROR_DECODING_CERTIFICATE),
-        "error decoding certificate" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_ERROR_DECODING_ENCRYPTEDKEY),
-        "error decoding encryptedkey" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_ERROR_DECRYPTING_CERTIFICATE),
-        "error decrypting certificate" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_ERROR_DECRYPTING_ENCRYPTEDKEY),
-        "error decrypting encryptedkey" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_ERROR_DECRYPTING_ENCRYPTEDVALUE),
-        "error decrypting encryptedvalue" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_ERROR_DECRYPTING_SYMMETRIC_KEY),
-        "error decrypting symmetric key" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_ERROR_SETTING_PURPOSE),
-        "error setting purpose" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_ERROR_VERIFYING_ENCRYPTEDKEY),
-        "error verifying encryptedkey" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_FAILURE_OBTAINING_RANDOM),
-        "failure obtaining random" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_ITERATIONCOUNT_BELOW_100),
-        "iterationcount below 100" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_MALFORMED_IV), "malformed iv" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_NULL_ARGUMENT), "null argument" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_POPOSKINPUT_NOT_SUPPORTED),
-        "poposkinput not supported" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_POPO_INCONSISTENT_CENTRAL_KEYGEN),
-        "popo inconsistent central keygen" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY),
-        "popo inconsistent public key" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_POPO_MISSING), "popo missing" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_POPO_MISSING_PUBLIC_KEY),
-        "popo missing public key" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_POPO_MISSING_SUBJECT),
-        "popo missing subject" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED),
-        "popo raverified not accepted" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_SETTING_MAC_ALGOR_FAILURE),
-        "setting mac algor failure" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_SETTING_OWF_ALGOR_FAILURE),
-        "setting owf algor failure" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_UNSUPPORTED_ALGORITHM),
-        "unsupported algorithm" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_UNSUPPORTED_CIPHER),
-        "unsupported cipher" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_UNSUPPORTED_METHOD_FOR_CREATING_POPO),
-        "unsupported method for creating popo" },
-    { ERR_PACK(ERR_LIB_CRMF, 0, CRMF_R_UNSUPPORTED_POPO_METHOD),
-        "unsupported popo method" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_CRMF_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(CRMF_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(CRMF_str_reasons);
-#endif
-    return 1;
-}
-#else
-NON_EMPTY_TRANSLATION_UNIT
-#endif
diff --git a/deps/openssl/openssl/crypto/crmf/crmf_lib.c b/deps/openssl/openssl/crypto/crmf/crmf_lib.c
index aba92f24c05..5747ab18569 100644
--- a/deps/openssl/openssl/crypto/crmf/crmf_lib.c
+++ b/deps/openssl/openssl/crypto/crmf/crmf_lib.c
@@ -26,19 +26,11 @@
  * cases increases its link count) in the parent and so both should be freed up.
  */

-#include <openssl/asn1t.h>
-
 #include "crmf_local.h"
+#include <openssl/asn1t.h>
 #include "internal/constant_time.h"
-#include "internal/sizes.h"
-#include "crypto/evp.h"
-#include "crypto/x509.h"
-
-/* explicit #includes not strictly needed since implied by the above: */
-#include <openssl/crmf.h>
-#include <openssl/err.h>
-#include <openssl/evp.h>
-#include <openssl/cms.h>
+#include "internal/sizes.h" /* for OSSL_MAX_NAME_SIZE */
+#include "crypto/x509.h" /* for ossl_x509_check_private_key() */

 /*-
  * atyp = Attribute Type
@@ -386,10 +378,14 @@ static int create_popo_signature(OSSL_CRMF_POPOSIGNINGKEY *ps,
         && strcmp(name, "UNDEF") == 0) /* at least for Ed25519, Ed448 */
         digest = NULL;

-    return ASN1_item_sign_ex(ASN1_ITEM_rptr(OSSL_CRMF_CERTREQUEST),
-        ps->algorithmIdentifier, /* sets this X509_ALGOR */
-        NULL, ps->signature, /* sets the ASN1_BIT_STRING */
-        cr, NULL, pkey, digest, libctx, propq);
+    if (ASN1_item_sign_ex(ASN1_ITEM_rptr(OSSL_CRMF_CERTREQUEST),
+            ps->algorithmIdentifier, /* sets this X509_ALGOR */
+            NULL, ps->signature, /* sets the ASN1_BIT_STRING */
+            cr, NULL, pkey, digest, libctx, propq)
+        != 0)
+        return 1;
+    ERR_raise(ERR_LIB_CRMF, CRMF_R_ERROR_SIGNING_POPO);
+    return 0;
 }

 int OSSL_CRMF_MSG_create_popo(int meth, OSSL_CRMF_MSG *crm,
@@ -541,13 +537,13 @@ int OSSL_CRMF_MSGS_verify_popo(const OSSL_CRMF_MSGS *reqs,
     return 1;
 }

-int OSSL_CRMF_MSG_centralkeygen_requested(const OSSL_CRMF_MSG *crm, const X509_REQ *p10cr)
+int OSSL_CRMF_MSG_centralkeygen_requested(const OSSL_CRMF_MSG *crm, const X509_REQ *p10)
 {
     X509_PUBKEY *pubkey = NULL;
     const unsigned char *pk = NULL;
     int pklen, ret = 0;

-    if (crm == NULL && p10cr == NULL) {
+    if (crm == NULL && p10 == NULL) {
         ERR_raise(ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT);
         return -1;
     }
@@ -555,7 +551,7 @@ int OSSL_CRMF_MSG_centralkeygen_requested(const OSSL_CRMF_MSG *crm, const X509_R
     if (crm != NULL)
         pubkey = OSSL_CRMF_CERTTEMPLATE_get0_publicKey(OSSL_CRMF_MSG_get0_tmpl(crm));
     else
-        pubkey = p10cr->req_info.pubkey;
+        pubkey = p10->req_info.pubkey;

     if (pubkey == NULL
         || (X509_PUBKEY_get0_param(NULL, &pk, &pklen, NULL, pubkey)
@@ -785,16 +781,11 @@ unsigned char *OSSL_CRMF_ENCRYPTEDVALUE_decrypt(const OSSL_CRMF_ENCRYPTEDVALUE *

     /* select symmetric cipher based on algorithm given in message */
     OBJ_obj2txt(name, sizeof(name), enc->symmAlg->algorithm, 0);
-    (void)ERR_set_mark();
     cipher = EVP_CIPHER_fetch(libctx, name, propq);
-    if (cipher == NULL)
-        cipher = (EVP_CIPHER *)EVP_get_cipherbyobj(enc->symmAlg->algorithm);
     if (cipher == NULL) {
-        (void)ERR_clear_last_mark();
         ERR_raise(ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_CIPHER);
         goto end;
     }
-    (void)ERR_pop_to_mark();

     cikeysize = EVP_CIPHER_get_key_length(cipher);
     /* first the symmetric key needs to be decrypted */
@@ -859,7 +850,7 @@ end:
     return NULL;
 }

-/*
+/*-
  * Decrypts the certificate in the given encryptedValue using private key pkey.
  * This is needed for the indirect PoP method as in RFC 9810 section 5.2.8.3.2.
  *
@@ -889,6 +880,7 @@ end:
     OPENSSL_free(buf);
     return cert;
 }
+
 /*-
  * Decrypts the certificate in the given encryptedKey using private key pkey.
  * This is needed for the indirect PoP method as in RFC 9810 section 5.2.8.3.2.
diff --git a/deps/openssl/openssl/crypto/crmf/crmf_local.h b/deps/openssl/openssl/crypto/crmf/crmf_local.h
index 44ea4b4843e..17bf9891169 100644
--- a/deps/openssl/openssl/crypto/crmf/crmf_local.h
+++ b/deps/openssl/openssl/crypto/crmf/crmf_local.h
@@ -14,16 +14,7 @@
 #ifndef OSSL_CRYPTO_CRMF_LOCAL_H
 #define OSSL_CRYPTO_CRMF_LOCAL_H

-#include <openssl/crmf.h>
-#include <openssl/cms.h> /* for CMS_EnvelopedData and CMS_SignedData */
-#include <openssl/err.h>
-#include "internal/crmf.h" /* for ossl_crmf_attributetypeandvalue_st */
-
-/* explicit #includes not strictly needed since implied by the above: */
-#include <openssl/types.h>
-#include <openssl/safestack.h>
-#include <openssl/x509.h>
-#include <openssl/x509v3.h>
+#include "internal/crmf.h"

 /*-
  * EncryptedValue ::= SEQUENCE {
diff --git a/deps/openssl/openssl/crypto/crmf/crmf_pbm.c b/deps/openssl/openssl/crypto/crmf/crmf_pbm.c
index 58199fc0d29..2825a6773a6 100644
--- a/deps/openssl/openssl/crypto/crmf/crmf_pbm.c
+++ b/deps/openssl/openssl/crypto/crmf/crmf_pbm.c
@@ -1,5 +1,5 @@
 /*-
- * Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright Nokia 2007-2019
  * Copyright Siemens AG 2015-2019
  *
@@ -11,22 +11,12 @@
  * CRMF implementation by Martin Peylo, Miikka Viljanen, and David von Oheimb.
  */

-#include <string.h>
-
-#include <openssl/rand.h>
-#include <openssl/evp.h>
-#include <openssl/hmac.h>
-
-/* explicit #includes not strictly needed since implied by the above: */
-#include <openssl/asn1t.h>
-#include <openssl/crmf.h>
+#include "crmf_local.h"
+#include <openssl/rand.h> /* for RAND_bytes_ex() */
+#include "internal/sizes.h" /* for OSSL_MAX_NAME_SIZE */
 #include <openssl/err.h>
-#include <openssl/params.h>
-#include <openssl/core_names.h>

-#include "internal/sizes.h"
-
-#include "crmf_local.h"
+#include <crypto/asn1.h>

 /*-
  * creates and initializes OSSL_CRMF_PBMPARAMETER (section 4.4)
@@ -89,7 +79,7 @@ OSSL_CRMF_PBMPARAMETER *OSSL_CRMF_pbmp_new(OSSL_LIB_CTX *libctx, size_t slen,
         goto err;
     }

-    if (!ASN1_INTEGER_set(pbm->iterationCount, itercnt)) {
+    if (!ASN1_INTEGER_set(pbm->iterationCount, (long)itercnt)) {
         ERR_raise(ERR_LIB_CRMF, CRMF_R_CRMFERROR);
         goto err;
     }
diff --git a/deps/openssl/openssl/crypto/cryptlib.c b/deps/openssl/openssl/crypto/cryptlib.c
index 54a1ff3688c..229552f85c9 100644
--- a/deps/openssl/openssl/crypto/cryptlib.c
+++ b/deps/openssl/openssl/crypto/cryptlib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1998-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -15,13 +15,6 @@
 #if defined(_WIN32) && !defined(OPENSSL_SYS_UEFI)
 #include <tchar.h>
 #include <signal.h>
-#ifdef __WATCOMC__
-#if defined(_UNICODE) || defined(__UNICODE__)
-#define _vsntprintf _vsnwprintf
-#else
-#define _vsntprintf _vsnprintf
-#endif
-#endif
 #ifdef _MSC_VER
 #define alloca _alloca
 #endif
@@ -60,7 +53,7 @@ int OPENSSL_isservice(void)
     }

     if (_OPENSSL_isservice.p != (void *)-1)
-        return (*_OPENSSL_isservice.f)();
+        return (int)((*_OPENSSL_isservice.f)());

     h = GetProcessWindowStation();
     if (h == NULL)
@@ -110,8 +103,6 @@ void OPENSSL_showfatal(const char *fmta, ...)
     /*
      * First check if it's a console application, in which case the
      * error message would be printed to standard error.
-     * Windows CE does not have a concept of a console application,
-     * so we need to guard the check.
      */
 #ifdef STD_ERROR_HANDLE
     HANDLE h;
@@ -142,7 +133,7 @@ void OPENSSL_showfatal(const char *fmta, ...)
                 fmt = (const TCHAR *)L"no stack?";
                 break;
             }
-            if (!MultiByteToWideChar(CP_ACP, 0, fmta, len_0, fmtw, len_0))
+            if (!MultiByteToWideChar(CP_ACP, 0, fmta, (int)len_0, fmtw, (int)len_0))
                 for (i = 0; i < len_0; i++)
                     fmtw[i] = (WCHAR)fmta[i];
             for (i = 0; i < len_0; i++) {
@@ -260,9 +251,7 @@ void OPENSSL_die(const char *message, const char *file, int line)
     /*
      * Win32 abort() customarily shows a dialog, but we just did that...
      */
-#if !defined(_WIN32_WCE)
     raise(SIGABRT);
-#endif
     _exit(3);
 #endif
 }
diff --git a/deps/openssl/openssl/crypto/ct/ct_b64.c b/deps/openssl/openssl/crypto/ct/ct_b64.c
index 01bd8fc508d..b2a91b9426a 100644
--- a/deps/openssl/openssl/crypto/ct/ct_b64.c
+++ b/deps/openssl/openssl/crypto/ct/ct_b64.c
@@ -27,17 +27,17 @@ static int ct_base64_decode(const char *in, unsigned char **out)
     int outlen, i;
     unsigned char *outbuf = NULL;

-    if (inlen == 0) {
+    if (inlen == 0 || inlen > INT_MAX) {
         *out = NULL;
         return 0;
     }

-    outlen = (inlen / 4) * 3;
+    outlen = (int)((inlen / 4) * 3);
     outbuf = OPENSSL_malloc(outlen);
     if (outbuf == NULL)
         goto err;

-    outlen = EVP_DecodeBlock(outbuf, (unsigned char *)in, inlen);
+    outlen = EVP_DecodeBlock(outbuf, (unsigned char *)in, (int)inlen);
     if (outlen < 0) {
         ERR_raise(ERR_LIB_CT, CT_R_BASE64_DECODE_ERROR);
         goto err;
diff --git a/deps/openssl/openssl/crypto/ct/ct_err.c b/deps/openssl/openssl/crypto/ct/ct_err.c
deleted file mode 100644
index 21d9061b9b0..00000000000
--- a/deps/openssl/openssl/crypto/ct/ct_err.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/cterr.h>
-#include "crypto/cterr.h"
-
-#ifndef OPENSSL_NO_CT
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA CT_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_BASE64_DECODE_ERROR), "base64 decode error" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_INVALID_LOG_ID_LENGTH),
-        "invalid log id length" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_LOG_CONF_INVALID), "log conf invalid" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_LOG_CONF_INVALID_KEY),
-        "log conf invalid key" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_LOG_CONF_MISSING_DESCRIPTION),
-        "log conf missing description" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_LOG_CONF_MISSING_KEY),
-        "log conf missing key" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_LOG_KEY_INVALID), "log key invalid" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_SCT_FUTURE_TIMESTAMP),
-        "sct future timestamp" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_SCT_INVALID), "sct invalid" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_SCT_INVALID_SIGNATURE),
-        "sct invalid signature" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_SCT_LIST_INVALID), "sct list invalid" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_SCT_LOG_ID_MISMATCH), "sct log id mismatch" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_SCT_NOT_SET), "sct not set" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_SCT_UNSUPPORTED_VERSION),
-        "sct unsupported version" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_UNRECOGNIZED_SIGNATURE_NID),
-        "unrecognized signature nid" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_UNSUPPORTED_ENTRY_TYPE),
-        "unsupported entry type" },
-    { ERR_PACK(ERR_LIB_CT, 0, CT_R_UNSUPPORTED_VERSION), "unsupported version" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_CT_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(CT_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(CT_str_reasons);
-#endif
-    return 1;
-}
-#else
-NON_EMPTY_TRANSLATION_UNIT
-#endif
diff --git a/deps/openssl/openssl/crypto/ct/ct_local.h b/deps/openssl/openssl/crypto/ct/ct_local.h
index d2f6c48cbde..771d63dcdae 100644
--- a/deps/openssl/openssl/crypto/ct/ct_local.h
+++ b/deps/openssl/openssl/crypto/ct/ct_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_CT_CT_LOCAL_H)
+#define OSSL_LIBCRYPTO_CT_CT_LOCAL_H
+
 #include <stddef.h>
 #include <openssl/ct.h>
 #include <openssl/evp.h>
@@ -14,6 +17,8 @@
 #include <openssl/x509v3.h>
 #include <openssl/safestack.h>

+#include "internal/common.h"
+
 /*
  * From RFC6962: opaque SerializedSCT<1..2^16-1>; struct { SerializedSCT
  * sct_list <1..2^16-1>; } SignedCertificateTimestampList;
@@ -21,39 +26,6 @@
 #define MAX_SCT_SIZE 65535
 #define MAX_SCT_LIST_SIZE MAX_SCT_SIZE

-/*
- * Macros to read and write integers in network-byte order.
- */
-
-#define n2s(c, s) ((s = (((unsigned int)((c)[0])) << 8) | (((unsigned int)((c)[1])))), c += 2)
-
-#define s2n(s, c) ((c[0] = (unsigned char)(((s) >> 8) & 0xff), \
-                       c[1] = (unsigned char)(((s)) & 0xff)),  \
-    c += 2)
-
-#define l2n3(l, c) ((c[0] = (unsigned char)(((l) >> 16) & 0xff),   \
-                        c[1] = (unsigned char)(((l) >> 8) & 0xff), \
-                        c[2] = (unsigned char)(((l)) & 0xff)),     \
-    c += 3)
-
-#define n2l8(c, l) (l = ((uint64_t)(*((c)++))) << 56, \
-    l |= ((uint64_t)(*((c)++))) << 48,                \
-    l |= ((uint64_t)(*((c)++))) << 40,                \
-    l |= ((uint64_t)(*((c)++))) << 32,                \
-    l |= ((uint64_t)(*((c)++))) << 24,                \
-    l |= ((uint64_t)(*((c)++))) << 16,                \
-    l |= ((uint64_t)(*((c)++))) << 8,                 \
-    l |= ((uint64_t)(*((c)++))))
-
-#define l2n8(l, c) (*((c)++) = (unsigned char)(((l) >> 56) & 0xff), \
-    *((c)++) = (unsigned char)(((l) >> 48) & 0xff),                 \
-    *((c)++) = (unsigned char)(((l) >> 40) & 0xff),                 \
-    *((c)++) = (unsigned char)(((l) >> 32) & 0xff),                 \
-    *((c)++) = (unsigned char)(((l) >> 24) & 0xff),                 \
-    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                 \
-    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                  \
-    *((c)++) = (unsigned char)(((l)) & 0xff))
-
 /* Signed Certificate Timestamp */
 struct sct_st {
     sct_version_t version;
@@ -145,7 +117,7 @@ __owur int SCT_CTX_set1_cert(SCT_CTX *sctx, X509 *cert, X509 *presigner);
  * Issuer must not be NULL.
  * Returns 1 on success, 0 on failure.
  */
-__owur int SCT_CTX_set1_issuer(SCT_CTX *sctx, const X509 *issuer);
+__owur int SCT_CTX_set1_issuer(SCT_CTX *sctx, X509 *issuer);

 /*
  * Sets the public key of the issuer of the certificate that the SCT was created
@@ -153,14 +125,13 @@ __owur int SCT_CTX_set1_issuer(SCT_CTX *sctx, const X509 *issuer);
  * The public key must not be NULL.
  * Returns 1 on success, 0 on failure.
  */
-__owur int SCT_CTX_set1_issuer_pubkey(SCT_CTX *sctx, X509_PUBKEY *pubkey);
+__owur int SCT_CTX_set1_issuer_pubkey(SCT_CTX *sctx, const X509_PUBKEY *pubkey);

 /*
  * Sets the public key of the CT log that the SCT is from.
  * Returns 1 on success, 0 on failure.
  */
 __owur int SCT_CTX_set1_pubkey(SCT_CTX *sctx, X509_PUBKEY *pubkey);
-
 /*
  * Sets the time to evaluate the SCT against, in milliseconds since the Unix
  * epoch. If the SCT's timestamp is after this time, it will be interpreted as
@@ -216,3 +187,5 @@ __owur int o2i_SCT_signature(SCT *sct, const unsigned char **in, size_t len);
  * Handlers for Certificate Transparency X509v3/OCSP extensions
  */
 extern const X509V3_EXT_METHOD ossl_v3_ct_scts[3];
+
+#endif /* !defined(OSSL_LIBCRYPTO_CT_CT_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/ct/ct_log.c b/deps/openssl/openssl/crypto/ct/ct_log.c
index b9990dc9a08..53e0a2c791e 100644
--- a/deps/openssl/openssl/crypto/ct/ct_log.c
+++ b/deps/openssl/openssl/crypto/ct/ct_log.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -236,7 +236,8 @@ int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file)
         goto end;
     }

-    if (!CONF_parse_list(enabled_logs, ',', 1, ctlog_store_load_log, load_ctx) || load_ctx->invalid_log_entries > 0) {
+    if (CONF_parse_list(enabled_logs, ',', 1, ctlog_store_load_log, load_ctx) <= 0
+        || load_ctx->invalid_log_entries > 0) {
         ERR_raise(ERR_LIB_CT, CT_R_LOG_CONF_INVALID);
         goto end;
     }
@@ -315,6 +316,20 @@ EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log)
     return log->public_key;
 }

+int CTLOG_STORE_add0_log(CTLOG_STORE *store, CTLOG *log)
+{
+    if (store == NULL || log == NULL) {
+        ERR_raise(ERR_LIB_CT, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+
+    if (!sk_CTLOG_push(store->logs, log)) {
+        ERR_raise(ERR_LIB_CT, ERR_R_CRYPTO_LIB);
+        return 0;
+    }
+    return 1;
+}
+
 /*
  * Given a log ID, finds the matching log.
  * Returns NULL if no match found.
diff --git a/deps/openssl/openssl/crypto/ct/ct_oct.c b/deps/openssl/openssl/crypto/ct/ct_oct.c
index 03885f4dd54..3f1666baa1e 100644
--- a/deps/openssl/openssl/crypto/ct/ct_oct.c
+++ b/deps/openssl/openssl/crypto/ct/ct_oct.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -64,7 +64,7 @@ int o2i_SCT_signature(SCT *sct, const unsigned char **in, size_t len)
     len_remaining -= siglen;
     *in = p + siglen;

-    return len - len_remaining;
+    return (int)(len - len_remaining);
 }

 SCT *o2i_SCT(SCT **psct, const unsigned char **in, size_t len)
@@ -189,7 +189,7 @@ int i2o_SCT_signature(const SCT *sct, unsigned char **out)
         memcpy(p, sct->sig, sct->sig_len);
     }

-    return len;
+    return (int)len;
 err:
     OPENSSL_free(pstart);
     return -1;
@@ -215,8 +215,10 @@ int i2o_SCT(const SCT *sct, unsigned char **out)
     else
         len = sct->sct_len;

+    if (len > INT_MAX)
+        return -1;
     if (out == NULL)
-        return len;
+        return (int)len;

     if (*out != NULL) {
         p = *out;
@@ -244,7 +246,7 @@ int i2o_SCT(const SCT *sct, unsigned char **out)
         memcpy(p, sct->sct, len);
     }

-    return len;
+    return (int)len;
 err:
     OPENSSL_free(pstart);
     return -1;
@@ -345,7 +347,7 @@ int i2o_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp)
             if ((sct_len = i2o_SCT(sk_SCT_value(a, i), NULL)) == -1)
                 goto err;
         }
-        len2 += 2 + sct_len;
+        len2 += (size_t)sct_len + 2;
     }

     if (len2 > MAX_SCT_LIST_SIZE)
@@ -357,7 +359,7 @@ int i2o_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp)
         if (!is_pp_new)
             *pp += len2;
     }
-    return len2;
+    return (int)len2;

 err:
     if (is_pp_new) {
@@ -378,8 +380,8 @@ STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp,
     if (d2i_ASN1_OCTET_STRING(&oct, &p, len) == NULL)
         return NULL;

-    p = oct->data;
-    if ((sk = o2i_SCT_LIST(a, &p, oct->length)) != NULL)
+    p = ASN1_STRING_get0_data(oct);
+    if ((sk = o2i_SCT_LIST(a, &p, ASN1_STRING_get_length(oct))) != NULL)
         *pp += len;

     ASN1_OCTET_STRING_free(oct);
@@ -388,14 +390,20 @@ STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp,

 int i2d_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **out)
 {
-    ASN1_OCTET_STRING oct;
+    ASN1_OCTET_STRING *oct;
+    unsigned char *data = NULL;
     int len;

-    oct.data = NULL;
-    if ((oct.length = i2o_SCT_LIST(a, &oct.data)) == -1)
+    if ((len = i2o_SCT_LIST(a, &data)) == -1)
         return -1;

-    len = i2d_ASN1_OCTET_STRING(&oct, out);
-    OPENSSL_free(oct.data);
+    oct = ASN1_OCTET_STRING_new();
+    if (oct == NULL) {
+        OPENSSL_free(data);
+        return -1;
+    }
+    ASN1_STRING_set0(oct, data, len);
+    len = i2d_ASN1_OCTET_STRING(oct, out);
+    ASN1_OCTET_STRING_free(oct);
     return len;
 }
diff --git a/deps/openssl/openssl/crypto/ct/ct_prn.c b/deps/openssl/openssl/crypto/ct/ct_prn.c
index fabd9d213fd..cdca666cfe0 100644
--- a/deps/openssl/openssl/crypto/ct/ct_prn.c
+++ b/deps/openssl/openssl/crypto/ct/ct_prn.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,8 @@
 #error "CT is disabled"
 #endif

+#include <stdio.h>
+
 #include <openssl/asn1.h>
 #include <openssl/bio.h>

@@ -40,7 +42,7 @@ static void timestamp_print(uint64_t timestamp, BIO *out)
      * Note GeneralizedTime from ASN1_GENERALIZETIME_adj is always 15
      * characters long with a final Z. Update it with fractional seconds.
      */
-    BIO_snprintf(genstr, sizeof(genstr), "%.14s.%03dZ",
+    snprintf(genstr, sizeof(genstr), "%.14s.%03dZ",
         ASN1_STRING_get0_data(gen), (unsigned int)(timestamp % 1000));
     if (ASN1_GENERALIZEDTIME_set_string(gen, genstr))
         ASN1_GENERALIZEDTIME_print(out, gen);
@@ -82,7 +84,7 @@ void SCT_print(const SCT *sct, BIO *out, int indent,

     if (sct->version != SCT_VERSION_V1) {
         BIO_printf(out, "unknown\n%*s", indent + 16, "");
-        BIO_hex_string(out, indent + 16, 16, sct->sct, sct->sct_len);
+        BIO_hex_string(out, indent + 16, 16, sct->sct, (int)sct->sct_len);
         return;
     }

@@ -94,7 +96,7 @@ void SCT_print(const SCT *sct, BIO *out, int indent,
     }

     BIO_printf(out, "\n%*sLog ID    : ", indent + 4, "");
-    BIO_hex_string(out, indent + 16, 16, sct->log_id, sct->log_id_len);
+    BIO_hex_string(out, indent + 16, 16, sct->log_id, (int)sct->log_id_len);

     BIO_printf(out, "\n%*sTimestamp : ", indent + 4, "");
     timestamp_print(sct->timestamp, out);
@@ -103,12 +105,12 @@ void SCT_print(const SCT *sct, BIO *out, int indent,
     if (sct->ext_len == 0)
         BIO_printf(out, "none");
     else
-        BIO_hex_string(out, indent + 16, 16, sct->ext, sct->ext_len);
+        BIO_hex_string(out, indent + 16, 16, sct->ext, (int)sct->ext_len);

     BIO_printf(out, "\n%*sSignature : ", indent + 4, "");
     SCT_signature_algorithms_print(sct, out);
     BIO_printf(out, "\n%*s            ", indent + 4, "");
-    BIO_hex_string(out, indent + 16, 16, sct->sig, sct->sig_len);
+    BIO_hex_string(out, indent + 16, 16, sct->sig, (int)sct->sig_len);
 }

 void SCT_LIST_print(const STACK_OF(SCT) *sct_list, BIO *out, int indent,
diff --git a/deps/openssl/openssl/crypto/ct/ct_sct_ctx.c b/deps/openssl/openssl/crypto/ct/ct_sct_ctx.c
index af5be04eff4..80603b617f8 100644
--- a/deps/openssl/openssl/crypto/ct/ct_sct_ctx.c
+++ b/deps/openssl/openssl/crypto/ct/ct_sct_ctx.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -74,11 +74,15 @@ static int ct_x509_get_ext(X509 *cert, int nid, int *is_duplicated)
  */
 __owur static int ct_x509_cert_fixup(X509 *cert, X509 *presigner)
 {
+    int ret = 0;
     int preidx, certidx;
     int pre_akid_ext_is_dup, cert_akid_ext_is_dup;
+    X509_EXTENSION *new = NULL;

-    if (presigner == NULL)
-        return 1;
+    if (presigner == NULL) {
+        ret = 1;
+        goto done;
+    }

     preidx = ct_x509_get_ext(presigner, NID_authority_key_identifier,
         &pre_akid_ext_is_dup);
@@ -87,32 +91,41 @@ __owur static int ct_x509_cert_fixup(X509 *cert, X509 *presigner)

     /* An error occurred whilst searching for the extension */
     if (preidx < -1 || certidx < -1)
-        return 0;
+        goto done;
     /* Invalid certificate if they contain duplicate extensions */
     if (pre_akid_ext_is_dup || cert_akid_ext_is_dup)
-        return 0;
+        goto done;
     /* AKID must be present in both certificate or absent in both */
     if (preidx >= 0 && certidx == -1)
-        return 0;
+        goto done;
     if (preidx == -1 && certidx >= 0)
-        return 0;
+        goto done;
     /* Copy issuer name */
     if (!X509_set_issuer_name(cert, X509_get_issuer_name(presigner)))
-        return 0;
+        goto done;
     if (preidx != -1) {
         /* Retrieve and copy AKID encoding */
-        X509_EXTENSION *preext = X509_get_ext(presigner, preidx);
-        X509_EXTENSION *certext = X509_get_ext(cert, certidx);
-        ASN1_OCTET_STRING *preextdata;
+        const X509_EXTENSION *preext = X509_get_ext(presigner, preidx);
+        const X509_EXTENSION *certext = X509_get_ext(cert, certidx);
+        const ASN1_OCTET_STRING *preextdata;

         /* Should never happen */
         if (preext == NULL || certext == NULL)
-            return 0;
+            goto done;
+        if ((new = X509_EXTENSION_dup(certext)) == NULL)
+            goto done;
         preextdata = X509_EXTENSION_get_data(preext);
-        if (preextdata == NULL || !X509_EXTENSION_set_data(certext, preextdata))
-            return 0;
+        if (preextdata == NULL || !X509_EXTENSION_set_data(new, preextdata))
+            goto done;
+        X509_EXTENSION_free(X509_delete_ext(cert, certidx));
+        certext = NULL;
+        if (!X509_add_ext(cert, new, certidx))
+            goto done;
+        ret = 1;
     }
-    return 1;
+done:
+    X509_EXTENSION_free(new);
+    return ret;
 }

 int SCT_CTX_set1_cert(SCT_CTX *sctx, X509 *cert, X509 *presigner)
@@ -197,7 +210,7 @@ err:
     return 0;
 }

-__owur static int ct_public_key_hash(SCT_CTX *sctx, X509_PUBKEY *pkey,
+__owur static int ct_public_key_hash(SCT_CTX *sctx, const X509_PUBKEY *pkey,
     unsigned char **hash, size_t *hash_len)
 {
     int ret = 0;
@@ -241,12 +254,12 @@ err:
     return ret;
 }

-int SCT_CTX_set1_issuer(SCT_CTX *sctx, const X509 *issuer)
+int SCT_CTX_set1_issuer(SCT_CTX *sctx, X509 *issuer)
 {
     return SCT_CTX_set1_issuer_pubkey(sctx, X509_get_X509_PUBKEY(issuer));
 }

-int SCT_CTX_set1_issuer_pubkey(SCT_CTX *sctx, X509_PUBKEY *pubkey)
+int SCT_CTX_set1_issuer_pubkey(SCT_CTX *sctx, const X509_PUBKEY *pubkey)
 {
     return ct_public_key_hash(sctx, pubkey, &sctx->ihash, &sctx->ihashlen);
 }
diff --git a/deps/openssl/openssl/crypto/cversion.c b/deps/openssl/openssl/crypto/cversion.c
index 1a922961df7..380a35a8efd 100644
--- a/deps/openssl/openssl/crypto/cversion.c
+++ b/deps/openssl/openssl/crypto/cversion.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -52,9 +52,6 @@ extern char ossl_cpu_info_str[];
 /* size: MAX_PATH + sizeof("OPENSSLDIR: \"\"") */
 static char openssldir[MAX_PATH + 15];

-/* size: MAX_PATH + sizeof("ENGINESDIR: \"\"") */
-static char enginesdir[MAX_PATH + 15];
-
 /* size: MAX_PATH + sizeof("MODULESDIR: \"\"") */
 static char modulesdir[MAX_PATH + 15];

@@ -62,11 +59,9 @@ static CRYPTO_ONCE version_strings_once = CRYPTO_ONCE_STATIC_INIT;

 DEFINE_RUN_ONCE_STATIC(version_strings_setup)
 {
-    BIO_snprintf(openssldir, sizeof(openssldir), "OPENSSLDIR: \"%s\"",
+    snprintf(openssldir, sizeof(openssldir), "OPENSSLDIR: \"%s\"",
         ossl_get_openssldir());
-    BIO_snprintf(enginesdir, sizeof(enginesdir), "ENGINESDIR: \"%s\"",
-        ossl_get_enginesdir());
-    BIO_snprintf(modulesdir, sizeof(modulesdir), "MODULESDIR: \"%s\"",
+    snprintf(modulesdir, sizeof(modulesdir), "MODULESDIR: \"%s\"",
         ossl_get_modulesdir());
     return 1;
 }
@@ -99,8 +94,6 @@ const char *OpenSSL_version(int t)
 #if defined(_WIN32) && defined(OSSL_WINCTX)
     case OPENSSL_DIR:
         return openssldir;
-    case OPENSSL_ENGINES_DIR:
-        return enginesdir;
     case OPENSSL_MODULES_DIR:
         return modulesdir;
 #else
@@ -109,12 +102,6 @@ const char *OpenSSL_version(int t)
         return "OPENSSLDIR: \"" OPENSSLDIR "\"";
 #else
         return "OPENSSLDIR: N/A";
-#endif
-    case OPENSSL_ENGINES_DIR:
-#ifdef ENGINESDIR
-        return "ENGINESDIR: \"" ENGINESDIR "\"";
-#else
-        return "ENGINESDIR: N/A";
 #endif
     case OPENSSL_MODULES_DIR:
 #ifdef MODULESDIR
@@ -134,6 +121,8 @@ const char *OpenSSL_version(int t)
 #else
         return "OSSL_WINCTX: Undefined";
 #endif
+    case OPENSSL_ENGINES_DIR:
+        return "ENGINESDIR: N/A";
     }
     return "not available";
 }
diff --git a/deps/openssl/openssl/crypto/defaults.c b/deps/openssl/openssl/crypto/defaults.c
index 17d8ffdd7cd..f55f79a82ee 100644
--- a/deps/openssl/openssl/crypto/defaults.c
+++ b/deps/openssl/openssl/crypto/defaults.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -33,17 +33,6 @@ static char openssldir[MAX_PATH + 1];
  */
 static char *openssldirptr = NULL;

-/**
- * @brief The directory where OpenSSL engines are located.
- */
-
-static char enginesdir[MAX_PATH + 1];
-
-/**
- * @brief The pointer to the enginesdir buffer
- */
-static char *enginesdirptr = NULL;
-
 /**
  * @brief The directory where OpenSSL modules are located.
  */
@@ -72,8 +61,12 @@ static char *get_windows_regdirs(char *dst, DWORD dstsizebytes, LPCWSTR valuenam
     DWORD index = 0;
     LPCWSTR tempstr = NULL;

-    ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-        TEXT(REGISTRY_KEY), KEY_WOW64_32KEY,
+    /*
+     * Narrow call: TEXT(REGISTRY_KEY) would widen only the first literal of the
+     * concatenation, which MSVC 12.0 rejects.  The subkey path is ASCII.
+     */
+    ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
+        REGISTRY_KEY, KEY_WOW64_32KEY,
         KEY_QUERY_VALUE, &hkey);
     if (ret != ERROR_SUCCESS)
         goto out;
@@ -124,7 +117,6 @@ static CRYPTO_ONCE defaults_setup_init = CRYPTO_ONCE_STATIC_INIT;
 DEFINE_RUN_ONCE_STATIC(do_defaults_setup)
 {
     get_windows_regdirs(openssldir, sizeof(openssldir), L"OPENSSLDIR");
-    get_windows_regdirs(enginesdir, sizeof(enginesdir), L"ENGINESDIR");
     get_windows_regdirs(modulesdir, sizeof(modulesdir), L"MODULESDIR");

     /*
@@ -133,9 +125,6 @@ DEFINE_RUN_ONCE_STATIC(do_defaults_setup)
     if (strlen(openssldir) > 0)
         openssldirptr = openssldir;

-    if (strlen(enginesdir) > 0)
-        enginesdirptr = enginesdir;
-
     if (strlen(modulesdir) > 0)
         modulesdirptr = modulesdir;

@@ -159,22 +148,6 @@ const char *ossl_get_openssldir(void)
 #endif
 }

-/**
- * @brief Get the directory where OpenSSL engines are located.
- *
- * @return A pointer to a string containing the engines directory path.
- */
-const char *ossl_get_enginesdir(void)
-{
-#if defined(_WIN32) && defined(OSSL_WINCTX)
-    if (!RUN_ONCE(&defaults_setup_init, do_defaults_setup))
-        return NULL;
-    return (const char *)enginesdirptr;
-#else
-    return ENGINESDIR;
-#endif
-}
-
 /**
  * @brief Get the directory where OpenSSL modules are located.
  *
diff --git a/deps/openssl/openssl/crypto/des/asm/dest4-sparcv9.pl b/deps/openssl/openssl/crypto/des/asm/dest4-sparcv9.pl
index afa15860f0a..3928d586654 100644
--- a/deps/openssl/openssl/crypto/des/asm/dest4-sparcv9.pl
+++ b/deps/openssl/openssl/crypto/des/asm/dest4-sparcv9.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2013-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2013-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -40,7 +40,7 @@ $code.=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #ifdef	__arch64__
 .register       %g2,#scratch
diff --git a/deps/openssl/openssl/crypto/des/des_local.h b/deps/openssl/openssl/crypto/des/des_local.h
index 8d08aca7e61..c175227e3f5 100644
--- a/deps/openssl/openssl/crypto/des/des_local.h
+++ b/deps/openssl/openssl/crypto/des/des_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -18,6 +18,8 @@

 #include <openssl/des.h>

+#include "internal/common.h"
+
 #ifdef OPENSSL_BUILD_SHLIBCRYPTO
 #undef OPENSSL_EXTERN
 #define OPENSSL_EXTERN OPENSSL_EXPORT
@@ -26,84 +28,11 @@
 #define ITERATIONS 16
 #define HALF_ITERATIONS 8

-#define c2l(c, l) (l = ((DES_LONG)(*((c)++))), \
-    l |= ((DES_LONG)(*((c)++))) << 8L,         \
-    l |= ((DES_LONG)(*((c)++))) << 16L,        \
-    l |= ((DES_LONG)(*((c)++))) << 24L)
-
-/* NOTE - c is not incremented as per c2l */
-#define c2ln(c, l1, l2, n)                       \
-    {                                            \
-        c += n;                                  \
-        l1 = l2 = 0;                             \
-        switch (n) {                             \
-        case 8:                                  \
-            l2 = ((DES_LONG)(*(--(c)))) << 24L;  \
-        /* fall through */                       \
-        case 7:                                  \
-            l2 |= ((DES_LONG)(*(--(c)))) << 16L; \
-        /* fall through */                       \
-        case 6:                                  \
-            l2 |= ((DES_LONG)(*(--(c)))) << 8L;  \
-        /* fall through */                       \
-        case 5:                                  \
-            l2 |= ((DES_LONG)(*(--(c))));        \
-        /* fall through */                       \
-        case 4:                                  \
-            l1 = ((DES_LONG)(*(--(c)))) << 24L;  \
-        /* fall through */                       \
-        case 3:                                  \
-            l1 |= ((DES_LONG)(*(--(c)))) << 16L; \
-        /* fall through */                       \
-        case 2:                                  \
-            l1 |= ((DES_LONG)(*(--(c)))) << 8L;  \
-        /* fall through */                       \
-        case 1:                                  \
-            l1 |= ((DES_LONG)(*(--(c))));        \
-        }                                        \
-    }
-
-#define l2c(l, c) (*((c)++) = (unsigned char)(((l)) & 0xff), \
-    *((c)++) = (unsigned char)(((l) >> 8L) & 0xff),          \
-    *((c)++) = (unsigned char)(((l) >> 16L) & 0xff),         \
-    *((c)++) = (unsigned char)(((l) >> 24L) & 0xff))
-
-/* NOTE - c is not incremented as per l2c */
-#define l2cn(l1, l2, c, n)                                    \
-    {                                                         \
-        c += n;                                               \
-        switch (n) {                                          \
-        case 8:                                               \
-            *(--(c)) = (unsigned char)(((l2) >> 24L) & 0xff); \
-        /* fall through */                                    \
-        case 7:                                               \
-            *(--(c)) = (unsigned char)(((l2) >> 16L) & 0xff); \
-        /* fall through */                                    \
-        case 6:                                               \
-            *(--(c)) = (unsigned char)(((l2) >> 8L) & 0xff);  \
-        /* fall through */                                    \
-        case 5:                                               \
-            *(--(c)) = (unsigned char)(((l2)) & 0xff);        \
-        /* fall through */                                    \
-        case 4:                                               \
-            *(--(c)) = (unsigned char)(((l1) >> 24L) & 0xff); \
-        /* fall through */                                    \
-        case 3:                                               \
-            *(--(c)) = (unsigned char)(((l1) >> 16L) & 0xff); \
-        /* fall through */                                    \
-        case 2:                                               \
-            *(--(c)) = (unsigned char)(((l1) >> 8L) & 0xff);  \
-        /* fall through */                                    \
-        case 1:                                               \
-            *(--(c)) = (unsigned char)(((l1)) & 0xff);        \
-        }                                                     \
-    }
-
 #if defined(_MSC_VER)
 #define ROTATE(a, n) (_lrotr(a, n))
 #elif defined(__ICC)
 #define ROTATE(a, n) (_rotr(a, n))
-#elif defined(__GNUC__) && __GNUC__ >= 2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC)
+#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC)
 #if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
 #define ROTATE(a, n) ({        \
     register unsigned int ret; \
diff --git a/deps/openssl/openssl/crypto/des/spr.h b/deps/openssl/openssl/crypto/des/spr.h
index 955fbc2989d..2274f95f35c 100644
--- a/deps/openssl/openssl/crypto/des/spr.h
+++ b/deps/openssl/openssl/crypto/des/spr.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,11 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_DES_SPR_H)
+#define OSSL_LIBCRYPTO_DES_SPR_H
+
+#include <openssl/des.h>
+
 const DES_LONG DES_SPtrans[8][64] = {
     {
         /* nibble 0 */
@@ -545,3 +550,5 @@ const DES_LONG DES_SPtrans[8][64] = {
         0x00820080L,
     }
 };
+
+#endif /* !defined(OSSL_LIBCRYPTO_DES_SPR_H) */
diff --git a/deps/openssl/openssl/crypto/des/str2key.c b/deps/openssl/openssl/crypto/des/str2key.c
index f6687fe524f..412fd5cfb82 100644
--- a/deps/openssl/openssl/crypto/des/str2key.c
+++ b/deps/openssl/openssl/crypto/des/str2key.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,11 +19,14 @@
 void DES_string_to_key(const char *str, DES_cblock *key)
 {
     DES_key_schedule ks;
-    int i, length;
+    int i;
+    size_t length;

     memset(key, 0, 8);
     length = strlen(str);
-    for (i = 0; i < length; i++) {
+    if (length > INT_MAX)
+        length = INT_MAX;
+    for (i = 0; i < (int)length; i++) {
         register unsigned char j = str[i];

         if ((i % 16) < 8)
@@ -38,7 +41,7 @@ void DES_string_to_key(const char *str, DES_cblock *key)
     }
     DES_set_odd_parity(key);
     DES_set_key_unchecked(key, &ks);
-    DES_cbc_cksum((const unsigned char *)str, key, length, &ks, key);
+    DES_cbc_cksum((const unsigned char *)str, key, (int)length, &ks, key);
     OPENSSL_cleanse(&ks, sizeof(ks));
     DES_set_odd_parity(key);
 }
@@ -46,12 +49,15 @@ void DES_string_to_key(const char *str, DES_cblock *key)
 void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2)
 {
     DES_key_schedule ks;
-    int i, length;
+    int i;
+    size_t length;

     memset(key1, 0, 8);
     memset(key2, 0, 8);
     length = strlen(str);
-    for (i = 0; i < length; i++) {
+    if (length > INT_MAX)
+        length = INT_MAX;
+    for (i = 0; i < (int)length; i++) {
         register unsigned char j = str[i];

         if ((i % 32) < 16) {
@@ -74,9 +80,9 @@ void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2)
     DES_set_odd_parity(key1);
     DES_set_odd_parity(key2);
     DES_set_key_unchecked(key1, &ks);
-    DES_cbc_cksum((const unsigned char *)str, key1, length, &ks, key1);
+    DES_cbc_cksum((const unsigned char *)str, key1, (int)length, &ks, key1);
     DES_set_key_unchecked(key2, &ks);
-    DES_cbc_cksum((const unsigned char *)str, key2, length, &ks, key2);
+    DES_cbc_cksum((const unsigned char *)str, key2, (int)length, &ks, key2);
     OPENSSL_cleanse(&ks, sizeof(ks));
     DES_set_odd_parity(key1);
     DES_set_odd_parity(key2);
diff --git a/deps/openssl/openssl/crypto/deterministic_nonce.c b/deps/openssl/openssl/crypto/deterministic_nonce.c
index 5b3adbcfabf..afd319795e0 100644
--- a/deps/openssl/openssl/crypto/deterministic_nonce.c
+++ b/deps/openssl/openssl/crypto/deterministic_nonce.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -28,7 +28,7 @@
 static int bits2int(BIGNUM *out, int qlen_bits,
     const unsigned char *in, size_t inlen)
 {
-    int blen_bits = inlen * 8;
+    int blen_bits = (int)(inlen * 8);
     int shift;

     if (BN_bin2bn(in, (int)inlen, out) == NULL)
@@ -55,7 +55,7 @@ static int bits2int(BIGNUM *out, int qlen_bits,
 static int bits2int_consttime(BIGNUM *out, int qlen_bits,
     const unsigned char *in, size_t inlen)
 {
-    int blen_bits = (inlen - sizeof(BN_ULONG)) * 8;
+    int blen_bits = (int)((inlen - sizeof(BN_ULONG)) * 8);
     int shift;

     if (BN_bin2bn(in, (int)inlen, out) == NULL)
diff --git a/deps/openssl/openssl/crypto/dh/build.info b/deps/openssl/openssl/crypto/dh/build.info
index b4135672718..52f4de5fe77 100644
--- a/deps/openssl/openssl/crypto/dh/build.info
+++ b/deps/openssl/openssl/crypto/dh/build.info
@@ -5,7 +5,7 @@ $COMMON=dh_lib.c dh_key.c dh_group_params.c dh_check.c dh_backend.c dh_gen.c \

 SOURCE[../../libcrypto]=$COMMON\
         dh_asn1.c dh_err.c \
-        dh_ameth.c dh_pmeth.c dh_prn.c dh_rfc5114.c dh_meth.c
+        dh_ameth.c dh_prn.c dh_rfc5114.c dh_meth.c
 IF[{- !$disabled{'deprecated-0.9.8'} -}]
   SOURCE[../../libcrypto]=dh_depr.c
 ENDIF
diff --git a/deps/openssl/openssl/crypto/dh/dh_ameth.c b/deps/openssl/openssl/crypto/dh/dh_ameth.c
index af839de4f5a..44cae47f256 100644
--- a/deps/openssl/openssl/crypto/dh/dh_ameth.c
+++ b/deps/openssl/openssl/crypto/dh/dh_ameth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -411,7 +411,7 @@ static int dh_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
         dh = (DH *)EVP_PKEY_get0_DH(pkey);
         if (dh == NULL)
             return 0;
-        return ossl_dh_key2buf(dh, arg2, 0, 1);
+        return (int)ossl_dh_key2buf(dh, arg2, 0, 1);
     default:
         return -2;
     }
diff --git a/deps/openssl/openssl/crypto/dh/dh_asn1.c b/deps/openssl/openssl/crypto/dh/dh_asn1.c
index 10bcdd2253f..29d987d3c28 100644
--- a/deps/openssl/openssl/crypto/dh/dh_asn1.c
+++ b/deps/openssl/openssl/crypto/dh/dh_asn1.c
@@ -21,6 +21,8 @@
 #include <openssl/asn1t.h>
 #include "crypto/dh.h"

+#include <crypto/asn1.h>
+
 /* Override the default free and new methods */
 static int dh_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
     void *exarg)
@@ -116,7 +118,7 @@ DH *d2i_DHxparams(DH **a, const unsigned char **pp, long length)

     if (dhx->vparams != NULL) {
         /* The counter has a maximum value of 4 * numbits(p) - 1 */
-        size_t counter = (size_t)BN_get_word(dhx->vparams->counter);
+        int counter = (int)BN_get_word(dhx->vparams->counter);
         ossl_ffc_params_set_validate_params(params, dhx->vparams->seed->data,
             dhx->vparams->seed->length,
             counter);
diff --git a/deps/openssl/openssl/crypto/dh/dh_backend.c b/deps/openssl/openssl/crypto/dh/dh_backend.c
index 77b0b3257fb..bb3824a4a01 100644
--- a/deps/openssl/openssl/crypto/dh/dh_backend.c
+++ b/deps/openssl/openssl/crypto/dh/dh_backend.c
@@ -22,10 +22,12 @@
 #include "crypto/dh.h"
 #include "dh_local.h"

+#include <crypto/asn1.h>
+
 /*
  * The intention with the "backend" source file is to offer backend functions
- * for legacy backends (EVP_PKEY_ASN1_METHOD and EVP_PKEY_METHOD) and provider
- * implementations alike.
+ * for legacy backends (EVP_PKEY_ASN1_METHOD) and provider implementations
+ * alike.
  */

 static int dh_ffc_params_fromdata(DH *dh, const OSSL_PARAM params[])
@@ -87,20 +89,21 @@ err:
     return 0;
 }

-int ossl_dh_params_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[])
+int ossl_dh_params_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM *privlen,
+    const FFC_OSSL_PARAMS *pp)
 {
-    long l = DH_get_length(dh);
+    const long l = DH_get_length(dh);

-    if (!ossl_ffc_params_todata(ossl_dh_get0_params(dh), bld, params))
+    if (!ossl_ffc_params_todata(ossl_dh_get0_params(dh), bld, pp))
         return 0;
     if (l > 0
-        && !ossl_param_build_set_long(bld, params, OSSL_PKEY_PARAM_DH_PRIV_LEN, l))
+        && !ossl_param_build_set_long(bld, privlen, OSSL_PKEY_PARAM_DH_PRIV_LEN, l))
         return 0;
     return 1;
 }

-int ossl_dh_key_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[],
-    int include_private)
+int ossl_dh_key_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM *pubkey,
+    OSSL_PARAM *privkey, int include_private)
 {
     const BIGNUM *priv = NULL, *pub = NULL;

@@ -110,10 +113,10 @@ int ossl_dh_key_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[],
     DH_get0_key(dh, &pub, &priv);
     if (priv != NULL
         && include_private
-        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PRIV_KEY, priv))
+        && !ossl_param_build_set_bn(bld, privkey, OSSL_PKEY_PARAM_PRIV_KEY, priv))
         return 0;
     if (pub != NULL
-        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PUB_KEY, pub))
+        && !ossl_param_build_set_bn(bld, pubkey, OSSL_PKEY_PARAM_PUB_KEY, pub))
         return 0;

     return 1;
@@ -122,7 +125,7 @@ int ossl_dh_key_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[],
 int ossl_dh_is_foreign(const DH *dh)
 {
 #ifndef FIPS_MODULE
-    if (dh->engine != NULL || ossl_dh_get_method(dh) != DH_OpenSSL())
+    if (ossl_dh_get_method(dh) != DH_OpenSSL())
         return 1;
 #endif
     return 0;
diff --git a/deps/openssl/openssl/crypto/dh/dh_err.c b/deps/openssl/openssl/crypto/dh/dh_err.c
deleted file mode 100644
index 63c6d98a3b3..00000000000
--- a/deps/openssl/openssl/crypto/dh/dh_err.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/dherr.h>
-#include "crypto/dherr.h"
-
-#ifndef OPENSSL_NO_DH
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA DH_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_BAD_FFC_PARAMETERS), "bad ffc parameters" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_BAD_GENERATOR), "bad generator" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_BN_DECODE_ERROR), "bn decode error" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_BN_ERROR), "bn error" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_CHECK_INVALID_J_VALUE),
-        "check invalid j value" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_CHECK_INVALID_Q_VALUE),
-        "check invalid q value" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_CHECK_PUBKEY_INVALID),
-        "check pubkey invalid" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_CHECK_PUBKEY_TOO_LARGE),
-        "check pubkey too large" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_CHECK_PUBKEY_TOO_SMALL),
-        "check pubkey too small" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_CHECK_P_NOT_PRIME), "check p not prime" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_CHECK_P_NOT_SAFE_PRIME),
-        "check p not safe prime" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_CHECK_Q_NOT_PRIME), "check q not prime" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_DECODE_ERROR), "decode error" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_INVALID_PARAMETER_NAME),
-        "invalid parameter name" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_INVALID_PARAMETER_NID),
-        "invalid parameter nid" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_INVALID_PUBKEY), "invalid public key" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_INVALID_SECRET), "invalid secret" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_INVALID_SIZE), "invalid size" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_KDF_PARAMETER_ERROR), "kdf parameter error" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_KEYS_NOT_SET), "keys not set" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_MISSING_PUBKEY), "missing pubkey" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_MODULUS_TOO_LARGE), "modulus too large" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_MODULUS_TOO_SMALL), "modulus too small" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_NOT_SUITABLE_GENERATOR),
-        "not suitable generator" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_NO_PARAMETERS_SET), "no parameters set" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_NO_PRIVATE_VALUE), "no private value" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_PARAMETER_ENCODING_ERROR),
-        "parameter encoding error" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_PEER_KEY_ERROR), "peer key error" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_Q_TOO_LARGE), "q too large" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_SHARED_INFO_ERROR), "shared info error" },
-    { ERR_PACK(ERR_LIB_DH, 0, DH_R_UNABLE_TO_CHECK_GENERATOR),
-        "unable to check generator" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_DH_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(DH_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(DH_str_reasons);
-#endif
-    return 1;
-}
-#else
-NON_EMPTY_TRANSLATION_UNIT
-#endif
diff --git a/deps/openssl/openssl/crypto/dh/dh_key.c b/deps/openssl/openssl/crypto/dh/dh_key.c
index 2d9f7a8100f..d996f3f81e1 100644
--- a/deps/openssl/openssl/crypto/dh/dh_key.c
+++ b/deps/openssl/openssl/crypto/dh/dh_key.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -114,7 +114,7 @@ err:
 int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
 {
     int ret = 0, i;
-    volatile size_t npad = 0, mask = 1;
+    volatile int npad = 0, mask = 1;

     /* compute the key; ret is constant unless compute_key is external */
 #ifdef FIPS_MODULE
@@ -207,6 +207,7 @@ static int dh_init(DH *dh)
 static int dh_finish(DH *dh)
 {
     BN_MONT_CTX_free(dh->method_mont_p);
+    dh->method_mont_p = NULL;
     return 1;
 }

@@ -393,7 +394,7 @@ int ossl_dh_buf2key(DH *dh, const unsigned char *buf, size_t len)
     const BIGNUM *p;
     int ret;

-    if ((pubkey = BN_bin2bn(buf, len, NULL)) == NULL)
+    if (len > INT_MAX || (pubkey = BN_bin2bn(buf, (int)len, NULL)) == NULL)
         goto err;
     DH_get0_pqg(dh, &p, NULL, NULL);
     if (p == NULL || BN_num_bytes(p) == 0) {
diff --git a/deps/openssl/openssl/crypto/dh/dh_lib.c b/deps/openssl/openssl/crypto/dh/dh_lib.c
index 94026e50ce7..1934c710807 100644
--- a/deps/openssl/openssl/crypto/dh/dh_lib.c
+++ b/deps/openssl/openssl/crypto/dh/dh_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,18 +15,16 @@

 #include <stdio.h>
 #include <openssl/bn.h>
-#ifndef FIPS_MODULE
-#include <openssl/engine.h>
-#endif
 #include <openssl/obj_mac.h>
 #include <openssl/core_names.h>
 #include "internal/cryptlib.h"
 #include "internal/refcount.h"
+#include "internal/common.h"
 #include "crypto/evp.h"
 #include "crypto/dh.h"
 #include "dh_local.h"

-static DH *dh_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx);
+static DH *dh_new_intern(OSSL_LIB_CTX *libctx);

 #ifndef FIPS_MODULE
 int DH_set_method(DH *dh, const DH_METHOD *meth)
@@ -39,10 +37,6 @@ int DH_set_method(DH *dh, const DH_METHOD *meth)
     mtmp = dh->meth;
     if (mtmp->finish)
         mtmp->finish(dh);
-#ifndef OPENSSL_NO_ENGINE
-    ENGINE_finish(dh->engine);
-    dh->engine = NULL;
-#endif
     dh->meth = meth;
     if (meth->init)
         meth->init(dh);
@@ -56,22 +50,24 @@ const DH_METHOD *ossl_dh_get_method(const DH *dh)
 #ifndef OPENSSL_NO_DEPRECATED_3_0
 DH *DH_new(void)
 {
-    return dh_new_intern(NULL, NULL);
+    return dh_new_intern(NULL);
 }
 #endif

 DH *DH_new_method(ENGINE *engine)
 {
-    return dh_new_intern(engine, NULL);
+    if (!ossl_assert(engine == NULL))
+        return NULL;
+    return dh_new_intern(NULL);
 }
 #endif /* !FIPS_MODULE */

 DH *ossl_dh_new_ex(OSSL_LIB_CTX *libctx)
 {
-    return dh_new_intern(NULL, libctx);
+    return dh_new_intern(libctx);
 }

-static DH *dh_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx)
+static DH *dh_new_intern(OSSL_LIB_CTX *libctx)
 {
     DH *ret = OPENSSL_zalloc(sizeof(*ret));

@@ -93,25 +89,6 @@ static DH *dh_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx)

     ret->libctx = libctx;
     ret->meth = DH_get_default_method();
-#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
-    ret->flags = ret->meth->flags; /* early default init */
-    if (engine) {
-        if (!ENGINE_init(engine)) {
-            ERR_raise(ERR_LIB_DH, ERR_R_ENGINE_LIB);
-            goto err;
-        }
-        ret->engine = engine;
-    } else
-        ret->engine = ENGINE_get_default_DH();
-    if (ret->engine) {
-        ret->meth = ENGINE_get_DH(ret->engine);
-        if (ret->meth == NULL) {
-            ERR_raise(ERR_LIB_DH, ERR_R_ENGINE_LIB);
-            goto err;
-        }
-    }
-#endif
-
     ret->flags = ret->meth->flags;

 #ifndef FIPS_MODULE
@@ -149,9 +126,6 @@ void DH_free(DH *r)
     if (r->meth != NULL && r->meth->finish != NULL)
         r->meth->finish(r);
 #if !defined(FIPS_MODULE)
-#if !defined(OPENSSL_NO_ENGINE)
-    ENGINE_finish(r->engine);
-#endif
     CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data);
 #endif

@@ -168,7 +142,7 @@ int DH_up_ref(DH *r)
 {
     int i;

-    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&r->references, &i))
         return 0;

     REF_PRINT_COUNT("DH", i, r);
@@ -176,6 +150,11 @@ int DH_up_ref(DH *r)
     return ((i > 1) ? 1 : 0);
 }

+OSSL_LIB_CTX *ossl_dh_get0_libctx(const DH *dh)
+{
+    return dh->libctx;
+}
+
 void ossl_dh_set0_libctx(DH *d, OSSL_LIB_CTX *libctx)
 {
     d->libctx = libctx;
@@ -319,13 +298,6 @@ void DH_set_flags(DH *dh, int flags)
     dh->flags |= flags;
 }

-#ifndef FIPS_MODULE
-ENGINE *DH_get0_engine(DH *dh)
-{
-    return dh->engine;
-}
-#endif /*FIPS_MODULE */
-
 FFC_PARAMS *ossl_dh_get0_params(DH *dh)
 {
     return &dh->params;
diff --git a/deps/openssl/openssl/crypto/dh/dh_local.h b/deps/openssl/openssl/crypto/dh/dh_local.h
index ed4e0f1e9a4..da5e549ca09 100644
--- a/deps/openssl/openssl/crypto/dh/dh_local.h
+++ b/deps/openssl/openssl/crypto/dh/dh_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_DH_DH_LOCAL_H)
+#define OSSL_LIBCRYPTO_DH_DH_LOCAL_H
+
 #include <openssl/dh.h>
 #include "internal/refcount.h"
 #include "internal/ffc.h"
@@ -30,7 +33,6 @@ struct dh_st {
     CRYPTO_REF_COUNT references;
 #ifndef FIPS_MODULE
     CRYPTO_EX_DATA ex_data;
-    ENGINE *engine;
 #endif
     OSSL_LIB_CTX *libctx;
     const DH_METHOD *meth;
@@ -58,3 +60,5 @@ struct dh_method {
     int (*generate_params)(DH *dh, int prime_len, int generator,
         BN_GENCB *cb);
 };
+
+#endif /* !defined(OSSL_LIBCRYPTO_DH_DH_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/dh/dh_pmeth.c b/deps/openssl/openssl/crypto/dh/dh_pmeth.c
deleted file mode 100644
index dd36dce2818..00000000000
--- a/deps/openssl/openssl/crypto/dh/dh_pmeth.c
+++ /dev/null
@@ -1,535 +0,0 @@
-/*
- * Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * DH & DSA low level APIs are deprecated for public use, but still ok for
- * internal use.
- */
-#include "internal/deprecated.h"
-
-#include <stdio.h>
-#include "internal/cryptlib.h"
-#include <openssl/asn1t.h>
-#include <openssl/x509.h>
-#include <openssl/evp.h>
-#include "dh_local.h"
-#include <openssl/bn.h>
-#include <openssl/dsa.h>
-#include <openssl/objects.h>
-#include "crypto/evp.h"
-
-/* DH pkey context structure */
-
-typedef struct {
-    /* Parameter gen parameters */
-    int prime_len;
-    int generator;
-    int paramgen_type;
-    int subprime_len;
-    int pad;
-    /* message digest used for parameter generation */
-    const EVP_MD *md;
-    int param_nid;
-    /* Keygen callback info */
-    int gentmp[2];
-    /* KDF (if any) to use for DH */
-    char kdf_type;
-    /* OID to use for KDF */
-    ASN1_OBJECT *kdf_oid;
-    /* Message digest to use for key derivation */
-    const EVP_MD *kdf_md;
-    /* User key material */
-    unsigned char *kdf_ukm;
-    size_t kdf_ukmlen;
-    /* KDF output length */
-    size_t kdf_outlen;
-} DH_PKEY_CTX;
-
-static int pkey_dh_init(EVP_PKEY_CTX *ctx)
-{
-    DH_PKEY_CTX *dctx;
-
-    if ((dctx = OPENSSL_zalloc(sizeof(*dctx))) == NULL)
-        return 0;
-    dctx->prime_len = 2048;
-    dctx->subprime_len = -1;
-    dctx->generator = 2;
-    dctx->kdf_type = EVP_PKEY_DH_KDF_NONE;
-
-    ctx->data = dctx;
-    ctx->keygen_info = dctx->gentmp;
-    ctx->keygen_info_count = 2;
-
-    return 1;
-}
-
-static void pkey_dh_cleanup(EVP_PKEY_CTX *ctx)
-{
-    DH_PKEY_CTX *dctx = ctx->data;
-
-    if (dctx != NULL) {
-        OPENSSL_free(dctx->kdf_ukm);
-        ASN1_OBJECT_free(dctx->kdf_oid);
-        OPENSSL_free(dctx);
-    }
-}
-
-static int pkey_dh_copy(EVP_PKEY_CTX *dst, const EVP_PKEY_CTX *src)
-{
-    DH_PKEY_CTX *dctx, *sctx;
-
-    if (!pkey_dh_init(dst))
-        return 0;
-    sctx = src->data;
-    dctx = dst->data;
-    dctx->prime_len = sctx->prime_len;
-    dctx->subprime_len = sctx->subprime_len;
-    dctx->generator = sctx->generator;
-    dctx->paramgen_type = sctx->paramgen_type;
-    dctx->pad = sctx->pad;
-    dctx->md = sctx->md;
-    dctx->param_nid = sctx->param_nid;
-
-    dctx->kdf_type = sctx->kdf_type;
-    dctx->kdf_oid = OBJ_dup(sctx->kdf_oid);
-    if (dctx->kdf_oid == NULL)
-        return 0;
-    dctx->kdf_md = sctx->kdf_md;
-    if (sctx->kdf_ukm != NULL) {
-        dctx->kdf_ukm = OPENSSL_memdup(sctx->kdf_ukm, sctx->kdf_ukmlen);
-        if (dctx->kdf_ukm == NULL)
-            return 0;
-        dctx->kdf_ukmlen = sctx->kdf_ukmlen;
-    }
-    dctx->kdf_outlen = sctx->kdf_outlen;
-    return 1;
-}
-
-static int pkey_dh_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
-{
-    DH_PKEY_CTX *dctx = ctx->data;
-    switch (type) {
-    case EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN:
-        if (p1 < 256)
-            return -2;
-        dctx->prime_len = p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN:
-        if (dctx->paramgen_type == DH_PARAMGEN_TYPE_GENERATOR)
-            return -2;
-        dctx->subprime_len = p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_DH_PAD:
-        dctx->pad = p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR:
-        if (dctx->paramgen_type != DH_PARAMGEN_TYPE_GENERATOR)
-            return -2;
-        dctx->generator = p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_DH_PARAMGEN_TYPE:
-#ifdef OPENSSL_NO_DSA
-        if (p1 != DH_PARAMGEN_TYPE_GENERATOR)
-            return -2;
-#else
-        if (p1 < 0 || p1 > 2)
-            return -2;
-#endif
-        dctx->paramgen_type = p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_DH_RFC5114:
-        if (p1 < 1 || p1 > 3 || dctx->param_nid != NID_undef)
-            return -2;
-        dctx->param_nid = p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_DH_NID:
-        if (p1 <= 0 || dctx->param_nid != NID_undef)
-            return -2;
-        dctx->param_nid = p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_PEER_KEY:
-        /* Default behaviour is OK */
-        return 1;
-
-    case EVP_PKEY_CTRL_DH_KDF_TYPE:
-        if (p1 == -2)
-            return dctx->kdf_type;
-        if (p1 != EVP_PKEY_DH_KDF_NONE && p1 != EVP_PKEY_DH_KDF_X9_42)
-            return -2;
-        dctx->kdf_type = p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_DH_KDF_MD:
-        dctx->kdf_md = p2;
-        return 1;
-
-    case EVP_PKEY_CTRL_GET_DH_KDF_MD:
-        *(const EVP_MD **)p2 = dctx->kdf_md;
-        return 1;
-
-    case EVP_PKEY_CTRL_DH_KDF_OUTLEN:
-        if (p1 <= 0)
-            return -2;
-        dctx->kdf_outlen = (size_t)p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN:
-        *(int *)p2 = dctx->kdf_outlen;
-        return 1;
-
-    case EVP_PKEY_CTRL_DH_KDF_UKM:
-        OPENSSL_free(dctx->kdf_ukm);
-        dctx->kdf_ukm = p2;
-        if (p2)
-            dctx->kdf_ukmlen = p1;
-        else
-            dctx->kdf_ukmlen = 0;
-        return 1;
-
-    case EVP_PKEY_CTRL_GET_DH_KDF_UKM:
-        *(unsigned char **)p2 = dctx->kdf_ukm;
-        return dctx->kdf_ukmlen;
-
-    case EVP_PKEY_CTRL_DH_KDF_OID:
-        ASN1_OBJECT_free(dctx->kdf_oid);
-        dctx->kdf_oid = p2;
-        return 1;
-
-    case EVP_PKEY_CTRL_GET_DH_KDF_OID:
-        *(ASN1_OBJECT **)p2 = dctx->kdf_oid;
-        return 1;
-
-    default:
-        return -2;
-    }
-}
-
-static int pkey_dh_ctrl_str(EVP_PKEY_CTX *ctx,
-    const char *type, const char *value)
-{
-    if (strcmp(type, "dh_paramgen_prime_len") == 0) {
-        int len;
-        len = atoi(value);
-        return EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len);
-    }
-    if (strcmp(type, "dh_rfc5114") == 0) {
-        DH_PKEY_CTX *dctx = ctx->data;
-        int id;
-
-        id = atoi(value);
-        if (id < 0 || id > 3)
-            return -2;
-        dctx->param_nid = id;
-        return 1;
-    }
-    if (strcmp(type, "dh_param") == 0) {
-        DH_PKEY_CTX *dctx = ctx->data;
-        int nid = OBJ_sn2nid(value);
-
-        if (nid == NID_undef) {
-            ERR_raise(ERR_LIB_DH, DH_R_INVALID_PARAMETER_NAME);
-            return -2;
-        }
-        dctx->param_nid = nid;
-        return 1;
-    }
-    if (strcmp(type, "dh_paramgen_generator") == 0) {
-        int len;
-        len = atoi(value);
-        return EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, len);
-    }
-    if (strcmp(type, "dh_paramgen_subprime_len") == 0) {
-        int len;
-        len = atoi(value);
-        return EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len);
-    }
-    if (strcmp(type, "dh_paramgen_type") == 0) {
-        int typ;
-        typ = atoi(value);
-        return EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ);
-    }
-    if (strcmp(type, "dh_pad") == 0) {
-        int pad;
-        pad = atoi(value);
-        return EVP_PKEY_CTX_set_dh_pad(ctx, pad);
-    }
-    return -2;
-}
-
-static DH *ffc_params_generate(OSSL_LIB_CTX *libctx, DH_PKEY_CTX *dctx,
-    BN_GENCB *pcb)
-{
-    DH *ret;
-    int rv = 0;
-    int res;
-    int prime_len = dctx->prime_len;
-    int subprime_len = dctx->subprime_len;
-
-    if (dctx->paramgen_type > DH_PARAMGEN_TYPE_FIPS_186_4)
-        return NULL;
-    ret = DH_new();
-    if (ret == NULL)
-        return NULL;
-
-    if (subprime_len == -1) {
-        if (prime_len >= 2048)
-            subprime_len = 256;
-        else
-            subprime_len = 160;
-    }
-
-    if (dctx->md != NULL)
-        ossl_ffc_set_digest(&ret->params, EVP_MD_get0_name(dctx->md), NULL);
-
-#ifndef FIPS_MODULE
-    if (dctx->paramgen_type == DH_PARAMGEN_TYPE_FIPS_186_2)
-        rv = ossl_ffc_params_FIPS186_2_generate(libctx, &ret->params,
-            FFC_PARAM_TYPE_DH,
-            prime_len, subprime_len, &res,
-            pcb);
-    else
-#endif
-        /* For FIPS we always use the DH_PARAMGEN_TYPE_FIPS_186_4 generator */
-        if (dctx->paramgen_type >= DH_PARAMGEN_TYPE_FIPS_186_2)
-            rv = ossl_ffc_params_FIPS186_4_generate(libctx, &ret->params,
-                FFC_PARAM_TYPE_DH,
-                prime_len, subprime_len, &res,
-                pcb);
-    if (rv <= 0) {
-        DH_free(ret);
-        return NULL;
-    }
-    return ret;
-}
-
-static int pkey_dh_paramgen(EVP_PKEY_CTX *ctx,
-    EVP_PKEY *pkey)
-{
-    DH *dh = NULL;
-    DH_PKEY_CTX *dctx = ctx->data;
-    BN_GENCB *pcb = NULL;
-    int ret;
-
-    /*
-     * Look for a safe prime group for key establishment. Which uses
-     * either RFC_3526 (modp_XXXX) or RFC_7919 (ffdheXXXX).
-     * RFC_5114 is also handled here for param_nid = (1..3)
-     */
-    if (dctx->param_nid != NID_undef) {
-        int type = dctx->param_nid <= 3 ? EVP_PKEY_DHX : EVP_PKEY_DH;
-
-        if ((dh = DH_new_by_nid(dctx->param_nid)) == NULL)
-            return 0;
-        EVP_PKEY_assign(pkey, type, dh);
-        return 1;
-    }
-
-    if (ctx->pkey_gencb != NULL) {
-        pcb = BN_GENCB_new();
-        if (pcb == NULL)
-            return 0;
-        evp_pkey_set_cb_translate(pcb, ctx);
-    }
-#ifdef FIPS_MODULE
-    dctx->paramgen_type = DH_PARAMGEN_TYPE_FIPS_186_4;
-#endif /* FIPS_MODULE */
-    if (dctx->paramgen_type >= DH_PARAMGEN_TYPE_FIPS_186_2) {
-        dh = ffc_params_generate(NULL, dctx, pcb);
-        BN_GENCB_free(pcb);
-        if (dh == NULL)
-            return 0;
-        EVP_PKEY_assign(pkey, EVP_PKEY_DHX, dh);
-        return 1;
-    }
-    dh = DH_new();
-    if (dh == NULL) {
-        BN_GENCB_free(pcb);
-        return 0;
-    }
-    ret = DH_generate_parameters_ex(dh,
-        dctx->prime_len, dctx->generator, pcb);
-    BN_GENCB_free(pcb);
-    if (ret)
-        EVP_PKEY_assign_DH(pkey, dh);
-    else
-        DH_free(dh);
-    return ret;
-}
-
-static int pkey_dh_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
-{
-    DH_PKEY_CTX *dctx = ctx->data;
-    DH *dh = NULL;
-
-    if (ctx->pkey == NULL && dctx->param_nid == NID_undef) {
-        ERR_raise(ERR_LIB_DH, DH_R_NO_PARAMETERS_SET);
-        return 0;
-    }
-    if (dctx->param_nid != NID_undef)
-        dh = DH_new_by_nid(dctx->param_nid);
-    else
-        dh = DH_new();
-    if (dh == NULL)
-        return 0;
-    EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, dh);
-    /* Note: if error return, pkey is freed by parent routine */
-    if (ctx->pkey != NULL && !EVP_PKEY_copy_parameters(pkey, ctx->pkey))
-        return 0;
-    return DH_generate_key((DH *)EVP_PKEY_get0_DH(pkey));
-}
-
-static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
-    size_t *keylen)
-{
-    int ret;
-    DH *dh;
-    const DH *dhpub;
-    DH_PKEY_CTX *dctx = ctx->data;
-    BIGNUM *dhpubbn;
-
-    if (ctx->pkey == NULL || ctx->peerkey == NULL) {
-        ERR_raise(ERR_LIB_DH, DH_R_KEYS_NOT_SET);
-        return 0;
-    }
-    dh = (DH *)EVP_PKEY_get0_DH(ctx->pkey);
-    dhpub = EVP_PKEY_get0_DH(ctx->peerkey);
-    if (dhpub == NULL || dh == NULL) {
-        ERR_raise(ERR_LIB_DH, DH_R_KEYS_NOT_SET);
-        return 0;
-    }
-    dhpubbn = dhpub->pub_key;
-    if (dctx->kdf_type == EVP_PKEY_DH_KDF_NONE) {
-        if (key == NULL) {
-            *keylen = DH_size(dh);
-            return 1;
-        }
-        if (dctx->pad)
-            ret = DH_compute_key_padded(key, dhpubbn, dh);
-        else
-            ret = DH_compute_key(key, dhpubbn, dh);
-        if (ret <= 0)
-            return ret;
-        *keylen = ret;
-        return 1;
-    } else if (dctx->kdf_type == EVP_PKEY_DH_KDF_X9_42) {
-
-        unsigned char *Z = NULL;
-        int Zlen = 0;
-
-        if (!dctx->kdf_outlen || !dctx->kdf_oid)
-            return 0;
-        if (key == NULL) {
-            *keylen = dctx->kdf_outlen;
-            return 1;
-        }
-        if (*keylen != dctx->kdf_outlen)
-            return 0;
-        ret = 0;
-        if ((Zlen = DH_size(dh)) <= 0)
-            return 0;
-        if ((Z = OPENSSL_malloc(Zlen)) == NULL)
-            return 0;
-        if (DH_compute_key_padded(Z, dhpubbn, dh) <= 0)
-            goto err;
-        if (!DH_KDF_X9_42(key, *keylen, Z, Zlen, dctx->kdf_oid,
-                dctx->kdf_ukm, dctx->kdf_ukmlen, dctx->kdf_md))
-            goto err;
-        *keylen = dctx->kdf_outlen;
-        ret = 1;
-    err:
-        OPENSSL_clear_free(Z, Zlen);
-        return ret;
-    }
-    return 0;
-}
-
-static const EVP_PKEY_METHOD dh_pkey_meth = {
-    EVP_PKEY_DH,
-    0,
-    pkey_dh_init,
-    pkey_dh_copy,
-    pkey_dh_cleanup,
-
-    0,
-    pkey_dh_paramgen,
-
-    0,
-    pkey_dh_keygen,
-
-    0,
-    0,
-
-    0,
-    0,
-
-    0, 0,
-
-    0, 0, 0, 0,
-
-    0, 0,
-
-    0, 0,
-
-    0,
-    pkey_dh_derive,
-
-    pkey_dh_ctrl,
-    pkey_dh_ctrl_str
-};
-
-const EVP_PKEY_METHOD *ossl_dh_pkey_method(void)
-{
-    return &dh_pkey_meth;
-}
-
-static const EVP_PKEY_METHOD dhx_pkey_meth = {
-    EVP_PKEY_DHX,
-    0,
-    pkey_dh_init,
-    pkey_dh_copy,
-    pkey_dh_cleanup,
-
-    0,
-    pkey_dh_paramgen,
-
-    0,
-    pkey_dh_keygen,
-
-    0,
-    0,
-
-    0,
-    0,
-
-    0, 0,
-
-    0, 0, 0, 0,
-
-    0, 0,
-
-    0, 0,
-
-    0,
-    pkey_dh_derive,
-
-    pkey_dh_ctrl,
-    pkey_dh_ctrl_str
-};
-
-const EVP_PKEY_METHOD *ossl_dhx_pkey_method(void)
-{
-    return &dhx_pkey_meth;
-}
diff --git a/deps/openssl/openssl/crypto/dh/dh_rfc5114.c b/deps/openssl/openssl/crypto/dh/dh_rfc5114.c
index 67a9198a707..7f88d569e0e 100644
--- a/deps/openssl/openssl/crypto/dh/dh_rfc5114.c
+++ b/deps/openssl/openssl/crypto/dh/dh_rfc5114.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2021 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/crypto/dllmain.c b/deps/openssl/openssl/crypto/dllmain.c
index f2b72df8994..0ca19e63ec7 100644
--- a/deps/openssl/openssl/crypto/dllmain.c
+++ b/deps/openssl/openssl/crypto/dllmain.c
@@ -40,6 +40,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 #endif
         break;
     case DLL_PROCESS_DETACH:
+#if defined(OSSL_DLLMAIN_DESTRUCTOR)
+        ossl_cleanup_destructor();
+#endif /* defined(OSSL_DLLMAIN_DESTRUCTOR) */
         break;
     }
     return TRUE;
diff --git a/deps/openssl/openssl/crypto/dsa/build.info b/deps/openssl/openssl/crypto/dsa/build.info
index 9a7d275c350..f38ad8d5678 100644
--- a/deps/openssl/openssl/crypto/dsa/build.info
+++ b/deps/openssl/openssl/crypto/dsa/build.info
@@ -4,7 +4,7 @@ $COMMON=dsa_sign.c dsa_vrf.c dsa_lib.c dsa_ossl.c dsa_check.c \
         dsa_key.c dsa_backend.c dsa_gen.c

 SOURCE[../../libcrypto]=$COMMON\
-        dsa_asn1.c dsa_err.c dsa_ameth.c dsa_pmeth.c dsa_prn.c \
+        dsa_asn1.c dsa_err.c dsa_ameth.c dsa_prn.c \
         dsa_meth.c
 IF[{- !$disabled{'deprecated-0.9.8'} -}]
   SOURCE[../../libcrypto]=dsa_depr.c
diff --git a/deps/openssl/openssl/crypto/dsa/dsa_asn1.c b/deps/openssl/openssl/crypto/dsa/dsa_asn1.c
index 9ebc7cc2596..4cf5d66a63a 100644
--- a/deps/openssl/openssl/crypto/dsa/dsa_asn1.c
+++ b/deps/openssl/openssl/crypto/dsa/dsa_asn1.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/crypto/dsa/dsa_backend.c b/deps/openssl/openssl/crypto/dsa/dsa_backend.c
index 4d71d17b916..cab9b713014 100644
--- a/deps/openssl/openssl/crypto/dsa/dsa_backend.c
+++ b/deps/openssl/openssl/crypto/dsa/dsa_backend.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -21,10 +21,12 @@
 #include "crypto/dsa.h"
 #include "dsa_local.h"

+#include <crypto/asn1.h>
+
 /*
- * The intention with the "backend" source file is to offer backend support
- * for legacy backends (EVP_PKEY_ASN1_METHOD and EVP_PKEY_METHOD) and provider
- * implementations alike.
+ * The intention with the "backend" source file is to offer backend functions
+ * for legacy backends (EVP_PKEY_ASN1_METHOD) and provider implementations
+ * alike.
  */

 int ossl_dsa_key_fromdata(DSA *dsa, const OSSL_PARAM params[],
@@ -64,7 +66,7 @@ err:
 int ossl_dsa_is_foreign(const DSA *dsa)
 {
 #ifndef FIPS_MODULE
-    if (dsa->engine != NULL || DSA_get_method((DSA *)dsa) != DSA_OpenSSL())
+    if (DSA_get_method((DSA *)dsa) != DSA_OpenSSL())
         return 1;
 #endif
     return 0;
diff --git a/deps/openssl/openssl/crypto/dsa/dsa_err.c b/deps/openssl/openssl/crypto/dsa/dsa_err.c
deleted file mode 100644
index 12bc68ab56e..00000000000
--- a/deps/openssl/openssl/crypto/dsa/dsa_err.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/dsaerr.h>
-#include "crypto/dsaerr.h"
-
-#ifndef OPENSSL_NO_DSA
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA DSA_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_BAD_FFC_PARAMETERS), "bad ffc parameters" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_BAD_Q_VALUE), "bad q value" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_BN_DECODE_ERROR), "bn decode error" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_BN_ERROR), "bn error" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_DECODE_ERROR), "decode error" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_INVALID_DIGEST_TYPE),
-        "invalid digest type" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_INVALID_PARAMETERS), "invalid parameters" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_MISSING_PARAMETERS), "missing parameters" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_MISSING_PRIVATE_KEY),
-        "missing private key" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_MODULUS_TOO_LARGE), "modulus too large" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_NO_PARAMETERS_SET), "no parameters set" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_PARAMETER_ENCODING_ERROR),
-        "parameter encoding error" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_P_NOT_PRIME), "p not prime" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_Q_NOT_PRIME), "q not prime" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_SEED_LEN_SMALL),
-        "seed_len is less than the length of q" },
-    { ERR_PACK(ERR_LIB_DSA, 0, DSA_R_TOO_MANY_RETRIES), "too many retries" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_DSA_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(DSA_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(DSA_str_reasons);
-#endif
-    return 1;
-}
-#else
-NON_EMPTY_TRANSLATION_UNIT
-#endif
diff --git a/deps/openssl/openssl/crypto/dsa/dsa_lib.c b/deps/openssl/openssl/crypto/dsa/dsa_lib.c
index 382fe9d0f16..5936b840980 100644
--- a/deps/openssl/openssl/crypto/dsa/dsa_lib.c
+++ b/deps/openssl/openssl/crypto/dsa/dsa_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,16 +14,14 @@
 #include "internal/deprecated.h"

 #include <openssl/bn.h>
-#ifndef FIPS_MODULE
-#include <openssl/engine.h>
-#endif
 #include "internal/cryptlib.h"
 #include "internal/refcount.h"
+#include "internal/common.h"
 #include "crypto/dsa.h"
 #include "crypto/dh.h" /* required by DSA_dup_DH() */
 #include "dsa_local.h"

-static DSA *dsa_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx);
+static DSA *dsa_new_intern(OSSL_LIB_CTX *libctx);

 #ifndef FIPS_MODULE

@@ -98,11 +96,6 @@ void DSA_set_flags(DSA *d, int flags)
     d->flags |= flags;
 }

-ENGINE *DSA_get0_engine(DSA *d)
-{
-    return d->engine;
-}
-
 int DSA_set_method(DSA *dsa, const DSA_METHOD *meth)
 {
     /*
@@ -113,10 +106,6 @@ int DSA_set_method(DSA *dsa, const DSA_METHOD *meth)
     mtmp = dsa->meth;
     if (mtmp->finish)
         mtmp->finish(dsa);
-#ifndef OPENSSL_NO_ENGINE
-    ENGINE_finish(dsa->engine);
-    dsa->engine = NULL;
-#endif
     dsa->meth = meth;
     if (meth->init)
         meth->init(dsa);
@@ -129,7 +118,7 @@ const DSA_METHOD *DSA_get_method(DSA *d)
     return d->meth;
 }

-static DSA *dsa_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx)
+static DSA *dsa_new_intern(OSSL_LIB_CTX *libctx)
 {
     DSA *ret = OPENSSL_zalloc(sizeof(*ret));

@@ -151,24 +140,6 @@ static DSA *dsa_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx)

     ret->libctx = libctx;
     ret->meth = DSA_get_default_method();
-#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
-    ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW; /* early default init */
-    if (engine) {
-        if (!ENGINE_init(engine)) {
-            ERR_raise(ERR_LIB_DSA, ERR_R_ENGINE_LIB);
-            goto err;
-        }
-        ret->engine = engine;
-    } else
-        ret->engine = ENGINE_get_default_DSA();
-    if (ret->engine) {
-        ret->meth = ENGINE_get_DSA(ret->engine);
-        if (ret->meth == NULL) {
-            ERR_raise(ERR_LIB_DSA, ERR_R_ENGINE_LIB);
-            goto err;
-        }
-    }
-#endif

     ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW;

@@ -194,18 +165,20 @@ err:

 DSA *DSA_new_method(ENGINE *engine)
 {
-    return dsa_new_intern(engine, NULL);
+    if (!ossl_assert(engine == NULL))
+        return NULL;
+    return dsa_new_intern(NULL);
 }

 DSA *ossl_dsa_new(OSSL_LIB_CTX *libctx)
 {
-    return dsa_new_intern(NULL, libctx);
+    return dsa_new_intern(libctx);
 }

 #ifndef FIPS_MODULE
 DSA *DSA_new(void)
 {
-    return dsa_new_intern(NULL, NULL);
+    return dsa_new_intern(NULL);
 }
 #endif

@@ -224,9 +197,6 @@ void DSA_free(DSA *r)

     if (r->meth != NULL && r->meth->finish != NULL)
         r->meth->finish(r);
-#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
-    ENGINE_finish(r->engine);
-#endif

 #ifndef FIPS_MODULE
     CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data);
@@ -245,7 +215,7 @@ int DSA_up_ref(DSA *r)
 {
     int i;

-    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&r->references, &i))
         return 0;

     REF_PRINT_COUNT("DSA", i, r);
@@ -253,6 +223,11 @@ int DSA_up_ref(DSA *r)
     return ((i > 1) ? 1 : 0);
 }

+OSSL_LIB_CTX *ossl_dsa_get0_libctx(const DSA *d)
+{
+    return d->libctx;
+}
+
 void ossl_dsa_set0_libctx(DSA *d, OSSL_LIB_CTX *libctx)
 {
     d->libctx = libctx;
diff --git a/deps/openssl/openssl/crypto/dsa/dsa_local.h b/deps/openssl/openssl/crypto/dsa/dsa_local.h
index 73a6bad653d..56cc4360f5f 100644
--- a/deps/openssl/openssl/crypto/dsa/dsa_local.h
+++ b/deps/openssl/openssl/crypto/dsa/dsa_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_DSA_DSA_LOCAL_H)
+#define OSSL_LIBCRYPTO_DSA_DSA_LOCAL_H
+
 #include <openssl/dsa.h>
 #include "internal/refcount.h"
 #include "internal/ffc.h"
@@ -29,8 +32,6 @@ struct dsa_st {
     CRYPTO_EX_DATA ex_data;
 #endif
     const DSA_METHOD *meth;
-    /* functional reference if 'meth' is ENGINE-provided */
-    ENGINE *engine;
     CRYPTO_RWLOCK *lock;
     OSSL_LIB_CTX *libctx;

@@ -72,3 +73,5 @@ struct dsa_method {
 DSA_SIG *ossl_dsa_do_sign_int(const unsigned char *dgst, int dlen, DSA *dsa,
     unsigned int nonce_type, const char *digestname,
     OSSL_LIB_CTX *libctx, const char *propq);
+
+#endif /* !defined(OSSL_LIBCRYPTO_DSA_DSA_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/dsa/dsa_ossl.c b/deps/openssl/openssl/crypto/dsa/dsa_ossl.c
index 7bfcb434d08..10655137df4 100644
--- a/deps/openssl/openssl/crypto/dsa/dsa_ossl.c
+++ b/deps/openssl/openssl/crypto/dsa/dsa_ossl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -39,7 +39,7 @@ static int dsa_finish(DSA *dsa);
 static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q,
     BN_CTX *ctx);

-static DSA_METHOD openssl_dsa_meth = {
+static const DSA_METHOD openssl_dsa_meth = {
     "OpenSSL DSA method",
     dsa_do_sign,
     dsa_sign_setup_no_digest,
@@ -468,6 +468,7 @@ static int dsa_init(DSA *dsa)
 static int dsa_finish(DSA *dsa)
 {
     BN_MONT_CTX_free(dsa->method_mont_p);
+    dsa->method_mont_p = NULL;
     return 1;
 }

diff --git a/deps/openssl/openssl/crypto/dsa/dsa_pmeth.c b/deps/openssl/openssl/crypto/dsa/dsa_pmeth.c
deleted file mode 100644
index e41e634944b..00000000000
--- a/deps/openssl/openssl/crypto/dsa/dsa_pmeth.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Copyright 2006-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * DSA low level APIs are deprecated for public use, but still ok for
- * internal use.
- */
-#include "internal/deprecated.h"
-
-#include <stdio.h>
-#include "internal/cryptlib.h"
-#include <openssl/asn1t.h>
-#include <openssl/x509.h>
-#include <openssl/evp.h>
-#include <openssl/bn.h>
-#include "crypto/evp.h"
-#include "dsa_local.h"
-
-/* DSA pkey context structure */
-
-typedef struct {
-    /* Parameter gen parameters */
-    int nbits; /* size of p in bits (default: 2048) */
-    int qbits; /* size of q in bits (default: 224) */
-    const EVP_MD *pmd; /* MD for parameter generation */
-    /* Keygen callback info */
-    int gentmp[2];
-    /* message digest */
-    const EVP_MD *md; /* MD for the signature */
-} DSA_PKEY_CTX;
-
-static int pkey_dsa_init(EVP_PKEY_CTX *ctx)
-{
-    DSA_PKEY_CTX *dctx = OPENSSL_malloc(sizeof(*dctx));
-
-    if (dctx == NULL)
-        return 0;
-    dctx->nbits = 2048;
-    dctx->qbits = 224;
-    dctx->pmd = NULL;
-    dctx->md = NULL;
-
-    ctx->data = dctx;
-    ctx->keygen_info = dctx->gentmp;
-    ctx->keygen_info_count = 2;
-
-    return 1;
-}
-
-static int pkey_dsa_copy(EVP_PKEY_CTX *dst, const EVP_PKEY_CTX *src)
-{
-    DSA_PKEY_CTX *dctx, *sctx;
-
-    if (!pkey_dsa_init(dst))
-        return 0;
-    sctx = src->data;
-    dctx = dst->data;
-    dctx->nbits = sctx->nbits;
-    dctx->qbits = sctx->qbits;
-    dctx->pmd = sctx->pmd;
-    dctx->md = sctx->md;
-    return 1;
-}
-
-static void pkey_dsa_cleanup(EVP_PKEY_CTX *ctx)
-{
-    DSA_PKEY_CTX *dctx = ctx->data;
-    OPENSSL_free(dctx);
-}
-
-static int pkey_dsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig,
-    size_t *siglen, const unsigned char *tbs,
-    size_t tbslen)
-{
-    int ret, md_size;
-    unsigned int sltmp;
-    DSA_PKEY_CTX *dctx = ctx->data;
-    /*
-     * Discard const. Its marked as const because this may be a cached copy of
-     * the "real" key. These calls don't make any modifications that need to
-     * be reflected back in the "original" key.
-     */
-    DSA *dsa = (DSA *)EVP_PKEY_get0_DSA(ctx->pkey);
-
-    if (dctx->md != NULL) {
-        md_size = EVP_MD_get_size(dctx->md);
-        if (md_size <= 0)
-            return 0;
-        if (tbslen != (size_t)md_size)
-            return 0;
-    }
-
-    ret = DSA_sign(0, tbs, tbslen, sig, &sltmp, dsa);
-
-    if (ret <= 0)
-        return ret;
-    *siglen = sltmp;
-    return 1;
-}
-
-static int pkey_dsa_verify(EVP_PKEY_CTX *ctx,
-    const unsigned char *sig, size_t siglen,
-    const unsigned char *tbs, size_t tbslen)
-{
-    int ret, md_size;
-    DSA_PKEY_CTX *dctx = ctx->data;
-    /*
-     * Discard const. Its marked as const because this may be a cached copy of
-     * the "real" key. These calls don't make any modifications that need to
-     * be reflected back in the "original" key.
-     */
-    DSA *dsa = (DSA *)EVP_PKEY_get0_DSA(ctx->pkey);
-
-    if (dctx->md != NULL) {
-        md_size = EVP_MD_get_size(dctx->md);
-        if (md_size <= 0)
-            return 0;
-        if (tbslen != (size_t)md_size)
-            return 0;
-    }
-
-    ret = DSA_verify(0, tbs, tbslen, sig, siglen, dsa);
-
-    return ret;
-}
-
-static int pkey_dsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
-{
-    DSA_PKEY_CTX *dctx = ctx->data;
-
-    switch (type) {
-    case EVP_PKEY_CTRL_DSA_PARAMGEN_BITS:
-        if (p1 < 256)
-            return -2;
-        dctx->nbits = p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS:
-        if (p1 != 160 && p1 != 224 && p1 && p1 != 256)
-            return -2;
-        dctx->qbits = p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_DSA_PARAMGEN_MD:
-        if (EVP_MD_get_type((const EVP_MD *)p2) != NID_sha1 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha224 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha256) {
-            ERR_raise(ERR_LIB_DSA, DSA_R_INVALID_DIGEST_TYPE);
-            return 0;
-        }
-        dctx->pmd = p2;
-        return 1;
-
-    case EVP_PKEY_CTRL_MD:
-        if (EVP_MD_get_type((const EVP_MD *)p2) != NID_sha1 && EVP_MD_get_type((const EVP_MD *)p2) != NID_dsa && EVP_MD_get_type((const EVP_MD *)p2) != NID_dsaWithSHA && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha224 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha256 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha384 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha512 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha3_224 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha3_256 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha3_384 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha3_512) {
-            ERR_raise(ERR_LIB_DSA, DSA_R_INVALID_DIGEST_TYPE);
-            return 0;
-        }
-        dctx->md = p2;
-        return 1;
-
-    case EVP_PKEY_CTRL_GET_MD:
-        *(const EVP_MD **)p2 = dctx->md;
-        return 1;
-
-    case EVP_PKEY_CTRL_DIGESTINIT:
-    case EVP_PKEY_CTRL_PKCS7_SIGN:
-    case EVP_PKEY_CTRL_CMS_SIGN:
-        return 1;
-
-    case EVP_PKEY_CTRL_PEER_KEY:
-        ERR_raise(ERR_LIB_DSA, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
-        return -2;
-    default:
-        return -2;
-    }
-}
-
-static int pkey_dsa_ctrl_str(EVP_PKEY_CTX *ctx,
-    const char *type, const char *value)
-{
-    if (strcmp(type, "dsa_paramgen_bits") == 0) {
-        int nbits;
-        nbits = atoi(value);
-        return EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits);
-    }
-    if (strcmp(type, "dsa_paramgen_q_bits") == 0) {
-        int qbits = atoi(value);
-        return EVP_PKEY_CTX_set_dsa_paramgen_q_bits(ctx, qbits);
-    }
-    if (strcmp(type, "dsa_paramgen_md") == 0) {
-        const EVP_MD *md = EVP_get_digestbyname(value);
-
-        if (md == NULL) {
-            ERR_raise(ERR_LIB_DSA, DSA_R_INVALID_DIGEST_TYPE);
-            return 0;
-        }
-        return EVP_PKEY_CTX_set_dsa_paramgen_md(ctx, md);
-    }
-    return -2;
-}
-
-static int pkey_dsa_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
-{
-    DSA *dsa = NULL;
-    DSA_PKEY_CTX *dctx = ctx->data;
-    BN_GENCB *pcb;
-    int ret, res;
-
-    if (ctx->pkey_gencb) {
-        pcb = BN_GENCB_new();
-        if (pcb == NULL)
-            return 0;
-        evp_pkey_set_cb_translate(pcb, ctx);
-    } else
-        pcb = NULL;
-    dsa = DSA_new();
-    if (dsa == NULL) {
-        BN_GENCB_free(pcb);
-        return 0;
-    }
-    if (dctx->md != NULL)
-        ossl_ffc_set_digest(&dsa->params, EVP_MD_get0_name(dctx->md), NULL);
-
-    ret = ossl_ffc_params_FIPS186_4_generate(NULL, &dsa->params,
-        FFC_PARAM_TYPE_DSA, dctx->nbits,
-        dctx->qbits, &res, pcb);
-    BN_GENCB_free(pcb);
-    if (ret > 0)
-        EVP_PKEY_assign_DSA(pkey, dsa);
-    else
-        DSA_free(dsa);
-    return ret;
-}
-
-static int pkey_dsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
-{
-    DSA *dsa = NULL;
-
-    if (ctx->pkey == NULL) {
-        ERR_raise(ERR_LIB_DSA, DSA_R_NO_PARAMETERS_SET);
-        return 0;
-    }
-    dsa = DSA_new();
-    if (dsa == NULL)
-        return 0;
-    EVP_PKEY_assign_DSA(pkey, dsa);
-    /* Note: if error return, pkey is freed by parent routine */
-    if (!EVP_PKEY_copy_parameters(pkey, ctx->pkey))
-        return 0;
-    return DSA_generate_key((DSA *)EVP_PKEY_get0_DSA(pkey));
-}
-
-static const EVP_PKEY_METHOD dsa_pkey_meth = {
-    EVP_PKEY_DSA,
-    EVP_PKEY_FLAG_AUTOARGLEN,
-    pkey_dsa_init,
-    pkey_dsa_copy,
-    pkey_dsa_cleanup,
-
-    0,
-    pkey_dsa_paramgen,
-
-    0,
-    pkey_dsa_keygen,
-
-    0,
-    pkey_dsa_sign,
-
-    0,
-    pkey_dsa_verify,
-
-    0, 0,
-
-    0, 0, 0, 0,
-
-    0, 0,
-
-    0, 0,
-
-    0, 0,
-
-    pkey_dsa_ctrl,
-    pkey_dsa_ctrl_str
-};
-
-const EVP_PKEY_METHOD *ossl_dsa_pkey_method(void)
-{
-    return &dsa_pkey_meth;
-}
diff --git a/deps/openssl/openssl/crypto/dso/dso_dl.c b/deps/openssl/openssl/crypto/dso/dso_dl.c
index ff51764deaf..26f6ee8d22e 100644
--- a/deps/openssl/openssl/crypto/dso/dso_dl.c
+++ b/deps/openssl/openssl/crypto/dso/dso_dl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,8 @@
  * https://www.openssl.org/source/license.html
  */

+#include <stdio.h>
+
 #include "dso_local.h"

 #ifdef DSO_DL
@@ -228,13 +230,13 @@ static char *dl_name_converter(DSO *dso, const char *filename)
         return NULL;
     }
     if (transform)
-        BIO_snprintf(translated, rsize,
+        snprintf(translated, rsize,
             (DSO_flags(dso) & DSO_FLAG_NAME_TRANSLATION_EXT_ONLY) == 0
                 ? "lib%s%s"
                 : "%s%s",
             filename, DSO_EXTENSION);
     else
-        BIO_snprintf(translated, rsize, "%s", filename);
+        snprintf(translated, rsize, "%s", filename);
     return translated;
 }

diff --git a/deps/openssl/openssl/crypto/dso/dso_dlfcn.c b/deps/openssl/openssl/crypto/dso/dso_dlfcn.c
index 26493009743..3b8242ff2e9 100644
--- a/deps/openssl/openssl/crypto/dso/dso_dlfcn.c
+++ b/deps/openssl/openssl/crypto/dso/dso_dlfcn.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -16,6 +16,8 @@
 #define _GNU_SOURCE /* make sure dladdr is declared */
 #endif

+#include <stdio.h>
+
 #include "dso_local.h"
 #include "internal/e_os.h"

@@ -262,11 +264,11 @@ static char *dlfcn_name_converter(DSO *dso, const char *filename)
     }
     if (transform) {
         if ((DSO_flags(dso) & DSO_FLAG_NAME_TRANSLATION_EXT_ONLY) == 0)
-            BIO_snprintf(translated, rsize, "lib%s" DSO_EXTENSION, filename);
+            snprintf(translated, rsize, "lib%s" DSO_EXTENSION, filename);
         else
-            BIO_snprintf(translated, rsize, "%s" DSO_EXTENSION, filename);
+            snprintf(translated, rsize, "%s" DSO_EXTENSION, filename);
     } else {
-        BIO_snprintf(translated, rsize, "%s", filename);
+        snprintf(translated, rsize, "%s", filename);
     }
     return translated;
 }
diff --git a/deps/openssl/openssl/crypto/dso/dso_err.c b/deps/openssl/openssl/crypto/dso/dso_err.c
deleted file mode 100644
index ec55b9a30a9..00000000000
--- a/deps/openssl/openssl/crypto/dso/dso_err.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include "internal/dsoerr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA DSO_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_CTRL_FAILED), "control command failed" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_DSO_ALREADY_LOADED), "dso already loaded" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_EMPTY_FILE_STRUCTURE),
-        "empty file structure" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_FAILURE), "failure" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_FILENAME_TOO_BIG), "filename too big" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_FINISH_FAILED),
-        "cleanup method function failed" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_INCORRECT_FILE_SYNTAX),
-        "incorrect file syntax" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_LOAD_FAILED),
-        "could not load the shared library" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_NAME_TRANSLATION_FAILED),
-        "name translation failed" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_NO_FILENAME), "no filename" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_NULL_HANDLE),
-        "a null shared library handle was used" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_SET_FILENAME_FAILED),
-        "set filename failed" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_STACK_ERROR),
-        "the meth_data stack is corrupt" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_SYM_FAILURE),
-        "could not bind to the requested symbol name" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_UNLOAD_FAILED),
-        "could not unload the shared library" },
-    { ERR_PACK(ERR_LIB_DSO, 0, DSO_R_UNSUPPORTED),
-        "functionality not supported" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_DSO_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(DSO_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(DSO_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/dso/dso_lib.c b/deps/openssl/openssl/crypto/dso/dso_lib.c
index 6f51e4d35a0..a0fddd3c6b4 100644
--- a/deps/openssl/openssl/crypto/dso/dso_lib.c
+++ b/deps/openssl/openssl/crypto/dso/dso_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -93,7 +93,7 @@ int DSO_up_ref(DSO *dso)
         return 0;
     }

-    if (CRYPTO_UP_REF(&dso->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&dso->references, &i))
         return 0;

     REF_PRINT_COUNT("DSO", i, dso);
diff --git a/deps/openssl/openssl/crypto/dso/dso_local.h b/deps/openssl/openssl/crypto/dso/dso_local.h
index f3ec8021011..1a80dccbae6 100644
--- a/deps/openssl/openssl/crypto/dso/dso_local.h
+++ b/deps/openssl/openssl/crypto/dso/dso_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_DSO_DSO_LOCAL_H)
+#define OSSL_LIBCRYPTO_DSO_DSO_LOCAL_H
+
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include "internal/dso.h"
@@ -104,3 +107,5 @@ struct dso_meth_st {
     /* Perform global symbol lookup, i.e. among *all* modules */
     void *(*globallookup)(const char *symname);
 };
+
+#endif /* !defined(OSSL_LIBCRYPTO_DSO_DSO_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/dso/dso_win32.c b/deps/openssl/openssl/crypto/dso/dso_win32.c
index 77d45f7ee8c..e785bb8abb9 100644
--- a/deps/openssl/openssl/crypto/dso/dso_win32.c
+++ b/deps/openssl/openssl/crypto/dso/dso_win32.c
@@ -7,54 +7,13 @@
  * https://www.openssl.org/source/license.html
  */

+#include <stdio.h>
+
 #include "internal/e_os.h"
 #include "dso_local.h"

 #if defined(DSO_WIN32)

-#ifdef _WIN32_WCE
-#if _WIN32_WCE < 300
-static FARPROC GetProcAddressA(HMODULE hModule, LPCSTR lpProcName)
-{
-    WCHAR lpProcNameW[64];
-    int i;
-
-    for (i = 0; lpProcName[i] && i < 64; i++)
-        lpProcNameW[i] = (WCHAR)lpProcName[i];
-    if (i == 64)
-        return NULL;
-    lpProcNameW[i] = 0;
-
-    return GetProcAddressW(hModule, lpProcNameW);
-}
-#endif
-#undef GetProcAddress
-#define GetProcAddress GetProcAddressA
-
-static HINSTANCE LoadLibraryA(LPCSTR lpLibFileName)
-{
-    WCHAR *fnamw;
-    size_t len_0 = strlen(lpLibFileName) + 1, i;
-
-#ifdef _MSC_VER
-    fnamw = (WCHAR *)_alloca(len_0 * sizeof(WCHAR));
-#else
-    fnamw = (WCHAR *)alloca(len_0 * sizeof(WCHAR));
-#endif
-    if (fnamw == NULL) {
-        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-        return NULL;
-    }
-#if defined(_WIN32_WCE) && _WIN32_WCE >= 101
-    if (!MultiByteToWideChar(CP_ACP, 0, lpLibFileName, len_0, fnamw, len_0))
-#endif
-        for (i = 0; i < len_0; i++)
-            fnamw[i] = (WCHAR)lpLibFileName[i];
-
-    return LoadLibraryW(fnamw);
-}
-#endif
-
 #define GETPROCADDRESS(h, name, type) ((type)(void (*)(void))GetProcAddress((h), (name)))

 /* Part of the hack in "win32_load" ... */
@@ -448,15 +407,15 @@ static char *win32_name_converter(DSO *dso, const char *filename)
     transform = ((strstr(filename, "/") == NULL) && (strstr(filename, "\\") == NULL) && (strstr(filename, ":") == NULL));
     /* If transform != 0, then we convert to %s.dll, else just dupe filename */

-    len = strlen(filename) + 1;
+    len = (int)strlen(filename) + 1;
     if (transform)
-        len += strlen(".dll");
+        len += (int)strlen(".dll");
     translated = OPENSSL_malloc(len);
     if (translated == NULL) {
         ERR_raise(ERR_LIB_DSO, DSO_R_NAME_TRANSLATION_FAILED);
         return NULL;
     }
-    BIO_snprintf(translated, len, "%s%s", filename, transform ? ".dll" : "");
+    snprintf(translated, len, "%s%s", filename, transform ? ".dll" : "");
     return translated;
 }

@@ -472,14 +431,10 @@ static const char *openssl_strnchr(const char *string, int c, size_t len)
 }

 #include <tlhelp32.h>
-#ifdef _WIN32_WCE
-#define DLLNAME "TOOLHELP.DLL"
-#else
 #ifdef MODULEENTRY32
 #undef MODULEENTRY32 /* unmask the ASCII version! */
 #endif
 #define DLLNAME "KERNEL32.DLL"
-#endif

 typedef HANDLE(WINAPI *CREATETOOLHELP32SNAPSHOT)(DWORD, DWORD);
 typedef BOOL(WINAPI *CLOSETOOLHELP32SNAPSHOT)(HANDLE);
@@ -551,6 +506,8 @@ static int win32_pathbyaddr(void *addr, char *path, int sz)
     }
 out:
     OPENSSL_free(wpath);
+    if (hModule != NULL)
+        CloseHandle(hModule);
     return utf8len;
 }

@@ -580,11 +537,7 @@ static void *win32_globallookup(const char *name)
         return NULL;
     }
     /* We take the rest for granted... */
-#ifdef _WIN32_WCE
-    close_snap = GETPROCADDRESS(dll, "CloseToolhelp32Snapshot", CLOSETOOLHELP32SNAPSHOT);
-#else
     close_snap = (CLOSETOOLHELP32SNAPSHOT)CloseHandle;
-#endif
     module_first = GETPROCADDRESS(dll, "Module32First", MODULE32);
     module_next = GETPROCADDRESS(dll, "Module32Next", MODULE32);

diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv4.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv4.pl
index 0adad26cb11..8b3e54fa0f1 100755
--- a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv4.pl
+++ b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv4.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # ECP_NISTZ256 module for ARMv4.
@@ -51,7 +51,7 @@ if ($flavour && $flavour ne "void") {
 }

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 #if defined(__thumb2__)
 .syntax	unified
@@ -114,7 +114,7 @@ $code.=<<___;
 .long	0xfffffffe, 0xffffffff, 0xfffffffd, 0x00000004
 .Lone:
 .long	1,0,0,0,0,0,0,0
-.asciz	"ECP_NISTZ256 for ARMv4, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"ECP_NISTZ256 for ARMv4, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	6
 ___

diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv8.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv8.pl
index 35b14c695df..04e035f7727 100644
--- a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv8.pl
+++ b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-armv8.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2015-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # ECP_NISTZ256 module for ARMv8.
@@ -53,7 +53,7 @@ my ($rp,$ap,$bp,$bi,$a0,$a1,$a2,$a3,$t0,$t1,$t2,$t3,$poly1,$poly3,
 my ($acc6,$acc7)=($ap,$bp);	# used in __ecp_nistz256_sqr_mont

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 .rodata
 ___
@@ -115,7 +115,7 @@ $code.=<<___;
 .quad	0xf3b9cac2fc632551,0xbce6faada7179e84,0xffffffffffffffff,0xffffffff00000000
 .LordK:
 .quad	0xccd1c8aaee00bc4f
-.asciz	"ECP_NISTZ256 for ARMv8, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"ECP_NISTZ256 for ARMv8, CRYPTOGAMS by <https://github.com/dot-asm>"

 .text

diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-ppc64.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-ppc64.pl
index 7f600cece9d..a51f284c483 100755
--- a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-ppc64.pl
+++ b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-ppc64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # ECP_NISTZ256 module for PPC64.
@@ -98,7 +98,7 @@ for(1..37) {

 $code.=<<___;
 .size	ecp_nistz256_precomputed,.-ecp_nistz256_precomputed
-.asciz	"ECP_NISTZ256 for PPC64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"ECP_NISTZ256 for PPC64, CRYPTOGAMS by <https://github.com/dot-asm>"

 # void	ecp_nistz256_mul_mont(BN_ULONG x0[4],const BN_ULONG x1[4],
 #					     const BN_ULONG x2[4]);
@@ -873,7 +873,7 @@ ecp_nistz256_point_double:
 	srdi	$poly1,$poly1,32	# 0x00000000ffffffff
 	li	$poly3,1
 	orc	$poly3,$poly3,$poly1	# 0xffffffff00000001
-.Ldouble_shortcut:
+ec_dbl_shortcut:
 	ld	$acc0,32($ap)
 	ld	$acc1,40($ap)
 	ld	$acc2,48($ap)
@@ -1211,7 +1211,7 @@ ecp_nistz256_point_add:
 	ld	r18,$FRAME-8*14($sp)
 	ld	r19,$FRAME-8*13($sp)
 	stdu	$bp,$FRAME-288($sp)	# difference in stack frame sizes
-	b	.Ldouble_shortcut
+	b       ec_dbl_shortcut

 .align	4
 .Ladd_proceed:
diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-sparcv9.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-sparcv9.pl
index 986e002cc94..bee6d539e95 100755
--- a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-sparcv9.pl
+++ b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-sparcv9.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # ECP_NISTZ256 module for SPARCv9.
@@ -37,7 +37,7 @@ $code.=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #define LOCALS	(STACK_BIAS+STACK_FRAME)
 #ifdef	__arch64__
@@ -111,7 +111,7 @@ $code.=<<___;
 .long	0xfffffffe, 0xffffffff, 0xfffffffd, 0x00000004
 .Lone:
 .long	1,0,0,0,0,0,0,0
-.asciz	"ECP_NISTZ256 for SPARCv9, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"ECP_NISTZ256 for SPARCv9, CRYPTOGAMS by <https://github.com/dot-asm>"

 ! void	ecp_nistz256_to_mont(BN_ULONG %i0[8],const BN_ULONG %i1[8]);
 .globl	ecp_nistz256_to_mont
diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86.pl
index e78f0cd7266..44063bb4eea 100755
--- a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86.pl
+++ b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2015-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # ECP_NISTZ256 module for x86/SSE2.
@@ -104,7 +104,7 @@ for(1..37) {
 &static_label("ONE");
 &set_label("ONE");
 &data_word(1,0,0,0,0,0,0,0);
-&asciz("ECP_NISZ256 for x86/SSE2, CRYPTOGAMS by <appro\@openssl.org>");
+&asciz("ECP_NISZ256 for x86/SSE2, CRYPTOGAMS by <https://github.com/dot-asm>");
 &align(64);

 ########################################################################
diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl
index 12a104b5ec0..f8a021ee030 100755
--- a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl
+++ b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl
@@ -17,7 +17,7 @@
 # S.Gueron and V.Krasnov, "Fast Prime Field Elliptic Curve Cryptography with
 #                          256 Bit Primes"

-# Further optimization by <appro@openssl.org>:
+# Further optimization by <https://github.com/dot-asm>:
 #
 #		this/original	with/without -DECP_NISTZ256_ASM(*)
 # Opteron	+15-49%		+150-195%
@@ -3059,7 +3059,7 @@ ___
 # reloading them, pointers, would create undesired dependencies on
 # effective addresses calculation paths. In other words it's too done
 # to favour out-of-order execution logic.
-#						<appro@openssl.org>
+#						<https://github.com/dot-asm>

 my ($r_ptr,$a_ptr,$b_org,$b_ptr)=("%rdi","%rsi","%rdx","%rbx");
 my ($acc0,$acc1,$acc2,$acc3,$acc4,$acc5,$acc6,$acc7)=map("%r$_",(8..15));
diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_sm2p256-armv8.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_sm2p256-armv8.pl
index 6db0b6d7aa3..509e93a8158 100644
--- a/deps/openssl/openssl/crypto/ec/asm/ecp_sm2p256-armv8.pl
+++ b/deps/openssl/openssl/crypto/ec/asm/ecp_sm2p256-armv8.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -162,7 +162,7 @@ ___

 {
 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"
 .arch  armv8-a
 .rodata

diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_sm2p256-riscv64.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_sm2p256-riscv64.pl
new file mode 100644
index 00000000000..011f7a5a251
--- /dev/null
+++ b/deps/openssl/openssl/crypto/ec/asm/ecp_sm2p256-riscv64.pl
@@ -0,0 +1,1306 @@
+#! /usr/bin/env perl
+# Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+use strict;
+use warnings;
+
+use FindBin qw($Bin);
+use lib "$Bin";
+use lib "$Bin/../../perlasm";
+use riscv;
+
+my $output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+my $flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+$output and open STDOUT,">$output";
+
+################################################################################
+# Utility functions to help with keeping track of which registers to stack/
+# unstack when entering / exiting routines.
+################################################################################
+{
+    # Callee-saved registers
+    my @callee_saved = map("x$_",(2,8,9,18..27));
+    # Caller-saved registers
+    my @caller_saved = map("x$_",(1,5..7,10..17,28..31));
+    my @must_save;
+    sub use_reg {
+        my $reg = shift;
+        if (grep(/^$reg$/, @callee_saved)) {
+            push(@must_save, $reg);
+        } elsif (!grep(/^$reg$/, @caller_saved)) {
+            # Register is not usable!
+            die("Unusable register ".$reg);
+        }
+        return $reg;
+    }
+    sub use_regs {
+        return map(use_reg("x$_"), @_);
+    }
+    sub save_regs {
+        my $ret = '';
+        my $stack_reservation = ($#must_save + 1) * 8;
+        my $stack_offset = $stack_reservation;
+        if ($stack_reservation % 16) {
+            $stack_reservation += 8;
+        }
+        $ret.="    addi    sp,sp,-$stack_reservation\n";
+        foreach (@must_save) {
+            $stack_offset -= 8;
+            $ret.="    sd      $_,$stack_offset(sp)\n";
+        }
+        return $ret;
+    }
+    sub load_regs {
+        my $ret = '';
+        my $stack_reservation = ($#must_save + 1) * 8;
+        my $stack_offset = $stack_reservation;
+        if ($stack_reservation % 16) {
+            $stack_reservation += 8;
+        }
+        foreach (@must_save) {
+            $stack_offset -= 8;
+            $ret.="    ld      $_,$stack_offset(sp)\n";
+        }
+        $ret.="    addi    sp,sp,$stack_reservation\n";
+        return $ret;
+    }
+    sub clear_regs {
+        @must_save = ();
+    }
+}
+
+my $code=<<___;
+.text
+___
+
+# Function arguments
+# Input block pointer, output block pointer, key pointer
+my ($i0, $i1, $i2) = use_regs(10 .. 12);
+my ($t0, $t1, $t2, $t3, $t4, $t5, $t6, $t7, $c0, $c1, $c2, $c3) = use_regs(5 .. 7, 13 ... 17, 28 .. 31);
+my ($s0, $s1, $s2, $s3, $s4, $s5, $s6, $s7, $s8, $s9, $s10) = use_regs(9, 18 .. 27);
+
+sub bn_mod_add() {
+# returns r = ( a + b ) mod p, where p is a predefined polynomial modulus
+# Input: $i1 = address of operand a, $i2 = address of operand b
+# Output: $i0 = address for result storage
+# Dependencies: $mod = address of modulus p (passed via parameter)
+# Register usage: $t0-$t7: data storage registers, $c0-$c3: carry/borrow flags
+    my $mod = shift;
+$code.=<<___;
+	// Load inputs
+	ld $t0, 0($i1)
+	ld $t1, 8($i1)
+	ld $t2, 16($i1)
+	ld $t3, 24($i1)
+
+	ld $t4, 0($i2)
+	ld $t5, 8($i2)
+	ld $t6, 16($i2)
+	ld $t7, 24($i2)
+
+	// Addition
+	add $t0, $t0, $t4
+	sltu $c0, $t0, $t4  //carry
+
+	add $t1, $t1, $t5
+	sltu $c1, $t1, $t5
+	add $t1, $t1, $c0
+	sltu $c0, $t1, $c0
+	add $c0, $c0, $c1
+
+	add $t2, $t2, $t6
+	sltu $c1, $t2, $t6
+	add $t2, $t2, $c0
+	sltu $c0, $t2, $c0
+	add $c0, $c0, $c1
+
+	add $t3, $t3, $t7
+	sltu $c1, $t3, $t7
+	add $t3, $t3, $c0
+	sltu $c0, $t3, $c0
+	add $c0, $c0, $c1
+
+	// Load polynomial
+	la $i2, $mod
+	ld $t4, 0($i2)
+	ld $t5, 8($i2)
+	ld $t6, 16($i2)
+	ld $t7, 24($i2)
+
+	// Sub polynomial
+	sltu $c3, $t0, $t4  //borrow
+	sub $t4, $t0, $t4
+	sltu $c1, $t1, $t5
+	sub $t5, $t1, $t5
+	sltu $c2, $t5, $c3
+	sub $t5, $t5, $c3
+	add $c1, $c1, $c2  //borrow
+	sltu $c3, $t2, $t6
+	sub $t6, $t2, $t6
+	sltu $c2, $t6, $c1
+	sub $t6, $t6, $c1
+	add $c3, $c3, $c2  //borrow
+	sltu $c1, $t3, $t7
+	sub $t7, $t3, $t7
+	sltu $c2, $t7, $c3
+	sub $t7, $t7, $c3
+	add $c3, $c1, $c2  //borrow
+
+	// Select based on carry
+	slt $c0, $c0, $c3
+	negw $c1, $c0
+	addw $c0, $c0, -1
+
+	and $t0, $t0, $c1
+	and $t1, $t1, $c1
+	and $t2, $t2, $c1
+	and $t3, $t3, $c1
+	and $t4, $t4, $c0
+	and $t5, $t5, $c0
+	and $t6, $t6, $c0
+	and $t7, $t7, $c0
+	or $t0, $t0, $t4
+	or $t1, $t1, $t5
+	or $t2, $t2, $t6
+	or $t3, $t3, $t7
+
+
+	// Store results
+	sd $t0, 0($i0)
+	sd $t1, 8($i0)
+	sd $t2, 16($i0)
+	sd $t3, 24($i0)
+___
+}
+
+sub bn_mod_sub() {
+# returns r = ( a - b ) mod p, where p is a predefined polynomial modulus
+# Input: $i1 = address of operand a, $i2 = address of operand b
+# Output: $i0 = address for result storage
+# Dependencies: $mod = address of modulus p (passed via parameter)
+# Register usage: $t0-$t7: data storage registers, $c0-$c3: carry/borrow flags
+    my $mod = shift;
+$code.=<<___;
+	// Load inputs
+	ld $t0, 0($i1)
+	ld $t1, 8($i1)
+	ld $t2, 16($i1)
+	ld $t3, 24($i1)
+
+	ld $t4, 0($i2)
+	ld $t5, 8($i2)
+	ld $t6, 16($i2)
+	ld $t7, 24($i2)
+
+	// Subtraction
+	sltu $c3, $t0, $t4  //borrow
+	sub $t0, $t0, $t4
+
+	sltu $c1, $t1, $t5
+	sub $t1, $t1, $t5
+	sltu $c2, $t1, $c3
+	sub $t1, $t1, $c3
+	add $c3, $c2, $c1
+
+	sltu $c1, $t2, $t6
+	sub $t2, $t2, $t6
+	sltu $c2, $t2, $c3
+	sub $t2, $t2, $c3
+	add $c3, $c2, $c1
+
+	sltu $c1, $t3, $t7
+	sub $t3, $t3, $t7
+	sltu $c2, $t3, $c3
+	sub $t3, $t3, $c3
+	add $c3, $c2, $c1
+
+	// Load polynomial
+	la $i2, $mod
+	ld $t4, 0($i2)
+	ld $t5, 8($i2)
+	ld $t6, 16($i2)
+	ld $t7, 24($i2)
+
+	// Add polynomial
+	add $t4, $t0, $t4
+	sltu $c0, $t4, $t0
+
+	add $t5, $t1, $t5
+	sltu $c1, $t5, $t1
+	add $t5, $t5, $c0
+	sltu $c0, $t5, $c0
+	add $c0, $c0, $c1
+
+	add $t6, $t2, $t6
+	sltu $c1, $t6, $t2
+	add $t6, $t6, $c0
+	sltu $c0, $t6, $c0
+	add $c0, $c0, $c1
+
+	add $t7, $t3, $t7
+	add $t7, $t7, $c0
+
+	negw $c1, $c3
+	addw $c3, $c3, -1
+
+	and $t0, $t0, $c3
+	and $t1, $t1, $c3
+	and $t2, $t2, $c3
+	and $t3, $t3, $c3
+	and $t4, $t4, $c1
+	and $t5, $t5, $c1
+	and $t6, $t6, $c1
+	and $t7, $t7, $c1
+	or $t0, $t0, $t4
+	or $t1, $t1, $t5
+	or $t2, $t2, $t6
+	or $t3, $t3, $t7
+
+	sd $t0, 0($i0)
+	sd $t1, 8($i0)
+	sd $t2, 16($i0)
+	sd $t3, 24($i0)
+___
+}
+
+sub bn_mod_div_by_2() {
+# returns r = ( a / 2 ) mod p, (if a_is_odd ? a + p : a) >> 1, where p is a predefined polynomial modulus
+# Input: $i1 = address of operand a
+# Output: $i0 = address for result storage
+# Dependencies: $mod = address of modulus k = (p + 1) / 2 (passed via parameter)
+# Register usage: $t0-$t7: data storage registers, $c0-$c3: carry/borrow flags
+# Principle:
+#     if a is even: 0 <= a / 2 < p, ( a / 2 ) mod p = a / 2
+#     if a is odd: ( a / 2 ) mod p = ( a + p ) >> 1, k = (p + 1) / 2, ( a / 2 ) mod p = a >> 1 + k
+    my $mod = shift;
+$code.=<<___;
+	// Load inputs
+	ld $t0, 0($i1)
+	ld $t1, 8($i1)
+	ld $t2, 16($i1)
+	ld $t3, 24($i1)
+
+	// Save the least significant bit, is odd?
+	andi $c0, $t0, 0x1
+
+	// Right shift 1
+	slli $t4, $t1, 63
+	srli $t0, $t0, 1
+	or $t0, $t0, $t4
+	slli $t5, $t2, 63
+	srli $t1, $t1, 1
+	or $t1, $t1, $t5
+	slli $t6, $t3, 63
+	srli $t2, $t2, 1
+	or $t2, $t2, $t6
+	srli $t3, $t3, 1
+
+	// Load mod
+	la $i2, $mod
+	ld $t4, 0($i2)
+	ld $t5, 8($i2)
+	ld $t6, 16($i2)
+	ld $t7, 24($i2)
+
+	sub $c1, zero, $c0  //if even, p clear to 0
+
+	and $t4, $t4, $c1
+	and $t5, $t5, $c1
+	and $t6, $t6, $c1
+	and $t7, $t7, $c1
+
+	add $t0, $t0, $t4
+	sltu $c0, $t0, $t4
+
+	add $t1, $t1, $t5
+	sltu $c1, $t1, $t5
+	add $t1, $t1, $c0
+	sltu $c0, $t1, $c0
+	add $c0, $c0, $c1
+
+	add $t2, $t2, $t6
+	sltu $c1, $t2, $t6
+	add $t2, $t2, $c0
+	sltu $c0, $t2, $c0
+	add $c0, $c0, $c1
+
+	add $t3, $t3, $t7
+	add $t3, $t3, $c0
+
+	sd $t0, 0($i0)
+	sd $t1, 8($i0)
+	sd $t2, 16($i0)
+	sd $t3, 24($i0)
+___
+}
+
+{
+$code.=<<___;
+
+.section .rodata
+.p2align 5
+// The polynomial p
+.type .Lpoly,\@object
+.Lpoly:
+.dword	0xffffffffffffffff,0xffffffff00000000,0xffffffffffffffff,0xfffffffeffffffff
+
+// The order of polynomial n
+.type .Lord,\@object
+.Lord:
+.dword	0x53bbf40939d54123,0x7203df6b21c6052b,0xffffffffffffffff,0xfffffffeffffffff
+
+// (p + 1) / 2
+.type .Lpoly_div_2,\@object
+.Lpoly_div_2:
+.dword	0x8000000000000000,0xffffffff80000000,0xffffffffffffffff,0x7fffffff7fffffff
+
+// (n + 1) / 2
+.type .Lord_div_2,\@object
+.Lord_div_2:
+.dword	0xa9ddfa049ceaa092,0xb901efb590e30295,0xffffffffffffffff,0x7fffffff7fffffff
+.previous
+
+// void bn_rshift1(BN_ULONG *a);
+.globl	bn_rshift1
+.type	bn_rshift1,%function
+.p2align 5
+bn_rshift1:
+	// Load inputs
+	ld $t0, 0($i0)
+	ld $t1, 8($i0)
+	ld $t2, 16($i0)
+	ld $t3, 24($i0)
+
+	// Right shift 1
+	slli $t4, $t1, 63
+	srli $t0, $t0, 1
+	or $t0, $t0, $t4
+	slli $t5, $t2, 63
+	srli $t1, $t1, 1
+	or $t1, $t1, $t5
+	slli $t6, $t3, 63
+	srli $t2, $t2, 1
+	or $t2, $t2, $t6
+	srli $t7, $t3, 1
+
+	// Store results
+	sd $t0, 0($i0)
+	sd $t1, 8($i0)
+	sd $t2, 16($i0)
+	sd $t7, 24($i0)
+
+	ret
+.size bn_rshift1,.-bn_rshift1
+
+// void bn_sub(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b);
+.globl	bn_sub
+.type	bn_sub,%function
+.p2align 5
+bn_sub:
+	// Load inputs
+	ld $t0, 0($i1)
+	ld $t1, 8($i1)
+	ld $t2, 16($i1)
+	ld $t3, 24($i1)
+
+	ld $t4, 0($i2)
+	ld $t5, 8($i2)
+	ld $t6, 16($i2)
+	ld $t7, 24($i2)
+
+	// Subtraction
+	sltu $c3, $t0, $t4  //borrow
+	sub $t0, $t0, $t4
+
+	sltu $c1, $t1, $t5
+	sub $t1, $t1, $t5
+	sltu $c0, $t1, $c3
+	sub $t1, $t1, $c3
+	add $c3, $c1, $c0
+
+	sltu $c2, $t2, $t6
+	sub $t2, $t2, $t6
+	sltu $c1, $t2, $c3
+	sub $t2, $t2, $c3
+	add $c2, $c2, $c1
+
+	sub $t3, $t3, $t7
+	sub $t3, $t3, $c2
+
+	// Store results
+	sd $t0, 0($i0)
+	sd $t1, 8($i0)
+	sd $t2, 16($i0)
+	sd $t3, 24($i0)
+
+	ret
+.size bn_sub,.-bn_sub
+
+// void ecp_sm2p256_mul_by_3(BN_ULONG *r,const BN_ULONG *a);
+.globl	ecp_sm2p256_mul_by_3
+.type	ecp_sm2p256_mul_by_3,%function
+.p2align 5
+ecp_sm2p256_mul_by_3:
+// returns r = ( a * 3 ) mod p, where p is a predefined polynomial modulus .Lpoly
+// Input: $i1 = address of operand a
+// Output: $i0 = address for result storage
+// Register usage: $t0-$t7,$s0-$s7: data storage registers, $c0-$c3: carry/borrow flags
+___
+$code.= save_regs();
+$code.=<<___;
+	// Load inputs
+	ld $t0, 0($i1)
+	ld $t1, 8($i1)
+	ld $t2, 16($i1)
+	ld $t3, 24($i1)
+
+	// 2*a
+	add $t4, $t0, $t0
+	sltu $c0, $t4, $t0
+
+	slli $t5, $t1, 1
+	sltu $c1, $t5, $t1
+	add $t5, $t5, $c0
+
+	slli $t6, $t2, 1
+	sltu $c3, $t6, $t2
+	add $t6, $t6, $c1
+
+	slli $t7, $t3, 1
+	sltu $c0, $t7, $t3
+	add $t7, $t7, $c3
+
+	la $i2, .Lpoly
+	ld $s0, 0($i2)
+	ld $s1, 8($i2)
+	ld $s2, 16($i2)
+	ld $s3, 24($i2)
+
+	// Sub polynomial
+	sltu $c3, $t4, $s0
+	sub $s4, $t4, $s0
+
+	sltu $c1, $t5, $c3
+	sub $s5, $t5, $c3
+	sltu $c3, $s5, $s1
+	sub $s5, $s5, $s1
+	add $c3, $c3, $c1
+
+	sltu $c1, $t6, $c3
+	sub $s6, $t6, $c3
+	sltu $c3, $s6, $s2
+	sub $s6, $s6, $s2
+	add $c3, $c3, $c1
+
+	sltu $c1, $t7, $c3
+	sub $s7, $t7, $c3
+	sltu $c3, $s7, $s3
+	sub $s7, $s7, $s3
+	add $c3, $c3, $c1
+
+	slt $c0, $c0, $c3
+	negw $c1, $c0
+	addw $c0, $c0, -1
+
+	and $t4, $t4, $c1
+	and $t5, $t5, $c1
+	and $t6, $t6, $c1
+	and $t7, $t7, $c1
+	and $s4, $s4, $c0
+	and $s5, $s5, $c0
+	and $s6, $s6, $c0
+	and $s7, $s7, $c0
+	or $t4, $t4, $s4
+	or $t5, $t5, $s5
+	or $t6, $t6, $s6
+	or $t7, $t7, $s7
+
+	// 3*a
+	add $t4, $t4, $t0
+	sltu $c0, $t4, $t0
+
+	add $t5, $t5, $t1
+	sltu $c1, $t5, $t1
+	add $t5, $t5, $c0
+	sltu $c0, $t5, $c0
+	add $c0, $c0, $c1
+
+	add $t6, $t6, $t2
+	sltu $c1, $t6, $t2
+	add $t6, $t6, $c0
+	sltu $c0, $t6, $c0
+	add $c0, $c0, $c1
+
+	add $t7, $t7, $t3
+	sltu $c1, $t7, $t3
+	add $t7, $t7, $c0
+	sltu $c0, $t7, $c0
+	add $c0, $c0, $c1
+
+	// Sub polynomial
+	sltu $c3, $t4, $s0
+ 	sub $s4, $t4, $s0
+
+	sltu $c1, $t5, $c3
+	sub $s5, $t5, $c3
+	sltu $c3, $s5, $s1
+	sub $s5, $s5, $s1
+	add $c3, $c3, $c1
+
+	sltu $c1, $t6, $c3
+	sub $s6, $t6, $c3
+	sltu $c3, $s6, $s2
+	sub $s6, $s6, $s2
+	add $c3, $c3, $c1
+
+	sltu $c1, $t7, $c3
+	sub $s7, $t7, $c3
+	sltu $c3, $s7, $s3
+	sub $s7, $s7, $s3
+	add $c3, $c3, $c1
+
+	slt $c0, $c0, $c3
+	negw $c1, $c0
+	addw $c0, $c0, -1
+
+	and $t4, $t4, $c1
+	and $t5, $t5, $c1
+	and $t6, $t6, $c1
+	and $t7, $t7, $c1
+	and $s4, $s4, $c0
+	and $s5, $s5, $c0
+	and $s6, $s6, $c0
+	and $s7, $s7, $c0
+	or $t4, $t4, $s4
+	or $t5, $t5, $s5
+	or $t6, $t6, $s6
+	or $t7, $t7, $s7
+
+	// Store results
+	sd $t4, 0($i0)
+	sd $t5, 8($i0)
+	sd $t6, 16($i0)
+	sd $t7, 24($i0)
+___
+$code.= load_regs();
+$code.=<<___;
+	ret
+.size ecp_sm2p256_mul_by_3,.-ecp_sm2p256_mul_by_3
+
+
+// void ecp_sm2p256_add(BN_ULONG *r,const BN_ULONG *a,const BN_ULONG *b);
+.globl	ecp_sm2p256_add
+.type	ecp_sm2p256_add,%function
+.p2align 5
+ecp_sm2p256_add:
+___
+    &bn_mod_add(".Lpoly");
+$code.=<<___;
+	ret
+.size ecp_sm2p256_add,.-ecp_sm2p256_add
+
+// void ecp_sm2p256_sub(BN_ULONG *r,const BN_ULONG *a,const BN_ULONG *b);
+.globl	ecp_sm2p256_sub
+.type	ecp_sm2p256_sub,%function
+.p2align 5
+ecp_sm2p256_sub:
+___
+    &bn_mod_sub(".Lpoly");
+$code.=<<___;
+	ret
+.size ecp_sm2p256_sub,.-ecp_sm2p256_sub
+
+// void ecp_sm2p256_sub_mod_ord(BN_ULONG *r,const BN_ULONG *a,const BN_ULONG *b);
+.globl	ecp_sm2p256_sub_mod_ord
+.type	ecp_sm2p256_sub_mod_ord,%function
+.p2align 5
+ecp_sm2p256_sub_mod_ord:
+___
+    &bn_mod_sub(".Lord");
+$code.=<<___;
+	ret
+.size ecp_sm2p256_sub_mod_ord,.-ecp_sm2p256_sub_mod_ord
+
+// void ecp_sm2p256_div_by_2(BN_ULONG *r,const BN_ULONG *a);
+.globl	ecp_sm2p256_div_by_2
+.type	ecp_sm2p256_div_by_2,%function
+.p2align 5
+ecp_sm2p256_div_by_2:
+___
+    &bn_mod_div_by_2(".Lpoly_div_2");
+$code.=<<___;
+	ret
+.size ecp_sm2p256_div_by_2,.-ecp_sm2p256_div_by_2
+
+// void ecp_sm2p256_div_by_2_mod_ord(BN_ULONG *r,const BN_ULONG *a);
+.globl	ecp_sm2p256_div_by_2_mod_ord
+.type	ecp_sm2p256_div_by_2_mod_ord,%function
+.p2align 5
+ecp_sm2p256_div_by_2_mod_ord:
+___
+    &bn_mod_div_by_2(".Lord_div_2");
+$code.=<<___;
+	ret
+.size ecp_sm2p256_div_by_2_mod_ord,.-ecp_sm2p256_div_by_2_mod_ord
+
+.macro RDC
+// Fast Modular reduction of 512 bits in t7..t0 mod p
+// See https://en.wikipedia.org/wiki/Solinas_prime#Modular_reduction_algorithm
+//
+// For SM2 p = 2^256 -2^224 - 2^96 + 2^64 - 1
+//
+// p is a Generalized Mersenne prime of the form
+// p = 2^(32*8) - (2^(32*7) + 2^(32*3) - 2^(32*2) + 2^(32*0))
+//
+// Giving f(x) = x^7 + x^3 - x^2 + 1 (for x = 2^32)
+//
+// For j = 0 to 7
+//  sum(a(j) * x^j) = (s0 s1 .. s7) + ((s8 s9 .. s15))[matrix of coefficients][1 x x^2.. x^7]
+//
+// where the higher order terms can be expressed as
+//    x^8 ~= x^7 + x^3 - x^2 + 1
+//    x^9 ~= x * x^8 ~= x * (x^7 + x^3 - x^2 + 1)
+//       ~= x^8 + x^4 - x^3 + x mod p ~= x^7 + x^3 - x^2 + 1 + x^4 - x^3 + x
+//       ~= x^7 + x^4 - x^2 + x + 1
+//    Similarly:
+//    x^10 ~= x * x^9 ~= x * (x^7 + x^4 - x^2 + x + 1) ~= (x^8 + x^5 - x^3 + x2 + x)
+//         ~= x^7 + x^5 + x + 1
+//    x^11 ~= x^8 + x^6 + x^2 + x
+//         ~= x^7 + x^6 + x^3 + x + 1
+//    x^12 ~= x^8 + x^7 + x^4 + x^2 + x
+//         ~= 2x^7 + x^4 + x^3 + x + 1
+//    x^13 ~= 2x^8 + x^5 + x^4 + x^2 + x
+//         ~= 2x^7 + x^5 + x^4 + 2x^3 - x^2 + x + 2
+//    x^14 ~= 2x^8 + x^6 + x^5 + 2x^4 - x^3 + x^2 + 2x
+//         ~= 2x^7 + x^6 + x^5 + 2x^4 + x^3 - x^2 + 2x + 2
+//    x^15 ~= 2x^8 + x^7 + x^6 + 2x^5 + x^4 - x^3 + 2x^2 + 2x
+//         ~= 3x^7 + x^6 + 2x^5 + x^4 + x^3 + 2x + 2
+// ====>
+//      x^0     x^1     x^2     x^3     x^4     x^5     x^6     x^7
+//------------------------------------------------------------------
+// x^8      1       0      -1       1       0       0       0       1
+// x^9      1       1      -1       0       1       0       0       1
+// x^10     1       1       0       0       0       1       0       1
+// x^11     1       1       0       1       0       0       1       1
+// x^12     1       1       0       1       1       0       0       2
+// x^13     2       1      -1       2       1       1       0       2
+// x^14     2       2      -1       1       2       1       1       2
+// x^15     2       2       0       1       1       2       1       3
+// ====>
+// c0 = x0 + x8 + x9 + x10 + x11 + x12 + 2*x13 + 2*x14 + 2*x15
+// c1 = x1 + 0 + x9 + x10 + x11 + x12 + x13 + 2*x14 + 2*x15
+// c2 = x2 - x8 - x9 + 0 + 0 + 0 - x13 - x14 + 0
+// c3 = x3 + x8 + 0 + 0 + x11 + x12 + 2*x13 + x14 + x15
+// c4 = x4 + 0 + x9 + 0 + 0 + x12 + x13 + 2*x14 + x15
+// c5 = x5 + 0 + 0 + x10 + 0 + 0 + x13 + x14 + 2*x15
+// c6 = x6 + 0 + 0 + 0 + x11 + 0 + 0 + x14 + x15
+// c7 = x7 + x8 + x9 + x10 + x11 + 2*x12 + 2*x13 + 2*x14 + 3*x15
+// ===>
+// The input values are 8 64 bit values t0..t7
+// t4-t7 can be represented as 16*32 bit values s0..s7
+// a = |  t7   | ... | t0  |, where ti are 64-bit quantitiet
+//   = | s7| s6| ... |--|--|, where ai are 32-bit quantitiet
+// |    t7     |    t6     |    t5     |    t4     |
+// |  s7 |  s6 |  s5 |  s4 |  s3 |  s2 | s1  | s0  |
+// |    t3     |    t2     |    t1     |    t0     |
+// |           |           |           |           |
+// =================================================
+// |  s0 |  s3 |  s2 | s1  |  s0 |   0 |    t4     | (+)
+// |  s1 |  s7 |    t6     |  s3 |   0 |  s2 |  s1 | (+)
+// |  s2 |   0 |  s6 |  s5 |  s4 |   0 |    t5     | (+)
+// |  s3 |   0 |    t7     |  s5 |   0 |  s4 |  s3 | (+)
+// |  s4 |   0 |    t7     |  s5 |   0 |    t6     | (+)
+// |  s4 |   0 |   0 |  s7 |  s6 |   0 |  s6 |  s5 | (+)
+// |  s5 |   0 |   0 |   0 |  s7 |   0 |  s6 |  s5 | (+)
+// |  s5 |   0 |   0 |   0 |   0 |   0 |    t7     | (+)
+// |  s6 |   0 |   0 |   0 |   0 |   0 |    t7     | (+)
+// |  s6 |   0 |   0 |   0 |   0 |   0 |   0 |  s7 | (+)
+// |  s7 |   0 |   0 |   0 |   0 |   0 |   0 |  s7 | (+)
+// |  s7 |   0 |   0 |   0 |   0 |   0 |   0 |   0 | (+)
+// |    t7     |   0 |   0 |   0 |   0 |   0 |   0 | (+)
+// |   0 |   0 |   0 |   0 |   0 | s0  |   0 |   0 | (-)
+// |   0 |   0 |   0 |   0 |   0 | s1  |   0 |   0 | (-)
+// |   0 |   0 |   0 |   0 |   0 | s5  |   0 |   0 | (-)
+// |   0 |   0 |   0 |   0 |   0 | s6  |   0 |   0 | (-)
+// | U[7]| U[6]| U[5]| U[4]| U[3]| U[2]| U[1]| U[0]|
+// |  t7 |  t6 |  t5 |  t4 |  s3 |  s2 |   s1 | s0 | (+)
+// |    V[3]   |    V[2]   |    V[1]   |    V[0]   |
+
+	// 1. 64-bit addition
+	// s0=t6+t7+t7
+	add $s0, $t6, $t7
+	sltu $c0, $s0, $t6
+	add $s0, $s0, $t7
+	sltu $c1, $s0, $t7
+	add $s10, $c0, $c1  //t6+t7+t7 carry
+
+	// s2=t4+t5+s0
+	add $s2, $t4, $t5
+	sltu $c2, $s2, $t4
+	add $c0, $c2, $s10
+	add $s2, $s2, $s0
+	sltu $c3, $s2, $s0
+	add $c0, $c0, $c3  //t4+t5+t6+t7+t7 carry
+
+	// sum
+	add $t0, $t0, $s2 // t0 += (t4 + t5 + t6 + 2 * t7)
+	sltu $c1, $t0, $s2
+	add $t1, $t1, $c0
+	sltu $c0, $t1, $c0
+	add $t1, $t1, $c1
+	sltu $c1, $t1, $c1
+	add $c0, $c0, $c1
+	add $t2, $t2, $s0  //t2 += t6 + 2 * t7
+	sltu $c2, $t2, $s0
+	add $t2, $t2, $c0
+	sltu $c0, $t2, $c0
+	add $c0, $c0, $c2
+	add $t3, $t3, $t7 // t3 += t7
+	sltu $c1, $t3, $t7
+	add $t3, $t3, $c0
+	sltu $c0, $t3, $c0
+	add $c0, $c0, $c1
+	add $t3, $t3, $s10
+	sltu $c1, $t3, $s10
+	add $s8, $c0, $c1  // s8 = carry from t3
+
+	// 2. 64-bit to 32-bit spread
+	zext.w $s0, $t4
+	zext.w $s2, $t5
+	zext.w $s4, $t6
+	zext.w $s6, $t7
+
+	srli $s1, $t4, 32
+	srli $s3, $t5, 32
+	srli $s5, $t6, 32
+	srli $s7, $t7, 32
+
+	// 3. 32-bit addition
+	add $c0, $s4, $s6
+	add $c1, $s5, $s7
+	add $c2, $s0, $s1
+	add $t5, $s6, $s2  // t5 :s2 + s6
+	add $t6, $s7, $s3  // t6: s3 + s7
+	add $s4, $c1, $c0  // s4 + s5 + s6 + s7
+	add $s2, $s2, $s4
+	add $s2, $s2, $s4
+	add $c3, $s3, $c2
+	add $t7, $s2, $c3  //  t7: s0 + s1 + s2 + s3 + 2*(s4 + s5 + s6 + s7)
+	add $s4, $s4, $s5
+	add $s4, $s4, $s3
+	add $s4, $s4, $s0  // s0 + s3 + s4 + s5*2 + s6 + s7
+	add $c2, $c2, $s6
+	add $s2, $c2, $s5  // s2: s0 + s1 + s5 + s6
+	add $t4, $s1, $c1  // t4: s1 +s5 +s7
+	add $s3, $s3, $t4
+	add $s0, $s3, $c1  // s0: s1 + s3 + (s5 + s7)*2
+	add $s1, $c0, $t5  // s1: s2 + s4 + s6*2
+	mv $s3, $s4   // s3: s4 + s5 + s6 + s7
+
+	// 4. 32-bit to 64-bit
+	slli $s9, $s1, 32
+	slli $c0, $s3, 32
+	srli $c1, $s1, 32
+	or $s1, $c1, $c0
+	slli $c2, $t5, 32
+	srli $c3, $s3, 32
+	or $s3, $c3, $c2
+	slli $c0, $t7, 32
+	srli $c1, $t5, 32
+	or $t5, $c0, $c1
+	srli $t7, $t7, 32
+
+	// 5. 64-bit addition
+	add $s0, $s0, $s9
+	sltu $c0, $s0, $s9
+	add $s1, $s1, $c0
+	sltu $c1, $s1, $c0
+	add $s3, $t4, $s3
+	sltu $c2, $s3, $t4
+	add $s3, $s3, $c1
+	sltu $c3, $s3, $c1
+	add $c0, $c2, $c3
+	add $s4, $t6, $t5
+	sltu $c1, $s4, $t6
+	add $s4, $s4, $c0
+	sltu $c2, $s4, $c0
+	add $c0, $c1, $c2
+	add $c0, $c0, $s8
+	add $c0, $c0, $t7
+
+	// V[0]	s0
+	// V[1]	s1
+	// V[2]	s3
+	// V[3]	s4
+	// carry	c0
+	// sub	s2
+
+	// add with V0-V3
+	add $t0, $t0, $s0
+	sltu $c1, $t0, $s0
+	add $t1, $t1, $s1
+	sltu $c2, $t1, $s1
+	add $t1, $t1, $c1
+	sltu $c1, $t1, $c1
+	add $c1, $c1, $c2
+	add $t2, $t2, $s3
+	sltu $c2, $t2, $s3
+	add $t2, $t2, $c1
+	sltu $c1, $t2, $c1
+	add $c1, $c1, $c2
+	add $t3, $t3, $s4
+	sltu $c2, $t3, $s4
+	add $t3, $t3, $c1
+	sltu $c1, $t3, $c1
+	add $c1, $c1, $c2
+	add $c0, $c0, $c1
+	// sub with s2
+	sltu $c2, $t1, $s2
+	sub $t1, $t1, $s2
+	sltu $c3, $t2, $c2
+	sub $t2, $t2, $c2
+	sltu $c1, $t3, $c3
+	sub $t3, $t3, $c3
+	sub $c0, $c0, $c1
+
+	// 6. MOD
+	// First Mod
+	slli $s5, $c0, 32
+	sub $s6, $s5, $c0
+
+	add $t0, $t0, $c0
+	sltu $c1, $t0, $c0
+	add $t1, $t1, $s6
+	sltu $c2, $t1, $s6
+	add $t1, $t1, $c1
+	sltu $c1, $t1, $c1
+	add $c1, $c1, $c2
+	add $t2, $t2, $c1
+	sltu $c1, $t2, $c1
+	add $t3, $t3, $s5
+	sltu $c2, $t3, $s5
+	add $t3, $t3, $c1
+	sltu $c1, $t3, $c1
+	add $c0, $c2, $c1
+
+	// Last Mod
+	// return y - p if y > p else y
+	la $i2, .Lpoly
+	ld $s0, 0($i2)
+	ld $s1, 8($i2)
+	ld $s2, 16($i2)
+	ld $s3, 24($i2)
+
+	sltu $c1, $t0, $s0
+	sub $t4, $t0, $s0
+	sltu $c2, $t1, $s1
+	sub $t5, $t1, $s1
+	sltu $c3, $t5, $c1
+	sub $t5, $t5, $c1
+	add $c1, $c2, $c3
+	sltu $c2, $t2, $s2
+	sub $t6, $t2, $s2
+	sltu $c3, $t6, $c1
+	sub $t6, $t6, $c1
+	add $c1, $c2, $c3
+	sltu $c2, $t3, $s3
+	sub $t7, $t3, $s3
+	sltu $c3, $t7, $c1
+	sub $t7, $t7, $c1
+	add $c1, $c2, $c3
+
+	slt $c0, $c0, $c1
+	negw $c1, $c0
+	addw $c0, $c0, -1
+
+	and $t0, $t0, $c1
+	and $t1, $t1, $c1
+	and $t2, $t2, $c1
+	and $t3, $t3, $c1
+	and $t4, $t4, $c0
+	and $t5, $t5, $c0
+	and $t6, $t6, $c0
+	and $t7, $t7, $c0
+	or $t0, $t0, $t4
+	or $t1, $t1, $t5
+	or $t2, $t2, $t6
+	or $t3, $t3, $t7
+
+	sd $t0, 0($i0)
+	sd $t1, 8($i0)
+	sd $t2, 16($i0)
+	sd $t3, 24($i0)
+.endm
+
+
+// void ecp_sm2p256_mul(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b);
+.globl	ecp_sm2p256_mul
+.type	ecp_sm2p256_mul,%function
+.p2align 5
+ecp_sm2p256_mul:
+___
+$code.= save_regs();
+$code.=<<___;
+	// Load inputs
+	ld $t0, 0($i1)
+	ld $t1, 8($i1)
+	ld $t2, 16($i1)
+	ld $t3, 24($i1)
+	ld $t4, 0($i2)
+	ld $t5, 8($i2)
+	ld $t6, 16($i2)
+	ld $t7, 24($i2)
+// ### multiplication ###
+	// ========================
+	//             t3 t2 t1 t0
+	// *           t7 t6 t5 t4
+	// ------------------------
+	// +           t0 t0 t0 t0
+	//              *  *  *  *
+	//             t7 t6 t5 t4
+	//          t1 t1 t1 t1
+	//           *  *  *  *
+	//          t7 t6 t5 t4
+	//       t2 t2 t2 t2
+	//        *  *  *  *
+	//       t7 t6 t5 t4
+	//    t3 t3 t3 t3
+	//     *  *  *  *
+	//    t7 t6 t5 t4
+	// ------------------------
+	// t7 t6 t5 t4 t3 t2 t1 t0
+	// ========================
+
+// ### t0*t4 ###
+	mul $s0, $t0, $t4
+	mulhu $s1, $t0, $t4
+
+//	### t0*t5+t1*t4 ###
+	mul $s2, $t0, $t5
+	mulhu $s3, $t0, $t5
+	mul $s4, $t1, $t4
+	mulhu $s5, $t1, $t4
+
+	add $s1, $s1, $s2
+	sltu $c0, $s1, $s2
+	add $s3, $s3, $s5
+	sltu $c1, $s3, $s5
+
+	add $s1, $s1, $s4
+	sltu $c2, $s1, $s4
+	add $c0, $c0, $c2
+	add $s3, $s3, $c0
+	sltu $c0, $s3, $c0
+	add $c0, $c0, $c1
+
+//	### t0*t6+t1*t5+t2*t4 ###
+	mul $s2, $t0, $t6
+	mulhu $s4, $t0, $t6
+	mul $s5, $t1, $t5
+	mulhu $s6, $t1, $t5
+	mul $s7, $t2, $t4
+	mulhu $s8, $t2, $t4
+
+	add $s2, $s2, $s3
+	sltu $c1, $s2, $s3
+	add $s5, $s5, $s7
+	sltu $c3, $s5, $s7
+	add $s2, $s2, $s5
+	sltu $c2, $s2, $s5
+	add $c1, $c1, $c3
+	add $c0, $c0, $c2
+	add $c0, $c0, $c1
+
+	add $s4, $s4, $s6
+	sltu $c2, $s4, $s6
+	add $s8, $s8, $c0
+	sltu $c0, $s8, $c0
+	add $s4, $s4, $s8
+	sltu $c3, $s4, $s8
+	add $c0, $c2, $c0
+	add $c0, $c0, $c3
+
+//	### t0*t7+t1*t6+t2*t5+t3*t4 ###
+	mul $s3, $t0, $t7
+	mulhu $s5, $t0, $t7
+	mv $t0, $s0
+	mul $s9, $t1, $t6
+	mulhu $s10, $t1, $t6
+	mul $s0, $t2, $t5
+	mulhu $s6, $t2, $t5
+	mul $s7, $t3, $t4
+	mulhu $s8, $t3, $t4
+
+	add $s3, $s3, $s9
+	sltu $c1, $s3, $s9
+	add $s0, $s0, $s4
+	sltu $c2, $s0, $s4
+	add $c1, $c1, $c2
+	add $s3, $s3, $s7
+	sltu $c3, $s3, $s7
+	add $s3, $s3, $s0
+	sltu $c2, $s3, $s0
+	add $c3, $c3, $c2
+	add $c0, $c0, $c1
+	add $c0, $c0, $c3
+
+	add $s5, $s5, $s10
+	sltu $c1, $s5, $s10
+	add $s6, $s6, $s8
+	sltu $c2, $s6, $s8
+	add $c1, $c1, $c2
+	add $s5, $s5, $c0
+	sltu $c0, $s5, $c0
+	add $s5, $s5, $s6
+	sltu $c3, $s5, $s6
+	add $c0, $c0, $c1
+	add $c0, $c0, $c3
+
+//	### t1*t7+t2*t6+t3*t5 ###
+	mul $s4, $t1, $t7
+	mulhu $s6, $t1, $t7
+	mv $t1, $s1
+	mul $s0, $t2, $t6
+	mulhu $s1, $t2, $t6
+	mul $s7, $t3, $t5
+	mulhu $s8, $t3, $t5
+
+	add $s4, $s4, $s5
+	sltu $c1, $s4, $s5
+	add $s0, $s0, $s7
+	sltu $c2, $s0, $s7
+	add $c1, $c1, $c2
+	add $t4, $s4, $s0
+	sltu $c3, $t4, $s0
+	add $c1, $c1, $c3
+	add $c0, $c0, $c1
+
+	add $s6, $s6, $s1
+	sltu $c2, $s6, $s1
+	add $s8, $s8, $c0
+	sltu $c0, $s8, $c0
+	add $c0, $c0, $c2
+	add $s6, $s6, $s8
+	sltu $c3, $s6, $s8
+	add $c0, $c0, $c3
+
+//	### t2*t7+t3*t6 ###
+	mul $s0, $t2, $t7
+	mulhu $s1, $t2, $t7
+	mv $t2, $s2
+	mul $s5, $t3, $t6
+	mulhu $t6, $t3, $t6
+
+	add $s0, $s0, $s5
+	sltu $c1, $s0, $s5
+	add $t5, $s0, $s6
+	sltu $c2, $t5, $s6
+	add $c0, $c0, $c1
+	add $c0, $c0, $c2
+
+	add $t6, $t6, $s1
+	sltu $c1, $t6, $s1
+	add $t6, $t6, $c0
+	sltu $c0, $t6, $c0
+	add $c0, $c0, $c1
+
+//	### t3*t7 ###
+	mul $s2, $t3, $t7
+	mulhu $t7, $t3, $t7
+	mv $t3, $s3
+
+	add $t6, $t6, $s2
+	sltu $c1, $t6, $s2
+	add $t7, $t7, $c0
+	add $t7, $t7, $c1
+
+	// ### Reduction ###
+	RDC
+___
+$code.= load_regs();
+$code.=<<___;
+	ret
+.size ecp_sm2p256_mul,.-ecp_sm2p256_mul
+
+// void ecp_sm2p256_sqr(BN_ULONG *r, const BN_ULONG *a);
+.globl	ecp_sm2p256_sqr
+.type	ecp_sm2p256_sqr,%function
+.p2align 5
+ecp_sm2p256_sqr:
+___
+$code.= save_regs();
+$code.=<<___;
+	// Load inputs
+	ld $s0, 0($i1)
+	ld $s1, 8($i1)
+	ld $s2, 16($i1)
+	ld $s3, 24($i1)
+
+	// ========================
+	//             s3 s2 s1 s0
+	// *           s3 s2 s1 s0
+	// ------------------------
+	// +           s0 s0 s0 s0
+	//              *  *  *  *
+	//             s3 s2 s1 s0
+	//          s1 s1 s1 s1
+	//           *  *  *  *
+	//          s3 s2 s1 s0
+	//       s2 s2 s2 s2
+	//        *  *  *  *
+	//       s3 s2 s1 s0
+	//    s3 s3 s3 s3
+	//     *  *  *  *
+	//    s3 s2 s1 s0
+	// ------------------------
+	// t7 t6 t5 t4 t3 t2 t1 t0
+	// ========================
+
+// ### s0*s0 ###
+	mul $t0, $s0, $s0
+	mulhu $t1, $s0, $s0
+
+// ### s0*s1*2 ###
+	mul $s4, $s0, $s1
+	mulhu $s5, $s0, $s1
+
+	slli $s6, $s4, 1
+	sltu $c0, $s6, $s4
+	add $t1, $t1, $s6
+	sltu $c1, $t1, $s6
+	add $c0, $c0, $c1
+
+	slli $t2, $s5, 1
+	sltu $c2, $t2, $s5
+	add $t2, $t2, $c0
+	sltu $c3, $t2, $c0
+	add $c0, $c2, $c3
+
+// ### s0*s2*2+s1*s1 ###
+	mul $s7, $s0, $s2
+	mulhu $s8, $s0, $s2
+	mul $s9, $s1, $s1
+	mulhu $s10, $s1, $s1
+
+	slli $t4, $s7, 1
+	sltu $c1, $t4, $s7
+	add $t2, $t2, $s9
+	sltu $c2, $t2, $s9
+	add $c0, $c0, $c1
+	add $t2, $t2, $t4
+	sltu $c3, $t2, $t4
+	add $c0, $c0, $c2
+	add $c0, $c0, $c3
+
+	slli $t3, $s8, 1
+	sltu $c1, $t3, $s8
+	add $s10, $s10, $c0
+	sltu $c0, $s10, $c0
+	add $t3, $t3, $s10
+	sltu $c2, $t3, $s10
+	add $c0, $c0, $c1
+	add $c0, $c0, $c2
+
+// ### (s0*s3+s1*s2)*2 ###
+	mul $s4, $s0, $s3
+	mulhu $s5, $s0, $s3
+	mul $s6, $s1, $s2
+	mulhu $s7, $s1, $s2
+
+	add $s4, $s4, $s6
+	sltu $c1, $s4, $s6
+	slli $c1, $c1, 1
+	slli $s6, $s4, 1
+	sltu $c2, $s6, $s4
+	add $c1, $c1, $c2
+	add $t3, $t3, $s6
+	sltu $c3, $t3, $s6
+	add $c0, $c0, $c1
+	add $c0, $c0, $c3
+
+	add $s5, $s5, $s7
+	sltu $c1, $s5, $s7
+	slli $c1, $c1, 1
+	slli $s8, $s5, 1
+	sltu $c2, $s8, $s5
+	add $c1, $c1, $c2
+	add $t4, $c0, $s8
+	sltu $c3, $t4, $s8
+	add $c0, $c1, $c3
+
+// ### s1*s3*2+s2*s2 ###
+	mul $s4, $s1, $s3
+	mulhu $s5, $s1, $s3
+	mul $s6, $s2, $s2
+	mulhu $s7, $s2, $s2
+
+	slli $s8, $s4, 1
+	sltu $c1, $s8, $s4
+	add $c0, $c0, $c1
+	add $t4, $t4, $s6
+	sltu $c2, $t4, $s6
+	add $c0, $c0, $c2
+	add $t4, $t4, $s8
+	sltu $c3, $t4, $s8
+	add $c0, $c0, $c3
+
+	slli $s9, $s5, 1
+	sltu $c1, $s9, $s5
+	add $t5, $c0, $s7
+	sltu $c2, $t5, $s7
+	add $c0, $c1, $c2
+	add $t5, $t5, $s9
+	sltu $c3, $t5, $s9
+	add $c0, $c0, $c3
+
+// ### s2*s3*2 ###
+	mul $s4, $s2, $s3
+	mulhu $s5, $s2, $s3
+
+	slli $s6, $s4, 1
+	sltu $c1, $s6, $s4
+	add $t5, $t5, $s6
+	sltu $c2, $t5, $s6
+	add $c0, $c0, $c1
+	add $c0, $c0, $c2
+
+	slli $t6, $s5, 1
+	sltu $c3, $t6, $s5
+	add $t6, $t6, $c0
+	sltu $c0, $t6, $c0
+	add $c0, $c0, $c3
+
+// ### s3*s3 ###
+	mul $s8, $s3, $s3
+	mulhu $s9, $s3, $s3
+
+	add $t6, $t6, $s8
+	sltu $c1, $t6, $s8
+
+	add $t7, $s9, $c0
+	add $t7, $t7, $c1
+
+	// ### Reduction ###
+	RDC
+___
+$code.= load_regs();
+$code.=<<___;
+	ret
+.size ecp_sm2p256_sqr,.-ecp_sm2p256_sqr
+___
+}
+
+foreach (split("\n",$code)) {
+    s/\`([^\`]*)\`/eval $1/ge;
+
+    print $_,"\n";
+}
+close STDOUT or die "error closing STDOUT: $!";		# enforce flush
diff --git a/deps/openssl/openssl/crypto/ec/asm/x25519-ppc64.pl b/deps/openssl/openssl/crypto/ec/asm/x25519-ppc64.pl
index c1d9650c6bf..9f0e01f6ade 100755
--- a/deps/openssl/openssl/crypto/ec/asm/x25519-ppc64.pl
+++ b/deps/openssl/openssl/crypto/ec/asm/x25519-ppc64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2018-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -7,10 +7,10 @@
 # https://www.openssl.org/source/license.html
 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # X25519 lower-level primitives for PPC64.
diff --git a/deps/openssl/openssl/crypto/ec/asm/x25519-x86_64.pl b/deps/openssl/openssl/crypto/ec/asm/x25519-x86_64.pl
index 204c5185481..2842e34823a 100755
--- a/deps/openssl/openssl/crypto/ec/asm/x25519-x86_64.pl
+++ b/deps/openssl/openssl/crypto/ec/asm/x25519-x86_64.pl
@@ -7,10 +7,10 @@
 # https://www.openssl.org/source/license.html
 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # X25519 lower-level primitives for x86_64.
@@ -916,7 +916,7 @@ x25519_fe64_tobytes:
 ___
 }
 $code.=<<___;
-.asciz	"X25519 primitives for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"X25519 primitives for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame,
diff --git a/deps/openssl/openssl/crypto/ec/build.info b/deps/openssl/openssl/crypto/ec/build.info
index dbe69578ef5..6fe0a319326 100644
--- a/deps/openssl/openssl/crypto/ec/build.info
+++ b/deps/openssl/openssl/crypto/ec/build.info
@@ -59,6 +59,14 @@ IF[{- !$disabled{asm} -}]

   $ECASM_c64xplus=

+  IF[{- !$disabled{'sm2'} -}]
+    $ECASM_riscv64=ecp_sm2p256.c  ecp_sm2p256-riscv64.S
+    IF[{- !$disabled{'sm2-precomp'} -}]
+      $ECASM_riscv64=$ECASM_riscv64 ecp_sm2p256_table.c
+    ENDIF
+    $ECDEF_riscv64=ECP_SM2P256_ASM
+  ENDIF
+
   # Now that we have defined all the arch specific variables, use the
   # appropriate one, and define the appropriate macros
   IF[$ECASM_{- $target{asm_arch} -}]
@@ -85,7 +93,7 @@ IF[{- !$disabled{'ec_nistp_64_gcc_128'} -}]
   $COMMON=$COMMON ecp_nistp224.c ecp_nistp256.c ecp_nistp384.c ecp_nistp521.c ecp_nistputil.c
 ENDIF

-SOURCE[../../libcrypto]=$COMMON ec_ameth.c ec_pmeth.c \
+SOURCE[../../libcrypto]=$COMMON ec_ameth.c \
                         ec_err.c eck_prn.c \
                         ec_deprecated.c ec_print.c
 IF[{- !$disabled{'ecx'} -}]
@@ -139,3 +147,8 @@ IF[{- !$disabled{'sm2'} -}]
   GENERATE[ecp_sm2p256-armv8.S]=asm/ecp_sm2p256-armv8.pl
   INCLUDE[ecp_sm2p256-armv8.o]=..
 ENDIF
+
+IF[{- !$disabled{'sm2'} -}]
+  GENERATE[ecp_sm2p256-riscv64.S]=asm/ecp_sm2p256-riscv64.pl
+  INCLUDE[ecp_sm2p256-riscv64.o]=..
+ENDIF
diff --git a/deps/openssl/openssl/crypto/ec/curve25519.c b/deps/openssl/openssl/crypto/ec/curve25519.c
index c6886763aba..d6ab92b8c1c 100644
--- a/deps/openssl/openssl/crypto/ec/curve25519.c
+++ b/deps/openssl/openssl/crypto/ec/curve25519.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -236,6 +236,13 @@ static void x25519_scalar_mulx(uint8_t out[32], const uint8_t scalar[32],
         fe64_sub(tmp1, x2, z2);
         fe64_add(x2, x2, z2);
         fe64_add(z2, x3, z3);
+        /* The original copy in x25519_scalar_mult_generic uses argument order
+         * fe_mul(z3, tmp0, x2), with the input arguments swapped.
+         *
+         * The assembly implementation of fe64_mul used here runs faster in
+         * parallel with its nearby instructions when an earlier-computable
+         * input (like tmp0) is passed as the 2nd input because it consumes
+         * the 2nd input at a faster rate than the 1st input. */
         fe64_mul(z3, x2, tmp0);
         fe64_mul(z2, z2, tmp1);
         fe64_sqr(tmp0, tmp1);
diff --git a/deps/openssl/openssl/crypto/ec/curve448/arch_32/arch_intrinsics.h b/deps/openssl/openssl/crypto/ec/curve448/arch_32/arch_intrinsics.inc
similarity index 87%
rename from deps/openssl/openssl/crypto/ec/curve448/arch_32/arch_intrinsics.h
rename to deps/openssl/openssl/crypto/ec/curve448/arch_32/arch_intrinsics.inc
index 6a2bf46a53c..dab7a017659 100644
--- a/deps/openssl/openssl/crypto/ec/curve448/arch_32/arch_intrinsics.h
+++ b/deps/openssl/openssl/crypto/ec/curve448/arch_32/arch_intrinsics.inc
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2016 Cryptography Research, Inc.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -10,6 +10,8 @@
  * Originally written by Mike Hamburg
  */

+/* IWYU pragma: private, include word.h */
+
 #ifndef OSSL_CRYPTO_EC_CURVE448_ARCH_32_INTRINSICS_H
 #define OSSL_CRYPTO_EC_CURVE448_ARCH_32_INTRINSICS_H

diff --git a/deps/openssl/openssl/crypto/ec/curve448/arch_32/f_impl.h b/deps/openssl/openssl/crypto/ec/curve448/arch_32/f_impl.h
deleted file mode 100644
index 017844c11db..00000000000
--- a/deps/openssl/openssl/crypto/ec/curve448/arch_32/f_impl.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
- * Copyright 2014-2016 Cryptography Research, Inc.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- *
- * Originally written by Mike Hamburg
- */
-
-#ifndef OSSL_CRYPTO_EC_CURVE448_ARCH_32_F_IMPL_H
-#define OSSL_CRYPTO_EC_CURVE448_ARCH_32_F_IMPL_H
-
-#define GF_HEADROOM 2
-#define LIMB(x) ((x) & ((1 << 28) - 1)), ((x) >> 28)
-#define FIELD_LITERAL(a, b, c, d, e, f, g, h)                                      \
-    {                                                                              \
-        {                                                                          \
-            LIMB(a), LIMB(b), LIMB(c), LIMB(d), LIMB(e), LIMB(f), LIMB(g), LIMB(h) \
-        }                                                                          \
-    }
-
-#define LIMB_PLACE_VALUE(i) 28
-
-void gf_add_RAW(gf out, const gf a, const gf b)
-{
-    unsigned int i;
-
-    for (i = 0; i < NLIMBS; i++)
-        out->limb[i] = a->limb[i] + b->limb[i];
-}
-
-void gf_sub_RAW(gf out, const gf a, const gf b)
-{
-    unsigned int i;
-
-    for (i = 0; i < NLIMBS; i++)
-        out->limb[i] = a->limb[i] - b->limb[i];
-}
-
-void gf_bias(gf a, int amt)
-{
-    unsigned int i;
-    uint32_t co1 = ((1 << 28) - 1) * amt, co2 = co1 - amt;
-
-    for (i = 0; i < NLIMBS; i++)
-        a->limb[i] += (i == NLIMBS / 2) ? co2 : co1;
-}
-
-void gf_weak_reduce(gf a)
-{
-    uint32_t mask = (1 << 28) - 1;
-    uint32_t tmp = a->limb[NLIMBS - 1] >> 28;
-    unsigned int i;
-
-    a->limb[NLIMBS / 2] += tmp;
-    for (i = NLIMBS - 1; i > 0; i--)
-        a->limb[i] = (a->limb[i] & mask) + (a->limb[i - 1] >> 28);
-    a->limb[0] = (a->limb[0] & mask) + tmp;
-}
-
-#endif /* OSSL_CRYPTO_EC_CURVE448_ARCH_32_F_IMPL_H */
diff --git a/deps/openssl/openssl/crypto/ec/curve448/arch_64/arch_intrinsics.h b/deps/openssl/openssl/crypto/ec/curve448/arch_64/arch_intrinsics.inc
similarity index 85%
rename from deps/openssl/openssl/crypto/ec/curve448/arch_64/arch_intrinsics.h
rename to deps/openssl/openssl/crypto/ec/curve448/arch_64/arch_intrinsics.inc
index 09f0fdf34e4..6739ff36cb3 100644
--- a/deps/openssl/openssl/crypto/ec/curve448/arch_64/arch_intrinsics.h
+++ b/deps/openssl/openssl/crypto/ec/curve448/arch_64/arch_intrinsics.inc
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2016 Cryptography Research, Inc.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -10,9 +10,13 @@
  * Originally written by Mike Hamburg
  */

+/* IWYU pragma: private, include word.h */
+
 #ifndef OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H
 #define OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H

+#include <stdint.h>
+
 #include "internal/constant_time.h"

 #define ARCH_WORD_BITS 64
diff --git a/deps/openssl/openssl/crypto/ec/curve448/arch_64/f_impl.h b/deps/openssl/openssl/crypto/ec/curve448/arch_64/f_impl.h
deleted file mode 100644
index 3e27820171e..00000000000
--- a/deps/openssl/openssl/crypto/ec/curve448/arch_64/f_impl.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
- * Copyright 2014-2016 Cryptography Research, Inc.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- *
- * Originally written by Mike Hamburg
- */
-
-#ifndef OSSL_CRYPTO_EC_CURVE448_ARCH_64_F_IMPL_H
-#define OSSL_CRYPTO_EC_CURVE448_ARCH_64_F_IMPL_H
-
-#define GF_HEADROOM 9999 /* Everything is reduced anyway */
-#define FIELD_LITERAL(a, b, c, d, e, f, g, h) \
-    {                                         \
-        {                                     \
-            a, b, c, d, e, f, g, h            \
-        }                                     \
-    }
-
-#define LIMB_PLACE_VALUE(i) 56
-
-void gf_add_RAW(gf out, const gf a, const gf b)
-{
-    unsigned int i;
-
-    for (i = 0; i < NLIMBS; i++)
-        out->limb[i] = a->limb[i] + b->limb[i];
-
-    gf_weak_reduce(out);
-}
-
-void gf_sub_RAW(gf out, const gf a, const gf b)
-{
-    uint64_t co1 = ((1ULL << 56) - 1) * 2, co2 = co1 - 2;
-    unsigned int i;
-
-    for (i = 0; i < NLIMBS; i++)
-        out->limb[i] = a->limb[i] - b->limb[i] + ((i == NLIMBS / 2) ? co2 : co1);
-
-    gf_weak_reduce(out);
-}
-
-void gf_bias(gf a, int amt)
-{
-}
-
-void gf_weak_reduce(gf a)
-{
-    uint64_t mask = (1ULL << 56) - 1;
-    uint64_t tmp = a->limb[NLIMBS - 1] >> 56;
-    unsigned int i;
-
-    a->limb[NLIMBS / 2] += tmp;
-    for (i = NLIMBS - 1; i > 0; i--)
-        a->limb[i] = (a->limb[i] & mask) + (a->limb[i - 1] >> 56);
-    a->limb[0] = (a->limb[0] & mask) + tmp;
-}
-
-#endif /* OSSL_CRYPTO_EC_CURVE448_ARCH_64_F_IMPL_H */
diff --git a/deps/openssl/openssl/crypto/ec/curve448/curve448.c b/deps/openssl/openssl/crypto/ec/curve448/curve448.c
index 1a31f863559..e7255ef22bb 100644
--- a/deps/openssl/openssl/crypto/ec/curve448/curve448.c
+++ b/deps/openssl/openssl/crypto/ec/curve448/curve448.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2015-2016 Cryptography Research, Inc.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -502,7 +502,7 @@ struct smvt_control {
     int power, addend;
 };

-#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3))
+#if defined(__GNUC__)
 #define NUMTRAILINGZEROS __builtin_ctz
 #else
 #define NUMTRAILINGZEROS numtrailingzeros
diff --git a/deps/openssl/openssl/crypto/ec/curve448/ed448.h b/deps/openssl/openssl/crypto/ec/curve448/ed448.h
index 1c94649557c..b6f68e608d9 100644
--- a/deps/openssl/openssl/crypto/ec/curve448/ed448.h
+++ b/deps/openssl/openssl/crypto/ec/curve448/ed448.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2015-2016 Cryptography Research, Inc.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -13,6 +13,8 @@
 #ifndef OSSL_CRYPTO_EC_CURVE448_ED448_H
 #define OSSL_CRYPTO_EC_CURVE448_ED448_H

+#include <openssl/types.h>
+
 #include "point_448.h"

 /* Number of bytes in an EdDSA public key. */
@@ -30,128 +32,6 @@
 /* EdDSA decoding ratio. */
 #define C448_EDDSA_DECODE_RATIO (4 / 4)

-/*
- * EdDSA key generation.  This function uses a different (non-Decaf) encoding.
- *
- * pubkey (out): The public key.
- * privkey (in): The private key.
- */
-c448_error_t
-ossl_c448_ed448_derive_public_key(
-    OSSL_LIB_CTX *ctx,
-    uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
-    const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
-    const char *propq);
-
-/*
- * EdDSA signing.
- *
- * signature (out): The signature.
- * privkey (in): The private key.
- * pubkey (in):  The public key.
- * message (in):  The message to sign.
- * message_len (in):  The length of the message.
- * prehashed (in):  Nonzero if the message is actually the hash of something
- *                  you want to sign.
- * context (in):  A "context" for this signature of up to 255 bytes.
- * context_len (in):  Length of the context.
- *
- * For Ed25519, it is unsafe to use the same key for both prehashed and
- * non-prehashed messages, at least without some very careful protocol-level
- * disambiguation.  For Ed448 it is safe.
- */
-c448_error_t
-ossl_c448_ed448_sign(OSSL_LIB_CTX *ctx,
-    uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
-    const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
-    const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
-    const uint8_t *message, size_t message_len,
-    uint8_t prehashed, const uint8_t *context,
-    size_t context_len,
-    const char *propq);
-
-/*
- * EdDSA signing with prehash.
- *
- * signature (out): The signature.
- * privkey (in): The private key.
- * pubkey (in): The public key.
- * hash (in): The hash of the message.  This object will not be modified by the
- *            call.
- * context (in): A "context" for this signature of up to 255 bytes.  Must be the
- *               same as what was used for the prehash.
- * context_len (in): Length of the context.
- *
- * For Ed25519, it is unsafe to use the same key for both prehashed and
- * non-prehashed messages, at least without some very careful protocol-level
- * disambiguation.  For Ed448 it is safe.
- */
-c448_error_t
-ossl_c448_ed448_sign_prehash(OSSL_LIB_CTX *ctx,
-    uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
-    const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
-    const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
-    const uint8_t hash[64],
-    const uint8_t *context,
-    size_t context_len,
-    const char *propq);
-
-/*
- * EdDSA signature verification.
- *
- * Uses the standard (i.e. less-strict) verification formula.
- *
- * signature (in): The signature.
- * pubkey (in): The public key.
- * message (in): The message to verify.
- * message_len (in): The length of the message.
- * prehashed (in): Nonzero if the message is actually the hash of something you
- *                 want to verify.
- * context (in): A "context" for this signature of up to 255 bytes.
- * context_len (in): Length of the context.
- *
- * For Ed25519, it is unsafe to use the same key for both prehashed and
- * non-prehashed messages, at least without some very careful protocol-level
- * disambiguation.  For Ed448 it is safe.
- */
-c448_error_t
-ossl_c448_ed448_verify(OSSL_LIB_CTX *ctx,
-    const uint8_t
-        signature[EDDSA_448_SIGNATURE_BYTES],
-    const uint8_t
-        pubkey[EDDSA_448_PUBLIC_BYTES],
-    const uint8_t *message, size_t message_len,
-    uint8_t prehashed, const uint8_t *context,
-    uint8_t context_len,
-    const char *propq);
-
-/*
- * EdDSA signature verification.
- *
- * Uses the standard (i.e. less-strict) verification formula.
- *
- * signature (in): The signature.
- * pubkey (in): The public key.
- * hash (in): The hash of the message.  This object will not be modified by the
- *            call.
- * context (in): A "context" for this signature of up to 255 bytes.  Must be the
- *               same as what was used for the prehash.
- * context_len (in): Length of the context.
- *
- * For Ed25519, it is unsafe to use the same key for both prehashed and
- * non-prehashed messages, at least without some very careful protocol-level
- * disambiguation.  For Ed448 it is safe.
- */
-c448_error_t
-ossl_c448_ed448_verify_prehash(
-    OSSL_LIB_CTX *ctx,
-    const uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
-    const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
-    const uint8_t hash[64],
-    const uint8_t *context,
-    uint8_t context_len,
-    const char *propq);
-
 /*
  * EdDSA point encoding.  Used internally, exposed externally.
  * Multiplies by C448_EDDSA_ENCODE_RATIO first.
@@ -193,19 +73,4 @@ ossl_curve448_point_decode_like_eddsa_and_mul_by_ratio(
     curve448_point_t p,
     const uint8_t enc[EDDSA_448_PUBLIC_BYTES]);

-/*
- * EdDSA to ECDH private key conversion
- * Using the appropriate hash function, hash the EdDSA private key
- * and keep only the lower bytes to get the ECDH private key
- *
- * x (out): The ECDH private key as in RFC7748
- * ed (in): The EdDSA private key
- */
-c448_error_t
-ossl_c448_ed448_convert_private_key_to_x448(
-    OSSL_LIB_CTX *ctx,
-    uint8_t x[X448_PRIVATE_BYTES],
-    const uint8_t ed[EDDSA_448_PRIVATE_BYTES],
-    const char *propq);
-
 #endif /* OSSL_CRYPTO_EC_CURVE448_ED448_H */
diff --git a/deps/openssl/openssl/crypto/ec/curve448/eddsa.c b/deps/openssl/openssl/crypto/ec/curve448/eddsa.c
index f90ee2e82d1..1c375413aba 100644
--- a/deps/openssl/openssl/crypto/ec/curve448/eddsa.c
+++ b/deps/openssl/openssl/crypto/ec/curve448/eddsa.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2015-2016 Cryptography Research, Inc.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -62,7 +62,7 @@ static c448_error_t hash_init_with_dom(OSSL_LIB_CTX *ctx, EVP_MD_CTX *hashctx,
     const char *propq)
 {
     /* ASCII: "SigEd448", in hex for EBCDIC compatibility */
-    const char dom_s[] = "\x53\x69\x67\x45\x64\x34\x34\x38";
+    static const char dom_s[] = "\x53\x69\x67\x45\x64\x34\x34\x38";
     uint8_t dom[2];
     EVP_MD *shake256 = NULL;

@@ -89,22 +89,15 @@ static c448_error_t hash_init_with_dom(OSSL_LIB_CTX *ctx, EVP_MD_CTX *hashctx,
     return C448_SUCCESS;
 }

-/* In this file because it uses the hash */
-c448_error_t
-ossl_c448_ed448_convert_private_key_to_x448(
-    OSSL_LIB_CTX *ctx,
-    uint8_t x[X448_PRIVATE_BYTES],
-    const uint8_t ed[EDDSA_448_PRIVATE_BYTES],
-    const char *propq)
-{
-    /* pass the private key through oneshot_hash function */
-    /* and keep the first X448_PRIVATE_BYTES bytes */
-    return oneshot_hash(ctx, x, X448_PRIVATE_BYTES, ed,
-        EDDSA_448_PRIVATE_BYTES, propq);
-}
-
-c448_error_t
-ossl_c448_ed448_derive_public_key(
+/*
+ * EdDSA key generation.  This function uses a different (non-Decaf) encoding.
+ *
+ * pubkey (out): The public key.
+ * privkey (in): The private key.
+ * propq (in): The property query used to fetch SHAKE256.
+ */
+static c448_error_t
+c448_ed448_derive_public_key(
     OSSL_LIB_CTX *ctx,
     uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
     const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
@@ -151,8 +144,26 @@ ossl_c448_ed448_derive_public_key(
     return C448_SUCCESS;
 }

-c448_error_t
-ossl_c448_ed448_sign(OSSL_LIB_CTX *ctx,
+/*
+ * EdDSA signing.
+ *
+ * signature (out): The signature.
+ * privkey (in): The private key.
+ * pubkey (in):  The public key.
+ * message (in):  The message to sign.
+ * message_len (in):  The length of the message.
+ * prehashed (in):  Nonzero if the message is actually the hash of something
+ *                  you want to sign.
+ * context (in):  A "context" for this signature of up to 255 bytes.
+ * context_len (in):  Length of the context.
+ * propq (in):  The property query used to fetch SHAKE256.
+ *
+ * For Ed25519, it is unsafe to use the same key for both prehashed and
+ * non-prehashed messages, at least without some very careful protocol-level
+ * disambiguation.  For Ed448 it is safe.
+ */
+static c448_error_t
+c448_ed448_sign(OSSL_LIB_CTX *ctx,
     uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
     const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
     const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
@@ -259,19 +270,6 @@ err:
     return ret;
 }

-c448_error_t
-ossl_c448_ed448_sign_prehash(
-    OSSL_LIB_CTX *ctx,
-    uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
-    const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
-    const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
-    const uint8_t hash[64], const uint8_t *context,
-    size_t context_len, const char *propq)
-{
-    return ossl_c448_ed448_sign(ctx, signature, privkey, pubkey, hash, 64, 1,
-        context, context_len, propq);
-}
-
 static c448_error_t
 c448_ed448_pubkey_verify(const uint8_t *pub, size_t pub_len)
 {
@@ -283,8 +281,27 @@ c448_ed448_pubkey_verify(const uint8_t *pub, size_t pub_len)
     return ossl_curve448_point_decode_like_eddsa_and_mul_by_ratio(pk_point, pub);
 }

-c448_error_t
-ossl_c448_ed448_verify(
+/*
+ * EdDSA signature verification.
+ *
+ * Uses the standard (i.e. less-strict) verification formula.
+ *
+ * signature (in): The signature.
+ * pubkey (in): The public key.
+ * message (in): The message to verify.
+ * message_len (in): The length of the message.
+ * prehashed (in): Nonzero if the message is actually the hash of something you
+ *                 want to verify.
+ * context (in): A "context" for this signature of up to 255 bytes.
+ * context_len (in): Length of the context.
+ * propq (in): The property query used to fetch SHAKE256.
+ *
+ * For Ed25519, it is unsafe to use the same key for both prehashed and
+ * non-prehashed messages, at least without some very careful protocol-level
+ * disambiguation.  For Ed448 it is safe.
+ */
+static c448_error_t
+c448_ed448_verify(
     OSSL_LIB_CTX *ctx,
     const uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
     const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
@@ -365,25 +382,13 @@ ossl_c448_ed448_verify(
     return c448_succeed_if(ossl_curve448_point_eq(pk_point, r_point));
 }

-c448_error_t
-ossl_c448_ed448_verify_prehash(
-    OSSL_LIB_CTX *ctx,
-    const uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
-    const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
-    const uint8_t hash[64], const uint8_t *context,
-    uint8_t context_len, const char *propq)
-{
-    return ossl_c448_ed448_verify(ctx, signature, pubkey, hash, 64, 1, context,
-        context_len, propq);
-}
-
 int ossl_ed448_sign(OSSL_LIB_CTX *ctx, uint8_t *out_sig,
     const uint8_t *message, size_t message_len,
     const uint8_t public_key[57], const uint8_t private_key[57],
     const uint8_t *context, size_t context_len,
     const uint8_t phflag, const char *propq)
 {
-    return ossl_c448_ed448_sign(ctx, out_sig, private_key, public_key, message,
+    return c448_ed448_sign(ctx, out_sig, private_key, public_key, message,
                message_len, phflag, context, context_len,
                propq)
         == C448_SUCCESS;
@@ -405,7 +410,7 @@ int ossl_ed448_verify(OSSL_LIB_CTX *ctx,
     const uint8_t *context, size_t context_len,
     const uint8_t phflag, const char *propq)
 {
-    return ossl_c448_ed448_verify(ctx, signature, public_key, message,
+    return c448_ed448_verify(ctx, signature, public_key, message,
                message_len, phflag, context, (uint8_t)context_len,
                propq)
         == C448_SUCCESS;
@@ -414,7 +419,7 @@ int ossl_ed448_verify(OSSL_LIB_CTX *ctx,
 int ossl_ed448_public_from_private(OSSL_LIB_CTX *ctx, uint8_t out_public_key[57],
     const uint8_t private_key[57], const char *propq)
 {
-    return ossl_c448_ed448_derive_public_key(ctx, out_public_key, private_key,
+    return c448_ed448_derive_public_key(ctx, out_public_key, private_key,
                propq)
         == C448_SUCCESS;
 }
diff --git a/deps/openssl/openssl/crypto/ec/curve448/field.h b/deps/openssl/openssl/crypto/ec/curve448/field.h
index 5de942f0423..9c3b8a3f166 100644
--- a/deps/openssl/openssl/crypto/ec/curve448/field.h
+++ b/deps/openssl/openssl/crypto/ec/curve448/field.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2014 Cryptography Research, Inc.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -66,14 +66,107 @@ void gf_serialize(uint8_t serial[SER_BYTES], const gf x, int with_highbit);
 mask_t gf_deserialize(gf x, const uint8_t serial[SER_BYTES], int with_hibit,
     uint8_t hi_nmask);

+/* clang-format off */
 #define LIMBPERM(i) (i)
 #if (ARCH_WORD_BITS == 32)
-#include "arch_32/f_impl.h" /* Bring in the inline implementations */
+#define GF_HEADROOM 2
+#define LIMB(x) ((x) & ((1 << 28) - 1)), ((x) >> 28)
+#define FIELD_LITERAL(a, b, c, d, e, f, g, h)                                      \
+    {                                                                              \
+        {                                                                          \
+            LIMB(a), LIMB(b), LIMB(c), LIMB(d), LIMB(e), LIMB(f), LIMB(g), LIMB(h) \
+        }                                                                          \
+    }
+
+#define LIMB_PLACE_VALUE(i) 28
+
+void gf_add_RAW(gf out, const gf a, const gf b)
+{
+    unsigned int i;
+
+    for (i = 0; i < NLIMBS; i++)
+        out->limb[i] = a->limb[i] + b->limb[i];
+}
+
+void gf_sub_RAW(gf out, const gf a, const gf b)
+{
+    unsigned int i;
+
+    for (i = 0; i < NLIMBS; i++)
+        out->limb[i] = a->limb[i] - b->limb[i];
+}
+
+void gf_bias(gf a, int amt)
+{
+    unsigned int i;
+    uint32_t co1 = ((1 << 28) - 1) * amt, co2 = co1 - amt;
+
+    for (i = 0; i < NLIMBS; i++)
+        a->limb[i] += (i == NLIMBS / 2) ? co2 : co1;
+}
+
+void gf_weak_reduce(gf a)
+{
+    uint32_t mask = (1 << 28) - 1;
+    uint32_t tmp = a->limb[NLIMBS - 1] >> 28;
+    unsigned int i;
+
+    a->limb[NLIMBS / 2] += tmp;
+    for (i = NLIMBS - 1; i > 0; i--)
+        a->limb[i] = (a->limb[i] & mask) + (a->limb[i - 1] >> 28);
+    a->limb[0] = (a->limb[0] & mask) + tmp;
+}
 #define LIMB_MASK(i) (((1) << LIMB_PLACE_VALUE(i)) - 1)
 #elif (ARCH_WORD_BITS == 64)
-#include "arch_64/f_impl.h" /* Bring in the inline implementations */
+#define GF_HEADROOM 9999 /* Everything is reduced anyway */
+#define FIELD_LITERAL(a, b, c, d, e, f, g, h) \
+    {                                         \
+        {                                     \
+            a, b, c, d, e, f, g, h            \
+        }                                     \
+    }
+
+#define LIMB_PLACE_VALUE(i) 56
+
+void gf_add_RAW(gf out, const gf a, const gf b)
+{
+    unsigned int i;
+
+    for (i = 0; i < NLIMBS; i++)
+        out->limb[i] = a->limb[i] + b->limb[i];
+
+    gf_weak_reduce(out);
+}
+
+void gf_sub_RAW(gf out, const gf a, const gf b)
+{
+    uint64_t co1 = ((1ULL << 56) - 1) * 2, co2 = co1 - 2;
+    unsigned int i;
+
+    for (i = 0; i < NLIMBS; i++)
+        out->limb[i] = a->limb[i] - b->limb[i] + ((i == NLIMBS / 2) ? co2 : co1);
+
+    gf_weak_reduce(out);
+}
+
+void gf_bias(gf a, int amt)
+{
+}
+
+void gf_weak_reduce(gf a)
+{
+    uint64_t mask = (1ULL << 56) - 1;
+    uint64_t tmp = a->limb[NLIMBS - 1] >> 56;
+    unsigned int i;
+
+    a->limb[NLIMBS / 2] += tmp;
+    for (i = NLIMBS - 1; i > 0; i--)
+        a->limb[i] = (a->limb[i] & mask) + (a->limb[i - 1] >> 56);
+    a->limb[0] = (a->limb[0] & mask) + tmp;
+}
 #define LIMB_MASK(i) (((1ULL) << LIMB_PLACE_VALUE(i)) - 1)
 #endif
+/* clang-format on */

 static const gf ZERO = { { { 0 } } }, ONE = { { { 1 } } };

diff --git a/deps/openssl/openssl/crypto/ec/curve448/word.h b/deps/openssl/openssl/crypto/ec/curve448/word.h
index df533f2b36d..e795b57ac21 100644
--- a/deps/openssl/openssl/crypto/ec/curve448/word.h
+++ b/deps/openssl/openssl/crypto/ec/curve448/word.h
@@ -21,9 +21,9 @@
 #include "internal/constant_time.h"

 #ifdef INT128_MAX
-#include "arch_64/arch_intrinsics.h"
+#include "arch_64/arch_intrinsics.inc"
 #else
-#include "arch_32/arch_intrinsics.h"
+#include "arch_32/arch_intrinsics.inc"
 #endif

 #if (ARCH_WORD_BITS == 64)
diff --git a/deps/openssl/openssl/crypto/ec/ec2_oct.c b/deps/openssl/openssl/crypto/ec/ec2_oct.c
index dc58f97380a..9113ac60fdc 100644
--- a/deps/openssl/openssl/crypto/ec/ec2_oct.c
+++ b/deps/openssl/openssl/crypto/ec/ec2_oct.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2025 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -258,7 +258,7 @@ int ossl_ec_GF2m_simple_oct2point(const EC_GROUP *group, EC_POINT *point,
     point_conversion_form_t form;
     int y_bit, m;
     BIGNUM *x, *y, *yxi;
-    size_t field_len, enc_len;
+    int field_len, enc_len;
     int ret = 0;
 #ifndef FIPS_MODULE
     BN_CTX *new_ctx = NULL;
@@ -308,7 +308,7 @@ int ossl_ec_GF2m_simple_oct2point(const EC_GROUP *group, EC_POINT *point,
     field_len = (m + 7) / 8;
     enc_len = (form == POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;

-    if (len != enc_len) {
+    if (len != (size_t)enc_len) {
         ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
         return 0;
     }
diff --git a/deps/openssl/openssl/crypto/ec/ec2_smpl.c b/deps/openssl/openssl/crypto/ec/ec2_smpl.c
index 17f814e4c95..34a2d5a7411 100644
--- a/deps/openssl/openssl/crypto/ec/ec2_smpl.c
+++ b/deps/openssl/openssl/crypto/ec/ec2_smpl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -74,11 +74,11 @@ void ossl_ec_GF2m_simple_group_clear_finish(EC_GROUP *group)
  */
 int ossl_ec_GF2m_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src)
 {
-    if (!BN_copy(dest->field, src->field))
+    if (BN_copy(dest->field, src->field) == NULL)
         return 0;
-    if (!BN_copy(dest->a, src->a))
+    if (BN_copy(dest->a, src->a) == NULL)
         return 0;
-    if (!BN_copy(dest->b, src->b))
+    if (BN_copy(dest->b, src->b) == NULL)
         return 0;
     dest->poly[0] = src->poly[0];
     dest->poly[1] = src->poly[1];
@@ -103,7 +103,7 @@ int ossl_ec_GF2m_simple_group_set_curve(EC_GROUP *group,
     int ret = 0, i;

     /* group->field */
-    if (!BN_copy(group->field, p))
+    if (BN_copy(group->field, p) == NULL)
         goto err;
     i = BN_GF2m_poly2arr(group->field, group->poly, 6) - 1;
     if ((i != 5) && (i != 3)) {
@@ -142,17 +142,17 @@ int ossl_ec_GF2m_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p,
     int ret = 0;

     if (p != NULL) {
-        if (!BN_copy(p, group->field))
+        if (BN_copy(p, group->field) == NULL)
             return 0;
     }

     if (a != NULL) {
-        if (!BN_copy(a, group->a))
+        if (BN_copy(a, group->a) == NULL)
             goto err;
     }

     if (b != NULL) {
-        if (!BN_copy(b, group->b))
+        if (BN_copy(b, group->b) == NULL)
             goto err;
     }

@@ -255,11 +255,11 @@ void ossl_ec_GF2m_simple_point_clear_finish(EC_POINT *point)
  */
 int ossl_ec_GF2m_simple_point_copy(EC_POINT *dest, const EC_POINT *src)
 {
-    if (!BN_copy(dest->X, src->X))
+    if (BN_copy(dest->X, src->X) == NULL)
         return 0;
-    if (!BN_copy(dest->Y, src->Y))
+    if (BN_copy(dest->Y, src->Y) == NULL)
         return 0;
-    if (!BN_copy(dest->Z, src->Z))
+    if (BN_copy(dest->Z, src->Z) == NULL)
         return 0;
     dest->Z_is_one = src->Z_is_one;
     dest->curve_name = src->curve_name;
@@ -295,13 +295,13 @@ int ossl_ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP *group,
         return 0;
     }

-    if (!BN_copy(point->X, x))
+    if (BN_copy(point->X, x) == NULL)
         goto err;
     BN_set_negative(point->X, 0);
-    if (!BN_copy(point->Y, y))
+    if (BN_copy(point->Y, y) == NULL)
         goto err;
     BN_set_negative(point->Y, 0);
-    if (!BN_copy(point->Z, BN_value_one()))
+    if (BN_copy(point->Z, BN_value_one()) == NULL)
         goto err;
     BN_set_negative(point->Z, 0);
     point->Z_is_one = 1;
@@ -332,12 +332,12 @@ int ossl_ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group,
         return 0;
     }
     if (x != NULL) {
-        if (!BN_copy(x, point->X))
+        if (BN_copy(x, point->X) == NULL)
             goto err;
         BN_set_negative(x, 0);
     }
     if (y != NULL) {
-        if (!BN_copy(y, point->Y))
+        if (BN_copy(y, point->Y) == NULL)
             goto err;
         BN_set_negative(y, 0);
     }
@@ -393,18 +393,18 @@ int ossl_ec_GF2m_simple_add(const EC_GROUP *group, EC_POINT *r,
         goto err;

     if (a->Z_is_one) {
-        if (!BN_copy(x0, a->X))
+        if (BN_copy(x0, a->X) == NULL)
             goto err;
-        if (!BN_copy(y0, a->Y))
+        if (BN_copy(y0, a->Y) == NULL)
             goto err;
     } else {
         if (!EC_POINT_get_affine_coordinates(group, a, x0, y0, ctx))
             goto err;
     }
     if (b->Z_is_one) {
-        if (!BN_copy(x1, b->X))
+        if (BN_copy(x1, b->X) == NULL)
             goto err;
-        if (!BN_copy(y1, b->Y))
+        if (BN_copy(y1, b->Y) == NULL)
             goto err;
     } else {
         if (!EC_POINT_get_affine_coordinates(group, b, x1, y1, ctx))
@@ -655,9 +655,9 @@ int ossl_ec_GF2m_simple_make_affine(const EC_GROUP *group, EC_POINT *point,

     if (!EC_POINT_get_affine_coordinates(group, point, x, y, ctx))
         goto err;
-    if (!BN_copy(point->X, x))
+    if (BN_copy(point->X, x) == NULL)
         goto err;
-    if (!BN_copy(point->Y, y))
+    if (BN_copy(point->Y, y) == NULL)
         goto err;
     if (!BN_one(point->Z))
         goto err;
diff --git a/deps/openssl/openssl/crypto/ec/ec_ameth.c b/deps/openssl/openssl/crypto/ec/ec_ameth.c
index 33c9d94c008..e32055a06ca 100644
--- a/deps/openssl/openssl/crypto/ec/ec_ameth.c
+++ b/deps/openssl/openssl/crypto/ec/ec_ameth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -21,6 +21,7 @@
 #include <openssl/asn1t.h>
 #include "crypto/asn1.h"
 #include "crypto/evp.h"
+#include "crypto/ec_params.h"
 #include "crypto/x509.h"
 #include <openssl/core_names.h>
 #include <openssl/param_build.h>
@@ -214,19 +215,7 @@ static int ec_bits(const EVP_PKEY *pkey)

 static int ec_security_bits(const EVP_PKEY *pkey)
 {
-    int ecbits = ec_bits(pkey);
-
-    if (ecbits >= 512)
-        return 256;
-    if (ecbits >= 384)
-        return 192;
-    if (ecbits >= 256)
-        return 128;
-    if (ecbits >= 224)
-        return 112;
-    if (ecbits >= 160)
-        return 80;
-    return ecbits / 2;
+    return EC_GROUP_security_bits(EC_KEY_get0_group(pkey->pkey.ec));
 }

 static int ec_missing_parameters(const EVP_PKEY *pkey)
@@ -413,7 +402,7 @@ static int ec_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
         return EC_KEY_oct2key(evp_pkey_get0_EC_KEY_int(pkey), arg2, arg1, NULL);

     case ASN1_PKEY_CTRL_GET1_TLS_ENCPT:
-        return EC_KEY_key2buf(EVP_PKEY_get0_EC_KEY(pkey),
+        return (int)EC_KEY_key2buf(EVP_PKEY_get0_EC_KEY(pkey),
             POINT_CONVERSION_UNCOMPRESSED, arg2, NULL);

     default:
@@ -610,15 +599,20 @@ static int ec_pkey_import_from(const OSSL_PARAM params[], void *vpctx)
     EVP_PKEY_CTX *pctx = vpctx;
     EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(pctx);
     EC_KEY *ec = EC_KEY_new_ex(pctx->libctx, pctx->propquery);
+    EC_PARAMS p;

     if (ec == NULL) {
         ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
         return 0;
     }
+    if (!ec_pkey_import_from_decoder(params, &p)) {
+        EC_KEY_free(ec);
+        return 0;
+    }

-    if (!ossl_ec_group_fromdata(ec, params)
-        || !ossl_ec_key_otherparams_fromdata(ec, params)
-        || !ossl_ec_key_fromdata(ec, params, 1)
+    if (!ossl_ec_group_fromdata_parsed(ec, &p)
+        || !ossl_ec_key_otherparams_fromdata_parsed(ec, &p)
+        || !ossl_ec_key_fromdata_parsed(ec, &p, 1)
         || !EVP_PKEY_assign_EC_KEY(pkey, ec)) {
         EC_KEY_free(ec);
         return 0;
diff --git a/deps/openssl/openssl/crypto/ec/ec_asn1.c b/deps/openssl/openssl/crypto/ec/ec_asn1.c
index 6b44b8068f9..3d32c13616e 100644
--- a/deps/openssl/openssl/crypto/ec/ec_asn1.c
+++ b/deps/openssl/openssl/crypto/ec/ec_asn1.c
@@ -303,7 +303,7 @@ static int ec_asn1_group2curve(const EC_GROUP *group, X9_62_CURVE *curve)
     int ok = 0;
     BIGNUM *tmp_1 = NULL, *tmp_2 = NULL;
     unsigned char *a_buf = NULL, *b_buf = NULL;
-    size_t len;
+    int len;

     if (!group || !curve || !curve->a || !curve->b)
         return 0;
@@ -324,7 +324,7 @@ static int ec_asn1_group2curve(const EC_GROUP *group, X9_62_CURVE *curve)
      * definition of Curve, C.1's definition of FieldElement, and 2.3.5's
      * definition of how to encode the field elements.
      */
-    len = ((size_t)EC_GROUP_get_degree(group) + 7) / 8;
+    len = (EC_GROUP_get_degree(group) + 7) / 8;
     if ((a_buf = OPENSSL_malloc(len)) == NULL
         || (b_buf = OPENSSL_malloc(len)) == NULL)
         goto err;
@@ -348,9 +348,8 @@ static int ec_asn1_group2curve(const EC_GROUP *group, X9_62_CURVE *curve)
                 ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
                 goto err;
             }
-        ossl_asn1_string_set_bits_left(curve->seed, 0);
-        if (!ASN1_BIT_STRING_set(curve->seed, group->seed,
-                (int)group->seed_len)) {
+        if (!ASN1_BIT_STRING_set1(curve->seed, group->seed,
+                (int)group->seed_len, 0)) {
             ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
             goto err;
         }
@@ -412,7 +411,7 @@ ECPARAMETERS *EC_GROUP_get_ecparameters(const EC_GROUP *group,
     form = EC_GROUP_get_point_conversion_form(group);

     len = EC_POINT_point2buf(group, point, form, &buffer, NULL);
-    if (len == 0) {
+    if (len == 0 || len > INT_MAX) {
         ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
         goto err;
     }
@@ -421,7 +420,7 @@ ECPARAMETERS *EC_GROUP_get_ecparameters(const EC_GROUP *group,
         ERR_raise(ERR_LIB_EC, ERR_R_ASN1_LIB);
         goto err;
     }
-    ASN1_STRING_set0(ret->base, buffer, len);
+    ASN1_STRING_set0(ret->base, buffer, (int)len);

     /* set the order */
     tmp = EC_GROUP_get0_order(group);
@@ -467,11 +466,14 @@ ECPKPARAMETERS *EC_GROUP_get_ecpkparameters(const EC_GROUP *group,
             return NULL;
         }
     } else {
-        if (ret->type == ECPKPARAMETERS_TYPE_NAMED)
+        if (ret->type == ECPKPARAMETERS_TYPE_NAMED) {
             ASN1_OBJECT_free(ret->value.named_curve);
-        else if (ret->type == ECPKPARAMETERS_TYPE_EXPLICIT
-            && ret->value.parameters != NULL)
+            ret->value.named_curve = NULL;
+        } else if (ret->type == ECPKPARAMETERS_TYPE_EXPLICIT
+            && ret->value.parameters != NULL) {
             ECPARAMETERS_free(ret->value.parameters);
+            ret->value.parameters = NULL;
+        }
     }

     if (EC_GROUP_get_asn1_flag(group) == OPENSSL_EC_NAMED_CURVE) {
@@ -888,6 +890,14 @@ EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, long len)

     if (params->type == ECPKPARAMETERS_TYPE_EXPLICIT)
         group->decoded_from_explicit_params = 1;
+#ifdef OPENSSL_NO_EC_EXPLICIT_CURVES
+    if (EC_GROUP_check_named_curve(group, 0, NULL) == NID_undef) {
+        EC_GROUP_free(group);
+        ECPKPARAMETERS_free(params);
+        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_GROUP);
+        return NULL;
+    }
+#endif

     if (a) {
         EC_GROUP_free(*a);
@@ -948,13 +958,21 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
         goto err;
     }

+#ifdef OPENSSL_NO_EC_EXPLICIT_CURVES
+    if (EC_GROUP_check_named_curve(ret->group, 0, NULL) == NID_undef) {
+        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_GROUP);
+        goto err;
+    }
+#endif
+
     ret->version = priv_key->version;

     if (priv_key->privateKey) {
         ASN1_OCTET_STRING *pkey = priv_key->privateKey;
-        if (EC_KEY_oct2priv(ret, ASN1_STRING_get0_data(pkey),
-                ASN1_STRING_length(pkey))
-            == 0)
+        size_t pkey_len = ASN1_STRING_get_length(pkey);
+        if (pkey_len > INT_MAX)
+            goto err;
+        if (EC_KEY_oct2priv(ret, ASN1_STRING_get0_data(pkey), (int)pkey_len) == 0)
             goto err;
     } else {
         ERR_raise(ERR_LIB_EC, EC_R_MISSING_PRIVATE_KEY);
@@ -973,11 +991,13 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)

     if (priv_key->publicKey) {
         const unsigned char *pub_oct;
-        int pub_oct_len;
+        size_t pub_oct_len;

         pub_oct = ASN1_STRING_get0_data(priv_key->publicKey);
-        pub_oct_len = ASN1_STRING_length(priv_key->publicKey);
-        if (!EC_KEY_oct2key(ret, pub_oct, pub_oct_len, NULL)) {
+        pub_oct_len = ASN1_STRING_get_length(priv_key->publicKey);
+        if (pub_oct_len > INT_MAX)
+            goto err;
+        if (!EC_KEY_oct2key(ret, pub_oct, (int)pub_oct_len, NULL)) {
             ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
             goto err;
         }
@@ -1025,12 +1045,12 @@ int i2d_ECPrivateKey(const EC_KEY *a, unsigned char **out)

     privlen = EC_KEY_priv2buf(a, &priv);

-    if (privlen == 0) {
+    if (privlen == 0 || privlen > INT_MAX) {
         ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
         goto err;
     }

-    ASN1_STRING_set0(priv_key->privateKey, priv, privlen);
+    ASN1_STRING_set0(priv_key->privateKey, priv, (int)privlen);
     priv = NULL;

     if (!(a->enc_flag & EC_PKEY_NO_PARAMETERS)) {
@@ -1049,15 +1069,15 @@ int i2d_ECPrivateKey(const EC_KEY *a, unsigned char **out)
             goto err;
         }

-        publen = EC_KEY_key2buf(a, a->conv_form, &pub, NULL);
+        publen = EC_KEY_key2buf(a, EC_KEY_get_conv_form(a), &pub, NULL);

-        if (publen == 0) {
+        if (publen == 0 || publen > INT_MAX) {
             ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
             goto err;
         }

-        ossl_asn1_string_set_bits_left(priv_key->publicKey, 0);
-        ASN1_STRING_set0(priv_key->publicKey, pub, publen);
+        ossl_asn1_bit_string_set_unused_bits(priv_key->publicKey, 0);
+        ASN1_STRING_set0(priv_key->publicKey, pub, (int)publen);
         pub = NULL;
     }

@@ -1070,7 +1090,7 @@ err:
     OPENSSL_clear_free(priv, privlen);
     OPENSSL_free(pub);
     EC_PRIVATEKEY_free(priv_key);
-    return (ok ? ret : 0);
+    return ok ? ret : 0;
 }

 int i2d_ECParameters(const EC_KEY *a, unsigned char **out)
@@ -1150,18 +1170,22 @@ int i2o_ECPublicKey(const EC_KEY *a, unsigned char **out)
     }

     buf_len = EC_POINT_point2oct(a->group, a->pub_key,
-        a->conv_form, NULL, 0, NULL);
+        EC_KEY_get_conv_form(a), NULL, 0, NULL);

+    if (buf_len > INT_MAX) {
+        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
     if (out == NULL || buf_len == 0)
         /* out == NULL => just return the length of the octet string */
-        return buf_len;
+        return (int)buf_len;

     if (*out == NULL) {
         if ((*out = OPENSSL_malloc(buf_len)) == NULL)
             return 0;
         new_buffer = 1;
     }
-    if (!EC_POINT_point2oct(a->group, a->pub_key, a->conv_form,
+    if (!EC_POINT_point2oct(a->group, a->pub_key, EC_KEY_get_conv_form(a),
             *out, buf_len, NULL)) {
         ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
         if (new_buffer) {
@@ -1172,7 +1196,7 @@ int i2o_ECPublicKey(const EC_KEY *a, unsigned char **out)
     }
     if (!new_buffer)
         *out += buf_len;
-    return buf_len;
+    return (int)buf_len;
 }

 DECLARE_ASN1_FUNCTIONS(ECDSA_SIG)
diff --git a/deps/openssl/openssl/crypto/ec/ec_backend.c b/deps/openssl/openssl/crypto/ec/ec_backend.c
index 7c37d898f78..4c6302c5b51 100644
--- a/deps/openssl/openssl/crypto/ec/ec_backend.c
+++ b/deps/openssl/openssl/crypto/ec/ec_backend.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -18,16 +18,18 @@
 #include <openssl/params.h>
 #include <openssl/err.h>
 #ifndef FIPS_MODULE
-#include <openssl/engine.h>
 #include <openssl/x509.h>
 #endif
 #include "crypto/bn.h"
 #include "crypto/ec.h"
+#include "crypto/ec_params.h"
 #include "ec_local.h"
 #include "internal/e_os.h"
 #include "internal/nelem.h"
 #include "internal/param_build_set.h"

+#include <crypto/asn1.h>
+
 /* Mapping between a flag and a name */
 static const OSSL_ITEM encoding_nameid_map[] = {
     { OPENSSL_EC_EXPLICIT_CURVE, OSSL_PKEY_EC_ENCODING_EXPLICIT },
@@ -155,15 +157,15 @@ char *ossl_ec_pt_format_id2name(int id)
 }

 static int ec_group_explicit_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
-    OSSL_PARAM params[], BN_CTX *bnctx,
+    const EC_PARAMS *params, BN_CTX *bnctx,
     unsigned char **genbuf)
 {
     int ret = 0, fid;
     const char *field_type;
-    const OSSL_PARAM *param = NULL;
-    const OSSL_PARAM *param_p = NULL;
-    const OSSL_PARAM *param_a = NULL;
-    const OSSL_PARAM *param_b = NULL;
+    OSSL_PARAM *param = NULL;
+    OSSL_PARAM *param_p = NULL;
+    OSSL_PARAM *param_a = NULL;
+    OSSL_PARAM *param_b = NULL;

     fid = EC_GROUP_get_field_type(group);

@@ -181,9 +183,11 @@ static int ec_group_explicit_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
         return 0;
     }

-    param_p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_P);
-    param_a = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_A);
-    param_b = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_B);
+    if (params != NULL) {
+        param_p = params->p;
+        param_a = params->a;
+        param_b = params->b;
+    }
     if (tmpl != NULL || param_p != NULL || param_a != NULL || param_b != NULL) {
         BIGNUM *p = BN_CTX_get(bnctx);
         BIGNUM *a = BN_CTX_get(bnctx);
@@ -198,15 +202,17 @@ static int ec_group_explicit_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
             ERR_raise(ERR_LIB_EC, EC_R_INVALID_CURVE);
             goto err;
         }
-        if (!ossl_param_build_set_bn(tmpl, params, OSSL_PKEY_PARAM_EC_P, p)
-            || !ossl_param_build_set_bn(tmpl, params, OSSL_PKEY_PARAM_EC_A, a)
-            || !ossl_param_build_set_bn(tmpl, params, OSSL_PKEY_PARAM_EC_B, b)) {
+        if (!ossl_param_build_set_bn(tmpl, param_p, OSSL_PKEY_PARAM_EC_P, p)
+            || !ossl_param_build_set_bn(tmpl, param_a,
+                OSSL_PKEY_PARAM_EC_A, a)
+            || !ossl_param_build_set_bn(tmpl, param_b,
+                OSSL_PKEY_PARAM_EC_B, b)) {
             ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
             goto err;
         }
     }

-    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_ORDER);
+    param = params == NULL ? NULL : params->order;
     if (tmpl != NULL || param != NULL) {
         const BIGNUM *order = EC_GROUP_get0_order(group);

@@ -214,16 +220,16 @@ static int ec_group_explicit_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
             ERR_raise(ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER);
             goto err;
         }
-        if (!ossl_param_build_set_bn(tmpl, params, OSSL_PKEY_PARAM_EC_ORDER,
+        if (!ossl_param_build_set_bn(tmpl, param, OSSL_PKEY_PARAM_EC_ORDER,
                 order)) {
             ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
             goto err;
         }
     }

-    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_FIELD_TYPE);
+    param = params == NULL ? NULL : params->field_type;
     if (tmpl != NULL || param != NULL) {
-        if (!ossl_param_build_set_utf8_string(tmpl, params,
+        if (!ossl_param_build_set_utf8_string(tmpl, param,
                 OSSL_PKEY_PARAM_EC_FIELD_TYPE,
                 field_type)) {
             ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
@@ -231,7 +237,7 @@ static int ec_group_explicit_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
         }
     }

-    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_GENERATOR);
+    param = params == NULL ? NULL : params->generator;
     if (tmpl != NULL || param != NULL) {
         size_t genbuf_len;
         const EC_POINT *genpt = EC_GROUP_get0_generator(group);
@@ -246,7 +252,7 @@ static int ec_group_explicit_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
             ERR_raise(ERR_LIB_EC, EC_R_INVALID_GENERATOR);
             goto err;
         }
-        if (!ossl_param_build_set_octet_string(tmpl, params,
+        if (!ossl_param_build_set_octet_string(tmpl, param,
                 OSSL_PKEY_PARAM_EC_GENERATOR,
                 *genbuf, genbuf_len)) {
             ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
@@ -254,26 +260,26 @@ static int ec_group_explicit_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
         }
     }

-    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_COFACTOR);
+    param = params == NULL ? NULL : params->cofactor;
     if (tmpl != NULL || param != NULL) {
         const BIGNUM *cofactor = EC_GROUP_get0_cofactor(group);

         if (cofactor != NULL
-            && !ossl_param_build_set_bn(tmpl, params,
+            && !ossl_param_build_set_bn(tmpl, param,
                 OSSL_PKEY_PARAM_EC_COFACTOR, cofactor)) {
             ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
             goto err;
         }
     }

-    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_SEED);
+    param = params == NULL ? NULL : params->seed;
     if (tmpl != NULL || param != NULL) {
         unsigned char *seed = EC_GROUP_get0_seed(group);
         size_t seed_len = EC_GROUP_get_seed_len(group);

         if (seed != NULL
             && seed_len > 0
-            && !ossl_param_build_set_octet_string(tmpl, params,
+            && !ossl_param_build_set_octet_string(tmpl, param,
                 OSSL_PKEY_PARAM_EC_SEED,
                 seed, seed_len)) {
             ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
@@ -285,8 +291,8 @@ err:
     return ret;
 }

-int ossl_ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
-    OSSL_PARAM params[], OSSL_LIB_CTX *libctx,
+int ossl_ec_group_todata_parsed(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
+    const EC_PARAMS *params, OSSL_LIB_CTX *libctx,
     const char *propq,
     BN_CTX *bnctx, unsigned char **genbuf)
 {
@@ -303,7 +309,7 @@ int ossl_ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
     pt_form_name = ossl_ec_pt_format_id2name(genform);
     if (pt_form_name == NULL
         || !ossl_param_build_set_utf8_string(
-            tmpl, params,
+            tmpl, params == NULL ? NULL : params->pt_format,
             OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT, pt_form_name)) {
         ERR_raise(ERR_LIB_EC, EC_R_INVALID_FORM);
         return 0;
@@ -311,14 +317,16 @@ int ossl_ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
     encoding_flag = EC_GROUP_get_asn1_flag(group) & OPENSSL_EC_NAMED_CURVE;
     encoding_name = ec_param_encoding_id2name(encoding_flag);
     if (encoding_name == NULL
-        || !ossl_param_build_set_utf8_string(tmpl, params,
+        || !ossl_param_build_set_utf8_string(tmpl,
+            params == NULL ? NULL : params->encoding,
             OSSL_PKEY_PARAM_EC_ENCODING,
             encoding_name)) {
         ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
         return 0;
     }

-    if (!ossl_param_build_set_int(tmpl, params,
+    if (!ossl_param_build_set_int(tmpl,
+            params == NULL ? NULL : params->decoded,
             OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS,
             group->decoded_from_explicit_params))
         return 0;
@@ -339,7 +347,8 @@ int ossl_ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
         const char *curve_name = OSSL_EC_curve_nid2name(curve_nid);

         if (curve_name == NULL
-            || !ossl_param_build_set_utf8_string(tmpl, params,
+            || !ossl_param_build_set_utf8_string(tmpl,
+                params == NULL ? NULL : params->group_name,
                 OSSL_PKEY_PARAM_GROUP_NAME,
                 curve_name)) {
             ERR_raise(ERR_LIB_EC, EC_R_INVALID_CURVE);
@@ -351,10 +360,27 @@ err:
     return ret;
 }

+int ossl_ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
+    OSSL_PARAM params[], OSSL_LIB_CTX *libctx,
+    const char *propq,
+    BN_CTX *bnctx, unsigned char **genbuf)
+{
+    EC_PARAMS p;
+
+    if (params != NULL) {
+        if (!ec_group_todata_decoder(params, &p))
+            return 0;
+        return ossl_ec_group_todata_parsed(group, tmpl, &p, libctx, propq,
+            bnctx, genbuf);
+    }
+    return ossl_ec_group_todata_parsed(group, tmpl, NULL, libctx, propq,
+        bnctx, genbuf);
+}
+
 /*
- * The intention with the "backend" source file is to offer backend support
- * for legacy backends (EVP_PKEY_ASN1_METHOD and EVP_PKEY_METHOD) and provider
- * implementations alike.
+ * The intention with the "backend" source file is to offer backend functions
+ * for legacy backends (EVP_PKEY_ASN1_METHOD) and provider implementations
+ * alike.
  */
 int ossl_ec_set_ecdh_cofactor_mode(EC_KEY *ec, int mode)
 {
@@ -393,7 +419,8 @@ int ossl_ec_set_ecdh_cofactor_mode(EC_KEY *ec, int mode)
  * parameters are treated separately, and domain parameters are required to
  * define a keypair.
  */
-int ossl_ec_key_fromdata(EC_KEY *ec, const OSSL_PARAM params[], int include_private)
+int ossl_ec_key_fromdata_parsed(EC_KEY *ec, const EC_PARAMS *params,
+    int include_private)
 {
     const OSSL_PARAM *param_priv_key = NULL, *param_pub_key = NULL;
     BN_CTX *ctx = NULL;
@@ -408,9 +435,12 @@ int ossl_ec_key_fromdata(EC_KEY *ec, const OSSL_PARAM params[], int include_priv
     if (ecg == NULL)
         return 0;

-    param_pub_key = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PUB_KEY);
+    if (params == NULL)
+        return 0;
+
+    param_pub_key = params->pub;
     if (include_private)
-        param_priv_key = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY);
+        param_priv_key = params->priv;

     ctx = BN_CTX_new_ex(ossl_ec_key_get_libctx(ec));
     if (ctx == NULL)
@@ -484,6 +514,15 @@ int ossl_ec_key_fromdata(EC_KEY *ec, const OSSL_PARAM params[], int include_priv
         && !EC_KEY_set_public_key(ec, pub_point))
         goto err;

+    /* Fallback computation of public key if not provided */
+    if (priv_key != NULL && pub_point == NULL) {
+        if ((pub_point = EC_POINT_new(ecg)) == NULL
+            || !EC_KEY_set_public_key(ec, pub_point))
+            goto err;
+        if (!ossl_ec_key_simple_generate_public_key(ec))
+            goto err;
+    }
+
     ok = 1;

 err:
@@ -494,7 +533,17 @@ err:
     return ok;
 }

-int ossl_ec_group_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
+int ossl_ec_key_fromdata(EC_KEY *ec, const OSSL_PARAM params[],
+    int include_private)
+{
+    EC_PARAMS p;
+
+    if (!ec_key_fromdata_decoder(params, &p))
+        return 0;
+    return ossl_ec_key_fromdata_parsed(ec, &p, include_private);
+}
+
+int ossl_ec_group_fromdata_parsed(EC_KEY *ec, const EC_PARAMS *params)
 {
     int ok = 0;
     EC_GROUP *group = NULL;
@@ -502,7 +551,8 @@ int ossl_ec_group_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
     if (ec == NULL)
         return 0;

-    group = EC_GROUP_new_from_params(params, ossl_ec_key_get_libctx(ec),
+    group = ossl_ec_group_new_from_params_parsed(params,
+        ossl_ec_key_get_libctx(ec),
         ossl_ec_key_get0_propq(ec));

     if (!EC_KEY_set_group(ec, group))
@@ -513,14 +563,21 @@ err:
     return ok;
 }

-static int ec_key_point_format_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
+int ossl_ec_group_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
+{
+    EC_PARAMS p;
+
+    if (!ec_group_fromdata_decoder(params, &p))
+        return 0;
+    return ossl_ec_group_fromdata_parsed(ec, &p);
+}
+
+static int ec_key_point_format_fromdata(EC_KEY *ec, const EC_PARAMS *params)
 {
-    const OSSL_PARAM *p;
     int format = -1;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT);
-    if (p != NULL) {
-        if (!ossl_ec_pt_format_param2id(p, &format)) {
+    if (params->pt_format != NULL) {
+        if (!ossl_ec_pt_format_param2id(params->pt_format, &format)) {
             ERR_raise(ERR_LIB_EC, EC_R_INVALID_FORM);
             return 0;
         }
@@ -529,13 +586,10 @@ static int ec_key_point_format_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
     return 1;
 }

-static int ec_key_group_check_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
+static int ec_key_group_check_fromdata(EC_KEY *ec, const EC_PARAMS *params)
 {
-    const OSSL_PARAM *p;
-
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE);
-    if (p != NULL)
-        return ec_set_check_group_type_from_param(ec, p);
+    if (params->group_check != NULL)
+        return ec_set_check_group_type_from_param(ec, params->group_check);
     return 1;
 }

@@ -551,27 +605,24 @@ static int ec_set_include_public(EC_KEY *ec, int include)
     return 1;
 }

-int ossl_ec_key_otherparams_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
+int ossl_ec_key_otherparams_fromdata_parsed(EC_KEY *ec,
+    const EC_PARAMS *params)
 {
-    const OSSL_PARAM *p;
-
-    if (ec == NULL)
+    if (ec == NULL || params == NULL)
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_USE_COFACTOR_ECDH);
-    if (p != NULL) {
+    if (params->use_cofactor != NULL) {
         int mode;

-        if (!OSSL_PARAM_get_int(p, &mode)
+        if (!OSSL_PARAM_get_int(params->use_cofactor, &mode)
             || !ossl_ec_set_ecdh_cofactor_mode(ec, mode))
             return 0;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC);
-    if (p != NULL) {
+    if (params->include_public != NULL) {
         int include = 1;

-        if (!OSSL_PARAM_get_int(p, &include)
+        if (!OSSL_PARAM_get_int(params->include_public, &include)
             || !ec_set_include_public(ec, include))
             return 0;
     }
@@ -582,10 +633,19 @@ int ossl_ec_key_otherparams_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
     return 1;
 }

+int ossl_ec_key_otherparams_fromdata(EC_KEY *ec, const OSSL_PARAM params[])
+{
+    EC_PARAMS p;
+
+    if (!ec_key_otherparams_fromdata_decoder(params, &p))
+        return 0;
+    return ossl_ec_key_otherparams_fromdata_parsed(ec, &p);
+}
+
 int ossl_ec_key_is_foreign(const EC_KEY *ec)
 {
 #ifndef FIPS_MODULE
-    if (ec->engine != NULL || EC_KEY_get_method(ec) != EC_KEY_OpenSSL())
+    if (EC_KEY_get_method(ec) != EC_KEY_OpenSSL())
         return 1;
 #endif
     return 0;
@@ -600,9 +660,7 @@ EC_KEY *ossl_ec_key_dup(const EC_KEY *src, int selection)
         return NULL;
     }

-    if ((ret = ossl_ec_key_new_method_int(src->libctx, src->propq,
-             src->engine))
-        == NULL)
+    if ((ret = ossl_ec_key_new_method_int(src->libctx, src->propq)) == NULL)
         return NULL;

     /* copy the parameters */
@@ -637,7 +695,7 @@ EC_KEY *ossl_ec_key_dup(const EC_KEY *src, int selection)
             /* no parameter-less keys allowed */
             goto err;
         ret->priv_key = BN_new();
-        if (ret->priv_key == NULL || !BN_copy(ret->priv_key, src->priv_key))
+        if (ret->priv_key == NULL || BN_copy(ret->priv_key, src->priv_key) == NULL)
             goto err;
         if (ret->group->meth->keycopy
             && ret->group->meth->keycopy(ret, src) == 0)
@@ -647,7 +705,6 @@ EC_KEY *ossl_ec_key_dup(const EC_KEY *src, int selection)
     /* copy the rest */
     if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0) {
         ret->enc_flag = src->enc_flag;
-        ret->conv_form = src->conv_form;
     }

     ret->version = src->version;
diff --git a/deps/openssl/openssl/crypto/ec/ec_curve.c b/deps/openssl/openssl/crypto/ec/ec_curve.c
index c3bc92fd75a..e63d89bae73 100644
--- a/deps/openssl/openssl/crypto/ec/ec_curve.c
+++ b/deps/openssl/openssl/crypto/ec/ec_curve.c
@@ -3111,7 +3111,7 @@ int ossl_ec_curve_nid_from_params(const EC_GROUP *group, BN_CTX *ctx)
         param_len = len;

     /* Allocate space to store the padded data for (p, a, b, x, y, order)  */
-    param_bytes = OPENSSL_malloc(param_len * NUM_BN_FIELDS);
+    param_bytes = OPENSSL_malloc_array(NUM_BN_FIELDS, param_len);
     if (param_bytes == NULL)
         goto end;

diff --git a/deps/openssl/openssl/crypto/ec/ec_cvt.c b/deps/openssl/openssl/crypto/ec/ec_cvt.c
index 77f92091089..3bf9a35dbaf 100644
--- a/deps/openssl/openssl/crypto/ec/ec_cvt.c
+++ b/deps/openssl/openssl/crypto/ec/ec_cvt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2025 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -44,7 +44,7 @@ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,
      * implementing dedicated NxN multiplication subroutines for
      * small N. But till it materializes, let's stick to generic
      * prime method...
-     *                                              <appro>
+     *                                              <@dot-asm>
      */
     meth = EC_GFp_mont_method();
 #else
diff --git a/deps/openssl/openssl/crypto/ec/ec_deprecated.c b/deps/openssl/openssl/crypto/ec/ec_deprecated.c
index c05785e0df5..dd4bb520be8 100644
--- a/deps/openssl/openssl/crypto/ec/ec_deprecated.c
+++ b/deps/openssl/openssl/crypto/ec/ec_deprecated.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -28,10 +28,10 @@ BIGNUM *EC_POINT_point2bn(const EC_GROUP *group,

     buf_len = EC_POINT_point2buf(group, point, form, &buf, ctx);

-    if (buf_len == 0)
+    if (buf_len == 0 || buf_len > INT_MAX)
         return NULL;

-    ret = BN_bin2bn(buf, buf_len, ret);
+    ret = BN_bin2bn(buf, (int)buf_len, ret);

     OPENSSL_free(buf);

@@ -41,7 +41,7 @@ BIGNUM *EC_POINT_point2bn(const EC_GROUP *group,
 EC_POINT *EC_POINT_bn2point(const EC_GROUP *group,
     const BIGNUM *bn, EC_POINT *point, BN_CTX *ctx)
 {
-    size_t buf_len = 0;
+    int buf_len = 0;
     unsigned char *buf;
     EC_POINT *ret;

diff --git a/deps/openssl/openssl/crypto/ec/ec_err.c b/deps/openssl/openssl/crypto/ec/ec_err.c
deleted file mode 100644
index 4e3152d0df6..00000000000
--- a/deps/openssl/openssl/crypto/ec/ec_err.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/ecerr.h>
-#include "crypto/ecerr.h"
-
-#ifndef OPENSSL_NO_EC
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA EC_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_ASN1_ERROR), "asn1 error" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_BAD_SIGNATURE), "bad signature" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_BIGNUM_OUT_OF_RANGE), "bignum out of range" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_BUFFER_TOO_SMALL), "buffer too small" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_CANNOT_INVERT), "cannot invert" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_COORDINATES_OUT_OF_RANGE),
-        "coordinates out of range" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_CURVE_DOES_NOT_SUPPORT_ECDH),
-        "curve does not support ecdh" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_CURVE_DOES_NOT_SUPPORT_ECDSA),
-        "curve does not support ecdsa" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING),
-        "curve does not support signing" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_DECODE_ERROR), "decode error" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_DISCRIMINANT_IS_ZERO),
-        "discriminant is zero" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_EC_GROUP_NEW_BY_NAME_FAILURE),
-        "ec group new by name failure" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_EXPLICIT_PARAMS_NOT_SUPPORTED),
-        "explicit params not supported" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_FAILED_MAKING_PUBLIC_KEY),
-        "failed making public key" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_FIELD_TOO_LARGE), "field too large" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_GF2M_NOT_SUPPORTED), "gf2m not supported" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_GROUP2PKPARAMETERS_FAILURE),
-        "group2pkparameters failure" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_I2D_ECPKPARAMETERS_FAILURE),
-        "i2d ecpkparameters failure" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INCOMPATIBLE_OBJECTS),
-        "incompatible objects" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_A), "invalid a" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_ARGUMENT), "invalid argument" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_B), "invalid b" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_COFACTOR), "invalid cofactor" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_COMPRESSED_POINT),
-        "invalid compressed point" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_COMPRESSION_BIT),
-        "invalid compression bit" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_CURVE), "invalid curve" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_DIGEST), "invalid digest" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_DIGEST_TYPE), "invalid digest type" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_ENCODING), "invalid encoding" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_FIELD), "invalid field" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_FORM), "invalid form" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_GENERATOR), "invalid generator" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_GROUP_ORDER), "invalid group order" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_KEY), "invalid key" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_LENGTH), "invalid length" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_NAMED_GROUP_CONVERSION),
-        "invalid named group conversion" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_OUTPUT_LENGTH),
-        "invalid output length" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_P), "invalid p" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_PEER_KEY), "invalid peer key" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_PENTANOMIAL_BASIS),
-        "invalid pentanomial basis" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_PRIVATE_KEY), "invalid private key" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_SEED), "invalid seed" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_INVALID_TRINOMIAL_BASIS),
-        "invalid trinomial basis" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_KDF_PARAMETER_ERROR), "kdf parameter error" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_KEYS_NOT_SET), "keys not set" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_LADDER_POST_FAILURE), "ladder post failure" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_LADDER_PRE_FAILURE), "ladder pre failure" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_LADDER_STEP_FAILURE), "ladder step failure" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_MISSING_OID), "missing OID" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_MISSING_PARAMETERS), "missing parameters" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_MISSING_PRIVATE_KEY), "missing private key" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_NEED_NEW_SETUP_VALUES),
-        "need new setup values" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_NOT_A_NIST_PRIME), "not a NIST prime" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_NOT_IMPLEMENTED), "not implemented" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_NOT_INITIALIZED), "not initialized" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_NO_PARAMETERS_SET), "no parameters set" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_NO_PRIVATE_VALUE), "no private value" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_OPERATION_NOT_SUPPORTED),
-        "operation not supported" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_PASSED_NULL_PARAMETER),
-        "passed null parameter" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_PEER_KEY_ERROR), "peer key error" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_POINT_ARITHMETIC_FAILURE),
-        "point arithmetic failure" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_POINT_AT_INFINITY), "point at infinity" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_POINT_COORDINATES_BLIND_FAILURE),
-        "point coordinates blind failure" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_POINT_IS_NOT_ON_CURVE),
-        "point is not on curve" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_RANDOM_NUMBER_GENERATION_FAILED),
-        "random number generation failed" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_SHARED_INFO_ERROR), "shared info error" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_SLOT_FULL), "slot full" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_TOO_MANY_RETRIES), "too many retries" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_UNDEFINED_GENERATOR), "undefined generator" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_UNDEFINED_ORDER), "undefined order" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_UNKNOWN_COFACTOR), "unknown cofactor" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_UNKNOWN_GROUP), "unknown group" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_UNKNOWN_ORDER), "unknown order" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_UNSUPPORTED_FIELD), "unsupported field" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_WRONG_CURVE_PARAMETERS),
-        "wrong curve parameters" },
-    { ERR_PACK(ERR_LIB_EC, 0, EC_R_WRONG_ORDER), "wrong order" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_EC_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(EC_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(EC_str_reasons);
-#endif
-    return 1;
-}
-#else
-NON_EMPTY_TRANSLATION_UNIT
-#endif
diff --git a/deps/openssl/openssl/crypto/ec/ec_key.c b/deps/openssl/openssl/crypto/ec/ec_key.c
index 71f1c63e2ab..d8640a4bca1 100644
--- a/deps/openssl/openssl/crypto/ec/ec_key.c
+++ b/deps/openssl/openssl/crypto/ec/ec_key.c
@@ -19,9 +19,6 @@
 #include "ec_local.h"
 #include "internal/refcount.h"
 #include <openssl/err.h>
-#ifndef FIPS_MODULE
-#include <openssl/engine.h>
-#endif
 #include <openssl/self_test.h>
 #include "prov/providercommon.h"
 #include "prov/ecx.h"
@@ -33,13 +30,13 @@ static int ecdsa_keygen_pairwise_test(EC_KEY *eckey, OSSL_CALLBACK *cb,
 #ifndef FIPS_MODULE
 EC_KEY *EC_KEY_new(void)
 {
-    return ossl_ec_key_new_method_int(NULL, NULL, NULL);
+    return ossl_ec_key_new_method_int(NULL, NULL);
 }
 #endif

 EC_KEY *EC_KEY_new_ex(OSSL_LIB_CTX *ctx, const char *propq)
 {
-    return ossl_ec_key_new_method_int(ctx, propq, NULL);
+    return ossl_ec_key_new_method_int(ctx, propq);
 }

 EC_KEY *EC_KEY_new_by_curve_name_ex(OSSL_LIB_CTX *ctx, const char *propq,
@@ -84,10 +81,6 @@ void EC_KEY_free(EC_KEY *r)
     if (r->meth != NULL && r->meth->finish != NULL)
         r->meth->finish(r);

-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    ENGINE_finish(r->engine);
-#endif
-
     if (r->group && r->group->meth->keyfinish)
         r->group->meth->keyfinish(r);

@@ -114,11 +107,6 @@ EC_KEY *EC_KEY_copy(EC_KEY *dest, const EC_KEY *src)
             dest->meth->finish(dest);
         if (dest->group && dest->group->meth->keyfinish)
             dest->group->meth->keyfinish(dest);
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-        if (ENGINE_finish(dest->engine) == 0)
-            return 0;
-        dest->engine = NULL;
-#endif
     }
     dest->libctx = src->libctx;
     /* copy the parameters */
@@ -148,7 +136,7 @@ EC_KEY *EC_KEY_copy(EC_KEY *dest, const EC_KEY *src)
                 if (dest->priv_key == NULL)
                     return NULL;
             }
-            if (!BN_copy(dest->priv_key, src->priv_key))
+            if (BN_copy(dest->priv_key, src->priv_key) == NULL)
                 return NULL;
             if (src->group->meth->keycopy
                 && src->group->meth->keycopy(dest, src) == 0)
@@ -158,7 +146,6 @@ EC_KEY *EC_KEY_copy(EC_KEY *dest, const EC_KEY *src)

     /* copy the rest */
     dest->enc_flag = src->enc_flag;
-    dest->conv_form = src->conv_form;
     dest->version = src->version;
     dest->flags = src->flags;
 #ifndef FIPS_MODULE
@@ -168,11 +155,6 @@ EC_KEY *EC_KEY_copy(EC_KEY *dest, const EC_KEY *src)
 #endif

     if (src->meth != dest->meth) {
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-        if (src->engine != NULL && ENGINE_init(src->engine) == 0)
-            return NULL;
-        dest->engine = src->engine;
-#endif
         dest->meth = src->meth;
     }

@@ -193,7 +175,7 @@ int EC_KEY_up_ref(EC_KEY *r)
 {
     int i;

-    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&r->references, &i))
         return 0;

     REF_PRINT_COUNT("EC_KEY", i, r);
@@ -201,11 +183,6 @@ int EC_KEY_up_ref(EC_KEY *r)
     return ((i > 1) ? 1 : 0);
 }

-ENGINE *EC_KEY_get0_engine(const EC_KEY *eckey)
-{
-    return eckey->engine;
-}
-
 int EC_KEY_generate_key(EC_KEY *eckey)
 {
     if (eckey == NULL || eckey->group == NULL) {
@@ -854,12 +831,13 @@ void EC_KEY_set_enc_flags(EC_KEY *key, unsigned int flags)

 point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key)
 {
-    return key->conv_form;
+    return key->group != NULL
+        ? EC_GROUP_get_point_conversion_form(key->group)
+        : POINT_CONVERSION_UNCOMPRESSED;
 }

 void EC_KEY_set_conv_form(EC_KEY *key, point_conversion_form_t cform)
 {
-    key->conv_form = cform;
     if (key->group != NULL)
         EC_GROUP_set_point_conversion_form(key->group, cform);
 }
@@ -930,8 +908,10 @@ int EC_KEY_oct2key(EC_KEY *key, const unsigned char *buf, size_t len,
      * EC_POINT_oct2point() has already performed sanity checking of
      * the buffer so we know it is valid.
      */
-    if ((key->group->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0)
-        key->conv_form = (point_conversion_form_t)(buf[0] & ~0x01);
+    if ((key->group->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0) {
+        EC_GROUP_set_point_conversion_form(key->group,
+            (point_conversion_form_t)(buf[0] & ~0x01));
+    }
     return 1;
 }

@@ -951,14 +931,14 @@ size_t EC_KEY_priv2oct(const EC_KEY *eckey,
 size_t ossl_ec_key_simple_priv2oct(const EC_KEY *eckey,
     unsigned char *buf, size_t len)
 {
-    size_t buf_len;
+    int buf_len;

     buf_len = (EC_GROUP_order_bits(eckey->group) + 7) / 8;
     if (eckey->priv_key == NULL)
         return 0;
     if (buf == NULL)
         return buf_len;
-    else if (len < buf_len)
+    else if (len < (size_t)buf_len)
         return 0;

     /* Octetstring may need leading zeros if BN is to short */
@@ -990,13 +970,17 @@ int EC_KEY_oct2priv(EC_KEY *eckey, const unsigned char *buf, size_t len)
 int ossl_ec_key_simple_oct2priv(EC_KEY *eckey, const unsigned char *buf,
     size_t len)
 {
+    if (len > INT_MAX) {
+        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
     if (eckey->priv_key == NULL)
         eckey->priv_key = BN_secure_new();
     if (eckey->priv_key == NULL) {
         ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
         return 0;
     }
-    if (BN_bin2bn(buf, len, eckey->priv_key) == NULL) {
+    if (BN_bin2bn(buf, (int)len, eckey->priv_key) == NULL) {
         ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
         return 0;
     }
diff --git a/deps/openssl/openssl/crypto/ec/ec_kmeth.c b/deps/openssl/openssl/crypto/ec/ec_kmeth.c
index 1e712f84e53..cf3e0be2e66 100644
--- a/deps/openssl/openssl/crypto/ec/ec_kmeth.c
+++ b/deps/openssl/openssl/crypto/ec/ec_kmeth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,9 +15,6 @@

 #include <string.h>
 #include <openssl/ec.h>
-#ifndef FIPS_MODULE
-#include <openssl/engine.h>
-#endif
 #include <openssl/err.h>
 #include "ec_local.h"

@@ -66,19 +63,13 @@ int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth)
     if (finish != NULL)
         finish(key);

-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    ENGINE_finish(key->engine);
-    key->engine = NULL;
-#endif
-
     key->meth = meth;
     if (meth->init != NULL)
         return meth->init(key);
     return 1;
 }

-EC_KEY *ossl_ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq,
-    ENGINE *engine)
+EC_KEY *ossl_ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq)
 {
     EC_KEY *ret = OPENSSL_zalloc(sizeof(*ret));

@@ -98,26 +89,7 @@ EC_KEY *ossl_ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq,
     }

     ret->meth = EC_KEY_get_default_method();
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    if (engine != NULL) {
-        if (!ENGINE_init(engine)) {
-            ERR_raise(ERR_LIB_EC, ERR_R_ENGINE_LIB);
-            goto err;
-        }
-        ret->engine = engine;
-    } else
-        ret->engine = ENGINE_get_default_EC();
-    if (ret->engine != NULL) {
-        ret->meth = ENGINE_get_EC(ret->engine);
-        if (ret->meth == NULL) {
-            ERR_raise(ERR_LIB_EC, ERR_R_ENGINE_LIB);
-            goto err;
-        }
-    }
-#endif
-
     ret->version = 1;
-    ret->conv_form = POINT_CONVERSION_UNCOMPRESSED;

 /* No ex_data inside the FIPS provider */
 #ifndef FIPS_MODULE
@@ -139,9 +111,11 @@ err:
 }

 #ifndef FIPS_MODULE
-EC_KEY *EC_KEY_new_method(ENGINE *engine)
+EC_KEY *EC_KEY_new_method(ossl_unused ENGINE *engine)
 {
-    return ossl_ec_key_new_method_int(NULL, NULL, engine);
+    if (engine != NULL)
+        return NULL;
+    return ossl_ec_key_new_method_int(NULL, NULL);
 }
 #endif

@@ -170,7 +144,7 @@ int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
         memcpy(out, sec, outlen);
     }
     OPENSSL_clear_free(sec, seclen);
-    return outlen;
+    return (int)outlen;
 }

 EC_KEY_METHOD *EC_KEY_METHOD_new(const EC_KEY_METHOD *meth)
diff --git a/deps/openssl/openssl/crypto/ec/ec_lib.c b/deps/openssl/openssl/crypto/ec/ec_lib.c
index e29e39aca56..6df9774ed90 100644
--- a/deps/openssl/openssl/crypto/ec/ec_lib.c
+++ b/deps/openssl/openssl/crypto/ec/ec_lib.c
@@ -21,6 +21,7 @@
 #include <openssl/opensslv.h>
 #include <openssl/param_build.h>
 #include "crypto/ec.h"
+#include "crypto/ec_params.h"
 #include "crypto/bn.h"
 #include "internal/nelem.h"
 #include "ec_local.h"
@@ -242,9 +243,9 @@ int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)
     }

     if ((src->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0) {
-        if (!BN_copy(dest->order, src->order))
+        if (BN_copy(dest->order, src->order) == NULL)
             return 0;
-        if (!BN_copy(dest->cofactor, src->cofactor))
+        if (BN_copy(dest->cofactor, src->cofactor) == NULL)
             return 0;
     }

@@ -348,7 +349,7 @@ static int ec_guess_cofactor(EC_GROUP *group)
         if (!BN_set_bit(q, BN_num_bits(group->field) - 1))
             goto err;
     } else {
-        if (!BN_copy(q, group->field))
+        if (BN_copy(q, group->field) == NULL)
             goto err;
     }

@@ -411,12 +412,12 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
     if (!EC_POINT_copy(group->generator, generator))
         return 0;

-    if (!BN_copy(group->order, order))
+    if (BN_copy(group->order, order) == NULL)
         return 0;

     /* Either take the provided positive cofactor, or try to compute it */
     if (cofactor != NULL && !BN_is_zero(cofactor)) {
-        if (!BN_copy(group->cofactor, cofactor))
+        if (BN_copy(group->cofactor, cofactor) == NULL)
             return 0;
     } else if (!ec_guess_cofactor(group)) {
         BN_zero(group->cofactor);
@@ -451,7 +452,7 @@ int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
 {
     if (group->order == NULL)
         return 0;
-    if (!BN_copy(order, group->order))
+    if (BN_copy(order, group->order) == NULL)
         return 0;

     return !BN_is_zero(order);
@@ -467,13 +468,39 @@ int EC_GROUP_order_bits(const EC_GROUP *group)
     return group->meth->group_order_bits(group);
 }

+int EC_GROUP_security_bits(const EC_GROUP *group)
+{
+    int ecbits = group->meth->group_order_bits(group);
+
+    /*
+     * The following estimates are based on the values published in Table 2 of
+     * "NIST Special Publication 800-57 Part 1 Revision 4" at
+     * http://dx.doi.org/10.6028/NIST.SP.800-57pt1r4 .
+     *
+     * Note that the above reference explicitly categorizes algorithms in a
+     * discrete set of values {80, 112, 128, 192, 256}, and that it is relevant
+     * only for NIST approved Elliptic Curves, while OpenSSL applies the same
+     * logic also to other curves.
+     */
+    if (ecbits >= 512)
+        return 256;
+    if (ecbits >= 384)
+        return 192;
+    if (ecbits >= 256)
+        return 128;
+    if (ecbits >= 224)
+        return 112;
+    if (ecbits >= 160)
+        return 80;
+    return ecbits / 2;
+}
+
 int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,
     BN_CTX *ctx)
 {
-
     if (group->cofactor == NULL)
         return 0;
-    if (!BN_copy(cofactor, group->cofactor))
+    if (BN_copy(cofactor, group->cofactor) == NULL)
         return 0;

     return !BN_is_zero(group->cofactor);
@@ -904,6 +931,9 @@ int EC_POINT_get_affine_coordinates(const EC_GROUP *group,
     const EC_POINT *point, BIGNUM *x, BIGNUM *y,
     BN_CTX *ctx)
 {
+    BN_CTX *new_ctx = NULL;
+    int ret = 0;
+
     if (group->meth->point_get_affine_coordinates == NULL) {
         ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
         return 0;
@@ -916,7 +946,24 @@ int EC_POINT_get_affine_coordinates(const EC_GROUP *group,
         ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
         return 0;
     }
-    return group->meth->point_get_affine_coordinates(group, point, x, y, ctx);
+    if (point->Z_is_one) {
+        if (group->meth->field_decode != NULL) {
+            if (ctx == NULL && (ctx = new_ctx = BN_CTX_new_ex(group->libctx)) == NULL) {
+                ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
+                return 0;
+            }
+            if ((x != NULL && !group->meth->field_decode(group, x, point->X, ctx))
+                || (y != NULL && !group->meth->field_decode(group, y, point->Y, ctx)))
+                goto err;
+        } else if ((x != NULL && BN_copy(x, point->X) == NULL)
+            || (y != NULL && BN_copy(y, point->Y) == NULL))
+            goto err;
+        ret = 1;
+    } else
+        ret = group->meth->point_get_affine_coordinates(group, point, x, y, ctx);
+err:
+    BN_CTX_free(new_ctx);
+    return ret;
 }

 #ifndef OPENSSL_NO_DEPRECATED_3_0
@@ -1502,34 +1549,34 @@ static EC_GROUP *group_new_from_name(const OSSL_PARAM *p,
 }

 /* These parameters can be set directly into an EC_GROUP */
-int ossl_ec_group_set_params(EC_GROUP *group, const OSSL_PARAM params[])
+int ossl_ec_group_set_params_parsed(EC_GROUP *group, const EC_PARAMS *params)
 {
     int encoding_flag = -1, format = -1;
-    const OSSL_PARAM *p;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT);
-    if (p != NULL) {
-        if (!ossl_ec_pt_format_param2id(p, &format)) {
+    if (params == NULL)
+        return 0;
+
+    if (params->pt_format != NULL) {
+        if (!ossl_ec_pt_format_param2id(params->pt_format, &format)) {
             ERR_raise(ERR_LIB_EC, EC_R_INVALID_FORM);
             return 0;
         }
         EC_GROUP_set_point_conversion_form(group, format);
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_ENCODING);
-    if (p != NULL) {
-        if (!ossl_ec_encoding_param2id(p, &encoding_flag)) {
+    if (params->encoding != NULL) {
+        if (!ossl_ec_encoding_param2id(params->encoding, &encoding_flag)) {
             ERR_raise(ERR_LIB_EC, EC_R_INVALID_FORM);
             return 0;
         }
         EC_GROUP_set_asn1_flag(group, encoding_flag);
     }
     /* Optional seed */
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_SEED);
-    if (p != NULL) {
+    if (params->seed != NULL) {
         /* The seed is allowed to be NULL */
-        if (p->data_type != OSSL_PARAM_OCTET_STRING
-            || !EC_GROUP_set_seed(group, p->data, p->data_size)) {
+        if (params->seed->data_type != OSSL_PARAM_OCTET_STRING
+            || !EC_GROUP_set_seed(group, params->seed->data,
+                params->seed->data_size)) {
             ERR_raise(ERR_LIB_EC, EC_R_INVALID_SEED);
             return 0;
         }
@@ -1537,7 +1584,16 @@ int ossl_ec_group_set_params(EC_GROUP *group, const OSSL_PARAM params[])
     return 1;
 }

-EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
+int ossl_ec_group_set_params(EC_GROUP *group, const OSSL_PARAM params[])
+{
+    EC_PARAMS p;
+
+    if (!ec_group_fromdata_decoder(params, &p))
+        return 0;
+    return ossl_ec_group_set_params_parsed(group, &p);
+}
+
+EC_GROUP *ossl_ec_group_new_from_params_parsed(const EC_PARAMS *params,
     OSSL_LIB_CTX *libctx, const char *propq)
 {
     const OSSL_PARAM *ptmp;
@@ -1553,23 +1609,27 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
     int is_prime_field = 1;
     BN_CTX *bnctx = NULL;
     const unsigned char *buf = NULL;
+#ifndef OPENSSL_NO_EC_EXPLICIT_CURVES
     int encoding_flag = -1;
+#endif
 #endif

     /* This is the simple named group case */
-    ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_GROUP_NAME);
+    if (params == NULL)
+        return NULL;
+
+    ptmp = params->group_name;
     if (ptmp != NULL) {
         int decoded = 0;

         if ((group = group_new_from_name(ptmp, libctx, propq)) == NULL)
             return NULL;
-        if (!ossl_ec_group_set_params(group, params)) {
+        if (!ossl_ec_group_set_params_parsed(group, params)) {
             EC_GROUP_free(group);
             return NULL;
         }

-        ptmp = OSSL_PARAM_locate_const(params,
-            OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS);
+        ptmp = params->decoded;
         if (ptmp != NULL && !OSSL_PARAM_get_int(ptmp, &decoded)) {
             ERR_raise(ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS);
             EC_GROUP_free(group);
@@ -1599,7 +1659,7 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
         goto err;
     }

-    ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_FIELD_TYPE);
+    ptmp = params->field_type;
     if (ptmp == NULL || ptmp->data_type != OSSL_PARAM_UTF8_STRING) {
         ERR_raise(ERR_LIB_EC, EC_R_INVALID_FIELD);
         goto err;
@@ -1616,19 +1676,19 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
         goto err;
     }

-    pa = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_A);
+    pa = params->a;
     if (!OSSL_PARAM_get_BN(pa, &a)) {
         ERR_raise(ERR_LIB_EC, EC_R_INVALID_A);
         goto err;
     }
-    pb = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_B);
+    pb = params->b;
     if (!OSSL_PARAM_get_BN(pb, &b)) {
         ERR_raise(ERR_LIB_EC, EC_R_INVALID_B);
         goto err;
     }

     /* extract the prime number or irreducible polynomial */
-    ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_P);
+    ptmp = params->p;
     if (!OSSL_PARAM_get_BN(ptmp, &p)) {
         ERR_raise(ERR_LIB_EC, EC_R_INVALID_P);
         goto err;
@@ -1670,7 +1730,7 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
     }

     /* Optional seed */
-    ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_SEED);
+    ptmp = params->seed;
     if (ptmp != NULL) {
         if (ptmp->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_EC, EC_R_INVALID_SEED);
@@ -1681,7 +1741,7 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
     }

     /* generator base point */
-    ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_GENERATOR);
+    ptmp = params->generator;
     if (ptmp == NULL
         || ptmp->data_type != OSSL_PARAM_OCTET_STRING
         || ptmp->data_size == 0) {
@@ -1699,7 +1759,7 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
     }

     /* order */
-    ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_ORDER);
+    ptmp = params->order;
     if (!OSSL_PARAM_get_BN(ptmp, &order)
         || (BN_is_negative(order) || BN_is_zero(order))
         || (BN_num_bits(order) > (int)field_bits + 1)) { /* Hasse bound */
@@ -1708,7 +1768,7 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
     }

     /* Optional cofactor */
-    ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_COFACTOR);
+    ptmp = params->cofactor;
     if (ptmp != NULL) {
         cofactor = BN_CTX_get(bnctx);
         if (cofactor == NULL || !OSSL_PARAM_get_BN(ptmp, &cofactor)) {
@@ -1729,11 +1789,17 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
         goto err;
     }
     if (named_group == group) {
+#ifdef OPENSSL_NO_EC_EXPLICIT_CURVES
+        if (EC_GROUP_check_named_curve(group, 0, NULL) == NID_undef) {
+            ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_GROUP);
+            goto err;
+        }
+#else
         /*
          * If we did not find a named group then the encoding should be explicit
          * if it was specified
          */
-        ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_ENCODING);
+        ptmp = params->encoding;
         if (ptmp != NULL
             && !ossl_ec_encoding_param2id(ptmp, &encoding_flag)) {
             ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
@@ -1744,10 +1810,13 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
             goto err;
         }
         EC_GROUP_set_asn1_flag(group, OPENSSL_EC_EXPLICIT_CURVE);
+#endif
     } else {
         EC_GROUP_free(group);
         group = named_group;
     }
+    if (!ossl_ec_group_set_params_parsed(group, params))
+        goto err;
     /* We've imported the group from explicit parameters, set it so. */
     group->decoded_from_explicit_params = 1;
     ok = 1;
@@ -1764,6 +1833,16 @@ err:
 #endif /* FIPS_MODULE */
 }

+EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
+    OSSL_LIB_CTX *libctx, const char *propq)
+{
+    EC_PARAMS p;
+
+    if (!ec_group_fromdata_decoder(params, &p))
+        return NULL;
+    return ossl_ec_group_new_from_params_parsed(&p, libctx, propq);
+}
+
 OSSL_PARAM *EC_GROUP_to_params(const EC_GROUP *group, OSSL_LIB_CTX *libctx,
     const char *propq, BN_CTX *bnctx)
 {
diff --git a/deps/openssl/openssl/crypto/ec/ec_local.h b/deps/openssl/openssl/crypto/ec/ec_local.h
index 2bff820ca86..8ddda4516b3 100644
--- a/deps/openssl/openssl/crypto/ec/ec_local.h
+++ b/deps/openssl/openssl/crypto/ec/ec_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -8,6 +8,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_EC_EC_LOCAL_H)
+#define OSSL_LIBCRYPTO_EC_EC_LOCAL_H
+
 #include <stdlib.h>

 #include <openssl/obj_mac.h>
@@ -293,13 +296,11 @@ struct ec_group_st {

 struct ec_key_st {
     const EC_KEY_METHOD *meth;
-    ENGINE *engine;
     int version;
     EC_GROUP *group;
     EC_POINT *pub_key;
     BIGNUM *priv_key;
     unsigned int enc_flag;
-    point_conversion_form_t conv_form;
     CRYPTO_REF_COUNT references;
     int flags;
 #ifndef FIPS_MODULE
@@ -689,8 +690,7 @@ struct ec_key_method_st {

 #define EC_KEY_METHOD_DYNAMIC 1

-EC_KEY *ossl_ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq,
-    ENGINE *engine);
+EC_KEY *ossl_ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq);

 int ossl_ec_key_gen(EC_KEY *eckey);
 int ossl_ecdh_compute_key(unsigned char **pout, size_t *poutlen,
@@ -796,3 +796,5 @@ static ossl_inline int ec_point_ladder_post(const EC_GROUP *group,

     return 1;
 }
+
+#endif /* !defined(OSSL_LIBCRYPTO_EC_EC_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/ec/ec_mult.c b/deps/openssl/openssl/crypto/ec/ec_mult.c
index f7c6148eb25..19e35c339e8 100644
--- a/deps/openssl/openssl/crypto/ec/ec_mult.c
+++ b/deps/openssl/openssl/crypto/ec/ec_mult.c
@@ -72,8 +72,8 @@ static EC_PRE_COMP *ec_pre_comp_new(const EC_GROUP *group)
 EC_PRE_COMP *EC_ec_pre_comp_dup(EC_PRE_COMP *pre)
 {
     int i;
-    if (pre != NULL)
-        CRYPTO_UP_REF(&pre->references, &i);
+    if (pre == NULL || !CRYPTO_UP_REF(&pre->references, &i))
+        return NULL;
     return pre;
 }

@@ -224,7 +224,7 @@ int ossl_ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r,
      * the subsequent arithmetic constant time regardless, but cannot
      * retroactively fix the copy length here.
      */
-    if (!BN_copy(k, scalar)) {
+    if (BN_copy(k, scalar) == NULL) {
         ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
         goto err;
     }
@@ -539,11 +539,11 @@ int ossl_ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,

     totalnum = num + numblocks;

-    wsize = OPENSSL_malloc(totalnum * sizeof(wsize[0]));
-    wNAF_len = OPENSSL_malloc(totalnum * sizeof(wNAF_len[0]));
+    wsize = OPENSSL_malloc_array(totalnum, sizeof(wsize[0]));
+    wNAF_len = OPENSSL_malloc_array(totalnum, sizeof(wNAF_len[0]));
     /* include space for pivot */
-    wNAF = OPENSSL_malloc((totalnum + 1) * sizeof(wNAF[0]));
-    val_sub = OPENSSL_malloc(totalnum * sizeof(val_sub[0]));
+    wNAF = OPENSSL_malloc_array(totalnum + 1, sizeof(wNAF[0]));
+    val_sub = OPENSSL_malloc_array(totalnum, sizeof(val_sub[0]));

     /* Ensure wNAF is initialised in case we end up going to err */
     if (wNAF != NULL)
@@ -564,7 +564,7 @@ int ossl_ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
         wsize[i] = EC_window_bits_for_scalar_size(bits);
         num_val += (size_t)1 << (wsize[i] - 1);
         wNAF[i + 1] = NULL; /* make sure we always have a pivot */
-        wNAF[i] = bn_compute_wNAF((i < num ? scalars[i] : scalar), wsize[i],
+        wNAF[i] = bn_compute_wNAF((i < num ? scalars[i] : scalar), (int)wsize[i],
             &wNAF_len[i]);
         if (wNAF[i] == NULL)
             goto err;
@@ -594,7 +594,7 @@ int ossl_ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
              * use the window size for which we have precomputation
              */
             wsize[num] = pre_comp->w;
-            tmp_wNAF = bn_compute_wNAF(scalar, wsize[num], &tmp_len);
+            tmp_wNAF = bn_compute_wNAF(scalar, (int)wsize[num], &tmp_len);
             if (!tmp_wNAF)
                 goto err;

@@ -685,7 +685,7 @@ int ossl_ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
      * 'val_sub[i]' is a pointer to the subarray for the i-th point, or to a
      * subarray of 'pre_comp->points' if we already have precomputation.
      */
-    val = OPENSSL_malloc((num_val + 1) * sizeof(val[0]));
+    val = OPENSSL_malloc_array(num_val + 1, sizeof(val[0]));
     if (val == NULL)
         goto err;
     val[num_val] = NULL; /* pivot element */
@@ -741,7 +741,9 @@ int ossl_ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,

     r_is_at_infinity = 1;

-    for (k = max_len - 1; k >= 0; k--) {
+    if (max_len > INT_MAX)
+        goto err;
+    for (k = (int)(max_len - 1); k >= 0; k--) {
         if (!r_is_at_infinity) {
             if (!EC_POINT_dbl(group, r, r, ctx))
                 goto err;
@@ -913,7 +915,7 @@ int ossl_ec_wNAF_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
     num = pre_points_per_block * numblocks; /* number of points to compute
                                              * and store */

-    points = OPENSSL_malloc(sizeof(*points) * (num + 1));
+    points = OPENSSL_malloc_array(num + 1, sizeof(*points));
     if (points == NULL)
         goto err;

diff --git a/deps/openssl/openssl/crypto/ec/ec_pmeth.c b/deps/openssl/openssl/crypto/ec/ec_pmeth.c
deleted file mode 100644
index 1ef1743d781..00000000000
--- a/deps/openssl/openssl/crypto/ec/ec_pmeth.c
+++ /dev/null
@@ -1,504 +0,0 @@
-/*
- * Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * ECDH and ECDSA low level APIs are deprecated for public use, but still ok
- * for internal use.
- */
-#include "internal/deprecated.h"
-
-#include <stdio.h>
-#include "internal/cryptlib.h"
-#include <openssl/asn1t.h>
-#include <openssl/x509.h>
-#include <openssl/ec.h>
-#include "ec_local.h"
-#include <openssl/evp.h>
-#include "crypto/evp.h"
-
-/* EC pkey context structure */
-
-typedef struct {
-    /* Key and paramgen group */
-    EC_GROUP *gen_group;
-    /* message digest */
-    const EVP_MD *md;
-    /* Duplicate key if custom cofactor needed */
-    EC_KEY *co_key;
-    /* Cofactor mode */
-    signed char cofactor_mode;
-    /* KDF (if any) to use for ECDH */
-    char kdf_type;
-    /* Message digest to use for key derivation */
-    const EVP_MD *kdf_md;
-    /* User key material */
-    unsigned char *kdf_ukm;
-    size_t kdf_ukmlen;
-    /* KDF output length */
-    size_t kdf_outlen;
-} EC_PKEY_CTX;
-
-static int pkey_ec_init(EVP_PKEY_CTX *ctx)
-{
-    EC_PKEY_CTX *dctx;
-
-    if ((dctx = OPENSSL_zalloc(sizeof(*dctx))) == NULL)
-        return 0;
-
-    dctx->cofactor_mode = -1;
-    dctx->kdf_type = EVP_PKEY_ECDH_KDF_NONE;
-    ctx->data = dctx;
-    return 1;
-}
-
-static int pkey_ec_copy(EVP_PKEY_CTX *dst, const EVP_PKEY_CTX *src)
-{
-    EC_PKEY_CTX *dctx, *sctx;
-    if (!pkey_ec_init(dst))
-        return 0;
-    sctx = src->data;
-    dctx = dst->data;
-    if (sctx->gen_group) {
-        dctx->gen_group = EC_GROUP_dup(sctx->gen_group);
-        if (!dctx->gen_group)
-            return 0;
-    }
-    dctx->md = sctx->md;
-
-    if (sctx->co_key) {
-        dctx->co_key = EC_KEY_dup(sctx->co_key);
-        if (!dctx->co_key)
-            return 0;
-    }
-    dctx->kdf_type = sctx->kdf_type;
-    dctx->kdf_md = sctx->kdf_md;
-    dctx->kdf_outlen = sctx->kdf_outlen;
-    if (sctx->kdf_ukm) {
-        dctx->kdf_ukm = OPENSSL_memdup(sctx->kdf_ukm, sctx->kdf_ukmlen);
-        if (!dctx->kdf_ukm)
-            return 0;
-    } else
-        dctx->kdf_ukm = NULL;
-    dctx->kdf_ukmlen = sctx->kdf_ukmlen;
-    return 1;
-}
-
-static void pkey_ec_cleanup(EVP_PKEY_CTX *ctx)
-{
-    EC_PKEY_CTX *dctx = ctx->data;
-    if (dctx != NULL) {
-        EC_GROUP_free(dctx->gen_group);
-        EC_KEY_free(dctx->co_key);
-        OPENSSL_free(dctx->kdf_ukm);
-        OPENSSL_free(dctx);
-        ctx->data = NULL;
-    }
-}
-
-static int pkey_ec_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
-    const unsigned char *tbs, size_t tbslen)
-{
-    int ret, type;
-    unsigned int sltmp;
-    EC_PKEY_CTX *dctx = ctx->data;
-    /*
-     * Discard const. Its marked as const because this may be a cached copy of
-     * the "real" key. These calls don't make any modifications that need to
-     * be reflected back in the "original" key.
-     */
-    EC_KEY *ec = (EC_KEY *)EVP_PKEY_get0_EC_KEY(ctx->pkey);
-    const int sig_sz = ECDSA_size(ec);
-
-    /* ensure cast to size_t is safe */
-    if (!ossl_assert(sig_sz > 0))
-        return 0;
-
-    if (sig == NULL) {
-        *siglen = (size_t)sig_sz;
-        return 1;
-    }
-
-    if (*siglen < (size_t)sig_sz) {
-        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
-        return 0;
-    }
-
-    type = (dctx->md != NULL) ? EVP_MD_get_type(dctx->md) : NID_sha1;
-
-    ret = ECDSA_sign(type, tbs, tbslen, sig, &sltmp, ec);
-
-    if (ret <= 0)
-        return ret;
-    *siglen = (size_t)sltmp;
-    return 1;
-}
-
-static int pkey_ec_verify(EVP_PKEY_CTX *ctx,
-    const unsigned char *sig, size_t siglen,
-    const unsigned char *tbs, size_t tbslen)
-{
-    int ret, type;
-    EC_PKEY_CTX *dctx = ctx->data;
-    /*
-     * Discard const. Its marked as const because this may be a cached copy of
-     * the "real" key. These calls don't make any modifications that need to
-     * be reflected back in the "original" key.
-     */
-    EC_KEY *ec = (EC_KEY *)EVP_PKEY_get0_EC_KEY(ctx->pkey);
-
-    if (dctx->md)
-        type = EVP_MD_get_type(dctx->md);
-    else
-        type = NID_sha1;
-
-    ret = ECDSA_verify(type, tbs, tbslen, sig, siglen, ec);
-
-    return ret;
-}
-
-#ifndef OPENSSL_NO_EC
-static int pkey_ec_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)
-{
-    int ret;
-    size_t outlen;
-    const EC_POINT *pubkey = NULL;
-    EC_KEY *eckey;
-    const EC_KEY *eckeypub;
-    EC_PKEY_CTX *dctx = ctx->data;
-
-    if (ctx->pkey == NULL || ctx->peerkey == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_KEYS_NOT_SET);
-        return 0;
-    }
-    eckeypub = EVP_PKEY_get0_EC_KEY(ctx->peerkey);
-    if (eckeypub == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_KEYS_NOT_SET);
-        return 0;
-    }
-
-    eckey = dctx->co_key ? dctx->co_key
-                         : (EC_KEY *)EVP_PKEY_get0_EC_KEY(ctx->pkey);
-
-    if (!key) {
-        const EC_GROUP *group;
-        group = EC_KEY_get0_group(eckey);
-
-        if (group == NULL)
-            return 0;
-        *keylen = (EC_GROUP_get_degree(group) + 7) / 8;
-        return 1;
-    }
-    pubkey = EC_KEY_get0_public_key(eckeypub);
-
-    /*
-     * NB: unlike PKCS#3 DH, if *outlen is less than maximum size this is not
-     * an error, the result is truncated.
-     */
-
-    outlen = *keylen;
-
-    ret = ECDH_compute_key(key, outlen, pubkey, eckey, 0);
-    if (ret <= 0)
-        return 0;
-    *keylen = ret;
-    return 1;
-}
-
-static int pkey_ec_kdf_derive(EVP_PKEY_CTX *ctx,
-    unsigned char *key, size_t *keylen)
-{
-    EC_PKEY_CTX *dctx = ctx->data;
-    unsigned char *ktmp = NULL;
-    size_t ktmplen;
-    int rv = 0;
-    if (dctx->kdf_type == EVP_PKEY_ECDH_KDF_NONE)
-        return pkey_ec_derive(ctx, key, keylen);
-    if (!key) {
-        *keylen = dctx->kdf_outlen;
-        return 1;
-    }
-    if (*keylen != dctx->kdf_outlen)
-        return 0;
-    if (!pkey_ec_derive(ctx, NULL, &ktmplen))
-        return 0;
-    if ((ktmp = OPENSSL_malloc(ktmplen)) == NULL)
-        return 0;
-    if (!pkey_ec_derive(ctx, ktmp, &ktmplen))
-        goto err;
-    /* Do KDF stuff */
-    if (!ossl_ecdh_kdf_X9_63(key, *keylen, ktmp, ktmplen,
-            dctx->kdf_ukm, dctx->kdf_ukmlen, dctx->kdf_md,
-            ctx->libctx, ctx->propquery))
-        goto err;
-    rv = 1;
-
-err:
-    OPENSSL_clear_free(ktmp, ktmplen);
-    return rv;
-}
-#endif
-
-static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
-{
-    EC_PKEY_CTX *dctx = ctx->data;
-    EC_GROUP *group;
-    switch (type) {
-    case EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID:
-        group = EC_GROUP_new_by_curve_name(p1);
-        if (group == NULL) {
-            ERR_raise(ERR_LIB_EC, EC_R_INVALID_CURVE);
-            return 0;
-        }
-        EC_GROUP_free(dctx->gen_group);
-        dctx->gen_group = group;
-        return 1;
-
-    case EVP_PKEY_CTRL_EC_PARAM_ENC:
-        if (!dctx->gen_group) {
-            ERR_raise(ERR_LIB_EC, EC_R_NO_PARAMETERS_SET);
-            return 0;
-        }
-        EC_GROUP_set_asn1_flag(dctx->gen_group, p1);
-        return 1;
-
-#ifndef OPENSSL_NO_EC
-    case EVP_PKEY_CTRL_EC_ECDH_COFACTOR:
-        if (p1 == -2) {
-            if (dctx->cofactor_mode != -1)
-                return dctx->cofactor_mode;
-            else {
-                const EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(ctx->pkey);
-                return EC_KEY_get_flags(ec_key) & EC_FLAG_COFACTOR_ECDH ? 1 : 0;
-            }
-        } else if (p1 < -1 || p1 > 1)
-            return -2;
-        dctx->cofactor_mode = p1;
-        if (p1 != -1) {
-            EC_KEY *ec_key = (EC_KEY *)EVP_PKEY_get0_EC_KEY(ctx->pkey);
-
-            /*
-             * We discarded the "const" above. This will only work if the key is
-             * a "real" legacy key, and not a cached copy of a provided key
-             */
-            if (evp_pkey_is_provided(ctx->pkey)) {
-                ERR_raise(ERR_LIB_EC, ERR_R_UNSUPPORTED);
-                return 0;
-            }
-            if (!ec_key->group)
-                return -2;
-            /* If cofactor is 1 cofactor mode does nothing */
-            if (BN_is_one(ec_key->group->cofactor))
-                return 1;
-            if (!dctx->co_key) {
-                dctx->co_key = EC_KEY_dup(ec_key);
-                if (!dctx->co_key)
-                    return 0;
-            }
-            if (p1)
-                EC_KEY_set_flags(dctx->co_key, EC_FLAG_COFACTOR_ECDH);
-            else
-                EC_KEY_clear_flags(dctx->co_key, EC_FLAG_COFACTOR_ECDH);
-        } else {
-            EC_KEY_free(dctx->co_key);
-            dctx->co_key = NULL;
-        }
-        return 1;
-#endif
-
-    case EVP_PKEY_CTRL_EC_KDF_TYPE:
-        if (p1 == -2)
-            return dctx->kdf_type;
-        if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_63)
-            return -2;
-        dctx->kdf_type = p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_EC_KDF_MD:
-        dctx->kdf_md = p2;
-        return 1;
-
-    case EVP_PKEY_CTRL_GET_EC_KDF_MD:
-        *(const EVP_MD **)p2 = dctx->kdf_md;
-        return 1;
-
-    case EVP_PKEY_CTRL_EC_KDF_OUTLEN:
-        if (p1 <= 0)
-            return -2;
-        dctx->kdf_outlen = (size_t)p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN:
-        *(int *)p2 = dctx->kdf_outlen;
-        return 1;
-
-    case EVP_PKEY_CTRL_EC_KDF_UKM:
-        OPENSSL_free(dctx->kdf_ukm);
-        dctx->kdf_ukm = p2;
-        if (p2)
-            dctx->kdf_ukmlen = p1;
-        else
-            dctx->kdf_ukmlen = 0;
-        return 1;
-
-    case EVP_PKEY_CTRL_GET_EC_KDF_UKM:
-        *(unsigned char **)p2 = dctx->kdf_ukm;
-        return dctx->kdf_ukmlen;
-
-    case EVP_PKEY_CTRL_MD:
-        if (EVP_MD_get_type((const EVP_MD *)p2) != NID_sha1 && EVP_MD_get_type((const EVP_MD *)p2) != NID_ecdsa_with_SHA1 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha224 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha256 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha384 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha512 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha3_224 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha3_256 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha3_384 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sha3_512 && EVP_MD_get_type((const EVP_MD *)p2) != NID_sm3) {
-            ERR_raise(ERR_LIB_EC, EC_R_INVALID_DIGEST_TYPE);
-            return 0;
-        }
-        dctx->md = p2;
-        return 1;
-
-    case EVP_PKEY_CTRL_GET_MD:
-        *(const EVP_MD **)p2 = dctx->md;
-        return 1;
-
-    case EVP_PKEY_CTRL_PEER_KEY:
-        /* Default behaviour is OK */
-    case EVP_PKEY_CTRL_DIGESTINIT:
-    case EVP_PKEY_CTRL_PKCS7_SIGN:
-    case EVP_PKEY_CTRL_CMS_SIGN:
-        return 1;
-
-    default:
-        return -2;
-    }
-}
-
-static int pkey_ec_ctrl_str(EVP_PKEY_CTX *ctx,
-    const char *type, const char *value)
-{
-    if (strcmp(type, "ec_paramgen_curve") == 0) {
-        int nid;
-        nid = EC_curve_nist2nid(value);
-        if (nid == NID_undef)
-            nid = OBJ_sn2nid(value);
-        if (nid == NID_undef)
-            nid = OBJ_ln2nid(value);
-        if (nid == NID_undef) {
-            ERR_raise(ERR_LIB_EC, EC_R_INVALID_CURVE);
-            return 0;
-        }
-        return EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid);
-    } else if (strcmp(type, "ec_param_enc") == 0) {
-        int param_enc;
-        if (strcmp(value, "explicit") == 0)
-            param_enc = 0;
-        else if (strcmp(value, "named_curve") == 0)
-            param_enc = OPENSSL_EC_NAMED_CURVE;
-        else
-            return -2;
-        return EVP_PKEY_CTX_set_ec_param_enc(ctx, param_enc);
-    } else if (strcmp(type, "ecdh_kdf_md") == 0) {
-        const EVP_MD *md;
-        if ((md = EVP_get_digestbyname(value)) == NULL) {
-            ERR_raise(ERR_LIB_EC, EC_R_INVALID_DIGEST);
-            return 0;
-        }
-        return EVP_PKEY_CTX_set_ecdh_kdf_md(ctx, md);
-    } else if (strcmp(type, "ecdh_cofactor_mode") == 0) {
-        int co_mode;
-        co_mode = atoi(value);
-        return EVP_PKEY_CTX_set_ecdh_cofactor_mode(ctx, co_mode);
-    }
-
-    return -2;
-}
-
-static int pkey_ec_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
-{
-    EC_KEY *ec = NULL;
-    EC_PKEY_CTX *dctx = ctx->data;
-    int ret;
-
-    if (dctx->gen_group == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_NO_PARAMETERS_SET);
-        return 0;
-    }
-    ec = EC_KEY_new();
-    if (ec == NULL)
-        return 0;
-    if (!(ret = EC_KEY_set_group(ec, dctx->gen_group))
-        || !ossl_assert(ret = EVP_PKEY_assign_EC_KEY(pkey, ec)))
-        EC_KEY_free(ec);
-    return ret;
-}
-
-static int pkey_ec_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
-{
-    EC_KEY *ec = NULL;
-    EC_PKEY_CTX *dctx = ctx->data;
-    int ret;
-
-    if (ctx->pkey == NULL && dctx->gen_group == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_NO_PARAMETERS_SET);
-        return 0;
-    }
-    ec = EC_KEY_new();
-    if (ec == NULL)
-        return 0;
-    if (!ossl_assert(EVP_PKEY_assign_EC_KEY(pkey, ec))) {
-        EC_KEY_free(ec);
-        return 0;
-    }
-    /* Note: if error is returned, we count on caller to free pkey->pkey.ec */
-    if (ctx->pkey != NULL)
-        ret = EVP_PKEY_copy_parameters(pkey, ctx->pkey);
-    else
-        ret = EC_KEY_set_group(ec, dctx->gen_group);
-
-    return ret ? EC_KEY_generate_key(ec) : 0;
-}
-
-static const EVP_PKEY_METHOD ec_pkey_meth = {
-    EVP_PKEY_EC,
-    0,
-    pkey_ec_init,
-    pkey_ec_copy,
-    pkey_ec_cleanup,
-
-    0,
-    pkey_ec_paramgen,
-
-    0,
-    pkey_ec_keygen,
-
-    0,
-    pkey_ec_sign,
-
-    0,
-    pkey_ec_verify,
-
-    0, 0,
-
-    0, 0, 0, 0,
-
-    0,
-    0,
-
-    0,
-    0,
-
-    0,
-#ifndef OPENSSL_NO_EC
-    pkey_ec_kdf_derive,
-#else
-    0,
-#endif
-    pkey_ec_ctrl,
-    pkey_ec_ctrl_str
-};
-
-const EVP_PKEY_METHOD *ossl_ec_pkey_method(void)
-{
-    return &ec_pkey_meth;
-}
diff --git a/deps/openssl/openssl/crypto/ec/ecdsa_ossl.c b/deps/openssl/openssl/crypto/ec/ecdsa_ossl.c
index 83bb6294b0c..ad5b16df834 100644
--- a/deps/openssl/openssl/crypto/ec/ecdsa_ossl.c
+++ b/deps/openssl/openssl/crypto/ec/ecdsa_ossl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -198,13 +198,11 @@ static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in,

             if (dgst != NULL) {
                 if (nonce_type == 1) {
-#ifndef FIPS_MODULE
                     res = ossl_gen_deterministic_nonce_rfc6979(k, order,
                         priv_key,
                         dgst, dlen,
                         digestname,
                         libctx, propq);
-#endif
                 } else {
                     res = ossl_bn_gen_dsa_nonce_fixed_top(k, order, priv_key,
                         dgst, dlen, ctx);
diff --git a/deps/openssl/openssl/crypto/ec/eck_prn.c b/deps/openssl/openssl/crypto/ec/eck_prn.c
index 595129c89d6..04c40bc429a 100644
--- a/deps/openssl/openssl/crypto/ec/eck_prn.c
+++ b/deps/openssl/openssl/crypto/ec/eck_prn.c
@@ -242,7 +242,7 @@ static int print_bin(BIO *fp, const char *name, const unsigned char *buf,
         return 0;

     for (i = 0; i < len; i++) {
-        if ((i % 15) == 0) {
+        if ((i % 16) == 0) {
             str[0] = '\n';
             memset(&(str[1]), ' ', off + 4);
             if (BIO_write(fp, str, off + 1 + 4) <= 0)
diff --git a/deps/openssl/openssl/crypto/ec/ecp_mont.c b/deps/openssl/openssl/crypto/ec/ecp_mont.c
index 2ed4a6d6c44..175aa81ae54 100644
--- a/deps/openssl/openssl/crypto/ec/ecp_mont.c
+++ b/deps/openssl/openssl/crypto/ec/ecp_mont.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -294,7 +294,7 @@ int ossl_ec_GFp_mont_field_set_to_one(const EC_GROUP *group, BIGNUM *r,
         return 0;
     }

-    if (!BN_copy(r, group->field_data2))
+    if (BN_copy(r, group->field_data2) == NULL)
         return 0;
     return 1;
 }
diff --git a/deps/openssl/openssl/crypto/ec/ecp_nistp224.c b/deps/openssl/openssl/crypto/ec/ecp_nistp224.c
index 553c0c20204..e39dabe16bb 100644
--- a/deps/openssl/openssl/crypto/ec/ecp_nistp224.c
+++ b/deps/openssl/openssl/crypto/ec/ecp_nistp224.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2010-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -49,9 +49,6 @@
 #error "Your compiler doesn't appear to support 128-bit integer types"
 #endif

-typedef uint8_t u8;
-typedef uint64_t u64;
-
 /******************************************************************************/
 /*-
  * INTERNAL REPRESENTATION OF FIELD ELEMENTS
@@ -84,7 +81,7 @@ typedef widelimb widefelem[7];
  * group order size for the elliptic curve, and we also use this type for
  * scalars for point multiplication.
  */
-typedef u8 felem_bytearray[28];
+typedef uint8_t felem_bytearray[28];

 static const felem_bytearray nistp224_curve_params[5] = {
     { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* p */
@@ -307,7 +304,7 @@ const EC_METHOD *EC_GFp_nistp224_method(void)
 /*
  * Helper functions to convert field elements to/from internal representation
  */
-static void bin28_to_felem(felem out, const u8 in[28])
+static void bin28_to_felem(felem out, const uint8_t in[28])
 {
     out[0] = *((const limb *)(in)) & 0x00ffffffffffffff;
     out[1] = (*((const limb_aX *)(in + 7))) & 0x00ffffffffffffff;
@@ -315,7 +312,7 @@ static void bin28_to_felem(felem out, const u8 in[28])
     out[3] = (*((const limb_aX *)(in + 20))) >> 8;
 }

-static void felem_to_bin28(u8 out[28], const felem in)
+static void felem_to_bin28(uint8_t out[28], const felem in)
 {
     unsigned i;
     for (i = 0; i < 7; ++i) {
@@ -1087,7 +1084,7 @@ static void point_add(felem x3, felem y3, felem z3,
  * copies it to out.
  * The pre_comp array argument should be size of |size| argument
  */
-static void select_point(const u64 idx, unsigned int size,
+static void select_point(const uint64_t idx, unsigned int size,
     const felem pre_comp[][3], felem out[3])
 {
     unsigned i, j;
@@ -1096,7 +1093,7 @@ static void select_point(const u64 idx, unsigned int size,
     memset(out, 0, sizeof(*out) * 3);
     for (i = 0; i < size; i++) {
         const limb *inlimbs = &pre_comp[i][0][0];
-        u64 mask = i ^ idx;
+        uint64_t mask = i ^ idx;
         mask |= mask >> 4;
         mask |= mask >> 2;
         mask |= mask >> 1;
@@ -1124,7 +1121,7 @@ static char get_bit(const felem_bytearray in, unsigned i)
  */
 static void batch_mul(felem x_out, felem y_out, felem z_out,
     const felem_bytearray scalars[],
-    const unsigned num_points, const u8 *g_scalar,
+    const unsigned num_points, const uint8_t *g_scalar,
     const int mixed, const felem pre_comp[][17][3],
     const felem g_pre_comp[2][16][3])
 {
@@ -1132,8 +1129,8 @@ static void batch_mul(felem x_out, felem y_out, felem z_out,
     unsigned num;
     unsigned gen_mul = (g_scalar != NULL);
     felem nq[3], tmp[4];
-    u64 bits;
-    u8 sign, digit;
+    uint64_t bits;
+    uint8_t sign, digit;

     /* set nq to the point at infinity */
     memset(nq, 0, sizeof(nq));
@@ -1237,8 +1234,8 @@ static NISTP224_PRE_COMP *nistp224_pre_comp_new(void)
 NISTP224_PRE_COMP *EC_nistp224_pre_comp_dup(NISTP224_PRE_COMP *p)
 {
     int i;
-    if (p != NULL)
-        CRYPTO_UP_REF(&p->references, &i);
+    if (p == NULL || !CRYPTO_UP_REF(&p->references, &i))
+        return NULL;
     return p;
 }

@@ -1458,10 +1455,10 @@ int ossl_ec_GFp_nistp224_points_mul(const EC_GROUP *group, EC_POINT *r,
              */
             mixed = 1;
         }
-        secrets = OPENSSL_zalloc(sizeof(*secrets) * num_points);
-        pre_comp = OPENSSL_zalloc(sizeof(*pre_comp) * num_points);
+        secrets = OPENSSL_calloc(num_points, sizeof(*secrets));
+        pre_comp = OPENSSL_calloc(num_points, sizeof(*pre_comp));
         if (mixed)
-            tmp_felems = OPENSSL_malloc(sizeof(felem) * (num_points * 17 + 1));
+            tmp_felems = OPENSSL_malloc_array(num_points * 17 + 1, sizeof(felem));
         if ((secrets == NULL) || (pre_comp == NULL)
             || (mixed && (tmp_felems == NULL)))
             goto err;
diff --git a/deps/openssl/openssl/crypto/ec/ecp_nistp256.c b/deps/openssl/openssl/crypto/ec/ecp_nistp256.c
index 9066f2e6b9d..ae5c8389c6c 100644
--- a/deps/openssl/openssl/crypto/ec/ecp_nistp256.c
+++ b/deps/openssl/openssl/crypto/ec/ecp_nistp256.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -50,17 +50,13 @@
 #error "Your compiler doesn't appear to support 128-bit integer types"
 #endif

-typedef uint8_t u8;
-typedef uint32_t u32;
-typedef uint64_t u64;
-
 /*
  * The underlying field. P256 operates over GF(2^256-2^224+2^192+2^96-1). We
  * can serialize an element of this field into 32 bytes. We call this an
  * felem_bytearray.
  */

-typedef u8 felem_bytearray[32];
+typedef uint8_t felem_bytearray[32];

 /*
  * These are the parameters of P256, taken from FIPS 186-3, page 86. These
@@ -115,36 +111,36 @@ static const felem_bytearray nistp256_curve_params[5] = {
 typedef uint128_t limb;
 typedef limb felem[NLIMBS];
 typedef limb longfelem[NLIMBS * 2];
-typedef u64 smallfelem[NLIMBS];
+typedef uint64_t smallfelem[NLIMBS];

 /* This is the value of the prime as four 64-bit words, little-endian. */
-static const u64 kPrime[4] = {
+static const uint64_t kPrime[4] = {
     0xfffffffffffffffful, 0xffffffff, 0, 0xffffffff00000001ul
 };
-static const u64 bottom63bits = 0x7ffffffffffffffful;
+static const uint64_t bottom63bits = 0x7ffffffffffffffful;

 /*
  * bin32_to_felem takes a little-endian byte array and converts it into felem
  * form. This assumes that the CPU is little-endian.
  */
-static void bin32_to_felem(felem out, const u8 in[32])
+static void bin32_to_felem(felem out, const uint8_t in[32])
 {
-    out[0] = *((u64 *)&in[0]);
-    out[1] = *((u64 *)&in[8]);
-    out[2] = *((u64 *)&in[16]);
-    out[3] = *((u64 *)&in[24]);
+    out[0] = *((uint64_t *)&in[0]);
+    out[1] = *((uint64_t *)&in[8]);
+    out[2] = *((uint64_t *)&in[16]);
+    out[3] = *((uint64_t *)&in[24]);
 }

 /*
  * smallfelem_to_bin32 takes a smallfelem and serializes into a little
  * endian, 32 byte array. This assumes that the CPU is little-endian.
  */
-static void smallfelem_to_bin32(u8 out[32], const smallfelem in)
+static void smallfelem_to_bin32(uint8_t out[32], const smallfelem in)
 {
-    *((u64 *)&out[0]) = in[0];
-    *((u64 *)&out[8]) = in[1];
-    *((u64 *)&out[16]) = in[2];
-    *((u64 *)&out[24]) = in[3];
+    *((uint64_t *)&out[0]) = in[0];
+    *((uint64_t *)&out[8]) = in[1];
+    *((uint64_t *)&out[16]) = in[2];
+    *((uint64_t *)&out[24]) = in[3];
 }

 /* BN_to_felem converts an OpenSSL BIGNUM into an felem */
@@ -222,7 +218,7 @@ static void felem_small_sum(felem out, const smallfelem in)
 }

 /* felem_scalar sets out = out * scalar */
-static void felem_scalar(felem out, const u64 scalar)
+static void felem_scalar(felem out, const uint64_t scalar)
 {
     out[0] *= scalar;
     out[1] *= scalar;
@@ -231,7 +227,7 @@ static void felem_scalar(felem out, const u64 scalar)
 }

 /* longfelem_scalar sets out = out * scalar */
-static void longfelem_scalar(longfelem out, const u64 scalar)
+static void longfelem_scalar(longfelem out, const uint64_t scalar)
 {
     out[0] *= scalar;
     out[1] *= scalar;
@@ -376,15 +372,15 @@ static const felem zero110 = { two64m0, two110p32m0, two64m46, two64m32 };
 static void felem_shrink(smallfelem out, const felem in)
 {
     felem tmp;
-    u64 a, b, mask;
-    u64 high, low;
-    static const u64 kPrime3Test = 0x7fffffff00000001ul; /* 2^63 - 2^32 + 1 */
+    uint64_t a, b, mask;
+    uint64_t high, low;
+    static const uint64_t kPrime3Test = 0x7fffffff00000001ul; /* 2^63 - 2^32 + 1 */

     /* Carry 2->3 */
-    tmp[3] = zero110[3] + in[3] + ((u64)(in[2] >> 64));
+    tmp[3] = zero110[3] + in[3] + ((uint64_t)(in[2] >> 64));
     /* tmp[3] < 2^110 */

-    tmp[2] = zero110[2] + (u64)in[2];
+    tmp[2] = zero110[2] + (uint64_t)in[2];
     tmp[0] = zero110[0] + in[0];
     tmp[1] = zero110[1] + in[1];
     /* tmp[0] < 2**110, tmp[1] < 2^111, tmp[2] < 2**65 */
@@ -394,7 +390,7 @@ static void felem_shrink(smallfelem out, const felem in)
      * tmp[3]. We don't update the other words till the end.
      */
     a = tmp[3] >> 64; /* a < 2^46 */
-    tmp[3] = (u64)tmp[3];
+    tmp[3] = (uint64_t)tmp[3];
     tmp[3] -= a;
     tmp[3] += ((limb)a) << 32;
     /* tmp[3] < 2^79 */
@@ -402,7 +398,7 @@ static void felem_shrink(smallfelem out, const felem in)
     b = a;
     a = tmp[3] >> 64; /* a < 2^15 */
     b += a; /* b < 2^46 + 2^15 < 2^47 */
-    tmp[3] = (u64)tmp[3];
+    tmp[3] = (uint64_t)tmp[3];
     tmp[3] -= a;
     tmp[3] += ((limb)a) << 32;
     /* tmp[3] < 2^64 + 2^47 */
@@ -418,7 +414,7 @@ static void felem_shrink(smallfelem out, const felem in)
      * In order to make space in tmp[3] for the carry from 2 -> 3, we
      * conditionally subtract kPrime if tmp[3] is large enough.
      */
-    high = (u64)(tmp[3] >> 64);
+    high = (uint64_t)(tmp[3] >> 64);
     /* As tmp[3] < 2^65, high is either 1 or 0 */
     high = 0 - high;
     /*-
@@ -426,7 +422,7 @@ static void felem_shrink(smallfelem out, const felem in)
      *   all ones   if the high word of tmp[3] is 1
      *   all zeros  if the high word of tmp[3] if 0
      */
-    low = (u64)tmp[3];
+    low = (uint64_t)tmp[3];
     mask = 0 - (low >> 63);
     /*-
      * mask is:
@@ -450,12 +446,12 @@ static void felem_shrink(smallfelem out, const felem in)
     tmp[3] -= mask & kPrime[3];
     /* tmp[3] < 2**64 - 2**32 + 1 */

-    tmp[1] += ((u64)(tmp[0] >> 64));
-    tmp[0] = (u64)tmp[0];
-    tmp[2] += ((u64)(tmp[1] >> 64));
-    tmp[1] = (u64)tmp[1];
-    tmp[3] += ((u64)(tmp[2] >> 64));
-    tmp[2] = (u64)tmp[2];
+    tmp[1] += ((uint64_t)(tmp[0] >> 64));
+    tmp[0] = (uint64_t)tmp[0];
+    tmp[2] += ((uint64_t)(tmp[1] >> 64));
+    tmp[1] = (uint64_t)tmp[1];
+    tmp[3] += ((uint64_t)(tmp[2] >> 64));
+    tmp[2] = (uint64_t)tmp[2];
     /* tmp[i] < 2^64 */

     out[0] = tmp[0];
@@ -483,7 +479,7 @@ static void smallfelem_expand(felem out, const smallfelem in)
 static void smallfelem_square(longfelem out, const smallfelem small)
 {
     limb a;
-    u64 high, low;
+    uint64_t high, low;

     a = ((uint128_t)small[0]) * small[0];
     low = a;
@@ -561,7 +557,7 @@ static void smallfelem_square(longfelem out, const smallfelem small)
  */
 static void felem_square(longfelem out, const felem in)
 {
-    u64 small[4];
+    uint64_t small[4];
     felem_shrink(small, in);
     smallfelem_square(out, small);
 }
@@ -578,7 +574,7 @@ static void smallfelem_mul(longfelem out, const smallfelem small1,
     const smallfelem small2)
 {
     limb a;
-    u64 high, low;
+    uint64_t high, low;

     a = ((uint128_t)small1[0]) * small2[0];
     low = a;
@@ -827,12 +823,12 @@ static void felem_reduce_zero105(felem out, const longfelem in)
  * subtract_u64 sets *result = *result - v and *carry to one if the
  * subtraction underflowed.
  */
-static void subtract_u64(u64 *result, u64 *carry, u64 v)
+static void subtract_u64(uint64_t *result, uint64_t *carry, uint64_t v)
 {
     uint128_t r = *result;
     r -= v;
     *carry = (r >> 64) & 1;
-    *result = (u64)r;
+    *result = (uint64_t)r;
 }

 /*
@@ -842,7 +838,7 @@ static void subtract_u64(u64 *result, u64 *carry, u64 v)
 static void felem_contract(smallfelem out, const felem in)
 {
     unsigned i;
-    u64 all_equal_so_far = 0, result = 0, carry;
+    uint64_t all_equal_so_far = 0, result = 0, carry;

     felem_shrink(out, in);
     /* small is minimal except that the value might be > p */
@@ -850,18 +846,18 @@ static void felem_contract(smallfelem out, const felem in)
     all_equal_so_far--;
     /*
      * We are doing a constant time test if out >= kPrime. We need to compare
-     * each u64, from most-significant to least significant. For each one, if
+     * each uint64_t, from most-significant to least significant. For each one, if
      * all words so far have been equal (m is all ones) then a non-equal
      * result is the answer. Otherwise we continue.
      */
     for (i = 3; i < 4; i--) {
-        u64 equal;
+        uint64_t equal;
         uint128_t a = ((uint128_t)kPrime[i]) - out[i];
         /*
          * if out[i] > kPrime[i] then a will underflow and the high 64-bits
          * will all be set.
          */
-        result |= all_equal_so_far & ((u64)(a >> 64));
+        result |= all_equal_so_far & ((uint64_t)(a >> 64));

         /*
          * if kPrime[i] == out[i] then |equal| will be all zeros and the
@@ -932,9 +928,9 @@ static void smallfelem_mul_contract(smallfelem out, const smallfelem in1,
 static limb smallfelem_is_zero(const smallfelem small)
 {
     limb result;
-    u64 is_p;
+    uint64_t is_p;

-    u64 is_zero = small[0] | small[1] | small[2] | small[3];
+    uint64_t is_zero = small[0] | small[1] | small[2] | small[3];
     is_zero--;
     is_zero &= is_zero << 32;
     is_zero &= is_zero << 16;
@@ -1209,7 +1205,7 @@ static void copy_conditional(felem out, const felem in, limb mask)
 static void copy_small_conditional(felem out, const smallfelem in, limb mask)
 {
     unsigned i;
-    const u64 mask64 = mask;
+    const uint64_t mask64 = mask;
     for (i = 0; i < NLIMBS; ++i) {
         out[i] = ((limb)(in[i] & mask64)) | (out[i] & ~mask);
     }
@@ -1628,17 +1624,17 @@ static const smallfelem gmul[2][16][3] = {
  * select_point selects the |idx|th point from a precomputation table and
  * copies it to out.
  */
-static void select_point(const u64 idx, unsigned int size,
+static void select_point(const uint64_t idx, unsigned int size,
     const smallfelem pre_comp[16][3], smallfelem out[3])
 {
     unsigned i, j;
-    u64 *outlimbs = &out[0][0];
+    uint64_t *outlimbs = &out[0][0];

     memset(out, 0, sizeof(*out) * 3);

     for (i = 0; i < size; i++) {
-        const u64 *inlimbs = (u64 *)&pre_comp[i][0][0];
-        u64 mask = i ^ idx;
+        const uint64_t *inlimbs = (uint64_t *)&pre_comp[i][0][0];
+        uint64_t mask = i ^ idx;
         mask |= mask >> 4;
         mask |= mask >> 2;
         mask |= mask >> 1;
@@ -1666,7 +1662,7 @@ static char get_bit(const felem_bytearray in, int i)
  */
 static void batch_mul(felem x_out, felem y_out, felem z_out,
     const felem_bytearray scalars[],
-    const unsigned num_points, const u8 *g_scalar,
+    const unsigned num_points, const uint8_t *g_scalar,
     const int mixed, const smallfelem pre_comp[][17][3],
     const smallfelem g_pre_comp[2][16][3])
 {
@@ -1674,8 +1670,8 @@ static void batch_mul(felem x_out, felem y_out, felem z_out,
     unsigned num, gen_mul = (g_scalar != NULL);
     felem nq[3], ftmp;
     smallfelem tmp[3];
-    u64 bits;
-    u8 sign, digit;
+    uint64_t bits;
+    uint8_t sign, digit;

     /* set nq to the point at infinity */
     memset(nq, 0, sizeof(nq));
@@ -1856,8 +1852,8 @@ static NISTP256_PRE_COMP *nistp256_pre_comp_new(void)
 NISTP256_PRE_COMP *EC_nistp256_pre_comp_dup(NISTP256_PRE_COMP *p)
 {
     int i;
-    if (p != NULL)
-        CRYPTO_UP_REF(&p->references, &i);
+    if (p == NULL || !CRYPTO_UP_REF(&p->references, &i))
+        return NULL;
     return p;
 }

@@ -2077,10 +2073,11 @@ int ossl_ec_GFp_nistp256_points_mul(const EC_GROUP *group, EC_POINT *r,
              */
             mixed = 1;
         }
-        secrets = OPENSSL_malloc(sizeof(*secrets) * num_points);
-        pre_comp = OPENSSL_malloc(sizeof(*pre_comp) * num_points);
+        secrets = OPENSSL_calloc(num_points, sizeof(*secrets));
+        pre_comp = OPENSSL_calloc(num_points, sizeof(*pre_comp));
         if (mixed)
-            tmp_smallfelems = OPENSSL_malloc(sizeof(*tmp_smallfelems) * (num_points * 17 + 1));
+            tmp_smallfelems = OPENSSL_malloc_array(num_points * 17 + 1,
+                sizeof(*tmp_smallfelems));
         if ((secrets == NULL) || (pre_comp == NULL)
             || (mixed && (tmp_smallfelems == NULL)))
             goto err;
@@ -2089,8 +2086,6 @@ int ossl_ec_GFp_nistp256_points_mul(const EC_GROUP *group, EC_POINT *r,
          * we treat NULL scalars as 0, and NULL points as points at infinity,
          * i.e., they contribute nothing to the linear combination
          */
-        memset(secrets, 0, sizeof(*secrets) * num_points);
-        memset(pre_comp, 0, sizeof(*pre_comp) * num_points);
         for (i = 0; i < num_points; ++i) {
             if (i == num) {
                 /*
diff --git a/deps/openssl/openssl/crypto/ec/ecp_nistp384.c b/deps/openssl/openssl/crypto/ec/ecp_nistp384.c
index 110f9badb77..71139932609 100644
--- a/deps/openssl/openssl/crypto/ec/ecp_nistp384.c
+++ b/deps/openssl/openssl/crypto/ec/ecp_nistp384.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -41,16 +41,13 @@
 #error "Your compiler doesn't appear to support 128-bit integer types"
 #endif

-typedef uint8_t u8;
-typedef uint64_t u64;
-
 /*
  * The underlying field. P384 operates over GF(2^384-2^128-2^96+2^32-1). We
  * can serialize an element of this field into 48 bytes. We call this an
  * felem_bytearray.
  */

-typedef u8 felem_bytearray[48];
+typedef uint8_t felem_bytearray[48];

 /*
  * These are the parameters of P384, taken from FIPS 186-3, section D.1.2.4.
@@ -113,7 +110,7 @@ typedef widelimb widefelem[2 * NLIMBS - 1];
 static const limb bottom56bits = 0xffffffffffffff;

 /* Helper functions (de)serialising reduced field elements in little endian */
-static void bin48_to_felem(felem out, const u8 in[48])
+static void bin48_to_felem(felem out, const uint8_t in[48])
 {
     memset(out, 0, 56);
     out[0] = (*((limb *)&in[0])) & bottom56bits;
@@ -125,7 +122,7 @@ static void bin48_to_felem(felem out, const u8 in[48])
     memmove(&out[6], &in[42], 6);
 }

-static void felem_to_bin48(u8 out[48], const felem in)
+static void felem_to_bin48(uint8_t out[48], const felem in)
 {
     memset(out, 0, 48);
     (*((limb *)&out[0])) |= (in[0] & bottom56bits);
@@ -720,7 +717,7 @@ void p384_felem_square_reduce(felem out, const felem in);
 void p384_felem_mul_reduce(felem out, const felem in1, const felem in2);

 #if defined(_ARCH_PPC64)
-#include "crypto/ppc_arch.h"
+#include "arch/ppc_arch.h"
 #endif

 static void felem_select(void)
@@ -1404,7 +1401,7 @@ static char get_bit(const felem_bytearray in, int i)
  */
 static void batch_mul(felem x_out, felem y_out, felem z_out,
     const felem_bytearray scalars[],
-    const unsigned int num_points, const u8 *g_scalar,
+    const unsigned int num_points, const uint8_t *g_scalar,
     const int mixed, const felem pre_comp[][17][3],
     const felem g_pre_comp[16][3])
 {
@@ -1412,7 +1409,7 @@ static void batch_mul(felem x_out, felem y_out, felem z_out,
     unsigned int num, gen_mul = (g_scalar != NULL);
     felem nq[3], tmp[4];
     limb bits;
-    u8 sign, digit;
+    uint8_t sign, digit;

     /* set nq to the point at infinity */
     memset(nq, 0, sizeof(nq));
@@ -1579,8 +1576,8 @@ NISTP384_PRE_COMP *ossl_ec_nistp384_pre_comp_dup(NISTP384_PRE_COMP *p)
 {
     int i;

-    if (p != NULL)
-        CRYPTO_UP_REF(&p->references, &i);
+    if (p == NULL || !CRYPTO_UP_REF(&p->references, &i))
+        return NULL;
     return p;
 }

@@ -1798,10 +1795,10 @@ int ossl_ec_GFp_nistp384_points_mul(const EC_GROUP *group, EC_POINT *r,
              */
             mixed = 1;
         }
-        secrets = OPENSSL_zalloc(sizeof(*secrets) * num_points);
-        pre_comp = OPENSSL_zalloc(sizeof(*pre_comp) * num_points);
+        secrets = OPENSSL_calloc(num_points, sizeof(*secrets));
+        pre_comp = OPENSSL_calloc(num_points, sizeof(*pre_comp));
         if (mixed)
-            tmp_felems = OPENSSL_malloc(sizeof(*tmp_felems) * (num_points * 17 + 1));
+            tmp_felems = OPENSSL_malloc_array(num_points * 17 + 1, sizeof(*tmp_felems));
         if ((secrets == NULL) || (pre_comp == NULL)
             || (mixed && (tmp_felems == NULL)))
             goto err;
diff --git a/deps/openssl/openssl/crypto/ec/ecp_nistp521.c b/deps/openssl/openssl/crypto/ec/ecp_nistp521.c
index ca47c82e7f2..c624295e90a 100644
--- a/deps/openssl/openssl/crypto/ec/ecp_nistp521.c
+++ b/deps/openssl/openssl/crypto/ec/ecp_nistp521.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -49,16 +49,13 @@
 #error "Your compiler doesn't appear to support 128-bit integer types"
 #endif

-typedef uint8_t u8;
-typedef uint64_t u64;
-
 /*
  * The underlying field. P521 operates over GF(2^521-1). We can serialize an
  * element of this field into 66 bytes where the most significant byte
  * contains only a single bit. We call this an felem_bytearray.
  */

-typedef u8 felem_bytearray[66];
+typedef uint8_t felem_bytearray[66];

 /*
  * These are the parameters of P521, taken from FIPS 186-3, section D.1.2.5.
@@ -140,7 +137,7 @@ static const limb bottom58bits = 0x3ffffffffffffff;
  * bin66_to_felem takes a little-endian byte array and converts it into felem
  * form. This assumes that the CPU is little-endian.
  */
-static void bin66_to_felem(felem out, const u8 in[66])
+static void bin66_to_felem(felem out, const uint8_t in[66])
 {
     out[0] = (*((limb *)&in[0])) & bottom58bits;
     out[1] = (*((limb_aX *)&in[7]) >> 2) & bottom58bits;
@@ -157,7 +154,7 @@ static void bin66_to_felem(felem out, const u8 in[66])
  * felem_to_bin66 takes an felem and serializes into a little endian, 66 byte
  * array. This assumes that the CPU is little-endian.
  */
-static void felem_to_bin66(u8 out[66], const felem in)
+static void felem_to_bin66(uint8_t out[66], const felem in)
 {
     memset(out, 0, 66);
     (*((limb *)&out[0])) = in[0];
@@ -521,7 +518,7 @@ static const limb bottom52bits = 0xfffffffffffff;
  */
 static void felem_reduce(felem out, const largefelem in)
 {
-    u64 overflow1, overflow2;
+    uint64_t overflow1, overflow2;

     out[0] = ((limb)in[0]) & bottom58bits;
     out[1] = ((limb)in[1]) & bottom58bits;
@@ -605,7 +602,7 @@ void p521_felem_square(largefelem out, const felem in);
 void p521_felem_mul(largefelem out, const felem in1, const felem in2);

 #if defined(_ARCH_PPC64)
-#include "crypto/ppc_arch.h"
+#include "arch/ppc_arch.h"
 #endif

 static void felem_select(void)
@@ -1497,7 +1494,7 @@ static char get_bit(const felem_bytearray in, int i)
  */
 static void batch_mul(felem x_out, felem y_out, felem z_out,
     const felem_bytearray scalars[],
-    const unsigned num_points, const u8 *g_scalar,
+    const unsigned num_points, const uint8_t *g_scalar,
     const int mixed, const felem pre_comp[][17][3],
     const felem g_pre_comp[16][3])
 {
@@ -1505,7 +1502,7 @@ static void batch_mul(felem x_out, felem y_out, felem z_out,
     unsigned num, gen_mul = (g_scalar != NULL);
     felem nq[3], tmp[4];
     limb bits;
-    u8 sign, digit;
+    uint8_t sign, digit;

     /* set nq to the point at infinity */
     memset(nq, 0, sizeof(nq));
@@ -1670,8 +1667,8 @@ static NISTP521_PRE_COMP *nistp521_pre_comp_new(void)
 NISTP521_PRE_COMP *EC_nistp521_pre_comp_dup(NISTP521_PRE_COMP *p)
 {
     int i;
-    if (p != NULL)
-        CRYPTO_UP_REF(&p->references, &i);
+    if (p == NULL || !CRYPTO_UP_REF(&p->references, &i))
+        return NULL;
     return p;
 }

@@ -1892,10 +1889,10 @@ int ossl_ec_GFp_nistp521_points_mul(const EC_GROUP *group, EC_POINT *r,
              */
             mixed = 1;
         }
-        secrets = OPENSSL_zalloc(sizeof(*secrets) * num_points);
-        pre_comp = OPENSSL_zalloc(sizeof(*pre_comp) * num_points);
+        secrets = OPENSSL_calloc(num_points, sizeof(*secrets));
+        pre_comp = OPENSSL_calloc(num_points, sizeof(*pre_comp));
         if (mixed)
-            tmp_felems = OPENSSL_malloc(sizeof(*tmp_felems) * (num_points * 17 + 1));
+            tmp_felems = OPENSSL_malloc_array(num_points * 17 + 1, sizeof(*tmp_felems));
         if ((secrets == NULL) || (pre_comp == NULL)
             || (mixed && (tmp_felems == NULL)))
             goto err;
diff --git a/deps/openssl/openssl/crypto/ec/ecp_nistz256.c b/deps/openssl/openssl/crypto/ec/ecp_nistz256.c
index 40054116b6e..86ef80183fe 100644
--- a/deps/openssl/openssl/crypto/ec/ecp_nistz256.c
+++ b/deps/openssl/openssl/crypto/ec/ecp_nistz256.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2014-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2014, Intel Corporation. All Rights Reserved.
  * Copyright (c) 2015, CloudFlare, Inc.
  *
@@ -37,11 +37,8 @@
 #define TOBN(hi, lo) ((BN_ULONG)hi << 32 | lo)
 #endif

-#define ALIGNPTR(p, N) ((unsigned char *)p + N - (size_t)p % N)
 #define P256_LIMBS (256 / BN_BITS2)

-typedef unsigned short u16;
-
 typedef struct {
     BN_ULONG X[P256_LIMBS];
     BN_ULONG Y[P256_LIMBS];
@@ -622,12 +619,13 @@ __owur static int ecp_nistz256_windowed_mul(const EC_GROUP *group,
     void *table_storage = NULL;

     if ((num * 16 + 6) > OPENSSL_MALLOC_MAX_NELEMS(P256_POINT)
-        || (table_storage = OPENSSL_malloc((num * 16 + 5) * sizeof(P256_POINT) + 64)) == NULL
-        || (p_str = OPENSSL_malloc(num * 33 * sizeof(unsigned char))) == NULL
-        || (scalars = OPENSSL_malloc(num * sizeof(BIGNUM *))) == NULL)
+        || (table = OPENSSL_aligned_alloc_array(num * 16 + 5, sizeof(P256_POINT), 64,
+                &table_storage))
+            == NULL
+        || (p_str = OPENSSL_malloc_array(num, 33)) == NULL
+        || (scalars = OPENSSL_malloc_array(num, sizeof(BIGNUM *))) == NULL)
         goto err;

-    table = (void *)ALIGNPTR(table_storage, 64);
     temp = (P256_POINT *)(table + num);

     for (i = 0; i < num; i++) {
@@ -809,7 +807,7 @@ __owur static int ecp_nistz256_mult_precompute(EC_GROUP *group, BN_CTX *ctx)
     size_t w;

     PRECOMP256_ROW *preComputedTable = NULL;
-    unsigned char *precomp_storage = NULL;
+    void *precomp_storage = NULL;

     /* if there is an old NISTZ256_PRE_COMP object, throw it away */
     EC_pre_comp_free(group);
@@ -849,11 +847,11 @@ __owur static int ecp_nistz256_mult_precompute(EC_GROUP *group, BN_CTX *ctx)

     w = 7;

-    if ((precomp_storage = OPENSSL_malloc(37 * 64 * sizeof(P256_POINT_AFFINE) + 64)) == NULL)
+    if ((preComputedTable = OPENSSL_aligned_alloc_array(37 * 64, sizeof(P256_POINT_AFFINE), 64,
+             &precomp_storage))
+        == NULL)
         goto err;

-    preComputedTable = (void *)ALIGNPTR(precomp_storage, 64);
-
     P = EC_POINT_new(group);
     T = EC_POINT_new(group);
     if (P == NULL || T == NULL)
@@ -1098,11 +1096,11 @@ __owur static int ecp_nistz256_points_mul(const EC_GROUP *group,
          * Without a precomputed table for the generator, it has to be
          * handled like a normal point.
          */
-        new_scalars = OPENSSL_malloc((num + 1) * sizeof(BIGNUM *));
+        new_scalars = OPENSSL_malloc_array(num + 1, sizeof(BIGNUM *));
         if (new_scalars == NULL)
             goto err;

-        new_points = OPENSSL_malloc((num + 1) * sizeof(EC_POINT *));
+        new_points = OPENSSL_malloc_array(num + 1, sizeof(EC_POINT *));
         if (new_points == NULL)
             goto err;

@@ -1210,8 +1208,8 @@ static NISTZ256_PRE_COMP *ecp_nistz256_pre_comp_new(const EC_GROUP *group)
 NISTZ256_PRE_COMP *EC_nistz256_pre_comp_dup(NISTZ256_PRE_COMP *p)
 {
     int i;
-    if (p != NULL)
-        CRYPTO_UP_REF(&p->references, &i);
+    if (p == NULL || !CRYPTO_UP_REF(&p->references, &i))
+        return NULL;
     return p;
 }

@@ -1533,7 +1531,7 @@ static int ecp_nistz256group_full_init(EC_GROUP *group,
     }
     if (!EC_POINT_copy(group->generator, P))
         goto err;
-    if (!BN_copy(group->order, order))
+    if (BN_copy(group->order, order) == NULL)
         goto err;
     if (!BN_set_word(group->cofactor, 1))
         goto err;
diff --git a/deps/openssl/openssl/crypto/ec/ecp_oct.c b/deps/openssl/openssl/crypto/ec/ecp_oct.c
index 05a28fde837..dcef2dfe80e 100644
--- a/deps/openssl/openssl/crypto/ec/ecp_oct.c
+++ b/deps/openssl/openssl/crypto/ec/ecp_oct.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2025 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -278,7 +278,7 @@ int ossl_ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point,
     int y_bit;
     BN_CTX *new_ctx = NULL;
     BIGNUM *x, *y;
-    size_t field_len, enc_len;
+    int field_len, enc_len;
     int ret = 0;

     if (len == 0) {
@@ -311,7 +311,7 @@ int ossl_ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point,
     field_len = BN_num_bytes(group->field);
     enc_len = (form == POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;

-    if (len != enc_len) {
+    if (len != (size_t)enc_len) {
         ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
         return 0;
     }
diff --git a/deps/openssl/openssl/crypto/ec/ecp_ppc.c b/deps/openssl/openssl/crypto/ec/ecp_ppc.c
index e038a074755..e4b6f2e6bd0 100644
--- a/deps/openssl/openssl/crypto/ec/ecp_ppc.c
+++ b/deps/openssl/openssl/crypto/ec/ecp_ppc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2009-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -8,7 +8,7 @@
  */

 #include "internal/cryptlib.h"
-#include "crypto/ppc_arch.h"
+#include "arch/ppc_arch.h"
 #include "ec_local.h"

 void ecp_nistz256_mul_mont(unsigned long res[4], const unsigned long a[4],
diff --git a/deps/openssl/openssl/crypto/ec/ecp_s390x_nistp.c b/deps/openssl/openssl/crypto/ec/ecp_s390x_nistp.c
index d06fd444f18..c05f21c7329 100644
--- a/deps/openssl/openssl/crypto/ec/ecp_s390x_nistp.c
+++ b/deps/openssl/openssl/crypto/ec/ecp_s390x_nistp.c
@@ -18,7 +18,7 @@
 #include <openssl/err.h>
 #include <openssl/rand.h>
 #include "ec_local.h"
-#include "s390x_arch.h"
+#include "arch/s390x_arch.h"

 /* Size of parameter blocks */
 #define S390X_SIZE_PARAM 4096
@@ -98,9 +98,7 @@ static int ec_GFp_s390x_nistp_mul(const EC_GROUP *group, EC_POINT *r,

         memset(&param, 0, sizeof(param));

-        if (group->meth->point_get_affine_coordinates(group, point_ptr,
-                x, y, ctx)
-                != 1
+        if (EC_POINT_get_affine_coordinates(group, point_ptr, x, y, ctx) != 1
             || BN_bn2binpad(x, param + S390X_OFF_SRC_X(len), len) == -1
             || BN_bn2binpad(y, param + S390X_OFF_SRC_Y(len), len) == -1
             || BN_bn2binpad(scalar_ptr,
@@ -109,9 +107,7 @@ static int ec_GFp_s390x_nistp_mul(const EC_GROUP *group, EC_POINT *r,
             || s390x_pcc(fc, param) != 0
             || BN_bin2bn(param + S390X_OFF_RES_X(len), len, x) == NULL
             || BN_bin2bn(param + S390X_OFF_RES_Y(len), len, y) == NULL
-            || group->meth->point_set_affine_coordinates(group, r,
-                   x, y, ctx)
-                != 1)
+            || EC_POINT_set_affine_coordinates(group, r, x, y, ctx) != 1)
             goto ret;

         rc = 1;
@@ -127,6 +123,8 @@ ret:
     return rc;
 }

+#define MIN_ECDSA_SIGN_ORDERBITS 64
+
 static ECDSA_SIG *ecdsa_s390x_nistp_sign_sig(const unsigned char *dgst,
     int dgstlen,
     const BIGNUM *kinv,
@@ -140,6 +138,11 @@ static ECDSA_SIG *ecdsa_s390x_nistp_sign_sig(const unsigned char *dgst,
     ECDSA_SIG *sig;
     const EC_GROUP *group;
     const BIGNUM *privkey;
+    BN_CTX *bn_ctx = NULL;
+    const BIGNUM *order;
+#ifdef FIPS_MODULE
+    int order_bits;
+#endif
     int off;

     if (dgstlen < 0) {
@@ -158,6 +161,12 @@ static ECDSA_SIG *ecdsa_s390x_nistp_sign_sig(const unsigned char *dgst,
         return NULL;
     }

+    order = EC_GROUP_get0_order(group);
+    if (order == NULL) {
+        ERR_raise(ERR_LIB_EC, EC_R_MISSING_PARAMETERS);
+        return NULL;
+    }
+
     privkey = EC_KEY_get0_private_key(eckey);
     if (privkey == NULL) {
         ERR_raise(ERR_LIB_EC, EC_R_MISSING_PARAMETERS);
@@ -197,6 +206,42 @@ static ECDSA_SIG *ecdsa_s390x_nistp_sign_sig(const unsigned char *dgst,
             ERR_raise(ERR_LIB_EC, EC_R_INVALID_LENGTH);
             goto ret;
         }
+#ifdef FIPS_MODULE
+        /* get random value of k using OpenSSL's RNG */
+        bn_ctx = BN_CTX_secure_new_ex(ossl_ec_key_get_libctx(eckey));
+        if (bn_ctx == NULL)
+            goto ret;
+
+        /* Preallocate space */
+        order_bits = BN_num_bits(order);
+        /* Check the number of bits here so that an infinite loop is not possible */
+        if (order_bits < MIN_ECDSA_SIGN_ORDERBITS
+            || !BN_set_bit(k, order_bits))
+            goto ret;
+
+        do {
+            int res = 0;
+
+            if (dgst != NULL)
+                res = ossl_bn_gen_dsa_nonce_fixed_top(k, order, privkey,
+                    dgst, dgstlen, bn_ctx);
+            else
+                res = ossl_bn_priv_rand_range_fixed_top(k, order, 0, bn_ctx);
+
+            if (!res) {
+                ERR_raise(ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED);
+                goto ret;
+            }
+        } while (ossl_bn_is_word_fixed_top(k, 0));
+
+        if (BN_bn2binpad(k, param + S390X_OFF_RN(len), len) == -1) {
+            ERR_raise(ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED);
+            goto ret;
+        }
+
+        /* Turns KDSA internal nonce-generation off. */
+        fc |= S390X_KDSA_D;
+#else
         /*
          * Generate random k and copy to param block. RAND_priv_bytes_ex
          * is used instead of BN_priv_rand_range or BN_generate_dsa_nonce
@@ -209,9 +254,14 @@ static ECDSA_SIG *ecdsa_s390x_nistp_sign_sig(const unsigned char *dgst,
             ERR_raise(ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED);
             goto ret;
         }
+#endif
     } else {
+        bn_ctx = BN_CTX_secure_new_ex(ossl_ec_key_get_libctx(eckey));
+        if (bn_ctx == NULL)
+            goto ret;
+
         /* Reconstruct k = (k^-1)^-1. */
-        if (ossl_ec_group_do_inverse_ord(group, k, kinv, NULL) == 0
+        if (ossl_ec_group_do_inverse_ord(group, k, kinv, bn_ctx) == 0
             || BN_bn2binpad(k, param + S390X_OFF_RN(len), len) == -1) {
             ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
             goto ret;
@@ -233,6 +283,7 @@ static ECDSA_SIG *ecdsa_s390x_nistp_sign_sig(const unsigned char *dgst,

     ok = 1;
 ret:
+    BN_CTX_free(bn_ctx);
     OPENSSL_cleanse(param, sizeof(param));
     if (ok != 1) {
         ECDSA_SIG_free(sig);
@@ -313,9 +364,7 @@ static int ecdsa_s390x_nistp_verify_sig(const unsigned char *dgst, int dgstlen,
         goto ret;
     }

-    if (group->meth->point_get_affine_coordinates(group, pubkey,
-            x, y, ctx)
-            != 1
+    if (EC_POINT_get_affine_coordinates(group, pubkey, x, y, ctx) != 1
         || BN_bn2binpad(x, param + S390X_OFF_X(len), len) == -1
         || BN_bn2binpad(y, param + S390X_OFF_Y(len), len) == -1) {
         ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
diff --git a/deps/openssl/openssl/crypto/ec/ecp_sm2p256.c b/deps/openssl/openssl/crypto/ec/ecp_sm2p256.c
index e53e7ec5440..2ba2279886a 100644
--- a/deps/openssl/openssl/crypto/ec/ecp_sm2p256.c
+++ b/deps/openssl/openssl/crypto/ec/ecp_sm2p256.c
@@ -532,7 +532,7 @@ static int ecp_sm2p256_windowed_mul(const EC_GROUP *group,
     } t, p;

     if (num > OPENSSL_MALLOC_MAX_NELEMS(P256_POINT)
-        || (scalars = OPENSSL_malloc(num * sizeof(BIGNUM *))) == NULL) {
+        || (scalars = OPENSSL_malloc_array(num, sizeof(BIGNUM *))) == NULL) {
         ECerr(ERR_LIB_EC, ERR_R_MALLOC_FAILURE);
         goto err;
     }
@@ -565,6 +565,13 @@ static int ecp_sm2p256_windowed_mul(const EC_GROUP *group,
             goto err;
         }

+        /*
+         * The scalar is secret (e.g. the SM2 decryption private key). Mark it
+         * so that under enable-ct-validation Valgrind flags any branch or
+         * memory index depending on it inside the scalar multiplication below.
+         */
+        CONSTTIME_SECRET(k, sizeof(k));
+
         ecp_sm2p256_point_get_affine(&t.a, &p.p);
         ecp_sm2p256_point_P_mul_by_scalar(&kP, k, t.a);
         ecp_sm2p256_point_add(r, r, &kP);
@@ -610,6 +617,13 @@ static int ecp_sm2p256_points_mul(const EC_GROUP *group,
             ECerr(ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE);
             goto err;
         }
+
+        /*
+         * The generator scalar is secret (e.g. the SM2 signature nonce k).
+         * Mark it so that under enable-ct-validation any branch or memory
+         * index depending on it in [k]G is flagged by Valgrind.
+         */
+        CONSTTIME_SECRET(k, sizeof(k));
 #if !defined(OPENSSL_NO_SM2_PRECOMP)
         if (ecp_sm2p256_is_affine_G(generator)) {
             ecp_sm2p256_point_G_mul_by_scalar(&p.p, k);
@@ -645,6 +659,16 @@ static int ecp_sm2p256_points_mul(const EC_GROUP *group,
             ecp_sm2p256_point_add(&p.p, &p.p, out);
     }

+    /*
+     * The result ([k]G, or [d]C) is public. Declassify it so that the
+     * (legitimately variable-time) serialisation below and the branches the
+     * caller performs on the public signature/ciphertext do not trip
+     * ct-validation.
+     */
+    CONSTTIME_DECLASSIFY(p.p.X, sizeof(p.p.X));
+    CONSTTIME_DECLASSIFY(p.p.Y, sizeof(p.p.Y));
+    CONSTTIME_DECLASSIFY(p.p.Z, sizeof(p.p.Z));
+
     /* Not constant-time, but we're only operating on the public output. */
     if (!bn_set_words(r->X, p.p.X, P256_LIMBS)
         || !bn_set_words(r->Y, p.p.Y, P256_LIMBS)
diff --git a/deps/openssl/openssl/crypto/ec/ecp_smpl.c b/deps/openssl/openssl/crypto/ec/ecp_smpl.c
index 3542eb11f16..33c6fcb0ee9 100644
--- a/deps/openssl/openssl/crypto/ec/ecp_smpl.c
+++ b/deps/openssl/openssl/crypto/ec/ecp_smpl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -126,11 +126,11 @@ void ossl_ec_GFp_simple_group_clear_finish(EC_GROUP *group)

 int ossl_ec_GFp_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src)
 {
-    if (!BN_copy(dest->field, src->field))
+    if (BN_copy(dest->field, src->field) == NULL)
         return 0;
-    if (!BN_copy(dest->a, src->a))
+    if (BN_copy(dest->a, src->a) == NULL)
         return 0;
-    if (!BN_copy(dest->b, src->b))
+    if (BN_copy(dest->b, src->b) == NULL)
         return 0;

     dest->a_is_minus3 = src->a_is_minus3;
@@ -164,7 +164,7 @@ int ossl_ec_GFp_simple_group_set_curve(EC_GROUP *group,
         goto err;

     /* group->field */
-    if (!BN_copy(group->field, p))
+    if (BN_copy(group->field, p) == NULL)
         goto err;
     BN_set_negative(group->field, 0);

@@ -174,7 +174,7 @@ int ossl_ec_GFp_simple_group_set_curve(EC_GROUP *group,
     if (group->meth->field_encode != NULL) {
         if (!group->meth->field_encode(group, group->a, tmp_a, ctx))
             goto err;
-    } else if (!BN_copy(group->a, tmp_a))
+    } else if (BN_copy(group->a, tmp_a) == NULL)
         goto err;

     /* group->b */
@@ -204,7 +204,7 @@ int ossl_ec_GFp_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p,
     BN_CTX *new_ctx = NULL;

     if (p != NULL) {
-        if (!BN_copy(p, group->field))
+        if (BN_copy(p, group->field) == NULL)
             return 0;
     }

@@ -225,11 +225,11 @@ int ossl_ec_GFp_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p,
             }
         } else {
             if (a != NULL) {
-                if (!BN_copy(a, group->a))
+                if (BN_copy(a, group->a) == NULL)
                     goto err;
             }
             if (b != NULL) {
-                if (!BN_copy(b, group->b))
+                if (BN_copy(b, group->b) == NULL)
                     goto err;
             }
         }
@@ -277,9 +277,9 @@ int ossl_ec_GFp_simple_group_check_discriminant(const EC_GROUP *group,
         if (!group->meth->field_decode(group, b, group->b, ctx))
             goto err;
     } else {
-        if (!BN_copy(a, group->a))
+        if (BN_copy(a, group->a) == NULL)
             goto err;
-        if (!BN_copy(b, group->b))
+        if (BN_copy(b, group->b) == NULL)
             goto err;
     }

@@ -352,11 +352,11 @@ void ossl_ec_GFp_simple_point_clear_finish(EC_POINT *point)

 int ossl_ec_GFp_simple_point_copy(EC_POINT *dest, const EC_POINT *src)
 {
-    if (!BN_copy(dest->X, src->X))
+    if (BN_copy(dest->X, src->X) == NULL)
         return 0;
-    if (!BN_copy(dest->Y, src->Y))
+    if (BN_copy(dest->Y, src->Y) == NULL)
         return 0;
-    if (!BN_copy(dest->Z, src->Z))
+    if (BN_copy(dest->Z, src->Z) == NULL)
         return 0;
     dest->Z_is_one = src->Z_is_one;
     dest->curve_name = src->curve_name;
@@ -460,15 +460,15 @@ int ossl_ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
         }
     } else {
         if (x != NULL) {
-            if (!BN_copy(x, point->X))
+            if (BN_copy(x, point->X) == NULL)
                 goto err;
         }
         if (y != NULL) {
-            if (!BN_copy(y, point->Y))
+            if (BN_copy(y, point->Y) == NULL)
                 goto err;
         }
         if (z != NULL) {
-            if (!BN_copy(z, point->Z))
+            if (BN_copy(z, point->Z) == NULL)
                 goto err;
         }
     }
@@ -548,11 +548,11 @@ int ossl_ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP *group,
             }
         } else {
             if (x != NULL) {
-                if (!BN_copy(x, point->X))
+                if (BN_copy(x, point->X) == NULL)
                     goto err;
             }
             if (y != NULL) {
-                if (!BN_copy(y, point->Y))
+                if (BN_copy(y, point->Y) == NULL)
                     goto err;
             }
         }
@@ -656,9 +656,9 @@ int ossl_ec_GFp_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a

     /* n1, n2 */
     if (b->Z_is_one) {
-        if (!BN_copy(n1, a->X))
+        if (BN_copy(n1, a->X) == NULL)
             goto end;
-        if (!BN_copy(n2, a->Y))
+        if (BN_copy(n2, a->Y) == NULL)
             goto end;
         /* n1 = X_a */
         /* n2 = Y_a */
@@ -678,9 +678,9 @@ int ossl_ec_GFp_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a

     /* n3, n4 */
     if (a->Z_is_one) {
-        if (!BN_copy(n3, b->X))
+        if (BN_copy(n3, b->X) == NULL)
             goto end;
-        if (!BN_copy(n4, b->Y))
+        if (BN_copy(n4, b->Y) == NULL)
             goto end;
         /* n3 = X_b */
         /* n4 = Y_b */
@@ -732,14 +732,14 @@ int ossl_ec_GFp_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a

     /* Z_r */
     if (a->Z_is_one && b->Z_is_one) {
-        if (!BN_copy(r->Z, n5))
+        if (BN_copy(r->Z, n5) == NULL)
             goto end;
     } else {
         if (a->Z_is_one) {
-            if (!BN_copy(n0, b->Z))
+            if (BN_copy(n0, b->Z) == NULL)
                 goto end;
         } else if (b->Z_is_one) {
-            if (!BN_copy(n0, a->Z))
+            if (BN_copy(n0, a->Z) == NULL)
                 goto end;
         } else {
             if (!field_mul(group, n0, a->Z, b->Z, ctx))
@@ -883,7 +883,7 @@ int ossl_ec_GFp_simple_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a

     /* Z_r */
     if (a->Z_is_one) {
-        if (!BN_copy(n0, a->Y))
+        if (BN_copy(n0, a->Y) == NULL)
             goto err;
     } else {
         if (!field_mul(group, n0, a->Y, a->Z, ctx))
@@ -1226,7 +1226,7 @@ int ossl_ec_GFp_simple_points_make_affine(const EC_GROUP *group, size_t num,
     if (tmp_Z == NULL)
         goto err;

-    prod_Z = OPENSSL_malloc(num * sizeof(prod_Z[0]));
+    prod_Z = OPENSSL_malloc_array(num, sizeof(prod_Z[0]));
     if (prod_Z == NULL)
         goto err;
     for (i = 0; i < num; i++) {
@@ -1241,7 +1241,7 @@ int ossl_ec_GFp_simple_points_make_affine(const EC_GROUP *group, size_t num,
      */

     if (!BN_is_zero(points[0]->Z)) {
-        if (!BN_copy(prod_Z[0], points[0]->Z))
+        if (BN_copy(prod_Z[0], points[0]->Z) == NULL)
             goto err;
     } else {
         if (group->meth->field_set_to_one != 0) {
@@ -1259,7 +1259,7 @@ int ossl_ec_GFp_simple_points_make_affine(const EC_GROUP *group, size_t num,
                     ctx))
                 goto err;
         } else {
-            if (!BN_copy(prod_Z[i], prod_Z[i - 1]))
+            if (BN_copy(prod_Z[i], prod_Z[i - 1]) == NULL)
                 goto err;
         }
     }
@@ -1303,14 +1303,14 @@ int ossl_ec_GFp_simple_points_make_affine(const EC_GROUP *group, size_t num,
             if (!group->meth->field_mul(group, tmp, tmp, points[i]->Z, ctx))
                 goto err;
             /* Replace points[i]->Z by its inverse. */
-            if (!BN_copy(points[i]->Z, tmp_Z))
+            if (BN_copy(points[i]->Z, tmp_Z) == NULL)
                 goto err;
         }
     }

     if (!BN_is_zero(points[0]->Z)) {
         /* Replace points[0]->Z by its inverse. */
-        if (!BN_copy(points[0]->Z, tmp))
+        if (BN_copy(points[0]->Z, tmp) == NULL)
             goto err;
     }

diff --git a/deps/openssl/openssl/crypto/ec/ecx_backend.c b/deps/openssl/openssl/crypto/ec/ecx_backend.c
index 194dc2d7e33..371361a92dd 100644
--- a/deps/openssl/openssl/crypto/ec/ecx_backend.c
+++ b/deps/openssl/openssl/crypto/ec/ecx_backend.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,9 +20,9 @@
 #include "ecx_backend.h"

 /*
- * The intention with the "backend" source file is to offer backend support
- * for legacy backends (EVP_PKEY_ASN1_METHOD and EVP_PKEY_METHOD) and provider
- * implementations alike.
+ * The intention with the "backend" source file is to offer backend functions
+ * for legacy backends (EVP_PKEY_ASN1_METHOD) and provider implementations
+ * alike.
  */

 int ossl_ecx_public_from_private(ECX_KEY *key)
@@ -52,24 +52,20 @@ int ossl_ecx_public_from_private(ECX_KEY *key)
     return 1;
 }

-int ossl_ecx_key_fromdata(ECX_KEY *ecx, const OSSL_PARAM params[],
+int ossl_ecx_key_fromdata(ECX_KEY *ecx, const OSSL_PARAM *param_pub_key,
+    const OSSL_PARAM *param_priv_key,
     int include_private)
 {
     size_t privkeylen = 0, pubkeylen = 0;
-    const OSSL_PARAM *param_priv_key = NULL, *param_pub_key;
     unsigned char *pubkey;

     if (ecx == NULL)
         return 0;

-    param_pub_key = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PUB_KEY);
-    if (include_private)
-        param_priv_key = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY);
-
     if (param_pub_key == NULL && param_priv_key == NULL)
         return 0;

-    if (param_priv_key != NULL) {
+    if (include_private && param_priv_key != NULL) {
         if (!OSSL_PARAM_get_octet_string(param_priv_key,
                 (void **)&ecx->privkey, ecx->keylen,
                 &privkeylen))
@@ -234,15 +230,19 @@ ECX_KEY *ossl_ecx_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf,
     const X509_ALGOR *palg;

     if (!PKCS8_pkey_get0(NULL, &p, &plen, &palg, p8inf))
-        return 0;
+        goto err;

     oct = d2i_ASN1_OCTET_STRING(NULL, &p, plen);
     if (oct == NULL) {
         p = NULL;
         plen = 0;
     } else {
+        size_t tmp;
         p = ASN1_STRING_get0_data(oct);
-        plen = ASN1_STRING_length(oct);
+        tmp = ASN1_STRING_get_length(oct);
+        if (tmp > INT_MAX)
+            goto err;
+        plen = (int)tmp;
     }

     /*
@@ -251,6 +251,7 @@ ECX_KEY *ossl_ecx_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf,
      */
     ecx = ossl_ecx_key_op(palg, p, plen, EVP_PKEY_NONE, KEY_OP_PRIVATE,
         libctx, propq);
+err:
     ASN1_OCTET_STRING_free(oct);
     return ecx;
 }
diff --git a/deps/openssl/openssl/crypto/ec/ecx_backend.h b/deps/openssl/openssl/crypto/ec/ecx_backend.h
index d3d889c3a57..9b25ff05931 100644
--- a/deps/openssl/openssl/crypto/ec/ecx_backend.h
+++ b/deps/openssl/openssl/crypto/ec/ecx_backend.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_EC_ECX_BACKEND_H)
+#define OSSL_LIBCRYPTO_EC_ECX_BACKEND_H
+
 #define ISX448(id) ((id) == EVP_PKEY_X448)
 #define IS25519(id) ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
 #define KEYLENID(id) (IS25519(id) ? X25519_KEYLEN                        \
@@ -18,3 +21,5 @@
                  : ((id) == EVP_PKEY_X448 ? ECX_KEY_TYPE_X448       \
                                           : ECX_KEY_TYPE_ED448))
 #define KEYLEN(p) KEYLENID((p)->ameth->pkey_id)
+
+#endif /* !defined(OSSL_LIBCRYPTO_EC_ECX_BACKEND_H) */
diff --git a/deps/openssl/openssl/crypto/ec/ecx_key.c b/deps/openssl/openssl/crypto/ec/ecx_key.c
index 2fed62c3610..7f84375344b 100644
--- a/deps/openssl/openssl/crypto/ec/ecx_key.c
+++ b/deps/openssl/openssl/crypto/ec/ecx_key.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,7 +14,7 @@
 #include "internal/common.h" /* for ossl_assert() */

 #ifdef S390X_EC_ASM
-#include "s390x_arch.h"
+#include "arch/s390x_arch.h"
 #endif

 ECX_KEY *ossl_ecx_key_new(OSSL_LIB_CTX *libctx, ECX_KEY_TYPE type, int haspubkey,
@@ -92,7 +92,7 @@ int ossl_ecx_key_up_ref(ECX_KEY *key)
 {
     int i;

-    if (CRYPTO_UP_REF(&key->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&key->references, &i))
         return 0;

     REF_PRINT_COUNT("ECX_KEY", i, key);
diff --git a/deps/openssl/openssl/crypto/ec/ecx_meth.c b/deps/openssl/openssl/crypto/ec/ecx_meth.c
index bc5cb0ed147..52af1803f4a 100644
--- a/deps/openssl/openssl/crypto/ec/ecx_meth.c
+++ b/deps/openssl/openssl/crypto/ec/ecx_meth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -265,7 +265,7 @@ static int ecx_set_priv_key(EVP_PKEY *pkey, const unsigned char *priv,
     if (pkey->keymgmt != NULL)
         libctx = ossl_provider_libctx(EVP_KEYMGMT_get0_provider(pkey->keymgmt));

-    ecx = ossl_ecx_key_op(NULL, priv, len, pkey->ameth->pkey_id,
+    ecx = ossl_ecx_key_op(NULL, priv, (int)len, pkey->ameth->pkey_id,
         KEY_OP_PRIVATE, libctx, NULL);

     if (ecx != NULL) {
@@ -283,7 +283,7 @@ static int ecx_set_pub_key(EVP_PKEY *pkey, const unsigned char *pub, size_t len)
     if (pkey->keymgmt != NULL)
         libctx = ossl_provider_libctx(EVP_KEYMGMT_get0_provider(pkey->keymgmt));

-    ecx = ossl_ecx_key_op(NULL, pub, len, pkey->ameth->pkey_id,
+    ecx = ossl_ecx_key_op(NULL, pub, (int)len, pkey->ameth->pkey_id,
         KEY_OP_PUBLIC, libctx, NULL);

     if (ecx != NULL) {
@@ -388,13 +388,15 @@ static int ecx_generic_import_from(const OSSL_PARAM params[], void *vpctx,
     EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(pctx);
     ECX_KEY *ecx = ossl_ecx_key_new(pctx->libctx, KEYNID2TYPE(keytype), 0,
         pctx->propquery);
+    const OSSL_PARAM *pub = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PUB_KEY);
+    const OSSL_PARAM *priv = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY);

     if (ecx == NULL) {
         ERR_raise(ERR_LIB_DH, ERR_R_EC_LIB);
         return 0;
     }

-    if (!ossl_ecx_key_fromdata(ecx, params, 1)
+    if (!ossl_ecx_key_fromdata(ecx, pub, priv, 1)
         || !EVP_PKEY_assign(pkey, keytype, ecx)) {
         ossl_ecx_key_free(ecx);
         return 0;
@@ -707,760 +709,3 @@ const EVP_PKEY_ASN1_METHOD ossl_ed448_asn1_meth = {

     ecx_priv_decode_ex
 };
-
-static int pkey_ecx_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
-{
-    ECX_KEY *ecx = ossl_ecx_key_op(NULL, NULL, 0, ctx->pmeth->pkey_id,
-        KEY_OP_KEYGEN, NULL, NULL);
-
-    if (ecx != NULL) {
-        EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, ecx);
-        return 1;
-    }
-    return 0;
-}
-
-static int validate_ecx_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
-    size_t *keylen,
-    const unsigned char **privkey,
-    const unsigned char **pubkey)
-{
-    const ECX_KEY *ecxkey, *peerkey;
-
-    if (ctx->pkey == NULL || ctx->peerkey == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_KEYS_NOT_SET);
-        return 0;
-    }
-    ecxkey = evp_pkey_get_legacy(ctx->pkey);
-    peerkey = evp_pkey_get_legacy(ctx->peerkey);
-    if (ecxkey == NULL || ecxkey->privkey == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY);
-        return 0;
-    }
-    if (peerkey == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_INVALID_PEER_KEY);
-        return 0;
-    }
-    *privkey = ecxkey->privkey;
-    *pubkey = peerkey->pubkey;
-
-    return 1;
-}
-
-static int pkey_ecx_derive25519(EVP_PKEY_CTX *ctx, unsigned char *key,
-    size_t *keylen)
-{
-    const unsigned char *privkey, *pubkey;
-
-    if (!validate_ecx_derive(ctx, key, keylen, &privkey, &pubkey)
-        || (key != NULL
-            && ossl_x25519(key, privkey, pubkey) == 0))
-        return 0;
-    *keylen = X25519_KEYLEN;
-    return 1;
-}
-
-static int pkey_ecx_derive448(EVP_PKEY_CTX *ctx, unsigned char *key,
-    size_t *keylen)
-{
-    const unsigned char *privkey, *pubkey;
-
-    if (!validate_ecx_derive(ctx, key, keylen, &privkey, &pubkey)
-        || (key != NULL
-            && ossl_x448(key, privkey, pubkey) == 0))
-        return 0;
-    *keylen = X448_KEYLEN;
-    return 1;
-}
-
-static int pkey_ecx_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
-{
-    /* Only need to handle peer key for derivation */
-    if (type == EVP_PKEY_CTRL_PEER_KEY)
-        return 1;
-    return -2;
-}
-
-static const EVP_PKEY_METHOD ecx25519_pkey_meth = {
-    EVP_PKEY_X25519,
-    0, 0, 0, 0, 0, 0, 0,
-    pkey_ecx_keygen,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    pkey_ecx_derive25519,
-    pkey_ecx_ctrl,
-    0
-};
-
-static const EVP_PKEY_METHOD ecx448_pkey_meth = {
-    EVP_PKEY_X448,
-    0, 0, 0, 0, 0, 0, 0,
-    pkey_ecx_keygen,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    pkey_ecx_derive448,
-    pkey_ecx_ctrl,
-    0
-};
-
-static int pkey_ecd_digestsign25519(EVP_MD_CTX *ctx, unsigned char *sig,
-    size_t *siglen, const unsigned char *tbs,
-    size_t tbslen)
-{
-    const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey);
-
-    if (edkey == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_INVALID_KEY);
-        return 0;
-    }
-
-    if (sig == NULL) {
-        *siglen = ED25519_SIGSIZE;
-        return 1;
-    }
-    if (*siglen < ED25519_SIGSIZE) {
-        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
-        return 0;
-    }
-
-    if (ossl_ed25519_sign(sig, tbs, tbslen, edkey->pubkey, edkey->privkey,
-            0, 0, 0,
-            NULL, 0,
-            NULL, NULL)
-        == 0)
-        return 0;
-    *siglen = ED25519_SIGSIZE;
-    return 1;
-}
-
-static int pkey_ecd_digestsign448(EVP_MD_CTX *ctx, unsigned char *sig,
-    size_t *siglen, const unsigned char *tbs,
-    size_t tbslen)
-{
-    const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey);
-
-    if (edkey == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_INVALID_KEY);
-        return 0;
-    }
-
-    if (sig == NULL) {
-        *siglen = ED448_SIGSIZE;
-        return 1;
-    }
-    if (*siglen < ED448_SIGSIZE) {
-        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
-        return 0;
-    }
-
-    if (ossl_ed448_sign(edkey->libctx, sig, tbs, tbslen, edkey->pubkey,
-            edkey->privkey, NULL, 0, 0, edkey->propq)
-        == 0)
-        return 0;
-    *siglen = ED448_SIGSIZE;
-    return 1;
-}
-
-static int pkey_ecd_digestverify25519(EVP_MD_CTX *ctx, const unsigned char *sig,
-    size_t siglen, const unsigned char *tbs,
-    size_t tbslen)
-{
-    const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey);
-
-    if (edkey == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_INVALID_KEY);
-        return 0;
-    }
-
-    if (siglen != ED25519_SIGSIZE)
-        return 0;
-
-    return ossl_ed25519_verify(tbs, tbslen, sig, edkey->pubkey,
-        0, 0, 0,
-        NULL, 0,
-        edkey->libctx, edkey->propq);
-}
-
-static int pkey_ecd_digestverify448(EVP_MD_CTX *ctx, const unsigned char *sig,
-    size_t siglen, const unsigned char *tbs,
-    size_t tbslen)
-{
-    const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey);
-
-    if (edkey == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_INVALID_KEY);
-        return 0;
-    }
-
-    if (siglen != ED448_SIGSIZE)
-        return 0;
-
-    return ossl_ed448_verify(edkey->libctx, tbs, tbslen, sig, edkey->pubkey,
-        NULL, 0, 0, edkey->propq);
-}
-
-static int pkey_ecd_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
-{
-    switch (type) {
-    case EVP_PKEY_CTRL_MD:
-        /* Only NULL allowed as digest */
-        if (p2 == NULL || (const EVP_MD *)p2 == EVP_md_null())
-            return 1;
-        ERR_raise(ERR_LIB_EC, EC_R_INVALID_DIGEST_TYPE);
-        return 0;
-
-    case EVP_PKEY_CTRL_DIGESTINIT:
-        return 1;
-    }
-    return -2;
-}
-
-static const EVP_PKEY_METHOD ed25519_pkey_meth = {
-    EVP_PKEY_ED25519, EVP_PKEY_FLAG_SIGCTX_CUSTOM,
-    0, 0, 0, 0, 0, 0,
-    pkey_ecx_keygen,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    pkey_ecd_ctrl,
-    0,
-    pkey_ecd_digestsign25519,
-    pkey_ecd_digestverify25519
-};
-
-static const EVP_PKEY_METHOD ed448_pkey_meth = {
-    EVP_PKEY_ED448, EVP_PKEY_FLAG_SIGCTX_CUSTOM,
-    0, 0, 0, 0, 0, 0,
-    pkey_ecx_keygen,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    pkey_ecd_ctrl,
-    0,
-    pkey_ecd_digestsign448,
-    pkey_ecd_digestverify448
-};
-
-#ifdef S390X_EC_ASM
-#include "s390x_arch.h"
-
-static int s390x_pkey_ecx_keygen25519(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
-{
-    static const unsigned char generator[] = {
-        0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-    };
-    ECX_KEY *key = ossl_ecx_key_new(ctx->libctx, ECX_KEY_TYPE_X25519, 1,
-        ctx->propquery);
-    unsigned char *privkey = NULL, *pubkey;
-
-    if (key == NULL) {
-        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
-        goto err;
-    }
-
-    pubkey = key->pubkey;
-
-    privkey = ossl_ecx_key_allocate_privkey(key);
-    if (privkey == NULL) {
-        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
-        goto err;
-    }
-
-    if (RAND_priv_bytes_ex(ctx->libctx, privkey, X25519_KEYLEN, 0) <= 0)
-        goto err;
-
-    privkey[0] &= 248;
-    privkey[31] &= 127;
-    privkey[31] |= 64;
-
-    if (s390x_x25519_mul(pubkey, generator, privkey) != 1)
-        goto err;
-
-    EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, key);
-    return 1;
-err:
-    ossl_ecx_key_free(key);
-    return 0;
-}
-
-static int s390x_pkey_ecx_keygen448(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
-{
-    static const unsigned char generator[] = {
-        0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-    };
-    ECX_KEY *key = ossl_ecx_key_new(ctx->libctx, ECX_KEY_TYPE_X448, 1,
-        ctx->propquery);
-    unsigned char *privkey = NULL, *pubkey;
-
-    if (key == NULL) {
-        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
-        goto err;
-    }
-
-    pubkey = key->pubkey;
-
-    privkey = ossl_ecx_key_allocate_privkey(key);
-    if (privkey == NULL) {
-        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
-        goto err;
-    }
-
-    if (RAND_priv_bytes_ex(ctx->libctx, privkey, X448_KEYLEN, 0) <= 0)
-        goto err;
-
-    privkey[0] &= 252;
-    privkey[55] |= 128;
-
-    if (s390x_x448_mul(pubkey, generator, privkey) != 1)
-        goto err;
-
-    EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, key);
-    return 1;
-err:
-    ossl_ecx_key_free(key);
-    return 0;
-}
-
-static int s390x_pkey_ecd_keygen25519(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
-{
-    static const unsigned char generator_x[] = {
-        0x1a, 0xd5, 0x25, 0x8f, 0x60, 0x2d, 0x56, 0xc9, 0xb2, 0xa7, 0x25, 0x95,
-        0x60, 0xc7, 0x2c, 0x69, 0x5c, 0xdc, 0xd6, 0xfd, 0x31, 0xe2, 0xa4, 0xc0,
-        0xfe, 0x53, 0x6e, 0xcd, 0xd3, 0x36, 0x69, 0x21
-    };
-    static const unsigned char generator_y[] = {
-        0x58,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-        0x66,
-    };
-    unsigned char x_dst[32], buff[SHA512_DIGEST_LENGTH];
-    ECX_KEY *key = ossl_ecx_key_new(ctx->libctx, ECX_KEY_TYPE_ED25519, 1,
-        ctx->propquery);
-    unsigned char *privkey = NULL, *pubkey;
-    unsigned int sz;
-    EVP_MD *md = NULL;
-    int rv;
-
-    if (key == NULL) {
-        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
-        goto err;
-    }
-
-    pubkey = key->pubkey;
-
-    privkey = ossl_ecx_key_allocate_privkey(key);
-    if (privkey == NULL) {
-        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
-        goto err;
-    }
-
-    if (RAND_priv_bytes_ex(ctx->libctx, privkey, ED25519_KEYLEN, 0) <= 0)
-        goto err;
-
-    md = EVP_MD_fetch(ctx->libctx, "SHA512", ctx->propquery);
-    if (md == NULL)
-        goto err;
-
-    rv = EVP_Digest(privkey, 32, buff, &sz, md, NULL);
-    EVP_MD_free(md);
-    if (!rv)
-        goto err;
-
-    buff[0] &= 248;
-    buff[31] &= 63;
-    buff[31] |= 64;
-
-    if (s390x_ed25519_mul(x_dst, pubkey,
-            generator_x, generator_y, buff)
-        != 1)
-        goto err;
-
-    pubkey[31] |= ((x_dst[0] & 0x01) << 7);
-
-    EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, key);
-    return 1;
-err:
-    ossl_ecx_key_free(key);
-    return 0;
-}
-
-static int s390x_pkey_ecd_keygen448(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
-{
-    static const unsigned char generator_x[] = {
-        0x5e, 0xc0, 0x0c, 0xc7, 0x2b, 0xa8, 0x26, 0x26, 0x8e, 0x93, 0x00, 0x8b,
-        0xe1, 0x80, 0x3b, 0x43, 0x11, 0x65, 0xb6, 0x2a, 0xf7, 0x1a, 0xae, 0x12,
-        0x64, 0xa4, 0xd3, 0xa3, 0x24, 0xe3, 0x6d, 0xea, 0x67, 0x17, 0x0f, 0x47,
-        0x70, 0x65, 0x14, 0x9e, 0xda, 0x36, 0xbf, 0x22, 0xa6, 0x15, 0x1d, 0x22,
-        0xed, 0x0d, 0xed, 0x6b, 0xc6, 0x70, 0x19, 0x4f, 0x00
-    };
-    static const unsigned char generator_y[] = {
-        0x14, 0xfa, 0x30, 0xf2, 0x5b, 0x79, 0x08, 0x98, 0xad, 0xc8, 0xd7, 0x4e,
-        0x2c, 0x13, 0xbd, 0xfd, 0xc4, 0x39, 0x7c, 0xe6, 0x1c, 0xff, 0xd3, 0x3a,
-        0xd7, 0xc2, 0xa0, 0x05, 0x1e, 0x9c, 0x78, 0x87, 0x40, 0x98, 0xa3, 0x6c,
-        0x73, 0x73, 0xea, 0x4b, 0x62, 0xc7, 0xc9, 0x56, 0x37, 0x20, 0x76, 0x88,
-        0x24, 0xbc, 0xb6, 0x6e, 0x71, 0x46, 0x3f, 0x69, 0x00
-    };
-    unsigned char x_dst[57], buff[114];
-    ECX_KEY *key = ossl_ecx_key_new(ctx->libctx, ECX_KEY_TYPE_ED448, 1,
-        ctx->propquery);
-    unsigned char *privkey = NULL, *pubkey;
-    EVP_MD_CTX *hashctx = NULL;
-    EVP_MD *md = NULL;
-    int rv;
-
-    if (key == NULL) {
-        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
-        goto err;
-    }
-
-    pubkey = key->pubkey;
-
-    privkey = ossl_ecx_key_allocate_privkey(key);
-    if (privkey == NULL) {
-        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
-        goto err;
-    }
-
-    if (RAND_priv_bytes_ex(ctx->libctx, privkey, ED448_KEYLEN, 0) <= 0)
-        goto err;
-
-    hashctx = EVP_MD_CTX_new();
-    if (hashctx == NULL)
-        goto err;
-
-    md = EVP_MD_fetch(ctx->libctx, "SHAKE256", ctx->propquery);
-    if (md == NULL)
-        goto err;
-
-    rv = EVP_DigestInit_ex(hashctx, md, NULL);
-    EVP_MD_free(md);
-    if (rv != 1)
-        goto err;
-
-    if (EVP_DigestUpdate(hashctx, privkey, 57) != 1)
-        goto err;
-    if (EVP_DigestFinalXOF(hashctx, buff, sizeof(buff)) != 1)
-        goto err;
-
-    buff[0] &= -4;
-    buff[55] |= 0x80;
-    buff[56] = 0;
-
-    if (s390x_ed448_mul(x_dst, pubkey,
-            generator_x, generator_y, buff)
-        != 1)
-        goto err;
-
-    pubkey[56] |= ((x_dst[0] & 0x01) << 7);
-
-    EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, key);
-    EVP_MD_CTX_free(hashctx);
-    return 1;
-err:
-    ossl_ecx_key_free(key);
-    EVP_MD_CTX_free(hashctx);
-    return 0;
-}
-
-static int s390x_pkey_ecx_derive25519(EVP_PKEY_CTX *ctx, unsigned char *key,
-    size_t *keylen)
-{
-    const unsigned char *privkey, *pubkey;
-
-    if (!validate_ecx_derive(ctx, key, keylen, &privkey, &pubkey)
-        || (key != NULL
-            && s390x_x25519_mul(key, privkey, pubkey) == 0))
-        return 0;
-    *keylen = X25519_KEYLEN;
-    return 1;
-}
-
-static int s390x_pkey_ecx_derive448(EVP_PKEY_CTX *ctx, unsigned char *key,
-    size_t *keylen)
-{
-    const unsigned char *privkey, *pubkey;
-
-    if (!validate_ecx_derive(ctx, key, keylen, &privkey, &pubkey)
-        || (key != NULL
-            && s390x_x448_mul(key, pubkey, privkey) == 0))
-        return 0;
-    *keylen = X448_KEYLEN;
-    return 1;
-}
-
-static int s390x_pkey_ecd_digestsign25519(EVP_MD_CTX *ctx,
-    unsigned char *sig, size_t *siglen,
-    const unsigned char *tbs,
-    size_t tbslen)
-{
-    union {
-        struct {
-            unsigned char sig[64];
-            unsigned char priv[32];
-        } ed25519;
-        unsigned long long buff[512];
-    } param;
-    const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey);
-    int rc;
-
-    if (edkey == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_INVALID_KEY);
-        return 0;
-    }
-
-    if (sig == NULL) {
-        *siglen = ED25519_SIGSIZE;
-        return 1;
-    }
-
-    if (*siglen < ED25519_SIGSIZE) {
-        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
-        return 0;
-    }
-
-    memset(&param, 0, sizeof(param));
-    memcpy(param.ed25519.priv, edkey->privkey, sizeof(param.ed25519.priv));
-
-    rc = s390x_kdsa(S390X_EDDSA_SIGN_ED25519, &param.ed25519, tbs, tbslen);
-    OPENSSL_cleanse(param.ed25519.priv, sizeof(param.ed25519.priv));
-    if (rc != 0)
-        return 0;
-
-    s390x_flip_endian32(sig, param.ed25519.sig);
-    s390x_flip_endian32(sig + 32, param.ed25519.sig + 32);
-
-    *siglen = ED25519_SIGSIZE;
-    return 1;
-}
-
-static int s390x_pkey_ecd_digestsign448(EVP_MD_CTX *ctx,
-    unsigned char *sig, size_t *siglen,
-    const unsigned char *tbs,
-    size_t tbslen)
-{
-    union {
-        struct {
-            unsigned char sig[128];
-            unsigned char priv[64];
-        } ed448;
-        unsigned long long buff[512];
-    } param;
-    const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey);
-    int rc;
-
-    if (edkey == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_INVALID_KEY);
-        return 0;
-    }
-
-    if (sig == NULL) {
-        *siglen = ED448_SIGSIZE;
-        return 1;
-    }
-
-    if (*siglen < ED448_SIGSIZE) {
-        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
-        return 0;
-    }
-
-    memset(&param, 0, sizeof(param));
-    memcpy(param.ed448.priv + 64 - 57, edkey->privkey, 57);
-
-    rc = s390x_kdsa(S390X_EDDSA_SIGN_ED448, &param.ed448, tbs, tbslen);
-    OPENSSL_cleanse(param.ed448.priv, sizeof(param.ed448.priv));
-    if (rc != 0)
-        return 0;
-
-    s390x_flip_endian64(param.ed448.sig, param.ed448.sig);
-    s390x_flip_endian64(param.ed448.sig + 64, param.ed448.sig + 64);
-    memcpy(sig, param.ed448.sig, 57);
-    memcpy(sig + 57, param.ed448.sig + 64, 57);
-
-    *siglen = ED448_SIGSIZE;
-    return 1;
-}
-
-static int s390x_pkey_ecd_digestverify25519(EVP_MD_CTX *ctx,
-    const unsigned char *sig,
-    size_t siglen,
-    const unsigned char *tbs,
-    size_t tbslen)
-{
-    union {
-        struct {
-            unsigned char sig[64];
-            unsigned char pub[32];
-        } ed25519;
-        unsigned long long buff[512];
-    } param;
-    const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey);
-
-    if (edkey == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_INVALID_KEY);
-        return 0;
-    }
-
-    if (siglen != ED25519_SIGSIZE)
-        return 0;
-
-    memset(&param, 0, sizeof(param));
-    s390x_flip_endian32(param.ed25519.sig, sig);
-    s390x_flip_endian32(param.ed25519.sig + 32, sig + 32);
-    s390x_flip_endian32(param.ed25519.pub, edkey->pubkey);
-
-    return s390x_kdsa(S390X_EDDSA_VERIFY_ED25519,
-               &param.ed25519, tbs, tbslen)
-            == 0
-        ? 1
-        : 0;
-}
-
-static int s390x_pkey_ecd_digestverify448(EVP_MD_CTX *ctx,
-    const unsigned char *sig,
-    size_t siglen,
-    const unsigned char *tbs,
-    size_t tbslen)
-{
-    union {
-        struct {
-            unsigned char sig[128];
-            unsigned char pub[64];
-        } ed448;
-        unsigned long long buff[512];
-    } param;
-    const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey);
-
-    if (edkey == NULL) {
-        ERR_raise(ERR_LIB_EC, EC_R_INVALID_KEY);
-        return 0;
-    }
-
-    if (siglen != ED448_SIGSIZE)
-        return 0;
-
-    memset(&param, 0, sizeof(param));
-    memcpy(param.ed448.sig, sig, 57);
-    s390x_flip_endian64(param.ed448.sig, param.ed448.sig);
-    memcpy(param.ed448.sig + 64, sig + 57, 57);
-    s390x_flip_endian64(param.ed448.sig + 64, param.ed448.sig + 64);
-    memcpy(param.ed448.pub, edkey->pubkey, 57);
-    s390x_flip_endian64(param.ed448.pub, param.ed448.pub);
-
-    return s390x_kdsa(S390X_EDDSA_VERIFY_ED448,
-               &param.ed448, tbs, tbslen)
-            == 0
-        ? 1
-        : 0;
-}
-
-static const EVP_PKEY_METHOD ecx25519_s390x_pkey_meth = {
-    EVP_PKEY_X25519,
-    0, 0, 0, 0, 0, 0, 0,
-    s390x_pkey_ecx_keygen25519,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    s390x_pkey_ecx_derive25519,
-    pkey_ecx_ctrl,
-    0
-};
-
-static const EVP_PKEY_METHOD ecx448_s390x_pkey_meth = {
-    EVP_PKEY_X448,
-    0, 0, 0, 0, 0, 0, 0,
-    s390x_pkey_ecx_keygen448,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    s390x_pkey_ecx_derive448,
-    pkey_ecx_ctrl,
-    0
-};
-static const EVP_PKEY_METHOD ed25519_s390x_pkey_meth = {
-    EVP_PKEY_ED25519, EVP_PKEY_FLAG_SIGCTX_CUSTOM,
-    0, 0, 0, 0, 0, 0,
-    s390x_pkey_ecd_keygen25519,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    pkey_ecd_ctrl,
-    0,
-    s390x_pkey_ecd_digestsign25519,
-    s390x_pkey_ecd_digestverify25519
-};
-
-static const EVP_PKEY_METHOD ed448_s390x_pkey_meth = {
-    EVP_PKEY_ED448, EVP_PKEY_FLAG_SIGCTX_CUSTOM,
-    0, 0, 0, 0, 0, 0,
-    s390x_pkey_ecd_keygen448,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    pkey_ecd_ctrl,
-    0,
-    s390x_pkey_ecd_digestsign448,
-    s390x_pkey_ecd_digestverify448
-};
-#endif
-
-const EVP_PKEY_METHOD *ossl_ecx25519_pkey_method(void)
-{
-#ifdef S390X_EC_ASM
-    if (OPENSSL_s390xcap_P.pcc[1] & S390X_CAPBIT(S390X_SCALAR_MULTIPLY_X25519))
-        return &ecx25519_s390x_pkey_meth;
-#endif
-    return &ecx25519_pkey_meth;
-}
-
-const EVP_PKEY_METHOD *ossl_ecx448_pkey_method(void)
-{
-#ifdef S390X_EC_ASM
-    if (OPENSSL_s390xcap_P.pcc[1] & S390X_CAPBIT(S390X_SCALAR_MULTIPLY_X448))
-        return &ecx448_s390x_pkey_meth;
-#endif
-    return &ecx448_pkey_meth;
-}
-
-const EVP_PKEY_METHOD *ossl_ed25519_pkey_method(void)
-{
-#ifdef S390X_EC_ASM
-    if (OPENSSL_s390xcap_P.pcc[1] & S390X_CAPBIT(S390X_SCALAR_MULTIPLY_ED25519)
-        && OPENSSL_s390xcap_P.kdsa[0] & S390X_CAPBIT(S390X_EDDSA_SIGN_ED25519)
-        && OPENSSL_s390xcap_P.kdsa[0]
-            & S390X_CAPBIT(S390X_EDDSA_VERIFY_ED25519))
-        return &ed25519_s390x_pkey_meth;
-#endif
-    return &ed25519_pkey_meth;
-}
-
-const EVP_PKEY_METHOD *ossl_ed448_pkey_method(void)
-{
-#ifdef S390X_EC_ASM
-    if (OPENSSL_s390xcap_P.pcc[1] & S390X_CAPBIT(S390X_SCALAR_MULTIPLY_ED448)
-        && OPENSSL_s390xcap_P.kdsa[0] & S390X_CAPBIT(S390X_EDDSA_SIGN_ED448)
-        && OPENSSL_s390xcap_P.kdsa[0] & S390X_CAPBIT(S390X_EDDSA_VERIFY_ED448))
-        return &ed448_s390x_pkey_meth;
-#endif
-    return &ed448_pkey_meth;
-}
diff --git a/deps/openssl/openssl/crypto/ec/ecx_s390x.c b/deps/openssl/openssl/crypto/ec/ecx_s390x.c
index 4b9514084ae..7a6a25b6d5a 100644
--- a/deps/openssl/openssl/crypto/ec/ecx_s390x.c
+++ b/deps/openssl/openssl/crypto/ec/ecx_s390x.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,7 +15,7 @@
 #include "ec_local.h"
 #include "curve448/curve448_local.h"
 #include "ecx_backend.h"
-#include "s390x_arch.h"
+#include "arch/s390x_arch.h"
 #include "internal/constant_time.h"

 static void s390x_x25519_mod_p(unsigned char u[32])
diff --git a/deps/openssl/openssl/crypto/encode_decode/decoder_err.c b/deps/openssl/openssl/crypto/encode_decode/decoder_err.c
deleted file mode 100644
index 9e6556a1467..00000000000
--- a/deps/openssl/openssl/crypto/encode_decode/decoder_err.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/decodererr.h>
-#include "crypto/decodererr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA OSSL_DECODER_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_OSSL_DECODER, 0, OSSL_DECODER_R_COULD_NOT_DECODE_OBJECT),
-        "could not decode object" },
-    { ERR_PACK(ERR_LIB_OSSL_DECODER, 0, OSSL_DECODER_R_DECODER_NOT_FOUND),
-        "decoder not found" },
-    { ERR_PACK(ERR_LIB_OSSL_DECODER, 0, OSSL_DECODER_R_MISSING_GET_PARAMS),
-        "missing get params" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_OSSL_DECODER_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(OSSL_DECODER_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(OSSL_DECODER_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/encode_decode/decoder_lib.c b/deps/openssl/openssl/crypto/encode_decode/decoder_lib.c
index c0b32d7d9c4..7be00d21a14 100644
--- a/deps/openssl/openssl/crypto/encode_decode/decoder_lib.c
+++ b/deps/openssl/openssl/crypto/encode_decode/decoder_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -30,9 +30,9 @@ struct decoder_process_data_st {
     BIO *bio;

     /* Index of the current decoder instance to be processed */
-    size_t current_decoder_inst_index;
+    int current_decoder_inst_index;
     /* For tracing, count recursion level */
-    size_t recursion;
+    int recursion;

     /*-
      * Flags
@@ -167,11 +167,16 @@ int OSSL_DECODER_from_data(OSSL_DECODER_CTX *ctx, const unsigned char **pdata,

 int OSSL_DECODER_CTX_set_selection(OSSL_DECODER_CTX *ctx, int selection)
 {
-    if (!ossl_assert(ctx != NULL)) {
+    if (ctx == NULL) {
         ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }

+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     /*
      * 0 is a valid selection, and means that the caller leaves
      * it to code to discover what the selection is.
@@ -183,11 +188,16 @@ int OSSL_DECODER_CTX_set_selection(OSSL_DECODER_CTX *ctx, int selection)
 int OSSL_DECODER_CTX_set_input_type(OSSL_DECODER_CTX *ctx,
     const char *input_type)
 {
-    if (!ossl_assert(ctx != NULL)) {
+    if (ctx == NULL) {
         ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }

+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     /*
      * NULL is a valid starting input type, and means that the caller leaves
      * it to code to discover what the starting input type is.
@@ -199,11 +209,16 @@ int OSSL_DECODER_CTX_set_input_type(OSSL_DECODER_CTX *ctx,
 int OSSL_DECODER_CTX_set_input_structure(OSSL_DECODER_CTX *ctx,
     const char *input_structure)
 {
-    if (!ossl_assert(ctx != NULL)) {
+    if (ctx == NULL) {
         ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }

+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     /*
      * NULL is a valid starting input structure, and means that the caller
      * leaves it to code to discover what the starting input structure is.
@@ -368,10 +383,11 @@ int ossl_decoder_ctx_add_decoder_inst(OSSL_DECODER_CTX *ctx,
         {
             BIO_printf(trc_out,
                 "(ctx %p) Added decoder instance %p for decoder %p\n"
-                "    %s with %s\n",
+                "    %s with %s (%s)\n",
                 (void *)ctx, (void *)di, (void *)di->decoder,
                 OSSL_DECODER_get0_name(di->decoder),
-                OSSL_DECODER_get0_properties(di->decoder));
+                OSSL_DECODER_get0_properties(di->decoder),
+                OSSL_DECODER_get0_description(di->decoder));
         }
         OSSL_TRACE_END(DECODER);
     }
@@ -385,11 +401,16 @@ int OSSL_DECODER_CTX_add_decoder(OSSL_DECODER_CTX *ctx, OSSL_DECODER *decoder)
     void *decoderctx = NULL;
     void *provctx = NULL;

-    if (!ossl_assert(ctx != NULL) || !ossl_assert(decoder != NULL)) {
+    if (ctx == NULL || decoder == NULL) {
         ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }

+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     prov = OSSL_DECODER_get0_provider(decoder);
     provctx = OSSL_PROVIDER_get0_provider_ctx(prov);

@@ -421,8 +442,8 @@ struct collect_extra_decoder_data_st {
      */
     enum { IS_SAME = 0,
         IS_DIFFERENT = 1 } type_check;
-    size_t w_prev_start, w_prev_end; /* "previous" decoders */
-    size_t w_new_start, w_new_end; /* "new" decoders */
+    int w_prev_start, w_prev_end; /* "previous" decoders */
+    int w_new_start, w_new_end; /* "new" decoders */
 };

 DEFINE_STACK_OF(OSSL_DECODER)
@@ -439,7 +460,7 @@ static void collect_all_decoders(OSSL_DECODER *decoder, void *arg)
 static void collect_extra_decoder(OSSL_DECODER *decoder, void *arg)
 {
     struct collect_extra_decoder_data_st *data = arg;
-    size_t j;
+    int j;
     const OSSL_PROVIDER *prov = OSSL_DECODER_get0_provider(decoder);
     void *provctx = OSSL_PROVIDER_get0_provider_ctx(prov);

@@ -451,10 +472,11 @@ static void collect_extra_decoder(OSSL_DECODER *decoder, void *arg)
         {
             BIO_printf(trc_out,
                 "(ctx %p) [%d] Checking out decoder %p:\n"
-                "    %s with %s\n",
+                "    %s with %s (%s)\n",
                 (void *)data->ctx, data->type_check, (void *)decoder,
                 OSSL_DECODER_get0_name(decoder),
-                OSSL_DECODER_get0_properties(decoder));
+                OSSL_DECODER_get0_properties(decoder),
+                OSSL_DECODER_get0_description(decoder));
         }
         OSSL_TRACE_END(DECODER);

@@ -582,14 +604,19 @@ int OSSL_DECODER_CTX_add_extra(OSSL_DECODER_CTX *ctx,
     struct collect_extra_decoder_data_st data;
     size_t depth = 0; /* Counts the number of iterations */
     size_t count; /* Calculates how many were added in each iteration */
-    size_t numdecoders;
+    int numdecoders;
     STACK_OF(OSSL_DECODER) *skdecoders;

-    if (!ossl_assert(ctx != NULL)) {
+    if (ctx == NULL) {
         ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }

+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     /*
      * If there is no stack of OSSL_DECODER_INSTANCE, we have nothing
      * more to add.  That's fine.
@@ -636,7 +663,7 @@ int OSSL_DECODER_CTX_add_extra(OSSL_DECODER_CTX *ctx,
     data.w_prev_start = 0;
     data.w_prev_end = sk_OSSL_DECODER_INSTANCE_num(ctx->decoder_insts);
     do {
-        size_t i, j;
+        int i, j;

         data.w_new_start = data.w_new_end = data.w_prev_end;

@@ -687,10 +714,16 @@ int OSSL_DECODER_CTX_get_num_decoders(OSSL_DECODER_CTX *ctx)
 int OSSL_DECODER_CTX_set_construct(OSSL_DECODER_CTX *ctx,
     OSSL_DECODER_CONSTRUCT *construct)
 {
-    if (!ossl_assert(ctx != NULL)) {
+    if (ctx == NULL) {
         ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
+
+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     ctx->construct = construct;
     return 1;
 }
@@ -698,10 +731,16 @@ int OSSL_DECODER_CTX_set_construct(OSSL_DECODER_CTX *ctx,
 int OSSL_DECODER_CTX_set_construct_data(OSSL_DECODER_CTX *ctx,
     void *construct_data)
 {
-    if (!ossl_assert(ctx != NULL)) {
+    if (ctx == NULL) {
         ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
+
+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     ctx->construct_data = construct_data;
     return 1;
 }
@@ -709,10 +748,16 @@ int OSSL_DECODER_CTX_set_construct_data(OSSL_DECODER_CTX *ctx,
 int OSSL_DECODER_CTX_set_cleanup(OSSL_DECODER_CTX *ctx,
     OSSL_DECODER_CLEANUP *cleanup)
 {
-    if (!ossl_assert(ctx != NULL)) {
+    if (ctx == NULL) {
         ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
+
+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     ctx->cleanup = cleanup;
     return 1;
 }
@@ -747,10 +792,8 @@ int OSSL_DECODER_export(OSSL_DECODER_INSTANCE *decoder_inst,
     OSSL_DECODER *decoder = NULL;
     void *decoderctx = NULL;

-    if (!(ossl_assert(decoder_inst != NULL)
-            && ossl_assert(reference != NULL)
-            && ossl_assert(export_cb != NULL)
-            && ossl_assert(export_cbarg != NULL))) {
+    if (decoder_inst == NULL || reference == NULL
+        || export_cb == NULL || export_cbarg == NULL) {
         ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
@@ -804,7 +847,7 @@ static int decoder_process(const OSSL_PARAM params[], void *arg)
     OSSL_CORE_BIO *cbio = NULL;
     BIO *bio = data->bio;
     long loc;
-    size_t i;
+    int i;
     int ok = 0;
     /* For recursions */
     struct decoder_process_data_st new_data;
@@ -824,7 +867,7 @@ static int decoder_process(const OSSL_PARAM params[], void *arg)
     new_data.recursion = data->recursion + 1;

 #define LEVEL_STR ">>>>>>>>>>>>>>>>"
-#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)            \
+#define LEVEL ((size_t)new_data.recursion < sizeof(LEVEL_STR)    \
         ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
         : LEVEL_STR "...")

@@ -943,9 +986,10 @@ static int decoder_process(const OSSL_PARAM params[], void *arg)
         OSSL_TRACE_BEGIN(DECODER)
         {
             BIO_printf(trc_out,
-                "(ctx %p) %s incoming from previous decoder (%p):\n"
+                "(ctx %p) %s incoming from previous decoder (%p %s):\n"
                 "    data type: %s, data structure: %s%s\n",
                 (void *)new_data.ctx, LEVEL, (void *)decoder,
+                OSSL_DECODER_get0_description(decoder),
                 data_type, trace_data_structure,
                 (trace_data_structure == data_structure
                         ? ""
@@ -985,10 +1029,11 @@ static int decoder_process(const OSSL_PARAM params[], void *arg)
         {
             new_decoder_name = OSSL_DECODER_get0_name(new_decoder);
             BIO_printf(trc_out,
-                "(ctx %p) %s [%u] Considering decoder instance %p (decoder %p):\n"
+                "(ctx %p) %s [%u] Considering decoder instance %p (decoder %p %s):\n"
                 "    %s with %s\n",
                 (void *)new_data.ctx, LEVEL, (unsigned int)i,
                 (void *)new_decoder_inst, (void *)new_decoder,
+                OSSL_DECODER_get0_description(new_decoder),
                 new_decoder_name,
                 OSSL_DECODER_get0_properties(new_decoder));
         }
@@ -1022,9 +1067,10 @@ static int decoder_process(const OSSL_PARAM params[], void *arg)
             OSSL_TRACE_BEGIN(DECODER)
             {
                 BIO_printf(trc_out,
-                    "(ctx %p) %s [%u] the input type doesn't match the name of the previous decoder (%p), skipping...\n",
+                    "(ctx %p) %s [%u] the input type doesn't match the name of the previous decoder (%p %s), skipping...\n",
                     (void *)new_data.ctx, LEVEL, (unsigned int)i,
-                    (void *)decoder);
+                    (void *)decoder,
+                    OSSL_DECODER_get0_description(decoder));
             }
             OSSL_TRACE_END(DECODER);
             continue;
diff --git a/deps/openssl/openssl/crypto/encode_decode/decoder_meth.c b/deps/openssl/openssl/crypto/encode_decode/decoder_meth.c
index 110581f764f..5e2a7ce3be3 100644
--- a/deps/openssl/openssl/crypto/encode_decode/decoder_meth.c
+++ b/deps/openssl/openssl/crypto/encode_decode/decoder_meth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -26,12 +26,28 @@

 static void ossl_decoder_free(void *data)
 {
-    OSSL_DECODER_free(data);
+    OSSL_DECODER *decoder = (OSSL_DECODER *)data;
+    int ref = 0;
+
+    if (decoder == NULL)
+        return;
+
+    CRYPTO_DOWN_REF(&decoder->base.refcnt, &ref);
+    if (ref > 0)
+        return;
+    OPENSSL_free(decoder->base.name);
+    ossl_property_free(decoder->base.parsed_propdef);
+    ossl_provider_free(decoder->base.prov);
+    CRYPTO_FREE_REF(&decoder->base.refcnt);
+    OPENSSL_free(decoder);
 }

 static int ossl_decoder_up_ref(void *data)
 {
-    return OSSL_DECODER_up_ref(data);
+    OSSL_DECODER *decoder = (OSSL_DECODER *)data;
+    int ref = 0;
+
+    return CRYPTO_UP_REF(&decoder->base.refcnt, &ref);
 }

 /* Simple method structure constructor and destructor */
@@ -42,7 +58,7 @@ static OSSL_DECODER *ossl_decoder_new(void)
     if ((decoder = OPENSSL_zalloc(sizeof(*decoder))) == NULL)
         return NULL;
     if (!CRYPTO_NEW_REF(&decoder->base.refcnt, 1)) {
-        OSSL_DECODER_free(decoder);
+        ossl_decoder_free(decoder);
         return NULL;
     }

@@ -51,27 +67,31 @@ static OSSL_DECODER *ossl_decoder_new(void)

 int OSSL_DECODER_up_ref(OSSL_DECODER *decoder)
 {
-    int ref = 0;
-
-    CRYPTO_UP_REF(&decoder->base.refcnt, &ref);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    return ossl_decoder_up_ref(decoder);
+#else
+    /*
+     * DECODERS do something weird.  They manually build methods rather than
+     * attempt to fetch them from the method store or construct them through
+     * the ossl_generic_fetch mechanism.  As such they don't make use of the refcounting
+     * that we rely on in the method store, and so we always need to refcount them here
+     * We can identify them based on the fact that they never have a registered nid (i.e.
+     * its always zero)
+     */
+    if (decoder->base.id == 0 || decoder->base.no_store != 0)
+        return ossl_decoder_up_ref(decoder);
     return 1;
+#endif
 }

 void OSSL_DECODER_free(OSSL_DECODER *decoder)
 {
-    int ref = 0;
-
-    if (decoder == NULL)
-        return;
-
-    CRYPTO_DOWN_REF(&decoder->base.refcnt, &ref);
-    if (ref > 0)
-        return;
-    OPENSSL_free(decoder->base.name);
-    ossl_property_free(decoder->base.parsed_propdef);
-    ossl_provider_free(decoder->base.prov);
-    CRYPTO_FREE_REF(&decoder->base.refcnt);
-    OPENSSL_free(decoder);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    ossl_decoder_free(decoder);
+#else
+    if (decoder != NULL && (decoder->base.id == 0 || decoder->base.no_store != 0))
+        ossl_decoder_free(decoder);
+#endif
 }

 /* Data to be passed through ossl_method_construct() */
@@ -207,7 +227,7 @@ static int put_decoder_in_store(void *store, void *method,

 /* Create and populate a decoder method */
 void *ossl_decoder_from_algorithm(int id, const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov)
+    OSSL_PROVIDER *prov, int no_store)
 {
     OSSL_DECODER *decoder = NULL;
     const OSSL_DISPATCH *fns = algodef->implementation;
@@ -216,15 +236,16 @@ void *ossl_decoder_from_algorithm(int id, const OSSL_ALGORITHM *algodef,
     if ((decoder = ossl_decoder_new()) == NULL)
         return NULL;
     decoder->base.id = id;
+    decoder->base.no_store = no_store;
     if ((decoder->base.name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
-        OSSL_DECODER_free(decoder);
+        ossl_decoder_free(decoder);
         return NULL;
     }
     decoder->base.algodef = algodef;
     if ((decoder->base.parsed_propdef
             = ossl_parse_property(libctx, algodef->property_definition))
         == NULL) {
-        OSSL_DECODER_free(decoder);
+        ossl_decoder_free(decoder);
         return NULL;
     }

@@ -276,13 +297,13 @@ void *ossl_decoder_from_algorithm(int id, const OSSL_ALGORITHM *algodef,
     if (!((decoder->newctx == NULL && decoder->freectx == NULL)
             || (decoder->newctx != NULL && decoder->freectx != NULL))
         || decoder->decode == NULL) {
-        OSSL_DECODER_free(decoder);
+        ossl_decoder_free(decoder);
         ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROVIDER_FUNCTIONS);
         return NULL;
     }

     if (prov != NULL && !ossl_provider_up_ref(prov)) {
-        OSSL_DECODER_free(decoder);
+        ossl_decoder_free(decoder);
         return NULL;
     }

@@ -296,7 +317,7 @@ void *ossl_decoder_from_algorithm(int id, const OSSL_ALGORITHM *algodef,
  * then call ossl_decoder_from_algorithm() with that identity number.
  */
 static void *construct_decoder(const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov, void *data)
+    OSSL_PROVIDER *prov, void *data, int no_store)
 {
     /*
      * This function is only called if get_decoder_from_store() returned
@@ -312,7 +333,7 @@ static void *construct_decoder(const OSSL_ALGORITHM *algodef,
     void *method = NULL;

     if (id != 0)
-        method = ossl_decoder_from_algorithm(id, algodef, prov);
+        method = ossl_decoder_from_algorithm(id, algodef, prov, no_store);

     /*
      * Flag to indicate that there was actual construction errors.  This
@@ -328,17 +349,7 @@ static void *construct_decoder(const OSSL_ALGORITHM *algodef,
 /* Intermediary function to avoid ugly casts, used below */
 static void destruct_decoder(void *method, void *data)
 {
-    OSSL_DECODER_free(method);
-}
-
-static int up_ref_decoder(void *method)
-{
-    return OSSL_DECODER_up_ref(method);
-}
-
-static void free_decoder(void *method)
-{
-    OSSL_DECODER_free(method);
+    ossl_decoder_free(method);
 }

 /* Fetching support.  Can fetch by numeric identity or by name */
@@ -394,9 +405,22 @@ inner_ossl_decoder_fetch(struct decoder_data_st *methdata,
              */
             if (id == 0 && name != NULL)
                 id = ossl_namemap_name2num(namemap, name);
-            if (id != 0)
+            if (id != 0 && methdata->tmp_store == NULL) {
                 ossl_method_store_cache_set(store, prov, id, propq, method,
-                    up_ref_decoder, free_decoder);
+                    ossl_decoder_up_ref, ossl_decoder_free);
+            } else {
+                /*
+                 * Like with EVP methods, if the provider requests no caching we need
+                 * to take an extra refcount here so that the tmp_stored decoder
+                 * lives beyond the freeing of that tmp_store
+                 */
+#ifndef OPENSSL_NO_CACHED_FETCH
+                if (!OSSL_DECODER_up_ref((OSSL_DECODER *)method)) {
+                    ossl_decoder_free(method);
+                    method = NULL;
+                }
+#endif
+            }
         }

         /*
@@ -637,8 +661,8 @@ int OSSL_DECODER_CTX_set_params(OSSL_DECODER_CTX *ctx,
     const OSSL_PARAM params[])
 {
     int ok = 1;
-    size_t i;
-    size_t l;
+    int i;
+    int l;

     if (!ossl_assert(ctx != NULL)) {
         ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
diff --git a/deps/openssl/openssl/crypto/encode_decode/decoder_pkey.c b/deps/openssl/openssl/crypto/encode_decode/decoder_pkey.c
index a578e6a1353..047295b20b1 100644
--- a/deps/openssl/openssl/crypto/encode_decode/decoder_pkey.c
+++ b/deps/openssl/openssl/crypto/encode_decode/decoder_pkey.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -276,9 +276,10 @@ static int collect_decoder_keymgmt(EVP_KEYMGMT *keymgmt, OSSL_DECODER *decoder,
     OSSL_TRACE_BEGIN(DECODER)
     {
         BIO_printf(trc_out,
-            "(ctx %p) Checking out decoder %p:\n"
+            "(ctx %p) Checking out decoder %p (%s):\n"
             "    %s with %s\n",
             (void *)data->ctx, (void *)decoder,
+            OSSL_DECODER_get0_description(decoder),
             OSSL_DECODER_get0_name(decoder),
             OSSL_DECODER_get0_properties(decoder));
     }
@@ -337,9 +338,10 @@ static void collect_decoder(OSSL_DECODER *decoder, void *arg)
     OSSL_TRACE_BEGIN(DECODER)
     {
         BIO_printf(trc_out,
-            "(ctx %p) Checking out decoder %p:\n"
+            "(ctx %p) Checking out decoder %p (%s):\n"
             "    %s with %s\n",
             (void *)data->ctx, (void *)decoder,
+            OSSL_DECODER_get0_description(decoder),
             OSSL_DECODER_get0_name(decoder),
             OSSL_DECODER_get0_properties(decoder));
     }
@@ -417,6 +419,13 @@ static void collect_keymgmt(EVP_KEYMGMT *keymgmt, void *arg)
     if (!EVP_KEYMGMT_up_ref(keymgmt))
         return;

+    OSSL_TRACE_BEGIN(DECODER)
+    {
+        BIO_printf(trc_out,
+            "(Collecting KeyManager %s %s [id %d]:\n",
+            keymgmt->description, keymgmt->type_name, keymgmt->id);
+    }
+    OSSL_TRACE_END(DECODER);
     if (sk_EVP_KEYMGMT_push(data->keymgmts, keymgmt) <= 0) {
         EVP_KEYMGMT_free(keymgmt);
         data->error_occurred = 1;
@@ -655,6 +664,7 @@ ossl_decoder_ctx_for_pkey_dup(OSSL_DECODER_CTX *src,
         goto err;
     }

+    dest->frozen = src->frozen;
     return dest;
 err:
     decoder_clean_pkey_construct_arg(process_data_dest);
@@ -891,6 +901,7 @@ OSSL_DECODER_CTX_new_for_pkey(EVP_PKEY **pkey,
             && OSSL_DECODER_CTX_add_extra(ctx, libctx, propquery)
             && (propquery == NULL
                 || OSSL_DECODER_CTX_set_params(ctx, decoder_params))) {
+            ctx->frozen = 1;
             OSSL_TRACE_BEGIN(DECODER)
             {
                 BIO_printf(trc_out, "(ctx %p) Got %d decoders\n",
@@ -942,6 +953,7 @@ OSSL_DECODER_CTX_new_for_pkey(EVP_PKEY **pkey,
             (void)lh_DECODER_CACHE_ENTRY_insert(cache->hashtable, newcache);
             if (lh_DECODER_CACHE_ENTRY_error(cache->hashtable)) {
                 ctx = NULL;
+                CRYPTO_THREAD_unlock(cache->lock);
                 ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
                 goto err;
             }
diff --git a/deps/openssl/openssl/crypto/encode_decode/encoder_err.c b/deps/openssl/openssl/crypto/encode_decode/encoder_err.c
deleted file mode 100644
index 79b12f9c31d..00000000000
--- a/deps/openssl/openssl/crypto/encode_decode/encoder_err.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/encodererr.h>
-#include "crypto/encodererr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA OSSL_ENCODER_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_OSSL_ENCODER, 0, OSSL_ENCODER_R_ENCODER_NOT_FOUND),
-        "encoder not found" },
-    { ERR_PACK(ERR_LIB_OSSL_ENCODER, 0, OSSL_ENCODER_R_INCORRECT_PROPERTY_QUERY),
-        "incorrect property query" },
-    { ERR_PACK(ERR_LIB_OSSL_ENCODER, 0, OSSL_ENCODER_R_MISSING_GET_PARAMS),
-        "missing get params" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_OSSL_ENCODER_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(OSSL_ENCODER_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(OSSL_ENCODER_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/encode_decode/encoder_lib.c b/deps/openssl/openssl/crypto/encode_decode/encoder_lib.c
index 753db526209..be1463d29bf 100644
--- a/deps/openssl/openssl/crypto/encode_decode/encoder_lib.c
+++ b/deps/openssl/openssl/crypto/encode_decode/encoder_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -24,7 +24,8 @@
 #include "encoder_local.h"

 /* Number of octets per line */
-#define LABELED_BUF_PRINT_WIDTH 15
+#define LABELED_BUF_PRINT_WIDTH 16
+#define LABELED_BN_PRINT_WIDTH 16

 #ifdef SIXTY_FOUR_BIT_LONG
 #define BN_FMTu "%lu"
@@ -169,12 +170,17 @@ int OSSL_ENCODER_to_data(OSSL_ENCODER_CTX *ctx, unsigned char **pdata,

 int OSSL_ENCODER_CTX_set_selection(OSSL_ENCODER_CTX *ctx, int selection)
 {
-    if (!ossl_assert(ctx != NULL)) {
+    if (ctx == NULL) {
         ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }

-    if (!ossl_assert(selection != 0)) {
+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
+    if (selection == 0) {
         ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_INVALID_ARGUMENT);
         return 0;
     }
@@ -186,11 +192,16 @@ int OSSL_ENCODER_CTX_set_selection(OSSL_ENCODER_CTX *ctx, int selection)
 int OSSL_ENCODER_CTX_set_output_type(OSSL_ENCODER_CTX *ctx,
     const char *output_type)
 {
-    if (!ossl_assert(ctx != NULL) || !ossl_assert(output_type != NULL)) {
+    if (ctx == NULL || output_type == NULL) {
         ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }

+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     ctx->output_type = output_type;
     return 1;
 }
@@ -198,11 +209,16 @@ int OSSL_ENCODER_CTX_set_output_type(OSSL_ENCODER_CTX *ctx,
 int OSSL_ENCODER_CTX_set_output_structure(OSSL_ENCODER_CTX *ctx,
     const char *output_structure)
 {
-    if (!ossl_assert(ctx != NULL) || !ossl_assert(output_structure != NULL)) {
+    if (ctx == NULL || output_structure == NULL) {
         ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }

+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     ctx->output_structure = output_structure;
     return 1;
 }
@@ -216,7 +232,7 @@ static OSSL_ENCODER_INSTANCE *ossl_encoder_instance_new(OSSL_ENCODER *encoder,
     const OSSL_PROPERTY_LIST *props;
     const OSSL_PROPERTY_DEFINITION *prop;

-    if (!ossl_assert(encoder != NULL)) {
+    if (encoder == NULL) {
         ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
@@ -311,11 +327,16 @@ int OSSL_ENCODER_CTX_add_encoder(OSSL_ENCODER_CTX *ctx, OSSL_ENCODER *encoder)
     void *encoderctx = NULL;
     void *provctx = NULL;

-    if (!ossl_assert(ctx != NULL) || !ossl_assert(encoder != NULL)) {
+    if (ctx == NULL || encoder == NULL) {
         ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }

+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     prov = OSSL_ENCODER_get0_provider(encoder);
     provctx = OSSL_PROVIDER_get0_provider_ctx(prov);

@@ -339,6 +360,16 @@ err:
 int OSSL_ENCODER_CTX_add_extra(OSSL_ENCODER_CTX *ctx,
     OSSL_LIB_CTX *libctx, const char *propq)
 {
+    if (ctx == NULL) {
+        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+
+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     return 1;
 }

@@ -352,10 +383,16 @@ int OSSL_ENCODER_CTX_get_num_encoders(OSSL_ENCODER_CTX *ctx)
 int OSSL_ENCODER_CTX_set_construct(OSSL_ENCODER_CTX *ctx,
     OSSL_ENCODER_CONSTRUCT *construct)
 {
-    if (!ossl_assert(ctx != NULL)) {
+    if (ctx == NULL) {
         ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
+
+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     ctx->construct = construct;
     return 1;
 }
@@ -363,10 +400,16 @@ int OSSL_ENCODER_CTX_set_construct(OSSL_ENCODER_CTX *ctx,
 int OSSL_ENCODER_CTX_set_construct_data(OSSL_ENCODER_CTX *ctx,
     void *construct_data)
 {
-    if (!ossl_assert(ctx != NULL)) {
+    if (ctx == NULL) {
         ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
+
+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     ctx->construct_data = construct_data;
     return 1;
 }
@@ -374,10 +417,16 @@ int OSSL_ENCODER_CTX_set_construct_data(OSSL_ENCODER_CTX *ctx,
 int OSSL_ENCODER_CTX_set_cleanup(OSSL_ENCODER_CTX *ctx,
     OSSL_ENCODER_CLEANUP *cleanup)
 {
-    if (!ossl_assert(ctx != NULL)) {
+    if (ctx == NULL) {
         ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
+
+    if (ctx->frozen != 0) {
+        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+
     ctx->cleanup = cleanup;
     return 1;
 }
@@ -534,6 +583,7 @@ static int encoder_process(struct encoder_process_data_st *data)
         data->prev_encoder_inst = new_data.prev_encoder_inst;
         data->running_output = new_data.running_output;
         data->running_output_length = new_data.running_output_length;
+        data->data_type = new_data.data_type;

         /*
          * ok == -1     means that the recursion call above gave no further
@@ -751,16 +801,9 @@ int ossl_bio_print_labeled_bignum(BIO *out, const char *label, const BIGNUM *bn)
     if (BIO_printf(out, "%s", spaces) <= 0)
         goto err;

-    /* Add a leading 00 if the top bit is set */
-    if (*p >= '8') {
-        if (BIO_printf(out, "%02x", 0) <= 0)
-            goto err;
-        ++bytes;
-        use_sep = 1;
-    }
     while (*p != '\0') {
-        /* Do a newline after every 15 hex bytes + add the space indent */
-        if ((bytes % 15) == 0 && bytes > 0) {
+        /* Do a newline after every n hex bytes + add the space indent */
+        if ((bytes % LABELED_BN_PRINT_WIDTH) == 0 && bytes > 0) {
             if (BIO_printf(out, ":\n%s", spaces) <= 0)
                 goto err;
             use_sep = 0; /* The first byte on the next line doesn't have a : */
diff --git a/deps/openssl/openssl/crypto/encode_decode/encoder_local.h b/deps/openssl/openssl/crypto/encode_decode/encoder_local.h
index 439bd085f93..0544e09ccdc 100644
--- a/deps/openssl/openssl/crypto/encode_decode/encoder_local.h
+++ b/deps/openssl/openssl/crypto/encode_decode/encoder_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_ENCODE_DECODE_ENCODER_LOCAL_H)
+#define OSSL_LIBCRYPTO_ENCODE_DECODE_ENCODER_LOCAL_H
+
 #include <openssl/core_dispatch.h>
 #include <openssl/types.h>
 #include <openssl/safestack.h>
@@ -21,6 +24,7 @@
 struct ossl_endecode_base_st {
     OSSL_PROVIDER *prov;
     int id;
+    int no_store;
     char *name;
     const OSSL_ALGORITHM *algodef;
     OSSL_PROPERTY_LIST *parsed_propdef;
@@ -101,6 +105,9 @@ struct ossl_encoder_ctx_st {

     /* For any function that needs a passphrase reader */
     struct ossl_passphrase_data_st pwdata;
+
+    /* Flag that the structure is ready for use */
+    int frozen;
 };

 struct ossl_decoder_instance_st {
@@ -162,6 +169,9 @@ struct ossl_decoder_ctx_st {

     /* Signal that further processing should not continue. */
     int harderr;
+
+    /* Flag that the structure is ready for use */
+    int frozen;
 };

 const OSSL_PROPERTY_LIST *
@@ -171,3 +181,5 @@ ossl_encoder_parsed_properties(const OSSL_ENCODER *encoder);

 int ossl_decoder_fast_is_a(OSSL_DECODER *decoder,
     const char *name, int *id_cache);
+
+#endif /* !defined(OSSL_LIBCRYPTO_ENCODE_DECODE_ENCODER_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/encode_decode/encoder_meth.c b/deps/openssl/openssl/crypto/encode_decode/encoder_meth.c
index 89c3d7b887c..f02b6ddc22a 100644
--- a/deps/openssl/openssl/crypto/encode_decode/encoder_meth.c
+++ b/deps/openssl/openssl/crypto/encode_decode/encoder_meth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -10,6 +10,7 @@
 #include <openssl/core.h>
 #include <openssl/core_dispatch.h>
 #include <openssl/encoder.h>
+#include <openssl/encodererr.h>
 #include <openssl/ui.h>
 #include "internal/core.h"
 #include "internal/namemap.h"
@@ -26,12 +27,28 @@

 static void ossl_encoder_free(void *data)
 {
-    OSSL_ENCODER_free(data);
+    OSSL_ENCODER *encoder = (OSSL_ENCODER *)data;
+    int ref = 0;
+
+    if (encoder == NULL)
+        return;
+
+    CRYPTO_DOWN_REF(&encoder->base.refcnt, &ref);
+    if (ref > 0)
+        return;
+    OPENSSL_free(encoder->base.name);
+    ossl_property_free(encoder->base.parsed_propdef);
+    ossl_provider_free(encoder->base.prov);
+    CRYPTO_FREE_REF(&encoder->base.refcnt);
+    OPENSSL_free(encoder);
 }

 static int ossl_encoder_up_ref(void *data)
 {
-    return OSSL_ENCODER_up_ref(data);
+    OSSL_ENCODER *encoder = (OSSL_ENCODER *)data;
+    int ref = 0;
+
+    return CRYPTO_UP_REF(&encoder->base.refcnt, &ref);
 }

 /* Simple method structure constructor and destructor */
@@ -51,27 +68,23 @@ static OSSL_ENCODER *ossl_encoder_new(void)

 int OSSL_ENCODER_up_ref(OSSL_ENCODER *encoder)
 {
-    int ref = 0;
-
-    CRYPTO_UP_REF(&encoder->base.refcnt, &ref);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    return ossl_encoder_up_ref(encoder);
+#else
+    if (encoder->base.no_store != 0)
+        return ossl_encoder_up_ref(encoder);
     return 1;
+#endif
 }

 void OSSL_ENCODER_free(OSSL_ENCODER *encoder)
 {
-    int ref = 0;
-
-    if (encoder == NULL)
-        return;
-
-    CRYPTO_DOWN_REF(&encoder->base.refcnt, &ref);
-    if (ref > 0)
-        return;
-    OPENSSL_free(encoder->base.name);
-    ossl_property_free(encoder->base.parsed_propdef);
-    ossl_provider_free(encoder->base.prov);
-    CRYPTO_FREE_REF(&encoder->base.refcnt);
-    OPENSSL_free(encoder);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    ossl_encoder_free(encoder);
+#else
+    if (encoder != NULL && (encoder->base.no_store != 0))
+        ossl_encoder_free(encoder);
+#endif
 }

 /* Data to be passed through ossl_method_construct() */
@@ -207,7 +220,7 @@ static int put_encoder_in_store(void *store, void *method,

 /* Create and populate a encoder method */
 static void *encoder_from_algorithm(int id, const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov)
+    OSSL_PROVIDER *prov, int no_store)
 {
     OSSL_ENCODER *encoder = NULL;
     const OSSL_DISPATCH *fns = algodef->implementation;
@@ -216,15 +229,16 @@ static void *encoder_from_algorithm(int id, const OSSL_ALGORITHM *algodef,
     if ((encoder = ossl_encoder_new()) == NULL)
         return NULL;
     encoder->base.id = id;
+    encoder->base.no_store = no_store;
     if ((encoder->base.name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
-        OSSL_ENCODER_free(encoder);
+        ossl_encoder_free(encoder);
         return NULL;
     }
     encoder->base.algodef = algodef;
     if ((encoder->base.parsed_propdef
             = ossl_parse_property(libctx, algodef->property_definition))
         == NULL) {
-        OSSL_ENCODER_free(encoder);
+        ossl_encoder_free(encoder);
         return NULL;
     }

@@ -282,13 +296,13 @@ static void *encoder_from_algorithm(int id, const OSSL_ALGORITHM *algodef,
             || (encoder->import_object != NULL && encoder->free_object != NULL)
             || (encoder->import_object == NULL && encoder->free_object == NULL))
         || encoder->encode == NULL) {
-        OSSL_ENCODER_free(encoder);
+        ossl_encoder_free(encoder);
         ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_INVALID_PROVIDER_FUNCTIONS);
         return NULL;
     }

     if (prov != NULL && !ossl_provider_up_ref(prov)) {
-        OSSL_ENCODER_free(encoder);
+        ossl_encoder_free(encoder);
         return NULL;
     }

@@ -302,7 +316,7 @@ static void *encoder_from_algorithm(int id, const OSSL_ALGORITHM *algodef,
  * then call encoder_from_algorithm() with that identity number.
  */
 static void *construct_encoder(const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov, void *data)
+    OSSL_PROVIDER *prov, void *data, int no_store)
 {
     /*
      * This function is only called if get_encoder_from_store() returned
@@ -318,7 +332,7 @@ static void *construct_encoder(const OSSL_ALGORITHM *algodef,
     void *method = NULL;

     if (id != 0)
-        method = encoder_from_algorithm(id, algodef, prov);
+        method = encoder_from_algorithm(id, algodef, prov, no_store);

     /*
      * Flag to indicate that there was actual construction errors.  This
@@ -334,17 +348,7 @@ static void *construct_encoder(const OSSL_ALGORITHM *algodef,
 /* Intermediary function to avoid ugly casts, used below */
 static void destruct_encoder(void *method, void *data)
 {
-    OSSL_ENCODER_free(method);
-}
-
-static int up_ref_encoder(void *method)
-{
-    return OSSL_ENCODER_up_ref(method);
-}
-
-static void free_encoder(void *method)
-{
-    OSSL_ENCODER_free(method);
+    ossl_encoder_free(method);
 }

 /* Fetching support.  Can fetch by numeric identity or by name */
@@ -363,7 +367,7 @@ inner_ossl_encoder_fetch(struct encoder_data_st *methdata,
         return NULL;
     }

-    id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
+    id = ossl_namemap_name2num(namemap, name);

     /*
      * If we haven't found the name yet, chances are that the algorithm to
@@ -400,8 +404,19 @@ inner_ossl_encoder_fetch(struct encoder_data_st *methdata,
              */
             if (id == 0)
                 id = ossl_namemap_name2num(namemap, name);
-            ossl_method_store_cache_set(store, prov, id, propq, method,
-                up_ref_encoder, free_encoder);
+            if (id != 0 && methdata->tmp_store == NULL) {
+                ossl_method_store_cache_set(store, prov, id, propq, method,
+                    ossl_encoder_up_ref, ossl_encoder_free);
+            } else {
+                /*
+                 * Like with EVP methods, if the provider requests no caching we need
+                 * to take an extra refcount here so that the tmp_stored encoder
+                 * lives beyond the freeing of that tmp_store
+                 */
+#ifndef OPENSSL_NO_CACHED_FETCH
+                OSSL_ENCODER_up_ref((OSSL_ENCODER *)method);
+#endif
+            }
         }

         /*
@@ -617,8 +632,8 @@ int OSSL_ENCODER_CTX_set_params(OSSL_ENCODER_CTX *ctx,
     const OSSL_PARAM params[])
 {
     int ok = 1;
-    size_t i;
-    size_t l;
+    int i;
+    int l;

     if (!ossl_assert(ctx != NULL)) {
         ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
@@ -642,6 +657,55 @@ int OSSL_ENCODER_CTX_set_params(OSSL_ENCODER_CTX *ctx,
     return ok;
 }

+int OSSL_ENCODER_CTX_ctrl_string(OSSL_ENCODER_CTX *ctx,
+    const char *name, const char *value)
+{
+    const OSSL_PARAM *settable = NULL;
+    int i, n, ok = 0;
+
+    if (!ossl_assert(ctx != NULL)) {
+        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+
+    if (ctx->encoder_insts == NULL)
+        return 1;
+
+    n = OSSL_ENCODER_CTX_get_num_encoders(ctx);
+    for (i = 0; i < n; i++) {
+        OSSL_ENCODER_INSTANCE *encoder_inst = sk_OSSL_ENCODER_INSTANCE_value(ctx->encoder_insts, i);
+        OSSL_ENCODER *encoder = OSSL_ENCODER_INSTANCE_get_encoder(encoder_inst);
+        void *encoderctx = OSSL_ENCODER_INSTANCE_get_encoder_ctx(encoder_inst);
+        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+        int good = 0;
+
+        if (encoderctx == NULL || encoder->set_ctx_params == NULL)
+            continue;
+
+        settable = OSSL_ENCODER_settable_ctx_params(encoder);
+        if (settable == NULL)
+            continue;
+        if (!OSSL_PARAM_allocate_from_text(params, settable, name, value,
+                strlen(value), &good)) {
+            if (!good)
+                continue;
+            ERR_raise_data(ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_BAD_PARAMETER_VALUE,
+                "bad encoder parameter value: %s:%s", name, value);
+            return 0;
+        }
+        good = encoder->set_ctx_params(encoderctx, params);
+        OPENSSL_free(params[0].data);
+        if (!good)
+            return 0;
+        ++ok;
+    }
+    if (!ok) {
+        ERR_raise_data(ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_UNKNOWN_PARAMETER_NAME,
+            "unknown encoder parameter name: %s", name);
+    }
+    return ok;
+}
+
 void OSSL_ENCODER_CTX_free(OSSL_ENCODER_CTX *ctx)
 {
     if (ctx != NULL) {
diff --git a/deps/openssl/openssl/crypto/encode_decode/encoder_pkey.c b/deps/openssl/openssl/crypto/encode_decode/encoder_pkey.c
index 10635337b79..87149f08050 100644
--- a/deps/openssl/openssl/crypto/encode_decode/encoder_pkey.c
+++ b/deps/openssl/openssl/crypto/encode_decode/encoder_pkey.c
@@ -285,7 +285,7 @@ static int ossl_encoder_ctx_setup_for_pkey(OSSL_ENCODER_CTX *ctx,
         namemap = ossl_namemap_stored(libctx);
         end = sk_OPENSSL_CSTRING_num(encoder_data.names);
         if (end > 0) {
-            encoder_data.id_names = OPENSSL_malloc(end * sizeof(int));
+            encoder_data.id_names = OPENSSL_malloc_array(end, sizeof(int));
             if (encoder_data.id_names == NULL) {
                 sk_OPENSSL_CSTRING_free(keymgmt_data.names);
                 goto err;
@@ -389,6 +389,7 @@ OSSL_ENCODER_CTX *OSSL_ENCODER_CTX_new_for_pkey(const EVP_PKEY *pkey,
         OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
         int save_parameters = pkey->save_parameters;

+        ctx->frozen = 1;
         params[0] = OSSL_PARAM_construct_int(OSSL_ENCODER_PARAM_SAVE_PARAMETERS,
             &save_parameters);
         /* ignoring error as this is only auxiliary parameter */
diff --git a/deps/openssl/openssl/crypto/engine/README.md b/deps/openssl/openssl/crypto/engine/README.md
deleted file mode 100644
index b45115ca248..00000000000
--- a/deps/openssl/openssl/crypto/engine/README.md
+++ /dev/null
@@ -1,210 +0,0 @@
-Notes on engines of 2001-09-24
-==============================
-
-This "description" (if one chooses to call it that) needed some major updating
-so here goes. This update addresses a change being made at the same time to
-OpenSSL, and it pretty much completely restructures the underlying mechanics of
-the "ENGINE" code. So it serves a double purpose of being a "ENGINE internals
-for masochists" document *and* a rather extensive commit log message. (I'd get
-lynched for sticking all this in CHANGES.md or the commit mails :-).
-
-ENGINE_TABLE underlies this restructuring, as described in the internal header
-"eng_local.h", implemented in eng_table.c, and used in each of the "class" files;
-tb_rsa.c, tb_dsa.c, etc.
-
-However, "EVP_CIPHER" underlies the motivation and design of ENGINE_TABLE so
-I'll mention a bit about that first. EVP_CIPHER (and most of this applies
-equally to EVP_MD for digests) is both a "method" and a algorithm/mode
-identifier that, in the current API, "lingers". These cipher description +
-implementation structures can be defined or obtained directly by applications,
-or can be loaded "en masse" into EVP storage so that they can be catalogued and
-searched in various ways, ie. two ways of encrypting with the "des_cbc"
-algorithm/mode pair are;
-
-    (i) directly;
-         const EVP_CIPHER *cipher = EVP_des_cbc();
-         EVP_EncryptInit(&ctx, cipher, key, iv);
-         [ ... use EVP_EncryptUpdate() and EVP_EncryptFinal() ...]
-
-    (ii) indirectly;
-         OpenSSL_add_all_ciphers();
-         cipher = EVP_get_cipherbyname("des_cbc");
-         EVP_EncryptInit(&ctx, cipher, key, iv);
-         [ ... etc ... ]
-
-The latter is more generally used because it also allows ciphers/digests to be
-looked up based on other identifiers which can be useful for automatic cipher
-selection, eg. in SSL/TLS, or by user-controllable configuration.
-
-The important point about this is that EVP_CIPHER definitions and structures are
-passed around with impunity and there is no safe way, without requiring massive
-rewrites of many applications, to assume that EVP_CIPHERs can be reference
-counted. One an EVP_CIPHER is exposed to the caller, neither it nor anything it
-comes from can "safely" be destroyed. Unless of course the way of getting to
-such ciphers is via entirely distinct API calls that didn't exist before.
-However existing API usage cannot be made to understand when an EVP_CIPHER
-pointer, that has been passed to the caller, is no longer being used.
-
-The other problem with the existing API w.r.t. to hooking EVP_CIPHER support
-into ENGINE is storage - the OBJ_NAME-based storage used by EVP to register
-ciphers simultaneously registers cipher *types* and cipher *implementations* -
-they are effectively the same thing, an "EVP_CIPHER" pointer. The problem with
-hooking in ENGINEs is that multiple ENGINEs may implement the same ciphers. The
-solution is necessarily that ENGINE-provided ciphers simply are not registered,
-stored, or exposed to the caller in the same manner as existing ciphers. This is
-especially necessary considering the fact ENGINE uses reference counts to allow
-for cleanup, modularity, and DSO support - yet EVP_CIPHERs, as exposed to
-callers in the current API, support no such controls.
-
-Another sticking point for integrating cipher support into ENGINE is linkage.
-Already there is a problem with the way ENGINE supports RSA, DSA, etc whereby
-they are available *because* they're part of a giant ENGINE called "openssl".
-Ie. all implementations *have* to come from an ENGINE, but we get round that by
-having a giant ENGINE with all the software support encapsulated. This creates
-linker hassles if nothing else - linking a 1-line application that calls 2 basic
-RSA functions (eg. "RSA_free(RSA_new());") will result in large quantities of
-ENGINE code being linked in *and* because of that DSA, DH, and RAND also. If we
-continue with this approach for EVP_CIPHER support (even if it *was* possible)
-we would lose our ability to link selectively by selectively loading certain
-implementations of certain functionality. Touching any part of any kind of
-crypto would result in massive static linkage of everything else. So the
-solution is to change the way ENGINE feeds existing "classes", ie. how the
-hooking to ENGINE works from RSA, DSA, DH, RAND, as well as adding new hooking
-for EVP_CIPHER, and EVP_MD.
-
-The way this is now being done is by mostly reverting back to how things used to
-work prior to ENGINE :-). Ie. RSA now has a "RSA_METHOD" pointer again - this
-was previously replaced by an "ENGINE" pointer and all RSA code that required
-the RSA_METHOD would call ENGINE_get_RSA() each time on its ENGINE handle to
-temporarily get and use the ENGINE's RSA implementation. Apart from being more
-efficient, switching back to each RSA having an RSA_METHOD pointer also allows
-us to conceivably operate with *no* ENGINE. As we'll see, this removes any need
-for a fallback ENGINE that encapsulates default implementations - we can simply
-have our RSA structure pointing its RSA_METHOD pointer to the software
-implementation and have its ENGINE pointer set to NULL.
-
-A look at the EVP_CIPHER hooking is most explanatory, the RSA, DSA (etc) cases
-turn out to be degenerate forms of the same thing. The EVP storage of ciphers,
-and the existing EVP API functions that return "software" implementations and
-descriptions remain untouched. However, the storage takes more meaning in terms
-of "cipher description" and less meaning in terms of "implementation". When an
-EVP_CIPHER_CTX is actually initialised with an EVP_CIPHER method and is about to
-begin en/decryption, the hooking to ENGINE comes into play. What happens is that
-cipher-specific ENGINE code is asked for an ENGINE pointer (a functional
-reference) for any ENGINE that is registered to perform the algo/mode that the
-provided EVP_CIPHER structure represents. Under normal circumstances, that
-ENGINE code will return NULL because no ENGINEs will have had any cipher
-implementations *registered*. As such, a NULL ENGINE pointer is stored in the
-EVP_CIPHER_CTX context, and the EVP_CIPHER structure is left hooked into the
-context and so is used as the implementation. Pretty much how things work now
-except we'd have a redundant ENGINE pointer set to NULL and doing nothing.
-
-Conversely, if an ENGINE *has* been registered to perform the algorithm/mode
-combination represented by the provided EVP_CIPHER, then a functional reference
-to that ENGINE will be returned to the EVP_CIPHER_CTX during initialisation.
-That functional reference will be stored in the context (and released on
-cleanup) - and having that reference provides a *safe* way to use an EVP_CIPHER
-definition that is private to the ENGINE. Ie. the EVP_CIPHER provided by the
-application will actually be replaced by an EVP_CIPHER from the registered
-ENGINE - it will support the same algorithm/mode as the original but will be a
-completely different implementation. Because this EVP_CIPHER isn't stored in the
-EVP storage, nor is it returned to applications from traditional API functions,
-there is no associated problem with it not having reference counts. And of
-course, when one of these "private" cipher implementations is hooked into
-EVP_CIPHER_CTX, it is done whilst the EVP_CIPHER_CTX holds a functional
-reference to the ENGINE that owns it, thus the use of the ENGINE's EVP_CIPHER is
-safe.
-
-The "cipher-specific ENGINE code" I mentioned is implemented in tb_cipher.c but
-in essence it is simply an instantiation of "ENGINE_TABLE" code for use by
-EVP_CIPHER code. tb_digest.c is virtually identical but, of course, it is for
-use by EVP_MD code. Ditto for tb_rsa.c, tb_dsa.c, etc. These instantiations of
-ENGINE_TABLE essentially provide linker-separation of the classes so that even
-if ENGINEs implement *all* possible algorithms, an application using only
-EVP_CIPHER code will link at most code relating to EVP_CIPHER, tb_cipher.c, core
-ENGINE code that is independent of class, and of course the ENGINE
-implementation that the application loaded. It will *not* however link any
-class-specific ENGINE code for digests, RSA, etc nor will it bleed over into
-other APIs, such as the RSA/DSA/etc library code.
-
-ENGINE_TABLE is a little more complicated than may seem necessary but this is
-mostly to avoid a lot of "init()"-thrashing on ENGINEs (that may have to load
-DSOs, and other expensive setup that shouldn't be thrashed unnecessarily) *and*
-to duplicate "default" behaviour. Basically an ENGINE_TABLE instantiation, for
-example tb_cipher.c, implements a hash-table keyed by integer "nid" values.
-These nids provide the uniquenness of an algorithm/mode - and each nid will hash
-to a potentially NULL "ENGINE_PILE". An ENGINE_PILE is essentially a list of
-pointers to ENGINEs that implement that particular 'nid'. Each "pile" uses some
-caching tricks such that requests on that 'nid' will be cached and all future
-requests will return immediately (well, at least with minimal operation) unless
-a change is made to the pile, eg. perhaps an ENGINE was unloaded. The reason is
-that an application could have support for 10 ENGINEs statically linked
-in, and the machine in question may not have any of the hardware those 10
-ENGINEs support. If each of those ENGINEs has a "des_cbc" implementation, we
-want to avoid every EVP_CIPHER_CTX setup from trying (and failing) to initialise
-each of those 10 ENGINEs. Instead, the first such request will try to do that
-and will either return (and cache) a NULL ENGINE pointer or will return a
-functional reference to the first that successfully initialised. In the latter
-case it will also cache an extra functional reference to the ENGINE as a
-"default" for that 'nid'. The caching is acknowledged by a 'uptodate' variable
-that is unset only if un/registration takes place on that pile. Ie. if
-implementations of "des_cbc" are added or removed. This behaviour can be
-tweaked; the ENGINE_TABLE_FLAG_NOINIT value can be passed to
-ENGINE_set_table_flags(), in which case the only ENGINEs that tb_cipher.c will
-try to initialise from the "pile" will be those that are already initialised
-(ie. it's simply an increment of the functional reference count, and no real
-"initialisation" will take place).
-
-RSA, DSA, DH, and RAND all have their own ENGINE_TABLE code as well, and the
-difference is that they all use an implicit 'nid' of 1. Whereas EVP_CIPHERs are
-actually qualitatively different depending on 'nid' (the "des_cbc" EVP_CIPHER is
-not an interoperable implementation of "aes_256_cbc"), RSA_METHODs are
-necessarily interoperable and don't have different flavours, only different
-implementations. In other words, the ENGINE_TABLE for RSA will either be empty,
-or will have a single ENGINE_PILE hashed to by the 'nid' 1 and that pile
-represents ENGINEs that implement the single "type" of RSA there is.
-
-Cleanup - the registration and unregistration may pose questions about how
-cleanup works with the ENGINE_PILE doing all this caching nonsense (ie. when the
-application or EVP_CIPHER code releases its last reference to an ENGINE, the
-ENGINE_PILE code may still have references and thus those ENGINEs will stay
-hooked in forever). The way this is handled is via "unregistration". With these
-new ENGINE changes, an abstract ENGINE can be loaded and initialised, but that
-is an algorithm-agnostic process. Even if initialised, it will not have
-registered any of its implementations (to do so would link all class "table"
-code despite the fact the application may use only ciphers, for example). This
-is deliberately a distinct step. Moreover, registration and unregistration has
-nothing to do with whether an ENGINE is *functional* or not (ie. you can even
-register an ENGINE and its implementations without it being operational, you may
-not even have the drivers to make it operate). What actually happens with
-respect to cleanup is managed inside eng_lib.c with the `engine_cleanup_***`
-functions. These functions are internal-only and each part of ENGINE code that
-could require cleanup will, upon performing its first allocation, register a
-callback with the "engine_cleanup" code. The other part of this that makes it
-tick is that the ENGINE_TABLE instantiations (tb_***.c) use NULL as their
-initialised state. So if RSA code asks for an ENGINE and no ENGINE has
-registered an implementation, the code will simply return NULL and the tb_rsa.c
-state will be unchanged. Thus, no cleanup is required unless registration takes
-place. ENGINE_cleanup() will simply iterate across a list of registered cleanup
-callbacks calling each in turn, and will then internally delete its own storage
-(a STACK). When a cleanup callback is next registered (eg. if the cleanup() is
-part of a graceful restart and the application wants to cleanup all state then
-start again), the internal STACK storage will be freshly allocated. This is much
-the same as the situation in the ENGINE_TABLE instantiations ... NULL is the
-initialised state, so only modification operations (not queries) will cause that
-code to have to register a cleanup.
-
-What else? The bignum callbacks and associated ENGINE functions have been
-removed for two obvious reasons; (i) there was no way to generalise them to the
-mechanism now used by RSA/DSA/..., because there's no such thing as a BIGNUM
-method, and (ii) because of (i), there was no meaningful way for library or
-application code to automatically hook and use ENGINE supplied bignum functions
-anyway. Also, ENGINE_cpy() has been removed (although an internal-only version
-exists) - the idea of providing an ENGINE_cpy() function probably wasn't a good
-one and now certainly doesn't make sense in any generalised way. Some of the
-RSA, DSA, DH, and RAND functions that were fiddled during the original ENGINE
-changes have now, as a consequence, been reverted back. This is because the
-hooking of ENGINE is now automatic (and passive, it can internally use a NULL
-ENGINE pointer to simply ignore ENGINE from then on).
-
-Hell, that should be enough for now ... comments welcome.
diff --git a/deps/openssl/openssl/crypto/engine/build.info b/deps/openssl/openssl/crypto/engine/build.info
deleted file mode 100644
index 47fe948966e..00000000000
--- a/deps/openssl/openssl/crypto/engine/build.info
+++ /dev/null
@@ -1,8 +0,0 @@
-LIBS=../../libcrypto
-SOURCE[../../libcrypto]=\
-        eng_err.c eng_lib.c eng_list.c eng_init.c eng_ctrl.c \
-        eng_table.c eng_pkey.c eng_fat.c eng_all.c \
-        tb_rsa.c tb_dsa.c tb_dh.c tb_rand.c \
-        tb_cipher.c tb_digest.c tb_pkmeth.c tb_asnmth.c tb_eckey.c \
-        eng_openssl.c eng_cnf.c eng_dyn.c \
-        eng_rdrand.c
diff --git a/deps/openssl/openssl/crypto/engine/eng_all.c b/deps/openssl/openssl/crypto/engine/eng_all.c
deleted file mode 100644
index 12a4f8832a1..00000000000
--- a/deps/openssl/openssl/crypto/engine/eng_all.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include "internal/cryptlib.h"
-#include "eng_local.h"
-
-void ENGINE_load_builtin_engines(void)
-{
-    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL);
-}
-
-#ifndef OPENSSL_NO_DEPRECATED_1_1_0
-#if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__))
-void ENGINE_setup_bsd_cryptodev(void)
-{
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/crypto/engine/eng_cnf.c b/deps/openssl/openssl/crypto/engine/eng_cnf.c
deleted file mode 100644
index 2d1a1d54a54..00000000000
--- a/deps/openssl/openssl/crypto/engine/eng_cnf.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "eng_local.h"
-#include <openssl/conf.h>
-#include <openssl/trace.h>
-
-/* ENGINE config module */
-
-static const char *skip_dot(const char *name)
-{
-    const char *p = strchr(name, '.');
-
-    if (p != NULL)
-        return p + 1;
-    return name;
-}
-
-static STACK_OF(ENGINE) *initialized_engines = NULL;
-
-static int int_engine_init(ENGINE *e)
-{
-    if (!ENGINE_init(e))
-        return 0;
-    if (!initialized_engines)
-        initialized_engines = sk_ENGINE_new_null();
-    if (!initialized_engines || !sk_ENGINE_push(initialized_engines, e)) {
-        ENGINE_finish(e);
-        return 0;
-    }
-    return 1;
-}
-
-static int int_engine_configure(const char *name, const char *value, const CONF *cnf)
-{
-    int i;
-    int ret = 0;
-    long do_init = -1;
-    STACK_OF(CONF_VALUE) *ecmds;
-    CONF_VALUE *ecmd = NULL;
-    const char *ctrlname, *ctrlvalue;
-    ENGINE *e = NULL;
-    int soft = 0;
-
-    name = skip_dot(name);
-    OSSL_TRACE1(CONF, "Configuring engine %s\n", name);
-    /* Value is a section containing ENGINE commands */
-    ecmds = NCONF_get_section(cnf, value);
-
-    if (!ecmds) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_ENGINE_SECTION_ERROR);
-        return 0;
-    }
-
-    for (i = 0; i < sk_CONF_VALUE_num(ecmds); i++) {
-        ecmd = sk_CONF_VALUE_value(ecmds, i);
-        ctrlname = skip_dot(ecmd->name);
-        ctrlvalue = ecmd->value;
-        OSSL_TRACE2(CONF, "ENGINE: doing ctrl(%s,%s)\n",
-            ctrlname, ctrlvalue);
-
-        /* First handle some special pseudo ctrls */
-
-        /* Override engine name to use */
-        if (strcmp(ctrlname, "engine_id") == 0)
-            name = ctrlvalue;
-        else if (strcmp(ctrlname, "soft_load") == 0)
-            soft = 1;
-        /* Load a dynamic ENGINE */
-        else if (strcmp(ctrlname, "dynamic_path") == 0) {
-            e = ENGINE_by_id("dynamic");
-            if (!e)
-                goto err;
-            if (!ENGINE_ctrl_cmd_string(e, "SO_PATH", ctrlvalue, 0))
-                goto err;
-            if (!ENGINE_ctrl_cmd_string(e, "LIST_ADD", "2", 0))
-                goto err;
-            if (!ENGINE_ctrl_cmd_string(e, "LOAD", NULL, 0))
-                goto err;
-        }
-        /* ... add other pseudos here ... */
-        else {
-            /*
-             * At this point we need an ENGINE structural reference if we
-             * don't already have one.
-             */
-            if (!e) {
-                e = ENGINE_by_id(name);
-                if (!e && soft) {
-                    ERR_clear_error();
-                    return 1;
-                }
-                if (!e)
-                    goto err;
-            }
-            /*
-             * Allow "EMPTY" to mean no value: this allows a valid "value" to
-             * be passed to ctrls of type NO_INPUT
-             */
-            if (strcmp(ctrlvalue, "EMPTY") == 0)
-                ctrlvalue = NULL;
-            if (strcmp(ctrlname, "init") == 0) {
-                if (!NCONF_get_number_e(cnf, value, "init", &do_init))
-                    goto err;
-                if (do_init == 1) {
-                    if (!int_engine_init(e))
-                        goto err;
-                } else if (do_init != 0) {
-                    ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_INIT_VALUE);
-                    goto err;
-                }
-            } else if (strcmp(ctrlname, "default_algorithms") == 0) {
-                if (!ENGINE_set_default_string(e, ctrlvalue))
-                    goto err;
-            } else if (!ENGINE_ctrl_cmd_string(e, ctrlname, ctrlvalue, 0))
-                goto err;
-        }
-    }
-    if (e && (do_init == -1) && !int_engine_init(e)) {
-        ecmd = NULL;
-        goto err;
-    }
-    ret = 1;
-err:
-    if (ret != 1) {
-        if (ecmd == NULL)
-            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_ENGINE_CONFIGURATION_ERROR);
-        else
-            ERR_raise_data(ERR_LIB_ENGINE, ENGINE_R_ENGINE_CONFIGURATION_ERROR,
-                "section=%s, name=%s, value=%s",
-                ecmd->section, ecmd->name, ecmd->value);
-    }
-    ENGINE_free(e);
-    return ret;
-}
-
-static int int_engine_module_init(CONF_IMODULE *md, const CONF *cnf)
-{
-    STACK_OF(CONF_VALUE) *elist;
-    CONF_VALUE *cval;
-    int i;
-    OSSL_TRACE2(CONF, "Called engine module: name %s, value %s\n",
-        CONF_imodule_get_name(md), CONF_imodule_get_value(md));
-    /* Value is a section containing ENGINEs to configure */
-    elist = NCONF_get_section(cnf, CONF_imodule_get_value(md));
-
-    if (!elist) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_ENGINES_SECTION_ERROR);
-        return 0;
-    }
-
-    for (i = 0; i < sk_CONF_VALUE_num(elist); i++) {
-        cval = sk_CONF_VALUE_value(elist, i);
-        if (!int_engine_configure(cval->name, cval->value, cnf))
-            return 0;
-    }
-
-    return 1;
-}
-
-static void int_engine_module_finish(CONF_IMODULE *md)
-{
-    ENGINE *e;
-
-    while ((e = sk_ENGINE_pop(initialized_engines)))
-        ENGINE_finish(e);
-    sk_ENGINE_free(initialized_engines);
-    initialized_engines = NULL;
-}
-
-void ENGINE_add_conf_module(void)
-{
-    CONF_module_add("engines",
-        int_engine_module_init, int_engine_module_finish);
-}
diff --git a/deps/openssl/openssl/crypto/engine/eng_ctrl.c b/deps/openssl/openssl/crypto/engine/eng_ctrl.c
deleted file mode 100644
index 8fc29321b75..00000000000
--- a/deps/openssl/openssl/crypto/engine/eng_ctrl.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright 2001-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "eng_local.h"
-
-/*
- * When querying a ENGINE-specific control command's 'description', this
- * string is used if the ENGINE_CMD_DEFN has cmd_desc set to NULL.
- */
-static const char *int_no_description = "";
-
-/*
- * These internal functions handle 'CMD'-related control commands when the
- * ENGINE in question has asked us to take care of it (ie. the ENGINE did not
- * set the ENGINE_FLAGS_MANUAL_CMD_CTRL flag.
- */
-
-static int int_ctrl_cmd_is_null(const ENGINE_CMD_DEFN *defn)
-{
-    if ((defn->cmd_num == 0) || (defn->cmd_name == NULL))
-        return 1;
-    return 0;
-}
-
-static int int_ctrl_cmd_by_name(const ENGINE_CMD_DEFN *defn, const char *s)
-{
-    int idx = 0;
-    while (!int_ctrl_cmd_is_null(defn) && (strcmp(defn->cmd_name, s) != 0)) {
-        idx++;
-        defn++;
-    }
-    if (int_ctrl_cmd_is_null(defn))
-        /* The given name wasn't found */
-        return -1;
-    return idx;
-}
-
-static int int_ctrl_cmd_by_num(const ENGINE_CMD_DEFN *defn, unsigned int num)
-{
-    int idx = 0;
-    /*
-     * NB: It is stipulated that 'cmd_defn' lists are ordered by cmd_num. So
-     * our searches don't need to take any longer than necessary.
-     */
-    while (!int_ctrl_cmd_is_null(defn) && (defn->cmd_num < num)) {
-        idx++;
-        defn++;
-    }
-    if (defn->cmd_num == num)
-        return idx;
-    /* The given cmd_num wasn't found */
-    return -1;
-}
-
-static int int_ctrl_helper(ENGINE *e, int cmd, long i, void *p,
-    void (*f)(void))
-{
-    int idx;
-    char *s = (char *)p;
-    const ENGINE_CMD_DEFN *cdp;
-
-    /* Take care of the easy one first (eg. it requires no searches) */
-    if (cmd == ENGINE_CTRL_GET_FIRST_CMD_TYPE) {
-        if ((e->cmd_defns == NULL) || int_ctrl_cmd_is_null(e->cmd_defns))
-            return 0;
-        return e->cmd_defns->cmd_num;
-    }
-    /* One or two commands require that "p" be a valid string buffer */
-    if ((cmd == ENGINE_CTRL_GET_CMD_FROM_NAME) || (cmd == ENGINE_CTRL_GET_NAME_FROM_CMD) || (cmd == ENGINE_CTRL_GET_DESC_FROM_CMD)) {
-        if (s == NULL) {
-            ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-            return -1;
-        }
-    }
-    /* Now handle cmd_name -> cmd_num conversion */
-    if (cmd == ENGINE_CTRL_GET_CMD_FROM_NAME) {
-        if ((e->cmd_defns == NULL)
-            || ((idx = int_ctrl_cmd_by_name(e->cmd_defns, s)) < 0)) {
-            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME);
-            return -1;
-        }
-        return e->cmd_defns[idx].cmd_num;
-    }
-    /*
-     * For the rest of the commands, the 'long' argument must specify a valid
-     * command number - so we need to conduct a search.
-     */
-    if ((e->cmd_defns == NULL)
-        || ((idx = int_ctrl_cmd_by_num(e->cmd_defns, (unsigned int)i)) < 0)) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER);
-        return -1;
-    }
-    /* Now the logic splits depending on command type */
-    cdp = &e->cmd_defns[idx];
-    switch (cmd) {
-    case ENGINE_CTRL_GET_NEXT_CMD_TYPE:
-        cdp++;
-        return int_ctrl_cmd_is_null(cdp) ? 0 : cdp->cmd_num;
-    case ENGINE_CTRL_GET_NAME_LEN_FROM_CMD:
-        return strlen(cdp->cmd_name);
-    case ENGINE_CTRL_GET_NAME_FROM_CMD:
-        return strlen(strcpy(s, cdp->cmd_name));
-    case ENGINE_CTRL_GET_DESC_LEN_FROM_CMD:
-        return strlen(cdp->cmd_desc == NULL ? int_no_description
-                                            : cdp->cmd_desc);
-    case ENGINE_CTRL_GET_DESC_FROM_CMD:
-        return strlen(strcpy(s, cdp->cmd_desc == NULL ? int_no_description : cdp->cmd_desc));
-    case ENGINE_CTRL_GET_CMD_FLAGS:
-        return cdp->cmd_flags;
-    }
-    /* Shouldn't really be here ... */
-    ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
-    return -1;
-}
-
-int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void))
-{
-    int ctrl_exists;
-
-    if (e == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return 0;
-    }
-
-    ctrl_exists = ((e->ctrl == NULL) ? 0 : 1);
-
-    /*
-     * Intercept any "root-level" commands before trying to hand them on to
-     * ctrl() handlers.
-     */
-    switch (cmd) {
-    case ENGINE_CTRL_HAS_CTRL_FUNCTION:
-        return ctrl_exists;
-    case ENGINE_CTRL_GET_FIRST_CMD_TYPE:
-    case ENGINE_CTRL_GET_NEXT_CMD_TYPE:
-    case ENGINE_CTRL_GET_CMD_FROM_NAME:
-    case ENGINE_CTRL_GET_NAME_LEN_FROM_CMD:
-    case ENGINE_CTRL_GET_NAME_FROM_CMD:
-    case ENGINE_CTRL_GET_DESC_LEN_FROM_CMD:
-    case ENGINE_CTRL_GET_DESC_FROM_CMD:
-    case ENGINE_CTRL_GET_CMD_FLAGS:
-        if (ctrl_exists && !(e->flags & ENGINE_FLAGS_MANUAL_CMD_CTRL))
-            return int_ctrl_helper(e, cmd, i, p, f);
-        if (!ctrl_exists) {
-            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION);
-            /*
-             * For these cmd-related functions, failure is indicated by a -1
-             * return value (because 0 is used as a valid return in some
-             * places).
-             */
-            return -1;
-        }
-    default:
-        break;
-    }
-    /* Anything else requires a ctrl() handler to exist. */
-    if (!ctrl_exists) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION);
-        return 0;
-    }
-    return e->ctrl(e, cmd, i, p, f);
-}
-
-int ENGINE_cmd_is_executable(ENGINE *e, int cmd)
-{
-    int flags;
-    if ((flags = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FLAGS, cmd, NULL, NULL)) < 0) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER);
-        return 0;
-    }
-    if (!(flags & ENGINE_CMD_FLAG_NO_INPUT) && !(flags & ENGINE_CMD_FLAG_NUMERIC) && !(flags & ENGINE_CMD_FLAG_STRING))
-        return 0;
-    return 1;
-}
-
-int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
-    long i, void *p, void (*f)(void), int cmd_optional)
-{
-    int num;
-
-    if (e == NULL || cmd_name == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return 0;
-    }
-    if (e->ctrl == NULL
-        || (num = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FROM_NAME,
-                0, (void *)cmd_name, NULL))
-            <= 0) {
-        /*
-         * If the command didn't *have* to be supported, we fake success.
-         * This allows certain settings to be specified for multiple ENGINEs
-         * and only require a change of ENGINE id (without having to
-         * selectively apply settings). Eg. changing from a hardware device
-         * back to the regular software ENGINE without editing the config
-         * file, etc.
-         */
-        if (cmd_optional) {
-            ERR_clear_error();
-            return 1;
-        }
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME);
-        return 0;
-    }
-    /*
-     * Force the result of the control command to 0 or 1, for the reasons
-     * mentioned before.
-     */
-    if (ENGINE_ctrl(e, num, i, p, f) > 0)
-        return 1;
-    return 0;
-}
-
-int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
-    int cmd_optional)
-{
-    int num, flags;
-    long l;
-    char *ptr;
-
-    if (e == NULL || cmd_name == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return 0;
-    }
-    if (e->ctrl == NULL
-        || (num = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FROM_NAME,
-                0, (void *)cmd_name, NULL))
-            <= 0) {
-        /*
-         * If the command didn't *have* to be supported, we fake success.
-         * This allows certain settings to be specified for multiple ENGINEs
-         * and only require a change of ENGINE id (without having to
-         * selectively apply settings). Eg. changing from a hardware device
-         * back to the regular software ENGINE without editing the config
-         * file, etc.
-         */
-        if (cmd_optional) {
-            ERR_clear_error();
-            return 1;
-        }
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME);
-        return 0;
-    }
-    if (!ENGINE_cmd_is_executable(e, num)) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_CMD_NOT_EXECUTABLE);
-        return 0;
-    }
-
-    flags = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FLAGS, num, NULL, NULL);
-    if (flags < 0) {
-        /*
-         * Shouldn't happen, given that ENGINE_cmd_is_executable() returned
-         * success.
-         */
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
-        return 0;
-    }
-    /*
-     * If the command takes no input, there must be no input. And vice versa.
-     */
-    if (flags & ENGINE_CMD_FLAG_NO_INPUT) {
-        if (arg != NULL) {
-            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_NO_INPUT);
-            return 0;
-        }
-        /*
-         * We deliberately force the result of ENGINE_ctrl() to 0 or 1 rather
-         * than returning it as "return data". This is to ensure usage of
-         * these commands is consistent across applications and that certain
-         * applications don't understand it one way, and others another.
-         */
-        if (ENGINE_ctrl(e, num, 0, (void *)arg, NULL) > 0)
-            return 1;
-        return 0;
-    }
-    /* So, we require input */
-    if (arg == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_INPUT);
-        return 0;
-    }
-    /* If it takes string input, that's easy */
-    if (flags & ENGINE_CMD_FLAG_STRING) {
-        /* Same explanation as above */
-        if (ENGINE_ctrl(e, num, 0, (void *)arg, NULL) > 0)
-            return 1;
-        return 0;
-    }
-    /*
-     * If it doesn't take numeric either, then it is unsupported for use in a
-     * config-setting situation, which is what this function is for. This
-     * should never happen though, because ENGINE_cmd_is_executable() was
-     * used.
-     */
-    if (!(flags & ENGINE_CMD_FLAG_NUMERIC)) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
-        return 0;
-    }
-    l = strtol(arg, &ptr, 10);
-    if ((arg == ptr) || (*ptr != '\0')) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER);
-        return 0;
-    }
-    /*
-     * Force the result of the control command to 0 or 1, for the reasons
-     * mentioned before.
-     */
-    if (ENGINE_ctrl(e, num, l, NULL, NULL) > 0)
-        return 1;
-    return 0;
-}
diff --git a/deps/openssl/openssl/crypto/engine/eng_dyn.c b/deps/openssl/openssl/crypto/engine/eng_dyn.c
deleted file mode 100644
index 72a373efcd3..00000000000
--- a/deps/openssl/openssl/crypto/engine/eng_dyn.c
+++ /dev/null
@@ -1,522 +0,0 @@
-/*
- * Copyright 2001-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "eng_local.h"
-#include "internal/dso.h"
-#include <openssl/crypto.h>
-
-/*
- * Shared libraries implementing ENGINEs for use by the "dynamic" ENGINE
- * loader should implement the hook-up functions with the following
- * prototypes.
- */
-
-/* Our ENGINE handlers */
-static int dynamic_init(ENGINE *e);
-static int dynamic_finish(ENGINE *e);
-static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p,
-    void (*f)(void));
-/* Predeclare our context type */
-typedef struct st_dynamic_data_ctx dynamic_data_ctx;
-/* The implementation for the important control command */
-static int dynamic_load(ENGINE *e, dynamic_data_ctx *ctx);
-
-#define DYNAMIC_CMD_SO_PATH ENGINE_CMD_BASE
-#define DYNAMIC_CMD_NO_VCHECK (ENGINE_CMD_BASE + 1)
-#define DYNAMIC_CMD_ID (ENGINE_CMD_BASE + 2)
-#define DYNAMIC_CMD_LIST_ADD (ENGINE_CMD_BASE + 3)
-#define DYNAMIC_CMD_DIR_LOAD (ENGINE_CMD_BASE + 4)
-#define DYNAMIC_CMD_DIR_ADD (ENGINE_CMD_BASE + 5)
-#define DYNAMIC_CMD_LOAD (ENGINE_CMD_BASE + 6)
-
-/* The constants used when creating the ENGINE */
-static const char *engine_dynamic_id = "dynamic";
-static const char *engine_dynamic_name = "Dynamic engine loading support";
-static const ENGINE_CMD_DEFN dynamic_cmd_defns[] = {
-    { DYNAMIC_CMD_SO_PATH,
-        "SO_PATH",
-        "Specifies the path to the new ENGINE shared library",
-        ENGINE_CMD_FLAG_STRING },
-    { DYNAMIC_CMD_NO_VCHECK,
-        "NO_VCHECK",
-        "Specifies to continue even if version checking fails (boolean)",
-        ENGINE_CMD_FLAG_NUMERIC },
-    { DYNAMIC_CMD_ID,
-        "ID",
-        "Specifies an ENGINE id name for loading",
-        ENGINE_CMD_FLAG_STRING },
-    { DYNAMIC_CMD_LIST_ADD,
-        "LIST_ADD",
-        "Whether to add a loaded ENGINE to the internal list (0=no,1=yes,2=mandatory)",
-        ENGINE_CMD_FLAG_NUMERIC },
-    { DYNAMIC_CMD_DIR_LOAD,
-        "DIR_LOAD",
-        "Specifies whether to load from 'DIR_ADD' directories (0=no,1=yes,2=mandatory)",
-        ENGINE_CMD_FLAG_NUMERIC },
-    { DYNAMIC_CMD_DIR_ADD,
-        "DIR_ADD",
-        "Adds a directory from which ENGINEs can be loaded",
-        ENGINE_CMD_FLAG_STRING },
-    { DYNAMIC_CMD_LOAD,
-        "LOAD",
-        "Load up the ENGINE specified by other settings",
-        ENGINE_CMD_FLAG_NO_INPUT },
-    { 0, NULL, NULL, 0 }
-};
-
-/*
- * Loading code stores state inside the ENGINE structure via the "ex_data"
- * element. We load all our state into a single structure and use that as a
- * single context in the "ex_data" stack.
- */
-struct st_dynamic_data_ctx {
-    /* The DSO object we load that supplies the ENGINE code */
-    DSO *dynamic_dso;
-    /*
-     * The function pointer to the version checking shared library function
-     */
-    dynamic_v_check_fn v_check;
-    /*
-     * The function pointer to the engine-binding shared library function
-     */
-    dynamic_bind_engine bind_engine;
-    /* The default name/path for loading the shared library */
-    char *DYNAMIC_LIBNAME;
-    /* Whether to continue loading on a version check failure */
-    int no_vcheck;
-    /* If non-NULL, stipulates the 'id' of the ENGINE to be loaded */
-    char *engine_id;
-    /*
-     * If non-zero, a successfully loaded ENGINE should be added to the
-     * internal ENGINE list. If 2, the add must succeed or the entire load
-     * should fail.
-     */
-    int list_add_value;
-    /* The symbol name for the version checking function */
-    const char *DYNAMIC_F1;
-    /* The symbol name for the "initialise ENGINE structure" function */
-    const char *DYNAMIC_F2;
-    /*
-     * Whether to never use 'dirs', use 'dirs' as a fallback, or only use
-     * 'dirs' for loading. Default is to use 'dirs' as a fallback.
-     */
-    int dir_load;
-    /* A stack of directories from which ENGINEs could be loaded */
-    STACK_OF(OPENSSL_STRING) *dirs;
-};
-
-/*
- * This is the "ex_data" index we obtain and reserve for use with our context
- * structure.
- */
-static int dynamic_ex_data_idx = -1;
-
-static void int_free_str(char *s)
-{
-    OPENSSL_free(s);
-}
-
-/*
- * Because our ex_data element may or may not get allocated depending on
- * whether a "first-use" occurs before the ENGINE is freed, we have a memory
- * leak problem to solve. We can't declare a "new" handler for the ex_data as
- * we don't want a dynamic_data_ctx in *all* ENGINE structures of all types
- * (this is a bug in the design of CRYPTO_EX_DATA). As such, we just declare
- * a "free" handler and that will get called if an ENGINE is being destroyed
- * and there was an ex_data element corresponding to our context type.
- */
-static void dynamic_data_ctx_free_func(void *parent, void *ptr,
-    CRYPTO_EX_DATA *ad, int idx, long argl,
-    void *argp)
-{
-    if (ptr) {
-        dynamic_data_ctx *ctx = (dynamic_data_ctx *)ptr;
-        DSO_free(ctx->dynamic_dso);
-        OPENSSL_free(ctx->DYNAMIC_LIBNAME);
-        OPENSSL_free(ctx->engine_id);
-        sk_OPENSSL_STRING_pop_free(ctx->dirs, int_free_str);
-        OPENSSL_free(ctx);
-    }
-}
-
-/*
- * Construct the per-ENGINE context. We create it blindly and then use a lock
- * to check for a race - if so, all but one of the threads "racing" will have
- * wasted their time. The alternative involves creating everything inside the
- * lock which is far worse.
- */
-static int dynamic_set_data_ctx(ENGINE *e, dynamic_data_ctx **ctx)
-{
-    dynamic_data_ctx *c = OPENSSL_zalloc(sizeof(*c));
-    int ret = 0;
-
-    if (c == NULL)
-        return 0;
-    c->dirs = sk_OPENSSL_STRING_new_null();
-    if (c->dirs == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
-        goto end;
-    }
-    c->DYNAMIC_F1 = "v_check";
-    c->DYNAMIC_F2 = "bind_engine";
-    c->dir_load = 1;
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        goto end;
-    if ((*ctx = (dynamic_data_ctx *)ENGINE_get_ex_data(e,
-             dynamic_ex_data_idx))
-        == NULL) {
-        /* Good, we're the first */
-        ret = ENGINE_set_ex_data(e, dynamic_ex_data_idx, c);
-        if (ret) {
-            *ctx = c;
-            c = NULL;
-        }
-    }
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    ret = 1;
-    /*
-     * If we lost the race to set the context, c is non-NULL and *ctx is the
-     * context of the thread that won.
-     */
-end:
-    if (c != NULL)
-        sk_OPENSSL_STRING_free(c->dirs);
-    OPENSSL_free(c);
-    return ret;
-}
-
-/*
- * This function retrieves the context structure from an ENGINE's "ex_data",
- * or if it doesn't exist yet, sets it up.
- */
-static dynamic_data_ctx *dynamic_get_data_ctx(ENGINE *e)
-{
-    dynamic_data_ctx *ctx;
-    if (dynamic_ex_data_idx < 0) {
-        /*
-         * Create and register the ENGINE ex_data, and associate our "free"
-         * function with it to ensure any allocated contexts get freed when
-         * an ENGINE goes underground.
-         */
-        int new_idx = ENGINE_get_ex_new_index(0, NULL, NULL, NULL,
-            dynamic_data_ctx_free_func);
-        if (new_idx == -1) {
-            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NO_INDEX);
-            return NULL;
-        }
-        if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-            return NULL;
-        /* Avoid a race by checking again inside this lock */
-        if (dynamic_ex_data_idx < 0) {
-            /* Good, someone didn't beat us to it */
-            dynamic_ex_data_idx = new_idx;
-            new_idx = -1;
-        }
-        CRYPTO_THREAD_unlock(global_engine_lock);
-        /*
-         * In theory we could "give back" the index here if (new_idx>-1), but
-         * it's not possible and wouldn't gain us much if it were.
-         */
-    }
-    ctx = (dynamic_data_ctx *)ENGINE_get_ex_data(e, dynamic_ex_data_idx);
-    /* Check if the context needs to be created */
-    if ((ctx == NULL) && !dynamic_set_data_ctx(e, &ctx))
-        /* "set_data" will set errors if necessary */
-        return NULL;
-    return ctx;
-}
-
-static ENGINE *engine_dynamic(void)
-{
-    ENGINE *ret = ENGINE_new();
-    if (ret == NULL)
-        return NULL;
-    if (!ENGINE_set_id(ret, engine_dynamic_id) || !ENGINE_set_name(ret, engine_dynamic_name) || !ENGINE_set_init_function(ret, dynamic_init) || !ENGINE_set_finish_function(ret, dynamic_finish) || !ENGINE_set_ctrl_function(ret, dynamic_ctrl) || !ENGINE_set_flags(ret, ENGINE_FLAGS_BY_ID_COPY) || !ENGINE_set_cmd_defns(ret, dynamic_cmd_defns)) {
-        ENGINE_free(ret);
-        return NULL;
-    }
-    return ret;
-}
-
-void engine_load_dynamic_int(void)
-{
-    ENGINE *toadd = engine_dynamic();
-    if (!toadd)
-        return;
-
-    ERR_set_mark();
-    ENGINE_add(toadd);
-    /*
-     * If the "add" worked, it gets a structural reference. So either way, we
-     * release our just-created reference.
-     */
-    ENGINE_free(toadd);
-    /*
-     * If the "add" didn't work, it was probably a conflict because it was
-     * already added (eg. someone calling ENGINE_load_blah then calling
-     * ENGINE_load_builtin_engines() perhaps).
-     */
-    ERR_pop_to_mark();
-}
-
-static int dynamic_init(ENGINE *e)
-{
-    /*
-     * We always return failure - the "dynamic" engine itself can't be used
-     * for anything.
-     */
-    return 0;
-}
-
-static int dynamic_finish(ENGINE *e)
-{
-    /*
-     * This should never be called on account of "dynamic_init" always
-     * failing.
-     */
-    return 0;
-}
-
-static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void))
-{
-    dynamic_data_ctx *ctx = dynamic_get_data_ctx(e);
-    int initialised;
-
-    if (!ctx) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NOT_LOADED);
-        return 0;
-    }
-    initialised = ((ctx->dynamic_dso == NULL) ? 0 : 1);
-    /* All our control commands require the ENGINE to be uninitialised */
-    if (initialised) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_ALREADY_LOADED);
-        return 0;
-    }
-    switch (cmd) {
-    case DYNAMIC_CMD_SO_PATH:
-        /* a NULL 'p' or a string of zero-length is the same thing */
-        if (p && (strlen((const char *)p) < 1))
-            p = NULL;
-        OPENSSL_free(ctx->DYNAMIC_LIBNAME);
-        if (p)
-            ctx->DYNAMIC_LIBNAME = OPENSSL_strdup(p);
-        else
-            ctx->DYNAMIC_LIBNAME = NULL;
-        return (ctx->DYNAMIC_LIBNAME ? 1 : 0);
-    case DYNAMIC_CMD_NO_VCHECK:
-        ctx->no_vcheck = ((i == 0) ? 0 : 1);
-        return 1;
-    case DYNAMIC_CMD_ID:
-        /* a NULL 'p' or a string of zero-length is the same thing */
-        if (p && (strlen((const char *)p) < 1))
-            p = NULL;
-        OPENSSL_free(ctx->engine_id);
-        if (p)
-            ctx->engine_id = OPENSSL_strdup(p);
-        else
-            ctx->engine_id = NULL;
-        return (ctx->engine_id ? 1 : 0);
-    case DYNAMIC_CMD_LIST_ADD:
-        if ((i < 0) || (i > 2)) {
-            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT);
-            return 0;
-        }
-        ctx->list_add_value = (int)i;
-        return 1;
-    case DYNAMIC_CMD_LOAD:
-        return dynamic_load(e, ctx);
-    case DYNAMIC_CMD_DIR_LOAD:
-        if ((i < 0) || (i > 2)) {
-            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT);
-            return 0;
-        }
-        ctx->dir_load = (int)i;
-        return 1;
-    case DYNAMIC_CMD_DIR_ADD:
-        /* a NULL 'p' or a string of zero-length is the same thing */
-        if (p == NULL || (strlen((const char *)p) < 1)) {
-            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT);
-            return 0;
-        }
-        {
-            char *tmp_str = OPENSSL_strdup(p);
-            if (tmp_str == NULL)
-                return 0;
-            if (!sk_OPENSSL_STRING_push(ctx->dirs, tmp_str)) {
-                OPENSSL_free(tmp_str);
-                ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
-                return 0;
-            }
-        }
-        return 1;
-    default:
-        break;
-    }
-    ERR_raise(ERR_LIB_ENGINE, ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED);
-    return 0;
-}
-
-static int int_load(dynamic_data_ctx *ctx)
-{
-    int num, loop;
-    /* Unless told not to, try a direct load */
-    if ((ctx->dir_load != 2) && (DSO_load(ctx->dynamic_dso, ctx->DYNAMIC_LIBNAME, NULL, 0)) != NULL)
-        return 1;
-    /* If we're not allowed to use 'dirs' or we have none, fail */
-    if (!ctx->dir_load || (num = sk_OPENSSL_STRING_num(ctx->dirs)) < 1)
-        return 0;
-    for (loop = 0; loop < num; loop++) {
-        const char *s = sk_OPENSSL_STRING_value(ctx->dirs, loop);
-        char *merge = DSO_merge(ctx->dynamic_dso, ctx->DYNAMIC_LIBNAME, s);
-        if (!merge)
-            return 0;
-        if (DSO_load(ctx->dynamic_dso, merge, NULL, 0)) {
-            /* Found what we're looking for */
-            OPENSSL_free(merge);
-            return 1;
-        }
-        OPENSSL_free(merge);
-    }
-    return 0;
-}
-
-/*
- * Unfortunately the version checker does not distinguish between
- * engines built for openssl 1.1.x and openssl 3.x, but loading
- * an engine that is built for openssl 1.1.x will cause a fatal
- * error.  Detect such engines, since EVP_PKEY_base_id is exported
- * as a function in openssl 1.1.x, while it is named EVP_PKEY_get_base_id
- * in openssl 3.x.  Therefore we take the presence of that symbol
- * as an indication that the engine will be incompatible.
- */
-static int using_libcrypto_11(dynamic_data_ctx *ctx)
-{
-    int ret;
-
-    ERR_set_mark();
-    ret = DSO_bind_func(ctx->dynamic_dso, "EVP_PKEY_base_id") != NULL;
-    ERR_pop_to_mark();
-
-    return ret;
-}
-
-static int dynamic_load(ENGINE *e, dynamic_data_ctx *ctx)
-{
-    ENGINE cpy;
-    dynamic_fns fns;
-
-    if (ctx->dynamic_dso == NULL)
-        ctx->dynamic_dso = DSO_new();
-    if (ctx->dynamic_dso == NULL)
-        return 0;
-    if (!ctx->DYNAMIC_LIBNAME) {
-        if (!ctx->engine_id)
-            return 0;
-        DSO_ctrl(ctx->dynamic_dso, DSO_CTRL_SET_FLAGS,
-            DSO_FLAG_NAME_TRANSLATION_EXT_ONLY, NULL);
-        ctx->DYNAMIC_LIBNAME = DSO_convert_filename(ctx->dynamic_dso, ctx->engine_id);
-    }
-    if (!int_load(ctx)) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_DSO_NOT_FOUND);
-        DSO_free(ctx->dynamic_dso);
-        ctx->dynamic_dso = NULL;
-        return 0;
-    }
-    /* We have to find a bind function otherwise it'll always end badly */
-    if (!(ctx->bind_engine = (dynamic_bind_engine)DSO_bind_func(ctx->dynamic_dso,
-              ctx->DYNAMIC_F2))) {
-        ctx->bind_engine = NULL;
-        DSO_free(ctx->dynamic_dso);
-        ctx->dynamic_dso = NULL;
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_DSO_FAILURE);
-        return 0;
-    }
-    /* Do we perform version checking? */
-    if (!ctx->no_vcheck) {
-        unsigned long vcheck_res = 0;
-        /*
-         * Now we try to find a version checking function and decide how to
-         * cope with failure if/when it fails.
-         */
-        ctx->v_check = (dynamic_v_check_fn)DSO_bind_func(ctx->dynamic_dso,
-            ctx->DYNAMIC_F1);
-        if (ctx->v_check)
-            vcheck_res = ctx->v_check(OSSL_DYNAMIC_VERSION);
-        /*
-         * We fail if the version checker veto'd the load *or* if it is
-         * deferring to us (by returning its version) and we think it is too
-         * old. Also fail if this is engine for openssl 1.1.x.
-         */
-        if (vcheck_res < OSSL_DYNAMIC_OLDEST || using_libcrypto_11(ctx)) {
-            /* Fail */
-            ctx->bind_engine = NULL;
-            ctx->v_check = NULL;
-            DSO_free(ctx->dynamic_dso);
-            ctx->dynamic_dso = NULL;
-            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_VERSION_INCOMPATIBILITY);
-            return 0;
-        }
-    }
-    /*
-     * First binary copy the ENGINE structure so that we can roll back if the
-     * hand-over fails
-     */
-    memcpy(&cpy, e, sizeof(ENGINE));
-    /*
-     * Provide the ERR, "ex_data", memory, and locking callbacks so the
-     * loaded library uses our state rather than its own. FIXME: As noted in
-     * engine.h, much of this would be simplified if each area of code
-     * provided its own "summary" structure of all related callbacks. It
-     * would also increase opaqueness.
-     */
-    fns.static_state = ENGINE_get_static_state();
-    CRYPTO_get_mem_functions(&fns.mem_fns.malloc_fn, &fns.mem_fns.realloc_fn,
-        &fns.mem_fns.free_fn);
-    /*
-     * Now that we've loaded the dynamic engine, make sure no "dynamic"
-     * ENGINE elements will show through.
-     */
-    engine_set_all_null(e);
-
-    /* Try to bind the ENGINE onto our own ENGINE structure */
-    if (!engine_add_dynamic_id(e, (ENGINE_DYNAMIC_ID)ctx->bind_engine, 1)
-        || !ctx->bind_engine(e, ctx->engine_id, &fns)) {
-        engine_remove_dynamic_id(e, 1);
-        ctx->bind_engine = NULL;
-        ctx->v_check = NULL;
-        DSO_free(ctx->dynamic_dso);
-        ctx->dynamic_dso = NULL;
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED);
-        /* Copy the original ENGINE structure back */
-        memcpy(e, &cpy, sizeof(ENGINE));
-        return 0;
-    }
-    /* Do we try to add this ENGINE to the internal list too? */
-    if (ctx->list_add_value > 0) {
-        if (!ENGINE_add(e)) {
-            /* Do we tolerate this or fail? */
-            if (ctx->list_add_value > 1) {
-                /*
-                 * Fail - NB: By this time, it's too late to rollback, and
-                 * trying to do so allows the bind_engine() code to have
-                 * created leaks. We just have to fail where we are, after
-                 * the ENGINE has changed.
-                 */
-                ERR_raise(ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID);
-                return 0;
-            }
-            /* Tolerate */
-            ERR_clear_error();
-        }
-    }
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/engine/eng_err.c b/deps/openssl/openssl/crypto/engine/eng_err.c
deleted file mode 100644
index 8f5e023864c..00000000000
--- a/deps/openssl/openssl/crypto/engine/eng_err.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/engineerr.h>
-#include "crypto/engineerr.h"
-
-#ifndef OPENSSL_NO_ENGINE
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA ENGINE_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_ALREADY_LOADED), "already loaded" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER),
-        "argument is not a number" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_CMD_NOT_EXECUTABLE),
-        "cmd not executable" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_COMMAND_TAKES_INPUT),
-        "command takes input" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_COMMAND_TAKES_NO_INPUT),
-        "command takes no input" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_CONFLICTING_ENGINE_ID),
-        "conflicting engine id" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED),
-        "ctrl command not implemented" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_DSO_FAILURE), "DSO failure" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_DSO_NOT_FOUND), "dso not found" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_ENGINES_SECTION_ERROR),
-        "engines section error" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_ENGINE_CONFIGURATION_ERROR),
-        "engine configuration error" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_ENGINE_IS_NOT_IN_LIST),
-        "engine is not in the list" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_ENGINE_SECTION_ERROR),
-        "engine section error" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_FAILED_LOADING_PRIVATE_KEY),
-        "failed loading private key" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_FAILED_LOADING_PUBLIC_KEY),
-        "failed loading public key" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_FINISH_FAILED), "finish failed" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_ID_OR_NAME_MISSING),
-        "'id' or 'name' missing" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_INIT_FAILED), "init failed" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_INTERNAL_LIST_ERROR),
-        "internal list error" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_INVALID_ARGUMENT),
-        "invalid argument" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_INVALID_CMD_NAME),
-        "invalid cmd name" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_INVALID_CMD_NUMBER),
-        "invalid cmd number" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_INVALID_INIT_VALUE),
-        "invalid init value" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_INVALID_STRING), "invalid string" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_NOT_INITIALISED), "not initialised" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_NOT_LOADED), "not loaded" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_NO_CONTROL_FUNCTION),
-        "no control function" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_NO_INDEX), "no index" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_NO_LOAD_FUNCTION),
-        "no load function" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_NO_REFERENCE), "no reference" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_NO_SUCH_ENGINE), "no such engine" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_UNIMPLEMENTED_CIPHER),
-        "unimplemented cipher" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_UNIMPLEMENTED_DIGEST),
-        "unimplemented digest" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD),
-        "unimplemented public key method" },
-    { ERR_PACK(ERR_LIB_ENGINE, 0, ENGINE_R_VERSION_INCOMPATIBILITY),
-        "version incompatibility" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_ENGINE_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(ENGINE_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(ENGINE_str_reasons);
-#endif
-    return 1;
-}
-#else
-NON_EMPTY_TRANSLATION_UNIT
-#endif
diff --git a/deps/openssl/openssl/crypto/engine/eng_fat.c b/deps/openssl/openssl/crypto/engine/eng_fat.c
deleted file mode 100644
index 06166cacf25..00000000000
--- a/deps/openssl/openssl/crypto/engine/eng_fat.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "eng_local.h"
-#include <openssl/conf.h>
-
-int ENGINE_set_default(ENGINE *e, unsigned int flags)
-{
-    if ((flags & ENGINE_METHOD_CIPHERS) && !ENGINE_set_default_ciphers(e))
-        return 0;
-    if ((flags & ENGINE_METHOD_DIGESTS) && !ENGINE_set_default_digests(e))
-        return 0;
-    if ((flags & ENGINE_METHOD_RSA) && !ENGINE_set_default_RSA(e))
-        return 0;
-#ifndef OPENSSL_NO_DSA
-    if ((flags & ENGINE_METHOD_DSA) && !ENGINE_set_default_DSA(e))
-        return 0;
-#endif
-#ifndef OPENSSL_NO_DH
-    if ((flags & ENGINE_METHOD_DH) && !ENGINE_set_default_DH(e))
-        return 0;
-#endif
-#ifndef OPENSSL_NO_EC
-    if ((flags & ENGINE_METHOD_EC) && !ENGINE_set_default_EC(e))
-        return 0;
-#endif
-    if ((flags & ENGINE_METHOD_RAND) && !ENGINE_set_default_RAND(e))
-        return 0;
-    if ((flags & ENGINE_METHOD_PKEY_METHS)
-        && !ENGINE_set_default_pkey_meths(e))
-        return 0;
-    if ((flags & ENGINE_METHOD_PKEY_ASN1_METHS)
-        && !ENGINE_set_default_pkey_asn1_meths(e))
-        return 0;
-    return 1;
-}
-
-/* Set default algorithms using a string */
-
-static int int_def_cb(const char *alg, int len, void *arg)
-{
-    unsigned int *pflags = arg;
-    if (alg == NULL)
-        return 0;
-    if (strncmp(alg, "ALL", len) == 0)
-        *pflags |= ENGINE_METHOD_ALL;
-    else if (strncmp(alg, "RSA", len) == 0)
-        *pflags |= ENGINE_METHOD_RSA;
-    else if (strncmp(alg, "DSA", len) == 0)
-        *pflags |= ENGINE_METHOD_DSA;
-    else if (strncmp(alg, "DH", len) == 0)
-        *pflags |= ENGINE_METHOD_DH;
-    else if (strncmp(alg, "EC", len) == 0)
-        *pflags |= ENGINE_METHOD_EC;
-    else if (strncmp(alg, "RAND", len) == 0)
-        *pflags |= ENGINE_METHOD_RAND;
-    else if (strncmp(alg, "CIPHERS", len) == 0)
-        *pflags |= ENGINE_METHOD_CIPHERS;
-    else if (strncmp(alg, "DIGESTS", len) == 0)
-        *pflags |= ENGINE_METHOD_DIGESTS;
-    else if (strncmp(alg, "PKEY", len) == 0)
-        *pflags |= ENGINE_METHOD_PKEY_METHS | ENGINE_METHOD_PKEY_ASN1_METHS;
-    else if (strncmp(alg, "PKEY_CRYPTO", len) == 0)
-        *pflags |= ENGINE_METHOD_PKEY_METHS;
-    else if (strncmp(alg, "PKEY_ASN1", len) == 0)
-        *pflags |= ENGINE_METHOD_PKEY_ASN1_METHS;
-    else
-        return 0;
-    return 1;
-}
-
-int ENGINE_set_default_string(ENGINE *e, const char *def_list)
-{
-    unsigned int flags = 0;
-    if (!CONF_parse_list(def_list, ',', 1, int_def_cb, &flags)) {
-        ERR_raise_data(ERR_LIB_ENGINE, ENGINE_R_INVALID_STRING,
-            "str=%s", def_list);
-        return 0;
-    }
-    return ENGINE_set_default(e, flags);
-}
-
-int ENGINE_register_complete(ENGINE *e)
-{
-    ENGINE_register_ciphers(e);
-    ENGINE_register_digests(e);
-    ENGINE_register_RSA(e);
-#ifndef OPENSSL_NO_DSA
-    ENGINE_register_DSA(e);
-#endif
-#ifndef OPENSSL_NO_DH
-    ENGINE_register_DH(e);
-#endif
-#ifndef OPENSSL_NO_EC
-    ENGINE_register_EC(e);
-#endif
-    ENGINE_register_RAND(e);
-    ENGINE_register_pkey_meths(e);
-    ENGINE_register_pkey_asn1_meths(e);
-    return 1;
-}
-
-int ENGINE_register_all_complete(void)
-{
-    ENGINE *e;
-
-    for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
-        if (!(e->flags & ENGINE_FLAGS_NO_REGISTER_ALL))
-            ENGINE_register_complete(e);
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/engine/eng_init.c b/deps/openssl/openssl/crypto/engine/eng_init.c
deleted file mode 100644
index 0ac91ff5ed7..00000000000
--- a/deps/openssl/openssl/crypto/engine/eng_init.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright 2001-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "internal/e_os.h"
-#include "eng_local.h"
-
-/*
- * Initialise an engine type for use (or up its functional reference count if
- * it's already in use). This version is only used internally.
- */
-int engine_unlocked_init(ENGINE *e)
-{
-    int to_return = 1;
-
-    if ((e->funct_ref == 0) && e->init)
-        /*
-         * This is the first functional reference and the engine requires
-         * initialisation so we do it now.
-         */
-        to_return = e->init(e);
-    if (to_return) {
-        int ref;
-
-        /*
-         * OK, we return a functional reference which is also a structural
-         * reference.
-         */
-        if (!CRYPTO_UP_REF(&e->struct_ref, &ref)) {
-            e->finish(e);
-            return 0;
-        }
-        e->funct_ref++;
-        ENGINE_REF_PRINT(e, 0, 1);
-        ENGINE_REF_PRINT(e, 1, 1);
-    }
-    return to_return;
-}
-
-/*
- * Free a functional reference to an engine type. This version is only used
- * internally.
- */
-int engine_unlocked_finish(ENGINE *e, int unlock_for_handlers)
-{
-    int to_return = 1;
-
-    /*
-     * Reduce the functional reference count here so if it's the terminating
-     * case, we can release the lock safely and call the finish() handler
-     * without risk of a race. We get a race if we leave the count until
-     * after and something else is calling "finish" at the same time -
-     * there's a chance that both threads will together take the count from 2
-     * to 0 without either calling finish().
-     */
-    e->funct_ref--;
-    ENGINE_REF_PRINT(e, 1, -1);
-    if ((e->funct_ref == 0) && e->finish) {
-        if (unlock_for_handlers)
-            CRYPTO_THREAD_unlock(global_engine_lock);
-        to_return = e->finish(e);
-        if (unlock_for_handlers)
-            if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-                return 0;
-        if (!to_return)
-            return 0;
-    }
-    REF_ASSERT_ISNT(e->funct_ref < 0);
-    /* Release the structural reference too */
-    if (!engine_free_util(e, 0)) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED);
-        return 0;
-    }
-    return to_return;
-}
-
-/* The API (locked) version of "init" */
-int ENGINE_init(ENGINE *e)
-{
-    int ret;
-    if (e == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return 0;
-    }
-    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
-        /* Maybe this should be raised in do_engine_lock_init() */
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
-        return 0;
-    }
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return 0;
-    ret = engine_unlocked_init(e);
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    return ret;
-}
-
-/* The API (locked) version of "finish" */
-int ENGINE_finish(ENGINE *e)
-{
-    int to_return = 1;
-
-    if (e == NULL)
-        return 1;
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return 0;
-    to_return = engine_unlocked_finish(e, 1);
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    if (!to_return) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED);
-        return 0;
-    }
-    return to_return;
-}
diff --git a/deps/openssl/openssl/crypto/engine/eng_lib.c b/deps/openssl/openssl/crypto/engine/eng_lib.c
deleted file mode 100644
index 04a2602ed2d..00000000000
--- a/deps/openssl/openssl/crypto/engine/eng_lib.c
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * Copyright 2001-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include "internal/e_os.h"
-#include "eng_local.h"
-#include <openssl/rand.h>
-#include "internal/refcount.h"
-
-CRYPTO_RWLOCK *global_engine_lock;
-
-CRYPTO_ONCE engine_lock_init = CRYPTO_ONCE_STATIC_INIT;
-
-/* The "new"/"free" stuff first */
-
-DEFINE_RUN_ONCE(do_engine_lock_init)
-{
-    global_engine_lock = CRYPTO_THREAD_lock_new();
-    return global_engine_lock != NULL;
-}
-
-ENGINE *ENGINE_new(void)
-{
-    ENGINE *ret;
-
-    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
-        /* Maybe this should be raised in do_engine_lock_init() */
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
-        return 0;
-    }
-    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
-        return NULL;
-    if (!CRYPTO_NEW_REF(&ret->struct_ref, 1)) {
-        OPENSSL_free(ret);
-        return NULL;
-    }
-    ENGINE_REF_PRINT(ret, 0, 1);
-    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_ENGINE, ret, &ret->ex_data)) {
-        CRYPTO_FREE_REF(&ret->struct_ref);
-        OPENSSL_free(ret);
-        return NULL;
-    }
-    return ret;
-}
-
-/*
- * Placed here (close proximity to ENGINE_new) so that modifications to the
- * elements of the ENGINE structure are more likely to be caught and changed
- * here.
- */
-void engine_set_all_null(ENGINE *e)
-{
-    e->id = NULL;
-    e->name = NULL;
-    e->rsa_meth = NULL;
-    e->dsa_meth = NULL;
-    e->dh_meth = NULL;
-    e->rand_meth = NULL;
-    e->ciphers = NULL;
-    e->digests = NULL;
-    e->destroy = NULL;
-    e->init = NULL;
-    e->finish = NULL;
-    e->ctrl = NULL;
-    e->load_privkey = NULL;
-    e->load_pubkey = NULL;
-    e->cmd_defns = NULL;
-    e->flags = 0;
-    e->dynamic_id = NULL;
-}
-
-int engine_free_util(ENGINE *e, int not_locked)
-{
-    int i;
-
-    if (e == NULL)
-        return 1;
-    CRYPTO_DOWN_REF(&e->struct_ref, &i);
-    ENGINE_REF_PRINT(e, 0, -1);
-    if (i > 0)
-        return 1;
-    REF_ASSERT_ISNT(i < 0);
-    /* Free up any dynamically allocated public key methods */
-    engine_pkey_meths_free(e);
-    engine_pkey_asn1_meths_free(e);
-    /*
-     * Give the ENGINE a chance to do any structural cleanup corresponding to
-     * allocation it did in its constructor (eg. unload error strings)
-     */
-    if (e->destroy)
-        e->destroy(e);
-    engine_remove_dynamic_id(e, not_locked);
-    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ENGINE, e, &e->ex_data);
-    CRYPTO_FREE_REF(&e->struct_ref);
-    OPENSSL_free(e);
-    return 1;
-}
-
-int ENGINE_free(ENGINE *e)
-{
-    return engine_free_util(e, 1);
-}
-
-/* Cleanup stuff */
-
-/*
- * engine_cleanup_int() is coded such that anything that does work that will
- * need cleanup can register a "cleanup" callback here. That way we don't get
- * linker bloat by referring to all *possible* cleanups, but any linker bloat
- * into code "X" will cause X's cleanup function to end up here.
- */
-static STACK_OF(ENGINE_CLEANUP_ITEM) *cleanup_stack = NULL;
-static int int_cleanup_check(int create)
-{
-    if (cleanup_stack)
-        return 1;
-    if (!create)
-        return 0;
-    cleanup_stack = sk_ENGINE_CLEANUP_ITEM_new_null();
-    return (cleanup_stack ? 1 : 0);
-}
-
-static ENGINE_CLEANUP_ITEM *int_cleanup_item(ENGINE_CLEANUP_CB *cb)
-{
-    ENGINE_CLEANUP_ITEM *item;
-
-    if ((item = OPENSSL_malloc(sizeof(*item))) == NULL)
-        return NULL;
-    item->cb = cb;
-    return item;
-}
-
-int engine_cleanup_add_first(ENGINE_CLEANUP_CB *cb)
-{
-    ENGINE_CLEANUP_ITEM *item;
-
-    if (!int_cleanup_check(1))
-        return 0;
-    item = int_cleanup_item(cb);
-    if (item != NULL) {
-        if (sk_ENGINE_CLEANUP_ITEM_insert(cleanup_stack, item, 0))
-            return 1;
-        OPENSSL_free(item);
-    }
-    return 0;
-}
-
-int engine_cleanup_add_last(ENGINE_CLEANUP_CB *cb)
-{
-    ENGINE_CLEANUP_ITEM *item;
-
-    if (!int_cleanup_check(1))
-        return 0;
-    item = int_cleanup_item(cb);
-    if (item != NULL) {
-        if (sk_ENGINE_CLEANUP_ITEM_push(cleanup_stack, item) > 0)
-            return 1;
-        OPENSSL_free(item);
-    }
-    return 0;
-}
-
-/* The API function that performs all cleanup */
-static void engine_cleanup_cb_free(ENGINE_CLEANUP_ITEM *item)
-{
-    (*(item->cb))();
-    OPENSSL_free(item);
-}
-
-void engine_cleanup_int(void)
-{
-    if (int_cleanup_check(0)) {
-        sk_ENGINE_CLEANUP_ITEM_pop_free(cleanup_stack,
-            engine_cleanup_cb_free);
-        cleanup_stack = NULL;
-    }
-    CRYPTO_THREAD_lock_free(global_engine_lock);
-    global_engine_lock = NULL;
-}
-
-/* Now the "ex_data" support */
-
-int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg)
-{
-    return CRYPTO_set_ex_data(&e->ex_data, idx, arg);
-}
-
-void *ENGINE_get_ex_data(const ENGINE *e, int idx)
-{
-    return CRYPTO_get_ex_data(&e->ex_data, idx);
-}
-
-/*
- * Functions to get/set an ENGINE's elements - mainly to avoid exposing the
- * ENGINE structure itself.
- */
-
-int ENGINE_set_id(ENGINE *e, const char *id)
-{
-    if (id == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return 0;
-    }
-    e->id = id;
-    return 1;
-}
-
-int ENGINE_set_name(ENGINE *e, const char *name)
-{
-    if (name == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return 0;
-    }
-    e->name = name;
-    return 1;
-}
-
-int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f)
-{
-    e->destroy = destroy_f;
-    return 1;
-}
-
-int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f)
-{
-    e->init = init_f;
-    return 1;
-}
-
-int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f)
-{
-    e->finish = finish_f;
-    return 1;
-}
-
-int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f)
-{
-    e->ctrl = ctrl_f;
-    return 1;
-}
-
-int ENGINE_set_flags(ENGINE *e, int flags)
-{
-    e->flags = flags;
-    return 1;
-}
-
-int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns)
-{
-    e->cmd_defns = defns;
-    return 1;
-}
-
-const char *ENGINE_get_id(const ENGINE *e)
-{
-    return e->id;
-}
-
-const char *ENGINE_get_name(const ENGINE *e)
-{
-    return e->name;
-}
-
-ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e)
-{
-    return e->destroy;
-}
-
-ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e)
-{
-    return e->init;
-}
-
-ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e)
-{
-    return e->finish;
-}
-
-ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e)
-{
-    return e->ctrl;
-}
-
-int ENGINE_get_flags(const ENGINE *e)
-{
-    return e->flags;
-}
-
-const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e)
-{
-    return e->cmd_defns;
-}
-
-/*
- * eng_lib.o is pretty much linked into anything that touches ENGINE already,
- * so put the "static_state" hack here.
- */
-
-static int internal_static_hack = 0;
-
-void *ENGINE_get_static_state(void)
-{
-    return &internal_static_hack;
-}
diff --git a/deps/openssl/openssl/crypto/engine/eng_list.c b/deps/openssl/openssl/crypto/engine/eng_list.c
deleted file mode 100644
index 917fa84a40c..00000000000
--- a/deps/openssl/openssl/crypto/engine/eng_list.c
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * Copyright 2001-2024 The OpenSSL Project Authors. All Rights Reserved.
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "eng_local.h"
-
-/*
- * The linked-list of pointers to engine types. engine_list_head incorporates
- * an implicit structural reference but engine_list_tail does not - the
- * latter is a computational optimization and only points to something that
- * is already pointed to by its predecessor in the list (or engine_list_head
- * itself). In the same way, the use of the "prev" pointer in each ENGINE is
- * to save excessive list iteration, it doesn't correspond to an extra
- * structural reference. Hence, engine_list_head, and each non-null "next"
- * pointer account for the list itself assuming exactly 1 structural
- * reference on each list member.
- */
-static ENGINE *engine_list_head = NULL;
-static ENGINE *engine_list_tail = NULL;
-
-/*
- * The linked list of currently loaded dynamic engines.
- */
-static ENGINE *engine_dyn_list_head = NULL;
-static ENGINE *engine_dyn_list_tail = NULL;
-
-/*
- * This cleanup function is only needed internally. If it should be called,
- * we register it with the "engine_cleanup_int()" stack to be called during
- * cleanup.
- */
-
-static void engine_list_cleanup(void)
-{
-    ENGINE *iterator = engine_list_head;
-
-    while (iterator != NULL) {
-        ENGINE_remove(iterator);
-        iterator = engine_list_head;
-    }
-    return;
-}
-
-/*
- * These static functions starting with a lower case "engine_" always take
- * place when global_engine_lock has been locked up.
- */
-static int engine_list_add(ENGINE *e)
-{
-    int conflict = 0;
-    ENGINE *iterator = NULL;
-    int ref;
-
-    if (e == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return 0;
-    }
-    iterator = engine_list_head;
-    while (iterator && !conflict) {
-        conflict = (strcmp(iterator->id, e->id) == 0);
-        iterator = iterator->next;
-    }
-    if (conflict) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID);
-        return 0;
-    }
-
-    /*
-     * Having the engine in the list assumes a structural reference.
-     */
-    if (!CRYPTO_UP_REF(&e->struct_ref, &ref)) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
-        return 0;
-    }
-    ENGINE_REF_PRINT(e, 0, 1);
-    if (engine_list_head == NULL) {
-        /* We are adding to an empty list. */
-        if (engine_list_tail != NULL) {
-            CRYPTO_DOWN_REF(&e->struct_ref, &ref);
-            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
-            return 0;
-        }
-        /*
-         * The first time the list allocates, we should register the cleanup.
-         */
-        if (!engine_cleanup_add_last(engine_list_cleanup)) {
-            CRYPTO_DOWN_REF(&e->struct_ref, &ref);
-            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
-            return 0;
-        }
-        engine_list_head = e;
-        e->prev = NULL;
-    } else {
-        /* We are adding to the tail of an existing list. */
-        if ((engine_list_tail == NULL) || (engine_list_tail->next != NULL)) {
-            CRYPTO_DOWN_REF(&e->struct_ref, &ref);
-            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
-            return 0;
-        }
-        engine_list_tail->next = e;
-        e->prev = engine_list_tail;
-    }
-
-    /* However it came to be, e is the last item in the list. */
-    engine_list_tail = e;
-    e->next = NULL;
-    return 1;
-}
-
-static int engine_list_remove(ENGINE *e)
-{
-    ENGINE *iterator;
-
-    if (e == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return 0;
-    }
-    /* We need to check that e is in our linked list! */
-    iterator = engine_list_head;
-    while (iterator && (iterator != e))
-        iterator = iterator->next;
-    if (iterator == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_ENGINE_IS_NOT_IN_LIST);
-        return 0;
-    }
-    /* un-link e from the chain. */
-    if (e->next)
-        e->next->prev = e->prev;
-    if (e->prev)
-        e->prev->next = e->next;
-    /* Correct our head/tail if necessary. */
-    if (engine_list_head == e)
-        engine_list_head = e->next;
-    if (engine_list_tail == e)
-        engine_list_tail = e->prev;
-    engine_free_util(e, 0);
-    return 1;
-}
-
-/* Add engine to dynamic engine list. */
-int engine_add_dynamic_id(ENGINE *e, ENGINE_DYNAMIC_ID dynamic_id,
-    int not_locked)
-{
-    int result = 0;
-    ENGINE *iterator = NULL;
-
-    if (e == NULL)
-        return 0;
-
-    if (e->dynamic_id == NULL && dynamic_id == NULL)
-        return 0;
-
-    if (not_locked && !CRYPTO_THREAD_write_lock(global_engine_lock))
-        return 0;
-
-    if (dynamic_id != NULL) {
-        iterator = engine_dyn_list_head;
-        while (iterator != NULL) {
-            if (iterator->dynamic_id == dynamic_id)
-                goto err;
-            iterator = iterator->next;
-        }
-        if (e->dynamic_id != NULL)
-            goto err;
-        e->dynamic_id = dynamic_id;
-    }
-
-    if (engine_dyn_list_head == NULL) {
-        /* We are adding to an empty list. */
-        if (engine_dyn_list_tail != NULL)
-            goto err;
-        engine_dyn_list_head = e;
-        e->prev_dyn = NULL;
-    } else {
-        /* We are adding to the tail of an existing list. */
-        if (engine_dyn_list_tail == NULL
-            || engine_dyn_list_tail->next_dyn != NULL)
-            goto err;
-        engine_dyn_list_tail->next_dyn = e;
-        e->prev_dyn = engine_dyn_list_tail;
-    }
-
-    engine_dyn_list_tail = e;
-    e->next_dyn = NULL;
-    result = 1;
-
-err:
-    if (not_locked)
-        CRYPTO_THREAD_unlock(global_engine_lock);
-    return result;
-}
-
-/* Remove engine from dynamic engine list. */
-void engine_remove_dynamic_id(ENGINE *e, int not_locked)
-{
-    if (e == NULL || e->dynamic_id == NULL)
-        return;
-
-    if (not_locked && !CRYPTO_THREAD_write_lock(global_engine_lock))
-        return;
-
-    e->dynamic_id = NULL;
-
-    /* un-link e from the chain. */
-    if (e->next_dyn != NULL)
-        e->next_dyn->prev_dyn = e->prev_dyn;
-    if (e->prev_dyn != NULL)
-        e->prev_dyn->next_dyn = e->next_dyn;
-    /* Correct our head/tail if necessary. */
-    if (engine_dyn_list_head == e)
-        engine_dyn_list_head = e->next_dyn;
-    if (engine_dyn_list_tail == e)
-        engine_dyn_list_tail = e->prev_dyn;
-
-    if (not_locked)
-        CRYPTO_THREAD_unlock(global_engine_lock);
-}
-
-/* Get the first/last "ENGINE" type available. */
-ENGINE *ENGINE_get_first(void)
-{
-    ENGINE *ret;
-
-    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
-        /* Maybe this should be raised in do_engine_lock_init() */
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
-        return NULL;
-    }
-
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return NULL;
-    ret = engine_list_head;
-    if (ret) {
-        int ref;
-
-        if (!CRYPTO_UP_REF(&ret->struct_ref, &ref)) {
-            CRYPTO_THREAD_unlock(global_engine_lock);
-            ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
-            return NULL;
-        }
-        ENGINE_REF_PRINT(ret, 0, 1);
-    }
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    return ret;
-}
-
-ENGINE *ENGINE_get_last(void)
-{
-    ENGINE *ret;
-
-    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
-        /* Maybe this should be raised in do_engine_lock_init() */
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
-        return NULL;
-    }
-
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return NULL;
-    ret = engine_list_tail;
-    if (ret) {
-        int ref;
-
-        if (!CRYPTO_UP_REF(&ret->struct_ref, &ref)) {
-            CRYPTO_THREAD_unlock(global_engine_lock);
-            ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
-            return NULL;
-        }
-        ENGINE_REF_PRINT(ret, 0, 1);
-    }
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    return ret;
-}
-
-/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
-ENGINE *ENGINE_get_next(ENGINE *e)
-{
-    ENGINE *ret = NULL;
-    if (e == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return NULL;
-    }
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return NULL;
-    ret = e->next;
-    if (ret) {
-        int ref;
-
-        /* Return a valid structural reference to the next ENGINE */
-        if (!CRYPTO_UP_REF(&ret->struct_ref, &ref)) {
-            CRYPTO_THREAD_unlock(global_engine_lock);
-            ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
-            return NULL;
-        }
-        ENGINE_REF_PRINT(ret, 0, 1);
-    }
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    /* Release the structural reference to the previous ENGINE */
-    ENGINE_free(e);
-    return ret;
-}
-
-ENGINE *ENGINE_get_prev(ENGINE *e)
-{
-    ENGINE *ret = NULL;
-    if (e == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return NULL;
-    }
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return NULL;
-    ret = e->prev;
-    if (ret) {
-        int ref;
-
-        /* Return a valid structural reference to the next ENGINE */
-        if (!CRYPTO_UP_REF(&ret->struct_ref, &ref)) {
-            CRYPTO_THREAD_unlock(global_engine_lock);
-            ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
-            return NULL;
-        }
-        ENGINE_REF_PRINT(ret, 0, 1);
-    }
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    /* Release the structural reference to the previous ENGINE */
-    ENGINE_free(e);
-    return ret;
-}
-
-/* Add another "ENGINE" type into the list. */
-int ENGINE_add(ENGINE *e)
-{
-    int to_return = 1;
-    if (e == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return 0;
-    }
-    if ((e->id == NULL) || (e->name == NULL)) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_ID_OR_NAME_MISSING);
-        return 0;
-    }
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return 0;
-    if (!engine_list_add(e)) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
-        to_return = 0;
-    }
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    return to_return;
-}
-
-/* Remove an existing "ENGINE" type from the array. */
-int ENGINE_remove(ENGINE *e)
-{
-    int to_return = 1;
-    if (e == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return 0;
-    }
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return 0;
-    if (!engine_list_remove(e)) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
-        to_return = 0;
-    }
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    return to_return;
-}
-
-static void engine_cpy(ENGINE *dest, const ENGINE *src)
-{
-    dest->id = src->id;
-    dest->name = src->name;
-    dest->rsa_meth = src->rsa_meth;
-#ifndef OPENSSL_NO_DSA
-    dest->dsa_meth = src->dsa_meth;
-#endif
-#ifndef OPENSSL_NO_DH
-    dest->dh_meth = src->dh_meth;
-#endif
-#ifndef OPENSSL_NO_EC
-    dest->ec_meth = src->ec_meth;
-#endif
-    dest->rand_meth = src->rand_meth;
-    dest->ciphers = src->ciphers;
-    dest->digests = src->digests;
-    dest->pkey_meths = src->pkey_meths;
-    dest->destroy = src->destroy;
-    dest->init = src->init;
-    dest->finish = src->finish;
-    dest->ctrl = src->ctrl;
-    dest->load_privkey = src->load_privkey;
-    dest->load_pubkey = src->load_pubkey;
-    dest->cmd_defns = src->cmd_defns;
-    dest->flags = src->flags;
-    dest->dynamic_id = src->dynamic_id;
-    engine_add_dynamic_id(dest, NULL, 0);
-}
-
-ENGINE *ENGINE_by_id(const char *id)
-{
-    ENGINE *iterator;
-    const char *load_dir = NULL;
-    if (id == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return NULL;
-    }
-    ENGINE_load_builtin_engines();
-
-    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
-        /* Maybe this should be raised in do_engine_lock_init() */
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
-        return NULL;
-    }
-
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return NULL;
-    iterator = engine_list_head;
-    while (iterator && (strcmp(id, iterator->id) != 0))
-        iterator = iterator->next;
-    if (iterator != NULL) {
-        /*
-         * We need to return a structural reference. If this is an ENGINE
-         * type that returns copies, make a duplicate - otherwise increment
-         * the existing ENGINE's reference count.
-         */
-        if (iterator->flags & ENGINE_FLAGS_BY_ID_COPY) {
-            ENGINE *cp = ENGINE_new();
-            if (cp == NULL)
-                iterator = NULL;
-            else {
-                engine_cpy(cp, iterator);
-                iterator = cp;
-            }
-        } else {
-            int ref;
-
-            if (!CRYPTO_UP_REF(&iterator->struct_ref, &ref)) {
-                CRYPTO_THREAD_unlock(global_engine_lock);
-                ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
-                return NULL;
-            }
-            ENGINE_REF_PRINT(iterator, 0, 1);
-        }
-    }
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    if (iterator != NULL)
-        return iterator;
-    /*
-     * Prevent infinite recursion if we're looking for the dynamic engine.
-     */
-    if (strcmp(id, "dynamic")) {
-        if ((load_dir = ossl_safe_getenv("OPENSSL_ENGINES")) == NULL)
-            load_dir = ossl_get_enginesdir();
-        iterator = ENGINE_by_id("dynamic");
-        if (!iterator || !ENGINE_ctrl_cmd_string(iterator, "ID", id, 0) || !ENGINE_ctrl_cmd_string(iterator, "DIR_LOAD", "2", 0) || !ENGINE_ctrl_cmd_string(iterator, "DIR_ADD", load_dir, 0) || !ENGINE_ctrl_cmd_string(iterator, "LIST_ADD", "1", 0) || !ENGINE_ctrl_cmd_string(iterator, "LOAD", NULL, 0))
-            goto notfound;
-        return iterator;
-    }
-notfound:
-    ENGINE_free(iterator);
-    ERR_raise_data(ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE, "id=%s", id);
-    return NULL;
-    /* EEK! Experimental code ends */
-}
-
-int ENGINE_up_ref(ENGINE *e)
-{
-    int i;
-    if (e == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return 0;
-    }
-    CRYPTO_UP_REF(&e->struct_ref, &i);
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/engine/eng_local.h b/deps/openssl/openssl/crypto/engine/eng_local.h
deleted file mode 100644
index d69b621b6d7..00000000000
--- a/deps/openssl/openssl/crypto/engine/eng_local.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright 2001-2023 The OpenSSL Project Authors. All Rights Reserved.
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_ENGINE_ENG_LOCAL_H
-#define OSSL_CRYPTO_ENGINE_ENG_LOCAL_H
-
-#include <openssl/trace.h>
-#include "internal/cryptlib.h"
-#include "crypto/engine.h"
-#include "internal/thread_once.h"
-#include "internal/refcount.h"
-
-extern CRYPTO_RWLOCK *global_engine_lock;
-
-/*
- * This prints the engine's pointer address, "struct" or "funct" to
- * indicate the reference type, the before and after reference count, and
- * the file:line-number pair. The "ENGINE_REF_PRINT" statements must come
- * *after* the change.
- */
-#define ENGINE_REF_PRINT(e, isfunct, diff)                \
-    OSSL_TRACE6(ENGINE_REF_COUNT,                         \
-        "engine: %p %s from %d to %d (%s:%d)\n",          \
-        (void *)(e), (isfunct ? "funct" : "struct"),      \
-        ((isfunct)                                        \
-                ? ((e)->funct_ref - (diff))               \
-                : (eng_struct_ref(e) - (diff))),          \
-        ((isfunct) ? (e)->funct_ref : eng_struct_ref(e)), \
-        (OPENSSL_FILE), (OPENSSL_LINE))
-
-/*
- * Any code that will need cleanup operations should use these functions to
- * register callbacks. engine_cleanup_int() will call all registered
- * callbacks in order. NB: both the "add" functions assume the engine lock to
- * already be held (in "write" mode).
- */
-typedef void(ENGINE_CLEANUP_CB)(void);
-typedef struct st_engine_cleanup_item {
-    ENGINE_CLEANUP_CB *cb;
-} ENGINE_CLEANUP_ITEM;
-DEFINE_STACK_OF(ENGINE_CLEANUP_ITEM)
-int engine_cleanup_add_first(ENGINE_CLEANUP_CB *cb);
-int engine_cleanup_add_last(ENGINE_CLEANUP_CB *cb);
-
-/* We need stacks of ENGINEs for use in eng_table.c */
-DEFINE_STACK_OF(ENGINE)
-
-/*
- * This represents an implementation table. Dependent code should instantiate
- * it as a (ENGINE_TABLE *) pointer value set initially to NULL.
- */
-typedef struct st_engine_table ENGINE_TABLE;
-int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup,
-    ENGINE *e, const int *nids, int num_nids,
-    int setdefault);
-void engine_table_unregister(ENGINE_TABLE **table, ENGINE *e);
-void engine_table_cleanup(ENGINE_TABLE **table);
-ENGINE *ossl_engine_table_select(ENGINE_TABLE **table, int nid,
-    const char *f, int l);
-typedef void(engine_table_doall_cb)(int nid, STACK_OF(ENGINE) *sk,
-    ENGINE *def, void *arg);
-void engine_table_doall(ENGINE_TABLE *table, engine_table_doall_cb *cb,
-    void *arg);
-
-/*
- * Internal versions of API functions that have control over locking. These
- * are used between C files when functionality needs to be shared but the
- * caller may already be controlling of the engine lock.
- */
-int engine_unlocked_init(ENGINE *e);
-int engine_unlocked_finish(ENGINE *e, int unlock_for_handlers);
-int engine_free_util(ENGINE *e, int not_locked);
-
-/*
- * This function will reset all "set"able values in an ENGINE to NULL. This
- * won't touch reference counts or ex_data, but is equivalent to calling all
- * the ENGINE_set_***() functions with a NULL value.
- */
-void engine_set_all_null(ENGINE *e);
-
-/*
- * NB: Bitwise OR-able values for the "flags" variable in ENGINE are now
- * exposed in engine.h.
- */
-
-/* Free up dynamically allocated public key methods associated with ENGINE */
-
-void engine_pkey_meths_free(ENGINE *e);
-void engine_pkey_asn1_meths_free(ENGINE *e);
-
-/* Once initialisation function */
-extern CRYPTO_ONCE engine_lock_init;
-DECLARE_RUN_ONCE(do_engine_lock_init)
-
-typedef void (*ENGINE_DYNAMIC_ID)(void);
-int engine_add_dynamic_id(ENGINE *e, ENGINE_DYNAMIC_ID dynamic_id,
-    int not_locked);
-void engine_remove_dynamic_id(ENGINE *e, int not_locked);
-
-/*
- * This is a structure for storing implementations of various crypto
- * algorithms and functions.
- */
-struct engine_st {
-    const char *id;
-    const char *name;
-    const RSA_METHOD *rsa_meth;
-    const DSA_METHOD *dsa_meth;
-    const DH_METHOD *dh_meth;
-    const EC_KEY_METHOD *ec_meth;
-    const RAND_METHOD *rand_meth;
-    /* Cipher handling is via this callback */
-    ENGINE_CIPHERS_PTR ciphers;
-    /* Digest handling is via this callback */
-    ENGINE_DIGESTS_PTR digests;
-    /* Public key handling via this callback */
-    ENGINE_PKEY_METHS_PTR pkey_meths;
-    /* ASN1 public key handling via this callback */
-    ENGINE_PKEY_ASN1_METHS_PTR pkey_asn1_meths;
-    ENGINE_GEN_INT_FUNC_PTR destroy;
-    ENGINE_GEN_INT_FUNC_PTR init;
-    ENGINE_GEN_INT_FUNC_PTR finish;
-    ENGINE_CTRL_FUNC_PTR ctrl;
-    ENGINE_LOAD_KEY_PTR load_privkey;
-    ENGINE_LOAD_KEY_PTR load_pubkey;
-    ENGINE_SSL_CLIENT_CERT_PTR load_ssl_client_cert;
-    const ENGINE_CMD_DEFN *cmd_defns;
-    int flags;
-    /* reference count on the structure itself */
-    CRYPTO_REF_COUNT struct_ref;
-    /*
-     * reference count on usability of the engine type. NB: This controls the
-     * loading and initialisation of any functionality required by this
-     * engine, whereas the previous count is simply to cope with
-     * (de)allocation of this structure. Hence, running_ref <= struct_ref at
-     * all times.
-     */
-    int funct_ref;
-    /* A place to store per-ENGINE data */
-    CRYPTO_EX_DATA ex_data;
-    /* Used to maintain the linked-list of engines. */
-    struct engine_st *prev;
-    struct engine_st *next;
-    /* Used to maintain the linked-list of dynamic engines. */
-    struct engine_st *prev_dyn;
-    struct engine_st *next_dyn;
-    ENGINE_DYNAMIC_ID dynamic_id;
-};
-
-typedef struct st_engine_pile ENGINE_PILE;
-
-DEFINE_LHASH_OF_EX(ENGINE_PILE);
-
-static ossl_unused ossl_inline int eng_struct_ref(ENGINE *e)
-{
-    int res;
-
-    CRYPTO_GET_REF(&e->struct_ref, &res);
-    return res;
-}
-
-#endif /* OSSL_CRYPTO_ENGINE_ENG_LOCAL_H */
diff --git a/deps/openssl/openssl/crypto/engine/eng_openssl.c b/deps/openssl/openssl/crypto/engine/eng_openssl.c
deleted file mode 100644
index b6cfb5dd1b8..00000000000
--- a/deps/openssl/openssl/crypto/engine/eng_openssl.c
+++ /dev/null
@@ -1,670 +0,0 @@
-/*
- * Copyright 2001-2025 The OpenSSL Project Authors. All Rights Reserved.
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-/*
- * RC4 and SHA-1 low level APIs and EVP _meth_ APISs are deprecated for public
- * use, but still ok for internal use.
- */
-#include "internal/deprecated.h"
-
-#include <stdio.h>
-#include <openssl/crypto.h>
-#include "internal/cryptlib.h"
-#include "crypto/engine.h"
-#include <openssl/pem.h>
-#include <openssl/evp.h>
-#include <openssl/rand.h>
-#include <openssl/rsa.h>
-#include <openssl/dsa.h>
-#include <openssl/dh.h>
-
-#include <openssl/hmac.h>
-#include <openssl/x509v3.h>
-
-/*
- * This testing gunk is implemented (and explained) lower down. It also
- * assumes the application explicitly calls "ENGINE_load_openssl()" because
- * this is no longer automatic in ENGINE_load_builtin_engines().
- */
-#define TEST_ENG_OPENSSL_RC4
-#ifndef OPENSSL_NO_STDIO
-#define TEST_ENG_OPENSSL_PKEY
-#endif
-/* #define TEST_ENG_OPENSSL_HMAC */
-/* #define TEST_ENG_OPENSSL_HMAC_INIT */
-/* #define TEST_ENG_OPENSSL_RC4_OTHERS */
-#ifndef OPENSSL_NO_STDIO
-#define TEST_ENG_OPENSSL_RC4_P_INIT
-#endif
-/* #define TEST_ENG_OPENSSL_RC4_P_CIPHER */
-#define TEST_ENG_OPENSSL_SHA
-/* #define TEST_ENG_OPENSSL_SHA_OTHERS */
-/* #define TEST_ENG_OPENSSL_SHA_P_INIT */
-/* #define TEST_ENG_OPENSSL_SHA_P_UPDATE */
-/* #define TEST_ENG_OPENSSL_SHA_P_FINAL */
-
-/* Now check what of those algorithms are actually enabled */
-#ifdef OPENSSL_NO_RC4
-#undef TEST_ENG_OPENSSL_RC4
-#undef TEST_ENG_OPENSSL_RC4_OTHERS
-#undef TEST_ENG_OPENSSL_RC4_P_INIT
-#undef TEST_ENG_OPENSSL_RC4_P_CIPHER
-#endif
-
-static int openssl_destroy(ENGINE *e);
-
-#ifdef TEST_ENG_OPENSSL_RC4
-static int openssl_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
-    const int **nids, int nid);
-#endif
-#ifdef TEST_ENG_OPENSSL_SHA
-static int openssl_digests(ENGINE *e, const EVP_MD **digest,
-    const int **nids, int nid);
-#endif
-
-#ifdef TEST_ENG_OPENSSL_PKEY
-static EVP_PKEY *openssl_load_privkey(ENGINE *eng, const char *key_id,
-    UI_METHOD *ui_method,
-    void *callback_data);
-#endif
-
-#ifdef TEST_ENG_OPENSSL_HMAC
-static int ossl_register_hmac_meth(void);
-static int ossl_pkey_meths(ENGINE *e, EVP_PKEY_METHOD **pmeth,
-    const int **nids, int nid);
-#endif
-
-/* The constants used when creating the ENGINE */
-static const char *engine_openssl_id = "openssl";
-static const char *engine_openssl_name = "Software engine support";
-
-/*
- * This internal function is used by ENGINE_openssl() and possibly by the
- * "dynamic" ENGINE support too
- */
-static int bind_helper(ENGINE *e)
-{
-    if (!ENGINE_set_id(e, engine_openssl_id)
-        || !ENGINE_set_name(e, engine_openssl_name)
-        || !ENGINE_set_destroy_function(e, openssl_destroy)
-#ifndef TEST_ENG_OPENSSL_NO_ALGORITHMS
-        || !ENGINE_set_RSA(e, RSA_get_default_method())
-#ifndef OPENSSL_NO_DSA
-        || !ENGINE_set_DSA(e, DSA_get_default_method())
-#endif
-#ifndef OPENSSL_NO_EC
-        || !ENGINE_set_EC(e, EC_KEY_OpenSSL())
-#endif
-#ifndef OPENSSL_NO_DH
-        || !ENGINE_set_DH(e, DH_get_default_method())
-#endif
-        || !ENGINE_set_RAND(e, RAND_OpenSSL())
-#ifdef TEST_ENG_OPENSSL_RC4
-        || !ENGINE_set_ciphers(e, openssl_ciphers)
-#endif
-#ifdef TEST_ENG_OPENSSL_SHA
-        || !ENGINE_set_digests(e, openssl_digests)
-#endif
-#endif
-#ifdef TEST_ENG_OPENSSL_PKEY
-        || !ENGINE_set_load_privkey_function(e, openssl_load_privkey)
-#endif
-#ifdef TEST_ENG_OPENSSL_HMAC
-        || !ossl_register_hmac_meth()
-        || !ENGINE_set_pkey_meths(e, ossl_pkey_meths)
-#endif
-    )
-        return 0;
-    /*
-     * If we add errors to this ENGINE, ensure the error handling is setup
-     * here
-     */
-    /* openssl_load_error_strings(); */
-    return 1;
-}
-
-static ENGINE *engine_openssl(void)
-{
-    ENGINE *ret = ENGINE_new();
-    if (ret == NULL)
-        return NULL;
-    if (!bind_helper(ret)) {
-        ENGINE_free(ret);
-        return NULL;
-    }
-    return ret;
-}
-
-void engine_load_openssl_int(void)
-{
-    ENGINE *toadd = engine_openssl();
-    if (!toadd)
-        return;
-
-    ERR_set_mark();
-    ENGINE_add(toadd);
-    /*
-     * If the "add" worked, it gets a structural reference. So either way, we
-     * release our just-created reference.
-     */
-    ENGINE_free(toadd);
-    /*
-     * If the "add" didn't work, it was probably a conflict because it was
-     * already added (eg. someone calling ENGINE_load_blah then calling
-     * ENGINE_load_builtin_engines() perhaps).
-     */
-    ERR_pop_to_mark();
-}
-
-/*
- * This stuff is needed if this ENGINE is being compiled into a
- * self-contained shared-library.
- */
-#ifdef ENGINE_DYNAMIC_SUPPORT
-static int bind_fn(ENGINE *e, const char *id)
-{
-    if (id && (strcmp(id, engine_openssl_id) != 0))
-        return 0;
-    if (!bind_helper(e))
-        return 0;
-    return 1;
-}
-
-IMPLEMENT_DYNAMIC_CHECK_FN()
-IMPLEMENT_DYNAMIC_BIND_FN(bind_fn)
-#endif /* ENGINE_DYNAMIC_SUPPORT */
-#ifdef TEST_ENG_OPENSSL_RC4
-/*-
- * This section of code compiles an "alternative implementation" of two modes of
- * RC4 into this ENGINE. The result is that EVP_CIPHER operation for "rc4"
- * should under normal circumstances go via this support rather than the default
- * EVP support. There are other symbols to tweak the testing;
- *    TEST_ENC_OPENSSL_RC4_OTHERS - print a one line message to stderr each time
- *        we're asked for a cipher we don't support (should not happen).
- *    TEST_ENG_OPENSSL_RC4_P_INIT - print a one line message to stderr each time
- *        the "init_key" handler is called.
- *    TEST_ENG_OPENSSL_RC4_P_CIPHER - ditto for the "cipher" handler.
- */
-#include <openssl/rc4.h>
-#define TEST_RC4_KEY_SIZE 16
-typedef struct {
-    unsigned char key[TEST_RC4_KEY_SIZE];
-    RC4_KEY ks;
-} TEST_RC4_KEY;
-#define test(ctx) ((TEST_RC4_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))
-static int test_rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    const int n = EVP_CIPHER_CTX_get_key_length(ctx);
-
-#ifdef TEST_ENG_OPENSSL_RC4_P_INIT
-    fprintf(stderr, "(TEST_ENG_OPENSSL_RC4) test_init_key() called\n");
-#endif
-    if (n <= 0)
-        return n;
-    memcpy(&test(ctx)->key[0], key, n);
-    RC4_set_key(&test(ctx)->ks, n, test(ctx)->key);
-    return 1;
-}
-
-static int test_rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-#ifdef TEST_ENG_OPENSSL_RC4_P_CIPHER
-    fprintf(stderr, "(TEST_ENG_OPENSSL_RC4) test_cipher() called\n");
-#endif
-    RC4(&test(ctx)->ks, inl, in, out);
-    return 1;
-}
-
-static EVP_CIPHER *r4_cipher = NULL;
-static const EVP_CIPHER *test_r4_cipher(void)
-{
-    if (r4_cipher == NULL) {
-        EVP_CIPHER *cipher;
-
-        if ((cipher = EVP_CIPHER_meth_new(NID_rc4, 1, TEST_RC4_KEY_SIZE)) == NULL
-            || !EVP_CIPHER_meth_set_iv_length(cipher, 0)
-            || !EVP_CIPHER_meth_set_flags(cipher, EVP_CIPH_VARIABLE_LENGTH)
-            || !EVP_CIPHER_meth_set_init(cipher, test_rc4_init_key)
-            || !EVP_CIPHER_meth_set_do_cipher(cipher, test_rc4_cipher)
-            || !EVP_CIPHER_meth_set_impl_ctx_size(cipher, sizeof(TEST_RC4_KEY))) {
-            EVP_CIPHER_meth_free(cipher);
-            cipher = NULL;
-        }
-        r4_cipher = cipher;
-    }
-    return r4_cipher;
-}
-static void test_r4_cipher_destroy(void)
-{
-    EVP_CIPHER_meth_free(r4_cipher);
-    r4_cipher = NULL;
-}
-
-static EVP_CIPHER *r4_40_cipher = NULL;
-static const EVP_CIPHER *test_r4_40_cipher(void)
-{
-    if (r4_40_cipher == NULL) {
-        EVP_CIPHER *cipher;
-
-        if ((cipher = EVP_CIPHER_meth_new(NID_rc4, 1, 5 /* 40 bits */)) == NULL
-            || !EVP_CIPHER_meth_set_iv_length(cipher, 0)
-            || !EVP_CIPHER_meth_set_flags(cipher, EVP_CIPH_VARIABLE_LENGTH)
-            || !EVP_CIPHER_meth_set_init(cipher, test_rc4_init_key)
-            || !EVP_CIPHER_meth_set_do_cipher(cipher, test_rc4_cipher)
-            || !EVP_CIPHER_meth_set_impl_ctx_size(cipher, sizeof(TEST_RC4_KEY))) {
-            EVP_CIPHER_meth_free(cipher);
-            cipher = NULL;
-        }
-        r4_40_cipher = cipher;
-    }
-    return r4_40_cipher;
-}
-static void test_r4_40_cipher_destroy(void)
-{
-    EVP_CIPHER_meth_free(r4_40_cipher);
-    r4_40_cipher = NULL;
-}
-static int test_cipher_nids(const int **nids)
-{
-    static int cipher_nids[4] = { 0, 0, 0, 0 };
-    static int pos = 0;
-    static int init = 0;
-
-    if (!init) {
-        const EVP_CIPHER *cipher;
-        if ((cipher = test_r4_cipher()) != NULL)
-            cipher_nids[pos++] = EVP_CIPHER_get_nid(cipher);
-        if ((cipher = test_r4_40_cipher()) != NULL)
-            cipher_nids[pos++] = EVP_CIPHER_get_nid(cipher);
-        cipher_nids[pos] = 0;
-        init = 1;
-    }
-    *nids = cipher_nids;
-    return pos;
-}
-
-static int openssl_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
-    const int **nids, int nid)
-{
-    if (!cipher) {
-        /* We are returning a list of supported nids */
-        return test_cipher_nids(nids);
-    }
-    /* We are being asked for a specific cipher */
-    if (nid == NID_rc4)
-        *cipher = test_r4_cipher();
-    else if (nid == NID_rc4_40)
-        *cipher = test_r4_40_cipher();
-    else {
-#ifdef TEST_ENG_OPENSSL_RC4_OTHERS
-        fprintf(stderr, "(TEST_ENG_OPENSSL_RC4) returning NULL for "
-                        "nid %d\n",
-            nid);
-#endif
-        *cipher = NULL;
-        return 0;
-    }
-    return 1;
-}
-#endif
-
-#ifdef TEST_ENG_OPENSSL_SHA
-/* Much the same sort of comment as for TEST_ENG_OPENSSL_RC4 */
-#include <openssl/sha.h>
-
-static int test_sha1_init(EVP_MD_CTX *ctx)
-{
-#ifdef TEST_ENG_OPENSSL_SHA_P_INIT
-    fprintf(stderr, "(TEST_ENG_OPENSSL_SHA) test_sha1_init() called\n");
-#endif
-    return SHA1_Init(EVP_MD_CTX_get0_md_data(ctx));
-}
-
-static int test_sha1_update(EVP_MD_CTX *ctx, const void *data, size_t count)
-{
-#ifdef TEST_ENG_OPENSSL_SHA_P_UPDATE
-    fprintf(stderr, "(TEST_ENG_OPENSSL_SHA) test_sha1_update() called\n");
-#endif
-    return SHA1_Update(EVP_MD_CTX_get0_md_data(ctx), data, count);
-}
-
-static int test_sha1_final(EVP_MD_CTX *ctx, unsigned char *md)
-{
-#ifdef TEST_ENG_OPENSSL_SHA_P_FINAL
-    fprintf(stderr, "(TEST_ENG_OPENSSL_SHA) test_sha1_final() called\n");
-#endif
-    return SHA1_Final(md, EVP_MD_CTX_get0_md_data(ctx));
-}
-
-static EVP_MD *sha1_md = NULL;
-static const EVP_MD *test_sha_md(void)
-{
-    if (sha1_md == NULL) {
-        EVP_MD *md;
-
-        if ((md = EVP_MD_meth_new(NID_sha1, NID_sha1WithRSAEncryption)) == NULL
-            || !EVP_MD_meth_set_result_size(md, SHA_DIGEST_LENGTH)
-            || !EVP_MD_meth_set_input_blocksize(md, SHA_CBLOCK)
-            || !EVP_MD_meth_set_app_datasize(md,
-                sizeof(EVP_MD *) + sizeof(SHA_CTX))
-            || !EVP_MD_meth_set_flags(md, 0)
-            || !EVP_MD_meth_set_init(md, test_sha1_init)
-            || !EVP_MD_meth_set_update(md, test_sha1_update)
-            || !EVP_MD_meth_set_final(md, test_sha1_final)) {
-            EVP_MD_meth_free(md);
-            md = NULL;
-        }
-        sha1_md = md;
-    }
-    return sha1_md;
-}
-static void test_sha_md_destroy(void)
-{
-    EVP_MD_meth_free(sha1_md);
-    sha1_md = NULL;
-}
-static int test_digest_nids(const int **nids)
-{
-    static int digest_nids[2] = { 0, 0 };
-    static int pos = 0;
-    static int init = 0;
-
-    if (!init) {
-        const EVP_MD *md;
-        if ((md = test_sha_md()) != NULL)
-            digest_nids[pos++] = EVP_MD_get_type(md);
-        digest_nids[pos] = 0;
-        init = 1;
-    }
-    *nids = digest_nids;
-    return pos;
-}
-
-static int openssl_digests(ENGINE *e, const EVP_MD **digest,
-    const int **nids, int nid)
-{
-    if (!digest) {
-        /* We are returning a list of supported nids */
-        return test_digest_nids(nids);
-    }
-    /* We are being asked for a specific digest */
-    if (nid == NID_sha1)
-        *digest = test_sha_md();
-    else {
-#ifdef TEST_ENG_OPENSSL_SHA_OTHERS
-        fprintf(stderr, "(TEST_ENG_OPENSSL_SHA) returning NULL for "
-                        "nid %d\n",
-            nid);
-#endif
-        *digest = NULL;
-        return 0;
-    }
-    return 1;
-}
-#endif
-
-#ifdef TEST_ENG_OPENSSL_PKEY
-static EVP_PKEY *openssl_load_privkey(ENGINE *eng, const char *key_id,
-    UI_METHOD *ui_method,
-    void *callback_data)
-{
-    BIO *in;
-    EVP_PKEY *key;
-    fprintf(stderr, "(TEST_ENG_OPENSSL_PKEY)Loading Private key %s\n",
-        key_id);
-#if defined(OPENSSL_SYS_WINDOWS)
-    in = BIO_new_file(key_id, "rb");
-#else
-    in = BIO_new_file(key_id, "r");
-#endif
-    if (!in)
-        return NULL;
-    key = PEM_read_bio_PrivateKey(in, NULL, 0, NULL);
-    BIO_free(in);
-    return key;
-}
-#endif
-
-#ifdef TEST_ENG_OPENSSL_HMAC
-
-/*
- * Experimental HMAC redirection implementation: mainly copied from
- * hm_pmeth.c
- */
-
-/* HMAC pkey context structure */
-
-typedef struct {
-    const EVP_MD *md; /* MD for HMAC use */
-    ASN1_OCTET_STRING ktmp; /* Temp storage for key */
-    HMAC_CTX *ctx;
-} OSSL_HMAC_PKEY_CTX;
-
-static int ossl_hmac_init(EVP_PKEY_CTX *ctx)
-{
-    OSSL_HMAC_PKEY_CTX *hctx;
-
-    if ((hctx = OPENSSL_zalloc(sizeof(*hctx))) == NULL)
-        return 0;
-    hctx->ktmp.type = V_ASN1_OCTET_STRING;
-    hctx->ctx = HMAC_CTX_new();
-    if (hctx->ctx == NULL) {
-        OPENSSL_free(hctx);
-        return 0;
-    }
-    EVP_PKEY_CTX_set_data(ctx, hctx);
-    EVP_PKEY_CTX_set0_keygen_info(ctx, NULL, 0);
-#ifdef TEST_ENG_OPENSSL_HMAC_INIT
-    fprintf(stderr, "(TEST_ENG_OPENSSL_HMAC) ossl_hmac_init() called\n");
-#endif
-    return 1;
-}
-
-static void ossl_hmac_cleanup(EVP_PKEY_CTX *ctx);
-
-static int ossl_hmac_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)
-{
-    OSSL_HMAC_PKEY_CTX *sctx, *dctx;
-
-    /* allocate memory for dst->data and a new HMAC_CTX in dst->data->ctx */
-    if (!ossl_hmac_init(dst))
-        return 0;
-    sctx = EVP_PKEY_CTX_get_data(src);
-    dctx = EVP_PKEY_CTX_get_data(dst);
-    dctx->md = sctx->md;
-    if (!HMAC_CTX_copy(dctx->ctx, sctx->ctx))
-        goto err;
-    if (sctx->ktmp.data) {
-        if (!ASN1_OCTET_STRING_set(&dctx->ktmp,
-                sctx->ktmp.data, sctx->ktmp.length))
-            goto err;
-    }
-    return 1;
-err:
-    /* release HMAC_CTX in dst->data->ctx and memory allocated for dst->data */
-    ossl_hmac_cleanup(dst);
-    return 0;
-}
-
-static void ossl_hmac_cleanup(EVP_PKEY_CTX *ctx)
-{
-    OSSL_HMAC_PKEY_CTX *hctx = EVP_PKEY_CTX_get_data(ctx);
-
-    if (hctx) {
-        HMAC_CTX_free(hctx->ctx);
-        OPENSSL_clear_free(hctx->ktmp.data, hctx->ktmp.length);
-        OPENSSL_free(hctx);
-        EVP_PKEY_CTX_set_data(ctx, NULL);
-    }
-}
-
-static int ossl_hmac_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
-{
-    ASN1_OCTET_STRING *hkey = NULL;
-    OSSL_HMAC_PKEY_CTX *hctx = EVP_PKEY_CTX_get_data(ctx);
-    if (!hctx->ktmp.data)
-        return 0;
-    hkey = ASN1_OCTET_STRING_dup(&hctx->ktmp);
-    if (!hkey)
-        return 0;
-    EVP_PKEY_assign(pkey, EVP_PKEY_HMAC, hkey);
-
-    return 1;
-}
-
-static int ossl_int_update(EVP_MD_CTX *ctx, const void *data, size_t count)
-{
-    OSSL_HMAC_PKEY_CTX *hctx = EVP_PKEY_CTX_get_data(EVP_MD_CTX_get_pkey_ctx(ctx));
-    if (!HMAC_Update(hctx->ctx, data, count))
-        return 0;
-    return 1;
-}
-
-static int ossl_hmac_signctx_init(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx)
-{
-    EVP_MD_CTX_set_flags(mctx, EVP_MD_CTX_FLAG_NO_INIT);
-    EVP_MD_CTX_set_update_fn(mctx, ossl_int_update);
-    return 1;
-}
-
-static int ossl_hmac_signctx(EVP_PKEY_CTX *ctx, unsigned char *sig,
-    size_t *siglen, EVP_MD_CTX *mctx)
-{
-    unsigned int hlen;
-    OSSL_HMAC_PKEY_CTX *hctx = EVP_PKEY_CTX_get_data(ctx);
-    int l = EVP_MD_CTX_get_size(mctx);
-
-    if (l < 0)
-        return 0;
-    *siglen = l;
-    if (!sig)
-        return 1;
-
-    if (!HMAC_Final(hctx->ctx, sig, &hlen))
-        return 0;
-    *siglen = (size_t)hlen;
-    return 1;
-}
-
-static int ossl_hmac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
-{
-    OSSL_HMAC_PKEY_CTX *hctx = EVP_PKEY_CTX_get_data(ctx);
-    EVP_PKEY *pk;
-    ASN1_OCTET_STRING *key;
-    switch (type) {
-
-    case EVP_PKEY_CTRL_SET_MAC_KEY:
-        if ((!p2 && p1 > 0) || (p1 < -1))
-            return 0;
-        if (!ASN1_OCTET_STRING_set(&hctx->ktmp, p2, p1))
-            return 0;
-        break;
-
-    case EVP_PKEY_CTRL_MD:
-        hctx->md = p2;
-        break;
-
-    case EVP_PKEY_CTRL_DIGESTINIT:
-        pk = EVP_PKEY_CTX_get0_pkey(ctx);
-        key = EVP_PKEY_get0(pk);
-        if (!HMAC_Init_ex(hctx->ctx, key->data, key->length, hctx->md, NULL))
-            return 0;
-        break;
-
-    default:
-        return -2;
-    }
-    return 1;
-}
-
-static int ossl_hmac_ctrl_str(EVP_PKEY_CTX *ctx,
-    const char *type, const char *value)
-{
-    if (!value) {
-        return 0;
-    }
-    if (strcmp(type, "key") == 0) {
-        void *p = (void *)value;
-        return ossl_hmac_ctrl(ctx, EVP_PKEY_CTRL_SET_MAC_KEY, -1, p);
-    }
-    if (strcmp(type, "hexkey") == 0) {
-        unsigned char *key;
-        int r;
-        long keylen;
-        key = OPENSSL_hexstr2buf(value, &keylen);
-        if (!key)
-            return 0;
-        r = ossl_hmac_ctrl(ctx, EVP_PKEY_CTRL_SET_MAC_KEY, keylen, key);
-        OPENSSL_free(key);
-        return r;
-    }
-    return -2;
-}
-
-static EVP_PKEY_METHOD *ossl_hmac_meth;
-
-static int ossl_register_hmac_meth(void)
-{
-    EVP_PKEY_METHOD *meth;
-    meth = EVP_PKEY_meth_new(EVP_PKEY_HMAC, 0);
-    if (meth == NULL)
-        return 0;
-    EVP_PKEY_meth_set_init(meth, ossl_hmac_init);
-    EVP_PKEY_meth_set_copy(meth, ossl_hmac_copy);
-    EVP_PKEY_meth_set_cleanup(meth, ossl_hmac_cleanup);
-
-    EVP_PKEY_meth_set_keygen(meth, 0, ossl_hmac_keygen);
-
-    EVP_PKEY_meth_set_signctx(meth, ossl_hmac_signctx_init,
-        ossl_hmac_signctx);
-
-    EVP_PKEY_meth_set_ctrl(meth, ossl_hmac_ctrl, ossl_hmac_ctrl_str);
-    ossl_hmac_meth = meth;
-    return 1;
-}
-
-static int ossl_pkey_meths(ENGINE *e, EVP_PKEY_METHOD **pmeth,
-    const int **nids, int nid)
-{
-    static int ossl_pkey_nids[] = {
-        EVP_PKEY_HMAC,
-        0
-    };
-
-    if (pmeth == NULL) {
-        *nids = ossl_pkey_nids;
-        return 1;
-    }
-
-    if (nid == EVP_PKEY_HMAC) {
-        *pmeth = ossl_hmac_meth;
-        return 1;
-    }
-
-    *pmeth = NULL;
-    return 0;
-}
-
-#endif
-
-int openssl_destroy(ENGINE *e)
-{
-    test_sha_md_destroy();
-#ifdef TEST_ENG_OPENSSL_RC4
-    test_r4_cipher_destroy();
-    test_r4_40_cipher_destroy();
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/engine/eng_pkey.c b/deps/openssl/openssl/crypto/engine/eng_pkey.c
deleted file mode 100644
index 8ab30afc703..00000000000
--- a/deps/openssl/openssl/crypto/engine/eng_pkey.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright 2001-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "eng_local.h"
-
-/* Basic get/set stuff */
-
-int ENGINE_set_load_privkey_function(ENGINE *e,
-    ENGINE_LOAD_KEY_PTR loadpriv_f)
-{
-    e->load_privkey = loadpriv_f;
-    return 1;
-}
-
-int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f)
-{
-    e->load_pubkey = loadpub_f;
-    return 1;
-}
-
-int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
-    ENGINE_SSL_CLIENT_CERT_PTR
-        loadssl_f)
-{
-    e->load_ssl_client_cert = loadssl_f;
-    return 1;
-}
-
-ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e)
-{
-    return e->load_privkey;
-}
-
-ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e)
-{
-    return e->load_pubkey;
-}
-
-ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE
-        *e)
-{
-    return e->load_ssl_client_cert;
-}
-
-/* API functions to load public/private keys */
-
-EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
-    UI_METHOD *ui_method, void *callback_data)
-{
-    EVP_PKEY *pkey;
-
-    if (e == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return NULL;
-    }
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return NULL;
-    if (e->funct_ref == 0) {
-        CRYPTO_THREAD_unlock(global_engine_lock);
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED);
-        return NULL;
-    }
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    if (!e->load_privkey) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION);
-        return NULL;
-    }
-    pkey = e->load_privkey(e, key_id, ui_method, callback_data);
-    if (pkey == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PRIVATE_KEY);
-        return NULL;
-    }
-    return pkey;
-}
-
-EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
-    UI_METHOD *ui_method, void *callback_data)
-{
-    EVP_PKEY *pkey;
-
-    if (e == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return NULL;
-    }
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return NULL;
-    if (e->funct_ref == 0) {
-        CRYPTO_THREAD_unlock(global_engine_lock);
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED);
-        return NULL;
-    }
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    if (!e->load_pubkey) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION);
-        return NULL;
-    }
-    pkey = e->load_pubkey(e, key_id, ui_method, callback_data);
-    if (pkey == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PUBLIC_KEY);
-        return NULL;
-    }
-    return pkey;
-}
-
-int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s,
-    STACK_OF(X509_NAME) *ca_dn, X509 **pcert,
-    EVP_PKEY **ppkey, STACK_OF(X509) **pother,
-    UI_METHOD *ui_method, void *callback_data)
-{
-
-    if (e == NULL) {
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
-        return 0;
-    }
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return 0;
-    if (e->funct_ref == 0) {
-        CRYPTO_THREAD_unlock(global_engine_lock);
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED);
-        return 0;
-    }
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    if (!e->load_ssl_client_cert) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION);
-        return 0;
-    }
-    return e->load_ssl_client_cert(e, s, ca_dn, pcert, ppkey, pother,
-        ui_method, callback_data);
-}
diff --git a/deps/openssl/openssl/crypto/engine/eng_rdrand.c b/deps/openssl/openssl/crypto/engine/eng_rdrand.c
deleted file mode 100644
index 8672944ff07..00000000000
--- a/deps/openssl/openssl/crypto/engine/eng_rdrand.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright 2011-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include <openssl/opensslconf.h>
-
-#include <stdio.h>
-#include <string.h>
-#include "crypto/engine.h"
-#include "internal/cryptlib.h"
-#include <openssl/rand.h>
-#include <openssl/err.h>
-#include <openssl/crypto.h>
-
-#if defined(__has_feature)
-#if __has_feature(memory_sanitizer)
-#include <sanitizer/msan_interface.h>
-#endif
-#endif
-
-#if (defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64)) && defined(OPENSSL_CPUID_OBJ)
-
-size_t OPENSSL_ia32_rdrand_bytes(unsigned char *buf, size_t len);
-
-static int get_random_bytes(unsigned char *buf, int num)
-{
-    if (num < 0) {
-        return 0;
-    }
-
-#if defined(__has_feature)
-#if __has_feature(memory_sanitizer)
-    /*
-     * MemorySanitizer fails to understand asm and produces false positive
-     * use-of-uninitialized-value warnings.
-     */
-    __msan_unpoison(buf, num);
-#endif
-#endif
-
-    return (size_t)num == OPENSSL_ia32_rdrand_bytes(buf, (size_t)num);
-}
-
-static int random_status(void)
-{
-    return 1;
-}
-
-static RAND_METHOD rdrand_meth = {
-    NULL, /* seed */
-    get_random_bytes,
-    NULL, /* cleanup */
-    NULL, /* add */
-    get_random_bytes,
-    random_status,
-};
-
-static int rdrand_init(ENGINE *e)
-{
-    return 1;
-}
-
-static const char *engine_e_rdrand_id = "rdrand";
-static const char *engine_e_rdrand_name = "Intel RDRAND engine";
-
-static int bind_helper(ENGINE *e)
-{
-    if (!ENGINE_set_id(e, engine_e_rdrand_id) || !ENGINE_set_name(e, engine_e_rdrand_name) || !ENGINE_set_flags(e, ENGINE_FLAGS_NO_REGISTER_ALL) || !ENGINE_set_init_function(e, rdrand_init) || !ENGINE_set_RAND(e, &rdrand_meth))
-        return 0;
-
-    return 1;
-}
-
-static ENGINE *ENGINE_rdrand(void)
-{
-    ENGINE *ret = ENGINE_new();
-    if (ret == NULL)
-        return NULL;
-    if (!bind_helper(ret)) {
-        ENGINE_free(ret);
-        return NULL;
-    }
-    return ret;
-}
-
-void engine_load_rdrand_int(void)
-{
-    if (OPENSSL_ia32cap_P[1] & (1 << (62 - 32))) {
-        ENGINE *toadd = ENGINE_rdrand();
-        if (!toadd)
-            return;
-        ERR_set_mark();
-        ENGINE_add(toadd);
-        /*
-         * If the "add" worked, it gets a structural reference. So either way, we
-         * release our just-created reference.
-         */
-        ENGINE_free(toadd);
-        /*
-         * If the "add" didn't work, it was probably a conflict because it was
-         * already added (eg. someone calling ENGINE_load_blah then calling
-         * ENGINE_load_builtin_engines() perhaps).
-         */
-        ERR_pop_to_mark();
-    }
-}
-#else
-void engine_load_rdrand_int(void)
-{
-}
-#endif
diff --git a/deps/openssl/openssl/crypto/engine/eng_table.c b/deps/openssl/openssl/crypto/engine/eng_table.c
deleted file mode 100644
index 3e91743fc9e..00000000000
--- a/deps/openssl/openssl/crypto/engine/eng_table.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Copyright 2001-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include "internal/cryptlib.h"
-#include <openssl/evp.h>
-#include <openssl/lhash.h>
-#include <openssl/trace.h>
-#include "eng_local.h"
-
-/* The type of the items in the table */
-struct st_engine_pile {
-    /* The 'nid' of this algorithm/mode */
-    int nid;
-    /* ENGINEs that implement this algorithm/mode. */
-    STACK_OF(ENGINE) *sk;
-    /* The default ENGINE to perform this algorithm/mode. */
-    ENGINE *funct;
-    /*
-     * Zero if 'sk' is newer than the cached 'funct', non-zero otherwise
-     */
-    int uptodate;
-};
-
-/* The type exposed in eng_local.h */
-struct st_engine_table {
-    LHASH_OF(ENGINE_PILE) piles;
-}; /* ENGINE_TABLE */
-
-typedef struct st_engine_pile_doall {
-    engine_table_doall_cb *cb;
-    void *arg;
-} ENGINE_PILE_DOALL;
-
-/* Global flags (ENGINE_TABLE_FLAG_***). */
-static unsigned int table_flags = 0;
-
-/* API function manipulating 'table_flags' */
-unsigned int ENGINE_get_table_flags(void)
-{
-    return table_flags;
-}
-
-void ENGINE_set_table_flags(unsigned int flags)
-{
-    table_flags = flags;
-}
-
-/* Internal functions for the "piles" hash table */
-static unsigned long engine_pile_hash(const ENGINE_PILE *c)
-{
-    return c->nid;
-}
-
-static int engine_pile_cmp(const ENGINE_PILE *a, const ENGINE_PILE *b)
-{
-    return a->nid - b->nid;
-}
-
-static int int_table_check(ENGINE_TABLE **t, int create)
-{
-    LHASH_OF(ENGINE_PILE) *lh;
-
-    if (*t)
-        return 1;
-    if (!create)
-        return 0;
-    if ((lh = lh_ENGINE_PILE_new(engine_pile_hash, engine_pile_cmp)) == NULL)
-        return 0;
-    *t = (ENGINE_TABLE *)lh;
-    return 1;
-}
-
-/*
- * Privately exposed (via eng_local.h) functions for adding and/or removing
- * ENGINEs from the implementation table
- */
-int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup,
-    ENGINE *e, const int *nids, int num_nids,
-    int setdefault)
-{
-    int ret = 0, added = 0;
-    ENGINE_PILE tmplate, *fnd;
-
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return 0;
-    if (!(*table))
-        added = 1;
-    if (!int_table_check(table, 1))
-        goto end;
-    /* The cleanup callback needs to be added */
-    if (added && !engine_cleanup_add_first(cleanup)) {
-        lh_ENGINE_PILE_free(&(*table)->piles);
-        *table = NULL;
-        goto end;
-    }
-    while (num_nids--) {
-        tmplate.nid = *nids;
-        fnd = lh_ENGINE_PILE_retrieve(&(*table)->piles, &tmplate);
-        if (!fnd) {
-            fnd = OPENSSL_malloc(sizeof(*fnd));
-            if (fnd == NULL)
-                goto end;
-            fnd->uptodate = 1;
-            fnd->nid = *nids;
-            fnd->sk = sk_ENGINE_new_null();
-            if (!fnd->sk) {
-                OPENSSL_free(fnd);
-                goto end;
-            }
-            fnd->funct = NULL;
-            (void)lh_ENGINE_PILE_insert(&(*table)->piles, fnd);
-            if (lh_ENGINE_PILE_retrieve(&(*table)->piles, &tmplate) != fnd) {
-                sk_ENGINE_free(fnd->sk);
-                OPENSSL_free(fnd);
-                goto end;
-            }
-        }
-        /* A registration shouldn't add duplicate entries */
-        (void)sk_ENGINE_delete_ptr(fnd->sk, e);
-        /*
-         * if 'setdefault', this ENGINE goes to the head of the list
-         */
-        if (!sk_ENGINE_push(fnd->sk, e))
-            goto end;
-        /* "touch" this ENGINE_PILE */
-        fnd->uptodate = 0;
-        if (setdefault) {
-            if (!engine_unlocked_init(e)) {
-                ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED);
-                goto end;
-            }
-            if (fnd->funct)
-                engine_unlocked_finish(fnd->funct, 0);
-            fnd->funct = e;
-            fnd->uptodate = 1;
-        }
-        nids++;
-    }
-    ret = 1;
-end:
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    return ret;
-}
-
-static void int_unregister_cb(ENGINE_PILE *pile, ENGINE *e)
-{
-    int n;
-    /* Iterate the 'c->sk' stack removing any occurrence of 'e' */
-    while ((n = sk_ENGINE_find(pile->sk, e)) >= 0) {
-        (void)sk_ENGINE_delete(pile->sk, n);
-        pile->uptodate = 0;
-    }
-    if (pile->funct == e) {
-        engine_unlocked_finish(e, 0);
-        pile->funct = NULL;
-    }
-}
-
-IMPLEMENT_LHASH_DOALL_ARG(ENGINE_PILE, ENGINE);
-
-void engine_table_unregister(ENGINE_TABLE **table, ENGINE *e)
-{
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        /* Can't return a value. :( */
-        return;
-    if (int_table_check(table, 0))
-        lh_ENGINE_PILE_doall_ENGINE(&(*table)->piles, int_unregister_cb, e);
-    CRYPTO_THREAD_unlock(global_engine_lock);
-}
-
-static void int_cleanup_cb_doall(ENGINE_PILE *p)
-{
-    if (p == NULL)
-        return;
-    sk_ENGINE_free(p->sk);
-    if (p->funct)
-        engine_unlocked_finish(p->funct, 0);
-    OPENSSL_free(p);
-}
-
-void engine_table_cleanup(ENGINE_TABLE **table)
-{
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return;
-    if (*table) {
-        lh_ENGINE_PILE_doall(&(*table)->piles, int_cleanup_cb_doall);
-        lh_ENGINE_PILE_free(&(*table)->piles);
-        *table = NULL;
-    }
-    CRYPTO_THREAD_unlock(global_engine_lock);
-}
-
-/* return a functional reference for a given 'nid' */
-ENGINE *ossl_engine_table_select(ENGINE_TABLE **table, int nid,
-    const char *f, int l)
-{
-    ENGINE *ret = NULL;
-    ENGINE_PILE tmplate, *fnd = NULL;
-    int initres, loop = 0;
-
-#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
-    /* Load the config before trying to check if engines are available */
-    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
-#endif
-
-    if (!(*table)) {
-        OSSL_TRACE3(ENGINE_TABLE,
-            "%s:%d, nid=%d, nothing registered!\n",
-            f, l, nid);
-        return NULL;
-    }
-
-    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
-        return NULL;
-
-    ERR_set_mark();
-    /*
-     * Check again inside the lock otherwise we could race against cleanup
-     * operations. But don't worry about a debug printout
-     */
-    if (!int_table_check(table, 0))
-        goto end;
-    tmplate.nid = nid;
-    fnd = lh_ENGINE_PILE_retrieve(&(*table)->piles, &tmplate);
-    if (!fnd)
-        goto end;
-    if (fnd->funct && engine_unlocked_init(fnd->funct)) {
-        OSSL_TRACE4(ENGINE_TABLE,
-            "%s:%d, nid=%d, using ENGINE '%s' cached\n",
-            f, l, nid, fnd->funct->id);
-        ret = fnd->funct;
-        goto end;
-    }
-    if (fnd->uptodate) {
-        ret = fnd->funct;
-        goto end;
-    }
-trynext:
-    ret = sk_ENGINE_value(fnd->sk, loop++);
-    if (!ret) {
-        OSSL_TRACE3(ENGINE_TABLE,
-            "%s:%d, nid=%d, "
-            "no registered implementations would initialise\n",
-            f, l, nid);
-        goto end;
-    }
-    /* Try to initialise the ENGINE? */
-    if ((ret->funct_ref > 0) || !(table_flags & ENGINE_TABLE_FLAG_NOINIT))
-        initres = engine_unlocked_init(ret);
-    else
-        initres = 0;
-    if (initres) {
-        /* Update 'funct' */
-        if ((fnd->funct != ret) && engine_unlocked_init(ret)) {
-            /* If there was a previous default we release it. */
-            if (fnd->funct)
-                engine_unlocked_finish(fnd->funct, 0);
-            fnd->funct = ret;
-            OSSL_TRACE4(ENGINE_TABLE,
-                "%s:%d, nid=%d, setting default to '%s'\n",
-                f, l, nid, ret->id);
-        }
-        OSSL_TRACE4(ENGINE_TABLE,
-            "%s:%d, nid=%d, using newly initialised '%s'\n",
-            f, l, nid, ret->id);
-        goto end;
-    }
-    goto trynext;
-end:
-    /*
-     * If it failed, it is unlikely to succeed again until some future
-     * registrations have taken place. In all cases, we cache.
-     */
-    if (fnd)
-        fnd->uptodate = 1;
-    if (ret)
-        OSSL_TRACE4(ENGINE_TABLE,
-            "%s:%d, nid=%d, caching ENGINE '%s'\n",
-            f, l, nid, ret->id);
-    else
-        OSSL_TRACE3(ENGINE_TABLE,
-            "%s:%d, nid=%d, caching 'no matching ENGINE'\n",
-            f, l, nid);
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    /*
-     * Whatever happened, any failed init()s are not failures in this
-     * context, so clear our error state.
-     */
-    ERR_pop_to_mark();
-    return ret;
-}
-
-/* Table enumeration */
-
-static void int_dall(const ENGINE_PILE *pile, ENGINE_PILE_DOALL *dall)
-{
-    dall->cb(pile->nid, pile->sk, pile->funct, dall->arg);
-}
-
-IMPLEMENT_LHASH_DOALL_ARG_CONST(ENGINE_PILE, ENGINE_PILE_DOALL);
-
-void engine_table_doall(ENGINE_TABLE *table, engine_table_doall_cb *cb,
-    void *arg)
-{
-    ENGINE_PILE_DOALL dall;
-    dall.cb = cb;
-    dall.arg = arg;
-    if (table)
-        lh_ENGINE_PILE_doall_ENGINE_PILE_DOALL(&table->piles, int_dall, &dall);
-}
diff --git a/deps/openssl/openssl/crypto/engine/tb_asnmth.c b/deps/openssl/openssl/crypto/engine/tb_asnmth.c
deleted file mode 100644
index 1929de86aaf..00000000000
--- a/deps/openssl/openssl/crypto/engine/tb_asnmth.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright 2006-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "internal/e_os.h"
-#include "eng_local.h"
-#include <openssl/evp.h>
-#include "crypto/asn1.h"
-
-/*
- * If this symbol is defined then ENGINE_get_pkey_asn1_meth_engine(), the
- * function that is used by EVP to hook in pkey_asn1_meth code and cache
- * defaults (etc), will display brief debugging summaries to stderr with the
- * 'nid'.
- */
-/* #define ENGINE_PKEY_ASN1_METH_DEBUG */
-
-static ENGINE_TABLE *pkey_asn1_meth_table = NULL;
-
-void ENGINE_unregister_pkey_asn1_meths(ENGINE *e)
-{
-    engine_table_unregister(&pkey_asn1_meth_table, e);
-}
-
-static void engine_unregister_all_pkey_asn1_meths(void)
-{
-    engine_table_cleanup(&pkey_asn1_meth_table);
-}
-
-int ENGINE_register_pkey_asn1_meths(ENGINE *e)
-{
-    if (e->pkey_asn1_meths) {
-        const int *nids;
-        int num_nids = e->pkey_asn1_meths(e, NULL, &nids, 0);
-        if (num_nids > 0)
-            return engine_table_register(&pkey_asn1_meth_table,
-                engine_unregister_all_pkey_asn1_meths,
-                e, nids, num_nids, 0);
-    }
-    return 1;
-}
-
-void ENGINE_register_all_pkey_asn1_meths(void)
-{
-    ENGINE *e;
-
-    for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
-        ENGINE_register_pkey_asn1_meths(e);
-}
-
-int ENGINE_set_default_pkey_asn1_meths(ENGINE *e)
-{
-    if (e->pkey_asn1_meths) {
-        const int *nids;
-        int num_nids = e->pkey_asn1_meths(e, NULL, &nids, 0);
-        if (num_nids > 0)
-            return engine_table_register(&pkey_asn1_meth_table,
-                engine_unregister_all_pkey_asn1_meths,
-                e, nids, num_nids, 1);
-    }
-    return 1;
-}
-
-/*
- * Exposed API function to get a functional reference from the implementation
- * table (ie. try to get a functional reference from the tabled structural
- * references) for a given pkey_asn1_meth 'nid'
- */
-ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid)
-{
-    return ossl_engine_table_select(&pkey_asn1_meth_table, nid,
-        OPENSSL_FILE, OPENSSL_LINE);
-}
-
-/*
- * Obtains a pkey_asn1_meth implementation from an ENGINE functional
- * reference
- */
-const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid)
-{
-    EVP_PKEY_ASN1_METHOD *ret;
-    ENGINE_PKEY_ASN1_METHS_PTR fn = ENGINE_get_pkey_asn1_meths(e);
-    if (!fn || !fn(e, &ret, NULL, nid)) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD);
-        return NULL;
-    }
-    return ret;
-}
-
-/* Gets the pkey_asn1_meth callback from an ENGINE structure */
-ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e)
-{
-    return e->pkey_asn1_meths;
-}
-
-/* Sets the pkey_asn1_meth callback in an ENGINE structure */
-int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f)
-{
-    e->pkey_asn1_meths = f;
-    return 1;
-}
-
-/*
- * Internal function to free up EVP_PKEY_ASN1_METHOD structures before an
- * ENGINE is destroyed
- */
-
-void engine_pkey_asn1_meths_free(ENGINE *e)
-{
-    int i;
-    EVP_PKEY_ASN1_METHOD *pkm;
-    if (e->pkey_asn1_meths) {
-        const int *pknids;
-        int npknids;
-        npknids = e->pkey_asn1_meths(e, NULL, &pknids, 0);
-        for (i = 0; i < npknids; i++) {
-            if (e->pkey_asn1_meths(e, &pkm, NULL, pknids[i])) {
-                EVP_PKEY_asn1_free(pkm);
-            }
-        }
-    }
-}
-
-/*
- * Find a method based on a string. This does a linear search through all
- * implemented algorithms. This is OK in practice because only a small number
- * of algorithms are likely to be implemented in an engine and it is not used
- * for speed critical operations.
- */
-
-const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
-    const char *str,
-    int len)
-{
-    int i, nidcount;
-    const int *nids;
-    EVP_PKEY_ASN1_METHOD *ameth;
-    if (!e->pkey_asn1_meths)
-        return NULL;
-    if (len == -1)
-        len = strlen(str);
-    nidcount = e->pkey_asn1_meths(e, NULL, &nids, 0);
-    for (i = 0; i < nidcount; i++) {
-        e->pkey_asn1_meths(e, &ameth, NULL, nids[i]);
-        if (ameth != NULL
-            && ((int)strlen(ameth->pem_str) == len)
-            && OPENSSL_strncasecmp(ameth->pem_str, str, len) == 0)
-            return ameth;
-    }
-    return NULL;
-}
-
-typedef struct {
-    ENGINE *e;
-    const EVP_PKEY_ASN1_METHOD *ameth;
-    const char *str;
-    int len;
-} ENGINE_FIND_STR;
-
-static void look_str_cb(int nid, STACK_OF(ENGINE) *sk, ENGINE *def, void *arg)
-{
-    ENGINE_FIND_STR *lk = arg;
-    int i;
-    if (lk->ameth)
-        return;
-    for (i = 0; i < sk_ENGINE_num(sk); i++) {
-        ENGINE *e = sk_ENGINE_value(sk, i);
-        EVP_PKEY_ASN1_METHOD *ameth;
-        e->pkey_asn1_meths(e, &ameth, NULL, nid);
-        if (ameth != NULL
-            && ((int)strlen(ameth->pem_str) == lk->len)
-            && OPENSSL_strncasecmp(ameth->pem_str, lk->str, lk->len) == 0) {
-            lk->e = e;
-            lk->ameth = ameth;
-            return;
-        }
-    }
-}
-
-const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
-    const char *str,
-    int len)
-{
-    ENGINE_FIND_STR fstr;
-    fstr.e = NULL;
-    fstr.ameth = NULL;
-    fstr.str = str;
-    fstr.len = len;
-
-    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
-        /* Maybe this should be raised in do_engine_lock_init() */
-        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
-        return NULL;
-    }
-
-    if (!CRYPTO_THREAD_read_lock(global_engine_lock))
-        return NULL;
-    engine_table_doall(pkey_asn1_meth_table, look_str_cb, &fstr);
-    /* If found obtain a structural reference to engine */
-    if (fstr.e != NULL) {
-        int ref;
-
-        if (!CRYPTO_UP_REF(&fstr.e->struct_ref, &ref)) {
-            CRYPTO_THREAD_unlock(global_engine_lock);
-            ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
-            return NULL;
-        }
-        ENGINE_REF_PRINT(fstr.e, 0, 1);
-    }
-    *pe = fstr.e;
-    CRYPTO_THREAD_unlock(global_engine_lock);
-    return fstr.ameth;
-}
diff --git a/deps/openssl/openssl/crypto/engine/tb_cipher.c b/deps/openssl/openssl/crypto/engine/tb_cipher.c
deleted file mode 100644
index c0aacb06df0..00000000000
--- a/deps/openssl/openssl/crypto/engine/tb_cipher.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "eng_local.h"
-
-static ENGINE_TABLE *cipher_table = NULL;
-
-void ENGINE_unregister_ciphers(ENGINE *e)
-{
-    engine_table_unregister(&cipher_table, e);
-}
-
-static void engine_unregister_all_ciphers(void)
-{
-    engine_table_cleanup(&cipher_table);
-}
-
-int ENGINE_register_ciphers(ENGINE *e)
-{
-    if (e->ciphers) {
-        const int *nids;
-        int num_nids = e->ciphers(e, NULL, &nids, 0);
-        if (num_nids > 0)
-            return engine_table_register(&cipher_table,
-                engine_unregister_all_ciphers, e,
-                nids, num_nids, 0);
-    }
-    return 1;
-}
-
-void ENGINE_register_all_ciphers(void)
-{
-    ENGINE *e;
-
-    for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
-        ENGINE_register_ciphers(e);
-}
-
-int ENGINE_set_default_ciphers(ENGINE *e)
-{
-    if (e->ciphers) {
-        const int *nids;
-        int num_nids = e->ciphers(e, NULL, &nids, 0);
-        if (num_nids > 0)
-            return engine_table_register(&cipher_table,
-                engine_unregister_all_ciphers, e,
-                nids, num_nids, 1);
-    }
-    return 1;
-}
-
-/*
- * Exposed API function to get a functional reference from the implementation
- * table (ie. try to get a functional reference from the tabled structural
- * references) for a given cipher 'nid'
- */
-ENGINE *ENGINE_get_cipher_engine(int nid)
-{
-    return ossl_engine_table_select(&cipher_table, nid,
-        OPENSSL_FILE, OPENSSL_LINE);
-}
-
-/* Obtains a cipher implementation from an ENGINE functional reference */
-const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid)
-{
-    const EVP_CIPHER *ret;
-    ENGINE_CIPHERS_PTR fn = ENGINE_get_ciphers(e);
-    if (!fn || !fn(e, &ret, NULL, nid)) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_CIPHER);
-        return NULL;
-    }
-    return ret;
-}
-
-/* Gets the cipher callback from an ENGINE structure */
-ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e)
-{
-    return e->ciphers;
-}
-
-/* Sets the cipher callback in an ENGINE structure */
-int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f)
-{
-    e->ciphers = f;
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/engine/tb_dh.c b/deps/openssl/openssl/crypto/engine/tb_dh.c
deleted file mode 100644
index 8f7ee1266f5..00000000000
--- a/deps/openssl/openssl/crypto/engine/tb_dh.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "eng_local.h"
-
-static ENGINE_TABLE *dh_table = NULL;
-static const int dummy_nid = 1;
-
-void ENGINE_unregister_DH(ENGINE *e)
-{
-    engine_table_unregister(&dh_table, e);
-}
-
-static void engine_unregister_all_DH(void)
-{
-    engine_table_cleanup(&dh_table);
-}
-
-int ENGINE_register_DH(ENGINE *e)
-{
-    if (e->dh_meth)
-        return engine_table_register(&dh_table,
-            engine_unregister_all_DH, e, &dummy_nid,
-            1, 0);
-    return 1;
-}
-
-void ENGINE_register_all_DH(void)
-{
-    ENGINE *e;
-
-    for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
-        ENGINE_register_DH(e);
-}
-
-int ENGINE_set_default_DH(ENGINE *e)
-{
-    if (e->dh_meth)
-        return engine_table_register(&dh_table,
-            engine_unregister_all_DH, e, &dummy_nid,
-            1, 1);
-    return 1;
-}
-
-/*
- * Exposed API function to get a functional reference from the implementation
- * table (ie. try to get a functional reference from the tabled structural
- * references).
- */
-ENGINE *ENGINE_get_default_DH(void)
-{
-    return ossl_engine_table_select(&dh_table, dummy_nid,
-        OPENSSL_FILE, OPENSSL_LINE);
-}
-
-/* Obtains an DH implementation from an ENGINE functional reference */
-const DH_METHOD *ENGINE_get_DH(const ENGINE *e)
-{
-    return e->dh_meth;
-}
-
-/* Sets an DH implementation in an ENGINE structure */
-int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth)
-{
-    e->dh_meth = dh_meth;
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/engine/tb_digest.c b/deps/openssl/openssl/crypto/engine/tb_digest.c
deleted file mode 100644
index 60c44cfb017..00000000000
--- a/deps/openssl/openssl/crypto/engine/tb_digest.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "eng_local.h"
-
-static ENGINE_TABLE *digest_table = NULL;
-
-void ENGINE_unregister_digests(ENGINE *e)
-{
-    engine_table_unregister(&digest_table, e);
-}
-
-static void engine_unregister_all_digests(void)
-{
-    engine_table_cleanup(&digest_table);
-}
-
-int ENGINE_register_digests(ENGINE *e)
-{
-    if (e->digests) {
-        const int *nids;
-        int num_nids = e->digests(e, NULL, &nids, 0);
-        if (num_nids > 0)
-            return engine_table_register(&digest_table,
-                engine_unregister_all_digests, e,
-                nids, num_nids, 0);
-    }
-    return 1;
-}
-
-void ENGINE_register_all_digests(void)
-{
-    ENGINE *e;
-
-    for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
-        ENGINE_register_digests(e);
-}
-
-int ENGINE_set_default_digests(ENGINE *e)
-{
-    if (e->digests) {
-        const int *nids;
-        int num_nids = e->digests(e, NULL, &nids, 0);
-        if (num_nids > 0)
-            return engine_table_register(&digest_table,
-                engine_unregister_all_digests, e,
-                nids, num_nids, 1);
-    }
-    return 1;
-}
-
-/*
- * Exposed API function to get a functional reference from the implementation
- * table (ie. try to get a functional reference from the tabled structural
- * references) for a given digest 'nid'
- */
-ENGINE *ENGINE_get_digest_engine(int nid)
-{
-    return ossl_engine_table_select(&digest_table, nid,
-        OPENSSL_FILE, OPENSSL_LINE);
-}
-
-/* Obtains a digest implementation from an ENGINE functional reference */
-const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid)
-{
-    const EVP_MD *ret;
-    ENGINE_DIGESTS_PTR fn = ENGINE_get_digests(e);
-    if (!fn || !fn(e, &ret, NULL, nid)) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_DIGEST);
-        return NULL;
-    }
-    return ret;
-}
-
-/* Gets the digest callback from an ENGINE structure */
-ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e)
-{
-    return e->digests;
-}
-
-/* Sets the digest callback in an ENGINE structure */
-int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f)
-{
-    e->digests = f;
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/engine/tb_dsa.c b/deps/openssl/openssl/crypto/engine/tb_dsa.c
deleted file mode 100644
index f7175d03f42..00000000000
--- a/deps/openssl/openssl/crypto/engine/tb_dsa.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "eng_local.h"
-
-static ENGINE_TABLE *dsa_table = NULL;
-static const int dummy_nid = 1;
-
-void ENGINE_unregister_DSA(ENGINE *e)
-{
-    engine_table_unregister(&dsa_table, e);
-}
-
-static void engine_unregister_all_DSA(void)
-{
-    engine_table_cleanup(&dsa_table);
-}
-
-int ENGINE_register_DSA(ENGINE *e)
-{
-    if (e->dsa_meth)
-        return engine_table_register(&dsa_table,
-            engine_unregister_all_DSA, e, &dummy_nid,
-            1, 0);
-    return 1;
-}
-
-void ENGINE_register_all_DSA(void)
-{
-    ENGINE *e;
-
-    for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
-        ENGINE_register_DSA(e);
-}
-
-int ENGINE_set_default_DSA(ENGINE *e)
-{
-    if (e->dsa_meth)
-        return engine_table_register(&dsa_table,
-            engine_unregister_all_DSA, e, &dummy_nid,
-            1, 1);
-    return 1;
-}
-
-/*
- * Exposed API function to get a functional reference from the implementation
- * table (ie. try to get a functional reference from the tabled structural
- * references).
- */
-ENGINE *ENGINE_get_default_DSA(void)
-{
-    return ossl_engine_table_select(&dsa_table, dummy_nid,
-        OPENSSL_FILE, OPENSSL_LINE);
-}
-
-/* Obtains an DSA implementation from an ENGINE functional reference */
-const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e)
-{
-    return e->dsa_meth;
-}
-
-/* Sets an DSA implementation in an ENGINE structure */
-int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth)
-{
-    e->dsa_meth = dsa_meth;
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/engine/tb_eckey.c b/deps/openssl/openssl/crypto/engine/tb_eckey.c
deleted file mode 100644
index 66e3c088298..00000000000
--- a/deps/openssl/openssl/crypto/engine/tb_eckey.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "eng_local.h"
-
-static ENGINE_TABLE *dh_table = NULL;
-static const int dummy_nid = 1;
-
-void ENGINE_unregister_EC(ENGINE *e)
-{
-    engine_table_unregister(&dh_table, e);
-}
-
-static void engine_unregister_all_EC(void)
-{
-    engine_table_cleanup(&dh_table);
-}
-
-int ENGINE_register_EC(ENGINE *e)
-{
-    if (e->ec_meth != NULL)
-        return engine_table_register(&dh_table,
-            engine_unregister_all_EC, e, &dummy_nid,
-            1, 0);
-    return 1;
-}
-
-void ENGINE_register_all_EC(void)
-{
-    ENGINE *e;
-
-    for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
-        ENGINE_register_EC(e);
-}
-
-int ENGINE_set_default_EC(ENGINE *e)
-{
-    if (e->ec_meth != NULL)
-        return engine_table_register(&dh_table,
-            engine_unregister_all_EC, e, &dummy_nid,
-            1, 1);
-    return 1;
-}
-
-/*
- * Exposed API function to get a functional reference from the implementation
- * table (ie. try to get a functional reference from the tabled structural
- * references).
- */
-ENGINE *ENGINE_get_default_EC(void)
-{
-    return ossl_engine_table_select(&dh_table, dummy_nid,
-        OPENSSL_FILE, OPENSSL_LINE);
-}
-
-/* Obtains an EC_KEY implementation from an ENGINE functional reference */
-const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e)
-{
-    return e->ec_meth;
-}
-
-/* Sets an EC_KEY implementation in an ENGINE structure */
-int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ec_meth)
-{
-    e->ec_meth = ec_meth;
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/engine/tb_pkmeth.c b/deps/openssl/openssl/crypto/engine/tb_pkmeth.c
deleted file mode 100644
index 2f384a2fe32..00000000000
--- a/deps/openssl/openssl/crypto/engine/tb_pkmeth.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some  deprecated APIs */
-#include "internal/deprecated.h"
-
-#include "eng_local.h"
-#include <openssl/evp.h>
-
-static ENGINE_TABLE *pkey_meth_table = NULL;
-
-void ENGINE_unregister_pkey_meths(ENGINE *e)
-{
-    engine_table_unregister(&pkey_meth_table, e);
-}
-
-static void engine_unregister_all_pkey_meths(void)
-{
-    engine_table_cleanup(&pkey_meth_table);
-}
-
-int ENGINE_register_pkey_meths(ENGINE *e)
-{
-    if (e->pkey_meths) {
-        const int *nids;
-        int num_nids = e->pkey_meths(e, NULL, &nids, 0);
-        if (num_nids > 0)
-            return engine_table_register(&pkey_meth_table,
-                engine_unregister_all_pkey_meths, e,
-                nids, num_nids, 0);
-    }
-    return 1;
-}
-
-void ENGINE_register_all_pkey_meths(void)
-{
-    ENGINE *e;
-
-    for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
-        ENGINE_register_pkey_meths(e);
-}
-
-int ENGINE_set_default_pkey_meths(ENGINE *e)
-{
-    if (e->pkey_meths) {
-        const int *nids;
-        int num_nids = e->pkey_meths(e, NULL, &nids, 0);
-        if (num_nids > 0)
-            return engine_table_register(&pkey_meth_table,
-                engine_unregister_all_pkey_meths, e,
-                nids, num_nids, 1);
-    }
-    return 1;
-}
-
-/*
- * Exposed API function to get a functional reference from the implementation
- * table (ie. try to get a functional reference from the tabled structural
- * references) for a given pkey_meth 'nid'
- */
-ENGINE *ENGINE_get_pkey_meth_engine(int nid)
-{
-    return ossl_engine_table_select(&pkey_meth_table, nid,
-        OPENSSL_FILE, OPENSSL_LINE);
-}
-
-/* Obtains a pkey_meth implementation from an ENGINE functional reference */
-const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid)
-{
-    EVP_PKEY_METHOD *ret;
-    ENGINE_PKEY_METHS_PTR fn = ENGINE_get_pkey_meths(e);
-    if (!fn || !fn(e, &ret, NULL, nid)) {
-        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD);
-        return NULL;
-    }
-    return ret;
-}
-
-/* Gets the pkey_meth callback from an ENGINE structure */
-ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e)
-{
-    return e->pkey_meths;
-}
-
-/* Sets the pkey_meth callback in an ENGINE structure */
-int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f)
-{
-    e->pkey_meths = f;
-    return 1;
-}
-
-/*
- * Internal function to free up EVP_PKEY_METHOD structures before an ENGINE
- * is destroyed
- */
-
-void engine_pkey_meths_free(ENGINE *e)
-{
-    int i;
-    EVP_PKEY_METHOD *pkm;
-    if (e->pkey_meths) {
-        const int *pknids;
-        int npknids;
-        npknids = e->pkey_meths(e, NULL, &pknids, 0);
-        for (i = 0; i < npknids; i++) {
-            if (e->pkey_meths(e, &pkm, NULL, pknids[i])) {
-                EVP_PKEY_meth_free(pkm);
-            }
-        }
-    }
-}
diff --git a/deps/openssl/openssl/crypto/engine/tb_rand.c b/deps/openssl/openssl/crypto/engine/tb_rand.c
deleted file mode 100644
index 3e2edc4d9f0..00000000000
--- a/deps/openssl/openssl/crypto/engine/tb_rand.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "eng_local.h"
-
-static ENGINE_TABLE *rand_table = NULL;
-static const int dummy_nid = 1;
-
-void ENGINE_unregister_RAND(ENGINE *e)
-{
-    engine_table_unregister(&rand_table, e);
-}
-
-static void engine_unregister_all_RAND(void)
-{
-    engine_table_cleanup(&rand_table);
-}
-
-int ENGINE_register_RAND(ENGINE *e)
-{
-    if (e->rand_meth)
-        return engine_table_register(&rand_table,
-            engine_unregister_all_RAND, e,
-            &dummy_nid, 1, 0);
-    return 1;
-}
-
-void ENGINE_register_all_RAND(void)
-{
-    ENGINE *e;
-
-    for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
-        ENGINE_register_RAND(e);
-}
-
-int ENGINE_set_default_RAND(ENGINE *e)
-{
-    if (e->rand_meth)
-        return engine_table_register(&rand_table,
-            engine_unregister_all_RAND, e,
-            &dummy_nid, 1, 1);
-    return 1;
-}
-
-/*
- * Exposed API function to get a functional reference from the implementation
- * table (ie. try to get a functional reference from the tabled structural
- * references).
- */
-ENGINE *ENGINE_get_default_RAND(void)
-{
-    return ossl_engine_table_select(&rand_table, dummy_nid,
-        OPENSSL_FILE, OPENSSL_LINE);
-}
-
-/* Obtains an RAND implementation from an ENGINE functional reference */
-const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e)
-{
-    return e->rand_meth;
-}
-
-/* Sets an RAND implementation in an ENGINE structure */
-int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth)
-{
-    e->rand_meth = rand_meth;
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/engine/tb_rsa.c b/deps/openssl/openssl/crypto/engine/tb_rsa.c
deleted file mode 100644
index 9fe0476ca4e..00000000000
--- a/deps/openssl/openssl/crypto/engine/tb_rsa.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "eng_local.h"
-
-static ENGINE_TABLE *rsa_table = NULL;
-static const int dummy_nid = 1;
-
-void ENGINE_unregister_RSA(ENGINE *e)
-{
-    engine_table_unregister(&rsa_table, e);
-}
-
-static void engine_unregister_all_RSA(void)
-{
-    engine_table_cleanup(&rsa_table);
-}
-
-int ENGINE_register_RSA(ENGINE *e)
-{
-    if (e->rsa_meth)
-        return engine_table_register(&rsa_table,
-            engine_unregister_all_RSA, e, &dummy_nid,
-            1, 0);
-    return 1;
-}
-
-void ENGINE_register_all_RSA(void)
-{
-    ENGINE *e;
-
-    for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
-        ENGINE_register_RSA(e);
-}
-
-int ENGINE_set_default_RSA(ENGINE *e)
-{
-    if (e->rsa_meth)
-        return engine_table_register(&rsa_table,
-            engine_unregister_all_RSA, e, &dummy_nid,
-            1, 1);
-    return 1;
-}
-
-/*
- * Exposed API function to get a functional reference from the implementation
- * table (ie. try to get a functional reference from the tabled structural
- * references).
- */
-ENGINE *ENGINE_get_default_RSA(void)
-{
-    return ossl_engine_table_select(&rsa_table, dummy_nid,
-        OPENSSL_FILE, OPENSSL_LINE);
-}
-
-/* Obtains an RSA implementation from an ENGINE functional reference */
-const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e)
-{
-    return e->rsa_meth;
-}
-
-/* Sets an RSA implementation in an ENGINE structure */
-int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth)
-{
-    e->rsa_meth = rsa_meth;
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/err/README.md b/deps/openssl/openssl/crypto/err/README.md
index 477dffa2ad3..2f48714f3b6 100644
--- a/deps/openssl/openssl/crypto/err/README.md
+++ b/deps/openssl/openssl/crypto/err/README.md
@@ -1,55 +1,49 @@
 Adding new libraries
 ====================

-When adding a new sub-library to OpenSSL, assign it a library number
-`ERR_LIB_XXX`, define a macro `XXXerr()` (both in `err.h`), add its
-name to `ERR_str_libraries[]` (in `crypto/err/err.c`), and add
-`ERR_load_XXX_strings()` to the `ERR_load_crypto_strings()` function
-(in `crypto/err/err_all.c`). Finally, add an entry:
+When adding a new sub-library to OpenSSL:

-    L      XXX     xxx.h   xxx_err.c
+- assign it a library number `ERR_LIB_XXX` in `include/openssl/err.h`;
+- add its name to `ERR_str_libraries[]` in `crypto/err/err.c`;
+- add a call to `ossl_err_load_XXX_strings()` in
+  `ossl_err_load_crypto_strings()` in `crypto/err/err_all.c`.  That
+  function is defined in the generated source named below;
+- add an entry to `crypto/err/openssl.ec`:

-to `crypto/err/openssl.ec`, and add `xxx_err.c` to the `Makefile`.
-Running make errors will then generate a file `xxx_err.c`, and
-add all error codes used in the library to `xxx.h`.
+      L      XXX     include/openssl/xxxerr.h    crypto/xxx/xxx_err.c

-Additionally the library include file must have a certain form.
-Typically it will initially look like this:
+  The fields after the library name are the public header, the source
+  file, and an optional private header.  `NONE` stands for a file that
+  is not wanted.  The public header must be under `include/openssl/`,
+  and a private header may only be given for an internal library;

-    #ifndef HEADER_XXX_H
-    #define HEADER_XXX_H
+- add the files named on that entry to the block of generated error
+  files in `.gitignore`.

-    #ifdef __cplusplus
-    extern "C" {
-    #endif
+Those files are produced during the build from `crypto/err/openssl.ec`
+and `crypto/err/openssl.txt`, and are not in git.  They are left
+read-only: an edit to one is lost the next time it is generated.

-    /* Include files */
-
-    #include <openssl/bio.h>
-    #include <openssl/x509.h>
+Adding new error codes
+======================

-    /* Macros, structures and function prototypes */
+Raise an error with `ERR_raise()`, using a reason name of the form
+`XXX_R_...`:

+    ERR_raise(ERR_LIB_XXX, XXX_R_SOMETHING_FAILED);

-    /* BEGIN ERROR CODES */
+The reason does not have to be declared first.  Running

-The `BEGIN ERROR CODES` sequence is used by the error code
-generation script as the point to place new error codes, any text
-after this point will be overwritten when make errors is run.
-The closing `#endif` etc will be automatically added by the script.
+    make update

-The generated C error code file `xxx_err.c` will load the header
-files `stdio.h`, `openssl/err.h` and `openssl/xxx.h` so the
-header file must load any additional header files containing any
-definitions it uses.
+scans the sources, assigns a number to each reason that does not have
+one, and records it in `crypto/err/openssl.txt`:

-Adding new error codes
-======================
+    XXX_R_SOMETHING_FAILED:100:something failed

-Instead of manually adding error codes into `crypto/err/openssl.txt`,
-it is recommended to leverage `make update` for error code generation.
-The target will process relevant sources and generate error codes for
-any *used* error codes.
+Numbers already recorded there are kept, so they remain stable for
+applications that have compiled against them.

-If an error code is added manually into `crypto/err/openssl.txt`,
-subsequent `make update` has no effect.
+The third field is the string returned by `ERR_reason_error_string()`.
+It is derived from the reason name, with underscores replaced by
+spaces; edit `crypto/err/openssl.txt` if it should read differently.
diff --git a/deps/openssl/openssl/crypto/err/err.c b/deps/openssl/openssl/crypto/err/err.c
index 94c542cd3f5..2923f0b13fd 100644
--- a/deps/openssl/openssl/crypto/err/err.c
+++ b/deps/openssl/openssl/crypto/err/err.c
@@ -7,8 +7,6 @@
  * https://www.openssl.org/source/license.html
  */

-#define OSSL_FORCE_ERR_STATE
-
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
@@ -21,20 +19,18 @@
 #include <openssl/bio.h>
 #include <openssl/opensslconf.h>
 #include "internal/thread_once.h"
+#include "internal/threads_common.h"
 #include "crypto/ctype.h"
 #include "internal/constant_time.h"
 #include "internal/e_os.h"
 #include "err_local.h"

-/* Forward declaration in case it's not published because of configuration */
-ERR_STATE *ERR_get_state(void);
-
 #ifndef OPENSSL_NO_ERR
 static int err_load_strings(const ERR_STRING_DATA *str);
 #endif

 #ifndef OPENSSL_NO_ERR
-static ERR_STRING_DATA ERR_str_libraries[] = {
+static const ERR_STRING_DATA ERR_str_libraries[] = {
     { ERR_PACK(ERR_LIB_NONE, 0, 0), "unknown library" },
     { ERR_PACK(ERR_LIB_SYS, 0, 0), "system library" },
     { ERR_PACK(ERR_LIB_BN, 0, 0), "bignum routines" },
@@ -85,7 +81,7 @@ static ERR_STRING_DATA ERR_str_libraries[] = {
  * Should make sure that all ERR_R_ reasons defined in include/openssl/err.h.in
  * are listed.  For maintainability, please keep all reasons in the same order.
  */
-static ERR_STRING_DATA ERR_str_reasons[] = {
+static const ERR_STRING_DATA ERR_str_reasons[] = {
     { ERR_R_SYS_LIB, "system lib" },
     { ERR_R_BN_LIB, "BN lib" },
     { ERR_R_RSA_LIB, "RSA lib" },
@@ -138,10 +134,6 @@ static ERR_STRING_DATA ERR_str_reasons[] = {
 };
 #endif

-static CRYPTO_ONCE err_init = CRYPTO_ONCE_STATIC_INIT;
-static int set_err_thread_local;
-static CRYPTO_THREAD_LOCAL err_thread_local;
-
 static CRYPTO_ONCE err_string_init = CRYPTO_ONCE_STATIC_INIT;
 static CRYPTO_RWLOCK *err_string_lock = NULL;

@@ -233,8 +225,6 @@ DEFINE_RUN_ONCE_STATIC(do_err_strings_init)

 void err_cleanup(void)
 {
-    if (set_err_thread_local != 0)
-        CRYPTO_THREAD_cleanup_local(&err_thread_local);
     CRYPTO_THREAD_lock_free(err_string_lock);
     err_string_lock = NULL;
 #ifndef OPENSSL_NO_ERR
@@ -342,7 +332,7 @@ void ERR_clear_error(void)
     int i;
     ERR_STATE *es;

-    es = ossl_err_get_state_int();
+    es = ossl_err_get_state_int(0);
     if (es == NULL)
         return;

@@ -456,7 +446,7 @@ static unsigned long get_error_values(ERR_GET_ACTION g,
     ERR_STATE *es;
     unsigned long ret;

-    es = ossl_err_get_state_int();
+    es = ossl_err_get_state_int(1);
     if (es == NULL)
         return 0;

@@ -530,6 +520,7 @@ void ossl_err_string_int(unsigned long e, const char *func,
     char lsbuf[64], rsbuf[256];
     const char *ls, *rs = NULL;
     unsigned long l, r;
+    int n;

     if (len == 0)
         return;
@@ -537,7 +528,7 @@ void ossl_err_string_int(unsigned long e, const char *func,
     l = ERR_GET_LIB(e);
     ls = ERR_lib_error_string(e);
     if (ls == NULL) {
-        BIO_snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
+        snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
         ls = lsbuf;
     }

@@ -557,16 +548,15 @@ void ossl_err_string_int(unsigned long e, const char *func,
     }
 #endif
     if (rs == NULL) {
-        BIO_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)",
+        snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)",
             r & ~(ERR_RFLAGS_MASK << ERR_RFLAGS_OFFSET));
         rs = rsbuf;
     }

-    BIO_snprintf(buf, len, "error:%08lX:%s:%s:%s", e, ls, func, rs);
-    if (strlen(buf) == len - 1) {
+    n = snprintf(buf, len, "error:%08lX:%s:%s:%s", e, ls, func, rs);
+    if (n < 0 || (size_t)n >= len)
         /* Didn't fit; use a minimal format. */
-        BIO_snprintf(buf, len, "err:%lx:%lx:%lx:%lx", e, l, 0L, r);
-    }
+        snprintf(buf, len, "err:%lx:%lx:%lx:%lx", e, l, 0L, r);
 }

 void ERR_error_string_n(unsigned long e, char *buf, size_t len)
@@ -648,61 +638,51 @@ const char *ERR_reason_error_string(unsigned long e)

 static void err_delete_thread_state(void *unused)
 {
-    ERR_STATE *state = CRYPTO_THREAD_get_local(&err_thread_local);
+    ERR_STATE *state = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
+        CRYPTO_THREAD_NO_CONTEXT);
+
     if (state == NULL)
         return;

-    CRYPTO_THREAD_set_local(&err_thread_local, NULL);
+    CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
+        CRYPTO_THREAD_NO_CONTEXT, NULL);
     OSSL_ERR_STATE_free(state);
 }

-#ifndef OPENSSL_NO_DEPRECATED_1_1_0
-void ERR_remove_thread_state(void *dummy)
-{
-}
-#endif
-
-#ifndef OPENSSL_NO_DEPRECATED_1_0_0
-void ERR_remove_state(unsigned long pid)
-{
-}
-#endif
-
-DEFINE_RUN_ONCE_STATIC(err_do_init)
-{
-    set_err_thread_local = 1;
-    return CRYPTO_THREAD_init_local(&err_thread_local, NULL);
-}
-
-ERR_STATE *ossl_err_get_state_int(void)
+ERR_STATE *ossl_err_get_state_int(int save_sys_error)
 {
     ERR_STATE *state;
-    int saveerrno = get_last_sys_error();
+    int saveerrno = 0;

-    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
-        return NULL;
+    if (save_sys_error)
+        saveerrno = get_last_sys_error();

-    if (!RUN_ONCE(&err_init, err_do_init))
+    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
         return NULL;

-    state = CRYPTO_THREAD_get_local(&err_thread_local);
+    state = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
+        CRYPTO_THREAD_NO_CONTEXT);
     if (state == (ERR_STATE *)-1)
         return NULL;

     if (state == NULL) {
-        if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE *)-1))
+        if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
+                CRYPTO_THREAD_NO_CONTEXT, (ERR_STATE *)-1))
             return NULL;

         state = OSSL_ERR_STATE_new();
         if (state == NULL) {
-            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
+            CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
+                CRYPTO_THREAD_NO_CONTEXT, NULL);
             return NULL;
         }

         if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state)
-            || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
+            || !CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
+                CRYPTO_THREAD_NO_CONTEXT, state)) {
             OSSL_ERR_STATE_free(state);
-            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
+            CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
+                CRYPTO_THREAD_NO_CONTEXT, NULL);
             return NULL;
         }

@@ -710,17 +690,11 @@ ERR_STATE *ossl_err_get_state_int(void)
         OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
     }

-    set_sys_error(saveerrno);
+    if (save_sys_error)
+        set_sys_error(saveerrno);
     return state;
 }

-#ifndef OPENSSL_NO_DEPRECATED_3_0
-ERR_STATE *ERR_get_state(void)
-{
-    return ossl_err_get_state_int();
-}
-#endif
-
 /*
  * err_shelve_state returns the current thread local error state
  * and freezes the error module until err_unshelve_state is called.
@@ -744,11 +718,10 @@ int err_shelve_state(void **state)
     if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
         return 0;

-    if (!RUN_ONCE(&err_init, err_do_init))
-        return 0;
-
-    *state = CRYPTO_THREAD_get_local(&err_thread_local);
-    if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE *)-1))
+    *state = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
+        CRYPTO_THREAD_NO_CONTEXT);
+    if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
+            CRYPTO_THREAD_NO_CONTEXT, (ERR_STATE *)-1))
         return 0;

     set_sys_error(saveerrno);
@@ -762,7 +735,8 @@ int err_shelve_state(void **state)
 void err_unshelve_state(void *state)
 {
     if (state != (void *)-1)
-        CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE *)state);
+        CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
+            CRYPTO_THREAD_NO_CONTEXT, (ERR_STATE *)state);
 }

 int ERR_get_next_error_library(void)
@@ -784,7 +758,7 @@ static int err_set_error_data_int(char *data, size_t size, int flags,
 {
     ERR_STATE *es;

-    es = ossl_err_get_state_int();
+    es = ossl_err_get_state_int(1);
     if (es == NULL)
         return 0;

@@ -823,13 +797,14 @@ void ERR_add_error_data(int num, ...)

 void ERR_add_error_vdata(int num, va_list args)
 {
-    int i, len, size;
+    int i;
+    size_t len, size;
     int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
     char *str, *arg;
     ERR_STATE *es;

     /* Get the current error data; if an allocated string get it. */
-    es = ossl_err_get_state_int();
+    es = ossl_err_get_state_int(1);
     if (es == NULL)
         return;
     i = es->top;
@@ -875,7 +850,7 @@ void ERR_add_error_vdata(int num, va_list args)
             }
             str = p;
         }
-        OPENSSL_strlcat(str, arg, (size_t)size);
+        OPENSSL_strlcat(str, arg, size);
     }
     if (!err_set_error_data_int(str, size, flags, 0))
         OPENSSL_free(str);
@@ -886,7 +861,7 @@ void err_clear_last_constant_time(int clear)
     ERR_STATE *es;
     int top;

-    es = ossl_err_get_state_int();
+    es = ossl_err_get_state_int(0);
     if (es == NULL)
         return;

diff --git a/deps/openssl/openssl/crypto/err/err_all.c b/deps/openssl/openssl/crypto/err/err_all.c
index 76841f4ad3c..9b118383c31 100644
--- a/deps/openssl/openssl/crypto/err/err_all.c
+++ b/deps/openssl/openssl/crypto/err/err_all.c
@@ -30,7 +30,6 @@
 #include "crypto/pkcs12err.h"
 #include "crypto/randerr.h"
 #include "internal/dsoerr.h"
-#include "crypto/engineerr.h"
 #include "crypto/uierr.h"
 #include "crypto/httperr.h"
 #include "crypto/ocsperr.h"
@@ -83,9 +82,6 @@ int ossl_err_load_crypto_strings(void)
 #ifndef OPENSSL_NO_TS
         || ossl_err_load_TS_strings() == 0
 #endif
-#ifndef OPENSSL_NO_ENGINE
-        || ossl_err_load_ENGINE_strings() == 0
-#endif
 #ifndef OPENSSL_NO_HTTP
         || ossl_err_load_HTTP_strings() == 0
 #endif
diff --git a/deps/openssl/openssl/crypto/err/err_all_legacy.c b/deps/openssl/openssl/crypto/err/err_all_legacy.c
index 34031237c75..1817e85fa0a 100644
--- a/deps/openssl/openssl/crypto/err/err_all_legacy.c
+++ b/deps/openssl/openssl/crypto/err/err_all_legacy.c
@@ -27,7 +27,6 @@
 #include "crypto/dsaerr.h"
 #include "internal/dsoerr.h"
 #include "crypto/ecerr.h"
-#include "crypto/engineerr.h"
 #include "crypto/evperr.h"
 #include "crypto/httperr.h"
 #include "crypto/objectserr.h"
@@ -82,9 +81,6 @@ IMPLEMENT_LEGACY_ERR_LOAD(DSA)
 #ifndef OPENSSL_NO_EC
 IMPLEMENT_LEGACY_ERR_LOAD(EC)
 #endif
-#ifndef OPENSSL_NO_ENGINE
-IMPLEMENT_LEGACY_ERR_LOAD(ENGINE)
-#endif
 IMPLEMENT_LEGACY_ERR_LOAD(ERR)
 IMPLEMENT_LEGACY_ERR_LOAD(EVP)
 IMPLEMENT_LEGACY_ERR_LOAD(OBJ)
diff --git a/deps/openssl/openssl/crypto/err/err_blocks.c b/deps/openssl/openssl/crypto/err/err_blocks.c
index a658df05766..05de1632808 100644
--- a/deps/openssl/openssl/crypto/err/err_blocks.c
+++ b/deps/openssl/openssl/crypto/err/err_blocks.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,8 +7,7 @@
  * https://www.openssl.org/source/license.html
  */

-#define OSSL_FORCE_ERR_STATE
-
+#include <stdio.h>
 #include <string.h>
 #include <openssl/err.h>
 #include "err_local.h"
@@ -17,7 +16,7 @@ void ERR_new(void)
 {
     ERR_STATE *es;

-    es = ossl_err_get_state_int();
+    es = ossl_err_get_state_int(1);
     if (es == NULL)
         return;

@@ -30,7 +29,7 @@ void ERR_set_debug(const char *file, int line, const char *func)
 {
     ERR_STATE *es;

-    es = ossl_err_get_state_int();
+    es = ossl_err_get_state_int(1);
     if (es == NULL)
         return;

@@ -54,7 +53,7 @@ void ERR_vset_error(int lib, int reason, const char *fmt, va_list args)
     unsigned long flags = 0;
     size_t i;

-    es = ossl_err_get_state_int();
+    es = ossl_err_get_state_int(1);
     if (es == NULL)
         return;
     i = es->top;
@@ -87,9 +86,9 @@ void ERR_vset_error(int lib, int reason, const char *fmt, va_list args)
         }

         if (buf != NULL) {
-            printed_len = BIO_vsnprintf(buf, buf_size, fmt, args);
+            printed_len = vsnprintf(buf, buf_size, fmt, args);
         }
-        if (printed_len < 0)
+        if (printed_len < 0 || (size_t)printed_len >= buf_size)
             printed_len = 0;
         if (buf != NULL)
             buf[printed_len] = '\0';
diff --git a/deps/openssl/openssl/crypto/err/err_local.h b/deps/openssl/openssl/crypto/err/err_local.h
index 4d300593861..99aa5c76328 100644
--- a/deps/openssl/openssl/crypto/err/err_local.h
+++ b/deps/openssl/openssl/crypto/err/err_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,9 +7,29 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_ERR_ERR_LOCAL_H)
+#define OSSL_LIBCRYPTO_ERR_ERR_LOCAL_H
+
 #include <string.h>
 #include <openssl/err.h>
 #include <openssl/e_os2.h>
+#include "internal/err.h"
+
+#define ERR_FLAG_MARK 0x01
+#define ERR_FLAG_CLEAR 0x02
+
+struct err_state_st {
+    int err_flags[ERR_NUM_ERRORS];
+    int err_marks[ERR_NUM_ERRORS];
+    unsigned long err_buffer[ERR_NUM_ERRORS];
+    char *err_data[ERR_NUM_ERRORS];
+    size_t err_data_size[ERR_NUM_ERRORS];
+    int err_data_flags[ERR_NUM_ERRORS];
+    char *err_file[ERR_NUM_ERRORS];
+    int err_line[ERR_NUM_ERRORS];
+    char *err_func[ERR_NUM_ERRORS];
+    int top, bottom;
+};

 static ossl_inline void err_get_slot(ERR_STATE *es)
 {
@@ -95,6 +115,8 @@ static ossl_inline void err_clear(ERR_STATE *es, size_t i, int deall)
     es->err_func[i] = NULL;
 }

-ERR_STATE *ossl_err_get_state_int(void);
+ERR_STATE *ossl_err_get_state_int(int save_sys_error);
 void ossl_err_string_int(unsigned long e, const char *func,
     char *buf, size_t len);
+
+#endif /* !defined(OSSL_LIBCRYPTO_ERR_ERR_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/err/err_mark.c b/deps/openssl/openssl/crypto/err/err_mark.c
index 33fa6b21278..29aef24a129 100644
--- a/deps/openssl/openssl/crypto/err/err_mark.c
+++ b/deps/openssl/openssl/crypto/err/err_mark.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2003-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,8 +7,6 @@
  * https://www.openssl.org/source/license.html
  */

-#define OSSL_FORCE_ERR_STATE
-
 #include <openssl/err.h>
 #include "err_local.h"

@@ -16,7 +14,7 @@ int ERR_set_mark(void)
 {
     ERR_STATE *es;

-    es = ossl_err_get_state_int();
+    es = ossl_err_get_state_int(0);
     if (es == NULL)
         return 0;

@@ -30,7 +28,7 @@ int ERR_pop(void)
 {
     ERR_STATE *es;

-    es = ossl_err_get_state_int();
+    es = ossl_err_get_state_int(0);
     if (es == NULL || es->bottom == es->top)
         return 0;

@@ -43,7 +41,7 @@ int ERR_pop_to_mark(void)
 {
     ERR_STATE *es;

-    es = ossl_err_get_state_int();
+    es = ossl_err_get_state_int(0);
     if (es == NULL)
         return 0;

@@ -64,7 +62,7 @@ int ERR_count_to_mark(void)
     ERR_STATE *es;
     int count = 0, top;

-    es = ossl_err_get_state_int();
+    es = ossl_err_get_state_int(1);
     if (es == NULL)
         return 0;

@@ -83,7 +81,7 @@ int ERR_clear_last_mark(void)
     ERR_STATE *es;
     int top;

-    es = ossl_err_get_state_int();
+    es = ossl_err_get_state_int(0);
     if (es == NULL)
         return 0;

diff --git a/deps/openssl/openssl/crypto/err/err_prn.c b/deps/openssl/openssl/crypto/err/err_prn.c
index a6311098e3c..d3f704056e8 100644
--- a/deps/openssl/openssl/crypto/err/err_prn.c
+++ b/deps/openssl/openssl/crypto/err/err_prn.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,8 +7,6 @@
  * https://www.openssl.org/source/license.html
  */

-#define OSSL_FORCE_ERR_STATE
-
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/crypto.h>
@@ -34,11 +32,11 @@ void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u),
             data = "";

         hex = ossl_buf2hexstr_sep((const unsigned char *)&tid, sizeof(tid), '\0');
-        BIO_snprintf(buf, sizeof(buf), "%s:", hex == NULL ? "<null>" : hex);
-        offset = strlen(buf);
+        snprintf(buf, sizeof(buf), "%s:", hex == NULL ? "<null>" : hex);
+        offset = (int)strlen(buf);
         ossl_err_string_int(l, func, buf + offset, sizeof(buf) - offset);
-        offset += strlen(buf + offset);
-        BIO_snprintf(buf + offset, sizeof(buf) - offset, ":%s:%d:%s\n",
+        offset += (int)strlen(buf + offset);
+        snprintf(buf + offset, sizeof(buf) - offset, ":%s:%d:%s\n",
             file, line, data);
         OPENSSL_free(hex);
         if (cb(buf, strlen(buf), u) <= 0)
@@ -165,7 +163,7 @@ void ERR_add_error_mem_bio(const char *separator, BIO *bio)

 static int print_bio(const char *str, size_t len, void *bp)
 {
-    return BIO_write((BIO *)bp, str, len);
+    return BIO_write((BIO *)bp, str, (int)len);
 }

 void ERR_print_errors(BIO *bp)
diff --git a/deps/openssl/openssl/crypto/err/err_save.c b/deps/openssl/openssl/crypto/err/err_save.c
index 5781810315f..62f5d752dc7 100644
--- a/deps/openssl/openssl/crypto/err/err_save.c
+++ b/deps/openssl/openssl/crypto/err/err_save.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,8 +7,6 @@
  * https://www.openssl.org/source/license.html
  */

-#define OSSL_FORCE_ERR_STATE
-
 #include <openssl/err.h>
 #include "err_local.h"

@@ -25,7 +23,7 @@ ERR_STATE *OSSL_ERR_STATE_new(void)

 void OSSL_ERR_STATE_save(ERR_STATE *es)
 {
-    size_t i;
+    int i;
     ERR_STATE *thread_es;

     if (es == NULL)
@@ -34,7 +32,7 @@ void OSSL_ERR_STATE_save(ERR_STATE *es)
     for (i = 0; i < ERR_NUM_ERRORS; i++)
         err_clear(es, i, 1);

-    thread_es = ossl_err_get_state_int();
+    thread_es = ossl_err_get_state_int(1);
     if (thread_es == NULL)
         return;

@@ -45,14 +43,14 @@ void OSSL_ERR_STATE_save(ERR_STATE *es)

 void OSSL_ERR_STATE_save_to_mark(ERR_STATE *es)
 {
-    size_t i, j, count;
+    int i, j, count;
     int top;
     ERR_STATE *thread_es;

     if (es == NULL)
         return;

-    thread_es = ossl_err_get_state_int();
+    thread_es = ossl_err_get_state_int(1);
     if (thread_es == NULL) {
         for (i = 0; i < ERR_NUM_ERRORS; ++i)
             err_clear(es, i, 1);
@@ -112,18 +110,18 @@ void OSSL_ERR_STATE_save_to_mark(ERR_STATE *es)

 void OSSL_ERR_STATE_restore(const ERR_STATE *es)
 {
-    size_t i;
+    int i;
     ERR_STATE *thread_es;

     if (es == NULL || es->bottom == es->top)
         return;

-    thread_es = ossl_err_get_state_int();
+    thread_es = ossl_err_get_state_int(0);
     if (thread_es == NULL)
         return;

-    for (i = (size_t)es->bottom; i != (size_t)es->top;) {
-        size_t top;
+    for (i = es->bottom; i != es->top;) {
+        int top;

         i = (i + 1) % ERR_NUM_ERRORS;
         if ((es->err_flags[i] & ERR_FLAG_CLEAR) != 0)
diff --git a/deps/openssl/openssl/crypto/err/openssl.ec b/deps/openssl/openssl/crypto/err/openssl.ec
index 22f87d4c139..91aa11d1a6f 100644
--- a/deps/openssl/openssl/crypto/err/openssl.ec
+++ b/deps/openssl/openssl/crypto/err/openssl.ec
@@ -24,7 +24,6 @@ L X509V3        include/openssl/x509v3err.h     crypto/x509/v3err.c
 L PKCS12        include/openssl/pkcs12err.h     crypto/pkcs12/pk12err.c                 include/crypto/pkcs12err.h
 L RAND          include/openssl/randerr.h       crypto/rand/rand_err.c                  include/crypto/randerr.h
 L DSO           NONE                            crypto/dso/dso_err.c                    include/internal/dsoerr.h
-L ENGINE        include/openssl/engineerr.h     crypto/engine/eng_err.c                 include/crypto/engineerr.h
 L OCSP          include/openssl/ocsperr.h       crypto/ocsp/ocsp_err.c                  include/crypto/ocsperr.h
 L UI            include/openssl/uierr.h         crypto/ui/ui_err.c                      include/crypto/uierr.h
 L COMP          include/openssl/comperr.h       crypto/comp/comp_err.c                  include/crypto/comperr.h
@@ -46,19 +45,19 @@ L OSSL_DECODER  include/openssl/decodererr.h    crypto/encode_decode/decoder_err
 L HTTP          include/openssl/httperr.h       crypto/http/http_err.c                  include/crypto/httperr.h

 # SSL/TLS alerts
-R SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE          1010
-R SSL_R_SSLV3_ALERT_BAD_RECORD_MAC              1020
+R SSL_R_TLS_ALERT_UNEXPECTED_MESSAGE            1010
+R SSL_R_TLS_ALERT_BAD_RECORD_MAC                1020
 R SSL_R_TLSV1_ALERT_DECRYPTION_FAILED           1021
 R SSL_R_TLSV1_ALERT_RECORD_OVERFLOW             1022
-R SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE       1030
-R SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE           1040
-R SSL_R_SSLV3_ALERT_NO_CERTIFICATE              1041
-R SSL_R_SSLV3_ALERT_BAD_CERTIFICATE             1042
-R SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE     1043
-R SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED         1044
-R SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED         1045
-R SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN         1046
-R SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER           1047
+R SSL_R_TLS_ALERT_DECOMPRESSION_FAILURE         1030
+R SSL_R_TLS_ALERT_HANDSHAKE_FAILURE             1040
+R SSL_R_TLS_ALERT_NO_CERTIFICATE                1041
+R SSL_R_TLS_ALERT_BAD_CERTIFICATE               1042
+R SSL_R_TLS_ALERT_UNSUPPORTED_CERTIFICATE       1043
+R SSL_R_TLS_ALERT_CERTIFICATE_REVOKED           1044
+R SSL_R_TLS_ALERT_CERTIFICATE_EXPIRED           1045
+R SSL_R_TLS_ALERT_CERTIFICATE_UNKNOWN           1046
+R SSL_R_TLS_ALERT_ILLEGAL_PARAMETER             1047
 R SSL_R_TLSV1_ALERT_UNKNOWN_CA                  1048
 R SSL_R_TLSV1_ALERT_ACCESS_DENIED               1049
 R SSL_R_TLSV1_ALERT_DECODE_ERROR                1050
diff --git a/deps/openssl/openssl/crypto/err/openssl.txt b/deps/openssl/openssl/crypto/err/openssl.txt
index be65c1767ec..9911fbb5809 100644
--- a/deps/openssl/openssl/crypto/err/openssl.txt
+++ b/deps/openssl/openssl/crypto/err/openssl.txt
@@ -154,7 +154,8 @@ BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED:143:\
 BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED:144:no hostname or service specified
 BIO_R_NO_PORT_DEFINED:113:no port defined
 BIO_R_NO_SUCH_FILE:128:no such file
-BIO_R_PEER_ADDR_NOT_AVAILABLE:114:peer addr not available
+BIO_R_NULL_PARAMETER:115:null parameter
+BIO_R_PEER_ADDR_NOT_AVAILABLE:151:peer addr not available
 BIO_R_PORT_MISMATCH:150:port mismatch
 BIO_R_TFO_DISABLED:106:tfo disabled
 BIO_R_TFO_NO_KERNEL_SUPPORT:108:tfo no kernel support
@@ -355,6 +356,7 @@ CMS_R_NEED_ONE_SIGNER:164:need one signer
 CMS_R_NOT_A_SIGNED_RECEIPT:165:not a signed receipt
 CMS_R_NOT_ENCRYPTED_DATA:122:not encrypted data
 CMS_R_NOT_KEK:123:not kek
+CMS_R_NOT_KEM:197:not kem
 CMS_R_NOT_KEY_AGREEMENT:181:not key agreement
 CMS_R_NOT_KEY_TRANSPORT:124:not key transport
 CMS_R_NOT_PWRI:177:not pwri
@@ -395,11 +397,13 @@ CMS_R_UNABLE_TO_FINALIZE_CONTEXT:147:unable to finalize context
 CMS_R_UNKNOWN_CIPHER:148:unknown cipher
 CMS_R_UNKNOWN_DIGEST_ALGORITHM:149:unknown digest algorithm
 CMS_R_UNKNOWN_ID:150:unknown id
+CMS_R_UNKNOWN_KDF_ALGORITHM:198:unknown kdf algorithm
 CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM:151:unsupported compression algorithm
 CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM:194:\
 	unsupported content encryption algorithm
 CMS_R_UNSUPPORTED_CONTENT_TYPE:152:unsupported content type
 CMS_R_UNSUPPORTED_ENCRYPTION_TYPE:192:unsupported encryption type
+CMS_R_UNSUPPORTED_KDF_ALGORITHM:199:unsupported kdf algorithm
 CMS_R_UNSUPPORTED_KEK_ALGORITHM:153:unsupported kek algorithm
 CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM:179:\
 	unsupported key encryption algorithm
@@ -462,6 +466,7 @@ CRMF_R_ERROR_DECRYPTING_ENCRYPTEDKEY:124:error decrypting encryptedkey
 CRMF_R_ERROR_DECRYPTING_ENCRYPTEDVALUE:125:error decrypting encryptedvalue
 CRMF_R_ERROR_DECRYPTING_SYMMETRIC_KEY:106:error decrypting symmetric key
 CRMF_R_ERROR_SETTING_PURPOSE:126:error setting purpose
+CRMF_R_ERROR_SIGNING_POPO:129:error signing popo
 CRMF_R_ERROR_VERIFYING_ENCRYPTEDKEY:127:error verifying encryptedkey
 CRMF_R_FAILURE_OBTAINING_RANDOM:107:failure obtaining random
 CRMF_R_ITERATIONCOUNT_BELOW_100:108:iterationcount below 100
@@ -672,41 +677,6 @@ EC_R_UNKNOWN_ORDER:114:unknown order
 EC_R_UNSUPPORTED_FIELD:131:unsupported field
 EC_R_WRONG_CURVE_PARAMETERS:145:wrong curve parameters
 EC_R_WRONG_ORDER:130:wrong order
-ENGINE_R_ALREADY_LOADED:100:already loaded
-ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER:133:argument is not a number
-ENGINE_R_CMD_NOT_EXECUTABLE:134:cmd not executable
-ENGINE_R_COMMAND_TAKES_INPUT:135:command takes input
-ENGINE_R_COMMAND_TAKES_NO_INPUT:136:command takes no input
-ENGINE_R_CONFLICTING_ENGINE_ID:103:conflicting engine id
-ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED:119:ctrl command not implemented
-ENGINE_R_DSO_FAILURE:104:DSO failure
-ENGINE_R_DSO_NOT_FOUND:132:dso not found
-ENGINE_R_ENGINES_SECTION_ERROR:148:engines section error
-ENGINE_R_ENGINE_CONFIGURATION_ERROR:102:engine configuration error
-ENGINE_R_ENGINE_IS_NOT_IN_LIST:105:engine is not in the list
-ENGINE_R_ENGINE_SECTION_ERROR:149:engine section error
-ENGINE_R_FAILED_LOADING_PRIVATE_KEY:128:failed loading private key
-ENGINE_R_FAILED_LOADING_PUBLIC_KEY:129:failed loading public key
-ENGINE_R_FINISH_FAILED:106:finish failed
-ENGINE_R_ID_OR_NAME_MISSING:108:'id' or 'name' missing
-ENGINE_R_INIT_FAILED:109:init failed
-ENGINE_R_INTERNAL_LIST_ERROR:110:internal list error
-ENGINE_R_INVALID_ARGUMENT:143:invalid argument
-ENGINE_R_INVALID_CMD_NAME:137:invalid cmd name
-ENGINE_R_INVALID_CMD_NUMBER:138:invalid cmd number
-ENGINE_R_INVALID_INIT_VALUE:151:invalid init value
-ENGINE_R_INVALID_STRING:150:invalid string
-ENGINE_R_NOT_INITIALISED:117:not initialised
-ENGINE_R_NOT_LOADED:112:not loaded
-ENGINE_R_NO_CONTROL_FUNCTION:120:no control function
-ENGINE_R_NO_INDEX:144:no index
-ENGINE_R_NO_LOAD_FUNCTION:125:no load function
-ENGINE_R_NO_REFERENCE:130:no reference
-ENGINE_R_NO_SUCH_ENGINE:116:no such engine
-ENGINE_R_UNIMPLEMENTED_CIPHER:146:unimplemented cipher
-ENGINE_R_UNIMPLEMENTED_DIGEST:147:unimplemented digest
-ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD:101:unimplemented public key method
-ENGINE_R_VERSION_INCOMPATIBILITY:145:version incompatibility
 ESS_R_EMPTY_ESS_CERT_ID_LIST:107:empty ess cert id list
 ESS_R_ESS_CERT_DIGEST_ERROR:103:ess cert digest error
 ESS_R_ESS_CERT_ID_NOT_FOUND:104:ess cert id not found
@@ -731,6 +701,7 @@ EVP_R_CIPHER_NOT_GCM_MODE:184:cipher not gcm mode
 EVP_R_CIPHER_PARAMETER_ERROR:122:cipher parameter error
 EVP_R_COMMAND_NOT_SUPPORTED:147:command not supported
 EVP_R_CONFLICTING_ALGORITHM_NAME:201:conflicting algorithm name
+EVP_R_CONTEXT_FINALIZED:239:context finalized
 EVP_R_COPY_ERROR:173:copy error
 EVP_R_CTRL_NOT_IMPLEMENTED:132:ctrl not implemented
 EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED:133:ctrl operation not implemented
@@ -806,6 +777,8 @@ EVP_R_PRIVATE_KEY_DECODE_ERROR:145:private key decode error
 EVP_R_PRIVATE_KEY_ENCODE_ERROR:146:private key encode error
 EVP_R_PROVIDER_ASYM_CIPHER_FAILURE:232:provider asym cipher failure
 EVP_R_PROVIDER_ASYM_CIPHER_NOT_SUPPORTED:235:provider asym cipher not supported
+EVP_R_PROVIDER_GET_CTX_PARAMS_NOT_SUPPORTED:238:\
+	provider get ctx params not supported
 EVP_R_PROVIDER_KEYMGMT_FAILURE:233:provider keymgmt failure
 EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED:236:provider keymgmt not supported
 EVP_R_PROVIDER_SIGNATURE_FAILURE:234:provider signature failure
@@ -911,9 +884,11 @@ OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE:129:unsupported requestorname type
 OSSL_DECODER_R_COULD_NOT_DECODE_OBJECT:101:could not decode object
 OSSL_DECODER_R_DECODER_NOT_FOUND:102:decoder not found
 OSSL_DECODER_R_MISSING_GET_PARAMS:100:missing get params
+OSSL_ENCODER_R_BAD_PARAMETER_VALUE:103:bad parameter value
 OSSL_ENCODER_R_ENCODER_NOT_FOUND:101:encoder not found
 OSSL_ENCODER_R_INCORRECT_PROPERTY_QUERY:100:incorrect property query
 OSSL_ENCODER_R_MISSING_GET_PARAMS:102:missing get params
+OSSL_ENCODER_R_UNKNOWN_PARAMETER_NAME:104:unknown parameter name
 OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE:107:ambiguous content type
 OSSL_STORE_R_BAD_PASSWORD_READ:115:bad password read
 OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC:113:error verifying pkcs12 mac
@@ -928,6 +903,7 @@ OSSL_STORE_R_NOT_A_CRL:101:not a crl
 OSSL_STORE_R_NOT_A_NAME:103:not a name
 OSSL_STORE_R_NOT_A_PRIVATE_KEY:102:not a private key
 OSSL_STORE_R_NOT_A_PUBLIC_KEY:122:not a public key
+OSSL_STORE_R_NOT_A_SYMMETRIC_KEY:124:not a symmetric key
 OSSL_STORE_R_NOT_PARAMETERS:104:not parameters
 OSSL_STORE_R_NO_LOADERS_FOUND:123:no loaders found
 OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR:114:passphrase callback error
@@ -984,6 +960,7 @@ PKCS12_R_ENCRYPT_ERROR:103:encrypt error
 PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE:120:error setting encrypted data type
 PKCS12_R_INVALID_NULL_ARGUMENT:104:invalid null argument
 PKCS12_R_INVALID_NULL_PKCS12_POINTER:105:invalid null pkcs12 pointer
+PKCS12_R_INVALID_SALT_LENGTH:117:invalid salt length
 PKCS12_R_INVALID_TYPE:112:invalid type
 PKCS12_R_IV_GEN_ERROR:106:iv gen error
 PKCS12_R_KEY_GEN_ERROR:107:key gen error
@@ -1062,8 +1039,12 @@ PROV_R_COFACTOR_REQUIRED:236:cofactor required
 PROV_R_DERIVATION_FUNCTION_INIT_FAILED:205:derivation function init failed
 PROV_R_DIGEST_NOT_ALLOWED:174:digest not allowed
 PROV_R_EMS_NOT_ENABLED:233:ems not enabled
+PROV_R_ENTROPY_SOURCE_FAILED_APT_CONTINUOUS_TEST:268:\
+        entropy source failed APT continuous test
 PROV_R_ENTROPY_SOURCE_FAILED_CONTINUOUS_TESTS:244:\
 	entropy source failed continuous tests
+PROV_R_ENTROPY_SOURCE_FAILED_RCT_CONTINUOUS_TEST:269:\
+        entropy source failed RCT continuous test
 PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK:186:entropy source strength too weak
 PROV_R_ERROR_INSTANTIATING_DRBG:188:error instantiating drbg
 PROV_R_ERROR_RETRIEVING_ENTROPY:189:error retrieving entropy
@@ -1080,6 +1061,7 @@ PROV_R_FIPS_MODULE_CONDITIONAL_ERROR:227:fips module conditional error
 PROV_R_FIPS_MODULE_ENTERING_ERROR_STATE:224:fips module entering error state
 PROV_R_FIPS_MODULE_IMPORT_PCT_ERROR:253:fips module import pct error
 PROV_R_FIPS_MODULE_IN_ERROR_STATE:225:fips module in error state
+PROV_R_FIPS_MODULE_MISSING_CHECKSUM:267:fips module missing checksum
 PROV_R_GENERATE_ERROR:191:generate error
 PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE:165:\
 	illegal or unsupported padding mode
@@ -1088,6 +1070,7 @@ PROV_R_INIT_CALL_OUT_OF_ORDER:238:init call out of order
 PROV_R_INSUFFICIENT_DRBG_STRENGTH:181:insufficient drbg strength
 PROV_R_INVALID_AAD:108:invalid aad
 PROV_R_INVALID_AEAD:231:invalid aead
+PROV_R_INVALID_CIPHER:260:invalid cipher
 PROV_R_INVALID_CONFIG_DATA:211:invalid config data
 PROV_R_INVALID_CONSTANT_LENGTH:157:invalid constant length
 PROV_R_INVALID_CURVE:176:invalid curve
@@ -1098,21 +1081,28 @@ PROV_R_INVALID_DIGEST_LENGTH:166:invalid digest length
 PROV_R_INVALID_DIGEST_SIZE:218:invalid digest size
 PROV_R_INVALID_EDDSA_INSTANCE_FOR_ATTEMPTED_OPERATION:243:\
 	invalid eddsa instance for attempted operation
+PROV_R_INVALID_FUNCTION_NAME:258:invalid function name
+PROV_R_INVALID_INDEX_LENGTH:259:invalid index length
 PROV_R_INVALID_INPUT_LENGTH:230:invalid input length
 PROV_R_INVALID_ITERATION_COUNT:123:invalid iteration count
 PROV_R_INVALID_IV_LENGTH:109:invalid iv length
 PROV_R_INVALID_KDF:232:invalid kdf
+PROV_R_INVALID_KDR:256:invalid kdr
 PROV_R_INVALID_KEY:158:invalid key
 PROV_R_INVALID_KEY_LENGTH:105:invalid key length
+PROV_R_INVALID_LABEL:257:invalid label
 PROV_R_INVALID_MAC:151:invalid mac
 PROV_R_INVALID_MEMORY_SIZE:235:invalid memory size
 PROV_R_INVALID_MGF1_MD:167:invalid mgf1 md
 PROV_R_INVALID_MODE:125:invalid mode
+PROV_R_INVALID_NONCE_LENGTH:264:invalid nonce length
 PROV_R_INVALID_OUTPUT_LENGTH:217:invalid output length
 PROV_R_INVALID_PADDING_MODE:168:invalid padding mode
+PROV_R_INVALID_PARAMETERS_FOR_DKM:261:invalid parameters for dkm
 PROV_R_INVALID_PREHASHED_DIGEST_LENGTH:241:invalid prehashed digest length
 PROV_R_INVALID_PUBINFO:198:invalid pubinfo
 PROV_R_INVALID_SALT_LENGTH:112:invalid salt length
+PROV_R_INVALID_SECRET_LENGTH:265:invalid secret length
 PROV_R_INVALID_SEED_LENGTH:154:invalid seed length
 PROV_R_INVALID_SIGNATURE_SIZE:179:invalid signature size
 PROV_R_INVALID_STATE:212:invalid state
@@ -1122,6 +1112,7 @@ PROV_R_INVALID_THREAD_POOL_SIZE:234:invalid thread pool size
 PROV_R_INVALID_UKM_LENGTH:200:invalid ukm length
 PROV_R_INVALID_X931_DIGEST:170:invalid x931 digest
 PROV_R_IN_ERROR_STATE:192:in error state
+PROV_R_KEY_IMMUTABLE_ONCE_SET:266:key immutable once set
 PROV_R_KEY_SETUP_FAILED:101:key setup failed
 PROV_R_KEY_SIZE_TOO_SMALL:171:key size too small
 PROV_R_LENGTH_TOO_LARGE:202:length too large
@@ -1130,9 +1121,12 @@ PROV_R_MISSING_CEK_ALG:144:missing cek alg
 PROV_R_MISSING_CIPHER:155:missing cipher
 PROV_R_MISSING_CONFIG_DATA:213:missing config data
 PROV_R_MISSING_CONSTANT:156:missing constant
+PROV_R_MISSING_DKM:262:missing dkm
+PROV_R_MISSING_EID:255:missing eid
 PROV_R_MISSING_KEY:128:missing key
 PROV_R_MISSING_MAC:150:missing mac
 PROV_R_MISSING_MESSAGE_DIGEST:129:missing message digest
+PROV_R_MISSING_NONCE:263:missing nonce
 PROV_R_MISSING_OID:209:missing OID
 PROV_R_MISSING_PASS:130:missing pass
 PROV_R_MISSING_SALT:131:missing salt
@@ -1164,9 +1158,11 @@ PROV_R_PARENT_CANNOT_GENERATE_RANDOM_NUMBERS:228:\
 PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED:187:parent cannot supply entropy seed
 PROV_R_PARENT_LOCKING_NOT_ENABLED:182:parent locking not enabled
 PROV_R_PARENT_STRENGTH_TOO_WEAK:194:parent strength too weak
+PROV_R_PASSWORD_STRENGTH_TOO_WEAK:254:password strength too weak
 PROV_R_PATH_MUST_BE_ABSOLUTE:219:path must be absolute
 PROV_R_PERSONALISATION_STRING_TOO_LONG:195:personalisation string too long
 PROV_R_PSS_SALTLEN_TOO_SMALL:172:pss saltlen too small
+PROV_R_REPEATED_PARAMETER:252:repeated parameter
 PROV_R_REQUEST_TOO_LARGE_FOR_DRBG:196:request too large for drbg
 PROV_R_REQUIRE_CTR_MODE_CIPHER:206:require ctr mode cipher
 PROV_R_RESEED_ERROR:197:reseed error
@@ -1320,7 +1316,6 @@ RSA_R_RANDOMNESS_SOURCE_STRENGTH_INSUFFICIENT:180:\
 RSA_R_RSA_OPERATIONS_NOT_SUPPORTED:130:rsa operations not supported
 RSA_R_SLEN_CHECK_FAILED:136:salt length check failed
 RSA_R_SLEN_RECOVERY_FAILED:135:salt length recovery failed
-RSA_R_SSLV3_ROLLBACK_ATTACK:115:sslv3 rollback attack
 RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD:116:\
 	the asn1 object identifier is not known for this md
 RSA_R_UNKNOWN_ALGORITHM_TYPE:117:unknown algorithm type
@@ -1366,6 +1361,7 @@ SSL_R_BAD_DH_VALUE:102:bad dh value
 SSL_R_BAD_DIGEST_LENGTH:111:bad digest length
 SSL_R_BAD_EARLY_DATA:233:bad early data
 SSL_R_BAD_ECC_CERT:304:bad ecc cert
+SSL_R_BAD_ECHCONFIG_EXTENSION:425:bad echconfig extension
 SSL_R_BAD_ECPOINT:306:bad ecpoint
 SSL_R_BAD_EXTENSION:110:bad extension
 SSL_R_BAD_HANDSHAKE_LENGTH:332:bad handshake length
@@ -1446,6 +1442,8 @@ SSL_R_DTLS_MESSAGE_TOO_BIG:334:dtls message too big
 SSL_R_DUPLICATE_COMPRESSION_ID:309:duplicate compression id
 SSL_R_ECC_CERT_NOT_FOR_SIGNING:318:ecc cert not for signing
 SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE:374:ecdh required for suiteb mode
+SSL_R_ECH_DECODE_ERROR:426:ech decode error
+SSL_R_ECH_REQUIRED:424:ech required
 SSL_R_EE_KEY_TOO_SMALL:399:ee key too small
 SSL_R_EMPTY_RAW_PUBLIC_KEY:349:empty raw public key
 SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST:354:empty srtp protection profile list
@@ -1609,23 +1607,6 @@ SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES:362:srtp could not allocate profiles
 SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG:363:\
 	srtp protection profile list too long
 SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE:364:srtp unknown protection profile
-SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH:232:\
-	ssl3 ext invalid max fragment length
-SSL_R_SSL3_EXT_INVALID_SERVERNAME:319:ssl3 ext invalid servername
-SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE:320:ssl3 ext invalid servername type
-SSL_R_SSL3_SESSION_ID_TOO_LONG:300:ssl3 session id too long
-SSL_R_SSLV3_ALERT_BAD_CERTIFICATE:1042:ssl/tls alert bad certificate
-SSL_R_SSLV3_ALERT_BAD_RECORD_MAC:1020:ssl/tls alert bad record mac
-SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED:1045:ssl/tls alert certificate expired
-SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED:1044:ssl/tls alert certificate revoked
-SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN:1046:ssl/tls alert certificate unknown
-SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE:1030:ssl/tls alert decompression failure
-SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE:1040:ssl/tls alert handshake failure
-SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER:1047:ssl/tls alert illegal parameter
-SSL_R_SSLV3_ALERT_NO_CERTIFICATE:1041:ssl/tls alert no certificate
-SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE:1010:ssl/tls alert unexpected message
-SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE:1043:\
-	ssl/tls alert unsupported certificate
 SSL_R_SSL_COMMAND_SECTION_EMPTY:117:ssl command section empty
 SSL_R_SSL_COMMAND_SECTION_NOT_FOUND:125:ssl command section not found
 SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION:228:ssl ctx has no default ssl version
@@ -1670,16 +1651,30 @@ SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE:1113:\
 SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE:1111:tlsv1 certificate unobtainable
 SSL_R_TLSV1_UNRECOGNIZED_NAME:1112:tlsv1 unrecognized name
 SSL_R_TLSV1_UNSUPPORTED_EXTENSION:1110:tlsv1 unsupported extension
+SSL_R_TLS_ALERT_BAD_CERTIFICATE:1042:tls alert bad certificate
+SSL_R_TLS_ALERT_BAD_RECORD_MAC:1020:tls alert bad record mac
+SSL_R_TLS_ALERT_CERTIFICATE_EXPIRED:1045:tls alert certificate expired
+SSL_R_TLS_ALERT_CERTIFICATE_REVOKED:1044:tls alert certificate revoked
+SSL_R_TLS_ALERT_CERTIFICATE_UNKNOWN:1046:tls alert certificate unknown
+SSL_R_TLS_ALERT_DECOMPRESSION_FAILURE:1030:tls alert decompression failure
+SSL_R_TLS_ALERT_HANDSHAKE_FAILURE:1040:tls alert handshake failure
+SSL_R_TLS_ALERT_ILLEGAL_PARAMETER:1047:tls alert illegal parameter
+SSL_R_TLS_ALERT_NO_CERTIFICATE:1041:tls alert no certificate
+SSL_R_TLS_ALERT_UNEXPECTED_MESSAGE:1010:tls alert unexpected message
+SSL_R_TLS_ALERT_UNSUPPORTED_CERTIFICATE:1043:tls alert unsupported certificate
+SSL_R_TLS_EXT_INVALID_MAX_FRAGMENT_LENGTH:232:\
+	tls ext invalid max fragment length
+SSL_R_TLS_EXT_INVALID_SERVERNAME:319:tls ext invalid servername
+SSL_R_TLS_EXT_INVALID_SERVERNAME_TYPE:320:tls ext invalid servername type
 SSL_R_TLS_ILLEGAL_EXPORTER_LABEL:367:tls illegal exporter label
 SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST:157:tls invalid ecpointformat list
+SSL_R_TLS_SESSION_ID_TOO_LONG:300:tls session id too long
 SSL_R_TOO_MANY_KEY_UPDATES:132:too many key updates
 SSL_R_TOO_MANY_WARN_ALERTS:409:too many warn alerts
 SSL_R_TOO_MUCH_EARLY_DATA:164:too much early data
 SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS:314:unable to find ecdh parameters
 SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS:239:\
 	unable to find public key parameters
-SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES:242:unable to load ssl3 md5 routines
-SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES:243:unable to load ssl3 sha1 routines
 SSL_R_UNEXPECTED_CCS_MESSAGE:262:unexpected ccs message
 SSL_R_UNEXPECTED_END_OF_EARLY_DATA:178:unexpected end of early data
 SSL_R_UNEXPECTED_EOF_WHILE_READING:294:unexpected eof while reading
@@ -1786,6 +1781,7 @@ X509V3_R_BN_DEC2BN_ERROR:100:bn dec2bn error
 X509V3_R_BN_TO_ASN1_INTEGER_ERROR:101:bn to asn1 integer error
 X509V3_R_DIRNAME_ERROR:149:dirname error
 X509V3_R_DISTPOINT_ALREADY_SET:160:distpoint already set
+X509V3_R_DUPLICATE_FIELD:174:duplicate field
 X509V3_R_DUPLICATE_ZONE_ID:133:duplicate zone id
 X509V3_R_EMPTY_KEY_USAGE:169:empty key usage
 X509V3_R_ERROR_CONVERTING_ZONE:131:error converting zone
@@ -1870,6 +1866,7 @@ X509_R_IDP_MISMATCH:128:idp mismatch
 X509_R_INVALID_ATTRIBUTES:138:invalid attributes
 X509_R_INVALID_DIRECTORY:113:invalid directory
 X509_R_INVALID_DISTPOINT:143:invalid distpoint
+X509_R_INVALID_EXTENSION:146:invalid extension
 X509_R_INVALID_FIELD_NAME:119:invalid field name
 X509_R_INVALID_TRUST:123:invalid trust
 X509_R_ISSUER_MISMATCH:129:issuer mismatch
diff --git a/deps/openssl/openssl/crypto/ess/ess_asn1.c b/deps/openssl/openssl/crypto/ess/ess_asn1.c
index d02076fabc5..5a0978dfe0d 100644
--- a/deps/openssl/openssl/crypto/ess/ess_asn1.c
+++ b/deps/openssl/openssl/crypto/ess/ess_asn1.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/crypto/ess/ess_err.c b/deps/openssl/openssl/crypto/ess/ess_err.c
deleted file mode 100644
index cd232d8934f..00000000000
--- a/deps/openssl/openssl/crypto/ess/ess_err.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/esserr.h>
-#include "crypto/esserr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA ESS_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_ESS, 0, ESS_R_EMPTY_ESS_CERT_ID_LIST),
-        "empty ess cert id list" },
-    { ERR_PACK(ERR_LIB_ESS, 0, ESS_R_ESS_CERT_DIGEST_ERROR),
-        "ess cert digest error" },
-    { ERR_PACK(ERR_LIB_ESS, 0, ESS_R_ESS_CERT_ID_NOT_FOUND),
-        "ess cert id not found" },
-    { ERR_PACK(ERR_LIB_ESS, 0, ESS_R_ESS_CERT_ID_WRONG_ORDER),
-        "ess cert id wrong order" },
-    { ERR_PACK(ERR_LIB_ESS, 0, ESS_R_ESS_DIGEST_ALG_UNKNOWN),
-        "ess digest alg unknown" },
-    { ERR_PACK(ERR_LIB_ESS, 0, ESS_R_ESS_SIGNING_CERTIFICATE_ERROR),
-        "ess signing certificate error" },
-    { ERR_PACK(ERR_LIB_ESS, 0, ESS_R_ESS_SIGNING_CERT_ADD_ERROR),
-        "ess signing cert add error" },
-    { ERR_PACK(ERR_LIB_ESS, 0, ESS_R_ESS_SIGNING_CERT_V2_ADD_ERROR),
-        "ess signing cert v2 add error" },
-    { ERR_PACK(ERR_LIB_ESS, 0, ESS_R_MISSING_SIGNING_CERTIFICATE_ATTRIBUTE),
-        "missing signing certificate attribute" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_ESS_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(ESS_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(ESS_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/ess/ess_lib.c b/deps/openssl/openssl/crypto/ess/ess_lib.c
index 0486beffc40..70efecae027 100644
--- a/deps/openssl/openssl/crypto/ess/ess_lib.c
+++ b/deps/openssl/openssl/crypto/ess/ess_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -186,12 +186,7 @@ static ESS_CERT_ID_V2 *ESS_CERT_ID_V2_new_init(const EVP_MD *hash_alg,

     if (!EVP_MD_is_a(hash_alg, SN_sha256)) {
         alg = X509_ALGOR_new();
-        if (alg == NULL) {
-            ERR_raise(ERR_LIB_ESS, ERR_R_ASN1_LIB);
-            goto err;
-        }
-        X509_ALGOR_set_md(alg, hash_alg);
-        if (alg->algorithm == NULL) {
+        if (alg == NULL || !X509_ALGOR_set_md(alg, hash_alg) || alg->algorithm == NULL) {
             ERR_raise(ERR_LIB_ESS, ERR_R_ASN1_LIB);
             goto err;
         }
@@ -268,7 +263,7 @@ static int ess_issuer_serial_cmp(const ESS_ISSUER_SERIAL *is, const X509 *cert)
  * Return 0 on not found, -1 on error, else 1 + the position in |certs|.
  */
 static int find(const ESS_CERT_ID *cid, const ESS_CERT_ID_V2 *cid_v2,
-    int index, const STACK_OF(X509) *certs)
+    int index, const STACK_OF(X509) *certs, OSSL_LIB_CTX *libctx, const char *propq)
 {
     const X509 *cert;
     EVP_MD *md = NULL;
@@ -291,18 +286,11 @@ static int find(const ESS_CERT_ID *cid, const ESS_CERT_ID_V2 *cid_v2,
     else
         OBJ_obj2txt(name, sizeof(name), cid_v2->hash_alg->algorithm, 0);

-    (void)ERR_set_mark();
-    md = EVP_MD_fetch(NULL, name, NULL);
-
-    if (md == NULL)
-        md = (EVP_MD *)EVP_get_digestbyname(name);
-
+    md = EVP_MD_fetch(libctx, name, propq);
     if (md == NULL) {
-        (void)ERR_clear_last_mark();
         ERR_raise(ERR_LIB_ESS, ESS_R_ESS_DIGEST_ALG_UNKNOWN);
         goto end;
     }
-    (void)ERR_pop_to_mark();

     for (i = 0; i < sk_X509_num(certs); ++i) {
         cert = sk_X509_value(certs, i);
@@ -337,9 +325,11 @@ end:
     return ret;
 }

-int OSSL_ESS_check_signing_certs(const ESS_SIGNING_CERT *ss,
+int OSSL_ESS_check_signing_certs_ex(const ESS_SIGNING_CERT *ss,
     const ESS_SIGNING_CERT_V2 *ssv2,
     const STACK_OF(X509) *chain,
+    OSSL_LIB_CTX *libctx,
+    const char *propq,
     int require_signing_cert)
 {
     int n_v1 = ss == NULL ? -1 : sk_ESS_CERT_ID_num(ss->cert_ids);
@@ -356,14 +346,23 @@ int OSSL_ESS_check_signing_certs(const ESS_SIGNING_CERT *ss,
     }
     /* If both ss and ssv2 exist, as required evaluate them independently. */
     for (i = 0; i < n_v1; i++) {
-        ret = find(sk_ESS_CERT_ID_value(ss->cert_ids, i), NULL, i, chain);
+        ret = find(sk_ESS_CERT_ID_value(ss->cert_ids, i), NULL, i, chain, libctx, propq);
         if (ret <= 0)
             return ret;
     }
     for (i = 0; i < n_v2; i++) {
-        ret = find(NULL, sk_ESS_CERT_ID_V2_value(ssv2->cert_ids, i), i, chain);
+        ret = find(NULL, sk_ESS_CERT_ID_V2_value(ssv2->cert_ids, i), i, chain, libctx, propq);
         if (ret <= 0)
             return ret;
     }
     return 1;
 }
+
+int OSSL_ESS_check_signing_certs(const ESS_SIGNING_CERT *ss,
+    const ESS_SIGNING_CERT_V2 *ssv2,
+    const STACK_OF(X509) *chain,
+    int require_signing_cert)
+{
+    return OSSL_ESS_check_signing_certs_ex(ss, ssv2, chain, NULL,
+        NULL, require_signing_cert);
+}
diff --git a/deps/openssl/openssl/crypto/evp/asymcipher.c b/deps/openssl/openssl/crypto/evp/asymcipher.c
index f1f5fd35390..ed3dcaaf45b 100644
--- a/deps/openssl/openssl/crypto/evp/asymcipher.c
+++ b/deps/openssl/openssl/crypto/evp/asymcipher.c
@@ -19,12 +19,26 @@

 static void evp_asym_cipher_free(void *data)
 {
-    EVP_ASYM_CIPHER_free(data);
+    EVP_ASYM_CIPHER *cipher = (EVP_ASYM_CIPHER *)data;
+    int i;
+
+    if (cipher == NULL)
+        return;
+    CRYPTO_DOWN_REF(&cipher->refcnt, &i);
+    if (i > 0)
+        return;
+    OPENSSL_free(cipher->type_name);
+    ossl_provider_free(cipher->prov);
+    CRYPTO_FREE_REF(&cipher->refcnt);
+    OPENSSL_free(cipher);
 }

 static int evp_asym_cipher_up_ref(void *data)
 {
-    return EVP_ASYM_CIPHER_up_ref(data);
+    EVP_ASYM_CIPHER *cipher = (EVP_ASYM_CIPHER *)data;
+    int ref = 0;
+
+    return CRYPTO_UP_REF(&cipher->refcnt, &ref);
 }

 static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation,
@@ -50,7 +64,7 @@ static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation,
     ERR_set_mark();

     if (evp_pkey_ctx_is_legacy(ctx))
-        goto legacy;
+        goto err;

     if (ctx->pkey == NULL) {
         ERR_clear_last_mark();
@@ -118,7 +132,7 @@ static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation,
             cipher = evp_asym_cipher_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
                 supported_ciph, ctx->propquery);
             if (cipher == NULL)
-                goto legacy;
+                goto err;
             break;
         }
         if (cipher == NULL)
@@ -146,7 +160,7 @@ static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation,

     if (provkey == NULL) {
         EVP_ASYM_CIPHER_free(cipher);
-        goto legacy;
+        goto err;
     }

     ERR_pop_to_mark();
@@ -191,35 +205,6 @@ static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation,
     EVP_KEYMGMT_free(tmp_keymgmt);
     return 1;

-legacy:
-    /*
-     * If we don't have the full support we need with provided methods,
-     * let's go see if legacy does.
-     */
-    ERR_pop_to_mark();
-    EVP_KEYMGMT_free(tmp_keymgmt);
-    tmp_keymgmt = NULL;
-
-    if (ctx->pmeth == NULL || ctx->pmeth->encrypt == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
-        return -2;
-    }
-    switch (ctx->operation) {
-    case EVP_PKEY_OP_ENCRYPT:
-        if (ctx->pmeth->encrypt_init == NULL)
-            return 1;
-        ret = ctx->pmeth->encrypt_init(ctx);
-        break;
-    case EVP_PKEY_OP_DECRYPT:
-        if (ctx->pmeth->decrypt_init == NULL)
-            return 1;
-        ret = ctx->pmeth->decrypt_init(ctx);
-        break;
-    default:
-        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
-        ret = -1;
-    }
-
 err:
     if (ret <= 0) {
         evp_pkey_ctx_free_old_ops(ctx);
@@ -257,9 +242,10 @@ int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx,
         return -1;
     }

-    if (ctx->op.ciph.algctx == NULL)
-        goto legacy;
-
+    if (ctx->op.ciph.algctx == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
+        return -2;
+    }
     cipher = ctx->op.ciph.cipher;
     desc = cipher->description != NULL ? cipher->description : "";
     ERR_set_mark();
@@ -269,13 +255,6 @@ int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx,
             "%s encrypt:%s", cipher->type_name, desc);
     ERR_clear_last_mark();
     return ret;
-
-legacy:
-    if (ctx->pmeth == NULL || ctx->pmeth->encrypt == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
-        return -2;
-    }
-    M_check_autoarg(ctx, out, outlen, EVP_F_EVP_PKEY_ENCRYPT) return ctx->pmeth->encrypt(ctx, out, outlen, in, inlen);
 }

 int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx)
@@ -306,8 +285,10 @@ int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx,
         return -1;
     }

-    if (ctx->op.ciph.algctx == NULL)
-        goto legacy;
+    if (ctx->op.ciph.algctx == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
+        return -2;
+    }

     cipher = ctx->op.ciph.cipher;
     desc = cipher->description != NULL ? cipher->description : "";
@@ -319,13 +300,6 @@ int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx,
     ERR_clear_last_mark();

     return ret;
-
-legacy:
-    if (ctx->pmeth == NULL || ctx->pmeth->decrypt == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
-        return -2;
-    }
-    M_check_autoarg(ctx, out, outlen, EVP_F_EVP_PKEY_DECRYPT) return ctx->pmeth->decrypt(ctx, out, outlen, in, inlen);
 }

 /* decrypt to new buffer of dynamic size, checking any pre-determined size */
@@ -367,7 +341,7 @@ static EVP_ASYM_CIPHER *evp_asym_cipher_new(OSSL_PROVIDER *prov)

 static void *evp_asym_cipher_from_algorithm(int name_id,
     const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov)
+    OSSL_PROVIDER *prov, int no_store)
 {
     const OSSL_DISPATCH *fns = algodef->implementation;
     EVP_ASYM_CIPHER *cipher = NULL;
@@ -380,6 +354,7 @@ static void *evp_asym_cipher_from_algorithm(int name_id,
     }

     cipher->name_id = name_id;
+    cipher->no_store = no_store;
     if ((cipher->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
         goto err;
     cipher->description = algodef->algorithm_description;
@@ -478,31 +453,29 @@ static void *evp_asym_cipher_from_algorithm(int name_id,

     return cipher;
 err:
-    EVP_ASYM_CIPHER_free(cipher);
+    evp_asym_cipher_free(cipher);
     return NULL;
 }

 void EVP_ASYM_CIPHER_free(EVP_ASYM_CIPHER *cipher)
 {
-    int i;
-
-    if (cipher == NULL)
-        return;
-    CRYPTO_DOWN_REF(&cipher->refcnt, &i);
-    if (i > 0)
-        return;
-    OPENSSL_free(cipher->type_name);
-    ossl_provider_free(cipher->prov);
-    CRYPTO_FREE_REF(&cipher->refcnt);
-    OPENSSL_free(cipher);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    evp_asym_cipher_free(cipher);
+#else
+    if (cipher != NULL && (cipher->no_store != 0))
+        evp_asym_cipher_free(cipher);
+#endif
 }

 int EVP_ASYM_CIPHER_up_ref(EVP_ASYM_CIPHER *cipher)
 {
-    int ref = 0;
-
-    CRYPTO_UP_REF(&cipher->refcnt, &ref);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    return evp_asym_cipher_up_ref(cipher);
+#else
+    if (cipher->no_store != 0)
+        return evp_asym_cipher_up_ref(cipher);
     return 1;
+#endif
 }

 OSSL_PROVIDER *EVP_ASYM_CIPHER_get0_provider(const EVP_ASYM_CIPHER *cipher)
@@ -555,8 +528,12 @@ void EVP_ASYM_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx,
         void *arg),
     void *arg)
 {
+    struct EVP_ASYM_CIPHER_do_all_provided_thunk t;
+
+    t.fn = fn;
+    t.arg = arg;
     evp_generic_do_all(libctx, OSSL_OP_ASYM_CIPHER,
-        (void (*)(void *, void *))fn, arg,
+        EVP_ASYM_CIPHER_do_all_provided_thunk, &t,
         evp_asym_cipher_from_algorithm,
         evp_asym_cipher_up_ref,
         evp_asym_cipher_free);
diff --git a/deps/openssl/openssl/crypto/evp/bio_b64.c b/deps/openssl/openssl/crypto/evp/bio_b64.c
index b4c3816a524..2a6f06c1100 100644
--- a/deps/openssl/openssl/crypto/evp/bio_b64.c
+++ b/deps/openssl/openssl/crypto/evp/bio_b64.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,6 +13,7 @@
 #include <openssl/buffer.h>
 #include <openssl/evp.h>
 #include "internal/bio.h"
+#include "crypto/evp.h"

 static int b64_write(BIO *h, const char *buf, int num);
 static int b64_read(BIO *h, char *buf, int size);
@@ -41,6 +42,10 @@ typedef struct b64_struct {
     EVP_ENCODE_CTX *base64;
     unsigned char buf[EVP_ENCODE_LENGTH(B64_BLOCK_SIZE) + 10];
     unsigned char tmp[B64_BLOCK_SIZE];
+    unsigned char *encoded_buf;
+    size_t encoded_buf_len;
+    size_t encoded_len;
+    size_t encoded_off;
 } BIO_B64_CTX;

 static const BIO_METHOD methods_b64 = {
@@ -72,6 +77,8 @@ static int b64_new(BIO *bi)

     ctx->cont = 1;
     ctx->start = 1;
+    ctx->encoded_buf = NULL;
+    ctx->encoded_buf_len = 0;
     ctx->base64 = EVP_ENCODE_CTX_new();
     if (ctx->base64 == NULL) {
         OPENSSL_free(ctx);
@@ -95,6 +102,9 @@ static int b64_free(BIO *a)
     if (ctx == NULL)
         return 0;

+    OPENSSL_free(ctx->encoded_buf);
+    ctx->encoded_buf = NULL;
+    ctx->encoded_buf_len = 0;
     EVP_ENCODE_CTX_free(ctx->base64);
     OPENSSL_free(ctx);
     BIO_set_data(a, NULL);
@@ -103,6 +113,72 @@ static int b64_free(BIO *a)
     return 1;
 }

+static int b64_write_buffer(BIO *b, BIO *next, unsigned char *buf,
+    size_t *buf_len, size_t *buf_off)
+{
+    size_t n;
+    int i, dlen;
+
+    if (!ossl_assert(*buf_len >= *buf_off)) {
+        ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+        return -1;
+    }
+
+    n = *buf_len - *buf_off;
+    if (n > 0 && !ossl_assert(buf != NULL)) {
+        ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+        return -1;
+    }
+    while (n > 0) {
+        if (n > INT_MAX)
+            dlen = INT_MAX;
+        else
+            dlen = (int)n;
+        i = BIO_write(next, &(buf[*buf_off]), dlen);
+        if (i <= 0) {
+            BIO_copy_next_retry(b);
+            return i;
+        }
+        if (!ossl_assert((size_t)i <= n)) {
+            ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+            return -1;
+        }
+        *buf_off += (size_t)i;
+        n -= (size_t)i;
+    }
+    *buf_off = 0;
+    *buf_len = 0;
+
+    return 1;
+}
+
+static int b64_write_buffer_int(BIO *b, BIO *next, unsigned char *buf,
+    int *buf_len, int *buf_off)
+{
+    int ret;
+    size_t len;
+    size_t off;
+
+    if (!ossl_assert(*buf_off >= 0)) {
+        ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+        return -1;
+    }
+
+    len = (size_t)*buf_len;
+    off = (size_t)*buf_off;
+    ret = b64_write_buffer(b, next, buf, &len, &off);
+
+    *buf_len = (int)len;
+    *buf_off = (int)off;
+    return ret;
+}
+
+static int b64_write_pending(BIO_B64_CTX *ctx)
+{
+    return ctx->encoded_len != ctx->encoded_off
+        || ctx->buf_len != ctx->buf_off;
+}
+
 /*
  * Unless `BIO_FLAGS_BASE64_NO_NL` is set, this BIO ignores leading lines that
  * aren't exclusively composed of valid Base64 characters (followed by <CRLF>
@@ -133,16 +209,24 @@ static int b64_read(BIO *b, char *out, int outl)
         ctx->buf_len = 0;
         ctx->buf_off = 0;
         ctx->tmp_len = 0;
+        ctx->encoded_len = 0;
+        ctx->encoded_off = 0;
         EVP_DecodeInit(ctx->base64);
     }

     /* First check if there are buffered bytes already decoded */
     if (ctx->buf_len > 0) {
-        OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
+        if (!ossl_assert(ctx->buf_len >= ctx->buf_off)) {
+            ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+            return -1;
+        }
         i = ctx->buf_len - ctx->buf_off;
         if (i > outl)
             i = outl;
-        OPENSSL_assert(ctx->buf_off + i < (int)sizeof(ctx->buf));
+        if (!ossl_assert(ctx->buf_off + i < (int)sizeof(ctx->buf))) {
+            ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+            return -1;
+        }
         memcpy(out, &(ctx->buf[ctx->buf_off]), i);
         ret = i;
         out += i;
@@ -218,7 +302,7 @@ static int b64_read(BIO *b, char *out, int outl)
                     continue;
                 }

-                k = EVP_DecodeUpdate(ctx->base64, ctx->buf, &num, p, q - p);
+                k = EVP_DecodeUpdate(ctx->base64, ctx->buf, &num, p, (int)(q - p));
                 EVP_DecodeInit(ctx->base64);
                 if (k <= 0 && num == 0) {
                     p = q;
@@ -227,7 +311,7 @@ static int b64_read(BIO *b, char *out, int outl)

                 ctx->start = 0;
                 if (p != ctx->tmp) {
-                    i -= p - ctx->tmp;
+                    i -= (int)(p - ctx->tmp);
                     for (x = 0; x < i; x++)
                         ctx->tmp[x] = p[x];
                 }
@@ -248,7 +332,7 @@ static int b64_read(BIO *b, char *out, int outl)
                     }
                 } else if (p != q) {
                     /* Retain partial line at end of buffer */
-                    n = q - p;
+                    n = (int)(q - p);
                     for (ii = 0; ii < n; ii++)
                         ctx->tmp[ii] = p[ii];
                     ctx->tmp_len = n;
@@ -309,7 +393,6 @@ static int b64_read(BIO *b, char *out, int outl)
         outl -= i;
         out += i;
     }
-    /* BIO_clear_retry_flags(b); */
     BIO_copy_next_retry(b);
     return ret == 0 ? ret_code : ret;
 }
@@ -317,10 +400,12 @@ static int b64_read(BIO *b, char *out, int outl)
 static int b64_write(BIO *b, const char *in, int inl)
 {
     int ret = 0;
-    int n;
     int i;
     BIO_B64_CTX *ctx;
     BIO *next;
+    size_t encoded_length;
+    unsigned char *encoded;
+    int n_bytes_enc;

     ctx = (BIO_B64_CTX *)BIO_get_data(b);
     next = BIO_next(b);
@@ -334,98 +419,91 @@ static int b64_write(BIO *b, const char *in, int inl)
         ctx->buf_len = 0;
         ctx->buf_off = 0;
         ctx->tmp_len = 0;
+        ctx->encoded_len = 0;
+        ctx->encoded_off = 0;
         EVP_EncodeInit(ctx->base64);
+        if (BIO_get_flags(b) & BIO_FLAGS_BASE64_NO_NL)
+            evp_encode_ctx_set_flags(ctx->base64, EVP_ENCODE_CTX_NO_NEWLINES);
+    }
+    if (!ossl_assert(ctx->buf_off < (int)sizeof(ctx->buf))) {
+        ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+        return -1;
+    }
+    if (!ossl_assert(ctx->buf_len <= (int)sizeof(ctx->buf))) {
+        ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+        return -1;
+    }
+    if (!ossl_assert(ctx->buf_len >= ctx->buf_off)) {
+        ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+        return -1;
+    }
+    if (!ossl_assert(ctx->encoded_len >= ctx->encoded_off)) {
+        ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+        return -1;
+    }
+    if (!ossl_assert(ctx->encoded_len <= ctx->encoded_buf_len)) {
+        ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+        return -1;
     }

-    OPENSSL_assert(ctx->buf_off < (int)sizeof(ctx->buf));
-    OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
-    OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
-    n = ctx->buf_len - ctx->buf_off;
-    while (n > 0) {
-        i = BIO_write(next, &(ctx->buf[ctx->buf_off]), n);
-        if (i <= 0) {
-            BIO_copy_next_retry(b);
-            return i;
-        }
-        OPENSSL_assert(i <= n);
-        ctx->buf_off += i;
-        OPENSSL_assert(ctx->buf_off <= (int)sizeof(ctx->buf));
-        OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
-        n -= i;
+    i = b64_write_buffer(b, next, ctx->encoded_buf, &ctx->encoded_len,
+        &ctx->encoded_off);
+    if (i <= 0)
+        return i;
+    i = b64_write_buffer_int(b, next, ctx->buf, &ctx->buf_len, &ctx->buf_off);
+    if (i <= 0)
+        return i;
+    if (!ossl_assert(ctx->buf_off <= (int)sizeof(ctx->buf))) {
+        ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+        return -1;
     }
-    /* at this point all pending data has been written */
-    ctx->buf_off = 0;
-    ctx->buf_len = 0;

     if (in == NULL || inl <= 0)
         return 0;

-    while (inl > 0) {
-        n = inl > B64_BLOCK_SIZE ? B64_BLOCK_SIZE : inl;
+    encoded_length = EVP_ENCODE_LENGTH(inl);

-        if ((BIO_get_flags(b) & BIO_FLAGS_BASE64_NO_NL) != 0) {
-            if (ctx->tmp_len > 0) {
-                OPENSSL_assert(ctx->tmp_len <= 3);
-                n = 3 - ctx->tmp_len;
-                /*
-                 * There's a theoretical possibility for this
-                 */
-                if (n > inl)
-                    n = inl;
-                memcpy(&(ctx->tmp[ctx->tmp_len]), in, n);
-                ctx->tmp_len += n;
-                ret += n;
-                if (ctx->tmp_len < 3)
-                    break;
-                ctx->buf_len = EVP_EncodeBlock(ctx->buf, ctx->tmp, ctx->tmp_len);
-                OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
-                OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
-                /*
-                 * Since we're now done using the temporary buffer, the
-                 * length should be 0'd
-                 */
-                ctx->tmp_len = 0;
-            } else {
-                if (n < 3) {
-                    memcpy(ctx->tmp, in, n);
-                    ctx->tmp_len = n;
-                    ret += n;
-                    break;
-                }
-                n -= n % 3;
-                ctx->buf_len = EVP_EncodeBlock(ctx->buf, (unsigned char *)in, n);
-                OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
-                OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
-                ret += n;
-            }
-        } else {
-            if (!EVP_EncodeUpdate(ctx->base64, ctx->buf, &ctx->buf_len,
-                    (unsigned char *)in, n))
-                return ret == 0 ? -1 : ret;
-            OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
-            OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
-            ret += n;
-        }
-        inl -= n;
-        in += n;
+    if (encoded_length > SIZE_MAX / 2) {
+        ERR_raise(ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG);
+        return -1;
+    }

-        ctx->buf_off = 0;
-        n = ctx->buf_len;
-        while (n > 0) {
-            i = BIO_write(next, &(ctx->buf[ctx->buf_off]), n);
-            if (i <= 0) {
-                BIO_copy_next_retry(b);
-                return ret == 0 ? i : ret;
-            }
-            OPENSSL_assert(i <= n);
-            n -= i;
-            ctx->buf_off += i;
-            OPENSSL_assert(ctx->buf_off <= (int)sizeof(ctx->buf));
-            OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
+    if (ctx->encoded_buf == NULL || encoded_length > ctx->encoded_buf_len) {
+        OPENSSL_free(ctx->encoded_buf);
+        ctx->encoded_buf = NULL;
+        ctx->encoded_buf_len = 0;
+        ctx->encoded_buf = OPENSSL_malloc(encoded_length);
+        if (ctx->encoded_buf == NULL) {
+            ERR_raise(ERR_LIB_BIO, ERR_R_MALLOC_FAILURE);
+            return -1;
         }
-        ctx->buf_len = 0;
-        ctx->buf_off = 0;
+        ctx->encoded_buf_len = encoded_length;
     }
+
+    encoded = ctx->encoded_buf;
+
+    if (encoded == NULL) {
+        ERR_raise(ERR_LIB_BIO, ERR_R_MALLOC_FAILURE);
+        return -1;
+    }
+    n_bytes_enc = 0;
+    if (!EVP_EncodeUpdate(ctx->base64, encoded, &n_bytes_enc,
+            (unsigned char *)in, inl)) {
+        return -1;
+    }
+    /*
+     * The encoder state has consumed the input.  Keep any unwritten encoded
+     * output pending so a later retry or flush can complete it.
+     */
+    ret += inl;
+    ctx->encoded_len = (size_t)n_bytes_enc;
+    ctx->encoded_off = 0;
+    /*
+     * Try to write it now, but the input is consumed into encoder state, so
+     * report it as written even if downstream cannot accept all encoded output.
+     */
+    (void)b64_write_buffer(b, next, ctx->encoded_buf, &ctx->encoded_len,
+        &ctx->encoded_off);
     return ret;
 }

@@ -438,14 +516,20 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)

     ctx = (BIO_B64_CTX *)BIO_get_data(b);
     next = BIO_next(b);
+    /*
+     * If there is no ctx or no next BIO, BIO_read() returns 0, which means EOF.
+     * BIO_eof() should return 1 in this case.
+     */
     if (ctx == NULL || next == NULL)
-        return 0;
+        return cmd == BIO_CTRL_EOF;

     switch (cmd) {
     case BIO_CTRL_RESET:
         ctx->cont = 1;
         ctx->start = 1;
         ctx->encode = B64_NONE;
+        ctx->encoded_len = 0;
+        ctx->encoded_off = 0;
         ret = BIO_ctrl(next, cmd, num, ptr);
         break;
     case BIO_CTRL_EOF: /* More to read */
@@ -455,8 +539,16 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)
             ret = BIO_ctrl(next, cmd, num, ptr);
         break;
     case BIO_CTRL_WPENDING: /* More to write in buffer */
-        OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
-        ret = ctx->buf_len - ctx->buf_off;
+        if (!ossl_assert(ctx->encoded_len >= ctx->encoded_off)) {
+            ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+            return -1;
+        }
+        if (!ossl_assert(ctx->buf_len >= ctx->buf_off)) {
+            ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+            return -1;
+        }
+        ret = (long)(ctx->encoded_len - ctx->encoded_off)
+            + (ctx->buf_len - ctx->buf_off);
         if (ret == 0 && ctx->encode != B64_NONE
             && EVP_ENCODE_CTX_num(ctx->base64) != 0)
             ret = 1;
@@ -464,35 +556,32 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)
             ret = BIO_ctrl(next, cmd, num, ptr);
         break;
     case BIO_CTRL_PENDING: /* More to read in buffer */
-        OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
+        if (!ossl_assert(ctx->buf_len >= ctx->buf_off)) {
+            ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
+            return -1;
+        }
         ret = ctx->buf_len - ctx->buf_off;
         if (ret <= 0)
             ret = BIO_ctrl(next, cmd, num, ptr);
         break;
     case BIO_CTRL_FLUSH:
-        /* do a final write */
-    again:
-        while (ctx->buf_len != ctx->buf_off) {
-            i = b64_write(b, NULL, 0);
-            if (i < 0)
-                return i;
-        }
-        if (BIO_get_flags(b) & BIO_FLAGS_BASE64_NO_NL) {
-            if (ctx->tmp_len != 0) {
-                ctx->buf_len = EVP_EncodeBlock(ctx->buf,
-                    ctx->tmp, ctx->tmp_len);
+        if (ctx->encode == B64_ENCODE) {
+            /* do a final write */
+        again:
+            while (b64_write_pending(ctx)) {
+                i = b64_write(b, NULL, 0);
+                if (i < 0 || (i == 0 && b64_write_pending(ctx)))
+                    return i;
+            }
+            if (EVP_ENCODE_CTX_num(ctx->base64) != 0) {
                 ctx->buf_off = 0;
-                ctx->tmp_len = 0;
+                EVP_EncodeFinal(ctx->base64, ctx->buf, &(ctx->buf_len));
+                /* push out the bytes */
                 goto again;
             }
-        } else if (ctx->encode != B64_NONE
-            && EVP_ENCODE_CTX_num(ctx->base64) != 0) {
-            ctx->buf_off = 0;
-            EVP_EncodeFinal(ctx->base64, ctx->buf, &(ctx->buf_len));
-            /* push out the bytes */
-            goto again;
         }
         /* Finally flush the underlying BIO */
+        BIO_clear_retry_flags(b);
         ret = BIO_ctrl(next, cmd, num, ptr);
         BIO_copy_next_retry(b);
         break;
@@ -527,5 +616,9 @@ static long b64_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)

 static int b64_puts(BIO *b, const char *str)
 {
-    return b64_write(b, str, strlen(str));
+    size_t len = strlen(str);
+
+    if (len > INT_MAX)
+        return -1;
+    return b64_write(b, str, (int)len);
 }
diff --git a/deps/openssl/openssl/crypto/evp/bio_enc.c b/deps/openssl/openssl/crypto/evp/bio_enc.c
index 4ffa366cb68..4b12e49359f 100644
--- a/deps/openssl/openssl/crypto/evp/bio_enc.c
+++ b/deps/openssl/openssl/crypto/evp/bio_enc.c
@@ -22,7 +22,12 @@ static long enc_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int enc_new(BIO *h);
 static int enc_free(BIO *data);
 static long enc_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fps);
-#define ENC_BLOCK_SIZE (1024 * 4)
+/*
+ * ENC_BLOCK_SIZE has been sized to handle ciphers that do not support streaming.
+ * i.e. For AES Key wrapping of larger PQ private keys the buffer needs to be
+ * large enough to process the input/output in one EVP_CipherUpdate() call.
+ */
+#define ENC_BLOCK_SIZE (1024 * 8)
 #define ENC_MIN_CHUNK (256)
 #define BUF_OFFSET (ENC_MIN_CHUNK + EVP_MAX_BLOCK_LENGTH)

@@ -154,7 +159,7 @@ static int enc_read(BIO *b, char *out, int outl)
             if (i > 0)
                 ctx->read_end += i;
         } else {
-            i = ctx->read_end - ctx->read_start;
+            i = (int)(ctx->read_end - ctx->read_start);
         }

         if (i <= 0) {
@@ -306,8 +311,12 @@ static long enc_ctrl(BIO *b, int cmd, long num, void *ptr)

     ctx = BIO_get_data(b);
     next = BIO_next(b);
+    /*
+     * If there is no ctx, BIO_read() returns 0, which means EOF.
+     * BIO_eof() should return 1 in this case.
+     */
     if (ctx == NULL)
-        return 0;
+        return cmd == BIO_CTRL_EOF;

     switch (cmd) {
     case BIO_CTRL_RESET:
@@ -322,7 +331,11 @@ static long enc_ctrl(BIO *b, int cmd, long num, void *ptr)
         if (ctx->cont <= 0)
             ret = 1;
         else
-            ret = BIO_ctrl(next, cmd, num, ptr);
+            /*
+             * If there is no next BIO, BIO_read() returns 0, which means EOF.
+             * BIO_eof() should return 1 in this case.
+             */
+            ret = (next == NULL) ? 1 : BIO_ctrl(next, cmd, num, ptr);
         break;
     case BIO_CTRL_WPENDING:
         ret = ctx->buf_len - ctx->buf_off;
diff --git a/deps/openssl/openssl/crypto/evp/bio_md.c b/deps/openssl/openssl/crypto/evp/bio_md.c
index a2d9afcf0e1..b003e47e123 100644
--- a/deps/openssl/openssl/crypto/evp/bio_md.c
+++ b/deps/openssl/openssl/crypto/evp/bio_md.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -167,12 +167,22 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr)
         else
             ret = 0;
         break;
+    case BIO_CTRL_EOF:
+        /*
+         * If there is no ctx or no next BIO, BIO_read() returns 0, which means
+         * EOF, BIO_eof() should return 1 in this case.
+         */
+        if (ctx == NULL || next == NULL)
+            ret = 1;
+        else
+            ret = BIO_ctrl(next, cmd, num, ptr);
+        break;
+    case BIO_CTRL_FLUSH:
     case BIO_C_DO_STATE_MACHINE:
         BIO_clear_retry_flags(b);
         ret = BIO_ctrl(next, cmd, num, ptr);
         BIO_copy_next_retry(b);
         break;
-
     case BIO_C_SET_MD:
         md = ptr;
         ret = EVP_DigestInit_ex(ctx, md, NULL);
diff --git a/deps/openssl/openssl/crypto/evp/bio_ok.c b/deps/openssl/openssl/crypto/evp/bio_ok.c
deleted file mode 100644
index 41cadea1cc3..00000000000
--- a/deps/openssl/openssl/crypto/evp/bio_ok.c
+++ /dev/null
@@ -1,606 +0,0 @@
-/*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
-        From: Arne Ansper
-
-        Why BIO_f_reliable?
-
-        I wrote function which took BIO* as argument, read data from it
-        and processed it. Then I wanted to store the input file in
-        encrypted form. OK I pushed BIO_f_cipher to the BIO stack
-        and everything was OK. BUT if user types wrong password
-        BIO_f_cipher outputs only garbage and my function crashes. Yes
-        I can and I should fix my function, but BIO_f_cipher is
-        easy way to add encryption support to many existing applications
-        and it's hard to debug and fix them all.
-
-        So I wanted another BIO which would catch the incorrect passwords and
-        file damages which cause garbage on BIO_f_cipher's output.
-
-        The easy way is to push the BIO_f_md and save the checksum at
-        the end of the file. However there are several problems with this
-        approach:
-
-        1) you must somehow separate checksum from actual data.
-        2) you need lot's of memory when reading the file, because you
-        must read to the end of the file and verify the checksum before
-        letting the application to read the data.
-
-        BIO_f_reliable tries to solve both problems, so that you can
-        read and write arbitrary long streams using only fixed amount
-        of memory.
-
-        BIO_f_reliable splits data stream into blocks. Each block is prefixed
-        with its length and suffixed with its digest. So you need only
-        several Kbytes of memory to buffer single block before verifying
-        its digest.
-
-        BIO_f_reliable goes further and adds several important capabilities:
-
-        1) the digest of the block is computed over the whole stream
-        -- so nobody can rearrange the blocks or remove or replace them.
-
-        2) to detect invalid passwords right at the start BIO_f_reliable
-        adds special prefix to the stream. In order to avoid known plain-text
-        attacks this prefix is generated as follows:
-
-                *) digest is initialized with random seed instead of
-                standardized one.
-                *) same seed is written to output
-                *) well-known text is then hashed and the output
-                of the digest is also written to output.
-
-        reader can now read the seed from stream, hash the same string
-        and then compare the digest output.
-
-        Bad things: BIO_f_reliable knows what's going on in EVP_Digest. I
-        initially wrote and tested this code on x86 machine and wrote the
-        digests out in machine-dependent order :( There are people using
-        this code and I cannot change this easily without making existing
-        data files unreadable.
-
-*/
-
-#include <stdio.h>
-#include <errno.h>
-#include <assert.h>
-#include "internal/cryptlib.h"
-#include <openssl/buffer.h>
-#include "internal/bio.h"
-#include <openssl/evp.h>
-#include <openssl/rand.h>
-#include "internal/endian.h"
-#include "internal/numbers.h" /* includes SIZE_MAX */
-#include "crypto/evp.h"
-
-static int ok_write(BIO *h, const char *buf, int num);
-static int ok_read(BIO *h, char *buf, int size);
-static long ok_ctrl(BIO *h, int cmd, long arg1, void *arg2);
-static int ok_new(BIO *h);
-static int ok_free(BIO *data);
-static long ok_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
-
-static __owur int sig_out(BIO *b);
-static __owur int sig_in(BIO *b);
-static __owur int block_out(BIO *b);
-static __owur int block_in(BIO *b);
-#define OK_BLOCK_SIZE (1024 * 4)
-#define OK_BLOCK_BLOCK 4
-#define IOBS (OK_BLOCK_SIZE + OK_BLOCK_BLOCK + 3 * EVP_MAX_MD_SIZE)
-#define WELLKNOWN "The quick brown fox jumped over the lazy dog's back."
-
-typedef struct ok_struct {
-    size_t buf_len;
-    size_t buf_off;
-    size_t buf_len_save;
-    size_t buf_off_save;
-    int cont; /* <= 0 when finished */
-    int finished;
-    EVP_MD_CTX *md;
-    int blockout; /* output block is ready */
-    int sigio; /* must process signature */
-    unsigned char buf[IOBS];
-} BIO_OK_CTX;
-
-static const BIO_METHOD methods_ok = {
-    BIO_TYPE_CIPHER,
-    "reliable",
-    bwrite_conv,
-    ok_write,
-    bread_conv,
-    ok_read,
-    NULL, /* ok_puts, */
-    NULL, /* ok_gets, */
-    ok_ctrl,
-    ok_new,
-    ok_free,
-    ok_callback_ctrl,
-};
-
-const BIO_METHOD *BIO_f_reliable(void)
-{
-    return &methods_ok;
-}
-
-static int ok_new(BIO *bi)
-{
-    BIO_OK_CTX *ctx;
-
-    if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL)
-        return 0;
-
-    ctx->cont = 1;
-    ctx->sigio = 1;
-    ctx->md = EVP_MD_CTX_new();
-    if (ctx->md == NULL) {
-        OPENSSL_free(ctx);
-        return 0;
-    }
-    BIO_set_init(bi, 0);
-    BIO_set_data(bi, ctx);
-
-    return 1;
-}
-
-static int ok_free(BIO *a)
-{
-    BIO_OK_CTX *ctx;
-
-    if (a == NULL)
-        return 0;
-
-    ctx = BIO_get_data(a);
-
-    EVP_MD_CTX_free(ctx->md);
-    OPENSSL_clear_free(ctx, sizeof(BIO_OK_CTX));
-    BIO_set_data(a, NULL);
-    BIO_set_init(a, 0);
-
-    return 1;
-}
-
-static int ok_read(BIO *b, char *out, int outl)
-{
-    int ret = 0, i, n;
-    BIO_OK_CTX *ctx;
-    BIO *next;
-
-    if (out == NULL)
-        return 0;
-
-    ctx = BIO_get_data(b);
-    next = BIO_next(b);
-
-    if ((ctx == NULL) || (next == NULL) || (BIO_get_init(b) == 0))
-        return 0;
-
-    while (outl > 0) {
-
-        /* copy clean bytes to output buffer */
-        if (ctx->blockout) {
-            i = ctx->buf_len - ctx->buf_off;
-            if (i > outl)
-                i = outl;
-            memcpy(out, &(ctx->buf[ctx->buf_off]), i);
-            ret += i;
-            out += i;
-            outl -= i;
-            ctx->buf_off += i;
-
-            /* all clean bytes are out */
-            if (ctx->buf_len == ctx->buf_off) {
-                ctx->buf_off = 0;
-
-                /*
-                 * copy start of the next block into proper place
-                 */
-                if (ctx->buf_len_save > ctx->buf_off_save) {
-                    ctx->buf_len = ctx->buf_len_save - ctx->buf_off_save;
-                    memmove(ctx->buf, &(ctx->buf[ctx->buf_off_save]),
-                        ctx->buf_len);
-                } else {
-                    ctx->buf_len = 0;
-                }
-                ctx->blockout = 0;
-            }
-        }
-
-        /* output buffer full -- cancel */
-        if (outl == 0)
-            break;
-
-        /* no clean bytes in buffer -- fill it */
-        n = IOBS - ctx->buf_len;
-        i = BIO_read(next, &(ctx->buf[ctx->buf_len]), n);
-
-        if (i <= 0)
-            break; /* nothing new */
-
-        ctx->buf_len += i;
-
-        /* no signature yet -- check if we got one */
-        if (ctx->sigio == 1) {
-            if (!sig_in(b)) {
-                BIO_clear_retry_flags(b);
-                return 0;
-            }
-        }
-
-        /* signature ok -- check if we got block */
-        if (ctx->sigio == 0) {
-            if (!block_in(b)) {
-                BIO_clear_retry_flags(b);
-                return 0;
-            }
-        }
-
-        /* invalid block -- cancel */
-        if (ctx->cont <= 0)
-            break;
-    }
-
-    BIO_clear_retry_flags(b);
-    BIO_copy_next_retry(b);
-    return ret;
-}
-
-static int ok_write(BIO *b, const char *in, int inl)
-{
-    int ret = 0, n, i;
-    BIO_OK_CTX *ctx;
-    BIO *next;
-
-    if (inl <= 0)
-        return inl;
-
-    ctx = BIO_get_data(b);
-    next = BIO_next(b);
-    ret = inl;
-
-    if ((ctx == NULL) || (next == NULL) || (BIO_get_init(b) == 0))
-        return 0;
-
-    if (ctx->sigio && !sig_out(b))
-        return 0;
-
-    do {
-        BIO_clear_retry_flags(b);
-        n = ctx->buf_len - ctx->buf_off;
-        while (ctx->blockout && n > 0) {
-            i = BIO_write(next, &(ctx->buf[ctx->buf_off]), n);
-            if (i <= 0) {
-                BIO_copy_next_retry(b);
-                if (!BIO_should_retry(b))
-                    ctx->cont = 0;
-                return i;
-            }
-            ctx->buf_off += i;
-            n -= i;
-        }
-
-        /* at this point all pending data has been written */
-        ctx->blockout = 0;
-        if (ctx->buf_len == ctx->buf_off) {
-            ctx->buf_len = OK_BLOCK_BLOCK;
-            ctx->buf_off = 0;
-        }
-
-        if ((in == NULL) || (inl <= 0))
-            return 0;
-
-        n = (inl + ctx->buf_len > OK_BLOCK_SIZE + OK_BLOCK_BLOCK) ? (int)(OK_BLOCK_SIZE + OK_BLOCK_BLOCK - ctx->buf_len) : inl;
-
-        memcpy(&ctx->buf[ctx->buf_len], in, n);
-        ctx->buf_len += n;
-        inl -= n;
-        in += n;
-
-        if (ctx->buf_len >= OK_BLOCK_SIZE + OK_BLOCK_BLOCK) {
-            if (!block_out(b)) {
-                BIO_clear_retry_flags(b);
-                return 0;
-            }
-        }
-    } while (inl > 0);
-
-    BIO_clear_retry_flags(b);
-    BIO_copy_next_retry(b);
-    return ret;
-}
-
-static long ok_ctrl(BIO *b, int cmd, long num, void *ptr)
-{
-    BIO_OK_CTX *ctx;
-    EVP_MD *md;
-    const EVP_MD **ppmd;
-    long ret = 1;
-    int i;
-    BIO *next;
-
-    ctx = BIO_get_data(b);
-    next = BIO_next(b);
-
-    switch (cmd) {
-    case BIO_CTRL_RESET:
-        ctx->buf_len = 0;
-        ctx->buf_off = 0;
-        ctx->buf_len_save = 0;
-        ctx->buf_off_save = 0;
-        ctx->cont = 1;
-        ctx->finished = 0;
-        ctx->blockout = 0;
-        ctx->sigio = 1;
-        ret = BIO_ctrl(next, cmd, num, ptr);
-        break;
-    case BIO_CTRL_EOF: /* More to read */
-        if (ctx->cont <= 0)
-            ret = 1;
-        else
-            ret = BIO_ctrl(next, cmd, num, ptr);
-        break;
-    case BIO_CTRL_PENDING: /* More to read in buffer */
-    case BIO_CTRL_WPENDING: /* More to read in buffer */
-        ret = ctx->blockout ? ctx->buf_len - ctx->buf_off : 0;
-        if (ret <= 0)
-            ret = BIO_ctrl(next, cmd, num, ptr);
-        break;
-    case BIO_CTRL_FLUSH:
-        /* do a final write */
-        if (ctx->blockout == 0)
-            if (!block_out(b))
-                return 0;
-
-        while (ctx->blockout) {
-            i = ok_write(b, NULL, 0);
-            if (i < 0) {
-                ret = i;
-                break;
-            }
-        }
-
-        ctx->finished = 1;
-        ctx->buf_off = ctx->buf_len = 0;
-        ctx->cont = (int)ret;
-
-        /* Finally flush the underlying BIO */
-        ret = BIO_ctrl(next, cmd, num, ptr);
-        BIO_copy_next_retry(b);
-        break;
-    case BIO_C_DO_STATE_MACHINE:
-        BIO_clear_retry_flags(b);
-        ret = BIO_ctrl(next, cmd, num, ptr);
-        BIO_copy_next_retry(b);
-        break;
-    case BIO_CTRL_INFO:
-        ret = (long)ctx->cont;
-        break;
-    case BIO_C_SET_MD:
-        md = ptr;
-        if (!EVP_DigestInit_ex(ctx->md, md, NULL))
-            return 0;
-        BIO_set_init(b, 1);
-        break;
-    case BIO_C_GET_MD:
-        if (BIO_get_init(b)) {
-            ppmd = ptr;
-            *ppmd = EVP_MD_CTX_get0_md(ctx->md);
-        } else
-            ret = 0;
-        break;
-    default:
-        ret = BIO_ctrl(next, cmd, num, ptr);
-        break;
-    }
-    return ret;
-}
-
-static long ok_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
-{
-    BIO *next;
-
-    next = BIO_next(b);
-
-    if (next == NULL)
-        return 0;
-
-    return BIO_callback_ctrl(next, cmd, fp);
-}
-
-static void longswap(void *_ptr, size_t len)
-{
-    DECLARE_IS_ENDIAN;
-
-    if (IS_LITTLE_ENDIAN) {
-        size_t i;
-        unsigned char *p = _ptr, c;
-
-        for (i = 0; i < len; i += 4) {
-            c = p[0], p[0] = p[3], p[3] = c;
-            c = p[1], p[1] = p[2], p[2] = c;
-        }
-    }
-}
-
-static int sig_out(BIO *b)
-{
-    BIO_OK_CTX *ctx;
-    EVP_MD_CTX *md;
-    const EVP_MD *digest;
-    int md_size;
-    void *md_data;
-
-    ctx = BIO_get_data(b);
-    md = ctx->md;
-    digest = EVP_MD_CTX_get0_md(md);
-    md_size = EVP_MD_get_size(digest);
-    md_data = EVP_MD_CTX_get0_md_data(md);
-
-    if (md_size <= 0)
-        goto berr;
-    if (ctx->buf_len + 2 * md_size > OK_BLOCK_SIZE)
-        return 1;
-
-    if (!EVP_DigestInit_ex(md, digest, NULL))
-        goto berr;
-    /*
-     * FIXME: there's absolutely no guarantee this makes any sense at all,
-     * particularly now EVP_MD_CTX has been restructured.
-     */
-    if (RAND_bytes(md_data, md_size) <= 0)
-        goto berr;
-    memcpy(&(ctx->buf[ctx->buf_len]), md_data, md_size);
-    longswap(&(ctx->buf[ctx->buf_len]), md_size);
-    ctx->buf_len += md_size;
-
-    if (!EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN)))
-        goto berr;
-    if (!EVP_DigestFinal_ex(md, &(ctx->buf[ctx->buf_len]), NULL))
-        goto berr;
-    ctx->buf_len += md_size;
-    ctx->blockout = 1;
-    ctx->sigio = 0;
-    return 1;
-berr:
-    BIO_clear_retry_flags(b);
-    return 0;
-}
-
-static int sig_in(BIO *b)
-{
-    BIO_OK_CTX *ctx;
-    EVP_MD_CTX *md;
-    unsigned char tmp[EVP_MAX_MD_SIZE];
-    int ret = 0;
-    const EVP_MD *digest;
-    int md_size;
-    void *md_data;
-
-    ctx = BIO_get_data(b);
-    if ((md = ctx->md) == NULL)
-        goto berr;
-    digest = EVP_MD_CTX_get0_md(md);
-    if ((md_size = EVP_MD_get_size(digest)) <= 0)
-        goto berr;
-    md_data = EVP_MD_CTX_get0_md_data(md);
-
-    if ((int)(ctx->buf_len - ctx->buf_off) < 2 * md_size)
-        return 1;
-
-    if (!EVP_DigestInit_ex(md, digest, NULL))
-        goto berr;
-    memcpy(md_data, &(ctx->buf[ctx->buf_off]), md_size);
-    longswap(md_data, md_size);
-    ctx->buf_off += md_size;
-
-    if (!EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN)))
-        goto berr;
-    if (!EVP_DigestFinal_ex(md, tmp, NULL))
-        goto berr;
-    ret = memcmp(&(ctx->buf[ctx->buf_off]), tmp, md_size) == 0;
-    ctx->buf_off += md_size;
-    if (ret == 1) {
-        ctx->sigio = 0;
-        if (ctx->buf_len != ctx->buf_off) {
-            memmove(ctx->buf, &(ctx->buf[ctx->buf_off]),
-                ctx->buf_len - ctx->buf_off);
-        }
-        ctx->buf_len -= ctx->buf_off;
-        ctx->buf_off = 0;
-    } else {
-        ctx->cont = 0;
-    }
-    return 1;
-berr:
-    BIO_clear_retry_flags(b);
-    return 0;
-}
-
-static int block_out(BIO *b)
-{
-    BIO_OK_CTX *ctx;
-    EVP_MD_CTX *md;
-    unsigned long tl;
-    const EVP_MD *digest;
-    int md_size;
-
-    ctx = BIO_get_data(b);
-    md = ctx->md;
-    digest = EVP_MD_CTX_get0_md(md);
-    md_size = EVP_MD_get_size(digest);
-    if (md_size <= 0)
-        goto berr;
-
-    tl = ctx->buf_len - OK_BLOCK_BLOCK;
-    ctx->buf[0] = (unsigned char)(tl >> 24);
-    ctx->buf[1] = (unsigned char)(tl >> 16);
-    ctx->buf[2] = (unsigned char)(tl >> 8);
-    ctx->buf[3] = (unsigned char)(tl);
-    if (!EVP_DigestUpdate(md,
-            (unsigned char *)&(ctx->buf[OK_BLOCK_BLOCK]), tl))
-        goto berr;
-    if (!EVP_DigestFinal_ex(md, &(ctx->buf[ctx->buf_len]), NULL))
-        goto berr;
-    ctx->buf_len += md_size;
-    ctx->blockout = 1;
-    return 1;
-berr:
-    BIO_clear_retry_flags(b);
-    return 0;
-}
-
-static int block_in(BIO *b)
-{
-    BIO_OK_CTX *ctx;
-    EVP_MD_CTX *md;
-    size_t tl = 0;
-    unsigned char tmp[EVP_MAX_MD_SIZE];
-    int md_size;
-
-    ctx = BIO_get_data(b);
-    md = ctx->md;
-    md_size = EVP_MD_get_size(EVP_MD_CTX_get0_md(md));
-    if (md_size <= 0)
-        goto berr;
-
-    assert(sizeof(tl) >= OK_BLOCK_BLOCK); /* always true */
-    tl = ((size_t)ctx->buf[0] << 24)
-        | ((size_t)ctx->buf[1] << 16)
-        | ((size_t)ctx->buf[2] << 8)
-        | ((size_t)ctx->buf[3]);
-
-    if (tl > OK_BLOCK_SIZE)
-        goto berr;
-
-    if (tl > SIZE_MAX - OK_BLOCK_BLOCK - (size_t)md_size)
-        goto berr;
-
-    if (ctx->buf_len < tl + OK_BLOCK_BLOCK + (size_t)md_size)
-        return 1;
-
-    if (!EVP_DigestUpdate(md,
-            (unsigned char *)&(ctx->buf[OK_BLOCK_BLOCK]), tl))
-        goto berr;
-    if (!EVP_DigestFinal_ex(md, tmp, NULL))
-        goto berr;
-    if (memcmp(&(ctx->buf[tl + OK_BLOCK_BLOCK]), tmp, (size_t)md_size) == 0) {
-        /* there might be parts from next block lurking around ! */
-        ctx->buf_off_save = tl + OK_BLOCK_BLOCK + md_size;
-        ctx->buf_len_save = ctx->buf_len;
-        ctx->buf_off = OK_BLOCK_BLOCK;
-        ctx->buf_len = tl + OK_BLOCK_BLOCK;
-        ctx->blockout = 1;
-    } else {
-        ctx->cont = 0;
-    }
-    return 1;
-berr:
-    BIO_clear_retry_flags(b);
-    return 0;
-}
diff --git a/deps/openssl/openssl/crypto/evp/build.info b/deps/openssl/openssl/crypto/evp/build.info
index 80570bdcce4..4849f3dfa18 100644
--- a/deps/openssl/openssl/crypto/evp/build.info
+++ b/deps/openssl/openssl/crypto/evp/build.info
@@ -2,22 +2,25 @@ LIBS=../../libcrypto
 $COMMON=digest.c evp_enc.c evp_lib.c evp_fetch.c evp_utils.c \
         mac_lib.c mac_meth.c keymgmt_meth.c keymgmt_lib.c kdf_lib.c kdf_meth.c \
         skeymgmt_meth.c \
-        pmeth_lib.c signature.c p_lib.c s_lib.c pmeth_gn.c exchange.c \
-        evp_rand.c asymcipher.c kem.c dh_support.c ec_support.c pmeth_check.c
+        pmeth_lib.c signature.c p_lib.c pmeth_gn.c exchange.c \
+        evp_rand.c asymcipher.c kem.c dh_support.c ec_support.c pmeth_check.c \
+        evp_pkey_type.c

 SOURCE[../../libcrypto]=$COMMON\
         encode.c evp_key.c evp_cnf.c \
+        enc_b64_scalar.c \
+        enc_b64_avx2.c \
         e_des.c e_bf.c e_idea.c e_des3.c \
         e_rc4.c e_aes.c names.c e_aria.c e_sm4.c \
         e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c m_null.c \
         p_seal.c p_sign.c p_verify.c p_legacy.c \
         bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c \
-        c_allc.c c_alld.c bio_ok.c \
+        c_allc.c c_alld.c \
         evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c pbe_scrypt.c \
         e_aes_cbc_hmac_sha1.c e_aes_cbc_hmac_sha256.c e_rc4_hmac_md5.c \
         e_chacha20_poly1305.c \
         legacy_sha.c ctrl_params_translate.c \
-        cmeth_lib.c m_sigver.c
+        m_sigver.c s_lib.c

 # Diverse type specific ctrl functions.  They are kinda sorta legacy, kinda
 # sorta not.
diff --git a/deps/openssl/openssl/crypto/evp/cmeth_lib.c b/deps/openssl/openssl/crypto/evp/cmeth_lib.c
deleted file mode 100644
index 5e71d0061cf..00000000000
--- a/deps/openssl/openssl/crypto/evp/cmeth_lib.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright 2015-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * EVP _meth_ APIs are deprecated for public use, but still ok for
- * internal use.
- */
-#include "internal/deprecated.h"
-
-#include <string.h>
-
-#include <openssl/evp.h>
-#include "crypto/evp.h"
-#include "internal/provider.h"
-#include "evp_local.h"
-
-EVP_CIPHER *EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len)
-{
-    EVP_CIPHER *cipher = evp_cipher_new();
-
-    if (cipher != NULL) {
-        cipher->nid = cipher_type;
-        cipher->block_size = block_size;
-        cipher->key_len = key_len;
-        cipher->origin = EVP_ORIG_METH;
-    }
-    return cipher;
-}
-
-EVP_CIPHER *EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher)
-{
-    EVP_CIPHER *to = NULL;
-
-    /*
-     * Non-legacy EVP_CIPHERs can't be duplicated like this.
-     * Use EVP_CIPHER_up_ref() instead.
-     */
-    if (cipher->prov != NULL)
-        return NULL;
-
-    if ((to = EVP_CIPHER_meth_new(cipher->nid, cipher->block_size,
-             cipher->key_len))
-        != NULL) {
-        CRYPTO_REF_COUNT refcnt = to->refcnt;
-
-        memcpy(to, cipher, sizeof(*to));
-        to->refcnt = refcnt;
-        to->origin = EVP_ORIG_METH;
-    }
-    return to;
-}
-
-void EVP_CIPHER_meth_free(EVP_CIPHER *cipher)
-{
-    if (cipher == NULL || cipher->origin != EVP_ORIG_METH)
-        return;
-
-    evp_cipher_free_int(cipher);
-}
-
-int EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher, int iv_len)
-{
-    if (cipher->iv_len != 0)
-        return 0;
-
-    cipher->iv_len = iv_len;
-    return 1;
-}
-
-int EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher, unsigned long flags)
-{
-    if (cipher->flags != 0)
-        return 0;
-
-    cipher->flags = flags;
-    return 1;
-}
-
-int EVP_CIPHER_meth_set_impl_ctx_size(EVP_CIPHER *cipher, int ctx_size)
-{
-    if (cipher->ctx_size != 0)
-        return 0;
-
-    cipher->ctx_size = ctx_size;
-    return 1;
-}
-
-int EVP_CIPHER_meth_set_init(EVP_CIPHER *cipher,
-    int (*init)(EVP_CIPHER_CTX *ctx,
-        const unsigned char *key,
-        const unsigned char *iv,
-        int enc))
-{
-    if (cipher->init != NULL)
-        return 0;
-
-    cipher->init = init;
-    return 1;
-}
-
-int EVP_CIPHER_meth_set_do_cipher(EVP_CIPHER *cipher,
-    int (*do_cipher)(EVP_CIPHER_CTX *ctx,
-        unsigned char *out,
-        const unsigned char *in,
-        size_t inl))
-{
-    if (cipher->do_cipher != NULL)
-        return 0;
-
-    cipher->do_cipher = do_cipher;
-    return 1;
-}
-
-int EVP_CIPHER_meth_set_cleanup(EVP_CIPHER *cipher,
-    int (*cleanup)(EVP_CIPHER_CTX *))
-{
-    if (cipher->cleanup != NULL)
-        return 0;
-
-    cipher->cleanup = cleanup;
-    return 1;
-}
-
-int EVP_CIPHER_meth_set_set_asn1_params(EVP_CIPHER *cipher,
-    int (*set_asn1_parameters)(EVP_CIPHER_CTX *,
-        ASN1_TYPE *))
-{
-    if (cipher->set_asn1_parameters != NULL)
-        return 0;
-
-    cipher->set_asn1_parameters = set_asn1_parameters;
-    return 1;
-}
-
-int EVP_CIPHER_meth_set_get_asn1_params(EVP_CIPHER *cipher,
-    int (*get_asn1_parameters)(EVP_CIPHER_CTX *,
-        ASN1_TYPE *))
-{
-    if (cipher->get_asn1_parameters != NULL)
-        return 0;
-
-    cipher->get_asn1_parameters = get_asn1_parameters;
-    return 1;
-}
-
-int EVP_CIPHER_meth_set_ctrl(EVP_CIPHER *cipher,
-    int (*ctrl)(EVP_CIPHER_CTX *, int type,
-        int arg, void *ptr))
-{
-    if (cipher->ctrl != NULL)
-        return 0;
-
-    cipher->ctrl = ctrl;
-    return 1;
-}
-
-int (*EVP_CIPHER_meth_get_init(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *iv,
-    int enc)
-{
-    return cipher->init;
-}
-int (*EVP_CIPHER_meth_get_do_cipher(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx,
-    unsigned char *out,
-    const unsigned char *in,
-    size_t inl)
-{
-    return cipher->do_cipher;
-}
-
-int (*EVP_CIPHER_meth_get_cleanup(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *)
-{
-    return cipher->cleanup;
-}
-
-int (*EVP_CIPHER_meth_get_set_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *,
-    ASN1_TYPE *)
-{
-    return cipher->set_asn1_parameters;
-}
-
-int (*EVP_CIPHER_meth_get_get_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *,
-    ASN1_TYPE *)
-{
-    return cipher->get_asn1_parameters;
-}
-
-int (*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *,
-    int type, int arg,
-    void *ptr)
-{
-    return cipher->ctrl;
-}
diff --git a/deps/openssl/openssl/crypto/evp/ctrl_params_translate.c b/deps/openssl/openssl/crypto/evp/ctrl_params_translate.c
index 388b5e0bdde..f605900cb57 100644
--- a/deps/openssl/openssl/crypto/evp/ctrl_params_translate.c
+++ b/deps/openssl/openssl/crypto/evp/ctrl_params_translate.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,6 +15,7 @@
  */
 #include "internal/deprecated.h"

+#include <stdio.h>
 #include <string.h>

 /* The following includes get us all the EVP_PKEY_CTRL macros */
@@ -474,7 +475,8 @@ static int default_fixup_args(enum state state,
                         == NULL)
                         return 0;
                     if (BN_bn2nativepad(ctx->p2,
-                            ctx->allocated_buf, ctx->buflen)
+                            ctx->allocated_buf,
+                            (int)ctx->buflen)
                         < 0) {
                         OPENSSL_free(ctx->allocated_buf);
                         ctx->allocated_buf = NULL;
@@ -776,10 +778,10 @@ static int fix_cipher_md(enum state state,
         ctx->p2 = (char *)(ctx->p2 == NULL
                 ? OBJ_nid2sn(ctx->p1)
                 : get_name(ctx->p2));
-        ctx->p1 = strlen(ctx->p2);
+        ctx->p1 = (int)strlen(ctx->p2);
     } else if (state == POST_PARAMS_TO_CTRL && ctx->action_type == OSSL_ACTION_GET) {
         ctx->p2 = (ctx->p2 == NULL ? "" : (char *)get_name(ctx->p2));
-        ctx->p1 = strlen(ctx->p2);
+        ctx->p1 = (int)strlen(ctx->p2);
     }

     if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
@@ -897,7 +899,7 @@ static int fix_kdf_type(enum state state,
             }
         if (ret <= 0)
             goto end;
-        ctx->p1 = strlen(ctx->p2);
+        ctx->p1 = (int)strlen(ctx->p2);
     }

     if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
@@ -1045,9 +1047,19 @@ static int fix_dh_nid5114(enum state state,
     case PRE_CTRL_STR_TO_PARAMS:
         if (ctx->p2 == NULL)
             return 0;
-        if ((ctx->p2 = (char *)ossl_ffc_named_group_get_name(ossl_ffc_uid_to_dh_named_group(atoi(ctx->p2)))) == NULL) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_VALUE);
-            return 0;
+        {
+            int uid;
+
+            if (!ossl_strtoint(ctx->p2, NULL, 10, &uid)) {
+                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_VALUE);
+                return 0;
+            }
+            ctx->p2 = (char *)ossl_ffc_named_group_get_name(
+                ossl_ffc_uid_to_dh_named_group(uid));
+            if (ctx->p2 == NULL) {
+                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_VALUE);
+                return 0;
+            }
         }

         ctx->p1 = 0;
@@ -1075,12 +1087,18 @@ static int fix_dh_paramgen_type(enum state state,
         return 0;

     if (state == PRE_CTRL_STR_TO_PARAMS) {
-        if ((ctx->p2 = (char *)ossl_dh_gen_type_id2name(atoi(ctx->p2)))
-            == NULL) {
+        int id;
+
+        if (!ossl_strtoint(ctx->p2, NULL, 10, &id)) {
+            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_VALUE);
+            return 0;
+        }
+        ctx->p2 = (char *)ossl_dh_gen_type_id2name(id);
+        if (ctx->p2 == NULL) {
             ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_VALUE);
             return 0;
         }
-        ctx->p1 = strlen(ctx->p2);
+        ctx->p1 = (int)strlen(ctx->p2);
     }

     return default_fixup_args(state, translation, ctx);
@@ -1337,7 +1355,7 @@ static int fix_rsa_padding_mode(enum state state,
             return -2;
         }
         ctx->p2 = str_value_map[i].ptr;
-        ctx->p1 = strlen(ctx->p2);
+        ctx->p1 = (int)strlen(ctx->p2);
     }

     if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
@@ -1409,14 +1427,14 @@ static int fix_rsa_pss_saltlen(enum state state,
                 break;
         }
         if (i == OSSL_NELEM(str_value_map)) {
-            BIO_snprintf(ctx->name_buf, sizeof(ctx->name_buf), "%d", ctx->p1);
+            snprintf(ctx->name_buf, sizeof(ctx->name_buf), "%d", ctx->p1);
         } else {
             /* This won't truncate but it will quiet static analysers */
             strncpy(ctx->name_buf, str_value_map[i].ptr, sizeof(ctx->name_buf) - 1);
             ctx->name_buf[sizeof(ctx->name_buf) - 1] = '\0';
         }
         ctx->p2 = ctx->name_buf;
-        ctx->p1 = strlen(ctx->p2);
+        ctx->p1 = (int)strlen(ctx->p2);
     }

     if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
@@ -1432,8 +1450,14 @@ static int fix_rsa_pss_saltlen(enum state state,
                 break;
         }

-        val = i == OSSL_NELEM(str_value_map) ? atoi(ctx->p2)
-                                             : (int)str_value_map[i].id;
+        if (i == OSSL_NELEM(str_value_map)) {
+            if (!ossl_strtoint(ctx->p2, NULL, 10, &val)) {
+                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_VALUE);
+                return 0;
+            }
+        } else {
+            val = (int)str_value_map[i].id;
+        }
         if (state == POST_CTRL_TO_PARAMS) {
             /*
              * EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN weirdness explained further
@@ -1475,7 +1499,7 @@ static int fix_hkdf_mode(enum state state,
         if (i == OSSL_NELEM(str_value_map))
             return 0;
         ctx->p2 = str_value_map[i].ptr;
-        ctx->p1 = strlen(ctx->p2);
+        ctx->p1 = (int)strlen(ctx->p2);
     }

     if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
@@ -1554,7 +1578,7 @@ static int get_payload_group_name(enum state state,
     if (ctx->p2 == NULL)
         return 1;

-    ctx->p1 = strlen(ctx->p2);
+    ctx->p1 = (int)strlen(ctx->p2);
     return default_fixup_args(state, translation, ctx);
 }

@@ -1832,6 +1856,36 @@ static int get_ec_decoded_from_explicit_params(enum state state,
     return get_payload_int(state, translation, ctx, val);
 }

+static int get_ec_field_degree(enum state state,
+    const struct translation_st *translation,
+    struct translation_ctx_st *ctx)
+{
+#ifndef OPENSSL_NO_EC
+    const EC_KEY *key;
+    const EC_GROUP *group;
+#endif
+    EVP_PKEY *pkey = ctx->p2;
+    int val = 0;
+
+    switch (EVP_PKEY_base_id(pkey)) {
+#ifndef OPENSSL_NO_EC
+    case EVP_PKEY_EC:
+        if ((key = EVP_PKEY_get0_EC_KEY(pkey)) == NULL
+            || (group = EC_KEY_get0_group(key)) == NULL) {
+            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY);
+            return 0;
+        }
+        val = EC_GROUP_get_degree(group);
+        break;
+#endif
+    default:
+        ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_TYPE);
+        return 0;
+    }
+
+    return get_payload_int(state, translation, ctx, val);
+}
+
 static int get_rsa_payload_n(enum state state,
     const struct translation_st *translation,
     struct translation_ctx_st *ctx)
@@ -2567,6 +2621,9 @@ static const struct translation_st evp_pkey_translations[] = {
     { OSSL_ACTION_GET, -1, -1, -1, 0, NULL, NULL,
         OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS, OSSL_PARAM_INTEGER,
         get_ec_decoded_from_explicit_params },
+    { OSSL_ACTION_GET, -1, -1, -1, 0, NULL, NULL,
+        OSSL_PKEY_PARAM_EC_FIELD_DEGREE, OSSL_PARAM_INTEGER,
+        get_ec_field_degree },
 };

 static const struct translation_st *
@@ -2717,11 +2774,6 @@ int evp_pkey_ctx_ctrl_to_param(EVP_PKEY_CTX *pctx,
         return -2;
     }

-    if (pctx->pmeth != NULL
-        && pctx->pmeth->pkey_id != translation->keytype1
-        && pctx->pmeth->pkey_id != translation->keytype2)
-        return -1;
-
     if (translation->fixup_args != NULL)
         fixup = translation->fixup_args;
     ctx.action_type = translation->action_type;
@@ -2939,7 +2991,7 @@ static int evp_pkey_setget_params_to_ctrl(const EVP_PKEY *pkey,
          * on fixup_args to do the whole work.  Also, we currently only
          * support getting.
          */
-        if (!ossl_assert(translation != NULL)
+        if (translation == NULL
             || !ossl_assert(translation->action_type == OSSL_ACTION_GET)
             || !ossl_assert(translation->fixup_args != NULL)) {
             return -2;
diff --git a/deps/openssl/openssl/crypto/evp/dh_ctrl.c b/deps/openssl/openssl/crypto/evp/dh_ctrl.c
index 48f454cee26..7d07d0d5206 100644
--- a/deps/openssl/openssl/crypto/evp/dh_ctrl.c
+++ b/deps/openssl/openssl/crypto/evp/dh_ctrl.c
@@ -25,8 +25,8 @@ static int dh_paramgen_check(EVP_PKEY_CTX *ctx)
     }
     /* If key type not DH return error */
     if (evp_pkey_ctx_is_legacy(ctx)
-        && ctx->pmeth->pkey_id != EVP_PKEY_DH
-        && ctx->pmeth->pkey_id != EVP_PKEY_DHX)
+        && ctx->legacy_keytype != EVP_PKEY_DH
+        && ctx->legacy_keytype != EVP_PKEY_DHX)
         return -1;
     return 1;
 }
@@ -40,8 +40,8 @@ static int dh_param_derive_check(EVP_PKEY_CTX *ctx)
     }
     /* If key type not DH return error */
     if (evp_pkey_ctx_is_legacy(ctx)
-        && ctx->pmeth->pkey_id != EVP_PKEY_DH
-        && ctx->pmeth->pkey_id != EVP_PKEY_DHX)
+        && ctx->legacy_keytype != EVP_PKEY_DH
+        && ctx->legacy_keytype != EVP_PKEY_DHX)
         return -1;
     return 1;
 }
diff --git a/deps/openssl/openssl/crypto/evp/digest.c b/deps/openssl/openssl/crypto/evp/digest.c
index 224f3000ce0..db7121f0a46 100644
--- a/deps/openssl/openssl/crypto/evp/digest.c
+++ b/deps/openssl/openssl/crypto/evp/digest.c
@@ -7,39 +7,23 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
 #include <stdio.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include <openssl/ec.h>
-#ifndef FIPS_MODULE
-#include <openssl/engine.h>
-#endif
 #include <openssl/params.h>
 #include <openssl/core_names.h>
 #include "internal/cryptlib.h"
 #include "internal/nelem.h"
 #include "internal/provider.h"
 #include "internal/core.h"
+#include "internal/common.h"
 #include "crypto/evp.h"
 #include "evp_local.h"

-static void cleanup_old_md_data(EVP_MD_CTX *ctx, int force)
-{
-    if (ctx->digest != NULL) {
-        if (ctx->digest->cleanup != NULL
-            && !EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_CLEANED))
-            ctx->digest->cleanup(ctx);
-        if (ctx->md_data != NULL && ctx->digest->ctx_size > 0
-            && (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_REUSE)
-                || force)) {
-            OPENSSL_clear_free(ctx->md_data, ctx->digest->ctx_size);
-            ctx->md_data = NULL;
-        }
-    }
-}
+#include <crypto/asn1.h>
+
+static void evp_md_free(void *m);

 void evp_md_ctx_clear_digest(EVP_MD_CTX *ctx, int force, int keep_fetched)
 {
@@ -56,15 +40,9 @@ void evp_md_ctx_clear_digest(EVP_MD_CTX *ctx, int force, int keep_fetched)
      * Don't assume ctx->md_data was cleaned in EVP_Digest_Final, because
      * sometimes only copies of the context are ever finalised.
      */
-    cleanup_old_md_data(ctx, force);
     if (force)
         ctx->digest = NULL;

-#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
-    ENGINE_finish(ctx->engine);
-    ctx->engine = NULL;
-#endif
-
     /* Non legacy code, this has to be later than the ctx->digest cleaning */
     if (!keep_fetched) {
         EVP_MD_free(ctx->fetched_digest);
@@ -155,12 +133,8 @@ int evp_md_ctx_free_algctx(EVP_MD_CTX *ctx)
 }

 static int evp_md_init_internal(EVP_MD_CTX *ctx, const EVP_MD *type,
-    const OSSL_PARAM params[], ENGINE *impl)
+    const OSSL_PARAM params[])
 {
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    ENGINE *tmpimpl = NULL;
-#endif
-
 #if !defined(FIPS_MODULE)
     if (ctx->pctx != NULL
         && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
@@ -172,9 +146,9 @@ static int evp_md_init_internal(EVP_MD_CTX *ctx, const EVP_MD *type,
          * operation. So in that case we redirect to EVP_DigestSignInit()
          */
         if (ctx->pctx->operation == EVP_PKEY_OP_SIGNCTX)
-            return EVP_DigestSignInit(ctx, NULL, type, impl, NULL);
+            return EVP_DigestSignInit(ctx, NULL, type, NULL, NULL);
         if (ctx->pctx->operation == EVP_PKEY_OP_VERIFYCTX)
-            return EVP_DigestVerifyInit(ctx, NULL, type, impl, NULL);
+            return EVP_DigestVerifyInit(ctx, NULL, type, NULL, NULL);
         ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
         return 0;
     }
@@ -185,68 +159,15 @@ static int evp_md_init_internal(EVP_MD_CTX *ctx, const EVP_MD *type,
     if (type != NULL) {
         ctx->reqdigest = type;
     } else {
-        if (ctx->digest == NULL) {
+        if (ossl_unlikely(ctx->digest == NULL)) {
             ERR_raise(ERR_LIB_EVP, EVP_R_NO_DIGEST_SET);
             return 0;
         }
         type = ctx->digest;
     }

-    /* Code below to be removed when legacy support is dropped. */
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    /*
-     * Whether it's nice or not, "Inits" can be used on "Final"'d contexts so
-     * this context may already have an ENGINE! Try to avoid releasing the
-     * previous handle, re-querying for an ENGINE, and having a
-     * reinitialisation, when it may all be unnecessary.
-     */
-    if (ctx->engine != NULL
-        && ctx->digest != NULL
-        && type->type == ctx->digest->type)
-        goto skip_to_init;
-
-    /*
-     * Ensure an ENGINE left lying around from last time is cleared (the
-     * previous check attempted to avoid this if the same ENGINE and
-     * EVP_MD could be used).
-     */
-    ENGINE_finish(ctx->engine);
-    ctx->engine = NULL;
-
-    if (impl == NULL)
-        tmpimpl = ENGINE_get_digest_engine(type->type);
-#endif
-
-    /*
-     * If there are engines involved or EVP_MD_CTX_FLAG_NO_INIT is set then we
-     * should use legacy handling for now.
-     */
-    if (impl != NULL
-#if !defined(OPENSSL_NO_ENGINE)
-        || ctx->engine != NULL
-#if !defined(FIPS_MODULE)
-        || tmpimpl != NULL
-#endif
-#endif
-        || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0
-        || (type != NULL && type->origin == EVP_ORIG_METH)
-        || (type == NULL && ctx->digest != NULL
-            && ctx->digest->origin == EVP_ORIG_METH)) {
-        /* If we were using provided hash before, cleanup algctx */
-        if (!evp_md_ctx_free_algctx(ctx))
-            return 0;
-        if (ctx->digest == ctx->fetched_digest)
-            ctx->digest = NULL;
-        EVP_MD_free(ctx->fetched_digest);
-        ctx->fetched_digest = NULL;
-        goto legacy;
-    }
-
-    cleanup_old_md_data(ctx, 1);
-
-    /* Start of non-legacy code below */
-    if (ctx->digest == type) {
-        if (!ossl_assert(type->prov != NULL)) {
+    if (ossl_likely(ctx->digest == type)) {
+        if (ossl_unlikely(!ossl_assert(type->prov != NULL))) {
             ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
             return 0;
         }
@@ -255,7 +176,7 @@ static int evp_md_init_internal(EVP_MD_CTX *ctx, const EVP_MD *type,
             return 0;
     }

-    if (type->prov == NULL) {
+    if (ossl_unlikely(type->prov == NULL)) {
 #ifdef FIPS_MODULE
         /* We only do explicit fetches inside the FIPS module */
         ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
@@ -277,8 +198,8 @@ static int evp_md_init_internal(EVP_MD_CTX *ctx, const EVP_MD *type,
 #endif
     }

-    if (type->prov != NULL && ctx->fetched_digest != type) {
-        if (!EVP_MD_up_ref((EVP_MD *)type)) {
+    if (ossl_unlikely(type->prov != NULL && ctx->fetched_digest != type)) {
+        if (ossl_unlikely(!EVP_MD_up_ref((EVP_MD *)type))) {
             ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
             return 0;
         }
@@ -300,99 +221,38 @@ static int evp_md_init_internal(EVP_MD_CTX *ctx, const EVP_MD *type,
     }

     return ctx->digest->dinit(ctx->algctx, params);
-
-    /* Code below to be removed when legacy support is dropped. */
-legacy:
-
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    if (type) {
-        if (impl != NULL) {
-            if (!ENGINE_init(impl)) {
-                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
-                return 0;
-            }
-        } else {
-            /* Ask if an ENGINE is reserved for this job */
-            impl = tmpimpl;
-        }
-        if (impl != NULL) {
-            /* There's an ENGINE for this job ... (apparently) */
-            const EVP_MD *d = ENGINE_get_digest(impl, type->type);
-
-            if (d == NULL) {
-                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
-                ENGINE_finish(impl);
-                return 0;
-            }
-            /* We'll use the ENGINE's private digest definition */
-            type = d;
-            /*
-             * Store the ENGINE functional reference so we know 'type' came
-             * from an ENGINE and we need to release it when done.
-             */
-            ctx->engine = impl;
-        } else
-            ctx->engine = NULL;
-    }
-#endif
-    if (ctx->digest != type) {
-        cleanup_old_md_data(ctx, 1);
-
-        ctx->digest = type;
-        if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) {
-            ctx->update = type->update;
-            ctx->md_data = OPENSSL_zalloc(type->ctx_size);
-            if (ctx->md_data == NULL)
-                return 0;
-        }
-    }
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-skip_to_init:
-#endif
-#ifndef FIPS_MODULE
-    if (ctx->pctx != NULL
-        && (!EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
-            || ctx->pctx->op.sig.signature == NULL)) {
-        int r;
-        r = EVP_PKEY_CTX_ctrl(ctx->pctx, -1, EVP_PKEY_OP_TYPE_SIG,
-            EVP_PKEY_CTRL_DIGESTINIT, 0, ctx);
-        if (r <= 0 && (r != -2))
-            return 0;
-    }
-#endif
-    if (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT)
-        return 1;
-    return ctx->digest->init(ctx);
 }

 int EVP_DigestInit_ex2(EVP_MD_CTX *ctx, const EVP_MD *type,
     const OSSL_PARAM params[])
 {
-    return evp_md_init_internal(ctx, type, params, NULL);
+    return evp_md_init_internal(ctx, type, params);
 }

 int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
 {
     EVP_MD_CTX_reset(ctx);
-    return evp_md_init_internal(ctx, type, NULL, NULL);
+    return evp_md_init_internal(ctx, type, NULL);
 }

 int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)
 {
-    return evp_md_init_internal(ctx, type, NULL, impl);
+    if (!ossl_assert(impl == NULL))
+        return 0;
+    return evp_md_init_internal(ctx, type, NULL);
 }

 int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
 {
-    if (count == 0)
+    if (ossl_unlikely(count == 0))
         return 1;

-    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
+    if (ossl_unlikely((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0)) {
         ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
         return 0;
     }

-    if (ctx->pctx != NULL
+    if (ossl_unlikely(ctx->pctx != NULL)
         && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
         && ctx->pctx->op.sig.algctx != NULL) {
 #ifndef FIPS_MODULE
@@ -413,20 +273,16 @@ int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
         return 0;
     }

-    if (ctx->digest == NULL
-        || ctx->digest->prov == NULL
-        || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0)
-        goto legacy;
+    if (ctx->digest == NULL || ctx->digest->prov == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
+        return 0;
+    }

-    if (ctx->digest->dupdate == NULL) {
+    if (ossl_unlikely(ctx->digest->dupdate == NULL)) {
         ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
         return 0;
     }
     return ctx->digest->dupdate(ctx->algctx, data, count);
-
-    /* Code below to be removed when legacy support is dropped. */
-legacy:
-    return ctx->update != NULL ? ctx->update(ctx, data, count) : 0;
 }

 /* The caller can assume that this removes any secret data from the context */
@@ -445,22 +301,24 @@ int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *isize)
     size_t size = 0;
     size_t mdsize = 0;

-    if (ctx->digest == NULL)
+    if (ossl_unlikely(ctx->digest == NULL))
         return 0;

     sz = EVP_MD_CTX_get_size(ctx);
-    if (sz < 0)
+    if (ossl_unlikely(sz < 0))
         return 0;
     mdsize = sz;
-    if (ctx->digest->prov == NULL)
-        goto legacy;
+    if (ossl_unlikely(ctx->digest->prov == NULL)) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
+        return 0;
+    }

-    if (ctx->digest->dfinal == NULL) {
+    if (ossl_unlikely(ctx->digest->dfinal == NULL)) {
         ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
         return 0;
     }

-    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
+    if (ossl_unlikely((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0)) {
         ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
         return 0;
     }
@@ -470,7 +328,7 @@ int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *isize)
     ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;

     if (isize != NULL) {
-        if (size <= UINT_MAX) {
+        if (ossl_likely(size <= UINT_MAX)) {
             *isize = (unsigned int)size;
         } else {
             ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
@@ -479,19 +337,6 @@ int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *isize)
     }

     return ret;
-
-    /* Code below to be removed when legacy support is dropped. */
-legacy:
-    OPENSSL_assert(mdsize <= EVP_MAX_MD_SIZE);
-    ret = ctx->digest->final(ctx, md);
-    if (isize != NULL)
-        *isize = mdsize;
-    if (ctx->digest->cleanup) {
-        ctx->digest->cleanup(ctx);
-        EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
-    }
-    OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
-    return ret;
 }

 /* This is a one shot operation */
@@ -501,20 +346,22 @@ int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, unsigned char *md, size_t size)
     OSSL_PARAM params[2];
     size_t i = 0;

-    if (ctx->digest == NULL) {
+    if (ossl_unlikely(ctx->digest == NULL)) {
         ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_NULL_ALGORITHM);
         return 0;
     }

-    if (ctx->digest->prov == NULL)
-        goto legacy;
+    if (ossl_unlikely(ctx->digest->prov == NULL)) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
+        return 0;
+    }

-    if (ctx->digest->dfinal == NULL) {
+    if (ossl_unlikely(ctx->digest->dfinal == NULL)) {
         ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
         return 0;
     }

-    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
+    if (ossl_unlikely((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0)) {
         ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
         return 0;
     }
@@ -527,27 +374,11 @@ int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, unsigned char *md, size_t size)
     params[i++] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_XOFLEN, &size);
     params[i++] = OSSL_PARAM_construct_end();

-    if (EVP_MD_CTX_set_params(ctx, params) >= 0)
+    if (ossl_likely(EVP_MD_CTX_set_params(ctx, params) >= 0))
         ret = ctx->digest->dfinal(ctx->algctx, md, &size, size);

     ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;

-    return ret;
-
-legacy:
-    if (EVP_MD_xof(ctx->digest)
-        && size <= INT_MAX
-        && ctx->digest->md_ctrl(ctx, EVP_MD_CTRL_XOF_LEN, (int)size, NULL)) {
-        ret = ctx->digest->final(ctx, md);
-        if (ctx->digest->cleanup != NULL) {
-            ctx->digest->cleanup(ctx);
-            EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
-        }
-        OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
-    } else {
-        ERR_raise(ERR_LIB_EVP, EVP_R_NOT_XOF_OR_INVALID_LENGTH);
-    }
-
     return ret;
 }

@@ -572,6 +403,57 @@ int EVP_DigestSqueeze(EVP_MD_CTX *ctx, unsigned char *md, size_t size)
     return ctx->digest->dsqueeze(ctx->algctx, md, &size, size);
 }

+int EVP_MD_CTX_serialize(EVP_MD_CTX *ctx, unsigned char *out, size_t *outlen)
+{
+    if (ctx->digest == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_NULL_ALGORITHM);
+        return 0;
+    }
+
+    if (ctx->digest->prov == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
+        return 0;
+    }
+
+    if (ctx->digest->serialize == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED);
+        return 0;
+    }
+
+    if (ossl_unlikely((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0)) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_CONTEXT_FINALIZED);
+        return 0;
+    }
+
+    return ctx->digest->serialize(ctx->algctx, out, outlen);
+}
+
+int EVP_MD_CTX_deserialize(EVP_MD_CTX *ctx, const unsigned char *in,
+    size_t inlen)
+{
+    if (ctx->digest == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_NULL_ALGORITHM);
+        return 0;
+    }
+
+    if (ctx->digest->prov == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
+        return 0;
+    }
+
+    if (ctx->digest->deserialize == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED);
+        return 0;
+    }
+
+    if (ossl_unlikely((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0)) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_CONTEXT_FINALIZED);
+        return 0;
+    }
+
+    return ctx->digest->deserialize(ctx->algctx, in, inlen);
+}
+
 EVP_MD_CTX *EVP_MD_CTX_dup(const EVP_MD_CTX *in)
 {
     EVP_MD_CTX *out = EVP_MD_CTX_new();
@@ -592,7 +474,6 @@ int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
 int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in)
 {
     int digest_change = 0;
-    unsigned char *tmp_buf;

     if (in == NULL) {
         ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_NULL_PARAMETER);
@@ -608,25 +489,20 @@ int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in)
         goto clone_pkey;
     }

-    if (in->digest->prov == NULL
-        || (in->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0)
-        goto legacy;
-
-    if (in->digest->dupctx == NULL) {
+    if (in->digest->prov == NULL || in->digest->dupctx == NULL) {
         ERR_raise(ERR_LIB_EVP, EVP_R_NOT_ABLE_TO_COPY_CTX);
         return 0;
     }

-    if (out->digest == in->digest && in->digest->copyctx != NULL) {
+    if (out->digest == in->digest && in->digest->copyctx != NULL
+        && out->algctx != NULL && in->algctx != NULL) {

         in->digest->copyctx(out->algctx, in->algctx);

         EVP_PKEY_CTX_free(out->pctx);
         out->pctx = NULL;
-        cleanup_old_md_data(out, 0);

         out->flags = in->flags;
-        out->update = in->update;
     } else {
         evp_md_ctx_reset_ex(out, 1);
         digest_change = (out->fetched_digest != in->fetched_digest);
@@ -665,75 +541,23 @@ clone_pkey:
 #endif

     return 1;
-
-    /* Code below to be removed when legacy support is dropped. */
-legacy:
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    /* Make sure it's safe to copy a digest context using an ENGINE */
-    if (in->engine && !ENGINE_init(in->engine)) {
-        ERR_raise(ERR_LIB_EVP, ERR_R_ENGINE_LIB);
-        return 0;
-    }
-#endif
-
-    if (out->digest == in->digest) {
-        tmp_buf = out->md_data;
-        EVP_MD_CTX_set_flags(out, EVP_MD_CTX_FLAG_REUSE);
-    } else
-        tmp_buf = NULL;
-    EVP_MD_CTX_reset(out);
-    memcpy(out, in, sizeof(*out));
-
-    /* copied EVP_MD_CTX should free the copied EVP_PKEY_CTX */
-    EVP_MD_CTX_clear_flags(out, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX);
-
-    /* Null these variables, since they are getting fixed up
-     * properly below.  Anything else may cause a memleak and/or
-     * double free if any of the memory allocations below fail
-     */
-    out->md_data = NULL;
-    out->pctx = NULL;
-
-    if (in->md_data && out->digest->ctx_size) {
-        if (tmp_buf)
-            out->md_data = tmp_buf;
-        else {
-            out->md_data = OPENSSL_malloc(out->digest->ctx_size);
-            if (out->md_data == NULL)
-                return 0;
-        }
-        memcpy(out->md_data, in->md_data, out->digest->ctx_size);
-    }
-
-    out->update = in->update;
-
-#ifndef FIPS_MODULE
-    if (in->pctx) {
-        out->pctx = EVP_PKEY_CTX_dup(in->pctx);
-        if (!out->pctx) {
-            EVP_MD_CTX_reset(out);
-            return 0;
-        }
-    }
-#endif
-
-    if (out->digest->copy)
-        return out->digest->copy(out, in);
-
-    return 1;
 }

 int EVP_Digest(const void *data, size_t count,
     unsigned char *md, unsigned int *size, const EVP_MD *type,
     ENGINE *impl)
 {
-    EVP_MD_CTX *ctx = EVP_MD_CTX_new();
+    EVP_MD_CTX *ctx;
     int ret;

+    if (!ossl_assert(impl == NULL))
+        return 0;
+
+    ctx = EVP_MD_CTX_new();
     if (ctx == NULL)
         return 0;
     EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT);
-    ret = EVP_DigestInit_ex(ctx, type, impl)
+    ret = EVP_DigestInit_ex(ctx, type, NULL)
         && EVP_DigestUpdate(ctx, data, count)
         && EVP_DigestFinal_ex(ctx, md, size);
     EVP_MD_CTX_free(ctx);
@@ -778,7 +602,7 @@ int EVP_MD_CTX_set_params(EVP_MD_CTX *ctx, const OSSL_PARAM params[])
     EVP_PKEY_CTX *pctx = ctx->pctx;

     /* If we have a pctx then we should try that first */
-    if (pctx != NULL
+    if (ossl_unlikely(pctx != NULL)
         && (pctx->operation == EVP_PKEY_OP_VERIFYCTX
             || pctx->operation == EVP_PKEY_OP_SIGNCTX)
         && pctx->op.sig.algctx != NULL
@@ -786,7 +610,7 @@ int EVP_MD_CTX_set_params(EVP_MD_CTX *ctx, const OSSL_PARAM params[])
         return pctx->op.sig.signature->set_ctx_md_params(pctx->op.sig.algctx,
             params);

-    if (ctx->digest != NULL && ctx->digest->set_ctx_params != NULL)
+    if (ossl_likely(ctx->digest != NULL && ctx->digest->set_ctx_params != NULL))
         return ctx->digest->set_ctx_params(ctx->algctx, params);

     return 0;
@@ -864,12 +688,12 @@ const OSSL_PARAM *EVP_MD_CTX_gettable_params(EVP_MD_CTX *ctx)
     EVP_PKEY_CTX *pctx;
     void *provctx;

-    if (ctx == NULL)
+    if (ossl_unlikely(ctx == NULL))
         return NULL;

     /* If we have a pctx then we should try that first */
     pctx = ctx->pctx;
-    if (pctx != NULL
+    if (ossl_unlikely(pctx != NULL)
         && (pctx->operation == EVP_PKEY_OP_VERIFYCTX
             || pctx->operation == EVP_PKEY_OP_SIGNCTX)
         && pctx->op.sig.signature != NULL
@@ -878,7 +702,8 @@ const OSSL_PARAM *EVP_MD_CTX_gettable_params(EVP_MD_CTX *ctx)
         return pctx->op.sig.signature->gettable_ctx_md_params(
             pctx->op.sig.algctx);

-    if (ctx->digest != NULL && ctx->digest->gettable_ctx_params != NULL) {
+    if (ossl_unlikely(ctx->digest != NULL
+            && ctx->digest->gettable_ctx_params != NULL)) {
         provctx = ossl_provider_ctx(EVP_MD_get0_provider(ctx->digest));
         return ctx->digest->gettable_ctx_params(ctx->algctx, provctx);
     }
@@ -897,8 +722,10 @@ int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)
         return 0;
     }

-    if (ctx->digest != NULL && ctx->digest->prov == NULL)
-        goto legacy;
+    if (ctx->digest != NULL && ctx->digest->prov == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED);
+        return 0;
+    }

     switch (cmd) {
     case EVP_MD_CTRL_XOF_LEN:
@@ -922,16 +749,7 @@ int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)
         ret = EVP_MD_CTX_set_params(ctx, params);
     else
         ret = EVP_MD_CTX_get_params(ctx, params);
-    goto conclude;
-
-    /* Code below to be removed when legacy support is dropped. */
-legacy:
-    if (ctx->digest->md_ctrl == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED);
-        return 0;
-    }

-    ret = ctx->digest->md_ctrl(ctx, cmd, p1, p2);
 conclude:
     if (ret <= 0)
         return 0;
@@ -1014,7 +832,7 @@ static int evp_md_cache_constants(EVP_MD *md)

 static void *evp_md_from_algorithm(int name_id,
     const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov)
+    OSSL_PROVIDER *prov, int no_store)
 {
     const OSSL_DISPATCH *fns = algodef->implementation;
     EVP_MD *md = NULL;
@@ -1026,6 +844,9 @@ static void *evp_md_from_algorithm(int name_id,
         return NULL;
     }

+    if (no_store != 0)
+        md->flags |= EVP_MD_FLAG_NO_STORE;
+
 #ifndef FIPS_MODULE
     md->type = NID_undef;
     if (!evp_names_do_all(prov, name_id, set_legacy_nid, &md->type)
@@ -1116,6 +937,14 @@ static void *evp_md_from_algorithm(int name_id,
             if (md->copyctx == NULL)
                 md->copyctx = OSSL_FUNC_digest_copyctx(fns);
             break;
+        case OSSL_FUNC_DIGEST_SERIALIZE:
+            if (md->serialize == NULL)
+                md->serialize = OSSL_FUNC_digest_serialize(fns);
+            break;
+        case OSSL_FUNC_DIGEST_DESERIALIZE:
+            if (md->deserialize == NULL)
+                md->deserialize = OSSL_FUNC_digest_deserialize(fns);
+            break;
         }
     }
     if ((fncnt != 0 && fncnt != 5 && fncnt != 6)
@@ -1142,18 +971,36 @@ static void *evp_md_from_algorithm(int name_id,
     return md;

 err:
-    EVP_MD_free(md);
+    evp_md_free(md);
     return NULL;
 }

-static int evp_md_up_ref(void *md)
+static int evp_md_up_ref(void *m)
 {
-    return EVP_MD_up_ref(md);
+    EVP_MD *md = (EVP_MD *)m;
+    int ref = 0;
+
+    if (md->origin == EVP_ORIG_DYNAMIC)
+        return CRYPTO_UP_REF(&md->refcnt, &ref);
+    return 1;
 }

-static void evp_md_free(void *md)
+static void evp_md_free(void *m)
 {
-    EVP_MD_free(md);
+    EVP_MD *md = (EVP_MD *)m;
+    int i;
+
+    if (md == NULL || md->origin != EVP_ORIG_DYNAMIC)
+        return;
+
+    CRYPTO_DOWN_REF(&md->refcnt, &i);
+    if (i > 0)
+        return;
+
+    OPENSSL_free(md->type_name);
+    ossl_provider_free(md->prov);
+    CRYPTO_FREE_REF(&md->refcnt);
+    OPENSSL_free(md);
 }

 EVP_MD *EVP_MD_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
@@ -1167,32 +1014,36 @@ EVP_MD *EVP_MD_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,

 int EVP_MD_up_ref(EVP_MD *md)
 {
-    int ref = 0;
-
-    if (md->origin == EVP_ORIG_DYNAMIC)
-        CRYPTO_UP_REF(&md->refcnt, &ref);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    return evp_md_up_ref(md);
+#else
+    if (md->flags & EVP_MD_FLAG_NO_STORE)
+        return evp_md_up_ref(md);
     return 1;
+#endif
 }

 void EVP_MD_free(EVP_MD *md)
 {
-    int i;
-
-    if (md == NULL || md->origin != EVP_ORIG_DYNAMIC)
-        return;
-
-    CRYPTO_DOWN_REF(&md->refcnt, &i);
-    if (i > 0)
-        return;
-    evp_md_free_int(md);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    evp_md_free(md);
+#else
+    if (md != NULL && (md->flags & EVP_MD_FLAG_NO_STORE))
+        evp_md_free(md);
+    return;
+#endif
 }

 void EVP_MD_do_all_provided(OSSL_LIB_CTX *libctx,
     void (*fn)(EVP_MD *mac, void *arg),
     void *arg)
 {
+    struct EVP_MD_do_all_provided_thunk t;
+
+    t.fn = fn;
+    t.arg = arg;
     evp_generic_do_all(libctx, OSSL_OP_DIGEST,
-        (void (*)(void *, void *))fn, arg,
+        EVP_MD_do_all_provided_thunk, &t,
         evp_md_from_algorithm, evp_md_up_ref, evp_md_free);
 }

diff --git a/deps/openssl/openssl/crypto/evp/dsa_ctrl.c b/deps/openssl/openssl/crypto/evp/dsa_ctrl.c
index af1b055ee44..8490a1fe82e 100644
--- a/deps/openssl/openssl/crypto/evp/dsa_ctrl.c
+++ b/deps/openssl/openssl/crypto/evp/dsa_ctrl.c
@@ -22,7 +22,7 @@ static int dsa_paramgen_check(EVP_PKEY_CTX *ctx)
         return -2;
     }
     /* If key type not DSA return error */
-    if (ctx->pmeth != NULL && ctx->pmeth->pkey_id != EVP_PKEY_DSA)
+    if (ctx->legacy_keytype != EVP_PKEY_DSA)
         return -1;
     return 1;
 }
diff --git a/deps/openssl/openssl/crypto/evp/e_aes.c b/deps/openssl/openssl/crypto/evp/e_aes.c
index da2090f894c..92773bb3a8a 100644
--- a/deps/openssl/openssl/crypto/evp/e_aes.c
+++ b/deps/openssl/openssl/crypto/evp/e_aes.c
@@ -7,2376 +7,16 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * This file uses the low-level AES functions (which are deprecated for
- * non-internal use) in order to implement the EVP AES ciphers.
- */
-#include "internal/deprecated.h"
-
-#include <string.h>
-#include <assert.h>
-#include <openssl/opensslconf.h>
-#include <openssl/crypto.h>
-#include <openssl/evp.h>
-#include <openssl/err.h>
-#include <openssl/aes.h>
-#include <openssl/rand.h>
-#include <openssl/cmac.h>
-#include "crypto/evp.h"
-#include "internal/cryptlib.h"
-#include "crypto/modes.h"
-#include "crypto/siv.h"
-#include "crypto/aes_platform.h"
-#include "evp_local.h"
-
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        AES_KEY ks;
-    } ks;
-    block128_f block;
-    union {
-        cbc128_f cbc;
-        ctr128_f ctr;
-    } stream;
-} EVP_AES_KEY;
-
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        AES_KEY ks;
-    } ks; /* AES key schedule to use */
-    int key_set; /* Set if key initialised */
-    int iv_set; /* Set if an iv is set */
-    GCM128_CONTEXT gcm;
-    unsigned char *iv; /* Temporary IV store */
-    int ivlen; /* IV length */
-    int taglen;
-    int iv_gen; /* It is OK to generate IVs */
-    int iv_gen_rand; /* No IV was specified, so generate a rand IV */
-    int tls_aad_len; /* TLS AAD length */
-    uint64_t tls_enc_records; /* Number of TLS records encrypted */
-    ctr128_f ctr;
-} EVP_AES_GCM_CTX;
-
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        AES_KEY ks;
-    } ks1, ks2; /* AES key schedules to use */
-    XTS128_CONTEXT xts;
-    void (*stream)(const unsigned char *in,
-        unsigned char *out, size_t length,
-        const AES_KEY *key1, const AES_KEY *key2,
-        const unsigned char iv[16]);
-} EVP_AES_XTS_CTX;
-
-#ifdef FIPS_MODULE
-static const int allow_insecure_decrypt = 0;
-#else
-static const int allow_insecure_decrypt = 1;
-#endif
-
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        AES_KEY ks;
-    } ks; /* AES key schedule to use */
-    int key_set; /* Set if key initialised */
-    int iv_set; /* Set if an iv is set */
-    int tag_set; /* Set if tag is valid */
-    int len_set; /* Set if message length set */
-    int L, M; /* L and M parameters from RFC3610 */
-    int tls_aad_len; /* TLS AAD length */
-    CCM128_CONTEXT ccm;
-    ccm128_f str;
-} EVP_AES_CCM_CTX;
-
-#ifndef OPENSSL_NO_OCB
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        AES_KEY ks;
-    } ksenc; /* AES key schedule to use for encryption */
-    union {
-        OSSL_UNION_ALIGN;
-        AES_KEY ks;
-    } ksdec; /* AES key schedule to use for decryption */
-    int key_set; /* Set if key initialised */
-    int iv_set; /* Set if an iv is set */
-    OCB128_CONTEXT ocb;
-    unsigned char *iv; /* Temporary IV store */
-    unsigned char tag[16];
-    unsigned char data_buf[16]; /* Store partial data blocks */
-    unsigned char aad_buf[16]; /* Store partial AAD blocks */
-    int data_buf_len;
-    int aad_buf_len;
-    int ivlen; /* IV length */
-    int taglen;
-} EVP_AES_OCB_CTX;
-#endif
-
-#define MAXBITCHUNK ((size_t)1 << (sizeof(size_t) * 8 - 4))
-
-/* increment counter (64-bit int) by 1 */
-static void ctr64_inc(unsigned char *counter)
-{
-    int n = 8;
-    unsigned char c;
-
-    do {
-        --n;
-        c = counter[n];
-        ++c;
-        counter[n] = c;
-        if (c)
-            return;
-    } while (n);
-}
-
-#if defined(AESNI_CAPABLE)
-#if defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64)
-#define AES_GCM_ASM2(gctx) (gctx->gcm.block == (block128_f)aesni_encrypt && gctx->gcm.ghash == gcm_ghash_avx)
-#undef AES_GCM_ASM2 /* minor size optimization */
-#endif
-
-static int aesni_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    int ret, mode;
-    EVP_AES_KEY *dat = EVP_C_DATA(EVP_AES_KEY, ctx);
-    const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-
-    if (keylen <= 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-        return 0;
-    }
-    mode = EVP_CIPHER_CTX_get_mode(ctx);
-    if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE)
-        && !enc) {
-        ret = aesni_set_decrypt_key(key, keylen, &dat->ks.ks);
-        dat->block = (block128_f)aesni_decrypt;
-        dat->stream.cbc = mode == EVP_CIPH_CBC_MODE ? (cbc128_f)aesni_cbc_encrypt : NULL;
-    } else {
-        ret = aesni_set_encrypt_key(key, keylen, &dat->ks.ks);
-        dat->block = (block128_f)aesni_encrypt;
-        if (mode == EVP_CIPH_CBC_MODE)
-            dat->stream.cbc = (cbc128_f)aesni_cbc_encrypt;
-        else if (mode == EVP_CIPH_CTR_MODE)
-            dat->stream.ctr = (ctr128_f)aesni_ctr32_encrypt_blocks;
-        else
-            dat->stream.cbc = NULL;
-    }
-
-    if (ret < 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_AES_KEY_SETUP_FAILED);
-        return 0;
-    }
-
-    return 1;
-}
-
-static int aesni_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    aesni_cbc_encrypt(in, out, len, &EVP_C_DATA(EVP_AES_KEY, ctx)->ks.ks,
-        ctx->iv, EVP_CIPHER_CTX_is_encrypting(ctx));
-
-    return 1;
-}
-
-static int aesni_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    size_t bl = EVP_CIPHER_CTX_get_block_size(ctx);
-
-    if (len < bl)
-        return 1;
-
-    aesni_ecb_encrypt(in, out, len, &EVP_C_DATA(EVP_AES_KEY, ctx)->ks.ks,
-        EVP_CIPHER_CTX_is_encrypting(ctx));
-
-    return 1;
-}
-
-#define aesni_ofb_cipher aes_ofb_cipher
-static int aesni_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define aesni_cfb_cipher aes_cfb_cipher
-static int aesni_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define aesni_cfb8_cipher aes_cfb8_cipher
-static int aesni_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define aesni_cfb1_cipher aes_cfb1_cipher
-static int aesni_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define aesni_ctr_cipher aes_ctr_cipher
-static int aesni_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-static int aesni_gcm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    EVP_AES_GCM_CTX *gctx = EVP_C_DATA(EVP_AES_GCM_CTX, ctx);
-
-    if (iv == NULL && key == NULL)
-        return 1;
-
-    if (key) {
-        const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-
-        if (keylen <= 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-        aesni_set_encrypt_key(key, keylen, &gctx->ks.ks);
-        CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks, (block128_f)aesni_encrypt);
-        gctx->ctr = (ctr128_f)aesni_ctr32_encrypt_blocks;
-        /*
-         * If we have an iv can set it directly, otherwise use saved IV.
-         */
-        if (iv == NULL && gctx->iv_set)
-            iv = gctx->iv;
-        if (iv) {
-            CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen);
-            gctx->iv_set = 1;
-        }
-        gctx->key_set = 1;
-    } else {
-        /* If key set use IV, otherwise copy */
-        if (gctx->key_set)
-            CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen);
-        else
-            memcpy(gctx->iv, iv, gctx->ivlen);
-        gctx->iv_set = 1;
-        gctx->iv_gen = 0;
-    }
-    return 1;
-}
-
-#define aesni_gcm_cipher aes_gcm_cipher
-static int aesni_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-static int aesni_xts_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    EVP_AES_XTS_CTX *xctx = EVP_C_DATA(EVP_AES_XTS_CTX, ctx);
-
-    if (iv == NULL && key == NULL)
-        return 1;
-
-    if (key) {
-        /* The key is two half length keys in reality */
-        const int keylen = EVP_CIPHER_CTX_get_key_length(ctx);
-        const int bytes = keylen / 2;
-        const int bits = bytes * 8;
-
-        if (keylen <= 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-        /*
-         * Verify that the two keys are different.
-         *
-         * This addresses Rogaway's vulnerability.
-         * See comment in aes_xts_init_key() below.
-         */
-        if ((!allow_insecure_decrypt || enc)
-            && CRYPTO_memcmp(key, key + bytes, bytes) == 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_XTS_DUPLICATED_KEYS);
-            return 0;
-        }
-
-        /* key_len is two AES keys */
-        if (enc) {
-            aesni_set_encrypt_key(key, bits, &xctx->ks1.ks);
-            xctx->xts.block1 = (block128_f)aesni_encrypt;
-            xctx->stream = aesni_xts_encrypt;
-        } else {
-            aesni_set_decrypt_key(key, bits, &xctx->ks1.ks);
-            xctx->xts.block1 = (block128_f)aesni_decrypt;
-            xctx->stream = aesni_xts_decrypt;
-        }
-
-        aesni_set_encrypt_key(key + bytes, bits, &xctx->ks2.ks);
-        xctx->xts.block2 = (block128_f)aesni_encrypt;
-
-        xctx->xts.key1 = &xctx->ks1;
-    }
-
-    if (iv) {
-        xctx->xts.key2 = &xctx->ks2;
-        memcpy(ctx->iv, iv, 16);
-    }
-
-    return 1;
-}
-
-#define aesni_xts_cipher aes_xts_cipher
-static int aesni_xts_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-static int aesni_ccm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    EVP_AES_CCM_CTX *cctx = EVP_C_DATA(EVP_AES_CCM_CTX, ctx);
-
-    if (iv == NULL && key == NULL)
-        return 1;
-
-    if (key != NULL) {
-        const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-
-        if (keylen <= 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-        aesni_set_encrypt_key(key, keylen, &cctx->ks.ks);
-        CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L,
-            &cctx->ks, (block128_f)aesni_encrypt);
-        cctx->str = enc ? (ccm128_f)aesni_ccm64_encrypt_blocks : (ccm128_f)aesni_ccm64_decrypt_blocks;
-        cctx->key_set = 1;
-    }
-    if (iv) {
-        memcpy(ctx->iv, iv, 15 - cctx->L);
-        cctx->iv_set = 1;
-    }
-    return 1;
-}
-
-#define aesni_ccm_cipher aes_ccm_cipher
-static int aesni_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#ifndef OPENSSL_NO_OCB
-static int aesni_ocb_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    EVP_AES_OCB_CTX *octx = EVP_C_DATA(EVP_AES_OCB_CTX, ctx);
-
-    if (iv == NULL && key == NULL)
-        return 1;
-
-    if (key != NULL) {
-        const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-
-        if (keylen <= 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-        do {
-            /*
-             * We set both the encrypt and decrypt key here because decrypt
-             * needs both. We could possibly optimise to remove setting the
-             * decrypt for an encryption operation.
-             */
-            aesni_set_encrypt_key(key, keylen, &octx->ksenc.ks);
-            aesni_set_decrypt_key(key, keylen, &octx->ksdec.ks);
-            if (!CRYPTO_ocb128_init(&octx->ocb,
-                    &octx->ksenc.ks, &octx->ksdec.ks,
-                    (block128_f)aesni_encrypt,
-                    (block128_f)aesni_decrypt,
-                    enc ? aesni_ocb_encrypt
-                        : aesni_ocb_decrypt))
-                return 0;
-        } while (0);
-
-        /*
-         * If we have an iv we can set it directly, otherwise use saved IV.
-         */
-        if (iv == NULL && octx->iv_set)
-            iv = octx->iv;
-        if (iv) {
-            if (CRYPTO_ocb128_setiv(&octx->ocb, iv, octx->ivlen, octx->taglen)
-                != 1)
-                return 0;
-            octx->iv_set = 1;
-        }
-        octx->key_set = 1;
-    } else {
-        /* If key set use IV, otherwise copy */
-        if (octx->key_set)
-            CRYPTO_ocb128_setiv(&octx->ocb, iv, octx->ivlen, octx->taglen);
-        else
-            memcpy(octx->iv, iv, octx->ivlen);
-        octx->iv_set = 1;
-    }
-    return 1;
-}
-
-#define aesni_ocb_cipher aes_ocb_cipher
-static int aesni_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-#endif /* OPENSSL_NO_OCB */
-
-#define BLOCK_CIPHER_generic(nid, keylen, blocksize, ivlen, nmode, mode, MODE, flags) \
-    static const EVP_CIPHER aesni_##keylen##_##mode = {                               \
-        nid##_##keylen##_##nmode, blocksize, keylen / 8, ivlen,                       \
-        flags | EVP_CIPH_##MODE##_MODE,                                               \
-        EVP_ORIG_GLOBAL,                                                              \
-        aesni_init_key,                                                               \
-        aesni_##mode##_cipher,                                                        \
-        NULL,                                                                         \
-        sizeof(EVP_AES_KEY),                                                          \
-        NULL, NULL, NULL, NULL                                                        \
-    };                                                                                \
-    static const EVP_CIPHER aes_##keylen##_##mode = {                                 \
-        nid##_##keylen##_##nmode, blocksize,                                          \
-        keylen / 8, ivlen,                                                            \
-        flags | EVP_CIPH_##MODE##_MODE,                                               \
-        EVP_ORIG_GLOBAL,                                                              \
-        aes_init_key,                                                                 \
-        aes_##mode##_cipher,                                                          \
-        NULL,                                                                         \
-        sizeof(EVP_AES_KEY),                                                          \
-        NULL, NULL, NULL, NULL                                                        \
-    };                                                                                \
-    const EVP_CIPHER *EVP_aes_##keylen##_##mode(void)                                 \
-    {                                                                                 \
-        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
-    }
-
-#define BLOCK_CIPHER_custom(nid, keylen, blocksize, ivlen, mode, MODE, flags)                                              \
-    static const EVP_CIPHER aesni_##keylen##_##mode = {                                                                    \
-        nid##_##keylen##_##mode, blocksize,                                                                                \
-        (EVP_CIPH_##MODE##_MODE == EVP_CIPH_XTS_MODE || EVP_CIPH_##MODE##_MODE == EVP_CIPH_SIV_MODE ? 2 : 1) * keylen / 8, \
-        ivlen,                                                                                                             \
-        flags | EVP_CIPH_##MODE##_MODE,                                                                                    \
-        EVP_ORIG_GLOBAL,                                                                                                   \
-        aesni_##mode##_init_key,                                                                                           \
-        aesni_##mode##_cipher,                                                                                             \
-        aes_##mode##_cleanup,                                                                                              \
-        sizeof(EVP_AES_##MODE##_CTX),                                                                                      \
-        NULL, NULL, aes_##mode##_ctrl, NULL                                                                                \
-    };                                                                                                                     \
-    static const EVP_CIPHER aes_##keylen##_##mode = {                                                                      \
-        nid##_##keylen##_##mode, blocksize,                                                                                \
-        (EVP_CIPH_##MODE##_MODE == EVP_CIPH_XTS_MODE || EVP_CIPH_##MODE##_MODE == EVP_CIPH_SIV_MODE ? 2 : 1) * keylen / 8, \
-        ivlen,                                                                                                             \
-        flags | EVP_CIPH_##MODE##_MODE,                                                                                    \
-        EVP_ORIG_GLOBAL,                                                                                                   \
-        aes_##mode##_init_key,                                                                                             \
-        aes_##mode##_cipher,                                                                                               \
-        aes_##mode##_cleanup,                                                                                              \
-        sizeof(EVP_AES_##MODE##_CTX),                                                                                      \
-        NULL, NULL, aes_##mode##_ctrl, NULL                                                                                \
-    };                                                                                                                     \
-    const EVP_CIPHER *EVP_aes_##keylen##_##mode(void)                                                                      \
-    {                                                                                                                      \
-        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;                                          \
-    }
-
-#elif defined(SPARC_AES_CAPABLE)
-
-static int aes_t4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    int ret, mode, bits;
-    EVP_AES_KEY *dat = EVP_C_DATA(EVP_AES_KEY, ctx);
-
-    mode = EVP_CIPHER_CTX_get_mode(ctx);
-    bits = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-    if (bits <= 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-        return 0;
-    }
-    if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE)
-        && !enc) {
-        ret = 0;
-        aes_t4_set_decrypt_key(key, bits, &dat->ks.ks);
-        dat->block = (block128_f)aes_t4_decrypt;
-        switch (bits) {
-        case 128:
-            dat->stream.cbc = mode == EVP_CIPH_CBC_MODE ? (cbc128_f)aes128_t4_cbc_decrypt : NULL;
-            break;
-        case 192:
-            dat->stream.cbc = mode == EVP_CIPH_CBC_MODE ? (cbc128_f)aes192_t4_cbc_decrypt : NULL;
-            break;
-        case 256:
-            dat->stream.cbc = mode == EVP_CIPH_CBC_MODE ? (cbc128_f)aes256_t4_cbc_decrypt : NULL;
-            break;
-        default:
-            ret = -1;
-        }
-    } else {
-        ret = 0;
-        aes_t4_set_encrypt_key(key, bits, &dat->ks.ks);
-        dat->block = (block128_f)aes_t4_encrypt;
-        switch (bits) {
-        case 128:
-            if (mode == EVP_CIPH_CBC_MODE)
-                dat->stream.cbc = (cbc128_f)aes128_t4_cbc_encrypt;
-            else if (mode == EVP_CIPH_CTR_MODE)
-                dat->stream.ctr = (ctr128_f)aes128_t4_ctr32_encrypt;
-            else
-                dat->stream.cbc = NULL;
-            break;
-        case 192:
-            if (mode == EVP_CIPH_CBC_MODE)
-                dat->stream.cbc = (cbc128_f)aes192_t4_cbc_encrypt;
-            else if (mode == EVP_CIPH_CTR_MODE)
-                dat->stream.ctr = (ctr128_f)aes192_t4_ctr32_encrypt;
-            else
-                dat->stream.cbc = NULL;
-            break;
-        case 256:
-            if (mode == EVP_CIPH_CBC_MODE)
-                dat->stream.cbc = (cbc128_f)aes256_t4_cbc_encrypt;
-            else if (mode == EVP_CIPH_CTR_MODE)
-                dat->stream.ctr = (ctr128_f)aes256_t4_ctr32_encrypt;
-            else
-                dat->stream.cbc = NULL;
-            break;
-        default:
-            ret = -1;
-        }
-    }
-
-    if (ret < 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_AES_KEY_SETUP_FAILED);
-        return 0;
-    }
-
-    return 1;
-}
-
-#define aes_t4_cbc_cipher aes_cbc_cipher
-static int aes_t4_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define aes_t4_ecb_cipher aes_ecb_cipher
-static int aes_t4_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define aes_t4_ofb_cipher aes_ofb_cipher
-static int aes_t4_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define aes_t4_cfb_cipher aes_cfb_cipher
-static int aes_t4_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define aes_t4_cfb8_cipher aes_cfb8_cipher
-static int aes_t4_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define aes_t4_cfb1_cipher aes_cfb1_cipher
-static int aes_t4_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define aes_t4_ctr_cipher aes_ctr_cipher
-static int aes_t4_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-static int aes_t4_gcm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    EVP_AES_GCM_CTX *gctx = EVP_C_DATA(EVP_AES_GCM_CTX, ctx);
-
-    if (iv == NULL && key == NULL)
-        return 1;
-    if (key) {
-        const int bits = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-
-        if (bits <= 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-        aes_t4_set_encrypt_key(key, bits, &gctx->ks.ks);
-        CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks,
-            (block128_f)aes_t4_encrypt);
-        switch (bits) {
-        case 128:
-            gctx->ctr = (ctr128_f)aes128_t4_ctr32_encrypt;
-            break;
-        case 192:
-            gctx->ctr = (ctr128_f)aes192_t4_ctr32_encrypt;
-            break;
-        case 256:
-            gctx->ctr = (ctr128_f)aes256_t4_ctr32_encrypt;
-            break;
-        default:
-            return 0;
-        }
-        /*
-         * If we have an iv can set it directly, otherwise use saved IV.
-         */
-        if (iv == NULL && gctx->iv_set)
-            iv = gctx->iv;
-        if (iv) {
-            CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen);
-            gctx->iv_set = 1;
-        }
-        gctx->key_set = 1;
-    } else {
-        /* If key set use IV, otherwise copy */
-        if (gctx->key_set)
-            CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen);
-        else
-            memcpy(gctx->iv, iv, gctx->ivlen);
-        gctx->iv_set = 1;
-        gctx->iv_gen = 0;
-    }
-    return 1;
-}
-
-#define aes_t4_gcm_cipher aes_gcm_cipher
-static int aes_t4_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-static int aes_t4_xts_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    EVP_AES_XTS_CTX *xctx = EVP_C_DATA(EVP_AES_XTS_CTX, ctx);
-
-    if (!iv && !key)
-        return 1;
-
-    if (key) {
-        /* The key is two half length keys in reality */
-        const int keylen = EVP_CIPHER_CTX_get_key_length(ctx);
-        const int bytes = keylen / 2;
-        const int bits = bytes * 8;
-
-        if (keylen <= 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-        /*
-         * Verify that the two keys are different.
-         *
-         * This addresses Rogaway's vulnerability.
-         * See comment in aes_xts_init_key() below.
-         */
-        if ((!allow_insecure_decrypt || enc)
-            && CRYPTO_memcmp(key, key + bytes, bytes) == 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_XTS_DUPLICATED_KEYS);
-            return 0;
-        }
-
-        xctx->stream = NULL;
-        /* key_len is two AES keys */
-        if (enc) {
-            aes_t4_set_encrypt_key(key, bits, &xctx->ks1.ks);
-            xctx->xts.block1 = (block128_f)aes_t4_encrypt;
-            switch (bits) {
-            case 128:
-                xctx->stream = aes128_t4_xts_encrypt;
-                break;
-            case 256:
-                xctx->stream = aes256_t4_xts_encrypt;
-                break;
-            default:
-                return 0;
-            }
-        } else {
-            aes_t4_set_decrypt_key(key, bits, &xctx->ks1.ks);
-            xctx->xts.block1 = (block128_f)aes_t4_decrypt;
-            switch (bits) {
-            case 128:
-                xctx->stream = aes128_t4_xts_decrypt;
-                break;
-            case 256:
-                xctx->stream = aes256_t4_xts_decrypt;
-                break;
-            default:
-                return 0;
-            }
-        }
-
-        aes_t4_set_encrypt_key(key + bytes, bits, &xctx->ks2.ks);
-        xctx->xts.block2 = (block128_f)aes_t4_encrypt;
-
-        xctx->xts.key1 = &xctx->ks1;
-    }
-
-    if (iv) {
-        xctx->xts.key2 = &xctx->ks2;
-        memcpy(ctx->iv, iv, 16);
-    }
-
-    return 1;
-}
-
-#define aes_t4_xts_cipher aes_xts_cipher
-static int aes_t4_xts_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-static int aes_t4_ccm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    EVP_AES_CCM_CTX *cctx = EVP_C_DATA(EVP_AES_CCM_CTX, ctx);
-
-    if (iv == NULL && key == NULL)
-        return 1;
-
-    if (key != NULL) {
-        const int bits = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-
-        if (bits <= 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-        aes_t4_set_encrypt_key(key, bits, &cctx->ks.ks);
-        CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L,
-            &cctx->ks, (block128_f)aes_t4_encrypt);
-        cctx->str = NULL;
-        cctx->key_set = 1;
-    }
-    if (iv) {
-        memcpy(ctx->iv, iv, 15 - cctx->L);
-        cctx->iv_set = 1;
-    }
-    return 1;
-}
-
-#define aes_t4_ccm_cipher aes_ccm_cipher
-static int aes_t4_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#ifndef OPENSSL_NO_OCB
-static int aes_t4_ocb_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    EVP_AES_OCB_CTX *octx = EVP_C_DATA(EVP_AES_OCB_CTX, ctx);
-
-    if (iv == NULL && key == NULL)
-        return 1;
-
-    if (key != NULL) {
-        const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-
-        if (keylen <= 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-        do {
-            /*
-             * We set both the encrypt and decrypt key here because decrypt
-             * needs both. We could possibly optimise to remove setting the
-             * decrypt for an encryption operation.
-             */
-            aes_t4_set_encrypt_key(key, keylen, &octx->ksenc.ks);
-            aes_t4_set_decrypt_key(key, keylen, &octx->ksdec.ks);
-            if (!CRYPTO_ocb128_init(&octx->ocb,
-                    &octx->ksenc.ks, &octx->ksdec.ks,
-                    (block128_f)aes_t4_encrypt,
-                    (block128_f)aes_t4_decrypt,
-                    NULL))
-                return 0;
-        } while (0);
-
-        /*
-         * If we have an iv we can set it directly, otherwise use saved IV.
-         */
-        if (iv == NULL && octx->iv_set)
-            iv = octx->iv;
-        if (iv) {
-            if (CRYPTO_ocb128_setiv(&octx->ocb, iv, octx->ivlen, octx->taglen)
-                != 1)
-                return 0;
-            octx->iv_set = 1;
-        }
-        octx->key_set = 1;
-    } else {
-        /* If key set use IV, otherwise copy */
-        if (octx->key_set)
-            CRYPTO_ocb128_setiv(&octx->ocb, iv, octx->ivlen, octx->taglen);
-        else
-            memcpy(octx->iv, iv, octx->ivlen);
-        octx->iv_set = 1;
-    }
-    return 1;
-}
-
-#define aes_t4_ocb_cipher aes_ocb_cipher
-static int aes_t4_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-#endif /* OPENSSL_NO_OCB */
-
-#ifndef OPENSSL_NO_SIV
-#define aes_t4_siv_init_key aes_siv_init_key
-#define aes_t4_siv_cipher aes_siv_cipher
-#endif /* OPENSSL_NO_SIV */
-
-#define BLOCK_CIPHER_generic(nid, keylen, blocksize, ivlen, nmode, mode, MODE, flags)  \
-    static const EVP_CIPHER aes_t4_##keylen##_##mode = {                               \
-        nid##_##keylen##_##nmode, blocksize, keylen / 8, ivlen,                        \
-        flags | EVP_CIPH_##MODE##_MODE,                                                \
-        EVP_ORIG_GLOBAL,                                                               \
-        aes_t4_init_key,                                                               \
-        aes_t4_##mode##_cipher,                                                        \
-        NULL,                                                                          \
-        sizeof(EVP_AES_KEY),                                                           \
-        NULL, NULL, NULL, NULL                                                         \
-    };                                                                                 \
-    static const EVP_CIPHER aes_##keylen##_##mode = {                                  \
-        nid##_##keylen##_##nmode, blocksize,                                           \
-        keylen / 8, ivlen,                                                             \
-        flags | EVP_CIPH_##MODE##_MODE,                                                \
-        EVP_ORIG_GLOBAL,                                                               \
-        aes_init_key,                                                                  \
-        aes_##mode##_cipher,                                                           \
-        NULL,                                                                          \
-        sizeof(EVP_AES_KEY),                                                           \
-        NULL, NULL, NULL, NULL                                                         \
-    };                                                                                 \
-    const EVP_CIPHER *EVP_aes_##keylen##_##mode(void)                                  \
-    {                                                                                  \
-        return SPARC_AES_CAPABLE ? &aes_t4_##keylen##_##mode : &aes_##keylen##_##mode; \
-    }
-
-#define BLOCK_CIPHER_custom(nid, keylen, blocksize, ivlen, mode, MODE, flags)                                              \
-    static const EVP_CIPHER aes_t4_##keylen##_##mode = {                                                                   \
-        nid##_##keylen##_##mode, blocksize,                                                                                \
-        (EVP_CIPH_##MODE##_MODE == EVP_CIPH_XTS_MODE || EVP_CIPH_##MODE##_MODE == EVP_CIPH_SIV_MODE ? 2 : 1) * keylen / 8, \
-        ivlen,                                                                                                             \
-        flags | EVP_CIPH_##MODE##_MODE,                                                                                    \
-        EVP_ORIG_GLOBAL,                                                                                                   \
-        aes_t4_##mode##_init_key,                                                                                          \
-        aes_t4_##mode##_cipher,                                                                                            \
-        aes_##mode##_cleanup,                                                                                              \
-        sizeof(EVP_AES_##MODE##_CTX),                                                                                      \
-        NULL, NULL, aes_##mode##_ctrl, NULL                                                                                \
-    };                                                                                                                     \
-    static const EVP_CIPHER aes_##keylen##_##mode = {                                                                      \
-        nid##_##keylen##_##mode, blocksize,                                                                                \
-        (EVP_CIPH_##MODE##_MODE == EVP_CIPH_XTS_MODE || EVP_CIPH_##MODE##_MODE == EVP_CIPH_SIV_MODE ? 2 : 1) * keylen / 8, \
-        ivlen,                                                                                                             \
-        flags | EVP_CIPH_##MODE##_MODE,                                                                                    \
-        EVP_ORIG_GLOBAL,                                                                                                   \
-        aes_##mode##_init_key,                                                                                             \
-        aes_##mode##_cipher,                                                                                               \
-        aes_##mode##_cleanup,                                                                                              \
-        sizeof(EVP_AES_##MODE##_CTX),                                                                                      \
-        NULL, NULL, aes_##mode##_ctrl, NULL                                                                                \
-    };                                                                                                                     \
-    const EVP_CIPHER *EVP_aes_##keylen##_##mode(void)                                                                      \
-    {                                                                                                                      \
-        return SPARC_AES_CAPABLE ? &aes_t4_##keylen##_##mode : &aes_##keylen##_##mode;                                     \
-    }
-
-#elif defined(S390X_aes_128_CAPABLE)
-/* IBM S390X support */
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        /*-
-         * KM-AES parameter block - begin
-         * (see z/Architecture Principles of Operation >= SA22-7832-06)
-         */
-        struct {
-            unsigned char k[32];
-        } param;
-        /* KM-AES parameter block - end */
-    } km;
-    unsigned int fc;
-} S390X_AES_ECB_CTX;
-
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        /*-
-         * KMO-AES parameter block - begin
-         * (see z/Architecture Principles of Operation >= SA22-7832-08)
-         */
-        struct {
-            unsigned char cv[16];
-            unsigned char k[32];
-        } param;
-        /* KMO-AES parameter block - end */
-    } kmo;
-    unsigned int fc;
-} S390X_AES_OFB_CTX;
-
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        /*-
-         * KMF-AES parameter block - begin
-         * (see z/Architecture Principles of Operation >= SA22-7832-08)
-         */
-        struct {
-            unsigned char cv[16];
-            unsigned char k[32];
-        } param;
-        /* KMF-AES parameter block - end */
-    } kmf;
-    unsigned int fc;
-} S390X_AES_CFB_CTX;
-
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        /*-
-         * KMA-GCM-AES parameter block - begin
-         * (see z/Architecture Principles of Operation >= SA22-7832-11)
-         */
-        struct {
-            unsigned char reserved[12];
-            union {
-                unsigned int w;
-                unsigned char b[4];
-            } cv;
-            union {
-                unsigned long long g[2];
-                unsigned char b[16];
-            } t;
-            unsigned char h[16];
-            unsigned long long taadl;
-            unsigned long long tpcl;
-            union {
-                unsigned long long g[2];
-                unsigned int w[4];
-            } j0;
-            unsigned char k[32];
-        } param;
-        /* KMA-GCM-AES parameter block - end */
-    } kma;
-    unsigned int fc;
-    int key_set;
-
-    unsigned char *iv;
-    int ivlen;
-    int iv_set;
-    int iv_gen;
-
-    int taglen;
-
-    unsigned char ares[16];
-    unsigned char mres[16];
-    unsigned char kres[16];
-    int areslen;
-    int mreslen;
-    int kreslen;
-
-    int tls_aad_len;
-    uint64_t tls_enc_records; /* Number of TLS records encrypted */
-} S390X_AES_GCM_CTX;
-
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        /*-
-         * Padding is chosen so that ccm.kmac_param.k overlaps with key.k and
-         * ccm.fc with key.k.rounds. Remember that on s390x, an AES_KEY's
-         * rounds field is used to store the function code and that the key
-         * schedule is not stored (if aes hardware support is detected).
-         */
-        struct {
-            unsigned char pad[16];
-            AES_KEY k;
-        } key;
-
-        struct {
-            /*-
-             * KMAC-AES parameter block - begin
-             * (see z/Architecture Principles of Operation >= SA22-7832-08)
-             */
-            struct {
-                union {
-                    unsigned long long g[2];
-                    unsigned char b[16];
-                } icv;
-                unsigned char k[32];
-            } kmac_param;
-            /* KMAC-AES parameter block - end */
-
-            union {
-                unsigned long long g[2];
-                unsigned char b[16];
-            } nonce;
-            union {
-                unsigned long long g[2];
-                unsigned char b[16];
-            } buf;
-
-            unsigned long long blocks;
-            int l;
-            int m;
-            int tls_aad_len;
-            int iv_set;
-            int tag_set;
-            int len_set;
-            int key_set;
-
-            unsigned char pad[140];
-            unsigned int fc;
-        } ccm;
-    } aes;
-} S390X_AES_CCM_CTX;
-
-#define s390x_aes_init_key aes_init_key
-static int s390x_aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-
-#define S390X_AES_CBC_CTX EVP_AES_KEY
-
-#define s390x_aes_cbc_init_key aes_init_key
-
-#define s390x_aes_cbc_cipher aes_cbc_cipher
-static int s390x_aes_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-static int s390x_aes_ecb_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    S390X_AES_ECB_CTX *cctx = EVP_C_DATA(S390X_AES_ECB_CTX, ctx);
-    const int keylen = EVP_CIPHER_CTX_get_key_length(ctx);
-
-    if (keylen <= 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-        return 0;
-    }
-    cctx->fc = S390X_AES_FC(keylen);
-    if (!enc)
-        cctx->fc |= S390X_DECRYPT;
-
-    memcpy(cctx->km.param.k, key, keylen);
-    return 1;
-}
-
-static int s390x_aes_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    S390X_AES_ECB_CTX *cctx = EVP_C_DATA(S390X_AES_ECB_CTX, ctx);
-
-    s390x_km(in, len, out, cctx->fc, &cctx->km.param);
-    return 1;
-}
-
-static int s390x_aes_ofb_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *ivec, int enc)
-{
-    S390X_AES_OFB_CTX *cctx = EVP_C_DATA(S390X_AES_OFB_CTX, ctx);
-    const unsigned char *iv = ctx->oiv;
-    const int keylen = EVP_CIPHER_CTX_get_key_length(ctx);
-    const int ivlen = EVP_CIPHER_CTX_get_iv_length(ctx);
-
-    if (keylen <= 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-        return 0;
-    }
-    if (ivlen <= 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH);
-        return 0;
-    }
-    memcpy(cctx->kmo.param.cv, iv, ivlen);
-    memcpy(cctx->kmo.param.k, key, keylen);
-    cctx->fc = S390X_AES_FC(keylen);
-    return 1;
-}
-
-static int s390x_aes_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    S390X_AES_OFB_CTX *cctx = EVP_C_DATA(S390X_AES_OFB_CTX, ctx);
-    const int ivlen = EVP_CIPHER_CTX_get_iv_length(ctx);
-    unsigned char *iv = EVP_CIPHER_CTX_iv_noconst(ctx);
-    int n = ctx->num;
-    int rem;
-
-    memcpy(cctx->kmo.param.cv, iv, ivlen);
-    while (n && len) {
-        *out = *in ^ cctx->kmo.param.cv[n];
-        n = (n + 1) & 0xf;
-        --len;
-        ++in;
-        ++out;
-    }
-
-    rem = len & 0xf;
-
-    len &= ~(size_t)0xf;
-    if (len) {
-        s390x_kmo(in, len, out, cctx->fc, &cctx->kmo.param);
-
-        out += len;
-        in += len;
-    }
-
-    if (rem) {
-        s390x_km(cctx->kmo.param.cv, 16, cctx->kmo.param.cv, cctx->fc,
-            cctx->kmo.param.k);
-
-        while (rem--) {
-            out[n] = in[n] ^ cctx->kmo.param.cv[n];
-            ++n;
-        }
-    }
-
-    memcpy(iv, cctx->kmo.param.cv, ivlen);
-    ctx->num = n;
-    return 1;
-}
-
-static int s390x_aes_cfb_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *ivec, int enc)
-{
-    S390X_AES_CFB_CTX *cctx = EVP_C_DATA(S390X_AES_CFB_CTX, ctx);
-    const unsigned char *iv = ctx->oiv;
-    const int keylen = EVP_CIPHER_CTX_get_key_length(ctx);
-    const int ivlen = EVP_CIPHER_CTX_get_iv_length(ctx);
-
-    if (keylen <= 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-        return 0;
-    }
-    if (ivlen <= 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH);
-        return 0;
-    }
-    cctx->fc = S390X_AES_FC(keylen);
-    cctx->fc |= 16 << 24; /* 16 bytes cipher feedback */
-    if (!enc)
-        cctx->fc |= S390X_DECRYPT;
-
-    memcpy(cctx->kmf.param.cv, iv, ivlen);
-    memcpy(cctx->kmf.param.k, key, keylen);
-    return 1;
-}
-
-static int s390x_aes_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    S390X_AES_CFB_CTX *cctx = EVP_C_DATA(S390X_AES_CFB_CTX, ctx);
-    const int keylen = EVP_CIPHER_CTX_get_key_length(ctx);
-    const int enc = EVP_CIPHER_CTX_is_encrypting(ctx);
-    const int ivlen = EVP_CIPHER_CTX_get_iv_length(ctx);
-    unsigned char *iv = EVP_CIPHER_CTX_iv_noconst(ctx);
-    int n = ctx->num;
-    int rem;
-    unsigned char tmp;
-
-    if (keylen <= 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-        return 0;
-    }
-    if (ivlen <= 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH);
-        return 0;
-    }
-    memcpy(cctx->kmf.param.cv, iv, ivlen);
-    while (n && len) {
-        tmp = *in;
-        *out = cctx->kmf.param.cv[n] ^ tmp;
-        cctx->kmf.param.cv[n] = enc ? *out : tmp;
-        n = (n + 1) & 0xf;
-        --len;
-        ++in;
-        ++out;
-    }
-
-    rem = len & 0xf;
-
-    len &= ~(size_t)0xf;
-    if (len) {
-        s390x_kmf(in, len, out, cctx->fc, &cctx->kmf.param);
-
-        out += len;
-        in += len;
-    }
-
-    if (rem) {
-        s390x_km(cctx->kmf.param.cv, 16, cctx->kmf.param.cv,
-            S390X_AES_FC(keylen), cctx->kmf.param.k);
-
-        while (rem--) {
-            tmp = in[n];
-            out[n] = cctx->kmf.param.cv[n] ^ tmp;
-            cctx->kmf.param.cv[n] = enc ? out[n] : tmp;
-            ++n;
-        }
-    }
-
-    memcpy(iv, cctx->kmf.param.cv, ivlen);
-    ctx->num = n;
-    return 1;
-}
-
-static int s390x_aes_cfb8_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *ivec, int enc)
-{
-    S390X_AES_CFB_CTX *cctx = EVP_C_DATA(S390X_AES_CFB_CTX, ctx);
-    const unsigned char *iv = ctx->oiv;
-    const int keylen = EVP_CIPHER_CTX_get_key_length(ctx);
-    const int ivlen = EVP_CIPHER_CTX_get_iv_length(ctx);
-
-    if (keylen <= 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-        return 0;
-    }
-    if (ivlen <= 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH);
-        return 0;
-    }
-    cctx->fc = S390X_AES_FC(keylen);
-    cctx->fc |= 1 << 24; /* 1 byte cipher feedback */
-    if (!enc)
-        cctx->fc |= S390X_DECRYPT;
-
-    memcpy(cctx->kmf.param.cv, iv, ivlen);
-    memcpy(cctx->kmf.param.k, key, keylen);
-    return 1;
-}
-
-static int s390x_aes_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    S390X_AES_CFB_CTX *cctx = EVP_C_DATA(S390X_AES_CFB_CTX, ctx);
-    const int ivlen = EVP_CIPHER_CTX_get_iv_length(ctx);
-    unsigned char *iv = EVP_CIPHER_CTX_iv_noconst(ctx);
-
-    memcpy(cctx->kmf.param.cv, iv, ivlen);
-    s390x_kmf(in, len, out, cctx->fc, &cctx->kmf.param);
-    memcpy(iv, cctx->kmf.param.cv, ivlen);
-    return 1;
-}
-
-#define s390x_aes_cfb1_init_key aes_init_key
-
-#define s390x_aes_cfb1_cipher aes_cfb1_cipher
-static int s390x_aes_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define S390X_AES_CTR_CTX EVP_AES_KEY
-
-#define s390x_aes_ctr_init_key aes_init_key
-
-#define s390x_aes_ctr_cipher aes_ctr_cipher
-static int s390x_aes_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-/* iv + padding length for iv lengths != 12 */
-#define S390X_gcm_ivpadlen(i) ((((i) + 15) >> 4 << 4) + 16)
-
-/*-
- * Process additional authenticated data. Returns 0 on success. Code is
- * big-endian.
- */
-static int s390x_aes_gcm_aad(S390X_AES_GCM_CTX *ctx, const unsigned char *aad,
-    size_t len)
-{
-    unsigned long long alen;
-    int n, rem;
-
-    if (ctx->kma.param.tpcl)
-        return -2;
-
-    alen = ctx->kma.param.taadl + len;
-    if (alen > (U64(1) << 61) || (sizeof(len) == 8 && alen < len))
-        return -1;
-    ctx->kma.param.taadl = alen;
-
-    n = ctx->areslen;
-    if (n) {
-        while (n && len) {
-            ctx->ares[n] = *aad;
-            n = (n + 1) & 0xf;
-            ++aad;
-            --len;
-        }
-        /* ctx->ares contains a complete block if offset has wrapped around */
-        if (!n) {
-            s390x_kma(ctx->ares, 16, NULL, 0, NULL, ctx->fc, &ctx->kma.param);
-            ctx->fc |= S390X_KMA_HS;
-        }
-        ctx->areslen = n;
-    }
-
-    rem = len & 0xf;
-
-    len &= ~(size_t)0xf;
-    if (len) {
-        s390x_kma(aad, len, NULL, 0, NULL, ctx->fc, &ctx->kma.param);
-        aad += len;
-        ctx->fc |= S390X_KMA_HS;
-    }
-
-    if (rem) {
-        ctx->areslen = rem;
-
-        do {
-            --rem;
-            ctx->ares[rem] = aad[rem];
-        } while (rem);
-    }
-    return 0;
-}
-
-/*-
- * En/de-crypt plain/cipher-text and authenticate ciphertext. Returns 0 for
- * success. Code is big-endian.
- */
-static int s390x_aes_gcm(S390X_AES_GCM_CTX *ctx, const unsigned char *in,
-    unsigned char *out, size_t len)
-{
-    const unsigned char *inptr;
-    unsigned long long mlen;
-    union {
-        unsigned int w[4];
-        unsigned char b[16];
-    } buf;
-    size_t inlen;
-    int n, rem, i;
-
-    mlen = ctx->kma.param.tpcl + len;
-    if (mlen > ((U64(1) << 36) - 32) || (sizeof(len) == 8 && mlen < len))
-        return -1;
-    ctx->kma.param.tpcl = mlen;
-
-    n = ctx->mreslen;
-    if (n) {
-        inptr = in;
-        inlen = len;
-        while (n && inlen) {
-            ctx->mres[n] = *inptr;
-            n = (n + 1) & 0xf;
-            ++inptr;
-            --inlen;
-        }
-        /* ctx->mres contains a complete block if offset has wrapped around */
-        if (!n) {
-            s390x_kma(ctx->ares, ctx->areslen, ctx->mres, 16, buf.b,
-                ctx->fc | S390X_KMA_LAAD, &ctx->kma.param);
-            ctx->fc |= S390X_KMA_HS;
-            ctx->areslen = 0;
-
-            /* previous call already encrypted/decrypted its remainder,
-             * see comment below */
-            n = ctx->mreslen;
-            while (n) {
-                *out = buf.b[n];
-                n = (n + 1) & 0xf;
-                ++out;
-                ++in;
-                --len;
-            }
-            ctx->mreslen = 0;
-        }
-    }
-
-    rem = len & 0xf;
-
-    len &= ~(size_t)0xf;
-    if (len) {
-        s390x_kma(ctx->ares, ctx->areslen, in, len, out,
-            ctx->fc | S390X_KMA_LAAD, &ctx->kma.param);
-        in += len;
-        out += len;
-        ctx->fc |= S390X_KMA_HS;
-        ctx->areslen = 0;
-    }
-
-    /*-
-     * If there is a remainder, it has to be saved such that it can be
-     * processed by kma later. However, we also have to do the for-now
-     * unauthenticated encryption/decryption part here and now...
-     */
-    if (rem) {
-        if (!ctx->mreslen) {
-            buf.w[0] = ctx->kma.param.j0.w[0];
-            buf.w[1] = ctx->kma.param.j0.w[1];
-            buf.w[2] = ctx->kma.param.j0.w[2];
-            buf.w[3] = ctx->kma.param.cv.w + 1;
-            s390x_km(buf.b, 16, ctx->kres, ctx->fc & 0x1f, &ctx->kma.param.k);
-        }
-
-        n = ctx->mreslen;
-        for (i = 0; i < rem; i++) {
-            ctx->mres[n + i] = in[i];
-            out[i] = in[i] ^ ctx->kres[n + i];
-        }
-
-        ctx->mreslen += rem;
-    }
-    return 0;
-}
-
-/*-
- * Initialize context structure. Code is big-endian.
- */
-static void s390x_aes_gcm_setiv(S390X_AES_GCM_CTX *ctx,
-    const unsigned char *iv)
-{
-    ctx->kma.param.t.g[0] = 0;
-    ctx->kma.param.t.g[1] = 0;
-    ctx->kma.param.tpcl = 0;
-    ctx->kma.param.taadl = 0;
-    ctx->mreslen = 0;
-    ctx->areslen = 0;
-    ctx->kreslen = 0;
-
-    if (ctx->ivlen == 12) {
-        memcpy(&ctx->kma.param.j0, iv, ctx->ivlen);
-        ctx->kma.param.j0.w[3] = 1;
-        ctx->kma.param.cv.w = 1;
-    } else {
-        /* ctx->iv has the right size and is already padded. */
-        memcpy(ctx->iv, iv, ctx->ivlen);
-        s390x_kma(ctx->iv, S390X_gcm_ivpadlen(ctx->ivlen), NULL, 0, NULL,
-            ctx->fc, &ctx->kma.param);
-        ctx->fc |= S390X_KMA_HS;
-
-        ctx->kma.param.j0.g[0] = ctx->kma.param.t.g[0];
-        ctx->kma.param.j0.g[1] = ctx->kma.param.t.g[1];
-        ctx->kma.param.cv.w = ctx->kma.param.j0.w[3];
-        ctx->kma.param.t.g[0] = 0;
-        ctx->kma.param.t.g[1] = 0;
-    }
-}
-
-/*-
- * Performs various operations on the context structure depending on control
- * type. Returns 1 for success, 0 for failure and -1 for unknown control type.
- * Code is big-endian.
- */
-static int s390x_aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
-{
-    S390X_AES_GCM_CTX *gctx = EVP_C_DATA(S390X_AES_GCM_CTX, c);
-    S390X_AES_GCM_CTX *gctx_out;
-    EVP_CIPHER_CTX *out;
-    unsigned char *buf;
-    int ivlen, enc, len;
-
-    switch (type) {
-    case EVP_CTRL_INIT:
-        ivlen = EVP_CIPHER_get_iv_length(c->cipher);
-        gctx->key_set = 0;
-        gctx->iv_set = 0;
-        gctx->ivlen = ivlen;
-        gctx->iv = c->iv;
-        gctx->taglen = -1;
-        gctx->iv_gen = 0;
-        gctx->tls_aad_len = -1;
-        return 1;
-
-    case EVP_CTRL_GET_IVLEN:
-        *(int *)ptr = gctx->ivlen;
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_IVLEN:
-        if (arg <= 0 || arg > EVP_MAX_IV_LENGTH)
-            return 0;
-
-        if (arg != 12) {
-            len = S390X_gcm_ivpadlen(arg);
-
-            /* Allocate memory for iv if needed. */
-            if (gctx->ivlen == 12 || len > S390X_gcm_ivpadlen(gctx->ivlen)) {
-                if (gctx->iv != c->iv)
-                    OPENSSL_free(gctx->iv);
-
-                if ((gctx->iv = OPENSSL_malloc(len)) == NULL)
-                    return 0;
-            }
-            /* Add padding. */
-            memset(gctx->iv + arg, 0, len - arg - 8);
-            *((unsigned long long *)(gctx->iv + len - 8)) = arg << 3;
-        }
-        gctx->ivlen = arg;
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_TAG:
-        buf = EVP_CIPHER_CTX_buf_noconst(c);
-        enc = EVP_CIPHER_CTX_is_encrypting(c);
-        if (arg <= 0 || arg > 16 || enc)
-            return 0;
-
-        memcpy(buf, ptr, arg);
-        gctx->taglen = arg;
-        return 1;
-
-    case EVP_CTRL_AEAD_GET_TAG:
-        enc = EVP_CIPHER_CTX_is_encrypting(c);
-        if (arg <= 0 || arg > 16 || !enc || gctx->taglen < 0)
-            return 0;
-
-        memcpy(ptr, gctx->kma.param.t.b, arg);
-        return 1;
-
-    case EVP_CTRL_GCM_SET_IV_FIXED:
-        /* Special case: -1 length restores whole iv */
-        if (arg == -1) {
-            memcpy(gctx->iv, ptr, gctx->ivlen);
-            gctx->iv_gen = 1;
-            return 1;
-        }
-        /*
-         * Fixed field must be at least 4 bytes and invocation field at least
-         * 8.
-         */
-        if ((arg < 4) || (gctx->ivlen - arg) < 8)
-            return 0;
-
-        if (arg)
-            memcpy(gctx->iv, ptr, arg);
-
-        enc = EVP_CIPHER_CTX_is_encrypting(c);
-        if (enc && RAND_bytes(gctx->iv + arg, gctx->ivlen - arg) <= 0)
-            return 0;
-
-        gctx->iv_gen = 1;
-        return 1;
-
-    case EVP_CTRL_GCM_IV_GEN:
-        if (gctx->iv_gen == 0 || gctx->key_set == 0)
-            return 0;
-
-        s390x_aes_gcm_setiv(gctx, gctx->iv);
-
-        if (arg <= 0 || arg > gctx->ivlen)
-            arg = gctx->ivlen;
-
-        memcpy(ptr, gctx->iv + gctx->ivlen - arg, arg);
-        /*
-         * Invocation field will be at least 8 bytes in size and so no need
-         * to check wrap around or increment more than last 8 bytes.
-         */
-        ctr64_inc(gctx->iv + gctx->ivlen - 8);
-        gctx->iv_set = 1;
-        return 1;
-
-    case EVP_CTRL_GCM_SET_IV_INV:
-        enc = EVP_CIPHER_CTX_is_encrypting(c);
-        if (gctx->iv_gen == 0 || gctx->key_set == 0 || enc)
-            return 0;
-
-        memcpy(gctx->iv + gctx->ivlen - arg, ptr, arg);
-        s390x_aes_gcm_setiv(gctx, gctx->iv);
-        gctx->iv_set = 1;
-        return 1;
-
-    case EVP_CTRL_AEAD_TLS1_AAD:
-        /* Save the aad for later use. */
-        if (arg != EVP_AEAD_TLS1_AAD_LEN)
-            return 0;
-
-        buf = EVP_CIPHER_CTX_buf_noconst(c);
-        memcpy(buf, ptr, arg);
-        gctx->tls_aad_len = arg;
-        gctx->tls_enc_records = 0;
-
-        len = buf[arg - 2] << 8 | buf[arg - 1];
-        /* Correct length for explicit iv. */
-        if (len < EVP_GCM_TLS_EXPLICIT_IV_LEN)
-            return 0;
-        len -= EVP_GCM_TLS_EXPLICIT_IV_LEN;
-
-        /* If decrypting correct for tag too. */
-        enc = EVP_CIPHER_CTX_is_encrypting(c);
-        if (!enc) {
-            if (len < EVP_GCM_TLS_TAG_LEN)
-                return 0;
-            len -= EVP_GCM_TLS_TAG_LEN;
-        }
-        buf[arg - 2] = len >> 8;
-        buf[arg - 1] = len & 0xff;
-        /* Extra padding: tag appended to record. */
-        return EVP_GCM_TLS_TAG_LEN;
-
-    case EVP_CTRL_COPY:
-        out = ptr;
-        gctx_out = EVP_C_DATA(S390X_AES_GCM_CTX, out);
-
-        if (gctx->iv == c->iv) {
-            gctx_out->iv = out->iv;
-        } else {
-            len = S390X_gcm_ivpadlen(gctx->ivlen);
-
-            if ((gctx_out->iv = OPENSSL_malloc(len)) == NULL)
-                return 0;
-
-            memcpy(gctx_out->iv, gctx->iv, len);
-        }
-        return 1;
-
-    default:
-        return -1;
-    }
-}
-
-/*-
- * Set key and/or iv. Returns 1 on success. Otherwise 0 is returned.
- */
-static int s390x_aes_gcm_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    S390X_AES_GCM_CTX *gctx = EVP_C_DATA(S390X_AES_GCM_CTX, ctx);
-    int keylen;
-
-    if (iv == NULL && key == NULL)
-        return 1;
-
-    if (key != NULL) {
-        keylen = EVP_CIPHER_CTX_get_key_length(ctx);
-        if (keylen <= 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-
-        memcpy(&gctx->kma.param.k, key, keylen);
-
-        gctx->fc = S390X_AES_FC(keylen);
-        if (!enc)
-            gctx->fc |= S390X_DECRYPT;
-
-        if (iv == NULL && gctx->iv_set)
-            iv = gctx->iv;
-
-        if (iv != NULL) {
-            s390x_aes_gcm_setiv(gctx, iv);
-            gctx->iv_set = 1;
-        }
-        gctx->key_set = 1;
-    } else {
-        if (gctx->key_set)
-            s390x_aes_gcm_setiv(gctx, iv);
-        else
-            memcpy(gctx->iv, iv, gctx->ivlen);
-
-        gctx->iv_set = 1;
-        gctx->iv_gen = 0;
-    }
-    return 1;
-}
-
-/*-
- * En/de-crypt and authenticate TLS packet. Returns the number of bytes written
- * if successful. Otherwise -1 is returned. Code is big-endian.
- */
-static int s390x_aes_gcm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    S390X_AES_GCM_CTX *gctx = EVP_C_DATA(S390X_AES_GCM_CTX, ctx);
-    const unsigned char *buf = EVP_CIPHER_CTX_buf_noconst(ctx);
-    const int enc = EVP_CIPHER_CTX_is_encrypting(ctx);
-    int rv = -1;
-
-    if (out != in || len < (EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN))
-        return -1;
-
-    /*
-     * Check for too many keys as per FIPS 140-2 IG A.5 "Key/IV Pair Uniqueness
-     * Requirements from SP 800-38D".  The requirements is for one party to the
-     * communication to fail after 2^64 - 1 keys.  We do this on the encrypting
-     * side only.
-     */
-    if (enc && ++gctx->tls_enc_records == 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_TOO_MANY_RECORDS);
-        goto err;
-    }
-
-    if (EVP_CIPHER_CTX_ctrl(ctx, enc ? EVP_CTRL_GCM_IV_GEN : EVP_CTRL_GCM_SET_IV_INV,
-            EVP_GCM_TLS_EXPLICIT_IV_LEN, out)
-        <= 0)
-        goto err;
-
-    in += EVP_GCM_TLS_EXPLICIT_IV_LEN;
-    out += EVP_GCM_TLS_EXPLICIT_IV_LEN;
-    len -= EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN;
-
-    gctx->kma.param.taadl = gctx->tls_aad_len << 3;
-    gctx->kma.param.tpcl = len << 3;
-    s390x_kma(buf, gctx->tls_aad_len, in, len, out,
-        gctx->fc | S390X_KMA_LAAD | S390X_KMA_LPC, &gctx->kma.param);
-
-    if (enc) {
-        memcpy(out + len, gctx->kma.param.t.b, EVP_GCM_TLS_TAG_LEN);
-        rv = len + EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN;
-    } else {
-        if (CRYPTO_memcmp(gctx->kma.param.t.b, in + len,
-                EVP_GCM_TLS_TAG_LEN)) {
-            OPENSSL_cleanse(out, len);
-            goto err;
-        }
-        rv = len;
-    }
-err:
-    gctx->iv_set = 0;
-    gctx->tls_aad_len = -1;
-    return rv;
-}
-
-/*-
- * Called from EVP layer to initialize context, process additional
- * authenticated data, en/de-crypt plain/cipher-text and authenticate
- * ciphertext or process a TLS packet, depending on context. Returns bytes
- * written on success. Otherwise -1 is returned. Code is big-endian.
- */
-static int s390x_aes_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    S390X_AES_GCM_CTX *gctx = EVP_C_DATA(S390X_AES_GCM_CTX, ctx);
-    unsigned char *buf, tmp[16];
-    int enc;
-
-    if (!gctx->key_set)
-        return -1;
-
-    if (gctx->tls_aad_len >= 0)
-        return s390x_aes_gcm_tls_cipher(ctx, out, in, len);
-
-    if (!gctx->iv_set)
-        return -1;
-
-    if (in != NULL) {
-        if (out == NULL) {
-            if (s390x_aes_gcm_aad(gctx, in, len))
-                return -1;
-        } else {
-            if (s390x_aes_gcm(gctx, in, out, len))
-                return -1;
-        }
-        return len;
-    } else {
-        gctx->kma.param.taadl <<= 3;
-        gctx->kma.param.tpcl <<= 3;
-        s390x_kma(gctx->ares, gctx->areslen, gctx->mres, gctx->mreslen, tmp,
-            gctx->fc | S390X_KMA_LAAD | S390X_KMA_LPC, &gctx->kma.param);
-        /* recall that we already did en-/decrypt gctx->mres
-         * and returned it to caller... */
-        OPENSSL_cleanse(tmp, gctx->mreslen);
-        gctx->iv_set = 0;
-
-        enc = EVP_CIPHER_CTX_is_encrypting(ctx);
-        if (enc) {
-            gctx->taglen = 16;
-        } else {
-            if (gctx->taglen < 0)
-                return -1;
-
-            buf = EVP_CIPHER_CTX_buf_noconst(ctx);
-            if (CRYPTO_memcmp(buf, gctx->kma.param.t.b, gctx->taglen))
-                return -1;
-        }
-        return 0;
-    }
-}
-
-static int s390x_aes_gcm_cleanup(EVP_CIPHER_CTX *c)
-{
-    S390X_AES_GCM_CTX *gctx = EVP_C_DATA(S390X_AES_GCM_CTX, c);
-
-    if (gctx == NULL)
-        return 0;
-
-    if (gctx->iv != c->iv)
-        OPENSSL_free(gctx->iv);
-
-    OPENSSL_cleanse(gctx, sizeof(*gctx));
-    return 1;
-}
-
-#define S390X_AES_XTS_CTX EVP_AES_XTS_CTX
-
-#define s390x_aes_xts_init_key aes_xts_init_key
-static int s390x_aes_xts_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *iv, int enc);
-#define s390x_aes_xts_cipher aes_xts_cipher
-static int s390x_aes_xts_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-#define s390x_aes_xts_ctrl aes_xts_ctrl
-static int s390x_aes_xts_ctrl(EVP_CIPHER_CTX *, int type, int arg, void *ptr);
-#define s390x_aes_xts_cleanup aes_xts_cleanup
-
-/*-
- * Set nonce and length fields. Code is big-endian.
- */
-static inline void s390x_aes_ccm_setiv(S390X_AES_CCM_CTX *ctx,
-    const unsigned char *nonce,
-    size_t mlen)
-{
-    ctx->aes.ccm.nonce.b[0] &= ~S390X_CCM_AAD_FLAG;
-    ctx->aes.ccm.nonce.g[1] = mlen;
-    memcpy(ctx->aes.ccm.nonce.b + 1, nonce, 15 - ctx->aes.ccm.l);
-}
-
-/*-
- * Process additional authenticated data. Code is big-endian.
- */
-static void s390x_aes_ccm_aad(S390X_AES_CCM_CTX *ctx, const unsigned char *aad,
-    size_t alen)
-{
-    unsigned char *ptr;
-    int i, rem;
-
-    if (!alen)
-        return;
-
-    ctx->aes.ccm.nonce.b[0] |= S390X_CCM_AAD_FLAG;
-
-    /* Suppress 'type-punned pointer dereference' warning. */
-    ptr = ctx->aes.ccm.buf.b;
-
-    if (alen < ((1 << 16) - (1 << 8))) {
-        *(uint16_t *)ptr = alen;
-        i = 2;
-    } else if (sizeof(alen) == 8
-        && alen >= (size_t)1 << (32 % (sizeof(alen) * 8))) {
-        *(uint16_t *)ptr = 0xffff;
-        *(uint64_t *)(ptr + 2) = alen;
-        i = 10;
-    } else {
-        *(uint16_t *)ptr = 0xfffe;
-        *(uint32_t *)(ptr + 2) = alen;
-        i = 6;
-    }
-
-    while (i < 16 && alen) {
-        ctx->aes.ccm.buf.b[i] = *aad;
-        ++aad;
-        --alen;
-        ++i;
-    }
-    while (i < 16) {
-        ctx->aes.ccm.buf.b[i] = 0;
-        ++i;
-    }
-
-    ctx->aes.ccm.kmac_param.icv.g[0] = 0;
-    ctx->aes.ccm.kmac_param.icv.g[1] = 0;
-    s390x_kmac(ctx->aes.ccm.nonce.b, 32, ctx->aes.ccm.fc,
-        &ctx->aes.ccm.kmac_param);
-    ctx->aes.ccm.blocks += 2;
-
-    rem = alen & 0xf;
-    alen &= ~(size_t)0xf;
-    if (alen) {
-        s390x_kmac(aad, alen, ctx->aes.ccm.fc, &ctx->aes.ccm.kmac_param);
-        ctx->aes.ccm.blocks += alen >> 4;
-        aad += alen;
-    }
-    if (rem) {
-        for (i = 0; i < rem; i++)
-            ctx->aes.ccm.kmac_param.icv.b[i] ^= aad[i];
-
-        s390x_km(ctx->aes.ccm.kmac_param.icv.b, 16,
-            ctx->aes.ccm.kmac_param.icv.b, ctx->aes.ccm.fc,
-            ctx->aes.ccm.kmac_param.k);
-        ctx->aes.ccm.blocks++;
-    }
-}
-
-/*-
- * En/de-crypt plain/cipher-text. Compute tag from plaintext. Returns 0 for
- * success.
- */
-static int s390x_aes_ccm(S390X_AES_CCM_CTX *ctx, const unsigned char *in,
-    unsigned char *out, size_t len, int enc)
-{
-    size_t n, rem;
-    unsigned int i, l, num;
-    unsigned char flags;
-
-    flags = ctx->aes.ccm.nonce.b[0];
-    if (!(flags & S390X_CCM_AAD_FLAG)) {
-        s390x_km(ctx->aes.ccm.nonce.b, 16, ctx->aes.ccm.kmac_param.icv.b,
-            ctx->aes.ccm.fc, ctx->aes.ccm.kmac_param.k);
-        ctx->aes.ccm.blocks++;
-    }
-    l = flags & 0x7;
-    ctx->aes.ccm.nonce.b[0] = l;
-
-    /*-
-     * Reconstruct length from encoded length field
-     * and initialize it with counter value.
-     */
-    n = 0;
-    for (i = 15 - l; i < 15; i++) {
-        n |= ctx->aes.ccm.nonce.b[i];
-        ctx->aes.ccm.nonce.b[i] = 0;
-        n <<= 8;
-    }
-    n |= ctx->aes.ccm.nonce.b[15];
-    ctx->aes.ccm.nonce.b[15] = 1;
-
-    if (n != len)
-        return -1; /* length mismatch */
-
-    if (enc) {
-        /* Two operations per block plus one for tag encryption */
-        ctx->aes.ccm.blocks += (((len + 15) >> 4) << 1) + 1;
-        if (ctx->aes.ccm.blocks > (1ULL << 61))
-            return -2; /* too much data */
-    }
-
-    num = 0;
-    rem = len & 0xf;
-    len &= ~(size_t)0xf;
-
-    if (enc) {
-        /* mac-then-encrypt */
-        if (len)
-            s390x_kmac(in, len, ctx->aes.ccm.fc, &ctx->aes.ccm.kmac_param);
-        if (rem) {
-            for (i = 0; i < rem; i++)
-                ctx->aes.ccm.kmac_param.icv.b[i] ^= in[len + i];
-
-            s390x_km(ctx->aes.ccm.kmac_param.icv.b, 16,
-                ctx->aes.ccm.kmac_param.icv.b, ctx->aes.ccm.fc,
-                ctx->aes.ccm.kmac_param.k);
-        }
-
-        CRYPTO_ctr128_encrypt_ctr32(in, out, len + rem, &ctx->aes.key.k,
-            ctx->aes.ccm.nonce.b, ctx->aes.ccm.buf.b,
-            &num, (ctr128_f)AES_ctr32_encrypt);
-    } else {
-        /* decrypt-then-mac */
-        CRYPTO_ctr128_encrypt_ctr32(in, out, len + rem, &ctx->aes.key.k,
-            ctx->aes.ccm.nonce.b, ctx->aes.ccm.buf.b,
-            &num, (ctr128_f)AES_ctr32_encrypt);
-
-        if (len)
-            s390x_kmac(out, len, ctx->aes.ccm.fc, &ctx->aes.ccm.kmac_param);
-        if (rem) {
-            for (i = 0; i < rem; i++)
-                ctx->aes.ccm.kmac_param.icv.b[i] ^= out[len + i];
-
-            s390x_km(ctx->aes.ccm.kmac_param.icv.b, 16,
-                ctx->aes.ccm.kmac_param.icv.b, ctx->aes.ccm.fc,
-                ctx->aes.ccm.kmac_param.k);
-        }
-    }
-    /* encrypt tag */
-    for (i = 15 - l; i < 16; i++)
-        ctx->aes.ccm.nonce.b[i] = 0;
-
-    s390x_km(ctx->aes.ccm.nonce.b, 16, ctx->aes.ccm.buf.b, ctx->aes.ccm.fc,
-        ctx->aes.ccm.kmac_param.k);
-    ctx->aes.ccm.kmac_param.icv.g[0] ^= ctx->aes.ccm.buf.g[0];
-    ctx->aes.ccm.kmac_param.icv.g[1] ^= ctx->aes.ccm.buf.g[1];
-
-    ctx->aes.ccm.nonce.b[0] = flags; /* restore flags field */
-    return 0;
-}
-
-/*-
- * En/de-crypt and authenticate TLS packet. Returns the number of bytes written
- * if successful. Otherwise -1 is returned.
- */
-static int s390x_aes_ccm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    S390X_AES_CCM_CTX *cctx = EVP_C_DATA(S390X_AES_CCM_CTX, ctx);
-    unsigned char *ivec = ctx->iv;
-    unsigned char *buf = EVP_CIPHER_CTX_buf_noconst(ctx);
-    const int enc = EVP_CIPHER_CTX_is_encrypting(ctx);
-
-    if (out != in
-        || len < (EVP_CCM_TLS_EXPLICIT_IV_LEN + (size_t)cctx->aes.ccm.m))
-        return -1;
-
-    if (enc) {
-        /* Set explicit iv (sequence number). */
-        memcpy(out, buf, EVP_CCM_TLS_EXPLICIT_IV_LEN);
-    }
-
-    len -= EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->aes.ccm.m;
-    /*-
-     * Get explicit iv (sequence number). We already have fixed iv
-     * (server/client_write_iv) here.
-     */
-    memcpy(ivec + EVP_CCM_TLS_FIXED_IV_LEN, in, EVP_CCM_TLS_EXPLICIT_IV_LEN);
-    s390x_aes_ccm_setiv(cctx, ivec, len);
-
-    /* Process aad (sequence number|type|version|length) */
-    s390x_aes_ccm_aad(cctx, buf, cctx->aes.ccm.tls_aad_len);
-
-    in += EVP_CCM_TLS_EXPLICIT_IV_LEN;
-    out += EVP_CCM_TLS_EXPLICIT_IV_LEN;
-
-    if (enc) {
-        if (s390x_aes_ccm(cctx, in, out, len, enc))
-            return -1;
-
-        memcpy(out + len, cctx->aes.ccm.kmac_param.icv.b, cctx->aes.ccm.m);
-        return len + EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->aes.ccm.m;
-    } else {
-        if (!s390x_aes_ccm(cctx, in, out, len, enc)) {
-            if (!CRYPTO_memcmp(cctx->aes.ccm.kmac_param.icv.b, in + len,
-                    cctx->aes.ccm.m))
-                return len;
-        }
-
-        OPENSSL_cleanse(out, len);
-        return -1;
-    }
-}
-
-/*-
- * Set key and flag field and/or iv. Returns 1 if successful. Otherwise 0 is
- * returned.
- */
-static int s390x_aes_ccm_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    S390X_AES_CCM_CTX *cctx = EVP_C_DATA(S390X_AES_CCM_CTX, ctx);
-    int keylen;
-
-    if (iv == NULL && key == NULL)
-        return 1;
-
-    if (key != NULL) {
-        keylen = EVP_CIPHER_CTX_get_key_length(ctx);
-        if (keylen <= 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-
-        cctx->aes.ccm.fc = S390X_AES_FC(keylen);
-        memcpy(cctx->aes.ccm.kmac_param.k, key, keylen);
-
-        /* Store encoded m and l. */
-        cctx->aes.ccm.nonce.b[0] = ((cctx->aes.ccm.l - 1) & 0x7)
-            | (((cctx->aes.ccm.m - 2) >> 1) & 0x7) << 3;
-        memset(cctx->aes.ccm.nonce.b + 1, 0,
-            sizeof(cctx->aes.ccm.nonce.b));
-        cctx->aes.ccm.blocks = 0;
-
-        cctx->aes.ccm.key_set = 1;
-    }
-
-    if (iv != NULL) {
-        memcpy(ctx->iv, iv, 15 - cctx->aes.ccm.l);
-
-        cctx->aes.ccm.iv_set = 1;
-    }
-
-    return 1;
-}
-
-/*-
- * Called from EVP layer to initialize context, process additional
- * authenticated data, en/de-crypt plain/cipher-text and authenticate
- * plaintext or process a TLS packet, depending on context. Returns bytes
- * written on success. Otherwise -1 is returned.
- */
-static int s390x_aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    S390X_AES_CCM_CTX *cctx = EVP_C_DATA(S390X_AES_CCM_CTX, ctx);
-    const int enc = EVP_CIPHER_CTX_is_encrypting(ctx);
-    int rv;
-    unsigned char *buf;
-
-    if (!cctx->aes.ccm.key_set)
-        return -1;
-
-    if (cctx->aes.ccm.tls_aad_len >= 0)
-        return s390x_aes_ccm_tls_cipher(ctx, out, in, len);
-
-    /*-
-     * Final(): Does not return any data. Recall that ccm is mac-then-encrypt
-     * so integrity must be checked already at Update() i.e., before
-     * potentially corrupted data is output.
-     */
-    if (in == NULL && out != NULL)
-        return 0;
-
-    if (!cctx->aes.ccm.iv_set)
-        return -1;
-
-    if (out == NULL) {
-        /* Update(): Pass message length. */
-        if (in == NULL) {
-            s390x_aes_ccm_setiv(cctx, ctx->iv, len);
-
-            cctx->aes.ccm.len_set = 1;
-            return len;
-        }
-
-        /* Update(): Process aad. */
-        if (!cctx->aes.ccm.len_set && len)
-            return -1;
-
-        s390x_aes_ccm_aad(cctx, in, len);
-        return len;
-    }
-
-    /* The tag must be set before actually decrypting data */
-    if (!enc && !cctx->aes.ccm.tag_set)
-        return -1;
-
-    /* Update(): Process message. */
-
-    if (!cctx->aes.ccm.len_set) {
-        /*-
-         * In case message length was not previously set explicitly via
-         * Update(), set it now.
-         */
-        s390x_aes_ccm_setiv(cctx, ctx->iv, len);
-
-        cctx->aes.ccm.len_set = 1;
-    }
-
-    if (enc) {
-        if (s390x_aes_ccm(cctx, in, out, len, enc))
-            return -1;
-
-        cctx->aes.ccm.tag_set = 1;
-        return len;
-    } else {
-        rv = -1;
-
-        if (!s390x_aes_ccm(cctx, in, out, len, enc)) {
-            buf = EVP_CIPHER_CTX_buf_noconst(ctx);
-            if (!CRYPTO_memcmp(cctx->aes.ccm.kmac_param.icv.b, buf,
-                    cctx->aes.ccm.m))
-                rv = len;
-        }
-
-        if (rv == -1)
-            OPENSSL_cleanse(out, len);
-
-        cctx->aes.ccm.iv_set = 0;
-        cctx->aes.ccm.tag_set = 0;
-        cctx->aes.ccm.len_set = 0;
-        return rv;
-    }
-}
-
-/*-
- * Performs various operations on the context structure depending on control
- * type. Returns 1 for success, 0 for failure and -1 for unknown control type.
- * Code is big-endian.
- */
-static int s390x_aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
-{
-    S390X_AES_CCM_CTX *cctx = EVP_C_DATA(S390X_AES_CCM_CTX, c);
-    unsigned char *buf;
-    int enc, len;
-
-    switch (type) {
-    case EVP_CTRL_INIT:
-        cctx->aes.ccm.key_set = 0;
-        cctx->aes.ccm.iv_set = 0;
-        cctx->aes.ccm.l = 8;
-        cctx->aes.ccm.m = 12;
-        cctx->aes.ccm.tag_set = 0;
-        cctx->aes.ccm.len_set = 0;
-        cctx->aes.ccm.tls_aad_len = -1;
-        return 1;
-
-    case EVP_CTRL_GET_IVLEN:
-        *(int *)ptr = 15 - cctx->aes.ccm.l;
-        return 1;
-
-    case EVP_CTRL_AEAD_TLS1_AAD:
-        if (arg != EVP_AEAD_TLS1_AAD_LEN)
-            return 0;
-
-        /* Save the aad for later use. */
-        buf = EVP_CIPHER_CTX_buf_noconst(c);
-        memcpy(buf, ptr, arg);
-        cctx->aes.ccm.tls_aad_len = arg;
-
-        len = buf[arg - 2] << 8 | buf[arg - 1];
-        if (len < EVP_CCM_TLS_EXPLICIT_IV_LEN)
-            return 0;
-
-        /* Correct length for explicit iv. */
-        len -= EVP_CCM_TLS_EXPLICIT_IV_LEN;
-
-        enc = EVP_CIPHER_CTX_is_encrypting(c);
-        if (!enc) {
-            if (len < cctx->aes.ccm.m)
-                return 0;
-
-            /* Correct length for tag. */
-            len -= cctx->aes.ccm.m;
-        }
-
-        buf[arg - 2] = len >> 8;
-        buf[arg - 1] = len & 0xff;
-
-        /* Extra padding: tag appended to record. */
-        return cctx->aes.ccm.m;
-
-    case EVP_CTRL_CCM_SET_IV_FIXED:
-        if (arg != EVP_CCM_TLS_FIXED_IV_LEN)
-            return 0;
-
-        /* Copy to first part of the iv. */
-        memcpy(c->iv, ptr, arg);
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_IVLEN:
-        arg = 15 - arg;
-        /* fall-through */
-
-    case EVP_CTRL_CCM_SET_L:
-        if (arg < 2 || arg > 8)
-            return 0;
-
-        cctx->aes.ccm.l = arg;
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_TAG:
-        if ((arg & 1) || arg < 4 || arg > 16)
-            return 0;
-
-        enc = EVP_CIPHER_CTX_is_encrypting(c);
-        if (enc && ptr)
-            return 0;
-
-        if (ptr) {
-            cctx->aes.ccm.tag_set = 1;
-            buf = EVP_CIPHER_CTX_buf_noconst(c);
-            memcpy(buf, ptr, arg);
-        }
-
-        cctx->aes.ccm.m = arg;
-        return 1;
-
-    case EVP_CTRL_AEAD_GET_TAG:
-        enc = EVP_CIPHER_CTX_is_encrypting(c);
-        if (!enc || !cctx->aes.ccm.tag_set)
-            return 0;
-
-        if (arg < cctx->aes.ccm.m)
-            return 0;
-
-        memcpy(ptr, cctx->aes.ccm.kmac_param.icv.b, cctx->aes.ccm.m);
-        cctx->aes.ccm.tag_set = 0;
-        cctx->aes.ccm.iv_set = 0;
-        cctx->aes.ccm.len_set = 0;
-        return 1;
-
-    case EVP_CTRL_COPY:
-        return 1;
-
-    default:
-        return -1;
-    }
-}
-
-#define s390x_aes_ccm_cleanup aes_ccm_cleanup
-
-#ifndef OPENSSL_NO_OCB
-#define S390X_AES_OCB_CTX EVP_AES_OCB_CTX
-
-#define s390x_aes_ocb_init_key aes_ocb_init_key
-static int s390x_aes_ocb_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-#define s390x_aes_ocb_cipher aes_ocb_cipher
-static int s390x_aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-#define s390x_aes_ocb_cleanup aes_ocb_cleanup
-static int s390x_aes_ocb_cleanup(EVP_CIPHER_CTX *);
-#define s390x_aes_ocb_ctrl aes_ocb_ctrl
-static int s390x_aes_ocb_ctrl(EVP_CIPHER_CTX *, int type, int arg, void *ptr);
-#endif
-
-#ifndef OPENSSL_NO_SIV
-#define S390X_AES_SIV_CTX EVP_AES_SIV_CTX
-
-#define s390x_aes_siv_init_key aes_siv_init_key
-#define s390x_aes_siv_cipher aes_siv_cipher
-#define s390x_aes_siv_cleanup aes_siv_cleanup
-#define s390x_aes_siv_ctrl aes_siv_ctrl
-#endif
-
-#define BLOCK_CIPHER_generic(nid, keylen, blocksize, ivlen, nmode, mode,                                      \
-    MODE, flags)                                                                                              \
-    static const EVP_CIPHER s390x_aes_##keylen##_##mode = {                                                   \
-        nid##_##keylen##_##nmode, blocksize,                                                                  \
-        keylen / 8,                                                                                           \
-        ivlen,                                                                                                \
-        flags | EVP_CIPH_##MODE##_MODE,                                                                       \
-        EVP_ORIG_GLOBAL,                                                                                      \
-        s390x_aes_##mode##_init_key,                                                                          \
-        s390x_aes_##mode##_cipher,                                                                            \
-        NULL,                                                                                                 \
-        sizeof(S390X_AES_##MODE##_CTX),                                                                       \
-        NULL,                                                                                                 \
-        NULL,                                                                                                 \
-        NULL,                                                                                                 \
-        NULL                                                                                                  \
-    };                                                                                                        \
-    static const EVP_CIPHER aes_##keylen##_##mode = {                                                         \
-        nid##_##keylen##_##nmode,                                                                             \
-        blocksize,                                                                                            \
-        keylen / 8,                                                                                           \
-        ivlen,                                                                                                \
-        flags | EVP_CIPH_##MODE##_MODE,                                                                       \
-        EVP_ORIG_GLOBAL,                                                                                      \
-        aes_init_key,                                                                                         \
-        aes_##mode##_cipher,                                                                                  \
-        NULL,                                                                                                 \
-        sizeof(EVP_AES_KEY),                                                                                  \
-        NULL,                                                                                                 \
-        NULL,                                                                                                 \
-        NULL,                                                                                                 \
-        NULL                                                                                                  \
-    };                                                                                                        \
-    const EVP_CIPHER *EVP_aes_##keylen##_##mode(void)                                                         \
-    {                                                                                                         \
-        return S390X_aes_##keylen##_##mode##_CAPABLE ? &s390x_aes_##keylen##_##mode : &aes_##keylen##_##mode; \
-    }
-
-#define BLOCK_CIPHER_custom(nid, keylen, blocksize, ivlen, mode, MODE, flags)                                              \
-    static const EVP_CIPHER s390x_aes_##keylen##_##mode = {                                                                \
-        nid##_##keylen##_##mode,                                                                                           \
-        blocksize,                                                                                                         \
-        (EVP_CIPH_##MODE##_MODE == EVP_CIPH_XTS_MODE || EVP_CIPH_##MODE##_MODE == EVP_CIPH_SIV_MODE ? 2 : 1) * keylen / 8, \
-        ivlen,                                                                                                             \
-        flags | EVP_CIPH_##MODE##_MODE,                                                                                    \
-        EVP_ORIG_GLOBAL,                                                                                                   \
-        s390x_aes_##mode##_init_key,                                                                                       \
-        s390x_aes_##mode##_cipher,                                                                                         \
-        s390x_aes_##mode##_cleanup,                                                                                        \
-        sizeof(S390X_AES_##MODE##_CTX),                                                                                    \
-        NULL,                                                                                                              \
-        NULL,                                                                                                              \
-        s390x_aes_##mode##_ctrl,                                                                                           \
-        NULL                                                                                                               \
-    };                                                                                                                     \
-    static const EVP_CIPHER aes_##keylen##_##mode = {                                                                      \
-        nid##_##keylen##_##mode, blocksize,                                                                                \
-        (EVP_CIPH_##MODE##_MODE == EVP_CIPH_XTS_MODE || EVP_CIPH_##MODE##_MODE == EVP_CIPH_SIV_MODE ? 2 : 1) * keylen / 8, \
-        ivlen,                                                                                                             \
-        flags | EVP_CIPH_##MODE##_MODE,                                                                                    \
-        EVP_ORIG_GLOBAL,                                                                                                   \
-        aes_##mode##_init_key,                                                                                             \
-        aes_##mode##_cipher,                                                                                               \
-        aes_##mode##_cleanup,                                                                                              \
-        sizeof(EVP_AES_##MODE##_CTX),                                                                                      \
-        NULL,                                                                                                              \
-        NULL,                                                                                                              \
-        aes_##mode##_ctrl,                                                                                                 \
-        NULL                                                                                                               \
-    };                                                                                                                     \
-    const EVP_CIPHER *EVP_aes_##keylen##_##mode(void)                                                                      \
-    {                                                                                                                      \
-        return S390X_aes_##keylen##_##mode##_CAPABLE ? &s390x_aes_##keylen##_##mode : &aes_##keylen##_##mode;              \
-    }
-
-#else
+#include "crypto/evp.h"

 #define BLOCK_CIPHER_generic(nid, keylen, blocksize, ivlen, nmode, mode, MODE, flags) \
     static const EVP_CIPHER aes_##keylen##_##mode = {                                 \
-        nid##_##keylen##_##nmode, blocksize, keylen / 8, ivlen,                       \
+        nid##_##keylen##_##nmode,                                                     \
+        blocksize,                                                                    \
+        keylen / 8,                                                                   \
+        ivlen,                                                                        \
         flags | EVP_CIPH_##MODE##_MODE,                                               \
         EVP_ORIG_GLOBAL,                                                              \
-        aes_init_key,                                                                 \
-        aes_##mode##_cipher,                                                          \
-        NULL,                                                                         \
-        sizeof(EVP_AES_KEY),                                                          \
-        NULL, NULL, NULL, NULL                                                        \
     };                                                                                \
     const EVP_CIPHER *EVP_aes_##keylen##_##mode(void)                                 \
     {                                                                                 \
@@ -2385,24 +25,18 @@ static int s390x_aes_ocb_ctrl(EVP_CIPHER_CTX *, int type, int arg, void *ptr);

 #define BLOCK_CIPHER_custom(nid, keylen, blocksize, ivlen, mode, MODE, flags)                                              \
     static const EVP_CIPHER aes_##keylen##_##mode = {                                                                      \
-        nid##_##keylen##_##mode, blocksize,                                                                                \
+        nid##_##keylen##_##mode,                                                                                           \
+        blocksize,                                                                                                         \
         (EVP_CIPH_##MODE##_MODE == EVP_CIPH_XTS_MODE || EVP_CIPH_##MODE##_MODE == EVP_CIPH_SIV_MODE ? 2 : 1) * keylen / 8, \
         ivlen,                                                                                                             \
         flags | EVP_CIPH_##MODE##_MODE,                                                                                    \
         EVP_ORIG_GLOBAL,                                                                                                   \
-        aes_##mode##_init_key,                                                                                             \
-        aes_##mode##_cipher,                                                                                               \
-        aes_##mode##_cleanup,                                                                                              \
-        sizeof(EVP_AES_##MODE##_CTX),                                                                                      \
-        NULL, NULL, aes_##mode##_ctrl, NULL                                                                                \
     };                                                                                                                     \
     const EVP_CIPHER *EVP_aes_##keylen##_##mode(void)                                                                      \
     {                                                                                                                      \
         return &aes_##keylen##_##mode;                                                                                     \
     }

-#endif
-
 #define BLOCK_CIPHER_generic_pack(nid, keylen, flags)                                              \
     BLOCK_CIPHER_generic(nid, keylen, 16, 16, cbc, cbc, CBC, flags | EVP_CIPH_FLAG_DEFAULT_ASN1)   \
     BLOCK_CIPHER_generic(nid, keylen, 16, 0, ecb, ecb, ECB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1)    \
@@ -2412,776 +46,10 @@ static int s390x_aes_ocb_ctrl(EVP_CIPHER_CTX *, int type, int arg, void *ptr);
     BLOCK_CIPHER_generic(nid, keylen, 1, 16, cfb8, cfb8, CFB, flags)                               \
     BLOCK_CIPHER_generic(nid, keylen, 1, 16, ctr, ctr, CTR, flags)

-static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    int ret, mode;
-    EVP_AES_KEY *dat = EVP_C_DATA(EVP_AES_KEY, ctx);
-    const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-
-    if (keylen <= 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-        return 0;
-    }
-
-    mode = EVP_CIPHER_CTX_get_mode(ctx);
-    if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE)
-        && !enc) {
-#ifdef HWAES_CAPABLE
-        if (HWAES_CAPABLE) {
-            ret = HWAES_set_decrypt_key(key, keylen, &dat->ks.ks);
-            dat->block = (block128_f)HWAES_decrypt;
-            dat->stream.cbc = NULL;
-#ifdef HWAES_cbc_encrypt
-            if (mode == EVP_CIPH_CBC_MODE)
-                dat->stream.cbc = (cbc128_f)HWAES_cbc_encrypt;
-#endif
-        } else
-#endif
-#ifdef BSAES_CAPABLE
-            if (BSAES_CAPABLE && mode == EVP_CIPH_CBC_MODE) {
-            ret = AES_set_decrypt_key(key, keylen, &dat->ks.ks);
-            dat->block = (block128_f)AES_decrypt;
-            dat->stream.cbc = (cbc128_f)ossl_bsaes_cbc_encrypt;
-        } else
-#endif
-#ifdef VPAES_CAPABLE
-            if (VPAES_CAPABLE) {
-            ret = vpaes_set_decrypt_key(key, keylen, &dat->ks.ks);
-            dat->block = (block128_f)vpaes_decrypt;
-            dat->stream.cbc = mode == EVP_CIPH_CBC_MODE ? (cbc128_f)vpaes_cbc_encrypt : NULL;
-        } else
-#endif
-        {
-            ret = AES_set_decrypt_key(key, keylen, &dat->ks.ks);
-            dat->block = (block128_f)AES_decrypt;
-            dat->stream.cbc = mode == EVP_CIPH_CBC_MODE ? (cbc128_f)AES_cbc_encrypt : NULL;
-        }
-    } else
-#ifdef HWAES_CAPABLE
-        if (HWAES_CAPABLE) {
-        ret = HWAES_set_encrypt_key(key, keylen, &dat->ks.ks);
-        dat->block = (block128_f)HWAES_encrypt;
-        dat->stream.cbc = NULL;
-#ifdef HWAES_cbc_encrypt
-        if (mode == EVP_CIPH_CBC_MODE)
-            dat->stream.cbc = (cbc128_f)HWAES_cbc_encrypt;
-        else
-#endif
-#ifdef HWAES_ctr32_encrypt_blocks
-            if (mode == EVP_CIPH_CTR_MODE)
-            dat->stream.ctr = (ctr128_f)HWAES_ctr32_encrypt_blocks;
-        else
-#endif
-            (void)0; /* terminate potentially open 'else' */
-    } else
-#endif
-#ifdef BSAES_CAPABLE
-        if (BSAES_CAPABLE && mode == EVP_CIPH_CTR_MODE) {
-        ret = AES_set_encrypt_key(key, keylen, &dat->ks.ks);
-        dat->block = (block128_f)AES_encrypt;
-        dat->stream.ctr = (ctr128_f)ossl_bsaes_ctr32_encrypt_blocks;
-    } else
-#endif
-#ifdef VPAES_CAPABLE
-        if (VPAES_CAPABLE) {
-        ret = vpaes_set_encrypt_key(key, keylen, &dat->ks.ks);
-        dat->block = (block128_f)vpaes_encrypt;
-        dat->stream.cbc = mode == EVP_CIPH_CBC_MODE ? (cbc128_f)vpaes_cbc_encrypt : NULL;
-    } else
-#endif
-    {
-        ret = AES_set_encrypt_key(key, keylen, &dat->ks.ks);
-        dat->block = (block128_f)AES_encrypt;
-        dat->stream.cbc = mode == EVP_CIPH_CBC_MODE ? (cbc128_f)AES_cbc_encrypt : NULL;
-#ifdef AES_CTR_ASM
-        if (mode == EVP_CIPH_CTR_MODE)
-            dat->stream.ctr = (ctr128_f)AES_ctr32_encrypt;
-#endif
-    }
-
-    if (ret < 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_AES_KEY_SETUP_FAILED);
-        return 0;
-    }
-
-    return 1;
-}
-
-static int aes_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_AES_KEY *dat = EVP_C_DATA(EVP_AES_KEY, ctx);
-
-    if (dat->stream.cbc)
-        (*dat->stream.cbc)(in, out, len, &dat->ks, ctx->iv,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-    else if (EVP_CIPHER_CTX_is_encrypting(ctx))
-        CRYPTO_cbc128_encrypt(in, out, len, &dat->ks, ctx->iv,
-            dat->block);
-    else
-        CRYPTO_cbc128_decrypt(in, out, len, &dat->ks,
-            ctx->iv, dat->block);
-
-    return 1;
-}
-
-static int aes_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    size_t bl = EVP_CIPHER_CTX_get_block_size(ctx);
-    size_t i;
-    EVP_AES_KEY *dat = EVP_C_DATA(EVP_AES_KEY, ctx);
-
-    if (len < bl)
-        return 1;
-
-    for (i = 0, len -= bl; i <= len; i += bl)
-        (*dat->block)(in + i, out + i, &dat->ks);
-
-    return 1;
-}
-
-static int aes_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_AES_KEY *dat = EVP_C_DATA(EVP_AES_KEY, ctx);
-
-    int num = EVP_CIPHER_CTX_get_num(ctx);
-    CRYPTO_ofb128_encrypt(in, out, len, &dat->ks,
-        ctx->iv, &num, dat->block);
-    EVP_CIPHER_CTX_set_num(ctx, num);
-    return 1;
-}
-
-static int aes_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_AES_KEY *dat = EVP_C_DATA(EVP_AES_KEY, ctx);
-
-    int num = EVP_CIPHER_CTX_get_num(ctx);
-    CRYPTO_cfb128_encrypt(in, out, len, &dat->ks,
-        ctx->iv, &num,
-        EVP_CIPHER_CTX_is_encrypting(ctx), dat->block);
-    EVP_CIPHER_CTX_set_num(ctx, num);
-    return 1;
-}
-
-static int aes_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_AES_KEY *dat = EVP_C_DATA(EVP_AES_KEY, ctx);
-
-    int num = EVP_CIPHER_CTX_get_num(ctx);
-    CRYPTO_cfb128_8_encrypt(in, out, len, &dat->ks,
-        ctx->iv, &num,
-        EVP_CIPHER_CTX_is_encrypting(ctx), dat->block);
-    EVP_CIPHER_CTX_set_num(ctx, num);
-    return 1;
-}
-
-static int aes_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_AES_KEY *dat = EVP_C_DATA(EVP_AES_KEY, ctx);
-
-    if (EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS)) {
-        int num = EVP_CIPHER_CTX_get_num(ctx);
-        CRYPTO_cfb128_1_encrypt(in, out, len, &dat->ks,
-            ctx->iv, &num,
-            EVP_CIPHER_CTX_is_encrypting(ctx), dat->block);
-        EVP_CIPHER_CTX_set_num(ctx, num);
-        return 1;
-    }
-
-    while (len >= MAXBITCHUNK) {
-        int num = EVP_CIPHER_CTX_get_num(ctx);
-        CRYPTO_cfb128_1_encrypt(in, out, MAXBITCHUNK * 8, &dat->ks,
-            ctx->iv, &num,
-            EVP_CIPHER_CTX_is_encrypting(ctx), dat->block);
-        EVP_CIPHER_CTX_set_num(ctx, num);
-        len -= MAXBITCHUNK;
-        out += MAXBITCHUNK;
-        in += MAXBITCHUNK;
-    }
-    if (len) {
-        int num = EVP_CIPHER_CTX_get_num(ctx);
-        CRYPTO_cfb128_1_encrypt(in, out, len * 8, &dat->ks,
-            ctx->iv, &num,
-            EVP_CIPHER_CTX_is_encrypting(ctx), dat->block);
-        EVP_CIPHER_CTX_set_num(ctx, num);
-    }
-
-    return 1;
-}
-
-static int aes_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    int n = EVP_CIPHER_CTX_get_num(ctx);
-    unsigned int num;
-    EVP_AES_KEY *dat = EVP_C_DATA(EVP_AES_KEY, ctx);
-
-    if (n < 0)
-        return 0;
-    num = (unsigned int)n;
-
-    if (dat->stream.ctr)
-        CRYPTO_ctr128_encrypt_ctr32(in, out, len, &dat->ks,
-            ctx->iv,
-            EVP_CIPHER_CTX_buf_noconst(ctx),
-            &num, dat->stream.ctr);
-    else
-        CRYPTO_ctr128_encrypt(in, out, len, &dat->ks,
-            ctx->iv,
-            EVP_CIPHER_CTX_buf_noconst(ctx), &num,
-            dat->block);
-    EVP_CIPHER_CTX_set_num(ctx, num);
-    return 1;
-}
-
 BLOCK_CIPHER_generic_pack(NID_aes, 128, 0)
 BLOCK_CIPHER_generic_pack(NID_aes, 192, 0)
 BLOCK_CIPHER_generic_pack(NID_aes, 256, 0)

-static int aes_gcm_cleanup(EVP_CIPHER_CTX *c)
-{
-    EVP_AES_GCM_CTX *gctx = EVP_C_DATA(EVP_AES_GCM_CTX, c);
-    if (gctx == NULL)
-        return 0;
-    OPENSSL_cleanse(&gctx->gcm, sizeof(gctx->gcm));
-    if (gctx->iv != c->iv)
-        OPENSSL_free(gctx->iv);
-    return 1;
-}
-
-static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
-{
-    EVP_AES_GCM_CTX *gctx = EVP_C_DATA(EVP_AES_GCM_CTX, c);
-    switch (type) {
-    case EVP_CTRL_INIT:
-        gctx->key_set = 0;
-        gctx->iv_set = 0;
-        gctx->ivlen = EVP_CIPHER_get_iv_length(c->cipher);
-        gctx->iv = c->iv;
-        gctx->taglen = -1;
-        gctx->iv_gen = 0;
-        gctx->tls_aad_len = -1;
-        return 1;
-
-    case EVP_CTRL_GET_IVLEN:
-        *(int *)ptr = gctx->ivlen;
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_IVLEN:
-        if (arg <= 0)
-            return 0;
-        /* Allocate memory for IV if needed */
-        if ((arg > EVP_MAX_IV_LENGTH) && (arg > gctx->ivlen)) {
-            if (gctx->iv != c->iv)
-                OPENSSL_free(gctx->iv);
-            if ((gctx->iv = OPENSSL_malloc(arg)) == NULL)
-                return 0;
-        }
-        gctx->ivlen = arg;
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_TAG:
-        if (arg <= 0 || arg > 16 || c->encrypt)
-            return 0;
-        memcpy(c->buf, ptr, arg);
-        gctx->taglen = arg;
-        return 1;
-
-    case EVP_CTRL_AEAD_GET_TAG:
-        if (arg <= 0 || arg > 16 || !c->encrypt
-            || gctx->taglen < 0)
-            return 0;
-        memcpy(ptr, c->buf, arg);
-        return 1;
-
-    case EVP_CTRL_GCM_SET_IV_FIXED:
-        /* Special case: -1 length restores whole IV */
-        if (arg == -1) {
-            memcpy(gctx->iv, ptr, gctx->ivlen);
-            gctx->iv_gen = 1;
-            return 1;
-        }
-        /*
-         * Fixed field must be at least 4 bytes and invocation field at least
-         * 8.
-         */
-        if ((arg < 4) || (gctx->ivlen - arg) < 8)
-            return 0;
-        if (arg)
-            memcpy(gctx->iv, ptr, arg);
-        if (c->encrypt && RAND_bytes(gctx->iv + arg, gctx->ivlen - arg) <= 0)
-            return 0;
-        gctx->iv_gen = 1;
-        return 1;
-
-    case EVP_CTRL_GCM_IV_GEN:
-        if (gctx->iv_gen == 0 || gctx->key_set == 0)
-            return 0;
-        CRYPTO_gcm128_setiv(&gctx->gcm, gctx->iv, gctx->ivlen);
-        if (arg <= 0 || arg > gctx->ivlen)
-            arg = gctx->ivlen;
-        memcpy(ptr, gctx->iv + gctx->ivlen - arg, arg);
-        /*
-         * Invocation field will be at least 8 bytes in size and so no need
-         * to check wrap around or increment more than last 8 bytes.
-         */
-        ctr64_inc(gctx->iv + gctx->ivlen - 8);
-        gctx->iv_set = 1;
-        return 1;
-
-    case EVP_CTRL_GCM_SET_IV_INV:
-        if (gctx->iv_gen == 0 || gctx->key_set == 0 || c->encrypt)
-            return 0;
-        memcpy(gctx->iv + gctx->ivlen - arg, ptr, arg);
-        CRYPTO_gcm128_setiv(&gctx->gcm, gctx->iv, gctx->ivlen);
-        gctx->iv_set = 1;
-        return 1;
-
-    case EVP_CTRL_AEAD_TLS1_AAD:
-        /* Save the AAD for later use */
-        if (arg != EVP_AEAD_TLS1_AAD_LEN)
-            return 0;
-        memcpy(c->buf, ptr, arg);
-        gctx->tls_aad_len = arg;
-        gctx->tls_enc_records = 0;
-        {
-            unsigned int len = c->buf[arg - 2] << 8 | c->buf[arg - 1];
-            /* Correct length for explicit IV */
-            if (len < EVP_GCM_TLS_EXPLICIT_IV_LEN)
-                return 0;
-            len -= EVP_GCM_TLS_EXPLICIT_IV_LEN;
-            /* If decrypting correct for tag too */
-            if (!c->encrypt) {
-                if (len < EVP_GCM_TLS_TAG_LEN)
-                    return 0;
-                len -= EVP_GCM_TLS_TAG_LEN;
-            }
-            c->buf[arg - 2] = len >> 8;
-            c->buf[arg - 1] = len & 0xff;
-        }
-        /* Extra padding: tag appended to record */
-        return EVP_GCM_TLS_TAG_LEN;
-
-    case EVP_CTRL_COPY: {
-        EVP_CIPHER_CTX *out = ptr;
-        EVP_AES_GCM_CTX *gctx_out = EVP_C_DATA(EVP_AES_GCM_CTX, out);
-        if (gctx->gcm.key) {
-            if (gctx->gcm.key != &gctx->ks)
-                return 0;
-            gctx_out->gcm.key = &gctx_out->ks;
-        }
-        if (gctx->iv == c->iv)
-            gctx_out->iv = out->iv;
-        else {
-            if ((gctx_out->iv = OPENSSL_malloc(gctx->ivlen)) == NULL)
-                return 0;
-            memcpy(gctx_out->iv, gctx->iv, gctx->ivlen);
-        }
-        return 1;
-    }
-
-    default:
-        return -1;
-    }
-}
-
-static int aes_gcm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    EVP_AES_GCM_CTX *gctx = EVP_C_DATA(EVP_AES_GCM_CTX, ctx);
-
-    if (iv == NULL && key == NULL)
-        return 1;
-
-    if (key != NULL) {
-        const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-
-        if (keylen <= 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-        do {
-#ifdef HWAES_CAPABLE
-            if (HWAES_CAPABLE) {
-                HWAES_set_encrypt_key(key, keylen, &gctx->ks.ks);
-                CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks,
-                    (block128_f)HWAES_encrypt);
-#ifdef HWAES_ctr32_encrypt_blocks
-                gctx->ctr = (ctr128_f)HWAES_ctr32_encrypt_blocks;
-#else
-                gctx->ctr = NULL;
-#endif
-                break;
-            } else
-#endif
-#ifdef BSAES_CAPABLE
-                if (BSAES_CAPABLE) {
-                AES_set_encrypt_key(key, keylen, &gctx->ks.ks);
-                CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks,
-                    (block128_f)AES_encrypt);
-                gctx->ctr = (ctr128_f)ossl_bsaes_ctr32_encrypt_blocks;
-                break;
-            } else
-#endif
-#ifdef VPAES_CAPABLE
-                if (VPAES_CAPABLE) {
-                vpaes_set_encrypt_key(key, keylen, &gctx->ks.ks);
-                CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks,
-                    (block128_f)vpaes_encrypt);
-                gctx->ctr = NULL;
-                break;
-            } else
-#endif
-                (void)0; /* terminate potentially open 'else' */
-
-            AES_set_encrypt_key(key, keylen, &gctx->ks.ks);
-            CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks,
-                (block128_f)AES_encrypt);
-#ifdef AES_CTR_ASM
-            gctx->ctr = (ctr128_f)AES_ctr32_encrypt;
-#else
-            gctx->ctr = NULL;
-#endif
-        } while (0);
-
-        /*
-         * If we have an iv can set it directly, otherwise use saved IV.
-         */
-        if (iv == NULL && gctx->iv_set)
-            iv = gctx->iv;
-        if (iv) {
-            CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen);
-            gctx->iv_set = 1;
-        }
-        gctx->key_set = 1;
-    } else {
-        /* If key set use IV, otherwise copy */
-        if (gctx->key_set)
-            CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen);
-        else
-            memcpy(gctx->iv, iv, gctx->ivlen);
-        gctx->iv_set = 1;
-        gctx->iv_gen = 0;
-    }
-    return 1;
-}
-
-/*
- * Handle TLS GCM packet format. This consists of the last portion of the IV
- * followed by the payload and finally the tag. On encrypt generate IV,
- * encrypt payload and write the tag. On verify retrieve IV, decrypt payload
- * and verify tag.
- */
-
-static int aes_gcm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_AES_GCM_CTX *gctx = EVP_C_DATA(EVP_AES_GCM_CTX, ctx);
-    int rv = -1;
-    /* Encrypt/decrypt must be performed in place */
-    if (out != in
-        || len < (EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN))
-        return -1;
-
-    /*
-     * Check for too many keys as per FIPS 140-2 IG A.5 "Key/IV Pair Uniqueness
-     * Requirements from SP 800-38D".  The requirements is for one party to the
-     * communication to fail after 2^64 - 1 keys.  We do this on the encrypting
-     * side only.
-     */
-    if (EVP_CIPHER_CTX_is_encrypting(ctx) && ++gctx->tls_enc_records == 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_TOO_MANY_RECORDS);
-        goto err;
-    }
-
-    /*
-     * Set IV from start of buffer or generate IV and write to start of
-     * buffer.
-     */
-    if (EVP_CIPHER_CTX_ctrl(ctx,
-            EVP_CIPHER_CTX_is_encrypting(ctx) ? EVP_CTRL_GCM_IV_GEN : EVP_CTRL_GCM_SET_IV_INV,
-            EVP_GCM_TLS_EXPLICIT_IV_LEN, out)
-        <= 0)
-        goto err;
-    /* Use saved AAD */
-    if (CRYPTO_gcm128_aad(&gctx->gcm, EVP_CIPHER_CTX_buf_noconst(ctx),
-            gctx->tls_aad_len))
-        goto err;
-    /* Fix buffer and length to point to payload */
-    in += EVP_GCM_TLS_EXPLICIT_IV_LEN;
-    out += EVP_GCM_TLS_EXPLICIT_IV_LEN;
-    len -= EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN;
-    if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-        /* Encrypt payload */
-        if (gctx->ctr) {
-            size_t bulk = 0;
-#if defined(AES_GCM_ASM)
-            if (len >= 32 && AES_GCM_ASM(gctx)) {
-                if (CRYPTO_gcm128_encrypt(&gctx->gcm, NULL, NULL, 0))
-                    return -1;
-
-                bulk = AES_gcm_encrypt(in, out, len,
-                    gctx->gcm.key,
-                    gctx->gcm.Yi.c, gctx->gcm.Xi.u);
-                gctx->gcm.len.u[1] += bulk;
-            }
-#endif
-            if (CRYPTO_gcm128_encrypt_ctr32(&gctx->gcm,
-                    in + bulk,
-                    out + bulk,
-                    len - bulk, gctx->ctr))
-                goto err;
-        } else {
-            size_t bulk = 0;
-#if defined(AES_GCM_ASM2)
-            if (len >= 32 && AES_GCM_ASM2(gctx)) {
-                if (CRYPTO_gcm128_encrypt(&gctx->gcm, NULL, NULL, 0))
-                    return -1;
-
-                bulk = AES_gcm_encrypt(in, out, len,
-                    gctx->gcm.key,
-                    gctx->gcm.Yi.c, gctx->gcm.Xi.u);
-                gctx->gcm.len.u[1] += bulk;
-            }
-#endif
-            if (CRYPTO_gcm128_encrypt(&gctx->gcm,
-                    in + bulk, out + bulk, len - bulk))
-                goto err;
-        }
-        out += len;
-        /* Finally write tag */
-        CRYPTO_gcm128_tag(&gctx->gcm, out, EVP_GCM_TLS_TAG_LEN);
-        rv = len + EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN;
-    } else {
-        /* Decrypt */
-        if (gctx->ctr) {
-            size_t bulk = 0;
-#if defined(AES_GCM_ASM)
-            if (len >= 16 && AES_GCM_ASM(gctx)) {
-                if (CRYPTO_gcm128_decrypt(&gctx->gcm, NULL, NULL, 0))
-                    return -1;
-
-                bulk = AES_gcm_decrypt(in, out, len,
-                    gctx->gcm.key,
-                    gctx->gcm.Yi.c, gctx->gcm.Xi.u);
-                gctx->gcm.len.u[1] += bulk;
-            }
-#endif
-            if (CRYPTO_gcm128_decrypt_ctr32(&gctx->gcm,
-                    in + bulk,
-                    out + bulk,
-                    len - bulk, gctx->ctr))
-                goto err;
-        } else {
-            size_t bulk = 0;
-#if defined(AES_GCM_ASM2)
-            if (len >= 16 && AES_GCM_ASM2(gctx)) {
-                if (CRYPTO_gcm128_decrypt(&gctx->gcm, NULL, NULL, 0))
-                    return -1;
-
-                bulk = AES_gcm_decrypt(in, out, len,
-                    gctx->gcm.key,
-                    gctx->gcm.Yi.c, gctx->gcm.Xi.u);
-                gctx->gcm.len.u[1] += bulk;
-            }
-#endif
-            if (CRYPTO_gcm128_decrypt(&gctx->gcm,
-                    in + bulk, out + bulk, len - bulk))
-                goto err;
-        }
-        /* Retrieve tag */
-        CRYPTO_gcm128_tag(&gctx->gcm, EVP_CIPHER_CTX_buf_noconst(ctx),
-            EVP_GCM_TLS_TAG_LEN);
-        /* If tag mismatch wipe buffer */
-        if (CRYPTO_memcmp(EVP_CIPHER_CTX_buf_noconst(ctx), in + len,
-                EVP_GCM_TLS_TAG_LEN)) {
-            OPENSSL_cleanse(out, len);
-            goto err;
-        }
-        rv = len;
-    }
-
-err:
-    gctx->iv_set = 0;
-    gctx->tls_aad_len = -1;
-    return rv;
-}
-
-#ifdef FIPS_MODULE
-/*
- * See SP800-38D (GCM) Section 8 "Uniqueness requirement on IVS and keys"
- *
- * See also 8.2.2 RBG-based construction.
- * Random construction consists of a free field (which can be NULL) and a
- * random field which will use a DRBG that can return at least 96 bits of
- * entropy strength. (The DRBG must be seeded by the FIPS module).
- */
-static int aes_gcm_iv_generate(EVP_AES_GCM_CTX *gctx, int offset)
-{
-    int sz = gctx->ivlen - offset;
-
-    /* Must be at least 96 bits */
-    if (sz <= 0 || gctx->ivlen < 12)
-        return 0;
-
-    /* Use DRBG to generate random iv */
-    if (RAND_bytes(gctx->iv + offset, sz) <= 0)
-        return 0;
-    return 1;
-}
-#endif /* FIPS_MODULE */
-
-static int aes_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_AES_GCM_CTX *gctx = EVP_C_DATA(EVP_AES_GCM_CTX, ctx);
-
-    /* If not set up, return error */
-    if (!gctx->key_set)
-        return -1;
-
-    if (gctx->tls_aad_len >= 0)
-        return aes_gcm_tls_cipher(ctx, out, in, len);
-
-#ifdef FIPS_MODULE
-    /*
-     * FIPS requires generation of AES-GCM IV's inside the FIPS module.
-     * The IV can still be set externally (the security policy will state that
-     * this is not FIPS compliant). There are some applications
-     * where setting the IV externally is the only option available.
-     */
-    if (!gctx->iv_set) {
-        if (!EVP_CIPHER_CTX_is_encrypting(ctx) || !aes_gcm_iv_generate(gctx, 0))
-            return -1;
-        CRYPTO_gcm128_setiv(&gctx->gcm, gctx->iv, gctx->ivlen);
-        gctx->iv_set = 1;
-        gctx->iv_gen_rand = 1;
-    }
-#else
-    if (!gctx->iv_set)
-        return -1;
-#endif /* FIPS_MODULE */
-
-    if (in) {
-        if (out == NULL) {
-            if (CRYPTO_gcm128_aad(&gctx->gcm, in, len))
-                return -1;
-        } else if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            if (gctx->ctr) {
-                size_t bulk = 0;
-#if defined(AES_GCM_ASM)
-                if (len >= 32 && AES_GCM_ASM(gctx)) {
-                    size_t res = (16 - gctx->gcm.mres) % 16;
-
-                    if (CRYPTO_gcm128_encrypt(&gctx->gcm, in, out, res))
-                        return -1;
-
-                    bulk = AES_gcm_encrypt(in + res,
-                        out + res, len - res,
-                        gctx->gcm.key, gctx->gcm.Yi.c,
-                        gctx->gcm.Xi.u);
-                    gctx->gcm.len.u[1] += bulk;
-                    bulk += res;
-                }
-#endif
-                if (CRYPTO_gcm128_encrypt_ctr32(&gctx->gcm,
-                        in + bulk,
-                        out + bulk,
-                        len - bulk, gctx->ctr))
-                    return -1;
-            } else {
-                size_t bulk = 0;
-#if defined(AES_GCM_ASM2)
-                if (len >= 32 && AES_GCM_ASM2(gctx)) {
-                    size_t res = (16 - gctx->gcm.mres) % 16;
-
-                    if (CRYPTO_gcm128_encrypt(&gctx->gcm, in, out, res))
-                        return -1;
-
-                    bulk = AES_gcm_encrypt(in + res,
-                        out + res, len - res,
-                        gctx->gcm.key, gctx->gcm.Yi.c,
-                        gctx->gcm.Xi.u);
-                    gctx->gcm.len.u[1] += bulk;
-                    bulk += res;
-                }
-#endif
-                if (CRYPTO_gcm128_encrypt(&gctx->gcm,
-                        in + bulk, out + bulk, len - bulk))
-                    return -1;
-            }
-        } else {
-            if (gctx->ctr) {
-                size_t bulk = 0;
-#if defined(AES_GCM_ASM)
-                if (len >= 16 && AES_GCM_ASM(gctx)) {
-                    size_t res = (16 - gctx->gcm.mres) % 16;
-
-                    if (CRYPTO_gcm128_decrypt(&gctx->gcm, in, out, res))
-                        return -1;
-
-                    bulk = AES_gcm_decrypt(in + res,
-                        out + res, len - res,
-                        gctx->gcm.key,
-                        gctx->gcm.Yi.c, gctx->gcm.Xi.u);
-                    gctx->gcm.len.u[1] += bulk;
-                    bulk += res;
-                }
-#endif
-                if (CRYPTO_gcm128_decrypt_ctr32(&gctx->gcm,
-                        in + bulk,
-                        out + bulk,
-                        len - bulk, gctx->ctr))
-                    return -1;
-            } else {
-                size_t bulk = 0;
-#if defined(AES_GCM_ASM2)
-                if (len >= 16 && AES_GCM_ASM2(gctx)) {
-                    size_t res = (16 - gctx->gcm.mres) % 16;
-
-                    if (CRYPTO_gcm128_decrypt(&gctx->gcm, in, out, res))
-                        return -1;
-
-                    bulk = AES_gcm_decrypt(in + res,
-                        out + res, len - res,
-                        gctx->gcm.key,
-                        gctx->gcm.Yi.c, gctx->gcm.Xi.u);
-                    gctx->gcm.len.u[1] += bulk;
-                    bulk += res;
-                }
-#endif
-                if (CRYPTO_gcm128_decrypt(&gctx->gcm,
-                        in + bulk, out + bulk, len - bulk))
-                    return -1;
-            }
-        }
-        return len;
-    } else {
-        if (!EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            if (gctx->taglen < 0)
-                return -1;
-            if (CRYPTO_gcm128_finish(&gctx->gcm,
-                    EVP_CIPHER_CTX_buf_noconst(ctx),
-                    gctx->taglen)
-                != 0)
-                return -1;
-            gctx->iv_set = 0;
-            return 0;
-        }
-        CRYPTO_gcm128_tag(&gctx->gcm, EVP_CIPHER_CTX_buf_noconst(ctx), 16);
-        gctx->taglen = 16;
-        /* Don't reuse the IV */
-        gctx->iv_set = 0;
-        return 0;
-    }
-}
-
 #define CUSTOM_FLAGS (EVP_CIPH_FLAG_DEFAULT_ASN1       \
     | EVP_CIPH_CUSTOM_IV | EVP_CIPH_FLAG_CUSTOM_CIPHER \
     | EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CTRL_INIT   \
@@ -3194,185 +62,6 @@ BLOCK_CIPHER_custom(NID_aes, 192, 1, 12, gcm, GCM,
 BLOCK_CIPHER_custom(NID_aes, 256, 1, 12, gcm, GCM,
     EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS)

-static int aes_xts_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
-{
-    EVP_AES_XTS_CTX *xctx = EVP_C_DATA(EVP_AES_XTS_CTX, c);
-
-    if (type == EVP_CTRL_COPY) {
-        EVP_CIPHER_CTX *out = ptr;
-        EVP_AES_XTS_CTX *xctx_out = EVP_C_DATA(EVP_AES_XTS_CTX, out);
-
-        if (xctx->xts.key1) {
-            if (xctx->xts.key1 != &xctx->ks1)
-                return 0;
-            xctx_out->xts.key1 = &xctx_out->ks1;
-        }
-        if (xctx->xts.key2) {
-            if (xctx->xts.key2 != &xctx->ks2)
-                return 0;
-            xctx_out->xts.key2 = &xctx_out->ks2;
-        }
-        return 1;
-    } else if (type != EVP_CTRL_INIT)
-        return -1;
-    /* key1 and key2 are used as an indicator both key and IV are set */
-    xctx->xts.key1 = NULL;
-    xctx->xts.key2 = NULL;
-    return 1;
-}
-
-static int aes_xts_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    EVP_AES_XTS_CTX *xctx = EVP_C_DATA(EVP_AES_XTS_CTX, ctx);
-
-    if (iv == NULL && key == NULL)
-        return 1;
-
-    if (key != NULL) {
-        do {
-            /* The key is two half length keys in reality */
-            const int keylen = EVP_CIPHER_CTX_get_key_length(ctx);
-            const int bytes = keylen / 2;
-            const int bits = bytes * 8;
-
-            if (keylen <= 0) {
-                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-                return 0;
-            }
-            /*
-             * Verify that the two keys are different.
-             *
-             * This addresses the vulnerability described in Rogaway's
-             * September 2004 paper:
-             *
-             *      "Efficient Instantiations of Tweakable Blockciphers and
-             *       Refinements to Modes OCB and PMAC".
-             *      (http://web.cs.ucdavis.edu/~rogaway/papers/offsets.pdf)
-             *
-             * FIPS 140-2 IG A.9 XTS-AES Key Generation Requirements states
-             * that:
-             *      "The check for Key_1 != Key_2 shall be done at any place
-             *       BEFORE using the keys in the XTS-AES algorithm to process
-             *       data with them."
-             */
-            if ((!allow_insecure_decrypt || enc)
-                && CRYPTO_memcmp(key, key + bytes, bytes) == 0) {
-                ERR_raise(ERR_LIB_EVP, EVP_R_XTS_DUPLICATED_KEYS);
-                return 0;
-            }
-
-#ifdef AES_XTS_ASM
-            xctx->stream = enc ? AES_xts_encrypt : AES_xts_decrypt;
-#else
-            xctx->stream = NULL;
-#endif
-            /* key_len is two AES keys */
-#ifdef HWAES_CAPABLE
-            if (HWAES_CAPABLE) {
-                if (enc) {
-                    HWAES_set_encrypt_key(key, bits, &xctx->ks1.ks);
-                    xctx->xts.block1 = (block128_f)HWAES_encrypt;
-#ifdef HWAES_xts_encrypt
-                    xctx->stream = HWAES_xts_encrypt;
-#endif
-                } else {
-                    HWAES_set_decrypt_key(key, bits, &xctx->ks1.ks);
-                    xctx->xts.block1 = (block128_f)HWAES_decrypt;
-#ifdef HWAES_xts_decrypt
-                    xctx->stream = HWAES_xts_decrypt;
-#endif
-                }
-
-                HWAES_set_encrypt_key(key + bytes, bits, &xctx->ks2.ks);
-                xctx->xts.block2 = (block128_f)HWAES_encrypt;
-
-                xctx->xts.key1 = &xctx->ks1;
-                break;
-            } else
-#endif
-#ifdef BSAES_CAPABLE
-                if (BSAES_CAPABLE)
-                xctx->stream = enc ? ossl_bsaes_xts_encrypt : ossl_bsaes_xts_decrypt;
-            else
-#endif
-#ifdef VPAES_CAPABLE
-                if (VPAES_CAPABLE) {
-                if (enc) {
-                    vpaes_set_encrypt_key(key, bits, &xctx->ks1.ks);
-                    xctx->xts.block1 = (block128_f)vpaes_encrypt;
-                } else {
-                    vpaes_set_decrypt_key(key, bits, &xctx->ks1.ks);
-                    xctx->xts.block1 = (block128_f)vpaes_decrypt;
-                }
-
-                vpaes_set_encrypt_key(key + bytes, bits, &xctx->ks2.ks);
-                xctx->xts.block2 = (block128_f)vpaes_encrypt;
-
-                xctx->xts.key1 = &xctx->ks1;
-                break;
-            } else
-#endif
-                (void)0; /* terminate potentially open 'else' */
-
-            if (enc) {
-                AES_set_encrypt_key(key, bits, &xctx->ks1.ks);
-                xctx->xts.block1 = (block128_f)AES_encrypt;
-            } else {
-                AES_set_decrypt_key(key, bits, &xctx->ks1.ks);
-                xctx->xts.block1 = (block128_f)AES_decrypt;
-            }
-
-            AES_set_encrypt_key(key + bytes, bits, &xctx->ks2.ks);
-            xctx->xts.block2 = (block128_f)AES_encrypt;
-
-            xctx->xts.key1 = &xctx->ks1;
-        } while (0);
-    }
-
-    if (iv) {
-        xctx->xts.key2 = &xctx->ks2;
-        memcpy(ctx->iv, iv, 16);
-    }
-
-    return 1;
-}
-
-static int aes_xts_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_AES_XTS_CTX *xctx = EVP_C_DATA(EVP_AES_XTS_CTX, ctx);
-
-    if (xctx->xts.key1 == NULL
-        || xctx->xts.key2 == NULL
-        || out == NULL
-        || in == NULL
-        || len < AES_BLOCK_SIZE)
-        return 0;
-
-    /*
-     * Impose a limit of 2^20 blocks per data unit as specified by
-     * IEEE Std 1619-2018.  The earlier and obsolete IEEE Std 1619-2007
-     * indicated that this was a SHOULD NOT rather than a MUST NOT.
-     * NIST SP 800-38E mandates the same limit.
-     */
-    if (len > XTS_MAX_BLOCKS_PER_DATA_UNIT * AES_BLOCK_SIZE) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_XTS_DATA_UNIT_IS_TOO_LARGE);
-        return 0;
-    }
-
-    if (xctx->stream)
-        (*xctx->stream)(in, out, len,
-            xctx->xts.key1, xctx->xts.key2,
-            ctx->iv);
-    else if (CRYPTO_xts128_encrypt(&xctx->xts, ctx->iv, in, out, len,
-                 EVP_CIPHER_CTX_is_encrypting(ctx)))
-        return 0;
-    return 1;
-}
-
-#define aes_xts_cleanup NULL
-
 #define XTS_FLAGS (EVP_CIPH_FLAG_DEFAULT_ASN1 | EVP_CIPH_CUSTOM_IV \
     | EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CTRL_INIT               \
     | EVP_CIPH_CUSTOM_COPY)
@@ -3380,278 +69,6 @@ static int aes_xts_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 BLOCK_CIPHER_custom(NID_aes, 128, 1, 16, xts, XTS, XTS_FLAGS)
 BLOCK_CIPHER_custom(NID_aes, 256, 1, 16, xts, XTS, XTS_FLAGS)

-static int aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
-{
-    EVP_AES_CCM_CTX *cctx = EVP_C_DATA(EVP_AES_CCM_CTX, c);
-    switch (type) {
-    case EVP_CTRL_INIT:
-        cctx->key_set = 0;
-        cctx->iv_set = 0;
-        cctx->L = 8;
-        cctx->M = 12;
-        cctx->tag_set = 0;
-        cctx->len_set = 0;
-        cctx->tls_aad_len = -1;
-        return 1;
-
-    case EVP_CTRL_GET_IVLEN:
-        *(int *)ptr = 15 - cctx->L;
-        return 1;
-
-    case EVP_CTRL_AEAD_TLS1_AAD:
-        /* Save the AAD for later use */
-        if (arg != EVP_AEAD_TLS1_AAD_LEN)
-            return 0;
-        memcpy(EVP_CIPHER_CTX_buf_noconst(c), ptr, arg);
-        cctx->tls_aad_len = arg;
-        {
-            uint16_t len = EVP_CIPHER_CTX_buf_noconst(c)[arg - 2] << 8
-                | EVP_CIPHER_CTX_buf_noconst(c)[arg - 1];
-            /* Correct length for explicit IV */
-            if (len < EVP_CCM_TLS_EXPLICIT_IV_LEN)
-                return 0;
-            len -= EVP_CCM_TLS_EXPLICIT_IV_LEN;
-            /* If decrypting correct for tag too */
-            if (!EVP_CIPHER_CTX_is_encrypting(c)) {
-                if (len < cctx->M)
-                    return 0;
-                len -= cctx->M;
-            }
-            EVP_CIPHER_CTX_buf_noconst(c)[arg - 2] = len >> 8;
-            EVP_CIPHER_CTX_buf_noconst(c)[arg - 1] = len & 0xff;
-        }
-        /* Extra padding: tag appended to record */
-        return cctx->M;
-
-    case EVP_CTRL_CCM_SET_IV_FIXED:
-        /* Sanity check length */
-        if (arg != EVP_CCM_TLS_FIXED_IV_LEN)
-            return 0;
-        /* Just copy to first part of IV */
-        memcpy(c->iv, ptr, arg);
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_IVLEN:
-        arg = 15 - arg;
-        /* fall through */
-    case EVP_CTRL_CCM_SET_L:
-        if (arg < 2 || arg > 8)
-            return 0;
-        cctx->L = arg;
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_TAG:
-        if ((arg & 1) || arg < 4 || arg > 16)
-            return 0;
-        if (EVP_CIPHER_CTX_is_encrypting(c) && ptr)
-            return 0;
-        if (ptr) {
-            cctx->tag_set = 1;
-            memcpy(EVP_CIPHER_CTX_buf_noconst(c), ptr, arg);
-        }
-        cctx->M = arg;
-        return 1;
-
-    case EVP_CTRL_AEAD_GET_TAG:
-        if (!EVP_CIPHER_CTX_is_encrypting(c) || !cctx->tag_set)
-            return 0;
-        if (!CRYPTO_ccm128_tag(&cctx->ccm, ptr, (size_t)arg))
-            return 0;
-        cctx->tag_set = 0;
-        cctx->iv_set = 0;
-        cctx->len_set = 0;
-        return 1;
-
-    case EVP_CTRL_COPY: {
-        EVP_CIPHER_CTX *out = ptr;
-        EVP_AES_CCM_CTX *cctx_out = EVP_C_DATA(EVP_AES_CCM_CTX, out);
-        if (cctx->ccm.key) {
-            if (cctx->ccm.key != &cctx->ks)
-                return 0;
-            cctx_out->ccm.key = &cctx_out->ks;
-        }
-        return 1;
-    }
-
-    default:
-        return -1;
-    }
-}
-
-static int aes_ccm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    EVP_AES_CCM_CTX *cctx = EVP_C_DATA(EVP_AES_CCM_CTX, ctx);
-
-    if (iv == NULL && key == NULL)
-        return 1;
-
-    if (key != NULL) {
-        const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-
-        if (keylen <= 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-        do {
-#ifdef HWAES_CAPABLE
-            if (HWAES_CAPABLE) {
-                HWAES_set_encrypt_key(key, keylen, &cctx->ks.ks);
-
-                CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L,
-                    &cctx->ks, (block128_f)HWAES_encrypt);
-                cctx->str = NULL;
-                cctx->key_set = 1;
-                break;
-            } else
-#endif
-#ifdef VPAES_CAPABLE
-                if (VPAES_CAPABLE) {
-                vpaes_set_encrypt_key(key, keylen, &cctx->ks.ks);
-                CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L,
-                    &cctx->ks, (block128_f)vpaes_encrypt);
-                cctx->str = NULL;
-                cctx->key_set = 1;
-                break;
-            }
-#endif
-            AES_set_encrypt_key(key, keylen, &cctx->ks.ks);
-            CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L,
-                &cctx->ks, (block128_f)AES_encrypt);
-            cctx->str = NULL;
-            cctx->key_set = 1;
-        } while (0);
-    }
-    if (iv != NULL) {
-        memcpy(ctx->iv, iv, 15 - cctx->L);
-        cctx->iv_set = 1;
-    }
-    return 1;
-}
-
-static int aes_ccm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_AES_CCM_CTX *cctx = EVP_C_DATA(EVP_AES_CCM_CTX, ctx);
-    CCM128_CONTEXT *ccm = &cctx->ccm;
-    /* Encrypt/decrypt must be performed in place */
-    if (out != in || len < (EVP_CCM_TLS_EXPLICIT_IV_LEN + (size_t)cctx->M))
-        return -1;
-    /* If encrypting set explicit IV from sequence number (start of AAD) */
-    if (EVP_CIPHER_CTX_is_encrypting(ctx))
-        memcpy(out, EVP_CIPHER_CTX_buf_noconst(ctx),
-            EVP_CCM_TLS_EXPLICIT_IV_LEN);
-    /* Get rest of IV from explicit IV */
-    memcpy(ctx->iv + EVP_CCM_TLS_FIXED_IV_LEN, in,
-        EVP_CCM_TLS_EXPLICIT_IV_LEN);
-    /* Correct length value */
-    len -= EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->M;
-    if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L,
-            len))
-        return -1;
-    /* Use saved AAD */
-    CRYPTO_ccm128_aad(ccm, EVP_CIPHER_CTX_buf_noconst(ctx),
-        cctx->tls_aad_len);
-    /* Fix buffer to point to payload */
-    in += EVP_CCM_TLS_EXPLICIT_IV_LEN;
-    out += EVP_CCM_TLS_EXPLICIT_IV_LEN;
-    if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-        if (cctx->str ? CRYPTO_ccm128_encrypt_ccm64(ccm, in, out, len,
-                            cctx->str)
-                      : CRYPTO_ccm128_encrypt(ccm, in, out, len))
-            return -1;
-        if (!CRYPTO_ccm128_tag(ccm, out + len, cctx->M))
-            return -1;
-        return len + EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->M;
-    } else {
-        if (cctx->str ? !CRYPTO_ccm128_decrypt_ccm64(ccm, in, out, len,
-                            cctx->str)
-                      : !CRYPTO_ccm128_decrypt(ccm, in, out, len)) {
-            unsigned char tag[16];
-            if (CRYPTO_ccm128_tag(ccm, tag, cctx->M)) {
-                if (!CRYPTO_memcmp(tag, in + len, cctx->M))
-                    return len;
-            }
-        }
-        OPENSSL_cleanse(out, len);
-        return -1;
-    }
-}
-
-static int aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_AES_CCM_CTX *cctx = EVP_C_DATA(EVP_AES_CCM_CTX, ctx);
-    CCM128_CONTEXT *ccm = &cctx->ccm;
-    /* If not set up, return error */
-    if (!cctx->key_set)
-        return -1;
-
-    if (cctx->tls_aad_len >= 0)
-        return aes_ccm_tls_cipher(ctx, out, in, len);
-
-    /* EVP_*Final() doesn't return any data */
-    if (in == NULL && out != NULL)
-        return 0;
-
-    if (!cctx->iv_set)
-        return -1;
-
-    if (!out) {
-        if (!in) {
-            if (CRYPTO_ccm128_setiv(ccm, ctx->iv,
-                    15 - cctx->L, len))
-                return -1;
-            cctx->len_set = 1;
-            return len;
-        }
-        /* If have AAD need message length */
-        if (!cctx->len_set && len)
-            return -1;
-        CRYPTO_ccm128_aad(ccm, in, len);
-        return len;
-    }
-
-    /* The tag must be set before actually decrypting data */
-    if (!EVP_CIPHER_CTX_is_encrypting(ctx) && !cctx->tag_set)
-        return -1;
-
-    /* If not set length yet do it */
-    if (!cctx->len_set) {
-        if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L, len))
-            return -1;
-        cctx->len_set = 1;
-    }
-    if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-        if (cctx->str ? CRYPTO_ccm128_encrypt_ccm64(ccm, in, out, len,
-                            cctx->str)
-                      : CRYPTO_ccm128_encrypt(ccm, in, out, len))
-            return -1;
-        cctx->tag_set = 1;
-        return len;
-    } else {
-        int rv = -1;
-        if (cctx->str ? !CRYPTO_ccm128_decrypt_ccm64(ccm, in, out, len,
-                            cctx->str)
-                      : !CRYPTO_ccm128_decrypt(ccm, in, out, len)) {
-            unsigned char tag[16];
-            if (CRYPTO_ccm128_tag(ccm, tag, cctx->M)) {
-                if (!CRYPTO_memcmp(tag, EVP_CIPHER_CTX_buf_noconst(ctx),
-                        cctx->M))
-                    rv = len;
-            }
-        }
-        if (rv == -1)
-            OPENSSL_cleanse(out, len);
-        cctx->iv_set = 0;
-        cctx->tag_set = 0;
-        cctx->len_set = 0;
-        return rv;
-    }
-}
-
-#define aes_ccm_cleanup NULL
-
 BLOCK_CIPHER_custom(NID_aes, 128, 1, 12, ccm, CCM,
     EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS)
 BLOCK_CIPHER_custom(NID_aes, 192, 1, 12, ccm, CCM,
@@ -3659,116 +76,13 @@ BLOCK_CIPHER_custom(NID_aes, 192, 1, 12, ccm, CCM,
 BLOCK_CIPHER_custom(NID_aes, 256, 1, 12, ccm, CCM,
     EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS)

-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        AES_KEY ks;
-    } ks;
-    /* Indicates if IV has been set */
-    unsigned char *iv;
-} EVP_AES_WRAP_CTX;
-
-static int aes_wrap_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    int len;
-    EVP_AES_WRAP_CTX *wctx = EVP_C_DATA(EVP_AES_WRAP_CTX, ctx);
-
-    if (iv == NULL && key == NULL)
-        return 1;
-    if (key != NULL) {
-        const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-
-        if (keylen <= 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-        if (EVP_CIPHER_CTX_is_encrypting(ctx))
-            AES_set_encrypt_key(key, keylen, &wctx->ks.ks);
-        else
-            AES_set_decrypt_key(key, keylen, &wctx->ks.ks);
-        if (iv == NULL)
-            wctx->iv = NULL;
-    }
-    if (iv != NULL) {
-        if ((len = EVP_CIPHER_CTX_get_iv_length(ctx)) < 0)
-            return 0;
-        memcpy(ctx->iv, iv, len);
-        wctx->iv = ctx->iv;
-    }
-    return 1;
-}
-
-static int aes_wrap_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inlen)
-{
-    EVP_AES_WRAP_CTX *wctx = EVP_C_DATA(EVP_AES_WRAP_CTX, ctx);
-    size_t rv;
-    /* AES wrap with padding has IV length of 4, without padding 8 */
-    int pad = EVP_CIPHER_CTX_get_iv_length(ctx) == 4;
-    /* No final operation so always return zero length */
-    if (!in)
-        return 0;
-    /* Input length must always be non-zero */
-    if (!inlen)
-        return -1;
-    /* If decrypting need at least 16 bytes and multiple of 8 */
-    if (!EVP_CIPHER_CTX_is_encrypting(ctx) && (inlen < 16 || inlen & 0x7))
-        return -1;
-    /* If not padding input must be multiple of 8 */
-    if (!pad && inlen & 0x7)
-        return -1;
-    if (ossl_is_partially_overlapping(out, in, inlen)) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING);
-        return 0;
-    }
-    if (!out) {
-        if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            /* If padding round up to multiple of 8 */
-            if (pad)
-                inlen = (inlen + 7) / 8 * 8;
-            /* 8 byte prefix */
-            return inlen + 8;
-        } else {
-            /*
-             * If not padding output will be exactly 8 bytes smaller than
-             * input. If padding it will be at least 8 bytes smaller but we
-             * don't know how much.
-             */
-            return inlen - 8;
-        }
-    }
-    if (pad) {
-        if (EVP_CIPHER_CTX_is_encrypting(ctx))
-            rv = CRYPTO_128_wrap_pad(&wctx->ks.ks, wctx->iv,
-                out, in, inlen,
-                (block128_f)AES_encrypt);
-        else
-            rv = CRYPTO_128_unwrap_pad(&wctx->ks.ks, wctx->iv,
-                out, in, inlen,
-                (block128_f)AES_decrypt);
-    } else {
-        if (EVP_CIPHER_CTX_is_encrypting(ctx))
-            rv = CRYPTO_128_wrap(&wctx->ks.ks, wctx->iv,
-                out, in, inlen, (block128_f)AES_encrypt);
-        else
-            rv = CRYPTO_128_unwrap(&wctx->ks.ks, wctx->iv,
-                out, in, inlen, (block128_f)AES_decrypt);
-    }
-    return rv ? (int)rv : -1;
-}
-
 #define WRAP_FLAGS (EVP_CIPH_WRAP_MODE                 \
     | EVP_CIPH_CUSTOM_IV | EVP_CIPH_FLAG_CUSTOM_CIPHER \
     | EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_FLAG_DEFAULT_ASN1)

 static const EVP_CIPHER aes_128_wrap = {
     NID_id_aes128_wrap,
-    8, 16, 8, WRAP_FLAGS, EVP_ORIG_GLOBAL,
-    aes_wrap_init_key, aes_wrap_cipher,
-    NULL,
-    sizeof(EVP_AES_WRAP_CTX),
-    NULL, NULL, NULL, NULL
+    8, 16, 8, WRAP_FLAGS, EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_aes_128_wrap(void)
@@ -3778,11 +92,7 @@ const EVP_CIPHER *EVP_aes_128_wrap(void)

 static const EVP_CIPHER aes_192_wrap = {
     NID_id_aes192_wrap,
-    8, 24, 8, WRAP_FLAGS, EVP_ORIG_GLOBAL,
-    aes_wrap_init_key, aes_wrap_cipher,
-    NULL,
-    sizeof(EVP_AES_WRAP_CTX),
-    NULL, NULL, NULL, NULL
+    8, 24, 8, WRAP_FLAGS, EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_aes_192_wrap(void)
@@ -3792,11 +102,7 @@ const EVP_CIPHER *EVP_aes_192_wrap(void)

 static const EVP_CIPHER aes_256_wrap = {
     NID_id_aes256_wrap,
-    8, 32, 8, WRAP_FLAGS, EVP_ORIG_GLOBAL,
-    aes_wrap_init_key, aes_wrap_cipher,
-    NULL,
-    sizeof(EVP_AES_WRAP_CTX),
-    NULL, NULL, NULL, NULL
+    8, 32, 8, WRAP_FLAGS, EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_aes_256_wrap(void)
@@ -3806,11 +112,7 @@ const EVP_CIPHER *EVP_aes_256_wrap(void)

 static const EVP_CIPHER aes_128_wrap_pad = {
     NID_id_aes128_wrap_pad,
-    8, 16, 4, WRAP_FLAGS, EVP_ORIG_GLOBAL,
-    aes_wrap_init_key, aes_wrap_cipher,
-    NULL,
-    sizeof(EVP_AES_WRAP_CTX),
-    NULL, NULL, NULL, NULL
+    8, 16, 4, WRAP_FLAGS, EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_aes_128_wrap_pad(void)
@@ -3820,11 +122,7 @@ const EVP_CIPHER *EVP_aes_128_wrap_pad(void)

 static const EVP_CIPHER aes_192_wrap_pad = {
     NID_id_aes192_wrap_pad,
-    8, 24, 4, WRAP_FLAGS, EVP_ORIG_GLOBAL,
-    aes_wrap_init_key, aes_wrap_cipher,
-    NULL,
-    sizeof(EVP_AES_WRAP_CTX),
-    NULL, NULL, NULL, NULL
+    8, 24, 4, WRAP_FLAGS, EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_aes_192_wrap_pad(void)
@@ -3834,11 +132,7 @@ const EVP_CIPHER *EVP_aes_192_wrap_pad(void)

 static const EVP_CIPHER aes_256_wrap_pad = {
     NID_id_aes256_wrap_pad,
-    8, 32, 4, WRAP_FLAGS, EVP_ORIG_GLOBAL,
-    aes_wrap_init_key, aes_wrap_cipher,
-    NULL,
-    sizeof(EVP_AES_WRAP_CTX),
-    NULL, NULL, NULL, NULL
+    8, 32, 4, WRAP_FLAGS, EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_aes_256_wrap_pad(void)
@@ -3847,303 +141,6 @@ const EVP_CIPHER *EVP_aes_256_wrap_pad(void)
 }

 #ifndef OPENSSL_NO_OCB
-static int aes_ocb_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
-{
-    EVP_AES_OCB_CTX *octx = EVP_C_DATA(EVP_AES_OCB_CTX, c);
-    EVP_CIPHER_CTX *newc;
-    EVP_AES_OCB_CTX *new_octx;
-
-    switch (type) {
-    case EVP_CTRL_INIT:
-        octx->key_set = 0;
-        octx->iv_set = 0;
-        octx->ivlen = EVP_CIPHER_get_iv_length(c->cipher);
-        octx->iv = c->iv;
-        octx->taglen = 16;
-        octx->data_buf_len = 0;
-        octx->aad_buf_len = 0;
-        return 1;
-
-    case EVP_CTRL_GET_IVLEN:
-        *(int *)ptr = octx->ivlen;
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_IVLEN:
-        /* IV len must be 1 to 15 */
-        if (arg <= 0 || arg > 15)
-            return 0;
-
-        octx->ivlen = arg;
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_TAG:
-        if (ptr == NULL) {
-            /* Tag len must be 0 to 16 */
-            if (arg < 0 || arg > 16)
-                return 0;
-
-            octx->taglen = arg;
-            return 1;
-        }
-        if (arg != octx->taglen || EVP_CIPHER_CTX_is_encrypting(c))
-            return 0;
-        memcpy(octx->tag, ptr, arg);
-        return 1;
-
-    case EVP_CTRL_AEAD_GET_TAG:
-        if (arg != octx->taglen || !EVP_CIPHER_CTX_is_encrypting(c))
-            return 0;
-
-        memcpy(ptr, octx->tag, arg);
-        return 1;
-
-    case EVP_CTRL_COPY:
-        newc = (EVP_CIPHER_CTX *)ptr;
-        new_octx = EVP_C_DATA(EVP_AES_OCB_CTX, newc);
-        return CRYPTO_ocb128_copy_ctx(&new_octx->ocb, &octx->ocb,
-            &new_octx->ksenc.ks,
-            &new_octx->ksdec.ks);
-
-    default:
-        return -1;
-    }
-}
-
-static int aes_ocb_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    EVP_AES_OCB_CTX *octx = EVP_C_DATA(EVP_AES_OCB_CTX, ctx);
-
-    if (iv == NULL && key == NULL)
-        return 1;
-
-    if (key != NULL) {
-        const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-
-        if (keylen <= 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-        do {
-            /*
-             * We set both the encrypt and decrypt key here because decrypt
-             * needs both. We could possibly optimise to remove setting the
-             * decrypt for an encryption operation.
-             */
-#ifdef HWAES_CAPABLE
-            if (HWAES_CAPABLE) {
-                HWAES_set_encrypt_key(key, keylen, &octx->ksenc.ks);
-                HWAES_set_decrypt_key(key, keylen, &octx->ksdec.ks);
-                if (!CRYPTO_ocb128_init(&octx->ocb,
-                        &octx->ksenc.ks, &octx->ksdec.ks,
-                        (block128_f)HWAES_encrypt,
-                        (block128_f)HWAES_decrypt,
-                        enc ? HWAES_ocb_encrypt
-                            : HWAES_ocb_decrypt))
-                    return 0;
-                break;
-            }
-#endif
-#ifdef VPAES_CAPABLE
-            if (VPAES_CAPABLE) {
-                vpaes_set_encrypt_key(key, keylen, &octx->ksenc.ks);
-                vpaes_set_decrypt_key(key, keylen, &octx->ksdec.ks);
-                if (!CRYPTO_ocb128_init(&octx->ocb,
-                        &octx->ksenc.ks, &octx->ksdec.ks,
-                        (block128_f)vpaes_encrypt,
-                        (block128_f)vpaes_decrypt,
-                        NULL))
-                    return 0;
-                break;
-            }
-#endif
-            AES_set_encrypt_key(key, keylen, &octx->ksenc.ks);
-            AES_set_decrypt_key(key, keylen, &octx->ksdec.ks);
-            if (!CRYPTO_ocb128_init(&octx->ocb,
-                    &octx->ksenc.ks, &octx->ksdec.ks,
-                    (block128_f)AES_encrypt,
-                    (block128_f)AES_decrypt,
-                    NULL))
-                return 0;
-        } while (0);
-
-        /*
-         * If we have an iv we can set it directly, otherwise use saved IV.
-         */
-        if (iv == NULL && octx->iv_set)
-            iv = octx->iv;
-        if (iv) {
-            if (CRYPTO_ocb128_setiv(&octx->ocb, iv, octx->ivlen, octx->taglen)
-                != 1)
-                return 0;
-            octx->iv_set = 1;
-        }
-        octx->key_set = 1;
-    } else {
-        /* If key set use IV, otherwise copy */
-        if (octx->key_set)
-            CRYPTO_ocb128_setiv(&octx->ocb, iv, octx->ivlen, octx->taglen);
-        else
-            memcpy(octx->iv, iv, octx->ivlen);
-        octx->iv_set = 1;
-    }
-    return 1;
-}
-
-static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    unsigned char *buf;
-    int *buf_len;
-    int written_len = 0;
-    size_t trailing_len;
-    EVP_AES_OCB_CTX *octx = EVP_C_DATA(EVP_AES_OCB_CTX, ctx);
-
-    /* If IV or Key not set then return error */
-    if (!octx->iv_set)
-        return -1;
-
-    if (!octx->key_set)
-        return -1;
-
-    if (in != NULL) {
-        /*
-         * Need to ensure we are only passing full blocks to low-level OCB
-         * routines. We do it here rather than in EVP_EncryptUpdate/
-         * EVP_DecryptUpdate because we need to pass full blocks of AAD too
-         * and those routines don't support that
-         */
-
-        /* Are we dealing with AAD or normal data here? */
-        if (out == NULL) {
-            buf = octx->aad_buf;
-            buf_len = &(octx->aad_buf_len);
-        } else {
-            buf = octx->data_buf;
-            buf_len = &(octx->data_buf_len);
-
-            if (ossl_is_partially_overlapping(out + *buf_len, in, len)) {
-                ERR_raise(ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING);
-                return 0;
-            }
-        }
-
-        /*
-         * If we've got a partially filled buffer from a previous call then
-         * use that data first
-         */
-        if (*buf_len > 0) {
-            unsigned int remaining;
-
-            remaining = AES_BLOCK_SIZE - (*buf_len);
-            if (remaining > len) {
-                memcpy(buf + (*buf_len), in, len);
-                *(buf_len) += len;
-                return 0;
-            }
-            memcpy(buf + (*buf_len), in, remaining);
-
-            /*
-             * If we get here we've filled the buffer, so process it
-             */
-            len -= remaining;
-            in += remaining;
-            if (out == NULL) {
-                if (!CRYPTO_ocb128_aad(&octx->ocb, buf, AES_BLOCK_SIZE))
-                    return -1;
-            } else if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-                if (!CRYPTO_ocb128_encrypt(&octx->ocb, buf, out,
-                        AES_BLOCK_SIZE))
-                    return -1;
-            } else {
-                if (!CRYPTO_ocb128_decrypt(&octx->ocb, buf, out,
-                        AES_BLOCK_SIZE))
-                    return -1;
-            }
-            written_len = AES_BLOCK_SIZE;
-            *buf_len = 0;
-            if (out != NULL)
-                out += AES_BLOCK_SIZE;
-        }
-
-        /* Do we have a partial block to handle at the end? */
-        trailing_len = len % AES_BLOCK_SIZE;
-
-        /*
-         * If we've got some full blocks to handle, then process these first
-         */
-        if (len != trailing_len) {
-            if (out == NULL) {
-                if (!CRYPTO_ocb128_aad(&octx->ocb, in, len - trailing_len))
-                    return -1;
-            } else if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-                if (!CRYPTO_ocb128_encrypt(&octx->ocb, in, out, len - trailing_len))
-                    return -1;
-            } else {
-                if (!CRYPTO_ocb128_decrypt(&octx->ocb, in, out, len - trailing_len))
-                    return -1;
-            }
-            written_len += len - trailing_len;
-            in += len - trailing_len;
-        }
-
-        /* Handle any trailing partial block */
-        if (trailing_len > 0) {
-            memcpy(buf, in, trailing_len);
-            *buf_len = trailing_len;
-        }
-
-        return written_len;
-    } else {
-        /*
-         * First of all empty the buffer of any partial block that we might
-         * have been provided - both for data and AAD
-         */
-        if (octx->data_buf_len > 0) {
-            if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-                if (!CRYPTO_ocb128_encrypt(&octx->ocb, octx->data_buf, out,
-                        octx->data_buf_len))
-                    return -1;
-            } else {
-                if (!CRYPTO_ocb128_decrypt(&octx->ocb, octx->data_buf, out,
-                        octx->data_buf_len))
-                    return -1;
-            }
-            written_len = octx->data_buf_len;
-            octx->data_buf_len = 0;
-        }
-        if (octx->aad_buf_len > 0) {
-            if (!CRYPTO_ocb128_aad(&octx->ocb, octx->aad_buf, octx->aad_buf_len))
-                return -1;
-            octx->aad_buf_len = 0;
-        }
-        /* If decrypting then verify */
-        if (!EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            if (octx->taglen < 0)
-                return -1;
-            if (CRYPTO_ocb128_finish(&octx->ocb,
-                    octx->tag, octx->taglen)
-                != 0)
-                return -1;
-            octx->iv_set = 0;
-            return written_len;
-        }
-        /* If encrypting then just get the tag */
-        if (CRYPTO_ocb128_tag(&octx->ocb, octx->tag, 16) != 1)
-            return -1;
-        /* Don't reuse the IV */
-        octx->iv_set = 0;
-        return written_len;
-    }
-}
-
-static int aes_ocb_cleanup(EVP_CIPHER_CTX *c)
-{
-    EVP_AES_OCB_CTX *octx = EVP_C_DATA(EVP_AES_OCB_CTX, c);
-    CRYPTO_ocb128_cleanup(&octx->ocb);
-    return 1;
-}
-
 BLOCK_CIPHER_custom(NID_aes, 128, 16, 12, ocb, OCB,
     EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS)
 BLOCK_CIPHER_custom(NID_aes, 192, 16, 12, ocb, OCB,
diff --git a/deps/openssl/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c b/deps/openssl/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c
index 3ff7126b29e..b7c86b3802c 100644
--- a/deps/openssl/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c
+++ b/deps/openssl/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,895 +7,15 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * AES low level APIs are deprecated for public use, but still ok for internal
- * use where we're using them to implement the higher level EVP interface, as is
- * the case here.
- */
-#include "internal/deprecated.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <openssl/opensslconf.h>
-#include <openssl/evp.h>
-#include <openssl/objects.h>
 #include <openssl/aes.h>
-#include <openssl/sha.h>
-#include <openssl/rand.h>
 #include "internal/cryptlib.h"
-#include "crypto/modes.h"
 #include "crypto/evp.h"
-#include "internal/constant_time.h"
-#include "evp_local.h"
-
-typedef struct {
-    AES_KEY ks;
-    SHA_CTX head, tail, md;
-    size_t payload_length; /* AAD length in decrypt case */
-    union {
-        unsigned int tls_ver;
-        unsigned char tls_aad[16]; /* 13 used */
-    } aux;
-} EVP_AES_HMAC_SHA1;
-
-#define NO_PAYLOAD_LENGTH ((size_t)-1)

 #if defined(AES_ASM) && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))

 #define AESNI_CAPABLE (1 << (57 - 32))

-int aesni_set_encrypt_key(const unsigned char *userKey, int bits,
-    AES_KEY *key);
-int aesni_set_decrypt_key(const unsigned char *userKey, int bits,
-    AES_KEY *key);
-
-void aesni_cbc_encrypt(const unsigned char *in,
-    unsigned char *out,
-    size_t length,
-    const AES_KEY *key, unsigned char *ivec, int enc);
-
-void aesni_cbc_sha1_enc(const void *inp, void *out, size_t blocks,
-    const AES_KEY *key, unsigned char iv[16],
-    SHA_CTX *ctx, const void *in0);
-
-void aesni256_cbc_sha1_dec(const void *inp, void *out, size_t blocks,
-    const AES_KEY *key, unsigned char iv[16],
-    SHA_CTX *ctx, const void *in0);
-
-#define data(ctx) ((EVP_AES_HMAC_SHA1 *)EVP_CIPHER_CTX_get_cipher_data(ctx))
-
-static int aesni_cbc_hmac_sha1_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *inkey,
-    const unsigned char *iv, int enc)
-{
-    EVP_AES_HMAC_SHA1 *key = data(ctx);
-    int ret;
-    const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-
-    if (keylen <= 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-        return 0;
-    }
-    if (enc)
-        ret = aesni_set_encrypt_key(inkey, keylen, &key->ks);
-    else
-        ret = aesni_set_decrypt_key(inkey, keylen, &key->ks);
-
-    SHA1_Init(&key->head); /* handy when benchmarking */
-    key->tail = key->head;
-    key->md = key->head;
-
-    key->payload_length = NO_PAYLOAD_LENGTH;
-
-    return ret < 0 ? 0 : 1;
-}
-
-#define STITCHED_CALL
-#undef STITCHED_DECRYPT_CALL
-
-#if !defined(STITCHED_CALL)
-#define aes_off 0
-#endif
-
-void sha1_block_data_order(void *c, const void *p, size_t len);
-
-static void sha1_update(SHA_CTX *c, const void *data, size_t len)
-{
-    const unsigned char *ptr = data;
-    size_t res;
-
-    if ((res = c->num)) {
-        res = SHA_CBLOCK - res;
-        if (len < res)
-            res = len;
-        SHA1_Update(c, ptr, res);
-        ptr += res;
-        len -= res;
-    }
-
-    res = len % SHA_CBLOCK;
-    len -= res;
-
-    if (len) {
-        sha1_block_data_order(c, ptr, len / SHA_CBLOCK);
-
-        ptr += len;
-        c->Nh += len >> 29;
-        c->Nl += len <<= 3;
-        if (c->Nl < (unsigned int)len)
-            c->Nh++;
-    }
-
-    if (res)
-        SHA1_Update(c, ptr, res);
-}
-
-#ifdef SHA1_Update
-#undef SHA1_Update
-#endif
-#define SHA1_Update sha1_update
-
-#if !defined(OPENSSL_NO_MULTIBLOCK)
-
-typedef struct {
-    unsigned int A[8], B[8], C[8], D[8], E[8];
-} SHA1_MB_CTX;
-typedef struct {
-    const unsigned char *ptr;
-    int blocks;
-} HASH_DESC;
-
-void sha1_multi_block(SHA1_MB_CTX *, const HASH_DESC *, int);
-
-typedef struct {
-    const unsigned char *inp;
-    unsigned char *out;
-    int blocks;
-    u64 iv[2];
-} CIPH_DESC;
-
-void aesni_multi_cbc_encrypt(CIPH_DESC *, void *, int);
-
-static size_t tls1_1_multi_block_encrypt(EVP_AES_HMAC_SHA1 *key,
-    unsigned char *out,
-    const unsigned char *inp,
-    size_t inp_len, int n4x)
-{ /* n4x is 1 or 2 */
-    HASH_DESC hash_d[8], edges[8];
-    CIPH_DESC ciph_d[8];
-    unsigned char storage[sizeof(SHA1_MB_CTX) + 32];
-    union {
-        u64 q[16];
-        u32 d[32];
-        u8 c[128];
-    } blocks[8];
-    SHA1_MB_CTX *ctx;
-    unsigned int frag, last, packlen, i, x4 = 4 * n4x, minblocks, processed = 0;
-    size_t ret = 0;
-    u8 *IVs;
-#if defined(BSWAP8)
-    u64 seqnum;
-#endif
-
-    /* ask for IVs in bulk */
-    if (RAND_bytes((IVs = blocks[0].c), 16 * x4) <= 0)
-        return 0;
-
-    ctx = (SHA1_MB_CTX *)(storage + 32 - ((size_t)storage % 32)); /* align */
-
-    frag = (unsigned int)inp_len >> (1 + n4x);
-    last = (unsigned int)inp_len + frag - (frag << (1 + n4x));
-    if (last > frag && ((last + 13 + 9) % 64) < (x4 - 1)) {
-        frag++;
-        last -= x4 - 1;
-    }
-
-    packlen = 5 + 16 + ((frag + 20 + 16) & -16);
-
-    /* populate descriptors with pointers and IVs */
-    hash_d[0].ptr = inp;
-    ciph_d[0].inp = inp;
-    /* 5+16 is place for header and explicit IV */
-    ciph_d[0].out = out + 5 + 16;
-    memcpy(ciph_d[0].out - 16, IVs, 16);
-    memcpy(ciph_d[0].iv, IVs, 16);
-    IVs += 16;
-
-    for (i = 1; i < x4; i++) {
-        ciph_d[i].inp = hash_d[i].ptr = hash_d[i - 1].ptr + frag;
-        ciph_d[i].out = ciph_d[i - 1].out + packlen;
-        memcpy(ciph_d[i].out - 16, IVs, 16);
-        memcpy(ciph_d[i].iv, IVs, 16);
-        IVs += 16;
-    }
-
-#if defined(BSWAP8)
-    memcpy(blocks[0].c, key->md.data, 8);
-    seqnum = BSWAP8(blocks[0].q[0]);
-#endif
-    for (i = 0; i < x4; i++) {
-        unsigned int len = (i == (x4 - 1) ? last : frag);
-#if !defined(BSWAP8)
-        unsigned int carry, j;
-#endif
-
-        ctx->A[i] = key->md.h0;
-        ctx->B[i] = key->md.h1;
-        ctx->C[i] = key->md.h2;
-        ctx->D[i] = key->md.h3;
-        ctx->E[i] = key->md.h4;
-
-        /* fix seqnum */
-#if defined(BSWAP8)
-        blocks[i].q[0] = BSWAP8(seqnum + i);
-#else
-        for (carry = i, j = 8; j--;) {
-            blocks[i].c[j] = ((u8 *)key->md.data)[j] + carry;
-            carry = (blocks[i].c[j] - carry) >> (sizeof(carry) * 8 - 1);
-        }
-#endif
-        blocks[i].c[8] = ((u8 *)key->md.data)[8];
-        blocks[i].c[9] = ((u8 *)key->md.data)[9];
-        blocks[i].c[10] = ((u8 *)key->md.data)[10];
-        /* fix length */
-        blocks[i].c[11] = (u8)(len >> 8);
-        blocks[i].c[12] = (u8)(len);
-
-        memcpy(blocks[i].c + 13, hash_d[i].ptr, 64 - 13);
-        hash_d[i].ptr += 64 - 13;
-        hash_d[i].blocks = (len - (64 - 13)) / 64;
-
-        edges[i].ptr = blocks[i].c;
-        edges[i].blocks = 1;
-    }
-
-    /* hash 13-byte headers and first 64-13 bytes of inputs */
-    sha1_multi_block(ctx, edges, n4x);
-    /* hash bulk inputs */
-#define MAXCHUNKSIZE 2048
-#if MAXCHUNKSIZE % 64
-#error "MAXCHUNKSIZE is not divisible by 64"
-#elif MAXCHUNKSIZE
-    /*
-     * goal is to minimize pressure on L1 cache by moving in shorter steps,
-     * so that hashed data is still in the cache by the time we encrypt it
-     */
-    minblocks = ((frag <= last ? frag : last) - (64 - 13)) / 64;
-    if (minblocks > MAXCHUNKSIZE / 64) {
-        for (i = 0; i < x4; i++) {
-            edges[i].ptr = hash_d[i].ptr;
-            edges[i].blocks = MAXCHUNKSIZE / 64;
-            ciph_d[i].blocks = MAXCHUNKSIZE / 16;
-        }
-        do {
-            sha1_multi_block(ctx, edges, n4x);
-            aesni_multi_cbc_encrypt(ciph_d, &key->ks, n4x);
-
-            for (i = 0; i < x4; i++) {
-                edges[i].ptr = hash_d[i].ptr += MAXCHUNKSIZE;
-                hash_d[i].blocks -= MAXCHUNKSIZE / 64;
-                edges[i].blocks = MAXCHUNKSIZE / 64;
-                ciph_d[i].inp += MAXCHUNKSIZE;
-                ciph_d[i].out += MAXCHUNKSIZE;
-                ciph_d[i].blocks = MAXCHUNKSIZE / 16;
-                memcpy(ciph_d[i].iv, ciph_d[i].out - 16, 16);
-            }
-            processed += MAXCHUNKSIZE;
-            minblocks -= MAXCHUNKSIZE / 64;
-        } while (minblocks > MAXCHUNKSIZE / 64);
-    }
-#endif
-#undef MAXCHUNKSIZE
-    sha1_multi_block(ctx, hash_d, n4x);
-
-    memset(blocks, 0, sizeof(blocks));
-    for (i = 0; i < x4; i++) {
-        unsigned int len = (i == (x4 - 1) ? last : frag),
-                     off = hash_d[i].blocks * 64;
-        const unsigned char *ptr = hash_d[i].ptr + off;
-
-        off = (len - processed) - (64 - 13) - off; /* remainder actually */
-        memcpy(blocks[i].c, ptr, off);
-        blocks[i].c[off] = 0x80;
-        len += 64 + 13; /* 64 is HMAC header */
-        len *= 8; /* convert to bits */
-        if (off < (64 - 8)) {
-#ifdef BSWAP4
-            blocks[i].d[15] = BSWAP4(len);
-#else
-            PUTU32(blocks[i].c + 60, len);
-#endif
-            edges[i].blocks = 1;
-        } else {
-#ifdef BSWAP4
-            blocks[i].d[31] = BSWAP4(len);
-#else
-            PUTU32(blocks[i].c + 124, len);
-#endif
-            edges[i].blocks = 2;
-        }
-        edges[i].ptr = blocks[i].c;
-    }
-
-    /* hash input tails and finalize */
-    sha1_multi_block(ctx, edges, n4x);
-
-    memset(blocks, 0, sizeof(blocks));
-    for (i = 0; i < x4; i++) {
-#ifdef BSWAP4
-        blocks[i].d[0] = BSWAP4(ctx->A[i]);
-        ctx->A[i] = key->tail.h0;
-        blocks[i].d[1] = BSWAP4(ctx->B[i]);
-        ctx->B[i] = key->tail.h1;
-        blocks[i].d[2] = BSWAP4(ctx->C[i]);
-        ctx->C[i] = key->tail.h2;
-        blocks[i].d[3] = BSWAP4(ctx->D[i]);
-        ctx->D[i] = key->tail.h3;
-        blocks[i].d[4] = BSWAP4(ctx->E[i]);
-        ctx->E[i] = key->tail.h4;
-        blocks[i].c[20] = 0x80;
-        blocks[i].d[15] = BSWAP4((64 + 20) * 8);
-#else
-        PUTU32(blocks[i].c + 0, ctx->A[i]);
-        ctx->A[i] = key->tail.h0;
-        PUTU32(blocks[i].c + 4, ctx->B[i]);
-        ctx->B[i] = key->tail.h1;
-        PUTU32(blocks[i].c + 8, ctx->C[i]);
-        ctx->C[i] = key->tail.h2;
-        PUTU32(blocks[i].c + 12, ctx->D[i]);
-        ctx->D[i] = key->tail.h3;
-        PUTU32(blocks[i].c + 16, ctx->E[i]);
-        ctx->E[i] = key->tail.h4;
-        blocks[i].c[20] = 0x80;
-        PUTU32(blocks[i].c + 60, (64 + 20) * 8);
-#endif
-        edges[i].ptr = blocks[i].c;
-        edges[i].blocks = 1;
-    }
-
-    /* finalize MACs */
-    sha1_multi_block(ctx, edges, n4x);
-
-    for (i = 0; i < x4; i++) {
-        unsigned int len = (i == (x4 - 1) ? last : frag), pad, j;
-        unsigned char *out0 = out;
-
-        memcpy(ciph_d[i].out, ciph_d[i].inp, len - processed);
-        ciph_d[i].inp = ciph_d[i].out;
-
-        out += 5 + 16 + len;
-
-        /* write MAC */
-        PUTU32(out + 0, ctx->A[i]);
-        PUTU32(out + 4, ctx->B[i]);
-        PUTU32(out + 8, ctx->C[i]);
-        PUTU32(out + 12, ctx->D[i]);
-        PUTU32(out + 16, ctx->E[i]);
-        out += 20;
-        len += 20;
-
-        /* pad */
-        pad = 15 - len % 16;
-        for (j = 0; j <= pad; j++)
-            *(out++) = pad;
-        len += pad + 1;
-
-        ciph_d[i].blocks = (len - processed) / 16;
-        len += 16; /* account for explicit iv */
-
-        /* arrange header */
-        out0[0] = ((u8 *)key->md.data)[8];
-        out0[1] = ((u8 *)key->md.data)[9];
-        out0[2] = ((u8 *)key->md.data)[10];
-        out0[3] = (u8)(len >> 8);
-        out0[4] = (u8)(len);
-
-        ret += len + 5;
-        inp += frag;
-    }
-
-    aesni_multi_cbc_encrypt(ciph_d, &key->ks, n4x);
-
-    OPENSSL_cleanse(blocks, sizeof(blocks));
-    OPENSSL_cleanse(ctx, sizeof(*ctx));
-
-    return ret;
-}
-#endif
-
-static int aesni_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_AES_HMAC_SHA1 *key = data(ctx);
-    unsigned int l;
-    size_t plen = key->payload_length, iv = 0, /* explicit IV in TLS 1.1 and
-                                                * later */
-        sha_off = 0;
-#if defined(STITCHED_CALL)
-    size_t aes_off = 0, blocks;
-
-    sha_off = SHA_CBLOCK - key->md.num;
-#endif
-
-    key->payload_length = NO_PAYLOAD_LENGTH;
-
-    if (len % AES_BLOCK_SIZE)
-        return 0;
-
-    if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-        if (plen == NO_PAYLOAD_LENGTH)
-            plen = len;
-        else if (len != ((plen + SHA_DIGEST_LENGTH + AES_BLOCK_SIZE) & -AES_BLOCK_SIZE))
-            return 0;
-        else if (key->aux.tls_ver >= TLS1_1_VERSION)
-            iv = AES_BLOCK_SIZE;
-
-#if defined(STITCHED_CALL)
-        if (plen > (sha_off + iv)
-            && (blocks = (plen - (sha_off + iv)) / SHA_CBLOCK)) {
-            SHA1_Update(&key->md, in + iv, sha_off);
-
-            aesni_cbc_sha1_enc(in, out, blocks, &key->ks, ctx->iv,
-                &key->md, in + iv + sha_off);
-            blocks *= SHA_CBLOCK;
-            aes_off += blocks;
-            sha_off += blocks;
-            key->md.Nh += blocks >> 29;
-            key->md.Nl += blocks <<= 3;
-            if (key->md.Nl < (unsigned int)blocks)
-                key->md.Nh++;
-        } else {
-            sha_off = 0;
-        }
-#endif
-        sha_off += iv;
-        SHA1_Update(&key->md, in + sha_off, plen - sha_off);
-
-        if (plen != len) { /* "TLS" mode of operation */
-            if (in != out)
-                memcpy(out + aes_off, in + aes_off, plen - aes_off);
-
-            /* calculate HMAC and append it to payload */
-            SHA1_Final(out + plen, &key->md);
-            key->md = key->tail;
-            SHA1_Update(&key->md, out + plen, SHA_DIGEST_LENGTH);
-            SHA1_Final(out + plen, &key->md);
-
-            /* pad the payload|hmac */
-            plen += SHA_DIGEST_LENGTH;
-            for (l = len - plen - 1; plen < len; plen++)
-                out[plen] = l;
-            /* encrypt HMAC|padding at once */
-            aesni_cbc_encrypt(out + aes_off, out + aes_off, len - aes_off,
-                &key->ks, ctx->iv, 1);
-        } else {
-            aesni_cbc_encrypt(in + aes_off, out + aes_off, len - aes_off,
-                &key->ks, ctx->iv, 1);
-        }
-    } else {
-        union {
-            unsigned int u[SHA_DIGEST_LENGTH / sizeof(unsigned int)];
-            unsigned char c[32 + SHA_DIGEST_LENGTH];
-        } mac, *pmac;
-
-        /* arrange cache line alignment */
-        pmac = (void *)(((size_t)mac.c + 31) & ((size_t)0 - 32));
-
-        if (plen != NO_PAYLOAD_LENGTH) { /* "TLS" mode of operation */
-            size_t inp_len, mask, j, i;
-            unsigned int res, maxpad, pad, bitlen;
-            int ret = 1;
-            union {
-                unsigned int u[SHA_LBLOCK];
-                unsigned char c[SHA_CBLOCK];
-            } *data = (void *)key->md.data;
-#if defined(STITCHED_DECRYPT_CALL)
-            unsigned char tail_iv[AES_BLOCK_SIZE];
-            int stitch = 0;
-            const int keylen = EVP_CIPHER_CTX_get_key_length(ctx);
-
-            if (keylen <= 0) {
-                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-                return 0;
-            }
-#endif
-
-            if ((key->aux.tls_aad[plen - 4] << 8 | key->aux.tls_aad[plen - 3])
-                >= TLS1_1_VERSION) {
-                if (len < (AES_BLOCK_SIZE + SHA_DIGEST_LENGTH + 1))
-                    return 0;
-
-                /* omit explicit iv */
-                memcpy(ctx->iv, in, AES_BLOCK_SIZE);
-
-                in += AES_BLOCK_SIZE;
-                out += AES_BLOCK_SIZE;
-                len -= AES_BLOCK_SIZE;
-            } else if (len < (SHA_DIGEST_LENGTH + 1))
-                return 0;
-
-#if defined(STITCHED_DECRYPT_CALL)
-            if (len >= 1024 && keylen == 32) {
-                /* decrypt last block */
-                memcpy(tail_iv, in + len - 2 * AES_BLOCK_SIZE,
-                    AES_BLOCK_SIZE);
-                aesni_cbc_encrypt(in + len - AES_BLOCK_SIZE,
-                    out + len - AES_BLOCK_SIZE, AES_BLOCK_SIZE,
-                    &key->ks, tail_iv, 0);
-                stitch = 1;
-            } else
-#endif
-                /* decrypt HMAC|padding at once */
-                aesni_cbc_encrypt(in, out, len, &key->ks,
-                    ctx->iv, 0);
-
-            /* figure out payload length */
-            pad = out[len - 1];
-            maxpad = len - (SHA_DIGEST_LENGTH + 1);
-            maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8);
-            maxpad &= 255;
-
-            mask = constant_time_ge(maxpad, pad);
-            ret &= mask;
-            /*
-             * If pad is invalid then we will fail the above test but we must
-             * continue anyway because we are in constant time code. However,
-             * we'll use the maxpad value instead of the supplied pad to make
-             * sure we perform well defined pointer arithmetic.
-             */
-            pad = constant_time_select(mask, pad, maxpad);
-
-            inp_len = len - (SHA_DIGEST_LENGTH + pad + 1);
-
-            key->aux.tls_aad[plen - 2] = inp_len >> 8;
-            key->aux.tls_aad[plen - 1] = inp_len;
-
-            /* calculate HMAC */
-            key->md = key->head;
-            SHA1_Update(&key->md, key->aux.tls_aad, plen);
-
-#if defined(STITCHED_DECRYPT_CALL)
-            if (stitch) {
-                blocks = (len - (256 + 32 + SHA_CBLOCK)) / SHA_CBLOCK;
-                aes_off = len - AES_BLOCK_SIZE - blocks * SHA_CBLOCK;
-                sha_off = SHA_CBLOCK - plen;
-
-                aesni_cbc_encrypt(in, out, aes_off, &key->ks, ctx->iv, 0);
-
-                SHA1_Update(&key->md, out, sha_off);
-                aesni256_cbc_sha1_dec(in + aes_off,
-                    out + aes_off, blocks, &key->ks,
-                    ctx->iv, &key->md, out + sha_off);
-
-                sha_off += blocks *= SHA_CBLOCK;
-                out += sha_off;
-                len -= sha_off;
-                inp_len -= sha_off;
-
-                key->md.Nl += (blocks << 3); /* at most 18 bits */
-                memcpy(ctx->iv, tail_iv, AES_BLOCK_SIZE);
-            }
-#endif
-
-#if 1 /* see original reference version in #else */
-            len -= SHA_DIGEST_LENGTH; /* amend mac */
-            if (len >= (256 + SHA_CBLOCK)) {
-                j = (len - (256 + SHA_CBLOCK)) & (0 - SHA_CBLOCK);
-                j += SHA_CBLOCK - key->md.num;
-                SHA1_Update(&key->md, out, j);
-                out += j;
-                len -= j;
-                inp_len -= j;
-            }
-
-            /* but pretend as if we hashed padded payload */
-            bitlen = key->md.Nl + (inp_len << 3); /* at most 18 bits */
-#ifdef BSWAP4
-            bitlen = BSWAP4(bitlen);
-#else
-            mac.c[0] = 0;
-            mac.c[1] = (unsigned char)(bitlen >> 16);
-            mac.c[2] = (unsigned char)(bitlen >> 8);
-            mac.c[3] = (unsigned char)bitlen;
-            bitlen = mac.u[0];
-#endif
-
-            pmac->u[0] = 0;
-            pmac->u[1] = 0;
-            pmac->u[2] = 0;
-            pmac->u[3] = 0;
-            pmac->u[4] = 0;
-
-            for (res = key->md.num, j = 0; j < len; j++) {
-                size_t c = out[j];
-                mask = (j - inp_len) >> (sizeof(j) * 8 - 8);
-                c &= mask;
-                c |= 0x80 & ~mask & ~((inp_len - j) >> (sizeof(j) * 8 - 8));
-                data->c[res++] = (unsigned char)c;
-
-                if (res != SHA_CBLOCK)
-                    continue;
-
-                /* j is not incremented yet */
-                mask = 0 - ((inp_len + 7 - j) >> (sizeof(j) * 8 - 1));
-                data->u[SHA_LBLOCK - 1] |= bitlen & mask;
-                sha1_block_data_order(&key->md, data, 1);
-                mask &= 0 - ((j - inp_len - 72) >> (sizeof(j) * 8 - 1));
-                pmac->u[0] |= key->md.h0 & mask;
-                pmac->u[1] |= key->md.h1 & mask;
-                pmac->u[2] |= key->md.h2 & mask;
-                pmac->u[3] |= key->md.h3 & mask;
-                pmac->u[4] |= key->md.h4 & mask;
-                res = 0;
-            }
-
-            for (i = res; i < SHA_CBLOCK; i++, j++)
-                data->c[i] = 0;
-
-            if (res > SHA_CBLOCK - 8) {
-                mask = 0 - ((inp_len + 8 - j) >> (sizeof(j) * 8 - 1));
-                data->u[SHA_LBLOCK - 1] |= bitlen & mask;
-                sha1_block_data_order(&key->md, data, 1);
-                mask &= 0 - ((j - inp_len - 73) >> (sizeof(j) * 8 - 1));
-                pmac->u[0] |= key->md.h0 & mask;
-                pmac->u[1] |= key->md.h1 & mask;
-                pmac->u[2] |= key->md.h2 & mask;
-                pmac->u[3] |= key->md.h3 & mask;
-                pmac->u[4] |= key->md.h4 & mask;
-
-                memset(data, 0, SHA_CBLOCK);
-                j += 64;
-            }
-            data->u[SHA_LBLOCK - 1] = bitlen;
-            sha1_block_data_order(&key->md, data, 1);
-            mask = 0 - ((j - inp_len - 73) >> (sizeof(j) * 8 - 1));
-            pmac->u[0] |= key->md.h0 & mask;
-            pmac->u[1] |= key->md.h1 & mask;
-            pmac->u[2] |= key->md.h2 & mask;
-            pmac->u[3] |= key->md.h3 & mask;
-            pmac->u[4] |= key->md.h4 & mask;
-
-#ifdef BSWAP4
-            pmac->u[0] = BSWAP4(pmac->u[0]);
-            pmac->u[1] = BSWAP4(pmac->u[1]);
-            pmac->u[2] = BSWAP4(pmac->u[2]);
-            pmac->u[3] = BSWAP4(pmac->u[3]);
-            pmac->u[4] = BSWAP4(pmac->u[4]);
-#else
-            for (i = 0; i < 5; i++) {
-                res = pmac->u[i];
-                pmac->c[4 * i + 0] = (unsigned char)(res >> 24);
-                pmac->c[4 * i + 1] = (unsigned char)(res >> 16);
-                pmac->c[4 * i + 2] = (unsigned char)(res >> 8);
-                pmac->c[4 * i + 3] = (unsigned char)res;
-            }
-#endif
-            len += SHA_DIGEST_LENGTH;
-#else /* pre-lucky-13 reference version of above */
-            SHA1_Update(&key->md, out, inp_len);
-            res = key->md.num;
-            SHA1_Final(pmac->c, &key->md);
-
-            {
-                unsigned int inp_blocks, pad_blocks;
-
-                /* but pretend as if we hashed padded payload */
-                inp_blocks = 1 + ((SHA_CBLOCK - 9 - res) >> (sizeof(res) * 8 - 1));
-                res += (unsigned int)(len - inp_len);
-                pad_blocks = res / SHA_CBLOCK;
-                res %= SHA_CBLOCK;
-                pad_blocks += 1 + ((SHA_CBLOCK - 9 - res) >> (sizeof(res) * 8 - 1));
-                for (; inp_blocks < pad_blocks; inp_blocks++)
-                    sha1_block_data_order(&key->md, data, 1);
-            }
-#endif
-            key->md = key->tail;
-            SHA1_Update(&key->md, pmac->c, SHA_DIGEST_LENGTH);
-            SHA1_Final(pmac->c, &key->md);
-
-            /* verify HMAC */
-            out += inp_len;
-            len -= inp_len;
-#if 1 /* see original reference version in #else */
-            {
-                unsigned char *p = out + len - 1 - maxpad - SHA_DIGEST_LENGTH;
-                size_t off = out - p;
-                unsigned int c, cmask;
-
-                for (res = 0, i = 0, j = 0; j < maxpad + SHA_DIGEST_LENGTH; j++) {
-                    c = p[j];
-                    cmask = ((int)(j - off - SHA_DIGEST_LENGTH)) >> (sizeof(int) * 8 - 1);
-                    res |= (c ^ pad) & ~cmask; /* ... and padding */
-                    cmask &= ((int)(off - 1 - j)) >> (sizeof(int) * 8 - 1);
-                    res |= (c ^ pmac->c[i]) & cmask;
-                    i += 1 & cmask;
-                }
-
-                res = 0 - ((0 - res) >> (sizeof(res) * 8 - 1));
-                ret &= (int)~res;
-            }
-#else /* pre-lucky-13 reference version of above */
-            for (res = 0, i = 0; i < SHA_DIGEST_LENGTH; i++)
-                res |= out[i] ^ pmac->c[i];
-            res = 0 - ((0 - res) >> (sizeof(res) * 8 - 1));
-            ret &= (int)~res;
-
-            /* verify padding */
-            pad = (pad & ~res) | (maxpad & res);
-            out = out + len - 1 - pad;
-            for (res = 0, i = 0; i < pad; i++)
-                res |= out[i] ^ pad;
-
-            res = (0 - res) >> (sizeof(res) * 8 - 1);
-            ret &= (int)~res;
-#endif
-            return ret;
-        } else {
-#if defined(STITCHED_DECRYPT_CALL)
-            if (len >= 1024 && keylen == 32) {
-                if (sha_off %= SHA_CBLOCK)
-                    blocks = (len - 3 * SHA_CBLOCK) / SHA_CBLOCK;
-                else
-                    blocks = (len - 2 * SHA_CBLOCK) / SHA_CBLOCK;
-                aes_off = len - blocks * SHA_CBLOCK;
-
-                aesni_cbc_encrypt(in, out, aes_off, &key->ks, ctx->iv, 0);
-                SHA1_Update(&key->md, out, sha_off);
-                aesni256_cbc_sha1_dec(in + aes_off,
-                    out + aes_off, blocks, &key->ks,
-                    ctx->iv, &key->md, out + sha_off);
-
-                sha_off += blocks *= SHA_CBLOCK;
-                out += sha_off;
-                len -= sha_off;
-
-                key->md.Nh += blocks >> 29;
-                key->md.Nl += blocks <<= 3;
-                if (key->md.Nl < (unsigned int)blocks)
-                    key->md.Nh++;
-            } else
-#endif
-                /* decrypt HMAC|padding at once */
-                aesni_cbc_encrypt(in, out, len, &key->ks,
-                    ctx->iv, 0);
-
-            SHA1_Update(&key->md, out, len);
-        }
-    }
-
-    return 1;
-}
-
-static int aesni_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
-    void *ptr)
-{
-    EVP_AES_HMAC_SHA1 *key = data(ctx);
-
-    switch (type) {
-    case EVP_CTRL_AEAD_SET_MAC_KEY: {
-        unsigned int i;
-        unsigned char hmac_key[64];
-
-        memset(hmac_key, 0, sizeof(hmac_key));
-
-        if (arg > (int)sizeof(hmac_key)) {
-            SHA1_Init(&key->head);
-            SHA1_Update(&key->head, ptr, arg);
-            SHA1_Final(hmac_key, &key->head);
-        } else {
-            memcpy(hmac_key, ptr, arg);
-        }
-
-        for (i = 0; i < sizeof(hmac_key); i++)
-            hmac_key[i] ^= 0x36; /* ipad */
-        SHA1_Init(&key->head);
-        SHA1_Update(&key->head, hmac_key, sizeof(hmac_key));
-
-        for (i = 0; i < sizeof(hmac_key); i++)
-            hmac_key[i] ^= 0x36 ^ 0x5c; /* opad */
-        SHA1_Init(&key->tail);
-        SHA1_Update(&key->tail, hmac_key, sizeof(hmac_key));
-
-        OPENSSL_cleanse(hmac_key, sizeof(hmac_key));
-
-        return 1;
-    }
-    case EVP_CTRL_AEAD_TLS1_AAD: {
-        unsigned char *p = ptr;
-        unsigned int len;
-
-        if (arg != EVP_AEAD_TLS1_AAD_LEN)
-            return -1;
-
-        len = p[arg - 2] << 8 | p[arg - 1];
-
-        if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            key->payload_length = len;
-            if ((key->aux.tls_ver = p[arg - 4] << 8 | p[arg - 3]) >= TLS1_1_VERSION) {
-                if (len < AES_BLOCK_SIZE)
-                    return 0;
-                len -= AES_BLOCK_SIZE;
-                p[arg - 2] = len >> 8;
-                p[arg - 1] = len;
-            }
-            key->md = key->head;
-            SHA1_Update(&key->md, p, arg);
-
-            return (int)(((len + SHA_DIGEST_LENGTH + AES_BLOCK_SIZE) & -AES_BLOCK_SIZE)
-                - len);
-        } else {
-            memcpy(key->aux.tls_aad, ptr, arg);
-            key->payload_length = arg;
-
-            return SHA_DIGEST_LENGTH;
-        }
-    }
-#if !defined(OPENSSL_NO_MULTIBLOCK)
-    case EVP_CTRL_TLS1_1_MULTIBLOCK_MAX_BUFSIZE:
-        return (int)(5 + 16 + ((arg + 20 + 16) & -16));
-    case EVP_CTRL_TLS1_1_MULTIBLOCK_AAD: {
-        EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM *param = (EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM *)ptr;
-        unsigned int n4x = 1, x4;
-        unsigned int frag, last, packlen, inp_len;
-
-        if (arg < (int)sizeof(EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM))
-            return -1;
-
-        inp_len = param->inp[11] << 8 | param->inp[12];
-
-        if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            if ((param->inp[9] << 8 | param->inp[10]) < TLS1_1_VERSION)
-                return -1;
-
-            if (inp_len) {
-                if (inp_len < 4096)
-                    return 0; /* too short */
-
-                if (inp_len >= 8192 && OPENSSL_ia32cap_P[2] & (1 << 5))
-                    n4x = 2; /* AVX2 */
-            } else if ((n4x = param->interleave / 4) && n4x <= 2)
-                inp_len = param->len;
-            else
-                return -1;
-
-            key->md = key->head;
-            SHA1_Update(&key->md, param->inp, 13);
-
-            x4 = 4 * n4x;
-            n4x += 1;
-
-            frag = inp_len >> n4x;
-            last = inp_len + frag - (frag << n4x);
-            if (last > frag && ((last + 13 + 9) % 64 < (x4 - 1))) {
-                frag++;
-                last -= x4 - 1;
-            }
-
-            packlen = 5 + 16 + ((frag + 20 + 16) & -16);
-            packlen = (packlen << n4x) - packlen;
-            packlen += 5 + 16 + ((last + 20 + 16) & -16);
-
-            param->interleave = x4;
-
-            return (int)packlen;
-        } else
-            return -1; /* not yet */
-    }
-    case EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT: {
-        EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM *param = (EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM *)ptr;
-
-        return (int)tls1_1_multi_block_encrypt(key, param->out,
-            param->inp, param->len,
-            param->interleave / 4);
-    }
-    case EVP_CTRL_TLS1_1_MULTIBLOCK_DECRYPT:
-#endif
-    default:
-        return -1;
-    }
-}
-
-static EVP_CIPHER aesni_128_cbc_hmac_sha1_cipher = {
+static const EVP_CIPHER aesni_128_cbc_hmac_sha1_cipher = {
 #ifdef NID_aes_128_cbc_hmac_sha1
     NID_aes_128_cbc_hmac_sha1,
 #else
@@ -903,18 +23,10 @@ static EVP_CIPHER aesni_128_cbc_hmac_sha1_cipher = {
 #endif
     AES_BLOCK_SIZE, 16, AES_BLOCK_SIZE,
     EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1 | EVP_CIPH_FLAG_AEAD_CIPHER | EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK,
-    EVP_ORIG_GLOBAL,
-    aesni_cbc_hmac_sha1_init_key,
-    aesni_cbc_hmac_sha1_cipher,
-    NULL,
-    sizeof(EVP_AES_HMAC_SHA1),
-    EVP_CIPH_FLAG_DEFAULT_ASN1 ? NULL : EVP_CIPHER_set_asn1_iv,
-    EVP_CIPH_FLAG_DEFAULT_ASN1 ? NULL : EVP_CIPHER_get_asn1_iv,
-    aesni_cbc_hmac_sha1_ctrl,
-    NULL
+    EVP_ORIG_GLOBAL
 };

-static EVP_CIPHER aesni_256_cbc_hmac_sha1_cipher = {
+static const EVP_CIPHER aesni_256_cbc_hmac_sha1_cipher = {
 #ifdef NID_aes_256_cbc_hmac_sha1
     NID_aes_256_cbc_hmac_sha1,
 #else
@@ -922,15 +34,7 @@ static EVP_CIPHER aesni_256_cbc_hmac_sha1_cipher = {
 #endif
     AES_BLOCK_SIZE, 32, AES_BLOCK_SIZE,
     EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1 | EVP_CIPH_FLAG_AEAD_CIPHER | EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK,
-    EVP_ORIG_GLOBAL,
-    aesni_cbc_hmac_sha1_init_key,
-    aesni_cbc_hmac_sha1_cipher,
-    NULL,
-    sizeof(EVP_AES_HMAC_SHA1),
-    EVP_CIPH_FLAG_DEFAULT_ASN1 ? NULL : EVP_CIPHER_set_asn1_iv,
-    EVP_CIPH_FLAG_DEFAULT_ASN1 ? NULL : EVP_CIPHER_get_asn1_iv,
-    aesni_cbc_hmac_sha1_ctrl,
-    NULL
+    EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void)
diff --git a/deps/openssl/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c b/deps/openssl/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c
index 8155164ca35..c2d2fbd3855 100644
--- a/deps/openssl/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c
+++ b/deps/openssl/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2013-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,864 +14,20 @@
  */
 #include "internal/deprecated.h"

-#include <stdio.h>
-#include <string.h>
-#include <openssl/opensslconf.h>
-#include <openssl/evp.h>
-#include <openssl/objects.h>
 #include <openssl/aes.h>
 #include <openssl/sha.h>
-#include <openssl/rand.h>
 #include "internal/cryptlib.h"
-#include "crypto/modes.h"
-#include "internal/constant_time.h"
 #include "crypto/evp.h"
-#include "evp_local.h"
-
-typedef struct {
-    AES_KEY ks;
-    SHA256_CTX head, tail, md;
-    size_t payload_length; /* AAD length in decrypt case */
-    union {
-        unsigned int tls_ver;
-        unsigned char tls_aad[16]; /* 13 used */
-    } aux;
-} EVP_AES_HMAC_SHA256;
-
-#define NO_PAYLOAD_LENGTH ((size_t)-1)

 #if defined(AES_ASM) && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))

 #define AESNI_CAPABLE (1 << (57 - 32))

-int aesni_set_encrypt_key(const unsigned char *userKey, int bits,
-    AES_KEY *key);
-int aesni_set_decrypt_key(const unsigned char *userKey, int bits,
-    AES_KEY *key);
-
-void aesni_cbc_encrypt(const unsigned char *in,
-    unsigned char *out,
-    size_t length,
-    const AES_KEY *key, unsigned char *ivec, int enc);
-
 int aesni_cbc_sha256_enc(const void *inp, void *out, size_t blocks,
     const AES_KEY *key, unsigned char iv[16],
     SHA256_CTX *ctx, const void *in0);

-#define data(ctx) ((EVP_AES_HMAC_SHA256 *)EVP_CIPHER_CTX_get_cipher_data(ctx))
-
-static int aesni_cbc_hmac_sha256_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *inkey,
-    const unsigned char *iv, int enc)
-{
-    EVP_AES_HMAC_SHA256 *key = data(ctx);
-    int ret;
-
-    if (enc)
-        ret = aesni_set_encrypt_key(inkey,
-            EVP_CIPHER_CTX_get_key_length(ctx) * 8,
-            &key->ks);
-    else
-        ret = aesni_set_decrypt_key(inkey,
-            EVP_CIPHER_CTX_get_key_length(ctx) * 8,
-            &key->ks);
-
-    SHA256_Init(&key->head); /* handy when benchmarking */
-    key->tail = key->head;
-    key->md = key->head;
-
-    key->payload_length = NO_PAYLOAD_LENGTH;
-
-    return ret < 0 ? 0 : 1;
-}
-
-#define STITCHED_CALL
-
-#if !defined(STITCHED_CALL)
-#define aes_off 0
-#endif
-
-void sha256_block_data_order(void *c, const void *p, size_t len);
-
-static void sha256_update(SHA256_CTX *c, const void *data, size_t len)
-{
-    const unsigned char *ptr = data;
-    size_t res;
-
-    if ((res = c->num)) {
-        res = SHA256_CBLOCK - res;
-        if (len < res)
-            res = len;
-        SHA256_Update(c, ptr, res);
-        ptr += res;
-        len -= res;
-    }
-
-    res = len % SHA256_CBLOCK;
-    len -= res;
-
-    if (len) {
-        sha256_block_data_order(c, ptr, len / SHA256_CBLOCK);
-
-        ptr += len;
-        c->Nh += len >> 29;
-        c->Nl += len <<= 3;
-        if (c->Nl < (unsigned int)len)
-            c->Nh++;
-    }
-
-    if (res)
-        SHA256_Update(c, ptr, res);
-}
-
-#ifdef SHA256_Update
-#undef SHA256_Update
-#endif
-#define SHA256_Update sha256_update
-
-#if !defined(OPENSSL_NO_MULTIBLOCK)
-
-typedef struct {
-    unsigned int A[8], B[8], C[8], D[8], E[8], F[8], G[8], H[8];
-} SHA256_MB_CTX;
-typedef struct {
-    const unsigned char *ptr;
-    int blocks;
-} HASH_DESC;
-
-void sha256_multi_block(SHA256_MB_CTX *, const HASH_DESC *, int);
-
-typedef struct {
-    const unsigned char *inp;
-    unsigned char *out;
-    int blocks;
-    u64 iv[2];
-} CIPH_DESC;
-
-void aesni_multi_cbc_encrypt(CIPH_DESC *, void *, int);
-
-static size_t tls1_1_multi_block_encrypt(EVP_AES_HMAC_SHA256 *key,
-    unsigned char *out,
-    const unsigned char *inp,
-    size_t inp_len, int n4x)
-{ /* n4x is 1 or 2 */
-    HASH_DESC hash_d[8], edges[8];
-    CIPH_DESC ciph_d[8];
-    unsigned char storage[sizeof(SHA256_MB_CTX) + 32];
-    union {
-        u64 q[16];
-        u32 d[32];
-        u8 c[128];
-    } blocks[8];
-    SHA256_MB_CTX *ctx;
-    unsigned int frag, last, packlen, i, x4 = 4 * n4x, minblocks, processed = 0;
-    size_t ret = 0;
-    u8 *IVs;
-#if defined(BSWAP8)
-    u64 seqnum;
-#endif
-
-    /* ask for IVs in bulk */
-    if (RAND_bytes((IVs = blocks[0].c), 16 * x4) <= 0)
-        return 0;
-
-    /* align */
-    ctx = (SHA256_MB_CTX *)(storage + 32 - ((size_t)storage % 32));
-
-    frag = (unsigned int)inp_len >> (1 + n4x);
-    last = (unsigned int)inp_len + frag - (frag << (1 + n4x));
-    if (last > frag && ((last + 13 + 9) % 64) < (x4 - 1)) {
-        frag++;
-        last -= x4 - 1;
-    }
-
-    packlen = 5 + 16 + ((frag + 32 + 16) & -16);
-
-    /* populate descriptors with pointers and IVs */
-    hash_d[0].ptr = inp;
-    ciph_d[0].inp = inp;
-    /* 5+16 is place for header and explicit IV */
-    ciph_d[0].out = out + 5 + 16;
-    memcpy(ciph_d[0].out - 16, IVs, 16);
-    memcpy(ciph_d[0].iv, IVs, 16);
-    IVs += 16;
-
-    for (i = 1; i < x4; i++) {
-        ciph_d[i].inp = hash_d[i].ptr = hash_d[i - 1].ptr + frag;
-        ciph_d[i].out = ciph_d[i - 1].out + packlen;
-        memcpy(ciph_d[i].out - 16, IVs, 16);
-        memcpy(ciph_d[i].iv, IVs, 16);
-        IVs += 16;
-    }
-
-#if defined(BSWAP8)
-    memcpy(blocks[0].c, key->md.data, 8);
-    seqnum = BSWAP8(blocks[0].q[0]);
-#endif
-    for (i = 0; i < x4; i++) {
-        unsigned int len = (i == (x4 - 1) ? last : frag);
-#if !defined(BSWAP8)
-        unsigned int carry, j;
-#endif
-
-        ctx->A[i] = key->md.h[0];
-        ctx->B[i] = key->md.h[1];
-        ctx->C[i] = key->md.h[2];
-        ctx->D[i] = key->md.h[3];
-        ctx->E[i] = key->md.h[4];
-        ctx->F[i] = key->md.h[5];
-        ctx->G[i] = key->md.h[6];
-        ctx->H[i] = key->md.h[7];
-
-        /* fix seqnum */
-#if defined(BSWAP8)
-        blocks[i].q[0] = BSWAP8(seqnum + i);
-#else
-        for (carry = i, j = 8; j--;) {
-            blocks[i].c[j] = ((u8 *)key->md.data)[j] + carry;
-            carry = (blocks[i].c[j] - carry) >> (sizeof(carry) * 8 - 1);
-        }
-#endif
-        blocks[i].c[8] = ((u8 *)key->md.data)[8];
-        blocks[i].c[9] = ((u8 *)key->md.data)[9];
-        blocks[i].c[10] = ((u8 *)key->md.data)[10];
-        /* fix length */
-        blocks[i].c[11] = (u8)(len >> 8);
-        blocks[i].c[12] = (u8)(len);
-
-        memcpy(blocks[i].c + 13, hash_d[i].ptr, 64 - 13);
-        hash_d[i].ptr += 64 - 13;
-        hash_d[i].blocks = (len - (64 - 13)) / 64;
-
-        edges[i].ptr = blocks[i].c;
-        edges[i].blocks = 1;
-    }
-
-    /* hash 13-byte headers and first 64-13 bytes of inputs */
-    sha256_multi_block(ctx, edges, n4x);
-    /* hash bulk inputs */
-#define MAXCHUNKSIZE 2048
-#if MAXCHUNKSIZE % 64
-#error "MAXCHUNKSIZE is not divisible by 64"
-#elif MAXCHUNKSIZE
-    /*
-     * goal is to minimize pressure on L1 cache by moving in shorter steps,
-     * so that hashed data is still in the cache by the time we encrypt it
-     */
-    minblocks = ((frag <= last ? frag : last) - (64 - 13)) / 64;
-    if (minblocks > MAXCHUNKSIZE / 64) {
-        for (i = 0; i < x4; i++) {
-            edges[i].ptr = hash_d[i].ptr;
-            edges[i].blocks = MAXCHUNKSIZE / 64;
-            ciph_d[i].blocks = MAXCHUNKSIZE / 16;
-        }
-        do {
-            sha256_multi_block(ctx, edges, n4x);
-            aesni_multi_cbc_encrypt(ciph_d, &key->ks, n4x);
-
-            for (i = 0; i < x4; i++) {
-                edges[i].ptr = hash_d[i].ptr += MAXCHUNKSIZE;
-                hash_d[i].blocks -= MAXCHUNKSIZE / 64;
-                edges[i].blocks = MAXCHUNKSIZE / 64;
-                ciph_d[i].inp += MAXCHUNKSIZE;
-                ciph_d[i].out += MAXCHUNKSIZE;
-                ciph_d[i].blocks = MAXCHUNKSIZE / 16;
-                memcpy(ciph_d[i].iv, ciph_d[i].out - 16, 16);
-            }
-            processed += MAXCHUNKSIZE;
-            minblocks -= MAXCHUNKSIZE / 64;
-        } while (minblocks > MAXCHUNKSIZE / 64);
-    }
-#endif
-#undef MAXCHUNKSIZE
-    sha256_multi_block(ctx, hash_d, n4x);
-
-    memset(blocks, 0, sizeof(blocks));
-    for (i = 0; i < x4; i++) {
-        unsigned int len = (i == (x4 - 1) ? last : frag),
-                     off = hash_d[i].blocks * 64;
-        const unsigned char *ptr = hash_d[i].ptr + off;
-
-        off = (len - processed) - (64 - 13) - off; /* remainder actually */
-        memcpy(blocks[i].c, ptr, off);
-        blocks[i].c[off] = 0x80;
-        len += 64 + 13; /* 64 is HMAC header */
-        len *= 8; /* convert to bits */
-        if (off < (64 - 8)) {
-#ifdef BSWAP4
-            blocks[i].d[15] = BSWAP4(len);
-#else
-            PUTU32(blocks[i].c + 60, len);
-#endif
-            edges[i].blocks = 1;
-        } else {
-#ifdef BSWAP4
-            blocks[i].d[31] = BSWAP4(len);
-#else
-            PUTU32(blocks[i].c + 124, len);
-#endif
-            edges[i].blocks = 2;
-        }
-        edges[i].ptr = blocks[i].c;
-    }
-
-    /* hash input tails and finalize */
-    sha256_multi_block(ctx, edges, n4x);
-
-    memset(blocks, 0, sizeof(blocks));
-    for (i = 0; i < x4; i++) {
-#ifdef BSWAP4
-        blocks[i].d[0] = BSWAP4(ctx->A[i]);
-        ctx->A[i] = key->tail.h[0];
-        blocks[i].d[1] = BSWAP4(ctx->B[i]);
-        ctx->B[i] = key->tail.h[1];
-        blocks[i].d[2] = BSWAP4(ctx->C[i]);
-        ctx->C[i] = key->tail.h[2];
-        blocks[i].d[3] = BSWAP4(ctx->D[i]);
-        ctx->D[i] = key->tail.h[3];
-        blocks[i].d[4] = BSWAP4(ctx->E[i]);
-        ctx->E[i] = key->tail.h[4];
-        blocks[i].d[5] = BSWAP4(ctx->F[i]);
-        ctx->F[i] = key->tail.h[5];
-        blocks[i].d[6] = BSWAP4(ctx->G[i]);
-        ctx->G[i] = key->tail.h[6];
-        blocks[i].d[7] = BSWAP4(ctx->H[i]);
-        ctx->H[i] = key->tail.h[7];
-        blocks[i].c[32] = 0x80;
-        blocks[i].d[15] = BSWAP4((64 + 32) * 8);
-#else
-        PUTU32(blocks[i].c + 0, ctx->A[i]);
-        ctx->A[i] = key->tail.h[0];
-        PUTU32(blocks[i].c + 4, ctx->B[i]);
-        ctx->B[i] = key->tail.h[1];
-        PUTU32(blocks[i].c + 8, ctx->C[i]);
-        ctx->C[i] = key->tail.h[2];
-        PUTU32(blocks[i].c + 12, ctx->D[i]);
-        ctx->D[i] = key->tail.h[3];
-        PUTU32(blocks[i].c + 16, ctx->E[i]);
-        ctx->E[i] = key->tail.h[4];
-        PUTU32(blocks[i].c + 20, ctx->F[i]);
-        ctx->F[i] = key->tail.h[5];
-        PUTU32(blocks[i].c + 24, ctx->G[i]);
-        ctx->G[i] = key->tail.h[6];
-        PUTU32(blocks[i].c + 28, ctx->H[i]);
-        ctx->H[i] = key->tail.h[7];
-        blocks[i].c[32] = 0x80;
-        PUTU32(blocks[i].c + 60, (64 + 32) * 8);
-#endif
-        edges[i].ptr = blocks[i].c;
-        edges[i].blocks = 1;
-    }
-
-    /* finalize MACs */
-    sha256_multi_block(ctx, edges, n4x);
-
-    for (i = 0; i < x4; i++) {
-        unsigned int len = (i == (x4 - 1) ? last : frag), pad, j;
-        unsigned char *out0 = out;
-
-        memcpy(ciph_d[i].out, ciph_d[i].inp, len - processed);
-        ciph_d[i].inp = ciph_d[i].out;
-
-        out += 5 + 16 + len;
-
-        /* write MAC */
-        PUTU32(out + 0, ctx->A[i]);
-        PUTU32(out + 4, ctx->B[i]);
-        PUTU32(out + 8, ctx->C[i]);
-        PUTU32(out + 12, ctx->D[i]);
-        PUTU32(out + 16, ctx->E[i]);
-        PUTU32(out + 20, ctx->F[i]);
-        PUTU32(out + 24, ctx->G[i]);
-        PUTU32(out + 28, ctx->H[i]);
-        out += 32;
-        len += 32;
-
-        /* pad */
-        pad = 15 - len % 16;
-        for (j = 0; j <= pad; j++)
-            *(out++) = pad;
-        len += pad + 1;
-
-        ciph_d[i].blocks = (len - processed) / 16;
-        len += 16; /* account for explicit iv */
-
-        /* arrange header */
-        out0[0] = ((u8 *)key->md.data)[8];
-        out0[1] = ((u8 *)key->md.data)[9];
-        out0[2] = ((u8 *)key->md.data)[10];
-        out0[3] = (u8)(len >> 8);
-        out0[4] = (u8)(len);
-
-        ret += len + 5;
-        inp += frag;
-    }
-
-    aesni_multi_cbc_encrypt(ciph_d, &key->ks, n4x);
-
-    OPENSSL_cleanse(blocks, sizeof(blocks));
-    OPENSSL_cleanse(ctx, sizeof(*ctx));
-
-    return ret;
-}
-#endif
-
-static int aesni_cbc_hmac_sha256_cipher(EVP_CIPHER_CTX *ctx,
-    unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_AES_HMAC_SHA256 *key = data(ctx);
-    unsigned int l;
-    size_t plen = key->payload_length, iv = 0, /* explicit IV in TLS 1.1 and
-                                                * later */
-        sha_off = 0;
-#if defined(STITCHED_CALL)
-    size_t aes_off = 0, blocks;
-
-    sha_off = SHA256_CBLOCK - key->md.num;
-#endif
-
-    key->payload_length = NO_PAYLOAD_LENGTH;
-
-    if (len % AES_BLOCK_SIZE)
-        return 0;
-
-    if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-        if (plen == NO_PAYLOAD_LENGTH)
-            plen = len;
-        else if (len != ((plen + SHA256_DIGEST_LENGTH + AES_BLOCK_SIZE) & -AES_BLOCK_SIZE))
-            return 0;
-        else if (key->aux.tls_ver >= TLS1_1_VERSION)
-            iv = AES_BLOCK_SIZE;
-
-#if defined(STITCHED_CALL)
-        /*
-         * Assembly stitch handles AVX-capable processors, but its
-         * performance is not optimal on AMD Jaguar, ~40% worse, for
-         * unknown reasons. Incidentally processor in question supports
-         * AVX, but not AMD-specific XOP extension, which can be used
-         * to identify it and avoid stitch invocation. So that after we
-         * establish that current CPU supports AVX, we even see if it's
-         * either even XOP-capable Bulldozer-based or GenuineIntel one.
-         * But SHAEXT-capable go ahead...
-         */
-        if (((OPENSSL_ia32cap_P[2] & (1 << 29)) || /* SHAEXT? */
-                ((OPENSSL_ia32cap_P[1] & (1 << (60 - 32))) && /* AVX? */
-                    ((OPENSSL_ia32cap_P[1] & (1 << (43 - 32))) /* XOP? */
-                        | (OPENSSL_ia32cap_P[0] & (1 << 30)))))
-            && /* "Intel CPU"? */
-            plen > (sha_off + iv) && (blocks = (plen - (sha_off + iv)) / SHA256_CBLOCK)) {
-            SHA256_Update(&key->md, in + iv, sha_off);
-
-            (void)aesni_cbc_sha256_enc(in, out, blocks, &key->ks,
-                ctx->iv, &key->md, in + iv + sha_off);
-            blocks *= SHA256_CBLOCK;
-            aes_off += blocks;
-            sha_off += blocks;
-            key->md.Nh += blocks >> 29;
-            key->md.Nl += blocks <<= 3;
-            if (key->md.Nl < (unsigned int)blocks)
-                key->md.Nh++;
-        } else {
-            sha_off = 0;
-        }
-#endif
-        sha_off += iv;
-        SHA256_Update(&key->md, in + sha_off, plen - sha_off);
-
-        if (plen != len) { /* "TLS" mode of operation */
-            if (in != out)
-                memcpy(out + aes_off, in + aes_off, plen - aes_off);
-
-            /* calculate HMAC and append it to payload */
-            SHA256_Final(out + plen, &key->md);
-            key->md = key->tail;
-            SHA256_Update(&key->md, out + plen, SHA256_DIGEST_LENGTH);
-            SHA256_Final(out + plen, &key->md);
-
-            /* pad the payload|hmac */
-            plen += SHA256_DIGEST_LENGTH;
-            for (l = len - plen - 1; plen < len; plen++)
-                out[plen] = l;
-            /* encrypt HMAC|padding at once */
-            aesni_cbc_encrypt(out + aes_off, out + aes_off, len - aes_off,
-                &key->ks, ctx->iv, 1);
-        } else {
-            aesni_cbc_encrypt(in + aes_off, out + aes_off, len - aes_off,
-                &key->ks, ctx->iv, 1);
-        }
-    } else {
-        union {
-            unsigned int u[SHA256_DIGEST_LENGTH / sizeof(unsigned int)];
-            unsigned char c[64 + SHA256_DIGEST_LENGTH];
-        } mac, *pmac;
-
-        /* arrange cache line alignment */
-        pmac = (void *)(((size_t)mac.c + 63) & ((size_t)0 - 64));
-
-        /* decrypt HMAC|padding at once */
-        aesni_cbc_encrypt(in, out, len, &key->ks,
-            ctx->iv, 0);
-
-        if (plen != NO_PAYLOAD_LENGTH) { /* "TLS" mode of operation */
-            size_t inp_len, mask, j, i;
-            unsigned int res, maxpad, pad, bitlen;
-            int ret = 1;
-            union {
-                unsigned int u[SHA_LBLOCK];
-                unsigned char c[SHA256_CBLOCK];
-            } *data = (void *)key->md.data;
-
-            if ((key->aux.tls_aad[plen - 4] << 8 | key->aux.tls_aad[plen - 3])
-                >= TLS1_1_VERSION)
-                iv = AES_BLOCK_SIZE;
-
-            if (len < (iv + SHA256_DIGEST_LENGTH + 1))
-                return 0;
-
-            /* omit explicit iv */
-            out += iv;
-            len -= iv;
-
-            /* figure out payload length */
-            pad = out[len - 1];
-            maxpad = len - (SHA256_DIGEST_LENGTH + 1);
-            maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8);
-            maxpad &= 255;
-
-            mask = constant_time_ge(maxpad, pad);
-            ret &= mask;
-            /*
-             * If pad is invalid then we will fail the above test but we must
-             * continue anyway because we are in constant time code. However,
-             * we'll use the maxpad value instead of the supplied pad to make
-             * sure we perform well defined pointer arithmetic.
-             */
-            pad = constant_time_select(mask, pad, maxpad);
-
-            inp_len = len - (SHA256_DIGEST_LENGTH + pad + 1);
-
-            key->aux.tls_aad[plen - 2] = inp_len >> 8;
-            key->aux.tls_aad[plen - 1] = inp_len;
-
-            /* calculate HMAC */
-            key->md = key->head;
-            SHA256_Update(&key->md, key->aux.tls_aad, plen);
-
-#if 1 /* see original reference version in #else */
-            len -= SHA256_DIGEST_LENGTH; /* amend mac */
-            if (len >= (256 + SHA256_CBLOCK)) {
-                j = (len - (256 + SHA256_CBLOCK)) & (0 - SHA256_CBLOCK);
-                j += SHA256_CBLOCK - key->md.num;
-                SHA256_Update(&key->md, out, j);
-                out += j;
-                len -= j;
-                inp_len -= j;
-            }
-
-            /* but pretend as if we hashed padded payload */
-            bitlen = key->md.Nl + (inp_len << 3); /* at most 18 bits */
-#ifdef BSWAP4
-            bitlen = BSWAP4(bitlen);
-#else
-            mac.c[0] = 0;
-            mac.c[1] = (unsigned char)(bitlen >> 16);
-            mac.c[2] = (unsigned char)(bitlen >> 8);
-            mac.c[3] = (unsigned char)bitlen;
-            bitlen = mac.u[0];
-#endif
-
-            pmac->u[0] = 0;
-            pmac->u[1] = 0;
-            pmac->u[2] = 0;
-            pmac->u[3] = 0;
-            pmac->u[4] = 0;
-            pmac->u[5] = 0;
-            pmac->u[6] = 0;
-            pmac->u[7] = 0;
-
-            for (res = key->md.num, j = 0; j < len; j++) {
-                size_t c = out[j];
-                mask = (j - inp_len) >> (sizeof(j) * 8 - 8);
-                c &= mask;
-                c |= 0x80 & ~mask & ~((inp_len - j) >> (sizeof(j) * 8 - 8));
-                data->c[res++] = (unsigned char)c;
-
-                if (res != SHA256_CBLOCK)
-                    continue;
-
-                /* j is not incremented yet */
-                mask = 0 - ((inp_len + 7 - j) >> (sizeof(j) * 8 - 1));
-                data->u[SHA_LBLOCK - 1] |= bitlen & mask;
-                sha256_block_data_order(&key->md, data, 1);
-                mask &= 0 - ((j - inp_len - 72) >> (sizeof(j) * 8 - 1));
-                pmac->u[0] |= key->md.h[0] & mask;
-                pmac->u[1] |= key->md.h[1] & mask;
-                pmac->u[2] |= key->md.h[2] & mask;
-                pmac->u[3] |= key->md.h[3] & mask;
-                pmac->u[4] |= key->md.h[4] & mask;
-                pmac->u[5] |= key->md.h[5] & mask;
-                pmac->u[6] |= key->md.h[6] & mask;
-                pmac->u[7] |= key->md.h[7] & mask;
-                res = 0;
-            }
-
-            for (i = res; i < SHA256_CBLOCK; i++, j++)
-                data->c[i] = 0;
-
-            if (res > SHA256_CBLOCK - 8) {
-                mask = 0 - ((inp_len + 8 - j) >> (sizeof(j) * 8 - 1));
-                data->u[SHA_LBLOCK - 1] |= bitlen & mask;
-                sha256_block_data_order(&key->md, data, 1);
-                mask &= 0 - ((j - inp_len - 73) >> (sizeof(j) * 8 - 1));
-                pmac->u[0] |= key->md.h[0] & mask;
-                pmac->u[1] |= key->md.h[1] & mask;
-                pmac->u[2] |= key->md.h[2] & mask;
-                pmac->u[3] |= key->md.h[3] & mask;
-                pmac->u[4] |= key->md.h[4] & mask;
-                pmac->u[5] |= key->md.h[5] & mask;
-                pmac->u[6] |= key->md.h[6] & mask;
-                pmac->u[7] |= key->md.h[7] & mask;
-
-                memset(data, 0, SHA256_CBLOCK);
-                j += 64;
-            }
-            data->u[SHA_LBLOCK - 1] = bitlen;
-            sha256_block_data_order(&key->md, data, 1);
-            mask = 0 - ((j - inp_len - 73) >> (sizeof(j) * 8 - 1));
-            pmac->u[0] |= key->md.h[0] & mask;
-            pmac->u[1] |= key->md.h[1] & mask;
-            pmac->u[2] |= key->md.h[2] & mask;
-            pmac->u[3] |= key->md.h[3] & mask;
-            pmac->u[4] |= key->md.h[4] & mask;
-            pmac->u[5] |= key->md.h[5] & mask;
-            pmac->u[6] |= key->md.h[6] & mask;
-            pmac->u[7] |= key->md.h[7] & mask;
-
-#ifdef BSWAP4
-            pmac->u[0] = BSWAP4(pmac->u[0]);
-            pmac->u[1] = BSWAP4(pmac->u[1]);
-            pmac->u[2] = BSWAP4(pmac->u[2]);
-            pmac->u[3] = BSWAP4(pmac->u[3]);
-            pmac->u[4] = BSWAP4(pmac->u[4]);
-            pmac->u[5] = BSWAP4(pmac->u[5]);
-            pmac->u[6] = BSWAP4(pmac->u[6]);
-            pmac->u[7] = BSWAP4(pmac->u[7]);
-#else
-            for (i = 0; i < 8; i++) {
-                res = pmac->u[i];
-                pmac->c[4 * i + 0] = (unsigned char)(res >> 24);
-                pmac->c[4 * i + 1] = (unsigned char)(res >> 16);
-                pmac->c[4 * i + 2] = (unsigned char)(res >> 8);
-                pmac->c[4 * i + 3] = (unsigned char)res;
-            }
-#endif
-            len += SHA256_DIGEST_LENGTH;
-#else
-            SHA256_Update(&key->md, out, inp_len);
-            res = key->md.num;
-            SHA256_Final(pmac->c, &key->md);
-
-            {
-                unsigned int inp_blocks, pad_blocks;
-
-                /* but pretend as if we hashed padded payload */
-                inp_blocks = 1 + ((SHA256_CBLOCK - 9 - res) >> (sizeof(res) * 8 - 1));
-                res += (unsigned int)(len - inp_len);
-                pad_blocks = res / SHA256_CBLOCK;
-                res %= SHA256_CBLOCK;
-                pad_blocks += 1 + ((SHA256_CBLOCK - 9 - res) >> (sizeof(res) * 8 - 1));
-                for (; inp_blocks < pad_blocks; inp_blocks++)
-                    sha1_block_data_order(&key->md, data, 1);
-            }
-#endif /* pre-lucky-13 reference version of above */
-            key->md = key->tail;
-            SHA256_Update(&key->md, pmac->c, SHA256_DIGEST_LENGTH);
-            SHA256_Final(pmac->c, &key->md);
-
-            /* verify HMAC */
-            out += inp_len;
-            len -= inp_len;
-#if 1 /* see original reference version in #else */
-            {
-                unsigned char *p = out + len - 1 - maxpad - SHA256_DIGEST_LENGTH;
-                size_t off = out - p;
-                unsigned int c, cmask;
-
-                for (res = 0, i = 0, j = 0; j < maxpad + SHA256_DIGEST_LENGTH;
-                    j++) {
-                    c = p[j];
-                    cmask = ((int)(j - off - SHA256_DIGEST_LENGTH)) >> (sizeof(int) * 8 - 1);
-                    res |= (c ^ pad) & ~cmask; /* ... and padding */
-                    cmask &= ((int)(off - 1 - j)) >> (sizeof(int) * 8 - 1);
-                    res |= (c ^ pmac->c[i]) & cmask;
-                    i += 1 & cmask;
-                }
-
-                res = 0 - ((0 - res) >> (sizeof(res) * 8 - 1));
-                ret &= (int)~res;
-            }
-#else /* pre-lucky-13 reference version of above */
-            for (res = 0, i = 0; i < SHA256_DIGEST_LENGTH; i++)
-                res |= out[i] ^ pmac->c[i];
-            res = 0 - ((0 - res) >> (sizeof(res) * 8 - 1));
-            ret &= (int)~res;
-
-            /* verify padding */
-            pad = (pad & ~res) | (maxpad & res);
-            out = out + len - 1 - pad;
-            for (res = 0, i = 0; i < pad; i++)
-                res |= out[i] ^ pad;
-
-            res = (0 - res) >> (sizeof(res) * 8 - 1);
-            ret &= (int)~res;
-#endif
-            return ret;
-        } else {
-            SHA256_Update(&key->md, out, len);
-        }
-    }
-
-    return 1;
-}
-
-static int aesni_cbc_hmac_sha256_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
-    void *ptr)
-{
-    EVP_AES_HMAC_SHA256 *key = data(ctx);
-    unsigned int u_arg = (unsigned int)arg;
-
-    switch (type) {
-    case EVP_CTRL_AEAD_SET_MAC_KEY: {
-        unsigned int i;
-        unsigned char hmac_key[64];
-
-        memset(hmac_key, 0, sizeof(hmac_key));
-
-        if (arg < 0)
-            return -1;
-
-        if (u_arg > sizeof(hmac_key)) {
-            SHA256_Init(&key->head);
-            SHA256_Update(&key->head, ptr, arg);
-            SHA256_Final(hmac_key, &key->head);
-        } else {
-            memcpy(hmac_key, ptr, arg);
-        }
-
-        for (i = 0; i < sizeof(hmac_key); i++)
-            hmac_key[i] ^= 0x36; /* ipad */
-        SHA256_Init(&key->head);
-        SHA256_Update(&key->head, hmac_key, sizeof(hmac_key));
-
-        for (i = 0; i < sizeof(hmac_key); i++)
-            hmac_key[i] ^= 0x36 ^ 0x5c; /* opad */
-        SHA256_Init(&key->tail);
-        SHA256_Update(&key->tail, hmac_key, sizeof(hmac_key));
-
-        OPENSSL_cleanse(hmac_key, sizeof(hmac_key));
-
-        return 1;
-    }
-    case EVP_CTRL_AEAD_TLS1_AAD: {
-        unsigned char *p = ptr;
-        unsigned int len;
-
-        if (arg != EVP_AEAD_TLS1_AAD_LEN)
-            return -1;
-
-        len = p[arg - 2] << 8 | p[arg - 1];
-
-        if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            key->payload_length = len;
-            if ((key->aux.tls_ver = p[arg - 4] << 8 | p[arg - 3]) >= TLS1_1_VERSION) {
-                if (len < AES_BLOCK_SIZE)
-                    return 0;
-                len -= AES_BLOCK_SIZE;
-                p[arg - 2] = len >> 8;
-                p[arg - 1] = len;
-            }
-            key->md = key->head;
-            SHA256_Update(&key->md, p, arg);
-
-            return (int)(((len + SHA256_DIGEST_LENGTH + AES_BLOCK_SIZE) & -AES_BLOCK_SIZE)
-                - len);
-        } else {
-            memcpy(key->aux.tls_aad, ptr, arg);
-            key->payload_length = arg;
-
-            return SHA256_DIGEST_LENGTH;
-        }
-    }
-#if !defined(OPENSSL_NO_MULTIBLOCK)
-    case EVP_CTRL_TLS1_1_MULTIBLOCK_MAX_BUFSIZE:
-        return (int)(5 + 16 + ((arg + 32 + 16) & -16));
-    case EVP_CTRL_TLS1_1_MULTIBLOCK_AAD: {
-        EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM *param = (EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM *)ptr;
-        unsigned int n4x = 1, x4;
-        unsigned int frag, last, packlen, inp_len;
-
-        if (arg < 0)
-            return -1;
-
-        if (u_arg < sizeof(EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM))
-            return -1;
-
-        inp_len = param->inp[11] << 8 | param->inp[12];
-
-        if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            if ((param->inp[9] << 8 | param->inp[10]) < TLS1_1_VERSION)
-                return -1;
-
-            if (inp_len) {
-                if (inp_len < 4096)
-                    return 0; /* too short */
-
-                if (inp_len >= 8192 && OPENSSL_ia32cap_P[2] & (1 << 5))
-                    n4x = 2; /* AVX2 */
-            } else if ((n4x = param->interleave / 4) && n4x <= 2)
-                inp_len = param->len;
-            else
-                return -1;
-
-            key->md = key->head;
-            SHA256_Update(&key->md, param->inp, 13);
-
-            x4 = 4 * n4x;
-            n4x += 1;
-
-            frag = inp_len >> n4x;
-            last = inp_len + frag - (frag << n4x);
-            if (last > frag && ((last + 13 + 9) % 64 < (x4 - 1))) {
-                frag++;
-                last -= x4 - 1;
-            }
-
-            packlen = 5 + 16 + ((frag + 32 + 16) & -16);
-            packlen = (packlen << n4x) - packlen;
-            packlen += 5 + 16 + ((last + 32 + 16) & -16);
-
-            param->interleave = x4;
-
-            return (int)packlen;
-        } else
-            return -1; /* not yet */
-    }
-    case EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT: {
-        EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM *param = (EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM *)ptr;
-
-        return (int)tls1_1_multi_block_encrypt(key, param->out,
-            param->inp, param->len,
-            param->interleave / 4);
-    }
-    case EVP_CTRL_TLS1_1_MULTIBLOCK_DECRYPT:
-#endif
-    default:
-        return -1;
-    }
-}
-
-static EVP_CIPHER aesni_128_cbc_hmac_sha256_cipher = {
+static const EVP_CIPHER aesni_128_cbc_hmac_sha256_cipher = {
 #ifdef NID_aes_128_cbc_hmac_sha256
     NID_aes_128_cbc_hmac_sha256,
 #else
@@ -879,18 +35,10 @@ static EVP_CIPHER aesni_128_cbc_hmac_sha256_cipher = {
 #endif
     AES_BLOCK_SIZE, 16, AES_BLOCK_SIZE,
     EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1 | EVP_CIPH_FLAG_AEAD_CIPHER | EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK,
-    EVP_ORIG_GLOBAL,
-    aesni_cbc_hmac_sha256_init_key,
-    aesni_cbc_hmac_sha256_cipher,
-    NULL,
-    sizeof(EVP_AES_HMAC_SHA256),
-    EVP_CIPH_FLAG_DEFAULT_ASN1 ? NULL : EVP_CIPHER_set_asn1_iv,
-    EVP_CIPH_FLAG_DEFAULT_ASN1 ? NULL : EVP_CIPHER_get_asn1_iv,
-    aesni_cbc_hmac_sha256_ctrl,
-    NULL
+    EVP_ORIG_GLOBAL
 };

-static EVP_CIPHER aesni_256_cbc_hmac_sha256_cipher = {
+static const EVP_CIPHER aesni_256_cbc_hmac_sha256_cipher = {
 #ifdef NID_aes_256_cbc_hmac_sha256
     NID_aes_256_cbc_hmac_sha256,
 #else
@@ -898,15 +46,7 @@ static EVP_CIPHER aesni_256_cbc_hmac_sha256_cipher = {
 #endif
     AES_BLOCK_SIZE, 32, AES_BLOCK_SIZE,
     EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1 | EVP_CIPH_FLAG_AEAD_CIPHER | EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK,
-    EVP_ORIG_GLOBAL,
-    aesni_cbc_hmac_sha256_init_key,
-    aesni_cbc_hmac_sha256_cipher,
-    NULL,
-    sizeof(EVP_AES_HMAC_SHA256),
-    EVP_CIPH_FLAG_DEFAULT_ASN1 ? NULL : EVP_CIPHER_set_asn1_iv,
-    EVP_CIPH_FLAG_DEFAULT_ASN1 ? NULL : EVP_CIPHER_get_asn1_iv,
-    aesni_cbc_hmac_sha256_ctrl,
-    NULL
+    EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha256(void)
diff --git a/deps/openssl/openssl/crypto/evp/e_aria.c b/deps/openssl/openssl/crypto/evp/e_aria.c
index e35e3f5083a..4570e1823d3 100644
--- a/deps/openssl/openssl/crypto/evp/e_aria.c
+++ b/deps/openssl/openssl/crypto/evp/e_aria.c
@@ -8,147 +8,20 @@
  * https://www.openssl.org/source/license.html
  */

-#include "internal/deprecated.h"
+#include <openssl/macros.h>

-#include "internal/cryptlib.h"
 #ifndef OPENSSL_NO_ARIA
-#include <openssl/evp.h>
-#include <openssl/modes.h>
-#include <openssl/rand.h>
-#include "crypto/aria.h"
 #include "crypto/evp.h"
-#include "crypto/modes.h"
-#include "evp_local.h"
-
-/* ARIA subkey Structure */
-typedef struct {
-    ARIA_KEY ks;
-} EVP_ARIA_KEY;
-
-/* ARIA GCM context */
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        ARIA_KEY ks;
-    } ks; /* ARIA subkey to use */
-    int key_set; /* Set if key initialised */
-    int iv_set; /* Set if an iv is set */
-    GCM128_CONTEXT gcm;
-    unsigned char *iv; /* Temporary IV store */
-    int ivlen; /* IV length */
-    int taglen;
-    int iv_gen; /* It is OK to generate IVs */
-    int tls_aad_len; /* TLS AAD length */
-} EVP_ARIA_GCM_CTX;
-
-/* ARIA CCM context */
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        ARIA_KEY ks;
-    } ks; /* ARIA key schedule to use */
-    int key_set; /* Set if key initialised */
-    int iv_set; /* Set if an iv is set */
-    int tag_set; /* Set if tag is valid */
-    int len_set; /* Set if message length set */
-    int L, M; /* L and M parameters from RFC3610 */
-    int tls_aad_len; /* TLS AAD length */
-    CCM128_CONTEXT ccm;
-    ccm128_f str;
-} EVP_ARIA_CCM_CTX;
-
-/* The subkey for ARIA is generated. */
-static int aria_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    int ret;
-    int mode = EVP_CIPHER_CTX_get_mode(ctx);
-
-    if (enc || (mode != EVP_CIPH_ECB_MODE && mode != EVP_CIPH_CBC_MODE))
-        ret = ossl_aria_set_encrypt_key(key,
-            EVP_CIPHER_CTX_get_key_length(ctx) * 8,
-            EVP_CIPHER_CTX_get_cipher_data(ctx));
-    else
-        ret = ossl_aria_set_decrypt_key(key,
-            EVP_CIPHER_CTX_get_key_length(ctx) * 8,
-            EVP_CIPHER_CTX_get_cipher_data(ctx));
-    if (ret < 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED);
-        return 0;
-    }
-    return 1;
-}
-
-static void aria_cbc_encrypt(const unsigned char *in, unsigned char *out,
-    size_t len, const ARIA_KEY *key,
-    unsigned char *ivec, const int enc)
-{
-
-    if (enc)
-        CRYPTO_cbc128_encrypt(in, out, len, key, ivec,
-            (block128_f)ossl_aria_encrypt);
-    else
-        CRYPTO_cbc128_decrypt(in, out, len, key, ivec,
-            (block128_f)ossl_aria_encrypt);
-}
-
-static void aria_cfb128_encrypt(const unsigned char *in, unsigned char *out,
-    size_t length, const ARIA_KEY *key,
-    unsigned char *ivec, int *num, const int enc)
-{
-
-    CRYPTO_cfb128_encrypt(in, out, length, key, ivec, num, enc,
-        (block128_f)ossl_aria_encrypt);
-}
-
-static void aria_cfb1_encrypt(const unsigned char *in, unsigned char *out,
-    size_t length, const ARIA_KEY *key,
-    unsigned char *ivec, int *num, const int enc)
-{
-    CRYPTO_cfb128_1_encrypt(in, out, length, key, ivec, num, enc,
-        (block128_f)ossl_aria_encrypt);
-}
-
-static void aria_cfb8_encrypt(const unsigned char *in, unsigned char *out,
-    size_t length, const ARIA_KEY *key,
-    unsigned char *ivec, int *num, const int enc)
-{
-    CRYPTO_cfb128_8_encrypt(in, out, length, key, ivec, num, enc,
-        (block128_f)ossl_aria_encrypt);
-}
-
-static void aria_ecb_encrypt(const unsigned char *in, unsigned char *out,
-    const ARIA_KEY *key, const int enc)
-{
-    ossl_aria_encrypt(in, out, key);
-}
-
-static void aria_ofb128_encrypt(const unsigned char *in, unsigned char *out,
-    size_t length, const ARIA_KEY *key,
-    unsigned char *ivec, int *num)
-{
-    CRYPTO_ofb128_encrypt(in, out, length, key, ivec, num,
-        (block128_f)ossl_aria_encrypt);
-}

 IMPLEMENT_BLOCK_CIPHER(aria_128, ks, aria, EVP_ARIA_KEY,
     NID_aria_128, 16, 16, 16, 128,
-    0, aria_init_key, NULL,
-    EVP_CIPHER_set_asn1_iv,
-    EVP_CIPHER_get_asn1_iv,
-    NULL)
+    0)
 IMPLEMENT_BLOCK_CIPHER(aria_192, ks, aria, EVP_ARIA_KEY,
     NID_aria_192, 16, 24, 16, 128,
-    0, aria_init_key, NULL,
-    EVP_CIPHER_set_asn1_iv,
-    EVP_CIPHER_get_asn1_iv,
-    NULL)
+    0)
 IMPLEMENT_BLOCK_CIPHER(aria_256, ks, aria, EVP_ARIA_KEY,
     NID_aria_256, 16, 32, 16, 128,
-    0, aria_init_key, NULL,
-    EVP_CIPHER_set_asn1_iv,
-    EVP_CIPHER_get_asn1_iv,
-    NULL)
+    0)

 #define IMPLEMENT_ARIA_CFBR(ksize, cbits) \
     IMPLEMENT_CFBR(aria, aria, EVP_ARIA_KEY, ks, ksize, cbits, 16, 0)
@@ -163,597 +36,17 @@ IMPLEMENT_ARIA_CFBR(256, 8)
     static const EVP_CIPHER aria_##keylen##_##mode = {                                \
         nid##_##keylen##_##nmode, blocksize, keylen / 8, ivlen,                       \
         flags | EVP_CIPH_##MODE##_MODE,                                               \
-        EVP_ORIG_GLOBAL,                                                              \
-        aria_init_key,                                                                \
-        aria_##mode##_cipher,                                                         \
-        NULL,                                                                         \
-        sizeof(EVP_ARIA_KEY),                                                         \
-        NULL, NULL, NULL, NULL                                                        \
+        EVP_ORIG_GLOBAL                                                               \
     };                                                                                \
     const EVP_CIPHER *EVP_aria_##keylen##_##mode(void)                                \
     {                                                                                 \
         return &aria_##keylen##_##mode;                                               \
     }

-static int aria_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    int n = EVP_CIPHER_CTX_get_num(ctx);
-    unsigned int num;
-    EVP_ARIA_KEY *dat = EVP_C_DATA(EVP_ARIA_KEY, ctx);
-
-    if (n < 0)
-        return 0;
-    num = (unsigned int)n;
-
-    CRYPTO_ctr128_encrypt(in, out, len, &dat->ks, ctx->iv,
-        EVP_CIPHER_CTX_buf_noconst(ctx), &num,
-        (block128_f)ossl_aria_encrypt);
-    EVP_CIPHER_CTX_set_num(ctx, num);
-    return 1;
-}
-
 BLOCK_CIPHER_generic(NID_aria, 128, 1, 16, ctr, ctr, CTR, 0)
 BLOCK_CIPHER_generic(NID_aria, 192, 1, 16, ctr, ctr, CTR, 0)
 BLOCK_CIPHER_generic(NID_aria, 256, 1, 16, ctr, ctr, CTR, 0)

-/* Authenticated cipher modes (GCM/CCM) */
-
-/* increment counter (64-bit int) by 1 */
-static void ctr64_inc(unsigned char *counter)
-{
-    int n = 8;
-    unsigned char c;
-
-    do {
-        --n;
-        c = counter[n];
-        ++c;
-        counter[n] = c;
-        if (c)
-            return;
-    } while (n);
-}
-
-static int aria_gcm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    int ret;
-    EVP_ARIA_GCM_CTX *gctx = EVP_C_DATA(EVP_ARIA_GCM_CTX, ctx);
-
-    if (!iv && !key)
-        return 1;
-    if (key) {
-        ret = ossl_aria_set_encrypt_key(key,
-            EVP_CIPHER_CTX_get_key_length(ctx) * 8,
-            &gctx->ks.ks);
-        CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks,
-            (block128_f)ossl_aria_encrypt);
-        if (ret < 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED);
-            return 0;
-        }
-
-        /*
-         * If we have an iv can set it directly, otherwise use saved IV.
-         */
-        if (iv == NULL && gctx->iv_set)
-            iv = gctx->iv;
-        if (iv) {
-            CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen);
-            gctx->iv_set = 1;
-        }
-        gctx->key_set = 1;
-    } else {
-        /* If key set use IV, otherwise copy */
-        if (gctx->key_set)
-            CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen);
-        else
-            memcpy(gctx->iv, iv, gctx->ivlen);
-        gctx->iv_set = 1;
-        gctx->iv_gen = 0;
-    }
-    return 1;
-}
-
-static int aria_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
-{
-    EVP_ARIA_GCM_CTX *gctx = EVP_C_DATA(EVP_ARIA_GCM_CTX, c);
-
-    switch (type) {
-    case EVP_CTRL_INIT:
-        gctx->key_set = 0;
-        gctx->iv_set = 0;
-        gctx->ivlen = EVP_CIPHER_get_iv_length(c->cipher);
-        gctx->iv = c->iv;
-        gctx->taglen = -1;
-        gctx->iv_gen = 0;
-        gctx->tls_aad_len = -1;
-        return 1;
-
-    case EVP_CTRL_GET_IVLEN:
-        *(int *)ptr = gctx->ivlen;
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_IVLEN:
-        if (arg <= 0)
-            return 0;
-        /* Allocate memory for IV if needed */
-        if ((arg > EVP_MAX_IV_LENGTH) && (arg > gctx->ivlen)) {
-            if (gctx->iv != c->iv)
-                OPENSSL_free(gctx->iv);
-            if ((gctx->iv = OPENSSL_malloc(arg)) == NULL)
-                return 0;
-        }
-        gctx->ivlen = arg;
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_TAG:
-        if (arg <= 0 || arg > 16 || EVP_CIPHER_CTX_is_encrypting(c))
-            return 0;
-        memcpy(EVP_CIPHER_CTX_buf_noconst(c), ptr, arg);
-        gctx->taglen = arg;
-        return 1;
-
-    case EVP_CTRL_AEAD_GET_TAG:
-        if (arg <= 0 || arg > 16 || !EVP_CIPHER_CTX_is_encrypting(c)
-            || gctx->taglen < 0)
-            return 0;
-        memcpy(ptr, EVP_CIPHER_CTX_buf_noconst(c), arg);
-        return 1;
-
-    case EVP_CTRL_GCM_SET_IV_FIXED:
-        /* Special case: -1 length restores whole IV */
-        if (arg == -1) {
-            memcpy(gctx->iv, ptr, gctx->ivlen);
-            gctx->iv_gen = 1;
-            return 1;
-        }
-        /*
-         * Fixed field must be at least 4 bytes and invocation field at least
-         * 8.
-         */
-        if ((arg < 4) || (gctx->ivlen - arg) < 8)
-            return 0;
-        if (arg)
-            memcpy(gctx->iv, ptr, arg);
-        if (EVP_CIPHER_CTX_is_encrypting(c)
-            && RAND_bytes(gctx->iv + arg, gctx->ivlen - arg) <= 0)
-            return 0;
-        gctx->iv_gen = 1;
-        return 1;
-
-    case EVP_CTRL_GCM_IV_GEN:
-        if (gctx->iv_gen == 0 || gctx->key_set == 0)
-            return 0;
-        CRYPTO_gcm128_setiv(&gctx->gcm, gctx->iv, gctx->ivlen);
-        if (arg <= 0 || arg > gctx->ivlen)
-            arg = gctx->ivlen;
-        memcpy(ptr, gctx->iv + gctx->ivlen - arg, arg);
-        /*
-         * Invocation field will be at least 8 bytes in size and so no need
-         * to check wrap around or increment more than last 8 bytes.
-         */
-        ctr64_inc(gctx->iv + gctx->ivlen - 8);
-        gctx->iv_set = 1;
-        return 1;
-
-    case EVP_CTRL_GCM_SET_IV_INV:
-        if (gctx->iv_gen == 0 || gctx->key_set == 0
-            || EVP_CIPHER_CTX_is_encrypting(c))
-            return 0;
-        memcpy(gctx->iv + gctx->ivlen - arg, ptr, arg);
-        CRYPTO_gcm128_setiv(&gctx->gcm, gctx->iv, gctx->ivlen);
-        gctx->iv_set = 1;
-        return 1;
-
-    case EVP_CTRL_AEAD_TLS1_AAD:
-        /* Save the AAD for later use */
-        if (arg != EVP_AEAD_TLS1_AAD_LEN)
-            return 0;
-        memcpy(EVP_CIPHER_CTX_buf_noconst(c), ptr, arg);
-        gctx->tls_aad_len = arg;
-        {
-            unsigned int len = EVP_CIPHER_CTX_buf_noconst(c)[arg - 2] << 8
-                | EVP_CIPHER_CTX_buf_noconst(c)[arg - 1];
-            /* Correct length for explicit IV */
-            if (len < EVP_GCM_TLS_EXPLICIT_IV_LEN)
-                return 0;
-            len -= EVP_GCM_TLS_EXPLICIT_IV_LEN;
-            /* If decrypting correct for tag too */
-            if (!EVP_CIPHER_CTX_is_encrypting(c)) {
-                if (len < EVP_GCM_TLS_TAG_LEN)
-                    return 0;
-                len -= EVP_GCM_TLS_TAG_LEN;
-            }
-            EVP_CIPHER_CTX_buf_noconst(c)[arg - 2] = len >> 8;
-            EVP_CIPHER_CTX_buf_noconst(c)[arg - 1] = len & 0xff;
-        }
-        /* Extra padding: tag appended to record */
-        return EVP_GCM_TLS_TAG_LEN;
-
-    case EVP_CTRL_COPY: {
-        EVP_CIPHER_CTX *out = ptr;
-        EVP_ARIA_GCM_CTX *gctx_out = EVP_C_DATA(EVP_ARIA_GCM_CTX, out);
-        if (gctx->gcm.key) {
-            if (gctx->gcm.key != &gctx->ks)
-                return 0;
-            gctx_out->gcm.key = &gctx_out->ks;
-        }
-        if (gctx->iv == c->iv)
-            gctx_out->iv = out->iv;
-        else {
-            if ((gctx_out->iv = OPENSSL_malloc(gctx->ivlen)) == NULL)
-                return 0;
-            memcpy(gctx_out->iv, gctx->iv, gctx->ivlen);
-        }
-        return 1;
-    }
-
-    default:
-        return -1;
-    }
-}
-
-static int aria_gcm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_ARIA_GCM_CTX *gctx = EVP_C_DATA(EVP_ARIA_GCM_CTX, ctx);
-    int rv = -1;
-
-    /* Encrypt/decrypt must be performed in place */
-    if (out != in
-        || len < (EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN))
-        return -1;
-    /*
-     * Set IV from start of buffer or generate IV and write to start of
-     * buffer.
-     */
-    if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CIPHER_CTX_is_encrypting(ctx) ? EVP_CTRL_GCM_IV_GEN : EVP_CTRL_GCM_SET_IV_INV,
-            EVP_GCM_TLS_EXPLICIT_IV_LEN, out)
-        <= 0)
-        goto err;
-    /* Use saved AAD */
-    if (CRYPTO_gcm128_aad(&gctx->gcm, EVP_CIPHER_CTX_buf_noconst(ctx),
-            gctx->tls_aad_len))
-        goto err;
-    /* Fix buffer and length to point to payload */
-    in += EVP_GCM_TLS_EXPLICIT_IV_LEN;
-    out += EVP_GCM_TLS_EXPLICIT_IV_LEN;
-    len -= EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN;
-    if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-        /* Encrypt payload */
-        if (CRYPTO_gcm128_encrypt(&gctx->gcm, in, out, len))
-            goto err;
-        out += len;
-        /* Finally write tag */
-        CRYPTO_gcm128_tag(&gctx->gcm, out, EVP_GCM_TLS_TAG_LEN);
-        rv = len + EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN;
-    } else {
-        /* Decrypt */
-        if (CRYPTO_gcm128_decrypt(&gctx->gcm, in, out, len))
-            goto err;
-        /* Retrieve tag */
-        CRYPTO_gcm128_tag(&gctx->gcm, EVP_CIPHER_CTX_buf_noconst(ctx),
-            EVP_GCM_TLS_TAG_LEN);
-        /* If tag mismatch wipe buffer */
-        if (CRYPTO_memcmp(EVP_CIPHER_CTX_buf_noconst(ctx), in + len,
-                EVP_GCM_TLS_TAG_LEN)) {
-            OPENSSL_cleanse(out, len);
-            goto err;
-        }
-        rv = len;
-    }
-
-err:
-    gctx->iv_set = 0;
-    gctx->tls_aad_len = -1;
-    return rv;
-}
-
-static int aria_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_ARIA_GCM_CTX *gctx = EVP_C_DATA(EVP_ARIA_GCM_CTX, ctx);
-
-    /* If not set up, return error */
-    if (!gctx->key_set)
-        return -1;
-
-    if (gctx->tls_aad_len >= 0)
-        return aria_gcm_tls_cipher(ctx, out, in, len);
-
-    if (!gctx->iv_set)
-        return -1;
-    if (in) {
-        if (out == NULL) {
-            if (CRYPTO_gcm128_aad(&gctx->gcm, in, len))
-                return -1;
-        } else if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            if (CRYPTO_gcm128_encrypt(&gctx->gcm, in, out, len))
-                return -1;
-        } else {
-            if (CRYPTO_gcm128_decrypt(&gctx->gcm, in, out, len))
-                return -1;
-        }
-        return len;
-    }
-    if (!EVP_CIPHER_CTX_is_encrypting(ctx)) {
-        if (gctx->taglen < 0)
-            return -1;
-        if (CRYPTO_gcm128_finish(&gctx->gcm,
-                EVP_CIPHER_CTX_buf_noconst(ctx),
-                gctx->taglen)
-            != 0)
-            return -1;
-        gctx->iv_set = 0;
-        return 0;
-    }
-    CRYPTO_gcm128_tag(&gctx->gcm, EVP_CIPHER_CTX_buf_noconst(ctx), 16);
-    gctx->taglen = 16;
-    /* Don't reuse the IV */
-    gctx->iv_set = 0;
-    return 0;
-}
-
-static int aria_gcm_cleanup(EVP_CIPHER_CTX *ctx)
-{
-    EVP_ARIA_GCM_CTX *gctx = EVP_C_DATA(EVP_ARIA_GCM_CTX, ctx);
-
-    if (gctx->iv != ctx->iv)
-        OPENSSL_free(gctx->iv);
-
-    return 1;
-}
-
-static int aria_ccm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    int ret;
-    EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX, ctx);
-
-    if (!iv && !key)
-        return 1;
-
-    if (key) {
-        ret = ossl_aria_set_encrypt_key(key,
-            EVP_CIPHER_CTX_get_key_length(ctx) * 8,
-            &cctx->ks.ks);
-        CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L,
-            &cctx->ks, (block128_f)ossl_aria_encrypt);
-        if (ret < 0) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED);
-            return 0;
-        }
-        cctx->str = NULL;
-        cctx->key_set = 1;
-    }
-    if (iv) {
-        memcpy(ctx->iv, iv, 15 - cctx->L);
-        cctx->iv_set = 1;
-    }
-    return 1;
-}
-
-static int aria_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
-{
-    EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX, c);
-
-    switch (type) {
-    case EVP_CTRL_INIT:
-        cctx->key_set = 0;
-        cctx->iv_set = 0;
-        cctx->L = 8;
-        cctx->M = 12;
-        cctx->tag_set = 0;
-        cctx->len_set = 0;
-        cctx->tls_aad_len = -1;
-        return 1;
-
-    case EVP_CTRL_GET_IVLEN:
-        *(int *)ptr = 15 - cctx->L;
-        return 1;
-
-    case EVP_CTRL_AEAD_TLS1_AAD:
-        /* Save the AAD for later use */
-        if (arg != EVP_AEAD_TLS1_AAD_LEN)
-            return 0;
-        memcpy(EVP_CIPHER_CTX_buf_noconst(c), ptr, arg);
-        cctx->tls_aad_len = arg;
-        {
-            uint16_t len = EVP_CIPHER_CTX_buf_noconst(c)[arg - 2] << 8
-                | EVP_CIPHER_CTX_buf_noconst(c)[arg - 1];
-            /* Correct length for explicit IV */
-            if (len < EVP_CCM_TLS_EXPLICIT_IV_LEN)
-                return 0;
-            len -= EVP_CCM_TLS_EXPLICIT_IV_LEN;
-            /* If decrypting correct for tag too */
-            if (!EVP_CIPHER_CTX_is_encrypting(c)) {
-                if (len < cctx->M)
-                    return 0;
-                len -= cctx->M;
-            }
-            EVP_CIPHER_CTX_buf_noconst(c)[arg - 2] = len >> 8;
-            EVP_CIPHER_CTX_buf_noconst(c)[arg - 1] = len & 0xff;
-        }
-        /* Extra padding: tag appended to record */
-        return cctx->M;
-
-    case EVP_CTRL_CCM_SET_IV_FIXED:
-        /* Sanity check length */
-        if (arg != EVP_CCM_TLS_FIXED_IV_LEN)
-            return 0;
-        /* Just copy to first part of IV */
-        memcpy(c->iv, ptr, arg);
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_IVLEN:
-        arg = 15 - arg;
-        /* fall through */
-    case EVP_CTRL_CCM_SET_L:
-        if (arg < 2 || arg > 8)
-            return 0;
-        cctx->L = arg;
-        return 1;
-    case EVP_CTRL_AEAD_SET_TAG:
-        if ((arg & 1) || arg < 4 || arg > 16)
-            return 0;
-        if (EVP_CIPHER_CTX_is_encrypting(c) && ptr)
-            return 0;
-        if (ptr) {
-            cctx->tag_set = 1;
-            memcpy(EVP_CIPHER_CTX_buf_noconst(c), ptr, arg);
-        }
-        cctx->M = arg;
-        return 1;
-
-    case EVP_CTRL_AEAD_GET_TAG:
-        if (!EVP_CIPHER_CTX_is_encrypting(c) || !cctx->tag_set)
-            return 0;
-        if (!CRYPTO_ccm128_tag(&cctx->ccm, ptr, (size_t)arg))
-            return 0;
-        cctx->tag_set = 0;
-        cctx->iv_set = 0;
-        cctx->len_set = 0;
-        return 1;
-
-    case EVP_CTRL_COPY: {
-        EVP_CIPHER_CTX *out = ptr;
-        EVP_ARIA_CCM_CTX *cctx_out = EVP_C_DATA(EVP_ARIA_CCM_CTX, out);
-        if (cctx->ccm.key) {
-            if (cctx->ccm.key != &cctx->ks)
-                return 0;
-            cctx_out->ccm.key = &cctx_out->ks;
-        }
-        return 1;
-    }
-
-    default:
-        return -1;
-    }
-}
-
-static int aria_ccm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX, ctx);
-    CCM128_CONTEXT *ccm = &cctx->ccm;
-
-    /* Encrypt/decrypt must be performed in place */
-    if (out != in || len < (EVP_CCM_TLS_EXPLICIT_IV_LEN + (size_t)cctx->M))
-        return -1;
-    /* If encrypting set explicit IV from sequence number (start of AAD) */
-    if (EVP_CIPHER_CTX_is_encrypting(ctx))
-        memcpy(out, EVP_CIPHER_CTX_buf_noconst(ctx),
-            EVP_CCM_TLS_EXPLICIT_IV_LEN);
-    /* Get rest of IV from explicit IV */
-    memcpy(ctx->iv + EVP_CCM_TLS_FIXED_IV_LEN, in,
-        EVP_CCM_TLS_EXPLICIT_IV_LEN);
-    /* Correct length value */
-    len -= EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->M;
-    if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L,
-            len))
-        return -1;
-    /* Use saved AAD */
-    CRYPTO_ccm128_aad(ccm, EVP_CIPHER_CTX_buf_noconst(ctx),
-        cctx->tls_aad_len);
-    /* Fix buffer to point to payload */
-    in += EVP_CCM_TLS_EXPLICIT_IV_LEN;
-    out += EVP_CCM_TLS_EXPLICIT_IV_LEN;
-    if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-        if (cctx->str ? CRYPTO_ccm128_encrypt_ccm64(ccm, in, out, len, cctx->str)
-                      : CRYPTO_ccm128_encrypt(ccm, in, out, len))
-            return -1;
-        if (!CRYPTO_ccm128_tag(ccm, out + len, cctx->M))
-            return -1;
-        return len + EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->M;
-    } else {
-        if (cctx->str ? !CRYPTO_ccm128_decrypt_ccm64(ccm, in, out, len, cctx->str)
-                      : !CRYPTO_ccm128_decrypt(ccm, in, out, len)) {
-            unsigned char tag[16];
-            if (CRYPTO_ccm128_tag(ccm, tag, cctx->M)) {
-                if (!CRYPTO_memcmp(tag, in + len, cctx->M))
-                    return len;
-            }
-        }
-        OPENSSL_cleanse(out, len);
-        return -1;
-    }
-}
-
-static int aria_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX, ctx);
-    CCM128_CONTEXT *ccm = &cctx->ccm;
-
-    /* If not set up, return error */
-    if (!cctx->key_set)
-        return -1;
-
-    if (cctx->tls_aad_len >= 0)
-        return aria_ccm_tls_cipher(ctx, out, in, len);
-
-    /* EVP_*Final() doesn't return any data */
-    if (in == NULL && out != NULL)
-        return 0;
-
-    if (!cctx->iv_set)
-        return -1;
-
-    if (!out) {
-        if (!in) {
-            if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L, len))
-                return -1;
-            cctx->len_set = 1;
-            return len;
-        }
-        /* If have AAD need message length */
-        if (!cctx->len_set && len)
-            return -1;
-        CRYPTO_ccm128_aad(ccm, in, len);
-        return len;
-    }
-
-    /* The tag must be set before actually decrypting data */
-    if (!EVP_CIPHER_CTX_is_encrypting(ctx) && !cctx->tag_set)
-        return -1;
-
-    /* If not set length yet do it */
-    if (!cctx->len_set) {
-        if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L, len))
-            return -1;
-        cctx->len_set = 1;
-    }
-    if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-        if (cctx->str ? CRYPTO_ccm128_encrypt_ccm64(ccm, in, out, len, cctx->str)
-                      : CRYPTO_ccm128_encrypt(ccm, in, out, len))
-            return -1;
-        cctx->tag_set = 1;
-        return len;
-    } else {
-        int rv = -1;
-        if (cctx->str ? !CRYPTO_ccm128_decrypt_ccm64(ccm, in, out, len,
-                            cctx->str)
-                      : !CRYPTO_ccm128_decrypt(ccm, in, out, len)) {
-            unsigned char tag[16];
-            if (CRYPTO_ccm128_tag(ccm, tag, cctx->M)) {
-                if (!CRYPTO_memcmp(tag, EVP_CIPHER_CTX_buf_noconst(ctx),
-                        cctx->M))
-                    rv = len;
-            }
-        }
-        if (rv == -1)
-            OPENSSL_cleanse(out, len);
-        cctx->iv_set = 0;
-        cctx->tag_set = 0;
-        cctx->len_set = 0;
-        return rv;
-    }
-}
-
-#define aria_ccm_cleanup NULL
-
 #define ARIA_AUTH_FLAGS (EVP_CIPH_FLAG_DEFAULT_ASN1    \
     | EVP_CIPH_CUSTOM_IV | EVP_CIPH_FLAG_CUSTOM_CIPHER \
     | EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CTRL_INIT   \
@@ -765,12 +58,7 @@ static int aria_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
         NID_aria_##keylen##_##mode,                    \
         1, keylen / 8, 12,                             \
         ARIA_AUTH_FLAGS | EVP_CIPH_##MODE##_MODE,      \
-        EVP_ORIG_GLOBAL,                               \
-        aria_##mode##_init_key,                        \
-        aria_##mode##_cipher,                          \
-        aria_##mode##_cleanup,                         \
-        sizeof(EVP_ARIA_##MODE##_CTX),                 \
-        NULL, NULL, aria_##mode##_ctrl, NULL           \
+        EVP_ORIG_GLOBAL                                \
     };                                                 \
     const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
     {                                                  \
@@ -785,4 +73,6 @@ BLOCK_CIPHER_aead(128, ccm, CCM)
 BLOCK_CIPHER_aead(192, ccm, CCM)
 BLOCK_CIPHER_aead(256, ccm, CCM)

+#else
+NON_EMPTY_TRANSLATION_UNIT
 #endif
diff --git a/deps/openssl/openssl/crypto/evp/e_bf.c b/deps/openssl/openssl/crypto/evp/e_bf.c
index 8cac877e91c..3910bb0c612 100644
--- a/deps/openssl/openssl/crypto/evp/e_bf.c
+++ b/deps/openssl/openssl/crypto/evp/e_bf.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,43 +7,13 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * BF low level APIs are deprecated for public use, but still ok for internal
- * use.
- */
-#include "internal/deprecated.h"
+#include <openssl/macros.h>

-#include <stdio.h>
-#include "internal/cryptlib.h"
 #ifndef OPENSSL_NO_BF
-#include <openssl/evp.h>
 #include "crypto/evp.h"
-#include <openssl/objects.h>
-#include <openssl/blowfish.h>
-#include "evp_local.h"
-
-static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-
-typedef struct {
-    BF_KEY ks;
-} EVP_BF_KEY;
-
-#define data(ctx) EVP_C_DATA(EVP_BF_KEY, ctx)

 IMPLEMENT_BLOCK_CIPHER(bf, ks, BF, EVP_BF_KEY, NID_bf, 8, 16, 8, 64,
-    EVP_CIPH_VARIABLE_LENGTH, bf_init_key, NULL,
-    EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL)
-
-static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    int len = EVP_CIPHER_CTX_get_key_length(ctx);
-
-    if (len < 0)
-        return 0;
-    BF_set_key(&data(ctx)->ks, len, key);
-    return 1;
-}
-
+    EVP_CIPH_VARIABLE_LENGTH)
+#else
+NON_EMPTY_TRANSLATION_UNIT
 #endif
diff --git a/deps/openssl/openssl/crypto/evp/e_camellia.c b/deps/openssl/openssl/crypto/evp/e_camellia.c
index babc4f18f3b..2549cd871dc 100644
--- a/deps/openssl/openssl/crypto/evp/e_camellia.c
+++ b/deps/openssl/openssl/crypto/evp/e_camellia.c
@@ -7,182 +7,22 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * Camellia low level APIs are deprecated for public use, but still ok for
- * internal use.
- */
-#include "internal/deprecated.h"
-
-#include <openssl/opensslconf.h>
-
-#include <openssl/evp.h>
-#include <openssl/err.h>
-#include <string.h>
-#include <assert.h>
-#include <openssl/camellia.h>
 #include "crypto/evp.h"
-#include "crypto/modes.h"
-#include "crypto/cmll_platform.h"
-#include "evp_local.h"
-
-static int camellia_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-
-/* Camellia subkey Structure */
-typedef struct {
-    CAMELLIA_KEY ks;
-    block128_f block;
-    union {
-        cbc128_f cbc;
-        ctr128_f ctr;
-    } stream;
-} EVP_CAMELLIA_KEY;
-
-#define MAXBITCHUNK ((size_t)1 << (sizeof(size_t) * 8 - 4))
-
-/* Attribute operation for Camellia */
-#define data(ctx) EVP_C_DATA(EVP_CAMELLIA_KEY, ctx)
-
-#if defined(AES_ASM) && (defined(__sparc) || defined(__sparc__))
-/* ---------^^^ this is not a typo, just a way to detect that
- * assembler support was in general requested... */
-#include "crypto/sparc_arch.h"
-
-static int cmll_t4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    int ret, mode, bits;
-    EVP_CAMELLIA_KEY *dat = (EVP_CAMELLIA_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-
-    mode = EVP_CIPHER_CTX_get_mode(ctx);
-    bits = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-
-    cmll_t4_set_key(key, bits, &dat->ks);
-
-    if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE)
-        && !enc) {
-        ret = 0;
-        dat->block = (block128_f)cmll_t4_decrypt;
-        switch (bits) {
-        case 128:
-            dat->stream.cbc = mode == EVP_CIPH_CBC_MODE ? (cbc128_f)cmll128_t4_cbc_decrypt : NULL;
-            break;
-        case 192:
-        case 256:
-            dat->stream.cbc = mode == EVP_CIPH_CBC_MODE ? (cbc128_f)cmll256_t4_cbc_decrypt : NULL;
-            break;
-        default:
-            ret = -1;
-        }
-    } else {
-        ret = 0;
-        dat->block = (block128_f)cmll_t4_encrypt;
-        switch (bits) {
-        case 128:
-            if (mode == EVP_CIPH_CBC_MODE)
-                dat->stream.cbc = (cbc128_f)cmll128_t4_cbc_encrypt;
-            else if (mode == EVP_CIPH_CTR_MODE)
-                dat->stream.ctr = (ctr128_f)cmll128_t4_ctr32_encrypt;
-            else
-                dat->stream.cbc = NULL;
-            break;
-        case 192:
-        case 256:
-            if (mode == EVP_CIPH_CBC_MODE)
-                dat->stream.cbc = (cbc128_f)cmll256_t4_cbc_encrypt;
-            else if (mode == EVP_CIPH_CTR_MODE)
-                dat->stream.ctr = (ctr128_f)cmll256_t4_ctr32_encrypt;
-            else
-                dat->stream.cbc = NULL;
-            break;
-        default:
-            ret = -1;
-        }
-    }
-
-    if (ret < 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_CAMELLIA_KEY_SETUP_FAILED);
-        return 0;
-    }
-
-    return 1;
-}
-
-#define cmll_t4_cbc_cipher camellia_cbc_cipher
-static int cmll_t4_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define cmll_t4_ecb_cipher camellia_ecb_cipher
-static int cmll_t4_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define cmll_t4_ofb_cipher camellia_ofb_cipher
-static int cmll_t4_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define cmll_t4_cfb_cipher camellia_cfb_cipher
-static int cmll_t4_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define cmll_t4_cfb8_cipher camellia_cfb8_cipher
-static int cmll_t4_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define cmll_t4_cfb1_cipher camellia_cfb1_cipher
-static int cmll_t4_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define cmll_t4_ctr_cipher camellia_ctr_cipher
-static int cmll_t4_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len);
-
-#define BLOCK_CIPHER_generic(nid, keylen, blocksize, ivlen, nmode, mode, MODE, flags)         \
-    static const EVP_CIPHER cmll_t4_##keylen##_##mode = {                                     \
-        nid##_##keylen##_##nmode, blocksize, keylen / 8, ivlen,                               \
-        flags | EVP_CIPH_##MODE##_MODE,                                                       \
-        EVP_ORIG_GLOBAL,                                                                      \
-        cmll_t4_init_key,                                                                     \
-        cmll_t4_##mode##_cipher,                                                              \
-        NULL,                                                                                 \
-        sizeof(EVP_CAMELLIA_KEY),                                                             \
-        NULL, NULL, NULL, NULL                                                                \
-    };                                                                                        \
-    static const EVP_CIPHER camellia_##keylen##_##mode = {                                    \
-        nid##_##keylen##_##nmode, blocksize,                                                  \
-        keylen / 8, ivlen,                                                                    \
-        flags | EVP_CIPH_##MODE##_MODE,                                                       \
-        EVP_ORIG_GLOBAL,                                                                      \
-        camellia_init_key,                                                                    \
-        camellia_##mode##_cipher,                                                             \
-        NULL,                                                                                 \
-        sizeof(EVP_CAMELLIA_KEY),                                                             \
-        NULL, NULL, NULL, NULL                                                                \
-    };                                                                                        \
-    const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void)                                    \
-    {                                                                                         \
-        return SPARC_CMLL_CAPABLE ? &cmll_t4_##keylen##_##mode : &camellia_##keylen##_##mode; \
-    }
-
-#else

 #define BLOCK_CIPHER_generic(nid, keylen, blocksize, ivlen, nmode, mode, MODE, flags) \
     static const EVP_CIPHER camellia_##keylen##_##mode = {                            \
-        nid##_##keylen##_##nmode, blocksize, keylen / 8, ivlen,                       \
+        nid##_##keylen##_##nmode,                                                     \
+        blocksize,                                                                    \
+        keylen / 8,                                                                   \
+        ivlen,                                                                        \
         flags | EVP_CIPH_##MODE##_MODE,                                               \
         EVP_ORIG_GLOBAL,                                                              \
-        camellia_init_key,                                                            \
-        camellia_##mode##_cipher,                                                     \
-        NULL,                                                                         \
-        sizeof(EVP_CAMELLIA_KEY),                                                     \
-        NULL, NULL, NULL, NULL                                                        \
     };                                                                                \
     const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void)                            \
     {                                                                                 \
         return &camellia_##keylen##_##mode;                                           \
     }

-#endif
-
 #define BLOCK_CIPHER_generic_pack(nid, keylen, flags)                                              \
     BLOCK_CIPHER_generic(nid, keylen, 16, 16, cbc, cbc, CBC, flags | EVP_CIPH_FLAG_DEFAULT_ASN1)   \
     BLOCK_CIPHER_generic(nid, keylen, 16, 0, ecb, ecb, ECB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1)    \
@@ -192,160 +32,6 @@ static int cmll_t4_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
     BLOCK_CIPHER_generic(nid, keylen, 1, 16, cfb8, cfb8, CFB, flags)                               \
     BLOCK_CIPHER_generic(nid, keylen, 1, 16, ctr, ctr, CTR, flags)

-/* The subkey for Camellia is generated. */
-static int camellia_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    int ret, mode;
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
-
-    ret = Camellia_set_key(key, EVP_CIPHER_CTX_get_key_length(ctx) * 8,
-        &dat->ks);
-    if (ret < 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_CAMELLIA_KEY_SETUP_FAILED);
-        return 0;
-    }
-
-    mode = EVP_CIPHER_CTX_get_mode(ctx);
-    if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE)
-        && !enc) {
-        dat->block = (block128_f)Camellia_decrypt;
-        dat->stream.cbc = mode == EVP_CIPH_CBC_MODE ? (cbc128_f)Camellia_cbc_encrypt : NULL;
-    } else {
-        dat->block = (block128_f)Camellia_encrypt;
-        dat->stream.cbc = mode == EVP_CIPH_CBC_MODE ? (cbc128_f)Camellia_cbc_encrypt : NULL;
-    }
-
-    return 1;
-}
-
-static int camellia_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
-
-    if (dat->stream.cbc)
-        (*dat->stream.cbc)(in, out, len, &dat->ks, ctx->iv,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-    else if (EVP_CIPHER_CTX_is_encrypting(ctx))
-        CRYPTO_cbc128_encrypt(in, out, len, &dat->ks, ctx->iv, dat->block);
-    else
-        CRYPTO_cbc128_decrypt(in, out, len, &dat->ks, ctx->iv, dat->block);
-
-    return 1;
-}
-
-static int camellia_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    size_t bl = EVP_CIPHER_CTX_get_block_size(ctx);
-    size_t i;
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
-
-    if (len < bl)
-        return 1;
-
-    for (i = 0, len -= bl; i <= len; i += bl)
-        (*dat->block)(in + i, out + i, &dat->ks);
-
-    return 1;
-}
-
-static int camellia_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
-
-    int num = EVP_CIPHER_CTX_get_num(ctx);
-    CRYPTO_ofb128_encrypt(in, out, len, &dat->ks, ctx->iv, &num, dat->block);
-    EVP_CIPHER_CTX_set_num(ctx, num);
-    return 1;
-}
-
-static int camellia_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
-
-    int num = EVP_CIPHER_CTX_get_num(ctx);
-    CRYPTO_cfb128_encrypt(in, out, len, &dat->ks, ctx->iv, &num,
-        EVP_CIPHER_CTX_is_encrypting(ctx), dat->block);
-    EVP_CIPHER_CTX_set_num(ctx, num);
-    return 1;
-}
-
-static int camellia_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
-
-    int num = EVP_CIPHER_CTX_get_num(ctx);
-    CRYPTO_cfb128_8_encrypt(in, out, len, &dat->ks, ctx->iv, &num,
-        EVP_CIPHER_CTX_is_encrypting(ctx), dat->block);
-    EVP_CIPHER_CTX_set_num(ctx, num);
-    return 1;
-}
-
-static int camellia_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
-
-    if (EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS)) {
-        int num = EVP_CIPHER_CTX_get_num(ctx);
-        CRYPTO_cfb128_1_encrypt(in, out, len, &dat->ks, ctx->iv, &num,
-            EVP_CIPHER_CTX_is_encrypting(ctx),
-            dat->block);
-        EVP_CIPHER_CTX_set_num(ctx, num);
-        return 1;
-    }
-
-    while (len >= MAXBITCHUNK) {
-        int num = EVP_CIPHER_CTX_get_num(ctx);
-        CRYPTO_cfb128_1_encrypt(in, out, MAXBITCHUNK * 8, &dat->ks,
-            ctx->iv, &num,
-            EVP_CIPHER_CTX_is_encrypting(ctx),
-            dat->block);
-        EVP_CIPHER_CTX_set_num(ctx, num);
-        len -= MAXBITCHUNK;
-        out += MAXBITCHUNK;
-        in += MAXBITCHUNK;
-    }
-    if (len) {
-        int num = EVP_CIPHER_CTX_get_num(ctx);
-        CRYPTO_cfb128_1_encrypt(in, out, len * 8, &dat->ks,
-            ctx->iv, &num,
-            EVP_CIPHER_CTX_is_encrypting(ctx),
-            dat->block);
-        EVP_CIPHER_CTX_set_num(ctx, num);
-    }
-
-    return 1;
-}
-
-static int camellia_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    int snum = EVP_CIPHER_CTX_get_num(ctx);
-    unsigned int num;
-    EVP_CAMELLIA_KEY *dat = EVP_C_DATA(EVP_CAMELLIA_KEY, ctx);
-
-    if (snum < 0)
-        return 0;
-    num = snum;
-    if (dat->stream.ctr)
-        CRYPTO_ctr128_encrypt_ctr32(in, out, len, &dat->ks, ctx->iv,
-            EVP_CIPHER_CTX_buf_noconst(ctx),
-            &num,
-            dat->stream.ctr);
-    else
-        CRYPTO_ctr128_encrypt(in, out, len, &dat->ks, ctx->iv,
-            EVP_CIPHER_CTX_buf_noconst(ctx), &num,
-            dat->block);
-    EVP_CIPHER_CTX_set_num(ctx, num);
-    return 1;
-}
-
 BLOCK_CIPHER_generic_pack(NID_camellia, 128, 0)
 BLOCK_CIPHER_generic_pack(NID_camellia, 192, 0)
 BLOCK_CIPHER_generic_pack(NID_camellia, 256, 0)
diff --git a/deps/openssl/openssl/crypto/evp/e_cast.c b/deps/openssl/openssl/crypto/evp/e_cast.c
index f45469e8212..bffe971dd03 100644
--- a/deps/openssl/openssl/crypto/evp/e_cast.c
+++ b/deps/openssl/openssl/crypto/evp/e_cast.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,45 +7,16 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * CAST low level APIs are deprecated for public use, but still ok for
- * internal use.
- */
-#include "internal/deprecated.h"
-
-#include <stdio.h>
-#include "internal/cryptlib.h"
+#include <openssl/macros.h>

 #ifndef OPENSSL_NO_CAST
-#include <openssl/evp.h>
-#include <openssl/objects.h>
-#include "crypto/evp.h"
 #include <openssl/cast.h>
-#include "evp_local.h"
-
-static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-
-typedef struct {
-    CAST_KEY ks;
-} EVP_CAST_KEY;
-
-#define data(ctx) EVP_C_DATA(EVP_CAST_KEY, ctx)
+#include "crypto/evp.h"

 IMPLEMENT_BLOCK_CIPHER(cast5, ks, CAST, EVP_CAST_KEY,
     NID_cast5, 8, CAST_KEY_LENGTH, 8, 64,
-    EVP_CIPH_VARIABLE_LENGTH, cast_init_key, NULL,
-    EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL)
-
-static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    int keylen = EVP_CIPHER_CTX_get_key_length(ctx);
-
-    if (keylen <= 0)
-        return 0;
-    CAST_set_key(&data(ctx)->ks, keylen, key);
-    return 1;
-}
+    EVP_CIPH_VARIABLE_LENGTH)

+#else
+NON_EMPTY_TRANSLATION_UNIT
 #endif
diff --git a/deps/openssl/openssl/crypto/evp/e_chacha20_poly1305.c b/deps/openssl/openssl/crypto/evp/e_chacha20_poly1305.c
index 1751444a904..78dbe45ce44 100644
--- a/deps/openssl/openssl/crypto/evp/e_chacha20_poly1305.c
+++ b/deps/openssl/openssl/crypto/evp/e_chacha20_poly1305.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,140 +7,20 @@
  * https://www.openssl.org/source/license.html
  */

-#include <stdio.h>
-#include "internal/cryptlib.h"
-#include "internal/endian.h"
+#include <openssl/macros.h>

 #ifndef OPENSSL_NO_CHACHA

-#include <openssl/evp.h>
-#include <openssl/objects.h>
 #include "crypto/evp.h"
-#include "evp_local.h"
 #include "crypto/chacha.h"

-typedef struct {
-    union {
-        OSSL_UNION_ALIGN; /* this ensures even sizeof(EVP_CHACHA_KEY)%8==0 */
-        unsigned int d[CHACHA_KEY_SIZE / 4];
-    } key;
-    unsigned int counter[CHACHA_CTR_SIZE / 4];
-    unsigned char buf[CHACHA_BLK_SIZE];
-    unsigned int partial_len;
-} EVP_CHACHA_KEY;
-
-#define data(ctx) ((EVP_CHACHA_KEY *)(ctx)->cipher_data)
-
-#define CHACHA20_POLY1305_MAX_IVLEN 12
-
-static int chacha_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char user_key[CHACHA_KEY_SIZE],
-    const unsigned char iv[CHACHA_CTR_SIZE], int enc)
-{
-    EVP_CHACHA_KEY *key = data(ctx);
-    unsigned int i;
-
-    if (user_key)
-        for (i = 0; i < CHACHA_KEY_SIZE; i += 4) {
-            key->key.d[i / 4] = CHACHA_U8TOU32(user_key + i);
-        }
-
-    if (iv)
-        for (i = 0; i < CHACHA_CTR_SIZE; i += 4) {
-            key->counter[i / 4] = CHACHA_U8TOU32(iv + i);
-        }
-
-    key->partial_len = 0;
-
-    return 1;
-}
-
-static int chacha_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *inp, size_t len)
-{
-    EVP_CHACHA_KEY *key = data(ctx);
-    unsigned int n, rem, ctr32;
-
-    if ((n = key->partial_len)) {
-        while (len && n < CHACHA_BLK_SIZE) {
-            *out++ = *inp++ ^ key->buf[n++];
-            len--;
-        }
-        key->partial_len = n;
-
-        if (len == 0)
-            return 1;
-
-        if (n == CHACHA_BLK_SIZE) {
-            key->partial_len = 0;
-            key->counter[0]++;
-            if (key->counter[0] == 0)
-                key->counter[1]++;
-        }
-    }
-
-    rem = (unsigned int)(len % CHACHA_BLK_SIZE);
-    len -= rem;
-    ctr32 = key->counter[0];
-    while (len >= CHACHA_BLK_SIZE) {
-        size_t blocks = len / CHACHA_BLK_SIZE;
-        /*
-         * 1<<28 is just a not-so-small yet not-so-large number...
-         * Below condition is practically never met, but it has to
-         * be checked for code correctness.
-         */
-        if (sizeof(size_t) > sizeof(unsigned int) && blocks > (1U << 28))
-            blocks = (1U << 28);
-
-        /*
-         * As ChaCha20_ctr32 operates on 32-bit counter, caller
-         * has to handle overflow. 'if' below detects the
-         * overflow, which is then handled by limiting the
-         * amount of blocks to the exact overflow point...
-         */
-        ctr32 += (unsigned int)blocks;
-        if (ctr32 < blocks) {
-            blocks -= ctr32;
-            ctr32 = 0;
-        }
-        blocks *= CHACHA_BLK_SIZE;
-        ChaCha20_ctr32(out, inp, blocks, key->key.d, key->counter);
-        len -= blocks;
-        inp += blocks;
-        out += blocks;
-
-        key->counter[0] = ctr32;
-        if (ctr32 == 0)
-            key->counter[1]++;
-    }
-
-    if (rem) {
-        memset(key->buf, 0, sizeof(key->buf));
-        ChaCha20_ctr32(key->buf, key->buf, CHACHA_BLK_SIZE,
-            key->key.d, key->counter);
-        for (n = 0; n < rem; n++)
-            out[n] = inp[n] ^ key->buf[n];
-        key->partial_len = rem;
-    }
-
-    return 1;
-}
-
 static const EVP_CIPHER chacha20 = {
     NID_chacha20,
     1, /* block_size */
     CHACHA_KEY_SIZE, /* key_len */
     CHACHA_CTR_SIZE, /* iv_len, 128-bit counter in the context */
     EVP_CIPH_CUSTOM_IV | EVP_CIPH_ALWAYS_CALL_INIT,
-    EVP_ORIG_GLOBAL,
-    chacha_init_key,
-    chacha_cipher,
-    NULL,
-    sizeof(EVP_CHACHA_KEY),
-    NULL,
-    NULL,
-    NULL,
-    NULL
+    EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_chacha20(void)
@@ -149,482 +29,21 @@ const EVP_CIPHER *EVP_chacha20(void)
 }

 #ifndef OPENSSL_NO_POLY1305
-#include "crypto/poly1305.h"
-
-typedef struct {
-    EVP_CHACHA_KEY key;
-    unsigned int nonce[12 / 4];
-    unsigned char tag[POLY1305_BLOCK_SIZE];
-    unsigned char tls_aad[POLY1305_BLOCK_SIZE];
-    struct {
-        uint64_t aad, text;
-    } len;
-    int aad, mac_inited, tag_len, nonce_len;
-    size_t tls_payload_length;
-} EVP_CHACHA_AEAD_CTX;
-
-#define NO_TLS_PAYLOAD_LENGTH ((size_t)-1)
-#define aead_data(ctx) ((EVP_CHACHA_AEAD_CTX *)(ctx)->cipher_data)
-#define POLY1305_ctx(actx) ((POLY1305 *)(actx + 1))
-
-static int chacha20_poly1305_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *inkey,
-    const unsigned char *iv, int enc)
-{
-    EVP_CHACHA_AEAD_CTX *actx = aead_data(ctx);

-    if (!inkey && !iv)
-        return 1;
-
-    actx->len.aad = 0;
-    actx->len.text = 0;
-    actx->aad = 0;
-    actx->mac_inited = 0;
-    actx->tls_payload_length = NO_TLS_PAYLOAD_LENGTH;
-
-    if (iv != NULL) {
-        unsigned char temp[CHACHA_CTR_SIZE] = { 0 };
-
-        /* pad on the left */
-        if (actx->nonce_len <= CHACHA_CTR_SIZE)
-            memcpy(temp + CHACHA_CTR_SIZE - actx->nonce_len, iv,
-                actx->nonce_len);
-
-        chacha_init_key(ctx, inkey, temp, enc);
-
-        actx->nonce[0] = actx->key.counter[1];
-        actx->nonce[1] = actx->key.counter[2];
-        actx->nonce[2] = actx->key.counter[3];
-    } else {
-        chacha_init_key(ctx, inkey, NULL, enc);
-    }
-
-    return 1;
-}
-
-#if !defined(OPENSSL_SMALL_FOOTPRINT)
-
-#if defined(POLY1305_ASM) && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
-#define XOR128_HELPERS
-void *xor128_encrypt_n_pad(void *out, const void *inp, void *otp, size_t len);
-void *xor128_decrypt_n_pad(void *out, const void *inp, void *otp, size_t len);
-static const unsigned char zero[4 * CHACHA_BLK_SIZE] = { 0 };
-#else
-static const unsigned char zero[2 * CHACHA_BLK_SIZE] = { 0 };
-#endif
-
-static int chacha20_poly1305_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_CHACHA_AEAD_CTX *actx = aead_data(ctx);
-    size_t tail, tohash_len, buf_len, plen = actx->tls_payload_length;
-    unsigned char *buf, *tohash, *ctr, storage[sizeof(zero) + 32];
-
-    if (len != plen + POLY1305_BLOCK_SIZE)
-        return -1;
-
-    buf = storage + ((0 - (size_t)storage) & 15); /* align */
-    ctr = buf + CHACHA_BLK_SIZE;
-    tohash = buf + CHACHA_BLK_SIZE - POLY1305_BLOCK_SIZE;
-
-#ifdef XOR128_HELPERS
-    if (plen <= 3 * CHACHA_BLK_SIZE) {
-        actx->key.counter[0] = 0;
-        buf_len = (plen + 2 * CHACHA_BLK_SIZE - 1) & (0 - CHACHA_BLK_SIZE);
-        ChaCha20_ctr32(buf, zero, buf_len, actx->key.key.d,
-            actx->key.counter);
-        Poly1305_Init(POLY1305_ctx(actx), buf);
-        actx->key.partial_len = 0;
-        memcpy(tohash, actx->tls_aad, POLY1305_BLOCK_SIZE);
-        tohash_len = POLY1305_BLOCK_SIZE;
-        actx->len.aad = EVP_AEAD_TLS1_AAD_LEN;
-        actx->len.text = plen;
-
-        if (plen) {
-            if (EVP_CIPHER_CTX_is_encrypting(ctx))
-                ctr = xor128_encrypt_n_pad(out, in, ctr, plen);
-            else
-                ctr = xor128_decrypt_n_pad(out, in, ctr, plen);
-
-            in += plen;
-            out += plen;
-            tohash_len = (size_t)(ctr - tohash);
-        }
-    }
-#else
-    if (plen <= CHACHA_BLK_SIZE) {
-        size_t i;
-
-        actx->key.counter[0] = 0;
-        ChaCha20_ctr32(buf, zero, (buf_len = 2 * CHACHA_BLK_SIZE),
-            actx->key.key.d, actx->key.counter);
-        Poly1305_Init(POLY1305_ctx(actx), buf);
-        actx->key.partial_len = 0;
-        memcpy(tohash, actx->tls_aad, POLY1305_BLOCK_SIZE);
-        tohash_len = POLY1305_BLOCK_SIZE;
-        actx->len.aad = EVP_AEAD_TLS1_AAD_LEN;
-        actx->len.text = plen;
-
-        if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            for (i = 0; i < plen; i++) {
-                out[i] = ctr[i] ^= in[i];
-            }
-        } else {
-            for (i = 0; i < plen; i++) {
-                unsigned char c = in[i];
-                out[i] = ctr[i] ^ c;
-                ctr[i] = c;
-            }
-        }
-
-        in += i;
-        out += i;
-
-        tail = (0 - i) & (POLY1305_BLOCK_SIZE - 1);
-        memset(ctr + i, 0, tail);
-        ctr += i + tail;
-        tohash_len += i + tail;
-    }
-#endif
-    else {
-        actx->key.counter[0] = 0;
-        ChaCha20_ctr32(buf, zero, (buf_len = CHACHA_BLK_SIZE),
-            actx->key.key.d, actx->key.counter);
-        Poly1305_Init(POLY1305_ctx(actx), buf);
-        actx->key.counter[0] = 1;
-        actx->key.partial_len = 0;
-        Poly1305_Update(POLY1305_ctx(actx), actx->tls_aad, POLY1305_BLOCK_SIZE);
-        tohash = ctr;
-        tohash_len = 0;
-        actx->len.aad = EVP_AEAD_TLS1_AAD_LEN;
-        actx->len.text = plen;
-
-        if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            ChaCha20_ctr32(out, in, plen, actx->key.key.d, actx->key.counter);
-            Poly1305_Update(POLY1305_ctx(actx), out, plen);
-        } else {
-            Poly1305_Update(POLY1305_ctx(actx), in, plen);
-            ChaCha20_ctr32(out, in, plen, actx->key.key.d, actx->key.counter);
-        }
-
-        in += plen;
-        out += plen;
-        tail = (0 - plen) & (POLY1305_BLOCK_SIZE - 1);
-        Poly1305_Update(POLY1305_ctx(actx), zero, tail);
-    }
-
-    {
-        DECLARE_IS_ENDIAN;
-
-        if (IS_LITTLE_ENDIAN) {
-            memcpy(ctr, (unsigned char *)&actx->len, POLY1305_BLOCK_SIZE);
-        } else {
-            ctr[0] = (unsigned char)(actx->len.aad);
-            ctr[1] = (unsigned char)(actx->len.aad >> 8);
-            ctr[2] = (unsigned char)(actx->len.aad >> 16);
-            ctr[3] = (unsigned char)(actx->len.aad >> 24);
-            ctr[4] = (unsigned char)(actx->len.aad >> 32);
-            ctr[5] = (unsigned char)(actx->len.aad >> 40);
-            ctr[6] = (unsigned char)(actx->len.aad >> 48);
-            ctr[7] = (unsigned char)(actx->len.aad >> 56);
-
-            ctr[8] = (unsigned char)(actx->len.text);
-            ctr[9] = (unsigned char)(actx->len.text >> 8);
-            ctr[10] = (unsigned char)(actx->len.text >> 16);
-            ctr[11] = (unsigned char)(actx->len.text >> 24);
-            ctr[12] = (unsigned char)(actx->len.text >> 32);
-            ctr[13] = (unsigned char)(actx->len.text >> 40);
-            ctr[14] = (unsigned char)(actx->len.text >> 48);
-            ctr[15] = (unsigned char)(actx->len.text >> 56);
-        }
-        tohash_len += POLY1305_BLOCK_SIZE;
-    }
-
-    Poly1305_Update(POLY1305_ctx(actx), tohash, tohash_len);
-    OPENSSL_cleanse(buf, buf_len);
-    Poly1305_Final(POLY1305_ctx(actx),
-        EVP_CIPHER_CTX_is_encrypting(ctx) ? actx->tag : tohash);
-
-    actx->tls_payload_length = NO_TLS_PAYLOAD_LENGTH;
-
-    if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-        memcpy(out, actx->tag, POLY1305_BLOCK_SIZE);
-    } else {
-        if (CRYPTO_memcmp(tohash, in, POLY1305_BLOCK_SIZE)) {
-            memset(out - (len - POLY1305_BLOCK_SIZE), 0,
-                len - POLY1305_BLOCK_SIZE);
-            return -1;
-        }
-    }
-
-    return len;
-}
-#else
-static const unsigned char zero[CHACHA_BLK_SIZE] = { 0 };
-#endif
-
-static int chacha20_poly1305_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_CHACHA_AEAD_CTX *actx = aead_data(ctx);
-    size_t rem, plen = actx->tls_payload_length;
-
-    if (!actx->mac_inited) {
-#if !defined(OPENSSL_SMALL_FOOTPRINT)
-        if (plen != NO_TLS_PAYLOAD_LENGTH && out != NULL)
-            return chacha20_poly1305_tls_cipher(ctx, out, in, len);
-#endif
-        actx->key.counter[0] = 0;
-        ChaCha20_ctr32(actx->key.buf, zero, CHACHA_BLK_SIZE,
-            actx->key.key.d, actx->key.counter);
-        Poly1305_Init(POLY1305_ctx(actx), actx->key.buf);
-        actx->key.counter[0] = 1;
-        actx->key.partial_len = 0;
-        actx->len.aad = actx->len.text = 0;
-        actx->mac_inited = 1;
-        if (plen != NO_TLS_PAYLOAD_LENGTH) {
-            Poly1305_Update(POLY1305_ctx(actx), actx->tls_aad,
-                EVP_AEAD_TLS1_AAD_LEN);
-            actx->len.aad = EVP_AEAD_TLS1_AAD_LEN;
-            actx->aad = 1;
-        }
-    }
-
-    if (in) { /* aad or text */
-        if (out == NULL) { /* aad */
-            Poly1305_Update(POLY1305_ctx(actx), in, len);
-            actx->len.aad += len;
-            actx->aad = 1;
-            return len;
-        } else { /* plain- or ciphertext */
-            if (actx->aad) { /* wrap up aad */
-                if ((rem = (size_t)actx->len.aad % POLY1305_BLOCK_SIZE))
-                    Poly1305_Update(POLY1305_ctx(actx), zero,
-                        POLY1305_BLOCK_SIZE - rem);
-                actx->aad = 0;
-            }
-
-            actx->tls_payload_length = NO_TLS_PAYLOAD_LENGTH;
-            if (plen == NO_TLS_PAYLOAD_LENGTH)
-                plen = len;
-            else if (len != plen + POLY1305_BLOCK_SIZE)
-                return -1;
-
-            if (EVP_CIPHER_CTX_is_encrypting(ctx)) { /* plaintext */
-                chacha_cipher(ctx, out, in, plen);
-                Poly1305_Update(POLY1305_ctx(actx), out, plen);
-                in += plen;
-                out += plen;
-                actx->len.text += plen;
-            } else { /* ciphertext */
-                Poly1305_Update(POLY1305_ctx(actx), in, plen);
-                chacha_cipher(ctx, out, in, plen);
-                in += plen;
-                out += plen;
-                actx->len.text += plen;
-            }
-        }
-    }
-    if (in == NULL /* explicit final */
-        || plen != len) { /* or tls mode */
-        DECLARE_IS_ENDIAN;
-        unsigned char temp[POLY1305_BLOCK_SIZE];
-
-        if (actx->aad) { /* wrap up aad */
-            if ((rem = (size_t)actx->len.aad % POLY1305_BLOCK_SIZE))
-                Poly1305_Update(POLY1305_ctx(actx), zero,
-                    POLY1305_BLOCK_SIZE - rem);
-            actx->aad = 0;
-        }
-
-        if ((rem = (size_t)actx->len.text % POLY1305_BLOCK_SIZE))
-            Poly1305_Update(POLY1305_ctx(actx), zero,
-                POLY1305_BLOCK_SIZE - rem);
-
-        if (IS_LITTLE_ENDIAN) {
-            Poly1305_Update(POLY1305_ctx(actx),
-                (unsigned char *)&actx->len, POLY1305_BLOCK_SIZE);
-        } else {
-            temp[0] = (unsigned char)(actx->len.aad);
-            temp[1] = (unsigned char)(actx->len.aad >> 8);
-            temp[2] = (unsigned char)(actx->len.aad >> 16);
-            temp[3] = (unsigned char)(actx->len.aad >> 24);
-            temp[4] = (unsigned char)(actx->len.aad >> 32);
-            temp[5] = (unsigned char)(actx->len.aad >> 40);
-            temp[6] = (unsigned char)(actx->len.aad >> 48);
-            temp[7] = (unsigned char)(actx->len.aad >> 56);
-
-            temp[8] = (unsigned char)(actx->len.text);
-            temp[9] = (unsigned char)(actx->len.text >> 8);
-            temp[10] = (unsigned char)(actx->len.text >> 16);
-            temp[11] = (unsigned char)(actx->len.text >> 24);
-            temp[12] = (unsigned char)(actx->len.text >> 32);
-            temp[13] = (unsigned char)(actx->len.text >> 40);
-            temp[14] = (unsigned char)(actx->len.text >> 48);
-            temp[15] = (unsigned char)(actx->len.text >> 56);
-
-            Poly1305_Update(POLY1305_ctx(actx), temp, POLY1305_BLOCK_SIZE);
-        }
-        Poly1305_Final(POLY1305_ctx(actx),
-            EVP_CIPHER_CTX_is_encrypting(ctx) ? actx->tag : temp);
-        actx->mac_inited = 0;
-
-        if (in != NULL && len != plen) { /* tls mode */
-            if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-                memcpy(out, actx->tag, POLY1305_BLOCK_SIZE);
-            } else {
-                if (CRYPTO_memcmp(temp, in, POLY1305_BLOCK_SIZE)) {
-                    memset(out - plen, 0, plen);
-                    return -1;
-                }
-            }
-        } else if (!EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            if (CRYPTO_memcmp(temp, actx->tag, actx->tag_len))
-                return -1;
-        }
-    }
-    return len;
-}
-
-static int chacha20_poly1305_cleanup(EVP_CIPHER_CTX *ctx)
-{
-    EVP_CHACHA_AEAD_CTX *actx = aead_data(ctx);
-    if (actx)
-        OPENSSL_cleanse(ctx->cipher_data, sizeof(*actx) + Poly1305_ctx_size());
-    return 1;
-}
-
-static int chacha20_poly1305_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
-    void *ptr)
-{
-    EVP_CHACHA_AEAD_CTX *actx = aead_data(ctx);
-
-    switch (type) {
-    case EVP_CTRL_INIT:
-        if (actx == NULL)
-            actx = ctx->cipher_data
-                = OPENSSL_zalloc(sizeof(*actx) + Poly1305_ctx_size());
-        if (actx == NULL) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
-            return 0;
-        }
-        actx->len.aad = 0;
-        actx->len.text = 0;
-        actx->aad = 0;
-        actx->mac_inited = 0;
-        actx->tag_len = 0;
-        actx->nonce_len = 12;
-        actx->tls_payload_length = NO_TLS_PAYLOAD_LENGTH;
-        memset(actx->tls_aad, 0, POLY1305_BLOCK_SIZE);
-        return 1;
-
-    case EVP_CTRL_COPY:
-        if (actx) {
-            EVP_CIPHER_CTX *dst = (EVP_CIPHER_CTX *)ptr;
-
-            dst->cipher_data = OPENSSL_memdup(actx, sizeof(*actx) + Poly1305_ctx_size());
-            if (dst->cipher_data == NULL) {
-                ERR_raise(ERR_LIB_EVP, EVP_R_COPY_ERROR);
-                return 0;
-            }
-        }
-        return 1;
-
-    case EVP_CTRL_GET_IVLEN:
-        *(int *)ptr = actx->nonce_len;
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_IVLEN:
-        if (arg <= 0 || arg > CHACHA20_POLY1305_MAX_IVLEN)
-            return 0;
-        actx->nonce_len = arg;
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_IV_FIXED:
-        if (arg != 12)
-            return 0;
-        actx->nonce[0] = actx->key.counter[1]
-            = CHACHA_U8TOU32((unsigned char *)ptr);
-        actx->nonce[1] = actx->key.counter[2]
-            = CHACHA_U8TOU32((unsigned char *)ptr + 4);
-        actx->nonce[2] = actx->key.counter[3]
-            = CHACHA_U8TOU32((unsigned char *)ptr + 8);
-        return 1;
-
-    case EVP_CTRL_AEAD_SET_TAG:
-        if (arg <= 0 || arg > POLY1305_BLOCK_SIZE)
-            return 0;
-        if (ptr != NULL) {
-            memcpy(actx->tag, ptr, arg);
-            actx->tag_len = arg;
-        }
-        return 1;
-
-    case EVP_CTRL_AEAD_GET_TAG:
-        if (arg <= 0 || arg > POLY1305_BLOCK_SIZE || !EVP_CIPHER_CTX_is_encrypting(ctx))
-            return 0;
-        memcpy(ptr, actx->tag, arg);
-        return 1;
-
-    case EVP_CTRL_AEAD_TLS1_AAD:
-        if (arg != EVP_AEAD_TLS1_AAD_LEN)
-            return 0;
-        {
-            unsigned int len;
-            unsigned char *aad = ptr;
-
-            memcpy(actx->tls_aad, ptr, EVP_AEAD_TLS1_AAD_LEN);
-            len = aad[EVP_AEAD_TLS1_AAD_LEN - 2] << 8 | aad[EVP_AEAD_TLS1_AAD_LEN - 1];
-            aad = actx->tls_aad;
-            if (!EVP_CIPHER_CTX_is_encrypting(ctx)) {
-                if (len < POLY1305_BLOCK_SIZE)
-                    return 0;
-                len -= POLY1305_BLOCK_SIZE; /* discount attached tag */
-                aad[EVP_AEAD_TLS1_AAD_LEN - 2] = (unsigned char)(len >> 8);
-                aad[EVP_AEAD_TLS1_AAD_LEN - 1] = (unsigned char)len;
-            }
-            actx->tls_payload_length = len;
-
-            /*
-             * merge record sequence number as per RFC7905
-             */
-            actx->key.counter[1] = actx->nonce[0];
-            actx->key.counter[2] = actx->nonce[1] ^ CHACHA_U8TOU32(aad);
-            actx->key.counter[3] = actx->nonce[2] ^ CHACHA_U8TOU32(aad + 4);
-            actx->mac_inited = 0;
-
-            return POLY1305_BLOCK_SIZE; /* tag length */
-        }
-
-    case EVP_CTRL_AEAD_SET_MAC_KEY:
-        /* no-op */
-        return 1;
-
-    default:
-        return -1;
-    }
-}
-
-static EVP_CIPHER chacha20_poly1305 = {
+static const EVP_CIPHER chacha20_poly1305 = {
     NID_chacha20_poly1305,
     1, /* block_size */
     CHACHA_KEY_SIZE, /* key_len */
     12, /* iv_len, 96-bit nonce in the context */
     EVP_CIPH_FLAG_AEAD_CIPHER | EVP_CIPH_CUSTOM_IV | EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CTRL_INIT | EVP_CIPH_CUSTOM_COPY | EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_CUSTOM_IV_LENGTH,
-    EVP_ORIG_GLOBAL,
-    chacha20_poly1305_init_key,
-    chacha20_poly1305_cipher,
-    chacha20_poly1305_cleanup,
-    0, /* 0 moves context-specific structure allocation to ctrl */
-    NULL, /* set_asn1_parameters */
-    NULL, /* get_asn1_parameters */
-    chacha20_poly1305_ctrl,
-    NULL /* app_data */
+    EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_chacha20_poly1305(void)
 {
-    return (&chacha20_poly1305);
+    return &chacha20_poly1305;
 }
 #endif
+#else
+NON_EMPTY_TRANSLATION_UNIT
 #endif
diff --git a/deps/openssl/openssl/crypto/evp/e_des.c b/deps/openssl/openssl/crypto/evp/e_des.c
index 9c9080025c1..875f1863403 100644
--- a/deps/openssl/openssl/crypto/evp/e_des.c
+++ b/deps/openssl/openssl/crypto/evp/e_des.c
@@ -7,239 +7,20 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * DES low level APIs are deprecated for public use, but still ok for internal
- * use.
- */
-#include "internal/deprecated.h"
+#include <openssl/macros.h>

-#include <stdio.h>
-#include "internal/cryptlib.h"
 #ifndef OPENSSL_NO_DES
-#include <openssl/evp.h>
-#include <openssl/objects.h>
 #include "crypto/evp.h"
-#include <openssl/des.h>
-#include <openssl/rand.h>
-#include "evp_local.h"
-
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        DES_key_schedule ks;
-    } ks;
-    union {
-        void (*cbc)(const void *, void *, size_t,
-            const DES_key_schedule *, unsigned char *);
-    } stream;
-} EVP_DES_KEY;
-
-#if defined(AES_ASM) && (defined(__sparc) || defined(__sparc__))
-/* ----------^^^ this is not a typo, just a way to detect that
- * assembler support was in general requested... */
-#include "crypto/sparc_arch.h"
-
-#define SPARC_DES_CAPABLE (OPENSSL_sparcv9cap_P[1] & CFR_DES)
-
-void des_t4_key_expand(const void *key, DES_key_schedule *ks);
-void des_t4_cbc_encrypt(const void *inp, void *out, size_t len,
-    const DES_key_schedule *ks, unsigned char iv[8]);
-void des_t4_cbc_decrypt(const void *inp, void *out, size_t len,
-    const DES_key_schedule *ks, unsigned char iv[8]);
-#endif
-
-static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-static int des_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
-
-/*
- * Because of various casts and different names can't use
- * IMPLEMENT_BLOCK_CIPHER
- */
-
-static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    BLOCK_CIPHER_ecb_loop()
-        DES_ecb_encrypt((DES_cblock *)(in + i), (DES_cblock *)(out + i),
-            EVP_CIPHER_CTX_get_cipher_data(ctx),
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-    return 1;
-}
-
-static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    while (inl >= EVP_MAXCHUNK) {
-        int num = EVP_CIPHER_CTX_get_num(ctx);
-        DES_ofb64_encrypt(in, out, (long)EVP_MAXCHUNK,
-            EVP_CIPHER_CTX_get_cipher_data(ctx),
-            (DES_cblock *)ctx->iv, &num);
-        EVP_CIPHER_CTX_set_num(ctx, num);
-        inl -= EVP_MAXCHUNK;
-        in += EVP_MAXCHUNK;
-        out += EVP_MAXCHUNK;
-    }
-    if (inl) {
-        int num = EVP_CIPHER_CTX_get_num(ctx);
-        DES_ofb64_encrypt(in, out, (long)inl,
-            EVP_CIPHER_CTX_get_cipher_data(ctx),
-            (DES_cblock *)ctx->iv, &num);
-        EVP_CIPHER_CTX_set_num(ctx, num);
-    }
-    return 1;
-}
-
-static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    EVP_DES_KEY *dat = (EVP_DES_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-
-    if (dat->stream.cbc != NULL) {
-        (*dat->stream.cbc)(in, out, inl, &dat->ks.ks, ctx->iv);
-        return 1;
-    }
-    while (inl >= EVP_MAXCHUNK) {
-        DES_ncbc_encrypt(in, out, (long)EVP_MAXCHUNK,
-            EVP_CIPHER_CTX_get_cipher_data(ctx),
-            (DES_cblock *)ctx->iv,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-        inl -= EVP_MAXCHUNK;
-        in += EVP_MAXCHUNK;
-        out += EVP_MAXCHUNK;
-    }
-    if (inl)
-        DES_ncbc_encrypt(in, out, (long)inl,
-            EVP_CIPHER_CTX_get_cipher_data(ctx),
-            (DES_cblock *)ctx->iv,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-    return 1;
-}
-
-static int des_cfb64_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    while (inl >= EVP_MAXCHUNK) {
-        int num = EVP_CIPHER_CTX_get_num(ctx);
-        DES_cfb64_encrypt(in, out, (long)EVP_MAXCHUNK,
-            EVP_CIPHER_CTX_get_cipher_data(ctx),
-            (DES_cblock *)ctx->iv, &num,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-        EVP_CIPHER_CTX_set_num(ctx, num);
-        inl -= EVP_MAXCHUNK;
-        in += EVP_MAXCHUNK;
-        out += EVP_MAXCHUNK;
-    }
-    if (inl) {
-        int num = EVP_CIPHER_CTX_get_num(ctx);
-        DES_cfb64_encrypt(in, out, (long)inl,
-            EVP_CIPHER_CTX_get_cipher_data(ctx),
-            (DES_cblock *)ctx->iv, &num,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-        EVP_CIPHER_CTX_set_num(ctx, num);
-    }
-    return 1;
-}
-
-/*
- * Although we have a CFB-r implementation for DES, it doesn't pack the right
- * way, so wrap it here
- */
-static int des_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    size_t n, chunk = EVP_MAXCHUNK / 8;
-    unsigned char c[1];
-    unsigned char d[1] = { 0 }; /* Appease Coverity */
-
-    if (inl < chunk)
-        chunk = inl;
-
-    while (inl && inl >= chunk) {
-        for (n = 0; n < chunk * 8; ++n) {
-            c[0] = (in[n / 8] & (1 << (7 - n % 8))) ? 0x80 : 0;
-            DES_cfb_encrypt(c, d, 1, 1, EVP_CIPHER_CTX_get_cipher_data(ctx),
-                (DES_cblock *)ctx->iv,
-                EVP_CIPHER_CTX_is_encrypting(ctx));
-            out[n / 8] = (out[n / 8] & ~(0x80 >> (unsigned int)(n % 8))) | ((d[0] & 0x80) >> (unsigned int)(n % 8));
-        }
-        inl -= chunk;
-        in += chunk;
-        out += chunk;
-        if (inl < chunk)
-            chunk = inl;
-    }
-
-    return 1;
-}
-
-static int des_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    while (inl >= EVP_MAXCHUNK) {
-        DES_cfb_encrypt(in, out, 8, (long)EVP_MAXCHUNK,
-            EVP_CIPHER_CTX_get_cipher_data(ctx),
-            (DES_cblock *)ctx->iv,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-        inl -= EVP_MAXCHUNK;
-        in += EVP_MAXCHUNK;
-        out += EVP_MAXCHUNK;
-    }
-    if (inl)
-        DES_cfb_encrypt(in, out, 8, (long)inl,
-            EVP_CIPHER_CTX_get_cipher_data(ctx),
-            (DES_cblock *)ctx->iv,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-    return 1;
-}

 BLOCK_CIPHER_defs(des, EVP_DES_KEY, NID_des, 8, 8, 8, 64,
-    EVP_CIPH_RAND_KEY, des_init_key, NULL,
-    EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, des_ctrl)
+    EVP_CIPH_RAND_KEY)

 BLOCK_CIPHER_def_cfb(des, EVP_DES_KEY, NID_des, 8, 8, 1,
-    EVP_CIPH_RAND_KEY, des_init_key, NULL,
-    EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, des_ctrl)
+    EVP_CIPH_RAND_KEY)

 BLOCK_CIPHER_def_cfb(des, EVP_DES_KEY, NID_des, 8, 8, 8,
-    EVP_CIPH_RAND_KEY, des_init_key, NULL,
-    EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, des_ctrl)
-
-static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    DES_cblock *deskey = (DES_cblock *)key;
-    EVP_DES_KEY *dat = (EVP_DES_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-
-    dat->stream.cbc = NULL;
-#if defined(SPARC_DES_CAPABLE)
-    if (SPARC_DES_CAPABLE) {
-        int mode = EVP_CIPHER_CTX_get_mode(ctx);
-
-        if (mode == EVP_CIPH_CBC_MODE) {
-            des_t4_key_expand(key, &dat->ks.ks);
-            dat->stream.cbc = enc ? des_t4_cbc_encrypt : des_t4_cbc_decrypt;
-            return 1;
-        }
-    }
-#endif
-    DES_set_key_unchecked(deskey, EVP_CIPHER_CTX_get_cipher_data(ctx));
-    return 1;
-}
-
-static int des_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
-{
-
-    switch (type) {
-    case EVP_CTRL_RAND_KEY:
-        if (RAND_priv_bytes(ptr, 8) <= 0)
-            return 0;
-        DES_set_odd_parity((DES_cblock *)ptr);
-        return 1;
-
-    default:
-        return -1;
-    }
-}
+    EVP_CIPH_RAND_KEY)

+#else
+NON_EMPTY_TRANSLATION_UNIT
 #endif
diff --git a/deps/openssl/openssl/crypto/evp/e_des3.c b/deps/openssl/openssl/crypto/evp/e_des3.c
index 13abdda138f..1c22537fb89 100644
--- a/deps/openssl/openssl/crypto/evp/e_des3.c
+++ b/deps/openssl/openssl/crypto/evp/e_des3.c
@@ -7,295 +7,22 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * DES low level APIs are deprecated for public use, but still ok for internal
- * use.
- */
-#include "internal/deprecated.h"
+#include <openssl/macros.h>

-#include <stdio.h>
-#include "internal/cryptlib.h"
 #ifndef OPENSSL_NO_DES
-#include <openssl/objects.h>
 #include "crypto/evp.h"
-#include "crypto/sha.h"
-#include <openssl/des.h>
-#include <openssl/rand.h>
-#include "evp_local.h"
-
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        DES_key_schedule ks[3];
-    } ks;
-    union {
-        void (*cbc)(const void *, void *, size_t,
-            const DES_key_schedule *, unsigned char *);
-    } stream;
-} DES_EDE_KEY;
-#define ks1 ks.ks[0]
-#define ks2 ks.ks[1]
-#define ks3 ks.ks[2]
-
-#if defined(AES_ASM) && (defined(__sparc) || defined(__sparc__))
-/* ---------^^^ this is not a typo, just a way to detect that
- * assembler support was in general requested... */
-#include "crypto/sparc_arch.h"
-
-#define SPARC_DES_CAPABLE (OPENSSL_sparcv9cap_P[1] & CFR_DES)
-
-void des_t4_key_expand(const void *key, DES_key_schedule *ks);
-void des_t4_ede3_cbc_encrypt(const void *inp, void *out, size_t len,
-    const DES_key_schedule ks[3], unsigned char iv[8]);
-void des_t4_ede3_cbc_decrypt(const void *inp, void *out, size_t len,
-    const DES_key_schedule ks[3], unsigned char iv[8]);
-#endif
-
-static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-
-static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-
-static int des3_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
-
-#define data(ctx) EVP_C_DATA(DES_EDE_KEY, ctx)
-
-/*
- * Because of various casts and different args can't use
- * IMPLEMENT_BLOCK_CIPHER
- */
-
-static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    BLOCK_CIPHER_ecb_loop()
-        DES_ecb3_encrypt((const_DES_cblock *)(in + i),
-            (DES_cblock *)(out + i),
-            &data(ctx)->ks1, &data(ctx)->ks2,
-            &data(ctx)->ks3, EVP_CIPHER_CTX_is_encrypting(ctx));
-    return 1;
-}
-
-static int des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    while (inl >= EVP_MAXCHUNK) {
-        int num = EVP_CIPHER_CTX_get_num(ctx);
-        DES_ede3_ofb64_encrypt(in, out, (long)EVP_MAXCHUNK,
-            &data(ctx)->ks1, &data(ctx)->ks2,
-            &data(ctx)->ks3,
-            (DES_cblock *)ctx->iv,
-            &num);
-        EVP_CIPHER_CTX_set_num(ctx, num);
-        inl -= EVP_MAXCHUNK;
-        in += EVP_MAXCHUNK;
-        out += EVP_MAXCHUNK;
-    }
-    if (inl) {
-        int num = EVP_CIPHER_CTX_get_num(ctx);
-        DES_ede3_ofb64_encrypt(in, out, (long)inl,
-            &data(ctx)->ks1, &data(ctx)->ks2,
-            &data(ctx)->ks3,
-            (DES_cblock *)ctx->iv,
-            &num);
-        EVP_CIPHER_CTX_set_num(ctx, num);
-    }
-    return 1;
-}
-
-static int des_ede_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    DES_EDE_KEY *dat = data(ctx);
-
-    if (dat->stream.cbc != NULL) {
-        (*dat->stream.cbc)(in, out, inl, dat->ks.ks,
-            ctx->iv);
-        return 1;
-    }
-
-    while (inl >= EVP_MAXCHUNK) {
-        DES_ede3_cbc_encrypt(in, out, (long)EVP_MAXCHUNK,
-            &dat->ks1, &dat->ks2, &dat->ks3,
-            (DES_cblock *)ctx->iv,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-        inl -= EVP_MAXCHUNK;
-        in += EVP_MAXCHUNK;
-        out += EVP_MAXCHUNK;
-    }
-    if (inl)
-        DES_ede3_cbc_encrypt(in, out, (long)inl,
-            &dat->ks1, &dat->ks2, &dat->ks3,
-            (DES_cblock *)ctx->iv,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-    return 1;
-}
-
-static int des_ede_cfb64_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    while (inl >= EVP_MAXCHUNK) {
-        int num = EVP_CIPHER_CTX_get_num(ctx);
-        DES_ede3_cfb64_encrypt(in, out, (long)EVP_MAXCHUNK,
-            &data(ctx)->ks1, &data(ctx)->ks2,
-            &data(ctx)->ks3, (DES_cblock *)ctx->iv,
-            &num, EVP_CIPHER_CTX_is_encrypting(ctx));
-        EVP_CIPHER_CTX_set_num(ctx, num);
-        inl -= EVP_MAXCHUNK;
-        in += EVP_MAXCHUNK;
-        out += EVP_MAXCHUNK;
-    }
-    if (inl) {
-        int num = EVP_CIPHER_CTX_get_num(ctx);
-        DES_ede3_cfb64_encrypt(in, out, (long)inl,
-            &data(ctx)->ks1, &data(ctx)->ks2,
-            &data(ctx)->ks3, (DES_cblock *)ctx->iv,
-            &num, EVP_CIPHER_CTX_is_encrypting(ctx));
-        EVP_CIPHER_CTX_set_num(ctx, num);
-    }
-    return 1;
-}
-
-/*
- * Although we have a CFB-r implementation for 3-DES, it doesn't pack the
- * right way, so wrap it here
- */
-static int des_ede3_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    size_t n;
-    unsigned char c[1];
-    unsigned char d[1] = { 0 }; /* Appease Coverity */
-
-    if (!EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS))
-        inl *= 8;
-    for (n = 0; n < inl; ++n) {
-        c[0] = (in[n / 8] & (1 << (7 - n % 8))) ? 0x80 : 0;
-        DES_ede3_cfb_encrypt(c, d, 1, 1,
-            &data(ctx)->ks1, &data(ctx)->ks2,
-            &data(ctx)->ks3, (DES_cblock *)ctx->iv,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-        out[n / 8] = (out[n / 8] & ~(0x80 >> (unsigned int)(n % 8)))
-            | ((d[0] & 0x80) >> (unsigned int)(n % 8));
-    }
-
-    return 1;
-}
-
-static int des_ede3_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    while (inl >= EVP_MAXCHUNK) {
-        DES_ede3_cfb_encrypt(in, out, 8, (long)EVP_MAXCHUNK,
-            &data(ctx)->ks1, &data(ctx)->ks2,
-            &data(ctx)->ks3, (DES_cblock *)ctx->iv,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-        inl -= EVP_MAXCHUNK;
-        in += EVP_MAXCHUNK;
-        out += EVP_MAXCHUNK;
-    }
-    if (inl)
-        DES_ede3_cfb_encrypt(in, out, 8, (long)inl,
-            &data(ctx)->ks1, &data(ctx)->ks2,
-            &data(ctx)->ks3, (DES_cblock *)ctx->iv,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-    return 1;
-}

 BLOCK_CIPHER_defs(des_ede, DES_EDE_KEY, NID_des_ede, 8, 16, 8, 64,
-    EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1,
-    des_ede_init_key, NULL, NULL, NULL, des3_ctrl)
-#define des_ede3_cfb64_cipher des_ede_cfb64_cipher
-#define des_ede3_ofb_cipher des_ede_ofb_cipher
-#define des_ede3_cbc_cipher des_ede_cbc_cipher
-#define des_ede3_ecb_cipher des_ede_ecb_cipher
+    EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1)
+
 BLOCK_CIPHER_defs(des_ede3, DES_EDE_KEY, NID_des_ede3, 8, 24, 8, 64,
-    EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1,
-    des_ede3_init_key, NULL, NULL, NULL, des3_ctrl)
+    EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1)

 BLOCK_CIPHER_def_cfb(des_ede3, DES_EDE_KEY, NID_des_ede3, 24, 8, 1,
-    EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1,
-    des_ede3_init_key, NULL, NULL, NULL, des3_ctrl)
+    EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1)

 BLOCK_CIPHER_def_cfb(des_ede3, DES_EDE_KEY, NID_des_ede3, 24, 8, 8,
-    EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1,
-    des_ede3_init_key, NULL, NULL, NULL, des3_ctrl)
-
-static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    DES_cblock *deskey = (DES_cblock *)key;
-    DES_EDE_KEY *dat = data(ctx);
-
-    dat->stream.cbc = NULL;
-#if defined(SPARC_DES_CAPABLE)
-    if (SPARC_DES_CAPABLE) {
-        int mode = EVP_CIPHER_CTX_get_mode(ctx);
-
-        if (mode == EVP_CIPH_CBC_MODE) {
-            des_t4_key_expand(&deskey[0], &dat->ks1);
-            des_t4_key_expand(&deskey[1], &dat->ks2);
-            memcpy(&dat->ks3, &dat->ks1, sizeof(dat->ks1));
-            dat->stream.cbc = enc ? des_t4_ede3_cbc_encrypt : des_t4_ede3_cbc_decrypt;
-            return 1;
-        }
-    }
-#endif
-    DES_set_key_unchecked(&deskey[0], &dat->ks1);
-    DES_set_key_unchecked(&deskey[1], &dat->ks2);
-    memcpy(&dat->ks3, &dat->ks1, sizeof(dat->ks1));
-    return 1;
-}
-
-static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    DES_cblock *deskey = (DES_cblock *)key;
-    DES_EDE_KEY *dat = data(ctx);
-
-    dat->stream.cbc = NULL;
-#if defined(SPARC_DES_CAPABLE)
-    if (SPARC_DES_CAPABLE) {
-        int mode = EVP_CIPHER_CTX_get_mode(ctx);
-
-        if (mode == EVP_CIPH_CBC_MODE) {
-            des_t4_key_expand(&deskey[0], &dat->ks1);
-            des_t4_key_expand(&deskey[1], &dat->ks2);
-            des_t4_key_expand(&deskey[2], &dat->ks3);
-            dat->stream.cbc = enc ? des_t4_ede3_cbc_encrypt : des_t4_ede3_cbc_decrypt;
-            return 1;
-        }
-    }
-#endif
-    DES_set_key_unchecked(&deskey[0], &dat->ks1);
-    DES_set_key_unchecked(&deskey[1], &dat->ks2);
-    DES_set_key_unchecked(&deskey[2], &dat->ks3);
-    return 1;
-}
-
-static int des3_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
-{
-
-    DES_cblock *deskey = ptr;
-    int kl;
-
-    switch (type) {
-    case EVP_CTRL_RAND_KEY:
-        kl = EVP_CIPHER_CTX_get_key_length(ctx);
-        if (kl < 0 || RAND_priv_bytes(ptr, kl) <= 0)
-            return 0;
-        DES_set_odd_parity(deskey);
-        if (kl >= 16)
-            DES_set_odd_parity(deskey + 1);
-        if (kl >= 24)
-            DES_set_odd_parity(deskey + 2);
-        return 1;
-
-    default:
-        return -1;
-    }
-}
+    EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1)

 const EVP_CIPHER *EVP_des_ede(void)
 {
@@ -307,113 +34,12 @@ const EVP_CIPHER *EVP_des_ede3(void)
     return &des_ede3_ecb;
 }

-#include <openssl/sha.h>
-
-static const unsigned char wrap_iv[8] = {
-    0x4a, 0xdd, 0xa2, 0x2c, 0x79, 0xe8, 0x21, 0x05
-};
-
-static int des_ede3_unwrap(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    unsigned char icv[8], iv[8], sha1tmp[SHA_DIGEST_LENGTH];
-    int rv = -1;
-    if (inl < 24)
-        return -1;
-    if (out == NULL)
-        return inl - 16;
-    memcpy(ctx->iv, wrap_iv, 8);
-    /* Decrypt first block which will end up as icv */
-    des_ede_cbc_cipher(ctx, icv, in, 8);
-    /* Decrypt central blocks */
-    /*
-     * If decrypting in place move whole output along a block so the next
-     * des_ede_cbc_cipher is in place.
-     */
-    if (out == in) {
-        memmove(out, out + 8, inl - 8);
-        in -= 8;
-    }
-    des_ede_cbc_cipher(ctx, out, in + 8, inl - 16);
-    /* Decrypt final block which will be IV */
-    des_ede_cbc_cipher(ctx, iv, in + inl - 8, 8);
-    /* Reverse order of everything */
-    BUF_reverse(icv, NULL, 8);
-    BUF_reverse(out, NULL, inl - 16);
-    BUF_reverse(ctx->iv, iv, 8);
-    /* Decrypt again using new IV */
-    des_ede_cbc_cipher(ctx, out, out, inl - 16);
-    des_ede_cbc_cipher(ctx, icv, icv, 8);
-    if (ossl_sha1(out, inl - 16, sha1tmp) /* Work out hash of first portion */
-        && CRYPTO_memcmp(sha1tmp, icv, 8) == 0)
-        rv = inl - 16;
-    OPENSSL_cleanse(icv, 8);
-    OPENSSL_cleanse(sha1tmp, SHA_DIGEST_LENGTH);
-    OPENSSL_cleanse(iv, 8);
-    OPENSSL_cleanse(ctx->iv, 8);
-    if (rv == -1)
-        OPENSSL_cleanse(out, inl - 16);
-
-    return rv;
-}
-
-static int des_ede3_wrap(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    unsigned char sha1tmp[SHA_DIGEST_LENGTH];
-    if (out == NULL)
-        return inl + 16;
-    /* Copy input to output buffer + 8 so we have space for IV */
-    memmove(out + 8, in, inl);
-    /* Work out ICV */
-    if (!ossl_sha1(in, inl, sha1tmp))
-        return -1;
-    memcpy(out + inl + 8, sha1tmp, 8);
-    OPENSSL_cleanse(sha1tmp, SHA_DIGEST_LENGTH);
-    /* Generate random IV */
-    if (RAND_bytes(ctx->iv, 8) <= 0)
-        return -1;
-    memcpy(out, ctx->iv, 8);
-    /* Encrypt everything after IV in place */
-    des_ede_cbc_cipher(ctx, out + 8, out + 8, inl + 8);
-    BUF_reverse(out, NULL, inl + 16);
-    memcpy(ctx->iv, wrap_iv, 8);
-    des_ede_cbc_cipher(ctx, out, out, inl + 16);
-    return inl + 16;
-}
-
-static int des_ede3_wrap_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    /*
-     * Sanity check input length: we typically only wrap keys so EVP_MAXCHUNK
-     * is more than will ever be needed. Also input length must be a multiple
-     * of 8 bits.
-     */
-    if (inl >= EVP_MAXCHUNK || inl % 8)
-        return -1;
-
-    if (ossl_is_partially_overlapping(out, in, inl)) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING);
-        return 0;
-    }
-
-    if (EVP_CIPHER_CTX_is_encrypting(ctx))
-        return des_ede3_wrap(ctx, out, in, inl);
-    else
-        return des_ede3_unwrap(ctx, out, in, inl);
-}
-
 static const EVP_CIPHER des3_wrap = {
     NID_id_smime_alg_CMS3DESwrap,
     8, 24, 0,
     EVP_CIPH_WRAP_MODE | EVP_CIPH_CUSTOM_IV | EVP_CIPH_FLAG_CUSTOM_CIPHER
         | EVP_CIPH_FLAG_DEFAULT_ASN1,
-    EVP_ORIG_GLOBAL,
-    des_ede3_init_key, des_ede3_wrap_cipher,
-    NULL,
-    sizeof(DES_EDE_KEY),
-    NULL, NULL, NULL, NULL
+    EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_des_ede3_wrap(void)
@@ -421,4 +47,6 @@ const EVP_CIPHER *EVP_des_ede3_wrap(void)
     return &des3_wrap;
 }

+#else
+NON_EMPTY_TRANSLATION_UNIT
 #endif
diff --git a/deps/openssl/openssl/crypto/evp/e_idea.c b/deps/openssl/openssl/crypto/evp/e_idea.c
index 6f4f05842f8..ed704672a39 100644
--- a/deps/openssl/openssl/crypto/evp/e_idea.c
+++ b/deps/openssl/openssl/crypto/evp/e_idea.c
@@ -7,72 +7,14 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * IDEA low level APIs are deprecated for public use, but still ok for internal
- * use where we're using them to implement the higher level EVP interface, as is
- * the case here.
- */
-#include "internal/deprecated.h"
-
-#include <stdio.h>
-#include "internal/cryptlib.h"
+#include <openssl/macros.h>

 #ifndef OPENSSL_NO_IDEA
-#include <openssl/evp.h>
-#include <openssl/objects.h>
 #include "crypto/evp.h"
-#include <openssl/idea.h>
-#include "evp_local.h"
-
-/* Can't use IMPLEMENT_BLOCK_CIPHER because IDEA_ecb_encrypt is different */
-
-typedef struct {
-    IDEA_KEY_SCHEDULE ks;
-} EVP_IDEA_KEY;
-
-static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-
-/*
- * NB IDEA_ecb_encrypt doesn't take an 'encrypt' argument so we treat it as a
- * special case
- */
-
-static int idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    BLOCK_CIPHER_ecb_loop()
-        IDEA_ecb_encrypt(in + i, out + i, &EVP_C_DATA(EVP_IDEA_KEY, ctx)->ks);
-    return 1;
-}
-
-BLOCK_CIPHER_func_cbc(idea, IDEA, EVP_IDEA_KEY, ks)
-    BLOCK_CIPHER_func_ofb(idea, IDEA, 64, EVP_IDEA_KEY, ks)
-        BLOCK_CIPHER_func_cfb(idea, IDEA, 64, EVP_IDEA_KEY, ks)
-
-            BLOCK_CIPHER_defs(idea, IDEA_KEY_SCHEDULE, NID_idea, 8, 16, 8, 64,
-                0, idea_init_key, NULL,
-                EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL)
-
-static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    if (!enc) {
-        if (EVP_CIPHER_CTX_get_mode(ctx) == EVP_CIPH_OFB_MODE)
-            enc = 1;
-        else if (EVP_CIPHER_CTX_get_mode(ctx) == EVP_CIPH_CFB_MODE)
-            enc = 1;
-    }
-    if (enc)
-        IDEA_set_encrypt_key(key, &EVP_C_DATA(EVP_IDEA_KEY, ctx)->ks);
-    else {
-        IDEA_KEY_SCHEDULE tmp;

-        IDEA_set_encrypt_key(key, &tmp);
-        IDEA_set_decrypt_key(&tmp, &EVP_C_DATA(EVP_IDEA_KEY, ctx)->ks);
-        OPENSSL_cleanse((unsigned char *)&tmp, sizeof(IDEA_KEY_SCHEDULE));
-    }
-    return 1;
-}
+BLOCK_CIPHER_defs(idea, IDEA_KEY_SCHEDULE, NID_idea, 8, 16, 8, 64,
+    0)

+#else
+NON_EMPTY_TRANSLATION_UNIT
 #endif
diff --git a/deps/openssl/openssl/crypto/evp/e_null.c b/deps/openssl/openssl/crypto/evp/e_null.c
index 1303caa892d..67f3dc299b2 100644
--- a/deps/openssl/openssl/crypto/evp/e_null.c
+++ b/deps/openssl/openssl/crypto/evp/e_null.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,45 +7,15 @@
  * https://www.openssl.org/source/license.html
  */

-#include <stdio.h>
-#include "internal/cryptlib.h"
-#include <openssl/evp.h>
-#include <openssl/objects.h>
 #include "crypto/evp.h"

-static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl);
 static const EVP_CIPHER n_cipher = {
     NID_undef,
     1, 0, 0, 0,
-    EVP_ORIG_GLOBAL,
-    null_init_key,
-    null_cipher,
-    NULL,
-    0,
-    NULL,
-    NULL,
-    NULL,
-    NULL
+    EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_enc_null(void)
 {
     return &n_cipher;
 }
-
-static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    return 1;
-}
-
-static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    if (in != out)
-        memcpy(out, in, inl);
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/evp/e_rc2.c b/deps/openssl/openssl/crypto/evp/e_rc2.c
index 88e359bd44e..3420662c0cf 100644
--- a/deps/openssl/openssl/crypto/evp/e_rc2.c
+++ b/deps/openssl/openssl/crypto/evp/e_rc2.c
@@ -1,82 +1,34 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
-
-/*
- * RC2 low level APIs are deprecated for public use, but still ok for internal
- * use.
- */
-#include "internal/deprecated.h"
-
-#include <stdio.h>
-#include "internal/cryptlib.h"
+#include <openssl/macros.h>

 #ifndef OPENSSL_NO_RC2
-
-#include <openssl/evp.h>
-#include <openssl/objects.h>
 #include "crypto/evp.h"
 #include <openssl/rc2.h>
-#include "evp_local.h"
-
-static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-static int rc2_meth_to_magic(EVP_CIPHER_CTX *ctx);
-static int rc2_magic_to_meth(int i);
-static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
-static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
-static int rc2_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
-
-typedef struct {
-    int key_bits; /* effective key bits */
-    RC2_KEY ks; /* key schedule */
-} EVP_RC2_KEY;
-
-#define data(ctx) EVP_C_DATA(EVP_RC2_KEY, ctx)

 IMPLEMENT_BLOCK_CIPHER(rc2, ks, RC2, EVP_RC2_KEY, NID_rc2,
     8,
     RC2_KEY_LENGTH, 8, 64,
-    EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
-    rc2_init_key, NULL,
-    rc2_set_asn1_type_and_iv, rc2_get_asn1_type_and_iv,
-    rc2_ctrl)
-#define RC2_40_MAGIC 0xa0
-#define RC2_64_MAGIC 0x78
-#define RC2_128_MAGIC 0x3a
+    EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT)
+
 static const EVP_CIPHER r2_64_cbc_cipher = {
     NID_rc2_64_cbc,
     8, 8 /* 64 bit */, 8,
     EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
-    EVP_ORIG_GLOBAL,
-    rc2_init_key,
-    rc2_cbc_cipher,
-    NULL,
-    sizeof(EVP_RC2_KEY),
-    rc2_set_asn1_type_and_iv,
-    rc2_get_asn1_type_and_iv,
-    rc2_ctrl,
-    NULL
+    EVP_ORIG_GLOBAL
 };

 static const EVP_CIPHER r2_40_cbc_cipher = {
     NID_rc2_40_cbc,
     8, 5 /* 40 bit */, 8,
     EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
-    EVP_ORIG_GLOBAL,
-    rc2_init_key,
-    rc2_cbc_cipher,
-    NULL,
-    sizeof(EVP_RC2_KEY),
-    rc2_set_asn1_type_and_iv,
-    rc2_get_asn1_type_and_iv,
-    rc2_ctrl,
-    NULL
+    EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_rc2_64_cbc(void)
@@ -89,111 +41,6 @@ const EVP_CIPHER *EVP_rc2_40_cbc(void)
     return &r2_40_cbc_cipher;
 }

-static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    RC2_set_key(&data(ctx)->ks, EVP_CIPHER_CTX_get_key_length(ctx),
-        key, data(ctx)->key_bits);
-    return 1;
-}
-
-static int rc2_meth_to_magic(EVP_CIPHER_CTX *e)
-{
-    int i;
-
-    if (EVP_CIPHER_CTX_ctrl(e, EVP_CTRL_GET_RC2_KEY_BITS, 0, &i) <= 0)
-        return 0;
-    if (i == 128)
-        return RC2_128_MAGIC;
-    else if (i == 64)
-        return RC2_64_MAGIC;
-    else if (i == 40)
-        return RC2_40_MAGIC;
-    else
-        return 0;
-}
-
-static int rc2_magic_to_meth(int i)
-{
-    if (i == RC2_128_MAGIC)
-        return 128;
-    else if (i == RC2_64_MAGIC)
-        return 64;
-    else if (i == RC2_40_MAGIC)
-        return 40;
-    else {
-        ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_SIZE);
-        return 0;
-    }
-}
-
-static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
-{
-    long num = 0;
-    int i = 0;
-    int key_bits;
-    unsigned int l;
-    unsigned char iv[EVP_MAX_IV_LENGTH];
-
-    if (type != NULL) {
-        l = EVP_CIPHER_CTX_get_iv_length(c);
-        OPENSSL_assert(l <= sizeof(iv));
-        i = ASN1_TYPE_get_int_octetstring(type, &num, iv, l);
-        if (i != (int)l)
-            return -1;
-        key_bits = rc2_magic_to_meth((int)num);
-        if (!key_bits)
-            return -1;
-        if (i > 0 && !EVP_CipherInit_ex(c, NULL, NULL, NULL, iv, -1))
-            return -1;
-        if (EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_RC2_KEY_BITS, key_bits,
-                NULL)
-                <= 0
-            || EVP_CIPHER_CTX_set_key_length(c, key_bits / 8) <= 0)
-            return -1;
-    }
-    return i;
-}
-
-static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
-{
-    long num;
-    int i = 0, j;
-
-    if (type != NULL) {
-        num = rc2_meth_to_magic(c);
-        j = EVP_CIPHER_CTX_get_iv_length(c);
-        i = ASN1_TYPE_set_int_octetstring(type, num, c->oiv, j);
-    }
-    return i;
-}
-
-static int rc2_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
-{
-    switch (type) {
-    case EVP_CTRL_INIT:
-        data(c)->key_bits = EVP_CIPHER_CTX_get_key_length(c) * 8;
-        return 1;
-
-    case EVP_CTRL_GET_RC2_KEY_BITS:
-        *(int *)ptr = data(c)->key_bits;
-        return 1;
-
-    case EVP_CTRL_SET_RC2_KEY_BITS:
-        if (arg > 0) {
-            data(c)->key_bits = arg;
-            return 1;
-        }
-        return 0;
-#ifdef PBE_PRF_TEST
-    case EVP_CTRL_PBE_PRF_NID:
-        *(int *)ptr = NID_hmacWithMD5;
-        return 1;
-#endif
-
-    default:
-        return -1;
-    }
-}
-
+#else
+NON_EMPTY_TRANSLATION_UNIT
 #endif
diff --git a/deps/openssl/openssl/crypto/evp/e_rc4.c b/deps/openssl/openssl/crypto/evp/e_rc4.c
index 7ca5e797e59..0ca5773130c 100644
--- a/deps/openssl/openssl/crypto/evp/e_rc4.c
+++ b/deps/openssl/openssl/crypto/evp/e_rc4.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,61 +7,23 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * RC4 low level APIs are deprecated for public use, but still ok for internal
- * use.
- */
-#include "internal/deprecated.h"
-
-#include <stdio.h>
-#include "internal/cryptlib.h"
+#include <openssl/macros.h>

 #ifndef OPENSSL_NO_RC4
-
-#include <openssl/evp.h>
-#include <openssl/objects.h>
-#include <openssl/rc4.h>
-
 #include "crypto/evp.h"

-typedef struct {
-    RC4_KEY ks; /* working key */
-} EVP_RC4_KEY;
-
-#define data(ctx) ((EVP_RC4_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))
-
-static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl);
 static const EVP_CIPHER r4_cipher = {
     NID_rc4,
     1, EVP_RC4_KEY_SIZE, 0,
     EVP_CIPH_VARIABLE_LENGTH,
-    EVP_ORIG_GLOBAL,
-    rc4_init_key,
-    rc4_cipher,
-    NULL,
-    sizeof(EVP_RC4_KEY),
-    NULL,
-    NULL,
-    NULL,
-    NULL
+    EVP_ORIG_GLOBAL
 };

 static const EVP_CIPHER r4_40_cipher = {
     NID_rc4_40,
     1, 5 /* 40 bit */, 0,
     EVP_CIPH_VARIABLE_LENGTH,
-    EVP_ORIG_GLOBAL,
-    rc4_init_key,
-    rc4_cipher,
-    NULL,
-    sizeof(EVP_RC4_KEY),
-    NULL,
-    NULL,
-    NULL,
-    NULL
+    EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_rc4(void)
@@ -73,22 +35,6 @@ const EVP_CIPHER *EVP_rc4_40(void)
 {
     return &r4_40_cipher;
 }
-
-static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    int keylen;
-
-    if ((keylen = EVP_CIPHER_CTX_get_key_length(ctx)) <= 0)
-        return 0;
-    RC4_set_key(&data(ctx)->ks, keylen, key);
-    return 1;
-}
-
-static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    RC4(&data(ctx)->ks, inl, in, out);
-    return 1;
-}
+#else
+NON_EMPTY_TRANSLATION_UNIT
 #endif
diff --git a/deps/openssl/openssl/crypto/evp/e_rc4_hmac_md5.c b/deps/openssl/openssl/crypto/evp/e_rc4_hmac_md5.c
index 7b45c08395c..520b930b00f 100644
--- a/deps/openssl/openssl/crypto/evp/e_rc4_hmac_md5.c
+++ b/deps/openssl/openssl/crypto/evp/e_rc4_hmac_md5.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,240 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * MD5 and RC4 low level APIs are deprecated for public use, but still ok for
- * internal use.
- */
-#include "internal/deprecated.h"
-
-#include "internal/cryptlib.h"
-#include <openssl/opensslconf.h>
-
-#include <stdio.h>
-#include <string.h>
+#include <openssl/macros.h>

 #if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_MD5)
-
-#include <openssl/crypto.h>
-#include <openssl/evp.h>
-#include <openssl/objects.h>
-#include <openssl/rc4.h>
-#include <openssl/md5.h>
 #include "crypto/evp.h"

-typedef struct {
-    RC4_KEY ks;
-    MD5_CTX head, tail, md;
-    size_t payload_length;
-} EVP_RC4_HMAC_MD5;
-
-#define NO_PAYLOAD_LENGTH ((size_t)-1)
-
-void rc4_md5_enc(RC4_KEY *key, const void *in0, void *out,
-    MD5_CTX *ctx, const void *inp, size_t blocks);
-
-#define data(ctx) ((EVP_RC4_HMAC_MD5 *)EVP_CIPHER_CTX_get_cipher_data(ctx))
-
-static int rc4_hmac_md5_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *inkey,
-    const unsigned char *iv, int enc)
-{
-    EVP_RC4_HMAC_MD5 *key = data(ctx);
-    const int keylen = EVP_CIPHER_CTX_get_key_length(ctx);
-
-    if (keylen <= 0)
-        return 0;
-
-    RC4_set_key(&key->ks, keylen, inkey);
-
-    MD5_Init(&key->head); /* handy when benchmarking */
-    key->tail = key->head;
-    key->md = key->head;
-
-    key->payload_length = NO_PAYLOAD_LENGTH;
-
-    return 1;
-}
-
-#if defined(RC4_ASM) && defined(MD5_ASM) && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
-#define STITCHED_CALL
-#endif
-
-#if !defined(STITCHED_CALL)
-#define rc4_off 0
-#define md5_off 0
-#endif
-
-static int rc4_hmac_md5_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_RC4_HMAC_MD5 *key = data(ctx);
-#if defined(STITCHED_CALL)
-    size_t rc4_off = 32 - 1 - (key->ks.x & (32 - 1)), /* 32 is $MOD from
-                                                       * rc4_md5-x86_64.pl */
-        md5_off = MD5_CBLOCK - key->md.num, blocks;
-    unsigned int l;
-#endif
-    size_t plen = key->payload_length;
-
-    if (plen != NO_PAYLOAD_LENGTH && len != (plen + MD5_DIGEST_LENGTH))
-        return 0;
-
-    if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-        if (plen == NO_PAYLOAD_LENGTH)
-            plen = len;
-#if defined(STITCHED_CALL)
-        /* cipher has to "fall behind" */
-        if (rc4_off > md5_off)
-            md5_off += MD5_CBLOCK;
-
-        if (plen > md5_off && (blocks = (plen - md5_off) / MD5_CBLOCK) && (OPENSSL_ia32cap_P[0] & (1 << 20)) == 0) {
-            MD5_Update(&key->md, in, md5_off);
-            RC4(&key->ks, rc4_off, in, out);
-
-            rc4_md5_enc(&key->ks, in + rc4_off, out + rc4_off,
-                &key->md, in + md5_off, blocks);
-            blocks *= MD5_CBLOCK;
-            rc4_off += blocks;
-            md5_off += blocks;
-            key->md.Nh += blocks >> 29;
-            key->md.Nl += blocks <<= 3;
-            if (key->md.Nl < (unsigned int)blocks)
-                key->md.Nh++;
-        } else {
-            rc4_off = 0;
-            md5_off = 0;
-        }
-#endif
-        MD5_Update(&key->md, in + md5_off, plen - md5_off);
-
-        if (plen != len) { /* "TLS" mode of operation */
-            if (in != out)
-                memcpy(out + rc4_off, in + rc4_off, plen - rc4_off);
-
-            /* calculate HMAC and append it to payload */
-            MD5_Final(out + plen, &key->md);
-            key->md = key->tail;
-            MD5_Update(&key->md, out + plen, MD5_DIGEST_LENGTH);
-            MD5_Final(out + plen, &key->md);
-            /* encrypt HMAC at once */
-            RC4(&key->ks, len - rc4_off, out + rc4_off, out + rc4_off);
-        } else {
-            RC4(&key->ks, len - rc4_off, in + rc4_off, out + rc4_off);
-        }
-    } else {
-        unsigned char mac[MD5_DIGEST_LENGTH];
-#if defined(STITCHED_CALL)
-        /* digest has to "fall behind" */
-        if (md5_off > rc4_off)
-            rc4_off += 2 * MD5_CBLOCK;
-        else
-            rc4_off += MD5_CBLOCK;
-
-        if (len > rc4_off && (blocks = (len - rc4_off) / MD5_CBLOCK) && (OPENSSL_ia32cap_P[0] & (1 << 20)) == 0) {
-            RC4(&key->ks, rc4_off, in, out);
-            MD5_Update(&key->md, out, md5_off);
-
-            rc4_md5_enc(&key->ks, in + rc4_off, out + rc4_off,
-                &key->md, out + md5_off, blocks);
-            blocks *= MD5_CBLOCK;
-            rc4_off += blocks;
-            md5_off += blocks;
-            l = (key->md.Nl + (blocks << 3)) & 0xffffffffU;
-            if (l < key->md.Nl)
-                key->md.Nh++;
-            key->md.Nl = l;
-            key->md.Nh += blocks >> 29;
-        } else {
-            md5_off = 0;
-            rc4_off = 0;
-        }
-#endif
-        /* decrypt HMAC at once */
-        RC4(&key->ks, len - rc4_off, in + rc4_off, out + rc4_off);
-        if (plen != NO_PAYLOAD_LENGTH) { /* "TLS" mode of operation */
-            MD5_Update(&key->md, out + md5_off, plen - md5_off);
-
-            /* calculate HMAC and verify it */
-            MD5_Final(mac, &key->md);
-            key->md = key->tail;
-            MD5_Update(&key->md, mac, MD5_DIGEST_LENGTH);
-            MD5_Final(mac, &key->md);
-
-            if (CRYPTO_memcmp(out + plen, mac, MD5_DIGEST_LENGTH))
-                return 0;
-        } else {
-            MD5_Update(&key->md, out + md5_off, len - md5_off);
-        }
-    }
-
-    key->payload_length = NO_PAYLOAD_LENGTH;
-
-    return 1;
-}
-
-static int rc4_hmac_md5_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
-    void *ptr)
-{
-    EVP_RC4_HMAC_MD5 *key = data(ctx);
-
-    switch (type) {
-    case EVP_CTRL_AEAD_SET_MAC_KEY: {
-        unsigned int i;
-        unsigned char hmac_key[64];
-
-        memset(hmac_key, 0, sizeof(hmac_key));
-
-        if (arg > (int)sizeof(hmac_key)) {
-            MD5_Init(&key->head);
-            MD5_Update(&key->head, ptr, arg);
-            MD5_Final(hmac_key, &key->head);
-        } else {
-            memcpy(hmac_key, ptr, arg);
-        }
-
-        for (i = 0; i < sizeof(hmac_key); i++)
-            hmac_key[i] ^= 0x36; /* ipad */
-        MD5_Init(&key->head);
-        MD5_Update(&key->head, hmac_key, sizeof(hmac_key));
-
-        for (i = 0; i < sizeof(hmac_key); i++)
-            hmac_key[i] ^= 0x36 ^ 0x5c; /* opad */
-        MD5_Init(&key->tail);
-        MD5_Update(&key->tail, hmac_key, sizeof(hmac_key));
-
-        OPENSSL_cleanse(hmac_key, sizeof(hmac_key));
-
-        return 1;
-    }
-    case EVP_CTRL_AEAD_TLS1_AAD: {
-        unsigned char *p = ptr;
-        unsigned int len;
-
-        if (arg != EVP_AEAD_TLS1_AAD_LEN)
-            return -1;
-
-        len = p[arg - 2] << 8 | p[arg - 1];
-
-        if (!EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            if (len < MD5_DIGEST_LENGTH)
-                return -1;
-            len -= MD5_DIGEST_LENGTH;
-            p[arg - 2] = len >> 8;
-            p[arg - 1] = len;
-        }
-        key->payload_length = len;
-        key->md = key->head;
-        MD5_Update(&key->md, p, arg);
-
-        return MD5_DIGEST_LENGTH;
-    }
-    default:
-        return -1;
-    }
-}
-
-static EVP_CIPHER r4_hmac_md5_cipher = {
+static const EVP_CIPHER r4_hmac_md5_cipher = {
 #ifdef NID_rc4_hmac_md5
     NID_rc4_hmac_md5,
 #else
@@ -248,19 +20,13 @@ static EVP_CIPHER r4_hmac_md5_cipher = {
 #endif
     1, EVP_RC4_KEY_SIZE, 0,
     EVP_CIPH_STREAM_CIPHER | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_FLAG_AEAD_CIPHER,
-    EVP_ORIG_GLOBAL,
-    rc4_hmac_md5_init_key,
-    rc4_hmac_md5_cipher,
-    NULL,
-    sizeof(EVP_RC4_HMAC_MD5),
-    NULL,
-    NULL,
-    rc4_hmac_md5_ctrl,
-    NULL
+    EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_rc4_hmac_md5(void)
 {
     return &r4_hmac_md5_cipher;
 }
+#else
+NON_EMPTY_TRANSLATION_UNIT
 #endif
diff --git a/deps/openssl/openssl/crypto/evp/e_rc5.c b/deps/openssl/openssl/crypto/evp/e_rc5.c
index 5133b28d366..f7a2af207f6 100644
--- a/deps/openssl/openssl/crypto/evp/e_rc5.c
+++ b/deps/openssl/openssl/crypto/evp/e_rc5.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,78 +7,16 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * RC5 low level APIs are deprecated for public use, but still ok for internal
- * use.
- */
-#include "internal/deprecated.h"
-
-#include <stdio.h>
-#include "internal/cryptlib.h"
+#include <openssl/macros.h>

 #ifndef OPENSSL_NO_RC5
-
-#include <openssl/evp.h>
 #include "crypto/evp.h"
-#include <openssl/objects.h>
-#include "evp_local.h"
 #include <openssl/rc5.h>

-static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-static int rc5_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
-
-typedef struct {
-    int rounds; /* number of rounds */
-    RC5_32_KEY ks; /* key schedule */
-} EVP_RC5_KEY;
-
-#define data(ctx) EVP_C_DATA(EVP_RC5_KEY, ctx)
-
 IMPLEMENT_BLOCK_CIPHER(rc5_32_12_16, ks, RC5_32, EVP_RC5_KEY, NID_rc5,
     8, RC5_32_KEY_LENGTH, 8, 64,
-    EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
-    r_32_12_16_init_key, NULL, NULL, NULL, rc5_ctrl)
-
-static int rc5_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
-{
-    switch (type) {
-    case EVP_CTRL_INIT:
-        data(c)->rounds = RC5_12_ROUNDS;
-        return 1;
-
-    case EVP_CTRL_GET_RC5_ROUNDS:
-        *(int *)ptr = data(c)->rounds;
-        return 1;
-
-    case EVP_CTRL_SET_RC5_ROUNDS:
-        switch (arg) {
-        case RC5_8_ROUNDS:
-        case RC5_12_ROUNDS:
-        case RC5_16_ROUNDS:
-            data(c)->rounds = arg;
-            return 1;
-
-        default:
-            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS);
-            return 0;
-        }
-
-    default:
-        return -1;
-    }
-}
-
-static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    const int key_len = EVP_CIPHER_CTX_get_key_length(ctx);
-
-    if (key_len > 255 || key_len < 0) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_BAD_KEY_LENGTH);
-        return 0;
-    }
-    return RC5_32_set_key(&data(ctx)->ks, key_len, key, data(ctx)->rounds);
-}
+    EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT)

+#else
+NON_EMPTY_TRANSLATION_UNIT
 #endif
diff --git a/deps/openssl/openssl/crypto/evp/e_seed.c b/deps/openssl/openssl/crypto/evp/e_seed.c
index a88cab02941..5884995abe8 100644
--- a/deps/openssl/openssl/crypto/evp/e_seed.c
+++ b/deps/openssl/openssl/crypto/evp/e_seed.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,35 +7,7 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * SEED low level APIs are deprecated for public use, but still ok for
- * internal use.
- */
-#include "internal/deprecated.h"
-
-#include <openssl/opensslconf.h>
-#include <openssl/evp.h>
-#include <openssl/err.h>
-#include <string.h>
-#include <assert.h>
-#include <openssl/seed.h>
 #include "crypto/evp.h"
-#include "evp_local.h"
-
-static int seed_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-
-typedef struct {
-    SEED_KEY_SCHEDULE ks;
-} EVP_SEED_KEY;

 IMPLEMENT_BLOCK_CIPHER(seed, ks, SEED, EVP_SEED_KEY, NID_seed,
-    16, 16, 16, 128, EVP_CIPH_FLAG_DEFAULT_ASN1,
-    seed_init_key, 0, 0, 0, 0)
-
-static int seed_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    SEED_set_key(key, &EVP_C_DATA(EVP_SEED_KEY, ctx)->ks);
-    return 1;
-}
+    16, 16, 16, 128, EVP_CIPH_FLAG_DEFAULT_ASN1)
diff --git a/deps/openssl/openssl/crypto/evp/e_sm4.c b/deps/openssl/openssl/crypto/evp/e_sm4.c
index 66b087c0201..bf10d3d390b 100644
--- a/deps/openssl/openssl/crypto/evp/e_sm4.c
+++ b/deps/openssl/openssl/crypto/evp/e_sm4.c
@@ -9,40 +9,16 @@
  * https://www.openssl.org/source/license.html
  */

-#include "internal/deprecated.h"
+#include <openssl/macros.h>

-#include "internal/cryptlib.h"
 #ifndef OPENSSL_NO_SM4
-#include <openssl/evp.h>
-#include <openssl/modes.h>
-#include "crypto/sm4.h"
 #include "crypto/evp.h"
-#include "crypto/sm4_platform.h"
-#include "evp_local.h"
-
-typedef struct {
-    union {
-        OSSL_UNION_ALIGN;
-        SM4_KEY ks;
-    } ks;
-    block128_f block;
-    union {
-        ecb128_f ecb;
-        cbc128_f cbc;
-        ctr128_f ctr;
-    } stream;
-} EVP_SM4_KEY;

 #define BLOCK_CIPHER_generic(nid, blocksize, ivlen, nmode, mode, MODE, flags) \
     static const EVP_CIPHER sm4_##mode = {                                    \
         nid##_##nmode, blocksize, 128 / 8, ivlen,                             \
         flags | EVP_CIPH_##MODE##_MODE,                                       \
-        EVP_ORIG_GLOBAL,                                                      \
-        sm4_init_key,                                                         \
-        sm4_##mode##_cipher,                                                  \
-        NULL,                                                                 \
-        sizeof(EVP_SM4_KEY),                                                  \
-        NULL, NULL, NULL, NULL                                                \
+        EVP_ORIG_GLOBAL                                                       \
     };                                                                        \
     const EVP_CIPHER *EVP_sm4_##mode(void)                                    \
     {                                                                         \
@@ -56,175 +32,7 @@ typedef struct {
     BLOCK_CIPHER_generic(nid, 1, 16, cfb128, cfb, CFB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \
     BLOCK_CIPHER_generic(nid, 1, 16, ctr, ctr, CTR, flags)

-static int sm4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    int mode;
-    EVP_SM4_KEY *dat = EVP_C_DATA(EVP_SM4_KEY, ctx);
-
-    mode = EVP_CIPHER_CTX_get_mode(ctx);
-    if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE)
-        && !enc) {
-#ifdef HWSM4_CAPABLE
-        if (HWSM4_CAPABLE) {
-            HWSM4_set_decrypt_key(key, &dat->ks.ks);
-            dat->block = (block128_f)HWSM4_decrypt;
-            dat->stream.cbc = NULL;
-#ifdef HWSM4_cbc_encrypt
-            if (mode == EVP_CIPH_CBC_MODE)
-                dat->stream.cbc = (cbc128_f)HWSM4_cbc_encrypt;
-#endif
-#ifdef HWSM4_ecb_encrypt
-            if (mode == EVP_CIPH_ECB_MODE)
-                dat->stream.ecb = (ecb128_f)HWSM4_ecb_encrypt;
-#endif
-        } else
-#endif
-#ifdef VPSM4_CAPABLE
-            if (VPSM4_CAPABLE) {
-            vpsm4_set_decrypt_key(key, &dat->ks.ks);
-            dat->block = (block128_f)vpsm4_decrypt;
-            dat->stream.cbc = NULL;
-            if (mode == EVP_CIPH_CBC_MODE)
-                dat->stream.cbc = (cbc128_f)vpsm4_cbc_encrypt;
-            else if (mode == EVP_CIPH_ECB_MODE)
-                dat->stream.ecb = (ecb128_f)vpsm4_ecb_encrypt;
-        } else
-#endif
-        {
-            dat->block = (block128_f)ossl_sm4_decrypt;
-            ossl_sm4_set_key(key, EVP_CIPHER_CTX_get_cipher_data(ctx));
-        }
-    } else
-#ifdef HWSM4_CAPABLE
-        if (HWSM4_CAPABLE) {
-        HWSM4_set_encrypt_key(key, &dat->ks.ks);
-        dat->block = (block128_f)HWSM4_encrypt;
-        dat->stream.cbc = NULL;
-#ifdef HWSM4_cbc_encrypt
-        if (mode == EVP_CIPH_CBC_MODE)
-            dat->stream.cbc = (cbc128_f)HWSM4_cbc_encrypt;
-        else
-#endif
-#ifdef HWSM4_ecb_encrypt
-            if (mode == EVP_CIPH_ECB_MODE)
-            dat->stream.ecb = (ecb128_f)HWSM4_ecb_encrypt;
-        else
-#endif
-#ifdef HWSM4_ctr32_encrypt_blocks
-            if (mode == EVP_CIPH_CTR_MODE)
-            dat->stream.ctr = (ctr128_f)HWSM4_ctr32_encrypt_blocks;
-        else
-#endif
-            (void)0; /* terminate potentially open 'else' */
-    } else
-#endif
-#ifdef VPSM4_CAPABLE
-        if (VPSM4_CAPABLE) {
-        vpsm4_set_encrypt_key(key, &dat->ks.ks);
-        dat->block = (block128_f)vpsm4_encrypt;
-        dat->stream.cbc = NULL;
-        if (mode == EVP_CIPH_CBC_MODE)
-            dat->stream.cbc = (cbc128_f)vpsm4_cbc_encrypt;
-        else if (mode == EVP_CIPH_ECB_MODE)
-            dat->stream.ecb = (ecb128_f)vpsm4_ecb_encrypt;
-        else if (mode == EVP_CIPH_CTR_MODE)
-            dat->stream.ctr = (ctr128_f)vpsm4_ctr32_encrypt_blocks;
-    } else
-#endif
-    {
-        dat->block = (block128_f)ossl_sm4_encrypt;
-        ossl_sm4_set_key(key, EVP_CIPHER_CTX_get_cipher_data(ctx));
-    }
-    return 1;
-}
-
-static int sm4_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_SM4_KEY *dat = EVP_C_DATA(EVP_SM4_KEY, ctx);
-
-    if (dat->stream.cbc)
-        (*dat->stream.cbc)(in, out, len, &dat->ks.ks, ctx->iv,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-    else if (EVP_CIPHER_CTX_is_encrypting(ctx))
-        CRYPTO_cbc128_encrypt(in, out, len, &dat->ks, ctx->iv,
-            dat->block);
-    else
-        CRYPTO_cbc128_decrypt(in, out, len, &dat->ks,
-            ctx->iv, dat->block);
-    return 1;
-}
-
-static int sm4_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_SM4_KEY *dat = EVP_C_DATA(EVP_SM4_KEY, ctx);
-    int num = EVP_CIPHER_CTX_get_num(ctx);
-
-    CRYPTO_cfb128_encrypt(in, out, len, &dat->ks,
-        ctx->iv, &num,
-        EVP_CIPHER_CTX_is_encrypting(ctx), dat->block);
-    EVP_CIPHER_CTX_set_num(ctx, num);
-    return 1;
-}
-
-static int sm4_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    size_t bl = EVP_CIPHER_CTX_get_block_size(ctx);
-    size_t i;
-    EVP_SM4_KEY *dat = EVP_C_DATA(EVP_SM4_KEY, ctx);
-
-    if (len < bl)
-        return 1;
-
-    if (dat->stream.ecb != NULL)
-        (*dat->stream.ecb)(in, out, len, &dat->ks.ks,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-    else
-        for (i = 0, len -= bl; i <= len; i += bl)
-            (*dat->block)(in + i, out + i, &dat->ks);
-
-    return 1;
-}
-
-static int sm4_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    EVP_SM4_KEY *dat = EVP_C_DATA(EVP_SM4_KEY, ctx);
-    int num = EVP_CIPHER_CTX_get_num(ctx);
-
-    CRYPTO_ofb128_encrypt(in, out, len, &dat->ks,
-        ctx->iv, &num, dat->block);
-    EVP_CIPHER_CTX_set_num(ctx, num);
-    return 1;
-}
-
-static int sm4_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t len)
-{
-    int n = EVP_CIPHER_CTX_get_num(ctx);
-    unsigned int num;
-    EVP_SM4_KEY *dat = EVP_C_DATA(EVP_SM4_KEY, ctx);
-
-    if (n < 0)
-        return 0;
-    num = (unsigned int)n;
-
-    if (dat->stream.ctr)
-        CRYPTO_ctr128_encrypt_ctr32(in, out, len, &dat->ks,
-            ctx->iv,
-            EVP_CIPHER_CTX_buf_noconst(ctx),
-            &num, dat->stream.ctr);
-    else
-        CRYPTO_ctr128_encrypt(in, out, len, &dat->ks,
-            ctx->iv,
-            EVP_CIPHER_CTX_buf_noconst(ctx), &num,
-            dat->block);
-    EVP_CIPHER_CTX_set_num(ctx, num);
-    return 1;
-}
-
 DEFINE_BLOCK_CIPHERS(NID_sm4, 0)
+#else
+NON_EMPTY_TRANSLATION_UNIT
 #endif
diff --git a/deps/openssl/openssl/crypto/evp/e_xcbc_d.c b/deps/openssl/openssl/crypto/evp/e_xcbc_d.c
index eaa021be2cf..6cda6f70533 100644
--- a/deps/openssl/openssl/crypto/evp/e_xcbc_d.c
+++ b/deps/openssl/openssl/crypto/evp/e_xcbc_d.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,85 +7,22 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * DES low level APIs are deprecated for public use, but still ok for internal
- * use.
- */
-#include "internal/deprecated.h"
-
-#include <stdio.h>
-#include "internal/cryptlib.h"
+#include <openssl/macros.h>

 #ifndef OPENSSL_NO_DES
-
-#include <openssl/evp.h>
-#include <openssl/objects.h>
 #include "crypto/evp.h"
-#include <openssl/des.h>
-#include "evp_local.h"
-
-static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl);
-
-typedef struct {
-    DES_key_schedule ks; /* key schedule */
-    DES_cblock inw;
-    DES_cblock outw;
-} DESX_CBC_KEY;
-
-#define data(ctx) EVP_C_DATA(DESX_CBC_KEY, ctx)

 static const EVP_CIPHER d_xcbc_cipher = {
     NID_desx_cbc,
     8, 24, 8,
     EVP_CIPH_CBC_MODE,
-    EVP_ORIG_GLOBAL,
-    desx_cbc_init_key,
-    desx_cbc_cipher,
-    NULL,
-    sizeof(DESX_CBC_KEY),
-    EVP_CIPHER_set_asn1_iv,
-    EVP_CIPHER_get_asn1_iv,
-    NULL,
-    NULL
+    EVP_ORIG_GLOBAL
 };

 const EVP_CIPHER *EVP_desx_cbc(void)
 {
     return &d_xcbc_cipher;
 }
-
-static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    DES_cblock *deskey = (DES_cblock *)key;
-
-    DES_set_key_unchecked(deskey, &data(ctx)->ks);
-    memcpy(&data(ctx)->inw[0], &key[8], 8);
-    memcpy(&data(ctx)->outw[0], &key[16], 8);
-
-    return 1;
-}
-
-static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    while (inl >= EVP_MAXCHUNK) {
-        DES_xcbc_encrypt(in, out, (long)EVP_MAXCHUNK, &data(ctx)->ks,
-            (DES_cblock *)ctx->iv,
-            &data(ctx)->inw, &data(ctx)->outw,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-        inl -= EVP_MAXCHUNK;
-        in += EVP_MAXCHUNK;
-        out += EVP_MAXCHUNK;
-    }
-    if (inl)
-        DES_xcbc_encrypt(in, out, (long)inl, &data(ctx)->ks,
-            (DES_cblock *)ctx->iv,
-            &data(ctx)->inw, &data(ctx)->outw,
-            EVP_CIPHER_CTX_is_encrypting(ctx));
-    return 1;
-}
+#else
+NON_EMPTY_TRANSLATION_UNIT
 #endif
diff --git a/deps/openssl/openssl/crypto/evp/ec_ctrl.c b/deps/openssl/openssl/crypto/evp/ec_ctrl.c
index 096f7f18d73..be772003e19 100644
--- a/deps/openssl/openssl/crypto/evp/ec_ctrl.c
+++ b/deps/openssl/openssl/crypto/evp/ec_ctrl.c
@@ -30,7 +30,7 @@ static ossl_inline int evp_pkey_ctx_getset_ecdh_param_checks(const EVP_PKEY_CTX

     /* If key type not EC return error */
     if (evp_pkey_ctx_is_legacy(ctx)
-        && ctx->pmeth != NULL && ctx->pmeth->pkey_id != EVP_PKEY_EC)
+        && ctx->legacy_keytype != EVP_PKEY_EC)
         return -1;

     return 1;
diff --git a/deps/openssl/openssl/crypto/evp/ec_support.c b/deps/openssl/openssl/crypto/evp/ec_support.c
index 20883c48f10..1e01a564365 100644
--- a/deps/openssl/openssl/crypto/evp/ec_support.c
+++ b/deps/openssl/openssl/crypto/evp/ec_support.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -9,6 +9,7 @@

 #include <string.h>
 #include <openssl/ec.h>
+#include <openssl/err.h>
 #include "crypto/ec.h"
 #include "internal/nelem.h"

@@ -186,3 +187,51 @@ int ossl_ec_curve_nist2nid_int(const char *name)
     }
     return NID_undef;
 }
+
+int EVP_EC_affine2oct(const BIGNUM *x, const BIGNUM *y, size_t field_len,
+    unsigned char **pbuf, size_t *pbsize)
+{
+    unsigned char *buf = NULL;
+    size_t buflen = 0;
+
+    if (x == NULL || y == NULL || pbuf == NULL || pbsize == NULL) {
+        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+
+    if (field_len > 2048) {
+        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
+            "The value of field_len is unreasonably large");
+        return 0;
+    }
+
+    /* Checking if affine coordinates are not too long */
+    if (BN_num_bytes(x) > (int)field_len || BN_num_bytes(y) > (int)field_len) {
+        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
+            "EC affine coordinate exceeds field length");
+        return 0;
+    }
+
+    /* Converting (X,Y) to the SEC1 uncompressed point encoding blob */
+    buflen = 1 + 2 * field_len;
+    buf = OPENSSL_malloc(buflen);
+    if (buf == NULL)
+        return 0;
+    buf[0] = POINT_CONVERSION_UNCOMPRESSED;
+    if (BN_bn2binpad(x, buf + 1, (int)field_len) < 0) {
+        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
+            "failed to encode X coordinate");
+        OPENSSL_free(buf);
+        return 0;
+    }
+    if (BN_bn2binpad(y, buf + 1 + field_len, (int)field_len) < 0) {
+        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
+            "failed to encode Y coordinate");
+        OPENSSL_free(buf);
+        return 0;
+    }
+
+    *pbuf = buf;
+    *pbsize = buflen;
+    return 1;
+}
diff --git a/deps/openssl/openssl/crypto/evp/enc_b64_avx2.c b/deps/openssl/openssl/crypto/evp/enc_b64_avx2.c
new file mode 100644
index 00000000000..df6406de571
--- /dev/null
+++ b/deps/openssl/openssl/crypto/evp/enc_b64_avx2.c
@@ -0,0 +1,674 @@
+#include <openssl/evp.h>
+#include "enc_b64_scalar.h"
+#include "enc_b64_avx2.h"
+#include "internal/cryptlib.h"
+#include "crypto/evp.h"
+#include "evp_local.h"
+
+#if defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64) || defined(__e2k__)
+#if !defined(_M_ARM64EC)
+#if defined(HAVE_AVX2_INTRINSICS)
+#define STRINGIFY_IMPLEMENTATION_(a) #a
+#define STRINGIFY(a) STRINGIFY_IMPLEMENTATION_(a)
+
+#ifdef __clang__
+/*
+ * clang does not have GCC push pop
+ * warning: clang attribute push can't be used within a namespace in clang up
+ * til 8.0 so OPENSSL_TARGET_REGION and OPENSSL_UNTARGET_REGION must be
+ * outside* of a namespace.
+ */
+#define OPENSSL_TARGET_REGION(T)                                       \
+    _Pragma(STRINGIFY(clang attribute push(__attribute__((target(T))), \
+        apply_to = function)))
+#define OPENSSL_UNTARGET_REGION _Pragma("clang attribute pop")
+#elif defined(__GNUC__)
+#define OPENSSL_TARGET_REGION(T) \
+    _Pragma("GCC push_options") _Pragma(STRINGIFY(GCC target(T)))
+#define OPENSSL_UNTARGET_REGION _Pragma("GCC pop_options")
+#endif /* clang then gcc */
+
+/* Default target region macros don't do anything. */
+#ifndef OPENSSL_TARGET_REGION
+#define OPENSSL_TARGET_REGION(T)
+#define OPENSSL_UNTARGET_REGION
+#endif
+
+#define OPENSSL_TARGET_AVX2 \
+    OPENSSL_TARGET_REGION("avx2")
+#define OPENSSL_UNTARGET_AVX2 OPENSSL_UNTARGET_REGION
+
+/*
+ * Ensure this whole block is compiled with AVX2 enabled on GCC.
+ * Clang/MSVC will just ignore these pragmas.
+ */
+
+#include <string.h>
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+OPENSSL_TARGET_AVX2
+static __m256i lookup_pshufb_std(__m256i input)
+{
+    __m256i result = _mm256_subs_epu8(input, _mm256_set1_epi8(51));
+    const __m256i less = _mm256_cmpgt_epi8(_mm256_set1_epi8(26), input);
+
+    result = _mm256_or_si256(result, _mm256_and_si256(less, _mm256_set1_epi8(13)));
+    __m256i shift_LUT = _mm256_setr_epi8('a' - 26, '0' - 52, '0' - 52, '0' - 52, '0' - 52,
+        '0' - 52, '0' - 52,
+        '0' - 52, '0' - 52, '0' - 52, '0' - 52, '+' - 62,
+        '/' - 63, 'A', 0, 0,
+        'a' - 26, '0' - 52, '0' - 52, '0' - 52, '0' - 52,
+        '0' - 52, '0' - 52,
+        '0' - 52, '0' - 52, '0' - 52, '0' - 52, '+' - 62,
+        '/' - 63, 'A', 0, 0);
+
+    result = _mm256_shuffle_epi8(shift_LUT, result);
+    return _mm256_add_epi8(result, input);
+}
+OPENSSL_UNTARGET_AVX2
+
+OPENSSL_TARGET_AVX2
+static ossl_inline __m256i lookup_pshufb_srp(__m256i input)
+{
+    const __m256i zero = _mm256_setzero_si256();
+    const __m256i hi = _mm256_set1_epi8((char)0x80);
+    __m256i invalid = _mm256_or_si256(_mm256_cmpgt_epi8(zero, input),
+        _mm256_cmpgt_epi8(input,
+            _mm256_set1_epi8(63)));
+    __m256i idx = _mm256_setzero_si256();
+
+    idx = _mm256_sub_epi8(idx, _mm256_cmpgt_epi8(input, _mm256_set1_epi8(9)));
+    idx = _mm256_sub_epi8(idx, _mm256_cmpgt_epi8(input, _mm256_set1_epi8(35)));
+    idx = _mm256_blendv_epi8(idx, _mm256_set1_epi8(3),
+        _mm256_cmpeq_epi8(input, _mm256_set1_epi8(62)));
+    idx = _mm256_blendv_epi8(idx, _mm256_set1_epi8(4),
+        _mm256_cmpeq_epi8(input, _mm256_set1_epi8(63)));
+
+    /* Zero-out invalid lanes via PSHUFB's high-bit mechanism */
+    idx = _mm256_or_si256(idx, _mm256_and_si256(invalid, hi));
+
+    const __m256i shift_LUT = _mm256_setr_epi8('0' - 0, 'A' - 10, 'a' - 36, '.' - 62, '/' - 63, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0,
+        '0' - 0, 'A' - 10, 'a' - 36, '.' - 62, '/' - 63, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+    __m256i shift = _mm256_shuffle_epi8(shift_LUT, idx);
+    __m256i ascii = _mm256_add_epi8(shift, input);
+    return ascii;
+}
+OPENSSL_UNTARGET_AVX2
+
+OPENSSL_TARGET_AVX2
+static ossl_inline __m256i shift_right_zeros(__m256i v, int n)
+{
+    switch (n) {
+    case 0:
+        return v;
+    case 1:
+        return _mm256_srli_si256(v, 1);
+    case 2:
+        return _mm256_srli_si256(v, 2);
+    case 3:
+        return _mm256_srli_si256(v, 3);
+    case 4:
+        return _mm256_srli_si256(v, 4);
+    case 5:
+        return _mm256_srli_si256(v, 5);
+    case 6:
+        return _mm256_srli_si256(v, 6);
+    case 7:
+        return _mm256_srli_si256(v, 7);
+    case 8:
+        return _mm256_srli_si256(v, 8);
+    case 9:
+        return _mm256_srli_si256(v, 9);
+    case 10:
+        return _mm256_srli_si256(v, 10);
+    case 11:
+        return _mm256_srli_si256(v, 11);
+    case 12:
+        return _mm256_srli_si256(v, 12);
+    case 13:
+        return _mm256_srli_si256(v, 13);
+    case 14:
+        return _mm256_srli_si256(v, 14);
+    case 15:
+        return _mm256_srli_si256(v, 15);
+    default:
+        return _mm256_setzero_si256();
+    }
+}
+OPENSSL_UNTARGET_AVX2
+
+OPENSSL_TARGET_AVX2
+static ossl_inline __m256i shift_left_zeros(__m256i v, int n)
+{
+    switch (n) {
+    case 0:
+        return v;
+    case 1:
+        return _mm256_slli_si256(v, 1);
+    case 2:
+        return _mm256_slli_si256(v, 2);
+    case 3:
+        return _mm256_slli_si256(v, 3);
+    case 4:
+        return _mm256_slli_si256(v, 4);
+    case 5:
+        return _mm256_slli_si256(v, 5);
+    case 6:
+        return _mm256_slli_si256(v, 6);
+    case 7:
+        return _mm256_slli_si256(v, 7);
+    case 8:
+        return _mm256_slli_si256(v, 8);
+    case 9:
+        return _mm256_slli_si256(v, 9);
+    case 10:
+        return _mm256_slli_si256(v, 10);
+    case 11:
+        return _mm256_slli_si256(v, 11);
+    case 12:
+        return _mm256_slli_si256(v, 12);
+    case 13:
+        return _mm256_slli_si256(v, 13);
+    case 14:
+        return _mm256_slli_si256(v, 14);
+    case 15:
+        return _mm256_slli_si256(v, 15);
+    case 16:
+        return _mm256_setzero_si256();
+    default:
+        return _mm256_setzero_si256();
+    }
+}
+OPENSSL_UNTARGET_AVX2
+
+static const uint8_t shuffle_masks[16][16] = {
+    { 0x80, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 },
+    { 0, 0x80, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 },
+    { 0, 1, 0x80, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 },
+    { 0, 1, 2, 0x80, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 },
+    { 0, 1, 2, 3, 0x80, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 },
+    { 0, 1, 2, 3, 4, 0x80, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 },
+    { 0, 1, 2, 3, 4, 5, 0x80, 6, 7, 8, 9, 10, 11, 12, 13, 14 },
+    { 0, 1, 2, 3, 4, 5, 6, 0x80, 7, 8, 9, 10, 11, 12, 13, 14 },
+    { 0, 1, 2, 3, 4, 5, 6, 7, 0x80, 8, 9, 10, 11, 12, 13, 14 },
+    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 0x80, 9, 10, 11, 12, 13, 14 },
+    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0x80, 10, 11, 12, 13, 14 },
+    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0x80, 11, 12, 13, 14 },
+    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x80, 12, 13, 14 },
+    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0x80, 13, 14 },
+    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0x80, 14 },
+    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0x80 }
+};
+
+/**
+ * Insert a line feed character in the 64-byte input at index K in [0,32).
+ */
+OPENSSL_TARGET_AVX2
+static ossl_inline __m256i insert_line_feed32(__m256i input, int K)
+{
+    __m256i line_feed_vector = _mm256_set1_epi8('\n');
+    __m128i identity = _mm_setr_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+
+    if (K >= 16) {
+        __m128i maskhi = _mm_loadu_si128((__m128i *)shuffle_masks[K - 16]);
+        __m256i mask = _mm256_set_m128i(maskhi, identity);
+        __m256i lf_pos = _mm256_cmpeq_epi8(mask, _mm256_set1_epi8((char)0x80));
+        __m256i shuffled = _mm256_shuffle_epi8(input, mask);
+        __m256i result = _mm256_blendv_epi8(shuffled, line_feed_vector, lf_pos);
+
+        return result;
+    }
+    /* Shift input right by 1 byte */
+    __m256i shift = _mm256_alignr_epi8(input, _mm256_permute2x128_si256(input, input, 0x21),
+        15);
+    input = _mm256_blend_epi32(input, shift, 0xF0);
+    __m128i masklo = _mm_loadu_si128((__m128i *)shuffle_masks[K]);
+    __m256i mask = _mm256_set_m128i(identity, masklo);
+    __m256i lf_pos = _mm256_cmpeq_epi8(mask, _mm256_set1_epi8((char)0x80));
+    __m256i shuffled = _mm256_shuffle_epi8(input, mask);
+    __m256i result = _mm256_blendv_epi8(shuffled, line_feed_vector, lf_pos);
+    return result;
+}
+OPENSSL_UNTARGET_AVX2
+
+OPENSSL_TARGET_AVX2
+static ossl_inline size_t ins_nl_gt32(__m256i v, uint8_t *out, int stride,
+    int *wrap_cnt)
+{
+    const int until_nl = stride - *wrap_cnt;
+
+    if (until_nl > 32) {
+        _mm256_storeu_si256((__m256i *)out, v);
+
+        *wrap_cnt += 32;
+        return 32;
+    }
+
+    if (until_nl == 32) {
+        _mm256_storeu_si256((__m256i *)out, v);
+
+        out[32] = '\n';
+        *wrap_cnt = 0;
+        return 33;
+    }
+
+    const uint8_t last = (uint8_t)_mm256_extract_epi8(v, 31);
+    const __m256i with_lf = insert_line_feed32(v, until_nl);
+    _mm256_storeu_si256((__m256i *)out, with_lf);
+    out[32] = last;
+
+    *wrap_cnt = 32 - until_nl;
+    return 33;
+}
+OPENSSL_UNTARGET_AVX2
+
+OPENSSL_TARGET_AVX2
+static ossl_inline size_t insert_nl_gt16(const __m256i v0,
+    uint8_t *output,
+    int wrap_max, int *wrap_cnt)
+{
+    uint8_t *out = output;
+    int wrap_rem = wrap_max - *wrap_cnt;
+    _mm256_storeu_si256((__m256i *)(output), v0);
+
+    if (wrap_rem > 32) {
+        *wrap_cnt += 32;
+        return 32;
+    }
+
+    __m256i all_ff_mask = _mm256_set1_epi8((char)0xFF);
+
+    __m256i mask_second_lane = _mm256_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0,
+        (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF,
+        (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF,
+        (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF,
+        (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF);
+
+    __m256i blended_0L = v0;
+    int surplus_0 = wrap_rem < 16 ? 1 : 0;
+    if (surplus_0 == 1) {
+        __m256i shifted_0_L = shift_left_zeros(shift_right_zeros(v0, wrap_rem),
+            wrap_rem + surplus_0);
+        __m256i mask_shifted_0_L = shift_left_zeros(all_ff_mask, wrap_rem + surplus_0);
+        __m256i mask = _mm256_or_si256(mask_shifted_0_L, mask_second_lane);
+        __m256i shifted_1_L = shift_left_zeros(v0, 1);
+        __m256i shifted = _mm256_blendv_epi8(shifted_0_L, shifted_1_L, mask);
+
+        blended_0L = _mm256_blendv_epi8(v0, shifted, mask);
+        _mm256_storeu_si256((__m256i *)(output), blended_0L);
+        wrap_rem += wrap_max;
+    }
+
+    int surplus_1 = (wrap_rem >= 16 && wrap_rem < 32) ? 1 : 0;
+    int last_of_1L = _mm256_extract_epi8(v0, 31);
+
+    if (surplus_1 == 1) {
+        uint16_t sec_last_of_1L = _mm256_extract_epi8(v0, 30);
+        int wrap_rem_1 = wrap_rem - 16;
+        __m256i shifted_1_L = shift_left_zeros(shift_right_zeros(v0, wrap_rem_1),
+            wrap_rem_1 + surplus_0 + surplus_1);
+        __m256i mask_shifted_1_L = shift_left_zeros(all_ff_mask, wrap_rem_1 + surplus_0 + surplus_1);
+        __m256i mask = _mm256_and_si256(mask_second_lane, mask_shifted_1_L);
+        __m256i blended_1L = _mm256_blendv_epi8(blended_0L, shifted_1_L, mask);
+        _mm256_storeu_si256((__m256i *)(output), blended_1L);
+
+        output[wrap_rem + surplus_0] = '\n';
+        output[31 + surplus_0] = (uint8_t)sec_last_of_1L;
+        output[31 + surplus_0 + surplus_1] = last_of_1L;
+    }
+
+    if (surplus_0 == 1) {
+        output[wrap_rem - wrap_max] = '\n';
+        output[16] = _mm256_extract_epi8(v0, 15);
+        output[31 + surplus_0 + surplus_1] = last_of_1L;
+    }
+
+    *wrap_cnt = wrap_rem > 32 ? 32 - (wrap_rem - wrap_max) : 32 - wrap_rem;
+
+    int nl_at_end = 0;
+    if (*wrap_cnt == wrap_max || *wrap_cnt == 0) {
+        *wrap_cnt = 0;
+        output[32 + surplus_0 + surplus_1] = '\n';
+        nl_at_end = 1;
+    }
+
+    out += 32 + surplus_0 + surplus_1 + nl_at_end;
+    size_t written = (size_t)(out - output);
+
+    return written;
+}
+OPENSSL_UNTARGET_AVX2
+
+OPENSSL_TARGET_AVX2
+static ossl_inline size_t insert_nl_2nd_vec_stride_12(const __m256i v0,
+    uint8_t *output,
+    int dummy_stride,
+    int *wrap_cnt)
+{
+    __m256i shuffling_mask = _mm256_setr_epi8(0, 1, 2, 3, (char)0xFF, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+        (char)0xFF,
+        (char)0xFF, (char)0xFF, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, (char)0xFF,
+        12);
+    __m256i shuffled = _mm256_shuffle_epi8(v0, shuffling_mask);
+
+    _mm256_storeu_si256((__m256i *)(output + 0), shuffled);
+
+    int16_t rem_1_L_ext = _mm256_extract_epi16(v0, 7);
+    int8_t rem_2_L_ext_P1 = _mm256_extract_epi8(v0, 29);
+    int16_t rem_2_L_ext_P2 = _mm256_extract_epi16(v0, 15);
+
+    uint8_t *out = output;
+    out[4] = '\n';
+    memcpy(out + 15, &rem_1_L_ext, sizeof(rem_1_L_ext));
+    out[16 + 1] = '\n';
+    memcpy(out + 15 + 17, &rem_2_L_ext_P1, sizeof(rem_2_L_ext_P1));
+    out[16 + 14] = '\n';
+    memcpy(out + 15 + 17 + 1, &rem_2_L_ext_P2, sizeof(rem_2_L_ext_P2));
+
+    out += 32 + 3;
+    *wrap_cnt = 4;
+
+    size_t written = (out - output);
+    return written;
+}
+OPENSSL_UNTARGET_AVX2
+
+OPENSSL_TARGET_AVX2
+static ossl_inline __m256i insert_newlines_by_mask(__m256i data, __m256i mask)
+{
+    __m256i newline = _mm256_set1_epi8('\n');
+
+    return _mm256_or_si256(_mm256_and_si256(mask, newline),
+        _mm256_andnot_si256(mask, data));
+}
+OPENSSL_UNTARGET_AVX2
+
+OPENSSL_TARGET_AVX2
+static ossl_inline size_t insert_nl_str4(const __m256i v0, uint8_t *output)
+{
+    __m256i shuffling_mask = _mm256_setr_epi8(0, 1, 2, 3, (char)0xFF, 4, 5, 6,
+        7, (char)0xFF, 8, 9, 10, 11, (char)0xFF, 12,
+        (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, 0, 1, 2, 3,
+        (char)0xFF, 4, 5, 6, 7, (char)0xFF, 8, 9);
+    __m256i mask_5_bytes = _mm256_setr_epi8(0, 0, 0, 0, (char)0xFF, 0, 0, 0, 0, (char)0xFF,
+        0, 0, 0, 0, (char)0xFF, 0, 0, 0, 0, (char)0xFF,
+        0, 0, 0, 0, (char)0xFF, 0, 0, 0, 0, (char)0xFF,
+        0, 0);
+    __m256i shuffled_4_bytes = _mm256_shuffle_epi8(v0, shuffling_mask);
+    __m256i v0_w_nl = insert_newlines_by_mask(shuffled_4_bytes, mask_5_bytes);
+
+    _mm256_storeu_si256((__m256i *)(output + 0), v0_w_nl);
+
+    /* Handle cross-lane remainder logic */
+    /* Without macros, _mm256_srli_si256 complains that the last arg must be an 8-bit immediate */
+#define B_LANE 16 /* Bytes per lane */
+#define N_RET_1_L 3 /* bytes "shifted out" of lane 0 */
+#define N_RET_2_L (N_RET_1_L + 4) /* bytes "shifted out" of lane 1 */
+
+    /* Bytes that were shifted out of lane 0 */
+    __m256i rem_1_L = _mm256_srli_si256(v0, B_LANE - N_RET_1_L);
+
+    /* Bytes that were shifted out of lane 1 */
+    __m256i rem_2_L_P1 = _mm256_srli_si256(_mm256_slli_si256(_mm256_srli_si256(v0, B_LANE - N_RET_2_L),
+                                               B_LANE - N_RET_1_L),
+        B_LANE - 2);
+
+    /* isolate the bytes that were shifted out of lane 1 */
+    __m256i rem_2_L_P2 = _mm256_slli_si256(
+        _mm256_srli_si256(v0,
+            B_LANE - N_RET_2_L + N_RET_1_L),
+        N_RET_1_L);
+
+    __m256i rem_2_L = _mm256_or_si256(rem_2_L_P1, rem_2_L_P2);
+
+    int32_t rem_1_L_ext = _mm256_extract_epi32(rem_1_L, 0);
+    int64_t rem_2_L_ext = _mm256_extract_epi64(rem_2_L, 2);
+
+    uint8_t *out = output + 16;
+    memcpy(out, &rem_1_L_ext, sizeof(rem_1_L_ext));
+    out += 3;
+    *out++ = '\n';
+
+    out = output + 32;
+    memcpy(out, &rem_2_L_ext, sizeof(rem_2_L_ext));
+    out += 2;
+    *out++ = '\n';
+    out += 4;
+    *out++ = '\n';
+
+    size_t written = (out - output);
+    return written;
+}
+OPENSSL_UNTARGET_AVX2
+
+OPENSSL_TARGET_AVX2
+static ossl_inline size_t insert_nl_str8(const __m256i v0, uint8_t *output)
+{
+    __m256i shuffling_mask = _mm256_setr_epi8(0, 1, 2, 3, 4, 5, 6, 7, (char)0xFF,
+        8, 9, 10, 11, 12, 13, 14,
+        (char)0xFF, (char)0xFF, 0, 1, 2, 3, 4, 5, 6,
+        7, (char)0xFF, 8, 9, 10, 11, 12);
+    __m256i shuffled_4_bytes = _mm256_shuffle_epi8(v0, shuffling_mask);
+    _mm256_storeu_si256((__m256i *)(output), shuffled_4_bytes);
+    int8_t rem_1_L = _mm256_extract_epi8(v0, 15);
+    int8_t rem_2_L_P1 = _mm256_extract_epi8(v0, 29);
+    int16_t rem_2_L_P2 = _mm256_extract_epi16(v0, 15);
+    uint8_t *out = output;
+
+    memcpy(out + 16, &rem_1_L, sizeof(rem_1_L));
+    memcpy(out + 32, &rem_2_L_P1, sizeof(rem_2_L_P1));
+    memcpy(out + 32 + 1, &rem_2_L_P2, sizeof(rem_2_L_P2));
+
+    output[8] = '\n';
+    output[17] = '\n';
+    output[26] = '\n';
+    output[35] = '\n';
+
+    out += 32 + 4;
+
+    size_t written = (out - output);
+    return written;
+}
+OPENSSL_UNTARGET_AVX2
+
+OPENSSL_TARGET_AVX2
+size_t encode_base64_avx2(EVP_ENCODE_CTX *ctx, unsigned char *dst,
+    const unsigned char *src, int srclen, int ctx_length,
+    int *final_wrap_cnt)
+{
+    const uint8_t *input = (const uint8_t *)src;
+    uint8_t *out = (uint8_t *)dst;
+    int i = 0;
+    int stride = (ctx == NULL) ? 0 : ctx_length / 3 * 4;
+    int wrap_cnt = 0;
+    const int use_srp = (ctx != NULL
+        && (ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0);
+    const __m256i shuf = _mm256_set_epi8(10, 11, 9, 10, 7, 8, 6, 7, 4, 5, 3, 4, 1, 2, 0, 1,
+        10, 11, 9, 10, 7, 8, 6, 7, 4, 5, 3, 4, 1, 2, 0, 1);
+    int base = 0;
+
+    /* Process 96 bytes at a time */
+    for (; i + 100 <= srclen; i += 96) {
+        _mm_prefetch((const char *)(input + i + 192), _MM_HINT_T0);
+        /*
+         * Interleaved for each vector: load, shuffle, bit-split, lookup
+         * before starting the next, giving the OoO engine independent work chains
+         * across execution ports.
+         */
+        const __m128i lo0 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 0));
+        const __m128i hi0 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 1));
+        __m256i in0 = _mm256_shuffle_epi8(_mm256_set_m128i(hi0, lo0), shuf);
+        const __m256i t0_0 = _mm256_and_si256(in0, _mm256_set1_epi32(0x0fc0fc00));
+        const __m256i t1_0 = _mm256_mulhi_epu16(t0_0, _mm256_set1_epi32(0x04000040));
+        const __m256i t2_0 = _mm256_and_si256(in0, _mm256_set1_epi32(0x003f03f0));
+        const __m256i t3_0 = _mm256_mullo_epi16(t2_0, _mm256_set1_epi32(0x01000010));
+        const __m256i input0 = _mm256_or_si256(t1_0, t3_0);
+
+        const __m128i lo1 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 2));
+        const __m128i hi1 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 3));
+        __m256i in1 = _mm256_shuffle_epi8(_mm256_set_m128i(hi1, lo1), shuf);
+        const __m256i t0_1 = _mm256_and_si256(in1, _mm256_set1_epi32(0x0fc0fc00));
+        const __m256i t1_1 = _mm256_mulhi_epu16(t0_1, _mm256_set1_epi32(0x04000040));
+        const __m256i t2_1 = _mm256_and_si256(in1, _mm256_set1_epi32(0x003f03f0));
+        const __m256i t3_1 = _mm256_mullo_epi16(t2_1, _mm256_set1_epi32(0x01000010));
+        const __m256i input1 = _mm256_or_si256(t1_1, t3_1);
+
+        const __m128i lo2 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 4));
+        const __m128i hi2 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 5));
+        __m256i in2 = _mm256_shuffle_epi8(_mm256_set_m128i(hi2, lo2), shuf);
+        const __m256i t0_2 = _mm256_and_si256(in2, _mm256_set1_epi32(0x0fc0fc00));
+        const __m256i t1_2 = _mm256_mulhi_epu16(t0_2, _mm256_set1_epi32(0x04000040));
+        const __m256i t2_2 = _mm256_and_si256(in2, _mm256_set1_epi32(0x003f03f0));
+        const __m256i t3_2 = _mm256_mullo_epi16(t2_2, _mm256_set1_epi32(0x01000010));
+        const __m256i input2 = _mm256_or_si256(t1_2, t3_2);
+
+        const __m128i lo3 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 6));
+        const __m128i hi3 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 7));
+        __m256i in3 = _mm256_shuffle_epi8(_mm256_set_m128i(hi3, lo3), shuf);
+        const __m256i t0_3 = _mm256_and_si256(in3, _mm256_set1_epi32(0x0fc0fc00));
+        const __m256i t1_3 = _mm256_mulhi_epu16(t0_3, _mm256_set1_epi32(0x04000040));
+        const __m256i t2_3 = _mm256_and_si256(in3, _mm256_set1_epi32(0x003f03f0));
+        const __m256i t3_3 = _mm256_mullo_epi16(t2_3, _mm256_set1_epi32(0x01000010));
+        const __m256i input3 = _mm256_or_si256(t1_3, t3_3);
+
+        __m256i vec0;
+        __m256i vec1;
+        __m256i vec2;
+        __m256i vec3;
+
+        if (use_srp) {
+            vec0 = lookup_pshufb_srp(input0);
+            vec1 = lookup_pshufb_srp(input1);
+            vec2 = lookup_pshufb_srp(input2);
+            vec3 = lookup_pshufb_srp(input3);
+
+        } else {
+            vec0 = lookup_pshufb_std(input0);
+            vec1 = lookup_pshufb_std(input1);
+            vec2 = lookup_pshufb_std(input2);
+            vec3 = lookup_pshufb_std(input3);
+        }
+
+        if (stride == 0) {
+            _mm256_storeu_si256((__m256i *)out, vec0);
+
+            out += 32;
+            _mm256_storeu_si256((__m256i *)out, vec1);
+
+            out += 32;
+            _mm256_storeu_si256((__m256i *)out, vec2);
+
+            out += 32;
+            _mm256_storeu_si256((__m256i *)out, vec3);
+
+            out += 32;
+        } else if (stride == 64) {
+            _mm256_storeu_si256((__m256i *)out, vec0);
+
+            out += 32;
+            _mm256_storeu_si256((__m256i *)out, vec1);
+
+            out += 32;
+            *(out++) = '\n';
+
+            _mm256_storeu_si256((__m256i *)out, vec2);
+            out += 32;
+
+            _mm256_storeu_si256((__m256i *)out, vec3);
+            out += 32;
+
+            *(out++) = '\n';
+        } else if (stride == 4) {
+            int out_idx = 0;
+
+            out_idx += (int)insert_nl_str4(vec0, out + out_idx);
+            out_idx += (int)insert_nl_str4(vec1, out + out_idx);
+            out_idx += (int)insert_nl_str4(vec2, out + out_idx);
+            out_idx += (int)insert_nl_str4(vec3, out + out_idx);
+
+            out += out_idx;
+        } else if (stride == 8) {
+
+            out += insert_nl_str8(vec0, out);
+            out += insert_nl_str8(vec1, out);
+            out += insert_nl_str8(vec2, out);
+            out += insert_nl_str8(vec3, out);
+
+        } else if (stride == 12) {
+            switch (base) {
+            case 0:
+
+                out += insert_nl_gt16(vec0, out, stride, &wrap_cnt);
+                out += insert_nl_2nd_vec_stride_12(vec1, out, stride, &wrap_cnt);
+                out += insert_nl_gt16(vec2, out, stride, &wrap_cnt);
+                out += insert_nl_gt16(vec3, out, stride, &wrap_cnt);
+                break;
+            case 1:
+                out += insert_nl_2nd_vec_stride_12(vec0, out, stride, &wrap_cnt);
+                out += insert_nl_gt16(vec1, out, stride, &wrap_cnt);
+                out += insert_nl_gt16(vec2, out, stride, &wrap_cnt);
+                out += insert_nl_2nd_vec_stride_12(vec3, out, stride, &wrap_cnt);
+                break;
+            default: /* base == 2 */
+                out += insert_nl_gt16(vec0, out, stride, &wrap_cnt);
+                out += insert_nl_gt16(vec1, out, stride, &wrap_cnt);
+                out += insert_nl_2nd_vec_stride_12(vec2, out, stride, &wrap_cnt);
+                out += insert_nl_gt16(vec3, out, stride, &wrap_cnt);
+                break;
+            }
+
+            if (++base == 3)
+                base = 0;
+        } else if (stride >= 32) {
+            out += ins_nl_gt32(vec0, out, stride, &wrap_cnt);
+            out += ins_nl_gt32(vec1, out, stride, &wrap_cnt);
+            out += ins_nl_gt32(vec2, out, stride, &wrap_cnt);
+            out += ins_nl_gt32(vec3, out, stride, &wrap_cnt);
+        } else if (stride >= 16) {
+            out += insert_nl_gt16(vec0, out, stride, &wrap_cnt);
+            out += insert_nl_gt16(vec1, out, stride, &wrap_cnt);
+            out += insert_nl_gt16(vec2, out, stride, &wrap_cnt);
+            out += insert_nl_gt16(vec3, out, stride, &wrap_cnt);
+        }
+    }
+
+    if (stride == 0) {
+        for (; i + 28 <= srclen; i += 24) {
+            /* lo = [xxxx|DDDC|CCBB|BAAA] */
+            /* hi = [xxxx|HHHG|GGFF|FEEE] */
+            const __m128i lo = _mm_loadu_si128((const __m128i *)(input + i));
+            const __m128i hi = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3));
+            /*
+             * bytes from groups A, B and C are needed in separate 32-bit lanes
+             * in = [0HHH|0GGG|0FFF|0EEE[0DDD|0CCC|0BBB|0AAA]
+             */
+            __m256i in = _mm256_shuffle_epi8(_mm256_set_m128i(hi, lo), shuf);
+            const __m256i t0 = _mm256_and_si256(in, _mm256_set1_epi32(0x0fc0fc00));
+            const __m256i t1 = _mm256_mulhi_epu16(t0, _mm256_set1_epi32(0x04000040));
+            const __m256i t2 = _mm256_and_si256(in, _mm256_set1_epi32(0x003f03f0));
+            const __m256i t3 = _mm256_mullo_epi16(t2, _mm256_set1_epi32(0x01000010));
+            const __m256i indices = _mm256_or_si256(t1, t3);
+            _mm256_storeu_si256((__m256i *)out, (use_srp ? lookup_pshufb_srp : lookup_pshufb_std)(indices));
+
+            out += 32;
+        }
+    }
+    *final_wrap_cnt = wrap_cnt;
+
+    if (stride >= 32 && wrap_cnt == stride) {
+        wrap_cnt = 0;
+        *out++ = '\n';
+    }
+
+    return (size_t)(out - (uint8_t *)dst) + evp_encodeblock_int(ctx, out, src + i, srclen - i, final_wrap_cnt);
+}
+OPENSSL_UNTARGET_AVX2
+#endif /* defined(HAVE_AVX2_INTRINSICS) */
+#endif /* !defined(_M_ARM64EC) */
+#endif
diff --git a/deps/openssl/openssl/crypto/evp/enc_b64_avx2.h b/deps/openssl/openssl/crypto/evp/enc_b64_avx2.h
new file mode 100644
index 00000000000..a450d40a8c7
--- /dev/null
+++ b/deps/openssl/openssl/crypto/evp/enc_b64_avx2.h
@@ -0,0 +1,25 @@
+#ifndef OSSL_CRYPTO_EVP_B64_AVX2_H
+#define OSSL_CRYPTO_EVP_B64_AVX2_H
+
+#include <openssl/evp.h>
+#include <stddef.h>
+
+#if defined(__clang__)
+#define HAVE_AVX2_INTRINSICS 1
+#elif defined(__GNUC__) && (__GNUC__ >= 8) && !defined(__MINGW32__)
+#define HAVE_AVX2_INTRINSICS 1
+#elif defined(_MSC_VER) && (_MSC_VER >= 1920) /* MSVC 2019 */
+#define HAVE_AVX2_INTRINSICS 1
+#endif
+
+#if defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64) || defined(__e2k__)
+#if !defined(_M_ARM64EC)
+#if defined(HAVE_AVX2_INTRINSICS)
+size_t encode_base64_avx2(EVP_ENCODE_CTX *ctx,
+    unsigned char *out, const unsigned char *src, int srclen,
+    int newlines, int *wrap_cnt);
+#endif /* defined(HAVE_AVX2_INTRINSICS) */
+#endif /* !defined(_M_ARM64EC) */
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/crypto/evp/enc_b64_scalar.c b/deps/openssl/openssl/crypto/evp/enc_b64_scalar.c
new file mode 100644
index 00000000000..4bdadcea0ca
--- /dev/null
+++ b/deps/openssl/openssl/crypto/evp/enc_b64_scalar.c
@@ -0,0 +1,286 @@
+#include <openssl/evp.h>
+#include "internal/cryptlib.h"
+#include "crypto/evp.h"
+#include "evp_local.h"
+#include "enc_b64_scalar.h"
+
+static const unsigned char base64_srp_bin2ascii_0[256] = {
+    '0', '0', '0', '0', '1', '1', '1', '1', '2', '2', '2', '2', '3', '3', '3', '3',
+    '4', '4', '4', '4', '5', '5', '5', '5', '6', '6', '6', '6', '7', '7', '7', '7',
+    '8', '8', '8', '8', '9', '9', '9', '9', 'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B',
+    'C', 'C', 'C', 'C', 'D', 'D', 'D', 'D', 'E', 'E', 'E', 'E', 'F', 'F', 'F', 'F',
+    'G', 'G', 'G', 'G', 'H', 'H', 'H', 'H', 'I', 'I', 'I', 'I', 'J', 'J', 'J', 'J',
+    'K', 'K', 'K', 'K', 'L', 'L', 'L', 'L', 'M', 'M', 'M', 'M', 'N', 'N', 'N', 'N',
+    'O', 'O', 'O', 'O', 'P', 'P', 'P', 'P', 'Q', 'Q', 'Q', 'Q', 'R', 'R', 'R', 'R',
+    'S', 'S', 'S', 'S', 'T', 'T', 'T', 'T', 'U', 'U', 'U', 'U', 'V', 'V', 'V', 'V',
+    'W', 'W', 'W', 'W', 'X', 'X', 'X', 'X', 'Y', 'Y', 'Y', 'Y', 'Z', 'Z', 'Z', 'Z',
+    'a', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'c', 'c', 'c', 'c', 'd', 'd', 'd', 'd',
+    'e', 'e', 'e', 'e', 'f', 'f', 'f', 'f', 'g', 'g', 'g', 'g', 'h', 'h', 'h', 'h',
+    'i', 'i', 'i', 'i', 'j', 'j', 'j', 'j', 'k', 'k', 'k', 'k', 'l', 'l', 'l', 'l',
+    'm', 'm', 'm', 'm', 'n', 'n', 'n', 'n', 'o', 'o', 'o', 'o', 'p', 'p', 'p', 'p',
+    'q', 'q', 'q', 'q', 'r', 'r', 'r', 'r', 's', 's', 's', 's', 't', 't', 't', 't',
+    'u', 'u', 'u', 'u', 'v', 'v', 'v', 'v', 'w', 'w', 'w', 'w', 'x', 'x', 'x', 'x',
+    'y', 'y', 'y', 'y', 'z', 'z', 'z', 'z', '.', '.', '.', '.', '/', '/', '/', '/'
+};
+
+static const unsigned char base64_srp_bin2ascii_1[256] = {
+    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
+    'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
+    'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
+    'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/',
+    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
+    'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
+    'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
+    'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/',
+    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
+    'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
+    'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
+    'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/',
+    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
+    'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
+    'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
+    'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/'
+};
+
+static const unsigned char base64_srp_bin2ascii_2[256] = {
+    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
+    'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
+    'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
+    'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/',
+    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
+    'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
+    'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
+    'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/',
+    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
+    'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
+    'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
+    'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/',
+    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
+    'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
+    'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
+    'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/'
+};
+
+static const unsigned char base64_std_bin2ascii_0[256] = {
+    'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', 'C', 'C', 'C', 'C', 'D', 'D', 'D',
+    'D', 'E', 'E', 'E', 'E', 'F', 'F', 'F', 'F', 'G', 'G', 'G', 'G', 'H', 'H',
+    'H', 'H', 'I', 'I', 'I', 'I', 'J', 'J', 'J', 'J', 'K', 'K', 'K', 'K', 'L',
+    'L', 'L', 'L', 'M', 'M', 'M', 'M', 'N', 'N', 'N', 'N', 'O', 'O', 'O', 'O',
+    'P', 'P', 'P', 'P', 'Q', 'Q', 'Q', 'Q', 'R', 'R', 'R', 'R', 'S', 'S', 'S',
+    'S', 'T', 'T', 'T', 'T', 'U', 'U', 'U', 'U', 'V', 'V', 'V', 'V', 'W', 'W',
+    'W', 'W', 'X', 'X', 'X', 'X', 'Y', 'Y', 'Y', 'Y', 'Z', 'Z', 'Z', 'Z', 'a',
+    'a', 'a', 'a', 'b', 'b', 'b', 'b', 'c', 'c', 'c', 'c', 'd', 'd', 'd', 'd',
+    'e', 'e', 'e', 'e', 'f', 'f', 'f', 'f', 'g', 'g', 'g', 'g', 'h', 'h', 'h',
+    'h', 'i', 'i', 'i', 'i', 'j', 'j', 'j', 'j', 'k', 'k', 'k', 'k', 'l', 'l',
+    'l', 'l', 'm', 'm', 'm', 'm', 'n', 'n', 'n', 'n', 'o', 'o', 'o', 'o', 'p',
+    'p', 'p', 'p', 'q', 'q', 'q', 'q', 'r', 'r', 'r', 'r', 's', 's', 's', 's',
+    't', 't', 't', 't', 'u', 'u', 'u', 'u', 'v', 'v', 'v', 'v', 'w', 'w', 'w',
+    'w', 'x', 'x', 'x', 'x', 'y', 'y', 'y', 'y', 'z', 'z', 'z', 'z', '0', '0',
+    '0', '0', '1', '1', '1', '1', '2', '2', '2', '2', '3', '3', '3', '3', '4',
+    '4', '4', '4', '5', '5', '5', '5', '6', '6', '6', '6', '7', '7', '7', '7',
+    '8', '8', '8', '8', '9', '9', '9', '9', '+', '+', '+', '+', '/', '/', '/',
+    '/'
+};
+
+static const unsigned char base64_std_bin2ascii_1[256] = {
+    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
+    'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
+    'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
+    't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7',
+    '8', '9', '+', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
+    'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
+    'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3',
+    '4', '5', '6', '7', '8', '9', '+', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
+    'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
+    'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
+    'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', 'A', 'B', 'C',
+    'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
+    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
+    'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
+    'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+',
+    '/'
+};
+
+static const unsigned char base64_std_bin2ascii_2[256] = {
+    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
+    'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
+    'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
+    't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7',
+    '8', '9', '+', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
+    'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
+    'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3',
+    '4', '5', '6', '7', '8', '9', '+', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
+    'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
+    'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
+    'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', 'A', 'B', 'C',
+    'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
+    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
+    'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
+    'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+',
+    '/'
+};
+
+size_t evp_encodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,
+    const unsigned char *f, int dlen, int *wrap_cnt)
+{
+    int i = 0;
+    size_t ret = 0;
+    uint8_t t1, t2, t3;
+    const unsigned char *e0, *e1, *e2;
+    int srp = (ctx != NULL
+        && (ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0);
+    int wrap_cnt_by_input = *wrap_cnt / 4 * 3;
+    const int ctx_length = (ctx != NULL) ? EVP_ENCODE_B64_LENGTH : 0;
+
+    if (srp) {
+        e0 = base64_srp_bin2ascii_0;
+        e1 = base64_srp_bin2ascii_1;
+        e2 = base64_srp_bin2ascii_2;
+    } else {
+        e0 = base64_std_bin2ascii_0;
+        e1 = base64_std_bin2ascii_1;
+        e2 = base64_std_bin2ascii_2;
+    }
+
+    if (ctx_length == 1) {
+        while (i < dlen && ctx != NULL) {
+            t1 = f[i];
+            *(t++) = e0[t1];
+            *(t++) = e1[(t1 & 0x03) << 4];
+            *(t++) = '=';
+            *(t++) = '=';
+            *(t++) = '\n';
+
+            ret += 5;
+            i++;
+        }
+
+        *t = '\0';
+        ret--;
+
+        return ret;
+    } else if (ctx_length % 3 != 0) {
+        i = 0;
+        int wrap_cnt_nm3 = 0;
+        while (i + 2 < dlen) {
+            if (ctx != NULL) {
+                if ((wrap_cnt_nm3 < EVP_ENCODE_B64_LENGTH
+                        && (wrap_cnt_nm3 + 3 + wrap_cnt_by_input) > EVP_ENCODE_B64_LENGTH)
+                    && ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0)) {
+
+                    switch (EVP_ENCODE_B64_LENGTH % 3) {
+                    case 0:
+                        break;
+                    case 1:
+                        t1 = f[i];
+                        *(t++) = e0[t1];
+                        *(t++) = e1[(t1 & 0x03) << 4];
+                        *(t++) = '=';
+                        *(t++) = '=';
+
+                        ret += 4;
+                        i++;
+                        break;
+                    case 2:
+                        t1 = f[i];
+                        t2 = f[i + 1];
+                        *(t++) = e0[t1];
+                        *(t++) = e1[((t1 & 0x03) << 4) | ((t2 >> 4) & 0x0F)];
+                        *(t++) = e2[(t2 & 0x0F) << 2];
+                        *(t++) = '=';
+                        i += 2;
+                        ret += 4;
+                        break;
+                    }
+                    *(t++) = '\n';
+                    ret++;
+                    wrap_cnt_nm3 = 0;
+                }
+            }
+
+            if (ctx_length >= 4 && i + 2 < dlen) {
+                t1 = f[i];
+                t2 = f[i + 1];
+                t3 = f[i + 2];
+                *(t++) = e0[t1];
+                *(t++) = e1[((t1 & 0x03) << 4) | ((t2 >> 4) & 0x0F)];
+                *(t++) = e1[((t2 & 0x0F) << 2) | ((t3 >> 6) & 0x03)];
+                *(t++) = e2[t3];
+                ret += 4;
+                wrap_cnt_nm3 += 3;
+                i += 3;
+            }
+        }
+    } else {
+        for (i = 0; i + 2 < dlen; i += 3) {
+
+            t1 = f[i];
+            t2 = f[i + 1];
+            t3 = f[i + 2];
+            *(t++) = e0[t1];
+            *(t++) = e1[((t1 & 0x03) << 4) | ((t2 >> 4) & 0x0F)];
+            *(t++) = e1[((t2 & 0x0F) << 2) | ((t3 >> 6) & 0x03)];
+            *(t++) = e2[t3];
+            ret += 4;
+
+            if (ctx != NULL) {
+                if ((i + 3 + wrap_cnt_by_input) % EVP_ENCODE_B64_LENGTH == 0
+                    && ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0)
+                    && EVP_ENCODE_B64_LENGTH % 3 == 0) {
+                    *(t++) = '\n';
+                    ret++;
+                }
+            }
+        }
+    }
+
+    switch (dlen - i) {
+    case 0:
+        break;
+    case 1:
+        t1 = f[i];
+        *(t++) = e0[t1];
+        *(t++) = e1[(t1 & 0x03) << 4];
+        *(t++) = '=';
+        *(t++) = '=';
+
+        ret += 4;
+
+        if (ctx != NULL) {
+            if ((i + 1 + wrap_cnt_by_input) % EVP_ENCODE_B64_LENGTH == 0
+                && ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0)
+                && EVP_ENCODE_B64_LENGTH % 3 == 0) {
+                *(t++) = '\n';
+                ret++;
+            }
+        }
+
+        break;
+    case 2:
+        t1 = f[i];
+        t2 = f[i + 1];
+        *(t++) = e0[t1];
+        *(t++) = e1[((t1 & 0x03) << 4) | ((t2 >> 4) & 0x0F)];
+        *(t++) = e2[(t2 & 0x0F) << 2];
+        *(t++) = '=';
+        ret += 4;
+
+        if (ctx != NULL) {
+            if ((i + 2 + wrap_cnt_by_input) % EVP_ENCODE_B64_LENGTH == 0
+                && ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0)
+                && EVP_ENCODE_B64_LENGTH % 3 == 0) {
+                *(t++) = '\n';
+                ret++;
+            }
+        }
+        break;
+    }
+
+    *t = '\0';
+
+    return ret;
+}
diff --git a/deps/openssl/openssl/crypto/evp/enc_b64_scalar.h b/deps/openssl/openssl/crypto/evp/enc_b64_scalar.h
new file mode 100644
index 00000000000..43059938ccf
--- /dev/null
+++ b/deps/openssl/openssl/crypto/evp/enc_b64_scalar.h
@@ -0,0 +1,9 @@
+#ifndef OSSL_CRYPTO_EVP_B64_SCALAR_H
+#define OSSL_CRYPTO_EVP_B64_SCALAR_H
+#include <openssl/evp.h>
+#include <stddef.h>
+
+size_t evp_encodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,
+    const unsigned char *f, int dlen, int *wrap_cnt);
+
+#endif
diff --git a/deps/openssl/openssl/crypto/evp/encode.c b/deps/openssl/openssl/crypto/evp/encode.c
index 19cc550519e..dd66c7d2d65 100644
--- a/deps/openssl/openssl/crypto/evp/encode.c
+++ b/deps/openssl/openssl/crypto/evp/encode.c
@@ -9,30 +9,27 @@

 #include <stdio.h>
 #include <limits.h>
+#include <assert.h>
 #include "internal/cryptlib.h"
 #include <openssl/evp.h>
 #include "crypto/evp.h"
 #include "evp_local.h"

+#if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
+#if !defined(_M_ARM64EC)
+#define HAS_IA32CAP_IS_64
+#endif /* !defined(_M_ARM64EC) */
+#endif
+
+#include "enc_b64_avx2.h"
+#include "enc_b64_scalar.h"
+
 static unsigned char conv_ascii2bin(unsigned char a,
     const unsigned char *table);
-static int evp_encodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,
-    const unsigned char *f, int dlen);
+size_t evp_encodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,
+    const unsigned char *f, int dlen, int *wrap_cnt);
 static int evp_decodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,
     const unsigned char *f, int n, int eof);
-
-#ifndef CHARSET_EBCDIC
-#define conv_bin2ascii(a, table) ((table)[(a) & 0x3f])
-#else
-/*
- * We assume that PEM encoded files are EBCDIC files (i.e., printable text
- * files). Convert them here while decoding. When encoding, output is EBCDIC
- * (text) format again. (No need for conversion in the conv_bin2ascii macro,
- * as the underlying textstring data_bin2ascii[] is already EBCDIC)
- */
-#define conv_bin2ascii(a, table) ((table)[(a) & 0x3f])
-#endif
-
 /*-
  * 64 char lines
  * pad input with 0
@@ -45,11 +42,6 @@ static int evp_decodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,
 #define CHUNKS_PER_LINE (64 / 4)
 #define CHAR_PER_LINE (64 + 1)

-static const unsigned char data_bin2ascii[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-/* SRP uses a different base64 alphabet */
-static const unsigned char srpdata_bin2ascii[65] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./";
-
 /*-
  * 0xF0 is a EOLN
  * 0xF1 is ignore but next needs to be 0xF0 (for \r\n processing).
@@ -144,7 +136,6 @@ void evp_encode_ctx_set_flags(EVP_ENCODE_CTX *ctx, unsigned int flags)

 void EVP_EncodeInit(EVP_ENCODE_CTX *ctx)
 {
-    ctx->length = 48;
     ctx->num = 0;
     ctx->line_num = 0;
     ctx->flags = 0;
@@ -153,45 +144,70 @@ void EVP_EncodeInit(EVP_ENCODE_CTX *ctx)
 int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
     const unsigned char *in, int inl)
 {
-    int i, j;
+    int i;
+    size_t j;
     size_t total = 0;

     *outl = 0;
     if (inl <= 0)
         return 0;
-    OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data));
-    if (ctx->length - ctx->num > inl) {
+    assert(EVP_ENCODE_B64_LENGTH <= (int)sizeof(ctx->enc_data));
+    if (EVP_ENCODE_B64_LENGTH - ctx->num > inl) {
         memcpy(&(ctx->enc_data[ctx->num]), in, inl);
         ctx->num += inl;
         return 1;
     }
     if (ctx->num != 0) {
-        i = ctx->length - ctx->num;
+        i = EVP_ENCODE_B64_LENGTH - ctx->num;
         memcpy(&(ctx->enc_data[ctx->num]), in, i);
         in += i;
         inl -= i;
-        j = evp_encodeblock_int(ctx, out, ctx->enc_data, ctx->length);
+        int wrap_cnt = 0;
+        j = evp_encodeblock_int(ctx, out, ctx->enc_data, EVP_ENCODE_B64_LENGTH,
+            &wrap_cnt);
         ctx->num = 0;
         out += j;
         total = j;
-        if ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0) {
-            *(out++) = '\n';
-            total++;
-        }
         *out = '\0';
     }
-    while (inl >= ctx->length && total <= INT_MAX) {
-        j = evp_encodeblock_int(ctx, out, in, ctx->length);
-        in += ctx->length;
-        inl -= ctx->length;
-        out += j;
-        total += j;
-        if ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0) {
-            *(out++) = '\n';
-            total++;
+    int wrap_cnt = 0;
+    if (EVP_ENCODE_B64_LENGTH % 3 != 0) {
+        j = evp_encodeblock_int(ctx, out, in, inl - (inl % EVP_ENCODE_B64_LENGTH),
+            &wrap_cnt);
+    } else {
+#if defined(__AVX2__) && defined(HAVE_AVX2_INTRINSICS)
+        const int newlines = !(ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) ? EVP_ENCODE_B64_LENGTH : 0;
+
+        j = encode_base64_avx2(ctx,
+            (unsigned char *)out,
+            (const unsigned char *)in,
+            inl - (inl % EVP_ENCODE_B64_LENGTH), newlines, &wrap_cnt);
+#elif defined(HAS_IA32CAP_IS_64) && defined(HAVE_AVX2_INTRINSICS)
+        if ((OPENSSL_ia32cap_P[2] & (1u << 5)) != 0) {
+            const int newlines = !(ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) ? EVP_ENCODE_B64_LENGTH : 0;
+
+            j = encode_base64_avx2(ctx,
+                (unsigned char *)out,
+                (const unsigned char *)in,
+                inl - (inl % EVP_ENCODE_B64_LENGTH), newlines, &wrap_cnt);
+        } else {
+            j = evp_encodeblock_int(ctx, out, in, inl - (inl % EVP_ENCODE_B64_LENGTH),
+                &wrap_cnt);
         }
-        *out = '\0';
+#else
+        j = evp_encodeblock_int(ctx, out, in, inl - (inl % EVP_ENCODE_B64_LENGTH),
+            &wrap_cnt);
+#endif
     }
+    in += inl - (inl % EVP_ENCODE_B64_LENGTH);
+    inl -= inl - (inl % EVP_ENCODE_B64_LENGTH);
+    out += j;
+    total += j;
+    if ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0 && EVP_ENCODE_B64_LENGTH % 3 != 0) {
+        *(out++) = '\n';
+        total++;
+    }
+    *out = '\0';
     if (total > INT_MAX) {
         /* Too much output data! */
         *outl = 0;
@@ -200,72 +216,49 @@ int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
     if (inl != 0)
         memcpy(&(ctx->enc_data[0]), in, inl);
     ctx->num = inl;
-    *outl = total;
+    *outl = (int)total;

     return 1;
 }

 void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)
 {
-    unsigned int ret = 0;
+    size_t ret = 0;
+    int wrap_cnt = 0;

     if (ctx->num != 0) {
-        ret = evp_encodeblock_int(ctx, out, ctx->enc_data, ctx->num);
-        if ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0)
-            out[ret++] = '\n';
-        out[ret] = '\0';
-        ctx->num = 0;
-    }
-    *outl = ret;
-}
-
-static int evp_encodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,
-    const unsigned char *f, int dlen)
-{
-    int i, ret = 0;
-    unsigned long l;
-    const unsigned char *table;
-
-    if (ctx != NULL && (ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0)
-        table = srpdata_bin2ascii;
-    else
-        table = data_bin2ascii;
-
-    for (i = dlen; i > 0; i -= 3) {
-        if (i >= 3) {
-            l = (((unsigned long)f[0]) << 16L) | (((unsigned long)f[1]) << 8L) | f[2];
-            *(t++) = conv_bin2ascii(l >> 18L, table);
-            *(t++) = conv_bin2ascii(l >> 12L, table);
-            *(t++) = conv_bin2ascii(l >> 6L, table);
-            *(t++) = conv_bin2ascii(l, table);
-        } else {
-            l = ((unsigned long)f[0]) << 16L;
-            if (i == 2)
-                l |= ((unsigned long)f[1] << 8L);
-
-            *(t++) = conv_bin2ascii(l >> 18L, table);
-            *(t++) = conv_bin2ascii(l >> 12L, table);
-            *(t++) = (i == 1) ? '=' : conv_bin2ascii(l >> 6L, table);
-            *(t++) = '=';
+        ret = evp_encodeblock_int(ctx, out, ctx->enc_data, ctx->num,
+            &wrap_cnt);
+        if (ret > 0) {
+            if ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0)
+                out[ret++] = '\n';
+            out[ret] = '\0';
+            ctx->num = 0;
         }
-        ret += 4;
-        f += 3;
     }
-
-    *t = '\0';
-    return ret;
+    *outl = (int)ret;
 }

 int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int dlen)
 {
-    return evp_encodeblock_int(NULL, t, f, dlen);
+    int wrap_cnt = 0;
+
+#if defined(__AVX2__) && defined(HAVE_AVX2_INTRINSICS)
+    return (int)encode_base64_avx2(NULL, t, f, dlen, 0, &wrap_cnt);
+#elif defined(HAS_IA32CAP_IS_64) && defined(HAVE_AVX2_INTRINSICS)
+    if ((OPENSSL_ia32cap_P[2] & (1u << 5)) != 0)
+        return (int)encode_base64_avx2(NULL, t, f, dlen, 0, &wrap_cnt);
+    else
+        return (int)evp_encodeblock_int(NULL, t, f, dlen, &wrap_cnt);
+#else
+    return (int)evp_encodeblock_int(NULL, t, f, dlen, &wrap_cnt);
+#endif
 }

 void EVP_DecodeInit(EVP_ENCODE_CTX *ctx)
 {
     /* Only ctx->num and ctx->flags are used during decoding. */
     ctx->num = 0;
-    ctx->length = 0;
     ctx->line_num = 0;
     ctx->flags = 0;
 }
@@ -463,16 +456,16 @@ static int evp_decodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,

     switch (eof) {
     case 2:
-        *(t++) = (unsigned char)(l >> 16L) & 0xff;
+        *t = (unsigned char)(l >> 16L) & 0xff;
         break;
     case 1:
         *(t++) = (unsigned char)(l >> 16L) & 0xff;
-        *(t++) = (unsigned char)(l >> 8L) & 0xff;
+        *t = (unsigned char)(l >> 8L) & 0xff;
         break;
     case 0:
         *(t++) = (unsigned char)(l >> 16L) & 0xff;
         *(t++) = (unsigned char)(l >> 8L) & 0xff;
-        *(t++) = (unsigned char)(l) & 0xff;
+        *t = (unsigned char)(l) & 0xff;
         break;
     }
     ret += 3 - eof;
diff --git a/deps/openssl/openssl/crypto/evp/evp_enc.c b/deps/openssl/openssl/crypto/evp/evp_enc.c
index 109412b342b..4b3fdc63759 100644
--- a/deps/openssl/openssl/crypto/evp/evp_enc.c
+++ b/deps/openssl/openssl/crypto/evp/evp_enc.c
@@ -7,23 +7,18 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
 #include <stdio.h>
 #include <limits.h>
 #include <assert.h>
 #include <openssl/evp.h>
 #include <openssl/err.h>
 #include <openssl/rand.h>
-#ifndef FIPS_MODULE
-#include <openssl/engine.h>
-#endif
 #include <openssl/params.h>
 #include <openssl/core_names.h>
 #include "internal/cryptlib.h"
 #include "internal/provider.h"
 #include "internal/core.h"
+#include "internal/common.h"
 #include "internal/safe_math.h"
 #include "crypto/evp.h"
 #include "evp_local.h"
@@ -36,7 +31,7 @@ int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx)
         return 1;

     if (ctx->cipher == NULL || ctx->cipher->prov == NULL)
-        goto legacy;
+        return 1;

     if (ctx->algctx != NULL) {
         if (ctx->cipher->freectx != NULL)
@@ -49,24 +44,6 @@ int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx)
     ctx->iv_len = -1;

     return 1;
-
-    /* Remove legacy code below when legacy support is removed. */
-legacy:
-
-    if (ctx->cipher != NULL) {
-        if (ctx->cipher->cleanup && !ctx->cipher->cleanup(ctx))
-            return 0;
-        /* Cleanse cipher context data */
-        if (ctx->cipher_data && ctx->cipher->ctx_size)
-            OPENSSL_cleanse(ctx->cipher_data, ctx->cipher->ctx_size);
-    }
-    OPENSSL_free(ctx->cipher_data);
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    ENGINE_finish(ctx->engine);
-#endif
-    memset(ctx, 0, sizeof(*ctx));
-    ctx->iv_len = -1;
-    return 1;
 }

 EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void)
@@ -91,16 +68,11 @@ void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx)

 static int evp_cipher_init_internal(EVP_CIPHER_CTX *ctx,
     const EVP_CIPHER *cipher,
-    ENGINE *impl, const unsigned char *key,
+    const unsigned char *key,
     const unsigned char *iv, int enc,
     uint8_t is_pipeline,
     const OSSL_PARAM params[])
 {
-    int n;
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    ENGINE *tmpimpl = NULL;
-#endif
-
     /*
      * enc == 1 means we are encrypting.
      * enc == 0 means we are decrypting.
@@ -119,57 +91,6 @@ static int evp_cipher_init_internal(EVP_CIPHER_CTX *ctx,
         return 0;
     }

-    /* Code below to be removed when legacy support is dropped. */
-    if (is_pipeline)
-        goto nonlegacy;
-
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    /*
-     * Whether it's nice or not, "Inits" can be used on "Final"'d contexts so
-     * this context may already have an ENGINE! Try to avoid releasing the
-     * previous handle, re-querying for an ENGINE, and having a
-     * reinitialisation, when it may all be unnecessary.
-     */
-    if (ctx->engine && ctx->cipher
-        && (cipher == NULL || cipher->nid == ctx->cipher->nid))
-        goto skip_to_init;
-
-    if (cipher != NULL && impl == NULL) {
-        /* Ask if an ENGINE is reserved for this job */
-        tmpimpl = ENGINE_get_cipher_engine(cipher->nid);
-    }
-#endif
-
-    /*
-     * If there are engines involved then we should use legacy handling for now.
-     */
-    if (ctx->engine != NULL
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-        || tmpimpl != NULL
-#endif
-        || impl != NULL
-        || (cipher != NULL && cipher->origin == EVP_ORIG_METH)
-        || (cipher == NULL && ctx->cipher != NULL
-            && ctx->cipher->origin == EVP_ORIG_METH)) {
-        if (ctx->cipher == ctx->fetched_cipher)
-            ctx->cipher = NULL;
-        EVP_CIPHER_free(ctx->fetched_cipher);
-        ctx->fetched_cipher = NULL;
-        goto legacy;
-    }
-    /*
-     * Ensure a context left lying around from last time is cleared
-     * (legacy code)
-     */
-    if (cipher != NULL && ctx->cipher != NULL) {
-        if (ctx->cipher->cleanup != NULL && !ctx->cipher->cleanup(ctx))
-            return 0;
-        OPENSSL_clear_free(ctx->cipher_data, ctx->cipher->ctx_size);
-        ctx->cipher_data = NULL;
-    }
-
-    /* Start of non-legacy code below */
-nonlegacy:
     /* Ensure a context left lying around from last time is cleared */
     if (cipher != NULL && ctx->cipher != NULL) {
         unsigned long flags = ctx->flags;
@@ -331,149 +252,9 @@ nonlegacy:
         iv == NULL ? 0
                    : EVP_CIPHER_CTX_get_iv_length(ctx),
         params);
-
-    /* Code below to be removed when legacy support is dropped. */
-legacy:
-
-    if (cipher != NULL) {
-        /*
-         * Ensure a context left lying around from last time is cleared (we
-         * previously attempted to avoid this if the same ENGINE and
-         * EVP_CIPHER could be used).
-         */
-        if (ctx->cipher) {
-            unsigned long flags = ctx->flags;
-            EVP_CIPHER_CTX_reset(ctx);
-            /* Restore encrypt and flags */
-            ctx->encrypt = enc;
-            ctx->flags = flags;
-        }
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-        if (impl != NULL) {
-            if (!ENGINE_init(impl)) {
-                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
-                return 0;
-            }
-        } else {
-            impl = tmpimpl;
-        }
-        if (impl != NULL) {
-            /* There's an ENGINE for this job ... (apparently) */
-            const EVP_CIPHER *c = ENGINE_get_cipher(impl, cipher->nid);
-
-            if (c == NULL) {
-                /*
-                 * One positive side-effect of US's export control history,
-                 * is that we should at least be able to avoid using US
-                 * misspellings of "initialisation"?
-                 */
-                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
-                return 0;
-            }
-            /* We'll use the ENGINE's private cipher definition */
-            cipher = c;
-            /*
-             * Store the ENGINE functional reference so we know 'cipher' came
-             * from an ENGINE and we need to release it when done.
-             */
-            ctx->engine = impl;
-        } else {
-            ctx->engine = NULL;
-        }
-#endif
-
-        ctx->cipher = cipher;
-        if (ctx->cipher->ctx_size) {
-            ctx->cipher_data = OPENSSL_zalloc(ctx->cipher->ctx_size);
-            if (ctx->cipher_data == NULL) {
-                ctx->cipher = NULL;
-                return 0;
-            }
-        } else {
-            ctx->cipher_data = NULL;
-        }
-        ctx->key_len = cipher->key_len;
-        /* Preserve wrap enable flag, zero everything else */
-        ctx->flags &= EVP_CIPHER_CTX_FLAG_WRAP_ALLOW;
-        if (ctx->cipher->flags & EVP_CIPH_CTRL_INIT) {
-            if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL) <= 0) {
-                ctx->cipher = NULL;
-                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
-                return 0;
-            }
-        }
-    }
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-skip_to_init:
-#endif
-    if (ctx->cipher == NULL)
-        return 0;
-
-    /* we assume block size is a power of 2 in *cryptUpdate */
-    OPENSSL_assert(ctx->cipher->block_size == 1
-        || ctx->cipher->block_size == 8
-        || ctx->cipher->block_size == 16);
-
-    if (!(ctx->flags & EVP_CIPHER_CTX_FLAG_WRAP_ALLOW)
-        && EVP_CIPHER_CTX_get_mode(ctx) == EVP_CIPH_WRAP_MODE) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED);
-        return 0;
-    }
-
-    if ((EVP_CIPHER_get_flags(EVP_CIPHER_CTX_get0_cipher(ctx))
-            & EVP_CIPH_CUSTOM_IV)
-        == 0) {
-        switch (EVP_CIPHER_CTX_get_mode(ctx)) {
-
-        case EVP_CIPH_STREAM_CIPHER:
-        case EVP_CIPH_ECB_MODE:
-            break;
-
-        case EVP_CIPH_CFB_MODE:
-        case EVP_CIPH_OFB_MODE:
-
-            ctx->num = 0;
-            /* fall-through */
-
-        case EVP_CIPH_CBC_MODE:
-            n = EVP_CIPHER_CTX_get_iv_length(ctx);
-            if (n < 0 || n > (int)sizeof(ctx->iv)) {
-                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH);
-                return 0;
-            }
-            if (iv != NULL)
-                memcpy(ctx->oiv, iv, n);
-            memcpy(ctx->iv, ctx->oiv, n);
-            break;
-
-        case EVP_CIPH_CTR_MODE:
-            ctx->num = 0;
-            /* Don't reuse IV for CTR mode */
-            if (iv != NULL) {
-                n = EVP_CIPHER_CTX_get_iv_length(ctx);
-                if (n <= 0 || n > (int)sizeof(ctx->iv)) {
-                    ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH);
-                    return 0;
-                }
-                memcpy(ctx->iv, iv, n);
-            }
-            break;
-
-        default:
-            return 0;
-        }
-    }
-
-    if (key != NULL || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) {
-        if (!ctx->cipher->init(ctx, key, iv, enc))
-            return 0;
-    }
-    ctx->buf_len = 0;
-    ctx->final_used = 0;
-    ctx->block_mask = ctx->cipher->block_size - 1;
-    return 1;
 }

+#ifndef FIPS_MODULE
 /*
  * This function is basically evp_cipher_init_internal without ENGINE support.
  * They should be combined when engines are not supported any longer.
@@ -501,27 +282,6 @@ static int evp_cipher_init_skey_internal(EVP_CIPHER_CTX *ctx,
         return 0;
     }

-    /*
-     * If there are engines involved then we throw an error
-     */
-    if (ctx->engine != NULL
-        || (cipher != NULL && cipher->origin == EVP_ORIG_METH)
-        || (cipher == NULL && ctx->cipher != NULL
-            && ctx->cipher->origin == EVP_ORIG_METH)) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
-        return 0;
-    }
-    /*
-     * Ensure a context left lying around from last time is cleared
-     * (legacy code)
-     */
-    if (cipher != NULL && ctx->cipher != NULL) {
-        if (ctx->cipher->cleanup != NULL && !ctx->cipher->cleanup(ctx))
-            return 0;
-        OPENSSL_clear_free(ctx->cipher_data, ctx->cipher->ctx_size);
-        ctx->cipher_data = NULL;
-    }
-
     /* Ensure a context left lying around from last time is cleared */
     if (cipher != NULL && ctx->cipher != NULL) {
         unsigned long flags = ctx->flags;
@@ -630,12 +390,13 @@ int EVP_CipherInit_SKEY(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
 {
     return evp_cipher_init_skey_internal(ctx, cipher, skey, iv, iv_len, enc, params);
 }
+#endif /* !FIPS_MODULE */

 int EVP_CipherInit_ex2(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
     const unsigned char *key, const unsigned char *iv,
     int enc, const OSSL_PARAM params[])
 {
-    return evp_cipher_init_internal(ctx, cipher, NULL, key, iv, enc, 0, params);
+    return evp_cipher_init_internal(ctx, cipher, key, iv, enc, 0, params);
 }

 int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
@@ -643,14 +404,16 @@ int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
 {
     if (cipher != NULL)
         EVP_CIPHER_CTX_reset(ctx);
-    return evp_cipher_init_internal(ctx, cipher, NULL, key, iv, enc, 0, NULL);
+    return evp_cipher_init_internal(ctx, cipher, key, iv, enc, 0, NULL);
 }

 int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
     ENGINE *impl, const unsigned char *key,
     const unsigned char *iv, int enc)
 {
-    return evp_cipher_init_internal(ctx, cipher, impl, key, iv, enc, 0, NULL);
+    if (!ossl_assert(impl == NULL))
+        return 0;
+    return evp_cipher_init_internal(ctx, cipher, key, iv, enc, 0, NULL);
 }

 int EVP_CipherPipelineEncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
@@ -665,7 +428,7 @@ int EVP_CipherPipelineEncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,

     ctx->numpipes = numpipes;

-    if (!evp_cipher_init_internal(ctx, cipher, NULL, NULL, NULL, 1, 1,
+    if (!evp_cipher_init_internal(ctx, cipher, NULL, NULL, 1, 1,
             NULL))
         return 0;

@@ -695,7 +458,7 @@ int EVP_CipherPipelineDecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,

     ctx->numpipes = numpipes;

-    if (!evp_cipher_init_internal(ctx, cipher, NULL, NULL, NULL, 0, 1,
+    if (!evp_cipher_init_internal(ctx, cipher, NULL, NULL, 0, 1,
             NULL))
         return 0;

@@ -816,7 +579,9 @@ int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
     ENGINE *impl, const unsigned char *key,
     const unsigned char *iv)
 {
-    return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 1);
+    if (!ossl_assert(impl == NULL))
+        return 0;
+    return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, 1);
 }

 int EVP_EncryptInit_ex2(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
@@ -836,7 +601,9 @@ int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
     ENGINE *impl, const unsigned char *key,
     const unsigned char *iv)
 {
-    return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 0);
+    if (!ossl_assert(impl == NULL))
+        return 0;
+    return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, 0);
 }

 int EVP_DecryptInit_ex2(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
@@ -882,96 +649,6 @@ int ossl_is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
     return overlapped;
 }

-static int evp_EncryptDecryptUpdate(EVP_CIPHER_CTX *ctx,
-    unsigned char *out, int *outl,
-    const unsigned char *in, int inl)
-{
-    int i, j, bl, cmpl = inl;
-
-    if (EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS))
-        cmpl = safe_div_round_up_int(cmpl, 8, NULL);
-
-    bl = ctx->cipher->block_size;
-
-    if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) {
-        /* If block size > 1 then the cipher will have to do this check */
-        if (bl == 1 && ossl_is_partially_overlapping(out, in, cmpl)) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING);
-            return 0;
-        }
-
-        i = ctx->cipher->do_cipher(ctx, out, in, inl);
-        if (i < 0)
-            return 0;
-        else
-            *outl = i;
-        return 1;
-    }
-
-    if (inl <= 0) {
-        *outl = 0;
-        return inl == 0;
-    }
-    if (ossl_is_partially_overlapping(out + ctx->buf_len, in, cmpl)) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING);
-        return 0;
-    }
-
-    if (ctx->buf_len == 0 && (inl & (ctx->block_mask)) == 0) {
-        if (ctx->cipher->do_cipher(ctx, out, in, inl)) {
-            *outl = inl;
-            return 1;
-        } else {
-            *outl = 0;
-            return 0;
-        }
-    }
-    i = ctx->buf_len;
-    OPENSSL_assert(bl <= (int)sizeof(ctx->buf));
-    if (i != 0) {
-        if (bl - i > inl) {
-            memcpy(&(ctx->buf[i]), in, inl);
-            ctx->buf_len += inl;
-            *outl = 0;
-            return 1;
-        } else {
-            j = bl - i;
-
-            /*
-             * Once we've processed the first j bytes from in, the amount of
-             * data left that is a multiple of the block length is:
-             * (inl - j) & ~(bl - 1)
-             * We must ensure that this amount of data, plus the one block that
-             * we process from ctx->buf does not exceed INT_MAX
-             */
-            if (((inl - j) & ~(bl - 1)) > INT_MAX - bl) {
-                ERR_raise(ERR_LIB_EVP, EVP_R_OUTPUT_WOULD_OVERFLOW);
-                return 0;
-            }
-            memcpy(&(ctx->buf[i]), in, j);
-            inl -= j;
-            in += j;
-            if (!ctx->cipher->do_cipher(ctx, out, ctx->buf, bl))
-                return 0;
-            out += bl;
-            *outl = bl;
-        }
-    } else
-        *outl = 0;
-    i = inl & (bl - 1);
-    inl -= i;
-    if (inl > 0) {
-        if (!ctx->cipher->do_cipher(ctx, out, in, inl))
-            return 0;
-        *outl += inl;
-    }
-
-    if (i != 0)
-        memcpy(ctx->buf, &(in[inl]), i);
-    ctx->buf_len = i;
-    return 1;
-}
-
 int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
     const unsigned char *in, int inl)
 {
@@ -1003,7 +680,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
     }

     if (ossl_unlikely(ctx->cipher->prov == NULL))
-        goto legacy;
+        return 0;

     blocksize = ctx->cipher->block_size;

@@ -1017,19 +694,14 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
         in, inl_);

     if (ossl_likely(ret)) {
-        if (soutl > INT_MAX) {
+        if (ossl_unlikely(soutl > INT_MAX)) {
             ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
             return 0;
         }
-        *outl = soutl;
+        *outl = (int)soutl;
     }

     return ret;
-
-    /* Code below to be removed when legacy support is dropped. */
-legacy:
-
-    return evp_EncryptDecryptUpdate(ctx, out, outl, in, inl);
 }

 int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
@@ -1041,8 +713,7 @@ int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)

 int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
 {
-    int n, ret;
-    unsigned int i, b, bl;
+    int ret;
     size_t soutl;
     int blocksize;

@@ -1063,8 +734,10 @@ int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
         ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
         return 0;
     }
-    if (ctx->cipher->prov == NULL)
-        goto legacy;
+    if (ctx->cipher->prov == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
+        return 0;
+    }

     blocksize = EVP_CIPHER_CTX_get_block_size(ctx);

@@ -1081,55 +754,16 @@ int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
             ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
             return 0;
         }
-        *outl = soutl;
+        *outl = (int)soutl;
     }

     return ret;
-
-    /* Code below to be removed when legacy support is dropped. */
-legacy:
-
-    if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) {
-        ret = ctx->cipher->do_cipher(ctx, out, NULL, 0);
-        if (ret < 0)
-            return 0;
-        else
-            *outl = ret;
-        return 1;
-    }
-
-    b = ctx->cipher->block_size;
-    OPENSSL_assert(b <= sizeof(ctx->buf));
-    if (b == 1) {
-        *outl = 0;
-        return 1;
-    }
-    bl = ctx->buf_len;
-    if (ctx->flags & EVP_CIPH_NO_PADDING) {
-        if (bl) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH);
-            return 0;
-        }
-        *outl = 0;
-        return 1;
-    }
-
-    n = b - bl;
-    for (i = bl; i < b; i++)
-        ctx->buf[i] = n;
-    ret = ctx->cipher->do_cipher(ctx, out, ctx->buf, b);
-
-    if (ret)
-        *outl = b;
-
-    return ret;
 }

 int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
     const unsigned char *in, int inl)
 {
-    int fix_len, cmpl = inl, ret;
-    unsigned int b;
+    int ret;
     size_t soutl, inl_ = (size_t)inl;
     int blocksize;

@@ -1155,8 +789,10 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
         ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
         return 0;
     }
-    if (ossl_unlikely(ctx->cipher->prov == NULL))
-        goto legacy;
+    if (ossl_unlikely(ctx->cipher->prov == NULL)) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
+        return 0;
+    }

     blocksize = EVP_CIPHER_CTX_get_block_size(ctx);

@@ -1169,92 +805,14 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
         in, inl_);

     if (ossl_likely(ret)) {
-        if (soutl > INT_MAX) {
+        if (ossl_unlikely(soutl > INT_MAX)) {
             ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
             return 0;
         }
-        *outl = soutl;
+        *outl = (int)soutl;
     }

     return ret;
-
-    /* Code below to be removed when legacy support is dropped. */
-legacy:
-
-    b = ctx->cipher->block_size;
-
-    if (EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS))
-        cmpl = safe_div_round_up_int(cmpl, 8, NULL);
-
-    if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) {
-        if (b == 1 && ossl_is_partially_overlapping(out, in, cmpl)) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING);
-            return 0;
-        }
-
-        fix_len = ctx->cipher->do_cipher(ctx, out, in, inl);
-        if (fix_len < 0) {
-            *outl = 0;
-            return 0;
-        } else
-            *outl = fix_len;
-        return 1;
-    }
-
-    if (inl <= 0) {
-        *outl = 0;
-        return inl == 0;
-    }
-
-    if (ctx->flags & EVP_CIPH_NO_PADDING)
-        return evp_EncryptDecryptUpdate(ctx, out, outl, in, inl);
-
-    OPENSSL_assert(b <= sizeof(ctx->final));
-
-    if (ctx->final_used) {
-        /* see comment about PTRDIFF_T comparison above */
-        if (((PTRDIFF_T)out == (PTRDIFF_T)in)
-            || ossl_is_partially_overlapping(out, in, b)) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING);
-            return 0;
-        }
-        /*
-         * final_used is only ever set if buf_len is 0. Therefore the maximum
-         * length output we will ever see from evp_EncryptDecryptUpdate is
-         * the maximum multiple of the block length that is <= inl, or just:
-         * inl & ~(b - 1)
-         * Since final_used has been set then the final output length is:
-         * (inl & ~(b - 1)) + b
-         * This must never exceed INT_MAX
-         */
-        if ((inl & ~(b - 1)) > INT_MAX - b) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_OUTPUT_WOULD_OVERFLOW);
-            return 0;
-        }
-        memcpy(out, ctx->final, b);
-        out += b;
-        fix_len = 1;
-    } else
-        fix_len = 0;
-
-    if (!evp_EncryptDecryptUpdate(ctx, out, outl, in, inl))
-        return 0;
-
-    /*
-     * if we have 'decrypted' a multiple of block size, make sure we have a
-     * copy of this last block
-     */
-    if (b > 1 && !ctx->buf_len) {
-        *outl -= b;
-        ctx->final_used = 1;
-        memcpy(ctx->final, &out[*outl], b);
-    } else
-        ctx->final_used = 0;
-
-    if (fix_len)
-        *outl += b;
-
-    return 1;
 }

 int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
@@ -1266,8 +824,6 @@ int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)

 int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
 {
-    int i, n;
-    unsigned int b;
     size_t soutl;
     int ret;
     int blocksize;
@@ -1290,8 +846,10 @@ int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
         return 0;
     }

-    if (ctx->cipher->prov == NULL)
-        goto legacy;
+    if (ctx->cipher->prov == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
+        return 0;
+    }

     blocksize = EVP_CIPHER_CTX_get_block_size(ctx);

@@ -1308,107 +866,42 @@ int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
             ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
             return 0;
         }
-        *outl = soutl;
+        *outl = (int)soutl;
     }

     return ret;
-
-    /* Code below to be removed when legacy support is dropped. */
-legacy:
-
-    *outl = 0;
-    if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) {
-        i = ctx->cipher->do_cipher(ctx, out, NULL, 0);
-        if (i < 0)
-            return 0;
-        else
-            *outl = i;
-        return 1;
-    }
-
-    b = ctx->cipher->block_size;
-    if (ctx->flags & EVP_CIPH_NO_PADDING) {
-        if (ctx->buf_len) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH);
-            return 0;
-        }
-        *outl = 0;
-        return 1;
-    }
-    if (b > 1) {
-        if (ctx->buf_len || !ctx->final_used) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_WRONG_FINAL_BLOCK_LENGTH);
-            return 0;
-        }
-        OPENSSL_assert(b <= sizeof(ctx->final));
-
-        /*
-         * The following assumes that the ciphertext has been authenticated.
-         * Otherwise it provides a padding oracle.
-         */
-        n = ctx->final[b - 1];
-        if (n == 0 || n > (int)b) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_BAD_DECRYPT);
-            return 0;
-        }
-        for (i = 0; i < n; i++) {
-            if (ctx->final[--b] != n) {
-                ERR_raise(ERR_LIB_EVP, EVP_R_BAD_DECRYPT);
-                return 0;
-            }
-        }
-        n = ctx->cipher->block_size - n;
-        for (i = 0; i < n; i++)
-            out[i] = ctx->final[i];
-        *outl = n;
-    }
-    return 1;
 }

 int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, int keylen)
 {
-    if (c->cipher->prov != NULL) {
-        int ok;
-        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
-        size_t len;
-
-        if (EVP_CIPHER_CTX_get_key_length(c) == keylen)
-            return 1;
-
-        /* Check the cipher actually understands this parameter */
-        if (OSSL_PARAM_locate_const(EVP_CIPHER_settable_ctx_params(c->cipher),
-                OSSL_CIPHER_PARAM_KEYLEN)
-            == NULL) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
+    int ok;
+    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+    size_t len;

-        params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &len);
-        if (!OSSL_PARAM_set_int(params, keylen))
-            return 0;
-        ok = evp_do_ciph_ctx_setparams(c->cipher, c->algctx, params);
-        if (ok <= 0)
-            return 0;
-        c->key_len = keylen;
-        return 1;
+    if (c->cipher->prov == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_CIPHER_PARAMETER_ERROR);
+        return 0;
     }

-    /* Code below to be removed when legacy support is dropped. */
-
-    /*
-     * Note there have never been any built-in ciphers that define this flag
-     * since it was first introduced.
-     */
-    if (c->cipher->flags & EVP_CIPH_CUSTOM_KEY_LENGTH)
-        return EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_KEY_LENGTH, keylen, NULL);
     if (EVP_CIPHER_CTX_get_key_length(c) == keylen)
         return 1;
-    if ((keylen > 0) && (c->cipher->flags & EVP_CIPH_VARIABLE_LENGTH)) {
-        c->key_len = keylen;
-        return 1;
+
+    /* Check the cipher actually understands this parameter */
+    if (OSSL_PARAM_locate_const(EVP_CIPHER_settable_ctx_params(c->cipher),
+            OSSL_CIPHER_PARAM_KEYLEN)
+        == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
+        return 0;
     }
-    ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
-    return 0;
+
+    params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &len);
+    if (!OSSL_PARAM_set_int(params, keylen))
+        return 0;
+    ok = evp_do_ciph_ctx_setparams(c->cipher, c->algctx, params);
+    if (ok <= 0)
+        return 0;
+    c->key_len = keylen;
+    return 1;
 }

 int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *ctx, int pad)
@@ -1445,8 +938,10 @@ int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
         return 0;
     }

-    if (ctx->cipher->prov == NULL)
-        goto legacy;
+    if (ctx->cipher->prov == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED);
+        return 0;
+    }

     switch (type) {
     case EVP_CTRL_SET_KEY_LENGTH:
@@ -1493,6 +988,12 @@ int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
         ctx->iv_len = -1;
         break;
     case EVP_CTRL_AEAD_SET_IV_FIXED:
+        /*
+         * arg == -1 is a valid sentinel meaning "use full ivlen"; anything
+         * below that would wrap to a huge size_t and overflow on memcpy.
+         */
+        if (arg < -1)
+            return 0;
         params[0] = OSSL_PARAM_construct_octet_string(
             OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED, ptr, sz);
         break;
@@ -1540,7 +1041,9 @@ int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
         ret = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
         if (ret <= 0)
             goto end;
-        return sz;
+        if (sz > INT_MAX)
+            return 0;
+        return (int)sz;
 #ifndef OPENSSL_NO_RC2
     case EVP_CTRL_GET_RC2_KEY_BITS:
         set_params = 0; /* Fall thru */
@@ -1560,9 +1063,9 @@ int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
             OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE, &sz);
         params[1] = OSSL_PARAM_construct_end();
         ret = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
-        if (ret <= 0)
+        if (ret <= 0 || sz > INT_MAX)
             return 0;
-        return sz;
+        return (int)sz;
     case EVP_CTRL_TLS1_1_MULTIBLOCK_AAD: {
         EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM *p = (EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM *)ptr;

@@ -1583,9 +1086,9 @@ int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
             OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE, &p->interleave);
         params[2] = OSSL_PARAM_construct_end();
         ret = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
-        if (ret <= 0)
+        if (ret <= 0 || sz > INT_MAX)
             return 0;
-        return sz;
+        return (int)sz;
     }
     case EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT: {
         EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM *p = (EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM *)ptr;
@@ -1605,9 +1108,9 @@ int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
             OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN, &sz);
         params[1] = OSSL_PARAM_construct_end();
         ret = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
-        if (ret <= 0)
+        if (ret <= 0 || sz > INT_MAX)
             return 0;
-        return sz;
+        return (int)sz;
     }
 #endif /* OPENSSL_NO_MULTIBLOCK */
     case EVP_CTRL_AEAD_SET_MAC_KEY:
@@ -1622,16 +1125,6 @@ int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
         ret = evp_do_ciph_ctx_setparams(ctx->cipher, ctx->algctx, params);
     else
         ret = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
-    goto end;
-
-    /* Code below to be removed when legacy support is dropped. */
-legacy:
-    if (ctx->cipher->ctrl == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED);
-        return 0;
-    }
-
-    ret = ctx->cipher->ctrl(ctx, type, arg, ptr);

 end:
     if (ret == EVP_CTRL_RET_UNSUPPORTED) {
@@ -1784,8 +1277,10 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in)
         return 0;
     }

-    if (in->cipher->prov == NULL)
-        goto legacy;
+    if (in->cipher->prov == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_INPUT_NOT_INITIALIZED);
+        return 0;
+    }

     if (in->cipher->dupctx == NULL) {
         ERR_raise(ERR_LIB_EVP, EVP_R_NOT_ABLE_TO_COPY_CTX);
@@ -1809,37 +1304,6 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in)
     }

     return 1;
-
-    /* Code below to be removed when legacy support is dropped. */
-legacy:
-
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    /* Make sure it's safe to copy a cipher context using an ENGINE */
-    if (in->engine && !ENGINE_init(in->engine)) {
-        ERR_raise(ERR_LIB_EVP, ERR_R_ENGINE_LIB);
-        return 0;
-    }
-#endif
-
-    EVP_CIPHER_CTX_reset(out);
-    memcpy(out, in, sizeof(*out));
-
-    if (in->cipher_data && in->cipher->ctx_size) {
-        out->cipher_data = OPENSSL_malloc(in->cipher->ctx_size);
-        if (out->cipher_data == NULL) {
-            out->cipher = NULL;
-            return 0;
-        }
-        memcpy(out->cipher_data, in->cipher_data, in->cipher->ctx_size);
-    }
-
-    if (in->cipher->flags & EVP_CIPH_CUSTOM_COPY)
-        if (!in->cipher->ctrl((EVP_CIPHER_CTX *)in, EVP_CTRL_COPY, 0, out)) {
-            out->cipher = NULL;
-            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
-            return 0;
-        }
-    return 1;
 }

 EVP_CIPHER *evp_cipher_new(void)
@@ -1884,9 +1348,33 @@ static void set_legacy_nid(const char *name, void *vlegacy_nid)
 }
 #endif

+static int evp_cipher_up_ref(void *c)
+{
+    EVP_CIPHER *cipher = (EVP_CIPHER *)c;
+    int ref = 0;
+
+    if (cipher->origin == EVP_ORIG_DYNAMIC)
+        return CRYPTO_UP_REF(&cipher->refcnt, &ref);
+    return 1;
+}
+
+static void evp_cipher_free(void *c)
+{
+    EVP_CIPHER *cipher = (EVP_CIPHER *)c;
+    int i;
+
+    if (cipher == NULL || cipher->origin != EVP_ORIG_DYNAMIC)
+        return;
+
+    CRYPTO_DOWN_REF(&cipher->refcnt, &i);
+    if (i > 0)
+        return;
+    evp_cipher_free_int(cipher);
+}
+
 static void *evp_cipher_from_algorithm(const int name_id,
     const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov)
+    OSSL_PROVIDER *prov, int no_store)
 {
     const OSSL_DISPATCH *fns = algodef->implementation;
     EVP_CIPHER *cipher = NULL;
@@ -1897,6 +1385,9 @@ static void *evp_cipher_from_algorithm(const int name_id,
         return NULL;
     }

+    if (no_store != 0)
+        cipher->flags |= EVP_CIPH_FLAG_NO_STORE;
+
 #ifndef FIPS_MODULE
     cipher->nid = NID_undef;
     if (!evp_names_do_all(prov, name_id, set_legacy_nid, &cipher->nid)
@@ -2032,12 +1523,12 @@ static void *evp_cipher_from_algorithm(const int name_id,
     if ((fnciphcnt != 0 && fnciphcnt != 3 && fnciphcnt != 4)
         || (fnciphcnt == 0 && cipher->ccipher == NULL && fnpipecnt == 0)
         || (fnpipecnt != 0 && (fnpipecnt < 3 || cipher->p_cupdate == NULL || cipher->p_cfinal == NULL))
-        || fnctxcnt != 2) {
+        || fnctxcnt != 2
+        || cipher->get_params == NULL) {
         /*
          * In order to be a consistent set of functions we must have at least
          * a complete set of "encrypt" functions, or a complete set of "decrypt"
-         * functions, or a single "cipher" function. In all cases we need both
-         * the "newctx" and "freectx" functions.
+         * functions, or a single "cipher" function.
          */
         ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
         goto err;
@@ -2055,20 +1546,10 @@ static void *evp_cipher_from_algorithm(const int name_id,
     return cipher;

 err:
-    EVP_CIPHER_free(cipher);
+    evp_cipher_free(cipher);
     return NULL;
 }

-static int evp_cipher_up_ref(void *cipher)
-{
-    return EVP_CIPHER_up_ref(cipher);
-}
-
-static void evp_cipher_free(void *cipher)
-{
-    EVP_CIPHER_free(cipher);
-}
-
 EVP_CIPHER *EVP_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
     const char *properties)
 {
@@ -2101,11 +1582,13 @@ int EVP_CIPHER_can_pipeline(const EVP_CIPHER *cipher, int enc)

 int EVP_CIPHER_up_ref(EVP_CIPHER *cipher)
 {
-    int ref = 0;
-
-    if (cipher->origin == EVP_ORIG_DYNAMIC)
-        CRYPTO_UP_REF(&cipher->refcnt, &ref);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    return evp_cipher_up_ref(cipher);
+#else
+    if (cipher->flags & EVP_CIPH_FLAG_NO_STORE)
+        return evp_cipher_up_ref(cipher);
     return 1;
+#endif
 }

 void evp_cipher_free_int(EVP_CIPHER *cipher)
@@ -2118,23 +1601,24 @@ void evp_cipher_free_int(EVP_CIPHER *cipher)

 void EVP_CIPHER_free(EVP_CIPHER *cipher)
 {
-    int i;
-
-    if (cipher == NULL || cipher->origin != EVP_ORIG_DYNAMIC)
-        return;
-
-    CRYPTO_DOWN_REF(&cipher->refcnt, &i);
-    if (i > 0)
-        return;
-    evp_cipher_free_int(cipher);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    evp_cipher_free(cipher);
+#else
+    if (cipher != NULL && (cipher->flags & EVP_CIPH_FLAG_NO_STORE))
+        evp_cipher_free(cipher);
+#endif
 }

 void EVP_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx,
     void (*fn)(EVP_CIPHER *mac, void *arg),
     void *arg)
 {
+    struct EVP_CIPHER_do_all_provided_thunk t;
+
+    t.fn = fn;
+    t.arg = arg;
     evp_generic_do_all(libctx, OSSL_OP_CIPHER,
-        (void (*)(void *, void *))fn, arg,
+        EVP_CIPHER_do_all_provided_thunk, &t,
         evp_cipher_from_algorithm, evp_cipher_up_ref,
         evp_cipher_free);
 }
diff --git a/deps/openssl/openssl/crypto/evp/evp_err.c b/deps/openssl/openssl/crypto/evp/evp_err.c
deleted file mode 100644
index 91b40a6cd57..00000000000
--- a/deps/openssl/openssl/crypto/evp/evp_err.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/evperr.h>
-#include "crypto/evperr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA EVP_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_AES_KEY_SETUP_FAILED),
-        "aes key setup failed" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_ARIA_KEY_SETUP_FAILED),
-        "aria key setup failed" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_BAD_ALGORITHM_NAME), "bad algorithm name" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_BAD_DECRYPT), "bad decrypt" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_BAD_KEY_LENGTH), "bad key length" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_BUFFER_TOO_SMALL), "buffer too small" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_CACHE_CONSTANTS_FAILED),
-        "cache constants failed" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_CAMELLIA_KEY_SETUP_FAILED),
-        "camellia key setup failed" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_CANNOT_GET_PARAMETERS),
-        "cannot get parameters" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_CANNOT_SET_PARAMETERS),
-        "cannot set parameters" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_CIPHER_NOT_GCM_MODE),
-        "cipher not gcm mode" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_CIPHER_PARAMETER_ERROR),
-        "cipher parameter error" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_COMMAND_NOT_SUPPORTED),
-        "command not supported" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_CONFLICTING_ALGORITHM_NAME),
-        "conflicting algorithm name" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_COPY_ERROR), "copy error" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_CTRL_NOT_IMPLEMENTED),
-        "ctrl not implemented" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED),
-        "ctrl operation not implemented" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH),
-        "data not multiple of block length" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_DECODE_ERROR), "decode error" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_DEFAULT_QUERY_PARSE_ERROR),
-        "default query parse error" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_DIFFERENT_KEY_TYPES),
-        "different key types" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_DIFFERENT_PARAMETERS),
-        "different parameters" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_ERROR_LOADING_SECTION),
-        "error loading section" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_EXPECTING_AN_HMAC_KEY),
-        "expecting an hmac key" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_EXPECTING_AN_RSA_KEY),
-        "expecting an rsa key" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_EXPECTING_A_DH_KEY), "expecting a dh key" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_EXPECTING_A_DSA_KEY),
-        "expecting a dsa key" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_EXPECTING_A_ECX_KEY),
-        "expecting an ecx key" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_EXPECTING_A_EC_KEY), "expecting an ec key" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_EXPECTING_A_POLY1305_KEY),
-        "expecting a poly1305 key" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_EXPECTING_A_SIPHASH_KEY),
-        "expecting a siphash key" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_FINAL_ERROR), "final error" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_GENERATE_ERROR), "generate error" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_GETTING_ALGORITHMIDENTIFIER_NOT_SUPPORTED),
-        "getting AlgorithmIdentifier not supported" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_GET_RAW_KEY_FAILED), "get raw key failed" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_ILLEGAL_SCRYPT_PARAMETERS),
-        "illegal scrypt parameters" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INACCESSIBLE_DOMAIN_PARAMETERS),
-        "inaccessible domain parameters" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INACCESSIBLE_KEY), "inaccessible key" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INITIALIZATION_ERROR),
-        "initialization error" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INPUT_NOT_INITIALIZED),
-        "input not initialized" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_CUSTOM_LENGTH),
-        "invalid custom length" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_DIGEST), "invalid digest" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_IV_LENGTH), "invalid iv length" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_KEY), "invalid key" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_KEY_LENGTH), "invalid key length" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_LENGTH), "invalid length" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_NULL_ALGORITHM),
-        "invalid null algorithm" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_OPERATION), "invalid operation" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_PROVIDER_FUNCTIONS),
-        "invalid provider functions" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_SALT_LENGTH),
-        "invalid salt length" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_SECRET_LENGTH),
-        "invalid secret length" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_SEED_LENGTH),
-        "invalid seed length" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_INVALID_VALUE), "invalid value" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_KEYMGMT_EXPORT_FAILURE),
-        "keymgmt export failure" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_KEY_SETUP_FAILED), "key setup failed" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_LOCKING_NOT_SUPPORTED),
-        "locking not supported" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_MEMORY_LIMIT_EXCEEDED),
-        "memory limit exceeded" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_MESSAGE_DIGEST_IS_NULL),
-        "message digest is null" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_METHOD_NOT_SUPPORTED),
-        "method not supported" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_MISSING_PARAMETERS), "missing parameters" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_NOT_ABLE_TO_COPY_CTX),
-        "not able to copy ctx" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_NOT_XOF_OR_INVALID_LENGTH),
-        "not XOF or invalid length" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_NO_CIPHER_SET), "no cipher set" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_NO_DEFAULT_DIGEST), "no default digest" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_NO_DIGEST_SET), "no digest set" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_NO_IMPORT_FUNCTION), "no import function" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_NO_KEYMGMT_AVAILABLE),
-        "no keymgmt available" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_NO_KEYMGMT_PRESENT), "no keymgmt present" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_NO_KEY_SET), "no key set" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_NO_OPERATION_SET), "no operation set" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_NULL_MAC_PKEY_CTX), "null mac pkey ctx" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_ONLY_ONESHOT_SUPPORTED),
-        "only oneshot supported" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_OPERATION_NOT_INITIALIZED),
-        "operation not initialized" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE),
-        "operation not supported for this keytype" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_SIGNATURE_TYPE),
-        "operation not supported for this signature type" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_OUTPUT_WOULD_OVERFLOW),
-        "output would overflow" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PARAMETER_TOO_LARGE),
-        "parameter too large" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PARTIALLY_OVERLAPPING),
-        "partially overlapping buffers" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PBKDF2_ERROR), "pbkdf2 error" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PIPELINE_NOT_SUPPORTED),
-        "pipeline not supported" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED),
-        "pkey application asn1 method already registered" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PRIVATE_KEY_DECODE_ERROR),
-        "private key decode error" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PRIVATE_KEY_ENCODE_ERROR),
-        "private key encode error" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PROVIDER_ASYM_CIPHER_FAILURE),
-        "provider asym cipher failure" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PROVIDER_ASYM_CIPHER_NOT_SUPPORTED),
-        "provider asym cipher not supported" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PROVIDER_KEYMGMT_FAILURE),
-        "provider keymgmt failure" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED),
-        "provider keymgmt not supported" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PROVIDER_SIGNATURE_FAILURE),
-        "provider signature failure" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED),
-        "provider signature not supported" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PUBLIC_KEY_NOT_RSA), "public key not rsa" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_SETTING_XOF_FAILED), "setting xof failed" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_SET_DEFAULT_PROPERTY_FAILURE),
-        "set default property failure" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_SIGNATURE_TYPE_AND_KEY_TYPE_INCOMPATIBLE),
-        "signature type and key type incompatible" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_TOO_MANY_PIPES), "too many pipes" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_TOO_MANY_RECORDS), "too many records" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNABLE_TO_ENABLE_LOCKING),
-        "unable to enable locking" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE),
-        "unable to get maximum request size" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNABLE_TO_GET_RANDOM_STRENGTH),
-        "unable to get random strength" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNABLE_TO_LOCK_CONTEXT),
-        "unable to lock context" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNABLE_TO_SET_CALLBACKS),
-        "unable to set callbacks" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNKNOWN_BITS), "unknown bits" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNKNOWN_CIPHER), "unknown cipher" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNKNOWN_DIGEST), "unknown digest" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNKNOWN_KEY_TYPE), "unknown key type" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNKNOWN_MAX_SIZE), "unknown max size" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNKNOWN_OPTION), "unknown option" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNKNOWN_PBE_ALGORITHM),
-        "unknown pbe algorithm" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNKNOWN_SECURITY_BITS),
-        "unknown security bits" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNSUPPORTED_ALGORITHM),
-        "unsupported algorithm" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNSUPPORTED_CIPHER), "unsupported cipher" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNSUPPORTED_KEYLENGTH),
-        "unsupported keylength" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION),
-        "unsupported key derivation function" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNSUPPORTED_KEY_SIZE),
-        "unsupported key size" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNSUPPORTED_KEY_TYPE),
-        "unsupported key type" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS),
-        "unsupported number of rounds" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNSUPPORTED_PRF), "unsupported prf" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM),
-        "unsupported private key algorithm" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UNSUPPORTED_SALT_TYPE),
-        "unsupported salt type" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_UPDATE_ERROR), "update error" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_WRAP_MODE_NOT_ALLOWED),
-        "wrap mode not allowed" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_WRONG_FINAL_BLOCK_LENGTH),
-        "wrong final block length" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_XTS_DATA_UNIT_IS_TOO_LARGE),
-        "xts data unit is too large" },
-    { ERR_PACK(ERR_LIB_EVP, 0, EVP_R_XTS_DUPLICATED_KEYS),
-        "xts duplicated keys" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_EVP_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(EVP_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(EVP_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/evp/evp_fetch.c b/deps/openssl/openssl/crypto/evp/evp_fetch.c
index 612e57e6f08..d798f8a9002 100644
--- a/deps/openssl/openssl/crypto/evp/evp_fetch.c
+++ b/deps/openssl/openssl/crypto/evp/evp_fetch.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,7 @@
 #include <openssl/types.h>
 #include <openssl/evp.h>
 #include <openssl/core.h>
+#include <openssl/kdf.h>
 #include "internal/cryptlib.h"
 #include "internal/thread_once.h"
 #include "internal/property.h"
@@ -36,7 +37,7 @@ struct evp_method_data_st {
     unsigned int flag_construct_error_occurred : 1;

     void *(*method_from_algorithm)(int name_id, const OSSL_ALGORITHM *,
-        OSSL_PROVIDER *);
+        OSSL_PROVIDER *, int);
     int (*refcnt_up_method)(void *method);
     void (*destruct_method)(void *method);
 };
@@ -208,7 +209,7 @@ static int put_evp_method_in_store(void *store, void *method,
  * This function is responsible to getting an identity number for it.
  */
 static void *construct_evp_method(const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov, void *data)
+    OSSL_PROVIDER *prov, void *data, int no_store)
 {
     /*
      * This function is only called if get_evp_method_from_store() returned
@@ -227,7 +228,7 @@ static void *construct_evp_method(const OSSL_ALGORITHM *algodef,
     if (name_id == 0)
         return NULL;

-    method = methdata->method_from_algorithm(name_id, algodef, prov);
+    method = methdata->method_from_algorithm(name_id, algodef, prov, no_store);

     /*
      * Flag to indicate that there was actual construction errors.  This
@@ -253,7 +254,7 @@ inner_evp_generic_fetch(struct evp_method_data_st *methdata,
     const char *name, ossl_unused const char *properties,
     void *(*new_method)(int name_id,
         const OSSL_ALGORITHM *algodef,
-        OSSL_PROVIDER *prov),
+        OSSL_PROVIDER *prov, int no_store),
     int (*up_ref_method)(void *),
     void (*free_method)(void *))
 {
@@ -273,6 +274,9 @@ inner_evp_generic_fetch(struct evp_method_data_st *methdata,
     uint32_t meth_id = 0;
     void *method = NULL;
     int unsupported, name_id;
+    int set_in_cache = 1;
+    void *tmp_method;
+    const OSSL_PROVIDER *tmp_prov = prov;

     if (store == NULL || namemap == NULL) {
         ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_INVALID_ARGUMENT);
@@ -289,7 +293,7 @@ inner_evp_generic_fetch(struct evp_method_data_st *methdata,
     }

     /* If we haven't received a name id yet, try to get one for the name */
-    name_id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
+    name_id = ossl_namemap_name2num(namemap, name);

     /*
      * If we have a name id, calculate a method id with evp_method_id().
@@ -350,14 +354,110 @@ inner_evp_generic_fetch(struct evp_method_data_st *methdata,
                 name_id = ossl_namemap_name2num(namemap, name);
             if (name_id == 0) {
                 ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
-                    "Algorithm %s cannot be found", name);
+                    "Algorithm %s cannot be found", name != NULL ? name : "<null>");
+#ifdef OPENSSL_NO_CACHED_FETCH
                 free_method(method);
+#endif
                 method = NULL;
             } else {
                 meth_id = evp_method_id(name_id, operation_id);
-                if (meth_id != 0)
+                /*
+                 * do not insert method to method store cache when provider
+                 * did ask for not caching it. methods which are not to be
+                 * cached end up in ->tmp_store when provider asks not
+                 * to cache the result (see ossl_method_construct_reserve_store())
+                 */
+                if (meth_id != 0) {
+                    /*
+                     * If the method doesn't exist in the tmp_store, either the tmp_store doesn't exist
+                     * or the algorithm doesn't exist there, in either case, this is a cacheable entry
+                     */
+                    if (!ossl_method_store_fetch(methdata->tmp_store, meth_id, propq, &tmp_prov, &tmp_method)) {
+                        set_in_cache = 1;
+                    } else {
+                        /*
+                         * We found a matching method in the temp store, don't cache this entry
+                         */
+                        if (tmp_method == method) {
+                            set_in_cache = 0;
+                        } else {
+                            set_in_cache = 1;
+                        }
+
+#ifdef OPENSSL_NO_CACHED_FETCH
+                        /*
+                         * ossl_method_store_fetch takes a reference on the fetched method
+                         * when using NO_CACHED_FETCH, so we need to free it here
+                         */
+                        free_method(tmp_method);
+#endif
+                    }
+                }
+
+                if (set_in_cache == 1) {
                     ossl_method_store_cache_set(store, prov, meth_id, propq,
                         method, up_ref_method, free_method);
+                } else {
+#ifndef OPENSSL_NO_CACHED_FETCH
+                    /*
+                     * There is a corner case we need to handle here.  IF:
+                     * 1) we are fetching an algorithm and plan to return it to the caller
+                     * 2) The provider we fetched from requested no_cache
+                     * Then we are in a situation in which this method that was constructed
+                     * only lives in the tmp_store, and has a reference count of 1.
+                     * On return from this function, that tmp_store is going to be deallocated,
+                     * Which will drop the methods ref count to 0 and free it, after which the
+                     * method will be returned to the called, as an already freed object.
+                     *
+                     * That's bad.  We need to grab an extra ref count on the method before returning
+                     * so that the requestor via EVP_*_fetch has ownership.
+                     *
+                     * BUT we only want to do this in the event that the algorithm is uncached.
+                     * Unfortunately, we don't know that here, because it was the provider that
+                     * made that request.  However, each algorithm type does store that information
+                     * so we have a path forward.  Based on the operation id, call the appropriate
+                     * up_ref method.  That implementation knows how to query its algorithm type and
+                     * decide if a reference needs to be taken here
+                     */
+                    switch (operation_id) {
+                    case OSSL_OP_DIGEST:
+                        EVP_MD_up_ref((EVP_MD *)method);
+                        break;
+                    case OSSL_OP_CIPHER:
+                        EVP_CIPHER_up_ref((EVP_CIPHER *)method);
+                        break;
+                    case OSSL_OP_MAC:
+                        EVP_MAC_up_ref((EVP_MAC *)method);
+                        break;
+                    case OSSL_OP_KDF:
+                        EVP_KDF_up_ref((EVP_KDF *)method);
+                        break;
+                    case OSSL_OP_RAND:
+                        EVP_RAND_up_ref((EVP_RAND *)method);
+                        break;
+                    case OSSL_OP_KEYMGMT:
+                        EVP_KEYMGMT_up_ref((EVP_KEYMGMT *)method);
+                        break;
+                    case OSSL_OP_KEYEXCH:
+                        EVP_KEYEXCH_up_ref((EVP_KEYEXCH *)method);
+                        break;
+                    case OSSL_OP_SIGNATURE:
+                        EVP_SIGNATURE_up_ref((EVP_SIGNATURE *)method);
+                        break;
+                    case OSSL_OP_ASYM_CIPHER:
+                        EVP_ASYM_CIPHER_up_ref((EVP_ASYM_CIPHER *)method);
+                        break;
+                    case OSSL_OP_KEM:
+                        EVP_KEM_up_ref((EVP_KEM *)method);
+                        break;
+                    case OSSL_OP_SKEYMGMT:
+                        EVP_SKEYMGMT_up_ref((EVP_SKEYMGMT *)method);
+                        break;
+                    default:
+                        break;
+                    }
+#endif
+                }
             }
         }

@@ -392,7 +492,7 @@ void *evp_generic_fetch(OSSL_LIB_CTX *libctx, int operation_id,
     const char *name, const char *properties,
     void *(*new_method)(int name_id,
         const OSSL_ALGORITHM *algodef,
-        OSSL_PROVIDER *prov),
+        OSSL_PROVIDER *prov, int no_store),
     int (*up_ref_method)(void *),
     void (*free_method)(void *))
 {
@@ -418,7 +518,7 @@ void *evp_generic_fetch_from_prov(OSSL_PROVIDER *prov, int operation_id,
     const char *name, const char *properties,
     void *(*new_method)(int name_id,
         const OSSL_ALGORITHM *algodef,
-        OSSL_PROVIDER *prov),
+        OSSL_PROVIDER *prov, int no_store),
     int (*up_ref_method)(void *),
     void (*free_method)(void *))
 {
@@ -632,7 +732,7 @@ void evp_generic_do_all(OSSL_LIB_CTX *libctx, int operation_id,
     void *user_arg,
     void *(*new_method)(int name_id,
         const OSSL_ALGORITHM *algodef,
-        OSSL_PROVIDER *prov),
+        OSSL_PROVIDER *prov, int no_store),
     int (*up_ref_method)(void *),
     void (*free_method)(void *))
 {
diff --git a/deps/openssl/openssl/crypto/evp/evp_lib.c b/deps/openssl/openssl/crypto/evp/evp_lib.c
index 652374ed43d..35a44e878c7 100644
--- a/deps/openssl/openssl/crypto/evp/evp_lib.c
+++ b/deps/openssl/openssl/crypto/evp/evp_lib.c
@@ -89,12 +89,7 @@ int evp_cipher_param_to_asn1_ex(EVP_CIPHER_CTX *c, ASN1_TYPE *type,

     cipher = c->cipher;
     /*
-     * For legacy implementations, we detect custom AlgorithmIdentifier
-     * parameter handling by checking if the function pointer
-     * cipher->set_asn1_parameters is set.  We know that this pointer
-     * is NULL for provided implementations.
-     *
-     * Otherwise, for any implementation, we check the flag
+     * For any implementation, we check the flag
      * EVP_CIPH_FLAG_CUSTOM_ASN1.  If it isn't set, we apply
      * default AI parameter extraction.
      *
@@ -104,9 +99,7 @@ int evp_cipher_param_to_asn1_ex(EVP_CIPHER_CTX *c, ASN1_TYPE *type,
      *
      * If none of the above applies, this operation is unsupported.
      */
-    if (cipher->set_asn1_parameters != NULL) {
-        ret = cipher->set_asn1_parameters(c, type);
-    } else if ((EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_CUSTOM_ASN1) == 0) {
+    if ((EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_CUSTOM_ASN1) == 0) {
         switch (EVP_CIPHER_get_mode(cipher)) {
         case EVP_CIPH_WRAP_MODE:
             if (EVP_CIPHER_is_a(cipher, SN_id_smime_alg_CMS3DESwrap))
@@ -160,12 +153,7 @@ int evp_cipher_asn1_to_param_ex(EVP_CIPHER_CTX *c, ASN1_TYPE *type,

     cipher = c->cipher;
     /*
-     * For legacy implementations, we detect custom AlgorithmIdentifier
-     * parameter handling by checking if there the function pointer
-     * cipher->get_asn1_parameters is set.  We know that this pointer
-     * is NULL for provided implementations.
-     *
-     * Otherwise, for any implementation, we check the flag
+     * For any implementation, we check the flag
      * EVP_CIPH_FLAG_CUSTOM_ASN1.  If it isn't set, we apply
      * default AI parameter creation.
      *
@@ -175,9 +163,7 @@ int evp_cipher_asn1_to_param_ex(EVP_CIPHER_CTX *c, ASN1_TYPE *type,
      *
      * If none of the above applies, this operation is unsupported.
      */
-    if (cipher->get_asn1_parameters != NULL) {
-        ret = cipher->get_asn1_parameters(c, type);
-    } else if ((EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_CUSTOM_ASN1) == 0) {
+    if ((EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_CUSTOM_ASN1) == 0) {
         switch (EVP_CIPHER_get_mode(cipher)) {
         case EVP_CIPH_WRAP_MODE:
             ret = 1;
@@ -321,11 +307,13 @@ int EVP_CIPHER_get_type(const EVP_CIPHER *cipher)
 int evp_cipher_cache_constants(EVP_CIPHER *cipher)
 {
     int ok, aead = 0, custom_iv = 0, cts = 0, multiblock = 0, randkey = 0;
+    int encrypt_then_mac = 0;
     size_t ivlen = 0;
     size_t blksz = 0;
     size_t keylen = 0;
     unsigned int mode = 0;
-    OSSL_PARAM params[10];
+    int no_store = cipher->flags & EVP_CIPH_FLAG_NO_STORE;
+    OSSL_PARAM params[11];

     params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_BLOCK_SIZE, &blksz);
     params[1] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN, &ivlen);
@@ -339,13 +327,15 @@ int evp_cipher_cache_constants(EVP_CIPHER *cipher)
         &multiblock);
     params[8] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_HAS_RAND_KEY,
         &randkey);
-    params[9] = OSSL_PARAM_construct_end();
+    params[9] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC,
+        &encrypt_then_mac);
+    params[10] = OSSL_PARAM_construct_end();
     ok = evp_do_ciph_getparams(cipher, params) > 0;
     if (ok) {
-        cipher->block_size = blksz;
-        cipher->iv_len = ivlen;
-        cipher->key_len = keylen;
-        cipher->flags = mode;
+        cipher->block_size = (int)blksz;
+        cipher->iv_len = (int)ivlen;
+        cipher->key_len = (int)keylen;
+        cipher->flags = mode | no_store;
         if (aead)
             cipher->flags |= EVP_CIPH_FLAG_AEAD_CIPHER;
         if (custom_iv)
@@ -358,6 +348,8 @@ int evp_cipher_cache_constants(EVP_CIPHER *cipher)
             cipher->flags |= EVP_CIPH_FLAG_CUSTOM_CIPHER;
         if (randkey)
             cipher->flags |= EVP_CIPH_RAND_KEY;
+        if (encrypt_then_mac)
+            cipher->flags |= EVP_CIPH_FLAG_ENC_THEN_MAC;
         if (OSSL_PARAM_locate_const(EVP_CIPHER_gettable_ctx_params(cipher),
                 OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS))
             cipher->flags |= EVP_CIPH_FLAG_CUSTOM_ASN1;
@@ -377,48 +369,44 @@ int EVP_CIPHER_CTX_get_block_size(const EVP_CIPHER_CTX *ctx)

 int EVP_CIPHER_impl_ctx_size(const EVP_CIPHER *e)
 {
-    return e->ctx_size;
+    return 0;
 }

 int EVP_Cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
     const unsigned char *in, unsigned int inl)
 {
-    if (ctx == NULL || ctx->cipher == NULL)
+    if (ctx == NULL || ctx->cipher == NULL || ctx->cipher->prov == NULL)
         return 0;

-    if (ctx->cipher->prov != NULL) {
-        /*
-         * If the provided implementation has a ccipher function, we use it,
-         * and translate its return value like this: 0 => -1, 1 => outlen
-         *
-         * Otherwise, we call the cupdate function if in != NULL, or cfinal
-         * if in == NULL.  Regardless of which, we return what we got.
-         */
-        int ret = -1;
-        size_t outl = 0;
-        size_t blocksize = EVP_CIPHER_CTX_get_block_size(ctx);
-
-        if (blocksize == 0)
-            return 0;
-
-        if (ctx->cipher->ccipher != NULL)
-            ret = ctx->cipher->ccipher(ctx->algctx, out, &outl,
-                      inl + (blocksize == 1 ? 0 : blocksize),
-                      in, (size_t)inl)
-                ? (int)outl
-                : -1;
-        else if (in != NULL)
-            ret = ctx->cipher->cupdate(ctx->algctx, out, &outl,
-                inl + (blocksize == 1 ? 0 : blocksize),
-                in, (size_t)inl);
-        else
-            ret = ctx->cipher->cfinal(ctx->algctx, out, &outl,
-                blocksize == 1 ? 0 : blocksize);
-
-        return ret;
-    }
+    /*
+     * If the provided implementation has a ccipher function, we use it,
+     * and translate its return value like this: 0 => -1, 1 => outlen
+     *
+     * Otherwise, we call the cupdate function if in != NULL, or cfinal
+     * if in == NULL.  Regardless of which, we return what we got.
+     */
+    int ret = -1;
+    size_t outl = 0;
+    size_t blocksize = EVP_CIPHER_CTX_get_block_size(ctx);
+
+    if (blocksize == 0)
+        return 0;

-    return ctx->cipher->do_cipher(ctx, out, in, inl);
+    if (ctx->cipher->ccipher != NULL)
+        ret = ctx->cipher->ccipher(ctx->algctx, out, &outl,
+                  inl + (blocksize == 1 ? 0 : blocksize),
+                  in, (size_t)inl)
+            ? (int)outl
+            : -1;
+    else if (in != NULL)
+        ret = ctx->cipher->cupdate(ctx->algctx, out, &outl,
+            inl + (blocksize == 1 ? 0 : blocksize),
+            in, (size_t)inl);
+    else
+        ret = ctx->cipher->cfinal(ctx->algctx, out, &outl,
+            blocksize == 1 ? 0 : blocksize);
+
+    return ret;
 }

 #ifndef OPENSSL_NO_DEPRECATED_3_0
@@ -605,6 +593,7 @@ unsigned char *EVP_CIPHER_CTX_buf_noconst(EVP_CIPHER_CTX *ctx)
     return ctx->buf;
 }

+#ifndef OPENSSL_NO_DEPRECATED_4_1
 int EVP_CIPHER_CTX_get_num(const EVP_CIPHER_CTX *ctx)
 {
     int ok;
@@ -630,6 +619,7 @@ int EVP_CIPHER_CTX_set_num(EVP_CIPHER_CTX *ctx, int num)
         ctx->num = (int)n;
     return ok != 0;
 }
+#endif /* OPENSSL_NO_DEPRECATED_4_1 */

 int EVP_CIPHER_get_key_length(const EVP_CIPHER *cipher)
 {
@@ -822,182 +812,6 @@ unsigned long EVP_MD_get_flags(const EVP_MD *md)
     return md->flags;
 }

-EVP_MD *EVP_MD_meth_new(int md_type, int pkey_type)
-{
-    EVP_MD *md = evp_md_new();
-
-    if (md != NULL) {
-        md->type = md_type;
-        md->pkey_type = pkey_type;
-        md->origin = EVP_ORIG_METH;
-    }
-    return md;
-}
-
-EVP_MD *EVP_MD_meth_dup(const EVP_MD *md)
-{
-    EVP_MD *to = NULL;
-
-    /*
-     * Non-legacy EVP_MDs can't be duplicated like this.
-     * Use EVP_MD_up_ref() instead.
-     */
-    if (md->prov != NULL)
-        return NULL;
-
-    if ((to = EVP_MD_meth_new(md->type, md->pkey_type)) != NULL) {
-        CRYPTO_REF_COUNT refcnt = to->refcnt;
-
-        memcpy(to, md, sizeof(*to));
-        to->refcnt = refcnt;
-        to->origin = EVP_ORIG_METH;
-    }
-    return to;
-}
-
-void evp_md_free_int(EVP_MD *md)
-{
-    OPENSSL_free(md->type_name);
-    ossl_provider_free(md->prov);
-    CRYPTO_FREE_REF(&md->refcnt);
-    OPENSSL_free(md);
-}
-
-void EVP_MD_meth_free(EVP_MD *md)
-{
-    if (md == NULL || md->origin != EVP_ORIG_METH)
-        return;
-
-    evp_md_free_int(md);
-}
-
-int EVP_MD_meth_set_input_blocksize(EVP_MD *md, int blocksize)
-{
-    if (md->block_size != 0)
-        return 0;
-
-    md->block_size = blocksize;
-    return 1;
-}
-int EVP_MD_meth_set_result_size(EVP_MD *md, int resultsize)
-{
-    if (md->md_size != 0)
-        return 0;
-
-    md->md_size = resultsize;
-    return 1;
-}
-int EVP_MD_meth_set_app_datasize(EVP_MD *md, int datasize)
-{
-    if (md->ctx_size != 0)
-        return 0;
-
-    md->ctx_size = datasize;
-    return 1;
-}
-int EVP_MD_meth_set_flags(EVP_MD *md, unsigned long flags)
-{
-    if (md->flags != 0)
-        return 0;
-
-    md->flags = flags;
-    return 1;
-}
-int EVP_MD_meth_set_init(EVP_MD *md, int (*init)(EVP_MD_CTX *ctx))
-{
-    if (md->init != NULL)
-        return 0;
-
-    md->init = init;
-    return 1;
-}
-int EVP_MD_meth_set_update(EVP_MD *md, int (*update)(EVP_MD_CTX *ctx, const void *data, size_t count))
-{
-    if (md->update != NULL)
-        return 0;
-
-    md->update = update;
-    return 1;
-}
-int EVP_MD_meth_set_final(EVP_MD *md, int (*final)(EVP_MD_CTX *ctx, unsigned char *md))
-{
-    if (md->final != NULL)
-        return 0;
-
-    md->final = final;
-    return 1;
-}
-int EVP_MD_meth_set_copy(EVP_MD *md, int (*copy)(EVP_MD_CTX *to, const EVP_MD_CTX *from))
-{
-    if (md->copy != NULL)
-        return 0;
-
-    md->copy = copy;
-    return 1;
-}
-int EVP_MD_meth_set_cleanup(EVP_MD *md, int (*cleanup)(EVP_MD_CTX *ctx))
-{
-    if (md->cleanup != NULL)
-        return 0;
-
-    md->cleanup = cleanup;
-    return 1;
-}
-int EVP_MD_meth_set_ctrl(EVP_MD *md, int (*ctrl)(EVP_MD_CTX *ctx, int cmd, int p1, void *p2))
-{
-    if (md->md_ctrl != NULL)
-        return 0;
-
-    md->md_ctrl = ctrl;
-    return 1;
-}
-
-int EVP_MD_meth_get_input_blocksize(const EVP_MD *md)
-{
-    return md->block_size;
-}
-int EVP_MD_meth_get_result_size(const EVP_MD *md)
-{
-    return md->md_size;
-}
-int EVP_MD_meth_get_app_datasize(const EVP_MD *md)
-{
-    return md->ctx_size;
-}
-unsigned long EVP_MD_meth_get_flags(const EVP_MD *md)
-{
-    return md->flags;
-}
-int (*EVP_MD_meth_get_init(const EVP_MD *md))(EVP_MD_CTX *ctx)
-{
-    return md->init;
-}
-int (*EVP_MD_meth_get_update(const EVP_MD *md))(EVP_MD_CTX *ctx,
-    const void *data,
-    size_t count)
-{
-    return md->update;
-}
-int (*EVP_MD_meth_get_final(const EVP_MD *md))(EVP_MD_CTX *ctx,
-    unsigned char *md)
-{
-    return md->final;
-}
-int (*EVP_MD_meth_get_copy(const EVP_MD *md))(EVP_MD_CTX *to,
-    const EVP_MD_CTX *from)
-{
-    return md->copy;
-}
-int (*EVP_MD_meth_get_cleanup(const EVP_MD *md))(EVP_MD_CTX *ctx)
-{
-    return md->cleanup;
-}
-int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))(EVP_MD_CTX *ctx, int cmd,
-    int p1, void *p2)
-{
-    return md->md_ctrl;
-}
-
 #ifndef OPENSSL_NO_DEPRECATED_3_0
 const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx)
 {
@@ -1046,10 +860,10 @@ int EVP_MD_CTX_get_size_ex(const EVP_MD_CTX *ctx)
          */
         params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_SIZE, &sz);
         if (EVP_MD_CTX_get_params(c, params) != 1
-            || sz == SIZE_MAX
+            || sz > INT_MAX
             || sz == 0)
             return -1;
-        return sz;
+        return (int)sz;
     }
     /* Normal digests have a constant fixed size output */
     return EVP_MD_get_size(EVP_MD_CTX_get0_md(ctx));
@@ -1081,23 +895,12 @@ void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx)
 }
 #endif /* !defined(FIPS_MODULE) */

+#ifndef OPENSSL_NO_DEPRECATED_4_0
 void *EVP_MD_CTX_get0_md_data(const EVP_MD_CTX *ctx)
 {
-    return ctx->md_data;
-}
-
-int (*EVP_MD_CTX_update_fn(EVP_MD_CTX *ctx))(EVP_MD_CTX *ctx,
-    const void *data, size_t count)
-{
-    return ctx->update;
-}
-
-void EVP_MD_CTX_set_update_fn(EVP_MD_CTX *ctx,
-    int (*update)(EVP_MD_CTX *ctx,
-        const void *data, size_t count))
-{
-    ctx->update = update;
+    return NULL;
 }
+#endif

 void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags)
 {
@@ -1229,12 +1032,17 @@ EVP_PKEY *EVP_PKEY_Q_keygen(OSSL_LIB_CTX *libctx, const char *propq,
         params[0] = OSSL_PARAM_construct_size_t(OSSL_PKEY_PARAM_RSA_BITS, &bits);
     } else if (OPENSSL_strcasecmp(type, "EC") == 0) {
         name = va_arg(args, char *);
+        if (name == NULL) {
+            ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_NULL_PARAMETER);
+            goto end;
+        }
         params[0] = OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME,
             name, 0);
     }

     ret = evp_pkey_keygen(libctx, type, propq, params);

+end:
     va_end(args);
     return ret;
 }
@@ -1351,7 +1159,7 @@ int EVP_CIPHER_CTX_get_algor(EVP_CIPHER_CTX *ctx, X509_ALGOR **alg)
         ret = -2;
         goto err;
     }
-    if (alg != NULL) {
+    if (alg != NULL && aid_len <= LONG_MAX) {
         unsigned char *aid = NULL;
         const unsigned char *pp = NULL;

@@ -1360,7 +1168,7 @@ int EVP_CIPHER_CTX_get_algor(EVP_CIPHER_CTX *ctx, X509_ALGOR **alg)
             pp = aid;
             if (EVP_CIPHER_CTX_get_params(ctx, params)
                 && OSSL_PARAM_modified(&params[0])
-                && d2i_X509_ALGOR(alg, &pp, aid_len) != NULL)
+                && d2i_X509_ALGOR(alg, &pp, (long)aid_len) != NULL)
                 ret = 1;
         }
         OPENSSL_free(aid);
@@ -1426,6 +1234,7 @@ int EVP_PKEY_CTX_get_algor_params(EVP_PKEY_CTX *ctx, X509_ALGOR *alg)
     if (OSSL_PARAM_modified(&params[0])
         /* ... but, we should get a return size too! */
         && derl != 0
+        && derl <= LONG_MAX
         && (der = OPENSSL_malloc(derl)) != NULL) {
         unsigned char *derp = der;

@@ -1433,7 +1242,7 @@ int EVP_PKEY_CTX_get_algor_params(EVP_PKEY_CTX *ctx, X509_ALGOR *alg)
         if (EVP_PKEY_CTX_get_params(ctx, params)
             && OSSL_PARAM_modified(&params[0])
             && d2i_ASN1_TYPE(&type, (const unsigned char **)&derp,
-                   derl)
+                   (long)derl)
                 != NULL) {
             /*
              * Don't free alg->parameter, see comment further up.
@@ -1468,7 +1277,7 @@ int EVP_PKEY_CTX_get_algor(EVP_PKEY_CTX *ctx, X509_ALGOR **alg)
         ret = -2;
         goto err;
     }
-    if (alg != NULL) {
+    if (alg != NULL && aid_len <= LONG_MAX) {
         unsigned char *aid = NULL;
         const unsigned char *pp = NULL;

@@ -1477,7 +1286,7 @@ int EVP_PKEY_CTX_get_algor(EVP_PKEY_CTX *ctx, X509_ALGOR **alg)
             pp = aid;
             if (EVP_PKEY_CTX_get_params(ctx, params)
                 && OSSL_PARAM_modified(&params[0])
-                && d2i_X509_ALGOR(alg, &pp, aid_len) != NULL)
+                && d2i_X509_ALGOR(alg, &pp, (long)aid_len) != NULL)
                 ret = 1;
         }
         OPENSSL_free(aid);
diff --git a/deps/openssl/openssl/crypto/evp/evp_local.h b/deps/openssl/openssl/crypto/evp/evp_local.h
index ec1e3a83fa1..749bc09f554 100644
--- a/deps/openssl/openssl/crypto/evp/evp_local.h
+++ b/deps/openssl/openssl/crypto/evp/evp_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,22 +7,31 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_EVP_EVP_LOCAL_H)
+#define OSSL_LIBCRYPTO_EVP_EVP_LOCAL_H
+
 #include <openssl/core_dispatch.h>
+#include <openssl/evp.h>
+
+#include <crypto/evp.h>
+
 #include "internal/refcount.h"

 #define EVP_CTRL_RET_UNSUPPORTED -1

+/*
+ * Length of the BASE64-encoded lines when encoding.
+ * This needs to be divisible by 3 to keep the AVX2 optimized code path.
+ */
+#define EVP_ENCODE_B64_LENGTH 48
+
 struct evp_md_ctx_st {
     const EVP_MD *reqdigest; /* The original requested digest */
     const EVP_MD *digest;
-    ENGINE *engine; /* functional reference if 'digest' is
-                     * ENGINE-provided */
     unsigned long flags;
-    void *md_data;
+
     /* Public key context for sign/verify */
     EVP_PKEY_CTX *pctx;
-    /* Update function: usually copied from EVP_MD */
-    int (*update)(EVP_MD_CTX *ctx, const void *data, size_t count);

     /*
      * Opaque ctx returned from a providers digest algorithm implementation
@@ -34,8 +43,6 @@ struct evp_md_ctx_st {

 struct evp_cipher_ctx_st {
     const EVP_CIPHER *cipher;
-    ENGINE *engine; /* functional reference if 'cipher' is
-                     * ENGINE-provided */
     int encrypt; /* encrypt or decrypt */
     int buf_len; /* number we have left */
     unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */
@@ -95,6 +102,7 @@ struct evp_keymgmt_st {
     int id; /* libcrypto internal */

     int name_id;
+    int no_store;
     /* NID for the legacy alg if there is one */
     int legacy_alg;
     char *type_name;
@@ -104,6 +112,7 @@ struct evp_keymgmt_st {

     /* Constructor(s), destructor, information */
     OSSL_FUNC_keymgmt_new_fn *new;
+    OSSL_FUNC_keymgmt_new_ex_fn *new_ex;
     OSSL_FUNC_keymgmt_free_fn *free;
     OSSL_FUNC_keymgmt_get_params_fn *get_params;
     OSSL_FUNC_keymgmt_gettable_params_fn *gettable_params;
@@ -140,6 +149,7 @@ struct evp_keymgmt_st {

 struct evp_keyexch_st {
     int name_id;
+    int no_store;
     char *type_name;
     const char *description;
     OSSL_PROVIDER *prov;
@@ -155,10 +165,12 @@ struct evp_keyexch_st {
     OSSL_FUNC_keyexch_settable_ctx_params_fn *settable_ctx_params;
     OSSL_FUNC_keyexch_get_ctx_params_fn *get_ctx_params;
     OSSL_FUNC_keyexch_gettable_ctx_params_fn *gettable_ctx_params;
+    OSSL_FUNC_keyexch_derive_skey_fn *derive_skey;
 } /* EVP_KEYEXCH */;

 struct evp_signature_st {
     int name_id;
+    int no_store;
     char *type_name;
     const char *description;
     OSSL_PROVIDER *prov;
@@ -202,6 +214,7 @@ struct evp_signature_st {

 struct evp_skeymgmt_st {
     int name_id;
+    int no_store;
     char *type_name;
     const char *description;
     OSSL_PROVIDER *prov;
@@ -219,12 +232,17 @@ struct evp_skeymgmt_st {
     /* Key identifier */
     OSSL_FUNC_skeymgmt_get_key_id_fn *get_key_id;

+    /* Key metadata accessors */
+    OSSL_FUNC_skeymgmt_get_local_keyid_fn *get_local_keyid;
+    OSSL_FUNC_skeymgmt_get_algorithm_id_fn *get_algorithm_id;
+
     /* destructor */
     OSSL_FUNC_skeymgmt_free_fn *free;
 } /* EVP_SKEYMGMT */;

 struct evp_asym_cipher_st {
     int name_id;
+    int no_store;
     char *type_name;
     const char *description;
     OSSL_PROVIDER *prov;
@@ -245,6 +263,7 @@ struct evp_asym_cipher_st {

 struct evp_kem_st {
     int name_id;
+    int no_store;
     char *type_name;
     const char *description;
     OSSL_PROVIDER *prov;
@@ -277,12 +296,6 @@ int PKCS5_v2_PBKDF2_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass,
 struct evp_Encode_Ctx_st {
     /* number saved in a partial encode/decode */
     int num;
-    /*
-     * The length is either the output line length (in input bytes) or the
-     * shortest input line length that is ok.  Once decoding begins, the
-     * length is adjusted up each time a longer line is decoded
-     */
-    int length;
     /* data to encode */
     unsigned char enc_data[80];
     /* number read on current line */
@@ -302,14 +315,14 @@ void *evp_generic_fetch(OSSL_LIB_CTX *ctx, int operation_id,
     const char *name, const char *properties,
     void *(*new_method)(int name_id,
         const OSSL_ALGORITHM *algodef,
-        OSSL_PROVIDER *prov),
+        OSSL_PROVIDER *prov, int no_store),
     int (*up_ref_method)(void *),
     void (*free_method)(void *));
 void *evp_generic_fetch_from_prov(OSSL_PROVIDER *prov, int operation_id,
     const char *name, const char *properties,
     void *(*new_method)(int name_id,
         const OSSL_ALGORITHM *algodef,
-        OSSL_PROVIDER *prov),
+        OSSL_PROVIDER *prov, int no_store),
     int (*up_ref_method)(void *),
     void (*free_method)(void *));
 void evp_generic_do_all_prefetched(OSSL_LIB_CTX *libctx, int operation_id,
@@ -320,7 +333,7 @@ void evp_generic_do_all(OSSL_LIB_CTX *libctx, int operation_id,
     void *user_arg,
     void *(*new_method)(int name_id,
         const OSSL_ALGORITHM *algodef,
-        OSSL_PROVIDER *prov),
+        OSSL_PROVIDER *prov, int no_store),
     int (*up_ref_method)(void *),
     void (*free_method)(void *));

@@ -384,27 +397,8 @@ int evp_do_md_ctx_setparams(const EVP_MD *md, void *provctx,

 OSSL_PARAM *evp_pkey_to_param(EVP_PKEY *pkey, size_t *sz);

-#define M_check_autoarg(ctx, arg, arglen, err)                               \
-    if (ctx->pmeth->flags & EVP_PKEY_FLAG_AUTOARGLEN) {                      \
-        size_t pksize = (size_t)EVP_PKEY_get_size(ctx->pkey);                \
-                                                                             \
-        if (pksize == 0) {                                                   \
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY); /*ckerr_ignore*/      \
-            return 0;                                                        \
-        }                                                                    \
-        if (arg == NULL) {                                                   \
-            *arglen = pksize;                                                \
-            return 1;                                                        \
-        }                                                                    \
-        if (*arglen < pksize) {                                              \
-            ERR_raise(ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL); /*ckerr_ignore*/ \
-            return 0;                                                        \
-        }                                                                    \
-    }
-
 void evp_pkey_ctx_free_old_ops(EVP_PKEY_CTX *ctx);
 void evp_cipher_free_int(EVP_CIPHER *md);
-void evp_md_free_int(EVP_MD *md);

 /* OSSL_PROVIDER * is only used to get the library context */
 int evp_is_a(OSSL_PROVIDER *prov, int number,
@@ -413,3 +407,28 @@ int evp_names_do_all(OSSL_PROVIDER *prov, int number,
     void (*fn)(const char *name, void *data),
     void *data);
 int evp_cipher_cache_constants(EVP_CIPHER *cipher);
+
+#define EVP_DO_ALL_PROVIDED_THUNK(type)                                                       \
+    struct type##_do_all_provided_thunk {                                                     \
+        void (*fn)(type * method, void *arg);                                                 \
+        void *arg;                                                                            \
+    };                                                                                        \
+    static ossl_inline ossl_unused void type##_do_all_provided_thunk(void *method, void *arg) \
+    {                                                                                         \
+        struct type##_do_all_provided_thunk *t = arg;                                         \
+        (*t->fn)((type *)method, t->arg);                                                     \
+    }
+
+EVP_DO_ALL_PROVIDED_THUNK(EVP_ASYM_CIPHER)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_MD)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_CIPHER)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_RAND)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_KEYEXCH)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_KDF)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_KEM)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_KEYMGMT)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_MAC)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_SIGNATURE)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_SKEYMGMT)
+
+#endif /* !defined(OSSL_LIBCRYPTO_EVP_EVP_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/evp/evp_pbe.c b/deps/openssl/openssl/crypto/evp/evp_pbe.c
index 785c4e1f512..0b0554358c4 100644
--- a/deps/openssl/openssl/crypto/evp/evp_pbe.c
+++ b/deps/openssl/openssl/crypto/evp/evp_pbe.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -97,10 +97,8 @@ int EVP_PBE_CipherInit_ex(ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
     ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de,
     OSSL_LIB_CTX *libctx, const char *propq)
 {
-    const EVP_CIPHER *cipher = NULL;
-    EVP_CIPHER *cipher_fetch = NULL;
-    const EVP_MD *md = NULL;
-    EVP_MD *md_fetch = NULL;
+    EVP_CIPHER *cipher = NULL;
+    EVP_MD *md = NULL;
     int ret = 0, cipher_nid, md_nid;
     EVP_PBE_KEYGEN_EX *keygen_ex;
     EVP_PBE_KEYGEN *keygen;
@@ -121,36 +119,24 @@ int EVP_PBE_CipherInit_ex(ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
     if (pass == NULL)
         passlen = 0;
     else if (passlen == -1)
-        passlen = strlen(pass);
+        passlen = (int)strlen(pass);

     if (cipher_nid != -1) {
-        (void)ERR_set_mark();
-        cipher = cipher_fetch = EVP_CIPHER_fetch(libctx, OBJ_nid2sn(cipher_nid), propq);
-        /* Fallback to legacy method */
-        if (cipher == NULL)
-            cipher = EVP_get_cipherbynid(cipher_nid);
+        cipher = EVP_CIPHER_fetch(libctx, OBJ_nid2sn(cipher_nid), propq);
         if (cipher == NULL) {
-            (void)ERR_clear_last_mark();
             ERR_raise_data(ERR_LIB_EVP, EVP_R_UNKNOWN_CIPHER,
                 OBJ_nid2sn(cipher_nid));
             goto err;
         }
-        (void)ERR_pop_to_mark();
     }

     if (md_nid != -1) {
-        (void)ERR_set_mark();
-        md = md_fetch = EVP_MD_fetch(libctx, OBJ_nid2sn(md_nid), propq);
-        /* Fallback to legacy method */
-        if (md == NULL)
-            md = EVP_get_digestbynid(md_nid);
+        md = EVP_MD_fetch(libctx, OBJ_nid2sn(md_nid), propq);

         if (md == NULL) {
-            (void)ERR_clear_last_mark();
             ERR_raise(ERR_LIB_EVP, EVP_R_UNKNOWN_DIGEST);
             goto err;
         }
-        (void)ERR_pop_to_mark();
     }

     /* Try extended keygen with libctx/propq first, fall back to legacy keygen */
@@ -160,8 +146,8 @@ int EVP_PBE_CipherInit_ex(ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
         ret = keygen(ctx, pass, passlen, param, cipher, md, en_de);

 err:
-    EVP_CIPHER_free(cipher_fetch);
-    EVP_MD_free(md_fetch);
+    EVP_CIPHER_free(cipher);
+    EVP_MD_free(md);

     return ret;
 }
diff --git a/deps/openssl/openssl/crypto/evp/evp_pkey.c b/deps/openssl/openssl/crypto/evp/evp_pkey.c
index 6b0103c2aa0..dbabf84b08b 100644
--- a/deps/openssl/openssl/crypto/evp/evp_pkey.c
+++ b/deps/openssl/openssl/crypto/evp/evp_pkey.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -244,17 +244,21 @@ int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key,

 const char *EVP_PKEY_get0_type_name(const EVP_PKEY *key)
 {
+#ifndef OPENSSL_NO_DEPRECATED_3_6
     const EVP_PKEY_ASN1_METHOD *ameth;
+#endif
     const char *name = NULL;

     if (key->keymgmt != NULL)
         return EVP_KEYMGMT_get0_name(key->keymgmt);

+#ifndef OPENSSL_NO_DEPRECATED_3_6
     /* Otherwise fallback to legacy */
-    ameth = EVP_PKEY_get0_asn1(key);
+    ameth = evp_pkey_get0_asn1(key);
     if (ameth != NULL)
-        EVP_PKEY_asn1_get0_info(NULL, NULL,
+        evp_pkey_asn1_get0_info(NULL, NULL,
             NULL, NULL, &name, ameth);
+#endif

     return name;
 }
diff --git a/deps/openssl/openssl/crypto/evp/evp_pkey_type.c b/deps/openssl/openssl/crypto/evp/evp_pkey_type.c
new file mode 100644
index 00000000000..7864ccbfe5c
--- /dev/null
+++ b/deps/openssl/openssl/crypto/evp/evp_pkey_type.c
@@ -0,0 +1,83 @@
+/*
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#define OPENSSL_SUPPRESS_DEPRECATED
+
+#include "crypto/evp.h"
+#include <openssl/core_names.h>
+#include <openssl/macros.h>
+#ifndef OPENSSL_NO_DEPRECATED_3_6
+#include "crypto/asn1.h"
+#include <openssl/types.h>
+#else
+#include "internal/nelem.h"
+#endif
+
+#ifdef OPENSSL_NO_DEPRECATED_3_6
+/*
+ * This is a hardcoded conversion table for legacy ASN1_METHOD and pkey type.
+ * As the deprecated ASN1 should not enable to add any asn1 method, therefore
+ * this should work.
+ */
+struct pkid2bid {
+    int pkey_id;
+    int pkey_base_id;
+};
+
+static const struct pkid2bid base_id_conversion[] = {
+    { EVP_PKEY_RSA, EVP_PKEY_RSA },
+    { EVP_PKEY_RSA2, EVP_PKEY_RSA },
+    { EVP_PKEY_RSA_PSS, EVP_PKEY_RSA_PSS },
+#ifndef OPENSSL_NO_DH
+    { EVP_PKEY_DH, EVP_PKEY_DH },
+    { EVP_PKEY_DHX, EVP_PKEY_DHX },
+#endif
+#ifndef OPENSSL_NO_DSA
+    { EVP_PKEY_DSA1, EVP_PKEY_DSA },
+    { EVP_PKEY_DSA4, EVP_PKEY_DSA2 },
+    { EVP_PKEY_DSA3, EVP_PKEY_DSA2 },
+    { EVP_PKEY_DSA, EVP_PKEY_DSA },
+#endif
+#ifndef OPENSSL_NO_EC
+    { EVP_PKEY_EC, EVP_PKEY_EC },
+#endif
+#ifndef OPENSSL_NO_ECX
+    { EVP_PKEY_X25519, EVP_PKEY_X25519 },
+    { EVP_PKEY_X448, EVP_PKEY_X448 },
+    { EVP_PKEY_ED25519, EVP_PKEY_ED25519 },
+    { EVP_PKEY_ED448, EVP_PKEY_ED448 },
+#endif
+#ifndef OPENSSL_NO_SM2
+    { EVP_PKEY_SM2, EVP_PKEY_EC },
+#endif
+};
+#endif
+
+int EVP_PKEY_type(int type)
+{
+#ifndef OPENSSL_NO_DEPRECATED_3_6
+    int ret;
+    const EVP_PKEY_ASN1_METHOD *ameth;
+
+    ameth = evp_pkey_asn1_find(type);
+    if (ameth)
+        ret = ameth->pkey_id;
+    else
+        ret = NID_undef;
+    return ret;
+#else
+    size_t i;
+
+    for (i = 0; i < OSSL_NELEM(base_id_conversion); i++) {
+        if (type == base_id_conversion[i].pkey_id)
+            return base_id_conversion[i].pkey_base_id;
+    }
+    return NID_undef;
+#endif
+}
diff --git a/deps/openssl/openssl/crypto/evp/evp_rand.c b/deps/openssl/openssl/crypto/evp/evp_rand.c
index 6aa9c055678..168f308f606 100644
--- a/deps/openssl/openssl/crypto/evp/evp_rand.c
+++ b/deps/openssl/openssl/crypto/evp/evp_rand.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -24,6 +24,7 @@
 struct evp_rand_st {
     OSSL_PROVIDER *prov;
     int name_id;
+    int no_store;
     char *type_name;
     const char *description;
     CRYPTO_REF_COUNT refcnt;
@@ -116,7 +117,7 @@ static void evp_rand_unlock(EVP_RAND_CTX *rand)

 static void *evp_rand_from_algorithm(int name_id,
     const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov)
+    OSSL_PROVIDER *prov, int no_store)
 {
     const OSSL_DISPATCH *fns = algodef->implementation;
     EVP_RAND *rand = NULL;
@@ -130,6 +131,7 @@ static void *evp_rand_from_algorithm(int name_id,
         return NULL;
     }
     rand->name_id = name_id;
+    rand->no_store = no_store;
     if ((rand->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
         evp_rand_free(rand);
         return NULL;
@@ -289,12 +291,23 @@ EVP_RAND *EVP_RAND_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,

 int EVP_RAND_up_ref(EVP_RAND *rand)
 {
+#ifdef OPENSSL_NO_CACHED_FETCH
     return evp_rand_up_ref(rand);
+#else
+    if (rand->no_store != 0)
+        return evp_rand_up_ref(rand);
+    return 1;
+#endif
 }

 void EVP_RAND_free(EVP_RAND *rand)
 {
+#ifdef OPENSSL_NO_CACHED_FETCH
     evp_rand_free(rand);
+#else
+    if (rand != NULL && (rand->no_store != 0))
+        evp_rand_free(rand);
+#endif
 }

 int evp_rand_get_number(const EVP_RAND *rand)
@@ -492,8 +505,12 @@ void EVP_RAND_do_all_provided(OSSL_LIB_CTX *libctx,
     void (*fn)(EVP_RAND *rand, void *arg),
     void *arg)
 {
+    struct EVP_RAND_do_all_provided_thunk t;
+
+    t.fn = fn;
+    t.arg = arg;
     evp_generic_do_all(libctx, OSSL_OP_RAND,
-        (void (*)(void *, void *))fn, arg,
+        EVP_RAND_do_all_provided_thunk, &t,
         evp_rand_from_algorithm, evp_rand_up_ref,
         evp_rand_free);
 }
@@ -720,7 +737,7 @@ size_t evp_rand_get_seed(EVP_RAND_CTX *ctx,
     int prediction_resistance,
     const unsigned char *adin, size_t adin_len)
 {
-    int res;
+    size_t res;

     if (!evp_rand_lock(ctx))
         return 0;
diff --git a/deps/openssl/openssl/crypto/evp/exchange.c b/deps/openssl/openssl/crypto/evp/exchange.c
index 30299d67def..23c838d43ab 100644
--- a/deps/openssl/openssl/crypto/evp/exchange.c
+++ b/deps/openssl/openssl/crypto/evp/exchange.c
@@ -7,6 +7,7 @@
  * https://www.openssl.org/source/license.html
  */

+#include <openssl/core_names.h>
 #include <openssl/crypto.h>
 #include <openssl/evp.h>
 #include <openssl/err.h>
@@ -20,12 +21,26 @@

 static void evp_keyexch_free(void *data)
 {
-    EVP_KEYEXCH_free(data);
+    EVP_KEYEXCH *exchange = (EVP_KEYEXCH *)data;
+    int i;
+
+    if (exchange == NULL)
+        return;
+    CRYPTO_DOWN_REF(&exchange->refcnt, &i);
+    if (i > 0)
+        return;
+    OPENSSL_free(exchange->type_name);
+    ossl_provider_free(exchange->prov);
+    CRYPTO_FREE_REF(&exchange->refcnt);
+    OPENSSL_free(exchange);
 }

 static int evp_keyexch_up_ref(void *data)
 {
-    return EVP_KEYEXCH_up_ref(data);
+    EVP_KEYEXCH *exchange = (EVP_KEYEXCH *)data;
+    int ref = 0;
+
+    return CRYPTO_UP_REF(&exchange->refcnt, &ref);
 }

 static EVP_KEYEXCH *evp_keyexch_new(OSSL_PROVIDER *prov)
@@ -48,11 +63,11 @@ static EVP_KEYEXCH *evp_keyexch_new(OSSL_PROVIDER *prov)

 static void *evp_keyexch_from_algorithm(int name_id,
     const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov)
+    OSSL_PROVIDER *prov, int no_store)
 {
     const OSSL_DISPATCH *fns = algodef->implementation;
     EVP_KEYEXCH *exchange = NULL;
-    int fncnt = 0, sparamfncnt = 0, gparamfncnt = 0;
+    int fncnt = 0, sparamfncnt = 0, gparamfncnt = 0, derive_found = 0;

     if ((exchange = evp_keyexch_new(prov)) == NULL) {
         ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
@@ -60,6 +75,7 @@ static void *evp_keyexch_from_algorithm(int name_id,
     }

     exchange->name_id = name_id;
+    exchange->no_store = no_store;
     if ((exchange->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
         goto err;
     exchange->description = algodef->algorithm_description;
@@ -87,7 +103,7 @@ static void *evp_keyexch_from_algorithm(int name_id,
             if (exchange->derive != NULL)
                 break;
             exchange->derive = OSSL_FUNC_keyexch_derive(fns);
-            fncnt++;
+            derive_found = 1;
             break;
         case OSSL_FUNC_KEYEXCH_FREECTX:
             if (exchange->freectx != NULL)
@@ -126,8 +142,15 @@ static void *evp_keyexch_from_algorithm(int name_id,
                 = OSSL_FUNC_keyexch_settable_ctx_params(fns);
             sparamfncnt++;
             break;
+        case OSSL_FUNC_KEYEXCH_DERIVE_SKEY:
+            if (exchange->derive_skey != NULL)
+                break;
+            exchange->derive_skey = OSSL_FUNC_keyexch_derive_skey(fns);
+            derive_found = 1;
+            break;
         }
     }
+    fncnt += derive_found;
     if (fncnt != 4
         || (gparamfncnt != 0 && gparamfncnt != 2)
         || (sparamfncnt != 0 && sparamfncnt != 2)) {
@@ -146,31 +169,29 @@ static void *evp_keyexch_from_algorithm(int name_id,
     return exchange;

 err:
-    EVP_KEYEXCH_free(exchange);
+    evp_keyexch_free(exchange);
     return NULL;
 }

 void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange)
 {
-    int i;
-
-    if (exchange == NULL)
-        return;
-    CRYPTO_DOWN_REF(&exchange->refcnt, &i);
-    if (i > 0)
-        return;
-    OPENSSL_free(exchange->type_name);
-    ossl_provider_free(exchange->prov);
-    CRYPTO_FREE_REF(&exchange->refcnt);
-    OPENSSL_free(exchange);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    evp_keyexch_free(exchange);
+#else
+    if (exchange != NULL && (exchange->no_store != 0))
+        evp_keyexch_free(exchange);
+#endif
 }

 int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange)
 {
-    int ref = 0;
-
-    CRYPTO_UP_REF(&exchange->refcnt, &ref);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    return evp_keyexch_up_ref(exchange);
+#else
+    if (exchange->no_store != 0)
+        return evp_keyexch_up_ref(exchange);
     return 1;
+#endif
 }

 OSSL_PROVIDER *EVP_KEYEXCH_get0_provider(const EVP_KEYEXCH *exchange)
@@ -224,7 +245,7 @@ int EVP_PKEY_derive_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[])
     ERR_set_mark();

     if (evp_pkey_ctx_is_legacy(ctx))
-        goto legacy;
+        goto err;

     /*
      * Some algorithms (e.g. legacy KDFs) don't have a pkey - so we create
@@ -235,7 +256,7 @@ int EVP_PKEY_derive_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[])

         if (pkey == NULL
             || !EVP_PKEY_set_type_by_keymgmt(pkey, ctx->keymgmt)
-            || (pkey->keydata = evp_keymgmt_newdata(ctx->keymgmt)) == NULL) {
+            || (pkey->keydata = evp_keymgmt_newdata(ctx->keymgmt, NULL)) == NULL) {
             ERR_clear_last_mark();
             EVP_PKEY_free(pkey);
             ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
@@ -301,8 +322,11 @@ int EVP_PKEY_derive_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[])
             tmp_prov = EVP_KEYMGMT_get0_provider(ctx->keymgmt);
             exchange = evp_keyexch_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
                 supported_exch, ctx->propquery);
-            if (exchange == NULL)
-                goto legacy;
+            if (exchange == NULL) {
+                ERR_pop_to_mark();
+                ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
+                return -2;
+            }
             break;
         }
         if (exchange == NULL)
@@ -328,14 +352,14 @@ int EVP_PKEY_derive_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[])
     }

     if (provkey == NULL) {
+        ERR_pop_to_mark();
         EVP_KEYEXCH_free(exchange);
-        goto legacy;
+        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
+        return -2;
     }

     ERR_pop_to_mark();

-    /* No more legacy from here down to legacy: */
-
     /* A Coverity false positive with up_ref/down_ref and free */
     /* coverity[use_after_free] */
     ctx->op.kex.exchange = exchange;
@@ -356,30 +380,6 @@ err:
     ctx->operation = EVP_PKEY_OP_UNDEFINED;
     EVP_KEYMGMT_free(tmp_keymgmt);
     return 0;
-
-legacy:
-    /*
-     * If we don't have the full support we need with provided methods,
-     * let's go see if legacy does.
-     */
-    ERR_pop_to_mark();
-
-#ifdef FIPS_MODULE
-    return 0;
-#else
-    if (ctx->pmeth == NULL || ctx->pmeth->derive == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
-        return -2;
-    }
-
-    if (ctx->pmeth->derive_init == NULL)
-        return 1;
-    ret = ctx->pmeth->derive_init(ctx);
-    if (ret <= 0)
-        ctx->operation = EVP_PKEY_OP_UNDEFINED;
-    EVP_KEYMGMT_free(tmp_keymgmt);
-    return ret;
-#endif
 }

 int EVP_PKEY_derive_set_peer_ex(EVP_PKEY_CTX *ctx, EVP_PKEY *peer,
@@ -395,8 +395,10 @@ int EVP_PKEY_derive_set_peer_ex(EVP_PKEY_CTX *ctx, EVP_PKEY *peer,
         return -1;
     }

-    if (!EVP_PKEY_CTX_IS_DERIVE_OP(ctx) || ctx->op.kex.algctx == NULL)
-        goto legacy;
+    if (!EVP_PKEY_CTX_IS_DERIVE_OP(ctx) || ctx->op.kex.algctx == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
+        return -2;
+    }

     if (ctx->op.kex.exchange->set_peer == NULL) {
         ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
@@ -426,79 +428,24 @@ int EVP_PKEY_derive_set_peer_ex(EVP_PKEY_CTX *ctx, EVP_PKEY *peer,
                                                                        EVP_KEYEXCH_get0_provider(ctx->op.kex.exchange),
         EVP_KEYMGMT_get0_name(ctx->keymgmt),
         ctx->propquery);
-    if (tmp_keymgmt != NULL)
-        /* A Coverity issue with up_ref/down_ref and free */
-        /* coverity[pass_freed_arg] */
-        provkey = evp_pkey_export_to_provider(peer, ctx->libctx,
-            &tmp_keymgmt, ctx->propquery);
-    EVP_KEYMGMT_free(tmp_keymgmt_tofree);
-
-    /*
-     * If making the key provided wasn't possible, legacy may be able to pick
-     * it up
-     */
-    if (provkey == NULL)
-        goto legacy;
-    ret = ctx->op.kex.exchange->set_peer(ctx->op.kex.algctx, provkey);
-    if (ret <= 0)
-        return ret;
-    goto common;
-
-legacy:
-#ifdef FIPS_MODULE
-    return ret;
-#else
-    if (ctx->pmeth == NULL
-        || !(ctx->pmeth->derive != NULL
-            || ctx->pmeth->encrypt != NULL
-            || ctx->pmeth->decrypt != NULL)
-        || ctx->pmeth->ctrl == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
-        return -2;
-    }
-    if (ctx->operation != EVP_PKEY_OP_DERIVE
-        && ctx->operation != EVP_PKEY_OP_ENCRYPT
-        && ctx->operation != EVP_PKEY_OP_DECRYPT) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED);
-        return -1;
-    }
-
-    ret = ctx->pmeth->ctrl(ctx, EVP_PKEY_CTRL_PEER_KEY, 0, peer);
-
-    if (ret <= 0)
-        return ret;
-
-    if (ret == 2)
-        return 1;
-
-    if (ctx->pkey == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_NO_KEY_SET);
-        return -1;
-    }
-
-    if (ctx->pkey->type != peer->type) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES);
+    if (tmp_keymgmt == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_NO_KEYMGMT_AVAILABLE);
         return -1;
     }
+    /* A Coverity issue with up_ref/down_ref and free */
+    /* coverity[pass_freed_arg] */
+    provkey = evp_pkey_export_to_provider(peer, ctx->libctx,
+        &tmp_keymgmt, ctx->propquery);
+    EVP_KEYMGMT_free(tmp_keymgmt_tofree);

-    /*
-     * For clarity.  The error is if parameters in peer are
-     * present (!missing) but don't match.  EVP_PKEY_parameters_eq may return
-     * 1 (match), 0 (don't match) and -2 (comparison is not defined).  -1
-     * (different key types) is impossible here because it is checked earlier.
-     * -2 is OK for us here, as well as 1, so we can check for 0 only.
-     */
-    if (!EVP_PKEY_missing_parameters(peer) && !EVP_PKEY_parameters_eq(ctx->pkey, peer)) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_DIFFERENT_PARAMETERS);
+    if (provkey == NULL) {
+        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
         return -1;
     }
-
-    ret = ctx->pmeth->ctrl(ctx, EVP_PKEY_CTRL_PEER_KEY, 1, peer);
+    ret = ctx->op.kex.exchange->set_peer(ctx->op.kex.algctx, provkey);
     if (ret <= 0)
         return ret;
-#endif

-common:
     if (!EVP_PKEY_up_ref(peer))
         return -1;

@@ -527,21 +474,114 @@ int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *pkeylen)
         return -1;
     }

-    if (ctx->op.kex.algctx == NULL)
-        goto legacy;
+    if (ctx->op.kex.algctx == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
+        return -2;
+    }

     ret = ctx->op.kex.exchange->derive(ctx->op.kex.algctx, key, pkeylen,
         key != NULL ? *pkeylen : 0);

     return ret;
-legacy:
-    if (ctx->pmeth == NULL || ctx->pmeth->derive == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
-        return -2;
+}
+
+#ifndef FIPS_MODULE
+EVP_SKEY *EVP_PKEY_derive_SKEY(EVP_PKEY_CTX *ctx, EVP_SKEYMGMT *mgmt,
+    const char *key_type, const char *propquery,
+    size_t keylen, const OSSL_PARAM params[])
+{
+    EVP_SKEYMGMT *skeymgmt = NULL;
+    EVP_SKEY *ret = NULL;
+
+    if (ctx == NULL || key_type == NULL) {
+        ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_NULL_PARAMETER);
+        return NULL;
+    }
+
+    if (!EVP_PKEY_CTX_IS_DERIVE_OP(ctx)) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED);
+        return NULL;
+    }
+
+    if (ctx->op.kex.algctx == NULL) {
+        ERR_raise(ERR_R_EVP_LIB, ERR_R_UNSUPPORTED);
+        return NULL;
+    }
+
+    if (mgmt != NULL) {
+        skeymgmt = mgmt;
+    } else {
+        skeymgmt = evp_skeymgmt_fetch_from_prov(ctx->op.kex.exchange->prov,
+            key_type, propquery);
+        if (skeymgmt == NULL) {
+            /*
+             * The provider does not support skeymgmt, let's try to fallback
+             * to a provider that supports it
+             */
+            skeymgmt = EVP_SKEYMGMT_fetch(ctx->libctx, key_type, propquery);
+        }
+        if (skeymgmt == NULL) {
+            ERR_raise(ERR_LIB_EVP, ERR_R_FETCH_FAILED);
+            return NULL;
+        }
     }

-    M_check_autoarg(ctx, key, pkeylen, EVP_F_EVP_PKEY_DERIVE) return ctx->pmeth->derive(ctx, key, pkeylen);
+    /* Fallback to raw derive + import if necessary */
+    if (skeymgmt->prov != ctx->op.kex.exchange->prov || ctx->op.kex.exchange->derive_skey == NULL) {
+        size_t tmplen = keylen;
+        unsigned char *key = NULL;
+        OSSL_PARAM import_params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+
+        if (ctx->op.kex.exchange->derive == NULL) {
+            ERR_raise(ERR_R_EVP_LIB, ERR_R_UNSUPPORTED);
+            goto cleanup;
+        }
+
+        key = OPENSSL_zalloc(keylen);
+        if (key == NULL) {
+            ERR_raise(ERR_R_EVP_LIB, ERR_R_CRYPTO_LIB);
+            goto cleanup;
+        }
+
+        if (!ctx->op.kex.exchange->derive(ctx->op.kex.algctx, key, &tmplen,
+                tmplen)) {
+            OPENSSL_free(key);
+            goto cleanup;
+        }
+
+        if (keylen != tmplen) {
+            OPENSSL_free(key);
+            ERR_raise(ERR_R_EVP_LIB, ERR_R_INTERNAL_ERROR);
+            goto cleanup;
+        }
+        import_params[0] = OSSL_PARAM_construct_octet_string(OSSL_SKEY_PARAM_RAW_BYTES,
+            key, keylen);
+
+        ret = EVP_SKEY_import_SKEYMGMT(ctx->libctx, skeymgmt,
+            OSSL_SKEYMGMT_SELECT_SECRET_KEY, import_params);
+        OPENSSL_clear_free(key, keylen);
+        goto cleanup;
+    }
+
+    ret = evp_skey_alloc(skeymgmt);
+    if (ret == NULL)
+        goto cleanup;
+
+    ret->keydata = ctx->op.kex.exchange->derive_skey(ctx->op.kex.algctx, key_type,
+        ossl_provider_ctx(skeymgmt->prov),
+        skeymgmt->import, keylen, params);
+
+    if (ret->keydata == NULL) {
+        EVP_SKEY_free(ret);
+        ret = NULL;
+        goto cleanup;
+    }
+cleanup:
+    if (mgmt != skeymgmt)
+        EVP_SKEYMGMT_free(skeymgmt);
+    return ret;
 }
+#endif /* !FIPS_MODULE */

 int evp_keyexch_get_number(const EVP_KEYEXCH *keyexch)
 {
@@ -568,8 +608,12 @@ void EVP_KEYEXCH_do_all_provided(OSSL_LIB_CTX *libctx,
     void (*fn)(EVP_KEYEXCH *keyexch, void *arg),
     void *arg)
 {
+    struct EVP_KEYEXCH_do_all_provided_thunk t;
+
+    t.fn = fn;
+    t.arg = arg;
     evp_generic_do_all(libctx, OSSL_OP_KEYEXCH,
-        (void (*)(void *, void *))fn, arg,
+        EVP_KEYEXCH_do_all_provided_thunk, &t,
         evp_keyexch_from_algorithm,
         evp_keyexch_up_ref,
         evp_keyexch_free);
diff --git a/deps/openssl/openssl/crypto/evp/kdf_lib.c b/deps/openssl/openssl/crypto/evp/kdf_lib.c
index b445fa9d124..c89d93b3baf 100644
--- a/deps/openssl/openssl/crypto/evp/kdf_lib.c
+++ b/deps/openssl/openssl/crypto/evp/kdf_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2018-2019, Oracle and/or its affiliates.  All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -19,6 +19,7 @@
 #include "internal/numbers.h"
 #include "internal/provider.h"
 #include "evp_local.h"
+#include "internal/param_build_set.h"

 EVP_KDF_CTX *EVP_KDF_CTX_new(EVP_KDF *kdf)
 {
@@ -103,11 +104,25 @@ const OSSL_PROVIDER *EVP_KDF_get0_provider(const EVP_KDF *kdf)
     return kdf->prov;
 }

-const EVP_KDF *EVP_KDF_CTX_kdf(EVP_KDF_CTX *ctx)
+const EVP_KDF *EVP_KDF_CTX_get0_kdf(const EVP_KDF_CTX *ctx)
 {
     return ctx->meth;
 }

+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+const EVP_KDF *EVP_KDF_CTX_kdf(const EVP_KDF_CTX *ctx)
+{
+    return EVP_KDF_CTX_get0_kdf(ctx);
+}
+#endif /* !OPENSSL_NO_DEPRECATED_4_1 */
+
+EVP_KDF *EVP_KDF_CTX_get1_kdf(const EVP_KDF_CTX *ctx)
+{
+    if (!EVP_KDF_up_ref(ctx->meth))
+        return NULL;
+    return ctx->meth;
+}
+
 void EVP_KDF_CTX_reset(EVP_KDF_CTX *ctx)
 {
     if (ctx == NULL)
@@ -144,6 +159,145 @@ int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen,
     return ctx->meth->derive(ctx->algctx, key, keylen, params);
 }

+#ifndef FIPS_MODULE
+struct convert_key {
+    const char *name;
+    OSSL_PARAM *param;
+};
+
+static int convert_key_cb(const OSSL_PARAM params[], void *arg)
+{
+    struct convert_key *ckey = arg;
+    const OSSL_PARAM *raw_bytes;
+    unsigned char *data;
+    size_t len;
+
+    raw_bytes = OSSL_PARAM_locate_const(params, OSSL_SKEY_PARAM_RAW_BYTES);
+    if (raw_bytes == NULL)
+        return 0;
+
+    if (!OSSL_PARAM_get_octet_string_ptr(raw_bytes, (const void **)&data, &len))
+        return 0;
+
+    *ckey->param = OSSL_PARAM_construct_octet_string(ckey->name, data, len);
+    return 1;
+}
+
+int EVP_KDF_CTX_set_SKEY(EVP_KDF_CTX *ctx, EVP_SKEY *key, const char *paramname)
+{
+    struct convert_key ckey;
+    OSSL_PARAM params[2] = {
+        OSSL_PARAM_END,
+        OSSL_PARAM_END,
+    };
+
+    if (ctx == NULL)
+        return 0;
+
+    ckey.name = (paramname != NULL) ? paramname : OSSL_KDF_PARAM_KEY;
+
+    if (ctx->meth->set_skey != NULL && ctx->meth->prov == key->skeymgmt->prov)
+        return ctx->meth->set_skey(ctx->algctx, key->keydata, ckey.name);
+
+    /*
+     * We can't use the opaque key directly.
+     * Let's try to export it and set the ctx params in a traditional manner.
+     */
+    ckey.param = &params[0];
+
+    if (!ctx->meth->set_ctx_params)
+        return 0;
+
+    if (EVP_SKEY_export(key, OSSL_SKEYMGMT_SELECT_SECRET_KEY,
+            convert_key_cb, &ckey))
+        return ctx->meth->set_ctx_params(ctx->algctx, params);
+
+    return 0;
+}
+
+EVP_SKEY *EVP_KDF_derive_SKEY(EVP_KDF_CTX *ctx, EVP_SKEYMGMT *mgmt,
+    const char *key_type, const char *propquery,
+    size_t keylen, const OSSL_PARAM params[])
+{
+    EVP_SKEYMGMT *skeymgmt = NULL;
+    EVP_SKEY *ret = NULL;
+
+    if (ctx == NULL || key_type == NULL) {
+        ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_NULL_PARAMETER);
+        return NULL;
+    }
+
+    if (mgmt != NULL) {
+        skeymgmt = mgmt;
+    } else {
+        skeymgmt = evp_skeymgmt_fetch_from_prov(ctx->meth->prov,
+            key_type, propquery);
+        if (skeymgmt == NULL) {
+            /*
+             * The provider does not support skeymgmt, let's try to fallback
+             * to a provider that supports it
+             */
+            skeymgmt = EVP_SKEYMGMT_fetch(ossl_provider_libctx(ctx->meth->prov),
+                key_type, propquery);
+        }
+
+        if (skeymgmt == NULL) {
+            ERR_raise(ERR_LIB_EVP, ERR_R_FETCH_FAILED);
+            return NULL;
+        }
+    }
+
+    /* Fallback to raw derive + import if necessary */
+    if (skeymgmt->prov != ctx->meth->prov || ctx->meth->derive_skey == NULL) {
+        unsigned char *key = NULL;
+        OSSL_PARAM import_params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+
+        if (ctx->meth->derive == NULL) {
+            ERR_raise(ERR_R_EVP_LIB, ERR_R_UNSUPPORTED);
+            return NULL;
+        }
+
+        key = OPENSSL_zalloc(keylen);
+        if (!key)
+            return NULL;
+
+        if (!ctx->meth->derive(ctx->algctx, key, keylen, params)) {
+            OPENSSL_free(key);
+            return NULL;
+        }
+        import_params[0] = OSSL_PARAM_construct_octet_string(OSSL_SKEY_PARAM_RAW_BYTES,
+            key, keylen);
+
+        ret = EVP_SKEY_import_SKEYMGMT(ossl_provider_libctx(ctx->meth->prov), skeymgmt,
+            OSSL_SKEYMGMT_SELECT_SECRET_KEY, import_params);
+
+        if (mgmt != skeymgmt)
+            EVP_SKEYMGMT_free(skeymgmt);
+
+        OPENSSL_clear_free(key, keylen);
+        return ret;
+    }
+
+    ret = evp_skey_alloc(skeymgmt);
+    if (ret == NULL) {
+        if (mgmt != skeymgmt)
+            EVP_SKEYMGMT_free(skeymgmt);
+        return NULL;
+    }
+
+    ret->keydata = ctx->meth->derive_skey(ctx->algctx, key_type, ossl_provider_ctx(skeymgmt->prov),
+        skeymgmt->import, keylen, params);
+    if (ret->keydata == NULL) {
+        EVP_SKEY_free(ret);
+        ret = NULL;
+    }
+
+    if (mgmt != skeymgmt)
+        EVP_SKEYMGMT_free(skeymgmt);
+    return ret;
+}
+#endif /* !FIPS_MODULE */
+
 /*
  * The {get,set}_params functions return 1 if there is no corresponding
  * function in the implementation.  This is the same as if there was one,
diff --git a/deps/openssl/openssl/crypto/evp/kdf_meth.c b/deps/openssl/openssl/crypto/evp/kdf_meth.c
index 11d0a39ef27..2ad6f49235a 100644
--- a/deps/openssl/openssl/crypto/evp/kdf_meth.c
+++ b/deps/openssl/openssl/crypto/evp/kdf_meth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -22,8 +22,7 @@ static int evp_kdf_up_ref(void *vkdf)
     EVP_KDF *kdf = (EVP_KDF *)vkdf;
     int ref = 0;

-    CRYPTO_UP_REF(&kdf->refcnt, &ref);
-    return 1;
+    return CRYPTO_UP_REF(&kdf->refcnt, &ref);
 }

 static void evp_kdf_free(void *vkdf)
@@ -57,7 +56,7 @@ static void *evp_kdf_new(void)

 static void *evp_kdf_from_algorithm(int name_id,
     const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov)
+    OSSL_PROVIDER *prov, int no_store)
 {
     const OSSL_DISPATCH *fns = algodef->implementation;
     EVP_KDF *kdf = NULL;
@@ -68,6 +67,8 @@ static void *evp_kdf_from_algorithm(int name_id,
         return NULL;
     }
     kdf->name_id = name_id;
+    kdf->no_store = no_store;
+
     if ((kdf->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
         goto err;

@@ -133,6 +134,16 @@ static void *evp_kdf_from_algorithm(int name_id,
                 break;
             kdf->set_ctx_params = OSSL_FUNC_kdf_set_ctx_params(fns);
             break;
+        case OSSL_FUNC_KDF_SET_SKEY:
+            if (kdf->set_skey != NULL)
+                break;
+            kdf->set_skey = OSSL_FUNC_kdf_set_skey(fns);
+            break;
+        case OSSL_FUNC_KDF_DERIVE_SKEY:
+            if (kdf->derive_skey != NULL)
+                break;
+            kdf->derive_skey = OSSL_FUNC_kdf_derive_skey(fns);
+            break;
         }
     }
     if (fnkdfcnt != 1 || fnctxcnt != 2) {
@@ -166,12 +177,23 @@ EVP_KDF *EVP_KDF_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,

 int EVP_KDF_up_ref(EVP_KDF *kdf)
 {
+#ifdef OPENSSL_NO_CACHED_FETCH
     return evp_kdf_up_ref(kdf);
+#else
+    if (kdf->no_store != 0)
+        return evp_kdf_up_ref(kdf);
+    return 1;
+#endif
 }

 void EVP_KDF_free(EVP_KDF *kdf)
 {
+#ifdef OPENSSL_NO_CACHED_FETCH
     evp_kdf_free(kdf);
+#else
+    if (kdf != NULL && (kdf->no_store != 0))
+        evp_kdf_free(kdf);
+#endif
 }

 const OSSL_PARAM *EVP_KDF_gettable_params(const EVP_KDF *kdf)
@@ -225,7 +247,11 @@ void EVP_KDF_do_all_provided(OSSL_LIB_CTX *libctx,
     void (*fn)(EVP_KDF *kdf, void *arg),
     void *arg)
 {
+    struct EVP_KDF_do_all_provided_thunk t;
+
+    t.fn = fn;
+    t.arg = arg;
     evp_generic_do_all(libctx, OSSL_OP_KDF,
-        (void (*)(void *, void *))fn, arg,
+        EVP_KDF_do_all_provided_thunk, &t,
         evp_kdf_from_algorithm, evp_kdf_up_ref, evp_kdf_free);
 }
diff --git a/deps/openssl/openssl/crypto/evp/kem.c b/deps/openssl/openssl/crypto/evp/kem.c
index cb53d40eeb1..8ae968d5a51 100644
--- a/deps/openssl/openssl/crypto/evp/kem.c
+++ b/deps/openssl/openssl/crypto/evp/kem.c
@@ -19,12 +19,27 @@

 static void evp_kem_free(void *data)
 {
-    EVP_KEM_free(data);
+    EVP_KEM *kem = (EVP_KEM *)data;
+    int i;
+
+    if (kem == NULL)
+        return;
+
+    CRYPTO_DOWN_REF(&kem->refcnt, &i);
+    if (i > 0)
+        return;
+    OPENSSL_free(kem->type_name);
+    ossl_provider_free(kem->prov);
+    CRYPTO_FREE_REF(&kem->refcnt);
+    OPENSSL_free(kem);
 }

 static int evp_kem_up_ref(void *data)
 {
-    return EVP_KEM_up_ref(data);
+    EVP_KEM *kem = (EVP_KEM *)data;
+    int ref = 0;
+
+    return CRYPTO_UP_REF(&kem->refcnt, &ref);
 }

 static int evp_kem_init(EVP_PKEY_CTX *ctx, int operation,
@@ -301,7 +316,7 @@ static EVP_KEM *evp_kem_new(OSSL_PROVIDER *prov)
 }

 static void *evp_kem_from_algorithm(int name_id, const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov)
+    OSSL_PROVIDER *prov, int no_store)
 {
     const OSSL_DISPATCH *fns = algodef->implementation;
     EVP_KEM *kem = NULL;
@@ -314,6 +329,8 @@ static void *evp_kem_from_algorithm(int name_id, const OSSL_ALGORITHM *algodef,
     }

     kem->name_id = name_id;
+    kem->no_store = no_store;
+
     if ((kem->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
         goto err;
     kem->description = algodef->algorithm_description;
@@ -426,32 +443,29 @@ static void *evp_kem_from_algorithm(int name_id, const OSSL_ALGORITHM *algodef,

     return kem;
 err:
-    EVP_KEM_free(kem);
+    evp_kem_free(kem);
     return NULL;
 }

 void EVP_KEM_free(EVP_KEM *kem)
 {
-    int i;
-
-    if (kem == NULL)
-        return;
-
-    CRYPTO_DOWN_REF(&kem->refcnt, &i);
-    if (i > 0)
-        return;
-    OPENSSL_free(kem->type_name);
-    ossl_provider_free(kem->prov);
-    CRYPTO_FREE_REF(&kem->refcnt);
-    OPENSSL_free(kem);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    evp_kem_free(kem);
+#else
+    if (kem != NULL && (kem->no_store != 0))
+        evp_kem_free(kem);
+#endif
 }

 int EVP_KEM_up_ref(EVP_KEM *kem)
 {
-    int ref = 0;
-
-    CRYPTO_UP_REF(&kem->refcnt, &ref);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    return evp_kem_up_ref(kem);
+#else
+    if (kem->no_store != 0)
+        return evp_kem_up_ref(kem);
     return 1;
+#endif
 }

 OSSL_PROVIDER *EVP_KEM_get0_provider(const EVP_KEM *kem)
@@ -501,7 +515,11 @@ void EVP_KEM_do_all_provided(OSSL_LIB_CTX *libctx,
     void (*fn)(EVP_KEM *kem, void *arg),
     void *arg)
 {
-    evp_generic_do_all(libctx, OSSL_OP_KEM, (void (*)(void *, void *))fn, arg,
+    struct EVP_KEM_do_all_provided_thunk t;
+
+    t.fn = fn;
+    t.arg = arg;
+    evp_generic_do_all(libctx, OSSL_OP_KEM, EVP_KEM_do_all_provided_thunk, &t,
         evp_kem_from_algorithm,
         evp_kem_up_ref,
         evp_kem_free);
diff --git a/deps/openssl/openssl/crypto/evp/keymgmt_lib.c b/deps/openssl/openssl/crypto/evp/keymgmt_lib.c
index 6b6da9062a5..108601e939e 100644
--- a/deps/openssl/openssl/crypto/evp/keymgmt_lib.c
+++ b/deps/openssl/openssl/crypto/evp/keymgmt_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -33,7 +33,7 @@ int evp_keymgmt_util_try_import(const OSSL_PARAM params[], void *arg)

     /* Just in time creation of keydata */
     if (data->keydata == NULL) {
-        if ((data->keydata = evp_keymgmt_newdata(data->keymgmt)) == NULL) {
+        if ((data->keydata = evp_keymgmt_newdata(data->keymgmt, params)) == NULL) {
             ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
             return 0;
         }
@@ -219,14 +219,13 @@ static void op_cache_free(OP_CACHE_ELEM *e)
     OPENSSL_free(e);
 }

-int evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk)
+void evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk)
 {
-    if (pk != NULL) {
-        sk_OP_CACHE_ELEM_pop_free(pk->operation_cache, op_cache_free);
-        pk->operation_cache = NULL;
-    }
+    if (pk == NULL)
+        return;

-    return 1;
+    sk_OP_CACHE_ELEM_pop_free(pk->operation_cache, op_cache_free);
+    pk->operation_cache = NULL;
 }

 OP_CACHE_ELEM *evp_keymgmt_util_find_operation_cache(EVP_PKEY *pk,
@@ -296,18 +295,22 @@ void evp_keymgmt_util_cache_keyinfo(EVP_PKEY *pk)
     if (pk->keydata != NULL) {
         int bits = 0;
         int security_bits = 0;
+        int security_category = -1;
         int size = 0;
-        OSSL_PARAM params[4];
+        OSSL_PARAM params[5];

         params[0] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_BITS, &bits);
         params[1] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_BITS,
             &security_bits);
-        params[2] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_MAX_SIZE, &size);
-        params[3] = OSSL_PARAM_construct_end();
+        params[2] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_CATEGORY,
+            &security_category);
+        params[3] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_MAX_SIZE, &size);
+        params[4] = OSSL_PARAM_construct_end();
         if (evp_keymgmt_get_params(pk->keymgmt, pk->keydata, params)) {
             pk->cache.size = size;
             pk->cache.bits = bits;
             pk->cache.security_bits = security_bits;
+            pk->cache.security_category = security_category;
         }
     }
 }
@@ -317,7 +320,7 @@ void *evp_keymgmt_util_fromdata(EVP_PKEY *target, EVP_KEYMGMT *keymgmt,
 {
     void *keydata = NULL;

-    if ((keydata = evp_keymgmt_newdata(keymgmt)) == NULL
+    if ((keydata = evp_keymgmt_newdata(keymgmt, params)) == NULL
         || !evp_keymgmt_import(keymgmt, keydata, selection, params)
         || !evp_keymgmt_util_assign_pkey(target, keymgmt, keydata)) {
         evp_keymgmt_freedata(keymgmt, keydata);
diff --git a/deps/openssl/openssl/crypto/evp/keymgmt_meth.c b/deps/openssl/openssl/crypto/evp/keymgmt_meth.c
index 843976f476e..9cf4ef5e4fa 100644
--- a/deps/openssl/openssl/crypto/evp/keymgmt_meth.c
+++ b/deps/openssl/openssl/crypto/evp/keymgmt_meth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,12 +19,27 @@

 static void evp_keymgmt_free(void *data)
 {
-    EVP_KEYMGMT_free(data);
+    EVP_KEYMGMT *keymgmt = (EVP_KEYMGMT *)data;
+    int ref = 0;
+
+    if (keymgmt == NULL)
+        return;
+
+    CRYPTO_DOWN_REF(&keymgmt->refcnt, &ref);
+    if (ref > 0)
+        return;
+    OPENSSL_free(keymgmt->type_name);
+    ossl_provider_free(keymgmt->prov);
+    CRYPTO_FREE_REF(&keymgmt->refcnt);
+    OPENSSL_free(keymgmt);
 }

 static int evp_keymgmt_up_ref(void *data)
 {
-    return EVP_KEYMGMT_up_ref(data);
+    EVP_KEYMGMT *keymgmt = (EVP_KEYMGMT *)data;
+    int ref = 0;
+
+    return CRYPTO_UP_REF(&keymgmt->refcnt, &ref);
 }

 static void *keymgmt_new(void)
@@ -34,7 +49,7 @@ static void *keymgmt_new(void)
     if ((keymgmt = OPENSSL_zalloc(sizeof(*keymgmt))) == NULL)
         return NULL;
     if (!CRYPTO_NEW_REF(&keymgmt->refcnt, 1)) {
-        EVP_KEYMGMT_free(keymgmt);
+        OPENSSL_free(keymgmt);
         return NULL;
     }
     return keymgmt;
@@ -62,7 +77,7 @@ static int get_legacy_alg_type_from_keymgmt(const EVP_KEYMGMT *keymgmt)

 static void *keymgmt_from_algorithm(int name_id,
     const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov)
+    OSSL_PROVIDER *prov, int no_store)
 {
     const OSSL_DISPATCH *fns = algodef->implementation;
     EVP_KEYMGMT *keymgmt = NULL;
@@ -76,8 +91,10 @@ static void *keymgmt_from_algorithm(int name_id,
         return NULL;

     keymgmt->name_id = name_id;
+    keymgmt->no_store = no_store;
+
     if ((keymgmt->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
-        EVP_KEYMGMT_free(keymgmt);
+        evp_keymgmt_free(keymgmt);
         return NULL;
     }
     keymgmt->description = algodef->algorithm_description;
@@ -88,6 +105,10 @@ static void *keymgmt_from_algorithm(int name_id,
             if (keymgmt->new == NULL)
                 keymgmt->new = OSSL_FUNC_keymgmt_new(fns);
             break;
+        case OSSL_FUNC_KEYMGMT_NEW_EX:
+            if (keymgmt->new_ex == NULL)
+                keymgmt->new_ex = OSSL_FUNC_keymgmt_new_ex(fns);
+            break;
         case OSSL_FUNC_KEYMGMT_GEN_INIT:
             if (keymgmt->gen_init == NULL)
                 keymgmt->gen_init = OSSL_FUNC_keymgmt_gen_init(fns);
@@ -236,6 +257,7 @@ static void *keymgmt_from_algorithm(int name_id,
      */
     if (keymgmt->free == NULL
         || (keymgmt->new == NULL
+            && keymgmt->new_ex == NULL
             && keymgmt->gen == NULL
             && keymgmt->load == NULL)
         || keymgmt->has == NULL
@@ -248,13 +270,16 @@ static void *keymgmt_from_algorithm(int name_id,
         || (keymgmt->gen != NULL
             && (keymgmt->gen_init == NULL
                 || keymgmt->gen_cleanup == NULL))) {
-        EVP_KEYMGMT_free(keymgmt);
+        evp_keymgmt_free(keymgmt);
         ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
         return NULL;
     }
     keymgmt->prov = prov;
-    if (prov != NULL)
-        ossl_provider_up_ref(prov);
+    if (prov != NULL && !ossl_provider_up_ref(prov)) {
+        evp_keymgmt_free(keymgmt);
+        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
+        return NULL;
+    }

 #ifndef FIPS_MODULE
     keymgmt->legacy_alg = get_legacy_alg_type_from_keymgmt(keymgmt);
@@ -285,26 +310,23 @@ EVP_KEYMGMT *EVP_KEYMGMT_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,

 int EVP_KEYMGMT_up_ref(EVP_KEYMGMT *keymgmt)
 {
-    int ref = 0;
-
-    CRYPTO_UP_REF(&keymgmt->refcnt, &ref);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    return evp_keymgmt_up_ref(keymgmt);
+#else
+    if (keymgmt->no_store != 0)
+        return evp_keymgmt_up_ref(keymgmt);
     return 1;
+#endif
 }

 void EVP_KEYMGMT_free(EVP_KEYMGMT *keymgmt)
 {
-    int ref = 0;
-
-    if (keymgmt == NULL)
-        return;
-
-    CRYPTO_DOWN_REF(&keymgmt->refcnt, &ref);
-    if (ref > 0)
-        return;
-    OPENSSL_free(keymgmt->type_name);
-    ossl_provider_free(keymgmt->prov);
-    CRYPTO_FREE_REF(&keymgmt->refcnt);
-    OPENSSL_free(keymgmt);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    evp_keymgmt_free(keymgmt);
+#else
+    if (keymgmt != NULL && (keymgmt->no_store != 0))
+        evp_keymgmt_free(keymgmt);
+#endif
 }

 const OSSL_PROVIDER *EVP_KEYMGMT_get0_provider(const EVP_KEYMGMT *keymgmt)
@@ -342,8 +364,12 @@ void EVP_KEYMGMT_do_all_provided(OSSL_LIB_CTX *libctx,
     void (*fn)(EVP_KEYMGMT *keymgmt, void *arg),
     void *arg)
 {
+    struct EVP_KEYMGMT_do_all_provided_thunk t;
+
+    t.fn = fn;
+    t.arg = arg;
     evp_generic_do_all(libctx, OSSL_OP_KEYMGMT,
-        (void (*)(void *, void *))fn, arg,
+        EVP_KEYMGMT_do_all_provided_thunk, &t,
         keymgmt_from_algorithm,
         evp_keymgmt_up_ref,
         evp_keymgmt_free);
@@ -362,18 +388,20 @@ int EVP_KEYMGMT_names_do_all(const EVP_KEYMGMT *keymgmt,
 /*
  * Internal API that interfaces with the method function pointers
  */
-void *evp_keymgmt_newdata(const EVP_KEYMGMT *keymgmt)
+void *evp_keymgmt_newdata(const EVP_KEYMGMT *keymgmt, const OSSL_PARAM params[])
 {
     void *provctx = ossl_provider_ctx(EVP_KEYMGMT_get0_provider(keymgmt));

     /*
-     * 'new' is currently mandatory on its own, but when new
-     * constructors appear, it won't be quite as mandatory,
-     * so we have a check for future cases.
+     * Some providers may have a new_ex which accepts parameters. Otherwise we
+     * fall back to the old "new" which doesn't accept params.
      */
-    if (keymgmt->new == NULL)
-        return NULL;
-    return keymgmt->new(provctx);
+    if (keymgmt->new_ex == NULL) {
+        if (keymgmt->new == NULL)
+            return NULL;
+        return keymgmt->new(provctx);
+    }
+    return keymgmt->new_ex(provctx, params);
 }

 void evp_keymgmt_freedata(const EVP_KEYMGMT *keymgmt, void *keydata)
@@ -398,8 +426,8 @@ int evp_keymgmt_gen_set_template(const EVP_KEYMGMT *keymgmt, void *genctx,
     /*
      * It's arguable if we actually should return success in this case, as
      * it allows the caller to set a template key, which is then ignored.
-     * However, this is how the legacy methods (EVP_PKEY_METHOD) operate,
-     * so we do this in the interest of backward compatibility.
+     * However, this is how the legacy methods used to operate, so we do this in
+     * the interest of backward compatibility.
      */
     if (keymgmt->gen_set_template == NULL)
         return 1;
diff --git a/deps/openssl/openssl/crypto/evp/legacy_blake2.c b/deps/openssl/openssl/crypto/evp/legacy_blake2.c
index af8ad536fa3..b8809c10672 100644
--- a/deps/openssl/openssl/crypto/evp/legacy_blake2.c
+++ b/deps/openssl/openssl/crypto/evp/legacy_blake2.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -9,33 +9,6 @@

 #include "crypto/evp.h"
 #include "prov/blake2.h" /* diverse BLAKE2 macros */
-#include "legacy_meth.h"
-
-/*
- * Local hack to adapt the BLAKE2 init functions to what the
- * legacy function signatures demand.
- */
-static int blake2s_init(BLAKE2S_CTX *C)
-{
-    BLAKE2S_PARAM P;
-
-    ossl_blake2s_param_init(&P);
-    return ossl_blake2s_init(C, &P);
-}
-static int blake2b_init(BLAKE2B_CTX *C)
-{
-    BLAKE2B_PARAM P;
-
-    ossl_blake2b_param_init(&P);
-    return ossl_blake2b_init(C, &P);
-}
-#define blake2s_update ossl_blake2s_update
-#define blake2b_update ossl_blake2b_update
-#define blake2s_final ossl_blake2s_final
-#define blake2b_final ossl_blake2b_final
-
-IMPLEMENT_LEGACY_EVP_MD_METH_LC(blake2s_int, blake2s)
-IMPLEMENT_LEGACY_EVP_MD_METH_LC(blake2b_int, blake2b)

 static const EVP_MD blake2b_md = {
     NID_blake2b512,
@@ -43,8 +16,7 @@ static const EVP_MD blake2b_md = {
     BLAKE2B_DIGEST_LENGTH,
     0,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(blake2b_int_init, blake2b_int_update,
-        blake2b_int_final, NULL, BLAKE2B_BLOCKBYTES),
+    BLAKE2B_BLOCKBYTES,
 };

 const EVP_MD *EVP_blake2b512(void)
@@ -58,8 +30,7 @@ static const EVP_MD blake2s_md = {
     BLAKE2S_DIGEST_LENGTH,
     0,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(blake2s_int_init, blake2s_int_update,
-        blake2s_int_final, NULL, BLAKE2S_BLOCKBYTES),
+    BLAKE2S_BLOCKBYTES,
 };

 const EVP_MD *EVP_blake2s256(void)
diff --git a/deps/openssl/openssl/crypto/evp/legacy_md2.c b/deps/openssl/openssl/crypto/evp/legacy_md2.c
index 72cc99ad704..bd587d177c7 100644
--- a/deps/openssl/openssl/crypto/evp/legacy_md2.c
+++ b/deps/openssl/openssl/crypto/evp/legacy_md2.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,17 +7,8 @@
  * https://www.openssl.org/source/license.html
  */

-/*
- * MD2 low level APIs are deprecated for public use, but still ok for
- * internal use.
- */
-#include "internal/deprecated.h"
-
 #include <openssl/md2.h>
 #include "crypto/evp.h"
-#include "legacy_meth.h"
-
-IMPLEMENT_LEGACY_EVP_MD_METH(md2, MD2)

 static const EVP_MD md2_md = {
     NID_md2,
@@ -25,7 +16,7 @@ static const EVP_MD md2_md = {
     MD2_DIGEST_LENGTH,
     0,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(md2_init, md2_update, md2_final, NULL, MD2_BLOCK)
+    MD2_BLOCK
 };

 const EVP_MD *EVP_md2(void)
diff --git a/deps/openssl/openssl/crypto/evp/legacy_md4.c b/deps/openssl/openssl/crypto/evp/legacy_md4.c
index 4bc852b5209..0dd2a0e23dc 100644
--- a/deps/openssl/openssl/crypto/evp/legacy_md4.c
+++ b/deps/openssl/openssl/crypto/evp/legacy_md4.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,9 +15,6 @@

 #include <openssl/md4.h>
 #include "crypto/evp.h"
-#include "legacy_meth.h"
-
-IMPLEMENT_LEGACY_EVP_MD_METH(md4, MD4)

 static const EVP_MD md4_md = {
     NID_md4,
@@ -25,7 +22,7 @@ static const EVP_MD md4_md = {
     MD4_DIGEST_LENGTH,
     0,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(md4_init, md4_update, md4_final, NULL, MD4_CBLOCK),
+    MD4_CBLOCK
 };

 const EVP_MD *EVP_md4(void)
diff --git a/deps/openssl/openssl/crypto/evp/legacy_md5.c b/deps/openssl/openssl/crypto/evp/legacy_md5.c
index a67be9fef74..b95dea66943 100644
--- a/deps/openssl/openssl/crypto/evp/legacy_md5.c
+++ b/deps/openssl/openssl/crypto/evp/legacy_md5.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,9 +15,6 @@

 #include <openssl/md5.h>
 #include "crypto/evp.h"
-#include "legacy_meth.h"
-
-IMPLEMENT_LEGACY_EVP_MD_METH(md5, MD5)

 static const EVP_MD md5_md = {
     NID_md5,
@@ -25,7 +22,7 @@ static const EVP_MD md5_md = {
     MD5_DIGEST_LENGTH,
     0,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(md5_init, md5_update, md5_final, NULL, MD5_CBLOCK)
+    MD5_CBLOCK
 };

 const EVP_MD *EVP_md5(void)
diff --git a/deps/openssl/openssl/crypto/evp/legacy_md5_sha1.c b/deps/openssl/openssl/crypto/evp/legacy_md5_sha1.c
index 62947f8b9a6..3b46a44e6f7 100644
--- a/deps/openssl/openssl/crypto/evp/legacy_md5_sha1.c
+++ b/deps/openssl/openssl/crypto/evp/legacy_md5_sha1.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -16,13 +16,6 @@

 #include "crypto/evp.h"
 #include "prov/md5_sha1.h" /* diverse MD5_SHA1 macros */
-#include "legacy_meth.h"
-
-IMPLEMENT_LEGACY_EVP_MD_METH_LC(md5_sha1_int, ossl_md5_sha1)
-static int md5_sha1_int_ctrl(EVP_MD_CTX *ctx, int cmd, int mslen, void *ms)
-{
-    return ossl_md5_sha1_ctrl(EVP_MD_CTX_get0_md_data(ctx), cmd, mslen, ms);
-}

 static const EVP_MD md5_sha1_md = {
     NID_md5_sha1,
@@ -30,9 +23,7 @@ static const EVP_MD md5_sha1_md = {
     MD5_SHA1_DIGEST_LENGTH,
     0,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(md5_sha1_int_init, md5_sha1_int_update,
-        md5_sha1_int_final, md5_sha1_int_ctrl,
-        MD5_SHA1_CBLOCK),
+    MD5_SHA1_CBLOCK
 };

 const EVP_MD *EVP_md5_sha1(void)
diff --git a/deps/openssl/openssl/crypto/evp/legacy_mdc2.c b/deps/openssl/openssl/crypto/evp/legacy_mdc2.c
index 2ad432426c6..0fd7b9e0a8c 100644
--- a/deps/openssl/openssl/crypto/evp/legacy_mdc2.c
+++ b/deps/openssl/openssl/crypto/evp/legacy_mdc2.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,9 +15,6 @@

 #include <openssl/mdc2.h>
 #include "crypto/evp.h"
-#include "legacy_meth.h"
-
-IMPLEMENT_LEGACY_EVP_MD_METH(mdc2, MDC2)

 static const EVP_MD mdc2_md = {
     NID_mdc2,
@@ -25,8 +22,7 @@ static const EVP_MD mdc2_md = {
     MDC2_DIGEST_LENGTH,
     0,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(mdc2_init, mdc2_update, mdc2_final, NULL,
-        MDC2_BLOCK),
+    MDC2_BLOCK
 };

 const EVP_MD *EVP_mdc2(void)
diff --git a/deps/openssl/openssl/crypto/evp/legacy_meth.h b/deps/openssl/openssl/crypto/evp/legacy_meth.h
deleted file mode 100644
index ea1e84c7e7b..00000000000
--- a/deps/openssl/openssl/crypto/evp/legacy_meth.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#define IMPLEMENT_LEGACY_EVP_MD_METH(nm, fn)                                \
-    static int nm##_init(EVP_MD_CTX *ctx)                                   \
-    {                                                                       \
-        return fn##_Init(EVP_MD_CTX_get0_md_data(ctx));                     \
-    }                                                                       \
-    static int nm##_update(EVP_MD_CTX *ctx, const void *data, size_t count) \
-    {                                                                       \
-        return fn##_Update(EVP_MD_CTX_get0_md_data(ctx), data, count);      \
-    }                                                                       \
-    static int nm##_final(EVP_MD_CTX *ctx, unsigned char *md)               \
-    {                                                                       \
-        return fn##_Final(md, EVP_MD_CTX_get0_md_data(ctx));                \
-    }
-
-#define IMPLEMENT_LEGACY_EVP_MD_METH_LC(nm, fn)                             \
-    static int nm##_init(EVP_MD_CTX *ctx)                                   \
-    {                                                                       \
-        return fn##_init(EVP_MD_CTX_get0_md_data(ctx));                     \
-    }                                                                       \
-    static int nm##_update(EVP_MD_CTX *ctx, const void *data, size_t count) \
-    {                                                                       \
-        return fn##_update(EVP_MD_CTX_get0_md_data(ctx), data, count);      \
-    }                                                                       \
-    static int nm##_final(EVP_MD_CTX *ctx, unsigned char *md)               \
-    {                                                                       \
-        return fn##_final(md, EVP_MD_CTX_get0_md_data(ctx));                \
-    }
-
-#define LEGACY_EVP_MD_METH_TABLE(init, update, final, ctrl, blksz) \
-    init, update, final, NULL, NULL, blksz, 0, ctrl
diff --git a/deps/openssl/openssl/crypto/evp/legacy_ripemd.c b/deps/openssl/openssl/crypto/evp/legacy_ripemd.c
index 80f551a97d5..d28e8a0dc98 100644
--- a/deps/openssl/openssl/crypto/evp/legacy_ripemd.c
+++ b/deps/openssl/openssl/crypto/evp/legacy_ripemd.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,9 +15,6 @@

 #include <openssl/ripemd.h>
 #include "crypto/evp.h"
-#include "legacy_meth.h"
-
-IMPLEMENT_LEGACY_EVP_MD_METH(ripe, RIPEMD160)

 static const EVP_MD ripemd160_md = {
     NID_ripemd160,
@@ -25,8 +22,7 @@ static const EVP_MD ripemd160_md = {
     RIPEMD160_DIGEST_LENGTH,
     0,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(ripe_init, ripe_update, ripe_final, NULL,
-        RIPEMD160_CBLOCK),
+    RIPEMD160_CBLOCK
 };

 const EVP_MD *EVP_ripemd160(void)
diff --git a/deps/openssl/openssl/crypto/evp/legacy_sha.c b/deps/openssl/openssl/crypto/evp/legacy_sha.c
index 0c1a74de30a..77d63cf8cd7 100644
--- a/deps/openssl/openssl/crypto/evp/legacy_sha.c
+++ b/deps/openssl/openssl/crypto/evp/legacy_sha.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -16,76 +16,6 @@
 #include <openssl/sha.h> /* diverse SHA macros */
 #include "internal/sha3.h" /* KECCAK1600_WIDTH */
 #include "crypto/evp.h"
-/* Used by legacy methods */
-#include "crypto/sha.h"
-#include "legacy_meth.h"
-#include "evp_local.h"
-
-/*-
- * LEGACY methods for SHA.
- * These only remain to support engines that can get these methods.
- * Hardware support for SHA3 has been removed from these legacy cases.
- */
-#define IMPLEMENT_LEGACY_EVP_MD_METH_SHA3(nm, fn, tag)                                 \
-    static int nm##_init(EVP_MD_CTX *ctx)                                              \
-    {                                                                                  \
-        return fn##_init(EVP_MD_CTX_get0_md_data(ctx), tag, ctx->digest->md_size * 8); \
-    }                                                                                  \
-    static int nm##_update(EVP_MD_CTX *ctx, const void *data, size_t count)            \
-    {                                                                                  \
-        return fn##_update(EVP_MD_CTX_get0_md_data(ctx), data, count);                 \
-    }                                                                                  \
-    static int nm##_final(EVP_MD_CTX *ctx, unsigned char *md)                          \
-    {                                                                                  \
-        KECCAK1600_CTX *kctx = EVP_MD_CTX_get0_md_data(ctx);                           \
-        return fn##_final(kctx, md, kctx->md_size);                                    \
-    }
-#define IMPLEMENT_LEGACY_EVP_MD_METH_SHAKE(nm, fn, tag)                                \
-    static int nm##_init(EVP_MD_CTX *ctx)                                              \
-    {                                                                                  \
-        return fn##_init(EVP_MD_CTX_get0_md_data(ctx), tag, ctx->digest->md_size * 8); \
-    }
-
-#define sha512_224_Init sha512_224_init
-#define sha512_256_Init sha512_256_init
-
-#define sha512_224_Update SHA512_Update
-#define sha512_224_Final SHA512_Final
-#define sha512_256_Update SHA512_Update
-#define sha512_256_Final SHA512_Final
-
-IMPLEMENT_LEGACY_EVP_MD_METH(sha1, SHA1)
-IMPLEMENT_LEGACY_EVP_MD_METH(sha224, SHA224)
-IMPLEMENT_LEGACY_EVP_MD_METH(sha256, SHA256)
-IMPLEMENT_LEGACY_EVP_MD_METH(sha384, SHA384)
-IMPLEMENT_LEGACY_EVP_MD_METH(sha512, SHA512)
-IMPLEMENT_LEGACY_EVP_MD_METH(sha512_224_int, sha512_224)
-IMPLEMENT_LEGACY_EVP_MD_METH(sha512_256_int, sha512_256)
-IMPLEMENT_LEGACY_EVP_MD_METH_SHA3(sha3_int, ossl_sha3, '\x06')
-IMPLEMENT_LEGACY_EVP_MD_METH_SHAKE(shake, ossl_sha3, '\x1f')
-
-static int sha1_int_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)
-{
-    return ossl_sha1_ctrl(ctx != NULL ? EVP_MD_CTX_get0_md_data(ctx) : NULL,
-        cmd, p1, p2);
-}
-
-static int shake_ctrl(EVP_MD_CTX *evp_ctx, int cmd, int p1, void *p2)
-{
-    KECCAK1600_CTX *ctx;
-
-    if (evp_ctx == NULL)
-        return 0;
-    ctx = evp_ctx->md_data;
-
-    switch (cmd) {
-    case EVP_MD_CTRL_XOF_LEN:
-        ctx->md_size = p1;
-        return 1;
-    default:
-        return 0;
-    }
-}

 static const EVP_MD sha1_md = {
     NID_sha1,
@@ -93,8 +23,7 @@ static const EVP_MD sha1_md = {
     SHA_DIGEST_LENGTH,
     EVP_MD_FLAG_DIGALGID_ABSENT,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(sha1_init, sha1_update, sha1_final, sha1_int_ctrl,
-        SHA_CBLOCK),
+    SHA_CBLOCK
 };

 const EVP_MD *EVP_sha1(void)
@@ -108,8 +37,7 @@ static const EVP_MD sha224_md = {
     SHA224_DIGEST_LENGTH,
     EVP_MD_FLAG_DIGALGID_ABSENT,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(sha224_init, sha224_update, sha224_final, NULL,
-        SHA256_CBLOCK),
+    SHA256_CBLOCK
 };

 const EVP_MD *EVP_sha224(void)
@@ -123,8 +51,7 @@ static const EVP_MD sha256_md = {
     SHA256_DIGEST_LENGTH,
     EVP_MD_FLAG_DIGALGID_ABSENT,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(sha256_init, sha256_update, sha256_final, NULL,
-        SHA256_CBLOCK),
+    SHA256_CBLOCK
 };

 const EVP_MD *EVP_sha256(void)
@@ -138,8 +65,7 @@ static const EVP_MD sha512_224_md = {
     SHA224_DIGEST_LENGTH,
     EVP_MD_FLAG_DIGALGID_ABSENT,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(sha512_224_int_init, sha512_224_int_update,
-        sha512_224_int_final, NULL, SHA512_CBLOCK),
+    SHA512_CBLOCK
 };

 const EVP_MD *EVP_sha512_224(void)
@@ -153,8 +79,7 @@ static const EVP_MD sha512_256_md = {
     SHA256_DIGEST_LENGTH,
     EVP_MD_FLAG_DIGALGID_ABSENT,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(sha512_256_int_init, sha512_256_int_update,
-        sha512_256_int_final, NULL, SHA512_CBLOCK),
+    SHA512_CBLOCK
 };

 const EVP_MD *EVP_sha512_256(void)
@@ -168,8 +93,7 @@ static const EVP_MD sha384_md = {
     SHA384_DIGEST_LENGTH,
     EVP_MD_FLAG_DIGALGID_ABSENT,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(sha384_init, sha384_update, sha384_final, NULL,
-        SHA512_CBLOCK),
+    SHA512_CBLOCK
 };

 const EVP_MD *EVP_sha384(void)
@@ -183,8 +107,7 @@ static const EVP_MD sha512_md = {
     SHA512_DIGEST_LENGTH,
     EVP_MD_FLAG_DIGALGID_ABSENT,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(sha512_init, sha512_update, sha512_final, NULL,
-        SHA512_CBLOCK),
+    SHA512_CBLOCK
 };

 const EVP_MD *EVP_sha512(void)
@@ -192,34 +115,31 @@ const EVP_MD *EVP_sha512(void)
     return &sha512_md;
 }

-#define EVP_MD_SHA3(bitlen)                                          \
-    const EVP_MD *EVP_sha3_##bitlen(void)                            \
-    {                                                                \
-        static const EVP_MD sha3_##bitlen##_md = {                   \
-            NID_sha3_##bitlen,                                       \
-            NID_RSA_SHA3_##bitlen,                                   \
-            bitlen / 8,                                              \
-            EVP_MD_FLAG_DIGALGID_ABSENT,                             \
-            EVP_ORIG_GLOBAL,                                         \
-            LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update, \
-                sha3_int_final, NULL,                                \
-                (KECCAK1600_WIDTH - bitlen * 2) / 8),                \
-        };                                                           \
-        return &sha3_##bitlen##_md;                                  \
+#define EVP_MD_SHA3(bitlen)                        \
+    const EVP_MD *EVP_sha3_##bitlen(void)          \
+    {                                              \
+        static const EVP_MD sha3_##bitlen##_md = { \
+            NID_sha3_##bitlen,                     \
+            NID_RSA_SHA3_##bitlen,                 \
+            bitlen / 8,                            \
+            EVP_MD_FLAG_DIGALGID_ABSENT,           \
+            EVP_ORIG_GLOBAL,                       \
+            (KECCAK1600_WIDTH - bitlen * 2) / 8    \
+        };                                         \
+        return &sha3_##bitlen##_md;                \
     }
-#define EVP_MD_SHAKE(bitlen)                                                      \
-    const EVP_MD *EVP_shake##bitlen(void)                                         \
-    {                                                                             \
-        static const EVP_MD shake##bitlen##_md = {                                \
-            NID_shake##bitlen,                                                    \
-            0,                                                                    \
-            bitlen / 8,                                                           \
-            EVP_MD_FLAG_XOF | EVP_MD_FLAG_DIGALGID_ABSENT,                        \
-            EVP_ORIG_GLOBAL,                                                      \
-            LEGACY_EVP_MD_METH_TABLE(shake_init, sha3_int_update, sha3_int_final, \
-                shake_ctrl, (KECCAK1600_WIDTH - bitlen * 2) / 8),                 \
-        };                                                                        \
-        return &shake##bitlen##_md;                                               \
+#define EVP_MD_SHAKE(bitlen)                               \
+    const EVP_MD *EVP_shake##bitlen(void)                  \
+    {                                                      \
+        static const EVP_MD shake##bitlen##_md = {         \
+            NID_shake##bitlen,                             \
+            0,                                             \
+            bitlen / 8,                                    \
+            EVP_MD_FLAG_XOF | EVP_MD_FLAG_DIGALGID_ABSENT, \
+            EVP_ORIG_GLOBAL,                               \
+            (KECCAK1600_WIDTH - bitlen * 2) / 8            \
+        };                                                 \
+        return &shake##bitlen##_md;                        \
     }

 EVP_MD_SHA3(224)
diff --git a/deps/openssl/openssl/crypto/evp/legacy_wp.c b/deps/openssl/openssl/crypto/evp/legacy_wp.c
index 21865e63508..15aeee78b65 100644
--- a/deps/openssl/openssl/crypto/evp/legacy_wp.c
+++ b/deps/openssl/openssl/crypto/evp/legacy_wp.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,9 +15,6 @@

 #include <openssl/whrlpool.h>
 #include "crypto/evp.h"
-#include "legacy_meth.h"
-
-IMPLEMENT_LEGACY_EVP_MD_METH(wp, WHIRLPOOL)

 static const EVP_MD whirlpool_md = {
     NID_whirlpool,
@@ -25,8 +22,7 @@ static const EVP_MD whirlpool_md = {
     WHIRLPOOL_DIGEST_LENGTH,
     0,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(wp_init, wp_update, wp_final, NULL,
-        WHIRLPOOL_BBLOCK / 8),
+    WHIRLPOOL_BBLOCK / 8
 };

 const EVP_MD *EVP_whirlpool(void)
diff --git a/deps/openssl/openssl/crypto/evp/m_null.c b/deps/openssl/openssl/crypto/evp/m_null.c
index 7b310d70477..642fe9ec1e8 100644
--- a/deps/openssl/openssl/crypto/evp/m_null.c
+++ b/deps/openssl/openssl/crypto/evp/m_null.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,41 +7,14 @@
  * https://www.openssl.org/source/license.html
  */

-#include <stdio.h>
-#include "internal/cryptlib.h"
-#include <openssl/evp.h>
-#include <openssl/objects.h>
-#include <openssl/x509.h>
 #include "crypto/evp.h"

-static int init(EVP_MD_CTX *ctx)
-{
-    return 1;
-}
-
-static int update(EVP_MD_CTX *ctx, const void *data, size_t count)
-{
-    return 1;
-}
-
-static int final(EVP_MD_CTX *ctx, unsigned char *md)
-{
-    return 1;
-}
-
 static const EVP_MD null_md = {
     NID_undef,
     NID_undef,
     0,
     0,
-    EVP_ORIG_GLOBAL,
-    init,
-    update,
-    final,
-    NULL,
-    NULL,
-    0,
-    sizeof(EVP_MD *),
+    EVP_ORIG_GLOBAL
 };

 const EVP_MD *EVP_md_null(void)
diff --git a/deps/openssl/openssl/crypto/evp/m_sigver.c b/deps/openssl/openssl/crypto/evp/m_sigver.c
index 01f7e923932..a79d6568049 100644
--- a/deps/openssl/openssl/crypto/evp/m_sigver.c
+++ b/deps/openssl/openssl/crypto/evp/m_sigver.c
@@ -14,14 +14,9 @@
 #include "crypto/evp.h"
 #include "internal/provider.h"
 #include "internal/numbers.h" /* includes SIZE_MAX */
+#include "internal/common.h"
 #include "evp_local.h"

-static int update(EVP_MD_CTX *ctx, const void *data, size_t datalen)
-{
-    ERR_raise(ERR_LIB_EVP, EVP_R_ONLY_ONESHOT_SUPPORTED);
-    return 0;
-}
-
 /*
  * If we get the "NULL" md then the name comes back as "UNDEF". We want to use
  * NULL for this.
@@ -37,7 +32,7 @@ static const char *canon_mdname(const char *mdname)
 static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
     const EVP_MD *type, const char *mdname,
     OSSL_LIB_CTX *libctx, const char *props,
-    ENGINE *e, EVP_PKEY *pkey, int ver,
+    EVP_PKEY *pkey, int ver,
     const OSSL_PARAM params[])
 {
     EVP_PKEY_CTX *locpctx = NULL;
@@ -55,10 +50,7 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,

     if (ctx->pctx == NULL) {
         reinit = 0;
-        if (e == NULL)
-            ctx->pctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, props);
-        else
-            ctx->pctx = EVP_PKEY_CTX_new(pkey, e);
+        ctx->pctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, props);
     }
     if (ctx->pctx == NULL)
         return 0;
@@ -69,7 +61,7 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
     ERR_set_mark();

     if (evp_pkey_ctx_is_legacy(locpctx))
-        goto legacy;
+        goto notsupported;

     /* do not reinitialize if pkey is set or operation is different */
     if (reinit
@@ -155,7 +147,7 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
             signature = evp_signature_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
                 supported_sig, locpctx->propquery);
             if (signature == NULL)
-                goto legacy;
+                goto notsupported;
             break;
         }
         if (signature == NULL)
@@ -227,8 +219,6 @@ reinitialize:
              */
             evp_md_ctx_clear_digest(ctx, 1, 0);

-            /* legacy code support for engines */
-            ERR_set_mark();
             /*
              * This might be requested by a later call to EVP_MD_CTX_get0_md().
              * In that case the "explicit fetch" rules apply for that
@@ -239,16 +229,11 @@ reinitialize:
             ctx->fetched_digest = EVP_MD_fetch(locpctx->libctx, mdname, props);
             if (ctx->fetched_digest != NULL) {
                 ctx->digest = ctx->reqdigest = ctx->fetched_digest;
-            } else {
-                /* legacy engine support : remove the mark when this is deleted */
-                ctx->reqdigest = ctx->digest = EVP_get_digestbyname(mdname);
                 if (ctx->digest == NULL) {
-                    (void)ERR_clear_last_mark();
                     ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
                     goto err;
                 }
             }
-            (void)ERR_pop_to_mark();
         }
     }

@@ -275,8 +260,13 @@ reinitialize:
      * If the operation was not a success and no digest was found, an error
      * needs to be raised.
      */
-    if (ret > 0 || mdname != NULL)
-        goto end;
+    if (ret > 0 || mdname != NULL) {
+        if (ret > 0)
+            ret = evp_pkey_ctx_use_cached_data(locpctx);
+
+        EVP_KEYMGMT_free(tmp_keymgmt);
+        return ret > 0 ? 1 : 0;
+    }
     if (type == NULL) /* This check is redundant but clarifies matters */
         ERR_raise(ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST);
     ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
@@ -289,83 +279,14 @@ err:
     EVP_KEYMGMT_free(tmp_keymgmt);
     return 0;

-legacy:
-    /*
-     * If we don't have the full support we need with provided methods,
-     * let's go see if legacy does.
-     */
+notsupported:
     ERR_pop_to_mark();
     EVP_KEYMGMT_free(tmp_keymgmt);
-    tmp_keymgmt = NULL;
-
-    if (type == NULL && mdname != NULL)
-        type = evp_get_digestbyname_ex(locpctx->libctx, mdname);
-
-    if (ctx->pctx->pmeth == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
-        return 0;
-    }
-
-    if (!(ctx->pctx->pmeth->flags & EVP_PKEY_FLAG_SIGCTX_CUSTOM)) {
-
-        if (type == NULL) {
-            int def_nid;
-            if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) > 0)
-                type = EVP_get_digestbynid(def_nid);
-        }
-
-        if (type == NULL) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST);
-            return 0;
-        }
-    }
-
-    if (ver) {
-        if (ctx->pctx->pmeth->verifyctx_init) {
-            if (ctx->pctx->pmeth->verifyctx_init(ctx->pctx, ctx) <= 0)
-                return 0;
-            ctx->pctx->operation = EVP_PKEY_OP_VERIFYCTX;
-        } else if (ctx->pctx->pmeth->digestverify != 0) {
-            ctx->pctx->operation = EVP_PKEY_OP_VERIFY;
-            ctx->update = update;
-        } else if (EVP_PKEY_verify_init(ctx->pctx) <= 0) {
-            return 0;
-        }
-    } else {
-        if (ctx->pctx->pmeth->signctx_init) {
-            if (ctx->pctx->pmeth->signctx_init(ctx->pctx, ctx) <= 0)
-                return 0;
-            ctx->pctx->operation = EVP_PKEY_OP_SIGNCTX;
-        } else if (ctx->pctx->pmeth->digestsign != 0) {
-            ctx->pctx->operation = EVP_PKEY_OP_SIGN;
-            ctx->update = update;
-        } else if (EVP_PKEY_sign_init(ctx->pctx) <= 0) {
-            return 0;
-        }
-    }
-    if (EVP_PKEY_CTX_set_signature_md(ctx->pctx, type) <= 0)
-        return 0;
-    if (pctx)
-        *pctx = ctx->pctx;
-    if (ctx->pctx->pmeth->flags & EVP_PKEY_FLAG_SIGCTX_CUSTOM)
-        return 1;
-    if (!EVP_DigestInit_ex(ctx, type, e))
-        return 0;
-    /*
-     * This indicates the current algorithm requires
-     * special treatment before hashing the tbs-message.
-     */
-    ctx->pctx->flag_call_digest_custom = 0;
-    if (ctx->pctx->pmeth->digest_custom != NULL)
-        ctx->pctx->flag_call_digest_custom = 1;
-
-    ret = 1;
-end:
-    if (ret > 0)
-        ret = evp_pkey_ctx_use_cached_data(locpctx);

-    EVP_KEYMGMT_free(tmp_keymgmt);
-    return ret > 0 ? 1 : 0;
+    ERR_raise_data(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE,
+        ver ? "%s digest_verify_init" : "%s digest_sign_init",
+        EVP_PKEY_get0_type_name(locpctx->pkey));
+    return 0;
 }

 int EVP_DigestSignInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
@@ -373,14 +294,16 @@ int EVP_DigestSignInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
     const char *props, EVP_PKEY *pkey,
     const OSSL_PARAM params[])
 {
-    return do_sigver_init(ctx, pctx, NULL, mdname, libctx, props, NULL, pkey, 0,
+    return do_sigver_init(ctx, pctx, NULL, mdname, libctx, props, pkey, 0,
         params);
 }

 int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
     const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey)
 {
-    return do_sigver_init(ctx, pctx, type, NULL, NULL, NULL, e, pkey, 0,
+    if (!ossl_assert(e == NULL))
+        return 0;
+    return do_sigver_init(ctx, pctx, type, NULL, NULL, NULL, pkey, 0,
         NULL);
 }

@@ -389,14 +312,16 @@ int EVP_DigestVerifyInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
     const char *props, EVP_PKEY *pkey,
     const OSSL_PARAM params[])
 {
-    return do_sigver_init(ctx, pctx, NULL, mdname, libctx, props, NULL, pkey, 1,
+    return do_sigver_init(ctx, pctx, NULL, mdname, libctx, props, pkey, 1,
         params);
 }

 int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
     const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey)
 {
-    return do_sigver_init(ctx, pctx, type, NULL, NULL, NULL, e, pkey, 1,
+    if (!ossl_assert(e == NULL))
+        return 0;
+    return do_sigver_init(ctx, pctx, type, NULL, NULL, NULL, pkey, 1,
         NULL);
 }

@@ -412,11 +337,15 @@ int EVP_DigestSignUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize)
         return 0;
     }

-    if (pctx == NULL
-        || pctx->operation != EVP_PKEY_OP_SIGNCTX
+    if (pctx == NULL)
+        return EVP_DigestUpdate(ctx, data, dsize);
+
+    if (pctx->operation != EVP_PKEY_OP_SIGNCTX
         || pctx->op.sig.algctx == NULL
-        || pctx->op.sig.signature == NULL)
-        goto legacy;
+        || pctx->op.sig.signature == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
+        return 0;
+    }

     signature = pctx->op.sig.signature;
     desc = signature->description != NULL ? signature->description : "";
@@ -433,17 +362,6 @@ int EVP_DigestSignUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize)
             "%s digest_sign_update:%s", signature->type_name, desc);
     ERR_clear_last_mark();
     return ret;
-
-legacy:
-    if (pctx != NULL) {
-        /* do_sigver_init() checked that |digest_custom| is non-NULL */
-        if (pctx->flag_call_digest_custom
-            && !ctx->pctx->pmeth->digest_custom(ctx->pctx, ctx))
-            return 0;
-        pctx->flag_call_digest_custom = 0;
-    }
-
-    return EVP_DigestUpdate(ctx, data, dsize);
 }

 int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize)
@@ -462,7 +380,7 @@ int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize)
         || pctx->operation != EVP_PKEY_OP_VERIFYCTX
         || pctx->op.sig.algctx == NULL
         || pctx->op.sig.signature == NULL)
-        goto legacy;
+        return EVP_DigestUpdate(ctx, data, dsize);

     signature = pctx->op.sig.signature;
     desc = signature->description != NULL ? signature->description : "";
@@ -479,17 +397,6 @@ int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize)
             "%s digest_verify_update:%s", signature->type_name, desc);
     ERR_clear_last_mark();
     return ret;
-
-legacy:
-    if (pctx != NULL) {
-        /* do_sigver_init() checked that |digest_custom| is non-NULL */
-        if (pctx->flag_call_digest_custom
-            && !ctx->pctx->pmeth->digest_custom(ctx->pctx, ctx))
-            return 0;
-        pctx->flag_call_digest_custom = 0;
-    }
-
-    return EVP_DigestUpdate(ctx, data, dsize);
 }

 int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
@@ -497,7 +404,6 @@ int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
 {
     EVP_SIGNATURE *signature;
     const char *desc;
-    int sctx = 0;
     int r = 0;
     EVP_PKEY_CTX *dctx = NULL, *pctx = ctx->pctx;

@@ -509,8 +415,10 @@ int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
     if (pctx == NULL
         || pctx->operation != EVP_PKEY_OP_SIGNCTX
         || pctx->op.sig.algctx == NULL
-        || pctx->op.sig.signature == NULL)
-        goto legacy;
+        || pctx->op.sig.signature == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
+        return 0;
+    }

     signature = pctx->op.sig.signature;
     desc = signature->description != NULL ? signature->description : "";
@@ -539,79 +447,6 @@ int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
     else
         EVP_PKEY_CTX_free(dctx);
     return r;
-
-legacy:
-    if (pctx == NULL || pctx->pmeth == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
-        return 0;
-    }
-
-    /* do_sigver_init() checked that |digest_custom| is non-NULL */
-    if (pctx->flag_call_digest_custom
-        && !ctx->pctx->pmeth->digest_custom(ctx->pctx, ctx))
-        return 0;
-    pctx->flag_call_digest_custom = 0;
-
-    if (pctx->pmeth->flags & EVP_PKEY_FLAG_SIGCTX_CUSTOM) {
-        if (sigret == NULL)
-            return pctx->pmeth->signctx(pctx, sigret, siglen, ctx);
-        if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISE) != 0) {
-            r = pctx->pmeth->signctx(pctx, sigret, siglen, ctx);
-            ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
-        } else {
-            dctx = EVP_PKEY_CTX_dup(pctx);
-            if (dctx == NULL)
-                return 0;
-            r = dctx->pmeth->signctx(dctx, sigret, siglen, ctx);
-            EVP_PKEY_CTX_free(dctx);
-        }
-        return r;
-    }
-    if (pctx->pmeth->signctx != NULL)
-        sctx = 1;
-    else
-        sctx = 0;
-    if (sigret != NULL) {
-        unsigned char md[EVP_MAX_MD_SIZE];
-        unsigned int mdlen = 0;
-
-        if (ctx->flags & EVP_MD_CTX_FLAG_FINALISE) {
-            if (sctx)
-                r = pctx->pmeth->signctx(pctx, sigret, siglen, ctx);
-            else
-                r = EVP_DigestFinal_ex(ctx, md, &mdlen);
-        } else {
-            EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
-
-            if (tmp_ctx == NULL)
-                return 0;
-            if (!EVP_MD_CTX_copy_ex(tmp_ctx, ctx)) {
-                EVP_MD_CTX_free(tmp_ctx);
-                return 0;
-            }
-            if (sctx)
-                r = tmp_ctx->pctx->pmeth->signctx(tmp_ctx->pctx,
-                    sigret, siglen, tmp_ctx);
-            else
-                r = EVP_DigestFinal_ex(tmp_ctx, md, &mdlen);
-            EVP_MD_CTX_free(tmp_ctx);
-        }
-        if (sctx || !r)
-            return r;
-        if (EVP_PKEY_sign(pctx, sigret, siglen, md, mdlen) <= 0)
-            return 0;
-    } else {
-        if (sctx) {
-            if (pctx->pmeth->signctx(pctx, sigret, siglen, ctx) <= 0)
-                return 0;
-        } else {
-            int s = EVP_MD_get_size(ctx->digest);
-
-            if (s <= 0 || EVP_PKEY_sign(pctx, sigret, siglen, NULL, s) <= 0)
-                return 0;
-        }
-    }
-    return 1;
 }

 int EVP_DigestSign(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen,
@@ -649,10 +484,6 @@ int EVP_DigestSign(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen,
             ERR_clear_last_mark();
             return ret;
         }
-    } else {
-        /* legacy */
-        if (pctx->pmeth != NULL && pctx->pmeth->digestsign != NULL)
-            return pctx->pmeth->digestsign(ctx, sigret, siglen, tbs, tbslen);
     }

     if (sigret != NULL && EVP_DigestSignUpdate(ctx, tbs, tbslen) <= 0)
@@ -665,9 +496,6 @@ int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig,
 {
     EVP_SIGNATURE *signature;
     const char *desc;
-    int vctx = 0;
-    unsigned int mdlen = 0;
-    unsigned char md[EVP_MAX_MD_SIZE];
     int r = 0;
     EVP_PKEY_CTX *dctx = NULL, *pctx = ctx->pctx;

@@ -679,8 +507,10 @@ int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig,
     if (pctx == NULL
         || pctx->operation != EVP_PKEY_OP_VERIFYCTX
         || pctx->op.sig.algctx == NULL
-        || pctx->op.sig.signature == NULL)
-        goto legacy;
+        || pctx->op.sig.signature == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
+        return 0;
+    }

     signature = pctx->op.sig.signature;
     desc = signature->description != NULL ? signature->description : "";
@@ -708,47 +538,6 @@ int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig,
     else
         EVP_PKEY_CTX_free(dctx);
     return r;
-
-legacy:
-    if (pctx == NULL || pctx->pmeth == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
-        return 0;
-    }
-
-    /* do_sigver_init() checked that |digest_custom| is non-NULL */
-    if (pctx->flag_call_digest_custom
-        && !ctx->pctx->pmeth->digest_custom(ctx->pctx, ctx))
-        return 0;
-    pctx->flag_call_digest_custom = 0;
-
-    if (pctx->pmeth->verifyctx != NULL)
-        vctx = 1;
-    else
-        vctx = 0;
-    if (ctx->flags & EVP_MD_CTX_FLAG_FINALISE) {
-        if (vctx) {
-            r = pctx->pmeth->verifyctx(pctx, sig, siglen, ctx);
-            ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
-        } else
-            r = EVP_DigestFinal_ex(ctx, md, &mdlen);
-    } else {
-        EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
-        if (tmp_ctx == NULL)
-            return -1;
-        if (!EVP_MD_CTX_copy_ex(tmp_ctx, ctx)) {
-            EVP_MD_CTX_free(tmp_ctx);
-            return -1;
-        }
-        if (vctx)
-            r = tmp_ctx->pctx->pmeth->verifyctx(tmp_ctx->pctx,
-                sig, siglen, tmp_ctx);
-        else
-            r = EVP_DigestFinal_ex(tmp_ctx, md, &mdlen);
-        EVP_MD_CTX_free(tmp_ctx);
-    }
-    if (vctx || !r)
-        return r;
-    return EVP_PKEY_verify(pctx, sig, siglen, md, mdlen);
 }

 int EVP_DigestVerify(EVP_MD_CTX *ctx, const unsigned char *sigret,
@@ -783,11 +572,8 @@ int EVP_DigestVerify(EVP_MD_CTX *ctx, const unsigned char *sigret,
             ERR_clear_last_mark();
             return ret;
         }
-    } else {
-        /* legacy */
-        if (pctx->pmeth != NULL && pctx->pmeth->digestverify != NULL)
-            return pctx->pmeth->digestverify(ctx, sigret, siglen, tbs, tbslen);
     }
+
     if (EVP_DigestVerifyUpdate(ctx, tbs, tbslen) <= 0)
         return -1;
     return EVP_DigestVerifyFinal(ctx, sigret, siglen);
diff --git a/deps/openssl/openssl/crypto/evp/mac_lib.c b/deps/openssl/openssl/crypto/evp/mac_lib.c
index a3c7fbb4b53..404141dc11c 100644
--- a/deps/openssl/openssl/crypto/evp/mac_lib.c
+++ b/deps/openssl/openssl/crypto/evp/mac_lib.c
@@ -259,7 +259,8 @@ unsigned char *EVP_Q_mac(OSSL_LIB_CTX *libctx,
     unsigned char *out, size_t outsize, size_t *outlen)
 {
     EVP_MAC *mac = EVP_MAC_fetch(libctx, name, propq);
-    OSSL_PARAM subalg_param[] = { OSSL_PARAM_END, OSSL_PARAM_END };
+    OSSL_PARAM subalg_param[3];
+    OSSL_PARAM *p = subalg_param;
     EVP_MAC_CTX *ctx = NULL;
     size_t len = 0;
     unsigned char *res = NULL;
@@ -284,8 +285,26 @@ unsigned char *EVP_Q_mac(OSSL_LIB_CTX *libctx,
                 goto err;
             }
         }
-        subalg_param[0] = OSSL_PARAM_construct_utf8_string(param_name, (char *)subalg, 0);
+        *p++ = OSSL_PARAM_construct_utf8_string(param_name, (char *)subalg, 0);
     }
+
+    /*
+     * If we passed in a property query, make sure the underlying algorithm uses it.
+     * Compound algorithms may fetch other underlying algorithms (i.e. a MAC algorithm
+     * may use a digest algorithm as part of its internal work), and the MAC decides which
+     * implementation of the underlying digest to use based on the
+     * OSSL_ALG_PARAM_PROPERTIES parameter, rather than the propq value passed in the
+     * EVP_MAC_fetch call above.
+     * If we don't set this parameter, then the MAC alg may use the default provider
+     * to allocate an underlying digest, rather than the one that we would have gotten
+     * by using the propq value here.
+     */
+    if (propq != NULL)
+        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_ALG_PARAM_PROPERTIES,
+            (char *)propq, 0);
+
+    *p = OSSL_PARAM_construct_end();
+
     /* Single-shot - on NULL key input, set dummy key value for EVP_MAC_Init. */
     if (key == NULL && keylen == 0)
         key = data;
diff --git a/deps/openssl/openssl/crypto/evp/mac_meth.c b/deps/openssl/openssl/crypto/evp/mac_meth.c
index ee29f58b3e2..fb6f3f0b8f6 100644
--- a/deps/openssl/openssl/crypto/evp/mac_meth.c
+++ b/deps/openssl/openssl/crypto/evp/mac_meth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -21,8 +21,7 @@ static int evp_mac_up_ref(void *vmac)
     EVP_MAC *mac = vmac;
     int ref = 0;

-    CRYPTO_UP_REF(&mac->refcnt, &ref);
-    return 1;
+    return CRYPTO_UP_REF(&mac->refcnt, &ref);
 }

 static void evp_mac_free(void *vmac)
@@ -56,7 +55,7 @@ static void *evp_mac_new(void)

 static void *evp_mac_from_algorithm(int name_id,
     const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov)
+    OSSL_PROVIDER *prov, int no_store)
 {
     const OSSL_DISPATCH *fns = algodef->implementation;
     EVP_MAC *mac = NULL;
@@ -67,6 +66,7 @@ static void *evp_mac_from_algorithm(int name_id,
         goto err;
     }
     mac->name_id = name_id;
+    mac->no_store = no_store;

     if ((mac->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
         goto err;
@@ -182,12 +182,23 @@ EVP_MAC *EVP_MAC_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,

 int EVP_MAC_up_ref(EVP_MAC *mac)
 {
+#ifdef OPENSSL_NO_CACHED_FETCH
     return evp_mac_up_ref(mac);
+#else
+    if (mac->no_store != 0)
+        return evp_mac_up_ref(mac);
+    return 1;
+#endif
 }

 void EVP_MAC_free(EVP_MAC *mac)
 {
+#ifdef OPENSSL_NO_CACHED_FETCH
     evp_mac_free(mac);
+#else
+    if (mac != NULL && (mac->no_store != 0))
+        evp_mac_free(mac);
+#endif
 }

 const OSSL_PROVIDER *EVP_MAC_get0_provider(const EVP_MAC *mac)
@@ -246,8 +257,12 @@ void EVP_MAC_do_all_provided(OSSL_LIB_CTX *libctx,
     void (*fn)(EVP_MAC *mac, void *arg),
     void *arg)
 {
+    struct EVP_MAC_do_all_provided_thunk t;
+
+    t.fn = fn;
+    t.arg = arg;
     evp_generic_do_all(libctx, OSSL_OP_MAC,
-        (void (*)(void *, void *))fn, arg,
+        EVP_MAC_do_all_provided_thunk, &t,
         evp_mac_from_algorithm, evp_mac_up_ref, evp_mac_free);
 }

diff --git a/deps/openssl/openssl/crypto/evp/names.c b/deps/openssl/openssl/crypto/evp/names.c
index 01297325421..81029feb87a 100644
--- a/deps/openssl/openssl/crypto/evp/names.c
+++ b/deps/openssl/openssl/crypto/evp/names.c
@@ -190,8 +190,6 @@ void evp_cleanup_int(void)

     EVP_PBE_cleanup();
     OBJ_sigid_free();
-
-    evp_app_cleanup_int();
 }

 struct doall_cipher {
diff --git a/deps/openssl/openssl/crypto/evp/p5_crpt.c b/deps/openssl/openssl/crypto/evp/p5_crpt.c
index 0a301104e0f..1fc24fcd52d 100644
--- a/deps/openssl/openssl/crypto/evp/p5_crpt.c
+++ b/deps/openssl/openssl/crypto/evp/p5_crpt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,6 +15,8 @@
 #include <openssl/core_names.h>
 #include <openssl/kdf.h>

+#include <crypto/asn1.h>
+
 /*
  * Doesn't do anything now: Builtin PBE algorithms in static table.
  */
@@ -74,7 +76,7 @@ int PKCS5_PBE_keyivgen_ex(EVP_CIPHER_CTX *cctx, const char *pass, int passlen,
     if (pass == NULL)
         passlen = 0;
     else if (passlen == -1)
-        passlen = strlen(pass);
+        passlen = (int)strlen(pass);

     mdsize = EVP_MD_get_size(md);
     if (mdsize <= 0)
diff --git a/deps/openssl/openssl/crypto/evp/p5_crpt2.c b/deps/openssl/openssl/crypto/evp/p5_crpt2.c
index 8003bd31afd..acffe82e51f 100644
--- a/deps/openssl/openssl/crypto/evp/p5_crpt2.c
+++ b/deps/openssl/openssl/crypto/evp/p5_crpt2.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,24 +19,26 @@
 #include "crypto/evp.h"
 #include "evp_local.h"

+#include <crypto/asn1.h>
+
 int ossl_pkcs5_pbkdf2_hmac_ex(const char *pass, int passlen,
     const unsigned char *salt, int saltlen, int iter,
     const EVP_MD *digest, int keylen, unsigned char *out,
     OSSL_LIB_CTX *libctx, const char *propq)
 {
     const char *empty = "";
-    int rv = 1, mode = 1;
+    int rv = 1;
     EVP_KDF *kdf;
     EVP_KDF_CTX *kctx;
     const char *mdname = EVP_MD_get0_name(digest);
-    OSSL_PARAM params[6], *p = params;
+    OSSL_PARAM params[5], *p = params;

     /* Keep documented behaviour. */
     if (pass == NULL) {
         pass = empty;
         passlen = 0;
     } else if (passlen == -1) {
-        passlen = strlen(pass);
+        passlen = (int)strlen(pass);
     }
     if (salt == NULL && saltlen == 0)
         salt = (unsigned char *)empty;
@@ -50,7 +52,6 @@ int ossl_pkcs5_pbkdf2_hmac_ex(const char *pass, int passlen,
         return 0;
     *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_PASSWORD,
         (char *)pass, (size_t)passlen);
-    *p++ = OSSL_PARAM_construct_int(OSSL_KDF_PARAM_PKCS5, &mode);
     *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_SALT,
         (unsigned char *)salt, saltlen);
     *p++ = OSSL_PARAM_construct_int(OSSL_KDF_PARAM_ITER, &iter);
@@ -117,8 +118,7 @@ int PKCS5_v2_PBE_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
 {
     PBE2PARAM *pbe2 = NULL;
     char ciph_name[80];
-    const EVP_CIPHER *cipher = NULL;
-    EVP_CIPHER *cipher_fetch = NULL;
+    EVP_CIPHER *cipher = NULL;
     EVP_PBE_KEYGEN_EX *kdf;

     int rv = 0;
@@ -144,11 +144,7 @@ int PKCS5_v2_PBE_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
         goto err;
     }

-    (void)ERR_set_mark();
-    cipher = cipher_fetch = EVP_CIPHER_fetch(libctx, ciph_name, propq);
-    /* Fallback to legacy method */
-    if (cipher == NULL)
-        cipher = EVP_get_cipherbyname(ciph_name);
+    cipher = EVP_CIPHER_fetch(libctx, ciph_name, propq);

     if (cipher == NULL) {
         (void)ERR_clear_last_mark();
@@ -166,7 +162,7 @@ int PKCS5_v2_PBE_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
     }
     rv = kdf(ctx, pass, passlen, pbe2->keyfunc->parameter, NULL, NULL, en_de, libctx, propq);
 err:
-    EVP_CIPHER_free(cipher_fetch);
+    EVP_CIPHER_free(cipher);
     PBE2PARAM_free(pbe2);
     return rv;
 }
@@ -189,8 +185,7 @@ int PKCS5_v2_PBKDF2_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass,
     unsigned int keylen = 0;
     int prf_nid, hmac_md_nid;
     PBKDF2PARAM *kdf = NULL;
-    const EVP_MD *prfmd = NULL;
-    EVP_MD *prfmd_fetch = NULL;
+    EVP_MD *prfmd = NULL;

     if (EVP_CIPHER_CTX_get0_cipher(ctx) == NULL) {
         ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
@@ -232,16 +227,11 @@ int PKCS5_v2_PBKDF2_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass,
         goto err;
     }

-    (void)ERR_set_mark();
-    prfmd = prfmd_fetch = EVP_MD_fetch(libctx, OBJ_nid2sn(hmac_md_nid), propq);
-    if (prfmd == NULL)
-        prfmd = EVP_get_digestbynid(hmac_md_nid);
+    prfmd = EVP_MD_fetch(libctx, OBJ_nid2sn(hmac_md_nid), propq);
     if (prfmd == NULL) {
-        (void)ERR_clear_last_mark();
         ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRF);
         goto err;
     }
-    (void)ERR_pop_to_mark();

     if (kdf->salt->type != V_ASN1_OCTET_STRING) {
         ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_SALT_TYPE);
@@ -259,7 +249,7 @@ int PKCS5_v2_PBKDF2_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass,
 err:
     OPENSSL_cleanse(key, keylen);
     PBKDF2PARAM_free(kdf);
-    EVP_MD_free(prfmd_fetch);
+    EVP_MD_free(prfmd);
     return rv;
 }

diff --git a/deps/openssl/openssl/crypto/evp/p_lib.c b/deps/openssl/openssl/crypto/evp/p_lib.c
index 412ed9fcf09..5fdcebf55ca 100644
--- a/deps/openssl/openssl/crypto/evp/p_lib.c
+++ b/deps/openssl/openssl/crypto/evp/p_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -27,13 +27,11 @@
 #include <openssl/dh.h>
 #include <openssl/ec.h>
 #include <openssl/cmac.h>
-#ifndef FIPS_MODULE
-#include <openssl/engine.h>
-#endif
 #include <openssl/params.h>
 #include <openssl/param_build.h>
 #include <openssl/encoder.h>
 #include <openssl/core_names.h>
+#include <openssl/provider.h>

 #include "internal/numbers.h" /* includes SIZE_MAX */
 #include "internal/ffc.h"
@@ -48,9 +46,10 @@
 #include "crypto/x509.h"
 #endif
 #include "internal/provider.h"
+#include "internal/common.h"
 #include "evp_local.h"

-static int pkey_set_type(EVP_PKEY *pkey, ENGINE *e, int type, const char *str,
+static int pkey_set_type(EVP_PKEY *pkey, int type, const char *str,
     int len, EVP_KEYMGMT *keymgmt);
 static void evp_pkey_free_it(EVP_PKEY *key);

@@ -90,6 +89,11 @@ int EVP_PKEY_get_security_bits(const EVP_PKEY *pkey)
     return size;
 }

+int EVP_PKEY_get_security_category(const EVP_PKEY *pkey)
+{
+    return pkey != NULL ? pkey->cache.security_category : -1;
+}
+
 int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode)
 {
 #ifndef OPENSSL_NO_DSA
@@ -412,68 +416,42 @@ static EVP_PKEY *new_raw_key_int(OSSL_LIB_CTX *libctx,
     const char *strtype,
     const char *propq,
     int nidtype,
-    ENGINE *e,
     const unsigned char *key,
     size_t len,
     int key_is_priv)
 {
     EVP_PKEY *pkey = NULL;
     EVP_PKEY_CTX *ctx = NULL;
-    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
     int result = 0;

-#ifndef OPENSSL_NO_ENGINE
-    /* Check if there is an Engine for this type */
-    if (e == NULL) {
-        ENGINE *tmpe = NULL;
-
-        if (strtype != NULL)
-            ameth = EVP_PKEY_asn1_find_str(&tmpe, strtype, -1);
-        else if (nidtype != EVP_PKEY_NONE)
-            ameth = EVP_PKEY_asn1_find(&tmpe, nidtype);
-
-        /* If tmpe is NULL then no engine is claiming to support this type */
-        if (tmpe == NULL)
-            ameth = NULL;
+    ctx = EVP_PKEY_CTX_new_from_name(libctx,
+        strtype != NULL ? strtype
+                        : OBJ_nid2sn(nidtype),
+        propq);
+    if (ctx == NULL)
+        goto err;
+    /* May fail if no provider available */
+    ERR_set_mark();
+    if (EVP_PKEY_fromdata_init(ctx) == 1) {
+        OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };

-        ENGINE_finish(tmpe);
-    }
-#endif
+        ERR_clear_last_mark();
+        params[0] = OSSL_PARAM_construct_octet_string(
+            key_is_priv ? OSSL_PKEY_PARAM_PRIV_KEY
+                        : OSSL_PKEY_PARAM_PUB_KEY,
+            (void *)key, len);

-    if (e == NULL && ameth == NULL) {
-        /*
-         * No engine is claiming to support this type, so lets see if we have
-         * a provider.
-         */
-        ctx = EVP_PKEY_CTX_new_from_name(libctx,
-            strtype != NULL ? strtype
-                            : OBJ_nid2sn(nidtype),
-            propq);
-        if (ctx == NULL)
+        if (EVP_PKEY_fromdata(ctx, &pkey, EVP_PKEY_KEYPAIR, params) != 1) {
+            ERR_raise(ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED);
             goto err;
-        /* May fail if no provider available */
-        ERR_set_mark();
-        if (EVP_PKEY_fromdata_init(ctx) == 1) {
-            OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };
-
-            ERR_clear_last_mark();
-            params[0] = OSSL_PARAM_construct_octet_string(
-                key_is_priv ? OSSL_PKEY_PARAM_PRIV_KEY
-                            : OSSL_PKEY_PARAM_PUB_KEY,
-                (void *)key, len);
-
-            if (EVP_PKEY_fromdata(ctx, &pkey, EVP_PKEY_KEYPAIR, params) != 1) {
-                ERR_raise(ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED);
-                goto err;
-            }
+        }

-            EVP_PKEY_CTX_free(ctx);
+        EVP_PKEY_CTX_free(ctx);

-            return pkey;
-        }
-        ERR_pop_to_mark();
-        /* else not supported so fallback to legacy */
+        return pkey;
     }
+    ERR_pop_to_mark();
+    /* else not supported so fallback to legacy */

     /* Legacy code path */

@@ -483,7 +461,7 @@ static EVP_PKEY *new_raw_key_int(OSSL_LIB_CTX *libctx,
         goto err;
     }

-    if (!pkey_set_type(pkey, e, nidtype, strtype, -1, NULL)) {
+    if (!pkey_set_type(pkey, nidtype, strtype, -1, NULL)) {
         /* ERR_raise(ERR_LIB_EVP, ...) already called */
         goto err;
     }
@@ -528,7 +506,7 @@ EVP_PKEY *EVP_PKEY_new_raw_private_key_ex(OSSL_LIB_CTX *libctx,
     const char *propq,
     const unsigned char *priv, size_t len)
 {
-    return new_raw_key_int(libctx, keytype, propq, EVP_PKEY_NONE, NULL, priv,
+    return new_raw_key_int(libctx, keytype, propq, EVP_PKEY_NONE, priv,
         len, 1);
 }

@@ -536,14 +514,16 @@ EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e,
     const unsigned char *priv,
     size_t len)
 {
-    return new_raw_key_int(NULL, NULL, NULL, type, e, priv, len, 1);
+    if (!ossl_assert(e == NULL))
+        return NULL;
+    return new_raw_key_int(NULL, NULL, NULL, type, priv, len, 1);
 }

 EVP_PKEY *EVP_PKEY_new_raw_public_key_ex(OSSL_LIB_CTX *libctx,
     const char *keytype, const char *propq,
     const unsigned char *pub, size_t len)
 {
-    return new_raw_key_int(libctx, keytype, propq, EVP_PKEY_NONE, NULL, pub,
+    return new_raw_key_int(libctx, keytype, propq, EVP_PKEY_NONE, pub,
         len, 0);
 }

@@ -551,7 +531,9 @@ EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e,
     const unsigned char *pub,
     size_t len)
 {
-    return new_raw_key_int(NULL, NULL, NULL, type, e, pub, len, 0);
+    if (!ossl_assert(e == NULL))
+        return NULL;
+    return new_raw_key_int(NULL, NULL, NULL, type, pub, len, 0);
 }

 struct raw_key_details_st {
@@ -651,12 +633,9 @@ static EVP_PKEY *new_cmac_key_int(const unsigned char *priv, size_t len,
     const char *cipher_name,
     const EVP_CIPHER *cipher,
     OSSL_LIB_CTX *libctx,
-    const char *propq, ENGINE *e)
+    const char *propq)
 {
 #ifndef OPENSSL_NO_CMAC
-#ifndef OPENSSL_NO_ENGINE
-    const char *engine_id = e != NULL ? ENGINE_get_id(e) : NULL;
-#endif
     OSSL_PARAM params[5], *p = params;
     EVP_PKEY *pkey = NULL;
     EVP_PKEY_CTX *ctx;
@@ -685,11 +664,6 @@ static EVP_PKEY *new_cmac_key_int(const unsigned char *priv, size_t len,
     if (propq != NULL)
         *p++ = OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_PROPERTIES,
             (char *)propq, 0);
-#ifndef OPENSSL_NO_ENGINE
-    if (engine_id != NULL)
-        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_ENGINE,
-            (char *)engine_id, 0);
-#endif
     *p = OSSL_PARAM_construct_end();

     if (EVP_PKEY_fromdata(ctx, &pkey, EVP_PKEY_KEYPAIR, params) <= 0) {
@@ -710,43 +684,20 @@ err:
 EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv,
     size_t len, const EVP_CIPHER *cipher)
 {
-    return new_cmac_key_int(priv, len, NULL, cipher, NULL, NULL, e);
+    if (!ossl_assert(e == NULL))
+        return NULL;
+    return new_cmac_key_int(priv, len, NULL, cipher, NULL, NULL);
 }

 int EVP_PKEY_set_type(EVP_PKEY *pkey, int type)
 {
-    return pkey_set_type(pkey, NULL, type, NULL, -1, NULL);
+    return pkey_set_type(pkey, type, NULL, -1, NULL);
 }

 int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len)
 {
-    return pkey_set_type(pkey, NULL, EVP_PKEY_NONE, str, len, NULL);
-}
-
-#ifndef OPENSSL_NO_ENGINE
-int EVP_PKEY_set1_engine(EVP_PKEY *pkey, ENGINE *e)
-{
-    if (e != NULL) {
-        if (!ENGINE_init(e)) {
-            ERR_raise(ERR_LIB_EVP, ERR_R_ENGINE_LIB);
-            return 0;
-        }
-        if (ENGINE_get_pkey_meth(e, pkey->type) == NULL) {
-            ENGINE_finish(e);
-            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
-            return 0;
-        }
-    }
-    ENGINE_finish(pkey->pmeth_engine);
-    pkey->pmeth_engine = e;
-    return 1;
-}
-
-ENGINE *EVP_PKEY_get0_engine(const EVP_PKEY *pkey)
-{
-    return pkey->engine;
+    return pkey_set_type(pkey, EVP_PKEY_NONE, str, len, NULL);
 }
-#endif

 #ifndef OPENSSL_NO_DEPRECATED_3_0
 static void detect_foreign_key(EVP_PKEY *pkey)
@@ -1015,22 +966,6 @@ DH *EVP_PKEY_get1_DH(EVP_PKEY *pkey)
 }
 #endif

-int EVP_PKEY_type(int type)
-{
-    int ret;
-    const EVP_PKEY_ASN1_METHOD *ameth;
-    ENGINE *e;
-    ameth = EVP_PKEY_asn1_find(&e, type);
-    if (ameth)
-        ret = ameth->pkey_id;
-    else
-        ret = NID_undef;
-#ifndef OPENSSL_NO_ENGINE
-    ENGINE_finish(e);
-#endif
-    return ret;
-}
-
 int EVP_PKEY_get_id(const EVP_PKEY *pkey)
 {
     return pkey->type;
@@ -1441,7 +1376,7 @@ int EVP_PKEY_set1_encoded_public_key(EVP_PKEY *pkey, const unsigned char *pub,
     if (publen > INT_MAX)
         return 0;
     /* Historically this function was EVP_PKEY_set1_tls_encodedpoint */
-    if (evp_pkey_asn1_ctrl(pkey, ASN1_PKEY_CTRL_SET1_TLS_ENCPT, publen,
+    if (evp_pkey_asn1_ctrl(pkey, ASN1_PKEY_CTRL_SET1_TLS_ENCPT, (int)publen,
             (void *)pub)
         <= 0)
         return 0;
@@ -1536,8 +1471,8 @@ err:
  * Setup a public key management method.
  *
  * For legacy keys, either |type| or |str| is expected to have the type
- * information.  In this case, the setup consists of finding an ASN1 method
- * and potentially an ENGINE, and setting those fields in |pkey|.
+ * information. In this case, the setup consists of finding an ASN1 method
+ * and setting those fields in |pkey|.
  *
  * For provider side keys, |keymgmt| is expected to be non-NULL.  In this
  * case, the setup consists of setting the |keymgmt| field in |pkey|.
@@ -1545,20 +1480,18 @@ err:
  * If pkey is NULL just return 1 or 0 if the key management method exists.
  */

-static int pkey_set_type(EVP_PKEY *pkey, ENGINE *e, int type, const char *str,
+static int pkey_set_type(EVP_PKEY *pkey, int type, const char *str,
     int len, EVP_KEYMGMT *keymgmt)
 {
 #ifndef FIPS_MODULE
     const EVP_PKEY_ASN1_METHOD *ameth = NULL;
-    ENGINE **eptr = (e == NULL) ? &e : NULL;
 #endif

     /*
      * The setups can't set both legacy and provider side methods.
      * It is forbidden
      */
-    if (!ossl_assert(type == EVP_PKEY_NONE || keymgmt == NULL)
-        || !ossl_assert(e == NULL || keymgmt == NULL)) {
+    if (!ossl_assert(type == EVP_PKEY_NONE || keymgmt == NULL)) {
         ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
         return 0;
     }
@@ -1581,24 +1514,13 @@ static int pkey_set_type(EVP_PKEY *pkey, ENGINE *e, int type, const char *str,
             && type == pkey->save_type
             && pkey->ameth != NULL)
             return 1;
-#ifndef OPENSSL_NO_ENGINE
-        /* If we have ENGINEs release them */
-        ENGINE_finish(pkey->engine);
-        pkey->engine = NULL;
-        ENGINE_finish(pkey->pmeth_engine);
-        pkey->pmeth_engine = NULL;
-#endif
 #endif
     }
 #ifndef FIPS_MODULE
     if (str != NULL)
-        ameth = EVP_PKEY_asn1_find_str(eptr, str, len);
+        ameth = evp_pkey_asn1_find_str(str, len);
     else if (type != EVP_PKEY_NONE)
-        ameth = EVP_PKEY_asn1_find(eptr, type);
-#ifndef OPENSSL_NO_ENGINE
-    if (pkey == NULL && eptr != NULL)
-        ENGINE_finish(e);
-#endif
+        ameth = evp_pkey_asn1_find(type);
 #endif

     {
@@ -1647,13 +1569,6 @@ static int pkey_set_type(EVP_PKEY *pkey, ENGINE *e, int type, const char *str,
         } else {
             pkey->type = EVP_PKEY_KEYMGMT;
         }
-#ifndef OPENSSL_NO_ENGINE
-        if (eptr == NULL && e != NULL && !ENGINE_init(e)) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
-            return 0;
-        }
-#endif
-        pkey->engine = e;
 #endif
     }
     return 1;
@@ -1670,7 +1585,7 @@ static void find_ameth(const char *name, void *data)
      */
     ERR_set_mark();

-    if (pkey_set_type(NULL, NULL, EVP_PKEY_NONE, name, strlen(name),
+    if (pkey_set_type(NULL, EVP_PKEY_NONE, name, (int)strlen(name),
             NULL)) {
         if (str[0] == NULL)
             str[0] = name;
@@ -1703,7 +1618,7 @@ int EVP_PKEY_set_type_by_keymgmt(EVP_PKEY *pkey, EVP_KEYMGMT *keymgmt)
 #define EVP_PKEY_TYPE_STR NULL
 #define EVP_PKEY_TYPE_STRLEN -1
 #endif
-    return pkey_set_type(pkey, NULL, EVP_PKEY_NONE,
+    return pkey_set_type(pkey, EVP_PKEY_NONE,
         EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
         keymgmt);

@@ -1715,7 +1630,7 @@ int EVP_PKEY_up_ref(EVP_PKEY *pkey)
 {
     int i;

-    if (CRYPTO_UP_REF(&pkey->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&pkey->references, &i))
         return 0;

     REF_PRINT_COUNT("EVP_PKEY", i, pkey);
@@ -1788,10 +1703,9 @@ err:
 void evp_pkey_free_legacy(EVP_PKEY *x)
 {
     const EVP_PKEY_ASN1_METHOD *ameth = x->ameth;
-    ENGINE *tmpe = NULL;

     if (ameth == NULL && x->legacy_cache_pkey.ptr != NULL)
-        ameth = EVP_PKEY_asn1_find(&tmpe, x->type);
+        ameth = evp_pkey_asn1_find(x->type);

     if (ameth != NULL) {
         if (x->legacy_cache_pkey.ptr != NULL) {
@@ -1811,13 +1725,6 @@ void evp_pkey_free_legacy(EVP_PKEY *x)
             ameth->pkey_free(x);
         x->pkey.ptr = NULL;
     }
-#ifndef OPENSSL_NO_ENGINE
-    ENGINE_finish(tmpe);
-    ENGINE_finish(x->engine);
-    x->engine = NULL;
-    ENGINE_finish(x->pmeth_engine);
-    x->pmeth_engine = NULL;
-#endif
 }
 #endif /* FIPS_MODULE */

@@ -1953,6 +1860,8 @@ void *evp_pkey_export_to_provider(EVP_PKEY *pk, OSSL_LIB_CTX *libctx,
 #ifndef FIPS_MODULE
     if (pk->pkey.ptr != NULL) {
         OP_CACHE_ELEM *op;
+        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+        OSSL_PARAM *p = NULL;

         /*
          * If the legacy "origin" hasn't changed since last time, we try
@@ -1991,11 +1900,33 @@ void *evp_pkey_export_to_provider(EVP_PKEY *pk, OSSL_LIB_CTX *libctx,
         if (!EVP_KEYMGMT_is_a(tmp_keymgmt, OBJ_nid2sn(pk->type)))
             goto end;

-        if ((keydata = evp_keymgmt_newdata(tmp_keymgmt)) == NULL)
+        if (strcmp(OSSL_PROVIDER_get0_name(EVP_KEYMGMT_get0_provider(tmp_keymgmt)), "default") == 0) {
+            /*
+             * We attempt to pass the low-level object to the keymgmt. We only
+             * support this via an internal use only parameter. We break the
+             * normal rules that prevent passing complex objects via OSSL_PARAM,
+             * but this is only for the default provider where we can get away
+             * with this. This is necessary here for backwards compatibility
+             * reasons.
+             */
+            params[0] = OSSL_PARAM_construct_octet_ptr("legacy-object",
+                &pk->pkey.ptr, sizeof(pk->pkey.ptr));
+            p = params;
+        } else if (propquery != NULL) {
+            params[0] = OSSL_PARAM_construct_utf8_string(
+                OSSL_PKEY_PARAM_PROPERTIES, (char *)propquery, 0);
+            p = params;
+        }
+        keydata = evp_keymgmt_newdata(tmp_keymgmt, p);
+        if (keydata == NULL)
             goto end;

-        if (!pk->ameth->export_to(pk, keydata, tmp_keymgmt->import,
-                libctx, propquery)) {
+        /*
+         * We skip the export if the key data we got back is actually the same
+         * as the low level object we passed in
+         */
+        if (keydata != pk->pkey.ptr
+            && !pk->ameth->export_to(pk, keydata, tmp_keymgmt->import, libctx, propquery)) {
             evp_keymgmt_freedata(tmp_keymgmt, keydata);
             keydata = NULL;
             goto end;
@@ -2015,14 +1946,10 @@ void *evp_pkey_export_to_provider(EVP_PKEY *pk, OSSL_LIB_CTX *libctx,

         if (!CRYPTO_THREAD_write_lock(pk->lock))
             goto end;
-        if (pk->ameth->dirty_cnt(pk) != pk->dirty_cnt_copy
-            && !evp_keymgmt_util_clear_operation_cache(pk)) {
-            CRYPTO_THREAD_unlock(pk->lock);
-            evp_keymgmt_freedata(tmp_keymgmt, keydata);
-            keydata = NULL;
-            EVP_KEYMGMT_free(tmp_keymgmt);
-            goto end;
-        }
+
+        if (pk->ameth->dirty_cnt(pk) != pk->dirty_cnt_copy)
+            evp_keymgmt_util_clear_operation_cache(pk);
+
         EVP_KEYMGMT_free(tmp_keymgmt); /* refcnt-- */

         /* Check to make sure some other thread didn't get there first */
@@ -2482,13 +2409,10 @@ int EVP_PKEY_get_ec_point_conv_form(const EVP_PKEY *pkey)
         /* Might work through the legacy route */
         const EC_KEY *ec = EVP_PKEY_get0_EC_KEY(pkey);

-        if (ec == NULL)
-            return 0;
-
-        return EC_KEY_get_conv_form(ec);
-#else
-        return 0;
+        if (ec != NULL)
+            return EC_KEY_get_conv_form(ec);
 #endif
+        return 0;
     }

     if (!EVP_PKEY_get_utf8_string_param(pkey,
diff --git a/deps/openssl/openssl/crypto/evp/p_open.c b/deps/openssl/openssl/crypto/evp/p_open.c
index cddb85d3140..c5676384902 100644
--- a/deps/openssl/openssl/crypto/evp/p_open.c
+++ b/deps/openssl/openssl/crypto/evp/p_open.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -48,7 +48,7 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
     if (EVP_PKEY_decrypt(pctx, key, &keylen, ek, ekl) <= 0)
         goto err;

-    if (EVP_CIPHER_CTX_set_key_length(ctx, keylen) <= 0
+    if (EVP_CIPHER_CTX_set_key_length(ctx, (int)keylen) <= 0
         || !EVP_DecryptInit_ex(ctx, NULL, NULL, key, iv))
         goto err;

diff --git a/deps/openssl/openssl/crypto/evp/p_seal.c b/deps/openssl/openssl/crypto/evp/p_seal.c
index a4df78b251c..9be4175a413 100644
--- a/deps/openssl/openssl/crypto/evp/p_seal.c
+++ b/deps/openssl/openssl/crypto/evp/p_seal.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/crypto/evp/p_sign.c b/deps/openssl/openssl/crypto/evp/p_sign.c
index 3601a1556b6..1d1ac2aa2d3 100644
--- a/deps/openssl/openssl/crypto/evp/p_sign.c
+++ b/deps/openssl/openssl/crypto/evp/p_sign.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -57,7 +57,7 @@ int EVP_SignFinal_ex(EVP_MD_CTX *ctx, unsigned char *sigret,
         goto err;
     if (EVP_PKEY_sign(pkctx, sigret, &sltmp, m, m_len) <= 0)
         goto err;
-    *siglen = sltmp;
+    *siglen = (unsigned int)sltmp;
     i = 1;
 err:
     EVP_PKEY_CTX_free(pkctx);
diff --git a/deps/openssl/openssl/crypto/evp/pmeth_check.c b/deps/openssl/openssl/crypto/evp/pmeth_check.c
index ebab82809ca..376998e5acc 100644
--- a/deps/openssl/openssl/crypto/evp/pmeth_check.c
+++ b/deps/openssl/openssl/crypto/evp/pmeth_check.c
@@ -59,22 +59,6 @@ static int evp_pkey_public_check_combined(EVP_PKEY_CTX *ctx, int checktype)
         != -1)
         return ok;

-    if (pkey->type == EVP_PKEY_NONE)
-        goto not_supported;
-
-#ifndef FIPS_MODULE
-    /* legacy */
-    /* call customized public key check function first */
-    if (ctx->pmeth->public_check != NULL)
-        return ctx->pmeth->public_check(pkey);
-
-    /* use default public key check function in ameth */
-    if (pkey->ameth == NULL || pkey->ameth->pkey_public_check == NULL)
-        goto not_supported;
-
-    return pkey->ameth->pkey_public_check(pkey);
-#endif
-not_supported:
     ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
     return -2;
 }
@@ -105,22 +89,6 @@ static int evp_pkey_param_check_combined(EVP_PKEY_CTX *ctx, int checktype)
         != -1)
         return ok;

-    if (pkey->type == EVP_PKEY_NONE)
-        goto not_supported;
-
-#ifndef FIPS_MODULE
-    /* legacy */
-    /* call customized param check function first */
-    if (ctx->pmeth->param_check != NULL)
-        return ctx->pmeth->param_check(pkey);
-
-    /* use default param check function in ameth */
-    if (pkey->ameth == NULL || pkey->ameth->pkey_param_check == NULL)
-        goto not_supported;
-
-    return pkey->ameth->pkey_param_check(pkey);
-#endif
-not_supported:
     ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
     return -2;
 }
@@ -175,22 +143,6 @@ int EVP_PKEY_pairwise_check(EVP_PKEY_CTX *ctx)
         != -1)
         return ok;

-    if (pkey->type == EVP_PKEY_NONE)
-        goto not_supported;
-
-#ifndef FIPS_MODULE
-    /* legacy */
-    /* call customized check function first */
-    if (ctx->pmeth->check != NULL)
-        return ctx->pmeth->check(pkey);
-
-    /* use default check function in ameth */
-    if (pkey->ameth == NULL || pkey->ameth->pkey_check == NULL)
-        goto not_supported;
-
-    return pkey->ameth->pkey_check(pkey);
-#endif
-not_supported:
     ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
     return -2;
 }
diff --git a/deps/openssl/openssl/crypto/evp/pmeth_gn.c b/deps/openssl/openssl/crypto/evp/pmeth_gn.c
index c653dbd6edc..c8ca005e940 100644
--- a/deps/openssl/openssl/crypto/evp/pmeth_gn.c
+++ b/deps/openssl/openssl/crypto/evp/pmeth_gn.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,6 +13,7 @@
 #include <openssl/core_names.h>
 #include "internal/cryptlib.h"
 #include "internal/core.h"
+#include "internal/common.h"
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include "crypto/bn.h"
@@ -33,7 +34,7 @@ static int gen_init(EVP_PKEY_CTX *ctx, int operation)
     ctx->operation = operation;

     if (ctx->keymgmt == NULL || ctx->keymgmt->gen_init == NULL)
-        goto legacy;
+        goto not_supported;

     switch (operation) {
     case EVP_PKEY_OP_PARAMGEN:
@@ -52,30 +53,6 @@ static int gen_init(EVP_PKEY_CTX *ctx, int operation)
         ret = 1;
     goto end;

-legacy:
-#ifdef FIPS_MODULE
-    goto not_supported;
-#else
-    if (ctx->pmeth == NULL
-        || (operation == EVP_PKEY_OP_PARAMGEN
-            && ctx->pmeth->paramgen == NULL)
-        || (operation == EVP_PKEY_OP_KEYGEN
-            && ctx->pmeth->keygen == NULL))
-        goto not_supported;
-
-    ret = 1;
-    switch (operation) {
-    case EVP_PKEY_OP_PARAMGEN:
-        if (ctx->pmeth->paramgen_init != NULL)
-            ret = ctx->pmeth->paramgen_init(ctx);
-        break;
-    case EVP_PKEY_OP_KEYGEN:
-        if (ctx->pmeth->keygen_init != NULL)
-            ret = ctx->pmeth->keygen_init(ctx);
-        break;
-    }
-#endif
-
 end:
     if (ret <= 0 && ctx != NULL) {
         evp_pkey_ctx_free_old_ops(ctx);
@@ -148,7 +125,7 @@ int EVP_PKEY_generate(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
     }

     if (ctx->op.keymgmt.genctx == NULL)
-        goto legacy;
+        goto not_supported;

     /*
      * Assigning gentmp to ctx->keygen_info is something our legacy
@@ -189,7 +166,7 @@ int EVP_PKEY_generate(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)

     ctx->keygen_info = NULL;

-#ifndef FIPS_MODULE
+#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_DEPRECATED_3_6)
     /* In case |*ppkey| was originally a legacy key */
     if (ret)
         evp_pkey_free_legacy(*ppkey);
@@ -202,33 +179,6 @@ int EVP_PKEY_generate(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)

     goto end;

-legacy:
-#ifdef FIPS_MODULE
-    goto not_supported;
-#else
-    /*
-     * If we get here then we're using legacy paramgen/keygen. In that case
-     * the pkey in ctx (if there is one) had better not be provided (because the
-     * legacy methods may not know how to handle it). However we can only get
-     * here if ctx->op.keymgmt.genctx == NULL, but that should never be the case
-     * if ctx->pkey is provided because we don't allow this when we initialise
-     * the ctx.
-     */
-    if (ctx->pkey != NULL && !ossl_assert(!evp_pkey_is_provided(ctx->pkey)))
-        goto not_accessible;
-
-    switch (ctx->operation) {
-    case EVP_PKEY_OP_PARAMGEN:
-        ret = ctx->pmeth->paramgen(ctx, *ppkey);
-        break;
-    case EVP_PKEY_OP_KEYGEN:
-        ret = ctx->pmeth->keygen(ctx, *ppkey);
-        break;
-    default:
-        goto not_supported;
-    }
-#endif
-
 end:
     if (ret <= 0) {
         if (allocated_pkey != NULL)
@@ -245,12 +195,6 @@ not_initialized:
     ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED);
     ret = -1;
     goto end;
-#ifndef FIPS_MODULE
-not_accessible:
-    ERR_raise(ERR_LIB_EVP, EVP_R_INACCESSIBLE_DOMAIN_PARAMETERS);
-    ret = -1;
-    goto end;
-#endif
 }

 int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
@@ -315,7 +259,10 @@ EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e,
 {
     EVP_PKEY_CTX *mac_ctx = NULL;
     EVP_PKEY *mac_key = NULL;
-    mac_ctx = EVP_PKEY_CTX_new_id(type, e);
+
+    if (!ossl_assert(e == NULL))
+        return NULL;
+    mac_ctx = EVP_PKEY_CTX_new_id(type, NULL);
     if (!mac_ctx)
         return NULL;
     if (EVP_PKEY_keygen_init(mac_ctx) <= 0)
diff --git a/deps/openssl/openssl/crypto/evp/pmeth_lib.c b/deps/openssl/openssl/crypto/evp/pmeth_lib.c
index 2a0fc3ef0be..963e0615c2c 100644
--- a/deps/openssl/openssl/crypto/evp/pmeth_lib.c
+++ b/deps/openssl/openssl/crypto/evp/pmeth_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,9 +15,6 @@

 #include <stdio.h>
 #include <stdlib.h>
-#ifndef FIPS_MODULE
-#include <openssl/engine.h>
-#endif
 #include <openssl/evp.h>
 #include <openssl/core_names.h>
 #include <openssl/dh.h>
@@ -33,6 +30,7 @@
 #include "internal/ffc.h"
 #include "internal/numbers.h"
 #include "internal/provider.h"
+#include "internal/common.h"
 #include "evp_local.h"

 #ifndef FIPS_MODULE
@@ -45,94 +43,6 @@ static void evp_pkey_ctx_free_cached_data(EVP_PKEY_CTX *ctx,
     int cmd, const char *name);
 static void evp_pkey_ctx_free_all_cached_data(EVP_PKEY_CTX *ctx);

-typedef const EVP_PKEY_METHOD *(*pmeth_fn)(void);
-typedef int sk_cmp_fn_type(const char *const *a, const char *const *b);
-
-static STACK_OF(EVP_PKEY_METHOD) *app_pkey_methods = NULL;
-
-/* This array needs to be in order of NIDs */
-static pmeth_fn standard_methods[] = {
-    ossl_rsa_pkey_method,
-#ifndef OPENSSL_NO_DH
-    ossl_dh_pkey_method,
-#endif
-#ifndef OPENSSL_NO_DSA
-    ossl_dsa_pkey_method,
-#endif
-#ifndef OPENSSL_NO_EC
-    ossl_ec_pkey_method,
-#endif
-    ossl_rsa_pss_pkey_method,
-#ifndef OPENSSL_NO_DH
-    ossl_dhx_pkey_method,
-#endif
-#ifndef OPENSSL_NO_ECX
-    ossl_ecx25519_pkey_method,
-    ossl_ecx448_pkey_method,
-    ossl_ed25519_pkey_method,
-    ossl_ed448_pkey_method,
-#endif
-};
-
-DECLARE_OBJ_BSEARCH_CMP_FN(const EVP_PKEY_METHOD *, pmeth_fn, pmeth_func);
-
-static int pmeth_func_cmp(const EVP_PKEY_METHOD *const *a, pmeth_fn const *b)
-{
-    return ((*a)->pkey_id - ((**b)())->pkey_id);
-}
-
-IMPLEMENT_OBJ_BSEARCH_CMP_FN(const EVP_PKEY_METHOD *, pmeth_fn, pmeth_func);
-
-static int pmeth_cmp(const EVP_PKEY_METHOD *const *a,
-    const EVP_PKEY_METHOD *const *b)
-{
-    return ((*a)->pkey_id - (*b)->pkey_id);
-}
-
-static const EVP_PKEY_METHOD *evp_pkey_meth_find_added_by_application(int type)
-{
-    if (app_pkey_methods != NULL) {
-        int idx;
-        EVP_PKEY_METHOD tmp;
-
-        tmp.pkey_id = type;
-        idx = sk_EVP_PKEY_METHOD_find(app_pkey_methods, &tmp);
-        if (idx >= 0)
-            return sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx);
-    }
-    return NULL;
-}
-
-const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type)
-{
-    pmeth_fn *ret;
-    EVP_PKEY_METHOD tmp;
-    const EVP_PKEY_METHOD *t;
-
-    if ((t = evp_pkey_meth_find_added_by_application(type)) != NULL)
-        return t;
-
-    tmp.pkey_id = type;
-    t = &tmp;
-    ret = OBJ_bsearch_pmeth_func(&t, standard_methods,
-        OSSL_NELEM(standard_methods));
-    if (ret == NULL || *ret == NULL)
-        return NULL;
-    return (**ret)();
-}
-
-EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags)
-{
-    EVP_PKEY_METHOD *pmeth;
-
-    pmeth = OPENSSL_zalloc(sizeof(*pmeth));
-    if (pmeth == NULL)
-        return NULL;
-
-    pmeth->pkey_id = id;
-    pmeth->flags = flags | EVP_PKEY_FLAG_DYNAMIC;
-    return pmeth;
-}
 #endif /* FIPS_MODULE */

 int evp_pkey_ctx_state(const EVP_PKEY_CTX *ctx)
@@ -155,14 +65,11 @@ int evp_pkey_ctx_state(const EVP_PKEY_CTX *ctx)
     return EVP_PKEY_STATE_LEGACY;
 }

-static EVP_PKEY_CTX *int_ctx_new(OSSL_LIB_CTX *libctx,
-    EVP_PKEY *pkey, ENGINE *e,
+static EVP_PKEY_CTX *int_ctx_new(OSSL_LIB_CTX *libctx, EVP_PKEY *pkey,
     const char *keytype, const char *propquery,
     int id)
-
 {
     EVP_PKEY_CTX *ret = NULL;
-    const EVP_PKEY_METHOD *pmeth = NULL, *app_pmeth = NULL;
     EVP_KEYMGMT *keymgmt = NULL;

     /* Code below to be removed when legacy support is dropped. */
@@ -184,66 +91,20 @@ static EVP_PKEY_CTX *int_ctx_new(OSSL_LIB_CTX *libctx,
 #endif
         }
     }
-    /* If no ID was found here, we can only resort to find a keymgmt */
-    if (id == -1) {
-#ifndef FIPS_MODULE
-        /* Using engine with a key without id will not work */
-        if (e != NULL) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
-            return NULL;
-        }
-#endif
-        goto common;
-    }

 #ifndef FIPS_MODULE
     /*
      * Here, we extract what information we can for the purpose of
      * supporting usage with implementations from providers, to make
      * for a smooth transition from legacy stuff to provider based stuff.
-     *
-     * If an engine is given, this is entirely legacy, and we should not
-     * pretend anything else, so we clear the name.
      */
-    if (e != NULL)
-        keytype = NULL;
-    if (e == NULL && (pkey == NULL || pkey->foreign == 0))
+    if (id != -1)
         keytype = OBJ_nid2sn(id);

-#ifndef OPENSSL_NO_ENGINE
-    if (e == NULL && pkey != NULL)
-        e = pkey->pmeth_engine != NULL ? pkey->pmeth_engine : pkey->engine;
-    /* Try to find an ENGINE which implements this method */
-    if (e != NULL) {
-        if (!ENGINE_init(e)) {
-            ERR_raise(ERR_LIB_EVP, ERR_R_ENGINE_LIB);
-            return NULL;
-        }
-    } else {
-        e = ENGINE_get_pkey_meth_engine(id);
-    }
-
-    /*
-     * If an ENGINE handled this method look it up. Otherwise use internal
-     * tables.
-     */
-    if (e != NULL)
-        pmeth = ENGINE_get_pkey_meth(e, id);
-    else
-#endif /* OPENSSL_NO_ENGINE */
-        if (pkey != NULL && pkey->foreign)
-            pmeth = EVP_PKEY_meth_find(id);
-        else
-            app_pmeth = pmeth = evp_pkey_meth_find_added_by_application(id);
-
-        /* END legacy */
+    /* END legacy */
 #endif /* FIPS_MODULE */
-common:
-    /*
-     * If there's no engine and no app supplied pmeth and there's a name, we try
-     * fetching a provider implementation.
-     */
-    if (e == NULL && app_pmeth == NULL && keytype != NULL) {
+    /* We try fetching a provider implementation. */
+    if (keytype != NULL) {
         /*
          * If |pkey| is given and is provided, we take a reference to its
          * keymgmt.  Otherwise, we fetch one for the keytype we got. This
@@ -291,17 +152,12 @@ common:
 #endif
     }

-    if (pmeth == NULL && keymgmt == NULL) {
+    if (keymgmt == NULL) {
         ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
     } else {
         ret = OPENSSL_zalloc(sizeof(*ret));
     }

-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    if ((ret == NULL || pmeth == NULL) && e != NULL)
-        ENGINE_finish(e);
-#endif
-
     if (ret == NULL) {
         EVP_KEYMGMT_free(keymgmt);
         return NULL;
@@ -318,8 +174,6 @@ common:
     ret->keytype = keytype;
     ret->keymgmt = keymgmt;
     ret->legacy_keytype = id;
-    ret->engine = e;
-    ret->pmeth = pmeth;
     ret->operation = EVP_PKEY_OP_UNDEFINED;

     if (pkey != NULL && !EVP_PKEY_up_ref(pkey)) {
@@ -329,14 +183,6 @@ common:

     ret->pkey = pkey;

-    if (pmeth != NULL && pmeth->init != NULL) {
-        if (pmeth->init(ret) <= 0) {
-            ret->pmeth = NULL;
-            EVP_PKEY_CTX_free(ret);
-            return NULL;
-        }
-    }
-
     return ret;
 }

@@ -346,13 +192,13 @@ EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_name(OSSL_LIB_CTX *libctx,
     const char *name,
     const char *propquery)
 {
-    return int_ctx_new(libctx, NULL, NULL, name, propquery, -1);
+    return int_ctx_new(libctx, NULL, name, propquery, -1);
 }

 EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_pkey(OSSL_LIB_CTX *libctx, EVP_PKEY *pkey,
     const char *propquery)
 {
-    return int_ctx_new(libctx, pkey, NULL, NULL, propquery, -1);
+    return int_ctx_new(libctx, pkey, NULL, propquery, -1);
 }

 void evp_pkey_ctx_free_old_ops(EVP_PKEY_CTX *ctx)
@@ -391,8 +237,6 @@ void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx)
 {
     if (ctx == NULL)
         return;
-    if (ctx->pmeth && ctx->pmeth->cleanup)
-        ctx->pmeth->cleanup(ctx);

     evp_pkey_ctx_free_old_ops(ctx);
 #ifndef FIPS_MODULE
@@ -403,63 +247,29 @@ void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx)
     OPENSSL_free(ctx->propquery);
     EVP_PKEY_free(ctx->pkey);
     EVP_PKEY_free(ctx->peerkey);
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    ENGINE_finish(ctx->engine);
-#endif
     BN_free(ctx->rsa_pubexp);
     OPENSSL_free(ctx);
 }

 #ifndef FIPS_MODULE
-
-void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags,
-    const EVP_PKEY_METHOD *meth)
-{
-    if (ppkey_id)
-        *ppkey_id = meth->pkey_id;
-    if (pflags)
-        *pflags = meth->flags;
-}
-
-void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src)
-{
-    int pkey_id = dst->pkey_id;
-    int flags = dst->flags;
-
-    *dst = *src;
-
-    /* We only copy the function pointers so restore the other values */
-    dst->pkey_id = pkey_id;
-    dst->flags = flags;
-}
-
-void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth)
-{
-    if (pmeth && (pmeth->flags & EVP_PKEY_FLAG_DYNAMIC))
-        OPENSSL_free(pmeth);
-}
-
 EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e)
 {
-    return int_ctx_new(NULL, pkey, e, NULL, NULL, -1);
+    if (!ossl_assert(e == NULL))
+        return NULL;
+    return int_ctx_new(NULL, pkey, NULL, NULL, -1);
 }

 EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e)
 {
-    return int_ctx_new(NULL, NULL, e, NULL, NULL, id);
+    if (!ossl_assert(e == NULL))
+        return NULL;
+    return int_ctx_new(NULL, NULL, NULL, NULL, id);
 }

 EVP_PKEY_CTX *EVP_PKEY_CTX_dup(const EVP_PKEY_CTX *pctx)
 {
     EVP_PKEY_CTX *rctx;

-#ifndef OPENSSL_NO_ENGINE
-    /* Make sure it's safe to copy a pkey context using an ENGINE */
-    if (pctx->engine && !ENGINE_init(pctx->engine)) {
-        ERR_raise(ERR_LIB_EVP, ERR_R_ENGINE_LIB);
-        return 0;
-    }
-#endif
     rctx = OPENSSL_zalloc(sizeof(*rctx));
     if (rctx == NULL)
         return NULL;
@@ -574,102 +384,39 @@ EVP_PKEY_CTX *EVP_PKEY_CTX_dup(const EVP_PKEY_CTX *pctx)
         goto err;
     }

-    rctx->pmeth = pctx->pmeth;
-#ifndef OPENSSL_NO_ENGINE
-    rctx->engine = pctx->engine;
-#endif
-
     if (pctx->peerkey != NULL && !EVP_PKEY_up_ref(pctx->peerkey))
         goto err;

     rctx->peerkey = pctx->peerkey;

-    if (pctx->pmeth == NULL) {
-        if (rctx->operation == EVP_PKEY_OP_UNDEFINED) {
-            EVP_KEYMGMT *tmp_keymgmt = pctx->keymgmt;
-            void *provkey;
-
-            if (pctx->pkey == NULL)
-                return rctx;
+    if (rctx->operation == EVP_PKEY_OP_UNDEFINED) {
+        EVP_KEYMGMT *tmp_keymgmt = pctx->keymgmt;
+        void *provkey;

-            provkey = evp_pkey_export_to_provider(pctx->pkey, pctx->libctx,
-                &tmp_keymgmt, pctx->propquery);
-            if (provkey == NULL)
-                goto err;
-            if (!EVP_KEYMGMT_up_ref(tmp_keymgmt))
-                goto err;
-            EVP_KEYMGMT_free(rctx->keymgmt);
-            rctx->keymgmt = tmp_keymgmt;
+        if (pctx->pkey == NULL)
             return rctx;
-        }
-    } else if (pctx->pmeth->copy(rctx, pctx) > 0) {
+
+        provkey = evp_pkey_export_to_provider(pctx->pkey, pctx->libctx,
+            &tmp_keymgmt, pctx->propquery);
+        if (provkey == NULL)
+            goto err;
+        if (!EVP_KEYMGMT_up_ref(tmp_keymgmt))
+            goto err;
+        EVP_KEYMGMT_free(rctx->keymgmt);
+        rctx->keymgmt = tmp_keymgmt;
         return rctx;
     }
 err:
-    rctx->pmeth = NULL;
     EVP_PKEY_CTX_free(rctx);
     return NULL;
 }
-
-int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth)
-{
-    if (app_pkey_methods == NULL) {
-        app_pkey_methods = sk_EVP_PKEY_METHOD_new(pmeth_cmp);
-        if (app_pkey_methods == NULL) {
-            ERR_raise(ERR_LIB_EVP, ERR_R_CRYPTO_LIB);
-            return 0;
-        }
-    }
-    if (!sk_EVP_PKEY_METHOD_push(app_pkey_methods, pmeth)) {
-        ERR_raise(ERR_LIB_EVP, ERR_R_CRYPTO_LIB);
-        return 0;
-    }
-    sk_EVP_PKEY_METHOD_sort(app_pkey_methods);
-    return 1;
-}
-
-void evp_app_cleanup_int(void)
-{
-    if (app_pkey_methods != NULL)
-        sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free);
-}
-
-int EVP_PKEY_meth_remove(const EVP_PKEY_METHOD *pmeth)
-{
-    const EVP_PKEY_METHOD *ret;
-
-    ret = sk_EVP_PKEY_METHOD_delete_ptr(app_pkey_methods, pmeth);
-
-    return ret == NULL ? 0 : 1;
-}
-
-size_t EVP_PKEY_meth_get_count(void)
-{
-    size_t rv = OSSL_NELEM(standard_methods);
-
-    if (app_pkey_methods)
-        rv += sk_EVP_PKEY_METHOD_num(app_pkey_methods);
-    return rv;
-}
-
-const EVP_PKEY_METHOD *EVP_PKEY_meth_get0(size_t idx)
-{
-    if (idx < OSSL_NELEM(standard_methods))
-        return (standard_methods[idx])();
-    if (app_pkey_methods == NULL)
-        return NULL;
-    idx -= OSSL_NELEM(standard_methods);
-    if (idx >= (size_t)sk_EVP_PKEY_METHOD_num(app_pkey_methods))
-        return NULL;
-    return sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx);
-}
 #endif

 int EVP_PKEY_CTX_is_a(EVP_PKEY_CTX *ctx, const char *keytype)
 {
 #ifndef FIPS_MODULE
     if (evp_pkey_ctx_is_legacy(ctx))
-        return (ctx->pmeth->pkey_id == evp_pkey_name2type(keytype));
+        return (ctx->legacy_keytype == evp_pkey_name2type(keytype));
 #endif
     return EVP_KEYMGMT_is_a(ctx->keymgmt, keytype);
 }
@@ -751,6 +498,8 @@ int EVP_PKEY_CTX_get_params(EVP_PKEY_CTX *ctx, OSSL_PARAM *params)
         return evp_pkey_ctx_get_params_to_ctrl(ctx, params);
 #endif
     }
+    ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_GET_CTX_PARAMS_NOT_SUPPORTED,
+        "EVP_PKEY_OP=0x%x", ctx->operation);
     return 0;
 }

@@ -1299,21 +1048,14 @@ static int evp_pkey_ctx_ctrl_int(EVP_PKEY_CTX *ctx, int keytype, int optype,
 {
     int ret = 0;

-    /*
-     * If the method has a |digest_custom| function, we can relax the
-     * operation type check, since this can be called before the operation
-     * is initialized.
-     */
-    if (ctx->pmeth == NULL || ctx->pmeth->digest_custom == NULL) {
-        if (ctx->operation == EVP_PKEY_OP_UNDEFINED) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_NO_OPERATION_SET);
-            return -1;
-        }
+    if (ctx->operation == EVP_PKEY_OP_UNDEFINED) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_NO_OPERATION_SET);
+        return -1;
+    }

-        if ((optype != -1) && !(ctx->operation & optype)) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
-            return -1;
-        }
+    if ((optype != -1) && !(ctx->operation & optype)) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
+        return -1;
     }

     switch (evp_pkey_ctx_state(ctx)) {
@@ -1321,18 +1063,8 @@ static int evp_pkey_ctx_ctrl_int(EVP_PKEY_CTX *ctx, int keytype, int optype,
         return evp_pkey_ctx_ctrl_to_param(ctx, keytype, optype, cmd, p1, p2);
     case EVP_PKEY_STATE_UNKNOWN:
     case EVP_PKEY_STATE_LEGACY:
-        if (ctx->pmeth == NULL || ctx->pmeth->ctrl == NULL) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
-            return -2;
-        }
-        if ((keytype != -1) && (ctx->pmeth->pkey_id != keytype))
-            return -1;
-
-        ret = ctx->pmeth->ctrl(ctx, cmd, p1, p2);
-
-        if (ret == -2)
-            ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
-        break;
+        ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
+        return -2;
     }
     return ret;
 }
@@ -1386,17 +1118,8 @@ static int evp_pkey_ctx_ctrl_str_int(EVP_PKEY_CTX *ctx,
         return evp_pkey_ctx_ctrl_str_to_param(ctx, name, value);
     case EVP_PKEY_STATE_UNKNOWN:
     case EVP_PKEY_STATE_LEGACY:
-        if (ctx == NULL || ctx->pmeth == NULL || ctx->pmeth->ctrl_str == NULL) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
-            return -2;
-        }
-        if (strcmp(name, "digest") == 0)
-            ret = EVP_PKEY_CTX_md(ctx,
-                EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT,
-                EVP_PKEY_CTRL_MD, value);
-        else
-            ret = ctx->pmeth->ctrl_str(ctx, name, value);
-        break;
+        ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
+        return -2;
     }

     return ret;
@@ -1476,15 +1199,8 @@ static int evp_pkey_ctx_store_cached_data(EVP_PKEY_CTX *ctx,
             break;
         case EVP_PKEY_STATE_UNKNOWN:
         case EVP_PKEY_STATE_LEGACY:
-            if (ctx->pmeth == NULL) {
-                ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
-                return -2;
-            }
-            if (EVP_PKEY_type(ctx->pmeth->pkey_id) != EVP_PKEY_type(keytype)) {
-                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
-                return -1;
-            }
-            break;
+            ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
+            return -2;
         }
     }
     if (optype != -1 && (ctx->operation & optype) == 0) {
@@ -1500,7 +1216,7 @@ static int evp_pkey_ctx_store_cached_data(EVP_PKEY_CTX *ctx,
             if (ctx->cached_parameters.dist_id_name == NULL)
                 return 0;
         }
-        if (data_len > 0) {
+        if (data != NULL) {
             ctx->cached_parameters.dist_id = OPENSSL_memdup(data, data_len);
             if (ctx->cached_parameters.dist_id == NULL)
                 return 0;
@@ -1592,7 +1308,7 @@ int EVP_PKEY_CTX_str2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *str)
     len = strlen(str);
     if (len > INT_MAX)
         return -1;
-    return ctx->pmeth->ctrl(ctx, cmd, len, (void *)str);
+    return EVP_PKEY_CTX_ctrl(ctx, -1, -1, cmd, (int)len, (void *)str);
 }

 int EVP_PKEY_CTX_hex2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *hex)
@@ -1605,7 +1321,7 @@ int EVP_PKEY_CTX_hex2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *hex)
     if (bin == NULL)
         return 0;
     if (binlen <= INT_MAX)
-        rv = ctx->pmeth->ctrl(ctx, cmd, binlen, bin);
+        rv = EVP_PKEY_CTX_ctrl(ctx, -1, -1, cmd, binlen, bin);
     OPENSSL_free(bin);
     return rv;
 }
@@ -1662,401 +1378,4 @@ void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx)
 {
     return ctx->app_data;
 }
-
-void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth,
-    int (*init)(EVP_PKEY_CTX *ctx))
-{
-    pmeth->init = init;
-}
-
-void EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth,
-    int (*copy)(EVP_PKEY_CTX *dst,
-        const EVP_PKEY_CTX *src))
-{
-    pmeth->copy = copy;
-}
-
-void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth,
-    void (*cleanup)(EVP_PKEY_CTX *ctx))
-{
-    pmeth->cleanup = cleanup;
-}
-
-void EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth,
-    int (*paramgen_init)(EVP_PKEY_CTX *ctx),
-    int (*paramgen)(EVP_PKEY_CTX *ctx,
-        EVP_PKEY *pkey))
-{
-    pmeth->paramgen_init = paramgen_init;
-    pmeth->paramgen = paramgen;
-}
-
-void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth,
-    int (*keygen_init)(EVP_PKEY_CTX *ctx),
-    int (*keygen)(EVP_PKEY_CTX *ctx,
-        EVP_PKEY *pkey))
-{
-    pmeth->keygen_init = keygen_init;
-    pmeth->keygen = keygen;
-}
-
-void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth,
-    int (*sign_init)(EVP_PKEY_CTX *ctx),
-    int (*sign)(EVP_PKEY_CTX *ctx,
-        unsigned char *sig, size_t *siglen,
-        const unsigned char *tbs,
-        size_t tbslen))
-{
-    pmeth->sign_init = sign_init;
-    pmeth->sign = sign;
-}
-
-void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth,
-    int (*verify_init)(EVP_PKEY_CTX *ctx),
-    int (*verify)(EVP_PKEY_CTX *ctx,
-        const unsigned char *sig,
-        size_t siglen,
-        const unsigned char *tbs,
-        size_t tbslen))
-{
-    pmeth->verify_init = verify_init;
-    pmeth->verify = verify;
-}
-
-void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth,
-    int (*verify_recover_init)(EVP_PKEY_CTX
-            *ctx),
-    int (*verify_recover)(EVP_PKEY_CTX
-                              *ctx,
-        unsigned char
-            *sig,
-        size_t *siglen,
-        const unsigned char *tbs,
-        size_t tbslen))
-{
-    pmeth->verify_recover_init = verify_recover_init;
-    pmeth->verify_recover = verify_recover;
-}
-
-void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth,
-    int (*signctx_init)(EVP_PKEY_CTX *ctx,
-        EVP_MD_CTX *mctx),
-    int (*signctx)(EVP_PKEY_CTX *ctx,
-        unsigned char *sig,
-        size_t *siglen,
-        EVP_MD_CTX *mctx))
-{
-    pmeth->signctx_init = signctx_init;
-    pmeth->signctx = signctx;
-}
-
-void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth,
-    int (*verifyctx_init)(EVP_PKEY_CTX *ctx,
-        EVP_MD_CTX *mctx),
-    int (*verifyctx)(EVP_PKEY_CTX *ctx,
-        const unsigned char *sig,
-        int siglen,
-        EVP_MD_CTX *mctx))
-{
-    pmeth->verifyctx_init = verifyctx_init;
-    pmeth->verifyctx = verifyctx;
-}
-
-void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth,
-    int (*encrypt_init)(EVP_PKEY_CTX *ctx),
-    int (*encryptfn)(EVP_PKEY_CTX *ctx,
-        unsigned char *out,
-        size_t *outlen,
-        const unsigned char *in,
-        size_t inlen))
-{
-    pmeth->encrypt_init = encrypt_init;
-    pmeth->encrypt = encryptfn;
-}
-
-void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth,
-    int (*decrypt_init)(EVP_PKEY_CTX *ctx),
-    int (*decrypt)(EVP_PKEY_CTX *ctx,
-        unsigned char *out,
-        size_t *outlen,
-        const unsigned char *in,
-        size_t inlen))
-{
-    pmeth->decrypt_init = decrypt_init;
-    pmeth->decrypt = decrypt;
-}
-
-void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth,
-    int (*derive_init)(EVP_PKEY_CTX *ctx),
-    int (*derive)(EVP_PKEY_CTX *ctx,
-        unsigned char *key,
-        size_t *keylen))
-{
-    pmeth->derive_init = derive_init;
-    pmeth->derive = derive;
-}
-
-void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth,
-    int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1,
-        void *p2),
-    int (*ctrl_str)(EVP_PKEY_CTX *ctx,
-        const char *type,
-        const char *value))
-{
-    pmeth->ctrl = ctrl;
-    pmeth->ctrl_str = ctrl_str;
-}
-
-void EVP_PKEY_meth_set_digestsign(EVP_PKEY_METHOD *pmeth,
-    int (*digestsign)(EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen,
-        const unsigned char *tbs, size_t tbslen))
-{
-    pmeth->digestsign = digestsign;
-}
-
-void EVP_PKEY_meth_set_digestverify(EVP_PKEY_METHOD *pmeth,
-    int (*digestverify)(EVP_MD_CTX *ctx, const unsigned char *sig,
-        size_t siglen, const unsigned char *tbs,
-        size_t tbslen))
-{
-    pmeth->digestverify = digestverify;
-}
-
-void EVP_PKEY_meth_set_check(EVP_PKEY_METHOD *pmeth,
-    int (*check)(EVP_PKEY *pkey))
-{
-    pmeth->check = check;
-}
-
-void EVP_PKEY_meth_set_public_check(EVP_PKEY_METHOD *pmeth,
-    int (*check)(EVP_PKEY *pkey))
-{
-    pmeth->public_check = check;
-}
-
-void EVP_PKEY_meth_set_param_check(EVP_PKEY_METHOD *pmeth,
-    int (*check)(EVP_PKEY *pkey))
-{
-    pmeth->param_check = check;
-}
-
-void EVP_PKEY_meth_set_digest_custom(EVP_PKEY_METHOD *pmeth,
-    int (*digest_custom)(EVP_PKEY_CTX *ctx,
-        EVP_MD_CTX *mctx))
-{
-    pmeth->digest_custom = digest_custom;
-}
-
-void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth,
-    int (**pinit)(EVP_PKEY_CTX *ctx))
-{
-    *pinit = pmeth->init;
-}
-
-void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth,
-    int (**pcopy)(EVP_PKEY_CTX *dst,
-        const EVP_PKEY_CTX *src))
-{
-    *pcopy = pmeth->copy;
-}
-
-void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth,
-    void (**pcleanup)(EVP_PKEY_CTX *ctx))
-{
-    *pcleanup = pmeth->cleanup;
-}
-
-void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth,
-    int (**pparamgen_init)(EVP_PKEY_CTX *ctx),
-    int (**pparamgen)(EVP_PKEY_CTX *ctx,
-        EVP_PKEY *pkey))
-{
-    if (pparamgen_init)
-        *pparamgen_init = pmeth->paramgen_init;
-    if (pparamgen)
-        *pparamgen = pmeth->paramgen;
-}
-
-void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth,
-    int (**pkeygen_init)(EVP_PKEY_CTX *ctx),
-    int (**pkeygen)(EVP_PKEY_CTX *ctx,
-        EVP_PKEY *pkey))
-{
-    if (pkeygen_init)
-        *pkeygen_init = pmeth->keygen_init;
-    if (pkeygen)
-        *pkeygen = pmeth->keygen;
-}
-
-void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth,
-    int (**psign_init)(EVP_PKEY_CTX *ctx),
-    int (**psign)(EVP_PKEY_CTX *ctx,
-        unsigned char *sig, size_t *siglen,
-        const unsigned char *tbs,
-        size_t tbslen))
-{
-    if (psign_init)
-        *psign_init = pmeth->sign_init;
-    if (psign)
-        *psign = pmeth->sign;
-}
-
-void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth,
-    int (**pverify_init)(EVP_PKEY_CTX *ctx),
-    int (**pverify)(EVP_PKEY_CTX *ctx,
-        const unsigned char *sig,
-        size_t siglen,
-        const unsigned char *tbs,
-        size_t tbslen))
-{
-    if (pverify_init)
-        *pverify_init = pmeth->verify_init;
-    if (pverify)
-        *pverify = pmeth->verify;
-}
-
-void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth,
-    int (**pverify_recover_init)(EVP_PKEY_CTX
-            *ctx),
-    int (**pverify_recover)(EVP_PKEY_CTX
-                                *ctx,
-        unsigned char
-            *sig,
-        size_t *siglen,
-        const unsigned char *tbs,
-        size_t tbslen))
-{
-    if (pverify_recover_init)
-        *pverify_recover_init = pmeth->verify_recover_init;
-    if (pverify_recover)
-        *pverify_recover = pmeth->verify_recover;
-}
-
-void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth,
-    int (**psignctx_init)(EVP_PKEY_CTX *ctx,
-        EVP_MD_CTX *mctx),
-    int (**psignctx)(EVP_PKEY_CTX *ctx,
-        unsigned char *sig,
-        size_t *siglen,
-        EVP_MD_CTX *mctx))
-{
-    if (psignctx_init)
-        *psignctx_init = pmeth->signctx_init;
-    if (psignctx)
-        *psignctx = pmeth->signctx;
-}
-
-void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth,
-    int (**pverifyctx_init)(EVP_PKEY_CTX *ctx,
-        EVP_MD_CTX *mctx),
-    int (**pverifyctx)(EVP_PKEY_CTX *ctx,
-        const unsigned char *sig,
-        int siglen,
-        EVP_MD_CTX *mctx))
-{
-    if (pverifyctx_init)
-        *pverifyctx_init = pmeth->verifyctx_init;
-    if (pverifyctx)
-        *pverifyctx = pmeth->verifyctx;
-}
-
-void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth,
-    int (**pencrypt_init)(EVP_PKEY_CTX *ctx),
-    int (**pencryptfn)(EVP_PKEY_CTX *ctx,
-        unsigned char *out,
-        size_t *outlen,
-        const unsigned char *in,
-        size_t inlen))
-{
-    if (pencrypt_init)
-        *pencrypt_init = pmeth->encrypt_init;
-    if (pencryptfn)
-        *pencryptfn = pmeth->encrypt;
-}
-
-void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth,
-    int (**pdecrypt_init)(EVP_PKEY_CTX *ctx),
-    int (**pdecrypt)(EVP_PKEY_CTX *ctx,
-        unsigned char *out,
-        size_t *outlen,
-        const unsigned char *in,
-        size_t inlen))
-{
-    if (pdecrypt_init)
-        *pdecrypt_init = pmeth->decrypt_init;
-    if (pdecrypt)
-        *pdecrypt = pmeth->decrypt;
-}
-
-void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth,
-    int (**pderive_init)(EVP_PKEY_CTX *ctx),
-    int (**pderive)(EVP_PKEY_CTX *ctx,
-        unsigned char *key,
-        size_t *keylen))
-{
-    if (pderive_init)
-        *pderive_init = pmeth->derive_init;
-    if (pderive)
-        *pderive = pmeth->derive;
-}
-
-void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth,
-    int (**pctrl)(EVP_PKEY_CTX *ctx, int type, int p1,
-        void *p2),
-    int (**pctrl_str)(EVP_PKEY_CTX *ctx,
-        const char *type,
-        const char *value))
-{
-    if (pctrl)
-        *pctrl = pmeth->ctrl;
-    if (pctrl_str)
-        *pctrl_str = pmeth->ctrl_str;
-}
-
-void EVP_PKEY_meth_get_digestsign(const EVP_PKEY_METHOD *pmeth,
-    int (**digestsign)(EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen,
-        const unsigned char *tbs, size_t tbslen))
-{
-    if (digestsign)
-        *digestsign = pmeth->digestsign;
-}
-
-void EVP_PKEY_meth_get_digestverify(const EVP_PKEY_METHOD *pmeth,
-    int (**digestverify)(EVP_MD_CTX *ctx, const unsigned char *sig,
-        size_t siglen, const unsigned char *tbs,
-        size_t tbslen))
-{
-    if (digestverify)
-        *digestverify = pmeth->digestverify;
-}
-
-void EVP_PKEY_meth_get_check(const EVP_PKEY_METHOD *pmeth,
-    int (**pcheck)(EVP_PKEY *pkey))
-{
-    if (pcheck != NULL)
-        *pcheck = pmeth->check;
-}
-
-void EVP_PKEY_meth_get_public_check(const EVP_PKEY_METHOD *pmeth,
-    int (**pcheck)(EVP_PKEY *pkey))
-{
-    if (pcheck != NULL)
-        *pcheck = pmeth->public_check;
-}
-
-void EVP_PKEY_meth_get_param_check(const EVP_PKEY_METHOD *pmeth,
-    int (**pcheck)(EVP_PKEY *pkey))
-{
-    if (pcheck != NULL)
-        *pcheck = pmeth->param_check;
-}
-
-void EVP_PKEY_meth_get_digest_custom(const EVP_PKEY_METHOD *pmeth,
-    int (**pdigest_custom)(EVP_PKEY_CTX *ctx,
-        EVP_MD_CTX *mctx))
-{
-    if (pdigest_custom != NULL)
-        *pdigest_custom = pmeth->digest_custom;
-}
-
 #endif /* FIPS_MODULE */
diff --git a/deps/openssl/openssl/crypto/evp/s_lib.c b/deps/openssl/openssl/crypto/evp/s_lib.c
index 23982d96204..83428977314 100644
--- a/deps/openssl/openssl/crypto/evp/s_lib.c
+++ b/deps/openssl/openssl/crypto/evp/s_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -29,7 +29,7 @@ int EVP_SKEY_export(const EVP_SKEY *skey, int selection,
     return evp_skeymgmt_export(skey->skeymgmt, skey->keydata, selection, export_cb, export_cbarg);
 }

-static EVP_SKEY *evp_skey_alloc(EVP_SKEYMGMT *skeymgmt)
+EVP_SKEY *evp_skey_alloc(EVP_SKEYMGMT *skeymgmt)
 {
     EVP_SKEY *skey;

@@ -47,8 +47,12 @@ static EVP_SKEY *evp_skey_alloc(EVP_SKEYMGMT *skeymgmt)
         ERR_raise(ERR_LIB_EVP, ERR_R_CRYPTO_LIB);
         goto err;
     }
-    skey->skeymgmt = skeymgmt;
-    return skey;
+    if (EVP_SKEYMGMT_up_ref(skeymgmt)) {
+        skey->skeymgmt = skeymgmt;
+        return skey;
+    } else {
+        goto err;
+    }

 err:
     CRYPTO_FREE_REF(&skey->references);
@@ -78,8 +82,7 @@ static EVP_SKEY *evp_skey_alloc_fetch(OSSL_LIB_CTX *libctx,
     }

     skey = evp_skey_alloc(skeymgmt);
-    if (skey == NULL)
-        EVP_SKEYMGMT_free(skeymgmt);
+    EVP_SKEYMGMT_free(skeymgmt);

     return skey;
 }
@@ -103,6 +106,25 @@ err:
     return NULL;
 }

+EVP_SKEY *EVP_SKEY_import_SKEYMGMT(OSSL_LIB_CTX *libctx, EVP_SKEYMGMT *skeymgmt,
+    int selection, const OSSL_PARAM *params)
+{
+    EVP_SKEY *skey = evp_skey_alloc(skeymgmt);
+
+    if (skey == NULL)
+        return NULL;
+
+    skey->keydata = evp_skeymgmt_import(skey->skeymgmt, selection, params);
+    if (skey->keydata == NULL)
+        goto err;
+
+    return skey;
+
+err:
+    EVP_SKEY_free(skey);
+    return NULL;
+}
+
 EVP_SKEY *EVP_SKEY_generate(OSSL_LIB_CTX *libctx, const char *skeymgmtname,
     const char *propquery, const OSSL_PARAM *params)
 {
@@ -174,7 +196,7 @@ int EVP_SKEY_up_ref(EVP_SKEY *skey)
 {
     int i;

-    if (CRYPTO_UP_REF(&skey->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&skey->references, &i))
         return 0;

     REF_PRINT_COUNT("EVP_SKEY", i, skey);
@@ -265,11 +287,15 @@ EVP_SKEY *EVP_SKEY_to_provider(EVP_SKEY *skey, OSSL_LIB_CTX *libctx,
     }

     if (prov != NULL) {
-        if (skey->skeymgmt->prov == prov)
+        if (skey->skeymgmt->prov == prov) {
             skeymgmt = skey->skeymgmt;
-        else
+            /* Balance the short-circuit free below */
+            if (!EVP_SKEYMGMT_up_ref(skeymgmt))
+                goto err;
+        } else {
             skeymgmt = evp_skeymgmt_fetch_from_prov(prov, skey->skeymgmt->type_name,
                 propquery);
+        }
     } else {
         /* If no provider, get the default skeymgmt */
         skeymgmt = EVP_SKEYMGMT_fetch(libctx, skey->skeymgmt->type_name,
@@ -304,6 +330,9 @@ EVP_SKEY *EVP_SKEY_to_provider(EVP_SKEY *skey, OSSL_LIB_CTX *libctx,

     ret->keydata = ctx.keydata;

+    /* Balance the local reference obtained earlier (fetch or alias up_ref) */
+    EVP_SKEYMGMT_free(skeymgmt);
+
     return ret;

 err:
@@ -311,3 +340,49 @@ err:
     EVP_SKEY_free(ret);
     return NULL;
 }
+
+int EVP_SKEY_get0_local_keyid(const EVP_SKEY *skey,
+    const unsigned char **id, size_t *len)
+{
+    if (skey == NULL || id == NULL || len == NULL) {
+        ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+
+    if (skey->skeymgmt->get_local_keyid == NULL)
+        return 0;
+
+    return skey->skeymgmt->get_local_keyid(skey->keydata, id, len);
+}
+
+int EVP_SKEY_get0_algorithm_id(const EVP_SKEY *skey,
+    const unsigned char **oid, size_t *oid_len,
+    const unsigned char **params, size_t *params_len)
+{
+    int ret_oid = 0, ret_params = 0;
+
+    if (skey == NULL) {
+        ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+
+    if (skey->skeymgmt->get_algorithm_id == NULL)
+        return 0;
+
+    if (oid != NULL && oid_len != NULL)
+        ret_oid = 1;
+    if (params != NULL && params_len != NULL)
+        ret_params = 1;
+
+    if (ret_oid == 0 && ret_params == 0)
+        return 0;
+
+    if (ret_oid == 0 && (oid != NULL || oid_len != NULL))
+        return 0;
+
+    if (ret_params == 0 && (params != NULL || params_len != NULL))
+        return 0;
+
+    return skey->skeymgmt->get_algorithm_id(skey->keydata,
+        oid, oid_len, params, params_len);
+}
diff --git a/deps/openssl/openssl/crypto/evp/signature.c b/deps/openssl/openssl/crypto/evp/signature.c
index 85560ec4fde..6c6aad7e92d 100644
--- a/deps/openssl/openssl/crypto/evp/signature.c
+++ b/deps/openssl/openssl/crypto/evp/signature.c
@@ -22,12 +22,26 @@

 static void evp_signature_free(void *data)
 {
-    EVP_SIGNATURE_free(data);
+    EVP_SIGNATURE *signature = (EVP_SIGNATURE *)data;
+    int i;
+
+    if (signature == NULL)
+        return;
+    CRYPTO_DOWN_REF(&signature->refcnt, &i);
+    if (i > 0)
+        return;
+    OPENSSL_free(signature->type_name);
+    ossl_provider_free(signature->prov);
+    CRYPTO_FREE_REF(&signature->refcnt);
+    OPENSSL_free(signature);
 }

 static int evp_signature_up_ref(void *data)
 {
-    return EVP_SIGNATURE_up_ref(data);
+    EVP_SIGNATURE *signature = (EVP_SIGNATURE *)data;
+    int ref = 0;
+
+    return CRYPTO_UP_REF(&signature->refcnt, &ref);
 }

 static EVP_SIGNATURE *evp_signature_new(OSSL_PROVIDER *prov)
@@ -51,7 +65,7 @@ static EVP_SIGNATURE *evp_signature_new(OSSL_PROVIDER *prov)

 static void *evp_signature_from_algorithm(int name_id,
     const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov)
+    OSSL_PROVIDER *prov, int no_store)
 {
     const OSSL_DISPATCH *fns = algodef->implementation;
     EVP_SIGNATURE *signature = NULL;
@@ -70,6 +84,7 @@ static void *evp_signature_from_algorithm(int name_id,
     }

     signature->name_id = name_id;
+    signature->no_store = no_store;
     if ((signature->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
         goto err;
     signature->description = algodef->algorithm_description;
@@ -448,31 +463,29 @@ static void *evp_signature_from_algorithm(int name_id,

     return signature;
 err:
-    EVP_SIGNATURE_free(signature);
+    evp_signature_free(signature);
     return NULL;
 }

 void EVP_SIGNATURE_free(EVP_SIGNATURE *signature)
 {
-    int i;
-
-    if (signature == NULL)
-        return;
-    CRYPTO_DOWN_REF(&signature->refcnt, &i);
-    if (i > 0)
-        return;
-    OPENSSL_free(signature->type_name);
-    ossl_provider_free(signature->prov);
-    CRYPTO_FREE_REF(&signature->refcnt);
-    OPENSSL_free(signature);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    evp_signature_free(signature);
+#else
+    if (signature != NULL && (signature->no_store != 0))
+        evp_signature_free(signature);
+#endif
 }

 int EVP_SIGNATURE_up_ref(EVP_SIGNATURE *signature)
 {
-    int ref = 0;
-
-    CRYPTO_UP_REF(&signature->refcnt, &ref);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    return evp_signature_up_ref(signature);
+#else
+    if (signature->no_store != 0)
+        return evp_signature_up_ref(signature);
     return 1;
+#endif
 }

 OSSL_PROVIDER *EVP_SIGNATURE_get0_provider(const EVP_SIGNATURE *signature)
@@ -506,6 +519,12 @@ int EVP_SIGNATURE_is_a(const EVP_SIGNATURE *signature, const char *name)
         && evp_is_a(signature->prov, signature->name_id, NULL, name);
 }

+int EVP_SIGNATURE_has_message_update(const EVP_SIGNATURE *signature)
+{
+    return signature->verify_message_update != NULL
+        && signature->sign_message_update != NULL;
+}
+
 int evp_signature_get_number(const EVP_SIGNATURE *signature)
 {
     return signature->name_id;
@@ -526,8 +545,12 @@ void EVP_SIGNATURE_do_all_provided(OSSL_LIB_CTX *libctx,
         void *arg),
     void *arg)
 {
+    struct EVP_SIGNATURE_do_all_provided_thunk t;
+
+    t.fn = fn;
+    t.arg = arg;
     evp_generic_do_all(libctx, OSSL_OP_SIGNATURE,
-        (void (*)(void *, void *))fn, arg,
+        EVP_SIGNATURE_do_all_provided_thunk, &t,
         evp_signature_from_algorithm,
         evp_signature_up_ref,
         evp_signature_free);
@@ -674,7 +697,7 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, EVP_SIGNATURE *signature,
         ERR_set_mark();

         if (evp_pkey_ctx_is_legacy(ctx))
-            goto legacy;
+            goto notsupported;

         if (ctx->pkey == NULL) {
             ERR_clear_last_mark();
@@ -741,7 +764,7 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, EVP_SIGNATURE *signature,
                 signature = evp_signature_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
                     supported_sig, ctx->propquery);
                 if (signature == NULL)
-                    goto legacy;
+                    goto notsupported;
                 break;
             }
             if (signature == NULL)
@@ -769,7 +792,7 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, EVP_SIGNATURE *signature,

         if (provkey == NULL) {
             EVP_SIGNATURE_free(signature);
-            goto legacy;
+            goto notsupported;
         }

         ERR_pop_to_mark();
@@ -845,7 +868,7 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, EVP_SIGNATURE *signature,
     }
     goto end;

-legacy:
+notsupported:
     /*
      * If we don't have the full support we need with provided methods,
      * let's go see if legacy does.
@@ -854,37 +877,9 @@ legacy:
     EVP_KEYMGMT_free(tmp_keymgmt);
     tmp_keymgmt = NULL;

-    if (ctx->pmeth == NULL
-        || (operation == EVP_PKEY_OP_SIGN && ctx->pmeth->sign == NULL)
-        || (operation == EVP_PKEY_OP_VERIFY && ctx->pmeth->verify == NULL)
-        || (operation == EVP_PKEY_OP_VERIFYRECOVER
-            && ctx->pmeth->verify_recover == NULL)) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
-        return -2;
-    }
+    ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
+    return -2;

-    switch (operation) {
-    case EVP_PKEY_OP_SIGN:
-        if (ctx->pmeth->sign_init == NULL)
-            return 1;
-        ret = ctx->pmeth->sign_init(ctx);
-        break;
-    case EVP_PKEY_OP_VERIFY:
-        if (ctx->pmeth->verify_init == NULL)
-            return 1;
-        ret = ctx->pmeth->verify_init(ctx);
-        break;
-    case EVP_PKEY_OP_VERIFYRECOVER:
-        if (ctx->pmeth->verify_recover_init == NULL)
-            return 1;
-        ret = ctx->pmeth->verify_recover_init(ctx);
-        break;
-    default:
-        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
-        goto err;
-    }
-    if (ret <= 0)
-        goto err;
 end:
 #ifndef FIPS_MODULE
     if (ret > 0)
@@ -1006,8 +1001,10 @@ int EVP_PKEY_sign(EVP_PKEY_CTX *ctx,
         return -1;
     }

-    if (ctx->op.sig.algctx == NULL)
-        goto legacy;
+    if (ctx->op.sig.algctx == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
+        return -2;
+    }

     signature = ctx->op.sig.signature;
     desc = signature->description != NULL ? signature->description : "";
@@ -1023,14 +1020,6 @@ int EVP_PKEY_sign(EVP_PKEY_CTX *ctx,
         ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
             "%s sign:%s", signature->type_name, desc);
     return ret;
-legacy:
-
-    if (ctx->pmeth == NULL || ctx->pmeth->sign == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
-        return -2;
-    }
-
-    M_check_autoarg(ctx, sig, siglen, EVP_F_EVP_PKEY_SIGN) return ctx->pmeth->sign(ctx, sig, siglen, tbs, tbslen);
 }

 int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx)
@@ -1159,8 +1148,10 @@ int EVP_PKEY_verify(EVP_PKEY_CTX *ctx,
         return -1;
     }

-    if (ctx->op.sig.algctx == NULL)
-        goto legacy;
+    if (ctx->op.sig.algctx == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
+        return -2;
+    }

     signature = ctx->op.sig.signature;
     desc = signature->description != NULL ? signature->description : "";
@@ -1177,13 +1168,6 @@ int EVP_PKEY_verify(EVP_PKEY_CTX *ctx,
             "%s verify:%s", signature->type_name, desc);

     return ret;
-legacy:
-    if (ctx->pmeth == NULL || ctx->pmeth->verify == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
-        return -2;
-    }
-
-    return ctx->pmeth->verify(ctx, sig, siglen, tbs, tbslen);
 }

 int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx)
@@ -1221,8 +1205,10 @@ int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx,
         return -1;
     }

-    if (ctx->op.sig.algctx == NULL)
-        goto legacy;
+    if (ctx->op.sig.algctx == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
+        return -2;
+    }

     signature = ctx->op.sig.signature;
     desc = signature->description != NULL ? signature->description : "";
@@ -1238,10 +1224,4 @@ int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx,
         ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
             "%s verify_recover:%s", signature->type_name, desc);
     return ret;
-legacy:
-    if (ctx->pmeth == NULL || ctx->pmeth->verify_recover == NULL) {
-        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
-        return -2;
-    }
-    M_check_autoarg(ctx, rout, routlen, EVP_F_EVP_PKEY_VERIFY_RECOVER) return ctx->pmeth->verify_recover(ctx, rout, routlen, sig, siglen);
 }
diff --git a/deps/openssl/openssl/crypto/evp/skeymgmt_meth.c b/deps/openssl/openssl/crypto/evp/skeymgmt_meth.c
index 46ea0c54434..6d27ec54e39 100644
--- a/deps/openssl/openssl/crypto/evp/skeymgmt_meth.c
+++ b/deps/openssl/openssl/crypto/evp/skeymgmt_meth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,6 +17,8 @@
 #include "crypto/evp.h"
 #include "evp_local.h"

+static void evp_skeymgmt_free(void *s);
+
 void *evp_skeymgmt_generate(const EVP_SKEYMGMT *skeymgmt, const OSSL_PARAM params[])
 {
     void *provctx = ossl_provider_ctx(EVP_SKEYMGMT_get0_provider(skeymgmt));
@@ -52,7 +54,7 @@ static void *skeymgmt_new(void)
     if ((skeymgmt = OPENSSL_zalloc(sizeof(*skeymgmt))) == NULL)
         return NULL;
     if (!CRYPTO_NEW_REF(&skeymgmt->refcnt, 1)) {
-        EVP_SKEYMGMT_free(skeymgmt);
+        evp_skeymgmt_free(skeymgmt);
         return NULL;
     }
     return skeymgmt;
@@ -60,7 +62,7 @@ static void *skeymgmt_new(void)

 static void *skeymgmt_from_algorithm(int name_id,
     const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov)
+    OSSL_PROVIDER *prov, int no_store)
 {
     const OSSL_DISPATCH *fns = algodef->implementation;
     EVP_SKEYMGMT *skeymgmt = NULL;
@@ -69,8 +71,9 @@ static void *skeymgmt_from_algorithm(int name_id,
         return NULL;

     skeymgmt->name_id = name_id;
+    skeymgmt->no_store = no_store;
     if ((skeymgmt->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
-        EVP_SKEYMGMT_free(skeymgmt);
+        evp_skeymgmt_free(skeymgmt);
         return NULL;
     }
     skeymgmt->description = algodef->algorithm_description;
@@ -97,6 +100,14 @@ static void *skeymgmt_from_algorithm(int name_id,
             if (skeymgmt->get_key_id == NULL)
                 skeymgmt->get_key_id = OSSL_FUNC_skeymgmt_get_key_id(fns);
             break;
+        case OSSL_FUNC_SKEYMGMT_GET_LOCAL_KEYID:
+            if (skeymgmt->get_local_keyid == NULL)
+                skeymgmt->get_local_keyid = OSSL_FUNC_skeymgmt_get_local_keyid(fns);
+            break;
+        case OSSL_FUNC_SKEYMGMT_GET_ALGORITHM_ID:
+            if (skeymgmt->get_algorithm_id == NULL)
+                skeymgmt->get_algorithm_id = OSSL_FUNC_skeymgmt_get_algorithm_id(fns);
+            break;
         case OSSL_FUNC_SKEYMGMT_IMP_SETTABLE_PARAMS:
             if (skeymgmt->imp_params == NULL)
                 skeymgmt->imp_params = OSSL_FUNC_skeymgmt_imp_settable_params(fns);
@@ -112,13 +123,13 @@ static void *skeymgmt_from_algorithm(int name_id,
     if (skeymgmt->free == NULL
         || skeymgmt->import == NULL
         || skeymgmt->export == NULL) {
-        EVP_SKEYMGMT_free(skeymgmt);
+        evp_skeymgmt_free(skeymgmt);
         ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
         return NULL;
     }

     if (!ossl_provider_up_ref(prov)) {
-        EVP_SKEYMGMT_free(skeymgmt);
+        evp_skeymgmt_free(skeymgmt);
         ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
         return NULL;
     }
@@ -127,6 +138,31 @@ static void *skeymgmt_from_algorithm(int name_id,
     return skeymgmt;
 }

+static int evp_skeymgmt_up_ref(void *s)
+{
+    EVP_SKEYMGMT *skeymgmt = (EVP_SKEYMGMT *)s;
+    int ref = 0;
+
+    return CRYPTO_UP_REF(&skeymgmt->refcnt, &ref);
+}
+
+static void evp_skeymgmt_free(void *s)
+{
+    EVP_SKEYMGMT *skeymgmt = (EVP_SKEYMGMT *)s;
+    int ref = 0;
+
+    if (skeymgmt == NULL)
+        return;
+
+    CRYPTO_DOWN_REF(&skeymgmt->refcnt, &ref);
+    if (ref > 0)
+        return;
+    OPENSSL_free(skeymgmt->type_name);
+    ossl_provider_free(skeymgmt->prov);
+    CRYPTO_FREE_REF(&skeymgmt->refcnt);
+    OPENSSL_free(skeymgmt);
+}
+
 EVP_SKEYMGMT *evp_skeymgmt_fetch_from_prov(OSSL_PROVIDER *prov,
     const char *name,
     const char *properties)
@@ -135,8 +171,8 @@ EVP_SKEYMGMT *evp_skeymgmt_fetch_from_prov(OSSL_PROVIDER *prov,
         OSSL_OP_SKEYMGMT,
         name, properties,
         skeymgmt_from_algorithm,
-        (int (*)(void *))EVP_SKEYMGMT_up_ref,
-        (void (*)(void *))EVP_SKEYMGMT_free);
+        evp_skeymgmt_up_ref,
+        evp_skeymgmt_free);
 }

 EVP_SKEYMGMT *EVP_SKEYMGMT_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
@@ -144,32 +180,29 @@ EVP_SKEYMGMT *EVP_SKEYMGMT_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
 {
     return evp_generic_fetch(ctx, OSSL_OP_SKEYMGMT, algorithm, properties,
         skeymgmt_from_algorithm,
-        (int (*)(void *))EVP_SKEYMGMT_up_ref,
-        (void (*)(void *))EVP_SKEYMGMT_free);
+        evp_skeymgmt_up_ref,
+        evp_skeymgmt_free);
 }

 int EVP_SKEYMGMT_up_ref(EVP_SKEYMGMT *skeymgmt)
 {
-    int ref = 0;
-
-    CRYPTO_UP_REF(&skeymgmt->refcnt, &ref);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    return evp_skeymgmt_up_ref(skeymgmt);
+#else
+    if (skeymgmt->no_store != 0)
+        return evp_skeymgmt_up_ref(skeymgmt);
     return 1;
+#endif
 }

 void EVP_SKEYMGMT_free(EVP_SKEYMGMT *skeymgmt)
 {
-    int ref = 0;
-
-    if (skeymgmt == NULL)
-        return;
-
-    CRYPTO_DOWN_REF(&skeymgmt->refcnt, &ref);
-    if (ref > 0)
-        return;
-    OPENSSL_free(skeymgmt->type_name);
-    ossl_provider_free(skeymgmt->prov);
-    CRYPTO_FREE_REF(&skeymgmt->refcnt);
-    OPENSSL_free(skeymgmt);
+#ifdef OPENSSL_NO_CACHED_FETCH
+    evp_skeymgmt_free(skeymgmt);
+#else
+    if (skeymgmt != NULL && (skeymgmt->no_store != 0))
+        evp_skeymgmt_free(skeymgmt);
+#endif
 }

 const OSSL_PROVIDER *EVP_SKEYMGMT_get0_provider(const EVP_SKEYMGMT *skeymgmt)
@@ -197,11 +230,15 @@ void EVP_SKEYMGMT_do_all_provided(OSSL_LIB_CTX *libctx,
     void (*fn)(EVP_SKEYMGMT *skeymgmt, void *arg),
     void *arg)
 {
+    struct EVP_SKEYMGMT_do_all_provided_thunk t;
+
+    t.fn = fn;
+    t.arg = arg;
     evp_generic_do_all(libctx, OSSL_OP_SKEYMGMT,
-        (void (*)(void *, void *))fn, arg,
+        EVP_SKEYMGMT_do_all_provided_thunk, &t,
         skeymgmt_from_algorithm,
-        (int (*)(void *))EVP_SKEYMGMT_up_ref,
-        (void (*)(void *))EVP_SKEYMGMT_free);
+        evp_skeymgmt_up_ref,
+        evp_skeymgmt_free);
 }

 int EVP_SKEYMGMT_names_do_all(const EVP_SKEYMGMT *skeymgmt,
diff --git a/deps/openssl/openssl/crypto/ex_data.c b/deps/openssl/openssl/crypto/ex_data.c
index 8efe0277b72..cd443bd4b93 100644
--- a/deps/openssl/openssl/crypto/ex_data.c
+++ b/deps/openssl/openssl/crypto/ex_data.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -239,7 +239,7 @@ int ossl_crypto_new_ex_data_ex(OSSL_LIB_CTX *ctx, int class_index, void *obj,
         if (mx < (int)OSSL_NELEM(stack))
             storage = stack;
         else
-            storage = OPENSSL_malloc(sizeof(*storage) * mx);
+            storage = OPENSSL_malloc_array(mx, sizeof(*storage));
         if (storage != NULL)
             for (i = 0; i < mx; i++)
                 storage[i] = sk_EX_CALLBACK_value(ip->meth, i);
@@ -301,7 +301,7 @@ int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
         if (mx < (int)OSSL_NELEM(stack))
             storage = stack;
         else
-            storage = OPENSSL_malloc(sizeof(*storage) * mx);
+            storage = OPENSSL_malloc_array(mx, sizeof(*storage));
         if (storage != NULL)
             for (i = 0; i < mx; i++)
                 storage[i] = sk_EX_CALLBACK_value(ip->meth, i);
@@ -385,7 +385,7 @@ void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
         if (mx < (int)OSSL_NELEM(stack))
             storage = stack;
         else
-            storage = OPENSSL_malloc(sizeof(*storage) * mx);
+            storage = OPENSSL_malloc_array(mx, sizeof(*storage));
         if (storage != NULL)
             for (i = 0; i < mx; i++) {
                 storage[i].excb = sk_EX_CALLBACK_value(ip->meth, i);
@@ -500,8 +500,3 @@ void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
         return NULL;
     return sk_void_value(ad->sk, idx);
 }
-
-OSSL_LIB_CTX *ossl_crypto_ex_data_get_ossl_lib_ctx(const CRYPTO_EX_DATA *ad)
-{
-    return ad->ctx;
-}
diff --git a/deps/openssl/openssl/crypto/ffc/ffc_backend.c b/deps/openssl/openssl/crypto/ffc/ffc_backend.c
index fa3182bc80a..cc54d38b0b6 100644
--- a/deps/openssl/openssl/crypto/ffc/ffc_backend.c
+++ b/deps/openssl/openssl/crypto/ffc/ffc_backend.c
@@ -12,9 +12,9 @@
 #include "internal/sizes.h"

 /*
- * The intention with the "backend" source file is to offer backend support
- * for legacy backends (EVP_PKEY_ASN1_METHOD and EVP_PKEY_METHOD) and provider
- * implementations alike.
+ * The intention with the "backend" source file is to offer backend functions
+ * for legacy backends (EVP_PKEY_ASN1_METHOD) and provider implementations
+ * alike.
  */

 int ossl_ffc_params_fromdata(FFC_PARAMS *ffc, const OSSL_PARAM params[])
diff --git a/deps/openssl/openssl/crypto/ffc/ffc_params.c b/deps/openssl/openssl/crypto/ffc/ffc_params.c
index ce0f7e08c97..4f8da4c4ed0 100644
--- a/deps/openssl/openssl/crypto/ffc/ffc_params.c
+++ b/deps/openssl/openssl/crypto/ffc/ffc_params.c
@@ -12,6 +12,7 @@
 #include "internal/ffc.h"
 #include "internal/param_build_set.h"
 #include "internal/nelem.h"
+#include "internal/zeroization.h"

 #ifndef FIPS_MODULE
 #include <openssl/asn1.h> /* ossl_ffc_params_print */
@@ -27,34 +28,27 @@ void ossl_ffc_params_init(FFC_PARAMS *params)

 void ossl_ffc_params_cleanup(FFC_PARAMS *params)
 {
-#ifdef OPENSSL_PEDANTIC_ZEROIZATION
-    BN_clear_free(params->p);
-    BN_clear_free(params->q);
-    BN_clear_free(params->g);
-    BN_clear_free(params->j);
-    OPENSSL_clear_free(params->seed, params->seedlen);
-#else
-    BN_free(params->p);
-    BN_free(params->q);
-    BN_free(params->g);
-    BN_free(params->j);
-    OPENSSL_free(params->seed);
-#endif
+    ossl_public_bn_free(params->p);
+    ossl_public_bn_free(params->q);
+    ossl_public_bn_free(params->g);
+    ossl_public_bn_free(params->j);
+    ossl_public_param_free(params->seed, params->seedlen);
+
     ossl_ffc_params_init(params);
 }

 void ossl_ffc_params_set0_pqg(FFC_PARAMS *d, BIGNUM *p, BIGNUM *q, BIGNUM *g)
 {
     if (p != NULL && p != d->p) {
-        BN_free(d->p);
+        ossl_public_bn_free(d->p);
         d->p = p;
     }
     if (q != NULL && q != d->q) {
-        BN_free(d->q);
+        ossl_public_bn_free(d->q);
         d->q = q;
     }
     if (g != NULL && g != d->g) {
-        BN_free(d->g);
+        ossl_public_bn_free(d->g);
         d->g = g;
     }
 }
@@ -73,7 +67,7 @@ void ossl_ffc_params_get0_pqg(const FFC_PARAMS *d, const BIGNUM **p,
 /* j is the 'cofactor' that is optionally output for ASN1. */
 void ossl_ffc_params_set0_j(FFC_PARAMS *d, BIGNUM *j)
 {
-    BN_free(d->j);
+    ossl_public_bn_free(d->j);
     d->j = NULL;
     if (j != NULL)
         d->j = j;
@@ -85,7 +79,7 @@ int ossl_ffc_params_set_seed(FFC_PARAMS *params,
     if (params->seed != NULL) {
         if (params->seed == seed)
             return 1;
-        OPENSSL_free(params->seed);
+        ossl_public_param_free(params->seed, params->seedlen);
     }

     if (seed != NULL && seedlen > 0) {
@@ -172,7 +166,7 @@ static int ffc_bn_cpy(BIGNUM **dst, const BIGNUM *src)
         a = (BIGNUM *)src;
     else if ((a = BN_dup(src)) == NULL)
         return 0;
-    BN_clear_free(*dst);
+    ossl_public_bn_free(*dst);
     *dst = a;
     return 1;
 }
@@ -189,7 +183,7 @@ int ossl_ffc_params_copy(FFC_PARAMS *dst, const FFC_PARAMS *src)

     dst->mdname = src->mdname;
     dst->mdprops = src->mdprops;
-    OPENSSL_free(dst->seed);
+    ossl_public_param_free(dst->seed, dst->seedlen);
     dst->seedlen = src->seedlen;
     if (src->seed != NULL) {
         dst->seed = OPENSSL_memdup(src->seed, src->seedlen);
@@ -217,33 +211,34 @@ int ossl_ffc_params_cmp(const FFC_PARAMS *a, const FFC_PARAMS *b, int ignore_q)
 }

 int ossl_ffc_params_todata(const FFC_PARAMS *ffc, OSSL_PARAM_BLD *bld,
-    OSSL_PARAM params[])
+    const FFC_OSSL_PARAMS *pp)
 {
     int test_flags;

+#define PP(f) (pp == NULL ? NULL : pp->f)
     if (ffc->p != NULL
-        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_P, ffc->p))
+        && !ossl_param_build_set_bn(bld, PP(p), OSSL_PKEY_PARAM_FFC_P, ffc->p))
         return 0;
     if (ffc->q != NULL
-        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_Q, ffc->q))
+        && !ossl_param_build_set_bn(bld, PP(q), OSSL_PKEY_PARAM_FFC_Q, ffc->q))
         return 0;
     if (ffc->g != NULL
-        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_G, ffc->g))
+        && !ossl_param_build_set_bn(bld, PP(g), OSSL_PKEY_PARAM_FFC_G, ffc->g))
         return 0;
     if (ffc->j != NULL
-        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_COFACTOR,
-            ffc->j))
+        && !ossl_param_build_set_bn(bld, PP(cofactor),
+            OSSL_PKEY_PARAM_FFC_COFACTOR, ffc->j))
         return 0;
-    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_GINDEX,
+    if (!ossl_param_build_set_int(bld, PP(g_index), OSSL_PKEY_PARAM_FFC_GINDEX,
             ffc->gindex))
         return 0;
-    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_PCOUNTER,
+    if (!ossl_param_build_set_int(bld, PP(p_counter), OSSL_PKEY_PARAM_FFC_PCOUNTER,
             ffc->pcounter))
         return 0;
-    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_H, ffc->h))
+    if (!ossl_param_build_set_int(bld, PP(h), OSSL_PKEY_PARAM_FFC_H, ffc->h))
         return 0;
     if (ffc->seed != NULL
-        && !ossl_param_build_set_octet_string(bld, params,
+        && !ossl_param_build_set_octet_string(bld, PP(seed),
             OSSL_PKEY_PARAM_FFC_SEED,
             ffc->seed, ffc->seedlen))
         return 0;
@@ -252,35 +247,36 @@ int ossl_ffc_params_todata(const FFC_PARAMS *ffc, OSSL_PARAM_BLD *bld,
         const char *name = ossl_ffc_named_group_get_name(group);

         if (name == NULL
-            || !ossl_param_build_set_utf8_string(bld, params,
+            || !ossl_param_build_set_utf8_string(bld, PP(group_name),
                 OSSL_PKEY_PARAM_GROUP_NAME,
                 name))
             return 0;
     }
     test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_PQ) != 0);
-    if (!ossl_param_build_set_int(bld, params,
+    if (!ossl_param_build_set_int(bld, PP(validate_pq),
             OSSL_PKEY_PARAM_FFC_VALIDATE_PQ, test_flags))
         return 0;
     test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_G) != 0);
-    if (!ossl_param_build_set_int(bld, params,
+    if (!ossl_param_build_set_int(bld, PP(validate_g),
             OSSL_PKEY_PARAM_FFC_VALIDATE_G, test_flags))
         return 0;
     test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_LEGACY) != 0);
-    if (!ossl_param_build_set_int(bld, params,
+    if (!ossl_param_build_set_int(bld, PP(validate_legacy),
             OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY,
             test_flags))
         return 0;

     if (ffc->mdname != NULL
-        && !ossl_param_build_set_utf8_string(bld, params,
+        && !ossl_param_build_set_utf8_string(bld, PP(digest),
             OSSL_PKEY_PARAM_FFC_DIGEST,
             ffc->mdname))
         return 0;
     if (ffc->mdprops != NULL
-        && !ossl_param_build_set_utf8_string(bld, params,
+        && !ossl_param_build_set_utf8_string(bld, PP(propq),
             OSSL_PKEY_PARAM_FFC_DIGEST_PROPS,
             ffc->mdprops))
         return 0;
+#undef PP
     return 1;
 }

@@ -304,7 +300,7 @@ int ossl_ffc_params_print(BIO *bp, const FFC_PARAMS *ffc, int indent)
             || BIO_puts(bp, "seed:") <= 0)
             goto err;
         for (i = 0; i < ffc->seedlen; i++) {
-            if ((i % 15) == 0) {
+            if ((i % 16) == 0) {
                 if (BIO_puts(bp, "\n") <= 0
                     || !BIO_indent(bp, indent + 4, 128))
                     goto err;
diff --git a/deps/openssl/openssl/crypto/ffc/ffc_params_generate.c b/deps/openssl/openssl/crypto/ffc/ffc_params_generate.c
index 94b1602dd28..3e84a9ba7c1 100644
--- a/deps/openssl/openssl/crypto/ffc/ffc_params_generate.c
+++ b/deps/openssl/openssl/crypto/ffc/ffc_params_generate.c
@@ -46,7 +46,8 @@ static int ffc_validate_LN(size_t L, size_t N, int type, int verify)
         if (L == 2048 && (N == 224 || N == 256))
             return 112;
 #ifndef OPENSSL_NO_DH
-        ERR_raise(ERR_LIB_DH, DH_R_BAD_FFC_PARAMETERS);
+        ERR_raise_data(ERR_LIB_DH, DH_R_BAD_FFC_PARAMETERS,
+            "(L, N)=(%zu, %zu) should be (2048, 224) or (2048, 256)", L, N);
 #endif
     } else if (type == FFC_PARAM_TYPE_DSA) {
         /* Valid DSA L,N parameters from FIPS 186-4 Section 4.2 */
@@ -58,7 +59,10 @@ static int ffc_validate_LN(size_t L, size_t N, int type, int verify)
         if (L == 3072 && N == 256)
             return 128;
 #ifndef OPENSSL_NO_DSA
-        ERR_raise(ERR_LIB_DSA, DSA_R_BAD_FFC_PARAMETERS);
+        ERR_raise_data(ERR_LIB_DSA, DSA_R_BAD_FFC_PARAMETERS,
+            "(L, N)=(%zu, %zu) should be (1024, 160) (for verification only), "
+            "(2048, 224), (2048, 256), or (3072, 256)",
+            L, N);
 #endif
     }
     return 0;
@@ -74,7 +78,10 @@ static int ffc_validate_LN(size_t L, size_t N, int type, int verify)
         if (L == 2048 && (N == 224 || N == 256))
             return 112;
 #ifndef OPENSSL_NO_DH
-        ERR_raise(ERR_LIB_DH, DH_R_BAD_FFC_PARAMETERS);
+        ERR_raise_data(ERR_LIB_DH, DH_R_BAD_FFC_PARAMETERS,
+            "(L, N)=(%zu, %zu) should be (1024, 160), (2048, 224), or "
+            "(2048, 256)",
+            L, N);
 #endif
     } else if (type == FFC_PARAM_TYPE_DSA) {
         if (N > 512) {
@@ -91,7 +98,8 @@ static int ffc_validate_LN(size_t L, size_t N, int type, int verify)
         if (L >= 1024 && N >= 160)
             return 80;
 #ifndef OPENSSL_NO_DSA
-        ERR_raise(ERR_LIB_DSA, DSA_R_BAD_FFC_PARAMETERS);
+        ERR_raise_data(ERR_LIB_DSA, DSA_R_BAD_FFC_PARAMETERS,
+            "(L, N)=(%zu, %zu) should be at least (1024, 160)", L, N);
 #endif
     }
     return 0;
@@ -266,7 +274,7 @@ static int generate_p(BN_CTX *ctx, const EVP_MD *evpmd, int max_counter, int n,
          * X = W + 2^(L-1) where W < 2^(L-1)
          */
         if (!BN_mask_bits(W, L - 1)
-            || !BN_copy(X, W)
+            || BN_copy(X, W) == NULL
             || !BN_add(X, X, test)
             /*
              * A.1.1.2 Step (11.4) AND
@@ -563,7 +571,7 @@ int ossl_ffc_params_FIPS186_4_gen_verify(OSSL_LIB_CTX *libctx,

     if (N == 0)
         N = mdsize * 8;
-    qsize = N >> 3;
+    qsize = (int)(N >> 3);

     /*
      * A.1.1.2 Step (1) AND
@@ -667,7 +675,7 @@ int ossl_ffc_params_FIPS186_4_gen_verify(OSSL_LIB_CTX *libctx,
     }

     /* A.1.1.2 Step (11): max loop count = 4L - 1 */
-    counter = 4 * L - 1;
+    counter = (int)(4 * L - 1);
     /* Validation requires the counter to be supplied */
     if (verify) {
         /* A.1.1.3 Step (4) : if (counter > (4L -1)) return INVALID */
@@ -683,10 +691,10 @@ int ossl_ffc_params_FIPS186_4_gen_verify(OSSL_LIB_CTX *libctx,
      * A.1.1.3 Step (10)
      * n = floor(L / hash_outlen) - 1
      */
-    n = (L - 1) / (mdsize << 3);
+    n = (int)((L - 1) / (mdsize << 3));

     /* Calculate 2^(L-1): Used in step A.1.1.2 Step (11.3) */
-    if (!BN_lshift(test, BN_value_one(), L - 1))
+    if (!BN_lshift(test, BN_value_one(), (int)(L - 1)))
         goto err;

     for (;;) {
@@ -704,7 +712,7 @@ int ossl_ffc_params_FIPS186_4_gen_verify(OSSL_LIB_CTX *libctx,
             goto err;

         memcpy(seed_tmp, seed, seedlen);
-        r = generate_p(ctx, md, counter, n, seed_tmp, seedlen, q, p, L,
+        r = generate_p(ctx, md, counter, n, seed_tmp, seedlen, q, p, (int)L,
             cb, &pcounter, res);
         if (r > 0)
             break; /* found p */
@@ -905,7 +913,7 @@ int ossl_ffc_params_FIPS186_2_gen_verify(OSSL_LIB_CTX *libctx,
     if (test == NULL)
         goto err;

-    if (!BN_lshift(test, BN_value_one(), L - 1))
+    if (!BN_lshift(test, BN_value_one(), (int)(L - 1)))
         goto err;

     if (!verify) {
@@ -951,8 +959,8 @@ int ossl_ffc_params_FIPS186_2_gen_verify(OSSL_LIB_CTX *libctx,
             goto err;

         /* step 6 */
-        n = (L - 1) / 160;
-        counter = 4 * L - 1; /* Was 4096 */
+        n = (int)((L - 1) / 160);
+        counter = (int)(4 * L - 1); /* Was 4096 */
         /* Validation requires the counter to be supplied */
         if (verify) {
             if (params->pcounter > counter) {
@@ -962,7 +970,7 @@ int ossl_ffc_params_FIPS186_2_gen_verify(OSSL_LIB_CTX *libctx,
             counter = params->pcounter;
         }

-        rv = generate_p(ctx, md, counter, n, buf, qsize, q, p, L, cb,
+        rv = generate_p(ctx, md, counter, n, buf, qsize, q, p, (int)L, cb,
             &pcounter, res);
         if (rv > 0)
             break; /* found it */
diff --git a/deps/openssl/openssl/crypto/getenv.c b/deps/openssl/openssl/crypto/getenv.c
index aa01ea8af7c..5edcecb4ee5 100644
--- a/deps/openssl/openssl/crypto/getenv.c
+++ b/deps/openssl/openssl/crypto/getenv.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,7 +17,7 @@

 char *ossl_safe_getenv(const char *name)
 {
-#if defined(_WIN32) && defined(CP_UTF8) && !defined(_WIN32_WCE)
+#if defined(_WIN32) && defined(CP_UTF8)
     if (GetEnvironmentVariableW(L"OPENSSL_WIN32_UTF8", NULL, 0) != 0) {
         char *val = NULL;
         int vallen = 0;
diff --git a/deps/openssl/openssl/crypto/hashtable/hashtable.c b/deps/openssl/openssl/crypto/hashtable/hashtable.c
index 11f144f2219..1cce15ed244 100644
--- a/deps/openssl/openssl/crypto/hashtable/hashtable.c
+++ b/deps/openssl/openssl/crypto/hashtable/hashtable.c
@@ -71,7 +71,6 @@
 #include <sanitizer/tsan_interface.h>
 #endif

-#include "internal/numbers.h"
 /*
  * When we do a lookup/insert/delete, there is a high likelihood
  * that we will iterate over at least part of the neighborhood list
@@ -156,12 +155,15 @@ static struct ht_neighborhood_st *alloc_new_neighborhood_list(size_t len,
 {
     struct ht_neighborhood_st *ret;

-    ret = OPENSSL_aligned_alloc(sizeof(struct ht_neighborhood_st) * len,
+#if !defined(OPENSSL_SMALL_FOOTPRINT)
+    ret = OPENSSL_aligned_alloc_array(len, sizeof(struct ht_neighborhood_st),
         CACHE_LINE_BYTES, freeptr);

     /* fall back to regular malloc */
-    if (ret == NULL) {
-        ret = *freeptr = OPENSSL_malloc(sizeof(struct ht_neighborhood_st) * len);
+    if (ret == NULL)
+#endif
+    {
+        ret = *freeptr = OPENSSL_malloc_array(len, sizeof(struct ht_neighborhood_st));
         if (ret == NULL)
             return NULL;
     }
@@ -174,6 +176,11 @@ static void internal_free_nop(HT_VALUE *v)
     return;
 }

+static uint64_t internal_ht_hash_fn(HT_KEY *key)
+{
+    return ossl_fnv1a_hash(key->keybuf, key->keysize);
+}
+
 HT *ossl_ht_new(const HT_CONFIG *conf)
 {
     HT *new = OPENSSL_zalloc(sizeof(*new));
@@ -181,10 +188,14 @@ HT *ossl_ht_new(const HT_CONFIG *conf)
     if (new == NULL)
         return NULL;

-    new->atomic_lock = CRYPTO_THREAD_lock_new();
-    if (new->atomic_lock == NULL)
+    if (conf->lockless_reads && conf->no_rcu)
         goto err;

+    if (!conf->no_rcu) {
+        new->atomic_lock = CRYPTO_THREAD_lock_new();
+        if (new->atomic_lock == NULL)
+            goto err;
+    }
     memcpy(&new->config, conf, sizeof(*conf));

     if (new->config.init_neighborhoods != 0) {
@@ -214,18 +225,21 @@ HT *ossl_ht_new(const HT_CONFIG *conf)
         goto err;
     new->md->neighborhood_mask = new->wpd.neighborhood_len - 1;

-    new->lock = ossl_rcu_lock_new(1, conf->ctx);
-    if (new->lock == NULL)
-        goto err;
-
+    if (!conf->no_rcu) {
+        new->lock = ossl_rcu_lock_new(1, conf->ctx);
+        if (new->lock == NULL)
+            goto err;
+    }
     if (new->config.ht_hash_fn == NULL)
-        new->config.ht_hash_fn = ossl_fnv1a_hash;
+        new->config.ht_hash_fn = internal_ht_hash_fn;

     return new;

 err:
-    CRYPTO_THREAD_lock_free(new->atomic_lock);
-    ossl_rcu_lock_free(new->lock);
+    if (!conf->no_rcu) {
+        CRYPTO_THREAD_lock_free(new->atomic_lock);
+        ossl_rcu_lock_free(new->lock);
+    }
     if (new->md != NULL)
         OPENSSL_free(new->md->neighborhood_ptr_to_free);
     OPENSSL_free(new->md);
@@ -233,18 +247,27 @@ err:
     return NULL;
 }

-void ossl_ht_read_lock(HT *htable)
+int ossl_ht_read_lock(HT *htable)
 {
-    ossl_rcu_read_lock(htable->lock);
+    if (htable->config.no_rcu)
+        return 1;
+
+    return ossl_rcu_read_lock(htable->lock);
 }

 void ossl_ht_read_unlock(HT *htable)
 {
+    if (htable->config.no_rcu)
+        return;
+
     ossl_rcu_read_unlock(htable->lock);
 }

 void ossl_ht_write_lock(HT *htable)
 {
+    if (htable->config.no_rcu)
+        return;
+
     ossl_rcu_write_lock(htable->lock);
     htable->wpd.need_sync = 0;
 }
@@ -253,6 +276,9 @@ void ossl_ht_write_unlock(HT *htable)
 {
     int need_sync = htable->wpd.need_sync;

+    if (htable->config.no_rcu)
+        return;
+
     htable->wpd.need_sync = 0;
     ossl_rcu_write_unlock(htable->lock);
     if (need_sync)
@@ -300,23 +326,32 @@ static int ossl_ht_flush_internal(HT *h)

     newmd->neighborhood_mask = DEFAULT_NEIGH_LEN - 1;

-    cbi = ossl_rcu_cb_item_new();
-    if (cbi == NULL) {
-        OPENSSL_free(newmd->neighborhood_ptr_to_free);
-        OPENSSL_free(newmd);
-        return 0;
-    }
+    if (!h->config.no_rcu) {
+        cbi = ossl_rcu_cb_item_new();
+        if (cbi == NULL) {
+            OPENSSL_free(newmd->neighborhood_ptr_to_free);
+            OPENSSL_free(newmd);
+            return 0;
+        }

-    /* Swap the old and new mutable data sets */
-    oldmd = ossl_rcu_deref(&h->md);
-    ossl_rcu_assign_ptr(&h->md, &newmd);
+        /* Swap the old and new mutable data sets */
+        oldmd = ossl_rcu_deref(&h->md);
+        ossl_rcu_assign_ptr(&h->md, &newmd);
+    } else {
+        oldmd = h->md;
+        h->md = newmd;
+    }

     /* Set the number of entries to 0 */
     h->wpd.value_count = 0;
     h->wpd.neighborhood_len = DEFAULT_NEIGH_LEN;

-    ossl_rcu_call(h->lock, cbi, free_oldmd, oldmd);
-    h->wpd.need_sync = 1;
+    if (!h->config.no_rcu) {
+        ossl_rcu_call(h->lock, cbi, free_oldmd, oldmd);
+        h->wpd.need_sync = 1;
+    } else {
+        free_oldmd(oldmd);
+    }

     return 1;
 }
@@ -333,20 +368,23 @@ void ossl_ht_free(HT *h)
     if (h == NULL)
         return;

-    ossl_ht_write_lock(h);
-    flush_ok = ossl_ht_flush_internal(h);
-    ossl_ht_write_unlock(h);
-    /* Freeing the lock does a final sync for us */
-    CRYPTO_THREAD_lock_free(h->atomic_lock);
-    ossl_rcu_lock_free(h->lock);
-    if (flush_ok) {
-        OPENSSL_free(h->md->neighborhood_ptr_to_free);
-        OPENSSL_free(h->md);
-    } else {
+    if (h->config.no_rcu) {
         free_oldmd(h->md);
+    } else {
+        ossl_ht_write_lock(h);
+        flush_ok = ossl_ht_flush_internal(h);
+        ossl_ht_write_unlock(h);
+        /* Freeing the lock does a final sync for us */
+        CRYPTO_THREAD_lock_free(h->atomic_lock);
+        ossl_rcu_lock_free(h->lock);
+        if (flush_ok) {
+            OPENSSL_free(h->md->neighborhood_ptr_to_free);
+            OPENSSL_free(h->md);
+        } else {
+            free_oldmd(h->md);
+        }
     }
     OPENSSL_free(h);
-    return;
 }

 size_t ossl_ht_count(HT *h)
@@ -495,9 +533,11 @@ static int grow_hashtable(HT *h, size_t oldsize)
     /*
      * Pre allocate the rcu callback item before assigning the newmd.
      */
-    cbi = ossl_rcu_cb_item_new();
-    if (cbi == NULL)
-        goto out_free;
+    if (!h->config.no_rcu) {
+        cbi = ossl_rcu_cb_item_new();
+        if (cbi == NULL)
+            goto out_free;
+    }

     /*
      * Now that our entries are all hashed into the new bucket list
@@ -508,9 +548,14 @@ static int grow_hashtable(HT *h, size_t oldsize)
     /*
      * Now we replace the old mutable data with the new
      */
-    ossl_rcu_assign_ptr(&h->md, &newmd);
-    ossl_rcu_call(h->lock, cbi, free_old_neigh_table, oldmd);
-    h->wpd.need_sync = 1;
+    if (!h->config.no_rcu) {
+        ossl_rcu_assign_ptr(&h->md, &newmd);
+        ossl_rcu_call(h->lock, cbi, free_old_neigh_table, oldmd);
+        h->wpd.need_sync = 1;
+    } else {
+        h->md = newmd;
+        free_old_neigh_table(oldmd);
+    }
     /*
      * And we're done
      */
@@ -563,13 +608,15 @@ static int ossl_ht_insert_locked(HT *h, uint64_t hash,
     HT_VALUE *ival;
     size_t empty_idx = SIZE_MAX;
     int lockless_reads = h->config.lockless_reads;
-    CRYPTO_RCU_CB_ITEM *cbi;

     do {
         PREFETCH_NEIGHBORHOOD(md->neighborhoods[neigh_idx]);

         for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
-            ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
+            if (!h->config.no_rcu)
+                ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
+            else
+                ival = (HT_VALUE *)md->neighborhoods[neigh_idx].entries[j].value;
             if (ival == NULL) {
                 empty_idx = j;
                 /* lockless_reads implies no deletion, we can break out */
@@ -577,25 +624,37 @@ static int ossl_ht_insert_locked(HT *h, uint64_t hash,
                     goto not_found;
                 continue;
             }
-            if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
-                    &ihash, h->atomic_lock))
-                return 0;
+            if (!h->config.no_rcu) {
+                if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
+                        &ihash, h->atomic_lock))
+                    return 0;
+            } else {
+                ihash = md->neighborhoods[neigh_idx].entries[j].hash;
+            }
             if (compare_hash(hash, ihash) && match_key(&newval->value.key, &ival->key)) {
                 if (olddata == NULL) {
                     /* This would insert a duplicate -> fail */
                     return 0;
                 }
                 /* Do a replacement */
-                cbi = ossl_rcu_cb_item_new();
-                if (cbi == NULL)
-                    return 0;
-                if (!CRYPTO_atomic_store(&md->neighborhoods[neigh_idx].entries[j].hash,
-                        hash, h->atomic_lock))
-                    return 0;
-                *olddata = (HT_VALUE *)md->neighborhoods[neigh_idx].entries[j].value;
-                ossl_rcu_assign_ptr(&md->neighborhoods[neigh_idx].entries[j].value,
-                    &newval);
-                ossl_rcu_call(h->lock, cbi, free_old_ht_value, *olddata);
+                if (!h->config.no_rcu) {
+                    CRYPTO_RCU_CB_ITEM *cbi = ossl_rcu_cb_item_new();
+                    if (cbi == NULL)
+                        return 0;
+                    if (!CRYPTO_atomic_store(&md->neighborhoods[neigh_idx].entries[j].hash,
+                            hash, h->atomic_lock)) {
+                        ossl_rcu_cb_item_free(cbi);
+                        return 0;
+                    }
+                    *olddata = (HT_VALUE *)md->neighborhoods[neigh_idx].entries[j].value;
+                    ossl_rcu_assign_ptr(&md->neighborhoods[neigh_idx].entries[j].value,
+                        &newval);
+                    ossl_rcu_call(h->lock, cbi, free_old_ht_value, *olddata);
+                } else {
+                    md->neighborhoods[neigh_idx].entries[j].hash = hash;
+                    *olddata = (HT_VALUE *)md->neighborhoods[neigh_idx].entries[j].value;
+                    md->neighborhoods[neigh_idx].entries[j].value = newval;
+                }
                 h->wpd.need_sync = 1;
                 return 1;
             }
@@ -610,12 +669,17 @@ not_found:
     /* If we get to here, its just an insert */
     if (empty_idx == SIZE_MAX)
         return -1; /* out of space */
-    if (!CRYPTO_atomic_store(&md->neighborhoods[neigh_idx].entries[empty_idx].hash,
-            hash, h->atomic_lock))
-        return 0;
+    if (!h->config.no_rcu) {
+        if (!CRYPTO_atomic_store(&md->neighborhoods[neigh_idx].entries[empty_idx].hash,
+                hash, h->atomic_lock))
+            return 0;
+        ossl_rcu_assign_ptr(&md->neighborhoods[neigh_idx].entries[empty_idx].value,
+            &newval);
+    } else {
+        md->neighborhoods[neigh_idx].entries[empty_idx].hash = hash;
+        md->neighborhoods[neigh_idx].entries[empty_idx].value = newval;
+    }
     h->wpd.value_count++;
-    ossl_rcu_assign_ptr(&md->neighborhoods[neigh_idx].entries[empty_idx].value,
-        &newval);
     return 1;
 }

@@ -662,16 +726,20 @@ int ossl_ht_insert(HT *h, HT_KEY *key, HT_VALUE *data, HT_VALUE **olddata)
     if (data->value == NULL)
         goto out;

+    rc = -1;
     newval = alloc_new_value(h, key, data->value, data->type_id);
     if (newval == NULL)
         goto out;

+    if (key->cached_hash)
+        hash = key->cached_hash;
+    else
+        hash = key->cached_hash = newval->value.key.cached_hash = h->config.ht_hash_fn(key);
+
     /*
      * we have to take our lock here to prevent other changes
      * to the bucket list
      */
-    hash = h->config.ht_hash_fn(key->keybuf, key->keysize);
-
     for (i = 0;
         (rc = ossl_ht_insert_locked(h, hash, newval, olddata)) == -1
         && i <= (int)NEIGHBORHOOD_LEN;
@@ -699,23 +767,36 @@ HT_VALUE *ossl_ht_get(HT *h, HT_KEY *key)
     uint64_t ehash;
     int lockless_reads = h->config.lockless_reads;

-    hash = h->config.ht_hash_fn(key->keybuf, key->keysize);
+    if (key->cached_hash)
+        hash = key->cached_hash;
+    else
+        hash = key->cached_hash = h->config.ht_hash_fn(key);

-    md = ossl_rcu_deref(&h->md);
+    if (!h->config.no_rcu)
+        md = ossl_rcu_deref(&h->md);
+    else
+        md = h->md;
     neigh_idx = neigh_idx_start = hash & md->neighborhood_mask;
     do {
         PREFETCH_NEIGHBORHOOD(md->neighborhoods[neigh_idx]);
         for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
-            ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
+            if (!h->config.no_rcu)
+                ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
+            else
+                ival = md->neighborhoods[neigh_idx].entries[j].value;
             if (ival == NULL) {
                 if (lockless_reads)
                     /* lockless_reads implies no deletion, we can break out */
                     return NULL;
                 continue;
             }
-            if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
-                    &ehash, h->atomic_lock))
-                return NULL;
+            if (!h->config.no_rcu) {
+                if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
+                        &ehash, h->atomic_lock))
+                    return NULL;
+            } else {
+                ehash = md->neighborhoods[neigh_idx].entries[j].hash;
+            }
             if (compare_hash(hash, ehash) && match_key(&ival->value.key, key))
                 return (HT_VALUE *)ival;
         }
@@ -748,7 +829,10 @@ int ossl_ht_delete(HT *h, HT_KEY *key)
     if (h->config.lockless_reads)
         return 0;

-    hash = h->config.ht_hash_fn(key->keybuf, key->keysize);
+    if (key->cached_hash)
+        hash = key->cached_hash;
+    else
+        hash = key->cached_hash = h->config.ht_hash_fn(key);

     neigh_idx = hash & h->md->neighborhood_mask;
     PREFETCH_NEIGHBORHOOD(h->md->neighborhoods[neigh_idx]);
@@ -758,20 +842,54 @@ int ossl_ht_delete(HT *h, HT_KEY *key)
             continue;
         if (compare_hash(hash, h->md->neighborhoods[neigh_idx].entries[j].hash)
             && match_key(key, &v->value.key)) {
-            CRYPTO_RCU_CB_ITEM *cbi = ossl_rcu_cb_item_new();
-            if (cbi == NULL)
-                break;
-            if (!CRYPTO_atomic_store(&h->md->neighborhoods[neigh_idx].entries[j].hash,
-                    0, h->atomic_lock))
-                break;
+            if (!h->config.no_rcu) {
+                CRYPTO_RCU_CB_ITEM *cbi = ossl_rcu_cb_item_new();
+                if (cbi == NULL)
+                    break;
+                if (!CRYPTO_atomic_store(&h->md->neighborhoods[neigh_idx].entries[j].hash,
+                        0, h->atomic_lock)) {
+                    ossl_rcu_cb_item_free(cbi);
+                    break;
+                }
+                ossl_rcu_assign_ptr(&h->md->neighborhoods[neigh_idx].entries[j].value, &nv);
+                ossl_rcu_call(h->lock, cbi, free_old_entry, v);
+            } else {
+                h->md->neighborhoods[neigh_idx].entries[j].hash = 0;
+                h->md->neighborhoods[neigh_idx].entries[j].value = NULL;
+                free_old_entry(v);
+            }
             h->wpd.value_count--;
-            ossl_rcu_assign_ptr(&h->md->neighborhoods[neigh_idx].entries[j].value,
-                &nv);
-            ossl_rcu_call(h->lock, cbi, free_old_entry, v);
             h->wpd.need_sync = 1;
             rc = 1;
             break;
         }
     }
+
     return rc;
 }
+
+HT_VALUE *ossl_ht_deref_value(HT *h, HT_VALUE **val)
+{
+    HT_VALUE *v;
+
+    if (!h->config.no_rcu)
+        v = ossl_rcu_deref(val);
+    else
+        v = *val;
+
+    return v;
+}
+
+void *ossl_ht_inner_value(HT *h, HT_VALUE *v)
+{
+    void *inner;
+
+    if (!h->config.no_rcu) {
+        inner = v->value;
+    } else {
+        inner = v->value;
+        OPENSSL_free(v);
+    }
+
+    return inner;
+}
diff --git a/deps/openssl/openssl/crypto/hmac/hmac.c b/deps/openssl/openssl/crypto/hmac/hmac.c
index 77b97b6bef6..8eaf116926f 100644
--- a/deps/openssl/openssl/crypto/hmac/hmac.c
+++ b/deps/openssl/openssl/crypto/hmac/hmac.c
@@ -35,6 +35,9 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
     if (md != NULL && md != ctx->md && (key == NULL || len < 0))
         return 0;

+    if (impl != NULL)
+        return 0;
+
     if (md != NULL)
         ctx->md = md;
     else if (ctx->md != NULL)
@@ -51,7 +54,7 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,

 #ifdef OPENSSL_HMAC_S390X
     {
-        int ret = s390x_HMAC_init(ctx, key, len, impl);
+        int ret = s390x_HMAC_init(ctx, key, len);
         if (ret != -1) /* -1 means SW fallback */
             return ret;
     }
@@ -66,7 +69,7 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
         if (j < 0)
             return 0;
         if (j < len) {
-            if (!EVP_DigestInit_ex(ctx->md_ctx, md, impl)
+            if (!EVP_DigestInit_ex(ctx->md_ctx, md, NULL)
                 || !EVP_DigestUpdate(ctx->md_ctx, key, len)
                 || !EVP_DigestFinal_ex(ctx->md_ctx, keytmp,
                     &keytmp_length))
@@ -83,14 +86,14 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,

         for (i = 0; i < HMAC_MAX_MD_CBLOCK_SIZE; i++)
             pad[i] = 0x36 ^ keytmp[i];
-        if (!EVP_DigestInit_ex(ctx->i_ctx, md, impl)
+        if (!EVP_DigestInit_ex(ctx->i_ctx, md, NULL)
             || !EVP_DigestUpdate(ctx->i_ctx, pad,
                 EVP_MD_get_block_size(md)))
             goto err;

         for (i = 0; i < HMAC_MAX_MD_CBLOCK_SIZE; i++)
             pad[i] = 0x5c ^ keytmp[i];
-        if (!EVP_DigestInit_ex(ctx->o_ctx, md, impl)
+        if (!EVP_DigestInit_ex(ctx->o_ctx, md, NULL)
             || !EVP_DigestUpdate(ctx->o_ctx, pad,
                 EVP_MD_get_block_size(md)))
             goto err;
diff --git a/deps/openssl/openssl/crypto/hmac/hmac_local.h b/deps/openssl/openssl/crypto/hmac/hmac_local.h
index 288252ab46d..e991bece7e4 100644
--- a/deps/openssl/openssl/crypto/hmac/hmac_local.h
+++ b/deps/openssl/openssl/crypto/hmac/hmac_local.h
@@ -56,7 +56,7 @@ struct hmac_ctx_st {
 #ifdef OPENSSL_HMAC_S390X
 #define HMAC_S390X_BUF_NUM_BLOCKS 64

-int s390x_HMAC_init(HMAC_CTX *ctx, const void *key, int key_len, ENGINE *impl);
+int s390x_HMAC_init(HMAC_CTX *ctx, const void *key, int key_len);
 int s390x_HMAC_update(HMAC_CTX *ctx, const unsigned char *data, size_t len);
 int s390x_HMAC_final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
 int s390x_HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
diff --git a/deps/openssl/openssl/crypto/hmac/hmac_s390x.c b/deps/openssl/openssl/crypto/hmac/hmac_s390x.c
index cae5a6064e9..6a0287a92d4 100644
--- a/deps/openssl/openssl/crypto/hmac/hmac_s390x.c
+++ b/deps/openssl/openssl/crypto/hmac/hmac_s390x.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -10,14 +10,11 @@
 /* We need to use some engine deprecated APIs */
 #define OPENSSL_SUPPRESS_DEPRECATED

-#include "crypto/s390x_arch.h"
+#include "arch/s390x_arch.h"
 #include "hmac_local.h"
 #include "openssl/obj_mac.h"
 #include "openssl/evp.h"
 #include "openssl/err.h"
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-#include <openssl/engine.h>
-#endif

 #ifdef OPENSSL_HMAC_S390X

@@ -70,32 +67,7 @@ static void s390x_call_kmac(HMAC_CTX *ctx, const unsigned char *in, size_t len)
     ctx->plat.s390x.ikp = 1;
 }

-static int s390x_check_engine_used(const EVP_MD *md, ENGINE *impl)
-{
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    const EVP_MD *d;
-
-    if (impl != NULL) {
-        if (!ENGINE_init(impl))
-            return 0;
-    } else {
-        impl = ENGINE_get_digest_engine(EVP_MD_get_type(md));
-    }
-
-    if (impl == NULL)
-        return 0;
-
-    d = ENGINE_get_digest(impl, EVP_MD_get_type(md));
-    ENGINE_finish(impl);
-
-    if (d != NULL)
-        return 1;
-#endif
-
-    return 0;
-}
-
-int s390x_HMAC_init(HMAC_CTX *ctx, const void *key, int key_len, ENGINE *impl)
+int s390x_HMAC_init(HMAC_CTX *ctx, const void *key, int key_len)
 {
     unsigned char *key_param;
     unsigned int key_param_len;
@@ -104,11 +76,6 @@ int s390x_HMAC_init(HMAC_CTX *ctx, const void *key, int key_len, ENGINE *impl)
     if (ctx->plat.s390x.fc == 0)
         return -1; /* Not supported by kmac instruction */

-    if (s390x_check_engine_used(ctx->md, impl)) {
-        ctx->plat.s390x.fc = 0;
-        return -1; /* An engine handles the digest, disable acceleration */
-    }
-
     ctx->plat.s390x.blk_size = EVP_MD_get_block_size(ctx->md);
     if (ctx->plat.s390x.blk_size < 0)
         return 0;
@@ -116,7 +83,8 @@ int s390x_HMAC_init(HMAC_CTX *ctx, const void *key, int key_len, ENGINE *impl)
     if (ctx->plat.s390x.size != (size_t)(ctx->plat.s390x.blk_size * HMAC_S390X_BUF_NUM_BLOCKS)) {
         OPENSSL_clear_free(ctx->plat.s390x.buf, ctx->plat.s390x.size);
         ctx->plat.s390x.size = 0;
-        ctx->plat.s390x.buf = OPENSSL_zalloc(ctx->plat.s390x.blk_size * HMAC_S390X_BUF_NUM_BLOCKS);
+        ctx->plat.s390x.buf = OPENSSL_calloc(HMAC_S390X_BUF_NUM_BLOCKS,
+            ctx->plat.s390x.blk_size);
         if (ctx->plat.s390x.buf == NULL)
             return 0;
         ctx->plat.s390x.size = ctx->plat.s390x.blk_size * HMAC_S390X_BUF_NUM_BLOCKS;
@@ -167,7 +135,7 @@ int s390x_HMAC_init(HMAC_CTX *ctx, const void *key, int key_len, ENGINE *impl)
             return 0;

         if (key_len > ctx->plat.s390x.blk_size) {
-            if (!EVP_DigestInit_ex(ctx->md_ctx, ctx->md, impl)
+            if (!EVP_DigestInit_ex(ctx->md_ctx, ctx->md, NULL)
                 || !EVP_DigestUpdate(ctx->md_ctx, key, key_len)
                 || !EVP_DigestFinal_ex(ctx->md_ctx, key_param,
                     &key_param_len))
diff --git a/deps/openssl/openssl/crypto/hpke/hpke.c b/deps/openssl/openssl/crypto/hpke/hpke.c
index 2c1fe47cea3..0a301e462fb 100644
--- a/deps/openssl/openssl/crypto/hpke/hpke.c
+++ b/deps/openssl/openssl/crypto/hpke/hpke.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -149,7 +149,8 @@ static int hpke_aead_dec(OSSL_HPKE_CTX *hctx, const unsigned char *iv,
     size_t taglen;

     taglen = hctx->aead_info->taglen;
-    if (ctlen <= taglen || *ptlen < ctlen - taglen) {
+    if (ctlen <= taglen || *ptlen < ctlen - taglen
+        || aadlen > INT_MAX || ctlen > INT_MAX) {
         ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT);
         return 0;
     }
@@ -162,7 +163,7 @@ static int hpke_aead_dec(OSSL_HPKE_CTX *hctx, const unsigned char *iv,
         goto err;
     }
     if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN,
-            hctx->noncelen, NULL)
+            (int)hctx->noncelen, NULL)
         != 1) {
         ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
         goto err;
@@ -174,18 +175,18 @@ static int hpke_aead_dec(OSSL_HPKE_CTX *hctx, const unsigned char *iv,
     }
     /* Provide AAD. */
     if (aadlen != 0 && aad != NULL) {
-        if (EVP_DecryptUpdate(ctx, NULL, &len, aad, aadlen) != 1) {
+        if (EVP_DecryptUpdate(ctx, NULL, &len, aad, (int)aadlen) != 1) {
             ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
             goto err;
         }
     }
-    if (EVP_DecryptUpdate(ctx, pt, &len, ct, ctlen - taglen) != 1) {
+    if (EVP_DecryptUpdate(ctx, pt, &len, ct, (int)(ctlen - taglen)) != 1) {
         ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
         goto err;
     }
     *ptlen = len;
     if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG,
-            taglen, (void *)(ct + ctlen - taglen))) {
+            (int)taglen, (void *)(ct + ctlen - taglen))) {
         ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
         goto err;
     }
@@ -227,7 +228,8 @@ static int hpke_aead_enc(OSSL_HPKE_CTX *hctx, const unsigned char *iv,
     unsigned char tag[EVP_MAX_AEAD_TAG_LENGTH];

     taglen = hctx->aead_info->taglen;
-    if (*ctlen <= taglen || ptlen > *ctlen - taglen) {
+    if (*ctlen <= taglen || ptlen > *ctlen - taglen
+        || aadlen > INT_MAX || ptlen > INT_MAX) {
         ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT);
         return 0;
     }
@@ -244,7 +246,7 @@ static int hpke_aead_enc(OSSL_HPKE_CTX *hctx, const unsigned char *iv,
         goto err;
     }
     if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN,
-            hctx->noncelen, NULL)
+            (int)hctx->noncelen, NULL)
         != 1) {
         ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
         goto err;
@@ -256,12 +258,12 @@ static int hpke_aead_enc(OSSL_HPKE_CTX *hctx, const unsigned char *iv,
     }
     /* Provide any AAD data. */
     if (aadlen != 0 && aad != NULL) {
-        if (EVP_EncryptUpdate(ctx, NULL, &len, aad, aadlen) != 1) {
+        if (EVP_EncryptUpdate(ctx, NULL, &len, aad, (int)aadlen) != 1) {
             ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
             goto err;
         }
     }
-    if (EVP_EncryptUpdate(ctx, ct, &len, pt, ptlen) != 1) {
+    if (EVP_EncryptUpdate(ctx, ct, &len, pt, (int)ptlen) != 1) {
         ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
         goto err;
     }
@@ -273,7 +275,7 @@ static int hpke_aead_enc(OSSL_HPKE_CTX *hctx, const unsigned char *iv,
     }
     *ctlen += len;
     /* Get tag. Not a duplicate so needs to be added to the ciphertext */
-    if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, taglen, tag) != 1) {
+    if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, (int)taglen, tag) != 1) {
         ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
         goto err;
     }
diff --git a/deps/openssl/openssl/crypto/hpke/hpke_util.c b/deps/openssl/openssl/crypto/hpke/hpke_util.c
index 511e08b0c26..3ffe30ef6fd 100644
--- a/deps/openssl/openssl/crypto/hpke/hpke_util.c
+++ b/deps/openssl/openssl/crypto/hpke/hpke_util.c
@@ -193,7 +193,7 @@ const OSSL_HPKE_KEM_INFO *ossl_HPKE_KEM_INFO_find_random(OSSL_LIB_CTX *ctx)
 {
     uint32_t rval = 0;
     int err = 0;
-    size_t sz = OSSL_NELEM(hpke_kem_tab);
+    uint32_t sz = OSSL_NELEM(hpke_kem_tab);

     rval = ossl_rand_uniform_uint32(ctx, sz, &err);
     return (err == 1 ? NULL : &hpke_kem_tab[rval]);
@@ -215,7 +215,7 @@ const OSSL_HPKE_KDF_INFO *ossl_HPKE_KDF_INFO_find_random(OSSL_LIB_CTX *ctx)
 {
     uint32_t rval = 0;
     int err = 0;
-    size_t sz = OSSL_NELEM(hpke_kdf_tab);
+    uint32_t sz = OSSL_NELEM(hpke_kdf_tab);

     rval = ossl_rand_uniform_uint32(ctx, sz, &err);
     return (err == 1 ? NULL : &hpke_kdf_tab[rval]);
@@ -238,7 +238,7 @@ const OSSL_HPKE_AEAD_INFO *ossl_HPKE_AEAD_INFO_find_random(OSSL_LIB_CTX *ctx)
     uint32_t rval = 0;
     int err = 0;
     /* the minus 1 below is so we don't pick the EXPORTONLY codepoint */
-    size_t sz = OSSL_NELEM(hpke_aead_tab) - 1;
+    uint32_t sz = OSSL_NELEM(hpke_aead_tab) - 1;

     rval = ossl_rand_uniform_uint32(ctx, sz, &err);
     return (err == 1 ? NULL : &hpke_aead_tab[rval]);
diff --git a/deps/openssl/openssl/crypto/http/http_client.c b/deps/openssl/openssl/crypto/http/http_client.c
index 701efe86d2d..db0aaf6d8bd 100644
--- a/deps/openssl/openssl/crypto/http/http_client.c
+++ b/deps/openssl/openssl/crypto/http/http_client.c
@@ -665,7 +665,7 @@ next_io:
             if (rctx->state == OHS_WRITE_HDR1)
                 rctx->state = OHS_WRITE_HDR;
             rctx->pos += sz;
-            rctx->len_to_send -= sz;
+            rctx->len_to_send -= (long)sz;
             goto next_io;
         }
         if (rctx->state == OHS_WRITE_HDR) {
@@ -1242,7 +1242,7 @@ BIO *OSSL_HTTP_exchange(OSSL_HTTP_REQ_CTX *rctx, char **redirection_url)
 #endif
             ) {
                 if (rctx->server != NULL && *rctx->server != '\0') {
-                    BIO_snprintf(buf, sizeof(buf), "server=http%s://%s%s%s",
+                    snprintf(buf, sizeof(buf), "server=http%s://%s%s%s",
                         rctx->use_ssl ? "s" : "", rctx->server,
                         rctx->port != NULL ? ":" : "",
                         rctx->port != NULL ? rctx->port : "");
@@ -1251,7 +1251,7 @@ BIO *OSSL_HTTP_exchange(OSSL_HTTP_REQ_CTX *rctx, char **redirection_url)
                 if (rctx->proxy != NULL)
                     ERR_add_error_data(2, " proxy=", rctx->proxy);
                 if (err == 0) {
-                    BIO_snprintf(buf, sizeof(buf), " peer has disconnected%s",
+                    snprintf(buf, sizeof(buf), " peer has disconnected%s",
                         rctx->use_ssl ? " violating the protocol" : ", likely because it requires the use of TLS");
                     ERR_add_error_data(1, buf);
                 }
@@ -1431,6 +1431,8 @@ static char *base64encode(const void *buf, size_t len)
     size_t outl;
     char *out;

+    if (len > INT_MAX)
+        return 0;
     /* Calculate size of encoded data */
     outl = (len / 3);
     if (len % 3 > 0)
@@ -1440,7 +1442,7 @@ static char *base64encode(const void *buf, size_t len)
     if (out == NULL)
         return 0;

-    i = EVP_EncodeBlock((unsigned char *)out, buf, len);
+    i = EVP_EncodeBlock((unsigned char *)out, buf, (int)len);
     if (!ossl_assert(0 <= i && (size_t)i <= outl)) {
         OPENSSL_free(out);
         return NULL;
@@ -1506,7 +1508,7 @@ int OSSL_HTTP_proxy_connect(BIO *bio, const char *server, const char *port,
         proxyauth = OPENSSL_malloc(len + 1);
         if (proxyauth == NULL)
             goto end;
-        if (BIO_snprintf(proxyauth, len + 1, "%s:%s", proxyuser,
+        if (snprintf(proxyauth, len + 1, "%s:%s", proxyuser,
                 proxypass != NULL ? proxypass : "")
             != (int)len)
             goto proxy_end;
diff --git a/deps/openssl/openssl/crypto/http/http_err.c b/deps/openssl/openssl/crypto/http/http_err.c
deleted file mode 100644
index 8598dd1ff48..00000000000
--- a/deps/openssl/openssl/crypto/http/http_err.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/httperr.h>
-#include "crypto/httperr.h"
-
-#ifndef OPENSSL_NO_HTTP
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA HTTP_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ASN1_LEN_EXCEEDS_MAX_RESP_LEN),
-        "asn1 len exceeds max resp len" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_CONNECT_FAILURE), "connect failure" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_CONTENT_TYPE_MISMATCH),
-        "content type mismatch" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ERROR_PARSING_ASN1_LENGTH),
-        "error parsing asn1 length" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ERROR_PARSING_CONTENT_LENGTH),
-        "error parsing content length" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ERROR_PARSING_URL), "error parsing url" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ERROR_RECEIVING), "error receiving" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ERROR_SENDING), "error sending" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_FAILED_READING_DATA),
-        "failed reading data" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_HEADER_PARSE_ERROR),
-        "header parse error" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_INCONSISTENT_CONTENT_LENGTH),
-        "inconsistent content length" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_INVALID_PORT_NUMBER),
-        "invalid port number" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_INVALID_URL_PATH), "invalid url path" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_INVALID_URL_SCHEME),
-        "invalid url scheme" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_MAX_RESP_LEN_EXCEEDED),
-        "max resp len exceeded" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_MISSING_ASN1_ENCODING),
-        "missing asn1 encoding" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_MISSING_CONTENT_TYPE),
-        "missing content type" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_MISSING_REDIRECT_LOCATION),
-        "missing redirect location" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_RECEIVED_ERROR), "received error" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_RECEIVED_WRONG_HTTP_VERSION),
-        "received wrong http version" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_REDIRECTION_FROM_HTTPS_TO_HTTP),
-        "redirection from https to http" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_REDIRECTION_NOT_ENABLED),
-        "redirection not enabled" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_RESPONSE_LINE_TOO_LONG),
-        "response line too long" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_RESPONSE_PARSE_ERROR),
-        "response parse error" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_RESPONSE_TOO_MANY_HDRLINES),
-        "response too many hdrlines" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_RETRY_TIMEOUT), "retry timeout" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_SERVER_CANCELED_CONNECTION),
-        "server canceled connection" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_SOCK_NOT_SUPPORTED),
-        "sock not supported" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_STATUS_CODE_UNSUPPORTED),
-        "status code unsupported" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_TLS_NOT_ENABLED), "tls not enabled" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_TOO_MANY_REDIRECTIONS),
-        "too many redirections" },
-    { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_UNEXPECTED_CONTENT_TYPE),
-        "unexpected content type" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_HTTP_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(HTTP_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(HTTP_str_reasons);
-#endif
-    return 1;
-}
-#else
-NON_EMPTY_TRANSLATION_UNIT
-#endif
diff --git a/deps/openssl/openssl/crypto/http/http_lib.c b/deps/openssl/openssl/crypto/http/http_lib.c
index d7227f5df24..ce3a20db5bf 100644
--- a/deps/openssl/openssl/crypto/http/http_lib.c
+++ b/deps/openssl/openssl/crypto/http/http_lib.c
@@ -11,7 +11,6 @@
 #include <string.h>
 #include <openssl/http.h>
 #include <openssl/httperr.h>
-#include <openssl/bio.h> /* for BIO_snprintf() */
 #include <openssl/err.h>
 #include "internal/cryptlib.h" /* for ossl_assert() */
 #ifndef OPENSSL_NO_SOCK
@@ -80,7 +79,7 @@ int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost,
         return 0;
     }

-    /* check for optional prefix "<scheme>://" as per RFC 3986: */
+    /* check for optional prefix "<scheme>://" as per RFC 3986 */
     scheme = scheme_end = p = url;
     if (ossl_isalpha(*p)) {
         while (*p != '\0'
@@ -181,7 +180,7 @@ int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost,

         if ((*ppath = OPENSSL_malloc(buflen)) == NULL)
             goto err;
-        BIO_snprintf(*ppath, buflen, "/%s", path);
+        snprintf(*ppath, buflen, "/%s", path);
     }
     return 1;

diff --git a/deps/openssl/openssl/crypto/ia64cpuid.S b/deps/openssl/openssl/crypto/ia64cpuid.S
index a09f8556372..fa15c3b0220 100644
--- a/deps/openssl/openssl/crypto/ia64cpuid.S
+++ b/deps/openssl/openssl/crypto/ia64cpuid.S
@@ -1,4 +1,4 @@
-// Copyright 2004-2017 The OpenSSL Project Authors. All Rights Reserved.
+// Copyright 2004-2025 The OpenSSL Project Authors. All Rights Reserved.
 //
 // Licensed under the Apache License 2.0 (the "License").  You may not use
 // this file except in compliance with the License.  You can obtain a copy
@@ -49,96 +49,6 @@ OPENSSL_atomic_add:
 	br.ret.sptk.many	b0	};;
 .endp	OPENSSL_atomic_add#

-// Returns a structure comprising pointer to the top of stack of
-// the caller and pointer beyond backing storage for the current
-// register frame. The latter is required, because it might be
-// insufficient to wipe backing storage for the current frame
-// (as this procedure does), one might have to go further, toward
-// higher addresses to reach for whole "retroactively" saved
-// context...
-.global	OPENSSL_wipe_cpu#
-.proc	OPENSSL_wipe_cpu#
-.align	32
-OPENSSL_wipe_cpu:
-	.prologue
-	.fframe	0
-	.save	ar.pfs,r2
-	.save	ar.lc,r3
-{ .mib;	alloc		r2=ar.pfs,0,96,0,96
-	mov		r3=ar.lc
-	brp.loop.imp	.L_wipe_top,.L_wipe_end-16
-					};;
-{ .mii;	mov		r9=ar.bsp
-	mov		r8=pr
-	mov		ar.lc=96	};;
-	.body
-{ .mii;	add		r9=96*8-8,r9
-	mov		ar.ec=1		};;
-
-// One can sweep double as fast, but then we can't guarantee
-// that backing storage is wiped...
-.L_wipe_top:
-{ .mfi;	st8		[r9]=r0,-8
-	mov		f127=f0
-	mov		r127=r0		}
-{ .mfb;	nop.m		0
-	nop.f		0
-	br.ctop.sptk	.L_wipe_top	};;
-.L_wipe_end:
-
-{ .mfi;	mov		r11=r0
-	mov		f6=f0
-	mov		r14=r0		}
-{ .mfi;	mov		r15=r0
-	mov		f7=f0
-	mov		r16=r0		}
-{ .mfi;	mov		r17=r0
-	mov		f8=f0
-	mov		r18=r0		}
-{ .mfi;	mov		r19=r0
-	mov		f9=f0
-	mov		r20=r0		}
-{ .mfi;	mov		r21=r0
-	mov		f10=f0
-	mov		r22=r0		}
-{ .mfi;	mov		r23=r0
-	mov		f11=f0
-	mov		r24=r0		}
-{ .mfi;	mov		r25=r0
-	mov		f12=f0
-	mov		r26=r0		}
-{ .mfi;	mov		r27=r0
-	mov		f13=f0
-	mov		r28=r0		}
-{ .mfi;	mov		r29=r0
-	mov		f14=f0
-	mov		r30=r0		}
-{ .mfi;	mov		r31=r0
-	mov		f15=f0
-	nop.i		0		}
-{ .mfi;	mov		f16=f0		}
-{ .mfi;	mov		f17=f0		}
-{ .mfi;	mov		f18=f0		}
-{ .mfi;	mov		f19=f0		}
-{ .mfi;	mov		f20=f0		}
-{ .mfi;	mov		f21=f0		}
-{ .mfi;	mov		f22=f0		}
-{ .mfi;	mov		f23=f0		}
-{ .mfi;	mov		f24=f0		}
-{ .mfi;	mov		f25=f0		}
-{ .mfi;	mov		f26=f0		}
-{ .mfi;	mov		f27=f0		}
-{ .mfi;	mov		f28=f0		}
-{ .mfi;	mov		f29=f0		}
-{ .mfi;	mov		f30=f0		}
-{ .mfi;	add		r9=96*8+8,r9
-	mov		f31=f0
-	mov		pr=r8,0x1ffff	}
-{ .mib;	mov		r8=sp
-	mov		ar.lc=r3
-	br.ret.sptk	b0		};;
-.endp	OPENSSL_wipe_cpu#
-
 .global	OPENSSL_cleanse#
 .proc	OPENSSL_cleanse#
 OPENSSL_cleanse:
diff --git a/deps/openssl/openssl/crypto/idea/idea_local.h b/deps/openssl/openssl/crypto/idea/idea_local.h
index 73dcd3adbd8..ffe8f7dedd8 100644
--- a/deps/openssl/openssl/crypto/idea/idea_local.h
+++ b/deps/openssl/openssl/crypto/idea/idea_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,11 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_IDEA_IDEA_LOCAL_H)
+#define OSSL_LIBCRYPTO_IDEA_IDEA_LOCAL_H
+
+#include "internal/common.h"
+
 #define idea_mul(r, a, b, ul)                                          \
     ul = (unsigned long)a * b;                                         \
     if (ul != 0) {                                                     \
@@ -16,89 +21,6 @@
         r = (-(int)a - b + 1); /* assuming a or b is 0 and in range */ \
     }

-/* NOTE - c is not incremented as per n2l */
-#define n2ln(c, l1, l2, n)                           \
-    {                                                \
-        c += n;                                      \
-        l1 = l2 = 0;                                 \
-        switch (n) {                                 \
-        case 8:                                      \
-            l2 = ((unsigned long)(*(--(c))));        \
-        /* fall through */                           \
-        case 7:                                      \
-            l2 |= ((unsigned long)(*(--(c)))) << 8;  \
-        /* fall through */                           \
-        case 6:                                      \
-            l2 |= ((unsigned long)(*(--(c)))) << 16; \
-        /* fall through */                           \
-        case 5:                                      \
-            l2 |= ((unsigned long)(*(--(c)))) << 24; \
-        /* fall through */                           \
-        case 4:                                      \
-            l1 = ((unsigned long)(*(--(c))));        \
-        /* fall through */                           \
-        case 3:                                      \
-            l1 |= ((unsigned long)(*(--(c)))) << 8;  \
-        /* fall through */                           \
-        case 2:                                      \
-            l1 |= ((unsigned long)(*(--(c)))) << 16; \
-        /* fall through */                           \
-        case 1:                                      \
-            l1 |= ((unsigned long)(*(--(c)))) << 24; \
-        }                                            \
-    }
-
-/* NOTE - c is not incremented as per l2n */
-#define l2nn(l1, l2, c, n)                                   \
-    {                                                        \
-        c += n;                                              \
-        switch (n) {                                         \
-        case 8:                                              \
-            *(--(c)) = (unsigned char)(((l2)) & 0xff);       \
-        /* fall through */                                   \
-        case 7:                                              \
-            *(--(c)) = (unsigned char)(((l2) >> 8) & 0xff);  \
-        /* fall through */                                   \
-        case 6:                                              \
-            *(--(c)) = (unsigned char)(((l2) >> 16) & 0xff); \
-        /* fall through */                                   \
-        case 5:                                              \
-            *(--(c)) = (unsigned char)(((l2) >> 24) & 0xff); \
-        /* fall through */                                   \
-        case 4:                                              \
-            *(--(c)) = (unsigned char)(((l1)) & 0xff);       \
-        /* fall through */                                   \
-        case 3:                                              \
-            *(--(c)) = (unsigned char)(((l1) >> 8) & 0xff);  \
-        /* fall through */                                   \
-        case 2:                                              \
-            *(--(c)) = (unsigned char)(((l1) >> 16) & 0xff); \
-        /* fall through */                                   \
-        case 1:                                              \
-            *(--(c)) = (unsigned char)(((l1) >> 24) & 0xff); \
-        }                                                    \
-    }
-
-#undef n2l
-#define n2l(c, l) (l = ((unsigned long)(*((c)++))) << 24L, \
-    l |= ((unsigned long)(*((c)++))) << 16L,               \
-    l |= ((unsigned long)(*((c)++))) << 8L,                \
-    l |= ((unsigned long)(*((c)++))))
-
-#undef l2n
-#define l2n(l, c) (*((c)++) = (unsigned char)(((l) >> 24L) & 0xff), \
-    *((c)++) = (unsigned char)(((l) >> 16L) & 0xff),                \
-    *((c)++) = (unsigned char)(((l) >> 8L) & 0xff),                 \
-    *((c)++) = (unsigned char)(((l)) & 0xff))
-
-#undef s2n
-#define s2n(l, c) (*((c)++) = (unsigned char)(((l)) & 0xff), \
-    *((c)++) = (unsigned char)(((l) >> 8L) & 0xff))
-
-#undef n2s
-#define n2s(c, l) (l = ((IDEA_INT)(*((c)++))) << 8L, \
-    l |= ((IDEA_INT)(*((c)++))))
-
 #define E_IDEA(num)                       \
     x1 &= 0xffff;                         \
     idea_mul(x1, x1, *p, ul);             \
@@ -120,3 +42,5 @@
     ul = x2 ^ t0; /* do the swap to x3 */ \
     x2 = x3 ^ t1;                         \
     x3 = ul;
+
+#endif /* !defined(OSSL_LIBCRYPTO_IDEA_IDEA_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/info.c b/deps/openssl/openssl/crypto/info.c
index a0344a88769..588374f7804 100644
--- a/deps/openssl/openssl/crypto/info.c
+++ b/deps/openssl/openssl/crypto/info.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,7 @@
  * https://www.openssl.org/source/license.html
  */

+#include <stdarg.h>
 #include <openssl/crypto.h>
 #include "crypto/rand.h"
 #include "crypto/dso_conf.h"
@@ -21,16 +22,19 @@
 #endif

 #if defined(__arm__) || defined(__arm) || defined(__aarch64__)
-#include "arm_arch.h"
+#include "arch/arm_arch.h"
 #define CPU_INFO_STR_LEN 128
 #elif defined(__powerpc__) || defined(__POWERPC__) || defined(_ARCH_PPC)
-#include "crypto/ppc_arch.h"
+#include "arch/ppc_arch.h"
+#define CPU_INFO_STR_LEN 128
+#elif defined(__sparcv9) || defined(__sparcv9__)
+#include "arch/sparc_arch.h"
 #define CPU_INFO_STR_LEN 128
 #elif defined(__s390__) || defined(__s390x__)
-#include "s390x_arch.h"
+#include "arch/s390x_arch.h"
 #define CPU_INFO_STR_LEN 2048
 #elif defined(__riscv)
-#include "crypto/riscv_arch.h"
+#include "arch/riscv_arch.h"
 #define CPU_INFO_STR_LEN 2048
 #else
 #define CPU_INFO_STR_LEN 256
@@ -46,60 +50,75 @@ char ossl_cpu_info_str[CPU_INFO_STR_LEN] = "";

 static CRYPTO_ONCE init_info = CRYPTO_ONCE_STATIC_INIT;

+/*
+ * Append a printf-formatted suffix to ossl_cpu_info_str, truncating to
+ * fit.  The first call writes the base string (the buffer starts empty,
+ * so off == 0); subsequent calls extend it.
+ */
+static ossl_unused void cpu_info_append(const char *fmt, ...)
+{
+    size_t off = strlen(ossl_cpu_info_str);
+    va_list args;
+
+    if (off >= sizeof(ossl_cpu_info_str))
+        return;
+    va_start(args, fmt);
+    (void)vsnprintf(ossl_cpu_info_str + off,
+        sizeof(ossl_cpu_info_str) - off, fmt, args);
+    va_end(args);
+}
+
 DEFINE_RUN_ONCE_STATIC(init_info_strings)
 {
 #if defined(OPENSSL_CPUID_OBJ)
 #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64)
     const char *env;

-    BIO_snprintf(ossl_cpu_info_str, sizeof(ossl_cpu_info_str),
-        CPUINFO_PREFIX "OPENSSL_ia32cap=0x%.16llx:0x%.16llx:0x%.16llx:0x%.16llx:0x%.16llx",
+    cpu_info_append(CPUINFO_PREFIX
+        "OPENSSL_ia32cap=0x%.16llx:0x%.16llx:0x%.16llx:0x%.16llx:0x%.16llx",
         (unsigned long long)OPENSSL_ia32cap_P[0] | (unsigned long long)OPENSSL_ia32cap_P[1] << 32,
         (unsigned long long)OPENSSL_ia32cap_P[2] | (unsigned long long)OPENSSL_ia32cap_P[3] << 32,
         (unsigned long long)OPENSSL_ia32cap_P[4] | (unsigned long long)OPENSSL_ia32cap_P[5] << 32,
         (unsigned long long)OPENSSL_ia32cap_P[6] | (unsigned long long)OPENSSL_ia32cap_P[7] << 32,
         (unsigned long long)OPENSSL_ia32cap_P[8] | (unsigned long long)OPENSSL_ia32cap_P[9] << 32);
-
     if ((env = getenv("OPENSSL_ia32cap")) != NULL)
-        BIO_snprintf(ossl_cpu_info_str + strlen(ossl_cpu_info_str),
-            sizeof(ossl_cpu_info_str) - strlen(ossl_cpu_info_str),
-            " env:%s", env);
+        cpu_info_append(" env:%s", env);
 #elif defined(__arm__) || defined(__arm) || defined(__aarch64__)
     const char *env;

-    BIO_snprintf(ossl_cpu_info_str, sizeof(ossl_cpu_info_str),
-        CPUINFO_PREFIX "OPENSSL_armcap=0x%x", OPENSSL_armcap_P);
+    cpu_info_append(CPUINFO_PREFIX "OPENSSL_armcap=0x%x", OPENSSL_armcap_P);
     if ((env = getenv("OPENSSL_armcap")) != NULL)
-        BIO_snprintf(ossl_cpu_info_str + strlen(ossl_cpu_info_str),
-            sizeof(ossl_cpu_info_str) - strlen(ossl_cpu_info_str),
-            " env:%s", env);
+        cpu_info_append(" env:%s", env);
 #elif defined(__powerpc__) || defined(__POWERPC__) || defined(_ARCH_PPC)
     const char *env;

-    BIO_snprintf(ossl_cpu_info_str, sizeof(ossl_cpu_info_str),
-        CPUINFO_PREFIX "OPENSSL_ppccap=0x%x", OPENSSL_ppccap_P);
+    cpu_info_append(CPUINFO_PREFIX "OPENSSL_ppccap=0x%x", OPENSSL_ppccap_P);
     if ((env = getenv("OPENSSL_ppccap")) != NULL)
-        BIO_snprintf(ossl_cpu_info_str + strlen(ossl_cpu_info_str),
-            sizeof(ossl_cpu_info_str) - strlen(ossl_cpu_info_str),
-            " env:%s", env);
+        cpu_info_append(" env:%s", env);
+#elif defined(__sparcv9) || defined(__sparcv9__)
+    const char *env;
+
+    cpu_info_append(CPUINFO_PREFIX "OPENSSL_sparcv9cap=0x%x:0x%x",
+        OPENSSL_sparcv9cap_P[0], OPENSSL_sparcv9cap_P[1]);
+    if ((env = getenv("OPENSSL_sparcv9cap")) != NULL)
+        cpu_info_append(" env:%s", env);
 #elif defined(__s390__) || defined(__s390x__)
     const char *env;

-    BIO_snprintf(ossl_cpu_info_str, sizeof(ossl_cpu_info_str),
-        CPUINFO_PREFIX "OPENSSL_s390xcap="
-                       "stfle:0x%llx:0x%llx:0x%llx:0x%llx:"
-                       "kimd:0x%llx:0x%llx:"
-                       "klmd:0x%llx:0x%llx:"
-                       "km:0x%llx:0x%llx:"
-                       "kmc:0x%llx:0x%llx:"
-                       "kmac:0x%llx:0x%llx:"
-                       "kmctr:0x%llx:0x%llx:"
-                       "kmo:0x%llx:0x%llx:"
-                       "kmf:0x%llx:0x%llx:"
-                       "prno:0x%llx:0x%llx:"
-                       "kma:0x%llx:0x%llx:"
-                       "pcc:0x%llx:0x%llx:"
-                       "kdsa:0x%llx:0x%llx",
+    cpu_info_append(CPUINFO_PREFIX "OPENSSL_s390xcap="
+                                   "stfle:0x%llx:0x%llx:0x%llx:0x%llx:"
+                                   "kimd:0x%llx:0x%llx:"
+                                   "klmd:0x%llx:0x%llx:"
+                                   "km:0x%llx:0x%llx:"
+                                   "kmc:0x%llx:0x%llx:"
+                                   "kmac:0x%llx:0x%llx:"
+                                   "kmctr:0x%llx:0x%llx:"
+                                   "kmo:0x%llx:0x%llx:"
+                                   "kmf:0x%llx:0x%llx:"
+                                   "prno:0x%llx:0x%llx:"
+                                   "kma:0x%llx:0x%llx:"
+                                   "pcc:0x%llx:0x%llx:"
+                                   "kdsa:0x%llx:0x%llx",
         OPENSSL_s390xcap_P.stfle[0], OPENSSL_s390xcap_P.stfle[1],
         OPENSSL_s390xcap_P.stfle[2], OPENSSL_s390xcap_P.stfle[3],
         OPENSSL_s390xcap_P.kimd[0], OPENSSL_s390xcap_P.kimd[1],
@@ -115,63 +134,54 @@ DEFINE_RUN_ONCE_STATIC(init_info_strings)
         OPENSSL_s390xcap_P.pcc[0], OPENSSL_s390xcap_P.pcc[1],
         OPENSSL_s390xcap_P.kdsa[0], OPENSSL_s390xcap_P.kdsa[1]);
     if ((env = getenv("OPENSSL_s390xcap")) != NULL)
-        BIO_snprintf(ossl_cpu_info_str + strlen(ossl_cpu_info_str),
-            sizeof(ossl_cpu_info_str) - strlen(ossl_cpu_info_str),
-            " env:%s", env);
+        cpu_info_append(" env:%s", env);
 #elif defined(__riscv)
     const char *env;
     size_t i;

-    BIO_snprintf(ossl_cpu_info_str, sizeof(ossl_cpu_info_str),
-        CPUINFO_PREFIX "OPENSSL_riscvcap=RV"
+    cpu_info_append(CPUINFO_PREFIX "OPENSSL_riscvcap=RV"
 #if __riscv_xlen == 32
-                       "32"
+                                   "32"
 #elif __riscv_xlen == 64
-                       "64"
+                                   "64"
 #elif __riscv_xlen == 128
-                       "128"
+                                   "128"
 #endif
 #if defined(__riscv_i) && defined(__riscv_m) && defined(__riscv_a) \
     && defined(__riscv_f) && defined(__riscv_d)                    \
     && defined(__riscv_zicsr) && defined(__riscv_zifencei)
-                       "G" /* shorthand for IMAFD_Zicsr_Zifencei */
+                                   "G" /* shorthand for IMAFD_Zicsr_Zifencei */
 #else
 #ifdef __riscv_i
-                       "I"
+                                   "I"
 #endif
 #ifdef __riscv_m
-                       "M"
+                                   "M"
 #endif
 #ifdef __riscv_a
-                       "A"
+                                   "A"
 #endif
 #ifdef __riscv_f
-                       "F"
+                                   "F"
 #endif
 #ifdef __riscv_d
-                       "D"
+                                   "D"
 #endif
 #endif
 #ifdef __riscv_c
-                       "C"
+                                   "C"
 #endif
     );
     for (i = 0; i < kRISCVNumCaps; i++) {
         if (OPENSSL_riscvcap_P[RISCV_capabilities[i].index]
             & (1 << RISCV_capabilities[i].bit_offset))
             /* Match, display the name */
-            BIO_snprintf(ossl_cpu_info_str + strlen(ossl_cpu_info_str),
-                sizeof(ossl_cpu_info_str) - strlen(ossl_cpu_info_str),
-                "_%s", RISCV_capabilities[i].name);
+            cpu_info_append("_%s", RISCV_capabilities[i].name);
     }
     if (RISCV_HAS_V())
-        BIO_snprintf(ossl_cpu_info_str + strlen(ossl_cpu_info_str),
-            sizeof(ossl_cpu_info_str) - strlen(ossl_cpu_info_str),
-            " vlen:%lu", riscv_vlen());
+        cpu_info_append(" vlen:%lu", riscv_vlen());
     if ((env = getenv("OPENSSL_riscvcap")) != NULL)
-        BIO_snprintf(ossl_cpu_info_str + strlen(ossl_cpu_info_str),
-            sizeof(ossl_cpu_info_str) - strlen(ossl_cpu_info_str),
-            " env:%s", env);
+        cpu_info_append(" env:%s", env);
 #endif
 #endif

@@ -231,7 +241,7 @@ DEFINE_RUN_ONCE_STATIC(init_info_strings)
         {
             char buf[32];

-            BIO_snprintf(buf, sizeof(buf), "JITTER (%d)", jent_version());
+            snprintf(buf, sizeof(buf), "JITTER (%d)", jent_version());
             add_seeds_string(buf);
         }
 #endif
@@ -253,7 +263,7 @@ const char *OPENSSL_info(int t)
     case OPENSSL_INFO_CONFIG_DIR:
         return ossl_get_openssldir();
     case OPENSSL_INFO_ENGINES_DIR:
-        return ossl_get_enginesdir();
+        return NULL;
     case OPENSSL_INFO_MODULES_DIR:
         return ossl_get_modulesdir();
     case OPENSSL_INFO_DSO_EXTENSION:
diff --git a/deps/openssl/openssl/crypto/init.c b/deps/openssl/openssl/crypto/init.c
index 290bb0712c1..1863894b393 100644
--- a/deps/openssl/openssl/crypto/init.c
+++ b/deps/openssl/openssl/crypto/init.c
@@ -7,9 +7,6 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
 #include "internal/e_os.h"
 #include "crypto/cryptlib.h"
 #include <openssl/err.h>
@@ -19,7 +16,6 @@
 #include "crypto/evp.h"
 #include "internal/conf.h"
 #include "crypto/async.h"
-#include "crypto/engine.h"
 #include "internal/comp.h"
 #include "internal/err.h"
 #include "crypto/err.h"
@@ -33,19 +29,17 @@
 #include <openssl/cmp_util.h> /* for OSSL_CMP_log_close() */
 #include <openssl/trace.h>
 #include <openssl/ssl.h> /* for OPENSSL_INIT_(NO_)?LOAD_SSL_STRINGS */
+#include "crypto/bn.h"
 #include "crypto/ctype.h"
 #include "sslerr.h"

+#ifdef S390X_MOD_EXP
+#include "arch/s390x_arch.h"
+#endif
+
 static int stopped = 0;
 static uint64_t optsdone = 0;

-typedef struct ossl_init_stop_st OPENSSL_INIT_STOP;
-struct ossl_init_stop_st {
-    void (*handler)(void);
-    OPENSSL_INIT_STOP *next;
-};
-
-static OPENSSL_INIT_STOP *stop_handlers = NULL;
 /* Guards access to the optsdone variable on platforms without atomics */
 static CRYPTO_RWLOCK *optsdone_lock = NULL;
 /* Guards simultaneous INIT_LOAD_CONFIG calls with non-NULL settings */
@@ -54,6 +48,7 @@ static CRYPTO_THREAD_LOCAL in_init_config_local;

 static CRYPTO_ONCE base = CRYPTO_ONCE_STATIC_INIT;
 static int base_inited = 0;
+static int do_global_cleanup = 0;
 DEFINE_RUN_ONCE_STATIC(ossl_init_base)
 {
     /* no need to init trace */
@@ -88,98 +83,6 @@ err:
     return 0;
 }

-static CRYPTO_ONCE register_atexit = CRYPTO_ONCE_STATIC_INIT;
-#if !defined(OPENSSL_SYS_UEFI) && defined(_WIN32)
-static int win32atexit(void)
-{
-    OPENSSL_cleanup();
-    return 0;
-}
-#endif
-
-DEFINE_RUN_ONCE_STATIC(ossl_init_register_atexit)
-{
-#ifndef OPENSSL_NO_ATEXIT
-#ifdef OPENSSL_INIT_DEBUG
-    fprintf(stderr, "OPENSSL_INIT: ossl_init_register_atexit()\n");
-#endif
-#ifndef OPENSSL_SYS_UEFI
-#if defined(_WIN32) && !defined(__BORLANDC__)
-    /* We use _onexit() in preference because it gets called on DLL unload */
-    if (_onexit(win32atexit) == NULL)
-        return 0;
-#else
-    if (atexit(OPENSSL_cleanup) != 0)
-        return 0;
-#endif
-#endif
-#endif
-
-    return 1;
-}
-
-DEFINE_RUN_ONCE_STATIC_ALT(ossl_init_no_register_atexit,
-    ossl_init_register_atexit)
-{
-#ifdef OPENSSL_INIT_DEBUG
-    fprintf(stderr, "OPENSSL_INIT: ossl_init_no_register_atexit ok!\n");
-#endif
-    /* Do nothing in this case */
-    return 1;
-}
-
-static CRYPTO_ONCE load_crypto_nodelete = CRYPTO_ONCE_STATIC_INIT;
-DEFINE_RUN_ONCE_STATIC(ossl_init_load_crypto_nodelete)
-{
-    OSSL_TRACE(INIT, "ossl_init_load_crypto_nodelete()\n");
-
-#if !defined(OPENSSL_USE_NODELETE) \
-    && !defined(OPENSSL_NO_PINSHARED)
-#if defined(DSO_WIN32) && !defined(_WIN32_WCE)
-    {
-        HMODULE handle = NULL;
-        BOOL ret;
-
-        /* We don't use the DSO route for WIN32 because there is a better way */
-        ret = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
-                | GET_MODULE_HANDLE_EX_FLAG_PIN,
-            (void *)&base_inited, &handle);
-
-        OSSL_TRACE1(INIT,
-            "ossl_init_load_crypto_nodelete: "
-            "obtained DSO reference? %s\n",
-            (ret == TRUE ? "No!" : "Yes."));
-        return (ret == TRUE) ? 1 : 0;
-    }
-#elif !defined(DSO_NONE)
-    /*
-     * Deliberately leak a reference to ourselves. This will force the library
-     * to remain loaded until the atexit() handler is run at process exit.
-     */
-    {
-        DSO *dso;
-        void *err;
-
-        if (!err_shelve_state(&err))
-            return 0;
-
-        dso = DSO_dsobyaddr(&base_inited, DSO_FLAG_NO_UNLOAD_ON_FREE);
-        /*
-         * In case of No!, it is uncertain our exit()-handlers can still be
-         * called. After dlclose() the whole library might have been unloaded
-         * already.
-         */
-        OSSL_TRACE1(INIT, "obtained DSO reference? %s\n",
-            (dso == NULL ? "No!" : "Yes."));
-        DSO_free(dso);
-        err_unshelve_state(err);
-    }
-#endif
-#endif
-
-    return 1;
-}
-
 static CRYPTO_ONCE load_crypto_strings = CRYPTO_ONCE_STATIC_INIT;

 DEFINE_RUN_ONCE_STATIC(ossl_init_load_crypto_strings)
@@ -307,74 +210,29 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_async)
     return 1;
 }

-#ifndef OPENSSL_NO_ENGINE
-static CRYPTO_ONCE engine_openssl = CRYPTO_ONCE_STATIC_INIT;
-DEFINE_RUN_ONCE_STATIC(ossl_init_engine_openssl)
-{
-    OSSL_TRACE(INIT, "engine_load_openssl_int()\n");
-    engine_load_openssl_int();
-    return 1;
-}
-#ifndef OPENSSL_NO_RDRAND
-static CRYPTO_ONCE engine_rdrand = CRYPTO_ONCE_STATIC_INIT;
-DEFINE_RUN_ONCE_STATIC(ossl_init_engine_rdrand)
-{
-    OSSL_TRACE(INIT, "engine_load_rdrand_int()\n");
-    engine_load_rdrand_int();
-    return 1;
-}
-#endif
-static CRYPTO_ONCE engine_dynamic = CRYPTO_ONCE_STATIC_INIT;
-DEFINE_RUN_ONCE_STATIC(ossl_init_engine_dynamic)
-{
-    OSSL_TRACE(INIT, "engine_load_dynamic_int()\n");
-    engine_load_dynamic_int();
-    return 1;
-}
-#ifndef OPENSSL_NO_STATIC_ENGINE
-#ifndef OPENSSL_NO_DEVCRYPTOENG
-static CRYPTO_ONCE engine_devcrypto = CRYPTO_ONCE_STATIC_INIT;
-DEFINE_RUN_ONCE_STATIC(ossl_init_engine_devcrypto)
-{
-    OSSL_TRACE(INIT, "engine_load_devcrypto_int()\n");
-    engine_load_devcrypto_int();
-    return 1;
-}
-#endif
-#if !defined(OPENSSL_NO_PADLOCKENG)
-static CRYPTO_ONCE engine_padlock = CRYPTO_ONCE_STATIC_INIT;
-DEFINE_RUN_ONCE_STATIC(ossl_init_engine_padlock)
-{
-    OSSL_TRACE(INIT, "engine_load_padlock_int()\n");
-    engine_load_padlock_int();
-    return 1;
-}
-#endif
-#if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
-static CRYPTO_ONCE engine_capi = CRYPTO_ONCE_STATIC_INIT;
-DEFINE_RUN_ONCE_STATIC(ossl_init_engine_capi)
-{
-    OSSL_TRACE(INIT, "engine_load_capi_int()\n");
-    engine_load_capi_int();
-    return 1;
-}
-#endif
-#if !defined(OPENSSL_NO_AFALGENG)
-static CRYPTO_ONCE engine_afalg = CRYPTO_ONCE_STATIC_INIT;
-DEFINE_RUN_ONCE_STATIC(ossl_init_engine_afalg)
-{
-    OSSL_TRACE(INIT, "engine_load_afalg_int()\n");
-    engine_load_afalg_int();
-    return 1;
-}
-#endif
-#endif
-#endif
-
-void OPENSSL_cleanup(void)
+/*
+ * Global cleanup function. This is optional, and not strictly
+ * necessary to run. Operating systems have successfully been
+ * recovering memory from exiting tasks since the days when I amused
+ * myself by drawing dinosaurs in crayon on used punch cards.
+ *
+ * If we have destructor support, this function is installed and
+ * always run as a global destructor. It only does anything if
+ * someone has called OPENSSL_cleanup() before it is run.
+ *
+ * This ensures that we do the actual cleanup requested by an
+ * OPENSSL_cleanup() only after subordinate library destructors which
+ * may call into OpenSSL have run.
+ *
+ * If we do not have destructor support, then this function is not
+ * normally run, and OPENSSL_cleanup() will do nothing. If we are
+ * compiled with the compile time define of
+ * DO_NOT_SKIP_OPENSSL_CLEANUP, this function will be called
+ * directly from OPENSSL_cleanup() so that cleanup will happen
+ * when OPENSSL_cleanup() is called.
+ */
+void ossl_cleanup_destructor(void)
 {
-    OPENSSL_INIT_STOP *currhandler, *lasthandler;
-
     /*
      * At some point we should consider looking at this function with a view to
      * moving most/all of this into onfree handlers in OSSL_LIB_CTX.
@@ -384,7 +242,11 @@ void OPENSSL_cleanup(void)
     if (!base_inited)
         return;

-    /* Might be explicitly called and also by atexit */
+    /* If we have not been told to clean up, and we are invoked, return */
+    if (!do_global_cleanup)
+        return;
+
+    /* Might be explicitly called */
     if (stopped)
         return;
     stopped = 1;
@@ -395,15 +257,6 @@ void OPENSSL_cleanup(void)
      */
     OPENSSL_thread_stop();

-    currhandler = stop_handlers;
-    while (currhandler != NULL) {
-        currhandler->handler();
-        lasthandler = currhandler;
-        currhandler = currhandler->next;
-        OPENSSL_free(lasthandler);
-    }
-    stop_handlers = NULL;
-
     CRYPTO_THREAD_lock_free(optsdone_lock);
     optsdone_lock = NULL;
     CRYPTO_THREAD_lock_free(init_lock);
@@ -447,11 +300,6 @@ void OPENSSL_cleanup(void)
     OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_config_modules_free()\n");
     ossl_config_modules_free();

-#ifndef OPENSSL_NO_ENGINE
-    OSSL_TRACE(INIT, "OPENSSL_cleanup: engine_cleanup_int()\n");
-    engine_cleanup_int();
-#endif
-
 #ifndef OPENSSL_NO_DEPRECATED_3_0
     OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_store_cleanup_int()\n");
     ossl_store_cleanup_int();
@@ -485,6 +333,10 @@ void OPENSSL_cleanup(void)
     OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_trace_cleanup()\n");
     ossl_trace_cleanup();

+#ifdef S390X_MOD_EXP
+    OPENSSL_s390x_cleanup();
+#endif
+
     base_inited = 0;
 }

@@ -500,7 +352,7 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
     int aloaddone = 0;

     /* Applications depend on 0 being returned when cleanup was already done */
-    if (stopped) {
+    if (ossl_unlikely(stopped)) {
         if (!(opts & OPENSSL_INIT_BASE_ONLY))
             ERR_raise(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL);
         return 0;
@@ -519,7 +371,7 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
      * unnecessarily - but all the critical code is contained in RUN_ONCE
      * functions anyway so we are safe.
      */
-    if (CRYPTO_atomic_load(&optsdone, &tmp, NULL)) {
+    if (ossl_likely(CRYPTO_atomic_load(&optsdone, &tmp, NULL))) {
         if ((tmp & opts) == opts)
             return 1;
         aloaddone = 1;
@@ -531,15 +383,12 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
      *
      * When the caller specifies OPENSSL_INIT_BASE_ONLY, that should be the
      * *only* option specified.  With that option we return immediately after
-     * doing the requested limited initialization.  Note that
-     * err_shelve_state() called by us via ossl_init_load_crypto_nodelete()
-     * re-enters OPENSSL_init_crypto() with OPENSSL_INIT_BASE_ONLY, but with
-     * base already initialized this is a harmless NOOP.
+     * doing the requested limited initialization.
      *
      * If we remain the only caller of err_shelve_state() the recursion should
      * perhaps be removed, but if in doubt, it can be left in place.
      */
-    if (!RUN_ONCE(&base, ossl_init_base))
+    if (ossl_unlikely(!RUN_ONCE(&base, ossl_init_base)))
         return 0;

     if (opts & OPENSSL_INIT_BASE_ONLY)
@@ -557,23 +406,6 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
             return 1;
     }

-    /*
-     * Now we don't always set up exit handlers, the INIT_BASE_ONLY calls
-     * should not have the side-effect of setting up exit handlers, and
-     * therefore, this code block is below the INIT_BASE_ONLY-conditioned early
-     * return above.
-     */
-    if ((opts & OPENSSL_INIT_NO_ATEXIT) != 0) {
-        if (!RUN_ONCE_ALT(&register_atexit, ossl_init_no_register_atexit,
-                ossl_init_register_atexit))
-            return 0;
-    } else if (!RUN_ONCE(&register_atexit, ossl_init_register_atexit)) {
-        return 0;
-    }
-
-    if (!RUN_ONCE(&load_crypto_nodelete, ossl_init_load_crypto_nodelete))
-        return 0;
-
     if ((opts & OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS)
         && !RUN_ONCE_ALT(&load_crypto_strings,
             ossl_init_no_load_crypto_strings,
@@ -656,111 +488,20 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
         && !RUN_ONCE(&async, ossl_init_async))
         return 0;

-#ifndef OPENSSL_NO_ENGINE
-    if ((opts & OPENSSL_INIT_ENGINE_OPENSSL)
-        && !RUN_ONCE(&engine_openssl, ossl_init_engine_openssl))
-        return 0;
-#ifndef OPENSSL_NO_RDRAND
-    if ((opts & OPENSSL_INIT_ENGINE_RDRAND)
-        && !RUN_ONCE(&engine_rdrand, ossl_init_engine_rdrand))
-        return 0;
-#endif
-    if ((opts & OPENSSL_INIT_ENGINE_DYNAMIC)
-        && !RUN_ONCE(&engine_dynamic, ossl_init_engine_dynamic))
-        return 0;
-#ifndef OPENSSL_NO_STATIC_ENGINE
-#ifndef OPENSSL_NO_DEVCRYPTOENG
-    if ((opts & OPENSSL_INIT_ENGINE_CRYPTODEV)
-        && !RUN_ONCE(&engine_devcrypto, ossl_init_engine_devcrypto))
-        return 0;
-#endif
-#if !defined(OPENSSL_NO_PADLOCKENG)
-    if ((opts & OPENSSL_INIT_ENGINE_PADLOCK)
-        && !RUN_ONCE(&engine_padlock, ossl_init_engine_padlock))
-        return 0;
-#endif
-#if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
-    if ((opts & OPENSSL_INIT_ENGINE_CAPI)
-        && !RUN_ONCE(&engine_capi, ossl_init_engine_capi))
-        return 0;
-#endif
-#if !defined(OPENSSL_NO_AFALGENG)
-    if ((opts & OPENSSL_INIT_ENGINE_AFALG)
-        && !RUN_ONCE(&engine_afalg, ossl_init_engine_afalg))
-        return 0;
-#endif
-#endif
-    if (opts & (OPENSSL_INIT_ENGINE_ALL_BUILTIN | OPENSSL_INIT_ENGINE_OPENSSL | OPENSSL_INIT_ENGINE_AFALG)) {
-        ENGINE_register_all_complete();
-    }
-#endif
-
     if (!CRYPTO_atomic_or(&optsdone, optsdone_bits, &tmp, optsdone_lock))
         return 0;

     return 1;
 }

-int OPENSSL_atexit(void (*handler)(void))
+void OPENSSL_cleanup(void)
 {
-    OPENSSL_INIT_STOP *newhand;
-
-#if !defined(OPENSSL_USE_NODELETE) \
-    && !defined(OPENSSL_NO_PINSHARED)
-    {
-#if defined(DSO_WIN32) && !defined(_WIN32_WCE)
-        HMODULE handle = NULL;
-        BOOL ret;
-        union {
-            void *sym;
-            void (*func)(void);
-        } handlersym;
-
-        handlersym.func = handler;
-
-        /*
-         * We don't use the DSO route for WIN32 because there is a better
-         * way
-         */
-        ret = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
-                | GET_MODULE_HANDLE_EX_FLAG_PIN,
-            handlersym.sym, &handle);
-
-        if (!ret)
-            return 0;
-#elif !defined(DSO_NONE)
-        /*
-         * Deliberately leak a reference to the handler. This will force the
-         * library/code containing the handler to remain loaded until we run the
-         * atexit handler. If -znodelete has been used then this is
-         * unnecessary.
-         */
-        DSO *dso = NULL;
-        union {
-            void *sym;
-            void (*func)(void);
-        } handlersym;
-
-        handlersym.func = handler;
-
-        ERR_set_mark();
-        dso = DSO_dsobyaddr(handlersym.sym, DSO_FLAG_NO_UNLOAD_ON_FREE);
-        /* See same code above in ossl_init_base() for an explanation. */
-        OSSL_TRACE1(INIT,
-            "atexit: obtained DSO reference? %s\n",
-            (dso == NULL ? "No!" : "Yes."));
-        DSO_free(dso);
-        ERR_pop_to_mark();
-#endif
-    }
-#endif
-
-    if ((newhand = OPENSSL_malloc(sizeof(*newhand))) == NULL)
-        return 0;
-
-    newhand->handler = handler;
-    newhand->next = stop_handlers;
-    stop_handlers = newhand;
-
-    return 1;
+    do_global_cleanup = 1;
+#if defined(OSSL_CLEANUP_USING_DESTRUCTOR)
+    return;
+#endif /* defined(OSSL_CLEANUP_USING_DESTRUCTOR) */
+
+#if defined(DO_NOT_SKIP_OPENSSL_CLEANUP)
+    ossl_cleanup_destructor();
+#endif /* defined(DO_NOT_SKIP_OPENSSL_CLEANUP) */
 }
diff --git a/deps/openssl/openssl/crypto/initthread.c b/deps/openssl/openssl/crypto/initthread.c
index 22738b93310..1e1b9e69db5 100644
--- a/deps/openssl/openssl/crypto/initthread.c
+++ b/deps/openssl/openssl/crypto/initthread.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,6 +12,7 @@
 #include "crypto/cryptlib.h"
 #include "prov/providercommon.h"
 #include "internal/thread_once.h"
+#include "internal/threads_common.h"
 #include "crypto/context.h"

 #ifdef FIPS_MODULE
@@ -83,6 +84,25 @@ static GLOBAL_TEVENT_REGISTER *get_global_tevent_register(void)
 #endif

 #ifndef FIPS_MODULE
+/*
+ * Since per-thread-specific-data destructors are not universally
+ * available, i.e. not on Windows, only below CRYPTO_THREAD_LOCAL key
+ * is assumed to have destructor associated. And then an effort is made
+ * to call this single destructor on non-pthread platform[s].
+ *
+ * Initial value is "impossible". It is used as guard value to shortcut
+ * destructor for threads terminating before libcrypto is initialized or
+ * after it's de-initialized. Access to the key doesn't have to be
+ * serialized for the said threads, because they didn't use libcrypto
+ * and it doesn't matter if they pick "impossible" or dereference real
+ * key value and pull NULL past initialization in the first thread that
+ * intends to use libcrypto.
+ */
+static union {
+    long sane;
+    CRYPTO_THREAD_LOCAL value;
+} destructor_key = { -1 };
+
 static int init_thread_push_handlers(THREAD_EVENT_HANDLER **hands);
 static void init_thread_remove_handlers(THREAD_EVENT_HANDLER **handsin);
 static void init_thread_destructor(void *hands);
@@ -90,10 +110,32 @@ static int init_thread_deregister(void *arg, int all);
 #endif
 static void init_thread_stop(void *arg, THREAD_EVENT_HANDLER **hands);

+static THREAD_EVENT_HANDLER **get_thread_event_handler(OSSL_LIB_CTX *ctx)
+{
+#ifdef FIPS_MODULE
+    return CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_TEVENT_KEY, ctx);
+#else
+    if (destructor_key.sane != -1)
+        return CRYPTO_THREAD_get_local(&destructor_key.value);
+    return NULL;
+#endif
+}
+
+static int set_thread_event_handler(OSSL_LIB_CTX *ctx, THREAD_EVENT_HANDLER **hands)
+{
+#ifdef FIPS_MODULE
+    return CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_TEVENT_KEY, ctx, hands);
+#else
+    if (destructor_key.sane != -1)
+        return CRYPTO_THREAD_set_local(&destructor_key.value, hands);
+    return 0;
+#endif
+}
+
 static THREAD_EVENT_HANDLER **
-init_get_thread_local(CRYPTO_THREAD_LOCAL *local, int alloc, int keep)
+manage_thread_local(OSSL_LIB_CTX *ctx, int alloc, int keep)
 {
-    THREAD_EVENT_HANDLER **hands = CRYPTO_THREAD_get_local(local);
+    THREAD_EVENT_HANDLER **hands = get_thread_event_handler(ctx);

     if (alloc) {
         if (hands == NULL) {
@@ -101,56 +143,41 @@ init_get_thread_local(CRYPTO_THREAD_LOCAL *local, int alloc, int keep)
             if ((hands = OPENSSL_zalloc(sizeof(*hands))) == NULL)
                 return NULL;

-            if (!CRYPTO_THREAD_set_local(local, hands)) {
+            if (!set_thread_event_handler(ctx, hands)) {
                 OPENSSL_free(hands);
                 return NULL;
             }
-
 #ifndef FIPS_MODULE
             if (!init_thread_push_handlers(hands)) {
-                CRYPTO_THREAD_set_local(local, NULL);
+                set_thread_event_handler(ctx, NULL);
                 OPENSSL_free(hands);
                 return NULL;
             }
 #endif
         }
     } else if (!keep) {
-        CRYPTO_THREAD_set_local(local, NULL);
+        set_thread_event_handler(ctx, NULL);
     }

     return hands;
 }

-int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))
+static ossl_inline THREAD_EVENT_HANDLER **clear_thread_local(OSSL_LIB_CTX *ctx)
 {
+    return manage_thread_local(ctx, 0, 0);
+}

-#ifndef FIPS_MODULE
-    if (!ossl_init_thread())
-        return 0;
-#endif
-    return ossl_thread_init_local(key, cleanup);
+static ossl_inline ossl_unused THREAD_EVENT_HANDLER **fetch_thread_local(OSSL_LIB_CTX *ctx)
+{
+    return manage_thread_local(ctx, 0, 1);
 }

-#ifndef FIPS_MODULE
-/*
- * Since per-thread-specific-data destructors are not universally
- * available, i.e. not on Windows, only below CRYPTO_THREAD_LOCAL key
- * is assumed to have destructor associated. And then an effort is made
- * to call this single destructor on non-pthread platform[s].
- *
- * Initial value is "impossible". It is used as guard value to shortcut
- * destructor for threads terminating before libcrypto is initialized or
- * after it's de-initialized. Access to the key doesn't have to be
- * serialized for the said threads, because they didn't use libcrypto
- * and it doesn't matter if they pick "impossible" or dereference real
- * key value and pull NULL past initialization in the first thread that
- * intends to use libcrypto.
- */
-static union {
-    long sane;
-    CRYPTO_THREAD_LOCAL value;
-} destructor_key = { -1 };
+static ossl_inline THREAD_EVENT_HANDLER **alloc_thread_local(OSSL_LIB_CTX *ctx)
+{
+    return manage_thread_local(ctx, 1, 0);
+}

+#ifndef FIPS_MODULE
 /*
  * The thread event handler list is a thread specific linked list
  * of callback functions which are invoked in list order by the
@@ -209,24 +236,15 @@ static void init_thread_destructor(void *hands)
     OPENSSL_free(hands);
 }

-static CRYPTO_ONCE ossl_init_thread_runonce = CRYPTO_ONCE_STATIC_INIT;
-
-DEFINE_RUN_ONCE_STATIC(ossl_init_thread_once)
+int ossl_init_thread(void)
 {
-    if (!ossl_thread_init_local(&destructor_key.value,
+    if (!CRYPTO_THREAD_init_local(&destructor_key.value,
             init_thread_destructor))
         return 0;

     return 1;
 }

-int ossl_init_thread(void)
-{
-    if (!RUN_ONCE(&ossl_init_thread_runonce, ossl_init_thread_once))
-        return 0;
-    return 1;
-}
-
 void ossl_cleanup_thread(void)
 {
     init_thread_deregister(NULL, 1);
@@ -248,20 +266,22 @@ void OPENSSL_thread_stop_ex(OSSL_LIB_CTX *ctx)
 void OPENSSL_thread_stop(void)
 {
     if (destructor_key.sane != -1) {
-        THREAD_EVENT_HANDLER **hands
-            = init_get_thread_local(&destructor_key.value, 0, 0);
+        THREAD_EVENT_HANDLER **hands = clear_thread_local(NULL);
+
         init_thread_stop(NULL, hands);

         init_thread_remove_handlers(hands);
         OPENSSL_free(hands);
+
+        CRYPTO_THREAD_clean_local();
     }
 }

 void ossl_ctx_thread_stop(OSSL_LIB_CTX *ctx)
 {
     if (destructor_key.sane != -1) {
-        THREAD_EVENT_HANDLER **hands
-            = init_get_thread_local(&destructor_key.value, 0, 1);
+        THREAD_EVENT_HANDLER **hands = fetch_thread_local(ctx);
+
         init_thread_stop(ctx, hands);
     }
 }
@@ -277,22 +297,15 @@ int ossl_thread_register_fips(OSSL_LIB_CTX *libctx)
         libctx);
 }

-void *ossl_thread_event_ctx_new(OSSL_LIB_CTX *libctx)
+int ossl_thread_event_ctx_new(OSSL_LIB_CTX *libctx)
 {
     THREAD_EVENT_HANDLER **hands = NULL;
-    CRYPTO_THREAD_LOCAL *tlocal = OPENSSL_zalloc(sizeof(*tlocal));
-
-    if (tlocal == NULL)
-        return NULL;
-
-    if (!CRYPTO_THREAD_init_local(tlocal, NULL))
-        goto deinit;

     hands = OPENSSL_zalloc(sizeof(*hands));
     if (hands == NULL)
         goto err;

-    if (!CRYPTO_THREAD_set_local(tlocal, hands))
+    if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_TEVENT_KEY, libctx, hands))
         goto err;

     /*
@@ -305,19 +318,15 @@ void *ossl_thread_event_ctx_new(OSSL_LIB_CTX *libctx)
      * function.
      */

-    return tlocal;
+    return 1;
 err:
     OPENSSL_free(hands);
-    CRYPTO_THREAD_cleanup_local(tlocal);
-deinit:
-    OPENSSL_free(tlocal);
-    return NULL;
+    return 0;
 }

-void ossl_thread_event_ctx_free(void *tlocal)
+void ossl_thread_event_ctx_free(OSSL_LIB_CTX *ctx)
 {
-    CRYPTO_THREAD_cleanup_local(tlocal);
-    OPENSSL_free(tlocal);
+    CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_TEVENT_KEY, ctx, NULL);
 }

 static void ossl_arg_thread_stop(void *arg)
@@ -328,12 +337,8 @@ static void ossl_arg_thread_stop(void *arg)
 void ossl_ctx_thread_stop(OSSL_LIB_CTX *ctx)
 {
     THREAD_EVENT_HANDLER **hands;
-    CRYPTO_THREAD_LOCAL *local
-        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX);

-    if (local == NULL)
-        return;
-    hands = init_get_thread_local(local, 0, 0);
+    hands = clear_thread_local(ctx);
     init_thread_stop(ctx, hands);
     OPENSSL_free(hands);
 }
@@ -387,27 +392,19 @@ int ossl_init_thread_start(const void *index, void *arg,
 {
     THREAD_EVENT_HANDLER **hands;
     THREAD_EVENT_HANDLER *hand;
+    OSSL_LIB_CTX *ctx = NULL;
 #ifdef FIPS_MODULE
-    OSSL_LIB_CTX *ctx = arg;
-
     /*
      * In FIPS mode the list of THREAD_EVENT_HANDLERs is unique per combination
      * of OSSL_LIB_CTX and thread. This is because in FIPS mode each
      * OSSL_LIB_CTX gets informed about thread stop events individually.
      */
-    CRYPTO_THREAD_LOCAL *local
-        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX);
-#else
-    /*
-     * Outside of FIPS mode the list of THREAD_EVENT_HANDLERs is unique per
-     * thread, but may hold multiple OSSL_LIB_CTXs. We only get told about
-     * thread stop events globally, so we have to ensure all affected
-     * OSSL_LIB_CTXs are informed.
-     */
-    CRYPTO_THREAD_LOCAL *local = &destructor_key.value;
+
+    ctx = arg;
 #endif

-    hands = init_get_thread_local(local, 1, 0);
+    hands = alloc_thread_local(ctx);
+
     if (hands == NULL)
         return 0;

diff --git a/deps/openssl/openssl/crypto/lhash/lhash.c b/deps/openssl/openssl/crypto/lhash/lhash.c
index 1813d687c88..ad8c7a6280c 100644
--- a/deps/openssl/openssl/crypto/lhash/lhash.c
+++ b/deps/openssl/openssl/crypto/lhash/lhash.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -66,7 +66,7 @@ OPENSSL_LHASH *OPENSSL_LH_new(OPENSSL_LH_HASHFUNC h, OPENSSL_LH_COMPFUNC c)

     if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
         return NULL;
-    if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
+    if ((ret->b = OPENSSL_calloc(MIN_NODES, sizeof(*ret->b))) == NULL)
         goto err;
     ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
     ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
@@ -250,7 +250,7 @@ static int expand(OPENSSL_LHASH *lh)
     pmax = lh->pmax;
     if (p + 1 >= pmax) {
         j = nni * 2;
-        n = OPENSSL_realloc(lh->b, sizeof(OPENSSL_LH_NODE *) * j);
+        n = OPENSSL_realloc_array(lh->b, j, sizeof(OPENSSL_LH_NODE *));
         if (n == NULL) {
             lh->error++;
             return 0;
@@ -290,8 +290,7 @@ static void contract(OPENSSL_LHASH *lh)
     np = lh->b[lh->p + lh->pmax - 1];
     lh->b[lh->p + lh->pmax - 1] = NULL; /* 24/07-92 - eay - weird but :-( */
     if (lh->p == 0) {
-        n = OPENSSL_realloc(lh->b,
-            (unsigned int)(sizeof(OPENSSL_LH_NODE *) * lh->pmax));
+        n = OPENSSL_realloc_array(lh->b, lh->pmax, sizeof(OPENSSL_LH_NODE *));
         if (n == NULL) {
             /* fputs("realloc error in lhash", stderr); */
             lh->error++;
diff --git a/deps/openssl/openssl/crypto/lhash/lhash_local.h b/deps/openssl/openssl/crypto/lhash/lhash_local.h
index 4a7cdfb9f66..9a8a325b457 100644
--- a/deps/openssl/openssl/crypto/lhash/lhash_local.h
+++ b/deps/openssl/openssl/crypto/lhash/lhash_local.h
@@ -1,12 +1,16 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
+#if !defined(OSSL_LIBCRYPTO_LHASH_LHASH_LOCAL_H)
+#define OSSL_LIBCRYPTO_LHASH_LHASH_LOCAL_H
+
 #include <openssl/crypto.h>
+#include <openssl/lhash.h>

 #include "internal/tsan_assist.h"

@@ -33,3 +37,5 @@ struct lhash_st {
     unsigned long num_items;
     int error;
 };
+
+#endif /* !defined(OSSL_LIBCRYPTO_LHASH_LHASH_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/lms/build.info b/deps/openssl/openssl/crypto/lms/build.info
new file mode 100644
index 00000000000..36c0ca65b0f
--- /dev/null
+++ b/deps/openssl/openssl/crypto/lms/build.info
@@ -0,0 +1,9 @@
+LIBS=../../libcrypto
+
+$COMMON=lms_params.c lms_pubkey_decode.c lms_key.c lm_ots_params.c \
+        lm_ots_verify.c lms_sig.c lms_sig_decoder.c lms_verify.c
+
+IF[{- !$disabled{'lms'} -}]
+  SOURCE[../../libcrypto]=$COMMON
+  SOURCE[../../providers/libfips.a]=$COMMON
+ENDIF
diff --git a/deps/openssl/openssl/crypto/lms/lm_ots_params.c b/deps/openssl/openssl/crypto/lms/lm_ots_params.c
new file mode 100644
index 00000000000..14e36ed0680
--- /dev/null
+++ b/deps/openssl/openssl/crypto/lms/lm_ots_params.c
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "crypto/lms.h"
+#include "crypto/lms_sig.h"
+#include "crypto/lms_util.h"
+
+/* Refer to SP800-208 Section 4 LM-OTS parameter sets */
+static const LM_OTS_PARAMS lm_ots_params[] = {
+    { OSSL_LM_OTS_TYPE_SHA256_N32_W1, 32, 1, 265, 7, "SHA256" },
+    { OSSL_LM_OTS_TYPE_SHA256_N32_W2, 32, 2, 133, 6, "SHA256" },
+    { OSSL_LM_OTS_TYPE_SHA256_N32_W4, 32, 4, 67, 4, "SHA256" },
+    { OSSL_LM_OTS_TYPE_SHA256_N32_W8, 32, 8, 34, 0, "SHA256" },
+    { OSSL_LM_OTS_TYPE_SHA256_N24_W1, 24, 1, 200, 8, "SHA256-192" },
+    { OSSL_LM_OTS_TYPE_SHA256_N24_W2, 24, 2, 101, 6, "SHA256-192" },
+    { OSSL_LM_OTS_TYPE_SHA256_N24_W4, 24, 4, 51, 4, "SHA256-192" },
+    { OSSL_LM_OTS_TYPE_SHA256_N24_W8, 24, 8, 26, 0, "SHA256-192" },
+    { OSSL_LM_OTS_TYPE_SHAKE_N32_W1, 32, 1, 265, 7, "SHAKE-256" },
+    { OSSL_LM_OTS_TYPE_SHAKE_N32_W2, 32, 2, 133, 6, "SHAKE-256" },
+    { OSSL_LM_OTS_TYPE_SHAKE_N32_W4, 32, 4, 67, 4, "SHAKE-256" },
+    { OSSL_LM_OTS_TYPE_SHAKE_N32_W8, 32, 8, 34, 0, "SHAKE-256" },
+    /* SHAKE-256/192 - OpenSSL does not support this as a name */
+    { OSSL_LM_OTS_TYPE_SHAKE_N24_W1, 24, 1, 200, 8, "SHAKE-256" },
+    { OSSL_LM_OTS_TYPE_SHAKE_N24_W2, 24, 2, 101, 6, "SHAKE-256" },
+    { OSSL_LM_OTS_TYPE_SHAKE_N24_W4, 24, 4, 51, 4, "SHAKE-256" },
+    { OSSL_LM_OTS_TYPE_SHAKE_N24_W8, 24, 8, 26, 0, "SHAKE-256" },
+    { 0, 0, 0, 0, 0, NULL },
+};
+
+/**
+ * @brief A getter to convert an |ots_type| into a LM_OTS_PARAMS object.
+ *
+ * @param ots_type The type such as OSSL_LM_OTS_TYPE_SHA256_N32_W1
+ * @returns The LM_OTS_PARAMS object associated with the |ots_type|, or
+ *          NULL if |ots_type| is undefined.
+ */
+const LM_OTS_PARAMS *ossl_lm_ots_params_get(uint32_t ots_type)
+{
+    const LM_OTS_PARAMS *p;
+
+    for (p = lm_ots_params; p->digestname != NULL; ++p)
+        if (p->lm_ots_type == ots_type)
+            return p;
+    return NULL;
+}
+
+/* See RFC 8554 Section 4.4 Checksum */
+uint16_t ossl_lm_ots_params_checksum(const LM_OTS_PARAMS *params,
+    const unsigned char *S)
+{
+    uint16_t sum = 0;
+    uint16_t i;
+    /* Largest size is 8 * 32 / 1 = 256 (which doesn't quite fit into 8 bits) */
+    uint16_t bytes = (8 * params->n / params->w);
+    uint16_t end = (1 << params->w) - 1;
+
+    for (i = 0; i < bytes; ++i)
+        sum += end - lms_ots_coef(S, i, params->w);
+    return (sum << params->ls);
+}
diff --git a/deps/openssl/openssl/crypto/lms/lm_ots_verify.c b/deps/openssl/openssl/crypto/lms/lm_ots_verify.c
new file mode 100644
index 00000000000..53d36200316
--- /dev/null
+++ b/deps/openssl/openssl/crypto/lms/lm_ots_verify.c
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/evp.h>
+#include <openssl/byteorder.h>
+#include "crypto/lms_sig.h"
+#include "crypto/lms_util.h"
+
+static int lm_ots_compute_pubkey_final(EVP_MD_CTX *ctx, EVP_MD_CTX *ctxIq,
+    const LM_OTS_SIG *sig, unsigned char *Kc);
+
+/**
+ * @brief OTS Signature verification.
+ *
+ * See RFC 8554 Section 4.6 Signature Verification
+ * Algorithm 4b: Compute a Public Key Candidate |Kc| from a signature, message
+ * and public key parameters.
+ *
+ * @param ctx A temporary working EVP_MD_CTX object.
+ * @param ctxIq A EVP_MD_CTX object that has been initialised with a digest,
+ *              that returns a non finalized value of H(I || q)
+ * @param sig An LM_OTS_SIG object that contains C and y
+ * @param pub The public key LM_OTS_PARAMS
+ * @param Id A 16 byte identifier (I) associated with a LMS tree
+ * @param q The leaf index of the LMS tree.
+ * @param msg A message to verify
+ * @param msglen The size of |msg|
+ * @param Kc The computed public key candidate. It is assumed the size is n.
+ * @returns 1 on success, or 0 otherwise.
+ */
+int ossl_lm_ots_compute_pubkey(EVP_MD_CTX *ctx, EVP_MD_CTX *ctxIq,
+    const LM_OTS_SIG *sig, const LM_OTS_PARAMS *pub,
+    const unsigned char *Id, uint32_t q,
+    const unsigned char *msg, size_t msglen,
+    unsigned char *Kc)
+{
+    unsigned char qbuf[LMS_SIZE_q];
+    unsigned char d_mesg[sizeof(uint16_t)];
+
+    if (sig->params != pub)
+        return 0;
+
+    OPENSSL_store_u32_be(qbuf, q);
+    OPENSSL_store_u16_be(d_mesg, OSSL_LMS_D_MESG);
+
+    return (EVP_DigestUpdate(ctxIq, Id, LMS_SIZE_I)
+        && EVP_DigestUpdate(ctxIq, qbuf, sizeof(qbuf))
+        && EVP_MD_CTX_copy_ex(ctx, ctxIq)
+        /* Q = H(I || u32str(q) || u16str(D_MESG) || C || msg) */
+        && EVP_DigestUpdate(ctx, d_mesg, sizeof(d_mesg))
+        && EVP_DigestUpdate(ctx, sig->C, sig->params->n)
+        && EVP_DigestUpdate(ctx, msg, msglen)
+        && lm_ots_compute_pubkey_final(ctx, ctxIq, sig, Kc));
+}
+
+/**
+ * @brief simple function to increment a big-endian 16 bit counter by 1.
+ * It assumes checking for overflow is not required.
+ */
+static ossl_inline void INC16(unsigned char *tag)
+{
+    if (++(tag[1]) == 0)
+        ++tag[0];
+}
+
+/*
+ * @brief OTS signature verification final phase
+ * See RFC 8554 Section 4.3 Signature Verification
+ * Algorithm 4b - Part 3
+ * Step 3 (Finalizes Q) and 4
+ *
+ * @param ctx A EVP_MD_CTX object that contains a non finalized value of
+ *            Q = H(I || u32str(q) || u16str(D_MESG) || C || msg)
+ *            This ctx is reused for other calculations.
+ * @param ctxIq A EVP_MD_CTX object that contains a non finalized value of H(I || q).
+ * @param sig An object containing LM_OTS signature data.
+ * @param Kc The computed public key. It is assumed the size is n.
+ * @returns 1 on success, or 0 otherwise.
+ */
+static int lm_ots_compute_pubkey_final(EVP_MD_CTX *ctx, EVP_MD_CTX *ctxIq,
+    const LM_OTS_SIG *sig, unsigned char *Kc)
+{
+    int ret = 0, i;
+    EVP_MD_CTX *ctxKc = NULL;
+    unsigned char tag[2 + 1], *tag2 = &tag[2];
+    unsigned char Q[LMS_MAX_DIGEST_SIZE + LMS_SIZE_QSUM], *Qsum;
+    unsigned char z[LMS_MAX_DIGEST_SIZE];
+    unsigned char d_pblc[sizeof(uint16_t)];
+    uint16_t sum;
+    const LM_OTS_PARAMS *params = sig->params;
+    int n = params->n;
+    int p = params->p;
+    uint8_t j, w = params->w, end = (1 << w) - 1;
+    int a;
+    unsigned char *y;
+
+    if (!EVP_DigestFinal_ex(ctx, Q, NULL)
+        || (ctxKc = EVP_MD_CTX_create()) == NULL)
+        return 0;
+
+    sum = ossl_lm_ots_params_checksum(params, Q);
+    Qsum = Q + n;
+    /* Q || Cksm(Q) */
+    OPENSSL_store_u16_be(Qsum, sum);
+    OPENSSL_store_u16_be(d_pblc, OSSL_LMS_D_PBLC);
+
+    if (!(EVP_MD_CTX_copy_ex(ctxKc, ctxIq))
+        || !EVP_DigestUpdate(ctxKc, d_pblc, sizeof(d_pblc)))
+        goto err;
+
+    y = sig->y;
+    tag[0] = 0;
+    tag[1] = 0;
+
+    /*
+     * Depending on the lm_ots_type (see lm_ots_params[])
+     * The outer loop |p| ranges from 26...265 iterations and
+     * the inner loop |end| is in the range 0...(2^w)-1
+     */
+    for (i = 0; i < p; ++i) {
+        a = lms_ots_coef(Q, i, w);
+        memcpy(z, y, n);
+        y += n;
+        for (j = a; j < end; ++j) {
+            *tag2 = (j & 0xFF);
+            if (!(EVP_MD_CTX_copy_ex(ctx, ctxIq))
+                || !EVP_DigestUpdate(ctx, tag, sizeof(tag))
+                || !EVP_DigestUpdate(ctx, z, n)
+                || !EVP_DigestFinal_ex(ctx, z, NULL))
+                goto err;
+        }
+        INC16(tag);
+        if (!EVP_DigestUpdate(ctxKc, z, n))
+            goto err;
+    }
+
+    /* Kc = H(I || u32str(q) || u16str(D_PBLC) || z[0] || ... || z[p-1]) */
+    if (!EVP_DigestFinal(ctxKc, Kc, NULL))
+        goto err;
+    ret = 1;
+err:
+    EVP_MD_CTX_free(ctxKc);
+    return ret;
+}
diff --git a/deps/openssl/openssl/crypto/lms/lms_key.c b/deps/openssl/openssl/crypto/lms/lms_key.c
new file mode 100644
index 00000000000..58c2205d78a
--- /dev/null
+++ b/deps/openssl/openssl/crypto/lms/lms_key.c
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/core_dispatch.h>
+#include "crypto/lms.h"
+#include <string.h>
+
+/**
+ * @brief Create a new LMS_KEY object
+ *
+ * @param libctx A OSSL_LIB_CTX object used for fetching algorithms.
+ * @returns The new LMS_KEY object on success, or NULL on malloc failure
+ */
+LMS_KEY *ossl_lms_key_new(OSSL_LIB_CTX *libctx)
+{
+    LMS_KEY *ret = OPENSSL_zalloc(sizeof(LMS_KEY));
+
+    if (ret != NULL)
+        ret->libctx = libctx;
+    return ret;
+}
+
+/**
+ * @brief Destroy a LMS_KEY object
+ */
+void ossl_lms_key_free(LMS_KEY *lmskey)
+{
+    LMS_PUB_KEY *pub;
+
+    if (lmskey == NULL)
+        return;
+
+    pub = &lmskey->pub;
+    OPENSSL_free(pub->encoded);
+    OPENSSL_free(lmskey);
+}
+
+/**
+ * @brief Are 2 LMS public keys equal?
+ *
+ * To be equal the keys must have the same LMS_PARAMS, LM_OTS_PARAMS and
+ * encoded public keys.
+ *
+ * @param key1 A LMS_KEY object
+ * @param key2 A LMS_KEY object
+ * @param selection Only OSSL_KEYMGMT_SELECT_PUBLIC_KEY is supported
+ * @returns 1 if the keys are equal otherwise it returns 0.
+ */
+int ossl_lms_key_equal(const LMS_KEY *key1, const LMS_KEY *key2, int selection)
+{
+    int ok = 1;
+
+    if (key1->lms_params != key2->lms_params
+        || key1->ots_params != key2->ots_params)
+        return 0;
+
+    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
+        if (key1->pub.encodedlen != key2->pub.encodedlen)
+            return 0;
+        ok = (key1->pub.encodedlen == 0)
+            || (memcmp(key1->pub.encoded, key2->pub.encoded,
+                    key1->pub.encodedlen)
+                == 0);
+    }
+    return ok;
+}
+
+/**
+ * @brief Is a LMS_KEY valid.
+ *
+ * @param key A LMS_KEY object
+ * @param selection Currently only supports |OSSL_KEYMGMT_SELECT_PUBLIC_KEY|
+ * @returns 1 if a LMS_KEY contains valid key data.
+ */
+int ossl_lms_key_valid(const LMS_KEY *key, int selection)
+{
+    if (key == NULL)
+        return 0;
+
+    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
+        return key->pub.encoded != NULL && key->pub.encodedlen != 0;
+    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
+        return 0; /* a private key that doesn't exist can't be valid */
+    return 1;
+}
+
+/**
+ * @brief Does a LMS_KEY object contain a public key.
+ *
+ * @param key A LMS_KEY object
+ * @param selection Currently only supports |OSSL_KEYMGMT_SELECT_PUBLIC_KEY|
+ * @returns 1 if a LMS_KEY contains public key data, or 0 otherwise.
+ */
+int ossl_lms_key_has(const LMS_KEY *key, int selection)
+{
+    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
+        return (key != NULL) && (key->pub.K != NULL);
+    /* There is no private key currently */
+    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
+        return 0;
+    return 1;
+}
+
+/* Returns the public key data or NULL if there is no public key */
+const uint8_t *ossl_lms_key_get_pub(const LMS_KEY *key)
+{
+    return key->pub.encoded;
+}
+
+/* The encoded public key size */
+size_t ossl_lms_key_get_pub_len(const LMS_KEY *key)
+{
+    return 24 + key->lms_params->n;
+}
+
+size_t ossl_lms_key_get_collision_strength_bits(const LMS_KEY *key)
+{
+    return key->lms_params->n * 8;
+}
+
+size_t ossl_lms_key_get_sig_len(const LMS_KEY *key)
+{
+    return 12 + key->lms_params->n * (1 + key->ots_params->p + key->lms_params->h);
+}
diff --git a/deps/openssl/openssl/crypto/lms/lms_params.c b/deps/openssl/openssl/crypto/lms/lms_params.c
new file mode 100644
index 00000000000..722a41940ae
--- /dev/null
+++ b/deps/openssl/openssl/crypto/lms/lms_params.c
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "crypto/lms.h"
+
+/* Refer to SP800-208 Section 4 LMS Parameter Sets */
+static const LMS_PARAMS lms_params[] = {
+    { OSSL_LMS_TYPE_SHA256_N32_H5, "SHA256", 32, 5, 128 },
+    { OSSL_LMS_TYPE_SHA256_N32_H10, "SHA256", 32, 10, 128 },
+    { OSSL_LMS_TYPE_SHA256_N32_H15, "SHA256", 32, 15, 128 },
+    { OSSL_LMS_TYPE_SHA256_N32_H20, "SHA256", 32, 20, 128 },
+    { OSSL_LMS_TYPE_SHA256_N32_H25, "SHA256", 32, 25, 128 },
+    { OSSL_LMS_TYPE_SHA256_N24_H5, "SHA256-192", 24, 5, 96 },
+    { OSSL_LMS_TYPE_SHA256_N24_H10, "SHA256-192", 24, 10, 96 },
+    { OSSL_LMS_TYPE_SHA256_N24_H15, "SHA256-192", 24, 15, 96 },
+    { OSSL_LMS_TYPE_SHA256_N24_H20, "SHA256-192", 24, 20, 96 },
+    { OSSL_LMS_TYPE_SHA256_N24_H25, "SHA256-192", 24, 25, 96 },
+    { OSSL_LMS_TYPE_SHAKE_N32_H5, "SHAKE-256", 32, 5, 256 },
+    { OSSL_LMS_TYPE_SHAKE_N32_H10, "SHAKE-256", 32, 10, 256 },
+    { OSSL_LMS_TYPE_SHAKE_N32_H15, "SHAKE-256", 32, 15, 256 },
+    { OSSL_LMS_TYPE_SHAKE_N32_H20, "SHAKE-256", 32, 20, 256 },
+    { OSSL_LMS_TYPE_SHAKE_N32_H25, "SHAKE-256", 32, 25, 256 },
+    /* SHAKE-256/192 */
+    { OSSL_LMS_TYPE_SHAKE_N24_H5, "SHAKE-256", 24, 5, 192 },
+    { OSSL_LMS_TYPE_SHAKE_N24_H10, "SHAKE-256", 24, 10, 192 },
+    { OSSL_LMS_TYPE_SHAKE_N24_H15, "SHAKE-256", 24, 15, 192 },
+    { OSSL_LMS_TYPE_SHAKE_N24_H20, "SHAKE-256", 24, 20, 192 },
+    { OSSL_LMS_TYPE_SHAKE_N24_H25, "SHAKE-256", 24, 25, 192 },
+
+    { 0, NULL, 0, 0 }
+};
+
+/**
+ * @brief A getter to convert a |lms_type| into a LMS_PARAMS object.
+ *
+ * @param lms_type The type such as OSSL_LMS_TYPE_SHA256_N32_H5.
+ * @returns The LMS_PARAMS object associated with the |lms_type|, or
+ *          NULL if |lms_type| is undefined.
+ */
+const LMS_PARAMS *ossl_lms_params_get(uint32_t lms_type)
+{
+    const LMS_PARAMS *p;
+
+    for (p = lms_params; p->digestname != NULL; ++p)
+        if (p->lms_type == lms_type)
+            return p;
+    return NULL;
+}
diff --git a/deps/openssl/openssl/crypto/lms/lms_pubkey_decode.c b/deps/openssl/openssl/crypto/lms/lms_pubkey_decode.c
new file mode 100644
index 00000000000..0e89f089fec
--- /dev/null
+++ b/deps/openssl/openssl/crypto/lms/lms_pubkey_decode.c
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/core_names.h>
+#include "crypto/lms.h"
+#include "crypto/lms_util.h"
+
+/**
+ * @brief Calculate the size of a public key in XDR format.
+ *
+ * @param data A byte array of XDR data for a LMS public key.
+ *             The first 4 bytes are looked at.
+ * @param datalen The size of |data|.
+ * @returns The calculated size, or 0 on error.
+ */
+size_t ossl_lms_pubkey_length(const unsigned char *data, size_t datalen)
+{
+    PACKET pkt;
+    uint32_t lms_type;
+    const LMS_PARAMS *params;
+
+    if (!PACKET_buf_init(&pkt, data, datalen)
+        || !PACKET_get_net_4_len_u32(&pkt, &lms_type)
+        || (params = ossl_lms_params_get(lms_type)) == NULL)
+        return 0;
+    return LMS_SIZE_LMS_TYPE + LMS_SIZE_OTS_TYPE + LMS_SIZE_I + params->n;
+}
+
+/*
+ * @brief Decode LMS public key data in XDR format into a LMS_KEY object.
+ *
+ * See RFC 8554 Algorithm 6: Steps 1 & 2.
+ * The XDR format is lms_type[4] || ots_type[4] || I[16] || K[n]
+ * Steps that involve checking the size of the public key data are
+ * done indirectly by checking the return result of PACKET_get API's.
+ * This function may be called multiple times.
+ *
+ * @param pkt The packet to read public key data in XDR format from.
+ * @param lmskey The object to store the public key into
+ * @return 1 on success or 0 otherwise.
+ */
+static int lms_pubkey_from_pkt(LMS_KEY *lmskey, const unsigned char *pubkeydata,
+    size_t publen)
+{
+    uint32_t lms_type;
+    uint32_t ots_type;
+    LMS_PUB_KEY *key = &lmskey->pub;
+    PACKET pkt;
+
+    if (!PACKET_buf_init(&pkt, pubkeydata, publen))
+        goto err;
+    key->encoded = (unsigned char *)PACKET_data(&pkt);
+    if (!PACKET_get_net_4_len_u32(&pkt, &lms_type))
+        goto err;
+    lmskey->lms_params = ossl_lms_params_get(lms_type);
+    if (lmskey->lms_params == NULL
+        || !PACKET_get_net_4_len_u32(&pkt, &ots_type))
+        goto err;
+    lmskey->ots_params = ossl_lm_ots_params_get(ots_type);
+    if (lmskey->ots_params == NULL)
+        goto err;
+
+    /* The digest used must be the same */
+    if (HASH_NOT_MATCHED(lmskey->ots_params, lmskey->lms_params)
+        || !PACKET_get_bytes(&pkt, (const unsigned char **)&lmskey->Id,
+            LMS_SIZE_I)
+        || !PACKET_get_bytes(&pkt, (const unsigned char **)&key->K,
+            lmskey->lms_params->n))
+        goto err;
+    key->encodedlen = (unsigned char *)PACKET_data(&pkt) - key->encoded;
+    return PACKET_remaining(&pkt) == 0;
+err:
+    return 0;
+}
+
+/*
+ * @brief Decode LMS public key data in XDR format into a LMS_KEY object.
+ * Used by the LMS public key decoder.
+ * The XDR format is lms_type[4] || ots_type[4] || I[16] || K[n]
+ *
+ * @param pub byte array of public key data in XDR format.
+ * @param publen is the size of |pub|.
+ * @param lmskey The LMS_KEY object to store the public key into.
+ * @returns 1 on success, or 0 otherwise. 0 is returned if either |pub| is
+ * invalid or |publen| is not the correct size (i.e. trailing data is not allowed)
+ */
+int ossl_lms_pubkey_decode(const unsigned char *pub, size_t publen,
+    LMS_KEY *lmskey)
+{
+    LMS_PUB_KEY *pkey = &lmskey->pub;
+
+    if (pkey->encoded != NULL) {
+        OPENSSL_free(pkey->encoded);
+        pkey->encodedlen = 0;
+    }
+    pkey->encoded = OPENSSL_memdup(pub, publen);
+    if (pkey->encoded == NULL)
+        return 0;
+
+    if (!lms_pubkey_from_pkt(lmskey, pkey->encoded, publen))
+        goto err;
+    pkey->encodedlen = publen;
+    return 1;
+err:
+    OPENSSL_free(pkey->encoded);
+    pkey->encoded = NULL;
+    pkey->encodedlen = 0;
+    return 0;
+}
+
+/**
+ * @brief Load a LMS public key from OSSL_PARAM data.
+ *
+ * @param params An array of OSSL_PARAM
+ * @param lmskey The LMS_KEY to load the public key data into.
+ * @returns 1 on success, or 0 otherwise.
+ */
+int ossl_lms_pubkey_from_params(const OSSL_PARAM *pub, LMS_KEY *lmskey)
+{
+    /*
+     * An LMS_KEY with no public key material is unusable - lms_params
+     * and ots_params would remain NULL and any subsequent consumer op
+     * (lms_get_params -> ossl_lms_key_get_pub_len, lms_verify_msg_init
+     * -> setdigest, ...) would dereference NULL.  Require the caller
+     * to supply a well-formed OSSL_PKEY_PARAM_PUB_KEY.
+     */
+    if (pub == NULL
+        || pub->data == NULL
+        || pub->data_type != OSSL_PARAM_OCTET_STRING
+        || !ossl_lms_pubkey_decode(pub->data, pub->data_size, lmskey))
+        return 0;
+    return 1;
+}
diff --git a/deps/openssl/openssl/crypto/lms/lms_sig.c b/deps/openssl/openssl/crypto/lms/lms_sig.c
new file mode 100644
index 00000000000..7c1c8b226c4
--- /dev/null
+++ b/deps/openssl/openssl/crypto/lms/lms_sig.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "crypto/lms_sig.h"
+
+/**
+ * @brief Create a new LMS_SIG object
+ */
+LMS_SIG *ossl_lms_sig_new(void)
+{
+    return OPENSSL_zalloc(sizeof(LMS_SIG));
+}
+
+/**
+ * @brief Destroy an existing LMS_SIG object
+ */
+void ossl_lms_sig_free(LMS_SIG *sig)
+{
+    OPENSSL_free(sig);
+}
diff --git a/deps/openssl/openssl/crypto/lms/lms_sig_decoder.c b/deps/openssl/openssl/crypto/lms/lms_sig_decoder.c
new file mode 100644
index 00000000000..47c20be847c
--- /dev/null
+++ b/deps/openssl/openssl/crypto/lms/lms_sig_decoder.c
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "crypto/lms_sig.h"
+#include "crypto/lms_util.h"
+
+/**
+ * @brief Decode a byte array containing XDR signature data into a LMS_SIG object.
+ *
+ * This is used for LMS Signature Verification.
+ * This function may be called multiple times.
+ * See RFC 8554 Algorithm 6a: Steps 1 and 2.
+ * It uses shallow copies for C, y and path.
+ *
+ * @param pkt Contains the signature data to decode. There may still be data
+ *            remaining in pkt after decoding.
+ * @param pub A public key that contains LMS_PARAMS and LM_OTS_PARAMS associated
+ *            with the signature.
+ * @returns The created LMS_SIG object if successful, or NULL on failure. A
+ *          failure may occur if the passed in LMS public key |pub| is not
+ *          compatible with the decoded LMS_SIG object,
+ */
+LMS_SIG *ossl_lms_sig_from_pkt(PACKET *pkt, const LMS_KEY *pub)
+{
+    uint32_t sig_ots_type = 0, sig_lms_type = 0;
+    const LMS_PARAMS *lparams = pub->lms_params;
+    const LM_OTS_PARAMS *pub_ots_params = pub->ots_params;
+    const LM_OTS_PARAMS *sig_params;
+    LMS_SIG *lsig = NULL;
+
+    lsig = ossl_lms_sig_new();
+    if (lsig == NULL)
+        return NULL;
+
+    if (!PACKET_get_net_4_len_u32(pkt, &lsig->q) /* q = Leaf Index */
+        || !PACKET_get_net_4_len_u32(pkt, &sig_ots_type)
+        || pub_ots_params->lm_ots_type != sig_ots_type)
+        goto err;
+    sig_params = pub_ots_params;
+    lsig->sig.params = sig_params;
+    lsig->params = lparams;
+
+    if (!PACKET_get_bytes(pkt, (const unsigned char **)&lsig->sig.C,
+            sig_params->n)
+        || !PACKET_get_bytes(pkt, (const unsigned char **)&lsig->sig.y,
+            sig_params->p * sig_params->n)
+        || !PACKET_get_net_4_len_u32(pkt, &sig_lms_type)
+        || (lparams->lms_type != sig_lms_type)
+        || HASH_NOT_MATCHED(lparams, sig_params)
+        || lsig->q >= (uint32_t)(1 << lparams->h)
+        || !PACKET_get_bytes(pkt, (const unsigned char **)&lsig->paths,
+            lparams->h * lparams->n)
+        || PACKET_remaining(pkt) > 0)
+        goto err;
+    return lsig;
+err:
+    ossl_lms_sig_free(lsig);
+    return NULL;
+}
+
+/**
+ * @brief Decode a byte array of LMS signature data.
+ *
+ * This function does not duplicate any of the byte data contained within
+ * |sig|. So it is expected that |sig| will exist for the duration of the
+ * returned signature |out|.
+ *
+ * @param out Used to return the LMS_SIG object.
+ * @param pub The root public LMS key
+ * @param sig A input byte array of signature data.
+ * @param siglen The size of sig.
+ * @returns 1 if the signature is successfully decoded,
+ *          otherwise it returns 0.
+ */
+int ossl_lms_sig_decode(LMS_SIG **out, LMS_KEY *pub,
+    const unsigned char *sig, size_t siglen)
+{
+    PACKET pkt;
+    LMS_SIG *s = NULL;
+
+    if (pub == NULL)
+        return 0;
+
+    if (!PACKET_buf_init(&pkt, sig, siglen))
+        return 0;
+
+    s = ossl_lms_sig_from_pkt(&pkt, pub);
+    if (s == NULL)
+        return 0;
+
+    /* Fail if there are trailing bytes */
+    if (PACKET_remaining(&pkt) > 0)
+        goto err;
+    *out = s;
+    return 1;
+err:
+    ossl_lms_sig_free(s);
+    return 0;
+}
diff --git a/deps/openssl/openssl/crypto/lms/lms_verify.c b/deps/openssl/openssl/crypto/lms/lms_verify.c
new file mode 100644
index 00000000000..602658d47d1
--- /dev/null
+++ b/deps/openssl/openssl/crypto/lms/lms_verify.c
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/byteorder.h>
+#include "crypto/lms_sig.h"
+#include "crypto/lms_util.h"
+#include "internal/common.h"
+
+/*
+ * Constants used for obtaining unique inputs for different hashing operations
+ * e.g H(I || q || OSSL_LMS_D_LEAF || ... )
+ */
+const uint16_t OSSL_LMS_D_PBLC = 0x8080;
+const uint16_t OSSL_LMS_D_MESG = 0x8181;
+const uint16_t OSSL_LMS_D_LEAF = 0x8282;
+const uint16_t OSSL_LMS_D_INTR = 0x8383;
+
+/*
+ * @brief Compute the candidate LMS root value Tc
+ *
+ * @param paths An array of bytes representing the hash values associated with
+ *              the path through the tree from the leaf associated with the
+ *              LM-OTS signature to the root public key node.
+ * @param n The hash output size (The size of each path in |paths|)
+ * @param nodenum The leaf index node number. The root node had a value of 1
+ *                Each subsequent level has nodes in the range 2^h...2^(h+1)-1
+ * @param ctx A EVP_MD_CTX object used for calculations
+ * @param ctxI A EVP_MD_CTX object containing an unfinalised H(I)
+ * @param Tc Contains H(I || u32str(node_num) || u16str(D_LEAF) || Kc) on input,
+ *           and on output returns the calculated candidate public key.
+ * @returns 1 on success, or 0 otherwise.
+ */
+static int lms_sig_compute_tc_from_path(const unsigned char *paths, uint32_t n,
+    uint32_t node_num,
+    EVP_MD_CTX *ctx, EVP_MD_CTX *ctxI,
+    unsigned char *Tc)
+{
+    int ret = 0;
+    unsigned char qbuf[4];
+    unsigned char d_intr[sizeof(uint16_t)];
+    const unsigned char *path = paths;
+
+    OPENSSL_store_u16_be(d_intr, OSSL_LMS_D_INTR);
+
+    /*
+     * Calculate the public key Tc using the path
+     * The root hash is the hash of its 2 children's Hash values.
+     * A child hash for each level is passed in by paths, and we have
+     * a leaf value that can be used with the path to calculate the parent
+     * hash.
+     */
+    while (node_num > 1) {
+        /* At each level the path contains either the left or right child */
+        int odd = node_num & 1;
+
+        node_num = node_num >> 1; /* get the parent node_num */
+        OPENSSL_store_u32_be(qbuf, node_num);
+
+        /*
+         * Calculate Tc as either
+         *   Tc(parent) = H(I || node_q || 0x8383 || paths[i][n] || Tc(right) OR
+         *   Tc(parent) = H(I || node_q || 0x8383 || Tc(left) || paths[i][n])
+         */
+        if (!EVP_MD_CTX_copy_ex(ctx, ctxI)
+            || !EVP_DigestUpdate(ctx, qbuf, sizeof(qbuf))
+            || !EVP_DigestUpdate(ctx, d_intr, sizeof(d_intr)))
+            goto err;
+
+        if (odd) {
+            if (!EVP_DigestUpdate(ctx, path, n)
+                || !EVP_DigestUpdate(ctx, Tc, n))
+                goto err;
+        } else {
+            if (!EVP_DigestUpdate(ctx, Tc, n)
+                || !EVP_DigestUpdate(ctx, path, n))
+                goto err;
+        }
+        /*
+         * Tc = parent Hash, which is either the left or right child for the next
+         * level up (node_num determines if it is left or right).
+         */
+        if (!EVP_DigestFinal_ex(ctx, Tc, NULL))
+            goto err;
+        path += n;
+    }
+    ret = 1;
+err:
+    return ret;
+}
+
+/*
+ * @brief LMS signature verification.
+ * See RFC 8554 Section 5.4.2. Algorithm 6: Steps 3 & 4
+ *
+ * @param lms_sig Is a valid decoded LMS_SIG signature object.
+ * @param pub Is a valid LMS public key object.
+ * @param md Contains the fetched digest to be used for Hash operations
+ * @param msg A message to verify
+ * @param msglen The size of |msg|
+ * @returns 1 if the verification succeeded, or 0 otherwise.
+ */
+int ossl_lms_sig_verify(const LMS_SIG *lms_sig, const LMS_KEY *pub,
+    const EVP_MD *md,
+    const unsigned char *msg, size_t msglen)
+{
+    int ret = 0;
+    EVP_MD_CTX *ctx = NULL, *ctxIq = NULL;
+    EVP_MD_CTX *ctxI;
+    unsigned char Kc[LMS_MAX_DIGEST_SIZE];
+    unsigned char Tc[LMS_MAX_DIGEST_SIZE];
+    unsigned char qbuf[4];
+    unsigned char d_leaf[sizeof(uint16_t)];
+    const LMS_PARAMS *lms_params = pub->lms_params;
+    uint32_t n = lms_params->n;
+    uint32_t node_num;
+
+    ctx = EVP_MD_CTX_create();
+    ctxIq = EVP_MD_CTX_create();
+    if (ctx == NULL || ctxIq == NULL)
+        goto err;
+
+    if (!lms_evp_md_ctx_init(ctxIq, md, lms_sig->params))
+        goto err;
+    /*
+     * Algorithm 6a: Step 3.
+     * Calculate a candidate public key |Kc| using the lmots_signature, message,
+     * and the identifiers I, q
+     */
+    if (!ossl_lm_ots_compute_pubkey(ctx, ctxIq, &lms_sig->sig,
+            pub->ots_params, pub->Id,
+            lms_sig->q, msg, msglen, Kc))
+        goto err;
+
+    /*
+     * Algorithm 6a: Step 4
+     * Compute the candidate LMS root value Tc
+     */
+    if (!ossl_assert(lms_sig->q < (uint32_t)(1 << lms_params->h)))
+        return 0;
+    node_num = (1 << lms_params->h) + lms_sig->q;
+
+    OPENSSL_store_u32_be(qbuf, node_num);
+    OPENSSL_store_u16_be(d_leaf, OSSL_LMS_D_LEAF);
+    ctxI = ctxIq;
+    /*
+     * Tc = H(I || u32str(node_num) || u16str(D_LEAF) || Kc)
+     *
+     * ctx is left initialised with the md from ossl_lm_ots_compute_pubkey,
+     * so there is no need to reinitialise it here.
+     */
+    if (!EVP_DigestInit_ex2(ctx, NULL, NULL)
+        || !EVP_DigestUpdate(ctx, pub->Id, LMS_SIZE_I)
+        || !EVP_MD_CTX_copy_ex(ctxI, ctx)
+        || !EVP_DigestUpdate(ctx, qbuf, sizeof(qbuf))
+        || !EVP_DigestUpdate(ctx, d_leaf, sizeof(d_leaf))
+        || !EVP_DigestUpdate(ctx, Kc, n)
+        || !EVP_DigestFinal_ex(ctx, Tc, NULL)
+        || !lms_sig_compute_tc_from_path(lms_sig->paths, n, node_num,
+            ctx, ctxI, Tc))
+        goto err;
+    /* Algorithm 6: Step 4 */
+    ret = (memcmp(pub->pub.K, Tc, n) == 0);
+err:
+    EVP_MD_CTX_free(ctxIq);
+    EVP_MD_CTX_free(ctx);
+    return ret;
+}
diff --git a/deps/openssl/openssl/crypto/loongarchcap.c b/deps/openssl/openssl/crypto/loongarchcap.c
index 9772a980903..152f94fa351 100644
--- a/deps/openssl/openssl/crypto/loongarchcap.c
+++ b/deps/openssl/openssl/crypto/loongarchcap.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,7 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 #include <sys/auxv.h>
-#include "loongarch_arch.h"
+#include "internal/cryptlib.h"
+#include "arch/loongarch_arch.h"

 unsigned int OPENSSL_loongarch_hwcap_P = 0;

diff --git a/deps/openssl/openssl/crypto/md4/md4_local.h b/deps/openssl/openssl/crypto/md4/md4_local.h
index ec2a8c361cf..2d0360bc430 100644
--- a/deps/openssl/openssl/crypto/md4/md4_local.h
+++ b/deps/openssl/openssl/crypto/md4/md4_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_MD4_MD4_LOCAL_H)
+#define OSSL_LIBCRYPTO_MD4_MD4_LOCAL_H
+
 #include <stdlib.h>
 #include <string.h>
 #include <openssl/opensslconf.h>
@@ -36,7 +39,9 @@ void md4_block_data_order(MD4_CTX *c, const void *p, size_t num);
     } while (0)
 #define HASH_BLOCK_DATA_ORDER md4_block_data_order

-#include "crypto/md32_common.h"
+/* clang-format off */
+#include "crypto/md32_common.inc"
+/* clang-format on */

 /*-
 #define F(x,y,z)        (((x) & (y))  |  ((~(x)) & (z)))
@@ -69,3 +74,5 @@ void md4_block_data_order(MD4_CTX *c, const void *p, size_t num);
         a += ((k) + (t) + H((b), (c), (d))); \
         a = ROTATE(a, s);                    \
     };
+
+#endif /* !defined(OSSL_LIBCRYPTO_MD4_MD4_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/md5/asm/md5-aarch64.pl b/deps/openssl/openssl/crypto/md5/asm/md5-aarch64.pl
index 02bc05caaf5..78537b4d50c 100755
--- a/deps/openssl/openssl/crypto/md5/asm/md5-aarch64.pl
+++ b/deps/openssl/openssl/crypto/md5/asm/md5-aarch64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2021-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -28,7 +28,7 @@ open OUT,"| \"$^X\" $xlate $flavour \"$output\""
 *STDOUT=*OUT;

 $code .= <<EOF;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 .text
 .globl  ossl_md5_block_asm_data_order
diff --git a/deps/openssl/openssl/crypto/md5/asm/md5-loongarch64.pl b/deps/openssl/openssl/crypto/md5/asm/md5-loongarch64.pl
index 370efd08c41..52f6d150ab9 100755
--- a/deps/openssl/openssl/crypto/md5/asm/md5-loongarch64.pl
+++ b/deps/openssl/openssl/crypto/md5/asm/md5-loongarch64.pl
@@ -1,8 +1,8 @@
 #! /usr/bin/env perl
 # Author: Min Zhou <zhoumin@loongson.cn>
-# Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
-# Licensed under the OpenSSL license (the "License").  You may not use
+# Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
 # in the file LICENSE in the source distribution or at
 # https://www.openssl.org/source/license.html
@@ -14,9 +14,9 @@ use strict;

 my $code;

-my ($zero,$ra,$tp,$sp,$fp)=map("\$r$_",(0..3,22));
-my ($a0,$a1,$a2,$a3,$a4,$a5,$a6,$a7)=map("\$r$_",(4..11));
-my ($t0,$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$x)=map("\$r$_",(12..21));
+my ($zero,$ra,$tp,$sp,$fp)=("\$zero", "\$ra", "\$tp", "\$sp", "\$fp");
+my ($a0,$a1,$a2,$a3,$a4,$a5,$a6,$a7)=map("\$a$_",(0..7));
+my ($t0,$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8)=map("\$t$_",(0..8));

 # $output is the last argument if it looks like a file (it has an extension)
 my $output;
diff --git a/deps/openssl/openssl/crypto/md5/asm/md5-riscv64-zbb.pl b/deps/openssl/openssl/crypto/md5/asm/md5-riscv64-zbb.pl
new file mode 100644
index 00000000000..54900ae7847
--- /dev/null
+++ b/deps/openssl/openssl/crypto/md5/asm/md5-riscv64-zbb.pl
@@ -0,0 +1,377 @@
+#! /usr/bin/env perl
+# This file is dual-licensed, meaning that you can use it under your
+# choice of either of the following two licenses:
+#
+# Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License"). You can obtain
+# a copy in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+#
+# or
+#
+# Copyright (c) 2025, Julian Zhu <julian.oerv@isrc.iscas.ac.cn>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# The generated code of this file depends on the following RISC-V extensions:
+# - RV64I
+# Optional:
+# - RISC-V Basic Bit-manipulation extension ('Zbb')
+
+use strict;
+use warnings;
+
+use FindBin qw($Bin);
+use lib "$Bin";
+use lib "$Bin/../../perlasm";
+use riscv;
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+my $output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+my $flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+my $use_zbb = $flavour && $flavour =~ /zbb/i ? 1 : 0;
+my $isaext = "_" . ( $use_zbb ? "zbb" : "riscv64" );
+
+$output and open STDOUT,">$output";
+
+my $code=<<___;
+.text
+___
+
+# Function arguments
+my ($CTX, $INP, $LEN, $A, $B, $C, $D) = ("a0", "a1", "a2", "a4", "a5", "a6", "a7");
+my ($KT, $T0, $T1, $T2, $lA, $lB, $lC, $lD) = ("a3", "t0", "t1", "t2", "t3", "t4", "t5", "t6");
+my ($C1, $C2, $C3, $C4, $C5, $C6, $C7, $C8) = ("s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7");
+
+sub ROUND0 {
+    my ($a, $b, $c, $d, $x, $const, $shift, $is_odd) = @_;
+    my $code=<<___;
+    li $T0, $const
+___
+    if ($is_odd) {
+        $code .= <<___;
+        addw $a, $a, $T0
+        srli $T0, $x, 32
+___
+    } else {
+        $code .= <<___;
+        addw $a, $a, $x
+___
+    }
+    $code .= <<___;
+    addw $a, $a, $T0
+    xor $T0, $c, $d
+    and $T0, $T0, $b
+    xor $T0, $T0, $d
+    addw $a, $a, $T0
+___
+    if ($use_zbb) {
+        my $ror_part = <<___;
+        @{[roriw $a, $a, 32 - $shift]}
+___
+        $code .= $ror_part;
+    } else {
+        my $ror_part = <<___;
+        @{[roriw_rv64i $a, $a, $T1, $T2, 32 - $shift]}
+___
+        $code .= $ror_part;
+    }
+    $code .= <<___;
+    addw $a, $a, $b
+___
+    return $code;
+}
+
+sub ROUND1 {
+    my ($a, $b, $c, $d, $x, $const, $shift, $is_odd) = @_;
+    my $code=<<___;
+    li $T0, $const
+___
+    if ($is_odd) {
+        $code .= <<___;
+        addw $a, $a, $T0
+        srli $T0, $x, 32
+___
+    } else {
+        $code .= <<___;
+        addw $a, $a, $x
+___
+    }
+    $code .= <<___;
+    addw $a, $a, $T0
+    xor $T0, $b, $c
+    and $T0, $T0, $d
+    xor $T0, $T0, $c
+    addw $a, $a, $T0
+___
+    if ($use_zbb) {
+        my $ror_part = <<___;
+        @{[roriw $a, $a, 32 - $shift]}
+___
+        $code .= $ror_part;
+    } else {
+        my $ror_part = <<___;
+        @{[roriw_rv64i $a, $a, $T1, $T2, 32 - $shift]}
+___
+        $code .= $ror_part;
+    }
+    $code .= <<___;
+    addw $a, $a, $b
+___
+    return $code;
+}
+
+sub ROUND2 {
+    my ($a, $b, $c, $d, $x, $const, $shift, $is_odd) = @_;
+    my $code=<<___;
+    li $T0, $const
+___
+    if ($is_odd) {
+        $code .= <<___;
+        addw $a, $a, $T0
+        srli $T0, $x, 32
+___
+    } else {
+        $code .= <<___;
+        addw $a, $a, $x
+___
+    }
+    $code .= <<___;
+    addw $a, $a, $T0
+    xor $T0, $c, $d
+    xor $T0, $T0, $b
+    addw $a, $a, $T0
+___
+    if ($use_zbb) {
+        my $ror_part = <<___;
+        @{[roriw $a, $a, 32 - $shift]}
+___
+        $code .= $ror_part;
+    } else {
+        my $ror_part = <<___;
+        @{[roriw_rv64i $a, $a, $T1, $T2, 32 - $shift]}
+___
+        $code .= $ror_part;
+    }
+    $code .= <<___;
+    addw $a, $a, $b
+___
+    return $code;
+}
+
+sub ROUND3 {
+    my ($a, $b, $c, $d, $x, $const, $shift, $is_odd) = @_;
+    my $code=<<___;
+    li $T0, $const
+___
+    if ($is_odd) {
+        $code .= <<___;
+        addw $a, $a, $T0
+        srli $T0, $x, 32
+___
+    } else {
+        $code .= <<___;
+        addw $a, $a, $x
+___
+    }
+    $code .= <<___;
+    addw $a, $a, $T0
+___
+    if ($use_zbb) {
+        my $orn_part = <<___;
+        @{[orn $T0, $b, $d]}
+___
+        $code .= $orn_part;
+    } else {
+        my $orn_part = <<___;
+        @{[orn_rv64i $T0, $b, $d]}
+___
+        $code .= $orn_part;
+    }
+    $code .= <<___;
+    xor $T0, $T0, $c
+    addw $a, $a, $T0
+___
+    if ($use_zbb) {
+        my $ror_part = <<___;
+        @{[roriw $a, $a, 32 - $shift]}
+___
+        $code .= $ror_part;
+    } else {
+        my $ror_part = <<___;
+        @{[roriw_rv64i $a, $a, $T1, $T2, 32 - $shift]}
+___
+        $code .= $ror_part;
+    }
+    $code .= <<___;
+    addw $a, $a, $b
+___
+    return $code;
+}
+
+################################################################################
+# void ossl_md5_block_asm_data_order@{[$isaext]}(MD5_CTX *c, const void *p, size_t num)
+$code .= <<___;
+.p2align 3
+.globl ossl_md5_block_asm_data_order@{[$isaext]}
+.type ossl_md5_block_asm_data_order@{[$isaext]},\@function
+ossl_md5_block_asm_data_order@{[$isaext]}:
+
+    addi sp, sp, -64
+
+    sd s0, 0(sp)
+    sd s1, 8(sp)
+    sd s2, 16(sp)
+    sd s3, 24(sp)
+    sd s4, 32(sp)
+    sd s5, 40(sp)
+    sd s6, 48(sp)
+    sd s7, 56(sp)
+
+    # load ctx
+    lw $A, 0($CTX)
+    lw $B, 4($CTX)
+    lw $C, 8($CTX)
+    lw $D, 12($CTX)
+
+L_round_loop:
+
+    ld $C1, 0($INP)
+    ld $C2, 8($INP)
+    ld $C3, 16($INP)
+    ld $C4, 24($INP)
+    ld $C5, 32($INP)
+    ld $C6, 40($INP)
+    ld $C7, 48($INP)
+    ld $C8, 56($INP)
+
+    mv $lA, $A
+    mv $lB, $B
+    mv $lC, $C
+    mv $lD, $D
+
+    @{[ROUND0 $A, $B, $C, $D, $C1, 0xd76aa478,  7, 0]}
+    @{[ROUND0 $D, $A, $B, $C, $C1, 0xe8c7b756, 12, 1]}
+    @{[ROUND0 $C, $D, $A, $B, $C2, 0x242070db, 17, 0]}
+    @{[ROUND0 $B, $C, $D, $A, $C2, 0xc1bdceee, 22, 1]}
+    @{[ROUND0 $A, $B, $C, $D, $C3, 0xf57c0faf,  7, 0]}
+    @{[ROUND0 $D, $A, $B, $C, $C3, 0x4787c62a, 12, 1]}
+    @{[ROUND0 $C, $D, $A, $B, $C4, 0xa8304613, 17, 0]}
+    @{[ROUND0 $B, $C, $D, $A, $C4, 0xfd469501, 22, 1]}
+    @{[ROUND0 $A, $B, $C, $D, $C5, 0x698098d8,  7, 0]}
+    @{[ROUND0 $D, $A, $B, $C, $C5, 0x8b44f7af, 12, 1]}
+    @{[ROUND0 $C, $D, $A, $B, $C6, 0xffff5bb1, 17, 0]}
+    @{[ROUND0 $B, $C, $D, $A, $C6, 0x895cd7be, 22, 1]}
+    @{[ROUND0 $A, $B, $C, $D, $C7, 0x6b901122,  7, 0]}
+    @{[ROUND0 $D, $A, $B, $C, $C7, 0xfd987193, 12, 1]}
+    @{[ROUND0 $C, $D, $A, $B, $C8, 0xa679438e, 17, 0]}
+    @{[ROUND0 $B, $C, $D, $A, $C8, 0x49b40821, 22, 1]}
+
+    @{[ROUND1 $A, $B, $C, $D, $C1, 0xf61e2562,  5, 1]}
+    @{[ROUND1 $D, $A, $B, $C, $C4, 0xc040b340,  9, 0]}
+    @{[ROUND1 $C, $D, $A, $B, $C6, 0x265e5a51, 14, 1]}
+    @{[ROUND1 $B, $C, $D, $A, $C1, 0xe9b6c7aa, 20, 0]}
+    @{[ROUND1 $A, $B, $C, $D, $C3, 0xd62f105d,  5, 1]}
+    @{[ROUND1 $D, $A, $B, $C, $C6, 0x2441453,   9, 0]}
+    @{[ROUND1 $C, $D, $A, $B, $C8, 0xd8a1e681, 14, 1]}
+    @{[ROUND1 $B, $C, $D, $A, $C3, 0xe7d3fbc8, 20, 0]}
+    @{[ROUND1 $A, $B, $C, $D, $C5, 0x21e1cde6,  5, 1]}
+    @{[ROUND1 $D, $A, $B, $C, $C8, 0xc33707d6,  9, 0]}
+    @{[ROUND1 $C, $D, $A, $B, $C2, 0xf4d50d87, 14, 1]}
+    @{[ROUND1 $B, $C, $D, $A, $C5, 0x455a14ed, 20, 0]}
+    @{[ROUND1 $A, $B, $C, $D, $C7, 0xa9e3e905,  5, 1]}
+    @{[ROUND1 $D, $A, $B, $C, $C2, 0xfcefa3f8,  9, 0]}
+    @{[ROUND1 $C, $D, $A, $B, $C4, 0x676f02d9, 14, 1]}
+    @{[ROUND1 $B, $C, $D, $A, $C7, 0x8d2a4c8a, 20, 0]}
+
+    @{[ROUND2 $A, $B, $C, $D, $C3, 0xfffa3942,  4, 1]}
+    @{[ROUND2 $D, $A, $B, $C, $C5, 0x8771f681, 11, 0]}
+    @{[ROUND2 $C, $D, $A, $B, $C6, 0x6d9d6122, 16, 1]}
+    @{[ROUND2 $B, $C, $D, $A, $C8, 0xfde5380c, 23, 0]}
+    @{[ROUND2 $A, $B, $C, $D, $C1, 0xa4beea44,  4, 1]}
+    @{[ROUND2 $D, $A, $B, $C, $C3, 0x4bdecfa9, 11, 0]}
+    @{[ROUND2 $C, $D, $A, $B, $C4, 0xf6bb4b60, 16, 1]}
+    @{[ROUND2 $B, $C, $D, $A, $C6, 0xbebfbc70, 23, 0]}
+    @{[ROUND2 $A, $B, $C, $D, $C7, 0x289b7ec6,  4, 1]}
+    @{[ROUND2 $D, $A, $B, $C, $C1, 0xeaa127fa, 11, 0]}
+    @{[ROUND2 $C, $D, $A, $B, $C2, 0xd4ef3085, 16, 1]}
+    @{[ROUND2 $B, $C, $D, $A, $C4, 0x4881d05,  23, 0]}
+    @{[ROUND2 $A, $B, $C, $D, $C5, 0xd9d4d039,  4, 1]}
+    @{[ROUND2 $D, $A, $B, $C, $C7, 0xe6db99e5, 11, 0]}
+    @{[ROUND2 $C, $D, $A, $B, $C8, 0x1fa27cf8, 16, 1]}
+    @{[ROUND2 $B, $C, $D, $A, $C2, 0xc4ac5665, 23, 0]}
+
+    @{[ROUND3 $A, $B, $C, $D, $C1, 0xf4292244,  6, 0]}
+    @{[ROUND3 $D, $A, $B, $C, $C4, 0x432aff97, 10, 1]}
+    @{[ROUND3 $C, $D, $A, $B, $C8, 0xab9423a7, 15, 0]}
+    @{[ROUND3 $B, $C, $D, $A, $C3, 0xfc93a039, 21, 1]}
+    @{[ROUND3 $A, $B, $C, $D, $C7, 0x655b59c3,  6, 0]}
+    @{[ROUND3 $D, $A, $B, $C, $C2, 0x8f0ccc92, 10, 1]}
+    @{[ROUND3 $C, $D, $A, $B, $C6, 0xffeff47d, 15, 0]}
+    @{[ROUND3 $B, $C, $D, $A, $C1, 0x85845dd1, 21, 1]}
+    @{[ROUND3 $A, $B, $C, $D, $C5, 0x6fa87e4f,  6, 0]}
+    @{[ROUND3 $D, $A, $B, $C, $C8, 0xfe2ce6e0, 10, 1]}
+    @{[ROUND3 $C, $D, $A, $B, $C4, 0xa3014314, 15, 0]}
+    @{[ROUND3 $B, $C, $D, $A, $C7, 0x4e0811a1, 21, 1]}
+    @{[ROUND3 $A, $B, $C, $D, $C3, 0xf7537e82,  6, 0]}
+    @{[ROUND3 $D, $A, $B, $C, $C6, 0xbd3af235, 10, 1]}
+    @{[ROUND3 $C, $D, $A, $B, $C2, 0x2ad7d2bb, 15, 0]}
+    @{[ROUND3 $B, $C, $D, $A, $C5, 0xeb86d391, 21, 1]}
+
+    addw $A, $A, $lA
+    addw $B, $B, $lB
+    addw $C, $C, $lC
+    addw $D, $D, $lD
+
+    addi $INP, $INP, 64
+
+    addi $LEN, $LEN, -1
+
+    bnez $LEN, L_round_loop
+
+    sw $A, 0($CTX)
+    sw $B, 4($CTX)
+    sw $C, 8($CTX)
+    sw $D, 12($CTX)
+
+    ld s0, 0(sp)
+    ld s1, 8(sp)
+    ld s2, 16(sp)
+    ld s3, 24(sp)
+    ld s4, 32(sp)
+    ld s5, 40(sp)
+    ld s6, 48(sp)
+    ld s7, 56(sp)
+
+    addi sp, sp, 64
+
+    ret
+.size ossl_md5_block_asm_data_order@{[$isaext]},.-ossl_md5_block_asm_data_order@{[$isaext]}
+___
+
+print $code;
+
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/md5/asm/md5-sparcv9.pl b/deps/openssl/openssl/crypto/md5/asm/md5-sparcv9.pl
index c41ccf6ba90..05f13f09f09 100644
--- a/deps/openssl/openssl/crypto/md5/asm/md5-sparcv9.pl
+++ b/deps/openssl/openssl/crypto/md5/asm/md5-sparcv9.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2012-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2012-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 #
 # Hardware SPARC T4 support by David S. Miller.
 # ====================================================================
@@ -206,7 +206,7 @@ $code.=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #ifdef __arch64__
 .register	%g2,#scratch
@@ -377,7 +377,7 @@ $code.=<<___;
 .type	ossl_md5_block_asm_data_order,#function
 .size	ossl_md5_block_asm_data_order,(.-ossl_md5_block_asm_data_order)

-.asciz	"MD5 block transform for SPARCv9, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"MD5 block transform for SPARCv9, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	4
 ___

diff --git a/deps/openssl/openssl/crypto/md5/build.info b/deps/openssl/openssl/crypto/md5/build.info
index 307e5037ee6..9a73db39516 100644
--- a/deps/openssl/openssl/crypto/md5/build.info
+++ b/deps/openssl/openssl/crypto/md5/build.info
@@ -6,6 +6,7 @@ IF[{- !$disabled{asm} -}]
   $MD5ASM_x86_64=md5-x86_64.s
   $MD5ASM_aarch64=md5-aarch64.S
   $MD5ASM_loongarch64=md5-loongarch64.S
+  $MD5ASM_riscv64=md5_riscv.c md5-riscv64.S md5-riscv64-zbb.S
   $MD5ASM_sparcv9=md5-sparcv9.S

   # Now that we have defined all the arch specific variables, use the
@@ -43,5 +44,9 @@ INCLUDE[md5-aarch64.o]=..
 GENERATE[md5-loongarch64.S]=asm/md5-loongarch64.pl
 INCLUDE[md5-loongarch64.o]=..

+GENERATE[md5-riscv64.S]=asm/md5-riscv64-zbb.pl
+GENERATE[md5-riscv64-zbb.S]=asm/md5-riscv64-zbb.pl zbb
+INCLUDE[md5-riscv64.o]=..
+
 GENERATE[md5-sparcv9.S]=asm/md5-sparcv9.pl
 INCLUDE[md5-sparcv9.o]=..
diff --git a/deps/openssl/openssl/crypto/md5/md5_local.h b/deps/openssl/openssl/crypto/md5/md5_local.h
index f0905e513c6..a0523df6d36 100644
--- a/deps/openssl/openssl/crypto/md5/md5_local.h
+++ b/deps/openssl/openssl/crypto/md5/md5_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,13 +7,16 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_MD5_MD5_LOCAL_H)
+#define OSSL_LIBCRYPTO_MD5_MD5_LOCAL_H
+
 #include <stdlib.h>
 #include <string.h>
 #include <openssl/e_os2.h>
 #include <openssl/md5.h>

 #ifdef MD5_ASM
-#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64) || defined(__aarch64__) || (defined(__loongarch__) && __loongarch_grlen == 64)
+#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64) || defined(__aarch64__) || (defined(__loongarch__) && __loongarch_grlen == 64) || (defined(__riscv) && __riscv_xlen == 64)
 #define md5_block_data_order ossl_md5_block_asm_data_order
 #elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
 #define md5_block_data_order ossl_md5_block_asm_data_order
@@ -46,7 +49,9 @@ void md5_block_data_order(MD5_CTX *c, const void *p, size_t num);
     } while (0)
 #define HASH_BLOCK_DATA_ORDER md5_block_data_order

-#include "crypto/md32_common.h"
+/* clang-format off */
+#include "crypto/md32_common.inc"
+/* clang-format on */

 /*-
 #define F(x,y,z)        (((x) & (y))  |  ((~(x)) & (z)))
@@ -90,3 +95,5 @@ void md5_block_data_order(MD5_CTX *c, const void *p, size_t num);
         a = ROTATE(a, s);                    \
         a += b;                              \
     };
+
+#endif /* !defined(OSSL_LIBCRYPTO_MD5_MD5_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/md5/md5_riscv.c b/deps/openssl/openssl/crypto/md5/md5_riscv.c
new file mode 100644
index 00000000000..efc8d0d2ea5
--- /dev/null
+++ b/deps/openssl/openssl/crypto/md5/md5_riscv.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/opensslconf.h>
+#include <openssl/md5.h>
+#include "arch/riscv_arch.h"
+
+void ossl_md5_block_asm_data_order(void *c, const void *p, size_t num);
+void ossl_md5_block_asm_data_order_zbb(void *c, const void *p, size_t num);
+void ossl_md5_block_asm_data_order_riscv64(void *c, const void *p, size_t num);
+void ossl_md5_block_asm_data_order(void *c, const void *p, size_t num)
+{
+    if (RISCV_HAS_ZBB()) {
+        ossl_md5_block_asm_data_order_zbb(c, p, num);
+    } else {
+        ossl_md5_block_asm_data_order_riscv64(c, p, num);
+    }
+}
diff --git a/deps/openssl/openssl/crypto/mdc2/mdc2dgst.c b/deps/openssl/openssl/crypto/mdc2/mdc2dgst.c
index 6fa9bbd356a..ea39990eb68 100644
--- a/deps/openssl/openssl/crypto/mdc2/mdc2dgst.c
+++ b/deps/openssl/openssl/crypto/mdc2/mdc2dgst.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,18 +19,7 @@
 #include <openssl/crypto.h>
 #include <openssl/des.h>
 #include <openssl/mdc2.h>
-
-#undef c2l
-#define c2l(c, l) (l = ((DES_LONG)(*((c)++))), \
-    l |= ((DES_LONG)(*((c)++))) << 8L,         \
-    l |= ((DES_LONG)(*((c)++))) << 16L,        \
-    l |= ((DES_LONG)(*((c)++))) << 24L)
-
-#undef l2c
-#define l2c(l, c) (*((c)++) = (unsigned char)(((l)) & 0xff), \
-    *((c)++) = (unsigned char)(((l) >> 8L) & 0xff),          \
-    *((c)++) = (unsigned char)(((l) >> 16L) & 0xff),         \
-    *((c)++) = (unsigned char)(((l) >> 24L) & 0xff))
+#include "internal/common.h"

 static void mdc2_body(MDC2_CTX *c, const unsigned char *in, size_t len);
 int MDC2_Init(MDC2_CTX *c)
diff --git a/deps/openssl/openssl/crypto/mem.c b/deps/openssl/openssl/crypto/mem.c
index 2ae2b8c8c75..4b6ea2ec953 100644
--- a/deps/openssl/openssl/crypto/mem.c
+++ b/deps/openssl/openssl/crypto/mem.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -8,7 +8,9 @@
  */

 #include "internal/e_os.h"
+#include "internal/threads_common.h"
 #include "internal/cryptlib.h"
+#include "internal/mem_alloc_utils.h"
 #include "crypto/cryptlib.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -111,12 +113,19 @@ static void parseit(void)
 {
     char *semi = strchr(md_failstring, ';');
     char *atsign;
+    char *end;

     if (semi != NULL)
         *semi++ = '\0';

-    /* Get the count (atol will stop at the @ if there), and percentage */
-    md_count = atol(md_failstring);
+    /*
+     * Get the count (parsing stops at the '@' if present), and percentage.
+     * Ignore an unparsable/overflowing count rather than acting on garbage.
+     * Validate that the count is followed by '@' or end-of-string.
+     */
+    if (!ossl_strtol(md_failstring, &end, 10, &md_count)
+        || (*end != '\0' && *end != '@'))
+        md_count = 0;
     atsign = strchr(md_failstring, '@');
     md_fail_percent = atsign == NULL ? 0 : (int)(atof(atsign + 1) * 100 + 0.5);

@@ -146,7 +155,7 @@ static int shouldfail(void)
     char buff[80];

     if (md_tracefd > 0) {
-        BIO_snprintf(buff, sizeof(buff),
+        snprintf(buff, sizeof(buff),
             "%c C%ld %%%d R%d\n",
             shoulditfail ? '-' : '+', md_count, md_fail_percent, roll);
         len = strlen(buff);
@@ -178,10 +187,19 @@ void ossl_malloc_setup_failures(void)
             parseit();
         }
     }
-    if ((cp = getenv("OPENSSL_MALLOC_FD")) != NULL)
-        md_tracefd = atoi(cp);
-    if ((cp = getenv("OPENSSL_MALLOC_SEED")) != NULL)
-        srandom(atoi(cp));
+    if ((cp = getenv("OPENSSL_MALLOC_FD")) != NULL) {
+        int fd;
+
+        if (ossl_strtoint(cp, NULL, 10, &fd) && fd >= 0)
+            md_tracefd = fd;
+    }
+    if ((cp = getenv("OPENSSL_MALLOC_SEED")) != NULL) {
+        unsigned long seed;
+
+        /* Any value is a usable seed; just truncate it to the srandom() type. */
+        if (OPENSSL_strtoul(cp, NULL, 10, &seed))
+            srandom((unsigned int)seed);
+    }
 }
 #endif

@@ -190,6 +208,7 @@ void *CRYPTO_malloc(size_t num, const char *file, int line)
     void *ptr;

     INCREMENT(malloc_count);
+    FAILTEST();
     if (malloc_impl != CRYPTO_malloc) {
         ptr = malloc_impl(num, file, line);
         if (ptr != NULL || num == 0)
@@ -197,11 +216,12 @@ void *CRYPTO_malloc(size_t num, const char *file, int line)
         goto err;
     }

-    if (num == 0)
+    if (ossl_unlikely(num == 0))
         return NULL;

-    FAILTEST();
     if (allow_customize) {
+        TSAN_BENIGN(&allow_customize,
+            "allow_customize is intentionally racy");
         /*
          * Disallow customization after the first allocation. We only set this
          * if necessary to avoid a store to the same cache line on every
@@ -211,18 +231,10 @@ void *CRYPTO_malloc(size_t num, const char *file, int line)
     }

     ptr = malloc(num);
-    if (ptr != NULL)
+    if (ossl_likely(ptr != NULL))
         return ptr;
 err:
-    /*
-     * ossl_err_get_state_int() in err.c uses CRYPTO_zalloc(num, NULL, 0) for
-     * ERR_STATE allocation. Prevent mem alloc error loop while reporting error.
-     */
-    if (file != NULL || line != 0) {
-        ERR_new();
-        ERR_set_debug(file, line, NULL);
-        ERR_set_error(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE, NULL);
-    }
+    ossl_report_alloc_err(file, line);
     return NULL;
 }

@@ -240,70 +252,48 @@ void *CRYPTO_zalloc(size_t num, const char *file, int line)
 void *CRYPTO_aligned_alloc(size_t num, size_t alignment, void **freeptr,
     const char *file, int line)
 {
-    void *ret;
-
     *freeptr = NULL;

-#if defined(OPENSSL_SMALL_FOOTPRINT)
-    ret = freeptr = NULL;
-    return ret;
-#endif
+    /* Ensure that alignment is a power of two no larger than 65536 */
+    if (alignment == 0 || (alignment & (alignment - 1)) != 0
+        || alignment > 65536) {
+        ossl_report_alloc_err_inv(file, line);
+        return NULL;
+    }

     /* Allow non-malloc() allocations as long as no malloc_impl is provided. */
     if (malloc_impl == CRYPTO_malloc) {
 #if defined(_BSD_SOURCE) || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L)
-        if (posix_memalign(&ret, alignment, num))
-            return NULL;
-        *freeptr = ret;
-        return ret;
-#elif defined(_ISOC11_SOURCE)
-        ret = *freeptr = aligned_alloc(alignment, num);
-        return ret;
-#endif
-    }
-
-    /* we have to do this the hard way */
-
-    /*
-     * Note: Windows supports an _aligned_malloc call, but we choose
-     * not to use it here, because allocations from that function
-     * require that they be freed via _aligned_free.  Given that
-     * we can't differentiate plain malloc blocks from blocks obtained
-     * via _aligned_malloc, just avoid its use entirely
-     */
+        void *ret;

-    /*
-     * Step 1: Allocate an amount of memory that is <alignment>
-     * bytes bigger than requested
-     */
-    *freeptr = CRYPTO_malloc(num + alignment, file, line);
-    if (*freeptr == NULL)
-        return NULL;
+        /* posix_memalign() requires alignment to be at least sizeof(void *) */
+        if (alignment < sizeof(void *))
+            alignment = sizeof(void *);

-    /*
-     * Step 2: Add <alignment - 1> bytes to the pointer
-     * This will cross the alignment boundary that is
-     * requested
-     */
-    ret = (void *)((char *)*freeptr + (alignment - 1));
+        if (posix_memalign(&ret, alignment, num) == 0) {
+            *freeptr = ret;
+            return ret;
+        }
+#endif
+    }

-    /*
-     * Step 3: Use the alignment as a mask to translate the
-     * least significant bits of the allocation at the alignment
-     * boundary to 0.  ret now holds a pointer to the memory
-     * buffer at the requested alignment
-     * NOTE: It is a documented requirement that alignment be a
-     * power of 2, which is what allows this to work
-     */
-    ret = (void *)((uintptr_t)ret & (uintptr_t)(~(alignment - 1)));
-    return ret;
+    return ossl_malloc_align(num, alignment, freeptr, file, line);
 }

 void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
 {
+    void *ret;
+
     INCREMENT(realloc_count);
-    if (realloc_impl != CRYPTO_realloc)
-        return realloc_impl(str, num, file, line);
+    FAILTEST();
+    if (realloc_impl != CRYPTO_realloc) {
+        ret = realloc_impl(str, num, file, line);
+
+        if (num == 0 || ret != NULL)
+            return ret;
+
+        goto err;
+    }

     if (str == NULL)
         return CRYPTO_malloc(num, file, line);
@@ -313,8 +303,13 @@ void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
         return NULL;
     }

-    FAILTEST();
-    return realloc(str, num);
+    ret = realloc(str, num);
+
+err:
+    if (num != 0 && ret == NULL)
+        ossl_report_alloc_err(file, line);
+
+    return ret;
 }

 void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num,
diff --git a/deps/openssl/openssl/crypto/mem_sec.c b/deps/openssl/openssl/crypto/mem_sec.c
index 21275d6cb23..50078ab7c06 100644
--- a/deps/openssl/openssl/crypto/mem_sec.c
+++ b/deps/openssl/openssl/crypto/mem_sec.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2004-2014, Akamai Technologies. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -23,8 +23,10 @@

 #ifndef OPENSSL_NO_SECURE_MEMORY
 #if defined(_WIN32)
-#include <windows.h>
 #if defined(WINAPI_FAMILY_PARTITION)
+#if !defined(WINAPI_PARTITION_SYSTEM)
+#define WINAPI_PARTITION_SYSTEM 0
+#endif
 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
 /*
  * While VirtualLock is available under the app partition (e.g. UWP),
@@ -262,6 +264,8 @@ size_t CRYPTO_secure_used(void)
     size_t ret = 0;

 #ifndef OPENSSL_NO_SECURE_MEMORY
+    if (!secure_mem_initialized)
+        return 0;
     if (!CRYPTO_THREAD_read_lock(sec_malloc_lock))
         return 0;

@@ -277,7 +281,9 @@ size_t CRYPTO_secure_actual_size(void *ptr)
 #ifndef OPENSSL_NO_SECURE_MEMORY
     size_t actual_size;

-    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock))
+    if (!secure_mem_initialized)
+        return 0;
+    if (!CRYPTO_THREAD_read_lock(sec_malloc_lock))
         return 0;
     actual_size = sh_actual_size(ptr);
     CRYPTO_THREAD_unlock(sec_malloc_lock);
@@ -475,7 +481,7 @@ static int sh_init(size_t size, size_t minsize)
     for (i = sh.bittable_size; i; i >>= 1)
         sh.freelist_size++;

-    sh.freelist = OPENSSL_zalloc(sh.freelist_size * sizeof(char *));
+    sh.freelist = OPENSSL_calloc(sh.freelist_size, sizeof(char *));
     OPENSSL_assert(sh.freelist != NULL);
     if (sh.freelist == NULL)
         goto err;
@@ -651,8 +657,8 @@ static void *sh_malloc(size_t size)
         char *temp = sh.freelist[slist];

         /* remove from bigger list */
-        OPENSSL_assert(!sh_testbit(temp, slist, sh.bitmalloc));
-        sh_clearbit(temp, slist, sh.bittable);
+        OPENSSL_assert(!sh_testbit(temp, (int)slist, sh.bitmalloc));
+        sh_clearbit(temp, (int)slist, sh.bittable);
         sh_remove_from_list(temp);
         OPENSSL_assert(temp != sh.freelist[slist]);

@@ -660,25 +666,25 @@ static void *sh_malloc(size_t size)
         slist++;

         /* add to smaller list */
-        OPENSSL_assert(!sh_testbit(temp, slist, sh.bitmalloc));
-        sh_setbit(temp, slist, sh.bittable);
+        OPENSSL_assert(!sh_testbit(temp, (int)slist, sh.bitmalloc));
+        sh_setbit(temp, (int)slist, sh.bittable);
         sh_add_to_list(&sh.freelist[slist], temp);
         OPENSSL_assert(sh.freelist[slist] == temp);

         /* split in 2 */
         temp += sh.arena_size >> slist;
-        OPENSSL_assert(!sh_testbit(temp, slist, sh.bitmalloc));
-        sh_setbit(temp, slist, sh.bittable);
+        OPENSSL_assert(!sh_testbit(temp, (int)slist, sh.bitmalloc));
+        sh_setbit(temp, (int)slist, sh.bittable);
         sh_add_to_list(&sh.freelist[slist], temp);
         OPENSSL_assert(sh.freelist[slist] == temp);

-        OPENSSL_assert(temp - (sh.arena_size >> slist) == sh_find_my_buddy(temp, slist));
+        OPENSSL_assert(temp - (sh.arena_size >> slist) == sh_find_my_buddy(temp, (int)slist));
     }

     /* peel off memory to hand back */
     chunk = sh.freelist[list];
-    OPENSSL_assert(sh_testbit(chunk, list, sh.bittable));
-    sh_setbit(chunk, list, sh.bitmalloc);
+    OPENSSL_assert(sh_testbit(chunk, (int)list, sh.bittable));
+    sh_setbit(chunk, (int)list, sh.bitmalloc);
     sh_remove_from_list(chunk);

     OPENSSL_assert(WITHIN_ARENA(chunk));
@@ -701,19 +707,19 @@ static void sh_free(void *ptr)
         return;

     list = sh_getlist(ptr);
-    OPENSSL_assert(sh_testbit(ptr, list, sh.bittable));
-    sh_clearbit(ptr, list, sh.bitmalloc);
+    OPENSSL_assert(sh_testbit(ptr, (int)list, sh.bittable));
+    sh_clearbit(ptr, (int)list, sh.bitmalloc);
     sh_add_to_list(&sh.freelist[list], ptr);

     /* Try to coalesce two adjacent free areas. */
-    while ((buddy = sh_find_my_buddy(ptr, list)) != NULL) {
-        OPENSSL_assert(ptr == sh_find_my_buddy(buddy, list));
+    while ((buddy = sh_find_my_buddy(ptr, (int)list)) != NULL) {
+        OPENSSL_assert(ptr == sh_find_my_buddy(buddy, (int)list));
         OPENSSL_assert(ptr != NULL);
-        OPENSSL_assert(!sh_testbit(ptr, list, sh.bitmalloc));
-        sh_clearbit(ptr, list, sh.bittable);
+        OPENSSL_assert(!sh_testbit(ptr, (int)list, sh.bitmalloc));
+        sh_clearbit(ptr, (int)list, sh.bittable);
         sh_remove_from_list(ptr);
-        OPENSSL_assert(!sh_testbit(ptr, list, sh.bitmalloc));
-        sh_clearbit(buddy, list, sh.bittable);
+        OPENSSL_assert(!sh_testbit(ptr, (int)list, sh.bitmalloc));
+        sh_clearbit(buddy, (int)list, sh.bittable);
         sh_remove_from_list(buddy);

         list--;
@@ -723,8 +729,8 @@ static void sh_free(void *ptr)
         if (ptr > buddy)
             ptr = buddy;

-        OPENSSL_assert(!sh_testbit(ptr, list, sh.bitmalloc));
-        sh_setbit(ptr, list, sh.bittable);
+        OPENSSL_assert(!sh_testbit(ptr, (int)list, sh.bitmalloc));
+        sh_setbit(ptr, (int)list, sh.bittable);
         sh_add_to_list(&sh.freelist[list], ptr);
         OPENSSL_assert(sh.freelist[list] == ptr);
     }
@@ -737,7 +743,7 @@ static size_t sh_actual_size(char *ptr)
     OPENSSL_assert(WITHIN_ARENA(ptr));
     if (!WITHIN_ARENA(ptr))
         return 0;
-    list = sh_getlist(ptr);
+    list = (int)sh_getlist(ptr);
     OPENSSL_assert(sh_testbit(ptr, list, sh.bittable));
     return sh.arena_size / (ONE << list);
 }
diff --git a/deps/openssl/openssl/crypto/ml_dsa/asm/ml_dsa_ntt-x86_64.pl b/deps/openssl/openssl/crypto/ml_dsa/asm/ml_dsa_ntt-x86_64.pl
new file mode 100644
index 00000000000..96839307609
--- /dev/null
+++ b/deps/openssl/openssl/crypto/ml_dsa/asm/ml_dsa_ntt-x86_64.pl
@@ -0,0 +1,2036 @@
+#! /usr/bin/env perl
+#
+# Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright (c) 2026 Intel Corporation. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+###############################################################################
+# ML-DSA AVX2 Vectorized NTT/INTT Assembly Routines
+#
+# Description:
+#   This file provides optimized x86_64 assembly implementations of the Number
+#   Theoretic Transform (NTT) and inverse NTT (INTT) and their modular Montgomery
+#   reduction building blocks for the ML-DSA signature scheme.
+#
+#   The routines are vectorized using AVX2 instructions, performing
+#   modular arithmetic and butterfly operations on multiple
+#   coefficients in parallel. The mathematical structure and transformations strictly
+#   follow those implemented in the corresponding C code (ml_dsa_ntt.c),
+#   ensuring that this file provides a drop-in, performant backend using the
+#   same algorithms and data layout.
+#   There is dedicated zeta table used for INTT only. It is essentially
+#   reformatted original table from ml_dsa_ntt.c file to reduce INTT compute cycles.
+#
+#   This module supports both the forward (NTT) and inverse (INTT)
+#   polynomial transforms, as well as element-wise NTT-domain polynomial
+#   multiplication, compatible with the ML-DSA cryptographic protocol.
+#
+#   Step, offset and zeta index details provided for NTT and INTT level operations
+#   correspond directly to the original C implementations from ml_dsa_ntt.c file.
+#
+# Notes:
+#   - Uses AVX2 instructions and YMM registers that accommodate 8 32-bit coefficients
+#   - Must be kept functionally synchronized with the math and
+#     interface of ml_dsa_ntt.c
+#   - Data structures, twiddle factors ("zetas"), and constants must match
+#     those in the C implementation
+###############################################################################
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+$win64 = 0;
+$win64 = 1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/);
+
+$avx2 = 0;
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/;
+$dir = $1;
+($xlate = "${dir}x86_64-xlate.pl" and -f $xlate)
+  or ($xlate = "${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate)
+  or die "can't locate x86_64-xlate.pl";
+
+# Check for AVX2 support in assembler
+if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1` =~ /GNU assembler version ([2-9]\.[0-9]+)/) {
+  $avx2 = ($1 >= 2.22);
+}
+
+if (!$avx2
+  && $win64
+  && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/)
+  && `nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)(?:\.([0-9]+))?/)
+{
+  $avx2 = ($1 >= 2.10);
+}
+
+if (!$avx2 && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) {
+    $avx2 = ($2>=3.3); # minimal tested version for AVX2
+}
+
+open OUT, "| \"$^X\" \"$xlate\" $flavour \"$output\""
+  or die "can't call $xlate: $!";
+*STDOUT = *OUT;
+
+# ML-DSA constants
+my $ML_DSA_Q = 8380417;             # Q: 2^23 - 2^13 + 1
+my $ML_DSA_Q_NEG_INV = 4236238847;  # -Q^{-1} mod 2^32
+
+#  The multiplicative inverse of 256 mod Q, in Montgomery form is
+#  ((256^{-1} mod Q) * ((2^32 * 2^32) mod Q)) mod Q = (8347681 * 2365951) mod 8380417
+my $inverse_degree_montgomery = 41978;
+
+if ($avx2>0) {{{
+
+# avx2 feature bit
+my $avx2_mask = (1<<5);
+
+$code .= <<___;
+.text
+
+.extern OPENSSL_ia32cap_P
+
+.globl  ml_dsa_ntt_avx2_capable
+.type   ml_dsa_ntt_avx2_capable,\@abi-omnipotent
+.align 32
+ml_dsa_ntt_avx2_capable:
+    mov     OPENSSL_ia32cap_P+8(%rip), %rcx
+    xor     %eax, %eax
+    and     \$$avx2_mask, %ecx
+    cmovnz  %ecx, %eax
+    ret
+.size   ml_dsa_ntt_avx2_capable, .-ml_dsa_ntt_avx2_capable
+___
+
+###############################################################################
+# multiply_mod_Q
+#
+# Description:
+#   The inputs (A and B) are in YMM registers, where each packs 8 32-bit integers.
+#   The result, (A * B mod Q), is also in a YMM register.
+#   This routine is used as the core modular multiplication step in
+#   NTT butterfly operations.
+#
+# Parameters:
+#   inA      - Input YMM containing 8 32-bit unsigned values (A)
+#   inB      - Input YMM containing 8 32-bit unsigned values (B)
+#   out      - Output YMM for (A * B mod Q)
+#   tmp0-tmp2 - Temporary registers for intermediate values
+#   q_neg_inv- YMM containing -Q^{-1} mod 2^32 (for Montgomery reduction)
+#   q        - YMM containing modulus Q
+#   bcast32  – if 1, `inB` is assumed to have each qword formed by
+#              repeating its low dword (DW|DW). Multiplication uses only
+#              the low dword, avoiding the need for `vmovshdup` when
+#              zetas are uniform across all lanes of `inA`.
+#
+# Output:
+#   out      - Resulting 8 packed 32-bit integers, each (A * B) mod Q
+#
+# Side effects:
+#   Clobbers tmp0, tmp1, tmp2
+#
+# Notes:
+#   inA or inB can also be used as out
+###############################################################################
+sub multiply_mod_Q {
+    my ($inA, $inB, $out,
+        $tmp0, $tmp1, $tmp2,
+        $q_neg_inv, $q, $bcast32) = @_;
+
+    if (!defined($bcast32)) {
+        $bcast32 = 0;
+    }
+
+    $code .= <<___;
+    # Multiply A x B
+    vpmuludq $inA, $inB, $tmp0  # multiply even indexes
+    vmovshdup $inA, $tmp1
+___
+    if ($bcast32 == 0) {
+        $code .= <<___;
+    vmovshdup $inB, $tmp2
+    vpmuludq $tmp1, $tmp2, $tmp1  # multiply odd indexes
+___
+    } else {
+        $code .= <<___;
+    vpmuludq $tmp1, $inB, $tmp1   # multiply odd indexes of inA
+___
+    }
+        $code .= <<___;
+    # Montgomery reduction: t1 = (A x B)[31..0] x Qinv
+    vpmuludq $q_neg_inv, $tmp0, $out
+    vpmuludq $q_neg_inv, $tmp1, $tmp2
+
+    # t2 = t1[31..0] x Q
+    vpmuludq $out, $q, $out
+    vpmuludq $tmp2, $q, $tmp2
+
+    # t3 = (A x B) + t2
+    vpaddq  $out, $tmp0, $out
+    vpaddq  $tmp2, $tmp1, $tmp1
+
+    # out = t3 >> 32
+    vmovshdup $out, $out
+    vpblendd \$0xAA, $tmp1, $out, $out
+
+    # out can be between Q and 2Q, do final reduction
+    vpcmpgtd $out, $q, $tmp0    # $tmp0 = $q > $out ? 0xffffffff : 0
+    vpandn $q, $tmp0, $tmp0     # $tmp0 = ~$tmp0 & $q
+    vpsubd $tmp0, $out, $out    # $out -= $tmp0
+___
+}
+
+###############################################################################
+###############################################################################
+###
+### NTT (Number Theoretic Transform)
+###
+###############################################################################
+###############################################################################
+
+###############################################################################
+# ntt_butterfly
+#
+# Description:
+#   Performs the butterfly operation for a single NTT stage on two input YMM's,
+#   applying a twiddle factor ("zetas"). This is the core step in NTT layers:
+#     - Computes t_odd = w_odd * zetas mod Q (Montgomery form)
+#     - n_even = w_even + t_odd mod Q
+#     - n_odd  = (w_even + Q) - t_odd mod Q
+#   Uses AVX2 instructions to process 8 coefficients at a time.
+#
+# Parameters:
+#   w_even  - YMM containing the "even" values
+#   w_odd   - YMM containing the "odd" values
+#   zetas   - YMM containing the twiddle factor(s)
+#   n_even  - Output YMM for the updated even coefficients
+#   n_odd   - Output YMM for the updated odd coefficients
+#   tmp0, tmp1, tmp2, tmp3 - Temporary registers for intermediate values
+#   q_neg_inv - YMM with -Q^{-1} mod 2^32
+#   q       - YMM with modulus Q
+#   level   - current NTT processing level
+#
+# Output:
+#   n_even  - Updated even coefficients after butterfly and reduction
+#   n_odd   - Updated odd coefficients after butterfly and reduction
+#
+# Side effects:
+#   Clobbers tmp0, tmp1, tmp2, tmp3
+###############################################################################
+sub ntt_butterfly {
+    my ($w_even, $w_odd,
+        $zetas,
+        $n_even, $n_odd,
+        $tmp0, $tmp1, $tmp2, $tmp3,
+        $q_neg_inv, $q, $level) = @_;
+
+    if ($level >= 7) {
+        # level 7: each zeta (B) dword is different
+        &multiply_mod_Q($w_odd, # A
+                        $zetas, # B
+                        $tmp0,  # out (AxB)
+                        $tmp1, $tmp2, $tmp3, # tmp
+                        $q_neg_inv, $q, 0);  # qinv, q, no-bcast32
+    } else {
+        # levels 0 to 6: same zeta (B) dwords within each qword
+        &multiply_mod_Q($w_odd, # A
+                        $zetas, # B
+                        $tmp0,  # out (AxB)
+                        $tmp1, $tmp2, $tmp3, # tmp
+                        $q_neg_inv, $q, 1);  # qinv, q, bcast32
+    }
+    $code .= <<___;
+
+    # t_odd = $tmp0
+
+    # compute new w_odd (n_odd): (w_even + Q) - t_odd
+    vpaddd  $q, $w_even, $tmp1
+    vpsubd  $tmp0, $tmp1, $n_odd
+
+    # compute new w_even (n_even): w_even + t_odd
+    vpaddd  $w_even, $tmp0, $n_even
+
+    # reduce n_even & n_odd
+    # - results can be between Q and 2Q
+    vpcmpgtd $n_even, $q, $tmp0 # $tmp0 = $q > $n_even ? 0xffffffff : 0
+    vpcmpgtd $n_odd, $q, $tmp1  # $tmp1 = $q > $n_odd ? 0xffffffff : 0
+    vpandn $q, $tmp0, $tmp0     # $tmp0 = ~$tmp0 & $q
+    vpandn $q, $tmp1, $tmp1     # $tmp1 = ~$tmp1 & $q
+    vpsubd $tmp0, $n_even, $n_even  # $n_even -= $tmp0
+    vpsubd $tmp1, $n_odd, $n_odd    # $n_odd -= $tmp1
+___
+}
+
+###############################################################################
+# ntt_levels0to2
+#
+# Description: Performs the first three layers (levels 0, 1, and 2) of the NTT.
+#   It works on 8 YMM registers, 8 32-bit coefficients each. Coefficients loaded into
+#   YMM's are separated by 32 coefficients (32 x 4 bytes = 128 bytes). All 8 YMM registers
+#   undergo consecutive butterfly operations with the appropriate "zetas" (twiddle factors) for
+#   each level. This function must be called 4 times with different offsets to process all 256
+#   coefficients.
+#
+# Layer/level details:
+#   - Level 0:  offset = 128, step = 1, uses zeta index 1
+#   - Level 1:  offset =  64, step = 2, uses zeta indexes 2, 3
+#   - Level 2:  offset =  32, step = 4, uses zeta indexes 4, 5, 6, 7
+#
+# Prerequisites:
+#   %rdi    - pointer to the coefficients
+#   %r11    - pointer to the zetas (twiddle factors) table
+#   %ymm14  - register with q_neg_inv (for Montgomery reduction)
+#   %ymm15  - register with modulus Q
+#
+# Arguments:
+#   $off    - offset to the start of a group of 8 coefficients (in bytes, relative to %rdi)
+#             valid values: 0*4, 8*4, 16*4 or 24*4
+#
+# Output:
+#   In-place NTT updated coefficients in memory.
+#
+# Notes:
+#   - Must be invoked 4 times for complete polynomial: offsets 0, 8*4, 16*4, 24*4
+###############################################################################
+
+sub ntt_levels0to2 {
+    my ($off) = @_;
+    $code .= <<___;
+    vmovdqu $off+0*4(%rdi), %ymm0
+    vmovdqu $off+32*4(%rdi), %ymm1
+    vmovdqu $off+64*4(%rdi), %ymm2
+    vmovdqu $off+96*4(%rdi), %ymm3
+    vmovdqu $off+128*4(%rdi), %ymm4
+    vmovdqu $off+160*4(%rdi), %ymm5
+    vmovdqu $off+192*4(%rdi), %ymm6
+    vmovdqu $off+224*4(%rdi), %ymm7
+
+    # ==============================================================
+    # level 0: offset = 128, step = 1
+    # zeta indexes = 1
+
+    vpbroadcastd 1*4(%r11), %ymm13
+___
+    &ntt_butterfly("%ymm0", "%ymm4", "%ymm13", "%ymm0", "%ymm4",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm8", "%ymm9", "%ymm10", "%ymm11",            # tmp
+                   "%ymm14", "%ymm15", 0);                          # qinv, q, level
+    &ntt_butterfly("%ymm1", "%ymm5", "%ymm13", "%ymm1", "%ymm5",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm8", "%ymm9", "%ymm10", "%ymm11",            # tmp
+                   "%ymm14", "%ymm15", 0);                          # qinv, q, level
+    &ntt_butterfly("%ymm2", "%ymm6", "%ymm13", "%ymm2", "%ymm6",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm8", "%ymm9", "%ymm10", "%ymm11",            # tmp
+                   "%ymm14", "%ymm15", 0);                          # qinv, q, level
+    &ntt_butterfly("%ymm3", "%ymm7", "%ymm13", "%ymm3", "%ymm7",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm8", "%ymm9", "%ymm10", "%ymm11",            # tmp
+                   "%ymm14", "%ymm15", 0);                          # qinv, q, level
+    $code .= <<___;
+
+    # ==============================================================
+    # level 1: offset = 64, step = 2
+    # zeta indexes = 2, 3
+
+    vpbroadcastd 2*4(%r11), %ymm13
+___
+    &ntt_butterfly("%ymm0", "%ymm2", "%ymm13", "%ymm0", "%ymm2",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm8", "%ymm9", "%ymm10", "%ymm11",            # tmp
+                   "%ymm14", "%ymm15", 1);                          # qinv, q, level
+    &ntt_butterfly("%ymm1", "%ymm3", "%ymm13", "%ymm1", "%ymm3",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm8", "%ymm9", "%ymm10", "%ymm11",            # tmp
+                   "%ymm14", "%ymm15", 1);                          # qinv, q, level
+    $code .= <<___;
+    vpbroadcastd 3*4(%r11), %ymm13
+___
+    &ntt_butterfly("%ymm4", "%ymm6", "%ymm13", "%ymm4", "%ymm6",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm8", "%ymm9", "%ymm10", "%ymm11",            # tmp
+                   "%ymm14", "%ymm15", 1);                          # qinv, q, level
+    &ntt_butterfly("%ymm5", "%ymm7", "%ymm13", "%ymm5", "%ymm7",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm8", "%ymm9", "%ymm10", "%ymm11",            # tmp
+                   "%ymm14", "%ymm15", 1);                          # qinv, q, level
+$code .= <<___;
+
+    # ==============================================================
+    # level 2: offset = 32, step = 4
+    # zeta indexes = 4, 5, 6, 7
+
+    vpbroadcastd 4*4(%r11), %ymm13
+___
+    &ntt_butterfly("%ymm0", "%ymm1", "%ymm13", "%ymm0", "%ymm1",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm8", "%ymm9", "%ymm10", "%ymm11",            # tmp
+                   "%ymm14", "%ymm15", 2);                          # qinv, q, level
+    $code .= <<___;
+    vpbroadcastd 5*4(%r11), %ymm13
+___
+    &ntt_butterfly("%ymm2", "%ymm3", "%ymm13", "%ymm2", "%ymm3",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm8", "%ymm9", "%ymm10", "%ymm11",            # tmp
+                   "%ymm14", "%ymm15", 2);                          # qinv, q, level
+    $code .= <<___;
+    vpbroadcastd 6*4(%r11), %ymm13
+___
+    &ntt_butterfly("%ymm4", "%ymm5", "%ymm13", "%ymm4", "%ymm5",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm8", "%ymm9", "%ymm10", "%ymm11",            # tmp
+                   "%ymm14", "%ymm15", 2);                          # qinv, q, level
+    $code .= <<___;
+    vpbroadcastd 7*4(%r11), %ymm13
+___
+    &ntt_butterfly("%ymm6", "%ymm7", "%ymm13", "%ymm6", "%ymm7",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm8", "%ymm9", "%ymm10", "%ymm11",            # tmp
+                   "%ymm14", "%ymm15", 2);                          # qinv, q, level
+$code .= <<___;
+
+    vmovdqu %ymm0, $off+0*4(%rdi)
+    vmovdqu %ymm1, $off+32*4(%rdi)
+    vmovdqu %ymm2, $off+64*4(%rdi)
+    vmovdqu %ymm3, $off+96*4(%rdi)
+    vmovdqu %ymm4, $off+128*4(%rdi)
+    vmovdqu %ymm5, $off+160*4(%rdi)
+    vmovdqu %ymm6, $off+192*4(%rdi)
+    vmovdqu %ymm7, $off+224*4(%rdi)
+___
+}
+
+###############################################################################
+# ntt_levels3to7
+#
+# Description:
+#   Performs layers 3 through 7 of the NTT on 64 coefficients.
+#
+#   It operates on 8 YMM's registers, each YMM packs 8 32-bit coefficients (64
+#   in total).
+#   Contiguous coefficients are loaded into the YMM registers (no gap between them).
+#
+#   The function must be called 4 times to process 256 coefficients.  At each level, the
+#   function executes butterfly operations in the correct coefficient pattern and applies the
+#   corresponding twiddle factors ("zetas").
+#
+# Layer/level details:
+#   - Level 3: offset = 16, step = 8;   zeta indexes 8...15
+#   - Level 4: offset =  8, step = 16;  zeta indexes 16...31
+#   - Level 5: offset =  4, step = 32;  zeta indexes 32...63
+#   - Level 6: offset =  2, step = 64;  zeta indexes 64...127
+#   - Level 7: offset =  1, step = 128; zeta indexes 128...255
+#
+# Prerequisites:
+#   %rdi    - pointer to the coefficients
+#   %r11    - pointer to the zetas (twiddle factors) table
+#   %ymm14  - q_neg_inv (Montgomery reduction)
+#   %ymm15  - Q (modulus)
+#
+# Arguments:
+#   $off, $l3, $l4, $l5, $l6, $l7
+#     $off - offset to the start of a set of 8 coefficients (in bytes, relative to %rdi)
+#     $l3, $l4, $l5, $l6, $l7 - offsets to required zetas in the table, for levels 3 to 7
+#
+# Output:
+#   In-place NTT-transformed coefficients for the selected group.
+#
+# Notes:
+#   - Should be called 4 times per complete 256-coefficient transform (offsets 0, 64*4, 128*4, 192*4).
+#   - All butterfly operations and twiddle applications handled by subroutine ntt_butterfly.
+###############################################################################
+sub ntt_levels3to7 {
+    my ($off,$l3,$l4,$l5,$l6,$l7) = @_;
+
+    $code .= <<___;
+    # ==============================================================
+    # level 3: offset = 16, step = 8
+    # zeta indexes = 8, 9, 10, 11, 12, 13, 14, 15
+
+    # broadcast zetas
+    vpbroadcastd $l3(%r11), %ymm13  # zeta for coefficients 0-15
+
+    # load w_even and w_odd
+    vmovdqu $off(%rdi), %ymm0       # w_even[0:7]
+    vmovdqu $off+32(%rdi), %ymm1    # w_even[8:15]
+    vmovdqu $off+64(%rdi), %ymm2    # w_odd[0:7]
+    vmovdqu $off+96(%rdi), %ymm3    # w_odd[8:15]
+___
+    # Process first 16 coefficients with zeta in ymm13
+    &ntt_butterfly("%ymm0", "%ymm2", "%ymm13", "%ymm0", "%ymm2",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 3);                          # qinv, q, level
+    &ntt_butterfly("%ymm1", "%ymm3", "%ymm13", "%ymm1", "%ymm3",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 3);                          # qinv, q, level
+$code .= <<___;
+    # broadcast zetas
+    vpbroadcastd $l3+4(%r11), %ymm13  # zeta for coefficients 16-31
+
+    # load w_even and w_odd
+    vmovdqu $off+128(%rdi), %ymm4   # w_even[16:23]
+    vmovdqu $off+160(%rdi), %ymm5   # w_even[24:31]
+    vmovdqu $off+192(%rdi), %ymm6  # w_odd[16:23]
+    vmovdqu $off+224(%rdi), %ymm7  # w_odd[24:31]
+___
+    # Process next 16 coefficients with zeta in ymm13
+    &ntt_butterfly("%ymm4", "%ymm6", "%ymm13", "%ymm4", "%ymm6",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 3);                          # qinv, q, level
+    &ntt_butterfly("%ymm5", "%ymm7", "%ymm13", "%ymm5", "%ymm7",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 3);                          # qinv, q, level
+$code .= <<___;
+
+    # ==============================================================
+    # level 4: offset = 8, step = 16
+    # zeta indexes = 16, 17, 18, ..., 30, 31
+
+    # broadcast zetas for first 8 coefficients
+    vpbroadcastd $l4(%r11), %ymm13      # zeta for coefficients 0-7
+
+    # Prepare w_even and w_odd
+    # Input dword layout:
+    #   ymm0 = [ 0  1  2  3 |  4  5  6  7] (even)
+    #   ymm1 = [ 8  9 10 11 | 12 13 14 15] (even)
+    #   ymm2 = [16 17 18 19 | 20 21 22 23] (odd)
+    #   ymm3 = [24 25 26 27 | 28 29 30 31] (odd)
+    # Required dword layout is the same:
+    #   ymm0 = [ 0  1  2  3 |  4  5  6  7] (even)
+    #   ymm1 = [ 8  9 10 11 | 12 13 14 15] (odd)
+    #   ymm2 = [16 17 18 19 | 20 21 22 23] (even)
+    #   ymm3 = [24 25 26 27 | 28 29 30 31] (odd)
+
+___
+    &ntt_butterfly("%ymm0", "%ymm1", "%ymm13", "%ymm0", "%ymm1",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 4);                          # qinv, q, level
+$code .= <<___;
+    # broadcast zetas for next 8 coefficients
+    vpbroadcastd $l4+4(%r11), %ymm13    # zeta for coefficients 8-15
+___
+    &ntt_butterfly("%ymm2", "%ymm3", "%ymm13", "%ymm2", "%ymm3",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 4);                          # qinv, q, level
+    $code .= <<___;
+    # broadcast zetas for next 8 coefficients
+    vpbroadcastd $l4+8(%r11), %ymm13    # zeta for coefficients 16-23
+___
+    &ntt_butterfly("%ymm4", "%ymm5", "%ymm13", "%ymm4", "%ymm5",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 4);                          # qinv, q, level
+$code .= <<___;
+    # broadcast zetas for next 8 coefficients
+    vpbroadcastd $l4+12(%r11), %ymm13   # zeta for coefficients 24-31
+___
+    &ntt_butterfly("%ymm6", "%ymm7", "%ymm13", "%ymm6", "%ymm7",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 4);                          # qinv, q, level
+    $code .= <<___;
+
+    # ==============================================================
+    # level 5: offset = 4, step = 32
+    # zeta indexes = 32, 33, 34, ..., 62, 63
+
+    # prepare w_even and w_odd
+    # Input dword layout:
+    #   ymm0 = [ 0  1  2  3 |  4  5  6  7] (even)
+    #   ymm1 = [ 8  9 10 11 | 12 13 14 15] (odd)
+    # Required dword layout:
+    #   ymm8 = [ 0  1  2  3 |  8  9 10 11] (even)
+    #   ymm1 = [ 4  5  6  7 | 12 13 14 15] (odd)
+    vperm2i128 \$0x20, %ymm1, %ymm0, %ymm8
+    vperm2i128 \$0x31, %ymm1, %ymm0, %ymm1
+
+    # load zetas for first 8 coefficients
+    vpbroadcastd $l5(%r11), %ymm13         # zetas for coefficients 0-3
+    vpbroadcastd $l5+4(%r11), %ymm12       # zetas for coefficients 4-7
+    vpblendd \$0xf0, %ymm12, %ymm13, %ymm13 # blend into ymm13
+
+___
+    &ntt_butterfly("%ymm8", "%ymm1", "%ymm13", "%ymm0", "%ymm1",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 5);                          # qinv, q, level
+$code .= <<___;
+    # prepare w_even and w_odd
+    vperm2i128 \$0x20, %ymm3, %ymm2, %ymm8
+    vperm2i128 \$0x31, %ymm3, %ymm2, %ymm3
+
+    # load zetas for first 8 coefficients
+    vpbroadcastd $l5+8(%r11), %ymm13        # zetas for coefficients 8-11
+    vpbroadcastd $l5+12(%r11), %ymm12       # zetas for coefficients 12-15
+    vpblendd \$0xf0, %ymm12, %ymm13, %ymm13 # blend into ymm13
+
+___
+    &ntt_butterfly("%ymm8", "%ymm3", "%ymm13", "%ymm2", "%ymm3",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 5);                          # qinv, q, level
+    $code .= <<___;
+    # prepare w_even and w_odd
+    vperm2i128 \$0x20, %ymm5, %ymm4, %ymm8
+    vperm2i128 \$0x31, %ymm5, %ymm4, %ymm5
+
+    # load zetas for next 8 coefficients
+    vpbroadcastd $l5+16(%r11), %ymm13       # zetas for coefficients 16-19
+    vpbroadcastd $l5+20(%r11), %ymm12       # zetas for coefficients 20-23
+    vpblendd \$0xf0, %ymm12, %ymm13, %ymm13 # blend into ymm13
+
+___
+    &ntt_butterfly("%ymm8", "%ymm5", "%ymm13", "%ymm4", "%ymm5",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 5);                          # qinv, q, level
+$code .= <<___;
+    # prepare w_even and w_odd
+    vperm2i128 \$0x20, %ymm7, %ymm6, %ymm8
+    vperm2i128 \$0x31, %ymm7, %ymm6, %ymm7
+
+    # load zetas for next 8 coefficients
+    vpbroadcastd $l5+24(%r11), %ymm13       # zetas for coefficients 24-27
+    vpbroadcastd $l5+28(%r11), %ymm12       # zetas for coefficients 28-31
+    vpblendd \$0xf0, %ymm12, %ymm13, %ymm13 # blend into ymm13
+
+___
+    &ntt_butterfly("%ymm8", "%ymm7", "%ymm13", "%ymm6", "%ymm7",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 5);                          # qinv, q, level
+    $code .= <<___;
+
+    # ==============================================================
+    # level 6: offset = 2, step = 64
+    # zeta indexes = 64, 65, 66, ..., 62, 127
+
+    # Input DWORD layout in memory:
+    #   ymm0 = [ 0  1  2  3] [ 8  9 10 11] (even)
+    #   ymm1 = [ 4  5  6  7] [12 13 14 15] (odd)
+    #   ymm2 = [16 17 18 19] [24 25 26 27] (even)
+    #   ymm3 = [20 21 22 23] [28 29 30 31] (odd)
+    # Desired DWORD layout:
+    #   ymm8 = [ 0  1  4  5] [ 8  9 12 13] (even)
+    #   ymm1 = [ 2  3  6  7] [10 11 14 15] (odd)
+
+    # load & prepare zetas
+    # - it is enough that the 1st dword of each qword is populated
+    vmovdqu $l6(%r11), %xmm13
+    vpmovzxdq %xmm13, %ymm13
+
+    # prepare w_even and w_odd
+    vpunpcklqdq %ymm1, %ymm0, %ymm8
+    vpunpckhqdq %ymm1, %ymm0, %ymm1
+___
+    &ntt_butterfly("%ymm8", "%ymm1", "%ymm13", "%ymm0", "%ymm1",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 6);                          # qinv, q, level
+    $code .= <<___;
+    # load & prepare zetas
+    vmovdqu $l6+16(%r11), %xmm13
+    vpmovzxdq %xmm13, %ymm13
+
+    # prepare w_even and w_odd
+    vpunpcklqdq %ymm3, %ymm2, %ymm8
+    vpunpckhqdq %ymm3, %ymm2, %ymm3
+___
+    &ntt_butterfly("%ymm8", "%ymm3", "%ymm13", "%ymm2", "%ymm3",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 6);                          # qinv, q, level
+    $code .= <<___;
+
+    # load & prepare zetas
+    vmovdqu $l6+32(%r11), %xmm13
+    vpmovzxdq %xmm13, %ymm13
+
+    # prepare w_even and w_odd
+    vpunpcklqdq %ymm5, %ymm4, %ymm8
+    vpunpckhqdq %ymm5, %ymm4, %ymm5
+___
+    &ntt_butterfly("%ymm8", "%ymm5", "%ymm13", "%ymm4", "%ymm5",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 6);                          # qinv, q, level
+$code .= <<___;
+    # load & prepare zetas
+    vmovdqu $l6+48(%r11), %xmm13
+    vpmovzxdq %xmm13, %ymm13
+
+    # prepare w_even and w_odd
+    vpunpcklqdq %ymm7, %ymm6, %ymm8
+    vpunpckhqdq %ymm7, %ymm6, %ymm7
+___
+    &ntt_butterfly("%ymm8", "%ymm7", "%ymm13", "%ymm6", "%ymm7",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 6);                          # qinv, q, level
+    $code .= <<___;
+
+    # ==============================================================
+    # level 7: offset = 1, step = 128
+    # zeta indexes = 128, 129, 130, ..., 254, 255
+
+    # Input DWORD layout:
+    #   ymm0 = [ 0  1  4  5] [ 8  9 12 13]
+    #   ymm1 = [ 2  3  6  7] [10 11 14 15]
+    # Required DWORD layout:
+    #   ymm0 = [ 0  2  4  6] [ 8 10 12 14] (even)
+    #   ymm1 = [ 1  3  5  7] [ 9 11 13 15] (odd)
+
+    vpunpckldq   %ymm1, %ymm0, %ymm8      # ymm8 = [0 2 1 3] [ 8 10  9 11]
+    vpunpckhdq   %ymm1, %ymm0, %ymm9      # ymm9 = [4 6 5 7] [12 14 13 15]
+
+    vshufps      \$0xEE, %ymm9, %ymm8, %ymm1   # ymm1 = [1 3 5 7] [ 9 11 13 15]
+    vshufps      \$0x44, %ymm9, %ymm8, %ymm0   # ymm0 = [0 2 4 6] [ 8 10 12 14]
+
+    # load zetas
+    vmovdqu $l7(%r11), %ymm13          # 8 zetas for coefficients 0-7
+___
+    &ntt_butterfly("%ymm0", "%ymm1", "%ymm13", "%ymm0", "%ymm1",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 7);                          # qinv, q, level
+$code .= <<___;
+    # load zetas
+    vmovdqu $l7+32(%r11), %ymm13       # 8 zetas for coefficients 8-15
+
+    # format w_even and w_odd
+    vpunpckldq   %ymm3, %ymm2, %ymm8
+    vpunpckhdq   %ymm3, %ymm2, %ymm9
+
+    vshufps      \$0xEE, %ymm9, %ymm8, %ymm3
+    vshufps      \$0x44, %ymm9, %ymm8, %ymm2
+___
+    &ntt_butterfly("%ymm2", "%ymm3", "%ymm13", "%ymm2", "%ymm3",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 7);                          # qinv, q, level
+    $code .= <<___;
+
+    # load zetas
+    vmovdqu $l7+64(%r11), %ymm13       # 8 zetas for coefficients 16-23
+
+    # format w_even and w_odd
+    vpunpckldq   %ymm5, %ymm4, %ymm8
+    vpunpckhdq   %ymm5, %ymm4, %ymm9
+
+    vshufps      \$0xEE, %ymm9, %ymm8, %ymm5
+    vshufps      \$0x44, %ymm9, %ymm8, %ymm4
+___
+    &ntt_butterfly("%ymm4", "%ymm5", "%ymm13", "%ymm4", "%ymm5",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 7);                          # qinv, q, level
+$code .= <<___;
+    # load zetas
+    vmovdqu $l7+96(%r11), %ymm13       # 8 zetas for coefficients 24-31
+
+    # format w_even and w_odd
+    vpunpckldq   %ymm7, %ymm6, %ymm8
+    vpunpckhdq   %ymm7, %ymm6, %ymm9
+
+    vshufps      \$0xEE, %ymm9, %ymm8, %ymm7
+    vshufps      \$0x44, %ymm9, %ymm8, %ymm6
+___
+    &ntt_butterfly("%ymm6", "%ymm7", "%ymm13", "%ymm6", "%ymm7",    # w_even, w_odd, zetas, n_even, n_odd
+                   "%ymm9", "%ymm10", "%ymm11", "%ymm12",           # tmp
+                   "%ymm14", "%ymm15", 7);                          # qinv, q, level
+    $code .= <<___;
+
+    # Interleave and store first 16
+    vpunpckldq %ymm1, %ymm0, %ymm8
+    vpunpckhdq %ymm1, %ymm0, %ymm9
+
+    vperm2i128 \$0x20, %ymm9, %ymm8, %ymm10
+    vperm2i128 \$0x31, %ymm9, %ymm8, %ymm11
+    vmovdqu %ymm10, $off(%rdi)
+    vmovdqu %ymm11, $off+32(%rdi)
+
+    vpunpckldq  %ymm3, %ymm2, %ymm8
+    vpunpckhdq  %ymm3, %ymm2, %ymm9
+
+    vperm2i128 \$0x20, %ymm9, %ymm8, %ymm10
+    vperm2i128 \$0x31, %ymm9, %ymm8, %ymm11
+    vmovdqu %ymm10, $off+64(%rdi)
+    vmovdqu %ymm11, $off+96(%rdi)
+
+    # Interleave and store second 16
+    vpunpckldq %ymm5, %ymm4, %ymm8
+    vpunpckhdq %ymm5, %ymm4, %ymm9
+
+    vperm2i128 \$0x20, %ymm9, %ymm8, %ymm10
+    vperm2i128 \$0x31, %ymm9, %ymm8, %ymm11
+    vmovdqu %ymm10, $off+128(%rdi)
+    vmovdqu %ymm11, $off+160(%rdi)
+
+    vpunpckldq  %ymm7, %ymm6, %ymm8
+    vpunpckhdq  %ymm7, %ymm6, %ymm9
+
+    vperm2i128 \$0x20, %ymm9, %ymm8, %ymm10
+    vperm2i128 \$0x31, %ymm9, %ymm8, %ymm11
+    vmovdqu %ymm10, $off+192(%rdi)
+    vmovdqu %ymm11, $off+224(%rdi)
+___
+}
+
+###############################################################################
+###############################################################################
+###
+### INTT (Inverse Number Theoretic Transform)
+###
+###############################################################################
+###############################################################################
+
+###############################################################################
+# intt_butterfly
+#
+# Description:
+#   Performs the butterfly operation for a single stage of the INTT
+#   on two 8-element vectors of 32-bit integers (YMM).
+#
+#   Implements the core data-mixing and modular multiplication steps with a
+#   zeta (twiddle factor), including the modular reductions. The updated even and
+#   odd results are put into the designated registers.
+#
+#   This butterfly operation computes:
+#     n_even = (w_even + w_odd) mod Q
+#     n_odd  = ((w_even + Q) - w_odd) * zetas mod Q
+#   where Q is the NTT modulus, and zetas is the power of a primitive root used
+#   for this stage.
+#
+# Parameters:
+#   w_even    - YMM with "even" input coefficients
+#   w_odd     - YMM with "odd" input coefficients
+#   zetas     - YMM with modular twiddle factors for this butterfly
+#   tmp0-tmp2 - Scratch YMM registers for temporary/intermediate values
+#   n_even    - Output YMM for new even coefficients
+#   n_odd     - Output YMM for new odd coefficients
+#   q_neg_inv - YMM with -Q^{-1} mod 2^32 for Montgomery reduction
+#   q         - YMM with modulus Q
+#   level     - current INTT processing level
+#
+# Output:
+#   n_even, n_odd
+#
+# Side effects:
+#   Clobbers tmp0, tmp1, tmp2
+###############################################################################
+
+sub intt_butterfly {
+    my ($w_even, $w_odd, $zetas,
+        $tmp0, $tmp1, $tmp2,
+        $n_even, $n_odd,
+        $q_neg_inv, $q, $level) = @_;
+
+$code .= <<___;
+    # n_even = reduce_once(w_even + w_odd)
+    # n_odd = (w_even + Q) - w_odd
+    vpaddd $q, $w_even, $tmp1           # n_odd: tmp1 = w_even + Q
+    vpaddd $w_even, $w_odd, $n_even     # n_even: n_even = w_even + w_odd
+    vpsubd $w_odd, $tmp1, $n_odd        # n_odd: n_odd = tmp1 - w_odd
+
+    vpcmpgtd $n_even, $q, $tmp0         # n_even: tmp0 = $q > $n_even ? 0xffffffff : 0
+    vpandn $q, $tmp0, $tmp0             # n_even: tmp0 = ~$tmp0 & $q
+    vpsubd $tmp0, $n_even, $n_even      # n_even: n_even -= $tmp0
+
+    # Multiply n_odd by zetas (step root)
+___
+    if ($level < 1) {
+        # level 0: each zeta (B) dword is different
+        &multiply_mod_Q($n_odd,     # A
+                        $zetas,     # B
+                        $n_odd,     # out (AxB)
+                        $tmp0, $tmp1, $tmp2,    # tmp
+                        $q_neg_inv, $q, 0);     # qinv, q, no-bcast32
+    } else {
+        # levels 1 to 7: same zeta (B) dwords within each qword
+        &multiply_mod_Q($n_odd,     # A
+                        $zetas,     # B
+                        $n_odd,     # out (AxB)
+                        $tmp0, $tmp1, $tmp2,    # tmp
+                        $q_neg_inv, $q, 1);     # qinv, q, bcast32
+    }
+}
+
+###############################################################################
+# intt_levels0to4
+#
+# Description:
+#   Executes the first five stages (levels 0–4) of the INTT
+#   on groups of 32 coefficients (4 YMM registers).
+#
+#   This function hierarchically mixes and transforms groups of coefficients using
+#   butterfly operations and level specific zeta (twiddle) factors, performing all required
+#   re-packing and permutations for each layer.
+#
+#   Each call operates on a block of 64 coefficients, and must be repeated 4 times (with
+#   offsets 0, 64*4, 128*4, 192*4) to process all 256 coefficients.
+#
+# Layer/Level details:
+#   - Level 0: offset = 1,   step = 128;  zeta indexes (new) = 0..127
+#   - Level 1: offset = 2,   step = 64;   zeta indexes (new) = 128..191
+#   - Level 2: offset = 4,   step = 32;   zeta indexes (new) = 192..223
+#   - Level 3: offset = 8,   step = 16;   zeta indexes (new) = 224..239
+#   - Level 4: offset = 16,  step = 8;    zeta indexes (new) = 240..247
+#
+# Prerequisites:
+#   %rdi    - pointer to the coefficients array
+#   %r11    - pointer to the zetas (twiddle factors) table
+#   %ymm14  - q_neg_inv (for Montgomery reduction)
+#   %ymm15  - Q (modulus)
+#
+# Arguments:
+#   $off    - offset (in bytes) to the start of the 16-coefficient group
+#   $l0-$l4 - offsets (in bytes) into the zeta table for each INTT level 0..4
+#
+# Output:
+#   Updated coefficients are written in-place in memory.
+#
+# Notes:
+#   - Function must be called 4 times for a full 256-coefficient INTT layer sweep.
+###############################################################################
+
+sub intt_levels0to4 {
+    my ($off,$l0,$l1,$l2,$l3,$l4) = @_;
+    $code .= <<___;
+    # ==============================================================
+    # level 0: offset = 1, step = 128
+    # zeta indexes (original table) = 255, 254, 253, ... 129, 128
+    # zeta indexes (new table) = 0, 1, 2, .. 127
+
+    # dword layout in memory:
+    #   ymm0 = [0,1,2,3 | 4,5,6,7]
+    #   ymm1 = [8,9,10,11 | 12,13,14,15]
+    # required dword layout in registers:
+    #   ymm0 = [0,2,4,6 | 8,10,12,14]
+    #   ymm1 = [1,3,5,7 | 9,11,13,15]
+
+    # load w_even and w_odd
+    vmovdqu $off(%rdi), %ymm8
+    vmovdqu $off+32(%rdi), %ymm9
+
+    # compact even words into ymm0 (w_even[0:7])
+    vmovdqa idx_even(%rip), %ymm13
+    vpermd %ymm8, %ymm13, %ymm10            # [ 0, 2, 4, 6 | 0, 2, 4, 6]
+    vpermd %ymm9, %ymm13, %ymm11            # [ 8,10,12,14 | 8,10,12,14]
+    vpblendd \$0xf0, %ymm11, %ymm10, %ymm0  # [ 0, 2, 4, 6 | 8,10,12,14]
+
+    # compact odd words into ymm1 (w_odd[0..7])
+    vmovdqa idx_odd(%rip), %ymm13
+    vpermd %ymm8, %ymm13, %ymm10            # [ 1, 3, 5, 7 | 1, 3, 5, 7]
+    vpermd %ymm9, %ymm13, %ymm11            # [ 9,11,13,15 | 9,11,13,15]
+    vpblendd \$0xf0, %ymm11, %ymm10, %ymm1  # [ 1, 3, 5, 7 | 9,11,13,15]
+
+    # load 16 zetas
+    vmovdqu $l0(%r11), %ymm13
+
+___
+
+    &intt_butterfly("%ymm0", "%ymm1", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm0", "%ymm1",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 0);         # qinv, q, level
+
+$code .= <<___;
+
+    # load w_even and w_odd
+    vmovdqu $off+64(%rdi), %ymm8
+    vmovdqu $off+96(%rdi), %ymm9
+
+    # compact even words into ymm2 (w_even[8..15])
+    vmovdqa idx_even(%rip), %ymm13
+    vpermd %ymm8, %ymm13, %ymm10
+    vpermd %ymm9, %ymm13, %ymm11
+    vpblendd \$0xf0, %ymm11, %ymm10, %ymm2
+
+    # compact odd words into ymm3 (w_odd[8..15])
+    vmovdqa idx_odd(%rip), %ymm13
+    vpermd %ymm8, %ymm13, %ymm10
+    vpermd %ymm9, %ymm13, %ymm11
+    vpblendd \$0xf0, %ymm11, %ymm10, %ymm3
+
+    # load 16 zetas
+    vmovdqu $l0+32(%r11), %ymm13
+
+___
+
+    &intt_butterfly("%ymm2", "%ymm3", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm2", "%ymm3",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 0);         # qinv, q, level
+
+$code .= <<___;
+    # load w_even and w_odd
+    vmovdqu $off+128(%rdi), %ymm8
+    vmovdqu $off+160(%rdi), %ymm9
+
+    # compact even words into ymm4 (w_even[16..23])
+    vmovdqa idx_even(%rip), %ymm13
+    vpermd %ymm8, %ymm13, %ymm10            # [ 0, 2, 4, 6 | 0, 2, 4, 6]
+    vpermd %ymm9, %ymm13, %ymm11            # [ 8,10,12,14 | 8,10,12,14]
+    vpblendd \$0xf0, %ymm11, %ymm10, %ymm4  # [ 0, 2, 4, 6 | 8,10,12,14]
+
+    # compact odd words into ymm5 (w_odd[16..23])
+    vmovdqa idx_odd(%rip), %ymm13
+    vpermd %ymm8, %ymm13, %ymm10            # [ 1, 3, 5, 7 | 1, 3, 5, 7]
+    vpermd %ymm9, %ymm13, %ymm11            # [ 9,11,13,15 | 9,11,13,15]
+    vpblendd \$0xf0, %ymm11, %ymm10, %ymm5  # [ 1, 3, 5, 7 | 9,11,13,15]
+
+    # load 16 zetas
+    vmovdqu $l0+64(%r11), %ymm13
+
+___
+
+    &intt_butterfly("%ymm4", "%ymm5", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm4", "%ymm5",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 0);         # qinv, q, level
+
+$code .= <<___;
+
+    # load w_even and w_odd
+    vmovdqu $off+192(%rdi), %ymm8
+    vmovdqu $off+224(%rdi), %ymm9
+
+    # compact even words into ymm6 (w_even[24..31])
+    vmovdqa idx_even(%rip), %ymm13
+    vpermd %ymm8, %ymm13, %ymm10
+    vpermd %ymm9, %ymm13, %ymm11
+    vpblendd \$0xf0, %ymm11, %ymm10, %ymm6
+
+    # compact odd words into ymm7 (w_odd[24..31])
+    vmovdqa idx_odd(%rip), %ymm13
+    vpermd %ymm8, %ymm13, %ymm10
+    vpermd %ymm9, %ymm13, %ymm11
+    vpblendd \$0xf0, %ymm11, %ymm10, %ymm7
+
+    # load 16 zetas
+    vmovdqu $l0+96(%r11), %ymm13
+
+___
+
+    &intt_butterfly("%ymm6", "%ymm7", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm6", "%ymm7",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 0);         # qinv, q, level
+
+$code .= <<___;
+
+    # ==============================================================
+    # level 1: offset = 2, step = 64
+    # zeta indexes = 127, 126, 125, ... 65, 64
+    # zeta indexes (new) = 128, 129, .. 191
+
+    # Result DWORD layout:
+    #   ymm0 = [0,  2,  4,  6,  8, 10, 12, 14]
+    #   ymm1 = [1,  3,  5,  7,  9, 11, 13, 15]
+    # Desired layout for this phase:
+    #   %ymm0 = [0,1,4,5,8,9,12,13]
+    #   %ymm1 = [2,3,6,7,10,11,14,15]
+
+    # Interleave even/odd within each 128-bit lane:
+    vpunpckldq %ymm1, %ymm0, %ymm8     # A = [0,1,2,3 | 8,9,10,11]
+    vpunpckhdq %ymm1, %ymm0, %ymm9     # B = [4,5,6,7 | 12,13,14,15]
+
+    # [0,1,4,5 | 8,9,12,13]
+    vshufps \$0x44, %ymm9, %ymm8, %ymm0
+
+    # [2,3,6,7 | 10,11,14,15]
+    vshufps \$0xee, %ymm9, %ymm8, %ymm1
+
+    # load 4 zetas and populate across ymm
+    vmovdqu $l1(%r11), %xmm13
+    vpmovzxdq %xmm13, %ymm13            # [0 - 1 -] [2 - 3 -]
+___
+
+    &intt_butterfly("%ymm0", "%ymm1", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm0", "%ymm1",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 1);         # qinv, q, level
+
+$code .= <<___;
+
+    # Interleave even/odd within each 128-bit lane:
+    vpunpckldq %ymm3, %ymm2, %ymm8     # A = [0,1,2,3 | 8,9,10,11]
+    vpunpckhdq %ymm3, %ymm2, %ymm9     # B = [4,5,6,7 | 12,13,14,15]
+
+    # ymm2 = [0,1,4,5 | 8,9,12,13]
+    vshufps \$0x44, %ymm9, %ymm8, %ymm2
+
+    # ymm3 = [2,3,6,7 | 10,11,14,15]
+    vshufps \$0xee, %ymm9, %ymm8, %ymm3
+
+    # load 4 zetas and populate across YMM
+    vmovdqu $l1+16(%r11), %xmm13
+    vpmovzxdq %xmm13, %ymm13            # [0 - 1 -] [2 - 3 -]
+___
+
+    &intt_butterfly("%ymm2", "%ymm3", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm2", "%ymm3",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 1);         # qinv, q, level
+
+$code .= <<___;
+    # Interleave even/odd within each 128-bit lane:
+    vpunpckldq %ymm5, %ymm4, %ymm8     # A = [0,1,2,3 | 8,9,10,11]
+    vpunpckhdq %ymm5, %ymm4, %ymm9     # B = [4,5,6,7 | 12,13,14,15]
+
+    # [0,1,4,5 | 8,9,12,13]
+    vshufps \$0x44, %ymm9, %ymm8, %ymm4
+
+    # [2,3,6,7 | 10,11,14,15]
+    vshufps \$0xee, %ymm9, %ymm8, %ymm5
+
+    # load 4 zetas and populate across ymm
+    vmovdqu $l1+32(%r11), %xmm13
+    vpmovzxdq %xmm13, %ymm13            # [0 - 1 -] [2 - 3 -]
+___
+
+    &intt_butterfly("%ymm4", "%ymm5", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm4", "%ymm5",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 1);         # qinv, q, level
+
+$code .= <<___;
+
+    # Interleave even/odd within each 128-bit lane:
+    vpunpckldq %ymm7, %ymm6, %ymm8     # A = [0,1,2,3 | 8,9,10,11]
+    vpunpckhdq %ymm7, %ymm6, %ymm9     # B = [4,5,6,7 | 12,13,14,15]
+
+    # ymm6 = [0,1,4,5 | 8,9,12,13]
+    vshufps \$0x44, %ymm9, %ymm8, %ymm6
+
+    # ymm7 = [2,3,6,7 | 10,11,14,15]
+    vshufps \$0xee, %ymm9, %ymm8, %ymm7
+
+    # load 4 zetas and populate across YMM
+    vmovdqu $l1+48(%r11), %xmm13
+    vpmovzxdq %xmm13, %ymm13            # [0 - 1 -] [2 - 3 -]
+___
+
+    &intt_butterfly("%ymm6", "%ymm7", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm6", "%ymm7",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 1);         # qinv, q, level
+
+$code .= <<___;
+
+    # ==============================================================
+    # level 2: offset = 4, step = 32
+    # zeta indexes = 63, 62, 61, ... 33, 32
+    # zeta indexes (new) = 192, 193, 194, ... 223
+
+    # Result DWORD layout:
+    #   ymm0 = [0,1,4,5,8,9,12,13]
+    #   ymm1 = [16,17,20,21,24,25,28,29]
+    # Desired layout:
+    #   ymm8  = [0,1,2,3, 8,9,10,11]
+    #   ymm1 = [4,5,6,7, 12,13,14,15]
+
+    # ymm8 = [0,1,2,3 | 8,9,10,11]
+    vshufps \$0x44, %ymm1, %ymm0, %ymm8
+
+    # ymm1 = [4,5,6,7 | 12,13,14,15]
+    vshufps \$0xee, %ymm1, %ymm0, %ymm1
+
+    # broadcast zetas
+    vpbroadcastd $l2(%r11), %ymm13
+    vpbroadcastd $l2+4(%r11), %ymm12
+    vpblendd \$0xf0, %ymm12, %ymm13, %ymm13
+___
+
+    &intt_butterfly("%ymm8", "%ymm1", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm0", "%ymm1",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 2);         # qinv, q, level
+
+$code .= <<___;
+    vshufps \$0x44, %ymm3, %ymm2, %ymm8
+    vshufps \$0xee, %ymm3, %ymm2, %ymm3
+
+    # broadcast zetas
+    vpbroadcastd $l2+8(%r11), %ymm13
+    vpbroadcastd $l2+12(%r11), %ymm12
+    vpblendd \$0xf0, %ymm12, %ymm13, %ymm13
+___
+
+    &intt_butterfly("%ymm8", "%ymm3", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm2", "%ymm3",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 2);         # qinv, q, level
+
+$code .= <<___;
+    vshufps \$0x44, %ymm5, %ymm4, %ymm8
+    vshufps \$0xee, %ymm5, %ymm4, %ymm5
+
+    # broadcast zetas
+    vpbroadcastd $l2+16(%r11), %ymm13
+    vpbroadcastd $l2+20(%r11), %ymm12
+    vpblendd \$0xf0, %ymm12, %ymm13, %ymm13
+___
+
+    &intt_butterfly("%ymm8", "%ymm5", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm4", "%ymm5",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 2);         # qinv, q, level
+
+$code .= <<___;
+    vshufps \$0x44, %ymm7, %ymm6, %ymm8
+    vshufps \$0xee, %ymm7, %ymm6, %ymm7
+
+    # broadcast zetas
+    vpbroadcastd $l2+24(%r11), %ymm13
+    vpbroadcastd $l2+28(%r11), %ymm12
+    vpblendd \$0xf0, %ymm12, %ymm13, %ymm13
+___
+
+    &intt_butterfly("%ymm8", "%ymm7", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm6", "%ymm7",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 2);         # qinv, q, level
+
+$code .= <<___;
+
+    # ==============================================================
+    # level 3: offset = 8, step = 16
+    # zeta indexes = 31, 30, 29, ... 17, 16
+    # zeta indexes (new) = 224, 225, 226, ... 239
+
+    #   ymm0 = [0,1,2,3 | 8,9,10,11]
+    #   ymm1 = [16,17,18,19 | 24,25,26,27]
+    vperm2i128 \$0x20, %ymm1, %ymm0, %ymm8      # [0,1,2,3 | 4,5,6,7]
+    vperm2i128 \$0x31, %ymm1, %ymm0, %ymm1      # [8,9,10,11 | 12,13,14,15]
+
+    # broadcast zetas
+    vpbroadcastd $l3(%r11), %ymm13
+___
+
+    &intt_butterfly("%ymm8", "%ymm1", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm0", "%ymm1",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 3);         # qinv, q, level
+
+$code .= <<___;
+
+    vperm2i128 \$0x20, %ymm3, %ymm2, %ymm8
+    vperm2i128 \$0x31, %ymm3, %ymm2, %ymm3
+
+    # broadcast zetas
+    vpbroadcastd $l3+4(%r11), %ymm13
+___
+
+    &intt_butterfly("%ymm8", "%ymm3", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm2", "%ymm3",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 3);         # qinv, q, level
+
+$code .= <<___;
+    vperm2i128 \$0x20, %ymm5, %ymm4, %ymm8      # [0,1,2,3 | 4,5,6,7]
+    vperm2i128 \$0x31, %ymm5, %ymm4, %ymm5      # [8,9,10,11 | 12,13,14,15]
+
+    # broadcast zetas
+    vpbroadcastd $l3+8(%r11), %ymm13
+___
+
+    &intt_butterfly("%ymm8", "%ymm5", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm4", "%ymm5",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 3);         # qinv, q, level
+
+$code .= <<___;
+
+    vperm2i128 \$0x20, %ymm7, %ymm6, %ymm8
+    vperm2i128 \$0x31, %ymm7, %ymm6, %ymm7
+
+    # broadcast zetas
+    vpbroadcastd $l3+12(%r11), %ymm13
+___
+
+    &intt_butterfly("%ymm8", "%ymm7", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm6", "%ymm7",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 3);         # qinv, q, level
+
+$code .= <<___;
+
+    # ==============================================================
+    # level 4: offset = 16, step = 8
+    # zeta indexes = 15, 14, 13, ..., 9, 8
+    # zeta indexes (new) = 240, 241, 242, ... 247
+
+    # broadcast zetas
+    vpbroadcastd $l4(%r11), %ymm13
+___
+
+    &intt_butterfly("%ymm0", "%ymm2", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm0", "%ymm2",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 4);         # qinv, q, level
+
+    &intt_butterfly("%ymm1", "%ymm3", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm1", "%ymm3",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 4);         # qinv, q, level
+
+$code .= <<___;
+    # broadcast zetas
+    vpbroadcastd $l4+4(%r11), %ymm13
+___
+
+    &intt_butterfly("%ymm4", "%ymm6", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm4", "%ymm6",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 4);         # qinv, q, level
+
+    &intt_butterfly("%ymm5", "%ymm7", "%ymm13",     # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12",   # temporary
+                    "%ymm5", "%ymm7",               # n_even, n_odd
+                    "%ymm14", "%ymm15", 4);         # qinv, q, level
+
+$code .= <<___;
+
+    # Store new w_even and w_odd
+    vmovdqu %ymm0, $off(%rdi)
+    vmovdqu %ymm1, $off+32(%rdi)
+    vmovdqu %ymm2, $off+64(%rdi)
+    vmovdqu %ymm3, $off+96(%rdi)
+    vmovdqu %ymm4, $off+128(%rdi)
+    vmovdqu %ymm5, $off+160(%rdi)
+    vmovdqu %ymm6, $off+192(%rdi)
+    vmovdqu %ymm7, $off+224(%rdi)
+___
+}
+
+###############################################################################
+# intt_levels5to7
+#
+# Description:
+#   Processes the last three levels (5 to 7) of the INTT on 64 coefficients.
+#
+#   It completes the hierarchical merging of INTT, applying stage-specific zeta
+#   (twiddle) factors and modular butterfly operations for each level, and performs the final
+#   post-processing Montgomery multiplication at the end of the transform.
+#
+#   It must be invoked 4 times with offsets equal to 0*4, 8*4, 16*4 and 24*4 to cover
+#   all 256 coefficients.
+#
+# Layer/Level details:
+#   - Level 5: offset =  32, step = 4;   zeta indexes (new) = 248..251
+#   - Level 6: offset =  64, step = 2;   zeta indexes (new) = 252, 253
+#   - Level 7: offset = 128, step = 1;   zeta index   (new) = 254
+#
+#   After all INTT levels, multiplies the output by the Montgomery factor
+#   corresponding to the inverse transform scaling (usually the modular inverse of the
+#   NTT degree in Montgomery form), to obtain the final reduced coefficients.
+#
+# Prerequisites:
+#   %rdi    - pointer to the coefficients array
+#   %r11    - pointer to the zetas (twiddle factors) table
+#   %ymm14  - q_neg_inv (for Montgomery reduction)
+#   %ymm15  - Q (modulus)
+#
+# Arguments:
+#   $off    - offset (in bytes) to the start of the 8-coefficient group
+#
+# Output:
+#   Overwrites memory at the given offset with the INTT-processed coefficients.
+#
+# Notes:
+#   - This subroutine must be called 4 times with appropriate offsets to process
+#     all 256 coefficients.
+###############################################################################
+
+sub intt_levels5to7 {
+    my ($off) = @_;
+    $code .= <<___;
+    vmovdqu $off+0*4(%rdi), %ymm0
+    vmovdqu $off+32*4(%rdi), %ymm1
+    vmovdqu $off+64*4(%rdi), %ymm2
+    vmovdqu $off+96*4(%rdi), %ymm3
+    vmovdqu $off+128*4(%rdi), %ymm4
+    vmovdqu $off+160*4(%rdi), %ymm5
+    vmovdqu $off+192*4(%rdi), %ymm6
+    vmovdqu $off+224*4(%rdi), %ymm7
+
+    # ==============================================================
+    # level 5: offset = 32, step = 4
+
+    vpbroadcastd 248*4(%r11), %ymm13
+___
+    &intt_butterfly("%ymm0", "%ymm1", "%ymm13", # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12", # temporary
+                    "%ymm0", "%ymm1",           # n_even, n_odd
+                    "%ymm14", "%ymm15", 5);     # qinv, q, level
+    $code .= <<___;
+    vpbroadcastd 249*4(%r11), %ymm13
+___
+    &intt_butterfly("%ymm2", "%ymm3", "%ymm13", # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12", # temporary
+                    "%ymm2", "%ymm3",           # n_even, n_odd
+                    "%ymm14", "%ymm15", 5);     # qinv, q, level
+
+    $code .= <<___;
+    vpbroadcastd 250*4(%r11), %ymm13
+___
+    &intt_butterfly("%ymm4", "%ymm5", "%ymm13", # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12", # temporary
+                    "%ymm4", "%ymm5",           # n_even, n_odd
+                    "%ymm14", "%ymm15", 5);     # qinv, q, level
+
+    $code .= <<___;
+    vpbroadcastd 251*4(%r11), %ymm13
+___
+    &intt_butterfly("%ymm6", "%ymm7", "%ymm13", # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12", # temporary
+                    "%ymm6", "%ymm7",           # n_even, n_odd
+                    "%ymm14", "%ymm15", 5);     # qinv, q, level
+    $code .= <<___;
+
+    # ==============================================================
+    # level 6: offset = 64, step = 2
+
+    vpbroadcastd 252*4(%r11), %ymm13
+___
+    &intt_butterfly("%ymm0", "%ymm2", "%ymm13", # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12", # temporary
+                    "%ymm0", "%ymm2",           # n_even, n_odd
+                    "%ymm14", "%ymm15", 6);     # qinv, q, level
+    &intt_butterfly("%ymm1", "%ymm3", "%ymm13", # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12", # temporary
+                    "%ymm1", "%ymm3",           # n_even, n_odd
+                    "%ymm14", "%ymm15", 6);     # qinv, q, level
+    $code .= <<___;
+    vpbroadcastd 253*4(%r11), %ymm13
+___
+    &intt_butterfly("%ymm4", "%ymm6", "%ymm13", # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12", # temporary
+                    "%ymm4", "%ymm6",           # n_even, n_odd
+                    "%ymm14", "%ymm15", 6);     # qinv, q, level
+    &intt_butterfly("%ymm5", "%ymm7", "%ymm13", # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12", # temporary
+                    "%ymm5", "%ymm7",           # n_even, n_odd
+                    "%ymm14", "%ymm15", 6);     # qinv, q, level
+$code .= <<___;
+
+    # ==============================================================
+    # level 7: offset = 128, step = 1
+
+    vpbroadcastd 254*4(%r11), %ymm13
+___
+    &intt_butterfly("%ymm0", "%ymm4", "%ymm13", # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12", # temporary
+                    "%ymm0", "%ymm4",           # n_even, n_odd
+                    "%ymm14", "%ymm15", 7);     # qinv, q, level
+    &intt_butterfly("%ymm1", "%ymm5", "%ymm13", # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12", # temporary
+                    "%ymm1", "%ymm5",           # n_even, n_odd
+                    "%ymm14", "%ymm15", 7);     # qinv, q, level
+    &intt_butterfly("%ymm2", "%ymm6", "%ymm13", # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12", # temporary
+                    "%ymm2", "%ymm6",           # n_even, n_odd
+                    "%ymm14", "%ymm15", 7);     # qinv, q, level
+    &intt_butterfly("%ymm3", "%ymm7", "%ymm13", # w_even, w_odd, zetas
+                    "%ymm10", "%ymm11", "%ymm12", # temporary
+                    "%ymm3", "%ymm7",           # n_even, n_odd
+                    "%ymm14", "%ymm15", 7);     # qinv, q, level
+$code .= <<___;
+
+    # ==============================================================
+    # extra multiply
+
+    vpbroadcastd ml_dsa_inverse_degree_montgomery(%rip), %ymm13
+___
+
+    &multiply_mod_Q("%ymm0", "%ymm13", "%ymm0",   # A, B, out (AxB)
+                    "%ymm10", "%ymm11", "%ymm12", # tmp
+                    "%ymm14", "%ymm15", 1);       # qinv, q, bcast32
+    &multiply_mod_Q("%ymm4", "%ymm13", "%ymm4",   # A, B, out (AxB)
+                    "%ymm10", "%ymm11", "%ymm12", # tmp
+                    "%ymm14", "%ymm15", 1);       # qinv, q, bcast32
+    &multiply_mod_Q("%ymm1", "%ymm13", "%ymm1",   # A, B, out (AxB)
+                    "%ymm10", "%ymm11", "%ymm12", # tmp
+                    "%ymm14", "%ymm15", 1);       # qinv, q, bcast32
+    &multiply_mod_Q("%ymm5", "%ymm13", "%ymm5",   # A, B, out (AxB)
+                    "%ymm10", "%ymm11", "%ymm12", # tmp
+                    "%ymm14", "%ymm15", 1);       # qinv, q, bcast32
+    &multiply_mod_Q("%ymm2", "%ymm13", "%ymm2",   # A, B, out (AxB)
+                    "%ymm10", "%ymm11", "%ymm12", # tmp
+                    "%ymm14", "%ymm15", 1);       # qinv, q, bcast32
+    &multiply_mod_Q("%ymm6", "%ymm13", "%ymm6",   # A, B, out (AxB)
+                    "%ymm10", "%ymm11", "%ymm12", # tmp
+                    "%ymm14", "%ymm15", 1);       # qinv, q, bcast32
+    &multiply_mod_Q("%ymm3", "%ymm13", "%ymm3",   # A, B, out (AxB)
+                    "%ymm10", "%ymm11", "%ymm12", # tmp
+                    "%ymm14", "%ymm15", 1);       # qinv, q, bcast32
+    &multiply_mod_Q("%ymm7", "%ymm13", "%ymm7",   # A, B, out (AxB)
+                    "%ymm10", "%ymm11", "%ymm12", # tmp
+                    "%ymm14", "%ymm15", 1);       # qinv, q, bcast32
+
+$code .= <<___;
+
+    vmovdqu %ymm0, $off+0*4(%rdi)
+    vmovdqu %ymm1, $off+32*4(%rdi)
+    vmovdqu %ymm2, $off+64*4(%rdi)
+    vmovdqu %ymm3, $off+96*4(%rdi)
+    vmovdqu %ymm4, $off+128*4(%rdi)
+    vmovdqu %ymm5, $off+160*4(%rdi)
+    vmovdqu %ymm6, $off+192*4(%rdi)
+    vmovdqu %ymm7, $off+224*4(%rdi)
+___
+}
+
+$code .= <<___;
+###############################################################################
+###############################################################################
+### Data section
+
+.section .rodata
+
+###############################################################################
+# zetas_inverse:
+#
+# Description:
+#   Table of inverse NTT "zetas" (twiddle factors), precomputed as powers of the
+#   primitive root of unity (mod Q) required for each stage of the inverse Number
+#   Theoretic Transform (INTT). Entries represent the modular inverses of the
+#   forward NTT zetas (ml_dsa_ntt.c), arranged in bit-reversed or stage-order
+#   as required by the INTT implementation.
+#   Elements of the table are in reversed order vs the original table for the
+#   forward NTT. This is reduce permute operations when preparing zetas in the
+#   correct format for butterfly operations.
+#
+#   Each .long entry corresponds to a 32-bit modular value (Q - zeta) for the
+#   appropriate stage and index.
+#
+#   The exact arrangement and computation of these zetas matches the INTT
+#   schedule and must be consistent with the NTT forward transform (ml_dsa_ntt.c).
+###############################################################################
+.align 64
+zetas_inverse:
+    .long $ML_DSA_Q - 1976782, $ML_DSA_Q - 7534263, $ML_DSA_Q - 1400424, $ML_DSA_Q - 3937738, $ML_DSA_Q - 7018208, $ML_DSA_Q - 8332111, $ML_DSA_Q - 3919660, $ML_DSA_Q - 7826001
+    .long $ML_DSA_Q - 4834730, $ML_DSA_Q - 1612842, $ML_DSA_Q - 7403526, $ML_DSA_Q - 183443,  $ML_DSA_Q - 6094090, $ML_DSA_Q - 7959518, $ML_DSA_Q - 6144432, $ML_DSA_Q - 5441381
+    .long $ML_DSA_Q - 4546524, $ML_DSA_Q - 8119771, $ML_DSA_Q - 7276084, $ML_DSA_Q - 6712985, $ML_DSA_Q - 1910376, $ML_DSA_Q - 6577327, $ML_DSA_Q - 1723600, $ML_DSA_Q - 7953734
+    .long $ML_DSA_Q - 472078,  $ML_DSA_Q - 1717735, $ML_DSA_Q - 7404533, $ML_DSA_Q - 2213111, $ML_DSA_Q - 269760,  $ML_DSA_Q - 3866901, $ML_DSA_Q - 3523897, $ML_DSA_Q - 5341501
+    .long $ML_DSA_Q - 6581310, $ML_DSA_Q - 4686184, $ML_DSA_Q - 1652634, $ML_DSA_Q - 810149,  $ML_DSA_Q - 3014001, $ML_DSA_Q - 1616392, $ML_DSA_Q - 162844,  $ML_DSA_Q - 5196991
+    .long $ML_DSA_Q - 7173032, $ML_DSA_Q - 185531,  $ML_DSA_Q - 3369112, $ML_DSA_Q - 1957272, $ML_DSA_Q - 8215696, $ML_DSA_Q - 2454455, $ML_DSA_Q - 2432395, $ML_DSA_Q - 6366809
+    .long $ML_DSA_Q - 4603424, $ML_DSA_Q - 594136,  $ML_DSA_Q - 4656147, $ML_DSA_Q - 5796124, $ML_DSA_Q - 6533464, $ML_DSA_Q - 6709241, $ML_DSA_Q - 5548557, $ML_DSA_Q - 7838005
+    .long $ML_DSA_Q - 3406031, $ML_DSA_Q - 2235880, $ML_DSA_Q - 777191,  $ML_DSA_Q - 1500165, $ML_DSA_Q - 7005614, $ML_DSA_Q - 5834105, $ML_DSA_Q - 1917081, $ML_DSA_Q - 7100756
+    .long $ML_DSA_Q - 6417775, $ML_DSA_Q - 3306115, $ML_DSA_Q - 1312455, $ML_DSA_Q - 7929317, $ML_DSA_Q - 6950192, $ML_DSA_Q - 5062207, $ML_DSA_Q - 1237275, $ML_DSA_Q - 7047359
+    .long $ML_DSA_Q - 7329447, $ML_DSA_Q - 1903435, $ML_DSA_Q - 1869119, $ML_DSA_Q - 5386378, $ML_DSA_Q - 4832145, $ML_DSA_Q - 2635921, $ML_DSA_Q - 1250494, $ML_DSA_Q - 4613401
+    .long $ML_DSA_Q - 1595974, $ML_DSA_Q - 2486353, $ML_DSA_Q - 1247620, $ML_DSA_Q - 4055324, $ML_DSA_Q - 1265009, $ML_DSA_Q - 5790267, $ML_DSA_Q - 2691481, $ML_DSA_Q - 2842341
+    .long $ML_DSA_Q - 203044,  $ML_DSA_Q - 1735879, $ML_DSA_Q - 5038140, $ML_DSA_Q - 3437287, $ML_DSA_Q - 4108315, $ML_DSA_Q - 5942594, $ML_DSA_Q - 286988,  $ML_DSA_Q - 342297
+    .long $ML_DSA_Q - 4784579, $ML_DSA_Q - 7611795, $ML_DSA_Q - 7855319, $ML_DSA_Q - 4823422, $ML_DSA_Q - 3207046, $ML_DSA_Q - 2031748, $ML_DSA_Q - 5257975, $ML_DSA_Q - 7725090
+    .long $ML_DSA_Q - 7857917, $ML_DSA_Q - 8337157, $ML_DSA_Q - 6767243, $ML_DSA_Q - 495491,  $ML_DSA_Q - 819034,  $ML_DSA_Q - 909542,  $ML_DSA_Q - 1859098, $ML_DSA_Q - 900702
+    .long $ML_DSA_Q - 5187039, $ML_DSA_Q - 7183191, $ML_DSA_Q - 4621053, $ML_DSA_Q - 4860065, $ML_DSA_Q - 3513181, $ML_DSA_Q - 7144689, $ML_DSA_Q - 2434439, $ML_DSA_Q - 266997
+    .long $ML_DSA_Q - 4817955, $ML_DSA_Q - 5933984, $ML_DSA_Q - 2244091, $ML_DSA_Q - 5037939, $ML_DSA_Q - 3817976, $ML_DSA_Q - 2316500, $ML_DSA_Q - 3407706, $ML_DSA_Q - 2091667
+    .long $ML_DSA_Q - 3839961, $ML_DSA_Q - 4751448, $ML_DSA_Q - 4499357, $ML_DSA_Q - 5361315, $ML_DSA_Q - 6940675, $ML_DSA_Q - 7567685, $ML_DSA_Q - 6795489, $ML_DSA_Q - 1285669
+    .long $ML_DSA_Q - 1341330, $ML_DSA_Q - 1315589, $ML_DSA_Q - 8202977, $ML_DSA_Q - 5971092, $ML_DSA_Q - 6529015, $ML_DSA_Q - 3159746, $ML_DSA_Q - 4827145, $ML_DSA_Q - 189548
+    .long $ML_DSA_Q - 7063561, $ML_DSA_Q - 759969,  $ML_DSA_Q - 8169440, $ML_DSA_Q - 2389356, $ML_DSA_Q - 5130689, $ML_DSA_Q - 1653064, $ML_DSA_Q - 8371839, $ML_DSA_Q - 4656075
+    .long $ML_DSA_Q - 3958618, $ML_DSA_Q - 904516,  $ML_DSA_Q - 7280319, $ML_DSA_Q - 44288,   $ML_DSA_Q - 3097992, $ML_DSA_Q - 508951,  $ML_DSA_Q - 264944,  $ML_DSA_Q - 5037034
+    .long $ML_DSA_Q - 6949987, $ML_DSA_Q - 1852771, $ML_DSA_Q - 1349076, $ML_DSA_Q - 7998430, $ML_DSA_Q - 7072248, $ML_DSA_Q - 8357436, $ML_DSA_Q - 7151892, $ML_DSA_Q - 7709315
+    .long $ML_DSA_Q - 5903370, $ML_DSA_Q - 7969390, $ML_DSA_Q - 4686924, $ML_DSA_Q - 5412772, $ML_DSA_Q - 2715295, $ML_DSA_Q - 2147896, $ML_DSA_Q - 7396998, $ML_DSA_Q - 3412210
+    .long $ML_DSA_Q - 126922,  $ML_DSA_Q - 4747489, $ML_DSA_Q - 5223087, $ML_DSA_Q - 5190273, $ML_DSA_Q - 7380215, $ML_DSA_Q - 4296819, $ML_DSA_Q - 1939314, $ML_DSA_Q - 7122806
+    .long $ML_DSA_Q - 6795196, $ML_DSA_Q - 2176455, $ML_DSA_Q - 3475950, $ML_DSA_Q - 6927966, $ML_DSA_Q - 5339162, $ML_DSA_Q - 4702672, $ML_DSA_Q - 6851714, $ML_DSA_Q - 4450022
+    .long $ML_DSA_Q - 5582638, $ML_DSA_Q - 2071892, $ML_DSA_Q - 5823537, $ML_DSA_Q - 3900724, $ML_DSA_Q - 3881043, $ML_DSA_Q - 954230,  $ML_DSA_Q - 531354,  $ML_DSA_Q - 811944
+    .long $ML_DSA_Q - 3699596, $ML_DSA_Q - 6779997, $ML_DSA_Q - 6239768, $ML_DSA_Q - 3507263, $ML_DSA_Q - 4558682, $ML_DSA_Q - 3505694, $ML_DSA_Q - 6736599, $ML_DSA_Q - 6681150
+    .long $ML_DSA_Q - 7841118, $ML_DSA_Q - 2348700, $ML_DSA_Q - 8079950, $ML_DSA_Q - 3539968, $ML_DSA_Q - 5512770, $ML_DSA_Q - 3574422, $ML_DSA_Q - 5336701, $ML_DSA_Q - 4519302
+    .long $ML_DSA_Q - 3915439, $ML_DSA_Q - 5842901, $ML_DSA_Q - 4788269, $ML_DSA_Q - 6718724, $ML_DSA_Q - 3530437, $ML_DSA_Q - 3077325, $ML_DSA_Q - 95776,   $ML_DSA_Q - 2706023
+    .long $ML_DSA_Q - 280005,  $ML_DSA_Q - 4010497, $ML_DSA_Q - 8360995, $ML_DSA_Q - 1757237, $ML_DSA_Q - 5102745, $ML_DSA_Q - 6980856, $ML_DSA_Q - 4520680, $ML_DSA_Q - 6262231
+    .long $ML_DSA_Q - 6271868, $ML_DSA_Q - 2619752, $ML_DSA_Q - 7260833, $ML_DSA_Q - 7830929, $ML_DSA_Q - 3585928, $ML_DSA_Q - 7300517, $ML_DSA_Q - 1024112, $ML_DSA_Q - 2725464
+    .long $ML_DSA_Q - 2680103, $ML_DSA_Q - 3111497, $ML_DSA_Q - 5495562, $ML_DSA_Q - 3119733, $ML_DSA_Q - 6288512, $ML_DSA_Q - 8021166, $ML_DSA_Q - 2353451, $ML_DSA_Q - 1826347
+    .long $ML_DSA_Q - 466468,  $ML_DSA_Q - 7504169, $ML_DSA_Q - 7602457, $ML_DSA_Q - 237124,  $ML_DSA_Q - 7861508, $ML_DSA_Q - 5771523, $ML_DSA_Q - 25847,   $ML_DSA_Q - 4193792
+
+.align 32
+idx_even:
+    .long 0,2,4,6, 0,2,4,6
+
+.align 32
+idx_odd:
+    .long 1,3,5,7, 1,3,5,7
+
+# Modulus Q for ML-DSA NTT (2^23 - 2^13 + 1)
+.align 8
+ml_dsa_q:
+    .quad $ML_DSA_Q
+
+# -Q^{-1} mod 2^32 (Montgomery parameter for ML-DSA modular reduction)
+.align 8
+ml_dsa_q_neg_inv:
+    .quad $ML_DSA_Q_NEG_INV
+
+# (N^{-1} mod Q) in Montgomery form for scaling after inverse NTT
+.align 8
+ml_dsa_inverse_degree_montgomery:
+    .quad $inverse_degree_montgomery
+
+###############################################################################
+###############################################################################
+### Code section
+
+.text
+
+###############################################################################
+# ml_dsa_poly_ntt_mult_avx2
+#
+# C Prototype:
+#   void ml_dsa_poly_ntt_mult_avx2(
+#       const uint32_t *a,       // (rdi) Input polynomial A (in NTT domain)
+#       const uint32_t *b,       // (rsi) Input polynomial B (in NTT domain)
+#       uint32_t *out,           // (rdx) Output polynomial (result)
+#   );
+#
+# Description:
+#   Top-level routine for polynomial multiplication in ML-DSA,
+#   using number-theoretic transform (NTT) methods. This function performs
+#   multiplication of two polynomials in the NTT domain, making full use of
+#   AVX2 vector instructions.
+#   It assumes there are 256 coefficients.
+#
+#   out[i] = a[i] x b[i] mod Q
+#
+#   The function:
+#     - Takes pointers to source polynomials (NTT domain) and destination buffer
+#     - Performs element-wise modular (pointwise) multiplication in the NTT domain
+#     - Applies Montgomery reduction for efficient modular arithmetic
+#
+# Inputs:
+#   a   - First input polynomial, NTT domain
+#   b   - Second input polynomial, NTT domain
+#   out - Destination buffer for output coefficients
+#
+# Output:
+#   - Output buffer 'out' contains the coefficient-wise modular product of
+#     the input polynomials (still in NTT domain)
+#
+###############################################################################
+
+.globl  ml_dsa_poly_ntt_mult_avx2
+.type   ml_dsa_poly_ntt_mult_avx2,\@function,3
+.align 32
+ml_dsa_poly_ntt_mult_avx2:
+.cfi_startproc
+___
+$code .= <<___ if ($win64);
+    lea     -168(%rax), %rsp
+    vmovaps %xmm6,   0(%rsp)
+    vmovaps %xmm7,   16(%rsp)
+    vmovaps %xmm8,   32(%rsp)
+    vmovaps %xmm9,   48(%rsp)
+    vmovaps %xmm10,  64(%rsp)
+    vmovaps %xmm11,  80(%rsp)
+    vmovaps %xmm12,  96(%rsp)
+    vmovaps %xmm13,  112(%rsp)
+    vmovaps %xmm14,  128(%rsp)
+    vmovaps %xmm15,  144(%rsp)
+___
+$code .= <<___;
+.Lntt_mult_body:
+    vpbroadcastq ml_dsa_q_neg_inv(%rip), %ymm14
+    vpbroadcastd ml_dsa_q(%rip), %ymm15
+    xor %r10d, %r10d
+
+.align 32
+.Lmult_loop:
+    # Load a and b into ymm registers
+    vmovdqu (%rdi,%r10), %ymm0   # a[0:7]
+    vmovdqu (%rsi,%r10), %ymm1   # b[0:7]
+
+    # multiply this part of input data
+___
+
+    &multiply_mod_Q("%ymm0", "%ymm1", "%ymm0",  # A, B, out (AxB)
+                    "%ymm8", "%ymm9", "%ymm10", # tmp
+                    "%ymm14", "%ymm15", 0);     # qinv, q, bcast32
+
+$code .= <<___;
+    # store result to output
+    vmovdqu %ymm0, (%rdx,%r10)
+
+    # start new iteration
+    add \$8*4, %r10d
+    cmp \$256*4, %r10d
+    jb .Lmult_loop
+
+    # clear and restore registers
+    vzeroall
+___
+$code .= <<___ if ($win64);
+    vmovaps 0(%rsp),   %xmm6
+    vmovaps 16(%rsp),  %xmm7
+    vmovaps 32(%rsp),  %xmm8
+    vmovaps 48(%rsp),  %xmm9
+    vmovaps 64(%rsp),  %xmm10
+    vmovaps 80(%rsp),  %xmm11
+    vmovaps 96(%rsp),  %xmm12
+    vmovaps 112(%rsp), %xmm13
+    vmovaps 128(%rsp), %xmm14
+    vmovaps 144(%rsp), %xmm15
+    lea     (%rax), %rsp
+___
+$code .= <<___;
+.Lntt_mult_epilogue:
+    ret
+.cfi_endproc
+.size   ml_dsa_poly_ntt_mult_avx2, .-ml_dsa_poly_ntt_mult_avx2
+
+###############################################################################
+# ml_dsa_poly_ntt_avx2
+#
+# C Prototype:
+#   void ml_dsa_poly_ntt_avx2(
+#       uint32_t *p_coeffs,     // Pointer to coefficients (input: normal domain, output: NTT domain)
+#       const uint32_t *p_zetas // Pointer to zeta (twiddle factor) table for the forward NTT
+#   );
+#
+# Description:
+#   Top-level implementation of the forward Number Theoretic
+#   Transform (NTT) for ML-DSA polynomials. This function converts a polynomial
+#   from its standard coefficient (normal) form to its NTT representation,
+#   storing the result in-place in the provided coefficients array. The function
+#   uses stage-specific "zeta" (twiddle factor) tables passed from C (ml_dsa_ntt.c).
+#
+#   The function:
+#     - Takes a buffer of polynomial coefficients in normal (standard) order
+#     - Uses the provided zeta table for all twiddle-factor multiplications
+#     - Processes the NTT in a breadth-first, layered fashion with AVX2 SIMD
+#     - Overwrites the input buffer with its NTT-domain representation
+#
+# Inputs:
+#   p_coeffs - Pointer to the coefficient array (will be overwritten in-place by the NTT result)
+#   p_zetas  - Pointer to the precomputed table of forward NTT zeta (twiddle) factors (from ml_dsa_ntt.c)
+#
+# Output:
+#   - The 'p_coeffs' array is updated in-place with the corresponding NTT-domain representation.
+###############################################################################
+.globl  ml_dsa_poly_ntt_avx2
+.type   ml_dsa_poly_ntt_avx2,\@function,2
+.align 32
+ml_dsa_poly_ntt_avx2:
+.cfi_startproc
+___
+$code .= <<___ if ($win64);
+    lea     -168(%rax), %rsp
+    vmovaps %xmm6,   0(%rsp)
+    vmovaps %xmm7,   16(%rsp)
+    vmovaps %xmm8,   32(%rsp)
+    vmovaps %xmm9,   48(%rsp)
+    vmovaps %xmm10,  64(%rsp)
+    vmovaps %xmm11,  80(%rsp)
+    vmovaps %xmm12,  96(%rsp)
+    vmovaps %xmm13,  112(%rsp)
+    vmovaps %xmm14,  128(%rsp)
+    vmovaps %xmm15,  144(%rsp)
+___
+$code .= <<___;
+.Lntt_body:
+
+    # move p_zetas to r11
+    mov %rsi, %r11
+
+    # load constants
+    vpbroadcastq ml_dsa_q_neg_inv(%rip), %ymm14
+    vpbroadcastd ml_dsa_q(%rip), %ymm15     # 32-bit Q
+
+    # ==============================================================
+    # - level 0: offset = 128, step = 1, zeta indexes = 1
+    # - level 1: offset = 64, step = 2, zeta indexes = 2, 3
+    # - level 2: offset = 32, step = 4, zeta indexes = 4, 5, 6, 7
+    # p_coeffs already in rdi
+___
+
+    &ntt_levels0to2(0*4);
+    &ntt_levels0to2(8*4);
+    &ntt_levels0to2(16*4);
+    &ntt_levels0to2(24*4);
+
+$code .= <<___;
+
+    # ==============================================================
+    # - level 3: offset = 16, step = 8
+    #     zeta indexes = 8, 9, 10, 11, 12, 13, 14, 15
+    # - level 4: offset = 8, step = 16
+    #     zeta indexes = 16, 17, 18, ..., 30, 31
+    # - level 5: offset = 4, step = 32
+    #     zeta indexes = 32, 33, 34, ..., 62, 63
+    # - level 6: offset = 2, step = 64
+    #     zeta indexes = 64, 65, 66, ..., 126, 127
+    # - level 7: offset = 1, step = 128
+    #     zeta indexes = 128, 129, 130, ..., 254, 255
+    # p_coeffs already in rdi
+___
+
+    # arguments:    coeff,   l3,    l4,    l5,    l6,    l7
+    &ntt_levels3to7(  0*4,  8*4,  16*4,  32*4,  64*4, 128*4);
+    &ntt_levels3to7( 64*4, 10*4,  20*4,  40*4,  80*4, 160*4);
+    &ntt_levels3to7(128*4, 12*4,  24*4,  48*4,  96*4, 192*4);
+    &ntt_levels3to7(192*4, 14*4,  28*4,  56*4, 112*4, 224*4);
+
+$code .= <<___;
+
+    # clear and restore registers
+    vzeroall
+___
+$code .= <<___ if ($win64);
+    vmovaps 0(%rsp),   %xmm6
+    vmovaps 16(%rsp),  %xmm7
+    vmovaps 32(%rsp),  %xmm8
+    vmovaps 48(%rsp),  %xmm9
+    vmovaps 64(%rsp),  %xmm10
+    vmovaps 80(%rsp),  %xmm11
+    vmovaps 96(%rsp),  %xmm12
+    vmovaps 112(%rsp), %xmm13
+    vmovaps 128(%rsp), %xmm14
+    vmovaps 144(%rsp), %xmm15
+    lea     (%rax), %rsp
+___
+$code .= <<___;
+.Lntt_epilogue:
+    ret
+.cfi_endproc
+.size   ml_dsa_poly_ntt_avx2, .-ml_dsa_poly_ntt_avx2
+
+###############################################################################
+# ml_dsa_poly_ntt_inverse_avx2
+#
+# C Prototype:
+#     void ml_dsa_poly_ntt_inverse_avx2(
+#        uint32_t *p_coeffs // (rdi) Pointer to coefficients
+#                           // input: NTT domain, output: normal domain, in-place
+#     );
+#
+# Description:
+#   Top-level implementation of the inverse Number Theoretic
+#   Transform (INTT) for ML-DSA polynomial. This function converts a polynomial
+#   from its NTT domain back to the standard coefficient (normal) domain,
+#   storing the result in-place in the provided buffer. The required inverse zeta
+#   (twiddle) factors are managed internally.
+#
+#   The function:
+#     - Accepts a buffer of NTT-domain coefficients
+#     - Overwrites the input buffer with the result in the normal (coefficient) domain
+#
+# Inputs:
+#   p_coeffs - Pointer to the polynomial coefficient array (in-place transform)
+#
+# Output:
+#   - The 'p_coeffs' array is updated in-place to contain the standard domain polynomial.
+#   - Uses 'zetas_inverse' table
+###############################################################################
+.globl  ml_dsa_poly_ntt_inverse_avx2
+.type   ml_dsa_poly_ntt_inverse_avx2,\@function,1
+.align 32
+ml_dsa_poly_ntt_inverse_avx2:
+.cfi_startproc
+___
+$code .= <<___ if ($win64);
+    lea     -168(%rax), %rsp
+    vmovaps %xmm6,   0(%rsp)
+    vmovaps %xmm7,   16(%rsp)
+    vmovaps %xmm8,   32(%rsp)
+    vmovaps %xmm9,   48(%rsp)
+    vmovaps %xmm10,  64(%rsp)
+    vmovaps %xmm11,  80(%rsp)
+    vmovaps %xmm12,  96(%rsp)
+    vmovaps %xmm13,  112(%rsp)
+    vmovaps %xmm14,  128(%rsp)
+    vmovaps %xmm15,  144(%rsp)
+___
+$code .= <<___;
+.Lintt_body:
+    lea zetas_inverse(%rip), %r11
+
+    vpbroadcastq ml_dsa_q_neg_inv(%rip), %ymm14
+    vpbroadcastd ml_dsa_q(%rip), %ymm15
+
+    # ==============================================================
+    # - level 0: offset = 1, step = 128
+    #     zeta indexes (original table) = 255, 254, 253, ... 129, 128
+    #     zeta indexes (new table) = 0, 1, 2, .. 127
+    # - level 1: offset = 2, step = 64
+    #     zeta indexes (original table) = 127, 126, 125, ... 65, 64
+    #     zeta indexes (new table) = 128, 129, .. 191
+    # - level 2: offset = 4, step = 32
+    #     zeta indexes (original table) = 63, 62, 61, ... 33, 32
+    #     zeta indexes (new table) = 192, 193, 194, ... 223
+    # - level 3: offset = 8, step = 16
+    #     zeta indexes (original table) = 31, 30, 29, ... 17, 16
+    #     zeta indexes (new table) = 224, 225, 226, ... 239
+    # - level 4: offset = 16, step = 8
+    #     zeta indexes (original table) = 15, 14, 13, ..., 9, 8
+    #     zeta indexes (new table) = 240, 241, 242, ... 247
+
+___
+
+    #  arguments:    coeff,   l0,    l1,    l2,    l3,    l4
+    &intt_levels0to4(0*4,    0*4, 128*4, 192*4, 224*4, 240*4);
+    &intt_levels0to4(64*4,  32*4, 144*4, 200*4, 228*4, 242*4);
+    &intt_levels0to4(128*4, 64*4, 160*4, 208*4, 232*4, 244*4);
+    &intt_levels0to4(192*4, 96*4, 176*4, 216*4, 236*4, 246*4);
+
+$code .= <<___;
+
+    # ==============================================================
+    # - level 5: offset = 32, step = 4
+    #   zeta indexes (original table) = 7, 6, 5, 4
+    #   zeta indexes (new table) = 248, 249, 250, 251
+    # - level 6: offset = 64, step = 2
+    #   zeta indexes (original table) = 3, 2
+    #   zeta indexes (new table) = 252, 253
+    # - level 7: offset = 128, step = 1
+    #   zeta indexes (original table) = 1
+    #   zeta indexes (new table) = 254
+___
+    &intt_levels5to7(0*4);
+    &intt_levels5to7(8*4);
+    &intt_levels5to7(16*4);
+    &intt_levels5to7(24*4);
+    $code .= <<___;
+
+    # clear and restore registers
+    vzeroall
+___
+$code .= <<___ if ($win64);
+    vmovaps 0(%rsp),   %xmm6
+    vmovaps 16(%rsp),  %xmm7
+    vmovaps 32(%rsp),  %xmm8
+    vmovaps 48(%rsp),  %xmm9
+    vmovaps 64(%rsp),  %xmm10
+    vmovaps 80(%rsp),  %xmm11
+    vmovaps 96(%rsp),  %xmm12
+    vmovaps 112(%rsp), %xmm13
+    vmovaps 128(%rsp), %xmm14
+    vmovaps 144(%rsp), %xmm15
+    lea     (%rax), %rsp
+___
+$code .= <<___;
+.Lintt_epilogue:
+    ret
+.cfi_endproc
+.size   ml_dsa_poly_ntt_inverse_avx2, .-ml_dsa_poly_ntt_inverse_avx2
+___
+
+# Windows SEH exception handler and unwind data
+if ($win64) {
+my $context = "%r8";
+my $disp    = "%r9";
+
+$code .= <<___;
+.extern __imp_RtlVirtualUnwind
+.type   ntt_se_handler,\@abi-omnipotent
+.align  16
+ntt_se_handler:
+    push    %rsi
+    push    %rdi
+    push    %rbx
+    push    %rbp
+    push    %r12
+    push    %r13
+    push    %r14
+    push    %r15
+    pushfq
+    sub     \$64, %rsp
+
+    mov     120($context), %rax     # context->Rax = original %rsp (saved by xlate preamble)
+    mov     248($context), %rbx     # context->Rip
+
+    mov     8($disp), %rsi          # disp->ImageBase
+    mov     56($disp), %r11         # disp->HandlerData
+
+    mov     0(%r11), %r10d          # HandlerData[0]: body label (rva)
+    lea     (%rsi,%r10), %r10
+    cmp     %r10, %rbx              # Rip < body?
+    jb      .Lntt_in_prologue
+
+    mov     4(%r11), %r10d          # HandlerData[1]: epilogue label (rva)
+    lea     (%rsi,%r10), %r10
+    cmp     %r10, %rbx              # Rip >= epilogue?
+    jae     .Lntt_in_prologue
+
+    # In function body: XMM6-XMM15 are saved at 0..144(new_rsp).
+    # context->Rsp = new_rsp = rax - 168
+    mov     152($context), %rsi     # context->Rsp = new_rsp (address of XMM saves)
+    lea     512($context), %rdi     # &context->Xmm6
+    mov     \$20, %ecx              # 10 XMMs * 2 qwords = 20 qwords
+    .long   0xa548f3fc              # cld; rep movsq
+
+.Lntt_in_prologue:
+    # Restore rdi and rsi saved by xlate preamble in shadow space
+    mov     8(%rax), %rcx
+    mov     16(%rax), %rdx
+    mov     %rcx, 176($context)     # context->Rdi
+    mov     %rdx, 168($context)     # context->Rsi
+    mov     %rax, 152($context)     # context->Rsp = original %rsp
+
+    mov     40($disp), %rdi         # disp->ContextRecord
+    mov     $context, %rsi
+    mov     \$154, %ecx             # sizeof(CONTEXT)/8
+    .long   0xa548f3fc              # cld; rep movsq
+
+    mov     $disp, %rsi
+    xor     %rcx, %rcx              # UNW_FLAG_NHANDLER
+    mov     8(%rsi), %rdx           # disp->ImageBase
+    mov     0(%rsi), %r8            # disp->ControlPc
+    mov     16(%rsi), %r9           # disp->FunctionEntry
+    mov     40(%rsi), %r10          # disp->ContextRecord
+    lea     56(%rsi), %r11          # &disp->HandlerData
+    lea     24(%rsi), %r12          # &disp->EstablisherFrame
+    mov     %r10, 32(%rsp)
+    mov     %r11, 40(%rsp)
+    mov     %r12, 48(%rsp)
+    mov     %rcx, 56(%rsp)
+    call    *__imp_RtlVirtualUnwind(%rip)
+
+    mov     \$1, %eax               # ExceptionContinueSearch
+    add     \$64, %rsp
+    popfq
+    pop     %r15
+    pop     %r14
+    pop     %r13
+    pop     %r12
+    pop     %rbp
+    pop     %rbx
+    pop     %rdi
+    pop     %rsi
+    ret
+.size   ntt_se_handler,.-ntt_se_handler
+
+.section    .pdata
+.align  4
+    .rva    .LSEH_begin_ml_dsa_poly_ntt_mult_avx2
+    .rva    .LSEH_end_ml_dsa_poly_ntt_mult_avx2
+    .rva    .LSEH_info_ml_dsa_poly_ntt_mult_avx2
+    .rva    .LSEH_begin_ml_dsa_poly_ntt_avx2
+    .rva    .LSEH_end_ml_dsa_poly_ntt_avx2
+    .rva    .LSEH_info_ml_dsa_poly_ntt_avx2
+    .rva    .LSEH_begin_ml_dsa_poly_ntt_inverse_avx2
+    .rva    .LSEH_end_ml_dsa_poly_ntt_inverse_avx2
+    .rva    .LSEH_info_ml_dsa_poly_ntt_inverse_avx2
+
+.section    .xdata
+.align  8
+.LSEH_info_ml_dsa_poly_ntt_mult_avx2:
+    .byte   9,0,0,0
+    .rva    ntt_se_handler
+    .rva    .Lntt_mult_body,.Lntt_mult_epilogue
+.LSEH_info_ml_dsa_poly_ntt_avx2:
+    .byte   9,0,0,0
+    .rva    ntt_se_handler
+    .rva    .Lntt_body,.Lntt_epilogue
+.LSEH_info_ml_dsa_poly_ntt_inverse_avx2:
+    .byte   9,0,0,0
+    .rva    ntt_se_handler
+    .rva    .Lintt_body,.Lintt_epilogue
+___
+}
+
+}}} else {{{
+# When AVX2 is not available, output stub functions
+# The capable function returns 0, and the operation functions trap if called
+$code .= <<___;
+.text
+
+.globl  ml_dsa_ntt_avx2_capable
+.type   ml_dsa_ntt_avx2_capable,\@abi-omnipotent
+ml_dsa_ntt_avx2_capable:
+    xor     %eax, %eax
+    ret
+.size   ml_dsa_ntt_avx2_capable, .-ml_dsa_ntt_avx2_capable
+
+.globl  ml_dsa_poly_ntt_mult_avx2
+.globl  ml_dsa_poly_ntt_avx2
+.globl  ml_dsa_poly_ntt_inverse_avx2
+.type   ml_dsa_poly_ntt_mult_avx2,\@abi-omnipotent
+ml_dsa_poly_ntt_mult_avx2:
+ml_dsa_poly_ntt_avx2:
+ml_dsa_poly_ntt_inverse_avx2:
+    .byte   0x0f,0x0b       # ud2
+    ret
+.size   ml_dsa_poly_ntt_mult_avx2, .-ml_dsa_poly_ntt_mult_avx2
+___
+}}}
+
+print $code;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/ml_dsa/asm/mldsa_intt_ppc64le.S b/deps/openssl/openssl/crypto/ml_dsa/asm/mldsa_intt_ppc64le.S
new file mode 100644
index 00000000000..d4072915ef0
--- /dev/null
+++ b/deps/openssl/openssl/crypto/ml_dsa/asm/mldsa_intt_ppc64le.S
@@ -0,0 +1,648 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+/*
+ * Copyright IBM Corp. 2025, 2026
+ *
+ * ===================================================================================
+ * Written by Danny Tsen <dtsen@us.ibm.com>
+ *
+ * Optimized inverse NTT implementation for ppc64le.
+ */
+
+#define Q_NEG_INV_OFFSET 16
+#define FCONST_OFFSET 32
+#define ZETA_INTT_OFFSET 48
+
+#define V_F     2
+#define V_ZETA  2
+#define V_Z0    2
+#define V_Z1    3
+#define V_Z2    4
+#define V_Z3    5
+
+#include "mldsa_ppc_macros_asm.inc"
+
+.machine "any"
+.text
+
+.macro SAVE_REGS
+        stdu    1, -352(1)
+        mflr    0
+        std     14, 56(1)
+        std     15, 64(1)
+        std     16, 72(1)
+        std     17, 80(1)
+        std     18, 88(1)
+        std     19, 96(1)
+        std     20, 104(1)
+        std     21, 112(1)
+        li      10, 128
+        li      11, 144
+        li      12, 160
+        li      14, 176
+        li      15, 192
+        li      16, 208
+        stxvx   32+20, 10, 1
+        stxvx   32+21, 11, 1
+        stxvx   32+22, 12, 1
+        stxvx   32+23, 14, 1
+        stxvx   32+24, 15, 1
+        stxvx   32+25, 16, 1
+        li      10, 224
+        li      11, 240
+        li      12, 256
+        li      14, 272
+        stxvx   32+26, 10, 1
+        stxvx   32+27, 11, 1
+        stxvx   32+28, 12, 1
+        stxvx   32+29, 14, 1
+.endm
+
+.macro RESTORE_REGS
+        li      10, 128
+        li      11, 144
+        li      12, 160
+        li      14, 176
+        li      15, 192
+        li      16, 208
+        lxvx    32+20, 10, 1
+        lxvx    32+21, 11, 1
+        lxvx    32+22, 12, 1
+        lxvx    32+23, 14, 1
+        lxvx    32+24, 15, 1
+        lxvx    32+25, 16, 1
+        li      10, 224
+        li      11, 240
+        li      12, 256
+        li      14, 272
+        lxvx    32+26, 10, 1
+        lxvx    32+27, 11, 1
+        lxvx    32+28, 12, 1
+        lxvx    32+29, 14, 1
+        ld      14, 56(1)
+        ld      15, 64(1)
+        ld      16, 72(1)
+        ld      17, 80(1)
+        ld      18, 88(1)
+        ld      19, 96(1)
+        ld      20, 104(1)
+        ld      21, 112(1)
+
+        mtlr    0
+        addi    1, 1, 352
+.endm
+
+/*
+ * Compute updated curr and peer coefficients.
+ *
+ *  Input curr : V14, V15, V16, V17
+ *  Input peer : V18, V19, V20, V21
+ *
+ *  updated curr: V26, V27, V28, V29
+ *  updated peer: V6, V7, V8, V9
+ */
+.macro _Compute_4Coeff
+        vadduwm 26, 14, 18
+        vsubuwm 10, 14, 18
+        vadduwm 6, 10, V_Q
+
+        vadduwm 27, 15, 19
+        vsubuwm 11, 15, 19
+        vadduwm 7, 11, V_Q
+
+        vadduwm 28, 16, 20
+        vsubuwm 12, 16, 20
+        vadduwm 8, 12, V_Q
+
+        vadduwm 29, 17, 21
+        vsubuwm 13, 17, 21
+        vadduwm 9, 13, V_Q
+
+        reduce_once_1x 26
+        reduce_once_1x 27
+        reduce_once_1x 28
+        reduce_once_1x 29
+.endm
+
+/*
+ * For Len=2,
+ * Transpose the final coefficients of 2-2 layout to the original
+ * coefficient array order.
+ *
+ *   updated peer : V15, V17, V19, V21
+ *   updated curr : V14, V16, V18, V20
+ */
+.macro _delayed_writes_xxperm
+        xxpermdi 32+14, 32+26, 32+10, 0
+        xxpermdi 32+15, 32+26, 32+10, 3
+        xxpermdi 32+16, 32+27, 32+11, 0
+        xxpermdi 32+17, 32+27, 32+11, 3
+        xxpermdi 32+18, 32+28, 32+12, 0
+        xxpermdi 32+19, 32+28, 32+12, 3
+        xxpermdi 32+20, 32+29, 32+13, 0
+        xxpermdi 32+21, 32+29, 32+13, 3
+        delayed_writes_curr_peer 14, 15, 16, 17, 18, 19, 20, 21
+.endm
+
+/*
+ * For Len=1,
+ * Transpose the final coefficients of 1-1-1-1 layout to the original
+ * coefficient array order.
+ *
+ *   updated peer : V15, V17, V19, V21
+ *   updated curr : V14, V16, V18, V20
+ */
+.macro _delayed_writes_vmrg
+        vmrgew 14, 10, 26
+        vmrgow 15, 10, 26
+        vmrgew 16, 11, 27
+        vmrgow 17, 11, 27
+        vmrgew 18, 12, 28
+        vmrgow 19, 12, 28
+        vmrgew 20, 13, 29
+        vmrgow 21, 13, 29
+        delayed_writes_curr_peer 14, 15, 16, 17, 18, 19, 20, 21
+.endm
+
+/*
+ * For Layer 1, Len= 1, layer with 1-1-1-1 layout.
+ */
+.macro INTT_Layer1_4x
+        lxvd2x  32+V_Z0, 0, 14
+        lxvd2x  32+V_Z1, 10, 14
+        lxvd2x  32+V_Z2, 11, 14
+        lxvd2x  32+V_Z3, 12, 14
+        addi    14, 14, 64
+        Load_vmrg_coeffs 14, 15, 16, 17, 18, 19, 20, 21
+        _Compute_4Coeff
+        mont_mul_reduce_4x V_Z0, V_Z1, V_Z2, V_Z3
+        _delayed_writes_vmrg
+        addi    5, 5, 128
+.endm
+
+/*
+ * For Layer 2, Len= 2, layer with 2-2 layout.
+ */
+.macro INTT_Layer2_4x
+        lxvd2x  32+V_Z0, 0, 14
+        lxvd2x  32+V_Z1, 10, 14
+        lxvd2x  32+V_Z2, 11, 14
+        lxvd2x  32+V_Z3, 12, 14
+        addi    14, 14, 64
+        Load_xxperm_coeffs 14, 15, 16, 17, 18, 19, 20, 21
+        _Compute_4Coeff
+        mont_mul_reduce_4x V_Z0, V_Z1, V_Z2, V_Z3
+        _delayed_writes_xxperm
+        addi    5, 5, 128
+.endm
+
+.macro _load_curr_peer_coeffs
+        lxvd2x  32+18, GPR_OFFSET_P0, 5
+        lxvd2x  32+19, GPR_OFFSET_P1, 5
+        lxvd2x  32+20, GPR_OFFSET_P2, 5
+        lxvd2x  32+21, GPR_OFFSET_P3, 5
+
+        lxvd2x  32+14, GPR_OFFSET_C0, 5
+        lxvd2x  32+15, GPR_OFFSET_C1, 5
+        lxvd2x  32+16, GPR_OFFSET_C2, 5
+        lxvd2x  32+17, GPR_OFFSET_C3, 5
+.endm
+
+/*
+ * For Layer 3, 4, 5, Len=4, 8, 16
+ */
+.macro INTT_Layer345_4x _vz0 _vz1 _vz2 _vz3
+        _load_curr_peer_coeffs
+        _Compute_4Coeff
+        mont_mul_reduce_4x \_vz0, \_vz1, \_vz2, \_vz3
+        delayed_writes_curr_peer 26, 10, 27, 11, 28, 12, 29, 13
+        addi  5, 5, 128
+.endm
+
+/*
+ * For Layer 6, 7, 8, Len=32, 64, 128
+ */
+.macro INTT_Layer678 _vz0 _vz1 _vz2 _vz3
+        _load_curr_peer_coeffs
+        _Compute_4Coeff
+        mont_mul_reduce_4x \_vz0, \_vz1, \_vz2, \_vz3
+        delayed_writes_curr_peer 26, 10, 27, 11, 28, 12, 29, 13
+        addi  5, 5, 64
+.endm
+
+/* ===================================================================== */
+/*
+ * Supporting macros for Montgomery reduce loops with
+ * constant f=41978 (mont^2/256).
+ */
+.macro _Reload_4coeffs
+        lxvd2x  32+6, 0, 6
+        lxvd2x  32+7, 10, 6
+        lxvd2x  32+8, 11, 6
+        lxvd2x  32+9, 12, 6
+.endm
+
+.macro _update_curr_coeffs_4x
+        stxvd2x 32+10, 0, 6
+        stxvd2x 32+11, 10, 6
+        stxvd2x 32+12, 11, 6
+        stxvd2x 32+13, 12, 6
+        addi    6, 6, 64
+.endm
+
+.macro POLY_Mont_Reduce_4x
+        _Reload_4coeffs
+        mont_mul_reduce_4x V_F, V_F, V_F, V_F
+        _update_curr_coeffs_4x
+
+        _Reload_4coeffs
+        mont_mul_reduce_4x V_F, V_F, V_F, V_F
+        _update_curr_coeffs_4x
+
+        _Reload_4coeffs
+        mont_mul_reduce_4x V_F, V_F, V_F, V_F
+        _update_curr_coeffs_4x
+
+        _Reload_4coeffs
+        mont_mul_reduce_4x V_F, V_F, V_F, V_F
+        _update_curr_coeffs_4x
+.endm
+/* ===================================================================== */
+
+/*
+ * mldsa_poly_ntt_inverse_ppc(int32_t *r)
+ *
+ *   Compute Inverse NTT based on the following 8 layers -
+ *     len = 1, 2, 4, 8, 16, 32, 64, 128.
+ *
+ *   Each layer compute the coefficients on 2 legs, start and start + len*2 offsets.
+ *
+ *   leg 1                        leg 2
+ *   -----                        -----
+ *   start                        start+len*2
+ *   start+next                   start+len*2+next
+ *   start+next+next              start+len*2+next+next
+ *   start+next+next+next         start+len*2+next+next+next
+ *
+ *   Each computation loads 8 vectors, 4 for each leg.
+ *   The final coefficient (t) from each vector of leg1 and leg2 then do the
+ *   add/sub operations to obtain the final results.
+ *
+ *   -> leg1 = leg1 + t, leg2 = leg1 - t
+ *
+ *   The resulting coefficients then store back to each leg's offset.
+ *
+ *   Each vector has the same corresponding zeta except len=2.
+ *
+ *   len=2 has 2-2 layout which means every 2 32-bit coefficients has the same zeta.
+ *   e.g.
+ *         coeff vector    a1   a2   a3  a4
+ *         zeta  vector    z1   z1   z2  z2
+ *
+ *   For len=2, each vector will get permuted to leg1 and leg2. Zeta is
+ *   pre-arranged for the leg1 and leg2.  After the computation, each vector needs
+ *   to transpose back to its original 2-2 layout.
+ *
+ *   For len=1, each vector will get permuted to leg1 and leg2. Zeta is
+ *   pre-arranged for the leg1 and leg2.  After the computation, each vector needs
+ *   to transpose back to its original 1-1-1-1 layout.
+ *
+ * Registers used for offsets to coefficients, curr and peer.  Each layer may
+ * reset these registers.
+ *
+ *   R9: offset to curr
+ *   R11: offset to R9 + next curr offset
+ *   R15: offset to R11 + next curr offset
+ *   R17: offset to R15 + next curr offset
+ *
+ *   R10: offset to peer
+ *   R12: offset to R10 + next peer offset
+ *   R16: offset to R12 + next peer offset
+ *   R18: offset to R16 + next peer offset
+ */
+.global mldsa_poly_ntt_inverse_ppc
+.align 4
+mldsa_poly_ntt_inverse_ppc:
+
+        SAVE_REGS
+
+        /* load Q and Q_NEG_INV */
+        addis   8,2,.mldsa_consts@toc@ha
+        addi    8,8,.mldsa_consts@toc@l
+        lvx     V_Q, 0, 8
+        li      10, Q_NEG_INV_OFFSET
+        lvx     Q_NEG_INV, 10, 8
+
+        /* set zetas array */
+        addi    14, 8, ZETA_INTT_OFFSET
+
+.align 4
+        /*
+         * Layer 1. len = 1
+         */
+        mr      5, 3
+
+        li      GPR_OFFSET_C0, 0
+        li      GPR_OFFSET_C1, 0x20
+        li      GPR_OFFSET_C2, 0x40
+        li      GPR_OFFSET_C3, 0x60
+
+        li      GPR_OFFSET_P0, 0x10
+        li      GPR_OFFSET_P1, 0x30
+        li      GPR_OFFSET_P2, 0x50
+        li      GPR_OFFSET_P3, 0x70
+
+        INTT_Layer1_4x
+        INTT_Layer1_4x
+        INTT_Layer1_4x
+        INTT_Layer1_4x
+        INTT_Layer1_4x
+        INTT_Layer1_4x
+        INTT_Layer1_4x
+        INTT_Layer1_4x
+
+.align 4
+        /*
+         * Layer 2. len = 2
+         */
+        mr      5, 3
+
+        INTT_Layer2_4x
+        INTT_Layer2_4x
+        INTT_Layer2_4x
+        INTT_Layer2_4x
+        INTT_Layer2_4x
+        INTT_Layer2_4x
+        INTT_Layer2_4x
+        INTT_Layer2_4x
+
+.align 4
+        /*
+         * Layer 3. len = 4
+         */
+        mr      5, 3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer345_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer345_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer345_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer345_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer345_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer345_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer345_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer345_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+.align 4
+        /*
+         * Layer 4. len = 8
+         */
+        mr      5, 3
+
+        li      GPR_OFFSET_C1, 0x10
+        li      GPR_OFFSET_C2, 0x40
+        li      GPR_OFFSET_C3, 0x50
+
+        li      GPR_OFFSET_P0, 0x20
+        li      GPR_OFFSET_P1, 0x30
+        li      GPR_OFFSET_P2, 0x60
+        li      GPR_OFFSET_P3, 0x70
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer345_4x V_Z0, V_Z0, V_Z1, V_Z1
+        INTT_Layer345_4x V_Z2, V_Z2, V_Z3, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer345_4x V_Z0, V_Z0, V_Z1, V_Z1
+        INTT_Layer345_4x V_Z2, V_Z2, V_Z3, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer345_4x V_Z0, V_Z0, V_Z1, V_Z1
+        INTT_Layer345_4x V_Z2, V_Z2, V_Z3, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer345_4x V_Z0, V_Z0, V_Z1, V_Z1
+        INTT_Layer345_4x V_Z2, V_Z2, V_Z3, V_Z3
+
+.align 4
+        /*
+         * Layer 5. len = 16
+         */
+        mr      5, 3
+
+        li      GPR_OFFSET_C1, 0x10
+        li      GPR_OFFSET_C2, 0x20
+        li      GPR_OFFSET_C3, 0x30
+
+        li      GPR_OFFSET_P0, 0x40
+        li      GPR_OFFSET_P1, 0x50
+        li      GPR_OFFSET_P2, 0x60
+        li      GPR_OFFSET_P3, 0x70
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer345_4x V_Z0, V_Z0, V_Z0, V_Z0
+        INTT_Layer345_4x V_Z1, V_Z1, V_Z1, V_Z1
+        INTT_Layer345_4x V_Z2, V_Z2, V_Z2, V_Z2
+        INTT_Layer345_4x V_Z3, V_Z3, V_Z3, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer345_4x V_Z0, V_Z0, V_Z0, V_Z0
+        INTT_Layer345_4x V_Z1, V_Z1, V_Z1, V_Z1
+        INTT_Layer345_4x V_Z2, V_Z2, V_Z2, V_Z2
+        INTT_Layer345_4x V_Z3, V_Z3, V_Z3, V_Z3
+
+.align 4
+        /*
+         * Layer 6. len = 32
+         */
+        mr      5, 3
+
+        li      GPR_OFFSET_P0, 0x80
+        li      GPR_OFFSET_P1, 0x90
+        li      GPR_OFFSET_P2, 0xa0
+        li      GPR_OFFSET_P3, 0xb0
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        INTT_Layer678 V_Z0, V_Z0, V_Z0, V_Z0
+        INTT_Layer678 V_Z0, V_Z0, V_Z0, V_Z0
+        addi  5, 5, 0x80
+
+        INTT_Layer678 V_Z1, V_Z1, V_Z1, V_Z1
+        INTT_Layer678 V_Z1, V_Z1, V_Z1, V_Z1
+        addi  5, 5, 0x80
+
+        INTT_Layer678 V_Z2, V_Z2, V_Z2, V_Z2
+        INTT_Layer678 V_Z2, V_Z2, V_Z2, V_Z2
+        addi  5, 5, 0x80
+
+        INTT_Layer678 V_Z3, V_Z3, V_Z3, V_Z3
+        INTT_Layer678 V_Z3, V_Z3, V_Z3, V_Z3
+
+.align 4
+        /*
+         * Layer 7. len = 64
+         */
+        mr      5, 3
+
+        li      GPR_OFFSET_P0, 0x100
+        li      GPR_OFFSET_P1, 0x110
+        li      GPR_OFFSET_P2, 0x120
+        li      GPR_OFFSET_P3, 0x130
+
+        lvx     V_ZETA, 0, 14
+        addi    14, 14, 16
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        addi 5, 5, 0x100
+
+        lvx     V_ZETA, 0, 14
+        addi    14, 14, 16
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+
+        /*
+         * Layer 8. len = 128
+         */
+        mr      5, 3
+
+        li      GPR_OFFSET_P0, 0x200
+        li      GPR_OFFSET_P1, 0x210
+        li      GPR_OFFSET_P2, 0x220
+        li      GPR_OFFSET_P3, 0x230
+
+        lvx     V_ZETA, 0, 14
+        addi    14, 14, 16
+
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        INTT_Layer678 V_ZETA, V_ZETA, V_ZETA, V_ZETA
+
+        /*
+         * Montgomery reduce loops with
+         *   constant inverse_degree_montgomery f=41978 (mont^2/256)
+         *
+         *  updated coeff = montgomery_reduce((int64_t)f * coeff)
+         */
+        addi    10, 8, FCONST_OFFSET
+        lvx     V_F, 0, 10
+
+        li      10, 16
+        li      11, 32
+        li      12, 48
+
+        mr      6, 3
+
+        POLY_Mont_Reduce_4x
+        POLY_Mont_Reduce_4x
+        POLY_Mont_Reduce_4x
+        POLY_Mont_Reduce_4x
+
+        RESTORE_REGS
+        blr
+.size     mldsa_poly_ntt_inverse_ppc,.-mldsa_poly_ntt_inverse_ppc
+
+.rodata
+.align 4
+.mldsa_consts:
+.long ML_DSA_Q, ML_DSA_Q, ML_DSA_Q, ML_DSA_Q
+.long ML_DSA_Q_NEG_INV, ML_DSA_Q_NEG_INV, ML_DSA_Q_NEG_INV, ML_DSA_Q_NEG_INV
+/* Constant for INTT, f=mont^2/256 */
+.long 41978, 41978, 41978, 41978
+
+.mldsa_izetas:
+/* Zetas for Lane=1: setup as (3, 2, 1, 4) order */
+.long 6979993, 6403635, 4442679, 846154, 4460757, 1362209, 554416, 48306
+.long 976891, 3545687, 8196974, 6767575, 2235985, 2286327, 2939036, 420899
+.long 1104333, 3833893, 1667432, 260646, 6656817, 6470041, 426683, 1803090
+.long 975884, 7908339, 6167306, 6662682, 4856520, 8110657, 3038916, 4513516
+.long 6727783, 1799107, 7570268, 3694233, 8217573, 5366416, 3183426, 6764025
+.long 5011305, 1207385, 6423145, 8194886, 5948022, 164721, 2013608, 5925962
+.long 3724270, 3776993, 2584293, 7786281, 2831860, 1846953, 542412, 1671176
+.long 7603226, 4974386, 6880252, 6144537, 6463336, 1374803, 1279661, 2546312
+.long 7067962, 1962642, 451100, 5074302, 7143142, 1430225, 1333058, 3318210
+.long 6511298, 1050970, 2994039, 6476982, 7129923, 3548272, 3767016, 5744496
+.long 7132797, 6784443, 4325093, 5894064, 5688936, 7115408, 5538076, 2590150
+.long 3342277, 8177373, 4943130, 6644538, 8093429, 4272102, 8038120, 2437823
+.long 525098, 3595838, 3556995, 768622, 3122442, 5173371, 655327, 6348669
+.long 1613174, 522500, 7884926, 43260, 6521319, 7561383, 7479715, 7470875
+.long 3759364, 3193378, 3520352, 1197226, 5945978, 4867236, 8113420, 1235728
+.long 6136326, 3562462, 3342478, 2446433, 4972711, 4562441, 6288750, 6063917
+/* For Len=2 */
+.long 4540456, 4540456, 3628969, 3628969, 3881060, 3881060, 3019102, 3019102
+.long 1439742, 1439742, 812732, 812732, 1584928, 1584928, 7094748, 7094748
+.long 7039087, 7039087, 7064828, 7064828, 177440, 177440, 2409325, 2409325
+.long 1851402, 1851402, 5220671, 5220671, 3553272, 3553272, 8190869, 8190869
+.long 1316856, 1316856, 7620448, 7620448, 210977, 210977, 5991061, 5991061
+.long 3249728, 3249728, 6727353, 6727353, 8578, 8578, 3724342, 3724342
+.long 4421799, 4421799, 7475901, 7475901, 1100098, 1100098, 8336129, 8336129
+.long 5282425, 5282425, 7871466, 7871466, 8115473, 8115473, 3343383, 3343383
+.long 1430430, 1430430, 6527646, 6527646, 7031341, 7031341, 381987, 381987
+.long 1308169, 1308169, 22981, 22981, 1228525, 1228525, 671102, 671102
+.long 2477047, 2477047, 411027, 411027, 3693493, 3693493, 2967645, 2967645
+.long 5665122, 5665122, 6232521, 6232521, 983419, 983419, 4968207, 4968207
+.long 8253495, 8253495, 3632928, 3632928, 3157330, 3157330, 3190144, 3190144
+.long 1000202, 1000202, 4083598, 4083598, 6441103, 6441103, 1257611, 1257611
+.long 1585221, 1585221, 6203962, 6203962, 4904467, 4904467, 1452451, 1452451
+.long 3041255, 3041255, 3677745, 3677745, 1528703, 1528703, 3930395, 3930395
+/*  For Lane=4 */
+.long 2797779, 2797779, 2797779, 2797779, 6308525, 6308525, 6308525, 6308525
+.long 2556880, 2556880, 2556880, 2556880, 4479693, 4479693, 4479693, 4479693
+.long 4499374, 4499374, 4499374, 4499374, 7426187, 7426187, 7426187, 7426187
+.long 7849063, 7849063, 7849063, 7849063, 7568473, 7568473, 7568473, 7568473
+.long 4680821, 4680821, 4680821, 4680821, 1600420, 1600420, 1600420, 1600420
+.long 2140649, 2140649, 2140649, 2140649, 4873154, 4873154, 4873154, 4873154
+.long 3821735, 3821735, 3821735, 3821735, 4874723, 4874723, 4874723, 4874723
+.long 1643818, 1643818, 1643818, 1643818, 1699267, 1699267, 1699267, 1699267
+.long 539299, 539299, 539299, 539299, 6031717, 6031717, 6031717, 6031717
+.long 300467, 300467, 300467, 300467, 4840449, 4840449, 4840449, 4840449
+.long 2867647, 2867647, 2867647, 2867647, 4805995, 4805995, 4805995, 4805995
+.long 3043716, 3043716, 3043716, 3043716, 3861115, 3861115, 3861115, 3861115
+.long 4464978, 4464978, 4464978, 4464978, 2537516, 2537516, 2537516, 2537516
+.long 3592148, 3592148, 3592148, 3592148, 1661693, 1661693, 1661693, 1661693
+.long 4849980, 4849980, 4849980, 4849980, 5303092, 5303092, 5303092, 5303092
+.long 8284641, 8284641, 8284641, 8284641, 5674394, 5674394, 5674394, 5674394
+/* zetas for other len */
+.long 8100412, 8100412, 8100412, 8100412, 4369920, 4369920, 4369920, 4369920
+.long 19422, 19422, 19422, 19422, 6623180, 6623180, 6623180, 6623180
+.long 3277672, 3277672, 3277672, 3277672, 1399561, 1399561, 1399561, 1399561
+.long 3859737, 3859737, 3859737, 3859737, 2118186, 2118186, 2118186, 2118186
+.long 2108549, 2108549, 2108549, 2108549, 5760665, 5760665, 5760665, 5760665
+.long 1119584, 1119584, 1119584, 1119584, 549488, 549488, 549488, 549488
+.long 4794489, 4794489, 4794489, 4794489, 1079900, 1079900, 1079900, 1079900
+.long 7356305, 7356305, 7356305, 7356305, 5654953, 5654953, 5654953, 5654953
+.long 5700314, 5700314, 5700314, 5700314, 5268920, 5268920, 5268920, 5268920
+.long 2884855, 2884855, 2884855, 2884855, 5260684, 5260684, 5260684, 5260684
+.long 2091905, 2091905, 2091905, 2091905, 359251, 359251, 359251, 359251
+.long 6026966, 6026966, 6026966, 6026966, 6554070, 6554070, 6554070, 6554070
+.long 7913949, 7913949, 7913949, 7913949, 876248, 876248, 876248, 876248
+.long 777960, 777960, 777960, 777960, 8143293, 8143293, 8143293, 8143293
+.long 518909, 518909, 518909, 518909, 2608894, 2608894, 2608894, 2608894
+.long 8354570, 8354570, 8354570, 8354570
diff --git a/deps/openssl/openssl/crypto/ml_dsa/asm/mldsa_ntt_ppc64le.S b/deps/openssl/openssl/crypto/ml_dsa/asm/mldsa_ntt_ppc64le.S
new file mode 100644
index 00000000000..40f12bcd685
--- /dev/null
+++ b/deps/openssl/openssl/crypto/ml_dsa/asm/mldsa_ntt_ppc64le.S
@@ -0,0 +1,700 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+/*
+ * Copyright IBM Corp. 2025, 2026
+ *
+ * ===================================================================================
+ * Written by Danny Tsen <dtsen@us.ibm.com>
+ *
+ * Optimized NTT implementation for ppc64le.
+ */
+
+#define Q_NEG_INV_OFFSET 16
+#define ZETA_NTT_OFFSET 32
+
+#define V_ZETA  2
+#define V_Z0    2
+#define V_Z1    3
+#define V_Z2    4
+#define V_Z3    5
+
+#include "mldsa_ppc_macros_asm.inc"
+
+.machine "any"
+.text
+
+.macro SAVE_REGS
+        stdu    1, -352(1)
+        mflr    0
+        std     14, 56(1)
+        std     15, 64(1)
+        std     16, 72(1)
+        std     17, 80(1)
+        std     18, 88(1)
+        std     19, 96(1)
+        std     20, 104(1)
+        std     21, 112(1)
+        li      10, 128
+        li      11, 144
+        li      12, 160
+        li      14, 176
+        li      15, 192
+        li      16, 208
+        stxvx   32+20, 10, 1
+        stxvx   32+21, 11, 1
+        stxvx   32+22, 12, 1
+        stxvx   32+23, 14, 1
+        stxvx   32+24, 15, 1
+        stxvx   32+25, 16, 1
+        li      10, 224
+        li      11, 240
+        li      12, 256
+        li      14, 272
+        stxvx   32+26, 10, 1
+        stxvx   32+27, 11, 1
+        stxvx   32+28, 12, 1
+        stxvx   32+29, 14, 1
+.endm
+
+.macro RESTORE_REGS
+        li      10, 128
+        li      11, 144
+        li      12, 160
+        li      14, 176
+        li      15, 192
+        li      16, 208
+        lxvx    32+20, 10, 1
+        lxvx    32+21, 11, 1
+        lxvx    32+22, 12, 1
+        lxvx    32+23, 14, 1
+        lxvx    32+24, 15, 1
+        lxvx    32+25, 16, 1
+        li      10, 224
+        li      11, 240
+        li      12, 256
+        li      14, 272
+        lxvx    32+26, 10, 1
+        lxvx    32+27, 11, 1
+        lxvx    32+28, 12, 1
+        lxvx    32+29, 14, 1
+        ld      14, 56(1)
+        ld      15, 64(1)
+        ld      16, 72(1)
+        ld      17, 80(1)
+        ld      18, 88(1)
+        ld      19, 96(1)
+        ld      20, 104(1)
+        ld      21, 112(1)
+
+        mtlr    0
+        addi    1, 1, 352
+.endm
+
+/* ===================================================================== */
+/*
+ * Compute updated curr and peer coefficients.
+ *   updated curr = reduce_once(curr + peer);
+ *   updated peer = mod_sub(curr, peer);
+ *
+ *   Input curr : V26, V27, V28, V29
+ *   Input peer : V10, V11, V12, V13
+ *
+ *   updated peer : V18, V19, V20, V21
+ *   updated curr : V22, V23, V24, V25
+ */
+.macro _update_curr_peer_coeffs
+        vadduwm 22, 26, 10
+        mod_sub 18, 26, 10
+
+        vadduwm 23, 27, 11
+        mod_sub 19, 27, 11
+
+        vadduwm 24, 28, 12
+        mod_sub 20, 28, 12
+
+        vadduwm 25, 29, 13
+        mod_sub 21, 29, 13
+
+        reduce_once_1x 22
+        reduce_once_1x 23
+        reduce_once_1x 24
+        reduce_once_1x 25
+.endm
+
+/*
+ * Transpose the final coefficients of 2-2 layout to the original
+ * coefficient array order.
+ *
+ *   updated peer : V14, V15, V16, V17
+ *   updated curr : V10, V11, V12, V13
+ */
+.macro _delayed_writes_xxperm
+        xxpermdi 32+10, 32+22, 32+18, 0
+        xxpermdi 32+14, 32+22, 32+18, 3
+        xxpermdi 32+11, 32+23, 32+19, 0
+        xxpermdi 32+15, 32+23, 32+19, 3
+        xxpermdi 32+12, 32+24, 32+20, 0
+        xxpermdi 32+16, 32+24, 32+20, 3
+        xxpermdi 32+13, 32+25, 32+21, 0
+        xxpermdi 32+17, 32+25, 32+21, 3
+        delayed_writes_curr_peer 10, 14, 11, 15, 12, 16, 13, 17
+.endm
+
+/*
+ * Transpose the final coefficients of 1-1-1-1 layout to the original
+ * coefficient array order.
+ *
+ *   updated peer : V14, V15, V16, V17
+ *   updated curr : V10, V11, V12, V13
+ */
+.macro _delayed_writes_vmrg
+        vmrgew 10, 18, 22
+        vmrgow 11, 18, 22
+        vmrgew 12, 19, 23
+        vmrgow 13, 19, 23
+        vmrgew 14, 20, 24
+        vmrgow 15, 20, 24
+        vmrgew 16, 21, 25
+        vmrgow 17, 21, 25
+        delayed_writes_curr_peer 10, 11, 12, 13, 14, 15, 16, 17
+.endm
+
+/*
+ * NTT computation for layers, 1, 2, 3, 4, 5, 6.
+ */
+.macro _ntt_body _vz0, _vz1, _vz2, _vz3
+        lxvd2x  32+6, 5, GPR_OFFSET_P0
+        lxvd2x  32+7, 5, GPR_OFFSET_P1
+        lxvd2x  32+8, 5, GPR_OFFSET_P2
+        lxvd2x  32+9, 5, GPR_OFFSET_P3
+        mont_mul_reduce_4x \_vz0, \_vz1, \_vz2, \_vz3
+        lxvd2x  32+26, 5, GPR_OFFSET_C0
+        lxvd2x  32+27, 5, GPR_OFFSET_C1
+        lxvd2x  32+28, 5, GPR_OFFSET_C2
+        lxvd2x  32+29, 5, GPR_OFFSET_C3
+
+        /* update curr and peer coefficients */
+        _update_curr_peer_coeffs
+.endm
+
+/*
+ * For Layer 1, 2, 3, Len=32, 64, 128
+ */
+.macro NTT_Layer123_4x _vz0, _vz1, _vz2, _vz3
+        _ntt_body \_vz0, \_vz1, \_vz2, \_vz3
+        delayed_writes_curr_peer 22, 18, 23, 19, 24, 20, 25, 21
+        addi    5, 5, 64
+.endm
+
+/*
+ * For Layer 4, 5, 6, Len=4, 8, 16
+ */
+.macro NTT_Layer456_4x _vz0, _vz1, _vz2, _vz3
+        _ntt_body \_vz0, \_vz1, \_vz2, \_vz3
+        delayed_writes_curr_peer 22, 18, 23, 19, 24, 20, 25, 21
+        addi    5, 5, 128
+.endm
+
+/*
+ * For Layer 7, Len= 2, layer with 2-2 layout.
+ */
+.macro NTT_Layer7_4x
+        lxvd2x  32+V_Z0, 0, 14
+        lxvd2x  32+V_Z1, 10, 14
+        lxvd2x  32+V_Z2, 11, 14
+        lxvd2x  32+V_Z3, 12, 14
+        addi    14, 14, 64
+        Load_xxperm_coeffs 26, 27, 28, 29, 6, 7, 8, 9
+        mont_mul_reduce_4x V_Z0, V_Z1, V_Z2, V_Z3
+        _update_curr_peer_coeffs
+        _delayed_writes_xxperm
+        addi    5, 5, 128
+.endm
+
+/*
+ * For Layer 8, Len= 1, layer with 1-1-1-1 layout.
+ */
+.macro NTT_Layer8_4x
+        lxvd2x  32+V_Z0, 0, 14
+        lxvd2x  32+V_Z1, 10, 14
+        lxvd2x  32+V_Z2, 11, 14
+        lxvd2x  32+V_Z3, 12, 14
+        addi    14, 14, 64
+        Load_vmrg_coeffs 26, 27, 28, 29, 6, 7, 8, 9
+        mont_mul_reduce_4x V_Z0, V_Z1, V_Z2, V_Z3
+        _update_curr_peer_coeffs
+        _delayed_writes_vmrg
+        addi    5, 5, 128
+.endm
+
+/* ===================================================================== */
+/*
+ * mldsa_poly_ntt_ppc(int32_t *r)
+ *   Compute forward NTT based on the following 8 layers -
+ *     len = 128, 64, 32, 16, 8, 4, 2, 1.
+ *
+ *   Each layer compute the coefficients on 2 legs, start and start + len*2 offsets.
+ *
+ *   leg 1                        leg 2
+ *   -----                        -----
+ *   start                        start+len*2
+ *   start+next                   start+len*2+next
+ *   start+next+next              start+len*2+next+next
+ *   start+next+next+next         start+len*2+next+next+next
+ *
+ *   Each computation loads 8 vectors, 4 for each leg.
+ *   The final coefficient (t) from each vector of leg1 and leg2 then do the
+ *   add/sub operations to obtain the final results.
+ *
+ *   -> leg1 = leg1 + t, leg2 = leg1 - t
+ *
+ *   The resulting coefficients then store back to each leg's offset.
+ *
+ *   Each vector has the same corresponding zeta except len=2.
+ *
+ *   len=2 has 2-2 layout which means every 2 32-bit coefficients has the same zeta.
+ *   e.g.
+ *         coeff vector    a1   a2   a3  a4
+ *         zeta  vector    z1   z1   z2  z2
+ *
+ *   For len=2, each vector will get permuted to leg1 and leg2. Zeta is
+ *   pre-arranged for the leg1 and leg2.  After the computation, each vector needs
+ *   to transpose back to its original 2-2 layout.
+ *
+ *   For len=1, each vector will get permuted to leg1 and leg2. Zeta is
+ *   pre-arranged for the leg1 and leg2.  After the computation, each vector needs
+ *   to transpose back to its original 1-1-1-1 layout.
+ *
+ * Registers used for offsets to coefficients, curr and peer.  Each layer may
+ * reset these registers.
+ *
+ *   R9: offset to curr
+ *   R11: offset to R9 + next curr offset
+ *   R15: offset to R11 + next curr offset
+ *   R17: offset to R15 + next curr offset
+ *
+ *   R10: offset to peer
+ *   R12: offset to R10 + next peer offset
+ *   R16: offset to R12 + next peer offset
+ *   R18: offset to R16 + next peer offset
+ */
+.global mldsa_poly_ntt_ppc
+.align 4
+mldsa_poly_ntt_ppc:
+
+        SAVE_REGS
+
+        /* load Q and Q_NEG_INV */
+        addis   8,2,.mldsa_consts@toc@ha
+        addi    8,8,.mldsa_consts@toc@l
+        lvx     V_Q, 0, 8
+        li      10, Q_NEG_INV_OFFSET
+        lvx     Q_NEG_INV, 10, 8
+
+        /* set zetas array */
+        addi      14, 8, ZETA_NTT_OFFSET
+
+        /*
+         * 1. Layer 1, len = 128
+         */
+        mr      5, 3
+
+        li      GPR_OFFSET_C0, 0
+        li      GPR_OFFSET_C1, 0x10
+        li      GPR_OFFSET_C2, 0x20
+        li      GPR_OFFSET_C3, 0x30
+
+        li      GPR_OFFSET_P0, 0x200
+        li      GPR_OFFSET_P1, 0x210
+        li      GPR_OFFSET_P2, 0x220
+        li      GPR_OFFSET_P3, 0x230
+
+        lvx     V_ZETA, 0, 14
+        addi    14, 14, 16
+
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+
+.align 4
+        /*
+         * Layer 2. len = 64
+         */
+        mr      5, 3
+
+        li      GPR_OFFSET_P0, 0x100
+        li      GPR_OFFSET_P1, 0x110
+        li      GPR_OFFSET_P2, 0x120
+        li      GPR_OFFSET_P3, 0x130
+
+        lvx     V_ZETA, 0, 14
+        addi    14, 14, 16
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        addi  5, 5, 0x100
+
+        lvx     V_ZETA, 0, 14
+        addi    14, 14, 16
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        NTT_Layer123_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+
+.align 4
+        /*
+         * Layer 3. len = 32
+         */
+        mr      5, 3
+
+        li      GPR_OFFSET_P0, 0x80
+        li      GPR_OFFSET_P1, 0x90
+        li      GPR_OFFSET_P2, 0xa0
+        li      GPR_OFFSET_P3, 0xb0
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer123_4x V_Z0, V_Z0, V_Z0, V_Z0
+        NTT_Layer123_4x V_Z0, V_Z0, V_Z0, V_Z0
+        addi  5, 5, 0x80
+
+        NTT_Layer123_4x V_Z1, V_Z1, V_Z1, V_Z1
+        NTT_Layer123_4x V_Z1, V_Z1, V_Z1, V_Z1
+        addi  5, 5, 0x80
+
+        NTT_Layer123_4x V_Z2, V_Z2, V_Z2, V_Z2
+        NTT_Layer123_4x V_Z2, V_Z2, V_Z2, V_Z2
+        addi  5, 5, 0x80
+
+        NTT_Layer123_4x V_Z3, V_Z3, V_Z3, V_Z3
+        NTT_Layer123_4x V_Z3, V_Z3, V_Z3, V_Z3
+
+.align 4
+        /*
+         * Layer 4. len = 16
+         */
+        mr      5, 3
+
+        li      GPR_OFFSET_P0, 0x40
+        li      GPR_OFFSET_P1, 0x50
+        li      GPR_OFFSET_P2, 0x60
+        li      GPR_OFFSET_P3, 0x70
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer456_4x V_Z0, V_Z0, V_Z0, V_Z0
+        NTT_Layer456_4x V_Z1, V_Z1, V_Z1, V_Z1
+        NTT_Layer456_4x V_Z2, V_Z2, V_Z2, V_Z2
+        NTT_Layer456_4x V_Z3, V_Z3, V_Z3, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer456_4x V_Z0, V_Z0, V_Z0, V_Z0
+        NTT_Layer456_4x V_Z1, V_Z1, V_Z1, V_Z1
+        NTT_Layer456_4x V_Z2, V_Z2, V_Z2, V_Z2
+        NTT_Layer456_4x V_Z3, V_Z3, V_Z3, V_Z3
+
+.align 4
+        /*
+         * Layer 5. len = 8
+         */
+        mr      5, 3
+
+        li      GPR_OFFSET_C1, 0x10
+        li      GPR_OFFSET_C2, 0x40
+        li      GPR_OFFSET_C3, 0x50
+
+        li      GPR_OFFSET_P0, 0x20
+        li      GPR_OFFSET_P1, 0x30
+        li      GPR_OFFSET_P2, 0x60
+        li      GPR_OFFSET_P3, 0x70
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer456_4x V_Z0, V_Z0, V_Z1, V_Z1
+        NTT_Layer456_4x V_Z2, V_Z2, V_Z3, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer456_4x V_Z0, V_Z0, V_Z1, V_Z1
+        NTT_Layer456_4x V_Z2, V_Z2, V_Z3, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer456_4x V_Z0, V_Z0, V_Z1, V_Z1
+        NTT_Layer456_4x V_Z2, V_Z2, V_Z3, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer456_4x V_Z0, V_Z0, V_Z1, V_Z1
+        NTT_Layer456_4x V_Z2, V_Z2, V_Z3, V_Z3
+
+.align 4
+        /*
+         * Layer 6. len = 4
+         */
+        mr      5, 3
+
+        li      GPR_OFFSET_C1, 0x20
+        li      GPR_OFFSET_C2, 0x40
+        li      GPR_OFFSET_C3, 0x60
+
+        li      GPR_OFFSET_P0, 0x10
+        li      GPR_OFFSET_P1, 0x30
+        li      GPR_OFFSET_P2, 0x50
+        li      GPR_OFFSET_P3, 0x70
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer456_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer456_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer456_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer456_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer456_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer456_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer456_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+        Load_4zetas V_Z0, V_Z1, V_Z2, V_Z3
+        NTT_Layer456_4x V_Z0, V_Z1, V_Z2, V_Z3
+
+.align 4
+        /*
+         * Layer 7. len = 2
+         *   Layer 7 uses the same offset as Layer 6.
+         */
+        mr      5, 3
+
+        NTT_Layer7_4x
+        NTT_Layer7_4x
+        NTT_Layer7_4x
+        NTT_Layer7_4x
+        NTT_Layer7_4x
+        NTT_Layer7_4x
+        NTT_Layer7_4x
+        NTT_Layer7_4x
+
+.align 4
+        /*
+         * Layer 8. len = 1
+         *   Layer 8 uses the same offset as Layer 6.
+         */
+        mr      5, 3
+
+        NTT_Layer8_4x
+        NTT_Layer8_4x
+        NTT_Layer8_4x
+        NTT_Layer8_4x
+        NTT_Layer8_4x
+        NTT_Layer8_4x
+        NTT_Layer8_4x
+        NTT_Layer8_4x
+
+        RESTORE_REGS
+        blr
+.size     mldsa_poly_ntt_ppc,.-mldsa_poly_ntt_ppc
+
+/* ===================================================================== */
+.macro POLY_SAVE_REGS
+        stdu    1, -256(1)
+        mflr    0
+        li      9, 128
+        li      10, 144
+        li      11, 160
+        li      12, 176
+        stxvx   32+20, 9, 1
+        stxvx   32+21, 10, 1
+        stxvx   32+22, 11, 1
+        stxvx   32+23, 12, 1
+        li      9, 192
+        li      10, 208
+        stxvx   32+24, 9, 1
+        stxvx   32+25, 10, 1
+.endm
+
+.macro POLY_RESTORE_REGS
+        li      9, 128
+        li      10, 144
+        li      11, 160
+        li      12, 176
+        lxvx    32+20, 9, 1
+        lxvx    32+21, 10, 1
+        lxvx    32+22, 11, 1
+        lxvx    32+23, 12, 1
+        li      9, 192
+        li      10, 208
+        lxvx    32+24, 9, 1
+        lxvx    32+25, 10, 1
+
+        mtlr    0
+        addi    1, 1, 256
+.endm
+
+.macro _Load_poly_points_vectors
+        lxvd2x     32+2, 0, 4
+        lxvd2x     32+3, 10, 4
+        lxvd2x     32+4, 11, 4
+        lxvd2x     32+5, 12, 4
+
+        lxvd2x     32+6, 0, 5
+        lxvd2x     32+7, 10, 5
+        lxvd2x     32+8, 11, 5
+        lxvd2x     32+9, 12, 5
+        addi    4, 4, 64
+        addi    5, 5, 64
+.endm
+
+.macro _update_poly_coeffs
+        stxvd2x     32+10, 0, 3
+        stxvd2x     32+11, 10, 3
+        stxvd2x     32+12, 11, 3
+        stxvd2x     32+13, 12, 3
+        addi    3, 3, 64
+.endm
+
+.macro _poly_ntt_mul_4x
+        _Load_poly_points_vectors
+        //_Mont_point_mul
+        Mont_scalar_mul_4x 2, 3, 4, 5
+        Mont_reduce_4x
+        _update_poly_coeffs
+.endm
+
+/*
+ * mldsa_poly_ntt_mult(poly *c, const poly *a, const poly *b)
+ */
+.global mldsa_poly_ntt_mult_ppc
+.align 4
+mldsa_poly_ntt_mult_ppc:
+
+        POLY_SAVE_REGS
+
+        /* load Q and Q_NEG_INV */
+        addis   8,2,.mldsa_consts@toc@ha
+        addi    8,8,.mldsa_consts@toc@l
+        lvx     V_Q, 0, 8
+        li      10, 16
+        lvx     Q_NEG_INV, 10, 8
+
+        /*
+         * Montgomery reduce loops for a * b
+         *
+         *  c[j] = montgomery_reduce(a[j] * b[j])
+         */
+        li       10, 16
+        li       11, 32
+        li       12, 48
+
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+        _poly_ntt_mul_4x
+
+        POLY_RESTORE_REGS
+        blr
+.size     mldsa_poly_ntt_mult_ppc,.-mldsa_poly_ntt_mult_ppc
+/* ===================================================================== */
+
+.rodata
+.align 4
+.mldsa_consts:
+.long ML_DSA_Q, ML_DSA_Q, ML_DSA_Q, ML_DSA_Q
+.long ML_DSA_Q_NEG_INV, ML_DSA_Q_NEG_INV, ML_DSA_Q_NEG_INV, ML_DSA_Q_NEG_INV
+
+/* zetas */
+.mldsa_zetas:
+/* For Len=128, 64, 32, 16, 8 */
+.long 25847, 25847, 25847, 25847, 5771523, 5771523, 5771523, 5771523
+.long 7861508, 7861508, 7861508, 7861508, 237124, 237124, 237124, 237124
+.long 7602457, 7602457, 7602457, 7602457, 7504169, 7504169, 7504169, 7504169
+.long 466468, 466468, 466468, 466468, 1826347, 1826347, 1826347, 1826347
+.long 2353451, 2353451, 2353451, 2353451, 8021166, 8021166, 8021166, 8021166
+.long 6288512, 6288512, 6288512, 6288512, 3119733, 3119733, 3119733, 3119733
+.long 5495562, 5495562, 5495562, 5495562, 3111497, 3111497, 3111497, 3111497
+.long 2680103, 2680103, 2680103, 2680103, 2725464, 2725464, 2725464, 2725464
+.long 1024112, 1024112, 1024112, 1024112, 7300517, 7300517, 7300517, 7300517
+.long 3585928, 3585928, 3585928, 3585928, 7830929, 7830929, 7830929, 7830929
+.long 7260833, 7260833, 7260833, 7260833, 2619752, 2619752, 2619752, 2619752
+.long 6271868, 6271868, 6271868, 6271868, 6262231, 6262231, 6262231, 6262231
+.long 4520680, 4520680, 4520680, 4520680, 6980856, 6980856, 6980856, 6980856
+.long 5102745, 5102745, 5102745, 5102745, 1757237, 1757237, 1757237, 1757237
+.long 8360995, 8360995, 8360995, 8360995, 4010497, 4010497, 4010497, 4010497
+.long 280005, 280005, 280005, 280005
+/*For Len=4 */
+.long 2706023, 2706023, 2706023, 2706023, 95776, 95776, 95776, 95776
+.long 3077325, 3077325, 3077325, 3077325, 3530437, 3530437, 3530437, 3530437
+.long 6718724, 6718724, 6718724, 6718724, 4788269, 4788269, 4788269, 4788269
+.long 5842901, 5842901, 5842901, 5842901, 3915439, 3915439, 3915439, 3915439
+.long 4519302, 4519302, 4519302, 4519302, 5336701, 5336701, 5336701, 5336701
+.long 3574422, 3574422, 3574422, 3574422, 5512770, 5512770, 5512770, 5512770
+.long 3539968, 3539968, 3539968, 3539968, 8079950, 8079950, 8079950, 8079950
+.long 2348700, 2348700, 2348700, 2348700, 7841118, 7841118, 7841118, 7841118
+.long 6681150, 6681150, 6681150, 6681150, 6736599, 6736599, 6736599, 6736599
+.long 3505694, 3505694, 3505694, 3505694, 4558682, 4558682, 4558682, 4558682
+.long 3507263, 3507263, 3507263, 3507263, 6239768, 6239768, 6239768, 6239768
+.long 6779997, 6779997, 6779997, 6779997, 3699596, 3699596, 3699596, 3699596
+.long 811944, 811944, 811944, 811944, 531354, 531354, 531354, 531354
+.long 954230, 954230, 954230, 954230, 3881043, 3881043, 3881043, 3881043
+.long 3900724, 3900724, 3900724, 3900724, 5823537, 5823537, 5823537, 5823537
+.long 2071892, 2071892, 2071892, 2071892, 5582638, 5582638, 5582638, 5582638
+/* For Len=2 */
+.long 4450022, 4450022, 6851714, 6851714, 4702672, 4702672, 5339162, 5339162
+.long 6927966, 6927966, 3475950, 3475950, 2176455, 2176455, 6795196, 6795196
+.long 7122806, 7122806, 1939314, 1939314, 4296819, 4296819, 7380215, 7380215
+.long 5190273, 5190273, 5223087, 5223087, 4747489, 4747489, 126922, 126922
+.long 3412210, 3412210, 7396998, 7396998, 2147896, 2147896, 2715295, 2715295
+.long 5412772, 5412772, 4686924, 4686924, 7969390, 7969390, 5903370, 5903370
+.long 7709315, 7709315, 7151892, 7151892, 8357436, 8357436, 7072248, 7072248
+.long 7998430, 7998430, 1349076, 1349076, 1852771, 1852771, 6949987, 6949987
+.long 5037034, 5037034, 264944, 264944, 508951, 508951, 3097992, 3097992
+.long 44288, 44288, 7280319, 7280319, 904516, 904516, 3958618, 3958618
+.long 4656075, 4656075, 8371839, 8371839, 1653064, 1653064, 5130689, 5130689
+.long 2389356, 2389356, 8169440, 8169440, 759969, 759969, 7063561, 7063561
+.long 189548, 189548, 4827145, 4827145, 3159746, 3159746, 6529015, 6529015
+.long 5971092, 5971092, 8202977, 8202977, 1315589, 1315589, 1341330, 1341330
+.long 1285669, 1285669, 6795489, 6795489, 7567685, 7567685, 6940675, 6940675
+.long 5361315, 5361315, 4499357, 4499357, 4751448, 4751448, 3839961, 3839961
+/* Setup zetas for Len=1 as (3, 2, 1, 4) order */
+.long 2316500, 2091667, 3817976, 3407706, 5933984, 5037939, 4817955, 2244091
+.long 7144689, 266997, 3513181, 2434439, 7183191, 4860065, 5187039, 4621053
+.long 909542, 900702, 819034, 1859098, 8337157, 495491, 7857917, 6767243
+.long 2031748, 7725090, 3207046, 5257975, 7611795, 4823422, 4784579, 7855319
+.long 5942594, 342297, 4108315, 286988, 1735879, 3437287, 203044, 5038140
+.long 5790267, 2842341, 1265009, 2691481, 2486353, 4055324, 1595974, 1247620
+.long 2635921, 4613401, 4832145, 1250494, 1903435, 5386378, 7329447, 1869119
+.long 5062207, 7047359, 6950192, 1237275, 3306115, 7929317, 6417775, 1312455
+.long 5834105, 7100756, 7005614, 1917081, 2235880, 1500165, 3406031, 777191
+.long 6709241, 7838005, 6533464, 5548557, 594136, 5796124, 4603424, 4656147
+.long 2454455, 6366809, 8215696, 2432395, 185531, 1957272, 7173032, 3369112
+.long 1616392, 5196991, 3014001, 162844, 4686184, 810149, 6581310, 1652634
+.long 3866901, 5341501, 269760, 3523897, 1717735, 2213111, 472078, 7404533
+.long 6577327, 7953734, 1910376, 1723600, 8119771, 6712985, 4546524, 7276084
+.long 7959518, 5441381, 6094090, 6144432, 1612842, 183443, 4834730, 7403526
+.long 8332111, 7826001, 7018208, 3919660, 7534263, 3937738, 1976782, 1400424
diff --git a/deps/openssl/openssl/crypto/ml_dsa/asm/mldsa_ppc_macros_asm.inc b/deps/openssl/openssl/crypto/ml_dsa/asm/mldsa_ppc_macros_asm.inc
new file mode 100644
index 00000000000..3f386db5634
--- /dev/null
+++ b/deps/openssl/openssl/crypto/ml_dsa/asm/mldsa_ppc_macros_asm.inc
@@ -0,0 +1,228 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+/*
+ * Copyright IBM Corp. 2025, 2026
+ *
+ * ===================================================================================
+ * Written by Danny Tsen <dtsen@us.ibm.com>
+ */
+
+#define ML_DSA_Q 8380417   /* The modulus is 23 bits (2^23 - 2^13 + 1) */
+#define ML_DSA_Q_NEG_INV 4236238847 /* Inverse of -q modulo 2^32 */
+
+#define Q_NEG_INV    0
+#define V_Q     1
+
+#define GPR_OFFSET_C0 9
+#define GPR_OFFSET_C1 11
+#define GPR_OFFSET_C2 15
+#define GPR_OFFSET_C3 17
+
+#define GPR_OFFSET_P0 10
+#define GPR_OFFSET_P1 12
+#define GPR_OFFSET_P2 16
+#define GPR_OFFSET_P3 18
+
+/* ===================================================================== */
+/*
+ * For NTT implementation, initial peer and curr vectors setup as
+ *  peer = V6, V7, V8, V9
+ *  curr = V26, V27, V28, V29
+ *
+ * For Inverse NTT implementation, initial peer and curr vectors setup as
+ *  peer = V18, V19, V20, V21
+ *  curr = V14, V15, V16, V17
+ */
+/*
+ * Load coefficients with 1-1-1-1 layout,
+ *  each load contains 2 curr and 2 peer elements.
+ *    -> curr1 peer1 curr2 peer2
+ *       curr3 peer3 curr4 peer4
+ *  vmrgew and vmrgow ->
+ *       curr vector contains 4 curr elements and
+ *       peer vector contains 4 peer elements
+ *
+ * In order to do the coefficients computation, zeta vector will arrange
+ * in the proper order to match the multiplication.
+ */
+.macro Load_vmrg_coeffs _c1, _c2, _c3, _c4, _p1, _p2, _p3, _p4
+        lxvd2x     32+10, GPR_OFFSET_C0, 5
+        lxvd2x     32+11, GPR_OFFSET_P0, 5
+        vmrgew \_p1, 10, 11
+        vmrgow \_c1, 10, 11
+        lxvd2x     32+12, GPR_OFFSET_C1, 5
+        lxvd2x     32+13, GPR_OFFSET_P1, 5
+        vmrgew \_p2, 12, 13
+        vmrgow \_c2, 12, 13
+        lxvd2x     32+10, GPR_OFFSET_C2, 5
+        lxvd2x     32+11, GPR_OFFSET_P2, 5
+        vmrgew \_p3, 10, 11
+        vmrgow \_c3, 10, 11
+        lxvd2x     32+12, GPR_OFFSET_C3, 5
+        lxvd2x     32+13, GPR_OFFSET_P3, 5
+        vmrgew \_p4, 12, 13
+        vmrgow \_c4, 12, 13
+.endm
+
+/*
+ * Load coefficients with 2-2 layout,
+ *  each load contains 4 curr and 4 peer elements
+ *    -> curr1 curr2 peer1 peer2
+ *       curr3 curr3 pee43 peer4
+ *  xxpermidi -> 4 curr elements and 4 peer elements
+ *       curr vector contains 4 curr elements and
+ *       peer vector contains 4 peer elements
+ *
+ * In order to do the coefficients computation, zeta vector will arrange
+ * in the proper order to match the multiplication.
+ */
+.macro Load_xxperm_coeffs _c1, _c2, _c3, _c4, _p1, _p2, _p3, _p4
+        lxvd2x     1, GPR_OFFSET_C0, 5
+        lxvd2x     2, GPR_OFFSET_P0, 5
+        xxpermdi 32+\_p1, 1, 2, 3
+        xxpermdi 32+\_c1, 1, 2, 0
+        lxvd2x     3, GPR_OFFSET_C1, 5
+        lxvd2x     4, GPR_OFFSET_P1, 5
+        xxpermdi 32+\_p2, 3, 4, 3
+        xxpermdi 32+\_c2, 3, 4, 0
+        lxvd2x     1, GPR_OFFSET_C2, 5
+        lxvd2x     2, GPR_OFFSET_P2, 5
+        xxpermdi 32+\_p3, 1, 2, 3
+        xxpermdi 32+\_c3, 1, 2, 0
+        lxvd2x     3, GPR_OFFSET_C3, 5
+        lxvd2x     4, GPR_OFFSET_P3, 5
+        xxpermdi 32+\_p4, 3, 4, 3
+        xxpermdi 32+\_c4, 3, 4, 0
+.endm
+
+/*
+ * Reduces x mod q in constant time
+ * i.e. return x < q ? x : x - q;
+ * @param x Where x is assumed to be in the range 0 <= x < 2*q
+ * @returns the difference in the range 0..q-1
+ */
+.macro reduce_once_1x _vt
+        vsubuwm  16, \_vt, V_Q
+        vcmpgtsw 17, V_Q, \_vt
+        xxsel   32+\_vt, 32+16, 32+\_vt, 32+17
+.endm
+
+/*
+ * Calculate The positive value of (a-b) mod q in constant time.
+ *
+ * a - b mod q gives a value in the range -(q-1)..(q-1)
+ * By adding q we get a range of 1..(2q-1).
+ * Reducing this once then gives the range 0..q-1
+ *
+ * returns The value (q + a - b) mod q
+ */
+.macro mod_sub _x _a _b
+        vadduwm 14, \_a, V_Q
+        vsubuwm \_x, 14, \_b
+        reduce_once_1x \_x
+.endm
+
+/* Delayed writes resulting curr and peer coefficients */
+.macro delayed_writes_curr_peer _c1, _p1, _c2, _p2, _c3, _p3, _c4, _p4
+        stxvd2x    32+\_c1, GPR_OFFSET_C0, 5
+        stxvd2x    32+\_p1, GPR_OFFSET_P0, 5
+        stxvd2x    32+\_c2, GPR_OFFSET_C1, 5
+        stxvd2x    32+\_p2, GPR_OFFSET_P1, 5
+        stxvd2x    32+\_c3, GPR_OFFSET_C2, 5
+        stxvd2x    32+\_p3, GPR_OFFSET_P2, 5
+        stxvd2x    32+\_c4, GPR_OFFSET_C3, 5
+        stxvd2x    32+\_p4, GPR_OFFSET_P3, 5
+.endm
+
+.macro Load_4zetas _vz0, _vz1, _vz2, _vz3
+        lvx     \_vz0, 0, 14
+        addi    14, 14, 16
+        lvx     \_vz1, 0, 14
+        addi    14, 14, 16
+        lvx     \_vz2, 0, 14
+        addi    14, 14, 16
+        lvx     \_vz3, 0, 14
+        addi    14, 14, 16
+.endm
+
+/*
+ * Montgomery multiply:
+ *   a = zeta * peer or a = b * c
+ *   Multiply of 2 numbers in montgomery form, in the range 0...(2^32)*q
+ */
+.macro Mont_scalar_mul_4x  _vz0 _vz1 _vz2 _vz3
+        vmuleuw 10, 6, \_vz0
+        vmulouw 11, 6, \_vz0
+        vmuleuw 12, 7, \_vz1
+        vmulouw 13, 7, \_vz1
+        vmuleuw 14, 8, \_vz2
+        vmulouw 15, 8, \_vz2
+        vmuleuw 16, 9, \_vz3
+        vmulouw 17, 9, \_vz3
+.endm
+
+/*
+ * @brief When multiplying 2 numbers mod q that are in montgomery form, the
+ * product mod q needs to be multiplied by 2^-32 to be in montgomery form.
+ * See FIPS 204, Algorithm 49, MontgomeryReduce()
+ * Note it is slightly different due to the input range being positive
+ *
+ * @param a is the result of a multiply of 2 numbers in montgomery form,
+ *          in the range 0...(2^32)*q
+ * @returns The Montgomery form of 'a' with multiplier 2^32 in the range 0..q-1
+ *          The result is congruent to x * 2^-32 mod q
+ */
+.macro Mont_reduce_4x
+        vmulouw 18, 10, Q_NEG_INV
+        vmulouw 19, 11, Q_NEG_INV
+        vmulouw 20, 12, Q_NEG_INV
+        vmulouw 21, 13, Q_NEG_INV
+        vmulouw 22, 14, Q_NEG_INV
+        vmulouw 23, 15, Q_NEG_INV
+        vmulouw 24, 16, Q_NEG_INV
+        vmulouw 25, 17, Q_NEG_INV
+
+        vmulouw 18, 18, V_Q
+        vmulouw 19, 19, V_Q
+        vmulouw 20, 20, V_Q
+        vmulouw 21, 21, V_Q
+        vmulouw 22, 22, V_Q
+        vmulouw 23, 23, V_Q
+        vmulouw 24, 24, V_Q
+        vmulouw 25, 25, V_Q
+
+        vaddudm 18, 18, 10
+        vaddudm 19, 19, 11
+        vaddudm 20, 20, 12
+        vaddudm 21, 21, 13
+        vaddudm 22, 22, 14
+        vaddudm 23, 23, 15
+        vaddudm 24, 24, 16
+        vaddudm 25, 25, 17
+
+        vmrgew  10, 18, 19
+        vmrgew  11, 20, 21
+        vmrgew  12, 22, 23
+        vmrgew  13, 24, 25
+
+        reduce_once_1x 10
+        reduce_once_1x 11
+        reduce_once_1x 12
+        reduce_once_1x 13
+.endm
+
+/*
+ * -----------------------------------
+ * mont_mul_reduce_4x(_vz0, _vz1, _vz2, _vz3)
+ */
+.macro mont_mul_reduce_4x  _vz0 _vz1 _vz2 _vz3
+        Mont_scalar_mul_4x \_vz0, \_vz1, \_vz2, \_vz3
+        Mont_reduce_4x
+.endm
+/* ===================================================================== */
diff --git a/deps/openssl/openssl/crypto/ml_dsa/build.info b/deps/openssl/openssl/crypto/ml_dsa/build.info
index a0aee56f5a0..3c74aef2f7a 100644
--- a/deps/openssl/openssl/crypto/ml_dsa/build.info
+++ b/deps/openssl/openssl/crypto/ml_dsa/build.info
@@ -4,7 +4,39 @@ $COMMON=ml_dsa_encoders.c ml_dsa_key_compress.c ml_dsa_key.c \
         ml_dsa_matrix.c ml_dsa_ntt.c ml_dsa_params.c ml_dsa_sample.c \
         ml_dsa_sign.c

+$ML_DSA_ASM=
+IF[{- !$disabled{asm} -}]
+  $ML_DSA_ASM_x86_64=ml_dsa_ntt-x86_64.s
+
+  IF[{- $target{sys_id} ne "AIX" && $target{sys_id} ne "MACOSX" -}]
+    $ML_DSA_ASM_ppc64=asm/mldsa_ntt_ppc64le.S asm/mldsa_intt_ppc64le.S
+  ENDIF
+
+  # Now that we have defined all the arch specific variables, use the
+  # appropriate one, and define the appropriate macros
+  IF[$ML_DSA_ASM_{- $target{asm_arch} -}]
+    $ML_DSA_ASM=$ML_DSA_ASM_{- $target{asm_arch} -}
+  ENDIF
+ENDIF
+
 IF[{- !$disabled{'ml-dsa'} -}]
-  SOURCE[../../libcrypto]=$COMMON
-  SOURCE[../../providers/libfips.a]=$COMMON
+  IF[{- ($target{perlasm_scheme} // '') ne '31' -}]
+    $ML_DSA_VX_s390x=ml_dsa_ntt_vec128.c
+    $ML_DSA_DEF_s390x=OPENSSL_ML_DSA_S390X
+  ENDIF
+
+  # Now that we have defined all the arch specific variables, use the
+  # appropriate ones, and define the appropriate macros
+  IF[$ML_DSA_VX_{- $target{asm_arch} -}]
+    $ML_DSA_VX=$ML_DSA_VX_{- $target{asm_arch} -}
+    $ML_DSA_DEF=$ML_DSA_DEF_{- $target{asm_arch} -}
+  ENDIF
 ENDIF
+
+IF[{- !$disabled{'ml-dsa'} -}]
+  SOURCE[../../libcrypto]=$COMMON $ML_DSA_ASM $ML_DSA_VX
+  SOURCE[../../providers/libfips.a]=$COMMON $ML_DSA_ASM $ML_DSA_VX
+ENDIF
+
+# Assembly implementations
+GENERATE[ml_dsa_ntt-x86_64.s]=asm/ml_dsa_ntt-x86_64.pl
diff --git a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_encoders.c b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_encoders.c
index 9ebe5ae02d9..7d04d867c21 100644
--- a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_encoders.c
+++ b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_encoders.c
@@ -713,7 +713,7 @@ int ossl_ml_dsa_sk_encode(ML_DSA_KEY *key)
     size_t enc_len = params->sk_len;
     const POLY *t0 = key->t0.poly;
     WPACKET pkt;
-    uint8_t *enc = OPENSSL_malloc(enc_len);
+    uint8_t *enc = OPENSSL_secure_malloc(enc_len);

     if (enc == NULL)
         return 0;
@@ -741,13 +741,13 @@ int ossl_ml_dsa_sk_encode(ML_DSA_KEY *key)
     if (!WPACKET_get_total_written(&pkt, &written)
         || written != enc_len)
         goto err;
-    OPENSSL_clear_free(key->priv_encoding, enc_len);
+    OPENSSL_secure_clear_free(key->priv_encoding, enc_len);
     key->priv_encoding = enc;
     ret = 1;
 err:
     WPACKET_finish(&pkt);
     if (ret == 0)
-        OPENSSL_clear_free(enc, enc_len);
+        OPENSSL_secure_clear_free(enc, enc_len);
     return ret;
 }

@@ -770,7 +770,7 @@ int ossl_ml_dsa_sk_decode(ML_DSA_KEY *key, const uint8_t *in, size_t in_len)
     PACKET pkt;

     /* When loading from an explicit key, drop the seed. */
-    OPENSSL_clear_free(key->seed, ML_DSA_SEED_BYTES);
+    OPENSSL_secure_clear_free(key->seed, ML_DSA_SEED_BYTES);
     key->seed = NULL;

     /* Allow the key encoding to be already set to the provided pointer */
@@ -805,9 +805,12 @@ int ossl_ml_dsa_sk_decode(ML_DSA_KEY *key, const uint8_t *in, size_t in_len)
             goto err;
     if (PACKET_remaining(&pkt) != 0)
         goto err;
-    if (key->priv_encoding == NULL
-        && (key->priv_encoding = OPENSSL_memdup(in, in_len)) == NULL)
-        goto err;
+    if (key->priv_encoding == NULL) {
+        key->priv_encoding = OPENSSL_secure_malloc(in_len);
+        if (key->priv_encoding == NULL)
+            goto err;
+        memcpy(key->priv_encoding, in, in_len);
+    }
     /*
      * Computing the public key also computes its hash, which must be equal to
      * the |tr| value in the private key, else the key was corrupted.
@@ -836,7 +839,7 @@ err:
  */
 static int hint_bits_encode(const VECTOR *hint, WPACKET *pkt, uint32_t omega)
 {
-    int i, j, k = hint->num_poly;
+    int i, j, k = (int)hint->num_poly;
     size_t coeff_index = 0;
     POLY *p = hint->poly;
     uint8_t *data;
diff --git a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_hash.h b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_hash.h
index 7625d3367d9..db450c7fd5c 100644
--- a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_hash.h
+++ b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_hash.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_HASH_H)
+#define OSSL_LIBCRYPTO_ML_DSA_ML_DSA_HASH_H
+
 #include <openssl/evp.h>

 static ossl_inline ossl_unused int
@@ -39,3 +42,5 @@ shake_xof_3(EVP_MD_CTX *ctx, const EVP_MD *md, const uint8_t *in1, size_t in1_le
         && EVP_DigestUpdate(ctx, in3, in3_len)
         && EVP_DigestSqueeze(ctx, out, out_len);
 }
+
+#endif /* !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_HASH_H) */
diff --git a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_key.c b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_key.c
index 66e2ff2b61a..e1b4f3bb738 100644
--- a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_key.c
+++ b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_key.c
@@ -48,25 +48,45 @@ int ossl_ml_dsa_set_prekey(ML_DSA_KEY *key, int flags_set, int flags_clr,
         || key->seed != NULL)
         return 0;

-    if (sk != NULL
-        && (key->priv_encoding = OPENSSL_memdup(sk, sk_len)) == NULL)
-        goto end;
-    if (seed != NULL
-        && (key->seed = OPENSSL_memdup(seed, seed_len)) == NULL)
-        goto end;
+    if (sk != NULL) {
+        key->priv_encoding = OPENSSL_secure_malloc(sk_len);
+        if (key->priv_encoding == NULL)
+            goto end;
+        memcpy(key->priv_encoding, sk, sk_len);
+    }
+
+    if (seed != NULL) {
+        if ((key->seed = OPENSSL_secure_malloc(seed_len)) == NULL)
+            goto end;
+        memcpy(key->seed, seed, seed_len);
+    }
     key->prov_flags |= flags_set;
     key->prov_flags &= ~flags_clr;
     ret = 1;

 end:
     if (!ret) {
-        OPENSSL_free(key->priv_encoding);
-        OPENSSL_free(key->seed);
+        OPENSSL_secure_clear_free(key->priv_encoding, sk_len);
+        OPENSSL_secure_clear_free(key->seed, seed_len);
         key->priv_encoding = key->seed = NULL;
     }
     return ret;
 }

+/*
+ * @brief Fetch digest algorithms based on a propq.
+ * For the import case ossl_ml_dsa_key_new() gets passed a NULL propq,
+ * so the propq is optionally deferred to the import using OSSL_PARAM.
+ */
+int ossl_ml_dsa_key_fetch_digests(ML_DSA_KEY *key, const char *propq)
+{
+    EVP_MD_free(key->shake128_md);
+    EVP_MD_free(key->shake256_md);
+    key->shake128_md = EVP_MD_fetch(key->libctx, "SHAKE-128", propq);
+    key->shake256_md = EVP_MD_fetch(key->libctx, "SHAKE-256", propq);
+    return (key->shake128_md != NULL && key->shake256_md != NULL);
+}
+
 /**
  * @brief Create a new ML_DSA_KEY object
  *
@@ -89,9 +109,7 @@ ML_DSA_KEY *ossl_ml_dsa_key_new(OSSL_LIB_CTX *libctx, const char *propq,
         ret->libctx = libctx;
         ret->params = params;
         ret->prov_flags = ML_DSA_KEY_PROV_FLAGS_DEFAULT;
-        ret->shake128_md = EVP_MD_fetch(libctx, "SHAKE-128", propq);
-        ret->shake256_md = EVP_MD_fetch(libctx, "SHAKE-256", propq);
-        if (ret->shake128_md == NULL || ret->shake256_md == NULL)
+        if (!ossl_ml_dsa_key_fetch_digests(ret, propq))
             goto err;
     }
     return ret;
@@ -114,7 +132,7 @@ int ossl_ml_dsa_key_priv_alloc(ML_DSA_KEY *key)

     if (key->s1.poly != NULL)
         return 0;
-    if (!vector_alloc(&key->s1, l + 2 * k))
+    if (!vector_secure_alloc(&key->s1, l + 2 * k))
         return 0;

     poly = key->s1.poly;
@@ -148,12 +166,12 @@ void ossl_ml_dsa_key_reset(ML_DSA_KEY *key)
      * must not access after |s1|'s poly is freed.
      */
     if (key->s1.poly != NULL) {
-        vector_zero(&key->s1);
-        vector_zero(&key->s2);
-        vector_zero(&key->t0);
-        vector_free(&key->s1);
-        key->s2.poly = NULL;
-        key->t0.poly = NULL;
+        const ML_DSA_PARAMS *params = key->params;
+        size_t k = params->k, l = params->l;
+
+        vector_secure_free(&key->s1, l + 2 * k);
+        vector_init(&key->s2, NULL, 0);
+        vector_init(&key->t0, NULL, 0);
     }
     /* The |t1| vector is public and allocated separately */
     vector_free(&key->t1);
@@ -161,10 +179,10 @@ void ossl_ml_dsa_key_reset(ML_DSA_KEY *key)
     OPENSSL_free(key->pub_encoding);
     key->pub_encoding = NULL;
     if (key->priv_encoding != NULL)
-        OPENSSL_clear_free(key->priv_encoding, key->params->sk_len);
+        OPENSSL_secure_clear_free(key->priv_encoding, key->params->sk_len);
     key->priv_encoding = NULL;
     if (key->seed != NULL)
-        OPENSSL_clear_free(key->seed, ML_DSA_SEED_BYTES);
+        OPENSSL_secure_clear_free(key->seed, ML_DSA_SEED_BYTES);
     key->seed = NULL;
 }

@@ -218,16 +236,17 @@ ML_DSA_KEY *ossl_ml_dsa_key_dup(const ML_DSA_KEY *src, int selection)
                         vector_copy(&ret->s2, &src->s2);
                         vector_copy(&ret->t0, &src->t0);
                     }
-                    if ((ret->priv_encoding = OPENSSL_memdup(src->priv_encoding,
-                             src->params->sk_len))
-                        == NULL)
+                    ret->priv_encoding = OPENSSL_secure_malloc(src->params->sk_len);
+                    if (ret->priv_encoding == NULL)
                         goto err;
+                    memcpy(ret->priv_encoding, src->priv_encoding, src->params->sk_len);
+                }
+                if (src->seed != NULL) {
+                    ret->seed = OPENSSL_secure_malloc(ML_DSA_SEED_BYTES);
+                    if (ret->seed == NULL)
+                        goto err;
+                    memcpy(ret->seed, src->seed, ML_DSA_SEED_BYTES);
                 }
-                if (src->seed != NULL
-                    && (ret->seed = OPENSSL_memdup(src->seed,
-                            ML_DSA_SEED_BYTES))
-                        == NULL)
-                    goto err;
             }
         }
         EVP_MD_up_ref(src->shake128_md);
@@ -313,17 +332,17 @@ int ossl_ml_dsa_key_has(const ML_DSA_KEY *key, int selection)
  * @returns 1 on success, or 0 on failure.
  */
 static int public_from_private(const ML_DSA_KEY *key, EVP_MD_CTX *md_ctx,
-    VECTOR *t1, VECTOR *t0)
+    const OSSL_ML_DSA_SAMPLE_OPS *sample_ops, VECTOR *t1, VECTOR *t0)
 {
     int ret = 0;
     const ML_DSA_PARAMS *params = key->params;
-    uint32_t k = params->k, l = params->l;
+    uint32_t k = (uint32_t)params->k, l = (uint32_t)params->l;
     POLY *polys;
     MATRIX a_ntt;
     VECTOR s1_ntt;
     VECTOR t;

-    polys = OPENSSL_malloc(sizeof(*polys) * (k + l + k * l));
+    polys = OPENSSL_malloc_array(k + l + k * l, sizeof(*polys));
     if (polys == NULL)
         return 0;

@@ -332,7 +351,7 @@ static int public_from_private(const ML_DSA_KEY *key, EVP_MD_CTX *md_ctx,
     matrix_init(&a_ntt, s1_ntt.poly + l, k, l);

     /* Using rho generate A' = A in NTT form */
-    if (!matrix_expand_A(md_ctx, key->shake128_md, key->rho, &a_ntt))
+    if (!sample_ops->matrix_expand_A(md_ctx, key->shake128_md, key->rho, &a_ntt))
         goto err;

     /* t = NTT_inv(A' * NTT(s1)) + s2 */
@@ -362,6 +381,7 @@ err:
 int ossl_ml_dsa_key_public_from_private(ML_DSA_KEY *key)
 {
     int ret = 0;
+    const OSSL_ML_DSA_SAMPLE_OPS *sample_ops = ossl_ml_dsa_sample_ops();
     VECTOR t0;
     EVP_MD_CTX *md_ctx = NULL;

@@ -369,7 +389,7 @@ int ossl_ml_dsa_key_public_from_private(ML_DSA_KEY *key)
         return 0;
     ret = ((md_ctx = EVP_MD_CTX_new()) != NULL)
         && ossl_ml_dsa_key_pub_alloc(key) /* allocate space for t1 */
-        && public_from_private(key, md_ctx, &key->t1, &t0)
+        && public_from_private(key, md_ctx, sample_ops, &key->t1, &t0)
         && vector_equal(&t0, &key->t0) /* compare the generated t0 to the expected */
         && ossl_ml_dsa_pk_encode(key)
         && shake_xof(md_ctx, key->shake256_md,
@@ -384,15 +404,16 @@ int ossl_ml_dsa_key_public_from_private(ML_DSA_KEY *key)
 int ossl_ml_dsa_key_pairwise_check(const ML_DSA_KEY *key)
 {
     int ret = 0;
+    const OSSL_ML_DSA_SAMPLE_OPS *sample_ops = ossl_ml_dsa_sample_ops();
     VECTOR t1, t0;
     POLY *polys = NULL;
-    uint32_t k = key->params->k;
+    uint32_t k = (uint32_t)key->params->k;
     EVP_MD_CTX *md_ctx = NULL;

     if (key->pub_encoding == NULL || key->priv_encoding == 0)
         return 0;

-    polys = OPENSSL_malloc(sizeof(*polys) * (2 * k));
+    polys = OPENSSL_malloc_array(2 * k, sizeof(*polys));
     if (polys == NULL)
         return 0;
     md_ctx = EVP_MD_CTX_new();
@@ -401,7 +422,7 @@ int ossl_ml_dsa_key_pairwise_check(const ML_DSA_KEY *key)

     vector_init(&t1, polys, k);
     vector_init(&t0, polys + k, k);
-    if (!public_from_private(key, md_ctx, &t1, &t0))
+    if (!public_from_private(key, md_ctx, sample_ops, &t1, &t0))
         goto err;

     ret = vector_equal(&t1, &key->t1) && vector_equal(&t0, &key->t0);
@@ -422,6 +443,7 @@ err:
 static int keygen_internal(ML_DSA_KEY *out)
 {
     int ret = 0;
+    const OSSL_ML_DSA_SAMPLE_OPS *sample_ops = ossl_ml_dsa_sample_ops();
     uint8_t augmented_seed[ML_DSA_SEED_BYTES + 2];
     uint8_t expanded_seed[ML_DSA_RHO_BYTES + ML_DSA_PRIV_SEED_BYTES + ML_DSA_K_BYTES];
     const uint8_t *const rho = expanded_seed; /* p = Public Random Seed */
@@ -448,18 +470,15 @@ static int keygen_internal(ML_DSA_KEY *out)
     memcpy(out->rho, rho, sizeof(out->rho));
     memcpy(out->K, K, sizeof(out->K));

-    ret = vector_expand_S(md_ctx, out->shake256_md, params->eta, priv_seed, &out->s1, &out->s2)
-        && public_from_private(out, md_ctx, &out->t1, &out->t0)
+    ret = sample_ops->vector_expand_S(md_ctx, out->shake256_md, params->eta,
+              priv_seed, &out->s1, &out->s2)
+        && public_from_private(out, md_ctx, sample_ops, &out->t1, &out->t0)
         && ossl_ml_dsa_pk_encode(out)
         && shake_xof(md_ctx, out->shake256_md, out->pub_encoding, out->params->pk_len,
             out->tr, sizeof(out->tr))
         && ossl_ml_dsa_sk_encode(out);

 err:
-    if (out->seed != NULL && (out->prov_flags & ML_DSA_KEY_RETAIN_SEED) == 0) {
-        OPENSSL_clear_free(out->seed, ML_DSA_SEED_BYTES);
-        out->seed = NULL;
-    }
     EVP_MD_CTX_free(md_ctx);
     OPENSSL_cleanse(augmented_seed, sizeof(augmented_seed));
     OPENSSL_cleanse(expanded_seed, sizeof(expanded_seed));
@@ -473,10 +492,10 @@ int ossl_ml_dsa_generate_key(ML_DSA_KEY *out)
     int ret;

     if (out->seed == NULL) {
-        if ((out->seed = OPENSSL_malloc(seed_len)) == NULL)
+        if ((out->seed = OPENSSL_secure_malloc(seed_len)) == NULL)
             return 0;
         if (RAND_priv_bytes_ex(out->libctx, out->seed, seed_len, 0) <= 0) {
-            OPENSSL_free(out->seed);
+            OPENSSL_secure_free(out->seed);
             out->seed = NULL;
             return 0;
         }
@@ -487,6 +506,11 @@ int ossl_ml_dsa_generate_key(ML_DSA_KEY *out)
     if (sk == NULL) {
         ret = keygen_internal(out);
     } else {
+        /*
+         * A constant-time comparison is unnecessary here since this check
+         * is only performed during key generation and is not exposed to
+         * timing attacks.
+         */
         if ((ret = keygen_internal(out)) != 0
             && memcmp(out->priv_encoding, sk, out->params->sk_len) != 0) {
             ret = 0;
@@ -495,7 +519,7 @@ int ossl_ml_dsa_generate_key(ML_DSA_KEY *out)
                 "explicit %s private key does not match seed",
                 out->params->alg);
         }
-        OPENSSL_clear_free(sk, out->params->sk_len);
+        OPENSSL_secure_clear_free(sk, out->params->sk_len);
     }
     return ret;
 }
@@ -532,6 +556,11 @@ size_t ossl_ml_dsa_key_get_collision_strength_bits(const ML_DSA_KEY *key)
     return key->params->bit_strength;
 }

+int ossl_ml_dsa_key_get_security_category(const ML_DSA_KEY *key)
+{
+    return key->params->security_category;
+}
+
 /* Returns the private key data or NULL if there is no private key */
 const uint8_t *ossl_ml_dsa_key_get_priv(const ML_DSA_KEY *key)
 {
diff --git a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_key.h b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_key.h
index e89bb01ca44..4752475a66b 100644
--- a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_key.h
+++ b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_key.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_KEY_H)
+#define OSSL_LIBCRYPTO_ML_DSA_ML_DSA_KEY_H
+
 #include <openssl/e_os2.h>
 #include "ml_dsa_local.h"
 #include "ml_dsa_vector.h"
@@ -54,3 +57,5 @@ struct ml_dsa_key_st {
     VECTOR s1; /* private secret of size L with short coefficients (-4..4) or (-2..2) */
     /* The s1->poly block is allocated and has space for s2 and t0 also */
 };
+
+#endif /* !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_KEY_H) */
diff --git a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_local.h b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_local.h
index 459ab3ff0a9..a47355e7b4c 100644
--- a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_local.h
+++ b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -29,7 +29,6 @@
 #define ML_DSA_PRIV_SEED_BYTES 64 /* p' = Private random seed */
 #define ML_DSA_K_BYTES 32 /* K = Private random seed for signing */
 #define ML_DSA_TR_BYTES 64 /* Size of the Hash of the public key used for signing */
-#define ML_DSA_MU_BYTES 64 /* Size of the Hash for the message representative */
 #define ML_DSA_RHO_PRIME_BYTES 64 /* private random seed size */

 /*
@@ -60,10 +59,21 @@ typedef struct vector_st VECTOR;
 typedef struct matrix_st MATRIX;
 typedef struct ml_dsa_sig_st ML_DSA_SIG;

-int ossl_ml_dsa_matrix_expand_A(EVP_MD_CTX *g_ctx, const EVP_MD *md,
+typedef int(ML_DSA_MATRIX_EXPAND_A_FN)(EVP_MD_CTX *g_ctx, const EVP_MD *md,
     const uint8_t *rho, MATRIX *out);
-int ossl_ml_dsa_vector_expand_S(EVP_MD_CTX *h_ctx, const EVP_MD *md, int eta,
-    const uint8_t *seed, VECTOR *s1, VECTOR *s2);
+typedef int(ML_DSA_VECTOR_EXPAND_S_FN)(EVP_MD_CTX *h_ctx, const EVP_MD *md,
+    int eta, const uint8_t *seed, VECTOR *s1, VECTOR *s2);
+typedef void(ML_DSA_VECTOR_EXPAND_MASK_FN)(VECTOR *out,
+    const uint8_t rho_prime[ML_DSA_RHO_PRIME_BYTES], uint32_t kappa, uint32_t gamma1,
+    EVP_MD_CTX *h_ctx, const EVP_MD *md);
+
+typedef struct ossl_ml_dsa_sample_ops_st {
+    ML_DSA_MATRIX_EXPAND_A_FN *matrix_expand_A;
+    ML_DSA_VECTOR_EXPAND_S_FN *vector_expand_S;
+    ML_DSA_VECTOR_EXPAND_MASK_FN *vector_expand_mask;
+} OSSL_ML_DSA_SAMPLE_OPS;
+
+const OSSL_ML_DSA_SAMPLE_OPS *ossl_ml_dsa_sample_ops(void);
 void ossl_ml_dsa_matrix_mult_vector(const MATRIX *matrix_kl, const VECTOR *vl,
     VECTOR *vk);
 int ossl_ml_dsa_poly_expand_mask(POLY *out, const uint8_t *seed, size_t seed_len,
@@ -77,6 +87,16 @@ void ossl_ml_dsa_poly_ntt(POLY *s);
 void ossl_ml_dsa_poly_ntt_inverse(POLY *s);
 void ossl_ml_dsa_poly_ntt_mult(const POLY *lhs, const POLY *rhs, POLY *out);

+/* Optimization for s390x */
+/* z13 supports VX, z14 supports VXE; z14 means __ARCH__ == 12 */
+#if defined(OPENSSL_ML_DSA_S390X) && defined(__s390x__) && (__ARCH__ >= 12) && defined(__VX__)
+#include "arch/s390x_arch.h"
+#define VX_COMPILER_SUPPORT_VEC128
+void ossl_ml_dsa_poly_ntt_vec128(POLY *p);
+void ossl_ml_dsa_poly_ntt_inverse_vec128(POLY *p);
+void ossl_poly_ntt_mult_scalar_vec128(const POLY *lhs, const POLY *rhs, POLY *out);
+#endif
+
 void ossl_ml_dsa_key_compress_power2_round(uint32_t r, uint32_t *r1, uint32_t *r0);
 uint32_t ossl_ml_dsa_key_compress_high_bits(uint32_t r, uint32_t gamma2);
 void ossl_ml_dsa_key_compress_decompose(uint32_t r, uint32_t gamma2,
@@ -102,20 +122,26 @@ int ossl_ml_dsa_poly_decode_expand_mask(POLY *out,
     const uint8_t *in, size_t in_len,
     uint32_t gamma1);

-/*
- * @brief Reduces x mod q in constant time
+/*-
+ * @brief Reduces 0 <= x < 2*q, mod q.
  * i.e. return x < q ? x : x - q;
  *
- * @param x Where x is assumed to be in the range 0 <= x < 2*q
+ * Subtract |q| if the input is larger, without exposing a side-channel,
+ * avoiding the "clangover" attack.  See |constish_time_true| for a discussion
+ * on why the value barrier is by default omitted.
+ *
  * @returns the difference in the range 0..q-1
  */
-static ossl_inline ossl_unused uint32_t reduce_once(uint32_t x)
+static ossl_inline ossl_unused __owur uint32_t reduce_once(uint32_t x)
 {
-    return constant_time_select_32(constant_time_lt_32(x, ML_DSA_Q), x, x - ML_DSA_Q);
+    const uint32_t subtracted = x - ML_DSA_Q;
+    uint32_t mask = constish_time_true(subtracted >> 31);
+
+    return (mask & x) | (~mask & subtracted);
 }

 /*
- * @brief Calculate The positive value of (a-b) mod q in constant time.
+ * @brief Calculates the positive value of (a-b) mod q in constant time.
  *
  * a - b mod q gives a value in the range -(q-1)..(q-1)
  * By adding q we get a range of 1..(2q-1).
@@ -132,21 +158,25 @@ static ossl_inline ossl_unused uint32_t mod_sub(uint32_t a, uint32_t b)

 /*
  * @brief Returns the absolute value in constant time.
- * i.e. return is_positive(x) ? x : -x;
+ * i.e.  return is_negative(x) ? -x : x;
  */
 static ossl_inline ossl_unused uint32_t abs_signed(uint32_t x)
 {
-    return constant_time_select_32(constant_time_lt_32(x, 0x80000000), x, 0u - x);
+    uint32_t mask = 0u - (x >> 31);
+
+    return constant_time_select_32(mask, 0u - x, x);
 }

 /*
  * @brief Returns the absolute value modulo q in constant time
- * i.e return x > (q - 1) / 2 ? q - x : x;
+ * i.e return x <= (q-1)/2 ? x : q - x;
  */
 static ossl_inline ossl_unused uint32_t abs_mod_prime(uint32_t x)
 {
-    return constant_time_select_32(constant_time_lt_32(ML_DSA_Q_MINUS1_DIV2, x),
-        ML_DSA_Q - x, x);
+    uint32_t mask = x - ML_DSA_Q_MINUS1_DIV2;
+
+    mask = 0u - (mask >> 31);
+    return constant_time_select_32(mask, x, ML_DSA_Q - x);
 }

 /*
@@ -155,7 +185,9 @@ static ossl_inline ossl_unused uint32_t abs_mod_prime(uint32_t x)
  */
 static ossl_inline ossl_unused uint32_t maximum(uint32_t x, uint32_t y)
 {
-    return constant_time_select_int(constant_time_lt(x, y), y, x);
+    uint32_t mask = x - y;
+    mask = 0u - (mask >> 31);
+    return constant_time_select_int(mask, y, x);
 }

 #endif /* OSSL_CRYPTO_ML_DSA_LOCAL_H */
diff --git a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_matrix.h b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_matrix.h
index 0352ecac7af..2318ce4de47 100644
--- a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_matrix.h
+++ b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_matrix.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -8,6 +8,11 @@
  */

 /* A 'k' by 'l' Matrix object ('k' rows and 'l' columns) containing polynomial scalars */
+#if !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_MATRIX_H)
+#define OSSL_LIBCRYPTO_ML_DSA_ML_DSA_MATRIX_H
+
+#include "ml_dsa_local.h"
+
 struct matrix_st {
     POLY *m_poly;
     size_t k, l;
@@ -36,9 +41,4 @@ matrix_mult_vector(const MATRIX *a, const VECTOR *s, VECTOR *t)
     ossl_ml_dsa_matrix_mult_vector(a, s, t);
 }

-static ossl_inline ossl_unused int
-matrix_expand_A(EVP_MD_CTX *g_ctx, const EVP_MD *md, const uint8_t *rho,
-    MATRIX *out)
-{
-    return ossl_ml_dsa_matrix_expand_A(g_ctx, md, rho, out);
-}
+#endif /* !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_MATRIX_H) */
diff --git a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_ntt.c b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_ntt.c
index 2cce4622923..17a63802f39 100644
--- a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_ntt.c
+++ b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_ntt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -9,6 +9,39 @@

 #include "ml_dsa_local.h"
 #include "ml_dsa_poly.h"
+#include <openssl/crypto.h>
+
+/* Assembly function declarations for AVX2 implementations */
+#if !defined(OPENSSL_NO_ASM) && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
+#define ML_DSA_NTT_ASM
+int ml_dsa_ntt_avx2_capable(void);
+void ml_dsa_poly_ntt_avx2(uint32_t *p_coeff, const uint32_t *p_zetas);
+void ml_dsa_poly_ntt_inverse_avx2(uint32_t *p_coeff);
+void ml_dsa_poly_ntt_mult_avx2(const uint32_t *a, const uint32_t *b, uint32_t *out);
+#endif
+
+/*
+ * Function pointer types for NTT operations.
+ * These allow selecting AVX2 or scalar implementations at initialization time.
+ */
+typedef void (*ml_dsa_poly_ntt_fn)(POLY *p);
+typedef void (*ml_dsa_poly_ntt_inverse_fn)(POLY *p);
+typedef void (*ml_dsa_poly_ntt_mult_fn)(const POLY *lhs, const POLY *rhs,
+    POLY *out);
+
+/* Forward declarations of scalar NTT functions */
+static void poly_ntt_scalar(POLY *p);
+static void poly_ntt_inverse_scalar(POLY *p);
+static void poly_ntt_mult_scalar(const POLY *lhs, const POLY *rhs, POLY *out);
+
+/*
+ * NTT function pointers - initialized to scalar implementations by default.
+ */
+static ml_dsa_poly_ntt_fn poly_ntt_impl = poly_ntt_scalar;
+static ml_dsa_poly_ntt_inverse_fn poly_ntt_inverse_impl = poly_ntt_inverse_scalar;
+static ml_dsa_poly_ntt_mult_fn poly_ntt_mult_impl = poly_ntt_mult_scalar;
+
+static CRYPTO_ONCE ml_dsa_ntt_once = CRYPTO_ONCE_STATIC_INIT;

 /*
  * This file has multiple parts required for fast matrix multiplication,
@@ -100,32 +133,19 @@ static uint32_t reduce_montgomery(uint64_t a)
 }

 /*
- * @brief Multiply two polynomials in the number theoretically transformed state.
- * See FIPS 204, Algorithm 45, MultiplyNTT()
- * This function has been modified to use montgomery multiplication
- *
- * @param lhs A polynomial multiplicand
- * @param rhs A polynomial multiplier
- * @param out The returned result of the polynomial multiply
+ * Scalar (fallback) implementations of NTT operations.
+ * These are used when AVX2 is not available.
  */
-void ossl_ml_dsa_poly_ntt_mult(const POLY *lhs, const POLY *rhs, POLY *out)
+static void poly_ntt_mult_scalar(const POLY *lhs, const POLY *rhs, POLY *out)
 {
     int i;

     for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++)
-        out->coeff[i] = reduce_montgomery((uint64_t)lhs->coeff[i] * (uint64_t)rhs->coeff[i]);
+        out->coeff[i] = reduce_montgomery((uint64_t)lhs->coeff[i]
+            * (uint64_t)rhs->coeff[i]);
 }

-/*
- * In place number theoretic transform of a given polynomial.
- *
- * See FIPS 204, Algorithm 41, NTT()
- * This function uses montgomery multiplication.
- *
- * @param p a polynomial that is used as the input, that is replaced with
- *        the NTT of the polynomial
- */
-void ossl_ml_dsa_poly_ntt(POLY *p)
+static void poly_ntt_scalar(POLY *p)
 {
     int i, j, k;
     int step;
@@ -151,14 +171,7 @@ void ossl_ml_dsa_poly_ntt(POLY *p)
     }
 }

-/*
- * @brief In place inverse number theoretic transform of a given polynomial.
- * See FIPS 204, Algorithm 42,  NTT^-1()
- *
- * @param p a polynomial that is used as the input, that is overwritten with
- *          the inverse of the NTT.
- */
-void ossl_ml_dsa_poly_ntt_inverse(POLY *p)
+static void poly_ntt_inverse_scalar(POLY *p)
 {
     /*
      * Step: 128, 64, 32, 16, ..., 1
@@ -189,5 +202,129 @@ void ossl_ml_dsa_poly_ntt_inverse(POLY *p)
         }
     }
     for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS; i++)
-        p->coeff[i] = reduce_montgomery((uint64_t)p->coeff[i] * (uint64_t)inverse_degree_montgomery);
+        p->coeff[i] = reduce_montgomery((uint64_t)p->coeff[i]
+            * (uint64_t)inverse_degree_montgomery);
+}
+
+/*
+ * AVX2 wrapper functions
+ */
+#ifdef ML_DSA_NTT_ASM
+static void poly_ntt_mult_avx2_wrapper(const POLY *lhs, const POLY *rhs,
+    POLY *out)
+{
+    ml_dsa_poly_ntt_mult_avx2(&lhs->coeff[0], &rhs->coeff[0], &out->coeff[0]);
+}
+
+static void poly_ntt_avx2_wrapper(POLY *p)
+{
+    ml_dsa_poly_ntt_avx2(&p->coeff[0], zetas_montgomery);
+}
+
+static void poly_ntt_inverse_avx2_wrapper(POLY *p)
+{
+    ml_dsa_poly_ntt_inverse_avx2(&p->coeff[0]);
+}
+#endif
+
+/*
+ * PPC64le wrapper functions.
+ */
+#if !defined(OPENSSL_NO_ASM) && defined(_ARCH_PPC64) && (defined(__LITTLE_ENDIAN__) || (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
+#define MLDSA_NTT_PPC_ASM
+#include "arch/ppc_arch.h"
+#endif
+
+#if defined(MLDSA_NTT_PPC_ASM)
+extern void mldsa_poly_ntt_mult_ppc(POLY *out, const POLY *lhs, const POLY *rhs);
+static void poly_ntt_mult_ppc64le_wrapper(const POLY *lhs, const POLY *rhs, POLY *out)
+{
+    mldsa_poly_ntt_mult_ppc(out, lhs, rhs);
+}
+
+extern void mldsa_poly_ntt_ppc(uint32_t *p);
+static void poly_ntt_ppc64le_wrapper(POLY *p)
+{
+    mldsa_poly_ntt_ppc(p->coeff);
+}
+
+extern void mldsa_poly_ntt_inverse_ppc(uint32_t *p);
+static void poly_ntt_inverse_ppc64le_wrapper(POLY *p)
+{
+    mldsa_poly_ntt_inverse_ppc(p->coeff);
+}
+#endif
+
+/*
+ * Initialize NTT function pointers to AVX2 implementations if available.
+ * Scalar implementations are used by default.
+ */
+static void ml_dsa_ntt_init(void)
+{
+#ifdef ML_DSA_NTT_ASM
+    if (ml_dsa_ntt_avx2_capable()) {
+        poly_ntt_impl = poly_ntt_avx2_wrapper;
+        poly_ntt_inverse_impl = poly_ntt_inverse_avx2_wrapper;
+        poly_ntt_mult_impl = poly_ntt_mult_avx2_wrapper;
+    }
+#endif
+
+#if defined(MLDSA_NTT_PPC_ASM)
+    if (OPENSSL_ppccap_P & PPC_CRYPTO207) {
+        poly_ntt_impl = poly_ntt_ppc64le_wrapper;
+        poly_ntt_inverse_impl = poly_ntt_inverse_ppc64le_wrapper;
+        poly_ntt_mult_impl = poly_ntt_mult_ppc64le_wrapper;
+    }
+#endif
+
+#ifdef VX_COMPILER_SUPPORT_VEC128
+    if (S390X_VX_CAPABLE) {
+        poly_ntt_impl = ossl_ml_dsa_poly_ntt_vec128;
+        poly_ntt_inverse_impl = ossl_ml_dsa_poly_ntt_inverse_vec128;
+        poly_ntt_mult_impl = ossl_poly_ntt_mult_scalar_vec128;
+    }
+#endif
+}
+
+/*
+ * @brief Multiply two polynomials in the number theoretically transformed state.
+ * See FIPS 204, Algorithm 45, MultiplyNTT()
+ * This function has been modified to use montgomery multiplication
+ *
+ * @param lhs A polynomial multiplicand
+ * @param rhs A polynomial multiplier
+ * @param out The returned result of the polynomial multiply
+ */
+void ossl_ml_dsa_poly_ntt_mult(const POLY *lhs, const POLY *rhs, POLY *out)
+{
+    (void)CRYPTO_THREAD_run_once(&ml_dsa_ntt_once, ml_dsa_ntt_init);
+    poly_ntt_mult_impl(lhs, rhs, out);
+}
+
+/*
+ * In place number theoretic transform of a given polynomial.
+ *
+ * See FIPS 204, Algorithm 41, NTT()
+ * This function uses montgomery multiplication.
+ *
+ * @param p a polynomial that is used as the input, that is replaced with
+ *        the NTT of the polynomial
+ */
+void ossl_ml_dsa_poly_ntt(POLY *p)
+{
+    (void)CRYPTO_THREAD_run_once(&ml_dsa_ntt_once, ml_dsa_ntt_init);
+    poly_ntt_impl(p);
+}
+
+/*
+ * @brief In place inverse number theoretic transform of a given polynomial.
+ * See FIPS 204, Algorithm 42,  NTT^-1()
+ *
+ * @param p a polynomial that is used as the input, that is overwritten with
+ *          the inverse of the NTT.
+ */
+void ossl_ml_dsa_poly_ntt_inverse(POLY *p)
+{
+    (void)CRYPTO_THREAD_run_once(&ml_dsa_ntt_once, ml_dsa_ntt_init);
+    poly_ntt_inverse_impl(p);
 }
diff --git a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_ntt_vec128.c b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_ntt_vec128.c
new file mode 100644
index 00000000000..54d59a9a087
--- /dev/null
+++ b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_ntt_vec128.c
@@ -0,0 +1,708 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "ml_dsa_local.h"
+#include "ml_dsa_poly.h"
+
+#if defined(OPENSSL_ML_DSA_S390X) && defined(__s390x__) && (__ARCH__ >= 12) && defined(__VX__)
+
+#include <vecintrin.h>
+
+#include <stdint.h>
+
+/* Width of vector registers in bytes */
+#define VECTOR_REG_WIDTH_BYTES 16
+/*
+ * __may_alias__ solves the undefined behavior problem in code like
+ * vec_int32_t *out_vec_ptr = (vec_int32_t *)out->coeff;
+ */
+typedef int32_t vec_int32_t __attribute__((vector_size(VECTOR_REG_WIDTH_BYTES), __may_alias__));
+typedef uint32_t vec_uint32_t __attribute__((vector_size(VECTOR_REG_WIDTH_BYTES), __may_alias__));
+
+typedef int32_t vec_int32_alias_t __attribute__((vector_size(VECTOR_REG_WIDTH_BYTES)));
+typedef uint32_t vec_uint32_alias_t __attribute__((vector_size(VECTOR_REG_WIDTH_BYTES)));
+
+/* Our implementation of the vectorized algorithms assumes NUM_INT32_IN_VECTOR == 4. */
+#define NUM_INT32_IN_VECTOR (VECTOR_REG_WIDTH_BYTES / ((int)sizeof(int32_t)))
+
+/*
+ * This file has multiple parts required for fast matrix multiplication,
+ * 1) NTT (See https://eprint.iacr.org/2024/585.pdf)
+ * NTT and NTT inverse transformations are Discrete Fourier Transforms in a
+ * polynomial ring. Fast-Fourier Transformations can then be applied to make
+ * multiplications n log(n). This uses the symmetry of the transformation to
+ * reduce computations.
+ *
+ * 2) Montgomery multiplication
+ * The multiplication of a.b mod q requires division by q which is a slow operation.
+ *
+ * When many multiplications mod q are required montgomery multiplication
+ * can be used. This requires a number R > q such that R & q are coprime
+ * (i.e. GCD(R, q) = 1), so that division happens using R instead of q.
+ * If r is a power of 2 then this division can be done as a bit shift.
+ *
+ * Given that q = 2^23 - 2^13 + 1
+ * We can chose a Montgomery multiplier of R = 2^32.
+ *
+ * To transform |a| into Montgomery form |m| we use
+ *   m = a mod q * ((2^32)*(2^32) mod q)
+ * which is then Montgomery reduced, removing the excess factor of R = 2^32.
+ *
+ * A good reference for optimizations around ML-DSA and Montgomery multiplication is
+ * [Seiler 2018, Faster AVX2 optimized NTT multiplication for Ring-LWE lattice cryptography].
+ */
+
+/*
+ * The table in FIPS 204 Appendix B uses the following formula
+ * zeta[k]= 1753^bitrev(k) mod q for (k = 1..255) (The first value is not used).
+ *
+ * As this implementation uses montgomery form with a multiplier of 2^32.
+ * The values need to be transformed i.e.
+ *
+ * zetasMontgomery[k] = reduce_montgomery(zeta[k] * (2^32 * 2^32 mod(q)))
+ * reduce_montgomery() is defined below.
+ */
+static const int32_t zetas_montgomery[256] = {
+    4193792, 25847, 5771523, 7861508, 237124, 7602457, 7504169, 466468,
+    1826347, 2353451, 8021166, 6288512, 3119733, 5495562, 3111497, 2680103,
+    2725464, 1024112, 7300517, 3585928, 7830929, 7260833, 2619752, 6271868,
+    6262231, 4520680, 6980856, 5102745, 1757237, 8360995, 4010497, 280005,
+    2706023, 95776, 3077325, 3530437, 6718724, 4788269, 5842901, 3915439,
+    4519302, 5336701, 3574422, 5512770, 3539968, 8079950, 2348700, 7841118,
+    6681150, 6736599, 3505694, 4558682, 3507263, 6239768, 6779997, 3699596,
+    811944, 531354, 954230, 3881043, 3900724, 5823537, 2071892, 5582638,
+    4450022, 6851714, 4702672, 5339162, 6927966, 3475950, 2176455, 6795196,
+    7122806, 1939314, 4296819, 7380215, 5190273, 5223087, 4747489, 126922,
+    3412210, 7396998, 2147896, 2715295, 5412772, 4686924, 7969390, 5903370,
+    7709315, 7151892, 8357436, 7072248, 7998430, 1349076, 1852771, 6949987,
+    5037034, 264944, 508951, 3097992, 44288, 7280319, 904516, 3958618,
+    4656075, 8371839, 1653064, 5130689, 2389356, 8169440, 759969, 7063561,
+    189548, 4827145, 3159746, 6529015, 5971092, 8202977, 1315589, 1341330,
+    1285669, 6795489, 7567685, 6940675, 5361315, 4499357, 4751448, 3839961,
+    2091667, 3407706, 2316500, 3817976, 5037939, 2244091, 5933984, 4817955,
+    266997, 2434439, 7144689, 3513181, 4860065, 4621053, 7183191, 5187039,
+    900702, 1859098, 909542, 819034, 495491, 6767243, 8337157, 7857917,
+    7725090, 5257975, 2031748, 3207046, 4823422, 7855319, 7611795, 4784579,
+    342297, 286988, 5942594, 4108315, 3437287, 5038140, 1735879, 203044,
+    2842341, 2691481, 5790267, 1265009, 4055324, 1247620, 2486353, 1595974,
+    4613401, 1250494, 2635921, 4832145, 5386378, 1869119, 1903435, 7329447,
+    7047359, 1237275, 5062207, 6950192, 7929317, 1312455, 3306115, 6417775,
+    7100756, 1917081, 5834105, 7005614, 1500165, 777191, 2235880, 3406031,
+    7838005, 5548557, 6709241, 6533464, 5796124, 4656147, 594136, 4603424,
+    6366809, 2432395, 2454455, 8215696, 1957272, 3369112, 185531, 7173032,
+    5196991, 162844, 1616392, 3014001, 810149, 1652634, 4686184, 6581310,
+    5341501, 3523897, 3866901, 269760, 2213111, 7404533, 1717735, 472078,
+    7953734, 1723600, 6577327, 1910376, 6712985, 7276084, 8119771, 4546524,
+    5441381, 6144432, 7959518, 6094090, 183443, 7403526, 1612842, 4834730,
+    7826001, 3919660, 8332111, 7018208, 3937738, 1400424, 7534263, 1976782
+};
+
+/* clang-format off */
+static const int32_t zetas_montgomery_twisted[256] = {
+        -512,   1830765815,  -1929875197,  -1927777020,
+  1640767044,   1477910809,   1612161321,   1640734244,
+   308362795,  -1815525077,  -1374673746,  -1091570560,
+ -1929495947,    515185418,   -285697463,    625853735,
+  1727305304,   2082316400,  -1364982363,    858240904,
+  1806278033,    222489249,   -346752664,    684667772,
+  1654287831,   -878576920,  -1257667336,   -748618599,
+   329347125,   1837364259,  -1443016191,  -1170414139,
+ -1846138265,  -1631226336,  -1404529459,   1838055109,
+  1594295556,  -1076973523,  -1898723371,   -594436433,
+  -202001018,   -475984259,   -561427818,   1797021250,
+ -1061813248,   2059733582,  -1661512036,  -1104976546,
+ -1750224322,   -901666089,    418987550,   1831915354,
+ -1925356481,    992097816,    879957085,   2024403852,
+  1484874664,  -1636082790,   -285388938,  -1983539117,
+ -1495136972,   -950076367,  -1714807468,   -952438994,
+ -1574918426,   -654783358,   1350681040,  -1974159334,
+ -2143979938,   1651689966,   1599739335,    140455868,
+ -1285853322,  -1039411342,   -993005453,   1955560695,
+ -1440787839,   1529189039,    568627425,  -2131021878,
+  -783134478,   -247357818,   -588790216,   1518161567,
+   289871780,    -86965172,  -1262003602,   1708872714,
+  2135294595,   1787797780,  -1018755524,   1638590968,
+  -889861154,   -120646188,   1665705315,  -1669960605,
+  1321868266,   -916321552,   1225434135,   1155548552,
+ -1784632064,   2143745727,    666258756,   1210558298,
+   675310539,  -1261461889,  -1555941048,   -318346815,
+ -1999506068,    628664288,  -1499481951,  -1729304567,
+  -695180180,   1422575625,  -1375177022,   1424130039,
+  1777179796,  -1185330463,    334803717,    235321234,
+  -178766299,    168022241,   -518252219,   1206536195,
+  1957047971,    985155485,   1146323032,   -894060583,
+     -898413,    991903578,   1363007700,    746144248,
+ -1363460237,    912367099,     30313376,  -1420958685,
+  -605900043,    -44694137,   -326425359,   2032221021,
+  2027833505,   1176904445,   1683520343,   1904936415,
+    14253662,   -421552614,   -517299994,   1257750362,
+  1014493059,   -818371957,   2027935493,   1926727421,
+   863641634,   1747917559,  -1372618620,   1931587462,
+  1819892094,   -325927721,    128353683,   1258381763,
+  2124962073,    908452108,  -1123881662,    885133339,
+ -1223601433,   1851023420,    137583815,   1629985060,
+ -1920467227,  -1176751719,   -635454917,   1967222129,
+ -1637785316,  -1354528380,   -642772911,      6363718,
+ -1536588519,    -72690498,     45766801,  -1287922799,
+   694382730,   -314284737,    671509323,   1136965287,
+   235104447,    985022747,  -2070602177,   1779436848,
+ -1045062171,    963438279,    419615363,   1116720495,
+   831969620,  -1078959975,   1216882041,   1042326958,
+  -300448763,    604552167,   -270590488,   1405999311,
+   756955445,  -1021949427,  -1276805127,    713994584,
+  -260312804,    608791571,    371462360,    940195360,
+  1554794073,    173440395,  -1357098057,  -1542497136,
+  1339088280,  -2126092136,   -384158533,   2061661096,
+ -2040058689,  -1316619236,    827959816,   -883155599,
+  -853476187,  -1039370342,   -596344472,   1726753854,
+ -2047270595,      6087993,    702390549,  -1547952704,
+ -1723816713,   -110126091,   -279505433,    394851342,
+ -1591599802,    565464272,   -260424529,    283780712,
+  -440824167,  -1758099916,    -71875109,    776003548,
+  1119856485,  -1600929360,  -1208667170,   1123958026,
+  1544891539,    879867910,  -1499603926,    201262506,
+   155290193,  -1809756372,   2036925263,   1934038752,
+  -973777462,    400711272,   -540420425,    374860238
+};
+
+static const int32_t neg_zetas_montgomery[256] = {
+     4186625,      8354570,      2608894,       518909,
+     8143293,       777960,       876248,      7913949,
+     6554070,      6026966,       359251,      2091905,
+     5260684,      2884855,      5268920,      5700314,
+     5654953,      7356305,      1079900,      4794489,
+      549488,      1119584,      5760665,      2108549,
+     2118186,      3859737,      1399561,      3277672,
+     6623180,        19422,      4369920,      8100412,
+     5674394,      8284641,      5303092,      4849980,
+     1661693,      3592148,      2537516,      4464978,
+     3861115,      3043716,      4805995,      2867647,
+     4840449,       300467,      6031717,       539299,
+     1699267,      1643818,      4874723,      3821735,
+     4873154,      2140649,      1600420,      4680821,
+     7568473,      7849063,      7426187,      4499374,
+     4479693,      2556880,      6308525,      2797779,
+     3930395,      1528703,      3677745,      3041255,
+     1452451,      4904467,      6203962,      1585221,
+     1257611,      6441103,      4083598,      1000202,
+     3190144,      3157330,      3632928,      8253495,
+     4968207,       983419,      6232521,      5665122,
+     2967645,      3693493,       411027,      2477047,
+      671102,      1228525,        22981,      1308169,
+      381987,      7031341,      6527646,      1430430,
+     3343383,      8115473,      7871466,      5282425,
+     8336129,      1100098,      7475901,      4421799,
+     3724342,         8578,      6727353,      3249728,
+     5991061,       210977,      7620448,      1316856,
+     8190869,      3553272,      5220671,      1851402,
+     2409325,       177440,      7064828,      7039087,
+     7094748,      1584928,       812732,      1439742,
+     3019102,      3881060,      3628969,      4540456,
+     6288750,      4972711,      6063917,      4562441,
+     3342478,      6136326,      2446433,      3562462,
+     8113420,      5945978,      1235728,      4867236,
+     3520352,      3759364,      1197226,      3193378,
+     7479715,      6521319,      7470875,      7561383,
+     7884926,      1613174,        43260,       522500,
+      655327,      3122442,      6348669,      5173371,
+     3556995,       525098,       768622,      3595838,
+     8038120,      8093429,      2437823,      4272102,
+     4943130,      3342277,      6644538,      8177373,
+     5538076,      5688936,      2590150,      7115408,
+     4325093,      7132797,      5894064,      6784443,
+     3767016,      7129923,      5744496,      3548272,
+     2994039,      6511298,      6476982,      1050970,
+     1333058,      7143142,      3318210,      1430225,
+      451100,      7067962,      5074302,      1962642,
+     1279661,      6463336,      2546312,      1374803,
+     6880252,      7603226,      6144537,      4974386,
+      542412,      2831860,      1671176,      1846953,
+     2584293,      3724270,      7786281,      3776993,
+     2013608,      5948022,      5925962,       164721,
+     6423145,      5011305,      8194886,      1207385,
+     3183426,      8217573,      6764025,      5366416,
+     7570268,      6727783,      3694233,      1799107,
+     3038916,      4856520,      4513516,      8110657,
+     6167306,       975884,      6662682,      7908339,
+      426683,      6656817,      1803090,      6470041,
+     1667432,      1104333,       260646,      3833893,
+     2939036,      2235985,       420899,      2286327,
+     8196974,       976891,      6767575,      3545687,
+      554416,      4460757,        48306,      1362209,
+     4442679,      6979993,       846154,      6403635
+};
+
+static const int32_t neg_zetas_montgomery_twisted[256] = {
+         513,  -1830765814,   1929875198,   1927777021,
+ -1640767043,  -1477910808,  -1612161320,  -1640734243,
+  -308362794,   1815525078,   1374673747,   1091570561,
+  1929495948,   -515185417,    285697464,   -625853734,
+ -1727305303,  -2082316399,   1364982364,   -858240903,
+ -1806278032,   -222489248,    346752665,   -684667771,
+ -1654287830,    878576921,   1257667337,    748618600,
+  -329347124,  -1837364258,   1443016192,   1170414140,
+  1846138266,   1631226337,   1404529460,  -1838055108,
+ -1594295555,   1076973524,   1898723372,    594436434,
+   202001019,    475984260,    561427819,  -1797021249,
+  1061813249,  -2059733581,   1661512037,   1104976547,
+  1750224323,    901666090,   -418987549,  -1831915353,
+  1925356482,   -992097815,   -879957084,  -2024403851,
+ -1484874663,   1636082791,    285388939,   1983539118,
+  1495136973,    950076368,   1714807469,    952438995,
+  1574918427,    654783359,  -1350681039,   1974159335,
+  2143979939,  -1651689965,  -1599739334,   -140455867,
+  1285853323,   1039411343,    993005454,  -1955560694,
+  1440787840,  -1529189038,   -568627424,   2131021879,
+   783134479,    247357819,    588790217,  -1518161566,
+  -289871779,     86965173,   1262003603,  -1708872713,
+ -2135294594,  -1787797779,   1018755525,  -1638590967,
+   889861155,    120646189,  -1665705314,   1669960606,
+ -1321868265,    916321553,  -1225434134,  -1155548551,
+  1784632065,  -2143745726,   -666258755,  -1210558297,
+  -675310538,   1261461890,   1555941049,    318346816,
+  1999506069,   -628664287,   1499481952,   1729304568,
+   695180181,  -1422575624,   1375177023,  -1424130038,
+ -1777179795,   1185330464,   -334803716,   -235321233,
+   178766300,   -168022240,    518252220,  -1206536194,
+ -1957047970,   -985155484,  -1146323031,    894060584,
+      898414,   -991903577,  -1363007699,   -746144247,
+  1363460238,   -912367098,    -30313375,   1420958686,
+   605900044,     44694138,    326425360,  -2032221020,
+ -2027833504,  -1176904444,  -1683520342,  -1904936414,
+   -14253661,    421552615,    517299995,  -1257750361,
+ -1014493058,    818371958,  -2027935492,  -1926727420,
+  -863641633,  -1747917558,   1372618621,  -1931587461,
+ -1819892093,    325927722,   -128353682,  -1258381762,
+ -2124962072,   -908452107,   1123881663,   -885133338,
+  1223601434,  -1851023419,   -137583814,  -1629985059,
+  1920467228,   1176751720,    635454918,  -1967222128,
+  1637785317,   1354528381,    642772912,     -6363717,
+  1536588520,     72690499,    -45766800,   1287922800,
+  -694382729,    314284738,   -671509322,  -1136965286,
+  -235104446,   -985022746,   2070602178,  -1779436847,
+  1045062172,   -963438278,   -419615362,  -1116720494,
+  -831969619,   1078959976,  -1216882040,  -1042326957,
+   300448764,   -604552166,    270590489,  -1405999310,
+  -756955444,   1021949428,   1276805128,   -713994583,
+   260312805,   -608791570,   -371462359,   -940195359,
+ -1554794072,   -173440394,   1357098058,   1542497137,
+ -1339088279,   2126092137,    384158534,  -2061661095,
+  2040058690,   1316619237,   -827959815,    883155600,
+   853476188,   1039370343,    596344473,  -1726753853,
+  2047270596,     -6087992,   -702390548,   1547952705,
+  1723816714,    110126092,    279505434,   -394851341,
+  1591599803,   -565464271,    260424530,   -283780711,
+   440824168,   1758099917,     71875110,   -776003547,
+ -1119856484,   1600929361,   1208667171,  -1123958025,
+ -1544891538,   -879867909,   1499603927,   -201262505,
+  -155290192,   1809756373,  -2036925262,  -1934038751,
+   973777463,   -400711271,    540420426,   -374860237
+};
+/* clang-format on */
+
+static const vec_int32_t vec_q = { ML_DSA_Q, ML_DSA_Q, ML_DSA_Q, ML_DSA_Q };
+static const vec_int32_t vec_q_inv = { ML_DSA_Q_INV, ML_DSA_Q_INV, ML_DSA_Q_INV, ML_DSA_Q_INV };
+
+/*
+ * @brief Reduce a in (-q, q) to a mod q in [0, q).
+ *
+ * @param a in (-q, q)
+ * @returns a mod q in [0, q)
+ */
+static ossl_inline
+    vec_int32_t
+    reduce_once_signed(vec_int32_t a)
+{
+    /* mask is 11..11 when a is negative, else 0 */
+    vec_uint32_t mask = -(((vec_uint32_t)a) >> 31);
+    return a + (vec_int32_t)(mask & (vec_uint32_t)vec_q);
+}
+
+/*
+ * @brief Reduce a in (-2q, q) to a mod q in [0, q).
+ *
+ * @param a in (-2q, q)
+ * @returns a mod q in [0, q)
+ */
+static ossl_inline
+    vec_int32_t
+    reduce_twice_signed(vec_int32_t a)
+{
+    /* mask is 11..11 when a is negative, else 0 */
+    vec_uint32_t mask = -(((vec_uint32_t)a) >> 31);
+    /* b is in (-q, q) */
+    vec_int32_t b = a + (vec_int32_t)(mask & (vec_uint32_t)vec_q);
+    return reduce_once_signed(b);
+}
+
+/*
+ * @brief Computes the Montgomery product of a and b.
+ *        See [Seiler 2018, Algorithm 3].
+ *
+ * @param a is the first factor, assumed to be in [0, q).
+ * @param a_twist is (int32)((uint32)a * ML_DSA_Q_INV).
+ * @param b is the second factor.
+ * @returns The Montgomery product of a and b in the range
+ *          [0, q).
+ */
+
+static ossl_inline
+    vec_int32_t
+    montgomery_multiplication_vectorized(vec_int32_t a, vec_int32_t a_twist, vec_int32_t b)
+{
+    vec_uint32_t k = (vec_uint32_t)a_twist * (vec_uint32_t)b;
+    vec_uint32_t c_u = vec_mulh((vec_uint32_alias_t)k, (vec_uint32_alias_t)vec_q);
+    vec_int32_t c = (vec_int32_t)c_u;
+    vec_int32_t z_high = vec_mulh((vec_int32_alias_t)a, (vec_int32_alias_t)b);
+    vec_int32_t r = z_high - c;
+    return reduce_twice_signed(r);
+}
+
+/*
+ * @brief Reduce modulo q to an non-negative vector.
+ *        Note that the constant v_scalar equals
+ *        floor(2**(floor(log_2(q))-1 * 2**32/q)).
+ *
+ * @param a in the range -2**31..2**31-1
+ * @returns a mod q in the range 0..q-1
+ */
+static ossl_inline
+    vec_int32_t
+    reduce_fully(vec_int32_t a)
+{
+    const int32_t v_scalar = 1074791296;
+    const vec_int32_alias_t v = { v_scalar, v_scalar, v_scalar, v_scalar };
+    vec_int32_t t = vec_mulh((vec_int32_alias_t)a, v) >> 21;
+    t *= ML_DSA_Q;
+    vec_int32_t r = a - t; /* in [0, q] */
+    return reduce_once_signed(r);
+}
+
+void ossl_poly_ntt_mult_scalar_vec128(const POLY *lhs, const POLY *rhs, POLY *out)
+{
+    int i;
+    const vec_int32_t *lhs_vec_ptr = (const vec_int32_t *)lhs->coeff;
+    const vec_int32_t *rhs_vec_ptr = (const vec_int32_t *)rhs->coeff;
+    vec_int32_t *out_vec_ptr = (vec_int32_t *)out->coeff;
+
+    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS / NUM_INT32_IN_VECTOR; i++) {
+        vec_int32_t twist_vec = (vec_int32_t)((vec_uint32_t)lhs_vec_ptr[i] * (vec_uint32_t)vec_q_inv);
+        out_vec_ptr[i] = montgomery_multiplication_vectorized(
+            lhs_vec_ptr[i], twist_vec, rhs_vec_ptr[i]);
+    }
+}
+
+/*
+ * In place number theoretic transform of a given polynomial.
+ *
+ * See FIPS 204, Algorithm 41, NTT()
+ * This function uses montgomery multiplication.
+ *
+ * @param p a polynomial that is used as the input, that is replaced with
+ *        the NTT of the polynomial
+ */
+void ossl_ml_dsa_poly_ntt_vec128(POLY *p)
+{
+    int i, j, k;
+    int step;
+    int offset = ML_DSA_NUM_POLY_COEFFICIENTS;
+    vec_int32_t *p_vec = (vec_int32_t *)p->coeff;
+
+    /* Step: 1, 2, 4, 8, ..., 32 */
+    for (step = 1; step < ML_DSA_NUM_POLY_COEFFICIENTS / 4; step <<= 1) {
+        k = 0;
+        offset >>= 1; /* Offset: 128, 64, 32, 16, ..., 4 */
+
+        for (i = 0; i < step; i++) {
+            const vec_int32_t zeta = { zetas_montgomery[step + i],
+                zetas_montgomery[step + i],
+                zetas_montgomery[step + i],
+                zetas_montgomery[step + i] };
+            const vec_int32_t zeta_twisted = { zetas_montgomery_twisted[step + i],
+                zetas_montgomery_twisted[step + i],
+                zetas_montgomery_twisted[step + i],
+                zetas_montgomery_twisted[step + i] };
+
+            for (j = k; j < k + offset; j += NUM_INT32_IN_VECTOR) {
+                vec_int32_t w_even_vec = p_vec[j / NUM_INT32_IN_VECTOR];
+                vec_int32_t w_odd_vec = p_vec[(j + offset) / NUM_INT32_IN_VECTOR];
+                vec_int32_t t_odd_vec = montgomery_multiplication_vectorized(
+                    zeta,
+                    zeta_twisted,
+                    w_odd_vec);
+                vec_int32_t coeff_j_vec = (w_even_vec + t_odd_vec);
+                vec_int32_t coeff_j_offset_vec = (w_even_vec - t_odd_vec);
+                p_vec[j / NUM_INT32_IN_VECTOR] = coeff_j_vec;
+                p_vec[(j + offset) / NUM_INT32_IN_VECTOR] = coeff_j_offset_vec;
+            }
+            k += 2 * offset;
+        }
+    }
+
+    /* offset == 2*/
+    k = 0;
+    step = 64;
+    offset = 2;
+    for (j = 0; j < ML_DSA_NUM_POLY_COEFFICIENTS; j += 2 * NUM_INT32_IN_VECTOR) {
+        const vec_int32_t zeta = {
+            zetas_montgomery[step + j / NUM_INT32_IN_VECTOR],
+            zetas_montgomery[step + j / NUM_INT32_IN_VECTOR],
+            zetas_montgomery[step + j / NUM_INT32_IN_VECTOR + 1],
+            zetas_montgomery[step + j / NUM_INT32_IN_VECTOR + 1]
+        };
+        const vec_int32_t zeta_twisted = {
+            zetas_montgomery_twisted[step + j / NUM_INT32_IN_VECTOR],
+            zetas_montgomery_twisted[step + j / NUM_INT32_IN_VECTOR],
+            zetas_montgomery_twisted[step + j / NUM_INT32_IN_VECTOR + 1],
+            zetas_montgomery_twisted[step + j / NUM_INT32_IN_VECTOR + 1]
+        };
+
+        vec_int32_t w_even_vec = {
+            p_vec[j / NUM_INT32_IN_VECTOR][0],
+            p_vec[j / NUM_INT32_IN_VECTOR][1],
+            p_vec[j / NUM_INT32_IN_VECTOR + 1][0],
+            p_vec[j / NUM_INT32_IN_VECTOR + 1][1]
+        };
+        vec_int32_t w_odd_vec = {
+            p_vec[j / NUM_INT32_IN_VECTOR][2],
+            p_vec[j / NUM_INT32_IN_VECTOR][3],
+            p_vec[j / NUM_INT32_IN_VECTOR + 1][2],
+            p_vec[j / NUM_INT32_IN_VECTOR + 1][3]
+        };
+        vec_int32_t t_odd_vec = montgomery_multiplication_vectorized(
+            zeta,
+            zeta_twisted,
+            w_odd_vec);
+        vec_int32_t coeff_j_vec = (w_even_vec + t_odd_vec);
+        vec_int32_t coeff_j_offset_vec = (w_even_vec - t_odd_vec);
+        p_vec[j / NUM_INT32_IN_VECTOR] = (vec_int32_t) {
+            coeff_j_vec[0],
+            coeff_j_vec[1],
+            coeff_j_offset_vec[0],
+            coeff_j_offset_vec[1]
+        };
+        p_vec[j / NUM_INT32_IN_VECTOR + 1] = (vec_int32_t) {
+            coeff_j_vec[2],
+            coeff_j_vec[3],
+            coeff_j_offset_vec[2],
+            coeff_j_offset_vec[3]
+        };
+    }
+
+    /* offset == 1 */
+    k = 0;
+    step = 128;
+    for (i = 0; i < step; i += NUM_INT32_IN_VECTOR) {
+        const vec_int32_t zeta = {
+            zetas_montgomery[step + i],
+            zetas_montgomery[step + i + 1],
+            zetas_montgomery[step + i + 2],
+            zetas_montgomery[step + i + 3]
+        };
+        const vec_int32_t zeta_twisted = {
+            zetas_montgomery_twisted[step + i],
+            zetas_montgomery_twisted[step + i + 1],
+            zetas_montgomery_twisted[step + i + 2],
+            zetas_montgomery_twisted[step + i + 3]
+        };
+
+        vec_int32_t w_even_vec = {
+            p_vec[k / NUM_INT32_IN_VECTOR][0],
+            p_vec[k / NUM_INT32_IN_VECTOR][2],
+            p_vec[k / NUM_INT32_IN_VECTOR + 1][0],
+            p_vec[k / NUM_INT32_IN_VECTOR + 1][2]
+        };
+        vec_int32_t w_odd_vec = {
+            p_vec[k / NUM_INT32_IN_VECTOR][1],
+            p_vec[k / NUM_INT32_IN_VECTOR][3],
+            p_vec[k / NUM_INT32_IN_VECTOR + 1][1],
+            p_vec[k / NUM_INT32_IN_VECTOR + 1][3]
+        };
+        vec_int32_t t_odd_vec = montgomery_multiplication_vectorized(
+            zeta,
+            zeta_twisted,
+            w_odd_vec);
+        vec_int32_t coeff_j_vec = reduce_fully(w_even_vec + t_odd_vec);
+        vec_int32_t coeff_j_offset_vec = reduce_fully(w_even_vec - t_odd_vec);
+
+        p->coeff[k] = coeff_j_vec[0];
+        p->coeff[k + 2] = coeff_j_vec[1];
+        p->coeff[k + 4] = coeff_j_vec[2];
+        p->coeff[k + 6] = coeff_j_vec[3];
+        p->coeff[k + 1] = coeff_j_offset_vec[0];
+        p->coeff[k + 2 + 1] = coeff_j_offset_vec[1];
+        p->coeff[k + 4 + 1] = coeff_j_offset_vec[2];
+        p->coeff[k + 6 + 1] = coeff_j_offset_vec[3];
+
+        k += 2 * NUM_INT32_IN_VECTOR;
+    }
+}
+
+/*
+ * @brief In place inverse number theoretic transform of a given polynomial.
+ * See FIPS 204, Algorithm 42,  NTT^-1()
+ *
+ * @param p a polynomial that is used as the input, that is overwritten with
+ *          the inverse of the NTT.
+ */
+void ossl_ml_dsa_poly_ntt_inverse_vec128(POLY *p)
+{
+    /*
+     * Step: 128, 64, 32, 16, ..., 1
+     * Offset: 1, 2, 4, 8, ..., 128
+     */
+    int i, j, k, offset, step = ML_DSA_NUM_POLY_COEFFICIENTS;
+    /*
+     * The multiplicative inverse of 256 mod q, in Montgomery form is
+     * ((256^-1 mod q) * ((2^32 * 2^32) mod q)) mod q = (8347681 * 2365951) mod 8380417
+     */
+    static const int32_t inverse_degree_montgomery = 41978;
+    static const vec_int32_t vec_inverse_degree_montgomery = {
+        inverse_degree_montgomery,
+        inverse_degree_montgomery,
+        inverse_degree_montgomery,
+        inverse_degree_montgomery
+    };
+    static const int32_t inverse_degree_montgomery_twisted = -8395782;
+    static const vec_int32_t vec_inverse_degree_montgomery_twisted = {
+        inverse_degree_montgomery_twisted,
+        inverse_degree_montgomery_twisted,
+        inverse_degree_montgomery_twisted,
+        inverse_degree_montgomery_twisted
+    };
+
+    vec_int32_t *p_vec = (vec_int32_t *)p->coeff;
+
+    offset = 1;
+    step >>= 1;
+    k = 0;
+
+    for (i = 0; i < step; i += NUM_INT32_IN_VECTOR) {
+        /* offset == 1*/
+        const vec_int32_t zeta = { neg_zetas_montgomery[step + (step - 1 - i)],
+            neg_zetas_montgomery[step + (step - 1 - i - 1)],
+            neg_zetas_montgomery[step + (step - 1 - i - 2)],
+            neg_zetas_montgomery[step + (step - 1 - i - 3)] };
+        const vec_int32_t zeta_twisted = { neg_zetas_montgomery_twisted[step + (step - 1 - i)],
+            neg_zetas_montgomery_twisted[step + (step - 1 - i - 1)],
+            neg_zetas_montgomery_twisted[step + (step - 1 - i - 2)],
+            neg_zetas_montgomery_twisted[step + (step - 1 - i - 3)] };
+        vec_int32_t even = { p->coeff[k],
+            p->coeff[k + 2],
+            p->coeff[k + 4],
+            p->coeff[k + 6] };
+        vec_int32_t odd = { p->coeff[k + 1],
+            p->coeff[k + 1 + 2],
+            p->coeff[k + 1 + 4],
+            p->coeff[k + 1 + 6] };
+
+        vec_int32_t coeff_j = (odd + even);
+        vec_int32_t coeff_j_offset = montgomery_multiplication_vectorized(
+            zeta,
+            zeta_twisted,
+            even - odd);
+
+        p->coeff[k + 0] = coeff_j[0];
+        p->coeff[k + 2] = coeff_j[1];
+        p->coeff[k + 4] = coeff_j[2];
+        p->coeff[k + 6] = coeff_j[3];
+        p->coeff[k + 1 + 0] = coeff_j_offset[0];
+        p->coeff[k + 1 + 2] = coeff_j_offset[1];
+        p->coeff[k + 1 + 4] = coeff_j_offset[2];
+        p->coeff[k + 1 + 6] = coeff_j_offset[3];
+
+        k += 2 * NUM_INT32_IN_VECTOR;
+    }
+
+    /* offset == 2 */
+    offset <<= 1;
+    step >>= 1;
+    k = 0;
+
+    for (i = 0; i < step; i += 2) {
+        const vec_int32_t zeta = { neg_zetas_montgomery[step + (step - 1 - i)],
+            neg_zetas_montgomery[step + (step - 1 - i)],
+            neg_zetas_montgomery[step + (step - 1 - i - 1)],
+            neg_zetas_montgomery[step + (step - 1 - i - 1)] };
+        const vec_int32_t zeta_twisted = { neg_zetas_montgomery_twisted[step + (step - 1 - i)],
+            neg_zetas_montgomery_twisted[step + (step - 1 - i)],
+            neg_zetas_montgomery_twisted[step + (step - 1 - i - 1)],
+            neg_zetas_montgomery_twisted[step + (step - 1 - i - 1)] };
+
+        j = k;
+        vec_int32_t even = { p->coeff[j],
+            p->coeff[j + 1],
+            p->coeff[j + 4],
+            p->coeff[j + 5] };
+        vec_int32_t odd = { p->coeff[j + 2],
+            p->coeff[j + 3],
+            p->coeff[j + 6],
+            p->coeff[j + 7] };
+
+        vec_int32_t coeff_j = (odd + even);
+        vec_int32_t coeff_j_offset = montgomery_multiplication_vectorized(
+            zeta,
+            zeta_twisted,
+            even - odd);
+
+        p_vec[j / NUM_INT32_IN_VECTOR] = (vec_int32_t) {
+            coeff_j[0],
+            coeff_j[1],
+            coeff_j_offset[0],
+            coeff_j_offset[1]
+        };
+        p_vec[j / NUM_INT32_IN_VECTOR + 1] = (vec_int32_t) {
+            coeff_j[2],
+            coeff_j[3],
+            coeff_j_offset[2],
+            coeff_j_offset[3]
+        };
+        k += 2 * 2 * offset;
+    }
+
+    /* offset >= 4 */
+    for (offset <<= 1; offset < ML_DSA_NUM_POLY_COEFFICIENTS; offset <<= 1) {
+        step >>= 1;
+        k = 0;
+
+        for (i = 0; i < step; i++) {
+            const vec_int32_t zeta = { neg_zetas_montgomery[step + (step - 1 - i)],
+                neg_zetas_montgomery[step + (step - 1 - i)],
+                neg_zetas_montgomery[step + (step - 1 - i)],
+                neg_zetas_montgomery[step + (step - 1 - i)] };
+            const vec_int32_t zeta_twisted = { neg_zetas_montgomery_twisted[step + (step - 1 - i)],
+                neg_zetas_montgomery_twisted[step + (step - 1 - i)],
+                neg_zetas_montgomery_twisted[step + (step - 1 - i)],
+                neg_zetas_montgomery_twisted[step + (step - 1 - i)] };
+
+            for (j = k; j < k + offset; j += NUM_INT32_IN_VECTOR) {
+                vec_int32_t even = p_vec[j / NUM_INT32_IN_VECTOR];
+                vec_int32_t odd = p_vec[(j + offset) / NUM_INT32_IN_VECTOR];
+
+                vec_int32_t coeff_j = (odd + even);
+                vec_int32_t coeff_j_offset = montgomery_multiplication_vectorized(
+                    zeta,
+                    zeta_twisted,
+                    even - odd);
+                p_vec[j / NUM_INT32_IN_VECTOR] = coeff_j;
+                p_vec[(j + offset) / NUM_INT32_IN_VECTOR] = coeff_j_offset;
+            }
+            k += 2 * offset;
+        }
+    }
+
+    for (i = 0; i < ML_DSA_NUM_POLY_COEFFICIENTS / NUM_INT32_IN_VECTOR; i += 1) {
+        p_vec[i] = montgomery_multiplication_vectorized(
+            vec_inverse_degree_montgomery,
+            vec_inverse_degree_montgomery_twisted,
+            p_vec[i]);
+    }
+}
+
+#endif
diff --git a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_poly.h b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_poly.h
index 5edc11be806..c45bd549cd6 100644
--- a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_poly.h
+++ b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_poly.h
@@ -1,18 +1,30 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
+#if !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_POLY_H)
+#define OSSL_LIBCRYPTO_ML_DSA_ML_DSA_POLY_H
+
 #include <openssl/crypto.h>

+#include "internal/common.h"
+#include "ml_dsa_local.h"
+
 #define ML_DSA_NUM_POLY_COEFFICIENTS 256

 /* Polynomial object with 256 coefficients. The coefficients are unsigned 32 bits */
 struct poly_st {
+#if defined(VX_COMPILER_SUPPORT_VEC128)
+    ALIGN16 uint32_t coeff[ML_DSA_NUM_POLY_COEFFICIENTS];
+#elif defined(_ARCH_PPC64)
+    ALIGN16 uint32_t coeff[ML_DSA_NUM_POLY_COEFFICIENTS];
+#else
     uint32_t coeff[ML_DSA_NUM_POLY_COEFFICIENTS];
+#endif
 };

 static ossl_inline ossl_unused void
@@ -182,3 +194,5 @@ poly_max_signed(const POLY *p, uint32_t *mx)
         *mx = maximum(*mx, abs);
     }
 }
+
+#endif /* !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_POLY_H) */
diff --git a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sample.c b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sample.c
index f8ce638dc22..be86b9844f7 100644
--- a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sample.c
+++ b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sample.c
@@ -13,6 +13,7 @@
 #include "ml_dsa_vector.h"
 #include "ml_dsa_matrix.h"
 #include "ml_dsa_hash.h"
+#include "internal/constant_time.h"
 #include "internal/sha3.h"
 #include "internal/packet.h"

@@ -35,6 +36,10 @@ typedef int(COEFF_FROM_NIBBLE_FUNC)(uint32_t nibble, uint32_t *out);
 static COEFF_FROM_NIBBLE_FUNC coeff_from_nibble_4;
 static COEFF_FROM_NIBBLE_FUNC coeff_from_nibble_2;

+static ML_DSA_MATRIX_EXPAND_A_FN matrix_expand_A_scalar;
+static ML_DSA_VECTOR_EXPAND_S_FN vector_expand_S_scalar;
+static ML_DSA_VECTOR_EXPAND_MASK_FN vector_expand_mask_scalar;
+
 /**
  * @brief Combine 3 bytes to form an coefficient.
  * See FIPS 204, Algorithm 14, CoeffFromThreeBytes()
@@ -206,7 +211,7 @@ err:
  *            in the range of 0..q-1.
  * @returns 1 if the matrix was generated, or 0 on error.
  */
-int ossl_ml_dsa_matrix_expand_A(EVP_MD_CTX *g_ctx, const EVP_MD *md,
+static int matrix_expand_A_scalar(EVP_MD_CTX *g_ctx, const EVP_MD *md,
     const uint8_t *rho, MATRIX *out)
 {
     int ret = 0;
@@ -223,7 +228,6 @@ int ossl_ml_dsa_matrix_expand_A(EVP_MD_CTX *g_ctx, const EVP_MD *md,

     /* The seed used for each matrix element is rho + column_index + row_index */
     memcpy(derived_seed, rho, ML_DSA_RHO_BYTES);
-
     for (i = 0; i < out->k; i++) {
         for (j = 0; j < out->l; j++) {
             derived_seed[ML_DSA_RHO_BYTES + 1] = (uint8_t)i;
@@ -256,7 +260,7 @@ err:
  *           the range (q-eta)..0..eta
  * @returns 1 if s1 and s2 were successfully generated, or 0 otherwise.
  */
-int ossl_ml_dsa_vector_expand_S(EVP_MD_CTX *h_ctx, const EVP_MD *md, int eta,
+static int vector_expand_S_scalar(EVP_MD_CTX *h_ctx, const EVP_MD *md, int eta,
     const uint8_t *seed, VECTOR *s1, VECTOR *s2)
 {
     int ret = 0;
@@ -345,6 +349,23 @@ int ossl_ml_dsa_poly_sample_in_ball(POLY *out_c, const uint8_t *seed, int seed_l
      */
     OPENSSL_load_u64_le(&signs, block);

+    /*
+     * SampleInBall implements a Fisher-Yates shuffle whose rejection-sampling
+     * inner loop and data-dependent array index unavoidably leak the structure
+     * of the challenge polynomial via memory-access pattern and branch timing.
+     * This is safe: c_tilde = H(mu ‖ w1) is the Fiat-Shamir commitment and is
+     * published in the accepted signature, so the SHAKE bytes that build c are
+     * effectively public.  See the BoringSSL design discussion at
+     * https://boringssl-review.googlesource.com/c/boringssl/+/67747/comment/8d8f01ac_70af3f21/
+     *
+     * The first 8 bytes (the sign bits loaded into |signs| above) are left
+     * tainted: they determine only the ±1 values written into c, which flow
+     * into the CT arithmetic of cs1/cs2/ct0 alongside the already-tainted
+     * secret polynomials and cause no spurious violations there.
+     * Only the rejection-sampling bytes need to be declassified.
+     */
+    CONSTTIME_DECLASSIFY(block + offset, sizeof(block) - offset);
+
     poly_zero(out_c);

     /* Loop tau times */
@@ -357,6 +378,8 @@ int ossl_ml_dsa_poly_sample_in_ball(POLY *out_c, const uint8_t *seed, int seed_l
                 /* squeeze another block if the bytes from block have been used */
                 if (!EVP_DigestSqueeze(h_ctx, block, sizeof(block)))
                     goto err;
+                /* See comment above for why the block is declassified. */
+                CONSTTIME_DECLASSIFY(block, sizeof(block));
                 offset = 0;
             }

@@ -379,3 +402,46 @@ err:
     OPENSSL_cleanse(block, sizeof(block));
     return ret;
 }
+
+static void vector_expand_mask_scalar(VECTOR *out,
+    const uint8_t rho_prime[ML_DSA_RHO_PRIME_BYTES], uint32_t kappa, uint32_t gamma1,
+    EVP_MD_CTX *h_ctx, const EVP_MD *md)
+{
+    size_t i;
+    uint8_t derived_seed[ML_DSA_RHO_PRIME_BYTES + 2];
+
+    memcpy(derived_seed, rho_prime, ML_DSA_RHO_PRIME_BYTES);
+
+    for (i = 0; i < out->num_poly; i++) {
+        size_t index = kappa + i;
+
+        derived_seed[ML_DSA_RHO_PRIME_BYTES] = index & 0xFF;
+        derived_seed[ML_DSA_RHO_PRIME_BYTES + 1] = (index >> 8) & 0xFF;
+        poly_expand_mask(out->poly + i, derived_seed, sizeof(derived_seed),
+            gamma1, h_ctx, md);
+    }
+    OPENSSL_cleanse(derived_seed, sizeof(derived_seed));
+}
+
+static const OSSL_ML_DSA_SAMPLE_OPS ml_dsa_sample_generic_meth = {
+    matrix_expand_A_scalar,
+    vector_expand_S_scalar,
+    vector_expand_mask_scalar
+};
+
+#if defined(KECCAK1600_ASM)                                                               \
+    && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64)) \
+    && !defined(OPENSSL_NO_ASM)
+#include "ml_dsa_sample_hw_x86_64.inc"
+const OSSL_ML_DSA_SAMPLE_OPS *ossl_ml_dsa_sample_ops(void)
+{
+    if (SHA3_avx512vl_capable())
+        return &ml_dsa_sample_x86_64;
+    return &ml_dsa_sample_generic_meth;
+}
+#else
+const OSSL_ML_DSA_SAMPLE_OPS *ossl_ml_dsa_sample_ops(void)
+{
+    return &ml_dsa_sample_generic_meth;
+}
+#endif
diff --git a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sample_hw_x86_64.inc b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sample_hw_x86_64.inc
new file mode 100644
index 00000000000..1fb8b2b64e7
--- /dev/null
+++ b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sample_hw_x86_64.inc
@@ -0,0 +1,314 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright (c) 2026 Intel Corporation. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#define ML_DSA_SHAKE_X4_BATCH_SIZE 4
+#define ML_DSA_SHAKE_X4_DONE_MASK ((1 << ML_DSA_SHAKE_X4_BATCH_SIZE) - 1)
+#define ML_DSA_EXPAND_MASK_BYTES_PER_COEFF 32
+#define ML_DSA_EXPAND_MASK_COEFFS_GAMMA1_19 20
+#define ML_DSA_EXPAND_MASK_COEFFS_GAMMA1_17 18
+#define ML_DSA_EXPAND_MASK_BUF_SIZE_GAMMA1_19 \
+    (ML_DSA_EXPAND_MASK_BYTES_PER_COEFF * ML_DSA_EXPAND_MASK_COEFFS_GAMMA1_19)
+#define ML_DSA_EXPAND_MASK_BUF_SIZE_GAMMA1_17 \
+    (ML_DSA_EXPAND_MASK_BYTES_PER_COEFF * ML_DSA_EXPAND_MASK_COEFFS_GAMMA1_17)
+#define ML_DSA_EXPAND_MASK_BUF_SIZE(gamma1)         \
+    ((gamma1) == ML_DSA_GAMMA1_TWO_POWER_19         \
+            ? ML_DSA_EXPAND_MASK_BUF_SIZE_GAMMA1_19 \
+            : ML_DSA_EXPAND_MASK_BUF_SIZE_GAMMA1_17)
+
+static ossl_unused int rej_ntt_poly_mb(const uint8_t *seeds[ML_DSA_SHAKE_X4_BATCH_SIZE],
+    const size_t seed_len, POLY *outs[ML_DSA_SHAKE_X4_BATCH_SIZE], const size_t count)
+{
+    KECCAK1600_X4_AVX512VL_CTX ctx;
+    uint8_t blocks[ML_DSA_SHAKE_X4_BATCH_SIZE][SHAKE128_BLOCKSIZE];
+    int coeff_idx[ML_DSA_SHAKE_X4_BATCH_SIZE] = { 0, 0, 0, 0 };
+    size_t done_mask = 0;
+    size_t lane;
+
+    for (lane = count; lane < ML_DSA_SHAKE_X4_BATCH_SIZE; lane++)
+        done_mask |= ((size_t)1 << lane);
+
+    ossl_sha3_shake128_x4_inc_init_avx512vl(&ctx);
+    ossl_sha3_shake128_x4_inc_absorb_avx512vl(&ctx, seeds[0], seeds[1],
+        seeds[2], seeds[3], seed_len);
+
+    while (done_mask != ML_DSA_SHAKE_X4_DONE_MASK) {
+        ossl_sha3_shake128_x4_inc_squeeze_avx512vl(blocks[0], blocks[1],
+            blocks[2], blocks[3], SHAKE128_BLOCKSIZE, &ctx);
+
+        for (lane = 0; lane < ML_DSA_SHAKE_X4_BATCH_SIZE; lane++) {
+            if (done_mask & ((size_t)1 << lane))
+                continue;
+
+            const uint8_t *b = blocks[lane];
+            const uint8_t *end = b + SHAKE128_BLOCKSIZE;
+
+            for (; b < end && coeff_idx[lane] < ML_DSA_NUM_POLY_COEFFICIENTS; b += 3) {
+                uint32_t *coeff_ptr = &(outs[lane]->coeff[coeff_idx[lane]]);
+
+                if (coeff_from_three_bytes(b, coeff_ptr))
+                    coeff_idx[lane]++;
+            }
+
+            if (coeff_idx[lane] >= ML_DSA_NUM_POLY_COEFFICIENTS)
+                done_mask |= ((size_t)1 << lane);
+        }
+    }
+
+    return 1;
+}
+
+static void vector_expand_mask_mb(VECTOR *out,
+    const uint8_t rho_prime[ML_DSA_RHO_PRIME_BYTES], const uint32_t kappa, const uint32_t gamma1,
+    EVP_MD_CTX *h_ctx, const EVP_MD *md)
+{
+    size_t i;
+    const size_t num_polys = out->num_poly;
+    uint8_t derived_seeds[ML_DSA_SHAKE_X4_BATCH_SIZE][ML_DSA_RHO_PRIME_BYTES + 2];
+    const size_t seed_len = sizeof(derived_seeds[0]);
+    const size_t buf_size = ML_DSA_EXPAND_MASK_BUF_SIZE(gamma1);
+    uint8_t buffers[ML_DSA_SHAKE_X4_BATCH_SIZE][ML_DSA_EXPAND_MASK_BUF_SIZE_GAMMA1_19];
+
+    (void)h_ctx;
+    (void)md;
+
+    for (i = 0; i < ML_DSA_SHAKE_X4_BATCH_SIZE; i++)
+        memcpy(derived_seeds[i], rho_prime, ML_DSA_RHO_PRIME_BYTES);
+
+    for (i = 0; i + (ML_DSA_SHAKE_X4_BATCH_SIZE - 1) < num_polys; i += ML_DSA_SHAKE_X4_BATCH_SIZE) {
+        size_t b;
+
+        for (b = 0; b < ML_DSA_SHAKE_X4_BATCH_SIZE; b++) {
+            const size_t index = kappa + i + b;
+
+            derived_seeds[b][ML_DSA_RHO_PRIME_BYTES] = index & 0xFF;
+            derived_seeds[b][ML_DSA_RHO_PRIME_BYTES + 1] = (index >> 8) & 0xFF;
+        }
+
+        ossl_sha3_shake256_x4_avx512vl(buffers[0], buffers[1], buffers[2], buffers[3], buf_size,
+            derived_seeds[0], derived_seeds[1], derived_seeds[2], derived_seeds[3], seed_len);
+
+        ossl_ml_dsa_poly_decode_expand_mask(&out->poly[i + 0], buffers[0], buf_size, gamma1);
+        ossl_ml_dsa_poly_decode_expand_mask(&out->poly[i + 1], buffers[1], buf_size, gamma1);
+        ossl_ml_dsa_poly_decode_expand_mask(&out->poly[i + 2], buffers[2], buf_size, gamma1);
+        ossl_ml_dsa_poly_decode_expand_mask(&out->poly[i + 3], buffers[3], buf_size, gamma1);
+    }
+
+    /*
+     * num_polys is always 4 (ML-DSA-44), 5 (ML-DSA-65), or 7 (ML-DSA-87), so the
+     * above loops will always runs at least once, initializing derived_seeds.
+     * As a result, 'left' below will be 0, 1, or 3, meaning the 4 way shake will
+     * recalculate values that are not used.
+     */
+    if (i < num_polys) {
+        const size_t left = num_polys - i;
+        size_t b;
+
+        for (b = 0; b < left; b++) {
+            const size_t index = kappa + i + b;
+
+            derived_seeds[b][ML_DSA_RHO_PRIME_BYTES] = (uint8_t)index;
+            derived_seeds[b][ML_DSA_RHO_PRIME_BYTES + 1] = (uint8_t)(index >> 8);
+        }
+
+        ossl_sha3_shake256_x4_avx512vl(buffers[0], buffers[1], buffers[2], buffers[3], buf_size,
+            derived_seeds[0], derived_seeds[1], derived_seeds[2], derived_seeds[3], seed_len);
+
+        ossl_ml_dsa_poly_decode_expand_mask(&out->poly[i + 0], buffers[0], buf_size, gamma1);
+
+        if ((i + 1) < num_polys)
+            ossl_ml_dsa_poly_decode_expand_mask(&out->poly[i + 1], buffers[1], buf_size, gamma1);
+
+        if ((i + 2) < num_polys)
+            ossl_ml_dsa_poly_decode_expand_mask(&out->poly[i + 2], buffers[2], buf_size, gamma1);
+    }
+
+    OPENSSL_cleanse(buffers, sizeof(buffers));
+    OPENSSL_cleanse(derived_seeds, sizeof(derived_seeds));
+}
+
+static ossl_unused int rej_bounded_poly_mb(COEFF_FROM_NIBBLE_FUNC *coef_from_nibble,
+    const uint8_t *seeds[ML_DSA_SHAKE_X4_BATCH_SIZE], const size_t seed_len,
+    POLY *outs[ML_DSA_SHAKE_X4_BATCH_SIZE], const size_t count)
+{
+    KECCAK1600_X4_AVX512VL_CTX ctx;
+    uint8_t blocks[ML_DSA_SHAKE_X4_BATCH_SIZE][SHAKE256_BLOCKSIZE];
+    int coeff_idx[ML_DSA_SHAKE_X4_BATCH_SIZE] = { 0, 0, 0, 0 };
+    size_t done_mask = 0;
+    size_t lane;
+
+    for (lane = count; lane < ML_DSA_SHAKE_X4_BATCH_SIZE; lane++)
+        done_mask |= ((size_t)1 << lane);
+
+    ossl_sha3_shake256_x4_inc_init_avx512vl(&ctx);
+    ossl_sha3_shake256_x4_inc_absorb_avx512vl(&ctx, seeds[0], seeds[1],
+        seeds[2], seeds[3], seed_len);
+
+    while (done_mask != ML_DSA_SHAKE_X4_DONE_MASK) {
+        ossl_sha3_shake256_x4_inc_squeeze_avx512vl(blocks[0], blocks[1],
+            blocks[2], blocks[3], SHAKE256_BLOCKSIZE, &ctx);
+
+        for (lane = 0; lane < ML_DSA_SHAKE_X4_BATCH_SIZE; lane++) {
+            if (done_mask & ((size_t)1 << lane))
+                continue;
+
+            const uint8_t *b = blocks[lane];
+            const uint8_t *end = b + SHAKE256_BLOCKSIZE;
+
+            for (; b < end && coeff_idx[lane] < ML_DSA_NUM_POLY_COEFFICIENTS; b++) {
+                uint32_t z0 = *b & 0x0F;
+                uint32_t z1 = *b >> 4;
+
+                if (coef_from_nibble(z0, &outs[lane]->coeff[coeff_idx[lane]]))
+                    coeff_idx[lane]++;
+
+                if (coeff_idx[lane] >= ML_DSA_NUM_POLY_COEFFICIENTS) {
+                    done_mask |= ((size_t)1 << lane);
+                    break;
+                }
+
+                if (coef_from_nibble(z1, &outs[lane]->coeff[coeff_idx[lane]]))
+                    coeff_idx[lane]++;
+
+                if (coeff_idx[lane] >= ML_DSA_NUM_POLY_COEFFICIENTS) {
+                    done_mask |= ((size_t)1 << lane);
+                    break;
+                }
+            }
+        }
+    }
+
+    OPENSSL_cleanse(blocks, sizeof(blocks));
+    ossl_sha3_shake256_x4_inc_cleanup_avx512vl(&ctx);
+    return 1;
+}
+
+static int matrix_expand_A_mb(EVP_MD_CTX *g_ctx, const EVP_MD *md,
+    const uint8_t *rho, MATRIX *out)
+{
+    size_t b, idx;
+    uint8_t derived_seeds[ML_DSA_SHAKE_X4_BATCH_SIZE][ML_DSA_RHO_BYTES + 2];
+    const size_t seed_len = sizeof(derived_seeds[0]);
+    const uint8_t *seeds[ML_DSA_SHAKE_X4_BATCH_SIZE];
+    POLY *polys[ML_DSA_SHAKE_X4_BATCH_SIZE];
+    POLY *poly = out->m_poly;
+
+    /*
+     * The seeds derived below and the sampling buffers in rej_ntt_poly_mb()
+     * are not cleansed: per FIPS 204 section 3.6.3 the matrix A is easily
+     * computed from the public key and does not require any special
+     * protections.
+     */
+
+    for (b = 0; b < ML_DSA_SHAKE_X4_BATCH_SIZE; b++) {
+        memcpy(derived_seeds[b], rho, ML_DSA_RHO_BYTES);
+        seeds[b] = derived_seeds[b];
+    }
+
+    for (idx = 0; (idx + ML_DSA_SHAKE_X4_BATCH_SIZE - 1) < (out->k * out->l);
+        idx += ML_DSA_SHAKE_X4_BATCH_SIZE) {
+        for (b = 0; b < ML_DSA_SHAKE_X4_BATCH_SIZE; b++) {
+            const size_t row = (idx + b) / out->l;
+            const size_t col = (idx + b) % out->l;
+
+            derived_seeds[b][ML_DSA_RHO_BYTES] = (uint8_t)col;
+            derived_seeds[b][ML_DSA_RHO_BYTES + 1] = (uint8_t)row;
+            polys[b] = &poly[idx + b];
+        }
+
+        if (!rej_ntt_poly_mb(seeds, seed_len, polys, 4))
+            return 0;
+    }
+
+    if (idx < (out->k * out->l)) {
+        const size_t left = (out->k * out->l) - idx;
+
+        for (b = 0; b < left; b++) {
+            const size_t row = (idx + b) / out->l;
+            const size_t col = (idx + b) % out->l;
+
+            derived_seeds[b][ML_DSA_RHO_BYTES] = (uint8_t)col;
+            derived_seeds[b][ML_DSA_RHO_BYTES + 1] = (uint8_t)row;
+            polys[b] = &poly[idx + b];
+        }
+
+        if (!rej_ntt_poly_mb(seeds, seed_len, polys, left))
+            return 0;
+    }
+
+    return 1;
+}
+
+static int vector_expand_S_mb(EVP_MD_CTX *h_ctx, const EVP_MD *md, const int eta,
+    const uint8_t *seed, VECTOR *s1, VECTOR *s2)
+{
+    int ret = 0;
+    size_t b, idx;
+    const size_t l = s1->num_poly;
+    const size_t total = l + s2->num_poly;
+    uint8_t derived_seeds[ML_DSA_SHAKE_X4_BATCH_SIZE][ML_DSA_PRIV_SEED_BYTES + 2];
+    const uint8_t *seeds[ML_DSA_SHAKE_X4_BATCH_SIZE];
+    const size_t seed_len = sizeof(derived_seeds[0]);
+    POLY *polys[ML_DSA_SHAKE_X4_BATCH_SIZE];
+    COEFF_FROM_NIBBLE_FUNC *coef_from_nibble_fn = (eta == ML_DSA_ETA_4) ? coeff_from_nibble_4 : coeff_from_nibble_2;
+
+    for (b = 0; b < ML_DSA_SHAKE_X4_BATCH_SIZE; b++) {
+        memcpy(derived_seeds[b], seed, ML_DSA_PRIV_SEED_BYTES);
+        seeds[b] = derived_seeds[b];
+    }
+
+    for (idx = 0; (idx + ML_DSA_SHAKE_X4_BATCH_SIZE - 1) < total; idx += ML_DSA_SHAKE_X4_BATCH_SIZE) {
+        for (b = 0; b < ML_DSA_SHAKE_X4_BATCH_SIZE; b++) {
+            const size_t poly_idx = idx + b;
+
+            derived_seeds[b][ML_DSA_PRIV_SEED_BYTES] = (uint8_t)(poly_idx);
+            derived_seeds[b][ML_DSA_PRIV_SEED_BYTES + 1] = (uint8_t)(poly_idx >> 8);
+
+            if (poly_idx < l)
+                polys[b] = &s1->poly[poly_idx];
+            else
+                polys[b] = &s2->poly[poly_idx - l];
+        }
+
+        if (!rej_bounded_poly_mb(coef_from_nibble_fn,
+                seeds, seed_len, polys, ML_DSA_SHAKE_X4_BATCH_SIZE))
+            goto err;
+    }
+
+    if (idx < total) {
+        const size_t batch_count = total - idx;
+
+        for (b = 0; b < batch_count; b++) {
+            const size_t poly_idx = idx + b;
+
+            derived_seeds[b][ML_DSA_PRIV_SEED_BYTES] = (uint8_t)(poly_idx);
+            derived_seeds[b][ML_DSA_PRIV_SEED_BYTES + 1] = (uint8_t)(poly_idx >> 8);
+
+            if (poly_idx < l)
+                polys[b] = &s1->poly[poly_idx];
+            else
+                polys[b] = &s2->poly[poly_idx - l];
+        }
+
+        if (!rej_bounded_poly_mb(coef_from_nibble_fn,
+                seeds, seed_len, polys, batch_count))
+            goto err;
+    }
+
+    ret = 1;
+err:
+    OPENSSL_cleanse(derived_seeds, sizeof(derived_seeds));
+    return ret;
+}
+
+static const OSSL_ML_DSA_SAMPLE_OPS ml_dsa_sample_x86_64 = {
+    matrix_expand_A_mb,
+    vector_expand_S_mb,
+    vector_expand_mask_mb
+};
diff --git a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sign.c b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sign.c
index 166a604bcd5..bcff47dbc22 100644
--- a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sign.c
+++ b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sign.c
@@ -11,6 +11,10 @@
 #include <openssl/core_names.h>
 #include <openssl/params.h>
 #include <openssl/rand.h>
+#include <openssl/err.h>
+#include <openssl/proverr.h>
+#include "internal/common.h"
+#include "internal/constant_time.h"
 #include "ml_dsa_local.h"
 #include "ml_dsa_key.h"
 #include "ml_dsa_matrix.h"
@@ -43,54 +47,169 @@ static void signature_init(ML_DSA_SIG *sig,
 }

 /*
- * FIPS 204, Algorithm 7, ML-DSA.Sign_internal()
- * @returns 1 on success and 0 on failure.
+ * @brief: Auxiliary functions to compute ML-DSA's MU.
+ * This combines the steps of creating M' and concatenating it
+ * to the Public Key Hash to obtain MU.
+ * See FIPS 204 Algorithm 2 Step 10 (and algorithm 3 Step 5) as
+ * well as Algorithm 7 Step 6 (and algorithm 8 Step 7)
+ *
+ * ML_DSA pure signatures are encoded as M' = 00 || ctx_len || ctx || msg
+ * Where ctx is the empty string by default and ctx_len <= 255.
+ * The message is appended to the encoded context.
+ * Finally a public key hash is prepended, and the whole is hashed
+ * to derive the mu value.
+ *
+ * @param key: A public or private ML-DSA key;
+ * @param encode: if not set, assumes that M' is provided raw and the
+ * following parameters are ignored.
+ * @param ctx An optional context to add to the message encoding.
+ * @param ctx_len The size of |ctx|. It must be in the range 0..255
+ * @returns an EVP_MD_CTX if the operation is successful, NULL otherwise.
  */
-static int ml_dsa_sign_internal(const ML_DSA_KEY *priv, int msg_is_mu,
-    const uint8_t *encoded_msg,
-    size_t encoded_msg_len,
-    const uint8_t *rnd, size_t rnd_len,
+EVP_MD_CTX *ossl_ml_dsa_mu_init_int(EVP_MD *shake256_md,
+    const uint8_t *tr, size_t tr_len, int encode, int prehash,
+    const uint8_t *ctx, size_t ctx_len)
+{
+    EVP_MD_CTX *md_ctx;
+    uint8_t itb[2];
+
+    md_ctx = EVP_MD_CTX_new();
+    if (md_ctx == NULL)
+        return NULL;
+
+    /* H(.. */
+    if (!EVP_DigestInit_ex2(md_ctx, shake256_md, NULL))
+        goto err;
+    /* ..pk (= key->tr) */
+    if (!EVP_DigestUpdate(md_ctx, tr, tr_len))
+        goto err;
+    /* M' = .. */
+    if (encode) {
+        if (ctx_len > ML_DSA_MAX_CONTEXT_STRING_LEN)
+            goto err;
+        /* IntegerToBytes(0, 1) .. */
+        itb[0] = prehash ? 1 : 0;
+        /* || IntegerToBytes(|ctx|, 1) || .. */
+        itb[1] = (uint8_t)ctx_len;
+        if (!EVP_DigestUpdate(md_ctx, itb, 2))
+            goto err;
+        /* ctx || .. */
+        if (!EVP_DigestUpdate(md_ctx, ctx, ctx_len))
+            goto err;
+        /* .. msg) will follow in update and final functions */
+    }
+
+    return md_ctx;
+
+err:
+    EVP_MD_CTX_free(md_ctx);
+    return NULL;
+}
+
+EVP_MD_CTX *ossl_ml_dsa_mu_init(const ML_DSA_KEY *key, int encode,
+    const uint8_t *ctx, size_t ctx_len)
+{
+    if (key == NULL)
+        return NULL;
+    return ossl_ml_dsa_mu_init_int(key->shake256_md, key->tr, sizeof(key->tr),
+        encode, 0, ctx, ctx_len);
+}
+
+/*
+ * @brief: updates the internal ML-DSA hash with an additional message chunk.
+ *
+ * @param md_ctx: The hashing context
+ * @param msg: The next message chunk
+ * @param msg_len: The length of the msg buffer to process
+ * @returns 1 on success, 0 on error
+ */
+int ossl_ml_dsa_mu_update(EVP_MD_CTX *md_ctx, const uint8_t *msg, size_t msg_len)
+{
+    return EVP_DigestUpdate(md_ctx, msg, msg_len);
+}
+
+/*
+ * @brief: finalizes the internal ML-DSA hash
+ *
+ * @param md_ctx: The hashing context
+ * @param mu: The output buffer for Mu
+ * @param mu_len: The size of the output buffer
+ * @returns 1 on success, 0 on error
+ */
+int ossl_ml_dsa_mu_finalize(EVP_MD_CTX *md_ctx, uint8_t *mu, size_t mu_len)
+{
+    if (!ossl_assert(mu_len == ML_DSA_MU_BYTES)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_BAD_LENGTH);
+        return 0;
+    }
+    return EVP_DigestSqueeze(md_ctx, mu, mu_len);
+}
+
+/*
+ * @brief FIPS 204, Algorithm 7, ML-DSA.Sign_internal()
+ *
+ * This algorithm is decomposed in 2 steps, a set of functions to compute mu
+ * and then the actual signing function.
+ *
+ * @param priv: The private ML-DSA key
+ * @param mu: The pre-computed mu hash
+ * @param mu_len: The length of the mu buffer
+ * @param rnd: The random buffer
+ * @param rnd_len: The length of the random buffer
+ * @param out_sig: The output signature buffer
+ * @returns 1 on success, 0 on error
+ */
+static int ml_dsa_sign_internal(const ML_DSA_KEY *priv,
+    const uint8_t *mu, size_t mu_len, const uint8_t *rnd, size_t rnd_len,
     uint8_t *out_sig)
 {
     int ret = 0;
+    const OSSL_ML_DSA_SAMPLE_OPS *sample_ops = ossl_ml_dsa_sample_ops();
     const ML_DSA_PARAMS *params = priv->params;
     EVP_MD_CTX *md_ctx = NULL;
-    uint32_t k = params->k, l = params->l;
+    uint32_t k = (uint32_t)params->k, l = (uint32_t)params->l;
     uint32_t gamma1 = params->gamma1, gamma2 = params->gamma2;
-    uint8_t *alloc = NULL, *w1_encoded;
+    uint8_t *alloc = NULL, *w1_encoded = NULL;
+    void *alloc_freeptr = NULL;
     size_t alloc_len, w1_encoded_len;
     size_t num_polys_sig_k = 2 * k;
     size_t num_polys_k = 5 * k;
     size_t num_polys_l = 3 * l;
     size_t num_polys_k_by_l = k * l;
-    POLY *polys = NULL, *p, *c_ntt;
+    size_t poly_count;
+    POLY *p, *c_ntt;
     VECTOR s1_ntt, s2_ntt, t0_ntt, w, w1, cs1, cs2, y;
     MATRIX a_ntt;
     ML_DSA_SIG sig;
-    uint8_t mu[ML_DSA_MU_BYTES], *mu_ptr = mu;
-    const size_t mu_len = sizeof(mu);
     uint8_t rho_prime[ML_DSA_RHO_PRIME_BYTES];
     uint8_t c_tilde[ML_DSA_MAX_LAMBDA / 4];
     size_t c_tilde_len = params->bit_strength >> 2;
     size_t kappa;

-    /*
-     * Allocate a single blob for most of the variable size temporary variables.
-     * Mostly used for VECTOR POLYNOMIALS (every POLY is 1K).
-     */
+    if (mu_len != ML_DSA_MU_BYTES) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_BAD_LENGTH);
+        return 0;
+    }
+
+    /* Allocate w1_encoded buffer */
     w1_encoded_len = k * (gamma2 == ML_DSA_GAMMA2_Q_MINUS1_DIV88 ? 192 : 128);
-    alloc_len = w1_encoded_len
-        + sizeof(*polys) * (1 + num_polys_k + num_polys_l + num_polys_k_by_l + num_polys_sig_k);
-    alloc = OPENSSL_malloc(alloc_len);
-    if (alloc == NULL)
+    w1_encoded = OPENSSL_malloc(w1_encoded_len);
+    if (w1_encoded == NULL)
         return 0;
+
+    /* Allocate aligned POLY array */
+    poly_count = 1 + num_polys_k + num_polys_l + num_polys_k_by_l + num_polys_sig_k;
+    alloc_len = sizeof(*p) * poly_count;
+    alloc = OPENSSL_aligned_alloc(alloc_len, 16, &alloc_freeptr);
+    if (alloc == NULL)
+        goto err;
+
     md_ctx = EVP_MD_CTX_new();
     if (md_ctx == NULL)
         goto err;

-    w1_encoded = alloc;
-    /* Init the temp vectors to point to the allocated polys blob */
-    p = (POLY *)(w1_encoded + w1_encoded_len);
+    /* Init the temp vectors to point to the aligned polys blob */
+    p = (POLY *)alloc;
     c_ntt = p++;
     matrix_init(&a_ntt, p, k, l);
     p += num_polys_k_by_l;
@@ -107,19 +226,28 @@ static int ml_dsa_sign_internal(const ML_DSA_KEY *priv, int msg_is_mu,
     signature_init(&sig, p, k, p + k, l, c_tilde, c_tilde_len);
     /* End of the allocated blob setup */

-    if (!matrix_expand_A(md_ctx, priv->shake128_md, priv->rho, &a_ntt))
+    /*
+     * Mark the private key material as secret before we start computing with
+     * it.  Any control-flow branch or memory-index that transitively depends
+     * on these bytes will be flagged by Valgrind when the library is built
+     * with enable-ct-validation.
+     */
+    CONSTTIME_SECRET(priv->K, sizeof(priv->K));
+    CONSTTIME_SECRET_VECTOR(priv->s1);
+    CONSTTIME_SECRET_VECTOR(priv->s2);
+    CONSTTIME_SECRET_VECTOR(priv->t0);
+
+    if (!sample_ops->matrix_expand_A(md_ctx, priv->shake128_md, priv->rho, &a_ntt))
         goto err;
-    if (msg_is_mu) {
-        if (encoded_msg_len != mu_len)
-            goto err;
-        mu_ptr = (uint8_t *)encoded_msg;
-    } else {
-        if (!shake_xof_2(md_ctx, priv->shake256_md, priv->tr, sizeof(priv->tr),
-                encoded_msg, encoded_msg_len, mu_ptr, mu_len))
-            goto err;
-    }
+
+    /*
+     * rho_prime is derived from the secret K and must remain tainted
+     * throughout the rejection loop: knowing it would let an attacker
+     * reconstruct every mask y and recover c*s1 = z - y from the final
+     * signature.  Do NOT declassify it.
+     */
     if (!shake_xof_3(md_ctx, priv->shake256_md, priv->K, sizeof(priv->K),
-            rnd, rnd_len, mu_ptr, mu_len,
+            rnd, rnd_len, mu, mu_len,
             rho_prime, sizeof(rho_prime)))
         goto err;

@@ -140,8 +268,8 @@ static int ml_dsa_sign_internal(const ML_DSA_KEY *priv, int msg_is_mu,
         VECTOR *ct0 = &w1;
         uint32_t z_max, r0_max, ct0_max, h_ones;

-        vector_expand_mask(&y, rho_prime, sizeof(rho_prime), kappa,
-            gamma1, md_ctx, priv->shake256_md);
+        sample_ops->vector_expand_mask(&y, rho_prime,
+            (uint32_t)kappa, gamma1, md_ctx, priv->shake256_md);
         vector_copy(y_ntt, &y);
         vector_ntt(y_ntt);

@@ -151,11 +279,11 @@ static int ml_dsa_sign_internal(const ML_DSA_KEY *priv, int msg_is_mu,
         vector_high_bits(&w, gamma2, &w1);
         ossl_ml_dsa_w1_encode(&w1, gamma2, w1_encoded, w1_encoded_len);

-        if (!shake_xof_2(md_ctx, priv->shake256_md, mu_ptr, mu_len,
+        if (!shake_xof_2(md_ctx, priv->shake256_md, mu, mu_len,
                 w1_encoded, w1_encoded_len, c_tilde, c_tilde_len))
             break;

-        if (!poly_sample_in_ball_ntt(c_ntt, c_tilde, c_tilde_len,
+        if (!poly_sample_in_ball_ntt(c_ntt, c_tilde, (int)c_tilde_len,
                 md_ctx, priv->shake256_md, params->tau))
             break;

@@ -171,12 +299,17 @@ static int ml_dsa_sign_internal(const ML_DSA_KEY *priv, int msg_is_mu,
         vector_low_bits(r0, gamma2, r0);

         /*
-         * Leaking that the signature is rejected is fine as the next attempt at a
-         * signature will be (indistinguishable from) independent of this one.
+         * Leaking that the signature is rejected is fine: the next attempt
+         * is (indistinguishable from) independent of this one, so an
+         * observer learns nothing about the secret key beyond the number of
+         * iterations, which is itself safe to reveal.
+         * Declassify the bound-check output so that Valgrind does not flag
+         * these intentional leaks.
          */
         z_max = vector_max(&sig.z);
         r0_max = vector_max_signed(r0);
-        if (value_barrier_32(constant_time_ge(z_max, gamma1 - params->beta)
+        if (constant_time_declassify_u32(
+                constant_time_ge(z_max, gamma1 - params->beta)
                 | constant_time_ge(r0_max, gamma2 - params->beta)))
             continue;

@@ -185,65 +318,130 @@ static int ml_dsa_sign_internal(const ML_DSA_KEY *priv, int msg_is_mu,
         vector_make_hint(ct0, &cs2, &w, gamma2, &sig.hint);

         ct0_max = vector_max(ct0);
-        h_ones = vector_count_ones(&sig.hint);
+        h_ones = (uint32_t)vector_count_ones(&sig.hint);
         /* Same reasoning applies to the leak as above */
-        if (value_barrier_32(constant_time_ge(ct0_max, gamma2)
+        if (constant_time_declassify_u32(
+                constant_time_ge(ct0_max, gamma2)
                 | constant_time_lt(params->omega, h_ones)))
             continue;
+
+        /*
+         * The iteration has passed both rejection tests: the signature is
+         * accepted.  Declassify all three public outputs before encoding.
+         *
+         * sig.z and sig.hint were computed from secret key material (s1,
+         * s2, t0) and carry taint, but the rejection checks above have
+         * verified they lie within the ranges required by the security
+         * proof, so they reveal nothing about the key.
+         *
+         * c_tilde = H(mu || w1) carries taint that propagated from the
+         * secret rho_prime through y → w → w1.  It is the Fiat-Shamir
+         * challenge commitment and is published as part of the signature.
+         * We defer its declassification to here (rather than immediately
+         * after the SHAKE call) so that Valgrind can check that
+         * poly_sample_in_ball_ntt and the NTT challenge arithmetic are
+         * data-oblivious with respect to their tainted inputs.
+         */
+        CONSTTIME_DECLASSIFY(c_tilde, c_tilde_len);
+        CONSTTIME_DECLASSIFY_VECTOR(sig.z);
+        CONSTTIME_DECLASSIFY_VECTOR(sig.hint);
+
         ret = ossl_ml_dsa_sig_encode(&sig, params, out_sig);
         break;
     }
 err:
     EVP_MD_CTX_free(md_ctx);
-    OPENSSL_clear_free(alloc, alloc_len);
+    if (alloc_freeptr != NULL) {
+        /* Clear the actual sensitive buffer */
+        if (alloc != NULL)
+            OPENSSL_cleanse(alloc, alloc_len);
+        OPENSSL_free(alloc_freeptr);
+    }
+    if (w1_encoded != NULL)
+        OPENSSL_clear_free(w1_encoded, w1_encoded_len);
     OPENSSL_cleanse(rho_prime, sizeof(rho_prime));
     OPENSSL_cleanse(c_tilde, sizeof(c_tilde));
+    /*
+     * Declassify the private key material before returning.  The key struct
+     * is not owned here, so we do not free it, but we must remove the
+     * "secret" taint so that the caller does not inherit spurious Valgrind
+     * "uninitialised" state.  The polynomial data in |alloc| was already
+     * zeroed and freed above; rho_prime is stack-allocated and cleansed.
+     */
+    CONSTTIME_DECLASSIFY(priv->K, sizeof(priv->K));
+    CONSTTIME_DECLASSIFY_VECTOR(priv->s1);
+    CONSTTIME_DECLASSIFY_VECTOR(priv->s2);
+    CONSTTIME_DECLASSIFY_VECTOR(priv->t0);
     return ret;
 }

 /*
- * See FIPS 204, Algorithm 8, ML-DSA.Verify_internal().
+ * @brief FIPS 204, Algorithm 8, ML-DSA.Verify_internal().
+ *
+ * This algorithm is decomposed in 2 steps, a set of functions to compute mu
+ * and then the actual verification function.
+ *
+ * @param pub: The public ML-DSA key
+ * @param mu: The pre-computed mu hash
+ * @param mu_len: The length of the mu buffer
+ * @param sig_enc: The encoded signature to be verified
+ * @param sig_enc_len: the encoded csignature length
+ * @returns 1 on success, 0 on error
  */
-static int ml_dsa_verify_internal(const ML_DSA_KEY *pub, int msg_is_mu,
-    const uint8_t *msg_enc, size_t msg_enc_len,
+static int ml_dsa_verify_internal(const ML_DSA_KEY *pub,
+    const uint8_t *mu, size_t mu_len,
     const uint8_t *sig_enc, size_t sig_enc_len)
 {
     int ret = 0;
-    uint8_t *alloc = NULL, *w1_encoded;
-    POLY *polys = NULL, *p, *c_ntt;
+    const OSSL_ML_DSA_SAMPLE_OPS *sample_ops = ossl_ml_dsa_sample_ops();
+    uint8_t *alloc = NULL, *w1_encoded = NULL;
+    void *alloc_freeptr = NULL;
+    POLY *p, *c_ntt;
     MATRIX a_ntt;
     VECTOR az_ntt, ct1_ntt, *z_ntt, *w1, *w_approx;
     ML_DSA_SIG sig;
     const ML_DSA_PARAMS *params = pub->params;
-    uint32_t k = pub->params->k;
-    uint32_t l = pub->params->l;
+    uint32_t k = (uint32_t)pub->params->k;
+    uint32_t l = (uint32_t)pub->params->l;
     uint32_t gamma2 = params->gamma2;
     size_t w1_encoded_len;
     size_t num_polys_sig = k + l;
     size_t num_polys_k = 2 * k;
     size_t num_polys_l = 1 * l;
     size_t num_polys_k_by_l = k * l;
-    uint8_t mu[ML_DSA_MU_BYTES], *mu_ptr = mu;
-    const size_t mu_len = sizeof(mu);
+    size_t poly_count;
+    size_t alloc_len;
     uint8_t c_tilde[ML_DSA_MAX_LAMBDA / 4];
     uint8_t c_tilde_sig[ML_DSA_MAX_LAMBDA / 4];
     EVP_MD_CTX *md_ctx = NULL;
     size_t c_tilde_len = params->bit_strength >> 2;
     uint32_t z_max;

-    /* Allocate space for all the POLYNOMIALS used by temporary VECTORS */
+    /* FIPS 204 compliance: Also validate signature length before decoding */
+    if (mu_len != ML_DSA_MU_BYTES || sig_enc_len != params->sig_len) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_BAD_LENGTH);
+        return 0;
+    }
+
+    /* Allocate w1_encoded buffer */
     w1_encoded_len = k * (gamma2 == ML_DSA_GAMMA2_Q_MINUS1_DIV88 ? 192 : 128);
-    alloc = OPENSSL_malloc(w1_encoded_len
-        + sizeof(*polys) * (1 + num_polys_k + num_polys_l + num_polys_k_by_l + num_polys_sig));
-    if (alloc == NULL)
+    w1_encoded = OPENSSL_malloc(w1_encoded_len);
+    if (w1_encoded == NULL)
         return 0;
+
+    /* Allocate aligned POLY array */
+    poly_count = 1 + num_polys_k + num_polys_l + num_polys_k_by_l + num_polys_sig;
+    alloc_len = sizeof(*p) * poly_count;
+    alloc = OPENSSL_aligned_alloc(alloc_len, 16, &alloc_freeptr);
+    if (alloc == NULL)
+        goto err;
+
     md_ctx = EVP_MD_CTX_new();
     if (md_ctx == NULL)
         goto err;

-    w1_encoded = alloc;
-    /* Init the temp vectors to point to the allocated polys blob */
-    p = (POLY *)(w1_encoded + w1_encoded_len);
+    /* Init the temp vectors to point to the aligned polys blob */
+    p = (POLY *)alloc;
     c_ntt = p++;
     matrix_init(&a_ntt, p, k, l);
     p += num_polys_k_by_l;
@@ -253,19 +451,11 @@ static int ml_dsa_verify_internal(const ML_DSA_KEY *pub, int msg_is_mu,
     vector_init(&ct1_ntt, p + k, k);

     if (!ossl_ml_dsa_sig_decode(&sig, sig_enc, sig_enc_len, pub->params)
-        || !matrix_expand_A(md_ctx, pub->shake128_md, pub->rho, &a_ntt))
+        || !sample_ops->matrix_expand_A(md_ctx, pub->shake128_md, pub->rho, &a_ntt))
         goto err;
-    if (msg_is_mu) {
-        if (msg_enc_len != mu_len)
-            goto err;
-        mu_ptr = (uint8_t *)msg_enc;
-    } else {
-        if (!shake_xof_2(md_ctx, pub->shake256_md, pub->tr, sizeof(pub->tr),
-                msg_enc, msg_enc_len, mu_ptr, mu_len))
-            goto err;
-    }
-    /* Compute verifiers challenge c_ntt = NTT(SampleInBall(c_tilde) */
-    if (!poly_sample_in_ball_ntt(c_ntt, c_tilde_sig, c_tilde_len,
+
+    /* Compute verifiers challenge c_ntt = NTT(SampleInBall(c_tilde)) */
+    if (!poly_sample_in_ball_ntt(c_ntt, c_tilde_sig, (int)c_tilde_len,
             md_ctx, pub->shake256_md, params->tau))
         goto err;

@@ -289,115 +479,69 @@ static int ml_dsa_verify_internal(const ML_DSA_KEY *pub, int msg_is_mu,
     vector_use_hint(&sig.hint, w_approx, gamma2, w1);
     ossl_ml_dsa_w1_encode(w1, gamma2, w1_encoded, w1_encoded_len);

-    if (!shake_xof_3(md_ctx, pub->shake256_md, mu_ptr, mu_len,
+    if (!shake_xof_3(md_ctx, pub->shake256_md, mu, mu_len,
             w1_encoded, w1_encoded_len, NULL, 0, c_tilde, c_tilde_len))
         goto err;

     ret = (z_max < (uint32_t)(params->gamma1 - params->beta))
         && memcmp(c_tilde, sig.c_tilde, c_tilde_len) == 0;
 err:
-    OPENSSL_free(alloc);
+    if (alloc_freeptr != NULL)
+        OPENSSL_free(alloc_freeptr);
+    OPENSSL_free(w1_encoded);
     EVP_MD_CTX_free(md_ctx);
     return ret;
 }

-/**
- * @brief Encode a message
- * See FIPS 204 Algorithm 2 Step 10 (and algorithm 3 Step 5).
- *
- * ML_DSA pure signatures are encoded as M' = 00 || ctx_len || ctx || msg
- * Where ctx is the empty string by default and ctx_len <= 255.
- *
- * Note this code could be shared with SLH_DSA
- *
- * @param msg A message to encode
- * @param msg_len The size of |msg|
- * @param ctx An optional context to add to the message encoding.
- * @param ctx_len The size of |ctx|. It must be in the range 0..255
- * @param encode Use the Pure signature encoding if this is 1, and dont encode
- *               if this value is 0.
- * @param tmp A small buffer that may be used if the message is small.
- * @param tmp_len The size of |tmp|
- * @param out_len The size of the returned encoded buffer.
- * @returns A buffer containing the encoded message. If the passed in
- * |tmp| buffer is big enough to hold the encoded message then it returns |tmp|
- * otherwise it allocates memory which must be freed by the caller. If |encode|
- * is 0 then it returns |msg|. NULL is returned if there is a failure.
- */
-static uint8_t *msg_encode(const uint8_t *msg, size_t msg_len,
-    const uint8_t *ctx, size_t ctx_len, int encode,
-    uint8_t *tmp, size_t tmp_len, size_t *out_len)
-{
-    uint8_t *encoded = NULL;
-    size_t encoded_len;
-
-    if (encode == 0) {
-        /* Raw message */
-        *out_len = msg_len;
-        return (uint8_t *)msg;
-    }
-    if (ctx_len > ML_DSA_MAX_CONTEXT_STRING_LEN)
-        return NULL;
-
-    /* Pure encoding */
-    encoded_len = 1 + 1 + ctx_len + msg_len;
-    *out_len = encoded_len;
-    if (encoded_len <= tmp_len) {
-        encoded = tmp;
-    } else {
-        encoded = OPENSSL_malloc(encoded_len);
-        if (encoded == NULL)
-            return NULL;
-    }
-    encoded[0] = 0;
-    encoded[1] = (uint8_t)ctx_len;
-    memcpy(&encoded[2], ctx, ctx_len);
-    memcpy(&encoded[2 + ctx_len], msg, msg_len);
-    return encoded;
-}
-
 /**
  * See FIPS 204 Section 5.2 Algorithm 2 ML-DSA.Sign()
  *
  * @returns 1 on success, or 0 on error.
  */
-int ossl_ml_dsa_sign(const ML_DSA_KEY *priv, int msg_is_mu,
-    const uint8_t *msg, size_t msg_len,
+int ossl_ml_dsa_sign(const ML_DSA_KEY *priv,
+    int msg_is_mu, const uint8_t *msg, size_t msg_len,
     const uint8_t *context, size_t context_len,
     const uint8_t *rand, size_t rand_len, int encode,
     unsigned char *sig, size_t *sig_len, size_t sig_size)
 {
-    int ret = 1;
-    uint8_t m_tmp[1024], *m = m_tmp, *alloced_m = NULL;
-    size_t m_len = 0;
+    EVP_MD_CTX *md_ctx = NULL;
+    uint8_t mu[ML_DSA_MU_BYTES];
+    const uint8_t *mu_ptr = mu;
+    size_t mu_len = sizeof(mu);
+    int ret = 0;

     if (ossl_ml_dsa_key_get_priv(priv) == NULL)
         return 0;
-    if (sig != NULL) {
-        if (sig_size < priv->params->sig_len)
-            return 0;
-        if (msg_is_mu) {
-            m = (uint8_t *)msg;
-            m_len = msg_len;
-        } else {
-            m = msg_encode(msg, msg_len, context, context_len, encode,
-                m_tmp, sizeof(m_tmp), &m_len);
-            if (m == NULL)
-                return 0;
-            if (m != msg && m != m_tmp)
-                alloced_m = m;
-        }
-        ret = ml_dsa_sign_internal(priv, msg_is_mu, m, m_len, rand, rand_len, sig);
-        /* The encoded message may contain confidential message content */
-        if (m != msg) {
-            if (m != m_tmp)
-                OPENSSL_clear_free(alloced_m, m_len);
-            else
-                OPENSSL_cleanse(m_tmp, sizeof(m_tmp));
-        }
-    }
+
     if (sig_len != NULL)
         *sig_len = priv->params->sig_len;
+
+    if (sig == NULL)
+        return (sig_len != NULL) ? 1 : 0;
+
+    if (sig_size < priv->params->sig_len)
+        return 0;
+
+    if (msg_is_mu) {
+        mu_ptr = msg;
+        mu_len = msg_len;
+    } else {
+        md_ctx = ossl_ml_dsa_mu_init(priv, encode, context, context_len);
+        if (md_ctx == NULL)
+            return 0;
+
+        if (!ossl_ml_dsa_mu_update(md_ctx, msg, msg_len))
+            goto err;
+
+        if (!ossl_ml_dsa_mu_finalize(md_ctx, mu, mu_len))
+            goto err;
+    }
+
+    ret = ml_dsa_sign_internal(priv, mu_ptr, mu_len, rand, rand_len, sig);
+
+err:
+    EVP_MD_CTX_free(md_ctx);
+    OPENSSL_cleanse(mu, sizeof(mu));
     return ret;
 }

@@ -405,38 +549,38 @@ int ossl_ml_dsa_sign(const ML_DSA_KEY *priv, int msg_is_mu,
  * See FIPS 203 Section 5.3 Algorithm 3 ML-DSA.Verify()
  * @returns 1 on success, or 0 on error.
  */
-int ossl_ml_dsa_verify(const ML_DSA_KEY *pub, int msg_is_mu,
-    const uint8_t *msg, size_t msg_len,
+int ossl_ml_dsa_verify(const ML_DSA_KEY *pub,
+    int msg_is_mu, const uint8_t *msg, size_t msg_len,
     const uint8_t *context, size_t context_len, int encode,
     const uint8_t *sig, size_t sig_len)
 {
-    uint8_t *m, *alloced_m = NULL;
-    size_t m_len;
-    uint8_t m_tmp[1024];
+    EVP_MD_CTX *md_ctx = NULL;
+    uint8_t mu[ML_DSA_MU_BYTES];
+    const uint8_t *mu_ptr = mu;
+    size_t mu_len = sizeof(mu);
     int ret = 0;

     if (ossl_ml_dsa_key_get_pub(pub) == NULL)
         return 0;

     if (msg_is_mu) {
-        m = (uint8_t *)msg;
-        m_len = msg_len;
+        mu_ptr = msg;
+        mu_len = msg_len;
     } else {
-        m = msg_encode(msg, msg_len, context, context_len, encode,
-            m_tmp, sizeof(m_tmp), &m_len);
-        if (m == NULL)
+        md_ctx = ossl_ml_dsa_mu_init(pub, encode, context, context_len);
+        if (md_ctx == NULL)
             return 0;
-        if (m != msg && m != m_tmp)
-            alloced_m = m;
-    }

-    ret = ml_dsa_verify_internal(pub, msg_is_mu, m, m_len, sig, sig_len);
-    /* The encoded message may contain confidential message content */
-    if (m != msg) {
-        if (m != m_tmp)
-            OPENSSL_clear_free(alloced_m, m_len);
-        else
-            OPENSSL_cleanse(m_tmp, sizeof(m_tmp));
+        if (!ossl_ml_dsa_mu_update(md_ctx, msg, msg_len))
+            goto err;
+
+        if (!ossl_ml_dsa_mu_finalize(md_ctx, mu, mu_len))
+            goto err;
     }
+
+    ret = ml_dsa_verify_internal(pub, mu_ptr, mu_len, sig, sig_len);
+err:
+    EVP_MD_CTX_free(md_ctx);
+    OPENSSL_cleanse(mu, sizeof(mu));
     return ret;
 }
diff --git a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sign.h b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sign.h
index 23f44e1702b..5a6cbe81d51 100644
--- a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sign.h
+++ b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_sign.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,9 +7,16 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_SIGN_H)
+#define OSSL_LIBCRYPTO_ML_DSA_ML_DSA_SIGN_H
+
+#include "ml_dsa_vector.h"
+
 struct ml_dsa_sig_st {
     VECTOR z;
     VECTOR hint;
     uint8_t *c_tilde;
     size_t c_tilde_len;
 };
+
+#endif /* !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_SIGN_H) */
diff --git a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_vector.h b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_vector.h
index 1f3e6a03299..feedb56eff9 100644
--- a/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_vector.h
+++ b/deps/openssl/openssl/crypto/ml_dsa/ml_dsa_vector.h
@@ -7,8 +7,10 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_VECTOR_H)
+#define OSSL_LIBCRYPTO_ML_DSA_ML_DSA_VECTOR_H
+
 #include <assert.h>
-#include <openssl/crypto.h>
 #include "ml_dsa_poly.h"

 struct vector_st {
@@ -16,6 +18,11 @@ struct vector_st {
     size_t num_poly;
 };

+#define CONSTTIME_SECRET_VECTOR(v) \
+    CONSTTIME_SECRET(v.poly, v.num_poly * sizeof(POLY));
+#define CONSTTIME_DECLASSIFY_VECTOR(v) \
+    CONSTTIME_DECLASSIFY(v.poly, v.num_poly * sizeof(POLY));
+
 /**
  * @brief Initialize a Vector object.
  *
@@ -32,7 +39,16 @@ static ossl_inline ossl_unused void vector_init(VECTOR *v, POLY *polys, size_t n

 static ossl_inline ossl_unused int vector_alloc(VECTOR *v, size_t num_polys)
 {
-    v->poly = OPENSSL_malloc(num_polys * sizeof(POLY));
+    v->poly = OPENSSL_malloc_array(num_polys, sizeof(POLY));
+    if (v->poly == NULL)
+        return 0;
+    v->num_poly = num_polys;
+    return 1;
+}
+
+static ossl_inline ossl_unused int vector_secure_alloc(VECTOR *v, size_t num_polys)
+{
+    v->poly = OPENSSL_secure_malloc_array(num_polys, sizeof(POLY));
     if (v->poly == NULL)
         return 0;
     v->num_poly = num_polys;
@@ -46,6 +62,13 @@ static ossl_inline ossl_unused void vector_free(VECTOR *v)
     v->num_poly = 0;
 }

+static ossl_inline ossl_unused void vector_secure_free(VECTOR *v, size_t rank)
+{
+    OPENSSL_secure_clear_free(v->poly, rank * sizeof(POLY));
+    v->poly = NULL;
+    v->num_poly = 0;
+}
+
 /* @brief zeroize a vectors polynomial coefficients */
 static ossl_inline ossl_unused void vector_zero(VECTOR *va)
 {
@@ -129,34 +152,6 @@ vector_mult_scalar(const VECTOR *lhs, const POLY *rhs, VECTOR *out)
         ossl_ml_dsa_poly_ntt_mult(lhs->poly + i, rhs, out->poly + i);
 }

-static ossl_inline ossl_unused int
-vector_expand_S(EVP_MD_CTX *h_ctx, const EVP_MD *md, int eta,
-    const uint8_t *seed, VECTOR *s1, VECTOR *s2)
-{
-    return ossl_ml_dsa_vector_expand_S(h_ctx, md, eta, seed, s1, s2);
-}
-
-static ossl_inline ossl_unused void
-vector_expand_mask(VECTOR *out, const uint8_t *rho_prime, size_t rho_prime_len,
-    uint32_t kappa, uint32_t gamma1,
-    EVP_MD_CTX *h_ctx, const EVP_MD *md)
-{
-    size_t i;
-    uint8_t derived_seed[ML_DSA_RHO_PRIME_BYTES + 2];
-
-    memcpy(derived_seed, rho_prime, ML_DSA_RHO_PRIME_BYTES);
-
-    for (i = 0; i < out->num_poly; i++) {
-        size_t index = kappa + i;
-
-        derived_seed[ML_DSA_RHO_PRIME_BYTES] = index & 0xFF;
-        derived_seed[ML_DSA_RHO_PRIME_BYTES + 1] = (index >> 8) & 0xFF;
-        poly_expand_mask(out->poly + i, derived_seed, sizeof(derived_seed),
-            gamma1, h_ctx, md);
-    }
-    OPENSSL_cleanse(derived_seed, sizeof(derived_seed));
-}
-
 /* Scale back previously rounded value */
 static ossl_inline ossl_unused void
 vector_scale_power2_round_ntt(const VECTOR *in, VECTOR *out)
@@ -253,3 +248,5 @@ vector_use_hint(const VECTOR *h, const VECTOR *r, uint32_t gamma2, VECTOR *out)
     for (i = 0; i < out->num_poly; i++)
         poly_use_hint(h->poly + i, r->poly + i, gamma2, out->poly + i);
 }
+
+#endif /* !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_VECTOR_H) */
diff --git a/deps/openssl/openssl/crypto/ml_kem/asm/mlkem_intt_ppc64le.S b/deps/openssl/openssl/crypto/ml_kem/asm/mlkem_intt_ppc64le.S
new file mode 100644
index 00000000000..8f22851605a
--- /dev/null
+++ b/deps/openssl/openssl/crypto/ml_kem/asm/mlkem_intt_ppc64le.S
@@ -0,0 +1,676 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+/*
+ * Copyright IBM Corp. 2025, 2026
+ *
+ * ===================================================================================
+ * Written by Danny Tsen <dtsen@us.ibm.com>
+ */
+
+#include "mlkem_ppc_macros_asm.inc"
+
+.machine "any"
+.text
+
+#define ZETA_INTT_OFFSET 0
+
+#define PEER  17
+#define CURR  18
+
+#define V_Z1  28
+#define V_Z2  29
+#define V_Z3  30
+#define V_Z4  31
+#define V_ZETA  31
+
+.macro SAVE_REGS
+        stdu    1, -336(1)
+        mflr    0
+        std     14, 56(1)
+        std     15, 64(1)
+        std     16, 72(1)
+        std     17, 80(1)
+        std     18, 88(1)
+
+        li      10, 128
+        li      11, 144
+        li      12, 160
+        li      14, 176
+        li      15, 192
+        li      16, 208
+        stxvx   32+20, 10, 1
+        stxvx   32+21, 11, 1
+        stxvx   32+22, 12, 1
+        stxvx   32+23, 14, 1
+        stxvx   32+24, 15, 1
+        stxvx   32+25, 16, 1
+        li      10, 224
+        li      11, 240
+        li      12, 256
+        li      14, 272
+        li      15, 288
+        li      16, 304
+        stxvx   32+26, 10, 1
+        stxvx   32+27, 11, 1
+        stxvx   32+28, 12, 1
+        stxvx   32+29, 14, 1
+        stxvx   32+30, 15, 1
+        stxvx   32+31, 16, 1
+.endm
+
+.macro RESTORE_REGS
+        li      10, 128
+        li      11, 144
+        li      12, 160
+        li      14, 176
+        li      15, 192
+        li      16, 208
+        lxvx    32+20, 10, 1
+        lxvx    32+21, 11, 1
+        lxvx    32+22, 12, 1
+        lxvx    32+23, 14, 1
+        lxvx    32+24, 15, 1
+        lxvx    32+25, 16, 1
+        li      10, 224
+        li      11, 240
+        li      12, 256
+        li      14, 272
+        li      15, 288
+        li      16, 304
+        lxvx    32+26, 10, 1
+        lxvx    32+27, 11, 1
+        lxvx    32+28, 12, 1
+        lxvx    32+29, 14, 1
+        lxvx    32+30, 15, 1
+        lxvx    32+31, 16, 1
+        ld      14, 56(1)
+        ld      15, 64(1)
+        ld      16, 72(1)
+        ld      17, 80(1)
+        ld      18, 88(1)
+
+        mtlr    0
+        addi    1, 1, 336
+.endm
+
+/* ===================================================================== */
+/* Delayed writes resulting curr and peer coefficients */
+.macro delayed_writes_curr_peer _c1, _p1, _c2, _p2, _c3, _p3, _c4, _p4
+        stxvd2x    32+\_c1, 0, 5
+        stxvd2x    32+\_p1, 10, 5
+        stxvd2x    32+\_c2, 11, 5
+        stxvd2x    32+\_p2, 12, 5
+        stxvd2x    32+\_c3, 15, 5
+        stxvd2x    32+\_p3, 16, 5
+        stxvd2x    32+\_c4, 17, 5
+        stxvd2x    32+\_p4, 18, 5
+.endm
+
+/*
+ * _intt_layer_reduce_4x- common code for layer 6 and 7
+ *
+ * Assuming input registers and output vectors as follows,
+ *   input offsets - curr (0, r11, r15, r17), peer (r10, r12, r16, r18)
+ *   output vectors - v20, v21, v22, v23, v24, v25, v26
+ */
+.macro _intt_layer_reduce_4x
+        /* even - curr, odd - peer, odd is the updated peer */
+        /* Compute (even - odd + kPrime) */
+        vsubuhm  0, 10, 14
+        vadduhm  20, 14, 10
+        vadduhm  21, 0, V_kPrime16
+        vsubuhm  0, 11, 15
+        vadduhm  22, 15, 11
+        vadduhm  23, 0, V_kPrime16
+        vsubuhm  0, 12, 16
+        vadduhm  24, 16, 12
+        vadduhm  25, 0, V_kPrime16
+        vsubuhm  0, 13, 17
+        vadduhm  26, 17, 13
+        vadduhm  27, 0, V_kPrime16
+        zeta_scalar_mul 21, V_Z1, 8, 9       /* peer * zeta */
+        zeta_scalar_mul 23, V_Z2, 18, 19       /* peer * zeta */
+        Barrett_reduce_delayed_2x 8, 9, 18, 19, 21, 23
+        zeta_scalar_mul 25, V_Z3, 8, 9       /* peer * zeta */
+        zeta_scalar_mul 27, V_Z4, 18, 19       /* peer * zeta */
+        Barrett_reduce_delayed_2x 8, 9, 18, 19, 25, 27
+        reduce_once_4x 21, 23, 25, 27
+.endm
+
+/* Layer 1 layout -
+ *  each load contains 2 curr and 2 peer elements.
+ *    -> curr1 curr1 peer1 peer1 curr2 curr2 peer2 peer2
+ *  vmrgew and vmrgow -> 8 curr elements and 8 peer elements
+ */
+/*
+ * INTT layer 1,  Offset between legs = 2.
+ */
+.macro _load_transpose_layer1
+        lxvd2x     32+0, 0, 5
+        lxvd2x     32+6, 10, 5
+        lxvd2x     32+7, 11, 5
+        lxvd2x     32+8, 12, 5
+        lxvd2x     32+9, 15, 5
+        lxvd2x     32+10, 16, 5
+        lxvd2x     32+11, 17, 5
+        lxvd2x     32+12, 18, 5
+        vmrgew 14, 0, 6
+        vmrgew 15, 7, 8
+        vmrgew 16, 9, 10
+        vmrgew 17, 11, 12
+        vmrgow 13, 11, 12
+        vmrgow 12, 9, 10
+        vmrgow 11, 7, 8
+        vmrgow 10, 0, 6
+.endm
+
+.macro _intt_layer1_reduce_4x
+        lvx     V_Z1, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z2, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z3, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z4, 0, 14
+        addi  14, 14, 16
+        _load_transpose_layer1
+        _intt_layer_reduce_4x
+.endm
+
+.macro INTT_Layer1_4x
+        _intt_layer1_reduce_4x
+        reduce_once_4x 20, 22, 24, 26
+        vmrgow  6, 21, 20
+        vmrgew  7, 21, 20
+        vmrgow  8, 23, 22
+        vmrgew  9, 23, 22
+        vmrgow  10, 25, 24
+        vmrgew  11, 25, 24
+        vmrgow  12, 27, 26
+        vmrgew  13, 27, 26
+        delayed_writes_curr_peer 7, 6, 9, 8, 11, 10, 13, 12
+        addi  5, 5, 128
+.endm
+
+/* Layer 2 layout -
+ *  each load contains 4 curr and 4 peer elements
+ *  xxpermidi -> 8 curr elements and 8 peer elements
+ */
+/*
+ * INTT layer 2,  Offset between legs = 4.
+ */
+.macro _load_transpose_layer2
+        lxvd2x     4, 0, 5
+        lxvd2x     5, 10, 5
+        lxvd2x     6, 11, 5
+        lxvd2x     7, 12, 5
+        lxvd2x     8, 15, 5
+        lxvd2x     9, 16, 5
+        lxvd2x     10, 17, 5
+        lxvd2x     11, 18, 5
+        xxpermdi 32+14, 5, 4, 3
+        xxpermdi 32+10, 5, 4, 0
+        xxpermdi 32+15, 7, 6, 3
+        xxpermdi 32+11, 7, 6, 0
+        xxpermdi 32+16, 9, 8, 3
+        xxpermdi 32+12, 9, 8, 0
+        xxpermdi 32+17, 11, 10, 3
+        xxpermdi 32+13, 11, 10, 0
+.endm
+
+.macro _intt_layer2_reduce_4x
+        lvx     V_Z1, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z2, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z3, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z4, 0, 14
+        addi  14, 14, 16
+        _load_transpose_layer2
+        _intt_layer_reduce_4x
+.endm
+
+.macro INTT_Layer2_4x
+        _intt_layer2_reduce_4x
+        reduce_once_4x 20, 22, 24, 26
+        xxpermdi 32+6, 32+20, 32+21, 3
+        xxpermdi 32+7, 32+20, 32+21, 0
+        xxpermdi 32+8, 32+22, 32+23, 3
+        xxpermdi 32+9, 32+22, 32+23, 0
+        xxpermdi 32+10, 32+24, 32+25, 3
+        xxpermdi 32+11, 32+24, 32+25, 0
+        xxpermdi 32+12, 32+26, 32+27, 3
+        xxpermdi 32+13, 32+26, 32+27, 0
+        delayed_writes_curr_peer 6, 7, 8, 9, 10, 11, 12, 13
+        addi  5, 5, 128
+.endm
+
+/* ===================================================================== */
+/*
+ * INTT computation for layer 3, 4, 5, 6 and 7.
+ */
+
+/* Load 8 vectors with 4x pipeline
+ *
+ * Assuming input registers and output vectors as follows,
+ *   input offsets - curr (0, r11, r15, r17), peer (r10, r12, r16, r18)
+ *   output vectors - v20, v21, v22, v23, v24, v25, v26
+ */
+.macro _intt_scalar_reduce_4x _zeta1, _zeta2, _zeta3, _zeta4
+        /* Load peer */
+        lxvd2x     32+14, 10, 5
+        lxvd2x     32+15, 12, 5
+        lxvd2x     32+16, 16, 5
+        lxvd2x     32+17, 18, 5
+
+        /* Load curr */
+        lxvd2x     32+10, 0, 5
+        lxvd2x     32+11, 11, 5
+        lxvd2x     32+12, 15, 5
+        lxvd2x     32+13, 17, 5
+
+        /* even - curr, odd - peer, odd is the updated peer */
+        /* Compute (even - odd + kPrime) */
+        vsubuhm  0, 10, 14
+        vadduhm  20, 14, 10
+        vadduhm  21, 0, V_kPrime16
+        vsubuhm  0, 11, 15
+        vadduhm  22, 15, 11
+        vadduhm  23, 0, V_kPrime16
+        vsubuhm  0, 12, 16
+        vadduhm  24, 16, 12
+        vadduhm  25, 0, V_kPrime16
+        vsubuhm  0, 13, 17
+        vadduhm  26, 17, 13
+        vadduhm  27, 0, V_kPrime16
+        zeta_scalar_mul 21, \_zeta1, 8, 9       /* peer * zeta */
+        zeta_scalar_mul 23, \_zeta2, 18, 19       /* peer * zeta */
+        Barrett_reduce_delayed_2x 8, 9, 18, 19, 21, 23
+        zeta_scalar_mul 25, \_zeta3, 8, 9       /* peer * zeta */
+        zeta_scalar_mul 27, \_zeta4, 18, 19       /* peer * zeta */
+        Barrett_reduce_delayed_2x 8, 9, 18, 19, 25, 27
+        reduce_once_4x 21, 23, 25, 27
+.endm
+
+/*
+ * INTT layer 3, Offset between legs = 8.
+ */
+.macro INTT_Layer3_4x
+        lvx     V_Z1, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z2, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z3, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z4, 0, 14
+        addi  14, 14, 16
+        _intt_scalar_reduce_4x V_Z1, V_Z2, V_Z3, V_Z4
+        reduce_once_4x 20, 22, 24, 26
+        delayed_writes_curr_peer 20, 21, 22, 23, 24, 25, 26, 27
+        addi  5, 5, 128
+.endm
+
+/*
+ * INTT layer 4, Offset between legs = 16.
+ */
+.macro INTT_Layer4_4x
+        lvx     V_Z1, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z2, 0, 14
+        addi  14, 14, 16
+        _intt_scalar_reduce_4x V_Z1, V_Z1, V_Z2, V_Z2
+        reduce_once_4x 20, 22, 24, 26
+        delayed_writes_curr_peer 20, 21, 22, 23, 24, 25, 26, 27
+        addi  5, 5, 128
+.endm
+
+.macro intt_reduce_delayed_write
+        _intt_scalar_reduce_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        reduce_once_4x 20, 22, 24, 26
+        delayed_writes_curr_peer 20, 21, 22, 23, 24, 25, 26, 27
+.endm
+
+/*
+ * INTT layer 5, Offset between legs = 32.
+ */
+.macro INTT_Layer5_4x
+        lvx     V_ZETA, 0, 14
+        addi  14, 14, 16
+        intt_reduce_delayed_write
+        addi  5, 5, 128
+.endm
+
+/*
+ * INTT layer 6, Offset between legs = 64.
+ */
+.macro INTT_Layer6_4x
+        intt_reduce_delayed_write
+        addi  5, 5, 64
+.endm
+
+/*
+ * INTT layer 7, Offset between legs = 128.
+ */
+.macro INTT_Layer7_4x
+        intt_reduce_delayed_write
+        addi  5, 5, 64
+.endm
+
+/* ===================================================================== */
+/* Multiply a scalar by a constant (kInverseDegree=3303). */
+.macro _mul_const_reduce_2x _x1, _x2
+        vmulouh  6, \_x1, V_kInverseDegree
+        vmuleuh  7, \_x1, V_kInverseDegree
+        xxmrglw  32+28, 32+7, 32+6
+        xxmrghw  32+29, 32+7, 32+6
+        vmulouh  6, \_x2, V_kInverseDegree
+        vmuleuh  7, \_x2, V_kInverseDegree
+        xxmrglw  32+30, 32+7, 32+6
+        xxmrghw  32+31, 32+7, 32+6
+        Barrett_reduce_delayed_2x 28, 29, 30, 31, \_x1, \_x2
+.endm
+
+.macro scalar_mul_const_8x
+        lxvd2x     32+20, 0, 5
+        lxvd2x     32+21, 10, 5
+        lxvd2x     32+22, 11, 5
+        lxvd2x     32+23, 12, 5
+        lxvd2x     32+24, 15, 5
+        lxvd2x     32+25, 16, 5
+        lxvd2x     32+26, 17, 5
+        lxvd2x     32+27, 18, 5
+        _mul_const_reduce_2x 20, 21
+        _mul_const_reduce_2x 22, 23
+        _mul_const_reduce_2x 24, 25
+        _mul_const_reduce_2x 26, 27
+        reduce_once_4x 20, 21, 22, 23
+        reduce_once_4x 24, 25, 26, 27
+        /* overload delayed_writes_curr_peer */
+        delayed_writes_curr_peer 20, 21, 22, 23, 24, 25, 26, 27
+        addi  5, 5, 128
+.endm
+
+.macro Load_consts
+        addis   10,2,ntt_consts@toc@ha
+        addi    10,10,ntt_consts@toc@l
+        lvx V_kPrime16, 0, 10
+        li  7, 16
+        lvx V_kPrime32, 7, 10
+        li  7, 32
+        lvx V_kBarrettMultiplier, 7, 10
+        li  7, 48
+        lvx V_kBarrettShift, 7, 10
+        li  7, 64
+        lvx V_kInverseDegree, 7, 10
+.endm
+
+/* ===================================================================== */
+/*
+ * mlkem_inverse_ntt_ppc(int16_t *r)
+ *   Compute inverse NTT based on the following 7 layers -
+ *     len = 2, 4, 8, 16, 32, 64, 128
+ *
+ *   Each layer compute the coefficients on 2 legs, start and start + len*2 offsets.
+ *
+ *   leg 1                        leg 2
+ *   -----                        -----
+ *   start                        start+len*2
+ *   start+next                   start+len*2+next
+ *   start+next+next              start+len*2+next+next
+ *   start+next+next+next         start+len*2+next+next+next
+ *
+ *   The resulting coefficients then store back to each leg's offset.
+ *
+ *   Each vector has the same corresponding zeta except len=4 and len=2.
+ *
+ *   len=4 has 4-4 layout which means every 4 16-bit coefficients have the same zeta.
+ *   and len=2 has 2-2-2-2 layout which means every 2 16-bit coefficients have the same zeta.
+ *   e.g.
+ *         coeff vector    a1   a2   a3  a4  a5  a6  a7  a8
+ *         zeta  vector    z1   z1   z2  z2  z3  z3  z4  z4
+ *
+ *   For len=4 and len=2, each vector will get permuted to leg1 and leg2. Zeta is
+ *   pre-arranged for the leg1 and leg2.  After the computation, each vector needs
+ *   to transpose back to its original 4-4 or 2-2-2-2 layout.
+ */
+.global mlkem_inverse_ntt_ppc
+.align 4
+mlkem_inverse_ntt_ppc:
+
+        SAVE_REGS
+
+        Load_consts
+        addis   8,2,mlkem_intt_zetas@toc@ha
+        addi    8,8,mlkem_intt_zetas@toc@l
+        addi    14, 8, ZETA_INTT_OFFSET
+
+        li      10, 16        // offset to next peer
+        li      11, 32
+        li      12, 48
+        li      15, 64
+        li      16, 80
+        li      17, 96
+        li      18, 112
+
+.align 4
+        /*
+         * Layer 1. len = 2
+         *    Load zeta vectors in 2-2-2-2 layout
+         */
+        mr      5, 3
+
+        INTT_Layer1_4x
+        INTT_Layer1_4x
+        INTT_Layer1_4x
+        INTT_Layer1_4x
+
+.align 4
+        /*
+         * Layer 22. len = 4
+         *    Load zeta vectors in 4-4 layout
+         */
+        mr      5, 3
+
+        INTT_Layer2_4x
+        INTT_Layer2_4x
+        INTT_Layer2_4x
+        INTT_Layer2_4x
+
+.align 4
+        /*
+         * Layer 3. len = 8
+         */
+        mr      5, 3
+
+        INTT_Layer3_4x
+        INTT_Layer3_4x
+        INTT_Layer3_4x
+        INTT_Layer3_4x
+
+.align 4
+        /*
+         * Layer 4. len = 16
+         */
+        mr      5, 3
+        li      10, 32        // offset to next peer
+        li      11, 16
+        li      12, 32+16
+        li      15, 64
+        li      16, 64+32
+        li      17, 64+16
+        li      18, 96+16
+
+        INTT_Layer4_4x
+        INTT_Layer4_4x
+        INTT_Layer4_4x
+        INTT_Layer4_4x
+
+.align 4
+        /*
+         * Layer 5. len = 32
+         */
+        mr      5, 3
+        li      10, 64        // offset to next peer
+        li      11, 16
+        li      12, 64+16
+        li      15, 32
+        li      16, 64+32
+        li      17, 48
+        li      18, 64+48
+
+        INTT_Layer5_4x
+        INTT_Layer5_4x
+        INTT_Layer5_4x
+        INTT_Layer5_4x
+
+.align 4
+        /*
+         * Layer 6. len = 64
+         */
+        mr      5, 3
+        li      10, 128        // offset to next peer
+        li      11, 16
+        li      12, 128+16
+        li      15, 32
+        li      16, 128+32
+        li      17, 48
+        li      18, 128+48
+
+        lvx     V_ZETA, 0, 14
+        addi  14, 14, 16
+        INTT_Layer6_4x
+        INTT_Layer6_4x
+        addi  5, 5, 128
+        lvx     V_ZETA, 0, 14
+        addi  14, 14, 16
+        INTT_Layer6_4x
+        INTT_Layer6_4x
+        addi  5, 5, 128
+
+.align 4
+        /*
+         * Layer 7. len = 128
+         */
+        mr      5, 3
+        li      10, 256        // offset to next peer
+        li      11, 16
+        li      12, 256+16
+        li      15, 32
+        li      16, 256+32
+        li      17, 48
+        li      18, 256+48
+
+        lvx     V_ZETA, 0, 14
+        addi  14, 14, 16
+        INTT_Layer7_4x
+        INTT_Layer7_4x
+        INTT_Layer7_4x
+        INTT_Layer7_4x
+
+        /* Multiply a scalar by a constant. */
+        mr      5, 3
+        li      10, 16
+        li      11, 32
+        li      12, 48
+        li      15, 64
+        li      16, 80
+        li      17, 96
+        li      18, 112
+
+        scalar_mul_const_8x
+        scalar_mul_const_8x
+        scalar_mul_const_8x
+        scalar_mul_const_8x
+
+        RESTORE_REGS
+        blr
+.size     mlkem_inverse_ntt_ppc,.-mlkem_inverse_ntt_ppc
+
+.rodata
+.align 4
+ntt_consts:
+.short kPrime, kPrime, kPrime, kPrime, kPrime, kPrime, kPrime, kPrime
+.long  kPrime, kPrime, kPrime, kPrime
+.long  kBarrettMultiplier, kBarrettMultiplier, kBarrettMultiplier, kBarrettMultiplier
+.long  kBarrettShift, 0, kBarrettShift, 0
+.short kInverseDegree, kInverseDegree, kInverseDegree, kInverseDegree, kInverseDegree, kInverseDegree, kInverseDegree, kInverseDegree
+
+mlkem_intt_zetas:
+/*
+ * For intt Len=2
+ * reorder zeta array, (1, 2, 3, 4) -> (4, 2, 3, 1)
+ * Transpose z[0], z[1], z[2], z[3]
+ *    -> z[4], z[4], z[2], z[2], z[3], z[3], z[1], z[1]
+ */
+.short  1219, 1219, 2444, 2444, 394, 394, 1175, 1175
+.short  1607, 1607, 1455, 1455, 2117, 2117, 2300, 2300
+.short  2186, 2186, 554, 554, 1179, 1179, 2443, 2443
+.short  525, 525, 2926, 2926, 2237, 2237, 2303, 2303
+.short  1230, 1230, 863, 863, 2768, 2768, 735, 735
+.short  2266, 2266, 556, 556, 3010, 3010, 2572, 2572
+.short  2954, 2954, 1239, 1239, 780, 780, 1684, 1684
+.short  1745, 1745, 1292, 1292, 1031, 1031, 109, 109
+.short  2596, 2596, 3061, 3061, 992, 992, 2688, 2688
+.short  2390, 2390, 892, 892, 1021, 1021, 941, 941
+.short  1482, 1482, 1868, 1868, 2377, 2377, 642, 642
+.short  1626, 1626, 540, 540, 1678, 1678, 1540, 1540
+.short  2573, 2573, 314, 314, 1173, 1173, 279, 279
+.short  1920, 1920, 48, 48, 667, 667, 3096, 3096
+.short  1692, 1692, 1041, 1041, 2606, 2606, 2229, 2229
+.short  3312, 3312, 2746, 2746, 568, 568, 680, 680
+/* For intt Len=4 */
+.short  2419, 2419, 2419, 2419, 2102, 2102, 2102, 2102
+.short  219, 219, 219, 219, 855, 855, 855, 855
+.short  2681, 2681, 2681, 2681, 1848, 1848, 1848, 1848
+.short  712, 712, 712, 712, 682, 682, 682, 682
+.short  927, 927, 927, 927, 1795, 1795, 1795, 1795
+.short  461, 461, 461, 461, 1891, 1891, 1891, 1891
+.short  2877, 2877, 2877, 2877, 2522, 2522, 2522, 2522
+.short  1894, 1894, 1894, 1894, 1010, 1010, 1010, 1010
+.short  1414, 1414, 1414, 1414, 2009, 2009, 2009, 2009
+.short  3296, 3296, 3296, 3296, 464, 464, 464, 464
+.short  2697, 2697, 2697, 2697, 816, 816, 816, 816
+.short  1352, 1352, 1352, 1352, 2679, 2679, 2679, 2679
+.short  1274, 1274, 1274, 1274, 1052, 1052, 1052, 1052
+.short  1025, 1025, 1025, 1025, 2132, 2132, 2132, 2132
+.short  1573, 1573, 1573, 1573, 76, 76, 76, 76
+.short  2998, 2998, 2998, 2998, 3040, 3040, 3040, 3040
+/* For intt Len=8 and others */
+.short  2508, 2508, 2508, 2508, 2508, 2508, 2508, 2508
+.short  1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355
+.short  450, 450, 450, 450, 450, 450, 450, 450
+.short  936, 936, 936, 936, 936, 936, 936, 936
+.short  447, 447, 447, 447, 447, 447, 447, 447
+.short  2794, 2794, 2794, 2794, 2794, 2794, 2794, 2794
+.short  1235, 1235, 1235, 1235, 1235, 1235, 1235, 1235
+.short  1903, 1903, 1903, 1903, 1903, 1903, 1903, 1903
+.short  1996, 1996, 1996, 1996, 1996, 1996, 1996, 1996
+.short  1089, 1089, 1089, 1089, 1089, 1089, 1089, 1089
+.short  3273, 3273, 3273, 3273, 3273, 3273, 3273, 3273
+.short  283, 283, 283, 283, 283, 283, 283, 283
+.short  1853, 1853, 1853, 1853, 1853, 1853, 1853, 1853
+.short  1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990
+.short  882, 882, 882, 882, 882, 882, 882, 882
+.short  3033, 3033, 3033, 3033, 3033, 3033, 3033, 3033
+.short  1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583
+.short  2760, 2760, 2760, 2760, 2760, 2760, 2760, 2760
+.short  69, 69, 69, 69, 69, 69, 69, 69
+.short  543, 543, 543, 543, 543, 543, 543, 543
+.short  2532, 2532, 2532, 2532, 2532, 2532, 2532, 2532
+.short  3136, 3136, 3136, 3136, 3136, 3136, 3136, 3136
+.short  1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410
+.short  2267, 2267, 2267, 2267, 2267, 2267, 2267, 2267
+.short  2481, 2481, 2481, 2481, 2481, 2481, 2481, 2481
+.short  1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432
+.short  2699, 2699, 2699, 2699, 2699, 2699, 2699, 2699
+.short  687, 687, 687, 687, 687, 687, 687, 687
+.short  40, 40, 40, 40, 40, 40, 40, 40
+.short  749, 749, 749, 749, 749, 749, 749, 749
+.short  1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600
diff --git a/deps/openssl/openssl/crypto/ml_kem/asm/mlkem_ntt_ppc64le.S b/deps/openssl/openssl/crypto/ml_kem/asm/mlkem_ntt_ppc64le.S
new file mode 100644
index 00000000000..7569e201270
--- /dev/null
+++ b/deps/openssl/openssl/crypto/ml_kem/asm/mlkem_ntt_ppc64le.S
@@ -0,0 +1,647 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+/*
+ * Copyright IBM Corp. 2025, 2026
+ *
+ * ===================================================================================
+ * Written by Danny Tsen <dtsen@us.ibm.com>
+ */
+
+#include "mlkem_ppc_macros_asm.inc"
+
+.machine "any"
+.text
+
+#define ZETA_NTT_OFFSET 0
+
+#define V_Z1  28
+#define V_Z2  29
+#define V_Z3  30
+#define V_Z4  31
+#define V_ZETA  31
+
+.macro SAVE_REGS
+        stdu    1, -336(1)
+        mflr    0
+        std     14, 56(1)
+        std     15, 64(1)
+        std     16, 72(1)
+        std     17, 80(1)
+        std     18, 88(1)
+
+        li      10, 128
+        li      11, 144
+        li      12, 160
+        li      14, 176
+        li      15, 192
+        li      16, 208
+        stxvx   32+20, 10, 1
+        stxvx   32+21, 11, 1
+        stxvx   32+22, 12, 1
+        stxvx   32+23, 14, 1
+        stxvx   32+24, 15, 1
+        stxvx   32+25, 16, 1
+        li      10, 224
+        li      11, 240
+        li      12, 256
+        li      14, 272
+        li      15, 288
+        li      16, 304
+        stxvx   32+26, 10, 1
+        stxvx   32+27, 11, 1
+        stxvx   32+28, 12, 1
+        stxvx   32+29, 14, 1
+        stxvx   32+30, 15, 1
+        stxvx   32+31, 16, 1
+.endm
+
+.macro RESTORE_REGS
+        li      10, 128
+        li      11, 144
+        li      12, 160
+        li      14, 176
+        li      15, 192
+        li      16, 208
+        lxvx    32+20, 10, 1
+        lxvx    32+21, 11, 1
+        lxvx    32+22, 12, 1
+        lxvx    32+23, 14, 1
+        lxvx    32+24, 15, 1
+        lxvx    32+25, 16, 1
+        li      10, 224
+        li      11, 240
+        li      12, 256
+        li      14, 272
+        li      15, 288
+        li      16, 304
+        lxvx    32+26, 10, 1
+        lxvx    32+27, 11, 1
+        lxvx    32+28, 12, 1
+        lxvx    32+29, 14, 1
+        lxvx    32+30, 15, 1
+        lxvx    32+31, 16, 1
+        ld      14, 56(1)
+        ld      15, 64(1)
+        ld      16, 72(1)
+        ld      17, 80(1)
+        ld      18, 88(1)
+
+        mtlr    0
+        addi    1, 1, 336
+.endm
+
+/* ===================================================================== */
+/*
+ * NTT computation for layer 1, 2, 3, 4 and 5.
+ */
+/* Load 8 vectors with 4x pipeline
+ *
+ * Assuming input registers and output vectors as follows,
+ *   input offsets - curr (0, r11, r15, r17), peer (r10, r12, r16, r18)
+ *   output vectors - v20, v21, v22, v23, v24, v25, v26
+ */
+.macro _ntt_scalar_reduce_4x _zeta1, _zeta2, _zeta3, _zeta4
+        /* Load peer */
+        lxvd2x     32+14, 10, 5
+        lxvd2x     32+15, 12, 5
+        lxvd2x     32+16, 16, 5
+        lxvd2x     32+17, 18, 5
+
+        zeta_scalar_mul 14, \_zeta1, 20, 21       /* peer * zeta */
+        zeta_scalar_mul 15, \_zeta2, 22, 23       /* peer * zeta */
+        zeta_scalar_mul 16, \_zeta3, 24, 25       /* peer * zeta */
+        zeta_scalar_mul 17, \_zeta4, 26, 27       /* peer * zeta */
+        Barrett_reduce_delayed 20, 21, 14
+        Barrett_reduce_delayed 22, 23, 15
+        Barrett_reduce_delayed 24, 25, 16
+        Barrett_reduce_delayed 26, 27, 17
+        reduce_once_4x 14, 15, 16, 17
+
+        /* Load curr */
+        lxvd2x     32+10, 0, 5
+        lxvd2x     32+11, 11, 5
+        lxvd2x     32+12, 15, 5
+        lxvd2x     32+13, 17, 5
+
+        /* even - curr, odd - peer, odd is the updated peer */
+        /* Compute (even - odd + kPrime) */
+        vsubuhm  0, 10, 14
+        vadduhm  21, 0, V_kPrime16
+        vadduhm  20, 14, 10
+        vsubuhm  0, 11, 15
+        vadduhm  23, 0, V_kPrime16
+        vadduhm  22, 15, 11
+        vsubuhm  0, 12, 16
+        vadduhm  25, 0, V_kPrime16
+        vadduhm  24, 16, 12
+        vsubuhm  0, 13, 17
+        vadduhm  27, 0, V_kPrime16
+        vadduhm  26, 17, 13
+.endm
+
+/* Delayed writes resulting curr and peer coefficients */
+.macro delayed_writes_curr_peer _c1, _p1, _c2, _p2, _c3, _p3, _c4, _p4
+        stxvd2x    32+\_c1, 0, 5
+        stxvd2x    32+\_p1, 10, 5
+        stxvd2x    32+\_c2, 11, 5
+        stxvd2x    32+\_p2, 12, 5
+        stxvd2x    32+\_c3, 15, 5
+        stxvd2x    32+\_p3, 16, 5
+        stxvd2x    32+\_c4, 17, 5
+        stxvd2x    32+\_p4, 18, 5
+.endm
+
+.macro ntt_reduce_delayed_write
+        _ntt_scalar_reduce_4x V_ZETA, V_ZETA, V_ZETA, V_ZETA
+        reduce_once_4x 20, 22, 24, 26
+        reduce_once_4x 21, 23, 25, 27
+        delayed_writes_curr_peer 20, 21, 22, 23, 24, 25, 26, 27
+.endm
+
+/*
+ * NTT layer 1, Offset between legs = 128.
+ */
+.macro NTT_Layer1_4x
+        ntt_reduce_delayed_write
+        addi  5, 5, 64
+.endm
+
+/*
+ * NTT layer 2, Offset between legs = 64.
+ */
+.macro NTT_Layer2_4x
+        ntt_reduce_delayed_write
+        addi  5, 5, 64
+.endm
+
+/*
+ * NTT layer 3, Offset between legs = 32.
+ */
+.macro NTT_Layer3_4x
+        lvx     V_ZETA, 0, 14
+        addi  14, 14, 16
+        ntt_reduce_delayed_write
+        addi  5, 5, 128
+.endm
+
+/*
+ * NTT layer 4, Offset between legs = 16.
+ */
+.macro NTT_Layer4_4x
+        lvx     V_Z1, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z2, 0, 14
+        addi  14, 14, 16
+        _ntt_scalar_reduce_4x V_Z1, V_Z1, V_Z2, V_Z2
+        reduce_once_4x 20, 22, 24, 26
+        reduce_once_4x 21, 23, 25, 27
+        delayed_writes_curr_peer 20, 21, 22, 23, 24, 25, 26, 27
+        addi  5, 5, 128
+.endm
+
+/*
+ * NTT layer 5, Offset between legs = 8.
+ */
+.macro NTT_Layer5_4x
+        lvx     V_Z1, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z2, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z3, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z4, 0, 14
+        addi  14, 14, 16
+        _ntt_scalar_reduce_4x V_Z1, V_Z2, V_Z3, V_Z4
+        reduce_once_4x 20, 22, 24, 26
+        reduce_once_4x 21, 23, 25, 27
+        delayed_writes_curr_peer 20, 21, 22, 23, 24, 25, 26, 27
+        addi  5, 5, 128
+.endm
+
+/* ===================================================================== */
+/* Layer 6 layout -
+ *  each load contains 4 curr and 4 peer elements
+ *  xxpermidi -> 8 curr elements and 8 peer elements
+ */
+.macro _load_transpose_layer6
+        lxvd2x     4, 0, 5
+        lxvd2x     5, 10, 5
+        lxvd2x     6, 11, 5
+        lxvd2x     7, 12, 5
+        lxvd2x     8, 15, 5
+        lxvd2x     9, 16, 5
+        lxvd2x     10, 17, 5
+        lxvd2x     11, 18, 5
+        xxpermdi 32+14, 5, 4, 3
+        xxpermdi     0, 5, 4, 0
+        xxpermdi 32+15, 7, 6, 3
+        xxpermdi     1, 7, 6, 0
+        xxpermdi 32+16, 9, 8, 3
+        xxpermdi     2, 9, 8, 0
+        xxpermdi 32+17, 11, 10, 3
+        xxpermdi     3, 11, 10, 0
+.endm
+
+/*
+ * _layer_reduce_4x- common code for layer 6 and 7
+ *
+ * Assuming input registers and output vectors as follows,
+ *   input offsets - curr (0, r11, r15, r17), peer (r10, r12, r16, r18)
+ *   output vectors - v20, v21, v22, v23, v24, v25, v26
+ */
+.macro _layer_reduce_4x
+        zeta_scalar_mul 14, V_Z1, 20, 21       /* peer * zeta */
+        zeta_scalar_mul 15, V_Z2, 22, 23       /* peer * zeta */
+        zeta_scalar_mul 16, V_Z3, 24, 25       /* peer * zeta */
+        zeta_scalar_mul 17, V_Z4, 26, 27       /* peer * zeta */
+        Barrett_reduce_delayed 20, 21, 14
+        Barrett_reduce_delayed 22, 23, 15
+        Barrett_reduce_delayed 24, 25, 16
+        Barrett_reduce_delayed 26, 27, 17
+        reduce_once_4x 14, 15, 16, 17
+
+        /* Load curr */
+        xxlor     32+10, 0, 0
+        xxlor     32+11, 1, 1
+        xxlor     32+12, 2, 2
+        xxlor     32+13, 3, 3
+
+        /* even - curr, odd - peer, odd is the updated peer */
+        /* Compute (even - odd + kPrime) */
+        vsubuhm  0, 10, 14
+        vadduhm  21, 0, V_kPrime16
+        vadduhm  20, 14, 10
+        vsubuhm  0, 11, 15
+        vadduhm  23, 0, V_kPrime16
+        vadduhm  22, 15, 11
+        vsubuhm  0, 12, 16
+        vadduhm  25, 0, V_kPrime16
+        vadduhm  24, 16, 12
+        vsubuhm  0, 13, 17
+        vadduhm  27, 0, V_kPrime16
+        vadduhm  26, 17, 13
+.endm
+
+.macro _ntt_layer6_reduce_4x
+        lvx     V_Z1, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z2, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z3, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z4, 0, 14
+        addi  14, 14, 16
+        _load_transpose_layer6
+        _layer_reduce_4x
+.endm
+
+/*
+ * NTT layer 6,  Offset between legs = 4.
+ */
+.macro NTT_Layer6_4x
+        _ntt_layer6_reduce_4x
+        reduce_once_4x 20, 22, 24, 26
+        reduce_once_4x 21, 23, 25, 27
+
+        xxpermdi 32+6, 32+20, 32+21, 3
+        xxpermdi 32+7, 32+20, 32+21, 0
+        xxpermdi 32+8, 32+22, 32+23, 3
+        xxpermdi 32+9, 32+22, 32+23, 0
+        xxpermdi 32+10, 32+24, 32+25, 3
+        xxpermdi 32+11, 32+24, 32+25, 0
+        xxpermdi 32+12, 32+26, 32+27, 3
+        xxpermdi 32+13, 32+26, 32+27, 0
+        delayed_writes_curr_peer 6, 7, 8, 9, 10, 11, 12, 13
+        addi  5, 5, 128
+.endm
+
+/* Layer 7 layout -
+ *  each load contains 2 curr and 2 peer elements.
+ *    -> curr1 curr1 peer1 peer1 curr2 curr2 peer2 peer2
+ *  vmrgew and vmrgow -> 8 curr elements and 8 peer elements
+ */
+.macro _load_transpose_layer7
+        lxvd2x     32+0, 0, 5
+        lxvd2x     32+6, 10, 5
+        lxvd2x     32+7, 11, 5
+        lxvd2x     32+8, 12, 5
+        lxvd2x     32+9, 15, 5
+        lxvd2x     32+10, 16, 5
+        lxvd2x     32+11, 17, 5
+        lxvd2x     32+12, 18, 5
+        vmrgew 14, 0, 6
+        vmrgow  0, 0, 6
+        vmrgew 15, 7, 8
+        vmrgow  6, 7, 8
+        vmrgew 16, 9, 10
+        vmrgow  8, 9, 10
+        vmrgew 17, 11, 12
+        vmrgow 13, 11, 12
+        xxlor  0, 32+0, 32+0
+        xxlor  1, 32+6, 32+6
+        xxlor  2, 32+8, 32+8
+        xxlor  3, 32+13, 32+13
+.endm
+
+.macro _ntt_layer7_reduce_4x
+        lvx     V_Z1, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z2, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z3, 0, 14
+        addi  14, 14, 16
+        lvx     V_Z4, 0, 14
+        addi  14, 14, 16
+        _load_transpose_layer7
+        _layer_reduce_4x
+.endm
+
+/*
+ * NTT layer 7,  Offset between legs = 2.
+ */
+.macro NTT_Layer7_4x
+        _ntt_layer7_reduce_4x
+        reduce_once_4x 20, 22, 24, 26
+        reduce_once_4x 21, 23, 25, 27
+
+        vmrgow  6, 21, 20
+        vmrgew  7, 21, 20
+        vmrgow  8, 23, 22
+        vmrgew  9, 23, 22
+        vmrgow  10, 25, 24
+        vmrgew  11, 25, 24
+        vmrgow  12, 27, 26
+        vmrgew  13, 27, 26
+        delayed_writes_curr_peer 7, 6, 9, 8, 11, 10, 13, 12
+        addi  5, 5, 128
+.endm
+
+.macro Load_consts
+        addis   10,2,ntt_consts@toc@ha
+        addi    10,10,ntt_consts@toc@l
+        lvx V_kPrime16, 0, 10
+        li  7, 16
+        lvx V_kPrime32, 7, 10
+        li  7, 32
+        lvx V_kBarrettMultiplier, 7, 10
+        li  7, 48
+        lvx V_kBarrettShift, 7, 10
+        li  7, 64
+        lvx V_kInverseDegree, 7, 10
+.endm
+
+/* ===================================================================== */
+/*
+ * mlkem_ntt_ppc(int16_t *r)
+ *   Compute forward NTT based on the following 7 layers -
+ *     len = 128, 64, 32, 16, 8, 4, 2.
+ *
+ *   Each layer compute the coefficients on 2 legs, start and start + len*2 offsets.
+ *
+ *   leg 1                        leg 2
+ *   -----                        -----
+ *   start                        start+len*2
+ *   start+next                   start+len*2+next
+ *   start+next+next              start+len*2+next+next
+ *   start+next+next+next         start+len*2+next+next+next
+ *
+ *   The resulting coefficients then store back to each leg's offset.
+ *
+ *   Each vector has the same corresponding zeta except len=4 and len=2.
+ *
+ *   len=4 has 4-4 layout which means every 4 16-bit coefficients has the same zeta.
+ *   and len=2 has 2-2-2-2 layout which means every 2 16-bit coefficients has the same zeta.
+ *   e.g.
+ *         coeff vector    a1   a2   a3  a4  a5  a6  a7  a8
+ *         zeta  vector    z1   z1   z2  z2  z3  z3  z4  z4
+ *
+ *   For len=4 and len=2, each vector will get permuted to leg1 and leg2. Zeta is
+ *   pre-arranged for the leg1 and leg2.  After the computation, each vector needs
+ *   to transpose back to its original 4-4 or 2-2-2-2 layout.
+ *
+ */
+.global mlkem_ntt_ppc
+.align 4
+mlkem_ntt_ppc:
+        SAVE_REGS
+
+        Load_consts
+        addis   8,2,mlkem_ntt_zetas@toc@ha
+        addi    8,8,mlkem_ntt_zetas@toc@l
+        addi    14, 8, ZETA_NTT_OFFSET
+
+.align 4
+        /*
+         * Layer 1. len = 128
+         */
+        mr      5, 3
+        li      10, 256        // offset to next peer
+        li      11, 16
+        li      12, 256+16
+        li      15, 32
+        li      16, 256+32
+        li      17, 48
+        li      18, 256+48
+
+        lvx     V_ZETA, 0, 14
+        addi  14, 14, 16
+        NTT_Layer1_4x
+        NTT_Layer1_4x
+        NTT_Layer1_4x
+        NTT_Layer1_4x
+
+.align 4
+        /*
+         * Layer 2. len = 64
+         */
+        mr      5, 3
+        li      10, 128        // offset to next peer
+        li      11, 16
+        li      12, 128+16
+        li      15, 32
+        li      16, 128+32
+        li      17, 48
+        li      18, 128+48
+
+        lvx     V_ZETA, 0, 14
+        addi  14, 14, 16
+        NTT_Layer2_4x
+        NTT_Layer2_4x
+        addi  5, 5, 128
+        lvx     V_ZETA, 0, 14
+        addi  14, 14, 16
+        NTT_Layer2_4x
+        NTT_Layer2_4x
+        addi  5, 5, 128
+
+.align 4
+        /*
+         * Layer 3. len = 32
+         */
+        mr      5, 3
+        li      10, 64        // offset to next peer
+        li      11, 16
+        li      12, 64+16
+        li      15, 32
+        li      16, 64+32
+        li      17, 48
+        li      18, 64+48
+
+        NTT_Layer3_4x
+        NTT_Layer3_4x
+        NTT_Layer3_4x
+        NTT_Layer3_4x
+
+.align 4
+        /*
+         * Layer 4. len = 16
+         */
+        mr      5, 3
+        li      10, 32        // offset to next peer
+        li      11, 16
+        li      12, 32+16
+        li      15, 64
+        li      16, 64+32
+        li      17, 64+16
+        li      18, 96+16
+
+        NTT_Layer4_4x
+        NTT_Layer4_4x
+        NTT_Layer4_4x
+        NTT_Layer4_4x
+
+.align 4
+        /*
+         * Layer 5. len = 8
+         */
+        mr      5, 3
+        li      10, 16        // offset to next peer
+        li      11, 32
+        li      12, 48
+        li      15, 64
+        li      16, 80
+        li      17, 96
+        li      18, 112
+
+        NTT_Layer5_4x
+        NTT_Layer5_4x
+        NTT_Layer5_4x
+        NTT_Layer5_4x
+
+.align 4
+        /*
+         * Layer 6. len = 4
+         *    Load zeta vectors in 4-4 layout
+         */
+        mr      5, 3
+
+        NTT_Layer6_4x
+        NTT_Layer6_4x
+        NTT_Layer6_4x
+        NTT_Layer6_4x
+
+.align 4
+        /*
+         * Layer 7. len = 2
+         *    Load zeta vectors in 2-2-2-2 layout
+         */
+        mr      5, 3
+        li      10, 16
+
+        NTT_Layer7_4x
+        NTT_Layer7_4x
+        NTT_Layer7_4x
+        NTT_Layer7_4x
+
+        RESTORE_REGS
+        blr
+.size     mlkem_ntt_ppc,.-mlkem_ntt_ppc
+
+.rodata
+.align 4
+ntt_consts:
+.short kPrime, kPrime, kPrime, kPrime, kPrime, kPrime, kPrime, kPrime
+.long  kPrime, kPrime, kPrime, kPrime
+.long  kBarrettMultiplier, kBarrettMultiplier, kBarrettMultiplier, kBarrettMultiplier
+.long  kBarrettShift, 0, kBarrettShift, 0
+.short kInverseDegree, kInverseDegree, kInverseDegree, kInverseDegree, kInverseDegree, kInverseDegree, kInverseDegree , kInverseDegree
+
+/* zetas */
+mlkem_ntt_zetas:
+/* For ntt len = 128, 64, 32, 16, 8 */
+.short  1729, 1729, 1729, 1729, 1729, 1729, 1729, 1729
+.short  2580, 2580, 2580, 2580, 2580, 2580, 2580, 2580
+.short  3289, 3289, 3289, 3289, 3289, 3289, 3289, 3289
+.short  2642, 2642, 2642, 2642, 2642, 2642, 2642, 2642
+.short  630, 630, 630, 630, 630, 630, 630, 630
+.short  1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897
+.short  848, 848, 848, 848, 848, 848, 848, 848
+.short  1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062
+.short  1919, 1919, 1919, 1919, 1919, 1919, 1919, 1919
+.short  193, 193, 193, 193, 193, 193, 193, 193
+.short  797, 797, 797, 797, 797, 797, 797, 797
+.short  2786, 2786, 2786, 2786, 2786, 2786, 2786, 2786
+.short  3260, 3260, 3260, 3260, 3260, 3260, 3260, 3260
+.short  569, 569, 569, 569, 569, 569, 569, 569
+.short  1746, 1746, 1746, 1746, 1746, 1746, 1746, 1746
+.short  296, 296, 296, 296, 296, 296, 296, 296
+.short  2447, 2447, 2447, 2447, 2447, 2447, 2447, 2447
+.short  1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339
+.short  1476, 1476, 1476, 1476, 1476, 1476, 1476, 1476
+.short  3046, 3046, 3046, 3046, 3046, 3046, 3046, 3046
+.short  56, 56, 56, 56, 56, 56, 56, 56
+.short  2240, 2240, 2240, 2240, 2240, 2240, 2240, 2240
+.short  1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333
+.short  1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426
+.short  2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094
+.short  535, 535, 535, 535, 535, 535, 535, 535
+.short  2882, 2882, 2882, 2882, 2882, 2882, 2882, 2882
+.short  2393, 2393, 2393, 2393, 2393, 2393, 2393, 2393
+.short  2879, 2879, 2879, 2879, 2879, 2879, 2879, 2879
+.short  1974, 1974, 1974, 1974, 1974, 1974, 1974, 1974
+.short  821, 821, 821, 821, 821, 821, 821, 821
+/* For ntt len = 4 */
+.short  289, 289, 289, 289, 331, 331, 331, 331
+.short  3253, 3253, 3253, 3253, 1756, 1756, 1756, 1756
+.short  1197, 1197, 1197, 1197, 2304, 2304, 2304, 2304
+.short  2277, 2277, 2277, 2277, 2055, 2055, 2055, 2055
+.short  650, 650, 650, 650, 1977, 1977, 1977, 1977
+.short  2513, 2513, 2513, 2513, 632, 632, 632, 632
+.short  2865, 2865, 2865, 2865, 33, 33, 33, 33
+.short  1320, 1320, 1320, 1320, 1915, 1915, 1915, 1915
+.short  2319, 2319, 2319, 2319, 1435, 1435, 1435, 1435
+.short  807, 807, 807, 807, 452, 452, 452, 452
+.short  1438, 1438, 1438, 1438, 2868, 2868, 2868, 2868
+.short  1534, 1534, 1534, 1534, 2402, 2402, 2402, 2402
+.short  2647, 2647, 2647, 2647, 2617, 2617, 2617, 2617
+.short  1481, 1481, 1481, 1481, 648, 648, 648, 648
+.short  2474, 2474, 2474, 2474, 3110, 3110, 3110, 3110
+.short  1227, 1227, 1227, 1227, 910, 910, 910, 910
+/*
+ * For ntt Len=2
+ * reorder zeta array, (1, 2, 3, 4) -> (4, 2, 3, 1)
+ * Transpose z[0], z[1], z[2], z[3]
+ *    -> z[4], z[4], z[2], z[2], z[3], z[3], z[1], z[1]
+ */
+.short  2649, 2649, 2761, 2761, 583, 583, 17, 17
+.short  1100, 1100, 723, 723, 2288, 2288, 1637, 1637
+.short  233, 233, 2662, 2662, 3281, 3281, 1409, 1409
+.short  3050, 3050, 2156, 2156, 3015, 3015, 756, 756
+.short  1789, 1789, 1651, 1651, 2789, 2789, 1703, 1703
+.short  2687, 2687, 952, 952, 1461, 1461, 1847, 1847
+.short  2388, 2388, 2308, 2308, 2437, 2437, 939, 939
+.short  641, 641, 2337, 2337, 268, 268, 733, 733
+.short  3220, 3220, 2298, 2298, 2037, 2037, 1584, 1584
+.short  1645, 1645, 2549, 2549, 2090, 2090, 375, 375
+.short  757, 757, 319, 319, 2773, 2773, 1063, 1063
+.short  2594, 2594, 561, 561, 2466, 2466, 2099, 2099
+.short  1026, 1026, 1092, 1092, 403, 403, 2804, 2804
+.short  886, 886, 2150, 2150, 2775, 2775, 1143, 1143
+.short  1029, 1029, 1212, 1212, 1874, 1874, 1722, 1722
+.short  2154, 2154, 2935, 2935, 885, 885, 2110, 2110
diff --git a/deps/openssl/openssl/crypto/ml_kem/asm/mlkem_ppc_macros_asm.inc b/deps/openssl/openssl/crypto/ml_kem/asm/mlkem_ppc_macros_asm.inc
new file mode 100644
index 00000000000..2a52e14527f
--- /dev/null
+++ b/deps/openssl/openssl/crypto/ml_kem/asm/mlkem_ppc_macros_asm.inc
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+/*
+ * Copyright IBM Corp. 2025, 2026
+ *
+ * ===================================================================================
+ * Written by Danny Tsen <dtsen@us.ibm.com>
+ */
+
+/* ===================================================================== */
+/* Barrett reduce vectors and constants */
+#define V_kPrime16 1
+#define V_kPrime32 2
+#define V_kBarrettMultiplier 3
+#define V_kBarrettShift 4
+#define V_kInverseDegree 5
+
+#define ML_KEM_PRIME 3329
+#define kPrime 3329
+#define kBarrettShift 24
+#define kBarrettMultiplier 5039
+#define kInverseDegree 3303
+
+/*
+ * reduce_once reduces 0 <= x < 2*kPrime, mod kPrime.
+ *
+ * Subtract |q| if the input is larger, without exposing a side-channel,
+ * avoiding the "clangover" attack.  See |constish_time_non_zero| for a
+ * discussion on why the value barrier is by default omitted.
+ */
+.macro reduce_once _x
+        vsubuhm  6, \_x, V_kPrime16
+        vcmpgtuh 7, V_kPrime16, 6
+        xxsel    32+\_x, 32+\_x, 32+6, 32+7
+.endm
+
+/* reduce_once_4x: pipeline reduce_once in 4x */
+.macro reduce_once_4x _x1, _x2, _x3, _x4
+        vsubuhm  6, \_x1, V_kPrime16
+        vsubuhm  8, \_x2, V_kPrime16
+        vsubuhm  10, \_x3, V_kPrime16
+        vsubuhm  12, \_x4, V_kPrime16
+        vcmpgtuh 7, V_kPrime16, 6
+        vcmpgtuh 9, V_kPrime16, 8
+        vcmpgtuh 11, V_kPrime16, 10
+        vcmpgtuh 13, V_kPrime16, 12
+        xxsel    32+\_x1, 32+\_x1, 32+6, 32+7
+        xxsel    32+\_x2, 32+\_x2, 32+8, 32+9
+        xxsel    32+\_x3, 32+\_x3, 32+10, 32+11
+        xxsel    32+\_x4, 32+\_x4, 32+12, 32+13
+.endm
+
+/* scalar multiplication = coeff * zeta */
+.macro zeta_scalar_mul _coeff, _zeta, _x0, _x1
+        vmulouh  6, \_coeff, \_zeta
+        vmuleuh  7, \_coeff, \_zeta
+        xxmrglw  32+\_x0, 32+7, 32+6
+        xxmrghw  32+\_x1, 32+7, 32+6
+.endm
+
+/*
+ * Constant-time reduce x mod kPrime using Barrett reduction. x must be less
+ * than kPrime + 2 * kPrime^2.  This is sufficient to reduce a product of
+ * two already reduced u_int16 values, in fact it is sufficient for each
+ * to be less than 2^12, because (kPrime * (2 * kPrime + 1)) > 2^24.
+ *
+ * This macro handles 8 coefficients elements.
+ * Input vectors: x0, x1
+ * Output vector:  updated peer
+ * Scratch vectors: v6, v7, v10, v11, v12, v13
+ *
+ * Barrett_reduce_delayed-
+ *    We delay reduce_once in 4x pipeline in each layer
+ */
+.macro Barrett_reduce_delayed _x0, _x1, _updated_peer
+        /* uint64_t product = (uint64_t)x * kBarrettMultiplier; */
+        vmulouw  10, \_x0, V_kBarrettMultiplier
+        vmuleuw  11, \_x0, V_kBarrettMultiplier
+        vmulouw  12, \_x1, V_kBarrettMultiplier
+        vmuleuw  13, \_x1, V_kBarrettMultiplier
+
+        /* uint32_t quotient = (uint32_t)(product >> kBarrettShift); */
+        vsrd 10, 10, V_kBarrettShift
+        vsrd 11, 11, V_kBarrettShift
+        vsrd 12, 12, V_kBarrettShift
+        vsrd 13, 13, V_kBarrettShift
+        vmrgow  6, 11, 10
+        vmrgow  7, 13, 12
+
+        /* uint32_t remainder = x - quotient * kPrime; */
+        vmuluwm  10, 6, V_kPrime32
+        vmuluwm  11, 7, V_kPrime32
+        vsubuwm  6, \_x0, 10
+        vsubuwm  7, \_x1, 11
+        vpkuwus  \_updated_peer, 7, 6
+.endm
+
+.macro Barrett_reduce _x0, _x1, _updated_peer
+        Barrett_reduce_delayed \_x0, \_x1, \_updated_peer
+        reduce_once \_updated_peer
+.endm
+
+/*
+ * Barrett_reduce_delayed_2x - 2 Barrett_reduce_delayed in parallel
+ *   This is only 2x since we don't have enough vectors to support 4x pipeline.
+ */
+.macro Barrett_reduce_delayed_2x _x0, _x1, _y0, _y1, _updated_peer1, _updated_peer2
+        /* uint64_t product = (uint64_t)x * kBarrettMultiplier; */
+        vmulouw  10, \_x0, V_kBarrettMultiplier
+        vmuleuw  11, \_x0, V_kBarrettMultiplier
+        vmulouw  12, \_x1, V_kBarrettMultiplier
+        vmuleuw  13, \_x1, V_kBarrettMultiplier
+
+        vmulouw  14, \_y0, V_kBarrettMultiplier
+        vmuleuw  15, \_y0, V_kBarrettMultiplier
+        vmulouw  16, \_y1, V_kBarrettMultiplier
+        vmuleuw  17, \_y1, V_kBarrettMultiplier
+
+        /* uint32_t quotient = (uint32_t)(product >> kBarrettShift); */
+        vsrd 10, 10, V_kBarrettShift
+        vsrd 11, 11, V_kBarrettShift
+        vsrd 12, 12, V_kBarrettShift
+        vsrd 13, 13, V_kBarrettShift
+
+        vsrd 14, 14, V_kBarrettShift
+        vsrd 15, 15, V_kBarrettShift
+        vsrd 16, 16, V_kBarrettShift
+        vsrd 17, 17, V_kBarrettShift
+         vmrgow  6, 11, 10
+         vmrgow  7, 13, 12
+         vmrgow  12, 15, 14
+         vmrgow  13, 17, 16
+
+        /* uint32_t remainder = x - quotient * kPrime; */
+        vmuluwm  10, 6, V_kPrime32
+        vmuluwm  11, 7, V_kPrime32
+        vmuluwm  14, 12, V_kPrime32
+        vmuluwm  15, 13, V_kPrime32
+         vsubuwm  6, \_x0, 10
+         vsubuwm  7, \_x1, 11
+         vsubuwm  16, \_y0, 14
+         vsubuwm  17, \_y1, 15
+        vpkuwus  \_updated_peer1, 7, 6
+        vpkuwus  \_updated_peer2, 17, 16
+.endm
+/* ===================================================================== */
diff --git a/deps/openssl/openssl/crypto/ml_kem/build.info b/deps/openssl/openssl/crypto/ml_kem/build.info
index e2ea88b35dc..e5937019185 100644
--- a/deps/openssl/openssl/crypto/ml_kem/build.info
+++ b/deps/openssl/openssl/crypto/ml_kem/build.info
@@ -1,6 +1,29 @@
 LIBS = ../../libcrypto

+$MLKEMASM=
+IF[{- !$disabled{asm} -}]
+  $MLKEMDEF_ppc64=MLKEM_NTT_PPC_ASM
+
+  IF[{- $target{sys_id} ne "AIX" && $target{sys_id} ne "MACOSX" -}]
+    $MLKEMASM_ppc64=asm/mlkem_ntt_ppc64le.S asm/mlkem_intt_ppc64le.S
+  ENDIF
+
+  # Now that we have defined all the arch specific variables, use the
+  # appropriate one, and define the appropriate macros
+  IF[$MLKEMASM_{- $target{asm_arch} -}]
+    $MLKEMASM=$MLKEMASM_{- $target{asm_arch} -}
+    $MLKEMDEF=$MLKEMDEF_{- $target{asm_arch} -}
+  ENDIF
+ENDIF
+
+$COMMON=ml_kem.c $MLKEMASM
+
 IF[{- !$disabled{'ml-kem'} -}]
-    SOURCE[../../libcrypto]=ml_kem.c
-    SOURCE[../../providers/libfips.a]=ml_kem.c
+    SOURCE[../../libcrypto]=$COMMON
+    SOURCE[../../providers/libfips.a]=$COMMON
 ENDIF
+
+# Implementations are now spread across several libraries, so the defines
+# need to be applied to all affected libraries and modules.
+DEFINE[../../libcrypto]=$MLKEMDEF
+DEFINE[../../providers/libfips.a]=$MLKEMDEF
diff --git a/deps/openssl/openssl/crypto/ml_kem/ml_kem.c b/deps/openssl/openssl/crypto/ml_kem/ml_kem.c
index 6c3141ca2d3..60d3fd2af63 100644
--- a/deps/openssl/openssl/crypto/ml_kem/ml_kem.c
+++ b/deps/openssl/openssl/crypto/ml_kem/ml_kem.c
@@ -15,10 +15,6 @@
 #include "internal/constant_time.h"
 #include "internal/sha3.h"

-#if defined(OPENSSL_CONSTANT_TIME_VALIDATION)
-#include <valgrind/memcheck.h>
-#endif
-
 #if ML_KEM_SEED_BYTES != ML_KEM_SHARED_SECRET_BYTES + ML_KEM_RANDOM_BYTES
 #error "ML-KEM keygen seed length != shared secret + random bytes length"
 #endif
@@ -47,29 +43,6 @@
 #define SHAKE128_BLOCKSIZE SHA3_BLOCKSIZE(128)
 #endif

-/*
- * Return whether a value that can only be 0 or 1 is non-zero, in constant time
- * in practice!  The return value is a mask that is all ones if true, and all
- * zeros otherwise (twos-complement arithmetic assumed for unsigned values).
- *
- * Although this is used in constant-time selects, we omit a value barrier
- * here.  Value barriers impede auto-vectorization (likely because it forces
- * the value to transit through a general-purpose register). On AArch64, this
- * is a difference of 2x.
- *
- * We usually add value barriers to selects because Clang turns consecutive
- * selects with the same condition into a branch instead of CMOV/CSEL. This
- * condition does not occur in Kyber, so omitting it seems to be safe so far,
- * but see |cbd_2|, |cbd_3|, where reduction needs to be specialised to the
- * sign of the input, rather than adding |q| in advance, and using the generic
- * |reduce_once|.  (David Benjamin, Chromium)
- */
-#if 0
-#define constish_time_non_zero(b) (~constant_time_is_zero(b));
-#else
-#define constish_time_non_zero(b) (0u - (b))
-#endif
-
 /*
  * The scalar rejection-sampling buffer size needs to be a multiple of 12, but
  * is otherwise arbitrary, the preferred block size matches the internal buffer
@@ -94,24 +67,31 @@ typedef struct ossl_ml_kem_scalar_st {
 } scalar;

 /* Key material allocation layout */
-#define DECLARE_ML_KEM_KEYDATA(name, rank, private_sz)               \
-    struct name##_alloc {                                            \
-        /* Public vector |t| */                                      \
-        scalar tbuf[(rank)];                                         \
-        /* Pre-computed matrix |m| (FIPS 203 |A| transpose) */       \
-        scalar mbuf[(rank) * (rank)] /* optional private key data */ \
-            private_sz                                               \
+#define DECLARE_ML_KEM_PUBKEYDATA(name, rank)                  \
+    struct name##_alloc {                                      \
+        /* Public vector |t| */                                \
+        scalar tbuf[(rank)];                                   \
+        /* Pre-computed matrix |m| (FIPS 203 |A| transpose) */ \
+        scalar mbuf[(rank) * (rank)];                          \
+    }
+
+#define DECLARE_ML_KEM_PRVKEYDATA(name, rank)  \
+    struct name##_alloc {                      \
+        scalar sbuf[rank];                     \
+        uint8_t zbuf[2 * ML_KEM_RANDOM_BYTES]; \
     }

 /* Declare variant-specific public and private storage */
 #define DECLARE_ML_KEM_VARIANT_KEYDATA(bits)                        \
-    DECLARE_ML_KEM_KEYDATA(pubkey_##bits, ML_KEM_##bits##_RANK, ;); \
-    DECLARE_ML_KEM_KEYDATA(prvkey_##bits, ML_KEM_##bits##_RANK, ; scalar sbuf[ML_KEM_##bits##_RANK]; uint8_t zbuf[2 * ML_KEM_RANDOM_BYTES];)
+    DECLARE_ML_KEM_PUBKEYDATA(pubkey_##bits, ML_KEM_##bits##_RANK); \
+    DECLARE_ML_KEM_PRVKEYDATA(prvkey_##bits, ML_KEM_##bits##_RANK)
+
 DECLARE_ML_KEM_VARIANT_KEYDATA(512);
 DECLARE_ML_KEM_VARIANT_KEYDATA(768);
 DECLARE_ML_KEM_VARIANT_KEYDATA(1024);
 #undef DECLARE_ML_KEM_VARIANT_KEYDATA
-#undef DECLARE_ML_KEM_KEYDATA
+#undef DECLARE_ML_KEM_PUBKEYDATA
+#undef DECLARE_ML_KEM_PRVKEYDATA

 typedef __owur int (*CBD_FUNC)(scalar *out, uint8_t in[ML_KEM_RANDOM_BYTES + 1],
     EVP_MD_CTX *mdctx, const ML_KEM_KEY *key);
@@ -140,30 +120,6 @@ static void scalar_encode(uint8_t *out, const scalar *s, int bits);
 #define V_SCALAR_BYTES(b) ((DEGREE / 8) * ML_KEM_##b##_DV)
 #define CTEXT_BYTES(b) (U_VECTOR_BYTES(b) + V_SCALAR_BYTES(b))

-#if defined(OPENSSL_CONSTANT_TIME_VALIDATION)
-
-/*
- * CONSTTIME_SECRET takes a pointer and a number of bytes and marks that region
- * of memory as secret. Secret data is tracked as it flows to registers and
- * other parts of a memory. If secret data is used as a condition for a branch,
- * or as a memory index, it will trigger warnings in valgrind.
- */
-#define CONSTTIME_SECRET(ptr, len) VALGRIND_MAKE_MEM_UNDEFINED(ptr, len)
-
-/*
- * CONSTTIME_DECLASSIFY takes a pointer and a number of bytes and marks that
- * region of memory as public. Public data is not subject to constant-time
- * rules.
- */
-#define CONSTTIME_DECLASSIFY(ptr, len) VALGRIND_MAKE_MEM_DEFINED(ptr, len)
-
-#else
-
-#define CONSTTIME_SECRET(ptr, len)
-#define CONSTTIME_DECLASSIFY(ptr, len)
-
-#endif
-
 /*
  * Indices of slots in the vinfo tables below
  */
@@ -188,7 +144,8 @@ static const ML_KEM_VINFO vinfo_map[3] = {
         ML_KEM_512_RANK,
         ML_KEM_512_DU,
         ML_KEM_512_DV,
-        ML_KEM_512_SECBITS },
+        ML_KEM_512_SECBITS,
+        ML_KEM_512_SECURITY_CATEGORY },
     { "ML-KEM-768",
         PRVKEY_BYTES(768),
         sizeof(struct prvkey_768_alloc),
@@ -202,7 +159,8 @@ static const ML_KEM_VINFO vinfo_map[3] = {
         ML_KEM_768_RANK,
         ML_KEM_768_DU,
         ML_KEM_768_DV,
-        ML_KEM_768_SECBITS },
+        ML_KEM_768_SECBITS,
+        ML_KEM_768_SECURITY_CATEGORY },
     { "ML-KEM-1024",
         PRVKEY_BYTES(1024),
         sizeof(struct prvkey_1024_alloc),
@@ -216,7 +174,8 @@ static const ML_KEM_VINFO vinfo_map[3] = {
         ML_KEM_1024_RANK,
         ML_KEM_1024_DU,
         ML_KEM_1024_DV,
-        ML_KEM_1024_SECBITS }
+        ML_KEM_1024_SECBITS,
+        ML_KEM_1024_SECURITY_CATEGORY }
 };

 /*
@@ -249,134 +208,22 @@ static const uint16_t kInverseDegree = INVERSE_DEGREE;
  * kNTTRoots = [pow(17, bitreverse(i), p) for i in range(128)]
  */
 static const uint16_t kNTTRoots[128] = {
-    1,
-    1729,
-    2580,
-    3289,
-    2642,
-    630,
-    1897,
-    848,
-    1062,
-    1919,
-    193,
-    797,
-    2786,
-    3260,
-    569,
-    1746,
-    296,
-    2447,
-    1339,
-    1476,
-    3046,
-    56,
-    2240,
-    1333,
-    1426,
-    2094,
-    535,
-    2882,
-    2393,
-    2879,
-    1974,
-    821,
-    289,
-    331,
-    3253,
-    1756,
-    1197,
-    2304,
-    2277,
-    2055,
-    650,
-    1977,
-    2513,
-    632,
-    2865,
-    33,
-    1320,
-    1915,
-    2319,
-    1435,
-    807,
-    452,
-    1438,
-    2868,
-    1534,
-    2402,
-    2647,
-    2617,
-    1481,
-    648,
-    2474,
-    3110,
-    1227,
-    910,
-    17,
-    2761,
-    583,
-    2649,
-    1637,
-    723,
-    2288,
-    1100,
-    1409,
-    2662,
-    3281,
-    233,
-    756,
-    2156,
-    3015,
-    3050,
-    1703,
-    1651,
-    2789,
-    1789,
-    1847,
-    952,
-    1461,
-    2687,
-    939,
-    2308,
-    2437,
-    2388,
-    733,
-    2337,
-    268,
-    641,
-    1584,
-    2298,
-    2037,
-    3220,
-    375,
-    2549,
-    2090,
-    1645,
-    1063,
-    319,
-    2773,
-    757,
-    2099,
-    561,
-    2466,
-    2594,
-    2804,
-    1092,
-    403,
-    1026,
-    1143,
-    2150,
-    2775,
-    886,
-    1722,
-    1212,
-    1874,
-    1029,
-    2110,
-    2935,
-    885,
-    2154,
+    0x001, 0x6c1, 0xa14, 0xcd9, 0xa52, 0x276, 0x769, 0x350,
+    0x426, 0x77f, 0x0c1, 0x31d, 0xae2, 0xcbc, 0x239, 0x6d2,
+    0x128, 0x98f, 0x53b, 0x5c4, 0xbe6, 0x038, 0x8c0, 0x535,
+    0x592, 0x82e, 0x217, 0xb42, 0x959, 0xb3f, 0x7b6, 0x335,
+    0x121, 0x14b, 0xcb5, 0x6dc, 0x4ad, 0x900, 0x8e5, 0x807,
+    0x28a, 0x7b9, 0x9d1, 0x278, 0xb31, 0x021, 0x528, 0x77b,
+    0x90f, 0x59b, 0x327, 0x1c4, 0x59e, 0xb34, 0x5fe, 0x962,
+    0xa57, 0xa39, 0x5c9, 0x288, 0x9aa, 0xc26, 0x4cb, 0x38e,
+    0x011, 0xac9, 0x247, 0xa59, 0x665, 0x2d3, 0x8f0, 0x44c,
+    0x581, 0xa66, 0xcd1, 0x0e9, 0x2f4, 0x86c, 0xbc7, 0xbea,
+    0x6a7, 0x673, 0xae5, 0x6fd, 0x737, 0x3b8, 0x5b5, 0xa7f,
+    0x3ab, 0x904, 0x985, 0x954, 0x2dd, 0x921, 0x10c, 0x281,
+    0x630, 0x8fa, 0x7f5, 0xc94, 0x177, 0x9f5, 0x82a, 0x66d,
+    0x427, 0x13f, 0xad5, 0x2f5, 0x833, 0x231, 0x9a2, 0xa22,
+    0xaf4, 0x444, 0x193, 0x402, 0x477, 0x866, 0xad7, 0x376,
+    0x6ba, 0x4bc, 0x752, 0x405, 0x83e, 0xb77, 0x375, 0x86a
 };

 /*
@@ -386,134 +233,22 @@ static const uint16_t kNTTRoots[128] = {
  *  0, 64, 65, ..., 127, 32, 33, ..., 63, 16, 17, ..., 31, 8, 9, ...
  */
 static const uint16_t kInverseNTTRoots[128] = {
-    1,
-    1175,
-    2444,
-    394,
-    1219,
-    2300,
-    1455,
-    2117,
-    1607,
-    2443,
-    554,
-    1179,
-    2186,
-    2303,
-    2926,
-    2237,
-    525,
-    735,
-    863,
-    2768,
-    1230,
-    2572,
-    556,
-    3010,
-    2266,
-    1684,
-    1239,
-    780,
-    2954,
-    109,
-    1292,
-    1031,
-    1745,
-    2688,
-    3061,
-    992,
-    2596,
-    941,
-    892,
-    1021,
-    2390,
-    642,
-    1868,
-    2377,
-    1482,
-    1540,
-    540,
-    1678,
-    1626,
-    279,
-    314,
-    1173,
-    2573,
-    3096,
-    48,
-    667,
-    1920,
-    2229,
-    1041,
-    2606,
-    1692,
-    680,
-    2746,
-    568,
-    3312,
-    2419,
-    2102,
-    219,
-    855,
-    2681,
-    1848,
-    712,
-    682,
-    927,
-    1795,
-    461,
-    1891,
-    2877,
-    2522,
-    1894,
-    1010,
-    1414,
-    2009,
-    3296,
-    464,
-    2697,
-    816,
-    1352,
-    2679,
-    1274,
-    1052,
-    1025,
-    2132,
-    1573,
-    76,
-    2998,
-    3040,
-    2508,
-    1355,
-    450,
-    936,
-    447,
-    2794,
-    1235,
-    1903,
-    1996,
-    1089,
-    3273,
-    283,
-    1853,
-    1990,
-    882,
-    3033,
-    1583,
-    2760,
-    69,
-    543,
-    2532,
-    3136,
-    1410,
-    2267,
-    2481,
-    1432,
-    2699,
-    687,
-    40,
-    749,
-    1600,
+    0x001, 0x497, 0x98c, 0x18a, 0x4c3, 0x8fc, 0x5af, 0x845,
+    0x647, 0x98b, 0x22a, 0x49b, 0x88a, 0x8ff, 0xb6e, 0x8bd,
+    0x20d, 0x2df, 0x35f, 0xad0, 0x4ce, 0xa0c, 0x22c, 0xbc2,
+    0x8da, 0x694, 0x4d7, 0x30c, 0xb8a, 0x06d, 0x50c, 0x407,
+    0x6d1, 0xa80, 0xbf5, 0x3e0, 0xa24, 0x3ad, 0x37c, 0x3fd,
+    0x956, 0x282, 0x74c, 0x949, 0x5ca, 0x604, 0x21c, 0x68e,
+    0x65a, 0x117, 0x13a, 0x495, 0xa0d, 0xc18, 0x030, 0x29b,
+    0x780, 0x8b5, 0x411, 0xa2e, 0x69c, 0x2a8, 0xaba, 0x238,
+    0xcf0, 0x973, 0x836, 0x0db, 0x357, 0xa79, 0x738, 0x2c8,
+    0x2aa, 0x39f, 0x703, 0x1cd, 0x763, 0xb3d, 0x9da, 0x766,
+    0x3f2, 0x586, 0x7d9, 0xce0, 0x1d0, 0xa89, 0x330, 0x548,
+    0xa77, 0x4fa, 0x41c, 0x401, 0x854, 0x625, 0x04c, 0xbb6,
+    0xbe0, 0x9cc, 0x54b, 0x1c2, 0x3a8, 0x1bf, 0xaea, 0x4d3,
+    0x76f, 0x7cc, 0x441, 0xcc9, 0x11b, 0x73d, 0x7c6, 0x372,
+    0xbd9, 0x62f, 0xac8, 0x045, 0x21f, 0x9e4, 0xc40, 0x582,
+    0x8db, 0x9b1, 0x598, 0xa8b, 0x2af, 0x028, 0x2ed, 0x640
 };

 /*
@@ -522,134 +257,22 @@ static const uint16_t kInverseNTTRoots[128] = {
  * ModRoots = [pow(17, 2*bitreverse(i) + 1, p) for i in range(128)]
  */
 static const uint16_t kModRoots[128] = {
-    17,
-    3312,
-    2761,
-    568,
-    583,
-    2746,
-    2649,
-    680,
-    1637,
-    1692,
-    723,
-    2606,
-    2288,
-    1041,
-    1100,
-    2229,
-    1409,
-    1920,
-    2662,
-    667,
-    3281,
-    48,
-    233,
-    3096,
-    756,
-    2573,
-    2156,
-    1173,
-    3015,
-    314,
-    3050,
-    279,
-    1703,
-    1626,
-    1651,
-    1678,
-    2789,
-    540,
-    1789,
-    1540,
-    1847,
-    1482,
-    952,
-    2377,
-    1461,
-    1868,
-    2687,
-    642,
-    939,
-    2390,
-    2308,
-    1021,
-    2437,
-    892,
-    2388,
-    941,
-    733,
-    2596,
-    2337,
-    992,
-    268,
-    3061,
-    641,
-    2688,
-    1584,
-    1745,
-    2298,
-    1031,
-    2037,
-    1292,
-    3220,
-    109,
-    375,
-    2954,
-    2549,
-    780,
-    2090,
-    1239,
-    1645,
-    1684,
-    1063,
-    2266,
-    319,
-    3010,
-    2773,
-    556,
-    757,
-    2572,
-    2099,
-    1230,
-    561,
-    2768,
-    2466,
-    863,
-    2594,
-    735,
-    2804,
-    525,
-    1092,
-    2237,
-    403,
-    2926,
-    1026,
-    2303,
-    1143,
-    2186,
-    2150,
-    1179,
-    2775,
-    554,
-    886,
-    2443,
-    1722,
-    1607,
-    1212,
-    2117,
-    1874,
-    1455,
-    1029,
-    2300,
-    2110,
-    1219,
-    2935,
-    394,
-    885,
-    2444,
-    2154,
-    1175,
+    0x011, 0xcf0, 0xac9, 0x238, 0x247, 0xaba, 0xa59, 0x2a8,
+    0x665, 0x69c, 0x2d3, 0xa2e, 0x8f0, 0x411, 0x44c, 0x8b5,
+    0x581, 0x780, 0xa66, 0x29b, 0xcd1, 0x030, 0x0e9, 0xc18,
+    0x2f4, 0xa0d, 0x86c, 0x495, 0xbc7, 0x13a, 0xbea, 0x117,
+    0x6a7, 0x65a, 0x673, 0x68e, 0xae5, 0x21c, 0x6fd, 0x604,
+    0x737, 0x5ca, 0x3b8, 0x949, 0x5b5, 0x74c, 0xa7f, 0x282,
+    0x3ab, 0x956, 0x904, 0x3fd, 0x985, 0x37c, 0x954, 0x3ad,
+    0x2dd, 0xa24, 0x921, 0x3e0, 0x10c, 0xbf5, 0x281, 0xa80,
+    0x630, 0x6d1, 0x8fa, 0x407, 0x7f5, 0x50c, 0xc94, 0x06d,
+    0x177, 0xb8a, 0x9f5, 0x30c, 0x82a, 0x4d7, 0x66d, 0x694,
+    0x427, 0x8da, 0x13f, 0xbc2, 0xad5, 0x22c, 0x2f5, 0xa0c,
+    0x833, 0x4ce, 0x231, 0xad0, 0x9a2, 0x35f, 0xa22, 0x2df,
+    0xaf4, 0x20d, 0x444, 0x8bd, 0x193, 0xb6e, 0x402, 0x8ff,
+    0x477, 0x88a, 0x866, 0x49b, 0xad7, 0x22a, 0x376, 0x98b,
+    0x6ba, 0x647, 0x4bc, 0x845, 0x752, 0x5af, 0x405, 0x8fc,
+    0x83e, 0x4c3, 0xb77, 0x18a, 0x375, 0x98c, 0x86a, 0x497
 };

 /*
@@ -782,17 +405,69 @@ static __owur int sample_scalar(scalar *out, EVP_MD_CTX *mdctx)
     return 1;
 }

+static CRYPTO_ONCE ml_kem_ntt_once = CRYPTO_ONCE_STATIC_INIT;
+
+#if defined(_ARCH_PPC64)
+#include "arch/ppc_arch.h"
+#endif
+
+#if defined(MLKEM_NTT_PPC_ASM) && defined(_ARCH_PPC64)
+/*
+ * PPC64LE Platform supports.
+ */
+typedef void (*ml_kem_scalar_ntt_fn)(scalar *p);
+typedef void (*ml_kem_scalar_inverse_ntt_fn)(scalar *p);
+
+static void scalar_ntt_generic(scalar *p);
+static void scalar_inverse_ntt_generic(scalar *p);
+
+static ml_kem_scalar_ntt_fn scalar_ntt = scalar_ntt_generic;
+static ml_kem_scalar_inverse_ntt_fn scalar_inverse_ntt = scalar_inverse_ntt_generic;
+
+void mlkem_ntt_ppc(uint16_t *c);
+void mlkem_inverse_ntt_ppc(uint16_t *c);
+
+static void scalar_ntt_ppc(scalar *s)
+{
+    mlkem_ntt_ppc(s->c);
+}
+
+static void scalar_inverse_ntt_ppc(scalar *s)
+{
+    mlkem_inverse_ntt_ppc(s->c);
+}
+#else
+#define scalar_ntt_generic scalar_ntt
+#define scalar_inverse_ntt_generic scalar_inverse_ntt
+#endif
+
+/*
+ * Initialize NTT function pointers to PPC64le implementations if available.
+ * Scalar implementations are used by default.
+ */
+static void ml_kem_ntt_init(void)
+{
+#if defined(MLKEM_NTT_PPC_ASM) && defined(_ARCH_PPC64)
+#if defined(__LITTLE_ENDIAN__) || (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
+    if (OPENSSL_ppccap_P & PPC_CRYPTO207) {
+        scalar_ntt = scalar_ntt_ppc;
+        scalar_inverse_ntt = scalar_inverse_ntt_ppc;
+    }
+#endif
+#endif
+}
+
 /*-
  * reduce_once reduces 0 <= x < 2*kPrime, mod kPrime.
  *
  * Subtract |q| if the input is larger, without exposing a side-channel,
- * avoiding the "clangover" attack.  See |constish_time_non_zero| for a
+ * avoiding the "clangover" attack.  See |constish_time_true| for a
  * discussion on why the value barrier is by default omitted.
  */
 static __owur uint16_t reduce_once(uint16_t x)
 {
     const uint16_t subtracted = x - kPrime;
-    uint16_t mask = constish_time_non_zero(subtracted >> 15);
+    uint16_t mask = constish_time_true(subtracted >> 15);

     return (mask & x) | (~mask & subtracted);
 }
@@ -832,7 +507,7 @@ static void scalar_mult_const(scalar *s, uint16_t a)
  * elements in GF(3329^2), with the coefficients of the elements being
  * consecutive entries in |s->c|.
  */
-static void scalar_ntt(scalar *s)
+static void scalar_ntt_generic(scalar *s)
 {
     const uint16_t *roots = kNTTRoots;
     uint16_t *end = s->c + DEGREE;
@@ -864,7 +539,7 @@ static void scalar_ntt(scalar *s)
  * iFFT to account for the fact that 3329 does not have a 512th root of unity,
  * using the precomputed 128 roots of unity stored in InverseNTTRoots.
  */
-static void scalar_inverse_ntt(scalar *s)
+static void scalar_inverse_ntt_generic(scalar *s)
 {
     const uint16_t *roots = kInverseNTTRoots;
     uint16_t *end = s->c + DEGREE;
@@ -1092,11 +767,11 @@ scalar_decode_decompress_add(scalar *out, const uint8_t in[DEGREE / 8])

     /*
      * Add |half_q_plus_1| if the bit is set, without exposing a side-channel,
-     * avoiding the "clangover" attack.  See |constish_time_non_zero| for a
+     * avoiding the "clangover" attack.  See |constish_time_true| for a
      * discussion on why the value barrier is by default omitted.
      */
 #define decode_decompress_add_bit                        \
-    mask = constish_time_non_zero(bit0(b));              \
+    mask = constish_time_true(bit0(b));                  \
     *curr = reduce_once(*curr + (mask & half_q_plus_1)); \
     curr++;                                              \
     b >>= 1
@@ -1355,20 +1030,20 @@ static __owur int cbd_2(scalar *out, uint8_t in[ML_KEM_RANDOM_BYTES + 1],
         b = *r++;

         /*
-         * Add |kPrime| if |value| underflowed.  See |constish_time_non_zero|
-         * for a discussion on why the value barrier is by default omitted.
-         * While this could have been written reduce_once(value + kPrime), this
-         * is one extra addition and small range of |value| tempts some
-         * versions of Clang to emit a branch.
+         * Add |kPrime| if |value| underflowed.  See |constish_time_true| for
+         * a discussion on why the value barrier is by default omitted.  While
+         * this could have been written reduce_once(value + kPrime), this is
+         * one extra addition and small range of |value| tempts some versions
+         * of Clang to emit a branch.
          */
         value = bit0(b) + bitn(1, b);
         value -= bitn(2, b) + bitn(3, b);
-        mask = constish_time_non_zero(value >> 15);
+        mask = constish_time_true(value >> 15);
         *curr++ = value + (kPrime & mask);

         value = bitn(4, b) + bitn(5, b);
         value -= bitn(6, b) + bitn(7, b);
-        mask = constish_time_non_zero(value >> 15);
+        mask = constish_time_true(value >> 15);
         *curr++ = value + (kPrime & mask);
     } while (curr < end);

@@ -1401,7 +1076,7 @@ static __owur int cbd_3(scalar *out, uint8_t in[ML_KEM_RANDOM_BYTES + 1],
         b3 = *r++;

         /*
-         * Add |kPrime| if |value| underflowed.  See |constish_time_non_zero|
+         * Add |kPrime| if |value| underflowed.  See |constish_time_true|
          * for a discussion on why the value barrier is by default omitted.
          * While this could have been written reduce_once(value + kPrime), this
          * is one extra addition and small range of |value| tempts some
@@ -1409,22 +1084,22 @@ static __owur int cbd_3(scalar *out, uint8_t in[ML_KEM_RANDOM_BYTES + 1],
          */
         value = bit0(b1) + bitn(1, b1) + bitn(2, b1);
         value -= bitn(3, b1) + bitn(4, b1) + bitn(5, b1);
-        mask = constish_time_non_zero(value >> 15);
+        mask = constish_time_true(value >> 15);
         *curr++ = value + (kPrime & mask);

         value = bitn(6, b1) + bitn(7, b1) + bit0(b2);
         value -= bitn(1, b2) + bitn(2, b2) + bitn(3, b2);
-        mask = constish_time_non_zero(value >> 15);
+        mask = constish_time_true(value >> 15);
         *curr++ = value + (kPrime & mask);

         value = bitn(4, b2) + bitn(5, b2) + bitn(6, b2);
         value -= bitn(7, b2) + bit0(b3) + bitn(1, b3);
-        mask = constish_time_non_zero(value >> 15);
+        mask = constish_time_true(value >> 15);
         *curr++ = value + (kPrime & mask);

         value = bitn(2, b3) + bitn(3, b3) + bitn(4, b3);
         value -= bitn(5, b3) + bitn(6, b3) + bitn(7, b3);
-        mask = constish_time_non_zero(value >> 15);
+        mask = constish_time_true(value >> 15);
         *curr++ = value + (kPrime & mask);
     } while (curr < end);

@@ -1497,7 +1172,7 @@ end:
  * |A| (our key->m, with the public key holding an expanded (16-bit per scalar
  * coefficient) key->t vector).
  *
- * Caller passes storage in |tmp| for for two temporary vectors.
+ * Caller passes storage in |tmp| for two temporary vectors.
  */
 static __owur int encrypt_cpa(uint8_t out[ML_KEM_SHARED_SECRET_BYTES],
     const uint8_t message[DEGREE / 8],
@@ -1759,14 +1434,9 @@ static __owur int genkey(const uint8_t seed[ML_KEM_SEED_BYTES],
     /* Save |z| portion of seed for "implicit rejection" on failure. */
     memcpy(key->z, seed + ML_KEM_RANDOM_BYTES, ML_KEM_RANDOM_BYTES);

-    /* Optionally save the |d| portion of the seed */
+    /* Save the |d| portion of the seed */
     key->d = key->z + ML_KEM_RANDOM_BYTES;
-    if (key->prov_flags & ML_KEM_KEY_RETAIN_SEED) {
-        memcpy(key->d, seed, ML_KEM_RANDOM_BYTES);
-    } else {
-        OPENSSL_cleanse(key->d, ML_KEM_RANDOM_BYTES);
-        key->d = NULL;
-    }
+    memcpy(key->d, seed, ML_KEM_RANDOM_BYTES);

     ret = 1;
 end:
@@ -1813,6 +1483,30 @@ static int encap(uint8_t *ctext, uint8_t secret[ML_KEM_SHARED_SECRET_BYTES],
     return ret;
 }

+/*
+ * Hash the input message |m'| and public key digest |h|
+ * to obtain |K| and |r|.
+ */
+static int hash_kr(uint8_t *out, uint8_t *in,
+    EVP_MD_CTX *mdctx, const ML_KEM_KEY *key)
+{
+    unsigned int sz, wanted;
+
+    wanted = ML_KEM_SHARED_SECRET_BYTES + ML_KEM_RANDOM_BYTES;
+    return (EVP_DigestInit_ex(mdctx, key->sha3_512_md, NULL)
+        && EVP_DigestUpdate(mdctx, in, ML_KEM_RANDOM_BYTES)
+        && EVP_DigestUpdate(mdctx, key->pkhash, ML_KEM_PKHASH_BYTES)
+        && EVP_DigestFinal_ex(mdctx, out, &sz)
+        && ossl_assert(sz == wanted));
+}
+
+/*-
+ * Decap needs space for: Kbar | K | r | m'
+ * We slice up a single buffer to hold them all.
+ * We don't need to cleanse the public pkhash value.
+ */
+#define DECAP_BUFFER_SZ (2 * ML_KEM_SHARED_SECRET_BYTES + 2 * ML_KEM_RANDOM_BYTES)
+
 /*
  * FIPS 203, Section 6.3, Algorithm 18: ML-KEM.Decaps_internal
  *
@@ -1828,82 +1522,82 @@ static int decap(uint8_t secret[ML_KEM_SHARED_SECRET_BYTES],
     const uint8_t *ctext, uint8_t *tmp_ctext, scalar *tmp,
     EVP_MD_CTX *mdctx, const ML_KEM_KEY *key)
 {
-    uint8_t decrypted[ML_KEM_SHARED_SECRET_BYTES + ML_KEM_PKHASH_BYTES];
-    uint8_t failure_key[ML_KEM_RANDOM_BYTES];
-    uint8_t Kr[ML_KEM_SHARED_SECRET_BYTES + ML_KEM_RANDOM_BYTES];
+    uint8_t buf[DECAP_BUFFER_SZ];
+    uint8_t *failure_key = buf; /* Kbar */
+    uint8_t *Kr = failure_key + ML_KEM_SHARED_SECRET_BYTES;
     uint8_t *r = Kr + ML_KEM_SHARED_SECRET_BYTES;
-    const uint8_t *pkhash = key->pkhash;
+    uint8_t *m = r + ML_KEM_RANDOM_BYTES; /* m' */
     const ML_KEM_VINFO *vinfo = key->vinfo;
     int i;
     uint8_t mask;
+    int ret = 0;

     /*
-     * If our KDF is unavailable, fail early! Otherwise, keep going ignoring
-     * any further errors, returning success, and whatever we got for a shared
-     * secret.  The decrypt_cpa() function is just arithmetic on secret data,
-     * so should not be subject to failure that makes its output predictable.
-     *
-     * We guard against "should never happen" catastrophic failure of the
-     * "pure" function |hash_g| by overwriting the shared secret with the
-     * content of the failure key and returning early, if nevertheless hash_g
-     * fails.  This is not constant-time, but a failure of |hash_g| already
-     * implies loss of side-channel resistance.
-     *
-     * The same action is taken, if also |encrypt_cpa| should catastrophically
-     * fail, due to failure of the |PRF| underlying the CBD functions.
+     * The functions called below (kdf, hash_kr, encrypt_cpa) only fail on
+     * catastrophic failure of an underlying SHA3/SHAKE primitive, for example
+     * a memory allocation failure in EVP_DigestInit_ex(). None of these
+     * failures are dependent on the ciphertext content, so reporting them as a
+     * hard error does not create a chosen-ciphertext oracle and does not affect
+     * the constant-time properties of the implicit rejection path below.
      */
     if (!kdf(failure_key, key->z, ctext, vinfo->ctext_bytes, mdctx, key)) {
         ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
             "internal error while performing %s decapsulation",
             vinfo->algorithm_name);
-        OPENSSL_cleanse(failure_key, sizeof(failure_key));
-        return 0;
+        goto end;
     }
-    decrypt_cpa(decrypted, ctext, tmp, key);
-    memcpy(decrypted + ML_KEM_SHARED_SECRET_BYTES, pkhash, ML_KEM_PKHASH_BYTES);
-    if (!hash_g(Kr, decrypted, sizeof(decrypted), mdctx, key)
-        || !encrypt_cpa(tmp_ctext, decrypted, r, tmp, mdctx, key)) {
-        memcpy(secret, failure_key, ML_KEM_SHARED_SECRET_BYTES);
-        OPENSSL_cleanse(decrypted, ML_KEM_SHARED_SECRET_BYTES);
-        OPENSSL_cleanse(Kr, sizeof(Kr));
-        OPENSSL_cleanse(failure_key, sizeof(failure_key));
-        return 1;
+    decrypt_cpa(m, ctext, tmp, key);
+    if (!hash_kr(Kr, m, mdctx, key)
+        || !encrypt_cpa(tmp_ctext, m, r, tmp, mdctx, key)) {
+        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
+            "internal error while performing %s decapsulation",
+            vinfo->algorithm_name);
+        goto end;
     }
     mask = constant_time_eq_int_8(0,
         CRYPTO_memcmp(ctext, tmp_ctext, vinfo->ctext_bytes));
     for (i = 0; i < ML_KEM_SHARED_SECRET_BYTES; i++)
         secret[i] = constant_time_select_8(mask, Kr[i], failure_key[i]);
-    OPENSSL_cleanse(decrypted, ML_KEM_SHARED_SECRET_BYTES);
-    OPENSSL_cleanse(Kr, sizeof(Kr));
-    OPENSSL_cleanse(failure_key, sizeof(failure_key));
-    return 1;
+    ret = 1;
+end:
+    OPENSSL_cleanse(buf, DECAP_BUFFER_SZ);
+    return ret;
 }

 /*
  * After allocating storage for public or private key data, update the key
  * component pointers to reference that storage.
+ *
+ * The caller should only store private data in `priv` *after* a successful
+ * (non-zero) return from this function.
  */
-static __owur int add_storage(scalar *p, int private, int dup, ML_KEM_KEY *key)
+static __owur int add_storage(scalar *pub, scalar *priv,
+    int private, int dup, ML_KEM_KEY *key)
 {
     int rank = key->vinfo->rank;

-    if (p == NULL)
+    if (pub == NULL || (private && priv == NULL)) {
+        /*
+         * One of these could be allocated correctly. It is legal to call free with a NULL
+         * pointer, so always attempt to free both allocations here
+         */
+        OPENSSL_free(pub);
+        OPENSSL_secure_free(priv);
         return 0;
+    }

     /*
-     * We're adding key material, the seed buffer will now hold |rho| and
-     * |pkhash|.  Zero the key hash when creating fresh keys; when
-     * duplicating, |key| was memdup'd from the source so |seedbuf|
-     * already carries the correct |rho|/|pkhash| bytes — preserve them.
+     * We're adding key material, set up rho and pkhash to point to the
+     * rho_pkhash buffer.  Zero the key hash when creating fresh keys.
      */
     if (dup == 0)
-        memset(key->seedbuf, 0, sizeof(key->seedbuf));
-    key->rho = key->seedbuf;
-    key->pkhash = key->seedbuf + ML_KEM_RANDOM_BYTES;
+        memset(key->rho_pkhash, 0, sizeof(key->rho_pkhash));
+    key->rho = key->rho_pkhash;
+    key->pkhash = key->rho_pkhash + ML_KEM_RANDOM_BYTES;
     key->d = key->z = NULL;

     /* A public key needs space for |t| and |m| */
-    key->m = (key->t = p) + rank;
+    key->m = (key->t = pub) + rank;

     /*
      * A private key also needs space for |s| and |z|.
@@ -1913,7 +1607,7 @@ static __owur int add_storage(scalar *p, int private, int dup, ML_KEM_KEY *key)
      * non-NULL |d| pointer.
      */
     if (private)
-        key->z = (uint8_t *)(rank + (key->s = key->m + rank * rank));
+        key->z = (uint8_t *)(rank + (key->s = priv));
     return 1;
 }

@@ -1923,20 +1617,28 @@ static __owur int add_storage(scalar *p, int private, int dup, ML_KEM_KEY *key)
  */
 void ossl_ml_kem_key_reset(ML_KEM_KEY *key)
 {
-    if (key->t == NULL)
-        return;
+    /*
+     * seedbuf can be allocated and contain |z| and |d| if the key is
+     * being created from a private key encoding.  Similarly a pending
+     * serialised (encoded) private key may be queued up to load.
+     * Clear and free that data now.
+     */
+    if (key->seedbuf != NULL)
+        OPENSSL_secure_clear_free(key->seedbuf, ML_KEM_SEED_BYTES);
+    if (ossl_ml_kem_have_dkenc(key))
+        OPENSSL_secure_clear_free(key->encoded_dk, key->vinfo->prvkey_bytes);
+
     /*-
      * Cleanse any sensitive data:
      * - The private vector |s| is immediately followed by the FO failure
      *   secret |z|, and seed |d|, we can cleanse all three in one call.
-     *
-     * - Otherwise, when key->d is set, cleanse the stashed seed.
      */
-    if (ossl_ml_kem_have_prvkey(key))
-        OPENSSL_cleanse(key->s,
-            key->vinfo->rank * sizeof(scalar) + 2 * ML_KEM_RANDOM_BYTES);
-    OPENSSL_free(key->t);
-    key->d = key->z = (uint8_t *)(key->s = key->m = key->t = NULL);
+    if (key->t != NULL) {
+        if (ossl_ml_kem_have_prvkey(key))
+            OPENSSL_secure_clear_free(key->s, key->vinfo->prvalloc);
+        OPENSSL_free(key->t);
+    }
+    key->d = key->z = key->seedbuf = key->encoded_dk = (uint8_t *)(key->s = key->m = key->t = NULL);
 }

 /*
@@ -1949,6 +1651,8 @@ void ossl_ml_kem_key_reset(ML_KEM_KEY *key)
 /* Retrieve the parameters of one of the ML-KEM variants */
 const ML_KEM_VINFO *ossl_ml_kem_get_vinfo(int evp_type)
 {
+    (void)CRYPTO_THREAD_run_once(&ml_kem_ntt_once, ml_kem_ntt_init);
+
     switch (evp_type) {
     case EVP_PKEY_ML_KEM_512:
         return &vinfo_map[ML_KEM_512_VINFO];
@@ -1960,6 +1664,27 @@ const ML_KEM_VINFO *ossl_ml_kem_get_vinfo(int evp_type)
     return NULL;
 }

+/*
+ * @brief Fetch digest algorithms based on a propq.
+ * For the import case ossl_ml_kem_key_new() gets passed a NULL propq,
+ * so the propq is optionally deferred to the import using OSSL_PARAM.
+ */
+int ossl_ml_kem_key_fetch_digest(ML_KEM_KEY *key, const char *propq)
+{
+    if (key->shake128_md != NULL) {
+        EVP_MD_free(key->shake128_md);
+        EVP_MD_free(key->shake256_md);
+        EVP_MD_free(key->sha3_256_md);
+        EVP_MD_free(key->sha3_512_md);
+    }
+    key->shake128_md = EVP_MD_fetch(key->libctx, "SHAKE128", propq);
+    key->shake256_md = EVP_MD_fetch(key->libctx, "SHAKE256", propq);
+    key->sha3_256_md = EVP_MD_fetch(key->libctx, "SHA3-256", propq);
+    key->sha3_512_md = EVP_MD_fetch(key->libctx, "SHA3-512", propq);
+    return (key->shake128_md != NULL && key->shake256_md != NULL
+        && key->sha3_256_md != NULL && key->sha3_512_md != NULL);
+}
+
 ML_KEM_KEY *ossl_ml_kem_key_new(OSSL_LIB_CTX *libctx, const char *properties,
     int evp_type)
 {
@@ -1978,17 +1703,10 @@ ML_KEM_KEY *ossl_ml_kem_key_new(OSSL_LIB_CTX *libctx, const char *properties,
     key->vinfo = vinfo;
     key->libctx = libctx;
     key->prov_flags = ML_KEM_KEY_PROV_FLAGS_DEFAULT;
-    key->shake128_md = EVP_MD_fetch(libctx, "SHAKE128", properties);
-    key->shake256_md = EVP_MD_fetch(libctx, "SHAKE256", properties);
-    key->sha3_256_md = EVP_MD_fetch(libctx, "SHA3-256", properties);
-    key->sha3_512_md = EVP_MD_fetch(libctx, "SHA3-512", properties);
-    key->d = key->z = key->rho = key->pkhash = key->encoded_dk = NULL;
+    key->d = key->z = key->rho = key->pkhash = key->encoded_dk = key->seedbuf = NULL;
     key->s = key->m = key->t = NULL;
-
-    if (key->shake128_md != NULL
-        && key->shake256_md != NULL
-        && key->sha3_256_md != NULL
-        && key->sha3_512_md != NULL)
+    key->shake128_md = key->shake256_md = key->sha3_256_md = key->sha3_512_md = NULL;
+    if (ossl_ml_kem_key_fetch_digest(key, properties))
         return key;

     ossl_ml_kem_key_free(key);
@@ -2003,6 +1721,8 @@ ML_KEM_KEY *ossl_ml_kem_key_dup(const ML_KEM_KEY *key, int selection)
     int ok = 0;
     ML_KEM_KEY *ret;

+    if (key == NULL)
+        return NULL;
     /*
      * Partially decoded keys, not yet imported or loaded, should never be
      * duplicated.
@@ -2010,9 +1730,9 @@ ML_KEM_KEY *ossl_ml_kem_key_dup(const ML_KEM_KEY *key, int selection)
     if (ossl_ml_kem_decoded_key(key))
         return NULL;

-    if (key == NULL
-        || (ret = OPENSSL_memdup(key, sizeof(*key))) == NULL)
+    else if ((ret = OPENSSL_memdup(key, sizeof(*key))) == NULL)
         return NULL;
+
     ret->d = ret->z = ret->rho = ret->pkhash = NULL;
     ret->s = ret->m = ret->t = NULL;

@@ -2029,13 +1749,19 @@ ML_KEM_KEY *ossl_ml_kem_key_dup(const ML_KEM_KEY *key, int selection)
         ok = 1;
         break;
     case OSSL_KEYMGMT_SELECT_PUBLIC_KEY:
-        ok = add_storage(OPENSSL_memdup(key->t, key->vinfo->puballoc), 0, 1, ret);
+        ok = add_storage(OPENSSL_memdup(key->t, key->vinfo->puballoc), NULL, 0, 1, ret);
         break;
     case OSSL_KEYMGMT_SELECT_PRIVATE_KEY:
-        ok = add_storage(OPENSSL_memdup(key->t, key->vinfo->prvalloc), 1, 1, ret);
-        /* Duplicated keys retain |d|, if available */
-        if (key->d != NULL)
-            ret->d = ret->z + ML_KEM_RANDOM_BYTES;
+        /* Frees both and returns 0 if either is NULL */
+        ok = add_storage(OPENSSL_memdup(key->t, key->vinfo->puballoc),
+            OPENSSL_secure_malloc(key->vinfo->prvalloc), 1, 1, ret);
+        if (ok) {
+            memcpy(ret->s, key->s, key->vinfo->prvalloc);
+
+            /* Duplicated keys retain |d|, if available */
+            if (key->d != NULL)
+                ret->d = ret->z + ML_KEM_RANDOM_BYTES;
+        }
         break;
     }

@@ -2062,13 +1788,6 @@ void ossl_ml_kem_key_free(ML_KEM_KEY *key)
     EVP_MD_free(key->sha3_256_md);
     EVP_MD_free(key->sha3_512_md);

-    if (ossl_ml_kem_decoded_key(key)) {
-        OPENSSL_cleanse(key->seedbuf, sizeof(key->seedbuf));
-        if (ossl_ml_kem_have_dkenc(key)) {
-            OPENSSL_cleanse(key->encoded_dk, key->vinfo->prvkey_bytes);
-            OPENSSL_free(key->encoded_dk);
-        }
-    }
     ossl_ml_kem_key_reset(key);
     OPENSSL_free(key);
 }
@@ -2122,10 +1841,13 @@ ML_KEM_KEY *ossl_ml_kem_set_seed(const uint8_t *seed, size_t seedlen, ML_KEM_KEY
         || ossl_ml_kem_have_seed(key)
         || seedlen != ML_KEM_SEED_BYTES)
         return NULL;
-    /*
-     * With no public or private key material on hand, we can use the seed
-     * buffer for |z| and |d|, in that order.
-     */
+
+    if (key->seedbuf == NULL) {
+        key->seedbuf = OPENSSL_secure_malloc(seedlen);
+        if (key->seedbuf == NULL)
+            return NULL;
+    }
+
     key->z = key->seedbuf;
     key->d = key->z + ML_KEM_RANDOM_BYTES;
     memcpy(key->d, seed, ML_KEM_RANDOM_BYTES);
@@ -2152,7 +1874,7 @@ int ossl_ml_kem_parse_public_key(const uint8_t *in, size_t len, ML_KEM_KEY *key)
         || (mdctx = EVP_MD_CTX_new()) == NULL)
         return 0;

-    if (add_storage(OPENSSL_malloc(vinfo->puballoc), 0, 0, key))
+    if (add_storage(OPENSSL_malloc(vinfo->puballoc), NULL, 0, 0, key))
         ret = parse_pubkey(in, mdctx, key);

     if (!ret)
@@ -2180,7 +1902,11 @@ int ossl_ml_kem_parse_private_key(const uint8_t *in, size_t len,
         || (mdctx = EVP_MD_CTX_new()) == NULL)
         return 0;

-    if (add_storage(OPENSSL_malloc(vinfo->prvalloc), 1, 0, key))
+    /* Clear any unused seed */
+    ossl_ml_kem_key_reset(key);
+
+    if (add_storage(OPENSSL_malloc(vinfo->puballoc),
+            OPENSSL_secure_malloc(vinfo->prvalloc), 1, 0, key))
         ret = parse_prvkey(in, mdctx, key);

     if (!ret)
@@ -2209,10 +1935,10 @@ int ossl_ml_kem_genkey(uint8_t *pubenc, size_t publen, ML_KEM_KEY *key)
     if (pubenc != NULL && publen != vinfo->pubkey_bytes)
         return 0;

-    if (ossl_ml_kem_have_seed(key)) {
+    if (key->seedbuf != NULL) {
         if (!ossl_ml_kem_encode_seed(seed, sizeof(seed), key))
             return 0;
-        key->d = key->z = NULL;
+        ossl_ml_kem_key_reset(key);
     } else if (RAND_priv_bytes_ex(key->libctx, seed, sizeof(seed),
                    key->vinfo->secbits)
         <= 0) {
@@ -2228,7 +1954,8 @@ int ossl_ml_kem_genkey(uint8_t *pubenc, size_t publen, ML_KEM_KEY *key)
      */
     CONSTTIME_SECRET(seed, ML_KEM_SEED_BYTES);

-    if (add_storage(OPENSSL_malloc(vinfo->prvalloc), 1, 0, key))
+    if (add_storage(OPENSSL_malloc(vinfo->puballoc),
+            OPENSSL_secure_malloc(vinfo->prvalloc), 1, 0, key))
         ret = genkey(seed, mdctx, pubenc, key);
     OPENSSL_cleanse(seed, sizeof(seed));

@@ -2284,17 +2011,22 @@ int ossl_ml_kem_encap_seed(uint8_t *ctext, size_t clen,
      * We stack-allocate these.
      */
 #define case_encap_seed(bits)                                        \
-    case EVP_PKEY_ML_KEM_##bits: {                                   \
+    {                                                                \
         scalar tmp[2 * ML_KEM_##bits##_RANK];                        \
                                                                      \
         ret = encap(ctext, shared_secret, entropy, tmp, mdctx, key); \
         OPENSSL_cleanse((void *)tmp, sizeof(tmp));                   \
-        break;                                                       \
     }
     switch (vinfo->evp_type) {
+    case EVP_PKEY_ML_KEM_512:
         case_encap_seed(512);
+        break;
+    case EVP_PKEY_ML_KEM_768:
         case_encap_seed(768);
+        break;
+    case EVP_PKEY_ML_KEM_1024:
         case_encap_seed(1024);
+        break;
     }
 #undef case_encap_seed

@@ -2358,14 +2090,14 @@ int ossl_ml_kem_decap(uint8_t *shared_secret, size_t slen,
             ML_KEM_SHARED_SECRET_BYTES, vinfo->secbits);
         return 0;
     }
-#if defined(OPENSSL_CONSTANT_TIME_VALIDATION)
     /*
      * Data derived from |s| and |z| defaults secret, and to avoid side-channel
      * leaks should not influence control flow.
      */
-    classify_bytes = 2 * sizeof(scalar) + ML_KEM_RANDOM_BYTES;
-    CONSTTIME_SECRET(key->s, classify_bytes);
+#if defined(OPENSSL_CONSTANT_TIME_VALIDATION)
+    classify_bytes = vinfo->rank * sizeof(scalar) + ML_KEM_RANDOM_BYTES;
 #endif
+    CONSTTIME_SECRET(key->s, classify_bytes);

     /*-
      * This avoids the need to handle allocation failures for two (max 2KB
@@ -2374,20 +2106,26 @@ int ossl_ml_kem_decap(uint8_t *shared_secret, size_t slen,
      * We stack-allocate these.
      */
 #define case_decap(bits)                                          \
-    case EVP_PKEY_ML_KEM_##bits: {                                \
+    {                                                             \
         uint8_t cbuf[CTEXT_BYTES(bits)];                          \
         scalar tmp[2 * ML_KEM_##bits##_RANK];                     \
                                                                   \
         ret = decap(shared_secret, ctext, cbuf, tmp, mdctx, key); \
         OPENSSL_cleanse((void *)tmp, sizeof(tmp));                \
         OPENSSL_cleanse((void *)cbuf, sizeof(cbuf));              \
-        break;                                                    \
     }
     switch (vinfo->evp_type) {
+    case EVP_PKEY_ML_KEM_512:
         case_decap(512);
+        break;
+    case EVP_PKEY_ML_KEM_768:
         case_decap(768);
+        break;
+    case EVP_PKEY_ML_KEM_1024:
         case_decap(1024);
+        break;
     }
+#undef case_decap

     /* Declassify secret inputs and derived outputs before returning control */
     CONSTTIME_DECLASSIFY(key->s, classify_bytes);
@@ -2395,7 +2133,6 @@ int ossl_ml_kem_decap(uint8_t *shared_secret, size_t slen,
     EVP_MD_CTX_free(mdctx);

     return ret;
-#undef case_decap
 }

 int ossl_ml_kem_pubkey_cmp(const ML_KEM_KEY *key1, const ML_KEM_KEY *key2)
diff --git a/deps/openssl/openssl/crypto/modes/asm/aes-gcm-armv8-unroll8_64.pl b/deps/openssl/openssl/crypto/modes/asm/aes-gcm-armv8-unroll8_64.pl
index d516359eb81..f96bc3c1232 100644
--- a/deps/openssl/openssl/crypto/modes/asm/aes-gcm-armv8-unroll8_64.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/aes-gcm-armv8-unroll8_64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -170,7 +170,7 @@ open OUT,"| \"$^X\" $xlate $flavour $output";
 *STDOUT=*OUT;

 $code=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 #if __ARM_MAX_ARCH__>=8
 ___
diff --git a/deps/openssl/openssl/crypto/modes/asm/aes-gcm-armv8_64.pl b/deps/openssl/openssl/crypto/modes/asm/aes-gcm-armv8_64.pl
index 95491fd08e5..ce513412d76 100755
--- a/deps/openssl/openssl/crypto/modes/asm/aes-gcm-armv8_64.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/aes-gcm-armv8_64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -12,7 +12,7 @@
 # derived from https://github.com/ARM-software/AArch64cryptolib, original
 # author Samuel Lee <Samuel.Lee@arm.com>. The module is, however, dual
 # licensed under OpenSSL and CRYPTOGAMS licenses depending on where you
-# obtain it. For further details see http://www.openssl.org/~appro/cryptogams/.
+# obtain it. For further details see https://github.com/dot-asm/cryptogams/.
 #========================================================================
 #
 # Approach - assume we don't want to reload constants, so reserve ~half of vector register file for constants
@@ -225,7 +225,7 @@ my $rk4v="v22";
 my $rk4d="d22";

 $code=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 #if __ARM_MAX_ARCH__>=8
 ___
@@ -6036,7 +6036,7 @@ ___

 $code.=<<___;
 .rodata
-.asciz  "GHASH for ARMv8, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz  "GHASH for ARMv8, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align  2
 #endif
 ___
diff --git a/deps/openssl/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl b/deps/openssl/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl
index 202883dac35..68f71eaff10 100644
--- a/deps/openssl/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 #
@@ -964,7 +964,7 @@ $code.=<<___;
 	.byte	2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
 .Lone_lsb:
 	.byte	1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-.asciz	"AES-NI GCM module for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"AES-NI GCM module for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .previous
 .align	64
 ___
diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-alpha.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-alpha.pl
index c350e901555..1eb4057b649 100644
--- a/deps/openssl/openssl/crypto/modes/asm/ghash-alpha.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/ghash-alpha.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2010-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # March 2010
@@ -457,7 +457,7 @@ rem_4bit:
 	.long	0,0x7080<<16, 0,0x6CA0<<16, 0,0x48C0<<16, 0,0x54E0<<16
 	.long	0,0xE100<<16, 0,0xFD20<<16, 0,0xD940<<16, 0,0xC560<<16
 	.long	0,0x9180<<16, 0,0x8DA0<<16, 0,0xA9C0<<16, 0,0xB5E0<<16
-.ascii	"GHASH for Alpha, CRYPTOGAMS by <appro\@openssl.org>"
+.ascii	"GHASH for Alpha, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	4

 ___
diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl
index 4ab6d8cb2b4..7d9ea5d5be7 100644
--- a/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # April 2010
@@ -142,7 +142,7 @@ ___
 }

 $code=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 #if defined(__thumb2__) || defined(__clang__)
 .syntax	unified
@@ -296,6 +296,7 @@ $code.=<<___;

 .global	gcm_gmult_4bit
 .type	gcm_gmult_4bit,%function
+.align	4
 gcm_gmult_4bit:
 	stmdb	sp!,{r4-r11,lr}
 	ldrb	$nlo,[$Xi,#15]
@@ -538,7 +539,7 @@ $code.=<<___;
 ___
 }
 $code.=<<___;
-.asciz  "GHASH for ARMv4/NEON, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz  "GHASH for ARMv4/NEON, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align  2
 ___

diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-c64xplus.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-c64xplus.pl
index ded2f779e66..a07c855d5dd 100644
--- a/deps/openssl/openssl/crypto/modes/asm/ghash-c64xplus.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/ghash-c64xplus.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2012-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2012-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # December 2011
@@ -238,7 +238,7 @@ $code.=<<___;
 	.endasmfunc

 	.sect	.const
-	.cstring "GHASH for C64x+, CRYPTOGAMS by <appro\@openssl.org>"
+	.cstring "GHASH for C64x+, CRYPTOGAMS by <https://github.com/dot-asm>"
 	.align	4
 ___

diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-e2kv6.c b/deps/openssl/openssl/crypto/modes/asm/ghash-e2kv6.c
new file mode 100644
index 00000000000..25615693e22
--- /dev/null
+++ b/deps/openssl/openssl/crypto/modes/asm/ghash-e2kv6.c
@@ -0,0 +1,180 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <stdint.h>
+#include <e2kintrin.h>
+
+#include "crypto/modes.h"
+
+static __attribute__((__always_inline__)) inline __v2di reverse_vector(const __v2di in)
+{
+    __v2di fmt = __builtin_e2k_qppackdl(0x0001020304050607LL, 0x08090a0b0c0d0e0fLL);
+    return __builtin_e2k_qppermb(in, in, fmt);
+}
+
+static __attribute__((__always_inline__)) inline __v2di gcm_reduce(__v2di B0, __v2di B1)
+{
+    __v2di X0 = __builtin_e2k_qpsrlw(B1, 31);
+    __v2di X1 = __builtin_e2k_qpsllw(B1, 1);
+    __v2di X2 = __builtin_e2k_qpsrlw(B0, 31);
+    __v2di X3 = __builtin_e2k_qpsllw(B0, 1);
+
+    X3 = X3 | __builtin_e2k_qpshufb(X0, X0, __builtin_e2k_qppackdl(0x8080808080808080LL, 0x808080800f0e0d0cLL))
+        | __builtin_e2k_qpshufb(X2, X2, __builtin_e2k_qppackdl(0x0b0a090807060504LL, 0x0302010080808080LL));
+
+    X1 = X1 | __builtin_e2k_qpshufb(X0, X0, __builtin_e2k_qppackdl(0x0b0a090807060504LL, 0x0302010080808080LL));
+
+    X0 = __builtin_e2k_qpsllw(X1, 31) ^ __builtin_e2k_qpsllw(X1, 30) ^ __builtin_e2k_qpsllw(X1, 25);
+
+    X1 ^= __builtin_e2k_qpshufb(X0, X0, __builtin_e2k_qppackdl(0x0302010080808080LL, 0x8080808080808080LL));
+
+    X0 = X1 ^ X3 ^ __builtin_e2k_qpshufb(X0, X0, __builtin_e2k_qppackdl(0x808080800f0e0d0cLL, 0x0b0a090807060504LL));
+
+    X0 ^= __builtin_e2k_qpsrlw(X1, 7) ^ __builtin_e2k_qpsrlw(X1, 2) ^ __builtin_e2k_qpsrlw(X1, 1);
+
+    return X0;
+}
+
+static __attribute__((__always_inline__)) inline __v2di gcm_multiply(__v2di H, __v2di x)
+{
+    uint64_t Hh = H[1], Hl = H[0];
+    uint64_t xh = x[1], xl = x[0];
+
+    uint64_t T0h = __builtin_e2k_clmulh(Hh, xh), T0l = __builtin_e2k_clmull(Hh, xh);
+    uint64_t T1h = __builtin_e2k_clmulh(Hh, xl), T1l = __builtin_e2k_clmull(Hh, xl);
+    uint64_t T2h = __builtin_e2k_clmulh(Hl, xh), T2l = __builtin_e2k_clmull(Hl, xh);
+    uint64_t T3h = __builtin_e2k_clmulh(Hl, xl), T3l = __builtin_e2k_clmull(Hl, xl);
+
+    T1h = __builtin_e2k_pxord(T1h, T2h);
+    T1l = __builtin_e2k_pxord(T1l, T2l);
+
+    T0l = __builtin_e2k_pxord(T0l, T1h);
+    T3h = __builtin_e2k_pxord(T3h, T1l);
+
+    return gcm_reduce(__builtin_e2k_qppackdl(T0h, T0l), __builtin_e2k_qppackdl(T3h, T3l));
+}
+
+static __attribute__((__always_inline__)) inline __v2di gcm_multiply_x4(__v2di H1, __v2di H2, __v2di H3, __v2di H4,
+    __v2di X1, __v2di X2, __v2di X3, __v2di X4)
+{
+    /*
+     * Multiply with delayed reduction, algorithm by Krzysztof Jankowski
+     * and Pierre Laurent of Intel
+     */
+
+    const uint64_t loh = (__builtin_e2k_clmulh(H1[0], X1[0]) ^ __builtin_e2k_clmulh(H2[0], X2[0])) ^ (__builtin_e2k_clmulh(H3[0], X3[0]) ^ __builtin_e2k_clmulh(H4[0], X4[0]));
+    const uint64_t lol = (__builtin_e2k_clmull(H1[0], X1[0]) ^ __builtin_e2k_clmull(H2[0], X2[0])) ^ (__builtin_e2k_clmull(H3[0], X3[0]) ^ __builtin_e2k_clmull(H4[0], X4[0]));
+
+    const uint64_t hih = (__builtin_e2k_clmulh(H1[1], X1[1]) ^ __builtin_e2k_clmulh(H2[1], X2[1])) ^ (__builtin_e2k_clmulh(H3[1], X3[1]) ^ __builtin_e2k_clmulh(H4[1], X4[1]));
+    const uint64_t hil = (__builtin_e2k_clmull(H1[1], X1[1]) ^ __builtin_e2k_clmull(H2[1], X2[1])) ^ (__builtin_e2k_clmull(H3[1], X3[1]) ^ __builtin_e2k_clmull(H4[1], X4[1]));
+    uint64_t Th, Tl;
+
+    Th = __builtin_e2k_clmulh(H1[0] ^ H1[1], X1[0] ^ X1[1]);
+    Tl = __builtin_e2k_clmull(H1[0] ^ H1[1], X1[0] ^ X1[1]);
+
+    Th ^= __builtin_e2k_clmulh(H2[0] ^ H2[1], X2[0] ^ X2[1]);
+    Tl ^= __builtin_e2k_clmull(H2[0] ^ H2[1], X2[0] ^ X2[1]);
+
+    Th ^= __builtin_e2k_clmulh(H3[0] ^ H3[1], X3[0] ^ X3[1]);
+    Tl ^= __builtin_e2k_clmull(H3[0] ^ H3[1], X3[0] ^ X3[1]);
+
+    Th ^= __builtin_e2k_clmulh(H4[0] ^ H4[1], X4[0] ^ X4[1]);
+    Tl ^= __builtin_e2k_clmull(H4[0] ^ H4[1], X4[0] ^ X4[1]);
+
+    Th ^= loh;
+    Tl ^= lol;
+    Th ^= hih;
+    Tl ^= hil;
+
+    return gcm_reduce(__builtin_e2k_qppackdl(hih, hil ^ Th),
+        __builtin_e2k_qppackdl(loh ^ Tl, lol));
+}
+
+/*##############################################################################
+# void gcm_init_e2kv6_clmul(u128 Htable[16],const uint64_t H[2]);
+#
+# input:        128-bit H - secret parameter E(K,0^128)
+# output:       precomputed table filled with degrees of twisted H;
+#               H is twisted to handle reverse bitness of GHASH;
+#               only few of 16 slots of Htable[16] are used;
+#               data is opaque to outside world (which allows to
+#               optimize the code independently);
+#
+*/
+void gcm_init_e2kv6_clmul(u128 Htable[16], const uint64_t H[2])
+{
+    __v2di *Hp = (__v2di *)Htable;
+    __v2di H1 = (__v2di) { H[1], H[0] }; /* H in LE, but need swap hi/lo */
+    __v2di H2 = gcm_multiply(H1, H1);
+    __v2di H3 = gcm_multiply(H1, H2);
+    __v2di H4 = gcm_multiply(H2, H2);
+
+    Hp[0] = H1;
+    Hp[1] = H2;
+    Hp[2] = H3;
+    Hp[3] = H4;
+}
+
+/*##############################################################################
+# void gcm_gmult_e2kv6_clmul(uint64_t Xi[2],const u128 Htable[16]);
+#
+# input:        Xi - current hash value;
+#               Htable - table precomputed in gcm_init_e2kv6_clmul;
+# output:       Xi - next hash value Xi;
+*/
+void gcm_gmult_e2kv6_clmul(uint64_t Xi[2], const u128 Htable[16])
+{
+    __v2di *Xp = (__v2di *)Xi;
+    __v2di *Hp = (__v2di *)Htable;
+    *Xp = reverse_vector(gcm_multiply(Hp[0], reverse_vector(*Xp)));
+}
+
+/*##############################################################################
+# void gcm_ghash_e2kv6_clmul(uint64_t Xi[2], const u128 Htable[16],
+#                            const uint8_t *inp,size_t len);
+#
+# input:        table precomputed in gcm_init_e2kv6_clmul;
+#               current hash value Xi;
+#               pointer to input data;
+#               length of input data in bytes, but divisible by block size;
+# output:       next hash value Xi;
+*/
+void gcm_ghash_e2kv6_clmul(uint64_t Xi[2], const u128 Htable[16],
+    const uint8_t *inp, size_t len)
+{
+    __v2di *Hp = (__v2di *)Htable;
+    __v2di *input = (__v2di *)inp;
+    __v2di x;
+    size_t i, blocks = (len >> 4);
+
+    x = reverse_vector(*(__v2di *)Xi);
+
+    while (blocks >= 4) {
+        __v2di m0 = reverse_vector(input[0]);
+        __v2di m1 = reverse_vector(input[1]);
+        __v2di m2 = reverse_vector(input[2]);
+        __v2di m3 = reverse_vector(input[3]);
+
+        x ^= m0;
+        x = gcm_multiply_x4(Hp[0], Hp[1], Hp[2], Hp[3], m3, m2, m1, x);
+
+        input += 4;
+        blocks -= 4;
+    }
+
+#pragma loop count(3)
+    for (i = 0; i < blocks; i++) {
+        __v2di m = reverse_vector(input[i]);
+
+        x ^= m;
+        x = gcm_multiply(Hp[0], x);
+    }
+
+    *(__v2di *)Xi = reverse_vector(x);
+}
diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-ia64.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-ia64.pl
index 74b88176b84..ec478a1d25c 100755
--- a/deps/openssl/openssl/crypto/modes/asm/ghash-ia64.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/ghash-ia64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2010-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # March 2010
@@ -460,7 +460,7 @@ rem_8bit:
 	data1	0xB5,0xE0, 0xB4,0x22, 0xB6,0x64, 0xB7,0xA6, 0xB2,0xE8, 0xB3,0x2A, 0xB1,0x6C, 0xB0,0xAE
 	data1	0xBB,0xF0, 0xBA,0x32, 0xB8,0x74, 0xB9,0xB6, 0xBC,0xF8, 0xBD,0x3A, 0xBF,0x7C, 0xBE,0xBE
 .size	rem_8bit#,512
-stringz	"GHASH for IA64, CRYPTOGAMS by <appro\@openssl.org>"
+stringz	"GHASH for IA64, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 $code =~ s/mux1(\s+)\S+\@rev/nop.i$1 0x0/gm      if ($big_endian);
diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-parisc.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-parisc.pl
index 7b5cc2f16e3..94cce17f8d8 100644
--- a/deps/openssl/openssl/crypto/modes/asm/ghash-parisc.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/ghash-parisc.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2010-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # April 2010
@@ -627,7 +627,7 @@ L\$rem_4bit
 	.WORD	`0x7080<<16`,0,`0x6CA0<<16`,0,`0x48C0<<16`,0,`0x54E0<<16`,0
 	.WORD	`0xE100<<16`,0,`0xFD20<<16`,0,`0xD940<<16`,0,`0xC560<<16`,0
 	.WORD	`0x9180<<16`,0,`0x8DA0<<16`,0,`0xA9C0<<16`,0,`0xB5E0<<16`,0
-	.STRINGZ "GHASH for PA-RISC, GRYPTOGAMS by <appro\@openssl.org>"
+	.STRINGZ "GHASH for PA-RISC, GRYPTOGAMS by <https://github.com/dot-asm>"
 	.ALIGN	64
 ___

diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-riscv64-zvkg.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-riscv64-zvkg.pl
index 8423ae9cf82..e16fcf5cdd3 100644
--- a/deps/openssl/openssl/crypto/modes/asm/ghash-riscv64-zvkg.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/ghash-riscv64-zvkg.pl
@@ -94,7 +94,7 @@ $code .= <<___;
 .globl gcm_init_rv64i_zvkg_zvkb
 .type gcm_init_rv64i_zvkg_zvkb,\@function
 gcm_init_rv64i_zvkg_zvkb:
-    @{[vsetivli__x0_2_e64_m1_tu_mu]} # vsetivli x0, 2, e64, m1, ta, ma
+    @{[vsetivli__x0_2_e64_m1_tu_mu]} # vsetivli x0, 2, e64, m1, tu, mu
     @{[vle64_v $V0, $H]}             # vle64.v v0, (a1)
     @{[vrev8_v $V0, $V0]}            # vrev8.v v0, v0
     @{[vse64_v $V0, $Htable]}        # vse64.v v0, (a0)
diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-s390x.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-s390x.pl
index 0ae6adbf614..84fc5550953 100644
--- a/deps/openssl/openssl/crypto/modes/asm/ghash-s390x.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/ghash-s390x.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2010-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # September 2010.
@@ -82,7 +82,7 @@ $rem_4bit="%r14";
 $sp="%r15";

 $code.=<<___;
-#include "s390x_arch.h"
+#include "arch/s390x_arch.h"

 .text

@@ -248,7 +248,7 @@ rem_4bit:
 	.long	`0x9180<<12`,0,`0x8DA0<<12`,0,`0xA9C0<<12`,0,`0xB5E0<<12`,0
 .type	rem_4bit,\@object
 .size	rem_4bit,(.-rem_4bit)
-.string	"GHASH for s390x, CRYPTOGAMS by <appro\@openssl.org>"
+.string	"GHASH for s390x, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 $code =~ s/\`([^\`]*)\`/eval $1/gem;
diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-sparcv9.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-sparcv9.pl
index e35064237f4..b28b752ef09 100644
--- a/deps/openssl/openssl/crypto/modes/asm/ghash-sparcv9.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/ghash-sparcv9.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2010-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2010-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # March 2010
@@ -83,7 +83,7 @@ $code.=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #ifdef  __arch64__
 .register	%g2,#scratch
@@ -535,7 +535,7 @@ gcm_ghash_vis3:
 ___
 }}}
 $code.=<<___;
-.asciz	"GHASH for SPARCv9/VIS3, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"GHASH for SPARCv9/VIS3, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	4
 ___

diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-x86.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-x86.pl
index c796107c7f9..dd5f2843866 100644
--- a/deps/openssl/openssl/crypto/modes/asm/ghash-x86.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/ghash-x86.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2010-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # March, May, June 2010
@@ -1374,7 +1374,7 @@ my ($Xhi,$Xi)=@_;
 	&data_word(0,0x9180<<$S,0,0x8DA0<<$S,0,0xA9C0<<$S,0,0xB5E0<<$S);
 }}}	# !$x86only

-&asciz("GHASH for x86, CRYPTOGAMS by <appro\@openssl.org>");
+&asciz("GHASH for x86, CRYPTOGAMS by <https://github.com/dot-asm>");
 &asm_finish();

 close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-x86_64.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-x86_64.pl
index 181793c5523..5371fd16684 100644
--- a/deps/openssl/openssl/crypto/modes/asm/ghash-x86_64.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/ghash-x86_64.pl
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # March, June 2010
@@ -1670,7 +1670,7 @@ $code.=<<___;
 	.value	0xB5E0,0xB422,0xB664,0xB7A6,0xB2E8,0xB32A,0xB16C,0xB0AE
 	.value	0xBBF0,0xBA32,0xB874,0xB9B6,0xBCF8,0xBD3A,0xBF7C,0xBEBE

-.asciz	"GHASH for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"GHASH for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	64
 .previous
 ___
diff --git a/deps/openssl/openssl/crypto/modes/asm/ghashp8-ppc.pl b/deps/openssl/openssl/crypto/modes/asm/ghashp8-ppc.pl
index 20f611dabd4..d3b4a5363bd 100755
--- a/deps/openssl/openssl/crypto/modes/asm/ghashp8-ppc.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/ghashp8-ppc.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2014-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # GHASH for for PowerISA v2.07.
@@ -654,7 +654,7 @@ ___
 $code.=<<___;
 .size	.gcm_ghash_p8,.-.gcm_ghash_p8

-.asciz  "GHASH for PowerISA 2.07, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz  "GHASH for PowerISA 2.07, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align  2
 ___

diff --git a/deps/openssl/openssl/crypto/modes/asm/ghashv8-armx.pl b/deps/openssl/openssl/crypto/modes/asm/ghashv8-armx.pl
index 8ab7c03df16..d39b8446017 100644
--- a/deps/openssl/openssl/crypto/modes/asm/ghashv8-armx.pl
+++ b/deps/openssl/openssl/crypto/modes/asm/ghashv8-armx.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2014-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2014-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # GHASH for ARMv8 Crypto Extension, 64-bit polynomial multiplication.
@@ -73,7 +73,7 @@ my ($t0,$t1,$t2,$xC2,$H,$Hhl,$H2)=map("q$_",(8..14));
 my $_byte = ($flavour =~ /win/ ? "DCB" : ".byte");

 $code=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 #if __ARM_MAX_ARCH__>=7
 ___
@@ -811,7 +811,7 @@ ___

 $code.=<<___;
 .rodata
-.asciz  "GHASH for ARMv8, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz  "GHASH for ARMv8, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align  2
 #endif
 ___
diff --git a/deps/openssl/openssl/crypto/modes/build.info b/deps/openssl/openssl/crypto/modes/build.info
index 9fb2d503d8d..cd4e0330dac 100644
--- a/deps/openssl/openssl/crypto/modes/build.info
+++ b/deps/openssl/openssl/crypto/modes/build.info
@@ -46,6 +46,11 @@ IF[{- !$disabled{asm} -}]
   $MODESASM_riscv64=ghash-riscv64.s ghash-riscv64-zvkb-zvbc.s ghash-riscv64-zvkg.s aes-gcm-riscv64-zvkb-zvkg-zvkned.s
   $MODESDEF_riscv64=GHASH_ASM

+  $MODESASM_e2kv6=asm/ghash-e2kv6.c
+  $MODESDEF_e2kv6=GHASH_ASM
+  $MODESASM_e2kv7=asm/ghash-e2kv6.c
+  $MODESDEF_e2kv7=GHASH_ASM
+
   # Now that we have defined all the arch specific variables, use the
   # appropriate one, and define the appropriate macros
   IF[$MODESASM_{- $target{asm_arch} -}]
diff --git a/deps/openssl/openssl/crypto/modes/ccm128.c b/deps/openssl/openssl/crypto/modes/ccm128.c
index 02ab4f88315..3b9d5d54270 100644
--- a/deps/openssl/openssl/crypto/modes/ccm128.c
+++ b/deps/openssl/openssl/crypto/modes/ccm128.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,9 +13,9 @@

 #ifndef STRICT_ALIGNMENT
 #ifdef __GNUC__
-typedef u64 u64_a1 __attribute((__aligned__(1)));
+typedef uint64_t u64_a1 __attribute((__aligned__(1)));
 #else
-typedef u64 u64_a1;
+typedef uint64_t u64_a1;
 #endif
 #endif

@@ -28,7 +28,7 @@ void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx,
     block128_f block)
 {
     memset(ctx->nonce.c, 0, sizeof(ctx->nonce.c));
-    ctx->nonce.c[0] = ((u8)(L - 1) & 7) | (u8)(((M - 2) / 2) & 7) << 3;
+    ctx->nonce.c[0] = ((uint8_t)(L - 1) & 7) | (uint8_t)(((M - 2) / 2) & 7) << 3;
     ctx->blocks = 0;
     ctx->block = block;
     ctx->key = key;
@@ -46,17 +46,17 @@ int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx,
         return -1; /* nonce is too short */

     if (sizeof(mlen) == 8 && L >= 3) {
-        ctx->nonce.c[8] = (u8)(mlen >> (56 % (sizeof(mlen) * 8)));
-        ctx->nonce.c[9] = (u8)(mlen >> (48 % (sizeof(mlen) * 8)));
-        ctx->nonce.c[10] = (u8)(mlen >> (40 % (sizeof(mlen) * 8)));
-        ctx->nonce.c[11] = (u8)(mlen >> (32 % (sizeof(mlen) * 8)));
+        ctx->nonce.c[8] = (uint8_t)(mlen >> (56 % (sizeof(mlen) * 8)));
+        ctx->nonce.c[9] = (uint8_t)(mlen >> (48 % (sizeof(mlen) * 8)));
+        ctx->nonce.c[10] = (uint8_t)(mlen >> (40 % (sizeof(mlen) * 8)));
+        ctx->nonce.c[11] = (uint8_t)(mlen >> (32 % (sizeof(mlen) * 8)));
     } else
         ctx->nonce.u[1] = 0;

-    ctx->nonce.c[12] = (u8)(mlen >> 24);
-    ctx->nonce.c[13] = (u8)(mlen >> 16);
-    ctx->nonce.c[14] = (u8)(mlen >> 8);
-    ctx->nonce.c[15] = (u8)mlen;
+    ctx->nonce.c[12] = (uint8_t)(mlen >> 24);
+    ctx->nonce.c[13] = (uint8_t)(mlen >> 16);
+    ctx->nonce.c[14] = (uint8_t)(mlen >> 8);
+    ctx->nonce.c[15] = (uint8_t)mlen;

     ctx->nonce.c[0] &= ~0x40; /* clear Adata flag */
     memcpy(&ctx->nonce.c[1], nonce, 14 - L);
@@ -78,29 +78,29 @@ void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx,
     (*block)(ctx->nonce.c, ctx->cmac.c, ctx->key), ctx->blocks++;

     if (alen < (0x10000 - 0x100)) {
-        ctx->cmac.c[0] ^= (u8)(alen >> 8);
-        ctx->cmac.c[1] ^= (u8)alen;
+        ctx->cmac.c[0] ^= (uint8_t)(alen >> 8);
+        ctx->cmac.c[1] ^= (uint8_t)alen;
         i = 2;
     } else if (sizeof(alen) == 8
         && alen >= (size_t)1 << (32 % (sizeof(alen) * 8))) {
         ctx->cmac.c[0] ^= 0xFF;
         ctx->cmac.c[1] ^= 0xFF;
-        ctx->cmac.c[2] ^= (u8)(alen >> (56 % (sizeof(alen) * 8)));
-        ctx->cmac.c[3] ^= (u8)(alen >> (48 % (sizeof(alen) * 8)));
-        ctx->cmac.c[4] ^= (u8)(alen >> (40 % (sizeof(alen) * 8)));
-        ctx->cmac.c[5] ^= (u8)(alen >> (32 % (sizeof(alen) * 8)));
-        ctx->cmac.c[6] ^= (u8)(alen >> 24);
-        ctx->cmac.c[7] ^= (u8)(alen >> 16);
-        ctx->cmac.c[8] ^= (u8)(alen >> 8);
-        ctx->cmac.c[9] ^= (u8)alen;
+        ctx->cmac.c[2] ^= (uint8_t)(alen >> (56 % (sizeof(alen) * 8)));
+        ctx->cmac.c[3] ^= (uint8_t)(alen >> (48 % (sizeof(alen) * 8)));
+        ctx->cmac.c[4] ^= (uint8_t)(alen >> (40 % (sizeof(alen) * 8)));
+        ctx->cmac.c[5] ^= (uint8_t)(alen >> (32 % (sizeof(alen) * 8)));
+        ctx->cmac.c[6] ^= (uint8_t)(alen >> 24);
+        ctx->cmac.c[7] ^= (uint8_t)(alen >> 16);
+        ctx->cmac.c[8] ^= (uint8_t)(alen >> 8);
+        ctx->cmac.c[9] ^= (uint8_t)alen;
         i = 10;
     } else {
         ctx->cmac.c[0] ^= 0xFF;
         ctx->cmac.c[1] ^= 0xFE;
-        ctx->cmac.c[2] ^= (u8)(alen >> 24);
-        ctx->cmac.c[3] ^= (u8)(alen >> 16);
-        ctx->cmac.c[4] ^= (u8)(alen >> 8);
-        ctx->cmac.c[5] ^= (u8)alen;
+        ctx->cmac.c[2] ^= (uint8_t)(alen >> 24);
+        ctx->cmac.c[3] ^= (uint8_t)(alen >> 16);
+        ctx->cmac.c[4] ^= (uint8_t)(alen >> 8);
+        ctx->cmac.c[5] ^= (uint8_t)alen;
         i = 6;
     }

@@ -121,7 +121,7 @@ void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx,
 static void ctr64_inc(unsigned char *counter)
 {
     unsigned int n = 8;
-    u8 c;
+    uint8_t c;

     counter += 8;
     do {
@@ -144,8 +144,8 @@ int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx,
     block128_f block = ctx->block;
     void *key = ctx->key;
     union {
-        u64 u[2];
-        u8 c[16];
+        uint64_t u[2];
+        uint8_t c[16];
     } scratch;

     if (!(flags0 & 0x40))
@@ -170,8 +170,8 @@ int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx,
     while (len >= 16) {
 #if defined(STRICT_ALIGNMENT)
         union {
-            u64 u[2];
-            u8 c[16];
+            uint64_t u[2];
+            uint8_t c[16];
         } temp;

         memcpy(temp.c, inp, 16);
@@ -228,8 +228,8 @@ int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx,
     block128_f block = ctx->block;
     void *key = ctx->key;
     union {
-        u64 u[2];
-        u8 c[16];
+        uint64_t u[2];
+        uint8_t c[16];
     } scratch;

     if (!(flags0 & 0x40))
@@ -250,8 +250,8 @@ int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx,
     while (len >= 16) {
 #if defined(STRICT_ALIGNMENT)
         union {
-            u64 u[2];
-            u8 c[16];
+            uint64_t u[2];
+            uint8_t c[16];
         } temp;
 #endif
         (*block)(ctx->nonce.c, scratch.c, key);
@@ -317,8 +317,8 @@ int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx,
     block128_f block = ctx->block;
     void *key = ctx->key;
     union {
-        u64 u[2];
-        u8 c[16];
+        uint64_t u[2];
+        uint8_t c[16];
     } scratch;

     if (!(flags0 & 0x40))
@@ -381,8 +381,8 @@ int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx,
     block128_f block = ctx->block;
     void *key = ctx->key;
     union {
-        u64 u[2];
-        u8 c[16];
+        uint64_t u[2];
+        uint8_t c[16];
     } scratch;

     if (!(flags0 & 0x40))
diff --git a/deps/openssl/openssl/crypto/modes/ctr128.c b/deps/openssl/openssl/crypto/modes/ctr128.c
index 6013d6ee411..29a48fe0df7 100644
--- a/deps/openssl/openssl/crypto/modes/ctr128.c
+++ b/deps/openssl/openssl/crypto/modes/ctr128.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -26,12 +26,12 @@ typedef size_t size_t_aX;
 /* increment counter (128-bit int) by 1 */
 static void ctr128_inc(unsigned char *counter)
 {
-    u32 n = 16, c = 1;
+    uint32_t n = 16, c = 1;

     do {
         --n;
         c += counter[n];
-        counter[n] = (u8)c;
+        counter[n] = (uint8_t)c;
         c >>= 8;
     } while (n);
 }
@@ -137,12 +137,12 @@ void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
 /* increment upper 96 bits of 128-bit counter by 1 */
 static void ctr96_inc(unsigned char *counter)
 {
-    u32 n = 12, c = 1;
+    uint32_t n = 12, c = 1;

     do {
         --n;
         c += counter[n];
-        counter[n] = (u8)c;
+        counter[n] = (uint8_t)c;
         c >>= 8;
     } while (n);
 }
@@ -179,7 +179,7 @@ void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,
          * overflow, which is then handled by limiting the
          * amount of blocks to the exact overflow point...
          */
-        ctr32 += (u32)blocks;
+        ctr32 += (uint32_t)blocks;
         if (ctr32 < blocks) {
             blocks -= ctr32;
             ctr32 = 0;
diff --git a/deps/openssl/openssl/crypto/modes/gcm128.c b/deps/openssl/openssl/crypto/modes/gcm128.c
index 16c13e2961e..f1a6ebff173 100644
--- a/deps/openssl/openssl/crypto/modes/gcm128.c
+++ b/deps/openssl/openssl/crypto/modes/gcm128.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2010-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -22,9 +22,9 @@ typedef size_t size_t_aX;
 #if defined(BSWAP4) && defined(STRICT_ALIGNMENT)
 /* redefine, because alignment is ensured */
 #undef GETU32
-#define GETU32(p) BSWAP4(*(const u32 *)(p))
+#define GETU32(p) BSWAP4(*(const uint32_t *)(p))
 #undef PUTU32
-#define PUTU32(p, v) *(u32 *)(p) = BSWAP4(v)
+#define PUTU32(p, v) *(uint32_t *)(p) = BSWAP4(v)
 #endif

 /* RISC-V uses C implementation as a fallback. */
@@ -34,17 +34,17 @@ typedef size_t size_t_aX;
 #endif

 #define PACK(s) ((size_t)(s) << (sizeof(size_t) * 8 - 16))
-#define REDUCE1BIT(V)                                           \
-    do {                                                        \
-        if (sizeof(size_t) == 8) {                              \
-            u64 T = U64(0xe100000000000000) & (0 - (V.lo & 1)); \
-            V.lo = (V.hi << 63) | (V.lo >> 1);                  \
-            V.hi = (V.hi >> 1) ^ T;                             \
-        } else {                                                \
-            u32 T = 0xe1000000U & (0 - (u32)(V.lo & 1));        \
-            V.lo = (V.hi << 63) | (V.lo >> 1);                  \
-            V.hi = (V.hi >> 1) ^ ((u64)T << 32);                \
-        }                                                       \
+#define REDUCE1BIT(V)                                                \
+    do {                                                             \
+        if (sizeof(size_t) == 8) {                                   \
+            uint64_t T = U64(0xe100000000000000) & (0 - (V.lo & 1)); \
+            V.lo = (V.hi << 63) | (V.lo >> 1);                       \
+            V.hi = (V.hi >> 1) ^ T;                                  \
+        } else {                                                     \
+            uint32_t T = 0xe1000000U & (0 - (uint32_t)(V.lo & 1));   \
+            V.lo = (V.hi << 63) | (V.lo >> 1);                       \
+            V.hi = (V.hi >> 1) ^ ((uint64_t)T << 32);                \
+        }                                                            \
     } while (0)

 /*-
@@ -85,7 +85,7 @@ typedef size_t size_t_aX;
  * Value of 1 is not appropriate for performance reasons.
  */

-static void gcm_init_4bit(u128 Htable[16], const u64 H[2])
+static void gcm_init_4bit(u128 Htable[16], const uint64_t H[2])
 {
     u128 V;
 #if defined(OPENSSL_SMALL_FOOTPRINT)
@@ -165,14 +165,14 @@ static const size_t rem_4bit[16] = {
     PACK(0x9180), PACK(0x8DA0), PACK(0xA9C0), PACK(0xB5E0)
 };

-static void gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16])
+static void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16])
 {
     u128 Z;
     int cnt = 15;
     size_t rem, nlo, nhi;
     DECLARE_IS_ENDIAN;

-    nlo = ((const u8 *)Xi)[15];
+    nlo = ((const uint8_t *)Xi)[15];
     nhi = nlo >> 4;
     nlo &= 0xf;

@@ -186,7 +186,7 @@ static void gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16])
         if (sizeof(size_t) == 8)
             Z.hi ^= rem_4bit[rem];
         else
-            Z.hi ^= (u64)rem_4bit[rem] << 32;
+            Z.hi ^= (uint64_t)rem_4bit[rem] << 32;

         Z.hi ^= Htable[nhi].hi;
         Z.lo ^= Htable[nhi].lo;
@@ -194,7 +194,7 @@ static void gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16])
         if (--cnt < 0)
             break;

-        nlo = ((const u8 *)Xi)[cnt];
+        nlo = ((const uint8_t *)Xi)[cnt];
         nhi = nlo >> 4;
         nlo &= 0xf;

@@ -204,7 +204,7 @@ static void gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16])
         if (sizeof(size_t) == 8)
             Z.hi ^= rem_4bit[rem];
         else
-            Z.hi ^= (u64)rem_4bit[rem] << 32;
+            Z.hi ^= (uint64_t)rem_4bit[rem] << 32;

         Z.hi ^= Htable[nlo].hi;
         Z.lo ^= Htable[nlo].lo;
@@ -215,15 +215,15 @@ static void gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16])
         Xi[0] = BSWAP8(Z.hi);
         Xi[1] = BSWAP8(Z.lo);
 #else
-        u8 *p = (u8 *)Xi;
-        u32 v;
-        v = (u32)(Z.hi >> 32);
+        uint8_t *p = (uint8_t *)Xi;
+        uint32_t v;
+        v = (uint32_t)(Z.hi >> 32);
         PUTU32(p, v);
-        v = (u32)(Z.hi);
+        v = (uint32_t)(Z.hi);
         PUTU32(p + 4, v);
-        v = (u32)(Z.lo >> 32);
+        v = (uint32_t)(Z.lo >> 32);
         PUTU32(p + 8, v);
-        v = (u32)(Z.lo);
+        v = (uint32_t)(Z.lo);
         PUTU32(p + 12, v);
 #endif
     } else {
@@ -243,8 +243,8 @@ static void gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16])
  * mostly as reference and a placeholder for possible future
  * non-trivial optimization[s]...
  */
-static void gcm_ghash_4bit(u64 Xi[2], const u128 Htable[16],
-    const u8 *inp, size_t len)
+static void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16],
+    const uint8_t *inp, size_t len)
 {
     u128 Z;
     int cnt;
@@ -253,7 +253,7 @@ static void gcm_ghash_4bit(u64 Xi[2], const u128 Htable[16],

     do {
         cnt = 15;
-        nlo = ((const u8 *)Xi)[15];
+        nlo = ((const uint8_t *)Xi)[15];
         nlo ^= inp[15];
         nhi = nlo >> 4;
         nlo &= 0xf;
@@ -268,7 +268,7 @@ static void gcm_ghash_4bit(u64 Xi[2], const u128 Htable[16],
             if (sizeof(size_t) == 8)
                 Z.hi ^= rem_4bit[rem];
             else
-                Z.hi ^= (u64)rem_4bit[rem] << 32;
+                Z.hi ^= (uint64_t)rem_4bit[rem] << 32;

             Z.hi ^= Htable[nhi].hi;
             Z.lo ^= Htable[nhi].lo;
@@ -276,7 +276,7 @@ static void gcm_ghash_4bit(u64 Xi[2], const u128 Htable[16],
             if (--cnt < 0)
                 break;

-            nlo = ((const u8 *)Xi)[cnt];
+            nlo = ((const uint8_t *)Xi)[cnt];
             nlo ^= inp[cnt];
             nhi = nlo >> 4;
             nlo &= 0xf;
@@ -287,7 +287,7 @@ static void gcm_ghash_4bit(u64 Xi[2], const u128 Htable[16],
             if (sizeof(size_t) == 8)
                 Z.hi ^= rem_4bit[rem];
             else
-                Z.hi ^= (u64)rem_4bit[rem] << 32;
+                Z.hi ^= (uint64_t)rem_4bit[rem] << 32;

             Z.hi ^= Htable[nlo].hi;
             Z.lo ^= Htable[nlo].lo;
@@ -298,15 +298,15 @@ static void gcm_ghash_4bit(u64 Xi[2], const u128 Htable[16],
             Xi[0] = BSWAP8(Z.hi);
             Xi[1] = BSWAP8(Z.lo);
 #else
-            u8 *p = (u8 *)Xi;
-            u32 v;
-            v = (u32)(Z.hi >> 32);
+            uint8_t *p = (uint8_t *)Xi;
+            uint32_t v;
+            v = (uint32_t)(Z.hi >> 32);
             PUTU32(p, v);
-            v = (u32)(Z.hi);
+            v = (uint32_t)(Z.hi);
             PUTU32(p + 4, v);
-            v = (u32)(Z.lo >> 32);
+            v = (uint32_t)(Z.lo >> 32);
             PUTU32(p + 8, v);
-            v = (u32)(Z.lo);
+            v = (uint32_t)(Z.lo);
             PUTU32(p + 12, v);
 #endif
         } else {
@@ -321,8 +321,8 @@ static void gcm_ghash_4bit(u64 Xi[2], const u128 Htable[16],
 }
 #endif
 #else
-void gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16]);
-void gcm_ghash_4bit(u64 Xi[2], const u128 Htable[16], const u8 *inp,
+void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]);
+void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp,
     size_t len);
 #endif

@@ -341,9 +341,9 @@ void gcm_ghash_4bit(u64 Xi[2], const u128 Htable[16], const u8 *inp,
 #if !defined(I386_ONLY) && (defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))
 #define GHASH_ASM_X86_OR_64

-void gcm_init_clmul(u128 Htable[16], const u64 Xi[2]);
-void gcm_gmult_clmul(u64 Xi[2], const u128 Htable[16]);
-void gcm_ghash_clmul(u64 Xi[2], const u128 Htable[16], const u8 *inp,
+void gcm_init_clmul(u128 Htable[16], const uint64_t Xi[2]);
+void gcm_gmult_clmul(uint64_t Xi[2], const u128 Htable[16]);
+void gcm_ghash_clmul(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp,
     size_t len);

 #if defined(__i386) || defined(__i386__) || defined(_M_IX86)
@@ -351,77 +351,83 @@ void gcm_ghash_clmul(u64 Xi[2], const u128 Htable[16], const u8 *inp,
 #define gcm_gmult_avx gcm_gmult_clmul
 #define gcm_ghash_avx gcm_ghash_clmul
 #else
-void gcm_init_avx(u128 Htable[16], const u64 Xi[2]);
-void gcm_gmult_avx(u64 Xi[2], const u128 Htable[16]);
-void gcm_ghash_avx(u64 Xi[2], const u128 Htable[16], const u8 *inp,
+void gcm_init_avx(u128 Htable[16], const uint64_t Xi[2]);
+void gcm_gmult_avx(uint64_t Xi[2], const u128 Htable[16]);
+void gcm_ghash_avx(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp,
     size_t len);
 #endif

 #if defined(__i386) || defined(__i386__) || defined(_M_IX86)
 #define GHASH_ASM_X86
-void gcm_gmult_4bit_mmx(u64 Xi[2], const u128 Htable[16]);
-void gcm_ghash_4bit_mmx(u64 Xi[2], const u128 Htable[16], const u8 *inp,
+void gcm_gmult_4bit_mmx(uint64_t Xi[2], const u128 Htable[16]);
+void gcm_ghash_4bit_mmx(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp,
     size_t len);

-void gcm_gmult_4bit_x86(u64 Xi[2], const u128 Htable[16]);
-void gcm_ghash_4bit_x86(u64 Xi[2], const u128 Htable[16], const u8 *inp,
+void gcm_gmult_4bit_x86(uint64_t Xi[2], const u128 Htable[16]);
+void gcm_ghash_4bit_x86(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp,
     size_t len);
 #endif
 #elif defined(__arm__) || defined(__arm) || defined(__aarch64__) || defined(_M_ARM64)
-#include "arm_arch.h"
+#include "arch/arm_arch.h"
 #if __ARM_MAX_ARCH__ >= 7
 #define GHASH_ASM_ARM
 #define PMULL_CAPABLE (OPENSSL_armcap_P & ARMV8_PMULL)
 #if defined(__arm__) || defined(__arm)
 #define NEON_CAPABLE (OPENSSL_armcap_P & ARMV7_NEON)
 #endif
-void gcm_init_neon(u128 Htable[16], const u64 Xi[2]);
-void gcm_gmult_neon(u64 Xi[2], const u128 Htable[16]);
-void gcm_ghash_neon(u64 Xi[2], const u128 Htable[16], const u8 *inp,
+void gcm_init_neon(u128 Htable[16], const uint64_t Xi[2]);
+void gcm_gmult_neon(uint64_t Xi[2], const u128 Htable[16]);
+void gcm_ghash_neon(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp,
     size_t len);
-void gcm_init_v8(u128 Htable[16], const u64 Xi[2]);
-void gcm_gmult_v8(u64 Xi[2], const u128 Htable[16]);
-void gcm_ghash_v8(u64 Xi[2], const u128 Htable[16], const u8 *inp,
+void gcm_init_v8(u128 Htable[16], const uint64_t Xi[2]);
+void gcm_gmult_v8(uint64_t Xi[2], const u128 Htable[16]);
+void gcm_ghash_v8(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp,
     size_t len);
 #endif
 #elif defined(__sparc__) || defined(__sparc)
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"
 #define GHASH_ASM_SPARC
-void gcm_init_vis3(u128 Htable[16], const u64 Xi[2]);
-void gcm_gmult_vis3(u64 Xi[2], const u128 Htable[16]);
-void gcm_ghash_vis3(u64 Xi[2], const u128 Htable[16], const u8 *inp,
+void gcm_init_vis3(u128 Htable[16], const uint64_t Xi[2]);
+void gcm_gmult_vis3(uint64_t Xi[2], const u128 Htable[16]);
+void gcm_ghash_vis3(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp,
     size_t len);
 #elif defined(OPENSSL_CPUID_OBJ) && (defined(__powerpc__) || defined(__POWERPC__) || defined(_ARCH_PPC))
-#include "crypto/ppc_arch.h"
+#include "arch/ppc_arch.h"
 #define GHASH_ASM_PPC
-void gcm_init_p8(u128 Htable[16], const u64 Xi[2]);
-void gcm_gmult_p8(u64 Xi[2], const u128 Htable[16]);
-void gcm_ghash_p8(u64 Xi[2], const u128 Htable[16], const u8 *inp,
+void gcm_init_p8(u128 Htable[16], const uint64_t Xi[2]);
+void gcm_gmult_p8(uint64_t Xi[2], const u128 Htable[16]);
+void gcm_ghash_p8(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp,
     size_t len);
 #elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
-#include "crypto/riscv_arch.h"
+#include "arch/riscv_arch.h"
 #define GHASH_ASM_RV64I
 /* Zbc/Zbkc (scalar crypto with clmul) based routines. */
-void gcm_init_rv64i_zbc(u128 Htable[16], const u64 Xi[2]);
-void gcm_init_rv64i_zbc__zbb(u128 Htable[16], const u64 Xi[2]);
-void gcm_init_rv64i_zbc__zbkb(u128 Htable[16], const u64 Xi[2]);
-void gcm_gmult_rv64i_zbc(u64 Xi[2], const u128 Htable[16]);
-void gcm_gmult_rv64i_zbc__zbkb(u64 Xi[2], const u128 Htable[16]);
-void gcm_ghash_rv64i_zbc(u64 Xi[2], const u128 Htable[16],
-    const u8 *inp, size_t len);
-void gcm_ghash_rv64i_zbc__zbkb(u64 Xi[2], const u128 Htable[16],
-    const u8 *inp, size_t len);
+void gcm_init_rv64i_zbc(u128 Htable[16], const uint64_t Xi[2]);
+void gcm_init_rv64i_zbc__zbb(u128 Htable[16], const uint64_t Xi[2]);
+void gcm_init_rv64i_zbc__zbkb(u128 Htable[16], const uint64_t Xi[2]);
+void gcm_gmult_rv64i_zbc(uint64_t Xi[2], const u128 Htable[16]);
+void gcm_gmult_rv64i_zbc__zbkb(uint64_t Xi[2], const u128 Htable[16]);
+void gcm_ghash_rv64i_zbc(uint64_t Xi[2], const u128 Htable[16],
+    const uint8_t *inp, size_t len);
+void gcm_ghash_rv64i_zbc__zbkb(uint64_t Xi[2], const u128 Htable[16],
+    const uint8_t *inp, size_t len);
 /* zvkb/Zvbc (vector crypto with vclmul) based routines. */
-void gcm_init_rv64i_zvkb_zvbc(u128 Htable[16], const u64 Xi[2]);
-void gcm_gmult_rv64i_zvkb_zvbc(u64 Xi[2], const u128 Htable[16]);
-void gcm_ghash_rv64i_zvkb_zvbc(u64 Xi[2], const u128 Htable[16],
-    const u8 *inp, size_t len);
+void gcm_init_rv64i_zvkb_zvbc(u128 Htable[16], const uint64_t Xi[2]);
+void gcm_gmult_rv64i_zvkb_zvbc(uint64_t Xi[2], const u128 Htable[16]);
+void gcm_ghash_rv64i_zvkb_zvbc(uint64_t Xi[2], const u128 Htable[16],
+    const uint8_t *inp, size_t len);
 /* Zvkg (vector crypto with vgmul.vv and vghsh.vv). */
-void gcm_init_rv64i_zvkg(u128 Htable[16], const u64 Xi[2]);
-void gcm_init_rv64i_zvkg_zvkb(u128 Htable[16], const u64 Xi[2]);
-void gcm_gmult_rv64i_zvkg(u64 Xi[2], const u128 Htable[16]);
-void gcm_ghash_rv64i_zvkg(u64 Xi[2], const u128 Htable[16],
-    const u8 *inp, size_t len);
+void gcm_init_rv64i_zvkg(u128 Htable[16], const uint64_t Xi[2]);
+void gcm_init_rv64i_zvkg_zvkb(u128 Htable[16], const uint64_t Xi[2]);
+void gcm_gmult_rv64i_zvkg(uint64_t Xi[2], const u128 Htable[16]);
+void gcm_ghash_rv64i_zvkg(uint64_t Xi[2], const u128 Htable[16],
+    const uint8_t *inp, size_t len);
+#elif defined(__e2k__) && (__iset__ >= 6)
+#define GHASH_ASM_E2KV6
+void gcm_init_e2kv6_clmul(u128 Htable[16], const uint64_t Xi[2]);
+void gcm_gmult_e2kv6_clmul(uint64_t Xi[2], const u128 Htable[16]);
+void gcm_ghash_e2kv6_clmul(uint64_t Xi[2], const u128 Htable[16],
+    const uint8_t *inp, size_t len);
 #endif
 #endif

@@ -552,6 +558,11 @@ static void gcm_get_funcs(struct gcm_funcs_st *ctx)
         }
     }
     return;
+#elif defined(GHASH_ASM_E2KV6)
+    ctx->ginit = gcm_init_e2kv6_clmul;
+    ctx->gmult = gcm_gmult_e2kv6_clmul;
+    ctx->ghash = gcm_ghash_e2kv6_clmul;
+    return;
 #elif defined(GHASH_ASM)
     /* all other architectures use the generic names */
     ctx->gmult = gcm_gmult_4bit;
@@ -560,7 +571,7 @@ static void gcm_get_funcs(struct gcm_funcs_st *ctx)
 #endif
 }

-void ossl_gcm_init_4bit(u128 Htable[16], const u64 H[2])
+void ossl_gcm_init_4bit(u128 Htable[16], const uint64_t H[2])
 {
     struct gcm_funcs_st funcs;

@@ -568,7 +579,7 @@ void ossl_gcm_init_4bit(u128 Htable[16], const u64 H[2])
     funcs.ginit(Htable, H);
 }

-void ossl_gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16])
+void ossl_gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16])
 {
     struct gcm_funcs_st funcs;

@@ -576,11 +587,11 @@ void ossl_gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16])
     funcs.gmult(Xi, Htable);
 }

-void ossl_gcm_ghash_4bit(u64 Xi[2], const u128 Htable[16],
-    const u8 *inp, size_t len)
+void ossl_gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16],
+    const uint8_t *inp, size_t len)
 {
     struct gcm_funcs_st funcs;
-    u64 tmp[2];
+    uint64_t tmp[2];
     size_t i;

     gcm_get_funcs(&funcs);
@@ -613,10 +624,10 @@ void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block)
         ctx->H.u[0] = BSWAP8(ctx->H.u[0]);
         ctx->H.u[1] = BSWAP8(ctx->H.u[1]);
 #else
-        u8 *p = ctx->H.c;
-        u64 hi, lo;
-        hi = (u64)GETU32(p) << 32 | GETU32(p + 4);
-        lo = (u64)GETU32(p + 8) << 32 | GETU32(p + 12);
+        uint8_t *p = ctx->H.c;
+        uint64_t hi, lo;
+        hi = (uint64_t)GETU32(p) << 32 | GETU32(p + 4);
+        lo = (uint64_t)GETU32(p + 8) << 32 | GETU32(p + 12);
         ctx->H.u[0] = hi;
         ctx->H.u[1] = lo;
 #endif
@@ -646,7 +657,7 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv,
         ctr = 1;
     } else {
         size_t i;
-        u64 len0 = len;
+        uint64_t len0 = len;

         /* Borrow ctx->Xi to calculate initial Yi */
         ctx->Xi.u[0] = 0;
@@ -669,14 +680,14 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv,
 #ifdef BSWAP8
             ctx->Xi.u[1] ^= BSWAP8(len0);
 #else
-            ctx->Xi.c[8] ^= (u8)(len0 >> 56);
-            ctx->Xi.c[9] ^= (u8)(len0 >> 48);
-            ctx->Xi.c[10] ^= (u8)(len0 >> 40);
-            ctx->Xi.c[11] ^= (u8)(len0 >> 32);
-            ctx->Xi.c[12] ^= (u8)(len0 >> 24);
-            ctx->Xi.c[13] ^= (u8)(len0 >> 16);
-            ctx->Xi.c[14] ^= (u8)(len0 >> 8);
-            ctx->Xi.c[15] ^= (u8)(len0);
+            ctx->Xi.c[8] ^= (uint8_t)(len0 >> 56);
+            ctx->Xi.c[9] ^= (uint8_t)(len0 >> 48);
+            ctx->Xi.c[10] ^= (uint8_t)(len0 >> 40);
+            ctx->Xi.c[11] ^= (uint8_t)(len0 >> 32);
+            ctx->Xi.c[12] ^= (uint8_t)(len0 >> 24);
+            ctx->Xi.c[13] ^= (uint8_t)(len0 >> 16);
+            ctx->Xi.c[14] ^= (uint8_t)(len0 >> 8);
+            ctx->Xi.c[15] ^= (uint8_t)(len0);
 #endif
         } else {
             ctx->Xi.u[1] ^= len0;
@@ -718,7 +729,7 @@ int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad,
 {
     size_t i;
     unsigned int n;
-    u64 alen = ctx->len.u[0];
+    uint64_t alen = ctx->len.u[0];

     if (ctx->len.u[1])
         return -2;
@@ -774,7 +785,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx,
     DECLARE_IS_ENDIAN;
     unsigned int n, ctr, mres;
     size_t i;
-    u64 mlen = ctx->len.u[1];
+    uint64_t mlen = ctx->len.u[1];
     block128_f block = ctx->block;
     void *key = ctx->key;

@@ -999,7 +1010,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
     DECLARE_IS_ENDIAN;
     unsigned int n, ctr, mres;
     size_t i;
-    u64 mlen = ctx->len.u[1];
+    uint64_t mlen = ctx->len.u[1];
     block128_f block = ctx->block;
     void *key = ctx->key;

@@ -1057,7 +1068,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
                 }
 #else
                 while (n && len) {
-                    u8 c = *(in++);
+                    uint8_t c = *(in++);
                     *(out++) = c ^ ctx->EKi.c[n];
                     ctx->Xi.c[n] ^= c;
                     --len;
@@ -1176,7 +1187,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
                 }
 #else
                 while (len--) {
-                    u8 c = in[n];
+                    uint8_t c = in[n];
                     ctx->Xi.c[n] ^= c;
                     out[n] = c ^ ctx->EKi.c[n];
                     ++n;
@@ -1191,7 +1202,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
     }
 #endif
     for (i = 0; i < len; ++i) {
-        u8 c;
+        uint8_t c;
         if (n == 0) {
             (*block)(ctx->Yi.c, ctx->EKi.c, key);
             ++ctr;
@@ -1235,7 +1246,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx,
     DECLARE_IS_ENDIAN;
     unsigned int n, ctr, mres;
     size_t i;
-    u64 mlen = ctx->len.u[1];
+    uint64_t mlen = ctx->len.u[1];
     void *key = ctx->key;

     mlen += len;
@@ -1389,7 +1400,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,
     DECLARE_IS_ENDIAN;
     unsigned int n, ctr, mres;
     size_t i;
-    u64 mlen = ctx->len.u[1];
+    uint64_t mlen = ctx->len.u[1];
     void *key = ctx->key;

     mlen += len;
@@ -1443,7 +1454,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,
         }
 #else
         while (n && len) {
-            u8 c = *(in++);
+            uint8_t c = *(in++);
             *(out++) = c ^ ctx->EKi.c[n];
             ctx->Xi.c[n] ^= c;
             --len;
@@ -1527,7 +1538,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,
 #if defined(GHASH)
             out[n] = (ctx->Xn[mres++] = in[n]) ^ ctx->EKi.c[n];
 #else
-            u8 c = in[n];
+            uint8_t c = in[n];
             ctx->Xi.c[mres++] ^= c;
             out[n] = c ^ ctx->EKi.c[n];
 #endif
@@ -1540,12 +1551,19 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,
 #endif
 }

+/*
+ * Calculate the tag and verify it against the supplied tag.
+ * Returns:
+ * -1: invalid tag length
+ *  0: tag verified
+ * >0: tag mismatch
+ */
 int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag,
     size_t len)
 {
     DECLARE_IS_ENDIAN;
-    u64 alen = ctx->len.u[0] << 3;
-    u64 clen = ctx->len.u[1] << 3;
+    uint64_t alen = ctx->len.u[0] << 3;
+    uint64_t clen = ctx->len.u[1] << 3;

 #if defined(GHASH) && !defined(OPENSSL_SMALL_FOOTPRINT)
     u128 bitlen;
@@ -1573,13 +1591,13 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag,
         alen = BSWAP8(alen);
         clen = BSWAP8(clen);
 #else
-        u8 *p = ctx->len.c;
+        uint8_t *p = ctx->len.c;

         ctx->len.u[0] = alen;
         ctx->len.u[1] = clen;

-        alen = (u64)GETU32(p) << 32 | GETU32(p + 4);
-        clen = (u64)GETU32(p + 8) << 32 | GETU32(p + 12);
+        alen = (uint64_t)GETU32(p) << 32 | GETU32(p + 4);
+        clen = (uint64_t)GETU32(p + 8) << 32 | GETU32(p + 12);
 #endif
     }

diff --git a/deps/openssl/openssl/crypto/modes/ocb128.c b/deps/openssl/openssl/crypto/modes/ocb128.c
index 857730c9aa9..7d44ff1a088 100644
--- a/deps/openssl/openssl/crypto/modes/ocb128.c
+++ b/deps/openssl/openssl/crypto/modes/ocb128.c
@@ -17,9 +17,9 @@
 /*
  * Calculate the number of binary trailing zero's in any given number
  */
-static u32 ocb_ntz(u64 n)
+static uint32_t ocb_ntz(uint64_t n)
 {
-    u32 cnt = 0;
+    uint32_t cnt = 0;

     /*
      * We do a right-to-left simple sequential search. This is surprisingly
@@ -110,7 +110,7 @@ static OCB_BLOCK *ocb_lookup_l(OCB128_CONTEXT *ctx, size_t idx)
          * the index.
          */
         ctx->max_l_index += (idx - ctx->max_l_index + 4) & ~3;
-        tmp_ptr = OPENSSL_realloc(ctx->l, ctx->max_l_index * sizeof(OCB_BLOCK));
+        tmp_ptr = OPENSSL_realloc_array(ctx->l, ctx->max_l_index, sizeof(OCB_BLOCK));
         if (tmp_ptr == NULL) /* prevent ctx->l from being clobbered */
             return NULL;
         ctx->l = tmp_ptr;
@@ -155,7 +155,7 @@ int CRYPTO_ocb128_init(OCB128_CONTEXT *ctx, void *keyenc, void *keydec,
     memset(ctx, 0, sizeof(*ctx));
     ctx->l_index = 0;
     ctx->max_l_index = 5;
-    if ((ctx->l = OPENSSL_malloc(ctx->max_l_index * 16)) == NULL)
+    if ((ctx->l = OPENSSL_malloc_array(ctx->max_l_index, 16)) == NULL)
         return 0;

     /*
@@ -200,7 +200,7 @@ int CRYPTO_ocb128_copy_ctx(OCB128_CONTEXT *dest, OCB128_CONTEXT *src,
     if (keydec)
         dest->keydec = keydec;
     if (src->l) {
-        if ((dest->l = OPENSSL_malloc(src->max_l_index * 16)) == NULL)
+        if ((dest->l = OPENSSL_malloc_array(src->max_l_index, 16)) == NULL)
             return 0;
         memcpy(dest->l, src->l, (src->l_index + 1) * 16);
     }
@@ -263,7 +263,7 @@ int CRYPTO_ocb128_setiv(OCB128_CONTEXT *ctx, const unsigned char *iv,
 int CRYPTO_ocb128_aad(OCB128_CONTEXT *ctx, const unsigned char *aad,
     size_t len)
 {
-    u64 i, all_num_blocks;
+    uint64_t i, all_num_blocks;
     size_t num_blocks, last_len;
     OCB_BLOCK tmp;

@@ -325,7 +325,7 @@ int CRYPTO_ocb128_encrypt(OCB128_CONTEXT *ctx,
     const unsigned char *in, unsigned char *out,
     size_t len)
 {
-    u64 i, all_num_blocks;
+    uint64_t i, all_num_blocks;
     size_t num_blocks, last_len;

     /*
@@ -420,7 +420,7 @@ int CRYPTO_ocb128_decrypt(OCB128_CONTEXT *ctx,
     const unsigned char *in, unsigned char *out,
     size_t len)
 {
-    u64 i, all_num_blocks;
+    uint64_t i, all_num_blocks;
     size_t num_blocks, last_len;

     /*
@@ -534,6 +534,10 @@ static int ocb_finish(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len,

 /*
  * Calculate the tag and verify it against the supplied tag
+ * Returns:
+ * -1: invalid tag length
+ *  0: tag verified
+ * >0: tag mismatch
  */
 int CRYPTO_ocb128_finish(OCB128_CONTEXT *ctx, const unsigned char *tag,
     size_t len)
diff --git a/deps/openssl/openssl/crypto/modes/wrap128.c b/deps/openssl/openssl/crypto/modes/wrap128.c
index 0df4dfe786a..165d8e09aa9 100644
--- a/deps/openssl/openssl/crypto/modes/wrap128.c
+++ b/deps/openssl/openssl/crypto/modes/wrap128.c
@@ -198,7 +198,7 @@ size_t CRYPTO_128_wrap_pad(void *key, const unsigned char *icv,
     const size_t padding_len = padded_len - inlen;
     /* RFC 5649 section 3: Alternative Initial Value */
     unsigned char aiv[8];
-    int ret;
+    size_t ret;

     /* Section 1: use 32-bit fixed field for plaintext octet length */
     if (inlen == 0 || inlen >= CRYPTO128_WRAP_MAX)
@@ -288,7 +288,7 @@ size_t CRYPTO_128_unwrap_pad(void *key, const unsigned char *icv,
         padded_len = inlen - 8;
         ret = crypto_128_unwrap_raw(key, aiv, out, in, inlen, block);
         if (padded_len != ret) {
-            OPENSSL_cleanse(out, inlen);
+            OPENSSL_cleanse(out, padded_len);
             return 0;
         }
     }
@@ -300,7 +300,7 @@ size_t CRYPTO_128_unwrap_pad(void *key, const unsigned char *icv,
      */
     if ((!icv && CRYPTO_memcmp(aiv, default_aiv, 4))
         || (icv && CRYPTO_memcmp(aiv, icv, 4))) {
-        OPENSSL_cleanse(out, inlen);
+        OPENSSL_cleanse(out, padded_len);
         return 0;
     }

@@ -314,7 +314,7 @@ size_t CRYPTO_128_unwrap_pad(void *key, const unsigned char *icv,
         | ((unsigned int)aiv[6] << 8)
         | (unsigned int)aiv[7];
     if (8 * (n - 1) >= ptext_len || ptext_len > 8 * n) {
-        OPENSSL_cleanse(out, inlen);
+        OPENSSL_cleanse(out, padded_len);
         return 0;
     }

@@ -324,7 +324,7 @@ size_t CRYPTO_128_unwrap_pad(void *key, const unsigned char *icv,
      */
     padding_len = padded_len - ptext_len;
     if (CRYPTO_memcmp(out + ptext_len, zeros, padding_len) != 0) {
-        OPENSSL_cleanse(out, inlen);
+        OPENSSL_cleanse(out, padded_len);
         return 0;
     }

diff --git a/deps/openssl/openssl/crypto/modes/xts128.c b/deps/openssl/openssl/crypto/modes/xts128.c
index 7b55d1e0b3b..2afcfbaacdc 100644
--- a/deps/openssl/openssl/crypto/modes/xts128.c
+++ b/deps/openssl/openssl/crypto/modes/xts128.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,9 +14,9 @@

 #ifndef STRICT_ALIGNMENT
 #ifdef __GNUC__
-typedef u64 u64_a1 __attribute((__aligned__(1)));
+typedef uint64_t u64_a1 __attribute((__aligned__(1)));
 #else
-typedef u64 u64_a1;
+typedef uint64_t u64_a1;
 #endif
 #endif

@@ -27,9 +27,9 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,
 {
     DECLARE_IS_ENDIAN;
     union {
-        u64 u[2];
-        u32 d[4];
-        u8 c[16];
+        uint64_t u[2];
+        uint32_t d[4];
+        uint8_t c[16];
     } tweak, scratch;
     unsigned int i;

@@ -83,15 +83,15 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,
                  * + substitutes for |, because c is 1 bit
                  */
                 c += ((size_t)tweak.c[i]) << 1;
-                tweak.c[i] = (u8)c;
+                tweak.c[i] = (uint8_t)c;
                 c = c >> 8;
             }
-            tweak.c[0] ^= (u8)(0x87 & (0 - c));
+            tweak.c[0] ^= (uint8_t)(0x87 & (0 - c));
         }
     }
     if (enc) {
         for (i = 0; i < len; ++i) {
-            u8 c = inp[i];
+            uint8_t c = inp[i];
             out[i] = scratch.c[i];
             scratch.c[i] = c;
         }
@@ -103,8 +103,8 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,
         memcpy(out - 16, scratch.c, 16);
     } else {
         union {
-            u64 u[2];
-            u8 c[16];
+            uint64_t u[2];
+            uint8_t c[16];
         } tweak1;

         if (IS_LITTLE_ENDIAN) {
@@ -122,10 +122,10 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,
                  * + substitutes for |, because c is 1 bit
                  */
                 c += ((size_t)tweak.c[i]) << 1;
-                tweak1.c[i] = (u8)c;
+                tweak1.c[i] = (uint8_t)c;
                 c = c >> 8;
             }
-            tweak1.c[0] ^= (u8)(0x87 & (0 - c));
+            tweak1.c[0] ^= (uint8_t)(0x87 & (0 - c));
         }
 #if defined(STRICT_ALIGNMENT)
         memcpy(scratch.c, inp, 16);
@@ -140,7 +140,7 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,
         scratch.u[1] ^= tweak1.u[1];

         for (i = 0; i < len; ++i) {
-            u8 c = inp[16 + i];
+            uint8_t c = inp[16 + i];
             out[16 + i] = scratch.c[i];
             scratch.c[i] = c;
         }
diff --git a/deps/openssl/openssl/crypto/modes/xts128gb.c b/deps/openssl/openssl/crypto/modes/xts128gb.c
index 563077277c7..3ad94e107ae 100644
--- a/deps/openssl/openssl/crypto/modes/xts128gb.c
+++ b/deps/openssl/openssl/crypto/modes/xts128gb.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,9 +14,9 @@

 #ifndef STRICT_ALIGNMENT
 #ifdef __GNUC__
-typedef u64 u64_a1 __attribute((__aligned__(1)));
+typedef uint64_t u64_a1 __attribute((__aligned__(1)));
 #else
-typedef u64 u64_a1;
+typedef uint64_t u64_a1;
 #endif
 #endif

@@ -27,9 +27,9 @@ int ossl_crypto_xts128gb_encrypt(const XTS128_CONTEXT *ctx,
 {
     DECLARE_IS_ENDIAN;
     union {
-        u64 u[2];
-        u32 d[4];
-        u8 c[16];
+        uint64_t u[2];
+        uint32_t d[4];
+        uint8_t c[16];
     } tweak, scratch;
     unsigned int i;

@@ -69,18 +69,18 @@ int ossl_crypto_xts128gb_encrypt(const XTS128_CONTEXT *ctx,
             return 0;

         if (IS_LITTLE_ENDIAN) {
-            u8 res;
-            u64 hi, lo;
+            uint8_t res;
+            uint64_t hi, lo;
 #ifdef BSWAP8
             hi = BSWAP8(tweak.u[0]);
             lo = BSWAP8(tweak.u[1]);
 #else
-            u8 *p = tweak.c;
+            uint8_t *p = tweak.c;

-            hi = (u64)GETU32(p) << 32 | GETU32(p + 4);
-            lo = (u64)GETU32(p + 8) << 32 | GETU32(p + 12);
+            hi = (uint64_t)GETU32(p) << 32 | GETU32(p + 4);
+            lo = (uint64_t)GETU32(p + 8) << 32 | GETU32(p + 12);
 #endif
-            res = (u8)lo & 1;
+            res = (uint8_t)lo & 1;
             tweak.u[0] = (lo >> 1) | (hi << 63);
             tweak.u[1] = hi >> 1;
             if (res)
@@ -91,13 +91,13 @@ int ossl_crypto_xts128gb_encrypt(const XTS128_CONTEXT *ctx,
 #else
             p = tweak.c;

-            hi = (u64)GETU32(p) << 32 | GETU32(p + 4);
-            lo = (u64)GETU32(p + 8) << 32 | GETU32(p + 12);
+            hi = (uint64_t)GETU32(p) << 32 | GETU32(p + 4);
+            lo = (uint64_t)GETU32(p + 8) << 32 | GETU32(p + 12);
 #endif
             tweak.u[0] = lo;
             tweak.u[1] = hi;
         } else {
-            u8 carry, res;
+            uint8_t carry, res;
             carry = 0;
             for (i = 0; i < 16; ++i) {
                 res = (tweak.c[i] << 7) & 0x80;
@@ -110,7 +110,7 @@ int ossl_crypto_xts128gb_encrypt(const XTS128_CONTEXT *ctx,
     }
     if (enc) {
         for (i = 0; i < len; ++i) {
-            u8 c = inp[i];
+            uint8_t c = inp[i];
             out[i] = scratch.c[i];
             scratch.c[i] = c;
         }
@@ -122,23 +122,23 @@ int ossl_crypto_xts128gb_encrypt(const XTS128_CONTEXT *ctx,
         memcpy(out - 16, scratch.c, 16);
     } else {
         union {
-            u64 u[2];
-            u8 c[16];
+            uint64_t u[2];
+            uint8_t c[16];
         } tweak1;

         if (IS_LITTLE_ENDIAN) {
-            u8 res;
-            u64 hi, lo;
+            uint8_t res;
+            uint64_t hi, lo;
 #ifdef BSWAP8
             hi = BSWAP8(tweak.u[0]);
             lo = BSWAP8(tweak.u[1]);
 #else
-            u8 *p = tweak.c;
+            uint8_t *p = tweak.c;

-            hi = (u64)GETU32(p) << 32 | GETU32(p + 4);
-            lo = (u64)GETU32(p + 8) << 32 | GETU32(p + 12);
+            hi = (uint64_t)GETU32(p) << 32 | GETU32(p + 4);
+            lo = (uint64_t)GETU32(p + 8) << 32 | GETU32(p + 12);
 #endif
-            res = (u8)lo & 1;
+            res = (uint8_t)lo & 1;
             tweak1.u[0] = (lo >> 1) | (hi << 63);
             tweak1.u[1] = hi >> 1;
             if (res)
@@ -149,13 +149,13 @@ int ossl_crypto_xts128gb_encrypt(const XTS128_CONTEXT *ctx,
 #else
             p = tweak1.c;

-            hi = (u64)GETU32(p) << 32 | GETU32(p + 4);
-            lo = (u64)GETU32(p + 8) << 32 | GETU32(p + 12);
+            hi = (uint64_t)GETU32(p) << 32 | GETU32(p + 4);
+            lo = (uint64_t)GETU32(p + 8) << 32 | GETU32(p + 12);
 #endif
             tweak1.u[0] = lo;
             tweak1.u[1] = hi;
         } else {
-            u8 carry, res;
+            uint8_t carry, res;
             carry = 0;
             for (i = 0; i < 16; ++i) {
                 res = (tweak.c[i] << 7) & 0x80;
@@ -178,7 +178,7 @@ int ossl_crypto_xts128gb_encrypt(const XTS128_CONTEXT *ctx,
         scratch.u[1] ^= tweak1.u[1];

         for (i = 0; i < len; ++i) {
-            u8 c = inp[16 + i];
+            uint8_t c = inp[16 + i];
             out[16 + i] = scratch.c[i];
             scratch.c[i] = c;
         }
diff --git a/deps/openssl/openssl/crypto/msvc2013_snprintf.c b/deps/openssl/openssl/crypto/msvc2013_snprintf.c
new file mode 100644
index 00000000000..973e86b11bd
--- /dev/null
+++ b/deps/openssl/openssl/crypto/msvc2013_snprintf.c
@@ -0,0 +1,171 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * C99 snprintf and vsnprintf emulation for MSVC versions earlier than
+ * Visual Studio 2015 (_MSC_VER < 1900).  Those compilers ship _snprintf
+ * and _vsnprintf with non-C99 semantics (return -1 on truncation, no
+ * guaranteed NUL termination) and do not provide the standard names at
+ * all.  This file supplies the missing C99 names.
+ *
+ * This file is only compiled when the configured target is one of the
+ * Windows MSVC 2013 compatibility variants; on every other platform
+ * the standard library already provides these symbols.
+ *
+ * IMPORTANT: This translation unit MUST define snprintf and vsnprintf
+ * and nothing else.  This single file is compiled directly into libcrypto,
+ * libssl, and the apps; each references it from its own build.info rather
+ * than keeping a copy.  Because each definition lives in its own .obj, the
+ * linker's archive-search rule ensures only one copy is pulled into any
+ * final binary.  Defining any additional symbol here would risk pulling
+ * multiple copies and producing a duplicate-symbol link error.
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <string.h>
+#include <openssl/bio.h>
+#include <openssl/crypto.h>
+
+/*
+ * _MSC_VER described here:
+ * https://learn.microsoft.com/en-us/cpp/overview/compiler-versions?view=msvc-170
+ *
+ * Beginning with the UCRT in Visual Studio 2015 and Windows 10, snprintf is no
+ * longer identical to _snprintf. The snprintf behavior is now C99 standard
+ * conformant. The difference is that if you run out of buffer, snprintf
+ * null-terminates the end of the buffer and returns the number of characters
+ * that would have been required whereas _snprintf doesn't null-terminate the
+ * buffer and returns -1. Also, snprintf() includes one more character in the
+ * output because it doesn't null-terminate the buffer.
+ * [ https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l?view=msvc-170#remarks
+ *
+ * for older MSVC (older than 2015) we can use _vscprintf() and _vsnprintf()
+ * as suggested here:
+ * https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
+ *
+ */
+int msvc_translate_printf_format(const char *format, const char **out,
+    char **tmp)
+{
+    /* Valid printf conversion specifiers, grouped by category: signed
+     * integers (d i), unsigned (o u x X), floating-point (f F e E g G a A),
+     * misc (c s p n) and MSVC-specific (S Z C). */
+    static const char conv[] = "diouxXfFeEgGaAcspnSZC";
+    const char *p = format;
+    char *dst = NULL, *q = NULL;
+
+    /*
+     * The VS 2013 CRT does not understand the C99 z, t and j length
+     * modifiers. Translate z and t to I (both are pointer-sized on Windows)
+     * and j to I64 (intmax_t is 64 bits). Every input character expands to
+     * at most three output characters (j -> I64), so 3 * length is a safe
+     * bound for the buffer.
+     *
+     * This is done in a single pass: nothing is allocated until the first
+     * modifier is seen, so formats that need no translation return the
+     * original string untouched. EMIT_CHAR() appends a character to the
+     * output once the buffer exists; before that it is a no-op.
+     */
+#define EMIT_CHAR(c)     \
+    do {                 \
+        if (dst != NULL) \
+            *q++ = (c);  \
+    } while (0)
+
+    *out = format;
+    *tmp = NULL;
+
+    while (*p != '\0') {
+        if (*p != '%') { /* literal character */
+            EMIT_CHAR(*p);
+            p++;
+            continue;
+        }
+        p++; /* consume '%' */
+        if (*p == '%') { /* literal "%%" */
+            EMIT_CHAR('%');
+            EMIT_CHAR('%');
+            p++;
+            continue;
+        }
+        EMIT_CHAR('%');
+        while (*p != '\0' && strchr(conv, *p) == NULL) {
+            char c = *p++;
+            if (c != 'z' && c != 't' && c != 'j') { /* verbatim */
+                EMIT_CHAR(c);
+                continue;
+            }
+            if (dst == NULL) { /* first modifier: allocate + flush prefix */
+                size_t len = strlen(format);
+                if (len > (SIZE_MAX - 1) / 3) /* make static analysis happy */
+                    return 0;
+                dst = (char *)OPENSSL_malloc(3 * len + 1);
+                if (dst == NULL)
+                    return 0;
+                q = dst;
+                memcpy(q, format, (size_t)(p - 1 - format));
+                q += p - 1 - format;
+            }
+            EMIT_CHAR('I');
+            if (c == 'j') {
+                EMIT_CHAR('6');
+                EMIT_CHAR('4');
+            }
+        }
+        if (*p != '\0') { /* copy the conversion specifier */
+            EMIT_CHAR(*p);
+            p++;
+        }
+    }
+#undef EMIT_CHAR
+
+    if (dst != NULL) {
+        *q = '\0';
+        *out = dst;
+        *tmp = dst;
+    }
+    return 1;
+}
+
+int vsnprintf(char *buf, size_t n, const char *format, va_list args)
+{
+    int count = -1;
+    va_list args_copy;
+    char *fmt_alloc = NULL;
+    const char *fmt;
+
+    if (!msvc_translate_printf_format(format, &fmt, &fmt_alloc))
+        goto done;
+    va_copy(args_copy, args);
+    count = _vscprintf(fmt, args_copy);
+    va_end(args_copy);
+
+    if (count < 0)
+        goto done;
+
+    if (n > 0)
+        (void)_vsnprintf_s(buf, n, _TRUNCATE, fmt, args);
+
+done:
+    OPENSSL_free(fmt_alloc);
+    return count;
+}
+
+int snprintf(char *buf, size_t n, const char *fmt, ...)
+{
+    va_list args;
+    int ret;
+
+    va_start(args, fmt);
+    ret = vsnprintf(buf, n, fmt, args);
+    va_end(args);
+    return ret;
+}
diff --git a/deps/openssl/openssl/crypto/o_dir.c b/deps/openssl/openssl/crypto/o_dir.c
index 36d33fbed4f..7da07c78ef6 100644
--- a/deps/openssl/openssl/crypto/o_dir.c
+++ b/deps/openssl/openssl/crypto/o_dir.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -31,8 +31,6 @@
 # include "LPdir_vms.c"
 #elif defined OPENSSL_SYS_WIN32
 # include "LPdir_win32.c"
-#elif defined OPENSSL_SYS_WINCE
-# include "LPdir_wince.c"
 #else
 # include "LPdir_nyi.c"
 #endif
diff --git a/deps/openssl/openssl/crypto/o_fopen.c b/deps/openssl/openssl/crypto/o_fopen.c
index 4268e69e5e0..9b13f0a896b 100644
--- a/deps/openssl/openssl/crypto/o_fopen.c
+++ b/deps/openssl/openssl/crypto/o_fopen.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -69,7 +69,7 @@ FILE *openssl_fopen(const char *filename, const char *mode)

         if (MultiByteToWideChar(CP_UTF8, flags,
                 filename, len_0, wfilename, sz)
-            && MultiByteToWideChar(CP_UTF8, 0, mode, strlen(mode) + 1,
+            && MultiByteToWideChar(CP_UTF8, 0, mode, (int)(strlen(mode) + 1),
                 wmode, OSSL_NELEM(wmode))
             && (file = _wfopen(wfilename, wmode)) == NULL && (errno == ENOENT || errno == EBADF)) {
             /*
diff --git a/deps/openssl/openssl/crypto/o_str.c b/deps/openssl/openssl/crypto/o_str.c
index 154393c7b3e..3532276af74 100644
--- a/deps/openssl/openssl/crypto/o_str.c
+++ b/deps/openssl/openssl/crypto/o_str.c
@@ -22,12 +22,15 @@
 char *CRYPTO_strdup(const char *str, const char *file, int line)
 {
     char *ret;
+    size_t len;

     if (str == NULL)
         return NULL;
-    ret = CRYPTO_malloc(strlen(str) + 1, file, line);
+
+    len = strlen(str) + 1;
+    ret = CRYPTO_malloc(len, file, line);
     if (ret != NULL)
-        strcpy(ret, str);
+        memcpy(ret, str, len);
     return ret;
 }

@@ -158,6 +161,52 @@ int OPENSSL_strtoul(const char *str, char **endptr, int base,
     return 1;
 }

+/*
+ * Internal signed counterpart to OPENSSL_strtoul().  Parses a signed long with
+ * the same validation rules: it fails on a conversion error (including
+ * overflow/underflow), if no digits were consumed, or, when |endptr| is NULL,
+ * if the whole string was not consumed.  Returns 1 on success (storing the
+ * result in |*result|), 0 otherwise.
+ */
+int ossl_strtol(const char *str, char **endptr, int base, long *result)
+{
+    char *tmp_endptr;
+    char **internal_endptr = endptr == NULL ? &tmp_endptr : endptr;
+
+    errno = 0;
+
+    *internal_endptr = (char *)str;
+
+    if (result == NULL || str == NULL)
+        return 0;
+
+    *result = strtol(str, internal_endptr, base);
+    if (errno != 0
+        || (endptr == NULL && **internal_endptr != '\0')
+        || str == *internal_endptr)
+        return 0;
+
+    return 1;
+}
+
+/*
+ * As ossl_strtol() but stores the result in an int, additionally failing if
+ * the parsed value does not fit in an int.  Returns 1 on success (storing the
+ * result in |*result|), 0 otherwise.
+ */
+int ossl_strtoint(const char *str, char **endptr, int base, int *result)
+{
+    long l;
+
+    if (result == NULL || !ossl_strtol(str, endptr, base, &l))
+        return 0;
+    if (l < INT_MIN || l > INT_MAX)
+        return 0;
+
+    *result = (int)l;
+    return 1;
+}
+
 int OPENSSL_hexchar2int(unsigned char c)
 {
 #ifdef CHARSET_EBCDIC
@@ -341,6 +390,8 @@ char *ossl_buf2hexstr_sep(const unsigned char *buf, long buflen, char sep)
     char *tmp;
     size_t tmp_n;

+    if (buflen < 0)
+        return NULL;
     if (buflen == 0)
         return OPENSSL_zalloc(1);

@@ -372,7 +423,7 @@ char *OPENSSL_buf2hexstr(const unsigned char *buf, long buflen)

 int openssl_strerror_r(int errnum, char *buf, size_t buflen)
 {
-#if defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(_WIN32_WCE)
+#if defined(_MSC_VER) && _MSC_VER >= 1400
     return !strerror_s(buf, buflen, errnum);
 #elif defined(_GNU_SOURCE)
     char *err;
diff --git a/deps/openssl/openssl/crypto/o_time.c b/deps/openssl/openssl/crypto/o_time.c
deleted file mode 100644
index b2b32064f8b..00000000000
--- a/deps/openssl/openssl/crypto/o_time.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/e_os2.h>
-#include <string.h>
-#include <openssl/crypto.h>
-
-struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
-{
-    struct tm *ts = NULL;
-
-#if defined(OPENSSL_THREADS) && defined(OPENSSL_SYS_VMS)
-    {
-        /*
-         * On VMS, gmtime_r() takes a 32-bit pointer as second argument.
-         * Since we can't know that |result| is in a space that can easily
-         * translate to a 32-bit pointer, we must store temporarily on stack
-         * and copy the result.  The stack is always reachable with 32-bit
-         * pointers.
-         */
-#if defined(OPENSSL_SYS_VMS) && __INITIAL_POINTER_SIZE
-#pragma pointer_size save
-#pragma pointer_size 32
-#endif
-        struct tm data, *ts2 = &data;
-#if defined OPENSSL_SYS_VMS && __INITIAL_POINTER_SIZE
-#pragma pointer_size restore
-#endif
-        if (gmtime_r(timer, ts2) == NULL)
-            return NULL;
-        memcpy(result, ts2, sizeof(struct tm));
-        ts = result;
-    }
-#elif defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_SYS_MACOSX)
-    if (gmtime_r(timer, result) == NULL)
-        return NULL;
-    ts = result;
-#elif defined(OPENSSL_SYS_WINDOWS) && defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(_WIN32_WCE)
-    if (gmtime_s(result, timer))
-        return NULL;
-    ts = result;
-#else
-    ts = gmtime(timer);
-    if (ts == NULL)
-        return NULL;
-
-    memcpy(result, ts, sizeof(struct tm));
-    ts = result;
-#endif
-    return ts;
-}
-
-/*
- * Take a tm structure and add an offset to it. This avoids any OS issues
- * with restricted date types and overflows which cause the year 2038
- * problem.
- */
-
-#define SECS_PER_DAY (24 * 60 * 60)
-
-static long date_to_julian(int y, int m, int d);
-static void julian_to_date(long jd, int *y, int *m, int *d);
-static int julian_adj(const struct tm *tm, int off_day, long offset_sec,
-    long *pday, int *psec);
-
-int OPENSSL_gmtime_adj(struct tm *tm, int off_day, long offset_sec)
-{
-    int time_sec, time_year, time_month, time_day;
-    long time_jd;
-
-    /* Convert time and offset into Julian day and seconds */
-    if (!julian_adj(tm, off_day, offset_sec, &time_jd, &time_sec))
-        return 0;
-
-    /* Convert Julian day back to date */
-
-    julian_to_date(time_jd, &time_year, &time_month, &time_day);
-
-    if (time_year < 1900 || time_year > 9999)
-        return 0;
-
-    /* Update tm structure */
-
-    tm->tm_year = time_year - 1900;
-    tm->tm_mon = time_month - 1;
-    tm->tm_mday = time_day;
-
-    tm->tm_hour = time_sec / 3600;
-    tm->tm_min = (time_sec / 60) % 60;
-    tm->tm_sec = time_sec % 60;
-
-    return 1;
-}
-
-int OPENSSL_gmtime_diff(int *pday, int *psec,
-    const struct tm *from, const struct tm *to)
-{
-    int from_sec, to_sec, diff_sec;
-    long from_jd, to_jd, diff_day;
-    if (!julian_adj(from, 0, 0, &from_jd, &from_sec))
-        return 0;
-    if (!julian_adj(to, 0, 0, &to_jd, &to_sec))
-        return 0;
-    diff_day = to_jd - from_jd;
-    diff_sec = to_sec - from_sec;
-    /* Adjust differences so both positive or both negative */
-    if (diff_day > 0 && diff_sec < 0) {
-        diff_day--;
-        diff_sec += SECS_PER_DAY;
-    }
-    if (diff_day < 0 && diff_sec > 0) {
-        diff_day++;
-        diff_sec -= SECS_PER_DAY;
-    }
-
-    if (pday)
-        *pday = (int)diff_day;
-    if (psec)
-        *psec = diff_sec;
-
-    return 1;
-}
-
-/* Convert tm structure and offset into julian day and seconds */
-static int julian_adj(const struct tm *tm, int off_day, long offset_sec,
-    long *pday, int *psec)
-{
-    int offset_hms;
-    long offset_day, time_jd;
-    int time_year, time_month, time_day;
-    /* split offset into days and day seconds */
-    offset_day = offset_sec / SECS_PER_DAY;
-    /* Avoid sign issues with % operator */
-    offset_hms = offset_sec - (offset_day * SECS_PER_DAY);
-    offset_day += off_day;
-    /* Add current time seconds to offset */
-    offset_hms += tm->tm_hour * 3600 + tm->tm_min * 60 + tm->tm_sec;
-    /* Adjust day seconds if overflow */
-    if (offset_hms >= SECS_PER_DAY) {
-        offset_day++;
-        offset_hms -= SECS_PER_DAY;
-    } else if (offset_hms < 0) {
-        offset_day--;
-        offset_hms += SECS_PER_DAY;
-    }
-
-    /*
-     * Convert date of time structure into a Julian day number.
-     */
-
-    time_year = tm->tm_year + 1900;
-    time_month = tm->tm_mon + 1;
-    time_day = tm->tm_mday;
-
-    time_jd = date_to_julian(time_year, time_month, time_day);
-
-    /* Work out Julian day of new date */
-    time_jd += offset_day;
-
-    if (time_jd < 0)
-        return 0;
-
-    *pday = time_jd;
-    *psec = offset_hms;
-    return 1;
-}
-
-/*
- * Convert date to and from julian day Uses Fliegel & Van Flandern algorithm
- */
-static long date_to_julian(int y, int m, int d)
-{
-    return (1461 * (y + 4800 + (m - 14) / 12)) / 4 + (367 * (m - 2 - 12 * ((m - 14) / 12))) / 12 - (3 * ((y + 4900 + (m - 14) / 12) / 100)) / 4 + d - 32075;
-}
-
-static void julian_to_date(long jd, int *y, int *m, int *d)
-{
-    long L = jd + 68569;
-    long n = (4 * L) / 146097;
-    long i, j;
-
-    L = L - (146097 * n + 3) / 4;
-    i = (4000 * (L + 1)) / 1461001;
-    L = L - (1461 * i) / 4 + 31;
-    j = (80 * L) / 2447;
-    *d = L - (2447 * j) / 80;
-    L = j / 11;
-    *m = j + 2 - (12 * L);
-    *y = 100 * (n - 49) + i + L;
-}
diff --git a/deps/openssl/openssl/crypto/objects/build.info b/deps/openssl/openssl/crypto/objects/build.info
index 38e290756b9..cc4e731ddf2 100644
--- a/deps/openssl/openssl/crypto/objects/build.info
+++ b/deps/openssl/openssl/crypto/objects/build.info
@@ -1,3 +1,14 @@
 LIBS=../../libcrypto
 SOURCE[../../libcrypto]=\
         o_names.c obj_dat.c obj_lib.c obj_err.c obj_xref.c
+
+DEPEND[obj_dat.o]=obj_dat.h
+GENERATE[obj_dat.h]=obj_dat.pl $(BLDDIR)/include/openssl/obj_mac.h
+DEPEND[obj_dat.h]=../../include/openssl/obj_mac.h
+
+DEPEND[obj_xref.o]=obj_xref.h
+GENERATE[obj_xref.h]=objxref.pl $(SRCDIR)/crypto/objects/obj_mac.num \
+    $(SRCDIR)/crypto/objects/obj_xref.txt
+DEPEND[obj_xref.h]=obj_mac.num obj_xref.txt
+INCLUDE[obj_dat.o]=.
+INCLUDE[obj_xref.o]=.
diff --git a/deps/openssl/openssl/crypto/objects/o_names.c b/deps/openssl/openssl/crypto/objects/o_names.c
index a585e381972..2ac33aa5633 100644
--- a/deps/openssl/openssl/crypto/objects/o_names.c
+++ b/deps/openssl/openssl/crypto/objects/o_names.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1998-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -29,12 +29,6 @@ static LHASH_OF(OBJ_NAME) *names_lh = NULL;
 static int names_type_num = OBJ_NAME_TYPE_NUM;
 static CRYPTO_RWLOCK *obj_lock = NULL;

-struct name_funcs_st {
-    unsigned long (*hash_func)(const char *name);
-    int (*cmp_func)(const char *a, const char *b);
-    void (*free_func)(const char *, int, const char *);
-};
-
 static STACK_OF(NAME_FUNCS) *name_funcs_stack;

 /*
@@ -335,7 +329,7 @@ void OBJ_NAME_do_all_sorted(int type,
     int n;

     d.type = type;
-    d.names = OPENSSL_malloc(sizeof(*d.names) * lh_OBJ_NAME_num_items(names_lh));
+    d.names = OPENSSL_malloc_array(lh_OBJ_NAME_num_items(names_lh), sizeof(*d.names));
     /* Really should return an error if !d.names...but its a void function! */
     if (d.names != NULL) {
         d.n = 0;
diff --git a/deps/openssl/openssl/crypto/objects/obj_dat.c b/deps/openssl/openssl/crypto/objects/obj_dat.c
index 9a823d3cd92..cbb98f4030e 100644
--- a/deps/openssl/openssl/crypto/objects/obj_dat.c
+++ b/deps/openssl/openssl/crypto/objects/obj_dat.c
@@ -15,6 +15,7 @@
 #include "internal/tsan_assist.h"
 #include <openssl/lhash.h>
 #include <openssl/asn1.h>
+#include "crypto/asn1/asn1_local.h"
 #include "crypto/objects.h"
 #include <openssl/bn.h>
 #include "crypto/asn1.h"
@@ -37,13 +38,17 @@ struct added_obj_st {
     ASN1_OBJECT *obj;
 };

+static unsigned long added_obj_hash(const ADDED_OBJ *ca);
+static int added_obj_cmp(const ADDED_OBJ *ca, const ADDED_OBJ *cb);
+static int add_object(const ASN1_OBJECT *obj, int indirect);
+
 static LHASH_OF(ADDED_OBJ) *added = NULL;
 static CRYPTO_RWLOCK *ossl_obj_lock = NULL;
 #ifdef TSAN_REQUIRES_LOCKING
 static CRYPTO_RWLOCK *ossl_obj_nid_lock = NULL;
 #endif

-static CRYPTO_ONCE ossl_obj_lock_init = CRYPTO_ONCE_STATIC_INIT;
+static CRYPTO_ONCE ossl_obj_api_init = CRYPTO_ONCE_STATIC_INIT;

 static ossl_inline void objs_free_locks(void)
 {
@@ -55,7 +60,7 @@ static ossl_inline void objs_free_locks(void)
 #endif
 }

-DEFINE_RUN_ONCE_STATIC(obj_lock_initialise)
+DEFINE_RUN_ONCE_STATIC(obj_api_initialise)
 {
     ossl_obj_lock = CRYPTO_THREAD_lock_new();
     if (ossl_obj_lock == NULL)
@@ -68,40 +73,41 @@ DEFINE_RUN_ONCE_STATIC(obj_lock_initialise)
         return 0;
     }
 #endif
+    added = lh_ADDED_OBJ_new(added_obj_hash, added_obj_cmp);
+    if (added == NULL) {
+        objs_free_locks();
+        return 0;
+    }
+
     return 1;
 }

-static ossl_inline int ossl_init_added_lock(void)
+static ossl_inline int ossl_init_added_api(void)
 {
 #ifndef OPENSSL_NO_AUTOLOAD_CONFIG
     /* Make sure we've loaded config before checking for any "added" objects */
     OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
 #endif
-    return RUN_ONCE(&ossl_obj_lock_init, obj_lock_initialise);
+    return RUN_ONCE(&ossl_obj_api_init, obj_api_initialise);
 }

-static ossl_inline int ossl_obj_write_lock(int lock)
+static ossl_inline int ossl_obj_write_lock(void)
 {
-    if (!lock)
-        return 1;
-    if (!ossl_init_added_lock())
+    if (!ossl_init_added_api())
         return 0;
     return CRYPTO_THREAD_write_lock(ossl_obj_lock);
 }

-static ossl_inline int ossl_obj_read_lock(int lock)
+static ossl_inline int ossl_obj_read_lock(void)
 {
-    if (!lock)
-        return 1;
-    if (!ossl_init_added_lock())
+    if (!ossl_init_added_api())
         return 0;
     return CRYPTO_THREAD_read_lock(ossl_obj_lock);
 }

-static ossl_inline void ossl_obj_unlock(int lock)
+static ossl_inline void ossl_obj_unlock(void)
 {
-    if (lock)
-        CRYPTO_THREAD_unlock(ossl_obj_lock);
+    CRYPTO_THREAD_unlock(ossl_obj_lock);
 }

 static int sn_cmp(const ASN1_OBJECT *const *a, const unsigned int *b)
@@ -151,6 +157,18 @@ static unsigned long added_obj_hash(const ADDED_OBJ *ca)
     return ret;
 }

+/*
+ * Compare two ASN1_OBJECTs, including SNAME and LNAME, but not NIDs.
+ */
+static int obj_equivalent(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
+{
+    return OBJ_cmp(a, b) == 0
+        && (a->sn == NULL) == (b->sn == NULL)
+        && strcmp(a->sn ? a->sn : "", b->sn ? b->sn : "") == 0
+        && (a->ln == NULL) == (b->ln == NULL)
+        && strcmp(a->ln ? a->ln : "", b->ln ? b->ln : "") == 0;
+}
+
 static int added_obj_cmp(const ADDED_OBJ *ca, const ADDED_OBJ *cb)
 {
     ASN1_OBJECT *a, *b;
@@ -163,10 +181,7 @@ static int added_obj_cmp(const ADDED_OBJ *ca, const ADDED_OBJ *cb)
     b = cb->obj;
     switch (ca->type) {
     case ADDED_DATA:
-        i = (a->length - b->length);
-        if (i)
-            return i;
-        return memcmp(a->data, b->data, (size_t)a->length);
+        return OBJ_cmp(a, b);
     case ADDED_SNAME:
         if (a->sn == NULL)
             return -1;
@@ -220,110 +235,22 @@ void ossl_obj_cleanup_int(void)
     objs_free_locks();
 }

-/*
- * Requires that the ossl_obj_lock be held
- * if TSAN_REQUIRES_LOCKING defined
- */
-static int obj_new_nid_unlocked(int num)
+int OBJ_new_nid(int num)
 {
     static TSAN_QUALIFIER int new_nid = NUM_NID;
 #ifdef TSAN_REQUIRES_LOCKING
     int i;

+    ossl_obj_write_lock();
     i = new_nid;
     new_nid += num;
-
+    ossl_obj_unlock();
     return i;
 #else
     return tsan_add(&new_nid, num);
 #endif
 }

-int OBJ_new_nid(int num)
-{
-#ifdef TSAN_REQUIRES_LOCKING
-    int i;
-
-    if (!ossl_obj_write_lock(1)) {
-        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
-        return NID_undef;
-    }
-
-    i = obj_new_nid_unlocked(num);
-
-    ossl_obj_unlock(1);
-
-    return i;
-#else
-    return obj_new_nid_unlocked(num);
-#endif
-}
-
-static int ossl_obj_add_object(const ASN1_OBJECT *obj, int lock)
-{
-    ASN1_OBJECT *o = NULL;
-    ADDED_OBJ *ao[4] = { NULL, NULL, NULL, NULL }, *aop[4];
-    int i;
-
-    if ((o = OBJ_dup(obj)) == NULL)
-        return NID_undef;
-    if ((ao[ADDED_NID] = OPENSSL_malloc(sizeof(*ao[0]))) == NULL
-        || (o->length != 0
-            && obj->data != NULL
-            && (ao[ADDED_DATA] = OPENSSL_malloc(sizeof(*ao[0]))) == NULL)
-        || (o->sn != NULL
-            && (ao[ADDED_SNAME] = OPENSSL_malloc(sizeof(*ao[0]))) == NULL)
-        || (o->ln != NULL
-            && (ao[ADDED_LNAME] = OPENSSL_malloc(sizeof(*ao[0]))) == NULL))
-        goto err2;
-
-    if (!ossl_obj_write_lock(lock)) {
-        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
-        goto err2;
-    }
-    if (added == NULL) {
-        added = lh_ADDED_OBJ_new(added_obj_hash, added_obj_cmp);
-        if (added == NULL) {
-            ERR_raise(ERR_LIB_OBJ, ERR_R_CRYPTO_LIB);
-            goto err;
-        }
-    }
-
-    for (i = ADDED_DATA; i <= ADDED_NID; i++) {
-        if (ao[i] != NULL) {
-            ao[i]->type = i;
-            ao[i]->obj = o;
-            aop[i] = lh_ADDED_OBJ_retrieve(added, ao[i]);
-            if (aop[i] != NULL)
-                aop[i]->type = -1;
-            (void)lh_ADDED_OBJ_insert(added, ao[i]);
-            if (lh_ADDED_OBJ_error(added)) {
-                if (aop[i] != NULL)
-                    aop[i]->type = i;
-                while (i-- > ADDED_DATA) {
-                    lh_ADDED_OBJ_delete(added, ao[i]);
-                    if (aop[i] != NULL)
-                        aop[i]->type = i;
-                }
-                ERR_raise(ERR_LIB_OBJ, ERR_R_CRYPTO_LIB);
-                goto err;
-            }
-        }
-    }
-    o->flags &= ~(ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | ASN1_OBJECT_FLAG_DYNAMIC_DATA);
-
-    ossl_obj_unlock(lock);
-    return o->nid;
-
-err:
-    ossl_obj_unlock(lock);
-err2:
-    for (i = ADDED_DATA; i <= ADDED_NID; i++)
-        OPENSSL_free(ao[i]);
-    ASN1_OBJECT_free(o);
-    return NID_undef;
-}
-
 ASN1_OBJECT *OBJ_nid2obj(int n)
 {
     ADDED_OBJ ad, *adp = NULL;
@@ -336,13 +263,12 @@ ASN1_OBJECT *OBJ_nid2obj(int n)
     ad.type = ADDED_NID;
     ad.obj = &ob;
     ob.nid = n;
-    if (!ossl_obj_read_lock(1)) {
+    if (!ossl_obj_read_lock()) {
         ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
         return NULL;
     }
-    if (added != NULL)
-        adp = lh_ADDED_OBJ_retrieve(added, &ad);
-    ossl_obj_unlock(1);
+    adp = lh_ADDED_OBJ_retrieve(added, &ad);
+    ossl_obj_unlock();
     if (adp != NULL)
         return adp->obj;

@@ -366,21 +292,12 @@ const char *OBJ_nid2ln(int n)

 static int obj_cmp(const ASN1_OBJECT *const *ap, const unsigned int *bp)
 {
-    int j;
-    const ASN1_OBJECT *a = *ap;
-    const ASN1_OBJECT *b = &nid_objs[*bp];
-
-    j = (a->length - b->length);
-    if (j)
-        return j;
-    if (a->length == 0)
-        return 0;
-    return memcmp(a->data, b->data, a->length);
+    return OBJ_cmp(*ap, &nid_objs[*bp]);
 }

 IMPLEMENT_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, obj);

-static int ossl_obj_obj2nid(const ASN1_OBJECT *a, const int lock)
+static int ossl_obj_obj2nid(const ASN1_OBJECT *a)
 {
     int nid = NID_undef;
     const unsigned int *op;
@@ -396,18 +313,16 @@ static int ossl_obj_obj2nid(const ASN1_OBJECT *a, const int lock)
     op = OBJ_bsearch_obj(&a, obj_objs, NUM_OBJ);
     if (op != NULL)
         return nid_objs[*op].nid;
-    if (!ossl_obj_read_lock(lock)) {
+    if (!ossl_obj_read_lock()) {
         ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
         return NID_undef;
     }
-    if (added != NULL) {
-        ad.type = ADDED_DATA;
-        ad.obj = (ASN1_OBJECT *)a; /* casting away const is harmless here */
-        adp = lh_ADDED_OBJ_retrieve(added, &ad);
-        if (adp != NULL)
-            nid = adp->obj->nid;
-    }
-    ossl_obj_unlock(lock);
+    ad.type = ADDED_DATA;
+    ad.obj = (ASN1_OBJECT *)a; /* casting away const is harmless here */
+    adp = lh_ADDED_OBJ_retrieve(added, &ad);
+    if (adp != NULL)
+        nid = adp->obj->nid;
+    ossl_obj_unlock();
     return nid;
 }

@@ -484,7 +399,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
             s = OBJ_nid2sn(nid);
         if (s != NULL) {
             if (buf != NULL)
-                OPENSSL_strlcpy(buf, s, buf_len);
+                return (int)OPENSSL_strlcpy(buf, s, buf_len);
             return (int)strlen(s);
         }
     }
@@ -573,7 +488,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
             bndec = BN_bn2dec(bl);
             if (!bndec)
                 goto err;
-            i = strlen(bndec);
+            i = (int)strlen(bndec);
             if (buf != NULL) {
                 if (buf_len > 1) {
                     *buf++ = '.';
@@ -593,8 +508,8 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
             n += i;
             OPENSSL_free(bndec);
         } else {
-            BIO_snprintf(tbuf, sizeof(tbuf), ".%lu", l);
-            i = strlen(tbuf);
+            snprintf(tbuf, sizeof(tbuf), ".%lu", l);
+            i = (int)strlen(tbuf);
             if (buf && buf_len > 0) {
                 OPENSSL_strlcpy(buf, tbuf, buf_len);
                 if (i > buf_len) {
@@ -642,18 +557,16 @@ int OBJ_ln2nid(const char *s)
     op = OBJ_bsearch_ln(&oo, ln_objs, NUM_LN);
     if (op != NULL)
         return nid_objs[*op].nid;
-    if (!ossl_obj_read_lock(1)) {
+    if (!ossl_obj_read_lock()) {
         ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
         return NID_undef;
     }
-    if (added != NULL) {
-        ad.type = ADDED_LNAME;
-        ad.obj = &o;
-        adp = lh_ADDED_OBJ_retrieve(added, &ad);
-        if (adp != NULL)
-            nid = adp->obj->nid;
-    }
-    ossl_obj_unlock(1);
+    ad.type = ADDED_LNAME;
+    ad.obj = &o;
+    adp = lh_ADDED_OBJ_retrieve(added, &ad);
+    if (adp != NULL)
+        nid = adp->obj->nid;
+    ossl_obj_unlock();
     return nid;
 }

@@ -669,18 +582,16 @@ int OBJ_sn2nid(const char *s)
     op = OBJ_bsearch_sn(&oo, sn_objs, NUM_SN);
     if (op != NULL)
         return nid_objs[*op].nid;
-    if (!ossl_obj_read_lock(1)) {
+    if (!ossl_obj_read_lock()) {
         ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
         return NID_undef;
     }
-    if (added != NULL) {
-        ad.type = ADDED_SNAME;
-        ad.obj = &o;
-        adp = lh_ADDED_OBJ_retrieve(added, &ad);
-        if (adp != NULL)
-            nid = adp->obj->nid;
-    }
-    ossl_obj_unlock(1);
+    ad.type = ADDED_SNAME;
+    ad.obj = &o;
+    adp = lh_ADDED_OBJ_retrieve(added, &ad);
+    if (adp != NULL)
+        nid = adp->obj->nid;
+    ossl_obj_unlock();
     return nid;
 }

@@ -695,7 +606,7 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base, int num,
     int (*cmp)(const void *, const void *),
     int flags)
 {
-    const char *p = ossl_bsearch(key, base, num, size, cmp, flags);
+    const char *p = ossl_bsearch(key, base, num, size, cmp, NULL, flags);

 #ifdef CHARSET_EBCDIC
     /*
@@ -776,63 +687,52 @@ int OBJ_create_objects(BIO *in)
 int OBJ_create(const char *oid, const char *sn, const char *ln)
 {
     ASN1_OBJECT *tmpoid = NULL;
-    int ok = 0;
+    int ok = NID_undef;

     /* With no arguments at all, nothing can be done */
     if (oid == NULL && sn == NULL && ln == NULL) {
         ERR_raise(ERR_LIB_OBJ, ERR_R_PASSED_INVALID_ARGUMENT);
-        return 0;
+        return NID_undef;
     }

     /* Check to see if short or long name already present */
     if ((sn != NULL && OBJ_sn2nid(sn) != NID_undef)
         || (ln != NULL && OBJ_ln2nid(ln) != NID_undef)) {
         ERR_raise(ERR_LIB_OBJ, OBJ_R_OID_EXISTS);
-        return 0;
+        return NID_undef;
     }

     if (oid != NULL) {
         /* Convert numerical OID string to an ASN1_OBJECT structure */
         tmpoid = OBJ_txt2obj(oid, 1);
         if (tmpoid == NULL)
-            return 0;
+            return NID_undef;
     } else {
         /* Create a no-OID ASN1_OBJECT */
-        tmpoid = ASN1_OBJECT_new();
+        tmpoid = ossl_asn1_object_new();
         if (tmpoid == NULL) {
             ERR_raise(ERR_LIB_OBJ, ERR_R_ASN1_LIB);
-            return 0;
+            return NID_undef;
         }
     }

-    if (!ossl_obj_write_lock(1)) {
-        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
-        ASN1_OBJECT_free(tmpoid);
-        return 0;
-    }
-
     /* If NID is not NID_undef then object already exists */
     if (oid != NULL
-        && ossl_obj_obj2nid(tmpoid, 0) != NID_undef) {
+        && ossl_obj_obj2nid(tmpoid) != NID_undef) {
         ERR_raise(ERR_LIB_OBJ, OBJ_R_OID_EXISTS);
         goto err;
     }

-    tmpoid->nid = obj_new_nid_unlocked(1);
-
-    if (tmpoid->nid == NID_undef)
-        goto err;
-
+    tmpoid->nid = NID_undef;
     tmpoid->sn = (char *)sn;
     tmpoid->ln = (char *)ln;

-    ok = ossl_obj_add_object(tmpoid, 0);
+    ok = add_object(tmpoid, 1);

     tmpoid->sn = NULL;
     tmpoid->ln = NULL;

 err:
-    ossl_obj_unlock(1);
     ASN1_OBJECT_free(tmpoid);
     return ok;
 }
@@ -851,12 +751,108 @@ const unsigned char *OBJ_get0_data(const ASN1_OBJECT *obj)
     return obj->data;
 }

+static int add_object(const ASN1_OBJECT *obj, int indirect)
+{
+    ASN1_OBJECT *o = NULL, *dup = NULL;
+    ADDED_OBJ *ao[4] = { NULL, NULL, NULL, NULL }, *aop[4];
+    int i, ret = NID_undef, nid = obj->nid;
+
+    /*
+     * Indirect calls leave the NID unspecified, in which case we generate a
+     * fresh NID here.  Direct calls via `OBJ_add_object()` must explicitly
+     * specify the nid, and we then also check against the compile-time bsearch
+     * lists that the indirect calls have checked while holding a read lock.
+     */
+    if (indirect) {
+        if (nid != NID_undef
+            || (nid = OBJ_new_nid(1)) < NUM_NID
+            || (o = OBJ_dup(obj)) == NULL)
+            return ret;
+        o->nid = nid;
+    } else if (nid < NUM_NID
+        || (obj->data != NULL
+            && OBJ_bsearch_obj(&obj, obj_objs, NUM_OBJ) != NULL)
+        || (obj->sn != NULL
+            && OBJ_bsearch_sn(&obj, sn_objs, NUM_SN) != NULL)
+        || (obj->ln != NULL
+            && OBJ_bsearch_ln(&obj, ln_objs, NUM_LN) != NULL)
+        || (o = OBJ_dup(obj)) == NULL) {
+        return ret;
+    }
+
+    if ((ao[ADDED_NID] = OPENSSL_malloc(sizeof(*ao[0]))) == NULL
+        || (o->length != 0
+            && obj->data != NULL
+            && (ao[ADDED_DATA] = OPENSSL_malloc(sizeof(*ao[0]))) == NULL)
+        || (o->sn != NULL
+            && (ao[ADDED_SNAME] = OPENSSL_malloc(sizeof(*ao[0]))) == NULL)
+        || (o->ln != NULL
+            && (ao[ADDED_LNAME] = OPENSSL_malloc(sizeof(*ao[0]))) == NULL))
+        goto err2;
+
+    if (!ossl_obj_write_lock()) {
+        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
+        goto err2;
+    }
+
+    for (i = ADDED_DATA; i <= ADDED_NID; i++) {
+        if (ao[i] == NULL)
+            continue;
+        ao[i]->type = i;
+        ao[i]->obj = o;
+        if ((aop[i] = lh_ADDED_OBJ_retrieve(added, ao[i])) != NULL)
+            dup = aop[i]->obj;
+    }
+
+    if (dup != NULL) {
+        /*
+         * We found a possible conflict.  If the caller did not specify a NID,
+         * return NID_undef to signal the conflict.  Otherwise, if the NID and
+         * parameters are unchanged, return the old NID, else NID_undef to
+         * signal the conflict.  This ensures that object registrations are
+         * immutable.
+         *
+         * In the future, ideally also return an equivalent existing NID also
+         * when the caller did not specify a NID, as in OBJ_create().
+         */
+        if (obj->nid == dup->nid && obj_equivalent(obj, dup))
+            ret = dup->nid;
+        goto err;
+    }
+
+    for (i = ADDED_DATA; i <= ADDED_NID; i++) {
+        if (ao[i] == NULL)
+            continue;
+        (void)lh_ADDED_OBJ_insert(added, ao[i]);
+        if (lh_ADDED_OBJ_error(added)) {
+            while (i-- > ADDED_DATA) {
+                if (ao[i] != NULL)
+                    lh_ADDED_OBJ_delete(added, ao[i]);
+            }
+            ERR_raise(ERR_LIB_OBJ, ERR_R_CRYPTO_LIB);
+            goto err;
+        }
+    }
+    o->flags &= ~(ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | ASN1_OBJECT_FLAG_DYNAMIC_DATA);
+
+    ossl_obj_unlock();
+    return o->nid;
+
+err:
+    ossl_obj_unlock();
+err2:
+    for (i = ADDED_DATA; i <= ADDED_NID; i++)
+        OPENSSL_free(ao[i]);
+    ASN1_OBJECT_free(o);
+    return ret;
+}
+
 int OBJ_add_object(const ASN1_OBJECT *obj)
 {
-    return ossl_obj_add_object(obj, 1);
+    return add_object(obj, 0);
 }

 int OBJ_obj2nid(const ASN1_OBJECT *a)
 {
-    return ossl_obj_obj2nid(a, 1);
+    return ossl_obj_obj2nid(a);
 }
diff --git a/deps/openssl/openssl/crypto/objects/obj_dat.h b/deps/openssl/openssl/crypto/objects/obj_dat.h
deleted file mode 100644
index 8790de50dd6..00000000000
--- a/deps/openssl/openssl/crypto/objects/obj_dat.h
+++ /dev/null
@@ -1,7154 +0,0 @@
-/*
- * WARNING: do not edit!
- * Generated by crypto/objects/obj_dat.pl
- *
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* Serialized OID's */
-static const unsigned char so[9517] = {
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,                 /* [    0] OBJ_rsadsi */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,            /* [    6] OBJ_pkcs */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x02,       /* [   13] OBJ_md2 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,       /* [   21] OBJ_md5 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x04,       /* [   29] OBJ_rc4 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,  /* [   37] OBJ_rsaEncryption */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x02,  /* [   46] OBJ_md2WithRSAEncryption */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x04,  /* [   55] OBJ_md5WithRSAEncryption */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x01,  /* [   64] OBJ_pbeWithMD2AndDES_CBC */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,  /* [   73] OBJ_pbeWithMD5AndDES_CBC */
-    0x55,                                          /* [   82] OBJ_X500 */
-    0x55,0x04,                                     /* [   83] OBJ_X509 */
-    0x55,0x04,0x03,                                /* [   85] OBJ_commonName */
-    0x55,0x04,0x06,                                /* [   88] OBJ_countryName */
-    0x55,0x04,0x07,                                /* [   91] OBJ_localityName */
-    0x55,0x04,0x08,                                /* [   94] OBJ_stateOrProvinceName */
-    0x55,0x04,0x0A,                                /* [   97] OBJ_organizationName */
-    0x55,0x04,0x0B,                                /* [  100] OBJ_organizationalUnitName */
-    0x55,0x08,0x01,0x01,                           /* [  103] OBJ_rsa */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,       /* [  107] OBJ_pkcs7 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,  /* [  115] OBJ_pkcs7_data */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,  /* [  124] OBJ_pkcs7_signed */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,  /* [  133] OBJ_pkcs7_enveloped */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x04,  /* [  142] OBJ_pkcs7_signedAndEnveloped */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x05,  /* [  151] OBJ_pkcs7_digest */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,  /* [  160] OBJ_pkcs7_encrypted */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x03,       /* [  169] OBJ_pkcs3 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x03,0x01,  /* [  177] OBJ_dhKeyAgreement */
-    0x2B,0x0E,0x03,0x02,0x06,                      /* [  186] OBJ_des_ecb */
-    0x2B,0x0E,0x03,0x02,0x09,                      /* [  191] OBJ_des_cfb64 */
-    0x2B,0x0E,0x03,0x02,0x07,                      /* [  196] OBJ_des_cbc */
-    0x2B,0x0E,0x03,0x02,0x11,                      /* [  201] OBJ_des_ede_ecb */
-    0x2B,0x06,0x01,0x04,0x01,0x81,0x3C,0x07,0x01,0x01,0x02,  /* [  206] OBJ_idea_cbc */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,       /* [  217] OBJ_rc2_cbc */
-    0x2B,0x0E,0x03,0x02,0x12,                      /* [  225] OBJ_sha */
-    0x2B,0x0E,0x03,0x02,0x0F,                      /* [  230] OBJ_shaWithRSAEncryption */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,       /* [  235] OBJ_des_ede3_cbc */
-    0x2B,0x0E,0x03,0x02,0x08,                      /* [  243] OBJ_des_ofb64 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,       /* [  248] OBJ_pkcs9 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,  /* [  256] OBJ_pkcs9_emailAddress */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x02,  /* [  265] OBJ_pkcs9_unstructuredName */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,  /* [  274] OBJ_pkcs9_contentType */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,  /* [  283] OBJ_pkcs9_messageDigest */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,  /* [  292] OBJ_pkcs9_signingTime */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,  /* [  301] OBJ_pkcs9_countersignature */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,  /* [  310] OBJ_pkcs9_challengePassword */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x08,  /* [  319] OBJ_pkcs9_unstructuredAddress */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x09,  /* [  328] OBJ_pkcs9_extCertAttributes */
-    0x60,0x86,0x48,0x01,0x86,0xF8,0x42,            /* [  337] OBJ_netscape */
-    0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,       /* [  344] OBJ_netscape_cert_extension */
-    0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x02,       /* [  352] OBJ_netscape_data_type */
-    0x2B,0x0E,0x03,0x02,0x1A,                      /* [  360] OBJ_sha1 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,  /* [  365] OBJ_sha1WithRSAEncryption */
-    0x2B,0x0E,0x03,0x02,0x0D,                      /* [  374] OBJ_dsaWithSHA */
-    0x2B,0x0E,0x03,0x02,0x0C,                      /* [  379] OBJ_dsa_2 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,  /* [  384] OBJ_pbeWithSHA1AndRC2_CBC */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,  /* [  393] OBJ_id_pbkdf2 */
-    0x2B,0x0E,0x03,0x02,0x1B,                      /* [  402] OBJ_dsaWithSHA1_2 */
-    0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x01,  /* [  407] OBJ_netscape_cert_type */
-    0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x02,  /* [  416] OBJ_netscape_base_url */
-    0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x03,  /* [  425] OBJ_netscape_revocation_url */
-    0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x04,  /* [  434] OBJ_netscape_ca_revocation_url */
-    0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x07,  /* [  443] OBJ_netscape_renewal_url */
-    0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x08,  /* [  452] OBJ_netscape_ca_policy_url */
-    0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x0C,  /* [  461] OBJ_netscape_ssl_server_name */
-    0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x0D,  /* [  470] OBJ_netscape_comment */
-    0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x02,0x05,  /* [  479] OBJ_netscape_cert_sequence */
-    0x55,0x1D,                                     /* [  488] OBJ_id_ce */
-    0x55,0x1D,0x0E,                                /* [  490] OBJ_subject_key_identifier */
-    0x55,0x1D,0x0F,                                /* [  493] OBJ_key_usage */
-    0x55,0x1D,0x10,                                /* [  496] OBJ_private_key_usage_period */
-    0x55,0x1D,0x11,                                /* [  499] OBJ_subject_alt_name */
-    0x55,0x1D,0x12,                                /* [  502] OBJ_issuer_alt_name */
-    0x55,0x1D,0x13,                                /* [  505] OBJ_basic_constraints */
-    0x55,0x1D,0x14,                                /* [  508] OBJ_crl_number */
-    0x55,0x1D,0x20,                                /* [  511] OBJ_certificate_policies */
-    0x55,0x1D,0x23,                                /* [  514] OBJ_authority_key_identifier */
-    0x2B,0x06,0x01,0x04,0x01,0x97,0x55,0x01,0x02,  /* [  517] OBJ_bf_cbc */
-    0x55,0x08,0x03,0x65,                           /* [  526] OBJ_mdc2 */
-    0x55,0x08,0x03,0x64,                           /* [  530] OBJ_mdc2WithRSA */
-    0x55,0x04,0x2A,                                /* [  534] OBJ_givenName */
-    0x55,0x04,0x04,                                /* [  537] OBJ_surname */
-    0x55,0x04,0x2B,                                /* [  540] OBJ_initials */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x2C,  /* [  543] OBJ_uniqueIdentifier */
-    0x55,0x1D,0x1F,                                /* [  553] OBJ_crl_distribution_points */
-    0x2B,0x0E,0x03,0x02,0x03,                      /* [  556] OBJ_md5WithRSA */
-    0x55,0x04,0x05,                                /* [  561] OBJ_serialNumber */
-    0x55,0x04,0x0C,                                /* [  564] OBJ_title */
-    0x55,0x04,0x0D,                                /* [  567] OBJ_description */
-    0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x42,0x0A,  /* [  570] OBJ_cast5_cbc */
-    0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x42,0x0C,  /* [  579] OBJ_pbeWithMD5AndCast5_CBC */
-    0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,            /* [  588] OBJ_dsaWithSHA1 */
-    0x2B,0x0E,0x03,0x02,0x1D,                      /* [  595] OBJ_sha1WithRSA */
-    0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,            /* [  600] OBJ_dsa */
-    0x2B,0x24,0x03,0x02,0x01,                      /* [  607] OBJ_ripemd160 */
-    0x2B,0x24,0x03,0x03,0x01,0x02,                 /* [  612] OBJ_ripemd160WithRSA */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x08,       /* [  618] OBJ_rc5_cbc */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x08,  /* [  626] OBJ_zlib_compression */
-    0x55,0x1D,0x25,                                /* [  637] OBJ_ext_key_usage */
-    0x2B,0x06,0x01,0x05,0x05,0x07,                 /* [  640] OBJ_id_pkix */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,            /* [  646] OBJ_id_kp */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,       /* [  653] OBJ_server_auth */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,       /* [  661] OBJ_client_auth */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,       /* [  669] OBJ_code_sign */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,       /* [  677] OBJ_email_protect */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,       /* [  685] OBJ_time_stamp */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x15,  /* [  693] OBJ_ms_code_ind */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x16,  /* [  703] OBJ_ms_code_com */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x0A,0x03,0x01,  /* [  713] OBJ_ms_ctl_sign */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x0A,0x03,0x03,  /* [  723] OBJ_ms_sgc */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x0A,0x03,0x04,  /* [  733] OBJ_ms_efs */
-    0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x04,0x01,  /* [  743] OBJ_ns_sgc */
-    0x55,0x1D,0x1B,                                /* [  752] OBJ_delta_crl */
-    0x55,0x1D,0x15,                                /* [  755] OBJ_crl_reason */
-    0x55,0x1D,0x18,                                /* [  758] OBJ_invalidity_date */
-    0x2B,0x65,0x01,0x04,0x01,                      /* [  761] OBJ_sxnet */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x01,  /* [  766] OBJ_pbe_WithSHA1And128BitRC4 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x02,  /* [  776] OBJ_pbe_WithSHA1And40BitRC4 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,  /* [  786] OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x04,  /* [  796] OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,  /* [  806] OBJ_pbe_WithSHA1And128BitRC2_CBC */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,  /* [  816] OBJ_pbe_WithSHA1And40BitRC2_CBC */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,  /* [  826] OBJ_keyBag */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,  /* [  837] OBJ_pkcs8ShroudedKeyBag */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,  /* [  848] OBJ_certBag */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x04,  /* [  859] OBJ_crlBag */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,  /* [  870] OBJ_secretBag */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,  /* [  881] OBJ_safeContentsBag */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,  /* [  892] OBJ_friendlyName */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,  /* [  901] OBJ_localKeyID */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,  /* [  910] OBJ_x509Certificate */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x02,  /* [  920] OBJ_sdsiCertificate */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x17,0x01,  /* [  930] OBJ_x509Crl */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,  /* [  940] OBJ_pbes2 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0E,  /* [  949] OBJ_pbmac1 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,       /* [  958] OBJ_hmacWithSHA1 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x01,       /* [  966] OBJ_id_qt_cps */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x02,       /* [  974] OBJ_id_qt_unotice */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,  /* [  982] OBJ_SMIMECapabilities */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x04,  /* [  991] OBJ_pbeWithMD2AndRC2_CBC */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x06,  /* [ 1000] OBJ_pbeWithMD5AndRC2_CBC */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,  /* [ 1009] OBJ_pbeWithSHA1AndDES_CBC */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x0E,  /* [ 1018] OBJ_ms_ext_req */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,  /* [ 1028] OBJ_ext_req */
-    0x55,0x04,0x29,                                /* [ 1037] OBJ_name */
-    0x55,0x04,0x2E,                                /* [ 1040] OBJ_dnQualifier */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,            /* [ 1043] OBJ_id_pe */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,            /* [ 1050] OBJ_id_ad */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x01,       /* [ 1057] OBJ_info_access */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,       /* [ 1065] OBJ_ad_OCSP */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,       /* [ 1073] OBJ_ad_ca_issuers */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,       /* [ 1081] OBJ_OCSP_sign */
-    0x2A,                                          /* [ 1089] OBJ_member_body */
-    0x2A,0x86,0x48,                                /* [ 1090] OBJ_ISO_US */
-    0x2A,0x86,0x48,0xCE,0x38,                      /* [ 1093] OBJ_X9_57 */
-    0x2A,0x86,0x48,0xCE,0x38,0x04,                 /* [ 1098] OBJ_X9cm */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,       /* [ 1104] OBJ_pkcs1 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,       /* [ 1112] OBJ_pkcs5 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,  /* [ 1120] OBJ_SMIME */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,  /* [ 1129] OBJ_id_smime_mod */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,  /* [ 1139] OBJ_id_smime_ct */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,  /* [ 1149] OBJ_id_smime_aa */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,  /* [ 1159] OBJ_id_smime_alg */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x04,  /* [ 1169] OBJ_id_smime_cd */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x05,  /* [ 1179] OBJ_id_smime_spq */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,  /* [ 1189] OBJ_id_smime_cti */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x01,  /* [ 1199] OBJ_id_smime_mod_cms */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x02,  /* [ 1210] OBJ_id_smime_mod_ess */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x03,  /* [ 1221] OBJ_id_smime_mod_oid */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x04,  /* [ 1232] OBJ_id_smime_mod_msg_v3 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x05,  /* [ 1243] OBJ_id_smime_mod_ets_eSignature_88 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x06,  /* [ 1254] OBJ_id_smime_mod_ets_eSignature_97 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x07,  /* [ 1265] OBJ_id_smime_mod_ets_eSigPolicy_88 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x08,  /* [ 1276] OBJ_id_smime_mod_ets_eSigPolicy_97 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x01,  /* [ 1287] OBJ_id_smime_ct_receipt */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x02,  /* [ 1298] OBJ_id_smime_ct_authData */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x03,  /* [ 1309] OBJ_id_smime_ct_publishCert */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,  /* [ 1320] OBJ_id_smime_ct_TSTInfo */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x05,  /* [ 1331] OBJ_id_smime_ct_TDTInfo */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x06,  /* [ 1342] OBJ_id_smime_ct_contentInfo */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x07,  /* [ 1353] OBJ_id_smime_ct_DVCSRequestData */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x08,  /* [ 1364] OBJ_id_smime_ct_DVCSResponseData */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x01,  /* [ 1375] OBJ_id_smime_aa_receiptRequest */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x02,  /* [ 1386] OBJ_id_smime_aa_securityLabel */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x03,  /* [ 1397] OBJ_id_smime_aa_mlExpandHistory */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x04,  /* [ 1408] OBJ_id_smime_aa_contentHint */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x05,  /* [ 1419] OBJ_id_smime_aa_msgSigDigest */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x06,  /* [ 1430] OBJ_id_smime_aa_encapContentType */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x07,  /* [ 1441] OBJ_id_smime_aa_contentIdentifier */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x08,  /* [ 1452] OBJ_id_smime_aa_macValue */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x09,  /* [ 1463] OBJ_id_smime_aa_equivalentLabels */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0A,  /* [ 1474] OBJ_id_smime_aa_contentReference */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0B,  /* [ 1485] OBJ_id_smime_aa_encrypKeyPref */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,  /* [ 1496] OBJ_id_smime_aa_signingCertificate */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0D,  /* [ 1507] OBJ_id_smime_aa_smimeEncryptCerts */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,  /* [ 1518] OBJ_id_smime_aa_timeStampToken */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0F,  /* [ 1529] OBJ_id_smime_aa_ets_sigPolicyId */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x10,  /* [ 1540] OBJ_id_smime_aa_ets_commitmentType */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x11,  /* [ 1551] OBJ_id_smime_aa_ets_signerLocation */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x12,  /* [ 1562] OBJ_id_smime_aa_ets_signerAttr */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x13,  /* [ 1573] OBJ_id_smime_aa_ets_otherSigCert */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x14,  /* [ 1584] OBJ_id_smime_aa_ets_contentTimestamp */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x15,  /* [ 1595] OBJ_id_smime_aa_ets_CertificateRefs */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x16,  /* [ 1606] OBJ_id_smime_aa_ets_RevocationRefs */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x17,  /* [ 1617] OBJ_id_smime_aa_ets_certValues */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x18,  /* [ 1628] OBJ_id_smime_aa_ets_revocationValues */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x19,  /* [ 1639] OBJ_id_smime_aa_ets_escTimeStamp */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x1A,  /* [ 1650] OBJ_id_smime_aa_ets_certCRLTimestamp */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x1B,  /* [ 1661] OBJ_id_smime_aa_ets_archiveTimeStamp */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x1C,  /* [ 1672] OBJ_id_smime_aa_signatureType */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x1D,  /* [ 1683] OBJ_id_smime_aa_dvcs_dvc */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x01,  /* [ 1694] OBJ_id_smime_alg_ESDHwith3DES */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x02,  /* [ 1705] OBJ_id_smime_alg_ESDHwithRC2 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x03,  /* [ 1716] OBJ_id_smime_alg_3DESwrap */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x04,  /* [ 1727] OBJ_id_smime_alg_RC2wrap */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x05,  /* [ 1738] OBJ_id_smime_alg_ESDH */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x06,  /* [ 1749] OBJ_id_smime_alg_CMS3DESwrap */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x07,  /* [ 1760] OBJ_id_smime_alg_CMSRC2wrap */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x04,0x01,  /* [ 1771] OBJ_id_smime_cd_ldap */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x05,0x01,  /* [ 1782] OBJ_id_smime_spq_ets_sqt_uri */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x05,0x02,  /* [ 1793] OBJ_id_smime_spq_ets_sqt_unotice */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x01,  /* [ 1804] OBJ_id_smime_cti_ets_proofOfOrigin */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x02,  /* [ 1815] OBJ_id_smime_cti_ets_proofOfReceipt */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x03,  /* [ 1826] OBJ_id_smime_cti_ets_proofOfDelivery */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x04,  /* [ 1837] OBJ_id_smime_cti_ets_proofOfSender */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x05,  /* [ 1848] OBJ_id_smime_cti_ets_proofOfApproval */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x06,  /* [ 1859] OBJ_id_smime_cti_ets_proofOfCreation */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x04,       /* [ 1870] OBJ_md4 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,            /* [ 1878] OBJ_id_pkix_mod */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x02,            /* [ 1885] OBJ_id_qt */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,            /* [ 1892] OBJ_id_it */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x05,            /* [ 1899] OBJ_id_pkip */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x06,            /* [ 1906] OBJ_id_alg */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,            /* [ 1913] OBJ_id_cmc */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x08,            /* [ 1920] OBJ_id_on */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x09,            /* [ 1927] OBJ_id_pda */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,            /* [ 1934] OBJ_id_aca */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0B,            /* [ 1941] OBJ_id_qcs */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0C,            /* [ 1948] OBJ_id_cct */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x01,       /* [ 1955] OBJ_id_pkix1_explicit_88 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x02,       /* [ 1963] OBJ_id_pkix1_implicit_88 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x03,       /* [ 1971] OBJ_id_pkix1_explicit_93 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x04,       /* [ 1979] OBJ_id_pkix1_implicit_93 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x05,       /* [ 1987] OBJ_id_mod_crmf */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x06,       /* [ 1995] OBJ_id_mod_cmc */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x07,       /* [ 2003] OBJ_id_mod_kea_profile_88 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x08,       /* [ 2011] OBJ_id_mod_kea_profile_93 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x09,       /* [ 2019] OBJ_id_mod_cmp */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0A,       /* [ 2027] OBJ_id_mod_qualified_cert_88 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0B,       /* [ 2035] OBJ_id_mod_qualified_cert_93 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0C,       /* [ 2043] OBJ_id_mod_attribute_cert */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0D,       /* [ 2051] OBJ_id_mod_timestamp_protocol */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0E,       /* [ 2059] OBJ_id_mod_ocsp */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0F,       /* [ 2067] OBJ_id_mod_dvcs */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x10,       /* [ 2075] OBJ_id_mod_cmp2000 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x02,       /* [ 2083] OBJ_biometricInfo */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x03,       /* [ 2091] OBJ_qcStatements */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x04,       /* [ 2099] OBJ_ac_auditIdentity */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x05,       /* [ 2107] OBJ_ac_targeting */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x06,       /* [ 2115] OBJ_aaControls */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x07,       /* [ 2123] OBJ_sbgp_ipAddrBlock */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x08,       /* [ 2131] OBJ_sbgp_autonomousSysNum */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x09,       /* [ 2139] OBJ_sbgp_routerIdentifier */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x03,       /* [ 2147] OBJ_textNotice */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x05,       /* [ 2155] OBJ_ipsecEndSystem */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x06,       /* [ 2163] OBJ_ipsecTunnel */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x07,       /* [ 2171] OBJ_ipsecUser */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x0A,       /* [ 2179] OBJ_dvcs */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x01,       /* [ 2187] OBJ_id_it_caProtEncCert */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x02,       /* [ 2195] OBJ_id_it_signKeyPairTypes */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x03,       /* [ 2203] OBJ_id_it_encKeyPairTypes */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x04,       /* [ 2211] OBJ_id_it_preferredSymmAlg */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x05,       /* [ 2219] OBJ_id_it_caKeyUpdateInfo */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x06,       /* [ 2227] OBJ_id_it_currentCRL */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x07,       /* [ 2235] OBJ_id_it_unsupportedOIDs */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x08,       /* [ 2243] OBJ_id_it_subscriptionRequest */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x09,       /* [ 2251] OBJ_id_it_subscriptionResponse */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0A,       /* [ 2259] OBJ_id_it_keyPairParamReq */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0B,       /* [ 2267] OBJ_id_it_keyPairParamRep */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0C,       /* [ 2275] OBJ_id_it_revPassphrase */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0D,       /* [ 2283] OBJ_id_it_implicitConfirm */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0E,       /* [ 2291] OBJ_id_it_confirmWaitTime */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0F,       /* [ 2299] OBJ_id_it_origPKIMessage */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,       /* [ 2307] OBJ_id_regCtrl */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x02,       /* [ 2315] OBJ_id_regInfo */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x01,  /* [ 2323] OBJ_id_regCtrl_regToken */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x02,  /* [ 2332] OBJ_id_regCtrl_authenticator */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x03,  /* [ 2341] OBJ_id_regCtrl_pkiPublicationInfo */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x04,  /* [ 2350] OBJ_id_regCtrl_pkiArchiveOptions */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x05,  /* [ 2359] OBJ_id_regCtrl_oldCertID */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x06,  /* [ 2368] OBJ_id_regCtrl_protocolEncrKey */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x02,0x01,  /* [ 2377] OBJ_id_regInfo_utf8Pairs */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x02,0x02,  /* [ 2386] OBJ_id_regInfo_certReq */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x01,       /* [ 2395] OBJ_id_alg_des40 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,       /* [ 2403] OBJ_id_alg_noSignature */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x03,       /* [ 2411] OBJ_id_alg_dh_sig_hmac_sha1 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x04,       /* [ 2419] OBJ_id_alg_dh_pop */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x01,       /* [ 2427] OBJ_id_cmc_statusInfo */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x02,       /* [ 2435] OBJ_id_cmc_identification */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x03,       /* [ 2443] OBJ_id_cmc_identityProof */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x04,       /* [ 2451] OBJ_id_cmc_dataReturn */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x05,       /* [ 2459] OBJ_id_cmc_transactionId */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x06,       /* [ 2467] OBJ_id_cmc_senderNonce */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x07,       /* [ 2475] OBJ_id_cmc_recipientNonce */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x08,       /* [ 2483] OBJ_id_cmc_addExtensions */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x09,       /* [ 2491] OBJ_id_cmc_encryptedPOP */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x0A,       /* [ 2499] OBJ_id_cmc_decryptedPOP */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x0B,       /* [ 2507] OBJ_id_cmc_lraPOPWitness */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x0F,       /* [ 2515] OBJ_id_cmc_getCert */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x10,       /* [ 2523] OBJ_id_cmc_getCRL */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x11,       /* [ 2531] OBJ_id_cmc_revokeRequest */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x12,       /* [ 2539] OBJ_id_cmc_regInfo */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x13,       /* [ 2547] OBJ_id_cmc_responseInfo */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x15,       /* [ 2555] OBJ_id_cmc_queryPending */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x16,       /* [ 2563] OBJ_id_cmc_popLinkRandom */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x17,       /* [ 2571] OBJ_id_cmc_popLinkWitness */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x18,       /* [ 2579] OBJ_id_cmc_confirmCertAcceptance */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x08,0x01,       /* [ 2587] OBJ_id_on_personalData */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x01,       /* [ 2595] OBJ_id_pda_dateOfBirth */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x02,       /* [ 2603] OBJ_id_pda_placeOfBirth */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x03,       /* [ 2611] OBJ_id_pda_gender */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x04,       /* [ 2619] OBJ_id_pda_countryOfCitizenship */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x05,       /* [ 2627] OBJ_id_pda_countryOfResidence */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x01,       /* [ 2635] OBJ_id_aca_authenticationInfo */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x02,       /* [ 2643] OBJ_id_aca_accessIdentity */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x03,       /* [ 2651] OBJ_id_aca_chargingIdentity */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x04,       /* [ 2659] OBJ_id_aca_group */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x05,       /* [ 2667] OBJ_id_aca_role */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0B,0x01,       /* [ 2675] OBJ_id_qcs_pkixQCSyntax_v1 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0C,0x01,       /* [ 2683] OBJ_id_cct_crs */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0C,0x02,       /* [ 2691] OBJ_id_cct_PKIData */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0C,0x03,       /* [ 2699] OBJ_id_cct_PKIResponse */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x03,       /* [ 2707] OBJ_ad_timeStamping */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x04,       /* [ 2715] OBJ_ad_dvcs */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x01,  /* [ 2723] OBJ_id_pkix_OCSP_basic */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,  /* [ 2732] OBJ_id_pkix_OCSP_Nonce */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x03,  /* [ 2741] OBJ_id_pkix_OCSP_CrlID */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x04,  /* [ 2750] OBJ_id_pkix_OCSP_acceptableResponses */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x05,  /* [ 2759] OBJ_id_pkix_OCSP_noCheck */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x06,  /* [ 2768] OBJ_id_pkix_OCSP_archiveCutoff */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x07,  /* [ 2777] OBJ_id_pkix_OCSP_serviceLocator */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x08,  /* [ 2786] OBJ_id_pkix_OCSP_extendedStatus */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x09,  /* [ 2795] OBJ_id_pkix_OCSP_valid */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x0A,  /* [ 2804] OBJ_id_pkix_OCSP_path */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x0B,  /* [ 2813] OBJ_id_pkix_OCSP_trustRoot */
-    0x2B,0x0E,0x03,0x02,                           /* [ 2822] OBJ_algorithm */
-    0x2B,0x0E,0x03,0x02,0x0B,                      /* [ 2826] OBJ_rsaSignature */
-    0x55,0x08,                                     /* [ 2831] OBJ_X500algorithms */
-    0x2B,                                          /* [ 2833] OBJ_org */
-    0x2B,0x06,                                     /* [ 2834] OBJ_dod */
-    0x2B,0x06,0x01,                                /* [ 2836] OBJ_iana */
-    0x2B,0x06,0x01,0x01,                           /* [ 2839] OBJ_Directory */
-    0x2B,0x06,0x01,0x02,                           /* [ 2843] OBJ_Management */
-    0x2B,0x06,0x01,0x03,                           /* [ 2847] OBJ_Experimental */
-    0x2B,0x06,0x01,0x04,                           /* [ 2851] OBJ_Private */
-    0x2B,0x06,0x01,0x05,                           /* [ 2855] OBJ_Security */
-    0x2B,0x06,0x01,0x06,                           /* [ 2859] OBJ_SNMPv2 */
-    0x2B,0x06,0x01,0x07,                           /* [ 2863] OBJ_Mail */
-    0x2B,0x06,0x01,0x04,0x01,                      /* [ 2867] OBJ_Enterprises */
-    0x2B,0x06,0x01,0x04,0x01,0x8B,0x3A,0x82,0x58,  /* [ 2872] OBJ_dcObject */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x19,  /* [ 2881] OBJ_domainComponent */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x0D,  /* [ 2891] OBJ_Domain */
-    0x55,0x01,0x05,                                /* [ 2901] OBJ_selected_attribute_types */
-    0x55,0x01,0x05,0x37,                           /* [ 2904] OBJ_clearance */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x03,  /* [ 2908] OBJ_md4WithRSAEncryption */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0A,       /* [ 2917] OBJ_ac_proxying */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0B,       /* [ 2925] OBJ_sinfo_access */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x06,       /* [ 2933] OBJ_id_aca_encAttrs */
-    0x55,0x04,0x48,                                /* [ 2941] OBJ_role */
-    0x55,0x1D,0x24,                                /* [ 2944] OBJ_policy_constraints */
-    0x55,0x1D,0x37,                                /* [ 2947] OBJ_target_information */
-    0x55,0x1D,0x38,                                /* [ 2950] OBJ_no_rev_avail */
-    0x2A,0x86,0x48,0xCE,0x3D,                      /* [ 2953] OBJ_ansi_X9_62 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,            /* [ 2958] OBJ_X9_62_prime_field */
-    0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,            /* [ 2965] OBJ_X9_62_characteristic_two_field */
-    0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,            /* [ 2972] OBJ_X9_62_id_ecPublicKey */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x01,       /* [ 2979] OBJ_X9_62_prime192v1 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x02,       /* [ 2987] OBJ_X9_62_prime192v2 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x03,       /* [ 2995] OBJ_X9_62_prime192v3 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x04,       /* [ 3003] OBJ_X9_62_prime239v1 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x05,       /* [ 3011] OBJ_X9_62_prime239v2 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x06,       /* [ 3019] OBJ_X9_62_prime239v3 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,       /* [ 3027] OBJ_X9_62_prime256v1 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,            /* [ 3035] OBJ_ecdsa_with_SHA1 */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,  /* [ 3042] OBJ_ms_csp_name */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x01,  /* [ 3051] OBJ_aes_128_ecb */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,  /* [ 3060] OBJ_aes_128_cbc */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x03,  /* [ 3069] OBJ_aes_128_ofb128 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x04,  /* [ 3078] OBJ_aes_128_cfb128 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x15,  /* [ 3087] OBJ_aes_192_ecb */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,  /* [ 3096] OBJ_aes_192_cbc */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x17,  /* [ 3105] OBJ_aes_192_ofb128 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x18,  /* [ 3114] OBJ_aes_192_cfb128 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x29,  /* [ 3123] OBJ_aes_256_ecb */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,  /* [ 3132] OBJ_aes_256_cbc */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2B,  /* [ 3141] OBJ_aes_256_ofb128 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2C,  /* [ 3150] OBJ_aes_256_cfb128 */
-    0x55,0x1D,0x17,                                /* [ 3159] OBJ_hold_instruction_code */
-    0x2A,0x86,0x48,0xCE,0x38,0x02,0x01,            /* [ 3162] OBJ_hold_instruction_none */
-    0x2A,0x86,0x48,0xCE,0x38,0x02,0x02,            /* [ 3169] OBJ_hold_instruction_call_issuer */
-    0x2A,0x86,0x48,0xCE,0x38,0x02,0x03,            /* [ 3176] OBJ_hold_instruction_reject */
-    0x09,                                          /* [ 3183] OBJ_data */
-    0x09,0x92,0x26,                                /* [ 3184] OBJ_pss */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,            /* [ 3187] OBJ_ucl */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,       /* [ 3194] OBJ_pilot */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,  /* [ 3202] OBJ_pilotAttributeType */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x03,  /* [ 3211] OBJ_pilotAttributeSyntax */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,  /* [ 3220] OBJ_pilotObjectClass */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x0A,  /* [ 3229] OBJ_pilotGroups */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x03,0x04,  /* [ 3238] OBJ_iA5StringSyntax */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x03,0x05,  /* [ 3248] OBJ_caseIgnoreIA5StringSyntax */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x03,  /* [ 3258] OBJ_pilotObject */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x04,  /* [ 3268] OBJ_pilotPerson */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x05,  /* [ 3278] OBJ_account */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x06,  /* [ 3288] OBJ_document */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x07,  /* [ 3298] OBJ_room */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x09,  /* [ 3308] OBJ_documentSeries */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x0E,  /* [ 3318] OBJ_rFC822localPart */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x0F,  /* [ 3328] OBJ_dNSDomain */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x11,  /* [ 3338] OBJ_domainRelatedObject */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x12,  /* [ 3348] OBJ_friendlyCountry */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x13,  /* [ 3358] OBJ_simpleSecurityObject */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x14,  /* [ 3368] OBJ_pilotOrganization */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x15,  /* [ 3378] OBJ_pilotDSA */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x16,  /* [ 3388] OBJ_qualityLabelledData */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x01,  /* [ 3398] OBJ_userId */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x02,  /* [ 3408] OBJ_textEncodedORAddress */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x03,  /* [ 3418] OBJ_rfc822Mailbox */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x04,  /* [ 3428] OBJ_info */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x05,  /* [ 3438] OBJ_favouriteDrink */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x06,  /* [ 3448] OBJ_roomNumber */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x07,  /* [ 3458] OBJ_photo */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x08,  /* [ 3468] OBJ_userClass */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x09,  /* [ 3478] OBJ_host */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x0A,  /* [ 3488] OBJ_manager */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x0B,  /* [ 3498] OBJ_documentIdentifier */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x0C,  /* [ 3508] OBJ_documentTitle */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x0D,  /* [ 3518] OBJ_documentVersion */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x0E,  /* [ 3528] OBJ_documentAuthor */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x0F,  /* [ 3538] OBJ_documentLocation */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x14,  /* [ 3548] OBJ_homeTelephoneNumber */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x15,  /* [ 3558] OBJ_secretary */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x16,  /* [ 3568] OBJ_otherMailbox */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x17,  /* [ 3578] OBJ_lastModifiedTime */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x18,  /* [ 3588] OBJ_lastModifiedBy */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x1A,  /* [ 3598] OBJ_aRecord */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x1B,  /* [ 3608] OBJ_pilotAttributeType27 */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x1C,  /* [ 3618] OBJ_mXRecord */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x1D,  /* [ 3628] OBJ_nSRecord */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x1E,  /* [ 3638] OBJ_sOARecord */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x1F,  /* [ 3648] OBJ_cNAMERecord */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x25,  /* [ 3658] OBJ_associatedDomain */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x26,  /* [ 3668] OBJ_associatedName */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x27,  /* [ 3678] OBJ_homePostalAddress */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x28,  /* [ 3688] OBJ_personalTitle */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x29,  /* [ 3698] OBJ_mobileTelephoneNumber */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x2A,  /* [ 3708] OBJ_pagerTelephoneNumber */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x2B,  /* [ 3718] OBJ_friendlyCountryName */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x2D,  /* [ 3728] OBJ_organizationalStatus */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x2E,  /* [ 3738] OBJ_janetMailbox */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x2F,  /* [ 3748] OBJ_mailPreferenceOption */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x30,  /* [ 3758] OBJ_buildingName */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x31,  /* [ 3768] OBJ_dSAQuality */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x32,  /* [ 3778] OBJ_singleLevelQuality */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x33,  /* [ 3788] OBJ_subtreeMinimumQuality */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x34,  /* [ 3798] OBJ_subtreeMaximumQuality */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x35,  /* [ 3808] OBJ_personalSignature */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x36,  /* [ 3818] OBJ_dITRedirect */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x37,  /* [ 3828] OBJ_audio */
-    0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x38,  /* [ 3838] OBJ_documentPublisher */
-    0x55,0x04,0x2D,                                /* [ 3848] OBJ_x500UniqueIdentifier */
-    0x2B,0x06,0x01,0x07,0x01,                      /* [ 3851] OBJ_mime_mhs */
-    0x2B,0x06,0x01,0x07,0x01,0x01,                 /* [ 3856] OBJ_mime_mhs_headings */
-    0x2B,0x06,0x01,0x07,0x01,0x02,                 /* [ 3862] OBJ_mime_mhs_bodies */
-    0x2B,0x06,0x01,0x07,0x01,0x01,0x01,            /* [ 3868] OBJ_id_hex_partial_message */
-    0x2B,0x06,0x01,0x07,0x01,0x01,0x02,            /* [ 3875] OBJ_id_hex_multipart_message */
-    0x55,0x04,0x2C,                                /* [ 3882] OBJ_generationQualifier */
-    0x55,0x04,0x41,                                /* [ 3885] OBJ_pseudonym */
-    0x67,0x2A,                                     /* [ 3888] OBJ_id_set */
-    0x67,0x2A,0x00,                                /* [ 3890] OBJ_set_ctype */
-    0x67,0x2A,0x01,                                /* [ 3893] OBJ_set_msgExt */
-    0x67,0x2A,0x03,                                /* [ 3896] OBJ_set_attr */
-    0x67,0x2A,0x05,                                /* [ 3899] OBJ_set_policy */
-    0x67,0x2A,0x07,                                /* [ 3902] OBJ_set_certExt */
-    0x67,0x2A,0x08,                                /* [ 3905] OBJ_set_brand */
-    0x67,0x2A,0x00,0x00,                           /* [ 3908] OBJ_setct_PANData */
-    0x67,0x2A,0x00,0x01,                           /* [ 3912] OBJ_setct_PANToken */
-    0x67,0x2A,0x00,0x02,                           /* [ 3916] OBJ_setct_PANOnly */
-    0x67,0x2A,0x00,0x03,                           /* [ 3920] OBJ_setct_OIData */
-    0x67,0x2A,0x00,0x04,                           /* [ 3924] OBJ_setct_PI */
-    0x67,0x2A,0x00,0x05,                           /* [ 3928] OBJ_setct_PIData */
-    0x67,0x2A,0x00,0x06,                           /* [ 3932] OBJ_setct_PIDataUnsigned */
-    0x67,0x2A,0x00,0x07,                           /* [ 3936] OBJ_setct_HODInput */
-    0x67,0x2A,0x00,0x08,                           /* [ 3940] OBJ_setct_AuthResBaggage */
-    0x67,0x2A,0x00,0x09,                           /* [ 3944] OBJ_setct_AuthRevReqBaggage */
-    0x67,0x2A,0x00,0x0A,                           /* [ 3948] OBJ_setct_AuthRevResBaggage */
-    0x67,0x2A,0x00,0x0B,                           /* [ 3952] OBJ_setct_CapTokenSeq */
-    0x67,0x2A,0x00,0x0C,                           /* [ 3956] OBJ_setct_PInitResData */
-    0x67,0x2A,0x00,0x0D,                           /* [ 3960] OBJ_setct_PI_TBS */
-    0x67,0x2A,0x00,0x0E,                           /* [ 3964] OBJ_setct_PResData */
-    0x67,0x2A,0x00,0x10,                           /* [ 3968] OBJ_setct_AuthReqTBS */
-    0x67,0x2A,0x00,0x11,                           /* [ 3972] OBJ_setct_AuthResTBS */
-    0x67,0x2A,0x00,0x12,                           /* [ 3976] OBJ_setct_AuthResTBSX */
-    0x67,0x2A,0x00,0x13,                           /* [ 3980] OBJ_setct_AuthTokenTBS */
-    0x67,0x2A,0x00,0x14,                           /* [ 3984] OBJ_setct_CapTokenData */
-    0x67,0x2A,0x00,0x15,                           /* [ 3988] OBJ_setct_CapTokenTBS */
-    0x67,0x2A,0x00,0x16,                           /* [ 3992] OBJ_setct_AcqCardCodeMsg */
-    0x67,0x2A,0x00,0x17,                           /* [ 3996] OBJ_setct_AuthRevReqTBS */
-    0x67,0x2A,0x00,0x18,                           /* [ 4000] OBJ_setct_AuthRevResData */
-    0x67,0x2A,0x00,0x19,                           /* [ 4004] OBJ_setct_AuthRevResTBS */
-    0x67,0x2A,0x00,0x1A,                           /* [ 4008] OBJ_setct_CapReqTBS */
-    0x67,0x2A,0x00,0x1B,                           /* [ 4012] OBJ_setct_CapReqTBSX */
-    0x67,0x2A,0x00,0x1C,                           /* [ 4016] OBJ_setct_CapResData */
-    0x67,0x2A,0x00,0x1D,                           /* [ 4020] OBJ_setct_CapRevReqTBS */
-    0x67,0x2A,0x00,0x1E,                           /* [ 4024] OBJ_setct_CapRevReqTBSX */
-    0x67,0x2A,0x00,0x1F,                           /* [ 4028] OBJ_setct_CapRevResData */
-    0x67,0x2A,0x00,0x20,                           /* [ 4032] OBJ_setct_CredReqTBS */
-    0x67,0x2A,0x00,0x21,                           /* [ 4036] OBJ_setct_CredReqTBSX */
-    0x67,0x2A,0x00,0x22,                           /* [ 4040] OBJ_setct_CredResData */
-    0x67,0x2A,0x00,0x23,                           /* [ 4044] OBJ_setct_CredRevReqTBS */
-    0x67,0x2A,0x00,0x24,                           /* [ 4048] OBJ_setct_CredRevReqTBSX */
-    0x67,0x2A,0x00,0x25,                           /* [ 4052] OBJ_setct_CredRevResData */
-    0x67,0x2A,0x00,0x26,                           /* [ 4056] OBJ_setct_PCertReqData */
-    0x67,0x2A,0x00,0x27,                           /* [ 4060] OBJ_setct_PCertResTBS */
-    0x67,0x2A,0x00,0x28,                           /* [ 4064] OBJ_setct_BatchAdminReqData */
-    0x67,0x2A,0x00,0x29,                           /* [ 4068] OBJ_setct_BatchAdminResData */
-    0x67,0x2A,0x00,0x2A,                           /* [ 4072] OBJ_setct_CardCInitResTBS */
-    0x67,0x2A,0x00,0x2B,                           /* [ 4076] OBJ_setct_MeAqCInitResTBS */
-    0x67,0x2A,0x00,0x2C,                           /* [ 4080] OBJ_setct_RegFormResTBS */
-    0x67,0x2A,0x00,0x2D,                           /* [ 4084] OBJ_setct_CertReqData */
-    0x67,0x2A,0x00,0x2E,                           /* [ 4088] OBJ_setct_CertReqTBS */
-    0x67,0x2A,0x00,0x2F,                           /* [ 4092] OBJ_setct_CertResData */
-    0x67,0x2A,0x00,0x30,                           /* [ 4096] OBJ_setct_CertInqReqTBS */
-    0x67,0x2A,0x00,0x31,                           /* [ 4100] OBJ_setct_ErrorTBS */
-    0x67,0x2A,0x00,0x32,                           /* [ 4104] OBJ_setct_PIDualSignedTBE */
-    0x67,0x2A,0x00,0x33,                           /* [ 4108] OBJ_setct_PIUnsignedTBE */
-    0x67,0x2A,0x00,0x34,                           /* [ 4112] OBJ_setct_AuthReqTBE */
-    0x67,0x2A,0x00,0x35,                           /* [ 4116] OBJ_setct_AuthResTBE */
-    0x67,0x2A,0x00,0x36,                           /* [ 4120] OBJ_setct_AuthResTBEX */
-    0x67,0x2A,0x00,0x37,                           /* [ 4124] OBJ_setct_AuthTokenTBE */
-    0x67,0x2A,0x00,0x38,                           /* [ 4128] OBJ_setct_CapTokenTBE */
-    0x67,0x2A,0x00,0x39,                           /* [ 4132] OBJ_setct_CapTokenTBEX */
-    0x67,0x2A,0x00,0x3A,                           /* [ 4136] OBJ_setct_AcqCardCodeMsgTBE */
-    0x67,0x2A,0x00,0x3B,                           /* [ 4140] OBJ_setct_AuthRevReqTBE */
-    0x67,0x2A,0x00,0x3C,                           /* [ 4144] OBJ_setct_AuthRevResTBE */
-    0x67,0x2A,0x00,0x3D,                           /* [ 4148] OBJ_setct_AuthRevResTBEB */
-    0x67,0x2A,0x00,0x3E,                           /* [ 4152] OBJ_setct_CapReqTBE */
-    0x67,0x2A,0x00,0x3F,                           /* [ 4156] OBJ_setct_CapReqTBEX */
-    0x67,0x2A,0x00,0x40,                           /* [ 4160] OBJ_setct_CapResTBE */
-    0x67,0x2A,0x00,0x41,                           /* [ 4164] OBJ_setct_CapRevReqTBE */
-    0x67,0x2A,0x00,0x42,                           /* [ 4168] OBJ_setct_CapRevReqTBEX */
-    0x67,0x2A,0x00,0x43,                           /* [ 4172] OBJ_setct_CapRevResTBE */
-    0x67,0x2A,0x00,0x44,                           /* [ 4176] OBJ_setct_CredReqTBE */
-    0x67,0x2A,0x00,0x45,                           /* [ 4180] OBJ_setct_CredReqTBEX */
-    0x67,0x2A,0x00,0x46,                           /* [ 4184] OBJ_setct_CredResTBE */
-    0x67,0x2A,0x00,0x47,                           /* [ 4188] OBJ_setct_CredRevReqTBE */
-    0x67,0x2A,0x00,0x48,                           /* [ 4192] OBJ_setct_CredRevReqTBEX */
-    0x67,0x2A,0x00,0x49,                           /* [ 4196] OBJ_setct_CredRevResTBE */
-    0x67,0x2A,0x00,0x4A,                           /* [ 4200] OBJ_setct_BatchAdminReqTBE */
-    0x67,0x2A,0x00,0x4B,                           /* [ 4204] OBJ_setct_BatchAdminResTBE */
-    0x67,0x2A,0x00,0x4C,                           /* [ 4208] OBJ_setct_RegFormReqTBE */
-    0x67,0x2A,0x00,0x4D,                           /* [ 4212] OBJ_setct_CertReqTBE */
-    0x67,0x2A,0x00,0x4E,                           /* [ 4216] OBJ_setct_CertReqTBEX */
-    0x67,0x2A,0x00,0x4F,                           /* [ 4220] OBJ_setct_CertResTBE */
-    0x67,0x2A,0x00,0x50,                           /* [ 4224] OBJ_setct_CRLNotificationTBS */
-    0x67,0x2A,0x00,0x51,                           /* [ 4228] OBJ_setct_CRLNotificationResTBS */
-    0x67,0x2A,0x00,0x52,                           /* [ 4232] OBJ_setct_BCIDistributionTBS */
-    0x67,0x2A,0x01,0x01,                           /* [ 4236] OBJ_setext_genCrypt */
-    0x67,0x2A,0x01,0x03,                           /* [ 4240] OBJ_setext_miAuth */
-    0x67,0x2A,0x01,0x04,                           /* [ 4244] OBJ_setext_pinSecure */
-    0x67,0x2A,0x01,0x05,                           /* [ 4248] OBJ_setext_pinAny */
-    0x67,0x2A,0x01,0x07,                           /* [ 4252] OBJ_setext_track2 */
-    0x67,0x2A,0x01,0x08,                           /* [ 4256] OBJ_setext_cv */
-    0x67,0x2A,0x05,0x00,                           /* [ 4260] OBJ_set_policy_root */
-    0x67,0x2A,0x07,0x00,                           /* [ 4264] OBJ_setCext_hashedRoot */
-    0x67,0x2A,0x07,0x01,                           /* [ 4268] OBJ_setCext_certType */
-    0x67,0x2A,0x07,0x02,                           /* [ 4272] OBJ_setCext_merchData */
-    0x67,0x2A,0x07,0x03,                           /* [ 4276] OBJ_setCext_cCertRequired */
-    0x67,0x2A,0x07,0x04,                           /* [ 4280] OBJ_setCext_tunneling */
-    0x67,0x2A,0x07,0x05,                           /* [ 4284] OBJ_setCext_setExt */
-    0x67,0x2A,0x07,0x06,                           /* [ 4288] OBJ_setCext_setQualf */
-    0x67,0x2A,0x07,0x07,                           /* [ 4292] OBJ_setCext_PGWYcapabilities */
-    0x67,0x2A,0x07,0x08,                           /* [ 4296] OBJ_setCext_TokenIdentifier */
-    0x67,0x2A,0x07,0x09,                           /* [ 4300] OBJ_setCext_Track2Data */
-    0x67,0x2A,0x07,0x0A,                           /* [ 4304] OBJ_setCext_TokenType */
-    0x67,0x2A,0x07,0x0B,                           /* [ 4308] OBJ_setCext_IssuerCapabilities */
-    0x67,0x2A,0x03,0x00,                           /* [ 4312] OBJ_setAttr_Cert */
-    0x67,0x2A,0x03,0x01,                           /* [ 4316] OBJ_setAttr_PGWYcap */
-    0x67,0x2A,0x03,0x02,                           /* [ 4320] OBJ_setAttr_TokenType */
-    0x67,0x2A,0x03,0x03,                           /* [ 4324] OBJ_setAttr_IssCap */
-    0x67,0x2A,0x03,0x00,0x00,                      /* [ 4328] OBJ_set_rootKeyThumb */
-    0x67,0x2A,0x03,0x00,0x01,                      /* [ 4333] OBJ_set_addPolicy */
-    0x67,0x2A,0x03,0x02,0x01,                      /* [ 4338] OBJ_setAttr_Token_EMV */
-    0x67,0x2A,0x03,0x02,0x02,                      /* [ 4343] OBJ_setAttr_Token_B0Prime */
-    0x67,0x2A,0x03,0x03,0x03,                      /* [ 4348] OBJ_setAttr_IssCap_CVM */
-    0x67,0x2A,0x03,0x03,0x04,                      /* [ 4353] OBJ_setAttr_IssCap_T2 */
-    0x67,0x2A,0x03,0x03,0x05,                      /* [ 4358] OBJ_setAttr_IssCap_Sig */
-    0x67,0x2A,0x03,0x03,0x03,0x01,                 /* [ 4363] OBJ_setAttr_GenCryptgrm */
-    0x67,0x2A,0x03,0x03,0x04,0x01,                 /* [ 4369] OBJ_setAttr_T2Enc */
-    0x67,0x2A,0x03,0x03,0x04,0x02,                 /* [ 4375] OBJ_setAttr_T2cleartxt */
-    0x67,0x2A,0x03,0x03,0x05,0x01,                 /* [ 4381] OBJ_setAttr_TokICCsig */
-    0x67,0x2A,0x03,0x03,0x05,0x02,                 /* [ 4387] OBJ_setAttr_SecDevSig */
-    0x67,0x2A,0x08,0x01,                           /* [ 4393] OBJ_set_brand_IATA_ATA */
-    0x67,0x2A,0x08,0x1E,                           /* [ 4397] OBJ_set_brand_Diners */
-    0x67,0x2A,0x08,0x22,                           /* [ 4401] OBJ_set_brand_AmericanExpress */
-    0x67,0x2A,0x08,0x23,                           /* [ 4405] OBJ_set_brand_JCB */
-    0x67,0x2A,0x08,0x04,                           /* [ 4409] OBJ_set_brand_Visa */
-    0x67,0x2A,0x08,0x05,                           /* [ 4413] OBJ_set_brand_MasterCard */
-    0x67,0x2A,0x08,0xAE,0x7B,                      /* [ 4417] OBJ_set_brand_Novus */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x0A,       /* [ 4422] OBJ_des_cdmf */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x06,  /* [ 4430] OBJ_rsaOAEPEncryptionSET */
-    0x67,                                          /* [ 4439] OBJ_international_organizations */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x02,  /* [ 4440] OBJ_ms_smartcard_login */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,  /* [ 4450] OBJ_ms_upn */
-    0x55,0x04,0x09,                                /* [ 4460] OBJ_streetAddress */
-    0x55,0x04,0x11,                                /* [ 4463] OBJ_postalCode */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x15,            /* [ 4466] OBJ_id_ppl */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0E,       /* [ 4473] OBJ_proxyCertInfo */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x15,0x00,       /* [ 4481] OBJ_id_ppl_anyLanguage */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x15,0x01,       /* [ 4489] OBJ_id_ppl_inheritAll */
-    0x55,0x1D,0x1E,                                /* [ 4497] OBJ_name_constraints */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x15,0x02,       /* [ 4500] OBJ_Independent */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,  /* [ 4508] OBJ_sha256WithRSAEncryption */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,  /* [ 4517] OBJ_sha384WithRSAEncryption */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,  /* [ 4526] OBJ_sha512WithRSAEncryption */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0E,  /* [ 4535] OBJ_sha224WithRSAEncryption */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,  /* [ 4544] OBJ_sha256 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,  /* [ 4553] OBJ_sha384 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,  /* [ 4562] OBJ_sha512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x04,  /* [ 4571] OBJ_sha224 */
-    0x2B,                                          /* [ 4580] OBJ_identified_organization */
-    0x2B,0x81,0x04,                                /* [ 4581] OBJ_certicom_arc */
-    0x67,0x2B,                                     /* [ 4584] OBJ_wap */
-    0x67,0x2B,0x01,                                /* [ 4586] OBJ_wap_wsg */
-    0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,0x03,       /* [ 4589] OBJ_X9_62_id_characteristic_two_basis */
-    0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,0x03,0x01,  /* [ 4597] OBJ_X9_62_onBasis */
-    0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,0x03,0x02,  /* [ 4606] OBJ_X9_62_tpBasis */
-    0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,0x03,0x03,  /* [ 4615] OBJ_X9_62_ppBasis */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x01,       /* [ 4624] OBJ_X9_62_c2pnb163v1 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x02,       /* [ 4632] OBJ_X9_62_c2pnb163v2 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x03,       /* [ 4640] OBJ_X9_62_c2pnb163v3 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x04,       /* [ 4648] OBJ_X9_62_c2pnb176v1 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x05,       /* [ 4656] OBJ_X9_62_c2tnb191v1 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x06,       /* [ 4664] OBJ_X9_62_c2tnb191v2 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x07,       /* [ 4672] OBJ_X9_62_c2tnb191v3 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x08,       /* [ 4680] OBJ_X9_62_c2onb191v4 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x09,       /* [ 4688] OBJ_X9_62_c2onb191v5 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x0A,       /* [ 4696] OBJ_X9_62_c2pnb208w1 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x0B,       /* [ 4704] OBJ_X9_62_c2tnb239v1 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x0C,       /* [ 4712] OBJ_X9_62_c2tnb239v2 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x0D,       /* [ 4720] OBJ_X9_62_c2tnb239v3 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x0E,       /* [ 4728] OBJ_X9_62_c2onb239v4 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x0F,       /* [ 4736] OBJ_X9_62_c2onb239v5 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x10,       /* [ 4744] OBJ_X9_62_c2pnb272w1 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x11,       /* [ 4752] OBJ_X9_62_c2pnb304w1 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x12,       /* [ 4760] OBJ_X9_62_c2tnb359v1 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x13,       /* [ 4768] OBJ_X9_62_c2pnb368w1 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x03,0x00,0x14,       /* [ 4776] OBJ_X9_62_c2tnb431r1 */
-    0x2B,0x81,0x04,0x00,0x06,                      /* [ 4784] OBJ_secp112r1 */
-    0x2B,0x81,0x04,0x00,0x07,                      /* [ 4789] OBJ_secp112r2 */
-    0x2B,0x81,0x04,0x00,0x1C,                      /* [ 4794] OBJ_secp128r1 */
-    0x2B,0x81,0x04,0x00,0x1D,                      /* [ 4799] OBJ_secp128r2 */
-    0x2B,0x81,0x04,0x00,0x09,                      /* [ 4804] OBJ_secp160k1 */
-    0x2B,0x81,0x04,0x00,0x08,                      /* [ 4809] OBJ_secp160r1 */
-    0x2B,0x81,0x04,0x00,0x1E,                      /* [ 4814] OBJ_secp160r2 */
-    0x2B,0x81,0x04,0x00,0x1F,                      /* [ 4819] OBJ_secp192k1 */
-    0x2B,0x81,0x04,0x00,0x20,                      /* [ 4824] OBJ_secp224k1 */
-    0x2B,0x81,0x04,0x00,0x21,                      /* [ 4829] OBJ_secp224r1 */
-    0x2B,0x81,0x04,0x00,0x0A,                      /* [ 4834] OBJ_secp256k1 */
-    0x2B,0x81,0x04,0x00,0x22,                      /* [ 4839] OBJ_secp384r1 */
-    0x2B,0x81,0x04,0x00,0x23,                      /* [ 4844] OBJ_secp521r1 */
-    0x2B,0x81,0x04,0x00,0x04,                      /* [ 4849] OBJ_sect113r1 */
-    0x2B,0x81,0x04,0x00,0x05,                      /* [ 4854] OBJ_sect113r2 */
-    0x2B,0x81,0x04,0x00,0x16,                      /* [ 4859] OBJ_sect131r1 */
-    0x2B,0x81,0x04,0x00,0x17,                      /* [ 4864] OBJ_sect131r2 */
-    0x2B,0x81,0x04,0x00,0x01,                      /* [ 4869] OBJ_sect163k1 */
-    0x2B,0x81,0x04,0x00,0x02,                      /* [ 4874] OBJ_sect163r1 */
-    0x2B,0x81,0x04,0x00,0x0F,                      /* [ 4879] OBJ_sect163r2 */
-    0x2B,0x81,0x04,0x00,0x18,                      /* [ 4884] OBJ_sect193r1 */
-    0x2B,0x81,0x04,0x00,0x19,                      /* [ 4889] OBJ_sect193r2 */
-    0x2B,0x81,0x04,0x00,0x1A,                      /* [ 4894] OBJ_sect233k1 */
-    0x2B,0x81,0x04,0x00,0x1B,                      /* [ 4899] OBJ_sect233r1 */
-    0x2B,0x81,0x04,0x00,0x03,                      /* [ 4904] OBJ_sect239k1 */
-    0x2B,0x81,0x04,0x00,0x10,                      /* [ 4909] OBJ_sect283k1 */
-    0x2B,0x81,0x04,0x00,0x11,                      /* [ 4914] OBJ_sect283r1 */
-    0x2B,0x81,0x04,0x00,0x24,                      /* [ 4919] OBJ_sect409k1 */
-    0x2B,0x81,0x04,0x00,0x25,                      /* [ 4924] OBJ_sect409r1 */
-    0x2B,0x81,0x04,0x00,0x26,                      /* [ 4929] OBJ_sect571k1 */
-    0x2B,0x81,0x04,0x00,0x27,                      /* [ 4934] OBJ_sect571r1 */
-    0x67,0x2B,0x01,0x04,0x01,                      /* [ 4939] OBJ_wap_wsg_idm_ecid_wtls1 */
-    0x67,0x2B,0x01,0x04,0x03,                      /* [ 4944] OBJ_wap_wsg_idm_ecid_wtls3 */
-    0x67,0x2B,0x01,0x04,0x04,                      /* [ 4949] OBJ_wap_wsg_idm_ecid_wtls4 */
-    0x67,0x2B,0x01,0x04,0x05,                      /* [ 4954] OBJ_wap_wsg_idm_ecid_wtls5 */
-    0x67,0x2B,0x01,0x04,0x06,                      /* [ 4959] OBJ_wap_wsg_idm_ecid_wtls6 */
-    0x67,0x2B,0x01,0x04,0x07,                      /* [ 4964] OBJ_wap_wsg_idm_ecid_wtls7 */
-    0x67,0x2B,0x01,0x04,0x08,                      /* [ 4969] OBJ_wap_wsg_idm_ecid_wtls8 */
-    0x67,0x2B,0x01,0x04,0x09,                      /* [ 4974] OBJ_wap_wsg_idm_ecid_wtls9 */
-    0x67,0x2B,0x01,0x04,0x0A,                      /* [ 4979] OBJ_wap_wsg_idm_ecid_wtls10 */
-    0x67,0x2B,0x01,0x04,0x0B,                      /* [ 4984] OBJ_wap_wsg_idm_ecid_wtls11 */
-    0x67,0x2B,0x01,0x04,0x0C,                      /* [ 4989] OBJ_wap_wsg_idm_ecid_wtls12 */
-    0x55,0x1D,0x20,0x00,                           /* [ 4994] OBJ_any_policy */
-    0x55,0x1D,0x21,                                /* [ 4998] OBJ_policy_mappings */
-    0x55,0x1D,0x36,                                /* [ 5001] OBJ_inhibit_any_policy */
-    0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x01,0x02,  /* [ 5004] OBJ_camellia_128_cbc */
-    0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x01,0x03,  /* [ 5015] OBJ_camellia_192_cbc */
-    0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x01,0x04,  /* [ 5026] OBJ_camellia_256_cbc */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x01,       /* [ 5037] OBJ_camellia_128_ecb */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x15,       /* [ 5045] OBJ_camellia_192_ecb */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x29,       /* [ 5053] OBJ_camellia_256_ecb */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x04,       /* [ 5061] OBJ_camellia_128_cfb128 */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x18,       /* [ 5069] OBJ_camellia_192_cfb128 */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x2C,       /* [ 5077] OBJ_camellia_256_cfb128 */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x03,       /* [ 5085] OBJ_camellia_128_ofb128 */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x17,       /* [ 5093] OBJ_camellia_192_ofb128 */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x2B,       /* [ 5101] OBJ_camellia_256_ofb128 */
-    0x55,0x1D,0x09,                                /* [ 5109] OBJ_subject_directory_attributes */
-    0x55,0x1D,0x1C,                                /* [ 5112] OBJ_issuing_distribution_point */
-    0x55,0x1D,0x1D,                                /* [ 5115] OBJ_certificate_issuer */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x44,                 /* [ 5118] OBJ_kisa */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x44,0x01,0x03,       /* [ 5124] OBJ_seed_ecb */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x44,0x01,0x04,       /* [ 5132] OBJ_seed_cbc */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x44,0x01,0x06,       /* [ 5140] OBJ_seed_ofb128 */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x44,0x01,0x05,       /* [ 5148] OBJ_seed_cfb128 */
-    0x2B,0x06,0x01,0x05,0x05,0x08,0x01,0x01,       /* [ 5156] OBJ_hmac_md5 */
-    0x2B,0x06,0x01,0x05,0x05,0x08,0x01,0x02,       /* [ 5164] OBJ_hmac_sha1 */
-    0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x42,0x0D,  /* [ 5172] OBJ_id_PasswordBasedMAC */
-    0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x42,0x1E,  /* [ 5181] OBJ_id_DHBasedMac */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x10,       /* [ 5190] OBJ_id_it_suppLangTags */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x05,       /* [ 5198] OBJ_caRepository */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x09,  /* [ 5206] OBJ_id_smime_ct_compressedData */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x1B,  /* [ 5217] OBJ_id_ct_asciiTextWithCRLF */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x05,  /* [ 5228] OBJ_id_aes128_wrap */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x19,  /* [ 5237] OBJ_id_aes192_wrap */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2D,  /* [ 5246] OBJ_id_aes256_wrap */
-    0x2A,0x86,0x48,0xCE,0x3D,0x04,0x02,            /* [ 5255] OBJ_ecdsa_with_Recommended */
-    0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,            /* [ 5262] OBJ_ecdsa_with_Specified */
-    0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x01,       /* [ 5269] OBJ_ecdsa_with_SHA224 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,       /* [ 5277] OBJ_ecdsa_with_SHA256 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,       /* [ 5285] OBJ_ecdsa_with_SHA384 */
-    0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,       /* [ 5293] OBJ_ecdsa_with_SHA512 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x06,       /* [ 5301] OBJ_hmacWithMD5 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x08,       /* [ 5309] OBJ_hmacWithSHA224 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,       /* [ 5317] OBJ_hmacWithSHA256 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,       /* [ 5325] OBJ_hmacWithSHA384 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,       /* [ 5333] OBJ_hmacWithSHA512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x01,  /* [ 5341] OBJ_dsa_with_SHA224 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x02,  /* [ 5350] OBJ_dsa_with_SHA256 */
-    0x28,0xCF,0x06,0x03,0x00,0x37,                 /* [ 5359] OBJ_whirlpool */
-    0x2A,0x85,0x03,0x02,0x02,                      /* [ 5365] OBJ_cryptopro */
-    0x2A,0x85,0x03,0x02,0x09,                      /* [ 5370] OBJ_cryptocom */
-    0x2A,0x85,0x03,0x02,0x02,0x03,                 /* [ 5375] OBJ_id_GostR3411_94_with_GostR3410_2001 */
-    0x2A,0x85,0x03,0x02,0x02,0x04,                 /* [ 5381] OBJ_id_GostR3411_94_with_GostR3410_94 */
-    0x2A,0x85,0x03,0x02,0x02,0x09,                 /* [ 5387] OBJ_id_GostR3411_94 */
-    0x2A,0x85,0x03,0x02,0x02,0x0A,                 /* [ 5393] OBJ_id_HMACGostR3411_94 */
-    0x2A,0x85,0x03,0x02,0x02,0x13,                 /* [ 5399] OBJ_id_GostR3410_2001 */
-    0x2A,0x85,0x03,0x02,0x02,0x14,                 /* [ 5405] OBJ_id_GostR3410_94 */
-    0x2A,0x85,0x03,0x02,0x02,0x15,                 /* [ 5411] OBJ_id_Gost28147_89 */
-    0x2A,0x85,0x03,0x02,0x02,0x16,                 /* [ 5417] OBJ_id_Gost28147_89_MAC */
-    0x2A,0x85,0x03,0x02,0x02,0x17,                 /* [ 5423] OBJ_id_GostR3411_94_prf */
-    0x2A,0x85,0x03,0x02,0x02,0x62,                 /* [ 5429] OBJ_id_GostR3410_2001DH */
-    0x2A,0x85,0x03,0x02,0x02,0x63,                 /* [ 5435] OBJ_id_GostR3410_94DH */
-    0x2A,0x85,0x03,0x02,0x02,0x0E,0x01,            /* [ 5441] OBJ_id_Gost28147_89_CryptoPro_KeyMeshing */
-    0x2A,0x85,0x03,0x02,0x02,0x0E,0x00,            /* [ 5448] OBJ_id_Gost28147_89_None_KeyMeshing */
-    0x2A,0x85,0x03,0x02,0x02,0x1E,0x00,            /* [ 5455] OBJ_id_GostR3411_94_TestParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x1E,0x01,            /* [ 5462] OBJ_id_GostR3411_94_CryptoProParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x1F,0x00,            /* [ 5469] OBJ_id_Gost28147_89_TestParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x1F,0x01,            /* [ 5476] OBJ_id_Gost28147_89_CryptoPro_A_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x1F,0x02,            /* [ 5483] OBJ_id_Gost28147_89_CryptoPro_B_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x1F,0x03,            /* [ 5490] OBJ_id_Gost28147_89_CryptoPro_C_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x1F,0x04,            /* [ 5497] OBJ_id_Gost28147_89_CryptoPro_D_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x1F,0x05,            /* [ 5504] OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x1F,0x06,            /* [ 5511] OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x1F,0x07,            /* [ 5518] OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x20,0x00,            /* [ 5525] OBJ_id_GostR3410_94_TestParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x20,0x02,            /* [ 5532] OBJ_id_GostR3410_94_CryptoPro_A_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x20,0x03,            /* [ 5539] OBJ_id_GostR3410_94_CryptoPro_B_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x20,0x04,            /* [ 5546] OBJ_id_GostR3410_94_CryptoPro_C_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x20,0x05,            /* [ 5553] OBJ_id_GostR3410_94_CryptoPro_D_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x21,0x01,            /* [ 5560] OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x21,0x02,            /* [ 5567] OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x21,0x03,            /* [ 5574] OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x23,0x00,            /* [ 5581] OBJ_id_GostR3410_2001_TestParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x23,0x01,            /* [ 5588] OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x23,0x02,            /* [ 5595] OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x23,0x03,            /* [ 5602] OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x24,0x00,            /* [ 5609] OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x24,0x01,            /* [ 5616] OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet */
-    0x2A,0x85,0x03,0x02,0x02,0x14,0x01,            /* [ 5623] OBJ_id_GostR3410_94_a */
-    0x2A,0x85,0x03,0x02,0x02,0x14,0x02,            /* [ 5630] OBJ_id_GostR3410_94_aBis */
-    0x2A,0x85,0x03,0x02,0x02,0x14,0x03,            /* [ 5637] OBJ_id_GostR3410_94_b */
-    0x2A,0x85,0x03,0x02,0x02,0x14,0x04,            /* [ 5644] OBJ_id_GostR3410_94_bBis */
-    0x2A,0x85,0x03,0x02,0x09,0x01,0x06,0x01,       /* [ 5651] OBJ_id_Gost28147_89_cc */
-    0x2A,0x85,0x03,0x02,0x09,0x01,0x05,0x03,       /* [ 5659] OBJ_id_GostR3410_94_cc */
-    0x2A,0x85,0x03,0x02,0x09,0x01,0x05,0x04,       /* [ 5667] OBJ_id_GostR3410_2001_cc */
-    0x2A,0x85,0x03,0x02,0x09,0x01,0x03,0x03,       /* [ 5675] OBJ_id_GostR3411_94_with_GostR3410_94_cc */
-    0x2A,0x85,0x03,0x02,0x09,0x01,0x03,0x04,       /* [ 5683] OBJ_id_GostR3411_94_with_GostR3410_2001_cc */
-    0x2A,0x85,0x03,0x02,0x09,0x01,0x08,0x01,       /* [ 5691] OBJ_id_GostR3410_2001_ParamSet_cc */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x02,  /* [ 5699] OBJ_LocalKeySet */
-    0x55,0x1D,0x2E,                                /* [ 5708] OBJ_freshest_crl */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x08,0x03,       /* [ 5711] OBJ_id_on_permanentIdentifier */
-    0x55,0x04,0x0E,                                /* [ 5719] OBJ_searchGuide */
-    0x55,0x04,0x0F,                                /* [ 5722] OBJ_businessCategory */
-    0x55,0x04,0x10,                                /* [ 5725] OBJ_postalAddress */
-    0x55,0x04,0x12,                                /* [ 5728] OBJ_postOfficeBox */
-    0x55,0x04,0x13,                                /* [ 5731] OBJ_physicalDeliveryOfficeName */
-    0x55,0x04,0x14,                                /* [ 5734] OBJ_telephoneNumber */
-    0x55,0x04,0x15,                                /* [ 5737] OBJ_telexNumber */
-    0x55,0x04,0x16,                                /* [ 5740] OBJ_teletexTerminalIdentifier */
-    0x55,0x04,0x17,                                /* [ 5743] OBJ_facsimileTelephoneNumber */
-    0x55,0x04,0x18,                                /* [ 5746] OBJ_x121Address */
-    0x55,0x04,0x19,                                /* [ 5749] OBJ_internationaliSDNNumber */
-    0x55,0x04,0x1A,                                /* [ 5752] OBJ_registeredAddress */
-    0x55,0x04,0x1B,                                /* [ 5755] OBJ_destinationIndicator */
-    0x55,0x04,0x1C,                                /* [ 5758] OBJ_preferredDeliveryMethod */
-    0x55,0x04,0x1D,                                /* [ 5761] OBJ_presentationAddress */
-    0x55,0x04,0x1E,                                /* [ 5764] OBJ_supportedApplicationContext */
-    0x55,0x04,0x1F,                                /* [ 5767] OBJ_member */
-    0x55,0x04,0x20,                                /* [ 5770] OBJ_owner */
-    0x55,0x04,0x21,                                /* [ 5773] OBJ_roleOccupant */
-    0x55,0x04,0x22,                                /* [ 5776] OBJ_seeAlso */
-    0x55,0x04,0x23,                                /* [ 5779] OBJ_userPassword */
-    0x55,0x04,0x24,                                /* [ 5782] OBJ_userCertificate */
-    0x55,0x04,0x25,                                /* [ 5785] OBJ_cACertificate */
-    0x55,0x04,0x26,                                /* [ 5788] OBJ_authorityRevocationList */
-    0x55,0x04,0x27,                                /* [ 5791] OBJ_certificateRevocationList */
-    0x55,0x04,0x28,                                /* [ 5794] OBJ_crossCertificatePair */
-    0x55,0x04,0x2F,                                /* [ 5797] OBJ_enhancedSearchGuide */
-    0x55,0x04,0x30,                                /* [ 5800] OBJ_protocolInformation */
-    0x55,0x04,0x31,                                /* [ 5803] OBJ_distinguishedName */
-    0x55,0x04,0x32,                                /* [ 5806] OBJ_uniqueMember */
-    0x55,0x04,0x33,                                /* [ 5809] OBJ_houseIdentifier */
-    0x55,0x04,0x34,                                /* [ 5812] OBJ_supportedAlgorithms */
-    0x55,0x04,0x35,                                /* [ 5815] OBJ_deltaRevocationList */
-    0x55,0x04,0x36,                                /* [ 5818] OBJ_dmdName */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x09,  /* [ 5821] OBJ_id_alg_PWRI_KEK */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x06,  /* [ 5832] OBJ_aes_128_gcm */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x07,  /* [ 5841] OBJ_aes_128_ccm */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x08,  /* [ 5850] OBJ_id_aes128_wrap_pad */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x1A,  /* [ 5859] OBJ_aes_192_gcm */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x1B,  /* [ 5868] OBJ_aes_192_ccm */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x1C,  /* [ 5877] OBJ_id_aes192_wrap_pad */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2E,  /* [ 5886] OBJ_aes_256_gcm */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2F,  /* [ 5895] OBJ_aes_256_ccm */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x30,  /* [ 5904] OBJ_id_aes256_wrap_pad */
-    0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x03,0x02,  /* [ 5913] OBJ_id_camellia128_wrap */
-    0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x03,0x03,  /* [ 5924] OBJ_id_camellia192_wrap */
-    0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x03,0x04,  /* [ 5935] OBJ_id_camellia256_wrap */
-    0x55,0x1D,0x25,0x00,                           /* [ 5946] OBJ_anyExtendedKeyUsage */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,  /* [ 5950] OBJ_mgf1 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,  /* [ 5959] OBJ_rsassaPss */
-    0x2B,0x6F,0x02,0x8C,0x53,0x00,0x01,0x01,       /* [ 5968] OBJ_aes_128_xts */
-    0x2B,0x6F,0x02,0x8C,0x53,0x00,0x01,0x02,       /* [ 5976] OBJ_aes_256_xts */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,  /* [ 5984] OBJ_rsaesOaep */
-    0x2A,0x86,0x48,0xCE,0x3E,0x02,0x01,            /* [ 5993] OBJ_dhpublicnumber */
-    0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x01,  /* [ 6000] OBJ_brainpoolP160r1 */
-    0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x02,  /* [ 6009] OBJ_brainpoolP160t1 */
-    0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x03,  /* [ 6018] OBJ_brainpoolP192r1 */
-    0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x04,  /* [ 6027] OBJ_brainpoolP192t1 */
-    0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x05,  /* [ 6036] OBJ_brainpoolP224r1 */
-    0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x06,  /* [ 6045] OBJ_brainpoolP224t1 */
-    0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x07,  /* [ 6054] OBJ_brainpoolP256r1 */
-    0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x08,  /* [ 6063] OBJ_brainpoolP256t1 */
-    0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x09,  /* [ 6072] OBJ_brainpoolP320r1 */
-    0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x0A,  /* [ 6081] OBJ_brainpoolP320t1 */
-    0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x0B,  /* [ 6090] OBJ_brainpoolP384r1 */
-    0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x0C,  /* [ 6099] OBJ_brainpoolP384t1 */
-    0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x0D,  /* [ 6108] OBJ_brainpoolP512r1 */
-    0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x0E,  /* [ 6117] OBJ_brainpoolP512t1 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,  /* [ 6126] OBJ_pSpecified */
-    0x2B,0x81,0x05,0x10,0x86,0x48,0x3F,0x00,0x02,  /* [ 6135] OBJ_dhSinglePass_stdDH_sha1kdf_scheme */
-    0x2B,0x81,0x04,0x01,0x0B,0x00,                 /* [ 6144] OBJ_dhSinglePass_stdDH_sha224kdf_scheme */
-    0x2B,0x81,0x04,0x01,0x0B,0x01,                 /* [ 6150] OBJ_dhSinglePass_stdDH_sha256kdf_scheme */
-    0x2B,0x81,0x04,0x01,0x0B,0x02,                 /* [ 6156] OBJ_dhSinglePass_stdDH_sha384kdf_scheme */
-    0x2B,0x81,0x04,0x01,0x0B,0x03,                 /* [ 6162] OBJ_dhSinglePass_stdDH_sha512kdf_scheme */
-    0x2B,0x81,0x05,0x10,0x86,0x48,0x3F,0x00,0x03,  /* [ 6168] OBJ_dhSinglePass_cofactorDH_sha1kdf_scheme */
-    0x2B,0x81,0x04,0x01,0x0E,0x00,                 /* [ 6177] OBJ_dhSinglePass_cofactorDH_sha224kdf_scheme */
-    0x2B,0x81,0x04,0x01,0x0E,0x01,                 /* [ 6183] OBJ_dhSinglePass_cofactorDH_sha256kdf_scheme */
-    0x2B,0x81,0x04,0x01,0x0E,0x02,                 /* [ 6189] OBJ_dhSinglePass_cofactorDH_sha384kdf_scheme */
-    0x2B,0x81,0x04,0x01,0x0E,0x03,                 /* [ 6195] OBJ_dhSinglePass_cofactorDH_sha512kdf_scheme */
-    0x2B,0x06,0x01,0x04,0x01,0xD6,0x79,0x02,0x04,0x02,  /* [ 6201] OBJ_ct_precert_scts */
-    0x2B,0x06,0x01,0x04,0x01,0xD6,0x79,0x02,0x04,0x03,  /* [ 6211] OBJ_ct_precert_poison */
-    0x2B,0x06,0x01,0x04,0x01,0xD6,0x79,0x02,0x04,0x04,  /* [ 6221] OBJ_ct_precert_signer */
-    0x2B,0x06,0x01,0x04,0x01,0xD6,0x79,0x02,0x04,0x05,  /* [ 6231] OBJ_ct_cert_scts */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x3C,0x02,0x01,0x01,  /* [ 6241] OBJ_jurisdictionLocalityName */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x3C,0x02,0x01,0x02,  /* [ 6252] OBJ_jurisdictionStateOrProvinceName */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x3C,0x02,0x01,0x03,  /* [ 6263] OBJ_jurisdictionCountryName */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x06,       /* [ 6274] OBJ_camellia_128_gcm */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x07,       /* [ 6282] OBJ_camellia_128_ccm */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x09,       /* [ 6290] OBJ_camellia_128_ctr */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x0A,       /* [ 6298] OBJ_camellia_128_cmac */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x1A,       /* [ 6306] OBJ_camellia_192_gcm */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x1B,       /* [ 6314] OBJ_camellia_192_ccm */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x1D,       /* [ 6322] OBJ_camellia_192_ctr */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x1E,       /* [ 6330] OBJ_camellia_192_cmac */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x2E,       /* [ 6338] OBJ_camellia_256_gcm */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x2F,       /* [ 6346] OBJ_camellia_256_ccm */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x31,       /* [ 6354] OBJ_camellia_256_ctr */
-    0x03,0xA2,0x31,0x05,0x03,0x01,0x09,0x32,       /* [ 6362] OBJ_camellia_256_cmac */
-    0x2B,0x06,0x01,0x04,0x01,0xDA,0x47,0x04,0x0B,  /* [ 6370] OBJ_id_scrypt */
-    0x2A,0x85,0x03,0x07,0x01,                      /* [ 6379] OBJ_id_tc26 */
-    0x2A,0x85,0x03,0x07,0x01,0x01,                 /* [ 6384] OBJ_id_tc26_algorithms */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x01,            /* [ 6390] OBJ_id_tc26_sign */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x01,0x01,       /* [ 6397] OBJ_id_GostR3410_2012_256 */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x01,0x02,       /* [ 6405] OBJ_id_GostR3410_2012_512 */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x02,            /* [ 6413] OBJ_id_tc26_digest */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x02,0x02,       /* [ 6420] OBJ_id_GostR3411_2012_256 */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x02,0x03,       /* [ 6428] OBJ_id_GostR3411_2012_512 */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x03,            /* [ 6436] OBJ_id_tc26_signwithdigest */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x03,0x02,       /* [ 6443] OBJ_id_tc26_signwithdigest_gost3410_2012_256 */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x03,0x03,       /* [ 6451] OBJ_id_tc26_signwithdigest_gost3410_2012_512 */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x04,            /* [ 6459] OBJ_id_tc26_mac */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x04,0x01,       /* [ 6466] OBJ_id_tc26_hmac_gost_3411_2012_256 */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x04,0x02,       /* [ 6474] OBJ_id_tc26_hmac_gost_3411_2012_512 */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x05,            /* [ 6482] OBJ_id_tc26_cipher */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x06,            /* [ 6489] OBJ_id_tc26_agreement */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x06,0x01,       /* [ 6496] OBJ_id_tc26_agreement_gost_3410_2012_256 */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x06,0x02,       /* [ 6504] OBJ_id_tc26_agreement_gost_3410_2012_512 */
-    0x2A,0x85,0x03,0x07,0x01,0x02,                 /* [ 6512] OBJ_id_tc26_constants */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x01,            /* [ 6518] OBJ_id_tc26_sign_constants */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x02,       /* [ 6525] OBJ_id_tc26_gost_3410_2012_512_constants */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x02,0x00,  /* [ 6533] OBJ_id_tc26_gost_3410_2012_512_paramSetTest */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x02,0x01,  /* [ 6542] OBJ_id_tc26_gost_3410_2012_512_paramSetA */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x02,0x02,  /* [ 6551] OBJ_id_tc26_gost_3410_2012_512_paramSetB */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x02,            /* [ 6560] OBJ_id_tc26_digest_constants */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x05,            /* [ 6567] OBJ_id_tc26_cipher_constants */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x05,0x01,       /* [ 6574] OBJ_id_tc26_gost_28147_constants */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x05,0x01,0x01,  /* [ 6582] OBJ_id_tc26_gost_28147_param_Z */
-    0x2A,0x85,0x03,0x03,0x81,0x03,0x01,0x01,       /* [ 6591] OBJ_INN */
-    0x2A,0x85,0x03,0x64,0x01,                      /* [ 6599] OBJ_OGRN */
-    0x2A,0x85,0x03,0x64,0x03,                      /* [ 6604] OBJ_SNILS */
-    0x2A,0x85,0x03,0x64,0x6F,                      /* [ 6609] OBJ_subjectSignTool */
-    0x2A,0x85,0x03,0x64,0x70,                      /* [ 6614] OBJ_issuerSignTool */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x18,       /* [ 6619] OBJ_tlsfeature */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x11,       /* [ 6627] OBJ_ipsec_IKE */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x12,       /* [ 6635] OBJ_capwapAC */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x13,       /* [ 6643] OBJ_capwapWTP */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x15,       /* [ 6651] OBJ_sshClient */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x16,       /* [ 6659] OBJ_sshServer */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x17,       /* [ 6667] OBJ_sendRouter */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x18,       /* [ 6675] OBJ_sendProxiedRouter */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x19,       /* [ 6683] OBJ_sendOwner */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x1A,       /* [ 6691] OBJ_sendProxiedOwner */
-    0x2B,0x06,0x01,0x05,0x02,0x03,                 /* [ 6699] OBJ_id_pkinit */
-    0x2B,0x06,0x01,0x05,0x02,0x03,0x04,            /* [ 6705] OBJ_pkInitClientAuth */
-    0x2B,0x06,0x01,0x05,0x02,0x03,0x05,            /* [ 6712] OBJ_pkInitKDC */
-    0x2B,0x65,0x6E,                                /* [ 6719] OBJ_X25519 */
-    0x2B,0x65,0x6F,                                /* [ 6722] OBJ_X448 */
-    0x2B,0x06,0x01,0x04,0x01,0x8D,0x3A,0x0C,0x02,0x01,0x10,  /* [ 6725] OBJ_blake2b512 */
-    0x2B,0x06,0x01,0x04,0x01,0x8D,0x3A,0x0C,0x02,0x02,0x08,  /* [ 6736] OBJ_blake2s256 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x13,  /* [ 6747] OBJ_id_smime_ct_contentCollection */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x17,  /* [ 6758] OBJ_id_smime_ct_authEnvelopedData */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x1C,  /* [ 6769] OBJ_id_ct_xml */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x01,  /* [ 6780] OBJ_aria_128_ecb */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x02,  /* [ 6789] OBJ_aria_128_cbc */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x03,  /* [ 6798] OBJ_aria_128_cfb128 */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x04,  /* [ 6807] OBJ_aria_128_ofb128 */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x05,  /* [ 6816] OBJ_aria_128_ctr */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x06,  /* [ 6825] OBJ_aria_192_ecb */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x07,  /* [ 6834] OBJ_aria_192_cbc */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x08,  /* [ 6843] OBJ_aria_192_cfb128 */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x09,  /* [ 6852] OBJ_aria_192_ofb128 */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x0A,  /* [ 6861] OBJ_aria_192_ctr */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x0B,  /* [ 6870] OBJ_aria_256_ecb */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x0C,  /* [ 6879] OBJ_aria_256_cbc */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x0D,  /* [ 6888] OBJ_aria_256_cfb128 */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x0E,  /* [ 6897] OBJ_aria_256_ofb128 */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x0F,  /* [ 6906] OBJ_aria_256_ctr */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,  /* [ 6915] OBJ_id_smime_aa_signingCertificateV2 */
-    0x2B,0x65,0x70,                                /* [ 6926] OBJ_ED25519 */
-    0x2B,0x65,0x71,                                /* [ 6929] OBJ_ED448 */
-    0x55,0x04,0x61,                                /* [ 6932] OBJ_organizationIdentifier */
-    0x55,0x04,0x62,                                /* [ 6935] OBJ_countryCode3c */
-    0x55,0x04,0x63,                                /* [ 6938] OBJ_countryCode3n */
-    0x55,0x04,0x64,                                /* [ 6941] OBJ_dnsName */
-    0x2B,0x24,0x08,0x03,0x03,                      /* [ 6944] OBJ_x509ExtAdmission */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x05,  /* [ 6949] OBJ_sha512_224 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x06,  /* [ 6958] OBJ_sha512_256 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x07,  /* [ 6967] OBJ_sha3_224 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x08,  /* [ 6976] OBJ_sha3_256 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x09,  /* [ 6985] OBJ_sha3_384 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x0A,  /* [ 6994] OBJ_sha3_512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x0B,  /* [ 7003] OBJ_shake128 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x0C,  /* [ 7012] OBJ_shake256 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x0D,  /* [ 7021] OBJ_hmac_sha3_224 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x0E,  /* [ 7030] OBJ_hmac_sha3_256 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x0F,  /* [ 7039] OBJ_hmac_sha3_384 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x10,  /* [ 7048] OBJ_hmac_sha3_512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x03,  /* [ 7057] OBJ_dsa_with_SHA384 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x04,  /* [ 7066] OBJ_dsa_with_SHA512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x05,  /* [ 7075] OBJ_dsa_with_SHA3_224 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x06,  /* [ 7084] OBJ_dsa_with_SHA3_256 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x07,  /* [ 7093] OBJ_dsa_with_SHA3_384 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x08,  /* [ 7102] OBJ_dsa_with_SHA3_512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x09,  /* [ 7111] OBJ_ecdsa_with_SHA3_224 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x0A,  /* [ 7120] OBJ_ecdsa_with_SHA3_256 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x0B,  /* [ 7129] OBJ_ecdsa_with_SHA3_384 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x0C,  /* [ 7138] OBJ_ecdsa_with_SHA3_512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x0D,  /* [ 7147] OBJ_RSA_SHA3_224 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x0E,  /* [ 7156] OBJ_RSA_SHA3_256 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x0F,  /* [ 7165] OBJ_RSA_SHA3_384 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x10,  /* [ 7174] OBJ_RSA_SHA3_512 */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x25,  /* [ 7183] OBJ_aria_128_ccm */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x26,  /* [ 7192] OBJ_aria_192_ccm */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x27,  /* [ 7201] OBJ_aria_256_ccm */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x22,  /* [ 7210] OBJ_aria_128_gcm */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x23,  /* [ 7219] OBJ_aria_192_gcm */
-    0x2A,0x83,0x1A,0x8C,0x9A,0x6E,0x01,0x01,0x24,  /* [ 7228] OBJ_aria_256_gcm */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x1B,       /* [ 7237] OBJ_cmcCA */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x1C,       /* [ 7245] OBJ_cmcRA */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x01,       /* [ 7253] OBJ_sm4_ecb */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x02,       /* [ 7261] OBJ_sm4_cbc */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x03,       /* [ 7269] OBJ_sm4_ofb128 */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x05,       /* [ 7277] OBJ_sm4_cfb1 */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x04,       /* [ 7285] OBJ_sm4_cfb128 */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x06,       /* [ 7293] OBJ_sm4_cfb8 */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x07,       /* [ 7301] OBJ_sm4_ctr */
-    0x2A,0x81,0x1C,                                /* [ 7309] OBJ_ISO_CN */
-    0x2A,0x81,0x1C,0xCF,0x55,                      /* [ 7312] OBJ_oscca */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,                 /* [ 7317] OBJ_sm_scheme */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x83,0x11,       /* [ 7323] OBJ_sm3 */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x83,0x78,       /* [ 7331] OBJ_sm3WithRSAEncryption */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0F,  /* [ 7339] OBJ_sha512_224WithRSAEncryption */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x10,  /* [ 7348] OBJ_sha512_256WithRSAEncryption */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x01,       /* [ 7357] OBJ_id_tc26_gost_3410_2012_256_constants */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x01,0x01,  /* [ 7365] OBJ_id_tc26_gost_3410_2012_256_paramSetA */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x02,0x03,  /* [ 7374] OBJ_id_tc26_gost_3410_2012_512_paramSetC */
-    0x2A,0x86,0x24,                                /* [ 7383] OBJ_ISO_UA */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,            /* [ 7386] OBJ_ua_pki */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x01,0x01,  /* [ 7393] OBJ_dstu28147 */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x02,  /* [ 7403] OBJ_dstu28147_ofb */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x03,  /* [ 7414] OBJ_dstu28147_cfb */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x05,  /* [ 7425] OBJ_dstu28147_wrap */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x01,0x02,  /* [ 7436] OBJ_hmacWithDstu34311 */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x02,0x01,  /* [ 7446] OBJ_dstu34311 */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x03,0x01,0x01,  /* [ 7456] OBJ_dstu4145le */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x03,0x01,0x01,0x01,0x01,  /* [ 7467] OBJ_dstu4145be */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x03,0x01,0x01,0x02,0x00,  /* [ 7480] OBJ_uacurve0 */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x03,0x01,0x01,0x02,0x01,  /* [ 7493] OBJ_uacurve1 */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x03,0x01,0x01,0x02,0x02,  /* [ 7506] OBJ_uacurve2 */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x03,0x01,0x01,0x02,0x03,  /* [ 7519] OBJ_uacurve3 */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x03,0x01,0x01,0x02,0x04,  /* [ 7532] OBJ_uacurve4 */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x03,0x01,0x01,0x02,0x05,  /* [ 7545] OBJ_uacurve5 */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x03,0x01,0x01,0x02,0x06,  /* [ 7558] OBJ_uacurve6 */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x03,0x01,0x01,0x02,0x07,  /* [ 7571] OBJ_uacurve7 */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x03,0x01,0x01,0x02,0x08,  /* [ 7584] OBJ_uacurve8 */
-    0x2A,0x86,0x24,0x02,0x01,0x01,0x01,0x01,0x03,0x01,0x01,0x02,0x09,  /* [ 7597] OBJ_uacurve9 */
-    0x2B,0x6F,                                     /* [ 7610] OBJ_ieee */
-    0x2B,0x6F,0x02,0x8C,0x53,                      /* [ 7612] OBJ_ieee_siswg */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x82,0x2D,       /* [ 7617] OBJ_sm2 */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x05,0x01,       /* [ 7625] OBJ_id_tc26_cipher_gostr3412_2015_magma */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x05,0x01,0x01,  /* [ 7633] OBJ_magma_ctr_acpkm */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x05,0x01,0x02,  /* [ 7642] OBJ_magma_ctr_acpkm_omac */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x05,0x02,       /* [ 7651] OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x05,0x02,0x01,  /* [ 7659] OBJ_kuznyechik_ctr_acpkm */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x05,0x02,0x02,  /* [ 7668] OBJ_kuznyechik_ctr_acpkm_omac */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x07,            /* [ 7677] OBJ_id_tc26_wrap */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x07,0x01,       /* [ 7684] OBJ_id_tc26_wrap_gostr3412_2015_magma */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x07,0x01,0x01,  /* [ 7692] OBJ_magma_kexp15 */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x07,0x02,       /* [ 7701] OBJ_id_tc26_wrap_gostr3412_2015_kuznyechik */
-    0x2A,0x85,0x03,0x07,0x01,0x01,0x07,0x02,0x01,  /* [ 7709] OBJ_kuznyechik_kexp15 */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x01,0x02,  /* [ 7718] OBJ_id_tc26_gost_3410_2012_256_paramSetB */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x01,0x03,  /* [ 7727] OBJ_id_tc26_gost_3410_2012_256_paramSetC */
-    0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x01,0x04,  /* [ 7736] OBJ_id_tc26_gost_3410_2012_256_paramSetD */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0C,       /* [ 7745] OBJ_hmacWithSHA512_224 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0D,       /* [ 7753] OBJ_hmacWithSHA512_256 */
-    0x28,0xCC,0x45,0x03,0x04,                      /* [ 7761] OBJ_gmac */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x13,  /* [ 7766] OBJ_kmac128 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x14,  /* [ 7775] OBJ_kmac256 */
-    0x2B,0x06,0x01,0x04,0x01,0x8D,0x3A,0x0C,0x02,0x01,  /* [ 7784] OBJ_blake2bmac */
-    0x2B,0x06,0x01,0x04,0x01,0x8D,0x3A,0x0C,0x02,0x02,  /* [ 7794] OBJ_blake2smac */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x83,0x75,       /* [ 7804] OBJ_SM2_with_SM3 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x08,0x09,       /* [ 7812] OBJ_id_on_SmtpUTF8Mailbox */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x08,0x05,       /* [ 7820] OBJ_XmppAddr */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x08,0x07,       /* [ 7828] OBJ_SRVName */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x08,0x08,       /* [ 7836] OBJ_NAIRealm */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x1D,       /* [ 7844] OBJ_cmcArchive */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x1E,       /* [ 7852] OBJ_id_kp_bgpsec_router */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x1F,       /* [ 7860] OBJ_id_kp_BrandIndicatorforMessageIdentification */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x20,       /* [ 7868] OBJ_cmKGA */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x11,       /* [ 7876] OBJ_id_it_caCerts */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x12,       /* [ 7884] OBJ_id_it_rootCaKeyUpdate */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x13,       /* [ 7892] OBJ_id_it_certReqTemplate */
-    0x2A,0x85,0x03,0x64,0x05,                      /* [ 7900] OBJ_OGRNIP */
-    0x2A,0x85,0x03,0x64,0x71,                      /* [ 7905] OBJ_classSignTool */
-    0x2A,0x85,0x03,0x64,0x71,0x01,                 /* [ 7910] OBJ_classSignToolKC1 */
-    0x2A,0x85,0x03,0x64,0x71,0x02,                 /* [ 7916] OBJ_classSignToolKC2 */
-    0x2A,0x85,0x03,0x64,0x71,0x03,                 /* [ 7922] OBJ_classSignToolKC3 */
-    0x2A,0x85,0x03,0x64,0x71,0x04,                 /* [ 7928] OBJ_classSignToolKB1 */
-    0x2A,0x85,0x03,0x64,0x71,0x05,                 /* [ 7934] OBJ_classSignToolKB2 */
-    0x2A,0x85,0x03,0x64,0x71,0x06,                 /* [ 7940] OBJ_classSignToolKA1 */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x18,  /* [ 7946] OBJ_id_ct_routeOriginAuthz */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x1A,  /* [ 7957] OBJ_id_ct_rpkiManifest */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x23,  /* [ 7968] OBJ_id_ct_rpkiGhostbusters */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x24,  /* [ 7979] OBJ_id_ct_resourceTaggedAttest */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0E,            /* [ 7990] OBJ_id_cp */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x1C,       /* [ 7997] OBJ_sbgp_ipAddrBlockv2 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x1D,       /* [ 8005] OBJ_sbgp_autonomousSysNumv2 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0E,0x02,       /* [ 8013] OBJ_ipAddr_asNumber */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x0E,0x03,       /* [ 8021] OBJ_ipAddr_asNumberv2 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x0A,       /* [ 8029] OBJ_rpkiManifest */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x0B,       /* [ 8037] OBJ_signedObject */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x0D,       /* [ 8045] OBJ_rpkiNotify */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x2F,  /* [ 8053] OBJ_id_ct_geofeedCSVwithCRLF */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x30,  /* [ 8064] OBJ_id_ct_signedChecklist */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x08,       /* [ 8075] OBJ_sm4_gcm */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x09,       /* [ 8083] OBJ_sm4_ccm */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x31,  /* [ 8091] OBJ_id_ct_ASPA */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x32,       /* [ 8102] OBJ_id_mod_cmp2000_02 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x63,       /* [ 8110] OBJ_id_mod_cmp2021_88 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x64,       /* [ 8118] OBJ_id_mod_cmp2021_02 */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x14,       /* [ 8126] OBJ_id_it_rootCaCert */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x15,       /* [ 8134] OBJ_id_it_certProfile */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x16,       /* [ 8142] OBJ_id_it_crlStatusList */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x17,       /* [ 8150] OBJ_id_it_crls */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x07,  /* [ 8158] OBJ_id_regCtrl_altCertTemplate */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x0B,  /* [ 8167] OBJ_id_regCtrl_algId */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x0C,  /* [ 8176] OBJ_id_regCtrl_rsaKeyLen */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2C,  /* [ 8185] OBJ_id_aa_ets_attrCertificateRefs */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2D,  /* [ 8196] OBJ_id_aa_ets_attrRevocationRefs */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x34,  /* [ 8207] OBJ_id_aa_CMSAlgorithmProtection */
-    0x04,                                          /* [ 8216] OBJ_itu_t_identified_organization */
-    0x04,0x00,                                     /* [ 8217] OBJ_etsi */
-    0x04,0x00,0x8D,0x45,                           /* [ 8219] OBJ_electronic_signature_standard */
-    0x04,0x00,0x8D,0x45,0x02,                      /* [ 8223] OBJ_ess_attributes */
-    0x04,0x00,0x8D,0x45,0x02,0x01,                 /* [ 8228] OBJ_id_aa_ets_mimeType */
-    0x04,0x00,0x8D,0x45,0x02,0x02,                 /* [ 8234] OBJ_id_aa_ets_longTermValidation */
-    0x04,0x00,0x8D,0x45,0x02,0x03,                 /* [ 8240] OBJ_id_aa_ets_SignaturePolicyDocument */
-    0x04,0x00,0x8D,0x45,0x02,0x04,                 /* [ 8246] OBJ_id_aa_ets_archiveTimestampV3 */
-    0x04,0x00,0x8D,0x45,0x02,0x05,                 /* [ 8252] OBJ_id_aa_ATSHashIndex */
-    0x04,0x00,0x81,0x95,0x32,                      /* [ 8258] OBJ_cades */
-    0x04,0x00,0x81,0x95,0x32,0x01,                 /* [ 8263] OBJ_cades_attributes */
-    0x04,0x00,0x81,0x95,0x32,0x01,0x01,            /* [ 8269] OBJ_id_aa_ets_signerAttrV2 */
-    0x04,0x00,0x81,0x95,0x32,0x01,0x03,            /* [ 8276] OBJ_id_aa_ets_sigPolicyStore */
-    0x04,0x00,0x81,0x95,0x32,0x01,0x04,            /* [ 8283] OBJ_id_aa_ATSHashIndex_v2 */
-    0x04,0x00,0x81,0x95,0x32,0x01,0x05,            /* [ 8290] OBJ_id_aa_ATSHashIndex_v3 */
-    0x04,0x00,0x81,0x95,0x32,0x01,0x06,            /* [ 8297] OBJ_signedAssertion */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x30,  /* [ 8304] OBJ_id_aa_ets_archiveTimestampV2 */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x83,0x11,0x03,0x01,  /* [ 8315] OBJ_hmacWithSM3 */
-    0x60,0x86,0x48,0x01,0x86,0xF9,0x66,            /* [ 8325] OBJ_oracle */
-    0x60,0x86,0x48,0x01,0x86,0xF9,0x66,0xAD,0xCA,0x7B,0x01,0x01,  /* [ 8332] OBJ_oracle_jdk_trustedkeyusage */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x32,  /* [ 8344] OBJ_id_ct_signedTAL */
-    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x0A,       /* [ 8355] OBJ_sm4_xts */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x19,0x02,0x01,  /* [ 8363] OBJ_ms_ntds_obj_sid */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x19,0x02,  /* [ 8373] OBJ_ms_ntds_sec_ext */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x15,0x07,  /* [ 8382] OBJ_ms_cert_templ */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x15,0x0A,  /* [ 8391] OBJ_ms_app_policies */
-    0x55,0x1D,0x26,                                /* [ 8400] OBJ_authority_attribute_identifier */
-    0x55,0x1D,0x27,                                /* [ 8403] OBJ_role_spec_cert_identifier */
-    0x55,0x1D,0x29,                                /* [ 8406] OBJ_basic_att_constraints */
-    0x55,0x1D,0x2A,                                /* [ 8409] OBJ_delegated_name_constraints */
-    0x55,0x1D,0x2B,                                /* [ 8412] OBJ_time_specification */
-    0x55,0x1D,0x30,                                /* [ 8415] OBJ_attribute_descriptor */
-    0x55,0x1D,0x31,                                /* [ 8418] OBJ_user_notice */
-    0x55,0x1D,0x32,                                /* [ 8421] OBJ_soa_identifier */
-    0x55,0x1D,0x34,                                /* [ 8424] OBJ_acceptable_cert_policies */
-    0x55,0x1D,0x39,                                /* [ 8427] OBJ_acceptable_privilege_policies */
-    0x55,0x1D,0x3D,                                /* [ 8430] OBJ_indirect_issuer */
-    0x55,0x1D,0x3E,                                /* [ 8433] OBJ_no_assertion */
-    0x55,0x1D,0x3F,                                /* [ 8436] OBJ_id_aa_issuing_distribution_point */
-    0x55,0x1D,0x40,                                /* [ 8439] OBJ_issued_on_behalf_of */
-    0x55,0x1D,0x41,                                /* [ 8442] OBJ_single_use */
-    0x55,0x1D,0x42,                                /* [ 8445] OBJ_group_ac */
-    0x55,0x1D,0x43,                                /* [ 8448] OBJ_allowed_attribute_assignments */
-    0x55,0x1D,0x44,                                /* [ 8451] OBJ_attribute_mappings */
-    0x55,0x1D,0x45,                                /* [ 8454] OBJ_holder_name_constraints */
-    0x55,0x1D,0x46,                                /* [ 8457] OBJ_authorization_validation */
-    0x55,0x1D,0x47,                                /* [ 8460] OBJ_prot_restrict */
-    0x55,0x1D,0x48,                                /* [ 8463] OBJ_subject_alt_public_key_info */
-    0x55,0x1D,0x49,                                /* [ 8466] OBJ_alt_signature_algorithm */
-    0x55,0x1D,0x4A,                                /* [ 8469] OBJ_alt_signature_value */
-    0x55,0x1D,0x4B,                                /* [ 8472] OBJ_associated_information */
-    0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x33,  /* [ 8475] OBJ_id_ct_rpkiSignedPrefixList */
-    0x2B,0x06,0x01,0x05,0x05,0x07,0x08,0x04,       /* [ 8486] OBJ_id_on_hardwareModuleName */
-    0x2B,0x06,0x01,0x04,0x01,0x82,0xE4,0x25,0x01,  /* [ 8494] OBJ_id_kp_wisun_fan_device */
-    0x67,0x81,0x05,                                /* [ 8503] OBJ_tcg */
-    0x67,0x81,0x05,0x01,                           /* [ 8506] OBJ_tcg_tcpaSpecVersion */
-    0x67,0x81,0x05,0x02,                           /* [ 8510] OBJ_tcg_attribute */
-    0x67,0x81,0x05,0x03,                           /* [ 8514] OBJ_tcg_protocol */
-    0x67,0x81,0x05,0x04,                           /* [ 8518] OBJ_tcg_algorithm */
-    0x67,0x81,0x05,0x05,                           /* [ 8522] OBJ_tcg_platformClass */
-    0x67,0x81,0x05,0x06,                           /* [ 8526] OBJ_tcg_ce */
-    0x67,0x81,0x05,0x08,                           /* [ 8530] OBJ_tcg_kp */
-    0x67,0x81,0x05,0x0B,                           /* [ 8534] OBJ_tcg_ca */
-    0x67,0x81,0x05,0x11,                           /* [ 8538] OBJ_tcg_address */
-    0x67,0x81,0x05,0x12,                           /* [ 8542] OBJ_tcg_registry */
-    0x67,0x81,0x05,0x13,                           /* [ 8546] OBJ_tcg_traits */
-    0x67,0x81,0x05,0x05,0x01,                      /* [ 8550] OBJ_tcg_common */
-    0x67,0x81,0x05,0x05,0x01,0x01,                 /* [ 8555] OBJ_tcg_at_platformManufacturerStr */
-    0x67,0x81,0x05,0x05,0x01,0x02,                 /* [ 8561] OBJ_tcg_at_platformManufacturerId */
-    0x67,0x81,0x05,0x05,0x01,0x03,                 /* [ 8567] OBJ_tcg_at_platformConfigUri */
-    0x67,0x81,0x05,0x05,0x01,0x04,                 /* [ 8573] OBJ_tcg_at_platformModel */
-    0x67,0x81,0x05,0x05,0x01,0x05,                 /* [ 8579] OBJ_tcg_at_platformVersion */
-    0x67,0x81,0x05,0x05,0x01,0x06,                 /* [ 8585] OBJ_tcg_at_platformSerial */
-    0x67,0x81,0x05,0x05,0x01,0x07,                 /* [ 8591] OBJ_tcg_at_platformConfiguration */
-    0x67,0x81,0x05,0x05,0x01,0x08,                 /* [ 8597] OBJ_tcg_at_platformIdentifier */
-    0x67,0x81,0x05,0x02,0x01,                      /* [ 8603] OBJ_tcg_at_tpmManufacturer */
-    0x67,0x81,0x05,0x02,0x02,                      /* [ 8608] OBJ_tcg_at_tpmModel */
-    0x67,0x81,0x05,0x02,0x03,                      /* [ 8613] OBJ_tcg_at_tpmVersion */
-    0x67,0x81,0x05,0x02,0x0A,                      /* [ 8618] OBJ_tcg_at_securityQualities */
-    0x67,0x81,0x05,0x02,0x0B,                      /* [ 8623] OBJ_tcg_at_tpmProtectionProfile */
-    0x67,0x81,0x05,0x02,0x0C,                      /* [ 8628] OBJ_tcg_at_tpmSecurityTarget */
-    0x67,0x81,0x05,0x02,0x0D,                      /* [ 8633] OBJ_tcg_at_tbbProtectionProfile */
-    0x67,0x81,0x05,0x02,0x0E,                      /* [ 8638] OBJ_tcg_at_tbbSecurityTarget */
-    0x67,0x81,0x05,0x02,0x0F,                      /* [ 8643] OBJ_tcg_at_tpmIdLabel */
-    0x67,0x81,0x05,0x02,0x10,                      /* [ 8648] OBJ_tcg_at_tpmSpecification */
-    0x67,0x81,0x05,0x02,0x11,                      /* [ 8653] OBJ_tcg_at_tcgPlatformSpecification */
-    0x67,0x81,0x05,0x02,0x12,                      /* [ 8658] OBJ_tcg_at_tpmSecurityAssertions */
-    0x67,0x81,0x05,0x02,0x13,                      /* [ 8663] OBJ_tcg_at_tbbSecurityAssertions */
-    0x67,0x81,0x05,0x02,0x17,                      /* [ 8668] OBJ_tcg_at_tcgCredentialSpecification */
-    0x67,0x81,0x05,0x02,0x19,                      /* [ 8673] OBJ_tcg_at_tcgCredentialType */
-    0x67,0x81,0x05,0x02,0x1A,                      /* [ 8678] OBJ_tcg_at_previousPlatformCertificates */
-    0x67,0x81,0x05,0x02,0x1B,                      /* [ 8683] OBJ_tcg_at_tbbSecurityAssertions_v3 */
-    0x67,0x81,0x05,0x02,0x1C,                      /* [ 8688] OBJ_tcg_at_cryptographicAnchors */
-    0x67,0x81,0x05,0x05,0x01,0x07,0x01,            /* [ 8693] OBJ_tcg_at_platformConfiguration_v1 */
-    0x67,0x81,0x05,0x05,0x01,0x07,0x02,            /* [ 8700] OBJ_tcg_at_platformConfiguration_v2 */
-    0x67,0x81,0x05,0x05,0x01,0x07,0x03,            /* [ 8707] OBJ_tcg_at_platformConfiguration_v3 */
-    0x67,0x81,0x05,0x05,0x01,0x07,0x04,            /* [ 8714] OBJ_tcg_at_platformConfigUri_v3 */
-    0x67,0x81,0x05,0x04,0x01,                      /* [ 8721] OBJ_tcg_algorithm_null */
-    0x67,0x81,0x05,0x08,0x01,                      /* [ 8726] OBJ_tcg_kp_EKCertificate */
-    0x67,0x81,0x05,0x08,0x02,                      /* [ 8731] OBJ_tcg_kp_PlatformAttributeCertificate */
-    0x67,0x81,0x05,0x08,0x03,                      /* [ 8736] OBJ_tcg_kp_AIKCertificate */
-    0x67,0x81,0x05,0x08,0x04,                      /* [ 8741] OBJ_tcg_kp_PlatformKeyCertificate */
-    0x67,0x81,0x05,0x08,0x05,                      /* [ 8746] OBJ_tcg_kp_DeltaPlatformAttributeCertificate */
-    0x67,0x81,0x05,0x08,0x06,                      /* [ 8751] OBJ_tcg_kp_DeltaPlatformKeyCertificate */
-    0x67,0x81,0x05,0x08,0x07,                      /* [ 8756] OBJ_tcg_kp_AdditionalPlatformAttributeCertificate */
-    0x67,0x81,0x05,0x08,0x08,                      /* [ 8761] OBJ_tcg_kp_AdditionalPlatformKeyCertificate */
-    0x67,0x81,0x05,0x06,0x02,                      /* [ 8766] OBJ_tcg_ce_relevantCredentials */
-    0x67,0x81,0x05,0x06,0x03,                      /* [ 8771] OBJ_tcg_ce_relevantManifests */
-    0x67,0x81,0x05,0x06,0x04,                      /* [ 8776] OBJ_tcg_ce_virtualPlatformAttestationService */
-    0x67,0x81,0x05,0x06,0x05,                      /* [ 8781] OBJ_tcg_ce_migrationControllerAttestationService */
-    0x67,0x81,0x05,0x06,0x06,                      /* [ 8786] OBJ_tcg_ce_migrationControllerRegistrationService */
-    0x67,0x81,0x05,0x06,0x07,                      /* [ 8791] OBJ_tcg_ce_virtualPlatformBackupService */
-    0x67,0x81,0x05,0x03,0x01,                      /* [ 8796] OBJ_tcg_prt_tpmIdProtocol */
-    0x67,0x81,0x05,0x11,0x01,                      /* [ 8801] OBJ_tcg_address_ethernetmac */
-    0x67,0x81,0x05,0x11,0x02,                      /* [ 8806] OBJ_tcg_address_wlanmac */
-    0x67,0x81,0x05,0x11,0x03,                      /* [ 8811] OBJ_tcg_address_bluetoothmac */
-    0x67,0x81,0x05,0x12,0x03,                      /* [ 8816] OBJ_tcg_registry_componentClass */
-    0x67,0x81,0x05,0x12,0x03,0x01,                 /* [ 8821] OBJ_tcg_registry_componentClass_tcg */
-    0x67,0x81,0x05,0x12,0x03,0x02,                 /* [ 8827] OBJ_tcg_registry_componentClass_ietf */
-    0x67,0x81,0x05,0x12,0x03,0x03,                 /* [ 8833] OBJ_tcg_registry_componentClass_dmtf */
-    0x67,0x81,0x05,0x12,0x03,0x04,                 /* [ 8839] OBJ_tcg_registry_componentClass_pcie */
-    0x67,0x81,0x05,0x12,0x03,0x05,                 /* [ 8845] OBJ_tcg_registry_componentClass_disk */
-    0x67,0x81,0x05,0x0B,0x04,                      /* [ 8851] OBJ_tcg_cap_verifiedPlatformCertificate */
-    0x67,0x81,0x05,0x13,0x01,                      /* [ 8856] OBJ_tcg_tr_ID */
-    0x67,0x81,0x05,0x13,0x02,                      /* [ 8861] OBJ_tcg_tr_category */
-    0x67,0x81,0x05,0x13,0x03,                      /* [ 8866] OBJ_tcg_tr_registry */
-    0x67,0x81,0x05,0x13,0x01,0x01,                 /* [ 8871] OBJ_tcg_tr_ID_Boolean */
-    0x67,0x81,0x05,0x13,0x01,0x02,                 /* [ 8877] OBJ_tcg_tr_ID_CertificateIdentifier */
-    0x67,0x81,0x05,0x13,0x01,0x03,                 /* [ 8883] OBJ_tcg_tr_ID_CommonCriteria */
-    0x67,0x81,0x05,0x13,0x01,0x04,                 /* [ 8889] OBJ_tcg_tr_ID_componentClass */
-    0x67,0x81,0x05,0x13,0x01,0x05,                 /* [ 8895] OBJ_tcg_tr_ID_componentIdentifierV11 */
-    0x67,0x81,0x05,0x13,0x01,0x06,                 /* [ 8901] OBJ_tcg_tr_ID_FIPSLevel */
-    0x67,0x81,0x05,0x13,0x01,0x07,                 /* [ 8907] OBJ_tcg_tr_ID_ISO9000Level */
-    0x67,0x81,0x05,0x13,0x01,0x08,                 /* [ 8913] OBJ_tcg_tr_ID_networkMAC */
-    0x67,0x81,0x05,0x13,0x01,0x09,                 /* [ 8919] OBJ_tcg_tr_ID_OID */
-    0x67,0x81,0x05,0x13,0x01,0x0A,                 /* [ 8925] OBJ_tcg_tr_ID_PEN */
-    0x67,0x81,0x05,0x13,0x01,0x0B,                 /* [ 8931] OBJ_tcg_tr_ID_platformFirmwareCapabilities */
-    0x67,0x81,0x05,0x13,0x01,0x0C,                 /* [ 8937] OBJ_tcg_tr_ID_platformFirmwareSignatureVerification */
-    0x67,0x81,0x05,0x13,0x01,0x0D,                 /* [ 8943] OBJ_tcg_tr_ID_platformFirmwareUpdateCompliance */
-    0x67,0x81,0x05,0x13,0x01,0x0E,                 /* [ 8949] OBJ_tcg_tr_ID_platformHardwareCapabilities */
-    0x67,0x81,0x05,0x13,0x01,0x0F,                 /* [ 8955] OBJ_tcg_tr_ID_RTM */
-    0x67,0x81,0x05,0x13,0x01,0x10,                 /* [ 8961] OBJ_tcg_tr_ID_status */
-    0x67,0x81,0x05,0x13,0x01,0x11,                 /* [ 8967] OBJ_tcg_tr_ID_URI */
-    0x67,0x81,0x05,0x13,0x01,0x12,                 /* [ 8973] OBJ_tcg_tr_ID_UTF8String */
-    0x67,0x81,0x05,0x13,0x01,0x13,                 /* [ 8979] OBJ_tcg_tr_ID_IA5String */
-    0x67,0x81,0x05,0x13,0x01,0x14,                 /* [ 8985] OBJ_tcg_tr_ID_PEMCertString */
-    0x67,0x81,0x05,0x13,0x01,0x15,                 /* [ 8991] OBJ_tcg_tr_ID_PublicKey */
-    0x67,0x81,0x05,0x13,0x02,0x01,                 /* [ 8997] OBJ_tcg_tr_cat_platformManufacturer */
-    0x67,0x81,0x05,0x13,0x02,0x02,                 /* [ 9003] OBJ_tcg_tr_cat_platformModel */
-    0x67,0x81,0x05,0x13,0x02,0x03,                 /* [ 9009] OBJ_tcg_tr_cat_platformVersion */
-    0x67,0x81,0x05,0x13,0x02,0x04,                 /* [ 9015] OBJ_tcg_tr_cat_platformSerial */
-    0x67,0x81,0x05,0x13,0x02,0x05,                 /* [ 9021] OBJ_tcg_tr_cat_platformManufacturerIdentifier */
-    0x67,0x81,0x05,0x13,0x02,0x06,                 /* [ 9027] OBJ_tcg_tr_cat_platformOwnership */
-    0x67,0x81,0x05,0x13,0x02,0x07,                 /* [ 9033] OBJ_tcg_tr_cat_componentClass */
-    0x67,0x81,0x05,0x13,0x02,0x08,                 /* [ 9039] OBJ_tcg_tr_cat_componentManufacturer */
-    0x67,0x81,0x05,0x13,0x02,0x09,                 /* [ 9045] OBJ_tcg_tr_cat_componentModel */
-    0x67,0x81,0x05,0x13,0x02,0x0A,                 /* [ 9051] OBJ_tcg_tr_cat_componentSerial */
-    0x67,0x81,0x05,0x13,0x02,0x0B,                 /* [ 9057] OBJ_tcg_tr_cat_componentStatus */
-    0x67,0x81,0x05,0x13,0x02,0x0C,                 /* [ 9063] OBJ_tcg_tr_cat_componentLocation */
-    0x67,0x81,0x05,0x13,0x02,0x0D,                 /* [ 9069] OBJ_tcg_tr_cat_componentRevision */
-    0x67,0x81,0x05,0x13,0x02,0x0E,                 /* [ 9075] OBJ_tcg_tr_cat_componentFieldReplaceable */
-    0x67,0x81,0x05,0x13,0x02,0x0F,                 /* [ 9081] OBJ_tcg_tr_cat_EKCertificate */
-    0x67,0x81,0x05,0x13,0x02,0x10,                 /* [ 9087] OBJ_tcg_tr_cat_IAKCertificate */
-    0x67,0x81,0x05,0x13,0x02,0x11,                 /* [ 9093] OBJ_tcg_tr_cat_IDevIDCertificate */
-    0x67,0x81,0x05,0x13,0x02,0x12,                 /* [ 9099] OBJ_tcg_tr_cat_DICECertificate */
-    0x67,0x81,0x05,0x13,0x02,0x13,                 /* [ 9105] OBJ_tcg_tr_cat_SPDMCertificate */
-    0x67,0x81,0x05,0x13,0x02,0x14,                 /* [ 9111] OBJ_tcg_tr_cat_PEMCertificate */
-    0x67,0x81,0x05,0x13,0x02,0x15,                 /* [ 9117] OBJ_tcg_tr_cat_PlatformCertificate */
-    0x67,0x81,0x05,0x13,0x02,0x16,                 /* [ 9123] OBJ_tcg_tr_cat_DeltaPlatformCertificate */
-    0x67,0x81,0x05,0x13,0x02,0x17,                 /* [ 9129] OBJ_tcg_tr_cat_RebasePlatformCertificate */
-    0x67,0x81,0x05,0x13,0x02,0x18,                 /* [ 9135] OBJ_tcg_tr_cat_genericCertificate */
-    0x67,0x81,0x05,0x13,0x02,0x19,                 /* [ 9141] OBJ_tcg_tr_cat_CommonCriteria */
-    0x67,0x81,0x05,0x13,0x02,0x1A,                 /* [ 9147] OBJ_tcg_tr_cat_componentIdentifierV11 */
-    0x67,0x81,0x05,0x13,0x02,0x1B,                 /* [ 9153] OBJ_tcg_tr_cat_FIPSLevel */
-    0x67,0x81,0x05,0x13,0x02,0x1C,                 /* [ 9159] OBJ_tcg_tr_cat_ISO9000 */
-    0x67,0x81,0x05,0x13,0x02,0x1D,                 /* [ 9165] OBJ_tcg_tr_cat_networkMAC */
-    0x67,0x81,0x05,0x13,0x02,0x1E,                 /* [ 9171] OBJ_tcg_tr_cat_attestationProtocol */
-    0x67,0x81,0x05,0x13,0x02,0x1F,                 /* [ 9177] OBJ_tcg_tr_cat_PEN */
-    0x67,0x81,0x05,0x13,0x02,0x20,                 /* [ 9183] OBJ_tcg_tr_cat_platformFirmwareCapabilities */
-    0x67,0x81,0x05,0x13,0x02,0x21,                 /* [ 9189] OBJ_tcg_tr_cat_platformHardwareCapabilities */
-    0x67,0x81,0x05,0x13,0x02,0x22,                 /* [ 9195] OBJ_tcg_tr_cat_platformFirmwareSignatureVerification */
-    0x67,0x81,0x05,0x13,0x02,0x23,                 /* [ 9201] OBJ_tcg_tr_cat_platformFirmwareUpdateCompliance */
-    0x67,0x81,0x05,0x13,0x02,0x24,                 /* [ 9207] OBJ_tcg_tr_cat_RTM */
-    0x67,0x81,0x05,0x13,0x02,0x25,                 /* [ 9213] OBJ_tcg_tr_cat_PublicKey */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x04,0x01,  /* [ 9219] OBJ_ML_KEM_512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x04,0x02,  /* [ 9228] OBJ_ML_KEM_768 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x04,0x03,  /* [ 9237] OBJ_ML_KEM_1024 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x11,  /* [ 9246] OBJ_ML_DSA_44 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x12,  /* [ 9255] OBJ_ML_DSA_65 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x13,  /* [ 9264] OBJ_ML_DSA_87 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x14,  /* [ 9273] OBJ_SLH_DSA_SHA2_128s */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x15,  /* [ 9282] OBJ_SLH_DSA_SHA2_128f */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x16,  /* [ 9291] OBJ_SLH_DSA_SHA2_192s */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x17,  /* [ 9300] OBJ_SLH_DSA_SHA2_192f */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x18,  /* [ 9309] OBJ_SLH_DSA_SHA2_256s */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x19,  /* [ 9318] OBJ_SLH_DSA_SHA2_256f */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x1A,  /* [ 9327] OBJ_SLH_DSA_SHAKE_128s */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x1B,  /* [ 9336] OBJ_SLH_DSA_SHAKE_128f */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x1C,  /* [ 9345] OBJ_SLH_DSA_SHAKE_192s */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x1D,  /* [ 9354] OBJ_SLH_DSA_SHAKE_192f */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x1E,  /* [ 9363] OBJ_SLH_DSA_SHAKE_256s */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x1F,  /* [ 9372] OBJ_SLH_DSA_SHAKE_256f */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x20,  /* [ 9381] OBJ_HASH_ML_DSA_44_WITH_SHA512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x21,  /* [ 9390] OBJ_HASH_ML_DSA_65_WITH_SHA512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x22,  /* [ 9399] OBJ_HASH_ML_DSA_87_WITH_SHA512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x23,  /* [ 9408] OBJ_SLH_DSA_SHA2_128s_WITH_SHA256 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x24,  /* [ 9417] OBJ_SLH_DSA_SHA2_128f_WITH_SHA256 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x25,  /* [ 9426] OBJ_SLH_DSA_SHA2_192s_WITH_SHA512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x26,  /* [ 9435] OBJ_SLH_DSA_SHA2_192f_WITH_SHA512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x27,  /* [ 9444] OBJ_SLH_DSA_SHA2_256s_WITH_SHA512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x28,  /* [ 9453] OBJ_SLH_DSA_SHA2_256f_WITH_SHA512 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x29,  /* [ 9462] OBJ_SLH_DSA_SHAKE_128s_WITH_SHAKE128 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x2A,  /* [ 9471] OBJ_SLH_DSA_SHAKE_128f_WITH_SHAKE128 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x2B,  /* [ 9480] OBJ_SLH_DSA_SHAKE_192s_WITH_SHAKE256 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x2C,  /* [ 9489] OBJ_SLH_DSA_SHAKE_192f_WITH_SHAKE256 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x2D,  /* [ 9498] OBJ_SLH_DSA_SHAKE_256s_WITH_SHAKE256 */
-    0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x03,0x2E,  /* [ 9507] OBJ_SLH_DSA_SHAKE_256f_WITH_SHAKE256 */
-};
-
-#define NUM_NID 1487
-static const ASN1_OBJECT nid_objs[NUM_NID] = {
-    {"UNDEF", "undefined", NID_undef},
-    {"rsadsi", "RSA Data Security, Inc.", NID_rsadsi, 6, &so[0]},
-    {"pkcs", "RSA Data Security, Inc. PKCS", NID_pkcs, 7, &so[6]},
-    {"MD2", "md2", NID_md2, 8, &so[13]},
-    {"MD5", "md5", NID_md5, 8, &so[21]},
-    {"RC4", "rc4", NID_rc4, 8, &so[29]},
-    {"rsaEncryption", "rsaEncryption", NID_rsaEncryption, 9, &so[37]},
-    {"RSA-MD2", "md2WithRSAEncryption", NID_md2WithRSAEncryption, 9, &so[46]},
-    {"RSA-MD5", "md5WithRSAEncryption", NID_md5WithRSAEncryption, 9, &so[55]},
-    {"PBE-MD2-DES", "pbeWithMD2AndDES-CBC", NID_pbeWithMD2AndDES_CBC, 9, &so[64]},
-    {"PBE-MD5-DES", "pbeWithMD5AndDES-CBC", NID_pbeWithMD5AndDES_CBC, 9, &so[73]},
-    {"X500", "directory services (X.500)", NID_X500, 1, &so[82]},
-    {"X509", "X509", NID_X509, 2, &so[83]},
-    {"CN", "commonName", NID_commonName, 3, &so[85]},
-    {"C", "countryName", NID_countryName, 3, &so[88]},
-    {"L", "localityName", NID_localityName, 3, &so[91]},
-    {"ST", "stateOrProvinceName", NID_stateOrProvinceName, 3, &so[94]},
-    {"O", "organizationName", NID_organizationName, 3, &so[97]},
-    {"OU", "organizationalUnitName", NID_organizationalUnitName, 3, &so[100]},
-    {"RSA", "rsa", NID_rsa, 4, &so[103]},
-    {"pkcs7", "pkcs7", NID_pkcs7, 8, &so[107]},
-    {"pkcs7-data", "pkcs7-data", NID_pkcs7_data, 9, &so[115]},
-    {"pkcs7-signedData", "pkcs7-signedData", NID_pkcs7_signed, 9, &so[124]},
-    {"pkcs7-envelopedData", "pkcs7-envelopedData", NID_pkcs7_enveloped, 9, &so[133]},
-    {"pkcs7-signedAndEnvelopedData", "pkcs7-signedAndEnvelopedData", NID_pkcs7_signedAndEnveloped, 9, &so[142]},
-    {"pkcs7-digestData", "pkcs7-digestData", NID_pkcs7_digest, 9, &so[151]},
-    {"pkcs7-encryptedData", "pkcs7-encryptedData", NID_pkcs7_encrypted, 9, &so[160]},
-    {"pkcs3", "pkcs3", NID_pkcs3, 8, &so[169]},
-    {"dhKeyAgreement", "dhKeyAgreement", NID_dhKeyAgreement, 9, &so[177]},
-    {"DES-ECB", "des-ecb", NID_des_ecb, 5, &so[186]},
-    {"DES-CFB", "des-cfb", NID_des_cfb64, 5, &so[191]},
-    {"DES-CBC", "des-cbc", NID_des_cbc, 5, &so[196]},
-    {"DES-EDE", "des-ede", NID_des_ede_ecb, 5, &so[201]},
-    {"DES-EDE3", "des-ede3", NID_des_ede3_ecb},
-    {"IDEA-CBC", "idea-cbc", NID_idea_cbc, 11, &so[206]},
-    {"IDEA-CFB", "idea-cfb", NID_idea_cfb64},
-    {"IDEA-ECB", "idea-ecb", NID_idea_ecb},
-    {"RC2-CBC", "rc2-cbc", NID_rc2_cbc, 8, &so[217]},
-    {"RC2-ECB", "rc2-ecb", NID_rc2_ecb},
-    {"RC2-CFB", "rc2-cfb", NID_rc2_cfb64},
-    {"RC2-OFB", "rc2-ofb", NID_rc2_ofb64},
-    {"SHA", "sha", NID_sha, 5, &so[225]},
-    {"RSA-SHA", "shaWithRSAEncryption", NID_shaWithRSAEncryption, 5, &so[230]},
-    {"DES-EDE-CBC", "des-ede-cbc", NID_des_ede_cbc},
-    {"DES-EDE3-CBC", "des-ede3-cbc", NID_des_ede3_cbc, 8, &so[235]},
-    {"DES-OFB", "des-ofb", NID_des_ofb64, 5, &so[243]},
-    {"IDEA-OFB", "idea-ofb", NID_idea_ofb64},
-    {"pkcs9", "pkcs9", NID_pkcs9, 8, &so[248]},
-    {"emailAddress", "emailAddress", NID_pkcs9_emailAddress, 9, &so[256]},
-    {"unstructuredName", "unstructuredName", NID_pkcs9_unstructuredName, 9, &so[265]},
-    {"contentType", "contentType", NID_pkcs9_contentType, 9, &so[274]},
-    {"messageDigest", "messageDigest", NID_pkcs9_messageDigest, 9, &so[283]},
-    {"signingTime", "signingTime", NID_pkcs9_signingTime, 9, &so[292]},
-    {"countersignature", "countersignature", NID_pkcs9_countersignature, 9, &so[301]},
-    {"challengePassword", "challengePassword", NID_pkcs9_challengePassword, 9, &so[310]},
-    {"unstructuredAddress", "unstructuredAddress", NID_pkcs9_unstructuredAddress, 9, &so[319]},
-    {"extendedCertificateAttributes", "extendedCertificateAttributes", NID_pkcs9_extCertAttributes, 9, &so[328]},
-    {"Netscape", "Netscape Communications Corp.", NID_netscape, 7, &so[337]},
-    {"nsCertExt", "Netscape Certificate Extension", NID_netscape_cert_extension, 8, &so[344]},
-    {"nsDataType", "Netscape Data Type", NID_netscape_data_type, 8, &so[352]},
-    {"DES-EDE-CFB", "des-ede-cfb", NID_des_ede_cfb64},
-    {"DES-EDE3-CFB", "des-ede3-cfb", NID_des_ede3_cfb64},
-    {"DES-EDE-OFB", "des-ede-ofb", NID_des_ede_ofb64},
-    {"DES-EDE3-OFB", "des-ede3-ofb", NID_des_ede3_ofb64},
-    {"SHA1", "sha1", NID_sha1, 5, &so[360]},
-    {"RSA-SHA1", "sha1WithRSAEncryption", NID_sha1WithRSAEncryption, 9, &so[365]},
-    {"DSA-SHA", "dsaWithSHA", NID_dsaWithSHA, 5, &so[374]},
-    {"DSA-old", "dsaEncryption-old", NID_dsa_2, 5, &so[379]},
-    {"PBE-SHA1-RC2-64", "pbeWithSHA1AndRC2-CBC", NID_pbeWithSHA1AndRC2_CBC, 9, &so[384]},
-    {"PBKDF2", "PBKDF2", NID_id_pbkdf2, 9, &so[393]},
-    {"DSA-SHA1-old", "dsaWithSHA1-old", NID_dsaWithSHA1_2, 5, &so[402]},
-    {"nsCertType", "Netscape Cert Type", NID_netscape_cert_type, 9, &so[407]},
-    {"nsBaseUrl", "Netscape Base Url", NID_netscape_base_url, 9, &so[416]},
-    {"nsRevocationUrl", "Netscape Revocation Url", NID_netscape_revocation_url, 9, &so[425]},
-    {"nsCaRevocationUrl", "Netscape CA Revocation Url", NID_netscape_ca_revocation_url, 9, &so[434]},
-    {"nsRenewalUrl", "Netscape Renewal Url", NID_netscape_renewal_url, 9, &so[443]},
-    {"nsCaPolicyUrl", "Netscape CA Policy Url", NID_netscape_ca_policy_url, 9, &so[452]},
-    {"nsSslServerName", "Netscape SSL Server Name", NID_netscape_ssl_server_name, 9, &so[461]},
-    {"nsComment", "Netscape Comment", NID_netscape_comment, 9, &so[470]},
-    {"nsCertSequence", "Netscape Certificate Sequence", NID_netscape_cert_sequence, 9, &so[479]},
-    {"DESX-CBC", "desx-cbc", NID_desx_cbc},
-    {"id-ce", "id-ce", NID_id_ce, 2, &so[488]},
-    {"subjectKeyIdentifier", "X509v3 Subject Key Identifier", NID_subject_key_identifier, 3, &so[490]},
-    {"keyUsage", "X509v3 Key Usage", NID_key_usage, 3, &so[493]},
-    {"privateKeyUsagePeriod", "X509v3 Private Key Usage Period", NID_private_key_usage_period, 3, &so[496]},
-    {"subjectAltName", "X509v3 Subject Alternative Name", NID_subject_alt_name, 3, &so[499]},
-    {"issuerAltName", "X509v3 Issuer Alternative Name", NID_issuer_alt_name, 3, &so[502]},
-    {"basicConstraints", "X509v3 Basic Constraints", NID_basic_constraints, 3, &so[505]},
-    {"crlNumber", "X509v3 CRL Number", NID_crl_number, 3, &so[508]},
-    {"certificatePolicies", "X509v3 Certificate Policies", NID_certificate_policies, 3, &so[511]},
-    {"authorityKeyIdentifier", "X509v3 Authority Key Identifier", NID_authority_key_identifier, 3, &so[514]},
-    {"BF-CBC", "bf-cbc", NID_bf_cbc, 9, &so[517]},
-    {"BF-ECB", "bf-ecb", NID_bf_ecb},
-    {"BF-CFB", "bf-cfb", NID_bf_cfb64},
-    {"BF-OFB", "bf-ofb", NID_bf_ofb64},
-    {"MDC2", "mdc2", NID_mdc2, 4, &so[526]},
-    {"RSA-MDC2", "mdc2WithRSA", NID_mdc2WithRSA, 4, &so[530]},
-    {"RC4-40", "rc4-40", NID_rc4_40},
-    {"RC2-40-CBC", "rc2-40-cbc", NID_rc2_40_cbc},
-    {"GN", "givenName", NID_givenName, 3, &so[534]},
-    {"SN", "surname", NID_surname, 3, &so[537]},
-    {"initials", "initials", NID_initials, 3, &so[540]},
-    {"uid", "uniqueIdentifier", NID_uniqueIdentifier, 10, &so[543]},
-    {"crlDistributionPoints", "X509v3 CRL Distribution Points", NID_crl_distribution_points, 3, &so[553]},
-    {"RSA-NP-MD5", "md5WithRSA", NID_md5WithRSA, 5, &so[556]},
-    {"serialNumber", "serialNumber", NID_serialNumber, 3, &so[561]},
-    {"title", "title", NID_title, 3, &so[564]},
-    {"description", "description", NID_description, 3, &so[567]},
-    {"CAST5-CBC", "cast5-cbc", NID_cast5_cbc, 9, &so[570]},
-    {"CAST5-ECB", "cast5-ecb", NID_cast5_ecb},
-    {"CAST5-CFB", "cast5-cfb", NID_cast5_cfb64},
-    {"CAST5-OFB", "cast5-ofb", NID_cast5_ofb64},
-    {"pbeWithMD5AndCast5CBC", "pbeWithMD5AndCast5CBC", NID_pbeWithMD5AndCast5_CBC, 9, &so[579]},
-    {"DSA-SHA1", "dsaWithSHA1", NID_dsaWithSHA1, 7, &so[588]},
-    {"MD5-SHA1", "md5-sha1", NID_md5_sha1},
-    {"RSA-SHA1-2", "sha1WithRSA", NID_sha1WithRSA, 5, &so[595]},
-    {"DSA", "dsaEncryption", NID_dsa, 7, &so[600]},
-    {"RIPEMD160", "ripemd160", NID_ripemd160, 5, &so[607]},
-    { NULL, NULL, NID_undef },
-    {"RSA-RIPEMD160", "ripemd160WithRSA", NID_ripemd160WithRSA, 6, &so[612]},
-    {"RC5-CBC", "rc5-cbc", NID_rc5_cbc, 8, &so[618]},
-    {"RC5-ECB", "rc5-ecb", NID_rc5_ecb},
-    {"RC5-CFB", "rc5-cfb", NID_rc5_cfb64},
-    {"RC5-OFB", "rc5-ofb", NID_rc5_ofb64},
-    { NULL, NULL, NID_undef },
-    {"ZLIB", "zlib compression", NID_zlib_compression, 11, &so[626]},
-    {"extendedKeyUsage", "X509v3 Extended Key Usage", NID_ext_key_usage, 3, &so[637]},
-    {"PKIX", "PKIX", NID_id_pkix, 6, &so[640]},
-    {"id-kp", "id-kp", NID_id_kp, 7, &so[646]},
-    {"serverAuth", "TLS Web Server Authentication", NID_server_auth, 8, &so[653]},
-    {"clientAuth", "TLS Web Client Authentication", NID_client_auth, 8, &so[661]},
-    {"codeSigning", "Code Signing", NID_code_sign, 8, &so[669]},
-    {"emailProtection", "E-mail Protection", NID_email_protect, 8, &so[677]},
-    {"timeStamping", "Time Stamping", NID_time_stamp, 8, &so[685]},
-    {"msCodeInd", "Microsoft Individual Code Signing", NID_ms_code_ind, 10, &so[693]},
-    {"msCodeCom", "Microsoft Commercial Code Signing", NID_ms_code_com, 10, &so[703]},
-    {"msCTLSign", "Microsoft Trust List Signing", NID_ms_ctl_sign, 10, &so[713]},
-    {"msSGC", "Microsoft Server Gated Crypto", NID_ms_sgc, 10, &so[723]},
-    {"msEFS", "Microsoft Encrypted File System", NID_ms_efs, 10, &so[733]},
-    {"nsSGC", "Netscape Server Gated Crypto", NID_ns_sgc, 9, &so[743]},
-    {"deltaCRL", "X509v3 Delta CRL Indicator", NID_delta_crl, 3, &so[752]},
-    {"CRLReason", "X509v3 CRL Reason Code", NID_crl_reason, 3, &so[755]},
-    {"invalidityDate", "Invalidity Date", NID_invalidity_date, 3, &so[758]},
-    {"SXNetID", "Strong Extranet ID", NID_sxnet, 5, &so[761]},
-    {"PBE-SHA1-RC4-128", "pbeWithSHA1And128BitRC4", NID_pbe_WithSHA1And128BitRC4, 10, &so[766]},
-    {"PBE-SHA1-RC4-40", "pbeWithSHA1And40BitRC4", NID_pbe_WithSHA1And40BitRC4, 10, &so[776]},
-    {"PBE-SHA1-3DES", "pbeWithSHA1And3-KeyTripleDES-CBC", NID_pbe_WithSHA1And3_Key_TripleDES_CBC, 10, &so[786]},
-    {"PBE-SHA1-2DES", "pbeWithSHA1And2-KeyTripleDES-CBC", NID_pbe_WithSHA1And2_Key_TripleDES_CBC, 10, &so[796]},
-    {"PBE-SHA1-RC2-128", "pbeWithSHA1And128BitRC2-CBC", NID_pbe_WithSHA1And128BitRC2_CBC, 10, &so[806]},
-    {"PBE-SHA1-RC2-40", "pbeWithSHA1And40BitRC2-CBC", NID_pbe_WithSHA1And40BitRC2_CBC, 10, &so[816]},
-    {"keyBag", "keyBag", NID_keyBag, 11, &so[826]},
-    {"pkcs8ShroudedKeyBag", "pkcs8ShroudedKeyBag", NID_pkcs8ShroudedKeyBag, 11, &so[837]},
-    {"certBag", "certBag", NID_certBag, 11, &so[848]},
-    {"crlBag", "crlBag", NID_crlBag, 11, &so[859]},
-    {"secretBag", "secretBag", NID_secretBag, 11, &so[870]},
-    {"safeContentsBag", "safeContentsBag", NID_safeContentsBag, 11, &so[881]},
-    {"friendlyName", "friendlyName", NID_friendlyName, 9, &so[892]},
-    {"localKeyID", "localKeyID", NID_localKeyID, 9, &so[901]},
-    {"x509Certificate", "x509Certificate", NID_x509Certificate, 10, &so[910]},
-    {"sdsiCertificate", "sdsiCertificate", NID_sdsiCertificate, 10, &so[920]},
-    {"x509Crl", "x509Crl", NID_x509Crl, 10, &so[930]},
-    {"PBES2", "PBES2", NID_pbes2, 9, &so[940]},
-    {"PBMAC1", "PBMAC1", NID_pbmac1, 9, &so[949]},
-    {"hmacWithSHA1", "hmacWithSHA1", NID_hmacWithSHA1, 8, &so[958]},
-    {"id-qt-cps", "Policy Qualifier CPS", NID_id_qt_cps, 8, &so[966]},
-    {"id-qt-unotice", "Policy Qualifier User Notice", NID_id_qt_unotice, 8, &so[974]},
-    {"RC2-64-CBC", "rc2-64-cbc", NID_rc2_64_cbc},
-    {"SMIME-CAPS", "S/MIME Capabilities", NID_SMIMECapabilities, 9, &so[982]},
-    {"PBE-MD2-RC2-64", "pbeWithMD2AndRC2-CBC", NID_pbeWithMD2AndRC2_CBC, 9, &so[991]},
-    {"PBE-MD5-RC2-64", "pbeWithMD5AndRC2-CBC", NID_pbeWithMD5AndRC2_CBC, 9, &so[1000]},
-    {"PBE-SHA1-DES", "pbeWithSHA1AndDES-CBC", NID_pbeWithSHA1AndDES_CBC, 9, &so[1009]},
-    {"msExtReq", "Microsoft Extension Request", NID_ms_ext_req, 10, &so[1018]},
-    {"extReq", "Extension Request", NID_ext_req, 9, &so[1028]},
-    {"name", "name", NID_name, 3, &so[1037]},
-    {"dnQualifier", "dnQualifier", NID_dnQualifier, 3, &so[1040]},
-    {"id-pe", "id-pe", NID_id_pe, 7, &so[1043]},
-    {"id-ad", "id-ad", NID_id_ad, 7, &so[1050]},
-    {"authorityInfoAccess", "Authority Information Access", NID_info_access, 8, &so[1057]},
-    {"OCSP", "OCSP", NID_ad_OCSP, 8, &so[1065]},
-    {"caIssuers", "CA Issuers", NID_ad_ca_issuers, 8, &so[1073]},
-    {"OCSPSigning", "OCSP Signing", NID_OCSP_sign, 8, &so[1081]},
-    {"ISO", "iso", NID_iso},
-    {"member-body", "ISO Member Body", NID_member_body, 1, &so[1089]},
-    {"ISO-US", "ISO US Member Body", NID_ISO_US, 3, &so[1090]},
-    {"X9-57", "X9.57", NID_X9_57, 5, &so[1093]},
-    {"X9cm", "X9.57 CM ?", NID_X9cm, 6, &so[1098]},
-    {"pkcs1", "pkcs1", NID_pkcs1, 8, &so[1104]},
-    {"pkcs5", "pkcs5", NID_pkcs5, 8, &so[1112]},
-    {"SMIME", "S/MIME", NID_SMIME, 9, &so[1120]},
-    {"id-smime-mod", "id-smime-mod", NID_id_smime_mod, 10, &so[1129]},
-    {"id-smime-ct", "id-smime-ct", NID_id_smime_ct, 10, &so[1139]},
-    {"id-smime-aa", "id-smime-aa", NID_id_smime_aa, 10, &so[1149]},
-    {"id-smime-alg", "id-smime-alg", NID_id_smime_alg, 10, &so[1159]},
-    {"id-smime-cd", "id-smime-cd", NID_id_smime_cd, 10, &so[1169]},
-    {"id-smime-spq", "id-smime-spq", NID_id_smime_spq, 10, &so[1179]},
-    {"id-smime-cti", "id-smime-cti", NID_id_smime_cti, 10, &so[1189]},
-    {"id-smime-mod-cms", "id-smime-mod-cms", NID_id_smime_mod_cms, 11, &so[1199]},
-    {"id-smime-mod-ess", "id-smime-mod-ess", NID_id_smime_mod_ess, 11, &so[1210]},
-    {"id-smime-mod-oid", "id-smime-mod-oid", NID_id_smime_mod_oid, 11, &so[1221]},
-    {"id-smime-mod-msg-v3", "id-smime-mod-msg-v3", NID_id_smime_mod_msg_v3, 11, &so[1232]},
-    {"id-smime-mod-ets-eSignature-88", "id-smime-mod-ets-eSignature-88", NID_id_smime_mod_ets_eSignature_88, 11, &so[1243]},
-    {"id-smime-mod-ets-eSignature-97", "id-smime-mod-ets-eSignature-97", NID_id_smime_mod_ets_eSignature_97, 11, &so[1254]},
-    {"id-smime-mod-ets-eSigPolicy-88", "id-smime-mod-ets-eSigPolicy-88", NID_id_smime_mod_ets_eSigPolicy_88, 11, &so[1265]},
-    {"id-smime-mod-ets-eSigPolicy-97", "id-smime-mod-ets-eSigPolicy-97", NID_id_smime_mod_ets_eSigPolicy_97, 11, &so[1276]},
-    {"id-smime-ct-receipt", "id-smime-ct-receipt", NID_id_smime_ct_receipt, 11, &so[1287]},
-    {"id-smime-ct-authData", "id-smime-ct-authData", NID_id_smime_ct_authData, 11, &so[1298]},
-    {"id-smime-ct-publishCert", "id-smime-ct-publishCert", NID_id_smime_ct_publishCert, 11, &so[1309]},
-    {"id-smime-ct-TSTInfo", "id-smime-ct-TSTInfo", NID_id_smime_ct_TSTInfo, 11, &so[1320]},
-    {"id-smime-ct-TDTInfo", "id-smime-ct-TDTInfo", NID_id_smime_ct_TDTInfo, 11, &so[1331]},
-    {"id-smime-ct-contentInfo", "id-smime-ct-contentInfo", NID_id_smime_ct_contentInfo, 11, &so[1342]},
-    {"id-smime-ct-DVCSRequestData", "id-smime-ct-DVCSRequestData", NID_id_smime_ct_DVCSRequestData, 11, &so[1353]},
-    {"id-smime-ct-DVCSResponseData", "id-smime-ct-DVCSResponseData", NID_id_smime_ct_DVCSResponseData, 11, &so[1364]},
-    {"id-smime-aa-receiptRequest", "id-smime-aa-receiptRequest", NID_id_smime_aa_receiptRequest, 11, &so[1375]},
-    {"id-smime-aa-securityLabel", "id-smime-aa-securityLabel", NID_id_smime_aa_securityLabel, 11, &so[1386]},
-    {"id-smime-aa-mlExpandHistory", "id-smime-aa-mlExpandHistory", NID_id_smime_aa_mlExpandHistory, 11, &so[1397]},
-    {"id-smime-aa-contentHint", "id-smime-aa-contentHint", NID_id_smime_aa_contentHint, 11, &so[1408]},
-    {"id-smime-aa-msgSigDigest", "id-smime-aa-msgSigDigest", NID_id_smime_aa_msgSigDigest, 11, &so[1419]},
-    {"id-smime-aa-encapContentType", "id-smime-aa-encapContentType", NID_id_smime_aa_encapContentType, 11, &so[1430]},
-    {"id-smime-aa-contentIdentifier", "id-smime-aa-contentIdentifier", NID_id_smime_aa_contentIdentifier, 11, &so[1441]},
-    {"id-smime-aa-macValue", "id-smime-aa-macValue", NID_id_smime_aa_macValue, 11, &so[1452]},
-    {"id-smime-aa-equivalentLabels", "id-smime-aa-equivalentLabels", NID_id_smime_aa_equivalentLabels, 11, &so[1463]},
-    {"id-smime-aa-contentReference", "id-smime-aa-contentReference", NID_id_smime_aa_contentReference, 11, &so[1474]},
-    {"id-smime-aa-encrypKeyPref", "id-smime-aa-encrypKeyPref", NID_id_smime_aa_encrypKeyPref, 11, &so[1485]},
-    {"id-smime-aa-signingCertificate", "id-smime-aa-signingCertificate", NID_id_smime_aa_signingCertificate, 11, &so[1496]},
-    {"id-smime-aa-smimeEncryptCerts", "id-smime-aa-smimeEncryptCerts", NID_id_smime_aa_smimeEncryptCerts, 11, &so[1507]},
-    {"id-smime-aa-timeStampToken", "id-smime-aa-timeStampToken", NID_id_smime_aa_timeStampToken, 11, &so[1518]},
-    {"id-smime-aa-ets-sigPolicyId", "id-smime-aa-ets-sigPolicyId", NID_id_smime_aa_ets_sigPolicyId, 11, &so[1529]},
-    {"id-smime-aa-ets-commitmentType", "id-smime-aa-ets-commitmentType", NID_id_smime_aa_ets_commitmentType, 11, &so[1540]},
-    {"id-smime-aa-ets-signerLocation", "id-smime-aa-ets-signerLocation", NID_id_smime_aa_ets_signerLocation, 11, &so[1551]},
-    {"id-smime-aa-ets-signerAttr", "id-smime-aa-ets-signerAttr", NID_id_smime_aa_ets_signerAttr, 11, &so[1562]},
-    {"id-smime-aa-ets-otherSigCert", "id-smime-aa-ets-otherSigCert", NID_id_smime_aa_ets_otherSigCert, 11, &so[1573]},
-    {"id-smime-aa-ets-contentTimestamp", "id-smime-aa-ets-contentTimestamp", NID_id_smime_aa_ets_contentTimestamp, 11, &so[1584]},
-    {"id-smime-aa-ets-CertificateRefs", "id-smime-aa-ets-CertificateRefs", NID_id_smime_aa_ets_CertificateRefs, 11, &so[1595]},
-    {"id-smime-aa-ets-RevocationRefs", "id-smime-aa-ets-RevocationRefs", NID_id_smime_aa_ets_RevocationRefs, 11, &so[1606]},
-    {"id-smime-aa-ets-certValues", "id-smime-aa-ets-certValues", NID_id_smime_aa_ets_certValues, 11, &so[1617]},
-    {"id-smime-aa-ets-revocationValues", "id-smime-aa-ets-revocationValues", NID_id_smime_aa_ets_revocationValues, 11, &so[1628]},
-    {"id-smime-aa-ets-escTimeStamp", "id-smime-aa-ets-escTimeStamp", NID_id_smime_aa_ets_escTimeStamp, 11, &so[1639]},
-    {"id-smime-aa-ets-certCRLTimestamp", "id-smime-aa-ets-certCRLTimestamp", NID_id_smime_aa_ets_certCRLTimestamp, 11, &so[1650]},
-    {"id-smime-aa-ets-archiveTimeStamp", "id-smime-aa-ets-archiveTimeStamp", NID_id_smime_aa_ets_archiveTimeStamp, 11, &so[1661]},
-    {"id-smime-aa-signatureType", "id-smime-aa-signatureType", NID_id_smime_aa_signatureType, 11, &so[1672]},
-    {"id-smime-aa-dvcs-dvc", "id-smime-aa-dvcs-dvc", NID_id_smime_aa_dvcs_dvc, 11, &so[1683]},
-    {"id-smime-alg-ESDHwith3DES", "id-smime-alg-ESDHwith3DES", NID_id_smime_alg_ESDHwith3DES, 11, &so[1694]},
-    {"id-smime-alg-ESDHwithRC2", "id-smime-alg-ESDHwithRC2", NID_id_smime_alg_ESDHwithRC2, 11, &so[1705]},
-    {"id-smime-alg-3DESwrap", "id-smime-alg-3DESwrap", NID_id_smime_alg_3DESwrap, 11, &so[1716]},
-    {"id-smime-alg-RC2wrap", "id-smime-alg-RC2wrap", NID_id_smime_alg_RC2wrap, 11, &so[1727]},
-    {"id-smime-alg-ESDH", "id-smime-alg-ESDH", NID_id_smime_alg_ESDH, 11, &so[1738]},
-    {"id-smime-alg-CMS3DESwrap", "id-smime-alg-CMS3DESwrap", NID_id_smime_alg_CMS3DESwrap, 11, &so[1749]},
-    {"id-smime-alg-CMSRC2wrap", "id-smime-alg-CMSRC2wrap", NID_id_smime_alg_CMSRC2wrap, 11, &so[1760]},
-    {"id-smime-cd-ldap", "id-smime-cd-ldap", NID_id_smime_cd_ldap, 11, &so[1771]},
-    {"id-smime-spq-ets-sqt-uri", "id-smime-spq-ets-sqt-uri", NID_id_smime_spq_ets_sqt_uri, 11, &so[1782]},
-    {"id-smime-spq-ets-sqt-unotice", "id-smime-spq-ets-sqt-unotice", NID_id_smime_spq_ets_sqt_unotice, 11, &so[1793]},
-    {"id-smime-cti-ets-proofOfOrigin", "id-smime-cti-ets-proofOfOrigin", NID_id_smime_cti_ets_proofOfOrigin, 11, &so[1804]},
-    {"id-smime-cti-ets-proofOfReceipt", "id-smime-cti-ets-proofOfReceipt", NID_id_smime_cti_ets_proofOfReceipt, 11, &so[1815]},
-    {"id-smime-cti-ets-proofOfDelivery", "id-smime-cti-ets-proofOfDelivery", NID_id_smime_cti_ets_proofOfDelivery, 11, &so[1826]},
-    {"id-smime-cti-ets-proofOfSender", "id-smime-cti-ets-proofOfSender", NID_id_smime_cti_ets_proofOfSender, 11, &so[1837]},
-    {"id-smime-cti-ets-proofOfApproval", "id-smime-cti-ets-proofOfApproval", NID_id_smime_cti_ets_proofOfApproval, 11, &so[1848]},
-    {"id-smime-cti-ets-proofOfCreation", "id-smime-cti-ets-proofOfCreation", NID_id_smime_cti_ets_proofOfCreation, 11, &so[1859]},
-    {"MD4", "md4", NID_md4, 8, &so[1870]},
-    {"id-pkix-mod", "id-pkix-mod", NID_id_pkix_mod, 7, &so[1878]},
-    {"id-qt", "id-qt", NID_id_qt, 7, &so[1885]},
-    {"id-it", "id-it", NID_id_it, 7, &so[1892]},
-    {"id-pkip", "id-pkip", NID_id_pkip, 7, &so[1899]},
-    {"id-alg", "id-alg", NID_id_alg, 7, &so[1906]},
-    {"id-cmc", "id-cmc", NID_id_cmc, 7, &so[1913]},
-    {"id-on", "id-on", NID_id_on, 7, &so[1920]},
-    {"id-pda", "id-pda", NID_id_pda, 7, &so[1927]},
-    {"id-aca", "id-aca", NID_id_aca, 7, &so[1934]},
-    {"id-qcs", "id-qcs", NID_id_qcs, 7, &so[1941]},
-    {"id-cct", "id-cct", NID_id_cct, 7, &so[1948]},
-    {"id-pkix1-explicit-88", "id-pkix1-explicit-88", NID_id_pkix1_explicit_88, 8, &so[1955]},
-    {"id-pkix1-implicit-88", "id-pkix1-implicit-88", NID_id_pkix1_implicit_88, 8, &so[1963]},
-    {"id-pkix1-explicit-93", "id-pkix1-explicit-93", NID_id_pkix1_explicit_93, 8, &so[1971]},
-    {"id-pkix1-implicit-93", "id-pkix1-implicit-93", NID_id_pkix1_implicit_93, 8, &so[1979]},
-    {"id-mod-crmf", "id-mod-crmf", NID_id_mod_crmf, 8, &so[1987]},
-    {"id-mod-cmc", "id-mod-cmc", NID_id_mod_cmc, 8, &so[1995]},
-    {"id-mod-kea-profile-88", "id-mod-kea-profile-88", NID_id_mod_kea_profile_88, 8, &so[2003]},
-    {"id-mod-kea-profile-93", "id-mod-kea-profile-93", NID_id_mod_kea_profile_93, 8, &so[2011]},
-    {"id-mod-cmp", "id-mod-cmp", NID_id_mod_cmp, 8, &so[2019]},
-    {"id-mod-qualified-cert-88", "id-mod-qualified-cert-88", NID_id_mod_qualified_cert_88, 8, &so[2027]},
-    {"id-mod-qualified-cert-93", "id-mod-qualified-cert-93", NID_id_mod_qualified_cert_93, 8, &so[2035]},
-    {"id-mod-attribute-cert", "id-mod-attribute-cert", NID_id_mod_attribute_cert, 8, &so[2043]},
-    {"id-mod-timestamp-protocol", "id-mod-timestamp-protocol", NID_id_mod_timestamp_protocol, 8, &so[2051]},
-    {"id-mod-ocsp", "id-mod-ocsp", NID_id_mod_ocsp, 8, &so[2059]},
-    {"id-mod-dvcs", "id-mod-dvcs", NID_id_mod_dvcs, 8, &so[2067]},
-    {"id-mod-cmp2000", "id-mod-cmp2000", NID_id_mod_cmp2000, 8, &so[2075]},
-    {"biometricInfo", "Biometric Info", NID_biometricInfo, 8, &so[2083]},
-    {"qcStatements", "qcStatements", NID_qcStatements, 8, &so[2091]},
-    {"ac-auditIdentity", "X509v3 Audit Identity", NID_ac_auditIdentity, 8, &so[2099]},
-    {"ac-targeting", "ac-targeting", NID_ac_targeting, 8, &so[2107]},
-    {"aaControls", "aaControls", NID_aaControls, 8, &so[2115]},
-    {"sbgp-ipAddrBlock", "sbgp-ipAddrBlock", NID_sbgp_ipAddrBlock, 8, &so[2123]},
-    {"sbgp-autonomousSysNum", "sbgp-autonomousSysNum", NID_sbgp_autonomousSysNum, 8, &so[2131]},
-    {"sbgp-routerIdentifier", "sbgp-routerIdentifier", NID_sbgp_routerIdentifier, 8, &so[2139]},
-    {"textNotice", "textNotice", NID_textNotice, 8, &so[2147]},
-    {"ipsecEndSystem", "IPSec End System", NID_ipsecEndSystem, 8, &so[2155]},
-    {"ipsecTunnel", "IPSec Tunnel", NID_ipsecTunnel, 8, &so[2163]},
-    {"ipsecUser", "IPSec User", NID_ipsecUser, 8, &so[2171]},
-    {"DVCS", "dvcs", NID_dvcs, 8, &so[2179]},
-    {"id-it-caProtEncCert", "id-it-caProtEncCert", NID_id_it_caProtEncCert, 8, &so[2187]},
-    {"id-it-signKeyPairTypes", "id-it-signKeyPairTypes", NID_id_it_signKeyPairTypes, 8, &so[2195]},
-    {"id-it-encKeyPairTypes", "id-it-encKeyPairTypes", NID_id_it_encKeyPairTypes, 8, &so[2203]},
-    {"id-it-preferredSymmAlg", "id-it-preferredSymmAlg", NID_id_it_preferredSymmAlg, 8, &so[2211]},
-    {"id-it-caKeyUpdateInfo", "id-it-caKeyUpdateInfo", NID_id_it_caKeyUpdateInfo, 8, &so[2219]},
-    {"id-it-currentCRL", "id-it-currentCRL", NID_id_it_currentCRL, 8, &so[2227]},
-    {"id-it-unsupportedOIDs", "id-it-unsupportedOIDs", NID_id_it_unsupportedOIDs, 8, &so[2235]},
-    {"id-it-subscriptionRequest", "id-it-subscriptionRequest", NID_id_it_subscriptionRequest, 8, &so[2243]},
-    {"id-it-subscriptionResponse", "id-it-subscriptionResponse", NID_id_it_subscriptionResponse, 8, &so[2251]},
-    {"id-it-keyPairParamReq", "id-it-keyPairParamReq", NID_id_it_keyPairParamReq, 8, &so[2259]},
-    {"id-it-keyPairParamRep", "id-it-keyPairParamRep", NID_id_it_keyPairParamRep, 8, &so[2267]},
-    {"id-it-revPassphrase", "id-it-revPassphrase", NID_id_it_revPassphrase, 8, &so[2275]},
-    {"id-it-implicitConfirm", "id-it-implicitConfirm", NID_id_it_implicitConfirm, 8, &so[2283]},
-    {"id-it-confirmWaitTime", "id-it-confirmWaitTime", NID_id_it_confirmWaitTime, 8, &so[2291]},
-    {"id-it-origPKIMessage", "id-it-origPKIMessage", NID_id_it_origPKIMessage, 8, &so[2299]},
-    {"id-regCtrl", "id-regCtrl", NID_id_regCtrl, 8, &so[2307]},
-    {"id-regInfo", "id-regInfo", NID_id_regInfo, 8, &so[2315]},
-    {"id-regCtrl-regToken", "id-regCtrl-regToken", NID_id_regCtrl_regToken, 9, &so[2323]},
-    {"id-regCtrl-authenticator", "id-regCtrl-authenticator", NID_id_regCtrl_authenticator, 9, &so[2332]},
-    {"id-regCtrl-pkiPublicationInfo", "id-regCtrl-pkiPublicationInfo", NID_id_regCtrl_pkiPublicationInfo, 9, &so[2341]},
-    {"id-regCtrl-pkiArchiveOptions", "id-regCtrl-pkiArchiveOptions", NID_id_regCtrl_pkiArchiveOptions, 9, &so[2350]},
-    {"id-regCtrl-oldCertID", "id-regCtrl-oldCertID", NID_id_regCtrl_oldCertID, 9, &so[2359]},
-    {"id-regCtrl-protocolEncrKey", "id-regCtrl-protocolEncrKey", NID_id_regCtrl_protocolEncrKey, 9, &so[2368]},
-    {"id-regInfo-utf8Pairs", "id-regInfo-utf8Pairs", NID_id_regInfo_utf8Pairs, 9, &so[2377]},
-    {"id-regInfo-certReq", "id-regInfo-certReq", NID_id_regInfo_certReq, 9, &so[2386]},
-    {"id-alg-des40", "id-alg-des40", NID_id_alg_des40, 8, &so[2395]},
-    {"id-alg-noSignature", "id-alg-noSignature", NID_id_alg_noSignature, 8, &so[2403]},
-    {"id-alg-dh-sig-hmac-sha1", "id-alg-dh-sig-hmac-sha1", NID_id_alg_dh_sig_hmac_sha1, 8, &so[2411]},
-    {"id-alg-dh-pop", "id-alg-dh-pop", NID_id_alg_dh_pop, 8, &so[2419]},
-    {"id-cmc-statusInfo", "id-cmc-statusInfo", NID_id_cmc_statusInfo, 8, &so[2427]},
-    {"id-cmc-identification", "id-cmc-identification", NID_id_cmc_identification, 8, &so[2435]},
-    {"id-cmc-identityProof", "id-cmc-identityProof", NID_id_cmc_identityProof, 8, &so[2443]},
-    {"id-cmc-dataReturn", "id-cmc-dataReturn", NID_id_cmc_dataReturn, 8, &so[2451]},
-    {"id-cmc-transactionId", "id-cmc-transactionId", NID_id_cmc_transactionId, 8, &so[2459]},
-    {"id-cmc-senderNonce", "id-cmc-senderNonce", NID_id_cmc_senderNonce, 8, &so[2467]},
-    {"id-cmc-recipientNonce", "id-cmc-recipientNonce", NID_id_cmc_recipientNonce, 8, &so[2475]},
-    {"id-cmc-addExtensions", "id-cmc-addExtensions", NID_id_cmc_addExtensions, 8, &so[2483]},
-    {"id-cmc-encryptedPOP", "id-cmc-encryptedPOP", NID_id_cmc_encryptedPOP, 8, &so[2491]},
-    {"id-cmc-decryptedPOP", "id-cmc-decryptedPOP", NID_id_cmc_decryptedPOP, 8, &so[2499]},
-    {"id-cmc-lraPOPWitness", "id-cmc-lraPOPWitness", NID_id_cmc_lraPOPWitness, 8, &so[2507]},
-    {"id-cmc-getCert", "id-cmc-getCert", NID_id_cmc_getCert, 8, &so[2515]},
-    {"id-cmc-getCRL", "id-cmc-getCRL", NID_id_cmc_getCRL, 8, &so[2523]},
-    {"id-cmc-revokeRequest", "id-cmc-revokeRequest", NID_id_cmc_revokeRequest, 8, &so[2531]},
-    {"id-cmc-regInfo", "id-cmc-regInfo", NID_id_cmc_regInfo, 8, &so[2539]},
-    {"id-cmc-responseInfo", "id-cmc-responseInfo", NID_id_cmc_responseInfo, 8, &so[2547]},
-    {"id-cmc-queryPending", "id-cmc-queryPending", NID_id_cmc_queryPending, 8, &so[2555]},
-    {"id-cmc-popLinkRandom", "id-cmc-popLinkRandom", NID_id_cmc_popLinkRandom, 8, &so[2563]},
-    {"id-cmc-popLinkWitness", "id-cmc-popLinkWitness", NID_id_cmc_popLinkWitness, 8, &so[2571]},
-    {"id-cmc-confirmCertAcceptance", "id-cmc-confirmCertAcceptance", NID_id_cmc_confirmCertAcceptance, 8, &so[2579]},
-    {"id-on-personalData", "id-on-personalData", NID_id_on_personalData, 8, &so[2587]},
-    {"id-pda-dateOfBirth", "id-pda-dateOfBirth", NID_id_pda_dateOfBirth, 8, &so[2595]},
-    {"id-pda-placeOfBirth", "id-pda-placeOfBirth", NID_id_pda_placeOfBirth, 8, &so[2603]},
-    { NULL, NULL, NID_undef },
-    {"id-pda-gender", "id-pda-gender", NID_id_pda_gender, 8, &so[2611]},
-    {"id-pda-countryOfCitizenship", "id-pda-countryOfCitizenship", NID_id_pda_countryOfCitizenship, 8, &so[2619]},
-    {"id-pda-countryOfResidence", "id-pda-countryOfResidence", NID_id_pda_countryOfResidence, 8, &so[2627]},
-    {"id-aca-authenticationInfo", "id-aca-authenticationInfo", NID_id_aca_authenticationInfo, 8, &so[2635]},
-    {"id-aca-accessIdentity", "id-aca-accessIdentity", NID_id_aca_accessIdentity, 8, &so[2643]},
-    {"id-aca-chargingIdentity", "id-aca-chargingIdentity", NID_id_aca_chargingIdentity, 8, &so[2651]},
-    {"id-aca-group", "id-aca-group", NID_id_aca_group, 8, &so[2659]},
-    {"id-aca-role", "id-aca-role", NID_id_aca_role, 8, &so[2667]},
-    {"id-qcs-pkixQCSyntax-v1", "id-qcs-pkixQCSyntax-v1", NID_id_qcs_pkixQCSyntax_v1, 8, &so[2675]},
-    {"id-cct-crs", "id-cct-crs", NID_id_cct_crs, 8, &so[2683]},
-    {"id-cct-PKIData", "id-cct-PKIData", NID_id_cct_PKIData, 8, &so[2691]},
-    {"id-cct-PKIResponse", "id-cct-PKIResponse", NID_id_cct_PKIResponse, 8, &so[2699]},
-    {"ad_timestamping", "AD Time Stamping", NID_ad_timeStamping, 8, &so[2707]},
-    {"AD_DVCS", "ad dvcs", NID_ad_dvcs, 8, &so[2715]},
-    {"basicOCSPResponse", "Basic OCSP Response", NID_id_pkix_OCSP_basic, 9, &so[2723]},
-    {"Nonce", "OCSP Nonce", NID_id_pkix_OCSP_Nonce, 9, &so[2732]},
-    {"CrlID", "OCSP CRL ID", NID_id_pkix_OCSP_CrlID, 9, &so[2741]},
-    {"acceptableResponses", "Acceptable OCSP Responses", NID_id_pkix_OCSP_acceptableResponses, 9, &so[2750]},
-    {"noCheck", "OCSP No Check", NID_id_pkix_OCSP_noCheck, 9, &so[2759]},
-    {"archiveCutoff", "OCSP Archive Cutoff", NID_id_pkix_OCSP_archiveCutoff, 9, &so[2768]},
-    {"serviceLocator", "OCSP Service Locator", NID_id_pkix_OCSP_serviceLocator, 9, &so[2777]},
-    {"extendedStatus", "Extended OCSP Status", NID_id_pkix_OCSP_extendedStatus, 9, &so[2786]},
-    {"valid", "valid", NID_id_pkix_OCSP_valid, 9, &so[2795]},
-    {"path", "path", NID_id_pkix_OCSP_path, 9, &so[2804]},
-    {"trustRoot", "Trust Root", NID_id_pkix_OCSP_trustRoot, 9, &so[2813]},
-    {"algorithm", "algorithm", NID_algorithm, 4, &so[2822]},
-    {"rsaSignature", "rsaSignature", NID_rsaSignature, 5, &so[2826]},
-    {"X500algorithms", "directory services - algorithms", NID_X500algorithms, 2, &so[2831]},
-    {"ORG", "org", NID_org, 1, &so[2833]},
-    {"DOD", "dod", NID_dod, 2, &so[2834]},
-    {"IANA", "iana", NID_iana, 3, &so[2836]},
-    {"directory", "Directory", NID_Directory, 4, &so[2839]},
-    {"mgmt", "Management", NID_Management, 4, &so[2843]},
-    {"experimental", "Experimental", NID_Experimental, 4, &so[2847]},
-    {"private", "Private", NID_Private, 4, &so[2851]},
-    {"security", "Security", NID_Security, 4, &so[2855]},
-    {"snmpv2", "SNMPv2", NID_SNMPv2, 4, &so[2859]},
-    {"Mail", "Mail", NID_Mail, 4, &so[2863]},
-    {"enterprises", "Enterprises", NID_Enterprises, 5, &so[2867]},
-    {"dcobject", "dcObject", NID_dcObject, 9, &so[2872]},
-    {"DC", "domainComponent", NID_domainComponent, 10, &so[2881]},
-    {"domain", "Domain", NID_Domain, 10, &so[2891]},
-    {"NULL", "NULL", NID_joint_iso_ccitt},
-    {"selected-attribute-types", "Selected Attribute Types", NID_selected_attribute_types, 3, &so[2901]},
-    {"clearance", "clearance", NID_clearance, 4, &so[2904]},
-    {"RSA-MD4", "md4WithRSAEncryption", NID_md4WithRSAEncryption, 9, &so[2908]},
-    {"ac-proxying", "ac-proxying", NID_ac_proxying, 8, &so[2917]},
-    {"subjectInfoAccess", "Subject Information Access", NID_sinfo_access, 8, &so[2925]},
-    {"id-aca-encAttrs", "id-aca-encAttrs", NID_id_aca_encAttrs, 8, &so[2933]},
-    {"role", "role", NID_role, 3, &so[2941]},
-    {"policyConstraints", "X509v3 Policy Constraints", NID_policy_constraints, 3, &so[2944]},
-    {"targetInformation", "X509v3 AC Targeting", NID_target_information, 3, &so[2947]},
-    {"noRevAvail", "X509v3 No Revocation Available", NID_no_rev_avail, 3, &so[2950]},
-    {"NULL", "NULL", NID_ccitt},
-    {"ansi-X9-62", "ANSI X9.62", NID_ansi_X9_62, 5, &so[2953]},
-    {"prime-field", "prime-field", NID_X9_62_prime_field, 7, &so[2958]},
-    {"characteristic-two-field", "characteristic-two-field", NID_X9_62_characteristic_two_field, 7, &so[2965]},
-    {"id-ecPublicKey", "id-ecPublicKey", NID_X9_62_id_ecPublicKey, 7, &so[2972]},
-    {"prime192v1", "prime192v1", NID_X9_62_prime192v1, 8, &so[2979]},
-    {"prime192v2", "prime192v2", NID_X9_62_prime192v2, 8, &so[2987]},
-    {"prime192v3", "prime192v3", NID_X9_62_prime192v3, 8, &so[2995]},
-    {"prime239v1", "prime239v1", NID_X9_62_prime239v1, 8, &so[3003]},
-    {"prime239v2", "prime239v2", NID_X9_62_prime239v2, 8, &so[3011]},
-    {"prime239v3", "prime239v3", NID_X9_62_prime239v3, 8, &so[3019]},
-    {"prime256v1", "prime256v1", NID_X9_62_prime256v1, 8, &so[3027]},
-    {"ecdsa-with-SHA1", "ecdsa-with-SHA1", NID_ecdsa_with_SHA1, 7, &so[3035]},
-    {"CSPName", "Microsoft CSP Name", NID_ms_csp_name, 9, &so[3042]},
-    {"AES-128-ECB", "aes-128-ecb", NID_aes_128_ecb, 9, &so[3051]},
-    {"AES-128-CBC", "aes-128-cbc", NID_aes_128_cbc, 9, &so[3060]},
-    {"AES-128-OFB", "aes-128-ofb", NID_aes_128_ofb128, 9, &so[3069]},
-    {"AES-128-CFB", "aes-128-cfb", NID_aes_128_cfb128, 9, &so[3078]},
-    {"AES-192-ECB", "aes-192-ecb", NID_aes_192_ecb, 9, &so[3087]},
-    {"AES-192-CBC", "aes-192-cbc", NID_aes_192_cbc, 9, &so[3096]},
-    {"AES-192-OFB", "aes-192-ofb", NID_aes_192_ofb128, 9, &so[3105]},
-    {"AES-192-CFB", "aes-192-cfb", NID_aes_192_cfb128, 9, &so[3114]},
-    {"AES-256-ECB", "aes-256-ecb", NID_aes_256_ecb, 9, &so[3123]},
-    {"AES-256-CBC", "aes-256-cbc", NID_aes_256_cbc, 9, &so[3132]},
-    {"AES-256-OFB", "aes-256-ofb", NID_aes_256_ofb128, 9, &so[3141]},
-    {"AES-256-CFB", "aes-256-cfb", NID_aes_256_cfb128, 9, &so[3150]},
-    {"holdInstructionCode", "Hold Instruction Code", NID_hold_instruction_code, 3, &so[3159]},
-    {"holdInstructionNone", "Hold Instruction None", NID_hold_instruction_none, 7, &so[3162]},
-    {"holdInstructionCallIssuer", "Hold Instruction Call Issuer", NID_hold_instruction_call_issuer, 7, &so[3169]},
-    {"holdInstructionReject", "Hold Instruction Reject", NID_hold_instruction_reject, 7, &so[3176]},
-    {"data", "data", NID_data, 1, &so[3183]},
-    {"pss", "pss", NID_pss, 3, &so[3184]},
-    {"ucl", "ucl", NID_ucl, 7, &so[3187]},
-    {"pilot", "pilot", NID_pilot, 8, &so[3194]},
-    {"pilotAttributeType", "pilotAttributeType", NID_pilotAttributeType, 9, &so[3202]},
-    {"pilotAttributeSyntax", "pilotAttributeSyntax", NID_pilotAttributeSyntax, 9, &so[3211]},
-    {"pilotObjectClass", "pilotObjectClass", NID_pilotObjectClass, 9, &so[3220]},
-    {"pilotGroups", "pilotGroups", NID_pilotGroups, 9, &so[3229]},
-    {"iA5StringSyntax", "iA5StringSyntax", NID_iA5StringSyntax, 10, &so[3238]},
-    {"caseIgnoreIA5StringSyntax", "caseIgnoreIA5StringSyntax", NID_caseIgnoreIA5StringSyntax, 10, &so[3248]},
-    {"pilotObject", "pilotObject", NID_pilotObject, 10, &so[3258]},
-    {"pilotPerson", "pilotPerson", NID_pilotPerson, 10, &so[3268]},
-    {"account", "account", NID_account, 10, &so[3278]},
-    {"document", "document", NID_document, 10, &so[3288]},
-    {"room", "room", NID_room, 10, &so[3298]},
-    {"documentSeries", "documentSeries", NID_documentSeries, 10, &so[3308]},
-    {"rFC822localPart", "rFC822localPart", NID_rFC822localPart, 10, &so[3318]},
-    {"dNSDomain", "dNSDomain", NID_dNSDomain, 10, &so[3328]},
-    {"domainRelatedObject", "domainRelatedObject", NID_domainRelatedObject, 10, &so[3338]},
-    {"friendlyCountry", "friendlyCountry", NID_friendlyCountry, 10, &so[3348]},
-    {"simpleSecurityObject", "simpleSecurityObject", NID_simpleSecurityObject, 10, &so[3358]},
-    {"pilotOrganization", "pilotOrganization", NID_pilotOrganization, 10, &so[3368]},
-    {"pilotDSA", "pilotDSA", NID_pilotDSA, 10, &so[3378]},
-    {"qualityLabelledData", "qualityLabelledData", NID_qualityLabelledData, 10, &so[3388]},
-    {"UID", "userId", NID_userId, 10, &so[3398]},
-    {"textEncodedORAddress", "textEncodedORAddress", NID_textEncodedORAddress, 10, &so[3408]},
-    {"mail", "rfc822Mailbox", NID_rfc822Mailbox, 10, &so[3418]},
-    {"info", "info", NID_info, 10, &so[3428]},
-    {"favouriteDrink", "favouriteDrink", NID_favouriteDrink, 10, &so[3438]},
-    {"roomNumber", "roomNumber", NID_roomNumber, 10, &so[3448]},
-    {"photo", "photo", NID_photo, 10, &so[3458]},
-    {"userClass", "userClass", NID_userClass, 10, &so[3468]},
-    {"host", "host", NID_host, 10, &so[3478]},
-    {"manager", "manager", NID_manager, 10, &so[3488]},
-    {"documentIdentifier", "documentIdentifier", NID_documentIdentifier, 10, &so[3498]},
-    {"documentTitle", "documentTitle", NID_documentTitle, 10, &so[3508]},
-    {"documentVersion", "documentVersion", NID_documentVersion, 10, &so[3518]},
-    {"documentAuthor", "documentAuthor", NID_documentAuthor, 10, &so[3528]},
-    {"documentLocation", "documentLocation", NID_documentLocation, 10, &so[3538]},
-    {"homeTelephoneNumber", "homeTelephoneNumber", NID_homeTelephoneNumber, 10, &so[3548]},
-    {"secretary", "secretary", NID_secretary, 10, &so[3558]},
-    {"otherMailbox", "otherMailbox", NID_otherMailbox, 10, &so[3568]},
-    {"lastModifiedTime", "lastModifiedTime", NID_lastModifiedTime, 10, &so[3578]},
-    {"lastModifiedBy", "lastModifiedBy", NID_lastModifiedBy, 10, &so[3588]},
-    {"aRecord", "aRecord", NID_aRecord, 10, &so[3598]},
-    {"pilotAttributeType27", "pilotAttributeType27", NID_pilotAttributeType27, 10, &so[3608]},
-    {"mXRecord", "mXRecord", NID_mXRecord, 10, &so[3618]},
-    {"nSRecord", "nSRecord", NID_nSRecord, 10, &so[3628]},
-    {"sOARecord", "sOARecord", NID_sOARecord, 10, &so[3638]},
-    {"cNAMERecord", "cNAMERecord", NID_cNAMERecord, 10, &so[3648]},
-    {"associatedDomain", "associatedDomain", NID_associatedDomain, 10, &so[3658]},
-    {"associatedName", "associatedName", NID_associatedName, 10, &so[3668]},
-    {"homePostalAddress", "homePostalAddress", NID_homePostalAddress, 10, &so[3678]},
-    {"personalTitle", "personalTitle", NID_personalTitle, 10, &so[3688]},
-    {"mobileTelephoneNumber", "mobileTelephoneNumber", NID_mobileTelephoneNumber, 10, &so[3698]},
-    {"pagerTelephoneNumber", "pagerTelephoneNumber", NID_pagerTelephoneNumber, 10, &so[3708]},
-    {"friendlyCountryName", "friendlyCountryName", NID_friendlyCountryName, 10, &so[3718]},
-    {"organizationalStatus", "organizationalStatus", NID_organizationalStatus, 10, &so[3728]},
-    {"janetMailbox", "janetMailbox", NID_janetMailbox, 10, &so[3738]},
-    {"mailPreferenceOption", "mailPreferenceOption", NID_mailPreferenceOption, 10, &so[3748]},
-    {"buildingName", "buildingName", NID_buildingName, 10, &so[3758]},
-    {"dSAQuality", "dSAQuality", NID_dSAQuality, 10, &so[3768]},
-    {"singleLevelQuality", "singleLevelQuality", NID_singleLevelQuality, 10, &so[3778]},
-    {"subtreeMinimumQuality", "subtreeMinimumQuality", NID_subtreeMinimumQuality, 10, &so[3788]},
-    {"subtreeMaximumQuality", "subtreeMaximumQuality", NID_subtreeMaximumQuality, 10, &so[3798]},
-    {"personalSignature", "personalSignature", NID_personalSignature, 10, &so[3808]},
-    {"dITRedirect", "dITRedirect", NID_dITRedirect, 10, &so[3818]},
-    {"audio", "audio", NID_audio, 10, &so[3828]},
-    {"documentPublisher", "documentPublisher", NID_documentPublisher, 10, &so[3838]},
-    {"x500UniqueIdentifier", "x500UniqueIdentifier", NID_x500UniqueIdentifier, 3, &so[3848]},
-    {"mime-mhs", "MIME MHS", NID_mime_mhs, 5, &so[3851]},
-    {"mime-mhs-headings", "mime-mhs-headings", NID_mime_mhs_headings, 6, &so[3856]},
-    {"mime-mhs-bodies", "mime-mhs-bodies", NID_mime_mhs_bodies, 6, &so[3862]},
-    {"id-hex-partial-message", "id-hex-partial-message", NID_id_hex_partial_message, 7, &so[3868]},
-    {"id-hex-multipart-message", "id-hex-multipart-message", NID_id_hex_multipart_message, 7, &so[3875]},
-    {"generationQualifier", "generationQualifier", NID_generationQualifier, 3, &so[3882]},
-    {"pseudonym", "pseudonym", NID_pseudonym, 3, &so[3885]},
-    { NULL, NULL, NID_undef },
-    {"id-set", "Secure Electronic Transactions", NID_id_set, 2, &so[3888]},
-    {"set-ctype", "content types", NID_set_ctype, 3, &so[3890]},
-    {"set-msgExt", "message extensions", NID_set_msgExt, 3, &so[3893]},
-    {"set-attr", "set-attr", NID_set_attr, 3, &so[3896]},
-    {"set-policy", "set-policy", NID_set_policy, 3, &so[3899]},
-    {"set-certExt", "certificate extensions", NID_set_certExt, 3, &so[3902]},
-    {"set-brand", "set-brand", NID_set_brand, 3, &so[3905]},
-    {"setct-PANData", "setct-PANData", NID_setct_PANData, 4, &so[3908]},
-    {"setct-PANToken", "setct-PANToken", NID_setct_PANToken, 4, &so[3912]},
-    {"setct-PANOnly", "setct-PANOnly", NID_setct_PANOnly, 4, &so[3916]},
-    {"setct-OIData", "setct-OIData", NID_setct_OIData, 4, &so[3920]},
-    {"setct-PI", "setct-PI", NID_setct_PI, 4, &so[3924]},
-    {"setct-PIData", "setct-PIData", NID_setct_PIData, 4, &so[3928]},
-    {"setct-PIDataUnsigned", "setct-PIDataUnsigned", NID_setct_PIDataUnsigned, 4, &so[3932]},
-    {"setct-HODInput", "setct-HODInput", NID_setct_HODInput, 4, &so[3936]},
-    {"setct-AuthResBaggage", "setct-AuthResBaggage", NID_setct_AuthResBaggage, 4, &so[3940]},
-    {"setct-AuthRevReqBaggage", "setct-AuthRevReqBaggage", NID_setct_AuthRevReqBaggage, 4, &so[3944]},
-    {"setct-AuthRevResBaggage", "setct-AuthRevResBaggage", NID_setct_AuthRevResBaggage, 4, &so[3948]},
-    {"setct-CapTokenSeq", "setct-CapTokenSeq", NID_setct_CapTokenSeq, 4, &so[3952]},
-    {"setct-PInitResData", "setct-PInitResData", NID_setct_PInitResData, 4, &so[3956]},
-    {"setct-PI-TBS", "setct-PI-TBS", NID_setct_PI_TBS, 4, &so[3960]},
-    {"setct-PResData", "setct-PResData", NID_setct_PResData, 4, &so[3964]},
-    {"setct-AuthReqTBS", "setct-AuthReqTBS", NID_setct_AuthReqTBS, 4, &so[3968]},
-    {"setct-AuthResTBS", "setct-AuthResTBS", NID_setct_AuthResTBS, 4, &so[3972]},
-    {"setct-AuthResTBSX", "setct-AuthResTBSX", NID_setct_AuthResTBSX, 4, &so[3976]},
-    {"setct-AuthTokenTBS", "setct-AuthTokenTBS", NID_setct_AuthTokenTBS, 4, &so[3980]},
-    {"setct-CapTokenData", "setct-CapTokenData", NID_setct_CapTokenData, 4, &so[3984]},
-    {"setct-CapTokenTBS", "setct-CapTokenTBS", NID_setct_CapTokenTBS, 4, &so[3988]},
-    {"setct-AcqCardCodeMsg", "setct-AcqCardCodeMsg", NID_setct_AcqCardCodeMsg, 4, &so[3992]},
-    {"setct-AuthRevReqTBS", "setct-AuthRevReqTBS", NID_setct_AuthRevReqTBS, 4, &so[3996]},
-    {"setct-AuthRevResData", "setct-AuthRevResData", NID_setct_AuthRevResData, 4, &so[4000]},
-    {"setct-AuthRevResTBS", "setct-AuthRevResTBS", NID_setct_AuthRevResTBS, 4, &so[4004]},
-    {"setct-CapReqTBS", "setct-CapReqTBS", NID_setct_CapReqTBS, 4, &so[4008]},
-    {"setct-CapReqTBSX", "setct-CapReqTBSX", NID_setct_CapReqTBSX, 4, &so[4012]},
-    {"setct-CapResData", "setct-CapResData", NID_setct_CapResData, 4, &so[4016]},
-    {"setct-CapRevReqTBS", "setct-CapRevReqTBS", NID_setct_CapRevReqTBS, 4, &so[4020]},
-    {"setct-CapRevReqTBSX", "setct-CapRevReqTBSX", NID_setct_CapRevReqTBSX, 4, &so[4024]},
-    {"setct-CapRevResData", "setct-CapRevResData", NID_setct_CapRevResData, 4, &so[4028]},
-    {"setct-CredReqTBS", "setct-CredReqTBS", NID_setct_CredReqTBS, 4, &so[4032]},
-    {"setct-CredReqTBSX", "setct-CredReqTBSX", NID_setct_CredReqTBSX, 4, &so[4036]},
-    {"setct-CredResData", "setct-CredResData", NID_setct_CredResData, 4, &so[4040]},
-    {"setct-CredRevReqTBS", "setct-CredRevReqTBS", NID_setct_CredRevReqTBS, 4, &so[4044]},
-    {"setct-CredRevReqTBSX", "setct-CredRevReqTBSX", NID_setct_CredRevReqTBSX, 4, &so[4048]},
-    {"setct-CredRevResData", "setct-CredRevResData", NID_setct_CredRevResData, 4, &so[4052]},
-    {"setct-PCertReqData", "setct-PCertReqData", NID_setct_PCertReqData, 4, &so[4056]},
-    {"setct-PCertResTBS", "setct-PCertResTBS", NID_setct_PCertResTBS, 4, &so[4060]},
-    {"setct-BatchAdminReqData", "setct-BatchAdminReqData", NID_setct_BatchAdminReqData, 4, &so[4064]},
-    {"setct-BatchAdminResData", "setct-BatchAdminResData", NID_setct_BatchAdminResData, 4, &so[4068]},
-    {"setct-CardCInitResTBS", "setct-CardCInitResTBS", NID_setct_CardCInitResTBS, 4, &so[4072]},
-    {"setct-MeAqCInitResTBS", "setct-MeAqCInitResTBS", NID_setct_MeAqCInitResTBS, 4, &so[4076]},
-    {"setct-RegFormResTBS", "setct-RegFormResTBS", NID_setct_RegFormResTBS, 4, &so[4080]},
-    {"setct-CertReqData", "setct-CertReqData", NID_setct_CertReqData, 4, &so[4084]},
-    {"setct-CertReqTBS", "setct-CertReqTBS", NID_setct_CertReqTBS, 4, &so[4088]},
-    {"setct-CertResData", "setct-CertResData", NID_setct_CertResData, 4, &so[4092]},
-    {"setct-CertInqReqTBS", "setct-CertInqReqTBS", NID_setct_CertInqReqTBS, 4, &so[4096]},
-    {"setct-ErrorTBS", "setct-ErrorTBS", NID_setct_ErrorTBS, 4, &so[4100]},
-    {"setct-PIDualSignedTBE", "setct-PIDualSignedTBE", NID_setct_PIDualSignedTBE, 4, &so[4104]},
-    {"setct-PIUnsignedTBE", "setct-PIUnsignedTBE", NID_setct_PIUnsignedTBE, 4, &so[4108]},
-    {"setct-AuthReqTBE", "setct-AuthReqTBE", NID_setct_AuthReqTBE, 4, &so[4112]},
-    {"setct-AuthResTBE", "setct-AuthResTBE", NID_setct_AuthResTBE, 4, &so[4116]},
-    {"setct-AuthResTBEX", "setct-AuthResTBEX", NID_setct_AuthResTBEX, 4, &so[4120]},
-    {"setct-AuthTokenTBE", "setct-AuthTokenTBE", NID_setct_AuthTokenTBE, 4, &so[4124]},
-    {"setct-CapTokenTBE", "setct-CapTokenTBE", NID_setct_CapTokenTBE, 4, &so[4128]},
-    {"setct-CapTokenTBEX", "setct-CapTokenTBEX", NID_setct_CapTokenTBEX, 4, &so[4132]},
-    {"setct-AcqCardCodeMsgTBE", "setct-AcqCardCodeMsgTBE", NID_setct_AcqCardCodeMsgTBE, 4, &so[4136]},
-    {"setct-AuthRevReqTBE", "setct-AuthRevReqTBE", NID_setct_AuthRevReqTBE, 4, &so[4140]},
-    {"setct-AuthRevResTBE", "setct-AuthRevResTBE", NID_setct_AuthRevResTBE, 4, &so[4144]},
-    {"setct-AuthRevResTBEB", "setct-AuthRevResTBEB", NID_setct_AuthRevResTBEB, 4, &so[4148]},
-    {"setct-CapReqTBE", "setct-CapReqTBE", NID_setct_CapReqTBE, 4, &so[4152]},
-    {"setct-CapReqTBEX", "setct-CapReqTBEX", NID_setct_CapReqTBEX, 4, &so[4156]},
-    {"setct-CapResTBE", "setct-CapResTBE", NID_setct_CapResTBE, 4, &so[4160]},
-    {"setct-CapRevReqTBE", "setct-CapRevReqTBE", NID_setct_CapRevReqTBE, 4, &so[4164]},
-    {"setct-CapRevReqTBEX", "setct-CapRevReqTBEX", NID_setct_CapRevReqTBEX, 4, &so[4168]},
-    {"setct-CapRevResTBE", "setct-CapRevResTBE", NID_setct_CapRevResTBE, 4, &so[4172]},
-    {"setct-CredReqTBE", "setct-CredReqTBE", NID_setct_CredReqTBE, 4, &so[4176]},
-    {"setct-CredReqTBEX", "setct-CredReqTBEX", NID_setct_CredReqTBEX, 4, &so[4180]},
-    {"setct-CredResTBE", "setct-CredResTBE", NID_setct_CredResTBE, 4, &so[4184]},
-    {"setct-CredRevReqTBE", "setct-CredRevReqTBE", NID_setct_CredRevReqTBE, 4, &so[4188]},
-    {"setct-CredRevReqTBEX", "setct-CredRevReqTBEX", NID_setct_CredRevReqTBEX, 4, &so[4192]},
-    {"setct-CredRevResTBE", "setct-CredRevResTBE", NID_setct_CredRevResTBE, 4, &so[4196]},
-    {"setct-BatchAdminReqTBE", "setct-BatchAdminReqTBE", NID_setct_BatchAdminReqTBE, 4, &so[4200]},
-    {"setct-BatchAdminResTBE", "setct-BatchAdminResTBE", NID_setct_BatchAdminResTBE, 4, &so[4204]},
-    {"setct-RegFormReqTBE", "setct-RegFormReqTBE", NID_setct_RegFormReqTBE, 4, &so[4208]},
-    {"setct-CertReqTBE", "setct-CertReqTBE", NID_setct_CertReqTBE, 4, &so[4212]},
-    {"setct-CertReqTBEX", "setct-CertReqTBEX", NID_setct_CertReqTBEX, 4, &so[4216]},
-    {"setct-CertResTBE", "setct-CertResTBE", NID_setct_CertResTBE, 4, &so[4220]},
-    {"setct-CRLNotificationTBS", "setct-CRLNotificationTBS", NID_setct_CRLNotificationTBS, 4, &so[4224]},
-    {"setct-CRLNotificationResTBS", "setct-CRLNotificationResTBS", NID_setct_CRLNotificationResTBS, 4, &so[4228]},
-    {"setct-BCIDistributionTBS", "setct-BCIDistributionTBS", NID_setct_BCIDistributionTBS, 4, &so[4232]},
-    {"setext-genCrypt", "generic cryptogram", NID_setext_genCrypt, 4, &so[4236]},
-    {"setext-miAuth", "merchant initiated auth", NID_setext_miAuth, 4, &so[4240]},
-    {"setext-pinSecure", "setext-pinSecure", NID_setext_pinSecure, 4, &so[4244]},
-    {"setext-pinAny", "setext-pinAny", NID_setext_pinAny, 4, &so[4248]},
-    {"setext-track2", "setext-track2", NID_setext_track2, 4, &so[4252]},
-    {"setext-cv", "additional verification", NID_setext_cv, 4, &so[4256]},
-    {"set-policy-root", "set-policy-root", NID_set_policy_root, 4, &so[4260]},
-    {"setCext-hashedRoot", "setCext-hashedRoot", NID_setCext_hashedRoot, 4, &so[4264]},
-    {"setCext-certType", "setCext-certType", NID_setCext_certType, 4, &so[4268]},
-    {"setCext-merchData", "setCext-merchData", NID_setCext_merchData, 4, &so[4272]},
-    {"setCext-cCertRequired", "setCext-cCertRequired", NID_setCext_cCertRequired, 4, &so[4276]},
-    {"setCext-tunneling", "setCext-tunneling", NID_setCext_tunneling, 4, &so[4280]},
-    {"setCext-setExt", "setCext-setExt", NID_setCext_setExt, 4, &so[4284]},
-    {"setCext-setQualf", "setCext-setQualf", NID_setCext_setQualf, 4, &so[4288]},
-    {"setCext-PGWYcapabilities", "setCext-PGWYcapabilities", NID_setCext_PGWYcapabilities, 4, &so[4292]},
-    {"setCext-TokenIdentifier", "setCext-TokenIdentifier", NID_setCext_TokenIdentifier, 4, &so[4296]},
-    {"setCext-Track2Data", "setCext-Track2Data", NID_setCext_Track2Data, 4, &so[4300]},
-    {"setCext-TokenType", "setCext-TokenType", NID_setCext_TokenType, 4, &so[4304]},
-    {"setCext-IssuerCapabilities", "setCext-IssuerCapabilities", NID_setCext_IssuerCapabilities, 4, &so[4308]},
-    {"setAttr-Cert", "setAttr-Cert", NID_setAttr_Cert, 4, &so[4312]},
-    {"setAttr-PGWYcap", "payment gateway capabilities", NID_setAttr_PGWYcap, 4, &so[4316]},
-    {"setAttr-TokenType", "setAttr-TokenType", NID_setAttr_TokenType, 4, &so[4320]},
-    {"setAttr-IssCap", "issuer capabilities", NID_setAttr_IssCap, 4, &so[4324]},
-    {"set-rootKeyThumb", "set-rootKeyThumb", NID_set_rootKeyThumb, 5, &so[4328]},
-    {"set-addPolicy", "set-addPolicy", NID_set_addPolicy, 5, &so[4333]},
-    {"setAttr-Token-EMV", "setAttr-Token-EMV", NID_setAttr_Token_EMV, 5, &so[4338]},
-    {"setAttr-Token-B0Prime", "setAttr-Token-B0Prime", NID_setAttr_Token_B0Prime, 5, &so[4343]},
-    {"setAttr-IssCap-CVM", "setAttr-IssCap-CVM", NID_setAttr_IssCap_CVM, 5, &so[4348]},
-    {"setAttr-IssCap-T2", "setAttr-IssCap-T2", NID_setAttr_IssCap_T2, 5, &so[4353]},
-    {"setAttr-IssCap-Sig", "setAttr-IssCap-Sig", NID_setAttr_IssCap_Sig, 5, &so[4358]},
-    {"setAttr-GenCryptgrm", "generate cryptogram", NID_setAttr_GenCryptgrm, 6, &so[4363]},
-    {"setAttr-T2Enc", "encrypted track 2", NID_setAttr_T2Enc, 6, &so[4369]},
-    {"setAttr-T2cleartxt", "cleartext track 2", NID_setAttr_T2cleartxt, 6, &so[4375]},
-    {"setAttr-TokICCsig", "ICC or token signature", NID_setAttr_TokICCsig, 6, &so[4381]},
-    {"setAttr-SecDevSig", "secure device signature", NID_setAttr_SecDevSig, 6, &so[4387]},
-    {"set-brand-IATA-ATA", "set-brand-IATA-ATA", NID_set_brand_IATA_ATA, 4, &so[4393]},
-    {"set-brand-Diners", "set-brand-Diners", NID_set_brand_Diners, 4, &so[4397]},
-    {"set-brand-AmericanExpress", "set-brand-AmericanExpress", NID_set_brand_AmericanExpress, 4, &so[4401]},
-    {"set-brand-JCB", "set-brand-JCB", NID_set_brand_JCB, 4, &so[4405]},
-    {"set-brand-Visa", "set-brand-Visa", NID_set_brand_Visa, 4, &so[4409]},
-    {"set-brand-MasterCard", "set-brand-MasterCard", NID_set_brand_MasterCard, 4, &so[4413]},
-    {"set-brand-Novus", "set-brand-Novus", NID_set_brand_Novus, 5, &so[4417]},
-    {"DES-CDMF", "des-cdmf", NID_des_cdmf, 8, &so[4422]},
-    {"rsaOAEPEncryptionSET", "rsaOAEPEncryptionSET", NID_rsaOAEPEncryptionSET, 9, &so[4430]},
-    {"ITU-T", "itu-t", NID_itu_t},
-    {"JOINT-ISO-ITU-T", "joint-iso-itu-t", NID_joint_iso_itu_t},
-    {"international-organizations", "International Organizations", NID_international_organizations, 1, &so[4439]},
-    {"msSmartcardLogin", "Microsoft Smartcard Login", NID_ms_smartcard_login, 10, &so[4440]},
-    {"msUPN", "Microsoft User Principal Name", NID_ms_upn, 10, &so[4450]},
-    {"AES-128-CFB1", "aes-128-cfb1", NID_aes_128_cfb1},
-    {"AES-192-CFB1", "aes-192-cfb1", NID_aes_192_cfb1},
-    {"AES-256-CFB1", "aes-256-cfb1", NID_aes_256_cfb1},
-    {"AES-128-CFB8", "aes-128-cfb8", NID_aes_128_cfb8},
-    {"AES-192-CFB8", "aes-192-cfb8", NID_aes_192_cfb8},
-    {"AES-256-CFB8", "aes-256-cfb8", NID_aes_256_cfb8},
-    {"DES-CFB1", "des-cfb1", NID_des_cfb1},
-    {"DES-CFB8", "des-cfb8", NID_des_cfb8},
-    {"DES-EDE3-CFB1", "des-ede3-cfb1", NID_des_ede3_cfb1},
-    {"DES-EDE3-CFB8", "des-ede3-cfb8", NID_des_ede3_cfb8},
-    {"street", "streetAddress", NID_streetAddress, 3, &so[4460]},
-    {"postalCode", "postalCode", NID_postalCode, 3, &so[4463]},
-    {"id-ppl", "id-ppl", NID_id_ppl, 7, &so[4466]},
-    {"proxyCertInfo", "Proxy Certificate Information", NID_proxyCertInfo, 8, &so[4473]},
-    {"id-ppl-anyLanguage", "Any language", NID_id_ppl_anyLanguage, 8, &so[4481]},
-    {"id-ppl-inheritAll", "Inherit all", NID_id_ppl_inheritAll, 8, &so[4489]},
-    {"nameConstraints", "X509v3 Name Constraints", NID_name_constraints, 3, &so[4497]},
-    {"id-ppl-independent", "Independent", NID_Independent, 8, &so[4500]},
-    {"RSA-SHA256", "sha256WithRSAEncryption", NID_sha256WithRSAEncryption, 9, &so[4508]},
-    {"RSA-SHA384", "sha384WithRSAEncryption", NID_sha384WithRSAEncryption, 9, &so[4517]},
-    {"RSA-SHA512", "sha512WithRSAEncryption", NID_sha512WithRSAEncryption, 9, &so[4526]},
-    {"RSA-SHA224", "sha224WithRSAEncryption", NID_sha224WithRSAEncryption, 9, &so[4535]},
-    {"SHA256", "sha256", NID_sha256, 9, &so[4544]},
-    {"SHA384", "sha384", NID_sha384, 9, &so[4553]},
-    {"SHA512", "sha512", NID_sha512, 9, &so[4562]},
-    {"SHA224", "sha224", NID_sha224, 9, &so[4571]},
-    {"identified-organization", "identified-organization", NID_identified_organization, 1, &so[4580]},
-    {"certicom-arc", "certicom-arc", NID_certicom_arc, 3, &so[4581]},
-    {"wap", "wap", NID_wap, 2, &so[4584]},
-    {"wap-wsg", "wap-wsg", NID_wap_wsg, 3, &so[4586]},
-    {"id-characteristic-two-basis", "id-characteristic-two-basis", NID_X9_62_id_characteristic_two_basis, 8, &so[4589]},
-    {"onBasis", "onBasis", NID_X9_62_onBasis, 9, &so[4597]},
-    {"tpBasis", "tpBasis", NID_X9_62_tpBasis, 9, &so[4606]},
-    {"ppBasis", "ppBasis", NID_X9_62_ppBasis, 9, &so[4615]},
-    {"c2pnb163v1", "c2pnb163v1", NID_X9_62_c2pnb163v1, 8, &so[4624]},
-    {"c2pnb163v2", "c2pnb163v2", NID_X9_62_c2pnb163v2, 8, &so[4632]},
-    {"c2pnb163v3", "c2pnb163v3", NID_X9_62_c2pnb163v3, 8, &so[4640]},
-    {"c2pnb176v1", "c2pnb176v1", NID_X9_62_c2pnb176v1, 8, &so[4648]},
-    {"c2tnb191v1", "c2tnb191v1", NID_X9_62_c2tnb191v1, 8, &so[4656]},
-    {"c2tnb191v2", "c2tnb191v2", NID_X9_62_c2tnb191v2, 8, &so[4664]},
-    {"c2tnb191v3", "c2tnb191v3", NID_X9_62_c2tnb191v3, 8, &so[4672]},
-    {"c2onb191v4", "c2onb191v4", NID_X9_62_c2onb191v4, 8, &so[4680]},
-    {"c2onb191v5", "c2onb191v5", NID_X9_62_c2onb191v5, 8, &so[4688]},
-    {"c2pnb208w1", "c2pnb208w1", NID_X9_62_c2pnb208w1, 8, &so[4696]},
-    {"c2tnb239v1", "c2tnb239v1", NID_X9_62_c2tnb239v1, 8, &so[4704]},
-    {"c2tnb239v2", "c2tnb239v2", NID_X9_62_c2tnb239v2, 8, &so[4712]},
-    {"c2tnb239v3", "c2tnb239v3", NID_X9_62_c2tnb239v3, 8, &so[4720]},
-    {"c2onb239v4", "c2onb239v4", NID_X9_62_c2onb239v4, 8, &so[4728]},
-    {"c2onb239v5", "c2onb239v5", NID_X9_62_c2onb239v5, 8, &so[4736]},
-    {"c2pnb272w1", "c2pnb272w1", NID_X9_62_c2pnb272w1, 8, &so[4744]},
-    {"c2pnb304w1", "c2pnb304w1", NID_X9_62_c2pnb304w1, 8, &so[4752]},
-    {"c2tnb359v1", "c2tnb359v1", NID_X9_62_c2tnb359v1, 8, &so[4760]},
-    {"c2pnb368w1", "c2pnb368w1", NID_X9_62_c2pnb368w1, 8, &so[4768]},
-    {"c2tnb431r1", "c2tnb431r1", NID_X9_62_c2tnb431r1, 8, &so[4776]},
-    {"secp112r1", "secp112r1", NID_secp112r1, 5, &so[4784]},
-    {"secp112r2", "secp112r2", NID_secp112r2, 5, &so[4789]},
-    {"secp128r1", "secp128r1", NID_secp128r1, 5, &so[4794]},
-    {"secp128r2", "secp128r2", NID_secp128r2, 5, &so[4799]},
-    {"secp160k1", "secp160k1", NID_secp160k1, 5, &so[4804]},
-    {"secp160r1", "secp160r1", NID_secp160r1, 5, &so[4809]},
-    {"secp160r2", "secp160r2", NID_secp160r2, 5, &so[4814]},
-    {"secp192k1", "secp192k1", NID_secp192k1, 5, &so[4819]},
-    {"secp224k1", "secp224k1", NID_secp224k1, 5, &so[4824]},
-    {"secp224r1", "secp224r1", NID_secp224r1, 5, &so[4829]},
-    {"secp256k1", "secp256k1", NID_secp256k1, 5, &so[4834]},
-    {"secp384r1", "secp384r1", NID_secp384r1, 5, &so[4839]},
-    {"secp521r1", "secp521r1", NID_secp521r1, 5, &so[4844]},
-    {"sect113r1", "sect113r1", NID_sect113r1, 5, &so[4849]},
-    {"sect113r2", "sect113r2", NID_sect113r2, 5, &so[4854]},
-    {"sect131r1", "sect131r1", NID_sect131r1, 5, &so[4859]},
-    {"sect131r2", "sect131r2", NID_sect131r2, 5, &so[4864]},
-    {"sect163k1", "sect163k1", NID_sect163k1, 5, &so[4869]},
-    {"sect163r1", "sect163r1", NID_sect163r1, 5, &so[4874]},
-    {"sect163r2", "sect163r2", NID_sect163r2, 5, &so[4879]},
-    {"sect193r1", "sect193r1", NID_sect193r1, 5, &so[4884]},
-    {"sect193r2", "sect193r2", NID_sect193r2, 5, &so[4889]},
-    {"sect233k1", "sect233k1", NID_sect233k1, 5, &so[4894]},
-    {"sect233r1", "sect233r1", NID_sect233r1, 5, &so[4899]},
-    {"sect239k1", "sect239k1", NID_sect239k1, 5, &so[4904]},
-    {"sect283k1", "sect283k1", NID_sect283k1, 5, &so[4909]},
-    {"sect283r1", "sect283r1", NID_sect283r1, 5, &so[4914]},
-    {"sect409k1", "sect409k1", NID_sect409k1, 5, &so[4919]},
-    {"sect409r1", "sect409r1", NID_sect409r1, 5, &so[4924]},
-    {"sect571k1", "sect571k1", NID_sect571k1, 5, &so[4929]},
-    {"sect571r1", "sect571r1", NID_sect571r1, 5, &so[4934]},
-    {"wap-wsg-idm-ecid-wtls1", "wap-wsg-idm-ecid-wtls1", NID_wap_wsg_idm_ecid_wtls1, 5, &so[4939]},
-    {"wap-wsg-idm-ecid-wtls3", "wap-wsg-idm-ecid-wtls3", NID_wap_wsg_idm_ecid_wtls3, 5, &so[4944]},
-    {"wap-wsg-idm-ecid-wtls4", "wap-wsg-idm-ecid-wtls4", NID_wap_wsg_idm_ecid_wtls4, 5, &so[4949]},
-    {"wap-wsg-idm-ecid-wtls5", "wap-wsg-idm-ecid-wtls5", NID_wap_wsg_idm_ecid_wtls5, 5, &so[4954]},
-    {"wap-wsg-idm-ecid-wtls6", "wap-wsg-idm-ecid-wtls6", NID_wap_wsg_idm_ecid_wtls6, 5, &so[4959]},
-    {"wap-wsg-idm-ecid-wtls7", "wap-wsg-idm-ecid-wtls7", NID_wap_wsg_idm_ecid_wtls7, 5, &so[4964]},
-    {"wap-wsg-idm-ecid-wtls8", "wap-wsg-idm-ecid-wtls8", NID_wap_wsg_idm_ecid_wtls8, 5, &so[4969]},
-    {"wap-wsg-idm-ecid-wtls9", "wap-wsg-idm-ecid-wtls9", NID_wap_wsg_idm_ecid_wtls9, 5, &so[4974]},
-    {"wap-wsg-idm-ecid-wtls10", "wap-wsg-idm-ecid-wtls10", NID_wap_wsg_idm_ecid_wtls10, 5, &so[4979]},
-    {"wap-wsg-idm-ecid-wtls11", "wap-wsg-idm-ecid-wtls11", NID_wap_wsg_idm_ecid_wtls11, 5, &so[4984]},
-    {"wap-wsg-idm-ecid-wtls12", "wap-wsg-idm-ecid-wtls12", NID_wap_wsg_idm_ecid_wtls12, 5, &so[4989]},
-    {"anyPolicy", "X509v3 Any Policy", NID_any_policy, 4, &so[4994]},
-    {"policyMappings", "X509v3 Policy Mappings", NID_policy_mappings, 3, &so[4998]},
-    {"inhibitAnyPolicy", "X509v3 Inhibit Any Policy", NID_inhibit_any_policy, 3, &so[5001]},
-    {"Oakley-EC2N-3", "ipsec3", NID_ipsec3},
-    {"Oakley-EC2N-4", "ipsec4", NID_ipsec4},
-    {"CAMELLIA-128-CBC", "camellia-128-cbc", NID_camellia_128_cbc, 11, &so[5004]},
-    {"CAMELLIA-192-CBC", "camellia-192-cbc", NID_camellia_192_cbc, 11, &so[5015]},
-    {"CAMELLIA-256-CBC", "camellia-256-cbc", NID_camellia_256_cbc, 11, &so[5026]},
-    {"CAMELLIA-128-ECB", "camellia-128-ecb", NID_camellia_128_ecb, 8, &so[5037]},
-    {"CAMELLIA-192-ECB", "camellia-192-ecb", NID_camellia_192_ecb, 8, &so[5045]},
-    {"CAMELLIA-256-ECB", "camellia-256-ecb", NID_camellia_256_ecb, 8, &so[5053]},
-    {"CAMELLIA-128-CFB", "camellia-128-cfb", NID_camellia_128_cfb128, 8, &so[5061]},
-    {"CAMELLIA-192-CFB", "camellia-192-cfb", NID_camellia_192_cfb128, 8, &so[5069]},
-    {"CAMELLIA-256-CFB", "camellia-256-cfb", NID_camellia_256_cfb128, 8, &so[5077]},
-    {"CAMELLIA-128-CFB1", "camellia-128-cfb1", NID_camellia_128_cfb1},
-    {"CAMELLIA-192-CFB1", "camellia-192-cfb1", NID_camellia_192_cfb1},
-    {"CAMELLIA-256-CFB1", "camellia-256-cfb1", NID_camellia_256_cfb1},
-    {"CAMELLIA-128-CFB8", "camellia-128-cfb8", NID_camellia_128_cfb8},
-    {"CAMELLIA-192-CFB8", "camellia-192-cfb8", NID_camellia_192_cfb8},
-    {"CAMELLIA-256-CFB8", "camellia-256-cfb8", NID_camellia_256_cfb8},
-    {"CAMELLIA-128-OFB", "camellia-128-ofb", NID_camellia_128_ofb128, 8, &so[5085]},
-    {"CAMELLIA-192-OFB", "camellia-192-ofb", NID_camellia_192_ofb128, 8, &so[5093]},
-    {"CAMELLIA-256-OFB", "camellia-256-ofb", NID_camellia_256_ofb128, 8, &so[5101]},
-    {"subjectDirectoryAttributes", "X509v3 Subject Directory Attributes", NID_subject_directory_attributes, 3, &so[5109]},
-    {"issuingDistributionPoint", "X509v3 Issuing Distribution Point", NID_issuing_distribution_point, 3, &so[5112]},
-    {"certificateIssuer", "X509v3 Certificate Issuer", NID_certificate_issuer, 3, &so[5115]},
-    { NULL, NULL, NID_undef },
-    {"KISA", "kisa", NID_kisa, 6, &so[5118]},
-    { NULL, NULL, NID_undef },
-    { NULL, NULL, NID_undef },
-    {"SEED-ECB", "seed-ecb", NID_seed_ecb, 8, &so[5124]},
-    {"SEED-CBC", "seed-cbc", NID_seed_cbc, 8, &so[5132]},
-    {"SEED-OFB", "seed-ofb", NID_seed_ofb128, 8, &so[5140]},
-    {"SEED-CFB", "seed-cfb", NID_seed_cfb128, 8, &so[5148]},
-    {"HMAC-MD5", "hmac-md5", NID_hmac_md5, 8, &so[5156]},
-    {"HMAC-SHA1", "hmac-sha1", NID_hmac_sha1, 8, &so[5164]},
-    {"id-PasswordBasedMAC", "password based MAC", NID_id_PasswordBasedMAC, 9, &so[5172]},
-    {"id-DHBasedMac", "Diffie-Hellman based MAC", NID_id_DHBasedMac, 9, &so[5181]},
-    {"id-it-suppLangTags", "id-it-suppLangTags", NID_id_it_suppLangTags, 8, &so[5190]},
-    {"caRepository", "CA Repository", NID_caRepository, 8, &so[5198]},
-    {"id-smime-ct-compressedData", "id-smime-ct-compressedData", NID_id_smime_ct_compressedData, 11, &so[5206]},
-    {"id-ct-asciiTextWithCRLF", "id-ct-asciiTextWithCRLF", NID_id_ct_asciiTextWithCRLF, 11, &so[5217]},
-    {"id-aes128-wrap", "id-aes128-wrap", NID_id_aes128_wrap, 9, &so[5228]},
-    {"id-aes192-wrap", "id-aes192-wrap", NID_id_aes192_wrap, 9, &so[5237]},
-    {"id-aes256-wrap", "id-aes256-wrap", NID_id_aes256_wrap, 9, &so[5246]},
-    {"ecdsa-with-Recommended", "ecdsa-with-Recommended", NID_ecdsa_with_Recommended, 7, &so[5255]},
-    {"ecdsa-with-Specified", "ecdsa-with-Specified", NID_ecdsa_with_Specified, 7, &so[5262]},
-    {"ecdsa-with-SHA224", "ecdsa-with-SHA224", NID_ecdsa_with_SHA224, 8, &so[5269]},
-    {"ecdsa-with-SHA256", "ecdsa-with-SHA256", NID_ecdsa_with_SHA256, 8, &so[5277]},
-    {"ecdsa-with-SHA384", "ecdsa-with-SHA384", NID_ecdsa_with_SHA384, 8, &so[5285]},
-    {"ecdsa-with-SHA512", "ecdsa-with-SHA512", NID_ecdsa_with_SHA512, 8, &so[5293]},
-    {"hmacWithMD5", "hmacWithMD5", NID_hmacWithMD5, 8, &so[5301]},
-    {"hmacWithSHA224", "hmacWithSHA224", NID_hmacWithSHA224, 8, &so[5309]},
-    {"hmacWithSHA256", "hmacWithSHA256", NID_hmacWithSHA256, 8, &so[5317]},
-    {"hmacWithSHA384", "hmacWithSHA384", NID_hmacWithSHA384, 8, &so[5325]},
-    {"hmacWithSHA512", "hmacWithSHA512", NID_hmacWithSHA512, 8, &so[5333]},
-    {"dsa_with_SHA224", "dsa_with_SHA224", NID_dsa_with_SHA224, 9, &so[5341]},
-    {"dsa_with_SHA256", "dsa_with_SHA256", NID_dsa_with_SHA256, 9, &so[5350]},
-    {"whirlpool", "whirlpool", NID_whirlpool, 6, &so[5359]},
-    {"cryptopro", "cryptopro", NID_cryptopro, 5, &so[5365]},
-    {"cryptocom", "cryptocom", NID_cryptocom, 5, &so[5370]},
-    {"id-GostR3411-94-with-GostR3410-2001", "GOST R 34.11-94 with GOST R 34.10-2001", NID_id_GostR3411_94_with_GostR3410_2001, 6, &so[5375]},
-    {"id-GostR3411-94-with-GostR3410-94", "GOST R 34.11-94 with GOST R 34.10-94", NID_id_GostR3411_94_with_GostR3410_94, 6, &so[5381]},
-    {"md_gost94", "GOST R 34.11-94", NID_id_GostR3411_94, 6, &so[5387]},
-    {"id-HMACGostR3411-94", "HMAC GOST 34.11-94", NID_id_HMACGostR3411_94, 6, &so[5393]},
-    {"gost2001", "GOST R 34.10-2001", NID_id_GostR3410_2001, 6, &so[5399]},
-    {"gost94", "GOST R 34.10-94", NID_id_GostR3410_94, 6, &so[5405]},
-    {"gost89", "GOST 28147-89", NID_id_Gost28147_89, 6, &so[5411]},
-    {"gost89-cnt", "gost89-cnt", NID_gost89_cnt},
-    {"gost-mac", "GOST 28147-89 MAC", NID_id_Gost28147_89_MAC, 6, &so[5417]},
-    {"prf-gostr3411-94", "GOST R 34.11-94 PRF", NID_id_GostR3411_94_prf, 6, &so[5423]},
-    {"id-GostR3410-2001DH", "GOST R 34.10-2001 DH", NID_id_GostR3410_2001DH, 6, &so[5429]},
-    {"id-GostR3410-94DH", "GOST R 34.10-94 DH", NID_id_GostR3410_94DH, 6, &so[5435]},
-    {"id-Gost28147-89-CryptoPro-KeyMeshing", "id-Gost28147-89-CryptoPro-KeyMeshing", NID_id_Gost28147_89_CryptoPro_KeyMeshing, 7, &so[5441]},
-    {"id-Gost28147-89-None-KeyMeshing", "id-Gost28147-89-None-KeyMeshing", NID_id_Gost28147_89_None_KeyMeshing, 7, &so[5448]},
-    {"id-GostR3411-94-TestParamSet", "id-GostR3411-94-TestParamSet", NID_id_GostR3411_94_TestParamSet, 7, &so[5455]},
-    {"id-GostR3411-94-CryptoProParamSet", "id-GostR3411-94-CryptoProParamSet", NID_id_GostR3411_94_CryptoProParamSet, 7, &so[5462]},
-    {"id-Gost28147-89-TestParamSet", "id-Gost28147-89-TestParamSet", NID_id_Gost28147_89_TestParamSet, 7, &so[5469]},
-    {"id-Gost28147-89-CryptoPro-A-ParamSet", "id-Gost28147-89-CryptoPro-A-ParamSet", NID_id_Gost28147_89_CryptoPro_A_ParamSet, 7, &so[5476]},
-    {"id-Gost28147-89-CryptoPro-B-ParamSet", "id-Gost28147-89-CryptoPro-B-ParamSet", NID_id_Gost28147_89_CryptoPro_B_ParamSet, 7, &so[5483]},
-    {"id-Gost28147-89-CryptoPro-C-ParamSet", "id-Gost28147-89-CryptoPro-C-ParamSet", NID_id_Gost28147_89_CryptoPro_C_ParamSet, 7, &so[5490]},
-    {"id-Gost28147-89-CryptoPro-D-ParamSet", "id-Gost28147-89-CryptoPro-D-ParamSet", NID_id_Gost28147_89_CryptoPro_D_ParamSet, 7, &so[5497]},
-    {"id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet", "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet", NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet, 7, &so[5504]},
-    {"id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet", "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet", NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet, 7, &so[5511]},
-    {"id-Gost28147-89-CryptoPro-RIC-1-ParamSet", "id-Gost28147-89-CryptoPro-RIC-1-ParamSet", NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet, 7, &so[5518]},
-    {"id-GostR3410-94-TestParamSet", "id-GostR3410-94-TestParamSet", NID_id_GostR3410_94_TestParamSet, 7, &so[5525]},
-    {"id-GostR3410-94-CryptoPro-A-ParamSet", "id-GostR3410-94-CryptoPro-A-ParamSet", NID_id_GostR3410_94_CryptoPro_A_ParamSet, 7, &so[5532]},
-    {"id-GostR3410-94-CryptoPro-B-ParamSet", "id-GostR3410-94-CryptoPro-B-ParamSet", NID_id_GostR3410_94_CryptoPro_B_ParamSet, 7, &so[5539]},
-    {"id-GostR3410-94-CryptoPro-C-ParamSet", "id-GostR3410-94-CryptoPro-C-ParamSet", NID_id_GostR3410_94_CryptoPro_C_ParamSet, 7, &so[5546]},
-    {"id-GostR3410-94-CryptoPro-D-ParamSet", "id-GostR3410-94-CryptoPro-D-ParamSet", NID_id_GostR3410_94_CryptoPro_D_ParamSet, 7, &so[5553]},
-    {"id-GostR3410-94-CryptoPro-XchA-ParamSet", "id-GostR3410-94-CryptoPro-XchA-ParamSet", NID_id_GostR3410_94_CryptoPro_XchA_ParamSet, 7, &so[5560]},
-    {"id-GostR3410-94-CryptoPro-XchB-ParamSet", "id-GostR3410-94-CryptoPro-XchB-ParamSet", NID_id_GostR3410_94_CryptoPro_XchB_ParamSet, 7, &so[5567]},
-    {"id-GostR3410-94-CryptoPro-XchC-ParamSet", "id-GostR3410-94-CryptoPro-XchC-ParamSet", NID_id_GostR3410_94_CryptoPro_XchC_ParamSet, 7, &so[5574]},
-    {"id-GostR3410-2001-TestParamSet", "id-GostR3410-2001-TestParamSet", NID_id_GostR3410_2001_TestParamSet, 7, &so[5581]},
-    {"id-GostR3410-2001-CryptoPro-A-ParamSet", "id-GostR3410-2001-CryptoPro-A-ParamSet", NID_id_GostR3410_2001_CryptoPro_A_ParamSet, 7, &so[5588]},
-    {"id-GostR3410-2001-CryptoPro-B-ParamSet", "id-GostR3410-2001-CryptoPro-B-ParamSet", NID_id_GostR3410_2001_CryptoPro_B_ParamSet, 7, &so[5595]},
-    {"id-GostR3410-2001-CryptoPro-C-ParamSet", "id-GostR3410-2001-CryptoPro-C-ParamSet", NID_id_GostR3410_2001_CryptoPro_C_ParamSet, 7, &so[5602]},
-    {"id-GostR3410-2001-CryptoPro-XchA-ParamSet", "id-GostR3410-2001-CryptoPro-XchA-ParamSet", NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet, 7, &so[5609]},
-    {"id-GostR3410-2001-CryptoPro-XchB-ParamSet", "id-GostR3410-2001-CryptoPro-XchB-ParamSet", NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet, 7, &so[5616]},
-    {"id-GostR3410-94-a", "id-GostR3410-94-a", NID_id_GostR3410_94_a, 7, &so[5623]},
-    {"id-GostR3410-94-aBis", "id-GostR3410-94-aBis", NID_id_GostR3410_94_aBis, 7, &so[5630]},
-    {"id-GostR3410-94-b", "id-GostR3410-94-b", NID_id_GostR3410_94_b, 7, &so[5637]},
-    {"id-GostR3410-94-bBis", "id-GostR3410-94-bBis", NID_id_GostR3410_94_bBis, 7, &so[5644]},
-    {"id-Gost28147-89-cc", "GOST 28147-89 Cryptocom ParamSet", NID_id_Gost28147_89_cc, 8, &so[5651]},
-    {"gost94cc", "GOST 34.10-94 Cryptocom", NID_id_GostR3410_94_cc, 8, &so[5659]},
-    {"gost2001cc", "GOST 34.10-2001 Cryptocom", NID_id_GostR3410_2001_cc, 8, &so[5667]},
-    {"id-GostR3411-94-with-GostR3410-94-cc", "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom", NID_id_GostR3411_94_with_GostR3410_94_cc, 8, &so[5675]},
-    {"id-GostR3411-94-with-GostR3410-2001-cc", "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom", NID_id_GostR3411_94_with_GostR3410_2001_cc, 8, &so[5683]},
-    {"id-GostR3410-2001-ParamSet-cc", "GOST R 3410-2001 Parameter Set Cryptocom", NID_id_GostR3410_2001_ParamSet_cc, 8, &so[5691]},
-    {"HMAC", "hmac", NID_hmac},
-    {"LocalKeySet", "Microsoft Local Key set", NID_LocalKeySet, 9, &so[5699]},
-    {"freshestCRL", "X509v3 Freshest CRL", NID_freshest_crl, 3, &so[5708]},
-    {"id-on-permanentIdentifier", "Permanent Identifier", NID_id_on_permanentIdentifier, 8, &so[5711]},
-    {"searchGuide", "searchGuide", NID_searchGuide, 3, &so[5719]},
-    {"businessCategory", "businessCategory", NID_businessCategory, 3, &so[5722]},
-    {"postalAddress", "postalAddress", NID_postalAddress, 3, &so[5725]},
-    {"postOfficeBox", "postOfficeBox", NID_postOfficeBox, 3, &so[5728]},
-    {"physicalDeliveryOfficeName", "physicalDeliveryOfficeName", NID_physicalDeliveryOfficeName, 3, &so[5731]},
-    {"telephoneNumber", "telephoneNumber", NID_telephoneNumber, 3, &so[5734]},
-    {"telexNumber", "telexNumber", NID_telexNumber, 3, &so[5737]},
-    {"teletexTerminalIdentifier", "teletexTerminalIdentifier", NID_teletexTerminalIdentifier, 3, &so[5740]},
-    {"facsimileTelephoneNumber", "facsimileTelephoneNumber", NID_facsimileTelephoneNumber, 3, &so[5743]},
-    {"x121Address", "x121Address", NID_x121Address, 3, &so[5746]},
-    {"internationaliSDNNumber", "internationaliSDNNumber", NID_internationaliSDNNumber, 3, &so[5749]},
-    {"registeredAddress", "registeredAddress", NID_registeredAddress, 3, &so[5752]},
-    {"destinationIndicator", "destinationIndicator", NID_destinationIndicator, 3, &so[5755]},
-    {"preferredDeliveryMethod", "preferredDeliveryMethod", NID_preferredDeliveryMethod, 3, &so[5758]},
-    {"presentationAddress", "presentationAddress", NID_presentationAddress, 3, &so[5761]},
-    {"supportedApplicationContext", "supportedApplicationContext", NID_supportedApplicationContext, 3, &so[5764]},
-    {"member", "member", NID_member, 3, &so[5767]},
-    {"owner", "owner", NID_owner, 3, &so[5770]},
-    {"roleOccupant", "roleOccupant", NID_roleOccupant, 3, &so[5773]},
-    {"seeAlso", "seeAlso", NID_seeAlso, 3, &so[5776]},
-    {"userPassword", "userPassword", NID_userPassword, 3, &so[5779]},
-    {"userCertificate", "userCertificate", NID_userCertificate, 3, &so[5782]},
-    {"cACertificate", "cACertificate", NID_cACertificate, 3, &so[5785]},
-    {"authorityRevocationList", "authorityRevocationList", NID_authorityRevocationList, 3, &so[5788]},
-    {"certificateRevocationList", "certificateRevocationList", NID_certificateRevocationList, 3, &so[5791]},
-    {"crossCertificatePair", "crossCertificatePair", NID_crossCertificatePair, 3, &so[5794]},
-    {"enhancedSearchGuide", "enhancedSearchGuide", NID_enhancedSearchGuide, 3, &so[5797]},
-    {"protocolInformation", "protocolInformation", NID_protocolInformation, 3, &so[5800]},
-    {"distinguishedName", "distinguishedName", NID_distinguishedName, 3, &so[5803]},
-    {"uniqueMember", "uniqueMember", NID_uniqueMember, 3, &so[5806]},
-    {"houseIdentifier", "houseIdentifier", NID_houseIdentifier, 3, &so[5809]},
-    {"supportedAlgorithms", "supportedAlgorithms", NID_supportedAlgorithms, 3, &so[5812]},
-    {"deltaRevocationList", "deltaRevocationList", NID_deltaRevocationList, 3, &so[5815]},
-    {"dmdName", "dmdName", NID_dmdName, 3, &so[5818]},
-    {"id-alg-PWRI-KEK", "id-alg-PWRI-KEK", NID_id_alg_PWRI_KEK, 11, &so[5821]},
-    {"CMAC", "cmac", NID_cmac},
-    {"id-aes128-GCM", "aes-128-gcm", NID_aes_128_gcm, 9, &so[5832]},
-    {"id-aes128-CCM", "aes-128-ccm", NID_aes_128_ccm, 9, &so[5841]},
-    {"id-aes128-wrap-pad", "id-aes128-wrap-pad", NID_id_aes128_wrap_pad, 9, &so[5850]},
-    {"id-aes192-GCM", "aes-192-gcm", NID_aes_192_gcm, 9, &so[5859]},
-    {"id-aes192-CCM", "aes-192-ccm", NID_aes_192_ccm, 9, &so[5868]},
-    {"id-aes192-wrap-pad", "id-aes192-wrap-pad", NID_id_aes192_wrap_pad, 9, &so[5877]},
-    {"id-aes256-GCM", "aes-256-gcm", NID_aes_256_gcm, 9, &so[5886]},
-    {"id-aes256-CCM", "aes-256-ccm", NID_aes_256_ccm, 9, &so[5895]},
-    {"id-aes256-wrap-pad", "id-aes256-wrap-pad", NID_id_aes256_wrap_pad, 9, &so[5904]},
-    {"AES-128-CTR", "aes-128-ctr", NID_aes_128_ctr},
-    {"AES-192-CTR", "aes-192-ctr", NID_aes_192_ctr},
-    {"AES-256-CTR", "aes-256-ctr", NID_aes_256_ctr},
-    {"id-camellia128-wrap", "id-camellia128-wrap", NID_id_camellia128_wrap, 11, &so[5913]},
-    {"id-camellia192-wrap", "id-camellia192-wrap", NID_id_camellia192_wrap, 11, &so[5924]},
-    {"id-camellia256-wrap", "id-camellia256-wrap", NID_id_camellia256_wrap, 11, &so[5935]},
-    {"anyExtendedKeyUsage", "Any Extended Key Usage", NID_anyExtendedKeyUsage, 4, &so[5946]},
-    {"MGF1", "mgf1", NID_mgf1, 9, &so[5950]},
-    {"RSASSA-PSS", "rsassaPss", NID_rsassaPss, 9, &so[5959]},
-    {"AES-128-XTS", "aes-128-xts", NID_aes_128_xts, 8, &so[5968]},
-    {"AES-256-XTS", "aes-256-xts", NID_aes_256_xts, 8, &so[5976]},
-    {"RC4-HMAC-MD5", "rc4-hmac-md5", NID_rc4_hmac_md5},
-    {"AES-128-CBC-HMAC-SHA1", "aes-128-cbc-hmac-sha1", NID_aes_128_cbc_hmac_sha1},
-    {"AES-192-CBC-HMAC-SHA1", "aes-192-cbc-hmac-sha1", NID_aes_192_cbc_hmac_sha1},
-    {"AES-256-CBC-HMAC-SHA1", "aes-256-cbc-hmac-sha1", NID_aes_256_cbc_hmac_sha1},
-    {"RSAES-OAEP", "rsaesOaep", NID_rsaesOaep, 9, &so[5984]},
-    {"dhpublicnumber", "X9.42 DH", NID_dhpublicnumber, 7, &so[5993]},
-    {"brainpoolP160r1", "brainpoolP160r1", NID_brainpoolP160r1, 9, &so[6000]},
-    {"brainpoolP160t1", "brainpoolP160t1", NID_brainpoolP160t1, 9, &so[6009]},
-    {"brainpoolP192r1", "brainpoolP192r1", NID_brainpoolP192r1, 9, &so[6018]},
-    {"brainpoolP192t1", "brainpoolP192t1", NID_brainpoolP192t1, 9, &so[6027]},
-    {"brainpoolP224r1", "brainpoolP224r1", NID_brainpoolP224r1, 9, &so[6036]},
-    {"brainpoolP224t1", "brainpoolP224t1", NID_brainpoolP224t1, 9, &so[6045]},
-    {"brainpoolP256r1", "brainpoolP256r1", NID_brainpoolP256r1, 9, &so[6054]},
-    {"brainpoolP256t1", "brainpoolP256t1", NID_brainpoolP256t1, 9, &so[6063]},
-    {"brainpoolP320r1", "brainpoolP320r1", NID_brainpoolP320r1, 9, &so[6072]},
-    {"brainpoolP320t1", "brainpoolP320t1", NID_brainpoolP320t1, 9, &so[6081]},
-    {"brainpoolP384r1", "brainpoolP384r1", NID_brainpoolP384r1, 9, &so[6090]},
-    {"brainpoolP384t1", "brainpoolP384t1", NID_brainpoolP384t1, 9, &so[6099]},
-    {"brainpoolP512r1", "brainpoolP512r1", NID_brainpoolP512r1, 9, &so[6108]},
-    {"brainpoolP512t1", "brainpoolP512t1", NID_brainpoolP512t1, 9, &so[6117]},
-    {"PSPECIFIED", "pSpecified", NID_pSpecified, 9, &so[6126]},
-    {"dhSinglePass-stdDH-sha1kdf-scheme", "dhSinglePass-stdDH-sha1kdf-scheme", NID_dhSinglePass_stdDH_sha1kdf_scheme, 9, &so[6135]},
-    {"dhSinglePass-stdDH-sha224kdf-scheme", "dhSinglePass-stdDH-sha224kdf-scheme", NID_dhSinglePass_stdDH_sha224kdf_scheme, 6, &so[6144]},
-    {"dhSinglePass-stdDH-sha256kdf-scheme", "dhSinglePass-stdDH-sha256kdf-scheme", NID_dhSinglePass_stdDH_sha256kdf_scheme, 6, &so[6150]},
-    {"dhSinglePass-stdDH-sha384kdf-scheme", "dhSinglePass-stdDH-sha384kdf-scheme", NID_dhSinglePass_stdDH_sha384kdf_scheme, 6, &so[6156]},
-    {"dhSinglePass-stdDH-sha512kdf-scheme", "dhSinglePass-stdDH-sha512kdf-scheme", NID_dhSinglePass_stdDH_sha512kdf_scheme, 6, &so[6162]},
-    {"dhSinglePass-cofactorDH-sha1kdf-scheme", "dhSinglePass-cofactorDH-sha1kdf-scheme", NID_dhSinglePass_cofactorDH_sha1kdf_scheme, 9, &so[6168]},
-    {"dhSinglePass-cofactorDH-sha224kdf-scheme", "dhSinglePass-cofactorDH-sha224kdf-scheme", NID_dhSinglePass_cofactorDH_sha224kdf_scheme, 6, &so[6177]},
-    {"dhSinglePass-cofactorDH-sha256kdf-scheme", "dhSinglePass-cofactorDH-sha256kdf-scheme", NID_dhSinglePass_cofactorDH_sha256kdf_scheme, 6, &so[6183]},
-    {"dhSinglePass-cofactorDH-sha384kdf-scheme", "dhSinglePass-cofactorDH-sha384kdf-scheme", NID_dhSinglePass_cofactorDH_sha384kdf_scheme, 6, &so[6189]},
-    {"dhSinglePass-cofactorDH-sha512kdf-scheme", "dhSinglePass-cofactorDH-sha512kdf-scheme", NID_dhSinglePass_cofactorDH_sha512kdf_scheme, 6, &so[6195]},
-    {"dh-std-kdf", "dh-std-kdf", NID_dh_std_kdf},
-    {"dh-cofactor-kdf", "dh-cofactor-kdf", NID_dh_cofactor_kdf},
-    {"AES-128-CBC-HMAC-SHA256", "aes-128-cbc-hmac-sha256", NID_aes_128_cbc_hmac_sha256},
-    {"AES-192-CBC-HMAC-SHA256", "aes-192-cbc-hmac-sha256", NID_aes_192_cbc_hmac_sha256},
-    {"AES-256-CBC-HMAC-SHA256", "aes-256-cbc-hmac-sha256", NID_aes_256_cbc_hmac_sha256},
-    {"ct_precert_scts", "CT Precertificate SCTs", NID_ct_precert_scts, 10, &so[6201]},
-    {"ct_precert_poison", "CT Precertificate Poison", NID_ct_precert_poison, 10, &so[6211]},
-    {"ct_precert_signer", "CT Precertificate Signer", NID_ct_precert_signer, 10, &so[6221]},
-    {"ct_cert_scts", "CT Certificate SCTs", NID_ct_cert_scts, 10, &so[6231]},
-    {"jurisdictionL", "jurisdictionLocalityName", NID_jurisdictionLocalityName, 11, &so[6241]},
-    {"jurisdictionST", "jurisdictionStateOrProvinceName", NID_jurisdictionStateOrProvinceName, 11, &so[6252]},
-    {"jurisdictionC", "jurisdictionCountryName", NID_jurisdictionCountryName, 11, &so[6263]},
-    {"AES-128-OCB", "aes-128-ocb", NID_aes_128_ocb},
-    {"AES-192-OCB", "aes-192-ocb", NID_aes_192_ocb},
-    {"AES-256-OCB", "aes-256-ocb", NID_aes_256_ocb},
-    {"CAMELLIA-128-GCM", "camellia-128-gcm", NID_camellia_128_gcm, 8, &so[6274]},
-    {"CAMELLIA-128-CCM", "camellia-128-ccm", NID_camellia_128_ccm, 8, &so[6282]},
-    {"CAMELLIA-128-CTR", "camellia-128-ctr", NID_camellia_128_ctr, 8, &so[6290]},
-    {"CAMELLIA-128-CMAC", "camellia-128-cmac", NID_camellia_128_cmac, 8, &so[6298]},
-    {"CAMELLIA-192-GCM", "camellia-192-gcm", NID_camellia_192_gcm, 8, &so[6306]},
-    {"CAMELLIA-192-CCM", "camellia-192-ccm", NID_camellia_192_ccm, 8, &so[6314]},
-    {"CAMELLIA-192-CTR", "camellia-192-ctr", NID_camellia_192_ctr, 8, &so[6322]},
-    {"CAMELLIA-192-CMAC", "camellia-192-cmac", NID_camellia_192_cmac, 8, &so[6330]},
-    {"CAMELLIA-256-GCM", "camellia-256-gcm", NID_camellia_256_gcm, 8, &so[6338]},
-    {"CAMELLIA-256-CCM", "camellia-256-ccm", NID_camellia_256_ccm, 8, &so[6346]},
-    {"CAMELLIA-256-CTR", "camellia-256-ctr", NID_camellia_256_ctr, 8, &so[6354]},
-    {"CAMELLIA-256-CMAC", "camellia-256-cmac", NID_camellia_256_cmac, 8, &so[6362]},
-    {"id-scrypt", "scrypt", NID_id_scrypt, 9, &so[6370]},
-    {"id-tc26", "id-tc26", NID_id_tc26, 5, &so[6379]},
-    {"gost89-cnt-12", "gost89-cnt-12", NID_gost89_cnt_12},
-    {"gost-mac-12", "gost-mac-12", NID_gost_mac_12},
-    {"id-tc26-algorithms", "id-tc26-algorithms", NID_id_tc26_algorithms, 6, &so[6384]},
-    {"id-tc26-sign", "id-tc26-sign", NID_id_tc26_sign, 7, &so[6390]},
-    {"gost2012_256", "GOST R 34.10-2012 with 256 bit modulus", NID_id_GostR3410_2012_256, 8, &so[6397]},
-    {"gost2012_512", "GOST R 34.10-2012 with 512 bit modulus", NID_id_GostR3410_2012_512, 8, &so[6405]},
-    {"id-tc26-digest", "id-tc26-digest", NID_id_tc26_digest, 7, &so[6413]},
-    {"md_gost12_256", "GOST R 34.11-2012 with 256 bit hash", NID_id_GostR3411_2012_256, 8, &so[6420]},
-    {"md_gost12_512", "GOST R 34.11-2012 with 512 bit hash", NID_id_GostR3411_2012_512, 8, &so[6428]},
-    {"id-tc26-signwithdigest", "id-tc26-signwithdigest", NID_id_tc26_signwithdigest, 7, &so[6436]},
-    {"id-tc26-signwithdigest-gost3410-2012-256", "GOST R 34.10-2012 with GOST R 34.11-2012 (256 bit)", NID_id_tc26_signwithdigest_gost3410_2012_256, 8, &so[6443]},
-    {"id-tc26-signwithdigest-gost3410-2012-512", "GOST R 34.10-2012 with GOST R 34.11-2012 (512 bit)", NID_id_tc26_signwithdigest_gost3410_2012_512, 8, &so[6451]},
-    {"id-tc26-mac", "id-tc26-mac", NID_id_tc26_mac, 7, &so[6459]},
-    {"id-tc26-hmac-gost-3411-2012-256", "HMAC GOST 34.11-2012 256 bit", NID_id_tc26_hmac_gost_3411_2012_256, 8, &so[6466]},
-    {"id-tc26-hmac-gost-3411-2012-512", "HMAC GOST 34.11-2012 512 bit", NID_id_tc26_hmac_gost_3411_2012_512, 8, &so[6474]},
-    {"id-tc26-cipher", "id-tc26-cipher", NID_id_tc26_cipher, 7, &so[6482]},
-    {"id-tc26-agreement", "id-tc26-agreement", NID_id_tc26_agreement, 7, &so[6489]},
-    {"id-tc26-agreement-gost-3410-2012-256", "id-tc26-agreement-gost-3410-2012-256", NID_id_tc26_agreement_gost_3410_2012_256, 8, &so[6496]},
-    {"id-tc26-agreement-gost-3410-2012-512", "id-tc26-agreement-gost-3410-2012-512", NID_id_tc26_agreement_gost_3410_2012_512, 8, &so[6504]},
-    {"id-tc26-constants", "id-tc26-constants", NID_id_tc26_constants, 6, &so[6512]},
-    {"id-tc26-sign-constants", "id-tc26-sign-constants", NID_id_tc26_sign_constants, 7, &so[6518]},
-    {"id-tc26-gost-3410-2012-512-constants", "id-tc26-gost-3410-2012-512-constants", NID_id_tc26_gost_3410_2012_512_constants, 8, &so[6525]},
-    {"id-tc26-gost-3410-2012-512-paramSetTest", "GOST R 34.10-2012 (512 bit) testing parameter set", NID_id_tc26_gost_3410_2012_512_paramSetTest, 9, &so[6533]},
-    {"id-tc26-gost-3410-2012-512-paramSetA", "GOST R 34.10-2012 (512 bit) ParamSet A", NID_id_tc26_gost_3410_2012_512_paramSetA, 9, &so[6542]},
-    {"id-tc26-gost-3410-2012-512-paramSetB", "GOST R 34.10-2012 (512 bit) ParamSet B", NID_id_tc26_gost_3410_2012_512_paramSetB, 9, &so[6551]},
-    {"id-tc26-digest-constants", "id-tc26-digest-constants", NID_id_tc26_digest_constants, 7, &so[6560]},
-    {"id-tc26-cipher-constants", "id-tc26-cipher-constants", NID_id_tc26_cipher_constants, 7, &so[6567]},
-    {"id-tc26-gost-28147-constants", "id-tc26-gost-28147-constants", NID_id_tc26_gost_28147_constants, 8, &so[6574]},
-    {"id-tc26-gost-28147-param-Z", "GOST 28147-89 TC26 parameter set", NID_id_tc26_gost_28147_param_Z, 9, &so[6582]},
-    {"INN", "INN", NID_INN, 8, &so[6591]},
-    {"OGRN", "OGRN", NID_OGRN, 5, &so[6599]},
-    {"SNILS", "SNILS", NID_SNILS, 5, &so[6604]},
-    {"subjectSignTool", "Signing Tool of Subject", NID_subjectSignTool, 5, &so[6609]},
-    {"issuerSignTool", "Signing Tool of Issuer", NID_issuerSignTool, 5, &so[6614]},
-    {"gost89-cbc", "gost89-cbc", NID_gost89_cbc},
-    {"gost89-ecb", "gost89-ecb", NID_gost89_ecb},
-    {"gost89-ctr", "gost89-ctr", NID_gost89_ctr},
-    {"kuznyechik-ecb", "kuznyechik-ecb", NID_kuznyechik_ecb},
-    {"kuznyechik-ctr", "kuznyechik-ctr", NID_kuznyechik_ctr},
-    {"kuznyechik-ofb", "kuznyechik-ofb", NID_kuznyechik_ofb},
-    {"kuznyechik-cbc", "kuznyechik-cbc", NID_kuznyechik_cbc},
-    {"kuznyechik-cfb", "kuznyechik-cfb", NID_kuznyechik_cfb},
-    {"kuznyechik-mac", "kuznyechik-mac", NID_kuznyechik_mac},
-    {"ChaCha20-Poly1305", "chacha20-poly1305", NID_chacha20_poly1305},
-    {"ChaCha20", "chacha20", NID_chacha20},
-    {"tlsfeature", "TLS Feature", NID_tlsfeature, 8, &so[6619]},
-    {"TLS1-PRF", "tls1-prf", NID_tls1_prf},
-    {"ipsecIKE", "ipsec Internet Key Exchange", NID_ipsec_IKE, 8, &so[6627]},
-    {"capwapAC", "Ctrl/provision WAP Access", NID_capwapAC, 8, &so[6635]},
-    {"capwapWTP", "Ctrl/Provision WAP Termination", NID_capwapWTP, 8, &so[6643]},
-    {"secureShellClient", "SSH Client", NID_sshClient, 8, &so[6651]},
-    {"secureShellServer", "SSH Server", NID_sshServer, 8, &so[6659]},
-    {"sendRouter", "Send Router", NID_sendRouter, 8, &so[6667]},
-    {"sendProxiedRouter", "Send Proxied Router", NID_sendProxiedRouter, 8, &so[6675]},
-    {"sendOwner", "Send Owner", NID_sendOwner, 8, &so[6683]},
-    {"sendProxiedOwner", "Send Proxied Owner", NID_sendProxiedOwner, 8, &so[6691]},
-    {"id-pkinit", "id-pkinit", NID_id_pkinit, 6, &so[6699]},
-    {"pkInitClientAuth", "PKINIT Client Auth", NID_pkInitClientAuth, 7, &so[6705]},
-    {"pkInitKDC", "Signing KDC Response", NID_pkInitKDC, 7, &so[6712]},
-    {"X25519", "X25519", NID_X25519, 3, &so[6719]},
-    {"X448", "X448", NID_X448, 3, &so[6722]},
-    {"HKDF", "hkdf", NID_hkdf},
-    {"KxRSA", "kx-rsa", NID_kx_rsa},
-    {"KxECDHE", "kx-ecdhe", NID_kx_ecdhe},
-    {"KxDHE", "kx-dhe", NID_kx_dhe},
-    {"KxECDHE-PSK", "kx-ecdhe-psk", NID_kx_ecdhe_psk},
-    {"KxDHE-PSK", "kx-dhe-psk", NID_kx_dhe_psk},
-    {"KxRSA_PSK", "kx-rsa-psk", NID_kx_rsa_psk},
-    {"KxPSK", "kx-psk", NID_kx_psk},
-    {"KxSRP", "kx-srp", NID_kx_srp},
-    {"KxGOST", "kx-gost", NID_kx_gost},
-    {"AuthRSA", "auth-rsa", NID_auth_rsa},
-    {"AuthECDSA", "auth-ecdsa", NID_auth_ecdsa},
-    {"AuthPSK", "auth-psk", NID_auth_psk},
-    {"AuthDSS", "auth-dss", NID_auth_dss},
-    {"AuthGOST01", "auth-gost01", NID_auth_gost01},
-    {"AuthGOST12", "auth-gost12", NID_auth_gost12},
-    {"AuthSRP", "auth-srp", NID_auth_srp},
-    {"AuthNULL", "auth-null", NID_auth_null},
-    { NULL, NULL, NID_undef },
-    { NULL, NULL, NID_undef },
-    {"BLAKE2b512", "blake2b512", NID_blake2b512, 11, &so[6725]},
-    {"BLAKE2s256", "blake2s256", NID_blake2s256, 11, &so[6736]},
-    {"id-smime-ct-contentCollection", "id-smime-ct-contentCollection", NID_id_smime_ct_contentCollection, 11, &so[6747]},
-    {"id-smime-ct-authEnvelopedData", "id-smime-ct-authEnvelopedData", NID_id_smime_ct_authEnvelopedData, 11, &so[6758]},
-    {"id-ct-xml", "id-ct-xml", NID_id_ct_xml, 11, &so[6769]},
-    {"Poly1305", "poly1305", NID_poly1305},
-    {"SipHash", "siphash", NID_siphash},
-    {"KxANY", "kx-any", NID_kx_any},
-    {"AuthANY", "auth-any", NID_auth_any},
-    {"ARIA-128-ECB", "aria-128-ecb", NID_aria_128_ecb, 9, &so[6780]},
-    {"ARIA-128-CBC", "aria-128-cbc", NID_aria_128_cbc, 9, &so[6789]},
-    {"ARIA-128-CFB", "aria-128-cfb", NID_aria_128_cfb128, 9, &so[6798]},
-    {"ARIA-128-OFB", "aria-128-ofb", NID_aria_128_ofb128, 9, &so[6807]},
-    {"ARIA-128-CTR", "aria-128-ctr", NID_aria_128_ctr, 9, &so[6816]},
-    {"ARIA-192-ECB", "aria-192-ecb", NID_aria_192_ecb, 9, &so[6825]},
-    {"ARIA-192-CBC", "aria-192-cbc", NID_aria_192_cbc, 9, &so[6834]},
-    {"ARIA-192-CFB", "aria-192-cfb", NID_aria_192_cfb128, 9, &so[6843]},
-    {"ARIA-192-OFB", "aria-192-ofb", NID_aria_192_ofb128, 9, &so[6852]},
-    {"ARIA-192-CTR", "aria-192-ctr", NID_aria_192_ctr, 9, &so[6861]},
-    {"ARIA-256-ECB", "aria-256-ecb", NID_aria_256_ecb, 9, &so[6870]},
-    {"ARIA-256-CBC", "aria-256-cbc", NID_aria_256_cbc, 9, &so[6879]},
-    {"ARIA-256-CFB", "aria-256-cfb", NID_aria_256_cfb128, 9, &so[6888]},
-    {"ARIA-256-OFB", "aria-256-ofb", NID_aria_256_ofb128, 9, &so[6897]},
-    {"ARIA-256-CTR", "aria-256-ctr", NID_aria_256_ctr, 9, &so[6906]},
-    {"ARIA-128-CFB1", "aria-128-cfb1", NID_aria_128_cfb1},
-    {"ARIA-192-CFB1", "aria-192-cfb1", NID_aria_192_cfb1},
-    {"ARIA-256-CFB1", "aria-256-cfb1", NID_aria_256_cfb1},
-    {"ARIA-128-CFB8", "aria-128-cfb8", NID_aria_128_cfb8},
-    {"ARIA-192-CFB8", "aria-192-cfb8", NID_aria_192_cfb8},
-    {"ARIA-256-CFB8", "aria-256-cfb8", NID_aria_256_cfb8},
-    {"id-smime-aa-signingCertificateV2", "id-smime-aa-signingCertificateV2", NID_id_smime_aa_signingCertificateV2, 11, &so[6915]},
-    {"ED25519", "ED25519", NID_ED25519, 3, &so[6926]},
-    {"ED448", "ED448", NID_ED448, 3, &so[6929]},
-    {"organizationIdentifier", "organizationIdentifier", NID_organizationIdentifier, 3, &so[6932]},
-    {"c3", "countryCode3c", NID_countryCode3c, 3, &so[6935]},
-    {"n3", "countryCode3n", NID_countryCode3n, 3, &so[6938]},
-    {"dnsName", "dnsName", NID_dnsName, 3, &so[6941]},
-    {"x509ExtAdmission", "Professional Information or basis for Admission", NID_x509ExtAdmission, 5, &so[6944]},
-    {"SHA512-224", "sha512-224", NID_sha512_224, 9, &so[6949]},
-    {"SHA512-256", "sha512-256", NID_sha512_256, 9, &so[6958]},
-    {"SHA3-224", "sha3-224", NID_sha3_224, 9, &so[6967]},
-    {"SHA3-256", "sha3-256", NID_sha3_256, 9, &so[6976]},
-    {"SHA3-384", "sha3-384", NID_sha3_384, 9, &so[6985]},
-    {"SHA3-512", "sha3-512", NID_sha3_512, 9, &so[6994]},
-    {"SHAKE128", "shake128", NID_shake128, 9, &so[7003]},
-    {"SHAKE256", "shake256", NID_shake256, 9, &so[7012]},
-    {"id-hmacWithSHA3-224", "hmac-sha3-224", NID_hmac_sha3_224, 9, &so[7021]},
-    {"id-hmacWithSHA3-256", "hmac-sha3-256", NID_hmac_sha3_256, 9, &so[7030]},
-    {"id-hmacWithSHA3-384", "hmac-sha3-384", NID_hmac_sha3_384, 9, &so[7039]},
-    {"id-hmacWithSHA3-512", "hmac-sha3-512", NID_hmac_sha3_512, 9, &so[7048]},
-    {"id-dsa-with-sha384", "dsa_with_SHA384", NID_dsa_with_SHA384, 9, &so[7057]},
-    {"id-dsa-with-sha512", "dsa_with_SHA512", NID_dsa_with_SHA512, 9, &so[7066]},
-    {"id-dsa-with-sha3-224", "dsa_with_SHA3-224", NID_dsa_with_SHA3_224, 9, &so[7075]},
-    {"id-dsa-with-sha3-256", "dsa_with_SHA3-256", NID_dsa_with_SHA3_256, 9, &so[7084]},
-    {"id-dsa-with-sha3-384", "dsa_with_SHA3-384", NID_dsa_with_SHA3_384, 9, &so[7093]},
-    {"id-dsa-with-sha3-512", "dsa_with_SHA3-512", NID_dsa_with_SHA3_512, 9, &so[7102]},
-    {"id-ecdsa-with-sha3-224", "ecdsa_with_SHA3-224", NID_ecdsa_with_SHA3_224, 9, &so[7111]},
-    {"id-ecdsa-with-sha3-256", "ecdsa_with_SHA3-256", NID_ecdsa_with_SHA3_256, 9, &so[7120]},
-    {"id-ecdsa-with-sha3-384", "ecdsa_with_SHA3-384", NID_ecdsa_with_SHA3_384, 9, &so[7129]},
-    {"id-ecdsa-with-sha3-512", "ecdsa_with_SHA3-512", NID_ecdsa_with_SHA3_512, 9, &so[7138]},
-    {"id-rsassa-pkcs1-v1_5-with-sha3-224", "RSA-SHA3-224", NID_RSA_SHA3_224, 9, &so[7147]},
-    {"id-rsassa-pkcs1-v1_5-with-sha3-256", "RSA-SHA3-256", NID_RSA_SHA3_256, 9, &so[7156]},
-    {"id-rsassa-pkcs1-v1_5-with-sha3-384", "RSA-SHA3-384", NID_RSA_SHA3_384, 9, &so[7165]},
-    {"id-rsassa-pkcs1-v1_5-with-sha3-512", "RSA-SHA3-512", NID_RSA_SHA3_512, 9, &so[7174]},
-    {"ARIA-128-CCM", "aria-128-ccm", NID_aria_128_ccm, 9, &so[7183]},
-    {"ARIA-192-CCM", "aria-192-ccm", NID_aria_192_ccm, 9, &so[7192]},
-    {"ARIA-256-CCM", "aria-256-ccm", NID_aria_256_ccm, 9, &so[7201]},
-    {"ARIA-128-GCM", "aria-128-gcm", NID_aria_128_gcm, 9, &so[7210]},
-    {"ARIA-192-GCM", "aria-192-gcm", NID_aria_192_gcm, 9, &so[7219]},
-    {"ARIA-256-GCM", "aria-256-gcm", NID_aria_256_gcm, 9, &so[7228]},
-    {"ffdhe2048", "ffdhe2048", NID_ffdhe2048},
-    {"ffdhe3072", "ffdhe3072", NID_ffdhe3072},
-    {"ffdhe4096", "ffdhe4096", NID_ffdhe4096},
-    {"ffdhe6144", "ffdhe6144", NID_ffdhe6144},
-    {"ffdhe8192", "ffdhe8192", NID_ffdhe8192},
-    {"cmcCA", "CMC Certificate Authority", NID_cmcCA, 8, &so[7237]},
-    {"cmcRA", "CMC Registration Authority", NID_cmcRA, 8, &so[7245]},
-    {"SM4-ECB", "sm4-ecb", NID_sm4_ecb, 8, &so[7253]},
-    {"SM4-CBC", "sm4-cbc", NID_sm4_cbc, 8, &so[7261]},
-    {"SM4-OFB", "sm4-ofb", NID_sm4_ofb128, 8, &so[7269]},
-    {"SM4-CFB1", "sm4-cfb1", NID_sm4_cfb1, 8, &so[7277]},
-    {"SM4-CFB", "sm4-cfb", NID_sm4_cfb128, 8, &so[7285]},
-    {"SM4-CFB8", "sm4-cfb8", NID_sm4_cfb8, 8, &so[7293]},
-    {"SM4-CTR", "sm4-ctr", NID_sm4_ctr, 8, &so[7301]},
-    {"ISO-CN", "ISO CN Member Body", NID_ISO_CN, 3, &so[7309]},
-    {"oscca", "oscca", NID_oscca, 5, &so[7312]},
-    {"sm-scheme", "sm-scheme", NID_sm_scheme, 6, &so[7317]},
-    {"SM3", "sm3", NID_sm3, 8, &so[7323]},
-    {"RSA-SM3", "sm3WithRSAEncryption", NID_sm3WithRSAEncryption, 8, &so[7331]},
-    {"RSA-SHA512/224", "sha512-224WithRSAEncryption", NID_sha512_224WithRSAEncryption, 9, &so[7339]},
-    {"RSA-SHA512/256", "sha512-256WithRSAEncryption", NID_sha512_256WithRSAEncryption, 9, &so[7348]},
-    {"id-tc26-gost-3410-2012-256-constants", "id-tc26-gost-3410-2012-256-constants", NID_id_tc26_gost_3410_2012_256_constants, 8, &so[7357]},
-    {"id-tc26-gost-3410-2012-256-paramSetA", "GOST R 34.10-2012 (256 bit) ParamSet A", NID_id_tc26_gost_3410_2012_256_paramSetA, 9, &so[7365]},
-    {"id-tc26-gost-3410-2012-512-paramSetC", "GOST R 34.10-2012 (512 bit) ParamSet C", NID_id_tc26_gost_3410_2012_512_paramSetC, 9, &so[7374]},
-    {"ISO-UA", "ISO-UA", NID_ISO_UA, 3, &so[7383]},
-    {"ua-pki", "ua-pki", NID_ua_pki, 7, &so[7386]},
-    {"dstu28147", "DSTU Gost 28147-2009", NID_dstu28147, 10, &so[7393]},
-    {"dstu28147-ofb", "DSTU Gost 28147-2009 OFB mode", NID_dstu28147_ofb, 11, &so[7403]},
-    {"dstu28147-cfb", "DSTU Gost 28147-2009 CFB mode", NID_dstu28147_cfb, 11, &so[7414]},
-    {"dstu28147-wrap", "DSTU Gost 28147-2009 key wrap", NID_dstu28147_wrap, 11, &so[7425]},
-    {"hmacWithDstu34311", "HMAC DSTU Gost 34311-95", NID_hmacWithDstu34311, 10, &so[7436]},
-    {"dstu34311", "DSTU Gost 34311-95", NID_dstu34311, 10, &so[7446]},
-    {"dstu4145le", "DSTU 4145-2002 little endian", NID_dstu4145le, 11, &so[7456]},
-    {"dstu4145be", "DSTU 4145-2002 big endian", NID_dstu4145be, 13, &so[7467]},
-    {"uacurve0", "DSTU curve 0", NID_uacurve0, 13, &so[7480]},
-    {"uacurve1", "DSTU curve 1", NID_uacurve1, 13, &so[7493]},
-    {"uacurve2", "DSTU curve 2", NID_uacurve2, 13, &so[7506]},
-    {"uacurve3", "DSTU curve 3", NID_uacurve3, 13, &so[7519]},
-    {"uacurve4", "DSTU curve 4", NID_uacurve4, 13, &so[7532]},
-    {"uacurve5", "DSTU curve 5", NID_uacurve5, 13, &so[7545]},
-    {"uacurve6", "DSTU curve 6", NID_uacurve6, 13, &so[7558]},
-    {"uacurve7", "DSTU curve 7", NID_uacurve7, 13, &so[7571]},
-    {"uacurve8", "DSTU curve 8", NID_uacurve8, 13, &so[7584]},
-    {"uacurve9", "DSTU curve 9", NID_uacurve9, 13, &so[7597]},
-    {"ieee", "ieee", NID_ieee, 2, &so[7610]},
-    {"ieee-siswg", "IEEE Security in Storage Working Group", NID_ieee_siswg, 5, &so[7612]},
-    {"SM2", "sm2", NID_sm2, 8, &so[7617]},
-    {"id-tc26-cipher-gostr3412-2015-magma", "id-tc26-cipher-gostr3412-2015-magma", NID_id_tc26_cipher_gostr3412_2015_magma, 8, &so[7625]},
-    {"magma-ctr-acpkm", "magma-ctr-acpkm", NID_magma_ctr_acpkm, 9, &so[7633]},
-    {"magma-ctr-acpkm-omac", "magma-ctr-acpkm-omac", NID_magma_ctr_acpkm_omac, 9, &so[7642]},
-    {"id-tc26-cipher-gostr3412-2015-kuznyechik", "id-tc26-cipher-gostr3412-2015-kuznyechik", NID_id_tc26_cipher_gostr3412_2015_kuznyechik, 8, &so[7651]},
-    {"kuznyechik-ctr-acpkm", "kuznyechik-ctr-acpkm", NID_kuznyechik_ctr_acpkm, 9, &so[7659]},
-    {"kuznyechik-ctr-acpkm-omac", "kuznyechik-ctr-acpkm-omac", NID_kuznyechik_ctr_acpkm_omac, 9, &so[7668]},
-    {"id-tc26-wrap", "id-tc26-wrap", NID_id_tc26_wrap, 7, &so[7677]},
-    {"id-tc26-wrap-gostr3412-2015-magma", "id-tc26-wrap-gostr3412-2015-magma", NID_id_tc26_wrap_gostr3412_2015_magma, 8, &so[7684]},
-    {"magma-kexp15", "magma-kexp15", NID_magma_kexp15, 9, &so[7692]},
-    {"id-tc26-wrap-gostr3412-2015-kuznyechik", "id-tc26-wrap-gostr3412-2015-kuznyechik", NID_id_tc26_wrap_gostr3412_2015_kuznyechik, 8, &so[7701]},
-    {"kuznyechik-kexp15", "kuznyechik-kexp15", NID_kuznyechik_kexp15, 9, &so[7709]},
-    {"id-tc26-gost-3410-2012-256-paramSetB", "GOST R 34.10-2012 (256 bit) ParamSet B", NID_id_tc26_gost_3410_2012_256_paramSetB, 9, &so[7718]},
-    {"id-tc26-gost-3410-2012-256-paramSetC", "GOST R 34.10-2012 (256 bit) ParamSet C", NID_id_tc26_gost_3410_2012_256_paramSetC, 9, &so[7727]},
-    {"id-tc26-gost-3410-2012-256-paramSetD", "GOST R 34.10-2012 (256 bit) ParamSet D", NID_id_tc26_gost_3410_2012_256_paramSetD, 9, &so[7736]},
-    {"magma-ecb", "magma-ecb", NID_magma_ecb},
-    {"magma-ctr", "magma-ctr", NID_magma_ctr},
-    {"magma-ofb", "magma-ofb", NID_magma_ofb},
-    {"magma-cbc", "magma-cbc", NID_magma_cbc},
-    {"magma-cfb", "magma-cfb", NID_magma_cfb},
-    {"magma-mac", "magma-mac", NID_magma_mac},
-    {"hmacWithSHA512-224", "hmacWithSHA512-224", NID_hmacWithSHA512_224, 8, &so[7745]},
-    {"hmacWithSHA512-256", "hmacWithSHA512-256", NID_hmacWithSHA512_256, 8, &so[7753]},
-    {"GMAC", "gmac", NID_gmac, 5, &so[7761]},
-    {"KMAC128", "kmac128", NID_kmac128, 9, &so[7766]},
-    {"KMAC256", "kmac256", NID_kmac256, 9, &so[7775]},
-    {"AES-128-SIV", "aes-128-siv", NID_aes_128_siv},
-    {"AES-192-SIV", "aes-192-siv", NID_aes_192_siv},
-    {"AES-256-SIV", "aes-256-siv", NID_aes_256_siv},
-    {"BLAKE2BMAC", "blake2bmac", NID_blake2bmac, 10, &so[7784]},
-    {"BLAKE2SMAC", "blake2smac", NID_blake2smac, 10, &so[7794]},
-    {"SSHKDF", "sshkdf", NID_sshkdf},
-    {"SM2-SM3", "SM2-with-SM3", NID_SM2_with_SM3, 8, &so[7804]},
-    {"SSKDF", "sskdf", NID_sskdf},
-    {"X963KDF", "x963kdf", NID_x963kdf},
-    {"X942KDF", "x942kdf", NID_x942kdf},
-    {"id-on-SmtpUTF8Mailbox", "Smtp UTF8 Mailbox", NID_id_on_SmtpUTF8Mailbox, 8, &so[7812]},
-    {"id-on-xmppAddr", "XmppAddr", NID_XmppAddr, 8, &so[7820]},
-    {"id-on-dnsSRV", "SRVName", NID_SRVName, 8, &so[7828]},
-    {"id-on-NAIRealm", "NAIRealm", NID_NAIRealm, 8, &so[7836]},
-    {"modp_1536", "modp_1536", NID_modp_1536},
-    {"modp_2048", "modp_2048", NID_modp_2048},
-    {"modp_3072", "modp_3072", NID_modp_3072},
-    {"modp_4096", "modp_4096", NID_modp_4096},
-    {"modp_6144", "modp_6144", NID_modp_6144},
-    {"modp_8192", "modp_8192", NID_modp_8192},
-    {"KxGOST18", "kx-gost18", NID_kx_gost18},
-    {"cmcArchive", "CMC Archive Server", NID_cmcArchive, 8, &so[7844]},
-    {"id-kp-bgpsec-router", "BGPsec Router", NID_id_kp_bgpsec_router, 8, &so[7852]},
-    {"id-kp-BrandIndicatorforMessageIdentification", "Brand Indicator for Message Identification", NID_id_kp_BrandIndicatorforMessageIdentification, 8, &so[7860]},
-    {"cmKGA", "Certificate Management Key Generation Authority", NID_cmKGA, 8, &so[7868]},
-    {"id-it-caCerts", "id-it-caCerts", NID_id_it_caCerts, 8, &so[7876]},
-    {"id-it-rootCaKeyUpdate", "id-it-rootCaKeyUpdate", NID_id_it_rootCaKeyUpdate, 8, &so[7884]},
-    {"id-it-certReqTemplate", "id-it-certReqTemplate", NID_id_it_certReqTemplate, 8, &so[7892]},
-    {"OGRNIP", "OGRNIP", NID_OGRNIP, 5, &so[7900]},
-    {"classSignTool", "Class of Signing Tool", NID_classSignTool, 5, &so[7905]},
-    {"classSignToolKC1", "Class of Signing Tool KC1", NID_classSignToolKC1, 6, &so[7910]},
-    {"classSignToolKC2", "Class of Signing Tool KC2", NID_classSignToolKC2, 6, &so[7916]},
-    {"classSignToolKC3", "Class of Signing Tool KC3", NID_classSignToolKC3, 6, &so[7922]},
-    {"classSignToolKB1", "Class of Signing Tool KB1", NID_classSignToolKB1, 6, &so[7928]},
-    {"classSignToolKB2", "Class of Signing Tool KB2", NID_classSignToolKB2, 6, &so[7934]},
-    {"classSignToolKA1", "Class of Signing Tool KA1", NID_classSignToolKA1, 6, &so[7940]},
-    {"id-ct-routeOriginAuthz", "id-ct-routeOriginAuthz", NID_id_ct_routeOriginAuthz, 11, &so[7946]},
-    {"id-ct-rpkiManifest", "id-ct-rpkiManifest", NID_id_ct_rpkiManifest, 11, &so[7957]},
-    {"id-ct-rpkiGhostbusters", "id-ct-rpkiGhostbusters", NID_id_ct_rpkiGhostbusters, 11, &so[7968]},
-    {"id-ct-resourceTaggedAttest", "id-ct-resourceTaggedAttest", NID_id_ct_resourceTaggedAttest, 11, &so[7979]},
-    {"id-cp", "id-cp", NID_id_cp, 7, &so[7990]},
-    {"sbgp-ipAddrBlockv2", "sbgp-ipAddrBlockv2", NID_sbgp_ipAddrBlockv2, 8, &so[7997]},
-    {"sbgp-autonomousSysNumv2", "sbgp-autonomousSysNumv2", NID_sbgp_autonomousSysNumv2, 8, &so[8005]},
-    {"ipAddr-asNumber", "ipAddr-asNumber", NID_ipAddr_asNumber, 8, &so[8013]},
-    {"ipAddr-asNumberv2", "ipAddr-asNumberv2", NID_ipAddr_asNumberv2, 8, &so[8021]},
-    {"rpkiManifest", "RPKI Manifest", NID_rpkiManifest, 8, &so[8029]},
-    {"signedObject", "Signed Object", NID_signedObject, 8, &so[8037]},
-    {"rpkiNotify", "RPKI Notify", NID_rpkiNotify, 8, &so[8045]},
-    {"id-ct-geofeedCSVwithCRLF", "id-ct-geofeedCSVwithCRLF", NID_id_ct_geofeedCSVwithCRLF, 11, &so[8053]},
-    {"id-ct-signedChecklist", "id-ct-signedChecklist", NID_id_ct_signedChecklist, 11, &so[8064]},
-    {"SM4-GCM", "sm4-gcm", NID_sm4_gcm, 8, &so[8075]},
-    {"SM4-CCM", "sm4-ccm", NID_sm4_ccm, 8, &so[8083]},
-    {"id-ct-ASPA", "id-ct-ASPA", NID_id_ct_ASPA, 11, &so[8091]},
-    {"id-mod-cmp2000-02", "id-mod-cmp2000-02", NID_id_mod_cmp2000_02, 8, &so[8102]},
-    {"id-mod-cmp2021-88", "id-mod-cmp2021-88", NID_id_mod_cmp2021_88, 8, &so[8110]},
-    {"id-mod-cmp2021-02", "id-mod-cmp2021-02", NID_id_mod_cmp2021_02, 8, &so[8118]},
-    {"id-it-rootCaCert", "id-it-rootCaCert", NID_id_it_rootCaCert, 8, &so[8126]},
-    {"id-it-certProfile", "id-it-certProfile", NID_id_it_certProfile, 8, &so[8134]},
-    {"id-it-crlStatusList", "id-it-crlStatusList", NID_id_it_crlStatusList, 8, &so[8142]},
-    {"id-it-crls", "id-it-crls", NID_id_it_crls, 8, &so[8150]},
-    {"id-regCtrl-altCertTemplate", "id-regCtrl-altCertTemplate", NID_id_regCtrl_altCertTemplate, 9, &so[8158]},
-    {"id-regCtrl-algId", "id-regCtrl-algId", NID_id_regCtrl_algId, 9, &so[8167]},
-    {"id-regCtrl-rsaKeyLen", "id-regCtrl-rsaKeyLen", NID_id_regCtrl_rsaKeyLen, 9, &so[8176]},
-    {"id-aa-ets-attrCertificateRefs", "id-aa-ets-attrCertificateRefs", NID_id_aa_ets_attrCertificateRefs, 11, &so[8185]},
-    {"id-aa-ets-attrRevocationRefs", "id-aa-ets-attrRevocationRefs", NID_id_aa_ets_attrRevocationRefs, 11, &so[8196]},
-    {"id-aa-CMSAlgorithmProtection", "id-aa-CMSAlgorithmProtection", NID_id_aa_CMSAlgorithmProtection, 9, &so[8207]},
-    {"itu-t-identified-organization", "itu-t-identified-organization", NID_itu_t_identified_organization, 1, &so[8216]},
-    {"etsi", "etsi", NID_etsi, 2, &so[8217]},
-    {"electronic-signature-standard", "electronic-signature-standard", NID_electronic_signature_standard, 4, &so[8219]},
-    {"ess-attributes", "ess-attributes", NID_ess_attributes, 5, &so[8223]},
-    {"id-aa-ets-mimeType", "id-aa-ets-mimeType", NID_id_aa_ets_mimeType, 6, &so[8228]},
-    {"id-aa-ets-longTermValidation", "id-aa-ets-longTermValidation", NID_id_aa_ets_longTermValidation, 6, &so[8234]},
-    {"id-aa-ets-SignaturePolicyDocument", "id-aa-ets-SignaturePolicyDocument", NID_id_aa_ets_SignaturePolicyDocument, 6, &so[8240]},
-    {"id-aa-ets-archiveTimestampV3", "id-aa-ets-archiveTimestampV3", NID_id_aa_ets_archiveTimestampV3, 6, &so[8246]},
-    {"id-aa-ATSHashIndex", "id-aa-ATSHashIndex", NID_id_aa_ATSHashIndex, 6, &so[8252]},
-    {"cades", "cades", NID_cades, 5, &so[8258]},
-    {"cades-attributes", "cades-attributes", NID_cades_attributes, 6, &so[8263]},
-    {"id-aa-ets-signerAttrV2", "id-aa-ets-signerAttrV2", NID_id_aa_ets_signerAttrV2, 7, &so[8269]},
-    {"id-aa-ets-sigPolicyStore", "id-aa-ets-sigPolicyStore", NID_id_aa_ets_sigPolicyStore, 7, &so[8276]},
-    {"id-aa-ATSHashIndex-v2", "id-aa-ATSHashIndex-v2", NID_id_aa_ATSHashIndex_v2, 7, &so[8283]},
-    {"id-aa-ATSHashIndex-v3", "id-aa-ATSHashIndex-v3", NID_id_aa_ATSHashIndex_v3, 7, &so[8290]},
-    {"signedAssertion", "signedAssertion", NID_signedAssertion, 7, &so[8297]},
-    {"id-aa-ets-archiveTimestampV2", "id-aa-ets-archiveTimestampV2", NID_id_aa_ets_archiveTimestampV2, 11, &so[8304]},
-    {"hmacWithSM3", "hmacWithSM3", NID_hmacWithSM3, 10, &so[8315]},
-    {"oracle-organization", "Oracle organization", NID_oracle, 7, &so[8325]},
-    {"oracle-jdk-trustedkeyusage", "Trusted key usage (Oracle)", NID_oracle_jdk_trustedkeyusage, 12, &so[8332]},
-    {"id-ct-signedTAL", "id-ct-signedTAL", NID_id_ct_signedTAL, 11, &so[8344]},
-    {"brainpoolP256r1tls13", "brainpoolP256r1tls13", NID_brainpoolP256r1tls13},
-    {"brainpoolP384r1tls13", "brainpoolP384r1tls13", NID_brainpoolP384r1tls13},
-    {"brainpoolP512r1tls13", "brainpoolP512r1tls13", NID_brainpoolP512r1tls13},
-    {"brotli", "Brotli compression", NID_brotli},
-    {"zstd", "Zstandard compression", NID_zstd},
-    {"SM4-XTS", "sm4-xts", NID_sm4_xts, 8, &so[8355]},
-    {"ms-ntds-obj-sid", "Microsoft NTDS AD objectSid", NID_ms_ntds_obj_sid, 10, &so[8363]},
-    {"ms-ntds-sec-ext", "Microsoft NTDS CA Extension", NID_ms_ntds_sec_ext, 9, &so[8373]},
-    {"ms-cert-templ", "Microsoft certificate template", NID_ms_cert_templ, 9, &so[8382]},
-    {"ms-app-policies", "Microsoft Application Policies Extension", NID_ms_app_policies, 9, &so[8391]},
-    {"authorityAttributeIdentifier", "X509v3 Authority Attribute Identifier", NID_authority_attribute_identifier, 3, &so[8400]},
-    {"roleSpecCertIdentifier", "X509v3 Role Specification Certificate Identifier", NID_role_spec_cert_identifier, 3, &so[8403]},
-    {"basicAttConstraints", "X509v3 Basic Attribute Certificate Constraints", NID_basic_att_constraints, 3, &so[8406]},
-    {"delegatedNameConstraints", "X509v3 Delegated Name Constraints", NID_delegated_name_constraints, 3, &so[8409]},
-    {"timeSpecification", "X509v3 Time Specification", NID_time_specification, 3, &so[8412]},
-    {"attributeDescriptor", "X509v3 Attribute Descriptor", NID_attribute_descriptor, 3, &so[8415]},
-    {"userNotice", "X509v3 User Notice", NID_user_notice, 3, &so[8418]},
-    {"sOAIdentifier", "X509v3 Source of Authority Identifier", NID_soa_identifier, 3, &so[8421]},
-    {"acceptableCertPolicies", "X509v3 Acceptable Certification Policies", NID_acceptable_cert_policies, 3, &so[8424]},
-    {"acceptablePrivPolicies", "X509v3 Acceptable Privilege Policies", NID_acceptable_privilege_policies, 3, &so[8427]},
-    {"indirectIssuer", "X509v3 Indirect Issuer", NID_indirect_issuer, 3, &so[8430]},
-    {"noAssertion", "X509v3 No Assertion", NID_no_assertion, 3, &so[8433]},
-    {"aAissuingDistributionPoint", "X509v3 Attribute Authority Issuing Distribution Point", NID_id_aa_issuing_distribution_point, 3, &so[8436]},
-    {"issuedOnBehalfOf", "X509v3 Issued On Behalf Of", NID_issued_on_behalf_of, 3, &so[8439]},
-    {"singleUse", "X509v3 Single Use", NID_single_use, 3, &so[8442]},
-    {"groupAC", "X509v3 Group Attribute Certificate", NID_group_ac, 3, &so[8445]},
-    {"allowedAttributeAssignments", "X509v3 Allowed Attribute Assignments", NID_allowed_attribute_assignments, 3, &so[8448]},
-    {"attributeMappings", "X509v3 Attribute Mappings", NID_attribute_mappings, 3, &so[8451]},
-    {"holderNameConstraints", "X509v3 Holder Name Constraints", NID_holder_name_constraints, 3, &so[8454]},
-    {"authorizationValidation", "X509v3 Authorization Validation", NID_authorization_validation, 3, &so[8457]},
-    {"protRestrict", "X509v3 Protocol Restriction", NID_prot_restrict, 3, &so[8460]},
-    {"subjectAltPublicKeyInfo", "X509v3 Subject Alternative Public Key Info", NID_subject_alt_public_key_info, 3, &so[8463]},
-    {"altSignatureAlgorithm", "X509v3 Alternative Signature Algorithm", NID_alt_signature_algorithm, 3, &so[8466]},
-    {"altSignatureValue", "X509v3 Alternative Signature Value", NID_alt_signature_value, 3, &so[8469]},
-    {"associatedInformation", "X509v3 Associated Information", NID_associated_information, 3, &so[8472]},
-    {"id-ct-rpkiSignedPrefixList", "id-ct-rpkiSignedPrefixList", NID_id_ct_rpkiSignedPrefixList, 11, &so[8475]},
-    {"id-on-hardwareModuleName", "Hardware Module Name", NID_id_on_hardwareModuleName, 8, &so[8486]},
-    {"id-kp-wisun-fan-device", "Wi-SUN Alliance Field Area Network (FAN)", NID_id_kp_wisun_fan_device, 9, &so[8494]},
-    {"NULL", "NULL", NID_ac_auditEntity},
-    {"tcg", "Trusted Computing Group", NID_tcg, 3, &so[8503]},
-    {"tcg-tcpaSpecVersion", "tcg-tcpaSpecVersion", NID_tcg_tcpaSpecVersion, 4, &so[8506]},
-    {"tcg-attribute", "Trusted Computing Group Attributes", NID_tcg_attribute, 4, &so[8510]},
-    {"tcg-protocol", "Trusted Computing Group Protocols", NID_tcg_protocol, 4, &so[8514]},
-    {"tcg-algorithm", "Trusted Computing Group Algorithms", NID_tcg_algorithm, 4, &so[8518]},
-    {"tcg-platformClass", "Trusted Computing Group Platform Classes", NID_tcg_platformClass, 4, &so[8522]},
-    {"tcg-ce", "Trusted Computing Group Certificate Extensions", NID_tcg_ce, 4, &so[8526]},
-    {"tcg-kp", "Trusted Computing Group Key Purposes", NID_tcg_kp, 4, &so[8530]},
-    {"tcg-ca", "Trusted Computing Group Certificate Policies", NID_tcg_ca, 4, &so[8534]},
-    {"tcg-address", "Trusted Computing Group Address Formats", NID_tcg_address, 4, &so[8538]},
-    {"tcg-registry", "Trusted Computing Group Registry", NID_tcg_registry, 4, &so[8542]},
-    {"tcg-traits", "Trusted Computing Group Traits", NID_tcg_traits, 4, &so[8546]},
-    {"tcg-common", "Trusted Computing Group Common", NID_tcg_common, 5, &so[8550]},
-    {"tcg-at-platformManufacturerStr", "TCG Platform Manufacturer String", NID_tcg_at_platformManufacturerStr, 6, &so[8555]},
-    {"tcg-at-platformManufacturerId", "TCG Platform Manufacturer ID", NID_tcg_at_platformManufacturerId, 6, &so[8561]},
-    {"tcg-at-platformConfigUri", "TCG Platform Configuration URI", NID_tcg_at_platformConfigUri, 6, &so[8567]},
-    {"tcg-at-platformModel", "TCG Platform Model", NID_tcg_at_platformModel, 6, &so[8573]},
-    {"tcg-at-platformVersion", "TCG Platform Version", NID_tcg_at_platformVersion, 6, &so[8579]},
-    {"tcg-at-platformSerial", "TCG Platform Serial Number", NID_tcg_at_platformSerial, 6, &so[8585]},
-    {"tcg-at-platformConfiguration", "TCG Platform Configuration", NID_tcg_at_platformConfiguration, 6, &so[8591]},
-    {"tcg-at-platformIdentifier", "TCG Platform Identifier", NID_tcg_at_platformIdentifier, 6, &so[8597]},
-    {"tcg-at-tpmManufacturer", "TPM Manufacturer", NID_tcg_at_tpmManufacturer, 5, &so[8603]},
-    {"tcg-at-tpmModel", "TPM Model", NID_tcg_at_tpmModel, 5, &so[8608]},
-    {"tcg-at-tpmVersion", "TPM Version", NID_tcg_at_tpmVersion, 5, &so[8613]},
-    {"tcg-at-securityQualities", "Security Qualities", NID_tcg_at_securityQualities, 5, &so[8618]},
-    {"tcg-at-tpmProtectionProfile", "TPM Protection Profile", NID_tcg_at_tpmProtectionProfile, 5, &so[8623]},
-    {"tcg-at-tpmSecurityTarget", "TPM Security Target", NID_tcg_at_tpmSecurityTarget, 5, &so[8628]},
-    {"tcg-at-tbbProtectionProfile", "TBB Protection Profile", NID_tcg_at_tbbProtectionProfile, 5, &so[8633]},
-    {"tcg-at-tbbSecurityTarget", "TBB Security Target", NID_tcg_at_tbbSecurityTarget, 5, &so[8638]},
-    {"tcg-at-tpmIdLabel", "TPM ID Label", NID_tcg_at_tpmIdLabel, 5, &so[8643]},
-    {"tcg-at-tpmSpecification", "TPM Specification", NID_tcg_at_tpmSpecification, 5, &so[8648]},
-    {"tcg-at-tcgPlatformSpecification", "TPM Platform Specification", NID_tcg_at_tcgPlatformSpecification, 5, &so[8653]},
-    {"tcg-at-tpmSecurityAssertions", "TPM Security Assertions", NID_tcg_at_tpmSecurityAssertions, 5, &so[8658]},
-    {"tcg-at-tbbSecurityAssertions", "TBB Security Assertions", NID_tcg_at_tbbSecurityAssertions, 5, &so[8663]},
-    {"tcg-at-tcgCredentialSpecification", "TCG Credential Specification", NID_tcg_at_tcgCredentialSpecification, 5, &so[8668]},
-    {"tcg-at-tcgCredentialType", "TCG Credential Type", NID_tcg_at_tcgCredentialType, 5, &so[8673]},
-    {"tcg-at-previousPlatformCertificates", "TCG Previous Platform Certificates", NID_tcg_at_previousPlatformCertificates, 5, &so[8678]},
-    {"tcg-at-tbbSecurityAssertions-v3", "TCG TBB Security Assertions V3", NID_tcg_at_tbbSecurityAssertions_v3, 5, &so[8683]},
-    {"tcg-at-cryptographicAnchors", "TCG Cryptographic Anchors", NID_tcg_at_cryptographicAnchors, 5, &so[8688]},
-    {"tcg-at-platformConfiguration-v1", "Platform Configuration Version 1", NID_tcg_at_platformConfiguration_v1, 7, &so[8693]},
-    {"tcg-at-platformConfiguration-v2", "Platform Configuration Version 2", NID_tcg_at_platformConfiguration_v2, 7, &so[8700]},
-    {"tcg-at-platformConfiguration-v3", "Platform Configuration Version 3", NID_tcg_at_platformConfiguration_v3, 7, &so[8707]},
-    {"tcg-at-platformConfigUri-v3", "Platform Configuration URI Version 3", NID_tcg_at_platformConfigUri_v3, 7, &so[8714]},
-    {"tcg-algorithm-null", "TCG NULL Algorithm", NID_tcg_algorithm_null, 5, &so[8721]},
-    {"tcg-kp-EKCertificate", "Endorsement Key Certificate", NID_tcg_kp_EKCertificate, 5, &so[8726]},
-    {"tcg-kp-PlatformAttributeCertificate", "Platform Attribute Certificate", NID_tcg_kp_PlatformAttributeCertificate, 5, &so[8731]},
-    {"tcg-kp-AIKCertificate", "Attestation Identity Key Certificate", NID_tcg_kp_AIKCertificate, 5, &so[8736]},
-    {"tcg-kp-PlatformKeyCertificate", "Platform Key Certificate", NID_tcg_kp_PlatformKeyCertificate, 5, &so[8741]},
-    {"tcg-kp-DeltaPlatformAttributeCertificate", "Delta Platform Attribute Certificate", NID_tcg_kp_DeltaPlatformAttributeCertificate, 5, &so[8746]},
-    {"tcg-kp-DeltaPlatformKeyCertificate", "Delta Platform Key Certificate", NID_tcg_kp_DeltaPlatformKeyCertificate, 5, &so[8751]},
-    {"tcg-kp-AdditionalPlatformAttributeCertificate", "Additional Platform Attribute Certificate", NID_tcg_kp_AdditionalPlatformAttributeCertificate, 5, &so[8756]},
-    {"tcg-kp-AdditionalPlatformKeyCertificate", "Additional Platform Key Certificate", NID_tcg_kp_AdditionalPlatformKeyCertificate, 5, &so[8761]},
-    {"tcg-ce-relevantCredentials", "Relevant Credentials", NID_tcg_ce_relevantCredentials, 5, &so[8766]},
-    {"tcg-ce-relevantManifests", "Relevant Manifests", NID_tcg_ce_relevantManifests, 5, &so[8771]},
-    {"tcg-ce-virtualPlatformAttestationService", "Virtual Platform Attestation Service", NID_tcg_ce_virtualPlatformAttestationService, 5, &so[8776]},
-    {"tcg-ce-migrationControllerAttestationService", "Migration Controller Attestation Service", NID_tcg_ce_migrationControllerAttestationService, 5, &so[8781]},
-    {"tcg-ce-migrationControllerRegistrationService", "Migration Controller Registration Service", NID_tcg_ce_migrationControllerRegistrationService, 5, &so[8786]},
-    {"tcg-ce-virtualPlatformBackupService", "Virtual Platform Backup Service", NID_tcg_ce_virtualPlatformBackupService, 5, &so[8791]},
-    {"tcg-prt-tpmIdProtocol", "TCG TPM Protocol", NID_tcg_prt_tpmIdProtocol, 5, &so[8796]},
-    {"tcg-address-ethernetmac", "Ethernet MAC Address", NID_tcg_address_ethernetmac, 5, &so[8801]},
-    {"tcg-address-wlanmac", "WLAN MAC Address", NID_tcg_address_wlanmac, 5, &so[8806]},
-    {"tcg-address-bluetoothmac", "Bluetooth MAC Address", NID_tcg_address_bluetoothmac, 5, &so[8811]},
-    {"tcg-registry-componentClass", "TCG Component Class", NID_tcg_registry_componentClass, 5, &so[8816]},
-    {"tcg-registry-componentClass-tcg", "Trusted Computed Group Registry", NID_tcg_registry_componentClass_tcg, 6, &so[8821]},
-    {"tcg-registry-componentClass-ietf", "Internet Engineering Task Force Registry", NID_tcg_registry_componentClass_ietf, 6, &so[8827]},
-    {"tcg-registry-componentClass-dmtf", "Distributed Management Task Force Registry", NID_tcg_registry_componentClass_dmtf, 6, &so[8833]},
-    {"tcg-registry-componentClass-pcie", "PCIE Component Class", NID_tcg_registry_componentClass_pcie, 6, &so[8839]},
-    {"tcg-registry-componentClass-disk", "Disk Component Class", NID_tcg_registry_componentClass_disk, 6, &so[8845]},
-    {"tcg-cap-verifiedPlatformCertificate", "TCG Verified Platform Certificate CA Policy", NID_tcg_cap_verifiedPlatformCertificate, 5, &so[8851]},
-    {"tcg-tr-ID", "TCG Trait Identifiers", NID_tcg_tr_ID, 5, &so[8856]},
-    {"tcg-tr-category", "TCG Trait Categories", NID_tcg_tr_category, 5, &so[8861]},
-    {"tcg-tr-registry", "TCG Trait Registries", NID_tcg_tr_registry, 5, &so[8866]},
-    {"tcg-tr-ID-Boolean", "Boolean Trait", NID_tcg_tr_ID_Boolean, 6, &so[8871]},
-    {"tcg-tr-ID-CertificateIdentifier", "Certificate Identifier Trait", NID_tcg_tr_ID_CertificateIdentifier, 6, &so[8877]},
-    {"tcg-tr-ID-CommonCriteria", "Common Criteria Trait", NID_tcg_tr_ID_CommonCriteria, 6, &so[8883]},
-    {"tcg-tr-ID-componentClass", "Component Class Trait", NID_tcg_tr_ID_componentClass, 6, &so[8889]},
-    {"tcg-tr-ID-componentIdentifierV11", "Component Identifier V1.1 Trait", NID_tcg_tr_ID_componentIdentifierV11, 6, &so[8895]},
-    {"tcg-tr-ID-FIPSLevel", "FIPS Level Trait", NID_tcg_tr_ID_FIPSLevel, 6, &so[8901]},
-    {"tcg-tr-ID-ISO9000Level", "ISO 9000 Level Trait", NID_tcg_tr_ID_ISO9000Level, 6, &so[8907]},
-    {"tcg-tr-ID-networkMAC", "Network MAC Trait", NID_tcg_tr_ID_networkMAC, 6, &so[8913]},
-    {"tcg-tr-ID-OID", "Object Identifier Trait", NID_tcg_tr_ID_OID, 6, &so[8919]},
-    {"tcg-tr-ID-PEN", "Private Enterprise Number Trait", NID_tcg_tr_ID_PEN, 6, &so[8925]},
-    {"tcg-tr-ID-platformFirmwareCapabilities", "Platform Firmware Capabilities Trait", NID_tcg_tr_ID_platformFirmwareCapabilities, 6, &so[8931]},
-    {"tcg-tr-ID-platformFirmwareSignatureVerification", "Platform Firmware Signature Verification Trait", NID_tcg_tr_ID_platformFirmwareSignatureVerification, 6, &so[8937]},
-    {"tcg-tr-ID-platformFirmwareUpdateCompliance", "Platform Firmware Update Compliance Trait", NID_tcg_tr_ID_platformFirmwareUpdateCompliance, 6, &so[8943]},
-    {"tcg-tr-ID-platformHardwareCapabilities", "Platform Hardware Capabilities Trait", NID_tcg_tr_ID_platformHardwareCapabilities, 6, &so[8949]},
-    {"tcg-tr-ID-RTM", "Root of Trust for Measurement Trait", NID_tcg_tr_ID_RTM, 6, &so[8955]},
-    {"tcg-tr-ID-status", "Attribute Status Trait", NID_tcg_tr_ID_status, 6, &so[8961]},
-    {"tcg-tr-ID-URI", "Uniform Resource Identifier Trait", NID_tcg_tr_ID_URI, 6, &so[8967]},
-    {"tcg-tr-ID-UTF8String", "UTF8String Trait", NID_tcg_tr_ID_UTF8String, 6, &so[8973]},
-    {"tcg-tr-ID-IA5String", "IA5String Trait", NID_tcg_tr_ID_IA5String, 6, &so[8979]},
-    {"tcg-tr-ID-PEMCertString", "PEM-Encoded Certificate String Trait", NID_tcg_tr_ID_PEMCertString, 6, &so[8985]},
-    {"tcg-tr-ID-PublicKey", "Public Key Trait", NID_tcg_tr_ID_PublicKey, 6, &so[8991]},
-    {"tcg-tr-cat-platformManufacturer", "Platform Manufacturer Trait Category", NID_tcg_tr_cat_platformManufacturer, 6, &so[8997]},
-    {"tcg-tr-cat-platformModel", "Platform Model Trait Category", NID_tcg_tr_cat_platformModel, 6, &so[9003]},
-    {"tcg-tr-cat-platformVersion", "Platform Version Trait Category", NID_tcg_tr_cat_platformVersion, 6, &so[9009]},
-    {"tcg-tr-cat-platformSerial", "Platform Serial Trait Category", NID_tcg_tr_cat_platformSerial, 6, &so[9015]},
-    {"tcg-tr-cat-platformManufacturerIdentifier", "Platform Manufacturer Identifier Trait Category", NID_tcg_tr_cat_platformManufacturerIdentifier, 6, &so[9021]},
-    {"tcg-tr-cat-platformOwnership", "Platform Ownership Trait Category", NID_tcg_tr_cat_platformOwnership, 6, &so[9027]},
-    {"tcg-tr-cat-componentClass", "Component Class Trait Category", NID_tcg_tr_cat_componentClass, 6, &so[9033]},
-    {"tcg-tr-cat-componentManufacturer", "Component Manufacturer Trait Category", NID_tcg_tr_cat_componentManufacturer, 6, &so[9039]},
-    {"tcg-tr-cat-componentModel", "Component Model Trait Category", NID_tcg_tr_cat_componentModel, 6, &so[9045]},
-    {"tcg-tr-cat-componentSerial", "Component Serial Trait Category", NID_tcg_tr_cat_componentSerial, 6, &so[9051]},
-    {"tcg-tr-cat-componentStatus", "Component Status Trait Category", NID_tcg_tr_cat_componentStatus, 6, &so[9057]},
-    {"tcg-tr-cat-componentLocation", "Component Location Trait Category", NID_tcg_tr_cat_componentLocation, 6, &so[9063]},
-    {"tcg-tr-cat-componentRevision", "Component Revision Trait Category", NID_tcg_tr_cat_componentRevision, 6, &so[9069]},
-    {"tcg-tr-cat-componentFieldReplaceable", "Component Field Replaceable Trait Category", NID_tcg_tr_cat_componentFieldReplaceable, 6, &so[9075]},
-    {"tcg-tr-cat-EKCertificate", "EK Certificate Trait Category", NID_tcg_tr_cat_EKCertificate, 6, &so[9081]},
-    {"tcg-tr-cat-IAKCertificate", "IAK Certificate Trait Category", NID_tcg_tr_cat_IAKCertificate, 6, &so[9087]},
-    {"tcg-tr-cat-IDevIDCertificate", "IDevID Certificate Trait Category", NID_tcg_tr_cat_IDevIDCertificate, 6, &so[9093]},
-    {"tcg-tr-cat-DICECertificate", "DICE Certificate Trait Category", NID_tcg_tr_cat_DICECertificate, 6, &so[9099]},
-    {"tcg-tr-cat-SPDMCertificate", "SPDM Certificate Trait Category", NID_tcg_tr_cat_SPDMCertificate, 6, &so[9105]},
-    {"tcg-tr-cat-PEMCertificate", "PEM Certificate Trait Category", NID_tcg_tr_cat_PEMCertificate, 6, &so[9111]},
-    {"tcg-tr-cat-PlatformCertificate", "Platform Certificate Trait Category", NID_tcg_tr_cat_PlatformCertificate, 6, &so[9117]},
-    {"tcg-tr-cat-DeltaPlatformCertificate", "Delta Platform Certificate Trait Category", NID_tcg_tr_cat_DeltaPlatformCertificate, 6, &so[9123]},
-    {"tcg-tr-cat-RebasePlatformCertificate", "Rebase Platform Certificate Trait Category", NID_tcg_tr_cat_RebasePlatformCertificate, 6, &so[9129]},
-    {"tcg-tr-cat-genericCertificate", "Generic Certificate Trait Category", NID_tcg_tr_cat_genericCertificate, 6, &so[9135]},
-    {"tcg-tr-cat-CommonCriteria", "Common Criteria Trait Category", NID_tcg_tr_cat_CommonCriteria, 6, &so[9141]},
-    {"tcg-tr-cat-componentIdentifierV11", "Component Identifier V1.1 Trait Category", NID_tcg_tr_cat_componentIdentifierV11, 6, &so[9147]},
-    {"tcg-tr-cat-FIPSLevel", "FIPS Level Trait Category", NID_tcg_tr_cat_FIPSLevel, 6, &so[9153]},
-    {"tcg-tr-cat-ISO9000", "ISO 9000 Trait Category", NID_tcg_tr_cat_ISO9000, 6, &so[9159]},
-    {"tcg-tr-cat-networkMAC", "Network MAC Trait Category", NID_tcg_tr_cat_networkMAC, 6, &so[9165]},
-    {"tcg-tr-cat-attestationProtocol", "Attestation Protocol Trait Category", NID_tcg_tr_cat_attestationProtocol, 6, &so[9171]},
-    {"tcg-tr-cat-PEN", "Private Enterprise Number Trait Category", NID_tcg_tr_cat_PEN, 6, &so[9177]},
-    {"tcg-tr-cat-platformFirmwareCapabilities", "Platform Firmware Capabilities Trait Category", NID_tcg_tr_cat_platformFirmwareCapabilities, 6, &so[9183]},
-    {"tcg-tr-cat-platformHardwareCapabilities", "Platform Hardware Capabilities Trait Category", NID_tcg_tr_cat_platformHardwareCapabilities, 6, &so[9189]},
-    {"tcg-tr-cat-platformFirmwareSignatureVerification", "Platform Firmware Signature Verification Trait Category", NID_tcg_tr_cat_platformFirmwareSignatureVerification, 6, &so[9195]},
-    {"tcg-tr-cat-platformFirmwareUpdateCompliance", "Platform Firmware Update Compliance Trait Category", NID_tcg_tr_cat_platformFirmwareUpdateCompliance, 6, &so[9201]},
-    {"tcg-tr-cat-RTM", "Root of Trust of Measurement Trait Category", NID_tcg_tr_cat_RTM, 6, &so[9207]},
-    {"tcg-tr-cat-PublicKey", "Public Key Trait Category", NID_tcg_tr_cat_PublicKey, 6, &so[9213]},
-    {"id-alg-ml-kem-512", "ML-KEM-512", NID_ML_KEM_512, 9, &so[9219]},
-    {"id-alg-ml-kem-768", "ML-KEM-768", NID_ML_KEM_768, 9, &so[9228]},
-    {"id-alg-ml-kem-1024", "ML-KEM-1024", NID_ML_KEM_1024, 9, &so[9237]},
-    {"id-ml-dsa-44", "ML-DSA-44", NID_ML_DSA_44, 9, &so[9246]},
-    {"id-ml-dsa-65", "ML-DSA-65", NID_ML_DSA_65, 9, &so[9255]},
-    {"id-ml-dsa-87", "ML-DSA-87", NID_ML_DSA_87, 9, &so[9264]},
-    {"id-slh-dsa-sha2-128s", "SLH-DSA-SHA2-128s", NID_SLH_DSA_SHA2_128s, 9, &so[9273]},
-    {"id-slh-dsa-sha2-128f", "SLH-DSA-SHA2-128f", NID_SLH_DSA_SHA2_128f, 9, &so[9282]},
-    {"id-slh-dsa-sha2-192s", "SLH-DSA-SHA2-192s", NID_SLH_DSA_SHA2_192s, 9, &so[9291]},
-    {"id-slh-dsa-sha2-192f", "SLH-DSA-SHA2-192f", NID_SLH_DSA_SHA2_192f, 9, &so[9300]},
-    {"id-slh-dsa-sha2-256s", "SLH-DSA-SHA2-256s", NID_SLH_DSA_SHA2_256s, 9, &so[9309]},
-    {"id-slh-dsa-sha2-256f", "SLH-DSA-SHA2-256f", NID_SLH_DSA_SHA2_256f, 9, &so[9318]},
-    {"id-slh-dsa-shake-128s", "SLH-DSA-SHAKE-128s", NID_SLH_DSA_SHAKE_128s, 9, &so[9327]},
-    {"id-slh-dsa-shake-128f", "SLH-DSA-SHAKE-128f", NID_SLH_DSA_SHAKE_128f, 9, &so[9336]},
-    {"id-slh-dsa-shake-192s", "SLH-DSA-SHAKE-192s", NID_SLH_DSA_SHAKE_192s, 9, &so[9345]},
-    {"id-slh-dsa-shake-192f", "SLH-DSA-SHAKE-192f", NID_SLH_DSA_SHAKE_192f, 9, &so[9354]},
-    {"id-slh-dsa-shake-256s", "SLH-DSA-SHAKE-256s", NID_SLH_DSA_SHAKE_256s, 9, &so[9363]},
-    {"id-slh-dsa-shake-256f", "SLH-DSA-SHAKE-256f", NID_SLH_DSA_SHAKE_256f, 9, &so[9372]},
-    {"id-hash-ml-dsa-44-with-sha512", "HASH-ML-DSA-44-WITH-SHA512", NID_HASH_ML_DSA_44_WITH_SHA512, 9, &so[9381]},
-    {"id-hash-ml-dsa-65-with-sha512", "HASH-ML-DSA-65-WITH-SHA512", NID_HASH_ML_DSA_65_WITH_SHA512, 9, &so[9390]},
-    {"id-hash-ml-dsa-87-with-sha512", "HASH-ML-DSA-87-WITH-SHA512", NID_HASH_ML_DSA_87_WITH_SHA512, 9, &so[9399]},
-    {"id-hash-slh-dsa-sha2-128s-with-sha256", "SLH-DSA-SHA2-128s-WITH-SHA256", NID_SLH_DSA_SHA2_128s_WITH_SHA256, 9, &so[9408]},
-    {"id-hash-slh-dsa-sha2-128f-with-sha256", "SLH-DSA-SHA2-128f-WITH-SHA256", NID_SLH_DSA_SHA2_128f_WITH_SHA256, 9, &so[9417]},
-    {"id-hash-slh-dsa-sha2-192s-with-sha512", "SLH-DSA-SHA2-192s-WITH-SHA512", NID_SLH_DSA_SHA2_192s_WITH_SHA512, 9, &so[9426]},
-    {"id-hash-slh-dsa-sha2-192f-with-sha512", "SLH-DSA-SHA2-192f-WITH-SHA512", NID_SLH_DSA_SHA2_192f_WITH_SHA512, 9, &so[9435]},
-    {"id-hash-slh-dsa-sha2-256s-with-sha512", "SLH-DSA-SHA2-256s-WITH-SHA512", NID_SLH_DSA_SHA2_256s_WITH_SHA512, 9, &so[9444]},
-    {"id-hash-slh-dsa-sha2-256f-with-sha512", "SLH-DSA-SHA2-256f-WITH-SHA512", NID_SLH_DSA_SHA2_256f_WITH_SHA512, 9, &so[9453]},
-    {"id-hash-slh-dsa-shake-128s-with-shake128", "SLH-DSA-SHAKE-128s-WITH-SHAKE128", NID_SLH_DSA_SHAKE_128s_WITH_SHAKE128, 9, &so[9462]},
-    {"id-hash-slh-dsa-shake-128f-with-shake128", "SLH-DSA-SHAKE-128f-WITH-SHAKE128", NID_SLH_DSA_SHAKE_128f_WITH_SHAKE128, 9, &so[9471]},
-    {"id-hash-slh-dsa-shake-192s-with-shake256", "SLH-DSA-SHAKE-192s-WITH-SHAKE256", NID_SLH_DSA_SHAKE_192s_WITH_SHAKE256, 9, &so[9480]},
-    {"id-hash-slh-dsa-shake-192f-with-shake256", "SLH-DSA-SHAKE-192f-WITH-SHAKE256", NID_SLH_DSA_SHAKE_192f_WITH_SHAKE256, 9, &so[9489]},
-    {"id-hash-slh-dsa-shake-256s-with-shake256", "SLH-DSA-SHAKE-256s-WITH-SHAKE256", NID_SLH_DSA_SHAKE_256s_WITH_SHAKE256, 9, &so[9498]},
-    {"id-hash-slh-dsa-shake-256f-with-shake256", "SLH-DSA-SHAKE-256f-WITH-SHAKE256", NID_SLH_DSA_SHAKE_256f_WITH_SHAKE256, 9, &so[9507]},
-};
-
-#define NUM_SN 1478
-static const unsigned int sn_objs[NUM_SN] = {
-     364,    /* "AD_DVCS" */
-     419,    /* "AES-128-CBC" */
-     916,    /* "AES-128-CBC-HMAC-SHA1" */
-     948,    /* "AES-128-CBC-HMAC-SHA256" */
-     421,    /* "AES-128-CFB" */
-     650,    /* "AES-128-CFB1" */
-     653,    /* "AES-128-CFB8" */
-     904,    /* "AES-128-CTR" */
-     418,    /* "AES-128-ECB" */
-     958,    /* "AES-128-OCB" */
-     420,    /* "AES-128-OFB" */
-    1198,    /* "AES-128-SIV" */
-     913,    /* "AES-128-XTS" */
-     423,    /* "AES-192-CBC" */
-     917,    /* "AES-192-CBC-HMAC-SHA1" */
-     949,    /* "AES-192-CBC-HMAC-SHA256" */
-     425,    /* "AES-192-CFB" */
-     651,    /* "AES-192-CFB1" */
-     654,    /* "AES-192-CFB8" */
-     905,    /* "AES-192-CTR" */
-     422,    /* "AES-192-ECB" */
-     959,    /* "AES-192-OCB" */
-     424,    /* "AES-192-OFB" */
-    1199,    /* "AES-192-SIV" */
-     427,    /* "AES-256-CBC" */
-     918,    /* "AES-256-CBC-HMAC-SHA1" */
-     950,    /* "AES-256-CBC-HMAC-SHA256" */
-     429,    /* "AES-256-CFB" */
-     652,    /* "AES-256-CFB1" */
-     655,    /* "AES-256-CFB8" */
-     906,    /* "AES-256-CTR" */
-     426,    /* "AES-256-ECB" */
-     960,    /* "AES-256-OCB" */
-     428,    /* "AES-256-OFB" */
-    1200,    /* "AES-256-SIV" */
-     914,    /* "AES-256-XTS" */
-    1066,    /* "ARIA-128-CBC" */
-    1120,    /* "ARIA-128-CCM" */
-    1067,    /* "ARIA-128-CFB" */
-    1080,    /* "ARIA-128-CFB1" */
-    1083,    /* "ARIA-128-CFB8" */
-    1069,    /* "ARIA-128-CTR" */
-    1065,    /* "ARIA-128-ECB" */
-    1123,    /* "ARIA-128-GCM" */
-    1068,    /* "ARIA-128-OFB" */
-    1071,    /* "ARIA-192-CBC" */
-    1121,    /* "ARIA-192-CCM" */
-    1072,    /* "ARIA-192-CFB" */
-    1081,    /* "ARIA-192-CFB1" */
-    1084,    /* "ARIA-192-CFB8" */
-    1074,    /* "ARIA-192-CTR" */
-    1070,    /* "ARIA-192-ECB" */
-    1124,    /* "ARIA-192-GCM" */
-    1073,    /* "ARIA-192-OFB" */
-    1076,    /* "ARIA-256-CBC" */
-    1122,    /* "ARIA-256-CCM" */
-    1077,    /* "ARIA-256-CFB" */
-    1082,    /* "ARIA-256-CFB1" */
-    1085,    /* "ARIA-256-CFB8" */
-    1079,    /* "ARIA-256-CTR" */
-    1075,    /* "ARIA-256-ECB" */
-    1125,    /* "ARIA-256-GCM" */
-    1078,    /* "ARIA-256-OFB" */
-    1064,    /* "AuthANY" */
-    1049,    /* "AuthDSS" */
-    1047,    /* "AuthECDSA" */
-    1050,    /* "AuthGOST01" */
-    1051,    /* "AuthGOST12" */
-    1053,    /* "AuthNULL" */
-    1048,    /* "AuthPSK" */
-    1046,    /* "AuthRSA" */
-    1052,    /* "AuthSRP" */
-      91,    /* "BF-CBC" */
-      93,    /* "BF-CFB" */
-      92,    /* "BF-ECB" */
-      94,    /* "BF-OFB" */
-    1201,    /* "BLAKE2BMAC" */
-    1202,    /* "BLAKE2SMAC" */
-    1056,    /* "BLAKE2b512" */
-    1057,    /* "BLAKE2s256" */
-      14,    /* "C" */
-     751,    /* "CAMELLIA-128-CBC" */
-     962,    /* "CAMELLIA-128-CCM" */
-     757,    /* "CAMELLIA-128-CFB" */
-     760,    /* "CAMELLIA-128-CFB1" */
-     763,    /* "CAMELLIA-128-CFB8" */
-     964,    /* "CAMELLIA-128-CMAC" */
-     963,    /* "CAMELLIA-128-CTR" */
-     754,    /* "CAMELLIA-128-ECB" */
-     961,    /* "CAMELLIA-128-GCM" */
-     766,    /* "CAMELLIA-128-OFB" */
-     752,    /* "CAMELLIA-192-CBC" */
-     966,    /* "CAMELLIA-192-CCM" */
-     758,    /* "CAMELLIA-192-CFB" */
-     761,    /* "CAMELLIA-192-CFB1" */
-     764,    /* "CAMELLIA-192-CFB8" */
-     968,    /* "CAMELLIA-192-CMAC" */
-     967,    /* "CAMELLIA-192-CTR" */
-     755,    /* "CAMELLIA-192-ECB" */
-     965,    /* "CAMELLIA-192-GCM" */
-     767,    /* "CAMELLIA-192-OFB" */
-     753,    /* "CAMELLIA-256-CBC" */
-     970,    /* "CAMELLIA-256-CCM" */
-     759,    /* "CAMELLIA-256-CFB" */
-     762,    /* "CAMELLIA-256-CFB1" */
-     765,    /* "CAMELLIA-256-CFB8" */
-     972,    /* "CAMELLIA-256-CMAC" */
-     971,    /* "CAMELLIA-256-CTR" */
-     756,    /* "CAMELLIA-256-ECB" */
-     969,    /* "CAMELLIA-256-GCM" */
-     768,    /* "CAMELLIA-256-OFB" */
-     108,    /* "CAST5-CBC" */
-     110,    /* "CAST5-CFB" */
-     109,    /* "CAST5-ECB" */
-     111,    /* "CAST5-OFB" */
-     894,    /* "CMAC" */
-      13,    /* "CN" */
-     141,    /* "CRLReason" */
-     417,    /* "CSPName" */
-    1019,    /* "ChaCha20" */
-    1018,    /* "ChaCha20-Poly1305" */
-     367,    /* "CrlID" */
-     391,    /* "DC" */
-      31,    /* "DES-CBC" */
-     643,    /* "DES-CDMF" */
-      30,    /* "DES-CFB" */
-     656,    /* "DES-CFB1" */
-     657,    /* "DES-CFB8" */
-      29,    /* "DES-ECB" */
-      32,    /* "DES-EDE" */
-      43,    /* "DES-EDE-CBC" */
-      60,    /* "DES-EDE-CFB" */
-      62,    /* "DES-EDE-OFB" */
-      33,    /* "DES-EDE3" */
-      44,    /* "DES-EDE3-CBC" */
-      61,    /* "DES-EDE3-CFB" */
-     658,    /* "DES-EDE3-CFB1" */
-     659,    /* "DES-EDE3-CFB8" */
-      63,    /* "DES-EDE3-OFB" */
-      45,    /* "DES-OFB" */
-      80,    /* "DESX-CBC" */
-     380,    /* "DOD" */
-     116,    /* "DSA" */
-      66,    /* "DSA-SHA" */
-     113,    /* "DSA-SHA1" */
-      70,    /* "DSA-SHA1-old" */
-      67,    /* "DSA-old" */
-     297,    /* "DVCS" */
-    1087,    /* "ED25519" */
-    1088,    /* "ED448" */
-    1195,    /* "GMAC" */
-      99,    /* "GN" */
-    1036,    /* "HKDF" */
-     855,    /* "HMAC" */
-     780,    /* "HMAC-MD5" */
-     781,    /* "HMAC-SHA1" */
-     381,    /* "IANA" */
-      34,    /* "IDEA-CBC" */
-      35,    /* "IDEA-CFB" */
-      36,    /* "IDEA-ECB" */
-      46,    /* "IDEA-OFB" */
-    1004,    /* "INN" */
-     181,    /* "ISO" */
-    1140,    /* "ISO-CN" */
-    1150,    /* "ISO-UA" */
-     183,    /* "ISO-US" */
-     645,    /* "ITU-T" */
-     646,    /* "JOINT-ISO-ITU-T" */
-     773,    /* "KISA" */
-    1196,    /* "KMAC128" */
-    1197,    /* "KMAC256" */
-    1063,    /* "KxANY" */
-    1039,    /* "KxDHE" */
-    1041,    /* "KxDHE-PSK" */
-    1038,    /* "KxECDHE" */
-    1040,    /* "KxECDHE-PSK" */
-    1045,    /* "KxGOST" */
-    1218,    /* "KxGOST18" */
-    1043,    /* "KxPSK" */
-    1037,    /* "KxRSA" */
-    1042,    /* "KxRSA_PSK" */
-    1044,    /* "KxSRP" */
-      15,    /* "L" */
-     856,    /* "LocalKeySet" */
-       3,    /* "MD2" */
-     257,    /* "MD4" */
-       4,    /* "MD5" */
-     114,    /* "MD5-SHA1" */
-      95,    /* "MDC2" */
-     911,    /* "MGF1" */
-     388,    /* "Mail" */
-     393,    /* "NULL" */
-     404,    /* "NULL" */
-    1323,    /* "NULL" */
-      57,    /* "Netscape" */
-     366,    /* "Nonce" */
-      17,    /* "O" */
-     178,    /* "OCSP" */
-     180,    /* "OCSPSigning" */
-    1005,    /* "OGRN" */
-    1226,    /* "OGRNIP" */
-     379,    /* "ORG" */
-      18,    /* "OU" */
-     749,    /* "Oakley-EC2N-3" */
-     750,    /* "Oakley-EC2N-4" */
-       9,    /* "PBE-MD2-DES" */
-     168,    /* "PBE-MD2-RC2-64" */
-      10,    /* "PBE-MD5-DES" */
-     169,    /* "PBE-MD5-RC2-64" */
-     147,    /* "PBE-SHA1-2DES" */
-     146,    /* "PBE-SHA1-3DES" */
-     170,    /* "PBE-SHA1-DES" */
-     148,    /* "PBE-SHA1-RC2-128" */
-     149,    /* "PBE-SHA1-RC2-40" */
-      68,    /* "PBE-SHA1-RC2-64" */
-     144,    /* "PBE-SHA1-RC4-128" */
-     145,    /* "PBE-SHA1-RC4-40" */
-     161,    /* "PBES2" */
-      69,    /* "PBKDF2" */
-     162,    /* "PBMAC1" */
-     127,    /* "PKIX" */
-     935,    /* "PSPECIFIED" */
-    1061,    /* "Poly1305" */
-      98,    /* "RC2-40-CBC" */
-     166,    /* "RC2-64-CBC" */
-      37,    /* "RC2-CBC" */
-      39,    /* "RC2-CFB" */
-      38,    /* "RC2-ECB" */
-      40,    /* "RC2-OFB" */
-       5,    /* "RC4" */
-      97,    /* "RC4-40" */
-     915,    /* "RC4-HMAC-MD5" */
-     120,    /* "RC5-CBC" */
-     122,    /* "RC5-CFB" */
-     121,    /* "RC5-ECB" */
-     123,    /* "RC5-OFB" */
-     117,    /* "RIPEMD160" */
-      19,    /* "RSA" */
-       7,    /* "RSA-MD2" */
-     396,    /* "RSA-MD4" */
-       8,    /* "RSA-MD5" */
-      96,    /* "RSA-MDC2" */
-     104,    /* "RSA-NP-MD5" */
-     119,    /* "RSA-RIPEMD160" */
-      42,    /* "RSA-SHA" */
-      65,    /* "RSA-SHA1" */
-     115,    /* "RSA-SHA1-2" */
-     671,    /* "RSA-SHA224" */
-     668,    /* "RSA-SHA256" */
-     669,    /* "RSA-SHA384" */
-     670,    /* "RSA-SHA512" */
-    1145,    /* "RSA-SHA512/224" */
-    1146,    /* "RSA-SHA512/256" */
-    1144,    /* "RSA-SM3" */
-     919,    /* "RSAES-OAEP" */
-     912,    /* "RSASSA-PSS" */
-     777,    /* "SEED-CBC" */
-     779,    /* "SEED-CFB" */
-     776,    /* "SEED-ECB" */
-     778,    /* "SEED-OFB" */
-      41,    /* "SHA" */
-      64,    /* "SHA1" */
-     675,    /* "SHA224" */
-     672,    /* "SHA256" */
-    1096,    /* "SHA3-224" */
-    1097,    /* "SHA3-256" */
-    1098,    /* "SHA3-384" */
-    1099,    /* "SHA3-512" */
-     673,    /* "SHA384" */
-     674,    /* "SHA512" */
-    1094,    /* "SHA512-224" */
-    1095,    /* "SHA512-256" */
-    1100,    /* "SHAKE128" */
-    1101,    /* "SHAKE256" */
-    1172,    /* "SM2" */
-    1204,    /* "SM2-SM3" */
-    1143,    /* "SM3" */
-    1134,    /* "SM4-CBC" */
-    1249,    /* "SM4-CCM" */
-    1137,    /* "SM4-CFB" */
-    1136,    /* "SM4-CFB1" */
-    1138,    /* "SM4-CFB8" */
-    1139,    /* "SM4-CTR" */
-    1133,    /* "SM4-ECB" */
-    1248,    /* "SM4-GCM" */
-    1135,    /* "SM4-OFB" */
-    1290,    /* "SM4-XTS" */
-     188,    /* "SMIME" */
-     167,    /* "SMIME-CAPS" */
-     100,    /* "SN" */
-    1006,    /* "SNILS" */
-    1203,    /* "SSHKDF" */
-    1205,    /* "SSKDF" */
-      16,    /* "ST" */
-     143,    /* "SXNetID" */
-    1062,    /* "SipHash" */
-    1021,    /* "TLS1-PRF" */
-     458,    /* "UID" */
-       0,    /* "UNDEF" */
-    1034,    /* "X25519" */
-    1035,    /* "X448" */
-      11,    /* "X500" */
-     378,    /* "X500algorithms" */
-      12,    /* "X509" */
-     184,    /* "X9-57" */
-    1207,    /* "X942KDF" */
-    1206,    /* "X963KDF" */
-     185,    /* "X9cm" */
-     125,    /* "ZLIB" */
-    1307,    /* "aAissuingDistributionPoint" */
-     478,    /* "aRecord" */
-     289,    /* "aaControls" */
-     287,    /* "ac-auditIdentity" */
-     397,    /* "ac-proxying" */
-     288,    /* "ac-targeting" */
-    1303,    /* "acceptableCertPolicies" */
-    1304,    /* "acceptablePrivPolicies" */
-     368,    /* "acceptableResponses" */
-     446,    /* "account" */
-     363,    /* "ad_timestamping" */
-     376,    /* "algorithm" */
-    1311,    /* "allowedAttributeAssignments" */
-    1317,    /* "altSignatureAlgorithm" */
-    1318,    /* "altSignatureValue" */
-     405,    /* "ansi-X9-62" */
-     910,    /* "anyExtendedKeyUsage" */
-     746,    /* "anyPolicy" */
-     370,    /* "archiveCutoff" */
-     484,    /* "associatedDomain" */
-    1319,    /* "associatedInformation" */
-     485,    /* "associatedName" */
-    1300,    /* "attributeDescriptor" */
-    1312,    /* "attributeMappings" */
-     501,    /* "audio" */
-    1295,    /* "authorityAttributeIdentifier" */
-     177,    /* "authorityInfoAccess" */
-      90,    /* "authorityKeyIdentifier" */
-     882,    /* "authorityRevocationList" */
-    1314,    /* "authorizationValidation" */
-    1297,    /* "basicAttConstraints" */
-      87,    /* "basicConstraints" */
-     365,    /* "basicOCSPResponse" */
-     285,    /* "biometricInfo" */
-     921,    /* "brainpoolP160r1" */
-     922,    /* "brainpoolP160t1" */
-     923,    /* "brainpoolP192r1" */
-     924,    /* "brainpoolP192t1" */
-     925,    /* "brainpoolP224r1" */
-     926,    /* "brainpoolP224t1" */
-     927,    /* "brainpoolP256r1" */
-    1285,    /* "brainpoolP256r1tls13" */
-     928,    /* "brainpoolP256t1" */
-     929,    /* "brainpoolP320r1" */
-     930,    /* "brainpoolP320t1" */
-     931,    /* "brainpoolP384r1" */
-    1286,    /* "brainpoolP384r1tls13" */
-     932,    /* "brainpoolP384t1" */
-     933,    /* "brainpoolP512r1" */
-    1287,    /* "brainpoolP512r1tls13" */
-     934,    /* "brainpoolP512t1" */
-    1288,    /* "brotli" */
-     494,    /* "buildingName" */
-     860,    /* "businessCategory" */
-     691,    /* "c2onb191v4" */
-     692,    /* "c2onb191v5" */
-     697,    /* "c2onb239v4" */
-     698,    /* "c2onb239v5" */
-     684,    /* "c2pnb163v1" */
-     685,    /* "c2pnb163v2" */
-     686,    /* "c2pnb163v3" */
-     687,    /* "c2pnb176v1" */
-     693,    /* "c2pnb208w1" */
-     699,    /* "c2pnb272w1" */
-     700,    /* "c2pnb304w1" */
-     702,    /* "c2pnb368w1" */
-     688,    /* "c2tnb191v1" */
-     689,    /* "c2tnb191v2" */
-     690,    /* "c2tnb191v3" */
-     694,    /* "c2tnb239v1" */
-     695,    /* "c2tnb239v2" */
-     696,    /* "c2tnb239v3" */
-     701,    /* "c2tnb359v1" */
-     703,    /* "c2tnb431r1" */
-    1090,    /* "c3" */
-     881,    /* "cACertificate" */
-     483,    /* "cNAMERecord" */
-     179,    /* "caIssuers" */
-     785,    /* "caRepository" */
-    1273,    /* "cades" */
-    1274,    /* "cades-attributes" */
-    1023,    /* "capwapAC" */
-    1024,    /* "capwapWTP" */
-     443,    /* "caseIgnoreIA5StringSyntax" */
-     152,    /* "certBag" */
-     677,    /* "certicom-arc" */
-     771,    /* "certificateIssuer" */
-      89,    /* "certificatePolicies" */
-     883,    /* "certificateRevocationList" */
-      54,    /* "challengePassword" */
-     407,    /* "characteristic-two-field" */
-    1227,    /* "classSignTool" */
-    1233,    /* "classSignToolKA1" */
-    1231,    /* "classSignToolKB1" */
-    1232,    /* "classSignToolKB2" */
-    1228,    /* "classSignToolKC1" */
-    1229,    /* "classSignToolKC2" */
-    1230,    /* "classSignToolKC3" */
-     395,    /* "clearance" */
-     130,    /* "clientAuth" */
-    1222,    /* "cmKGA" */
-    1219,    /* "cmcArchive" */
-    1131,    /* "cmcCA" */
-    1132,    /* "cmcRA" */
-     131,    /* "codeSigning" */
-      50,    /* "contentType" */
-      53,    /* "countersignature" */
-     153,    /* "crlBag" */
-     103,    /* "crlDistributionPoints" */
-      88,    /* "crlNumber" */
-     884,    /* "crossCertificatePair" */
-     806,    /* "cryptocom" */
-     805,    /* "cryptopro" */
-     954,    /* "ct_cert_scts" */
-     952,    /* "ct_precert_poison" */
-     951,    /* "ct_precert_scts" */
-     953,    /* "ct_precert_signer" */
-     500,    /* "dITRedirect" */
-     451,    /* "dNSDomain" */
-     495,    /* "dSAQuality" */
-     434,    /* "data" */
-     390,    /* "dcobject" */
-    1298,    /* "delegatedNameConstraints" */
-     140,    /* "deltaCRL" */
-     891,    /* "deltaRevocationList" */
-     107,    /* "description" */
-     871,    /* "destinationIndicator" */
-     947,    /* "dh-cofactor-kdf" */
-     946,    /* "dh-std-kdf" */
-      28,    /* "dhKeyAgreement" */
-     941,    /* "dhSinglePass-cofactorDH-sha1kdf-scheme" */
-     942,    /* "dhSinglePass-cofactorDH-sha224kdf-scheme" */
-     943,    /* "dhSinglePass-cofactorDH-sha256kdf-scheme" */
-     944,    /* "dhSinglePass-cofactorDH-sha384kdf-scheme" */
-     945,    /* "dhSinglePass-cofactorDH-sha512kdf-scheme" */
-     936,    /* "dhSinglePass-stdDH-sha1kdf-scheme" */
-     937,    /* "dhSinglePass-stdDH-sha224kdf-scheme" */
-     938,    /* "dhSinglePass-stdDH-sha256kdf-scheme" */
-     939,    /* "dhSinglePass-stdDH-sha384kdf-scheme" */
-     940,    /* "dhSinglePass-stdDH-sha512kdf-scheme" */
-     920,    /* "dhpublicnumber" */
-     382,    /* "directory" */
-     887,    /* "distinguishedName" */
-     892,    /* "dmdName" */
-     174,    /* "dnQualifier" */
-    1092,    /* "dnsName" */
-     447,    /* "document" */
-     471,    /* "documentAuthor" */
-     468,    /* "documentIdentifier" */
-     472,    /* "documentLocation" */
-     502,    /* "documentPublisher" */
-     449,    /* "documentSeries" */
-     469,    /* "documentTitle" */
-     470,    /* "documentVersion" */
-     392,    /* "domain" */
-     452,    /* "domainRelatedObject" */
-     802,    /* "dsa_with_SHA224" */
-     803,    /* "dsa_with_SHA256" */
-    1152,    /* "dstu28147" */
-    1154,    /* "dstu28147-cfb" */
-    1153,    /* "dstu28147-ofb" */
-    1155,    /* "dstu28147-wrap" */
-    1157,    /* "dstu34311" */
-    1159,    /* "dstu4145be" */
-    1158,    /* "dstu4145le" */
-     791,    /* "ecdsa-with-Recommended" */
-     416,    /* "ecdsa-with-SHA1" */
-     793,    /* "ecdsa-with-SHA224" */
-     794,    /* "ecdsa-with-SHA256" */
-     795,    /* "ecdsa-with-SHA384" */
-     796,    /* "ecdsa-with-SHA512" */
-     792,    /* "ecdsa-with-Specified" */
-    1266,    /* "electronic-signature-standard" */
-      48,    /* "emailAddress" */
-     132,    /* "emailProtection" */
-     885,    /* "enhancedSearchGuide" */
-     389,    /* "enterprises" */
-    1267,    /* "ess-attributes" */
-    1265,    /* "etsi" */
-     384,    /* "experimental" */
-     172,    /* "extReq" */
-      56,    /* "extendedCertificateAttributes" */
-     126,    /* "extendedKeyUsage" */
-     372,    /* "extendedStatus" */
-     867,    /* "facsimileTelephoneNumber" */
-     462,    /* "favouriteDrink" */
-    1126,    /* "ffdhe2048" */
-    1127,    /* "ffdhe3072" */
-    1128,    /* "ffdhe4096" */
-    1129,    /* "ffdhe6144" */
-    1130,    /* "ffdhe8192" */
-     857,    /* "freshestCRL" */
-     453,    /* "friendlyCountry" */
-     490,    /* "friendlyCountryName" */
-     156,    /* "friendlyName" */
-     509,    /* "generationQualifier" */
-     815,    /* "gost-mac" */
-     976,    /* "gost-mac-12" */
-     811,    /* "gost2001" */
-     851,    /* "gost2001cc" */
-     979,    /* "gost2012_256" */
-     980,    /* "gost2012_512" */
-     813,    /* "gost89" */
-    1009,    /* "gost89-cbc" */
-     814,    /* "gost89-cnt" */
-     975,    /* "gost89-cnt-12" */
-    1011,    /* "gost89-ctr" */
-    1010,    /* "gost89-ecb" */
-     812,    /* "gost94" */
-     850,    /* "gost94cc" */
-    1310,    /* "groupAC" */
-    1156,    /* "hmacWithDstu34311" */
-     797,    /* "hmacWithMD5" */
-     163,    /* "hmacWithSHA1" */
-     798,    /* "hmacWithSHA224" */
-     799,    /* "hmacWithSHA256" */
-     800,    /* "hmacWithSHA384" */
-     801,    /* "hmacWithSHA512" */
-    1193,    /* "hmacWithSHA512-224" */
-    1194,    /* "hmacWithSHA512-256" */
-    1281,    /* "hmacWithSM3" */
-     432,    /* "holdInstructionCallIssuer" */
-     430,    /* "holdInstructionCode" */
-     431,    /* "holdInstructionNone" */
-     433,    /* "holdInstructionReject" */
-    1313,    /* "holderNameConstraints" */
-     486,    /* "homePostalAddress" */
-     473,    /* "homeTelephoneNumber" */
-     466,    /* "host" */
-     889,    /* "houseIdentifier" */
-     442,    /* "iA5StringSyntax" */
-     783,    /* "id-DHBasedMac" */
-     824,    /* "id-Gost28147-89-CryptoPro-A-ParamSet" */
-     825,    /* "id-Gost28147-89-CryptoPro-B-ParamSet" */
-     826,    /* "id-Gost28147-89-CryptoPro-C-ParamSet" */
-     827,    /* "id-Gost28147-89-CryptoPro-D-ParamSet" */
-     819,    /* "id-Gost28147-89-CryptoPro-KeyMeshing" */
-     829,    /* "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet" */
-     828,    /* "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet" */
-     830,    /* "id-Gost28147-89-CryptoPro-RIC-1-ParamSet" */
-     820,    /* "id-Gost28147-89-None-KeyMeshing" */
-     823,    /* "id-Gost28147-89-TestParamSet" */
-     849,    /* "id-Gost28147-89-cc" */
-     840,    /* "id-GostR3410-2001-CryptoPro-A-ParamSet" */
-     841,    /* "id-GostR3410-2001-CryptoPro-B-ParamSet" */
-     842,    /* "id-GostR3410-2001-CryptoPro-C-ParamSet" */
-     843,    /* "id-GostR3410-2001-CryptoPro-XchA-ParamSet" */
-     844,    /* "id-GostR3410-2001-CryptoPro-XchB-ParamSet" */
-     854,    /* "id-GostR3410-2001-ParamSet-cc" */
-     839,    /* "id-GostR3410-2001-TestParamSet" */
-     817,    /* "id-GostR3410-2001DH" */
-     832,    /* "id-GostR3410-94-CryptoPro-A-ParamSet" */
-     833,    /* "id-GostR3410-94-CryptoPro-B-ParamSet" */
-     834,    /* "id-GostR3410-94-CryptoPro-C-ParamSet" */
-     835,    /* "id-GostR3410-94-CryptoPro-D-ParamSet" */
-     836,    /* "id-GostR3410-94-CryptoPro-XchA-ParamSet" */
-     837,    /* "id-GostR3410-94-CryptoPro-XchB-ParamSet" */
-     838,    /* "id-GostR3410-94-CryptoPro-XchC-ParamSet" */
-     831,    /* "id-GostR3410-94-TestParamSet" */
-     845,    /* "id-GostR3410-94-a" */
-     846,    /* "id-GostR3410-94-aBis" */
-     847,    /* "id-GostR3410-94-b" */
-     848,    /* "id-GostR3410-94-bBis" */
-     818,    /* "id-GostR3410-94DH" */
-     822,    /* "id-GostR3411-94-CryptoProParamSet" */
-     821,    /* "id-GostR3411-94-TestParamSet" */
-     807,    /* "id-GostR3411-94-with-GostR3410-2001" */
-     853,    /* "id-GostR3411-94-with-GostR3410-2001-cc" */
-     808,    /* "id-GostR3411-94-with-GostR3410-94" */
-     852,    /* "id-GostR3411-94-with-GostR3410-94-cc" */
-     810,    /* "id-HMACGostR3411-94" */
-     782,    /* "id-PasswordBasedMAC" */
-    1272,    /* "id-aa-ATSHashIndex" */
-    1277,    /* "id-aa-ATSHashIndex-v2" */
-    1278,    /* "id-aa-ATSHashIndex-v3" */
-    1263,    /* "id-aa-CMSAlgorithmProtection" */
-    1270,    /* "id-aa-ets-SignaturePolicyDocument" */
-    1280,    /* "id-aa-ets-archiveTimestampV2" */
-    1271,    /* "id-aa-ets-archiveTimestampV3" */
-    1261,    /* "id-aa-ets-attrCertificateRefs" */
-    1262,    /* "id-aa-ets-attrRevocationRefs" */
-    1269,    /* "id-aa-ets-longTermValidation" */
-    1268,    /* "id-aa-ets-mimeType" */
-    1276,    /* "id-aa-ets-sigPolicyStore" */
-    1275,    /* "id-aa-ets-signerAttrV2" */
-     266,    /* "id-aca" */
-     355,    /* "id-aca-accessIdentity" */
-     354,    /* "id-aca-authenticationInfo" */
-     356,    /* "id-aca-chargingIdentity" */
-     399,    /* "id-aca-encAttrs" */
-     357,    /* "id-aca-group" */
-     358,    /* "id-aca-role" */
-     176,    /* "id-ad" */
-     896,    /* "id-aes128-CCM" */
-     895,    /* "id-aes128-GCM" */
-     788,    /* "id-aes128-wrap" */
-     897,    /* "id-aes128-wrap-pad" */
-     899,    /* "id-aes192-CCM" */
-     898,    /* "id-aes192-GCM" */
-     789,    /* "id-aes192-wrap" */
-     900,    /* "id-aes192-wrap-pad" */
-     902,    /* "id-aes256-CCM" */
-     901,    /* "id-aes256-GCM" */
-     790,    /* "id-aes256-wrap" */
-     903,    /* "id-aes256-wrap-pad" */
-     262,    /* "id-alg" */
-     893,    /* "id-alg-PWRI-KEK" */
-     323,    /* "id-alg-des40" */
-     326,    /* "id-alg-dh-pop" */
-     325,    /* "id-alg-dh-sig-hmac-sha1" */
-    1456,    /* "id-alg-ml-kem-1024" */
-    1454,    /* "id-alg-ml-kem-512" */
-    1455,    /* "id-alg-ml-kem-768" */
-     324,    /* "id-alg-noSignature" */
-     907,    /* "id-camellia128-wrap" */
-     908,    /* "id-camellia192-wrap" */
-     909,    /* "id-camellia256-wrap" */
-     268,    /* "id-cct" */
-     361,    /* "id-cct-PKIData" */
-     362,    /* "id-cct-PKIResponse" */
-     360,    /* "id-cct-crs" */
-      81,    /* "id-ce" */
-     680,    /* "id-characteristic-two-basis" */
-     263,    /* "id-cmc" */
-     334,    /* "id-cmc-addExtensions" */
-     346,    /* "id-cmc-confirmCertAcceptance" */
-     330,    /* "id-cmc-dataReturn" */
-     336,    /* "id-cmc-decryptedPOP" */
-     335,    /* "id-cmc-encryptedPOP" */
-     339,    /* "id-cmc-getCRL" */
-     338,    /* "id-cmc-getCert" */
-     328,    /* "id-cmc-identification" */
-     329,    /* "id-cmc-identityProof" */
-     337,    /* "id-cmc-lraPOPWitness" */
-     344,    /* "id-cmc-popLinkRandom" */
-     345,    /* "id-cmc-popLinkWitness" */
-     343,    /* "id-cmc-queryPending" */
-     333,    /* "id-cmc-recipientNonce" */
-     341,    /* "id-cmc-regInfo" */
-     342,    /* "id-cmc-responseInfo" */
-     340,    /* "id-cmc-revokeRequest" */
-     332,    /* "id-cmc-senderNonce" */
-     327,    /* "id-cmc-statusInfo" */
-     331,    /* "id-cmc-transactionId" */
-    1238,    /* "id-cp" */
-    1250,    /* "id-ct-ASPA" */
-     787,    /* "id-ct-asciiTextWithCRLF" */
-    1246,    /* "id-ct-geofeedCSVwithCRLF" */
-    1237,    /* "id-ct-resourceTaggedAttest" */
-    1234,    /* "id-ct-routeOriginAuthz" */
-    1236,    /* "id-ct-rpkiGhostbusters" */
-    1235,    /* "id-ct-rpkiManifest" */
-    1320,    /* "id-ct-rpkiSignedPrefixList" */
-    1247,    /* "id-ct-signedChecklist" */
-    1284,    /* "id-ct-signedTAL" */
-    1060,    /* "id-ct-xml" */
-    1108,    /* "id-dsa-with-sha3-224" */
-    1109,    /* "id-dsa-with-sha3-256" */
-    1110,    /* "id-dsa-with-sha3-384" */
-    1111,    /* "id-dsa-with-sha3-512" */
-    1106,    /* "id-dsa-with-sha384" */
-    1107,    /* "id-dsa-with-sha512" */
-     408,    /* "id-ecPublicKey" */
-    1112,    /* "id-ecdsa-with-sha3-224" */
-    1113,    /* "id-ecdsa-with-sha3-256" */
-    1114,    /* "id-ecdsa-with-sha3-384" */
-    1115,    /* "id-ecdsa-with-sha3-512" */
-    1472,    /* "id-hash-ml-dsa-44-with-sha512" */
-    1473,    /* "id-hash-ml-dsa-65-with-sha512" */
-    1474,    /* "id-hash-ml-dsa-87-with-sha512" */
-    1476,    /* "id-hash-slh-dsa-sha2-128f-with-sha256" */
-    1475,    /* "id-hash-slh-dsa-sha2-128s-with-sha256" */
-    1478,    /* "id-hash-slh-dsa-sha2-192f-with-sha512" */
-    1477,    /* "id-hash-slh-dsa-sha2-192s-with-sha512" */
-    1480,    /* "id-hash-slh-dsa-sha2-256f-with-sha512" */
-    1479,    /* "id-hash-slh-dsa-sha2-256s-with-sha512" */
-    1482,    /* "id-hash-slh-dsa-shake-128f-with-shake128" */
-    1481,    /* "id-hash-slh-dsa-shake-128s-with-shake128" */
-    1484,    /* "id-hash-slh-dsa-shake-192f-with-shake256" */
-    1483,    /* "id-hash-slh-dsa-shake-192s-with-shake256" */
-    1486,    /* "id-hash-slh-dsa-shake-256f-with-shake256" */
-    1485,    /* "id-hash-slh-dsa-shake-256s-with-shake256" */
-     508,    /* "id-hex-multipart-message" */
-     507,    /* "id-hex-partial-message" */
-    1102,    /* "id-hmacWithSHA3-224" */
-    1103,    /* "id-hmacWithSHA3-256" */
-    1104,    /* "id-hmacWithSHA3-384" */
-    1105,    /* "id-hmacWithSHA3-512" */
-     260,    /* "id-it" */
-    1223,    /* "id-it-caCerts" */
-     302,    /* "id-it-caKeyUpdateInfo" */
-     298,    /* "id-it-caProtEncCert" */
-    1255,    /* "id-it-certProfile" */
-    1225,    /* "id-it-certReqTemplate" */
-     311,    /* "id-it-confirmWaitTime" */
-    1256,    /* "id-it-crlStatusList" */
-    1257,    /* "id-it-crls" */
-     303,    /* "id-it-currentCRL" */
-     300,    /* "id-it-encKeyPairTypes" */
-     310,    /* "id-it-implicitConfirm" */
-     308,    /* "id-it-keyPairParamRep" */
-     307,    /* "id-it-keyPairParamReq" */
-     312,    /* "id-it-origPKIMessage" */
-     301,    /* "id-it-preferredSymmAlg" */
-     309,    /* "id-it-revPassphrase" */
-    1254,    /* "id-it-rootCaCert" */
-    1224,    /* "id-it-rootCaKeyUpdate" */
-     299,    /* "id-it-signKeyPairTypes" */
-     305,    /* "id-it-subscriptionRequest" */
-     306,    /* "id-it-subscriptionResponse" */
-     784,    /* "id-it-suppLangTags" */
-     304,    /* "id-it-unsupportedOIDs" */
-     128,    /* "id-kp" */
-    1221,    /* "id-kp-BrandIndicatorforMessageIdentification" */
-    1220,    /* "id-kp-bgpsec-router" */
-    1322,    /* "id-kp-wisun-fan-device" */
-    1457,    /* "id-ml-dsa-44" */
-    1458,    /* "id-ml-dsa-65" */
-    1459,    /* "id-ml-dsa-87" */
-     280,    /* "id-mod-attribute-cert" */
-     274,    /* "id-mod-cmc" */
-     277,    /* "id-mod-cmp" */
-     284,    /* "id-mod-cmp2000" */
-    1251,    /* "id-mod-cmp2000-02" */
-    1253,    /* "id-mod-cmp2021-02" */
-    1252,    /* "id-mod-cmp2021-88" */
-     273,    /* "id-mod-crmf" */
-     283,    /* "id-mod-dvcs" */
-     275,    /* "id-mod-kea-profile-88" */
-     276,    /* "id-mod-kea-profile-93" */
-     282,    /* "id-mod-ocsp" */
-     278,    /* "id-mod-qualified-cert-88" */
-     279,    /* "id-mod-qualified-cert-93" */
-     281,    /* "id-mod-timestamp-protocol" */
-     264,    /* "id-on" */
-    1211,    /* "id-on-NAIRealm" */
-    1208,    /* "id-on-SmtpUTF8Mailbox" */
-    1210,    /* "id-on-dnsSRV" */
-    1321,    /* "id-on-hardwareModuleName" */
-     858,    /* "id-on-permanentIdentifier" */
-     347,    /* "id-on-personalData" */
-    1209,    /* "id-on-xmppAddr" */
-     265,    /* "id-pda" */
-     352,    /* "id-pda-countryOfCitizenship" */
-     353,    /* "id-pda-countryOfResidence" */
-     348,    /* "id-pda-dateOfBirth" */
-     351,    /* "id-pda-gender" */
-     349,    /* "id-pda-placeOfBirth" */
-     175,    /* "id-pe" */
-    1031,    /* "id-pkinit" */
-     261,    /* "id-pkip" */
-     258,    /* "id-pkix-mod" */
-     269,    /* "id-pkix1-explicit-88" */
-     271,    /* "id-pkix1-explicit-93" */
-     270,    /* "id-pkix1-implicit-88" */
-     272,    /* "id-pkix1-implicit-93" */
-     662,    /* "id-ppl" */
-     664,    /* "id-ppl-anyLanguage" */
-     667,    /* "id-ppl-independent" */
-     665,    /* "id-ppl-inheritAll" */
-     267,    /* "id-qcs" */
-     359,    /* "id-qcs-pkixQCSyntax-v1" */
-     259,    /* "id-qt" */
-     164,    /* "id-qt-cps" */
-     165,    /* "id-qt-unotice" */
-     313,    /* "id-regCtrl" */
-    1259,    /* "id-regCtrl-algId" */
-    1258,    /* "id-regCtrl-altCertTemplate" */
-     316,    /* "id-regCtrl-authenticator" */
-     319,    /* "id-regCtrl-oldCertID" */
-     318,    /* "id-regCtrl-pkiArchiveOptions" */
-     317,    /* "id-regCtrl-pkiPublicationInfo" */
-     320,    /* "id-regCtrl-protocolEncrKey" */
-     315,    /* "id-regCtrl-regToken" */
-    1260,    /* "id-regCtrl-rsaKeyLen" */
-     314,    /* "id-regInfo" */
-     322,    /* "id-regInfo-certReq" */
-     321,    /* "id-regInfo-utf8Pairs" */
-    1116,    /* "id-rsassa-pkcs1-v1_5-with-sha3-224" */
-    1117,    /* "id-rsassa-pkcs1-v1_5-with-sha3-256" */
-    1118,    /* "id-rsassa-pkcs1-v1_5-with-sha3-384" */
-    1119,    /* "id-rsassa-pkcs1-v1_5-with-sha3-512" */
-     973,    /* "id-scrypt" */
-     512,    /* "id-set" */
-    1461,    /* "id-slh-dsa-sha2-128f" */
-    1460,    /* "id-slh-dsa-sha2-128s" */
-    1463,    /* "id-slh-dsa-sha2-192f" */
-    1462,    /* "id-slh-dsa-sha2-192s" */
-    1465,    /* "id-slh-dsa-sha2-256f" */
-    1464,    /* "id-slh-dsa-sha2-256s" */
-    1467,    /* "id-slh-dsa-shake-128f" */
-    1466,    /* "id-slh-dsa-shake-128s" */
-    1469,    /* "id-slh-dsa-shake-192f" */
-    1468,    /* "id-slh-dsa-shake-192s" */
-    1471,    /* "id-slh-dsa-shake-256f" */
-    1470,    /* "id-slh-dsa-shake-256s" */
-     191,    /* "id-smime-aa" */
-     215,    /* "id-smime-aa-contentHint" */
-     218,    /* "id-smime-aa-contentIdentifier" */
-     221,    /* "id-smime-aa-contentReference" */
-     240,    /* "id-smime-aa-dvcs-dvc" */
-     217,    /* "id-smime-aa-encapContentType" */
-     222,    /* "id-smime-aa-encrypKeyPref" */
-     220,    /* "id-smime-aa-equivalentLabels" */
-     232,    /* "id-smime-aa-ets-CertificateRefs" */
-     233,    /* "id-smime-aa-ets-RevocationRefs" */
-     238,    /* "id-smime-aa-ets-archiveTimeStamp" */
-     237,    /* "id-smime-aa-ets-certCRLTimestamp" */
-     234,    /* "id-smime-aa-ets-certValues" */
-     227,    /* "id-smime-aa-ets-commitmentType" */
-     231,    /* "id-smime-aa-ets-contentTimestamp" */
-     236,    /* "id-smime-aa-ets-escTimeStamp" */
-     230,    /* "id-smime-aa-ets-otherSigCert" */
-     235,    /* "id-smime-aa-ets-revocationValues" */
-     226,    /* "id-smime-aa-ets-sigPolicyId" */
-     229,    /* "id-smime-aa-ets-signerAttr" */
-     228,    /* "id-smime-aa-ets-signerLocation" */
-     219,    /* "id-smime-aa-macValue" */
-     214,    /* "id-smime-aa-mlExpandHistory" */
-     216,    /* "id-smime-aa-msgSigDigest" */
-     212,    /* "id-smime-aa-receiptRequest" */
-     213,    /* "id-smime-aa-securityLabel" */
-     239,    /* "id-smime-aa-signatureType" */
-     223,    /* "id-smime-aa-signingCertificate" */
-    1086,    /* "id-smime-aa-signingCertificateV2" */
-     224,    /* "id-smime-aa-smimeEncryptCerts" */
-     225,    /* "id-smime-aa-timeStampToken" */
-     192,    /* "id-smime-alg" */
-     243,    /* "id-smime-alg-3DESwrap" */
-     246,    /* "id-smime-alg-CMS3DESwrap" */
-     247,    /* "id-smime-alg-CMSRC2wrap" */
-     245,    /* "id-smime-alg-ESDH" */
-     241,    /* "id-smime-alg-ESDHwith3DES" */
-     242,    /* "id-smime-alg-ESDHwithRC2" */
-     244,    /* "id-smime-alg-RC2wrap" */
-     193,    /* "id-smime-cd" */
-     248,    /* "id-smime-cd-ldap" */
-     190,    /* "id-smime-ct" */
-     210,    /* "id-smime-ct-DVCSRequestData" */
-     211,    /* "id-smime-ct-DVCSResponseData" */
-     208,    /* "id-smime-ct-TDTInfo" */
-     207,    /* "id-smime-ct-TSTInfo" */
-     205,    /* "id-smime-ct-authData" */
-    1059,    /* "id-smime-ct-authEnvelopedData" */
-     786,    /* "id-smime-ct-compressedData" */
-    1058,    /* "id-smime-ct-contentCollection" */
-     209,    /* "id-smime-ct-contentInfo" */
-     206,    /* "id-smime-ct-publishCert" */
-     204,    /* "id-smime-ct-receipt" */
-     195,    /* "id-smime-cti" */
-     255,    /* "id-smime-cti-ets-proofOfApproval" */
-     256,    /* "id-smime-cti-ets-proofOfCreation" */
-     253,    /* "id-smime-cti-ets-proofOfDelivery" */
-     251,    /* "id-smime-cti-ets-proofOfOrigin" */
-     252,    /* "id-smime-cti-ets-proofOfReceipt" */
-     254,    /* "id-smime-cti-ets-proofOfSender" */
-     189,    /* "id-smime-mod" */
-     196,    /* "id-smime-mod-cms" */
-     197,    /* "id-smime-mod-ess" */
-     202,    /* "id-smime-mod-ets-eSigPolicy-88" */
-     203,    /* "id-smime-mod-ets-eSigPolicy-97" */
-     200,    /* "id-smime-mod-ets-eSignature-88" */
-     201,    /* "id-smime-mod-ets-eSignature-97" */
-     199,    /* "id-smime-mod-msg-v3" */
-     198,    /* "id-smime-mod-oid" */
-     194,    /* "id-smime-spq" */
-     250,    /* "id-smime-spq-ets-sqt-unotice" */
-     249,    /* "id-smime-spq-ets-sqt-uri" */
-     974,    /* "id-tc26" */
-     991,    /* "id-tc26-agreement" */
-     992,    /* "id-tc26-agreement-gost-3410-2012-256" */
-     993,    /* "id-tc26-agreement-gost-3410-2012-512" */
-     977,    /* "id-tc26-algorithms" */
-     990,    /* "id-tc26-cipher" */
-    1001,    /* "id-tc26-cipher-constants" */
-    1176,    /* "id-tc26-cipher-gostr3412-2015-kuznyechik" */
-    1173,    /* "id-tc26-cipher-gostr3412-2015-magma" */
-     994,    /* "id-tc26-constants" */
-     981,    /* "id-tc26-digest" */
-    1000,    /* "id-tc26-digest-constants" */
-    1002,    /* "id-tc26-gost-28147-constants" */
-    1003,    /* "id-tc26-gost-28147-param-Z" */
-    1147,    /* "id-tc26-gost-3410-2012-256-constants" */
-    1148,    /* "id-tc26-gost-3410-2012-256-paramSetA" */
-    1184,    /* "id-tc26-gost-3410-2012-256-paramSetB" */
-    1185,    /* "id-tc26-gost-3410-2012-256-paramSetC" */
-    1186,    /* "id-tc26-gost-3410-2012-256-paramSetD" */
-     996,    /* "id-tc26-gost-3410-2012-512-constants" */
-     998,    /* "id-tc26-gost-3410-2012-512-paramSetA" */
-     999,    /* "id-tc26-gost-3410-2012-512-paramSetB" */
-    1149,    /* "id-tc26-gost-3410-2012-512-paramSetC" */
-     997,    /* "id-tc26-gost-3410-2012-512-paramSetTest" */
-     988,    /* "id-tc26-hmac-gost-3411-2012-256" */
-     989,    /* "id-tc26-hmac-gost-3411-2012-512" */
-     987,    /* "id-tc26-mac" */
-     978,    /* "id-tc26-sign" */
-     995,    /* "id-tc26-sign-constants" */
-     984,    /* "id-tc26-signwithdigest" */
-     985,    /* "id-tc26-signwithdigest-gost3410-2012-256" */
-     986,    /* "id-tc26-signwithdigest-gost3410-2012-512" */
-    1179,    /* "id-tc26-wrap" */
-    1182,    /* "id-tc26-wrap-gostr3412-2015-kuznyechik" */
-    1180,    /* "id-tc26-wrap-gostr3412-2015-magma" */
-     676,    /* "identified-organization" */
-    1170,    /* "ieee" */
-    1171,    /* "ieee-siswg" */
-    1305,    /* "indirectIssuer" */
-     461,    /* "info" */
-     748,    /* "inhibitAnyPolicy" */
-     101,    /* "initials" */
-     647,    /* "international-organizations" */
-     869,    /* "internationaliSDNNumber" */
-     142,    /* "invalidityDate" */
-    1241,    /* "ipAddr-asNumber" */
-    1242,    /* "ipAddr-asNumberv2" */
-     294,    /* "ipsecEndSystem" */
-    1022,    /* "ipsecIKE" */
-     295,    /* "ipsecTunnel" */
-     296,    /* "ipsecUser" */
-    1308,    /* "issuedOnBehalfOf" */
-      86,    /* "issuerAltName" */
-    1008,    /* "issuerSignTool" */
-     770,    /* "issuingDistributionPoint" */
-    1264,    /* "itu-t-identified-organization" */
-     492,    /* "janetMailbox" */
-     957,    /* "jurisdictionC" */
-     955,    /* "jurisdictionL" */
-     956,    /* "jurisdictionST" */
-     150,    /* "keyBag" */
-      83,    /* "keyUsage" */
-    1015,    /* "kuznyechik-cbc" */
-    1016,    /* "kuznyechik-cfb" */
-    1013,    /* "kuznyechik-ctr" */
-    1177,    /* "kuznyechik-ctr-acpkm" */
-    1178,    /* "kuznyechik-ctr-acpkm-omac" */
-    1012,    /* "kuznyechik-ecb" */
-    1183,    /* "kuznyechik-kexp15" */
-    1017,    /* "kuznyechik-mac" */
-    1014,    /* "kuznyechik-ofb" */
-     477,    /* "lastModifiedBy" */
-     476,    /* "lastModifiedTime" */
-     157,    /* "localKeyID" */
-     480,    /* "mXRecord" */
-    1190,    /* "magma-cbc" */
-    1191,    /* "magma-cfb" */
-    1188,    /* "magma-ctr" */
-    1174,    /* "magma-ctr-acpkm" */
-    1175,    /* "magma-ctr-acpkm-omac" */
-    1187,    /* "magma-ecb" */
-    1181,    /* "magma-kexp15" */
-    1192,    /* "magma-mac" */
-    1189,    /* "magma-ofb" */
-     460,    /* "mail" */
-     493,    /* "mailPreferenceOption" */
-     467,    /* "manager" */
-     982,    /* "md_gost12_256" */
-     983,    /* "md_gost12_512" */
-     809,    /* "md_gost94" */
-     875,    /* "member" */
-     182,    /* "member-body" */
-      51,    /* "messageDigest" */
-     383,    /* "mgmt" */
-     504,    /* "mime-mhs" */
-     506,    /* "mime-mhs-bodies" */
-     505,    /* "mime-mhs-headings" */
-     488,    /* "mobileTelephoneNumber" */
-    1212,    /* "modp_1536" */
-    1213,    /* "modp_2048" */
-    1214,    /* "modp_3072" */
-    1215,    /* "modp_4096" */
-    1216,    /* "modp_6144" */
-    1217,    /* "modp_8192" */
-    1294,    /* "ms-app-policies" */
-    1293,    /* "ms-cert-templ" */
-    1291,    /* "ms-ntds-obj-sid" */
-    1292,    /* "ms-ntds-sec-ext" */
-     136,    /* "msCTLSign" */
-     135,    /* "msCodeCom" */
-     134,    /* "msCodeInd" */
-     138,    /* "msEFS" */
-     171,    /* "msExtReq" */
-     137,    /* "msSGC" */
-     648,    /* "msSmartcardLogin" */
-     649,    /* "msUPN" */
-    1091,    /* "n3" */
-     481,    /* "nSRecord" */
-     173,    /* "name" */
-     666,    /* "nameConstraints" */
-    1306,    /* "noAssertion" */
-     369,    /* "noCheck" */
-     403,    /* "noRevAvail" */
-      72,    /* "nsBaseUrl" */
-      76,    /* "nsCaPolicyUrl" */
-      74,    /* "nsCaRevocationUrl" */
-      58,    /* "nsCertExt" */
-      79,    /* "nsCertSequence" */
-      71,    /* "nsCertType" */
-      78,    /* "nsComment" */
-      59,    /* "nsDataType" */
-      75,    /* "nsRenewalUrl" */
-      73,    /* "nsRevocationUrl" */
-     139,    /* "nsSGC" */
-      77,    /* "nsSslServerName" */
-     681,    /* "onBasis" */
-    1283,    /* "oracle-jdk-trustedkeyusage" */
-    1282,    /* "oracle-organization" */
-    1089,    /* "organizationIdentifier" */
-     491,    /* "organizationalStatus" */
-    1141,    /* "oscca" */
-     475,    /* "otherMailbox" */
-     876,    /* "owner" */
-     489,    /* "pagerTelephoneNumber" */
-     374,    /* "path" */
-     112,    /* "pbeWithMD5AndCast5CBC" */
-     499,    /* "personalSignature" */
-     487,    /* "personalTitle" */
-     464,    /* "photo" */
-     863,    /* "physicalDeliveryOfficeName" */
-     437,    /* "pilot" */
-     439,    /* "pilotAttributeSyntax" */
-     438,    /* "pilotAttributeType" */
-     479,    /* "pilotAttributeType27" */
-     456,    /* "pilotDSA" */
-     441,    /* "pilotGroups" */
-     444,    /* "pilotObject" */
-     440,    /* "pilotObjectClass" */
-     455,    /* "pilotOrganization" */
-     445,    /* "pilotPerson" */
-    1032,    /* "pkInitClientAuth" */
-    1033,    /* "pkInitKDC" */
-       2,    /* "pkcs" */
-     186,    /* "pkcs1" */
-      27,    /* "pkcs3" */
-     187,    /* "pkcs5" */
-      20,    /* "pkcs7" */
-      21,    /* "pkcs7-data" */
-      25,    /* "pkcs7-digestData" */
-      26,    /* "pkcs7-encryptedData" */
-      23,    /* "pkcs7-envelopedData" */
-      24,    /* "pkcs7-signedAndEnvelopedData" */
-      22,    /* "pkcs7-signedData" */
-     151,    /* "pkcs8ShroudedKeyBag" */
-      47,    /* "pkcs9" */
-     401,    /* "policyConstraints" */
-     747,    /* "policyMappings" */
-     862,    /* "postOfficeBox" */
-     861,    /* "postalAddress" */
-     661,    /* "postalCode" */
-     683,    /* "ppBasis" */
-     872,    /* "preferredDeliveryMethod" */
-     873,    /* "presentationAddress" */
-     816,    /* "prf-gostr3411-94" */
-     406,    /* "prime-field" */
-     409,    /* "prime192v1" */
-     410,    /* "prime192v2" */
-     411,    /* "prime192v3" */
-     412,    /* "prime239v1" */
-     413,    /* "prime239v2" */
-     414,    /* "prime239v3" */
-     415,    /* "prime256v1" */
-     385,    /* "private" */
-      84,    /* "privateKeyUsagePeriod" */
-    1315,    /* "protRestrict" */
-     886,    /* "protocolInformation" */
-     663,    /* "proxyCertInfo" */
-     510,    /* "pseudonym" */
-     435,    /* "pss" */
-     286,    /* "qcStatements" */
-     457,    /* "qualityLabelledData" */
-     450,    /* "rFC822localPart" */
-     870,    /* "registeredAddress" */
-     400,    /* "role" */
-     877,    /* "roleOccupant" */
-    1296,    /* "roleSpecCertIdentifier" */
-     448,    /* "room" */
-     463,    /* "roomNumber" */
-    1243,    /* "rpkiManifest" */
-    1245,    /* "rpkiNotify" */
-       6,    /* "rsaEncryption" */
-     644,    /* "rsaOAEPEncryptionSET" */
-     377,    /* "rsaSignature" */
-       1,    /* "rsadsi" */
-    1302,    /* "sOAIdentifier" */
-     482,    /* "sOARecord" */
-     155,    /* "safeContentsBag" */
-     291,    /* "sbgp-autonomousSysNum" */
-    1240,    /* "sbgp-autonomousSysNumv2" */
-     290,    /* "sbgp-ipAddrBlock" */
-    1239,    /* "sbgp-ipAddrBlockv2" */
-     292,    /* "sbgp-routerIdentifier" */
-     159,    /* "sdsiCertificate" */
-     859,    /* "searchGuide" */
-     704,    /* "secp112r1" */
-     705,    /* "secp112r2" */
-     706,    /* "secp128r1" */
-     707,    /* "secp128r2" */
-     708,    /* "secp160k1" */
-     709,    /* "secp160r1" */
-     710,    /* "secp160r2" */
-     711,    /* "secp192k1" */
-     712,    /* "secp224k1" */
-     713,    /* "secp224r1" */
-     714,    /* "secp256k1" */
-     715,    /* "secp384r1" */
-     716,    /* "secp521r1" */
-     154,    /* "secretBag" */
-     474,    /* "secretary" */
-     717,    /* "sect113r1" */
-     718,    /* "sect113r2" */
-     719,    /* "sect131r1" */
-     720,    /* "sect131r2" */
-     721,    /* "sect163k1" */
-     722,    /* "sect163r1" */
-     723,    /* "sect163r2" */
-     724,    /* "sect193r1" */
-     725,    /* "sect193r2" */
-     726,    /* "sect233k1" */
-     727,    /* "sect233r1" */
-     728,    /* "sect239k1" */
-     729,    /* "sect283k1" */
-     730,    /* "sect283r1" */
-     731,    /* "sect409k1" */
-     732,    /* "sect409r1" */
-     733,    /* "sect571k1" */
-     734,    /* "sect571r1" */
-    1025,    /* "secureShellClient" */
-    1026,    /* "secureShellServer" */
-     386,    /* "security" */
-     878,    /* "seeAlso" */
-     394,    /* "selected-attribute-types" */
-    1029,    /* "sendOwner" */
-    1030,    /* "sendProxiedOwner" */
-    1028,    /* "sendProxiedRouter" */
-    1027,    /* "sendRouter" */
-     105,    /* "serialNumber" */
-     129,    /* "serverAuth" */
-     371,    /* "serviceLocator" */
-     625,    /* "set-addPolicy" */
-     515,    /* "set-attr" */
-     518,    /* "set-brand" */
-     638,    /* "set-brand-AmericanExpress" */
-     637,    /* "set-brand-Diners" */
-     636,    /* "set-brand-IATA-ATA" */
-     639,    /* "set-brand-JCB" */
-     641,    /* "set-brand-MasterCard" */
-     642,    /* "set-brand-Novus" */
-     640,    /* "set-brand-Visa" */
-     517,    /* "set-certExt" */
-     513,    /* "set-ctype" */
-     514,    /* "set-msgExt" */
-     516,    /* "set-policy" */
-     607,    /* "set-policy-root" */
-     624,    /* "set-rootKeyThumb" */
-     620,    /* "setAttr-Cert" */
-     631,    /* "setAttr-GenCryptgrm" */
-     623,    /* "setAttr-IssCap" */
-     628,    /* "setAttr-IssCap-CVM" */
-     630,    /* "setAttr-IssCap-Sig" */
-     629,    /* "setAttr-IssCap-T2" */
-     621,    /* "setAttr-PGWYcap" */
-     635,    /* "setAttr-SecDevSig" */
-     632,    /* "setAttr-T2Enc" */
-     633,    /* "setAttr-T2cleartxt" */
-     634,    /* "setAttr-TokICCsig" */
-     627,    /* "setAttr-Token-B0Prime" */
-     626,    /* "setAttr-Token-EMV" */
-     622,    /* "setAttr-TokenType" */
-     619,    /* "setCext-IssuerCapabilities" */
-     615,    /* "setCext-PGWYcapabilities" */
-     616,    /* "setCext-TokenIdentifier" */
-     618,    /* "setCext-TokenType" */
-     617,    /* "setCext-Track2Data" */
-     611,    /* "setCext-cCertRequired" */
-     609,    /* "setCext-certType" */
-     608,    /* "setCext-hashedRoot" */
-     610,    /* "setCext-merchData" */
-     613,    /* "setCext-setExt" */
-     614,    /* "setCext-setQualf" */
-     612,    /* "setCext-tunneling" */
-     540,    /* "setct-AcqCardCodeMsg" */
-     576,    /* "setct-AcqCardCodeMsgTBE" */
-     570,    /* "setct-AuthReqTBE" */
-     534,    /* "setct-AuthReqTBS" */
-     527,    /* "setct-AuthResBaggage" */
-     571,    /* "setct-AuthResTBE" */
-     572,    /* "setct-AuthResTBEX" */
-     535,    /* "setct-AuthResTBS" */
-     536,    /* "setct-AuthResTBSX" */
-     528,    /* "setct-AuthRevReqBaggage" */
-     577,    /* "setct-AuthRevReqTBE" */
-     541,    /* "setct-AuthRevReqTBS" */
-     529,    /* "setct-AuthRevResBaggage" */
-     542,    /* "setct-AuthRevResData" */
-     578,    /* "setct-AuthRevResTBE" */
-     579,    /* "setct-AuthRevResTBEB" */
-     543,    /* "setct-AuthRevResTBS" */
-     573,    /* "setct-AuthTokenTBE" */
-     537,    /* "setct-AuthTokenTBS" */
-     600,    /* "setct-BCIDistributionTBS" */
-     558,    /* "setct-BatchAdminReqData" */
-     592,    /* "setct-BatchAdminReqTBE" */
-     559,    /* "setct-BatchAdminResData" */
-     593,    /* "setct-BatchAdminResTBE" */
-     599,    /* "setct-CRLNotificationResTBS" */
-     598,    /* "setct-CRLNotificationTBS" */
-     580,    /* "setct-CapReqTBE" */
-     581,    /* "setct-CapReqTBEX" */
-     544,    /* "setct-CapReqTBS" */
-     545,    /* "setct-CapReqTBSX" */
-     546,    /* "setct-CapResData" */
-     582,    /* "setct-CapResTBE" */
-     583,    /* "setct-CapRevReqTBE" */
-     584,    /* "setct-CapRevReqTBEX" */
-     547,    /* "setct-CapRevReqTBS" */
-     548,    /* "setct-CapRevReqTBSX" */
-     549,    /* "setct-CapRevResData" */
-     585,    /* "setct-CapRevResTBE" */
-     538,    /* "setct-CapTokenData" */
-     530,    /* "setct-CapTokenSeq" */
-     574,    /* "setct-CapTokenTBE" */
-     575,    /* "setct-CapTokenTBEX" */
-     539,    /* "setct-CapTokenTBS" */
-     560,    /* "setct-CardCInitResTBS" */
-     566,    /* "setct-CertInqReqTBS" */
-     563,    /* "setct-CertReqData" */
-     595,    /* "setct-CertReqTBE" */
-     596,    /* "setct-CertReqTBEX" */
-     564,    /* "setct-CertReqTBS" */
-     565,    /* "setct-CertResData" */
-     597,    /* "setct-CertResTBE" */
-     586,    /* "setct-CredReqTBE" */
-     587,    /* "setct-CredReqTBEX" */
-     550,    /* "setct-CredReqTBS" */
-     551,    /* "setct-CredReqTBSX" */
-     552,    /* "setct-CredResData" */
-     588,    /* "setct-CredResTBE" */
-     589,    /* "setct-CredRevReqTBE" */
-     590,    /* "setct-CredRevReqTBEX" */
-     553,    /* "setct-CredRevReqTBS" */
-     554,    /* "setct-CredRevReqTBSX" */
-     555,    /* "setct-CredRevResData" */
-     591,    /* "setct-CredRevResTBE" */
-     567,    /* "setct-ErrorTBS" */
-     526,    /* "setct-HODInput" */
-     561,    /* "setct-MeAqCInitResTBS" */
-     522,    /* "setct-OIData" */
-     519,    /* "setct-PANData" */
-     521,    /* "setct-PANOnly" */
-     520,    /* "setct-PANToken" */
-     556,    /* "setct-PCertReqData" */
-     557,    /* "setct-PCertResTBS" */
-     523,    /* "setct-PI" */
-     532,    /* "setct-PI-TBS" */
-     524,    /* "setct-PIData" */
-     525,    /* "setct-PIDataUnsigned" */
-     568,    /* "setct-PIDualSignedTBE" */
-     569,    /* "setct-PIUnsignedTBE" */
-     531,    /* "setct-PInitResData" */
-     533,    /* "setct-PResData" */
-     594,    /* "setct-RegFormReqTBE" */
-     562,    /* "setct-RegFormResTBS" */
-     606,    /* "setext-cv" */
-     601,    /* "setext-genCrypt" */
-     602,    /* "setext-miAuth" */
-     604,    /* "setext-pinAny" */
-     603,    /* "setext-pinSecure" */
-     605,    /* "setext-track2" */
-    1279,    /* "signedAssertion" */
-    1244,    /* "signedObject" */
-      52,    /* "signingTime" */
-     454,    /* "simpleSecurityObject" */
-     496,    /* "singleLevelQuality" */
-    1309,    /* "singleUse" */
-    1142,    /* "sm-scheme" */
-     387,    /* "snmpv2" */
-     660,    /* "street" */
-      85,    /* "subjectAltName" */
-    1316,    /* "subjectAltPublicKeyInfo" */
-     769,    /* "subjectDirectoryAttributes" */
-     398,    /* "subjectInfoAccess" */
-      82,    /* "subjectKeyIdentifier" */
-    1007,    /* "subjectSignTool" */
-     498,    /* "subtreeMaximumQuality" */
-     497,    /* "subtreeMinimumQuality" */
-     890,    /* "supportedAlgorithms" */
-     874,    /* "supportedApplicationContext" */
-     402,    /* "targetInformation" */
-    1324,    /* "tcg" */
-    1333,    /* "tcg-address" */
-    1385,    /* "tcg-address-bluetoothmac" */
-    1383,    /* "tcg-address-ethernetmac" */
-    1384,    /* "tcg-address-wlanmac" */
-    1328,    /* "tcg-algorithm" */
-    1367,    /* "tcg-algorithm-null" */
-    1362,    /* "tcg-at-cryptographicAnchors" */
-    1339,    /* "tcg-at-platformConfigUri" */
-    1366,    /* "tcg-at-platformConfigUri-v3" */
-    1343,    /* "tcg-at-platformConfiguration" */
-    1363,    /* "tcg-at-platformConfiguration-v1" */
-    1364,    /* "tcg-at-platformConfiguration-v2" */
-    1365,    /* "tcg-at-platformConfiguration-v3" */
-    1344,    /* "tcg-at-platformIdentifier" */
-    1338,    /* "tcg-at-platformManufacturerId" */
-    1337,    /* "tcg-at-platformManufacturerStr" */
-    1340,    /* "tcg-at-platformModel" */
-    1342,    /* "tcg-at-platformSerial" */
-    1341,    /* "tcg-at-platformVersion" */
-    1360,    /* "tcg-at-previousPlatformCertificates" */
-    1348,    /* "tcg-at-securityQualities" */
-    1351,    /* "tcg-at-tbbProtectionProfile" */
-    1357,    /* "tcg-at-tbbSecurityAssertions" */
-    1361,    /* "tcg-at-tbbSecurityAssertions-v3" */
-    1352,    /* "tcg-at-tbbSecurityTarget" */
-    1358,    /* "tcg-at-tcgCredentialSpecification" */
-    1359,    /* "tcg-at-tcgCredentialType" */
-    1355,    /* "tcg-at-tcgPlatformSpecification" */
-    1353,    /* "tcg-at-tpmIdLabel" */
-    1345,    /* "tcg-at-tpmManufacturer" */
-    1346,    /* "tcg-at-tpmModel" */
-    1349,    /* "tcg-at-tpmProtectionProfile" */
-    1356,    /* "tcg-at-tpmSecurityAssertions" */
-    1350,    /* "tcg-at-tpmSecurityTarget" */
-    1354,    /* "tcg-at-tpmSpecification" */
-    1347,    /* "tcg-at-tpmVersion" */
-    1326,    /* "tcg-attribute" */
-    1332,    /* "tcg-ca" */
-    1392,    /* "tcg-cap-verifiedPlatformCertificate" */
-    1330,    /* "tcg-ce" */
-    1379,    /* "tcg-ce-migrationControllerAttestationService" */
-    1380,    /* "tcg-ce-migrationControllerRegistrationService" */
-    1376,    /* "tcg-ce-relevantCredentials" */
-    1377,    /* "tcg-ce-relevantManifests" */
-    1378,    /* "tcg-ce-virtualPlatformAttestationService" */
-    1381,    /* "tcg-ce-virtualPlatformBackupService" */
-    1336,    /* "tcg-common" */
-    1331,    /* "tcg-kp" */
-    1370,    /* "tcg-kp-AIKCertificate" */
-    1374,    /* "tcg-kp-AdditionalPlatformAttributeCertificate" */
-    1375,    /* "tcg-kp-AdditionalPlatformKeyCertificate" */
-    1372,    /* "tcg-kp-DeltaPlatformAttributeCertificate" */
-    1373,    /* "tcg-kp-DeltaPlatformKeyCertificate" */
-    1368,    /* "tcg-kp-EKCertificate" */
-    1369,    /* "tcg-kp-PlatformAttributeCertificate" */
-    1371,    /* "tcg-kp-PlatformKeyCertificate" */
-    1329,    /* "tcg-platformClass" */
-    1327,    /* "tcg-protocol" */
-    1382,    /* "tcg-prt-tpmIdProtocol" */
-    1334,    /* "tcg-registry" */
-    1386,    /* "tcg-registry-componentClass" */
-    1391,    /* "tcg-registry-componentClass-disk" */
-    1389,    /* "tcg-registry-componentClass-dmtf" */
-    1388,    /* "tcg-registry-componentClass-ietf" */
-    1390,    /* "tcg-registry-componentClass-pcie" */
-    1387,    /* "tcg-registry-componentClass-tcg" */
-    1325,    /* "tcg-tcpaSpecVersion" */
-    1393,    /* "tcg-tr-ID" */
-    1396,    /* "tcg-tr-ID-Boolean" */
-    1397,    /* "tcg-tr-ID-CertificateIdentifier" */
-    1398,    /* "tcg-tr-ID-CommonCriteria" */
-    1401,    /* "tcg-tr-ID-FIPSLevel" */
-    1414,    /* "tcg-tr-ID-IA5String" */
-    1402,    /* "tcg-tr-ID-ISO9000Level" */
-    1404,    /* "tcg-tr-ID-OID" */
-    1415,    /* "tcg-tr-ID-PEMCertString" */
-    1405,    /* "tcg-tr-ID-PEN" */
-    1416,    /* "tcg-tr-ID-PublicKey" */
-    1410,    /* "tcg-tr-ID-RTM" */
-    1412,    /* "tcg-tr-ID-URI" */
-    1413,    /* "tcg-tr-ID-UTF8String" */
-    1399,    /* "tcg-tr-ID-componentClass" */
-    1400,    /* "tcg-tr-ID-componentIdentifierV11" */
-    1403,    /* "tcg-tr-ID-networkMAC" */
-    1406,    /* "tcg-tr-ID-platformFirmwareCapabilities" */
-    1407,    /* "tcg-tr-ID-platformFirmwareSignatureVerification" */
-    1408,    /* "tcg-tr-ID-platformFirmwareUpdateCompliance" */
-    1409,    /* "tcg-tr-ID-platformHardwareCapabilities" */
-    1411,    /* "tcg-tr-ID-status" */
-    1441,    /* "tcg-tr-cat-CommonCriteria" */
-    1434,    /* "tcg-tr-cat-DICECertificate" */
-    1438,    /* "tcg-tr-cat-DeltaPlatformCertificate" */
-    1431,    /* "tcg-tr-cat-EKCertificate" */
-    1443,    /* "tcg-tr-cat-FIPSLevel" */
-    1432,    /* "tcg-tr-cat-IAKCertificate" */
-    1433,    /* "tcg-tr-cat-IDevIDCertificate" */
-    1444,    /* "tcg-tr-cat-ISO9000" */
-    1436,    /* "tcg-tr-cat-PEMCertificate" */
-    1447,    /* "tcg-tr-cat-PEN" */
-    1437,    /* "tcg-tr-cat-PlatformCertificate" */
-    1453,    /* "tcg-tr-cat-PublicKey" */
-    1452,    /* "tcg-tr-cat-RTM" */
-    1439,    /* "tcg-tr-cat-RebasePlatformCertificate" */
-    1435,    /* "tcg-tr-cat-SPDMCertificate" */
-    1446,    /* "tcg-tr-cat-attestationProtocol" */
-    1423,    /* "tcg-tr-cat-componentClass" */
-    1430,    /* "tcg-tr-cat-componentFieldReplaceable" */
-    1442,    /* "tcg-tr-cat-componentIdentifierV11" */
-    1428,    /* "tcg-tr-cat-componentLocation" */
-    1424,    /* "tcg-tr-cat-componentManufacturer" */
-    1425,    /* "tcg-tr-cat-componentModel" */
-    1429,    /* "tcg-tr-cat-componentRevision" */
-    1426,    /* "tcg-tr-cat-componentSerial" */
-    1427,    /* "tcg-tr-cat-componentStatus" */
-    1440,    /* "tcg-tr-cat-genericCertificate" */
-    1445,    /* "tcg-tr-cat-networkMAC" */
-    1448,    /* "tcg-tr-cat-platformFirmwareCapabilities" */
-    1450,    /* "tcg-tr-cat-platformFirmwareSignatureVerification" */
-    1451,    /* "tcg-tr-cat-platformFirmwareUpdateCompliance" */
-    1449,    /* "tcg-tr-cat-platformHardwareCapabilities" */
-    1417,    /* "tcg-tr-cat-platformManufacturer" */
-    1421,    /* "tcg-tr-cat-platformManufacturerIdentifier" */
-    1418,    /* "tcg-tr-cat-platformModel" */
-    1422,    /* "tcg-tr-cat-platformOwnership" */
-    1420,    /* "tcg-tr-cat-platformSerial" */
-    1419,    /* "tcg-tr-cat-platformVersion" */
-    1394,    /* "tcg-tr-category" */
-    1395,    /* "tcg-tr-registry" */
-    1335,    /* "tcg-traits" */
-     864,    /* "telephoneNumber" */
-     866,    /* "teletexTerminalIdentifier" */
-     865,    /* "telexNumber" */
-     459,    /* "textEncodedORAddress" */
-     293,    /* "textNotice" */
-    1299,    /* "timeSpecification" */
-     133,    /* "timeStamping" */
-     106,    /* "title" */
-    1020,    /* "tlsfeature" */
-     682,    /* "tpBasis" */
-     375,    /* "trustRoot" */
-    1151,    /* "ua-pki" */
-    1160,    /* "uacurve0" */
-    1161,    /* "uacurve1" */
-    1162,    /* "uacurve2" */
-    1163,    /* "uacurve3" */
-    1164,    /* "uacurve4" */
-    1165,    /* "uacurve5" */
-    1166,    /* "uacurve6" */
-    1167,    /* "uacurve7" */
-    1168,    /* "uacurve8" */
-    1169,    /* "uacurve9" */
-     436,    /* "ucl" */
-     102,    /* "uid" */
-     888,    /* "uniqueMember" */
-      55,    /* "unstructuredAddress" */
-      49,    /* "unstructuredName" */
-     880,    /* "userCertificate" */
-     465,    /* "userClass" */
-    1301,    /* "userNotice" */
-     879,    /* "userPassword" */
-     373,    /* "valid" */
-     678,    /* "wap" */
-     679,    /* "wap-wsg" */
-     735,    /* "wap-wsg-idm-ecid-wtls1" */
-     743,    /* "wap-wsg-idm-ecid-wtls10" */
-     744,    /* "wap-wsg-idm-ecid-wtls11" */
-     745,    /* "wap-wsg-idm-ecid-wtls12" */
-     736,    /* "wap-wsg-idm-ecid-wtls3" */
-     737,    /* "wap-wsg-idm-ecid-wtls4" */
-     738,    /* "wap-wsg-idm-ecid-wtls5" */
-     739,    /* "wap-wsg-idm-ecid-wtls6" */
-     740,    /* "wap-wsg-idm-ecid-wtls7" */
-     741,    /* "wap-wsg-idm-ecid-wtls8" */
-     742,    /* "wap-wsg-idm-ecid-wtls9" */
-     804,    /* "whirlpool" */
-     868,    /* "x121Address" */
-     503,    /* "x500UniqueIdentifier" */
-     158,    /* "x509Certificate" */
-     160,    /* "x509Crl" */
-    1093,    /* "x509ExtAdmission" */
-    1289,    /* "zstd" */
-};
-
-#define NUM_LN 1478
-static const unsigned int ln_objs[NUM_LN] = {
-     363,    /* "AD Time Stamping" */
-     405,    /* "ANSI X9.62" */
-     368,    /* "Acceptable OCSP Responses" */
-    1374,    /* "Additional Platform Attribute Certificate" */
-    1375,    /* "Additional Platform Key Certificate" */
-     910,    /* "Any Extended Key Usage" */
-     664,    /* "Any language" */
-    1370,    /* "Attestation Identity Key Certificate" */
-    1446,    /* "Attestation Protocol Trait Category" */
-    1411,    /* "Attribute Status Trait" */
-     177,    /* "Authority Information Access" */
-    1220,    /* "BGPsec Router" */
-     365,    /* "Basic OCSP Response" */
-     285,    /* "Biometric Info" */
-    1385,    /* "Bluetooth MAC Address" */
-    1396,    /* "Boolean Trait" */
-    1221,    /* "Brand Indicator for Message Identification" */
-    1288,    /* "Brotli compression" */
-     179,    /* "CA Issuers" */
-     785,    /* "CA Repository" */
-    1219,    /* "CMC Archive Server" */
-    1131,    /* "CMC Certificate Authority" */
-    1132,    /* "CMC Registration Authority" */
-     954,    /* "CT Certificate SCTs" */
-     952,    /* "CT Precertificate Poison" */
-     951,    /* "CT Precertificate SCTs" */
-     953,    /* "CT Precertificate Signer" */
-    1397,    /* "Certificate Identifier Trait" */
-    1222,    /* "Certificate Management Key Generation Authority" */
-    1227,    /* "Class of Signing Tool" */
-    1233,    /* "Class of Signing Tool KA1" */
-    1231,    /* "Class of Signing Tool KB1" */
-    1232,    /* "Class of Signing Tool KB2" */
-    1228,    /* "Class of Signing Tool KC1" */
-    1229,    /* "Class of Signing Tool KC2" */
-    1230,    /* "Class of Signing Tool KC3" */
-     131,    /* "Code Signing" */
-    1398,    /* "Common Criteria Trait" */
-    1441,    /* "Common Criteria Trait Category" */
-    1399,    /* "Component Class Trait" */
-    1423,    /* "Component Class Trait Category" */
-    1430,    /* "Component Field Replaceable Trait Category" */
-    1400,    /* "Component Identifier V1.1 Trait" */
-    1442,    /* "Component Identifier V1.1 Trait Category" */
-    1428,    /* "Component Location Trait Category" */
-    1424,    /* "Component Manufacturer Trait Category" */
-    1425,    /* "Component Model Trait Category" */
-    1429,    /* "Component Revision Trait Category" */
-    1426,    /* "Component Serial Trait Category" */
-    1427,    /* "Component Status Trait Category" */
-    1024,    /* "Ctrl/Provision WAP Termination" */
-    1023,    /* "Ctrl/provision WAP Access" */
-    1434,    /* "DICE Certificate Trait Category" */
-    1159,    /* "DSTU 4145-2002 big endian" */
-    1158,    /* "DSTU 4145-2002 little endian" */
-    1152,    /* "DSTU Gost 28147-2009" */
-    1154,    /* "DSTU Gost 28147-2009 CFB mode" */
-    1153,    /* "DSTU Gost 28147-2009 OFB mode" */
-    1155,    /* "DSTU Gost 28147-2009 key wrap" */
-    1157,    /* "DSTU Gost 34311-95" */
-    1160,    /* "DSTU curve 0" */
-    1161,    /* "DSTU curve 1" */
-    1162,    /* "DSTU curve 2" */
-    1163,    /* "DSTU curve 3" */
-    1164,    /* "DSTU curve 4" */
-    1165,    /* "DSTU curve 5" */
-    1166,    /* "DSTU curve 6" */
-    1167,    /* "DSTU curve 7" */
-    1168,    /* "DSTU curve 8" */
-    1169,    /* "DSTU curve 9" */
-    1372,    /* "Delta Platform Attribute Certificate" */
-    1438,    /* "Delta Platform Certificate Trait Category" */
-    1373,    /* "Delta Platform Key Certificate" */
-     783,    /* "Diffie-Hellman based MAC" */
-     382,    /* "Directory" */
-    1391,    /* "Disk Component Class" */
-    1389,    /* "Distributed Management Task Force Registry" */
-     392,    /* "Domain" */
-     132,    /* "E-mail Protection" */
-    1087,    /* "ED25519" */
-    1088,    /* "ED448" */
-    1431,    /* "EK Certificate Trait Category" */
-    1368,    /* "Endorsement Key Certificate" */
-     389,    /* "Enterprises" */
-    1383,    /* "Ethernet MAC Address" */
-     384,    /* "Experimental" */
-     372,    /* "Extended OCSP Status" */
-     172,    /* "Extension Request" */
-    1401,    /* "FIPS Level Trait" */
-    1443,    /* "FIPS Level Trait Category" */
-     813,    /* "GOST 28147-89" */
-     849,    /* "GOST 28147-89 Cryptocom ParamSet" */
-     815,    /* "GOST 28147-89 MAC" */
-    1003,    /* "GOST 28147-89 TC26 parameter set" */
-     851,    /* "GOST 34.10-2001 Cryptocom" */
-     850,    /* "GOST 34.10-94 Cryptocom" */
-     811,    /* "GOST R 34.10-2001" */
-     817,    /* "GOST R 34.10-2001 DH" */
-    1148,    /* "GOST R 34.10-2012 (256 bit) ParamSet A" */
-    1184,    /* "GOST R 34.10-2012 (256 bit) ParamSet B" */
-    1185,    /* "GOST R 34.10-2012 (256 bit) ParamSet C" */
-    1186,    /* "GOST R 34.10-2012 (256 bit) ParamSet D" */
-     998,    /* "GOST R 34.10-2012 (512 bit) ParamSet A" */
-     999,    /* "GOST R 34.10-2012 (512 bit) ParamSet B" */
-    1149,    /* "GOST R 34.10-2012 (512 bit) ParamSet C" */
-     997,    /* "GOST R 34.10-2012 (512 bit) testing parameter set" */
-     979,    /* "GOST R 34.10-2012 with 256 bit modulus" */
-     980,    /* "GOST R 34.10-2012 with 512 bit modulus" */
-     985,    /* "GOST R 34.10-2012 with GOST R 34.11-2012 (256 bit)" */
-     986,    /* "GOST R 34.10-2012 with GOST R 34.11-2012 (512 bit)" */
-     812,    /* "GOST R 34.10-94" */
-     818,    /* "GOST R 34.10-94 DH" */
-     982,    /* "GOST R 34.11-2012 with 256 bit hash" */
-     983,    /* "GOST R 34.11-2012 with 512 bit hash" */
-     809,    /* "GOST R 34.11-94" */
-     816,    /* "GOST R 34.11-94 PRF" */
-     807,    /* "GOST R 34.11-94 with GOST R 34.10-2001" */
-     853,    /* "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom" */
-     808,    /* "GOST R 34.11-94 with GOST R 34.10-94" */
-     852,    /* "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom" */
-     854,    /* "GOST R 3410-2001 Parameter Set Cryptocom" */
-    1440,    /* "Generic Certificate Trait Category" */
-    1472,    /* "HASH-ML-DSA-44-WITH-SHA512" */
-    1473,    /* "HASH-ML-DSA-65-WITH-SHA512" */
-    1474,    /* "HASH-ML-DSA-87-WITH-SHA512" */
-    1156,    /* "HMAC DSTU Gost 34311-95" */
-     988,    /* "HMAC GOST 34.11-2012 256 bit" */
-     989,    /* "HMAC GOST 34.11-2012 512 bit" */
-     810,    /* "HMAC GOST 34.11-94" */
-    1321,    /* "Hardware Module Name" */
-     432,    /* "Hold Instruction Call Issuer" */
-     430,    /* "Hold Instruction Code" */
-     431,    /* "Hold Instruction None" */
-     433,    /* "Hold Instruction Reject" */
-    1414,    /* "IA5String Trait" */
-    1432,    /* "IAK Certificate Trait Category" */
-     634,    /* "ICC or token signature" */
-    1433,    /* "IDevID Certificate Trait Category" */
-    1171,    /* "IEEE Security in Storage Working Group" */
-    1004,    /* "INN" */
-     294,    /* "IPSec End System" */
-     295,    /* "IPSec Tunnel" */
-     296,    /* "IPSec User" */
-    1402,    /* "ISO 9000 Level Trait" */
-    1444,    /* "ISO 9000 Trait Category" */
-    1140,    /* "ISO CN Member Body" */
-     182,    /* "ISO Member Body" */
-     183,    /* "ISO US Member Body" */
-    1150,    /* "ISO-UA" */
-     667,    /* "Independent" */
-     665,    /* "Inherit all" */
-     647,    /* "International Organizations" */
-    1388,    /* "Internet Engineering Task Force Registry" */
-     142,    /* "Invalidity Date" */
-     504,    /* "MIME MHS" */
-    1457,    /* "ML-DSA-44" */
-    1458,    /* "ML-DSA-65" */
-    1459,    /* "ML-DSA-87" */
-    1456,    /* "ML-KEM-1024" */
-    1454,    /* "ML-KEM-512" */
-    1455,    /* "ML-KEM-768" */
-     388,    /* "Mail" */
-     383,    /* "Management" */
-    1294,    /* "Microsoft Application Policies Extension" */
-     417,    /* "Microsoft CSP Name" */
-     135,    /* "Microsoft Commercial Code Signing" */
-     138,    /* "Microsoft Encrypted File System" */
-     171,    /* "Microsoft Extension Request" */
-     134,    /* "Microsoft Individual Code Signing" */
-     856,    /* "Microsoft Local Key set" */
-    1291,    /* "Microsoft NTDS AD objectSid" */
-    1292,    /* "Microsoft NTDS CA Extension" */
-     137,    /* "Microsoft Server Gated Crypto" */
-     648,    /* "Microsoft Smartcard Login" */
-     136,    /* "Microsoft Trust List Signing" */
-     649,    /* "Microsoft User Principal Name" */
-    1293,    /* "Microsoft certificate template" */
-    1379,    /* "Migration Controller Attestation Service" */
-    1380,    /* "Migration Controller Registration Service" */
-    1211,    /* "NAIRealm" */
-     393,    /* "NULL" */
-     404,    /* "NULL" */
-    1323,    /* "NULL" */
-      72,    /* "Netscape Base Url" */
-      76,    /* "Netscape CA Policy Url" */
-      74,    /* "Netscape CA Revocation Url" */
-      71,    /* "Netscape Cert Type" */
-      58,    /* "Netscape Certificate Extension" */
-      79,    /* "Netscape Certificate Sequence" */
-      78,    /* "Netscape Comment" */
-      57,    /* "Netscape Communications Corp." */
-      59,    /* "Netscape Data Type" */
-      75,    /* "Netscape Renewal Url" */
-      73,    /* "Netscape Revocation Url" */
-      77,    /* "Netscape SSL Server Name" */
-     139,    /* "Netscape Server Gated Crypto" */
-    1403,    /* "Network MAC Trait" */
-    1445,    /* "Network MAC Trait Category" */
-     178,    /* "OCSP" */
-     370,    /* "OCSP Archive Cutoff" */
-     367,    /* "OCSP CRL ID" */
-     369,    /* "OCSP No Check" */
-     366,    /* "OCSP Nonce" */
-     371,    /* "OCSP Service Locator" */
-     180,    /* "OCSP Signing" */
-    1005,    /* "OGRN" */
-    1226,    /* "OGRNIP" */
-    1404,    /* "Object Identifier Trait" */
-    1282,    /* "Oracle organization" */
-     161,    /* "PBES2" */
-      69,    /* "PBKDF2" */
-     162,    /* "PBMAC1" */
-    1390,    /* "PCIE Component Class" */
-    1436,    /* "PEM Certificate Trait Category" */
-    1415,    /* "PEM-Encoded Certificate String Trait" */
-    1032,    /* "PKINIT Client Auth" */
-     127,    /* "PKIX" */
-     858,    /* "Permanent Identifier" */
-    1369,    /* "Platform Attribute Certificate" */
-    1437,    /* "Platform Certificate Trait Category" */
-    1366,    /* "Platform Configuration URI Version 3" */
-    1363,    /* "Platform Configuration Version 1" */
-    1364,    /* "Platform Configuration Version 2" */
-    1365,    /* "Platform Configuration Version 3" */
-    1406,    /* "Platform Firmware Capabilities Trait" */
-    1448,    /* "Platform Firmware Capabilities Trait Category" */
-    1407,    /* "Platform Firmware Signature Verification Trait" */
-    1450,    /* "Platform Firmware Signature Verification Trait Category" */
-    1408,    /* "Platform Firmware Update Compliance Trait" */
-    1451,    /* "Platform Firmware Update Compliance Trait Category" */
-    1409,    /* "Platform Hardware Capabilities Trait" */
-    1449,    /* "Platform Hardware Capabilities Trait Category" */
-    1371,    /* "Platform Key Certificate" */
-    1421,    /* "Platform Manufacturer Identifier Trait Category" */
-    1417,    /* "Platform Manufacturer Trait Category" */
-    1418,    /* "Platform Model Trait Category" */
-    1422,    /* "Platform Ownership Trait Category" */
-    1420,    /* "Platform Serial Trait Category" */
-    1419,    /* "Platform Version Trait Category" */
-     164,    /* "Policy Qualifier CPS" */
-     165,    /* "Policy Qualifier User Notice" */
-     385,    /* "Private" */
-    1405,    /* "Private Enterprise Number Trait" */
-    1447,    /* "Private Enterprise Number Trait Category" */
-    1093,    /* "Professional Information or basis for Admission" */
-     663,    /* "Proxy Certificate Information" */
-    1416,    /* "Public Key Trait" */
-    1453,    /* "Public Key Trait Category" */
-    1243,    /* "RPKI Manifest" */
-    1245,    /* "RPKI Notify" */
-       1,    /* "RSA Data Security, Inc." */
-       2,    /* "RSA Data Security, Inc. PKCS" */
-    1116,    /* "RSA-SHA3-224" */
-    1117,    /* "RSA-SHA3-256" */
-    1118,    /* "RSA-SHA3-384" */
-    1119,    /* "RSA-SHA3-512" */
-    1439,    /* "Rebase Platform Certificate Trait Category" */
-    1376,    /* "Relevant Credentials" */
-    1377,    /* "Relevant Manifests" */
-    1410,    /* "Root of Trust for Measurement Trait" */
-    1452,    /* "Root of Trust of Measurement Trait Category" */
-     188,    /* "S/MIME" */
-     167,    /* "S/MIME Capabilities" */
-    1461,    /* "SLH-DSA-SHA2-128f" */
-    1476,    /* "SLH-DSA-SHA2-128f-WITH-SHA256" */
-    1460,    /* "SLH-DSA-SHA2-128s" */
-    1475,    /* "SLH-DSA-SHA2-128s-WITH-SHA256" */
-    1463,    /* "SLH-DSA-SHA2-192f" */
-    1478,    /* "SLH-DSA-SHA2-192f-WITH-SHA512" */
-    1462,    /* "SLH-DSA-SHA2-192s" */
-    1477,    /* "SLH-DSA-SHA2-192s-WITH-SHA512" */
-    1465,    /* "SLH-DSA-SHA2-256f" */
-    1480,    /* "SLH-DSA-SHA2-256f-WITH-SHA512" */
-    1464,    /* "SLH-DSA-SHA2-256s" */
-    1479,    /* "SLH-DSA-SHA2-256s-WITH-SHA512" */
-    1467,    /* "SLH-DSA-SHAKE-128f" */
-    1482,    /* "SLH-DSA-SHAKE-128f-WITH-SHAKE128" */
-    1466,    /* "SLH-DSA-SHAKE-128s" */
-    1481,    /* "SLH-DSA-SHAKE-128s-WITH-SHAKE128" */
-    1469,    /* "SLH-DSA-SHAKE-192f" */
-    1484,    /* "SLH-DSA-SHAKE-192f-WITH-SHAKE256" */
-    1468,    /* "SLH-DSA-SHAKE-192s" */
-    1483,    /* "SLH-DSA-SHAKE-192s-WITH-SHAKE256" */
-    1471,    /* "SLH-DSA-SHAKE-256f" */
-    1486,    /* "SLH-DSA-SHAKE-256f-WITH-SHAKE256" */
-    1470,    /* "SLH-DSA-SHAKE-256s" */
-    1485,    /* "SLH-DSA-SHAKE-256s-WITH-SHAKE256" */
-    1204,    /* "SM2-with-SM3" */
-    1006,    /* "SNILS" */
-     387,    /* "SNMPv2" */
-    1435,    /* "SPDM Certificate Trait Category" */
-    1210,    /* "SRVName" */
-    1025,    /* "SSH Client" */
-    1026,    /* "SSH Server" */
-     512,    /* "Secure Electronic Transactions" */
-     386,    /* "Security" */
-    1348,    /* "Security Qualities" */
-     394,    /* "Selected Attribute Types" */
-    1029,    /* "Send Owner" */
-    1030,    /* "Send Proxied Owner" */
-    1028,    /* "Send Proxied Router" */
-    1027,    /* "Send Router" */
-    1244,    /* "Signed Object" */
-    1033,    /* "Signing KDC Response" */
-    1008,    /* "Signing Tool of Issuer" */
-    1007,    /* "Signing Tool of Subject" */
-    1208,    /* "Smtp UTF8 Mailbox" */
-     143,    /* "Strong Extranet ID" */
-     398,    /* "Subject Information Access" */
-    1351,    /* "TBB Protection Profile" */
-    1357,    /* "TBB Security Assertions" */
-    1352,    /* "TBB Security Target" */
-    1386,    /* "TCG Component Class" */
-    1358,    /* "TCG Credential Specification" */
-    1359,    /* "TCG Credential Type" */
-    1362,    /* "TCG Cryptographic Anchors" */
-    1367,    /* "TCG NULL Algorithm" */
-    1343,    /* "TCG Platform Configuration" */
-    1339,    /* "TCG Platform Configuration URI" */
-    1344,    /* "TCG Platform Identifier" */
-    1338,    /* "TCG Platform Manufacturer ID" */
-    1337,    /* "TCG Platform Manufacturer String" */
-    1340,    /* "TCG Platform Model" */
-    1342,    /* "TCG Platform Serial Number" */
-    1341,    /* "TCG Platform Version" */
-    1360,    /* "TCG Previous Platform Certificates" */
-    1361,    /* "TCG TBB Security Assertions V3" */
-    1382,    /* "TCG TPM Protocol" */
-    1394,    /* "TCG Trait Categories" */
-    1393,    /* "TCG Trait Identifiers" */
-    1395,    /* "TCG Trait Registries" */
-    1392,    /* "TCG Verified Platform Certificate CA Policy" */
-    1020,    /* "TLS Feature" */
-     130,    /* "TLS Web Client Authentication" */
-     129,    /* "TLS Web Server Authentication" */
-    1353,    /* "TPM ID Label" */
-    1345,    /* "TPM Manufacturer" */
-    1346,    /* "TPM Model" */
-    1355,    /* "TPM Platform Specification" */
-    1349,    /* "TPM Protection Profile" */
-    1356,    /* "TPM Security Assertions" */
-    1350,    /* "TPM Security Target" */
-    1354,    /* "TPM Specification" */
-    1347,    /* "TPM Version" */
-     133,    /* "Time Stamping" */
-     375,    /* "Trust Root" */
-    1387,    /* "Trusted Computed Group Registry" */
-    1324,    /* "Trusted Computing Group" */
-    1333,    /* "Trusted Computing Group Address Formats" */
-    1328,    /* "Trusted Computing Group Algorithms" */
-    1326,    /* "Trusted Computing Group Attributes" */
-    1330,    /* "Trusted Computing Group Certificate Extensions" */
-    1332,    /* "Trusted Computing Group Certificate Policies" */
-    1336,    /* "Trusted Computing Group Common" */
-    1331,    /* "Trusted Computing Group Key Purposes" */
-    1329,    /* "Trusted Computing Group Platform Classes" */
-    1327,    /* "Trusted Computing Group Protocols" */
-    1334,    /* "Trusted Computing Group Registry" */
-    1335,    /* "Trusted Computing Group Traits" */
-    1283,    /* "Trusted key usage (Oracle)" */
-    1413,    /* "UTF8String Trait" */
-    1412,    /* "Uniform Resource Identifier Trait" */
-    1378,    /* "Virtual Platform Attestation Service" */
-    1381,    /* "Virtual Platform Backup Service" */
-    1384,    /* "WLAN MAC Address" */
-    1322,    /* "Wi-SUN Alliance Field Area Network (FAN)" */
-    1034,    /* "X25519" */
-    1035,    /* "X448" */
-      12,    /* "X509" */
-     402,    /* "X509v3 AC Targeting" */
-    1303,    /* "X509v3 Acceptable Certification Policies" */
-    1304,    /* "X509v3 Acceptable Privilege Policies" */
-    1311,    /* "X509v3 Allowed Attribute Assignments" */
-    1317,    /* "X509v3 Alternative Signature Algorithm" */
-    1318,    /* "X509v3 Alternative Signature Value" */
-     746,    /* "X509v3 Any Policy" */
-    1319,    /* "X509v3 Associated Information" */
-    1307,    /* "X509v3 Attribute Authority Issuing Distribution Point" */
-    1300,    /* "X509v3 Attribute Descriptor" */
-    1312,    /* "X509v3 Attribute Mappings" */
-     287,    /* "X509v3 Audit Identity" */
-    1295,    /* "X509v3 Authority Attribute Identifier" */
-      90,    /* "X509v3 Authority Key Identifier" */
-    1314,    /* "X509v3 Authorization Validation" */
-    1297,    /* "X509v3 Basic Attribute Certificate Constraints" */
-      87,    /* "X509v3 Basic Constraints" */
-     103,    /* "X509v3 CRL Distribution Points" */
-      88,    /* "X509v3 CRL Number" */
-     141,    /* "X509v3 CRL Reason Code" */
-     771,    /* "X509v3 Certificate Issuer" */
-      89,    /* "X509v3 Certificate Policies" */
-    1298,    /* "X509v3 Delegated Name Constraints" */
-     140,    /* "X509v3 Delta CRL Indicator" */
-     126,    /* "X509v3 Extended Key Usage" */
-     857,    /* "X509v3 Freshest CRL" */
-    1310,    /* "X509v3 Group Attribute Certificate" */
-    1313,    /* "X509v3 Holder Name Constraints" */
-    1305,    /* "X509v3 Indirect Issuer" */
-     748,    /* "X509v3 Inhibit Any Policy" */
-    1308,    /* "X509v3 Issued On Behalf Of" */
-      86,    /* "X509v3 Issuer Alternative Name" */
-     770,    /* "X509v3 Issuing Distribution Point" */
-      83,    /* "X509v3 Key Usage" */
-     666,    /* "X509v3 Name Constraints" */
-    1306,    /* "X509v3 No Assertion" */
-     403,    /* "X509v3 No Revocation Available" */
-     401,    /* "X509v3 Policy Constraints" */
-     747,    /* "X509v3 Policy Mappings" */
-      84,    /* "X509v3 Private Key Usage Period" */
-    1315,    /* "X509v3 Protocol Restriction" */
-    1296,    /* "X509v3 Role Specification Certificate Identifier" */
-    1309,    /* "X509v3 Single Use" */
-    1302,    /* "X509v3 Source of Authority Identifier" */
-      85,    /* "X509v3 Subject Alternative Name" */
-    1316,    /* "X509v3 Subject Alternative Public Key Info" */
-     769,    /* "X509v3 Subject Directory Attributes" */
-      82,    /* "X509v3 Subject Key Identifier" */
-    1299,    /* "X509v3 Time Specification" */
-    1301,    /* "X509v3 User Notice" */
-     920,    /* "X9.42 DH" */
-     184,    /* "X9.57" */
-     185,    /* "X9.57 CM ?" */
-    1209,    /* "XmppAddr" */
-    1289,    /* "Zstandard compression" */
-     478,    /* "aRecord" */
-     289,    /* "aaControls" */
-     397,    /* "ac-proxying" */
-     288,    /* "ac-targeting" */
-     446,    /* "account" */
-     364,    /* "ad dvcs" */
-     606,    /* "additional verification" */
-     419,    /* "aes-128-cbc" */
-     916,    /* "aes-128-cbc-hmac-sha1" */
-     948,    /* "aes-128-cbc-hmac-sha256" */
-     896,    /* "aes-128-ccm" */
-     421,    /* "aes-128-cfb" */
-     650,    /* "aes-128-cfb1" */
-     653,    /* "aes-128-cfb8" */
-     904,    /* "aes-128-ctr" */
-     418,    /* "aes-128-ecb" */
-     895,    /* "aes-128-gcm" */
-     958,    /* "aes-128-ocb" */
-     420,    /* "aes-128-ofb" */
-    1198,    /* "aes-128-siv" */
-     913,    /* "aes-128-xts" */
-     423,    /* "aes-192-cbc" */
-     917,    /* "aes-192-cbc-hmac-sha1" */
-     949,    /* "aes-192-cbc-hmac-sha256" */
-     899,    /* "aes-192-ccm" */
-     425,    /* "aes-192-cfb" */
-     651,    /* "aes-192-cfb1" */
-     654,    /* "aes-192-cfb8" */
-     905,    /* "aes-192-ctr" */
-     422,    /* "aes-192-ecb" */
-     898,    /* "aes-192-gcm" */
-     959,    /* "aes-192-ocb" */
-     424,    /* "aes-192-ofb" */
-    1199,    /* "aes-192-siv" */
-     427,    /* "aes-256-cbc" */
-     918,    /* "aes-256-cbc-hmac-sha1" */
-     950,    /* "aes-256-cbc-hmac-sha256" */
-     902,    /* "aes-256-ccm" */
-     429,    /* "aes-256-cfb" */
-     652,    /* "aes-256-cfb1" */
-     655,    /* "aes-256-cfb8" */
-     906,    /* "aes-256-ctr" */
-     426,    /* "aes-256-ecb" */
-     901,    /* "aes-256-gcm" */
-     960,    /* "aes-256-ocb" */
-     428,    /* "aes-256-ofb" */
-    1200,    /* "aes-256-siv" */
-     914,    /* "aes-256-xts" */
-     376,    /* "algorithm" */
-    1066,    /* "aria-128-cbc" */
-    1120,    /* "aria-128-ccm" */
-    1067,    /* "aria-128-cfb" */
-    1080,    /* "aria-128-cfb1" */
-    1083,    /* "aria-128-cfb8" */
-    1069,    /* "aria-128-ctr" */
-    1065,    /* "aria-128-ecb" */
-    1123,    /* "aria-128-gcm" */
-    1068,    /* "aria-128-ofb" */
-    1071,    /* "aria-192-cbc" */
-    1121,    /* "aria-192-ccm" */
-    1072,    /* "aria-192-cfb" */
-    1081,    /* "aria-192-cfb1" */
-    1084,    /* "aria-192-cfb8" */
-    1074,    /* "aria-192-ctr" */
-    1070,    /* "aria-192-ecb" */
-    1124,    /* "aria-192-gcm" */
-    1073,    /* "aria-192-ofb" */
-    1076,    /* "aria-256-cbc" */
-    1122,    /* "aria-256-ccm" */
-    1077,    /* "aria-256-cfb" */
-    1082,    /* "aria-256-cfb1" */
-    1085,    /* "aria-256-cfb8" */
-    1079,    /* "aria-256-ctr" */
-    1075,    /* "aria-256-ecb" */
-    1125,    /* "aria-256-gcm" */
-    1078,    /* "aria-256-ofb" */
-     484,    /* "associatedDomain" */
-     485,    /* "associatedName" */
-     501,    /* "audio" */
-    1064,    /* "auth-any" */
-    1049,    /* "auth-dss" */
-    1047,    /* "auth-ecdsa" */
-    1050,    /* "auth-gost01" */
-    1051,    /* "auth-gost12" */
-    1053,    /* "auth-null" */
-    1048,    /* "auth-psk" */
-    1046,    /* "auth-rsa" */
-    1052,    /* "auth-srp" */
-     882,    /* "authorityRevocationList" */
-      91,    /* "bf-cbc" */
-      93,    /* "bf-cfb" */
-      92,    /* "bf-ecb" */
-      94,    /* "bf-ofb" */
-    1056,    /* "blake2b512" */
-    1201,    /* "blake2bmac" */
-    1057,    /* "blake2s256" */
-    1202,    /* "blake2smac" */
-     921,    /* "brainpoolP160r1" */
-     922,    /* "brainpoolP160t1" */
-     923,    /* "brainpoolP192r1" */
-     924,    /* "brainpoolP192t1" */
-     925,    /* "brainpoolP224r1" */
-     926,    /* "brainpoolP224t1" */
-     927,    /* "brainpoolP256r1" */
-    1285,    /* "brainpoolP256r1tls13" */
-     928,    /* "brainpoolP256t1" */
-     929,    /* "brainpoolP320r1" */
-     930,    /* "brainpoolP320t1" */
-     931,    /* "brainpoolP384r1" */
-    1286,    /* "brainpoolP384r1tls13" */
-     932,    /* "brainpoolP384t1" */
-     933,    /* "brainpoolP512r1" */
-    1287,    /* "brainpoolP512r1tls13" */
-     934,    /* "brainpoolP512t1" */
-     494,    /* "buildingName" */
-     860,    /* "businessCategory" */
-     691,    /* "c2onb191v4" */
-     692,    /* "c2onb191v5" */
-     697,    /* "c2onb239v4" */
-     698,    /* "c2onb239v5" */
-     684,    /* "c2pnb163v1" */
-     685,    /* "c2pnb163v2" */
-     686,    /* "c2pnb163v3" */
-     687,    /* "c2pnb176v1" */
-     693,    /* "c2pnb208w1" */
-     699,    /* "c2pnb272w1" */
-     700,    /* "c2pnb304w1" */
-     702,    /* "c2pnb368w1" */
-     688,    /* "c2tnb191v1" */
-     689,    /* "c2tnb191v2" */
-     690,    /* "c2tnb191v3" */
-     694,    /* "c2tnb239v1" */
-     695,    /* "c2tnb239v2" */
-     696,    /* "c2tnb239v3" */
-     701,    /* "c2tnb359v1" */
-     703,    /* "c2tnb431r1" */
-     881,    /* "cACertificate" */
-     483,    /* "cNAMERecord" */
-    1273,    /* "cades" */
-    1274,    /* "cades-attributes" */
-     751,    /* "camellia-128-cbc" */
-     962,    /* "camellia-128-ccm" */
-     757,    /* "camellia-128-cfb" */
-     760,    /* "camellia-128-cfb1" */
-     763,    /* "camellia-128-cfb8" */
-     964,    /* "camellia-128-cmac" */
-     963,    /* "camellia-128-ctr" */
-     754,    /* "camellia-128-ecb" */
-     961,    /* "camellia-128-gcm" */
-     766,    /* "camellia-128-ofb" */
-     752,    /* "camellia-192-cbc" */
-     966,    /* "camellia-192-ccm" */
-     758,    /* "camellia-192-cfb" */
-     761,    /* "camellia-192-cfb1" */
-     764,    /* "camellia-192-cfb8" */
-     968,    /* "camellia-192-cmac" */
-     967,    /* "camellia-192-ctr" */
-     755,    /* "camellia-192-ecb" */
-     965,    /* "camellia-192-gcm" */
-     767,    /* "camellia-192-ofb" */
-     753,    /* "camellia-256-cbc" */
-     970,    /* "camellia-256-ccm" */
-     759,    /* "camellia-256-cfb" */
-     762,    /* "camellia-256-cfb1" */
-     765,    /* "camellia-256-cfb8" */
-     972,    /* "camellia-256-cmac" */
-     971,    /* "camellia-256-ctr" */
-     756,    /* "camellia-256-ecb" */
-     969,    /* "camellia-256-gcm" */
-     768,    /* "camellia-256-ofb" */
-     443,    /* "caseIgnoreIA5StringSyntax" */
-     108,    /* "cast5-cbc" */
-     110,    /* "cast5-cfb" */
-     109,    /* "cast5-ecb" */
-     111,    /* "cast5-ofb" */
-     152,    /* "certBag" */
-     677,    /* "certicom-arc" */
-     517,    /* "certificate extensions" */
-     883,    /* "certificateRevocationList" */
-    1019,    /* "chacha20" */
-    1018,    /* "chacha20-poly1305" */
-      54,    /* "challengePassword" */
-     407,    /* "characteristic-two-field" */
-     395,    /* "clearance" */
-     633,    /* "cleartext track 2" */
-     894,    /* "cmac" */
-      13,    /* "commonName" */
-     513,    /* "content types" */
-      50,    /* "contentType" */
-      53,    /* "countersignature" */
-    1090,    /* "countryCode3c" */
-    1091,    /* "countryCode3n" */
-      14,    /* "countryName" */
-     153,    /* "crlBag" */
-     884,    /* "crossCertificatePair" */
-     806,    /* "cryptocom" */
-     805,    /* "cryptopro" */
-     500,    /* "dITRedirect" */
-     451,    /* "dNSDomain" */
-     495,    /* "dSAQuality" */
-     434,    /* "data" */
-     390,    /* "dcObject" */
-     891,    /* "deltaRevocationList" */
-      31,    /* "des-cbc" */
-     643,    /* "des-cdmf" */
-      30,    /* "des-cfb" */
-     656,    /* "des-cfb1" */
-     657,    /* "des-cfb8" */
-      29,    /* "des-ecb" */
-      32,    /* "des-ede" */
-      43,    /* "des-ede-cbc" */
-      60,    /* "des-ede-cfb" */
-      62,    /* "des-ede-ofb" */
-      33,    /* "des-ede3" */
-      44,    /* "des-ede3-cbc" */
-      61,    /* "des-ede3-cfb" */
-     658,    /* "des-ede3-cfb1" */
-     659,    /* "des-ede3-cfb8" */
-      63,    /* "des-ede3-ofb" */
-      45,    /* "des-ofb" */
-     107,    /* "description" */
-     871,    /* "destinationIndicator" */
-      80,    /* "desx-cbc" */
-     947,    /* "dh-cofactor-kdf" */
-     946,    /* "dh-std-kdf" */
-      28,    /* "dhKeyAgreement" */
-     941,    /* "dhSinglePass-cofactorDH-sha1kdf-scheme" */
-     942,    /* "dhSinglePass-cofactorDH-sha224kdf-scheme" */
-     943,    /* "dhSinglePass-cofactorDH-sha256kdf-scheme" */
-     944,    /* "dhSinglePass-cofactorDH-sha384kdf-scheme" */
-     945,    /* "dhSinglePass-cofactorDH-sha512kdf-scheme" */
-     936,    /* "dhSinglePass-stdDH-sha1kdf-scheme" */
-     937,    /* "dhSinglePass-stdDH-sha224kdf-scheme" */
-     938,    /* "dhSinglePass-stdDH-sha256kdf-scheme" */
-     939,    /* "dhSinglePass-stdDH-sha384kdf-scheme" */
-     940,    /* "dhSinglePass-stdDH-sha512kdf-scheme" */
-      11,    /* "directory services (X.500)" */
-     378,    /* "directory services - algorithms" */
-     887,    /* "distinguishedName" */
-     892,    /* "dmdName" */
-     174,    /* "dnQualifier" */
-    1092,    /* "dnsName" */
-     447,    /* "document" */
-     471,    /* "documentAuthor" */
-     468,    /* "documentIdentifier" */
-     472,    /* "documentLocation" */
-     502,    /* "documentPublisher" */
-     449,    /* "documentSeries" */
-     469,    /* "documentTitle" */
-     470,    /* "documentVersion" */
-     380,    /* "dod" */
-     391,    /* "domainComponent" */
-     452,    /* "domainRelatedObject" */
-     116,    /* "dsaEncryption" */
-      67,    /* "dsaEncryption-old" */
-      66,    /* "dsaWithSHA" */
-     113,    /* "dsaWithSHA1" */
-      70,    /* "dsaWithSHA1-old" */
-     802,    /* "dsa_with_SHA224" */
-     803,    /* "dsa_with_SHA256" */
-    1108,    /* "dsa_with_SHA3-224" */
-    1109,    /* "dsa_with_SHA3-256" */
-    1110,    /* "dsa_with_SHA3-384" */
-    1111,    /* "dsa_with_SHA3-512" */
-    1106,    /* "dsa_with_SHA384" */
-    1107,    /* "dsa_with_SHA512" */
-     297,    /* "dvcs" */
-     791,    /* "ecdsa-with-Recommended" */
-     416,    /* "ecdsa-with-SHA1" */
-     793,    /* "ecdsa-with-SHA224" */
-     794,    /* "ecdsa-with-SHA256" */
-     795,    /* "ecdsa-with-SHA384" */
-     796,    /* "ecdsa-with-SHA512" */
-     792,    /* "ecdsa-with-Specified" */
-    1112,    /* "ecdsa_with_SHA3-224" */
-    1113,    /* "ecdsa_with_SHA3-256" */
-    1114,    /* "ecdsa_with_SHA3-384" */
-    1115,    /* "ecdsa_with_SHA3-512" */
-    1266,    /* "electronic-signature-standard" */
-      48,    /* "emailAddress" */
-     632,    /* "encrypted track 2" */
-     885,    /* "enhancedSearchGuide" */
-    1267,    /* "ess-attributes" */
-    1265,    /* "etsi" */
-      56,    /* "extendedCertificateAttributes" */
-     867,    /* "facsimileTelephoneNumber" */
-     462,    /* "favouriteDrink" */
-    1126,    /* "ffdhe2048" */
-    1127,    /* "ffdhe3072" */
-    1128,    /* "ffdhe4096" */
-    1129,    /* "ffdhe6144" */
-    1130,    /* "ffdhe8192" */
-     453,    /* "friendlyCountry" */
-     490,    /* "friendlyCountryName" */
-     156,    /* "friendlyName" */
-     631,    /* "generate cryptogram" */
-     509,    /* "generationQualifier" */
-     601,    /* "generic cryptogram" */
-      99,    /* "givenName" */
-    1195,    /* "gmac" */
-     976,    /* "gost-mac-12" */
-    1009,    /* "gost89-cbc" */
-     814,    /* "gost89-cnt" */
-     975,    /* "gost89-cnt-12" */
-    1011,    /* "gost89-ctr" */
-    1010,    /* "gost89-ecb" */
-    1036,    /* "hkdf" */
-     855,    /* "hmac" */
-     780,    /* "hmac-md5" */
-     781,    /* "hmac-sha1" */
-    1102,    /* "hmac-sha3-224" */
-    1103,    /* "hmac-sha3-256" */
-    1104,    /* "hmac-sha3-384" */
-    1105,    /* "hmac-sha3-512" */
-     797,    /* "hmacWithMD5" */
-     163,    /* "hmacWithSHA1" */
-     798,    /* "hmacWithSHA224" */
-     799,    /* "hmacWithSHA256" */
-     800,    /* "hmacWithSHA384" */
-     801,    /* "hmacWithSHA512" */
-    1193,    /* "hmacWithSHA512-224" */
-    1194,    /* "hmacWithSHA512-256" */
-    1281,    /* "hmacWithSM3" */
-     486,    /* "homePostalAddress" */
-     473,    /* "homeTelephoneNumber" */
-     466,    /* "host" */
-     889,    /* "houseIdentifier" */
-     442,    /* "iA5StringSyntax" */
-     381,    /* "iana" */
-     824,    /* "id-Gost28147-89-CryptoPro-A-ParamSet" */
-     825,    /* "id-Gost28147-89-CryptoPro-B-ParamSet" */
-     826,    /* "id-Gost28147-89-CryptoPro-C-ParamSet" */
-     827,    /* "id-Gost28147-89-CryptoPro-D-ParamSet" */
-     819,    /* "id-Gost28147-89-CryptoPro-KeyMeshing" */
-     829,    /* "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet" */
-     828,    /* "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet" */
-     830,    /* "id-Gost28147-89-CryptoPro-RIC-1-ParamSet" */
-     820,    /* "id-Gost28147-89-None-KeyMeshing" */
-     823,    /* "id-Gost28147-89-TestParamSet" */
-     840,    /* "id-GostR3410-2001-CryptoPro-A-ParamSet" */
-     841,    /* "id-GostR3410-2001-CryptoPro-B-ParamSet" */
-     842,    /* "id-GostR3410-2001-CryptoPro-C-ParamSet" */
-     843,    /* "id-GostR3410-2001-CryptoPro-XchA-ParamSet" */
-     844,    /* "id-GostR3410-2001-CryptoPro-XchB-ParamSet" */
-     839,    /* "id-GostR3410-2001-TestParamSet" */
-     832,    /* "id-GostR3410-94-CryptoPro-A-ParamSet" */
-     833,    /* "id-GostR3410-94-CryptoPro-B-ParamSet" */
-     834,    /* "id-GostR3410-94-CryptoPro-C-ParamSet" */
-     835,    /* "id-GostR3410-94-CryptoPro-D-ParamSet" */
-     836,    /* "id-GostR3410-94-CryptoPro-XchA-ParamSet" */
-     837,    /* "id-GostR3410-94-CryptoPro-XchB-ParamSet" */
-     838,    /* "id-GostR3410-94-CryptoPro-XchC-ParamSet" */
-     831,    /* "id-GostR3410-94-TestParamSet" */
-     845,    /* "id-GostR3410-94-a" */
-     846,    /* "id-GostR3410-94-aBis" */
-     847,    /* "id-GostR3410-94-b" */
-     848,    /* "id-GostR3410-94-bBis" */
-     822,    /* "id-GostR3411-94-CryptoProParamSet" */
-     821,    /* "id-GostR3411-94-TestParamSet" */
-    1272,    /* "id-aa-ATSHashIndex" */
-    1277,    /* "id-aa-ATSHashIndex-v2" */
-    1278,    /* "id-aa-ATSHashIndex-v3" */
-    1263,    /* "id-aa-CMSAlgorithmProtection" */
-    1270,    /* "id-aa-ets-SignaturePolicyDocument" */
-    1280,    /* "id-aa-ets-archiveTimestampV2" */
-    1271,    /* "id-aa-ets-archiveTimestampV3" */
-    1261,    /* "id-aa-ets-attrCertificateRefs" */
-    1262,    /* "id-aa-ets-attrRevocationRefs" */
-    1269,    /* "id-aa-ets-longTermValidation" */
-    1268,    /* "id-aa-ets-mimeType" */
-    1276,    /* "id-aa-ets-sigPolicyStore" */
-    1275,    /* "id-aa-ets-signerAttrV2" */
-     266,    /* "id-aca" */
-     355,    /* "id-aca-accessIdentity" */
-     354,    /* "id-aca-authenticationInfo" */
-     356,    /* "id-aca-chargingIdentity" */
-     399,    /* "id-aca-encAttrs" */
-     357,    /* "id-aca-group" */
-     358,    /* "id-aca-role" */
-     176,    /* "id-ad" */
-     788,    /* "id-aes128-wrap" */
-     897,    /* "id-aes128-wrap-pad" */
-     789,    /* "id-aes192-wrap" */
-     900,    /* "id-aes192-wrap-pad" */
-     790,    /* "id-aes256-wrap" */
-     903,    /* "id-aes256-wrap-pad" */
-     262,    /* "id-alg" */
-     893,    /* "id-alg-PWRI-KEK" */
-     323,    /* "id-alg-des40" */
-     326,    /* "id-alg-dh-pop" */
-     325,    /* "id-alg-dh-sig-hmac-sha1" */
-     324,    /* "id-alg-noSignature" */
-     907,    /* "id-camellia128-wrap" */
-     908,    /* "id-camellia192-wrap" */
-     909,    /* "id-camellia256-wrap" */
-     268,    /* "id-cct" */
-     361,    /* "id-cct-PKIData" */
-     362,    /* "id-cct-PKIResponse" */
-     360,    /* "id-cct-crs" */
-      81,    /* "id-ce" */
-     680,    /* "id-characteristic-two-basis" */
-     263,    /* "id-cmc" */
-     334,    /* "id-cmc-addExtensions" */
-     346,    /* "id-cmc-confirmCertAcceptance" */
-     330,    /* "id-cmc-dataReturn" */
-     336,    /* "id-cmc-decryptedPOP" */
-     335,    /* "id-cmc-encryptedPOP" */
-     339,    /* "id-cmc-getCRL" */
-     338,    /* "id-cmc-getCert" */
-     328,    /* "id-cmc-identification" */
-     329,    /* "id-cmc-identityProof" */
-     337,    /* "id-cmc-lraPOPWitness" */
-     344,    /* "id-cmc-popLinkRandom" */
-     345,    /* "id-cmc-popLinkWitness" */
-     343,    /* "id-cmc-queryPending" */
-     333,    /* "id-cmc-recipientNonce" */
-     341,    /* "id-cmc-regInfo" */
-     342,    /* "id-cmc-responseInfo" */
-     340,    /* "id-cmc-revokeRequest" */
-     332,    /* "id-cmc-senderNonce" */
-     327,    /* "id-cmc-statusInfo" */
-     331,    /* "id-cmc-transactionId" */
-    1238,    /* "id-cp" */
-    1250,    /* "id-ct-ASPA" */
-     787,    /* "id-ct-asciiTextWithCRLF" */
-    1246,    /* "id-ct-geofeedCSVwithCRLF" */
-    1237,    /* "id-ct-resourceTaggedAttest" */
-    1234,    /* "id-ct-routeOriginAuthz" */
-    1236,    /* "id-ct-rpkiGhostbusters" */
-    1235,    /* "id-ct-rpkiManifest" */
-    1320,    /* "id-ct-rpkiSignedPrefixList" */
-    1247,    /* "id-ct-signedChecklist" */
-    1284,    /* "id-ct-signedTAL" */
-    1060,    /* "id-ct-xml" */
-     408,    /* "id-ecPublicKey" */
-     508,    /* "id-hex-multipart-message" */
-     507,    /* "id-hex-partial-message" */
-     260,    /* "id-it" */
-    1223,    /* "id-it-caCerts" */
-     302,    /* "id-it-caKeyUpdateInfo" */
-     298,    /* "id-it-caProtEncCert" */
-    1255,    /* "id-it-certProfile" */
-    1225,    /* "id-it-certReqTemplate" */
-     311,    /* "id-it-confirmWaitTime" */
-    1256,    /* "id-it-crlStatusList" */
-    1257,    /* "id-it-crls" */
-     303,    /* "id-it-currentCRL" */
-     300,    /* "id-it-encKeyPairTypes" */
-     310,    /* "id-it-implicitConfirm" */
-     308,    /* "id-it-keyPairParamRep" */
-     307,    /* "id-it-keyPairParamReq" */
-     312,    /* "id-it-origPKIMessage" */
-     301,    /* "id-it-preferredSymmAlg" */
-     309,    /* "id-it-revPassphrase" */
-    1254,    /* "id-it-rootCaCert" */
-    1224,    /* "id-it-rootCaKeyUpdate" */
-     299,    /* "id-it-signKeyPairTypes" */
-     305,    /* "id-it-subscriptionRequest" */
-     306,    /* "id-it-subscriptionResponse" */
-     784,    /* "id-it-suppLangTags" */
-     304,    /* "id-it-unsupportedOIDs" */
-     128,    /* "id-kp" */
-     280,    /* "id-mod-attribute-cert" */
-     274,    /* "id-mod-cmc" */
-     277,    /* "id-mod-cmp" */
-     284,    /* "id-mod-cmp2000" */
-    1251,    /* "id-mod-cmp2000-02" */
-    1253,    /* "id-mod-cmp2021-02" */
-    1252,    /* "id-mod-cmp2021-88" */
-     273,    /* "id-mod-crmf" */
-     283,    /* "id-mod-dvcs" */
-     275,    /* "id-mod-kea-profile-88" */
-     276,    /* "id-mod-kea-profile-93" */
-     282,    /* "id-mod-ocsp" */
-     278,    /* "id-mod-qualified-cert-88" */
-     279,    /* "id-mod-qualified-cert-93" */
-     281,    /* "id-mod-timestamp-protocol" */
-     264,    /* "id-on" */
-     347,    /* "id-on-personalData" */
-     265,    /* "id-pda" */
-     352,    /* "id-pda-countryOfCitizenship" */
-     353,    /* "id-pda-countryOfResidence" */
-     348,    /* "id-pda-dateOfBirth" */
-     351,    /* "id-pda-gender" */
-     349,    /* "id-pda-placeOfBirth" */
-     175,    /* "id-pe" */
-    1031,    /* "id-pkinit" */
-     261,    /* "id-pkip" */
-     258,    /* "id-pkix-mod" */
-     269,    /* "id-pkix1-explicit-88" */
-     271,    /* "id-pkix1-explicit-93" */
-     270,    /* "id-pkix1-implicit-88" */
-     272,    /* "id-pkix1-implicit-93" */
-     662,    /* "id-ppl" */
-     267,    /* "id-qcs" */
-     359,    /* "id-qcs-pkixQCSyntax-v1" */
-     259,    /* "id-qt" */
-     313,    /* "id-regCtrl" */
-    1259,    /* "id-regCtrl-algId" */
-    1258,    /* "id-regCtrl-altCertTemplate" */
-     316,    /* "id-regCtrl-authenticator" */
-     319,    /* "id-regCtrl-oldCertID" */
-     318,    /* "id-regCtrl-pkiArchiveOptions" */
-     317,    /* "id-regCtrl-pkiPublicationInfo" */
-     320,    /* "id-regCtrl-protocolEncrKey" */
-     315,    /* "id-regCtrl-regToken" */
-    1260,    /* "id-regCtrl-rsaKeyLen" */
-     314,    /* "id-regInfo" */
-     322,    /* "id-regInfo-certReq" */
-     321,    /* "id-regInfo-utf8Pairs" */
-     191,    /* "id-smime-aa" */
-     215,    /* "id-smime-aa-contentHint" */
-     218,    /* "id-smime-aa-contentIdentifier" */
-     221,    /* "id-smime-aa-contentReference" */
-     240,    /* "id-smime-aa-dvcs-dvc" */
-     217,    /* "id-smime-aa-encapContentType" */
-     222,    /* "id-smime-aa-encrypKeyPref" */
-     220,    /* "id-smime-aa-equivalentLabels" */
-     232,    /* "id-smime-aa-ets-CertificateRefs" */
-     233,    /* "id-smime-aa-ets-RevocationRefs" */
-     238,    /* "id-smime-aa-ets-archiveTimeStamp" */
-     237,    /* "id-smime-aa-ets-certCRLTimestamp" */
-     234,    /* "id-smime-aa-ets-certValues" */
-     227,    /* "id-smime-aa-ets-commitmentType" */
-     231,    /* "id-smime-aa-ets-contentTimestamp" */
-     236,    /* "id-smime-aa-ets-escTimeStamp" */
-     230,    /* "id-smime-aa-ets-otherSigCert" */
-     235,    /* "id-smime-aa-ets-revocationValues" */
-     226,    /* "id-smime-aa-ets-sigPolicyId" */
-     229,    /* "id-smime-aa-ets-signerAttr" */
-     228,    /* "id-smime-aa-ets-signerLocation" */
-     219,    /* "id-smime-aa-macValue" */
-     214,    /* "id-smime-aa-mlExpandHistory" */
-     216,    /* "id-smime-aa-msgSigDigest" */
-     212,    /* "id-smime-aa-receiptRequest" */
-     213,    /* "id-smime-aa-securityLabel" */
-     239,    /* "id-smime-aa-signatureType" */
-     223,    /* "id-smime-aa-signingCertificate" */
-    1086,    /* "id-smime-aa-signingCertificateV2" */
-     224,    /* "id-smime-aa-smimeEncryptCerts" */
-     225,    /* "id-smime-aa-timeStampToken" */
-     192,    /* "id-smime-alg" */
-     243,    /* "id-smime-alg-3DESwrap" */
-     246,    /* "id-smime-alg-CMS3DESwrap" */
-     247,    /* "id-smime-alg-CMSRC2wrap" */
-     245,    /* "id-smime-alg-ESDH" */
-     241,    /* "id-smime-alg-ESDHwith3DES" */
-     242,    /* "id-smime-alg-ESDHwithRC2" */
-     244,    /* "id-smime-alg-RC2wrap" */
-     193,    /* "id-smime-cd" */
-     248,    /* "id-smime-cd-ldap" */
-     190,    /* "id-smime-ct" */
-     210,    /* "id-smime-ct-DVCSRequestData" */
-     211,    /* "id-smime-ct-DVCSResponseData" */
-     208,    /* "id-smime-ct-TDTInfo" */
-     207,    /* "id-smime-ct-TSTInfo" */
-     205,    /* "id-smime-ct-authData" */
-    1059,    /* "id-smime-ct-authEnvelopedData" */
-     786,    /* "id-smime-ct-compressedData" */
-    1058,    /* "id-smime-ct-contentCollection" */
-     209,    /* "id-smime-ct-contentInfo" */
-     206,    /* "id-smime-ct-publishCert" */
-     204,    /* "id-smime-ct-receipt" */
-     195,    /* "id-smime-cti" */
-     255,    /* "id-smime-cti-ets-proofOfApproval" */
-     256,    /* "id-smime-cti-ets-proofOfCreation" */
-     253,    /* "id-smime-cti-ets-proofOfDelivery" */
-     251,    /* "id-smime-cti-ets-proofOfOrigin" */
-     252,    /* "id-smime-cti-ets-proofOfReceipt" */
-     254,    /* "id-smime-cti-ets-proofOfSender" */
-     189,    /* "id-smime-mod" */
-     196,    /* "id-smime-mod-cms" */
-     197,    /* "id-smime-mod-ess" */
-     202,    /* "id-smime-mod-ets-eSigPolicy-88" */
-     203,    /* "id-smime-mod-ets-eSigPolicy-97" */
-     200,    /* "id-smime-mod-ets-eSignature-88" */
-     201,    /* "id-smime-mod-ets-eSignature-97" */
-     199,    /* "id-smime-mod-msg-v3" */
-     198,    /* "id-smime-mod-oid" */
-     194,    /* "id-smime-spq" */
-     250,    /* "id-smime-spq-ets-sqt-unotice" */
-     249,    /* "id-smime-spq-ets-sqt-uri" */
-     974,    /* "id-tc26" */
-     991,    /* "id-tc26-agreement" */
-     992,    /* "id-tc26-agreement-gost-3410-2012-256" */
-     993,    /* "id-tc26-agreement-gost-3410-2012-512" */
-     977,    /* "id-tc26-algorithms" */
-     990,    /* "id-tc26-cipher" */
-    1001,    /* "id-tc26-cipher-constants" */
-    1176,    /* "id-tc26-cipher-gostr3412-2015-kuznyechik" */
-    1173,    /* "id-tc26-cipher-gostr3412-2015-magma" */
-     994,    /* "id-tc26-constants" */
-     981,    /* "id-tc26-digest" */
-    1000,    /* "id-tc26-digest-constants" */
-    1002,    /* "id-tc26-gost-28147-constants" */
-    1147,    /* "id-tc26-gost-3410-2012-256-constants" */
-     996,    /* "id-tc26-gost-3410-2012-512-constants" */
-     987,    /* "id-tc26-mac" */
-     978,    /* "id-tc26-sign" */
-     995,    /* "id-tc26-sign-constants" */
-     984,    /* "id-tc26-signwithdigest" */
-    1179,    /* "id-tc26-wrap" */
-    1182,    /* "id-tc26-wrap-gostr3412-2015-kuznyechik" */
-    1180,    /* "id-tc26-wrap-gostr3412-2015-magma" */
-      34,    /* "idea-cbc" */
-      35,    /* "idea-cfb" */
-      36,    /* "idea-ecb" */
-      46,    /* "idea-ofb" */
-     676,    /* "identified-organization" */
-    1170,    /* "ieee" */
-     461,    /* "info" */
-     101,    /* "initials" */
-     869,    /* "internationaliSDNNumber" */
-    1241,    /* "ipAddr-asNumber" */
-    1242,    /* "ipAddr-asNumberv2" */
-    1022,    /* "ipsec Internet Key Exchange" */
-     749,    /* "ipsec3" */
-     750,    /* "ipsec4" */
-     181,    /* "iso" */
-     623,    /* "issuer capabilities" */
-     645,    /* "itu-t" */
-    1264,    /* "itu-t-identified-organization" */
-     492,    /* "janetMailbox" */
-     646,    /* "joint-iso-itu-t" */
-     957,    /* "jurisdictionCountryName" */
-     955,    /* "jurisdictionLocalityName" */
-     956,    /* "jurisdictionStateOrProvinceName" */
-     150,    /* "keyBag" */
-     773,    /* "kisa" */
-    1196,    /* "kmac128" */
-    1197,    /* "kmac256" */
-    1015,    /* "kuznyechik-cbc" */
-    1016,    /* "kuznyechik-cfb" */
-    1013,    /* "kuznyechik-ctr" */
-    1177,    /* "kuznyechik-ctr-acpkm" */
-    1178,    /* "kuznyechik-ctr-acpkm-omac" */
-    1012,    /* "kuznyechik-ecb" */
-    1183,    /* "kuznyechik-kexp15" */
-    1017,    /* "kuznyechik-mac" */
-    1014,    /* "kuznyechik-ofb" */
-    1063,    /* "kx-any" */
-    1039,    /* "kx-dhe" */
-    1041,    /* "kx-dhe-psk" */
-    1038,    /* "kx-ecdhe" */
-    1040,    /* "kx-ecdhe-psk" */
-    1045,    /* "kx-gost" */
-    1218,    /* "kx-gost18" */
-    1043,    /* "kx-psk" */
-    1037,    /* "kx-rsa" */
-    1042,    /* "kx-rsa-psk" */
-    1044,    /* "kx-srp" */
-     477,    /* "lastModifiedBy" */
-     476,    /* "lastModifiedTime" */
-     157,    /* "localKeyID" */
-      15,    /* "localityName" */
-     480,    /* "mXRecord" */
-    1190,    /* "magma-cbc" */
-    1191,    /* "magma-cfb" */
-    1188,    /* "magma-ctr" */
-    1174,    /* "magma-ctr-acpkm" */
-    1175,    /* "magma-ctr-acpkm-omac" */
-    1187,    /* "magma-ecb" */
-    1181,    /* "magma-kexp15" */
-    1192,    /* "magma-mac" */
-    1189,    /* "magma-ofb" */
-     493,    /* "mailPreferenceOption" */
-     467,    /* "manager" */
-       3,    /* "md2" */
-       7,    /* "md2WithRSAEncryption" */
-     257,    /* "md4" */
-     396,    /* "md4WithRSAEncryption" */
-       4,    /* "md5" */
-     114,    /* "md5-sha1" */
-     104,    /* "md5WithRSA" */
-       8,    /* "md5WithRSAEncryption" */
-      95,    /* "mdc2" */
-      96,    /* "mdc2WithRSA" */
-     875,    /* "member" */
-     602,    /* "merchant initiated auth" */
-     514,    /* "message extensions" */
-      51,    /* "messageDigest" */
-     911,    /* "mgf1" */
-     506,    /* "mime-mhs-bodies" */
-     505,    /* "mime-mhs-headings" */
-     488,    /* "mobileTelephoneNumber" */
-    1212,    /* "modp_1536" */
-    1213,    /* "modp_2048" */
-    1214,    /* "modp_3072" */
-    1215,    /* "modp_4096" */
-    1216,    /* "modp_6144" */
-    1217,    /* "modp_8192" */
-     481,    /* "nSRecord" */
-     173,    /* "name" */
-     681,    /* "onBasis" */
-     379,    /* "org" */
-    1089,    /* "organizationIdentifier" */
-      17,    /* "organizationName" */
-     491,    /* "organizationalStatus" */
-      18,    /* "organizationalUnitName" */
-    1141,    /* "oscca" */
-     475,    /* "otherMailbox" */
-     876,    /* "owner" */
-     935,    /* "pSpecified" */
-     489,    /* "pagerTelephoneNumber" */
-     782,    /* "password based MAC" */
-     374,    /* "path" */
-     621,    /* "payment gateway capabilities" */
-       9,    /* "pbeWithMD2AndDES-CBC" */
-     168,    /* "pbeWithMD2AndRC2-CBC" */
-     112,    /* "pbeWithMD5AndCast5CBC" */
-      10,    /* "pbeWithMD5AndDES-CBC" */
-     169,    /* "pbeWithMD5AndRC2-CBC" */
-     148,    /* "pbeWithSHA1And128BitRC2-CBC" */
-     144,    /* "pbeWithSHA1And128BitRC4" */
-     147,    /* "pbeWithSHA1And2-KeyTripleDES-CBC" */
-     146,    /* "pbeWithSHA1And3-KeyTripleDES-CBC" */
-     149,    /* "pbeWithSHA1And40BitRC2-CBC" */
-     145,    /* "pbeWithSHA1And40BitRC4" */
-     170,    /* "pbeWithSHA1AndDES-CBC" */
-      68,    /* "pbeWithSHA1AndRC2-CBC" */
-     499,    /* "personalSignature" */
-     487,    /* "personalTitle" */
-     464,    /* "photo" */
-     863,    /* "physicalDeliveryOfficeName" */
-     437,    /* "pilot" */
-     439,    /* "pilotAttributeSyntax" */
-     438,    /* "pilotAttributeType" */
-     479,    /* "pilotAttributeType27" */
-     456,    /* "pilotDSA" */
-     441,    /* "pilotGroups" */
-     444,    /* "pilotObject" */
-     440,    /* "pilotObjectClass" */
-     455,    /* "pilotOrganization" */
-     445,    /* "pilotPerson" */
-     186,    /* "pkcs1" */
-      27,    /* "pkcs3" */
-     187,    /* "pkcs5" */
-      20,    /* "pkcs7" */
-      21,    /* "pkcs7-data" */
-      25,    /* "pkcs7-digestData" */
-      26,    /* "pkcs7-encryptedData" */
-      23,    /* "pkcs7-envelopedData" */
-      24,    /* "pkcs7-signedAndEnvelopedData" */
-      22,    /* "pkcs7-signedData" */
-     151,    /* "pkcs8ShroudedKeyBag" */
-      47,    /* "pkcs9" */
-    1061,    /* "poly1305" */
-     862,    /* "postOfficeBox" */
-     861,    /* "postalAddress" */
-     661,    /* "postalCode" */
-     683,    /* "ppBasis" */
-     872,    /* "preferredDeliveryMethod" */
-     873,    /* "presentationAddress" */
-     406,    /* "prime-field" */
-     409,    /* "prime192v1" */
-     410,    /* "prime192v2" */
-     411,    /* "prime192v3" */
-     412,    /* "prime239v1" */
-     413,    /* "prime239v2" */
-     414,    /* "prime239v3" */
-     415,    /* "prime256v1" */
-     886,    /* "protocolInformation" */
-     510,    /* "pseudonym" */
-     435,    /* "pss" */
-     286,    /* "qcStatements" */
-     457,    /* "qualityLabelledData" */
-     450,    /* "rFC822localPart" */
-      98,    /* "rc2-40-cbc" */
-     166,    /* "rc2-64-cbc" */
-      37,    /* "rc2-cbc" */
-      39,    /* "rc2-cfb" */
-      38,    /* "rc2-ecb" */
-      40,    /* "rc2-ofb" */
-       5,    /* "rc4" */
-      97,    /* "rc4-40" */
-     915,    /* "rc4-hmac-md5" */
-     120,    /* "rc5-cbc" */
-     122,    /* "rc5-cfb" */
-     121,    /* "rc5-ecb" */
-     123,    /* "rc5-ofb" */
-     870,    /* "registeredAddress" */
-     460,    /* "rfc822Mailbox" */
-     117,    /* "ripemd160" */
-     119,    /* "ripemd160WithRSA" */
-     400,    /* "role" */
-     877,    /* "roleOccupant" */
-     448,    /* "room" */
-     463,    /* "roomNumber" */
-      19,    /* "rsa" */
-       6,    /* "rsaEncryption" */
-     644,    /* "rsaOAEPEncryptionSET" */
-     377,    /* "rsaSignature" */
-     919,    /* "rsaesOaep" */
-     912,    /* "rsassaPss" */
-     482,    /* "sOARecord" */
-     155,    /* "safeContentsBag" */
-     291,    /* "sbgp-autonomousSysNum" */
-    1240,    /* "sbgp-autonomousSysNumv2" */
-     290,    /* "sbgp-ipAddrBlock" */
-    1239,    /* "sbgp-ipAddrBlockv2" */
-     292,    /* "sbgp-routerIdentifier" */
-     973,    /* "scrypt" */
-     159,    /* "sdsiCertificate" */
-     859,    /* "searchGuide" */
-     704,    /* "secp112r1" */
-     705,    /* "secp112r2" */
-     706,    /* "secp128r1" */
-     707,    /* "secp128r2" */
-     708,    /* "secp160k1" */
-     709,    /* "secp160r1" */
-     710,    /* "secp160r2" */
-     711,    /* "secp192k1" */
-     712,    /* "secp224k1" */
-     713,    /* "secp224r1" */
-     714,    /* "secp256k1" */
-     715,    /* "secp384r1" */
-     716,    /* "secp521r1" */
-     154,    /* "secretBag" */
-     474,    /* "secretary" */
-     717,    /* "sect113r1" */
-     718,    /* "sect113r2" */
-     719,    /* "sect131r1" */
-     720,    /* "sect131r2" */
-     721,    /* "sect163k1" */
-     722,    /* "sect163r1" */
-     723,    /* "sect163r2" */
-     724,    /* "sect193r1" */
-     725,    /* "sect193r2" */
-     726,    /* "sect233k1" */
-     727,    /* "sect233r1" */
-     728,    /* "sect239k1" */
-     729,    /* "sect283k1" */
-     730,    /* "sect283r1" */
-     731,    /* "sect409k1" */
-     732,    /* "sect409r1" */
-     733,    /* "sect571k1" */
-     734,    /* "sect571r1" */
-     635,    /* "secure device signature" */
-     878,    /* "seeAlso" */
-     777,    /* "seed-cbc" */
-     779,    /* "seed-cfb" */
-     776,    /* "seed-ecb" */
-     778,    /* "seed-ofb" */
-     105,    /* "serialNumber" */
-     625,    /* "set-addPolicy" */
-     515,    /* "set-attr" */
-     518,    /* "set-brand" */
-     638,    /* "set-brand-AmericanExpress" */
-     637,    /* "set-brand-Diners" */
-     636,    /* "set-brand-IATA-ATA" */
-     639,    /* "set-brand-JCB" */
-     641,    /* "set-brand-MasterCard" */
-     642,    /* "set-brand-Novus" */
-     640,    /* "set-brand-Visa" */
-     516,    /* "set-policy" */
-     607,    /* "set-policy-root" */
-     624,    /* "set-rootKeyThumb" */
-     620,    /* "setAttr-Cert" */
-     628,    /* "setAttr-IssCap-CVM" */
-     630,    /* "setAttr-IssCap-Sig" */
-     629,    /* "setAttr-IssCap-T2" */
-     627,    /* "setAttr-Token-B0Prime" */
-     626,    /* "setAttr-Token-EMV" */
-     622,    /* "setAttr-TokenType" */
-     619,    /* "setCext-IssuerCapabilities" */
-     615,    /* "setCext-PGWYcapabilities" */
-     616,    /* "setCext-TokenIdentifier" */
-     618,    /* "setCext-TokenType" */
-     617,    /* "setCext-Track2Data" */
-     611,    /* "setCext-cCertRequired" */
-     609,    /* "setCext-certType" */
-     608,    /* "setCext-hashedRoot" */
-     610,    /* "setCext-merchData" */
-     613,    /* "setCext-setExt" */
-     614,    /* "setCext-setQualf" */
-     612,    /* "setCext-tunneling" */
-     540,    /* "setct-AcqCardCodeMsg" */
-     576,    /* "setct-AcqCardCodeMsgTBE" */
-     570,    /* "setct-AuthReqTBE" */
-     534,    /* "setct-AuthReqTBS" */
-     527,    /* "setct-AuthResBaggage" */
-     571,    /* "setct-AuthResTBE" */
-     572,    /* "setct-AuthResTBEX" */
-     535,    /* "setct-AuthResTBS" */
-     536,    /* "setct-AuthResTBSX" */
-     528,    /* "setct-AuthRevReqBaggage" */
-     577,    /* "setct-AuthRevReqTBE" */
-     541,    /* "setct-AuthRevReqTBS" */
-     529,    /* "setct-AuthRevResBaggage" */
-     542,    /* "setct-AuthRevResData" */
-     578,    /* "setct-AuthRevResTBE" */
-     579,    /* "setct-AuthRevResTBEB" */
-     543,    /* "setct-AuthRevResTBS" */
-     573,    /* "setct-AuthTokenTBE" */
-     537,    /* "setct-AuthTokenTBS" */
-     600,    /* "setct-BCIDistributionTBS" */
-     558,    /* "setct-BatchAdminReqData" */
-     592,    /* "setct-BatchAdminReqTBE" */
-     559,    /* "setct-BatchAdminResData" */
-     593,    /* "setct-BatchAdminResTBE" */
-     599,    /* "setct-CRLNotificationResTBS" */
-     598,    /* "setct-CRLNotificationTBS" */
-     580,    /* "setct-CapReqTBE" */
-     581,    /* "setct-CapReqTBEX" */
-     544,    /* "setct-CapReqTBS" */
-     545,    /* "setct-CapReqTBSX" */
-     546,    /* "setct-CapResData" */
-     582,    /* "setct-CapResTBE" */
-     583,    /* "setct-CapRevReqTBE" */
-     584,    /* "setct-CapRevReqTBEX" */
-     547,    /* "setct-CapRevReqTBS" */
-     548,    /* "setct-CapRevReqTBSX" */
-     549,    /* "setct-CapRevResData" */
-     585,    /* "setct-CapRevResTBE" */
-     538,    /* "setct-CapTokenData" */
-     530,    /* "setct-CapTokenSeq" */
-     574,    /* "setct-CapTokenTBE" */
-     575,    /* "setct-CapTokenTBEX" */
-     539,    /* "setct-CapTokenTBS" */
-     560,    /* "setct-CardCInitResTBS" */
-     566,    /* "setct-CertInqReqTBS" */
-     563,    /* "setct-CertReqData" */
-     595,    /* "setct-CertReqTBE" */
-     596,    /* "setct-CertReqTBEX" */
-     564,    /* "setct-CertReqTBS" */
-     565,    /* "setct-CertResData" */
-     597,    /* "setct-CertResTBE" */
-     586,    /* "setct-CredReqTBE" */
-     587,    /* "setct-CredReqTBEX" */
-     550,    /* "setct-CredReqTBS" */
-     551,    /* "setct-CredReqTBSX" */
-     552,    /* "setct-CredResData" */
-     588,    /* "setct-CredResTBE" */
-     589,    /* "setct-CredRevReqTBE" */
-     590,    /* "setct-CredRevReqTBEX" */
-     553,    /* "setct-CredRevReqTBS" */
-     554,    /* "setct-CredRevReqTBSX" */
-     555,    /* "setct-CredRevResData" */
-     591,    /* "setct-CredRevResTBE" */
-     567,    /* "setct-ErrorTBS" */
-     526,    /* "setct-HODInput" */
-     561,    /* "setct-MeAqCInitResTBS" */
-     522,    /* "setct-OIData" */
-     519,    /* "setct-PANData" */
-     521,    /* "setct-PANOnly" */
-     520,    /* "setct-PANToken" */
-     556,    /* "setct-PCertReqData" */
-     557,    /* "setct-PCertResTBS" */
-     523,    /* "setct-PI" */
-     532,    /* "setct-PI-TBS" */
-     524,    /* "setct-PIData" */
-     525,    /* "setct-PIDataUnsigned" */
-     568,    /* "setct-PIDualSignedTBE" */
-     569,    /* "setct-PIUnsignedTBE" */
-     531,    /* "setct-PInitResData" */
-     533,    /* "setct-PResData" */
-     594,    /* "setct-RegFormReqTBE" */
-     562,    /* "setct-RegFormResTBS" */
-     604,    /* "setext-pinAny" */
-     603,    /* "setext-pinSecure" */
-     605,    /* "setext-track2" */
-      41,    /* "sha" */
-      64,    /* "sha1" */
-     115,    /* "sha1WithRSA" */
-      65,    /* "sha1WithRSAEncryption" */
-     675,    /* "sha224" */
-     671,    /* "sha224WithRSAEncryption" */
-     672,    /* "sha256" */
-     668,    /* "sha256WithRSAEncryption" */
-    1096,    /* "sha3-224" */
-    1097,    /* "sha3-256" */
-    1098,    /* "sha3-384" */
-    1099,    /* "sha3-512" */
-     673,    /* "sha384" */
-     669,    /* "sha384WithRSAEncryption" */
-     674,    /* "sha512" */
-    1094,    /* "sha512-224" */
-    1145,    /* "sha512-224WithRSAEncryption" */
-    1095,    /* "sha512-256" */
-    1146,    /* "sha512-256WithRSAEncryption" */
-     670,    /* "sha512WithRSAEncryption" */
-      42,    /* "shaWithRSAEncryption" */
-    1100,    /* "shake128" */
-    1101,    /* "shake256" */
-    1279,    /* "signedAssertion" */
-      52,    /* "signingTime" */
-     454,    /* "simpleSecurityObject" */
-     496,    /* "singleLevelQuality" */
-    1062,    /* "siphash" */
-    1142,    /* "sm-scheme" */
-    1172,    /* "sm2" */
-    1143,    /* "sm3" */
-    1144,    /* "sm3WithRSAEncryption" */
-    1134,    /* "sm4-cbc" */
-    1249,    /* "sm4-ccm" */
-    1137,    /* "sm4-cfb" */
-    1136,    /* "sm4-cfb1" */
-    1138,    /* "sm4-cfb8" */
-    1139,    /* "sm4-ctr" */
-    1133,    /* "sm4-ecb" */
-    1248,    /* "sm4-gcm" */
-    1135,    /* "sm4-ofb" */
-    1290,    /* "sm4-xts" */
-    1203,    /* "sshkdf" */
-    1205,    /* "sskdf" */
-      16,    /* "stateOrProvinceName" */
-     660,    /* "streetAddress" */
-     498,    /* "subtreeMaximumQuality" */
-     497,    /* "subtreeMinimumQuality" */
-     890,    /* "supportedAlgorithms" */
-     874,    /* "supportedApplicationContext" */
-     100,    /* "surname" */
-    1325,    /* "tcg-tcpaSpecVersion" */
-     864,    /* "telephoneNumber" */
-     866,    /* "teletexTerminalIdentifier" */
-     865,    /* "telexNumber" */
-     459,    /* "textEncodedORAddress" */
-     293,    /* "textNotice" */
-     106,    /* "title" */
-    1021,    /* "tls1-prf" */
-     682,    /* "tpBasis" */
-    1151,    /* "ua-pki" */
-     436,    /* "ucl" */
-       0,    /* "undefined" */
-     102,    /* "uniqueIdentifier" */
-     888,    /* "uniqueMember" */
-      55,    /* "unstructuredAddress" */
-      49,    /* "unstructuredName" */
-     880,    /* "userCertificate" */
-     465,    /* "userClass" */
-     458,    /* "userId" */
-     879,    /* "userPassword" */
-     373,    /* "valid" */
-     678,    /* "wap" */
-     679,    /* "wap-wsg" */
-     735,    /* "wap-wsg-idm-ecid-wtls1" */
-     743,    /* "wap-wsg-idm-ecid-wtls10" */
-     744,    /* "wap-wsg-idm-ecid-wtls11" */
-     745,    /* "wap-wsg-idm-ecid-wtls12" */
-     736,    /* "wap-wsg-idm-ecid-wtls3" */
-     737,    /* "wap-wsg-idm-ecid-wtls4" */
-     738,    /* "wap-wsg-idm-ecid-wtls5" */
-     739,    /* "wap-wsg-idm-ecid-wtls6" */
-     740,    /* "wap-wsg-idm-ecid-wtls7" */
-     741,    /* "wap-wsg-idm-ecid-wtls8" */
-     742,    /* "wap-wsg-idm-ecid-wtls9" */
-     804,    /* "whirlpool" */
-     868,    /* "x121Address" */
-     503,    /* "x500UniqueIdentifier" */
-     158,    /* "x509Certificate" */
-     160,    /* "x509Crl" */
-    1207,    /* "x942kdf" */
-    1206,    /* "x963kdf" */
-     125,    /* "zlib compression" */
-};
-
-#define NUM_OBJ 1344
-static const unsigned int obj_objs[NUM_OBJ] = {
-       0,    /* OBJ_undef                        0 */
-     181,    /* OBJ_iso                          1 */
-     393,    /* OBJ_joint_iso_ccitt              OBJ_joint_iso_itu_t */
-     404,    /* OBJ_ccitt                        OBJ_itu_t */
-     645,    /* OBJ_itu_t                        0 */
-     646,    /* OBJ_joint_iso_itu_t              2 */
-    1323,    /* OBJ_ac_auditEntity               OBJ_ac_auditIdentity */
-    1264,    /* OBJ_itu_t_identified_organization 0 4 */
-     434,    /* OBJ_data                         0 9 */
-     182,    /* OBJ_member_body                  1 2 */
-     379,    /* OBJ_org                          1 3 */
-     676,    /* OBJ_identified_organization      1 3 */
-      11,    /* OBJ_X500                         2 5 */
-     647,    /* OBJ_international_organizations  2 23 */
-    1265,    /* OBJ_etsi                         0 4 0 */
-     380,    /* OBJ_dod                          1 3 6 */
-    1170,    /* OBJ_ieee                         1 3 111 */
-      12,    /* OBJ_X509                         2 5 4 */
-     378,    /* OBJ_X500algorithms               2 5 8 */
-      81,    /* OBJ_id_ce                        2 5 29 */
-     512,    /* OBJ_id_set                       2 23 42 */
-     678,    /* OBJ_wap                          2 23 43 */
-     435,    /* OBJ_pss                          0 9 2342 */
-    1140,    /* OBJ_ISO_CN                       1 2 156 */
-    1150,    /* OBJ_ISO_UA                       1 2 804 */
-     183,    /* OBJ_ISO_US                       1 2 840 */
-     381,    /* OBJ_iana                         1 3 6 1 */
-    1034,    /* OBJ_X25519                       1 3 101 110 */
-    1035,    /* OBJ_X448                         1 3 101 111 */
-    1087,    /* OBJ_ED25519                      1 3 101 112 */
-    1088,    /* OBJ_ED448                        1 3 101 113 */
-     677,    /* OBJ_certicom_arc                 1 3 132 */
-     394,    /* OBJ_selected_attribute_types     2 5 1 5 */
-      13,    /* OBJ_commonName                   2 5 4 3 */
-     100,    /* OBJ_surname                      2 5 4 4 */
-     105,    /* OBJ_serialNumber                 2 5 4 5 */
-      14,    /* OBJ_countryName                  2 5 4 6 */
-      15,    /* OBJ_localityName                 2 5 4 7 */
-      16,    /* OBJ_stateOrProvinceName          2 5 4 8 */
-     660,    /* OBJ_streetAddress                2 5 4 9 */
-      17,    /* OBJ_organizationName             2 5 4 10 */
-      18,    /* OBJ_organizationalUnitName       2 5 4 11 */
-     106,    /* OBJ_title                        2 5 4 12 */
-     107,    /* OBJ_description                  2 5 4 13 */
-     859,    /* OBJ_searchGuide                  2 5 4 14 */
-     860,    /* OBJ_businessCategory             2 5 4 15 */
-     861,    /* OBJ_postalAddress                2 5 4 16 */
-     661,    /* OBJ_postalCode                   2 5 4 17 */
-     862,    /* OBJ_postOfficeBox                2 5 4 18 */
-     863,    /* OBJ_physicalDeliveryOfficeName   2 5 4 19 */
-     864,    /* OBJ_telephoneNumber              2 5 4 20 */
-     865,    /* OBJ_telexNumber                  2 5 4 21 */
-     866,    /* OBJ_teletexTerminalIdentifier    2 5 4 22 */
-     867,    /* OBJ_facsimileTelephoneNumber     2 5 4 23 */
-     868,    /* OBJ_x121Address                  2 5 4 24 */
-     869,    /* OBJ_internationaliSDNNumber      2 5 4 25 */
-     870,    /* OBJ_registeredAddress            2 5 4 26 */
-     871,    /* OBJ_destinationIndicator         2 5 4 27 */
-     872,    /* OBJ_preferredDeliveryMethod      2 5 4 28 */
-     873,    /* OBJ_presentationAddress          2 5 4 29 */
-     874,    /* OBJ_supportedApplicationContext  2 5 4 30 */
-     875,    /* OBJ_member                       2 5 4 31 */
-     876,    /* OBJ_owner                        2 5 4 32 */
-     877,    /* OBJ_roleOccupant                 2 5 4 33 */
-     878,    /* OBJ_seeAlso                      2 5 4 34 */
-     879,    /* OBJ_userPassword                 2 5 4 35 */
-     880,    /* OBJ_userCertificate              2 5 4 36 */
-     881,    /* OBJ_cACertificate                2 5 4 37 */
-     882,    /* OBJ_authorityRevocationList      2 5 4 38 */
-     883,    /* OBJ_certificateRevocationList    2 5 4 39 */
-     884,    /* OBJ_crossCertificatePair         2 5 4 40 */
-     173,    /* OBJ_name                         2 5 4 41 */
-      99,    /* OBJ_givenName                    2 5 4 42 */
-     101,    /* OBJ_initials                     2 5 4 43 */
-     509,    /* OBJ_generationQualifier          2 5 4 44 */
-     503,    /* OBJ_x500UniqueIdentifier         2 5 4 45 */
-     174,    /* OBJ_dnQualifier                  2 5 4 46 */
-     885,    /* OBJ_enhancedSearchGuide          2 5 4 47 */
-     886,    /* OBJ_protocolInformation          2 5 4 48 */
-     887,    /* OBJ_distinguishedName            2 5 4 49 */
-     888,    /* OBJ_uniqueMember                 2 5 4 50 */
-     889,    /* OBJ_houseIdentifier              2 5 4 51 */
-     890,    /* OBJ_supportedAlgorithms          2 5 4 52 */
-     891,    /* OBJ_deltaRevocationList          2 5 4 53 */
-     892,    /* OBJ_dmdName                      2 5 4 54 */
-     510,    /* OBJ_pseudonym                    2 5 4 65 */
-     400,    /* OBJ_role                         2 5 4 72 */
-    1089,    /* OBJ_organizationIdentifier       2 5 4 97 */
-    1090,    /* OBJ_countryCode3c                2 5 4 98 */
-    1091,    /* OBJ_countryCode3n                2 5 4 99 */
-    1092,    /* OBJ_dnsName                      2 5 4 100 */
-     769,    /* OBJ_subject_directory_attributes 2 5 29 9 */
-      82,    /* OBJ_subject_key_identifier       2 5 29 14 */
-      83,    /* OBJ_key_usage                    2 5 29 15 */
-      84,    /* OBJ_private_key_usage_period     2 5 29 16 */
-      85,    /* OBJ_subject_alt_name             2 5 29 17 */
-      86,    /* OBJ_issuer_alt_name              2 5 29 18 */
-      87,    /* OBJ_basic_constraints            2 5 29 19 */
-      88,    /* OBJ_crl_number                   2 5 29 20 */
-     141,    /* OBJ_crl_reason                   2 5 29 21 */
-     430,    /* OBJ_hold_instruction_code        2 5 29 23 */
-     142,    /* OBJ_invalidity_date              2 5 29 24 */
-     140,    /* OBJ_delta_crl                    2 5 29 27 */
-     770,    /* OBJ_issuing_distribution_point   2 5 29 28 */
-     771,    /* OBJ_certificate_issuer           2 5 29 29 */
-     666,    /* OBJ_name_constraints             2 5 29 30 */
-     103,    /* OBJ_crl_distribution_points      2 5 29 31 */
-      89,    /* OBJ_certificate_policies         2 5 29 32 */
-     747,    /* OBJ_policy_mappings              2 5 29 33 */
-      90,    /* OBJ_authority_key_identifier     2 5 29 35 */
-     401,    /* OBJ_policy_constraints           2 5 29 36 */
-     126,    /* OBJ_ext_key_usage                2 5 29 37 */
-    1295,    /* OBJ_authority_attribute_identifier 2 5 29 38 */
-    1296,    /* OBJ_role_spec_cert_identifier    2 5 29 39 */
-    1297,    /* OBJ_basic_att_constraints        2 5 29 41 */
-    1298,    /* OBJ_delegated_name_constraints   2 5 29 42 */
-    1299,    /* OBJ_time_specification           2 5 29 43 */
-     857,    /* OBJ_freshest_crl                 2 5 29 46 */
-    1300,    /* OBJ_attribute_descriptor         2 5 29 48 */
-    1301,    /* OBJ_user_notice                  2 5 29 49 */
-    1302,    /* OBJ_soa_identifier               2 5 29 50 */
-    1303,    /* OBJ_acceptable_cert_policies     2 5 29 52 */
-     748,    /* OBJ_inhibit_any_policy           2 5 29 54 */
-     402,    /* OBJ_target_information           2 5 29 55 */
-     403,    /* OBJ_no_rev_avail                 2 5 29 56 */
-    1304,    /* OBJ_acceptable_privilege_policies 2 5 29 57 */
-    1305,    /* OBJ_indirect_issuer              2 5 29 61 */
-    1306,    /* OBJ_no_assertion                 2 5 29 62 */
-    1307,    /* OBJ_id_aa_issuing_distribution_point 2 5 29 63 */
-    1308,    /* OBJ_issued_on_behalf_of          2 5 29 64 */
-    1309,    /* OBJ_single_use                   2 5 29 65 */
-    1310,    /* OBJ_group_ac                     2 5 29 66 */
-    1311,    /* OBJ_allowed_attribute_assignments 2 5 29 67 */
-    1312,    /* OBJ_attribute_mappings           2 5 29 68 */
-    1313,    /* OBJ_holder_name_constraints      2 5 29 69 */
-    1314,    /* OBJ_authorization_validation     2 5 29 70 */
-    1315,    /* OBJ_prot_restrict                2 5 29 71 */
-    1316,    /* OBJ_subject_alt_public_key_info  2 5 29 72 */
-    1317,    /* OBJ_alt_signature_algorithm      2 5 29 73 */
-    1318,    /* OBJ_alt_signature_value          2 5 29 74 */
-    1319,    /* OBJ_associated_information       2 5 29 75 */
-     513,    /* OBJ_set_ctype                    2 23 42 0 */
-     514,    /* OBJ_set_msgExt                   2 23 42 1 */
-     515,    /* OBJ_set_attr                     2 23 42 3 */
-     516,    /* OBJ_set_policy                   2 23 42 5 */
-     517,    /* OBJ_set_certExt                  2 23 42 7 */
-     518,    /* OBJ_set_brand                    2 23 42 8 */
-     679,    /* OBJ_wap_wsg                      2 23 43 1 */
-    1324,    /* OBJ_tcg                          2 23 133 */
-    1266,    /* OBJ_electronic_signature_standard 0 4 0 1733 */
-     382,    /* OBJ_Directory                    1 3 6 1 1 */
-     383,    /* OBJ_Management                   1 3 6 1 2 */
-     384,    /* OBJ_Experimental                 1 3 6 1 3 */
-     385,    /* OBJ_Private                      1 3 6 1 4 */
-     386,    /* OBJ_Security                     1 3 6 1 5 */
-     387,    /* OBJ_SNMPv2                       1 3 6 1 6 */
-     388,    /* OBJ_Mail                         1 3 6 1 7 */
-     376,    /* OBJ_algorithm                    1 3 14 3 2 */
-     395,    /* OBJ_clearance                    2 5 1 5 55 */
-      19,    /* OBJ_rsa                          2 5 8 1 1 */
-      96,    /* OBJ_mdc2WithRSA                  2 5 8 3 100 */
-      95,    /* OBJ_mdc2                         2 5 8 3 101 */
-     746,    /* OBJ_any_policy                   2 5 29 32 0 */
-     910,    /* OBJ_anyExtendedKeyUsage          2 5 29 37 0 */
-     519,    /* OBJ_setct_PANData                2 23 42 0 0 */
-     520,    /* OBJ_setct_PANToken               2 23 42 0 1 */
-     521,    /* OBJ_setct_PANOnly                2 23 42 0 2 */
-     522,    /* OBJ_setct_OIData                 2 23 42 0 3 */
-     523,    /* OBJ_setct_PI                     2 23 42 0 4 */
-     524,    /* OBJ_setct_PIData                 2 23 42 0 5 */
-     525,    /* OBJ_setct_PIDataUnsigned         2 23 42 0 6 */
-     526,    /* OBJ_setct_HODInput               2 23 42 0 7 */
-     527,    /* OBJ_setct_AuthResBaggage         2 23 42 0 8 */
-     528,    /* OBJ_setct_AuthRevReqBaggage      2 23 42 0 9 */
-     529,    /* OBJ_setct_AuthRevResBaggage      2 23 42 0 10 */
-     530,    /* OBJ_setct_CapTokenSeq            2 23 42 0 11 */
-     531,    /* OBJ_setct_PInitResData           2 23 42 0 12 */
-     532,    /* OBJ_setct_PI_TBS                 2 23 42 0 13 */
-     533,    /* OBJ_setct_PResData               2 23 42 0 14 */
-     534,    /* OBJ_setct_AuthReqTBS             2 23 42 0 16 */
-     535,    /* OBJ_setct_AuthResTBS             2 23 42 0 17 */
-     536,    /* OBJ_setct_AuthResTBSX            2 23 42 0 18 */
-     537,    /* OBJ_setct_AuthTokenTBS           2 23 42 0 19 */
-     538,    /* OBJ_setct_CapTokenData           2 23 42 0 20 */
-     539,    /* OBJ_setct_CapTokenTBS            2 23 42 0 21 */
-     540,    /* OBJ_setct_AcqCardCodeMsg         2 23 42 0 22 */
-     541,    /* OBJ_setct_AuthRevReqTBS          2 23 42 0 23 */
-     542,    /* OBJ_setct_AuthRevResData         2 23 42 0 24 */
-     543,    /* OBJ_setct_AuthRevResTBS          2 23 42 0 25 */
-     544,    /* OBJ_setct_CapReqTBS              2 23 42 0 26 */
-     545,    /* OBJ_setct_CapReqTBSX             2 23 42 0 27 */
-     546,    /* OBJ_setct_CapResData             2 23 42 0 28 */
-     547,    /* OBJ_setct_CapRevReqTBS           2 23 42 0 29 */
-     548,    /* OBJ_setct_CapRevReqTBSX          2 23 42 0 30 */
-     549,    /* OBJ_setct_CapRevResData          2 23 42 0 31 */
-     550,    /* OBJ_setct_CredReqTBS             2 23 42 0 32 */
-     551,    /* OBJ_setct_CredReqTBSX            2 23 42 0 33 */
-     552,    /* OBJ_setct_CredResData            2 23 42 0 34 */
-     553,    /* OBJ_setct_CredRevReqTBS          2 23 42 0 35 */
-     554,    /* OBJ_setct_CredRevReqTBSX         2 23 42 0 36 */
-     555,    /* OBJ_setct_CredRevResData         2 23 42 0 37 */
-     556,    /* OBJ_setct_PCertReqData           2 23 42 0 38 */
-     557,    /* OBJ_setct_PCertResTBS            2 23 42 0 39 */
-     558,    /* OBJ_setct_BatchAdminReqData      2 23 42 0 40 */
-     559,    /* OBJ_setct_BatchAdminResData      2 23 42 0 41 */
-     560,    /* OBJ_setct_CardCInitResTBS        2 23 42 0 42 */
-     561,    /* OBJ_setct_MeAqCInitResTBS        2 23 42 0 43 */
-     562,    /* OBJ_setct_RegFormResTBS          2 23 42 0 44 */
-     563,    /* OBJ_setct_CertReqData            2 23 42 0 45 */
-     564,    /* OBJ_setct_CertReqTBS             2 23 42 0 46 */
-     565,    /* OBJ_setct_CertResData            2 23 42 0 47 */
-     566,    /* OBJ_setct_CertInqReqTBS          2 23 42 0 48 */
-     567,    /* OBJ_setct_ErrorTBS               2 23 42 0 49 */
-     568,    /* OBJ_setct_PIDualSignedTBE        2 23 42 0 50 */
-     569,    /* OBJ_setct_PIUnsignedTBE          2 23 42 0 51 */
-     570,    /* OBJ_setct_AuthReqTBE             2 23 42 0 52 */
-     571,    /* OBJ_setct_AuthResTBE             2 23 42 0 53 */
-     572,    /* OBJ_setct_AuthResTBEX            2 23 42 0 54 */
-     573,    /* OBJ_setct_AuthTokenTBE           2 23 42 0 55 */
-     574,    /* OBJ_setct_CapTokenTBE            2 23 42 0 56 */
-     575,    /* OBJ_setct_CapTokenTBEX           2 23 42 0 57 */
-     576,    /* OBJ_setct_AcqCardCodeMsgTBE      2 23 42 0 58 */
-     577,    /* OBJ_setct_AuthRevReqTBE          2 23 42 0 59 */
-     578,    /* OBJ_setct_AuthRevResTBE          2 23 42 0 60 */
-     579,    /* OBJ_setct_AuthRevResTBEB         2 23 42 0 61 */
-     580,    /* OBJ_setct_CapReqTBE              2 23 42 0 62 */
-     581,    /* OBJ_setct_CapReqTBEX             2 23 42 0 63 */
-     582,    /* OBJ_setct_CapResTBE              2 23 42 0 64 */
-     583,    /* OBJ_setct_CapRevReqTBE           2 23 42 0 65 */
-     584,    /* OBJ_setct_CapRevReqTBEX          2 23 42 0 66 */
-     585,    /* OBJ_setct_CapRevResTBE           2 23 42 0 67 */
-     586,    /* OBJ_setct_CredReqTBE             2 23 42 0 68 */
-     587,    /* OBJ_setct_CredReqTBEX            2 23 42 0 69 */
-     588,    /* OBJ_setct_CredResTBE             2 23 42 0 70 */
-     589,    /* OBJ_setct_CredRevReqTBE          2 23 42 0 71 */
-     590,    /* OBJ_setct_CredRevReqTBEX         2 23 42 0 72 */
-     591,    /* OBJ_setct_CredRevResTBE          2 23 42 0 73 */
-     592,    /* OBJ_setct_BatchAdminReqTBE       2 23 42 0 74 */
-     593,    /* OBJ_setct_BatchAdminResTBE       2 23 42 0 75 */
-     594,    /* OBJ_setct_RegFormReqTBE          2 23 42 0 76 */
-     595,    /* OBJ_setct_CertReqTBE             2 23 42 0 77 */
-     596,    /* OBJ_setct_CertReqTBEX            2 23 42 0 78 */
-     597,    /* OBJ_setct_CertResTBE             2 23 42 0 79 */
-     598,    /* OBJ_setct_CRLNotificationTBS     2 23 42 0 80 */
-     599,    /* OBJ_setct_CRLNotificationResTBS  2 23 42 0 81 */
-     600,    /* OBJ_setct_BCIDistributionTBS     2 23 42 0 82 */
-     601,    /* OBJ_setext_genCrypt              2 23 42 1 1 */
-     602,    /* OBJ_setext_miAuth                2 23 42 1 3 */
-     603,    /* OBJ_setext_pinSecure             2 23 42 1 4 */
-     604,    /* OBJ_setext_pinAny                2 23 42 1 5 */
-     605,    /* OBJ_setext_track2                2 23 42 1 7 */
-     606,    /* OBJ_setext_cv                    2 23 42 1 8 */
-     620,    /* OBJ_setAttr_Cert                 2 23 42 3 0 */
-     621,    /* OBJ_setAttr_PGWYcap              2 23 42 3 1 */
-     622,    /* OBJ_setAttr_TokenType            2 23 42 3 2 */
-     623,    /* OBJ_setAttr_IssCap               2 23 42 3 3 */
-     607,    /* OBJ_set_policy_root              2 23 42 5 0 */
-     608,    /* OBJ_setCext_hashedRoot           2 23 42 7 0 */
-     609,    /* OBJ_setCext_certType             2 23 42 7 1 */
-     610,    /* OBJ_setCext_merchData            2 23 42 7 2 */
-     611,    /* OBJ_setCext_cCertRequired        2 23 42 7 3 */
-     612,    /* OBJ_setCext_tunneling            2 23 42 7 4 */
-     613,    /* OBJ_setCext_setExt               2 23 42 7 5 */
-     614,    /* OBJ_setCext_setQualf             2 23 42 7 6 */
-     615,    /* OBJ_setCext_PGWYcapabilities     2 23 42 7 7 */
-     616,    /* OBJ_setCext_TokenIdentifier      2 23 42 7 8 */
-     617,    /* OBJ_setCext_Track2Data           2 23 42 7 9 */
-     618,    /* OBJ_setCext_TokenType            2 23 42 7 10 */
-     619,    /* OBJ_setCext_IssuerCapabilities   2 23 42 7 11 */
-     636,    /* OBJ_set_brand_IATA_ATA           2 23 42 8 1 */
-     640,    /* OBJ_set_brand_Visa               2 23 42 8 4 */
-     641,    /* OBJ_set_brand_MasterCard         2 23 42 8 5 */
-     637,    /* OBJ_set_brand_Diners             2 23 42 8 30 */
-     638,    /* OBJ_set_brand_AmericanExpress    2 23 42 8 34 */
-     639,    /* OBJ_set_brand_JCB                2 23 42 8 35 */
-    1325,    /* OBJ_tcg_tcpaSpecVersion          2 23 133 1 */
-    1326,    /* OBJ_tcg_attribute                2 23 133 2 */
-    1327,    /* OBJ_tcg_protocol                 2 23 133 3 */
-    1328,    /* OBJ_tcg_algorithm                2 23 133 4 */
-    1329,    /* OBJ_tcg_platformClass            2 23 133 5 */
-    1330,    /* OBJ_tcg_ce                       2 23 133 6 */
-    1331,    /* OBJ_tcg_kp                       2 23 133 8 */
-    1332,    /* OBJ_tcg_ca                       2 23 133 11 */
-    1333,    /* OBJ_tcg_address                  2 23 133 17 */
-    1334,    /* OBJ_tcg_registry                 2 23 133 18 */
-    1335,    /* OBJ_tcg_traits                   2 23 133 19 */
-    1273,    /* OBJ_cades                        0 4 0 19122 */
-    1267,    /* OBJ_ess_attributes               0 4 0 1733 2 */
-    1195,    /* OBJ_gmac                         1 0 9797 3 4 */
-    1141,    /* OBJ_oscca                        1 2 156 10197 */
-     805,    /* OBJ_cryptopro                    1 2 643 2 2 */
-     806,    /* OBJ_cryptocom                    1 2 643 2 9 */
-     974,    /* OBJ_id_tc26                      1 2 643 7 1 */
-    1005,    /* OBJ_OGRN                         1 2 643 100 1 */
-    1006,    /* OBJ_SNILS                        1 2 643 100 3 */
-    1226,    /* OBJ_OGRNIP                       1 2 643 100 5 */
-    1007,    /* OBJ_subjectSignTool              1 2 643 100 111 */
-    1008,    /* OBJ_issuerSignTool               1 2 643 100 112 */
-    1227,    /* OBJ_classSignTool                1 2 643 100 113 */
-     184,    /* OBJ_X9_57                        1 2 840 10040 */
-     405,    /* OBJ_ansi_X9_62                   1 2 840 10045 */
-     389,    /* OBJ_Enterprises                  1 3 6 1 4 1 */
-     504,    /* OBJ_mime_mhs                     1 3 6 1 7 1 */
-     104,    /* OBJ_md5WithRSA                   1 3 14 3 2 3 */
-      29,    /* OBJ_des_ecb                      1 3 14 3 2 6 */
-      31,    /* OBJ_des_cbc                      1 3 14 3 2 7 */
-      45,    /* OBJ_des_ofb64                    1 3 14 3 2 8 */
-      30,    /* OBJ_des_cfb64                    1 3 14 3 2 9 */
-     377,    /* OBJ_rsaSignature                 1 3 14 3 2 11 */
-      67,    /* OBJ_dsa_2                        1 3 14 3 2 12 */
-      66,    /* OBJ_dsaWithSHA                   1 3 14 3 2 13 */
-      42,    /* OBJ_shaWithRSAEncryption         1 3 14 3 2 15 */
-      32,    /* OBJ_des_ede_ecb                  1 3 14 3 2 17 */
-      41,    /* OBJ_sha                          1 3 14 3 2 18 */
-      64,    /* OBJ_sha1                         1 3 14 3 2 26 */
-      70,    /* OBJ_dsaWithSHA1_2                1 3 14 3 2 27 */
-     115,    /* OBJ_sha1WithRSA                  1 3 14 3 2 29 */
-     117,    /* OBJ_ripemd160                    1 3 36 3 2 1 */
-    1093,    /* OBJ_x509ExtAdmission             1 3 36 8 3 3 */
-     143,    /* OBJ_sxnet                        1 3 101 1 4 1 */
-    1171,    /* OBJ_ieee_siswg                   1 3 111 2 1619 */
-     721,    /* OBJ_sect163k1                    1 3 132 0 1 */
-     722,    /* OBJ_sect163r1                    1 3 132 0 2 */
-     728,    /* OBJ_sect239k1                    1 3 132 0 3 */
-     717,    /* OBJ_sect113r1                    1 3 132 0 4 */
-     718,    /* OBJ_sect113r2                    1 3 132 0 5 */
-     704,    /* OBJ_secp112r1                    1 3 132 0 6 */
-     705,    /* OBJ_secp112r2                    1 3 132 0 7 */
-     709,    /* OBJ_secp160r1                    1 3 132 0 8 */
-     708,    /* OBJ_secp160k1                    1 3 132 0 9 */
-     714,    /* OBJ_secp256k1                    1 3 132 0 10 */
-     723,    /* OBJ_sect163r2                    1 3 132 0 15 */
-     729,    /* OBJ_sect283k1                    1 3 132 0 16 */
-     730,    /* OBJ_sect283r1                    1 3 132 0 17 */
-     719,    /* OBJ_sect131r1                    1 3 132 0 22 */
-     720,    /* OBJ_sect131r2                    1 3 132 0 23 */
-     724,    /* OBJ_sect193r1                    1 3 132 0 24 */
-     725,    /* OBJ_sect193r2                    1 3 132 0 25 */
-     726,    /* OBJ_sect233k1                    1 3 132 0 26 */
-     727,    /* OBJ_sect233r1                    1 3 132 0 27 */
-     706,    /* OBJ_secp128r1                    1 3 132 0 28 */
-     707,    /* OBJ_secp128r2                    1 3 132 0 29 */
-     710,    /* OBJ_secp160r2                    1 3 132 0 30 */
-     711,    /* OBJ_secp192k1                    1 3 132 0 31 */
-     712,    /* OBJ_secp224k1                    1 3 132 0 32 */
-     713,    /* OBJ_secp224r1                    1 3 132 0 33 */
-     715,    /* OBJ_secp384r1                    1 3 132 0 34 */
-     716,    /* OBJ_secp521r1                    1 3 132 0 35 */
-     731,    /* OBJ_sect409k1                    1 3 132 0 36 */
-     732,    /* OBJ_sect409r1                    1 3 132 0 37 */
-     733,    /* OBJ_sect571k1                    1 3 132 0 38 */
-     734,    /* OBJ_sect571r1                    1 3 132 0 39 */
-     624,    /* OBJ_set_rootKeyThumb             2 23 42 3 0 0 */
-     625,    /* OBJ_set_addPolicy                2 23 42 3 0 1 */
-     626,    /* OBJ_setAttr_Token_EMV            2 23 42 3 2 1 */
-     627,    /* OBJ_setAttr_Token_B0Prime        2 23 42 3 2 2 */
-     628,    /* OBJ_setAttr_IssCap_CVM           2 23 42 3 3 3 */
-     629,    /* OBJ_setAttr_IssCap_T2            2 23 42 3 3 4 */
-     630,    /* OBJ_setAttr_IssCap_Sig           2 23 42 3 3 5 */
-     642,    /* OBJ_set_brand_Novus              2 23 42 8 6011 */
-     735,    /* OBJ_wap_wsg_idm_ecid_wtls1       2 23 43 1 4 1 */
-     736,    /* OBJ_wap_wsg_idm_ecid_wtls3       2 23 43 1 4 3 */
-     737,    /* OBJ_wap_wsg_idm_ecid_wtls4       2 23 43 1 4 4 */
-     738,    /* OBJ_wap_wsg_idm_ecid_wtls5       2 23 43 1 4 5 */
-     739,    /* OBJ_wap_wsg_idm_ecid_wtls6       2 23 43 1 4 6 */
-     740,    /* OBJ_wap_wsg_idm_ecid_wtls7       2 23 43 1 4 7 */
-     741,    /* OBJ_wap_wsg_idm_ecid_wtls8       2 23 43 1 4 8 */
-     742,    /* OBJ_wap_wsg_idm_ecid_wtls9       2 23 43 1 4 9 */
-     743,    /* OBJ_wap_wsg_idm_ecid_wtls10      2 23 43 1 4 10 */
-     744,    /* OBJ_wap_wsg_idm_ecid_wtls11      2 23 43 1 4 11 */
-     745,    /* OBJ_wap_wsg_idm_ecid_wtls12      2 23 43 1 4 12 */
-    1345,    /* OBJ_tcg_at_tpmManufacturer       2 23 133 2 1 */
-    1346,    /* OBJ_tcg_at_tpmModel              2 23 133 2 2 */
-    1347,    /* OBJ_tcg_at_tpmVersion            2 23 133 2 3 */
-    1348,    /* OBJ_tcg_at_securityQualities     2 23 133 2 10 */
-    1349,    /* OBJ_tcg_at_tpmProtectionProfile  2 23 133 2 11 */
-    1350,    /* OBJ_tcg_at_tpmSecurityTarget     2 23 133 2 12 */
-    1351,    /* OBJ_tcg_at_tbbProtectionProfile  2 23 133 2 13 */
-    1352,    /* OBJ_tcg_at_tbbSecurityTarget     2 23 133 2 14 */
-    1353,    /* OBJ_tcg_at_tpmIdLabel            2 23 133 2 15 */
-    1354,    /* OBJ_tcg_at_tpmSpecification      2 23 133 2 16 */
-    1355,    /* OBJ_tcg_at_tcgPlatformSpecification 2 23 133 2 17 */
-    1356,    /* OBJ_tcg_at_tpmSecurityAssertions 2 23 133 2 18 */
-    1357,    /* OBJ_tcg_at_tbbSecurityAssertions 2 23 133 2 19 */
-    1358,    /* OBJ_tcg_at_tcgCredentialSpecification 2 23 133 2 23 */
-    1359,    /* OBJ_tcg_at_tcgCredentialType     2 23 133 2 25 */
-    1360,    /* OBJ_tcg_at_previousPlatformCertificates 2 23 133 2 26 */
-    1361,    /* OBJ_tcg_at_tbbSecurityAssertions_v3 2 23 133 2 27 */
-    1362,    /* OBJ_tcg_at_cryptographicAnchors  2 23 133 2 28 */
-    1382,    /* OBJ_tcg_prt_tpmIdProtocol        2 23 133 3 1 */
-    1367,    /* OBJ_tcg_algorithm_null           2 23 133 4 1 */
-    1336,    /* OBJ_tcg_common                   2 23 133 5 1 */
-    1376,    /* OBJ_tcg_ce_relevantCredentials   2 23 133 6 2 */
-    1377,    /* OBJ_tcg_ce_relevantManifests     2 23 133 6 3 */
-    1378,    /* OBJ_tcg_ce_virtualPlatformAttestationService 2 23 133 6 4 */
-    1379,    /* OBJ_tcg_ce_migrationControllerAttestationService 2 23 133 6 5 */
-    1380,    /* OBJ_tcg_ce_migrationControllerRegistrationService 2 23 133 6 6 */
-    1381,    /* OBJ_tcg_ce_virtualPlatformBackupService 2 23 133 6 7 */
-    1368,    /* OBJ_tcg_kp_EKCertificate         2 23 133 8 1 */
-    1369,    /* OBJ_tcg_kp_PlatformAttributeCertificate 2 23 133 8 2 */
-    1370,    /* OBJ_tcg_kp_AIKCertificate        2 23 133 8 3 */
-    1371,    /* OBJ_tcg_kp_PlatformKeyCertificate 2 23 133 8 4 */
-    1372,    /* OBJ_tcg_kp_DeltaPlatformAttributeCertificate 2 23 133 8 5 */
-    1373,    /* OBJ_tcg_kp_DeltaPlatformKeyCertificate 2 23 133 8 6 */
-    1374,    /* OBJ_tcg_kp_AdditionalPlatformAttributeCertificate 2 23 133 8 7 */
-    1375,    /* OBJ_tcg_kp_AdditionalPlatformKeyCertificate 2 23 133 8 8 */
-    1392,    /* OBJ_tcg_cap_verifiedPlatformCertificate 2 23 133 11 4 */
-    1383,    /* OBJ_tcg_address_ethernetmac      2 23 133 17 1 */
-    1384,    /* OBJ_tcg_address_wlanmac          2 23 133 17 2 */
-    1385,    /* OBJ_tcg_address_bluetoothmac     2 23 133 17 3 */
-    1386,    /* OBJ_tcg_registry_componentClass  2 23 133 18 3 */
-    1393,    /* OBJ_tcg_tr_ID                    2 23 133 19 1 */
-    1394,    /* OBJ_tcg_tr_category              2 23 133 19 2 */
-    1395,    /* OBJ_tcg_tr_registry              2 23 133 19 3 */
-    1274,    /* OBJ_cades_attributes             0 4 0 19122 1 */
-    1268,    /* OBJ_id_aa_ets_mimeType           0 4 0 1733 2 1 */
-    1269,    /* OBJ_id_aa_ets_longTermValidation 0 4 0 1733 2 2 */
-    1270,    /* OBJ_id_aa_ets_SignaturePolicyDocument 0 4 0 1733 2 3 */
-    1271,    /* OBJ_id_aa_ets_archiveTimestampV3 0 4 0 1733 2 4 */
-    1272,    /* OBJ_id_aa_ATSHashIndex           0 4 0 1733 2 5 */
-     804,    /* OBJ_whirlpool                    1 0 10118 3 0 55 */
-    1142,    /* OBJ_sm_scheme                    1 2 156 10197 1 */
-     773,    /* OBJ_kisa                         1 2 410 200004 */
-     807,    /* OBJ_id_GostR3411_94_with_GostR3410_2001 1 2 643 2 2 3 */
-     808,    /* OBJ_id_GostR3411_94_with_GostR3410_94 1 2 643 2 2 4 */
-     809,    /* OBJ_id_GostR3411_94              1 2 643 2 2 9 */
-     810,    /* OBJ_id_HMACGostR3411_94          1 2 643 2 2 10 */
-     811,    /* OBJ_id_GostR3410_2001            1 2 643 2 2 19 */
-     812,    /* OBJ_id_GostR3410_94              1 2 643 2 2 20 */
-     813,    /* OBJ_id_Gost28147_89              1 2 643 2 2 21 */
-     815,    /* OBJ_id_Gost28147_89_MAC          1 2 643 2 2 22 */
-     816,    /* OBJ_id_GostR3411_94_prf          1 2 643 2 2 23 */
-     817,    /* OBJ_id_GostR3410_2001DH          1 2 643 2 2 98 */
-     818,    /* OBJ_id_GostR3410_94DH            1 2 643 2 2 99 */
-     977,    /* OBJ_id_tc26_algorithms           1 2 643 7 1 1 */
-     994,    /* OBJ_id_tc26_constants            1 2 643 7 1 2 */
-    1228,    /* OBJ_classSignToolKC1             1 2 643 100 113 1 */
-    1229,    /* OBJ_classSignToolKC2             1 2 643 100 113 2 */
-    1230,    /* OBJ_classSignToolKC3             1 2 643 100 113 3 */
-    1231,    /* OBJ_classSignToolKB1             1 2 643 100 113 4 */
-    1232,    /* OBJ_classSignToolKB2             1 2 643 100 113 5 */
-    1233,    /* OBJ_classSignToolKA1             1 2 643 100 113 6 */
-       1,    /* OBJ_rsadsi                       1 2 840 113549 */
-     185,    /* OBJ_X9cm                         1 2 840 10040 4 */
-    1031,    /* OBJ_id_pkinit                    1 3 6 1 5 2 3 */
-     127,    /* OBJ_id_pkix                      1 3 6 1 5 5 7 */
-     505,    /* OBJ_mime_mhs_headings            1 3 6 1 7 1 1 */
-     506,    /* OBJ_mime_mhs_bodies              1 3 6 1 7 1 2 */
-     119,    /* OBJ_ripemd160WithRSA             1 3 36 3 3 1 2 */
-     937,    /* OBJ_dhSinglePass_stdDH_sha224kdf_scheme 1 3 132 1 11 0 */
-     938,    /* OBJ_dhSinglePass_stdDH_sha256kdf_scheme 1 3 132 1 11 1 */
-     939,    /* OBJ_dhSinglePass_stdDH_sha384kdf_scheme 1 3 132 1 11 2 */
-     940,    /* OBJ_dhSinglePass_stdDH_sha512kdf_scheme 1 3 132 1 11 3 */
-     942,    /* OBJ_dhSinglePass_cofactorDH_sha224kdf_scheme 1 3 132 1 14 0 */
-     943,    /* OBJ_dhSinglePass_cofactorDH_sha256kdf_scheme 1 3 132 1 14 1 */
-     944,    /* OBJ_dhSinglePass_cofactorDH_sha384kdf_scheme 1 3 132 1 14 2 */
-     945,    /* OBJ_dhSinglePass_cofactorDH_sha512kdf_scheme 1 3 132 1 14 3 */
-     631,    /* OBJ_setAttr_GenCryptgrm          2 23 42 3 3 3 1 */
-     632,    /* OBJ_setAttr_T2Enc                2 23 42 3 3 4 1 */
-     633,    /* OBJ_setAttr_T2cleartxt           2 23 42 3 3 4 2 */
-     634,    /* OBJ_setAttr_TokICCsig            2 23 42 3 3 5 1 */
-     635,    /* OBJ_setAttr_SecDevSig            2 23 42 3 3 5 2 */
-    1337,    /* OBJ_tcg_at_platformManufacturerStr 2 23 133 5 1 1 */
-    1338,    /* OBJ_tcg_at_platformManufacturerId 2 23 133 5 1 2 */
-    1339,    /* OBJ_tcg_at_platformConfigUri     2 23 133 5 1 3 */
-    1340,    /* OBJ_tcg_at_platformModel         2 23 133 5 1 4 */
-    1341,    /* OBJ_tcg_at_platformVersion       2 23 133 5 1 5 */
-    1342,    /* OBJ_tcg_at_platformSerial        2 23 133 5 1 6 */
-    1343,    /* OBJ_tcg_at_platformConfiguration 2 23 133 5 1 7 */
-    1344,    /* OBJ_tcg_at_platformIdentifier    2 23 133 5 1 8 */
-    1387,    /* OBJ_tcg_registry_componentClass_tcg 2 23 133 18 3 1 */
-    1388,    /* OBJ_tcg_registry_componentClass_ietf 2 23 133 18 3 2 */
-    1389,    /* OBJ_tcg_registry_componentClass_dmtf 2 23 133 18 3 3 */
-    1390,    /* OBJ_tcg_registry_componentClass_pcie 2 23 133 18 3 4 */
-    1391,    /* OBJ_tcg_registry_componentClass_disk 2 23 133 18 3 5 */
-    1396,    /* OBJ_tcg_tr_ID_Boolean            2 23 133 19 1 1 */
-    1397,    /* OBJ_tcg_tr_ID_CertificateIdentifier 2 23 133 19 1 2 */
-    1398,    /* OBJ_tcg_tr_ID_CommonCriteria     2 23 133 19 1 3 */
-    1399,    /* OBJ_tcg_tr_ID_componentClass     2 23 133 19 1 4 */
-    1400,    /* OBJ_tcg_tr_ID_componentIdentifierV11 2 23 133 19 1 5 */
-    1401,    /* OBJ_tcg_tr_ID_FIPSLevel          2 23 133 19 1 6 */
-    1402,    /* OBJ_tcg_tr_ID_ISO9000Level       2 23 133 19 1 7 */
-    1403,    /* OBJ_tcg_tr_ID_networkMAC         2 23 133 19 1 8 */
-    1404,    /* OBJ_tcg_tr_ID_OID                2 23 133 19 1 9 */
-    1405,    /* OBJ_tcg_tr_ID_PEN                2 23 133 19 1 10 */
-    1406,    /* OBJ_tcg_tr_ID_platformFirmwareCapabilities 2 23 133 19 1 11 */
-    1407,    /* OBJ_tcg_tr_ID_platformFirmwareSignatureVerification 2 23 133 19 1 12 */
-    1408,    /* OBJ_tcg_tr_ID_platformFirmwareUpdateCompliance 2 23 133 19 1 13 */
-    1409,    /* OBJ_tcg_tr_ID_platformHardwareCapabilities 2 23 133 19 1 14 */
-    1410,    /* OBJ_tcg_tr_ID_RTM                2 23 133 19 1 15 */
-    1411,    /* OBJ_tcg_tr_ID_status             2 23 133 19 1 16 */
-    1412,    /* OBJ_tcg_tr_ID_URI                2 23 133 19 1 17 */
-    1413,    /* OBJ_tcg_tr_ID_UTF8String         2 23 133 19 1 18 */
-    1414,    /* OBJ_tcg_tr_ID_IA5String          2 23 133 19 1 19 */
-    1415,    /* OBJ_tcg_tr_ID_PEMCertString      2 23 133 19 1 20 */
-    1416,    /* OBJ_tcg_tr_ID_PublicKey          2 23 133 19 1 21 */
-    1417,    /* OBJ_tcg_tr_cat_platformManufacturer 2 23 133 19 2 1 */
-    1418,    /* OBJ_tcg_tr_cat_platformModel     2 23 133 19 2 2 */
-    1419,    /* OBJ_tcg_tr_cat_platformVersion   2 23 133 19 2 3 */
-    1420,    /* OBJ_tcg_tr_cat_platformSerial    2 23 133 19 2 4 */
-    1421,    /* OBJ_tcg_tr_cat_platformManufacturerIdentifier 2 23 133 19 2 5 */
-    1422,    /* OBJ_tcg_tr_cat_platformOwnership 2 23 133 19 2 6 */
-    1423,    /* OBJ_tcg_tr_cat_componentClass    2 23 133 19 2 7 */
-    1424,    /* OBJ_tcg_tr_cat_componentManufacturer 2 23 133 19 2 8 */
-    1425,    /* OBJ_tcg_tr_cat_componentModel    2 23 133 19 2 9 */
-    1426,    /* OBJ_tcg_tr_cat_componentSerial   2 23 133 19 2 10 */
-    1427,    /* OBJ_tcg_tr_cat_componentStatus   2 23 133 19 2 11 */
-    1428,    /* OBJ_tcg_tr_cat_componentLocation 2 23 133 19 2 12 */
-    1429,    /* OBJ_tcg_tr_cat_componentRevision 2 23 133 19 2 13 */
-    1430,    /* OBJ_tcg_tr_cat_componentFieldReplaceable 2 23 133 19 2 14 */
-    1431,    /* OBJ_tcg_tr_cat_EKCertificate     2 23 133 19 2 15 */
-    1432,    /* OBJ_tcg_tr_cat_IAKCertificate    2 23 133 19 2 16 */
-    1433,    /* OBJ_tcg_tr_cat_IDevIDCertificate 2 23 133 19 2 17 */
-    1434,    /* OBJ_tcg_tr_cat_DICECertificate   2 23 133 19 2 18 */
-    1435,    /* OBJ_tcg_tr_cat_SPDMCertificate   2 23 133 19 2 19 */
-    1436,    /* OBJ_tcg_tr_cat_PEMCertificate    2 23 133 19 2 20 */
-    1437,    /* OBJ_tcg_tr_cat_PlatformCertificate 2 23 133 19 2 21 */
-    1438,    /* OBJ_tcg_tr_cat_DeltaPlatformCertificate 2 23 133 19 2 22 */
-    1439,    /* OBJ_tcg_tr_cat_RebasePlatformCertificate 2 23 133 19 2 23 */
-    1440,    /* OBJ_tcg_tr_cat_genericCertificate 2 23 133 19 2 24 */
-    1441,    /* OBJ_tcg_tr_cat_CommonCriteria    2 23 133 19 2 25 */
-    1442,    /* OBJ_tcg_tr_cat_componentIdentifierV11 2 23 133 19 2 26 */
-    1443,    /* OBJ_tcg_tr_cat_FIPSLevel         2 23 133 19 2 27 */
-    1444,    /* OBJ_tcg_tr_cat_ISO9000           2 23 133 19 2 28 */
-    1445,    /* OBJ_tcg_tr_cat_networkMAC        2 23 133 19 2 29 */
-    1446,    /* OBJ_tcg_tr_cat_attestationProtocol 2 23 133 19 2 30 */
-    1447,    /* OBJ_tcg_tr_cat_PEN               2 23 133 19 2 31 */
-    1448,    /* OBJ_tcg_tr_cat_platformFirmwareCapabilities 2 23 133 19 2 32 */
-    1449,    /* OBJ_tcg_tr_cat_platformHardwareCapabilities 2 23 133 19 2 33 */
-    1450,    /* OBJ_tcg_tr_cat_platformFirmwareSignatureVerification 2 23 133 19 2 34 */
-    1451,    /* OBJ_tcg_tr_cat_platformFirmwareUpdateCompliance 2 23 133 19 2 35 */
-    1452,    /* OBJ_tcg_tr_cat_RTM               2 23 133 19 2 36 */
-    1453,    /* OBJ_tcg_tr_cat_PublicKey         2 23 133 19 2 37 */
-    1275,    /* OBJ_id_aa_ets_signerAttrV2       0 4 0 19122 1 1 */
-    1276,    /* OBJ_id_aa_ets_sigPolicyStore     0 4 0 19122 1 3 */
-    1277,    /* OBJ_id_aa_ATSHashIndex_v2        0 4 0 19122 1 4 */
-    1278,    /* OBJ_id_aa_ATSHashIndex_v3        0 4 0 19122 1 5 */
-    1279,    /* OBJ_signedAssertion              0 4 0 19122 1 6 */
-     436,    /* OBJ_ucl                          0 9 2342 19200300 */
-     820,    /* OBJ_id_Gost28147_89_None_KeyMeshing 1 2 643 2 2 14 0 */
-     819,    /* OBJ_id_Gost28147_89_CryptoPro_KeyMeshing 1 2 643 2 2 14 1 */
-     845,    /* OBJ_id_GostR3410_94_a            1 2 643 2 2 20 1 */
-     846,    /* OBJ_id_GostR3410_94_aBis         1 2 643 2 2 20 2 */
-     847,    /* OBJ_id_GostR3410_94_b            1 2 643 2 2 20 3 */
-     848,    /* OBJ_id_GostR3410_94_bBis         1 2 643 2 2 20 4 */
-     821,    /* OBJ_id_GostR3411_94_TestParamSet 1 2 643 2 2 30 0 */
-     822,    /* OBJ_id_GostR3411_94_CryptoProParamSet 1 2 643 2 2 30 1 */
-     823,    /* OBJ_id_Gost28147_89_TestParamSet 1 2 643 2 2 31 0 */
-     824,    /* OBJ_id_Gost28147_89_CryptoPro_A_ParamSet 1 2 643 2 2 31 1 */
-     825,    /* OBJ_id_Gost28147_89_CryptoPro_B_ParamSet 1 2 643 2 2 31 2 */
-     826,    /* OBJ_id_Gost28147_89_CryptoPro_C_ParamSet 1 2 643 2 2 31 3 */
-     827,    /* OBJ_id_Gost28147_89_CryptoPro_D_ParamSet 1 2 643 2 2 31 4 */
-     828,    /* OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet 1 2 643 2 2 31 5 */
-     829,    /* OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet 1 2 643 2 2 31 6 */
-     830,    /* OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet 1 2 643 2 2 31 7 */
-     831,    /* OBJ_id_GostR3410_94_TestParamSet 1 2 643 2 2 32 0 */
-     832,    /* OBJ_id_GostR3410_94_CryptoPro_A_ParamSet 1 2 643 2 2 32 2 */
-     833,    /* OBJ_id_GostR3410_94_CryptoPro_B_ParamSet 1 2 643 2 2 32 3 */
-     834,    /* OBJ_id_GostR3410_94_CryptoPro_C_ParamSet 1 2 643 2 2 32 4 */
-     835,    /* OBJ_id_GostR3410_94_CryptoPro_D_ParamSet 1 2 643 2 2 32 5 */
-     836,    /* OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet 1 2 643 2 2 33 1 */
-     837,    /* OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet 1 2 643 2 2 33 2 */
-     838,    /* OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet 1 2 643 2 2 33 3 */
-     839,    /* OBJ_id_GostR3410_2001_TestParamSet 1 2 643 2 2 35 0 */
-     840,    /* OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet 1 2 643 2 2 35 1 */
-     841,    /* OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet 1 2 643 2 2 35 2 */
-     842,    /* OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet 1 2 643 2 2 35 3 */
-     843,    /* OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet 1 2 643 2 2 36 0 */
-     844,    /* OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet 1 2 643 2 2 36 1 */
-     978,    /* OBJ_id_tc26_sign                 1 2 643 7 1 1 1 */
-     981,    /* OBJ_id_tc26_digest               1 2 643 7 1 1 2 */
-     984,    /* OBJ_id_tc26_signwithdigest       1 2 643 7 1 1 3 */
-     987,    /* OBJ_id_tc26_mac                  1 2 643 7 1 1 4 */
-     990,    /* OBJ_id_tc26_cipher               1 2 643 7 1 1 5 */
-     991,    /* OBJ_id_tc26_agreement            1 2 643 7 1 1 6 */
-    1179,    /* OBJ_id_tc26_wrap                 1 2 643 7 1 1 7 */
-     995,    /* OBJ_id_tc26_sign_constants       1 2 643 7 1 2 1 */
-    1000,    /* OBJ_id_tc26_digest_constants     1 2 643 7 1 2 2 */
-    1001,    /* OBJ_id_tc26_cipher_constants     1 2 643 7 1 2 5 */
-    1151,    /* OBJ_ua_pki                       1 2 804 2 1 1 1 */
-       2,    /* OBJ_pkcs                         1 2 840 113549 1 */
-     431,    /* OBJ_hold_instruction_none        1 2 840 10040 2 1 */
-     432,    /* OBJ_hold_instruction_call_issuer 1 2 840 10040 2 2 */
-     433,    /* OBJ_hold_instruction_reject      1 2 840 10040 2 3 */
-     116,    /* OBJ_dsa                          1 2 840 10040 4 1 */
-     113,    /* OBJ_dsaWithSHA1                  1 2 840 10040 4 3 */
-     406,    /* OBJ_X9_62_prime_field            1 2 840 10045 1 1 */
-     407,    /* OBJ_X9_62_characteristic_two_field 1 2 840 10045 1 2 */
-     408,    /* OBJ_X9_62_id_ecPublicKey         1 2 840 10045 2 1 */
-     416,    /* OBJ_ecdsa_with_SHA1              1 2 840 10045 4 1 */
-     791,    /* OBJ_ecdsa_with_Recommended       1 2 840 10045 4 2 */
-     792,    /* OBJ_ecdsa_with_Specified         1 2 840 10045 4 3 */
-     920,    /* OBJ_dhpublicnumber               1 2 840 10046 2 1 */
-    1032,    /* OBJ_pkInitClientAuth             1 3 6 1 5 2 3 4 */
-    1033,    /* OBJ_pkInitKDC                    1 3 6 1 5 2 3 5 */
-     258,    /* OBJ_id_pkix_mod                  1 3 6 1 5 5 7 0 */
-     175,    /* OBJ_id_pe                        1 3 6 1 5 5 7 1 */
-     259,    /* OBJ_id_qt                        1 3 6 1 5 5 7 2 */
-     128,    /* OBJ_id_kp                        1 3 6 1 5 5 7 3 */
-     260,    /* OBJ_id_it                        1 3 6 1 5 5 7 4 */
-     261,    /* OBJ_id_pkip                      1 3 6 1 5 5 7 5 */
-     262,    /* OBJ_id_alg                       1 3 6 1 5 5 7 6 */
-     263,    /* OBJ_id_cmc                       1 3 6 1 5 5 7 7 */
-     264,    /* OBJ_id_on                        1 3 6 1 5 5 7 8 */
-     265,    /* OBJ_id_pda                       1 3 6 1 5 5 7 9 */
-     266,    /* OBJ_id_aca                       1 3 6 1 5 5 7 10 */
-     267,    /* OBJ_id_qcs                       1 3 6 1 5 5 7 11 */
-     268,    /* OBJ_id_cct                       1 3 6 1 5 5 7 12 */
-    1238,    /* OBJ_id_cp                        1 3 6 1 5 5 7 14 */
-     662,    /* OBJ_id_ppl                       1 3 6 1 5 5 7 21 */
-     176,    /* OBJ_id_ad                        1 3 6 1 5 5 7 48 */
-     507,    /* OBJ_id_hex_partial_message       1 3 6 1 7 1 1 1 */
-     508,    /* OBJ_id_hex_multipart_message     1 3 6 1 7 1 1 2 */
-      57,    /* OBJ_netscape                     2 16 840 1 113730 */
-    1282,    /* OBJ_oracle                       2 16 840 1 113894 */
-    1363,    /* OBJ_tcg_at_platformConfiguration_v1 2 23 133 5 1 7 1 */
-    1364,    /* OBJ_tcg_at_platformConfiguration_v2 2 23 133 5 1 7 2 */
-    1365,    /* OBJ_tcg_at_platformConfiguration_v3 2 23 133 5 1 7 3 */
-    1366,    /* OBJ_tcg_at_platformConfigUri_v3  2 23 133 5 1 7 4 */
-     754,    /* OBJ_camellia_128_ecb             0 3 4401 5 3 1 9 1 */
-     766,    /* OBJ_camellia_128_ofb128          0 3 4401 5 3 1 9 3 */
-     757,    /* OBJ_camellia_128_cfb128          0 3 4401 5 3 1 9 4 */
-     961,    /* OBJ_camellia_128_gcm             0 3 4401 5 3 1 9 6 */
-     962,    /* OBJ_camellia_128_ccm             0 3 4401 5 3 1 9 7 */
-     963,    /* OBJ_camellia_128_ctr             0 3 4401 5 3 1 9 9 */
-     964,    /* OBJ_camellia_128_cmac            0 3 4401 5 3 1 9 10 */
-     755,    /* OBJ_camellia_192_ecb             0 3 4401 5 3 1 9 21 */
-     767,    /* OBJ_camellia_192_ofb128          0 3 4401 5 3 1 9 23 */
-     758,    /* OBJ_camellia_192_cfb128          0 3 4401 5 3 1 9 24 */
-     965,    /* OBJ_camellia_192_gcm             0 3 4401 5 3 1 9 26 */
-     966,    /* OBJ_camellia_192_ccm             0 3 4401 5 3 1 9 27 */
-     967,    /* OBJ_camellia_192_ctr             0 3 4401 5 3 1 9 29 */
-     968,    /* OBJ_camellia_192_cmac            0 3 4401 5 3 1 9 30 */
-     756,    /* OBJ_camellia_256_ecb             0 3 4401 5 3 1 9 41 */
-     768,    /* OBJ_camellia_256_ofb128          0 3 4401 5 3 1 9 43 */
-     759,    /* OBJ_camellia_256_cfb128          0 3 4401 5 3 1 9 44 */
-     969,    /* OBJ_camellia_256_gcm             0 3 4401 5 3 1 9 46 */
-     970,    /* OBJ_camellia_256_ccm             0 3 4401 5 3 1 9 47 */
-     971,    /* OBJ_camellia_256_ctr             0 3 4401 5 3 1 9 49 */
-     972,    /* OBJ_camellia_256_cmac            0 3 4401 5 3 1 9 50 */
-     437,    /* OBJ_pilot                        0 9 2342 19200300 100 */
-    1133,    /* OBJ_sm4_ecb                      1 2 156 10197 1 104 1 */
-    1134,    /* OBJ_sm4_cbc                      1 2 156 10197 1 104 2 */
-    1135,    /* OBJ_sm4_ofb128                   1 2 156 10197 1 104 3 */
-    1137,    /* OBJ_sm4_cfb128                   1 2 156 10197 1 104 4 */
-    1136,    /* OBJ_sm4_cfb1                     1 2 156 10197 1 104 5 */
-    1138,    /* OBJ_sm4_cfb8                     1 2 156 10197 1 104 6 */
-    1139,    /* OBJ_sm4_ctr                      1 2 156 10197 1 104 7 */
-    1248,    /* OBJ_sm4_gcm                      1 2 156 10197 1 104 8 */
-    1249,    /* OBJ_sm4_ccm                      1 2 156 10197 1 104 9 */
-    1290,    /* OBJ_sm4_xts                      1 2 156 10197 1 104 10 */
-    1172,    /* OBJ_sm2                          1 2 156 10197 1 301 */
-    1143,    /* OBJ_sm3                          1 2 156 10197 1 401 */
-    1204,    /* OBJ_SM2_with_SM3                 1 2 156 10197 1 501 */
-    1144,    /* OBJ_sm3WithRSAEncryption         1 2 156 10197 1 504 */
-     776,    /* OBJ_seed_ecb                     1 2 410 200004 1 3 */
-     777,    /* OBJ_seed_cbc                     1 2 410 200004 1 4 */
-     779,    /* OBJ_seed_cfb128                  1 2 410 200004 1 5 */
-     778,    /* OBJ_seed_ofb128                  1 2 410 200004 1 6 */
-     852,    /* OBJ_id_GostR3411_94_with_GostR3410_94_cc 1 2 643 2 9 1 3 3 */
-     853,    /* OBJ_id_GostR3411_94_with_GostR3410_2001_cc 1 2 643 2 9 1 3 4 */
-     850,    /* OBJ_id_GostR3410_94_cc           1 2 643 2 9 1 5 3 */
-     851,    /* OBJ_id_GostR3410_2001_cc         1 2 643 2 9 1 5 4 */
-     849,    /* OBJ_id_Gost28147_89_cc           1 2 643 2 9 1 6 1 */
-     854,    /* OBJ_id_GostR3410_2001_ParamSet_cc 1 2 643 2 9 1 8 1 */
-    1004,    /* OBJ_INN                          1 2 643 3 131 1 1 */
-     979,    /* OBJ_id_GostR3410_2012_256        1 2 643 7 1 1 1 1 */
-     980,    /* OBJ_id_GostR3410_2012_512        1 2 643 7 1 1 1 2 */
-     982,    /* OBJ_id_GostR3411_2012_256        1 2 643 7 1 1 2 2 */
-     983,    /* OBJ_id_GostR3411_2012_512        1 2 643 7 1 1 2 3 */
-     985,    /* OBJ_id_tc26_signwithdigest_gost3410_2012_256 1 2 643 7 1 1 3 2 */
-     986,    /* OBJ_id_tc26_signwithdigest_gost3410_2012_512 1 2 643 7 1 1 3 3 */
-     988,    /* OBJ_id_tc26_hmac_gost_3411_2012_256 1 2 643 7 1 1 4 1 */
-     989,    /* OBJ_id_tc26_hmac_gost_3411_2012_512 1 2 643 7 1 1 4 2 */
-    1173,    /* OBJ_id_tc26_cipher_gostr3412_2015_magma 1 2 643 7 1 1 5 1 */
-    1176,    /* OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik 1 2 643 7 1 1 5 2 */
-     992,    /* OBJ_id_tc26_agreement_gost_3410_2012_256 1 2 643 7 1 1 6 1 */
-     993,    /* OBJ_id_tc26_agreement_gost_3410_2012_512 1 2 643 7 1 1 6 2 */
-    1180,    /* OBJ_id_tc26_wrap_gostr3412_2015_magma 1 2 643 7 1 1 7 1 */
-    1182,    /* OBJ_id_tc26_wrap_gostr3412_2015_kuznyechik 1 2 643 7 1 1 7 2 */
-    1147,    /* OBJ_id_tc26_gost_3410_2012_256_constants 1 2 643 7 1 2 1 1 */
-     996,    /* OBJ_id_tc26_gost_3410_2012_512_constants 1 2 643 7 1 2 1 2 */
-    1002,    /* OBJ_id_tc26_gost_28147_constants 1 2 643 7 1 2 5 1 */
-     186,    /* OBJ_pkcs1                        1 2 840 113549 1 1 */
-      27,    /* OBJ_pkcs3                        1 2 840 113549 1 3 */
-     187,    /* OBJ_pkcs5                        1 2 840 113549 1 5 */
-      20,    /* OBJ_pkcs7                        1 2 840 113549 1 7 */
-      47,    /* OBJ_pkcs9                        1 2 840 113549 1 9 */
-       3,    /* OBJ_md2                          1 2 840 113549 2 2 */
-     257,    /* OBJ_md4                          1 2 840 113549 2 4 */
-       4,    /* OBJ_md5                          1 2 840 113549 2 5 */
-     797,    /* OBJ_hmacWithMD5                  1 2 840 113549 2 6 */
-     163,    /* OBJ_hmacWithSHA1                 1 2 840 113549 2 7 */
-     798,    /* OBJ_hmacWithSHA224               1 2 840 113549 2 8 */
-     799,    /* OBJ_hmacWithSHA256               1 2 840 113549 2 9 */
-     800,    /* OBJ_hmacWithSHA384               1 2 840 113549 2 10 */
-     801,    /* OBJ_hmacWithSHA512               1 2 840 113549 2 11 */
-    1193,    /* OBJ_hmacWithSHA512_224           1 2 840 113549 2 12 */
-    1194,    /* OBJ_hmacWithSHA512_256           1 2 840 113549 2 13 */
-      37,    /* OBJ_rc2_cbc                      1 2 840 113549 3 2 */
-       5,    /* OBJ_rc4                          1 2 840 113549 3 4 */
-      44,    /* OBJ_des_ede3_cbc                 1 2 840 113549 3 7 */
-     120,    /* OBJ_rc5_cbc                      1 2 840 113549 3 8 */
-     643,    /* OBJ_des_cdmf                     1 2 840 113549 3 10 */
-     680,    /* OBJ_X9_62_id_characteristic_two_basis 1 2 840 10045 1 2 3 */
-     684,    /* OBJ_X9_62_c2pnb163v1             1 2 840 10045 3 0 1 */
-     685,    /* OBJ_X9_62_c2pnb163v2             1 2 840 10045 3 0 2 */
-     686,    /* OBJ_X9_62_c2pnb163v3             1 2 840 10045 3 0 3 */
-     687,    /* OBJ_X9_62_c2pnb176v1             1 2 840 10045 3 0 4 */
-     688,    /* OBJ_X9_62_c2tnb191v1             1 2 840 10045 3 0 5 */
-     689,    /* OBJ_X9_62_c2tnb191v2             1 2 840 10045 3 0 6 */
-     690,    /* OBJ_X9_62_c2tnb191v3             1 2 840 10045 3 0 7 */
-     691,    /* OBJ_X9_62_c2onb191v4             1 2 840 10045 3 0 8 */
-     692,    /* OBJ_X9_62_c2onb191v5             1 2 840 10045 3 0 9 */
-     693,    /* OBJ_X9_62_c2pnb208w1             1 2 840 10045 3 0 10 */
-     694,    /* OBJ_X9_62_c2tnb239v1             1 2 840 10045 3 0 11 */
-     695,    /* OBJ_X9_62_c2tnb239v2             1 2 840 10045 3 0 12 */
-     696,    /* OBJ_X9_62_c2tnb239v3             1 2 840 10045 3 0 13 */
-     697,    /* OBJ_X9_62_c2onb239v4             1 2 840 10045 3 0 14 */
-     698,    /* OBJ_X9_62_c2onb239v5             1 2 840 10045 3 0 15 */
-     699,    /* OBJ_X9_62_c2pnb272w1             1 2 840 10045 3 0 16 */
-     700,    /* OBJ_X9_62_c2pnb304w1             1 2 840 10045 3 0 17 */
-     701,    /* OBJ_X9_62_c2tnb359v1             1 2 840 10045 3 0 18 */
-     702,    /* OBJ_X9_62_c2pnb368w1             1 2 840 10045 3 0 19 */
-     703,    /* OBJ_X9_62_c2tnb431r1             1 2 840 10045 3 0 20 */
-     409,    /* OBJ_X9_62_prime192v1             1 2 840 10045 3 1 1 */
-     410,    /* OBJ_X9_62_prime192v2             1 2 840 10045 3 1 2 */
-     411,    /* OBJ_X9_62_prime192v3             1 2 840 10045 3 1 3 */
-     412,    /* OBJ_X9_62_prime239v1             1 2 840 10045 3 1 4 */
-     413,    /* OBJ_X9_62_prime239v2             1 2 840 10045 3 1 5 */
-     414,    /* OBJ_X9_62_prime239v3             1 2 840 10045 3 1 6 */
-     415,    /* OBJ_X9_62_prime256v1             1 2 840 10045 3 1 7 */
-     793,    /* OBJ_ecdsa_with_SHA224            1 2 840 10045 4 3 1 */
-     794,    /* OBJ_ecdsa_with_SHA256            1 2 840 10045 4 3 2 */
-     795,    /* OBJ_ecdsa_with_SHA384            1 2 840 10045 4 3 3 */
-     796,    /* OBJ_ecdsa_with_SHA512            1 2 840 10045 4 3 4 */
-     269,    /* OBJ_id_pkix1_explicit_88         1 3 6 1 5 5 7 0 1 */
-     270,    /* OBJ_id_pkix1_implicit_88         1 3 6 1 5 5 7 0 2 */
-     271,    /* OBJ_id_pkix1_explicit_93         1 3 6 1 5 5 7 0 3 */
-     272,    /* OBJ_id_pkix1_implicit_93         1 3 6 1 5 5 7 0 4 */
-     273,    /* OBJ_id_mod_crmf                  1 3 6 1 5 5 7 0 5 */
-     274,    /* OBJ_id_mod_cmc                   1 3 6 1 5 5 7 0 6 */
-     275,    /* OBJ_id_mod_kea_profile_88        1 3 6 1 5 5 7 0 7 */
-     276,    /* OBJ_id_mod_kea_profile_93        1 3 6 1 5 5 7 0 8 */
-     277,    /* OBJ_id_mod_cmp                   1 3 6 1 5 5 7 0 9 */
-     278,    /* OBJ_id_mod_qualified_cert_88     1 3 6 1 5 5 7 0 10 */
-     279,    /* OBJ_id_mod_qualified_cert_93     1 3 6 1 5 5 7 0 11 */
-     280,    /* OBJ_id_mod_attribute_cert        1 3 6 1 5 5 7 0 12 */
-     281,    /* OBJ_id_mod_timestamp_protocol    1 3 6 1 5 5 7 0 13 */
-     282,    /* OBJ_id_mod_ocsp                  1 3 6 1 5 5 7 0 14 */
-     283,    /* OBJ_id_mod_dvcs                  1 3 6 1 5 5 7 0 15 */
-     284,    /* OBJ_id_mod_cmp2000               1 3 6 1 5 5 7 0 16 */
-    1251,    /* OBJ_id_mod_cmp2000_02            1 3 6 1 5 5 7 0 50 */
-    1252,    /* OBJ_id_mod_cmp2021_88            1 3 6 1 5 5 7 0 99 */
-    1253,    /* OBJ_id_mod_cmp2021_02            1 3 6 1 5 5 7 0 100 */
-     177,    /* OBJ_info_access                  1 3 6 1 5 5 7 1 1 */
-     285,    /* OBJ_biometricInfo                1 3 6 1 5 5 7 1 2 */
-     286,    /* OBJ_qcStatements                 1 3 6 1 5 5 7 1 3 */
-     287,    /* OBJ_ac_auditIdentity             1 3 6 1 5 5 7 1 4 */
-     288,    /* OBJ_ac_targeting                 1 3 6 1 5 5 7 1 5 */
-     289,    /* OBJ_aaControls                   1 3 6 1 5 5 7 1 6 */
-     290,    /* OBJ_sbgp_ipAddrBlock             1 3 6 1 5 5 7 1 7 */
-     291,    /* OBJ_sbgp_autonomousSysNum        1 3 6 1 5 5 7 1 8 */
-     292,    /* OBJ_sbgp_routerIdentifier        1 3 6 1 5 5 7 1 9 */
-     397,    /* OBJ_ac_proxying                  1 3 6 1 5 5 7 1 10 */
-     398,    /* OBJ_sinfo_access                 1 3 6 1 5 5 7 1 11 */
-     663,    /* OBJ_proxyCertInfo                1 3 6 1 5 5 7 1 14 */
-    1020,    /* OBJ_tlsfeature                   1 3 6 1 5 5 7 1 24 */
-    1239,    /* OBJ_sbgp_ipAddrBlockv2           1 3 6 1 5 5 7 1 28 */
-    1240,    /* OBJ_sbgp_autonomousSysNumv2      1 3 6 1 5 5 7 1 29 */
-     164,    /* OBJ_id_qt_cps                    1 3 6 1 5 5 7 2 1 */
-     165,    /* OBJ_id_qt_unotice                1 3 6 1 5 5 7 2 2 */
-     293,    /* OBJ_textNotice                   1 3 6 1 5 5 7 2 3 */
-     129,    /* OBJ_server_auth                  1 3 6 1 5 5 7 3 1 */
-     130,    /* OBJ_client_auth                  1 3 6 1 5 5 7 3 2 */
-     131,    /* OBJ_code_sign                    1 3 6 1 5 5 7 3 3 */
-     132,    /* OBJ_email_protect                1 3 6 1 5 5 7 3 4 */
-     294,    /* OBJ_ipsecEndSystem               1 3 6 1 5 5 7 3 5 */
-     295,    /* OBJ_ipsecTunnel                  1 3 6 1 5 5 7 3 6 */
-     296,    /* OBJ_ipsecUser                    1 3 6 1 5 5 7 3 7 */
-     133,    /* OBJ_time_stamp                   1 3 6 1 5 5 7 3 8 */
-     180,    /* OBJ_OCSP_sign                    1 3 6 1 5 5 7 3 9 */
-     297,    /* OBJ_dvcs                         1 3 6 1 5 5 7 3 10 */
-    1022,    /* OBJ_ipsec_IKE                    1 3 6 1 5 5 7 3 17 */
-    1023,    /* OBJ_capwapAC                     1 3 6 1 5 5 7 3 18 */
-    1024,    /* OBJ_capwapWTP                    1 3 6 1 5 5 7 3 19 */
-    1025,    /* OBJ_sshClient                    1 3 6 1 5 5 7 3 21 */
-    1026,    /* OBJ_sshServer                    1 3 6 1 5 5 7 3 22 */
-    1027,    /* OBJ_sendRouter                   1 3 6 1 5 5 7 3 23 */
-    1028,    /* OBJ_sendProxiedRouter            1 3 6 1 5 5 7 3 24 */
-    1029,    /* OBJ_sendOwner                    1 3 6 1 5 5 7 3 25 */
-    1030,    /* OBJ_sendProxiedOwner             1 3 6 1 5 5 7 3 26 */
-    1131,    /* OBJ_cmcCA                        1 3 6 1 5 5 7 3 27 */
-    1132,    /* OBJ_cmcRA                        1 3 6 1 5 5 7 3 28 */
-    1219,    /* OBJ_cmcArchive                   1 3 6 1 5 5 7 3 29 */
-    1220,    /* OBJ_id_kp_bgpsec_router          1 3 6 1 5 5 7 3 30 */
-    1221,    /* OBJ_id_kp_BrandIndicatorforMessageIdentification 1 3 6 1 5 5 7 3 31 */
-    1222,    /* OBJ_cmKGA                        1 3 6 1 5 5 7 3 32 */
-     298,    /* OBJ_id_it_caProtEncCert          1 3 6 1 5 5 7 4 1 */
-     299,    /* OBJ_id_it_signKeyPairTypes       1 3 6 1 5 5 7 4 2 */
-     300,    /* OBJ_id_it_encKeyPairTypes        1 3 6 1 5 5 7 4 3 */
-     301,    /* OBJ_id_it_preferredSymmAlg       1 3 6 1 5 5 7 4 4 */
-     302,    /* OBJ_id_it_caKeyUpdateInfo        1 3 6 1 5 5 7 4 5 */
-     303,    /* OBJ_id_it_currentCRL             1 3 6 1 5 5 7 4 6 */
-     304,    /* OBJ_id_it_unsupportedOIDs        1 3 6 1 5 5 7 4 7 */
-     305,    /* OBJ_id_it_subscriptionRequest    1 3 6 1 5 5 7 4 8 */
-     306,    /* OBJ_id_it_subscriptionResponse   1 3 6 1 5 5 7 4 9 */
-     307,    /* OBJ_id_it_keyPairParamReq        1 3 6 1 5 5 7 4 10 */
-     308,    /* OBJ_id_it_keyPairParamRep        1 3 6 1 5 5 7 4 11 */
-     309,    /* OBJ_id_it_revPassphrase          1 3 6 1 5 5 7 4 12 */
-     310,    /* OBJ_id_it_implicitConfirm        1 3 6 1 5 5 7 4 13 */
-     311,    /* OBJ_id_it_confirmWaitTime        1 3 6 1 5 5 7 4 14 */
-     312,    /* OBJ_id_it_origPKIMessage         1 3 6 1 5 5 7 4 15 */
-     784,    /* OBJ_id_it_suppLangTags           1 3 6 1 5 5 7 4 16 */
-    1223,    /* OBJ_id_it_caCerts                1 3 6 1 5 5 7 4 17 */
-    1224,    /* OBJ_id_it_rootCaKeyUpdate        1 3 6 1 5 5 7 4 18 */
-    1225,    /* OBJ_id_it_certReqTemplate        1 3 6 1 5 5 7 4 19 */
-    1254,    /* OBJ_id_it_rootCaCert             1 3 6 1 5 5 7 4 20 */
-    1255,    /* OBJ_id_it_certProfile            1 3 6 1 5 5 7 4 21 */
-    1256,    /* OBJ_id_it_crlStatusList          1 3 6 1 5 5 7 4 22 */
-    1257,    /* OBJ_id_it_crls                   1 3 6 1 5 5 7 4 23 */
-     313,    /* OBJ_id_regCtrl                   1 3 6 1 5 5 7 5 1 */
-     314,    /* OBJ_id_regInfo                   1 3 6 1 5 5 7 5 2 */
-     323,    /* OBJ_id_alg_des40                 1 3 6 1 5 5 7 6 1 */
-     324,    /* OBJ_id_alg_noSignature           1 3 6 1 5 5 7 6 2 */
-     325,    /* OBJ_id_alg_dh_sig_hmac_sha1      1 3 6 1 5 5 7 6 3 */
-     326,    /* OBJ_id_alg_dh_pop                1 3 6 1 5 5 7 6 4 */
-     327,    /* OBJ_id_cmc_statusInfo            1 3 6 1 5 5 7 7 1 */
-     328,    /* OBJ_id_cmc_identification        1 3 6 1 5 5 7 7 2 */
-     329,    /* OBJ_id_cmc_identityProof         1 3 6 1 5 5 7 7 3 */
-     330,    /* OBJ_id_cmc_dataReturn            1 3 6 1 5 5 7 7 4 */
-     331,    /* OBJ_id_cmc_transactionId         1 3 6 1 5 5 7 7 5 */
-     332,    /* OBJ_id_cmc_senderNonce           1 3 6 1 5 5 7 7 6 */
-     333,    /* OBJ_id_cmc_recipientNonce        1 3 6 1 5 5 7 7 7 */
-     334,    /* OBJ_id_cmc_addExtensions         1 3 6 1 5 5 7 7 8 */
-     335,    /* OBJ_id_cmc_encryptedPOP          1 3 6 1 5 5 7 7 9 */
-     336,    /* OBJ_id_cmc_decryptedPOP          1 3 6 1 5 5 7 7 10 */
-     337,    /* OBJ_id_cmc_lraPOPWitness         1 3 6 1 5 5 7 7 11 */
-     338,    /* OBJ_id_cmc_getCert               1 3 6 1 5 5 7 7 15 */
-     339,    /* OBJ_id_cmc_getCRL                1 3 6 1 5 5 7 7 16 */
-     340,    /* OBJ_id_cmc_revokeRequest         1 3 6 1 5 5 7 7 17 */
-     341,    /* OBJ_id_cmc_regInfo               1 3 6 1 5 5 7 7 18 */
-     342,    /* OBJ_id_cmc_responseInfo          1 3 6 1 5 5 7 7 19 */
-     343,    /* OBJ_id_cmc_queryPending          1 3 6 1 5 5 7 7 21 */
-     344,    /* OBJ_id_cmc_popLinkRandom         1 3 6 1 5 5 7 7 22 */
-     345,    /* OBJ_id_cmc_popLinkWitness        1 3 6 1 5 5 7 7 23 */
-     346,    /* OBJ_id_cmc_confirmCertAcceptance 1 3 6 1 5 5 7 7 24 */
-     347,    /* OBJ_id_on_personalData           1 3 6 1 5 5 7 8 1 */
-     858,    /* OBJ_id_on_permanentIdentifier    1 3 6 1 5 5 7 8 3 */
-    1321,    /* OBJ_id_on_hardwareModuleName     1 3 6 1 5 5 7 8 4 */
-    1209,    /* OBJ_XmppAddr                     1 3 6 1 5 5 7 8 5 */
-    1210,    /* OBJ_SRVName                      1 3 6 1 5 5 7 8 7 */
-    1211,    /* OBJ_NAIRealm                     1 3 6 1 5 5 7 8 8 */
-    1208,    /* OBJ_id_on_SmtpUTF8Mailbox        1 3 6 1 5 5 7 8 9 */
-     348,    /* OBJ_id_pda_dateOfBirth           1 3 6 1 5 5 7 9 1 */
-     349,    /* OBJ_id_pda_placeOfBirth          1 3 6 1 5 5 7 9 2 */
-     351,    /* OBJ_id_pda_gender                1 3 6 1 5 5 7 9 3 */
-     352,    /* OBJ_id_pda_countryOfCitizenship  1 3 6 1 5 5 7 9 4 */
-     353,    /* OBJ_id_pda_countryOfResidence    1 3 6 1 5 5 7 9 5 */
-     354,    /* OBJ_id_aca_authenticationInfo    1 3 6 1 5 5 7 10 1 */
-     355,    /* OBJ_id_aca_accessIdentity        1 3 6 1 5 5 7 10 2 */
-     356,    /* OBJ_id_aca_chargingIdentity      1 3 6 1 5 5 7 10 3 */
-     357,    /* OBJ_id_aca_group                 1 3 6 1 5 5 7 10 4 */
-     358,    /* OBJ_id_aca_role                  1 3 6 1 5 5 7 10 5 */
-     399,    /* OBJ_id_aca_encAttrs              1 3 6 1 5 5 7 10 6 */
-     359,    /* OBJ_id_qcs_pkixQCSyntax_v1       1 3 6 1 5 5 7 11 1 */
-     360,    /* OBJ_id_cct_crs                   1 3 6 1 5 5 7 12 1 */
-     361,    /* OBJ_id_cct_PKIData               1 3 6 1 5 5 7 12 2 */
-     362,    /* OBJ_id_cct_PKIResponse           1 3 6 1 5 5 7 12 3 */
-    1241,    /* OBJ_ipAddr_asNumber              1 3 6 1 5 5 7 14 2 */
-    1242,    /* OBJ_ipAddr_asNumberv2            1 3 6 1 5 5 7 14 3 */
-     664,    /* OBJ_id_ppl_anyLanguage           1 3 6 1 5 5 7 21 0 */
-     665,    /* OBJ_id_ppl_inheritAll            1 3 6 1 5 5 7 21 1 */
-     667,    /* OBJ_Independent                  1 3 6 1 5 5 7 21 2 */
-     178,    /* OBJ_ad_OCSP                      1 3 6 1 5 5 7 48 1 */
-     179,    /* OBJ_ad_ca_issuers                1 3 6 1 5 5 7 48 2 */
-     363,    /* OBJ_ad_timeStamping              1 3 6 1 5 5 7 48 3 */
-     364,    /* OBJ_ad_dvcs                      1 3 6 1 5 5 7 48 4 */
-     785,    /* OBJ_caRepository                 1 3 6 1 5 5 7 48 5 */
-    1243,    /* OBJ_rpkiManifest                 1 3 6 1 5 5 7 48 10 */
-    1244,    /* OBJ_signedObject                 1 3 6 1 5 5 7 48 11 */
-    1245,    /* OBJ_rpkiNotify                   1 3 6 1 5 5 7 48 13 */
-     780,    /* OBJ_hmac_md5                     1 3 6 1 5 5 8 1 1 */
-     781,    /* OBJ_hmac_sha1                    1 3 6 1 5 5 8 1 2 */
-     913,    /* OBJ_aes_128_xts                  1 3 111 2 1619 0 1 1 */
-     914,    /* OBJ_aes_256_xts                  1 3 111 2 1619 0 1 2 */
-      58,    /* OBJ_netscape_cert_extension      2 16 840 1 113730 1 */
-      59,    /* OBJ_netscape_data_type           2 16 840 1 113730 2 */
-     438,    /* OBJ_pilotAttributeType           0 9 2342 19200300 100 1 */
-     439,    /* OBJ_pilotAttributeSyntax         0 9 2342 19200300 100 3 */
-     440,    /* OBJ_pilotObjectClass             0 9 2342 19200300 100 4 */
-     441,    /* OBJ_pilotGroups                  0 9 2342 19200300 100 10 */
-    1065,    /* OBJ_aria_128_ecb                 1 2 410 200046 1 1 1 */
-    1066,    /* OBJ_aria_128_cbc                 1 2 410 200046 1 1 2 */
-    1067,    /* OBJ_aria_128_cfb128              1 2 410 200046 1 1 3 */
-    1068,    /* OBJ_aria_128_ofb128              1 2 410 200046 1 1 4 */
-    1069,    /* OBJ_aria_128_ctr                 1 2 410 200046 1 1 5 */
-    1070,    /* OBJ_aria_192_ecb                 1 2 410 200046 1 1 6 */
-    1071,    /* OBJ_aria_192_cbc                 1 2 410 200046 1 1 7 */
-    1072,    /* OBJ_aria_192_cfb128              1 2 410 200046 1 1 8 */
-    1073,    /* OBJ_aria_192_ofb128              1 2 410 200046 1 1 9 */
-    1074,    /* OBJ_aria_192_ctr                 1 2 410 200046 1 1 10 */
-    1075,    /* OBJ_aria_256_ecb                 1 2 410 200046 1 1 11 */
-    1076,    /* OBJ_aria_256_cbc                 1 2 410 200046 1 1 12 */
-    1077,    /* OBJ_aria_256_cfb128              1 2 410 200046 1 1 13 */
-    1078,    /* OBJ_aria_256_ofb128              1 2 410 200046 1 1 14 */
-    1079,    /* OBJ_aria_256_ctr                 1 2 410 200046 1 1 15 */
-    1123,    /* OBJ_aria_128_gcm                 1 2 410 200046 1 1 34 */
-    1124,    /* OBJ_aria_192_gcm                 1 2 410 200046 1 1 35 */
-    1125,    /* OBJ_aria_256_gcm                 1 2 410 200046 1 1 36 */
-    1120,    /* OBJ_aria_128_ccm                 1 2 410 200046 1 1 37 */
-    1121,    /* OBJ_aria_192_ccm                 1 2 410 200046 1 1 38 */
-    1122,    /* OBJ_aria_256_ccm                 1 2 410 200046 1 1 39 */
-    1174,    /* OBJ_magma_ctr_acpkm              1 2 643 7 1 1 5 1 1 */
-    1175,    /* OBJ_magma_ctr_acpkm_omac         1 2 643 7 1 1 5 1 2 */
-    1177,    /* OBJ_kuznyechik_ctr_acpkm         1 2 643 7 1 1 5 2 1 */
-    1178,    /* OBJ_kuznyechik_ctr_acpkm_omac    1 2 643 7 1 1 5 2 2 */
-    1181,    /* OBJ_magma_kexp15                 1 2 643 7 1 1 7 1 1 */
-    1183,    /* OBJ_kuznyechik_kexp15            1 2 643 7 1 1 7 2 1 */
-    1148,    /* OBJ_id_tc26_gost_3410_2012_256_paramSetA 1 2 643 7 1 2 1 1 1 */
-    1184,    /* OBJ_id_tc26_gost_3410_2012_256_paramSetB 1 2 643 7 1 2 1 1 2 */
-    1185,    /* OBJ_id_tc26_gost_3410_2012_256_paramSetC 1 2 643 7 1 2 1 1 3 */
-    1186,    /* OBJ_id_tc26_gost_3410_2012_256_paramSetD 1 2 643 7 1 2 1 1 4 */
-     997,    /* OBJ_id_tc26_gost_3410_2012_512_paramSetTest 1 2 643 7 1 2 1 2 0 */
-     998,    /* OBJ_id_tc26_gost_3410_2012_512_paramSetA 1 2 643 7 1 2 1 2 1 */
-     999,    /* OBJ_id_tc26_gost_3410_2012_512_paramSetB 1 2 643 7 1 2 1 2 2 */
-    1149,    /* OBJ_id_tc26_gost_3410_2012_512_paramSetC 1 2 643 7 1 2 1 2 3 */
-    1003,    /* OBJ_id_tc26_gost_28147_param_Z   1 2 643 7 1 2 5 1 1 */
-     108,    /* OBJ_cast5_cbc                    1 2 840 113533 7 66 10 */
-     112,    /* OBJ_pbeWithMD5AndCast5_CBC       1 2 840 113533 7 66 12 */
-     782,    /* OBJ_id_PasswordBasedMAC          1 2 840 113533 7 66 13 */
-     783,    /* OBJ_id_DHBasedMac                1 2 840 113533 7 66 30 */
-       6,    /* OBJ_rsaEncryption                1 2 840 113549 1 1 1 */
-       7,    /* OBJ_md2WithRSAEncryption         1 2 840 113549 1 1 2 */
-     396,    /* OBJ_md4WithRSAEncryption         1 2 840 113549 1 1 3 */
-       8,    /* OBJ_md5WithRSAEncryption         1 2 840 113549 1 1 4 */
-      65,    /* OBJ_sha1WithRSAEncryption        1 2 840 113549 1 1 5 */
-     644,    /* OBJ_rsaOAEPEncryptionSET         1 2 840 113549 1 1 6 */
-     919,    /* OBJ_rsaesOaep                    1 2 840 113549 1 1 7 */
-     911,    /* OBJ_mgf1                         1 2 840 113549 1 1 8 */
-     935,    /* OBJ_pSpecified                   1 2 840 113549 1 1 9 */
-     912,    /* OBJ_rsassaPss                    1 2 840 113549 1 1 10 */
-     668,    /* OBJ_sha256WithRSAEncryption      1 2 840 113549 1 1 11 */
-     669,    /* OBJ_sha384WithRSAEncryption      1 2 840 113549 1 1 12 */
-     670,    /* OBJ_sha512WithRSAEncryption      1 2 840 113549 1 1 13 */
-     671,    /* OBJ_sha224WithRSAEncryption      1 2 840 113549 1 1 14 */
-    1145,    /* OBJ_sha512_224WithRSAEncryption  1 2 840 113549 1 1 15 */
-    1146,    /* OBJ_sha512_256WithRSAEncryption  1 2 840 113549 1 1 16 */
-      28,    /* OBJ_dhKeyAgreement               1 2 840 113549 1 3 1 */
-       9,    /* OBJ_pbeWithMD2AndDES_CBC         1 2 840 113549 1 5 1 */
-      10,    /* OBJ_pbeWithMD5AndDES_CBC         1 2 840 113549 1 5 3 */
-     168,    /* OBJ_pbeWithMD2AndRC2_CBC         1 2 840 113549 1 5 4 */
-     169,    /* OBJ_pbeWithMD5AndRC2_CBC         1 2 840 113549 1 5 6 */
-     170,    /* OBJ_pbeWithSHA1AndDES_CBC        1 2 840 113549 1 5 10 */
-      68,    /* OBJ_pbeWithSHA1AndRC2_CBC        1 2 840 113549 1 5 11 */
-      69,    /* OBJ_id_pbkdf2                    1 2 840 113549 1 5 12 */
-     161,    /* OBJ_pbes2                        1 2 840 113549 1 5 13 */
-     162,    /* OBJ_pbmac1                       1 2 840 113549 1 5 14 */
-      21,    /* OBJ_pkcs7_data                   1 2 840 113549 1 7 1 */
-      22,    /* OBJ_pkcs7_signed                 1 2 840 113549 1 7 2 */
-      23,    /* OBJ_pkcs7_enveloped              1 2 840 113549 1 7 3 */
-      24,    /* OBJ_pkcs7_signedAndEnveloped     1 2 840 113549 1 7 4 */
-      25,    /* OBJ_pkcs7_digest                 1 2 840 113549 1 7 5 */
-      26,    /* OBJ_pkcs7_encrypted              1 2 840 113549 1 7 6 */
-      48,    /* OBJ_pkcs9_emailAddress           1 2 840 113549 1 9 1 */
-      49,    /* OBJ_pkcs9_unstructuredName       1 2 840 113549 1 9 2 */
-      50,    /* OBJ_pkcs9_contentType            1 2 840 113549 1 9 3 */
-      51,    /* OBJ_pkcs9_messageDigest          1 2 840 113549 1 9 4 */
-      52,    /* OBJ_pkcs9_signingTime            1 2 840 113549 1 9 5 */
-      53,    /* OBJ_pkcs9_countersignature       1 2 840 113549 1 9 6 */
-      54,    /* OBJ_pkcs9_challengePassword      1 2 840 113549 1 9 7 */
-      55,    /* OBJ_pkcs9_unstructuredAddress    1 2 840 113549 1 9 8 */
-      56,    /* OBJ_pkcs9_extCertAttributes      1 2 840 113549 1 9 9 */
-     172,    /* OBJ_ext_req                      1 2 840 113549 1 9 14 */
-     167,    /* OBJ_SMIMECapabilities            1 2 840 113549 1 9 15 */
-     188,    /* OBJ_SMIME                        1 2 840 113549 1 9 16 */
-     156,    /* OBJ_friendlyName                 1 2 840 113549 1 9 20 */
-     157,    /* OBJ_localKeyID                   1 2 840 113549 1 9 21 */
-    1263,    /* OBJ_id_aa_CMSAlgorithmProtection 1 2 840 113549 1 9 52 */
-     681,    /* OBJ_X9_62_onBasis                1 2 840 10045 1 2 3 1 */
-     682,    /* OBJ_X9_62_tpBasis                1 2 840 10045 1 2 3 2 */
-     683,    /* OBJ_X9_62_ppBasis                1 2 840 10045 1 2 3 3 */
-     417,    /* OBJ_ms_csp_name                  1 3 6 1 4 1 311 17 1 */
-     856,    /* OBJ_LocalKeySet                  1 3 6 1 4 1 311 17 2 */
-    1293,    /* OBJ_ms_cert_templ                1 3 6 1 4 1 311 21 7 */
-    1294,    /* OBJ_ms_app_policies              1 3 6 1 4 1 311 21 10 */
-    1292,    /* OBJ_ms_ntds_sec_ext              1 3 6 1 4 1 311 25 2 */
-    1322,    /* OBJ_id_kp_wisun_fan_device       1 3 6 1 4 1 45605 1 */
-     390,    /* OBJ_dcObject                     1 3 6 1 4 1 1466 344 */
-      91,    /* OBJ_bf_cbc                       1 3 6 1 4 1 3029 1 2 */
-     973,    /* OBJ_id_scrypt                    1 3 6 1 4 1 11591 4 11 */
-     315,    /* OBJ_id_regCtrl_regToken          1 3 6 1 5 5 7 5 1 1 */
-     316,    /* OBJ_id_regCtrl_authenticator     1 3 6 1 5 5 7 5 1 2 */
-     317,    /* OBJ_id_regCtrl_pkiPublicationInfo 1 3 6 1 5 5 7 5 1 3 */
-     318,    /* OBJ_id_regCtrl_pkiArchiveOptions 1 3 6 1 5 5 7 5 1 4 */
-     319,    /* OBJ_id_regCtrl_oldCertID         1 3 6 1 5 5 7 5 1 5 */
-     320,    /* OBJ_id_regCtrl_protocolEncrKey   1 3 6 1 5 5 7 5 1 6 */
-    1258,    /* OBJ_id_regCtrl_altCertTemplate   1 3 6 1 5 5 7 5 1 7 */
-    1259,    /* OBJ_id_regCtrl_algId             1 3 6 1 5 5 7 5 1 11 */
-    1260,    /* OBJ_id_regCtrl_rsaKeyLen         1 3 6 1 5 5 7 5 1 12 */
-     321,    /* OBJ_id_regInfo_utf8Pairs         1 3 6 1 5 5 7 5 2 1 */
-     322,    /* OBJ_id_regInfo_certReq           1 3 6 1 5 5 7 5 2 2 */
-     365,    /* OBJ_id_pkix_OCSP_basic           1 3 6 1 5 5 7 48 1 1 */
-     366,    /* OBJ_id_pkix_OCSP_Nonce           1 3 6 1 5 5 7 48 1 2 */
-     367,    /* OBJ_id_pkix_OCSP_CrlID           1 3 6 1 5 5 7 48 1 3 */
-     368,    /* OBJ_id_pkix_OCSP_acceptableResponses 1 3 6 1 5 5 7 48 1 4 */
-     369,    /* OBJ_id_pkix_OCSP_noCheck         1 3 6 1 5 5 7 48 1 5 */
-     370,    /* OBJ_id_pkix_OCSP_archiveCutoff   1 3 6 1 5 5 7 48 1 6 */
-     371,    /* OBJ_id_pkix_OCSP_serviceLocator  1 3 6 1 5 5 7 48 1 7 */
-     372,    /* OBJ_id_pkix_OCSP_extendedStatus  1 3 6 1 5 5 7 48 1 8 */
-     373,    /* OBJ_id_pkix_OCSP_valid           1 3 6 1 5 5 7 48 1 9 */
-     374,    /* OBJ_id_pkix_OCSP_path            1 3 6 1 5 5 7 48 1 10 */
-     375,    /* OBJ_id_pkix_OCSP_trustRoot       1 3 6 1 5 5 7 48 1 11 */
-     921,    /* OBJ_brainpoolP160r1              1 3 36 3 3 2 8 1 1 1 */
-     922,    /* OBJ_brainpoolP160t1              1 3 36 3 3 2 8 1 1 2 */
-     923,    /* OBJ_brainpoolP192r1              1 3 36 3 3 2 8 1 1 3 */
-     924,    /* OBJ_brainpoolP192t1              1 3 36 3 3 2 8 1 1 4 */
-     925,    /* OBJ_brainpoolP224r1              1 3 36 3 3 2 8 1 1 5 */
-     926,    /* OBJ_brainpoolP224t1              1 3 36 3 3 2 8 1 1 6 */
-     927,    /* OBJ_brainpoolP256r1              1 3 36 3 3 2 8 1 1 7 */
-     928,    /* OBJ_brainpoolP256t1              1 3 36 3 3 2 8 1 1 8 */
-     929,    /* OBJ_brainpoolP320r1              1 3 36 3 3 2 8 1 1 9 */
-     930,    /* OBJ_brainpoolP320t1              1 3 36 3 3 2 8 1 1 10 */
-     931,    /* OBJ_brainpoolP384r1              1 3 36 3 3 2 8 1 1 11 */
-     932,    /* OBJ_brainpoolP384t1              1 3 36 3 3 2 8 1 1 12 */
-     933,    /* OBJ_brainpoolP512r1              1 3 36 3 3 2 8 1 1 13 */
-     934,    /* OBJ_brainpoolP512t1              1 3 36 3 3 2 8 1 1 14 */
-     936,    /* OBJ_dhSinglePass_stdDH_sha1kdf_scheme 1 3 133 16 840 63 0 2 */
-     941,    /* OBJ_dhSinglePass_cofactorDH_sha1kdf_scheme 1 3 133 16 840 63 0 3 */
-     418,    /* OBJ_aes_128_ecb                  2 16 840 1 101 3 4 1 1 */
-     419,    /* OBJ_aes_128_cbc                  2 16 840 1 101 3 4 1 2 */
-     420,    /* OBJ_aes_128_ofb128               2 16 840 1 101 3 4 1 3 */
-     421,    /* OBJ_aes_128_cfb128               2 16 840 1 101 3 4 1 4 */
-     788,    /* OBJ_id_aes128_wrap               2 16 840 1 101 3 4 1 5 */
-     895,    /* OBJ_aes_128_gcm                  2 16 840 1 101 3 4 1 6 */
-     896,    /* OBJ_aes_128_ccm                  2 16 840 1 101 3 4 1 7 */
-     897,    /* OBJ_id_aes128_wrap_pad           2 16 840 1 101 3 4 1 8 */
-     422,    /* OBJ_aes_192_ecb                  2 16 840 1 101 3 4 1 21 */
-     423,    /* OBJ_aes_192_cbc                  2 16 840 1 101 3 4 1 22 */
-     424,    /* OBJ_aes_192_ofb128               2 16 840 1 101 3 4 1 23 */
-     425,    /* OBJ_aes_192_cfb128               2 16 840 1 101 3 4 1 24 */
-     789,    /* OBJ_id_aes192_wrap               2 16 840 1 101 3 4 1 25 */
-     898,    /* OBJ_aes_192_gcm                  2 16 840 1 101 3 4 1 26 */
-     899,    /* OBJ_aes_192_ccm                  2 16 840 1 101 3 4 1 27 */
-     900,    /* OBJ_id_aes192_wrap_pad           2 16 840 1 101 3 4 1 28 */
-     426,    /* OBJ_aes_256_ecb                  2 16 840 1 101 3 4 1 41 */
-     427,    /* OBJ_aes_256_cbc                  2 16 840 1 101 3 4 1 42 */
-     428,    /* OBJ_aes_256_ofb128               2 16 840 1 101 3 4 1 43 */
-     429,    /* OBJ_aes_256_cfb128               2 16 840 1 101 3 4 1 44 */
-     790,    /* OBJ_id_aes256_wrap               2 16 840 1 101 3 4 1 45 */
-     901,    /* OBJ_aes_256_gcm                  2 16 840 1 101 3 4 1 46 */
-     902,    /* OBJ_aes_256_ccm                  2 16 840 1 101 3 4 1 47 */
-     903,    /* OBJ_id_aes256_wrap_pad           2 16 840 1 101 3 4 1 48 */
-     672,    /* OBJ_sha256                       2 16 840 1 101 3 4 2 1 */
-     673,    /* OBJ_sha384                       2 16 840 1 101 3 4 2 2 */
-     674,    /* OBJ_sha512                       2 16 840 1 101 3 4 2 3 */
-     675,    /* OBJ_sha224                       2 16 840 1 101 3 4 2 4 */
-    1094,    /* OBJ_sha512_224                   2 16 840 1 101 3 4 2 5 */
-    1095,    /* OBJ_sha512_256                   2 16 840 1 101 3 4 2 6 */
-    1096,    /* OBJ_sha3_224                     2 16 840 1 101 3 4 2 7 */
-    1097,    /* OBJ_sha3_256                     2 16 840 1 101 3 4 2 8 */
-    1098,    /* OBJ_sha3_384                     2 16 840 1 101 3 4 2 9 */
-    1099,    /* OBJ_sha3_512                     2 16 840 1 101 3 4 2 10 */
-    1100,    /* OBJ_shake128                     2 16 840 1 101 3 4 2 11 */
-    1101,    /* OBJ_shake256                     2 16 840 1 101 3 4 2 12 */
-    1102,    /* OBJ_hmac_sha3_224                2 16 840 1 101 3 4 2 13 */
-    1103,    /* OBJ_hmac_sha3_256                2 16 840 1 101 3 4 2 14 */
-    1104,    /* OBJ_hmac_sha3_384                2 16 840 1 101 3 4 2 15 */
-    1105,    /* OBJ_hmac_sha3_512                2 16 840 1 101 3 4 2 16 */
-    1196,    /* OBJ_kmac128                      2 16 840 1 101 3 4 2 19 */
-    1197,    /* OBJ_kmac256                      2 16 840 1 101 3 4 2 20 */
-     802,    /* OBJ_dsa_with_SHA224              2 16 840 1 101 3 4 3 1 */
-     803,    /* OBJ_dsa_with_SHA256              2 16 840 1 101 3 4 3 2 */
-    1106,    /* OBJ_dsa_with_SHA384              2 16 840 1 101 3 4 3 3 */
-    1107,    /* OBJ_dsa_with_SHA512              2 16 840 1 101 3 4 3 4 */
-    1108,    /* OBJ_dsa_with_SHA3_224            2 16 840 1 101 3 4 3 5 */
-    1109,    /* OBJ_dsa_with_SHA3_256            2 16 840 1 101 3 4 3 6 */
-    1110,    /* OBJ_dsa_with_SHA3_384            2 16 840 1 101 3 4 3 7 */
-    1111,    /* OBJ_dsa_with_SHA3_512            2 16 840 1 101 3 4 3 8 */
-    1112,    /* OBJ_ecdsa_with_SHA3_224          2 16 840 1 101 3 4 3 9 */
-    1113,    /* OBJ_ecdsa_with_SHA3_256          2 16 840 1 101 3 4 3 10 */
-    1114,    /* OBJ_ecdsa_with_SHA3_384          2 16 840 1 101 3 4 3 11 */
-    1115,    /* OBJ_ecdsa_with_SHA3_512          2 16 840 1 101 3 4 3 12 */
-    1116,    /* OBJ_RSA_SHA3_224                 2 16 840 1 101 3 4 3 13 */
-    1117,    /* OBJ_RSA_SHA3_256                 2 16 840 1 101 3 4 3 14 */
-    1118,    /* OBJ_RSA_SHA3_384                 2 16 840 1 101 3 4 3 15 */
-    1119,    /* OBJ_RSA_SHA3_512                 2 16 840 1 101 3 4 3 16 */
-    1457,    /* OBJ_ML_DSA_44                    2 16 840 1 101 3 4 3 17 */
-    1458,    /* OBJ_ML_DSA_65                    2 16 840 1 101 3 4 3 18 */
-    1459,    /* OBJ_ML_DSA_87                    2 16 840 1 101 3 4 3 19 */
-    1460,    /* OBJ_SLH_DSA_SHA2_128s            2 16 840 1 101 3 4 3 20 */
-    1461,    /* OBJ_SLH_DSA_SHA2_128f            2 16 840 1 101 3 4 3 21 */
-    1462,    /* OBJ_SLH_DSA_SHA2_192s            2 16 840 1 101 3 4 3 22 */
-    1463,    /* OBJ_SLH_DSA_SHA2_192f            2 16 840 1 101 3 4 3 23 */
-    1464,    /* OBJ_SLH_DSA_SHA2_256s            2 16 840 1 101 3 4 3 24 */
-    1465,    /* OBJ_SLH_DSA_SHA2_256f            2 16 840 1 101 3 4 3 25 */
-    1466,    /* OBJ_SLH_DSA_SHAKE_128s           2 16 840 1 101 3 4 3 26 */
-    1467,    /* OBJ_SLH_DSA_SHAKE_128f           2 16 840 1 101 3 4 3 27 */
-    1468,    /* OBJ_SLH_DSA_SHAKE_192s           2 16 840 1 101 3 4 3 28 */
-    1469,    /* OBJ_SLH_DSA_SHAKE_192f           2 16 840 1 101 3 4 3 29 */
-    1470,    /* OBJ_SLH_DSA_SHAKE_256s           2 16 840 1 101 3 4 3 30 */
-    1471,    /* OBJ_SLH_DSA_SHAKE_256f           2 16 840 1 101 3 4 3 31 */
-    1472,    /* OBJ_HASH_ML_DSA_44_WITH_SHA512   2 16 840 1 101 3 4 3 32 */
-    1473,    /* OBJ_HASH_ML_DSA_65_WITH_SHA512   2 16 840 1 101 3 4 3 33 */
-    1474,    /* OBJ_HASH_ML_DSA_87_WITH_SHA512   2 16 840 1 101 3 4 3 34 */
-    1475,    /* OBJ_SLH_DSA_SHA2_128s_WITH_SHA256 2 16 840 1 101 3 4 3 35 */
-    1476,    /* OBJ_SLH_DSA_SHA2_128f_WITH_SHA256 2 16 840 1 101 3 4 3 36 */
-    1477,    /* OBJ_SLH_DSA_SHA2_192s_WITH_SHA512 2 16 840 1 101 3 4 3 37 */
-    1478,    /* OBJ_SLH_DSA_SHA2_192f_WITH_SHA512 2 16 840 1 101 3 4 3 38 */
-    1479,    /* OBJ_SLH_DSA_SHA2_256s_WITH_SHA512 2 16 840 1 101 3 4 3 39 */
-    1480,    /* OBJ_SLH_DSA_SHA2_256f_WITH_SHA512 2 16 840 1 101 3 4 3 40 */
-    1481,    /* OBJ_SLH_DSA_SHAKE_128s_WITH_SHAKE128 2 16 840 1 101 3 4 3 41 */
-    1482,    /* OBJ_SLH_DSA_SHAKE_128f_WITH_SHAKE128 2 16 840 1 101 3 4 3 42 */
-    1483,    /* OBJ_SLH_DSA_SHAKE_192s_WITH_SHAKE256 2 16 840 1 101 3 4 3 43 */
-    1484,    /* OBJ_SLH_DSA_SHAKE_192f_WITH_SHAKE256 2 16 840 1 101 3 4 3 44 */
-    1485,    /* OBJ_SLH_DSA_SHAKE_256s_WITH_SHAKE256 2 16 840 1 101 3 4 3 45 */
-    1486,    /* OBJ_SLH_DSA_SHAKE_256f_WITH_SHAKE256 2 16 840 1 101 3 4 3 46 */
-    1454,    /* OBJ_ML_KEM_512                   2 16 840 1 101 3 4 4 1 */
-    1455,    /* OBJ_ML_KEM_768                   2 16 840 1 101 3 4 4 2 */
-    1456,    /* OBJ_ML_KEM_1024                  2 16 840 1 101 3 4 4 3 */
-      71,    /* OBJ_netscape_cert_type           2 16 840 1 113730 1 1 */
-      72,    /* OBJ_netscape_base_url            2 16 840 1 113730 1 2 */
-      73,    /* OBJ_netscape_revocation_url      2 16 840 1 113730 1 3 */
-      74,    /* OBJ_netscape_ca_revocation_url   2 16 840 1 113730 1 4 */
-      75,    /* OBJ_netscape_renewal_url         2 16 840 1 113730 1 7 */
-      76,    /* OBJ_netscape_ca_policy_url       2 16 840 1 113730 1 8 */
-      77,    /* OBJ_netscape_ssl_server_name     2 16 840 1 113730 1 12 */
-      78,    /* OBJ_netscape_comment             2 16 840 1 113730 1 13 */
-      79,    /* OBJ_netscape_cert_sequence       2 16 840 1 113730 2 5 */
-     139,    /* OBJ_ns_sgc                       2 16 840 1 113730 4 1 */
-     458,    /* OBJ_userId                       0 9 2342 19200300 100 1 1 */
-     459,    /* OBJ_textEncodedORAddress         0 9 2342 19200300 100 1 2 */
-     460,    /* OBJ_rfc822Mailbox                0 9 2342 19200300 100 1 3 */
-     461,    /* OBJ_info                         0 9 2342 19200300 100 1 4 */
-     462,    /* OBJ_favouriteDrink               0 9 2342 19200300 100 1 5 */
-     463,    /* OBJ_roomNumber                   0 9 2342 19200300 100 1 6 */
-     464,    /* OBJ_photo                        0 9 2342 19200300 100 1 7 */
-     465,    /* OBJ_userClass                    0 9 2342 19200300 100 1 8 */
-     466,    /* OBJ_host                         0 9 2342 19200300 100 1 9 */
-     467,    /* OBJ_manager                      0 9 2342 19200300 100 1 10 */
-     468,    /* OBJ_documentIdentifier           0 9 2342 19200300 100 1 11 */
-     469,    /* OBJ_documentTitle                0 9 2342 19200300 100 1 12 */
-     470,    /* OBJ_documentVersion              0 9 2342 19200300 100 1 13 */
-     471,    /* OBJ_documentAuthor               0 9 2342 19200300 100 1 14 */
-     472,    /* OBJ_documentLocation             0 9 2342 19200300 100 1 15 */
-     473,    /* OBJ_homeTelephoneNumber          0 9 2342 19200300 100 1 20 */
-     474,    /* OBJ_secretary                    0 9 2342 19200300 100 1 21 */
-     475,    /* OBJ_otherMailbox                 0 9 2342 19200300 100 1 22 */
-     476,    /* OBJ_lastModifiedTime             0 9 2342 19200300 100 1 23 */
-     477,    /* OBJ_lastModifiedBy               0 9 2342 19200300 100 1 24 */
-     391,    /* OBJ_domainComponent              0 9 2342 19200300 100 1 25 */
-     478,    /* OBJ_aRecord                      0 9 2342 19200300 100 1 26 */
-     479,    /* OBJ_pilotAttributeType27         0 9 2342 19200300 100 1 27 */
-     480,    /* OBJ_mXRecord                     0 9 2342 19200300 100 1 28 */
-     481,    /* OBJ_nSRecord                     0 9 2342 19200300 100 1 29 */
-     482,    /* OBJ_sOARecord                    0 9 2342 19200300 100 1 30 */
-     483,    /* OBJ_cNAMERecord                  0 9 2342 19200300 100 1 31 */
-     484,    /* OBJ_associatedDomain             0 9 2342 19200300 100 1 37 */
-     485,    /* OBJ_associatedName               0 9 2342 19200300 100 1 38 */
-     486,    /* OBJ_homePostalAddress            0 9 2342 19200300 100 1 39 */
-     487,    /* OBJ_personalTitle                0 9 2342 19200300 100 1 40 */
-     488,    /* OBJ_mobileTelephoneNumber        0 9 2342 19200300 100 1 41 */
-     489,    /* OBJ_pagerTelephoneNumber         0 9 2342 19200300 100 1 42 */
-     490,    /* OBJ_friendlyCountryName          0 9 2342 19200300 100 1 43 */
-     102,    /* OBJ_uniqueIdentifier             0 9 2342 19200300 100 1 44 */
-     491,    /* OBJ_organizationalStatus         0 9 2342 19200300 100 1 45 */
-     492,    /* OBJ_janetMailbox                 0 9 2342 19200300 100 1 46 */
-     493,    /* OBJ_mailPreferenceOption         0 9 2342 19200300 100 1 47 */
-     494,    /* OBJ_buildingName                 0 9 2342 19200300 100 1 48 */
-     495,    /* OBJ_dSAQuality                   0 9 2342 19200300 100 1 49 */
-     496,    /* OBJ_singleLevelQuality           0 9 2342 19200300 100 1 50 */
-     497,    /* OBJ_subtreeMinimumQuality        0 9 2342 19200300 100 1 51 */
-     498,    /* OBJ_subtreeMaximumQuality        0 9 2342 19200300 100 1 52 */
-     499,    /* OBJ_personalSignature            0 9 2342 19200300 100 1 53 */
-     500,    /* OBJ_dITRedirect                  0 9 2342 19200300 100 1 54 */
-     501,    /* OBJ_audio                        0 9 2342 19200300 100 1 55 */
-     502,    /* OBJ_documentPublisher            0 9 2342 19200300 100 1 56 */
-     442,    /* OBJ_iA5StringSyntax              0 9 2342 19200300 100 3 4 */
-     443,    /* OBJ_caseIgnoreIA5StringSyntax    0 9 2342 19200300 100 3 5 */
-     444,    /* OBJ_pilotObject                  0 9 2342 19200300 100 4 3 */
-     445,    /* OBJ_pilotPerson                  0 9 2342 19200300 100 4 4 */
-     446,    /* OBJ_account                      0 9 2342 19200300 100 4 5 */
-     447,    /* OBJ_document                     0 9 2342 19200300 100 4 6 */
-     448,    /* OBJ_room                         0 9 2342 19200300 100 4 7 */
-     449,    /* OBJ_documentSeries               0 9 2342 19200300 100 4 9 */
-     392,    /* OBJ_Domain                       0 9 2342 19200300 100 4 13 */
-     450,    /* OBJ_rFC822localPart              0 9 2342 19200300 100 4 14 */
-     451,    /* OBJ_dNSDomain                    0 9 2342 19200300 100 4 15 */
-     452,    /* OBJ_domainRelatedObject          0 9 2342 19200300 100 4 17 */
-     453,    /* OBJ_friendlyCountry              0 9 2342 19200300 100 4 18 */
-     454,    /* OBJ_simpleSecurityObject         0 9 2342 19200300 100 4 19 */
-     455,    /* OBJ_pilotOrganization            0 9 2342 19200300 100 4 20 */
-     456,    /* OBJ_pilotDSA                     0 9 2342 19200300 100 4 21 */
-     457,    /* OBJ_qualityLabelledData          0 9 2342 19200300 100 4 22 */
-    1281,    /* OBJ_hmacWithSM3                  1 2 156 10197 1 401 3 1 */
-    1152,    /* OBJ_dstu28147                    1 2 804 2 1 1 1 1 1 1 */
-    1156,    /* OBJ_hmacWithDstu34311            1 2 804 2 1 1 1 1 1 2 */
-    1157,    /* OBJ_dstu34311                    1 2 804 2 1 1 1 1 2 1 */
-     189,    /* OBJ_id_smime_mod                 1 2 840 113549 1 9 16 0 */
-     190,    /* OBJ_id_smime_ct                  1 2 840 113549 1 9 16 1 */
-     191,    /* OBJ_id_smime_aa                  1 2 840 113549 1 9 16 2 */
-     192,    /* OBJ_id_smime_alg                 1 2 840 113549 1 9 16 3 */
-     193,    /* OBJ_id_smime_cd                  1 2 840 113549 1 9 16 4 */
-     194,    /* OBJ_id_smime_spq                 1 2 840 113549 1 9 16 5 */
-     195,    /* OBJ_id_smime_cti                 1 2 840 113549 1 9 16 6 */
-     158,    /* OBJ_x509Certificate              1 2 840 113549 1 9 22 1 */
-     159,    /* OBJ_sdsiCertificate              1 2 840 113549 1 9 22 2 */
-     160,    /* OBJ_x509Crl                      1 2 840 113549 1 9 23 1 */
-     144,    /* OBJ_pbe_WithSHA1And128BitRC4     1 2 840 113549 1 12 1 1 */
-     145,    /* OBJ_pbe_WithSHA1And40BitRC4      1 2 840 113549 1 12 1 2 */
-     146,    /* OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC 1 2 840 113549 1 12 1 3 */
-     147,    /* OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC 1 2 840 113549 1 12 1 4 */
-     148,    /* OBJ_pbe_WithSHA1And128BitRC2_CBC 1 2 840 113549 1 12 1 5 */
-     149,    /* OBJ_pbe_WithSHA1And40BitRC2_CBC  1 2 840 113549 1 12 1 6 */
-     171,    /* OBJ_ms_ext_req                   1 3 6 1 4 1 311 2 1 14 */
-     134,    /* OBJ_ms_code_ind                  1 3 6 1 4 1 311 2 1 21 */
-     135,    /* OBJ_ms_code_com                  1 3 6 1 4 1 311 2 1 22 */
-     136,    /* OBJ_ms_ctl_sign                  1 3 6 1 4 1 311 10 3 1 */
-     137,    /* OBJ_ms_sgc                       1 3 6 1 4 1 311 10 3 3 */
-     138,    /* OBJ_ms_efs                       1 3 6 1 4 1 311 10 3 4 */
-     648,    /* OBJ_ms_smartcard_login           1 3 6 1 4 1 311 20 2 2 */
-     649,    /* OBJ_ms_upn                       1 3 6 1 4 1 311 20 2 3 */
-    1291,    /* OBJ_ms_ntds_obj_sid              1 3 6 1 4 1 311 25 2 1 */
-    1201,    /* OBJ_blake2bmac                   1 3 6 1 4 1 1722 12 2 1 */
-    1202,    /* OBJ_blake2smac                   1 3 6 1 4 1 1722 12 2 2 */
-     951,    /* OBJ_ct_precert_scts              1 3 6 1 4 1 11129 2 4 2 */
-     952,    /* OBJ_ct_precert_poison            1 3 6 1 4 1 11129 2 4 3 */
-     953,    /* OBJ_ct_precert_signer            1 3 6 1 4 1 11129 2 4 4 */
-     954,    /* OBJ_ct_cert_scts                 1 3 6 1 4 1 11129 2 4 5 */
-     751,    /* OBJ_camellia_128_cbc             1 2 392 200011 61 1 1 1 2 */
-     752,    /* OBJ_camellia_192_cbc             1 2 392 200011 61 1 1 1 3 */
-     753,    /* OBJ_camellia_256_cbc             1 2 392 200011 61 1 1 1 4 */
-     907,    /* OBJ_id_camellia128_wrap          1 2 392 200011 61 1 1 3 2 */
-     908,    /* OBJ_id_camellia192_wrap          1 2 392 200011 61 1 1 3 3 */
-     909,    /* OBJ_id_camellia256_wrap          1 2 392 200011 61 1 1 3 4 */
-    1153,    /* OBJ_dstu28147_ofb                1 2 804 2 1 1 1 1 1 1 2 */
-    1154,    /* OBJ_dstu28147_cfb                1 2 804 2 1 1 1 1 1 1 3 */
-    1155,    /* OBJ_dstu28147_wrap               1 2 804 2 1 1 1 1 1 1 5 */
-    1158,    /* OBJ_dstu4145le                   1 2 804 2 1 1 1 1 3 1 1 */
-     196,    /* OBJ_id_smime_mod_cms             1 2 840 113549 1 9 16 0 1 */
-     197,    /* OBJ_id_smime_mod_ess             1 2 840 113549 1 9 16 0 2 */
-     198,    /* OBJ_id_smime_mod_oid             1 2 840 113549 1 9 16 0 3 */
-     199,    /* OBJ_id_smime_mod_msg_v3          1 2 840 113549 1 9 16 0 4 */
-     200,    /* OBJ_id_smime_mod_ets_eSignature_88 1 2 840 113549 1 9 16 0 5 */
-     201,    /* OBJ_id_smime_mod_ets_eSignature_97 1 2 840 113549 1 9 16 0 6 */
-     202,    /* OBJ_id_smime_mod_ets_eSigPolicy_88 1 2 840 113549 1 9 16 0 7 */
-     203,    /* OBJ_id_smime_mod_ets_eSigPolicy_97 1 2 840 113549 1 9 16 0 8 */
-     204,    /* OBJ_id_smime_ct_receipt          1 2 840 113549 1 9 16 1 1 */
-     205,    /* OBJ_id_smime_ct_authData         1 2 840 113549 1 9 16 1 2 */
-     206,    /* OBJ_id_smime_ct_publishCert      1 2 840 113549 1 9 16 1 3 */
-     207,    /* OBJ_id_smime_ct_TSTInfo          1 2 840 113549 1 9 16 1 4 */
-     208,    /* OBJ_id_smime_ct_TDTInfo          1 2 840 113549 1 9 16 1 5 */
-     209,    /* OBJ_id_smime_ct_contentInfo      1 2 840 113549 1 9 16 1 6 */
-     210,    /* OBJ_id_smime_ct_DVCSRequestData  1 2 840 113549 1 9 16 1 7 */
-     211,    /* OBJ_id_smime_ct_DVCSResponseData 1 2 840 113549 1 9 16 1 8 */
-     786,    /* OBJ_id_smime_ct_compressedData   1 2 840 113549 1 9 16 1 9 */
-    1058,    /* OBJ_id_smime_ct_contentCollection 1 2 840 113549 1 9 16 1 19 */
-    1059,    /* OBJ_id_smime_ct_authEnvelopedData 1 2 840 113549 1 9 16 1 23 */
-    1234,    /* OBJ_id_ct_routeOriginAuthz       1 2 840 113549 1 9 16 1 24 */
-    1235,    /* OBJ_id_ct_rpkiManifest           1 2 840 113549 1 9 16 1 26 */
-     787,    /* OBJ_id_ct_asciiTextWithCRLF      1 2 840 113549 1 9 16 1 27 */
-    1060,    /* OBJ_id_ct_xml                    1 2 840 113549 1 9 16 1 28 */
-    1236,    /* OBJ_id_ct_rpkiGhostbusters       1 2 840 113549 1 9 16 1 35 */
-    1237,    /* OBJ_id_ct_resourceTaggedAttest   1 2 840 113549 1 9 16 1 36 */
-    1246,    /* OBJ_id_ct_geofeedCSVwithCRLF     1 2 840 113549 1 9 16 1 47 */
-    1247,    /* OBJ_id_ct_signedChecklist        1 2 840 113549 1 9 16 1 48 */
-    1250,    /* OBJ_id_ct_ASPA                   1 2 840 113549 1 9 16 1 49 */
-    1284,    /* OBJ_id_ct_signedTAL              1 2 840 113549 1 9 16 1 50 */
-    1320,    /* OBJ_id_ct_rpkiSignedPrefixList   1 2 840 113549 1 9 16 1 51 */
-     212,    /* OBJ_id_smime_aa_receiptRequest   1 2 840 113549 1 9 16 2 1 */
-     213,    /* OBJ_id_smime_aa_securityLabel    1 2 840 113549 1 9 16 2 2 */
-     214,    /* OBJ_id_smime_aa_mlExpandHistory  1 2 840 113549 1 9 16 2 3 */
-     215,    /* OBJ_id_smime_aa_contentHint      1 2 840 113549 1 9 16 2 4 */
-     216,    /* OBJ_id_smime_aa_msgSigDigest     1 2 840 113549 1 9 16 2 5 */
-     217,    /* OBJ_id_smime_aa_encapContentType 1 2 840 113549 1 9 16 2 6 */
-     218,    /* OBJ_id_smime_aa_contentIdentifier 1 2 840 113549 1 9 16 2 7 */
-     219,    /* OBJ_id_smime_aa_macValue         1 2 840 113549 1 9 16 2 8 */
-     220,    /* OBJ_id_smime_aa_equivalentLabels 1 2 840 113549 1 9 16 2 9 */
-     221,    /* OBJ_id_smime_aa_contentReference 1 2 840 113549 1 9 16 2 10 */
-     222,    /* OBJ_id_smime_aa_encrypKeyPref    1 2 840 113549 1 9 16 2 11 */
-     223,    /* OBJ_id_smime_aa_signingCertificate 1 2 840 113549 1 9 16 2 12 */
-     224,    /* OBJ_id_smime_aa_smimeEncryptCerts 1 2 840 113549 1 9 16 2 13 */
-     225,    /* OBJ_id_smime_aa_timeStampToken   1 2 840 113549 1 9 16 2 14 */
-     226,    /* OBJ_id_smime_aa_ets_sigPolicyId  1 2 840 113549 1 9 16 2 15 */
-     227,    /* OBJ_id_smime_aa_ets_commitmentType 1 2 840 113549 1 9 16 2 16 */
-     228,    /* OBJ_id_smime_aa_ets_signerLocation 1 2 840 113549 1 9 16 2 17 */
-     229,    /* OBJ_id_smime_aa_ets_signerAttr   1 2 840 113549 1 9 16 2 18 */
-     230,    /* OBJ_id_smime_aa_ets_otherSigCert 1 2 840 113549 1 9 16 2 19 */
-     231,    /* OBJ_id_smime_aa_ets_contentTimestamp 1 2 840 113549 1 9 16 2 20 */
-     232,    /* OBJ_id_smime_aa_ets_CertificateRefs 1 2 840 113549 1 9 16 2 21 */
-     233,    /* OBJ_id_smime_aa_ets_RevocationRefs 1 2 840 113549 1 9 16 2 22 */
-     234,    /* OBJ_id_smime_aa_ets_certValues   1 2 840 113549 1 9 16 2 23 */
-     235,    /* OBJ_id_smime_aa_ets_revocationValues 1 2 840 113549 1 9 16 2 24 */
-     236,    /* OBJ_id_smime_aa_ets_escTimeStamp 1 2 840 113549 1 9 16 2 25 */
-     237,    /* OBJ_id_smime_aa_ets_certCRLTimestamp 1 2 840 113549 1 9 16 2 26 */
-     238,    /* OBJ_id_smime_aa_ets_archiveTimeStamp 1 2 840 113549 1 9 16 2 27 */
-     239,    /* OBJ_id_smime_aa_signatureType    1 2 840 113549 1 9 16 2 28 */
-     240,    /* OBJ_id_smime_aa_dvcs_dvc         1 2 840 113549 1 9 16 2 29 */
-    1261,    /* OBJ_id_aa_ets_attrCertificateRefs 1 2 840 113549 1 9 16 2 44 */
-    1262,    /* OBJ_id_aa_ets_attrRevocationRefs 1 2 840 113549 1 9 16 2 45 */
-    1086,    /* OBJ_id_smime_aa_signingCertificateV2 1 2 840 113549 1 9 16 2 47 */
-    1280,    /* OBJ_id_aa_ets_archiveTimestampV2 1 2 840 113549 1 9 16 2 48 */
-     241,    /* OBJ_id_smime_alg_ESDHwith3DES    1 2 840 113549 1 9 16 3 1 */
-     242,    /* OBJ_id_smime_alg_ESDHwithRC2     1 2 840 113549 1 9 16 3 2 */
-     243,    /* OBJ_id_smime_alg_3DESwrap        1 2 840 113549 1 9 16 3 3 */
-     244,    /* OBJ_id_smime_alg_RC2wrap         1 2 840 113549 1 9 16 3 4 */
-     245,    /* OBJ_id_smime_alg_ESDH            1 2 840 113549 1 9 16 3 5 */
-     246,    /* OBJ_id_smime_alg_CMS3DESwrap     1 2 840 113549 1 9 16 3 6 */
-     247,    /* OBJ_id_smime_alg_CMSRC2wrap      1 2 840 113549 1 9 16 3 7 */
-     125,    /* OBJ_zlib_compression             1 2 840 113549 1 9 16 3 8 */
-     893,    /* OBJ_id_alg_PWRI_KEK              1 2 840 113549 1 9 16 3 9 */
-     248,    /* OBJ_id_smime_cd_ldap             1 2 840 113549 1 9 16 4 1 */
-     249,    /* OBJ_id_smime_spq_ets_sqt_uri     1 2 840 113549 1 9 16 5 1 */
-     250,    /* OBJ_id_smime_spq_ets_sqt_unotice 1 2 840 113549 1 9 16 5 2 */
-     251,    /* OBJ_id_smime_cti_ets_proofOfOrigin 1 2 840 113549 1 9 16 6 1 */
-     252,    /* OBJ_id_smime_cti_ets_proofOfReceipt 1 2 840 113549 1 9 16 6 2 */
-     253,    /* OBJ_id_smime_cti_ets_proofOfDelivery 1 2 840 113549 1 9 16 6 3 */
-     254,    /* OBJ_id_smime_cti_ets_proofOfSender 1 2 840 113549 1 9 16 6 4 */
-     255,    /* OBJ_id_smime_cti_ets_proofOfApproval 1 2 840 113549 1 9 16 6 5 */
-     256,    /* OBJ_id_smime_cti_ets_proofOfCreation 1 2 840 113549 1 9 16 6 6 */
-     150,    /* OBJ_keyBag                       1 2 840 113549 1 12 10 1 1 */
-     151,    /* OBJ_pkcs8ShroudedKeyBag          1 2 840 113549 1 12 10 1 2 */
-     152,    /* OBJ_certBag                      1 2 840 113549 1 12 10 1 3 */
-     153,    /* OBJ_crlBag                       1 2 840 113549 1 12 10 1 4 */
-     154,    /* OBJ_secretBag                    1 2 840 113549 1 12 10 1 5 */
-     155,    /* OBJ_safeContentsBag              1 2 840 113549 1 12 10 1 6 */
-      34,    /* OBJ_idea_cbc                     1 3 6 1 4 1 188 7 1 1 2 */
-     955,    /* OBJ_jurisdictionLocalityName     1 3 6 1 4 1 311 60 2 1 1 */
-     956,    /* OBJ_jurisdictionStateOrProvinceName 1 3 6 1 4 1 311 60 2 1 2 */
-     957,    /* OBJ_jurisdictionCountryName      1 3 6 1 4 1 311 60 2 1 3 */
-    1056,    /* OBJ_blake2b512                   1 3 6 1 4 1 1722 12 2 1 16 */
-    1057,    /* OBJ_blake2s256                   1 3 6 1 4 1 1722 12 2 2 8 */
-    1283,    /* OBJ_oracle_jdk_trustedkeyusage   2 16 840 1 113894 746875 1 1 */
-    1159,    /* OBJ_dstu4145be                   1 2 804 2 1 1 1 1 3 1 1 1 1 */
-    1160,    /* OBJ_uacurve0                     1 2 804 2 1 1 1 1 3 1 1 2 0 */
-    1161,    /* OBJ_uacurve1                     1 2 804 2 1 1 1 1 3 1 1 2 1 */
-    1162,    /* OBJ_uacurve2                     1 2 804 2 1 1 1 1 3 1 1 2 2 */
-    1163,    /* OBJ_uacurve3                     1 2 804 2 1 1 1 1 3 1 1 2 3 */
-    1164,    /* OBJ_uacurve4                     1 2 804 2 1 1 1 1 3 1 1 2 4 */
-    1165,    /* OBJ_uacurve5                     1 2 804 2 1 1 1 1 3 1 1 2 5 */
-    1166,    /* OBJ_uacurve6                     1 2 804 2 1 1 1 1 3 1 1 2 6 */
-    1167,    /* OBJ_uacurve7                     1 2 804 2 1 1 1 1 3 1 1 2 7 */
-    1168,    /* OBJ_uacurve8                     1 2 804 2 1 1 1 1 3 1 1 2 8 */
-    1169,    /* OBJ_uacurve9                     1 2 804 2 1 1 1 1 3 1 1 2 9 */
-};
diff --git a/deps/openssl/openssl/crypto/objects/obj_dat.pl b/deps/openssl/openssl/crypto/objects/obj_dat.pl
index 510a906f57f..0f23a26a73d 100644
--- a/deps/openssl/openssl/crypto/objects/obj_dat.pl
+++ b/deps/openssl/openssl/crypto/objects/obj_dat.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -55,6 +55,9 @@ my %obj;
 my %objd;
 open(IN, "$ARGV[0]") || die "Can't open input file $ARGV[0], $!";
 while (<IN>) {
+    # The compatibility aliases appended after the include guard's
+    # closing #endif carry no object data; read only the guarded body.
+    last if m@^#endif\s+/\* OPENSSL_OBJ_MAC_H \*/@;
     next unless /^\#define\s+(\S+)\s+(.*)$/;
     my $v = $1;
     my $d = $2;
@@ -165,6 +168,16 @@ print <<"EOF";
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_OBJECTS_OBJ_DAT_H)
+#define OSSL_LIBCRYPTO_OBJECTS_OBJ_DAT_H
+
+/* clang-format off */
+
+#include <openssl/asn1.h>
+#include <openssl/objects.h>
+
+#include <crypto/asn1.h>
+
 EOF

 print "/* Serialized OID's */\n";
@@ -209,11 +222,11 @@ printf "static const unsigned int obj_objs[NUM_OBJ] = {\n";
 # Compare DER; prefer shorter; if some length, use the "smaller" encoding.
 sub obj_cmp
 {
-    no warnings "uninitialized";
-    my $A = $obj_len{$obj{$nid{$a}}};
-    my $B = $obj_len{$obj{$nid{$b}}};
+    my $A = $obj_len{$obj{$nid{$a}}} // 0;
+    my $B = $obj_len{$obj{$nid{$b}}} // 0;
     my $r = $A - $B;
     return $r if $r != 0;
+    return 0 if $A == 0;

     $A = $obj_der{$obj{$nid{$a}}};
     $B = $obj_der{$obj{$nid{$b}}};
@@ -227,3 +240,5 @@ foreach (sort obj_cmp @a) {
     printf "    %4d,    /* %-32s %s */\n", $_, $m, $v;
 }
 print  "};\n";
+print "/* clang-format on */\n";
+print "\n#endif /* !defined(OSSL_LIBCRYPTO_OBJECTS_OBJ_DAT_H) */\n";
diff --git a/deps/openssl/openssl/crypto/objects/obj_err.c b/deps/openssl/openssl/crypto/objects/obj_err.c
deleted file mode 100644
index c3c54780342..00000000000
--- a/deps/openssl/openssl/crypto/objects/obj_err.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/objectserr.h>
-#include "crypto/objectserr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA OBJ_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_OBJ, 0, OBJ_R_OID_EXISTS), "oid exists" },
-    { ERR_PACK(ERR_LIB_OBJ, 0, OBJ_R_UNKNOWN_NID), "unknown nid" },
-    { ERR_PACK(ERR_LIB_OBJ, 0, OBJ_R_UNKNOWN_OBJECT_NAME),
-        "unknown object name" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_OBJ_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(OBJ_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(OBJ_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/objects/obj_lib.c b/deps/openssl/openssl/crypto/objects/obj_lib.c
index d718a11e222..89be08810c4 100644
--- a/deps/openssl/openssl/crypto/objects/obj_lib.c
+++ b/deps/openssl/openssl/crypto/objects/obj_lib.c
@@ -12,6 +12,7 @@
 #include <openssl/objects.h>
 #include <openssl/buffer.h>
 #include "crypto/asn1.h"
+#include "crypto/asn1/asn1_local.h"

 ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o)
 {
@@ -23,7 +24,7 @@ ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o)
     if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC))
         return (ASN1_OBJECT *)o;

-    r = ASN1_OBJECT_new();
+    r = ossl_asn1_object_new();
     if (r == NULL) {
         ERR_raise(ERR_LIB_OBJ, ERR_R_ASN1_LIB);
         return NULL;
diff --git a/deps/openssl/openssl/crypto/objects/obj_local.h b/deps/openssl/openssl/crypto/objects/obj_local.h
index 73848a6fbfe..e8c83ae5ba6 100644
--- a/deps/openssl/openssl/crypto/objects/obj_local.h
+++ b/deps/openssl/openssl/crypto/objects/obj_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,8 +7,22 @@
  * https://www.openssl.org/source/license.html
  */

-typedef struct name_funcs_st NAME_FUNCS;
+#if !defined(OSSL_LIBCRYPTO_OBJECTS_OBJ_LOCAL_H)
+#define OSSL_LIBCRYPTO_OBJECTS_OBJ_LOCAL_H
+
+#include <openssl/lhash.h>
+#include <openssl/objects.h>
+#include <openssl/safestack.h>
+
+typedef struct name_funcs_st {
+    unsigned long (*hash_func)(const char *name);
+    int (*cmp_func)(const char *a, const char *b);
+    void (*free_func)(const char *, int, const char *);
+} NAME_FUNCS;
+
 DEFINE_STACK_OF(NAME_FUNCS)
 DEFINE_LHASH_OF_EX(OBJ_NAME);
 typedef struct added_obj_st ADDED_OBJ;
 DEFINE_LHASH_OF_EX(ADDED_OBJ);
+
+#endif /* !defined(OSSL_LIBCRYPTO_OBJECTS_OBJ_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/objects/obj_mac.num b/deps/openssl/openssl/crypto/objects/obj_mac.num
index 80413e087a0..327519580c1 100644
--- a/deps/openssl/openssl/crypto/objects/obj_mac.num
+++ b/deps/openssl/openssl/crypto/objects/obj_mac.num
@@ -1484,3 +1484,20 @@ SLH_DSA_SHAKE_192s_WITH_SHAKE256		1483
 SLH_DSA_SHAKE_192f_WITH_SHAKE256		1484
 SLH_DSA_SHAKE_256s_WITH_SHAKE256		1485
 SLH_DSA_SHAKE_256f_WITH_SHAKE256		1486
+aes_128_cbc_hmac_sha1_etm		1487
+aes_192_cbc_hmac_sha1_etm		1488
+aes_256_cbc_hmac_sha1_etm		1489
+aes_128_cbc_hmac_sha256_etm		1490
+aes_192_cbc_hmac_sha256_etm		1491
+aes_256_cbc_hmac_sha256_etm		1492
+aes_128_cbc_hmac_sha512_etm		1493
+aes_192_cbc_hmac_sha512_etm		1494
+aes_256_cbc_hmac_sha512_etm		1495
+HKDF_SHA256		1496
+HKDF_SHA384		1497
+HKDF_SHA512		1498
+id_smime_ori		1499
+id_smime_ori_kem		1500
+id_alg_hss_lms_hashsig		1501
+id_rdna_unsigned		1502
+id_alg_unsigned		1503
diff --git a/deps/openssl/openssl/crypto/objects/obj_xref.h b/deps/openssl/openssl/crypto/objects/obj_xref.h
deleted file mode 100644
index fed298906e9..00000000000
--- a/deps/openssl/openssl/crypto/objects/obj_xref.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * WARNING: do not edit!
- * Generated by objxref.pl
- *
- * Copyright 1998-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-
-typedef struct {
-    int sign_id;
-    int hash_id;
-    int pkey_id;
-} nid_triple;
-
-DEFINE_STACK_OF(nid_triple)
-
-static const nid_triple sigoid_srt[] = {
-    {NID_md2WithRSAEncryption, NID_md2, NID_rsaEncryption},
-    {NID_md5WithRSAEncryption, NID_md5, NID_rsaEncryption},
-    {NID_shaWithRSAEncryption, NID_sha, NID_rsaEncryption},
-    {NID_sha1WithRSAEncryption, NID_sha1, NID_rsaEncryption},
-    {NID_dsaWithSHA, NID_sha, NID_dsa},
-    {NID_dsaWithSHA1_2, NID_sha1, NID_dsa_2},
-    {NID_mdc2WithRSA, NID_mdc2, NID_rsaEncryption},
-    {NID_md5WithRSA, NID_md5, NID_rsa},
-    {NID_dsaWithSHA1, NID_sha1, NID_dsa},
-    {NID_sha1WithRSA, NID_sha1, NID_rsa},
-    {NID_ripemd160WithRSA, NID_ripemd160, NID_rsaEncryption},
-    {NID_md4WithRSAEncryption, NID_md4, NID_rsaEncryption},
-    {NID_ecdsa_with_SHA1, NID_sha1, NID_X9_62_id_ecPublicKey},
-    {NID_sha256WithRSAEncryption, NID_sha256, NID_rsaEncryption},
-    {NID_sha384WithRSAEncryption, NID_sha384, NID_rsaEncryption},
-    {NID_sha512WithRSAEncryption, NID_sha512, NID_rsaEncryption},
-    {NID_sha224WithRSAEncryption, NID_sha224, NID_rsaEncryption},
-    {NID_ecdsa_with_Recommended, NID_undef, NID_X9_62_id_ecPublicKey},
-    {NID_ecdsa_with_Specified, NID_undef, NID_X9_62_id_ecPublicKey},
-    {NID_ecdsa_with_SHA224, NID_sha224, NID_X9_62_id_ecPublicKey},
-    {NID_ecdsa_with_SHA256, NID_sha256, NID_X9_62_id_ecPublicKey},
-    {NID_ecdsa_with_SHA384, NID_sha384, NID_X9_62_id_ecPublicKey},
-    {NID_ecdsa_with_SHA512, NID_sha512, NID_X9_62_id_ecPublicKey},
-    {NID_dsa_with_SHA224, NID_sha224, NID_dsa},
-    {NID_dsa_with_SHA256, NID_sha256, NID_dsa},
-    {NID_id_GostR3411_94_with_GostR3410_2001, NID_id_GostR3411_94,
-     NID_id_GostR3410_2001},
-    {NID_id_GostR3411_94_with_GostR3410_94, NID_id_GostR3411_94,
-     NID_id_GostR3410_94},
-    {NID_id_GostR3411_94_with_GostR3410_94_cc, NID_id_GostR3411_94,
-     NID_id_GostR3410_94_cc},
-    {NID_id_GostR3411_94_with_GostR3410_2001_cc, NID_id_GostR3411_94,
-     NID_id_GostR3410_2001_cc},
-    {NID_rsassaPss, NID_undef, NID_rsassaPss},
-    {NID_dhSinglePass_stdDH_sha1kdf_scheme, NID_sha1, NID_dh_std_kdf},
-    {NID_dhSinglePass_stdDH_sha224kdf_scheme, NID_sha224, NID_dh_std_kdf},
-    {NID_dhSinglePass_stdDH_sha256kdf_scheme, NID_sha256, NID_dh_std_kdf},
-    {NID_dhSinglePass_stdDH_sha384kdf_scheme, NID_sha384, NID_dh_std_kdf},
-    {NID_dhSinglePass_stdDH_sha512kdf_scheme, NID_sha512, NID_dh_std_kdf},
-    {NID_dhSinglePass_cofactorDH_sha1kdf_scheme, NID_sha1,
-     NID_dh_cofactor_kdf},
-    {NID_dhSinglePass_cofactorDH_sha224kdf_scheme, NID_sha224,
-     NID_dh_cofactor_kdf},
-    {NID_dhSinglePass_cofactorDH_sha256kdf_scheme, NID_sha256,
-     NID_dh_cofactor_kdf},
-    {NID_dhSinglePass_cofactorDH_sha384kdf_scheme, NID_sha384,
-     NID_dh_cofactor_kdf},
-    {NID_dhSinglePass_cofactorDH_sha512kdf_scheme, NID_sha512,
-     NID_dh_cofactor_kdf},
-    {NID_id_tc26_signwithdigest_gost3410_2012_256, NID_id_GostR3411_2012_256,
-     NID_id_GostR3410_2012_256},
-    {NID_id_tc26_signwithdigest_gost3410_2012_512, NID_id_GostR3411_2012_512,
-     NID_id_GostR3410_2012_512},
-    {NID_ED25519, NID_undef, NID_ED25519},
-    {NID_ED448, NID_undef, NID_ED448},
-    {NID_ecdsa_with_SHA3_224, NID_sha3_224, NID_X9_62_id_ecPublicKey},
-    {NID_ecdsa_with_SHA3_256, NID_sha3_256, NID_X9_62_id_ecPublicKey},
-    {NID_ecdsa_with_SHA3_384, NID_sha3_384, NID_X9_62_id_ecPublicKey},
-    {NID_ecdsa_with_SHA3_512, NID_sha3_512, NID_X9_62_id_ecPublicKey},
-    {NID_RSA_SHA3_224, NID_sha3_224, NID_rsaEncryption},
-    {NID_RSA_SHA3_256, NID_sha3_256, NID_rsaEncryption},
-    {NID_RSA_SHA3_384, NID_sha3_384, NID_rsaEncryption},
-    {NID_RSA_SHA3_512, NID_sha3_512, NID_rsaEncryption},
-    {NID_SM2_with_SM3, NID_sm3, NID_sm2},
-    {NID_ML_DSA_44, NID_undef, NID_ML_DSA_44},
-    {NID_ML_DSA_65, NID_undef, NID_ML_DSA_65},
-    {NID_ML_DSA_87, NID_undef, NID_ML_DSA_87},
-    {NID_SLH_DSA_SHA2_128s, NID_undef, NID_SLH_DSA_SHA2_128s},
-    {NID_SLH_DSA_SHA2_128f, NID_undef, NID_SLH_DSA_SHA2_128f},
-    {NID_SLH_DSA_SHA2_192s, NID_undef, NID_SLH_DSA_SHA2_192s},
-    {NID_SLH_DSA_SHA2_192f, NID_undef, NID_SLH_DSA_SHA2_192f},
-    {NID_SLH_DSA_SHA2_256s, NID_undef, NID_SLH_DSA_SHA2_256s},
-    {NID_SLH_DSA_SHA2_256f, NID_undef, NID_SLH_DSA_SHA2_256f},
-    {NID_SLH_DSA_SHAKE_128s, NID_undef, NID_SLH_DSA_SHAKE_128s},
-    {NID_SLH_DSA_SHAKE_128f, NID_undef, NID_SLH_DSA_SHAKE_128f},
-    {NID_SLH_DSA_SHAKE_192s, NID_undef, NID_SLH_DSA_SHAKE_192s},
-    {NID_SLH_DSA_SHAKE_192f, NID_undef, NID_SLH_DSA_SHAKE_192f},
-    {NID_SLH_DSA_SHAKE_256s, NID_undef, NID_SLH_DSA_SHAKE_256s},
-    {NID_SLH_DSA_SHAKE_256f, NID_undef, NID_SLH_DSA_SHAKE_256f},
-};
-
-static const nid_triple *const sigoid_srt_xref[] = {
-    &sigoid_srt[0],
-    &sigoid_srt[1],
-    &sigoid_srt[7],
-    &sigoid_srt[2],
-    &sigoid_srt[4],
-    &sigoid_srt[3],
-    &sigoid_srt[9],
-    &sigoid_srt[5],
-    &sigoid_srt[8],
-    &sigoid_srt[12],
-    &sigoid_srt[30],
-    &sigoid_srt[35],
-    &sigoid_srt[6],
-    &sigoid_srt[10],
-    &sigoid_srt[11],
-    &sigoid_srt[13],
-    &sigoid_srt[24],
-    &sigoid_srt[20],
-    &sigoid_srt[32],
-    &sigoid_srt[37],
-    &sigoid_srt[14],
-    &sigoid_srt[21],
-    &sigoid_srt[33],
-    &sigoid_srt[38],
-    &sigoid_srt[15],
-    &sigoid_srt[22],
-    &sigoid_srt[34],
-    &sigoid_srt[39],
-    &sigoid_srt[16],
-    &sigoid_srt[23],
-    &sigoid_srt[19],
-    &sigoid_srt[31],
-    &sigoid_srt[36],
-    &sigoid_srt[25],
-    &sigoid_srt[26],
-    &sigoid_srt[27],
-    &sigoid_srt[28],
-    &sigoid_srt[40],
-    &sigoid_srt[41],
-    &sigoid_srt[48],
-    &sigoid_srt[44],
-    &sigoid_srt[49],
-    &sigoid_srt[45],
-    &sigoid_srt[50],
-    &sigoid_srt[46],
-    &sigoid_srt[51],
-    &sigoid_srt[47],
-    &sigoid_srt[52],
-};
diff --git a/deps/openssl/openssl/crypto/objects/obj_xref.txt b/deps/openssl/openssl/crypto/objects/obj_xref.txt
index 71bc12af745..e0ab9ecf434 100644
--- a/deps/openssl/openssl/crypto/objects/obj_xref.txt
+++ b/deps/openssl/openssl/crypto/objects/obj_xref.txt
@@ -11,6 +11,8 @@ sha256WithRSAEncryption sha256	rsaEncryption
 sha384WithRSAEncryption	sha384	rsaEncryption
 sha512WithRSAEncryption	sha512	rsaEncryption
 sha224WithRSAEncryption	sha224	rsaEncryption
+sha512_224WithRSAEncryption sha512_224 rsaEncryption
+sha512_256WithRSAEncryption sha512_256 rsaEncryption
 mdc2WithRSA		mdc2	rsaEncryption
 ripemd160WithRSA	ripemd160 rsaEncryption
 RSA_SHA3_224		sha3_224 rsaEncryption
@@ -64,6 +66,8 @@ ecdsa_with_SHA3_512     sha3_512    X9_62_id_ecPublicKey

 dsa_with_SHA224		sha224	dsa
 dsa_with_SHA256		sha256	dsa
+dsa_with_SHA384		sha384	dsa
+dsa_with_SHA512		sha512	dsa

 id_GostR3411_94_with_GostR3410_2001	id_GostR3411_94 id_GostR3410_2001
 id_GostR3411_94_with_GostR3410_94	id_GostR3411_94 id_GostR3410_94
diff --git a/deps/openssl/openssl/crypto/objects/objects.pl b/deps/openssl/openssl/crypto/objects/objects.pl
index 51bc248b3f0..b38dbd99821 100644
--- a/deps/openssl/openssl/crypto/objects/objects.pl
+++ b/deps/openssl/openssl/crypto/objects/objects.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -11,8 +11,8 @@ use FindBin;
 use lib "$FindBin::Bin/../../util/perl";
 use OpenSSL::copyright;

-our($opt_n);
-getopts('n');
+our($opt_n, $opt_a);
+getopts('na:');

 # The year the output file is generated.
 my $YEAR = OpenSSL::copyright::latest(($0, $ARGV[1], $ARGV[0]));
@@ -148,9 +148,10 @@ print <<"EOF";
  */

 #ifndef OPENSSL_OBJ_MAC_H
-# define OPENSSL_OBJ_MAC_H
-# pragma once
+#define OPENSSL_OBJ_MAC_H
+#pragma once

+/* clang-format off */
 #define SN_undef                        "UNDEF"
 #define LN_undef                        "undefined"
 #define NID_undef                       0
@@ -177,10 +178,24 @@ foreach (sort { $a <=> $b } keys %ordern)
 	}

 print <<EOF;
+/* clang-format on */

 #endif /* OPENSSL_OBJ_MAC_H */
 EOF

+# Append the compatibility aliases, skipping their license header the
+# same way the old build recipe did with sed -e '1,8d'.
+if ( $opt_a )
+	{
+	open (CMP,"$opt_a") || die "Can't open compat file $opt_a";
+	my $line = 0;
+	while (<CMP>)
+		{
+		print if ++$line > 8;
+		}
+	close CMP;
+	}
+
 sub process_oid
 	{
 	local($oid)=@_;
diff --git a/deps/openssl/openssl/crypto/objects/objects.txt b/deps/openssl/openssl/crypto/objects/objects.txt
index 06fe6f4bdad..b9d627e0742 100644
--- a/deps/openssl/openssl/crypto/objects/objects.txt
+++ b/deps/openssl/openssl/crypto/objects/objects.txt
@@ -251,6 +251,7 @@ SMIME 3			: id-smime-alg
 SMIME 4			: id-smime-cd
 SMIME 5			: id-smime-spq
 SMIME 6			: id-smime-cti
+SMIME 13		: id-smime-ori

 # S/MIME Modules
 id-smime-mod 1		: id-smime-mod-cms
@@ -336,6 +337,10 @@ id-smime-alg 5		: id-smime-alg-ESDH
 id-smime-alg 6		: id-smime-alg-CMS3DESwrap
 id-smime-alg 7		: id-smime-alg-CMSRC2wrap
 id-smime-alg 9		: id-alg-PWRI-KEK
+id-smime-alg 17     : id-alg-hss-lms-hashsig
+id-smime-alg 28		: id-alg-hkdf-with-sha256	: HKDF-SHA256
+id-smime-alg 29		: id-alg-hkdf-with-sha384	: HKDF-SHA384
+id-smime-alg 30		: id-alg-hkdf-with-sha512	: HKDF-SHA512

 # S/MIME Certificate Distribution
 id-smime-cd 1		: id-smime-cd-ldap
@@ -352,6 +357,9 @@ id-smime-cti 4		: id-smime-cti-ets-proofOfSender
 id-smime-cti 5		: id-smime-cti-ets-proofOfApproval
 id-smime-cti 6		: id-smime-cti-ets-proofOfCreation

+# S/MIME OtherRecipientInfo Type Identifier
+id-smime-ori 3		: id-smime-ori-kem
+
 pkcs9 20		:			: friendlyName
 pkcs9 21		:			: localKeyID
 !Alias ms-corp 1 3 6 1 4 1 311
@@ -491,6 +499,7 @@ id-pkix 11		: id-qcs
 id-pkix 14		: id-cp
 id-pkix 12		: id-cct
 id-pkix 21		: id-ppl
+id-pkix 25 1		: id-rdna-unsigned
 id-pkix 48		: id-ad

 # PKIX Modules
@@ -632,6 +641,7 @@ id-alg 1		: id-alg-des40
 id-alg 2		: id-alg-noSignature
 id-alg 3		: id-alg-dh-sig-hmac-sha1
 id-alg 4		: id-alg-dh-pop
+id-alg 36		: id-alg-unsigned

 # CMC controls
 id-cmc 1		: id-cmc-statusInfo
@@ -1721,6 +1731,15 @@ sm-scheme 104 10        : SM4-XTS             : sm4-xts
 			: AES-256-CBC-HMAC-SHA256	: aes-256-cbc-hmac-sha256
 			: ChaCha20-Poly1305		: chacha20-poly1305
 			: ChaCha20			: chacha20
+			: AES-128-CBC-HMAC-SHA1-ETM	: aes-128-cbc-hmac-sha1-etm
+			: AES-192-CBC-HMAC-SHA1-ETM	: aes-192-cbc-hmac-sha1-etm
+			: AES-256-CBC-HMAC-SHA1-ETM	: aes-256-cbc-hmac-sha1-etm
+			: AES-128-CBC-HMAC-SHA256-ETM	: aes-128-cbc-hmac-sha256-etm
+			: AES-192-CBC-HMAC-SHA256-ETM	: aes-192-cbc-hmac-sha256-etm
+			: AES-256-CBC-HMAC-SHA256-ETM	: aes-256-cbc-hmac-sha256-etm
+			: AES-128-CBC-HMAC-SHA512-ETM	: aes-128-cbc-hmac-sha512-etm
+			: AES-192-CBC-HMAC-SHA512-ETM	: aes-192-cbc-hmac-sha512-etm
+			: AES-256-CBC-HMAC-SHA512-ETM	: aes-256-cbc-hmac-sha512-etm

 ISO-US 10046 2 1	: dhpublicnumber		: X9.42 DH

diff --git a/deps/openssl/openssl/crypto/objects/objxref.pl b/deps/openssl/openssl/crypto/objects/objxref.pl
index a6748f00f45..9f4ccdfb4a0 100644
--- a/deps/openssl/openssl/crypto/objects/objxref.pl
+++ b/deps/openssl/openssl/crypto/objects/objxref.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 1998-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1998-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -84,6 +84,12 @@ print <<EOF;
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_OBJECTS_OBJ_XREF_H)
+#define OSSL_LIBCRYPTO_OBJECTS_OBJ_XREF_H
+
+/* clang-format off */
+
+#include <openssl/objects.h>

 typedef struct {
     int sign_id;
@@ -129,6 +135,8 @@ foreach (@srt2)
 	}

 print "};\n";
+print "/* clang-format on */\n";
+print "\n#endif /* !defined(OSSL_LIBCRYPTO_OBJECTS_OBJ_XREF_H) */\n";

 sub check_oid
 	{
diff --git a/deps/openssl/openssl/crypto/ocsp/ocsp_cl.c b/deps/openssl/openssl/crypto/ocsp/ocsp_cl.c
index 338d562328e..3e057caa612 100644
--- a/deps/openssl/openssl/crypto/ocsp/ocsp_cl.c
+++ b/deps/openssl/openssl/crypto/ocsp/ocsp_cl.c
@@ -16,6 +16,7 @@
 #include <openssl/pem.h>
 #include <openssl/x509v3.h>
 #include <openssl/ocsp.h>
+#include <openssl/posix_time.h>
 #include "ocsp_local.h"

 /*
@@ -46,18 +47,7 @@ OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid)
 /* Set requestorName from an X509_NAME structure */
 int OCSP_request_set1_name(OCSP_REQUEST *req, const X509_NAME *nm)
 {
-    GENERAL_NAME *gen = GENERAL_NAME_new();
-
-    if (gen == NULL)
-        return 0;
-    if (!X509_NAME_set(&gen->d.directoryName, nm)) {
-        GENERAL_NAME_free(gen);
-        return 0;
-    }
-    gen->type = GEN_DIRNAME;
-    GENERAL_NAME_free(req->tbsRequest.requestorName);
-    req->tbsRequest.requestorName = gen;
-    return 1;
+    return GENERAL_NAME_set1_X509_NAME(&req->tbsRequest.requestorName, nm);
 }

 /* Add a certificate to an OCSP request */
@@ -81,7 +71,7 @@ int OCSP_request_sign(OCSP_REQUEST *req,
     X509 *signer,
     EVP_PKEY *key,
     const EVP_MD *dgst,
-    STACK_OF(X509) *certs, unsigned long flags)
+    const STACK_OF(X509) *certs, unsigned long flags)
 {
     if (!OCSP_request_set1_name(req, X509_get_subject_name(signer)))
         goto err;
@@ -299,6 +289,20 @@ int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
     return 1;
 }

+static int gentime_to_posix(ASN1_GENERALIZEDTIME *time, int64_t *out_time)
+{
+    struct tm ctm;
+
+    if (!ASN1_GENERALIZEDTIME_check(time))
+        return 0;
+    if (!ASN1_TIME_to_tm(time, &ctm))
+        return 0;
+    if (!OPENSSL_tm_to_posix(&ctm, out_time))
+        return 0;
+
+    return 1;
+}
+
 /*
  * Check validity of thisUpdate and nextUpdate fields. It is possible that
  * the request will take a few seconds to process and/or the time won't be
@@ -310,63 +314,52 @@ int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
 int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
     ASN1_GENERALIZEDTIME *nextupd, long nsec, long maxsec)
 {
-    int ret = 1, cmp;
-    time_t t_now, t_tmp;
+    int64_t t_now, this_time, next_time;
+    int ret = 0;

-    time(&t_now);
-    /* Check thisUpdate is valid and not more than nsec in the future */
-    if (!ASN1_GENERALIZEDTIME_check(thisupd)) {
-        ERR_raise(ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD);
-        ret = 0;
-    } else {
-        t_tmp = t_now + nsec;
-        cmp = X509_cmp_time(thisupd, &t_tmp);
-        if (cmp == 0) {
-            ERR_raise(ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD);
-            ret = 0;
-        } else if (cmp > 0) {
-            ERR_raise(ERR_LIB_OCSP, OCSP_R_STATUS_NOT_YET_VALID);
-            ret = 0;
-        }
+    if (nsec < 0)
+        nsec = 0;

-        /*
-         * If maxsec specified check thisUpdate is not more than maxsec in
-         * the past. Skip this check if thisUpdate could not be compared above.
-         */
-        if (cmp != 0 && maxsec >= 0) {
-            t_tmp = t_now - maxsec;
-            if (X509_cmp_time(thisupd, &t_tmp) < 0) {
-                ERR_raise(ERR_LIB_OCSP, OCSP_R_STATUS_TOO_OLD);
-                ret = 0;
-            }
-        }
+    t_now = (int64_t)time(NULL);
+    /* Check thisUpdate is valid */
+    if (!gentime_to_posix(thisupd, &this_time)) {
+        ERR_raise(ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD);
+        goto err;
     }
-
-    if (nextupd == NULL)
-        return ret;
-
-    /* Check nextUpdate is valid and not more than nsec in the past */
-    if (!ASN1_GENERALIZEDTIME_check(nextupd)) {
-        ERR_raise(ERR_LIB_OCSP, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD);
-        ret = 0;
-    } else {
-        t_tmp = t_now - nsec;
-        cmp = X509_cmp_time(nextupd, &t_tmp);
-        if (cmp == 0) {
+    /* Check if thisUpdate is more than nsec in the future */
+    if (this_time > t_now + nsec) {
+        ERR_raise(ERR_LIB_OCSP, OCSP_R_STATUS_NOT_YET_VALID);
+        goto err;
+    }
+    /*
+     * If maxsec specified check thisUpdate is not more than maxsec in
+     * the past
+     */
+    if (maxsec >= 0 && this_time < t_now - maxsec) {
+        ERR_raise(ERR_LIB_OCSP, OCSP_R_STATUS_TOO_OLD);
+        goto err;
+    }
+    if (nextupd != NULL) {
+        /* Check nextUpdate is valid */
+        if (!gentime_to_posix(nextupd, &next_time)) {
             ERR_raise(ERR_LIB_OCSP, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD);
-            ret = 0;
-        } else if (cmp < 0) {
+            goto err;
+        }
+        /* Check nextUpdate is not more than nsec in the past */
+        if (next_time < t_now - nsec) {
             ERR_raise(ERR_LIB_OCSP, OCSP_R_STATUS_EXPIRED);
-            ret = 0;
+            goto err;
+        }
+        /* Also don't allow nextUpdate to precede thisUpdate */
+        if (next_time < this_time) {
+            ERR_raise(ERR_LIB_OCSP, OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE);
+            goto err;
         }
     }

-    /* Also don't allow nextUpdate to precede thisUpdate */
-    if (ASN1_STRING_cmp(nextupd, thisupd) < 0) {
-        ERR_raise(ERR_LIB_OCSP, OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE);
-        ret = 0;
-    }
+    ret = 1;

+err:
     return ret;
 }

diff --git a/deps/openssl/openssl/crypto/ocsp/ocsp_err.c b/deps/openssl/openssl/crypto/ocsp/ocsp_err.c
deleted file mode 100644
index aa0ee11af4f..00000000000
--- a/deps/openssl/openssl/crypto/ocsp/ocsp_err.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/ocsperr.h>
-#include "crypto/ocsperr.h"
-
-#ifndef OPENSSL_NO_OCSP
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA OCSP_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_CERTIFICATE_VERIFY_ERROR),
-        "certificate verify error" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_DIGEST_ERR), "digest err" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_DIGEST_NAME_ERR), "digest name err" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_DIGEST_SIZE_ERR), "digest size err" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD),
-        "error in nextupdate field" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_ERROR_IN_THISUPDATE_FIELD),
-        "error in thisupdate field" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_MISSING_OCSPSIGNING_USAGE),
-        "missing ocspsigning usage" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE),
-        "nextupdate before thisupdate" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_NOT_BASIC_RESPONSE),
-        "not basic response" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_NO_CERTIFICATES_IN_CHAIN),
-        "no certificates in chain" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_NO_RESPONSE_DATA), "no response data" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_NO_REVOKED_TIME), "no revoked time" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_NO_SIGNER_KEY), "no signer key" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE),
-        "private key does not match certificate" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_REQUEST_NOT_SIGNED),
-        "request not signed" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA),
-        "response contains no revocation data" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_ROOT_CA_NOT_TRUSTED),
-        "root ca not trusted" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_SIGNATURE_FAILURE), "signature failure" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND),
-        "signer certificate not found" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_STATUS_EXPIRED), "status expired" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_STATUS_NOT_YET_VALID),
-        "status not yet valid" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_STATUS_TOO_OLD), "status too old" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_UNKNOWN_MESSAGE_DIGEST),
-        "unknown message digest" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_UNKNOWN_NID), "unknown nid" },
-    { ERR_PACK(ERR_LIB_OCSP, 0, OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE),
-        "unsupported requestorname type" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_OCSP_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(OCSP_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(OCSP_str_reasons);
-#endif
-    return 1;
-}
-#else
-NON_EMPTY_TRANSLATION_UNIT
-#endif
diff --git a/deps/openssl/openssl/crypto/ocsp/ocsp_ext.c b/deps/openssl/openssl/crypto/ocsp/ocsp_ext.c
index 4149f7f66d2..2d21a94dcaf 100644
--- a/deps/openssl/openssl/crypto/ocsp/ocsp_ext.c
+++ b/deps/openssl/openssl/crypto/ocsp/ocsp_ext.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -41,14 +41,14 @@ int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos)
     return (X509v3_get_ext_by_critical(x->tbsRequest.requestExtensions, crit, lastpos));
 }

-X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc)
+const X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc)
 {
     return X509v3_get_ext(x->tbsRequest.requestExtensions, loc);
 }

 X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc)
 {
-    return X509v3_delete_ext(x->tbsRequest.requestExtensions, loc);
+    return X509v3_delete_extension(&x->tbsRequest.requestExtensions, loc);
 }

 void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, int *idx)
@@ -63,7 +63,7 @@ int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit,
         crit, flags);
 }

-int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc)
+int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, const X509_EXTENSION *ex, int loc)
 {
     return (X509v3_add_ext(&(x->tbsRequest.requestExtensions), ex, loc) != NULL);
 }
@@ -91,14 +91,14 @@ int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos)
     return (X509v3_get_ext_by_critical(x->singleRequestExtensions, crit, lastpos));
 }

-X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc)
+const X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc)
 {
     return X509v3_get_ext(x->singleRequestExtensions, loc);
 }

 X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc)
 {
-    return X509v3_delete_ext(x->singleRequestExtensions, loc);
+    return X509v3_delete_extension(&x->singleRequestExtensions, loc);
 }

 void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx)
@@ -113,7 +113,7 @@ int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
         flags);
 }

-int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc)
+int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, const X509_EXTENSION *ex, int loc)
 {
     return (X509v3_add_ext(&(x->singleRequestExtensions), ex, loc) != NULL);
 }
@@ -142,14 +142,14 @@ int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit,
     return (X509v3_get_ext_by_critical(x->tbsResponseData.responseExtensions, crit, lastpos));
 }

-X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc)
+const X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc)
 {
     return X509v3_get_ext(x->tbsResponseData.responseExtensions, loc);
 }

 X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc)
 {
-    return X509v3_delete_ext(x->tbsResponseData.responseExtensions, loc);
+    return X509v3_delete_extension(&x->tbsResponseData.responseExtensions, loc);
 }

 void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit,
@@ -166,7 +166,7 @@ int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value,
         value, crit, flags);
 }

-int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc)
+int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, const X509_EXTENSION *ex, int loc)
 {
     return (X509v3_add_ext(&(x->tbsResponseData.responseExtensions), ex, loc)
         != NULL);
@@ -196,14 +196,14 @@ int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit,
     return X509v3_get_ext_by_critical(x->singleExtensions, crit, lastpos);
 }

-X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc)
+const X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc)
 {
     return X509v3_get_ext(x->singleExtensions, loc);
 }

 X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc)
 {
-    return X509v3_delete_ext(x->singleExtensions, loc);
+    return X509v3_delete_extension(&x->singleExtensions, loc);
 }

 void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit,
@@ -218,7 +218,7 @@ int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value,
     return X509V3_add1_i2d(&x->singleExtensions, nid, value, crit, flags);
 }

-int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc)
+int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, const X509_EXTENSION *ex, int loc)
 {
     return (X509v3_add_ext(&(x->singleExtensions), ex, loc) != NULL);
 }
@@ -310,7 +310,7 @@ int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs)
      */

     int req_idx, resp_idx;
-    X509_EXTENSION *req_ext, *resp_ext;
+    const X509_EXTENSION *req_ext, *resp_ext;
     req_idx = OCSP_REQUEST_get_ext_by_NID(req, NID_id_pkix_OCSP_Nonce, -1);
     resp_idx = OCSP_BASICRESP_get_ext_by_NID(bs, NID_id_pkix_OCSP_Nonce, -1);
     /* Check both absent */
@@ -339,7 +339,7 @@ int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs)

 int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req)
 {
-    X509_EXTENSION *req_ext;
+    const X509_EXTENSION *req_ext;
     int req_idx;
     /* Check for nonce in request */
     req_idx = OCSP_REQUEST_get_ext_by_NID(req, NID_id_pkix_OCSP_Nonce, -1);
@@ -360,7 +360,7 @@ X509_EXTENSION *OCSP_crlID_new(const char *url, long *n, char *tim)
     if (url) {
         if ((cid->crlUrl = ASN1_IA5STRING_new()) == NULL)
             goto err;
-        if (!(ASN1_STRING_set(cid->crlUrl, url, -1)))
+        if (!(ossl_asn1_string_set1_string(cid->crlUrl, url)))
             goto err;
     }
     if (n) {
@@ -446,7 +446,7 @@ X509_EXTENSION *OCSP_url_svcloc_new(const X509_NAME *issuer, const char **urls)
             goto err;
         if ((ia5 = ASN1_IA5STRING_new()) == NULL)
             goto err;
-        if (!ASN1_STRING_set((ASN1_STRING *)ia5, *urls, -1))
+        if (!ossl_asn1_string_set1_string((ASN1_STRING *)ia5, *urls))
             goto err;
         /* ad->location is allocated inside ACCESS_DESCRIPTION_new */
         ad->location->type = GEN_URI;
diff --git a/deps/openssl/openssl/crypto/ocsp/ocsp_lib.c b/deps/openssl/openssl/crypto/ocsp/ocsp_lib.c
index b8f3bdccc07..49a620a076a 100644
--- a/deps/openssl/openssl/crypto/ocsp/ocsp_lib.c
+++ b/deps/openssl/openssl/crypto/ocsp/ocsp_lib.c
@@ -24,7 +24,7 @@ OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, const X509 *subject,
 {
     const X509_NAME *iname;
     const ASN1_INTEGER *serial;
-    ASN1_BIT_STRING *ikey;
+    const ASN1_BIT_STRING *ikey;

     if (!dgst)
         dgst = EVP_sha1();
diff --git a/deps/openssl/openssl/crypto/ocsp/ocsp_local.h b/deps/openssl/openssl/crypto/ocsp/ocsp_local.h
index 03c5aaef866..dc1bb39e662 100644
--- a/deps/openssl/openssl/crypto/ocsp/ocsp_local.h
+++ b/deps/openssl/openssl/crypto/ocsp/ocsp_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_OCSP_OCSP_LOCAL_H)
+#define OSSL_LIBCRYPTO_OCSP_OCSP_LOCAL_H
+
+#include <openssl/ocsp.h>
+#include <openssl/x509v3.h>
+
 #include "crypto/x509.h" /* for ossl_x509_add_cert_new() */

 /*-  CertID ::= SEQUENCE {
@@ -244,3 +250,5 @@ struct ocsp_service_locator_st {
     ASN1_item_verify_ex(ASN1_ITEM_rptr(OCSP_RESPDATA), \
         &(a)->signatureAlgorithm, (a)->signature,      \
         &(a)->tbsResponseData, NULL, r, libctx, propq)
+
+#endif /* !defined(OSSL_LIBCRYPTO_OCSP_OCSP_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/ocsp/ocsp_prn.c b/deps/openssl/openssl/crypto/ocsp/ocsp_prn.c
index 5a9e49480c9..2e3d43f0e63 100644
--- a/deps/openssl/openssl/crypto/ocsp/ocsp_prn.c
+++ b/deps/openssl/openssl/crypto/ocsp/ocsp_prn.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -98,7 +98,7 @@ int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST *o, unsigned long flags)
     if (BIO_write(bp, "OCSP Request Data:\n", 19) <= 0)
         goto err;
     l = ASN1_INTEGER_get(inf->version);
-    if (BIO_printf(bp, "    Version: %lu (0x%lx)", l + 1, l) <= 0)
+    if (BIO_printf(bp, "    Version: %ld (0x%lx)", l + 1, l) <= 0)
         goto err;
     if (inf->requestorName != NULL) {
         if (BIO_write(bp, "\n    Requestor Name: ", 21) <= 0)
@@ -166,7 +166,7 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags)
         goto err;
     rd = &br->tbsResponseData;
     l = ASN1_INTEGER_get(rd->version);
-    if (BIO_printf(bp, "\n    Version: %lu (0x%lx)\n", l + 1, l) <= 0)
+    if (BIO_printf(bp, "\n    Version: %ld (0x%lx)\n", l + 1, l) <= 0)
         goto err;
     if (BIO_puts(bp, "    Responder Id: ") <= 0)
         goto err;
diff --git a/deps/openssl/openssl/crypto/ocsp/ocsp_srv.c b/deps/openssl/openssl/crypto/ocsp/ocsp_srv.c
index 56276ad6017..9e77dcff748 100644
--- a/deps/openssl/openssl/crypto/ocsp/ocsp_srv.c
+++ b/deps/openssl/openssl/crypto/ocsp/ocsp_srv.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -164,17 +164,18 @@ int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert)
  */
 int OCSP_basic_sign_ctx(OCSP_BASICRESP *brsp,
     X509 *signer, EVP_MD_CTX *ctx,
-    STACK_OF(X509) *certs, unsigned long flags)
+    const STACK_OF(X509) *certs, unsigned long flags)
 {
     OCSP_RESPID *rid;
+    EVP_PKEY_CTX *pkctx;
     EVP_PKEY *pkey;

-    if (ctx == NULL || EVP_MD_CTX_get_pkey_ctx(ctx) == NULL) {
+    if (ctx == NULL || (pkctx = EVP_MD_CTX_get_pkey_ctx(ctx)) == NULL) {
         ERR_raise(ERR_LIB_OCSP, OCSP_R_NO_SIGNER_KEY);
         goto err;
     }

-    pkey = EVP_PKEY_CTX_get0_pkey(EVP_MD_CTX_get_pkey_ctx(ctx));
+    pkey = EVP_PKEY_CTX_get0_pkey(pkctx);
     if (pkey == NULL || !X509_check_private_key(signer, pkey)) {
         ERR_raise(ERR_LIB_OCSP, OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE);
         goto err;
@@ -211,7 +212,7 @@ err:

 int OCSP_basic_sign(OCSP_BASICRESP *brsp,
     X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
-    STACK_OF(X509) *certs, unsigned long flags)
+    const STACK_OF(X509) *certs, unsigned long flags)
 {
     EVP_MD_CTX *ctx = EVP_MD_CTX_new();
     EVP_PKEY_CTX *pkctx = NULL;
@@ -300,7 +301,7 @@ int OCSP_RESPID_match_ex(OCSP_RESPID *respid, X509 *cert, OSSL_LIB_CTX *libctx,
         if (!X509_pubkey_digest(cert, sha1, md, NULL))
             goto err;

-        ret = (ASN1_STRING_length(respid->value.byKey) == SHA_DIGEST_LENGTH)
+        ret = (ASN1_STRING_get_length(respid->value.byKey) == SHA_DIGEST_LENGTH)
             && (memcmp(ASN1_STRING_get0_data(respid->value.byKey), md,
                     SHA_DIGEST_LENGTH)
                 == 0);
diff --git a/deps/openssl/openssl/crypto/ocsp/ocsp_vfy.c b/deps/openssl/openssl/crypto/ocsp/ocsp_vfy.c
index 3b6b1fe052b..70e670cd63c 100644
--- a/deps/openssl/openssl/crypto/ocsp/ocsp_vfy.c
+++ b/deps/openssl/openssl/crypto/ocsp/ocsp_vfy.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,8 +14,8 @@
 #include "ocsp_local.h"

 static int ocsp_find_signer(X509 **psigner, OCSP_BASICRESP *bs,
-    STACK_OF(X509) *certs, unsigned long flags);
-static X509 *ocsp_find_signer_sk(STACK_OF(X509) *certs, OCSP_RESPID *id);
+    const STACK_OF(X509) *certs, unsigned long flags);
+static X509 *ocsp_find_signer_sk(const STACK_OF(X509) *certs, OCSP_RESPID *id);
 static int ocsp_check_issuer(OCSP_BASICRESP *bs, STACK_OF(X509) *chain);
 static int ocsp_check_ids(STACK_OF(OCSP_SINGLERESP) *sresp,
     OCSP_CERTID **ret);
@@ -23,7 +23,7 @@ static int ocsp_match_issuerid(X509 *cert, OCSP_CERTID *cid,
     STACK_OF(OCSP_SINGLERESP) *sresp);
 static int ocsp_check_delegated(X509 *x);
 static int ocsp_req_find_signer(X509 **psigner, OCSP_REQUEST *req,
-    const X509_NAME *nm, STACK_OF(X509) *certs,
+    const X509_NAME *nm, const STACK_OF(X509) *certs,
     unsigned long flags);

 /* Returns 1 on success, 0 on failure, or -1 on fatal error */
@@ -95,7 +95,7 @@ static int ocsp_verify(OCSP_REQUEST *req, OCSP_BASICRESP *bs,
 }

 /* Verify a basic response message */
-int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
+int OCSP_basic_verify(OCSP_BASICRESP *bs, const STACK_OF(X509) *certs,
     X509_STORE *st, unsigned long flags)
 {
     X509 *signer, *x;
@@ -160,13 +160,13 @@ end:
 }

 int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer,
-    STACK_OF(X509) *extra_certs)
+    const STACK_OF(X509) *extra_certs)
 {
     return ocsp_find_signer(signer, bs, extra_certs, 0) > 0;
 }

 static int ocsp_find_signer(X509 **psigner, OCSP_BASICRESP *bs,
-    STACK_OF(X509) *certs, unsigned long flags)
+    const STACK_OF(X509) *certs, unsigned long flags)
 {
     X509 *signer;
     OCSP_RESPID *rid = &bs->tbsResponseData.responderId;
@@ -185,7 +185,7 @@ static int ocsp_find_signer(X509 **psigner, OCSP_BASICRESP *bs,
     return 0;
 }

-static X509 *ocsp_find_signer_sk(STACK_OF(X509) *certs, OCSP_RESPID *id)
+static X509 *ocsp_find_signer_sk(const STACK_OF(X509) *certs, OCSP_RESPID *id)
 {
     int i, r;
     unsigned char tmphash[SHA_DIGEST_LENGTH], *keyhash;
@@ -314,17 +314,11 @@ static int ocsp_match_issuerid(X509 *cert, OCSP_CERTID *cid,

         OBJ_obj2txt(name, sizeof(name), cid->hashAlgorithm.algorithm, 0);

-        (void)ERR_set_mark();
         dgst = EVP_MD_fetch(NULL, name, NULL);
-        if (dgst == NULL)
-            dgst = (EVP_MD *)EVP_get_digestbyname(name);
-
         if (dgst == NULL) {
-            (void)ERR_clear_last_mark();
             ERR_raise(ERR_LIB_OCSP, OCSP_R_UNKNOWN_MESSAGE_DIGEST);
             goto end;
         }
-        (void)ERR_pop_to_mark();

         mdlen = EVP_MD_get_size(dgst);
         if (mdlen <= 0) {
@@ -380,7 +374,7 @@ static int ocsp_check_delegated(X509 *x)
  * Just find the signer's certificate and verify it against a given trust value.
  * Returns 1 on success, 0 on failure and on fatal error.
  */
-int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
+int OCSP_request_verify(OCSP_REQUEST *req, const STACK_OF(X509) *certs,
     X509_STORE *store, unsigned long flags)
 {
     X509 *signer;
@@ -417,7 +411,7 @@ int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
 }

 static int ocsp_req_find_signer(X509 **psigner, OCSP_REQUEST *req,
-    const X509_NAME *nm, STACK_OF(X509) *certs,
+    const X509_NAME *nm, const STACK_OF(X509) *certs,
     unsigned long flags)
 {
     X509 *signer;
diff --git a/deps/openssl/openssl/crypto/ocsp/v3_ocsp.c b/deps/openssl/openssl/crypto/ocsp/v3_ocsp.c
index d31c74ef453..95b81577646 100644
--- a/deps/openssl/openssl/crypto/ocsp/v3_ocsp.c
+++ b/deps/openssl/openssl/crypto/ocsp/v3_ocsp.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -143,7 +143,7 @@ static void *ocsp_nonce_new(void)
 static int i2d_ocsp_nonce(const void *a, unsigned char **pp)
 {
     const ASN1_OCTET_STRING *os = a;
-    if (pp) {
+    if (pp != NULL && os->length > 0) {
         memcpy(*pp, os->data, os->length);
         *pp += os->length;
     }
@@ -164,7 +164,8 @@ static void *d2i_ocsp_nonce(void *a, const unsigned char **pp, long length)
     if (!ASN1_OCTET_STRING_set(os, *pp, length))
         goto err;

-    *pp += length;
+    if (length > 0)
+        *pp += length;

     if (pos)
         *pos = os;
diff --git a/deps/openssl/openssl/crypto/packet.c b/deps/openssl/openssl/crypto/packet.c
index 48e2262ba4d..56cde3866e8 100644
--- a/deps/openssl/openssl/crypto/packet.c
+++ b/deps/openssl/openssl/crypto/packet.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -236,7 +236,7 @@ static int put_quic_value(unsigned char *data, size_t value, size_t len)
     if (ossl_quic_vlint_encode_len(value) > len)
         return 0;

-    ossl_quic_vlint_encode_n(data, value, len);
+    ossl_quic_vlint_encode_n(data, value, (int)len);
     return 1;
 }
 #endif
@@ -365,6 +365,12 @@ int WPACKET_finish(WPACKET *pkt)
 }

 int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
+{
+    return WPACKET_start_sub_packet_at_offset_len__(pkt, lenbytes, 0);
+}
+
+int WPACKET_start_sub_packet_at_offset_len__(WPACKET *pkt, size_t lenbytes,
+    size_t offset)
 {
     WPACKET_SUB *sub;
     unsigned char *lenchars;
@@ -382,7 +388,7 @@ int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)

     sub->parent = pkt->subs;
     pkt->subs = sub;
-    sub->pwritten = pkt->written + lenbytes;
+    sub->pwritten = pkt->written + lenbytes + offset;
     sub->lenbytes = lenbytes;

     if (lenbytes == 0) {
@@ -392,7 +398,8 @@ int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)

     sub->packet_len = pkt->written;

-    if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars))
+    if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)
+        || (offset > 0 && !WPACKET_allocate_bytes(pkt, offset, &lenchars)))
         return 0;

     return 1;
diff --git a/deps/openssl/openssl/crypto/param_build.c b/deps/openssl/openssl/crypto/param_build.c
index d37b18c4dd8..30254a5087e 100644
--- a/deps/openssl/openssl/crypto/param_build.c
+++ b/deps/openssl/openssl/crypto/param_build.c
@@ -421,9 +421,9 @@ static OSSL_PARAM *param_bld_convert(OSSL_PARAM_BLD *bld, OSSL_PARAM *param,
         if (pd->bn != NULL) {
             /* BIGNUM */
             if (pd->type == OSSL_PARAM_UNSIGNED_INTEGER)
-                BN_bn2nativepad(pd->bn, (unsigned char *)p, pd->size);
+                BN_bn2nativepad(pd->bn, (unsigned char *)p, (int)pd->size);
             else
-                BN_signed_bn2native(pd->bn, (unsigned char *)p, pd->size);
+                BN_signed_bn2native(pd->bn, (unsigned char *)p, (int)pd->size);
         } else if (pd->type == OSSL_PARAM_OCTET_PTR
             || pd->type == OSSL_PARAM_UTF8_PTR) {
             /* PTR */
@@ -480,6 +480,7 @@ OSSL_PARAM *OSSL_PARAM_BLD_to_param(OSSL_PARAM_BLD *bld)
     blk = p_blks + (OSSL_PARAM_ALIGNED_BLOCK *)(params);
     last = param_bld_convert(bld, params, blk, s);
     ossl_param_set_secure_block(last, s, ss);
+    last->return_size = total;

     /* Reset builder for reuse */
     bld->total_blocks = 0;
diff --git a/deps/openssl/openssl/crypto/param_build_set.c b/deps/openssl/openssl/crypto/param_build_set.c
index 063e35d33b9..dc9bcc9c8ae 100644
--- a/deps/openssl/openssl/crypto/param_build_set.c
+++ b/deps/openssl/openssl/crypto/param_build_set.c
@@ -99,31 +99,3 @@ int ossl_param_build_set_bn(OSSL_PARAM_BLD *bld, OSSL_PARAM *p,
         return OSSL_PARAM_set_BN(p, bn) > 0;
     return 1;
 }
-
-int ossl_param_build_set_multi_key_bn(OSSL_PARAM_BLD *bld, OSSL_PARAM *params,
-    const char *names[],
-    STACK_OF(BIGNUM_const) *stk)
-{
-    int i, sz = sk_BIGNUM_const_num(stk);
-    OSSL_PARAM *p;
-    const BIGNUM *bn;
-
-    if (bld != NULL) {
-        for (i = 0; i < sz && names[i] != NULL; ++i) {
-            bn = sk_BIGNUM_const_value(stk, i);
-            if (bn != NULL && !OSSL_PARAM_BLD_push_BN(bld, names[i], bn))
-                return 0;
-        }
-        return 1;
-    }
-
-    for (i = 0; i < sz && names[i] != NULL; ++i) {
-        bn = sk_BIGNUM_const_value(stk, i);
-        p = OSSL_PARAM_locate(params, names[i]);
-        if (p != NULL && bn != NULL) {
-            if (!OSSL_PARAM_set_BN(p, bn))
-                return 0;
-        }
-    }
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/params.c b/deps/openssl/openssl/crypto/params.c
index 4c037a3f3f9..b6d278243de 100644
--- a/deps/openssl/openssl/crypto/params.c
+++ b/deps/openssl/openssl/crypto/params.c
@@ -16,6 +16,7 @@
 #include "internal/endian.h"
 #include "internal/params.h"
 #include "internal/packet.h"
+#include "internal/common.h"

 /* Shortcuts for raising errors that are widely used */
 #define err_unsigned_negative \
@@ -52,7 +53,7 @@ static unsigned int real_shift(void)

 OSSL_PARAM *OSSL_PARAM_locate(OSSL_PARAM *p, const char *key)
 {
-    if (p != NULL && key != NULL)
+    if (ossl_likely(p != NULL && key != NULL))
         for (; p->key != NULL; p++)
             if (strcmp(key, p->key) == 0)
                 return p;
@@ -868,7 +869,7 @@ int OSSL_PARAM_get_uint64(const OSSL_PARAM *p, uint64_t *val)
         return 0;
     }

-    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
+    if (ossl_likely(p->data_type == OSSL_PARAM_UNSIGNED_INTEGER)) {
 #ifndef OPENSSL_SMALL_FOOTPRINT
         switch (p->data_size) {
         case sizeof(uint32_t):
@@ -1143,13 +1144,13 @@ int OSSL_PARAM_set_BN(OSSL_PARAM *p, const BIGNUM *val)

         switch (p->data_type) {
         case OSSL_PARAM_UNSIGNED_INTEGER:
-            if (BN_bn2nativepad(val, p->data, p->data_size) < 0) {
+            if (BN_bn2nativepad(val, p->data, (int)p->data_size) < 0) {
                 ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_INTEGER_OVERFLOW);
                 return 0;
             }
             break;
         case OSSL_PARAM_INTEGER:
-            if (BN_signed_bn2native(val, p->data, p->data_size) < 0) {
+            if (BN_signed_bn2native(val, p->data, (int)p->data_size) < 0) {
                 ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_INTEGER_OVERFLOW);
                 return 0;
             }
@@ -1471,6 +1472,15 @@ OSSL_PARAM OSSL_PARAM_construct_octet_string(const char *key, void *buf,
     return ossl_param_construct(key, OSSL_PARAM_OCTET_STRING, buf, bsize);
 }

+static int get_ptr_internal_skip_checks(const OSSL_PARAM *p, const void **val,
+    size_t *used_len)
+{
+    if (used_len != NULL)
+        *used_len = p->data_size;
+    *val = *(const void **)p->data;
+    return 1;
+}
+
 static int get_ptr_internal(const OSSL_PARAM *p, const void **val,
     size_t *used_len, unsigned int type)
 {
@@ -1482,10 +1492,7 @@ static int get_ptr_internal(const OSSL_PARAM *p, const void **val,
         err_bad_type;
         return 0;
     }
-    if (used_len != NULL)
-        *used_len = p->data_size;
-    *val = *(const void **)p->data;
-    return 1;
+    return get_ptr_internal_skip_checks(p, val, used_len);
 }

 int OSSL_PARAM_get_utf8_ptr(const OSSL_PARAM *p, const char **val)
@@ -1555,10 +1562,10 @@ OSSL_PARAM OSSL_PARAM_construct_octet_ptr(const char *key, void **buf,
  * *out and *out_len are guaranteed to be untouched if this function
  * doesn't return success.
  */
-int ossl_param_get1_octet_string(const OSSL_PARAM *params, const char *name,
-    unsigned char **out, size_t *out_len)
+int ossl_param_get1_octet_string_from_param(const OSSL_PARAM *p,
+    unsigned char **out,
+    size_t *out_len)
 {
-    const OSSL_PARAM *p = OSSL_PARAM_locate_const(params, name);
     void *buf = NULL;
     size_t len = 0;

@@ -1576,11 +1583,20 @@ int ossl_param_get1_octet_string(const OSSL_PARAM *params, const char *name,
     return 1;
 }

-static int setbuf_fromparams(const OSSL_PARAM *p, const char *name,
+int ossl_param_get1_octet_string(const OSSL_PARAM *params, const char *name,
+    unsigned char **out, size_t *out_len)
+{
+    const OSSL_PARAM *p = OSSL_PARAM_locate_const(params, name);
+
+    return ossl_param_get1_octet_string_from_param(p, out, out_len);
+}
+
+static int setbuf_fromparams(size_t n, OSSL_PARAM *p[],
     unsigned char *out, size_t *outlen)
 {
     int ret = 0;
     WPACKET pkt;
+    size_t i;

     if (out == NULL) {
         if (!WPACKET_init_null(&pkt, 0))
@@ -1590,12 +1606,12 @@ static int setbuf_fromparams(const OSSL_PARAM *p, const char *name,
             return 0;
     }

-    for (; p != NULL; p = OSSL_PARAM_locate_const(p + 1, name)) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING)
+    for (i = 0; i < n; i++) {
+        if (p[i]->data_type != OSSL_PARAM_OCTET_STRING)
             goto err;
-        if (p->data != NULL
-            && p->data_size != 0
-            && !WPACKET_memcpy(&pkt, p->data, p->data_size))
+        if (p[i]->data != NULL
+            && p[i]->data_size != 0
+            && !WPACKET_memcpy(&pkt, p[i]->data, p[i]->data_size))
             goto err;
     }
     if (!WPACKET_get_total_written(&pkt, outlen)
@@ -1607,23 +1623,17 @@ err:
     return ret;
 }

-int ossl_param_get1_concat_octet_string(const OSSL_PARAM *params, const char *name,
-    unsigned char **out,
-    size_t *out_len, size_t maxsize)
+int ossl_param_get1_concat_octet_string(size_t n, OSSL_PARAM *params[],
+    unsigned char **out, size_t *out_len)
 {
-    const OSSL_PARAM *p = OSSL_PARAM_locate_const(params, name);
     unsigned char *res;
     size_t sz = 0;

-    if (p == NULL)
-        return -1;
+    if (n == 0)
+        return 1;

     /* Calculate the total size */
-    if (!setbuf_fromparams(p, name, NULL, &sz))
-        return 0;
-
-    /* Check that it's not oversized */
-    if (maxsize > 0 && sz > maxsize)
+    if (!setbuf_fromparams(n, params, NULL, &sz))
         return 0;

     /* Special case zero length */
@@ -1639,7 +1649,7 @@ int ossl_param_get1_concat_octet_string(const OSSL_PARAM *params, const char *na
         return 0;

     /* Concat one or more OSSL_KDF_PARAM_INFO fields */
-    if (!setbuf_fromparams(p, name, res, &sz)) {
+    if (!setbuf_fromparams(n, params, res, &sz)) {
         OPENSSL_clear_free(res, sz);
         return 0;
     }
@@ -1659,12 +1669,17 @@ OSSL_PARAM OSSL_PARAM_construct_end(void)
 }

 static int get_string_ptr_internal(const OSSL_PARAM *p, const void **val,
-    size_t *used_len, unsigned int type)
+    size_t *used_len, unsigned int ref_type,
+    unsigned int type)
 {
     if (val == NULL || p == NULL) {
         err_null_argument;
         return 0;
     }
+
+    if (p->data_type == ref_type)
+        return get_ptr_internal_skip_checks(p, (const void **)val, used_len);
+
     if (p->data_type != type) {
         err_bad_type;
         return 0;
@@ -1677,23 +1692,32 @@ static int get_string_ptr_internal(const OSSL_PARAM *p, const void **val,

 int OSSL_PARAM_get_utf8_string_ptr(const OSSL_PARAM *p, const char **val)
 {
-    int rv;
-
-    ERR_set_mark();
-    rv = OSSL_PARAM_get_utf8_ptr(p, val);
-    ERR_pop_to_mark();
-
-    return rv || get_string_ptr_internal(p, (const void **)val, NULL, OSSL_PARAM_UTF8_STRING);
+    return get_string_ptr_internal(p, (const void **)val, NULL,
+        OSSL_PARAM_UTF8_PTR,
+        OSSL_PARAM_UTF8_STRING);
 }

 int OSSL_PARAM_get_octet_string_ptr(const OSSL_PARAM *p, const void **val,
     size_t *used_len)
 {
-    int rv;
+    return get_string_ptr_internal(p, (const void **)val, used_len,
+        OSSL_PARAM_OCTET_PTR,
+        OSSL_PARAM_OCTET_STRING);
+}
+
+int OSSL_PARAM_set_octet_string_or_ptr(OSSL_PARAM *p, const void *val,
+    size_t len)
+{
+    if (p == NULL) {
+        err_null_argument;
+        return 0;
+    }

-    ERR_set_mark();
-    rv = OSSL_PARAM_get_octet_ptr(p, val, used_len);
-    ERR_pop_to_mark();
+    if (p->data_type == OSSL_PARAM_OCTET_STRING)
+        return OSSL_PARAM_set_octet_string(p, val, len);
+    else if (p->data_type == OSSL_PARAM_OCTET_PTR)
+        return OSSL_PARAM_set_octet_ptr(p, val, len);

-    return rv || get_string_ptr_internal(p, val, used_len, OSSL_PARAM_OCTET_STRING);
+    err_bad_type;
+    return 0;
 }
diff --git a/deps/openssl/openssl/crypto/params_dup.c b/deps/openssl/openssl/crypto/params_dup.c
index d231c5b92ef..fcb99939c89 100644
--- a/deps/openssl/openssl/crypto/params_dup.c
+++ b/deps/openssl/openssl/crypto/params_dup.c
@@ -10,6 +10,7 @@
 #include <string.h>
 #include <openssl/params.h>
 #include <openssl/param_build.h>
+#include "internal/mem_alloc_utils.h"
 #include "internal/param_build_set.h"

 #define OSSL_PARAM_ALLOCATED_END 127
@@ -34,7 +35,13 @@ size_t ossl_param_bytes_to_blocks(size_t bytes)
 static int ossl_param_buf_alloc(OSSL_PARAM_BUF *out, size_t extra_blocks,
     int is_secure)
 {
-    size_t sz = OSSL_PARAM_ALIGN_SIZE * (extra_blocks + out->blocks);
+    size_t num_blocks, sz = 0;
+
+    if (ossl_unlikely(!ossl_size_add(extra_blocks, out->blocks, &num_blocks,
+                          OPENSSL_FILE, OPENSSL_LINE)
+            || !ossl_size_mul(num_blocks, OSSL_PARAM_ALIGN_SIZE, &sz,
+                OPENSSL_FILE, OPENSSL_LINE)))
+        return 0;

     out->alloc = is_secure ? OPENSSL_secure_zalloc(sz) : OPENSSL_zalloc(sz);
     if (out->alloc == NULL)
@@ -132,6 +139,7 @@ OSSL_PARAM *OSSL_PARAM_dup(const OSSL_PARAM *src)
     /* Store the allocated secure memory buffer in the last param block */
     ossl_param_set_secure_block(last, buf[OSSL_PARAM_BUF_SECURE].alloc,
         buf[OSSL_PARAM_BUF_SECURE].alloc_sz);
+    last->return_size = buf[OSSL_PARAM_BUF_PUBLIC].alloc_sz;
     return dst;
 }

@@ -181,7 +189,7 @@ OSSL_PARAM *OSSL_PARAM_merge(const OSSL_PARAM *p1, const OSSL_PARAM *p2)
     qsort(list2, list2_sz, sizeof(OSSL_PARAM *), compare_params);

     /* Allocate enough space to store the merged parameters */
-    params = OPENSSL_zalloc((list1_sz + list2_sz + 1) * sizeof(*p1));
+    params = OPENSSL_calloc(list1_sz + list2_sz + 1, sizeof(*p1));
     if (params == NULL)
         return NULL;
     dst = params;
@@ -234,3 +242,18 @@ void OSSL_PARAM_free(OSSL_PARAM *params)
         OPENSSL_free(params);
     }
 }
+
+void OSSL_PARAM_clear_free(OSSL_PARAM *params)
+{
+    if (params != NULL) {
+        OSSL_PARAM *p;
+
+        for (p = params; p->key != NULL; p++)
+            ;
+        if (p->data_type == OSSL_PARAM_ALLOCATED_END)
+            OPENSSL_secure_clear_free(p->data, p->data_size);
+        if (p->return_size > 0 && p->return_size != OSSL_PARAM_UNMODIFIED)
+            OPENSSL_cleanse(params, p->return_size);
+        OPENSSL_free(params);
+    }
+}
diff --git a/deps/openssl/openssl/crypto/params_from_text.c b/deps/openssl/openssl/crypto/params_from_text.c
index 700d9140e18..7401a5f4e46 100644
--- a/deps/openssl/openssl/crypto/params_from_text.c
+++ b/deps/openssl/openssl/crypto/params_from_text.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2019, Oracle and/or its affiliates.  All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -151,7 +151,7 @@ static int construct_from_text(OSSL_PARAM *to, const OSSL_PARAM *paramdef,
                 }
             */

-            BN_bn2nativepad(tmpbn, buf, buf_n);
+            BN_bn2nativepad(tmpbn, buf, (int)buf_n);

             /*
              * 2's complement negation, part two.
@@ -198,6 +198,7 @@ static int construct_from_text(OSSL_PARAM *to, const OSSL_PARAM *paramdef,
     return 1;
 }

+#ifndef FIPS_MODULE
 /**
  * OSSL_PARAM_print_to_bio - Print OSSL_PARAM array to a bio
  *
@@ -271,14 +272,14 @@ int OSSL_PARAM_print_to_bio(const OSSL_PARAM *p, BIO *bio, int print_values)
             }
             break;
         case OSSL_PARAM_UTF8_PTR:
-            ok = BIO_dump(bio, p->data, p->data_size);
+            ok = BIO_dump(bio, p->data, (int)p->data_size);
             break;
         case OSSL_PARAM_UTF8_STRING:
-            ok = BIO_dump(bio, (char *)p->data, p->data_size);
+            ok = BIO_dump(bio, (char *)p->data, (int)p->data_size);
             break;
         case OSSL_PARAM_OCTET_PTR:
         case OSSL_PARAM_OCTET_STRING:
-            ok = BIO_dump(bio, (char *)p->data, p->data_size);
+            ok = BIO_dump(bio, (char *)p->data, (int)p->data_size);
             break;
 #ifndef OPENSSL_SYS_UEFI
         case OSSL_PARAM_REAL:
@@ -302,6 +303,7 @@ int OSSL_PARAM_print_to_bio(const OSSL_PARAM *p, BIO *bio, int print_values)
 end:
     return ok == -1 ? 0 : 1;
 }
+#endif /* FIPS_MODULE */

 int OSSL_PARAM_allocate_from_text(OSSL_PARAM *to,
     const OSSL_PARAM *paramdefs,
diff --git a/deps/openssl/openssl/crypto/pariscid.pl b/deps/openssl/openssl/crypto/pariscid.pl
index bad33754574..014d6e3397a 100644
--- a/deps/openssl/openssl/crypto/pariscid.pl
+++ b/deps/openssl/openssl/crypto/pariscid.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2009-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -55,46 +55,6 @@ OPENSSL_rdtsc
 	.EXIT
 	nop
 	.PROCEND
-
-	.EXPORT	OPENSSL_wipe_cpu,ENTRY
-	.ALIGN	8
-OPENSSL_wipe_cpu
-	.PROC
-	.CALLINFO	NO_CALLS
-	.ENTRY
-	xor		%r0,%r0,%r1
-	fcpy,dbl	%fr0,%fr4
-	xor		%r0,%r0,%r19
-	fcpy,dbl	%fr0,%fr5
-	xor		%r0,%r0,%r20
-	fcpy,dbl	%fr0,%fr6
-	xor		%r0,%r0,%r21
-	fcpy,dbl	%fr0,%fr7
-	xor		%r0,%r0,%r22
-	fcpy,dbl	%fr0,%fr8
-	xor		%r0,%r0,%r23
-	fcpy,dbl	%fr0,%fr9
-	xor		%r0,%r0,%r24
-	fcpy,dbl	%fr0,%fr10
-	xor		%r0,%r0,%r25
-	fcpy,dbl	%fr0,%fr11
-	xor		%r0,%r0,%r26
-	fcpy,dbl	%fr0,%fr22
-	xor		%r0,%r0,%r29
-	fcpy,dbl	%fr0,%fr23
-	xor		%r0,%r0,%r31
-	fcpy,dbl	%fr0,%fr24
-	fcpy,dbl	%fr0,%fr25
-	fcpy,dbl	%fr0,%fr26
-	fcpy,dbl	%fr0,%fr27
-	fcpy,dbl	%fr0,%fr28
-	fcpy,dbl	%fr0,%fr29
-	fcpy,dbl	%fr0,%fr30
-	fcpy,dbl	%fr0,%fr31
-	bv		($rp)
-	.EXIT
-	ldo		0($sp),$rv
-	.PROCEND
 ___
 {
 my $inp="%r26";
diff --git a/deps/openssl/openssl/crypto/passphrase.c b/deps/openssl/openssl/crypto/passphrase.c
index c6ddfc1d5e5..a8bc8bc756a 100644
--- a/deps/openssl/openssl/crypto/passphrase.c
+++ b/deps/openssl/openssl/crypto/passphrase.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -150,7 +150,7 @@ static int do_ui_passphrase(char *pass, size_t pass_size, size_t *pass_len,

     prompt_idx = UI_add_input_string(ui, prompt,
                      UI_INPUT_FLAG_DEFAULT_PWD,
-                     ipass, 0, pass_size)
+                     ipass, 0, (int)pass_size)
         - 1;
     if (prompt_idx < 0) {
         ERR_raise(ERR_LIB_CRYPTO, ERR_R_UI_LIB);
@@ -164,7 +164,7 @@ static int do_ui_passphrase(char *pass, size_t pass_size, size_t *pass_len,
             goto end;
         verify_idx = UI_add_verify_string(ui, prompt,
                          UI_INPUT_FLAG_DEFAULT_PWD,
-                         vpass, 0, pass_size,
+                         vpass, 0, (int)pass_size,
                          ipass)
             - 1;
         if (verify_idx < 0) {
diff --git a/deps/openssl/openssl/crypto/pem/pem_err.c b/deps/openssl/openssl/crypto/pem/pem_err.c
deleted file mode 100644
index d51e584c009..00000000000
--- a/deps/openssl/openssl/crypto/pem/pem_err.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/pemerr.h>
-#include "crypto/pemerr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA PEM_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_BAD_BASE64_DECODE), "bad base64 decode" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_BAD_DECRYPT), "bad decrypt" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_BAD_END_LINE), "bad end line" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_BAD_IV_CHARS), "bad iv chars" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_BAD_MAGIC_NUMBER), "bad magic number" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_BAD_PASSWORD_READ), "bad password read" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_BAD_VERSION_NUMBER), "bad version number" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_BIO_WRITE_FAILURE), "bio write failure" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_CIPHER_IS_NULL), "cipher is null" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_ERROR_CONVERTING_PRIVATE_KEY),
-        "error converting private key" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_EXPECTING_DSS_KEY_BLOB),
-        "expecting dss key blob" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_EXPECTING_PRIVATE_KEY_BLOB),
-        "expecting private key blob" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_EXPECTING_PUBLIC_KEY_BLOB),
-        "expecting public key blob" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_EXPECTING_RSA_KEY_BLOB),
-        "expecting rsa key blob" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_HEADER_TOO_LONG), "header too long" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_INCONSISTENT_HEADER),
-        "inconsistent header" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_KEYBLOB_HEADER_PARSE_ERROR),
-        "keyblob header parse error" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_KEYBLOB_TOO_SHORT), "keyblob too short" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_MISSING_DEK_IV), "missing dek iv" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_NOT_DEK_INFO), "not dek info" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_NOT_ENCRYPTED), "not encrypted" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_NOT_PROC_TYPE), "not proc type" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_NO_START_LINE), "no start line" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_PROBLEMS_GETTING_PASSWORD),
-        "problems getting password" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_PVK_DATA_TOO_SHORT), "pvk data too short" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_PVK_TOO_SHORT), "pvk too short" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_READ_KEY), "read key" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_SHORT_HEADER), "short header" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_UNEXPECTED_DEK_IV), "unexpected dek iv" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_UNSUPPORTED_CIPHER), "unsupported cipher" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_UNSUPPORTED_ENCRYPTION),
-        "unsupported encryption" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_UNSUPPORTED_KEY_COMPONENTS),
-        "unsupported key components" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE),
-        "unsupported public key type" },
-    { ERR_PACK(ERR_LIB_PEM, 0, PEM_R_UNSUPPORTED_PVK_KEY_TYPE),
-        "unsupported pvk key type" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_PEM_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(PEM_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(PEM_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/pem/pem_info.c b/deps/openssl/openssl/crypto/pem/pem_info.c
index 8f38fe05807..281dfd69ed2 100644
--- a/deps/openssl/openssl/crypto/pem/pem_info.c
+++ b/deps/openssl/openssl/crypto/pem/pem_info.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -24,6 +24,14 @@
 #include <openssl/dsa.h>
 #include "crypto/evp.h"

+typedef enum {
+    PEM_INFO_NONE,
+    PEM_INFO_X509,
+    PEM_INFO_X509_AUX,
+    PEM_INFO_X509_CRL,
+    PEM_INFO_PKEY
+} pem_info_type;
+
 #ifndef OPENSSL_NO_STDIO
 STACK_OF(X509_INFO)
 *PEM_X509_INFO_read_ex(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb,
@@ -63,7 +71,7 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk,
     int ok = 0;
     STACK_OF(X509_INFO) *ret = NULL;
     unsigned int i, raw, ptype;
-    d2i_of_void *d2i = 0;
+    pem_info_type itype = PEM_INFO_NONE;

     if (sk == NULL) {
         if ((ret = sk_X509_INFO_new_null()) == NULL) {
@@ -78,6 +86,7 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk,
     for (;;) {
         raw = 0;
         ptype = 0;
+        itype = PEM_INFO_NONE;
         ERR_set_mark();
         i = PEM_read_bio(bp, &name, &header, &data, &len);
         if (i == 0) {
@@ -102,15 +111,15 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk,
                 goto start;
             }
             if ((strcmp(name, PEM_STRING_X509_TRUSTED) == 0))
-                d2i = (D2I_OF(void))d2i_X509_AUX;
+                itype = PEM_INFO_X509_AUX;
             else
-                d2i = (D2I_OF(void))d2i_X509;
+                itype = PEM_INFO_X509;
             xi->x509 = X509_new_ex(libctx, propq);
             if (xi->x509 == NULL)
                 goto err;
             pp = &(xi->x509);
         } else if (strcmp(name, PEM_STRING_X509_CRL) == 0) {
-            d2i = (D2I_OF(void))d2i_X509_CRL;
+            itype = PEM_INFO_X509_CRL;
             if (xi->crl != NULL) {
                 if (!sk_X509_INFO_push(ret, xi))
                     goto err;
@@ -137,7 +146,7 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk,
             xi->enc_data = NULL;
             xi->enc_len = 0;

-            d2i = (D2I_OF(void))d2i_AutoPrivateKey;
+            itype = PEM_INFO_PKEY;
             xi->x_pkey = X509_PKEY_new();
             if (xi->x_pkey == NULL)
                 goto err;
@@ -146,11 +155,11 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk,
                 || strcmp(name, PEM_STRING_PKCS8) == 0)
                 raw = 1;
         } else { /* unknown */
-            d2i = NULL;
+            itype = PEM_INFO_NONE;
             pp = NULL;
         }

-        if (d2i != NULL) {
+        if (itype != PEM_INFO_NONE) {
             if (!raw) {
                 EVP_CIPHER_INFO cipher;

@@ -160,15 +169,36 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk,
                     goto err;
                 p = data;
                 if (ptype) {
-                    if (d2i_PrivateKey_ex(ptype, pp, &p, len,
+                    if (d2i_PrivateKey_ex(ptype, (EVP_PKEY **)pp, &p, len,
                             libctx, propq)
                         == NULL) {
                         ERR_raise(ERR_LIB_PEM, ERR_R_ASN1_LIB);
                         goto err;
                     }
-                } else if (d2i(pp, &p, len) == NULL) {
-                    ERR_raise(ERR_LIB_PEM, ERR_R_ASN1_LIB);
-                    goto err;
+                } else {
+                    void *decoded = NULL;
+
+                    switch (itype) {
+                    case PEM_INFO_X509:
+                        decoded = d2i_X509((X509 **)pp, &p, len);
+                        break;
+                    case PEM_INFO_X509_AUX:
+                        decoded = d2i_X509_AUX((X509 **)pp, &p, len);
+                        break;
+                    case PEM_INFO_X509_CRL:
+                        decoded = d2i_X509_CRL((X509_CRL **)pp, &p, len);
+                        break;
+                    case PEM_INFO_PKEY:
+                        decoded = d2i_AutoPrivateKey_ex((EVP_PKEY **)pp, &p,
+                            len, libctx, propq);
+                        break;
+                    default:
+                        break;
+                    }
+                    if (decoded == NULL) {
+                        ERR_raise(ERR_LIB_PEM, ERR_R_ASN1_LIB);
+                        goto err;
+                    }
                 }
             } else { /* encrypted key data */
                 if (!PEM_get_EVP_CIPHER_INFO(header, &xi->enc_cipher))
diff --git a/deps/openssl/openssl/crypto/pem/pem_lib.c b/deps/openssl/openssl/crypto/pem/pem_lib.c
index c42ce0e6a7b..6c6df85198c 100644
--- a/deps/openssl/openssl/crypto/pem/pem_lib.c
+++ b/deps/openssl/openssl/crypto/pem/pem_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,8 +7,10 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
+/*
+ * We need to use some EVP_PKEY_asn1 deprecated APIs
+ */
+#include "internal/deprecated.h"

 #include <stdio.h>
 #include "crypto/ctype.h"
@@ -23,7 +25,7 @@
 #include <openssl/pkcs12.h>
 #include "crypto/asn1.h"
 #include <openssl/des.h>
-#include <openssl/engine.h>
+#include "crypto/evp.h"

 #define MIN_LENGTH 4

@@ -38,7 +40,7 @@ int PEM_def_callback(char *buf, int num, int rwflag, void *userdata)

     /* We assume that the user passes a default password as userdata */
     if (userdata) {
-        i = strlen(userdata);
+        i = (int)strlen(userdata);
         i = (i > num) ? num : i;
         memcpy(buf, userdata, i);
         return i;
@@ -63,7 +65,7 @@ int PEM_def_callback(char *buf, int num, int rwflag, void *userdata)
         memset(buf, 0, (unsigned int)num);
         return -1;
     }
-    return strlen(buf);
+    return (int)strlen(buf);
 }

 void PEM_proc_type(char *buf, int type)
@@ -80,22 +82,22 @@ void PEM_proc_type(char *buf, int type)
     else
         str = "BAD-TYPE";

-    BIO_snprintf(p, PEM_BUFSIZE - (size_t)(p - buf), "Proc-Type: 4,%s\n", str);
+    snprintf(p, PEM_BUFSIZE - (size_t)(p - buf), "Proc-Type: 4,%s\n", str);
 }

 void PEM_dek_info(char *buf, const char *type, int len, const char *str)
 {
     long i;
     char *p = buf + strlen(buf);
-    int j = PEM_BUFSIZE - (size_t)(p - buf), n;
+    int j = PEM_BUFSIZE - (int)(p - buf), n;

-    n = BIO_snprintf(p, j, "DEK-Info: %s,", type);
-    if (n > 0) {
+    n = snprintf(p, j, "DEK-Info: %s,", type);
+    if (n > 0 && n < j) {
         j -= n;
         p += n;
         for (i = 0; i < len; i++) {
-            n = BIO_snprintf(p, j, "%02X", 0xff & str[i]);
-            if (n <= 0)
+            n = snprintf(p, j, "%02X", 0xff & str[i]);
+            if (n <= 0 || n >= j)
                 return;
             j -= n;
             p += n;
@@ -144,7 +146,7 @@ static int check_pem(const char *nm, const char *name)
              * NB: ENGINE implementations won't contain a deprecated old
              * private key decode function so don't look for them.
              */
-            ameth = EVP_PKEY_asn1_find_str(NULL, nm, slen);
+            ameth = evp_pkey_asn1_find_str(nm, slen);
             if (ameth && ameth->old_priv_decode)
                 return 1;
         }
@@ -156,17 +158,13 @@ static int check_pem(const char *nm, const char *name)
         const EVP_PKEY_ASN1_METHOD *ameth;
         slen = ossl_pem_check_suffix(nm, "PARAMETERS");
         if (slen > 0) {
-            ENGINE *e;
-            ameth = EVP_PKEY_asn1_find_str(&e, nm, slen);
+            ameth = evp_pkey_asn1_find_str(nm, slen);
             if (ameth) {
                 int r;
                 if (ameth->param_decode)
                     r = 1;
                 else
                     r = 0;
-#ifndef OPENSSL_NO_ENGINE
-                ENGINE_finish(e);
-#endif
                 return r;
             }
         }
@@ -645,14 +643,14 @@ int PEM_write_bio(BIO *bp, const char *name, const char *header,
     }

     EVP_EncodeInit(ctx);
-    nlen = strlen(name);
+    nlen = (int)strlen(name);

     if ((BIO_write(bp, "-----BEGIN ", 11) != 11) || (BIO_write(bp, name, nlen) != nlen) || (BIO_write(bp, "-----\n", 6) != 6)) {
         reason = ERR_R_BIO_LIB;
         goto err;
     }

-    i = header != NULL ? strlen(header) : 0;
+    i = header != NULL ? (int)strlen(header) : 0;
     if (i > 0) {
         if ((BIO_write(bp, header, i) != i) || (BIO_write(bp, "\n", 1) != 1)) {
             reason = ERR_R_BIO_LIB;
@@ -660,7 +658,7 @@ int PEM_write_bio(BIO *bp, const char *name, const char *header,
         }
     }

-    buf = OPENSSL_malloc(PEM_BUFSIZE * 8);
+    buf = OPENSSL_malloc_array(PEM_BUFSIZE, 8);
     if (buf == NULL)
         goto err;

@@ -972,7 +970,11 @@ int PEM_read_bio_ex(BIO *bp, char **name_out, char **header,
         goto end;

     BIO_get_mem_ptr(dataB, &buf_mem);
-    len = buf_mem->length;
+    if (buf_mem->length > INT_MAX) {
+        ERR_raise(ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE);
+        goto end;
+    }
+    len = (int)buf_mem->length;

     /* There was no data in the PEM file */
     if (len == 0)
@@ -1040,9 +1042,10 @@ int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data,

 int ossl_pem_check_suffix(const char *pem_str, const char *suffix)
 {
-    int pem_len = strlen(pem_str);
-    int suffix_len = strlen(suffix);
+    int pem_len = (int)strlen(pem_str);
+    int suffix_len = (int)strlen(suffix);
     const char *p;
+
     if (suffix_len + 1 >= pem_len)
         return 0;
     p = pem_str + pem_len - suffix_len;
@@ -1051,5 +1054,5 @@ int ossl_pem_check_suffix(const char *pem_str, const char *suffix)
     p--;
     if (*p != ' ')
         return 0;
-    return p - pem_str;
+    return (int)(p - pem_str);
 }
diff --git a/deps/openssl/openssl/crypto/pem/pem_local.h b/deps/openssl/openssl/crypto/pem/pem_local.h
index 0795f82afc3..e74efe590ac 100644
--- a/deps/openssl/openssl/crypto/pem/pem_local.h
+++ b/deps/openssl/openssl/crypto/pem/pem_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_PEM_PEM_LOCAL_H)
+#define OSSL_LIBCRYPTO_PEM_PEM_LOCAL_H
+
 #include <openssl/core_dispatch.h>
 #include <openssl/pem.h>
 #include <openssl/encoder.h>
@@ -54,7 +57,7 @@
     if (kstr == NULL && cb == NULL) {                                   \
         if (u != NULL) {                                                \
             kstr = u;                                                   \
-            klen = strlen(u);                                           \
+            klen = (int)strlen(u);                                      \
         } else {                                                        \
             cb = PEM_def_callback;                                      \
         }                                                               \
@@ -162,3 +165,5 @@
 #define IMPLEMENT_PEM_provided_rw_cb(name, TYPE, type, str, asn1) \
     IMPLEMENT_PEM_read(name, TYPE, str, asn1)                     \
     IMPLEMENT_PEM_provided_write_cb(name, TYPE, type, str, asn1)
+
+#endif /* !defined(OSSL_LIBCRYPTO_PEM_PEM_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/pem/pem_pk8.c b/deps/openssl/openssl/crypto/pem/pem_pk8.c
index 1b05d8a29ce..c548a6ba1e2 100644
--- a/deps/openssl/openssl/crypto/pem/pem_pk8.c
+++ b/deps/openssl/openssl/crypto/pem/pem_pk8.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -86,7 +86,7 @@ static int do_pk8pkey(BIO *bp, const EVP_PKEY *x, int isder, int nid,
     if (kstr == NULL && cb == NULL) {
         if (u != NULL) {
             kstr = u;
-            klen = strlen(u);
+            klen = (int)strlen(u);
         } else {
             cb = PEM_def_callback;
         }
diff --git a/deps/openssl/openssl/crypto/pem/pem_pkey.c b/deps/openssl/openssl/crypto/pem/pem_pkey.c
index e68df7f5f6e..55744f3d658 100644
--- a/deps/openssl/openssl/crypto/pem/pem_pkey.c
+++ b/deps/openssl/openssl/crypto/pem/pem_pkey.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,8 +7,10 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
+/*
+ * We need to use some deprecated APIs
+ */
+#include "internal/deprecated.h"

 #include <stdio.h>
 #include <openssl/buffer.h>
@@ -17,7 +19,6 @@
 #include <openssl/x509.h>
 #include <openssl/pkcs12.h>
 #include <openssl/pem.h>
-#include <openssl/engine.h>
 #include <openssl/dh.h>
 #include <openssl/decoder.h>
 #include <openssl/ui.h>
@@ -173,7 +174,7 @@ static EVP_PKEY *pem_read_bio_key_legacy(BIO *bp, EVP_PKEY **x,
         PKCS8_PRIV_KEY_INFO_free(p8inf);
     } else if ((slen = ossl_pem_check_suffix(nm, "PRIVATE KEY")) > 0) {
         const EVP_PKEY_ASN1_METHOD *ameth;
-        ameth = EVP_PKEY_asn1_find_str(NULL, nm, slen);
+        ameth = evp_pkey_asn1_find_str(nm, slen);
         if (ameth == NULL || ameth->old_priv_decode == NULL)
             goto p8err;
         ret = ossl_d2i_PrivateKey_legacy(ameth->pkey_id, x, &p, len, libctx,
@@ -359,7 +360,7 @@ int PEM_write_bio_PrivateKey_traditional(BIO *bp, const EVP_PKEY *x,
         EVP_PKEY_free(copy);
         return 0;
     }
-    BIO_snprintf(pem_str, 80, "%s PRIVATE KEY", x->ameth->pem_str);
+    snprintf(pem_str, 80, "%s PRIVATE KEY", x->ameth->pem_str);
     ret = PEM_ASN1_write_bio((i2d_of_void *)i2d_PrivateKey,
         pem_str, bp, x, enc, kstr, klen, cb, u);

@@ -399,7 +400,7 @@ legacy:
     if (!x->ameth || !x->ameth->param_encode)
         return 0;

-    BIO_snprintf(pem_str, 80, "%s PARAMETERS", x->ameth->pem_str);
+    snprintf(pem_str, 80, "%s PARAMETERS", x->ameth->pem_str);
     return PEM_ASN1_write_bio((i2d_of_void *)x->ameth->param_encode,
         pem_str, out, x, NULL, NULL, 0, 0, NULL);
 }
diff --git a/deps/openssl/openssl/crypto/perlasm/riscv.pm b/deps/openssl/openssl/crypto/perlasm/riscv.pm
index 2402c052ca4..5d62f3a660d 100644
--- a/deps/openssl/openssl/crypto/perlasm/riscv.pm
+++ b/deps/openssl/openssl/crypto/perlasm/riscv.pm
@@ -2,7 +2,7 @@
 # This file is dual-licensed, meaning that you can use it under your
 # choice of either of the following two licenses:
 #
-# Copyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License"). You can obtain
 # a copy in the file LICENSE in the source distribution or at
@@ -13,6 +13,7 @@
 # Copyright (c) 2023, Christoph Müllner <christoph.muellner@vrull.eu>
 # Copyright (c) 2023, Jerry Shih <jerry.shih@sifive.com>
 # Copyright (c) 2023, Phoebe Chen <phoebe.chen@sifive.com>
+# Copyright (c) 2025, Julian Zhu <julian.oerv@isrc.iscas.ac.cn>
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -276,6 +277,27 @@ ___
     return $seq;
 }

+sub roriw_rv64i {
+    my (
+        $rd, $rs, $tmp1, $tmp2, $imm,
+    ) = @_;
+    my $code=<<___;
+    srliw $tmp1, $rs, $imm
+    slliw $tmp2, $rs, (32-$imm)
+    or $rd, $tmp1, $tmp2
+___
+    return $code;
+}
+
+sub orn_rv64i {
+    my ($rd, $rs1, $rs2) = @_;
+    my $code=<<___;
+    not $rd, $rs2
+    or $rd, $rd, $rs1
+___
+    return $code;
+}
+
 # Scalar crypto instructions

 sub aes64ds {
@@ -375,6 +397,16 @@ sub clmulh {
     return ".word ".($template | ($rs2 << 20) | ($rs1 << 15) | ($rd << 7));
 }

+sub orn {
+    # Encoding for orn rd, rs1, rs2
+    #               0100000 _ rs2 _ rs1 _110_ rd  _0110011
+    my $template = 0b0100000_00000_00000_110_00000_0110011;
+    my $rd = read_reg shift;
+    my $rs1 = read_reg shift;
+    my $rs2 = read_reg shift;
+    return ".word ".($template | ($rs2 << 20) | ($rs1 << 15) | ($rd << 7));
+}
+
 sub rev8 {
     # Encoding for rev8 rd, rs instruction on RV64
     #               XXXXXXXXXXXXX_ rs  _XXX_ rd  _XXXXXXX
@@ -384,6 +416,16 @@ sub rev8 {
     return ".word ".($template | ($rs << 15) | ($rd << 7));
 }

+sub rori {
+    # Encoding for rori rd, rs1, shamt instruction on RV64
+    #               XXXXXXX_ shamt _ rs1 _XXX_ rd  _XXXXXXX
+    my $template = 0b0110000_00000_00000_101_00000_0010011;
+    my $rd = read_reg shift;
+    my $rs1 = read_reg shift;
+    my $shamt = shift;
+    return ".word ".($template | ($shamt << 20) | ($rs1 << 15) | ($rd << 7));
+}
+
 sub roriw {
     # Encoding for roriw rd, rs1, shamt instruction on RV64
     #               XXXXXXX_ shamt _ rs1 _XXX_ rd  _XXXXXXX
@@ -426,6 +468,16 @@ sub vadd_vv {
     return ".word ".($template | ($vm << 25) | ($vs2 << 20) | ($vs1 << 15) | ($vd << 7));
 }

+sub vrgather_vv {
+    # vrgather.vv vd, vs2, vs1, vm
+    my $template = 0b001100_0_00000_00000_000_00000_1010111;
+    my $vd = read_vreg shift;
+    my $vs2 = read_vreg shift;
+    my $vs1 = read_vreg shift;
+    my $vm = read_mask_vreg shift;
+    return ".word ".($template | ($vm << 25) | ($vs2 << 20) | ($vs1 << 15) | ($vd << 7));
+}
+
 sub vadd_vx {
     # vadd.vx vd, vs2, rs1, vm
     my $template = 0b000000_0_00000_00000_100_00000_1010111;
@@ -537,6 +589,16 @@ sub vluxei8_v {
     return ".word ".($template | ($vm << 25) | ($vs2 << 20) | ($rs1 << 15) | ($vd << 7));
 }

+sub vluxei32_v {
+    # vluxei32.v vd, (rs1), vs2, vm
+    my $template = 0b000001_0_00000_00000_110_00000_0000111;
+    my $vd = read_vreg shift;
+    my $rs1 = read_reg shift;
+    my $vs2 = read_vreg shift;
+    my $vm = read_mask_vreg shift;
+    return ".word ".($template | ($vm << 25) | ($vs2 << 20) | ($rs1 << 15) | ($vd << 7));
+}
+
 sub vmerge_vim {
     # vmerge.vim vd, vs2, imm, v0
     my $template = 0b0101110_00000_00000_011_00000_1010111;
@@ -582,6 +644,14 @@ sub vmv_v_i {
     return ".word ".($template | ($imm << 15) | ($vd << 7));
 }

+sub vmv1r_v {
+    # vmv1r.v vd, vs1
+    my $template = 0b1001111_00000_00000_011_00000_1010111;
+    my $vd = read_vreg shift;
+    my $vs1 = read_vreg shift;
+    return ".word ".($template | ($vs1 << 20) | ($vd << 7));
+}
+
 sub vmv_v_x {
     # vmv.v.x vd, rs1
     my $template = 0b0101111_00000_00000_100_00000_1010111;
@@ -1050,4 +1120,13 @@ sub vsm3me_vv {
     return ".word ".($template | ($vs2 << 20) | ($vs1 << 15 ) | ($vd << 7));
 }

+sub vrgather_vv{
+    # vrgather.vv vd, vs2, vs1
+    my $template = 0b11001_00000_00000_000_00000_1010111;
+    my $vd = read_vreg shift;
+    my $vs2 = read_vreg shift;
+    my $vs1 = read_vreg shift;
+    return ".word ".($template | ($vs2 << 20) | ($vs1 << 15 ) | ($vd << 7));
+}
+
 1;
diff --git a/deps/openssl/openssl/crypto/perlasm/s390x.pm b/deps/openssl/openssl/crypto/perlasm/s390x.pm
index dbf48426813..d736551e321 100644
--- a/deps/openssl/openssl/crypto/perlasm/s390x.pm
+++ b/deps/openssl/openssl/crypto/perlasm/s390x.pm
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2018-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -3172,4 +3172,4 @@ sub err {
 	return $ERR{$_[0]};
 }

-1;
+no warnings 'void'; 1;
diff --git a/deps/openssl/openssl/crypto/perlasm/x86_64-xlate.pl b/deps/openssl/openssl/crypto/perlasm/x86_64-xlate.pl
index 94ba8ad7593..12dd1b5470d 100755
--- a/deps/openssl/openssl/crypto/perlasm/x86_64-xlate.pl
+++ b/deps/openssl/openssl/crypto/perlasm/x86_64-xlate.pl
@@ -7,7 +7,7 @@
 # https://www.openssl.org/source/license.html


-# Ascetic x86_64 AT&T to MASM/NASM assembler translator by <appro>.
+# Ascetic x86_64 AT&T to MASM/NASM assembler translator by <@dot-asm>.
 #
 # Why AT&T to MASM and not vice versa? Several reasons. Because AT&T
 # format is way easier to parse. Because it's simpler to "gear" from
@@ -440,6 +440,7 @@ my %globals;
 	    ($self->{asterisk})				&& ($sz="q") ||
 	    ($mnemonic =~ /^v?mov([qd])$/)		&& ($sz=$1)  ||
 	    ($mnemonic =~ /^v?pinsr([qdwb])$/)		&& ($sz=$1)  ||
+	    ($mnemonic =~ /^vbroadcasti32x4$/)		&& ($sz="x") ||
 	    ($mnemonic =~ /^vpbroadcast([qdwb])$/)	&& ($sz=$1)  ||
 	    ($mnemonic =~ /^v(?!perm)[a-z]+[fi]128$/)	&& ($sz="x");

diff --git a/deps/openssl/openssl/crypto/perlasm/x86asm.pl b/deps/openssl/openssl/crypto/perlasm/x86asm.pl
index 05b5ff94c54..2ec16c5571d 100644
--- a/deps/openssl/openssl/crypto/perlasm/x86asm.pl
+++ b/deps/openssl/openssl/crypto/perlasm/x86asm.pl
@@ -174,9 +174,9 @@ sub ::vprotd

 sub ::endbranch
 {
-    &::generic("%ifdef __CET__\n");
+    &::generic("#ifdef __CET__\n");
     &::data_byte(0xf3,0x0f,0x1e,0xfb);
-    &::generic("%endif\n");
+    &::generic("#endif\n");
 }

 # label management
diff --git a/deps/openssl/openssl/crypto/perlasm/x86gas.pl b/deps/openssl/openssl/crypto/perlasm/x86gas.pl
index f3c01ea89b4..af477080e83 100644
--- a/deps/openssl/openssl/crypto/perlasm/x86gas.pl
+++ b/deps/openssl/openssl/crypto/perlasm/x86gas.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/crypto/perlasm/x86masm.pl b/deps/openssl/openssl/crypto/perlasm/x86masm.pl
index ccdba757dc2..d56bc48428a 100644
--- a/deps/openssl/openssl/crypto/perlasm/x86masm.pl
+++ b/deps/openssl/openssl/crypto/perlasm/x86masm.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/crypto/perlasm/x86nasm.pl b/deps/openssl/openssl/crypto/perlasm/x86nasm.pl
index a8cdd2d0bbe..c9df05bd1ee 100644
--- a/deps/openssl/openssl/crypto/perlasm/x86nasm.pl
+++ b/deps/openssl/openssl/crypto/perlasm/x86nasm.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_add.c b/deps/openssl/openssl/crypto/pkcs12/p12_add.c
index 977aa8b6583..12173177837 100644
--- a/deps/openssl/openssl/crypto/pkcs12/p12_add.c
+++ b/deps/openssl/openssl/crypto/pkcs12/p12_add.c
@@ -98,8 +98,7 @@ PKCS7 *PKCS12_pack_p7encdata_ex(int pbe_nid, const char *pass, int passlen,
 {
     PKCS7 *p7;
     X509_ALGOR *pbe;
-    const EVP_CIPHER *pbe_ciph = NULL;
-    EVP_CIPHER *pbe_ciph_fetch = NULL;
+    EVP_CIPHER *pbe_ciph = NULL;

     if ((p7 = PKCS7_new_ex(ctx, propq)) == NULL) {
         ERR_raise(ERR_LIB_PKCS12, ERR_R_ASN1_LIB);
@@ -111,9 +110,7 @@ PKCS7 *PKCS12_pack_p7encdata_ex(int pbe_nid, const char *pass, int passlen,
     }

     ERR_set_mark();
-    pbe_ciph = pbe_ciph_fetch = EVP_CIPHER_fetch(ctx, OBJ_nid2sn(pbe_nid), propq);
-    if (pbe_ciph == NULL)
-        pbe_ciph = EVP_get_cipherbynid(pbe_nid);
+    pbe_ciph = EVP_CIPHER_fetch(ctx, OBJ_nid2sn(pbe_nid), propq);
     ERR_pop_to_mark();

     if (pbe_ciph != NULL) {
@@ -135,12 +132,12 @@ PKCS7 *PKCS12_pack_p7encdata_ex(int pbe_nid, const char *pass, int passlen,
         goto err;
     }

-    EVP_CIPHER_free(pbe_ciph_fetch);
+    EVP_CIPHER_free(pbe_ciph);
     return p7;

 err:
     PKCS7_free(p7);
-    EVP_CIPHER_free(pbe_ciph_fetch);
+    EVP_CIPHER_free(pbe_ciph);
     return NULL;
 }

diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_attr.c b/deps/openssl/openssl/crypto/pkcs12/p12_attr.c
index ec609d9b5a6..677f303b054 100644
--- a/deps/openssl/openssl/crypto/pkcs12/p12_attr.c
+++ b/deps/openssl/openssl/crypto/pkcs12/p12_attr.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,9 +12,11 @@
 #include <openssl/pkcs12.h>
 #include "p12_local.h"

+#include <crypto/asn1.h>
+
 /* Add a local keyid to a safebag */

-int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,
+int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, const unsigned char *name,
     int namelen)
 {
     if (X509at_add1_attr_by_NID(&bag->attrib, NID_localKeyID,
@@ -97,7 +99,7 @@ int PKCS12_add1_attr_by_txt(PKCS12_SAFEBAG *bag, const char *attrname, int type,
         return 0;
 }

-ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs,
+const ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs,
     int attr_nid)
 {
     int i = X509at_get_attr_by_NID(attrs, attr_nid, -1);
diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_crpt.c b/deps/openssl/openssl/crypto/pkcs12/p12_crpt.c
index b7519f7b585..e7963851019 100644
--- a/deps/openssl/openssl/crypto/pkcs12/p12_crpt.c
+++ b/deps/openssl/openssl/crypto/pkcs12/p12_crpt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,6 +14,8 @@
 #include "crypto/evp.h"
 #include <openssl/pkcs12.h>

+#include <crypto/asn1.h>
+
 /* PKCS#12 PBE algorithms now in static table */

 void PKCS12_PBE_add(void)
diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_crt.c b/deps/openssl/openssl/crypto/pkcs12/p12_crt.c
index 90a6fe1182d..948d46b8516 100644
--- a/deps/openssl/openssl/crypto/pkcs12/p12_crt.c
+++ b/deps/openssl/openssl/crypto/pkcs12/p12_crt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,7 +20,7 @@ static PKCS12_SAFEBAG *pkcs12_add_cert_bag(STACK_OF(PKCS12_SAFEBAG) **pbags,
     X509 *cert,
     const char *name,
     int namelen,
-    unsigned char *keyid,
+    const unsigned char *keyid,
     int keyidlen);

 static int copy_bag_attr(PKCS12_SAFEBAG *bag, EVP_PKEY *pkey, int nid)
@@ -46,7 +46,7 @@ PKCS12 *PKCS12_create_ex2(const char *pass, const char *name, EVP_PKEY *pkey,
     unsigned char keyid[EVP_MAX_MD_SIZE];
     unsigned int keyidlen = 0;
     int namelen = -1;
-    unsigned char *pkeyid = NULL;
+    const unsigned char *pkeyid = NULL;
     int pkeyidlen = -1;

     /* Set defaults */
@@ -190,7 +190,7 @@ static PKCS12_SAFEBAG *pkcs12_add_cert_bag(STACK_OF(PKCS12_SAFEBAG) **pbags,
     X509 *cert,
     const char *name,
     int namelen,
-    unsigned char *keyid,
+    const unsigned char *keyid,
     int keyidlen)
 {
     PKCS12_SAFEBAG *bag = NULL;
@@ -219,7 +219,7 @@ PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert)
 {
     char *name = NULL;
     int namelen = -1;
-    unsigned char *keyid = NULL;
+    const unsigned char *keyid = NULL;
     int keyidlen = -1;

     /*
diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_decr.c b/deps/openssl/openssl/crypto/pkcs12/p12_decr.c
index 31766989fc4..5b51f69027c 100644
--- a/deps/openssl/openssl/crypto/pkcs12/p12_decr.c
+++ b/deps/openssl/openssl/crypto/pkcs12/p12_decr.c
@@ -12,6 +12,8 @@
 #include <openssl/pkcs12.h>
 #include <openssl/trace.h>

+#include <crypto/asn1.h>
+
 /*
  * Encrypt/Decrypt a buffer based on password and algor, result in a
  * OPENSSL_malloc'ed buffer
diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_kiss.c b/deps/openssl/openssl/crypto/pkcs12/p12_kiss.c
index 1c2e49a57fa..20fd100cf3c 100644
--- a/deps/openssl/openssl/crypto/pkcs12/p12_kiss.c
+++ b/deps/openssl/openssl/crypto/pkcs12/p12_kiss.c
@@ -37,6 +37,9 @@ int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
 {
     STACK_OF(X509) *ocerts = NULL;
     X509 *x = NULL;
+    STACK_OF(X509) *initial_ca = ca != NULL ? *ca : NULL;
+    int initial_ca_count = initial_ca == NULL ? 0 : sk_X509_num(initial_ca);
+    int ca_added_count = 0;

     if (pkey != NULL)
         *pkey = NULL;
@@ -127,6 +130,19 @@ err:
         X509_free(*cert);
         *cert = NULL;
     }
+
+    ca_added_count = ca == NULL || *ca == NULL ? 0 : sk_X509_num(*ca) - initial_ca_count;
+    while (ca_added_count > 0) {
+        X509 *t_cert = sk_X509_pop(*ca);
+        X509_free(t_cert);
+        ca_added_count--;
+    }
+
+    if (initial_ca == NULL && ca != NULL) {
+        sk_X509_free(*ca);
+        *ca = NULL;
+    }
+
     X509_free(x);
     OSSL_STACK_OF_X509_free(ocerts);
     return 0;
diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_local.h b/deps/openssl/openssl/crypto/pkcs12/p12_local.h
index 34ffffb6924..4025fbab168 100644
--- a/deps/openssl/openssl/crypto/pkcs12/p12_local.h
+++ b/deps/openssl/openssl/crypto/pkcs12/p12_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,13 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_PKCS12_P12_LOCAL_H)
+#define OSSL_LIBCRYPTO_PKCS12_P12_LOCAL_H
+
+#include <openssl/asn1.h>
+#include <openssl/pkcs12.h>
+#include <openssl/x509.h>
+
 struct PKCS12_MAC_DATA_st {
     X509_SIG *dinfo;
     ASN1_OCTET_STRING *salt;
@@ -43,3 +50,5 @@ struct pkcs12_bag_st {
 };

 const PKCS7_CTX *ossl_pkcs12_get0_pkcs7ctx(const PKCS12 *p12);
+
+#endif /* !defined(OSSL_LIBCRYPTO_PKCS12_P12_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c b/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c
index 15072e12f26..6720349d8d6 100644
--- a/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c
+++ b/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c
@@ -22,11 +22,14 @@
 #include <openssl/pkcs12.h>
 #include "p12_local.h"

+#include <crypto/asn1.h>
+
 static int pkcs12_pbmac1_pbkdf2_key_gen(const char *pass, int passlen,
     unsigned char *salt, int saltlen,
     int id, int iter, int keylen,
     unsigned char *out,
-    const EVP_MD *md_type);
+    const EVP_MD *md_type,
+    OSSL_LIB_CTX *libctx, const char *propq);

 int PKCS12_mac_present(const PKCS12 *p12)
 {
@@ -139,7 +142,7 @@ static int PBMAC1_PBKDF2_HMAC(OSSL_LIB_CTX *ctx, const char *propq,
     /* Validate salt is an OCTET STRING choice */
     if (pbkdf2_param->salt == NULL
         || pbkdf2_param->salt->type != V_ASN1_OCTET_STRING) {
-        ERR_raise(ERR_LIB_PKCS12, PKCS12_R_PARSE_ERROR);
+        ERR_raise_data(ERR_LIB_PKCS12, PKCS12_R_PARSE_ERROR, "Invalid Salt");
         goto err;
     }
     pbkdf2_salt = pbkdf2_param->salt->value.octet_string;
@@ -177,12 +180,12 @@ static int pkcs12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
         unsigned char *salt, int slen,
         int id, int iter, int n,
         unsigned char *out,
-        const EVP_MD *md_type))
+        const EVP_MD *md_type,
+        OSSL_LIB_CTX *libctx,
+        const char *propq))
 {
     int ret = 0;
-    const EVP_MD *md;
-    EVP_MD *md_fetch;
-    HMAC_CTX *hmac = NULL;
+    EVP_MD *md;
     unsigned char key[EVP_MAX_MD_SIZE], *salt;
     int saltlen, iter;
     char md_name[80];
@@ -190,6 +193,9 @@ static int pkcs12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
     int md_nid = NID_undef;
     const X509_ALGOR *macalg;
     const ASN1_OBJECT *macoid;
+    OSSL_LIB_CTX *libctx;
+    const char *propq;
+    size_t md_sz, outlen;

     if (!PKCS7_type_is_data(p12->authsafes)) {
         ERR_raise(ERR_LIB_PKCS12, PKCS12_R_CONTENT_TYPE_NOT_DATA);
@@ -201,6 +207,8 @@ static int pkcs12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
         return 0;
     }

+    libctx = p12->authsafes->ctx.libctx;
+    propq = p12->authsafes->ctx.propq;
     salt = p12->mac->salt->data;
     saltlen = p12->mac->salt->length;
     if (p12->mac->iter == NULL)
@@ -216,28 +224,22 @@ static int pkcs12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
         if (OBJ_obj2txt(md_name, sizeof(md_name), macoid, 0) < 0)
             return 0;
     }
-    (void)ERR_set_mark();
-    md = md_fetch = EVP_MD_fetch(p12->authsafes->ctx.libctx, md_name,
-        p12->authsafes->ctx.propq);
-    if (md == NULL)
-        md = EVP_get_digestbynid(OBJ_obj2nid(macoid));
+    md = EVP_MD_fetch(libctx, md_name, propq);

     if (md == NULL) {
-        (void)ERR_clear_last_mark();
         ERR_raise(ERR_LIB_PKCS12, PKCS12_R_UNKNOWN_DIGEST_ALGORITHM);
         return 0;
     }
-    (void)ERR_pop_to_mark();

     keylen = EVP_MD_get_size(md);
     md_nid = EVP_MD_get_type(md);
     if (keylen <= 0)
         goto err;
+    md_sz = keylen;

     /* For PBMAC1 we use a special keygen callback if not provided (e.g. on verification) */
     if (pbmac1_md_nid != NID_undef && pkcs12_key_gen == NULL) {
-        keylen = PBMAC1_PBKDF2_HMAC(p12->authsafes->ctx.libctx, p12->authsafes->ctx.propq,
-            pass, passlen, macalg, key);
+        keylen = PBMAC1_PBKDF2_HMAC(libctx, propq, pass, passlen, macalg, key);
         if (keylen < 0)
             goto err;
     } else if ((md_nid == NID_id_GostR3411_94
@@ -251,7 +253,7 @@ static int pkcs12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
             goto err;
         }
     } else {
-        EVP_MD *hmac_md = (EVP_MD *)md;
+        EVP_MD *hmac_md = md;
         int fetched = 0;

         if (pbmac1_kdf_nid != NID_undef) {
@@ -259,14 +261,14 @@ static int pkcs12_gen_mac(PKCS12 *p12, const char *pass, int passlen,

             if (OBJ_obj2txt(hmac_md_name, sizeof(hmac_md_name), OBJ_nid2obj(pbmac1_kdf_nid), 0) < 0)
                 goto err;
-            hmac_md = EVP_MD_fetch(NULL, hmac_md_name, NULL);
+            hmac_md = EVP_MD_fetch(libctx, hmac_md_name, propq);
             if (hmac_md == NULL)
                 goto err;
             fetched = 1;
         }
         if (pkcs12_key_gen != NULL) {
             int res = (*pkcs12_key_gen)(pass, passlen, salt, saltlen, PKCS12_MAC_ID,
-                iter, keylen, key, hmac_md);
+                iter, keylen, key, hmac_md, libctx, propq);

             if (fetched)
                 EVP_MD_free(hmac_md);
@@ -279,26 +281,24 @@ static int pkcs12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
                 EVP_MD_free(hmac_md);
             /* Default to UTF-8 password */
             if (!PKCS12_key_gen_utf8_ex(pass, passlen, salt, saltlen, PKCS12_MAC_ID,
-                    iter, keylen, key, md,
-                    p12->authsafes->ctx.libctx, p12->authsafes->ctx.propq)) {
+                    iter, keylen, key, md, libctx, propq)) {
                 ERR_raise(ERR_LIB_PKCS12, PKCS12_R_KEY_GEN_ERROR);
                 goto err;
             }
         }
     }
-    if ((hmac = HMAC_CTX_new()) == NULL
-        || !HMAC_Init_ex(hmac, key, keylen, md, NULL)
-        || !HMAC_Update(hmac, p12->authsafes->d.data->data,
-            p12->authsafes->d.data->length)
-        || !HMAC_Final(hmac, mac, maclen)) {
+    if (EVP_Q_mac(libctx, "HMAC", propq, md_name, NULL, key, keylen,
+            p12->authsafes->d.data->data, p12->authsafes->d.data->length,
+            mac, md_sz, &outlen)
+        == NULL)
         goto err;
-    }
+    if (outlen > UINT_MAX)
+        goto err;
+    *maclen = (unsigned int)outlen;
     ret = 1;
-
 err:
     OPENSSL_cleanse(key, sizeof(key));
-    HMAC_CTX_free(hmac);
-    EVP_MD_free(md_fetch);
+    EVP_MD_free(md);
     return ret;
 }

@@ -350,7 +350,7 @@ int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen)
         }
     }
     X509_SIG_get0(p12->mac->dinfo, NULL, &macoct);
-    if ((maclen != (unsigned int)ASN1_STRING_length(macoct))
+    if ((maclen != ASN1_STRING_get_length(macoct))
         || CRYPTO_memcmp(mac, ASN1_STRING_get0_data(macoct), maclen) != 0)
         return 0;

@@ -394,10 +394,11 @@ static int pkcs12_pbmac1_pbkdf2_key_gen(const char *pass, int passlen,
     unsigned char *salt, int saltlen,
     int id, int iter, int keylen,
     unsigned char *out,
-    const EVP_MD *md_type)
+    const EVP_MD *md_type,
+    OSSL_LIB_CTX *libctx, const char *propq)
 {
-    return PKCS5_PBKDF2_HMAC(pass, passlen, salt, saltlen, iter,
-        md_type, keylen, out);
+    return ossl_pkcs5_pbkdf2_hmac_ex(pass, passlen, salt, saltlen, iter, md_type,
+        keylen, out, libctx, propq);
 }

 static int pkcs12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen,
@@ -465,6 +466,7 @@ int PKCS12_set_pbmac1_pbkdf2(PKCS12 *p12, const char *pass, int passlen,
     int keylen = 0;
     PBMAC1PARAM *param = NULL;
     X509_ALGOR *hmac_alg = NULL, *macalg = NULL;
+    OSSL_LIB_CTX *libctx = p12->authsafes->ctx.libctx;

     if (md_type == NULL)
         /* No need to do a fetch as the md_type is used only to get a NID */
@@ -489,19 +491,26 @@ int PKCS12_set_pbmac1_pbkdf2(PKCS12 *p12, const char *pass, int passlen,
     }

     if (salt == NULL) {
-        known_salt = OPENSSL_malloc(saltlen);
-        if (known_salt == NULL)
+        if (saltlen < 0) {
+            ERR_raise(ERR_LIB_PKCS12, PKCS12_R_INVALID_SALT_LENGTH);
             goto err;
+        }
+        if (saltlen > 0) {
+            known_salt = OPENSSL_malloc(saltlen);
+            if (known_salt == NULL)
+                goto err;

-        if (RAND_bytes_ex(NULL, known_salt, saltlen, 0) <= 0) {
-            ERR_raise(ERR_LIB_PKCS12, ERR_R_RAND_LIB);
-            goto err;
+            if (RAND_bytes_ex(libctx, known_salt, saltlen, 0) <= 0) {
+                ERR_raise(ERR_LIB_PKCS12, ERR_R_RAND_LIB);
+                goto err;
+            }
         }
     }

     param = PBMAC1PARAM_new();
     hmac_alg = X509_ALGOR_new();
-    alg = PKCS5_pbkdf2_set(iter, salt ? salt : known_salt, saltlen, prf_nid, keylen);
+    alg = PKCS5_pbkdf2_set_ex(iter, salt ? salt : known_salt, saltlen,
+        prf_nid, keylen, libctx);
     if (param == NULL || hmac_alg == NULL || alg == NULL)
         goto err;

diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_npas.c b/deps/openssl/openssl/crypto/pkcs12/p12_npas.c
index 2cce2ec0c10..44763e86680 100644
--- a/deps/openssl/openssl/crypto/pkcs12/p12_npas.c
+++ b/deps/openssl/openssl/crypto/pkcs12/p12_npas.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,6 +15,8 @@
 #include <openssl/pkcs12.h>
 #include "p12_local.h"

+#include <crypto/asn1.h>
+
 /* PKCS#12 password change routine */

 static int newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass);
@@ -62,7 +64,8 @@ static int newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass)
     STACK_OF(PKCS7) *asafes = NULL, *newsafes = NULL;
     STACK_OF(PKCS12_SAFEBAG) *bags = NULL;
     int i, bagnid, pbe_nid = 0, pbe_iter = 0, pbe_saltlen = 0, cipherid = NID_undef;
-    PKCS7 *p7, *p7new;
+    PKCS7 *p7;
+    PKCS7 *p7new = NULL;
     ASN1_OCTET_STRING *p12_data_tmp = NULL, *macoct = NULL;
     unsigned char mac[EVP_MAX_MD_SIZE];
     unsigned int maclen;
@@ -99,8 +102,10 @@ static int newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass)
             p7new = PKCS12_pack_p7encdata_ex(pbe_nid, newpass, -1, NULL,
                 pbe_saltlen, pbe_iter, bags,
                 p7->ctx.libctx, p7->ctx.propq);
-        if (p7new == NULL || !sk_PKCS7_push(newsafes, p7new))
+        if (p7new == NULL || !sk_PKCS7_push(newsafes, p7new)) {
+            PKCS7_free(p7new);
             goto err;
+        }
         sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
         bags = NULL;
     }
diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_sbag.c b/deps/openssl/openssl/crypto/pkcs12/p12_sbag.c
index 4848daf2e9b..2bb7c6fa8ba 100644
--- a/deps/openssl/openssl/crypto/pkcs12/p12_sbag.c
+++ b/deps/openssl/openssl/crypto/pkcs12/p12_sbag.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,7 +14,7 @@
 #include "crypto/x509.h"

 #ifndef OPENSSL_NO_DEPRECATED_1_1_0
-ASN1_TYPE *PKCS12_get_attr(const PKCS12_SAFEBAG *bag, int attr_nid)
+const ASN1_TYPE *PKCS12_get_attr(const PKCS12_SAFEBAG *bag, int attr_nid)
 {
     return PKCS12_get_attr_gen(bag->attrib, attr_nid);
 }
@@ -26,7 +26,7 @@ const ASN1_TYPE *PKCS12_SAFEBAG_get0_attr(const PKCS12_SAFEBAG *bag,
     return PKCS12_get_attr_gen(bag->attrib, attr_nid);
 }

-ASN1_TYPE *PKCS8_get_attr(PKCS8_PRIV_KEY_INFO *p8, int attr_nid)
+const ASN1_TYPE *PKCS8_get_attr(PKCS8_PRIV_KEY_INFO *p8, int attr_nid)
 {
     return PKCS12_get_attr_gen(PKCS8_pkey_get0_attrs(p8), attr_nid);
 }
@@ -252,14 +252,11 @@ PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt_ex(int pbe_nid,
     const char *propq)
 {
     PKCS12_SAFEBAG *bag = NULL;
-    const EVP_CIPHER *pbe_ciph = NULL;
-    EVP_CIPHER *pbe_ciph_fetch = NULL;
+    EVP_CIPHER *pbe_ciph = NULL;
     X509_SIG *p8;

     ERR_set_mark();
-    pbe_ciph = pbe_ciph_fetch = EVP_CIPHER_fetch(ctx, OBJ_nid2sn(pbe_nid), propq);
-    if (pbe_ciph == NULL)
-        pbe_ciph = EVP_get_cipherbynid(pbe_nid);
+    pbe_ciph = EVP_CIPHER_fetch(ctx, OBJ_nid2sn(pbe_nid), propq);
     ERR_pop_to_mark();

     if (pbe_ciph != NULL)
@@ -275,7 +272,7 @@ PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt_ex(int pbe_nid,
         X509_SIG_free(p8);

 err:
-    EVP_CIPHER_free(pbe_ciph_fetch);
+    EVP_CIPHER_free(pbe_ciph);
     return bag;
 }

diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_utl.c b/deps/openssl/openssl/crypto/pkcs12/p12_utl.c
index f252fd1a006..dd8e9697677 100644
--- a/deps/openssl/openssl/crypto/pkcs12/p12_utl.c
+++ b/deps/openssl/openssl/crypto/pkcs12/p12_utl.c
@@ -12,6 +12,7 @@
 #include <openssl/pkcs12.h>
 #include "p12_local.h"
 #include "crypto/pkcs7/pk7_local.h"
+#include <crypto/asn1.h>

 /* Cheap and nasty Unicode stuff */

@@ -22,7 +23,7 @@ unsigned char *OPENSSL_asc2uni(const char *asc, int asclen,
     unsigned char *unitmp;

     if (asclen == -1)
-        asclen = strlen(asc);
+        asclen = (int)strlen(asc);
     if (asclen < 0)
         return NULL;
     ulen = asclen * 2 + 2;
@@ -56,11 +57,15 @@ char *OPENSSL_uni2asc(const unsigned char *uni, int unilen)
     /* If no terminating zero allow for one */
     if (!unilen || uni[unilen - 1])
         asclen++;
-    uni++;
     if ((asctmp = OPENSSL_malloc(asclen)) == NULL)
         return NULL;
+    /*
+     * Take the low byte of each big-endian UTF-16 unit. Index from the
+     * caller's pointer rather than incrementing it first, so that a zero
+     * length input does not do pointer arithmetic on a NULL pointer.
+     */
     for (i = 0; i < unilen; i += 2)
-        asctmp[i >> 1] = uni[i];
+        asctmp[i >> 1] = uni[i + 1];
     asctmp[asclen - 1] = 0;
     return asctmp;
 }
@@ -79,13 +84,14 @@ unsigned char *OPENSSL_utf82uni(const char *asc, int asclen,
 {
     int ulen, i, j;
     unsigned char *unitmp, *ret;
-    unsigned long utf32chr = 0;
+    uint32_t utf32chr = 0;

     if (asclen == -1)
-        asclen = strlen(asc);
+        asclen = (int)strlen(asc);

     for (ulen = 0, i = 0; i < asclen; i += j) {
-        j = UTF8_getc((const unsigned char *)asc + i, asclen - i, &utf32chr);
+        j = ossl_utf8_getc_internal((const unsigned char *)asc + i, asclen - i,
+            &utf32chr);

         /*
          * Following condition is somewhat opportunistic is sense that
@@ -121,7 +127,8 @@ unsigned char *OPENSSL_utf82uni(const char *asc, int asclen,
         return NULL;
     /* re-run the loop writing down UTF-16 characters in big-endian order */
     for (unitmp = ret, i = 0; i < asclen; i += j) {
-        j = UTF8_getc((const unsigned char *)asc + i, asclen - i, &utf32chr);
+        j = ossl_utf8_getc_internal((const unsigned char *)asc + i, asclen - i,
+            &utf32chr);
         if (utf32chr >= 0x10000) { /* pair if UTF-16 characters */
             unsigned int hi, lo;

@@ -149,7 +156,7 @@ unsigned char *OPENSSL_utf82uni(const char *asc, int asclen,

 static int bmp_to_utf8(char *str, const unsigned char *utf16, int len)
 {
-    unsigned long utf32chr;
+    uint32_t utf32chr;

     if (len == 0)
         return 0;
@@ -175,9 +182,8 @@ static int bmp_to_utf8(char *str, const unsigned char *utf16, int len)
         utf32chr += 0x10000;
     }

-    return UTF8_putc((unsigned char *)str, 4, utf32chr);
+    return ossl_utf8_putc_internal((unsigned char *)str, 4, utf32chr);
 }
-
 char *OPENSSL_uni2utf8(const unsigned char *uni, int unilen)
 {
     int asclen, i, j;
diff --git a/deps/openssl/openssl/crypto/pkcs12/pk12err.c b/deps/openssl/openssl/crypto/pkcs12/pk12err.c
deleted file mode 100644
index 2a92d999d3a..00000000000
--- a/deps/openssl/openssl/crypto/pkcs12/pk12err.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/pkcs12err.h>
-#include "crypto/pkcs12err.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA PKCS12_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_CALLBACK_FAILED), "callback failed" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_CANT_PACK_STRUCTURE),
-        "can't pack structure" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_CONTENT_TYPE_NOT_DATA),
-        "content type not data" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_DECODE_ERROR), "decode error" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_ENCODE_ERROR), "encode error" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_ENCRYPT_ERROR), "encrypt error" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE),
-        "error setting encrypted data type" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_INVALID_NULL_ARGUMENT),
-        "invalid null argument" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_INVALID_NULL_PKCS12_POINTER),
-        "invalid null pkcs12 pointer" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_INVALID_TYPE), "invalid type" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_IV_GEN_ERROR), "iv gen error" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_KEY_GEN_ERROR), "key gen error" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_MAC_ABSENT), "mac absent" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_MAC_GENERATION_ERROR),
-        "mac generation error" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_MAC_SETUP_ERROR), "mac setup error" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_MAC_STRING_SET_ERROR),
-        "mac string set error" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_MAC_VERIFY_FAILURE),
-        "mac verify failure" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_PARSE_ERROR), "parse error" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_PKCS12_CIPHERFINAL_ERROR),
-        "pkcs12 cipherfinal error" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_UNKNOWN_DIGEST_ALGORITHM),
-        "unknown digest algorithm" },
-    { ERR_PACK(ERR_LIB_PKCS12, 0, PKCS12_R_UNSUPPORTED_PKCS12_MODE),
-        "unsupported pkcs12 mode" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_PKCS12_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(PKCS12_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(PKCS12_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/pkcs7/pk7_asn1.c b/deps/openssl/openssl/crypto/pkcs7/pk7_asn1.c
index 733f3bb69dc..00eabd98158 100644
--- a/deps/openssl/openssl/crypto/pkcs7/pk7_asn1.c
+++ b/deps/openssl/openssl/crypto/pkcs7/pk7_asn1.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -39,7 +39,7 @@ static int pk7_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
     switch (operation) {

     case ASN1_OP_STREAM_PRE:
-        if (PKCS7_stream(&sarg->boundary, *pp7) <= 0)
+        if (ossl_pkcs7_stream(*pp7) <= 0)
             return 0;
         /* fall through */
     case ASN1_OP_DETACHED_PRE:
@@ -53,6 +53,12 @@ static int pk7_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
         if (PKCS7_dataFinal(*pp7, sarg->ndef_bio) <= 0)
             return 0;
         break;
+
+    case ASN1_OP_GET0_STREAM_CONTENT: {
+        ASN1_STRING **content = exarg;
+
+        *content = ossl_pkcs7_get0_stream_content(*pp7);
+    } break;
     }
     return 1;
 }
@@ -73,7 +79,7 @@ PKCS7 *d2i_PKCS7(PKCS7 **a, const unsigned char **in, long len)
         propq = (*a)->ctx.propq;
     }

-    ret = (PKCS7 *)ASN1_item_d2i_ex((ASN1_VALUE **)a, in, len, (PKCS7_it()),
+    ret = (PKCS7 *)ASN1_item_d2i_ex((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(PKCS7),
         libctx, propq);
     if (ret != NULL)
         ossl_pkcs7_resolve_libctx(ret);
@@ -82,7 +88,7 @@ PKCS7 *d2i_PKCS7(PKCS7 **a, const unsigned char **in, long len)

 int i2d_PKCS7(const PKCS7 *a, unsigned char **out)
 {
-    return ASN1_item_i2d((const ASN1_VALUE *)a, out, (PKCS7_it()));
+    return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(PKCS7));
 }

 PKCS7 *PKCS7_new(void)
diff --git a/deps/openssl/openssl/crypto/pkcs7/pk7_attr.c b/deps/openssl/openssl/crypto/pkcs7/pk7_attr.c
index a1c09840e82..ac7a4cb4af7 100644
--- a/deps/openssl/openssl/crypto/pkcs7/pk7_attr.c
+++ b/deps/openssl/openssl/crypto/pkcs7/pk7_attr.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,6 +17,8 @@
 #include <openssl/x509.h>
 #include <openssl/err.h>

+#include <crypto/asn1.h>
+
 int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
     STACK_OF(X509_ALGOR) *cap)
 {
@@ -28,7 +30,7 @@ int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
     }
     seq->length = ASN1_item_i2d((ASN1_VALUE *)cap, &seq->data,
         ASN1_ITEM_rptr(X509_ALGORS));
-    if (seq->length <= 0 || seq->data == NULL) {
+    if (ASN1_STRING_get_length(seq) == 0 || ASN1_STRING_get0_data(seq) == NULL) {
         ASN1_STRING_free(seq);
         return 1;
     }
@@ -42,16 +44,19 @@ int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,

 STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si)
 {
-    ASN1_TYPE *cap;
+    const ASN1_TYPE *cap;
     const unsigned char *p;
+    size_t len;

     cap = PKCS7_get_signed_attribute(si, NID_SMIMECapabilities);
     if (cap == NULL || (cap->type != V_ASN1_SEQUENCE))
         return NULL;
-    p = cap->value.sequence->data;
+    p = ASN1_STRING_get0_data(cap->value.sequence);
+    len = ASN1_STRING_get_length(cap->value.sequence);
+    if (len > INT_MAX)
+        return NULL;
     return (STACK_OF(X509_ALGOR) *)
-        ASN1_item_d2i(NULL, &p, cap->value.sequence->length,
-            ASN1_ITEM_rptr(X509_ALGORS));
+        ASN1_item_d2i(NULL, &p, (int)len, ASN1_ITEM_rptr(X509_ALGORS));
 }

 /* Basic smime-capabilities OID and optional integer arg */
@@ -127,7 +132,7 @@ int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si,
     os = ASN1_OCTET_STRING_new();
     if (os == NULL)
         return 0;
-    if (!ASN1_STRING_set(os, md, mdlen)
+    if (!ossl_asn1_string_set1_data(os, md, mdlen)
         || !PKCS7_add_signed_attribute(si, NID_pkcs9_messageDigest,
             V_ASN1_OCTET_STRING, os)) {
         ASN1_OCTET_STRING_free(os);
diff --git a/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c b/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c
index aaf3c19aaea..3799dec1dab 100644
--- a/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c
+++ b/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c
@@ -18,9 +18,11 @@
 #include "crypto/evp.h"
 #include "pk7_local.h"

+#include <crypto/asn1.h>
+
 static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype,
     void *value);
-static ASN1_TYPE *get_attribute(const STACK_OF(X509_ATTRIBUTE) *sk, int nid);
+static const ASN1_TYPE *get_attribute(const STACK_OF(X509_ATTRIBUTE) *sk, int nid);

 int PKCS7_type_is_other(PKCS7 *p7)
 {
@@ -54,7 +56,7 @@ ASN1_OCTET_STRING *PKCS7_get_octet_string(PKCS7 *p7)
     return NULL;
 }

-static ASN1_OCTET_STRING *pkcs7_get1_data(PKCS7 *p7)
+static ASN1_OCTET_STRING *pkcs7_get1_data(PKCS7 *p7, int streaming)
 {
     ASN1_OCTET_STRING *os = PKCS7_get_octet_string(p7);

@@ -62,8 +64,7 @@ static ASN1_OCTET_STRING *pkcs7_get1_data(PKCS7 *p7)
         /* Edge case for MIME content, see RFC 5652 section-5.2.1 */
         ASN1_OCTET_STRING *osdup = ASN1_OCTET_STRING_dup(os);

-        if (osdup != NULL && (os->flags & ASN1_STRING_FLAG_NDEF))
-            /* ASN1_STRING_FLAG_NDEF flag is currently used by openssl-smime */
+        if (osdup != NULL && streaming)
             ASN1_STRING_set0(osdup, NULL, 0);
         return osdup;
     }
@@ -72,16 +73,19 @@ static ASN1_OCTET_STRING *pkcs7_get1_data(PKCS7 *p7)
     if (PKCS7_type_is_other(p7) && (p7->d.other != NULL)
         && (p7->d.other->type == V_ASN1_SEQUENCE)
         && (p7->d.other->value.sequence != NULL)
-        && (p7->d.other->value.sequence->length > 0)) {
-        const unsigned char *data = p7->d.other->value.sequence->data;
+        && (ASN1_STRING_get_length(p7->d.other->value.sequence) > 0)) {
+        const unsigned char *data = ASN1_STRING_get0_data(p7->d.other->value.sequence);
         long len;
         int inf, tag, class;
+        size_t tmp;

+        tmp = ASN1_STRING_get_length(p7->d.other->value.sequence);
+        if (tmp > INT_MAX)
+            return NULL;
         os = ASN1_OCTET_STRING_new();
         if (os == NULL)
             return NULL;
-        inf = ASN1_get_object(&data, &len, &tag, &class,
-            p7->d.other->value.sequence->length);
+        inf = ASN1_get_object(&data, &len, &tag, &class, (int)tmp);
         if (inf != V_ASN1_CONSTRUCTED || tag != V_ASN1_SEQUENCE
             || !ASN1_OCTET_STRING_set(os, data, len)) {
             ASN1_OCTET_STRING_free(os);
@@ -96,8 +100,7 @@ static int pkcs7_bio_add_digest(BIO **pbio, X509_ALGOR *alg,
 {
     BIO *btmp;
     char name[OSSL_MAX_NAME_SIZE];
-    EVP_MD *fetched = NULL;
-    const EVP_MD *md;
+    EVP_MD *md = NULL;

     if ((btmp = BIO_new(BIO_f_md())) == NULL) {
         ERR_raise(ERR_LIB_PKCS7, ERR_R_BIO_LIB);
@@ -106,27 +109,20 @@ static int pkcs7_bio_add_digest(BIO **pbio, X509_ALGOR *alg,

     OBJ_obj2txt(name, sizeof(name), alg->algorithm, 0);

-    (void)ERR_set_mark();
-    fetched = EVP_MD_fetch(ossl_pkcs7_ctx_get0_libctx(ctx), name,
+    md = EVP_MD_fetch(ossl_pkcs7_ctx_get0_libctx(ctx), name,
         ossl_pkcs7_ctx_get0_propq(ctx));
-    if (fetched != NULL)
-        md = fetched;
-    else
-        md = EVP_get_digestbyname(name);

     if (md == NULL) {
-        (void)ERR_clear_last_mark();
         ERR_raise(ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_DIGEST_TYPE);
         goto err;
     }
-    (void)ERR_pop_to_mark();

     if (BIO_set_md(btmp, md) <= 0) {
         ERR_raise(ERR_LIB_PKCS7, ERR_R_BIO_LIB);
-        EVP_MD_free(fetched);
+        EVP_MD_free(md);
         goto err;
     }
-    EVP_MD_free(fetched);
+    EVP_MD_free(md);
     if (*pbio == NULL)
         *pbio = btmp;
     else if (!BIO_push(*pbio, btmp)) {
@@ -174,7 +170,7 @@ static int pkcs7_encode_rinfo(PKCS7_RECIP_INFO *ri,
     if (EVP_PKEY_encrypt(pctx, ek, &eklen, key, keylen) <= 0)
         goto err;

-    ASN1_STRING_set0(ri->enc_key, ek, eklen);
+    ASN1_STRING_set0(ri->enc_key, ek, (int)eklen);
     ek = NULL;

     ret = 1;
@@ -204,7 +200,7 @@ static int pkcs7_decrypt_rinfo(unsigned char **pek, int *peklen,
         goto err;

     ret = evp_pkey_decrypt_alloc(pctx, &ek, &eklen, fixlen,
-        ri->enc_key->data, ri->enc_key->length);
+        ASN1_STRING_get0_data(ri->enc_key), ASN1_STRING_get_length(ri->enc_key));
     if (ret <= 0)
         goto err;

@@ -212,7 +208,7 @@ static int pkcs7_decrypt_rinfo(unsigned char **pek, int *peklen,

     OPENSSL_clear_free(*pek, *peklen);
     *pek = ek;
-    *peklen = eklen;
+    *peklen = (int)eklen;

 err:
     EVP_PKEY_CTX_free(pctx);
@@ -263,12 +259,12 @@ BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
     }

     i = OBJ_obj2nid(p7->type);
-    p7->state = PKCS7_S_HEADER;

     switch (i) {
     case NID_pkcs7_signed:
         md_sk = p7->d.sign->md_algs;
-        os = pkcs7_get1_data(p7->d.sign->contents);
+        os = pkcs7_get1_data(p7->d.sign->contents,
+            (p7->state & PKCS7_STATE_STREAMING) != 0);
         break;
     case NID_pkcs7_signedAndEnveloped:
         rsk = p7->d.signed_and_enveloped->recipientinfo;
@@ -291,7 +287,8 @@ BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
         break;
     case NID_pkcs7_digest:
         xa = p7->d.digest->md;
-        os = pkcs7_get1_data(p7->d.digest->contents);
+        os = pkcs7_get1_data(p7->d.digest->contents,
+            (p7->state & PKCS7_STATE_STREAMING) != 0);
         break;
     case NID_pkcs7_data:
         break;
@@ -377,7 +374,7 @@ BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
     if (bio == NULL) {
         if (PKCS7_is_detached(p7)) {
             bio = BIO_new(BIO_s_null());
-        } else if (os != NULL && os->length > 0) {
+        } else if (os != NULL && ASN1_STRING_get_length(os) > 0) {
             /*
              * bio needs a copy of os->data instead of a pointer because
              * the data will be used after os has been freed
@@ -385,7 +382,9 @@ BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
             bio = BIO_new(BIO_s_mem());
             if (bio != NULL) {
                 BIO_set_mem_eof_return(bio, 0);
-                if (BIO_write(bio, os->data, os->length) != os->length) {
+                const unsigned char *os_data = ASN1_STRING_get0_data(os);
+                size_t os_len = ASN1_STRING_get_length(os);
+                if (os_len > INT_MAX || BIO_write(bio, os_data, (int)os_len) != (int)os_len) {
                     BIO_free_all(bio);
                     bio = NULL;
                 }
@@ -433,10 +432,8 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
     BIO *out = NULL, *btmp = NULL, *etmp = NULL, *bio = NULL;
     X509_ALGOR *xa;
     ASN1_OCTET_STRING *data_body = NULL;
-    EVP_MD *evp_md = NULL;
-    const EVP_MD *md;
-    EVP_CIPHER *evp_cipher = NULL;
-    const EVP_CIPHER *cipher = NULL;
+    EVP_MD *md = NULL;
+    EVP_CIPHER *cipher = NULL;
     EVP_CIPHER_CTX *evp_ctx = NULL;
     X509_ALGOR *enc_alg = NULL;
     STACK_OF(X509_ALGOR) *md_sk = NULL;
@@ -464,7 +461,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
     }

     i = OBJ_obj2nid(p7->type);
-    p7->state = PKCS7_S_HEADER;

     switch (i) {
     case NID_pkcs7_signed:
@@ -490,19 +486,12 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)

         OBJ_obj2txt(name, sizeof(name), enc_alg->algorithm, 0);

-        (void)ERR_set_mark();
-        evp_cipher = EVP_CIPHER_fetch(libctx, name, propq);
-        if (evp_cipher != NULL)
-            cipher = evp_cipher;
-        else
-            cipher = EVP_get_cipherbyname(name);
+        cipher = EVP_CIPHER_fetch(libctx, name, propq);

         if (cipher == NULL) {
-            (void)ERR_clear_last_mark();
             ERR_raise(ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CIPHER_TYPE);
             goto err;
         }
-        (void)ERR_pop_to_mark();
         break;
     case NID_pkcs7_enveloped:
         rsk = p7->d.enveloped->recipientinfo;
@@ -511,19 +500,12 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
         data_body = p7->d.enveloped->enc_data->enc_data;
         OBJ_obj2txt(name, sizeof(name), enc_alg->algorithm, 0);

-        (void)ERR_set_mark();
-        evp_cipher = EVP_CIPHER_fetch(libctx, name, propq);
-        if (evp_cipher != NULL)
-            cipher = evp_cipher;
-        else
-            cipher = EVP_get_cipherbyname(name);
+        cipher = EVP_CIPHER_fetch(libctx, name, propq);

         if (cipher == NULL) {
-            (void)ERR_clear_last_mark();
             ERR_raise(ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CIPHER_TYPE);
             goto err;
         }
-        (void)ERR_pop_to_mark();
         break;
     default:
         ERR_raise(ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CONTENT_TYPE);
@@ -547,26 +529,19 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)

             OBJ_obj2txt(name, sizeof(name), xa->algorithm, 0);

-            (void)ERR_set_mark();
-            evp_md = EVP_MD_fetch(libctx, name, propq);
-            if (evp_md != NULL)
-                md = evp_md;
-            else
-                md = EVP_get_digestbyname(name);
+            md = EVP_MD_fetch(libctx, name, propq);

             if (md == NULL) {
-                (void)ERR_clear_last_mark();
                 ERR_raise(ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_DIGEST_TYPE);
                 goto err;
             }
-            (void)ERR_pop_to_mark();

             if (BIO_set_md(btmp, md) <= 0) {
-                EVP_MD_free(evp_md);
+                EVP_MD_free(md);
                 ERR_raise(ERR_LIB_PKCS7, ERR_R_BIO_LIB);
                 goto err;
             }
-            EVP_MD_free(evp_md);
+            EVP_MD_free(md);
             if (out == NULL)
                 out = btmp;
             else
@@ -683,8 +658,12 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
     if (in_bio != NULL) {
         bio = in_bio;
     } else {
-        if (data_body->length > 0)
-            bio = BIO_new_mem_buf(data_body->data, data_body->length);
+        size_t data_body_len = ASN1_STRING_get_length(data_body);
+        if (data_body_len > INT_MAX)
+            goto err;
+        if (data_body_len > 0)
+            bio = BIO_new_mem_buf(ASN1_STRING_get0_data(data_body),
+                (int)data_body_len);
         else {
             bio = BIO_new(BIO_s_mem());
             if (bio == NULL)
@@ -696,11 +675,11 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
     }
     BIO_push(out, bio);
     bio = NULL;
-    EVP_CIPHER_free(evp_cipher);
+    EVP_CIPHER_free(cipher);
     return out;

 err:
-    EVP_CIPHER_free(evp_cipher);
+    EVP_CIPHER_free(cipher);
     OPENSSL_clear_free(ek, eklen);
     OPENSSL_clear_free(tkey, tkeylen);
     BIO_free_all(out);
@@ -791,7 +770,6 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
     }

     i = OBJ_obj2nid(p7->type);
-    p7->state = PKCS7_S_HEADER;

     switch (i) {
     case NID_pkcs7_data:
@@ -922,7 +900,7 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
          */
         if (os == NULL)
             goto err;
-        if (!(os->flags & ASN1_STRING_FLAG_NDEF)) {
+        if (!(p7->state & PKCS7_STATE_STREAMING)) {
             char *cont;
             long contlen;
             btmp = BIO_find_type(bio, BIO_TYPE_MEM);
@@ -991,7 +969,7 @@ int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si)

     EVP_MD_CTX_free(mctx);

-    ASN1_STRING_set0(si->enc_digest, abuf, siglen);
+    ASN1_STRING_set0(si->enc_digest, abuf, (int)siglen);

     return 1;

@@ -1056,18 +1034,19 @@ int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, BIO *bio,
         goto err;
     }

-    return PKCS7_signatureVerify(bio, p7, si, signer);
+    if (PKCS7_signatureVerify(bio, p7, si, signer) <= 0)
+        goto err;
+    ret = 1;
 err:
     return ret;
 }

 int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
-    X509 *signer)
+    const X509 *signer)
 {
     ASN1_OCTET_STRING *os;
     EVP_MD_CTX *mdc_tmp, *mdc;
-    const EVP_MD *md;
-    EVP_MD *fetched_md = NULL;
+    EVP_MD *md = NULL;
     int ret = 0, i;
     int md_type;
     STACK_OF(X509_ATTRIBUTE) *sk;
@@ -1125,7 +1104,7 @@ int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
         unsigned char md_dat[EVP_MAX_MD_SIZE];
         unsigned int md_len;
         int alen;
-        ASN1_OCTET_STRING *message_digest;
+        const ASN1_OCTET_STRING *message_digest;

         if (!EVP_DigestFinal_ex(mdc_tmp, md_dat, &md_len))
             goto err;
@@ -1134,25 +1113,18 @@ int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
             ERR_raise(ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST);
             goto err;
         }
-        if ((message_digest->length != (int)md_len) || (memcmp(message_digest->data, md_dat, md_len))) {
+        if ((ASN1_STRING_get_length(message_digest) != md_len)
+            || (memcmp(ASN1_STRING_get0_data(message_digest), md_dat, md_len))) {
             ERR_raise(ERR_LIB_PKCS7, PKCS7_R_DIGEST_FAILURE);
             ret = -1;
             goto err;
         }

-        (void)ERR_set_mark();
-        fetched_md = EVP_MD_fetch(libctx, OBJ_nid2sn(md_type), propq);
-
-        if (fetched_md != NULL)
-            md = fetched_md;
-        else
-            md = EVP_get_digestbynid(md_type);
+        md = EVP_MD_fetch(libctx, OBJ_nid2sn(md_type), propq);

         if (md == NULL || !EVP_VerifyInit_ex(mdc_tmp, md, NULL)) {
-            (void)ERR_clear_last_mark();
             goto err;
         }
-        (void)ERR_pop_to_mark();

         alen = ASN1_item_i2d((ASN1_VALUE *)sk, &abuf,
             ASN1_ITEM_rptr(PKCS7_ATTR_VERIFY));
@@ -1172,7 +1144,13 @@ int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
         goto err;
     }

-    i = EVP_VerifyFinal_ex(mdc_tmp, os->data, os->length, pkey, libctx, propq);
+    const unsigned char *sig_data = ASN1_STRING_get0_data(os);
+    size_t sig_len = ASN1_STRING_get_length(os);
+    if (sig_len > INT_MAX) {
+        ret = -1;
+        goto err;
+    }
+    i = EVP_VerifyFinal_ex(mdc_tmp, sig_data, (int)sig_len, pkey, libctx, propq);
     if (i <= 0) {
         ERR_raise(ERR_LIB_PKCS7, PKCS7_R_SIGNATURE_FAILURE);
         ret = -1;
@@ -1182,7 +1160,7 @@ int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
 err:
     OPENSSL_free(abuf);
     EVP_MD_CTX_free(mdc_tmp);
-    EVP_MD_free(fetched_md);
+    EVP_MD_free(md);
     return ret;
 }

@@ -1206,17 +1184,17 @@ PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx)
     return ri->issuer_and_serial;
 }

-ASN1_TYPE *PKCS7_get_signed_attribute(const PKCS7_SIGNER_INFO *si, int nid)
+const ASN1_TYPE *PKCS7_get_signed_attribute(const PKCS7_SIGNER_INFO *si, int nid)
 {
     return get_attribute(si->auth_attr, nid);
 }

-ASN1_TYPE *PKCS7_get_attribute(const PKCS7_SIGNER_INFO *si, int nid)
+const ASN1_TYPE *PKCS7_get_attribute(const PKCS7_SIGNER_INFO *si, int nid)
 {
     return get_attribute(si->unauth_attr, nid);
 }

-static ASN1_TYPE *get_attribute(const STACK_OF(X509_ATTRIBUTE) *sk, int nid)
+static const ASN1_TYPE *get_attribute(const STACK_OF(X509_ATTRIBUTE) *sk, int nid)
 {
     int idx = X509at_get_attr_by_NID(sk, nid, -1);

@@ -1225,9 +1203,9 @@ static ASN1_TYPE *get_attribute(const STACK_OF(X509_ATTRIBUTE) *sk, int nid)
     return X509_ATTRIBUTE_get0_type(X509at_get_attr(sk, idx), 0);
 }

-ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk)
+const ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk)
 {
-    ASN1_TYPE *astype;
+    const ASN1_TYPE *astype;
     if ((astype = get_attribute(sk, NID_pkcs9_messageDigest)) == NULL)
         return NULL;
     if (astype->type != V_ASN1_OCTET_STRING)
diff --git a/deps/openssl/openssl/crypto/pkcs7/pk7_lib.c b/deps/openssl/openssl/crypto/pkcs7/pk7_lib.c
index 2fd753e873d..539bb1633b8 100644
--- a/deps/openssl/openssl/crypto/pkcs7/pk7_lib.c
+++ b/deps/openssl/openssl/crypto/pkcs7/pk7_lib.c
@@ -716,8 +716,8 @@ int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher)
     return 1;
 }

-/* unfortunately cannot constify BIO_new_NDEF() due to this and CMS_stream() */
-int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7)
+/* Return the content octet string that indefinite-length streaming encodes */
+ASN1_OCTET_STRING *ossl_pkcs7_get0_stream_content(PKCS7 *p7)
 {
     ASN1_OCTET_STRING *os = NULL;

@@ -769,11 +769,26 @@ int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7)
         break;
     }

+    return os;
+}
+
+int ossl_pkcs7_stream(PKCS7 *p7)
+{
+    ASN1_OCTET_STRING *os = ossl_pkcs7_get0_stream_content(p7);
+
     if (os == NULL)
         return 0;

-    os->flags |= ASN1_STRING_FLAG_NDEF;
-    *boundary = &os->data;
+    p7->state |= PKCS7_STATE_STREAMING;

     return 1;
 }
+
+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7)
+{
+    if (boundary != NULL)
+        *boundary = NULL;
+    return ossl_pkcs7_stream(p7);
+}
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_1) */
diff --git a/deps/openssl/openssl/crypto/pkcs7/pk7_local.h b/deps/openssl/openssl/crypto/pkcs7/pk7_local.h
index 79f909f3dd8..ab15ad923e4 100644
--- a/deps/openssl/openssl/crypto/pkcs7/pk7_local.h
+++ b/deps/openssl/openssl/crypto/pkcs7/pk7_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,11 +7,39 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_PKCS7_PK7_LOCAL_H)
+#define OSSL_LIBCRYPTO_PKCS7_PK7_LOCAL_H
+
 #include "crypto/pkcs7.h"

+/*
+ * The public PKCS7 state field once held PKCS7_S_HEADER/BODY/TAIL; those
+ * values are no longer used but remain public.  Use a separate bit of the
+ * field, clear of the public values, as an internal flag.
+ *
+ * Set when streaming is set up, where the encoder writes the content out.
+ * When it is not set and the content is not detached, the content octet
+ * string is filled at dataFinal time from the memory BIO PKCS7_dataInit()
+ * creates.
+ */
+#define PKCS7_STATE_STREAMING 0x100
+
+ASN1_OCTET_STRING *ossl_pkcs7_get0_stream_content(PKCS7 *p7);
+
+/**
+ * @brief Prepare the content of p7 for indefinite-length streaming.
+ * The content octet string is created if it is not already present, and the
+ * content is recorded as a streaming placeholder in the state field.
+ * @param p7 the PKCS7 to prepare for streaming
+ * @returns 1 on success, 0 on failure
+ */
+int ossl_pkcs7_stream(PKCS7 *p7);
+
 STACK_OF(X509) *pkcs7_get0_certificates(const PKCS7 *p7);
 const PKCS7_CTX *ossl_pkcs7_get0_ctx(const PKCS7 *p7);
 OSSL_LIB_CTX *ossl_pkcs7_ctx_get0_libctx(const PKCS7_CTX *ctx);
 const char *ossl_pkcs7_ctx_get0_propq(const PKCS7_CTX *ctx);

 int ossl_pkcs7_ctx_propagate(const PKCS7 *from, PKCS7 *to);
+
+#endif /* !defined(OSSL_LIBCRYPTO_PKCS7_PK7_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/pkcs7/pk7_smime.c b/deps/openssl/openssl/crypto/pkcs7/pk7_smime.c
index ec041809fea..7ff5682e57d 100644
--- a/deps/openssl/openssl/crypto/pkcs7/pk7_smime.c
+++ b/deps/openssl/openssl/crypto/pkcs7/pk7_smime.c
@@ -20,9 +20,8 @@

 static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si);

-PKCS7 *PKCS7_sign_ex(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
-    BIO *data, int flags, OSSL_LIB_CTX *libctx,
-    const char *propq)
+PKCS7 *PKCS7_sign_ex(X509 *signcert, EVP_PKEY *pkey, const STACK_OF(X509) *certs,
+    BIO *data, int flags, OSSL_LIB_CTX *libctx, const char *propq)
 {
     PKCS7 *p7;
     int i;
@@ -64,7 +63,7 @@ err:
     return NULL;
 }

-PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
+PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, const STACK_OF(X509) *certs,
     BIO *data, int flags)
 {
     return PKCS7_sign_ex(signcert, pkey, certs, data, flags, NULL, NULL);
@@ -98,17 +97,33 @@ err:

 /* Check to see if a cipher exists and if so add S/MIME capabilities */

-static int add_cipher_smcap(STACK_OF(X509_ALGOR) *sk, int nid, int arg)
+static int add_cipher_smcap(STACK_OF(X509_ALGOR) *sk, int nid, int arg,
+    OSSL_LIB_CTX *libctx, const char *propq)
 {
-    if (EVP_get_cipherbynid(nid))
+    EVP_CIPHER *cipher;
+
+    ERR_set_mark();
+    cipher = EVP_CIPHER_fetch(libctx, OBJ_nid2sn(nid), propq);
+    ERR_pop_to_mark();
+    if (cipher != NULL) {
+        EVP_CIPHER_free(cipher);
         return PKCS7_simple_smimecap(sk, nid, arg);
+    }
     return 1;
 }

-static int add_digest_smcap(STACK_OF(X509_ALGOR) *sk, int nid, int arg)
+static int add_digest_smcap(STACK_OF(X509_ALGOR) *sk, int nid, int arg,
+    OSSL_LIB_CTX *libctx, const char *propq)
 {
-    if (EVP_get_digestbynid(nid))
+    EVP_MD *md;
+
+    ERR_set_mark();
+    md = EVP_MD_fetch(libctx, OBJ_nid2sn(nid), propq);
+    ERR_pop_to_mark();
+    if (md != NULL) {
+        EVP_MD_free(md);
         return PKCS7_simple_smimecap(sk, nid, arg);
+    }
     return 1;
 }

@@ -118,6 +133,8 @@ PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, X509 *signcert,
 {
     PKCS7_SIGNER_INFO *si = NULL;
     STACK_OF(X509_ALGOR) *smcap = NULL;
+    OSSL_LIB_CTX *libctx;
+    const char *propq;

     if (!X509_check_private_key(signcert, pkey)) {
         ERR_raise(ERR_LIB_PKCS7,
@@ -145,18 +162,17 @@ PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, X509 *signcert,
                 ERR_raise(ERR_LIB_PKCS7, ERR_R_CRYPTO_LIB);
                 goto err;
             }
-            if (!add_cipher_smcap(smcap, NID_aes_256_cbc, -1)
-                || !add_digest_smcap(smcap, NID_id_GostR3411_2012_256, -1)
-                || !add_digest_smcap(smcap, NID_id_GostR3411_2012_512, -1)
-                || !add_digest_smcap(smcap, NID_id_GostR3411_94, -1)
-                || !add_cipher_smcap(smcap, NID_id_Gost28147_89, -1)
-                || !add_cipher_smcap(smcap, NID_aes_192_cbc, -1)
-                || !add_cipher_smcap(smcap, NID_aes_128_cbc, -1)
-                || !add_cipher_smcap(smcap, NID_des_ede3_cbc, -1)
-                || !add_cipher_smcap(smcap, NID_rc2_cbc, 128)
-                || !add_cipher_smcap(smcap, NID_rc2_cbc, 64)
-                || !add_cipher_smcap(smcap, NID_des_cbc, -1)
-                || !add_cipher_smcap(smcap, NID_rc2_cbc, 40)
+            libctx = ossl_pkcs7_ctx_get0_libctx(si->ctx);
+            propq = ossl_pkcs7_ctx_get0_propq(si->ctx);
+            if (!add_cipher_smcap(smcap, NID_aes_256_cbc, -1, libctx, propq)
+                || !add_digest_smcap(smcap, NID_id_GostR3411_2012_256, -1, libctx, propq)
+                || !add_digest_smcap(smcap, NID_id_GostR3411_2012_512, -1, libctx, propq)
+                || !add_digest_smcap(smcap, NID_id_GostR3411_94, -1, libctx, propq)
+                || !add_cipher_smcap(smcap, NID_id_Gost28147_89, -1, libctx, propq)
+                || !add_cipher_smcap(smcap, NID_aes_192_cbc, -1, libctx, propq)
+                || !add_cipher_smcap(smcap, NID_aes_128_cbc, -1, libctx, propq)
+                || !add_cipher_smcap(smcap, NID_des_ede3_cbc, -1, libctx, propq)
+                || !add_cipher_smcap(smcap, NID_rc2_cbc, 128, libctx, propq)
                 || !PKCS7_add_attrib_smimecap(si, smcap))
                 goto err;
             sk_X509_ALGOR_pop_free(smcap, X509_ALGOR_free);
@@ -186,7 +202,7 @@ static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si)
     int i;
     STACK_OF(PKCS7_SIGNER_INFO) *sinfos;
     PKCS7_SIGNER_INFO *sitmp;
-    ASN1_OCTET_STRING *osdig = NULL;
+    const ASN1_OCTET_STRING *osdig = NULL;
     sinfos = PKCS7_get_signer_info(p7);
     for (i = 0; i < sk_PKCS7_SIGNER_INFO_num(sinfos); i++) {
         sitmp = sk_PKCS7_SIGNER_INFO_value(sinfos, i);
@@ -200,15 +216,21 @@ static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si)
         }
     }

-    if (osdig != NULL)
-        return PKCS7_add1_attrib_digest(si, osdig->data, osdig->length);
+    if (osdig != NULL) {
+        size_t len;
+        len = ASN1_STRING_get_length(osdig);
+        if (len > INT_MAX)
+            goto err;
+        return PKCS7_add1_attrib_digest(si, ASN1_STRING_get0_data(osdig), (int)len);
+    }

+err:
     ERR_raise(ERR_LIB_PKCS7, PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND);
     return 0;
 }

 /* This strongly overlaps with CMS_verify(), partly with PKCS7_dataVerify() */
-int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
+int PKCS7_verify(PKCS7 *p7, const STACK_OF(X509) *certs, X509_STORE *store,
     BIO *indata, BIO *out, int flags)
 {
     STACK_OF(X509) *signers;
@@ -363,8 +385,7 @@ err:
     return ret;
 }

-STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,
-    int flags)
+STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, const STACK_OF(X509) *certs, int flags)
 {
     STACK_OF(X509) *signers, *included_certs;
     STACK_OF(PKCS7_SIGNER_INFO) *sinfos;
@@ -424,7 +445,7 @@ STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,

 /* Build a complete PKCS#7 enveloped data */

-PKCS7 *PKCS7_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
+PKCS7 *PKCS7_encrypt_ex(const STACK_OF(X509) *certs, BIO *in,
     const EVP_CIPHER *cipher, int flags,
     OSSL_LIB_CTX *libctx, const char *propq)
 {
@@ -466,8 +487,7 @@ err:
     return NULL;
 }

-PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
-    int flags)
+PKCS7 *PKCS7_encrypt(const STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, int flags)
 {
     return PKCS7_encrypt_ex(certs, in, cipher, flags, NULL, NULL);
 }
diff --git a/deps/openssl/openssl/crypto/pkcs7/pkcs7err.c b/deps/openssl/openssl/crypto/pkcs7/pkcs7err.c
deleted file mode 100644
index 45494a97686..00000000000
--- a/deps/openssl/openssl/crypto/pkcs7/pkcs7err.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/pkcs7err.h>
-#include "crypto/pkcs7err.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA PKCS7_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_CERTIFICATE_VERIFY_ERROR),
-        "certificate verify error" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER),
-        "cipher has no object identifier" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_CIPHER_NOT_INITIALIZED),
-        "cipher not initialized" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_CONTENT_AND_DATA_PRESENT),
-        "content and data present" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_CTRL_ERROR), "ctrl error" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_DECRYPT_ERROR), "decrypt error" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_DIGEST_FAILURE), "digest failure" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_ENCRYPTION_CTRL_FAILURE),
-        "encryption ctrl failure" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE),
-        "encryption not supported for this key type" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_ERROR_ADDING_RECIPIENT),
-        "error adding recipient" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_ERROR_SETTING_CIPHER),
-        "error setting cipher" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_INVALID_NULL_POINTER),
-        "invalid null pointer" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_INVALID_SIGNED_DATA_TYPE),
-        "invalid signed data type" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_NO_CONTENT), "no content" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_NO_DEFAULT_DIGEST),
-        "no default digest" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND),
-        "no matching digest type found" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE),
-        "no recipient matches certificate" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_NO_SIGNATURES_ON_DATA),
-        "no signatures on data" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_NO_SIGNERS), "no signers" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE),
-        "operation not supported on this type" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR),
-        "pkcs7 add signature error" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_PKCS7_ADD_SIGNER_ERROR),
-        "pkcs7 add signer error" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_PKCS7_DATASIGN), "pkcs7 datasign" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE),
-        "private key does not match certificate" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_SIGNATURE_FAILURE),
-        "signature failure" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND),
-        "signer certificate not found" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_SIGNING_CTRL_FAILURE),
-        "signing ctrl failure" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE),
-        "signing not supported for this key type" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_SMIME_TEXT_ERROR), "smime text error" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_UNABLE_TO_FIND_CERTIFICATE),
-        "unable to find certificate" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_UNABLE_TO_FIND_MEM_BIO),
-        "unable to find mem bio" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST),
-        "unable to find message digest" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_UNKNOWN_DIGEST_TYPE),
-        "unknown digest type" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_UNKNOWN_OPERATION),
-        "unknown operation" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_UNSUPPORTED_CIPHER_TYPE),
-        "unsupported cipher type" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_UNSUPPORTED_CONTENT_TYPE),
-        "unsupported content type" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_WRONG_CONTENT_TYPE),
-        "wrong content type" },
-    { ERR_PACK(ERR_LIB_PKCS7, 0, PKCS7_R_WRONG_PKCS7_TYPE), "wrong pkcs7 type" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_PKCS7_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(PKCS7_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(PKCS7_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv4.pl b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv4.pl
index 673ea62ec38..f7c30c9e5b4 100755
--- a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv4.pl
+++ b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv4.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 #			IALU(*)/gcc-4.4		NEON
@@ -48,7 +48,7 @@ if ($flavour && $flavour ne "void") {
 ($ctx,$inp,$len,$padbit)=map("r$_",(0..3));

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 #if defined(__thumb2__)
 .syntax	unified
@@ -1236,7 +1236,7 @@ poly1305_emit_neon:
 ___
 }	}
 $code.=<<___;
-.asciz	"Poly1305 for ARMv4/NEON, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Poly1305 for ARMv4/NEON, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2
 #if	__ARM_MAX_ARCH__>=7
 .extern   OPENSSL_armcap_P
diff --git a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv8.pl b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv8.pl
index df722dc26da..fe72c6ff018 100755
--- a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv8.pl
+++ b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv8.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # This module implements Poly1305 hash for ARMv8.
@@ -55,7 +55,7 @@ my ($mac,$nonce)=($inp,$len);
 my ($h0,$h1,$h2,$r0,$r1,$s1,$t0,$t1,$d0,$d1,$d2) = map("x$_",(4..14));

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 .text

@@ -69,6 +69,8 @@ $code.=<<___;
 .globl	poly1305_emit
 .hidden	poly1305_emit

+.extern poly1305_blocks_sve2
+
 .type	poly1305_init,%function
 .align	5
 poly1305_init:
@@ -109,6 +111,13 @@ poly1305_init:
 	csel	$d0,$d0,$r0,eq
 	csel	$d1,$d1,$r1,eq

+	tst	w17, #ARMV9_SVE2_POLY1305
+
+	adrp	$r0,poly1305_blocks_sve2
+	add	$r0,$r0,#:lo12:poly1305_blocks_sve2
+
+	csel	$d0,$d0,$r0,eq
+
 #ifdef	__ILP32__
 	stp	w12,w13,[$len]
 #else
@@ -948,7 +957,7 @@ poly1305_emit_neon:
 .align	5
 .Lzeros:
 .long	0,0,0,0,0,0,0,0
-.asciz	"Poly1305 for ARMv8, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Poly1305 for ARMv8, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2
 ___

diff --git a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv9-sve2.pl b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv9-sve2.pl
new file mode 100755
index 00000000000..1ba59c796d5
--- /dev/null
+++ b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-armv9-sve2.pl
@@ -0,0 +1,1421 @@
+#! /usr/bin/env perl
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+##############################################################################
+#
+# Copyright (c) 2025, Iakov Polyak <iakov.polyak@linaro.org>
+# This file is an SVE2 port-and-merge of POLY1305 hash algorithm, derived from
+# the OpenSSL Neon implementation and a vector length agnostic (VLA)
+# RISC-V implementation from the CRYPTOGAMS project.
+#
+##############################################################################
+#
+# Copyright (c) 2006, CRYPTOGAMS by <appro@openssl.org>
+# All rights reserved.
+#
+#Redistribution and use in source and binary forms, with or without
+#modification, are permitted provided that the following conditions
+#are met:
+#
+#      *	Redistributions of source code must retain copyright notices,
+#	this list of conditions and the following disclaimer.
+#
+#      *	Redistributions in binary form must reproduce the above
+#	copyright notice, this list of conditions and the following
+#	disclaimer in the documentation and/or other materials
+#	provided with the distribution.
+#
+#      *	Neither the name of the CRYPTOGAMS nor the names of its
+#	copyright holder and contributors may be used to endorse or
+#	promote products derived from this software without specific
+#	prior written permission.
+#
+#ALTERNATIVELY, provided that this notice is retained in full, this
+#product may be distributed under the terms of the GNU General Public
+#License (GPL), in which case the provisions of the GPL apply INSTEAD OF
+#those given above.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS
+#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+##############################################################################
+#
+# September 2025
+#
+# This is a 100% vector length agnostic implementation and has
+# been tested with QEMU for the vector length of up to 2048 bits.
+#
+# On Graviton4, with the vector register length of 128 bits,
+# it is less efficient than the Neon implementation by only 6%.
+# This number has been obtained by running
+# `openssl speed -evp ChaCha20-POLY1305` and
+# `openssl speed -evp ChaCha20`, pinned to a single CPU,
+# converting the 8192-byte result to cycles per byte
+# using actual average runtime CPU frequency from `perf stat`,
+# and taking the difference. On Graviton 4, this results in
+# 0.62 cpb for Neon and 0.66 for SVE2.
+#
+# While Neon should probably be the default choice on a 128-bit architecture,
+# speed-up is clearly expected with 256-bit and larger vector registers
+# in the future.
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
+( $xlate="${dir}arm-xlate.pl" and -f $xlate ) or
+( $xlate="${dir}../../perlasm/arm-xlate.pl" and -f $xlate) or
+die "can't locate arm-xlate.pl";
+
+open OUT,"| \"$^X\" $xlate $flavour \"$output\""
+    or die "can't call $xlate: $!";
+*STDOUT=*OUT;
+
+my ($ctx,$inp,$len,$padbit) = map("x$_",(0..3));
+
+my ($h0,$h1,$h2,$r0,$r1,$r2,$t0,$t1,$d0,$d1,$d2) = map("x$_",(4..14));
+
+my ($SVE_R0,$SVE_R1,$SVE_S1,$SVE_R2,$SVE_S2,$SVE_R3,$SVE_S3,$SVE_R4,$SVE_S4) = map("z$_.s",(0..8));
+my ($SVE_INlo_0,$SVE_INlo_1,$SVE_INlo_2,$SVE_INlo_3,$SVE_INlo_4) = map("z$_.s",(9..13));
+my ($SVE_INhi_0,$SVE_INhi_1,$SVE_INhi_2,$SVE_INhi_3,$SVE_INhi_4) = map("z$_.s",(14..18));
+my ($SVE_ACC0,$SVE_ACC1,$SVE_ACC2,$SVE_ACC3,$SVE_ACC4) = map("z$_.d",(19..23));
+my ($SVE_H0,$SVE_H1,$SVE_H2,$SVE_H3,$SVE_H4) = map("z$_.s",(24..28));
+my ($SVE_T0,$SVE_T1,$SVE_MASK) = map("z$_",(29..31));
+
+my ($vl,$vl0,$vl1,$vl2,$vl3,$vl4) = ("x16",$h0,$h1,$h2,$r0,$r1);
+my ($cs0,$cs1,$cs2,$cs3,$cs4,$cs5) = map("x$_",(19..24));
+my ($pwr,$mask) = map("x$_",(25..26));
+my $is_base2_26 = "w17";
+
+$code.=<<___;
+#include "arch/arm_arch.h"
+
+.text
+
+.arch armv8-a
+
+.extern poly1305_blocks
+
+// --- poly1305_sw_2_26 ---
+// Performs conversion of 3 base2_44 to 5 base2_26 scalars and
+//  stores them in memory at addresses [x5], [x5,#28], [x5,#56],
+//  [x5,#84] and [x5,#112].
+//
+// This is a leaf function and does not modify stack.
+//
+// Calling Convention:
+//   Inputs:
+//     x5: Pointer into memory where 1st value should be stored.
+//     x7-x9: The three base2_44 scalar values (r0-r2)
+//   Clobbers (uses as temporaries):
+//     x10-x15
+.type	poly1305_sw_2_26,%function
+.align	5
+poly1305_sw_2_26:
+	// Converts 3 base2_44 -> 5 base2_26 values and stores
+	mov		x15,#0x3ffffff			// w15  : 2^26-1 mask
+	and		x10,$r0,x15				// w10 -> r0
+	lsr		x11,$r0,#26				// w11 : top 18 bits of r0
+	str		w10,[x5]				// Store r0
+	bfi		x11,$r1,#18,#8			// w11 -> r1
+	ubfx	x12,$r1,#8,#26			// w12 -> r2
+	str		w11,[x5,#28]			// Store r1
+	lsr		x13,$r1,#34				// w13 : top 10 bits of r1
+	str		w12,[x5,#56]			// Store r2
+	bfi		x13,$r2,#10,#16			// w13 -> r3
+	lsr		x14,$r2,#16				// w14 -> r4
+	str		w13,[x5,#84]			// Store r3
+	str		w14,[x5,#112]			// Store r4
+	ret
+.size   poly1305_sw_2_26,.-poly1305_sw_2_26
+
+// --- poly1305_sqr_2_44 ---
+// Calculates base2_44 squaring operation.
+//
+// This is a leaf function and does not modify stack.
+// It however uses callee-saved registers as scratch, so those must be
+//  saved on stack prior to calling.
+//
+// Calling Convention:
+//   Inputs:
+//     x7-x9: The three base2_44 scalar values (r0-r2)
+//   Outputs:
+//     x7-x9: The three base2_44 scalar values, squared (r0-r2)
+//   Clobbers (uses as temporaries):
+//     x10-x15, x19-x24, x26
+.type	poly1305_sqr_2_44,%function
+.align	5
+poly1305_sqr_2_44:
+
+    // Pre-calculate constants and doubled terms.
+	mov		x12,#20
+	lsl		x13,$r1,#1		// x13 = r1 * 2
+	mul		x12,$r2,x12		// x12 = r2 * 20
+	lsl		x10,$r0,#1		// x10 = r0 * 2
+
+    // --- Calculate d2 = r1*r1 + 2*r0*r2 ---
+	umulh	$cs5,$r1,$r1	// high part of r1*r1
+	mul		$cs4,$r1,$r1	// low part of r1*r1
+	umulh	x15,x10,$r2		// high part of (r0*2)*r2
+	mul		x14,x10,$r2		// low part of (r0*2)*r2
+
+    // --- Calculate d0 = r0*r0 + 20*(2*r1*r2) ---
+	umulh	$cs1,$r0,$r0	// high part of r0*r0
+	mul		$cs0,$r0,$r0	// low part of r0*r0
+	umulh	x11,x13,x12		// high part of (r1*2)*(r2*20)
+	mul		x10,x13,x12		// low part of (r1*2)*(r2*20)
+
+	adds	$cs4,$cs4,x14	// d2_lo
+	adc		$cs5,$cs5,x15	// d2_hi
+
+    // --- Calculate d1 = 2*r0*r1 + 20*r2*r2 ---
+    // d1 is a 128-bit result stored in x7:x6 (hi:lo)
+	umulh	$cs3,$r0,x13	// high part of r0*(r1*2)
+	mul		$cs2,$r0,x13	// low part of r0*(r1*2)
+	umulh	x13,$r2,x12		// high part of r2*(r2*20)
+	mul		x12,$r2,x12		// low part of r2*(r2*20)
+
+	adds	$cs0,$cs0,x10	// d0_lo
+	adc		$cs1,$cs1,x11	// d0_hi
+
+	adds	$cs2,$cs2,x12	// d1_lo
+	adc		$cs3,$cs3,x13	// d1_hi
+
+    // --- Reduction and Carry Propagation ---
+    // Reduce the 128-bit d0, d1, d2 back to three 44-bit limbs in x0, x1, x2
+	lsr		x10,$cs0,#44	// (d0_lo >> 44)
+	lsl		x11,$cs1,#20	// (d0_hi << 20) - high 20 bits are zero
+	and		$r0,$cs0,$mask	// r0 -> d0_lo & mask
+	orr		x10,x10,x11		// x10 -> 64-bit carry from d0
+
+	lsr		x12,$cs2,#44	// (d1_lo >> 44)
+	lsl		x13,$cs3,#20	// (d1_hi << 20)
+	and		$r1,$cs2,$mask	// r1 -> d1_lo & mask
+	orr		x12,x12,x13		// x12 -> 64-bit carry from d1
+	add		$r1,$r1,x10		// r1 += carry from d0
+
+	lsr		x11,$mask,#2	// x11 -> 2^42-1 mask for d2 reduction
+	lsr		x10,$cs4,#42	// (d2_lo >> 42)
+	lsl		x13,$cs5,#22	// (d2_hi << 22)
+	and		$r2,$cs4,x11	// r2 -> d2_lo & 2^42-1 mask
+	orr		x10,x10,x13		// x10 -> final carry from d2
+	add		$r2,$r2,x12		// r2 += carry from d1
+
+    // Handle ripple-carry from r2 and apply the *5 reduction.
+	lsr		x13,$r2,#42		// Get carry from r2 (if r2 >= 2^42)
+	and		$r2,$r2,x11		// Mask r2 back down to 42 bits
+	add		x10,x10,x13		// Add this ripple-carry to the final carry
+
+	add		x11,x10,x10,lsl #2	// x11 -> final_carry * 5
+	add		$r0,$r0,x11			// r0 += final_carry * 5
+
+    // Final ripple-carry chain to ensure all limbs are 44 bits.
+	lsr		x11,$r1,#44		// Get carry from r1
+	and		$r1,$r1,$mask	// Mask r1 to 44 bits
+	add		$r2,$r2,x11		// r2 += carry from r1
+
+	lsr		x10,$r0,#44		// Get carry from r0
+	and		$r0,$r0,$mask	// Mask r0 to 44 bits
+	add		$r1,$r1,x10		// r1 += carry from r0
+
+    ret
+.size	poly1305_sqr_2_44,.-poly1305_sqr_2_44
+
+// --- poly1305_lazy_reduce_sve2 ---
+// Performs lazy reduction on five accumulator vectors as discussed
+// in "NEON crypto" by D.J. Bernstein and P. Schwabe.
+//
+// This is a leaf function and does not modify GPRs or the stack.
+//
+// Calling Convention:
+//   Inputs:
+//     z19-z23: The five 64-bit .d accumulator vectors (ACC0-ACC4)
+//   Outputs:
+//     z24-z28: The five 32-bit .s final limb vectors (H0-H4)
+//     z31: All-zeros (resets mask)
+//   Clobbers (uses as temporaries):
+//     z29, z30
+
+.type	poly1305_lazy_reduce_sve2,%function
+.align	5
+poly1305_lazy_reduce_sve2:
+	dup 	${SVE_MASK}.d,#-1
+	lsr 	${SVE_T0}.d,$SVE_ACC3,#26
+	trn1	$SVE_H3,z22.s,z24.s					// reproducing Neon's `xtn` - treat ACC3 as a .s vector
+	lsr 	${SVE_MASK}.d,${SVE_MASK}.d,#38
+	lsr 	${SVE_T1}.d,$SVE_ACC0,#26
+	and 	$SVE_ACC0,$SVE_ACC0,${SVE_MASK}.d
+	add 	$SVE_ACC4,$SVE_ACC4,${SVE_T0}.d	    // h3 -> h4
+	// Neon's bic is replaced with &=$SVE_MASK (because of using even-indexed elements)
+	and 	z27.d,z27.d,${SVE_MASK}.d			// refer to SVE_H3 as .d
+	add 	$SVE_ACC1,$SVE_ACC1,${SVE_T1}.d	    // h0 -> h1
+
+	lsr 	${SVE_T0}.d,$SVE_ACC4,#26
+	trn1	$SVE_H4,z23.s,z24.s					// reproducing Neon's `xtn` - treat ACC4 as a .s vector
+	lsr 	${SVE_T1}.d,$SVE_ACC1,#26
+	trn1	$SVE_H1,z20.s,z24.s					// reproducing Neon's `xtn` - treat ACC1 as a .s vector
+	and 	z28.d,z28.d,${SVE_MASK}.d			// refer to SVE_H4 as .d
+	add 	$SVE_ACC2,$SVE_ACC2,${SVE_T1}.d	    // h1 -> h2
+
+	add 	$SVE_ACC0,$SVE_ACC0,${SVE_T0}.d
+	lsl 	${SVE_T0}.d,${SVE_T0}.d,#2
+	shrnb	${SVE_T1}.s,$SVE_ACC2,#26			// check it's OK
+	trn1	$SVE_H2,z21.s,z24.s					// reproducing Neon's `xtn` - treat ACC2 as a .s vector
+	add 	$SVE_ACC0,$SVE_ACC0,${SVE_T0}.d		// h4 -> h0
+	and 	z25.d,z25.d,${SVE_MASK}.d			// refer to SVE_H1 as .d
+	add 	$SVE_H3,$SVE_H3,${SVE_T1}.s			// h2 -> h3
+	and 	z26.d,z26.d,${SVE_MASK}.d			// refer to SVE_H2 as .d
+
+	shrnb	${SVE_T0}.s,$SVE_ACC0,#26
+	trn1	$SVE_H0,z19.s,z24.s					// reproducing Neon's `xtn` - treat ACC0 as a .s vector - re-writing H0 here...
+	lsr 	${SVE_T1}.s,$SVE_H3,#26
+	and 	z27.d,z27.d,${SVE_MASK}.d			// refer to SVE_H3 as .d
+	add 	$SVE_H1,$SVE_H1,${SVE_T0}.s			// h0 -> h1
+	and 	z24.d,z24.d,${SVE_MASK}.d			// refer to SVE_H0 as .d
+	add 	$SVE_H4,$SVE_H4,${SVE_T1}.s			// h3 -> h4
+
+	eor 	${SVE_MASK}.d,${SVE_MASK}.d,${SVE_MASK}.d	// reset zero mask
+
+    ret
+.size	poly1305_lazy_reduce_sve2,.-poly1305_lazy_reduce_sve2
+
+// --- poly1305_blocks_sve2 ---
+// Main function, implementing POLY1305 algorithm as discussed
+// in "NEON crypto" by D.J. Bernstein and P. Schwabe, in a VLA fashion,
+// using SVE2.
+//
+// It is mostly a port-and-merge of the 128-bit Neon implementation herein and
+//  a VLA risc-v implementation in https://github.com/dot-asm/cryptogams.
+//
+.globl	poly1305_blocks_sve2
+.hidden	poly1305_blocks_sve2
+.type	poly1305_blocks_sve2,%function
+.align	5
+poly1305_blocks_sve2:
+.Lpoly1305_blocks_sve2:
+	AARCH64_VALID_CALL_TARGET
+	ldr	$is_base2_26,[$ctx,#24]
+	// Estimate vector width and branch to scalar if input too short
+	cntd	$vl					// vector width in 64-bit lanes (vl)
+	lsl	$vl0,$vl,#4				// vl * 16 (bytes per vector input blocks)
+	add $vl1,$vl0,$vl0,lsl #1	// 3 * vl * 16 - new threshold.
+	cmp	$len,$vl1
+	b.hs	.Lblocks_sve2
+	cbz	$is_base2_26,.Lshort_blocks	// Call scalar f-n if short; if in base 2^26 - proceed
+
+.Lblocks_sve2:
+	AARCH64_SIGN_LINK_REGISTER
+	stp	x29,x30,[sp,#-144]!		// Allowing for callee-saved reg-s
+	add	x29,sp,#0
+
+	//Store some callee-saved GPRs
+	stp	x19,x20,[sp,#16]
+ 	stp	x21,x22,[sp,#32]
+ 	stp	x23,x24,[sp,#48]
+	stp	x25,x26,[sp,#64]
+
+	ands	$len,$len,#-16
+	b.eq	.Lno_data_sve2
+
+	cbz	$is_base2_26,.Lbase2_64_sve2
+
+	ldp	w10,w11,[$ctx]			// load hash value base 2^26
+	ldp	w12,w13,[$ctx,#8]
+	ldr	w14,[$ctx,#16]
+
+	neg	$vl1,$vl0				// - (vl * 16)
+	sub	$vl0,$vl0,#1			// (vl * 16) - 1
+	and	$vl2,$len,$vl1			// $len - ($len % (vl * 16)) -> VLA length
+	and	$vl4,$len,$vl0			// $len % (vl * 16) -> scalar remainder
+	cbz	$vl4,.Leven_sve2		// If no scalar "head", proceed to VLA
+	add	$vl3,$inp,$vl4			// Pointer to the start of the VLA data
+	stp	$vl2,$vl3,[sp,#-16]!	// Backup VLA length and ptr
+	mov	$len,$vl4				// So that scalar part knows it's length
+
+	add	$h0,x10,x11,lsl#26		// base 2^26 -> base 2^64
+	lsr	$h1,x12,#12
+	adds	$h0,$h0,x12,lsl#52
+	add	$h1,$h1,x13,lsl#14
+	adc	$h1,$h1,xzr
+	lsr	$h2,x14,#24
+	adds	$h1,$h1,x14,lsl#40
+	adc	$d2,$h2,xzr				// can be partially reduced...
+
+	and	$t0,$d2,#-4				// ... so reduce
+	and	$h2,$d2,#3
+	add	$t0,$t0,$d2,lsr#2
+	adds	$h0,$h0,$t0
+	adcs	$h1,$h1,xzr
+	adc	$h2,$h2,xzr
+
+	stp	$h0,$h1,[$ctx]			// store hash value base 2^64
+	str	$h2,[$ctx,#16]
+
+	bl	poly1305_blocks			// Calculate the scalar "head"
+	ldp	$len,$inp,[sp],#16		// Recover updated length and input ptr
+	ldr	x30,[sp,#8]
+
+	cbz	$padbit,.Lzero_padbit_sve2	// hash already stored in poly1305_blocks
+
+	ldp	$h0,$h1,[$ctx]			// load hash value base 2^64
+	ldr $h2,[$ctx,#16]
+
+	and	x10,$h0,#0x03ffffff		// base 2^64 -> base 2^26
+	ubfx	x11,$h0,#26,#26
+	extr	x12,$h1,$h0,#52
+	and	x12,x12,#0x03ffffff
+	ubfx	x13,$h1,#14,#26
+	extr	x14,$h2,$h1,#40
+
+	cbnz	$len,.Leven_sve2
+
+	stp	w10,w11,[$ctx]			// store hash value base 2^26
+	stp	w12,w13,[$ctx,#8]
+	str	w14,[$ctx,#16]
+	b	.Lno_data_sve2
+
+.align	4
+.Lzero_padbit_sve2:
+	str	xzr,[$ctx,#24]
+	b	.Lno_data_sve2
+
+.align	4
+.Lbase2_64_sve2:
+	neg	$vl1,$vl0				// - (vl * 16)
+	sub	$vl0,$vl0,#1			// (vl * 16) - 1
+	and	$vl2,$len,$vl1			// $len - ($len % (vl * 16)) -> VLA length
+	and	$vl4,$len,$vl0			// $len % (vl * 16) -> scalar remainder
+	cbz	$vl4,.Linit_sve2		// If no scalar "head", proceed to VLA
+	add	$vl3,$inp,$vl4			// Pointer to the start of the VLA data
+	stp	$vl2,$vl3,[sp,#-16]!	// Backup VLA length and ptr
+	mov	$len,$vl4				// So that scalar part knows it's length
+	bl	poly1305_blocks			// Calculate the scalar "head"
+	ldp	$len,$inp,[sp],#16		// Recover updated length and input ptr
+
+.Linit_sve2:
+	// Calculating and storing r-powers (powers of a key).
+	// The layout of how r-powers are stored in memory:
+	//////////////////////////////////////////////////////////////////////////////////////
+	//                   lobe 1                           lobe 2                   etc. //
+	//      | .. r^{max},r^{max/2},...,r^2,r | .. r^{max},r^{max/2},...,r^2,r | ..      //
+	//     / \                              / \                              / \        //
+	//  [$ctx,48]                       [$ctx,48+28]                     [$ctx,48+56]   //
+	//////////////////////////////////////////////////////////////////////////////////////
+
+	ldr w5,[$ctx,#28]		// Load top power (if exists - 0 by default)
+	add $pwr,$ctx,#48+28	// Point to the end of powers allocation (1st lobe)
+
+	mov $mask,#-1
+	lsr $mask,$mask,#20		//2^44-1
+
+	cbnz	w5,.Lpwrs_precomputed
+
+	ldp	$r0,$r1,[$ctx,#32]	// load key value
+
+	lsr	$r2,$r1,#24			// base2_64 -> base2_44
+	extr	$r1,$r1,$r0,#44
+	and	$r0,$r0,$mask
+	and	$r1,$r1,$mask
+
+	mov	x4,$vl
+	add	x5,$pwr,#-4
+	bl	poly1305_sw_2_26
+
+.Loop_pwrs_sqr:
+	lsr	x4,x4,#1
+	add	x5,x5,#-4
+	bl	poly1305_sqr_2_44
+	bl	poly1305_sw_2_26
+	cbnz	 x4,.Loop_pwrs_sqr
+
+	sub	x5,x5,$pwr
+	str	w5,[$ctx,#28]
+
+.Lpwrs_precomputed:
+	ldp	$h0,$h1,[$ctx]		// load hash value base 2^64
+	ldr $h2,[$ctx,#16]
+
+	and	x10,$h0,#0x03ffffff	// base 2^64 -> base 2^26
+	ubfx	x11,$h0,#26,#26
+	extr	x12,$h1,$h0,#52
+	and	x12,x12,#0x03ffffff
+	ubfx	x13,$h1,#14,#26
+	extr	x14,$h2,$h1,#40
+
+	stp	d8,d9,[sp,#80]		// meet ABI requirements
+	stp	d10,d11,[sp,#96]
+	stp	d12,d13,[sp,#112]
+	stp	d14,d15,[sp,#128]
+
+    // Zeroing H0-H4 registers
+	eor 	z24.d,z24.d,z24.d  // H0
+	eor 	z25.d,z25.d,z25.d  // H1
+	eor 	z26.d,z26.d,z26.d  // H2
+	eor 	z27.d,z27.d,z27.d  // H3
+	eor 	z28.d,z28.d,z28.d  // H4
+
+	// Using Neon's fmov here for speed.
+	//  We only need the low 26 bits in the first step so no need for post-mov reshuffle.
+	fmov	d24,x10		// H0
+	fmov	d25,x11		// H1
+	fmov	d26,x12		// H2
+	fmov	d27,x13		// H3
+	fmov	d28,x14		// H4
+
+	ldr	x30,[sp,#8]
+
+	mov	x4,#1
+	stur	w4,[$ctx,#24]		// set is_base2_26
+	b	.Ldo_sve2
+
+.align	4
+.Leven_sve2:
+	// In principle all this could be moved to Ldo_sve2
+	stp	d8,d9,[sp,#80]		// meet ABI requirements
+	stp	d10,d11,[sp,#96]
+	stp	d12,d13,[sp,#112]
+	stp	d14,d15,[sp,#128]
+
+	eor 	z24.d,z24.d,z24.d  // H0
+	eor 	z25.d,z25.d,z25.d  // H1
+	eor 	z26.d,z26.d,z26.d  // H2
+	eor 	z27.d,z27.d,z27.d  // H3
+	eor 	z28.d,z28.d,z28.d  // H4
+
+	fmov	d24,x10		// H0
+	fmov	d25,x11		// H1
+	fmov	d26,x12		// H2
+	fmov	d27,x13		// H3
+	fmov	d28,x14		// H4
+
+.Ldo_sve2:
+    ptrue   p0.b, ALL               		// Set all-true predicate
+
+	// Load r-powers.
+	// They are stored in five lobes, in the order r^{max},...,r^2,r^1 each.
+	// We need specific powers to be at specific R- and S-vector indices.
+	// Hence we can't load all of them, an arbitrary amount, dependent on VL.
+	// Instead we load {r^{max},r^{max/2}} and {r^2,r^1} in batches,
+	//  and then interleave them using zip1 as {r^{max},r^2,r^{max/2},r}.
+	// We don't really care where r^{max} and r^{max/2} are, but we want
+	//  r^2 and r to be in either even or odd lanes. We chose lanes 1 and 3.
+	// Intermediate r-powers (r^{max/4},..,r^4), if applicable, will be
+	//  reloaded into lane 0 iteratively in Loop_reduce_sve2.
+
+	ldr 	w5,[$ctx,#28]
+	sxtw	x5,w5				// Zero-extend
+	add 	$pwr,$ctx,#48+28	// Pointer to the end of the r-powers 1st lobe
+	add		x10,$ctx,#48+20		// Pointer to r^2.
+	add		$pwr,$pwr,x5		// Pointer to the r^{max}
+
+	mov		x15,#2
+	whilelo	p1.s,xzr,x15
+
+	// If wouldn't need to load in two chunks, could use ld1rqw -
+	//  optimisation potential for 256-bit vector.
+	ld1w	{ $SVE_R0 },p1/z,[$pwr]
+	ld1w	{ $SVE_T0.s },p1/z,[x10]
+	add		$pwr,$pwr,#28
+	add		x10,x10,#28
+	zip1	$SVE_R0,$SVE_R0,$SVE_T0.s
+
+	ld1w	{ $SVE_R1 },p1/z,[$pwr]
+	ld1w	{ $SVE_T1.s },p1/z,[x10]
+	add		$pwr,$pwr,#28
+	add		x10,x10,#28
+	zip1	$SVE_R1,$SVE_R1,$SVE_T1.s
+
+	ld1w	{ $SVE_R2 },p1/z,[$pwr]
+	ld1w	{ $SVE_T0.s },p1/z,[x10]
+	add		$pwr,$pwr,#28
+	add		x10,x10,#28
+	zip1	$SVE_R2,$SVE_R2,$SVE_T0.s
+
+	ld1w	{ $SVE_R3 },p1/z,[$pwr]
+	ld1w	{ $SVE_T1.s },p1/z,[x10]
+	add		$pwr,$pwr,#28
+	add		x10,x10,#28
+	zip1	$SVE_R3,$SVE_R3,$SVE_T1.s
+
+	ld1w	{ $SVE_R4 },p1/z,[$pwr]
+	ld1w	{ $SVE_T0.s },p1/z,[x10]
+	sub		$pwr,$pwr,#104				// Adjust to 1st lobe, 3d power
+	zip1	$SVE_R4,$SVE_R4,$SVE_T0.s
+
+	// Broadcast r-powers loaded above to higher parts of the R-vectors.
+	cmp		$vl,#2
+	b.eq	.L_skip_dup_broadcast
+	dup		z0.q,z0.q[0]
+	dup		z1.q,z1.q[0]
+	dup		z3.q,z3.q[0]
+	dup		z5.q,z5.q[0]
+	dup		z7.q,z7.q[0]
+
+.L_skip_dup_broadcast:
+	// Calculate S-vectors (r^x*5)
+	adr     $SVE_S1,[$SVE_R1,$SVE_R1,lsl #2]
+	adr     $SVE_S2,[$SVE_R2,$SVE_R2,lsl #2]
+	adr     $SVE_S3,[$SVE_R3,$SVE_R3,lsl #2]
+	adr     $SVE_S4,[$SVE_R4,$SVE_R4,lsl #2]
+
+	// Load initial input blocks
+	lsr		x15,$len,#4
+	whilelo	p1.s,xzr,x15					// Set predicate for blocks loading
+	lsl	$padbit,$padbit,#24
+	ld4w	{ z9.s-z12.s },p1/z,[$inp]		// Loading all blocks at once
+
+#ifdef  __AARCH64EB__
+	revb	z9.s,  p0/m, z9.s
+	revb	z10.s, p0/m, z10.s
+	revb	z11.s, p0/m, z11.s
+	revb	z12.s, p0/m, z12.s
+#endif
+
+	// In-vector (VLA) conversion base2_64 -> base2_26.
+	dup 	${SVE_MASK}.s,#-1
+	lsr 	${SVE_MASK}.s,${SVE_MASK}.s,#6
+
+	lsr		${SVE_T0}.s,z11.s,#14		// T0 -> z11 >> 14
+	lsr		z13.s,z12.s,#8				// z13 -> l4
+	lsl		z11.s,z11.s,#12				// z11 -> upper part of l2
+	lsl		z12.s,z12.s,#18				// z12 -> upper part of l3
+	lsr		${SVE_T1}.s,z10.s,#20		// T1 -> z10 >> 20
+	orr		z12.d,z12.d,${SVE_T0}.d		// z12 -> final l3
+	lsl		z10.s,z10.s,#6				// z10 -> upper part of l1
+	lsr		${SVE_T0}.s,z9.s,#26		// T0 -> z9 >> 26
+	and		z9.d,z9.d,${SVE_MASK}.d		// z9 is now final l0
+	orr		z11.d,z11.d,${SVE_T1}.d		// z11 -> final l2
+	orr		z10.d,z10.d,${SVE_T0}.d		// z10 -> final l1
+	dup		${SVE_T1}.s,w3				// x3 -> $padbit but need it as a word
+	eor 	${SVE_T0}.d,${SVE_T0}.d,${SVE_T0}.d	// set zero mask
+	orr		z13.d,z13.d,${SVE_T1}.d		// l4 += padbit
+	and		z12.d,z12.d,${SVE_MASK}.d	// Mask l3
+	and		z11.d,z11.d,${SVE_MASK}.d	// Mask l2
+	and		z10.d,z10.d,${SVE_MASK}.d	// Mask l1
+
+
+	// Move high blocks from INlo -> INhi and sparcify (put in even lanes)
+	zip2	z14.s,z9.s,${SVE_T0}.s
+	zip2	z18.s,z13.s,${SVE_T0}.s
+	zip2	z17.s,z12.s,${SVE_T0}.s
+	zip2	z16.s,z11.s,${SVE_T0}.s
+	zip2	z15.s,z10.s,${SVE_T0}.s
+
+	// Sparcify blocks to even lanes in INlo
+	zip1	z9.s,z9.s,${SVE_T0}.s
+	zip1	z13.s,z13.s,${SVE_T0}.s
+	zip1	z12.s,z12.s,${SVE_T0}.s
+	zip1	z11.s,z11.s,${SVE_T0}.s
+	zip1	z10.s,z10.s,${SVE_T0}.s
+
+	subs	$len,$len,$vl,lsl #5		// By half vector width * 32
+
+	b.ls	.Lskip_loop_sve2
+
+.align	4
+.Loop_sve2:
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	// ((inp[0]*r^{vl*2} + inp[vl]  *r^{vl} + inp[2*vl]  )*r^{vl} + inp[3*vl]  )*r^{vl}
+	//+((inp[1]*r^{vl*2} + inp[vl+1]*r^{vl} + inp[2*vl+1])*r^{vl} + inp[3*vl+1])*r^{vl-1}
+	//+...
+	//   \_______________________________/    \_________________________________________/
+	//      first main loop iteration                       long tail
+	//
+	// ((inp[0]*r^{vl*2} + inp[vl]  *r^{vl} + inp[2*vl]  )*r^{vl*2} + inp[3*vl]  *r^{vl} + inp[4*vl]  )*r^{vl}
+	//+((inp[1]*r^{vl*2} + inp[vl+1]*r^{vl} + inp[2*vl+1])*r^{vl*2} + inp[3*vl+1]*r^{vl} + inp[4*vl+1])*r^{vl-1}
+	//+...
+	//   \_______________________________/    \________________________________________/   \___________________/
+	//      first main loop iteration             second main loop iteration                    short tail
+	//
+	// Note that we start with inp[vl:vl*2]*r^{vl}, as it
+	// doesn't depend on reduction in previous iteration.
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	// Hash-key power product f-la for the 5 limbs in base2^26 representation:
+	// d4 = h0*r4 + h1*r3   + h2*r2   + h3*r1   + h4*r0
+	// d3 = h0*r3 + h1*r2   + h2*r1   + h3*r0   + h4*5*r4
+	// d2 = h0*r2 + h1*r1   + h2*r0   + h3*5*r4 + h4*5*r3
+	// d1 = h0*r1 + h1*r0   + h2*5*r4 + h3*5*r3 + h4*5*r2
+	// d0 = h0*r0 + h1*5*r4 + h2*5*r3 + h3*5*r2 + h4*5*r1
+
+	add		$inp,$inp,$vl,lsl #5
+
+	umullb	$SVE_ACC4,$SVE_INhi_0,${SVE_R4}[2]
+	umullb	$SVE_ACC3,$SVE_INhi_0,${SVE_R3}[2]
+	umullb	$SVE_ACC2,$SVE_INhi_0,${SVE_R2}[2]
+	umullb	$SVE_ACC1,$SVE_INhi_0,${SVE_R1}[2]
+	umullb	$SVE_ACC0,$SVE_INhi_0,${SVE_R0}[2]
+
+	umlalb	$SVE_ACC4,$SVE_INhi_1,${SVE_R3}[2]
+	umlalb	$SVE_ACC3,$SVE_INhi_1,${SVE_R2}[2]
+	umlalb	$SVE_ACC2,$SVE_INhi_1,${SVE_R1}[2]
+	umlalb	$SVE_ACC1,$SVE_INhi_1,${SVE_R0}[2]
+	umlalb	$SVE_ACC0,$SVE_INhi_1,${SVE_S4}[2]
+
+	umlalb	$SVE_ACC4,$SVE_INhi_2,${SVE_R2}[2]
+	umlalb	$SVE_ACC3,$SVE_INhi_2,${SVE_R1}[2]
+	umlalb	$SVE_ACC2,$SVE_INhi_2,${SVE_R0}[2]
+	umlalb	$SVE_ACC1,$SVE_INhi_2,${SVE_S4}[2]
+	umlalb	$SVE_ACC0,$SVE_INhi_2,${SVE_S3}[2]
+
+	umlalb	$SVE_ACC4,$SVE_INhi_3,${SVE_R1}[2]
+	umlalb	$SVE_ACC3,$SVE_INhi_3,${SVE_R0}[2]
+	umlalb	$SVE_ACC2,$SVE_INhi_3,${SVE_S4}[2]
+	umlalb	$SVE_ACC1,$SVE_INhi_3,${SVE_S3}[2]
+	umlalb	$SVE_ACC0,$SVE_INhi_3,${SVE_S2}[2]
+
+	add 	$SVE_INlo_2,$SVE_INlo_2,$SVE_H2
+	umlalb	$SVE_ACC4,$SVE_INhi_4,${SVE_R0}[2]
+	umlalb	$SVE_ACC3,$SVE_INhi_4,${SVE_S4}[2]
+	umlalb	$SVE_ACC2,$SVE_INhi_4,${SVE_S3}[2]
+	umlalb	$SVE_ACC1,$SVE_INhi_4,${SVE_S2}[2]
+	umlalb	$SVE_ACC0,$SVE_INhi_4,${SVE_S1}[2]
+
+	//////////////////////////////////////////////////////////////////////
+	// (hash+inp[0:vl])*r^{vl*2} and accumulate
+	// Interleave add+mul with loading and converting the next input batch
+
+	add 	$SVE_INlo_0,$SVE_INlo_0,$SVE_H0
+	 lsr	x15,$len,#4
+	umlalb	$SVE_ACC3,$SVE_INlo_2,${SVE_R1}[0]
+	 whilelo	p1.s,xzr,x15
+	umlalb	$SVE_ACC0,$SVE_INlo_2,${SVE_S3}[0]
+	 ld4w	{ z14.s-z17.s }, p1/z, [$inp]
+	umlalb	$SVE_ACC4,$SVE_INlo_2,${SVE_R2}[0]
+	umlalb	$SVE_ACC1,$SVE_INlo_2,${SVE_S4}[0]
+	umlalb	$SVE_ACC2,$SVE_INlo_2,${SVE_R0}[0]
+
+#ifdef  __AARCH64EB__
+	revb	z14.s, p0/m, z14.s
+	revb	z15.s, p0/m, z15.s
+	revb	z16.s, p0/m, z16.s
+	revb	z17.s, p0/m, z17.s
+#endif
+
+	add 	$SVE_INlo_1,$SVE_INlo_1,$SVE_H1
+	 dup 	${SVE_MASK}.s,#-1
+	umlalb	$SVE_ACC3,$SVE_INlo_0,${SVE_R3}[0]
+	 lsr 	${SVE_MASK}.s,${SVE_MASK}.s,#6
+	umlalb	$SVE_ACC4,$SVE_INlo_0,${SVE_R4}[0]
+	 lsr	${SVE_T0}.s,z16.s,#14		// T0 -> z16 >> 14
+	umlalb	$SVE_ACC2,$SVE_INlo_0,${SVE_R2}[0]
+	 lsr	z18.s,z17.s,#8				// z18 -> l4
+	umlalb	$SVE_ACC0,$SVE_INlo_0,${SVE_R0}[0]
+	 lsl	z16.s,z16.s,#12				// z16 -> upper part of l2
+	umlalb	$SVE_ACC1,$SVE_INlo_0,${SVE_R1}[0]
+	 lsl	z17.s,z17.s,#18				// z17 -> upper part of l3
+
+	add 	$SVE_INlo_3,$SVE_INlo_3,$SVE_H3
+	 lsr	${SVE_T1}.s,z15.s,#20		// T1 -> z15 >> 20
+	umlalb	$SVE_ACC3,$SVE_INlo_1,${SVE_R2}[0]
+	 orr	z17.d,z17.d,${SVE_T0}.d		// z17 -> final l3
+	umlalb	$SVE_ACC4,$SVE_INlo_1,${SVE_R3}[0]
+	 lsl	z15.s,z15.s,#6				// z15 -> upper part of l1
+	umlalb	$SVE_ACC0,$SVE_INlo_1,${SVE_S4}[0]
+	 lsr	${SVE_T0}.s,z14.s,#26		// T0 -> z14 >> 26
+	umlalb	$SVE_ACC2,$SVE_INlo_1,${SVE_R1}[0]
+	 and	z14.d,z14.d,${SVE_MASK}.d	// z14 is now final l0
+	umlalb	$SVE_ACC1,$SVE_INlo_1,${SVE_R0}[0]
+	 orr	z16.d,z16.d,${SVE_T1}.d		// z16 -> final l2
+
+	add 	$SVE_INlo_4,$SVE_INlo_4,$SVE_H4
+	 orr	z15.d,z15.d,${SVE_T0}.d		// z15 -> final l1
+	umlalb	$SVE_ACC3,$SVE_INlo_3,${SVE_R0}[0]
+	 dup	${SVE_T1}.s,w3
+	umlalb	$SVE_ACC0,$SVE_INlo_3,${SVE_S2}[0]
+	 eor 	${SVE_T0}.d,${SVE_T0}.d,${SVE_T0}.d	// set zero mask
+	umlalb	$SVE_ACC4,$SVE_INlo_3,${SVE_R1}[0]
+	 orr	z18.d,z18.d,${SVE_T1}.d		// l4 += padbit
+	umlalb	$SVE_ACC1,$SVE_INlo_3,${SVE_S3}[0]
+	 and	z17.d,z17.d,${SVE_MASK}.d	// Mask l3
+	umlalb	$SVE_ACC2,$SVE_INlo_3,${SVE_S4}[0]
+	 and	z16.d,z16.d,${SVE_MASK}.d	// Mask l2
+
+	umlalb	$SVE_ACC3,$SVE_INlo_4,${SVE_S4}[0]
+	 and	z15.d,z15.d,${SVE_MASK}.d	// Mask l1
+	umlalb	$SVE_ACC0,$SVE_INlo_4,${SVE_S1}[0]
+	 zip1	z9.s,z14.s,${SVE_T0}.s
+	umlalb	$SVE_ACC4,$SVE_INlo_4,${SVE_R0}[0]
+	 zip1	z10.s,z15.s,${SVE_T0}.s
+	umlalb	$SVE_ACC1,$SVE_INlo_4,${SVE_S2}[0]
+	 zip1	z11.s,z16.s,${SVE_T0}.s
+	umlalb	$SVE_ACC2,$SVE_INlo_4,${SVE_S3}[0]
+	 zip1	z12.s,z17.s,${SVE_T0}.s
+	 zip1	z13.s,z18.s,${SVE_T0}.s
+
+	// Sparcify blocks to even lanes in INlo
+	zip2	z14.s,z14.s,${SVE_T0}.s
+	zip2	z15.s,z15.s,${SVE_T0}.s
+	zip2	z16.s,z16.s,${SVE_T0}.s
+	zip2	z17.s,z17.s,${SVE_T0}.s
+	zip2	z18.s,z18.s,${SVE_T0}.s
+
+	subs	$len,$len,$vl,lsl #5
+
+	// Lazy reduction
+	bl		poly1305_lazy_reduce_sve2
+	ldr	x30,[sp,#8]
+
+	b.hi	.Loop_sve2
+
+.Lskip_loop_sve2:
+
+	adds	$len,$len,$vl,lsl #4		// By half the usual input size
+	b.eq	.Lshort_tail_sve2
+
+.Long_tail_sve2:
+	////////////////////////////////////////////////////////////////
+	// (hash + inp[lo])*r^{vl} + inp[hi])*r^{vl..1}               //
+	//  \____________________/                                    //
+	//  first part of long tail                                   //
+	////////////////////////////////////////////////////////////////
+	//NB `vl` here (and in the code) is the vector length in double words.
+	// Intereaving algebra with copying INhi -> INlo for the next steps.
+
+	add 	$SVE_INlo_2,$SVE_INlo_2,$SVE_H2
+	add 	$SVE_INlo_0,$SVE_INlo_0,$SVE_H0
+	add 	$SVE_INlo_1,$SVE_INlo_1,$SVE_H1
+	add 	$SVE_INlo_3,$SVE_INlo_3,$SVE_H3
+	add 	$SVE_INlo_4,$SVE_INlo_4,$SVE_H4
+
+	umullb	$SVE_ACC3,$SVE_INlo_2,${SVE_R1}[2]
+	umullb	$SVE_ACC0,$SVE_INlo_2,${SVE_S3}[2]
+	umullb	$SVE_ACC4,$SVE_INlo_2,${SVE_R2}[2]
+	umullb	$SVE_ACC1,$SVE_INlo_2,${SVE_S4}[2]
+	umullb	$SVE_ACC2,$SVE_INlo_2,${SVE_R0}[2]
+
+	umlalb	$SVE_ACC3,$SVE_INlo_0,${SVE_R3}[2]
+	umlalb	$SVE_ACC4,$SVE_INlo_0,${SVE_R4}[2]
+	umlalb	$SVE_ACC2,$SVE_INlo_0,${SVE_R2}[2]
+	umlalb	$SVE_ACC0,$SVE_INlo_0,${SVE_R0}[2]
+	umlalb	$SVE_ACC1,$SVE_INlo_0,${SVE_R1}[2]
+	mov		z11.d,z16.d
+
+	umlalb	$SVE_ACC3,$SVE_INlo_1,${SVE_R2}[2]
+	umlalb	$SVE_ACC4,$SVE_INlo_1,${SVE_R3}[2]
+	umlalb	$SVE_ACC0,$SVE_INlo_1,${SVE_S4}[2]
+	umlalb	$SVE_ACC2,$SVE_INlo_1,${SVE_R1}[2]
+	umlalb	$SVE_ACC1,$SVE_INlo_1,${SVE_R0}[2]
+	mov		z9.d,z14.d
+
+	umlalb	$SVE_ACC3,$SVE_INlo_3,${SVE_R0}[2]
+	umlalb	$SVE_ACC0,$SVE_INlo_3,${SVE_S2}[2]
+	umlalb	$SVE_ACC4,$SVE_INlo_3,${SVE_R1}[2]
+	umlalb	$SVE_ACC1,$SVE_INlo_3,${SVE_S3}[2]
+	umlalb	$SVE_ACC2,$SVE_INlo_3,${SVE_S4}[2]
+	mov		z10.d,z15.d
+
+	umlalb	$SVE_ACC3,$SVE_INlo_4,${SVE_S4}[2]
+	umlalb	$SVE_ACC0,$SVE_INlo_4,${SVE_S1}[2]
+	umlalb	$SVE_ACC4,$SVE_INlo_4,${SVE_R0}[2]
+	umlalb	$SVE_ACC1,$SVE_INlo_4,${SVE_S2}[2]
+	umlalb	$SVE_ACC2,$SVE_INlo_4,${SVE_S3}[2]
+	mov		z12.d,z17.d
+
+	// Lazy reduction
+	bl		poly1305_lazy_reduce_sve2
+	ldr	x30,[sp,#8]
+
+	mov		z13.d,z18.d
+
+.Lshort_tail_sve2:
+
+	cmp     $vl, #2
+    b.ls    .Last_reduce_sve2
+
+	mov		x15,#1
+	whilelo p1.s,xzr,x15
+
+.Loop_reduce_sve2:
+	////////////////////////////////////////////////////////////////
+	// (hash + inp[hi])*r^{vl/2..2}                               //
+	//       \____________________/                               //
+	//  iterative reduction part of the short tail                //
+	////////////////////////////////////////////////////////////////
+	// Last column of products is calculated by iteratively "folding" vectors:
+	// 1. If vl==2 - skip to Last_reduce_sve2
+	// 2. calculate product with r^{vl/2} -> ACC{0-4}
+	// 3. lazy reduction -> H{0-4}
+	// 4. upper half of vectors (INlo{0-4}) is copied to lower halves
+	// 5. If vl/2==2 - go to Last_reduce_sve2
+	// 6. continue with 2.
+	// NB: this part is skipped for 128-bit case (vl==2)
+	// For 256-bit, no intermediate loading is necessary - r^2 is already in [1].
+	//  So a special case can be easily implemented, when corresponding hardware is available.
+
+	// Load the intermediate r-power into the 0th lanes of vectors
+	// Interleave with broadcasting and S-vector calculation.
+	ldr		w10,[$pwr]
+	ldr		w11,[$pwr,#28]
+	ldr		w12,[$pwr,#56]
+	cpy		$SVE_R0,p1/m,w10
+	ldr		w13,[$pwr,#84]
+	cpy		$SVE_R1,p1/m,w11
+	dup		z0.q,z0.q[0]
+	ldr		w14,[$pwr,#112]
+	cpy		$SVE_R2,p1/m,w12
+	dup		z1.q,z1.q[0]
+	cpy		$SVE_R3,p1/m,w13
+	dup		z3.q,z3.q[0]
+	cpy		$SVE_R4,p1/m,w14
+	add		$pwr,$pwr,#4			// Increment pointer for the next iteration
+	dup		z5.q,z5.q[0]
+	dup		z7.q,z7.q[0]
+
+	// Interleaved hash contraction and S-vector calc.
+	add 	$SVE_INlo_2,$SVE_INlo_2,$SVE_H2
+	adr     $SVE_S1,[$SVE_R1,$SVE_R1,lsl #2]
+	add 	$SVE_INlo_0,$SVE_INlo_0,$SVE_H0
+	adr     $SVE_S2,[$SVE_R2,$SVE_R2,lsl #2]
+	add 	$SVE_INlo_1,$SVE_INlo_1,$SVE_H1
+	adr     $SVE_S3,[$SVE_R3,$SVE_R3,lsl #2]
+	add 	$SVE_INlo_3,$SVE_INlo_3,$SVE_H3
+	adr     $SVE_S4,[$SVE_R4,$SVE_R4,lsl #2]
+	add 	$SVE_INlo_4,$SVE_INlo_4,$SVE_H4
+
+	umullb	$SVE_ACC3,$SVE_INlo_0,${SVE_R3}[0]
+	umullb	$SVE_ACC4,$SVE_INlo_0,${SVE_R4}[0]
+	umullb	$SVE_ACC2,$SVE_INlo_0,${SVE_R2}[0]
+	umullb	$SVE_ACC0,$SVE_INlo_0,${SVE_R0}[0]
+	umullb	$SVE_ACC1,$SVE_INlo_0,${SVE_R1}[0]
+
+	umlalb	$SVE_ACC3,$SVE_INlo_1,${SVE_R2}[0]
+	umlalb	$SVE_ACC4,$SVE_INlo_1,${SVE_R3}[0]
+	umlalb	$SVE_ACC0,$SVE_INlo_1,${SVE_S4}[0]
+	umlalb	$SVE_ACC2,$SVE_INlo_1,${SVE_R1}[0]
+	umlalb	$SVE_ACC1,$SVE_INlo_1,${SVE_R0}[0]
+
+	umlalb	$SVE_ACC3,$SVE_INlo_2,${SVE_R1}[0]
+	umlalb	$SVE_ACC0,$SVE_INlo_2,${SVE_S3}[0]
+	umlalb	$SVE_ACC4,$SVE_INlo_2,${SVE_R2}[0]
+	umlalb	$SVE_ACC1,$SVE_INlo_2,${SVE_S4}[0]
+	umlalb	$SVE_ACC2,$SVE_INlo_2,${SVE_R0}[0]
+
+	umlalb	$SVE_ACC3,$SVE_INlo_3,${SVE_R0}[0]
+	umlalb	$SVE_ACC0,$SVE_INlo_3,${SVE_S2}[0]
+	umlalb	$SVE_ACC4,$SVE_INlo_3,${SVE_R1}[0]
+	umlalb	$SVE_ACC1,$SVE_INlo_3,${SVE_S3}[0]
+	umlalb	$SVE_ACC2,$SVE_INlo_3,${SVE_S4}[0]
+
+	umlalb	$SVE_ACC3,$SVE_INlo_4,${SVE_S4}[0]
+	umlalb	$SVE_ACC0,$SVE_INlo_4,${SVE_S1}[0]
+	umlalb	$SVE_ACC4,$SVE_INlo_4,${SVE_R0}[0]
+	umlalb	$SVE_ACC1,$SVE_INlo_4,${SVE_S2}[0]
+	umlalb	$SVE_ACC2,$SVE_INlo_4,${SVE_S3}[0]
+
+	// Lazy reduction
+	bl		poly1305_lazy_reduce_sve2
+	ldr	x30,[sp,#8]
+
+	// Move higher part of vectors to lower part, depending on current vl
+	// NB look-up is done in terms of single-word lanes, hence indices
+	//  start from vl (refer to as w16) and not vl/2
+	// Higher part now contains "junk"
+	index	${SVE_T0}.s,w16,#1
+	tbl		${SVE_INlo_0},${SVE_INlo_0},${SVE_T0}.s
+	tbl		${SVE_INlo_1},${SVE_INlo_1},${SVE_T0}.s
+	tbl		${SVE_INlo_2},${SVE_INlo_2},${SVE_T0}.s
+	tbl		${SVE_INlo_3},${SVE_INlo_3},${SVE_T0}.s
+	tbl		${SVE_INlo_4},${SVE_INlo_4},${SVE_T0}.s
+	lsr		$vl,$vl,#1		// vl /= 2
+	cmp 	$vl,#2
+	b.hi	.Loop_reduce_sve2
+
+.Last_reduce_sve2:
+	////////////////////////////////////////////////////////////////
+	// (hash + inp[n-1])*r^2                                      //
+	//+(hash + inp[n]  )*r                                        //
+	//       \_____________/                                      //
+	//  Final part of the short tail                              //
+	////////////////////////////////////////////////////////////////
+
+	//Last hash addition - now everything stored in SVE_Hx
+	add 	$SVE_H2,$SVE_H2,$SVE_INlo_2
+	add 	$SVE_H0,$SVE_H0,$SVE_INlo_0
+	add 	$SVE_H1,$SVE_H1,$SVE_INlo_1
+	add 	$SVE_H3,$SVE_H3,$SVE_INlo_3
+	add 	$SVE_H4,$SVE_H4,$SVE_INlo_4
+
+	// Shift even lanes to odd lanes and set even to zero
+	//  because r^2 and r^1 are in lanes 1 and 3 of R-vectors
+	trn1	$SVE_H2,${SVE_MASK}.s,$SVE_H2
+	trn1	$SVE_H0,${SVE_MASK}.s,$SVE_H0
+	trn1	$SVE_H1,${SVE_MASK}.s,$SVE_H1
+	trn1	$SVE_H3,${SVE_MASK}.s,$SVE_H3
+	trn1	$SVE_H4,${SVE_MASK}.s,$SVE_H4
+
+	umullt	$SVE_ACC3,$SVE_H2,${SVE_R1}
+	umullt	$SVE_ACC0,$SVE_H2,${SVE_S3}
+	umullt	$SVE_ACC4,$SVE_H2,${SVE_R2}
+	umullt	$SVE_ACC1,$SVE_H2,${SVE_S4}
+	umullt	$SVE_ACC2,$SVE_H2,${SVE_R0}
+
+	umlalt	$SVE_ACC3,$SVE_H0,${SVE_R3}
+	umlalt	$SVE_ACC4,$SVE_H0,${SVE_R4}
+	umlalt	$SVE_ACC2,$SVE_H0,${SVE_R2}
+	umlalt	$SVE_ACC0,$SVE_H0,${SVE_R0}
+	umlalt	$SVE_ACC1,$SVE_H0,${SVE_R1}
+
+	umlalt	$SVE_ACC3,$SVE_H1,${SVE_R2}
+	umlalt	$SVE_ACC4,$SVE_H1,${SVE_R3}
+	umlalt	$SVE_ACC0,$SVE_H1,${SVE_S4}
+	umlalt	$SVE_ACC2,$SVE_H1,${SVE_R1}
+	umlalt	$SVE_ACC1,$SVE_H1,${SVE_R0}
+
+	umlalt	$SVE_ACC3,$SVE_H3,${SVE_R0}
+	umlalt	$SVE_ACC0,$SVE_H3,${SVE_S2}
+	umlalt	$SVE_ACC4,$SVE_H3,${SVE_R1}
+	umlalt	$SVE_ACC1,$SVE_H3,${SVE_S3}
+	umlalt	$SVE_ACC2,$SVE_H3,${SVE_S4}
+
+	umlalt	$SVE_ACC3,$SVE_H4,${SVE_S4}
+	umlalt	$SVE_ACC0,$SVE_H4,${SVE_S1}
+	umlalt	$SVE_ACC4,$SVE_H4,${SVE_R0}
+	umlalt	$SVE_ACC1,$SVE_H4,${SVE_S2}
+	umlalt	$SVE_ACC2,$SVE_H4,${SVE_S3}
+
+	// Generate predicate for the last two double words
+	mov		x15,#2
+	whilelo p2.d,xzr,x15
+
+	dup 	${SVE_MASK}.d,#-1
+	lsr 	${SVE_MASK}.d,${SVE_MASK}.d,#38
+
+	////////////////////////////////////////////////////////////////
+	// horizontal add
+
+	//In Neon implementation, one effectively using lower 64 bits of vector registers here.
+	//Here and below I use hard-coded FP registers.
+
+	uaddv	d22,p2,$SVE_ACC3
+	 ldp	d8,d9,[sp,#80]		// meet ABI requirements
+	uaddv	d19,p2,$SVE_ACC0
+	 ldp	d10,d11,[sp,#96]
+	uaddv	d23,p2,$SVE_ACC4
+	 ldp	d12,d13,[sp,#112]
+	uaddv	d20,p2,$SVE_ACC1
+	 ldp	d14,d15,[sp,#128]
+	uaddv	d21,p2,$SVE_ACC2
+
+	////////////////////////////////////////////////////////////////
+	// Lazy reduction, but without narrowing
+
+	// Since results were accumulated in the lower 64 bits,
+	//  one can refer to them as FP/aSIMD reg-s.
+
+	ushr	d29,d22,#26
+	and 	v22.8b,v22.8b,v31.8b
+	ushr	d30,d19,#26
+	and 	v19.8b,v19.8b,v31.8b
+
+	add 	d23,d23,d29				// h3 -> h4
+	add 	d20,d20,d30				// h0 -> h1
+
+	ushr	d29,d23,#26
+	and 	v23.8b,v23.8b,v31.8b
+	ushr	d30,d20,#26
+	and 	v20.8b,v20.8b,v31.8b
+	add 	d21,d21,d30				// h1 -> h2
+
+	add 	d19,d19,d29
+	shl 	d29,d29,#2
+	ushr	d30,d21,#26
+	and 	v21.8b,v21.8b,v31.8b
+	add 	d19,d19,d29				// h4 -> h0
+	add 	d22,d22,d30				// h2 -> h3
+
+	ushr	d29,d19,#26
+	and 	v19.8b,v19.8b,v31.8b
+	ushr 	d30,d22,#26
+	and 	v22.8b,v22.8b,v31.8b
+	add 	d20,d20,d29				// h0 -> h1
+	add 	d23,d23,d30				// h3 -> h4
+
+	////////////////////////////////////////////////////////////////
+	// write the result, can be partially reduced
+
+	stp 	s19,s20,[$ctx],#8
+	stp 	s21,s22,[$ctx],#8
+	str 	s23,[$ctx]
+
+.Lno_data_sve2:
+	// Restore the callee-saved GPRs
+	ldp	x19,x20,[sp,#16]
+	ldp	x21,x22,[sp,#32]
+	ldp	x23,x24,[sp,#48]
+	ldp	x25,x26,[sp,#64]
+	ldr	x29,[sp],#144
+	AARCH64_VALIDATE_LINK_REGISTER
+	ret
+
+.Lshort_blocks:
+	b	poly1305_blocks
+
+.size	poly1305_blocks_sve2,.-poly1305_blocks_sve2
+___
+
+##############################################################################
+#
+# SVE instruction encoder, adapted from chacha20-sve.pl
+#
+##############################################################################
+
+my $debug_encoder = 0;
+
+{
+my  %opcode_unpred = (
+	"eor"          => 0x04a03000,
+	"add"          => 0x04200000,
+	"orr"          => 0x04603000,
+	"mov"          => 0x04603000, # Alias for ORR
+	"and"          => 0x04203000,
+	"lsl"          => 0x04209C00,
+	"lsr"          => 0x04209400,
+	"zip1"         => 0x05206000,
+	"zip2"         => 0x05206400,
+	"trn1"         => 0x05207000,
+	"dup_gpr"      => 0x05203800,
+	"dup_elem"     => 0x05302000,
+	"cntd"         => 0x04e0e000,
+	"tbl"          => 0x05203000,
+	"adr"          => 0x04a0a000,
+	"umullb"       => 0x44e0d000,
+    "umullt"       => 0x45c07c00,
+    "umlalb"       => 0x44e09000,
+    "umlalt"       => 0x44c04c00,
+	"shrnb"        => 0x45201000);
+
+my  %opcode_imm_unpred = (
+	"dup"          => 0x2538C000,
+	"index"        => 0x04204400);
+
+my %opcode_scalar_pred = (
+	"cpy"          => 0x0528A000);
+
+my  %opcode_pred = (
+	"whilelo"      => 0x25200C00,
+	"ptrue"        => 0x2518E000,
+	"ld4w"         => 0xA560E000,
+	"ld1w"         => 0xA540A000,
+	"revb"         => 0x05248000,
+    "uaddv"        => 0x04012000);
+
+my  %tsize = (
+	'b'          => 0,
+	'h'          => 1,
+	's'          => 2,
+	'd'          => 3,
+	'q'          => 3); # To handle dup zx.q,zx.q[i] case
+
+my %sf = (
+	"w"          => 0,
+	"x"          => 1);
+
+my %pattern = ("ALL" => 31);
+
+sub create_verifier {
+	my $filename="./compile_sve.sh";
+
+$scripts = <<'___';
+#! /bin/bash
+set -e
+CROSS_COMPILE=${CROSS_COMPILE:-'aarch64-linux-gnu-'}
+
+[ -z "$1" ] && exit 1
+INST_TO_COMPILE="$1"
+FILENAME_BASE=${1%% *}
+TMPFILE="/tmp/${FILENAME_BASE}_test"
+OBJDUMP_LOG="/tmp/${FILENAME_BASE}_objdump.log"
+
+echo "--- DEBUG INFO ---" >&2
+echo "Received \$1 (Instruction): '$1'" >&2
+echo "Using Filename Base: '$FILENAME_BASE'" >&2
+echo "------------------" >&2
+
+ARCH=`uname -p | xargs echo -n`
+
+if [ $ARCH == 'aarch64' ]; then
+    CC=gcc-11
+    AS=as
+    OBJDUMP=objdump
+else
+    CC=${CROSS_COMPILE}gcc
+    AS=${CROSS_COMPILE}as
+    OBJDUMP=${CROSS_COMPILE}objdump
+fi
+
+cat > "${TMPFILE}.c" << EOF
+extern __attribute__((noinline, section("disasm_output"))) void dummy_func()
+{
+    asm("$INST_TO_COMPILE");
+}
+int main(int argc, char *argv[])
+{
+}
+EOF
+
+$CC -march=armv8.2-a+sve+sve2 -S -o "${TMPFILE}.s" "${TMPFILE}.c"
+
+$AS -march=armv8-a+sve2 -o "${TMPFILE}.o" "${TMPFILE}.s"
+
+#$OBJDUMP -d "${TMPFILE}.o" > "$OBJDUMP_LOG"
+
+#cat "$OBJDUMP_LOG" | awk -F"\n" -v RS="\n\n" '$1 ~ /dummy_func/' | awk 'FNR == 2 {printf "%s",$2}'
+$OBJDUMP -d "${TMPFILE}.o" | awk -F"\n" -v RS="\n\n" '$1 ~ /dummy_func/' | awk 'FNR == 2 {printf "%s",$2}'
+
+rm "${TMPFILE}.c" "${TMPFILE}.s" "${TMPFILE}.o"
+___
+	open(FH, '>', $filename) or die $!;
+	print FH $scripts;
+	close(FH);
+	system("chmod a+x ./compile_sve.sh");
+}
+
+sub compile_sve {
+	my $inst = shift;
+    return `./compile_sve.sh "$inst"`;
+}
+
+sub verify_inst {
+	my ($code,$inst)=@_;
+	my $hexcode = (sprintf "%08x", $code);
+
+	if ($debug_encoder == 1) {
+		my $expect=&compile_sve($inst);
+		if ($expect ne $hexcode) {
+			return (sprintf "%s // Encode Error! expect [%s] actual [%s]", $inst, $expect, $hexcode);
+		}
+	}
+	return (sprintf ".inst\t0x%s\t//%s", $hexcode, $inst);
+}
+
+sub reg_code {
+	my $code = shift;
+
+	if ($code == "zr") {
+		return "31";
+	}
+	return $code;
+}
+
+sub encode_size_imm() {
+	my ($mnemonic, $isize, $const)=@_;
+	my $esize = (8<<$tsize{$isize});
+	my $tsize_imm;
+	if ($mnemonic eq "shrnb") {
+        # Formula for narrowing shifts
+        $tsize_imm = $esize - $const;
+    } elsif ($mnemonic eq "lsr") {
+        # Formula for logical right shifts
+        $tsize_imm = 2*$esize - $const;
+    } else {
+        # Default formula for logical left shifts (lsl)
+        $tsize_imm = $esize + $const;
+    }
+	return (($tsize_imm>>5)<<22)|(($tsize_imm&0x1f)<<16);
+}
+
+sub sve_unpred {
+    my ($mnemonic,$arg)=@_;
+    my $inst = (sprintf "%s %s", $mnemonic,$arg);
+    # Special case: Widening multiplies (indexed and vector)
+    if (($mnemonic =~ /^(umull[bt]|umlal[bt])/) && $arg =~ m/z([0-9]+)\.d,\s*z([0-9]+)\.s,\s*z([0-9]+)\.s(\[([0-9]+)\])?/o) {
+        my ($zd, $zn, $zm, $indexed, $imm) = ($1, $2, $3, $4, $5);
+        my $opcode = $opcode_unpred{$mnemonic};
+        if ($indexed) {
+			# Split the 2-bit immediate index into its parts.
+            my $i2h = ($imm >> 1) & 0x1; # High bit of index
+            my $i2l = $imm & 0x1;       # Low bit of index
+            # Get the low 4 bits of the Zm register.
+            my $zm_low = $zm & 0xF;
+            return &verify_inst($opcode|($i2h << 20)|($zm_low << 16)|($i2l << 11)|($zn << 5)|$zd,$inst);
+        } else {
+            return &verify_inst($opcode|$zd|($zn<<5)|($zm<<16), $inst);
+        }
+    # Special case: 3-register vector ADR with lsl #2
+    } elsif ($mnemonic eq "adr" && $arg =~ m/z([0-9]+)\.s,\s*\[z([0-9]+)\.s,\s*z([0-9]+)\.s,\s*lsl\s*#2\]/o) {
+        my ($zd, $zn, $zm) = ($1, $2, $3);
+        my $opcode = $opcode_unpred{"adr"};
+        # Per the manual, the 'sz' bit (22) must be 0 for .s size.
+        # It is already 0 in our base, so we do nothing.
+        # The 'msz' field (bits 11-10) must be '10'. We achieve this by setting bit 11.
+        $opcode |= (1<<11);
+        return &verify_inst($opcode|$zd|($zn<<5)|($zm<<16), $inst);
+    # Special case: 'cntd xd' alias
+    } elsif ($mnemonic eq "cntd" && $arg =~ m/x([0-9]+)/o) {
+        my ($xd) = ($1);
+        my $opcode = $opcode_unpred{$mnemonic};
+        my $pattern_all = $pattern{"ALL"} << 5;
+        return &verify_inst($opcode|$xd|$pattern_all, $inst);
+    # Special parser for SHRNB's unique syntax (Zd.s, Zn.d, #imm)
+    } elsif ($mnemonic eq "shrnb" && $arg =~ m/z([0-9]+)\.[bhsd],\s*z([0-9]+)\.([bhsd]),\s*#([0-9]+)/o) {
+        my ($zd, $zn, $size_src, $imm) = ($1, $2, $3, $4);
+        my $opcode = $opcode_unpred{$mnemonic};
+        return &verify_inst($opcode|&encode_size_imm($mnemonic,$size_src,$imm)|($zn << 5)|$zd, $inst);
+	} elsif ($mnemonic eq "dup" && $arg =~ m/z([0-9]+)\.q,\s*z([0-9]+)\.q\[0\]/o) { # DUP from element
+        my ($zd, $zn) = ($1, $2);
+        my $opcode = $opcode_unpred{"dup_elem"};
+        return &verify_inst($opcode | ($zn << 5) | $zd, $inst);
+	} elsif ($mnemonic eq "dup" && $arg =~ m/z([0-9]+)\.([bhsdq]),\s*w([0-9]+)/o) { # DUP from GPR (wX/xX)
+        my ($zd, $size, $rn) = ($1, $2, $3);
+        my $opcode = $opcode_unpred{"dup_gpr"};
+        $opcode |= ($tsize{$size}<<22);
+        return &verify_inst($opcode|$zd|($rn<<5), $inst);
+	# Generic argument patterns
+    } elsif ($arg =~ m/z([0-9]+)\.([bhsdq]),\s*(.*)/o) {
+        my ($zd, $size, $regs) = ($1, $2, $3);
+        my $opcode = $opcode_unpred{$mnemonic};
+		# Handle shift-by-immediate separately due to its unique encoding.
+        if ($mnemonic eq "lsl" || $mnemonic eq "lsr") {
+            if ($regs =~ m/z([0-9]+)\.[bhsd],\s*#([0-9]+)/o) {
+                my ($zn, $imm) = ($1, $2);
+                return &verify_inst($opcode|$zd|($zn<<5)|&encode_size_imm($mnemonic,$size,$imm), $inst);
+            }
+        }
+		if ($mnemonic !~ /^(and|orr|eor|mov)$/) {
+        	$opcode |= ($tsize{$size}<<22);
+    	}
+        if ($regs =~ m/z([0-9]+)\.[bhsdq],\s*z([0-9]+)\.[bhsdq]/o) { # 3-operand vector
+            my ($zn, $zm) = ($1, $2);
+            return &verify_inst($opcode|$zd|($zn<<5)|($zm<<16), $inst);
+        } elsif ($regs =~ m/z([0-9]+)\.[bhsdq]/o) { # 2-operand vector (mov)
+            my $zn = $1;
+            my $zm = ($mnemonic eq "mov") ? $zn : 0;
+            return &verify_inst($opcode|$zd|($zn<<5)|($zm<<16), $inst);
+        } elsif ($regs =~ m/w([0-9]+),\s*#1/o) { # index
+            my ($rn, $rm) = ($1, 1);
+            $opcode = $opcode_imm_unpred{"index"};
+			$opcode |= ($tsize{$size}<<22);
+            return &verify_inst($opcode|$zd|($rn<<5)|($rm<<16), $inst);
+        } elsif ($regs =~ m/#(-?[0-9]+)/o) { # dup from immediate
+            my $imm = $1;
+            $opcode = $opcode_imm_unpred{"dup"};
+			$opcode |= ($tsize{$size}<<22);
+            my $imm_val = $imm & 0xff; # Only accounting for a simple case with zero shift.
+            return &verify_inst($opcode|$zd|($imm_val<<5), $inst);
+        }
+    }
+    sprintf "%s // fail to parse: %s", $mnemonic, $arg;
+}
+
+sub sve_pred {
+    my ($mnemonic, $arg)=@_;
+    my $inst = (sprintf "%s %s", $mnemonic,$arg);
+    # Special case: Multi-register loads (ld4w)
+    if ($arg =~ m/\{\s*z([0-9]+)\.s-z([0-9]+)\.s\s*\},\s*p([0-9]+)\/z,\s*\[(x[0-9]+)\]/o) {
+        my ($zt, $pg, $xn) = ($1, $3, $4);
+        $xn =~ s/x//;
+        my $opcode = $opcode_pred{$mnemonic};
+        return &verify_inst($opcode|$zt|($pg<<10)|($xn<<5), $inst);
+    # Special case: Single-register loads (ld1w)
+    } elsif ($arg =~ m/\{\s*z([0-9]+)\.s\s*\},\s*p([0-9]+)\/z,\s*\[(x[0-9]+)\]/o) {
+        my ($zt, $pg, $xn) = ($1, $2, $3);
+        $xn =~ s/x//;
+        my $opcode = $opcode_pred{$mnemonic};
+        return &verify_inst($opcode|$zt|($pg<<10)|($xn<<5), $inst);
+    # Special case: uaddv (scalar destination)
+    } elsif ($mnemonic eq "uaddv" && $arg =~ m/d([0-9]+),\s*p([0-9]+),\s*z([0-9]+)\.([bhsd])/o) {
+        my ($vd, $pg, $zn, $size) = ($1, $2, $3, $4);
+        my $opcode = $opcode_pred{$mnemonic};
+        return &verify_inst($opcode|($tsize{$size}<<22)|$vd|($pg<<10)|($zn<<5), $inst);
+    # Generic pattern: Starts with a predicate register (whilelo, ptrue)
+    } elsif ($arg =~ m/p([0-9]+)\.([bhsd]),\s*(.*)/o) {
+        my ($pd, $size, $regs) = ($1, $2, $3);
+        my $opcode = $opcode_pred{$mnemonic};
+        if ($regs =~ m/([wx])(zr|[0-9]+),\s*[wx](zr|[0-9]+)/o) { # whilelo
+            my ($sf_char, $rn, $rm) = ($1, $2, $3);
+            return &verify_inst($opcode|($tsize{$size}<<22)|$pd|($sf{$sf_char}<<12)|(&reg_code($rn)<<5)|(&reg_code($rm)<<16), $inst);
+        } elsif ($regs =~ m/(\w+)/o) { # ptrue
+            my $pat = $1;
+            return &verify_inst($opcode|($tsize{$size}<<22)|$pd|($pattern{$pat}<<5), $inst);
+        }
+    # Generic pattern: Starts with a vector register (cpy, revb)
+    } elsif ($arg =~ m/z([0-9]+)\.([bhsd]),\s*p([0-9]+)\/m,\s*(.*)/o) {
+        my ($zd, $size, $pg, $regs) = ($1, $2, $3, $4);
+        if ($regs =~ m/w([0-9]+)/o) { # CPY from GPR
+            my $wn = $1;
+            my $opcode = $opcode_scalar_pred{"cpy"};
+            return &verify_inst($opcode|($tsize{$size}<<22)|$zd|($pg<<10)|($wn<<5), $inst);
+        } elsif ($regs =~ m/z([0-9]+)\.([bhsd])/o) { # 2-operand predicated (revb)
+            my ($zn) = ($1);
+            my $opcode = $opcode_pred{$mnemonic};
+            return &verify_inst($opcode|($tsize{$size}<<22)|$zd|($pg<<10)|($zn<<5), $inst);
+        }
+    }
+    sprintf "%s // fail to parse: %s", $mnemonic, $arg;
+}
+
+open SELF,$0;
+while(<SELF>) {
+	next if (/^#!/);
+	last if (!s/^#/\/\// and !/^$/);
+	print;
+}
+close SELF;
+
+if ($debug_encoder == 1) {
+	&create_verifier();
+}
+
+foreach my $line (split("\n",$code)) {
+    my $original_line = $line;
+    my $encoded_line = "";
+    # Perform variable substitution
+    $line =~ s/\`([^\`]*)\`/eval($1)/ge;
+    # Predicated instructions
+    if ($line =~ /^\s*(\w+)\s+(z[0-9]+\.[bhsd],\s*p[0-9].*)/) {
+        $encoded_line = sve_pred($1, $2);
+    }
+	elsif ($line =~ /^\s*(\w+)\s+(d[0-9]+,\s*p[0-9].*)/) {
+        $encoded_line = sve_pred($1, $2);
+    }
+    elsif ($line =~ /^\s*(\w+[1-4][bhwd])\s+(\{\s*z[0-9]+.*\},\s*p[0-9]+.*)/) {
+        $encoded_line = sve_pred($1, $2);
+    }
+    elsif ($line =~ /^\s*(\w+)\s+(p[0-9]+\.[bhsd].*)/) {
+        $encoded_line = sve_pred($1, $2);
+    }
+    # Specific unpredicated instructions
+    elsif ($line =~ /^\s*(dup)\s+(z[0-9]+\.q,\s*z[0-9]+\.q\[0\])/) {
+        $encoded_line = sve_unpred($1, $2);
+    }
+    elsif ($line =~ /^\s*(dup)\s+(z[0-9]+\.[bhsdq],\s*(?:w|x)[0-9]+)/) {
+        $encoded_line = sve_unpred($1, $2);
+    }
+    elsif ($line =~ /^\s*(mov)\s+(z[0-9]+\.d,\s*z[0-9]+\.d)/) {
+        $encoded_line = sve_unpred("mov", $2);
+    }
+    elsif ($line =~ /^\s*(umull[bt]|umlal[bt])\s+(z[0-9]+\.d,\s*z[0-9]+\.s,\s*z[0-9]+\.s(?:\[[0-9]+\])?)/) {
+        $encoded_line = sve_unpred($1, $2);
+    }
+    elsif ($line =~ /^\s*(cntd)\s+((x|w)[0-9]+.*)/) {
+        $encoded_line = sve_unpred($1, $2);
+    }
+    # 3. Generic Unpredicated "catch-all"
+    elsif ($line =~ /^\s*(\w+)\s+(z[0-9]+\.[bhsdq].*)/) {
+        $encoded_line = sve_unpred($1, $2);
+    }
+    if ($encoded_line) {
+        print $encoded_line, "\n";
+    } else {
+        print $original_line, "\n";
+    }
+}
+
+}
+ STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-c64xplus.pl b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-c64xplus.pl
index 2bcdced7f45..f2c3b4d1d93 100755
--- a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-c64xplus.pl
+++ b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-c64xplus.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Poly1305 hash for C64x+.
@@ -323,7 +323,7 @@ ___
 }
 $code.=<<___;
 	.sect	.const
-	.cstring "Poly1305 for C64x+, CRYPTOGAMS by <appro\@openssl.org>"
+	.cstring "Poly1305 for C64x+, CRYPTOGAMS by <https://github.com/dot-asm>"
 	.align	4
 ___

diff --git a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-mips.pl b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-mips.pl
index 6c0b3292d07..7b3fd212d20 100755
--- a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-mips.pl
+++ b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-mips.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # Poly1305 hash for MIPS64.
@@ -52,7 +52,7 @@
 # ($s0,$s1,$s2,$s3,$s4,$s5,$s6,$s7)=map("\$$_",(16..23));
 # ($gp,$sp,$fp,$ra)=map("\$$_",(28..31));
 #
-# <appro@openssl.org>
+# <https://github.com/dot-asm>
 #
 ######################################################################

@@ -71,7 +71,7 @@ $SAVED_REGS_MASK = ($flavour =~ /nubi/i) ? "0x0003f000" : "0x00030000";
 ($in0,$in1,$tmp0,$tmp1,$tmp2,$tmp3,$tmp4) = ($a4,$a5,$a6,$a7,$at,$t0,$t1);

 $code.=<<___;
-#include "mips_arch.h"
+#include "arch/mips_arch.h"

 #ifdef MIPSEB
 # define MSB 0
@@ -430,7 +430,7 @@ poly1305_emit:
 	jr	$ra
 .end	poly1305_emit
 .rdata
-.asciiz	"Poly1305 for MIPS64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciiz	"Poly1305 for MIPS64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2
 ___
 }
diff --git a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-ppcfp.pl b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-ppcfp.pl
index 218708a4625..2627d9a661b 100755
--- a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-ppcfp.pl
+++ b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-ppcfp.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # This module implements Poly1305 hash for PowerPC FPU.
@@ -734,7 +734,7 @@ LPICmeup:
 .quad	0x4230000000000000		# 2^(52+16+64-96)

 .quad	0x0000000000000001		# fpscr: truncate, no exceptions
-.asciz	"Poly1305 for PPC FPU, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Poly1305 for PPC FPU, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	4
 ___

diff --git a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-s390x.pl b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-s390x.pl
index 4a93064ff66..a2f1f669fff 100755
--- a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-s390x.pl
+++ b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-s390x.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # This module implements Poly1305 hash for s390x.
@@ -68,7 +68,7 @@ my ($ctx,$inp,$len,$padbit) = map("%r$_",(2..5));

 PERLASM_BEGIN($output);

-INCLUDE	("s390x_arch.h");
+INCLUDE	("arch/s390x_arch.h");
 TEXT	();

 ################
@@ -979,6 +979,6 @@ LONG	(0xffffffff,0x00000000,0xffffffff,0xffffffff);
 LONG	(0xffffffff,0x00000000,0xffffffff,0x00000000);
 LONG	(0x00000000,0x00000000,0xffffffff,0x00000000);

-STRING	("\"Poly1305 for s390x, CRYPTOGAMS by <appro\@openssl.org>\"");
+STRING	("\"Poly1305 for s390x, CRYPTOGAMS by <https://github.com/dot-asm>\"");

 PERLASM_END();
diff --git a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-sparcv9.pl b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-sparcv9.pl
index dc592a07aca..a8717bb21f7 100755
--- a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-sparcv9.pl
+++ b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-sparcv9.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # This module implements Poly1305 hash for SPARCv9, vanilla, as well
@@ -55,7 +55,7 @@ $code.=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #ifdef	__arch64__
 .register	%g2,#scratch
@@ -1043,7 +1043,7 @@ $code.=<<___;
 .word	0x3e300000,0x00000000		! 2^(52+16+0-96)
 .word	0x40300000,0x00000000		! 2^(52+16+32-96)
 .word	0x42300000,0x00000000		! 2^(52+16+64-96)
-.asciz	"Poly1305 for SPARCv9/VIS3/FMA, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Poly1305 for SPARCv9/VIS3/FMA, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	4
 ___
 }
diff --git a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-x86.pl b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-x86.pl
index 6d367d858da..22819d21b09 100755
--- a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-x86.pl
+++ b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-x86.pl
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # This module implements Poly1305 hash for x86.
@@ -1813,7 +1813,7 @@ sub vlazy_reduction {
 	&data_word(0x03ffffff,0,0x03ffffff,0,	0x03ffffff,0,	0x03ffffff,0);
 	&data_word(0x0fffffff,0x0ffffffc,0x0ffffffc,0x0ffffffc);
 }
-&asciz	("Poly1305 for x86, CRYPTOGAMS by <appro\@openssl.org>");
+&asciz	("Poly1305 for x86, CRYPTOGAMS by <https://github.com/dot-asm>");
 &align	(4);

 &asm_finish();
diff --git a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-x86_64.pl b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-x86_64.pl
index 081fe4117ad..1ef2fad211e 100755
--- a/deps/openssl/openssl/crypto/poly1305/asm/poly1305-x86_64.pl
+++ b/deps/openssl/openssl/crypto/poly1305/asm/poly1305-x86_64.pl
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # This module implements Poly1305 hash for x86_64.
@@ -3827,7 +3827,7 @@ $code.=<<___;
 ___
 }
 $code.=<<___;
-.asciz	"Poly1305 for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Poly1305 for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	16
 ___

diff --git a/deps/openssl/openssl/crypto/poly1305/build.info b/deps/openssl/openssl/crypto/poly1305/build.info
index e359a2225df..5c35c8eceea 100644
--- a/deps/openssl/openssl/crypto/poly1305/build.info
+++ b/deps/openssl/openssl/crypto/poly1305/build.info
@@ -14,7 +14,7 @@ IF[{- !$disabled{asm} -}]
   $POLY1305ASM_s390x=poly1305-s390x.S

   $POLY1305ASM_armv4=poly1305-armv4.S
-  $POLY1305ASM_aarch64=poly1305-armv8.S
+  $POLY1305ASM_aarch64=poly1305-armv8.S poly1305-armv9-sve2.S

   $POLY1305ASM_ppc32=poly1305_ppc.c poly1305-ppc.s poly1305-ppcfp.s
   $POLY1305ASM_ppc64=$POLY1305ASM_ppc32
@@ -45,7 +45,9 @@ GENERATE[poly1305-ppcfp.s]=asm/poly1305-ppcfp.pl
 GENERATE[poly1305-armv4.S]=asm/poly1305-armv4.pl
 INCLUDE[poly1305-armv4.o]=..
 GENERATE[poly1305-armv8.S]=asm/poly1305-armv8.pl
+GENERATE[poly1305-armv9-sve2.S]=asm/poly1305-armv9-sve2.pl
 INCLUDE[poly1305-armv8.o]=..
+INCLUDE[poly1305-armv9-sve2.o]=..
 GENERATE[poly1305-mips.S]=asm/poly1305-mips.pl
 INCLUDE[poly1305-mips.o]=..
 GENERATE[poly1305-c64xplus.S]=asm/poly1305-c64xplus.pl
diff --git a/deps/openssl/openssl/crypto/poly1305/poly1305.c b/deps/openssl/openssl/crypto/poly1305/poly1305.c
index 8836dbf79ae..5e09a304ab3 100644
--- a/deps/openssl/openssl/crypto/poly1305/poly1305.c
+++ b/deps/openssl/openssl/crypto/poly1305/poly1305.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,7 @@
  * https://www.openssl.org/source/license.html
  */

+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include <openssl/crypto.h>
@@ -57,11 +58,9 @@ static unsigned int U8TOU32(const unsigned char *p)
  * implementation is not necessarily optimal choice in every situation,
  * rather contrary...
  *
- *                                              <appro@openssl.org>
+ *                                              <https://github.com/dot-asm>
  */

-typedef unsigned int u32;
-
 /*
  * poly1305_blocks processes a multiple of POLY1305_BLOCK_SIZE blocks
  * of |inp| no longer than |len|. Behaviour for |len| not divisible by
@@ -82,7 +81,7 @@ typedef unsigned int u32;
  *      handled locally.
  */
 static void
-poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, u32 padbit);
+poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, uint32_t padbit);

 /*
  * Type-agnostic "rip-off" from constant_time.h
@@ -92,22 +91,21 @@ poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, u32 padbit);

 #if defined(INT64_MAX) && defined(INT128_MAX)

-typedef unsigned long u64;
 typedef uint128_t u128;

 typedef struct {
-    u64 h[3];
-    u64 r[2];
+    uint64_t h[3];
+    uint64_t r[2];
 } poly1305_internal;

 /* pick 32-bit unsigned integer in little endian order */
-static u64 U8TOU64(const unsigned char *p)
+static uint64_t U8TOU64(const unsigned char *p)
 {
-    return (((u64)(p[0] & 0xff)) | ((u64)(p[1] & 0xff) << 8) | ((u64)(p[2] & 0xff) << 16) | ((u64)(p[3] & 0xff) << 24) | ((u64)(p[4] & 0xff) << 32) | ((u64)(p[5] & 0xff) << 40) | ((u64)(p[6] & 0xff) << 48) | ((u64)(p[7] & 0xff) << 56));
+    return (((uint64_t)(p[0] & 0xff)) | ((uint64_t)(p[1] & 0xff) << 8) | ((uint64_t)(p[2] & 0xff) << 16) | ((uint64_t)(p[3] & 0xff) << 24) | ((uint64_t)(p[4] & 0xff) << 32) | ((uint64_t)(p[5] & 0xff) << 40) | ((uint64_t)(p[6] & 0xff) << 48) | ((uint64_t)(p[7] & 0xff) << 56));
 }

 /* store a 32-bit unsigned integer in little endian */
-static void U64TO8(unsigned char *p, u64 v)
+static void U64TO8(unsigned char *p, uint64_t v)
 {
     p[0] = (unsigned char)((v) & 0xff);
     p[1] = (unsigned char)((v >> 8) & 0xff);
@@ -134,12 +132,12 @@ static void poly1305_init(void *ctx, const unsigned char key[16])
 }

 static void
-poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, u32 padbit)
+poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, uint32_t padbit)
 {
     poly1305_internal *st = (poly1305_internal *)ctx;
-    u64 r0, r1;
-    u64 s1;
-    u64 h0, h1, h2, c;
+    uint64_t r0, r1;
+    uint64_t s1;
+    uint64_t h0, h1, h2, c;
     u128 d0, d1;

     r0 = st->r[0];
@@ -153,13 +151,13 @@ poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, u32 padbit)

     while (len >= POLY1305_BLOCK_SIZE) {
         /* h += m[i] */
-        h0 = (u64)(d0 = (u128)h0 + U8TOU64(inp + 0));
-        h1 = (u64)(d1 = (u128)h1 + (d0 >> 64) + U8TOU64(inp + 8));
+        h0 = (uint64_t)(d0 = (u128)h0 + U8TOU64(inp + 0));
+        h1 = (uint64_t)(d1 = (u128)h1 + (d0 >> 64) + U8TOU64(inp + 8));
         /*
          * padbit can be zero only when original len was
          * POLY1305_BLOCK_SIZE, but we don't check
          */
-        h2 += (u64)(d1 >> 64) + padbit;
+        h2 += (uint64_t)(d1 >> 64) + padbit;

         /* h *= r "%" p, where "%" stands for "partial remainder" */
         d0 = ((u128)h0 * r0) + ((u128)h1 * s1);
@@ -168,9 +166,9 @@ poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, u32 padbit)

         /* last reduction step: */
         /* a) h2:h0 = h2<<128 + d1<<64 + d0 */
-        h0 = (u64)d0;
-        h1 = (u64)(d1 += d0 >> 64);
-        h2 += (u64)(d1 >> 64);
+        h0 = (uint64_t)d0;
+        h1 = (uint64_t)(d1 += d0 >> 64);
+        h2 += (uint64_t)(d1 >> 64);
         /* b) (h2:h0 += (h2:h0>>130) * 5) %= 2^130 */
         c = (h2 >> 2) + (h2 & ~3UL);
         h2 &= 3;
@@ -197,22 +195,22 @@ poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, u32 padbit)
 }

 static void poly1305_emit(void *ctx, unsigned char mac[16],
-    const u32 nonce[4])
+    const uint32_t nonce[4])
 {
     poly1305_internal *st = (poly1305_internal *)ctx;
-    u64 h0, h1, h2;
-    u64 g0, g1, g2;
+    uint64_t h0, h1, h2;
+    uint64_t g0, g1, g2;
     u128 t;
-    u64 mask;
+    uint64_t mask;

     h0 = st->h[0];
     h1 = st->h[1];
     h2 = st->h[2];

     /* compare to modulus by computing h + -p */
-    g0 = (u64)(t = (u128)h0 + 5);
-    g1 = (u64)(t = (u128)h1 + (t >> 64));
-    g2 = h2 + (u64)(t >> 64);
+    g0 = (uint64_t)(t = (u128)h0 + 5);
+    g1 = (uint64_t)(t = (u128)h1 + (t >> 64));
+    g2 = h2 + (uint64_t)(t >> 64);

     /* if there was carry into 131st bit, h1:h0 = g1:g0 */
     mask = 0 - (g2 >> 2);
@@ -223,8 +221,8 @@ static void poly1305_emit(void *ctx, unsigned char mac[16],
     h1 = (h1 & mask) | g1;

     /* mac = (h + nonce) % (2^128) */
-    h0 = (u64)(t = (u128)h0 + nonce[0] + ((u64)nonce[1] << 32));
-    h1 = (u64)(t = (u128)h1 + nonce[2] + ((u64)nonce[3] << 32) + (t >> 64));
+    h0 = (uint64_t)(t = (u128)h0 + nonce[0] + ((uint64_t)nonce[1] << 32));
+    h1 = (uint64_t)(t = (u128)h1 + nonce[2] + ((uint64_t)nonce[3] << 32) + (t >> 64));

     U64TO8(mac + 0, h0);
     U64TO8(mac + 8, h1);
@@ -232,17 +230,9 @@ static void poly1305_emit(void *ctx, unsigned char mac[16],

 #else

-#if defined(_WIN32) && !defined(__MINGW32__)
-typedef unsigned __int64 u64;
-#elif defined(__arch64__)
-typedef unsigned long u64;
-#else
-typedef unsigned long long u64;
-#endif
-
 typedef struct {
-    u32 h[5];
-    u32 r[4];
+    uint32_t h[5];
+    uint32_t r[4];
 } poly1305_internal;

 /* store a 32-bit unsigned integer in little endian */
@@ -273,13 +263,13 @@ static void poly1305_init(void *ctx, const unsigned char key[16])
 }

 static void
-poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, u32 padbit)
+poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, uint32_t padbit)
 {
     poly1305_internal *st = (poly1305_internal *)ctx;
-    u32 r0, r1, r2, r3;
-    u32 s1, s2, s3;
-    u32 h0, h1, h2, h3, h4, c;
-    u64 d0, d1, d2, d3;
+    uint32_t r0, r1, r2, r3;
+    uint32_t s1, s2, s3;
+    uint32_t h0, h1, h2, h3, h4, c;
+    uint64_t d0, d1, d2, d3;

     r0 = st->r[0];
     r1 = st->r[1];
@@ -298,26 +288,26 @@ poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, u32 padbit)

     while (len >= POLY1305_BLOCK_SIZE) {
         /* h += m[i] */
-        h0 = (u32)(d0 = (u64)h0 + U8TOU32(inp + 0));
-        h1 = (u32)(d1 = (u64)h1 + (d0 >> 32) + U8TOU32(inp + 4));
-        h2 = (u32)(d2 = (u64)h2 + (d1 >> 32) + U8TOU32(inp + 8));
-        h3 = (u32)(d3 = (u64)h3 + (d2 >> 32) + U8TOU32(inp + 12));
-        h4 += (u32)(d3 >> 32) + padbit;
+        h0 = (uint32_t)(d0 = (uint64_t)h0 + U8TOU32(inp + 0));
+        h1 = (uint32_t)(d1 = (uint64_t)h1 + (d0 >> 32) + U8TOU32(inp + 4));
+        h2 = (uint32_t)(d2 = (uint64_t)h2 + (d1 >> 32) + U8TOU32(inp + 8));
+        h3 = (uint32_t)(d3 = (uint64_t)h3 + (d2 >> 32) + U8TOU32(inp + 12));
+        h4 += (uint32_t)(d3 >> 32) + padbit;

         /* h *= r "%" p, where "%" stands for "partial remainder" */
-        d0 = ((u64)h0 * r0) + ((u64)h1 * s3) + ((u64)h2 * s2) + ((u64)h3 * s1);
-        d1 = ((u64)h0 * r1) + ((u64)h1 * r0) + ((u64)h2 * s3) + ((u64)h3 * s2) + (h4 * s1);
-        d2 = ((u64)h0 * r2) + ((u64)h1 * r1) + ((u64)h2 * r0) + ((u64)h3 * s3) + (h4 * s2);
-        d3 = ((u64)h0 * r3) + ((u64)h1 * r2) + ((u64)h2 * r1) + ((u64)h3 * r0) + (h4 * s3);
+        d0 = ((uint64_t)h0 * r0) + ((uint64_t)h1 * s3) + ((uint64_t)h2 * s2) + ((uint64_t)h3 * s1);
+        d1 = ((uint64_t)h0 * r1) + ((uint64_t)h1 * r0) + ((uint64_t)h2 * s3) + ((uint64_t)h3 * s2) + (h4 * s1);
+        d2 = ((uint64_t)h0 * r2) + ((uint64_t)h1 * r1) + ((uint64_t)h2 * r0) + ((uint64_t)h3 * s3) + (h4 * s2);
+        d3 = ((uint64_t)h0 * r3) + ((uint64_t)h1 * r2) + ((uint64_t)h2 * r1) + ((uint64_t)h3 * r0) + (h4 * s3);
         h4 = (h4 * r0);

         /* last reduction step: */
         /* a) h4:h0 = h4<<128 + d3<<96 + d2<<64 + d1<<32 + d0 */
-        h0 = (u32)d0;
-        h1 = (u32)(d1 += d0 >> 32);
-        h2 = (u32)(d2 += d1 >> 32);
-        h3 = (u32)(d3 += d2 >> 32);
-        h4 += (u32)(d3 >> 32);
+        h0 = (uint32_t)d0;
+        h1 = (uint32_t)(d1 += d0 >> 32);
+        h2 = (uint32_t)(d2 += d1 >> 32);
+        h3 = (uint32_t)(d3 += d2 >> 32);
+        h4 += (uint32_t)(d3 >> 32);
         /* b) (h4:h0 += (h4:h0>>130) * 5) %= 2^130 */
         c = (h4 >> 2) + (h4 & ~3U);
         h4 &= 3;
@@ -348,13 +338,13 @@ poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, u32 padbit)
 }

 static void poly1305_emit(void *ctx, unsigned char mac[16],
-    const u32 nonce[4])
+    const uint32_t nonce[4])
 {
     poly1305_internal *st = (poly1305_internal *)ctx;
-    u32 h0, h1, h2, h3, h4;
-    u32 g0, g1, g2, g3, g4;
-    u64 t;
-    u32 mask;
+    uint32_t h0, h1, h2, h3, h4;
+    uint32_t g0, g1, g2, g3, g4;
+    uint64_t t;
+    uint32_t mask;

     h0 = st->h[0];
     h1 = st->h[1];
@@ -363,11 +353,11 @@ static void poly1305_emit(void *ctx, unsigned char mac[16],
     h4 = st->h[4];

     /* compare to modulus by computing h + -p */
-    g0 = (u32)(t = (u64)h0 + 5);
-    g1 = (u32)(t = (u64)h1 + (t >> 32));
-    g2 = (u32)(t = (u64)h2 + (t >> 32));
-    g3 = (u32)(t = (u64)h3 + (t >> 32));
-    g4 = h4 + (u32)(t >> 32);
+    g0 = (uint32_t)(t = (uint64_t)h0 + 5);
+    g1 = (uint32_t)(t = (uint64_t)h1 + (t >> 32));
+    g2 = (uint32_t)(t = (uint64_t)h2 + (t >> 32));
+    g3 = (uint32_t)(t = (uint64_t)h3 + (t >> 32));
+    g4 = h4 + (uint32_t)(t >> 32);

     /* if there was carry into 131st bit, h3:h0 = g3:g0 */
     mask = 0 - (g4 >> 2);
@@ -382,10 +372,10 @@ static void poly1305_emit(void *ctx, unsigned char mac[16],
     h3 = (h3 & mask) | g3;

     /* mac = (h + nonce) % (2^128) */
-    h0 = (u32)(t = (u64)h0 + nonce[0]);
-    h1 = (u32)(t = (u64)h1 + (t >> 32) + nonce[1]);
-    h2 = (u32)(t = (u64)h2 + (t >> 32) + nonce[2]);
-    h3 = (u32)(t = (u64)h3 + (t >> 32) + nonce[3]);
+    h0 = (uint32_t)(t = (uint64_t)h0 + nonce[0]);
+    h1 = (uint32_t)(t = (uint64_t)h1 + (t >> 32) + nonce[1]);
+    h2 = (uint32_t)(t = (uint64_t)h2 + (t >> 32) + nonce[2]);
+    h3 = (uint32_t)(t = (uint64_t)h3 + (t >> 32) + nonce[3]);

     U32TO8(mac + 0, h0);
     U32TO8(mac + 4, h1);
diff --git a/deps/openssl/openssl/crypto/poly1305/poly1305_base2_44.c b/deps/openssl/openssl/crypto/poly1305/poly1305_base2_44.c
deleted file mode 100644
index 7e28970fbe7..00000000000
--- a/deps/openssl/openssl/crypto/poly1305/poly1305_base2_44.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * This module is meant to be used as template for base 2^44 assembly
- * implementation[s]. On side note compiler-generated code is not
- * slower than compiler-generated base 2^64 code on [high-end] x86_64,
- * even though amount of multiplications is 50% higher. Go figure...
- */
-#include <stdlib.h>
-
-typedef unsigned char u8;
-typedef unsigned int u32;
-typedef unsigned long u64;
-typedef uint128_t u128;
-
-typedef struct {
-    u64 h[3];
-    u64 s[2];
-    u64 r[3];
-} poly1305_internal;
-
-#define POLY1305_BLOCK_SIZE 16
-
-/* pick 64-bit unsigned integer in little endian order */
-static u64 U8TOU64(const unsigned char *p)
-{
-    return (((u64)(p[0] & 0xff)) | ((u64)(p[1] & 0xff) << 8) | ((u64)(p[2] & 0xff) << 16) | ((u64)(p[3] & 0xff) << 24) | ((u64)(p[4] & 0xff) << 32) | ((u64)(p[5] & 0xff) << 40) | ((u64)(p[6] & 0xff) << 48) | ((u64)(p[7] & 0xff) << 56));
-}
-
-/* store a 64-bit unsigned integer in little endian */
-static void U64TO8(unsigned char *p, u64 v)
-{
-    p[0] = (unsigned char)((v) & 0xff);
-    p[1] = (unsigned char)((v >> 8) & 0xff);
-    p[2] = (unsigned char)((v >> 16) & 0xff);
-    p[3] = (unsigned char)((v >> 24) & 0xff);
-    p[4] = (unsigned char)((v >> 32) & 0xff);
-    p[5] = (unsigned char)((v >> 40) & 0xff);
-    p[6] = (unsigned char)((v >> 48) & 0xff);
-    p[7] = (unsigned char)((v >> 56) & 0xff);
-}
-
-int poly1305_init(void *ctx, const unsigned char key[16])
-{
-    poly1305_internal *st = (poly1305_internal *)ctx;
-    u64 r0, r1;
-
-    /* h = 0 */
-    st->h[0] = 0;
-    st->h[1] = 0;
-    st->h[2] = 0;
-
-    r0 = U8TOU64(&key[0]) & 0x0ffffffc0fffffff;
-    r1 = U8TOU64(&key[8]) & 0x0ffffffc0ffffffc;
-
-    /* break r1:r0 to three 44-bit digits, masks are 1<<44-1 */
-    st->r[0] = r0 & 0x0fffffffffff;
-    st->r[1] = ((r0 >> 44) | (r1 << 20)) & 0x0fffffffffff;
-    st->r[2] = (r1 >> 24);
-
-    st->s[0] = (st->r[1] + (st->r[1] << 2)) << 2;
-    st->s[1] = (st->r[2] + (st->r[2] << 2)) << 2;
-
-    return 0;
-}
-
-void poly1305_blocks(void *ctx, const unsigned char *inp, size_t len,
-    u32 padbit)
-{
-    poly1305_internal *st = (poly1305_internal *)ctx;
-    u64 r0, r1, r2;
-    u64 s1, s2;
-    u64 h0, h1, h2, c;
-    u128 d0, d1, d2;
-    u64 pad = (u64)padbit << 40;
-
-    r0 = st->r[0];
-    r1 = st->r[1];
-    r2 = st->r[2];
-
-    s1 = st->s[0];
-    s2 = st->s[1];
-
-    h0 = st->h[0];
-    h1 = st->h[1];
-    h2 = st->h[2];
-
-    while (len >= POLY1305_BLOCK_SIZE) {
-        u64 m0, m1;
-
-        m0 = U8TOU64(inp + 0);
-        m1 = U8TOU64(inp + 8);
-
-        /* h += m[i], m[i] is broken to 44-bit digits */
-        h0 += m0 & 0x0fffffffffff;
-        h1 += ((m0 >> 44) | (m1 << 20)) & 0x0fffffffffff;
-        h2 += (m1 >> 24) + pad;
-
-        /* h *= r "%" p, where "%" stands for "partial remainder" */
-        d0 = ((u128)h0 * r0) + ((u128)h1 * s2) + ((u128)h2 * s1);
-        d1 = ((u128)h0 * r1) + ((u128)h1 * r0) + ((u128)h2 * s2);
-        d2 = ((u128)h0 * r2) + ((u128)h1 * r1) + ((u128)h2 * r0);
-
-        /* "lazy" reduction step */
-        h0 = (u64)d0 & 0x0fffffffffff;
-        h1 = (u64)(d1 += (u64)(d0 >> 44)) & 0x0fffffffffff;
-        h2 = (u64)(d2 += (u64)(d1 >> 44)) & 0x03ffffffffff; /* last 42 bits */
-
-        c = (d2 >> 42);
-        h0 += c + (c << 2);
-
-        inp += POLY1305_BLOCK_SIZE;
-        len -= POLY1305_BLOCK_SIZE;
-    }
-
-    st->h[0] = h0;
-    st->h[1] = h1;
-    st->h[2] = h2;
-}
-
-void poly1305_emit(void *ctx, unsigned char mac[16], const u32 nonce[4])
-{
-    poly1305_internal *st = (poly1305_internal *)ctx;
-    u64 h0, h1, h2;
-    u64 g0, g1, g2;
-    u128 t;
-    u64 mask;
-
-    h0 = st->h[0];
-    h1 = st->h[1];
-    h2 = st->h[2];
-
-    /* after "lazy" reduction, convert 44+bit digits to 64-bit ones */
-    h0 = (u64)(t = (u128)h0 + (h1 << 44));
-    h1 >>= 20;
-    h1 = (u64)(t = (u128)h1 + (h2 << 24) + (t >> 64));
-    h2 >>= 40;
-    h2 += (u64)(t >> 64);
-
-    /* compare to modulus by computing h + -p */
-    g0 = (u64)(t = (u128)h0 + 5);
-    g1 = (u64)(t = (u128)h1 + (t >> 64));
-    g2 = h2 + (u64)(t >> 64);
-
-    /* if there was carry into 131st bit, h1:h0 = g1:g0 */
-    mask = 0 - (g2 >> 2);
-    g0 &= mask;
-    g1 &= mask;
-    mask = ~mask;
-    h0 = (h0 & mask) | g0;
-    h1 = (h1 & mask) | g1;
-
-    /* mac = (h + nonce) % (2^128) */
-    h0 = (u64)(t = (u128)h0 + nonce[0] + ((u64)nonce[1] << 32));
-    h1 = (u64)(t = (u128)h1 + nonce[2] + ((u64)nonce[3] << 32) + (t >> 64));
-
-    U64TO8(mac + 0, h0);
-    U64TO8(mac + 8, h1);
-}
diff --git a/deps/openssl/openssl/crypto/poly1305/poly1305_ieee754.c b/deps/openssl/openssl/crypto/poly1305/poly1305_ieee754.c
deleted file mode 100644
index bd7426466e5..00000000000
--- a/deps/openssl/openssl/crypto/poly1305/poly1305_ieee754.c
+++ /dev/null
@@ -1,487 +0,0 @@
-/*
- * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * This module is meant to be used as template for non-x87 floating-
- * point assembly modules. The template itself is x86_64-specific
- * though, as it was debugged on x86_64. So that implementer would
- * have to recognize platform-specific parts, UxTOy and inline asm,
- * and act accordingly.
- *
- * Huh? x86_64-specific code as template for non-x87? Note seven, which
- * is not a typo, but reference to 80-bit precision. This module on the
- * other hand relies on 64-bit precision operations, which are default
- * for x86_64 code. And since we are at it, just for sense of it,
- * large-block performance in cycles per processed byte for *this* code
- * is:
- *                      gcc-4.8         icc-15.0        clang-3.4(*)
- *
- * Westmere             4.96            5.09            4.37
- * Sandy Bridge         4.95            4.90            4.17
- * Haswell              4.92            4.87            3.78
- * Bulldozer            4.67            4.49            4.68
- * VIA Nano             7.07            7.05            5.98
- * Silvermont           10.6            9.61            12.6
- *
- * (*)  clang managed to discover parallelism and deployed SIMD;
- *
- * And for range of other platforms with unspecified gcc versions:
- *
- * Freescale e300       12.5
- * PPC74x0              10.8
- * POWER6               4.92
- * POWER7               4.50
- * POWER8               4.10
- *
- * z10                  11.2
- * z196+                7.30
- *
- * UltraSPARC III       16.0
- * SPARC T4             16.1
- */
-
-#if !(defined(__GNUC__) && __GNUC__ >= 2)
-#error "this is gcc-specific template"
-#endif
-
-#include <stdlib.h>
-
-typedef unsigned char u8;
-typedef unsigned int u32;
-typedef unsigned long long u64;
-typedef union {
-    double d;
-    u64 u;
-} elem64;
-
-#define TWO(p) ((double)(1ULL << (p)))
-#define TWO0 TWO(0)
-#define TWO32 TWO(32)
-#define TWO64 (TWO32 * TWO(32))
-#define TWO96 (TWO64 * TWO(32))
-#define TWO130 (TWO96 * TWO(34))
-
-#define EXP(p) ((1023ULL + (p)) << 52)
-
-#if defined(__x86_64__) || (defined(__PPC__) && defined(__LITTLE_ENDIAN__))
-#define U8TOU32(p) (*(const u32 *)(p))
-#define U32TO8(p, v) (*(u32 *)(p) = (v))
-#elif defined(__PPC__) || defined(__POWERPC__)
-#define U8TOU32(p) ({u32 ret; asm ("lwbrx	%0,0,%1":"=r"(ret):"b"(p)); ret; })
-#define U32TO8(p, v) asm("stwbrx %0,0,%1" ::"r"(v), "b"(p) : "memory")
-#elif defined(__s390x__)
-#define U8TOU32(p) ({u32 ret; asm ("lrv	%0,%1":"=d"(ret):"m"(*(u32 *)(p))); ret; })
-#define U32TO8(p, v) asm("strv	%1,%0" : "=m"(*(u32 *)(p)) : "d"(v))
-#endif
-
-#ifndef U8TOU32
-#define U8TOU32(p) ((u32)(p)[0] | (u32)(p)[1] << 8 | (u32)(p)[2] << 16 | (u32)(p)[3] << 24)
-#endif
-#ifndef U32TO8
-#define U32TO8(p, v) ((p)[0] = (u8)(v), (p)[1] = (u8)((v) >> 8), \
-    (p)[2] = (u8)((v) >> 16), (p)[3] = (u8)((v) >> 24))
-#endif
-
-typedef struct {
-    elem64 h[4];
-    double r[8];
-    double s[6];
-} poly1305_internal;
-
-/* "round toward zero (truncate), mask all exceptions" */
-#if defined(__x86_64__)
-static const u32 mxcsr = 0x7f80;
-#elif defined(__PPC__) || defined(__POWERPC__)
-static const u64 one = 1;
-#elif defined(__s390x__)
-static const u32 fpc = 1;
-#elif defined(__sparc__)
-static const u64 fsr = 1ULL << 30;
-#elif defined(__mips__)
-static const u32 fcsr = 1;
-#else
-#error "unrecognized platform"
-#endif
-
-int poly1305_init(void *ctx, const unsigned char key[16])
-{
-    poly1305_internal *st = (poly1305_internal *)ctx;
-    elem64 r0, r1, r2, r3;
-
-    /* h = 0, biased */
-#if 0
-    st->h[0].d = TWO(52)*TWO0;
-    st->h[1].d = TWO(52)*TWO32;
-    st->h[2].d = TWO(52)*TWO64;
-    st->h[3].d = TWO(52)*TWO96;
-#else
-    st->h[0].u = EXP(52 + 0);
-    st->h[1].u = EXP(52 + 32);
-    st->h[2].u = EXP(52 + 64);
-    st->h[3].u = EXP(52 + 96);
-#endif
-
-    if (key) {
-        /*
-         * set "truncate" rounding mode
-         */
-#if defined(__x86_64__)
-        u32 mxcsr_orig;
-
-        asm volatile("stmxcsr	%0" : "=m"(mxcsr_orig));
-        asm volatile("ldmxcsr	%0" ::"m"(mxcsr));
-#elif defined(__PPC__) || defined(__POWERPC__)
-        double fpscr_orig, fpscr = *(double *)&one;
-
-        asm volatile("mffs	%0" : "=f"(fpscr_orig));
-        asm volatile("mtfsf	255,%0" ::"f"(fpscr));
-#elif defined(__s390x__)
-        u32 fpc_orig;
-
-        asm volatile("stfpc	%0" : "=m"(fpc_orig));
-        asm volatile("lfpc	%0" ::"m"(fpc));
-#elif defined(__sparc__)
-        u64 fsr_orig;
-
-        asm volatile("stx	%%fsr,%0" : "=m"(fsr_orig));
-        asm volatile("ldx	%0,%%fsr" ::"m"(fsr));
-#elif defined(__mips__)
-        u32 fcsr_orig;
-
-        asm volatile("cfc1	%0,$31" : "=r"(fcsr_orig));
-        asm volatile("ctc1	%0,$31" ::"r"(fcsr));
-#endif
-
-        /* r &= 0xffffffc0ffffffc0ffffffc0fffffff */
-        r0.u = EXP(52 + 0) | (U8TOU32(&key[0]) & 0x0fffffff);
-        r1.u = EXP(52 + 32) | (U8TOU32(&key[4]) & 0x0ffffffc);
-        r2.u = EXP(52 + 64) | (U8TOU32(&key[8]) & 0x0ffffffc);
-        r3.u = EXP(52 + 96) | (U8TOU32(&key[12]) & 0x0ffffffc);
-
-        st->r[0] = r0.d - TWO(52) * TWO0;
-        st->r[2] = r1.d - TWO(52) * TWO32;
-        st->r[4] = r2.d - TWO(52) * TWO64;
-        st->r[6] = r3.d - TWO(52) * TWO96;
-
-        st->s[0] = st->r[2] * (5.0 / TWO130);
-        st->s[2] = st->r[4] * (5.0 / TWO130);
-        st->s[4] = st->r[6] * (5.0 / TWO130);
-
-        /*
-         * base 2^32 -> base 2^16
-         */
-        st->r[1] = (st->r[0] + TWO(52) * TWO(16) * TWO0) - TWO(52) * TWO(16) * TWO0;
-        st->r[0] -= st->r[1];
-
-        st->r[3] = (st->r[2] + TWO(52) * TWO(16) * TWO32) - TWO(52) * TWO(16) * TWO32;
-        st->r[2] -= st->r[3];
-
-        st->r[5] = (st->r[4] + TWO(52) * TWO(16) * TWO64) - TWO(52) * TWO(16) * TWO64;
-        st->r[4] -= st->r[5];
-
-        st->r[7] = (st->r[6] + TWO(52) * TWO(16) * TWO96) - TWO(52) * TWO(16) * TWO96;
-        st->r[6] -= st->r[7];
-
-        st->s[1] = (st->s[0] + TWO(52) * TWO(16) * TWO0 / TWO96) - TWO(52) * TWO(16) * TWO0 / TWO96;
-        st->s[0] -= st->s[1];
-
-        st->s[3] = (st->s[2] + TWO(52) * TWO(16) * TWO32 / TWO96) - TWO(52) * TWO(16) * TWO32 / TWO96;
-        st->s[2] -= st->s[3];
-
-        st->s[5] = (st->s[4] + TWO(52) * TWO(16) * TWO64 / TWO96) - TWO(52) * TWO(16) * TWO64 / TWO96;
-        st->s[4] -= st->s[5];
-
-        /*
-         * restore original FPU control register
-         */
-#if defined(__x86_64__)
-        asm volatile("ldmxcsr	%0" ::"m"(mxcsr_orig));
-#elif defined(__PPC__) || defined(__POWERPC__)
-        asm volatile("mtfsf	255,%0" ::"f"(fpscr_orig));
-#elif defined(__s390x__)
-        asm volatile("lfpc	%0" ::"m"(fpc_orig));
-#elif defined(__sparc__)
-        asm volatile("ldx	%0,%%fsr" ::"m"(fsr_orig));
-#elif defined(__mips__)
-        asm volatile("ctc1	%0,$31" ::"r"(fcsr_orig));
-#endif
-    }
-
-    return 0;
-}
-
-void poly1305_blocks(void *ctx, const unsigned char *inp, size_t len,
-    int padbit)
-{
-    poly1305_internal *st = (poly1305_internal *)ctx;
-    elem64 in0, in1, in2, in3;
-    u64 pad = (u64)padbit << 32;
-
-    double x0, x1, x2, x3;
-    double h0lo, h0hi, h1lo, h1hi, h2lo, h2hi, h3lo, h3hi;
-    double c0lo, c0hi, c1lo, c1hi, c2lo, c2hi, c3lo, c3hi;
-
-    const double r0lo = st->r[0];
-    const double r0hi = st->r[1];
-    const double r1lo = st->r[2];
-    const double r1hi = st->r[3];
-    const double r2lo = st->r[4];
-    const double r2hi = st->r[5];
-    const double r3lo = st->r[6];
-    const double r3hi = st->r[7];
-
-    const double s1lo = st->s[0];
-    const double s1hi = st->s[1];
-    const double s2lo = st->s[2];
-    const double s2hi = st->s[3];
-    const double s3lo = st->s[4];
-    const double s3hi = st->s[5];
-
-    /*
-     * set "truncate" rounding mode
-     */
-#if defined(__x86_64__)
-    u32 mxcsr_orig;
-
-    asm volatile("stmxcsr	%0" : "=m"(mxcsr_orig));
-    asm volatile("ldmxcsr	%0" ::"m"(mxcsr));
-#elif defined(__PPC__) || defined(__POWERPC__)
-    double fpscr_orig, fpscr = *(double *)&one;
-
-    asm volatile("mffs		%0" : "=f"(fpscr_orig));
-    asm volatile("mtfsf	255,%0" ::"f"(fpscr));
-#elif defined(__s390x__)
-    u32 fpc_orig;
-
-    asm volatile("stfpc	%0" : "=m"(fpc_orig));
-    asm volatile("lfpc		%0" ::"m"(fpc));
-#elif defined(__sparc__)
-    u64 fsr_orig;
-
-    asm volatile("stx		%%fsr,%0" : "=m"(fsr_orig));
-    asm volatile("ldx		%0,%%fsr" ::"m"(fsr));
-#elif defined(__mips__)
-    u32 fcsr_orig;
-
-    asm volatile("cfc1		%0,$31" : "=r"(fcsr_orig));
-    asm volatile("ctc1		%0,$31" ::"r"(fcsr));
-#endif
-
-    /*
-     * load base 2^32 and de-bias
-     */
-    h0lo = st->h[0].d - TWO(52) * TWO0;
-    h1lo = st->h[1].d - TWO(52) * TWO32;
-    h2lo = st->h[2].d - TWO(52) * TWO64;
-    h3lo = st->h[3].d - TWO(52) * TWO96;
-
-#ifdef __clang__
-    h0hi = 0;
-    h1hi = 0;
-    h2hi = 0;
-    h3hi = 0;
-#else
-    in0.u = EXP(52 + 0) | U8TOU32(&inp[0]);
-    in1.u = EXP(52 + 32) | U8TOU32(&inp[4]);
-    in2.u = EXP(52 + 64) | U8TOU32(&inp[8]);
-    in3.u = EXP(52 + 96) | U8TOU32(&inp[12]) | pad;
-
-    x0 = in0.d - TWO(52) * TWO0;
-    x1 = in1.d - TWO(52) * TWO32;
-    x2 = in2.d - TWO(52) * TWO64;
-    x3 = in3.d - TWO(52) * TWO96;
-
-    x0 += h0lo;
-    x1 += h1lo;
-    x2 += h2lo;
-    x3 += h3lo;
-
-    goto fast_entry;
-#endif
-
-    do {
-        in0.u = EXP(52 + 0) | U8TOU32(&inp[0]);
-        in1.u = EXP(52 + 32) | U8TOU32(&inp[4]);
-        in2.u = EXP(52 + 64) | U8TOU32(&inp[8]);
-        in3.u = EXP(52 + 96) | U8TOU32(&inp[12]) | pad;
-
-        x0 = in0.d - TWO(52) * TWO0;
-        x1 = in1.d - TWO(52) * TWO32;
-        x2 = in2.d - TWO(52) * TWO64;
-        x3 = in3.d - TWO(52) * TWO96;
-
-        /*
-         * note that there are multiple ways to accumulate input, e.g.
-         * one can as well accumulate to h0lo-h1lo-h1hi-h2hi...
-         */
-        h0lo += x0;
-        h0hi += x1;
-        h2lo += x2;
-        h2hi += x3;
-
-        /*
-         * carries that cross 32n-bit (and 130-bit) boundaries
-         */
-        c0lo = (h0lo + TWO(52) * TWO32) - TWO(52) * TWO32;
-        c1lo = (h1lo + TWO(52) * TWO64) - TWO(52) * TWO64;
-        c2lo = (h2lo + TWO(52) * TWO96) - TWO(52) * TWO96;
-        c3lo = (h3lo + TWO(52) * TWO130) - TWO(52) * TWO130;
-
-        c0hi = (h0hi + TWO(52) * TWO32) - TWO(52) * TWO32;
-        c1hi = (h1hi + TWO(52) * TWO64) - TWO(52) * TWO64;
-        c2hi = (h2hi + TWO(52) * TWO96) - TWO(52) * TWO96;
-        c3hi = (h3hi + TWO(52) * TWO130) - TWO(52) * TWO130;
-
-        /*
-         * base 2^48 -> base 2^32 with last reduction step
-         */
-        x1 = (h1lo - c1lo) + c0lo;
-        x2 = (h2lo - c2lo) + c1lo;
-        x3 = (h3lo - c3lo) + c2lo;
-        x0 = (h0lo - c0lo) + c3lo * (5.0 / TWO130);
-
-        x1 += (h1hi - c1hi) + c0hi;
-        x2 += (h2hi - c2hi) + c1hi;
-        x3 += (h3hi - c3hi) + c2hi;
-        x0 += (h0hi - c0hi) + c3hi * (5.0 / TWO130);
-
-#ifndef __clang__
-    fast_entry:
-#endif
-        /*
-         * base 2^32 * base 2^16 = base 2^48
-         */
-        h0lo = s3lo * x1 + s2lo * x2 + s1lo * x3 + r0lo * x0;
-        h1lo = r0lo * x1 + s3lo * x2 + s2lo * x3 + r1lo * x0;
-        h2lo = r1lo * x1 + r0lo * x2 + s3lo * x3 + r2lo * x0;
-        h3lo = r2lo * x1 + r1lo * x2 + r0lo * x3 + r3lo * x0;
-
-        h0hi = s3hi * x1 + s2hi * x2 + s1hi * x3 + r0hi * x0;
-        h1hi = r0hi * x1 + s3hi * x2 + s2hi * x3 + r1hi * x0;
-        h2hi = r1hi * x1 + r0hi * x2 + s3hi * x3 + r2hi * x0;
-        h3hi = r2hi * x1 + r1hi * x2 + r0hi * x3 + r3hi * x0;
-
-        inp += 16;
-        len -= 16;
-
-    } while (len >= 16);
-
-    /*
-     * carries that cross 32n-bit (and 130-bit) boundaries
-     */
-    c0lo = (h0lo + TWO(52) * TWO32) - TWO(52) * TWO32;
-    c1lo = (h1lo + TWO(52) * TWO64) - TWO(52) * TWO64;
-    c2lo = (h2lo + TWO(52) * TWO96) - TWO(52) * TWO96;
-    c3lo = (h3lo + TWO(52) * TWO130) - TWO(52) * TWO130;
-
-    c0hi = (h0hi + TWO(52) * TWO32) - TWO(52) * TWO32;
-    c1hi = (h1hi + TWO(52) * TWO64) - TWO(52) * TWO64;
-    c2hi = (h2hi + TWO(52) * TWO96) - TWO(52) * TWO96;
-    c3hi = (h3hi + TWO(52) * TWO130) - TWO(52) * TWO130;
-
-    /*
-     * base 2^48 -> base 2^32 with last reduction step
-     */
-    x1 = (h1lo - c1lo) + c0lo;
-    x2 = (h2lo - c2lo) + c1lo;
-    x3 = (h3lo - c3lo) + c2lo;
-    x0 = (h0lo - c0lo) + c3lo * (5.0 / TWO130);
-
-    x1 += (h1hi - c1hi) + c0hi;
-    x2 += (h2hi - c2hi) + c1hi;
-    x3 += (h3hi - c3hi) + c2hi;
-    x0 += (h0hi - c0hi) + c3hi * (5.0 / TWO130);
-
-    /*
-     * store base 2^32, with bias
-     */
-    st->h[1].d = x1 + TWO(52) * TWO32;
-    st->h[2].d = x2 + TWO(52) * TWO64;
-    st->h[3].d = x3 + TWO(52) * TWO96;
-    st->h[0].d = x0 + TWO(52) * TWO0;
-
-    /*
-     * restore original FPU control register
-     */
-#if defined(__x86_64__)
-    asm volatile("ldmxcsr	%0" ::"m"(mxcsr_orig));
-#elif defined(__PPC__) || defined(__POWERPC__)
-    asm volatile("mtfsf	255,%0" ::"f"(fpscr_orig));
-#elif defined(__s390x__)
-    asm volatile("lfpc		%0" ::"m"(fpc_orig));
-#elif defined(__sparc__)
-    asm volatile("ldx		%0,%%fsr" ::"m"(fsr_orig));
-#elif defined(__mips__)
-    asm volatile("ctc1		%0,$31" ::"r"(fcsr_orig));
-#endif
-}
-
-void poly1305_emit(void *ctx, unsigned char mac[16], const u32 nonce[4])
-{
-    poly1305_internal *st = (poly1305_internal *)ctx;
-    u64 h0, h1, h2, h3, h4;
-    u32 g0, g1, g2, g3, g4;
-    u64 t;
-    u32 mask;
-
-    /*
-     * thanks to bias masking exponent gives integer result
-     */
-    h0 = st->h[0].u & 0x000fffffffffffffULL;
-    h1 = st->h[1].u & 0x000fffffffffffffULL;
-    h2 = st->h[2].u & 0x000fffffffffffffULL;
-    h3 = st->h[3].u & 0x000fffffffffffffULL;
-
-    /*
-     * can be partially reduced, so reduce...
-     */
-    h4 = h3 >> 32;
-    h3 &= 0xffffffffU;
-    g4 = h4 & -4;
-    h4 &= 3;
-    g4 += g4 >> 2;
-
-    h0 += g4;
-    h1 += h0 >> 32;
-    h0 &= 0xffffffffU;
-    h2 += h1 >> 32;
-    h1 &= 0xffffffffU;
-    h3 += h2 >> 32;
-    h2 &= 0xffffffffU;
-
-    /* compute h + -p */
-    g0 = (u32)(t = h0 + 5);
-    g1 = (u32)(t = h1 + (t >> 32));
-    g2 = (u32)(t = h2 + (t >> 32));
-    g3 = (u32)(t = h3 + (t >> 32));
-    g4 = h4 + (u32)(t >> 32);
-
-    /* if there was carry, select g0-g3 */
-    mask = 0 - (g4 >> 2);
-    g0 &= mask;
-    g1 &= mask;
-    g2 &= mask;
-    g3 &= mask;
-    mask = ~mask;
-    g0 |= (h0 & mask);
-    g1 |= (h1 & mask);
-    g2 |= (h2 & mask);
-    g3 |= (h3 & mask);
-
-    /* mac = (h + nonce) % (2^128) */
-    g0 = (u32)(t = (u64)g0 + nonce[0]);
-    g1 = (u32)(t = (u64)g1 + (t >> 32) + nonce[1]);
-    g2 = (u32)(t = (u64)g2 + (t >> 32) + nonce[2]);
-    g3 = (u32)(t = (u64)g3 + (t >> 32) + nonce[3]);
-
-    U32TO8(mac + 0, g0);
-    U32TO8(mac + 4, g1);
-    U32TO8(mac + 8, g2);
-    U32TO8(mac + 12, g3);
-}
diff --git a/deps/openssl/openssl/crypto/poly1305/poly1305_ppc.c b/deps/openssl/openssl/crypto/poly1305/poly1305_ppc.c
index a40ce729b72..32aa67041a8 100644
--- a/deps/openssl/openssl/crypto/poly1305/poly1305_ppc.c
+++ b/deps/openssl/openssl/crypto/poly1305/poly1305_ppc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2009-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -10,7 +10,7 @@
 #include <openssl/opensslconf.h>
 #include <openssl/types.h>
 #include "crypto/poly1305.h"
-#include "crypto/ppc_arch.h"
+#include "arch/ppc_arch.h"

 void poly1305_init_int(void *ctx, const unsigned char key[16]);
 void poly1305_blocks(void *ctx, const unsigned char *inp, size_t len,
diff --git a/deps/openssl/openssl/crypto/ppccap.c b/deps/openssl/openssl/crypto/ppccap.c
index 58ee452fa38..a258cf316d5 100644
--- a/deps/openssl/openssl/crypto/ppccap.c
+++ b/deps/openssl/openssl/crypto/ppccap.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2009-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -28,7 +28,7 @@
 #endif
 #include <openssl/crypto.h>
 #include "internal/cryptlib.h"
-#include "crypto/ppc_arch.h"
+#include "arch/ppc_arch.h"

 unsigned int OPENSSL_ppccap_P = 0;

@@ -101,7 +101,7 @@ size_t OPENSSL_instrument_bus2(unsigned int *out, size_t cnt, size_t max)

 #if defined(__FreeBSD__) || defined(__OpenBSD__)
 #include <sys/param.h>
-#if (defined(__FreeBSD__) && __FreeBSD_version >= 1200000) || (defined(__OpenBSD__) && OpenBSD >= 202409)
+#if (defined(__FreeBSD__) && __FreeBSD_version >= 1104000) || (defined(__OpenBSD__) && OpenBSD >= 202409)
 #include <sys/auxv.h>
 #define OSSL_IMPLEMENT_GETAUXVAL

@@ -134,7 +134,7 @@ static unsigned long getauxval(unsigned long key)
 #define HWCAP_ARCH_3_00 (1U << 23)
 #define HWCAP_ARCH_3_1 (1U << 18)

-#if defined(__GNUC__) && __GNUC__ >= 2
+#if defined(__GNUC__)
 __attribute__((constructor))
 #endif
 void OPENSSL_cpuid_setup(void)
@@ -160,11 +160,16 @@ void OPENSSL_cpuid_setup(void)

     if (sizeof(size_t) == 4) {
         struct utsname uts;
+        long major;
+        char *end;
 #if defined(_SC_AIX_KERNEL_BITMODE)
         if (sysconf(_SC_AIX_KERNEL_BITMODE) != 64)
             return;
 #endif
-        if (uname(&uts) != 0 || atoi(uts.version) < 6)
+        if (uname(&uts) != 0
+            || !ossl_strtol(uts.version, &end, 10, &major)
+            || (*end != '\0' && *end != '.')
+            || major < 6)
             return;
     }

diff --git a/deps/openssl/openssl/crypto/ppccpuid.pl b/deps/openssl/openssl/crypto/ppccpuid.pl
index 2814e72f509..9d5470265ff 100755
--- a/deps/openssl/openssl/crypto/ppccpuid.pl
+++ b/deps/openssl/openssl/crypto/ppccpuid.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2022 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -91,40 +91,6 @@ $code=<<___;
 	.byte	0,12,0x14,0,0,0,0,0
 .size	.OPENSSL_brd31_probe,.-.OPENSSL_brd31_probe

-
-.globl	.OPENSSL_wipe_cpu
-.align	4
-.OPENSSL_wipe_cpu:
-	xor	r0,r0,r0
-	fmr	f0,f31
-	fmr	f1,f31
-	fmr	f2,f31
-	mr	r3,r1
-	fmr	f3,f31
-	xor	r4,r4,r4
-	fmr	f4,f31
-	xor	r5,r5,r5
-	fmr	f5,f31
-	xor	r6,r6,r6
-	fmr	f6,f31
-	xor	r7,r7,r7
-	fmr	f7,f31
-	xor	r8,r8,r8
-	fmr	f8,f31
-	xor	r9,r9,r9
-	fmr	f9,f31
-	xor	r10,r10,r10
-	fmr	f10,f31
-	xor	r11,r11,r11
-	fmr	f11,f31
-	xor	r12,r12,r12
-	fmr	f12,f31
-	fmr	f13,f31
-	blr
-	.long	0
-	.byte	0,12,0x14,0,0,0,0,0
-.size	.OPENSSL_wipe_cpu,.-.OPENSSL_wipe_cpu
-
 .globl	.OPENSSL_atomic_add
 .align	4
 .OPENSSL_atomic_add:
diff --git a/deps/openssl/openssl/crypto/property/property.c b/deps/openssl/openssl/crypto/property/property.c
index 210a3afe76b..67219a8d41d 100644
--- a/deps/openssl/openssl/crypto/property/property.c
+++ b/deps/openssl/openssl/crypto/property/property.c
@@ -12,26 +12,35 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <openssl/crypto.h>
-#include "internal/core.h"
+#include <openssl/provider.h>
 #include "internal/property.h"
 #include "internal/provider.h"
 #include "internal/tsan_assist.h"
-#include "crypto/ctype.h"
+#include "internal/threads_common.h"
+#include "internal/list.h"
+#include "internal/time.h"
 #include <openssl/lhash.h>
 #include <openssl/rand.h>
 #include <openssl/trace.h>
-#include "internal/thread_once.h"
-#include "crypto/lhash.h"
 #include "crypto/sparse_array.h"
 #include "property_local.h"
 #include "crypto/context.h"

 /*
- * The number of elements in the query cache before we initiate a flush.
- * If reducing this, also ensure the stochastic test in test/property_test.c
- * isn't likely to fail.
+ * The shard count was determined through performance testing with the evp_fetch
+ * tool on an Intel Xeon Gold 6248R CPU @ 3.00GHz. Testing showed that 4 shards
+ * delivered the best performance for 16 or
+ * more threads, and close to best performance at below 16 threads.
  */
-#define IMPL_CACHE_FLUSH_THRESHOLD 500
+#ifndef NUM_SHARDS_BITS
+#define NUM_SHARDS_BITS 2
+#endif
+#define NUM_SHARDS (1 << NUM_SHARDS_BITS)
+
+#ifndef MAX_CACHE_LINES_BITS
+#define MAX_CACHE_LINES_BITS 3
+#endif
+#define MAX_CACHE_LINES (1 << MAX_CACHE_LINES_BITS)

 typedef struct {
     void *method;
@@ -40,6 +49,7 @@ typedef struct {
 } METHOD;

 typedef struct {
+    int archived;
     const OSSL_PROVIDER *provider;
     OSSL_PROPERTY_LIST *properties;
     METHOD method;
@@ -47,30 +57,50 @@ typedef struct {

 DEFINE_STACK_OF(IMPLEMENTATION)

-typedef struct {
-    const OSSL_PROVIDER *provider;
-    const char *query;
-    METHOD method;
-    char body[1];
+typedef struct query_st {
+    struct query_st *next; /* list pointer for lookup table */
+    void *saptr; /* pointer to our owning STORED_ALGORITHM */
+    int nid; /* nid of this query */
+    int archived; /* Mark entry as no longer findable */
+    OSSL_PROVIDER *prov; /*provider this belongs to */
+    char *prop_query; /* query string */
+    METHOD method; /* METHOD for this query */
 } QUERY;

-DEFINE_LHASH_OF_EX(QUERY);
-
 typedef struct {
     int nid;
     STACK_OF(IMPLEMENTATION) *impls;
-    LHASH_OF(QUERY) *cache;
 } ALGORITHM;

-struct ossl_method_store_st {
-    OSSL_LIB_CTX *ctx;
+typedef struct {
     SPARSE_ARRAY_OF(ALGORITHM) *algs;
+
+    QUERY *cache_lists[MAX_CACHE_LINES];
+    QUERY *archive;
+
     /*
-     * Lock to protect the |algs| array from concurrent writing, when
-     * individual implementations or queries are inserted.  This is used
+     * Lock to protect each shard of |algs| from concurrent writing,
+     * when individual implementations or queries are inserted.  This is used
      * by the appropriate functions here.
      */
     CRYPTO_RWLOCK *lock;
+    CRYPTO_RWLOCK *alock;
+
+    /* query cache specific values */
+
+} STORED_ALGORITHMS;
+
+static int ossl_method_store_atomic_insert_to_list(STORED_ALGORITHMS *sa, QUERY *new);
+static int ossl_method_store_atomic_archive(STORED_ALGORITHMS *sa, QUERY *old);
+static QUERY *ossl_method_store_atomic_find_in_list(STORED_ALGORITHMS *sa, int nid,
+    OSSL_PROVIDER *prov, const char *prop_query);
+static void ossl_cache_lists_flush(STORED_ALGORITHMS *sa);
+static void ossl_cache_lists_free(STORED_ALGORITHMS *sa);
+static void ossl_method_store_atomic_clean_archive(STORED_ALGORITHMS *sa);
+
+struct ossl_method_store_st {
+    OSSL_LIB_CTX *ctx;
+    STORED_ALGORITHMS *algs;
     /*
      * Lock to reserve the whole store.  This is used when fetching a set
      * of algorithms, via these functions, found in crypto/core_fetch.c:
@@ -78,23 +108,8 @@ struct ossl_method_store_st {
      * ossl_method_construct_unreserve_store()
      */
     CRYPTO_RWLOCK *biglock;
-
-    /* query cache specific values */
-
-    /* Count of the query cache entries for all algs */
-    size_t cache_nelem;
-
-    /* Flag: 1 if query cache entries for all algs need flushing */
-    int cache_need_flush;
 };

-typedef struct {
-    LHASH_OF(QUERY) *cache;
-    size_t nelem;
-    uint32_t seed;
-    unsigned char using_global_seed;
-} IMPL_CACHE_FLUSH;
-
 DEFINE_SPARSE_ARRAY_OF(ALGORITHM);

 DEFINE_STACK_OF(ALGORITHM)
@@ -106,9 +121,32 @@ typedef struct ossl_global_properties_st {
 #endif
 } OSSL_GLOBAL_PROPERTIES;

-static void ossl_method_cache_flush_alg(OSSL_METHOD_STORE *store,
+#define stored_algs_shard(store, nid) (&(store)->algs[(nid) & (NUM_SHARDS - 1)])
+
+static void ossl_method_cache_flush_alg(STORED_ALGORITHMS *sa,
     ALGORITHM *alg);
-static void ossl_method_cache_flush(OSSL_METHOD_STORE *store, int nid);
+static void ossl_method_cache_flush(STORED_ALGORITHMS *sa, int nid);
+
+static ossl_inline QUERY *QUERY_new(size_t prop_query_len)
+{
+    /*
+     * allocate a new QUERY with the associated property query buffer
+     * immediately following it
+     */
+    QUERY *new = OPENSSL_malloc(sizeof(QUERY) + prop_query_len + 1);
+    if (new != NULL)
+        new->prop_query = (char *)(new + 1);
+    return new;
+}
+
+static ossl_inline void QUERY_free(QUERY *q)
+{
+    /*
+     * because we allocate the QUERY with its property query string
+     * as one contiguous chunk, this frees both
+     */
+    OPENSSL_free(q);
+}

 /* Global properties are stored per library context */
 void ossl_ctx_global_properties_free(void *vglobp)
@@ -169,37 +207,21 @@ static void ossl_method_free(METHOD *method)
     (*method->free)(method->method);
 }

-static __owur int ossl_property_read_lock(OSSL_METHOD_STORE *p)
+static __owur int ossl_property_read_lock(STORED_ALGORITHMS *p)
 {
     return p != NULL ? CRYPTO_THREAD_read_lock(p->lock) : 0;
 }

-static __owur int ossl_property_write_lock(OSSL_METHOD_STORE *p)
+static __owur int ossl_property_write_lock(STORED_ALGORITHMS *p)
 {
     return p != NULL ? CRYPTO_THREAD_write_lock(p->lock) : 0;
 }

-static int ossl_property_unlock(OSSL_METHOD_STORE *p)
+static int ossl_property_unlock(STORED_ALGORITHMS *p)
 {
     return p != 0 ? CRYPTO_THREAD_unlock(p->lock) : 0;
 }

-static unsigned long query_hash(const QUERY *a)
-{
-    return OPENSSL_LH_strhash(a->query);
-}
-
-static int query_cmp(const QUERY *a, const QUERY *b)
-{
-    int res = strcmp(a->query, b->query);
-
-    if (res == 0 && a->provider != NULL && b->provider != NULL)
-        res = b->provider > a->provider ? 1
-            : b->provider < a->provider ? -1
-                                        : 0;
-    return res;
-}
-
 static void impl_free(IMPLEMENTATION *impl)
 {
     if (impl != NULL) {
@@ -208,32 +230,92 @@ static void impl_free(IMPLEMENTATION *impl)
     }
 }

-static void impl_cache_free(QUERY *elem)
+static ossl_inline void impl_cache_free_unlinked(QUERY *elem)
 {
     if (elem != NULL) {
         ossl_method_free(&elem->method);
-        OPENSSL_free(elem);
+        QUERY_free(elem);
     }
 }

-static void impl_cache_flush_alg(ossl_uintmax_t idx, ALGORITHM *alg)
+static void impl_cache_flush_alg(ALGORITHM *alg, STORED_ALGORITHMS *sa)
 {
-    lh_QUERY_doall(alg->cache, &impl_cache_free);
-    lh_QUERY_flush(alg->cache);
+    QUERY *q;
+    int i;
+
+    /*
+     * Instead of iterating over the hashtable with the
+     * ossl_ht_foreach_until function, we just traverse the
+     * linked list, as it much faster this way, as we avoid having
+     * to visit lots of potentially empty nodes
+     */
+    for (i = 0; i < MAX_CACHE_LINES; i++) {
+        if (!CRYPTO_atomic_load_ptr((void **)&sa->cache_lists[i], (void **)&q, sa->alock))
+            return;
+        while (q != NULL) {
+            if (q->nid == alg->nid)
+                ossl_method_store_atomic_archive(sa, q);
+            if (!CRYPTO_atomic_load_ptr((void **)&q->next, (void **)&q, sa->alock))
+                return;
+        }
+    }
 }

 static void alg_cleanup(ossl_uintmax_t idx, ALGORITHM *a, void *arg)
 {
-    OSSL_METHOD_STORE *store = arg;
+    STORED_ALGORITHMS *sa = arg;

     if (a != NULL) {
         sk_IMPLEMENTATION_pop_free(a->impls, &impl_free);
-        lh_QUERY_doall(a->cache, &impl_cache_free);
-        lh_QUERY_free(a->cache);
         OPENSSL_free(a);
     }
-    if (store != NULL)
-        ossl_sa_ALGORITHM_set(store->algs, idx, NULL);
+    if (sa != NULL)
+        ossl_sa_ALGORITHM_set(sa->algs, idx, NULL);
+}
+
+static void stored_algs_free(STORED_ALGORITHMS *sa)
+{
+    if (sa == NULL)
+        return;
+
+    for (int i = 0; i < NUM_SHARDS; ++i) {
+        ossl_sa_ALGORITHM_doall_arg(sa[i].algs, &alg_cleanup, &sa[i]);
+        ossl_sa_ALGORITHM_free(sa[i].algs);
+        ossl_cache_lists_free(&sa[i]);
+        CRYPTO_THREAD_lock_free(sa[i].lock);
+        CRYPTO_THREAD_lock_free(sa[i].alock);
+    }
+
+    OPENSSL_free(sa);
+}
+
+static STORED_ALGORITHMS *stored_algs_new(OSSL_LIB_CTX *ctx)
+{
+    STORED_ALGORITHMS *ret;
+
+    ret = OPENSSL_calloc(NUM_SHARDS, sizeof(STORED_ALGORITHMS));
+    if (ret == NULL)
+        return NULL;
+
+    for (int i = 0; i < NUM_SHARDS; ++i) {
+        ret[i].algs = ossl_sa_ALGORITHM_new();
+        if (ret[i].algs == NULL)
+            goto err;
+
+        ret[i].lock = CRYPTO_THREAD_lock_new();
+        if (ret[i].lock == NULL)
+            goto err;
+        ret[i].alock = CRYPTO_THREAD_lock_new();
+        if (ret[i].alock == NULL)
+            goto err;
+    }
+
+    return ret;
+
+err:
+    stored_algs_free(ret);
+
+    return NULL;
 }

 /*
@@ -247,8 +329,7 @@ OSSL_METHOD_STORE *ossl_method_store_new(OSSL_LIB_CTX *ctx)
     res = OPENSSL_zalloc(sizeof(*res));
     if (res != NULL) {
         res->ctx = ctx;
-        if ((res->algs = ossl_sa_ALGORITHM_new()) == NULL
-            || (res->lock = CRYPTO_THREAD_lock_new()) == NULL
+        if ((res->algs = stored_algs_new(ctx)) == NULL
             || (res->biglock = CRYPTO_THREAD_lock_new()) == NULL) {
             ossl_method_store_free(res);
             return NULL;
@@ -259,14 +340,12 @@ OSSL_METHOD_STORE *ossl_method_store_new(OSSL_LIB_CTX *ctx)

 void ossl_method_store_free(OSSL_METHOD_STORE *store)
 {
-    if (store != NULL) {
-        if (store->algs != NULL)
-            ossl_sa_ALGORITHM_doall_arg(store->algs, &alg_cleanup, store);
-        ossl_sa_ALGORITHM_free(store->algs);
-        CRYPTO_THREAD_lock_free(store->lock);
-        CRYPTO_THREAD_lock_free(store->biglock);
-        OPENSSL_free(store);
-    }
+    if (store == NULL)
+        return;
+
+    stored_algs_free(store->algs);
+    CRYPTO_THREAD_lock_free(store->biglock);
+    OPENSSL_free(store);
 }

 int ossl_method_lock_store(OSSL_METHOD_STORE *store)
@@ -279,14 +358,14 @@ int ossl_method_unlock_store(OSSL_METHOD_STORE *store)
     return store != NULL ? CRYPTO_THREAD_unlock(store->biglock) : 0;
 }

-static ALGORITHM *ossl_method_store_retrieve(OSSL_METHOD_STORE *store, int nid)
+static ALGORITHM *ossl_method_store_retrieve(STORED_ALGORITHMS *sa, int nid)
 {
-    return ossl_sa_ALGORITHM_get(store->algs, nid);
+    return ossl_sa_ALGORITHM_get(sa->algs, nid);
 }

-static int ossl_method_store_insert(OSSL_METHOD_STORE *store, ALGORITHM *alg)
+static int ossl_method_store_insert(STORED_ALGORITHMS *sa, ALGORITHM *alg)
 {
-    return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg);
+    return ossl_sa_ALGORITHM_set(sa->algs, alg->nid, alg);
 }

 /**
@@ -319,6 +398,7 @@ int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov,
     int (*method_up_ref)(void *),
     void (*method_destruct)(void *))
 {
+    STORED_ALGORITHMS *sa;
     ALGORITHM *alg = NULL;
     IMPLEMENTATION *impl;
     int ret = 0;
@@ -337,6 +417,7 @@ int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov,
     impl = OPENSSL_malloc(sizeof(*impl));
     if (impl == NULL)
         return 0;
+    impl->archived = 0;
     impl->method.method = method;
     impl->method.up_ref = method_up_ref;
     impl->method.free = method_destruct;
@@ -346,8 +427,10 @@ int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov,
     }
     impl->provider = prov;

+    sa = stored_algs_shard(store, nid);
+
     /* Insert into the hash table if required */
-    if (!ossl_property_write_lock(store)) {
+    if (!ossl_property_write_lock(sa)) {
         impl_free(impl);
         return 0;
     }
@@ -363,7 +446,7 @@ int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov,
      * method to the algorithm cache, in case the one selected by the next
      * query selects a different implementation
      */
-    ossl_method_cache_flush(store, nid);
+    ossl_method_cache_flush(sa, nid);

     /*
      * Parse the properties associated with this method, and convert it to a
@@ -385,22 +468,25 @@ int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov,
      * Check if we have an algorithm cache already for this nid.  If so use
      * it, otherwise, create it, and insert it into the store
      */
-    alg = ossl_method_store_retrieve(store, nid);
+    alg = ossl_method_store_retrieve(sa, nid);
     if (alg == NULL) {
         if ((alg = OPENSSL_zalloc(sizeof(*alg))) == NULL
-            || (alg->impls = sk_IMPLEMENTATION_new_null()) == NULL
-            || (alg->cache = lh_QUERY_new(&query_hash, &query_cmp)) == NULL)
+            || (alg->impls = sk_IMPLEMENTATION_new_null()) == NULL)
             goto err;
         alg->nid = nid;
-        if (!ossl_method_store_insert(store, alg))
+        if (!ossl_method_store_insert(sa, alg))
             goto err;
-        OSSL_TRACE2(QUERY, "Inserted an alg with nid %d into the store %p\n", nid, (void *)store);
+        OSSL_TRACE2(QUERY, "Inserted an alg with nid %d into the stored algorithms %p\n",
+            nid, (void *)sa);
     }

     /* Push onto stack if there isn't one there already */
     for (i = 0; i < sk_IMPLEMENTATION_num(alg->impls); i++) {
         const IMPLEMENTATION *tmpimpl = sk_IMPLEMENTATION_value(alg->impls, i);

+        if (tmpimpl->archived == 1)
+            continue;
+
         if (tmpimpl->provider == impl->provider
             && tmpimpl->properties == impl->properties)
             break;
@@ -420,13 +506,13 @@ int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov,
         OSSL_TRACE_END(QUERY);
 #endif
     }
-    ossl_property_unlock(store);
+    ossl_property_unlock(sa);
     if (ret == 0)
         impl_free(impl);
     return ret;

 err:
-    ossl_property_unlock(store);
+    ossl_property_unlock(sa);
     alg_cleanup(0, alg, NULL);
     impl_free(impl);
     return 0;
@@ -436,17 +522,20 @@ int ossl_method_store_remove(OSSL_METHOD_STORE *store, int nid,
     const void *method)
 {
     ALGORITHM *alg = NULL;
+    STORED_ALGORITHMS *sa;
     int i;

     if (nid <= 0 || method == NULL || store == NULL)
         return 0;

-    if (!ossl_property_write_lock(store))
+    sa = stored_algs_shard(store, nid);
+    if (!ossl_property_write_lock(sa))
         return 0;
-    ossl_method_cache_flush(store, nid);
-    alg = ossl_method_store_retrieve(store, nid);
+    ossl_method_cache_flush(sa, nid);
+    ossl_method_store_atomic_clean_archive(sa);
+    alg = ossl_method_store_retrieve(sa, nid);
     if (alg == NULL) {
-        ossl_property_unlock(store);
+        ossl_property_unlock(sa);
         return 0;
     }

@@ -461,16 +550,16 @@ int ossl_method_store_remove(OSSL_METHOD_STORE *store, int nid,
         if (impl->method.method == method) {
             impl_free(impl);
             (void)sk_IMPLEMENTATION_delete(alg->impls, i);
-            ossl_property_unlock(store);
+            ossl_property_unlock(sa);
             return 1;
         }
     }
-    ossl_property_unlock(store);
+    ossl_property_unlock(sa);
     return 0;
 }

 struct alg_cleanup_by_provider_data_st {
-    OSSL_METHOD_STORE *store;
+    STORED_ALGORITHMS *sa;
     const OSSL_PROVIDER *prov;
 };

@@ -518,10 +607,8 @@ alg_cleanup_by_provider(ossl_uintmax_t idx, ALGORITHM *alg, void *arg)
             }
             OSSL_TRACE_END(QUERY);
 #endif
-
-            (void)sk_IMPLEMENTATION_delete(alg->impls, i);
+            impl->archived = 1;
             count++;
-            impl_free(impl);
         }
     }

@@ -532,7 +619,7 @@ alg_cleanup_by_provider(ossl_uintmax_t idx, ALGORITHM *alg, void *arg)
      * any implementation, though.
      */
     if (count > 0)
-        ossl_method_cache_flush_alg(data->store, alg);
+        ossl_method_cache_flush_alg(data->sa, alg);
 }

 int ossl_method_store_remove_all_provided(OSSL_METHOD_STORE *store,
@@ -540,12 +627,17 @@ int ossl_method_store_remove_all_provided(OSSL_METHOD_STORE *store,
 {
     struct alg_cleanup_by_provider_data_st data;

-    if (!ossl_property_write_lock(store))
-        return 0;
-    data.prov = prov;
-    data.store = store;
-    ossl_sa_ALGORITHM_doall_arg(store->algs, &alg_cleanup_by_provider, &data);
-    ossl_property_unlock(store);
+    for (int k = 0; k < NUM_SHARDS; ++k) {
+        STORED_ALGORITHMS *sa = &store->algs[k];
+
+        if (!ossl_property_write_lock(sa))
+            return 0;
+        data.prov = prov;
+        data.sa = sa;
+        ossl_sa_ALGORITHM_doall_arg(sa->algs, &alg_cleanup_by_provider, &data);
+        ossl_method_store_atomic_clean_archive(sa);
+        ossl_property_unlock(sa);
+    }
     return 1;
 }

@@ -559,6 +651,8 @@ static void alg_do_one(ALGORITHM *alg, IMPLEMENTATION *impl,
 static void alg_copy(ossl_uintmax_t idx, ALGORITHM *alg, void *arg)
 {
     STACK_OF(ALGORITHM) *newalg = arg;
+    int i;
+    IMPLEMENTATION *impl;

     alg = OPENSSL_memdup(alg, sizeof(ALGORITHM));
     if (alg == NULL)
@@ -566,6 +660,17 @@ static void alg_copy(ossl_uintmax_t idx, ALGORITHM *alg, void *arg)

     alg->impls = sk_IMPLEMENTATION_dup(alg->impls);

+    /*
+     * Remove any archived items while we're under lock
+     * note we don't have to free the implementation here
+     * as its still tracked in the alg struct we're cloning from
+     */
+    for (i = sk_IMPLEMENTATION_num(alg->impls); i-- > 0;) {
+        impl = sk_IMPLEMENTATION_value(alg->impls, i);
+        if (impl->archived == 1)
+            (void)sk_IMPLEMENTATION_delete(alg->impls, i);
+    }
+
     (void)sk_ALGORITHM_push(newalg, alg);
 }

@@ -584,20 +689,24 @@ void ossl_method_store_do_all(OSSL_METHOD_STORE *store,
     STACK_OF(ALGORITHM) *tmpalgs;
     ALGORITHM *alg;

-    if (store != NULL) {
+    if (store == NULL)
+        return;
+
+    for (int k = 0; k < NUM_SHARDS; ++k) {
+        STORED_ALGORITHMS *sa = &store->algs[k];

-        if (!ossl_property_read_lock(store))
+        if (!ossl_property_read_lock(sa))
             return;

         tmpalgs = sk_ALGORITHM_new_reserve(NULL,
-            ossl_sa_ALGORITHM_num(store->algs));
+            (int)ossl_sa_ALGORITHM_num(sa->algs));
         if (tmpalgs == NULL) {
-            ossl_property_unlock(store);
+            ossl_property_unlock(sa);
             return;
         }

-        ossl_sa_ALGORITHM_doall_arg(store->algs, alg_copy, tmpalgs);
-        ossl_property_unlock(store);
+        ossl_sa_ALGORITHM_doall_arg(sa->algs, alg_copy, tmpalgs);
+        ossl_property_unlock(sa);
         numalgs = sk_ALGORITHM_num(tmpalgs);
         for (i = 0; i < numalgs; i++) {
             alg = sk_ALGORITHM_value(tmpalgs, i);
@@ -643,6 +752,7 @@ int ossl_method_store_fetch(OSSL_METHOD_STORE *store,
     const OSSL_PROVIDER *prov = prov_rw != NULL ? *prov_rw : NULL;
     int ret = 0;
     int j, best = -1, score, optional;
+    STORED_ALGORITHMS *sa;

     if (nid <= 0 || method == NULL || store == NULL)
         return 0;
@@ -653,18 +763,23 @@ int ossl_method_store_fetch(OSSL_METHOD_STORE *store,
         return 0;
 #endif

+    sa = stored_algs_shard(store, nid);
+
     /* This only needs to be a read lock, because the query won't create anything */
-    if (!ossl_property_read_lock(store))
+    if (!ossl_property_read_lock(sa))
         return 0;

-    OSSL_TRACE2(QUERY, "Retrieving by nid %d from store %p\n", nid, (void *)store);
-    alg = ossl_method_store_retrieve(store, nid);
+    OSSL_TRACE2(QUERY, "Retrieving by nid %d from stored algorithms %p\n",
+        nid, (void *)sa);
+    alg = ossl_method_store_retrieve(sa, nid);
     if (alg == NULL) {
-        ossl_property_unlock(store);
-        OSSL_TRACE2(QUERY, "Failed to retrieve by nid %d from store %p\n", nid, (void *)store);
+        ossl_property_unlock(sa);
+        OSSL_TRACE2(QUERY, "Failed to retrieve by nid %d from stored algorithms %p\n",
+            nid, (void *)sa);
         return 0;
     }
-    OSSL_TRACE2(QUERY, "Retrieved by nid %d from store %p\n", nid, (void *)store);
+    OSSL_TRACE2(QUERY, "Retrieved by nid %d from stored algorithms %p\n",
+        nid, (void *)sa);

     /*
      * If a property query string is provided, convert it to an
@@ -699,8 +814,11 @@ int ossl_method_store_fetch(OSSL_METHOD_STORE *store,
      */
     if (pq == NULL) {
         for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
-            if ((impl = sk_IMPLEMENTATION_value(alg->impls, j)) != NULL
-                && (prov == NULL || impl->provider == prov)) {
+            impl = sk_IMPLEMENTATION_value(alg->impls, j);
+            if (impl == NULL || impl->archived == 1)
+                continue;
+
+            if (prov == NULL || impl->provider == prov) {
                 best_impl = impl;
                 ret = 1;
                 break;
@@ -716,7 +834,9 @@ int ossl_method_store_fetch(OSSL_METHOD_STORE *store,
      */
     optional = ossl_property_has_optional(pq);
     for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
-        if ((impl = sk_IMPLEMENTATION_value(alg->impls, j)) != NULL
+        impl = sk_IMPLEMENTATION_value(alg->impls, j);
+        if (impl != NULL
+            && impl->archived == 0
             && (prov == NULL || impl->provider == prov)) {
             score = ossl_property_match_count(pq, impl->properties);
             if (score > best) {
@@ -729,10 +849,18 @@ int ossl_method_store_fetch(OSSL_METHOD_STORE *store,
         }
     }
 fin:
-    if (ret && ossl_method_up_ref(&best_impl->method)) {
+    if (ret) {
         *method = best_impl->method.method;
         if (prov_rw != NULL)
             *prov_rw = best_impl->provider;
+#ifdef OPENSSL_NO_CACHED_FETCH
+        if (!ossl_method_up_ref(&best_impl->method)) {
+            ret = 0;
+            *method = NULL;
+            if (prov_rw != NULL)
+                *prov_rw = NULL;
+        }
+#endif
     } else {
         ret = 0;
     }
@@ -741,7 +869,7 @@ fin:
     OSSL_TRACE_BEGIN(QUERY)
     {
         char buf[512];
-        int size;
+        size_t size;

         size = ossl_property_list_to_string(NULL, pq, buf, 512);
         BIO_printf(trc_out, "method store query with properties %s "
@@ -752,198 +880,444 @@ fin:
     OSSL_TRACE_END(QUERY);
 #endif

-    ossl_property_unlock(store);
+    ossl_property_unlock(sa);
     ossl_property_free(p2);
     return ret;
 }

-static void ossl_method_cache_flush_alg(OSSL_METHOD_STORE *store,
+static void ossl_method_cache_flush_alg(STORED_ALGORITHMS *sa,
     ALGORITHM *alg)
 {
-    store->cache_nelem -= lh_QUERY_num_items(alg->cache);
-    impl_cache_flush_alg(0, alg);
+    impl_cache_flush_alg(alg, sa);
 }

-static void ossl_method_cache_flush(OSSL_METHOD_STORE *store, int nid)
+static void ossl_method_cache_flush(STORED_ALGORITHMS *sa, int nid)
 {
-    ALGORITHM *alg = ossl_method_store_retrieve(store, nid);
+    ALGORITHM *alg = ossl_method_store_retrieve(sa, nid);

     if (alg != NULL)
-        ossl_method_cache_flush_alg(store, alg);
+        ossl_method_cache_flush_alg(sa, alg);
 }

-int ossl_method_store_cache_flush_all(OSSL_METHOD_STORE *store)
+static void ossl_cache_lists_flush(STORED_ALGORITHMS *sa)
 {
-    if (!ossl_property_write_lock(store))
-        return 0;
-    ossl_sa_ALGORITHM_doall(store->algs, &impl_cache_flush_alg);
-    store->cache_nelem = 0;
-    ossl_property_unlock(store);
-    return 1;
-}
+    int i;
+    QUERY *idx, *idxn;

-IMPLEMENT_LHASH_DOALL_ARG(QUERY, IMPL_CACHE_FLUSH);
+    for (i = 0; i < MAX_CACHE_LINES; i++) {
+        if (!CRYPTO_atomic_load_ptr((void **)&sa->cache_lists[i], (void **)&idx, sa->alock))
+            break;
+        while (idx != NULL) {
+            if (!CRYPTO_atomic_load_ptr((void **)&idx->next, (void **)&idxn, sa->alock))
+                break;
+            ossl_method_store_atomic_archive(sa, idx);
+            idx = idxn;
+        }
+    }
+}

-/*
- * Flush an element from the query cache (perhaps).
- *
- * In order to avoid taking a write lock or using atomic operations
- * to keep accurate least recently used (LRU) or least frequently used
- * (LFU) information, the procedure used here is to stochastically
- * flush approximately half the cache.
- *
- * This procedure isn't ideal, LRU or LFU would be better.  However,
- * in normal operation, reaching a full cache would be unexpected.
- * It means that no steady state of algorithm queries has been reached.
- * That is, it is most likely an attack of some form.  A suboptimal clearance
- * strategy that doesn't degrade performance of the normal case is
- * preferable to a more refined approach that imposes a performance
- * impact.
- */
-static void impl_cache_flush_cache(QUERY *c, IMPL_CACHE_FLUSH *state)
+static void ossl_cache_lists_free(STORED_ALGORITHMS *sa)
 {
-    uint32_t n;
+    int i;
+    QUERY *idx, *idxn;

-    /*
-     * Implement the 32 bit xorshift as suggested by George Marsaglia in:
-     *      https://doi.org/10.18637/jss.v008.i14
-     *
-     * This is a very fast PRNG so there is no need to extract bits one at a
-     * time and use the entire value each time.
-     */
-    n = state->seed;
-    n ^= n << 13;
-    n ^= n >> 17;
-    n ^= n << 5;
-    state->seed = n;
+    for (i = 0; i < MAX_CACHE_LINES; i++) {
+        if (!CRYPTO_atomic_load_ptr((void **)&sa->cache_lists[i], (void **)&idx, sa->alock))
+            return;
+        while (idx != NULL) {
+            if (!CRYPTO_atomic_load_ptr((void **)&idx->next, (void **)&idxn, sa->alock))
+                return;
+            impl_cache_free_unlinked(idx);
+            idx = idxn;
+        }
+    }

-    if ((n & 1) != 0)
-        impl_cache_free(lh_QUERY_delete(state->cache, c));
-    else
-        state->nelem++;
+    if (!CRYPTO_atomic_load_ptr((void **)&sa->archive, (void **)&idx, sa->alock))
+        return;
+    while (idx != NULL) {
+        if (!CRYPTO_atomic_load_ptr((void **)&idx->next, (void **)&idxn, sa->alock))
+            return;
+        impl_cache_free_unlinked(idx);
+        idx = idxn;
+    }
 }

-static void impl_cache_flush_one_alg(ossl_uintmax_t idx, ALGORITHM *alg,
-    void *v)
+int ossl_method_store_cache_flush_all(OSSL_METHOD_STORE *store)
 {
-    IMPL_CACHE_FLUSH *state = (IMPL_CACHE_FLUSH *)v;
-    unsigned long orig_down_load = lh_QUERY_get_down_load(alg->cache);
+    for (int i = 0; i < NUM_SHARDS; ++i) {
+        STORED_ALGORITHMS *sa = &store->algs[i];
+
+        if (!ossl_property_write_lock(sa))
+            return 0;
+        ossl_cache_lists_flush(sa);
+        ossl_method_store_atomic_clean_archive(sa);
+        ossl_property_unlock(sa);
+    }

-    state->cache = alg->cache;
-    lh_QUERY_set_down_load(alg->cache, 0);
-    lh_QUERY_doall_IMPL_CACHE_FLUSH(state->cache, &impl_cache_flush_cache,
-        state);
-    lh_QUERY_set_down_load(alg->cache, orig_down_load);
+    return 1;
 }

-static void ossl_method_cache_flush_some(OSSL_METHOD_STORE *store)
+static ossl_inline int ossl_method_store_cache_get_atomic(OSSL_METHOD_STORE *store, OSSL_PROVIDER *prov,
+    int nid, const char *prop_query, STORED_ALGORITHMS *sa, void **method)
 {
-    IMPL_CACHE_FLUSH state;
-    static TSAN_QUALIFIER uint32_t global_seed = 1;
+    QUERY *r = NULL;
+    int res = 0;
+
+    r = ossl_method_store_atomic_find_in_list(sa, nid, prov, prop_query);

-    state.nelem = 0;
-    state.using_global_seed = 0;
-    if ((state.seed = OPENSSL_rdtsc()) == 0) {
-        /* If there is no timer available, seed another way */
-        state.using_global_seed = 1;
-        state.seed = tsan_load(&global_seed);
+    if (r != NULL) {
+        *method = r->method.method;
+        res = 1;
+#ifdef OPENSSL_NO_CACHED_FETCH
+        if (!ossl_method_up_ref(&r->method)) {
+            *method = NULL;
+            res = 0;
+        }
+#endif
     }
-    store->cache_need_flush = 0;
-    ossl_sa_ALGORITHM_doall_arg(store->algs, &impl_cache_flush_one_alg, &state);
-    store->cache_nelem = state.nelem;
-    /* Without a timer, update the global seed */
-    if (state.using_global_seed)
-        tsan_add(&global_seed, state.seed);
+
+    return res;
 }

 int ossl_method_store_cache_get(OSSL_METHOD_STORE *store, OSSL_PROVIDER *prov,
     int nid, const char *prop_query, void **method)
 {
-    ALGORITHM *alg;
-    QUERY elem, *r;
-    int res = 0;
+    int ret;
+    STORED_ALGORITHMS *sa;

     if (nid <= 0 || store == NULL || prop_query == NULL)
         return 0;

-    if (!ossl_property_read_lock(store))
+    sa = stored_algs_shard(store, nid);
+
+    /*
+     * Do an atomic linked list walk to search for our entry
+     */
+    ret = ossl_method_store_cache_get_atomic(store, prov, nid, prop_query, sa,
+        method);
+
+    return ret;
+}
+
+static int ossl_method_store_atomic_archive(STORED_ALGORITHMS *sa, QUERY *old)
+{
+    if (!CRYPTO_atomic_store_int(&old->archived, 1, sa->alock))
         return 0;
-    alg = ossl_method_store_retrieve(store, nid);
-    if (alg == NULL)
-        goto err;
-
-    elem.query = prop_query;
-    elem.provider = prov;
-    r = lh_QUERY_retrieve(alg->cache, &elem);
-    if (r == NULL)
-        goto err;
-    if (ossl_method_up_ref(&r->method)) {
-        *method = r->method.method;
-        res = 1;
+    return 1;
+}
+
+static ossl_inline int ossl_method_store_put_in_archive(STORED_ALGORITHMS *sa, QUERY *old)
+{
+    /*
+     * point the item we're removing's next pointer to the top of the archive list
+     * Note: We're writing to the old->next here which is shared, so that's suspicious, but
+     * because we've already removed old from the cache_list in ossl_method_store_clean_archive
+     * this is safe for the following reasons:
+     * 1) the clean path is done under a write lock, so sa->archive is guaranteed stable
+     * 2) any concurrent reader (ie ossl_method_store_cache_set|get, if visiting the old node
+     * while we're moving it, will either read the true next value (pointing to the next element
+     * in the cache_list), or the one we write here (the next list in the archive)
+     *
+     * Reading the true next value is fine, as that's the normal traversal anyway.
+     * Reading the next pointer as pointing into the archive list is not great, but in the worst
+     * case this results in a transient failed cache lookup, which just means a temporary slow path
+     * retrieval of an algorithm.
+     */
+    if (!CRYPTO_atomic_load_ptr((void **)&sa->archive, (void **)&old->next, sa->alock))
+        return 0;
+    /*
+     * And update the head of the archive list to be our new entry
+     */
+    if (!CRYPTO_atomic_store_ptr((void **)&sa->archive, (void **)&old, sa->alock))
+        return 0;
+    return 1;
+}
+
+/*
+ * Migrate archived items to the archive list.  Must be done with the property write
+ * lock held
+ */
+static void ossl_method_store_atomic_clean_archive(STORED_ALGORITHMS *sa)
+{
+    QUERY *idx, *idxn, *tmp;
+    int archived;
+    int i;
+    int lock_failed;
+
+    /*
+     * For each of our linked lists
+     */
+    for (i = 0; i < MAX_CACHE_LINES; i++) {
+    restart_list:
+        /*
+         * Get the head of the list
+         */
+        if (!CRYPTO_atomic_load_ptr((void **)&sa->cache_lists[i], (void **)&idx, sa->alock))
+            continue;
+        /*
+         * If its NULL, the list is currently empty, move on to the next one
+         */
+        if (idx == NULL)
+            continue;
+        /*
+         * Get its archived value
+         */
+        if (!CRYPTO_atomic_load_int(&idx->archived, &archived, sa->alock))
+            continue;
+        /*
+         * Also fetch its next pointer to idxn
+         */
+        if (!CRYPTO_atomic_load_ptr((void **)&idx->next, (void **)&idxn, sa->alock))
+            continue;
+        /*
+         * If its been archived, we want to move it to the archive list
+         */
+        if (archived == 1) {
+            /*
+             * We know this is the current list head we're working with
+             * so store the next pointer to be the new list head
+             */
+            if (!CRYPTO_atomic_cmp_exch_ptr((void **)&sa->cache_lists[i], (void **)&idx, idxn, sa->alock,
+                    &lock_failed)) {
+                if (lock_failed)
+                    continue;
+                else
+                    goto restart_list;
+            }
+
+            if (!ossl_method_store_put_in_archive(sa, idx))
+                continue;
+            goto restart_list;
+        }
+
+        /*
+         * At this point our state is:
+         * idx - points to an element in cache_lists[i]
+         * idxn points to the next entry (i.e. idx->next)
+         */
+        while (idx != NULL) {
+            /*
+             * We know idx isn't archived, so we start looking at idxn
+             */
+            if (idxn != NULL) {
+                /*
+                 * if its not NULL, see if its archived
+                 */
+                if (!CRYPTO_atomic_load_int(&idxn->archived, &archived, sa->alock))
+                    break;
+                /*
+                 * If it is, remove it
+                 */
+                if (archived == 1) {
+                    /*
+                     * Start by making idx skip idxn in the list
+                     * First load the expected next value of idx->next
+                     */
+                    if (!CRYPTO_atomic_load_ptr((void **)&idx->next, (void **)&tmp, sa->alock))
+                        break;
+
+                    /*
+                     * Now compare the value of idx->next to what we just loaded to tmp above
+                     * if they match, we can safely update idx->next to skip the idxn entry
+                     * by pointing idx->next to idxn->next.
+                     * If the comparison fails, then we need to start the list traversal over again.
+                     * Note: This should never happen, as once an item is in the list, this is the
+                     * only path in which an in-list item has its next pointer mutated, and this
+                     * occurs under a write lock, but we should be safe here
+                     */
+                    if (!CRYPTO_atomic_cmp_exch_ptr((void **)&idx->next,
+                            (void **)&tmp, (void *)idxn->next,
+                            sa->alock, &lock_failed)) {
+                        if (lock_failed)
+                            break;
+                        /*
+                         * The list was mutated while we were trying to mutate it
+                         * Normally we would just use the reloaded value of tmp here to re-attempt
+                         * the removal, but since idx was changed underneath us, we don't know where
+                         * we are in the list anymore.  Its safer to just restart the whole traversal
+                         */
+                        goto restart_list;
+                    }
+
+                    if (!ossl_method_store_put_in_archive(sa, idxn))
+                        break;
+
+                    /*
+                     * Idx just got a new next pointer above, so just update idxn, so we are sure that idx
+                     * still isn't archived
+                     */
+                    if (!CRYPTO_atomic_load_ptr((void **)&idx->next, (void **)&idxn, sa->alock))
+                        break;
+                } else {
+                    /*
+                     * idxn wasn't archived, so we need to advance both pointers here
+                     */
+                    idx = idxn;
+                    if (!CRYPTO_atomic_load_ptr((void **)&idx->next, (void **)&idxn, sa->alock))
+                        break;
+                }
+            } else {
+                /*
+                 * idxn is NULL, that means we're at the end of the list.
+                 * Just advance idx to idxn and the loop will break on the next iteration
+                 */
+                idx = idxn;
+            }
+        }
     }
-err:
-    ossl_property_unlock(store);
-    return res;
 }

-int ossl_method_store_cache_set(OSSL_METHOD_STORE *store, OSSL_PROVIDER *prov,
-    int nid, const char *prop_query, void *method,
+static QUERY *ossl_method_store_atomic_find_in_list(STORED_ALGORITHMS *sa, int nid,
+    OSSL_PROVIDER *prov, const char *prop_query)
+{
+    int nididx = (nid >> NUM_SHARDS_BITS) & (MAX_CACHE_LINES - 1);
+    int archived;
+    QUERY *idx;
+    QUERY *ret = NULL;
+
+    if (!CRYPTO_atomic_load_ptr((void **)&sa->cache_lists[nididx], (void **)&idx, sa->alock))
+        goto out;
+
+    while (idx != NULL) {
+        if (!CRYPTO_atomic_load_int(&idx->archived, &archived, sa->alock))
+            goto out;
+        if (archived == 0 && idx->nid == nid && idx->prov == prov
+            && (strcmp(idx->prop_query, prop_query) == 0)) {
+            ret = idx;
+            break;
+        }
+        if (!CRYPTO_atomic_load_ptr((void **)&idx->next, (void **)&idx, sa->alock))
+            goto out;
+    }
+out:
+    return ret;
+}
+
+static int ossl_method_store_atomic_insert_to_list(STORED_ALGORITHMS *sa, QUERY *new)
+{
+    int nid = (new->nid >> NUM_SHARDS_BITS) & (MAX_CACHE_LINES - 1);
+    QUERY *headptr;
+    int ret = 0;
+    int lock_failed;
+
+    if (!CRYPTO_atomic_load_ptr((void **)&sa->cache_lists[nid], (void **)&headptr, sa->alock))
+        goto out;
+try_again:
+    if (!CRYPTO_atomic_store_ptr((void **)&new->next, (void **)&headptr, sa->alock))
+        goto out;
+    if (!CRYPTO_atomic_cmp_exch_ptr((void **)&sa->cache_lists[nid], (void **)&headptr, new, sa->alock,
+            &lock_failed)) {
+        if (lock_failed == 1)
+            goto out;
+        goto try_again;
+    }
+    ret = 1;
+out:
+    return ret;
+}
+
+static ossl_inline int ossl_method_store_cache_set_atomic(OSSL_METHOD_STORE *store, OSSL_PROVIDER *prov,
+    int nid, const char *prop_query, STORED_ALGORITHMS *sa, void *method,
     int (*method_up_ref)(void *),
     void (*method_destruct)(void *))
 {
-    QUERY elem, *old, *p = NULL;
-    ALGORITHM *alg;
-    size_t len;
+    QUERY *p = NULL;
     int res = 1;

-    if (nid <= 0 || store == NULL || prop_query == NULL)
-        return 0;
-
-    if (!ossl_assert(prov != NULL))
-        return 0;
-
-    if (!ossl_property_write_lock(store))
-        return 0;
-    if (store->cache_need_flush)
-        ossl_method_cache_flush_some(store);
-    alg = ossl_method_store_retrieve(store, nid);
-    if (alg == NULL)
-        goto err;
-
     if (method == NULL) {
-        elem.query = prop_query;
-        elem.provider = prov;
-        if ((old = lh_QUERY_delete(alg->cache, &elem)) != NULL) {
-            impl_cache_free(old);
-            store->cache_nelem--;
-        }
+        p = ossl_method_store_atomic_find_in_list(sa, nid, prov, prop_query);
+        if (p != NULL)
+            ossl_method_store_atomic_archive(sa, p);
         goto end;
     }
-    p = OPENSSL_malloc(sizeof(*p) + (len = strlen(prop_query)));
+
+    p = ossl_method_store_atomic_find_in_list(sa, nid, prov, prop_query);
+    if (p != NULL)
+        ossl_method_store_atomic_archive(sa, p);
+
+    p = QUERY_new(strlen(prop_query));
     if (p != NULL) {
-        p->query = p->body;
-        p->provider = prov;
+        TSAN_BENIGN(p, "Unpublished value is safe on subsequent read");
+        p->saptr = sa;
+        p->nid = nid;
+        p->prov = prov;
+        p->archived = 0;
+        strcpy(p->prop_query, prop_query);
         p->method.method = method;
         p->method.up_ref = method_up_ref;
         p->method.free = method_destruct;
         if (!ossl_method_up_ref(&p->method))
             goto err;
-        memcpy((char *)p->query, prop_query, len + 1);
-        if ((old = lh_QUERY_insert(alg->cache, p)) != NULL) {
-            impl_cache_free(old);
-            goto end;
+
+        if (!ossl_method_store_atomic_insert_to_list(sa, p)) {
+            ossl_method_free(&p->method);
+            goto err;
         }
-        if (!lh_QUERY_error(alg->cache)) {
-            if (++store->cache_nelem >= IMPL_CACHE_FLUSH_THRESHOLD)
-                store->cache_need_flush = 1;
-            goto end;
+
+        /*
+         * We also want to add this method into the cache against a key computed
+         * _only_ from nid and property query.  This lets us match in the event
+         * someone does a lookup against a NULL provider (i.e. the "any provided
+         * alg will do" match).
+         *
+         * Only insert it if no NULL-provider entry exists yet for this nid and
+         * property query.  The first provider to cache this nid owns that
+         * entry, which matches the provider ossl_method_store_fetch would pick
+         * by implementation order.  Without this check, a later cache_set from
+         * a different provider would overwrite it and change which provider an
+         * "any provider" lookup resolves to.
+         */
+        if (ossl_method_store_atomic_find_in_list(sa, nid, NULL, prop_query) == NULL) {
+            p = QUERY_new(strlen(prop_query));
+            if (p == NULL)
+                goto err;
+            TSAN_BENIGN(p, "Unpublished value is safe on subsequent read");
+            p->saptr = sa;
+            p->nid = nid;
+            p->prov = NULL;
+            p->archived = 0;
+            strcpy(p->prop_query, prop_query);
+            p->method.method = method;
+            p->method.up_ref = method_up_ref;
+            p->method.free = method_destruct;
+            if (!ossl_method_up_ref(&p->method))
+                goto err;
+            if (!ossl_method_store_atomic_insert_to_list(sa, p)) {
+                ossl_method_free(&p->method);
+                goto err;
+            }
         }
-        ossl_method_free(&p->method);
+
+        goto end;
     }
 err:
     res = 0;
-    OPENSSL_free(p);
+    QUERY_free(p);
 end:
-    ossl_property_unlock(store);
+    return res;
+}
+
+int ossl_method_store_cache_set(OSSL_METHOD_STORE *store, OSSL_PROVIDER *prov,
+    int nid, const char *prop_query, void *method,
+    int (*method_up_ref)(void *),
+    void (*method_destruct)(void *))
+{
+    STORED_ALGORITHMS *sa;
+    int res = 1;
+
+    if (nid <= 0 || store == NULL || prop_query == NULL)
+        return 0;
+
+    if (!ossl_assert(prov != NULL))
+        return 0;
+
+    sa = stored_algs_shard(store, nid);
+
+    /*
+     * Do an atomic insert into the appropriate cache linked list
+     */
+    res = ossl_method_store_cache_set_atomic(store, prov, nid, prop_query, sa, method,
+        method_up_ref, method_destruct);
+
     return res;
 }
diff --git a/deps/openssl/openssl/crypto/property/property_err.c b/deps/openssl/openssl/crypto/property/property_err.c
deleted file mode 100644
index 2361806fc7b..00000000000
--- a/deps/openssl/openssl/crypto/property/property_err.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include "internal/propertyerr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA PROP_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_PROP, 0, PROP_R_NAME_TOO_LONG), "name too long" },
-    { ERR_PACK(ERR_LIB_PROP, 0, PROP_R_NOT_AN_ASCII_CHARACTER),
-        "not an ascii character" },
-    { ERR_PACK(ERR_LIB_PROP, 0, PROP_R_NOT_AN_HEXADECIMAL_DIGIT),
-        "not an hexadecimal digit" },
-    { ERR_PACK(ERR_LIB_PROP, 0, PROP_R_NOT_AN_IDENTIFIER), "not an identifier" },
-    { ERR_PACK(ERR_LIB_PROP, 0, PROP_R_NOT_AN_OCTAL_DIGIT),
-        "not an octal digit" },
-    { ERR_PACK(ERR_LIB_PROP, 0, PROP_R_NOT_A_DECIMAL_DIGIT),
-        "not a decimal digit" },
-    { ERR_PACK(ERR_LIB_PROP, 0, PROP_R_NO_MATCHING_STRING_DELIMITER),
-        "no matching string delimiter" },
-    { ERR_PACK(ERR_LIB_PROP, 0, PROP_R_NO_VALUE), "no value" },
-    { ERR_PACK(ERR_LIB_PROP, 0, PROP_R_PARSE_FAILED), "parse failed" },
-    { ERR_PACK(ERR_LIB_PROP, 0, PROP_R_STRING_TOO_LONG), "string too long" },
-    { ERR_PACK(ERR_LIB_PROP, 0, PROP_R_TRAILING_CHARACTERS),
-        "trailing characters" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_PROP_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(PROP_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(PROP_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/property/property_local.h b/deps/openssl/openssl/crypto/property/property_local.h
index 98484240bb5..015b16109ad 100644
--- a/deps/openssl/openssl/crypto/property/property_local.h
+++ b/deps/openssl/openssl/crypto/property/property_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2019, Oracle and/or its affiliates.  All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -8,6 +8,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_PROPERTY_PROPERTY_LOCAL_H)
+#define OSSL_LIBCRYPTO_PROPERTY_PROPERTY_LOCAL_H
+
 #include <openssl/crypto.h>
 #include "internal/property.h"

@@ -55,3 +58,5 @@ int ossl_property_has_optional(const OSSL_PROPERTY_LIST *query);
 OSSL_PROPERTY_LIST *ossl_prop_defn_get(OSSL_LIB_CTX *ctx, const char *prop);
 int ossl_prop_defn_set(OSSL_LIB_CTX *ctx, const char *prop,
     OSSL_PROPERTY_LIST **pl);
+
+#endif /* !defined(OSSL_LIBCRYPTO_PROPERTY_PROPERTY_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/property/property_parse.c b/deps/openssl/openssl/crypto/property/property_parse.c
index 869d19da85a..b698d09b951 100644
--- a/deps/openssl/openssl/crypto/property/property_parse.c
+++ b/deps/openssl/openssl/crypto/property/property_parse.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2019, Oracle and/or its affiliates.  All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -685,7 +685,7 @@ static void put_num(int64_t val, char **buf, size_t *remain, size_t *needed)
     if (*remain == 0)
         return;

-    BIO_snprintf(*buf, *remain, "%lld", (long long int)val);
+    snprintf(*buf, *remain, "%lld", (long long int)val);
     if (*remain < len) {
         *buf += *remain;
         *remain = 0;
diff --git a/deps/openssl/openssl/crypto/property/property_query.c b/deps/openssl/openssl/crypto/property/property_query.c
index f5daca2aad1..6b6b96a4ee1 100644
--- a/deps/openssl/openssl/crypto/property/property_query.c
+++ b/deps/openssl/openssl/crypto/property/property_query.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -30,7 +30,7 @@ ossl_property_find_property(const OSSL_PROPERTY_LIST *list,
         return NULL;

     return ossl_bsearch(&name_idx, list->properties, list->num_properties,
-        sizeof(*list->properties), &property_idx_cmp, 0);
+        sizeof(*list->properties), &property_idx_cmp, NULL, 0);
 }

 OSSL_PROPERTY_TYPE ossl_property_get_type(const OSSL_PROPERTY_DEFINITION *prop)
diff --git a/deps/openssl/openssl/crypto/provider_conf.c b/deps/openssl/openssl/crypto/provider_conf.c
index f2e76ac402e..021b6540790 100644
--- a/deps/openssl/openssl/crypto/provider_conf.c
+++ b/deps/openssl/openssl/crypto/provider_conf.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,6 +15,7 @@
 #include <openssl/provider.h>
 #include "internal/provider.h"
 #include "internal/cryptlib.h"
+#include "internal/conf.h"
 #include "provider_local.h"
 #include "crypto/context.h"

@@ -275,30 +276,7 @@ static int provider_conf_activate(OSSL_LIB_CTX *libctx, const char *name,
 static int provider_conf_parse_bool_setting(const char *confname,
     const char *confvalue, int *val)
 {
-
-    if (confvalue == NULL) {
-        ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_PROVIDER_SECTION_ERROR,
-            "directive %s set to unrecognized value",
-            confname);
-        return 0;
-    }
-    if ((strcmp(confvalue, "1") == 0)
-        || (strcmp(confvalue, "yes") == 0)
-        || (strcmp(confvalue, "YES") == 0)
-        || (strcmp(confvalue, "true") == 0)
-        || (strcmp(confvalue, "TRUE") == 0)
-        || (strcmp(confvalue, "on") == 0)
-        || (strcmp(confvalue, "ON") == 0)) {
-        *val = 1;
-    } else if ((strcmp(confvalue, "0") == 0)
-        || (strcmp(confvalue, "no") == 0)
-        || (strcmp(confvalue, "NO") == 0)
-        || (strcmp(confvalue, "false") == 0)
-        || (strcmp(confvalue, "FALSE") == 0)
-        || (strcmp(confvalue, "off") == 0)
-        || (strcmp(confvalue, "OFF") == 0)) {
-        *val = 0;
-    } else {
+    if (!ossl_conf_parse_bool(confvalue, val)) {
         ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_PROVIDER_SECTION_ERROR,
             "directive %s set to unrecognized value",
             confname);
diff --git a/deps/openssl/openssl/crypto/provider_core.c b/deps/openssl/openssl/crypto/provider_core.c
index 2a47a9e709a..127cb4a23c2 100644
--- a/deps/openssl/openssl/crypto/provider_core.c
+++ b/deps/openssl/openssl/crypto/provider_core.c
@@ -8,6 +8,7 @@
  */

 #include <assert.h>
+#include <stdio.h>
 #include <openssl/core.h>
 #include <openssl/core_dispatch.h>
 #include <openssl/core_names.h>
@@ -371,8 +372,8 @@ int ossl_provider_info_add_to_store(OSSL_LIB_CTX *libctx,
     if (!CRYPTO_THREAD_write_lock(store->lock))
         return 0;
     if (store->provinfosz == 0) {
-        store->provinfo = OPENSSL_zalloc(sizeof(*store->provinfo)
-            * BUILTINS_BLOCK_SIZE);
+        store->provinfo = OPENSSL_calloc(BUILTINS_BLOCK_SIZE,
+            sizeof(*store->provinfo));
         if (store->provinfo == NULL)
             goto err;
         store->provinfosz = BUILTINS_BLOCK_SIZE;
@@ -380,8 +381,8 @@ int ossl_provider_info_add_to_store(OSSL_LIB_CTX *libctx,
         OSSL_PROVIDER_INFO *tmpbuiltins;
         size_t newsz = store->provinfosz + BUILTINS_BLOCK_SIZE;

-        tmpbuiltins = OPENSSL_realloc(store->provinfo,
-            sizeof(*store->provinfo) * newsz);
+        tmpbuiltins = OPENSSL_realloc_array(store->provinfo,
+            newsz, sizeof(*store->provinfo));
         if (tmpbuiltins == NULL)
             goto err;
         store->provinfo = tmpbuiltins;
@@ -420,9 +421,15 @@ OSSL_PROVIDER *ossl_provider_find(OSSL_LIB_CTX *libctx, const char *name,
 #endif

         tmpl.name = (char *)name;
-        if (!CRYPTO_THREAD_write_lock(store->lock))
+        if (!CRYPTO_THREAD_read_lock(store->lock))
             return NULL;
-        sk_OSSL_PROVIDER_sort(store->providers);
+        if (!sk_OSSL_PROVIDER_is_sorted(store->providers)) {
+            CRYPTO_THREAD_unlock(store->lock);
+            if (!CRYPTO_THREAD_write_lock(store->lock))
+                return NULL;
+            if (!sk_OSSL_PROVIDER_is_sorted(store->providers))
+                sk_OSSL_PROVIDER_sort(store->providers);
+        }
         if ((i = sk_OSSL_PROVIDER_find(store->providers, &tmpl)) != -1)
             prov = sk_OSSL_PROVIDER_value(store->providers, i);
         CRYPTO_THREAD_unlock(store->lock);
@@ -480,7 +487,7 @@ int ossl_provider_up_ref(OSSL_PROVIDER *prov)
 {
     int ref = 0;

-    if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0)
+    if (!CRYPTO_UP_REF(&prov->refcnt, &ref))
         return 0;

 #ifndef FIPS_MODULE
@@ -1118,7 +1125,7 @@ static int provider_init(OSSL_PROVIDER *prov)
         cnt++; /* One for the terminating item */

         /* Allocate one extra item for the "library" name */
-        prov->error_strings = OPENSSL_zalloc(sizeof(ERR_STRING_DATA) * (cnt + 1));
+        prov->error_strings = OPENSSL_calloc(cnt + 1, sizeof(ERR_STRING_DATA));
         if (prov->error_strings == NULL)
             goto end;

@@ -1128,7 +1135,7 @@ static int provider_init(OSSL_PROVIDER *prov)
         prov->error_strings[0].error = ERR_PACK(prov->error_lib, 0, 0);
         prov->error_strings[0].string = prov->name;
         /*
-         * Copy reasonstrings item 0..cnt-1 to prov->error_trings positions
+         * Copy reasonstrings item 0..cnt-1 to prov->error_strings positions
          * 1..cnt.
          */
         for (cnt2 = 1; cnt2 <= cnt; cnt2++) {
@@ -1570,7 +1577,7 @@ int ossl_provider_doall_activated(OSSL_LIB_CTX *ctx,
              * to avoid upping the ref count on the parent provider, which we
              * must not do while holding locks.
              */
-            if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0) {
+            if (!CRYPTO_UP_REF(&prov->refcnt, &ref)) {
                 CRYPTO_THREAD_unlock(prov->flag_lock);
                 goto err_unlock;
             }
@@ -2277,7 +2284,9 @@ OSSL_FUNC_BIO_puts_fn ossl_core_bio_puts;
 OSSL_FUNC_BIO_up_ref_fn ossl_core_bio_up_ref;
 OSSL_FUNC_BIO_free_fn ossl_core_bio_free;
 OSSL_FUNC_BIO_vprintf_fn ossl_core_bio_vprintf;
-OSSL_FUNC_BIO_vsnprintf_fn BIO_vsnprintf;
+#ifndef FIPS_MODULE
+static OSSL_FUNC_BIO_vsnprintf_fn core_bio_vsnprintf;
+#endif
 static OSSL_FUNC_indicator_cb_fn core_indicator_get_callback;
 static OSSL_FUNC_self_test_cb_fn core_self_test_get_callback;
 static OSSL_FUNC_get_entropy_fn rand_get_entropy;
@@ -2450,7 +2459,6 @@ static void core_self_test_get_callback(OPENSSL_CORE_CTX *libctx,
     OSSL_SELF_TEST_get_callback((OSSL_LIB_CTX *)libctx, cb, cbarg);
 }

-#ifdef OPENSSL_NO_FIPS_JITTER
 static size_t rand_get_entropy(const OSSL_CORE_HANDLE *handle,
     unsigned char **pout, int entropy,
     size_t min_len, size_t max_len)
@@ -2458,31 +2466,6 @@ static size_t rand_get_entropy(const OSSL_CORE_HANDLE *handle,
     return ossl_rand_get_entropy((OSSL_LIB_CTX *)core_get_libctx(handle),
         pout, entropy, min_len, max_len);
 }
-#else
-/*
- * OpenSSL FIPS providers prior to 3.2 call rand_get_entropy API from
- * core, instead of the newer get_user_entropy. Newer API call honors
- * runtime configuration of random seed source and can be configured
- * to use os getranom() or another seed source, such as
- * JITTER. However, 3.0.9 only calls this API. Note that no other
- * providers known to use this, and it is core <-> provider only
- * API. Public facing EVP and getrandom bytes already correctly honor
- * runtime configuration for seed source. There are no other providers
- * packaged in Wolfi, or even known to exist that use this api. Thus
- * it is safe to say any caller of this API is in fact 3.0.9 FIPS
- * provider. Also note that the passed in handle is invalid and cannot
- * be safely dereferences in such cases. Due to a bug in FIPS
- * providers 3.0.0, 3.0.8 and 3.0.9. See
- * https://github.com/openssl/openssl/blob/master/doc/internal/man3/ossl_rand_get_entropy.pod#notes
- */
-size_t ossl_rand_jitter_get_seed(unsigned char **, int, size_t, size_t);
-static size_t rand_get_entropy(const OSSL_CORE_HANDLE *handle,
-    unsigned char **pout, int entropy,
-    size_t min_len, size_t max_len)
-{
-    return ossl_rand_jitter_get_seed(pout, entropy, min_len, max_len);
-}
-#endif

 static size_t rand_get_user_entropy(const OSSL_CORE_HANDLE *handle,
     unsigned char **pout, int entropy,
@@ -2606,6 +2589,18 @@ static int core_obj_create(const OSSL_CORE_HANDLE *prov, const char *oid,
 /*
  * Functions provided by the core.
  */
+#ifndef FIPS_MODULE
+static int core_bio_vsnprintf(char *buf, size_t n, const char *format,
+    va_list args)
+{
+    int ret = vsnprintf(buf, n, format, args);
+
+    if ((size_t)ret >= n)
+        ret = -1;
+    return ret;
+}
+#endif
+
 static const OSSL_DISPATCH core_dispatch_[] = {
     { OSSL_FUNC_CORE_GETTABLE_PARAMS, (void (*)(void))core_gettable_params },
     { OSSL_FUNC_CORE_GET_PARAMS, (void (*)(void))core_get_params },
@@ -2630,7 +2625,7 @@ static const OSSL_DISPATCH core_dispatch_[] = {
     { OSSL_FUNC_BIO_UP_REF, (void (*)(void))ossl_core_bio_up_ref },
     { OSSL_FUNC_BIO_FREE, (void (*)(void))ossl_core_bio_free },
     { OSSL_FUNC_BIO_VPRINTF, (void (*)(void))ossl_core_bio_vprintf },
-    { OSSL_FUNC_BIO_VSNPRINTF, (void (*)(void))BIO_vsnprintf },
+    { OSSL_FUNC_BIO_VSNPRINTF, (void (*)(void))core_bio_vsnprintf },
     { OSSL_FUNC_SELF_TEST_CB, (void (*)(void))core_self_test_get_callback },
     { OSSL_FUNC_INDICATOR_CB, (void (*)(void))core_indicator_get_callback },
     { OSSL_FUNC_GET_ENTROPY, (void (*)(void))rand_get_entropy },
diff --git a/deps/openssl/openssl/crypto/provider_local.h b/deps/openssl/openssl/crypto/provider_local.h
index 7799980808f..7017e905c37 100644
--- a/deps/openssl/openssl/crypto/provider_local.h
+++ b/deps/openssl/openssl/crypto/provider_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_PROVIDER_LOCAL_H)
+#define OSSL_LIBCRYPTO_PROVIDER_LOCAL_H
+
 #include <openssl/core.h>

 typedef struct {
@@ -31,3 +34,5 @@ int ossl_provider_info_add_to_store(OSSL_LIB_CTX *libctx,
 int ossl_provider_info_add_parameter(OSSL_PROVIDER_INFO *provinfo,
     const char *name,
     const char *value);
+
+#endif /* !defined(OSSL_LIBCRYPTO_PROVIDER_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/punycode.c b/deps/openssl/openssl/crypto/punycode.c
index cb78c7f18f3..1b99594d5b9 100644
--- a/deps/openssl/openssl/crypto/punycode.c
+++ b/deps/openssl/openssl/crypto/punycode.c
@@ -122,12 +122,15 @@ int ossl_punycode_decode(const char *pEncoded, const size_t enc_len,
     unsigned int n = initial_n;
     unsigned int i = 0;
     unsigned int bias = initial_bias;
-    size_t processed_in = 0, written_out = 0;
+    unsigned int processed_in = 0;
+    unsigned int written_out = 0;
     unsigned int max_out = *pout_length;
     unsigned int basic_count = 0;
     unsigned int loop;

-    for (loop = 0; loop < enc_len; loop++) {
+    if (enc_len >= UINT_MAX)
+        return 0;
+    for (loop = 0; loop < (unsigned int)enc_len; loop++) {
         if (pEncoded[loop] == delimiter)
             basic_count = loop;
     }
@@ -146,7 +149,7 @@ int ossl_punycode_decode(const char *pEncoded, const size_t enc_len,
         processed_in = basic_count + 1;
     }

-    for (loop = processed_in; loop < enc_len;) {
+    for (loop = processed_in; loop < (unsigned int)enc_len;) {
         unsigned int oldi = i;
         unsigned int w = 1;
         unsigned int k, t;
diff --git a/deps/openssl/openssl/crypto/quic_vlint.c b/deps/openssl/openssl/crypto/quic_vlint.c
index 148b99db0d0..22048c95e7a 100644
--- a/deps/openssl/openssl/crypto/quic_vlint.c
+++ b/deps/openssl/openssl/crypto/quic_vlint.c
@@ -29,7 +29,7 @@ void ossl_quic_vlint_encode_n(uint8_t *buf, uint64_t v, int n)

 void ossl_quic_vlint_encode(uint8_t *buf, uint64_t v)
 {
-    ossl_quic_vlint_encode_n(buf, v, ossl_quic_vlint_encode_len(v));
+    ossl_quic_vlint_encode_n(buf, v, (int)ossl_quic_vlint_encode_len(v));
 }

 uint64_t ossl_quic_vlint_decode_unchecked(const unsigned char *buf)
@@ -75,7 +75,7 @@ int ossl_quic_vlint_decode(const unsigned char *buf, size_t buf_len, uint64_t *v
     x = ossl_quic_vlint_decode_unchecked(buf);

     *v = x;
-    return dec_len;
+    return (int)dec_len;
 }

 #endif
diff --git a/deps/openssl/openssl/crypto/rand/prov_seed.c b/deps/openssl/openssl/crypto/rand/prov_seed.c
index 8466ded8ab0..d0c7c635511 100644
--- a/deps/openssl/openssl/crypto/rand/prov_seed.c
+++ b/deps/openssl/openssl/crypto/rand/prov_seed.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -45,13 +45,27 @@ size_t ossl_rand_get_user_entropy(OSSL_LIB_CTX *ctx,
     unsigned char **pout, int entropy,
     size_t min_len, size_t max_len)
 {
-    EVP_RAND_CTX *rng = ossl_rand_get0_seed_noncreating(ctx);
-
-    if (rng != NULL && evp_rand_can_seed(rng))
-        return evp_rand_get_seed(rng, pout, entropy, min_len, max_len,
-            0, NULL, 0);
-    else
-        return ossl_rand_get_entropy(ctx, pout, entropy, min_len, max_len);
+    EVP_RAND_CTX *rng;
+
+    if (ossl_rand_seed_source_strict(ctx)) {
+        /*
+         * With strict seeding the seed source must be used, even when the
+         * request arrives before anything instantiated it: create it now
+         * and fail instead of silently substituting the operating system
+         * entropy sources.
+         */
+        rng = ossl_rand_get0_seed(ctx);
+        if (rng == NULL || !evp_rand_can_seed(rng)) {
+            ERR_raise(ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ENTROPY);
+            return 0;
+        }
+    } else {
+        rng = ossl_rand_get0_seed_noncreating(ctx);
+        if (rng == NULL || !evp_rand_can_seed(rng))
+            return ossl_rand_get_entropy(ctx, pout, entropy, min_len, max_len);
+    }
+    return evp_rand_get_seed(rng, pout, entropy, min_len, max_len,
+        0, NULL, 0);
 }

 void ossl_rand_cleanup_entropy(ossl_unused OSSL_LIB_CTX *ctx,
@@ -103,10 +117,21 @@ size_t ossl_rand_get_user_nonce(OSSL_LIB_CTX *ctx,
     const void *salt, size_t salt_len)
 {
     unsigned char *buf;
-    EVP_RAND_CTX *rng = ossl_rand_get0_seed_noncreating(ctx);
-
-    if (rng == NULL)
-        return ossl_rand_get_nonce(ctx, pout, min_len, max_len, salt, salt_len);
+    EVP_RAND_CTX *rng;
+
+    if (ossl_rand_seed_source_strict(ctx)) {
+        /* See ossl_rand_get_user_entropy() */
+        rng = ossl_rand_get0_seed(ctx);
+        if (rng == NULL) {
+            ERR_raise(ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_NONCE);
+            return 0;
+        }
+    } else {
+        rng = ossl_rand_get0_seed_noncreating(ctx);
+        if (rng == NULL)
+            return ossl_rand_get_nonce(ctx, pout, min_len, max_len,
+                salt, salt_len);
+    }

     if ((buf = OPENSSL_malloc(min_len)) == NULL)
         return 0;
diff --git a/deps/openssl/openssl/crypto/rand/rand_deprecated.c b/deps/openssl/openssl/crypto/rand/rand_deprecated.c
index d1eabc0080f..4745d7ac80c 100644
--- a/deps/openssl/openssl/crypto/rand/rand_deprecated.c
+++ b/deps/openssl/openssl/crypto/rand/rand_deprecated.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,8 +12,7 @@
 #include <openssl/rand.h>

 #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
-#include <windows.h>
-#if OPENSSL_API_COMPAT < 0x10100000L
+#ifndef OPENSSL_NO_DEPRECATED_1_1_0

 #define DEPRECATED_RAND_FUNCTIONS_DEFINED

diff --git a/deps/openssl/openssl/crypto/rand/rand_err.c b/deps/openssl/openssl/crypto/rand/rand_err.c
deleted file mode 100644
index 5bd44f2190b..00000000000
--- a/deps/openssl/openssl/crypto/rand/rand_err.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/randerr.h>
-#include "crypto/randerr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA RAND_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ADDITIONAL_INPUT_TOO_LONG),
-        "additional input too long" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ALREADY_INSTANTIATED),
-        "already instantiated" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ARGUMENT_OUT_OF_RANGE),
-        "argument out of range" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_CANNOT_OPEN_FILE), "Cannot open file" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_DRBG_ALREADY_INITIALIZED),
-        "drbg already initialized" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_DRBG_NOT_INITIALISED),
-        "drbg not initialised" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ENTROPY_INPUT_TOO_LONG),
-        "entropy input too long" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ENTROPY_OUT_OF_RANGE),
-        "entropy out of range" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED),
-        "error entropy pool was ignored" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_INITIALISING_DRBG),
-        "error initialising drbg" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_INSTANTIATING_DRBG),
-        "error instantiating drbg" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT),
-        "error retrieving additional input" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_RETRIEVING_ENTROPY),
-        "error retrieving entropy" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_RETRIEVING_NONCE),
-        "error retrieving nonce" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_FAILED_TO_CREATE_LOCK),
-        "failed to create lock" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_FUNC_NOT_IMPLEMENTED),
-        "Function not implemented" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_FWRITE_ERROR), "Error writing file" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_GENERATE_ERROR), "generate error" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_INSUFFICIENT_DRBG_STRENGTH),
-        "insufficient drbg strength" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_INTERNAL_ERROR), "internal error" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_INVALID_PROPERTY_QUERY),
-        "invalid property query" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_IN_ERROR_STATE), "in error state" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_NOT_A_REGULAR_FILE),
-        "Not a regular file" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_NOT_INSTANTIATED), "not instantiated" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED),
-        "no drbg implementation selected" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_PARENT_LOCKING_NOT_ENABLED),
-        "parent locking not enabled" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_PARENT_STRENGTH_TOO_WEAK),
-        "parent strength too weak" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_PERSONALISATION_STRING_TOO_LONG),
-        "personalisation string too long" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED),
-        "prediction resistance not supported" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_PRNG_NOT_SEEDED), "PRNG not seeded" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_RANDOM_POOL_IS_EMPTY),
-        "random pool is empty" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_RANDOM_POOL_OVERFLOW),
-        "random pool overflow" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_RANDOM_POOL_UNDERFLOW),
-        "random pool underflow" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_REQUEST_TOO_LARGE_FOR_DRBG),
-        "request too large for drbg" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_RESEED_ERROR), "reseed error" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_SELFTEST_FAILURE), "selftest failure" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_TOO_LITTLE_NONCE_REQUESTED),
-        "too little nonce requested" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_TOO_MUCH_NONCE_REQUESTED),
-        "too much nonce requested" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNABLE_TO_CREATE_DRBG),
-        "unable to create drbg" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNABLE_TO_FETCH_DRBG),
-        "unable to fetch drbg" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER),
-        "unable to get parent reseed prop counter" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNABLE_TO_GET_PARENT_STRENGTH),
-        "unable to get parent strength" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNABLE_TO_LOCK_PARENT),
-        "unable to lock parent" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNSUPPORTED_DRBG_FLAGS),
-        "unsupported drbg flags" },
-    { ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNSUPPORTED_DRBG_TYPE),
-        "unsupported drbg type" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_RAND_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(RAND_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(RAND_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/rand/rand_lib.c b/deps/openssl/openssl/crypto/rand/rand_lib.c
index df70d1c2b1d..13067172028 100644
--- a/deps/openssl/openssl/crypto/rand/rand_lib.c
+++ b/deps/openssl/openssl/crypto/rand/rand_lib.c
@@ -7,9 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine deprecated APIs */
+/* We need to use some RAND deprecated APIs */
 #define OPENSSL_SUPPRESS_DEPRECATED

+#ifndef FIPS_MODULE
+#include <openssl/async.h>
+#endif
 #include <openssl/err.h>
 #include <openssl/opensslconf.h>
 #include <openssl/core_names.h>
@@ -17,17 +20,13 @@
 #include "internal/cryptlib.h"
 #include "internal/provider.h"
 #include "internal/thread_once.h"
+#include "internal/threads_common.h"
 #include "crypto/rand.h"
 #include "crypto/cryptlib.h"
 #include "rand_local.h"
 #include "crypto/context.h"
 #include "internal/provider.h"
-
-/* clang-format off */
-#ifndef OPENSSL_DEFAULT_SEED_SRC
-#define OPENSSL_DEFAULT_SEED_SRC SEED-SRC
-#endif
-/* clang-format on */
+#include "internal/common.h"

 typedef struct rand_global_st {
     /*
@@ -63,26 +62,6 @@ typedef struct rand_global_st {
     char *random_provider_name;
 #endif /* !FIPS_MODULE */

-    /*
-     * The <public> DRBG
-     *
-     * Used by default for generating random bytes using RAND_bytes().
-     *
-     * The <public> secondary DRBG is thread-local, i.e., there is one instance
-     * per thread.
-     */
-    CRYPTO_THREAD_LOCAL public;
-
-    /*
-     * The <private> DRBG
-     *
-     * Used by default for generating private keys using RAND_priv_bytes()
-     *
-     * The <private> secondary DRBG is thread-local, i.e., there is one
-     * instance per thread.
-     */
-    CRYPTO_THREAD_LOCAL private;
-
     /* Which RNG is being used by default and it's configuration settings */
     char *rng_name;
     char *rng_cipher;
@@ -92,6 +71,12 @@ typedef struct rand_global_st {
     /* Allow the randomness source to be changed */
     char *seed_name;
     char *seed_propq;
+
+    /*
+     * Whether the seed source may never fall back to the OS entropy:
+     * 1 strict, 0 not strict, -1 unset (strict only for JITTER)
+     */
+    int seed_strict;
 } RAND_GLOBAL;

 static EVP_RAND_CTX *rand_get0_primary(OSSL_LIB_CTX *ctx, RAND_GLOBAL *dgbl);
@@ -109,7 +94,7 @@ static RAND_GLOBAL *rand_get_global(OSSL_LIB_CTX *libctx)
 #include <limits.h>
 #include <openssl/conf.h>
 #include <openssl/trace.h>
-#include <openssl/engine.h>
+#include "internal/conf.h"
 #include "crypto/rand_pool.h"
 #include "prov/seeding.h"
 #include "internal/e_os.h"
@@ -133,11 +118,6 @@ static int set_random_provider_name(RAND_GLOBAL *dgbl, const char *name)
     return dgbl->random_provider_name != NULL;
 }

-#ifndef OPENSSL_NO_ENGINE
-/* non-NULL if default_RAND_meth is ENGINE-provided */
-static ENGINE *funct_ref;
-static CRYPTO_RWLOCK *rand_engine_lock;
-#endif /* !OPENSSL_NO_ENGINE */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
 static CRYPTO_RWLOCK *rand_meth_lock;
 static const RAND_METHOD *default_RAND_meth;
@@ -148,12 +128,6 @@ static int rand_inited = 0;

 DEFINE_RUN_ONCE_STATIC(do_rand_init)
 {
-#ifndef OPENSSL_NO_ENGINE
-    rand_engine_lock = CRYPTO_THREAD_lock_new();
-    if (rand_engine_lock == NULL)
-        return 0;
-#endif /* !OPENSSL_NO_ENGINE */
-
 #ifndef OPENSSL_NO_DEPRECATED_3_0
     rand_meth_lock = CRYPTO_THREAD_lock_new();
     if (rand_meth_lock == NULL)
@@ -171,10 +145,6 @@ err:
     CRYPTO_THREAD_lock_free(rand_meth_lock);
     rand_meth_lock = NULL;
 #endif /* !OPENSSL_NO_DEPRECATED_3_0 */
-#ifndef OPENSSL_NO_ENGINE
-    CRYPTO_THREAD_lock_free(rand_engine_lock);
-    rand_engine_lock = NULL;
-#endif /* !OPENSSL_NO_ENGINE */
     return 0;
 }

@@ -191,10 +161,6 @@ void ossl_rand_cleanup_int(void)
     RAND_set_rand_method(NULL);
 #endif /* !OPENSSL_NO_DEPRECATED_3_0 */
     ossl_rand_pool_cleanup();
-#ifndef OPENSSL_NO_ENGINE
-    CRYPTO_THREAD_lock_free(rand_engine_lock);
-    rand_engine_lock = NULL;
-#endif /* !OPENSSL_NO_ENGINE */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
     CRYPTO_THREAD_lock_free(rand_meth_lock);
     rand_meth_lock = NULL;
@@ -246,7 +212,7 @@ int RAND_poll(void)

         if (meth->add == NULL
             || meth->add(ossl_rand_pool_buffer(pool),
-                   ossl_rand_pool_length(pool),
+                   (int)ossl_rand_pool_length(pool),
                    (ossl_rand_pool_entropy(pool) / 8.0))
                 == 0)
             goto err;
@@ -264,19 +230,15 @@ int RAND_poll(void)

 #ifndef OPENSSL_NO_DEPRECATED_3_0
 static int rand_set_rand_method_internal(const RAND_METHOD *meth,
-    ossl_unused ENGINE *e)
+    ENGINE *e)
 {
+    if (!ossl_assert(e == NULL))
+        return 0;
     if (!RUN_ONCE(&rand_init, do_rand_init))
         return 0;
-
-    if (!CRYPTO_THREAD_write_lock(rand_meth_lock))
+    if (!CRYPTO_atomic_store_ptr((void **)&default_RAND_meth, (void **)&meth,
+            rand_meth_lock))
         return 0;
-#ifndef OPENSSL_NO_ENGINE
-    ENGINE_finish(funct_ref);
-    funct_ref = e;
-#endif
-    default_RAND_meth = meth;
-    CRYPTO_THREAD_unlock(rand_meth_lock);
     return 1;
 }

@@ -288,72 +250,37 @@ int RAND_set_rand_method(const RAND_METHOD *meth)
 const RAND_METHOD *RAND_get_rand_method(void)
 {
     const RAND_METHOD *tmp_meth = NULL;
+    int lock_failed;

     if (!RUN_ONCE(&rand_init, do_rand_init))
-        return NULL;
-
-    if (rand_meth_lock == NULL)
-        return NULL;
+        goto end;

-    if (!CRYPTO_THREAD_read_lock(rand_meth_lock))
+    if (CRYPTO_atomic_load_ptr((void **)&default_RAND_meth, (void **)&tmp_meth,
+            rand_meth_lock)) {
+        if (tmp_meth != NULL)
+            return tmp_meth;
+    } else {
         return NULL;
-    tmp_meth = default_RAND_meth;
-    CRYPTO_THREAD_unlock(rand_meth_lock);
-    if (tmp_meth != NULL)
-        return tmp_meth;
-
-    if (!CRYPTO_THREAD_write_lock(rand_meth_lock))
-        return NULL;
-    if (default_RAND_meth == NULL) {
-#ifndef OPENSSL_NO_ENGINE
-        ENGINE *e;
-
-        /* If we have an engine that can do RAND, use it. */
-        if ((e = ENGINE_get_default_RAND()) != NULL
-            && (tmp_meth = ENGINE_get_RAND(e)) != NULL) {
-            funct_ref = e;
-            default_RAND_meth = tmp_meth;
-        } else {
-            ENGINE_finish(e);
-            default_RAND_meth = &ossl_rand_meth;
-        }
-#else
-        default_RAND_meth = &ossl_rand_meth;
-#endif
     }
-    tmp_meth = default_RAND_meth;
-    CRYPTO_THREAD_unlock(rand_meth_lock);
-    return tmp_meth;
-}
-
-#if !defined(OPENSSL_NO_ENGINE)
-int RAND_set_rand_engine(ENGINE *engine)
-{
-    const RAND_METHOD *tmp_meth = NULL;

-    if (!RUN_ONCE(&rand_init, do_rand_init))
-        return 0;
-
-    if (engine != NULL) {
-        if (!ENGINE_init(engine))
-            return 0;
-        tmp_meth = ENGINE_get_RAND(engine);
-        if (tmp_meth == NULL) {
-            ENGINE_finish(engine);
-            return 0;
-        }
-    }
-    if (!CRYPTO_THREAD_write_lock(rand_engine_lock)) {
-        ENGINE_finish(engine);
-        return 0;
+    /*
+     * We atomically compare and exchange default_RAND_meth
+     * if default_RAND_meth is NULL, we assign ossl_rand_meth to it
+     * If this returns 1, then the exchange was successful, and we can just
+     * return &ossl_rand_meth
+     * If it fails, then the contents of default_RAND_meth are written to tmp_meth
+     * which we can just return as is
+     */
+    if (CRYPTO_atomic_cmp_exch_ptr((void **)&default_RAND_meth, (void **)&tmp_meth,
+            (void *)&ossl_rand_meth, rand_meth_lock, &lock_failed)) {
+        tmp_meth = &ossl_rand_meth;
+    } else {
+        if (lock_failed == 1)
+            return NULL;
     }
-
-    /* This function releases any prior ENGINE so call it first */
-    rand_set_rand_method_internal(tmp_meth, engine);
-    CRYPTO_THREAD_unlock(rand_engine_lock);
-    return 1;
+end:
+    return tmp_meth;
 }
-#endif
 #endif /* OPENSSL_NO_DEPRECATED_3_0 */

 void RAND_seed(const void *buf, int num)
@@ -445,8 +372,12 @@ int RAND_priv_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num,
     const RAND_METHOD *meth = RAND_get_rand_method();

     if (meth != NULL && meth != RAND_OpenSSL()) {
+        if (num > INT_MAX) {
+            ERR_raise(ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE);
+            return -1;
+        }
         if (meth->bytes != NULL)
-            return meth->bytes(buf, num);
+            return meth->bytes(buf, (int)num);
         ERR_raise(ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED);
         return -1;
     }
@@ -484,8 +415,12 @@ int RAND_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num,
     const RAND_METHOD *meth = RAND_get_rand_method();

     if (meth != NULL && meth != RAND_OpenSSL()) {
+        if (num > INT_MAX) {
+            ERR_raise(ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE);
+            return -1;
+        }
         if (meth->bytes != NULL)
-            return meth->bytes(buf, num);
+            return meth->bytes(buf, (int)num);
         ERR_raise(ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED);
         return -1;
     }
@@ -526,6 +461,8 @@ void *ossl_rand_ctx_new(OSSL_LIB_CTX *libctx)
     if (dgbl == NULL)
         return NULL;

+    dgbl->seed_strict = -1;
+
 #ifndef FIPS_MODULE
     /*
      * We need to ensure that base libcrypto thread handling has been
@@ -543,16 +480,8 @@ void *ossl_rand_ctx_new(OSSL_LIB_CTX *libctx)
     if (dgbl->lock == NULL)
         goto err1;

-    if (!CRYPTO_THREAD_init_local(&dgbl->private, NULL))
-        goto err1;
-
-    if (!CRYPTO_THREAD_init_local(&dgbl->public, NULL))
-        goto err2;
-
     return dgbl;

-err2:
-    CRYPTO_THREAD_cleanup_local(&dgbl->private);
 err1:
     CRYPTO_THREAD_lock_free(dgbl->lock);
 #ifndef FIPS_MODULE
@@ -571,8 +500,6 @@ void ossl_rand_ctx_free(void *vdgbl)
         return;

     CRYPTO_THREAD_lock_free(dgbl->lock);
-    CRYPTO_THREAD_cleanup_local(&dgbl->private);
-    CRYPTO_THREAD_cleanup_local(&dgbl->public);
     EVP_RAND_CTX_free(dgbl->primary);
     EVP_RAND_CTX_free(dgbl->seed);
 #ifndef FIPS_MODULE
@@ -597,38 +524,71 @@ static void rand_delete_thread_state(void *arg)
     if (dgbl == NULL)
         return;

-    rand = CRYPTO_THREAD_get_local(&dgbl->public);
-    CRYPTO_THREAD_set_local(&dgbl->public, NULL);
+    rand = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY, ctx);
+    CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY, ctx, NULL);
     EVP_RAND_CTX_free(rand);

-    rand = CRYPTO_THREAD_get_local(&dgbl->private);
-    CRYPTO_THREAD_set_local(&dgbl->private, NULL);
+    rand = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY, ctx);
+    CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY, ctx, NULL);
     EVP_RAND_CTX_free(rand);
 }

 #if !defined(FIPS_MODULE) || !defined(OPENSSL_NO_FIPS_JITTER)
+/*
+ * Return 1 if the seed source must always be used and never be silently
+ * substituted by the operating system entropy sources: requested via the
+ * seed_strict option of the [random] configuration section, defaulting
+ * to strict for the JITTER seed source or implied by an
+ * enable-fips-jitter build which hard-wires the JITTER seed source.
+ */
+static int rand_seed_source_strict(ossl_unused RAND_GLOBAL *dgbl)
+{
+#ifdef OPENSSL_NO_FIPS_JITTER
+    const char *name;
+
+    if (dgbl->seed_strict >= 0)
+        return dgbl->seed_strict;
+    name = dgbl->seed_name != NULL ? dgbl->seed_name : OPENSSL_SEED_SRC_NAME;
+    return OPENSSL_strcasecmp(name, "JITTER") == 0;
+#else /* !OPENSSL_NO_FIPS_JITTER */
+    return 1;
+#endif /* OPENSSL_NO_FIPS_JITTER */
+}
+
 static EVP_RAND_CTX *rand_new_seed(OSSL_LIB_CTX *libctx)
 {
     EVP_RAND *rand;
     const char *propq;
     char *name;
     EVP_RAND_CTX *ctx = NULL;
+    int fallback = 0;
 #ifdef OPENSSL_NO_FIPS_JITTER
     RAND_GLOBAL *dgbl = rand_get_global(libctx);

     if (dgbl == NULL)
         return NULL;
     propq = dgbl->seed_propq;
-    name = dgbl->seed_name != NULL ? dgbl->seed_name
-                                   : OPENSSL_MSTR(OPENSSL_DEFAULT_SEED_SRC);
+#ifdef OPENSSL_DEFAULT_SEED_PROPQ
+    if (propq == NULL)
+        propq = OPENSSL_MSTR(OPENSSL_DEFAULT_SEED_PROPQ);
+#endif /* OPENSSL_DEFAULT_SEED_PROPQ */
+    if (dgbl->seed_name != NULL) {
+        name = dgbl->seed_name;
+    } else {
+        fallback = !rand_seed_source_strict(dgbl);
+        name = OPENSSL_SEED_SRC_NAME;
+    }
 #else /* !OPENSSL_NO_FIPS_JITTER */
-    name = "JITTER";
+    name = OPENSSL_SEED_SRC_NAME;
     propq = "";
 #endif /* OPENSSL_NO_FIPS_JITTER */

+    ERR_set_mark();
     rand = EVP_RAND_fetch(libctx, name, propq);
+    ERR_pop_to_mark();
     if (rand == NULL) {
-        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG);
+        if (!fallback)
+            ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG);
         goto err;
     }
     ctx = EVP_RAND_CTX_new(rand, NULL);
@@ -646,6 +606,116 @@ err:
     EVP_RAND_CTX_free(ctx);
     return NULL;
 }
+
+typedef struct rand_seed_construction_st {
+#ifndef FIPS_MODULE
+    ASYNC_JOB *job;
+#endif
+    struct rand_seed_construction_st *next;
+} RAND_SEED_CONSTRUCTION;
+
+static int rand_seed_construction_begin(OSSL_LIB_CTX *ctx,
+    RAND_SEED_CONSTRUCTION *marker)
+{
+    RAND_SEED_CONSTRUCTION *current, *head;
+#ifndef FIPS_MODULE
+    ASYNC_JOB *job = ASYNC_get_current_job();
+#endif
+
+    head = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_RAND_SEED_KEY, ctx);
+    for (current = head; current != NULL; current = current->next) {
+#ifndef FIPS_MODULE
+        if (current->job != job)
+            continue;
+#endif
+        ERR_raise(ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG);
+        return 0;
+    }
+
+#ifndef FIPS_MODULE
+    marker->job = job;
+#endif
+    marker->next = head;
+    if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_RAND_SEED_KEY, ctx,
+            marker)) {
+        ERR_raise(ERR_LIB_RAND, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    return 1;
+}
+
+static int rand_seed_construction_end(OSSL_LIB_CTX *ctx,
+    RAND_SEED_CONSTRUCTION *marker)
+{
+    RAND_SEED_CONSTRUCTION *current, *head;
+
+    head = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_RAND_SEED_KEY, ctx);
+    if (head == marker) {
+        if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_RAND_SEED_KEY,
+                ctx, marker->next)) {
+            ERR_raise(ERR_LIB_RAND, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+        return 1;
+    }
+
+    for (current = head; current != NULL; current = current->next) {
+        if (current->next == marker) {
+            current->next = marker->next;
+            return 1;
+        }
+    }
+
+    ERR_raise(ERR_LIB_RAND, ERR_R_INTERNAL_ERROR);
+    return 0;
+}
+
+/*
+ * Get the global seed source, creating and storing it if it does not
+ * exist yet.  If several threads race here, exactly one instance is
+ * kept and returned to all of them.
+ */
+static EVP_RAND_CTX *rand_get0_seed(OSSL_LIB_CTX *ctx, RAND_GLOBAL *dgbl)
+{
+    EVP_RAND_CTX *ret, *seed;
+    RAND_SEED_CONSTRUCTION marker;
+
+    if (!CRYPTO_THREAD_read_lock(dgbl->lock))
+        return NULL;
+    ret = dgbl->seed;
+    CRYPTO_THREAD_unlock(dgbl->lock);
+    if (ret != NULL)
+        return ret;
+
+    /*
+     * Mark before fetching so recursion through provider lookup is covered
+     * as well as recursion during context creation or instantiation.
+     */
+    if (!rand_seed_construction_begin(ctx, &marker))
+        return NULL;
+
+    seed = rand_new_seed(ctx);
+    if (!rand_seed_construction_end(ctx, &marker)) {
+        EVP_RAND_CTX_free(seed);
+        return NULL;
+    }
+    if (seed == NULL)
+        return NULL;
+
+    if (!CRYPTO_THREAD_write_lock(dgbl->lock)) {
+        EVP_RAND_CTX_free(seed);
+        return NULL;
+    }
+    if (dgbl->seed == NULL) {
+        dgbl->seed = seed;
+        seed = NULL;
+    }
+    ret = dgbl->seed;
+    CRYPTO_THREAD_unlock(dgbl->lock);
+    /* Free the instance that lost a creation race */
+    EVP_RAND_CTX_free(seed);
+    return ret;
+}
 #endif /* !FIPS_MODULE || !OPENSSL_NO_FIPS_JITTER */

 #ifndef FIPS_MODULE
@@ -663,6 +733,22 @@ EVP_RAND_CTX *ossl_rand_get0_seed_noncreating(OSSL_LIB_CTX *ctx)
     CRYPTO_THREAD_unlock(dgbl->lock);
     return ret;
 }
+
+EVP_RAND_CTX *ossl_rand_get0_seed(OSSL_LIB_CTX *ctx)
+{
+    RAND_GLOBAL *dgbl = rand_get_global(ctx);
+
+    if (dgbl == NULL)
+        return NULL;
+    return rand_get0_seed(ctx, dgbl);
+}
+
+int ossl_rand_seed_source_strict(OSSL_LIB_CTX *ctx)
+{
+    RAND_GLOBAL *dgbl = rand_get_global(ctx);
+
+    return dgbl != NULL && rand_seed_source_strict(dgbl);
+}
 #endif /* !FIPS_MODULE */

 static EVP_RAND_CTX *rand_new_drbg(OSSL_LIB_CTX *libctx, EVP_RAND_CTX *parent,
@@ -756,7 +842,7 @@ static EVP_RAND_CTX *rand_new_crngt(OSSL_LIB_CTX *libctx, EVP_RAND_CTX *parent)
  */
 static EVP_RAND_CTX *rand_get0_primary(OSSL_LIB_CTX *ctx, RAND_GLOBAL *dgbl)
 {
-    EVP_RAND_CTX *ret, *seed, *newseed = NULL, *primary;
+    EVP_RAND_CTX *ret, *seed = NULL, *primary;

     if (dgbl == NULL)
         return NULL;
@@ -765,7 +851,6 @@ static EVP_RAND_CTX *rand_get0_primary(OSSL_LIB_CTX *ctx, RAND_GLOBAL *dgbl)
         return NULL;

     ret = dgbl->primary;
-    seed = dgbl->seed;
     CRYPTO_THREAD_unlock(dgbl->lock);

     if (ret != NULL)
@@ -773,11 +858,13 @@ static EVP_RAND_CTX *rand_get0_primary(OSSL_LIB_CTX *ctx, RAND_GLOBAL *dgbl)

 #if !defined(FIPS_MODULE) || !defined(OPENSSL_NO_FIPS_JITTER)
     /* Create a seed source for libcrypto or jitter enabled FIPS provider */
-    if (seed == NULL) {
-        ERR_set_mark();
-        seed = newseed = rand_new_seed(ctx);
-        ERR_pop_to_mark();
+    ERR_set_mark();
+    seed = rand_get0_seed(ctx, dgbl);
+    if (seed == NULL && ERR_count_to_mark() > 0) {
+        ERR_clear_last_mark();
+        return NULL;
     }
+    ERR_pop_to_mark();
 #endif /* !FIPS_MODULE || !OPENSSL_NO_FIPS_JITTER */

 #if defined(FIPS_MODULE)
@@ -788,33 +875,30 @@ static EVP_RAND_CTX *rand_get0_primary(OSSL_LIB_CTX *ctx, RAND_GLOBAL *dgbl)
         PRIMARY_RESEED_TIME_INTERVAL);
 #endif /* FIPS_MODULE */

+    if (ret == NULL)
+        return NULL;
+
     /*
      * The primary DRBG may be shared between multiple threads so we must
      * enable locking.
      */
-    if (ret == NULL || !EVP_RAND_enable_locking(ret)) {
-        if (ret != NULL) {
-            ERR_raise(ERR_LIB_EVP, EVP_R_UNABLE_TO_ENABLE_LOCKING);
-            EVP_RAND_CTX_free(ret);
-        }
-        if (newseed == NULL)
-            return NULL;
-        /* else carry on and store seed */
-        ret = NULL;
+    if (!EVP_RAND_enable_locking(ret)) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_UNABLE_TO_ENABLE_LOCKING);
+        EVP_RAND_CTX_free(ret);
+        return NULL;
     }

-    if (!CRYPTO_THREAD_write_lock(dgbl->lock))
+    if (!CRYPTO_THREAD_write_lock(dgbl->lock)) {
+        EVP_RAND_CTX_free(ret);
         return NULL;
+    }

     primary = dgbl->primary;
     if (primary != NULL) {
         CRYPTO_THREAD_unlock(dgbl->lock);
         EVP_RAND_CTX_free(ret);
-        EVP_RAND_CTX_free(newseed);
         return primary;
     }
-    if (newseed != NULL)
-        dgbl->seed = newseed;
     dgbl->primary = ret;
     CRYPTO_THREAD_unlock(dgbl->lock);

@@ -836,30 +920,32 @@ EVP_RAND_CTX *RAND_get0_primary(OSSL_LIB_CTX *ctx)
 static EVP_RAND_CTX *rand_get0_public(OSSL_LIB_CTX *ctx, RAND_GLOBAL *dgbl)
 {
     EVP_RAND_CTX *rand, *primary;
+    OSSL_LIB_CTX *origctx = ctx;
+
+    ctx = ossl_lib_ctx_get_concrete(ctx);
+
+    if (ctx == NULL)
+        return NULL;

     if (dgbl == NULL)
         return NULL;

-    rand = CRYPTO_THREAD_get_local(&dgbl->public);
+    rand = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY, ctx);
     if (rand == NULL) {
-        primary = rand_get0_primary(ctx, dgbl);
+        primary = rand_get0_primary(origctx, dgbl);
         if (primary == NULL)
             return NULL;

-        ctx = ossl_lib_ctx_get_concrete(ctx);
-
-        if (ctx == NULL)
-            return NULL;
         /*
          * If the private is also NULL then this is the first time we've
          * used this thread.
          */
-        if (CRYPTO_THREAD_get_local(&dgbl->private) == NULL
+        if (CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY, ctx) == NULL
             && !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
             return NULL;
         rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
             SECONDARY_RESEED_TIME_INTERVAL);
-        if (!CRYPTO_THREAD_set_local(&dgbl->public, rand)) {
+        if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY, ctx, rand)) {
             EVP_RAND_CTX_free(rand);
             rand = NULL;
         }
@@ -881,27 +967,28 @@ EVP_RAND_CTX *RAND_get0_public(OSSL_LIB_CTX *ctx)
 static EVP_RAND_CTX *rand_get0_private(OSSL_LIB_CTX *ctx, RAND_GLOBAL *dgbl)
 {
     EVP_RAND_CTX *rand, *primary;
+    OSSL_LIB_CTX *origctx = ctx;
+
+    ctx = ossl_lib_ctx_get_concrete(ctx);
+    if (ctx == NULL)
+        return NULL;

-    rand = CRYPTO_THREAD_get_local(&dgbl->private);
+    rand = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY, ctx);
     if (rand == NULL) {
-        primary = rand_get0_primary(ctx, dgbl);
+        primary = rand_get0_primary(origctx, dgbl);
         if (primary == NULL)
             return NULL;

-        ctx = ossl_lib_ctx_get_concrete(ctx);
-
-        if (ctx == NULL)
-            return NULL;
         /*
          * If the public is also NULL then this is the first time we've
          * used this thread.
          */
-        if (CRYPTO_THREAD_get_local(&dgbl->public) == NULL
+        if (CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY, ctx) == NULL
             && !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
             return NULL;
         rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
             SECONDARY_RESEED_TIME_INTERVAL);
-        if (!CRYPTO_THREAD_set_local(&dgbl->private, rand)) {
+        if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY, ctx, rand)) {
             EVP_RAND_CTX_free(rand);
             rand = NULL;
         }
@@ -928,7 +1015,7 @@ EVP_RAND_CTX *ossl_rand_get0_private_noncreating(OSSL_LIB_CTX *ctx)
     if (dgbl == NULL)
         return NULL;

-    return CRYPTO_THREAD_get_local(&dgbl->private);
+    return CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY, ctx);
 }
 #endif

@@ -940,8 +1027,8 @@ int RAND_set0_public(OSSL_LIB_CTX *ctx, EVP_RAND_CTX *rand)

     if (dgbl == NULL)
         return 0;
-    old = CRYPTO_THREAD_get_local(&dgbl->public);
-    if ((r = CRYPTO_THREAD_set_local(&dgbl->public, rand)) > 0)
+    old = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY, ctx);
+    if ((r = CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY, ctx, rand)) > 0)
         EVP_RAND_CTX_free(old);
     return r;
 }
@@ -954,8 +1041,8 @@ int RAND_set0_private(OSSL_LIB_CTX *ctx, EVP_RAND_CTX *rand)

     if (dgbl == NULL)
         return 0;
-    old = CRYPTO_THREAD_get_local(&dgbl->private);
-    if ((r = CRYPTO_THREAD_set_local(&dgbl->private, rand)) > 0)
+    old = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY, ctx);
+    if ((r = CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY, ctx, rand)) > 0)
         EVP_RAND_CTX_free(old);
     return r;
 }
@@ -975,6 +1062,16 @@ static int random_set_string(char **p, const char *s)
     return 1;
 }

+static int random_set_bool(int *p, const CONF_VALUE *cval)
+{
+    if (!ossl_conf_parse_bool(cval->value, p)) {
+        ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_RANDOM_SECTION_ERROR,
+            "name=%s, value=%s", cval->name, cval->value);
+        return 0;
+    }
+    return 1;
+}
+
 /*
  * Load the DRBG definitions from a configuration file.
  */
@@ -1019,6 +1116,9 @@ static int random_conf_init(CONF_IMODULE *md, const CONF *cnf)
         } else if (OPENSSL_strcasecmp(cval->name, "seed_properties") == 0) {
             if (!random_set_string(&dgbl->seed_propq, cval->value))
                 return 0;
+        } else if (OPENSSL_strcasecmp(cval->name, "seed_strict") == 0) {
+            if (!random_set_bool(&dgbl->seed_strict, cval))
+                return 0;
         } else if (OPENSSL_strcasecmp(cval->name, "random_provider") == 0) {
 #ifndef FIPS_MODULE
             OSSL_PROVIDER *prov = ossl_provider_find(libctx, cval->value, 0);
diff --git a/deps/openssl/openssl/crypto/rand/rand_pool.c b/deps/openssl/openssl/crypto/rand/rand_pool.c
index cf2f8f359ca..b899dd3b744 100644
--- a/deps/openssl/openssl/crypto/rand/rand_pool.c
+++ b/deps/openssl/openssl/crypto/rand/rand_pool.c
@@ -12,7 +12,6 @@
 #include "internal/cryptlib.h"
 #include <openssl/opensslconf.h>
 #include "crypto/rand.h"
-#include <openssl/engine.h>
 #include "internal/thread_once.h"
 #include "crypto/rand_pool.h"

diff --git a/deps/openssl/openssl/crypto/rand/rand_uniform.c b/deps/openssl/openssl/crypto/rand/rand_uniform.c
index 877150af4e5..b34f2e603a5 100644
--- a/deps/openssl/openssl/crypto/rand/rand_uniform.c
+++ b/deps/openssl/openssl/crypto/rand/rand_uniform.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -47,7 +47,7 @@ uint32_t ossl_rand_uniform_uint32(OSSL_LIB_CTX *ctx, uint32_t upper, int *err)
      * We are generating a fixed point number on the interval [0, 1).
      * Multiplying this by the range gives us a number on [0, upper).
      * The high word of the multiplication result represents the integral
-     * part we want.  The lower word is the fractional part.  We can early exit if
+     * part we want.  The lower word is the fractional part.  We can early exit
      * if the fractional part is small enough that no carry from the next lower
      * word can cause an overflow and carry into the integer part.  This
      * happens when the fractional part is bounded by 2^32 - upper which
@@ -69,7 +69,7 @@ uint32_t ossl_rand_uniform_uint32(OSSL_LIB_CTX *ctx, uint32_t upper, int *err)
      * repeat the process with the next lower word.
      *
      * Each *bit* of randomness has a probability of one half of terminating
-     * this process, so each each word beyond the first has a probability
+     * this process, so each word beyond the first has a probability
      * of 2^-32 of not terminating the process.  That is, we're extremely
      * likely to stop very rapidly.
      */
diff --git a/deps/openssl/openssl/crypto/rand/randfile.c b/deps/openssl/openssl/crypto/rand/randfile.c
index 89797ec9649..eeb81faa95d 100644
--- a/deps/openssl/openssl/crypto/rand/randfile.c
+++ b/deps/openssl/openssl/crypto/rand/randfile.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -35,8 +35,7 @@
 #ifndef OPENSSL_NO_POSIX_IO
 #include <sys/stat.h>
 #include <fcntl.h>
-#if defined(_WIN32) && !defined(_WIN32_WCE)
-#include <windows.h>
+#if defined(_WIN32)
 #include <io.h>
 #define stat _stat
 #define chmod _chmod
@@ -70,7 +69,8 @@
  * This declaration is a nasty hack to get around vms' extension to fopen for
  * passing in sharing options being disabled by /STANDARD=ANSI89
  */
-static __FILE_ptr32 (*const vms_fopen)(const char *, const char *, ...) = (__FILE_ptr32 (*)(const char *, const char *, ...))fopen;
+static __FILE_ptr32 (*const vms_fopen)(const char *, const char *, ...)
+    = (__FILE_ptr32 (*)(const char *, const char *, ...))fopen;
 #define VMS_OPEN_ATTRS \
     "shr=get,put,upd,del", "ctx=bin,stm", "rfm=stm", "rat=none", "mrs=0"
 #define openssl_fopen(fname, mode) vms_fopen((fname), (mode), VMS_OPEN_ATTRS)
@@ -149,7 +149,7 @@ int RAND_load_file(const char *file, long bytes)
             n = (bytes <= RAND_LOAD_BUF_SIZE) ? (int)bytes : RAND_BUF_SIZE;
         else
             n = RAND_LOAD_BUF_SIZE;
-        i = fread(buf, 1, n, in);
+        i = (int)fread(buf, 1, n, in);
 #ifdef EINTR
         if (ferror(in) && errno == EINTR) {
             clearerr(in);
@@ -260,7 +260,7 @@ int RAND_write_file(const char *file)
     chmod(file, 0600);
 #endif

-    ret = fwrite(buf, 1, RAND_BUF_SIZE, out);
+    ret = (int)fwrite(buf, 1, RAND_BUF_SIZE, out);
     fclose(out);
     OPENSSL_cleanse(buf, RAND_BUF_SIZE);
     return ret;
@@ -272,7 +272,7 @@ const char *RAND_file_name(char *buf, size_t size)
     size_t len;
     int use_randfile = 1;

-#if defined(_WIN32) && defined(CP_UTF8) && !defined(_WIN32_WCE)
+#if defined(_WIN32) && defined(CP_UTF8)
     DWORD envlen;
     WCHAR *var;

diff --git a/deps/openssl/openssl/crypto/rc2/rc2_cbc.c b/deps/openssl/openssl/crypto/rc2/rc2_cbc.c
index 46baa9b772d..539e5f36723 100644
--- a/deps/openssl/openssl/crypto/rc2/rc2_cbc.c
+++ b/deps/openssl/openssl/crypto/rc2/rc2_cbc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,7 +14,7 @@
 #include "internal/deprecated.h"

 #include <openssl/rc2.h>
-#include "rc2_local.h"
+#include "internal/common.h"

 void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
     RC2_KEY *ks, unsigned char *iv, int encrypt)
diff --git a/deps/openssl/openssl/crypto/rc2/rc2_local.h b/deps/openssl/openssl/crypto/rc2/rc2_local.h
index f4bd06aaa66..96eb449e2b8 100644
--- a/deps/openssl/openssl/crypto/rc2/rc2_local.h
+++ b/deps/openssl/openssl/crypto/rc2/rc2_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,79 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

-#undef c2l
-#define c2l(c, l) (l = ((unsigned long)(*((c)++))), \
-    l |= ((unsigned long)(*((c)++))) << 8L,         \
-    l |= ((unsigned long)(*((c)++))) << 16L,        \
-    l |= ((unsigned long)(*((c)++))) << 24L)
+#if !defined(OSSL_LIBCRYPTO_RC2_RC2_LOCAL_H)
+#define OSSL_LIBCRYPTO_RC2_RC2_LOCAL_H

-/* NOTE - c is not incremented as per c2l */
-#undef c2ln
-#define c2ln(c, l1, l2, n)                            \
-    {                                                 \
-        c += n;                                       \
-        l1 = l2 = 0;                                  \
-        switch (n) {                                  \
-        case 8:                                       \
-            l2 = ((unsigned long)(*(--(c)))) << 24L;  \
-        /* fall through */                            \
-        case 7:                                       \
-            l2 |= ((unsigned long)(*(--(c)))) << 16L; \
-        /* fall through */                            \
-        case 6:                                       \
-            l2 |= ((unsigned long)(*(--(c)))) << 8L;  \
-        /* fall through */                            \
-        case 5:                                       \
-            l2 |= ((unsigned long)(*(--(c))));        \
-        /* fall through */                            \
-        case 4:                                       \
-            l1 = ((unsigned long)(*(--(c)))) << 24L;  \
-        /* fall through */                            \
-        case 3:                                       \
-            l1 |= ((unsigned long)(*(--(c)))) << 16L; \
-        /* fall through */                            \
-        case 2:                                       \
-            l1 |= ((unsigned long)(*(--(c)))) << 8L;  \
-        /* fall through */                            \
-        case 1:                                       \
-            l1 |= ((unsigned long)(*(--(c))));        \
-        }                                             \
-    }
+#include "internal/common.h"

-#undef l2c
-#define l2c(l, c) (*((c)++) = (unsigned char)(((l)) & 0xff), \
-    *((c)++) = (unsigned char)(((l) >> 8L) & 0xff),          \
-    *((c)++) = (unsigned char)(((l) >> 16L) & 0xff),         \
-    *((c)++) = (unsigned char)(((l) >> 24L) & 0xff))
-
-/* NOTE - c is not incremented as per l2c */
-#undef l2cn
-#define l2cn(l1, l2, c, n)                                    \
-    {                                                         \
-        c += n;                                               \
-        switch (n) {                                          \
-        case 8:                                               \
-            *(--(c)) = (unsigned char)(((l2) >> 24L) & 0xff); \
-        /* fall through */                                    \
-        case 7:                                               \
-            *(--(c)) = (unsigned char)(((l2) >> 16L) & 0xff); \
-        /* fall through */                                    \
-        case 6:                                               \
-            *(--(c)) = (unsigned char)(((l2) >> 8L) & 0xff);  \
-        /* fall through */                                    \
-        case 5:                                               \
-            *(--(c)) = (unsigned char)(((l2)) & 0xff);        \
-        /* fall through */                                    \
-        case 4:                                               \
-            *(--(c)) = (unsigned char)(((l1) >> 24L) & 0xff); \
-        /* fall through */                                    \
-        case 3:                                               \
-            *(--(c)) = (unsigned char)(((l1) >> 16L) & 0xff); \
-        /* fall through */                                    \
-        case 2:                                               \
-            *(--(c)) = (unsigned char)(((l1) >> 8L) & 0xff);  \
-        /* fall through */                                    \
-        case 1:                                               \
-            *(--(c)) = (unsigned char)(((l1)) & 0xff);        \
-        }                                                     \
-    }
+#endif /* !defined(OSSL_LIBCRYPTO_RC2_RC2_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/rc2/rc2_skey.c b/deps/openssl/openssl/crypto/rc2/rc2_skey.c
index 148753e5538..aa4aca99d5c 100644
--- a/deps/openssl/openssl/crypto/rc2/rc2_skey.c
+++ b/deps/openssl/openssl/crypto/rc2/rc2_skey.c
@@ -14,7 +14,7 @@
 #include "internal/deprecated.h"

 #include <openssl/rc2.h>
-#include "rc2_local.h"
+#include "internal/common.h"

 static const unsigned char key_table[256] = {
     0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed, 0x28, 0xe9,
diff --git a/deps/openssl/openssl/crypto/rc2/rc2cfb64.c b/deps/openssl/openssl/crypto/rc2/rc2cfb64.c
index 0ee6061486d..26d4c71a258 100644
--- a/deps/openssl/openssl/crypto/rc2/rc2cfb64.c
+++ b/deps/openssl/openssl/crypto/rc2/rc2cfb64.c
@@ -14,7 +14,7 @@
 #include "internal/deprecated.h"

 #include <openssl/rc2.h>
-#include "rc2_local.h"
+#include "internal/common.h"

 /*
  * The input and output encrypted as though 64bit cfb mode is being used.
diff --git a/deps/openssl/openssl/crypto/rc2/rc2ofb64.c b/deps/openssl/openssl/crypto/rc2/rc2ofb64.c
index fdc025bbd8f..f615ccfcc36 100644
--- a/deps/openssl/openssl/crypto/rc2/rc2ofb64.c
+++ b/deps/openssl/openssl/crypto/rc2/rc2ofb64.c
@@ -14,7 +14,7 @@
 #include "internal/deprecated.h"

 #include <openssl/rc2.h>
-#include "rc2_local.h"
+#include "internal/common.h"

 /*
  * The input and output encrypted as though 64bit ofb mode is being used.
diff --git a/deps/openssl/openssl/crypto/rc4/asm/rc4-586.pl b/deps/openssl/openssl/crypto/rc4/asm/rc4-586.pl
index 1fae93ae1a7..4971b141ada 100644
--- a/deps/openssl/openssl/crypto/rc4/asm/rc4-586.pl
+++ b/deps/openssl/openssl/crypto/rc4/asm/rc4-586.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 1998-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1998-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# [Re]written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# [Re]written by Andy Polyakov <https://github.com/dot-asm> for the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # At some point it became apparent that the original SSLeay RC4
@@ -416,7 +416,7 @@ $idx="edx";
 &asciz	("rc4(4x,int)");
 &asciz	("rc4(1x,char)");
 &asciz	("rc4(8x,mmx)");
-&asciz	("RC4 for x86, CRYPTOGAMS by <appro\@openssl.org>");
+&asciz	("RC4 for x86, CRYPTOGAMS by <https://github.com/dot-asm>");
 &align	(64);
 &function_end_B("RC4_options");

diff --git a/deps/openssl/openssl/crypto/rc4/asm/rc4-c64xplus.pl b/deps/openssl/openssl/crypto/rc4/asm/rc4-c64xplus.pl
index bd1745f1f32..bc7f910eec1 100644
--- a/deps/openssl/openssl/crypto/rc4/asm/rc4-c64xplus.pl
+++ b/deps/openssl/openssl/crypto/rc4/asm/rc4-c64xplus.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2014-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # RC4 for C64x+.
@@ -182,7 +182,7 @@ _rc4_options:
 	.align	4
 rc4_options:
 	.cstring "rc4(sploop,char)"
-	.cstring "RC4 for C64+, CRYPTOGAMS by <appro\@openssl.org>"
+	.cstring "RC4 for C64+, CRYPTOGAMS by <https://github.com/dot-asm>"
 	.align	4
 ___

diff --git a/deps/openssl/openssl/crypto/rc4/asm/rc4-md5-x86_64.pl b/deps/openssl/openssl/crypto/rc4/asm/rc4-md5-x86_64.pl
index 90c94dcb5e3..e11be98c431 100644
--- a/deps/openssl/openssl/crypto/rc4/asm/rc4-md5-x86_64.pl
+++ b/deps/openssl/openssl/crypto/rc4/asm/rc4-md5-x86_64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # June 2011
@@ -26,7 +26,7 @@
 # and Jim Guilford of Intel. MD5 is fresh implementation aiming to
 # minimize register usage, which was used as "main thread" with RC4
 # weaved into it, one RC4 round per one MD5 round. In addition to the
-# stiched subroutine the script can generate standalone replacement
+# stitched subroutine the script can generate standalone replacement
 # ossl_md5_block_asm_data_order and RC4. Below are performance numbers in
 # cycles per processed byte, less is better, for these the standalone
 # subroutines, sum of them, and stitched one:
diff --git a/deps/openssl/openssl/crypto/rc4/asm/rc4-parisc.pl b/deps/openssl/openssl/crypto/rc4/asm/rc4-parisc.pl
index 9a38674a59f..37e7f77bcf8 100644
--- a/deps/openssl/openssl/crypto/rc4/asm/rc4-parisc.pl
+++ b/deps/openssl/openssl/crypto/rc4/asm/rc4-parisc.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2009-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # RC4 for PA-RISC.
@@ -314,7 +314,7 @@ L\$pic
 	.ALIGN	8
 L\$opts
 	.STRINGZ "rc4(4x,`$SZ==1?"char":"int"`)"
-	.STRINGZ "RC4 for PA-RISC, CRYPTOGAMS by <appro\@openssl.org>"
+	.STRINGZ "RC4 for PA-RISC, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`
diff --git a/deps/openssl/openssl/crypto/rc4/asm/rc4-s390x.pl b/deps/openssl/openssl/crypto/rc4/asm/rc4-s390x.pl
index d5250f57f19..cd5a7398e74 100644
--- a/deps/openssl/openssl/crypto/rc4/asm/rc4-s390x.pl
+++ b/deps/openssl/openssl/crypto/rc4/asm/rc4-s390x.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2009-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # February 2009
@@ -162,7 +162,7 @@ $code.=<<___;
 	lm${g}	%r6,%r11,6*$SIZE_T($sp)
 	br	$rp
 .size	RC4,.-RC4
-.string	"RC4 for s390x, CRYPTOGAMS by <appro\@openssl.org>"
+.string	"RC4 for s390x, CRYPTOGAMS by <https://github.com/dot-asm>"

 ___
 }
diff --git a/deps/openssl/openssl/crypto/rc4/asm/rc4-x86_64.pl b/deps/openssl/openssl/crypto/rc4/asm/rc4-x86_64.pl
index 83a1d13635f..be269e1dc2b 100755
--- a/deps/openssl/openssl/crypto/rc4/asm/rc4-x86_64.pl
+++ b/deps/openssl/openssl/crypto/rc4/asm/rc4-x86_64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2005-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2005-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # July 2004
@@ -552,7 +552,7 @@ RC4_options:
 .asciz	"rc4(8x,int)"
 .asciz	"rc4(8x,char)"
 .asciz	"rc4(16x,int)"
-.asciz	"RC4 for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"RC4 for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	64
 .size	RC4_options,.-RC4_options
 ___
diff --git a/deps/openssl/openssl/crypto/rc5/rc5_local.h b/deps/openssl/openssl/crypto/rc5/rc5_local.h
index 57a1642c97e..75022bed943 100644
--- a/deps/openssl/openssl/crypto/rc5/rc5_local.h
+++ b/deps/openssl/openssl/crypto/rc5/rc5_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,84 +7,11 @@
  * https://www.openssl.org/source/license.html
  */

-#include <stdlib.h>
-
-#undef c2l
-#define c2l(c, l) (l = ((unsigned long)(*((c)++))), \
-    l |= ((unsigned long)(*((c)++))) << 8L,         \
-    l |= ((unsigned long)(*((c)++))) << 16L,        \
-    l |= ((unsigned long)(*((c)++))) << 24L)
-
-/* NOTE - c is not incremented as per c2l */
-#undef c2ln
-#define c2ln(c, l1, l2, n)                            \
-    {                                                 \
-        c += n;                                       \
-        l1 = l2 = 0;                                  \
-        switch (n) {                                  \
-        case 8:                                       \
-            l2 = ((unsigned long)(*(--(c)))) << 24L;  \
-        /* fall through */                            \
-        case 7:                                       \
-            l2 |= ((unsigned long)(*(--(c)))) << 16L; \
-        /* fall through */                            \
-        case 6:                                       \
-            l2 |= ((unsigned long)(*(--(c)))) << 8L;  \
-        /* fall through */                            \
-        case 5:                                       \
-            l2 |= ((unsigned long)(*(--(c))));        \
-        /* fall through */                            \
-        case 4:                                       \
-            l1 = ((unsigned long)(*(--(c)))) << 24L;  \
-        /* fall through */                            \
-        case 3:                                       \
-            l1 |= ((unsigned long)(*(--(c)))) << 16L; \
-        /* fall through */                            \
-        case 2:                                       \
-            l1 |= ((unsigned long)(*(--(c)))) << 8L;  \
-        /* fall through */                            \
-        case 1:                                       \
-            l1 |= ((unsigned long)(*(--(c))));        \
-        }                                             \
-    }
+#if !defined(OSSL_LIBCRYPTO_RC5_RC5_LOCAL_H)
+#define OSSL_LIBCRYPTO_RC5_RC5_LOCAL_H

-#undef l2c
-#define l2c(l, c) (*((c)++) = (unsigned char)(((l)) & 0xff), \
-    *((c)++) = (unsigned char)(((l) >> 8L) & 0xff),          \
-    *((c)++) = (unsigned char)(((l) >> 16L) & 0xff),         \
-    *((c)++) = (unsigned char)(((l) >> 24L) & 0xff))
-
-/* NOTE - c is not incremented as per l2c */
-#undef l2cn
-#define l2cn(l1, l2, c, n)                                    \
-    {                                                         \
-        c += n;                                               \
-        switch (n) {                                          \
-        case 8:                                               \
-            *(--(c)) = (unsigned char)(((l2) >> 24L) & 0xff); \
-        /* fall through */                                    \
-        case 7:                                               \
-            *(--(c)) = (unsigned char)(((l2) >> 16L) & 0xff); \
-        /* fall through */                                    \
-        case 6:                                               \
-            *(--(c)) = (unsigned char)(((l2) >> 8L) & 0xff);  \
-        /* fall through */                                    \
-        case 5:                                               \
-            *(--(c)) = (unsigned char)(((l2)) & 0xff);        \
-        /* fall through */                                    \
-        case 4:                                               \
-            *(--(c)) = (unsigned char)(((l1) >> 24L) & 0xff); \
-        /* fall through */                                    \
-        case 3:                                               \
-            *(--(c)) = (unsigned char)(((l1) >> 16L) & 0xff); \
-        /* fall through */                                    \
-        case 2:                                               \
-            *(--(c)) = (unsigned char)(((l1) >> 8L) & 0xff);  \
-        /* fall through */                                    \
-        case 1:                                               \
-            *(--(c)) = (unsigned char)(((l1)) & 0xff);        \
-        }                                                     \
-    }
+#include <stdlib.h>
+#include "internal/common.h"

 #if (defined(OPENSSL_SYS_WIN32) && defined(_MSC_VER))
 #define ROTATE_l32(a, n) _lrotl(a, n)
@@ -92,7 +19,7 @@
 #elif defined(__ICC)
 #define ROTATE_l32(a, n) _rotl(a, n)
 #define ROTATE_r32(a, n) _rotr(a, n)
-#elif defined(__GNUC__) && __GNUC__ >= 2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC)
+#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC)
 #if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
 #define ROTATE_l32(a, n) ({              \
     register unsigned int ret;           \
@@ -143,3 +70,5 @@
     a &= RC5_32_MASK;        \
     a = ROTATE_r32(a, b);    \
     a ^= b;
+
+#endif /* !defined(OSSL_LIBCRYPTO_RC5_RC5_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/rcu_internal.h b/deps/openssl/openssl/crypto/rcu_internal.h
index 3408923ebaa..508ca19b6c9 100644
--- a/deps/openssl/openssl/crypto/rcu_internal.h
+++ b/deps/openssl/openssl/crypto/rcu_internal.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,8 @@
 #define OPENSSL_RCU_INTERNAL_H
 #pragma once

+#include <internal/rcu.h>
+
 struct rcu_qp;

 struct rcu_cb_item {
diff --git a/deps/openssl/openssl/crypto/ripemd/rmd_local.h b/deps/openssl/openssl/crypto/ripemd/rmd_local.h
index f2934a7332f..d66c66bca4e 100644
--- a/deps/openssl/openssl/crypto/ripemd/rmd_local.h
+++ b/deps/openssl/openssl/crypto/ripemd/rmd_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_RIPEMD_RMD_LOCAL_H)
+#define OSSL_LIBCRYPTO_RIPEMD_RMD_LOCAL_H
+
 #include <stdlib.h>
 #include <string.h>
 #include <openssl/opensslconf.h>
@@ -48,7 +51,9 @@ void ripemd160_block_data_order(RIPEMD160_CTX *c, const void *p, size_t num);
     } while (0)
 #define HASH_BLOCK_DATA_ORDER ripemd160_block_data_order

-#include "crypto/md32_common.h"
+/* clang-format off */
+#include "crypto/md32_common.inc"
+/* clang-format on */

 /*
  * Transformed F2 and F4 are courtesy of Wei Dai
@@ -101,3 +106,5 @@ void ripemd160_block_data_order(RIPEMD160_CTX *c, const void *p, size_t num);
         a = ROTATE(a, s) + e;        \
         c = ROTATE(c, 10);           \
     }
+
+#endif /* !defined(OSSL_LIBCRYPTO_RIPEMD_RMD_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/ripemd/rmdconst.h b/deps/openssl/openssl/crypto/ripemd/rmdconst.h
index f9daf1b09f2..dd75463eb0e 100644
--- a/deps/openssl/openssl/crypto/ripemd/rmdconst.h
+++ b/deps/openssl/openssl/crypto/ripemd/rmdconst.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_RIPEMD_RMDCONST_H)
+#define OSSL_LIBCRYPTO_RIPEMD_RMDCONST_H
+
 #define KL0 0x00000000L
 #define KL1 0x5A827999L
 #define KL2 0x6ED9EBA1L
@@ -348,3 +351,5 @@
 #define SR78 11
 #define WR79 11
 #define SR79 11
+
+#endif /* !defined(OSSL_LIBCRYPTO_RIPEMD_RMDCONST_H) */
diff --git a/deps/openssl/openssl/crypto/riscv32cpuid.pl b/deps/openssl/openssl/crypto/riscv32cpuid.pl
index 9d42ef6b895..b693412b600 100644
--- a/deps/openssl/openssl/crypto/riscv32cpuid.pl
+++ b/deps/openssl/openssl/crypto/riscv32cpuid.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/crypto/riscv64cpuid.pl b/deps/openssl/openssl/crypto/riscv64cpuid.pl
index 5c0d3c429a8..59e78534817 100644
--- a/deps/openssl/openssl/crypto/riscv64cpuid.pl
+++ b/deps/openssl/openssl/crypto/riscv64cpuid.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/crypto/riscvcap.c b/deps/openssl/openssl/crypto/riscvcap.c
index 64a45d87cec..17e4dbc7d71 100644
--- a/deps/openssl/openssl/crypto/riscvcap.c
+++ b/deps/openssl/openssl/crypto/riscvcap.c
@@ -15,7 +15,7 @@
 #include "internal/cryptlib.h"

 #define OPENSSL_RISCVCAP_IMPL
-#include "crypto/riscv_arch.h"
+#include "arch/riscv_arch.h"

 #ifdef OSSL_RISCV_HWPROBE
 #include <unistd.h>
@@ -129,7 +129,7 @@ size_t riscv_vlen(void)
     return vlen;
 }

-#if defined(__GNUC__) && __GNUC__ >= 2
+#if defined(__GNUC__)
 __attribute__((constructor))
 #endif
 void OPENSSL_cpuid_setup(void)
diff --git a/deps/openssl/openssl/crypto/rsa/build.info b/deps/openssl/openssl/crypto/rsa/build.info
index ad3370db397..bf5316883e4 100644
--- a/deps/openssl/openssl/crypto/rsa/build.info
+++ b/deps/openssl/openssl/crypto/rsa/build.info
@@ -7,7 +7,7 @@ $COMMON=rsa_ossl.c rsa_gen.c rsa_lib.c rsa_sign.c rsa_pk1.c \

 SOURCE[../../libcrypto]=$COMMON\
         rsa_saos.c rsa_err.c rsa_asn1.c rsa_ameth.c rsa_prn.c \
-        rsa_pmeth.c rsa_meth.c rsa_mp.c
+        rsa_meth.c rsa_mp.c
 IF[{- !$disabled{'deprecated-0.9.8'} -}]
   SOURCE[../../libcrypto]=rsa_depr.c
 ENDIF
diff --git a/deps/openssl/openssl/crypto/rsa/rsa_acvp_test_params.c b/deps/openssl/openssl/crypto/rsa/rsa_acvp_test_params.c
index 77e1c39c3e0..c7a6b626de1 100644
--- a/deps/openssl/openssl/crypto/rsa/rsa_acvp_test_params.c
+++ b/deps/openssl/openssl/crypto/rsa/rsa_acvp_test_params.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,12 +11,14 @@
 #include <openssl/core_names.h>
 #include <openssl/param_build.h>
 #include "crypto/rsa.h"
+#include "crypto/rsa_params.h"
 #include "rsa_local.h"

-int ossl_rsa_acvp_test_gen_params_new(OSSL_PARAM **dst, const OSSL_PARAM src[])
+int ossl_rsa_acvp_test_gen_params_new_parsed(OSSL_PARAM **dst,
+    const RSA_PARAMS *params)
 {
-    const OSSL_PARAM *p, *s;
     OSSL_PARAM *d, *alloc = NULL;
+    size_t i;
     int ret = 1;

     static const OSSL_PARAM settable[] = {
@@ -29,9 +31,16 @@ int ossl_rsa_acvp_test_gen_params_new(OSSL_PARAM **dst, const OSSL_PARAM src[])
         OSSL_PARAM_END
     };

-    /* Assume the first element is a required field if this feature is used */
-    p = OSSL_PARAM_locate_const(src, settable[0].key);
-    if (p == NULL)
+    if (dst == NULL || params == NULL)
+        return 0;
+
+    const OSSL_PARAM *src[] = {
+        params->fips.xp, params->fips.xp1, params->fips.xp2,
+        params->fips.xq, params->fips.xq1, params->fips.xq2
+    };
+
+    /* Xp is required whenever the ACVP test interface is used. */
+    if (src[0] == NULL)
         return 1;

     /* Zeroing here means the terminator is always set at the end */
@@ -40,16 +49,16 @@ int ossl_rsa_acvp_test_gen_params_new(OSSL_PARAM **dst, const OSSL_PARAM src[])
         return 0;

     d = alloc;
-    for (s = settable; s->key != NULL; ++s) {
-        /* If src contains a key from settable then copy the src to the dest */
-        p = OSSL_PARAM_locate_const(src, s->key);
-        if (p != NULL) {
-            *d = *s; /* shallow copy from the static settable[] */
-            d->data_size = p->data_size;
-            d->data = OPENSSL_memdup(p->data, p->data_size);
-            if (d->data == NULL)
+    for (i = 0; i < OSSL_NELEM(src); i++) {
+        if (src[i] != NULL) {
+            *d = settable[i];
+            d->data_size = src[i]->data_size;
+            d->data = OPENSSL_memdup(src[i]->data, src[i]->data_size);
+            if (d->data == NULL) {
                 ret = 0;
-            ++d;
+                break;
+            }
+            d++;
         }
     }
     if (ret == 0) {
@@ -62,6 +71,16 @@ int ossl_rsa_acvp_test_gen_params_new(OSSL_PARAM **dst, const OSSL_PARAM src[])
     return ret;
 }

+int ossl_rsa_acvp_test_gen_params_new(OSSL_PARAM **dst,
+    const OSSL_PARAM src[])
+{
+    RSA_PARAMS params;
+
+    if (!rsa_acvp_input_decoder(src, &params))
+        return 0;
+    return ossl_rsa_acvp_test_gen_params_new_parsed(dst, &params);
+}
+
 void ossl_rsa_acvp_test_gen_params_free(OSSL_PARAM *dst)
 {
     OSSL_PARAM *p;
@@ -76,10 +95,12 @@ void ossl_rsa_acvp_test_gen_params_free(OSSL_PARAM *dst)
     OPENSSL_free(dst);
 }

-int ossl_rsa_acvp_test_set_params(RSA *r, const OSSL_PARAM params[])
+static int rsa_acvp_test_set_params_parsed(RSA *r, const RSA_PARAMS *p)
 {
     RSA_ACVP_TEST *t;
-    const OSSL_PARAM *p;
+
+    if (r == NULL || p == NULL)
+        return 0;

     if (r->acvp_test != NULL) {
         ossl_rsa_acvp_test_free(r->acvp_test);
@@ -90,31 +111,25 @@ int ossl_rsa_acvp_test_set_params(RSA *r, const OSSL_PARAM params[])
     if (t == NULL)
         return 0;

-    /* Set the input parameters */
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_TEST_XP1)) != NULL
-        && !OSSL_PARAM_get_BN(p, &t->Xp1))
+    if (p->fips.xp1 != NULL && !OSSL_PARAM_get_BN(p->fips.xp1, &t->Xp1))
         goto err;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_TEST_XP2)) != NULL
-        && !OSSL_PARAM_get_BN(p, &t->Xp2))
+    if (p->fips.xp2 != NULL && !OSSL_PARAM_get_BN(p->fips.xp2, &t->Xp2))
         goto err;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_TEST_XP)) != NULL
-        && !OSSL_PARAM_get_BN(p, &t->Xp))
+    if (p->fips.xp != NULL && !OSSL_PARAM_get_BN(p->fips.xp, &t->Xp))
         goto err;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_TEST_XQ1)) != NULL
-        && !OSSL_PARAM_get_BN(p, &t->Xq1))
+    if (p->fips.xq1 != NULL && !OSSL_PARAM_get_BN(p->fips.xq1, &t->Xq1))
         goto err;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_TEST_XQ2)) != NULL
-        && !OSSL_PARAM_get_BN(p, &t->Xq2))
+    if (p->fips.xq2 != NULL && !OSSL_PARAM_get_BN(p->fips.xq2, &t->Xq2))
         goto err;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_TEST_XQ)) != NULL
-        && !OSSL_PARAM_get_BN(p, &t->Xq))
+    if (p->fips.xq != NULL && !OSSL_PARAM_get_BN(p->fips.xq, &t->Xq))
         goto err;

-    /* Setup the output parameters */
     t->p1 = BN_new();
     t->p2 = BN_new();
     t->q1 = BN_new();
     t->q2 = BN_new();
+    if (t->p1 == NULL || t->p2 == NULL || t->q1 == NULL || t->q2 == NULL)
+        goto err;
     r->acvp_test = t;
     return 1;
 err:
@@ -122,32 +137,45 @@ err:
     return 0;
 }

-int ossl_rsa_acvp_test_get_params(RSA *r, OSSL_PARAM params[])
+int ossl_rsa_acvp_test_set_params(RSA *r, const OSSL_PARAM params[])
+{
+    RSA_PARAMS p;
+
+    if (!rsa_acvp_input_decoder(params, &p))
+        return 0;
+    return rsa_acvp_test_set_params_parsed(r, &p);
+}
+
+int ossl_rsa_acvp_test_get_params_parsed(RSA *r, const RSA_PARAMS *p)
 {
     RSA_ACVP_TEST *t;
-    OSSL_PARAM *p;

-    if (r == NULL)
+    if (r == NULL || p == NULL)
         return 0;

     t = r->acvp_test;
     if (t != NULL) {
-        if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_RSA_TEST_P1)) != NULL
-            && !OSSL_PARAM_set_BN(p, t->p1))
+        if (p->fips.p1 != NULL && !OSSL_PARAM_set_BN(p->fips.p1, t->p1))
             return 0;
-        if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_RSA_TEST_P2)) != NULL
-            && !OSSL_PARAM_set_BN(p, t->p2))
+        if (p->fips.p2 != NULL && !OSSL_PARAM_set_BN(p->fips.p2, t->p2))
             return 0;
-        if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_RSA_TEST_Q1)) != NULL
-            && !OSSL_PARAM_set_BN(p, t->q1))
+        if (p->fips.q1 != NULL && !OSSL_PARAM_set_BN(p->fips.q1, t->q1))
             return 0;
-        if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_RSA_TEST_Q2)) != NULL
-            && !OSSL_PARAM_set_BN(p, t->q2))
+        if (p->fips.q2 != NULL && !OSSL_PARAM_set_BN(p->fips.q2, t->q2))
             return 0;
     }
     return 1;
 }

+int ossl_rsa_acvp_test_get_params(RSA *r, OSSL_PARAM params[])
+{
+    RSA_PARAMS p;
+
+    if (!rsa_acvp_output_decoder(params, &p))
+        return 0;
+    return ossl_rsa_acvp_test_get_params_parsed(r, &p);
+}
+
 void ossl_rsa_acvp_test_free(RSA_ACVP_TEST *t)
 {
     if (t != NULL) {
diff --git a/deps/openssl/openssl/crypto/rsa/rsa_ameth.c b/deps/openssl/openssl/crypto/rsa/rsa_ameth.c
index 1eac38695d8..a1ee53e47da 100644
--- a/deps/openssl/openssl/crypto/rsa/rsa_ameth.c
+++ b/deps/openssl/openssl/crypto/rsa/rsa_ameth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -23,6 +23,7 @@
 #include "crypto/asn1.h"
 #include "crypto/evp.h"
 #include "crypto/rsa.h"
+#include "crypto/rsa_params.h"
 #include "rsa_local.h"

 /* Set any parameters associated with pkey */
@@ -653,6 +654,10 @@ static int rsa_item_sign(EVP_MD_CTX *ctx, const ASN1_ITEM *it, const void *asn,
     int pad_mode;
     EVP_PKEY_CTX *pkctx = EVP_MD_CTX_get_pkey_ctx(ctx);

+    if (pkctx == NULL) {
+        ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
     if (EVP_PKEY_CTX_get_rsa_padding(pkctx, &pad_mode) <= 0)
         return 0;
     if (pad_mode == RSA_PKCS1_PADDING)
@@ -704,13 +709,13 @@ static int rsa_item_sign(EVP_MD_CTX *ctx, const ASN1_ITEM *it, const void *asn,
         if (alg1 != NULL) {
             const unsigned char *pp = aid;

-            if (d2i_X509_ALGOR(&alg1, &pp, aid_len) == NULL)
+            if (d2i_X509_ALGOR(&alg1, &pp, (long)aid_len) == NULL)
                 return 0;
         }
         if (alg2 != NULL) {
             const unsigned char *pp = aid;

-            if (d2i_X509_ALGOR(&alg2, &pp, aid_len) == NULL)
+            if (d2i_X509_ALGOR(&alg2, &pp, (long)aid_len) == NULL)
                 return 0;
         }

@@ -846,10 +851,8 @@ err:
     return rv;
 }

-static int rsa_int_import_from(const OSSL_PARAM params[], void *vpctx,
-    int rsa_type)
+static int rsa_int_import_from(const RSA_PARAMS *p, EVP_PKEY_CTX *pctx, int rsa_type)
 {
-    EVP_PKEY_CTX *pctx = vpctx;
     EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(pctx);
     RSA *rsa = ossl_rsa_new_with_ctx(pctx->libctx);
     RSA_PSS_PARAMS_30 rsa_pss_params = {
@@ -866,8 +869,9 @@ static int rsa_int_import_from(const OSSL_PARAM params[], void *vpctx,
     RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK);
     RSA_set_flags(rsa, rsa_type);

-    if (!ossl_rsa_pss_params_30_fromdata(&rsa_pss_params, &pss_defaults_set,
-            params, pctx->libctx))
+    if (!ossl_rsa_pss_params_30_fromdata_parsed(&rsa_pss_params,
+            &pss_defaults_set,
+            p, pctx->libctx))
         goto err;

     switch (rsa_type) {
@@ -903,7 +907,7 @@ static int rsa_int_import_from(const OSSL_PARAM params[], void *vpctx,
         goto err;
     }

-    if (!ossl_rsa_fromdata(rsa, params, 1))
+    if (!ossl_rsa_fromdata_parsed(rsa, p, 1))
         goto err;

     switch (rsa_type) {
@@ -939,12 +943,22 @@ static int rsa_pss_pkey_export_to(const EVP_PKEY *from, void *to_keydata,

 static int rsa_pkey_import_from(const OSSL_PARAM params[], void *vpctx)
 {
-    return rsa_int_import_from(params, vpctx, RSA_FLAG_TYPE_RSA);
+    EVP_PKEY_CTX *pctx = vpctx;
+    RSA_PARAMS p;
+
+    if (pctx == NULL || !rsa_pkey_import_from_decoder(params, &p))
+        return 0;
+    return rsa_int_import_from(&p, pctx, RSA_FLAG_TYPE_RSA);
 }

 static int rsa_pss_pkey_import_from(const OSSL_PARAM params[], void *vpctx)
 {
-    return rsa_int_import_from(params, vpctx, RSA_FLAG_TYPE_RSASSAPSS);
+    EVP_PKEY_CTX *pctx = vpctx;
+    RSA_PARAMS p;
+
+    if (pctx == NULL || !rsa_pss_pkey_import_from_decoder(params, &p))
+        return 0;
+    return rsa_int_import_from(&p, pctx, RSA_FLAG_TYPE_RSASSAPSS);
 }

 static int rsa_pkey_copy(EVP_PKEY *to, EVP_PKEY *from)
diff --git a/deps/openssl/openssl/crypto/rsa/rsa_backend.c b/deps/openssl/openssl/crypto/rsa/rsa_backend.c
index 3cfa4a18be5..67fe3ab0994 100644
--- a/deps/openssl/openssl/crypto/rsa/rsa_backend.c
+++ b/deps/openssl/openssl/crypto/rsa/rsa_backend.c
@@ -25,31 +25,30 @@
 #include "internal/sizes.h"
 #include "internal/param_build_set.h"
 #include "crypto/rsa.h"
+#include "crypto/rsa_params.h"
 #include "rsa_local.h"

 /*
- * The intention with the "backend" source file is to offer backend support
- * for legacy backends (EVP_PKEY_ASN1_METHOD and EVP_PKEY_METHOD) and provider
- * implementations alike.
+ * The intention with the "backend" source file is to offer backend functions
+ * for legacy backends (EVP_PKEY_ASN1_METHOD) and provider implementations
+ * alike.
  */

 DEFINE_STACK_OF(BIGNUM)

 static int collect_numbers(STACK_OF(BIGNUM) *numbers,
-    const OSSL_PARAM params[], const char *names[])
+    OSSL_PARAM *const params[], size_t num_params)
 {
-    const OSSL_PARAM *p = NULL;
-    int i;
+    size_t i;

     if (numbers == NULL)
         return 0;

-    for (i = 0; names[i] != NULL; i++) {
-        p = OSSL_PARAM_locate_const(params, names[i]);
-        if (p != NULL) {
+    for (i = 0; i < num_params; i++) {
+        if (params[i] != NULL) {
             BIGNUM *tmp = NULL;

-            if (!OSSL_PARAM_get_BN(p, &tmp))
+            if (!OSSL_PARAM_get_BN(params[i], &tmp))
                 return 0;
             if (sk_BIGNUM_push(numbers, tmp) == 0) {
                 BN_clear_free(tmp);
@@ -61,39 +60,30 @@ static int collect_numbers(STACK_OF(BIGNUM) *numbers,
     return 1;
 }

-int ossl_rsa_fromdata(RSA *rsa, const OSSL_PARAM params[], int include_private)
+int ossl_rsa_fromdata_parsed(RSA *rsa, const RSA_PARAMS *p,
+    int include_private)
 {
-    const OSSL_PARAM *param_n, *param_e, *param_d = NULL;
-    const OSSL_PARAM *param_p, *param_q = NULL;
-    const OSSL_PARAM *param_derive = NULL;
-    BIGNUM *p = NULL, *q = NULL, *n = NULL, *e = NULL, *d = NULL;
+    BIGNUM *n = NULL, *e = NULL, *d = NULL;
     STACK_OF(BIGNUM) *factors = NULL, *exps = NULL, *coeffs = NULL;
     int is_private = 0;
     int derive_from_pq = 0;
     BN_CTX *ctx = NULL;

-    if (rsa == NULL)
+    if (rsa == NULL || p == NULL)
         return 0;

-    param_n = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_N);
-    param_e = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_E);
-
-    if ((param_n == NULL || !OSSL_PARAM_get_BN(param_n, &n))
-        || (param_e == NULL || !OSSL_PARAM_get_BN(param_e, &e))) {
+    if ((p->n == NULL || !OSSL_PARAM_get_BN(p->n, &n))
+        || (p->e == NULL || !OSSL_PARAM_get_BN(p->e, &e))) {
         ERR_raise(ERR_LIB_RSA, ERR_R_PASSED_NULL_PARAMETER);
         goto err;
     }

     if (include_private) {
-
-        param_derive = OSSL_PARAM_locate_const(params,
-            OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ);
-        if ((param_derive != NULL)
-            && !OSSL_PARAM_get_int(param_derive, &derive_from_pq))
+        if ((p->derive != NULL)
+            && !OSSL_PARAM_get_int(p->derive, &derive_from_pq))
             goto err;

-        param_d = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_D);
-        if (param_d != NULL && !OSSL_PARAM_get_BN(param_d, &d)) {
+        if (p->d != NULL && !OSSL_PARAM_get_BN(p->d, &d)) {
             ERR_raise(ERR_LIB_RSA, ERR_R_PASSED_NULL_PARAMETER);
             goto err;
         }
@@ -104,10 +94,7 @@ int ossl_rsa_fromdata(RSA *rsa, const OSSL_PARAM params[], int include_private)
                 goto err;

             /* we need at minimum p, q */
-            param_p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_FACTOR1);
-            param_q = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_FACTOR2);
-            if ((param_p == NULL || !OSSL_PARAM_get_BN(param_p, &p))
-                || (param_q == NULL || !OSSL_PARAM_get_BN(param_q, &q))) {
+            if (p->mp.factors[0] == NULL || p->mp.factors[1] == NULL) {
                 ERR_raise(ERR_LIB_RSA, ERR_R_PASSED_NULL_PARAMETER);
                 goto err;
             }
@@ -121,12 +108,12 @@ int ossl_rsa_fromdata(RSA *rsa, const OSSL_PARAM params[], int include_private)
     n = e = d = NULL;

     if (is_private) {
-        if (!collect_numbers(factors = sk_BIGNUM_new_null(), params,
-                ossl_rsa_mp_factor_names)
-            || !collect_numbers(exps = sk_BIGNUM_new_null(), params,
-                ossl_rsa_mp_exp_names)
-            || !collect_numbers(coeffs = sk_BIGNUM_new_null(), params,
-                ossl_rsa_mp_coeff_names))
+        if (!collect_numbers(factors = sk_BIGNUM_new_null(), p->mp.factors,
+                OSSL_NELEM(p->mp.factors))
+            || !collect_numbers(exps = sk_BIGNUM_new_null(), p->mp.exps,
+                OSSL_NELEM(p->mp.exps))
+            || !collect_numbers(coeffs = sk_BIGNUM_new_null(), p->mp.coeffs,
+                OSSL_NELEM(p->mp.coeffs)))
             goto err;

         if (derive_from_pq && sk_BIGNUM_num(exps) == 0
@@ -145,7 +132,7 @@ int ossl_rsa_fromdata(RSA *rsa, const OSSL_PARAM params[], int include_private)
              * been provided
              */
             if (sk_BIGNUM_num(factors) > 2
-                && (param_n == NULL || param_d == NULL)) {
+                && (p->n == NULL || p->d == NULL)) {
                 ERR_raise(ERR_LIB_RSA, ERR_R_PASSED_NULL_PARAMETER);
                 goto err;
             }
@@ -230,12 +217,10 @@ int ossl_rsa_fromdata(RSA *rsa, const OSSL_PARAM params[], int include_private)

     if (!ossl_rsa_check_factors(rsa)) {
         ERR_raise_data(ERR_LIB_RSA, RSA_R_INVALID_KEYPAIR,
-            "RSA factors/exponents are too big for for n-modulus\n");
+            "RSA factors/exponents are too big for n-modulus\n");
         goto err;
     }

-    BN_clear_free(p);
-    BN_clear_free(q);
     sk_BIGNUM_free(factors);
     sk_BIGNUM_free(exps);
     sk_BIGNUM_free(coeffs);
@@ -246,8 +231,6 @@ err:
     BN_free(n);
     BN_free(e);
     BN_free(d);
-    BN_clear_free(p);
-    BN_clear_free(q);
     sk_BIGNUM_pop_free(factors, BN_clear_free);
     sk_BIGNUM_pop_free(exps, BN_clear_free);
     sk_BIGNUM_pop_free(coeffs, BN_clear_free);
@@ -255,10 +238,38 @@ err:
     return 0;
 }

+int ossl_rsa_fromdata(RSA *rsa, const OSSL_PARAM params[],
+    int include_private)
+{
+    RSA_PARAMS p;
+
+    if (!rsa_key_fromdata_decoder(params, &p))
+        return 0;
+    return ossl_rsa_fromdata_parsed(rsa, &p, include_private);
+}
+
 DEFINE_SPECIAL_STACK_OF_CONST(BIGNUM_const, BIGNUM)

-int ossl_rsa_todata(RSA *rsa, OSSL_PARAM_BLD *bld, OSSL_PARAM params[],
-    int include_private)
+static int rsa_set_multi_key_bn(OSSL_PARAM_BLD *bld,
+    OSSL_PARAM *const params[], size_t num_params, const char *names[],
+    STACK_OF(BIGNUM_const) *numbers)
+{
+    int i, num_numbers = sk_BIGNUM_const_num(numbers);
+
+    for (i = 0; i < num_numbers && (size_t)i < num_params
+        && names[i] != NULL;
+        i++) {
+        const BIGNUM *bn = sk_BIGNUM_const_value(numbers, i);
+        OSSL_PARAM *p = bld == NULL ? params[i] : NULL;
+
+        if (bn != NULL && !ossl_param_build_set_bn(bld, p, names[i], bn))
+            return 0;
+    }
+    return 1;
+}
+
+int ossl_rsa_todata_parsed(RSA *rsa, OSSL_PARAM_BLD *bld,
+    const RSA_PARAMS *p, int include_private)
 {
     int ret = 0;
     const BIGNUM *rsa_d = NULL, *rsa_n = NULL, *rsa_e = NULL;
@@ -266,36 +277,42 @@ int ossl_rsa_todata(RSA *rsa, OSSL_PARAM_BLD *bld, OSSL_PARAM params[],
     STACK_OF(BIGNUM_const) *exps = sk_BIGNUM_const_new_null();
     STACK_OF(BIGNUM_const) *coeffs = sk_BIGNUM_const_new_null();

-    if (rsa == NULL || factors == NULL || exps == NULL || coeffs == NULL)
+    if (rsa == NULL || (bld == NULL && p == NULL)
+        || factors == NULL || exps == NULL || coeffs == NULL)
         goto err;

     RSA_get0_key(rsa, &rsa_n, &rsa_e, &rsa_d);
     ossl_rsa_get0_all_params(rsa, factors, exps, coeffs);

-    if (!ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_N, rsa_n)
-        || !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_E, rsa_e))
+    if (!ossl_param_build_set_bn(bld, p == NULL ? NULL : p->n,
+            OSSL_PKEY_PARAM_RSA_N, rsa_n)
+        || !ossl_param_build_set_bn(bld, p == NULL ? NULL : p->e,
+            OSSL_PKEY_PARAM_RSA_E, rsa_e))
         goto err;

     /* Check private key data integrity */
     if (include_private && rsa_d != NULL) {

-        if (!ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_D,
+        if (!ossl_param_build_set_bn(bld, p == NULL ? NULL : p->d,
+                OSSL_PKEY_PARAM_RSA_D,
                 rsa_d)
-            || !ossl_param_build_set_multi_key_bn(bld, params,
-                ossl_rsa_mp_factor_names,
-                factors)
-            || !ossl_param_build_set_multi_key_bn(bld, params,
-                ossl_rsa_mp_exp_names, exps)
-            || !ossl_param_build_set_multi_key_bn(bld, params,
-                ossl_rsa_mp_coeff_names,
-                coeffs))
+            || !rsa_set_multi_key_bn(bld,
+                p == NULL ? NULL : p->mp.factors,
+                OSSL_RSA_PARAM_MAX_PRIMES, ossl_rsa_mp_factor_names, factors)
+            || !rsa_set_multi_key_bn(bld,
+                p == NULL ? NULL : p->mp.exps,
+                OSSL_RSA_PARAM_MAX_PRIMES, ossl_rsa_mp_exp_names, exps)
+            || !rsa_set_multi_key_bn(bld,
+                p == NULL ? NULL : p->mp.coeffs,
+                OSSL_RSA_PARAM_MAX_PRIMES - 1,
+                ossl_rsa_mp_coeff_names, coeffs))
             goto err;
     }

 #if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
     /* The acvp test results are not meant for export so check for bld == NULL */
     if (bld == NULL)
-        ossl_rsa_acvp_test_get_params(rsa, params);
+        ossl_rsa_acvp_test_get_params_parsed(rsa, p);
 #endif
     ret = 1;
 err:
@@ -305,9 +322,25 @@ err:
     return ret;
 }

-int ossl_rsa_pss_params_30_todata(const RSA_PSS_PARAMS_30 *pss,
-    OSSL_PARAM_BLD *bld, OSSL_PARAM params[])
+int ossl_rsa_todata(RSA *rsa, OSSL_PARAM_BLD *bld, OSSL_PARAM params[],
+    int include_private)
 {
+    RSA_PARAMS p;
+
+    if (params != NULL) {
+        if (!rsa_key_todata_decoder(params, &p))
+            return 0;
+        return ossl_rsa_todata_parsed(rsa, bld, &p, include_private);
+    }
+    return ossl_rsa_todata_parsed(rsa, bld, NULL, include_private);
+}
+
+int ossl_rsa_pss_params_30_todata_parsed(const RSA_PSS_PARAMS_30 *pss,
+    OSSL_PARAM_BLD *bld, const RSA_PARAMS *p)
+{
+    if (bld == NULL && p == NULL)
+        return 0;
+
     if (!ossl_rsa_pss_params_30_is_unrestricted(pss)) {
         int hashalg_nid = ossl_rsa_pss_params_30_hashalg(pss);
         int maskgenalg_nid = ossl_rsa_pss_params_30_maskgenalg(pss);
@@ -336,42 +369,52 @@ int ossl_rsa_pss_params_30_todata(const RSA_PSS_PARAMS_30 *pss,
          * if it has a default value; saltlen.
          */
         if ((mdname != NULL
-                && !ossl_param_build_set_utf8_string(bld, params, key_md, mdname))
+                && !ossl_param_build_set_utf8_string(bld,
+                    p == NULL ? NULL : p->digest, key_md, mdname))
             || (mgfname != NULL
-                && !ossl_param_build_set_utf8_string(bld, params,
-                    key_mgf, mgfname))
+                && !ossl_param_build_set_utf8_string(bld,
+                    p == NULL ? NULL : p->maskgenfunc, key_mgf, mgfname))
             || (mgf1mdname != NULL
-                && !ossl_param_build_set_utf8_string(bld, params,
+                && !ossl_param_build_set_utf8_string(bld,
+                    p == NULL ? NULL : p->mgf1_digest,
                     key_mgf1_md, mgf1mdname))
-            || (!ossl_param_build_set_int(bld, params, key_saltlen, saltlen)))
+            || (!ossl_param_build_set_int(bld,
+                p == NULL ? NULL : p->pss_saltlen,
+                key_saltlen, saltlen)))
             return 0;
     }
     return 1;
 }

-int ossl_rsa_pss_params_30_fromdata(RSA_PSS_PARAMS_30 *pss_params,
-    int *defaults_set,
-    const OSSL_PARAM params[],
-    OSSL_LIB_CTX *libctx)
+int ossl_rsa_pss_params_30_todata(const RSA_PSS_PARAMS_30 *pss,
+    OSSL_PARAM_BLD *bld, OSSL_PARAM params[])
+{
+    RSA_PARAMS p;
+
+    if (params != NULL) {
+        if (!rsa_pss_todata_decoder(params, &p))
+            return 0;
+        return ossl_rsa_pss_params_30_todata_parsed(pss, bld, &p);
+    }
+    return ossl_rsa_pss_params_30_todata_parsed(pss, bld, NULL);
+}
+
+int ossl_rsa_pss_params_30_fromdata_parsed(RSA_PSS_PARAMS_30 *pss_params,
+    int *defaults_set, const RSA_PARAMS *p, OSSL_LIB_CTX *libctx)
 {
-    const OSSL_PARAM *param_md, *param_mgf, *param_mgf1md, *param_saltlen;
-    const OSSL_PARAM *param_propq;
     const char *propq = NULL;
     EVP_MD *md = NULL, *mgf1md = NULL;
     int saltlen;
     int ret = 0;

-    if (pss_params == NULL)
+    if (pss_params == NULL || defaults_set == NULL || p == NULL)
         return 0;
-    param_propq = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_DIGEST_PROPS);
-    param_md = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_DIGEST);
-    param_mgf = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_MASKGENFUNC);
-    param_mgf1md = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_MGF1_DIGEST);
-    param_saltlen = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_PSS_SALTLEN);
-
-    if (param_propq != NULL) {
-        if (param_propq->data_type == OSSL_PARAM_UTF8_STRING)
-            propq = param_propq->data;
+
+    if (p->digest_props != NULL) {
+        if (p->digest_props->data_type == OSSL_PARAM_UTF8_STRING)
+            propq = p->digest_props->data;
+        else if (!OSSL_PARAM_get_utf8_ptr(p->digest_props, &propq))
+            return 0;
     }
     /*
      * If we get any of the parameters, we know we have at least some
@@ -379,25 +422,26 @@ int ossl_rsa_pss_params_30_fromdata(RSA_PSS_PARAMS_30 *pss_params,
      * parameter override their specific restriction data.
      */
     if (!*defaults_set
-        && (param_md != NULL || param_mgf != NULL || param_mgf1md != NULL
-            || param_saltlen != NULL)) {
+        && (p->digest != NULL || p->maskgenfunc != NULL || p->mgf1_digest != NULL
+            || p->pss_saltlen != NULL)) {
         if (!ossl_rsa_pss_params_30_set_defaults(pss_params))
             return 0;
         *defaults_set = 1;
     }

-    if (param_mgf != NULL) {
+    if (p->maskgenfunc != NULL) {
         int default_maskgenalg_nid = ossl_rsa_pss_params_30_maskgenalg(NULL);
         const char *mgfname = NULL;

-        if (param_mgf->data_type == OSSL_PARAM_UTF8_STRING)
-            mgfname = param_mgf->data;
-        else if (!OSSL_PARAM_get_utf8_ptr(param_mgf, &mgfname))
+        if (p->maskgenfunc->data_type == OSSL_PARAM_UTF8_STRING)
+            mgfname = p->maskgenfunc->data;
+        else if (!OSSL_PARAM_get_utf8_ptr(p->maskgenfunc, &mgfname))
             return 0;

-        if (OPENSSL_strcasecmp(param_mgf->data,
-                ossl_rsa_mgf_nid2name(default_maskgenalg_nid))
-            != 0)
+        if (mgfname == NULL
+            || OPENSSL_strcasecmp(mgfname,
+                   ossl_rsa_mgf_nid2name(default_maskgenalg_nid))
+                != 0)
             return 0;
     }

@@ -406,12 +450,12 @@ int ossl_rsa_pss_params_30_fromdata(RSA_PSS_PARAMS_30 *pss_params,
      * exact propquery is unimportant in the EVP_MD_fetch() calls below.
      */

-    if (param_md != NULL) {
+    if (p->digest != NULL) {
         const char *mdname = NULL;

-        if (param_md->data_type == OSSL_PARAM_UTF8_STRING)
-            mdname = param_md->data;
-        else if (!OSSL_PARAM_get_utf8_ptr(param_mgf, &mdname))
+        if (p->digest->data_type == OSSL_PARAM_UTF8_STRING)
+            mdname = p->digest->data;
+        else if (!OSSL_PARAM_get_utf8_ptr(p->digest, &mdname))
             goto err;

         if ((md = EVP_MD_fetch(libctx, mdname, propq)) == NULL
@@ -420,12 +464,12 @@ int ossl_rsa_pss_params_30_fromdata(RSA_PSS_PARAMS_30 *pss_params,
             goto err;
     }

-    if (param_mgf1md != NULL) {
+    if (p->mgf1_digest != NULL) {
         const char *mgf1mdname = NULL;

-        if (param_mgf1md->data_type == OSSL_PARAM_UTF8_STRING)
-            mgf1mdname = param_mgf1md->data;
-        else if (!OSSL_PARAM_get_utf8_ptr(param_mgf, &mgf1mdname))
+        if (p->mgf1_digest->data_type == OSSL_PARAM_UTF8_STRING)
+            mgf1mdname = p->mgf1_digest->data;
+        else if (!OSSL_PARAM_get_utf8_ptr(p->mgf1_digest, &mgf1mdname))
             goto err;

         if ((mgf1md = EVP_MD_fetch(libctx, mgf1mdname, propq)) == NULL
@@ -434,8 +478,8 @@ int ossl_rsa_pss_params_30_fromdata(RSA_PSS_PARAMS_30 *pss_params,
             goto err;
     }

-    if (param_saltlen != NULL) {
-        if (!OSSL_PARAM_get_int(param_saltlen, &saltlen)
+    if (p->pss_saltlen != NULL) {
+        if (!OSSL_PARAM_get_int(p->pss_saltlen, &saltlen)
             || !ossl_rsa_pss_params_30_set_saltlen(pss_params, saltlen))
             goto err;
     }
@@ -448,10 +492,21 @@ err:
     return ret;
 }

+int ossl_rsa_pss_params_30_fromdata(RSA_PSS_PARAMS_30 *pss_params,
+    int *defaults_set, const OSSL_PARAM params[], OSSL_LIB_CTX *libctx)
+{
+    RSA_PARAMS p;
+
+    if (!rsa_pss_fromdata_decoder(params, &p))
+        return 0;
+    return ossl_rsa_pss_params_30_fromdata_parsed(pss_params, defaults_set,
+        &p, libctx);
+}
+
 int ossl_rsa_is_foreign(const RSA *rsa)
 {
 #ifndef FIPS_MODULE
-    if (rsa->engine != NULL || RSA_get_method(rsa) != RSA_PKCS1_OpenSSL())
+    if (RSA_get_method(rsa) != RSA_PKCS1_OpenSSL())
         return 1;
 #endif
     return 0;
@@ -539,7 +594,8 @@ RSA *ossl_rsa_dup(const RSA *rsa, int selection)
     }

     if (rsa->pss != NULL) {
-        dupkey->pss = RSA_PSS_PARAMS_dup(rsa->pss);
+        if ((dupkey->pss = RSA_PSS_PARAMS_dup(rsa->pss)) == NULL)
+            goto err;
         if (rsa->pss->maskGenAlgorithm != NULL
             && dupkey->pss->maskGenAlgorithm == NULL) {
             dupkey->pss->maskHash = ossl_x509_algor_mgf1_decode(rsa->pss->maskGenAlgorithm);
diff --git a/deps/openssl/openssl/crypto/rsa/rsa_crpt.c b/deps/openssl/openssl/crypto/rsa/rsa_crpt.c
index a62f20946da..d048d17705b 100644
--- a/deps/openssl/openssl/crypto/rsa/rsa_crpt.c
+++ b/deps/openssl/openssl/crypto/rsa/rsa_crpt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -61,28 +61,16 @@ int RSA_flags(const RSA *r)

 void RSA_blinding_off(RSA *rsa)
 {
-    BN_BLINDING_free(rsa->blinding);
-    rsa->blinding = NULL;
     rsa->flags &= ~RSA_FLAG_BLINDING;
     rsa->flags |= RSA_FLAG_NO_BLINDING;
 }

 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx)
 {
-    int ret = 0;
-
-    if (rsa->blinding != NULL)
-        RSA_blinding_off(rsa);
-
-    rsa->blinding = RSA_setup_blinding(rsa, ctx);
-    if (rsa->blinding == NULL)
-        goto err;

     rsa->flags |= RSA_FLAG_BLINDING;
     rsa->flags &= ~RSA_FLAG_NO_BLINDING;
-    ret = 1;
-err:
-    return ret;
+    return 1;
 }

 static BIGNUM *rsa_get_public_exp(const BIGNUM *d, const BIGNUM *p,
@@ -162,8 +150,6 @@ BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *in_ctx)
         goto err;
     }

-    BN_BLINDING_set_current_thread(ret);
-
 err:
     BN_CTX_end(ctx);
     if (ctx != in_ctx)
diff --git a/deps/openssl/openssl/crypto/rsa/rsa_err.c b/deps/openssl/openssl/crypto/rsa/rsa_err.c
deleted file mode 100644
index 8f20f68efed..00000000000
--- a/deps/openssl/openssl/crypto/rsa/rsa_err.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/rsaerr.h>
-#include "crypto/rsaerr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA RSA_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_ALGORITHM_MISMATCH), "algorithm mismatch" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_BAD_E_VALUE), "bad e value" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_BAD_FIXED_HEADER_DECRYPT),
-        "bad fixed header decrypt" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_BAD_PAD_BYTE_COUNT), "bad pad byte count" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_BAD_SIGNATURE), "bad signature" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_BLOCK_TYPE_IS_NOT_01),
-        "block type is not 01" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_BLOCK_TYPE_IS_NOT_02),
-        "block type is not 02" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_DATA_GREATER_THAN_MOD_LEN),
-        "data greater than mod len" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_DATA_TOO_LARGE), "data too large" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE),
-        "data too large for key size" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_DATA_TOO_LARGE_FOR_MODULUS),
-        "data too large for modulus" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_DATA_TOO_SMALL), "data too small" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE),
-        "data too small for key size" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_DIGEST_DOES_NOT_MATCH),
-        "digest does not match" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_DIGEST_NOT_ALLOWED), "digest not allowed" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY),
-        "digest too big for rsa key" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_DMP1_NOT_CONGRUENT_TO_D),
-        "dmp1 not congruent to d" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_DMQ1_NOT_CONGRUENT_TO_D),
-        "dmq1 not congruent to d" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_D_E_NOT_CONGRUENT_TO_1),
-        "d e not congruent to 1" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_FIRST_OCTET_INVALID),
-        "first octet invalid" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE),
-        "illegal or unsupported padding mode" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_DIGEST), "invalid digest" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_DIGEST_LENGTH),
-        "invalid digest length" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_HEADER), "invalid header" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_KEYPAIR), "invalid keypair" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_KEY_LENGTH), "invalid key length" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_LABEL), "invalid label" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_LENGTH), "invalid length" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_MESSAGE_LENGTH),
-        "invalid message length" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_MGF1_MD), "invalid mgf1 md" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_MODULUS), "invalid modulus" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_MULTI_PRIME_KEY),
-        "invalid multi prime key" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_OAEP_PARAMETERS),
-        "invalid oaep parameters" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_PADDING), "invalid padding" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_PADDING_MODE),
-        "invalid padding mode" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_PSS_PARAMETERS),
-        "invalid pss parameters" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_PSS_SALTLEN),
-        "invalid pss saltlen" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_REQUEST), "invalid request" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_SALT_LENGTH),
-        "invalid salt length" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_STRENGTH), "invalid strength" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_TRAILER), "invalid trailer" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_INVALID_X931_DIGEST),
-        "invalid x931 digest" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_IQMP_NOT_INVERSE_OF_Q),
-        "iqmp not inverse of q" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_KEY_PRIME_NUM_INVALID),
-        "key prime num invalid" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_KEY_SIZE_TOO_SMALL), "key size too small" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_LAST_OCTET_INVALID), "last octet invalid" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_MGF1_DIGEST_NOT_ALLOWED),
-        "mgf1 digest not allowed" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_MISSING_PRIVATE_KEY),
-        "missing private key" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_MODULUS_TOO_LARGE), "modulus too large" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R),
-        "mp coefficient not inverse of r" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D),
-        "mp exponent not congruent to d" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_MP_R_NOT_PRIME), "mp r not prime" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_NO_PUBLIC_EXPONENT), "no public exponent" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_NULL_BEFORE_BLOCK_MISSING),
-        "null before block missing" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES),
-        "n does not equal product of primes" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_N_DOES_NOT_EQUAL_P_Q),
-        "n does not equal p q" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_OAEP_DECODING_ERROR),
-        "oaep decoding error" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE),
-        "operation not supported for this keytype" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_PADDING_CHECK_FAILED),
-        "padding check failed" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_PAIRWISE_TEST_FAILURE),
-        "pairwise test failure" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_PKCS_DECODING_ERROR),
-        "pkcs decoding error" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_PSS_SALTLEN_TOO_SMALL),
-        "pss saltlen too small" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_PUB_EXPONENT_OUT_OF_RANGE),
-        "pub exponent out of range" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_P_NOT_PRIME), "p not prime" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_Q_NOT_PRIME), "q not prime" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_RANDOMNESS_SOURCE_STRENGTH_INSUFFICIENT),
-        "randomness source strength insufficient" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED),
-        "rsa operations not supported" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_SLEN_CHECK_FAILED),
-        "salt length check failed" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_SLEN_RECOVERY_FAILED),
-        "salt length recovery failed" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_SSLV3_ROLLBACK_ATTACK),
-        "sslv3 rollback attack" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD),
-        "the asn1 object identifier is not known for this md" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_UNKNOWN_ALGORITHM_TYPE),
-        "unknown algorithm type" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_UNKNOWN_DIGEST), "unknown digest" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_UNKNOWN_MASK_DIGEST),
-        "unknown mask digest" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_UNKNOWN_PADDING_TYPE),
-        "unknown padding type" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_UNSUPPORTED_ENCRYPTION_TYPE),
-        "unsupported encryption type" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_UNSUPPORTED_LABEL_SOURCE),
-        "unsupported label source" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_UNSUPPORTED_MASK_ALGORITHM),
-        "unsupported mask algorithm" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_UNSUPPORTED_MASK_PARAMETER),
-        "unsupported mask parameter" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_UNSUPPORTED_SIGNATURE_TYPE),
-        "unsupported signature type" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_VALUE_MISSING), "value missing" },
-    { ERR_PACK(ERR_LIB_RSA, 0, RSA_R_WRONG_SIGNATURE_LENGTH),
-        "wrong signature length" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_RSA_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(RSA_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(RSA_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/rsa/rsa_gen.c b/deps/openssl/openssl/crypto/rsa/rsa_gen.c
index 777a485422d..92b9a3a9ac9 100644
--- a/deps/openssl/openssl/crypto/rsa/rsa_gen.c
+++ b/deps/openssl/openssl/crypto/rsa/rsa_gen.c
@@ -29,7 +29,8 @@

 static int rsa_keygen_pairwise_test(RSA *rsa, OSSL_CALLBACK *cb, void *cbarg);
 static int rsa_keygen(OSSL_LIB_CTX *libctx, RSA *rsa, int bits, int primes,
-    BIGNUM *e_value, BN_GENCB *cb, int pairwise_test);
+    BIGNUM *e_value, BN_GENCB *cb, int pairwise_test,
+    uint32_t a, uint32_t b);

 /*
  * NB: this wrapper would normally be placed in rsa_lib.c and the static
@@ -47,8 +48,9 @@ int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb)
         e_value, cb);
 }

-int RSA_generate_multi_prime_key(RSA *rsa, int bits, int primes,
-    BIGNUM *e_value, BN_GENCB *cb)
+int ossl_rsa_generate_multi_prime_key(RSA *rsa, int bits, int primes,
+    BIGNUM *e_value, BN_GENCB *cb,
+    uint32_t a, uint32_t b)
 {
 #ifndef FIPS_MODULE
     /* multi-prime is only supported with the builtin key generation */
@@ -68,7 +70,13 @@ int RSA_generate_multi_prime_key(RSA *rsa, int bits, int primes,
             return 0;
     }
 #endif /* FIPS_MODULE */
-    return rsa_keygen(rsa->libctx, rsa, bits, primes, e_value, cb, 0);
+    return rsa_keygen(rsa->libctx, rsa, bits, primes, e_value, cb, 0, a, b);
+}
+
+int RSA_generate_multi_prime_key(RSA *rsa, int bits, int primes,
+    BIGNUM *e, BN_GENCB *cb)
+{
+    return ossl_rsa_generate_multi_prime_key(rsa, bits, primes, e, cb, 0, 0);
 }

 DEFINE_STACK_OF(BIGNUM)
@@ -450,8 +458,10 @@ static int rsa_multiprime_keygen(RSA *rsa, int bits, int primes,
             tmp = BN_dup(prime);
             if (tmp == NULL)
                 goto err;
-            if (!sk_BIGNUM_insert(factors, tmp, sk_BIGNUM_num(factors)))
+            if (!sk_BIGNUM_insert(factors, tmp, sk_BIGNUM_num(factors))) {
+                BN_clear_free(tmp);
                 goto err;
+            }
             continue;
         }

@@ -520,8 +530,10 @@ static int rsa_multiprime_keygen(RSA *rsa, int bits, int primes,
         tmp = BN_dup(prime);
         if (tmp == NULL)
             goto err;
-        if (!sk_BIGNUM_insert(factors, tmp, sk_BIGNUM_num(factors)))
+        if (!sk_BIGNUM_insert(factors, tmp, sk_BIGNUM_num(factors))) {
+            BN_clear_free(tmp);
             goto err;
+        }
     }

     if (BN_cmp(rsa->p, rsa->q) < 0) {
@@ -529,8 +541,12 @@ static int rsa_multiprime_keygen(RSA *rsa, int bits, int primes,
         rsa->p = rsa->q;
         rsa->q = tmp;
         /* mirror this in our factor stack */
-        if (!sk_BIGNUM_insert(factors, sk_BIGNUM_delete(factors, 0), 1))
+        tmp = sk_BIGNUM_delete(factors, 0);
+        if (!sk_BIGNUM_insert(factors, tmp, 1)) {
+            /* the factor is no longer on the stack, so free it here */
+            BN_clear_free(tmp);
             goto err;
+        }
     }

     /* calculate d */
@@ -595,9 +611,10 @@ static int rsa_multiprime_keygen(RSA *rsa, int bits, int primes,
     }
     ok = 1;
 err:
-    sk_BIGNUM_free(factors);
-    sk_BIGNUM_free(exps);
-    sk_BIGNUM_free(coeffs);
+    /* On error, these stacks may still contain BIGNUMs. */
+    sk_BIGNUM_pop_free(factors, BN_clear_free);
+    sk_BIGNUM_pop_free(exps, BN_clear_free);
+    sk_BIGNUM_pop_free(coeffs, BN_clear_free);
     if (ok == -1) {
         ERR_raise(ERR_LIB_RSA, ERR_R_BN_LIB);
         ok = 0;
@@ -609,12 +626,13 @@ err:
 #endif /* FIPS_MODULE */

 static int rsa_keygen(OSSL_LIB_CTX *libctx, RSA *rsa, int bits, int primes,
-    BIGNUM *e_value, BN_GENCB *cb, int pairwise_test)
+    BIGNUM *e_value, BN_GENCB *cb, int pairwise_test,
+    uint32_t a, uint32_t b)
 {
     int ok = 0;

 #ifdef FIPS_MODULE
-    ok = ossl_rsa_sp800_56b_generate_key(rsa, bits, e_value, cb);
+    ok = ossl_rsa_sp800_56b_generate_key(rsa, bits, e_value, cb, a, b);
     pairwise_test = 1; /* FIPS MODE needs to always run the pairwise test */
 #else
     /*
@@ -624,7 +642,7 @@ static int rsa_keygen(OSSL_LIB_CTX *libctx, RSA *rsa, int bits, int primes,
     if (primes == 2
         && bits >= 2048
         && (e_value == NULL || BN_num_bits(e_value) > 16))
-        ok = ossl_rsa_sp800_56b_generate_key(rsa, bits, e_value, cb);
+        ok = ossl_rsa_sp800_56b_generate_key(rsa, bits, e_value, cb, a, b);
     else
         ok = rsa_multiprime_keygen(rsa, bits, primes, e_value, cb);
 #endif /* FIPS_MODULE */
@@ -705,7 +723,7 @@ static int rsa_keygen_pairwise_test(RSA *rsa, OSSL_CALLBACK *cb, void *cbarg)
      * decoded.
      */
     plaintxt_len = RSA_size(rsa);
-    plaintxt = OPENSSL_zalloc(plaintxt_len * 3);
+    plaintxt = OPENSSL_calloc(plaintxt_len, 3);
     if (plaintxt == NULL)
         goto err;
     ciphertxt = plaintxt + plaintxt_len;
diff --git a/deps/openssl/openssl/crypto/rsa/rsa_lib.c b/deps/openssl/openssl/crypto/rsa/rsa_lib.c
index 746767cbd20..879974c96e4 100644
--- a/deps/openssl/openssl/crypto/rsa/rsa_lib.c
+++ b/deps/openssl/openssl/crypto/rsa/rsa_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,25 +15,25 @@

 #include <openssl/crypto.h>
 #include <openssl/core_names.h>
-#ifndef FIPS_MODULE
-#include <openssl/engine.h>
-#endif
 #include <openssl/evp.h>
 #include <openssl/param_build.h>
+#include "internal/common.h"
 #include "internal/cryptlib.h"
 #include "internal/refcount.h"
+#include "internal/zeroization.h"
 #include "crypto/bn.h"
 #include "crypto/evp.h"
 #include "crypto/rsa.h"
+#include "crypto/sparse_array.h"
 #include "crypto/security_bits.h"
 #include "rsa_local.h"

-static RSA *rsa_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx);
+static RSA *rsa_new_intern(OSSL_LIB_CTX *libctx);

 #ifndef FIPS_MODULE
 RSA *RSA_new(void)
 {
-    return rsa_new_intern(NULL, NULL);
+    return rsa_new_intern(NULL);
 }

 const RSA_METHOD *RSA_get_method(const RSA *rsa)
@@ -51,10 +51,6 @@ int RSA_set_method(RSA *rsa, const RSA_METHOD *meth)
     mtmp = rsa->meth;
     if (mtmp->finish)
         mtmp->finish(rsa);
-#ifndef OPENSSL_NO_ENGINE
-    ENGINE_finish(rsa->engine);
-    rsa->engine = NULL;
-#endif
     rsa->meth = meth;
     if (meth->init)
         meth->init(rsa);
@@ -63,16 +59,18 @@ int RSA_set_method(RSA *rsa, const RSA_METHOD *meth)

 RSA *RSA_new_method(ENGINE *engine)
 {
-    return rsa_new_intern(engine, NULL);
+    if (!ossl_assert(engine == NULL))
+        return NULL;
+    return rsa_new_intern(NULL);
 }
 #endif

 RSA *ossl_rsa_new_with_ctx(OSSL_LIB_CTX *libctx)
 {
-    return rsa_new_intern(NULL, libctx);
+    return rsa_new_intern(libctx);
 }

-static RSA *rsa_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx)
+static RSA *rsa_new_intern(OSSL_LIB_CTX *libctx)
 {
     RSA *ret = OPENSSL_zalloc(sizeof(*ret));

@@ -92,28 +90,12 @@ static RSA *rsa_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx)
         return NULL;
     }

+    ret->blindings_sa = ossl_rsa_alloc_blinding();
+    if (ret->blindings_sa == NULL)
+        goto err;
+
     ret->libctx = libctx;
     ret->meth = RSA_get_default_method();
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
-    if (engine) {
-        if (!ENGINE_init(engine)) {
-            ERR_raise(ERR_LIB_RSA, ERR_R_ENGINE_LIB);
-            goto err;
-        }
-        ret->engine = engine;
-    } else {
-        ret->engine = ENGINE_get_default_RSA();
-    }
-    if (ret->engine) {
-        ret->meth = ENGINE_get_RSA(ret->engine);
-        if (ret->meth == NULL) {
-            ERR_raise(ERR_LIB_RSA, ERR_R_ENGINE_LIB);
-            goto err;
-        }
-    }
-#endif
-
     ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
 #ifndef FIPS_MODULE
     if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data)) {
@@ -148,9 +130,6 @@ void RSA_free(RSA *r)

     if (r->meth != NULL && r->meth->finish != NULL)
         r->meth->finish(r);
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    ENGINE_finish(r->engine);
-#endif

 #ifndef FIPS_MODULE
     CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, r, &r->ex_data);
@@ -159,13 +138,8 @@ void RSA_free(RSA *r)
     CRYPTO_THREAD_lock_free(r->lock);
     CRYPTO_FREE_REF(&r->references);

-#ifdef OPENSSL_PEDANTIC_ZEROIZATION
-    BN_clear_free(r->n);
-    BN_clear_free(r->e);
-#else
-    BN_free(r->n);
-    BN_free(r->e);
-#endif
+    ossl_public_bn_free(r->n);
+    ossl_public_bn_free(r->e);
     BN_clear_free(r->d);
     BN_clear_free(r->p);
     BN_clear_free(r->q);
@@ -181,8 +155,7 @@ void RSA_free(RSA *r)
     RSA_PSS_PARAMS_free(r->pss);
     sk_RSA_PRIME_INFO_pop_free(r->prime_infos, ossl_rsa_multip_info_free);
 #endif
-    BN_BLINDING_free(r->blinding);
-    BN_BLINDING_free(r->mt_blinding);
+    ossl_rsa_free_blinding(r);
     OPENSSL_free(r);
 }

@@ -190,7 +163,7 @@ int RSA_up_ref(RSA *r)
 {
     int i;

-    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&r->references, &i))
         return 0;

     REF_PRINT_COUNT("RSA", i, r);
@@ -407,11 +380,11 @@ int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d)
         return 0;

     if (n != NULL) {
-        BN_free(r->n);
+        ossl_public_bn_free(r->n);
         r->n = n;
     }
     if (e != NULL) {
-        BN_free(r->e);
+        ossl_public_bn_free(r->e);
         r->e = e;
     }
     if (d != NULL) {
@@ -729,17 +702,12 @@ int RSA_get_version(RSA *r)
 }

 #ifndef FIPS_MODULE
-ENGINE *RSA_get0_engine(const RSA *r)
-{
-    return r->engine;
-}
-
 int RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2)
 {
     /* If key type not RSA or RSA-PSS return error */
-    if (ctx != NULL && ctx->pmeth != NULL
-        && ctx->pmeth->pkey_id != EVP_PKEY_RSA
-        && ctx->pmeth->pkey_id != EVP_PKEY_RSA_PSS)
+    if (ctx == NULL
+        || (ctx->legacy_keytype != EVP_PKEY_RSA
+            && ctx->legacy_keytype != EVP_PKEY_RSA_PSS))
         return -1;
     return EVP_PKEY_CTX_ctrl(ctx, -1, optype, cmd, p1, p2);
 }
@@ -1377,4 +1345,5 @@ int EVP_PKEY_CTX_set_rsa_keygen_primes(EVP_PKEY_CTX *ctx, int primes)

     return evp_pkey_ctx_set_params_strict(ctx, params);
 }
+
 #endif
diff --git a/deps/openssl/openssl/crypto/rsa/rsa_local.h b/deps/openssl/openssl/crypto/rsa/rsa_local.h
index 924d125ff51..7ea7ee65414 100644
--- a/deps/openssl/openssl/crypto/rsa/rsa_local.h
+++ b/deps/openssl/openssl/crypto/rsa/rsa_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -57,8 +57,6 @@ struct rsa_st {
     OSSL_LIB_CTX *libctx;
     int32_t version;
     const RSA_METHOD *meth;
-    /* functional reference if 'meth' is ENGINE-provided */
-    ENGINE *engine;
     BIGNUM *n;
     BIGNUM *e;
     BIGNUM *d;
@@ -93,8 +91,7 @@ struct rsa_st {
     BN_MONT_CTX *_method_mod_n;
     BN_MONT_CTX *_method_mod_p;
     BN_MONT_CTX *_method_mod_q;
-    BN_BLINDING *blinding;
-    BN_BLINDING *mt_blinding;
+    void *blindings_sa;
     CRYPTO_RWLOCK *lock;

     int dirty_cnt;
@@ -147,9 +144,8 @@ struct rsa_meth_st {
         BIGNUM *e, BN_GENCB *cb);
 };

-/* Macros to test if a pkey or ctx is for a PSS key */
+/* Macro to test if a pkey is for a PSS key */
 #define pkey_is_pss(pkey) (pkey->ameth->pkey_id == EVP_PKEY_RSA_PSS)
-#define pkey_ctx_is_pss(ctx) (ctx->pmeth->pkey_id == EVP_PKEY_RSA_PSS)
 int ossl_rsa_multiprime_derive(RSA *rsa, int bits, int primes,
     BIGNUM *e_value,
     STACK_OF(BIGNUM) *factors, STACK_OF(BIGNUM) *exps,
@@ -185,16 +181,18 @@ int ossl_rsa_sp800_56b_check_private(const RSA *rsa);
 int ossl_rsa_sp800_56b_check_keypair(const RSA *rsa, const BIGNUM *efixed,
     int strength, int nbits);
 int ossl_rsa_sp800_56b_generate_key(RSA *rsa, int nbits, const BIGNUM *efixed,
-    BN_GENCB *cb);
+    BN_GENCB *cb, uint32_t a, uint32_t b);

 int ossl_rsa_sp800_56b_derive_params_from_pq(RSA *rsa, int nbits,
     const BIGNUM *e, BN_CTX *ctx);
-int ossl_rsa_fips186_4_gen_prob_primes(RSA *rsa, RSA_ACVP_TEST *test,
+int ossl_rsa_fips186_5_gen_prob_primes(RSA *rsa, RSA_ACVP_TEST *test,
     int nbits, const BIGNUM *e, BN_CTX *ctx,
-    BN_GENCB *cb);
+    BN_GENCB *cb, uint32_t a, uint32_t b);

 int ossl_rsa_padding_add_PKCS1_type_2_ex(OSSL_LIB_CTX *libctx, unsigned char *to,
     int tlen, const unsigned char *from,
     int flen);
+void ossl_rsa_free_blinding(RSA *rsa);
+void *ossl_rsa_alloc_blinding(void);

 #endif /* OSSL_CRYPTO_RSA_LOCAL_H */
diff --git a/deps/openssl/openssl/crypto/rsa/rsa_ossl.c b/deps/openssl/openssl/crypto/rsa/rsa_ossl.c
index 73a4b7c20a4..f444e98e61a 100644
--- a/deps/openssl/openssl/crypto/rsa/rsa_ossl.c
+++ b/deps/openssl/openssl/crypto/rsa/rsa_ossl.c
@@ -15,12 +15,19 @@

 #include "internal/cryptlib.h"
 #include "crypto/bn.h"
+#include "crypto/sparse_array.h"
 #include "rsa_local.h"
 #include "internal/constant_time.h"
+#if defined(OPENSSL_SYS_TANDEM)
+#include "internal/tsan_assist.h"
+#include "internal/threads_common.h"
+#endif
 #include <openssl/evp.h>
 #include <openssl/sha.h>
 #include <openssl/hmac.h>

+DEFINE_SPARSE_ARRAY_OF(BN_BLINDING);
+
 static int rsa_ossl_public_encrypt(int flen, const unsigned char *from,
     unsigned char *to, RSA *rsa, int padding);
 static int rsa_ossl_private_encrypt(int flen, const unsigned char *from,
@@ -36,7 +43,7 @@ static int rsa_ossl_finish(RSA *rsa);
 #ifdef S390X_MOD_EXP
 static int rsa_ossl_s390x_mod_exp(BIGNUM *r0, const BIGNUM *i, RSA *rsa,
     BN_CTX *ctx);
-static RSA_METHOD rsa_pkcs1_ossl_meth = {
+static const RSA_METHOD rsa_pkcs1_ossl_meth = {
     "OpenSSL PKCS#1 RSA",
     rsa_ossl_public_encrypt,
     rsa_ossl_public_decrypt, /* signature verification */
@@ -54,7 +61,7 @@ static RSA_METHOD rsa_pkcs1_ossl_meth = {
     NULL /* rsa_multi_prime_keygen */
 };
 #else
-static RSA_METHOD rsa_pkcs1_ossl_meth = {
+static const RSA_METHOD rsa_pkcs1_ossl_meth = {
     "OpenSSL PKCS#1 RSA",
     rsa_ossl_public_encrypt,
     rsa_ossl_public_decrypt, /* signature verification */
@@ -215,86 +222,96 @@ err:
     return r;
 }

-static BN_BLINDING *rsa_get_blinding(RSA *rsa, int *local, BN_CTX *ctx)
-{
-    BN_BLINDING *ret;
+#if defined(OPENSSL_SYS_TANDEM)
+static TSAN_QUALIFIER uint64_t tsan_thread_id = 1;
+#endif

-    if (!CRYPTO_THREAD_read_lock(rsa->lock))
-        return NULL;
+static uintptr_t get_unique_thread_id(void)
+{
+#if defined(OPENSSL_SYS_TANDEM)
+    uintptr_t thread_id = (uintptr_t)CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_TANDEM_ID_KEY,
+        NULL);

-    if (rsa->blinding == NULL) {
-        /*
-         * This dance with upgrading the lock from read to write will be
-         * slower in cases of a single use RSA object, but should be
-         * significantly better in multi-thread cases (e.g. servers). It's
-         * probably worth it.
-         */
-        CRYPTO_THREAD_unlock(rsa->lock);
-        if (!CRYPTO_THREAD_write_lock(rsa->lock))
-            return NULL;
-        if (rsa->blinding == NULL)
-            rsa->blinding = RSA_setup_blinding(rsa, ctx);
+    if (thread_id == 0) {
+        thread_id = tsan_counter(&tsan_thread_id);
+        CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_TANDEM_ID_KEY, NULL, (void *)thread_id);
     }
+    return thread_id;
+#else
+    return (uintptr_t)CRYPTO_THREAD_get_current_id();
+#endif
+}

-    ret = rsa->blinding;
-    if (ret == NULL)
-        goto err;
+static void free_bn_blinding(ossl_uintmax_t idx, BN_BLINDING *b, void *arg)
+{
+    BN_BLINDING_free(b);
+}

-    if (BN_BLINDING_is_current_thread(ret)) {
-        /* rsa->blinding is ours! */
+void ossl_rsa_free_blinding(RSA *rsa)
+{
+    SPARSE_ARRAY_OF(BN_BLINDING) *blindings = rsa->blindings_sa;

-        *local = 1;
-    } else {
-        /* resort to rsa->mt_blinding instead */
+    ossl_sa_BN_BLINDING_doall_arg(blindings, free_bn_blinding, NULL);
+    ossl_sa_BN_BLINDING_free(blindings);
+}

-        /*
-         * instructs rsa_blinding_convert(), rsa_blinding_invert() that the
-         * BN_BLINDING is shared, meaning that accesses require locks, and
-         * that the blinding factor must be stored outside the BN_BLINDING
-         */
-        *local = 0;
+void *ossl_rsa_alloc_blinding(void)
+{
+    return ossl_sa_BN_BLINDING_new();
+}

-        if (rsa->mt_blinding == NULL) {
-            CRYPTO_THREAD_unlock(rsa->lock);
-            if (!CRYPTO_THREAD_write_lock(rsa->lock))
-                return NULL;
-            if (rsa->mt_blinding == NULL)
-                rsa->mt_blinding = RSA_setup_blinding(rsa, ctx);
-        }
-        ret = rsa->mt_blinding;
-    }
+static BN_BLINDING *ossl_rsa_get_thread_bn_blinding(RSA *rsa)
+{
+    SPARSE_ARRAY_OF(BN_BLINDING) *blindings = rsa->blindings_sa;
+    uintptr_t tid = get_unique_thread_id();

-err:
-    CRYPTO_THREAD_unlock(rsa->lock);
-    return ret;
+    return ossl_sa_BN_BLINDING_get(blindings, tid);
 }

-static int rsa_blinding_convert(BN_BLINDING *b, BIGNUM *f, BIGNUM *unblind,
-    BN_CTX *ctx)
+static int ossl_rsa_set_thread_bn_blinding(RSA *rsa, BN_BLINDING *b)
 {
-    if (unblind == NULL) {
-        /*
-         * Local blinding: store the unblinding factor in BN_BLINDING.
-         */
-        return BN_BLINDING_convert_ex(f, NULL, b, ctx);
-    } else {
-        /*
-         * Shared blinding: store the unblinding factor outside BN_BLINDING.
-         */
-        int ret;
+    SPARSE_ARRAY_OF(BN_BLINDING) *blindings = rsa->blindings_sa;
+    uintptr_t tid = get_unique_thread_id();
+
+    return ossl_sa_BN_BLINDING_set(blindings, tid, b);
+}

-        if (!BN_BLINDING_lock(b))
-            return 0;
+static BN_BLINDING *rsa_get_blinding(RSA *rsa, BN_CTX *ctx)
+{
+    BN_BLINDING *ret;

-        ret = BN_BLINDING_convert_ex(f, unblind, b, ctx);
-        BN_BLINDING_unlock(b);
+    if (!CRYPTO_THREAD_read_lock(rsa->lock))
+        return NULL;
+
+    ret = ossl_rsa_get_thread_bn_blinding(rsa);
+    CRYPTO_THREAD_unlock(rsa->lock);

-        return ret;
+    if (ret == NULL) {
+        ret = RSA_setup_blinding(rsa, ctx);
+        if (!CRYPTO_THREAD_write_lock(rsa->lock)) {
+            BN_BLINDING_free(ret);
+            ret = NULL;
+        } else {
+            if (!ossl_rsa_set_thread_bn_blinding(rsa, ret)) {
+                BN_BLINDING_free(ret);
+                ret = NULL;
+            }
+            CRYPTO_THREAD_unlock(rsa->lock);
+        }
     }
+
+    return ret;
 }

-static int rsa_blinding_invert(BN_BLINDING *b, BIGNUM *f, BIGNUM *unblind,
-    BN_CTX *ctx)
+static int rsa_blinding_convert(BN_BLINDING *b, BIGNUM *f, BN_CTX *ctx)
+{
+    /*
+     * Local blinding: store the unblinding factor in BN_BLINDING.
+     */
+    return BN_BLINDING_convert_ex(f, NULL, b, ctx);
+}
+
+static int rsa_blinding_invert(BN_BLINDING *b, BIGNUM *f, BN_CTX *ctx)
 {
     /*
      * For local blinding, unblind is set to NULL, and BN_BLINDING_invert_ex
@@ -305,7 +322,7 @@ static int rsa_blinding_invert(BN_BLINDING *b, BIGNUM *f, BIGNUM *unblind,
      * to access the blinding without a lock.
      */
     BN_set_flags(f, BN_FLG_CONSTTIME);
-    return BN_BLINDING_invert_ex(f, unblind, b, ctx);
+    return BN_BLINDING_invert_ex(f, NULL, b, ctx);
 }

 /* signing */
@@ -316,13 +333,6 @@ static int rsa_ossl_private_encrypt(int flen, const unsigned char *from,
     int i, num = 0, r = -1;
     unsigned char *buf = NULL;
     BN_CTX *ctx = NULL;
-    int local_blinding = 0;
-    /*
-     * Used only if the blinding structure is shared. A non-NULL unblind
-     * instructs rsa_blinding_convert() and rsa_blinding_invert() to store
-     * the unblinding factor outside the blinding structure.
-     */
-    BIGNUM *unblind = NULL;
     BN_BLINDING *blinding = NULL;

     if ((ctx = BN_CTX_new_ex(rsa->libctx)) == NULL)
@@ -367,19 +377,13 @@ static int rsa_ossl_private_encrypt(int flen, const unsigned char *from,
             goto err;

     if (!(rsa->flags & RSA_FLAG_NO_BLINDING)) {
-        blinding = rsa_get_blinding(rsa, &local_blinding, ctx);
+        blinding = rsa_get_blinding(rsa, ctx);
         if (blinding == NULL) {
             ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
             goto err;
         }
-    }

-    if (blinding != NULL) {
-        if (!local_blinding && ((unblind = BN_CTX_get(ctx)) == NULL)) {
-            ERR_raise(ERR_LIB_RSA, ERR_R_BN_LIB);
-            goto err;
-        }
-        if (!rsa_blinding_convert(blinding, f, unblind, ctx))
+        if (!rsa_blinding_convert(blinding, f, ctx))
             goto err;
     }

@@ -409,7 +413,7 @@ static int rsa_ossl_private_encrypt(int flen, const unsigned char *from,
     }

     if (blinding)
-        if (!rsa_blinding_invert(blinding, ret, unblind, ctx))
+        if (!rsa_blinding_invert(blinding, ret, ctx))
             goto err;

     if (padding == RSA_X931_PADDING) {
@@ -528,13 +532,6 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
     unsigned char *buf = NULL;
     unsigned char kdk[SHA256_DIGEST_LENGTH] = { 0 };
     BN_CTX *ctx = NULL;
-    int local_blinding = 0;
-    /*
-     * Used only if the blinding structure is shared. A non-NULL unblind
-     * instructs rsa_blinding_convert() and rsa_blinding_invert() to store
-     * the unblinding factor outside the blinding structure.
-     */
-    BIGNUM *unblind = NULL;
     BN_BLINDING *blinding = NULL;

     /*
@@ -616,19 +613,13 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
             goto err;

     if (!(rsa->flags & RSA_FLAG_NO_BLINDING)) {
-        blinding = rsa_get_blinding(rsa, &local_blinding, ctx);
+        blinding = rsa_get_blinding(rsa, ctx);
         if (blinding == NULL) {
             ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
             goto err;
         }
-    }

-    if (blinding != NULL) {
-        if (!local_blinding && ((unblind = BN_CTX_get(ctx)) == NULL)) {
-            ERR_raise(ERR_LIB_RSA, ERR_R_BN_LIB);
-            goto err;
-        }
-        if (!rsa_blinding_convert(blinding, f, unblind, ctx))
+        if (!rsa_blinding_convert(blinding, f, ctx))
             goto err;
     }

@@ -658,7 +649,7 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
     }

     if (blinding)
-        if (!rsa_blinding_invert(blinding, ret, unblind, ctx))
+        if (!rsa_blinding_invert(blinding, ret, ctx))
             goto err;

     /*
@@ -1207,9 +1198,12 @@ static int rsa_ossl_finish(RSA *rsa)
 static int rsa_ossl_s390x_mod_exp(BIGNUM *r0, const BIGNUM *i, RSA *rsa,
     BN_CTX *ctx)
 {
+    int rc;
+
     if (rsa->version != RSA_ASN1_VERSION_MULTI) {
-        if (s390x_crt(r0, i, rsa->p, rsa->q, rsa->dmp1, rsa->dmq1, rsa->iqmp) == 1)
-            return 1;
+        rc = s390x_crt(r0, i, rsa->p, rsa->q, rsa->dmp1, rsa->dmq1, rsa->iqmp);
+        if (rc >= 0)
+            return rc;
     }
     return rsa_ossl_mod_exp(r0, i, rsa, ctx);
 }
diff --git a/deps/openssl/openssl/crypto/rsa/rsa_pmeth.c b/deps/openssl/openssl/crypto/rsa/rsa_pmeth.c
deleted file mode 100644
index 9e1cae485c2..00000000000
--- a/deps/openssl/openssl/crypto/rsa/rsa_pmeth.c
+++ /dev/null
@@ -1,935 +0,0 @@
-/*
- * Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * RSA low level APIs are deprecated for public use, but still ok for
- * internal use.
- */
-#include "internal/deprecated.h"
-
-#include "internal/constant_time.h"
-
-#include <stdio.h>
-#include "internal/cryptlib.h"
-#include <openssl/asn1t.h>
-#include <openssl/x509.h>
-#include <openssl/rsa.h>
-#include <openssl/bn.h>
-#include <openssl/evp.h>
-#include <openssl/x509v3.h>
-#include <openssl/cms.h>
-#include "crypto/evp.h"
-#include "crypto/rsa.h"
-#include "rsa_local.h"
-
-/* RSA pkey context structure */
-
-typedef struct {
-    /* Key gen parameters */
-    int nbits;
-    BIGNUM *pub_exp;
-    int primes;
-    /* Keygen callback info */
-    int gentmp[2];
-    /* RSA padding mode */
-    int pad_mode;
-    /* message digest */
-    const EVP_MD *md;
-    /* message digest for MGF1 */
-    const EVP_MD *mgf1md;
-    /* PSS salt length */
-    int saltlen;
-    /* Minimum salt length or -1 if no PSS parameter restriction */
-    int min_saltlen;
-    /* Temp buffer */
-    unsigned char *tbuf;
-    /* OAEP label */
-    unsigned char *oaep_label;
-    size_t oaep_labellen;
-    /* if to use implicit rejection in PKCS#1 v1.5 decryption */
-    int implicit_rejection;
-} RSA_PKEY_CTX;
-
-/* True if PSS parameters are restricted */
-#define rsa_pss_restricted(rctx) (rctx->min_saltlen != -1)
-
-static int pkey_rsa_init(EVP_PKEY_CTX *ctx)
-{
-    RSA_PKEY_CTX *rctx = OPENSSL_zalloc(sizeof(*rctx));
-
-    if (rctx == NULL)
-        return 0;
-    rctx->nbits = 2048;
-    rctx->primes = RSA_DEFAULT_PRIME_NUM;
-    if (pkey_ctx_is_pss(ctx))
-        rctx->pad_mode = RSA_PKCS1_PSS_PADDING;
-    else
-        rctx->pad_mode = RSA_PKCS1_PADDING;
-    /* Maximum for sign, auto for verify */
-    rctx->saltlen = RSA_PSS_SALTLEN_AUTO;
-    rctx->min_saltlen = -1;
-    rctx->implicit_rejection = 1;
-    ctx->data = rctx;
-    ctx->keygen_info = rctx->gentmp;
-    ctx->keygen_info_count = 2;
-
-    return 1;
-}
-
-static int pkey_rsa_copy(EVP_PKEY_CTX *dst, const EVP_PKEY_CTX *src)
-{
-    RSA_PKEY_CTX *dctx, *sctx;
-
-    if (!pkey_rsa_init(dst))
-        return 0;
-    sctx = src->data;
-    dctx = dst->data;
-    dctx->nbits = sctx->nbits;
-    if (sctx->pub_exp) {
-        dctx->pub_exp = BN_dup(sctx->pub_exp);
-        if (!dctx->pub_exp)
-            return 0;
-    }
-    dctx->pad_mode = sctx->pad_mode;
-    dctx->md = sctx->md;
-    dctx->mgf1md = sctx->mgf1md;
-    dctx->saltlen = sctx->saltlen;
-    dctx->implicit_rejection = sctx->implicit_rejection;
-    if (sctx->oaep_label) {
-        OPENSSL_free(dctx->oaep_label);
-        dctx->oaep_label = OPENSSL_memdup(sctx->oaep_label, sctx->oaep_labellen);
-        if (!dctx->oaep_label)
-            return 0;
-        dctx->oaep_labellen = sctx->oaep_labellen;
-    }
-    return 1;
-}
-
-static int setup_tbuf(RSA_PKEY_CTX *ctx, EVP_PKEY_CTX *pk)
-{
-    if (ctx->tbuf != NULL)
-        return 1;
-    if ((ctx->tbuf = OPENSSL_malloc(RSA_size(EVP_PKEY_get0_RSA(pk->pkey)))) == NULL)
-        return 0;
-    return 1;
-}
-
-static void pkey_rsa_cleanup(EVP_PKEY_CTX *ctx)
-{
-    RSA_PKEY_CTX *rctx = ctx->data;
-    if (rctx) {
-        BN_free(rctx->pub_exp);
-        OPENSSL_free(rctx->tbuf);
-        OPENSSL_free(rctx->oaep_label);
-        OPENSSL_free(rctx);
-    }
-}
-
-static int pkey_rsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig,
-    size_t *siglen, const unsigned char *tbs,
-    size_t tbslen)
-{
-    int ret;
-    RSA_PKEY_CTX *rctx = ctx->data;
-    /*
-     * Discard const. Its marked as const because this may be a cached copy of
-     * the "real" key. These calls don't make any modifications that need to
-     * be reflected back in the "original" key.
-     */
-    RSA *rsa = (RSA *)EVP_PKEY_get0_RSA(ctx->pkey);
-    int md_size;
-
-    if (rctx->md) {
-        md_size = EVP_MD_get_size(rctx->md);
-        if (md_size <= 0) {
-            ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH);
-            return -1;
-        }
-
-        if (tbslen != (size_t)md_size) {
-            ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH);
-            return -1;
-        }
-
-        if (EVP_MD_get_type(rctx->md) == NID_mdc2) {
-            unsigned int sltmp;
-            if (rctx->pad_mode != RSA_PKCS1_PADDING)
-                return -1;
-            ret = RSA_sign_ASN1_OCTET_STRING(0, tbs, tbslen, sig, &sltmp, rsa);
-
-            if (ret <= 0)
-                return ret;
-            ret = sltmp;
-        } else if (rctx->pad_mode == RSA_X931_PADDING) {
-            if ((size_t)RSA_size(rsa) < tbslen + 1) {
-                ERR_raise(ERR_LIB_RSA, RSA_R_KEY_SIZE_TOO_SMALL);
-                return -1;
-            }
-            if (!setup_tbuf(rctx, ctx)) {
-                ERR_raise(ERR_LIB_RSA, ERR_R_RSA_LIB);
-                return -1;
-            }
-            memcpy(rctx->tbuf, tbs, tbslen);
-            rctx->tbuf[tbslen] = RSA_X931_hash_id(EVP_MD_get_type(rctx->md));
-            ret = RSA_private_encrypt(tbslen + 1, rctx->tbuf,
-                sig, rsa, RSA_X931_PADDING);
-        } else if (rctx->pad_mode == RSA_PKCS1_PADDING) {
-            unsigned int sltmp;
-            ret = RSA_sign(EVP_MD_get_type(rctx->md),
-                tbs, tbslen, sig, &sltmp, rsa);
-            if (ret <= 0)
-                return ret;
-            ret = sltmp;
-        } else if (rctx->pad_mode == RSA_PKCS1_PSS_PADDING) {
-            if (!setup_tbuf(rctx, ctx))
-                return -1;
-            if (!RSA_padding_add_PKCS1_PSS_mgf1(rsa,
-                    rctx->tbuf, tbs,
-                    rctx->md, rctx->mgf1md,
-                    rctx->saltlen))
-                return -1;
-            ret = RSA_private_encrypt(RSA_size(rsa), rctx->tbuf,
-                sig, rsa, RSA_NO_PADDING);
-        } else {
-            return -1;
-        }
-    } else {
-        ret = RSA_private_encrypt(tbslen, tbs, sig, rsa, rctx->pad_mode);
-    }
-    if (ret < 0)
-        return ret;
-    *siglen = ret;
-    return 1;
-}
-
-static int pkey_rsa_verifyrecover(EVP_PKEY_CTX *ctx,
-    unsigned char *rout, size_t *routlen,
-    const unsigned char *sig, size_t siglen)
-{
-    int ret;
-    RSA_PKEY_CTX *rctx = ctx->data;
-    /*
-     * Discard const. Its marked as const because this may be a cached copy of
-     * the "real" key. These calls don't make any modifications that need to
-     * be reflected back in the "original" key.
-     */
-    RSA *rsa = (RSA *)EVP_PKEY_get0_RSA(ctx->pkey);
-
-    if (rctx->md) {
-        if (rctx->pad_mode == RSA_X931_PADDING) {
-            if (!setup_tbuf(rctx, ctx))
-                return -1;
-            ret = RSA_public_decrypt(siglen, sig, rctx->tbuf, rsa,
-                RSA_X931_PADDING);
-            if (ret <= 0)
-                return 0;
-            ret--;
-            if (rctx->tbuf[ret] != RSA_X931_hash_id(EVP_MD_get_type(rctx->md))) {
-                ERR_raise(ERR_LIB_RSA, RSA_R_ALGORITHM_MISMATCH);
-                return 0;
-            }
-            if (ret != EVP_MD_get_size(rctx->md)) {
-                ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH);
-                return 0;
-            }
-            if (rout)
-                memcpy(rout, rctx->tbuf, ret);
-        } else if (rctx->pad_mode == RSA_PKCS1_PADDING) {
-            size_t sltmp;
-            ret = ossl_rsa_verify(EVP_MD_get_type(rctx->md),
-                NULL, 0, rout, &sltmp,
-                sig, siglen, rsa);
-            if (ret <= 0)
-                return 0;
-            ret = sltmp;
-        } else {
-            return -1;
-        }
-    } else {
-        ret = RSA_public_decrypt(siglen, sig, rout, rsa, rctx->pad_mode);
-    }
-    if (ret <= 0)
-        return ret;
-    *routlen = ret;
-    return 1;
-}
-
-static int pkey_rsa_verify(EVP_PKEY_CTX *ctx,
-    const unsigned char *sig, size_t siglen,
-    const unsigned char *tbs, size_t tbslen)
-{
-    RSA_PKEY_CTX *rctx = ctx->data;
-    /*
-     * Discard const. Its marked as const because this may be a cached copy of
-     * the "real" key. These calls don't make any modifications that need to
-     * be reflected back in the "original" key.
-     */
-    RSA *rsa = (RSA *)EVP_PKEY_get0_RSA(ctx->pkey);
-    size_t rslen;
-    int md_size;
-
-    if (rctx->md) {
-        if (rctx->pad_mode == RSA_PKCS1_PADDING)
-            return RSA_verify(EVP_MD_get_type(rctx->md), tbs, tbslen,
-                sig, siglen, rsa);
-        md_size = EVP_MD_get_size(rctx->md);
-        if (md_size <= 0) {
-            ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH);
-            return -1;
-        }
-        if (tbslen != (size_t)md_size) {
-            ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH);
-            return -1;
-        }
-        if (rctx->pad_mode == RSA_X931_PADDING) {
-            if (pkey_rsa_verifyrecover(ctx, NULL, &rslen, sig, siglen) <= 0)
-                return 0;
-        } else if (rctx->pad_mode == RSA_PKCS1_PSS_PADDING) {
-            int ret;
-            if (!setup_tbuf(rctx, ctx))
-                return -1;
-            ret = RSA_public_decrypt(siglen, sig, rctx->tbuf,
-                rsa, RSA_NO_PADDING);
-            if (ret <= 0)
-                return 0;
-            ret = RSA_verify_PKCS1_PSS_mgf1(rsa, tbs,
-                rctx->md, rctx->mgf1md,
-                rctx->tbuf, rctx->saltlen);
-            if (ret <= 0)
-                return 0;
-            return 1;
-        } else {
-            return -1;
-        }
-    } else {
-        if (!setup_tbuf(rctx, ctx))
-            return -1;
-        rslen = RSA_public_decrypt(siglen, sig, rctx->tbuf,
-            rsa, rctx->pad_mode);
-        if (rslen <= 0)
-            return 0;
-    }
-
-    if ((rslen != tbslen) || memcmp(tbs, rctx->tbuf, rslen))
-        return 0;
-
-    return 1;
-}
-
-static int pkey_rsa_encrypt(EVP_PKEY_CTX *ctx,
-    unsigned char *out, size_t *outlen,
-    const unsigned char *in, size_t inlen)
-{
-    int ret;
-    RSA_PKEY_CTX *rctx = ctx->data;
-    /*
-     * Discard const. Its marked as const because this may be a cached copy of
-     * the "real" key. These calls don't make any modifications that need to
-     * be reflected back in the "original" key.
-     */
-    RSA *rsa = (RSA *)EVP_PKEY_get0_RSA(ctx->pkey);
-
-    if (rctx->pad_mode == RSA_PKCS1_OAEP_PADDING) {
-        int klen = RSA_size(rsa);
-        if (!setup_tbuf(rctx, ctx))
-            return -1;
-        if (!RSA_padding_add_PKCS1_OAEP_mgf1(rctx->tbuf, klen,
-                in, inlen,
-                rctx->oaep_label,
-                rctx->oaep_labellen,
-                rctx->md, rctx->mgf1md))
-            return -1;
-        ret = RSA_public_encrypt(klen, rctx->tbuf, out, rsa, RSA_NO_PADDING);
-    } else {
-        ret = RSA_public_encrypt(inlen, in, out, rsa, rctx->pad_mode);
-    }
-    if (ret < 0)
-        return ret;
-    *outlen = ret;
-    return 1;
-}
-
-static int pkey_rsa_decrypt(EVP_PKEY_CTX *ctx,
-    unsigned char *out, size_t *outlen,
-    const unsigned char *in, size_t inlen)
-{
-    int ret;
-    int pad_mode;
-    RSA_PKEY_CTX *rctx = ctx->data;
-    /*
-     * Discard const. Its marked as const because this may be a cached copy of
-     * the "real" key. These calls don't make any modifications that need to
-     * be reflected back in the "original" key.
-     */
-    RSA *rsa = (RSA *)EVP_PKEY_get0_RSA(ctx->pkey);
-
-    if (rctx->pad_mode == RSA_PKCS1_OAEP_PADDING) {
-        if (!setup_tbuf(rctx, ctx))
-            return -1;
-        ret = RSA_private_decrypt(inlen, in, rctx->tbuf, rsa, RSA_NO_PADDING);
-        if (ret <= 0)
-            return ret;
-        ret = RSA_padding_check_PKCS1_OAEP_mgf1(out, ret, rctx->tbuf,
-            ret, ret,
-            rctx->oaep_label,
-            rctx->oaep_labellen,
-            rctx->md, rctx->mgf1md);
-    } else {
-        if (rctx->pad_mode == RSA_PKCS1_PADDING && rctx->implicit_rejection == 0)
-            pad_mode = RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING;
-        else
-            pad_mode = rctx->pad_mode;
-        ret = RSA_private_decrypt(inlen, in, out, rsa, pad_mode);
-    }
-    *outlen = constant_time_select_s(constant_time_msb_s(ret), *outlen, ret);
-    ret = constant_time_select_int(constant_time_msb(ret), ret, 1);
-    return ret;
-}
-
-static int check_padding_md(const EVP_MD *md, int padding)
-{
-    int mdnid;
-
-    if (!md)
-        return 1;
-
-    mdnid = EVP_MD_get_type(md);
-
-    if (padding == RSA_NO_PADDING) {
-        ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE);
-        return 0;
-    }
-
-    if (padding == RSA_X931_PADDING) {
-        if (RSA_X931_hash_id(mdnid) == -1) {
-            ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_X931_DIGEST);
-            return 0;
-        }
-    } else {
-        switch (mdnid) {
-        /* List of all supported RSA digests */
-        case NID_sha1:
-        case NID_sha224:
-        case NID_sha256:
-        case NID_sha384:
-        case NID_sha512:
-        case NID_sha512_224:
-        case NID_sha512_256:
-        case NID_md5:
-        case NID_md5_sha1:
-        case NID_md2:
-        case NID_md4:
-        case NID_mdc2:
-        case NID_ripemd160:
-        case NID_sha3_224:
-        case NID_sha3_256:
-        case NID_sha3_384:
-        case NID_sha3_512:
-            return 1;
-
-        default:
-            ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_DIGEST);
-            return 0;
-        }
-    }
-
-    return 1;
-}
-
-static int pkey_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
-{
-    RSA_PKEY_CTX *rctx = ctx->data;
-    int md_size;
-
-    switch (type) {
-    case EVP_PKEY_CTRL_RSA_PADDING:
-        if ((p1 >= RSA_PKCS1_PADDING) && (p1 <= RSA_PKCS1_PSS_PADDING)) {
-            if (!check_padding_md(rctx->md, p1))
-                return 0;
-            if (p1 == RSA_PKCS1_PSS_PADDING) {
-                if (!(ctx->operation & (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY)))
-                    goto bad_pad;
-                if (!rctx->md)
-                    rctx->md = EVP_sha1();
-            } else if (pkey_ctx_is_pss(ctx)) {
-                goto bad_pad;
-            }
-            if (p1 == RSA_PKCS1_OAEP_PADDING) {
-                if (!(ctx->operation & EVP_PKEY_OP_TYPE_CRYPT))
-                    goto bad_pad;
-                if (!rctx->md)
-                    rctx->md = EVP_sha1();
-            }
-            rctx->pad_mode = p1;
-            return 1;
-        }
-    bad_pad:
-        ERR_raise(ERR_LIB_RSA, RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE);
-        return -2;
-
-    case EVP_PKEY_CTRL_GET_RSA_PADDING:
-        *(int *)p2 = rctx->pad_mode;
-        return 1;
-
-    case EVP_PKEY_CTRL_RSA_PSS_SALTLEN:
-    case EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN:
-        if (rctx->pad_mode != RSA_PKCS1_PSS_PADDING) {
-            ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PSS_SALTLEN);
-            return -2;
-        }
-        if (type == EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN) {
-            *(int *)p2 = rctx->saltlen;
-        } else {
-            if (p1 < RSA_PSS_SALTLEN_MAX)
-                return -2;
-            if (rsa_pss_restricted(rctx)) {
-                if (p1 == RSA_PSS_SALTLEN_AUTO
-                    && ctx->operation == EVP_PKEY_OP_VERIFY) {
-                    ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PSS_SALTLEN);
-                    return -2;
-                }
-                md_size = EVP_MD_get_size(rctx->md);
-                if (md_size <= 0) {
-                    ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH);
-                    return -2;
-                }
-                if ((p1 == RSA_PSS_SALTLEN_DIGEST
-                        && rctx->min_saltlen > md_size)
-                    || (p1 >= 0 && p1 < rctx->min_saltlen)) {
-                    ERR_raise(ERR_LIB_RSA, RSA_R_PSS_SALTLEN_TOO_SMALL);
-                    return 0;
-                }
-            }
-            rctx->saltlen = p1;
-        }
-        return 1;
-
-    case EVP_PKEY_CTRL_RSA_KEYGEN_BITS:
-        if (p1 < RSA_MIN_MODULUS_BITS) {
-            ERR_raise(ERR_LIB_RSA, RSA_R_KEY_SIZE_TOO_SMALL);
-            return -2;
-        }
-        rctx->nbits = p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP:
-        if (p2 == NULL || !BN_is_odd((BIGNUM *)p2) || BN_is_one((BIGNUM *)p2)) {
-            ERR_raise(ERR_LIB_RSA, RSA_R_BAD_E_VALUE);
-            return -2;
-        }
-        BN_free(rctx->pub_exp);
-        rctx->pub_exp = p2;
-        return 1;
-
-    case EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES:
-        if (p1 < RSA_DEFAULT_PRIME_NUM || p1 > RSA_MAX_PRIME_NUM) {
-            ERR_raise(ERR_LIB_RSA, RSA_R_KEY_PRIME_NUM_INVALID);
-            return -2;
-        }
-        rctx->primes = p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_RSA_OAEP_MD:
-    case EVP_PKEY_CTRL_GET_RSA_OAEP_MD:
-        if (rctx->pad_mode != RSA_PKCS1_OAEP_PADDING) {
-            ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE);
-            return -2;
-        }
-        if (type == EVP_PKEY_CTRL_GET_RSA_OAEP_MD)
-            *(const EVP_MD **)p2 = rctx->md;
-        else
-            rctx->md = p2;
-        return 1;
-
-    case EVP_PKEY_CTRL_MD:
-        if (!check_padding_md(p2, rctx->pad_mode))
-            return 0;
-        if (rsa_pss_restricted(rctx)) {
-            if (EVP_MD_get_type(rctx->md) == EVP_MD_get_type(p2))
-                return 1;
-            ERR_raise(ERR_LIB_RSA, RSA_R_DIGEST_NOT_ALLOWED);
-            return 0;
-        }
-        rctx->md = p2;
-        return 1;
-
-    case EVP_PKEY_CTRL_GET_MD:
-        *(const EVP_MD **)p2 = rctx->md;
-        return 1;
-
-    case EVP_PKEY_CTRL_RSA_MGF1_MD:
-    case EVP_PKEY_CTRL_GET_RSA_MGF1_MD:
-        if (rctx->pad_mode != RSA_PKCS1_PSS_PADDING
-            && rctx->pad_mode != RSA_PKCS1_OAEP_PADDING) {
-            ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_MGF1_MD);
-            return -2;
-        }
-        if (type == EVP_PKEY_CTRL_GET_RSA_MGF1_MD) {
-            if (rctx->mgf1md)
-                *(const EVP_MD **)p2 = rctx->mgf1md;
-            else
-                *(const EVP_MD **)p2 = rctx->md;
-        } else {
-            if (rsa_pss_restricted(rctx)) {
-                if (EVP_MD_get_type(rctx->mgf1md) == EVP_MD_get_type(p2))
-                    return 1;
-                ERR_raise(ERR_LIB_RSA, RSA_R_MGF1_DIGEST_NOT_ALLOWED);
-                return 0;
-            }
-            rctx->mgf1md = p2;
-        }
-        return 1;
-
-    case EVP_PKEY_CTRL_RSA_OAEP_LABEL:
-        if (rctx->pad_mode != RSA_PKCS1_OAEP_PADDING) {
-            ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE);
-            return -2;
-        }
-        OPENSSL_free(rctx->oaep_label);
-        if (p2 && p1 > 0) {
-            rctx->oaep_label = p2;
-            rctx->oaep_labellen = p1;
-        } else {
-            rctx->oaep_label = NULL;
-            rctx->oaep_labellen = 0;
-        }
-        return 1;
-
-    case EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL:
-        if (rctx->pad_mode != RSA_PKCS1_OAEP_PADDING) {
-            ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE);
-            return -2;
-        }
-        if (p2 == NULL) {
-            ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_NULL_PARAMETER);
-            return 0;
-        }
-        *(unsigned char **)p2 = rctx->oaep_label;
-        return rctx->oaep_labellen;
-
-    case EVP_PKEY_CTRL_RSA_IMPLICIT_REJECTION:
-        if (rctx->pad_mode != RSA_PKCS1_PADDING) {
-            ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE);
-            return -2;
-        }
-        rctx->implicit_rejection = p1;
-        return 1;
-
-    case EVP_PKEY_CTRL_DIGESTINIT:
-    case EVP_PKEY_CTRL_PKCS7_SIGN:
-#ifndef OPENSSL_NO_CMS
-    case EVP_PKEY_CTRL_CMS_SIGN:
-#endif
-        return 1;
-
-    case EVP_PKEY_CTRL_PKCS7_ENCRYPT:
-    case EVP_PKEY_CTRL_PKCS7_DECRYPT:
-#ifndef OPENSSL_NO_CMS
-    case EVP_PKEY_CTRL_CMS_DECRYPT:
-    case EVP_PKEY_CTRL_CMS_ENCRYPT:
-#endif
-        if (!pkey_ctx_is_pss(ctx))
-            return 1;
-    /* fall through */
-    case EVP_PKEY_CTRL_PEER_KEY:
-        ERR_raise(ERR_LIB_RSA, RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
-        return -2;
-
-    default:
-        return -2;
-    }
-}
-
-static int pkey_rsa_ctrl_str(EVP_PKEY_CTX *ctx,
-    const char *type, const char *value)
-{
-    if (value == NULL) {
-        ERR_raise(ERR_LIB_RSA, RSA_R_VALUE_MISSING);
-        return 0;
-    }
-    if (strcmp(type, "rsa_padding_mode") == 0) {
-        int pm;
-
-        if (strcmp(value, "pkcs1") == 0) {
-            pm = RSA_PKCS1_PADDING;
-        } else if (strcmp(value, "none") == 0) {
-            pm = RSA_NO_PADDING;
-        } else if (strcmp(value, "oeap") == 0) {
-            pm = RSA_PKCS1_OAEP_PADDING;
-        } else if (strcmp(value, "oaep") == 0) {
-            pm = RSA_PKCS1_OAEP_PADDING;
-        } else if (strcmp(value, "x931") == 0) {
-            pm = RSA_X931_PADDING;
-        } else if (strcmp(value, "pss") == 0) {
-            pm = RSA_PKCS1_PSS_PADDING;
-        } else {
-            ERR_raise(ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE);
-            return -2;
-        }
-        return EVP_PKEY_CTX_set_rsa_padding(ctx, pm);
-    }
-
-    if (strcmp(type, "rsa_pss_saltlen") == 0) {
-        int saltlen;
-
-        if (!strcmp(value, "digest"))
-            saltlen = RSA_PSS_SALTLEN_DIGEST;
-        else if (!strcmp(value, "max"))
-            saltlen = RSA_PSS_SALTLEN_MAX;
-        else if (!strcmp(value, "auto"))
-            saltlen = RSA_PSS_SALTLEN_AUTO;
-        else
-            saltlen = atoi(value);
-        return EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, saltlen);
-    }
-
-    if (strcmp(type, "rsa_keygen_bits") == 0) {
-        int nbits = atoi(value);
-
-        return EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, nbits);
-    }
-
-    if (strcmp(type, "rsa_keygen_pubexp") == 0) {
-        int ret;
-
-        BIGNUM *pubexp = NULL;
-        if (!BN_asc2bn(&pubexp, value))
-            return 0;
-        ret = EVP_PKEY_CTX_set1_rsa_keygen_pubexp(ctx, pubexp);
-        BN_free(pubexp);
-        return ret;
-    }
-
-    if (strcmp(type, "rsa_keygen_primes") == 0) {
-        int nprimes = atoi(value);
-
-        return EVP_PKEY_CTX_set_rsa_keygen_primes(ctx, nprimes);
-    }
-
-    if (strcmp(type, "rsa_mgf1_md") == 0)
-        return EVP_PKEY_CTX_md(ctx,
-            EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT,
-            EVP_PKEY_CTRL_RSA_MGF1_MD, value);
-
-    if (pkey_ctx_is_pss(ctx)) {
-
-        if (strcmp(type, "rsa_pss_keygen_mgf1_md") == 0)
-            return EVP_PKEY_CTX_md(ctx, EVP_PKEY_OP_KEYGEN,
-                EVP_PKEY_CTRL_RSA_MGF1_MD, value);
-
-        if (strcmp(type, "rsa_pss_keygen_md") == 0)
-            return EVP_PKEY_CTX_md(ctx, EVP_PKEY_OP_KEYGEN,
-                EVP_PKEY_CTRL_MD, value);
-
-        if (strcmp(type, "rsa_pss_keygen_saltlen") == 0) {
-            int saltlen = atoi(value);
-
-            return EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(ctx, saltlen);
-        }
-    }
-
-    if (strcmp(type, "rsa_oaep_md") == 0)
-        return EVP_PKEY_CTX_md(ctx, EVP_PKEY_OP_TYPE_CRYPT,
-            EVP_PKEY_CTRL_RSA_OAEP_MD, value);
-
-    if (strcmp(type, "rsa_oaep_label") == 0) {
-        unsigned char *lab;
-        long lablen;
-        int ret;
-
-        lab = OPENSSL_hexstr2buf(value, &lablen);
-        if (!lab)
-            return 0;
-        ret = EVP_PKEY_CTX_set0_rsa_oaep_label(ctx, lab, lablen);
-        if (ret <= 0)
-            OPENSSL_free(lab);
-        return ret;
-    }
-
-    return -2;
-}
-
-/* Set PSS parameters when generating a key, if necessary */
-static int rsa_set_pss_param(RSA *rsa, EVP_PKEY_CTX *ctx)
-{
-    RSA_PKEY_CTX *rctx = ctx->data;
-
-    if (!pkey_ctx_is_pss(ctx))
-        return 1;
-    /* If all parameters are default values don't set pss */
-    if (rctx->md == NULL && rctx->mgf1md == NULL && rctx->saltlen == -2)
-        return 1;
-    rsa->pss = ossl_rsa_pss_params_create(rctx->md, rctx->mgf1md,
-        rctx->saltlen == -2
-            ? 0
-            : rctx->saltlen);
-    if (rsa->pss == NULL)
-        return 0;
-    return 1;
-}
-
-static int pkey_rsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
-{
-    RSA *rsa = NULL;
-    RSA_PKEY_CTX *rctx = ctx->data;
-    BN_GENCB *pcb;
-    int ret;
-
-    if (rctx->pub_exp == NULL) {
-        rctx->pub_exp = BN_new();
-        if (rctx->pub_exp == NULL || !BN_set_word(rctx->pub_exp, RSA_F4))
-            return 0;
-    }
-    rsa = RSA_new();
-    if (rsa == NULL)
-        return 0;
-    if (ctx->pkey_gencb) {
-        pcb = BN_GENCB_new();
-        if (pcb == NULL) {
-            RSA_free(rsa);
-            return 0;
-        }
-        evp_pkey_set_cb_translate(pcb, ctx);
-    } else {
-        pcb = NULL;
-    }
-    ret = RSA_generate_multi_prime_key(rsa, rctx->nbits, rctx->primes,
-        rctx->pub_exp, pcb);
-    BN_GENCB_free(pcb);
-    if (ret > 0 && !rsa_set_pss_param(rsa, ctx)) {
-        RSA_free(rsa);
-        return 0;
-    }
-    if (ret > 0)
-        EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, rsa);
-    else
-        RSA_free(rsa);
-    return ret;
-}
-
-static const EVP_PKEY_METHOD rsa_pkey_meth = {
-    EVP_PKEY_RSA,
-    EVP_PKEY_FLAG_AUTOARGLEN,
-    pkey_rsa_init,
-    pkey_rsa_copy,
-    pkey_rsa_cleanup,
-
-    0, 0,
-
-    0,
-    pkey_rsa_keygen,
-
-    0,
-    pkey_rsa_sign,
-
-    0,
-    pkey_rsa_verify,
-
-    0,
-    pkey_rsa_verifyrecover,
-
-    0, 0, 0, 0,
-
-    0,
-    pkey_rsa_encrypt,
-
-    0,
-    pkey_rsa_decrypt,
-
-    0, 0,
-
-    pkey_rsa_ctrl,
-    pkey_rsa_ctrl_str
-};
-
-const EVP_PKEY_METHOD *ossl_rsa_pkey_method(void)
-{
-    return &rsa_pkey_meth;
-}
-
-/*
- * Called for PSS sign or verify initialisation: checks PSS parameter
- * sanity and sets any restrictions on key usage.
- */
-
-static int pkey_pss_init(EVP_PKEY_CTX *ctx)
-{
-    const RSA *rsa;
-    RSA_PKEY_CTX *rctx = ctx->data;
-    const EVP_MD *md;
-    const EVP_MD *mgf1md;
-    int min_saltlen, max_saltlen, md_size;
-
-    /* Should never happen */
-    if (!pkey_ctx_is_pss(ctx))
-        return 0;
-    rsa = EVP_PKEY_get0_RSA(ctx->pkey);
-    /* If no restrictions just return */
-    if (rsa->pss == NULL)
-        return 1;
-    /* Get and check parameters */
-    if (!ossl_rsa_pss_get_param(rsa->pss, &md, &mgf1md, &min_saltlen))
-        return 0;
-
-    /* See if minimum salt length exceeds maximum possible */
-    md_size = EVP_MD_get_size(md);
-    if (md_size <= 0) {
-        ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH);
-        return 0;
-    }
-    max_saltlen = RSA_size(rsa) - md_size;
-    if ((RSA_bits(rsa) & 0x7) == 1)
-        max_saltlen--;
-    if (min_saltlen > max_saltlen) {
-        ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_SALT_LENGTH);
-        return 0;
-    }
-
-    rctx->min_saltlen = min_saltlen;
-
-    /*
-     * Set PSS restrictions as defaults: we can then block any attempt to
-     * use invalid values in pkey_rsa_ctrl
-     */
-
-    rctx->md = md;
-    rctx->mgf1md = mgf1md;
-    rctx->saltlen = min_saltlen;
-
-    return 1;
-}
-
-static const EVP_PKEY_METHOD rsa_pss_pkey_meth = {
-    EVP_PKEY_RSA_PSS,
-    EVP_PKEY_FLAG_AUTOARGLEN,
-    pkey_rsa_init,
-    pkey_rsa_copy,
-    pkey_rsa_cleanup,
-
-    0, 0,
-
-    0,
-    pkey_rsa_keygen,
-
-    pkey_pss_init,
-    pkey_rsa_sign,
-
-    pkey_pss_init,
-    pkey_rsa_verify,
-
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
-    pkey_rsa_ctrl,
-    pkey_rsa_ctrl_str
-};
-
-const EVP_PKEY_METHOD *ossl_rsa_pss_pkey_method(void)
-{
-    return &rsa_pss_pkey_meth;
-}
diff --git a/deps/openssl/openssl/crypto/rsa/rsa_saos.c b/deps/openssl/openssl/crypto/rsa/rsa_saos.c
index afcc4c9a4d8..28844843f3f 100644
--- a/deps/openssl/openssl/crypto/rsa/rsa_saos.c
+++ b/deps/openssl/openssl/crypto/rsa/rsa_saos.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,6 +19,7 @@
 #include <openssl/rsa.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
+#include <crypto/asn1.h>

 int RSA_sign_ASN1_OCTET_STRING(int type,
     const unsigned char *m, unsigned int m_len,
diff --git a/deps/openssl/openssl/crypto/rsa/rsa_sign.c b/deps/openssl/openssl/crypto/rsa/rsa_sign.c
index 41a659cde61..7b6b2ffedb4 100644
--- a/deps/openssl/openssl/crypto/rsa/rsa_sign.c
+++ b/deps/openssl/openssl/crypto/rsa/rsa_sign.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/crypto/rsa/rsa_sp800_56b_check.c b/deps/openssl/openssl/crypto/rsa/rsa_sp800_56b_check.c
index 60339889339..bdaf20530ac 100644
--- a/deps/openssl/openssl/crypto/rsa/rsa_sp800_56b_check.c
+++ b/deps/openssl/openssl/crypto/rsa/rsa_sp800_56b_check.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2018-2019, Oracle and/or its affiliates.  All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -104,7 +104,7 @@ int ossl_rsa_check_prime_factor_range(const BIGNUM *p, int nbits, BN_CTX *ctx)
         goto err;

     /* set low = (√2)(2^(nbits/2 - 1) */
-    if (!BN_copy(low, &ossl_bn_inv_sqrt_2))
+    if (BN_copy(low, &ossl_bn_inv_sqrt_2) == NULL)
         goto err;

     if (shift >= 0) {
diff --git a/deps/openssl/openssl/crypto/rsa/rsa_sp800_56b_gen.c b/deps/openssl/openssl/crypto/rsa/rsa_sp800_56b_gen.c
index ec80136e2e3..2a525ddaae5 100644
--- a/deps/openssl/openssl/crypto/rsa/rsa_sp800_56b_gen.c
+++ b/deps/openssl/openssl/crypto/rsa/rsa_sp800_56b_gen.c
@@ -17,11 +17,11 @@
 #include "crypto/security_bits.h"
 #include "rsa_local.h"

-#define RSA_FIPS1864_MIN_KEYGEN_KEYSIZE 2048
-#define RSA_FIPS1864_MIN_KEYGEN_STRENGTH 112
+#define RSA_FIPS186_5_MIN_KEYGEN_KEYSIZE 2048
+#define RSA_FIPS186_5_MIN_KEYGEN_STRENGTH 112

 /*
- * Generate probable primes 'p' & 'q'. See FIPS 186-4 Section B.3.6
+ * Generate probable primes 'p' & 'q'. See FIPS 186-5 Section A.1.6
  * "Generation of Probable Primes with Conditions Based on Auxiliary Probable
  * Primes".
  *
@@ -46,15 +46,22 @@
  *     e The public exponent.
  *     ctx A BN_CTX object.
  *     cb An optional BIGNUM callback.
+ *     a An optional number with a value of 0, 1, 3, 5 or 7 that may be used
+ *       to add the requirement p is congruent to a mod 8. The value is ignored
+ *       if it is zero.
+ *     b An optional number with a value of 0, 1, 3, 5 or 7 that may be used
+ *       to add the requirement q is congruent to b mod 8. The value is ignored
+ *       if it is zero.
+ *
  * Returns: 1 if successful, or  0 otherwise.
  * Notes:
  *     p1, p2, q1, q2 are returned if they are not NULL.
  *     Xp, Xp1, Xp2, Xq, Xq1, Xq2 are optionally passed in.
  *     (Required for CAVS testing).
  */
-int ossl_rsa_fips186_4_gen_prob_primes(RSA *rsa, RSA_ACVP_TEST *test,
+int ossl_rsa_fips186_5_gen_prob_primes(RSA *rsa, RSA_ACVP_TEST *test,
     int nbits, const BIGNUM *e, BN_CTX *ctx,
-    BN_GENCB *cb)
+    BN_GENCB *cb, uint32_t a, uint32_t b)
 {
     int ret = 0, ok;
     /* Temp allocated BIGNUMS */
@@ -81,21 +88,24 @@ int ossl_rsa_fips186_4_gen_prob_primes(RSA *rsa, RSA_ACVP_TEST *test,
     }
 #endif

-    /* (Step 1) Check key length
+    /*
+     * (Step 1) Check key length
      * NOTE: SP800-131A Rev1 Disallows key lengths of < 2048 bits for RSA
      * Signature Generation and Key Agree/Transport.
      */
-    if (nbits < RSA_FIPS1864_MIN_KEYGEN_KEYSIZE) {
+    if (nbits < RSA_FIPS186_5_MIN_KEYGEN_KEYSIZE) {
         ERR_raise(ERR_LIB_RSA, RSA_R_KEY_SIZE_TOO_SMALL);
         return 0;
     }

+    /* (Step 2) Check exponent */
     if (!ossl_rsa_check_public_exponent(e)) {
         ERR_raise(ERR_LIB_RSA, RSA_R_PUB_EXPONENT_OUT_OF_RANGE);
         return 0;
     }

-    /* (Step 3) Determine strength and check rand generator strength is ok -
+    /*
+     * (Step 3) Determine strength and check rand generator strength is ok -
      * this step is redundant because the generator always returns a higher
      * strength than is required.
      */
@@ -119,13 +129,13 @@ int ossl_rsa_fips186_4_gen_prob_primes(RSA *rsa, RSA_ACVP_TEST *test,
     BN_set_flags(rsa->q, BN_FLG_CONSTTIME);

     /* (Step 4) Generate p, Xp */
-    if (!ossl_bn_rsa_fips186_4_gen_prob_primes(rsa->p, Xpo, p1, p2, Xp, Xp1, Xp2,
-            nbits, e, ctx, cb))
+    if (!ossl_bn_rsa_fips186_5_gen_prob_primes(rsa->p, Xpo, p1, p2, Xp, Xp1, Xp2,
+            nbits, e, ctx, cb, a))
         goto err;
     for (;;) {
         /* (Step 5) Generate q, Xq*/
-        if (!ossl_bn_rsa_fips186_4_gen_prob_primes(rsa->q, Xqo, q1, q2, Xq, Xq1,
-                Xq2, nbits, e, ctx, cb))
+        if (!ossl_bn_rsa_fips186_5_gen_prob_primes(rsa->q, Xqo, q1, q2, Xq, Xq1,
+                Xq2, nbits, e, ctx, cb, b))
             goto err;

         /* (Step 6) |Xp - Xq| > 2^(nbitlen/2 - 100) */
@@ -146,7 +156,7 @@ int ossl_rsa_fips186_4_gen_prob_primes(RSA *rsa, RSA_ACVP_TEST *test,
     rsa->dirty_cnt++;
     ret = 1;
 err:
-    /* Zeroize any internally generated values that are not returned */
+    /* (Step 7) Zeroize any internally generated values that are not returned */
     BN_clear(Xpo);
     BN_clear(Xqo);
     BN_clear(tmp);
@@ -176,7 +186,7 @@ int ossl_rsa_sp800_56b_validate_strength(int nbits, int strength)
     int s = (int)ossl_ifc_ffc_compute_security_bits(nbits);

 #ifdef FIPS_MODULE
-    if (s < RSA_FIPS1864_MIN_KEYGEN_STRENGTH) {
+    if (s < RSA_FIPS186_5_MIN_KEYGEN_STRENGTH) {
         ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_MODULUS);
         return 0;
     }
@@ -351,7 +361,7 @@ err:
  *    6.3.1.1 rsakpg1 - basic
  *    6.3.1.3 rsakpg1 - crt
  *
- * See also FIPS 186-4 Section B.3.6
+ * See also FIPS 186-5 Section A.1.6
  * "Generation of Probable Primes with Conditions Based on Auxiliary
  * Probable Primes."
  *
@@ -360,10 +370,16 @@ err:
  *     nbits The intended key size in bits.
  *     efixed The public exponent. If NULL a default of 65537 is used.
  *     cb An optional BIGNUM callback.
+ *     a An optional number with a value of 0, 1, 3, 5 or 7 that may be used
+ *       to add the requirement p is congruent to a mod 8. The value is ignored
+ *       if it is zero.
+ *     b An optional number with a value of 0, 1, 3, 5 or 7 that may be used
+ *       to add the requirement q is congruent to b mod 8. The value is ignored
+ *       if it is zero.
  * Returns: 1 if successfully generated otherwise it returns 0.
  */
 int ossl_rsa_sp800_56b_generate_key(RSA *rsa, int nbits, const BIGNUM *efixed,
-    BN_GENCB *cb)
+    BN_GENCB *cb, uint32_t a, uint32_t b)
 {
     int ret = 0;
     int ok;
@@ -400,7 +416,7 @@ int ossl_rsa_sp800_56b_generate_key(RSA *rsa, int nbits, const BIGNUM *efixed,

     for (;;) {
         /* (Step 2) Generate prime factors */
-        if (!ossl_rsa_fips186_4_gen_prob_primes(rsa, info, nbits, e, ctx, cb))
+        if (!ossl_rsa_fips186_5_gen_prob_primes(rsa, info, nbits, e, ctx, cb, a, b))
             goto err;

         /* p>q check and skipping in case of acvp test */
diff --git a/deps/openssl/openssl/crypto/s390xcap.c b/deps/openssl/openssl/crypto/s390xcap.c
index 9498f6c734c..54db50c39b2 100644
--- a/deps/openssl/openssl/crypto/s390xcap.c
+++ b/deps/openssl/openssl/crypto/s390xcap.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2010-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,7 +14,7 @@
 #include <signal.h>
 #include "internal/cryptlib.h"
 #include "crypto/ctype.h"
-#include "s390x_arch.h"
+#include "arch/s390x_arch.h"

 #if defined(OPENSSL_SYS_LINUX) && !defined(FIPS_MODULE)
 #include <sys/types.h>
@@ -221,7 +221,6 @@ void OPENSSL_cpuid_setup(void)
         OPENSSL_s390xcex = -1;
     } else {
         OPENSSL_s390xcex = open("/dev/z90crypt", O_RDWR | O_CLOEXEC);
-        OPENSSL_atexit(OPENSSL_s390x_cleanup);
     }
     OPENSSL_s390xcex_nodev = 0;
 #endif
@@ -229,6 +228,7 @@ void OPENSSL_cpuid_setup(void)

 static int parse_env(struct OPENSSL_s390xcap_st *cap, int *cex)
 {
+    /* clang-format off */
     /*-
      * CPU model data
      * (only the STFLE- and QUERY-bits relevant to libcrypto are set)
@@ -239,19 +239,19 @@ static int parse_env(struct OPENSSL_s390xcap_st *cap, int *cex)
      * Facility detection would fail on real hw (no STFLE).
      */
     static const struct OPENSSL_s390xcap_st z900 = {
-        /*.stfle  = */ { 0ULL, 0ULL, 0ULL, 0ULL },
-        /*.kimd   = */ { 0ULL, 0ULL },
-        /*.klmd   = */ { 0ULL, 0ULL },
-        /*.km     = */ { 0ULL, 0ULL },
-        /*.kmc    = */ { 0ULL, 0ULL },
-        /*.kmac   = */ { 0ULL, 0ULL },
-        /*.kmctr  = */ { 0ULL, 0ULL },
-        /*.kmo    = */ { 0ULL, 0ULL },
-        /*.kmf    = */ { 0ULL, 0ULL },
-        /*.prno   = */ { 0ULL, 0ULL },
-        /*.kma    = */ { 0ULL, 0ULL },
-        /*.pcc    = */ { 0ULL, 0ULL },
-        /*.kdsa   = */ { 0ULL, 0ULL },
+        .stfle  = { 0ULL, 0ULL, 0ULL, 0ULL },
+        .kimd   = { 0ULL, 0ULL },
+        .klmd   = { 0ULL, 0ULL },
+        .km     = { 0ULL, 0ULL },
+        .kmc    = { 0ULL, 0ULL },
+        .kmac   = { 0ULL, 0ULL },
+        .kmctr  = { 0ULL, 0ULL },
+        .kmo    = { 0ULL, 0ULL },
+        .kmf    = { 0ULL, 0ULL },
+        .prno   = { 0ULL, 0ULL },
+        .kma    = { 0ULL, 0ULL },
+        .pcc    = { 0ULL, 0ULL },
+        .kdsa   = { 0ULL, 0ULL },
     };

     /*-
@@ -259,20 +259,27 @@ static int parse_env(struct OPENSSL_s390xcap_st *cap, int *cex)
      * Implements MSA. Facility detection would fail on real hw (no STFLE).
      */
     static const struct OPENSSL_s390xcap_st z990 = {
-        /*.stfle  = */ { S390X_CAPBIT(S390X_MSA),
-            0ULL, 0ULL, 0ULL },
-        /*.kimd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1), 0ULL },
-        /*.klmd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1), 0ULL },
-        /*.km     = */ { S390X_CAPBIT(S390X_QUERY), 0ULL },
-        /*.kmc    = */ { S390X_CAPBIT(S390X_QUERY), 0ULL },
-        /*.kmac   = */ { S390X_CAPBIT(S390X_QUERY), 0ULL },
-        /*.kmctr  = */ { 0ULL, 0ULL },
-        /*.kmo    = */ { 0ULL, 0ULL },
-        /*.kmf    = */ { 0ULL, 0ULL },
-        /*.prno   = */ { 0ULL, 0ULL },
-        /*.kma    = */ { 0ULL, 0ULL },
-        /*.pcc    = */ { 0ULL, 0ULL },
-        /*.kdsa   = */ { 0ULL, 0ULL },
+        .stfle  = { S390X_CAPBIT(S390X_MSA),
+                    0ULL, 0ULL, 0ULL },
+        .kimd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1),
+                    0ULL },
+        .klmd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1),
+                    0ULL },
+        .km     = { S390X_CAPBIT(S390X_QUERY),
+                    0ULL },
+        .kmc    = { S390X_CAPBIT(S390X_QUERY),
+                    0ULL },
+        .kmac   = { S390X_CAPBIT(S390X_QUERY),
+                    0ULL },
+        .kmctr  = { 0ULL, 0ULL },
+        .kmo    = { 0ULL, 0ULL },
+        .kmf    = { 0ULL, 0ULL },
+        .prno   = { 0ULL, 0ULL },
+        .kma    = { 0ULL, 0ULL },
+        .pcc    = { 0ULL, 0ULL },
+        .kdsa   = { 0ULL, 0ULL },
     };

     /*-
@@ -280,21 +287,32 @@ static int parse_env(struct OPENSSL_s390xcap_st *cap, int *cex)
      * Implements MSA and MSA1.
      */
     static const struct OPENSSL_s390xcap_st z9 = {
-        /*.stfle  = */ { S390X_CAPBIT(S390X_MSA)
-                | S390X_CAPBIT(S390X_STCKF),
-            0ULL, 0ULL, 0ULL },
-        /*.kimd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1) | S390X_CAPBIT(S390X_SHA_256), 0ULL },
-        /*.klmd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1) | S390X_CAPBIT(S390X_SHA_256), 0ULL },
-        /*.km     = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128), 0ULL },
-        /*.kmc    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128), 0ULL },
-        /*.kmac   = */ { S390X_CAPBIT(S390X_QUERY), 0ULL },
-        /*.kmctr  = */ { 0ULL, 0ULL },
-        /*.kmo    = */ { 0ULL, 0ULL },
-        /*.kmf    = */ { 0ULL, 0ULL },
-        /*.prno   = */ { 0ULL, 0ULL },
-        /*.kma    = */ { 0ULL, 0ULL },
-        /*.pcc    = */ { 0ULL, 0ULL },
-        /*.kdsa   = */ { 0ULL, 0ULL },
+        .stfle  = { S390X_CAPBIT(S390X_MSA)
+                    | S390X_CAPBIT(S390X_STCKF),
+                    0ULL, 0ULL, 0ULL },
+        .kimd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256),
+                    0ULL },
+        .klmd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256),
+                    0ULL },
+        .km     = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128),
+                    0ULL },
+        .kmc    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128),
+                    0ULL },
+        .kmac   = { S390X_CAPBIT(S390X_QUERY),
+                    0ULL },
+        .kmctr  = { 0ULL, 0ULL },
+        .kmo    = { 0ULL, 0ULL },
+        .kmf    = { 0ULL, 0ULL },
+        .prno   = { 0ULL, 0ULL },
+        .kma    = { 0ULL, 0ULL },
+        .pcc    = { 0ULL, 0ULL },
+        .kdsa   = { 0ULL, 0ULL },
     };

     /*-
@@ -302,21 +320,38 @@ static int parse_env(struct OPENSSL_s390xcap_st *cap, int *cex)
      * Implements MSA and MSA1-2.
      */
     static const struct OPENSSL_s390xcap_st z10 = {
-        /*.stfle  = */ { S390X_CAPBIT(S390X_MSA)
-                | S390X_CAPBIT(S390X_STCKF),
-            0ULL, 0ULL, 0ULL },
-        /*.kimd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1) | S390X_CAPBIT(S390X_SHA_256) | S390X_CAPBIT(S390X_SHA_512), 0ULL },
-        /*.klmd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1) | S390X_CAPBIT(S390X_SHA_256) | S390X_CAPBIT(S390X_SHA_512), 0ULL },
-        /*.km     = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmc    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmac   = */ { S390X_CAPBIT(S390X_QUERY), 0ULL },
-        /*.kmctr  = */ { 0ULL, 0ULL },
-        /*.kmo    = */ { 0ULL, 0ULL },
-        /*.kmf    = */ { 0ULL, 0ULL },
-        /*.prno   = */ { 0ULL, 0ULL },
-        /*.kma    = */ { 0ULL, 0ULL },
-        /*.pcc    = */ { 0ULL, 0ULL },
-        /*.kdsa   = */ { 0ULL, 0ULL },
+        .stfle  = { S390X_CAPBIT(S390X_MSA)
+                    | S390X_CAPBIT(S390X_STCKF),
+                    0ULL, 0ULL, 0ULL },
+        .kimd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256)
+                    | S390X_CAPBIT(S390X_SHA_512),
+                    0ULL },
+        .klmd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256)
+                    | S390X_CAPBIT(S390X_SHA_512),
+                    0ULL },
+        .km     = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmc    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmac   = { S390X_CAPBIT(S390X_QUERY),
+                    0ULL },
+        .kmctr  = { 0ULL, 0ULL },
+        .kmo    = { 0ULL, 0ULL },
+        .kmf    = { 0ULL, 0ULL },
+        .prno   = { 0ULL, 0ULL },
+        .kma    = { 0ULL, 0ULL },
+        .pcc    = { 0ULL, 0ULL },
+        .kdsa   = { 0ULL, 0ULL },
     };

     /*-
@@ -324,23 +359,58 @@ static int parse_env(struct OPENSSL_s390xcap_st *cap, int *cex)
      * Implements MSA and MSA1-4.
      */
     static const struct OPENSSL_s390xcap_st z196 = {
-        /*.stfle  = */ { S390X_CAPBIT(S390X_MSA)
-                | S390X_CAPBIT(S390X_STCKF),
-            S390X_CAPBIT(S390X_MSA3)
-                | S390X_CAPBIT(S390X_MSA4),
-            0ULL, 0ULL },
-        /*.kimd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1) | S390X_CAPBIT(S390X_SHA_256) | S390X_CAPBIT(S390X_SHA_512), S390X_CAPBIT(S390X_GHASH) },
-        /*.klmd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1) | S390X_CAPBIT(S390X_SHA_256) | S390X_CAPBIT(S390X_SHA_512), 0ULL },
-        /*.km     = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256) | S390X_CAPBIT(S390X_XTS_AES_128) | S390X_CAPBIT(S390X_XTS_AES_256), 0ULL },
-        /*.kmc    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmac   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmctr  = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmo    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmf    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.prno   = */ { 0ULL, 0ULL },
-        /*.kma    = */ { 0ULL, 0ULL },
-        /*.pcc    = */ { S390X_CAPBIT(S390X_QUERY), 0ULL },
-        /*.kdsa   = */ { 0ULL, 0ULL },
+        .stfle  = { S390X_CAPBIT(S390X_MSA)
+                    | S390X_CAPBIT(S390X_STCKF),
+                    S390X_CAPBIT(S390X_MSA3)
+                    | S390X_CAPBIT(S390X_MSA4),
+                    0ULL, 0ULL },
+        .kimd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256)
+                    | S390X_CAPBIT(S390X_SHA_512),
+                    S390X_CAPBIT(S390X_GHASH) },
+        .klmd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256)
+                    | S390X_CAPBIT(S390X_SHA_512),
+                    0ULL },
+        .km     = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256)
+                    | S390X_CAPBIT(S390X_XTS_AES_128)
+                    | S390X_CAPBIT(S390X_XTS_AES_256),
+                    0ULL },
+        .kmc    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmac   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmctr  = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmo    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmf    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .prno   = { 0ULL, 0ULL },
+        .kma    = { 0ULL, 0ULL },
+        .pcc    = { S390X_CAPBIT(S390X_QUERY),
+                    0ULL },
+        .kdsa   = { 0ULL, 0ULL },
     };

     /*-
@@ -348,23 +418,58 @@ static int parse_env(struct OPENSSL_s390xcap_st *cap, int *cex)
      * Implements MSA and MSA1-4.
      */
     static const struct OPENSSL_s390xcap_st zEC12 = {
-        /*.stfle  = */ { S390X_CAPBIT(S390X_MSA)
-                | S390X_CAPBIT(S390X_STCKF),
-            S390X_CAPBIT(S390X_MSA3)
-                | S390X_CAPBIT(S390X_MSA4),
-            0ULL, 0ULL },
-        /*.kimd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1) | S390X_CAPBIT(S390X_SHA_256) | S390X_CAPBIT(S390X_SHA_512), S390X_CAPBIT(S390X_GHASH) },
-        /*.klmd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1) | S390X_CAPBIT(S390X_SHA_256) | S390X_CAPBIT(S390X_SHA_512), 0ULL },
-        /*.km     = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256) | S390X_CAPBIT(S390X_XTS_AES_128) | S390X_CAPBIT(S390X_XTS_AES_256), 0ULL },
-        /*.kmc    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmac   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmctr  = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmo    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmf    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.prno   = */ { 0ULL, 0ULL },
-        /*.kma    = */ { 0ULL, 0ULL },
-        /*.pcc    = */ { S390X_CAPBIT(S390X_QUERY), 0ULL },
-        /*.kdsa   = */ { 0ULL, 0ULL },
+        .stfle  = { S390X_CAPBIT(S390X_MSA)
+                    | S390X_CAPBIT(S390X_STCKF),
+                    S390X_CAPBIT(S390X_MSA3)
+                    | S390X_CAPBIT(S390X_MSA4),
+                    0ULL, 0ULL },
+        .kimd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256)
+                    | S390X_CAPBIT(S390X_SHA_512),
+                    S390X_CAPBIT(S390X_GHASH) },
+        .klmd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256)
+                    | S390X_CAPBIT(S390X_SHA_512),
+                    0ULL },
+        .km     = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256)
+                    | S390X_CAPBIT(S390X_XTS_AES_128)
+                    | S390X_CAPBIT(S390X_XTS_AES_256),
+                    0ULL },
+        .kmc    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmac   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmctr  = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmo    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmf    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .prno   = { 0ULL, 0ULL },
+        .kma    = { 0ULL, 0ULL },
+        .pcc    = { S390X_CAPBIT(S390X_QUERY),
+                    0ULL },
+        .kdsa   = { 0ULL, 0ULL },
     };

     /*-
@@ -372,25 +477,62 @@ static int parse_env(struct OPENSSL_s390xcap_st *cap, int *cex)
      * Implements MSA and MSA1-5.
      */
     static const struct OPENSSL_s390xcap_st z13 = {
-        /*.stfle  = */ { S390X_CAPBIT(S390X_MSA)
-                | S390X_CAPBIT(S390X_STCKF)
-                | S390X_CAPBIT(S390X_MSA5),
-            S390X_CAPBIT(S390X_MSA3)
-                | S390X_CAPBIT(S390X_MSA4),
-            S390X_CAPBIT(S390X_VX),
-            0ULL },
-        /*.kimd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1) | S390X_CAPBIT(S390X_SHA_256) | S390X_CAPBIT(S390X_SHA_512), S390X_CAPBIT(S390X_GHASH) },
-        /*.klmd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1) | S390X_CAPBIT(S390X_SHA_256) | S390X_CAPBIT(S390X_SHA_512), 0ULL },
-        /*.km     = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256) | S390X_CAPBIT(S390X_XTS_AES_128) | S390X_CAPBIT(S390X_XTS_AES_256), 0ULL },
-        /*.kmc    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmac   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmctr  = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmo    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmf    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.prno   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_512_DRNG), 0ULL },
-        /*.kma    = */ { 0ULL, 0ULL },
-        /*.pcc    = */ { S390X_CAPBIT(S390X_QUERY), 0ULL },
-        /*.kdsa   = */ { 0ULL, 0ULL },
+        .stfle  = { S390X_CAPBIT(S390X_MSA)
+                    | S390X_CAPBIT(S390X_STCKF)
+                    | S390X_CAPBIT(S390X_MSA5),
+                    S390X_CAPBIT(S390X_MSA3)
+                    | S390X_CAPBIT(S390X_MSA4),
+                    S390X_CAPBIT(S390X_VX),
+                    0ULL },
+        .kimd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256)
+                    | S390X_CAPBIT(S390X_SHA_512),
+                    S390X_CAPBIT(S390X_GHASH) },
+        .klmd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256)
+                    | S390X_CAPBIT(S390X_SHA_512),
+                    0ULL },
+        .km     = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256)
+                    | S390X_CAPBIT(S390X_XTS_AES_128)
+                    | S390X_CAPBIT(S390X_XTS_AES_256),
+                    0ULL },
+        .kmc    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmac   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmctr  = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmo    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmf    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .prno   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_512_DRNG),
+                    0ULL },
+        .kma    = { 0ULL, 0ULL },
+        .pcc    = { S390X_CAPBIT(S390X_QUERY),
+                    0ULL },
+        .kdsa   = { 0ULL, 0ULL },
     };

     /*-
@@ -398,28 +540,81 @@ static int parse_env(struct OPENSSL_s390xcap_st *cap, int *cex)
      * Implements MSA and MSA1-8.
      */
     static const struct OPENSSL_s390xcap_st z14 = {
-        /*.stfle  = */ { S390X_CAPBIT(S390X_MSA)
-                | S390X_CAPBIT(S390X_STCKF)
-                | S390X_CAPBIT(S390X_MSA5),
-            S390X_CAPBIT(S390X_MSA3)
-                | S390X_CAPBIT(S390X_MSA4),
-            S390X_CAPBIT(S390X_VX)
-                | S390X_CAPBIT(S390X_VXD)
-                | S390X_CAPBIT(S390X_VXE)
-                | S390X_CAPBIT(S390X_MSA8),
-            0ULL },
-        /*.kimd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1) | S390X_CAPBIT(S390X_SHA_256) | S390X_CAPBIT(S390X_SHA_512) | S390X_CAPBIT(S390X_SHA3_224) | S390X_CAPBIT(S390X_SHA3_256) | S390X_CAPBIT(S390X_SHA3_384) | S390X_CAPBIT(S390X_SHA3_512) | S390X_CAPBIT(S390X_SHAKE_128) | S390X_CAPBIT(S390X_SHAKE_256), S390X_CAPBIT(S390X_GHASH) },
-        /*.klmd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1) | S390X_CAPBIT(S390X_SHA_256) | S390X_CAPBIT(S390X_SHA_512) | S390X_CAPBIT(S390X_SHA3_224) | S390X_CAPBIT(S390X_SHA3_256) | S390X_CAPBIT(S390X_SHA3_384) | S390X_CAPBIT(S390X_SHA3_512) | S390X_CAPBIT(S390X_SHAKE_128) | S390X_CAPBIT(S390X_SHAKE_256), 0ULL },
-        /*.km     = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256) | S390X_CAPBIT(S390X_XTS_AES_128) | S390X_CAPBIT(S390X_XTS_AES_256), 0ULL },
-        /*.kmc    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmac   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmctr  = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmo    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmf    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.prno   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_512_DRNG), S390X_CAPBIT(S390X_TRNG) },
-        /*.kma    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.pcc    = */ { S390X_CAPBIT(S390X_QUERY), 0ULL },
-        /*.kdsa   = */ { 0ULL, 0ULL },
+        .stfle  = { S390X_CAPBIT(S390X_MSA)
+                    | S390X_CAPBIT(S390X_STCKF)
+                    | S390X_CAPBIT(S390X_MSA5),
+                    S390X_CAPBIT(S390X_MSA3)
+                    | S390X_CAPBIT(S390X_MSA4),
+                    S390X_CAPBIT(S390X_VX)
+                    | S390X_CAPBIT(S390X_VXD)
+                    | S390X_CAPBIT(S390X_VXE)
+                    | S390X_CAPBIT(S390X_MSA8),
+                    0ULL },
+        .kimd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256)
+                    | S390X_CAPBIT(S390X_SHA_512)
+                    | S390X_CAPBIT(S390X_SHA3_224)
+                    | S390X_CAPBIT(S390X_SHA3_256)
+                    | S390X_CAPBIT(S390X_SHA3_384)
+                    | S390X_CAPBIT(S390X_SHA3_512)
+                    | S390X_CAPBIT(S390X_SHAKE_128)
+                    | S390X_CAPBIT(S390X_SHAKE_256),
+                    S390X_CAPBIT(S390X_GHASH) },
+        .klmd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256)
+                    | S390X_CAPBIT(S390X_SHA_512)
+                    | S390X_CAPBIT(S390X_SHA3_224)
+                    | S390X_CAPBIT(S390X_SHA3_256)
+                    | S390X_CAPBIT(S390X_SHA3_384)
+                    | S390X_CAPBIT(S390X_SHA3_512)
+                    | S390X_CAPBIT(S390X_SHAKE_128)
+                    | S390X_CAPBIT(S390X_SHAKE_256),
+                    0ULL },
+        .km     = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256)
+                    | S390X_CAPBIT(S390X_XTS_AES_128)
+                    | S390X_CAPBIT(S390X_XTS_AES_256),
+                    0ULL },
+        .kmc    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmac   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmctr  = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmo    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmf    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .prno   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_512_DRNG),
+                    S390X_CAPBIT(S390X_TRNG) },
+        .kma    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .pcc    = { S390X_CAPBIT(S390X_QUERY),
+                    0ULL },
+        .kdsa   = { 0ULL, 0ULL },
     };

     /*-
@@ -427,29 +622,99 @@ static int parse_env(struct OPENSSL_s390xcap_st *cap, int *cex)
      * Implements MSA and MSA1-9.
      */
     static const struct OPENSSL_s390xcap_st z15 = {
-        /*.stfle  = */ { S390X_CAPBIT(S390X_MSA)
-                | S390X_CAPBIT(S390X_STCKF)
-                | S390X_CAPBIT(S390X_MSA5),
-            S390X_CAPBIT(S390X_MSA3)
-                | S390X_CAPBIT(S390X_MSA4),
-            S390X_CAPBIT(S390X_VX)
-                | S390X_CAPBIT(S390X_VXD)
-                | S390X_CAPBIT(S390X_VXE)
-                | S390X_CAPBIT(S390X_MSA8)
-                | S390X_CAPBIT(S390X_MSA9),
-            0ULL },
-        /*.kimd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1) | S390X_CAPBIT(S390X_SHA_256) | S390X_CAPBIT(S390X_SHA_512) | S390X_CAPBIT(S390X_SHA3_224) | S390X_CAPBIT(S390X_SHA3_256) | S390X_CAPBIT(S390X_SHA3_384) | S390X_CAPBIT(S390X_SHA3_512) | S390X_CAPBIT(S390X_SHAKE_128) | S390X_CAPBIT(S390X_SHAKE_256), S390X_CAPBIT(S390X_GHASH) },
-        /*.klmd   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_1) | S390X_CAPBIT(S390X_SHA_256) | S390X_CAPBIT(S390X_SHA_512) | S390X_CAPBIT(S390X_SHA3_224) | S390X_CAPBIT(S390X_SHA3_256) | S390X_CAPBIT(S390X_SHA3_384) | S390X_CAPBIT(S390X_SHA3_512) | S390X_CAPBIT(S390X_SHAKE_128) | S390X_CAPBIT(S390X_SHAKE_256), 0ULL },
-        /*.km     = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256) | S390X_CAPBIT(S390X_XTS_AES_128) | S390X_CAPBIT(S390X_XTS_AES_256), 0ULL },
-        /*.kmc    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmac   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmctr  = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmo    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.kmf    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.prno   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_SHA_512_DRNG), S390X_CAPBIT(S390X_TRNG) },
-        /*.kma    = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_AES_128) | S390X_CAPBIT(S390X_AES_192) | S390X_CAPBIT(S390X_AES_256), 0ULL },
-        /*.pcc    = */ { S390X_CAPBIT(S390X_QUERY), S390X_CAPBIT(S390X_SCALAR_MULTIPLY_P256) | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_P384) | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_P521) | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_ED25519) | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_ED448) | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_X25519) | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_X448) },
-        /*.kdsa   = */ { S390X_CAPBIT(S390X_QUERY) | S390X_CAPBIT(S390X_ECDSA_VERIFY_P256) | S390X_CAPBIT(S390X_ECDSA_VERIFY_P384) | S390X_CAPBIT(S390X_ECDSA_VERIFY_P521) | S390X_CAPBIT(S390X_ECDSA_SIGN_P256) | S390X_CAPBIT(S390X_ECDSA_SIGN_P384) | S390X_CAPBIT(S390X_ECDSA_SIGN_P521) | S390X_CAPBIT(S390X_EDDSA_VERIFY_ED25519) | S390X_CAPBIT(S390X_EDDSA_VERIFY_ED448) | S390X_CAPBIT(S390X_EDDSA_SIGN_ED25519) | S390X_CAPBIT(S390X_EDDSA_SIGN_ED448), 0ULL },
+        .stfle  = { S390X_CAPBIT(S390X_MSA)
+                    | S390X_CAPBIT(S390X_STCKF)
+                    | S390X_CAPBIT(S390X_MSA5),
+                    S390X_CAPBIT(S390X_MSA3)
+                    | S390X_CAPBIT(S390X_MSA4),
+                    S390X_CAPBIT(S390X_VX)
+                    | S390X_CAPBIT(S390X_VXD)
+                    | S390X_CAPBIT(S390X_VXE)
+                    | S390X_CAPBIT(S390X_MSA8)
+                    | S390X_CAPBIT(S390X_MSA9),
+                    0ULL },
+        .kimd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256)
+                    | S390X_CAPBIT(S390X_SHA_512)
+                    | S390X_CAPBIT(S390X_SHA3_224)
+                    | S390X_CAPBIT(S390X_SHA3_256)
+                    | S390X_CAPBIT(S390X_SHA3_384)
+                    | S390X_CAPBIT(S390X_SHA3_512)
+                    | S390X_CAPBIT(S390X_SHAKE_128)
+                    | S390X_CAPBIT(S390X_SHAKE_256),
+                    S390X_CAPBIT(S390X_GHASH) },
+        .klmd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256)
+                    | S390X_CAPBIT(S390X_SHA_512)
+                    | S390X_CAPBIT(S390X_SHA3_224)
+                    | S390X_CAPBIT(S390X_SHA3_256)
+                    | S390X_CAPBIT(S390X_SHA3_384)
+                    | S390X_CAPBIT(S390X_SHA3_512)
+                    | S390X_CAPBIT(S390X_SHAKE_128)
+                    | S390X_CAPBIT(S390X_SHAKE_256),
+                    0ULL },
+        .km     = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256)
+                    | S390X_CAPBIT(S390X_XTS_AES_128)
+                    | S390X_CAPBIT(S390X_XTS_AES_256),
+                    0ULL },
+        .kmc    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmac   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmctr  = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmo    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmf    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL},
+        .prno   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_512_DRNG),
+                    S390X_CAPBIT(S390X_TRNG) },
+        .kma    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .pcc    = { S390X_CAPBIT(S390X_QUERY),
+                    S390X_CAPBIT(S390X_SCALAR_MULTIPLY_P256)
+                    | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_P384)
+                    | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_P521)
+                    | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_ED25519)
+                    | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_ED448)
+                    | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_X25519)
+                    | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_X448) },
+        .kdsa   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_ECDSA_VERIFY_P256)
+                    | S390X_CAPBIT(S390X_ECDSA_VERIFY_P384)
+                    | S390X_CAPBIT(S390X_ECDSA_VERIFY_P521)
+                    | S390X_CAPBIT(S390X_ECDSA_SIGN_P256)
+                    | S390X_CAPBIT(S390X_ECDSA_SIGN_P384)
+                    | S390X_CAPBIT(S390X_ECDSA_SIGN_P521)
+                    | S390X_CAPBIT(S390X_EDDSA_VERIFY_ED25519)
+                    | S390X_CAPBIT(S390X_EDDSA_VERIFY_ED448)
+                    | S390X_CAPBIT(S390X_EDDSA_SIGN_ED25519)
+                    | S390X_CAPBIT(S390X_EDDSA_SIGN_ED448),
+                    0ULL },
     };

     /*-
@@ -457,6 +722,113 @@ static int parse_env(struct OPENSSL_s390xcap_st *cap, int *cex)
      * Implements MSA and MSA1-9 (same as z15, no need to repeat).
      */

+    /*-
+     * z17 (2025) - z/Architecture POP
+     * Implements MSA and MSA1-12.
+     */
+    static const struct OPENSSL_s390xcap_st z17 = {
+        .stfle  = { S390X_CAPBIT(S390X_MSA)
+                    | S390X_CAPBIT(S390X_STCKF)
+                    | S390X_CAPBIT(S390X_MSA5),
+                    S390X_CAPBIT(S390X_MSA3)
+                    | S390X_CAPBIT(S390X_MSA4)
+                    | S390X_CAPBIT(S390X_MSA12),
+                    S390X_CAPBIT(S390X_VX)
+                    | S390X_CAPBIT(S390X_VXD)
+                    | S390X_CAPBIT(S390X_VXE)
+                    | S390X_CAPBIT(S390X_MSA8)
+                    | S390X_CAPBIT(S390X_MSA9),
+                    0ULL },
+        .kimd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256)
+                    | S390X_CAPBIT(S390X_SHA_512)
+                    | S390X_CAPBIT(S390X_SHA3_224)
+                    | S390X_CAPBIT(S390X_SHA3_256)
+                    | S390X_CAPBIT(S390X_SHA3_384)
+                    | S390X_CAPBIT(S390X_SHA3_512)
+                    | S390X_CAPBIT(S390X_SHAKE_128)
+                    | S390X_CAPBIT(S390X_SHAKE_256),
+                    S390X_CAPBIT(S390X_GHASH) },
+        .klmd   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_1)
+                    | S390X_CAPBIT(S390X_SHA_256)
+                    | S390X_CAPBIT(S390X_SHA_512)
+                    | S390X_CAPBIT(S390X_SHA3_224)
+                    | S390X_CAPBIT(S390X_SHA3_256)
+                    | S390X_CAPBIT(S390X_SHA3_384)
+                    | S390X_CAPBIT(S390X_SHA3_512)
+                    | S390X_CAPBIT(S390X_SHAKE_128)
+                    | S390X_CAPBIT(S390X_SHAKE_256),
+                    0ULL },
+        .km     = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256)
+                    | S390X_CAPBIT(S390X_XTS_AES_128)
+                    | S390X_CAPBIT(S390X_XTS_AES_256),
+                    S390X_CAPBIT(S390X_XTS_AES_128_MSA10)
+                    | S390X_CAPBIT(S390X_XTS_AES_256_MSA10) },
+        .kmc    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmac   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    S390X_CAPBIT(S390X_HMAC_SHA_224)
+                    | S390X_CAPBIT(S390X_HMAC_SHA_256)
+                    | S390X_CAPBIT(S390X_HMAC_SHA_384)
+                    | S390X_CAPBIT(S390X_HMAC_SHA_512) },
+        .kmctr  = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmo    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .kmf    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .prno   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_SHA_512_DRNG),
+                    S390X_CAPBIT(S390X_TRNG) },
+        .kma    = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_AES_128)
+                    | S390X_CAPBIT(S390X_AES_192)
+                    | S390X_CAPBIT(S390X_AES_256),
+                    0ULL },
+        .pcc    = { S390X_CAPBIT(S390X_QUERY),
+                    S390X_CAPBIT(S390X_SCALAR_MULTIPLY_P256)
+                    | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_P384)
+                    | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_P521)
+                    | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_ED25519)
+                    | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_ED448)
+                    | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_X25519)
+                    | S390X_CAPBIT(S390X_SCALAR_MULTIPLY_X448) },
+        .kdsa   = { S390X_CAPBIT(S390X_QUERY)
+                    | S390X_CAPBIT(S390X_ECDSA_VERIFY_P256)
+                    | S390X_CAPBIT(S390X_ECDSA_VERIFY_P384)
+                    | S390X_CAPBIT(S390X_ECDSA_VERIFY_P521)
+                    | S390X_CAPBIT(S390X_ECDSA_SIGN_P256)
+                    | S390X_CAPBIT(S390X_ECDSA_SIGN_P384)
+                    | S390X_CAPBIT(S390X_ECDSA_SIGN_P521)
+                    | S390X_CAPBIT(S390X_EDDSA_VERIFY_ED25519)
+                    | S390X_CAPBIT(S390X_EDDSA_VERIFY_ED448)
+                    | S390X_CAPBIT(S390X_EDDSA_SIGN_ED25519)
+                    | S390X_CAPBIT(S390X_EDDSA_SIGN_ED448),
+                    0ULL },
+    };
+
+    /* clang-format on */
+
     char *tok_begin, *tok_end, *buff, tok[S390X_STFLE_MAX][LEN + 1];
     int rc, off, i, n;

@@ -473,6 +845,7 @@ static int parse_env(struct OPENSSL_s390xcap_st *cap, int *cex)
     tok_end = strtok(NULL, ";");

     while (tok_begin != NULL) {
+        /* clang-format off */
         /* stfle token */
         if ((n = sscanf(tok_begin,
                  " stfle : %" STR(LEN) "[^:] : "
@@ -488,20 +861,38 @@ static int parse_env(struct OPENSSL_s390xcap_st *cap, int *cex)
         }

         /* query function tokens */
-        else if TOK_FUNC (kimd)
-            else if TOK_FUNC (klmd) else if TOK_FUNC (km) else if TOK_FUNC (kmc) else if TOK_FUNC (kmac) else if TOK_FUNC (kmctr) else if TOK_FUNC (kmo) else if TOK_FUNC (kmf) else if TOK_FUNC (prno) else if TOK_FUNC (kma) else if TOK_FUNC (pcc) else if TOK_FUNC (kdsa)
-
-                /* CPU model tokens */
-                else if TOK_CPU (z900) else if TOK_CPU (z990) else if TOK_CPU (z9) else if TOK_CPU (z10) else if TOK_CPU (z196) else if TOK_CPU (zEC12) else if TOK_CPU (z13) else if TOK_CPU (z14) else if TOK_CPU (z15) else if TOK_CPU_ALIAS (z16, z15)
-
-                /* nocex to deactivate cex support */
-                else if (sscanf(tok_begin, " %" STR(LEN) "s %" STR(LEN) "s ",
-                             tok[0], tok[1])
-                        == 1
-                    && !strcmp(tok[0], "nocex"))
-            {
-                *cex = 0;
-            }
+        else if TOK_FUNC(kimd)
+        else if TOK_FUNC(klmd)
+        else if TOK_FUNC(km)
+        else if TOK_FUNC(kmc)
+        else if TOK_FUNC(kmac)
+        else if TOK_FUNC(kmctr)
+        else if TOK_FUNC(kmo)
+        else if TOK_FUNC(kmf)
+        else if TOK_FUNC(prno)
+        else if TOK_FUNC(kma)
+        else if TOK_FUNC(pcc)
+        else if TOK_FUNC(kdsa)
+
+        /* CPU model tokens */
+        else if TOK_CPU(z900)
+        else if TOK_CPU(z990)
+        else if TOK_CPU(z9)
+        else if TOK_CPU(z10)
+        else if TOK_CPU(z196)
+        else if TOK_CPU(zEC12)
+        else if TOK_CPU(z13)
+        else if TOK_CPU(z14)
+        else if TOK_CPU(z15)
+        else if TOK_CPU_ALIAS(z16, z15)
+        else if TOK_CPU(z17)
+
+        /* nocex to deactivate cex support */
+        else if (sscanf(tok_begin, " %" STR(LEN) "s %" STR(LEN) "s ",
+                     tok[0], tok[1]) == 1
+            && !strcmp(tok[0], "nocex")) {
+            *cex = 0;
+        }

         /* whitespace(ignored) or invalid tokens */
         else {
@@ -511,6 +902,7 @@ static int parse_env(struct OPENSSL_s390xcap_st *cap, int *cex)
                 tok_begin++;
             }
         }
+        /* clang-format on */

         tok_begin = tok_end;
         tok_end = strtok(NULL, ";");
diff --git a/deps/openssl/openssl/crypto/s390xcpuid.pl b/deps/openssl/openssl/crypto/s390xcpuid.pl
index 254d5aecb13..098f958f847 100755
--- a/deps/openssl/openssl/crypto/s390xcpuid.pl
+++ b/deps/openssl/openssl/crypto/s390xcpuid.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2009-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2009-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -26,7 +26,7 @@ $sp="%r15";
 $stdframe=16*$SIZE_T+4*8;

 $code=<<___;
-#include "s390x_arch.h"
+#include "arch/s390x_arch.h"

 .text

@@ -188,26 +188,6 @@ OPENSSL_atomic_add:
 	br	$ra
 .size	OPENSSL_atomic_add,.-OPENSSL_atomic_add

-.globl	OPENSSL_wipe_cpu
-.type	OPENSSL_wipe_cpu,\@function
-.align	16
-OPENSSL_wipe_cpu:
-	xgr	%r0,%r0
-	xgr	%r1,%r1
-	lgr	%r2,$sp
-	xgr	%r3,%r3
-	xgr	%r4,%r4
-	lzdr	%f0
-	lzdr	%f1
-	lzdr	%f2
-	lzdr	%f3
-	lzdr	%f4
-	lzdr	%f5
-	lzdr	%f6
-	lzdr	%f7
-	br	$ra
-.size	OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu
-
 .globl	OPENSSL_cleanse
 .type	OPENSSL_cleanse,\@function
 .align	16
diff --git a/deps/openssl/openssl/crypto/sha/asm/keccak1600-armv4.pl b/deps/openssl/openssl/crypto/sha/asm/keccak1600-armv4.pl
index f9a8cd1f004..6414ef5cfe0 100755
--- a/deps/openssl/openssl/crypto/sha/asm/keccak1600-armv4.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/keccak1600-armv4.pl
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -7,10 +7,10 @@
 # https://www.openssl.org/source/license.html
 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Keccak-1600 for ARMv4.
@@ -113,7 +113,7 @@ my @D = map(8*$_, (25..29));
 my @T = map([ 8*$_, 8*($_+1), 8*($_+2), 8*($_+3), 8*($_+4) ], (30,35,40,45,50));

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 #if defined(__thumb2__)
 .syntax	unified
@@ -1605,7 +1605,7 @@ SHA3_squeeze_neon:
 	ldmia	sp!, {r4-r6,pc}
 .size	SHA3_squeeze_neon,.-SHA3_squeeze_neon
 #endif
-.asciz	"Keccak-1600 absorb and squeeze for ARMv4/NEON, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Keccak-1600 absorb and squeeze for ARMv4/NEON, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2
 ___

diff --git a/deps/openssl/openssl/crypto/sha/asm/keccak1600-armv8.pl b/deps/openssl/openssl/crypto/sha/asm/keccak1600-armv8.pl
index f49c54c4656..3bda2fd727c 100755
--- a/deps/openssl/openssl/crypto/sha/asm/keccak1600-armv8.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/keccak1600-armv8.pl
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -7,10 +7,10 @@
 # https://www.openssl.org/source/license.html
 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Keccak-1600 for ARMv8.
@@ -80,7 +80,7 @@ my @rhotates = ([  0,  1, 62, 28, 27 ],
                 [ 18,  2, 61, 56, 14 ]);

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 .rodata

@@ -853,7 +853,7 @@ SHA3_squeeze_cext:
 ___
 }								}}}
 $code.=<<___;
-.asciz	"Keccak-1600 absorb and squeeze for ARMv8, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Keccak-1600 absorb and squeeze for ARMv8, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 {   my  %opcode = (
diff --git a/deps/openssl/openssl/crypto/sha/asm/keccak1600-avx2.pl b/deps/openssl/openssl/crypto/sha/asm/keccak1600-avx2.pl
index 86406653344..5c4bc28d893 100755
--- a/deps/openssl/openssl/crypto/sha/asm/keccak1600-avx2.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/keccak1600-avx2.pl
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# Copyright 2017-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -7,10 +7,10 @@
 # https://www.openssl.org/source/license.html
 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Keccak-1600 for AVX2.
@@ -474,7 +474,7 @@ iotas:
 	.quad	0x0000000080000001, 0x0000000080000001, 0x0000000080000001, 0x0000000080000001
 	.quad	0x8000000080008008, 0x8000000080008008, 0x8000000080008008, 0x8000000080008008

-.asciz	"Keccak-1600 absorb and squeeze for AVX2, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Keccak-1600 absorb and squeeze for AVX2, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 $output=pop and open STDOUT,">$output";
diff --git a/deps/openssl/openssl/crypto/sha/asm/keccak1600-avx512.pl b/deps/openssl/openssl/crypto/sha/asm/keccak1600-avx512.pl
index efc32545c35..465479ab664 100755
--- a/deps/openssl/openssl/crypto/sha/asm/keccak1600-avx512.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/keccak1600-avx512.pl
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# Copyright 2017-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -7,10 +7,10 @@
 # https://www.openssl.org/source/license.html
 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Keccak-1600 for AVX-512F.
@@ -22,7 +22,7 @@
 # It's impossible to have one that is optimal for every step, hence
 # it's changing as algorithm progresses. Data is saved in linear order,
 # but in-register order morphs between rounds. Even rounds take in
-# linear layout, and odd rounds - transposed, or "verticaly-shaped"...
+# linear layout, and odd rounds - transposed, or "vertically-shaped"...
 #
 ########################################################################
 # Numbers are cycles per processed byte out of large message.
@@ -543,7 +543,7 @@ iotas:
 	.quad	0x0000000080000001
 	.quad	0x8000000080008008

-.asciz	"Keccak-1600 absorb and squeeze for AVX-512F, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Keccak-1600 absorb and squeeze for AVX-512F, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 $output=pop and open STDOUT,">$output";
diff --git a/deps/openssl/openssl/crypto/sha/asm/keccak1600-avx512vl.pl b/deps/openssl/openssl/crypto/sha/asm/keccak1600-avx512vl.pl
index f941556b42a..5a78024b013 100755
--- a/deps/openssl/openssl/crypto/sha/asm/keccak1600-avx512vl.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/keccak1600-avx512vl.pl
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# Copyright 2017-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -7,10 +7,10 @@
 # https://www.openssl.org/source/license.html
 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Keccak-1600 for AVX512VL.
@@ -384,7 +384,7 @@ iotas:
 	.quad	0x0000000080000001, 0x0000000080000001, 0x0000000080000001, 0x0000000080000001
 	.quad	0x8000000080008008, 0x8000000080008008, 0x8000000080008008, 0x8000000080008008

-.asciz	"Keccak-1600 absorb and squeeze for AVX512VL, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Keccak-1600 absorb and squeeze for AVX512VL, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 $output=pop and open STDOUT,">$output";
diff --git a/deps/openssl/openssl/crypto/sha/asm/keccak1600-c64x.pl b/deps/openssl/openssl/crypto/sha/asm/keccak1600-c64x.pl
index 0a9dec85c29..7530d27543f 100755
--- a/deps/openssl/openssl/crypto/sha/asm/keccak1600-c64x.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/keccak1600-c64x.pl
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -7,10 +7,10 @@
 # https://www.openssl.org/source/license.html
 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # [ABI- and endian-neutral] Keccak-1600 for C64x.
@@ -875,7 +875,7 @@ iotas:
 	.uword	0x00000001, 0x00008000
 	.uword	0x00000000, 0x80008082

-	.cstring "Keccak-1600 absorb and squeeze for C64x, CRYPTOGAMS by <appro\@openssl.org>"
+	.cstring "Keccak-1600 absorb and squeeze for C64x, CRYPTOGAMS by <https://github.com/dot-asm>"
 	.align	4
 ___

diff --git a/deps/openssl/openssl/crypto/sha/asm/keccak1600-mmx.pl b/deps/openssl/openssl/crypto/sha/asm/keccak1600-mmx.pl
index 7657a23a9c2..960a70d2534 100755
--- a/deps/openssl/openssl/crypto/sha/asm/keccak1600-mmx.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/keccak1600-mmx.pl
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -7,10 +7,10 @@
 # https://www.openssl.org/source/license.html
 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Keccak-1600 for x86 MMX.
@@ -432,7 +432,7 @@ sub Rho() {				######### regular Rho step
 	&data_word(0x00008080,0x80000000);
 	&data_word(0x80000001,0x00000000);
 	&data_word(0x80008008,0x80000000);
-&asciz("Keccak-1600 absorb and squeeze for MMX, CRYPTOGAMS by <appro\@openssl.org>");
+&asciz("Keccak-1600 absorb and squeeze for MMX, CRYPTOGAMS by <https://github.com/dot-asm>");

 &asm_finish();

diff --git a/deps/openssl/openssl/crypto/sha/asm/keccak1600-ppc64.pl b/deps/openssl/openssl/crypto/sha/asm/keccak1600-ppc64.pl
index 54f32e8c929..00f52a294da 100755
--- a/deps/openssl/openssl/crypto/sha/asm/keccak1600-ppc64.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/keccak1600-ppc64.pl
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -7,10 +7,10 @@
 # https://www.openssl.org/source/license.html
 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Keccak-1600 for PPC64.
@@ -772,7 +772,7 @@ iotas:
 	.quad	0x0000000080000001
 	.quad	0x8000000080008008
 .size	iotas,.-iotas
-.asciz	"Keccak-1600 absorb and squeeze for PPC64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Keccak-1600 absorb and squeeze for PPC64, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 $code =~ s/\`([^\`]*)\`/eval $1/gem;
diff --git a/deps/openssl/openssl/crypto/sha/asm/keccak1600-s390x.pl b/deps/openssl/openssl/crypto/sha/asm/keccak1600-s390x.pl
index 6cf0214bb93..fda541fbfa2 100755
--- a/deps/openssl/openssl/crypto/sha/asm/keccak1600-s390x.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/keccak1600-s390x.pl
@@ -7,10 +7,10 @@
 # https://www.openssl.org/source/license.html
 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Keccak-1600 for s390x.
@@ -555,7 +555,7 @@ iotas:
 	.quad	0x0000000080000001
 	.quad	0x8000000080008008
 .size	iotas,.-iotas
-.asciz	"Keccak-1600 absorb and squeeze for s390x, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Keccak-1600 absorb and squeeze for s390x, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 # unlike 32-bit shift 64-bit one takes three arguments
diff --git a/deps/openssl/openssl/crypto/sha/asm/keccak1600-x86_64.pl b/deps/openssl/openssl/crypto/sha/asm/keccak1600-x86_64.pl
index 3dbf17731e4..3794949e8a6 100755
--- a/deps/openssl/openssl/crypto/sha/asm/keccak1600-x86_64.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/keccak1600-x86_64.pl
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# Copyright 2017-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -7,10 +7,10 @@
 # https://www.openssl.org/source/license.html
 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Keccak-1600 for x86_64.
@@ -597,7 +597,7 @@ iotas:
 	.quad	0x0000000080000001
 	.quad	0x8000000080008008
 .size	iotas,.-iotas
-.asciz	"Keccak-1600 absorb and squeeze for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Keccak-1600 absorb and squeeze for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 foreach (split("\n",$code)) {
diff --git a/deps/openssl/openssl/crypto/sha/asm/keccak1600p8-ppc.pl b/deps/openssl/openssl/crypto/sha/asm/keccak1600p8-ppc.pl
index 7554c87f208..e02dfc6a59e 100755
--- a/deps/openssl/openssl/crypto/sha/asm/keccak1600p8-ppc.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/keccak1600p8-ppc.pl
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -7,10 +7,10 @@
 # https://www.openssl.org/source/license.html
 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Keccak-1600 for PowerISA 2.07.
@@ -836,7 +836,7 @@ iotas:
 	.quad	0x0000000080000001,0
 	.quad	0x8000000080008008,0
 .size	iotas,.-iotas
-.asciz	"Keccak-1600 absorb and squeeze for PowerISA 2.07, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"Keccak-1600 absorb and squeeze for PowerISA 2.07, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 foreach  (split("\n",$code)) {
diff --git a/deps/openssl/openssl/crypto/sha/asm/keccak1600x4-avx512vl.pl b/deps/openssl/openssl/crypto/sha/asm/keccak1600x4-avx512vl.pl
new file mode 100755
index 00000000000..a7fc1814f58
--- /dev/null
+++ b/deps/openssl/openssl/crypto/sha/asm/keccak1600x4-avx512vl.pl
@@ -0,0 +1,2349 @@
+#!/usr/bin/env perl
+#
+# Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright (c) 2026 Intel Corporation. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+###############################################################################
+# Keccak x4 AVX512VL SHA3/SHAKE Assembly Routines
+#
+# Description:
+#   This file emits x86_64 assembly for AVX512VL accelerated Keccak-f[1600]
+#   processing of 4 independent states in parallel ("x4").
+#
+#   It provides the core 24-round Keccak permutation and x4 helper routines
+#   used by SHA3 and SHAKE absorb/finalize/squeeze paths. Data from four
+#   input/output lanes is packed across YMM registers so lane-local operations
+#   execute in SIMD.
+#
+###############################################################################
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+$win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/);
+
+$avx512vl = 0;
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
+( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or
+( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
+die "can't locate x86_64-xlate.pl";
+
+# Check for AVX512VL support in assembler
+if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1` =~ /GNU assembler version (\d+)\.(\d+)/) {
+  my ($gas_major, $gas_minor) = ($1, $2);
+  $avx512vl = ($gas_major > 2 || ($gas_major == 2 && $gas_minor >= 26));
+}
+
+if (!$avx512vl
+  && $win64
+  && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/)
+  && `nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)(?:\.([0-9]+))?/)
+{
+  $avx512vl = ($1 >= 2.12);
+}
+
+if (!$avx512vl && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) {
+    $avx512vl = ($2>=3.9);
+}
+
+open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
+    or die "can't call $xlate: $!";
+*STDOUT=*OUT;
+
+$arg1="%rdi";
+$arg2="%rsi";
+$arg3="%rdx";
+$arg4="%rcx";
+$arg5="%r8";
+$arg6="%r9";
+$roundn="%r13d";
+$tblptr="%r14";
+
+# Define SHAKE rates
+$SHAKE128_RATE="\$168";
+$SHAKE256_RATE="\$136";
+
+# Stack frame offsets for SHAKE x4 wrapper functions
+$STATE_SIZE="808";    # (25 * 8 * 4) + 8 = 808 bytes
+$sf_arg1="0";
+$sf_arg2="8";
+$sf_arg3="16";
+$sf_arg4="24";
+$sf_arg5="32";
+$sf_state_ptr="40";
+$sf_state_x4="48";
+$sf_size="856";       # 48 + 808 = 856 bytes
+
+# Emit an internal helper call used by one-shot wrappers.
+# - Win64: call the provided *_internal shim and bracket it with 32-byte
+#   shadow space so shim entry can use xlate-compatible [rsp+8]/[rsp+16].
+# - non-Win64: call the local function entry label (.L_<base name>), which
+#   sits at the same address as the public symbol.  Calling the public
+#   global symbol by name here would break Mach-O builds: the call textually
+#   precedes the symbol's .globl declaration, so x86_64-xlate.pl never gets
+#   a chance to prepend the platform's leading-underscore, leaving an
+#   undefined reference to the un-decorated name.
+# The argument must be the shim/internal symbol name, e.g.
+#   SHA3_shake128_x4_inc_squeeze_avx512vl_internal
+sub call_internal {
+    my ($shim_name) = @_;
+    my $external_name = $shim_name;
+
+    $external_name =~ s/_internal$//;
+
+    return <<___ if ($win64);
+    sub     \$32, %rsp
+    call    $shim_name
+    add     \$32, %rsp
+___
+
+    return <<___;
+    call    .L_$external_name
+___
+}
+
+if ($avx512vl>0) {{{
+
+my $avx512_mask = (1<<31)|(1<<30)|(1<<17)|(1<<16);  # AVX512VL|BW|DQ|F
+
+$code .= <<___;
+.text
+
+.extern OPENSSL_ia32cap_P
+
+.globl  SHA3_avx512vl_capable
+.type   SHA3_avx512vl_capable,\@abi-omnipotent
+.align 32
+SHA3_avx512vl_capable:
+    mov     OPENSSL_ia32cap_P+8(%rip), %ecx
+    xor     %eax, %eax
+    # 1<<31|1<<30|1<<17|1<<16: AVX512VL|AVX512BW|AVX512DQ|AVX512F
+    and     \$$avx512_mask, %ecx
+    cmp     \$$avx512_mask, %ecx
+    cmove   %ecx, %eax
+    ret
+.size   SHA3_avx512vl_capable, .-SHA3_avx512vl_capable
+___
+
+$code.=<<___;
+.text
+
+# Perform Keccak permutation
+#
+# YMM registers 0 to 24 are used as Keccak state registers.
+# This function, as is, can work on 1 to 4 independent states at the same time.
+#
+# There is no clear boundary between Theta, Rho, Pi, Chi and Iota steps.
+# Instructions corresponding to these steps overlap for better efficiency.
+#
+# Arguments:
+# ymm0-ymm24    [in/out]    Keccak state registers (one SIMD per one state register)
+# ymm25-ymm31   [clobbered] temporary SIMD registers
+# $roundn       [clobbered] used for round tracking
+# $tblptr       [clobbered] used for access to SHA3 constant table
+.type keccak_1600_permute,\@abi-omnipotent
+.align  32
+keccak_1600_permute:
+.cfi_startproc
+    mov     \$24, $roundn        # 24 rounds
+    lea     iotas(%rip), $tblptr # Load the address of the SHA3 round constants
+
+.align  32
+.Lkeccak_rnd_loop:
+    # Theta step
+
+    # Compute column parities
+    # C[5] = [0, 0, 0, 0, 0]
+    # for x in 0 to 4:
+    #     C[x] = state[x][0] XOR state[x][1] XOR state[x][2] XOR state[x][3] XOR state[x][4]
+
+    vmovdqa64   %ymm0, %ymm25
+    vpternlogq  \$0x96, %ymm5, %ymm10, %ymm25
+    vmovdqa64   %ymm1, %ymm26
+    vpternlogq  \$0x96, %ymm11, %ymm6, %ymm26
+    vmovdqa64   %ymm2, %ymm27
+    vpternlogq  \$0x96, %ymm12, %ymm7, %ymm27
+
+    vmovdqa64   %ymm3, %ymm28
+    vpternlogq  \$0x96, %ymm13, %ymm8, %ymm28
+    vmovdqa64   %ymm4, %ymm29
+    vpternlogq  \$0x96, %ymm14, %ymm9, %ymm29
+    vpternlogq  \$0x96, %ymm20, %ymm15, %ymm25
+
+    vpternlogq  \$0x96, %ymm21, %ymm16, %ymm26
+    vpternlogq  \$0x96, %ymm22, %ymm17, %ymm27
+    vpternlogq  \$0x96, %ymm23, %ymm18, %ymm28
+
+    # Start computing D values and keep computing column parity
+    # D[5] = [0, 0, 0, 0, 0]
+    # for x in 0 to 4:
+    #     D[x] = C[(x+4) mod 5] XOR ROTATE_LEFT(C[(x+1) mod 5], 1)
+
+    vprolq      \$1, %ymm26, %ymm30
+    vprolq      \$1, %ymm27, %ymm31
+    vpternlogq  \$0x96, %ymm24, %ymm19, %ymm29
+
+    # Continue computing D values and apply Theta
+    # for x in 0 to 4:
+    #     for y in 0 to 4:
+    #         state[x][y] = state[x][y] XOR D[x]
+
+    vpternlogq  \$0x96, %ymm30, %ymm29, %ymm0
+    vpternlogq  \$0x96, %ymm30, %ymm29, %ymm10
+    vpternlogq  \$0x96, %ymm30, %ymm29, %ymm20
+
+    vpternlogq  \$0x96, %ymm30, %ymm29, %ymm5
+    vpternlogq  \$0x96, %ymm30, %ymm29, %ymm15
+    vprolq      \$1, %ymm28, %ymm30
+
+    vpternlogq  \$0x96, %ymm31, %ymm25, %ymm6
+    vpternlogq  \$0x96, %ymm31, %ymm25, %ymm16
+    vpternlogq  \$0x96, %ymm31, %ymm25, %ymm1
+
+    vpternlogq  \$0x96, %ymm31, %ymm25, %ymm11
+    vpternlogq  \$0x96, %ymm31, %ymm25, %ymm21
+    vprolq      \$1, %ymm29, %ymm31
+
+    vpbroadcastq    ($tblptr), %ymm29 # Load the round constant into ymm29 (Iota)
+    add         \$8, $tblptr          # Increment the pointer to the next round constant
+
+    vpternlogq  \$0x96, %ymm30, %ymm26, %ymm12
+    vpternlogq  \$0x96, %ymm30, %ymm26, %ymm7
+    vpternlogq  \$0x96, %ymm30, %ymm26, %ymm22
+
+    vpternlogq  \$0x96, %ymm30, %ymm26, %ymm17
+    vpternlogq  \$0x96, %ymm30, %ymm26, %ymm2
+    vprolq      \$1, %ymm25, %ymm30
+
+    # Rho step
+    # Keep applying Theta and start Rho step
+    #
+    # ROTATION_OFFSETS[5][5] = [
+    #     [0, 1, 62, 28, 27],
+    #     [36, 44, 6, 55, 20],
+    #     [3, 10, 43, 25, 39],
+    #     [41, 45, 15, 21, 8],
+    #     [18, 2, 61, 56, 14] ]
+    #
+    # for x in 0 to 4:
+    #     for y in 0 to 4:
+    #         state[x][y] = ROTATE_LEFT(state[x][y], ROTATION_OFFSETS[x][y])
+
+    vpternlogq  \$0x96, %ymm31, %ymm27, %ymm3
+    vpternlogq  \$0x96, %ymm31, %ymm27, %ymm13
+    vpternlogq  \$0x96, %ymm31, %ymm27, %ymm23
+
+    vprolq      \$44, %ymm6, %ymm6
+    vpternlogq  \$0x96, %ymm31, %ymm27, %ymm18
+    vpternlogq  \$0x96, %ymm31, %ymm27, %ymm8
+
+    vprolq      \$43, %ymm12, %ymm12
+    vprolq      \$21, %ymm18, %ymm18
+    vpternlogq  \$0x96, %ymm30, %ymm28, %ymm24
+
+    vprolq      \$14, %ymm24, %ymm24
+    vprolq      \$28, %ymm3, %ymm3
+    vpternlogq  \$0x96, %ymm30, %ymm28, %ymm9
+
+    vprolq      \$20, %ymm9, %ymm9
+    vprolq      \$3, %ymm10, %ymm10
+    vpternlogq  \$0x96, %ymm30, %ymm28, %ymm19
+
+    vprolq      \$45, %ymm16, %ymm16
+    vprolq      \$61, %ymm22, %ymm22
+    vpternlogq  \$0x96, %ymm30, %ymm28, %ymm4
+
+    vprolq      \$1, %ymm1, %ymm1
+    vprolq      \$6, %ymm7, %ymm7
+    vpternlogq  \$0x96, %ymm30, %ymm28, %ymm14
+
+    # Continue with Rho and start Pi and Chi steps at the same time
+    # Ternary logic 0xD2 is used for Chi step
+    #
+    # for x in 0 to 4:
+    #     for y in 0 to 4:
+    #         state[x][y] = state[x][y] XOR ((NOT state[(x+1) mod 5][y]) AND state[(x+2) mod 5][y])
+
+    vprolq      \$25, %ymm13, %ymm13
+    vprolq      \$8, %ymm19, %ymm19
+    vmovdqa64   %ymm0, %ymm30
+    vpternlogq  \$0xD2, %ymm12, %ymm6, %ymm30
+
+    vprolq      \$18, %ymm20, %ymm20
+    vprolq      \$27, %ymm4, %ymm4
+    vpxorq      %ymm29, %ymm30, %ymm30 # Iota step
+
+    vprolq      \$36, %ymm5, %ymm5
+    vprolq      \$10, %ymm11, %ymm11
+    vmovdqa64   %ymm6, %ymm31
+    vpternlogq  \$0xD2, %ymm18, %ymm12, %ymm31
+
+    vprolq      \$15, %ymm17, %ymm17
+    vprolq      \$56, %ymm23, %ymm23
+    vpternlogq  \$0xD2, %ymm24, %ymm18, %ymm12
+
+    vprolq      \$62, %ymm2, %ymm2
+    vprolq      \$55, %ymm8, %ymm8
+    vpternlogq  \$0xD2, %ymm0, %ymm24, %ymm18
+
+    vprolq      \$39, %ymm14, %ymm14
+    vprolq      \$41, %ymm15, %ymm15
+    vpternlogq  \$0xD2, %ymm6, %ymm0, %ymm24
+    vmovdqa64   %ymm30, %ymm0
+    vmovdqa64   %ymm31, %ymm6
+
+    vprolq      \$2, %ymm21, %ymm21
+    vmovdqa64   %ymm3, %ymm30
+    vpternlogq  \$0xD2, %ymm10, %ymm9, %ymm30
+    vmovdqa64   %ymm9, %ymm31
+    vpternlogq  \$0xD2, %ymm16, %ymm10, %ymm31
+
+    vpternlogq  \$0xD2, %ymm22, %ymm16, %ymm10
+    vpternlogq  \$0xD2, %ymm3, %ymm22, %ymm16
+    vpternlogq  \$0xD2, %ymm9, %ymm3, %ymm22
+    vmovdqa64   %ymm30, %ymm3
+    vmovdqa64   %ymm31, %ymm9
+
+    vmovdqa64   %ymm1, %ymm30
+    vpternlogq  \$0xD2, %ymm13, %ymm7, %ymm30
+    vmovdqa64   %ymm7, %ymm31
+    vpternlogq  \$0xD2, %ymm19, %ymm13, %ymm31
+    vpternlogq  \$0xD2, %ymm20, %ymm19, %ymm13
+
+    vpternlogq  \$0xD2, %ymm1, %ymm20, %ymm19
+    vpternlogq  \$0xD2, %ymm7, %ymm1, %ymm20
+    vmovdqa64   %ymm30, %ymm1
+    vmovdqa64   %ymm31, %ymm7
+    vmovdqa64   %ymm4, %ymm30
+    vpternlogq  \$0xD2, %ymm11, %ymm5, %ymm30
+
+    vmovdqa64   %ymm5, %ymm31
+    vpternlogq  \$0xD2, %ymm17, %ymm11, %ymm31
+    vpternlogq  \$0xD2, %ymm23, %ymm17, %ymm11
+    vpternlogq  \$0xD2, %ymm4, %ymm23, %ymm17
+
+    vpternlogq  \$0xD2, %ymm5, %ymm4, %ymm23
+    vmovdqa64   %ymm30, %ymm4
+    vmovdqa64   %ymm31, %ymm5
+    vmovdqa64   %ymm2, %ymm30
+    vpternlogq  \$0xD2, %ymm14, %ymm8, %ymm30
+    vmovdqa64   %ymm8, %ymm31
+    vpternlogq  \$0xD2, %ymm15, %ymm14, %ymm31
+
+    vpternlogq  \$0xD2, %ymm21, %ymm15, %ymm14
+    vpternlogq  \$0xD2, %ymm2, %ymm21, %ymm15
+    vpternlogq  \$0xD2, %ymm8, %ymm2, %ymm21
+    vmovdqa64   %ymm30, %ymm2
+    vmovdqa64   %ymm31, %ymm8
+
+    # Complete the steps and get updated state registers in ymm0 to ymm24
+    vmovdqa64   %ymm3,  %ymm30
+    vmovdqa64   %ymm18, %ymm3
+    vmovdqa64   %ymm17, %ymm18
+    vmovdqa64   %ymm11, %ymm17
+    vmovdqa64   %ymm7,  %ymm11
+    vmovdqa64   %ymm10, %ymm7
+    vmovdqa64   %ymm1,  %ymm10
+    vmovdqa64   %ymm6,  %ymm1
+    vmovdqa64   %ymm9,  %ymm6
+    vmovdqa64   %ymm22, %ymm9
+    vmovdqa64   %ymm14, %ymm22
+    vmovdqa64   %ymm20, %ymm14
+    vmovdqa64   %ymm2,  %ymm20
+    vmovdqa64   %ymm12, %ymm2
+    vmovdqa64   %ymm13, %ymm12
+    vmovdqa64   %ymm19, %ymm13
+    vmovdqa64   %ymm23, %ymm19
+    vmovdqa64   %ymm15, %ymm23
+    vmovdqa64   %ymm4,  %ymm15
+    vmovdqa64   %ymm24, %ymm4
+    vmovdqa64   %ymm21, %ymm24
+    vmovdqa64   %ymm8,  %ymm21
+    vmovdqa64   %ymm16, %ymm8
+    vmovdqa64   %ymm5,  %ymm16
+    vmovdqa64   %ymm30, %ymm5
+
+    dec         $roundn           # Decrement the round counter
+    jnz         .Lkeccak_rnd_loop # Jump to the start of the loop if r13d is not zero
+    ret
+.cfi_endproc
+.size   keccak_1600_permute,.-keccak_1600_permute
+
+# Initialize YMM registers 0-24 to zero
+.globl  keccak_1600_init_state
+.type   keccak_1600_init_state,\@abi-omnipotent
+.align  32
+keccak_1600_init_state:
+.cfi_startproc
+    vpxorq      %ymm0, %ymm0, %ymm0
+    vmovdqa64   %ymm0, %ymm1
+    vmovdqa64   %ymm0, %ymm2
+    vmovdqa64   %ymm0, %ymm3
+    vmovdqa64   %ymm0, %ymm4
+    vmovdqa64   %ymm0, %ymm5
+    vmovdqa64   %ymm0, %ymm6
+    vmovdqa64   %ymm0, %ymm7
+    vmovdqa64   %ymm0, %ymm8
+    vmovdqa64   %ymm0, %ymm9
+    vmovdqa64   %ymm0, %ymm10
+    vmovdqa64   %ymm0, %ymm11
+    vmovdqa64   %ymm0, %ymm12
+    vmovdqa64   %ymm0, %ymm13
+    vmovdqa64   %ymm0, %ymm14
+    vmovdqa64   %ymm0, %ymm15
+    vmovdqa64   %ymm0, %ymm16
+    vmovdqa64   %ymm0, %ymm17
+    vmovdqa64   %ymm0, %ymm18
+    vmovdqa64   %ymm0, %ymm19
+    vmovdqa64   %ymm0, %ymm20
+    vmovdqa64   %ymm0, %ymm21
+    vmovdqa64   %ymm0, %ymm22
+    vmovdqa64   %ymm0, %ymm23
+    vmovdqa64   %ymm0, %ymm24
+    ret
+.cfi_endproc
+.size   keccak_1600_init_state,.-keccak_1600_init_state
+
+.globl  keccak_1600_load_state_x4
+.type   keccak_1600_load_state_x4,\@abi-omnipotent
+.align  32
+keccak_1600_load_state_x4:
+.cfi_startproc
+    vmovdqu64   32*0($arg1),  %ymm0
+    vmovdqu64   32*1($arg1),  %ymm1
+    vmovdqu64   32*2($arg1),  %ymm2
+    vmovdqu64   32*3($arg1),  %ymm3
+    vmovdqu64   32*4($arg1),  %ymm4
+    vmovdqu64   32*5($arg1),  %ymm5
+    vmovdqu64   32*6($arg1),  %ymm6
+    vmovdqu64   32*7($arg1),  %ymm7
+    vmovdqu64   32*8($arg1),  %ymm8
+    vmovdqu64   32*9($arg1),  %ymm9
+    vmovdqu64   32*10($arg1), %ymm10
+    vmovdqu64   32*11($arg1), %ymm11
+    vmovdqu64   32*12($arg1), %ymm12
+    vmovdqu64   32*13($arg1), %ymm13
+    vmovdqu64   32*14($arg1), %ymm14
+    vmovdqu64   32*15($arg1), %ymm15
+    vmovdqu64   32*16($arg1), %ymm16
+    vmovdqu64   32*17($arg1), %ymm17
+    vmovdqu64   32*18($arg1), %ymm18
+    vmovdqu64   32*19($arg1), %ymm19
+    vmovdqu64   32*20($arg1), %ymm20
+    vmovdqu64   32*21($arg1), %ymm21
+    vmovdqu64   32*22($arg1), %ymm22
+    vmovdqu64   32*23($arg1), %ymm23
+    vmovdqu64   32*24($arg1), %ymm24
+    ret
+.cfi_endproc
+.size   keccak_1600_load_state_x4,.-keccak_1600_load_state_x4
+
+
+.globl  keccak_1600_save_state_x4
+.type   keccak_1600_save_state_x4,\@abi-omnipotent
+.align  32
+keccak_1600_save_state_x4:
+.cfi_startproc
+    vmovdqu64   %ymm0,  32*0($arg1)
+    vmovdqu64   %ymm1,  32*1($arg1)
+    vmovdqu64   %ymm2,  32*2($arg1)
+    vmovdqu64   %ymm3,  32*3($arg1)
+    vmovdqu64   %ymm4,  32*4($arg1)
+    vmovdqu64   %ymm5,  32*5($arg1)
+    vmovdqu64   %ymm6,  32*6($arg1)
+    vmovdqu64   %ymm7,  32*7($arg1)
+    vmovdqu64   %ymm8,  32*8($arg1)
+    vmovdqu64   %ymm9,  32*9($arg1)
+    vmovdqu64   %ymm10, 32*10($arg1)
+    vmovdqu64   %ymm11, 32*11($arg1)
+    vmovdqu64   %ymm12, 32*12($arg1)
+    vmovdqu64   %ymm13, 32*13($arg1)
+    vmovdqu64   %ymm14, 32*14($arg1)
+    vmovdqu64   %ymm15, 32*15($arg1)
+    vmovdqu64   %ymm16, 32*16($arg1)
+    vmovdqu64   %ymm17, 32*17($arg1)
+    vmovdqu64   %ymm18, 32*18($arg1)
+    vmovdqu64   %ymm19, 32*19($arg1)
+    vmovdqu64   %ymm20, 32*20($arg1)
+    vmovdqu64   %ymm21, 32*21($arg1)
+    vmovdqu64   %ymm22, 32*22($arg1)
+    vmovdqu64   %ymm23, 32*23($arg1)
+    vmovdqu64   %ymm24, 32*24($arg1)
+    ret
+.cfi_endproc
+.size   keccak_1600_save_state_x4,.-keccak_1600_save_state_x4
+
+
+# Add input data to state when message length is less than rate
+# Arguments:
+#   r10:        state pointer to absorb into (clobbered)
+#   arg2 (rsi): message pointer lane 0 (updated on output)
+#   arg3 (rdx): message pointer lane 1 (updated on output)
+#   arg4 (rcx): message pointer lane 2 (updated on output)
+#   arg5 (r8):  message pointer lane 3 (updated on output)
+#   r12:        length in bytes (clobbered on output)
+# Clobbers: r9, rbx, r15, k1, ymm31-ymm29
+.globl  keccak_1600_partial_add_x4
+.type   keccak_1600_partial_add_x4,\@abi-omnipotent
+.align  32
+keccak_1600_partial_add_x4:
+.cfi_startproc
+    mov     8*100(%r10), %r9
+    test    \$7, %r9d
+    jz      .Lstart_aligned_to_4x8
+
+    # Start offset is not aligned to register size
+    mov     %r9, %r15 # %r15 = s[100]
+
+    and     \$7, %r9d
+    neg     %r9d
+    add     \$8, %r9d     # register capacity = 8 - (offset % 8)
+    cmp     %r9d, %r12d
+    cmovnae   %r12d, %r9d # %r9d = min(register capacity, length)
+
+    lea     byte_kmask_0_to_7(%rip), %rbx
+    kmovb   (%rbx,%r9), %k1 # message load mask
+
+    mov     %r15, %rbx
+    and     \$~7, %ebx
+    lea     (%r10,%rbx,4), %r10 # get to state starting register
+
+    mov     %r15, %rbx
+    and     \$7, %ebx
+
+    vmovdqu8    (%r10), %ymm31 # load & store / allocate SB for the register
+    vmovdqu8    %ymm31, (%r10)
+
+    vmovdqu8    ($arg2), %xmm31{%k1}{z}        # Read 1 to 7 bytes from lane 0
+    vmovdqu8    8*0(%r10,%rbx), %xmm30{%k1}{z} # Read 1 to 7 bytes from state reg lane 0
+    vpxorq      %xmm30, %xmm31, %xmm31
+    vmovdqu8    %xmm31, 8*0(%r10,%rbx){%k1}    # Write 1 to 7 bytes to state reg lane 0
+
+    vmovdqu8    ($arg3), %xmm31{%k1}{z}        # Read 1 to 7 bytes from lane 1
+    vmovdqu8    8*1(%r10,%rbx), %xmm30{%k1}{z} # Read 1 to 7 bytes from state reg lane 1
+    vpxorq      %xmm30, %xmm31, %xmm31
+    vmovdqu8    %xmm31, 8*1(%r10,%rbx){%k1}    # Write 1 to 7 bytes to state reg lane 1
+
+    vmovdqu8    ($arg4), %xmm31{%k1}{z}        # Read 1 to 7 bytes from lane 2
+    vmovdqu8    8*2(%r10,%rbx), %xmm30{%k1}{z} # Read 1 to 7 bytes from state reg lane 2
+    vpxorq      %xmm30, %xmm31, %xmm31
+    vmovdqu8    %xmm31, 8*2(%r10,%rbx){%k1}    # Write 1 to 7 bytes to state reg lane 2
+
+    vmovdqu8    ($arg5), %xmm31{%k1}{z}        # Read 1 to 7 bytes from lane 3
+    vmovdqu8    8*3(%r10,%rbx), %xmm30{%k1}{z} # Read 1 to 7 bytes from state reg lane 3
+    vpxorq      %xmm30, %xmm31, %xmm31
+    vmovdqu8    %xmm31, 8*3(%r10,%rbx){%k1}    # Write 1 to 7 bytes to state reg lane 3
+
+    sub     %r9, %r12
+    jz      .Lzero_bytes
+
+    add     %r9, $arg2
+    add     %r9, $arg3
+    add     %r9, $arg4
+    add     %r9, $arg5
+    add     \$32, %r10
+    xor     %r9, %r9
+    jmp     .Lymm_loop
+
+.Lstart_aligned_to_4x8:
+    lea     (%r10,%r9,4), %r10
+    xor     %r9, %r9
+
+.align  32
+.Lymm_loop:
+    cmp     \$8, %r12d
+    jb      .Llt_8_bytes
+
+    vmovq       ($arg2,%r9), %xmm31              # Read 8 bytes from lane 0
+    vpinsrq     \$1, ($arg3,%r9), %xmm31, %xmm31 # Read 8 bytes from lane 1
+    vmovq       ($arg4,%r9), %xmm30              # Read 8 bytes from lane 2
+    vpinsrq     \$1, ($arg5,%r9),%xmm30, %xmm30  # Read 8 bytes from lane 3
+    vinserti32x4 \$1, %xmm30, %ymm31, %ymm31
+    vpxorq      (%r10,%r9,4), %ymm31, %ymm31     # Add data with the state
+    vmovdqu64   %ymm31, (%r10,%r9,4)
+    add     \$8, %r9
+    sub     \$8, %r12
+    jz      .Lzero_bytes
+
+    jmp     .Lymm_loop
+
+.align  32
+.Lzero_bytes:
+    add     %r9, $arg2
+    add     %r9, $arg3
+    add     %r9, $arg4
+    add     %r9, $arg5
+    ret
+
+.align  32
+.Llt_8_bytes:
+    add     %r9, $arg2
+    add     %r9, $arg3
+    add     %r9, $arg4
+    add     %r9, $arg5
+    lea     (%r10,%r9,4), %r10
+
+    lea     byte_kmask_0_to_7(%rip), %rbx
+    kmovb   (%rbx,%r12), %k1 # message load mask
+
+    vmovdqu8    ($arg2), %xmm31{%k1}{z} # Read 1 to 7 bytes from lane 0
+    vmovdqu8    ($arg3), %xmm30{%k1}{z} # Read 1 to 7 bytes from lane 1
+    vpunpcklqdq %xmm30, %xmm31, %xmm31  # Interleave data from lane 0 and lane 1
+    vmovdqu8    ($arg4), %xmm30{%k1}{z} # Read 1 to 7 bytes from lane 2
+    vmovdqu8    ($arg5), %xmm29{%k1}{z} # Read 1 to 7 bytes from lane 3
+    vpunpcklqdq %xmm29, %xmm30, %xmm30  # Interleave data from lane 2 and lane 3
+    vinserti32x4 \$1, %xmm30, %ymm31, %ymm31
+
+    vpxorq      (%r10), %ymm31, %ymm31 # Add data to the state
+    vmovdqu64   %ymm31, (%r10)         # Update state in memory
+
+    add     %r12, $arg2 # increment message pointer lane 0
+    add     %r12, $arg3 # increment message pointer lane 1
+    add     %r12, $arg4 # increment message pointer lane 2
+    add     %r12, $arg5 # increment message pointer lane 3
+    ret
+.cfi_endproc
+.size   keccak_1600_partial_add_x4,.-keccak_1600_partial_add_x4
+
+
+# Extract bytes from state and write to outputs
+# Arguments:
+#   r10:        state pointer to start extracting from (clobbered)
+#   arg1 (rdi): output pointer lane 0 (updated on output)
+#   arg2 (rsi): output pointer lane 1 (updated on output)
+#   arg3 (rdx): output pointer lane 2 (updated on output)
+#   arg4 (rcx): output pointer lane 3 (updated on output)
+#   r12:        length in bytes (clobbered on output)
+#   r11:        state offset to start extract from
+.globl  keccak_1600_extract_bytes_x4
+.type   keccak_1600_extract_bytes_x4,\@abi-omnipotent
+.align  32
+keccak_1600_extract_bytes_x4:
+.cfi_startproc
+    or      %r12, %r12
+    jz      .Lextract_zero_bytes
+
+    test    \$7, %r11d
+    jz      .Lextract_start_aligned_to_4x8
+
+    # Extract offset is not aligned to the register size (8 bytes)
+    mov     %r11, %r9
+
+    and     \$7, %r9d
+    neg     %r9d
+    add     \$8, %r9d     # register capacity = 8 - (offset % 8)
+    cmp     %r9d, %r12d
+    cmovnae   %r12d, %r9d # %r9d = min(register capacity, length)
+
+    lea     byte_kmask_0_to_7(%rip), %rbx
+    kmovb   (%rbx,%r9), %k1 # message store mask
+
+    mov     %r11, %rbx
+    and     \$~7, %ebx
+    lea     (%r10,%rbx,4), %r10 # get to state starting register
+
+    mov     %r11, %rbx
+    and     \$7, %ebx
+
+    vmovdqu8    8*0(%r10,%rbx), %xmm31{%k1}{z} # Read 1-7 bytes from state reg lane 0
+    vmovdqu8    %xmm31, ($arg1){%k1}           # Write 1-7 bytes to lane 0 output
+
+    vmovdqu8    8*1(%r10,%rbx), %xmm31{%k1}{z} # Read 1-7 bytes from state reg lane 1
+    vmovdqu8    %xmm31, ($arg2){%k1}           # Write 1-7 bytes to lane 1 output
+
+    vmovdqu8    8*2(%r10,%rbx), %xmm31{%k1}{z} # Read 1-7 bytes from state reg lane 2
+    vmovdqu8    %xmm31, ($arg3){%k1}           # Write 1-7 bytes to lane 2 output
+
+    vmovdqu8    8*3(%r10,%rbx), %xmm31{%k1}{z} # Read 1-7 bytes from state reg lane 3
+    vmovdqu8    %xmm31, ($arg4){%k1}           # Write 1-7 bytes to lane 3 output
+
+    # Increment output registers
+    add     %r9, $arg1
+    add     %r9, $arg2
+    add     %r9, $arg3
+    add     %r9, $arg4
+
+    # Decrement length to extract
+    sub     %r9, %r12
+    jz      .Lextract_zero_bytes
+
+    # More data to extract, update state register pointer
+    add     \$32, %r10
+    xor     %r9, %r9
+    jmp     .Lextract_ymm_loop
+
+.Lextract_start_aligned_to_4x8:
+        lea     (%r10,%r11,4), %r10
+        xor     %r9, %r9
+
+.align  32
+.Lextract_ymm_loop:
+    cmp     \$8, %r12
+    jb      .Lextract_lt_8_bytes
+
+    vmovdqu64   (%r10), %xmm31
+    vmovdqu64   16(%r10), %xmm30
+    vmovq       %xmm31, ($arg1,%r9)
+    vpextrq     \$1, %xmm31, ($arg2,%r9)
+    vmovq       %xmm30, ($arg3,%r9)
+    vpextrq     \$1, %xmm30, ($arg4,%r9)
+    add     \$8, %r9
+    sub     \$8, %r12
+    jz      .Lzero_bytes_left
+
+    add     \$32, %r10
+    jmp     .Lextract_ymm_loop
+
+.align  32
+.Lzero_bytes_left:
+    # Increment output pointers
+    add     %r9, $arg1
+    add     %r9, $arg2
+    add     %r9, $arg3
+    add     %r9, $arg4
+.Lextract_zero_bytes:
+    ret
+
+.align  32
+.Lextract_lt_8_bytes:
+    add     %r9, $arg1
+    add     %r9, $arg2
+    add     %r9, $arg3
+    add     %r9, $arg4
+
+    lea     byte_kmask_0_to_7(%rip), %r9
+    kmovb   (%r9,%r12), %k1 # k1 is the mask of message bytes to read
+
+    vmovq       0*8(%r10), %xmm31    # Read 8 bytes from state lane 0
+    vmovdqu8    %xmm31, ($arg1){%k1} # Extract 1-7 bytes into output 0
+    vmovq       1*8(%r10), %xmm31    # Read 8 bytes from state lane 1
+    vmovdqu8    %xmm31, ($arg2){%k1} # Extract 1-7 bytes into output 1
+    vmovq       2*8(%r10), %xmm31    # Read 8 bytes from state lane 2
+    vmovdqu8    %xmm31, ($arg3){%k1} # Extract 1-7 bytes into output 2
+    vmovq       3*8(%r10), %xmm31    # Read 8 bytes from state lane 3
+    vmovdqu8    %xmm31, ($arg4){%k1} # Extract 1-7 bytes into output 3
+
+    # Increment output pointers
+    add     %r12, $arg1
+    add     %r12, $arg2
+    add     %r12, $arg3
+    add     %r12, $arg4
+    ret
+.cfi_endproc
+.size   keccak_1600_extract_bytes_x4,.-keccak_1600_extract_bytes_x4
+
+
+# SHAKE128 x4 multi-buffer functions
+# These functions process 4 independent SHAKE128 streams in parallel using AVX-512VL
+# State layout: 25 ymm registers (200 bytes each) + 1 qword = 808 bytes per context
+# Rate: 168 bytes for SHAKE128
+
+# SHA3_shake128_x4_avx512vl
+# One-shot SHAKE-128 x4 function: init + absorb + finalize + squeeze
+# Arguments:
+#   arg1 (rdi): pointer to output lane 0
+#   arg2 (rsi): pointer to output lane 1
+#   arg3 (rdx): pointer to output lane 2
+#   arg4 (rcx): pointer to output lane 3
+#   arg5 (r8):  output length in bytes (must be same for all lanes)
+#   arg6 (r9):  pointer to input lane 0
+#   [stack+0]:  pointer to input lane 1
+#   [stack+8]:  pointer to input lane 2
+#   [stack+16]: pointer to input lane 3
+#   [stack+24]: input length in bytes (must be same for all lanes)
+# Returns: void
+.globl  SHA3_shake128_x4_avx512vl
+.type   SHA3_shake128_x4_avx512vl,\@function,10
+.align  32
+SHA3_shake128_x4_avx512vl:
+.cfi_startproc
+    push    %rbp
+.cfi_push       %rbp
+    mov     %rsp, %rbp
+    push    %rbx
+.cfi_push       %rbx
+___
+$code .= <<___ if ($win64);
+    sub     \$160, %rsp
+    vmovups %xmm6,   0(%rsp)
+    vmovups %xmm7,   16(%rsp)
+    vmovups %xmm8,   32(%rsp)
+    vmovups %xmm9,   48(%rsp)
+    vmovups %xmm10,  64(%rsp)
+    vmovups %xmm11,  80(%rsp)
+    vmovups %xmm12,  96(%rsp)
+    vmovups %xmm13,  112(%rsp)
+    vmovups %xmm14,  128(%rsp)
+    vmovups %xmm15,  144(%rsp)
+___
+$code.=<<___;
+
+    sub     \$$sf_size, %rsp
+    mov     %rsp, %rbx
+
+.Lshake128_x4_body:
+    mov     $arg1, $sf_arg1(%rbx)
+    mov     $arg2, $sf_arg2(%rbx)
+    mov     $arg3, $sf_arg3(%rbx)
+    mov     $arg4, $sf_arg4(%rbx)
+    mov     $arg5, $sf_arg5(%rbx)
+
+    lea     $sf_state_x4(%rbx), $arg1 # start of x4 state on the stack frame
+    mov     $arg1, $sf_state_ptr(%rbx)
+
+    # Initialize the state array to zero
+    call    keccak_1600_init_state
+
+    call    keccak_1600_save_state_x4
+
+    movq    \$0, 8*100($arg1) # clear s[100]
+
+    mov     $sf_state_ptr(%rbx), $arg1
+    mov     $arg6, $arg2
+___
+$code .= <<___ if ($win64);
+    # xlate prologue handles up to six arguments. For one-shot x4 wrappers
+    # (10 args), the remaining four stay in Win64 stack slots.
+    mov     64(%rbp), $arg3 # arg7 from stack
+    mov     72(%rbp), $arg4 # arg8 from stack
+    mov     80(%rbp), $arg5 # arg9 from stack
+    mov     88(%rbp), $arg6 # arg10 from stack
+___
+$code .= <<___ if (!$win64);
+    mov     16(%rbp), $arg3 # arg7 from stack
+    mov     24(%rbp), $arg4 # arg8 from stack
+    mov     32(%rbp), $arg5 # arg9 from stack
+    mov     40(%rbp), $arg6 # arg10 from stack
+___
+$code.=<<___;
+    # Internal entry avoids Win64 xlate prologue argument remapping.
+___
+$code .= call_internal("SHA3_shake128_x4_inc_absorb_avx512vl_internal");
+$code.=<<___;
+
+    mov     $sf_state_ptr(%rbx), $arg1
+    call    .L_SHA3_shake128_x4_inc_finalize_avx512vl
+
+    # squeeze
+    mov     $sf_arg1(%rbx), $arg1
+    mov     $sf_arg2(%rbx), $arg2
+    mov     $sf_arg3(%rbx), $arg3
+    mov     $sf_arg4(%rbx), $arg4
+    mov     $sf_arg5(%rbx), $arg5
+    mov     $sf_state_ptr(%rbx), $arg6
+___
+$code .= call_internal("SHA3_shake128_x4_inc_squeeze_avx512vl_internal");
+$code.=<<___;
+
+    # Clear the temporary buffer
+    lea     $sf_state_x4(%rbx), %r9
+    vpxorq      %ymm31, %ymm31, %ymm31
+    vmovdqu64   %ymm31, 32*0(%r9)
+    vmovdqu64   %ymm31, 32*1(%r9)
+    vmovdqu64   %ymm31, 32*2(%r9)
+    vmovdqu64   %ymm31, 32*3(%r9)
+    vmovdqu64   %ymm31, 32*4(%r9)
+    vmovdqu64   %ymm31, 32*5(%r9)
+    vmovdqu64   %ymm31, 32*6(%r9)
+    vmovdqu64   %ymm31, 32*7(%r9)
+    vmovdqu64   %ymm31, 32*8(%r9)
+    vmovdqu64   %ymm31, 32*9(%r9)
+    vmovdqu64   %ymm31, 32*10(%r9)
+    vmovdqu64   %ymm31, 32*11(%r9)
+    vmovdqu64   %ymm31, 32*12(%r9)
+    vmovdqu64   %ymm31, 32*13(%r9)
+    vmovdqu64   %ymm31, 32*14(%r9)
+    vmovdqu64   %ymm31, 32*15(%r9)
+    vmovdqu64   %ymm31, 32*16(%r9)
+    vmovdqu64   %ymm31, 32*17(%r9)
+    vmovdqu64   %ymm31, 32*18(%r9)
+    vmovdqu64   %ymm31, 32*19(%r9)
+    vmovdqu64   %ymm31, 32*20(%r9)
+    vmovdqu64   %ymm31, 32*21(%r9)
+    vmovdqu64   %ymm31, 32*22(%r9)
+    vmovdqu64   %ymm31, 32*23(%r9)
+    vmovdqu64   %ymm31, 32*24(%r9)
+    vmovq       %xmm31, 32*25(%r9)
+
+.Lshake128_x4_epilogue:
+___
+$code .= <<___ if ($win64);
+    vmovups $sf_size+0(%rsp),   %xmm6
+    vmovups $sf_size+16(%rsp),  %xmm7
+    vmovups $sf_size+32(%rsp),  %xmm8
+    vmovups $sf_size+48(%rsp),  %xmm9
+    vmovups $sf_size+64(%rsp),  %xmm10
+    vmovups $sf_size+80(%rsp),  %xmm11
+    vmovups $sf_size+96(%rsp),  %xmm12
+    vmovups $sf_size+112(%rsp), %xmm13
+    vmovups $sf_size+128(%rsp), %xmm14
+    vmovups $sf_size+144(%rsp), %xmm15
+    add     \$160, %rsp
+___
+$code.=<<___;
+    add     \$$sf_size, %rsp
+    pop     %rbx
+.cfi_pop        %rbx
+    pop     %rbp
+.cfi_pop        %rbp
+    ret
+.cfi_endproc
+.size   SHA3_shake128_x4_avx512vl,.-SHA3_shake128_x4_avx512vl
+
+___
+
+$code .= <<___ if ($win64);
+# Internal Win64 shim for absorb entry. It establishes xlate-compatible
+# unwind state and then jumps to the function entry after the prologue.
+# This is required for internal calls since the xlate ABI conversion
+# is already done in the caller function.
+.type   SHA3_shake128_x4_inc_absorb_avx512vl_internal,\@abi-omnipotent
+.align  32
+.LSEH_begin_SHA3_shake128_x4_inc_absorb_avx512vl_internal:
+SHA3_shake128_x4_inc_absorb_avx512vl_internal:
+    mov     %rsp, %rax
+    mov     $arg1, 8(%rsp)
+    mov     $arg2, 16(%rsp)
+    jmp     .L_SHA3_shake128_x4_inc_absorb_avx512vl
+.LSEH_end_SHA3_shake128_x4_inc_absorb_avx512vl_internal:
+.size   SHA3_shake128_x4_inc_absorb_avx512vl_internal,.-SHA3_shake128_x4_inc_absorb_avx512vl_internal
+___
+$code.=<<___;
+
+# SHA3_shake128_x4_inc_absorb_avx512vl
+# Absorb input data into 4 parallel SHAKE128 states
+# Arguments:
+#   arg1 (rdi): pointer to state context (808 bytes)
+#   arg2 (rsi): pointer to lane 0 input data
+#   arg3 (rdx): pointer to lane 1 input data
+#   arg4 (rcx): pointer to lane 2 input data
+#   arg5 (r8):  pointer to lane 3 input data
+#   arg6 (r9):  input length in bytes (must be same for all lanes)
+# Returns: void
+# Note: Input is XORed into state and Keccak permutation is applied for each rate-sized block
+.globl  SHA3_shake128_x4_inc_absorb_avx512vl
+.type   SHA3_shake128_x4_inc_absorb_avx512vl,\@function,6
+.align  32
+SHA3_shake128_x4_inc_absorb_avx512vl:
+.L_SHA3_shake128_x4_inc_absorb_avx512vl:
+.cfi_startproc
+        push    %rbp
+.cfi_push       %rbp
+        push    %rbx
+.cfi_push       %rbx
+        push    %r12
+.cfi_push       %r12
+        push    %r13
+.cfi_push       %r13
+        push    %r14
+.cfi_push       %r14
+        push    %r15
+.cfi_push       %r15
+___
+$code .= <<___ if ($win64);
+    sub     \$160, %rsp
+    vmovups %xmm6,   0(%rsp)
+    vmovups %xmm7,   16(%rsp)
+    vmovups %xmm8,   32(%rsp)
+    vmovups %xmm9,   48(%rsp)
+    vmovups %xmm10,  64(%rsp)
+    vmovups %xmm11,  80(%rsp)
+    vmovups %xmm12,  96(%rsp)
+    vmovups %xmm13,  112(%rsp)
+    vmovups %xmm14,  128(%rsp)
+    vmovups %xmm15,  144(%rsp)
+___
+$code.=<<___;
+
+.Lshake128_absorb_body:
+    # check for partially processed block
+    mov     8*100($arg1), %r14
+    or      %r14, %r14 # s[100] == 0?
+    je      .Lshake128_absorb_main_loop_start
+
+    # process remaining bytes if message long enough
+    mov     \$168, %r12 # SHAKE128_RATE = 168
+    sub     %r14, %r12  # %r12 = capacity
+
+    cmp     %r12, $arg6 # if mlen <= capacity then no permute
+    jbe     .Lshake128_absorb_skip_permute
+
+    sub     %r12, $arg6
+    mov     $arg6, %r11 # preserve remaining length across helper calls
+
+    # r10/state, arg2-arg5/inputs, r12/length
+    mov     $arg1, %r10                # %r10 = state
+    call    keccak_1600_partial_add_x4 # arg2-arg5 are updated
+
+    call    keccak_1600_load_state_x4
+
+    call    keccak_1600_permute
+
+    movq    \$0, 8*100($arg1) # clear s[100]
+    jmp     .Lshake128_absorb_partial_block_done
+
+.Lshake128_absorb_skip_permute:
+    # r10/state, arg2-arg5/inputs, r12/length
+    mov     $arg1, %r10
+    mov     $arg6, %r12
+    mov     $arg6, %r11 # preserve input length across helper call
+    call    keccak_1600_partial_add_x4
+
+    lea     (%r11,%r14), %r15
+    mov     %r15, 8*100($arg1) # s[100] += inlen
+
+    cmp     \$168, %r15 # check s[100] below SHAKE128_RATE
+    jb      .Lshake128_absorb_exit
+
+    call    keccak_1600_load_state_x4
+
+    call    keccak_1600_permute
+
+    call    keccak_1600_save_state_x4
+
+    movq    \$0, 8*100($arg1) # clear s[100]
+    jmp     .Lshake128_absorb_exit
+
+.Lshake128_absorb_main_loop_start:
+    call    keccak_1600_load_state_x4
+    mov     $arg6, %r11 # full input length when no prior partial block
+
+.Lshake128_absorb_partial_block_done:
+    xor     %r12, %r12  # zero message offset
+
+    # Process the input message in blocks
+.align  32
+.Lshake128_absorb_while_loop:
+    cmp     \$168, %r11 # compare mlen to SHAKE128_RATE
+    jb      .Lshake128_absorb_while_loop_done
+
+    # Inline absorb_bytes_x4 for SHAKE128_RATE (168 bytes = 21 ymm registers)
+___
+
+# Generate absorb code for SHAKE128 rate (168 bytes)
+for (my $i = 0; $i < 21; $i++) {
+    my $offset = $i * 8;
+    $code.=<<___;
+        vmovq       $offset($arg2,%r12), %xmm31
+        vpinsrq     \$1, $offset($arg3,%r12), %xmm31, %xmm31
+        vmovq       $offset($arg4,%r12), %xmm30
+        vpinsrq     \$1, $offset($arg5,%r12), %xmm30, %xmm30
+        vinserti32x4 \$1, %xmm30, %ymm31, %ymm31
+        vpxorq      %ymm31, %ymm$i, %ymm$i
+___
+}
+
+$code.=<<___;
+    sub     \$168, %r11         # Subtract the rate from the remaining length
+    add     \$168, %r12         # Adjust offset to next block
+    call    keccak_1600_permute # Perform the Keccak permutation
+
+    jmp     .Lshake128_absorb_while_loop
+
+.align  32
+.Lshake128_absorb_while_loop_done:
+    call    keccak_1600_save_state_x4
+
+    mov     %r11, 8*100($arg1) # update s[100]
+    or      %r11, %r11
+    jz      .Lshake128_absorb_exit
+
+    movq    \$0, 8*100($arg1) # clear s[100]
+
+    # r10/state, arg2-arg5/input, r12/length
+    mov     $arg1, %r10
+    add     %r12, $arg2
+    add     %r12, $arg3
+    add     %r12, $arg4
+    add     %r12, $arg5
+    mov     %r11, %r12
+    call    keccak_1600_partial_add_x4
+
+    mov     %r11, 8*100($arg1) # update s[100]
+
+.Lshake128_absorb_exit:
+    # Clear sensitive registers
+    vpxorq      %xmm16, %xmm16, %xmm16
+    vmovdqa64   %ymm16, %ymm17
+    vmovdqa64   %ymm16, %ymm18
+    vmovdqa64   %ymm16, %ymm19
+    vmovdqa64   %ymm16, %ymm20
+    vmovdqa64   %ymm16, %ymm21
+    vmovdqa64   %ymm16, %ymm22
+    vmovdqa64   %ymm16, %ymm23
+    vmovdqa64   %ymm16, %ymm24
+    vmovdqa64   %ymm16, %ymm25
+    vmovdqa64   %ymm16, %ymm26
+    vmovdqa64   %ymm16, %ymm27
+    vmovdqa64   %ymm16, %ymm28
+    vmovdqa64   %ymm16, %ymm29
+    vmovdqa64   %ymm16, %ymm30
+    vmovdqa64   %ymm16, %ymm31
+.Lshake128_absorb_epilogue:
+    vzeroall
+___
+$code .= <<___ if ($win64);
+    vmovups 0(%rsp),   %xmm6
+    vmovups 16(%rsp),  %xmm7
+    vmovups 32(%rsp),  %xmm8
+    vmovups 48(%rsp),  %xmm9
+    vmovups 64(%rsp),  %xmm10
+    vmovups 80(%rsp),  %xmm11
+    vmovups 96(%rsp),  %xmm12
+    vmovups 112(%rsp), %xmm13
+    vmovups 128(%rsp), %xmm14
+    vmovups 144(%rsp), %xmm15
+    add     \$160, %rsp
+___
+$code.=<<___;
+
+    pop     %r15
+.cfi_pop        %r15
+    pop     %r14
+.cfi_pop        %r14
+    pop     %r13
+.cfi_pop        %r13
+    pop     %r12
+.cfi_pop        %r12
+    pop     %rbx
+.cfi_pop        %rbx
+    pop     %rbp
+.cfi_pop        %rbp
+    ret
+.cfi_endproc
+.size   SHA3_shake128_x4_inc_absorb_avx512vl,.-SHA3_shake128_x4_inc_absorb_avx512vl
+
+
+# SHA3_shake128_x4_inc_finalize_avx512vl
+# Finalize absorption phase for 4 parallel SHAKE-128 states
+# Adds padding and terminator bytes and clears the absorb offset
+# Arguments:
+#   arg1 (rdi): pointer to state context (808 bytes)
+# Returns: void
+# Note: After this call, state is ready for squeezing output
+.globl  SHA3_shake128_x4_inc_finalize_avx512vl
+.type   SHA3_shake128_x4_inc_finalize_avx512vl,\@function,1
+.align  32
+SHA3_shake128_x4_inc_finalize_avx512vl:
+.L_SHA3_shake128_x4_inc_finalize_avx512vl:
+.cfi_startproc
+    mov         8*100($arg1), %r11 # load state offset from s[100]
+    mov         %r11, %r10
+    and         \$~7, %r10d        # offset to the state register
+    and         \$7, %r11d         # offset within the register
+
+    # add EOM byte right after the message
+    vmovdqu32   ($arg1,%r10,4), %ymm31
+    lea         shake_msg_pad_x4(%rip), %r9
+    sub         %r11, %r9
+    vmovdqu32   (%r9), %ymm30
+    vpxorq      %ymm30, %ymm31, %ymm31
+    vmovdqu32   %ymm31, ($arg1,%r10,4)
+
+    # add terminating byte at offset equal to rate - 1 (SHAKE128_RATE = 168)
+    vmovdqu32   640($arg1), %ymm31 # 168*4 - 32 = 672 - 32 = 640
+    vmovdqa32   shake_terminator_byte_x4(%rip), %ymm30
+    vpxorq      %ymm30, %ymm31, %ymm31
+    vmovdqu32   %ymm31, 640($arg1)
+
+    movq        \$0, 8*100($arg1) # clear s[100]
+    vpxorq      %ymm31, %ymm31, %ymm31
+    ret
+.cfi_endproc
+.size   SHA3_shake128_x4_inc_finalize_avx512vl,.-SHA3_shake128_x4_inc_finalize_avx512vl
+
+___
+
+$code .= <<___ if ($win64);
+# Internal Win64 shim for squeeze entry. It establishes xlate-compatible
+# unwind state and then jumps to the function entry after the prologue.
+# This is required for internal calls since the xlate ABI conversion
+# is already done in the caller function.
+.type   SHA3_shake128_x4_inc_squeeze_avx512vl_internal,\@abi-omnipotent
+.align  32
+.LSEH_begin_SHA3_shake128_x4_inc_squeeze_avx512vl_internal:
+SHA3_shake128_x4_inc_squeeze_avx512vl_internal:
+    mov     %rsp, %rax
+    mov     $arg1, 8(%rsp)
+    mov     $arg2, 16(%rsp)
+    jmp     .L_SHA3_shake128_x4_inc_squeeze_avx512vl
+.LSEH_end_SHA3_shake128_x4_inc_squeeze_avx512vl_internal:
+.size   SHA3_shake128_x4_inc_squeeze_avx512vl_internal,.-SHA3_shake128_x4_inc_squeeze_avx512vl_internal
+___
+$code.=<<___;
+
+# SHA3_shake128_x4_inc_squeeze_avx512vl
+# Squeeze output from 4 parallel SHAKE128 states
+# Arguments:
+#   arg1 (rdi): pointer to lane 0 output buffer
+#   arg2 (rsi): pointer to lane 1 output buffer
+#   arg3 (rdx): pointer to lane 2 output buffer
+#   arg4 (rcx): pointer to lane 3 output buffer
+#   arg5 (r8):  output length in bytes (must be same for all lanes)
+#   arg6 (r9):  pointer to state context (808 bytes)
+# Returns: void
+# Note: Can be called multiple times to generate arbitrary-length output
+.globl  SHA3_shake128_x4_inc_squeeze_avx512vl
+.type   SHA3_shake128_x4_inc_squeeze_avx512vl,\@function,6
+.align  32
+SHA3_shake128_x4_inc_squeeze_avx512vl:
+.L_SHA3_shake128_x4_inc_squeeze_avx512vl:
+.cfi_startproc
+    push    %rbp
+.cfi_push       %rbp
+    push    %rbx
+.cfi_push       %rbx
+    push    %r12
+.cfi_push       %r12
+    push    %r13
+.cfi_push       %r13
+    push    %r14
+.cfi_push       %r14
+    push    %r15
+.cfi_push       %r15
+___
+$code .= <<___ if ($win64);
+    sub     \$160, %rsp
+    vmovups %xmm6,   0(%rsp)
+    vmovups %xmm7,   16(%rsp)
+    vmovups %xmm8,   32(%rsp)
+    vmovups %xmm9,   48(%rsp)
+    vmovups %xmm10,  64(%rsp)
+    vmovups %xmm11,  80(%rsp)
+    vmovups %xmm12,  96(%rsp)
+    vmovups %xmm13,  112(%rsp)
+    vmovups %xmm14,  128(%rsp)
+    vmovups %xmm15,  144(%rsp)
+___
+$code.=<<___;
+
+.Lshake128_squeeze_body:
+    or      $arg5, $arg5
+    jz      .Lshake128_squeeze_done
+
+    # check for partially processed block
+    mov     8*100($arg6), %r15 # s[100] - capacity
+    or      %r15, %r15
+    jnz     .Lshake128_squeeze_no_init_permute
+
+    mov     $arg1, %r14
+    mov     $arg6, $arg1
+    call    keccak_1600_load_state_x4
+
+    mov     %r14, $arg1
+
+    xor     %rbp, %rbp
+    jmp     .Lshake128_squeeze_loop
+
+.align  32
+.Lshake128_squeeze_no_init_permute:
+    # extract bytes: r10 - state/src, arg1-arg4 - output/dst, r12 - length = min(capacity, outlen), r11 - offset
+    mov     $arg6, %r10
+    mov     $arg6, %r14 # preserve state pointer across extract helper
+
+    mov     %r15, %r12
+    cmp     %r15, $arg5
+    cmovnae $arg5, %r12 # %r12 = min(capacity, outlen)
+
+    sub     %r12, $arg5 # outlen -= length
+
+    mov     \$168, %r11d # SHAKE128_RATE
+    sub     %r15, %r11   # state offset
+
+    sub     %r12, %r15         # capacity -= length
+    mov     %r15, 8*100($arg6) # update s[100]
+
+    call    keccak_1600_extract_bytes_x4
+    mov     %r14, $arg6        # restore state pointer after helper clobbers
+
+    or      %r15, %r15
+    jnz     .Lshake128_squeeze_done # check s[100] not zero
+
+    mov     $arg1, %r13 # preserve arg1
+    mov     %r14, $arg1
+    call    keccak_1600_load_state_x4
+
+    mov     %r13, $arg1
+    xor     %rbp, %rbp
+
+.align  32
+.Lshake128_squeeze_loop:
+    cmp     \$168, $arg5 # outlen > SHAKE128_RATE
+    jb      .Lshake128_squeeze_final_extract
+
+    call    keccak_1600_permute
+
+    # Extract SHAKE128 rate bytes (168 bytes = 21 x 8 bytes) inline
+___
+
+# Generate extract code for SHAKE128 rate (168 bytes = 21 ymm registers)
+for (my $i = 0; $i < 21; $i++) {
+    my $offset = $i * 8;
+    $code.=<<___;
+        vextracti64x2 \$1, %ymm$i, %xmm31
+        vmovq       %xmm$i, $offset($arg1,%rbp)
+        vpextrq     \$1, %xmm$i, $offset($arg2,%rbp)
+        vmovq       %xmm31, $offset($arg3,%rbp)
+        vpextrq     \$1, %xmm31, $offset($arg4,%rbp)
+___
+}
+
+$code.=<<___;
+    add     \$168, %rbp  # dst offset += SHAKE128_RATE
+    sub     \$168, $arg5 # outlen -= SHAKE128_RATE
+    jmp     .Lshake128_squeeze_loop
+
+.align  32
+.Lshake128_squeeze_final_extract:
+    or      $arg5, $arg5
+    jz      .Lshake128_squeeze_no_end_permute
+
+    # update output pointers
+    add     %rbp, $arg1
+    add     %rbp, $arg2
+    add     %rbp, $arg3
+    add     %rbp, $arg4
+
+    mov     \$168, %r15d       # SHAKE128_RATE
+    sub     $arg5, %r15
+    mov     %r15, 8*100($arg6) # s[100] = capacity
+
+    call    keccak_1600_permute
+
+    mov     $arg1, %r14
+    mov     $arg6, $arg1
+    call    keccak_1600_save_state_x4
+
+    mov     %r14, $arg1
+
+    # extract bytes: r10 - state/src, arg1-arg4 - output/dst, r12 - length, r11 - offset = 0
+    mov     $arg6, %r10
+    mov     $arg5, %r12
+    xor     %r11, %r11
+    call    keccak_1600_extract_bytes_x4
+
+    jmp     .Lshake128_squeeze_done
+
+.Lshake128_squeeze_no_end_permute:
+    movq    \$0, 8*100($arg6) # s[100] = 0
+    mov     $arg6, $arg1
+    call    keccak_1600_save_state_x4
+
+.Lshake128_squeeze_done:
+    # Clear sensitive registers
+    vpxorq      %xmm16, %xmm16, %xmm16
+    vmovdqa64   %ymm16, %ymm17
+    vmovdqa64   %ymm16, %ymm18
+    vmovdqa64   %ymm16, %ymm19
+    vmovdqa64   %ymm16, %ymm20
+    vmovdqa64   %ymm16, %ymm21
+    vmovdqa64   %ymm16, %ymm22
+    vmovdqa64   %ymm16, %ymm23
+    vmovdqa64   %ymm16, %ymm24
+    vmovdqa64   %ymm16, %ymm25
+    vmovdqa64   %ymm16, %ymm26
+    vmovdqa64   %ymm16, %ymm27
+    vmovdqa64   %ymm16, %ymm28
+    vmovdqa64   %ymm16, %ymm29
+    vmovdqa64   %ymm16, %ymm30
+    vmovdqa64   %ymm16, %ymm31
+.Lshake128_squeeze_epilogue:
+    vzeroall
+___
+$code .= <<___ if ($win64);
+    vmovups 0(%rsp),   %xmm6
+    vmovups 16(%rsp),  %xmm7
+    vmovups 32(%rsp),  %xmm8
+    vmovups 48(%rsp),  %xmm9
+    vmovups 64(%rsp),  %xmm10
+    vmovups 80(%rsp),  %xmm11
+    vmovups 96(%rsp),  %xmm12
+    vmovups 112(%rsp), %xmm13
+    vmovups 128(%rsp), %xmm14
+    vmovups 144(%rsp), %xmm15
+    add     \$160, %rsp
+___
+$code.=<<___;
+
+    pop %r15
+.cfi_pop    %r15
+    pop %r14
+.cfi_pop    %r14
+    pop %r13
+.cfi_pop    %r13
+    pop %r12
+.cfi_pop    %r12
+    pop %rbx
+.cfi_pop    %rbx
+    pop %rbp
+.cfi_pop    %rbp
+    ret
+.cfi_endproc
+.size   SHA3_shake128_x4_inc_squeeze_avx512vl,.-SHA3_shake128_x4_inc_squeeze_avx512vl
+
+
+# SHAKE256 x4 multi-buffer functions
+# These functions process 4 independent SHAKE256 streams in parallel using AVX-512VL
+# State layout: 25 ymm registers (200 bytes each) + 1 qword = 808 bytes per context
+# Rate: 136 bytes for SHAKE256
+
+# SHA3_shake256_x4_avx512vl
+# One-shot SHAKE-256 x4 function: init + absorb + finalize + squeeze
+# Arguments:
+#   arg1 (rdi): pointer to output lane 0
+#   arg2 (rsi): pointer to output lane 1
+#   arg3 (rdx): pointer to output lane 2
+#   arg4 (rcx): pointer to output lane 3
+#   arg5 (r8):  output length in bytes (must be same for all lanes)
+#   arg6 (r9):  pointer to input lane 0
+#   [stack+0]:  pointer to input lane 1
+#   [stack+8]:  pointer to input lane 2
+#   [stack+16]: pointer to input lane 3
+#   [stack+24]: input length in bytes (must be same for all lanes)
+# Returns: void
+.globl  SHA3_shake256_x4_avx512vl
+.type   SHA3_shake256_x4_avx512vl,\@function,10
+.align  32
+SHA3_shake256_x4_avx512vl:
+.cfi_startproc
+    push    %rbp
+.cfi_push       %rbp
+    mov     %rsp, %rbp
+    push    %rbx
+.cfi_push       %rbx
+___
+$code .= <<___ if ($win64);
+    sub     \$160, %rsp
+    vmovups %xmm6,   0(%rsp)
+    vmovups %xmm7,   16(%rsp)
+    vmovups %xmm8,   32(%rsp)
+    vmovups %xmm9,   48(%rsp)
+    vmovups %xmm10,  64(%rsp)
+    vmovups %xmm11,  80(%rsp)
+    vmovups %xmm12,  96(%rsp)
+    vmovups %xmm13,  112(%rsp)
+    vmovups %xmm14,  128(%rsp)
+    vmovups %xmm15,  144(%rsp)
+___
+$code.=<<___;
+
+    sub     \$$sf_size, %rsp
+    mov     %rsp, %rbx
+
+.Lshake256_x4_body:
+    mov     $arg1, $sf_arg1(%rbx)
+    mov     $arg2, $sf_arg2(%rbx)
+    mov     $arg3, $sf_arg3(%rbx)
+    mov     $arg4, $sf_arg4(%rbx)
+    mov     $arg5, $sf_arg5(%rbx)
+
+    lea     $sf_state_x4(%rbx), $arg1 # start of x4 state on the stack frame
+    mov     $arg1, $sf_state_ptr(%rbx)
+
+    # Initialize the state array to zero
+    call    keccak_1600_init_state
+
+    call    keccak_1600_save_state_x4
+
+    movq    \$0, 8*100($arg1) # clear s[100]
+
+    mov     $sf_state_ptr(%rbx), $arg1
+    mov     $arg6, $arg2
+___
+$code .= <<___ if ($win64);
+    # xlate prologue handles up to six arguments. For one-shot x4 wrappers
+    # (10 args), the remaining four stay in Win64 stack slots.
+    mov     64(%rbp), $arg3 # arg7 from stack
+    mov     72(%rbp), $arg4 # arg8 from stack
+    mov     80(%rbp), $arg5 # arg9 from stack
+    mov     88(%rbp), $arg6 # arg10 from stack
+___
+$code .= <<___ if (!$win64);
+    mov     16(%rbp), $arg3 # arg7 from stack
+    mov     24(%rbp), $arg4 # arg8 from stack
+    mov     32(%rbp), $arg5 # arg9 from stack
+    mov     40(%rbp), $arg6 # arg10 from stack
+___
+$code.=<<___;
+    # Internal entry avoids Win64 xlate prologue argument remapping.
+___
+$code .= call_internal("SHA3_shake256_x4_inc_absorb_avx512vl_internal");
+$code.=<<___;
+
+    mov     $sf_state_ptr(%rbx), $arg1
+    call    .L_SHA3_shake256_x4_inc_finalize_avx512vl
+
+    # squeeze
+    mov     $sf_arg1(%rbx), $arg1
+    mov     $sf_arg2(%rbx), $arg2
+    mov     $sf_arg3(%rbx), $arg3
+    mov     $sf_arg4(%rbx), $arg4
+    mov     $sf_arg5(%rbx), $arg5
+    mov     $sf_state_ptr(%rbx), $arg6
+___
+$code .= call_internal("SHA3_shake256_x4_inc_squeeze_avx512vl_internal");
+$code.=<<___;
+
+    # Clear the temporary buffer
+    lea     $sf_state_x4(%rbx), %r9
+    vpxorq      %ymm31, %ymm31, %ymm31
+    vmovdqu64   %ymm31, 32*0(%r9)
+    vmovdqu64   %ymm31, 32*1(%r9)
+    vmovdqu64   %ymm31, 32*2(%r9)
+    vmovdqu64   %ymm31, 32*3(%r9)
+    vmovdqu64   %ymm31, 32*4(%r9)
+    vmovdqu64   %ymm31, 32*5(%r9)
+    vmovdqu64   %ymm31, 32*6(%r9)
+    vmovdqu64   %ymm31, 32*7(%r9)
+    vmovdqu64   %ymm31, 32*8(%r9)
+    vmovdqu64   %ymm31, 32*9(%r9)
+    vmovdqu64   %ymm31, 32*10(%r9)
+    vmovdqu64   %ymm31, 32*11(%r9)
+    vmovdqu64   %ymm31, 32*12(%r9)
+    vmovdqu64   %ymm31, 32*13(%r9)
+    vmovdqu64   %ymm31, 32*14(%r9)
+    vmovdqu64   %ymm31, 32*15(%r9)
+    vmovdqu64   %ymm31, 32*16(%r9)
+    vmovdqu64   %ymm31, 32*17(%r9)
+    vmovdqu64   %ymm31, 32*18(%r9)
+    vmovdqu64   %ymm31, 32*19(%r9)
+    vmovdqu64   %ymm31, 32*20(%r9)
+    vmovdqu64   %ymm31, 32*21(%r9)
+    vmovdqu64   %ymm31, 32*22(%r9)
+    vmovdqu64   %ymm31, 32*23(%r9)
+    vmovdqu64   %ymm31, 32*24(%r9)
+    vmovq       %xmm31, 32*25(%r9)
+
+.Lshake256_x4_epilogue:
+___
+$code .= <<___ if ($win64);
+    vmovups $sf_size+0(%rsp),   %xmm6
+    vmovups $sf_size+16(%rsp),  %xmm7
+    vmovups $sf_size+32(%rsp),  %xmm8
+    vmovups $sf_size+48(%rsp),  %xmm9
+    vmovups $sf_size+64(%rsp),  %xmm10
+    vmovups $sf_size+80(%rsp),  %xmm11
+    vmovups $sf_size+96(%rsp),  %xmm12
+    vmovups $sf_size+112(%rsp), %xmm13
+    vmovups $sf_size+128(%rsp), %xmm14
+    vmovups $sf_size+144(%rsp), %xmm15
+    add     \$160, %rsp
+___
+$code.=<<___;
+    add     \$$sf_size, %rsp
+    pop     %rbx
+.cfi_pop        %rbx
+    pop     %rbp
+.cfi_pop        %rbp
+    ret
+.cfi_endproc
+.size   SHA3_shake256_x4_avx512vl,.-SHA3_shake256_x4_avx512vl
+
+___
+
+$code .= <<___ if ($win64);
+# Internal Win64 shim for absorb entry. It establishes xlate-compatible
+# unwind state and then jumps to the function entry after the prologue.
+# This is required for internal calls since the xlate ABI conversion
+# is already done in the caller function.
+.type   SHA3_shake256_x4_inc_absorb_avx512vl_internal,\@abi-omnipotent
+.align  32
+.LSEH_begin_SHA3_shake256_x4_inc_absorb_avx512vl_internal:
+SHA3_shake256_x4_inc_absorb_avx512vl_internal:
+    mov     %rsp, %rax
+    mov     $arg1, 8(%rsp)
+    mov     $arg2, 16(%rsp)
+    jmp     .L_SHA3_shake256_x4_inc_absorb_avx512vl
+.LSEH_end_SHA3_shake256_x4_inc_absorb_avx512vl_internal:
+.size   SHA3_shake256_x4_inc_absorb_avx512vl_internal,.-SHA3_shake256_x4_inc_absorb_avx512vl_internal
+___
+$code.=<<___;
+
+# SHA3_shake256_x4_inc_absorb_avx512vl
+# Absorb input data into 4 parallel SHAKE256 states
+# Arguments:
+#   arg1 (rdi): pointer to state context (808 bytes)
+#   arg2 (rsi): pointer to lane 0 input data
+#   arg3 (rdx): pointer to lane 1 input data
+#   arg4 (rcx): pointer to lane 2 input data
+#   arg5 (r8):  pointer to lane 3 input data
+#   arg6 (r9):  input length in bytes (must be same for all lanes)
+# Returns: void
+# Note: Input is XORed into state and Keccak permutation is applied for each rate-sized block
+.globl  SHA3_shake256_x4_inc_absorb_avx512vl
+.type   SHA3_shake256_x4_inc_absorb_avx512vl,\@function,6
+.align  32
+SHA3_shake256_x4_inc_absorb_avx512vl:
+.L_SHA3_shake256_x4_inc_absorb_avx512vl:
+.cfi_startproc
+    push    %rbp
+.cfi_push       %rbp
+    push    %rbx
+.cfi_push       %rbx
+    push    %r12
+.cfi_push       %r12
+    push    %r13
+.cfi_push       %r13
+    push    %r14
+.cfi_push       %r14
+    push    %r15
+.cfi_push       %r15
+___
+$code .= <<___ if ($win64);
+    sub     \$160, %rsp
+    vmovups %xmm6,   0(%rsp)
+    vmovups %xmm7,   16(%rsp)
+    vmovups %xmm8,   32(%rsp)
+    vmovups %xmm9,   48(%rsp)
+    vmovups %xmm10,  64(%rsp)
+    vmovups %xmm11,  80(%rsp)
+    vmovups %xmm12,  96(%rsp)
+    vmovups %xmm13,  112(%rsp)
+    vmovups %xmm14,  128(%rsp)
+    vmovups %xmm15,  144(%rsp)
+___
+$code.=<<___;
+
+.Lshake256_absorb_body:
+    # check for partially processed block
+    mov     8*100($arg1), %r14
+    or      %r14, %r14 # s[100] == 0?
+    je      .Lshake256_absorb_main_loop_start
+
+    # process remaining bytes if message long enough
+    mov     \$136, %r12 # SHAKE256_RATE = 136
+    sub     %r14, %r12  # %r12 = capacity
+
+    cmp     %r12, $arg6 # if mlen <= capacity then no permute
+    jbe     .Lshake256_absorb_skip_permute
+
+    sub     %r12, $arg6
+    mov     $arg6, %r11 # preserve remaining length across helper calls
+
+    # r10/state, arg2-arg5/inputs, r12/length
+    mov     $arg1, %r10                # %r10 = state
+    call    keccak_1600_partial_add_x4 # arg2-arg5 are updated
+
+    call    keccak_1600_load_state_x4
+
+    call    keccak_1600_permute
+
+    movq    \$0, 8*100($arg1) # clear s[100]
+    jmp     .Lshake256_absorb_partial_block_done
+
+.Lshake256_absorb_skip_permute:
+    # r10/state, arg2-arg5/inputs, r12/length
+    mov     $arg1, %r10
+    mov     $arg6, %r12
+    mov     $arg6, %r11 # preserve input length across helper call
+    call    keccak_1600_partial_add_x4
+
+    lea     (%r11,%r14), %r15
+    mov     %r15, 8*100($arg1) # s[100] += inlen
+
+    cmp     \$136, %r15 # check s[100] below SHAKE256_RATE
+    jb      .Lshake256_absorb_exit
+
+    call    keccak_1600_load_state_x4
+
+    call    keccak_1600_permute
+
+    call    keccak_1600_save_state_x4
+
+    movq    \$0, 8*100($arg1) # clear s[100]
+    jmp     .Lshake256_absorb_exit
+
+.Lshake256_absorb_main_loop_start:
+    call    keccak_1600_load_state_x4
+    mov     $arg6, %r11 # full input length when no prior partial block
+
+.Lshake256_absorb_partial_block_done:
+    xor     %r12, %r12  # zero message offset
+
+    # Process the input message in blocks
+.align  32
+.Lshake256_absorb_while_loop:
+    cmp     \$136, %r11 # compare mlen to SHAKE256_RATE
+    jb      .Lshake256_absorb_while_loop_done
+
+    # Inline absorb_bytes_x4 for SHAKE256_RATE (136 bytes = 17 ymm registers)
+___
+
+# Generate absorb code for SHAKE256 rate (136 bytes)
+for (my $i = 0; $i < 17; $i++) {
+    my $offset = $i * 8;
+    $code.=<<___;
+        vmovq       $offset($arg2,%r12), %xmm31
+        vpinsrq     \$1, $offset($arg3,%r12), %xmm31, %xmm31
+        vmovq       $offset($arg4,%r12), %xmm30
+        vpinsrq     \$1, $offset($arg5,%r12), %xmm30, %xmm30
+        vinserti32x4 \$1, %xmm30, %ymm31, %ymm31
+        vpxorq      %ymm31, %ymm$i, %ymm$i
+___
+}
+
+$code.=<<___;
+    sub     \$136, %r11         # Subtract the rate from the remaining length
+    add     \$136, %r12         # Adjust offset to next block
+    call    keccak_1600_permute # Perform the Keccak permutation
+
+    jmp     .Lshake256_absorb_while_loop
+
+.align  32
+.Lshake256_absorb_while_loop_done:
+    call    keccak_1600_save_state_x4
+
+    mov     %r11, 8*100($arg1) # update s[100]
+    or      %r11, %r11
+    jz      .Lshake256_absorb_exit
+
+    movq    \$0, 8*100($arg1) # clear s[100]
+
+    # r10/state, arg2-arg5/input, r12/length
+    mov     $arg1, %r10
+    add     %r12, $arg2
+    add     %r12, $arg3
+    add     %r12, $arg4
+    add     %r12, $arg5
+    mov     %r11, %r12
+    call    keccak_1600_partial_add_x4
+
+    mov     %r11, 8*100($arg1) # update s[100]
+
+.Lshake256_absorb_exit:
+    # Clear sensitive registers
+    vpxorq      %xmm16, %xmm16, %xmm16
+    vmovdqa64   %ymm16, %ymm17
+    vmovdqa64   %ymm16, %ymm18
+    vmovdqa64   %ymm16, %ymm19
+    vmovdqa64   %ymm16, %ymm20
+    vmovdqa64   %ymm16, %ymm21
+    vmovdqa64   %ymm16, %ymm22
+    vmovdqa64   %ymm16, %ymm23
+    vmovdqa64   %ymm16, %ymm24
+    vmovdqa64   %ymm16, %ymm25
+    vmovdqa64   %ymm16, %ymm26
+    vmovdqa64   %ymm16, %ymm27
+    vmovdqa64   %ymm16, %ymm28
+    vmovdqa64   %ymm16, %ymm29
+    vmovdqa64   %ymm16, %ymm30
+    vmovdqa64   %ymm16, %ymm31
+.Lshake256_absorb_epilogue:
+    vzeroall
+___
+$code .= <<___ if ($win64);
+    vmovups 0(%rsp),   %xmm6
+    vmovups 16(%rsp),  %xmm7
+    vmovups 32(%rsp),  %xmm8
+    vmovups 48(%rsp),  %xmm9
+    vmovups 64(%rsp),  %xmm10
+    vmovups 80(%rsp),  %xmm11
+    vmovups 96(%rsp),  %xmm12
+    vmovups 112(%rsp), %xmm13
+    vmovups 128(%rsp), %xmm14
+    vmovups 144(%rsp), %xmm15
+    add     \$160, %rsp
+___
+$code.=<<___;
+
+    pop %r15
+.cfi_pop    %r15
+    pop %r14
+.cfi_pop    %r14
+    pop %r13
+.cfi_pop    %r13
+    pop %r12
+.cfi_pop    %r12
+    pop %rbx
+.cfi_pop    %rbx
+    pop %rbp
+.cfi_pop    %rbp
+    ret
+.cfi_endproc
+.size   SHA3_shake256_x4_inc_absorb_avx512vl,.-SHA3_shake256_x4_inc_absorb_avx512vl
+
+
+# SHA3_shake256_x4_inc_finalize_avx512vl
+# Finalize absorption phase for 4 parallel SHAKE-256 states
+# Adds padding and terminator bytes and clears the absorb offset
+# Arguments:
+#   arg1 (rdi): pointer to state context (808 bytes)
+# Returns: void
+# Note: After this call, state is ready for squeezing output
+.globl  SHA3_shake256_x4_inc_finalize_avx512vl
+.type   SHA3_shake256_x4_inc_finalize_avx512vl,\@function,1
+.align  32
+SHA3_shake256_x4_inc_finalize_avx512vl:
+.L_SHA3_shake256_x4_inc_finalize_avx512vl:
+.cfi_startproc
+    mov     8*100($arg1), %r11 # load state offset from s[100]
+    mov     %r11, %r10
+    and     \$~7, %r10d        # offset to the state register
+    and     \$7, %r11d         # offset within the register
+
+    # add EOM byte right after the message
+    vmovdqu32   ($arg1,%r10,4), %ymm31
+    lea         shake_msg_pad_x4(%rip), %r9
+    sub         %r11, %r9
+    vmovdqu32   (%r9), %ymm30
+    vpxorq      %ymm30, %ymm31, %ymm31
+    vmovdqu32   %ymm31, ($arg1,%r10,4)
+
+    # add terminating byte at offset equal to rate - 1 (SHAKE256_RATE = 136)
+    vmovdqu32   512($arg1), %ymm31 # 136*4 - 32 = 544 - 32 = 512
+    vmovdqa32   shake_terminator_byte_x4(%rip), %ymm30
+    vpxorq      %ymm30, %ymm31, %ymm31
+    vmovdqu32   %ymm31, 512($arg1)
+
+    movq        \$0, 8*100($arg1) # clear s[100]
+    vpxorq      %ymm31, %ymm31, %ymm31
+    ret
+.cfi_endproc
+.size   SHA3_shake256_x4_inc_finalize_avx512vl,.-SHA3_shake256_x4_inc_finalize_avx512vl
+
+___
+
+$code .= <<___ if ($win64);
+# Internal Win64 shim for squeeze entry. It establishes xlate-compatible
+# unwind state and then jumps to the function entry after the prologue.
+# This is required for internal calls since the xlate ABI conversion
+# is already done in the caller function.
+.type   SHA3_shake256_x4_inc_squeeze_avx512vl_internal,\@abi-omnipotent
+.align  32
+.LSEH_begin_SHA3_shake256_x4_inc_squeeze_avx512vl_internal:
+SHA3_shake256_x4_inc_squeeze_avx512vl_internal:
+    mov     %rsp, %rax
+    mov     $arg1, 8(%rsp)
+    mov     $arg2, 16(%rsp)
+    jmp     .L_SHA3_shake256_x4_inc_squeeze_avx512vl
+.LSEH_end_SHA3_shake256_x4_inc_squeeze_avx512vl_internal:
+.size   SHA3_shake256_x4_inc_squeeze_avx512vl_internal,.-SHA3_shake256_x4_inc_squeeze_avx512vl_internal
+___
+$code.=<<___;
+
+# SHA3_shake256_x4_inc_squeeze_avx512vl
+# Squeeze output from 4 parallel SHAKE256 states
+# Arguments:
+#   arg1 (rdi): pointer to lane 0 output buffer
+#   arg2 (rsi): pointer to lane 1 output buffer
+#   arg3 (rdx): pointer to lane 2 output buffer
+#   arg4 (rcx): pointer to lane 3 output buffer
+#   arg5 (r8):  output length in bytes (must be same for all lanes)
+#   arg6 (r9):  pointer to state context (808 bytes)
+# Returns: void
+# Note: Can be called multiple times to generate arbitrary-length output
+.globl  SHA3_shake256_x4_inc_squeeze_avx512vl
+.type   SHA3_shake256_x4_inc_squeeze_avx512vl,\@function,6
+.align  32
+SHA3_shake256_x4_inc_squeeze_avx512vl:
+.L_SHA3_shake256_x4_inc_squeeze_avx512vl:
+.cfi_startproc
+    push    %rbp
+.cfi_push       %rbp
+    push    %rbx
+.cfi_push       %rbx
+    push    %r12
+.cfi_push       %r12
+    push    %r13
+.cfi_push       %r13
+    push    %r14
+.cfi_push       %r14
+    push    %r15
+.cfi_push       %r15
+___
+$code .= <<___ if ($win64);
+    sub     \$160, %rsp
+    vmovups %xmm6,   0(%rsp)
+    vmovups %xmm7,   16(%rsp)
+    vmovups %xmm8,   32(%rsp)
+    vmovups %xmm9,   48(%rsp)
+    vmovups %xmm10,  64(%rsp)
+    vmovups %xmm11,  80(%rsp)
+    vmovups %xmm12,  96(%rsp)
+    vmovups %xmm13,  112(%rsp)
+    vmovups %xmm14,  128(%rsp)
+    vmovups %xmm15,  144(%rsp)
+___
+$code.=<<___;
+
+.Lshake256_squeeze_body:
+    or      $arg5, $arg5
+    jz      .Lshake256_squeeze_done
+
+    # check for partially processed block
+    mov     8*100($arg6), %r15 # s[100] - capacity
+    or      %r15, %r15
+    jnz     .Lshake256_squeeze_no_init_permute
+
+    mov     $arg1, %r14
+    mov     $arg6, $arg1
+    call    keccak_1600_load_state_x4
+
+    mov     %r14, $arg1
+
+    xor     %rbp, %rbp
+    jmp     .Lshake256_squeeze_loop
+
+.align  32
+.Lshake256_squeeze_no_init_permute:
+    # extract bytes: r10 - state/src, arg1-arg4 - output/dst, r12 - length = min(capacity, outlen), r11 - offset
+    mov     $arg6, %r10
+    mov     $arg6, %r14 # preserve state pointer across extract helper
+
+    mov     %r15, %r12
+    cmp     %r15, $arg5
+    cmovnae $arg5, %r12 # %r12 = min(capacity, outlen)
+
+    sub     %r12, $arg5 # outlen -= length
+
+    mov     \$136, %r11d # SHAKE256_RATE
+    sub     %r15, %r11   # state offset
+
+    sub     %r12, %r15         # capacity -= length
+    mov     %r15, 8*100($arg6) # update s[100]
+
+    call    keccak_1600_extract_bytes_x4
+    mov     %r14, $arg6        # restore state pointer after helper clobbers
+
+    or      %r15, %r15
+    jnz     .Lshake256_squeeze_done # check s[100] not zero
+
+    mov     $arg1, %r13 # preserve arg1
+    mov     %r14, $arg1
+    call    keccak_1600_load_state_x4
+
+    mov     %r13, $arg1
+    xor     %rbp, %rbp
+
+.align  32
+.Lshake256_squeeze_loop:
+    cmp     \$136, $arg5 # outlen > SHAKE256_RATE
+    jb      .Lshake256_squeeze_final_extract
+
+    call    keccak_1600_permute
+
+    # Extract SHAKE256 rate bytes (136 bytes = 17 x 8 bytes) inline
+___
+
+# Generate extract code for SHAKE256 rate (136 bytes = 17 ymm registers)
+for (my $i = 0; $i < 17; $i++) {
+    my $offset = $i * 8;
+    $code.=<<___;
+        vextracti64x2 \$1, %ymm$i, %xmm31
+        vmovq       %xmm$i, $offset($arg1,%rbp)
+        vpextrq     \$1, %xmm$i, $offset($arg2,%rbp)
+        vmovq       %xmm31, $offset($arg3,%rbp)
+        vpextrq     \$1, %xmm31, $offset($arg4,%rbp)
+___
+}
+
+$code.=<<___;
+    add     \$136, %rbp  # dst offset += SHAKE256_RATE
+    sub     \$136, $arg5 # outlen -= SHAKE256_RATE
+    jmp     .Lshake256_squeeze_loop
+
+.align  32
+.Lshake256_squeeze_final_extract:
+    or      $arg5, $arg5
+    jz      .Lshake256_squeeze_no_end_permute
+
+    # update output pointers
+    add     %rbp, $arg1
+    add     %rbp, $arg2
+    add     %rbp, $arg3
+    add     %rbp, $arg4
+
+    mov     \$136, %r15d       # SHAKE256_RATE
+    sub     $arg5, %r15
+    mov     %r15, 8*100($arg6) # s[100] = capacity
+
+    call    keccak_1600_permute
+
+    mov     $arg1, %r14
+    mov     $arg6, $arg1
+    call    keccak_1600_save_state_x4
+
+    mov     %r14, $arg1
+
+    # extract bytes: r10 - state/src, arg1-arg4 - output/dst, r12 - length, r11 - offset = 0
+    mov     $arg6, %r10
+    mov     $arg5, %r12
+    xor     %r11, %r11
+    call    keccak_1600_extract_bytes_x4
+
+    jmp     .Lshake256_squeeze_done
+
+.Lshake256_squeeze_no_end_permute:
+    movq    \$0, 8*100($arg6) # s[100] = 0
+    mov     $arg6, $arg1
+    call    keccak_1600_save_state_x4
+
+.Lshake256_squeeze_done:
+    # Clear sensitive registers
+    vpxorq      %xmm16, %xmm16, %xmm16
+    vmovdqa64   %ymm16, %ymm17
+    vmovdqa64   %ymm16, %ymm18
+    vmovdqa64   %ymm16, %ymm19
+    vmovdqa64   %ymm16, %ymm20
+    vmovdqa64   %ymm16, %ymm21
+    vmovdqa64   %ymm16, %ymm22
+    vmovdqa64   %ymm16, %ymm23
+    vmovdqa64   %ymm16, %ymm24
+    vmovdqa64   %ymm16, %ymm25
+    vmovdqa64   %ymm16, %ymm26
+    vmovdqa64   %ymm16, %ymm27
+    vmovdqa64   %ymm16, %ymm28
+    vmovdqa64   %ymm16, %ymm29
+    vmovdqa64   %ymm16, %ymm30
+    vmovdqa64   %ymm16, %ymm31
+.Lshake256_squeeze_epilogue:
+    vzeroall
+___
+$code .= <<___ if ($win64);
+    vmovups 0(%rsp),   %xmm6
+    vmovups 16(%rsp),  %xmm7
+    vmovups 32(%rsp),  %xmm8
+    vmovups 48(%rsp),  %xmm9
+    vmovups 64(%rsp),  %xmm10
+    vmovups 80(%rsp),  %xmm11
+    vmovups 96(%rsp),  %xmm12
+    vmovups 112(%rsp), %xmm13
+    vmovups 128(%rsp), %xmm14
+    vmovups 144(%rsp), %xmm15
+    add     \$160, %rsp
+___
+$code.=<<___;
+
+    pop %r15
+.cfi_pop    %r15
+    pop %r14
+.cfi_pop    %r14
+    pop %r13
+.cfi_pop    %r13
+    pop %r12
+.cfi_pop    %r12
+    pop %rbx
+.cfi_pop    %rbx
+    pop %rbp
+.cfi_pop    %rbp
+    ret
+.cfi_endproc
+.size   SHA3_shake256_x4_inc_squeeze_avx512vl,.-SHA3_shake256_x4_inc_squeeze_avx512vl
+___
+
+if ($win64) {
+my $context = "%r8";
+my $disp    = "%r9";
+
+$code.=<<___;
+.extern __imp_RtlVirtualUnwind
+.type   keccak_se_handler,\@abi-omnipotent
+.align  16
+keccak_se_handler:
+    push    %rsi
+    push    %rdi
+    push    %rbx
+    push    %rbp
+    push    %r12
+    push    %r13
+    push    %r14
+    push    %r15
+    pushfq
+    sub     \$64, %rsp
+
+    mov     120($context), %rax # context->Rax = original %rsp from xlate prologue
+    mov     248($context), %rbx # context->Rip
+
+    mov     8($disp), %rsi  # disp->ImageBase
+    mov     56($disp), %r11 # disp->HandlerData
+
+    mov     0(%r11), %r10d # HandlerData[0]: body label (rva)
+    lea     (%rsi,%r10), %r10
+    cmp     %r10, %rbx     # Rip < body?
+    jb      .Lkeccak_in_prologue
+
+    mov     4(%r11), %r10d # HandlerData[1]: epilogue label (rva)
+    lea     (%rsi,%r10), %r10
+    cmp     %r10, %rbx     # Rip >= epilogue?
+    jae     .Lkeccak_in_epilogue
+
+    # In function body:
+    # HandlerData[2]: delta from context->Rsp(body) to original %rsp
+    # HandlerData[3]: offset of XMM6 save area from context->Rsp(body), -1 if none
+    # HandlerData[4]: number of saved non-volatiles in stack frame layout (2 or 6)
+    # HandlerData[5]: delta from context->Rsp(epilogue) to original %rsp
+    mov     152($context), %rdx # body rsp
+    mov     8(%r11), %r10d
+    lea     (%rdx,%r10), %rax   # original rsp
+    jmp     .Lkeccak_restore_body_or_epilogue
+
+.Lkeccak_in_epilogue:
+    mov     152($context), %rdx # epilogue rsp
+    mov     20(%r11), %r10d
+    lea     (%rdx,%r10), %rax   # original rsp
+
+.Lkeccak_restore_body_or_epilogue:
+    mov     8(%rax), %rcx       # xlate shadow save of original rdi
+    mov     16(%rax), %rsi      # xlate shadow save of original rsi
+    mov     %rax, 152($context) # context->Rsp = original rsp
+    mov     %rsi, 168($context) # context->Rsi
+    mov     %rcx, 176($context) # context->Rdi
+
+    mov     16(%r11), %r10d # gpr save count
+    cmp     \$6, %r10d
+    jne     .Lkeccak_restore_two
+
+    mov     -24(%rax), %r12
+    mov     -32(%rax), %r13
+    mov     -40(%rax), %r14
+    mov     -48(%rax), %r15
+    mov     %r12, 216($context) # context->R12
+    mov     %r13, 224($context) # context->R13
+    mov     %r14, 232($context) # context->R14
+    mov     %r15, 240($context) # context->R15
+
+.Lkeccak_restore_two:
+    mov     -8(%rax), %rbp
+    mov     -16(%rax), %rbx
+    mov     %rbp, 160($context) # context->Rbp
+    mov     %rbx, 144($context) # context->Rbx
+
+    mov     12(%r11), %r10d # xmm save offset from body rsp
+    cmp     \$-1, %r10d
+    je      .Lkeccak_in_prologue
+
+    lea     (%rdx,%r10), %rsi   # source = xmm save area
+    lea     512($context), %rdi # &context->Xmm6
+    mov     \$20, %ecx          # 10 XMM * 2 qwords
+    .long   0xa548f3fc          # cld; rep movsq
+
+.Lkeccak_in_prologue:
+    mov     8(%rax), %rcx
+    mov     16(%rax), %rdx
+    mov     %rcx, 176($context) # context->Rdi
+    mov     %rdx, 168($context) # context->Rsi
+    mov     %rax, 152($context) # context->Rsp = original rsp
+
+    mov     40($disp), %rdi # disp->ContextRecord
+    mov     $context, %rsi
+    mov     \$154, %ecx     # sizeof(CONTEXT)/8
+    .long   0xa548f3fc      # cld; rep movsq
+
+    mov     $disp, %rsi
+    xor     %rcx, %rcx     # UNW_FLAG_NHANDLER
+    mov     8(%rsi), %rdx  # disp->ImageBase
+    mov     0(%rsi), %r8   # disp->ControlPc
+    mov     16(%rsi), %r9  # disp->FunctionEntry
+    mov     40(%rsi), %r10 # disp->ContextRecord
+    lea     56(%rsi), %r11 # &disp->HandlerData
+    lea     24(%rsi), %r12 # &disp->EstablisherFrame
+    mov     %r10, 32(%rsp)
+    mov     %r11, 40(%rsp)
+    mov     %r12, 48(%rsp)
+    mov     %rcx, 56(%rsp)
+    call    *__imp_RtlVirtualUnwind(%rip)
+
+    mov     \$1, %eax # ExceptionContinueSearch
+    add     \$64, %rsp
+    popfq
+    pop     %r15
+    pop     %r14
+    pop     %r13
+    pop     %r12
+    pop     %rbp
+    pop     %rbx
+    pop     %rdi
+    pop     %rsi
+    ret
+.size   keccak_se_handler,.-keccak_se_handler
+
+.section    .pdata
+.align  4
+    .rva    .LSEH_begin_SHA3_shake128_x4_avx512vl
+    .rva    .LSEH_end_SHA3_shake128_x4_avx512vl
+    .rva    .LSEH_info_SHA3_shake128_x4_avx512vl
+    .rva    .LSEH_begin_SHA3_shake128_x4_inc_absorb_avx512vl_internal
+    .rva    .LSEH_end_SHA3_shake128_x4_inc_absorb_avx512vl_internal
+    .rva    .LSEH_info_SHA3_shake128_x4_inc_absorb_avx512vl_internal
+    .rva    .LSEH_begin_SHA3_shake128_x4_inc_absorb_avx512vl
+    .rva    .LSEH_end_SHA3_shake128_x4_inc_absorb_avx512vl
+    .rva    .LSEH_info_SHA3_shake128_x4_inc_absorb_avx512vl
+    .rva    .LSEH_begin_SHA3_shake128_x4_inc_squeeze_avx512vl_internal
+    .rva    .LSEH_end_SHA3_shake128_x4_inc_squeeze_avx512vl_internal
+    .rva    .LSEH_info_SHA3_shake128_x4_inc_squeeze_avx512vl_internal
+    .rva    .LSEH_begin_SHA3_shake128_x4_inc_squeeze_avx512vl
+    .rva    .LSEH_end_SHA3_shake128_x4_inc_squeeze_avx512vl
+    .rva    .LSEH_info_SHA3_shake128_x4_inc_squeeze_avx512vl
+    .rva    .LSEH_begin_SHA3_shake256_x4_avx512vl
+    .rva    .LSEH_end_SHA3_shake256_x4_avx512vl
+    .rva    .LSEH_info_SHA3_shake256_x4_avx512vl
+    .rva    .LSEH_begin_SHA3_shake256_x4_inc_absorb_avx512vl_internal
+    .rva    .LSEH_end_SHA3_shake256_x4_inc_absorb_avx512vl_internal
+    .rva    .LSEH_info_SHA3_shake256_x4_inc_absorb_avx512vl_internal
+    .rva    .LSEH_begin_SHA3_shake256_x4_inc_absorb_avx512vl
+    .rva    .LSEH_end_SHA3_shake256_x4_inc_absorb_avx512vl
+    .rva    .LSEH_info_SHA3_shake256_x4_inc_absorb_avx512vl
+    .rva    .LSEH_begin_SHA3_shake256_x4_inc_squeeze_avx512vl_internal
+    .rva    .LSEH_end_SHA3_shake256_x4_inc_squeeze_avx512vl_internal
+    .rva    .LSEH_info_SHA3_shake256_x4_inc_squeeze_avx512vl_internal
+    .rva    .LSEH_begin_SHA3_shake256_x4_inc_squeeze_avx512vl
+    .rva    .LSEH_end_SHA3_shake256_x4_inc_squeeze_avx512vl
+    .rva    .LSEH_info_SHA3_shake256_x4_inc_squeeze_avx512vl
+
+.section    .xdata
+.align  8
+.LSEH_info_SHA3_shake128_x4_avx512vl:
+    .byte   9,0,0,0
+    .rva    keccak_se_handler
+    .rva    .Lshake128_x4_body,.Lshake128_x4_epilogue
+    .long   1032,856,2,1032
+.LSEH_info_SHA3_shake128_x4_inc_absorb_avx512vl:
+    .byte   9,0,0,0
+    .rva    keccak_se_handler
+    .rva    .Lshake128_absorb_body,.Lshake128_absorb_epilogue
+    .long   208,0,6,208
+.LSEH_info_SHA3_shake128_x4_inc_absorb_avx512vl_internal:
+    .byte   9,0,0,0
+    .rva    keccak_se_handler
+    .rva    .Lshake128_absorb_body,.Lshake128_absorb_epilogue
+    .long   208,0,6,208
+.LSEH_info_SHA3_shake128_x4_inc_squeeze_avx512vl:
+    .byte   9,0,0,0
+    .rva    keccak_se_handler
+    .rva    .Lshake128_squeeze_body,.Lshake128_squeeze_epilogue
+    .long   208,0,6,208
+.LSEH_info_SHA3_shake128_x4_inc_squeeze_avx512vl_internal:
+    .byte   9,0,0,0
+    .rva    keccak_se_handler
+    .rva    .Lshake128_squeeze_body,.Lshake128_squeeze_epilogue
+    .long   208,0,6,208
+.LSEH_info_SHA3_shake256_x4_avx512vl:
+    .byte   9,0,0,0
+    .rva    keccak_se_handler
+    .rva    .Lshake256_x4_body,.Lshake256_x4_epilogue
+    .long   1032,856,2,1032
+.LSEH_info_SHA3_shake256_x4_inc_absorb_avx512vl:
+    .byte   9,0,0,0
+    .rva    keccak_se_handler
+    .rva    .Lshake256_absorb_body,.Lshake256_absorb_epilogue
+    .long   208,0,6,208
+.LSEH_info_SHA3_shake256_x4_inc_absorb_avx512vl_internal:
+    .byte   9,0,0,0
+    .rva    keccak_se_handler
+    .rva    .Lshake256_absorb_body,.Lshake256_absorb_epilogue
+    .long   208,0,6,208
+.LSEH_info_SHA3_shake256_x4_inc_squeeze_avx512vl:
+    .byte   9,0,0,0
+    .rva    keccak_se_handler
+    .rva    .Lshake256_squeeze_body,.Lshake256_squeeze_epilogue
+    .long   208,0,6,208
+.LSEH_info_SHA3_shake256_x4_inc_squeeze_avx512vl_internal:
+    .byte   9,0,0,0
+    .rva    keccak_se_handler
+    .rva    .Lshake256_squeeze_body,.Lshake256_squeeze_epilogue
+    .long   208,0,6,208
+___
+}
+
+$code.=<<___;
+
+.section .rodata align=128
+.align  128
+.type   iotas,\@object
+iotas:
+    .quad   0x0000000000000001
+    .quad   0x0000000000008082
+    .quad   0x800000000000808a
+    .quad   0x8000000080008000
+    .quad   0x000000000000808b
+    .quad   0x0000000080000001
+    .quad   0x8000000080008081
+    .quad   0x8000000000008009
+    .quad   0x000000000000008a
+    .quad   0x0000000000000088
+    .quad   0x0000000080008009
+    .quad   0x000000008000000a
+    .quad   0x000000008000808b
+    .quad   0x800000000000008b
+    .quad   0x8000000000008089
+    .quad   0x8000000000008003
+    .quad   0x8000000000008002
+    .quad   0x8000000000000080
+    .quad   0x000000000000800a
+    .quad   0x800000008000000a
+    .quad   0x8000000080008081
+    .quad   0x8000000000008080
+    .quad   0x0000000080000001
+    .quad   0x8000000080008008
+.size   iotas,.-iotas
+
+.align  8
+byte_kmask_0_to_7:
+    .byte   0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f
+
+.align  32
+shake_terminator_byte_x4:
+    .byte   0, 0, 0, 0, 0, 0, 0, 0x80
+    .byte   0, 0, 0, 0, 0, 0, 0, 0x80
+    .byte   0, 0, 0, 0, 0, 0, 0, 0x80
+    .byte   0, 0, 0, 0, 0, 0, 0, 0x80
+
+.align  8
+    .byte   0, 0, 0, 0, 0, 0, 0, 0
+shake_msg_pad_x4:
+    .byte   0x1F, 0, 0, 0, 0, 0, 0, 0
+    .byte   0x1F, 0, 0, 0, 0, 0, 0, 0
+    .byte   0x1F, 0, 0, 0, 0, 0, 0, 0
+    .byte   0x1F, 0, 0, 0, 0, 0, 0, 0
+
+.asciz  "Keccak-1600 absorb and squeeze for AVX512VL, CRYPTOGAMS by <appro\@openssl.org>"
+___
+
+}}} else {{{
+
+# When AVX512VL is not available, output stub functions
+# The capable function returns 0, and the operation functions are not defined (will use C fallback)
+
+$code .= <<___;
+.text
+
+.globl  SHA3_avx512vl_capable
+.type   SHA3_avx512vl_capable,\@abi-omnipotent
+SHA3_avx512vl_capable:
+    xor     %eax, %eax
+    ret
+.size   SHA3_avx512vl_capable, .-SHA3_avx512vl_capable
+
+.globl  SHA3_shake128_x4_inc_absorb_avx512vl
+.globl  SHA3_shake256_x4_inc_absorb_avx512vl
+.globl  SHA3_shake128_x4_inc_finalize_avx512vl
+.globl  SHA3_shake256_x4_inc_finalize_avx512vl
+.globl  SHA3_shake128_x4_inc_squeeze_avx512vl
+.globl  SHA3_shake256_x4_inc_squeeze_avx512vl
+.globl  SHA3_shake128_x4_avx512vl
+.globl  SHA3_shake256_x4_avx512vl
+.type   SHA3_shake128_x4_inc_absorb_avx512vl,\@abi-omnipotent
+SHA3_shake128_x4_inc_absorb_avx512vl:
+SHA3_shake256_x4_inc_absorb_avx512vl:
+SHA3_shake128_x4_inc_finalize_avx512vl:
+SHA3_shake256_x4_inc_finalize_avx512vl:
+SHA3_shake128_x4_inc_squeeze_avx512vl:
+SHA3_shake256_x4_inc_squeeze_avx512vl:
+SHA3_shake128_x4_avx512vl:
+SHA3_shake256_x4_avx512vl:
+    .byte   0x0f,0x0b # ud2
+    ret
+.size   SHA3_shake128_x4_inc_absorb_avx512vl, .-SHA3_shake128_x4_inc_absorb_avx512vl
+___
+}}}
+
+print $code;
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-586.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-586.pl
index 81c3658b0ad..91e5f5612b8 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-586.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-586.pl
@@ -8,10 +8,10 @@


 # ====================================================================
-# [Re]written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# [Re]written by Andy Polyakov <https://github.com/dot-asm> for the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # "[Re]written" was achieved in two major overhauls. In 2004 BODY_*
@@ -1486,7 +1486,7 @@ sub Xtail_avx()
 &data_word(0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f);	# pbswap mask
 &data_byte(0xf,0xe,0xd,0xc,0xb,0xa,0x9,0x8,0x7,0x6,0x5,0x4,0x3,0x2,0x1,0x0);
 }
-&asciz("SHA1 block transform for x86, CRYPTOGAMS by <appro\@openssl.org>");
+&asciz("SHA1 block transform for x86, CRYPTOGAMS by <https://github.com/dot-asm>");

 &asm_finish();

diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-alpha.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-alpha.pl
index 0ffc090602e..be3ead5c434 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-alpha.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-alpha.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2009-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # SHA1 block procedure for Alpha.
@@ -321,7 +321,7 @@ $code.=<<___;
 	lda	sp,64(sp)
 	ret	(ra)
 .end	sha1_block_data_order
-.ascii	"SHA1 block transform for Alpha, CRYPTOGAMS by <appro\@openssl.org>"
+.ascii	"SHA1 block transform for Alpha, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2
 ___
 $output=pop and open STDOUT,">$output";
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-armv4-large.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-armv4-large.pl
index b3a8ec69414..e9abf95d704 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-armv4-large.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-armv4-large.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # sha1_block procedure for ARMv4.
@@ -187,7 +187,7 @@ ___
 }

 $code=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 #if defined(__thumb2__)
 .syntax	unified
@@ -322,7 +322,7 @@ $code.=<<___;
 .word	OPENSSL_armcap_P-.Lsha1_block
 # endif
 #endif
-.asciz	"SHA1 block transform for ARMv4/NEON/ARMv8, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"SHA1 block transform for ARMv4/NEON/ARMv8, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	5
 ___
 #####################################################################
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-armv8.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-armv8.pl
index c3a40b4abd9..b71321783f8 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-armv8.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-armv8.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2014-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2014-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # SHA1 for ARMv8.
@@ -175,7 +175,7 @@ ___
 }

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"
 #ifndef	__KERNEL__
 .extern OPENSSL_armcap_P
 .hidden OPENSSL_armcap_P
@@ -329,7 +329,7 @@ $code.=<<___;
 .long	0x6ed9eba1,0x6ed9eba1,0x6ed9eba1,0x6ed9eba1	//K_20_39
 .long	0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc	//K_40_59
 .long	0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6	//K_60_79
-.asciz	"SHA1 block transform for ARMv8, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"SHA1 block transform for ARMv8, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2
 ___
 }}}
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-c64xplus.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-c64xplus.pl
index 6a97da2b570..f1cc80daebe 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-c64xplus.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-c64xplus.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2012-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2012-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # SHA1 for C64x+.
@@ -328,7 +328,7 @@ $code.=<<___;
 	.endasmfunc

 	.sect	.const
-	.cstring "SHA1 block transform for C64x+, CRYPTOGAMS by <appro\@openssl.org>"
+	.cstring "SHA1 block transform for C64x+, CRYPTOGAMS by <https://github.com/dot-asm>"
 	.align	4
 ___

diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-ia64.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-ia64.pl
index f1b412dcf2e..a9be2670d01 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-ia64.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-ia64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2004-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # Eternal question is what's wrong with compiler generated code? The
@@ -26,7 +26,7 @@ $output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;

 $code=<<___;
 .ident  \"sha1-ia64.s, version 1.3\"
-.ident  \"IA-64 ISA artwork by Andy Polyakov <appro\@fy.chalmers.se>\"
+.ident  \"IA-64 ISA artwork by Andy Polyakov <https://github.com/dot-asm>\"
 .explicit

 ___
@@ -308,7 +308,7 @@ $code.=<<___;
 	mov	pr=r2,0x1ffff
 	br.ret.sptk.many	b0	};;
 .endp	sha1_block_data_order#
-stringz	"SHA1 block transform for IA64, CRYPTOGAMS by <appro\@openssl.org>"
+stringz	"SHA1 block transform for IA64, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 open STDOUT,">$output" if $output;
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-mb-x86_64.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-mb-x86_64.pl
index 59042c90b2f..9f57342152b 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-mb-x86_64.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-mb-x86_64.pl
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # Multi-buffer SHA1 procedure processes n buffers in parallel by
@@ -1395,7 +1395,7 @@ K_XX_XX:
 	.long	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f	# pbswap
 	.long	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f	# pbswap
 	.byte	0xf,0xe,0xd,0xc,0xb,0xa,0x9,0x8,0x7,0x6,0x5,0x4,0x3,0x2,0x1,0x0
-	.asciz	"SHA1 multi-block transform for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+	.asciz	"SHA1 multi-block transform for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .previous
 ___

diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-mips.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-mips.pl
index b41dd7a5d26..63f1200c0ad 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-mips.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-mips.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2009-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # SHA1 block procedure for MIPS.
@@ -75,7 +75,7 @@ if ($flavour =~ /64|n32/i) {
 	$SZREG=4;
 }
 #
-# <appro@openssl.org>
+# <https://github.com/dot-asm>
 #
 ######################################################################

@@ -343,7 +343,7 @@ $FRAMESIZE=16;	# large enough to accommodate NUBI saved registers
 $SAVED_REGS_MASK = ($flavour =~ /nubi/i) ? "0xc0fff008" : "0xc0ff0000";

 $code=<<___;
-#include "mips_arch.h"
+#include "arch/mips_arch.h"

 .text

@@ -458,7 +458,7 @@ $code.=<<___;
 	$PTR_ADD $sp,$FRAMESIZE*$SZREG
 .end	sha1_block_data_order
 .rdata
-.asciiz	"SHA1 for MIPS, CRYPTOGAMS by <appro\@openssl.org>"
+.asciiz	"SHA1 for MIPS, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___
 print $code;
 close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-parisc.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-parisc.pl
index 9eb98e8036a..7b5d00aa362 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-parisc.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-parisc.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2009-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # SHA1 block procedure for PA-RISC.
@@ -260,7 +260,7 @@ $code.=<<___;
 	.EXIT
 	$POPMB	-$FRAME(%sp),%r3
 	.PROCEND
-	.STRINGZ "SHA1 block transform for PA-RISC, CRYPTOGAMS by <appro\@openssl.org>"
+	.STRINGZ "SHA1 block transform for PA-RISC, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-ppc.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-ppc.pl
index acea2e94f39..debfb61ec83 100755
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-ppc.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-ppc.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # I let hardware handle unaligned input(*), except on page boundaries
@@ -347,7 +347,7 @@ $code.=<<___;
 .size	.sha1_block_data_order,.-.sha1_block_data_order
 ___
 $code.=<<___;
-.asciz	"SHA1 block transform for PPC, CRYPTOGAMS by <appro\@fy.chalmers.se>"
+.asciz	"SHA1 block transform for PPC, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 $code =~ s/\`([^\`]*)\`/eval $1/gem;
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-s390x.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-s390x.pl
index d870e0078eb..731143ca90e 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-s390x.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-s390x.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # SHA1 block procedure for s390x.
@@ -162,7 +162,7 @@ ___
 }

 $code.=<<___;
-#include "s390x_arch.h"
+#include "arch/s390x_arch.h"

 .text
 .align	64
@@ -242,7 +242,7 @@ $code.=<<___;
 	lm${g}	%r6,%r15,`$frame+6*$SIZE_T`($sp)
 	br	%r14
 .size	sha1_block_data_order,.-sha1_block_data_order
-.string	"SHA1 block transform for s390x, CRYPTOGAMS by <appro\@openssl.org>"
+.string	"SHA1 block transform for s390x, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 $code =~ s/\`([^\`]*)\`/eval $1/gem;
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-sparcv9.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-sparcv9.pl
index 904eda64655..72ef0fb989f 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-sparcv9.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-sparcv9.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 #
 # Hardware SPARC T4 support by David S. Miller
 # ====================================================================
@@ -190,7 +190,7 @@ $code.=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #ifdef __arch64__
 .register	%g2,#scratch
@@ -371,7 +371,7 @@ $code.=<<___;
 	restore
 .type	sha1_block_data_order,#function
 .size	sha1_block_data_order,(.-sha1_block_data_order)
-.asciz	"SHA1 block transform for SPARCv9, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"SHA1 block transform for SPARCv9, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	4
 ___

diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-sparcv9a.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-sparcv9a.pl
index 1b7a7f9c912..95165f6eb4c 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-sparcv9a.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-sparcv9a.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2009-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # January 2009
@@ -544,7 +544,7 @@ $code.=<<___;
 	restore
 .type	sha1_block_data_order,#function
 .size	sha1_block_data_order,(.-sha1_block_data_order)
-.asciz	"SHA1 block transform for SPARCv9a, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"SHA1 block transform for SPARCv9a, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	4
 ___

diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-thumb.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-thumb.pl
index aece5ea0cdd..00e4dd7b3b6 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-thumb.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-thumb.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # sha1_block for Thumb.
@@ -258,7 +258,7 @@ $code.=<<___;
 .LK_40_59:	.word	0x8f1bbcdc
 .LK_60_79:	.word	0xca62c1d6
 .size	sha1_block_data_order,.-sha1_block_data_order
-.asciz	"SHA1 block transform for Thumb, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"SHA1 block transform for Thumb, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 print $code;
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-x86_64.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-x86_64.pl
index 829fe16a827..62823574d35 100755
--- a/deps/openssl/openssl/crypto/sha/asm/sha1-x86_64.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha1-x86_64.pl
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # sha1_block procedure for x86_64.
@@ -1857,7 +1857,7 @@ K_XX_XX:
 ___
 }}}
 $code.=<<___;
-.asciz	"SHA1 block transform for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"SHA1 block transform for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	64
 ___

diff --git a/deps/openssl/openssl/crypto/sha/asm/sha256-586.pl b/deps/openssl/openssl/crypto/sha/asm/sha256-586.pl
index 3983e55ff9e..3cf8e1217a1 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha256-586.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha256-586.pl
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # SHA256 block transform for x86. September 2007.
@@ -374,7 +374,7 @@ my $suffix=shift;
 	0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2	);
 &data_word(@K256);
 &data_word(0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f);	# byte swap mask
-&asciz("SHA256 block transform for x86, CRYPTOGAMS by <appro\@openssl.org>");
+&asciz("SHA256 block transform for x86, CRYPTOGAMS by <https://github.com/dot-asm>");

 ($a,$b,$c,$d,$e,$f,$g,$h)=(0..7);	# offsets
 sub off { &DWP(4*(((shift)-$i)&7),"esp"); }
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha256-armv4.pl b/deps/openssl/openssl/crypto/sha/asm/sha256-armv4.pl
index feb1f26109a..a874eac9a4c 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha256-armv4.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha256-armv4.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 #
 # Permission to use under GPL terms is granted.
 # ====================================================================
@@ -177,7 +177,7 @@ ___

 $code=<<___;
 #ifndef __KERNEL__
-# include "arm_arch.h"
+# include "arch/arm_arch.h"
 #else
 # define __ARM_ARCH__ __LINUX_ARM_ARCH__
 # define __ARM_MAX_ARCH__ 7
@@ -690,7 +690,7 @@ $code.=<<___;
 ___
 }}}
 $code.=<<___;
-.asciz  "SHA256 block transform for ARMv4/NEON/ARMv8, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz  "SHA256 block transform for ARMv4/NEON/ARMv8, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2
 #if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
 .extern   OPENSSL_armcap_P
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha256-c64xplus.pl b/deps/openssl/openssl/crypto/sha/asm/sha256-c64xplus.pl
index 13fd45fd762..7e8238f7132 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha256-c64xplus.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha256-c64xplus.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2012-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2012-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # SHA256 for C64x+.
@@ -310,7 +310,7 @@ K256:
 	.uword	0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3
 	.uword	0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208
 	.uword	0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
-	.cstring "SHA256 block transform for C64x+, CRYPTOGAMS by <appro\@openssl.org>"
+	.cstring "SHA256 block transform for C64x+, CRYPTOGAMS by <https://github.com/dot-asm>"
 	.align	4

 ___
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha256-loongarch64.pl b/deps/openssl/openssl/crypto/sha/asm/sha256-loongarch64.pl
new file mode 100644
index 00000000000..cb8dd97be8b
--- /dev/null
+++ b/deps/openssl/openssl/crypto/sha/asm/sha256-loongarch64.pl
@@ -0,0 +1,396 @@
+#! /usr/bin/env perl
+# This file is dual-licensed, meaning that you can use it under your
+# choice of either of the following two licenses:
+#
+# Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License"). You can obtain
+# a copy in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+#
+# or
+#
+# Copyright (c) 2025, Julian Zhu <jz531210@gmail.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use warnings;
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+my $output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+my $flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+my $use_lsx = $flavour && $flavour =~ /lsx/i ? 1 : 0;
+my $isaext = "_" . ( $use_lsx ? "lsx" : "la64v100" );
+
+$output and open STDOUT,">$output";
+
+my $code=<<___;
+.text
+___
+
+my $K256 = "K256";
+
+# Function arguments
+my ($zero,$ra,$tp,$sp,$fp)=("\$zero", "\$ra", "\$tp", "\$sp", "\$fp");
+my ($a0,$a1,$a2,$a3,$a4,$a5,$a6,$a7)=map("\$a$_",(0..7));
+my ($t0,$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8)=map("\$t$_",(0..8));
+my ($s0,$s1,$s2,$s3,$s4,$s5,$s6,$s7,$s8)=map("\$s$_",(0..8));
+my ($va0, $va1, $va2, $va3, $va4, $va5, $va6, $va7) = map("\$vr$_",(0..7));
+my ($vt0, $vt1, $vt2, $vt3, $vt4, $vt5, $vt6, $vt7) = map("\$vr$_",(8..15));
+
+my ($INP, $LEN, $ADDR) = ($a1, $a2, $sp);
+my ($KT, $T1, $T2, $T3, $T4, $T5, $T6) = ($t0, $t1, $t2, $t3, $t4, $t5, $t6);
+my ($A, $B, $C, $D, $E, $F, $G, $H) = ($s0, $s1, $s2, $s3, $s4, $s5, $s6, $s7);
+my @VMSGS = ($va0, $va1, $va2, $va3, $va4, $va5, $va6, $va7);
+
+sub strip {
+    my ($str) = @_;
+    $str =~ s/^\s+|\s+$//g;
+    return $str;
+}
+
+sub MSGSCHEDULE0_lsx {
+    my ($index) = @_;
+    my $msg = $VMSGS[$index / 2];
+    my $msg2 = $VMSGS[$index / 2 + 1];
+    my ($tmp0, $tmp1) = ($vt0, $vt1);
+    my $code;
+
+    if ($index % 4 == 0) {
+        $code = <<___;
+    vld $tmp0, $INP, @{[4*$index]}
+    vshuf4i.b $tmp0, $tmp0, 0b00011011  # 0123
+    vldi $msg2, 0
+    vilvl.w $msg, $msg2, $tmp0  # 0_1_
+    vilvh.w $msg2, $msg2, $tmp0  # 2_3_
+___
+    }
+
+    $code .= <<___;
+    vpickve2gr.w $T1, $msg, @{[($index%2)*2]}
+___
+
+    return strip($code);
+}
+
+sub MSGSCHEDULE0 {
+    my ($index) = @_;
+
+    if ($use_lsx) {
+        return MSGSCHEDULE0_lsx($index);
+    }
+
+    my $code=<<___;
+    ld.w $T1, $INP, @{[4*$index]}
+    revb.2w $T1, $T1
+    st.w $T1, $ADDR, @{[4*$index]}
+___
+
+    return strip($code);
+}
+
+sub MSGSCHEDULE1_lsx {
+    my ($index) = @_;
+    my $msgidx = ($index / 2) % 8;
+    my $m01 = $VMSGS[$msgidx];
+    my $m23 = $VMSGS[($msgidx + 1) % 8];
+    my $m45 = $VMSGS[($msgidx + 2) % 8];
+    my $m67 = $VMSGS[($msgidx + 3) % 8];
+    my $m89 = $VMSGS[($msgidx + 4) % 8];
+    my $mab = $VMSGS[($msgidx + 5) % 8];
+    my $mcd = $VMSGS[($msgidx + 6) % 8];
+    my $mef = $VMSGS[($msgidx + 7) % 8];
+    my ($m12, $tmp0, $tmp1) = ($vt0, $vt1, $vt2);
+    my $code;
+
+    if ($index % 2 == 0) {
+        # re-align to get $m12 and "$m9a" ($tmp0)
+        # $m01 += $m9a
+        $code = <<___;
+    # m01 & new = $m01, m23 = $m23, m45 = $m45, m67 = $m67
+    # m89 = $m89, mab = $mab, mcd = $mcd, mef = $mef
+    vbsrl.v $m12, $m01, 8  # 1___
+    vextrins.w $m12, $m23, 0b00100000  # 1_2_
+    vbsrl.v $tmp0, $m89, 8  # 9___
+    vextrins.w $tmp0, $mab, 0b00100000  # 9_a_
+    vadd.w $m01, $m01, $tmp0
+___
+
+        # $m01 += sigma0($m12)
+        $code .= <<___;
+    vrotri.w $tmp0, $m12, 7
+    vrotri.w $tmp1, $m12, 18
+    vsrli.w $m12, $m12, 3
+    vxor.v $tmp0, $tmp0, $tmp1
+    vxor.v $m12, $m12, $tmp0
+    vadd.w $m01, $m01, $m12
+___
+
+        # $m01 += sigma1($mef)
+        # now m1234 can be re-used as temporary
+        $code .= <<___;
+    vrotri.w $tmp0, $mef, 17
+    vrotri.w $tmp1, $mef, 19
+    vsrli.w $m12, $mef, 10
+    vxor.v $tmp0, $tmp0, $tmp1
+    vxor.v $m12, $m12, $tmp0
+    vadd.w $m01, $m01, $m12
+___
+    }
+
+    $code .= <<___;
+    vpickve2gr.w $T1, $m01, @{[($index%2)*2]}
+___
+
+    return strip($code);
+}
+
+sub MSGSCHEDULE1 {
+    my ($index) = @_;
+
+    if ($use_lsx) {
+        return MSGSCHEDULE1_lsx($index);
+    }
+
+    my $code=<<___;
+    ld.w $T1, $ADDR, @{[(($index-2)&0x0f)*4]}
+    ld.w $T2, $ADDR, @{[(($index-15)&0x0f)*4]}
+    ld.w $T3, $ADDR, @{[(($index-7)&0x0f)*4]}
+    ld.w $T4, $ADDR, @{[($index&0x0f)*4]}
+    rotri.w $T5, $T1, 17
+    rotri.w $T6, $T1, 19
+    srli.w $T1, $T1, 10
+    xor $T1, $T1, $T5
+    xor $T1, $T1, $T6
+    add.w $T1, $T1, $T3
+    rotri.w $T5, $T2, 7
+    rotri.w $T6, $T2, 18
+    srli.w $T2, $T2, 3
+    xor $T2, $T2, $T5
+    xor $T2, $T2, $T6
+    add.w $T1, $T1, $T2
+    add.w $T1, $T1, $T4
+    st.w $T1, $ADDR, @{[($index&0x0f)*4]}
+___
+    return strip($code);
+}
+
+sub sha256_T1 {
+    my ($index, $e, $f, $g, $h) = @_;
+    my $code=<<___;
+    ld.w $T4, $KT, @{[4*$index]}
+    add.w $h, $h, $T1
+    add.w $h, $h, $T4
+    rotri.w $T2, $e, 6
+    rotri.w $T3, $e, 11
+    rotri.w $T4, $e, 25
+    xor $T2, $T2, $T3
+    xor $T1, $f, $g
+    xor $T2, $T2, $T4
+    and $T1, $T1, $e
+    add.w $h, $h, $T2
+    xor $T1, $T1, $g
+    add.w $T1, $T1, $h
+___
+    return strip($code);
+}
+
+sub sha256_T2 {
+    my ($a, $b, $c) = @_;
+    my $code=<<___;
+    rotri.w $T2, $a, 2
+    rotri.w $T3, $a, 13
+    rotri.w $T4, $a, 22
+    xor $T2, $T2, $T3
+    xor $T2, $T2, $T4
+    xor $T4, $b, $c
+    and $T3, $b, $c
+    and $T4, $T4, $a
+    xor $T4, $T4, $T3
+    add.w $T2, $T2, $T4
+___
+    return strip($code);
+}
+
+sub SHA256ROUND {
+    my ($index, $a, $b, $c, $d, $e, $f, $g, $h) = @_;
+    my $ms = $index < 16 ? \&MSGSCHEDULE0 : \&MSGSCHEDULE1;
+    my $code=<<___;
+    @{[$ms->($index)]}
+    @{[sha256_T1 $index, $e, $f, $g, $h]}
+    @{[sha256_T2 $a, $b, $c]}
+    add.w $d, $d, $T1
+    add.w $h, $T2, $T1
+___
+    return strip($code);
+}
+
+################################################################################
+# void sha256_block_data_order$isaext(void *c, const void *p, size_t len)
+$code .= <<___;
+.p2align 3
+.globl sha256_block_data_order@{[$isaext]}
+.type   sha256_block_data_order@{[$isaext]},\@function
+sha256_block_data_order@{[$isaext]}:
+
+    addi.d $sp, $sp, -80
+
+    st.d $s0, $sp, 0
+    st.d $s1, $sp, 8
+    st.d $s2, $sp, 16
+    st.d $s3, $sp, 24
+    st.d $s4, $sp, 32
+    st.d $s5, $sp, 40
+    st.d $s6, $sp, 48
+    st.d $s7, $sp, 56
+    st.d $s8, $sp, 64
+    st.d $fp, $sp, 72
+___
+
+# SHA256 LSX needs neither dedicated shuffle control word, nor stack space for
+# internal states
+if (!$use_lsx) {
+    $code .= <<___;
+    addi.d $sp, $sp, -64
+___
+}
+
+$code .= <<___;
+    la $KT, $K256
+
+    # load ctx
+    ld.w $A, $a0, 0
+    ld.w $B, $a0, 4
+    ld.w $C, $a0, 8
+    ld.w $D, $a0, 12
+    ld.w $E, $a0, 16
+    ld.w $F, $a0, 20
+    ld.w $G, $a0, 24
+    ld.w $H, $a0, 28
+
+L_round_loop:
+    # Decrement length by 1
+    addi.d $LEN, $LEN, -1
+___
+
+for (my $i = 0; $i < 64; $i += 8) {
+    $code .= <<___;
+    @{[SHA256ROUND $i, $A, $B, $C, $D, $E, $F, $G, $H]}
+    @{[SHA256ROUND $i+1, $H, $A, $B, $C, $D, $E, $F, $G]}
+    @{[SHA256ROUND $i+2, $G, $H, $A, $B, $C, $D, $E, $F]}
+    @{[SHA256ROUND $i+3, $F, $G, $H, $A, $B, $C, $D, $E]}
+    @{[SHA256ROUND $i+4, $E, $F, $G, $H, $A, $B, $C, $D]}
+    @{[SHA256ROUND $i+5, $D, $E, $F, $G, $H, $A, $B, $C]}
+    @{[SHA256ROUND $i+6, $C, $D, $E, $F, $G, $H, $A, $B]}
+    @{[SHA256ROUND $i+7, $B, $C, $D, $E, $F, $G, $H, $A]}
+___
+}
+
+$code .= <<___;
+    ld.w $T1, $a0, 0
+    ld.w $T2, $a0, 4
+    ld.w $T3, $a0, 8
+    ld.w $T4, $a0, 12
+
+    add.w $A, $A, $T1
+    add.w $B, $B, $T2
+    add.w $C, $C, $T3
+    add.w $D, $D, $T4
+
+    st.w $A, $a0, 0
+    st.w $B, $a0, 4
+    st.w $C, $a0, 8
+    st.w $D, $a0, 12
+
+    ld.w $T1, $a0, 16
+    ld.w $T2, $a0, 20
+    ld.w $T3, $a0, 24
+    ld.w $T4, $a0, 28
+
+    add.w $E, $E, $T1
+    add.w $F, $F, $T2
+    add.w $G, $G, $T3
+    add.w $H, $H, $T4
+
+    st.w $E, $a0, 16
+    st.w $F, $a0, 20
+    st.w $G, $a0, 24
+    st.w $H, $a0, 28
+
+    addi.d $INP, $INP, 64
+
+    bnez $LEN, L_round_loop
+___
+
+if (!$use_lsx) {
+    $code .= <<___;
+    addi.d $sp, $sp, 64
+___
+}
+
+$code .= <<___;
+    ld.d $s0, $sp, 0
+    ld.d $s1, $sp, 8
+    ld.d $s2, $sp, 16
+    ld.d $s3, $sp, 24
+    ld.d $s4, $sp, 32
+    ld.d $s5, $sp, 40
+    ld.d $s6, $sp, 48
+    ld.d $s7, $sp, 56
+    ld.d $s8, $sp, 64
+    ld.d $fp, $sp, 72
+
+    addi.d $sp, $sp, 80
+
+    ret
+.size sha256_block_data_order@{[$isaext]},.-sha256_block_data_order@{[$isaext]}
+
+.section .rodata
+.p2align 3
+.type $K256,\@object
+$K256:
+    .word 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5
+    .word 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5
+    .word 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3
+    .word 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174
+    .word 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc
+    .word 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da
+    .word 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7
+    .word 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967
+    .word 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13
+    .word 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85
+    .word 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3
+    .word 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070
+    .word 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5
+    .word 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3
+    .word 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208
+    .word 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
+.size $K256,.-$K256
+___
+
+print $code;
+
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha256-mb-x86_64.pl b/deps/openssl/openssl/crypto/sha/asm/sha256-mb-x86_64.pl
index e53517d787f..d43d31b4510 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha256-mb-x86_64.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha256-mb-x86_64.pl
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # Multi-buffer SHA256 procedure processes n buffers in parallel by
@@ -1396,7 +1396,7 @@ K256_shaext:
 	.long	0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
 	.long	0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
 	.long	0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
-	.asciz	"SHA256 multi-block transform for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+	.asciz	"SHA256 multi-block transform for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .previous
 ___

diff --git a/deps/openssl/openssl/crypto/sha/asm/sha256-riscv64-zbb.pl b/deps/openssl/openssl/crypto/sha/asm/sha256-riscv64-zbb.pl
new file mode 100644
index 00000000000..2755e4483c1
--- /dev/null
+++ b/deps/openssl/openssl/crypto/sha/asm/sha256-riscv64-zbb.pl
@@ -0,0 +1,484 @@
+#! /usr/bin/env perl
+# This file is dual-licensed, meaning that you can use it under your
+# choice of either of the following two licenses:
+#
+# Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License"). You can obtain
+# a copy in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+#
+# or
+#
+# Copyright (c) 2025-2026, Julian Zhu <julian.oerv@isrc.iscas.ac.cn>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# The generated code of this file depends on the following RISC-V extensions:
+# - RV64I
+# Optional:
+# - RISC-V Basic Bit-manipulation extension ('Zbb')
+
+use strict;
+use warnings;
+
+use FindBin qw($Bin);
+use lib "$Bin";
+use lib "$Bin/../../perlasm";
+use riscv;
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+my $output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+my $flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+my $use_zbb = $flavour && $flavour =~ /zbb/i ? 1 : 0;
+my $isaext = "_" . ( $use_zbb ? "zbb" : "riscv64" );
+
+$output and open STDOUT,">$output";
+
+my $code=<<___;
+.text
+___
+
+my $K256 = "K256";
+
+# Function arguments
+my ($INP, $LEN, $ADDR) = ("a1", "a2", "sp");
+my ($KT, $T1, $T2, $T3, $T4, $T5, $T6, $T7, $T8) = ("t0", "t1", "t2", "t3", "t4", "t5", "t6", "a3", "a4");
+# Shift amounts for misaligned input (Zbb only, T7/T8 are free there)
+my ($SHL, $SHR) = ($T7, $T8);
+my ($MISALIGNED_INPUT, $ALIGNED_INPUT) = (0, 1);
+# Parity-indexed pairs: W = W[i], U = W[i-15], X = a ^ b
+my ($W0, $W1, $U0, $U1, $X0, $X1) = ("a5", "a6", "a7", "s0", "s1", "s10");
+my ($A, $B, $C, $D ,$E ,$F ,$G ,$H) = ("s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9");
+
+# Misaligned: $dst = (lo >> SHL) | (hi << SHR) from two aligned loads
+sub loadDword {
+    my ($ALIGNED, $dst, $off) = @_;
+    if ($ALIGNED) {
+        return "ld $dst, $off($INP)";
+    }
+    my $code=<<___;
+    ld $T5, $off($INP)
+    ld $T6, ($off+8)($INP)
+    srl $dst, $T5, $SHL
+    sll $T6, $T6, $SHR
+    or $dst, $dst, $T6
+___
+    return $code;
+}
+
+sub MSGSCHEDULE0 {
+    my ($ALIGNED, $index) = @_;
+    if ($use_zbb) {
+        # Odd rounds: W[i] is already in W1
+        if ($index & 1) {
+            return "";
+        }
+        my $code=<<___;
+        @{[loadDword $ALIGNED, $W1, "4*$index"]}
+        @{[rev8 $W1, $W1]} # rev8 $W1, $W1
+        srli $W0, $W1, 32
+        sw $W0, 4*$index($ADDR)
+        sw $W1, (4*$index+4)($ADDR)
+___
+        return $code;
+    } else {
+        my $Wi = ($index & 1) ? $W1 : $W0;
+        my $code=<<___;
+        lbu $T1, (4*$index+0)($INP)
+        lbu $T2, (4*$index+1)($INP)
+        lbu $T3, (4*$index+2)($INP)
+        lbu $T4, (4*$index+3)($INP)
+        slliw $T1, $T1, 24
+        slliw $T2, $T2, 16
+        or $T1, $T1, $T2
+        slliw $T3, $T3, 8
+        or $T1, $T1, $T3
+        or $Wi, $T1, $T4
+        sw $Wi, 4*$index($ADDR)
+___
+        return $code;
+    }
+}
+
+# W[i-2] and W[i-16] are already in registers
+sub MSGSCHEDULE1 {
+    my ($INDEX) = @_;
+    my $Wi2 = ($INDEX & 1) ? $W1 : $W0;
+    # W[i] overwrites W[i-2], so it is written last
+    my $Wi = $Wi2;
+    my $Wi15 = ($INDEX & 1) ? $U1 : $U0;
+    my $Wi16 = ($INDEX & 1) ? $U0 : $U1;
+    my $code=<<___;
+    lw $T3, (($INDEX-7)&0x0f)*4($ADDR)
+    lw $Wi15, (($INDEX-15)&0x0f)*4($ADDR)
+___
+    if ($use_zbb) {
+        my $ror_part = <<___;
+        @{[roriw $T5, $Wi2, 17]}
+        @{[roriw $T6, $Wi2, 19]}
+___
+        $code .= $ror_part;
+    } else {
+        my $ror_part = <<___;
+        @{[roriw_rv64i $T5, $Wi2, $T7, $T8, 17]}
+        @{[roriw_rv64i $T6, $Wi2, $T7, $T8, 19]}
+___
+        $code .= $ror_part;
+    }
+    $code .= <<___;
+    srliw $T1, $Wi2, 10
+    xor $T1, $T1, $T5
+    xor $T1, $T1, $T6
+    addw $T1, $T1, $T3
+___
+    if ($use_zbb) {
+        my $ror_part = <<___;
+        @{[roriw $T5, $Wi15, 7]}
+        @{[roriw $T6, $Wi15, 18]}
+___
+        $code .= $ror_part;
+    } else {
+        my $ror_part = <<___;
+        @{[roriw_rv64i $T5, $Wi15, $T7, $T8, 7]}
+        @{[roriw_rv64i $T6, $Wi15, $T7, $T8, 18]}
+___
+        $code .= $ror_part;
+    }
+    $code .= <<___;
+    srliw $T2, $Wi15, 3
+    xor $T2, $T2, $T5
+    xor $T2, $T2, $T6
+    addw $T2, $T2, $Wi16
+    addw $Wi, $T1, $T2
+    sw $Wi, 4*($INDEX&0x0f)($ADDR)
+___
+
+    return $code;
+}
+
+sub sha256_T1 {
+    my ($INDEX, $e, $f, $g, $h) = @_;
+    my $Wi = ($INDEX & 1) ? $W1 : $W0;
+    my $code=<<___;
+    lw $T4, 4*$INDEX($KT)
+___
+    if ($use_zbb) {
+        my $ror_part = <<___;
+        @{[roriw $T2, $e, 6]}
+        @{[roriw $T3, $e, 11]}
+        @{[roriw $T5, $e, 25]}
+___
+        $code .= $ror_part;
+    } else {
+        my $ror_part = <<___;
+        @{[roriw_rv64i $T2, $e, $T7, $T8, 6]}
+        @{[roriw_rv64i $T3, $e, $T7, $T8, 11]}
+        @{[roriw_rv64i $T5, $e, $T7, $T8, 25]}
+___
+        $code .= $ror_part;
+    }
+    $code .= <<___;
+    addw $h, $h, $Wi
+    xor $T1, $f, $g
+    addw $h, $h, $T4
+    xor $T2, $T2, $T3
+    and $T1, $T1, $e
+    xor $T2, $T2, $T5
+    xor $T1, $T1, $g
+    addw $T2, $T2, $h
+    addw $T1, $T1, $T2
+___
+
+    return $code;
+}
+
+sub sha256_T2 {
+    my ($INDEX, $a, $b, $c) = @_;
+    my $Xab = ($INDEX & 1) ? $X1 : $X0;
+    my $Xbc = ($INDEX & 1) ? $X0 : $X1;
+    my $code=<<___;
+    # Sum0
+___
+    if ($use_zbb) {
+        my $ror_part = <<___;
+        @{[roriw $T2, $a, 2]}
+        @{[roriw $T3, $a, 13]}
+        @{[roriw $T4, $a, 22]}
+___
+        $code .= $ror_part;
+    } else {
+        my $ror_part = <<___;
+        @{[roriw_rv64i $T2, $a, $T7, $T8, 2]}
+        @{[roriw_rv64i $T3, $a, $T7, $T8, 13]}
+        @{[roriw_rv64i $T4, $a, $T7, $T8, 22]}
+___
+        $code .= $ror_part;
+    }
+    $code .= <<___;
+    # Maj
+    xor $Xab, $a, $b
+    xor $T2, $T2, $T3
+    and $T5, $Xab, $Xbc
+    xor $T2, $T2, $T4
+    xor $T5, $T5, $b
+    # T2
+    addw $T2, $T2, $T5
+___
+
+    return $code;
+}
+
+sub SHA256ROUND {
+    my ($INDEX, $a, $b, $c, $d, $e, $f, $g, $h) = @_;
+    my $code=<<___;
+    @{[sha256_T1 $INDEX, $e, $f, $g, $h]}
+    @{[sha256_T2 $INDEX, $a, $b, $c]}
+    addw $d, $d, $T1
+    addw $h, $T2, $T1
+___
+
+    return $code;
+}
+
+sub SHA256ROUND0 {
+    my ($ALIGNED, $INDEX, $a, $b, $c, $d, $e, $f, $g, $h) = @_;
+    my $code=<<___;
+    @{[MSGSCHEDULE0 $ALIGNED, $INDEX]}
+    @{[SHA256ROUND $INDEX, $a, $b, $c, $d, $e, $f, $g, $h]}
+___
+
+    return $code;
+}
+
+sub SHA256ROUND1 {
+    my ($INDEX, $a, $b, $c, $d, $e, $f, $g, $h) = @_;
+    my $code=<<___;
+    @{[MSGSCHEDULE1 $INDEX]}
+    @{[SHA256ROUND $INDEX, $a, $b, $c, $d, $e, $f, $g, $h]}
+___
+
+    return $code;
+}
+
+################################################################################
+# void sha256_block_data_order@{[$isaext]}(void *c, const void *p, size_t len)
+$code .= <<___;
+.p2align 3
+.globl sha256_block_data_order@{[$isaext]}
+.type   sha256_block_data_order@{[$isaext]},\@function
+sha256_block_data_order@{[$isaext]}:
+
+    addi sp, sp, -96
+
+    sd s0, 0(sp)
+    sd s1, 8(sp)
+    sd s2, 16(sp)
+    sd s3, 24(sp)
+    sd s4, 32(sp)
+    sd s5, 40(sp)
+    sd s6, 48(sp)
+    sd s7, 56(sp)
+    sd s8, 64(sp)
+    sd s9, 72(sp)
+    sd s10, 80(sp)
+    sd s11, 88(sp)
+
+    addi sp, sp, -64
+
+    la $KT, $K256
+
+    # load ctx
+    lw $A, 0(a0)
+    lw $B, 4(a0)
+    lw $C, 8(a0)
+    lw $D, 12(a0)
+    lw $E, 16(a0)
+    lw $F, 20(a0)
+    lw $G, 24(a0)
+    lw $H, 28(a0)
+___
+
+if ($use_zbb) {
+$code .= <<___;
+
+    andi $SHL, $INP, 7
+    beqz $SHL, L_round_loop
+    andi $INP, $INP, -8
+    slli $SHL, $SHL, 3
+    li $T1, 64
+    sub $SHR, $T1, $SHL
+___
+}
+
+$code .= <<___;
+
+L_round_loop:
+    # Decrement length by 1
+    addi $LEN, $LEN, -1
+
+    # b ^ c for round 0's Maj; later rounds reuse the previous a ^ b
+    xor $X1, $B, $C
+___
+
+# Rounds 0..15, plus a misaligned-input copy for Zbb (byte loads need none)
+if ($use_zbb) {
+    $code .= <<___;
+    bnez $SHL, L_load_misaligned
+___
+}
+
+for (my $i = 0; $i < 16; $i += 8) {
+    $code .= <<___;
+    @{[SHA256ROUND0 $ALIGNED_INPUT, $i, $A, $B, $C, $D, $E, $F, $G, $H]}
+    @{[SHA256ROUND0 $ALIGNED_INPUT, $i+1, $H, $A, $B, $C, $D, $E, $F, $G]}
+    @{[SHA256ROUND0 $ALIGNED_INPUT, $i+2, $G, $H, $A, $B, $C, $D, $E, $F]}
+    @{[SHA256ROUND0 $ALIGNED_INPUT, $i+3, $F, $G, $H, $A, $B, $C, $D, $E]}
+    @{[SHA256ROUND0 $ALIGNED_INPUT, $i+4, $E, $F, $G, $H, $A, $B, $C, $D]}
+    @{[SHA256ROUND0 $ALIGNED_INPUT, $i+5, $D, $E, $F, $G, $H, $A, $B, $C]}
+    @{[SHA256ROUND0 $ALIGNED_INPUT, $i+6, $C, $D, $E, $F, $G, $H, $A, $B]}
+    @{[SHA256ROUND0 $ALIGNED_INPUT, $i+7, $B, $C, $D, $E, $F, $G, $H, $A]}
+___
+}
+
+if ($use_zbb) {
+    $code .= <<___;
+    j L_message_schedule
+L_load_misaligned:
+___
+    for (my $i = 0; $i < 16; $i += 8) {
+        $code .= <<___;
+    @{[SHA256ROUND0 $MISALIGNED_INPUT, $i, $A, $B, $C, $D, $E, $F, $G, $H]}
+    @{[SHA256ROUND0 $MISALIGNED_INPUT, $i+1, $H, $A, $B, $C, $D, $E, $F, $G]}
+    @{[SHA256ROUND0 $MISALIGNED_INPUT, $i+2, $G, $H, $A, $B, $C, $D, $E, $F]}
+    @{[SHA256ROUND0 $MISALIGNED_INPUT, $i+3, $F, $G, $H, $A, $B, $C, $D, $E]}
+    @{[SHA256ROUND0 $MISALIGNED_INPUT, $i+4, $E, $F, $G, $H, $A, $B, $C, $D]}
+    @{[SHA256ROUND0 $MISALIGNED_INPUT, $i+5, $D, $E, $F, $G, $H, $A, $B, $C]}
+    @{[SHA256ROUND0 $MISALIGNED_INPUT, $i+6, $C, $D, $E, $F, $G, $H, $A, $B]}
+    @{[SHA256ROUND0 $MISALIGNED_INPUT, $i+7, $B, $C, $D, $E, $F, $G, $H, $A]}
+___
+    }
+}
+
+$code .= <<___;
+L_message_schedule:
+    # Round 16's W[i-16] is W[0]; later rounds reuse the previous W[i-15]
+    lw $U1, 0($ADDR)
+___
+
+for (my $i = 16; $i < 64; $i += 8) {
+    $code .= <<___;
+    @{[SHA256ROUND1 $i, $A, $B, $C, $D, $E, $F, $G, $H]}
+    @{[SHA256ROUND1 $i+1, $H, $A, $B, $C, $D, $E, $F, $G]}
+    @{[SHA256ROUND1 $i+2, $G, $H, $A, $B, $C, $D, $E, $F]}
+    @{[SHA256ROUND1 $i+3, $F, $G, $H, $A, $B, $C, $D, $E]}
+    @{[SHA256ROUND1 $i+4, $E, $F, $G, $H, $A, $B, $C, $D]}
+    @{[SHA256ROUND1 $i+5, $D, $E, $F, $G, $H, $A, $B, $C]}
+    @{[SHA256ROUND1 $i+6, $C, $D, $E, $F, $G, $H, $A, $B]}
+    @{[SHA256ROUND1 $i+7, $B, $C, $D, $E, $F, $G, $H, $A]}
+___
+}
+
+$code .= <<___;
+    lw $T1, 0(a0)
+    lw $T2, 4(a0)
+    lw $T3, 8(a0)
+    lw $T4, 12(a0)
+
+    addw $A, $A, $T1
+    addw $B, $B, $T2
+    addw $C, $C, $T3
+    addw $D, $D, $T4
+
+    sw $A, 0(a0)
+    sw $B, 4(a0)
+    sw $C, 8(a0)
+    sw $D, 12(a0)
+
+    lw $T1, 16(a0)
+    lw $T2, 20(a0)
+    lw $T3, 24(a0)
+    lw $T4, 28(a0)
+
+    addw $E, $E, $T1
+    addw $F, $F, $T2
+    addw $G, $G, $T3
+    addw $H, $H, $T4
+
+    sw $E, 16(a0)
+    sw $F, 20(a0)
+    sw $G, 24(a0)
+    sw $H, 28(a0)
+
+    addi $INP, $INP, 64
+
+    bnez $LEN, L_round_loop
+
+    addi sp, sp, 64
+
+    ld s0, 0(sp)
+    ld s1, 8(sp)
+    ld s2, 16(sp)
+    ld s3, 24(sp)
+    ld s4, 32(sp)
+    ld s5, 40(sp)
+    ld s6, 48(sp)
+    ld s7, 56(sp)
+    ld s8, 64(sp)
+    ld s9, 72(sp)
+    ld s10, 80(sp)
+    ld s11, 88(sp)
+
+    addi sp, sp, 96
+
+    ret
+.size sha256_block_data_order@{[$isaext]},.-sha256_block_data_order@{[$isaext]}
+
+.section .rodata
+.p2align 3
+.type $K256,\@object
+$K256:
+    .word 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5
+    .word 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5
+    .word 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3
+    .word 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174
+    .word 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc
+    .word 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da
+    .word 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7
+    .word 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967
+    .word 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13
+    .word 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85
+    .word 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3
+    .word 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070
+    .word 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5
+    .word 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3
+    .word 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208
+    .word 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
+.size $K256,.-$K256
+___
+
+print $code;
+
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha256-riscv64-zvkb-zvknha_or_zvknhb.pl b/deps/openssl/openssl/crypto/sha/asm/sha256-riscv64-zvkb-zvknha_or_zvknhb.pl
index 5e4d6be3457..74fc9a7555e 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha256-riscv64-zvkb-zvknha_or_zvknhb.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha256-riscv64-zvkb-zvknha_or_zvknhb.pl
@@ -117,9 +117,11 @@ $code .= <<___;
 .globl sha256_block_data_order_zvkb_zvknha_or_zvknhb
 .type   sha256_block_data_order_zvkb_zvknha_or_zvknhb,\@function
 sha256_block_data_order_zvkb_zvknha_or_zvknhb:
-    @{[vsetivli "zero", 4, "e32", "m1", "ta", "ma"]}

-    @{[sha_256_load_constant]}
+    # Setup v0 mask for the vmerge to replace the first word (idx==0) in key-scheduling.
+    # The AVL is 4 in SHA, so we could use a single e8(8 element masking) for masking.
+    @{[vsetivli "zero", 1, "e8", "m1", "ta", "ma"]}
+    @{[vmv_v_i $V0, 0x01]}

     # H is stored as {a,b,c,d},{e,f,g,h}, but we need {f,e,b,a},{h,g,d,c}
     # The dst vtype is e32m1 and the index vtype is e8mf4.
@@ -141,12 +143,7 @@ sha256_block_data_order_zvkb_zvknha_or_zvknhb:
     @{[vluxei8_v $V6, $H, $V26]}
     @{[vluxei8_v $V7, $H2, $V26]}

-    # Setup v0 mask for the vmerge to replace the first word (idx==0) in key-scheduling.
-    # The AVL is 4 in SHA, so we could use a single e8(8 element masking) for masking.
-    @{[vsetivli "zero", 1, "e8", "m1", "ta", "ma"]}
-    @{[vmv_v_i $V0, 0x01]}
-
-    @{[vsetivli "zero", 4, "e32", "m1", "ta", "ma"]}
+    @{[sha_256_load_constant]}

 L_round_loop:
     # Decrement length by 1
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-586.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-586.pl
index c25e773b0aa..d7bca420f62 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha512-586.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512-586.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # SHA512 block transform for x86. September 2007.
@@ -917,7 +917,7 @@ sub BODY_00_15_ssse3 {		# "phase-less" copy of BODY_00_15_sse2
 	&data_word(0x04050607,0x00010203);	# byte swap
 	&data_word(0x0c0d0e0f,0x08090a0b);	# mask
 &function_end_B("sha512_block_data_order");
-&asciz("SHA512 block transform for x86, CRYPTOGAMS by <appro\@openssl.org>");
+&asciz("SHA512 block transform for x86, CRYPTOGAMS by <https://github.com/dot-asm>");

 &asm_finish();

diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-armv4.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-armv4.pl
index 9aa310ffd05..8c65869c096 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha512-armv4.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512-armv4.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 #
 # Permission to use under GPL terms is granted.
 # ====================================================================
@@ -43,8 +43,8 @@
 # terms it's 22.6 cycles per byte, which is disappointing result.
 # Technical writers asserted that 3-way S4 pipeline can sustain
 # multiple NEON instructions per cycle, but dual NEON issue could
-# not be observed, see http://www.openssl.org/~appro/Snapdragon-S4.html
-# for further details. On side note Cortex-A15 processes one byte in
+# not be observed.
+# On side note Cortex-A15 processes one byte in
 # 16 cycles.

 # Byte order [in]dependence. =========================================
@@ -203,7 +203,7 @@ my $_word = ($flavour =~ /win/ ? "DCDU" : ".word");

 $code=<<___;
 #ifndef __KERNEL__
-# include "arm_arch.h"
+# include "arch/arm_arch.h"
 # define VFP_ABI_PUSH	vstmdb	sp!,{d8-d15}
 # define VFP_ABI_POP	vldmia	sp!,{d8-d15}
 #else
@@ -291,6 +291,7 @@ WORD64(0x5fcb6fab,0x3ad6faec, 0x6c44198c,0x4a475817)

 .global	sha512_block_data_order
 .type	sha512_block_data_order,%function
+.align 5
 sha512_block_data_order:
 .Lsha512_block_data_order:
 #if __ARM_ARCH__<7 && !defined(__thumb2__)
@@ -657,7 +658,7 @@ $code.=<<___;
 ___
 }
 $code.=<<___;
-.asciz	"SHA512 block transform for ARMv4/NEON, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"SHA512 block transform for ARMv4/NEON, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2
 #if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
 .extern	OPENSSL_armcap_P
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-armv8.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-armv8.pl
index 90e2a2e5a7a..49709198263 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha512-armv8.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512-armv8.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2014-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2014-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -7,10 +7,10 @@
 # https://www.openssl.org/source/license.html

 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 #
 # Permission to use under GPLv2 terms is granted.
 # ====================================================================
@@ -190,7 +190,7 @@ ___
 }

 $code.=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"
 #ifndef	__KERNEL__
 .extern	OPENSSL_armcap_P
 .hidden	OPENSSL_armcap_P
@@ -356,7 +356,7 @@ $code.=<<___ if ($SZ==4);
 ___
 $code.=<<___;
 .size	.LK$BITS,.-.LK$BITS
-.asciz	"SHA$BITS block transform for ARMv8, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"SHA$BITS block transform for ARMv8, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2

 .text
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-c64xplus.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-c64xplus.pl
index 867f2a42d65..834c881cb17 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha512-c64xplus.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512-c64xplus.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2012-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2012-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # SHA512 for C64x+.
@@ -429,7 +429,7 @@ K512:
 	.uword	0x3c9ebe0a,0x15c9bebc, 0x431d67c4,0x9c100d4c
 	.uword	0x4cc5d4be,0xcb3e42b6, 0x597f299c,0xfc657e2a
 	.uword	0x5fcb6fab,0x3ad6faec, 0x6c44198c,0x4a475817
-	.cstring "SHA512 block transform for C64x+, CRYPTOGAMS by <appro\@openssl.org>"
+	.cstring "SHA512 block transform for C64x+, CRYPTOGAMS by <https://github.com/dot-asm>"
 	.align	4
 ___

diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-ia64.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-ia64.pl
index e147f2682d5..02345060dee 100755
--- a/deps/openssl/openssl/crypto/sha/asm/sha512-ia64.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512-ia64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2004-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================
 #
 # SHA256/512_Transform for Itanium.
@@ -121,7 +121,7 @@ if (!defined($big_endian))

 $code=<<___;
 .ident  \"$output, version 2.0\"
-.ident  \"IA-64 ISA artwork by Andy Polyakov <appro\@openssl.org>\"
+.ident  \"IA-64 ISA artwork by Andy Polyakov <https://github.com/dot-asm>\"
 .explicit
 .text

@@ -643,7 +643,7 @@ K256:	data4	0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
 	data4	0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
 	data4	0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
 .size	K256#,$SZ*$rounds
-stringz	"SHA256 block transform for IA64, CRYPTOGAMS by <appro\@openssl.org>"
+stringz	"SHA256 block transform for IA64, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___
 print<<___ if ($BITS==64);
 .align	64
@@ -689,5 +689,5 @@ K512:	data8	0x428a2f98d728ae22,0x7137449123ef65cd
 	data8	0x4cc5d4becb3e42b6,0x597f299cfc657e2a
 	data8	0x5fcb6fab3ad6faec,0x6c44198c4a475817
 .size	K512#,$SZ*$rounds
-stringz	"SHA512 block transform for IA64, CRYPTOGAMS by <appro\@openssl.org>"
+stringz	"SHA512 block transform for IA64, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-loongarch64.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-loongarch64.pl
new file mode 100644
index 00000000000..82e62449635
--- /dev/null
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512-loongarch64.pl
@@ -0,0 +1,414 @@
+#! /usr/bin/env perl
+# This file is dual-licensed, meaning that you can use it under your
+# choice of either of the following two licenses:
+#
+# Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License"). You can obtain
+# a copy in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+#
+# or
+#
+# Copyright (c) 2025, Julian Zhu <jz531210@gmail.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use warnings;
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+my $output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+my $flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+my $use_lsx = $flavour && $flavour =~ /lsx/i ? 1 : 0;
+my $isaext = "_" . ( $use_lsx ? "lsx" : "la64v100" );
+
+$output and open STDOUT,">$output";
+
+my $code=<<___;
+.text
+___
+
+my $K512 = "K512";
+
+# Function arguments
+my ($zero,$ra,$tp,$sp,$fp)=("\$zero", "\$ra", "\$tp", "\$sp", "\$fp");
+my ($a0,$a1,$a2,$a3,$a4,$a5,$a6,$a7)=map("\$a$_",(0..7));
+my ($t0,$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8)=map("\$t$_",(0..8));
+my ($s0,$s1,$s2,$s3,$s4,$s5,$s6,$s7,$s8)=map("\$s$_",(0..8));
+my ($va0, $va1, $va2, $va3, $va4, $va5, $va6, $va7) = map("\$vr$_",(0..7));
+my ($vt0, $vt1, $vt2, $vt3, $vt4, $vt5, $vt6, $vt7) = map("\$vr$_",(8..15));
+
+my ($INP, $LEN, $ADDR) = ($a1, $a2, $sp);
+my ($KT, $T1, $T2, $T3, $T4, $T5, $T6) = ($t0, $t1, $t2, $t3, $t4, $t5, $t6);
+my ($A, $B, $C, $D, $E, $F, $G, $H) = ($s0, $s1, $s2, $s3, $s4, $s5, $s6, $s7);
+my @VMSGS = ($va0, $va1, $va2, $va3, $va4, $va5, $va6, $va7);
+
+sub strip {
+    my ($str) = @_;
+    $str =~ s/^\s+|\s+$//g;
+    return $str;
+}
+
+sub MSGSCHEDULE0_lsx {
+    my ($index) = @_;
+    my $msg = $VMSGS[$index / 2];
+    my $code;
+
+    if ($index % 2 == 0) {
+        $code = <<___;
+    vld $msg, $INP, @{[8*$index]}
+    vshuf4i.b $msg, $msg, 0b00011011
+    vshuf4i.w $msg, $msg, 0b10110001
+___
+    }
+
+    $code .= <<___;
+    vpickve2gr.d $T1, $msg, @{[$index%2]}
+___
+
+    return strip($code);
+}
+
+sub MSGSCHEDULE0 {
+    my ($index) = @_;
+
+    if ($use_lsx) {
+        return MSGSCHEDULE0_lsx($index);
+    }
+
+    my $code=<<___;
+    ld.d $T1, $INP, @{[8*$index]}
+    revb.d $T1, $T1
+    st.d $T1, $ADDR, @{[8*$index]}
+___
+    return strip($code);
+}
+
+sub MSGSCHEDULE1_lsx {
+    my ($index) = @_;
+    my $msgidx = ($index / 2) % 8;
+    my $m01 = $VMSGS[$msgidx];
+    my $m23 = $VMSGS[($msgidx + 1) % 8];
+    my $m45 = $VMSGS[($msgidx + 2) % 8];
+    my $m67 = $VMSGS[($msgidx + 3) % 8];
+    my $m89 = $VMSGS[($msgidx + 4) % 8];
+    my $mab = $VMSGS[($msgidx + 5) % 8];
+    my $mcd = $VMSGS[($msgidx + 6) % 8];
+    my $mef = $VMSGS[($msgidx + 7) % 8];
+    my ($m12, $tmp0, $tmp1) = ($vt0, $vt1, $vt2);
+    my $code;
+
+    if ($index % 2 == 0) {
+        # re-align to get $m12 and "$m9a" ($tmp0)
+        $code = <<___;
+    # m01 & new = $m01, m23 = $m23, m45 = $m45, m67 = $m67
+    # m89 = $m89, mab = $mab, mcd = $mcd, mef = $mef
+    vori.b $m12, $m01, 0
+    vshuf4i.d $m12, $m23, 0b1001
+    vori.b $tmp0, $m89, 0
+    vshuf4i.d $tmp0, $mab, 0b1001
+    vadd.d $m01, $m01, $tmp0
+___
+
+        # $m01 += sigma0($m12)
+        $code .= <<___;
+    vrotri.d $tmp0, $m12, 1
+    vrotri.d $tmp1, $m12, 8
+    vsrli.d $m12, $m12, 7
+    vxor.v $tmp0, $tmp0, $tmp1
+    vxor.v $m12, $m12, $tmp0
+    vadd.d $m01, $m01, $m12
+___
+
+        # $m01 += sigma1
+        # now m12 can be re-used as temporary
+        $code .= <<___;
+    vrotri.d $tmp0, $mef, 19
+    vrotri.d $tmp1, $mef, 61
+    vsrli.d $m12, $mef, 6
+    vxor.v $tmp0, $tmp0, $tmp1
+    vxor.v $m12, $m12, $tmp0
+    vadd.d $m01, $m01, $m12
+___
+    }
+
+    $code .= <<___;
+    vpickve2gr.d $T1, $m01, @{[$index%2]}
+___
+
+    return strip($code);
+}
+
+sub MSGSCHEDULE1 {
+    my ($index) = @_;
+
+    if ($use_lsx) {
+        return MSGSCHEDULE1_lsx($index);
+    }
+
+    my $code=<<___;
+    ld.d $T1, $ADDR, @{[(($index-2)&0x0f)*8]}
+    ld.d $T2, $ADDR, @{[(($index-15)&0x0f)*8]}
+    ld.d $T3, $ADDR, @{[(($index-7)&0x0f)*8]}
+    ld.d $T4, $ADDR, @{[($index&0x0f)*8]}
+    rotri.d $T5, $T1, 19
+    rotri.d $T6, $T1, 61
+    srli.d $T1, $T1, 6
+    xor $T1, $T1, $T5
+    xor $T1, $T1, $T6
+    add.d $T1, $T1, $T3
+    rotri.d $T5, $T2, 1
+    rotri.d $T6, $T2, 8
+    srli.d $T2, $T2, 7
+    xor $T2, $T2, $T5
+    xor $T2, $T2, $T6
+    add.d $T1, $T1, $T2
+    add.d $T1, $T1, $T4
+    st.d $T1, $ADDR, @{[8*($index&0x0f)]}
+___
+    return strip($code);
+}
+
+sub sha512_T1 {
+    my ($index, $e, $f, $g, $h) = @_;
+    my $code=<<___;
+    ld.d $T4, $KT, @{[8*$index]}
+    add.d $h, $h, $T1
+    add.d $h, $h, $T4
+    rotri.d $T2, $e, 14
+    rotri.d $T3, $e, 18
+    rotri.d $T4, $e, 41
+    xor $T2, $T2, $T3
+    xor $T1, $f, $g
+    xor $T2, $T2, $T4
+    and $T1, $T1, $e
+    add.d $h, $h, $T2
+    xor $T1, $T1, $g
+    add.d $T1, $T1, $h
+___
+    return strip($code);
+}
+
+sub sha512_T2 {
+    my ($a, $b, $c) = @_;
+    my $code=<<___;
+    rotri.d $T2, $a, 28
+    rotri.d $T3, $a, 34
+    rotri.d $T4, $a, 39
+    xor $T2, $T2, $T3
+    xor $T5, $b, $c
+    and $T3, $b, $c
+    and $T5, $T5, $a
+    xor $T2, $T2, $T4
+    xor $T3, $T3, $T5
+    add.d $T2, $T2, $T3
+___
+    return strip($code);
+}
+
+sub SHA512ROUND {
+    my ($index, $a, $b, $c, $d, $e, $f, $g, $h) = @_;
+    my $ms = $index < 16 ? \&MSGSCHEDULE0 : \&MSGSCHEDULE1;
+    my $code=<<___;
+    @{[$ms->($index)]}
+    @{[sha512_T1 $index, $e, $f, $g, $h]}
+    @{[sha512_T2 $a, $b, $c]}
+    add.d $d, $d, $T1
+    add.d $h, $T2, $T1
+___
+    return strip($code);
+}
+
+################################################################################
+# void sha512_block_data_order$isaext(void *c, const void *p, size_t len)
+$code .= <<___;
+.p2align 3
+.globl sha512_block_data_order@{[$isaext]}
+.type   sha512_block_data_order@{[$isaext]},\@function
+sha512_block_data_order@{[$isaext]}:
+
+    addi.d $sp, $sp, -80
+
+    st.d $s0, $sp, 0
+    st.d $s1, $sp, 8
+    st.d $s2, $sp, 16
+    st.d $s3, $sp, 24
+    st.d $s4, $sp, 32
+    st.d $s5, $sp, 40
+    st.d $s6, $sp, 48
+    st.d $s7, $sp, 56
+    st.d $s8, $sp, 64
+    st.d $fp, $sp, 72
+___
+
+# SHA512 LSX needs neither dedicated shuffle control word, nor stack space for
+# internal states
+if (!$use_lsx) {
+    $code .= <<___;
+    addi.d $sp, $sp, -128
+___
+}
+
+$code .= <<___;
+    la $KT, $K512
+
+    # load ctx
+    ld.d $A, $a0, 0
+    ld.d $B, $a0, 8
+    ld.d $C, $a0, 16
+    ld.d $D, $a0, 24
+    ld.d $E, $a0, 32
+    ld.d $F, $a0, 40
+    ld.d $G, $a0, 48
+    ld.d $H, $a0, 56
+
+L_round_loop:
+    # Decrement length by 1
+    addi.d $LEN, $LEN, -1
+___
+
+for (my $i = 0; $i < 80; $i += 8) {
+    $code .= <<___;
+    @{[SHA512ROUND $i, $A, $B, $C, $D, $E, $F, $G, $H]}
+    @{[SHA512ROUND $i+1, $H, $A, $B, $C, $D, $E, $F, $G]}
+    @{[SHA512ROUND $i+2, $G, $H, $A, $B, $C, $D, $E, $F]}
+    @{[SHA512ROUND $i+3, $F, $G, $H, $A, $B, $C, $D, $E]}
+    @{[SHA512ROUND $i+4, $E, $F, $G, $H, $A, $B, $C, $D]}
+    @{[SHA512ROUND $i+5, $D, $E, $F, $G, $H, $A, $B, $C]}
+    @{[SHA512ROUND $i+6, $C, $D, $E, $F, $G, $H, $A, $B]}
+    @{[SHA512ROUND $i+7, $B, $C, $D, $E, $F, $G, $H, $A]}
+___
+}
+
+$code .= <<___;
+    ld.d $T1, $a0, 0
+    ld.d $T2, $a0, 8
+    ld.d $T3, $a0, 16
+    ld.d $T4, $a0, 24
+
+    add.d $A, $A, $T1
+    add.d $B, $B, $T2
+    add.d $C, $C, $T3
+    add.d $D, $D, $T4
+
+    st.d $A, $a0, 0
+    st.d $B, $a0, 8
+    st.d $C, $a0, 16
+    st.d $D, $a0, 24
+
+    ld.d $T1, $a0, 32
+    ld.d $T2, $a0, 40
+    ld.d $T3, $a0, 48
+    ld.d $T4, $a0, 56
+
+    add.d $E, $E, $T1
+    add.d $F, $F, $T2
+    add.d $G, $G, $T3
+    add.d $H, $H, $T4
+
+    st.d $E, $a0, 32
+    st.d $F, $a0, 40
+    st.d $G, $a0, 48
+    st.d $H, $a0, 56
+
+    addi.d $INP, $INP, 128
+
+    bnez $LEN, L_round_loop
+___
+
+if (!$use_lsx) {
+    $code .= <<___;
+    addi.d $sp, $sp, 128
+___
+}
+
+$code .= <<___;
+    ld.d $s0, $sp, 0
+    ld.d $s1, $sp, 8
+    ld.d $s2, $sp, 16
+    ld.d $s3, $sp, 24
+    ld.d $s4, $sp, 32
+    ld.d $s5, $sp, 40
+    ld.d $s6, $sp, 48
+    ld.d $s7, $sp, 56
+    ld.d $s8, $sp, 64
+    ld.d $fp, $sp, 72
+
+    addi.d $sp, $sp, 80
+
+    ret
+.size sha512_block_data_order@{[$isaext]},.-sha512_block_data_order@{[$isaext]}
+
+.section .rodata
+.p2align 3
+.type $K512,\@object
+$K512:
+    .dword 0x428a2f98d728ae22, 0x7137449123ef65cd
+    .dword 0xb5c0fbcfec4d3b2f, 0xe9b5dba58189dbbc
+    .dword 0x3956c25bf348b538, 0x59f111f1b605d019
+    .dword 0x923f82a4af194f9b, 0xab1c5ed5da6d8118
+    .dword 0xd807aa98a3030242, 0x12835b0145706fbe
+    .dword 0x243185be4ee4b28c, 0x550c7dc3d5ffb4e2
+    .dword 0x72be5d74f27b896f, 0x80deb1fe3b1696b1
+    .dword 0x9bdc06a725c71235, 0xc19bf174cf692694
+    .dword 0xe49b69c19ef14ad2, 0xefbe4786384f25e3
+    .dword 0x0fc19dc68b8cd5b5, 0x240ca1cc77ac9c65
+    .dword 0x2de92c6f592b0275, 0x4a7484aa6ea6e483
+    .dword 0x5cb0a9dcbd41fbd4, 0x76f988da831153b5
+    .dword 0x983e5152ee66dfab, 0xa831c66d2db43210
+    .dword 0xb00327c898fb213f, 0xbf597fc7beef0ee4
+    .dword 0xc6e00bf33da88fc2, 0xd5a79147930aa725
+    .dword 0x06ca6351e003826f, 0x142929670a0e6e70
+    .dword 0x27b70a8546d22ffc, 0x2e1b21385c26c926
+    .dword 0x4d2c6dfc5ac42aed, 0x53380d139d95b3df
+    .dword 0x650a73548baf63de, 0x766a0abb3c77b2a8
+    .dword 0x81c2c92e47edaee6, 0x92722c851482353b
+    .dword 0xa2bfe8a14cf10364, 0xa81a664bbc423001
+    .dword 0xc24b8b70d0f89791, 0xc76c51a30654be30
+    .dword 0xd192e819d6ef5218, 0xd69906245565a910
+    .dword 0xf40e35855771202a, 0x106aa07032bbd1b8
+    .dword 0x19a4c116b8d2d0c8, 0x1e376c085141ab53
+    .dword 0x2748774cdf8eeb99, 0x34b0bcb5e19b48a8
+    .dword 0x391c0cb3c5c95a63, 0x4ed8aa4ae3418acb
+    .dword 0x5b9cca4f7763e373, 0x682e6ff3d6b2b8a3
+    .dword 0x748f82ee5defb2fc, 0x78a5636f43172f60
+    .dword 0x84c87814a1f0ab72, 0x8cc702081a6439ec
+    .dword 0x90befffa23631e28, 0xa4506cebde82bde9
+    .dword 0xbef9a3f7b2c67915, 0xc67178f2e372532b
+    .dword 0xca273eceea26619c, 0xd186b8c721c0c207
+    .dword 0xeada7dd6cde0eb1e, 0xf57d4f7fee6ed178
+    .dword 0x06f067aa72176fba, 0x0a637dc5a2c898a6
+    .dword 0x113f9804bef90dae, 0x1b710b35131c471b
+    .dword 0x28db77f523047d84, 0x32caab7b40c72493
+    .dword 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c
+    .dword 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a
+    .dword 0x5fcb6fab3ad6faec, 0x6c44198c4a475817
+.size $K512,.-$K512
+___
+
+print $code;
+
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-mips.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-mips.pl
index 573bb574fc6..1d01da6617e 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha512-mips.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512-mips.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2010-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # SHA2 block procedures for MIPS.
@@ -84,7 +84,7 @@ if ($flavour =~ /64|n32/i) {
 }
 $pf = ($flavour =~ /nubi/i) ? $t0 : $t2;
 #
-# <appro@openssl.org>
+# <https://github.com/dot-asm>
 #
 ######################################################################

@@ -308,7 +308,7 @@ $FRAMESIZE=16*$SZ+16*$SZREG;
 $SAVED_REGS_MASK = ($flavour =~ /nubi/i) ? "0xc0fff008" : "0xc0ff0000";

 $code.=<<___;
-#include "mips_arch.h"
+#include "arch/mips_arch.h"

 .text
 .set	noat
@@ -517,7 +517,7 @@ $code.=<<___;
 ___
 }
 $code.=<<___;
-.asciiz	"SHA${label} for MIPS, CRYPTOGAMS by <appro\@openssl.org>"
+.asciiz	"SHA${label} for MIPS, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	5

 ___
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-parisc.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-parisc.pl
index d0e5a4d5cec..69869f6fabf 100755
--- a/deps/openssl/openssl/crypto/sha/asm/sha512-parisc.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512-parisc.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2009-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # SHA256/512 block procedure for PA-RISC.
@@ -692,7 +692,7 @@ $code.=<<___;
 	.EXIT
 	$POPMB	-$FRAME(%sp),%r3
 	.PROCEND
-	.STRINGZ "SHA`64*$SZ` block transform for PA-RISC, CRYPTOGAMS by <appro\@openssl.org>"
+	.STRINGZ "SHA`64*$SZ` block transform for PA-RISC, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 # Explicitly encode PA-RISC 2.0 instructions used in this module, so
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-ppc.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-ppc.pl
index 966713936e6..2ca934491e0 100755
--- a/deps/openssl/openssl/crypto/sha/asm/sha512-ppc.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512-ppc.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # I let hardware handle unaligned input, except on page boundaries
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-riscv64-zbb.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-riscv64-zbb.pl
new file mode 100644
index 00000000000..7edae831d92
--- /dev/null
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512-riscv64-zbb.pl
@@ -0,0 +1,416 @@
+#! /usr/bin/env perl
+# This file is dual-licensed, meaning that you can use it under your
+# choice of either of the following two licenses:
+#
+# Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License"). You can obtain
+# a copy in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+#
+# or
+#
+# Copyright (c) 2025-2026, Julian Zhu <julian.oerv@isrc.iscas.ac.cn>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# The generated code of this file depends on the following RISC-V extensions:
+# - RV64I
+# - RISC-V Basic Bit-manipulation extension ('Zbb')
+
+use strict;
+use warnings;
+
+use FindBin qw($Bin);
+use lib "$Bin";
+use lib "$Bin/../../perlasm";
+use riscv;
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+my $output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+my $flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+$output and open STDOUT,">$output";
+
+my $code=<<___;
+.text
+___
+
+my $K512 = "K512";
+
+# Function arguments
+my ($INP, $LEN, $ADDR) = ("a1", "a2", "sp");
+my ($KT, $T1, $T2, $T3, $T4, $T5, $T6) = ("t0", "t1", "t2", "t3", "t4", "t5", "t6");
+# Shift amounts for misaligned input
+my ($SHL, $SHR) = ("a3", "a4");
+my ($MISALIGNED_INPUT, $ALIGNED_INPUT) = (0, 1);
+# Parity-indexed pairs: W = W[i], U = W[i-15], X = a ^ b
+my ($W0, $W1, $U0, $U1, $X0, $X1) = ("a5", "a6", "a7", "s0", "s1", "s10");
+my ($A, $B, $C, $D ,$E ,$F ,$G ,$H) = ("s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9");
+
+# Misaligned: $dst = (lo >> SHL) | (hi << SHR) from two aligned loads
+sub loadDword {
+    my ($ALIGNED, $dst, $off) = @_;
+    if ($ALIGNED) {
+        return "ld $dst, $off($INP)";
+    }
+    my $code=<<___;
+    ld $T5, $off($INP)
+    ld $T6, ($off+8)($INP)
+    srl $dst, $T5, $SHL
+    sll $T6, $T6, $SHR
+    or $dst, $dst, $T6
+___
+    return $code;
+}
+
+sub MSGSCHEDULE0 {
+    my ($ALIGNED, $index) = @_;
+    my $Wi = ($index & 1) ? $W1 : $W0;
+    my $code=<<___;
+    @{[loadDword $ALIGNED, $Wi, "8*$index"]}
+    @{[rev8 $Wi, $Wi]}
+    sd $Wi, 8*$index($ADDR)
+___
+
+    return $code;
+}
+
+# W[i-2] and W[i-16] are already in registers
+sub MSGSCHEDULE1 {
+    my ($INDEX) = @_;
+    my $Wi2 = ($INDEX & 1) ? $W1 : $W0;
+    # W[i] overwrites W[i-2], so it is written last
+    my $Wi = $Wi2;
+    my $Wi15 = ($INDEX & 1) ? $U1 : $U0;
+    my $Wi16 = ($INDEX & 1) ? $U0 : $U1;
+    my $code=<<___;
+    ld $T3, (($INDEX-7)&0x0f)*8($ADDR)
+    ld $Wi15, (($INDEX-15)&0x0f)*8($ADDR)
+    @{[rori $T5, $Wi2, 19]}
+    @{[rori $T6, $Wi2, 61]}
+    srli $T1, $Wi2, 6
+    xor $T1, $T1, $T5
+    xor $T1, $T1, $T6
+    add $T1, $T1, $T3
+    @{[rori $T5, $Wi15, 1]}
+    @{[rori $T6, $Wi15, 8]}
+    srli $T2, $Wi15, 7
+    xor $T2, $T2, $T5
+    xor $T2, $T2, $T6
+    add $T2, $T2, $Wi16
+    add $Wi, $T1, $T2
+    sd $Wi, 8*($INDEX&0x0f)($ADDR)
+___
+
+    return $code;
+}
+
+sub sha512_T1 {
+    my ($INDEX, $e, $f, $g, $h) = @_;
+    my $Wi = ($INDEX & 1) ? $W1 : $W0;
+    my $code=<<___;
+    ld $T4, 8*$INDEX($KT)
+    @{[rori $T2, $e, 14]}
+    @{[rori $T3, $e, 18]}
+    @{[rori $T5, $e, 41]}
+    add $h, $h, $Wi
+    xor $T1, $f, $g
+    add $h, $h, $T4
+    xor $T2, $T2, $T3
+    and $T1, $T1, $e
+    xor $T2, $T2, $T5
+    xor $T1, $T1, $g
+    add $T2, $T2, $h
+    add $T1, $T1, $T2
+___
+
+    return $code;
+}
+
+sub sha512_T2 {
+    my ($INDEX, $a, $b, $c) = @_;
+    my $Xab = ($INDEX & 1) ? $X1 : $X0;
+    my $Xbc = ($INDEX & 1) ? $X0 : $X1;
+    my $code=<<___;
+    # Sigma0
+    @{[rori $T2, $a, 28]}
+    @{[rori $T3, $a, 34]}
+    @{[rori $T4, $a, 39]}
+    # Maj
+    xor $Xab, $a, $b
+    xor $T2, $T2, $T3
+    and $T5, $Xab, $Xbc
+    xor $T2, $T2, $T4
+    xor $T5, $T5, $b
+    # T2
+    add $T2, $T2, $T5
+___
+
+    return $code;
+}
+
+sub SHA512ROUND {
+    my ($INDEX, $a, $b, $c, $d, $e, $f, $g, $h) = @_;
+    my $code=<<___;
+    @{[sha512_T1 $INDEX, $e, $f, $g, $h]}
+    @{[sha512_T2 $INDEX, $a, $b, $c]}
+    add $d, $d, $T1
+    add $h, $T2, $T1
+___
+
+    return $code;
+}
+
+sub SHA512ROUND0 {
+    my ($ALIGNED, $INDEX, $a, $b, $c, $d, $e, $f, $g, $h) = @_;
+    my $code=<<___;
+    @{[MSGSCHEDULE0 $ALIGNED, $INDEX]}
+    @{[SHA512ROUND $INDEX, $a, $b, $c, $d, $e, $f, $g, $h]}
+___
+
+    return $code;
+}
+
+sub SHA512ROUND1 {
+    my ($INDEX, $a, $b, $c, $d, $e, $f, $g, $h) = @_;
+    my $code=<<___;
+    @{[MSGSCHEDULE1 $INDEX]}
+    @{[SHA512ROUND $INDEX, $a, $b, $c, $d, $e, $f, $g, $h]}
+___
+
+    return $code;
+}
+
+
+################################################################################
+# void sha512_block_data_order_zbb(void *c, const void *p, size_t len)
+$code .= <<___;
+.p2align 3
+.globl sha512_block_data_order_zbb
+.type   sha512_block_data_order_zbb,\@function
+sha512_block_data_order_zbb:
+
+    addi sp, sp, -96
+
+    sd s0, 0(sp)
+    sd s1, 8(sp)
+    sd s2, 16(sp)
+    sd s3, 24(sp)
+    sd s4, 32(sp)
+    sd s5, 40(sp)
+    sd s6, 48(sp)
+    sd s7, 56(sp)
+    sd s8, 64(sp)
+    sd s9, 72(sp)
+    sd s10, 80(sp)
+    sd s11, 88(sp)
+
+    addi sp, sp, -128
+
+    la $KT, $K512
+
+    # load ctx
+    ld $A, 0(a0)
+    ld $B, 8(a0)
+    ld $C, 16(a0)
+    ld $D, 24(a0)
+    ld $E, 32(a0)
+    ld $F, 40(a0)
+    ld $G, 48(a0)
+    ld $H, 56(a0)
+
+    andi $SHL, $INP, 7
+    beqz $SHL, L_round_loop
+    andi $INP, $INP, -8
+    slli $SHL, $SHL, 3
+    li $T1, 64
+    sub $SHR, $T1, $SHL
+
+L_round_loop:
+    # Decrement length by 1
+    addi $LEN, $LEN, -1
+
+    # b ^ c for round 0's Maj; later rounds reuse the previous a ^ b
+    xor $X1, $B, $C
+
+    bnez $SHL, L_load_misaligned
+___
+
+# Rounds 0..15, once for aligned and once for misaligned input
+for (my $i = 0; $i < 16; $i += 8) {
+    $code .= <<___;
+    @{[SHA512ROUND0 $ALIGNED_INPUT, $i, $A, $B, $C, $D, $E, $F, $G, $H]}
+    @{[SHA512ROUND0 $ALIGNED_INPUT, $i+1, $H, $A, $B, $C, $D, $E, $F, $G]}
+    @{[SHA512ROUND0 $ALIGNED_INPUT, $i+2, $G, $H, $A, $B, $C, $D, $E, $F]}
+    @{[SHA512ROUND0 $ALIGNED_INPUT, $i+3, $F, $G, $H, $A, $B, $C, $D, $E]}
+    @{[SHA512ROUND0 $ALIGNED_INPUT, $i+4, $E, $F, $G, $H, $A, $B, $C, $D]}
+    @{[SHA512ROUND0 $ALIGNED_INPUT, $i+5, $D, $E, $F, $G, $H, $A, $B, $C]}
+    @{[SHA512ROUND0 $ALIGNED_INPUT, $i+6, $C, $D, $E, $F, $G, $H, $A, $B]}
+    @{[SHA512ROUND0 $ALIGNED_INPUT, $i+7, $B, $C, $D, $E, $F, $G, $H, $A]}
+___
+}
+
+$code .= <<___;
+    j L_message_schedule
+L_load_misaligned:
+___
+
+for (my $i = 0; $i < 16; $i += 8) {
+    $code .= <<___;
+    @{[SHA512ROUND0 $MISALIGNED_INPUT, $i, $A, $B, $C, $D, $E, $F, $G, $H]}
+    @{[SHA512ROUND0 $MISALIGNED_INPUT, $i+1, $H, $A, $B, $C, $D, $E, $F, $G]}
+    @{[SHA512ROUND0 $MISALIGNED_INPUT, $i+2, $G, $H, $A, $B, $C, $D, $E, $F]}
+    @{[SHA512ROUND0 $MISALIGNED_INPUT, $i+3, $F, $G, $H, $A, $B, $C, $D, $E]}
+    @{[SHA512ROUND0 $MISALIGNED_INPUT, $i+4, $E, $F, $G, $H, $A, $B, $C, $D]}
+    @{[SHA512ROUND0 $MISALIGNED_INPUT, $i+5, $D, $E, $F, $G, $H, $A, $B, $C]}
+    @{[SHA512ROUND0 $MISALIGNED_INPUT, $i+6, $C, $D, $E, $F, $G, $H, $A, $B]}
+    @{[SHA512ROUND0 $MISALIGNED_INPUT, $i+7, $B, $C, $D, $E, $F, $G, $H, $A]}
+___
+}
+
+$code .= <<___;
+L_message_schedule:
+    # Round 16's W[i-16] is W[0]; later rounds reuse the previous W[i-15]
+    ld $U1, 0($ADDR)
+___
+
+for (my $i = 16; $i < 80; $i += 8) {
+    $code .= <<___;
+    @{[SHA512ROUND1 $i, $A, $B, $C, $D, $E, $F, $G, $H]}
+    @{[SHA512ROUND1 $i+1, $H, $A, $B, $C, $D, $E, $F, $G]}
+    @{[SHA512ROUND1 $i+2, $G, $H, $A, $B, $C, $D, $E, $F]}
+    @{[SHA512ROUND1 $i+3, $F, $G, $H, $A, $B, $C, $D, $E]}
+    @{[SHA512ROUND1 $i+4, $E, $F, $G, $H, $A, $B, $C, $D]}
+    @{[SHA512ROUND1 $i+5, $D, $E, $F, $G, $H, $A, $B, $C]}
+    @{[SHA512ROUND1 $i+6, $C, $D, $E, $F, $G, $H, $A, $B]}
+    @{[SHA512ROUND1 $i+7, $B, $C, $D, $E, $F, $G, $H, $A]}
+___
+}
+
+$code .= <<___;
+    ld $T1, 0(a0)
+    ld $T2, 8(a0)
+    ld $T3, 16(a0)
+    ld $T4, 24(a0)
+
+    add $A, $A, $T1
+    add $B, $B, $T2
+    add $C, $C, $T3
+    add $D, $D, $T4
+
+    sd $A, 0(a0)
+    sd $B, 8(a0)
+    sd $C, 16(a0)
+    sd $D, 24(a0)
+
+    ld $T1, 32(a0)
+    ld $T2, 40(a0)
+    ld $T3, 48(a0)
+    ld $T4, 56(a0)
+
+    add $E, $E, $T1
+    add $F, $F, $T2
+    add $G, $G, $T3
+    add $H, $H, $T4
+
+    sd $E, 32(a0)
+    sd $F, 40(a0)
+    sd $G, 48(a0)
+    sd $H, 56(a0)
+
+    addi $INP, $INP, 128
+
+    bnez $LEN, L_round_loop
+
+    addi sp, sp, 128
+
+    ld s0, 0(sp)
+    ld s1, 8(sp)
+    ld s2, 16(sp)
+    ld s3, 24(sp)
+    ld s4, 32(sp)
+    ld s5, 40(sp)
+    ld s6, 48(sp)
+    ld s7, 56(sp)
+    ld s8, 64(sp)
+    ld s9, 72(sp)
+    ld s10, 80(sp)
+    ld s11, 88(sp)
+
+    addi sp, sp, 96
+
+    ret
+.size sha512_block_data_order_zbb,.-sha512_block_data_order_zbb
+
+.section .rodata
+.p2align 3
+.type $K512,\@object
+$K512:
+    .dword 0x428a2f98d728ae22, 0x7137449123ef65cd
+    .dword 0xb5c0fbcfec4d3b2f, 0xe9b5dba58189dbbc
+    .dword 0x3956c25bf348b538, 0x59f111f1b605d019
+    .dword 0x923f82a4af194f9b, 0xab1c5ed5da6d8118
+    .dword 0xd807aa98a3030242, 0x12835b0145706fbe
+    .dword 0x243185be4ee4b28c, 0x550c7dc3d5ffb4e2
+    .dword 0x72be5d74f27b896f, 0x80deb1fe3b1696b1
+    .dword 0x9bdc06a725c71235, 0xc19bf174cf692694
+    .dword 0xe49b69c19ef14ad2, 0xefbe4786384f25e3
+    .dword 0x0fc19dc68b8cd5b5, 0x240ca1cc77ac9c65
+    .dword 0x2de92c6f592b0275, 0x4a7484aa6ea6e483
+    .dword 0x5cb0a9dcbd41fbd4, 0x76f988da831153b5
+    .dword 0x983e5152ee66dfab, 0xa831c66d2db43210
+    .dword 0xb00327c898fb213f, 0xbf597fc7beef0ee4
+    .dword 0xc6e00bf33da88fc2, 0xd5a79147930aa725
+    .dword 0x06ca6351e003826f, 0x142929670a0e6e70
+    .dword 0x27b70a8546d22ffc, 0x2e1b21385c26c926
+    .dword 0x4d2c6dfc5ac42aed, 0x53380d139d95b3df
+    .dword 0x650a73548baf63de, 0x766a0abb3c77b2a8
+    .dword 0x81c2c92e47edaee6, 0x92722c851482353b
+    .dword 0xa2bfe8a14cf10364, 0xa81a664bbc423001
+    .dword 0xc24b8b70d0f89791, 0xc76c51a30654be30
+    .dword 0xd192e819d6ef5218, 0xd69906245565a910
+    .dword 0xf40e35855771202a, 0x106aa07032bbd1b8
+    .dword 0x19a4c116b8d2d0c8, 0x1e376c085141ab53
+    .dword 0x2748774cdf8eeb99, 0x34b0bcb5e19b48a8
+    .dword 0x391c0cb3c5c95a63, 0x4ed8aa4ae3418acb
+    .dword 0x5b9cca4f7763e373, 0x682e6ff3d6b2b8a3
+    .dword 0x748f82ee5defb2fc, 0x78a5636f43172f60
+    .dword 0x84c87814a1f0ab72, 0x8cc702081a6439ec
+    .dword 0x90befffa23631e28, 0xa4506cebde82bde9
+    .dword 0xbef9a3f7b2c67915, 0xc67178f2e372532b
+    .dword 0xca273eceea26619c, 0xd186b8c721c0c207
+    .dword 0xeada7dd6cde0eb1e, 0xf57d4f7fee6ed178
+    .dword 0x06f067aa72176fba, 0x0a637dc5a2c898a6
+    .dword 0x113f9804bef90dae, 0x1b710b35131c471b
+    .dword 0x28db77f523047d84, 0x32caab7b40c72493
+    .dword 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c
+    .dword 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a
+    .dword 0x5fcb6fab3ad6faec, 0x6c44198c4a475817
+.size $K512,.-$K512
+___
+
+print $code;
+
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-riscv64-zvkb-zvknhb.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-riscv64-zvkb-zvknhb.pl
index c5df987296e..29a51b2f2b6 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha512-riscv64-zvkb-zvknhb.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512-riscv64-zvkb-zvknhb.pl
@@ -70,6 +70,7 @@ my $K512 = "K512";

 # Function arguments
 my ($H, $INP, $LEN, $KT, $H2, $INDEX_PATTERN) = ("a0", "a1", "a2", "a3", "t3", "t4");
+my ($T0, $T1) = ("t0", "t1");

 ################################################################################
 # void sha512_block_data_order_zvkb_zvknhb(void *c, const void *p, size_t len)
@@ -78,8 +79,6 @@ $code .= <<___;
 .globl sha512_block_data_order_zvkb_zvknhb
 .type sha512_block_data_order_zvkb_zvknhb,\@function
 sha512_block_data_order_zvkb_zvknhb:
-    @{[vsetivli "zero", 4, "e64", "m2", "ta", "ma"]}
-
     # H is stored as {a,b,c,d},{e,f,g,h}, but we need {f,e,b,a},{h,g,d,c}
     # The dst vtype is e64m2 and the index vtype is e8mf4.
     # We use index-load with the following index pattern at v1.
@@ -105,9 +104,226 @@ sha512_block_data_order_zvkb_zvknhb:
     @{[vsetivli "zero", 1, "e8", "m1", "ta", "ma"]}
     @{[vmv_v_i $V0, 0x01]}

-    @{[vsetivli "zero", 4, "e64", "m2", "ta", "ma"]}
+    # Obtain VLEN and select the corresponding branch
+    csrr t0, vlenb
+    srl t1, t0, 5
+    beqz t1, sha512_block_data_order_zvkb_zvknhb_zvl128
+sha512_block_data_order_zvkb_zvknhb_zvl256_zvl512:
+    # When vlen=256 or 512, the round constants K512 can be loaded
+    # at once in vector register files.
+    @{[vsetivli "zero", 4, "e64", "m1", "ta", "ma"]}
+    # Load round constants K512
+    la $KT, $K512
+    @{[vle64_v $V2, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V3, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V4, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V5, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V6, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V7, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V8, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V9, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V11, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V13, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V15, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V17, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V19, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V21, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V23, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V25, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V27, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V29, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V30, ($KT)]}
+    addi $KT, $KT, 32
+    @{[vle64_v $V31, ($KT)]}
+
+L_round_loop_256_512:
+    # Decrement length by 1
+    addi $LEN, $LEN, -1

-L_round_loop:
+    # Keep the current state as we need it later: H' = H+{a',b',c',...,h'}.
+    @{[vmv1r_v $V26, $V22]}
+    @{[vmv1r_v $V28, $V24]}
+
+    # Load the 1024-bits of the message block in v10, v12, v14, v16
+    # and perform the endian swap.
+    @{[vle64_v $V10, $INP]}
+    @{[vrev8_v $V10, $V10]}
+    addi $INP, $INP, 32
+    @{[vle64_v $V12, $INP]}
+    @{[vrev8_v $V12, $V12]}
+    addi $INP, $INP, 32
+    @{[vle64_v $V14, $INP]}
+    @{[vrev8_v $V14, $V14]}
+    addi $INP, $INP, 32
+    @{[vle64_v $V16, $INP]}
+    @{[vrev8_v $V16, $V16]}
+    addi $INP, $INP, 32
+
+    # Quad-round 0 (+0, v10->v12->v14->v16)
+    @{[vadd_vv $V18, $V2, $V10]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V14, $V12, $V0]}
+    @{[vsha2ms_vv $V10, $V18, $V16]}
+
+    # Quad-round 1 (+1, v12->v14->v16->v10)
+    @{[vadd_vv $V18, $V3, $V12]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V16, $V14, $V0]}
+    @{[vsha2ms_vv $V12, $V18, $V10]}
+
+    # Quad-round 2 (+2, v14->v16->v10->v12)
+    @{[vadd_vv $V18, $V4, $V14]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V10, $V16, $V0]}
+    @{[vsha2ms_vv $V14, $V18, $V12]}
+
+    # Quad-round 3 (+3, v16->v10->v12->v14)
+    @{[vadd_vv $V18, $V5, $V16]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V12, $V10, $V0]}
+    @{[vsha2ms_vv $V16, $V18, $V14]}
+
+    # Quad-round 4 (+4, v10->v12->v14->v16)
+    @{[vadd_vv $V18, $V6, $V10]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V14, $V12, $V0]}
+    @{[vsha2ms_vv $V10, $V18, $V16]}
+
+    # Quad-round 5 (+5, v12->v14->v16->v10)
+    @{[vadd_vv $V18, $V7, $V12]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V16, $V14, $V0]}
+    @{[vsha2ms_vv $V12, $V18, $V10]}
+
+    # Quad-round 6 (+6, v14->v16->v10->v12)
+    @{[vadd_vv $V18, $V8, $V14]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V10, $V16, $V0]}
+    @{[vsha2ms_vv $V14, $V18, $V12]}
+
+    # Quad-round 7 (+7, v16->v10->v12->v14)
+    @{[vadd_vv $V18, $V9, $V16]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V12, $V10, $V0]}
+    @{[vsha2ms_vv $V16, $V18, $V14]}
+
+    # Quad-round 8 (+8, v10->v12->v14->v16)
+    @{[vadd_vv $V18, $V11, $V10]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V14, $V12, $V0]}
+    @{[vsha2ms_vv $V10, $V18, $V16]}
+
+    # Quad-round 9 (+9, v12->v14->v16->v10)
+    @{[vadd_vv $V18, $V13, $V12]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V16, $V14, $V0]}
+    @{[vsha2ms_vv $V12, $V18, $V10]}
+
+    # Quad-round 10 (+10, v14->v16->v10->v12)
+    @{[vadd_vv $V18, $V15, $V14]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V10, $V16, $V0]}
+    @{[vsha2ms_vv $V14, $V18, $V12]}
+
+    # Quad-round 11 (+11, v16->v10->v12->v14)
+    @{[vadd_vv $V18, $V17, $V16]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V12, $V10, $V0]}
+    @{[vsha2ms_vv $V16, $V18, $V14]}
+
+    # Quad-round 12 (+12, v10->v12->v14->v16)
+    @{[vadd_vv $V18, $V19, $V10]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V14, $V12, $V0]}
+    @{[vsha2ms_vv $V10, $V18, $V16]}
+
+    # Quad-round 13 (+13, v12->v14->v16->v10)
+    @{[vadd_vv $V18, $V21, $V12]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V16, $V14, $V0]}
+    @{[vsha2ms_vv $V12, $V18, $V10]}
+
+    # Quad-round 14 (+14, v14->v16->v10->v12)
+    @{[vadd_vv $V18, $V23, $V14]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V10, $V16, $V0]}
+    @{[vsha2ms_vv $V14, $V18, $V12]}
+
+    # Quad-round 15 (+15, v16->v10->v12->v14)
+    @{[vadd_vv $V18, $V25, $V16]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+    @{[vmerge_vvm $V18, $V12, $V10, $V0]}
+    @{[vsha2ms_vv $V16, $V18, $V14]}
+
+    # Quad-round 16 (+0, v10->v12->v14->v16)
+    # Note that we stop generating new message schedule words (Wt, v10-16)
+    # as we already generated all the words we end up consuming (i.e., W[79:76]).
+    @{[vadd_vv $V18, $V27, $V10]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+
+    # Quad-round 17 (+1, v12->v14->v16->v10)
+    @{[vadd_vv $V18, $V29, $V12]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+
+    # Quad-round 18 (+2, v14->v16->v10->v12)
+    @{[vadd_vv $V18, $V30, $V14]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+
+    # Quad-round 19 (+3, v16->v10->v12->v14)
+    @{[vadd_vv $V18, $V31, $V16]}
+    @{[vsha2cl_vv $V24, $V22, $V18]}
+    @{[vsha2ch_vv $V22, $V24, $V18]}
+
+    # H' = H+{a',b',c',...,h'}
+    @{[vadd_vv $V22, $V26, $V22]}
+    @{[vadd_vv $V24, $V28, $V24]}
+    bnez $LEN, L_round_loop_256_512
+
+    # Store {f,e,b,a},{h,g,d,c} back to {a,b,c,d},{e,f,g,h}.
+    @{[vsuxei8_v $V22, ($H), $V1]}
+    @{[vsuxei8_v $V24, ($H2), $V1]}
+
+    ret
+sha512_block_data_order_zvkb_zvknhb_zvl128:
+    @{[vsetivli $T0, 4, "e64", "m2", "ta", "ma"]}
+L_round_loop_128:
     # Load round constants K512
     la $KT, $K512

@@ -204,7 +420,7 @@ L_round_loop:
     # H' = H+{a',b',c',...,h'}
     @{[vadd_vv $V22, $V26, $V22]}
     @{[vadd_vv $V24, $V28, $V24]}
-    bnez $LEN, L_round_loop
+    bnez $LEN, L_round_loop_128

     # Store {f,e,b,a},{h,g,d,c} back to {a,b,c,d},{e,f,g,h}.
     @{[vsuxei8_v $V22, ($H), $V1]}
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-s390x.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-s390x.pl
index bc8ab0ca9fd..aa659dc996e 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha512-s390x.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512-s390x.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # SHA256/512 block procedures for s390x.
@@ -172,7 +172,7 @@ ___
 }

 $code.=<<___;
-#include "s390x_arch.h"
+#include "arch/s390x_arch.h"

 .text
 .align	64
@@ -315,7 +315,7 @@ $code.=<<___;
 	lm${g}	%r6,%r15,`$frame+6*$SIZE_T`($sp)
 	br	%r14
 .size	$Func,.-$Func
-.string	"SHA${label} block transform for s390x, CRYPTOGAMS by <appro\@openssl.org>"
+.string	"SHA${label} block transform for s390x, CRYPTOGAMS by <https://github.com/dot-asm>"
 ___

 $code =~ s/\`([^\`]*)\`/eval $1/gem;
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-sparcv9.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-sparcv9.pl
index 6bf366ef124..cc05c7bbc34 100644
--- a/deps/openssl/openssl/crypto/sha/asm/sha512-sparcv9.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512-sparcv9.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 #
 # Hardware SPARC T4 support by David S. Miller
 # ====================================================================
@@ -397,7 +397,7 @@ $code.=<<___;
 #ifndef __ASSEMBLER__
 # define __ASSEMBLER__ 1
 #endif
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #ifdef __arch64__
 .register	%g2,#scratch
@@ -797,7 +797,7 @@ $code.=<<___;
 	restore
 .type	sha${label}_block_data_order,#function
 .size	sha${label}_block_data_order,(.-sha${label}_block_data_order)
-.asciz	"SHA${label} block transform for SPARCv9, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"SHA${label} block transform for SPARCv9, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	4
 ___

diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-x86_64.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-x86_64.pl
index cbdd7df6756..1842718d8e0 100755
--- a/deps/openssl/openssl/crypto/sha/asm/sha512-x86_64.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512-x86_64.pl
@@ -8,7 +8,7 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. Rights for redistribution and usage in source and binary
 # forms are granted according to the License.
 # ====================================================================
@@ -80,6 +80,10 @@
 # March 2014.
 #
 # Add support for Intel SHA Extensions.
+#
+# December 2024.
+#
+# Add support for Intel(R) SHA512 Extensions.

 ######################################################################
 # Current performance in cycles per processed byte (less is better):
@@ -283,34 +287,50 @@ $func:
 .cfi_startproc
 ___
 $code.=<<___ if ($SZ==4 || $avx);
-	lea	OPENSSL_ia32cap_P(%rip),%r11
-	mov	0(%r11),%r9d
-	mov	4(%r11),%r10d
-	mov	8(%r11),%r11d
+    lea OPENSSL_ia32cap_P(%rip),%r10
+    mov 0(%r10),%r9
+    mov 8(%r10),%r11d
 ___
-$code.=<<___ if ($SZ==4 && $shaext);
-	test	\$`1<<29`,%r11d		# check for SHA
-	jnz	_shaext_shortcut
+$code.=<<___ if ($SZ==8 && $avx>1);
+    mov 20(%r10),%r10d
 ___
-$code.=<<___ if ($avx && $SZ==8);
-	test	\$`1<<11`,%r10d		# check for XOP
-	jnz	.Lxop_shortcut
+if ($SZ==4) {
+$code.=<<___ if ($shaext);
+    test \$`1<<29`,%r11d            # check for SHA
+    jnz  _shaext_shortcut
 ___
 $code.=<<___ if ($avx>1);
-	and	\$`1<<8|1<<5|1<<3`,%r11d	# check for BMI2+AVX2+BMI1
-	cmp	\$`1<<8|1<<5|1<<3`,%r11d
-	je	.Lavx2_shortcut
+    and \$`1<<8|1<<5|1<<3`,%r11d    # check for BMI2+AVX2+BMI1
+    cmp \$`1<<8|1<<5|1<<3`,%r11d
+    je  .Lavx2_shortcut
 ___
+} else { # $SZ==8
 $code.=<<___ if ($avx);
-	and	\$`1<<30`,%r9d		# mask "Intel CPU" bit
-	and	\$`1<<28|1<<9`,%r10d	# mask AVX and SSSE3 bits
-	or	%r9d,%r10d
-	cmp	\$`1<<28|1<<9|1<<30`,%r10d
-	je	.Lavx_shortcut
+    bt \$43,%r9                     # check for XOP
+    jc .Lxop_shortcut
+___
+if ($avx>1) { # $SZ==8 && $avx>1
+$code.=<<___;
+    test \$`1<<5`,%r11d             # check for AVX2
+    jz   .Lavx_dispatch
+    test \$`1<<0`,%r10d             # AVX2 confirmed, check SHA512
+    jnz  .Lsha512ext_shortcut
+    and \$`1<<8|1<<3`,%r11d         # AVX2 confirmed, check BMI2+BMI1
+    cmp \$`1<<8|1<<3`,%r11d
+    je  .Lavx2_shortcut
+___
+}}
+
+$code.=<<___ if ($avx);
+.Lavx_dispatch:                     # AVX2 not detected/enabled
+    mov \$`1<<60|1<<41|1<<30`,%r11  # mask "Intel CPU", AVX, SSSE3
+    and %r11,%r9
+    cmp %r11,%r9
+    je  .Lavx_shortcut
 ___
 $code.=<<___ if ($SZ==4);
-	test	\$`1<<9`,%r10d
-	jnz	.Lssse3_shortcut
+    bt \$41,%r9                     # mask SSSE3
+    jc .Lssse3_shortcut
 ___
 $code.=<<___;
 	mov	%rsp,%rax		# copy %rsp
@@ -468,7 +488,7 @@ $TABLE:
 	.long	0x03020100,0x0b0a0908,0xffffffff,0xffffffff
 	.long	0xffffffff,0xffffffff,0x03020100,0x0b0a0908
 	.long	0xffffffff,0xffffffff,0x03020100,0x0b0a0908
-	.asciz	"SHA256 block transform for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+	.asciz	"SHA256 block transform for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
 .previous
 ___
 } else {
@@ -560,7 +580,57 @@ $TABLE:

 	.quad	0x0001020304050607,0x08090a0b0c0d0e0f
 	.quad	0x0001020304050607,0x08090a0b0c0d0e0f
-	.asciz	"SHA512 block transform for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
+	.asciz	"SHA512 block transform for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>"
+___
+
+$code.=<<___ if ($avx>1);
+# $K512 duplicates data every 16 bytes.
+# The Intel(R) SHA512 implementation requires reads of 32 consecutive bytes.
+.align 64
+.type ${TABLE}_single,\@object
+${TABLE}_single:
+    .quad 0x428a2f98d728ae22, 0x7137449123ef65cd
+    .quad 0xb5c0fbcfec4d3b2f, 0xe9b5dba58189dbbc
+    .quad 0x3956c25bf348b538, 0x59f111f1b605d019
+    .quad 0x923f82a4af194f9b, 0xab1c5ed5da6d8118
+    .quad 0xd807aa98a3030242, 0x12835b0145706fbe
+    .quad 0x243185be4ee4b28c, 0x550c7dc3d5ffb4e2
+    .quad 0x72be5d74f27b896f, 0x80deb1fe3b1696b1
+    .quad 0x9bdc06a725c71235, 0xc19bf174cf692694
+    .quad 0xe49b69c19ef14ad2, 0xefbe4786384f25e3
+    .quad 0x0fc19dc68b8cd5b5, 0x240ca1cc77ac9c65
+    .quad 0x2de92c6f592b0275, 0x4a7484aa6ea6e483
+    .quad 0x5cb0a9dcbd41fbd4, 0x76f988da831153b5
+    .quad 0x983e5152ee66dfab, 0xa831c66d2db43210
+    .quad 0xb00327c898fb213f, 0xbf597fc7beef0ee4
+    .quad 0xc6e00bf33da88fc2, 0xd5a79147930aa725
+    .quad 0x06ca6351e003826f, 0x142929670a0e6e70
+    .quad 0x27b70a8546d22ffc, 0x2e1b21385c26c926
+    .quad 0x4d2c6dfc5ac42aed, 0x53380d139d95b3df
+    .quad 0x650a73548baf63de, 0x766a0abb3c77b2a8
+    .quad 0x81c2c92e47edaee6, 0x92722c851482353b
+    .quad 0xa2bfe8a14cf10364, 0xa81a664bbc423001
+    .quad 0xc24b8b70d0f89791, 0xc76c51a30654be30
+    .quad 0xd192e819d6ef5218, 0xd69906245565a910
+    .quad 0xf40e35855771202a, 0x106aa07032bbd1b8
+    .quad 0x19a4c116b8d2d0c8, 0x1e376c085141ab53
+    .quad 0x2748774cdf8eeb99, 0x34b0bcb5e19b48a8
+    .quad 0x391c0cb3c5c95a63, 0x4ed8aa4ae3418acb
+    .quad 0x5b9cca4f7763e373, 0x682e6ff3d6b2b8a3
+    .quad 0x748f82ee5defb2fc, 0x78a5636f43172f60
+    .quad 0x84c87814a1f0ab72, 0x8cc702081a6439ec
+    .quad 0x90befffa23631e28, 0xa4506cebde82bde9
+    .quad 0xbef9a3f7b2c67915, 0xc67178f2e372532b
+    .quad 0xca273eceea26619c, 0xd186b8c721c0c207
+    .quad 0xeada7dd6cde0eb1e, 0xf57d4f7fee6ed178
+    .quad 0x06f067aa72176fba, 0x0a637dc5a2c898a6
+    .quad 0x113f9804bef90dae, 0x1b710b35131c471b
+    .quad 0x28db77f523047d84, 0x32caab7b40c72493
+    .quad 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c
+    .quad 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a
+    .quad 0x5fcb6fab3ad6faec, 0x6c44198c4a475817
+___
+$code.=<<___;
 .previous
 ___
 }
@@ -2320,6 +2390,256 @@ ___
 }}
 }}}}}

+if ($SZ==8 && $avx>1) {
+$code.=<<___;
+.type ${func}_sha512ext,\@function,3
+.align 64
+${func}_sha512ext:
+.cfi_startproc
+    endbranch
+.Lsha512ext_shortcut:
+___
+
+my ($arg_hash,$arg_msg,$arg_num_blks)=("%rdi","%rsi","%rdx");
+
+$code.=<<___;
+    or $arg_num_blks, $arg_num_blks
+    je .Lsha512ext_done
+___
+
+$code.=<<___ if($win64);
+    # xmm6:xmm9, xmm11:xmm15 need to be maintained for Windows
+    # xmm10 not used
+    sub \$`9*16`,%rsp
+.cfi_adjust_cfa_offset \$`9*16`
+    vmovdqu %xmm6, 16*0(%rsp)
+    vmovdqu %xmm7, 16*1(%rsp)
+    vmovdqu %xmm8, 16*2(%rsp)
+    vmovdqu %xmm9, 16*3(%rsp)
+    vmovdqu %xmm11,16*4(%rsp)
+    vmovdqu %xmm12,16*5(%rsp)
+    vmovdqu %xmm13,16*6(%rsp)
+    vmovdqu %xmm14,16*7(%rsp)
+    vmovdqu %xmm15,16*8(%rsp)
+___
+
+$code.=<<___;
+    # reuse shuffle indices from $K512
+    vbroadcasti128 0x500+$TABLE(%rip),%ymm15
+
+#################################################
+# Format of comments describing register contents
+#################################################
+# ymm0 = ABCD
+# A is the most  significant word in `ymm0`
+# D is the least significant word in `ymm0`
+#################################################
+
+    # load current hash value and transform
+    vmovdqu 0x00($arg_hash),%ymm0
+    vmovdqu 0x20($arg_hash),%ymm1
+    # ymm0 = DCBA, ymm1 = HGFE
+    vperm2i128 \$0x20,%ymm1,%ymm0,%ymm2
+    vperm2i128 \$0x31,%ymm1,%ymm0,%ymm3
+    # ymm2 = FEBA, ymm3 = HGDC
+    vpermq \$0x1b,%ymm2,%ymm13
+    vpermq \$0x1b,%ymm3,%ymm14
+    # ymm13 = ABEF, ymm14 = CDGH
+
+    lea ${TABLE}_single(%rip),%r9
+
+.align 32
+.Lsha512ext_block_loop:
+
+    vmovdqa %ymm13,%ymm11                   # ABEF
+    vmovdqa %ymm14,%ymm12                   # CDGH
+
+    # R0 - R3
+    vmovdqu 0*32($arg_msg),%ymm0
+    vpshufb %ymm15,%ymm0,%ymm3              # ymm0/ymm3 = W[0..3]
+    vpaddq 0*32(%r9),%ymm3,%ymm0
+    vsha512rnds2 %xmm0,%ymm11,%ymm12
+    vperm2i128 \$0x1,%ymm0,%ymm0,%ymm0
+    vsha512rnds2 %xmm0,%ymm12,%ymm11
+
+    # R4 - R7
+    vmovdqu 1*32($arg_msg),%ymm0
+    vpshufb %ymm15,%ymm0,%ymm4              # ymm0/ymm4 = W[4..7]
+    vpaddq 1*32(%r9),%ymm4,%ymm0
+    vsha512rnds2 %xmm0,%ymm11,%ymm12
+    vperm2i128 \$0x1,%ymm0,%ymm0,%ymm0
+    vsha512rnds2 %xmm0,%ymm12,%ymm11
+    vsha512msg1 %xmm4,%ymm3                 # ymm3 = W[0..3] + S0(W[1..4])
+
+    # R8 - R11
+    vmovdqu 2*32($arg_msg),%ymm0
+    vpshufb %ymm15,%ymm0,%ymm5              # ymm0/ymm5 = W[8..11]
+    vpaddq 2*32(%r9),%ymm5,%ymm0
+    vsha512rnds2 %xmm0,%ymm11,%ymm12
+    vperm2i128 \$0x1,%ymm0,%ymm0,%ymm0
+    vsha512rnds2 %xmm0,%ymm12,%ymm11
+    vsha512msg1 %xmm5,%ymm4                 # ymm4 = W[4..7] + S0(W[5..8])
+
+    # R12 - R15
+    vmovdqu 3*32($arg_msg),%ymm0
+    vpshufb %ymm15,%ymm0,%ymm6              # ymm0/ymm6 = W[12..15]
+    vpaddq 3*32(%r9),%ymm6,%ymm0
+    vpermq \$0x1b,%ymm6,%ymm8               # ymm8 = W[12] W[13] W[14] W[15]
+    vpermq \$0x39,%ymm5,%ymm9               # ymm9 = W[8]  W[11] W[10] W[9]
+    vpblendd \$0x3f,%ymm9,%ymm8,%ymm8       # ymm8 = W[12] W[11] W[10] W[9]
+    vpaddq %ymm8,%ymm3,%ymm3                # ymm3 = W[0..3] + S0(W[1..4]) + W[9..12]
+    vsha512msg2 %ymm6,%ymm3                 # W[16..19] = ymm3 + S1(W[14..17])
+    vsha512rnds2 %xmm0,%ymm11,%ymm12
+    vperm2i128 \$0x1,%ymm0,%ymm0,%ymm0
+    vsha512rnds2 %xmm0,%ymm12,%ymm11
+    vsha512msg1 %xmm6,%ymm5                 # ymm5 = W[8..11] + S0(W[9..12])
+___
+
+# R16 - R63
+for($i=4;$i<16;) {
+$code.=<<___;
+    # R16 - R19, R32 - R35, R48 - R51
+    vpaddq `$i * 32`(%r9),%ymm3,%ymm0
+    vpermq \$0x1b,%ymm3,%ymm8               # ymm8 = W[16] W[17] W[18] W[19]
+    vpermq \$0x39,%ymm6,%ymm9               # ymm9 = W[12] W[15] W[14] W[13]
+    vpblendd \$0x3f,%ymm9,%ymm8,%ymm7       # ymm7 = W[16] W[15] W[14] W[13]
+    vpaddq %ymm7,%ymm4,%ymm4                # ymm4 = W[4..7] + S0(W[5..8]) + W[13..16]
+    vsha512msg2 %ymm3,%ymm4                 # W[20..23] = ymm4 + S1(W[18..21])
+    vsha512rnds2 %xmm0,%ymm11,%ymm12
+    vperm2i128 \$0x1,%ymm0,%ymm0,%ymm0
+    vsha512rnds2 %xmm0,%ymm12,%ymm11
+    vsha512msg1 %xmm3,%ymm6                 # ymm6 = W[12..15] + S0(W[13..16])
+___
+    $i++;
+$code.=<<___;
+    # R20 - R23, R36 - R39, R52 - R55
+    vpaddq `$i * 32`(%r9),%ymm4,%ymm0
+    vpermq \$0x1b,%ymm4,%ymm8               # ymm8 = W[20] W[21] W[22] W[23]
+    vpermq \$0x39,%ymm3,%ymm9               # ymm9 = W[16] W[19] W[18] W[17]
+    vpblendd \$0x3f,%ymm9,%ymm8,%ymm7       # ymm7 = W[20] W[19] W[18] W[17]
+    vpaddq %ymm7,%ymm5,%ymm5                # ymm5 = W[8..11] + S0(W[9..12]) + W[17..20]
+    vsha512msg2 %ymm4,%ymm5                 # W[24..27] = ymm5 + S1(W[22..25])
+    vsha512rnds2 %xmm0,%ymm11,%ymm12
+    vperm2i128 \$0x1,%ymm0,%ymm0,%ymm0
+    vsha512rnds2 %xmm0,%ymm12,%ymm11
+    vsha512msg1 %xmm4,%ymm3                 # ymm3 = W[16..19] + S0(W[17..20])
+___
+    $i++;
+$code.=<<___;
+    # R24 - R27, R40 - R43, R56 - R59
+    vpaddq `$i * 32`(%r9),%ymm5,%ymm0
+    vpermq \$0x1b,%ymm5,%ymm8               # ymm8 = W[24] W[25] W[26] W[27]
+    vpermq \$0x39,%ymm4,%ymm9               # ymm9 = W[20] W[23] W[22] W[21]
+    vpblendd \$0x3f,%ymm9,%ymm8,%ymm7       # ymm7 = W[24] W[23] W[22] W[21]
+    vpaddq %ymm7,%ymm6,%ymm6                # ymm6 = W[12..15] + S0(W[13..16]) + W[21..24]
+    vsha512msg2 %ymm5,%ymm6                 # W[28..31] = ymm6 + S1(W[26..29])
+    vsha512rnds2 %xmm0,%ymm11,%ymm12
+    vperm2i128 \$0x1,%ymm0,%ymm0,%ymm0
+    vsha512rnds2 %xmm0,%ymm12,%ymm11
+    vsha512msg1 %xmm5,%ymm4                 # ymm4 = W[20..23] + S0(W[21..24])
+___
+    $i++;
+$code.=<<___;
+    # R28 - R31, R44 - R47, R60 - R63
+    vpaddq `$i * 32`(%r9),%ymm6,%ymm0
+    vpermq \$0x1b,%ymm6,%ymm8               # ymm8 = W[28] W[29] W[30] W[31]
+    vpermq \$0x39,%ymm5,%ymm9               # ymm9 = W[24] W[27] W[26] W[25]
+    vpblendd \$0x3f,%ymm9,%ymm8,%ymm7       # ymm7 = W[28] W[27] W[26] W[25]
+    vpaddq %ymm7,%ymm3,%ymm3                # ymm3 = W[16..19] + S0(W[17..20]) + W[25..28]
+    vsha512msg2 %ymm6,%ymm3                 # W[32..35] = ymm3 + S1(W[30..33])
+    vsha512rnds2 %xmm0,%ymm11,%ymm12
+    vperm2i128 \$0x1,%ymm0,%ymm0,%ymm0
+    vsha512rnds2 %xmm0,%ymm12,%ymm11
+    vsha512msg1 %xmm6,%ymm5                 # ymm5 = W[24..27] + S0(W[25..28])
+___
+    $i++;
+}
+
+$code.=<<___;
+    # R64 - R67
+    vpaddq 16*32(%r9),%ymm3,%ymm0
+    vpermq \$0x1b,%ymm3,%ymm8               # ymm8 = W[64] W[65] W[66] W[67]
+    vpermq \$0x39,%ymm6,%ymm9               # ymm9 = W[60] W[63] W[62] W[61]
+    vpblendd \$0x3f,%ymm9,%ymm8,%ymm7       # ymm7 = W[64] W[63] W[62] W[61]
+    vpaddq %ymm7,%ymm4,%ymm4                # ymm4 = W[52..55] + S0(W[53..56]) + W[61..64]
+    vsha512msg2 %ymm3,%ymm4                 # W[64..67] = ymm4 + S1(W[62..65])
+    vsha512rnds2 %xmm0,%ymm11,%ymm12
+    vperm2i128 \$0x1,%ymm0,%ymm0,%ymm0
+    vsha512rnds2 %xmm0,%ymm12,%ymm11
+    vsha512msg1 %xmm3,%ymm6                 # ymm6 = W[60..63] + S0(W[61..64])
+
+    # R68 - R71
+    vpaddq 17*32(%r9),%ymm4,%ymm0
+    vpermq \$0x1b,%ymm4,%ymm8               # ymm8 = W[68] W[69] W[70] W[71]
+    vpermq \$0x39,%ymm3,%ymm9               # ymm9 = W[64] W[67] W[66] W[65]
+    vpblendd \$0x3f,%ymm9,%ymm8,%ymm7       # ymm7 = W[68] W[67] W[66] W[65]
+    vpaddq %ymm7,%ymm5,%ymm5                # ymm5 = W[56..59] + S0(W[57..60]) + W[65..68]
+    vsha512msg2 %ymm4,%ymm5                 # W[68..71] = ymm5 + S1(W[66..69])
+    vsha512rnds2 %xmm0,%ymm11,%ymm12
+    vperm2i128 \$0x1,%ymm0,%ymm0,%ymm0
+    vsha512rnds2 %xmm0,%ymm12,%ymm11
+
+    # R72 - R75
+    vpaddq 18*32(%r9),%ymm5,%ymm0
+    vpermq \$0x1b,%ymm5,%ymm8               # ymm8 = W[72] W[73] W[74] W[75]
+    vpermq \$0x39,%ymm4,%ymm9               # ymm9 = W[68] W[71] W[70] W[69]
+    vpblendd \$0x3f,%ymm9,%ymm8,%ymm7       # ymm7 = W[72] W[71] W[70] W[69]
+    vpaddq %ymm7,%ymm6,%ymm6                # ymm6 = W[60..63] + S0(W[61..64]) + W[69..72]
+    vsha512msg2 %ymm5,%ymm6                 # W[72..75] = ymm6 + S1(W[70..73])
+    vsha512rnds2 %xmm0,%ymm11,%ymm12
+    vperm2i128 \$0x1,%ymm0,%ymm0,%ymm0
+    vsha512rnds2 %xmm0,%ymm12,%ymm11
+
+    # R76 - R79
+    vpaddq 19*32(%r9),%ymm6,%ymm0
+    vsha512rnds2 %xmm0,%ymm11,%ymm12
+    vperm2i128 \$0x1,%ymm0,%ymm0,%ymm0
+    vsha512rnds2 %xmm0,%ymm12,%ymm11
+
+    # update hash value
+    vpaddq %ymm12,%ymm14,%ymm14
+    vpaddq %ymm11,%ymm13,%ymm13
+    add \$`4*32`,$arg_msg
+    dec $arg_num_blks
+    jnz .Lsha512ext_block_loop
+
+    # store the hash value back in memory
+    #   ymm13 = ABEF
+    #   ymm14 = CDGH
+    vperm2i128 \$0x31,%ymm14,%ymm13,%ymm1
+    vperm2i128 \$0x20,%ymm14,%ymm13,%ymm2
+    vpermq \$0xb1,%ymm1,%ymm1               # ymm1 = DCBA
+    vpermq \$0xb1,%ymm2,%ymm2               # ymm2 = HGFE
+    vmovdqu %ymm1,0x00($arg_hash)
+    vmovdqu %ymm2,0x20($arg_hash)
+
+    vzeroupper
+___
+
+$code.=<<___ if($win64);
+    # xmm6:xmm9, xmm11:xmm15 need to be maintained for Windows
+    # xmm10 not used
+    vmovdqu 16*0(%rsp),%xmm6
+    vmovdqu 16*1(%rsp),%xmm7
+    vmovdqu 16*2(%rsp),%xmm8
+    vmovdqu 16*3(%rsp),%xmm9
+    vmovdqu 16*4(%rsp),%xmm11
+    vmovdqu 16*5(%rsp),%xmm12
+    vmovdqu 16*6(%rsp),%xmm13
+    vmovdqu 16*7(%rsp),%xmm14
+    vmovdqu 16*8(%rsp),%xmm15
+    add \$`9*16`,%rsp
+.cfi_adjust_cfa_offset \$`-9*16`
+___
+
+$code.=<<___;
+.Lsha512ext_done:
+    ret
+.cfi_endproc
+.size ${func}_sha512ext,.-${func}_sha512ext
+___
+}
+
 # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame,
 #		CONTEXT *context,DISPATCHER_CONTEXT *disp)
 if ($win64) {
@@ -2544,6 +2864,34 @@ $code.=<<___ if ($avx>1);
 ___
 }

+sub sha512op {
+    my $instr = shift;
+
+    my $args = shift;
+    if ($args =~ /^(.+)\s*#/) {
+        $args = $1; # drop comment and its leading whitespace
+    }
+
+    if (($instr eq "vsha512msg1") && ($args =~ /%xmm(\d{1,2})\s*,\s*%ymm(\d{1,2})/)) {
+        my $b1 = sprintf("0x%02x", 0x42 | ((1-int($1/8))<<5) | ((1-int($2/8))<<7) );
+        my $b2 = sprintf("0x%02x", 0xc0 | ($1 & 7) | (($2 & 7)<<3)                );
+        return ".byte 0xc4,".$b1.",0x7f,0xcc,".$b2;
+    }
+    elsif (($instr eq "vsha512msg2") && ($args =~ /%ymm(\d{1,2})\s*,\s*%ymm(\d{1,2})/)) {
+        my $b1 = sprintf("0x%02x", 0x42 | ((1-int($1/8))<<5) | ((1-int($2/8))<<7) );
+        my $b2 = sprintf("0x%02x", 0xc0 | ($1 & 7) | (($2 & 7)<<3)                );
+        return ".byte 0xc4,".$b1.",0x7f,0xcd,".$b2;
+    }
+    elsif (($instr eq "vsha512rnds2") && ($args =~ /%xmm(\d{1,2})\s*,\s*%ymm(\d{1,2})\s*,\s*%ymm(\d{1,2})/)) {
+        my $b1 = sprintf("0x%02x", 0x42 | ((1-int($1/8))<<5) | ((1-int($3/8))<<7) );
+        my $b2 = sprintf("0x%02x", 0x07 | (15 - $2 & 15)<<3                       );
+        my $b3 = sprintf("0x%02x", 0xc0 | ($1 & 7) | (($3 & 7)<<3)                );
+        return ".byte 0xc4,".$b1.",".$b2.",0xcb,".$b3;
+    }
+
+    return $instr."\t".$args;
+}
+
 sub sha256op38 {
     my $instr = shift;
     my %opcodelet = (
@@ -2564,6 +2912,7 @@ sub sha256op38 {
 foreach (split("\n",$code)) {
 	s/\`([^\`]*)\`/eval $1/geo;

+	s/\b(vsha512[^\s]*)\s+(.*)/sha512op($1,$2)/geo;
 	s/\b(sha256[^\s]*)\s+(.*)/sha256op38($1,$2)/geo;

 	print $_,"\n";
diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512p8-ppc.pl b/deps/openssl/openssl/crypto/sha/asm/sha512p8-ppc.pl
index 97df14ef4cc..569c5ab9f48 100755
--- a/deps/openssl/openssl/crypto/sha/asm/sha512p8-ppc.pl
+++ b/deps/openssl/openssl/crypto/sha/asm/sha512p8-ppc.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2014-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@


 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://github.com/dot-asm/cryptogams/.
 # ====================================================================

 # SHA256/512 for PowerISA v2.07.
@@ -414,7 +414,7 @@ $code.=<<___	if ($LENDIAN);	# word-swapped
 ___
 }
 $code.=<<___;
-.asciz	"SHA${bits} for PowerISA 2.07, CRYPTOGAMS by <appro\@openssl.org>"
+.asciz	"SHA${bits} for PowerISA 2.07, CRYPTOGAMS by <https://github.com/dot-asm>"
 .align	2
 ___

diff --git a/deps/openssl/openssl/crypto/sha/build.info b/deps/openssl/openssl/crypto/sha/build.info
index 9a3d44f6eaa..88e8b9cc5e7 100644
--- a/deps/openssl/openssl/crypto/sha/build.info
+++ b/deps/openssl/openssl/crypto/sha/build.info
@@ -18,6 +18,11 @@ IF[{- !$disabled{asm} -}]
   $SHA1ASM_alpha=sha1-alpha.S
   $SHA1DEF_alpha=SHA1_ASM

+  $SHA1ASM_loongarch64=sha_loongarch.c \
+        sha256-loongarch64.S sha256-loongarch64-lsx.S \
+        sha512-loongarch64.S sha512-loongarch64-lsx.S
+  $SHA1DEF_loongarch64=SHA256_ASM SHA512_ASM
+
   $SHA1ASM_mips32=sha1-mips.S sha256-mips.S
   $SHA1DEF_mips32=SHA1_ASM SHA256_ASM
   $SHA1ASM_mips64=$SHA1ASM_mips32 sha512-mips.S
@@ -46,7 +51,7 @@ IF[{- !$disabled{asm} -}]
   $SHA1ASM_c64xplus=sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s
   $SHA1DEF_c64xplus=SHA1_ASM SHA256_ASM SHA512_ASM

-  $SHA1ASM_riscv64=sha_riscv.c sha256-riscv64-zvkb-zvknha_or_zvknhb.S sha512-riscv64-zvkb-zvknhb.S
+  $SHA1ASM_riscv64=sha_riscv.c sha256-riscv64.S sha256-riscv64-zbb.S sha256-riscv64-zvkb-zvknha_or_zvknhb.S sha512-riscv64-zbb.S sha512-riscv64-zvkb-zvknhb.S
   $SHA1DEF_riscv64=SHA256_ASM INCLUDE_C_SHA256 SHA512_ASM INCLUDE_C_SHA512

   # Now that we have defined all the arch specific variables, use the
@@ -60,7 +65,7 @@ ENDIF
 $KECCAK1600ASM=keccak1600.c
 IF[{- !$disabled{asm} -}]
   $KECCAK1600ASM_x86=
-  $KECCAK1600ASM_x86_64=keccak1600-x86_64.s
+  $KECCAK1600ASM_x86_64=keccak1600-x86_64.s keccak1600x4-avx512vl.s sha3_x4_avx512vl.c

   $KECCAK1600ASM_s390x=keccak1600-s390x.S

@@ -77,7 +82,7 @@ IF[{- !$disabled{asm} -}]
   ENDIF
 ENDIF

-$COMMON=sha1dgst.c sha256.c sha512.c sha3.c $SHA1ASM $KECCAK1600ASM
+$COMMON=sha1dgst.c sha256.c sha512.c sha3.c sha3_encode.c $SHA1ASM $KECCAK1600ASM
 SOURCE[../../libcrypto]=$COMMON sha1_one.c
 SOURCE[../../providers/libfips.a]= $COMMON

@@ -133,6 +138,15 @@ GENERATE[sha1-parisc.s]=asm/sha1-parisc.pl
 GENERATE[sha256-parisc.s]=asm/sha512-parisc.pl
 GENERATE[sha512-parisc.s]=asm/sha512-parisc.pl

+GENERATE[sha256-loongarch64.S]=asm/sha256-loongarch64.pl
+INCLUDE[sha256-loongarch64.o]=..
+GENERATE[sha256-loongarch64-lsx.S]=asm/sha256-loongarch64.pl lsx
+INCLUDE[sha256-loongarch64-lsx.o]=..
+GENERATE[sha512-loongarch64.S]=asm/sha512-loongarch64.pl
+INCLUDE[sha512-loongarch64.o]=..
+GENERATE[sha512-loongarch64-lsx.S]=asm/sha512-loongarch64.pl lsx
+INCLUDE[sha512-loongarch64-lsx.o]=..
+
 GENERATE[sha1-mips.S]=asm/sha1-mips.pl
 INCLUDE[sha1-mips.o]=..
 GENERATE[sha256-mips.S]=asm/sha512-mips.pl
@@ -170,7 +184,10 @@ GENERATE[sha1-c64xplus.S]=asm/sha1-c64xplus.pl
 GENERATE[sha256-c64xplus.S]=asm/sha256-c64xplus.pl
 GENERATE[sha512-c64xplus.S]=asm/sha512-c64xplus.pl

+GENERATE[sha256-riscv64.S]=asm/sha256-riscv64-zbb.pl
+GENERATE[sha256-riscv64-zbb.S]=asm/sha256-riscv64-zbb.pl zbb
 GENERATE[sha256-riscv64-zvkb-zvknha_or_zvknhb.S]=asm/sha256-riscv64-zvkb-zvknha_or_zvknhb.pl
+GENERATE[sha512-riscv64-zbb.S]=asm/sha512-riscv64-zbb.pl
 GENERATE[sha512-riscv64-zvkb-zvknhb.S]=asm/sha512-riscv64-zvkb-zvknhb.pl

 # These are not yet used and do not support multi-squeeze
@@ -181,4 +198,8 @@ GENERATE[keccak1600-avx512vl.S]=asm/keccak1600-avx512vl.pl
 GENERATE[keccak1600-mmx.S]=asm/keccak1600-mmx.pl
 GENERATE[keccak1600p8-ppc.S]=asm/keccak1600p8-ppc.pl

+# keccak1600x4-avx512vl.s supports multi-squeeze
+# Currently only used in ML-DSA on x86_64 with AVX-512VL support
+GENERATE[keccak1600x4-avx512vl.s]=asm/keccak1600x4-avx512vl.pl
+
 GENERATE[sha1-thumb.S]=asm/sha1-thumb.pl
diff --git a/deps/openssl/openssl/crypto/sha/keccak1600.c b/deps/openssl/openssl/crypto/sha/keccak1600.c
index 59e688ce433..b4cbd6b5637 100644
--- a/deps/openssl/openssl/crypto/sha/keccak1600.c
+++ b/deps/openssl/openssl/crypto/sha/keccak1600.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -111,7 +111,7 @@ static const uint64_t iotas[] = {
 /*
  * This is straightforward or "maximum clarity" implementation aiming
  * to resemble section 3.2 of the FIPS PUB 202 "SHA-3 Standard:
- * Permutation-Based Hash and Extendible-Output Functions" as much as
+ * Permutation-Based Hash and Extendable-Output Functions" as much as
  * possible. With one caveat. Because of the way C stores matrices,
  * references to A[x,y] in the specification are presented as A[y][x].
  * Implementation unrolls inner x-loops so that modulo 5 operations are
diff --git a/deps/openssl/openssl/crypto/sha/sha1dgst.c b/deps/openssl/openssl/crypto/sha/sha1dgst.c
index e8f1ef5244d..88437ba0bc7 100644
--- a/deps/openssl/openssl/crypto/sha/sha1dgst.c
+++ b/deps/openssl/openssl/crypto/sha/sha1dgst.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,7 +20,7 @@
 #include <openssl/evp.h>
 #include <openssl/sha.h>

-/* The implementation is in crypto/md32_common.h */
+/* The implementation is in crypto/md32_common.inc */

 #include "sha_local.h"
 #include "crypto/sha.h"
diff --git a/deps/openssl/openssl/crypto/sha/sha256.c b/deps/openssl/openssl/crypto/sha/sha256.c
index 0268e09dde9..8cbbfdbb30e 100644
--- a/deps/openssl/openssl/crypto/sha/sha256.c
+++ b/deps/openssl/openssl/crypto/sha/sha256.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -119,7 +119,8 @@ int SHA224_Final(unsigned char *md, SHA256_CTX *c)
         }                                                           \
     } while (0)

-#define HASH_UPDATE SHA256_Update
+#define HASH_UPDATE_THUNK
+#define HASH_UPDATE SHA256_Update_thunk
 #define HASH_TRANSFORM SHA256_Transform
 #define HASH_FINAL SHA256_Final
 #define HASH_BLOCK_DATA_ORDER sha256_block_data_order
@@ -132,7 +133,15 @@ void sha256_block_data_order_c(SHA256_CTX *ctx, const void *in, size_t num);
 #endif /* SHA256_ASM */
     void sha256_block_data_order(SHA256_CTX *ctx, const void *in, size_t num);

-#include "crypto/md32_common.h"
+/* clang-format off */
+#include "crypto/md32_common.inc"
+/* clang-format on */
+#undef HASH_UPDATE_THUNK
+
+int SHA256_Update(SHA256_CTX *ctx, const void *data, size_t sz)
+{
+    return SHA256_Update_thunk((void *)ctx, (const unsigned char *)data, sz);
+}

 #if !defined(SHA256_ASM) || defined(INCLUDE_C_SHA256)
 static const SHA_LONG K256[64] = {
@@ -155,7 +164,7 @@ static const SHA_LONG K256[64] = {
 };

 #ifndef PEDANTIC
-#if defined(__GNUC__) && __GNUC__ >= 2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
+#if defined(__GNUC__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 #if defined(__riscv_zknh)
 #define Sigma0(x) ({ MD32_REG_T ret;            \
                         asm ("sha256sum0 %0, %1"    \
diff --git a/deps/openssl/openssl/crypto/sha/sha3.c b/deps/openssl/openssl/crypto/sha/sha3.c
index 21e1070beed..5c8754cfd6e 100644
--- a/deps/openssl/openssl/crypto/sha/sha3.c
+++ b/deps/openssl/openssl/crypto/sha/sha3.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,21 @@
  */

 #include <string.h>
+#include "internal/sha3.h"
+#include "internal/common.h"
+
+#if defined(__aarch64__) && defined(KECCAK1600_ASM)
+#include "arch/arm_arch.h"
+#endif
+
 #if defined(__s390x__) && defined(OPENSSL_CPUID_OBJ)
-#include "crypto/s390x_arch.h"
+#include "arch/s390x_arch.h"
+#if defined(KECCAK1600_ASM)
+#define S390_SHA3 1
+#define S390_SHA3_CAPABLE(name) \
+    ((OPENSSL_s390xcap_P.kimd[0] & S390X_CAPBIT(name)) && (OPENSSL_s390xcap_P.klmd[0] & S390X_CAPBIT(name)))
+#endif
 #endif
-#include "internal/sha3.h"

 void SHA3_squeeze(uint64_t A[5][5], unsigned char *out, size_t len, size_t r, int next);

@@ -49,67 +60,98 @@ int ossl_keccak_init(KECCAK1600_CTX *ctx, unsigned char pad, size_t bitlen, size
     return ret;
 }

-int ossl_sha3_update(KECCAK1600_CTX *ctx, const void *_inp, size_t len)
+/*
+ * A buffered absorb function that calls a platform specific absorb
+ * method.
+ */
+int ossl_sha3_absorb(KECCAK1600_CTX *ctx, const unsigned char *inp, size_t len)
 {
-    const unsigned char *inp = _inp;
-    size_t bsz = ctx->block_size;
+    const size_t bsz = ctx->block_size;
     size_t num, rem;

-    if (len == 0)
+    if (ossl_unlikely(len == 0))
         return 1;

-    if (ctx->xof_state == XOF_STATE_SQUEEZE
-        || ctx->xof_state == XOF_STATE_FINAL)
+    if (!(ctx->xof_state == XOF_STATE_INIT || ctx->xof_state == XOF_STATE_ABSORB))
         return 0;

-    if ((num = ctx->bufsz) != 0) { /* process intermediate buffer? */
+    /* Is there anything in the buffer already ? */
+    if ((num = ctx->bufsz) != 0) {
+        /* Calculate how much space is left in the buffer */
         rem = bsz - num;
-
+        /* If the new input does not fill the buffer then just add it */
         if (len < rem) {
             memcpy(ctx->buf + num, inp, len);
             ctx->bufsz += len;
             return 1;
         }
-        /*
-         * We have enough data to fill or overflow the intermediate
-         * buffer. So we append |rem| bytes and process the block,
-         * leaving the rest for later processing...
-         */
+        /* otherwise fill up the buffer and absorb the buffer */
         memcpy(ctx->buf + num, inp, rem);
-        inp += rem, len -= rem;
-        (void)SHA3_absorb(ctx->A, ctx->buf, bsz, bsz);
+        /* Update the input pointer */
+        inp += rem;
+        len -= rem;
+        ctx->meth.absorb(ctx, ctx->buf, bsz);
         ctx->bufsz = 0;
-        /* ctx->buf is processed, ctx->num is guaranteed to be zero */
+        ctx->xof_state = XOF_STATE_ABSORB;
     }
-
+    /* Absorb the input - rem = leftover part of the input < blocksize) */
+    rem = ctx->meth.absorb(ctx, inp, len);
     if (len >= bsz)
-        rem = SHA3_absorb(ctx->A, inp, len, bsz);
-    else
-        rem = len;
-
-    if (rem) {
+        ctx->xof_state = XOF_STATE_ABSORB;
+    /* Copy the leftover bit of the input into the buffer */
+    if (ossl_likely(rem > 0)) {
         memcpy(ctx->buf, inp + len - rem, rem);
         ctx->bufsz = rem;
     }
-
     return 1;
 }

 /*
- * ossl_sha3_final()is a single shot method
- * (Use ossl_sha3_squeeze for multiple calls).
- * outlen is the variable size output.
+ * Call a platform specific final method.
+ * In most cases outlen should be set to ctx->mdlen.
+ * This function assumes the caller has checked outlen is bounded.
  */
 int ossl_sha3_final(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
 {
-    size_t bsz = ctx->block_size;
-    size_t num = ctx->bufsz;
+    int ret;

-    if (outlen == 0)
-        return 1;
     if (ctx->xof_state == XOF_STATE_SQUEEZE
         || ctx->xof_state == XOF_STATE_FINAL)
         return 0;
+    if (outlen == 0)
+        return 1;
+
+    ret = ctx->meth.final(ctx, out, outlen);
+    ctx->xof_state = XOF_STATE_FINAL;
+    return ret;
+}
+
+/* Calls a platform specific squeeze method */
+int ossl_sha3_squeeze(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
+{
+    int ret = 0;
+
+    if (ctx->xof_state == XOF_STATE_FINAL)
+        return 0;
+    ret = ctx->meth.squeeze(ctx, out, outlen);
+    ctx->xof_state = XOF_STATE_SQUEEZE;
+    return ret;
+}
+
+/* Default version of the absorb() */
+size_t ossl_sha3_absorb_default(KECCAK1600_CTX *ctx, const unsigned char *inp, size_t len)
+{
+    return SHA3_absorb(ctx->A, inp, len, ctx->block_size);
+}
+
+/*
+ * Default version of the final() is a single shot method
+ * (Use ossl_sha3_default_squeeze() for multiple calls).
+ */
+int ossl_sha3_final_default(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
+{
+    size_t bsz = ctx->block_size;
+    size_t num = ctx->bufsz;

     /*
      * Pad the data with 10*1. Note that |num| can be |bsz - 1|
@@ -122,7 +164,6 @@ int ossl_sha3_final(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)

     (void)SHA3_absorb(ctx->A, ctx->buf, bsz, bsz);

-    ctx->xof_state = XOF_STATE_FINAL;
     SHA3_squeeze(ctx->A, out, outlen, bsz, 0);
     return 1;
 }
@@ -137,19 +178,13 @@ int ossl_sha3_final(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
  * buffer the results. The next request will use the buffer first
  * to grab output bytes.
  */
-int ossl_sha3_squeeze(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
+int ossl_shake_squeeze_default(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
 {
     size_t bsz = ctx->block_size;
     size_t num = ctx->bufsz;
     size_t len;
     int next = 1;

-    if (outlen == 0)
-        return 1;
-
-    if (ctx->xof_state == XOF_STATE_FINAL)
-        return 0;
-
     /*
      * On the first squeeze call, finish the absorb process,
      * by adding the trailing padding and then doing
@@ -165,7 +200,6 @@ int ossl_sha3_squeeze(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
         ctx->buf[num] = ctx->pad;
         ctx->buf[bsz - 1] |= 0x80;
         (void)SHA3_absorb(ctx->A, ctx->buf, bsz, bsz);
-        ctx->xof_state = XOF_STATE_SQUEEZE;
         num = ctx->bufsz = 0;
         next = 0;
     }
@@ -202,6 +236,119 @@ int ossl_sha3_squeeze(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
         /* Step 4. Remember the leftover part of the squeezed block */
         ctx->bufsz = bsz - outlen;
     }
+    return 1;
+}
+
+static PROV_SHA3_METHOD shake_generic_meth = {
+    ossl_sha3_absorb_default,
+    ossl_sha3_final_default,
+    ossl_shake_squeeze_default
+};
+
+#if defined(S390_SHA3)
+
+/*-
+ * The platform specific parts of the absorb() and final() for S390X.
+ */
+static size_t sha3_absorb_s390x(KECCAK1600_CTX *ctx, const unsigned char *inp, size_t len)
+{
+    size_t rem = len % ctx->block_size;
+    unsigned int fc;
+
+    if (len - rem > 0) {
+        fc = ctx->pad;
+        fc |= ctx->xof_state == XOF_STATE_INIT ? S390X_KIMD_NIP : 0;
+        s390x_kimd(inp, len - rem, fc, ctx->A);
+    }
+    return rem;
+}
+
+static int shake_final_s390x(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
+{
+    unsigned int fc;
+
+    fc = ctx->pad | S390X_KLMD_DUFOP;
+    fc |= ctx->xof_state == XOF_STATE_INIT ? S390X_KLMD_NIP : 0;
+    s390x_klmd(ctx->buf, ctx->bufsz, out, outlen, fc, ctx->A);
+    return 1;
+}
+
+static int shake_squeeze_s390x(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
+{
+    unsigned int fc;
+    size_t len;
+
+    /*
+     * On the first squeeze call, finish the absorb process (incl. padding).
+     */
+    if (ctx->xof_state != XOF_STATE_SQUEEZE) {
+        fc = ctx->pad;
+        fc |= ctx->xof_state == XOF_STATE_INIT ? S390X_KLMD_NIP : 0;
+        s390x_klmd(ctx->buf, ctx->bufsz, out, outlen, fc, ctx->A);
+        ctx->bufsz = outlen % ctx->block_size;
+        /* reuse ctx->bufsz to count bytes squeezed from current sponge */
+        return 1;
+    }
+    if (ctx->bufsz != 0) {
+        len = ctx->block_size - ctx->bufsz;
+        if (outlen < len)
+            len = outlen;
+        memcpy(out, (char *)ctx->A + ctx->bufsz, len);
+        out += len;
+        outlen -= len;
+        ctx->bufsz += len;
+        if (ctx->bufsz == ctx->block_size)
+            ctx->bufsz = 0;
+    }
+    if (outlen == 0)
+        return 1;
+    s390x_klmd(NULL, 0, out, outlen, ctx->pad | S390X_KLMD_PS, ctx->A);
+    ctx->bufsz = outlen % ctx->block_size;

     return 1;
 }
+
+static PROV_SHA3_METHOD shake_s390x_meth = {
+    sha3_absorb_s390x,
+    shake_final_s390x,
+    shake_squeeze_s390x
+};
+#elif defined(__aarch64__) && defined(KECCAK1600_ASM)
+
+size_t SHA3_absorb_cext(uint64_t A[5][5], const unsigned char *inp, size_t len,
+    size_t r);
+/*-
+ * Hardware-assisted ARMv8.2 SHA3 extension version of the absorb()
+ */
+static size_t sha3_absorb_arm(KECCAK1600_CTX *ctx, const unsigned char *inp, size_t len)
+{
+    return SHA3_absorb_cext(ctx->A, inp, len, ctx->block_size);
+}
+
+static PROV_SHA3_METHOD shake_ARMSHA3_meth = {
+    sha3_absorb_arm,
+    ossl_sha3_final_default,
+    ossl_shake_squeeze_default
+};
+#endif
+
+KECCAK1600_CTX *ossl_shake256_new(void)
+{
+    KECCAK1600_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
+
+    if (ctx == NULL)
+        return NULL;
+    ossl_keccak_init(ctx, '\x1f', 256, 0);
+    ctx->md_size = SIZE_MAX;
+    ctx->meth = shake_generic_meth;
+#if defined(S390_SHA3)
+    if (S390_SHA3_CAPABLE(S390X_SHAKE_256)) {
+        ctx->pad = S390X_SHAKE_256;
+        ctx->meth = shake_s390x_meth;
+    }
+#elif defined(__aarch64__) && defined(KECCAK1600_ASM)
+    if (OPENSSL_armcap_P & ARMV8_HAVE_SHA3_AND_WORTH_USING)
+        ctx->meth = shake_ARMSHA3_meth;
+#endif
+    return ctx;
+}
diff --git a/deps/openssl/openssl/crypto/sha/sha3_encode.c b/deps/openssl/openssl/crypto/sha/sha3_encode.c
new file mode 100644
index 00000000000..1d4e38b86f8
--- /dev/null
+++ b/deps/openssl/openssl/crypto/sha/sha3_encode.c
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* including crypto/sha.h requires this for SHA256_CTX */
+#include "internal/deprecated.h"
+
+/*
+ * NIST.SP.800-185 Encoding/Padding Methods used for SHA3 derived functions
+ * e.g. It is used by KMAC and cSHAKE
+ */
+
+#include <string.h> /* memcpy */
+#include <openssl/err.h>
+#include <openssl/proverr.h>
+#include "crypto/sha.h"
+#include "internal/common.h" /* ossl_assert */
+
+/* Returns the number of bytes required to store 'bits' into a byte array */
+static unsigned int get_encode_size(size_t bits)
+{
+    unsigned int cnt = 0, sz = sizeof(size_t);
+
+    while (bits && (cnt < sz)) {
+        ++cnt;
+        bits >>= 8;
+    }
+    /* If bits is zero 1 byte is required */
+    if (cnt == 0)
+        cnt = 1;
+    return cnt;
+}
+
+/*
+ * Convert an integer into bytes. The number of bytes is appended
+ * to the end of the buffer.
+ * Returns an array of bytes 'out' of size *out_len.
+ *
+ * e.g if bits = 32, out[2] = { 0x20, 0x01 }
+ */
+int ossl_sp800_185_right_encode(unsigned char *out,
+    size_t out_max_len, size_t *out_len,
+    size_t bits)
+{
+    unsigned int len = get_encode_size(bits);
+    int i;
+
+    if (len >= out_max_len) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_LENGTH_TOO_LARGE);
+        return 0;
+    }
+
+    /* MSB's are at the start of the bytes array */
+    for (i = len - 1; i >= 0; --i) {
+        out[i] = (unsigned char)(bits & 0xFF);
+        bits >>= 8;
+    }
+    /* Tack the length onto the end */
+    out[len] = (unsigned char)len;
+
+    /* The Returned length includes the tacked on byte */
+    *out_len = len + 1;
+    return 1;
+}
+
+/*
+ * Encodes a string with a left encoded length added. Note that the
+ * in_len is converted to bits (* 8).
+ *
+ * e.g- in="KMAC" gives out[6] = { 0x01, 0x20, 0x4B, 0x4D, 0x41, 0x43 }
+ *                                 len   bits    K     M     A     C
+ */
+int ossl_sp800_185_encode_string(unsigned char *out,
+    size_t out_max_len, size_t *out_len,
+    const unsigned char *in, size_t in_len)
+{
+    if (in == NULL) {
+        *out_len = 0;
+    } else {
+        size_t i, bits, len, sz;
+
+        bits = 8 * in_len;
+        len = get_encode_size(bits);
+        sz = 1 + len + in_len;
+
+        if (sz > out_max_len) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_LENGTH_TOO_LARGE);
+            return 0;
+        }
+
+        out[0] = (unsigned char)len;
+        for (i = len; i > 0; --i) {
+            out[i] = (bits & 0xFF);
+            bits >>= 8;
+        }
+        memcpy(out + len + 1, in, in_len);
+        *out_len = sz;
+    }
+    return 1;
+}
+
+/*
+ * Returns a zero padded encoding of the inputs in1 and an optional
+ * in2 (can be NULL). The padded output must be a multiple of the blocksize 'w'.
+ * The value of w is in bytes (< 256).
+ *
+ * The returned output is:
+ *    zero_padded(multiple of w, (left_encode(w) || in1 [|| in2])
+ */
+int ossl_sp800_185_bytepad(unsigned char *out, size_t out_len_max, size_t *out_len,
+    const unsigned char *in1, size_t in1_len,
+    const unsigned char *in2, size_t in2_len,
+    size_t w)
+{
+    size_t len;
+    unsigned char *p = out;
+    size_t sz;
+
+    if (!ossl_assert(w <= 255))
+        return 0;
+    sz = (2 + in1_len + (in2 != NULL ? in2_len : 0) + w - 1) / w * w;
+    if (out_len_max != 0 && sz > out_len_max)
+        return 0;
+
+    if (out == NULL) {
+        if (out_len == NULL) {
+            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
+            return 0;
+        }
+        *out_len = sz;
+        return 1;
+    }
+
+    /* Left encoded w */
+    *p++ = 1;
+    *p++ = (unsigned char)w;
+    /* || in1 */
+    memcpy(p, in1, in1_len);
+    p += in1_len;
+    /* [ || in2 ] */
+    if (in2 != NULL && in2_len > 0) {
+        memcpy(p, in2, in2_len);
+        p += in2_len;
+    }
+    /* Figure out the pad size (divisible by w) */
+    len = p - out;
+    /* zero pad the end of the buffer */
+    if (sz != len)
+        memset(p, 0, sz - len);
+    if (out_len != NULL)
+        *out_len = sz;
+    return 1;
+}
diff --git a/deps/openssl/openssl/crypto/sha/sha3_x4_avx512vl.c b/deps/openssl/openssl/crypto/sha/sha3_x4_avx512vl.c
new file mode 100644
index 00000000000..86a8282814f
--- /dev/null
+++ b/deps/openssl/openssl/crypto/sha/sha3_x4_avx512vl.c
@@ -0,0 +1,213 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright (c) 2026 Intel Corporation. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * SHAKE x4 multi-buffer implementation for AVX-512VL
+ *
+ * This file provides incremental API wrappers around the AVX-512VL
+ * assembly implementations for processing 4 SHAKE instances in parallel.
+ *
+ * Callers should check SHA3_avx512vl_capable() before calling.
+ */
+
+#include "internal/sha3.h"
+#include <openssl/crypto.h>
+#include <string.h>
+
+#if defined(KECCAK1600_ASM)                                                               \
+    && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64)) \
+    && !defined(OPENSSL_NO_ASM)
+
+/* External assembly function declarations */
+extern void SHA3_shake128_x4_inc_absorb_avx512vl(
+    uint64_t *state,
+    const void *in0, const void *in1,
+    const void *in2, const void *in3,
+    size_t inlen);
+
+extern void SHA3_shake256_x4_inc_absorb_avx512vl(
+    uint64_t *state,
+    const void *in0, const void *in1,
+    const void *in2, const void *in3,
+    size_t inlen);
+
+extern void SHA3_shake128_x4_inc_finalize_avx512vl(uint64_t *state);
+extern void SHA3_shake256_x4_inc_finalize_avx512vl(uint64_t *state);
+
+extern void SHA3_shake128_x4_inc_squeeze_avx512vl(
+    void *out0, void *out1,
+    void *out2, void *out3,
+    size_t outlen,
+    uint64_t *state);
+
+extern void SHA3_shake256_x4_inc_squeeze_avx512vl(
+    void *out0, void *out1,
+    void *out2, void *out3,
+    size_t outlen,
+    uint64_t *state);
+
+/* One-shot assembly function declarations */
+extern void SHA3_shake128_x4_avx512vl(
+    void *out0, void *out1,
+    void *out2, void *out3,
+    size_t outlen,
+    const void *in0, const void *in1,
+    const void *in2, const void *in3,
+    size_t inlen);
+
+extern void SHA3_shake256_x4_avx512vl(
+    void *out0, void *out1,
+    void *out2, void *out3,
+    size_t outlen,
+    const void *in0, const void *in1,
+    const void *in2, const void *in3,
+    size_t inlen);
+
+/*
+ * SHAKE-128 x4 Implementation
+ */
+
+void ossl_sha3_shake128_x4_inc_init_avx512vl(KECCAK1600_X4_AVX512VL_CTX *ctx)
+{
+    memset(ctx->A, 0, sizeof(ctx->A));
+    ctx->rate = SHA3_BLOCKSIZE(128);
+    ctx->finalized = 0;
+}
+
+void ossl_sha3_shake128_x4_inc_absorb_avx512vl(
+    KECCAK1600_X4_AVX512VL_CTX *ctx,
+    const void *in0, const void *in1,
+    const void *in2, const void *in3,
+    size_t inlen)
+{
+    if (ctx->finalized) {
+        /* Error: cannot absorb after finalize */
+        return;
+    }
+
+    SHA3_shake128_x4_inc_absorb_avx512vl(
+        ctx->A, in0, in1, in2, in3, inlen);
+}
+
+void ossl_sha3_shake128_x4_inc_cleanup_avx512vl(KECCAK1600_X4_AVX512VL_CTX *ctx)
+{
+    OPENSSL_cleanse(ctx, sizeof(*ctx));
+}
+
+static void ossl_sha3_shake128_x4_inc_finalize_avx512vl(KECCAK1600_X4_AVX512VL_CTX *ctx)
+{
+    if (ctx->finalized) {
+        return; /* Already finalized */
+    }
+
+    SHA3_shake128_x4_inc_finalize_avx512vl(ctx->A);
+    ctx->finalized = 1;
+}
+
+void ossl_sha3_shake128_x4_inc_squeeze_avx512vl(
+    void *out0, void *out1,
+    void *out2, void *out3,
+    size_t outlen,
+    KECCAK1600_X4_AVX512VL_CTX *ctx)
+{
+    if (!ctx->finalized) {
+        /* Auto-finalize on first squeeze */
+        ossl_sha3_shake128_x4_inc_finalize_avx512vl(ctx);
+    }
+
+    SHA3_shake128_x4_inc_squeeze_avx512vl(
+        out0, out1, out2, out3, outlen, ctx->A);
+}
+
+/*
+ * SHAKE-256 x4 Implementation
+ */
+
+void ossl_sha3_shake256_x4_inc_init_avx512vl(KECCAK1600_X4_AVX512VL_CTX *ctx)
+{
+    memset(ctx->A, 0, sizeof(ctx->A));
+    ctx->rate = SHA3_BLOCKSIZE(256);
+    ctx->finalized = 0;
+}
+
+void ossl_sha3_shake256_x4_inc_absorb_avx512vl(
+    KECCAK1600_X4_AVX512VL_CTX *ctx,
+    const void *in0, const void *in1,
+    const void *in2, const void *in3,
+    size_t inlen)
+{
+    if (ctx->finalized) {
+        /* Error: cannot absorb after finalize */
+        return;
+    }
+
+    SHA3_shake256_x4_inc_absorb_avx512vl(
+        ctx->A, in0, in1, in2, in3, inlen);
+}
+
+void ossl_sha3_shake256_x4_inc_cleanup_avx512vl(KECCAK1600_X4_AVX512VL_CTX *ctx)
+{
+    OPENSSL_cleanse(ctx, sizeof(*ctx));
+}
+
+static void ossl_sha3_shake256_x4_inc_finalize_avx512vl(KECCAK1600_X4_AVX512VL_CTX *ctx)
+{
+    if (ctx->finalized) {
+        return; /* Already finalized */
+    }
+
+    SHA3_shake256_x4_inc_finalize_avx512vl(ctx->A);
+    ctx->finalized = 1;
+}
+
+void ossl_sha3_shake256_x4_inc_squeeze_avx512vl(
+    void *out0, void *out1,
+    void *out2, void *out3,
+    size_t outlen,
+    KECCAK1600_X4_AVX512VL_CTX *ctx)
+{
+    if (!ctx->finalized) {
+        /* Auto-finalize on first squeeze */
+        ossl_sha3_shake256_x4_inc_finalize_avx512vl(ctx);
+    }
+
+    SHA3_shake256_x4_inc_squeeze_avx512vl(
+        out0, out1, out2, out3, outlen, ctx->A);
+}
+
+/*
+ * Single-call wrapper APIs
+ */
+
+void ossl_sha3_shake128_x4_avx512vl(
+    void *out0, void *out1,
+    void *out2, void *out3,
+    size_t outlen,
+    const void *in0, const void *in1,
+    const void *in2, const void *in3,
+    size_t inlen)
+{
+    SHA3_shake128_x4_avx512vl(out0, out1, out2, out3, outlen,
+        in0, in1, in2, in3, inlen);
+}
+
+void ossl_sha3_shake256_x4_avx512vl(
+    void *out0, void *out1,
+    void *out2, void *out3,
+    size_t outlen,
+    const void *in0, const void *in1,
+    const void *in2, const void *in3,
+    size_t inlen)
+{
+    SHA3_shake256_x4_avx512vl(out0, out1, out2, out3, outlen,
+        in0, in1, in2, in3, inlen);
+}
+
+#endif /* KECCAK1600_ASM && x86_64 && !OPENSSL_NO_ASM */
diff --git a/deps/openssl/openssl/crypto/sha/sha512.c b/deps/openssl/openssl/crypto/sha/sha512.c
index 4c3a3b6c093..637eac146fe 100644
--- a/deps/openssl/openssl/crypto/sha/sha512.c
+++ b/deps/openssl/openssl/crypto/sha/sha512.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,6 +15,7 @@

 #include <stdio.h>
 #include <openssl/opensslconf.h>
+#include <openssl/byteorder.h>
 /*-
  * IMPLEMENTATION NOTES.
  *
@@ -25,7 +26,7 @@
  *   on [aligned] data in host byte order, and one operating on data in input
  *   stream byte order;
  * - share common byte-order neutral collector and padding function
- *   implementations, crypto/md32_common.h;
+ *   implementations, crypto/md32_common.inc;
  *
  * Neither of the above applies to this SHA-512 implementation. Reasons
  * [in reverse order] are:
@@ -59,7 +60,7 @@
 #include "internal/cryptlib.h"
 #include "crypto/sha.h"

-#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || defined(__s390__) || defined(__s390x__) || defined(__aarch64__) || defined(SHA512_ASM)
+#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || defined(__s390__) || defined(__s390x__) || defined(__aarch64__) || defined(__e2k__) || defined(SHA512_ASM)
 #define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA
 #endif

@@ -71,6 +72,8 @@
 #define U64(C) C##ULL
 #endif

+int SHA512_Update_thunk(void *cp, const unsigned char *data, size_t len);
+
 int sha512_224_init(SHA512_CTX *c)
 {
     c->h[0] = U64(0x8c3d37c819544da2);
@@ -152,7 +155,11 @@ void sha512_block_data_order_c(SHA512_CTX *ctx, const void *in, size_t num);
 #endif
     void sha512_block_data_order(SHA512_CTX *ctx, const void *in, size_t num);

-int SHA512_Final(unsigned char *md, SHA512_CTX *c)
+#define OUTPUT_RESULT(md, len)      \
+    for (n = 0; n < (len / 8); n++) \
+    md = OPENSSL_store_u64_be(md, (uint64_t)c->h[n])
+
+int SHA512_Final(unsigned char *out, SHA512_CTX *c)
 {
     unsigned char *p = (unsigned char *)c->u.p;
     size_t n = c->num;
@@ -170,44 +177,33 @@ int SHA512_Final(unsigned char *md, SHA512_CTX *c)
     c->u.d[SHA_LBLOCK - 2] = c->Nh;
     c->u.d[SHA_LBLOCK - 1] = c->Nl;
 #else
-    p[sizeof(c->u) - 1] = (unsigned char)(c->Nl);
-    p[sizeof(c->u) - 2] = (unsigned char)(c->Nl >> 8);
-    p[sizeof(c->u) - 3] = (unsigned char)(c->Nl >> 16);
-    p[sizeof(c->u) - 4] = (unsigned char)(c->Nl >> 24);
-    p[sizeof(c->u) - 5] = (unsigned char)(c->Nl >> 32);
-    p[sizeof(c->u) - 6] = (unsigned char)(c->Nl >> 40);
-    p[sizeof(c->u) - 7] = (unsigned char)(c->Nl >> 48);
-    p[sizeof(c->u) - 8] = (unsigned char)(c->Nl >> 56);
-    p[sizeof(c->u) - 9] = (unsigned char)(c->Nh);
-    p[sizeof(c->u) - 10] = (unsigned char)(c->Nh >> 8);
-    p[sizeof(c->u) - 11] = (unsigned char)(c->Nh >> 16);
-    p[sizeof(c->u) - 12] = (unsigned char)(c->Nh >> 24);
-    p[sizeof(c->u) - 13] = (unsigned char)(c->Nh >> 32);
-    p[sizeof(c->u) - 14] = (unsigned char)(c->Nh >> 40);
-    p[sizeof(c->u) - 15] = (unsigned char)(c->Nh >> 48);
-    p[sizeof(c->u) - 16] = (unsigned char)(c->Nh >> 56);
+    uint8_t *cu = p + sizeof(c->u) - 16;
+
+    cu = OPENSSL_store_u64_be(cu, (uint64_t)c->Nh);
+    cu = OPENSSL_store_u64_be(cu, (uint64_t)c->Nl);
 #endif

     sha512_block_data_order(c, p, 1);

-    if (md == 0)
+    if (out == NULL)
         return 0;

-    switch (c->md_len) {
     /* Let compiler decide if it's appropriate to unroll... */
-    case SHA224_DIGEST_LENGTH:
-        for (n = 0; n < SHA224_DIGEST_LENGTH / 8; n++) {
-            SHA_LONG64 t = c->h[n];
-
-            *(md++) = (unsigned char)(t >> 56);
-            *(md++) = (unsigned char)(t >> 48);
-            *(md++) = (unsigned char)(t >> 40);
-            *(md++) = (unsigned char)(t >> 32);
-            *(md++) = (unsigned char)(t >> 24);
-            *(md++) = (unsigned char)(t >> 16);
-            *(md++) = (unsigned char)(t >> 8);
-            *(md++) = (unsigned char)(t);
-        }
+    switch (c->md_len) {
+    case SHA256_192_DIGEST_LENGTH:
+        OUTPUT_RESULT(out, SHA256_192_DIGEST_LENGTH);
+        break;
+    case SHA256_DIGEST_LENGTH:
+        OUTPUT_RESULT(out, SHA256_DIGEST_LENGTH);
+        break;
+    case SHA384_DIGEST_LENGTH:
+        OUTPUT_RESULT(out, SHA384_DIGEST_LENGTH);
+        break;
+    case SHA512_DIGEST_LENGTH:
+        OUTPUT_RESULT(out, SHA512_DIGEST_LENGTH);
+        break;
+    case SHA224_DIGEST_LENGTH: {
+        OUTPUT_RESULT(out, SHA224_DIGEST_LENGTH);
         /*
          * For 224 bits, there are four bytes left over that have to be
          * processed separately.
@@ -215,54 +211,13 @@ int SHA512_Final(unsigned char *md, SHA512_CTX *c)
         {
             SHA_LONG64 t = c->h[SHA224_DIGEST_LENGTH / 8];

-            *(md++) = (unsigned char)(t >> 56);
-            *(md++) = (unsigned char)(t >> 48);
-            *(md++) = (unsigned char)(t >> 40);
-            *(md++) = (unsigned char)(t >> 32);
-        }
-        break;
-    case SHA256_DIGEST_LENGTH:
-        for (n = 0; n < SHA256_DIGEST_LENGTH / 8; n++) {
-            SHA_LONG64 t = c->h[n];
-
-            *(md++) = (unsigned char)(t >> 56);
-            *(md++) = (unsigned char)(t >> 48);
-            *(md++) = (unsigned char)(t >> 40);
-            *(md++) = (unsigned char)(t >> 32);
-            *(md++) = (unsigned char)(t >> 24);
-            *(md++) = (unsigned char)(t >> 16);
-            *(md++) = (unsigned char)(t >> 8);
-            *(md++) = (unsigned char)(t);
-        }
-        break;
-    case SHA384_DIGEST_LENGTH:
-        for (n = 0; n < SHA384_DIGEST_LENGTH / 8; n++) {
-            SHA_LONG64 t = c->h[n];
-
-            *(md++) = (unsigned char)(t >> 56);
-            *(md++) = (unsigned char)(t >> 48);
-            *(md++) = (unsigned char)(t >> 40);
-            *(md++) = (unsigned char)(t >> 32);
-            *(md++) = (unsigned char)(t >> 24);
-            *(md++) = (unsigned char)(t >> 16);
-            *(md++) = (unsigned char)(t >> 8);
-            *(md++) = (unsigned char)(t);
-        }
-        break;
-    case SHA512_DIGEST_LENGTH:
-        for (n = 0; n < SHA512_DIGEST_LENGTH / 8; n++) {
-            SHA_LONG64 t = c->h[n];
-
-            *(md++) = (unsigned char)(t >> 56);
-            *(md++) = (unsigned char)(t >> 48);
-            *(md++) = (unsigned char)(t >> 40);
-            *(md++) = (unsigned char)(t >> 32);
-            *(md++) = (unsigned char)(t >> 24);
-            *(md++) = (unsigned char)(t >> 16);
-            *(md++) = (unsigned char)(t >> 8);
-            *(md++) = (unsigned char)(t);
+            *(out++) = (unsigned char)(t >> 56);
+            *(out++) = (unsigned char)(t >> 48);
+            *(out++) = (unsigned char)(t >> 40);
+            *(out++) = (unsigned char)(t >> 32);
         }
         break;
+    }
     /* ... as well as make sure md_len is not abused. */
     default:
         return 0;
@@ -276,11 +231,11 @@ int SHA384_Final(unsigned char *md, SHA512_CTX *c)
     return SHA512_Final(md, c);
 }

-int SHA512_Update(SHA512_CTX *c, const void *_data, size_t len)
+int SHA512_Update_thunk(void *cp, const unsigned char *data, size_t len)
 {
+    SHA512_CTX *c = (SHA512_CTX *)cp;
     SHA_LONG64 l;
     unsigned char *p = c->u.p;
-    const unsigned char *data = (const unsigned char *)_data;

     if (len == 0)
         return 1;
@@ -324,9 +279,14 @@ int SHA512_Update(SHA512_CTX *c, const void *_data, size_t len)
     return 1;
 }

+int SHA512_Update(SHA512_CTX *c, const void *_data, size_t len)
+{
+    return SHA512_Update_thunk((void *)c, (const unsigned char *)_data, len);
+}
+
 int SHA384_Update(SHA512_CTX *c, const void *data, size_t len)
 {
-    return SHA512_Update(c, data, len);
+    return SHA512_Update_thunk((void *)c, (const unsigned char *)data, len);
 }

 void SHA512_Transform(SHA512_CTX *c, const unsigned char *data)
@@ -383,7 +343,7 @@ static const SHA_LONG64 K512[80] = {
 };

 #ifndef PEDANTIC
-#if defined(__GNUC__) && __GNUC__ >= 2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
+#if defined(__GNUC__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 #if defined(__x86_64) || defined(__x86_64__)
 #define ROTR(a, n) ({ SHA_LONG64 ret;             \
                                 asm ("rorq %1,%0"       \
@@ -445,6 +405,11 @@ static const SHA_LONG64 K512[80] = {
                         asm ("rev8 %0, %1"  \
                         : "=r"(ret)         \
                         : "r"(x)); ret; })
+#elif defined(__e2k__)
+#include <x86gprintrin.h>
+#define PULL64(x) __builtin_bswap64(x)
+#define ROTR(x, s) ((s) > 48 ? __rolq((x), 64 - (s)) \
+                             : __rorq((x), (s)))
 #endif
 #if defined(__riscv_zknh) && __riscv_xlen == 32
 #define Sigma0(x) ({ SHA_LONG64 ret; unsigned int *r = (unsigned int *)(&(ret));    \
@@ -527,6 +492,9 @@ static const SHA_LONG64 K512[80] = {
                         asm (".insn r4 0x33, 1, 0x3, %0, %2, %1, %3"\
                         : "=r"(ret)                                 \
                         : "r"(x^z), "r"(y), "r"(x)); ret; })
+#elif defined(__e2k__) && __iset__ >= 5
+#define sigma0(x) (__builtin_e2k_plog(0x96, ROTR((x), 1), ROTR((x), 8), ((x) >> 7)))
+#define sigma1(x) (__builtin_e2k_plog(0x96, ROTR((x), 19), ROTR((x), 61), ((x) >> 6)))
 #endif
 #elif defined(_MSC_VER)
 #if defined(_WIN64) /* applies to both IA-64 and AMD64 */
diff --git a/deps/openssl/openssl/crypto/sha/sha_local.h b/deps/openssl/openssl/crypto/sha/sha_local.h
index 3879c57526c..afe6df66d46 100644
--- a/deps/openssl/openssl/crypto/sha/sha_local.h
+++ b/deps/openssl/openssl/crypto/sha/sha_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_SHA_SHA_LOCAL_H)
+#define OSSL_LIBCRYPTO_SHA_SHA_LOCAL_H
+
 #include <stdlib.h>
 #include <string.h>

@@ -34,7 +37,8 @@
         (void)HOST_l2c(ll, (s)); \
     } while (0)

-#define HASH_UPDATE SHA1_Update
+#define HASH_UPDATE_THUNK
+#define HASH_UPDATE SHA1_Update_thunk
 #define HASH_TRANSFORM SHA1_Transform
 #define HASH_FINAL SHA1_Final
 #define HASH_INIT SHA1_Init
@@ -48,7 +52,15 @@ static void sha1_block_data_order(SHA_CTX *c, const void *p, size_t num);
 void sha1_block_data_order(SHA_CTX *c, const void *p, size_t num);
 #endif

-#include "crypto/md32_common.h"
+/* clang-format off */
+#include "crypto/md32_common.inc"
+/* clang-format on */
+#undef HASH_UPDATE_THUNK
+
+int SHA1_Update(SHA_CTX *c, const void *data, size_t len)
+{
+    return SHA1_Update_thunk((void *)c, (const unsigned char *)data, len);
+}

 #define INIT_DATA_h0 0x67452301UL
 #define INIT_DATA_h1 0xefcdab89UL
@@ -431,3 +443,5 @@ static void HASH_BLOCK_DATA_ORDER(SHA_CTX *c, const void *p, size_t num)
 #endif

 #endif
+
+#endif /* !defined(OSSL_LIBCRYPTO_SHA_SHA_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/sha/sha_loongarch.c b/deps/openssl/openssl/crypto/sha/sha_loongarch.c
new file mode 100644
index 00000000000..f04eb5aa515
--- /dev/null
+++ b/deps/openssl/openssl/crypto/sha/sha_loongarch.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <openssl/opensslconf.h>
+#include <openssl/sha.h>
+#include "arch/loongarch_arch.h"
+
+void sha256_block_data_order_la64v100(void *ctx, const void *in, size_t num);
+void sha256_block_data_order_lsx(void *ctx, const void *in, size_t num);
+void sha256_block_data_order(void *ctx, const void *in, size_t num);
+
+void sha256_block_data_order(void *ctx, const void *in, size_t num)
+{
+    if (OPENSSL_loongarch_hwcap_P & LOONGARCH_HWCAP_LSX) {
+        sha256_block_data_order_lsx(ctx, in, num);
+    } else {
+        sha256_block_data_order_la64v100(ctx, in, num);
+    }
+}
+
+void sha512_block_data_order_la64v100(void *ctx, const void *in, size_t num);
+void sha512_block_data_order_lsx(void *ctx, const void *in, size_t num);
+void sha512_block_data_order(void *ctx, const void *in, size_t num);
+
+void sha512_block_data_order(void *ctx, const void *in, size_t num)
+{
+    if (OPENSSL_loongarch_hwcap_P & LOONGARCH_HWCAP_LSX) {
+        sha512_block_data_order_lsx(ctx, in, num);
+    } else {
+        sha512_block_data_order_la64v100(ctx, in, num);
+    }
+}
diff --git a/deps/openssl/openssl/crypto/sha/sha_ppc.c b/deps/openssl/openssl/crypto/sha/sha_ppc.c
index 9853a2321ad..46372de183f 100644
--- a/deps/openssl/openssl/crypto/sha/sha_ppc.c
+++ b/deps/openssl/openssl/crypto/sha/sha_ppc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2009-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,7 +12,7 @@

 #include <openssl/opensslconf.h>
 #include <openssl/sha.h>
-#include "crypto/ppc_arch.h"
+#include "arch/ppc_arch.h"

 void sha256_block_p8(void *ctx, const void *inp, size_t len);
 void sha256_block_ppc(void *ctx, const void *inp, size_t len);
diff --git a/deps/openssl/openssl/crypto/sha/sha_riscv.c b/deps/openssl/openssl/crypto/sha/sha_riscv.c
index dad1b118767..f2e17a3e5e9 100644
--- a/deps/openssl/openssl/crypto/sha/sha_riscv.c
+++ b/deps/openssl/openssl/crypto/sha/sha_riscv.c
@@ -12,23 +12,27 @@

 #include <openssl/opensslconf.h>
 #include <openssl/sha.h>
-#include "crypto/riscv_arch.h"
+#include "arch/riscv_arch.h"

 void sha256_block_data_order_zvkb_zvknha_or_zvknhb(void *ctx, const void *in,
     size_t num);
-void sha256_block_data_order_c(void *ctx, const void *in, size_t num);
+void sha256_block_data_order_zbb(void *ctx, const void *in, size_t num);
+void sha256_block_data_order_riscv64(void *ctx, const void *in, size_t num);
 void sha256_block_data_order(void *ctx, const void *in, size_t num);

 void sha256_block_data_order(void *ctx, const void *in, size_t num)
 {
     if (RISCV_HAS_ZVKB() && (RISCV_HAS_ZVKNHA() || RISCV_HAS_ZVKNHB()) && riscv_vlen() >= 128) {
         sha256_block_data_order_zvkb_zvknha_or_zvknhb(ctx, in, num);
+    } else if (RISCV_HAS_ZBB()) {
+        sha256_block_data_order_zbb(ctx, in, num);
     } else {
-        sha256_block_data_order_c(ctx, in, num);
+        sha256_block_data_order_riscv64(ctx, in, num);
     }
 }

 void sha512_block_data_order_zvkb_zvknhb(void *ctx, const void *in, size_t num);
+void sha512_block_data_order_zbb(void *ctx, const void *in, size_t num);
 void sha512_block_data_order_c(void *ctx, const void *in, size_t num);
 void sha512_block_data_order(void *ctx, const void *in, size_t num);

@@ -36,6 +40,8 @@ void sha512_block_data_order(void *ctx, const void *in, size_t num)
 {
     if (RISCV_HAS_ZVKB_AND_ZVKNHB() && riscv_vlen() >= 128) {
         sha512_block_data_order_zvkb_zvknhb(ctx, in, num);
+    } else if (RISCV_HAS_ZBB()) {
+        sha512_block_data_order_zbb(ctx, in, num);
     } else {
         sha512_block_data_order_c(ctx, in, num);
     }
diff --git a/deps/openssl/openssl/crypto/siphash/siphash.c b/deps/openssl/openssl/crypto/siphash/siphash.c
index da978db094a..0b50d8b69fa 100644
--- a/deps/openssl/openssl/crypto/siphash/siphash.c
+++ b/deps/openssl/openssl/crypto/siphash/siphash.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -92,12 +92,12 @@ int SipHash_set_hash_size(SIPHASH *ctx, size_t hash_size)
      */

     /* Start by adjusting the stored size, to make things easier */
-    ctx->hash_size = siphash_adjust_hash_size(ctx->hash_size);
+    ctx->hash_size = (unsigned int)siphash_adjust_hash_size(ctx->hash_size);

     /* Now, adjust ctx->v1 if the old and the new size differ */
     if ((size_t)ctx->hash_size != hash_size) {
         ctx->v1 ^= 0xee;
-        ctx->hash_size = hash_size;
+        ctx->hash_size = (unsigned int)hash_size;
     }
     return 1;
 }
@@ -109,7 +109,7 @@ int SipHash_Init(SIPHASH *ctx, const unsigned char *k, int crounds, int drounds)
     uint64_t k1 = U8TO64_LE(k + 8);

     /* If the hash size wasn't set, i.e. is zero */
-    ctx->hash_size = siphash_adjust_hash_size(ctx->hash_size);
+    ctx->hash_size = (unsigned int)siphash_adjust_hash_size(ctx->hash_size);

     if (drounds == 0)
         drounds = SIPHASH_D_ROUNDS;
@@ -153,7 +153,7 @@ void SipHash_Update(SIPHASH *ctx, const unsigned char *in, size_t inlen)
         /* not enough to fill leavings */
         if (inlen < available) {
             memcpy(&ctx->leavings[ctx->len], in, inlen);
-            ctx->len += inlen;
+            ctx->len += (unsigned int)inlen;
             return;
         }

diff --git a/deps/openssl/openssl/crypto/sleep.c b/deps/openssl/openssl/crypto/sleep.c
index 9273995be68..fbe9450bb60 100644
--- a/deps/openssl/openssl/crypto/sleep.c
+++ b/deps/openssl/openssl/crypto/sleep.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -67,7 +67,6 @@ static void ossl_sleep_millis(uint64_t millis)

 #endif
 #elif defined(_WIN32) && !defined(OPENSSL_SYS_UEFI)
-#include <windows.h>

 static void ossl_sleep_millis(uint64_t millis)
 {
diff --git a/deps/openssl/openssl/crypto/slh_dsa/slh_adrs.h b/deps/openssl/openssl/crypto/slh_dsa/slh_adrs.h
index 556d0ad2863..d41f3962086 100644
--- a/deps/openssl/openssl/crypto/slh_dsa/slh_adrs.h
+++ b/deps/openssl/openssl/crypto/slh_dsa/slh_adrs.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_ADRS_H)
+#define OSSL_LIBCRYPTO_SLH_DSA_SLH_ADRS_H
+
 #include <openssl/e_os2.h>

 /*
@@ -69,3 +72,5 @@ typedef struct slh_adrs_func_st {
 } SLH_ADRS_FUNC;

 const SLH_ADRS_FUNC *ossl_slh_get_adrs_fn(int is_compressed);
+
+#endif /* !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_ADRS_H) */
diff --git a/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_hash_ctx.c b/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_hash_ctx.c
index 513f7f7dafc..f13c40e81ce 100644
--- a/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_hash_ctx.c
+++ b/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_hash_ctx.c
@@ -11,6 +11,8 @@
 #include "slh_dsa_local.h"
 #include "slh_dsa_key.h"
 #include <openssl/evp.h>
+#include <openssl/sha.h>
+#include "crypto/evp.h"

 /**
  * @brief Create a SLH_DSA_HASH_CTX that contains parameters, functions, and
@@ -31,23 +33,10 @@ SLH_DSA_HASH_CTX *ossl_slh_dsa_hash_ctx_new(const SLH_DSA_KEY *key)
         return NULL;

     ret->key = key;
-    ret->md_ctx = EVP_MD_CTX_new();
-    if (ret->md_ctx == NULL)
+    if (key->pub != NULL
+        && !ossl_slh_dsa_hash_ctx_prehash_pk_seed(ret, SLH_DSA_PK_SEED(key), key->params->n))
         goto err;
-    if (EVP_DigestInit_ex2(ret->md_ctx, key->md, NULL) != 1)
-        goto err;
-    if (key->md_big != NULL) {
-        /* Gets here for SHA2 algorithms */
-        if (key->md_big == key->md) {
-            ret->md_big_ctx = ret->md_ctx;
-        } else {
-            /* Only gets here for SHA2 */
-            ret->md_big_ctx = EVP_MD_CTX_new();
-            if (ret->md_big_ctx == NULL)
-                goto err;
-            if (EVP_DigestInit_ex2(ret->md_big_ctx, key->md_big, NULL) != 1)
-                goto err;
-        }
+    if (!key->params->is_shake) {
         if (key->hmac != NULL) {
             ret->hmac_ctx = EVP_MAC_CTX_new(key->hmac);
             if (ret->hmac_ctx == NULL)
@@ -76,17 +65,8 @@ SLH_DSA_HASH_CTX *ossl_slh_dsa_hash_ctx_dup(const SLH_DSA_HASH_CTX *src)
     /* Note that the key is not ref counted, since it does not own the key */
     ret->key = src->key;

-    if (src->md_ctx != NULL
-        && (ret->md_ctx = EVP_MD_CTX_dup(src->md_ctx)) == NULL)
+    if (!src->key->hash_func->prehash_dup(ret, src))
         goto err;
-    if (src->md_big_ctx != NULL) {
-        if (src->md_big_ctx != src->md_ctx) {
-            if ((ret->md_big_ctx = EVP_MD_CTX_dup(src->md_big_ctx)) == NULL)
-                goto err;
-        } else {
-            ret->md_big_ctx = ret->md_ctx;
-        }
-    }
     if (src->hmac_ctx != NULL
         && (ret->hmac_ctx = EVP_MAC_CTX_dup(src->hmac_ctx)) == NULL)
         goto err;
@@ -96,6 +76,19 @@ err:
     return NULL;
 }

+/**
+ * @brief Cache the pk seed.
+ * SLH_DSA performs a large number of hash operations that consist of either
+ *  SHAKE256(PK.seed || .. ) OR
+ *  SHA256(PK.seed || toByte(0, 64 - n) || ...)
+ * So cache this value and reuse it as the starting point for many hash functions.
+ */
+int ossl_slh_dsa_hash_ctx_prehash_pk_seed(SLH_DSA_HASH_CTX *ctx,
+    const uint8_t *pkseed, size_t n)
+{
+    return ctx->key->hash_func->prehash_pk_seed(ctx, pkseed, n);
+}
+
 /**
  * @brief Destroy a SLH_DSA_HASH_CTX
  *
@@ -105,10 +98,9 @@ void ossl_slh_dsa_hash_ctx_free(SLH_DSA_HASH_CTX *ctx)
 {
     if (ctx == NULL)
         return;
-    EVP_MD_CTX_free(ctx->md_ctx);
-    if (ctx->md_big_ctx != ctx->md_ctx)
-        EVP_MD_CTX_free(ctx->md_big_ctx);
+    OPENSSL_clear_free(ctx->shactx, ctx->shactx_len);
+    OPENSSL_clear_free(ctx->shactx_pkseed, ctx->shactx_len);
+    OPENSSL_clear_free(ctx->scratch, ctx->scratch_len);
     EVP_MAC_CTX_free(ctx->hmac_ctx);
-    /* Erases the |scratch| hash intermediates */
-    OPENSSL_clear_free(ctx, sizeof(*ctx));
+    OPENSSL_free(ctx);
 }
diff --git a/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_key.c b/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_key.c
index 9e980bf1bfb..7fec917aa9c 100644
--- a/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_key.c
+++ b/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_key.c
@@ -23,12 +23,11 @@ static int slh_dsa_compute_pk_root(SLH_DSA_HASH_CTX *ctx, SLH_DSA_KEY *out, int
 static void slh_dsa_key_hash_cleanup(SLH_DSA_KEY *key)
 {
     OPENSSL_free(key->propq);
-    if (key->md_big != key->md)
-        EVP_MD_free(key->md_big);
-    key->md_big = NULL;
+    EVP_MD_free(key->md_sha512);
     EVP_MD_free(key->md);
     EVP_MAC_free(key->hmac);
     key->md = NULL;
+    key->md_sha512 = NULL;
 }

 static int slh_dsa_key_hash_init(SLH_DSA_KEY *key)
@@ -45,13 +44,10 @@ static int slh_dsa_key_hash_init(SLH_DSA_KEY *key)
      * SHAKE algorithm(s) use SHAKE for all functions.
      */
     if (is_shake == 0) {
-        if (security_category == 1) {
-            /* For category 1 SHA2-256 is used for all hash operations */
-            key->md_big = key->md;
-        } else {
+        if (security_category != 1) {
             /* Security categories 3 & 5 also need SHA-512 */
-            key->md_big = EVP_MD_fetch(key->libctx, "SHA2-512", key->propq);
-            if (key->md_big == NULL)
+            key->md_sha512 = EVP_MD_fetch(key->libctx, "SHA2-512", key->propq);
+            if (key->md_sha512 == NULL)
                 goto err;
         }
         key->hmac = EVP_MAC_fetch(key->libctx, "HMAC", key->propq);
@@ -59,7 +55,7 @@ static int slh_dsa_key_hash_init(SLH_DSA_KEY *key)
             goto err;
     }
     key->adrs_func = ossl_slh_get_adrs_fn(is_shake == 0);
-    key->hash_func = ossl_slh_get_hash_fn(is_shake);
+    key->hash_func = ossl_slh_get_hash_fn(is_shake, security_category);
     return 1;
 err:
     return 0;
@@ -67,8 +63,8 @@ err:

 static void slh_dsa_key_hash_dup(SLH_DSA_KEY *dst, const SLH_DSA_KEY *src)
 {
-    if (src->md_big != NULL && src->md_big != src->md)
-        EVP_MD_up_ref(src->md_big);
+    if (src->md_sha512 != NULL)
+        EVP_MD_up_ref(src->md_sha512);
     if (src->md != NULL)
         EVP_MD_up_ref(src->md);
     if (src->hmac != NULL)
@@ -264,11 +260,11 @@ void ossl_slh_dsa_key_reset(SLH_DSA_KEY *key)
  *                        if it exists.
  * @returns 1 on success, or 0 on failure.
  */
-int ossl_slh_dsa_key_fromdata(SLH_DSA_KEY *key, const OSSL_PARAM params[],
+int ossl_slh_dsa_key_fromdata(SLH_DSA_KEY *key, const OSSL_PARAM *param_pub,
+    const OSSL_PARAM *param_priv,
     int include_private)
 {
     size_t priv_len, key_len, data_len = 0;
-    const OSSL_PARAM *param_priv = NULL, *param_pub = NULL;
     void *p;

     if (key == NULL)
@@ -281,7 +277,6 @@ int ossl_slh_dsa_key_fromdata(SLH_DSA_KEY *key, const OSSL_PARAM params[],

     /* Private key is optional */
     if (include_private) {
-        param_priv = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY);
         if (param_priv != NULL) {
             p = key->priv;
             if (!OSSL_PARAM_get_octet_string(param_priv, &p, priv_len, &data_len))
@@ -305,7 +300,6 @@ int ossl_slh_dsa_key_fromdata(SLH_DSA_KEY *key, const OSSL_PARAM params[],
      * the public key, (Keygen must be used for this case currently).
      */
     p = SLH_DSA_PUB(key);
-    param_pub = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PUB_KEY);
     if (param_pub == NULL
         || !OSSL_PARAM_get_octet_string(param_pub, &p, key_len, &data_len)
         || data_len != key_len)
@@ -389,7 +383,9 @@ int ossl_slh_dsa_generate_key(SLH_DSA_HASH_CTX *ctx, SLH_DSA_KEY *out,
             || RAND_bytes_ex(lib_ctx, pub, pk_seed_len, 0) <= 0)
             goto err;
     }
-    if (!slh_dsa_compute_pk_root(ctx, out, 0))
+
+    if (!ossl_slh_dsa_hash_ctx_prehash_pk_seed(ctx, pub, pk_seed_len)
+        || !slh_dsa_compute_pk_root(ctx, out, 0))
         goto err;
     out->pub = pub;
     out->has_priv = 1;
@@ -449,6 +445,11 @@ size_t ossl_slh_dsa_key_get_n(const SLH_DSA_KEY *key)
     return key->params->n;
 }

+int ossl_slh_dsa_key_get_security_category(const SLH_DSA_KEY *key)
+{
+    return key->params->security_category;
+}
+
 size_t ossl_slh_dsa_key_get_sig_len(const SLH_DSA_KEY *key)
 {
     return key->params->sig_len;
diff --git a/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_key.h b/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_key.h
index 37b7aa1b16a..6f7554a315f 100644
--- a/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_key.h
+++ b/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_key.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,8 +7,18 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_DSA_KEY_H)
+#define OSSL_LIBCRYPTO_SLH_DSA_SLH_DSA_KEY_H
+
+#include <openssl/crypto.h>
 #include <openssl/e_os2.h>

+#include "crypto/slh_dsa.h"
+
+#include "slh_params.h"
+#include "slh_adrs.h"
+#include "slh_hash.h"
+
 #define SLH_DSA_MAX_N 32
 #define SLH_DSA_SK_SEED(key) ((key)->priv)
 #define SLH_DSA_SK_PRF(key) ((key)->priv + (key)->params->n)
@@ -44,7 +54,9 @@ struct slh_dsa_key_st {
     const SLH_HASH_FUNC *hash_func;
     /* See FIPS 205 Section 11.1 */

-    EVP_MD *md; /* Used for SHAKE and SHA-256 */
-    EVP_MD *md_big; /* Used for SHA-256 or SHA-512 */
+    EVP_MD *md; /* Used for general SHAKE and SHA-256 hashes */
+    EVP_MD *md_sha512; /* Used for SHA-512 hashes */
     EVP_MAC *hmac;
 };
+
+#endif /* !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_DSA_KEY_H) */
diff --git a/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_local.h b/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_local.h
index d2eccdd08a9..df024dfbc5f 100644
--- a/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_local.h
+++ b/deps/openssl/openssl/crypto/slh_dsa/slh_dsa_local.h
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_DSA_LOCAL_H)
+#define OSSL_LIBCRYPTO_SLH_DSA_SLH_DSA_LOCAL_H
+
 #include "crypto/slh_dsa.h"
 #include "slh_hash.h"
 #include "slh_params.h"
@@ -45,24 +48,22 @@
  * NOTE: Any changes to this structure will need updating in
  * ossl_slh_dsa_hash_ctx_dup().
  */
-/* A SHA-512 digest plus two |n| byte node values */
-#define SLH_DSA_HASH_SCRATCH_LEN (64 + 2 * SLH_MAX_N)
-
 struct slh_dsa_hash_ctx_st {
     const SLH_DSA_KEY *key; /* This key is not owned by this object */
-    EVP_MD_CTX *md_ctx; /* Either SHAKE OR SHA-256 */
-    EVP_MD_CTX *md_big_ctx; /* Either SHA-512 or points to |md_ctx| for SHA-256*/
-    EVP_MAC_CTX *hmac_ctx; /* required by SHA algorithms for PRFmsg() */
-    int hmac_digest_used; /* Used for lazy init of hmac_ctx digest */
+    void *shactx; /* A low level SHAKE object */
+    void *shactx_pkseed; /* A low level SHAKE or SHA256 object with PK.seed hashed in it */
+    size_t shactx_len; /* The size of the two hash contexts above */
     /*
-     * Working storage for the SHA2 hash function intermediates, used in
-     * place of local stack copies, so that potentially sensitive
-     * intermediate data lives in one place and is erased when this object
-     * is freed (FIPS 205 section 3.1).  The SHAKE hash functions write
-     * their output directly to the caller's buffer and need no scratch.
-     * Not used concurrently.
+     * A working hash context used by the hash functions in place of local
+     * stack copies, so that intermediate hash states derived from secrets
+     * live in one place and are erased when this object is freed.  It is
+     * also used for the one-shot SHA-512 contexts of the security category
+     * 3 and 5 SHA2 parameter sets.  Not used concurrently.
      */
-    uint8_t scratch[SLH_DSA_HASH_SCRATCH_LEN];
+    void *scratch;
+    size_t scratch_len;
+    EVP_MAC_CTX *hmac_ctx; /* required by SHA algorithms for PRFmsg() */
+    int hmac_digest_used; /* Used for lazy init of hmac_ctx digest */
 };

 __owur int ossl_slh_wots_pk_gen(SLH_DSA_HASH_CTX *ctx, const uint8_t *sk_seed,
@@ -75,11 +76,11 @@ __owur int ossl_slh_wots_pk_from_sig(SLH_DSA_HASH_CTX *ctx,
     PACKET *sig_rpkt, const uint8_t *msg,
     const uint8_t *pk_seed, uint8_t *adrs,
     uint8_t *pk_out, size_t pk_out_len);
-
 __owur int ossl_slh_xmss_node(SLH_DSA_HASH_CTX *ctx, const uint8_t *sk_seed,
     uint32_t node_id, uint32_t height,
     const uint8_t *pk_seed, uint8_t *adrs,
     uint8_t *pk_out, size_t pk_out_len);
+
 __owur int ossl_slh_xmss_sign(SLH_DSA_HASH_CTX *ctx, const uint8_t *msg,
     const uint8_t *sk_seed, uint32_t node_id,
     const uint8_t *pk_seed, uint8_t *adrs,
@@ -105,3 +106,5 @@ __owur int ossl_slh_fors_pk_from_sig(SLH_DSA_HASH_CTX *ctx, PACKET *sig_rpkt,
     const uint8_t *md, const uint8_t *pk_seed,
     uint8_t *adrs,
     uint8_t *pk_out, size_t pk_out_len);
+
+#endif /* !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_DSA_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/slh_dsa/slh_fors.c b/deps/openssl/openssl/crypto/slh_dsa/slh_fors.c
index 7c8854cc9b3..305a172dc33 100644
--- a/deps/openssl/openssl/crypto/slh_dsa/slh_fors.c
+++ b/deps/openssl/openssl/crypto/slh_dsa/slh_fors.c
@@ -157,7 +157,7 @@ int ossl_slh_fors_sign(SLH_DSA_HASH_CTX *ctx, const uint8_t *md,
         /*
          * Give each of the k trees a unique range at each level.
          * e.g. If we have 4096 leaf nodes (2^a = 2^12) for each tree
-         * tree i will use indexes from 4096 * i + (0..4095) for its bottom level.
+         * i will use indexes from 4096 * i + (0..4095) for its bottom level.
          * For the next level up from the bottom there would be 2048 nodes
          * (so tree i uses indexes 2048 * i + (0...2047) for this level)
          */
diff --git a/deps/openssl/openssl/crypto/slh_dsa/slh_hash.c b/deps/openssl/openssl/crypto/slh_dsa/slh_hash.c
index b0023c955c3..d8d4a9e9690 100644
--- a/deps/openssl/openssl/crypto/slh_dsa/slh_hash.c
+++ b/deps/openssl/openssl/crypto/slh_dsa/slh_hash.c
@@ -16,160 +16,187 @@
 #include "slh_dsa_local.h"
 #include "slh_dsa_key.h"

+#include "openssl/sha.h"
+#include "internal/sha3.h"
+#include "crypto/evp.h"
+#include "crypto/sha.h"
+
 #define MAX_DIGEST_SIZE 64 /* SHA-512 is used for security category 3 & 5 */
+#define NIBBLE_MASK 15

-static OSSL_SLH_HASHFUNC_H_MSG slh_hmsg_sha2;
-static OSSL_SLH_HASHFUNC_PRF slh_prf_sha2;
-static OSSL_SLH_HASHFUNC_PRF_MSG slh_prf_msg_sha2;
-static OSSL_SLH_HASHFUNC_F slh_f_sha2;
-static OSSL_SLH_HASHFUNC_H slh_h_sha2;
-static OSSL_SLH_HASHFUNC_T slh_t_sha2;
+/* Most hash functions in SLH-DSA truncate the output */
+#define sha256_final(ctx, out, outlen)    \
+    (ctx)->md_len = (unsigned int)outlen; \
+    SHA256_Final(out, ctx)

-static OSSL_SLH_HASHFUNC_H_MSG slh_hmsg_shake;
+#define sha512_final(ctx, out, outlen)    \
+    (ctx)->md_len = (unsigned int)outlen; \
+    SHA512_Final(out, ctx)
+
+static OSSL_SLH_HASHFUNC_PRF slh_prf_sha256;
 static OSSL_SLH_HASHFUNC_PRF slh_prf_shake;
-static OSSL_SLH_HASHFUNC_PRF_MSG slh_prf_msg_shake;
+
+static OSSL_SLH_HASHFUNC_F slh_f_sha256;
 static OSSL_SLH_HASHFUNC_F slh_f_shake;
-static OSSL_SLH_HASHFUNC_H slh_h_shake;
-static OSSL_SLH_HASHFUNC_T slh_t_shake;

-static ossl_inline int xof_digest_3(EVP_MD_CTX *ctx,
-    const uint8_t *in1, size_t in1_len,
-    const uint8_t *in2, size_t in2_len,
-    const uint8_t *in3, size_t in3_len,
-    uint8_t *out, size_t out_len)
-{
-    return (EVP_DigestInit_ex2(ctx, NULL, NULL) == 1
-        && EVP_DigestUpdate(ctx, in1, in1_len) == 1
-        && EVP_DigestUpdate(ctx, in2, in2_len) == 1
-        && EVP_DigestUpdate(ctx, in3, in3_len) == 1
-        && EVP_DigestFinalXOF(ctx, out, out_len) == 1);
-}
+static OSSL_SLH_HASHFUNC_PRF_MSG slh_prf_msg_sha2;
+static OSSL_SLH_HASHFUNC_PRF_MSG slh_prf_msg_shake;

-static ossl_inline int xof_digest_4(EVP_MD_CTX *ctx,
-    const uint8_t *in1, size_t in1_len,
-    const uint8_t *in2, size_t in2_len,
-    const uint8_t *in3, size_t in3_len,
-    const uint8_t *in4, size_t in4_len,
-    uint8_t *out, size_t out_len)
-{
-    return (EVP_DigestInit_ex2(ctx, NULL, NULL) == 1
-        && EVP_DigestUpdate(ctx, in1, in1_len) == 1
-        && EVP_DigestUpdate(ctx, in2, in2_len) == 1
-        && EVP_DigestUpdate(ctx, in3, in3_len) == 1
-        && EVP_DigestUpdate(ctx, in4, in4_len) == 1
-        && EVP_DigestFinalXOF(ctx, out, out_len) == 1);
-}
+static OSSL_SLH_HASHFUNC_H_MSG slh_hmsg_sha256;
+static OSSL_SLH_HASHFUNC_H_MSG slh_hmsg_sha512;
+static OSSL_SLH_HASHFUNC_H_MSG slh_hmsg_shake;
+
+static OSSL_SLH_HASHFUNC_H slh_h_sha256;
+static OSSL_SLH_HASHFUNC_H slh_h_sha512;
+static OSSL_SLH_HASHFUNC_H slh_h_shake;
+static OSSL_SLH_HASHFUNC_T slh_t_sha256;
+static OSSL_SLH_HASHFUNC_T slh_t_sha512;
+static OSSL_SLH_HASHFUNC_wots_pk_gen slh_wots_pk_gen_sha2;
+static OSSL_SLH_HASHFUNC_wots_pk_gen slh_wots_pk_gen_shake;
+
+static const uint8_t zeros[128] = { 0 };

 /* See FIPS 205 Section 11.1 */
 static int
-slh_hmsg_shake(SLH_DSA_HASH_CTX *ctx, const uint8_t *r,
+slh_hmsg_shake(SLH_DSA_HASH_CTX *hctx, const uint8_t *r,
     const uint8_t *pk_seed, const uint8_t *pk_root,
     const uint8_t *msg, size_t msg_len,
     uint8_t *out, size_t out_len)
 {
-    const SLH_DSA_PARAMS *params = ctx->key->params;
+    KECCAK1600_CTX *sctx = (KECCAK1600_CTX *)(hctx->shactx);
+    const SLH_DSA_PARAMS *params = hctx->key->params;
     size_t m = params->m;
     size_t n = params->n;

-    return xof_digest_4(ctx->md_ctx, r, n, pk_seed, n, pk_root, n,
-        msg, msg_len, out, m);
+    ossl_sha3_reset(sctx);
+    ossl_sha3_absorb(sctx, r, n);
+    ossl_sha3_absorb(sctx, pk_seed, n);
+    ossl_sha3_absorb(sctx, pk_root, n);
+    ossl_sha3_absorb(sctx, msg, msg_len);
+    ossl_sha3_squeeze(sctx, out, m);
+    return 1;
 }

 static int
-slh_prf_shake(SLH_DSA_HASH_CTX *ctx,
-    const uint8_t *pk_seed, const uint8_t *sk_seed,
-    const uint8_t *adrs, uint8_t *out, size_t out_len)
-{
-    const SLH_DSA_PARAMS *params = ctx->key->params;
-    size_t n = params->n;
-
-    return xof_digest_3(ctx->md_ctx, pk_seed, n, adrs, SLH_ADRS_SIZE,
-        sk_seed, n, out, n);
-}
-
-static int
-slh_prf_msg_shake(SLH_DSA_HASH_CTX *ctx, const uint8_t *sk_prf,
+slh_prf_msg_shake(SLH_DSA_HASH_CTX *hctx, const uint8_t *sk_prf,
     const uint8_t *opt_rand, const uint8_t *msg, size_t msg_len,
     WPACKET *pkt)
 {
     int ret;
     unsigned char out[SLH_MAX_N];
-    const SLH_DSA_PARAMS *params = ctx->key->params;
+    const SLH_DSA_PARAMS *params = hctx->key->params;
     size_t n = params->n;
-
-    ret = xof_digest_3(ctx->md_ctx, sk_prf, n, opt_rand, n, msg, msg_len, out, n)
-        && WPACKET_memcpy(pkt, out, n);
+    KECCAK1600_CTX *sctx = (KECCAK1600_CTX *)(hctx->shactx);
+
+    ossl_sha3_reset(sctx);
+    ossl_sha3_absorb(sctx, sk_prf, n);
+    ossl_sha3_absorb(sctx, opt_rand, n);
+    ossl_sha3_absorb(sctx, msg, msg_len);
+    ossl_sha3_squeeze(sctx, out, n);
+    ret = WPACKET_memcpy(pkt, out, n);
     OPENSSL_cleanse(out, sizeof(out));
     return ret;
 }

 static int
-slh_f_shake(SLH_DSA_HASH_CTX *ctx, const uint8_t *pk_seed, const uint8_t *adrs,
+slh_f_shake(SLH_DSA_HASH_CTX *hctx, const uint8_t *pk_seed, const uint8_t *adrs,
     const uint8_t *m1, size_t m1_len, uint8_t *out, size_t out_len)
 {
-    const SLH_DSA_PARAMS *params = ctx->key->params;
+    const SLH_DSA_PARAMS *params = hctx->key->params;
     size_t n = params->n;
+    KECCAK1600_CTX *sctx = (KECCAK1600_CTX *)(hctx->scratch);

-    return xof_digest_3(ctx->md_ctx, pk_seed, n, adrs, SLH_ADRS_SIZE, m1, m1_len, out, n);
+    *sctx = *((KECCAK1600_CTX *)(hctx->shactx_pkseed));
+    ossl_sha3_absorb(sctx, adrs, SLH_ADRS_SIZE);
+    ossl_sha3_absorb(sctx, m1, m1_len);
+    ossl_sha3_squeeze(sctx, out, n);
+    return 1;
 }

 static int
-slh_h_shake(SLH_DSA_HASH_CTX *ctx, const uint8_t *pk_seed, const uint8_t *adrs,
-    const uint8_t *m1, const uint8_t *m2, uint8_t *out, size_t out_len)
+slh_prf_shake(SLH_DSA_HASH_CTX *hctx,
+    const uint8_t *pk_seed, const uint8_t *sk_seed,
+    const uint8_t *adrs, uint8_t *out, size_t out_len)
 {
-    const SLH_DSA_PARAMS *params = ctx->key->params;
+    const SLH_DSA_PARAMS *params = hctx->key->params;
     size_t n = params->n;
+    KECCAK1600_CTX *sctx = (KECCAK1600_CTX *)(hctx->scratch);

-    return xof_digest_4(ctx->md_ctx, pk_seed, n, adrs, SLH_ADRS_SIZE, m1, n, m2, n, out, n);
+    *sctx = *((KECCAK1600_CTX *)(hctx->shactx_pkseed));
+    ossl_sha3_absorb(sctx, adrs, SLH_ADRS_SIZE);
+    ossl_sha3_absorb(sctx, sk_seed, n);
+    ossl_sha3_squeeze(sctx, out, n);
+    return 1;
 }

 static int
-slh_t_shake(SLH_DSA_HASH_CTX *ctx, const uint8_t *pk_seed, const uint8_t *adrs,
-    const uint8_t *ml, size_t ml_len, uint8_t *out, size_t out_len)
+slh_h_shake(SLH_DSA_HASH_CTX *hctx, const uint8_t *pk_seed, const uint8_t *adrs,
+    const uint8_t *m1, const uint8_t *m2, uint8_t *out, size_t out_len)
 {
-    const SLH_DSA_PARAMS *params = ctx->key->params;
+    KECCAK1600_CTX *sctx = (KECCAK1600_CTX *)(hctx->scratch);
+    const SLH_DSA_PARAMS *params = hctx->key->params;
     size_t n = params->n;

-    return xof_digest_3(ctx->md_ctx, pk_seed, n, adrs, SLH_ADRS_SIZE, ml, ml_len, out, n);
-}
-
-static ossl_inline int
-digest_4(EVP_MD_CTX *ctx,
-    const uint8_t *in1, size_t in1_len, const uint8_t *in2, size_t in2_len,
-    const uint8_t *in3, size_t in3_len, const uint8_t *in4, size_t in4_len,
-    uint8_t *out)
-{
-    return (EVP_DigestInit_ex2(ctx, NULL, NULL) == 1
-        && EVP_DigestUpdate(ctx, in1, in1_len) == 1
-        && EVP_DigestUpdate(ctx, in2, in2_len) == 1
-        && EVP_DigestUpdate(ctx, in3, in3_len) == 1
-        && EVP_DigestUpdate(ctx, in4, in4_len) == 1
-        && EVP_DigestFinal_ex(ctx, out, NULL) == 1);
+    *sctx = *((KECCAK1600_CTX *)(hctx->shactx_pkseed));
+    ossl_sha3_absorb(sctx, adrs, SLH_ADRS_SIZE);
+    ossl_sha3_absorb(sctx, m1, n);
+    ossl_sha3_absorb(sctx, m2, n);
+    ossl_sha3_squeeze(sctx, out, n);
+    return 1;
 }

 /* FIPS 205 Section 11.2.1 and 11.2.2 */

 static int
-slh_hmsg_sha2(SLH_DSA_HASH_CTX *hctx, const uint8_t *r, const uint8_t *pk_seed,
+slh_hmsg_sha256(SLH_DSA_HASH_CTX *hctx, const uint8_t *r, const uint8_t *pk_seed,
     const uint8_t *pk_root, const uint8_t *msg, size_t msg_len,
     uint8_t *out, size_t out_len)
 {
     int ret;
+    SHA256_CTX *sctx = (SHA256_CTX *)(hctx->scratch);
     const SLH_DSA_PARAMS *params = hctx->key->params;
     size_t m = params->m;
     size_t n = params->n;
-    uint8_t seed[2 * SLH_MAX_N + MAX_DIGEST_SIZE];
-    int sz = EVP_MD_get_size(hctx->key->md_big);
-    size_t seed_len = (size_t)sz + 2 * n;
+    uint8_t seed[2 * SLH_MAX_N + SHA256_DIGEST_LENGTH];
+    long seed_len = SHA256_DIGEST_LENGTH + (long)(2 * n);

-    if (sz <= 0)
-        return 0;
+    memcpy(seed, r, n);
+    memcpy(seed + n, pk_seed, n);
+
+    SHA256_Init(sctx);
+    SHA256_Update(sctx, r, n);
+    SHA256_Update(sctx, pk_seed, n);
+    SHA256_Update(sctx, pk_root, n);
+    SHA256_Update(sctx, msg, msg_len);
+    ret = SHA256_Final(seed + 2 * n, sctx)
+        && (PKCS1_MGF1(out, (long)m, seed, seed_len, hctx->key->md) == 0);
+    OPENSSL_cleanse(seed, sizeof(seed));
+    return ret;
+}
+
+static int
+slh_hmsg_sha512(SLH_DSA_HASH_CTX *hctx, const uint8_t *r, const uint8_t *pk_seed,
+    const uint8_t *pk_root, const uint8_t *msg, size_t msg_len,
+    uint8_t *out, size_t out_len)
+{
+    int ret;
+    SHA512_CTX *sctx = (SHA512_CTX *)(hctx->scratch);
+    const SLH_DSA_PARAMS *params = hctx->key->params;
+    size_t m = params->m;
+    size_t n = params->n;
+    uint8_t seed[2 * SLH_MAX_N + SHA512_DIGEST_LENGTH];
+    long seed_len = SHA512_DIGEST_LENGTH + (long)(2 * n);

     memcpy(seed, r, n);
     memcpy(seed + n, pk_seed, n);
-    ret = digest_4(hctx->md_big_ctx, r, n, pk_seed, n, pk_root, n, msg, msg_len,
-              seed + 2 * n)
-        && (PKCS1_MGF1(out, m, seed, seed_len, hctx->key->md_big) == 0);
+
+    SHA512_Init(sctx);
+    SHA512_Update(sctx, r, n);
+    SHA512_Update(sctx, pk_seed, n);
+    SHA512_Update(sctx, pk_root, n);
+    SHA512_Update(sctx, msg, msg_len);
+    ret = SHA512_Final(seed + 2 * n, sctx)
+        && (PKCS1_MGF1(out, (long)m, seed, seed_len, hctx->key->md_sha512) == 0);
     OPENSSL_cleanse(seed, sizeof(seed));
     return ret;
 }
@@ -194,10 +221,11 @@ slh_prf_msg_sha2(SLH_DSA_HASH_CTX *hctx,
      * So we do a lazy update here on the first call.
      */
     if (hctx->hmac_digest_used == 0) {
+        const char *nm = EVP_MD_get0_name(key->md_sha512 == NULL ? key->md : key->md_sha512);
+
         p = params;
         /* The underlying digest to be used */
-        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST,
-            (char *)EVP_MD_get0_name(key->md_big), 0);
+        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST, (char *)nm, 0);
         if (key->propq != NULL)
             *p++ = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_PROPERTIES,
                 (char *)key->propq, 0);
@@ -215,86 +243,318 @@ slh_prf_msg_sha2(SLH_DSA_HASH_CTX *hctx,
     return ret;
 }

-/*
- * The |digest| scratch storage in the hash context is used in place of a
- * local stack buffer, and is erased when the hash context is freed
- * (FIPS 205 section 3.1).  On the PRF path it holds a derived chain secret.
- */
-static ossl_inline int
-do_hash(SLH_DSA_HASH_CTX *hctx, EVP_MD_CTX *ctx, size_t n,
-    const uint8_t *pk_seed, const uint8_t *adrs,
-    const uint8_t *m, size_t m_len, size_t b, uint8_t *out, size_t out_len)
+static int
+slh_prf_sha256(SLH_DSA_HASH_CTX *hctx, const uint8_t *pk_seed,
+    const uint8_t *sk_seed, const uint8_t *adrs,
+    uint8_t *out, size_t out_len)
 {
-    int ret;
-    uint8_t zeros[128] = { 0 };
-    uint8_t *digest = hctx->scratch;
+    SHA256_CTX *sctx = (SHA256_CTX *)(hctx->scratch);
+    size_t n = hctx->key->params->n;

-    ret = digest_4(ctx, pk_seed, n, zeros, b - n, adrs, SLH_ADRSC_SIZE,
-        m, m_len, digest);
-    /* Truncated returned value is n = 16 bytes */
-    memcpy(out, digest, n);
-    return ret;
+    *sctx = *((SHA256_CTX *)hctx->shactx_pkseed);
+    SHA256_Update(sctx, adrs, SLH_ADRSC_SIZE);
+    SHA256_Update(sctx, sk_seed, n);
+    sha256_final(sctx, out, n);
+    return 1;
 }

 static int
-slh_prf_sha2(SLH_DSA_HASH_CTX *hctx, const uint8_t *pk_seed,
-    const uint8_t *sk_seed, const uint8_t *adrs,
-    uint8_t *out, size_t out_len)
+slh_wots_pk_gen_sha2(SLH_DSA_HASH_CTX *hctx,
+    const uint8_t *sk_seed, const uint8_t *pk_seed,
+    uint8_t *adrs, uint8_t *pk_out, size_t pk_out_len)
 {
+    int ret = 0;
     size_t n = hctx->key->params->n;
+    size_t i, j = 0, len = SLH_WOTS_LEN(n);
+    uint8_t sk[SLH_MAX_N];
+    SHA256_CTX *sctx = (SHA256_CTX *)(hctx->shactx_pkseed);
+    SHA256_CTX *ctx = (SHA256_CTX *)(hctx->scratch);
+    const SLH_ADRS_FUNC *adrsf = hctx->key->adrs_func;
+    SLH_ADRS_DECLARE(sk_adrs);
+    SLH_ADRS_FN_DECLARE(adrsf, set_chain_address);
+    SLH_ADRS_FN_DECLARE(adrsf, set_hash_address);
+
+    adrsf->copy(sk_adrs, adrs);
+    adrsf->set_type_and_clear(sk_adrs, SLH_ADRS_TYPE_WOTS_PRF);
+    adrsf->copy_keypair_address(sk_adrs, adrs);
+
+    for (i = 0; i < len; ++i) { /* len = 2n + 3 */
+        set_chain_address(sk_adrs, (uint32_t)i);
+
+        /* PRF */
+        *ctx = *sctx;
+        SHA256_Update(ctx, sk_adrs, SLH_ADRSC_SIZE);
+        SHA256_Update(ctx, sk_seed, n);
+        sha256_final(ctx, sk, n);
+
+        set_chain_address(adrs, (uint32_t)i);
+        for (j = 0; j < NIBBLE_MASK; ++j) {
+            set_hash_address(adrs, (uint32_t)j);
+            /* F */
+            *ctx = *sctx;
+            SHA256_Update(ctx, adrs, SLH_ADRSC_SIZE);
+            SHA256_Update(ctx, sk, n);
+            sha256_final(ctx, sk, n);
+        }
+        memcpy(pk_out, sk, n);
+        pk_out += n;
+    }
+    ret = 1;
+    OPENSSL_cleanse(sk, sizeof(sk));
+    return ret;
+}

-    return do_hash(hctx, hctx->md_ctx, n, pk_seed, adrs, sk_seed, n,
-        OSSL_SLH_DSA_SHA2_NUM_ZEROS_H_AND_T_BOUND1, out, out_len);
+int slh_wots_pk_gen_shake(SLH_DSA_HASH_CTX *hctx,
+    const uint8_t *sk_seed, const uint8_t *pk_seed,
+    uint8_t *adrs, uint8_t *pk_out, size_t pk_out_len)
+{
+    int ret = 0;
+    size_t n = hctx->key->params->n;
+    size_t i, j = 0, len = SLH_WOTS_LEN(n);
+    uint8_t sk[SLH_MAX_N];
+    const SLH_ADRS_FUNC *adrsf = hctx->key->adrs_func;
+    SLH_ADRS_DECLARE(sk_adrs);
+    SLH_ADRS_FN_DECLARE(adrsf, set_chain_address);
+    SLH_ADRS_FN_DECLARE(adrsf, set_hash_address);
+    KECCAK1600_CTX *sctx = (KECCAK1600_CTX *)(hctx->shactx_pkseed);
+    KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)(hctx->scratch);
+
+    adrsf->copy(sk_adrs, adrs);
+    adrsf->set_type_and_clear(sk_adrs, SLH_ADRS_TYPE_WOTS_PRF);
+    adrsf->copy_keypair_address(sk_adrs, adrs);
+
+    for (i = 0; i < len; ++i) { /* len = 2n + 3 */
+        set_chain_address(sk_adrs, (uint32_t)i);
+
+        /* PRF */
+        *ctx = *sctx;
+        ossl_sha3_absorb(ctx, sk_adrs, SLH_ADRS_SIZE);
+        ossl_sha3_absorb(ctx, sk_seed, n);
+        ossl_sha3_squeeze(ctx, sk, n);
+
+        set_chain_address(adrs, (uint32_t)i);
+        for (j = 0; j < NIBBLE_MASK; ++j) {
+            set_hash_address(adrs, (uint32_t)j);
+            /* F */
+            *ctx = *sctx;
+            ossl_sha3_absorb(ctx, adrs, SLH_ADRS_SIZE);
+            ossl_sha3_absorb(ctx, sk, n);
+            ossl_sha3_squeeze(ctx, sk, n);
+        }
+        memcpy(pk_out, sk, n);
+        pk_out += n;
+    }
+    ret = 1;
+    OPENSSL_cleanse(sk, sizeof(sk));
+    return ret;
 }

 static int
-slh_f_sha2(SLH_DSA_HASH_CTX *hctx, const uint8_t *pk_seed, const uint8_t *adrs,
+slh_f_sha256(SLH_DSA_HASH_CTX *hctx, const uint8_t *pk_seed, const uint8_t *adrs,
     const uint8_t *m1, size_t m1_len, uint8_t *out, size_t out_len)
 {
-    return do_hash(hctx, hctx->md_ctx, hctx->key->params->n, pk_seed, adrs,
-        m1, m1_len, OSSL_SLH_DSA_SHA2_NUM_ZEROS_H_AND_T_BOUND1, out, out_len);
+    SHA256_CTX *sctx = (SHA256_CTX *)(hctx->scratch);
+
+    *sctx = *((SHA256_CTX *)hctx->shactx_pkseed);
+    SHA256_Update(sctx, adrs, SLH_ADRSC_SIZE);
+    SHA256_Update(sctx, m1, m1_len);
+    sha256_final(sctx, out, hctx->key->params->n);
+    return 1;
 }

 static int
-slh_h_sha2(SLH_DSA_HASH_CTX *hctx, const uint8_t *pk_seed, const uint8_t *adrs,
+slh_h_sha256(SLH_DSA_HASH_CTX *hctx, const uint8_t *pk_seed, const uint8_t *adrs,
     const uint8_t *m1, const uint8_t *m2, uint8_t *out, size_t out_len)
 {
-    /* The concatenated children go in the scratch after the digest */
-    uint8_t *m = hctx->scratch + MAX_DIGEST_SIZE;
+    SHA256_CTX *sctx = (SHA256_CTX *)(hctx->scratch);
     const SLH_DSA_PARAMS *prms = hctx->key->params;
     size_t n = prms->n;

-    memcpy(m, m1, n);
-    memcpy(m + n, m2, n);
-    return do_hash(hctx, hctx->md_big_ctx, n, pk_seed, adrs, m, 2 * n,
-        prms->sha2_h_and_t_bound, out, out_len);
+    *sctx = *((SHA256_CTX *)hctx->shactx_pkseed);
+    SHA256_Update(sctx, adrs, SLH_ADRSC_SIZE);
+    SHA256_Update(sctx, m1, n);
+    SHA256_Update(sctx, m2, n);
+    sha256_final(sctx, out, n);
+    return 1;
+}
+
+static int
+slh_h_sha512(SLH_DSA_HASH_CTX *hctx, const uint8_t *pk_seed, const uint8_t *adrs,
+    const uint8_t *m1, const uint8_t *m2, uint8_t *out, size_t out_len)
+{
+    SHA512_CTX *sctx = (SHA512_CTX *)(hctx->scratch);
+    const SLH_DSA_PARAMS *prms = hctx->key->params;
+    size_t n = prms->n;
+
+    SHA512_Init(sctx);
+    SHA512_Update(sctx, pk_seed, n);
+    SHA512_Update(sctx, zeros, 128 - n);
+    SHA512_Update(sctx, adrs, SLH_ADRSC_SIZE);
+    SHA512_Update(sctx, m1, n);
+    SHA512_Update(sctx, m2, n);
+    sha512_final(sctx, out, n);
+    return 1;
+}
+
+static int
+slh_t_sha256(SLH_DSA_HASH_CTX *hctx, const uint8_t *pk_seed, const uint8_t *adrs,
+    const uint8_t *ml, size_t ml_len, uint8_t *out, size_t out_len)
+{
+    SHA256_CTX *sctx = (SHA256_CTX *)(hctx->scratch);
+
+    *sctx = *((SHA256_CTX *)hctx->shactx_pkseed);
+    SHA256_Update(sctx, adrs, SLH_ADRSC_SIZE);
+    SHA256_Update(sctx, ml, ml_len);
+    sha256_final(sctx, out, hctx->key->params->n);
+    return 1;
 }

 static int
-slh_t_sha2(SLH_DSA_HASH_CTX *hctx, const uint8_t *pk_seed, const uint8_t *adrs,
+slh_t_sha512(SLH_DSA_HASH_CTX *hctx, const uint8_t *pk_seed, const uint8_t *adrs,
     const uint8_t *ml, size_t ml_len, uint8_t *out, size_t out_len)
 {
+    SHA512_CTX *sctx = (SHA512_CTX *)(hctx->scratch);
     const SLH_DSA_PARAMS *prms = hctx->key->params;
+    size_t n = prms->n;
+
+    SHA512_Init(sctx);
+    SHA512_Update(sctx, pk_seed, n);
+    SHA512_Update(sctx, zeros, 128 - n);
+    SHA512_Update(sctx, adrs, SLH_ADRSC_SIZE);
+    SHA512_Update(sctx, ml, ml_len);
+    sha512_final(sctx, out, hctx->key->params->n);
+    return 1;
+}
+
+static int slh_hash_shake_precache(SLH_DSA_HASH_CTX *hctx, const uint8_t *pkseed, size_t n)
+{
+    KECCAK1600_CTX *ctx = NULL, *seedctx = NULL, *scratch = NULL;
+
+    ctx = ossl_shake256_new();
+    if (ctx == NULL)
+        return 0;
+    seedctx = OPENSSL_memdup(ctx, sizeof(*ctx));
+    scratch = OPENSSL_malloc(sizeof(*scratch));
+    if (seedctx == NULL || scratch == NULL) {
+        OPENSSL_free(ctx);
+        OPENSSL_free(seedctx);
+        OPENSSL_free(scratch);
+        return 0;
+    }
+    ossl_sha3_absorb(seedctx, pkseed, n);
+    hctx->shactx = (void *)ctx;
+    hctx->shactx_pkseed = (void *)seedctx;
+    hctx->shactx_len = sizeof(*ctx);
+    hctx->scratch = (void *)scratch;
+    hctx->scratch_len = sizeof(*scratch);
+    return 1;
+}
+
+static int slh_hash_shake_dup(SLH_DSA_HASH_CTX *dst, const SLH_DSA_HASH_CTX *src)
+{
+    if (src->shactx != NULL) {
+        dst->shactx = OPENSSL_memdup(src->shactx, sizeof(KECCAK1600_CTX));
+        if (dst->shactx == NULL)
+            return 0;
+    }
+    if (src->shactx_pkseed != NULL) {
+        dst->shactx_pkseed = OPENSSL_memdup(src->shactx_pkseed, sizeof(KECCAK1600_CTX));
+        if (dst->shactx_pkseed == NULL) {
+            OPENSSL_free(dst->shactx);
+            dst->shactx = NULL;
+            return 0;
+        }
+    }
+    dst->shactx_len = src->shactx_len;
+    /* A prehashed context needs a scratch context, its content is transient */
+    if (dst->shactx_pkseed != NULL) {
+        dst->scratch = OPENSSL_malloc(sizeof(KECCAK1600_CTX));
+        if (dst->scratch == NULL)
+            return 0;
+        dst->scratch_len = sizeof(KECCAK1600_CTX);
+    } else {
+        dst->scratch = NULL;
+        dst->scratch_len = 0;
+    }
+    return 1;
+}
+
+static int slh_hash_sha256_precache(SLH_DSA_HASH_CTX *hctx, const uint8_t *pkseed, size_t n)
+{
+    SHA256_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
+    /* The scratch context is also used as a SHA512_CTX by category 3 and 5 */
+    size_t scratch_len = sizeof(SHA512_CTX);

-    return do_hash(hctx, hctx->md_big_ctx, prms->n, pk_seed, adrs, ml, ml_len,
-        prms->sha2_h_and_t_bound, out, out_len);
+    if (ctx == NULL)
+        return 0;
+    if ((hctx->scratch = OPENSSL_malloc(scratch_len)) == NULL) {
+        OPENSSL_free(ctx);
+        return 0;
+    }
+    hctx->scratch_len = scratch_len;
+    SHA256_Init(ctx);
+    SHA256_Update(ctx, pkseed, n);
+    SHA256_Update(ctx, zeros, 64 - n);
+    hctx->shactx_pkseed = (void *)ctx;
+    hctx->shactx_len = sizeof(*ctx);
+    return 1;
 }

-const SLH_HASH_FUNC *ossl_slh_get_hash_fn(int is_shake)
+static int slh_hash_sha256_dup(SLH_DSA_HASH_CTX *dst, const SLH_DSA_HASH_CTX *src)
+{
+    if (src->shactx_pkseed != NULL) {
+        dst->shactx_pkseed = OPENSSL_memdup(src->shactx_pkseed, sizeof(SHA256_CTX));
+        if (dst->shactx_pkseed == NULL)
+            return 0;
+    }
+    /*
+     * A prehashed context needs a scratch context, its content is transient.
+     * As in slh_hash_sha256_precache() the scratch context is sized to also
+     * serve as a SHA512_CTX for security categories 3 and 5.
+     */
+    dst->shactx_len = src->shactx_len;
+    if (dst->shactx_pkseed != NULL) {
+        dst->scratch = OPENSSL_malloc(sizeof(SHA512_CTX));
+        if (dst->scratch == NULL)
+            return 0;
+        dst->scratch_len = sizeof(SHA512_CTX);
+    } else {
+        dst->scratch = NULL;
+        dst->scratch_len = 0;
+    }
+    return 1;
+}
+
+const SLH_HASH_FUNC *ossl_slh_get_hash_fn(int is_shake, int security_category)
 {
     static const SLH_HASH_FUNC methods[] = {
-        { slh_hmsg_shake,
+        { slh_hash_shake_precache,
+            slh_hash_shake_dup,
+            slh_hmsg_shake,
             slh_prf_shake,
             slh_prf_msg_shake,
             slh_f_shake,
             slh_h_shake,
-            slh_t_shake },
-        { slh_hmsg_sha2,
-            slh_prf_sha2,
+            slh_f_shake,
+            slh_wots_pk_gen_shake },
+        { slh_hash_sha256_precache,
+            slh_hash_sha256_dup,
+            slh_hmsg_sha256,
+            slh_prf_sha256,
+            slh_prf_msg_sha2,
+            slh_f_sha256,
+            slh_h_sha256,
+            slh_t_sha256,
+            slh_wots_pk_gen_sha2 },
+        { slh_hash_sha256_precache,
+            slh_hash_sha256_dup,
+            slh_hmsg_sha512,
+            slh_prf_sha256,
             slh_prf_msg_sha2,
-            slh_f_sha2,
-            slh_h_sha2,
-            slh_t_sha2 }
+            slh_f_sha256,
+            slh_h_sha512,
+            slh_t_sha512,
+            slh_wots_pk_gen_sha2 }
     };
-    return &methods[is_shake ? 0 : 1];
+    return &methods[is_shake ? 0 : (security_category == 1 ? 1 : 2)];
 }
diff --git a/deps/openssl/openssl/crypto/slh_dsa/slh_hash.h b/deps/openssl/openssl/crypto/slh_dsa/slh_hash.h
index 51e542139f8..27f23323920 100644
--- a/deps/openssl/openssl/crypto/slh_dsa/slh_hash.h
+++ b/deps/openssl/openssl/crypto/slh_dsa/slh_hash.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,6 +12,9 @@
 #pragma once

 #include <openssl/e_os2.h>
+
+#include "crypto/slh_dsa.h"
+
 #include "slh_adrs.h"
 #include "internal/packet.h"

@@ -47,20 +50,29 @@ typedef int(OSSL_SLH_HASHFUNC_H)(SLH_DSA_HASH_CTX *ctx, const uint8_t *pk_seed,
     const uint8_t *m1, const uint8_t *m2,
     uint8_t *out, size_t out_len);

-typedef int(OSSL_SLH_HASHFUNC_T)(SLH_DSA_HASH_CTX *ctx, const uint8_t *pk_seed,
-    const uint8_t *adrs,
-    const uint8_t *m1, size_t m1_len,
-    uint8_t *out, size_t out_len);
+#define OSSL_SLH_HASHFUNC_T OSSL_SLH_HASHFUNC_F
+
+typedef int(OSSL_SLH_HASHFUNC_wots_pk_gen)(SLH_DSA_HASH_CTX *hctx,
+    const uint8_t *sk_seed, const uint8_t *pk_seed,
+    uint8_t *adrs, uint8_t *pk_out, size_t pk_out_len);
+
+typedef int(OSSL_SLH_HASHFUNC_prehash_pk_seed)(SLH_DSA_HASH_CTX *hctx,
+    const uint8_t *pk_seed, size_t n);
+typedef int(OSSL_SLH_HASHFUNC_prehash_dup)(SLH_DSA_HASH_CTX *dst,
+    const SLH_DSA_HASH_CTX *src);

 typedef struct slh_hash_func_st {
+    OSSL_SLH_HASHFUNC_prehash_pk_seed *prehash_pk_seed;
+    OSSL_SLH_HASHFUNC_prehash_dup *prehash_dup;
     OSSL_SLH_HASHFUNC_H_MSG *H_MSG;
     OSSL_SLH_HASHFUNC_PRF *PRF;
     OSSL_SLH_HASHFUNC_PRF_MSG *PRF_MSG;
     OSSL_SLH_HASHFUNC_F *F;
     OSSL_SLH_HASHFUNC_H *H;
     OSSL_SLH_HASHFUNC_T *T;
+    OSSL_SLH_HASHFUNC_wots_pk_gen *wots_pk_gen;
 } SLH_HASH_FUNC;

-const SLH_HASH_FUNC *ossl_slh_get_hash_fn(int is_shake);
+const SLH_HASH_FUNC *ossl_slh_get_hash_fn(int is_shake, int security_category);

 #endif
diff --git a/deps/openssl/openssl/crypto/slh_dsa/slh_params.h b/deps/openssl/openssl/crypto/slh_dsa/slh_params.h
index fea14d5d6a8..5a97b9fb58a 100644
--- a/deps/openssl/openssl/crypto/slh_dsa/slh_params.h
+++ b/deps/openssl/openssl/crypto/slh_dsa/slh_params.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_PARAMS_H)
+#define OSSL_LIBCRYPTO_SLH_DSA_SLH_PARAMS_H
+
 #include <openssl/e_os2.h>

 /*
@@ -37,3 +40,5 @@ typedef struct slh_dsa_params_st {
 } SLH_DSA_PARAMS;

 const SLH_DSA_PARAMS *ossl_slh_dsa_params_get(const char *alg);
+
+#endif /* !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_PARAMS_H) */
diff --git a/deps/openssl/openssl/crypto/slh_dsa/slh_wots.c b/deps/openssl/openssl/crypto/slh_dsa/slh_wots.c
index 79f3bca8747..e4e82f4407a 100644
--- a/deps/openssl/openssl/crypto/slh_dsa/slh_wots.c
+++ b/deps/openssl/openssl/crypto/slh_dsa/slh_wots.c
@@ -109,13 +109,13 @@ static int slh_wots_chain(SLH_DSA_HASH_CTX *ctx, const uint8_t *in,
     if (!WPACKET_allocate_bytes(wpkt, tmp_len, &tmp))
         return 0;

-    set_hash_address(adrs, j++);
+    set_hash_address(adrs, (uint32_t)(j++));
     if (!F(ctx, pk_seed, adrs, in, n, tmp, tmp_len))
         return 0;

     end_index = start_index + steps;
     for (; j < end_index; ++j) {
-        set_hash_address(adrs, j);
+        set_hash_address(adrs, (uint32_t)j);
         if (!F(ctx, pk_seed, adrs, tmp, n, tmp, tmp_len))
             return 0;
     }
@@ -142,45 +142,23 @@ int ossl_slh_wots_pk_gen(SLH_DSA_HASH_CTX *ctx,
     int ret = 0;
     const SLH_DSA_KEY *key = ctx->key;
     size_t n = key->params->n;
-    size_t i, len = SLH_WOTS_LEN(n); /* 2 * n + 3 */
-    uint8_t sk[SLH_MAX_N];
+    size_t len = SLH_WOTS_LEN(n); /* 2 * n + 3 */
     uint8_t tmp[SLH_WOTS_LEN_MAX * SLH_MAX_N];
-    WPACKET pkt, *tmp_wpkt = &pkt; /* Points to the |tmp| buffer */
-    size_t tmp_len = 0;
+    size_t tmp_len = n * len;

     SLH_HASH_FUNC_DECLARE(key, hashf);
     SLH_ADRS_FUNC_DECLARE(key, adrsf);
-    SLH_HASH_FN_DECLARE(hashf, PRF);
-    SLH_ADRS_FN_DECLARE(adrsf, set_chain_address);
-    SLH_ADRS_DECLARE(sk_adrs);
     SLH_ADRS_DECLARE(wots_pk_adrs);

-    if (!WPACKET_init_static_len(tmp_wpkt, tmp, sizeof(tmp), 0))
-        return 0;
-    adrsf->copy(sk_adrs, adrs);
-    adrsf->set_type_and_clear(sk_adrs, SLH_ADRS_TYPE_WOTS_PRF);
-    adrsf->copy_keypair_address(sk_adrs, adrs);
-
-    for (i = 0; i < len; ++i) { /* len = 2n + 3 */
-        set_chain_address(sk_adrs, i);
-        if (!PRF(ctx, pk_seed, sk_seed, sk_adrs, sk, sizeof(sk)))
-            goto end;
-
-        set_chain_address(adrs, i);
-        if (!slh_wots_chain(ctx, sk, 0, NIBBLE_MASK, pk_seed, adrs, tmp_wpkt))
-            goto end;
-    }
-
-    if (!WPACKET_get_total_written(tmp_wpkt, &tmp_len)) /* should be n * (2 * n + 3) */
+    if (!hashf->wots_pk_gen(ctx, sk_seed, pk_seed, adrs, tmp, tmp_len))
         goto end;
+
     adrsf->copy(wots_pk_adrs, adrs);
     adrsf->set_type_and_clear(wots_pk_adrs, SLH_ADRS_TYPE_WOTS_PK);
     adrsf->copy_keypair_address(wots_pk_adrs, adrs);
     ret = hashf->T(ctx, pk_seed, wots_pk_adrs, tmp, tmp_len, pk_out, pk_out_len);
 end:
-    WPACKET_finish(tmp_wpkt);
-    OPENSSL_cleanse(tmp, sizeof(tmp));
-    OPENSSL_cleanse(sk, n);
+    OPENSSL_cleanse(tmp, tmp_len);
     return ret;
 }

@@ -232,11 +210,11 @@ int ossl_slh_wots_sign(SLH_DSA_HASH_CTX *ctx, const uint8_t *msg,
     adrsf->copy_keypair_address(sk_adrs, adrs);

     for (i = 0; i < len; ++i) {
-        set_chain_address(sk_adrs, i);
+        set_chain_address(sk_adrs, (uint32_t)i);
         /* compute chain i secret */
         if (!PRF(ctx, pk_seed, sk_seed, sk_adrs, sk, sizeof(sk)))
             goto err;
-        set_chain_address(adrs, i);
+        set_chain_address(adrs, (uint32_t)i);
         /* compute chain i signature */
         if (!slh_wots_chain(ctx, sk, 0, msg_and_csum_nibbles[i],
                 pk_seed, adrs, sig_wpkt))
@@ -295,7 +273,7 @@ int ossl_slh_wots_pk_from_sig(SLH_DSA_HASH_CTX *ctx,

     /* Compute the end nodes for each of the chains */
     for (i = 0; i < len; ++i) {
-        set_chain_address(adrs, i);
+        set_chain_address(adrs, (uint32_t)i);
         if (!PACKET_get_bytes(sig_rpkt, &sig_i, n)
             || !slh_wots_chain(ctx, sig_i, msg_and_csum_nibbles[i],
                 NIBBLE_MASK - msg_and_csum_nibbles[i],
diff --git a/deps/openssl/openssl/crypto/sm2/sm2_crypt.c b/deps/openssl/openssl/crypto/sm2/sm2_crypt.c
index 32bfa9797fa..7aa8ecb6822 100644
--- a/deps/openssl/openssl/crypto/sm2/sm2_crypt.c
+++ b/deps/openssl/openssl/crypto/sm2/sm2_crypt.c
@@ -44,7 +44,7 @@ ASN1_SEQUENCE(SM2_Ciphertext) = {

 IMPLEMENT_ASN1_FUNCTIONS(SM2_Ciphertext)

-static size_t ec_field_size(const EC_GROUP *group)
+static int ec_field_size(const EC_GROUP *group)
 {
     const BIGNUM *p = EC_GROUP_get0_field(group);

@@ -71,14 +71,14 @@ int ossl_sm2_plaintext_size(const unsigned char *ct, size_t ct_size,
 {
     struct SM2_Ciphertext_st *sm2_ctext = NULL;

-    sm2_ctext = d2i_SM2_Ciphertext(NULL, &ct, ct_size);
+    sm2_ctext = d2i_SM2_Ciphertext(NULL, &ct, (long)ct_size);

     if (sm2_ctext == NULL) {
         ERR_raise(ERR_LIB_SM2, SM2_R_INVALID_ENCODING);
         return 0;
     }

-    *pt_size = sm2_ctext->C2->length;
+    *pt_size = ASN1_STRING_get_length(sm2_ctext->C2);
     SM2_Ciphertext_free(sm2_ctext);

     return 1;
@@ -87,19 +87,19 @@ int ossl_sm2_plaintext_size(const unsigned char *ct, size_t ct_size,
 int ossl_sm2_ciphertext_size(const EC_KEY *key, const EVP_MD *digest,
     size_t msg_len, size_t *ct_size)
 {
-    const size_t field_size = ec_field_size(EC_KEY_get0_group(key));
+    const int field_size = ec_field_size(EC_KEY_get0_group(key));
     const int md_size = EVP_MD_get_size(digest);
-    size_t sz;
+    int sz;

-    if (field_size == 0 || md_size <= 0)
+    if (field_size == 0 || md_size <= 0 || msg_len > INT_MAX / 2)
         return 0;

     /* Integer and string are simple type; set constructed = 0, means primitive and definite length encoding. */
     sz = 2 * ASN1_object_size(0, field_size + 1, V_ASN1_INTEGER)
         + ASN1_object_size(0, md_size, V_ASN1_OCTET_STRING)
-        + ASN1_object_size(0, msg_len, V_ASN1_OCTET_STRING);
+        + ASN1_object_size(0, (int)msg_len, V_ASN1_OCTET_STRING);
     /* Sequence is structured type; set constructed = 1, means constructed and definite length encoding. */
-    *ct_size = ASN1_object_size(1, sz, V_ASN1_SEQUENCE);
+    *ct_size = (size_t)ASN1_object_size(1, sz, V_ASN1_SEQUENCE);

     return 1;
 }
@@ -127,7 +127,7 @@ int ossl_sm2_encrypt(const EC_KEY *key,
     uint8_t *msg_mask = NULL;
     uint8_t *x2y2 = NULL;
     uint8_t *C3 = NULL;
-    size_t field_size;
+    int field_size;
     const int C3_size = EVP_MD_get_size(digest);
     EVP_MD *fetched_digest = NULL;
     OSSL_LIB_CTX *libctx = ossl_ec_key_get_libctx(key);
@@ -137,6 +137,11 @@ int ossl_sm2_encrypt(const EC_KEY *key,
     ctext_struct.C2 = NULL;
     ctext_struct.C3 = NULL;

+    if (msg_len > INT_MAX / 2) {
+        ERR_raise(ERR_LIB_SM2, ERR_R_PASSED_INVALID_ARGUMENT);
+        goto done;
+    }
+
     if (hash == NULL || C3_size <= 0) {
         ERR_raise(ERR_LIB_SM2, ERR_R_INTERNAL_ERROR);
         goto done;
@@ -172,7 +177,7 @@ int ossl_sm2_encrypt(const EC_KEY *key,
         goto done;
     }

-    x2y2 = OPENSSL_zalloc(2 * field_size);
+    x2y2 = OPENSSL_calloc(2, field_size);
     C3 = OPENSSL_zalloc(C3_size);

     if (x2y2 == NULL || C3 == NULL)
@@ -243,7 +248,7 @@ again:
         goto done;
     }
     if (!ASN1_OCTET_STRING_set(ctext_struct.C3, C3, C3_size)
-        || !ASN1_OCTET_STRING_set(ctext_struct.C2, msg_mask, msg_len)) {
+        || !ASN1_OCTET_STRING_set(ctext_struct.C2, msg_mask, (int)msg_len)) {
         ERR_raise(ERR_LIB_SM2, ERR_R_INTERNAL_ERROR);
         goto done;
     }
@@ -299,36 +304,40 @@ int ossl_sm2_decrypt(const EC_KEY *key,
     BIGNUM *y2 = NULL;
     uint8_t *x2y2 = NULL;
     uint8_t *computed_C3 = NULL;
-    const size_t field_size = ec_field_size(group);
+    const int field_size = ec_field_size(group);
     const int hash_size = EVP_MD_get_size(digest);
     uint8_t *msg_mask = NULL;
     const uint8_t *C2 = NULL;
     const uint8_t *C3 = NULL;
-    int msg_len = 0;
+    size_t c3_len, msg_len = 0;
     EVP_MD_CTX *hash = NULL;
     OSSL_LIB_CTX *libctx = ossl_ec_key_get_libctx(key);
     const char *propq = ossl_ec_key_get0_propq(key);

-    if (field_size == 0 || hash_size <= 0)
+    if (field_size == 0 || hash_size <= 0 || ciphertext_len > LONG_MAX)
         goto done;

     memset(ptext_buf, 0xFF, *ptext_len);

-    sm2_ctext = d2i_SM2_Ciphertext(NULL, &ciphertext, ciphertext_len);
+    sm2_ctext = d2i_SM2_Ciphertext(NULL, &ciphertext, (long)ciphertext_len);

     if (sm2_ctext == NULL) {
         ERR_raise(ERR_LIB_SM2, SM2_R_ASN1_ERROR);
         goto done;
     }

-    if (sm2_ctext->C3->length != hash_size) {
+    msg_len = ASN1_STRING_get_length(sm2_ctext->C2);
+    if (msg_len > INT_MAX)
+        goto done;
+
+    c3_len = ASN1_STRING_get_length(sm2_ctext->C3);
+    if (c3_len > INT_MAX || c3_len != (size_t)hash_size) {
         ERR_raise(ERR_LIB_SM2, SM2_R_INVALID_ENCODING);
         goto done;
     }

-    C2 = sm2_ctext->C2->data;
-    C3 = sm2_ctext->C3->data;
-    msg_len = sm2_ctext->C2->length;
+    C2 = ASN1_STRING_get0_data(sm2_ctext->C2);
+    C3 = ASN1_STRING_get0_data(sm2_ctext->C3);
     if (*ptext_len < (size_t)msg_len) {
         ERR_raise(ERR_LIB_SM2, SM2_R_BUFFER_TOO_SMALL);
         goto done;
@@ -350,7 +359,7 @@ int ossl_sm2_decrypt(const EC_KEY *key,
     }

     msg_mask = OPENSSL_zalloc(msg_len);
-    x2y2 = OPENSSL_zalloc(2 * field_size);
+    x2y2 = OPENSSL_calloc(2, field_size);
     computed_C3 = OPENSSL_zalloc(hash_size);

     if (msg_mask == NULL || x2y2 == NULL || computed_C3 == NULL)
@@ -373,7 +382,7 @@ int ossl_sm2_decrypt(const EC_KEY *key,

     if (BN_bn2binpad(x2, x2y2, field_size) < 0
         || BN_bn2binpad(y2, x2y2 + field_size, field_size) < 0
-        || !ossl_ecdh_kdf_X9_63(msg_mask, msg_len, x2y2, 2 * field_size,
+        || !ossl_ecdh_kdf_X9_63(msg_mask, (int)msg_len, x2y2, 2 * field_size,
             NULL, 0, digest, libctx, propq)) {
         ERR_raise(ERR_LIB_SM2, ERR_R_INTERNAL_ERROR);
         goto done;
@@ -384,7 +393,7 @@ int ossl_sm2_decrypt(const EC_KEY *key,
         goto done;
     }

-    for (i = 0; i != msg_len; ++i)
+    for (i = 0; i != (int)msg_len; ++i)
         ptext_buf[i] = C2[i] ^ msg_mask[i];

     hash = EVP_MD_CTX_new();
@@ -395,7 +404,7 @@ int ossl_sm2_decrypt(const EC_KEY *key,

     if (!EVP_DigestInit(hash, digest)
         || !EVP_DigestUpdate(hash, x2y2, field_size)
-        || !EVP_DigestUpdate(hash, ptext_buf, msg_len)
+        || !EVP_DigestUpdate(hash, ptext_buf, (int)msg_len)
         || !EVP_DigestUpdate(hash, x2y2 + field_size, field_size)
         || !EVP_DigestFinal(hash, computed_C3, NULL)) {
         ERR_raise(ERR_LIB_SM2, ERR_R_EVP_LIB);
@@ -408,7 +417,7 @@ int ossl_sm2_decrypt(const EC_KEY *key,
     }

     rc = 1;
-    *ptext_len = msg_len;
+    *ptext_len = (int)msg_len;

 done:
     if (rc == 0)
diff --git a/deps/openssl/openssl/crypto/sm2/sm2_err.c b/deps/openssl/openssl/crypto/sm2/sm2_err.c
deleted file mode 100644
index 2cb3de1c9ef..00000000000
--- a/deps/openssl/openssl/crypto/sm2/sm2_err.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include "crypto/sm2err.h"
-
-#ifndef OPENSSL_NO_SM2
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA SM2_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_SM2, 0, SM2_R_ASN1_ERROR), "asn1 error" },
-    { ERR_PACK(ERR_LIB_SM2, 0, SM2_R_BAD_SIGNATURE), "bad signature" },
-    { ERR_PACK(ERR_LIB_SM2, 0, SM2_R_BUFFER_TOO_SMALL), "buffer too small" },
-    { ERR_PACK(ERR_LIB_SM2, 0, SM2_R_DIST_ID_TOO_LARGE), "dist id too large" },
-    { ERR_PACK(ERR_LIB_SM2, 0, SM2_R_ID_NOT_SET), "id not set" },
-    { ERR_PACK(ERR_LIB_SM2, 0, SM2_R_ID_TOO_LARGE), "id too large" },
-    { ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_CURVE), "invalid curve" },
-    { ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_DIGEST), "invalid digest" },
-    { ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_DIGEST_TYPE),
-        "invalid digest type" },
-    { ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_ENCODING), "invalid encoding" },
-    { ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_FIELD), "invalid field" },
-    { ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_PRIVATE_KEY),
-        "invalid private key" },
-    { ERR_PACK(ERR_LIB_SM2, 0, SM2_R_NO_PARAMETERS_SET), "no parameters set" },
-    { ERR_PACK(ERR_LIB_SM2, 0, SM2_R_USER_ID_TOO_LARGE), "user id too large" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_SM2_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(SM2_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(SM2_str_reasons);
-#endif
-    return 1;
-}
-#else
-NON_EMPTY_TRANSLATION_UNIT
-#endif
diff --git a/deps/openssl/openssl/crypto/sm2/sm2_sign.c b/deps/openssl/openssl/crypto/sm2/sm2_sign.c
index 2ba4914357b..7f1a40452c8 100644
--- a/deps/openssl/openssl/crypto/sm2/sm2_sign.c
+++ b/deps/openssl/openssl/crypto/sm2/sm2_sign.c
@@ -21,10 +21,25 @@
 #include <openssl/bn.h>
 #include <string.h>

+/*
+ * [SM2 Signature Scheme]
+ * (https://datatracker.ietf.org/doc/html/rfc8998#section-3.2.1)
+ *
+ * If either a client or a server needs to verify the peer's SM2 certificate
+ * contained in the Certificate message, then the following ASCII string value
+ * MUST be used as the SM2 identifier according to [GMT.0009-2012]:
+ *
+ * 1234567812345678
+ */
+static const uint8_t default_sm2_id[] = {
+    0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
+    0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38
+};
+
 int ossl_sm2_compute_z_digest(uint8_t *out,
     const EVP_MD *digest,
     const uint8_t *id,
-    const size_t id_len,
+    size_t id_len,
     const EC_KEY *key)
 {
     int rc = 0;
@@ -82,6 +97,11 @@ int ossl_sm2_compute_z_digest(uint8_t *out,

     /* Z = h(ENTL || ID || a || b || xG || yG || xA || yA) */

+    if (id == NULL) {
+        id = default_sm2_id;
+        id_len = sizeof(default_sm2_id);
+    }
+
     if (id_len >= (UINT16_MAX / 8)) {
         /* too large */
         ERR_raise(ERR_LIB_SM2, SM2_R_ID_TOO_LARGE);
@@ -281,7 +301,7 @@ static ECDSA_SIG *sm2_sig_gen(const EC_KEY *key, const BIGNUM *e)
         /*
          * Pin the nonce to a fixed, value-independent width and flag it
          * BN_FLG_CONSTTIME, so its magnitude does not leak through operand
-         * lengths in the scalar copy inside the ladder or in the arithmetic
+         * lengths in the scalar copy inside the ladder, or in the arithmetic
          * below.  BN_priv_rand_range_ex() is kept so the nonce value itself
          * is unchanged; only its representation is pinned.
          */
diff --git a/deps/openssl/openssl/crypto/sm3/asm/sm3-armv8.pl b/deps/openssl/openssl/crypto/sm3/asm/sm3-armv8.pl
index f36e0e2be98..da7f839d719 100644
--- a/deps/openssl/openssl/crypto/sm3/asm/sm3-armv8.pl
+++ b/deps/openssl/openssl/crypto/sm3/asm/sm3-armv8.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2021-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -51,7 +51,7 @@ $code.=<<___;
 ___
 }

-# A round of compresson function
+# A round of compression function
 # Input:
 # 	ab - choose instruction among sm3tt1a, sm3tt1b, sm3tt2a, sm3tt2b
 # 	vstate0 - vstate1, store digest status(A - H)
@@ -109,7 +109,7 @@ ___
 }

 $code=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"
 .text
 ___

diff --git a/deps/openssl/openssl/crypto/sm3/asm/sm3-riscv64-zbb.pl b/deps/openssl/openssl/crypto/sm3/asm/sm3-riscv64-zbb.pl
new file mode 100644
index 00000000000..83b62ade86f
--- /dev/null
+++ b/deps/openssl/openssl/crypto/sm3/asm/sm3-riscv64-zbb.pl
@@ -0,0 +1,475 @@
+#! /usr/bin/env perl
+# This file is dual-licensed, meaning that you can use it under your
+# choice of either of the following two licenses:
+#
+# Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License"). You can obtain
+# a copy in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+#
+# or
+#
+# Copyright (c) 2025-2026, Julian Zhu <julian.oerv@isrc.iscas.ac.cn>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# The generated code of this file depends on the following RISC-V extensions:
+# - RV64I
+# - RISC-V Basic Bit-manipulation extension ('Zbb')
+
+use strict;
+use warnings;
+
+use FindBin qw($Bin);
+use lib "$Bin";
+use lib "$Bin/../../perlasm";
+use riscv;
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+my $output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+my $flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+$output and open STDOUT,">$output";
+
+my $code=<<___;
+.text
+___
+
+my $SM3K = "SM3K";
+
+# Function arguments
+my ($INP, $LEN, $ADDR) = ("a1", "a2", "sp");
+my ($TMP0, $TMP1) = ("a3", "a4");
+my ($KT, $T1, $T2, $T3, $T4, $T5, $T6) = ("t0", "t1", "t2", "t3", "t4", "t5", "t6");
+my ($A, $B, $C, $D ,$E ,$F ,$G ,$H) = ("s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9");
+my ($W9, $W10, $W11, $W12, $W13 ,$W14 ,$W15) = ("s0", "s1", "a5", "a6", "a7", "s10", "s11");
+my @W = (undef, undef, undef, undef, undef, undef, undef, undef, undef,
+        $W9, $W10, $W11, $W12, $W13, $W14, $W15);
+# Misaligned input only; they reuse round temporaries, so are set up per block
+my ($BASE, $SHL, $SHR) = ($T3, $T4, $T5);
+my ($MISALIGNED_INPUT, $ALIGNED_INPUT) = (0, 1);
+
+# W[9..15] live in registers, the rest on the stack; Wload/Wstore skip registers
+sub Wreg {
+    my ($index, $offset, $scratch) = @_;
+    my $masked = (($index-$offset) & 0x0F);
+    return $masked < 9 ? $scratch : $W[$masked];
+}
+
+sub Wload {
+    my ($scratch, $index, $offset) = @_;
+    my $masked = (($index-$offset) & 0x0F);
+    if ($masked >= 9) {
+        return "";
+    }
+    return "lw $scratch, (($index-$offset)&0x0F)*4($ADDR)";
+}
+
+sub Wstore {
+    my ($scratch, $index, $offset) = @_;
+    my $masked = (($index-$offset) & 0x0F);
+    if ($masked >= 9) {
+        return "";
+    }
+    return "sw $scratch, (($index-$offset)&0x0F)*4($ADDR)";
+}
+
+sub FG0 {
+    my ($X, $Y, $Z) = @_;
+    my $code=<<___;
+    xor $TMP1, $Y, $Z
+    xor $TMP0, $TMP1, $X
+___
+    return $code;
+}
+
+sub FF1 {
+    my ($X, $Y, $Z) = @_;
+    my $code=<<___;
+    or $TMP0, $X, $Y
+    and $TMP1, $X, $Y
+    and $TMP0, $TMP0, $Z
+    or $TMP0, $TMP0, $TMP1
+___
+    return $code;
+}
+
+sub GG1 {
+    my ($X, $Y, $Z) = @_;
+    my $code=<<___;
+    xor $TMP1, $Y, $Z
+    and $TMP0, $TMP1, $X
+    xor $TMP0, $TMP0, $Z
+___
+    return $code;
+}
+
+sub P0 {
+    my ($X) = @_;
+    my $code=<<___;
+    @{[roriw $TMP0, $X, 23]}
+    @{[roriw $TMP1, $X, 15]}
+    xor $TMP0, $TMP0, $X
+    xor $X, $TMP0, $TMP1
+___
+    return $code;
+}
+
+sub P1 {
+    my ($X) = @_;
+    my $code=<<___;
+    @{[roriw $TMP0, $X, 17]}
+    @{[roriw $TMP1, $X, 9]}
+    xor $TMP0, $TMP0, $X
+    xor $X, $TMP0, $TMP1
+___
+    return $code;
+}
+
+# W[j] = P1(W[j-16] ^ W[j-9] ^ ROTL(W[j-3], 15)) ^ ROTL(W[j-13], 7) ^ W[j-6]
+sub EXPAND {
+    my ($index) = @_;
+    my $w16 = Wreg($index, 0, $T1);
+    my $w9 = Wreg($index, 9, $T2);
+    my $w3 = Wreg($index, 3, $T3);
+    my $w13 = Wreg($index, 13, $T4);
+    my $w6 = Wreg($index, 6, $T5);
+    # W[j] overwrites W[j-16], so W[j-16] is read first
+    my $wj = Wreg($index, 0, $T6);
+    my $code=<<___;
+    @{[Wload $T1, $index, 0]}
+    @{[Wload $T2, $index, 9]}
+    @{[Wload $T3, $index, 3]}
+    @{[Wload $T4, $index, 13]}
+    @{[Wload $T5, $index, 6]}
+    xor $TMP0, $w16, $w9
+    @{[roriw $TMP1, $w3, 17]}
+    @{[roriw $T1, $w13, 25]}
+    xor $wj, $TMP0, $TMP1
+    xor $T1, $T1, $w6
+    @{[P1 $wj]}
+    xor $wj, $wj, $T1
+    @{[Wstore $T6, $index, 0]}
+___
+    return $code;
+}
+
+sub SM3ROUND1 {
+    my ($index, $a, $b, $c, $d, $e, $f, $g, $h) = @_;
+    my $wj = Wreg($index, 0, $T5);   # W[j]
+    my $w4 = Wreg($index, 12, $T2);  # W[j+4]
+    my $code=<<___;
+    @{[Wload $T5, $index, 0]}
+    @{[Wload $T2, $index, 12]}
+    lw $T1, 4*$index($KT) # T1 = Tj
+    xor $T6, $wj, $w4 # T6 = W'[j] = W[j] ^ W[j+4]
+    @{[roriw $T2, $a, 20]} # T2 = A12
+    @{[FG0 $a, $b, $c]}
+    addw $T3, $T2, $T1 # T3 = A12 + Tj
+    addw $T4, $TMP0, $d # T4 = FF + D
+    addw $T3, $T3, $e # T3 = A12 + Tj + E
+    addw $T4, $T4, $T6 # T4 = FF + D + W'
+    @{[roriw $T3, $T3, 25]} # T3 = SS1
+    addw $h, $h, $wj # h = H + W
+    xor $T1, $T3, $T2 # T1 = SS2 = SS1 ^ A12
+    @{[FG0 $e, $f, $g]}
+    addw $d, $T1, $T4 # d = TT1
+    @{[roriw $b, $b, 23]}
+    addw $T1, $TMP0, $T3 # T1 = GG + SS1
+    @{[roriw $f, $f, 13]}
+    addw $h, $h, $T1 # h = TT2
+    @{[P0 $h]}
+
+___
+    return $code;
+}
+
+sub SM3ROUND2 {
+    my ($index, $a, $b, $c, $d, $e, $f, $g, $h) = @_;
+    my $wj = Wreg($index, 0, $T5);   # W[j]
+    my $w4 = Wreg($index, 12, $T2);  # W[j+4]
+    my $code=<<___;
+    @{[Wload $T5, $index, 0]}
+    @{[Wload $T2, $index, 12]}
+    lw $T1, 4*$index($KT) # T1 = Tj
+    xor $T6, $wj, $w4 # T6 = W'[j] = W[j] ^ W[j+4]
+    @{[roriw $T2, $a, 20]} # T2 = A12
+    @{[FF1 $a, $b, $c]}
+    addw $T3, $T2, $T1 # T3 = A12 + Tj
+    addw $T4, $TMP0, $d # T4 = FF + D
+    addw $T3, $T3, $e # T3 = A12 + Tj + E
+    addw $T4, $T4, $T6 # T4 = FF + D + W'
+    @{[roriw $T3, $T3, 25]} # T3 = SS1
+    addw $h, $h, $wj # h = H + W
+    xor $T1, $T3, $T2 # T1 = SS2 = SS1 ^ A12
+    @{[GG1 $e, $f, $g]}
+    addw $d, $T1, $T4 # d = TT1
+    @{[roriw $b, $b, 23]}
+    addw $T1, $TMP0, $T3 # T1 = GG + SS1
+    @{[roriw $f, $f, 13]}
+    addw $h, $h, $T1 # h = TT2
+    @{[P0 $h]}
+
+___
+    return $code;
+}
+
+# Misaligned: $dst = (lo >> SHL) | (hi << SHR) from two aligned loads
+sub loadDword {
+    my ($ALIGNED, $dst, $off) = @_;
+    if ($ALIGNED) {
+        return "ld $dst, $off($INP)";
+    }
+    my $code=<<___;
+    ld $TMP0, $off($BASE)
+    ld $TMP1, ($off+8)($BASE)
+    srl $dst, $TMP0, $SHL
+    sll $TMP1, $TMP1, $SHR
+    or $dst, $dst, $TMP1
+___
+    return $code;
+}
+
+# One ld plus rev8 yields two message words, the first in the top half
+sub loadMsgRev32 {
+    my ($ALIGNED) = @_;
+    my $code=<<___;
+    @{[loadDword $ALIGNED, $T1, 0]}
+    @{[rev8 $T1, $T1]}
+    srli $T2, $T1, 32
+    sw $T2, 0($ADDR)
+    sw $T1, 4($ADDR)
+
+    @{[loadDword $ALIGNED, $T1, 8]}
+    @{[rev8 $T1, $T1]}
+    srli $T2, $T1, 32
+    sw $T2, 8($ADDR)
+    sw $T1, 12($ADDR)
+
+    @{[loadDword $ALIGNED, $T1, 16]}
+    @{[rev8 $T1, $T1]}
+    srli $T2, $T1, 32
+    sw $T2, 16($ADDR)
+    sw $T1, 20($ADDR)
+
+    @{[loadDword $ALIGNED, $T1, 24]}
+    @{[rev8 $T1, $T1]}
+    srli $T2, $T1, 32
+    sw $T2, 24($ADDR)
+    sw $T1, 28($ADDR)
+
+    @{[loadDword $ALIGNED, $W9, 32]}
+    @{[rev8 $W9, $W9]}
+    srli $T2, $W9, 32
+    sw $T2, 32($ADDR)
+
+    @{[loadDword $ALIGNED, $W11, 40]}
+    @{[rev8 $W11, $W11]}
+    srli $W10, $W11, 32
+
+    @{[loadDword $ALIGNED, $W13, 48]}
+    @{[rev8 $W13, $W13]}
+    srli $W12, $W13, 32
+
+    @{[loadDword $ALIGNED, $W15, 56]}
+    @{[rev8 $W15, $W15]}
+    srli $W14, $W15, 32
+___
+    return $code;
+}
+
+################################################################################
+# void ossl_sm3_block_data_order_zbb(SM3_CTX *ctx, const void *p, size_t num)
+$code .= <<___;
+.p2align 3
+.globl ossl_sm3_block_data_order_zbb
+.type   ossl_sm3_block_data_order_zbb,\@function
+ossl_sm3_block_data_order_zbb:
+
+    addi sp, sp, -96
+
+    sd s0, 0(sp)
+    sd s1, 8(sp)
+    sd s2, 16(sp)
+    sd s3, 24(sp)
+    sd s4, 32(sp)
+    sd s5, 40(sp)
+    sd s6, 48(sp)
+    sd s7, 56(sp)
+    sd s8, 64(sp)
+    sd s9, 72(sp)
+    sd s10, 80(sp)
+    sd s11, 88(sp)
+
+    addi sp, sp, -64
+
+    la $KT, $SM3K
+
+    # load ctx
+    lw $A, 0(a0)
+    lw $B, 4(a0)
+    lw $C, 8(a0)
+    lw $D, 12(a0)
+    lw $E, 16(a0)
+    lw $F, 20(a0)
+    lw $G, 24(a0)
+    lw $H, 28(a0)
+
+L_round_loop:
+    # Decrement length by 1
+    addi $LEN, $LEN, -1
+
+    andi $T1, $INP, 7
+    bnez $T1, L_load_misaligned
+    @{[loadMsgRev32 $ALIGNED_INPUT]}
+    j L_rounds
+
+L_load_misaligned:
+    andi $BASE, $INP, -8
+    andi $SHL, $INP, 7
+    slli $SHL, $SHL, 3
+    li $SHR, 64
+    sub $SHR, $SHR, $SHL
+    @{[loadMsgRev32 $MISALIGNED_INPUT]}
+
+L_rounds:
+___
+
+for (my $i = 0; $i < 16; $i += 4) {
+    $code .= <<___;
+    @{[SM3ROUND1 $i, $A, $B, $C, $D, $E, $F, $G, $H]}
+    @{[EXPAND $i]}
+    @{[SM3ROUND1 $i+1, $D, $A, $B, $C, $H, $E, $F, $G]}
+    @{[EXPAND $i+1]}
+    @{[SM3ROUND1 $i+2, $C, $D, $A, $B, $G, $H, $E, $F]}
+    @{[EXPAND $i+2]}
+    @{[SM3ROUND1 $i+3, $B, $C, $D, $A, $F, $G, $H, $E]}
+    @{[EXPAND $i+3]}
+___
+}
+
+for (my $i = 16; $i < 52; $i += 4) {
+    $code .= <<___;
+    @{[SM3ROUND2 $i, $A, $B, $C, $D, $E, $F, $G, $H]}
+    @{[EXPAND $i]}
+    @{[SM3ROUND2 $i+1, $D, $A, $B, $C, $H, $E, $F, $G]}
+    @{[EXPAND $i+1]}
+    @{[SM3ROUND2 $i+2, $C, $D, $A, $B, $G, $H, $E, $F]}
+    @{[EXPAND $i+2]}
+    @{[SM3ROUND2 $i+3, $B, $C, $D, $A, $F, $G, $H, $E]}
+    @{[EXPAND $i+3]}
+___
+}
+
+for (my $i = 52; $i < 64; $i += 4) {
+    $code .= <<___;
+    @{[SM3ROUND2 $i, $A, $B, $C, $D, $E, $F, $G, $H]}
+    @{[SM3ROUND2 $i+1, $D, $A, $B, $C, $H, $E, $F, $G]}
+    @{[SM3ROUND2 $i+2, $C, $D, $A, $B, $G, $H, $E, $F]}
+    @{[SM3ROUND2 $i+3, $B, $C, $D, $A, $F, $G, $H, $E]}
+___
+}
+
+$code .= <<___;
+    lw $T1, 0(a0)
+    lw $T2, 4(a0)
+    lw $T3, 8(a0)
+    lw $T4, 12(a0)
+
+    xor $A, $A, $T1
+    xor $B, $B, $T2
+    xor $C, $C, $T3
+    xor $D, $D, $T4
+
+    sw $A, 0(a0)
+    sw $B, 4(a0)
+    sw $C, 8(a0)
+    sw $D, 12(a0)
+
+    lw $T1, 16(a0)
+    lw $T2, 20(a0)
+    lw $T3, 24(a0)
+    lw $T4, 28(a0)
+
+    xor $E, $E, $T1
+    xor $F, $F, $T2
+    xor $G, $G, $T3
+    xor $H, $H, $T4
+
+    sw $E, 16(a0)
+    sw $F, 20(a0)
+    sw $G, 24(a0)
+    sw $H, 28(a0)
+
+    addi $INP, $INP, 64
+
+    bnez $LEN, L_round_loop
+
+    addi sp, sp, 64
+
+    ld s0, 0(sp)
+    ld s1, 8(sp)
+    ld s2, 16(sp)
+    ld s3, 24(sp)
+    ld s4, 32(sp)
+    ld s5, 40(sp)
+    ld s6, 48(sp)
+    ld s7, 56(sp)
+    ld s8, 64(sp)
+    ld s9, 72(sp)
+    ld s10, 80(sp)
+    ld s11, 88(sp)
+
+    addi sp, sp, 96
+
+    ret
+.size ossl_sm3_block_data_order_zbb,.-ossl_sm3_block_data_order_zbb
+
+.section .rodata
+.p2align 3
+.type $SM3K,\@object
+$SM3K:
+    .word 0x79CC4519, 0xF3988A32, 0xE7311465, 0xCE6228CB
+    .word 0x9CC45197, 0x3988A32F, 0x7311465E, 0xE6228CBC
+    .word 0xCC451979, 0x988A32F3, 0x311465E7, 0x6228CBCE
+    .word 0xC451979C, 0x88A32F39, 0x11465E73, 0x228CBCE6
+    .word 0x9D8A7A87, 0x3B14F50F, 0x7629EA1E, 0xEC53D43C
+    .word 0xD8A7A879, 0xB14F50F3, 0x629EA1E7, 0xC53D43CE
+    .word 0x8A7A879D, 0x14F50F3B, 0x29EA1E76, 0x53D43CEC
+    .word 0xA7A879D8, 0x4F50F3B1, 0x9EA1E762, 0x3D43CEC5
+    .word 0x7A879D8A, 0xF50F3B14, 0xEA1E7629, 0xD43CEC53
+    .word 0xA879D8A7, 0x50F3B14F, 0xA1E7629E, 0x43CEC53D
+    .word 0x879D8A7A, 0x0F3B14F5, 0x1E7629EA, 0x3CEC53D4
+    .word 0x79D8A7A8, 0xF3B14F50, 0xE7629EA1, 0xCEC53D43
+    .word 0x9D8A7A87, 0x3B14F50F, 0x7629EA1E, 0xEC53D43C
+    .word 0xD8A7A879, 0xB14F50F3, 0x629EA1E7, 0xC53D43CE
+    .word 0x8A7A879D, 0x14F50F3B, 0x29EA1E76, 0x53D43CEC
+    .word 0xA7A879D8, 0x4F50F3B1, 0x9EA1E762, 0x3D43CEC5
+.size $SM3K,.-$SM3K
+___
+
+print $code;
+
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/sm3/asm/sm3-riscv64-zvksh.pl b/deps/openssl/openssl/crypto/sm3/asm/sm3-riscv64-zvksh.pl
index 1b8fd2eea0d..2bee96e2c4a 100755
--- a/deps/openssl/openssl/crypto/sm3/asm/sm3-riscv64-zvksh.pl
+++ b/deps/openssl/openssl/crypto/sm3/asm/sm3-riscv64-zvksh.pl
@@ -63,7 +63,7 @@ ___
 ################################################################################
 # ossl_hwsm3_block_data_order_zvksh(SM3_CTX *c, const void *p, size_t num);
 {
-my ($CTX, $INPUT, $NUM) = ("a0", "a1", "a2");
+my ($CTX, $INPUT, $NUM, $EVENNUM , $TMPADDR) = ("a0", "a1", "a2", "a6", "t0");
 my ($V0, $V1, $V2, $V3, $V4, $V5, $V6, $V7,
     $V8, $V9, $V10, $V11, $V12, $V13, $V14, $V15,
     $V16, $V17, $V18, $V19, $V20, $V21, $V22, $V23,
@@ -76,8 +76,178 @@ $code .= <<___;
 .globl ossl_hwsm3_block_data_order_zvksh
 .type ossl_hwsm3_block_data_order_zvksh,\@function
 ossl_hwsm3_block_data_order_zvksh:
+    # Obtain VLEN and select the corresponding branch
+    csrr t0, vlenb
+    srl t1, t0, 5
+    beqz t1, ossl_hwsm3_block_data_order_zvksh_zvl128
+    srl t1, t0, 6
+    beqz t1, ossl_hwsm3_block_data_order_zvksh_zvl256
+ossl_hwsm3_block_data_order_zvksh_zvl512:
+    @{[vsetivli "zero", 8, "e32", "m1", "tu", "mu"]}
+    @{[vle32_v $V26, $CTX]}
+    @{[vrev8_v $V26, $V26]}
+    @{[vsetivli "zero", 16, "e32", "m1", "ta", "ma"]}
+    la $TMPADDR, ORDER_BY_ZVL512_DATA
+    @{[vle32_v $V30, $TMPADDR]}
+    addi $TMPADDR, $TMPADDR, 64
+    @{[vle32_v $V31, $TMPADDR]}
+    la $TMPADDR, ORDER_BY_ZVL512_EXP
+    @{[vle32_v $V29, $TMPADDR]}
+    addi $TMPADDR, $TMPADDR, 64
+    @{[vle32_v $V28, $TMPADDR]}
+    srli $EVENNUM , $NUM, 1
+    andi $NUM, $NUM, 1
+    beqz $EVENNUM , ossl_hwsm3_block_data_order_zvksh_zvl256
+L_sm3_loop_zvl512:
+    # Use indexed loads (ORDER_BY_RVV512_DATA) to load two blocks in the
+    # word order expected by the later vrgather/vsm3c stages.
+    @{[vluxei32_v $V0, $INPUT, $V30]}
+    @{[vluxei32_v $V1, $INPUT, $V31]}
+    @{[vrgather_vv $V9, $V0, $V29]}
+    @{[vrgather_vv $V10, $V9, $V29]}
+    @{[vrgather_vv $V11, $V1, $V28]}
+    @{[vor_vv $V10, $V10, $V11]}
+    @{[vrgather_vv $V11, $V10, $V29]}
+    @{[vrgather_vv $V12, $V1, $V29]}
+    @{[vrgather_vv $V13, $V12, $V29]}
+    @{[vsm3me_vv $V2, $V1, $V0]}
+    @{[vrgather_vv $V14, $V2, $V28]}
+    @{[vor_vv $V13, $V13, $V14]}
+    @{[vrgather_vv $V14, $V13, $V29]}
+    @{[vrgather_vv $V15, $V2, $V29]}
+    @{[vrgather_vv $V16, $V15, $V29]}
+    @{[vsm3me_vv $V3, $V2, $V1]}
+    @{[vrgather_vv $V17, $V3, $V28]}
+    @{[vor_vv $V16, $V16, $V17]}
+    @{[vrgather_vv $V17, $V16, $V29]}
+    @{[vrgather_vv $V18, $V3, $V29]}
+    @{[vrgather_vv $V19, $V18, $V29]}
+    @{[vsm3me_vv $V4, $V3, $V2]}
+    @{[vrgather_vv $V20, $V4, $V28]}
+    @{[vor_vv $V19, $V19, $V20]}
+    @{[vrgather_vv $V20, $V19, $V29]}
+    @{[vrgather_vv $V21, $V4, $V29]}
+    @{[vrgather_vv $V22, $V21, $V29]}
+    @{[vsm3me_vv $V5, $V4, $V3]}
+    @{[vrgather_vv $V23, $V5, $V28]}
+    @{[vor_vv $V22, $V22, $V23]}
+    @{[vrgather_vv $V23, $V22, $V29]}
+    @{[vrgather_vv $V24, $V5, $V29]}
+    @{[vrgather_vv $V25, $V24, $V29]}
+    @{[vsm3me_vv $V6, $V5, $V4]}
+    @{[vrgather_vv $V27, $V6, $V28]}
+    @{[vor_vv $V25, $V25, $V27]}
+    @{[vsm3me_vv $V7, $V6, $V5]}
+    @{[vsm3me_vv $V8, $V7, $V6]}
+    @{[vmv_v_v $V27, $V26]}
+    @{[vsetivli "zero", 8, "e32", "m1", "tu", "mu"]}
+    @{[vsm3c_vi $V26, $V0, 0]}
+    @{[vsm3c_vi $V26, $V9, 1]}
+    @{[vsm3c_vi $V26, $V10, 2]}
+    @{[vsm3c_vi $V26, $V11, 3]}
+    @{[vsm3c_vi $V26, $V1, 4]}
+    @{[vsm3c_vi $V26, $V12, 5]}
+    @{[vsm3c_vi $V26, $V13, 6]}
+    @{[vsm3c_vi $V26, $V14, 7]}
+    @{[vsm3c_vi $V26, $V2, 8]}
+    @{[vsm3c_vi $V26, $V15, 9]}
+    @{[vsm3c_vi $V26, $V16, 10]}
+    @{[vsm3c_vi $V26, $V17, 11]}
+    @{[vsm3c_vi $V26, $V3, 12]}
+    @{[vsm3c_vi $V26, $V18, 13]}
+    @{[vsm3c_vi $V26, $V19, 14]}
+    @{[vsm3c_vi $V26, $V20, 15]}
+    @{[vsm3c_vi $V26, $V4, 16]}
+    @{[vsm3c_vi $V26, $V21, 17]}
+    @{[vsm3c_vi $V26, $V22, 18]}
+    @{[vsm3c_vi $V26, $V23, 19]}
+    @{[vsm3c_vi $V26, $V5, 20]}
+    @{[vsm3c_vi $V26, $V24, 21]}
+    @{[vsm3c_vi $V26, $V25, 22]}
+    @{[vrgather_vv $V9, $V25, $V29]}
+    @{[vrgather_vv $V10, $V6, $V29]}
+    @{[vrgather_vv $V11, $V10, $V29]}
+    @{[vrgather_vv $V12, $V7, $V28]}
+    @{[vor_vv $V11, $V11, $V12]}
+    @{[vrgather_vv $V12, $V11, $V29]}
+    @{[vrgather_vv $V13, $V7, $V29]}
+    @{[vrgather_vv $V14, $V13, $V29]}
+    @{[vrgather_vv $V15, $V8, $V28]}
+    @{[vor_vv $V14, $V14, $V15]}
+    @{[vrgather_vv $V15, $V14, $V29]}
+    @{[vsm3c_vi $V26, $V9, 23]}
+    @{[vsm3c_vi $V26, $V6, 24]}
+    @{[vsm3c_vi $V26, $V10, 25]}
+    @{[vsm3c_vi $V26, $V11, 26]}
+    @{[vsm3c_vi $V26, $V12, 27]}
+    @{[vsm3c_vi $V26, $V7, 28]}
+    @{[vsm3c_vi $V26, $V13, 29]}
+    @{[vsm3c_vi $V26, $V14, 30]}
+    @{[vsm3c_vi $V26, $V15, 31]}
+    @{[vsetivli "zero", 16, "e32", "m1", "ta", "ma"]}
+    @{[vxor_vv $V26, $V26, $V27]}
+    @{[vslideup_vi $V27, $V26, 8]}
+    @{[vmv_v_v $V26, $V27]}
+    @{[vsm3c_vi $V26, $V0, 0]}
+    @{[vsm3c_vi $V26, $V9, 1]}
+    @{[vsm3c_vi $V26, $V10, 2]}
+    @{[vsm3c_vi $V26, $V11, 3]}
+    @{[vsm3c_vi $V26, $V1, 4]}
+    @{[vsm3c_vi $V26, $V12, 5]}
+    @{[vsm3c_vi $V26, $V13, 6]}
+    @{[vsm3c_vi $V26, $V14, 7]}
+    @{[vsm3c_vi $V26, $V2, 8]}
+    @{[vsm3c_vi $V26, $V15, 9]}
+    @{[vsm3c_vi $V26, $V16, 10]}
+    @{[vsm3c_vi $V26, $V17, 11]}
+    @{[vsm3c_vi $V26, $V3, 12]}
+    @{[vsm3c_vi $V26, $V18, 13]}
+    @{[vsm3c_vi $V26, $V19, 14]}
+    @{[vsm3c_vi $V26, $V20, 15]}
+    @{[vsm3c_vi $V26, $V4, 16]}
+    @{[vsm3c_vi $V26, $V21, 17]}
+    @{[vsm3c_vi $V26, $V22, 18]}
+    @{[vsm3c_vi $V26, $V23, 19]}
+    @{[vsm3c_vi $V26, $V5, 20]}
+    @{[vsm3c_vi $V26, $V24, 21]}
+    @{[vsm3c_vi $V26, $V25, 22]}
+    @{[vrgather_vv $V9, $V25, $V29]}
+    @{[vrgather_vv $V10, $V6, $V29]}
+    @{[vrgather_vv $V11, $V10, $V29]}
+    @{[vrgather_vv $V12, $V7, $V28]}
+    @{[vor_vv $V11, $V11, $V12]}
+    @{[vrgather_vv $V12, $V11, $V29]}
+    @{[vrgather_vv $V13, $V7, $V29]}
+    @{[vrgather_vv $V14, $V13, $V29]}
+    @{[vrgather_vv $V15, $V8, $V28]}
+    @{[vor_vv $V14, $V14, $V15]}
+    @{[vrgather_vv $V15, $V14, $V29]}
+    @{[vsm3c_vi $V26, $V9, 23]}
+    @{[vsm3c_vi $V26, $V6, 24]}
+    @{[vsm3c_vi $V26, $V10, 25]}
+    @{[vsm3c_vi $V26, $V11, 26]}
+    @{[vsm3c_vi $V26, $V12, 27]}
+    @{[vsm3c_vi $V26, $V7, 28]}
+    @{[vsm3c_vi $V26, $V13, 29]}
+    @{[vsm3c_vi $V26, $V14, 30]}
+    @{[vsm3c_vi $V26, $V15, 31]}
+    @{[vxor_vv $V26, $V26, $V27]}
+    @{[vslidedown_vi $V27, $V26, 8]}
+    @{[vmv_v_v $V26, $V27]}
+    addi $EVENNUM , $EVENNUM , -1
+    addi $INPUT, $INPUT, 128
+    bnez $EVENNUM , L_sm3_loop_zvl512
+    @{[vsetivli "zero", 8, "e32", "m1", "ta", "ma"]}
+    @{[vrev8_v $V26, $V26]}
+    @{[vse32_v $V26, $CTX]}
+    bnez $NUM, ossl_hwsm3_block_data_order_zvksh_zvl256
+    ret
+ossl_hwsm3_block_data_order_zvksh_zvl256:
+    @{[vsetivli "zero", 8, "e32", "m1", "ta", "ma"]}
+    j ossl_hwsm3_block_data_order_zvksh_single
+ossl_hwsm3_block_data_order_zvksh_zvl128:
     @{[vsetivli "zero", 8, "e32", "m2", "ta", "ma"]}
-
+ossl_hwsm3_block_data_order_zvksh_single:
     # Load initial state of hash context (c->A-H).
     @{[vle32_v $V0, $CTX]}
     @{[vrev8_v $V0, $V0]}
@@ -220,6 +390,19 @@ L_sm3_end:
     ret

 .size ossl_hwsm3_block_data_order_zvksh,.-ossl_hwsm3_block_data_order_zvksh
+
+.section .rodata
+.p2align 3
+.type ORDER_BY_ZVL512_DATA,\@object
+ORDER_BY_ZVL512_DATA:
+    .word 0, 4, 8, 12, 16, 20, 24, 28, 64, 68, 72, 76, 80, 84, 88, 92, 32, 36, 40, 44, 48, 52, 56, 60, 96, 100, 104, 108, 112, 116, 120, 124
+.size ORDER_BY_ZVL512_DATA, .-ORDER_BY_ZVL512_DATA
+
+.p2align 3
+.type ORDER_BY_ZVL512_EXP,\@object
+ORDER_BY_ZVL512_EXP:
+    .word 2, 3, 4, 5, 6, 7, 255, 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 0, 1, 2, 3, 255, 255, 255, 255, 8, 9, 10, 11
+.size ORDER_BY_ZVL512_EXP, .-ORDER_BY_ZVL512_EXP
 ___
 }

diff --git a/deps/openssl/openssl/crypto/sm3/asm/sm3-x86_64.pl b/deps/openssl/openssl/crypto/sm3/asm/sm3-x86_64.pl
new file mode 100755
index 00000000000..05fead782d9
--- /dev/null
+++ b/deps/openssl/openssl/crypto/sm3/asm/sm3-x86_64.pl
@@ -0,0 +1,326 @@
+#! /usr/bin/env perl
+# Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright (c) 2024, Intel Corporation. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+#
+#
+# This module implements support for Intel(R) SM3 instructions
+# from Intel(R) Multi-Buffer Crypto for IPsec Library
+# (https://github.com/intel/intel-ipsec-mb).
+# Original author is Tomasz Kantecki <tomasz.kantecki@intel.com>
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+$win64=0;
+$win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/);
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/;
+$dir=$1;
+( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or
+( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
+die "can't locate x86_64-xlate.pl";
+
+# Check Intel(R) SM3 instructions support
+if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`
+		=~ /GNU assembler version ([2-9]\.[0-9]+)/) {
+	$avx2_sm3_ni = ($1>=2.22); # minimal avx2 supported version, binary translation for SM3 instructions (sub sm3op) is used
+    $avx2_sm3_ni_native = ($1>=2.42); # support added at GNU asm 2.42
+}
+
+if (!$avx2_sm3_ni && $win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&
+	   `nasm -v 2>&1` =~ /NASM version ([2-9])\.([0-9]+)(?:\.([0-9]+))?/) {
+    my ($major, $minor, $patch) = ($1, $2, defined($3) ? $3 : 0);
+    $avx2_sm3_ni = ($major > 2) || ($major == 2 && $minor > 10); # minimal avx2 supported version, binary translation for SM3 instructions (sub sm3op) is used
+	$avx2_sm3_ni_native = ($major > 2) || ($major == 2 && $minor > 16) || ($major == 2 && $minor == 16 && $patch >= 2); # support added at NASM 2.16.02
+}
+
+if (!$avx2_sm3_ni && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) {
+	$avx2_sm3_ni = ($2>=7.0); # minimal tested version, binary translation for SM3 instructions (sub sm3op) is used
+    $avx2_sm3_ni_native = ($2>=17.0); # support added at LLVM 17.0.1
+}
+
+open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
+    or die "can't call $xlate: $!";
+*STDOUT=*OUT;
+
+if ($avx2_sm3_ni>0) {
+# Create 4 x 32-bit new words of message schedule W[] using SM3-NI ISA
+sub sm3msg {
+my ($W03_00, $W07_04, $W11_08, $W15_12, $W19_16, $T1,$T2) = @_;
+my $T3 = $W19_16;
+$code.=<<___;
+    vpalignr        \$12, $W07_04, $W11_08, $T3
+    vpsrldq         \$4, $W15_12, $T1
+    vsm3msg1        $W03_00, $T1, $T3
+    vpalignr        \$12, $W03_00, $W07_04, $T1
+    vpalignr        \$8, $W11_08, $W15_12, $T2
+    vsm3msg2        $T2, $T1, $T3
+___
+}
+
+# Performs 4 rounds of SM3 algorithm
+#   - consumes 4 words of message schedule W[]
+#   - updates SM3 state registers: ABEF and CDGH
+sub sm3rounds4 {
+my ($ABEF, $CDGH, $W03_00, $W07_04, $T1,$R)=@_;
+my $R2 = $R + 2;
+$code.=<<___;
+    vpunpcklqdq     $W07_04, $W03_00, $T1
+    vsm3rnds2       \$$R, $T1, $ABEF, $CDGH
+    vpunpckhqdq     $W07_04, $W03_00, $T1
+    vsm3rnds2       \$$R2, $T1, $CDGH, $ABEF
+___
+}
+
+$code.= ".data\n";
+{
+# input arguments aliases
+my ($ctx,$p,$num) = ("%rdi","%rsi","%rdx");
+
+$code.=<<___;
+.align 16
+SHUFF_MASK:
+    .byte 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12
+
+.text
+
+# void ossl_hwsm3_block_data_order(SM3_CTX *c, const void *p, size_t num)
+#
+# input: $ctx SM3 context
+#        $p  pointer to the data
+#        $num number of blocks
+#
+
+.globl	ossl_hwsm3_block_data_order
+.type	ossl_hwsm3_block_data_order,\@function,3
+.align	32
+ossl_hwsm3_block_data_order:
+.cfi_startproc
+    endbranch
+# Prolog
+    push    %rbp
+.cfi_push   %rbp
+.cfi_def_cfa_register %rbp
+.Lossl_hwsm3_block_data_order_seh_setfp:
+___
+
+$code.=<<___ if($win64);
+    # xmm6:xmm12 need to be maintained for Windows
+    sub \$`7*16`,%rsp
+.cfi_adjust_cfa_offset \$`7*16`
+    vmovdqu %xmm6, 16*0(%rsp)
+    vmovdqu %xmm7, 16*1(%rsp)
+    vmovdqu %xmm8, 16*2(%rsp)
+    vmovdqu %xmm9, 16*3(%rsp)
+    vmovdqu %xmm10,16*4(%rsp)
+    vmovdqu %xmm11,16*5(%rsp)
+    vmovdqu %xmm12,16*6(%rsp)
+___
+
+  $code .= <<___;
+# Prolog ends here.
+.Lossl_hwsm3_block_data_order_seh_prolog_end:
+    or $num, $num
+    je .done_hash
+
+    # xmm = D C B A
+    # D - most significant word in an `xmm`
+    # A - least significant word in an `xmm`
+    vmovdqu         ($ctx), %xmm6 # xmm6 = D C B A
+    vmovdqu         16($ctx), %xmm7 # xmm7 = H G F E
+
+    vpshufd         \$0x1B, %xmm6, %xmm0
+    vpshufd         \$0x1B, %xmm7, %xmm1
+    vpunpckhqdq     %xmm0, %xmm1, %xmm6
+    vpunpcklqdq     %xmm0, %xmm1, %xmm7
+    vpsrld          \$9, %xmm7, %xmm2
+    vpslld          \$23, %xmm7, %xmm3
+    vpxor           %xmm3, %xmm2, %xmm1
+    vpsrld          \$19, %xmm7, %xmm4
+    vpslld          \$13, %xmm7, %xmm5
+    vpxor           %xmm5, %xmm4, %xmm0
+    # xmm7 = ROL32(C, 23) ROL32(D, 23) ROL32(G, 13) ROL32(H, 13)
+    vpblendd        \$0x3, %xmm0, %xmm1, %xmm7
+
+    vmovdqa         SHUFF_MASK(%rip), %xmm12
+
+.align 32
+.block_loop:
+    vmovdqa         %xmm6, %xmm10
+    vmovdqa         %xmm7, %xmm11
+
+    # prepare W[0..15] - read and shuffle the data
+    vmovdqu         ($p), %xmm2
+    vmovdqu         16($p), %xmm3
+    vmovdqu         32($p), %xmm4
+    vmovdqu         48($p), %xmm5
+    vpshufb         %xmm12, %xmm2, %xmm2                            # xmm2 = W03 W02 W01 W00
+    vpshufb         %xmm12, %xmm3, %xmm3                            # xmm3 = W07 W06 W05 W04
+    vpshufb         %xmm12, %xmm4, %xmm4                            # xmm4 = W11 W10 W09 W08
+    vpshufb         %xmm12, %xmm5, %xmm5                            # xmm5 = W15 W14 W13 W12
+
+___
+    sm3msg("%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm8", "%xmm9", "%xmm1");
+    sm3rounds4("%xmm6", "%xmm7", "%xmm2", "%xmm3", "%xmm1", 0);
+
+    $code.="vmovdqa         %xmm8, %xmm2\n";
+    sm3msg("%xmm3", "%xmm4", "%xmm5", "%xmm2", "%xmm8", "%xmm9", "%xmm1");
+    sm3rounds4("%xmm6", "%xmm7", "%xmm3", "%xmm4", "%xmm1", 4);
+
+    $code.="vmovdqa         %xmm8, %xmm3\n";
+    sm3msg("%xmm4", "%xmm5", "%xmm2", "%xmm3", "%xmm8", "%xmm9", "%xmm1");
+    sm3rounds4("%xmm6", "%xmm7", "%xmm4", "%xmm5", "%xmm1", 8);
+
+    $code.="vmovdqa         %xmm8, %xmm4\n";
+    sm3msg("%xmm5", "%xmm2", "%xmm3", "%xmm4", "%xmm8", "%xmm9", "%xmm1");
+    sm3rounds4("%xmm6", "%xmm7", "%xmm5", "%xmm2", "%xmm1", 12);
+
+    $code.="vmovdqa         %xmm8, %xmm5\n";
+    sm3msg("%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm8", "%xmm9", "%xmm1");
+    sm3rounds4("%xmm6", "%xmm7", "%xmm2", "%xmm3", "%xmm1", 16);
+
+    $code.="vmovdqa         %xmm8, %xmm2\n";
+    sm3msg("%xmm3", "%xmm4", "%xmm5", "%xmm2", "%xmm8", "%xmm9", "%xmm1");
+    sm3rounds4("%xmm6", "%xmm7", "%xmm3", "%xmm4", "%xmm1", 20);
+
+    $code.="vmovdqa         %xmm8, %xmm3\n";
+    sm3msg("%xmm4", "%xmm5", "%xmm2", "%xmm3", "%xmm8", "%xmm9", "%xmm1");
+    sm3rounds4("%xmm6", "%xmm7", "%xmm4", "%xmm5", "%xmm1", 24);
+
+    $code.="vmovdqa         %xmm8, %xmm4\n";
+    sm3msg("%xmm5", "%xmm2", "%xmm3", "%xmm4", "%xmm8", "%xmm9", "%xmm1");
+    sm3rounds4("%xmm6", "%xmm7", "%xmm5", "%xmm2", "%xmm1", 28);
+
+    $code.="vmovdqa         %xmm8, %xmm5\n";
+    sm3msg("%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm8", "%xmm9", "%xmm1");
+    sm3rounds4("%xmm6", "%xmm7", "%xmm2", "%xmm3", "%xmm1", 32);
+
+    $code.="vmovdqa         %xmm8, %xmm2\n";
+    sm3msg("%xmm3", "%xmm4", "%xmm5", "%xmm2", "%xmm8", "%xmm9", "%xmm1");
+    sm3rounds4("%xmm6", "%xmm7", "%xmm3", "%xmm4", "%xmm1", 36);
+
+    $code.="vmovdqa         %xmm8, %xmm3\n";
+    sm3msg("%xmm4", "%xmm5", "%xmm2", "%xmm3", "%xmm8", "%xmm9", "%xmm1");
+    sm3rounds4("%xmm6", "%xmm7", "%xmm4", "%xmm5", "%xmm1", 40);
+
+    $code.="vmovdqa         %xmm8, %xmm4\n";
+    sm3msg("%xmm5", "%xmm2", "%xmm3", "%xmm4", "%xmm8", "%xmm9", "%xmm1");
+    sm3rounds4("%xmm6", "%xmm7", "%xmm5", "%xmm2", "%xmm1", 44);
+
+    $code.="vmovdqa         %xmm8, %xmm5\n";
+    sm3msg("%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm8", "%xmm9", "%xmm1");
+    sm3rounds4("%xmm6", "%xmm7", "%xmm2", "%xmm3", "%xmm1", 48);
+
+    $code.="vmovdqa         %xmm8, %xmm2\n";
+    sm3rounds4("%xmm6", "%xmm7", "%xmm3", "%xmm4", "%xmm1", 52);
+    sm3rounds4("%xmm6", "%xmm7", "%xmm4", "%xmm5", "%xmm1", 56);
+    sm3rounds4("%xmm6", "%xmm7", "%xmm5", "%xmm2", "%xmm1", 60);
+
+$code.=<<___;
+    # update hash value
+    vpxor           %xmm10, %xmm6, %xmm6
+    vpxor           %xmm11, %xmm7, %xmm7
+    addq             \$64, $p
+    dec             $num
+    jnz             .block_loop
+
+    # store the hash value back in memory
+    vpslld          \$9, %xmm7, %xmm2
+    vpsrld          \$23, %xmm7, %xmm3
+    vpxor           %xmm3, %xmm2, %xmm1
+    vpslld          \$19, %xmm7, %xmm4
+    vpsrld          \$13, %xmm7, %xmm5
+    vpxor           %xmm5, %xmm4, %xmm0
+    vpblendd        \$0x3, %xmm0, %xmm1, %xmm7
+    vpshufd         \$0x1B, %xmm6, %xmm0
+    vpshufd         \$0x1B, %xmm7, %xmm1
+
+    vpunpcklqdq     %xmm1, %xmm0, %xmm6
+    vpunpckhqdq     %xmm1, %xmm0, %xmm7
+
+    vmovdqu         %xmm6, ($ctx)
+    vmovdqu         %xmm7, 16($ctx)
+.done_hash:
+    # Epilog
+___
+$code.=<<___ if($win64);
+    # xmm6:xmm12 need to be maintained for Windows
+    vmovdqu 16*0(%rsp),%xmm6
+    vmovdqu 16*1(%rsp),%xmm7
+    vmovdqu 16*2(%rsp),%xmm8
+    vmovdqu 16*3(%rsp),%xmm9
+    vmovdqu 16*4(%rsp),%xmm10
+    vmovdqu 16*5(%rsp),%xmm11
+    vmovdqu 16*6(%rsp),%xmm12
+    add \$`7*16`,%rsp
+.cfi_adjust_cfa_offset \$`-7*16`
+___
+  $code .= <<___;
+     pop     %rbp
+.cfi_pop     %rbp
+    ret
+.cfi_endproc
+___
+}
+} else { # fallback
+$code .= <<___;
+.text
+
+.globl	ossl_hwsm3_block_data_order
+.type ossl_hwsm3_block_data_order,\@abi-omnipotent
+ossl_hwsm3_block_data_order:
+    .byte   0x0f,0x0b    # ud2
+    ret
+.size   ossl_hwsm3_block_data_order, .-ossl_hwsm3_block_data_order
+___
+} # avx2_sm3_ni
+
+if ($avx2_sm3_ni_native > 0) { # SM3 instructions are supported in asm
+  $code =~ s/\`([^\`]*)\`/eval $1/gem;
+  print $code;
+} else { # binary translation for SM3 instructions
+sub sm3op {
+  my $instr = shift;
+  my $args = shift;
+  if ($args =~ /^(.+)\s*#/) {
+    $args = $1; # drop comment and its leading whitespace
+  }
+  if (($instr eq "vsm3msg1") && ($args =~ /%xmm(\d{1,2})\s*,\s*%xmm(\d{1,2})\s*,\s*%xmm(\d{1,2})/)) {
+    my $b1 = sprintf("0x%02x", 0x42 | ((1-int($1/8))<<5) | ((1-int($3/8))<<7) );
+    my $b2 = sprintf("0x%02x", 0x00 | (15 - $2 & 15)<<3                       );
+    my $b3 = sprintf("0x%02x", 0xc0 | ($1 & 7) | (($3 & 7)<<3)                );
+    return ".byte 0xc4,".$b1.",".$b2.",0xda,".$b3;
+  }
+  elsif (($instr eq "vsm3msg2") && ($args =~ /%xmm(\d{1,2})\s*,\s*%xmm(\d{1,2})\s*,\s*%xmm(\d{1,2})/)) {
+    my $b1 = sprintf("0x%02x", 0x42 | ((1-int($1/8))<<5) | ((1-int($3/8))<<7) );
+    my $b2 = sprintf("0x%02x", 0x01 | (15 - $2 & 15)<<3                       );
+    my $b3 = sprintf("0x%02x", 0xc0 | ($1 & 7) | (($3 & 7)<<3)                );
+    return ".byte 0xc4,".$b1.",".$b2.",0xda,".$b3;
+  }
+  elsif (($instr eq "vsm3rnds2") && ($args =~ /\$(0x[0-9a-fA-F]+|\d{1,2})\s*,\s*%xmm(\d{1,2})\s*,\s*%xmm(\d{1,2})\s*,\s*%xmm(\d{1,2})/)) {
+    my $b1 = sprintf("0x%02x", $1                                             );
+    my $b2 = sprintf("0x%02x", 0x43 | ((1-int($2/8))<<5) | ((1-int($4/8))<<7) );
+    my $b3 = sprintf("0x%02x", 0x01 | (15 - $3 & 15)<<3                       );
+    my $b4 = sprintf("0x%02x", 0xc0 | ($2 & 7) | (($4 & 7)<<3)                );
+    return ".byte 0xc4,".$b2.",".$b3.",0xde,".$b4.",".$b1;
+  }
+
+  return $instr."\t".$args;
+}
+
+foreach (split("\n",$code)) {
+  s/\`([^\`]*)\`/eval $1/geo;
+  s/\b(vsm3[^\s]*)\s+(.*)/sm3op($1,$2)/geo;
+  print $_,"\n";
+}
+
+}
+
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/sm3/build.info b/deps/openssl/openssl/crypto/sm3/build.info
index 47ee949d8db..e58916d3178 100644
--- a/deps/openssl/openssl/crypto/sm3/build.info
+++ b/deps/openssl/openssl/crypto/sm3/build.info
@@ -5,9 +5,12 @@ IF[{- !$disabled{sm3} -}]
     $SM3ASM_aarch64=sm3-armv8.S
     $SM3DEF_aarch64=OPENSSL_SM3_ASM

-    $SM3ASM_riscv64=sm3_riscv.c sm3-riscv64-zvksh.S
+    $SM3ASM_riscv64=sm3_riscv.c sm3-riscv64-zbb.S sm3-riscv64-zvksh.S
     $SM3DEF_riscv64=OPENSSL_SM3_ASM

+    $SM3ASM_x86_64=sm3-x86_64.S
+    $SM3DEF_x86_64=OPENSSL_SM3_ASM
+
     # Now that we have defined all the arch specific variables, use the
     # appropriate ones, and define the appropriate macros
     IF[$SM3ASM_{- $target{asm_arch} -}]
@@ -22,6 +25,8 @@ IF[{- !$disabled{sm3} -}]
   GENERATE[sm3-armv8.S]=asm/sm3-armv8.pl
   INCLUDE[sm3-armv8.o]=..

+  GENERATE[sm3-riscv64-zbb.S]=asm/sm3-riscv64-zbb.pl
   GENERATE[sm3-riscv64-zvksh.S]=asm/sm3-riscv64-zvksh.pl
+  GENERATE[sm3-x86_64.S]=asm/sm3-x86_64.pl
 ENDIF

diff --git a/deps/openssl/openssl/crypto/sm3/legacy_sm3.c b/deps/openssl/openssl/crypto/sm3/legacy_sm3.c
index 7f5ee97807a..b71e79af249 100644
--- a/deps/openssl/openssl/crypto/sm3/legacy_sm3.c
+++ b/deps/openssl/openssl/crypto/sm3/legacy_sm3.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2017 Ribose Inc. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -9,19 +9,15 @@
  */

 #include "crypto/evp.h"
-#include "../evp/legacy_meth.h"
 #include "internal/sm3.h"

-IMPLEMENT_LEGACY_EVP_MD_METH_LC(sm3_int, ossl_sm3)
-
 static const EVP_MD sm3_md = {
     NID_sm3,
     NID_sm3WithRSAEncryption,
     SM3_DIGEST_LENGTH,
     0,
     EVP_ORIG_GLOBAL,
-    LEGACY_EVP_MD_METH_TABLE(sm3_int_init, sm3_int_update, sm3_int_final, NULL,
-        SM3_CBLOCK),
+    SM3_CBLOCK
 };

 const EVP_MD *EVP_sm3(void)
diff --git a/deps/openssl/openssl/crypto/sm3/sm3_local.h b/deps/openssl/openssl/crypto/sm3/sm3_local.h
index 762f3bb7e96..ee20db8a1d2 100644
--- a/deps/openssl/openssl/crypto/sm3/sm3_local.h
+++ b/deps/openssl/openssl/crypto/sm3/sm3_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2017 Ribose Inc. All Rights Reserved.
  * Ported from Ribose contributions from Botan.
  *
@@ -9,7 +9,11 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_SM3_SM3_LOCAL_H)
+#define OSSL_LIBCRYPTO_SM3_SM3_LOCAL_H
+
 #include <string.h>
+#include "internal/cryptlib.h"
 #include "internal/sm3.h"

 #define DATA_ORDER_IS_BIG_ENDIAN
@@ -43,15 +47,19 @@

 #if defined(OPENSSL_SM3_ASM)
 #if defined(__aarch64__) || defined(_M_ARM64)
-#include "crypto/arm_arch.h"
+#include "arch/arm_arch.h"
 #define HWSM3_CAPABLE (OPENSSL_armcap_P & ARMV8_SM3)
 void ossl_hwsm3_block_data_order(SM3_CTX *c, const void *p, size_t num);
 #endif
 #if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
-#include "crypto/riscv_arch.h"
+#include "arch/riscv_arch.h"
 #define HWSM3_CAPABLE 1
 void ossl_hwsm3_block_data_order(SM3_CTX *c, const void *p, size_t num);
 #endif
+#if (defined(__x86_64) || defined(__x86_64__) || defined(_M_X64))
+#define HWSM3_CAPABLE ((OPENSSL_ia32cap_P[2] & (1 << 5)) && (OPENSSL_ia32cap_P[5] & (1 << 1)))
+void ossl_hwsm3_block_data_order(SM3_CTX *c, const void *p, size_t num);
+#endif
 #endif

 #if defined(HWSM3_CAPABLE)
@@ -64,10 +72,12 @@ void ossl_hwsm3_block_data_order(SM3_CTX *c, const void *p, size_t num);
 void ossl_sm3_block_data_order(SM3_CTX *c, const void *p, size_t num);
 void ossl_sm3_transform(SM3_CTX *c, const unsigned char *data);

-#include "crypto/md32_common.h"
+/* clang-format off */
+#include "crypto/md32_common.inc"
+/* clang-format on */

 #ifndef PEDANTIC
-#if defined(__GNUC__) && __GNUC__ >= 2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
+#if defined(__GNUC__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 #if defined(__riscv_zksh)
 #define P0(x) ({ MD32_REG_T ret;        \
                        asm ("sm3p0 %0, %1" \
@@ -124,3 +134,5 @@ void ossl_sm3_transform(SM3_CTX *c, const unsigned char *data);
 #define SM3_F 0x163138aaUL
 #define SM3_G 0xe38dee4dUL
 #define SM3_H 0xb0fb0e4eUL
+
+#endif /* !defined(OSSL_LIBCRYPTO_SM3_SM3_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/sm3/sm3_riscv.c b/deps/openssl/openssl/crypto/sm3/sm3_riscv.c
index 21ee3772b01..961b7f107c9 100644
--- a/deps/openssl/openssl/crypto/sm3/sm3_riscv.c
+++ b/deps/openssl/openssl/crypto/sm3/sm3_riscv.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,17 +12,20 @@

 #include <openssl/opensslconf.h>
 #include "internal/sm3.h"
-#include "crypto/riscv_arch.h"
+#include "arch/riscv_arch.h"
 #include <stdio.h>

 void ossl_hwsm3_block_data_order_zvksh(SM3_CTX *c, const void *p, size_t num);
 void ossl_sm3_block_data_order(SM3_CTX *c, const void *p, size_t num);
+void ossl_sm3_block_data_order_zbb(SM3_CTX *c, const void *p, size_t num);
 void ossl_hwsm3_block_data_order(SM3_CTX *c, const void *p, size_t num);

 void ossl_hwsm3_block_data_order(SM3_CTX *c, const void *p, size_t num)
 {
     if (RISCV_HAS_ZVKB_AND_ZVKSH() && riscv_vlen() >= 128) {
         ossl_hwsm3_block_data_order_zvksh(c, p, num);
+    } else if (RISCV_HAS_ZBB()) {
+        ossl_sm3_block_data_order_zbb(c, p, num);
     } else {
         ossl_sm3_block_data_order(c, p, num);
     }
diff --git a/deps/openssl/openssl/crypto/sm4/asm/sm4-armv8.pl b/deps/openssl/openssl/crypto/sm4/asm/sm4-armv8.pl
index 1fe12dead49..602059d7b39 100755
--- a/deps/openssl/openssl/crypto/sm4/asm/sm4-armv8.pl
+++ b/deps/openssl/openssl/crypto/sm4/asm/sm4-armv8.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -111,7 +111,7 @@ ___
 }

 $code=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"
 .arch	armv8-a+crypto
 .text
 ___
diff --git a/deps/openssl/openssl/crypto/sm4/asm/sm4-riscv64-zvksed.pl b/deps/openssl/openssl/crypto/sm4/asm/sm4-riscv64-zvksed.pl
index 0734e5fa4c7..7fa3ff5ff8c 100644
--- a/deps/openssl/openssl/crypto/sm4/asm/sm4-riscv64-zvksed.pl
+++ b/deps/openssl/openssl/crypto/sm4/asm/sm4-riscv64-zvksed.pl
@@ -2,7 +2,7 @@
 # This file is dual-licensed, meaning that you can use it under your
 # choice of either of the following two licenses:
 #
-# Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License"). You can obtain
 # a copy in the file LICENSE in the source distribution or at
@@ -59,6 +59,559 @@ my $code=<<___;
 .text
 ___

+my $BLOCK_SIZE = 16;
+my $STRIDE = -4;  # Used for reversing word order
+my $FOUR_BLOCKS = 64;
+my $EIGHT_BLOCKS = 128;
+my ($vk0,$vk1,$vk2,$vk3,$vk4,$vk5,$vk6,$vk7)=("v16","v17","v18","v19","v20","v21","v22","v23");
+my ($tmp_stride,$tmp_base)=("t1","t2");
+# Loading with word order reversed
+sub reverse_order_L {
+    my $vreg = shift;
+    my $base_reg = shift;
+
+    return <<___;
+        addi $tmp_base, $base_reg, 12
+        @{[vlse32_v $vreg, $tmp_base, $tmp_stride]}
+___
+}
+
+# Storing with word order reversed
+sub reverse_order_S {
+    my $vreg = shift;
+    my $base_reg = shift;
+
+    return <<___;
+        addi $tmp_base, $base_reg, 12
+        @{[vsse32_v $vreg, $tmp_base, $tmp_stride]}
+___
+}
+
+# Load 32 round keys
+sub enc_load_key {
+    my $keys = shift;
+
+    my $code=<<___;
+    # Order of elements was adjusted in set_encrypt_key()
+    @{[vle32_v $vk0, $keys]} # rk[0:3]
+    addi $keys, $keys, $BLOCK_SIZE
+    @{[vle32_v $vk1, $keys]} # rk[4:7]
+    addi $keys, $keys, $BLOCK_SIZE
+    @{[vle32_v $vk2, $keys]} # rk[8:11]
+    addi $keys, $keys, $BLOCK_SIZE
+    @{[vle32_v $vk3, $keys]} # rk[12:15]
+    addi $keys, $keys, $BLOCK_SIZE
+    @{[vle32_v $vk4, $keys]} # rk[16:19]
+    addi $keys, $keys, $BLOCK_SIZE
+    @{[vle32_v $vk5, $keys]} # rk[20:23]
+    addi $keys, $keys, $BLOCK_SIZE
+    @{[vle32_v $vk6, $keys]} # rk[24:27]
+    addi $keys, $keys, $BLOCK_SIZE
+    @{[vle32_v $vk7, $keys]} # rk[28:31]
+___
+
+    return $code;
+}
+
+sub dec_load_key {
+    my $keys = shift;
+
+    my $code=<<___;
+    # Order of elements was adjusted in set_decrypt_key()
+    @{[vle32_v $vk7, $keys]} # rk[31:28]
+    addi $keys, $keys, $BLOCK_SIZE
+    @{[vle32_v $vk6, $keys]} # rk[27:24]
+    addi $keys, $keys, $BLOCK_SIZE
+    @{[vle32_v $vk5, $keys]} # rk[23:20]
+    addi $keys, $keys, $BLOCK_SIZE
+    @{[vle32_v $vk4, $keys]} # rk[19:16]
+    addi $keys, $keys, $BLOCK_SIZE
+    @{[vle32_v $vk3, $keys]} # rk[15:12]
+    addi $keys, $keys, $BLOCK_SIZE
+    @{[vle32_v $vk2, $keys]} # rk[11:8]
+    addi $keys, $keys, $BLOCK_SIZE
+    @{[vle32_v $vk1, $keys]} # rk[7:4]
+    addi $keys, $keys, $BLOCK_SIZE
+    @{[vle32_v $vk0, $keys]} # rk[3:0]
+___
+
+    return $code;
+}
+
+# Encrypt with all keys
+sub enc_blk {
+    my $data = shift;
+
+    my $code=<<___;
+    @{[vsm4r_vs $data, $vk0]}
+    @{[vsm4r_vs $data, $vk1]}
+    @{[vsm4r_vs $data, $vk2]}
+    @{[vsm4r_vs $data, $vk3]}
+    @{[vsm4r_vs $data, $vk4]}
+    @{[vsm4r_vs $data, $vk5]}
+    @{[vsm4r_vs $data, $vk6]}
+    @{[vsm4r_vs $data, $vk7]}
+___
+
+    return $code;
+}
+
+# Decrypt with all keys
+sub dec_blk {
+    my $data = shift;
+
+    my $code=<<___;
+    @{[vsm4r_vs $data, $vk7]}
+    @{[vsm4r_vs $data, $vk6]}
+    @{[vsm4r_vs $data, $vk5]}
+    @{[vsm4r_vs $data, $vk4]}
+    @{[vsm4r_vs $data, $vk3]}
+    @{[vsm4r_vs $data, $vk2]}
+    @{[vsm4r_vs $data, $vk1]}
+    @{[vsm4r_vs $data, $vk0]}
+___
+
+    return $code;
+}
+
+# Decrypt 4 blocks with all keys
+sub dec_4blks {
+    my $data0 = shift;
+    my $data1 = shift;
+    my $data2 = shift;
+    my $data3 = shift;
+
+    my $code=<<___;
+    @{[vsm4r_vs $data0, $vk7]}
+    @{[vsm4r_vs $data1, $vk7]}
+    @{[vsm4r_vs $data2, $vk7]}
+    @{[vsm4r_vs $data3, $vk7]}
+
+    @{[vsm4r_vs $data0, $vk6]}
+    @{[vsm4r_vs $data1, $vk6]}
+    @{[vsm4r_vs $data2, $vk6]}
+    @{[vsm4r_vs $data3, $vk6]}
+
+    @{[vsm4r_vs $data0, $vk5]}
+    @{[vsm4r_vs $data1, $vk5]}
+    @{[vsm4r_vs $data2, $vk5]}
+    @{[vsm4r_vs $data3, $vk5]}
+
+    @{[vsm4r_vs $data0, $vk4]}
+    @{[vsm4r_vs $data1, $vk4]}
+    @{[vsm4r_vs $data2, $vk4]}
+    @{[vsm4r_vs $data3, $vk4]}
+
+    @{[vsm4r_vs $data0, $vk3]}
+    @{[vsm4r_vs $data1, $vk3]}
+    @{[vsm4r_vs $data2, $vk3]}
+    @{[vsm4r_vs $data3, $vk3]}
+
+    @{[vsm4r_vs $data0, $vk2]}
+    @{[vsm4r_vs $data1, $vk2]}
+    @{[vsm4r_vs $data2, $vk2]}
+    @{[vsm4r_vs $data3, $vk2]}
+
+    @{[vsm4r_vs $data0, $vk1]}
+    @{[vsm4r_vs $data1, $vk1]}
+    @{[vsm4r_vs $data2, $vk1]}
+    @{[vsm4r_vs $data3, $vk1]}
+
+    @{[vsm4r_vs $data0, $vk0]}
+    @{[vsm4r_vs $data1, $vk0]}
+    @{[vsm4r_vs $data2, $vk0]}
+    @{[vsm4r_vs $data3, $vk0]}
+___
+
+    return $code;
+}
+
+####
+# void rv64i_zvksed_sm4_cbc_encrypt(const unsigned char *in, unsigned char *out,
+#                                   size_t len, const SM4_KEY *key,
+#                                   unsigned char *iv, int enc);
+#
+{
+my ($in,$out,$len,$keys,$ivp)=("a0","a1","a2","a3","a4");
+my ($tmp,$base)=("t0","t2");
+my ($vdata0,$vdata1,$vdata2,$vdata3,$vdata4,$vdata5,$vdata6,$vdata7)=("v1","v2","v3","v4","v5","v6","v7","v24");
+my ($vivec)=("v8");
+my ($vindex)=("v0");
+
+$code .= <<___;
+.section .rodata
+.align 4
+.Lreverse_index:
+    .word 3, 2, 1, 0
+.text
+.p2align 3
+.globl rv64i_zvksed_sm4_cbc_encrypt
+.type rv64i_zvksed_sm4_cbc_encrypt,\@function
+rv64i_zvksed_sm4_cbc_encrypt:
+    # check whether the length is a multiple of 16 and >= 16
+    li $tmp, $BLOCK_SIZE
+    bltu $len, $tmp, .Lcbc_enc_end
+    andi $tmp, $len, 15
+    bnez $tmp, .Lcbc_enc_end
+
+    @{[vsetivli "zero", 4, "e32", "m1", "ta", "ma"]}
+    # Load 32 round keys
+    @{[enc_load_key $keys]}
+
+    # Load IV
+    @{[vle32_v $vivec, $ivp]}
+
+    # Load the reverse index (for IV updates)
+    la $tmp, .Lreverse_index
+    @{[vle32_v $vindex, $tmp]}
+# =====================================================
+# If data length ≥ 64 bytes, process 4 blocks in batch:
+# 4-block CBC encryption pipeline:
+#   1. Load 4 plaintext blocks
+#   2. Reverse bytes for SM4 endianness
+#   3. Perform XOR operation with IV or previous ciphertext block (CBC chain)
+#   4. Encrypt each data block using the enc_blk function
+#   5. Adjust the byte order and store the ciphertext block
+#   6. Update the initialization vector (IV)
+# If data length < 64 bytes, process it block by block using the Lcbc_enc_single function
+# =====================================================
+.Lcbc_enc_loop:
+    li $tmp, $FOUR_BLOCKS
+    bltu $len, $tmp, .Lcbc_enc_single
+    # Load input data0-data3
+    @{[vle32_v $vdata0, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    @{[vle32_v $vdata1, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    @{[vle32_v $vdata2, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    @{[vle32_v $vdata3, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    #XOR with IV
+    @{[vxor_vv $vdata0, $vdata0, $vivec]}
+
+    @{[vrev8_v $vdata0, $vdata0]}
+    # Encrypt with all keys
+    @{[enc_blk $vdata0]}
+    @{[vrev8_v $vdata0, $vdata0]}
+
+    #Update IV to ciphertext block 0
+    @{[vrgather_vv $vivec, $vdata0, $vindex]}
+
+    @{[vxor_vv $vdata1, $vdata1, $vivec]}
+
+    @{[vrev8_v $vdata1, $vdata1]}
+    @{[enc_blk $vdata1]}
+    @{[vrev8_v $vdata1, $vdata1]}
+
+    #Update IV to ciphertext block 1
+    @{[vrgather_vv $vivec, $vdata1, $vindex]}
+
+    @{[vxor_vv $vdata2, $vdata2, $vivec]}
+
+    @{[vrev8_v $vdata2, $vdata2]}
+    @{[enc_blk $vdata2]}
+    @{[vrev8_v $vdata2, $vdata2]}
+
+    #Update IV to ciphertext block 2
+    @{[vrgather_vv $vivec, $vdata2, $vindex]}
+
+    @{[vxor_vv $vdata3, $vdata3, $vivec]}
+
+    @{[vrev8_v $vdata3, $vdata3]}
+    @{[enc_blk $vdata3]}
+    @{[vrev8_v $vdata3, $vdata3]}
+
+    #Update IV to ciphertext block 3
+    @{[vrgather_vv $vivec, $vdata3, $vindex]}
+
+    # Save the ciphertext (in reverse element order)
+    li $tmp_stride, $STRIDE
+    @{[reverse_order_S $vdata0, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    @{[reverse_order_S $vdata1, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    @{[reverse_order_S $vdata2, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    @{[reverse_order_S $vdata3, $out]}
+    addi $out, $out, $BLOCK_SIZE
+
+    addi $len, $len, -$FOUR_BLOCKS
+    bnez $len, .Lcbc_enc_loop
+    #Save the final IV
+    @{[vse32_v $vivec, $ivp]}
+    ret
+
+.Lcbc_enc_single:
+    # Load input data0
+    @{[vle32_v $vdata0, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    #XOR with IV
+    @{[vxor_vv $vdata0, $vdata0, $vivec]}
+
+    @{[vrev8_v $vdata0, $vdata0]}
+    # Encrypt with all keys
+    @{[enc_blk $vdata0]}
+    @{[vrev8_v $vdata0, $vdata0]}
+
+    # Update IV to ciphertext block 0
+    @{[vrgather_vv $vivec, $vdata0, $vindex]}
+
+    # Save the ciphertext (in reverse element order)
+    li $tmp_stride, $STRIDE
+    @{[reverse_order_S $vdata0, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    addi $len, $len, -$BLOCK_SIZE
+
+    li $tmp, $BLOCK_SIZE
+    bgeu $len, $tmp, .Lcbc_enc_single
+    # Save the final IV
+    @{[vse32_v $vivec, $ivp]}
+.Lcbc_enc_end:
+    ret
+.size rv64i_zvksed_sm4_cbc_encrypt,.-rv64i_zvksed_sm4_cbc_encrypt
+___
+
+####
+# void rv64i_zvksed_sm4_cbc_decrypt(const unsigned char *in, unsigned char *out,
+#                                   size_t len, const SM4_KEY *key,
+#                                   unsigned char *iv, int enc);
+#
+$code .= <<___;
+.p2align 3
+.globl rv64i_zvksed_sm4_cbc_decrypt
+.type rv64i_zvksed_sm4_cbc_decrypt,\@function
+rv64i_zvksed_sm4_cbc_decrypt:
+    # check whether the length is a multiple of 16 and >= 16
+    li $tmp, $BLOCK_SIZE
+    bltu $len, $tmp, .Lcbc_dec_end
+    andi $tmp, $len, 15
+    bnez $tmp, .Lcbc_dec_end
+
+    @{[vsetivli "zero", 4, "e32", "m1", "ta", "ma"]}
+    # Load IV (in reverse element order)
+    li $tmp_stride, $STRIDE
+    @{[reverse_order_L $vivec, $ivp]}
+
+    # Load 32 round keys
+    @{[dec_load_key $keys]}
+# =====================================================
+# If data length ≥ 128 bytes, process 8 blocks in batch:
+# 8-block CBC decryption pipeline:
+#   1. Load 8 ciphertext blocks
+#   2. Reverse bytes for SM4 endianness
+#   3. Use two calls to dec_4blks for decrypting each data block
+#   4. XOR with previous ciphertext block (CBC chain)
+#   5. Update IV and store plaintext with byte reversal
+# =====================================================
+.Lcbc_dec_loop:
+    li $tmp, $EIGHT_BLOCKS
+    bltu $len, $tmp, .Lcbc_check_64
+    # Load input data0-data7
+    @{[vle32_v $vdata0, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    @{[vle32_v $vdata1, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    @{[vle32_v $vdata2, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    @{[vle32_v $vdata3, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    @{[vle32_v $vdata4, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    @{[vle32_v $vdata5, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    @{[vle32_v $vdata6, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    @{[vle32_v $vdata7, $in]}
+    addi $in, $in, $BLOCK_SIZE
+
+    @{[vrev8_v $vdata0, $vdata0]}
+    @{[vrev8_v $vdata1, $vdata1]}
+    @{[vrev8_v $vdata2, $vdata2]}
+    @{[vrev8_v $vdata3, $vdata3]}
+    @{[vrev8_v $vdata4, $vdata4]}
+    @{[vrev8_v $vdata5, $vdata5]}
+    @{[vrev8_v $vdata6, $vdata6]}
+    @{[vrev8_v $vdata7, $vdata7]}
+    # Decrypt 8 data blocks
+    @{[dec_4blks $vdata0,$vdata1,$vdata2,$vdata3]}
+    @{[dec_4blks $vdata4,$vdata5,$vdata6,$vdata7]}
+    @{[vrev8_v $vdata0, $vdata0]}
+    @{[vrev8_v $vdata1, $vdata1]}
+    @{[vrev8_v $vdata2, $vdata2]}
+    @{[vrev8_v $vdata3, $vdata3]}
+    @{[vrev8_v $vdata4, $vdata4]}
+    @{[vrev8_v $vdata5, $vdata5]}
+    @{[vrev8_v $vdata6, $vdata6]}
+    @{[vrev8_v $vdata7, $vdata7]}
+
+    @{[vxor_vv $vdata0, $vdata0, $vivec]}
+
+    # Update ciphertext to IV (in reverse element order)
+    addi $base, $in, -128
+    @{[reverse_order_L $vivec, $base]}
+
+    @{[vxor_vv $vdata1, $vdata1, $vivec]}
+
+    addi $base, $in, -112
+    @{[reverse_order_L $vivec, $base]}
+
+    @{[vxor_vv $vdata2, $vdata2, $vivec]}
+
+    addi $base, $in, -96
+    @{[reverse_order_L $vivec, $base]}
+
+    @{[vxor_vv $vdata3, $vdata3, $vivec]}
+
+    addi $base, $in, -80
+    @{[reverse_order_L $vivec, $base]}
+
+    @{[vxor_vv $vdata4, $vdata4, $vivec]}
+
+    addi $base, $in, -64
+    @{[reverse_order_L $vivec, $base]}
+
+    @{[vxor_vv $vdata5, $vdata5, $vivec]}
+
+    addi $base, $in, -48
+    @{[reverse_order_L $vivec, $base]}
+
+    @{[vxor_vv $vdata6, $vdata6, $vivec]}
+
+    addi $base, $in, -32
+    @{[reverse_order_L $vivec, $base]}
+
+    @{[vxor_vv $vdata7, $vdata7, $vivec]}
+
+    addi $base, $in, -16
+    @{[reverse_order_L $vivec, $base]}
+
+    # Save the plaintext (in reverse element order)
+    @{[reverse_order_S $vdata0, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    @{[reverse_order_S $vdata1, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    @{[reverse_order_S $vdata2, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    @{[reverse_order_S $vdata3, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    @{[reverse_order_S $vdata4, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    @{[reverse_order_S $vdata5, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    @{[reverse_order_S $vdata6, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    @{[reverse_order_S $vdata7, $out]}
+    addi $out, $out, $BLOCK_SIZE
+
+    addi $len, $len, -$EIGHT_BLOCKS
+    bnez $len, .Lcbc_dec_loop
+    #Save the final IV (in reverse element order)
+    @{[reverse_order_S $vivec, $ivp]}
+    ret
+# =====================================================
+# If data length ≥ 64 bytes, process in batches of 4 blocks:
+# 4-block CBC decryption process:
+#   1. Load 4 ciphertext blocks
+#   2. Reverse byte order to fit SM4 byte order
+#   3. Decrypt each data block using the dec_4blks function
+#   4. XOR with previous ciphertext block (CBC chain)
+#   5. Update IV and store plaintext with byte reversal
+# If the data length is less than 64 bytes, process it block by block using the Lcbc_dec_single function
+# =====================================================
+.Lcbc_check_64:
+    li $tmp, $FOUR_BLOCKS
+    bltu $len, $tmp, .Lcbc_dec_single
+    # Load input data0-data3
+    @{[vle32_v $vdata0, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    @{[vle32_v $vdata1, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    @{[vle32_v $vdata2, $in]}
+    addi $in, $in, $BLOCK_SIZE
+    @{[vle32_v $vdata3, $in]}
+    addi $in, $in, $BLOCK_SIZE
+
+    @{[vrev8_v $vdata0, $vdata0]}
+    @{[vrev8_v $vdata1, $vdata1]}
+    @{[vrev8_v $vdata2, $vdata2]}
+    @{[vrev8_v $vdata3, $vdata3]}
+    # Decrypt 4 data blocks
+    @{[dec_4blks $vdata0,$vdata1,$vdata2,$vdata3]}
+    @{[vrev8_v $vdata0, $vdata0]}
+    @{[vrev8_v $vdata1, $vdata1]}
+    @{[vrev8_v $vdata2, $vdata2]}
+    @{[vrev8_v $vdata3, $vdata3]}
+
+    @{[vxor_vv $vdata0, $vdata0, $vivec]}
+
+    # Update ciphertext to IV (in reverse element order)
+    addi $base, $in, -64
+    @{[reverse_order_L $vivec, $base]}
+
+    @{[vxor_vv $vdata1, $vdata1, $vivec]}
+
+    addi $base, $in, -48
+    @{[reverse_order_L $vivec, $base]}
+
+    @{[vxor_vv $vdata2, $vdata2, $vivec]}
+
+    addi $base, $in, -32
+    @{[reverse_order_L $vivec, $base]}
+
+    @{[vxor_vv $vdata3, $vdata3, $vivec]}
+
+    addi $base, $in, -16
+    @{[reverse_order_L $vivec, $base]}
+
+    # Save the plaintext (in reverse element order)
+    @{[reverse_order_S $vdata0, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    @{[reverse_order_S $vdata1, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    @{[reverse_order_S $vdata2, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    @{[reverse_order_S $vdata3, $out]}
+    addi $out, $out, $BLOCK_SIZE
+
+    addi $len, $len, -$FOUR_BLOCKS
+    bnez $len, .Lcbc_check_64
+    #Save the final IV (in reverse element order)
+    @{[reverse_order_S $vivec, $ivp]}
+    ret
+
+.Lcbc_dec_single:
+    # Load input data0
+    @{[vle32_v $vdata0, $in]}
+    addi $in, $in, $BLOCK_SIZE
+
+    @{[vrev8_v $vdata0, $vdata0]}
+    # Decrypt with all keys
+    @{[dec_blk $vdata0]}
+    @{[vrev8_v $vdata0, $vdata0]}
+
+    #XOR with IV
+    @{[vxor_vv $vdata0, $vdata0, $vivec]}
+
+    # Update ciphertext to IV (in reverse element order)
+    li $tmp_stride, $STRIDE
+    addi $base, $in, -$BLOCK_SIZE
+    @{[reverse_order_L $vivec, $base]}
+    # Save the plaintext (in reverse element order)
+    @{[reverse_order_S $vdata0, $out]}
+    addi $out, $out, $BLOCK_SIZE
+    addi $len, $len, -$BLOCK_SIZE
+
+    li $tmp, $BLOCK_SIZE
+    bgeu $len, $tmp, .Lcbc_dec_single
+    #Save the final IV (in reverse element order)
+    @{[reverse_order_S $vivec, $ivp]}
+.Lcbc_dec_end:
+    ret
+.size rv64i_zvksed_sm4_cbc_decrypt,.-rv64i_zvksed_sm4_cbc_decrypt
+___
+}
+
 ####
 # int rv64i_zvksed_sm4_set_encrypt_key(const unsigned char *userKey,
 #                                      SM4_KEY *key);
@@ -94,19 +647,19 @@ rv64i_zvksed_sm4_set_encrypt_key:

     # Store round keys
     @{[vse32_v $vk0, $keys]} # rk[0:3]
-    addi $keys, $keys, 16
+    addi $keys, $keys, $BLOCK_SIZE
     @{[vse32_v $vk1, $keys]} # rk[4:7]
-    addi $keys, $keys, 16
+    addi $keys, $keys, $BLOCK_SIZE
     @{[vse32_v $vk2, $keys]} # rk[8:11]
-    addi $keys, $keys, 16
+    addi $keys, $keys, $BLOCK_SIZE
     @{[vse32_v $vk3, $keys]} # rk[12:15]
-    addi $keys, $keys, 16
+    addi $keys, $keys, $BLOCK_SIZE
     @{[vse32_v $vk4, $keys]} # rk[16:19]
-    addi $keys, $keys, 16
+    addi $keys, $keys, $BLOCK_SIZE
     @{[vse32_v $vk5, $keys]} # rk[20:23]
-    addi $keys, $keys, 16
+    addi $keys, $keys, $BLOCK_SIZE
     @{[vse32_v $vk6, $keys]} # rk[24:27]
-    addi $keys, $keys, 16
+    addi $keys, $keys, $BLOCK_SIZE
     @{[vse32_v $vk7, $keys]} # rk[28:31]

     li a0, 1
@@ -150,21 +703,21 @@ rv64i_zvksed_sm4_set_decrypt_key:

     # Store round keys in reverse order
     addi $keys, $keys, 12
-    li $stride, -4
+    li $stride, $STRIDE
     @{[vsse32_v $vk7, $keys, $stride]} # rk[31:28]
-    addi $keys, $keys, 16
+    addi $keys, $keys, $BLOCK_SIZE
     @{[vsse32_v $vk6, $keys, $stride]} # rk[27:24]
-    addi $keys, $keys, 16
+    addi $keys, $keys, $BLOCK_SIZE
     @{[vsse32_v $vk5, $keys, $stride]} # rk[23:20]
-    addi $keys, $keys, 16
+    addi $keys, $keys, $BLOCK_SIZE
     @{[vsse32_v $vk4, $keys, $stride]} # rk[19:16]
-    addi $keys, $keys, 16
+    addi $keys, $keys, $BLOCK_SIZE
     @{[vsse32_v $vk3, $keys, $stride]} # rk[15:12]
-    addi $keys, $keys, 16
+    addi $keys, $keys, $BLOCK_SIZE
     @{[vsse32_v $vk2, $keys, $stride]} # rk[11:8]
-    addi $keys, $keys, 16
+    addi $keys, $keys, $BLOCK_SIZE
     @{[vsse32_v $vk1, $keys, $stride]} # rk[7:4]
-    addi $keys, $keys, 16
+    addi $keys, $keys, $BLOCK_SIZE
     @{[vsse32_v $vk0, $keys, $stride]} # rk[3:0]

     li a0, 1
@@ -178,8 +731,8 @@ ___
 #                               const SM4_KEY *key);
 #
 {
-my ($in,$out,$keys,$stride)=("a0","a1","a2","t0");
-my ($vdata,$vk0,$vk1,$vk2,$vk3,$vk4,$vk5,$vk6,$vk7,$vgen)=("v1","v2","v3","v4","v5","v6","v7","v8","v9","v10");
+my ($in,$out,$keys)=("a0","a1","a2");
+my ($vdata)=("v1");
 $code .= <<___;
 .p2align 3
 .globl rv64i_zvksed_sm4_encrypt
@@ -187,42 +740,19 @@ $code .= <<___;
 rv64i_zvksed_sm4_encrypt:
     @{[vsetivli__x0_4_e32_m1_tu_mu]}

-    # Order of elements was adjusted in set_encrypt_key()
-    @{[vle32_v $vk0, $keys]} # rk[0:3]
-    addi $keys, $keys, 16
-    @{[vle32_v $vk1, $keys]} # rk[4:7]
-    addi $keys, $keys, 16
-    @{[vle32_v $vk2, $keys]} # rk[8:11]
-    addi $keys, $keys, 16
-    @{[vle32_v $vk3, $keys]} # rk[12:15]
-    addi $keys, $keys, 16
-    @{[vle32_v $vk4, $keys]} # rk[16:19]
-    addi $keys, $keys, 16
-    @{[vle32_v $vk5, $keys]} # rk[20:23]
-    addi $keys, $keys, 16
-    @{[vle32_v $vk6, $keys]} # rk[24:27]
-    addi $keys, $keys, 16
-    @{[vle32_v $vk7, $keys]} # rk[28:31]
+    @{[enc_load_key $keys]}

     # Load input data
     @{[vle32_v $vdata, $in]}
     @{[vrev8_v $vdata, $vdata]}

     # Encrypt with all keys
-    @{[vsm4r_vs $vdata, $vk0]}
-    @{[vsm4r_vs $vdata, $vk1]}
-    @{[vsm4r_vs $vdata, $vk2]}
-    @{[vsm4r_vs $vdata, $vk3]}
-    @{[vsm4r_vs $vdata, $vk4]}
-    @{[vsm4r_vs $vdata, $vk5]}
-    @{[vsm4r_vs $vdata, $vk6]}
-    @{[vsm4r_vs $vdata, $vk7]}
+    @{[enc_blk $vdata]}

     # Save the ciphertext (in reverse element order)
     @{[vrev8_v $vdata, $vdata]}
-    li $stride, -4
-    addi $out, $out, 12
-    @{[vsse32_v $vdata, $out, $stride]}
+    li $tmp_stride, $STRIDE
+    @{[reverse_order_S $vdata, $out]}

     ret
 .size rv64i_zvksed_sm4_encrypt,.-rv64i_zvksed_sm4_encrypt
@@ -234,8 +764,8 @@ ___
 #                               const SM4_KEY *key);
 #
 {
-my ($in,$out,$keys,$stride)=("a0","a1","a2","t0");
-my ($vdata,$vk0,$vk1,$vk2,$vk3,$vk4,$vk5,$vk6,$vk7,$vgen)=("v1","v2","v3","v4","v5","v6","v7","v8","v9","v10");
+my ($in,$out,$keys)=("a0","a1","a2");
+my ($vdata)=("v1");
 $code .= <<___;
 .p2align 3
 .globl rv64i_zvksed_sm4_decrypt
@@ -243,42 +773,19 @@ $code .= <<___;
 rv64i_zvksed_sm4_decrypt:
     @{[vsetivli__x0_4_e32_m1_tu_mu]}

-    # Order of elements was adjusted in set_decrypt_key()
-    @{[vle32_v $vk7, $keys]} # rk[31:28]
-    addi $keys, $keys, 16
-    @{[vle32_v $vk6, $keys]} # rk[27:24]
-    addi $keys, $keys, 16
-    @{[vle32_v $vk5, $keys]} # rk[23:20]
-    addi $keys, $keys, 16
-    @{[vle32_v $vk4, $keys]} # rk[19:16]
-    addi $keys, $keys, 16
-    @{[vle32_v $vk3, $keys]} # rk[15:11]
-    addi $keys, $keys, 16
-    @{[vle32_v $vk2, $keys]} # rk[11:8]
-    addi $keys, $keys, 16
-    @{[vle32_v $vk1, $keys]} # rk[7:4]
-    addi $keys, $keys, 16
-    @{[vle32_v $vk0, $keys]} # rk[3:0]
+    @{[dec_load_key $keys]}

     # Load input data
     @{[vle32_v $vdata, $in]}
     @{[vrev8_v $vdata, $vdata]}

-    # Encrypt with all keys
-    @{[vsm4r_vs $vdata, $vk7]}
-    @{[vsm4r_vs $vdata, $vk6]}
-    @{[vsm4r_vs $vdata, $vk5]}
-    @{[vsm4r_vs $vdata, $vk4]}
-    @{[vsm4r_vs $vdata, $vk3]}
-    @{[vsm4r_vs $vdata, $vk2]}
-    @{[vsm4r_vs $vdata, $vk1]}
-    @{[vsm4r_vs $vdata, $vk0]}
+    # Decrypt with all keys
+    @{[dec_blk $vdata]}

-    # Save the ciphertext (in reverse element order)
+    # Save the plaintext (in reverse element order)
     @{[vrev8_v $vdata, $vdata]}
-    li $stride, -4
-    addi $out, $out, 12
-    @{[vsse32_v $vdata, $out, $stride]}
+    li $tmp_stride, $STRIDE
+    @{[reverse_order_S $vdata, $out]}

     ret
 .size rv64i_zvksed_sm4_decrypt,.-rv64i_zvksed_sm4_decrypt
diff --git a/deps/openssl/openssl/crypto/sm4/asm/sm4-x86_64.pl b/deps/openssl/openssl/crypto/sm4/asm/sm4-x86_64.pl
new file mode 100644
index 00000000000..ec7d3f2b373
--- /dev/null
+++ b/deps/openssl/openssl/crypto/sm4/asm/sm4-x86_64.pl
@@ -0,0 +1,312 @@
+#! /usr/bin/env perl
+# Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright (c) 2025, Intel Corporation. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+#
+#
+# This module implements support for Intel(R) SM4 instructions
+# from Intel(R) Multi-Buffer Crypto for IPsec Library
+# (https://github.com/intel/intel-ipsec-mb).
+# Original author is Tomasz Kantecki <tomasz.kantecki@intel.com>
+
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
+$win64=0;
+$win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/);
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/;
+$dir=$1;
+( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or
+( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
+die "can't locate x86_64-xlate.pl";
+
+# Check Intel(R) SM4 instructions support
+if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`
+        =~ /GNU assembler version ([2-9]\.[0-9]+)/) {
+    $avx2_sm4_ni = ($1>=2.22); # minimal avx2 supported version, binary translation for SM4 instructions (sub sm4op) is used
+    $avx2_sm4_ni_native = ($1>=2.42); # support added at GNU asm 2.42
+}
+
+if (!$avx2_sm4_ni && $win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&
+       `nasm -v 2>&1` =~ /NASM version ([2-9])\.([0-9]+)(?:\.([0-9]+))?/) {
+    my ($major, $minor, $patch) = ($1, $2, defined($3) ? $3 : 0);
+    $avx2_sm4_ni = ($major > 2) || ($major == 2 && $minor > 10); # minimal avx2 supported version, binary translation for SM4 instructions (sub sm4op) is used
+    $avx2_sm4_ni_native = ($major > 2) || ($major == 2 && $minor > 16) || ($major == 2 && $minor == 16 && $patch >= 2); # support added at NASM 2.16.02
+}
+
+if (!$avx2_sm4_ni && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) {
+    $avx2_sm4_ni = ($2>=7.0); # minimal tested version, binary translation for SM4 instructions (sub sm4op) is used
+    $avx2_sm4_ni_native = ($2>=17.0); # support added at LLVM 17.0.1
+}
+
+open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
+    or die "can't call $xlate: $!";
+*STDOUT=*OUT;
+
+$prefix="hw_x86_64_sm4";
+
+if ($avx2_sm4_ni>0) {
+
+$code.= ".text\n";
+{
+# input arguments aliases for set_key
+my ($userKey,$key) = ("%rdi","%rsi");
+
+# input arguments aliases for encrypt/decrypt
+my ($in,$out,$ks) = ("%rdi","%rsi","%rdx");
+
+$code.=<<___;
+.section .rodata align=64
+.align 16
+SM4_FK:
+.long 0xa3b1bac6, 0x56aa3350, 0x677d9197, 0xb27022dc
+
+.align 16
+SM4_CK:
+.long 0x00070E15, 0x1C232A31, 0x383F464D, 0x545B6269
+.long 0x70777E85, 0x8C939AA1, 0xA8AFB6BD, 0xC4CBD2D9
+.long 0xE0E7EEF5, 0xFC030A11, 0x181F262D, 0x343B4249
+.long 0x50575E65, 0x6C737A81, 0x888F969D, 0xA4ABB2B9
+.long 0xC0C7CED5, 0xDCE3EAF1, 0xF8FF060D, 0x141B2229
+.long 0x30373E45, 0x4C535A61, 0x686F767D, 0x848B9299
+.long 0xA0A7AEB5, 0xBCC3CAD1, 0xD8DFE6ED, 0xF4FB0209
+.long 0x10171E25, 0x2C333A41, 0x484F565D, 0x646B7279
+
+IN_SHUFB:
+.byte 0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x05, 0x04
+.byte 0x0b, 0x0a, 0x09, 0x08, 0x0f, 0x0e, 0x0d, 0x0c
+.byte 0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x05, 0x04
+.byte 0x0b, 0x0a, 0x09, 0x08, 0x0f, 0x0e, 0x0d, 0x0c
+
+OUT_SHUFB:
+.byte 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08
+.byte 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00
+.byte 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08
+.byte 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00
+
+.text
+
+# int ${prefix}_set_key(const unsigned char *userKey, SM4_KEY *key)
+#
+# input: $userKey secret key
+#        $key  round keys
+#
+
+.globl    ${prefix}_set_key
+.type     ${prefix}_set_key,\@function,2
+.align    32
+${prefix}_set_key:
+.cfi_startproc
+    endbranch
+# Prolog
+    push    %rbp
+.cfi_push   %rbp
+# Prolog ends here.
+.Lossl_${prefix}_set_key_seh_prolog_end:
+
+    vmovdqu         ($userKey), %xmm0
+    vpshufb         IN_SHUFB(%rip), %xmm0, %xmm0
+    vpxor           SM4_FK(%rip), %xmm0, %xmm0
+
+    vmovdqu         SM4_CK(%rip), %xmm1
+    vsm4key4        %xmm1, %xmm0, %xmm0
+    vmovdqu         %xmm0, ($key)
+    vmovdqu         SM4_CK + 16(%rip), %xmm1
+    vsm4key4        %xmm1, %xmm0, %xmm0
+    vmovdqu         %xmm0, 16($key)
+    vmovdqu         SM4_CK + 32(%rip), %xmm1
+    vsm4key4        %xmm1, %xmm0, %xmm0
+    vmovdqu         %xmm0, 32($key)
+    vmovdqu         SM4_CK + 48(%rip), %xmm1
+    vsm4key4        %xmm1, %xmm0, %xmm0
+    vmovdqu         %xmm0, 48($key)
+    vmovdqu         SM4_CK + 64(%rip), %xmm1
+    vsm4key4        %xmm1, %xmm0, %xmm0
+    vmovdqu         %xmm0, 64($key)
+    vmovdqu         SM4_CK + 80(%rip), %xmm1
+    vsm4key4        %xmm1, %xmm0, %xmm0
+    vmovdqu         %xmm0, 80($key)
+    vmovdqu         SM4_CK + 96(%rip), %xmm1
+    vsm4key4        %xmm1, %xmm0, %xmm0
+    vmovdqu         %xmm0, 96($key)
+    vmovdqu         SM4_CK + 112(%rip), %xmm1
+    vsm4key4        %xmm1, %xmm0, %xmm0
+    vmovdqu         %xmm0, 112($key)
+
+    vpxor           %xmm0, %xmm0, %xmm0 # clear register
+    mov     \$1, %eax
+    pop     %rbp
+.cfi_pop     %rbp
+    ret
+.cfi_endproc
+
+# void ${prefix}_encrypt(const uint8_t *in, uint8_t *out, const SM4_KEY *ks)
+
+.globl    ${prefix}_encrypt
+.type     ${prefix}_encrypt,\@function,3
+.align    32
+${prefix}_encrypt:
+.cfi_startproc
+    endbranch
+# Prolog
+    push    %rbp
+.cfi_push   %rbp
+# Prolog ends here.
+.Lossl_${prefix}_encrypt_seh_prolog_end:
+
+    vmovdqu         ($in), %xmm0
+    vpshufb         IN_SHUFB(%rip), %xmm0, %xmm0
+
+    # note: to simplify binary instructions translation
+    mov             $ks, %r10
+
+    vsm4rnds4       (%r10), %xmm0, %xmm0
+    vsm4rnds4       16(%r10), %xmm0, %xmm0
+    vsm4rnds4       32(%r10), %xmm0, %xmm0
+    vsm4rnds4       48(%r10), %xmm0, %xmm0
+    vsm4rnds4       64(%r10), %xmm0, %xmm0
+    vsm4rnds4       80(%r10), %xmm0, %xmm0
+    vsm4rnds4       96(%r10), %xmm0, %xmm0
+    vsm4rnds4       112(%r10), %xmm0, %xmm0
+
+    vpshufb         OUT_SHUFB(%rip), %xmm0, %xmm0
+    vmovdqu         %xmm0, ($out)
+    vpxor           %xmm0, %xmm0, %xmm0 # clear register
+    pop             %rbp
+.cfi_pop            %rbp
+    ret
+.cfi_endproc
+
+# void ${prefix}_decrypt(const uint8_t *in, uint8_t *out, const SM4_KEY *ks)
+
+.globl    ${prefix}_decrypt
+.type     ${prefix}_decrypt,\@function,3
+.align    32
+${prefix}_decrypt:
+.cfi_startproc
+    endbranch
+# Prolog
+    push    %rbp
+.cfi_push   %rbp
+# Prolog ends here.
+.Lossl_${prefix}_decrypt_seh_prolog_end:
+
+    vmovdqu         ($in), %xmm0
+    vpshufb         IN_SHUFB(%rip), %xmm0, %xmm0
+
+    vmovdqu         112($ks), %xmm1
+    vpshufd         \$27, %xmm1, %xmm1
+    vsm4rnds4       %xmm1, %xmm0, %xmm0
+    vmovdqu         96($ks), %xmm1
+    vpshufd         \$27, %xmm1, %xmm1
+    vsm4rnds4       %xmm1, %xmm0, %xmm0
+    vmovdqu         80($ks), %xmm1
+    vpshufd          \$27, %xmm1, %xmm1
+    vsm4rnds4       %xmm1, %xmm0, %xmm0
+    vmovdqu         64($ks), %xmm1
+    vpshufd         \$27, %xmm1, %xmm1
+    vsm4rnds4       %xmm1, %xmm0, %xmm0
+    vmovdqu         48($ks), %xmm1
+    vpshufd         \$27, %xmm1, %xmm1
+    vsm4rnds4       %xmm1, %xmm0, %xmm0
+    vmovdqu         32($ks), %xmm1
+    vpshufd         \$27, %xmm1, %xmm1
+    vsm4rnds4       %xmm1, %xmm0, %xmm0
+    vmovdqu         16($ks), %xmm1
+    vpshufd         \$27, %xmm1, %xmm1
+    vsm4rnds4       %xmm1, %xmm0, %xmm0
+    vmovdqu         ($ks), %xmm1
+    vpshufd         \$27, %xmm1, %xmm1
+    vsm4rnds4       %xmm1, %xmm0, %xmm0
+
+    vpshufb         OUT_SHUFB(%rip), %xmm0, %xmm0
+    vmovdqu         %xmm0, ($out)
+    vpxor           %xmm0, %xmm0, %xmm0 # clear registers
+    vpxor           %xmm1, %xmm1, %xmm1
+    pop             %rbp
+.cfi_pop            %rbp
+    ret
+.cfi_endproc
+___
+}
+
+} else { # fallback for the unsupported configurations with undefined instruction
+
+$code .= <<___;
+.text
+
+.globl    ${prefix}_set_key
+.type     ${prefix}_set_key,\@abi-omnipotent
+${prefix}_set_key:
+    .byte   0x0f,0x0b    # ud2
+    ret
+.size     ${prefix}_set_key, .-${prefix}_set_key
+
+.globl    ${prefix}_encrypt
+.type ${prefix}_encrypt,\@abi-omnipotent
+${prefix}_encrypt:
+    .byte   0x0f,0x0b    # ud2
+    ret
+.size   ${prefix}_encrypt, .-${prefix}_encrypt
+
+.globl    ${prefix}_decrypt
+.type     ${prefix}_decrypt,\@abi-omnipotent
+${prefix}_decrypt:
+    .byte   0x0f,0x0b    # ud2
+    ret
+.size     ${prefix}_decrypt, .-${prefix}_decrypt
+___
+} # avx2_sm4_ni
+
+if ($avx2_sm4_ni_native > 0) { # SM4 instructions are supported in asm
+  $code =~ s/\`([^\`]*)\`/eval $1/gem;
+  print $code;
+} else { # binary translation for SM4 instructions
+  sub sm4op {
+    my $instr = shift;
+    my $args = shift;
+    if ($args =~ /^(.+)\s*#/) {
+      $args = $1; # drop comment and its leading whitespace
+    }
+    if (($instr eq "vsm4key4") && ($args =~ /%xmm(\d{1,2})\s*,\s*%xmm(\d{1,2})\s*,\s*%xmm(\d{1,2})/)) {
+      my $b1 = sprintf("0x%02x", 0x62 | ((1-int($1/8))<<5) | ((1-int($3/8))<<7) );
+      my $b2 = sprintf("0x%02x", 0x02 | (15 - $2 & 15)<<3                       );
+      my $b3 = sprintf("0x%02x", 0xc0 | ($1 & 7) | (($3 & 7)<<3)                );
+      return ".byte 0xc4,".$b1.",".$b2.",0xda,".$b3;
+    }
+    elsif (($instr eq "vsm4rnds4") && ($args =~ /(\d*)\(([^)]+)\)\s*,\s*%xmm(\d{1,2})\s*,\s*%xmm(\d{1,2})/)) {
+      my $shift = $1;
+      my $b3_offset = 0x00;
+      if ($shift) {
+        $shift = ",0x".sprintf("%02x", $shift);
+        $b3_offset = 0x40;
+      }
+      my $b1 = sprintf("0x%02x", 0x42 | ((1-int($4/8))<<7) );
+      my $b2 = sprintf("0x%02x", 0x03 | (15 - $3 & 15)<<3                       );
+      my $b3 = sprintf("0x%02x", 0x02 | ($4 & 7)<<3 | $b3_offset                );
+      return ".byte 0xc4,".$b1.",".$b2.",0xda,".$b3.$shift;
+    }
+    elsif (($instr eq "vsm4rnds4") && ($args =~ /%xmm(\d{1,2})\s*,\s*%xmm(\d{1,2})\s*,\s*%xmm(\d{1,2})/)) {
+      my $b1 = sprintf("0x%02x", 0x62 | ((1-int($1/8))<<5) | ((1-int($3/8))<<7) );
+      my $b2 = sprintf("0x%02x", 0x03 | (15 - $2 & 15)<<3                       );
+      my $b3 = sprintf("0x%02x", 0xc0 | ($1 & 7) | (($3 & 7)<<3)                );
+      return ".byte 0xc4,".$b1.",".$b2.",0xda,".$b3;
+    }
+    return $instr."\t".$args;
+  }
+
+  foreach (split("\n",$code)) {
+    s/\`([^\`]*)\`/eval $1/geo;
+    s/\b(vsm4[^\s]*)\s+(.*)/sm4op($1,$2)/geo;
+    print $_,"\n";
+  }
+} # avx2_sm4_ni_native > 0
+
+close STDOUT or die "error closing STDOUT: $!";
diff --git a/deps/openssl/openssl/crypto/sm4/asm/vpsm4-armv8.pl b/deps/openssl/openssl/crypto/sm4/asm/vpsm4-armv8.pl
index c60ace15366..21a6f2bb06d 100755
--- a/deps/openssl/openssl/crypto/sm4/asm/vpsm4-armv8.pl
+++ b/deps/openssl/openssl/crypto/sm4/asm/vpsm4-armv8.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -537,7 +537,7 @@ ___
 }

 $code=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"
 .arch	armv8-a
 .text

diff --git a/deps/openssl/openssl/crypto/sm4/asm/vpsm4_ex-armv8.pl b/deps/openssl/openssl/crypto/sm4/asm/vpsm4_ex-armv8.pl
index eac5a0f6a1d..fdb0d299479 100644
--- a/deps/openssl/openssl/crypto/sm4/asm/vpsm4_ex-armv8.pl
+++ b/deps/openssl/openssl/crypto/sm4/asm/vpsm4_ex-armv8.pl
@@ -539,7 +539,7 @@ ___
 }

 $code=<<___;
-#include "arm_arch.h"
+#include "arch/arm_arch.h"
 .arch	armv8-a+crypto
 .text

diff --git a/deps/openssl/openssl/crypto/sm4/build.info b/deps/openssl/openssl/crypto/sm4/build.info
index 990797a30e1..2f36b6b595e 100644
--- a/deps/openssl/openssl/crypto/sm4/build.info
+++ b/deps/openssl/openssl/crypto/sm4/build.info
@@ -7,6 +7,9 @@ IF[{- !$disabled{asm} -}]
   $SM4DEF_riscv64=SM4_ASM
   $SM4ASM_riscv64=sm4-riscv64-zvksed.s

+  $SM4DEF_x86_64=SM4_ASM
+  $SM4ASM_x86_64=sm4-x86_64.S
+
   # Now that we have defined all the arch specific variables, use the
   # appropriate one, and define the appropriate macros
   IF[$SM4ASM_{- $target{asm_arch} -}]
@@ -38,3 +41,4 @@ INCLUDE[sm4-armv8.o]=..
 INCLUDE[vpsm4-armv8.o]=..
 INCLUDE[vpsm4_ex-armv8.o]=..
 GENERATE[sm4-riscv64-zvksed.s]=asm/sm4-riscv64-zvksed.pl
+GENERATE[sm4-x86_64.S]=asm/sm4-x86_64.pl
diff --git a/deps/openssl/openssl/crypto/sm4/sm4.c b/deps/openssl/openssl/crypto/sm4/sm4.c
index 87e090dd5fe..0bc4a705b5b 100644
--- a/deps/openssl/openssl/crypto/sm4/sm4.c
+++ b/deps/openssl/openssl/crypto/sm4/sm4.c
@@ -86,7 +86,7 @@ static const uint32_t SM4_SBOX_T0[256] = {
     0x8BD45F5F, 0xE7C82F2F, 0xDD39E4E4, 0x68492121
 };

-static uint32_t SM4_SBOX_T1[256] = {
+static const uint32_t SM4_SBOX_T1[256] = {
     0x5B8ED55B, 0x42D09242, 0xA74DEAA7, 0xFB06FDFB, 0x33FCCF33, 0x8765E287,
     0xF4C93DF4, 0xDE6BB5DE, 0x584E1658, 0xDA6EB4DA, 0x50441450, 0x0BCAC10B,
     0xA08828A0, 0xEF17F8EF, 0xB09C2CB0, 0x14110514, 0xAC872BAC, 0x9DFB669D,
@@ -132,7 +132,7 @@ static uint32_t SM4_SBOX_T1[256] = {
     0x5F8BD45F, 0x2FE7C82F, 0xE4DD39E4, 0x21684921
 };

-static uint32_t SM4_SBOX_T2[256] = {
+static const uint32_t SM4_SBOX_T2[256] = {
     0x5B5B8ED5, 0x4242D092, 0xA7A74DEA, 0xFBFB06FD, 0x3333FCCF, 0x878765E2,
     0xF4F4C93D, 0xDEDE6BB5, 0x58584E16, 0xDADA6EB4, 0x50504414, 0x0B0BCAC1,
     0xA0A08828, 0xEFEF17F8, 0xB0B09C2C, 0x14141105, 0xACAC872B, 0x9D9DFB66,
@@ -178,7 +178,7 @@ static uint32_t SM4_SBOX_T2[256] = {
     0x5F5F8BD4, 0x2F2FE7C8, 0xE4E4DD39, 0x21216849
 };

-static uint32_t SM4_SBOX_T3[256] = {
+static const uint32_t SM4_SBOX_T3[256] = {
     0xD55B5B8E, 0x924242D0, 0xEAA7A74D, 0xFDFBFB06, 0xCF3333FC, 0xE2878765,
     0x3DF4F4C9, 0xB5DEDE6B, 0x1658584E, 0xB4DADA6E, 0x14505044, 0xC10B0BCA,
     0x28A0A088, 0xF8EFEF17, 0x2CB0B09C, 0x05141411, 0x2BACAC87, 0x669D9DFB,
diff --git a/deps/openssl/openssl/crypto/sparccpuid.S b/deps/openssl/openssl/crypto/sparccpuid.S
index 4771dd50879..8ad9723a7f8 100644
--- a/deps/openssl/openssl/crypto/sparccpuid.S
+++ b/deps/openssl/openssl/crypto/sparccpuid.S
@@ -1,4 +1,4 @@
-! Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.
+! Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
 !
 ! Licensed under the Apache License 2.0 (the "License").  You may not use
 ! this file except in compliance with the License.  You can obtain a copy
@@ -22,156 +22,6 @@
 #endif

 .text
-.align	32
-.global	OPENSSL_wipe_cpu
-.type	OPENSSL_wipe_cpu,#function
-! Keep in mind that this does not excuse us from wiping the stack!
-! This routine wipes registers, but not the backing store [which
-! resides on the stack, toward lower addresses]. To facilitate for
-! stack wiping I return pointer to the top of stack of the *caller*.
-OPENSSL_wipe_cpu:
-	save	%sp,FRAME,%sp
-	nop
-#ifdef __sun
-#include <sys/trap.h>
-	ta	ST_CLEAN_WINDOWS
-#else
-	call	.walk.reg.wins
-#endif
-	nop
-	call	.PIC.zero.up
-	mov	.zero-(.-4),%o0
-	ld	[%o0],%f0
-	ld	[%o0],%f1
-
-	subcc	%g0,1,%o0
-	! Following is V9 "rd %ccr,%o0" instruction. However! V8
-	! specification says that it ("rd %asr2,%o0" in V8 terms) does
-	! not cause illegal_instruction trap. It therefore can be used
-	! to determine if the CPU the code is executing on is V8- or
-	! V9-compliant, as V9 returns a distinct value of 0x99,
-	! "negative" and "borrow" bits set in both %icc and %xcc.
-	.word	0x91408000	!rd	%ccr,%o0
-	cmp	%o0,0x99
-	bne	.v8
-	nop
-			! Even though we do not use %fp register bank,
-			! we wipe it as memcpy might have used it...
-			.word	0xbfa00040	!fmovd	%f0,%f62
-			.word	0xbba00040	!...
-			.word	0xb7a00040
-			.word	0xb3a00040
-			.word	0xafa00040
-			.word	0xaba00040
-			.word	0xa7a00040
-			.word	0xa3a00040
-			.word	0x9fa00040
-			.word	0x9ba00040
-			.word	0x97a00040
-			.word	0x93a00040
-			.word	0x8fa00040
-			.word	0x8ba00040
-			.word	0x87a00040
-			.word	0x83a00040	!fmovd	%f0,%f32
-.v8:			fmovs	%f1,%f31
-	clr	%o0
-			fmovs	%f0,%f30
-	clr	%o1
-			fmovs	%f1,%f29
-	clr	%o2
-			fmovs	%f0,%f28
-	clr	%o3
-			fmovs	%f1,%f27
-	clr	%o4
-			fmovs	%f0,%f26
-	clr	%o5
-			fmovs	%f1,%f25
-	clr	%o7
-			fmovs	%f0,%f24
-	clr	%l0
-			fmovs	%f1,%f23
-	clr	%l1
-			fmovs	%f0,%f22
-	clr	%l2
-			fmovs	%f1,%f21
-	clr	%l3
-			fmovs	%f0,%f20
-	clr	%l4
-			fmovs	%f1,%f19
-	clr	%l5
-			fmovs	%f0,%f18
-	clr	%l6
-			fmovs	%f1,%f17
-	clr	%l7
-			fmovs	%f0,%f16
-	clr	%i0
-			fmovs	%f1,%f15
-	clr	%i1
-			fmovs	%f0,%f14
-	clr	%i2
-			fmovs	%f1,%f13
-	clr	%i3
-			fmovs	%f0,%f12
-	clr	%i4
-			fmovs	%f1,%f11
-	clr	%i5
-			fmovs	%f0,%f10
-	clr	%g1
-			fmovs	%f1,%f9
-	clr	%g2
-			fmovs	%f0,%f8
-	clr	%g3
-			fmovs	%f1,%f7
-	clr	%g4
-			fmovs	%f0,%f6
-	clr	%g5
-			fmovs	%f1,%f5
-			fmovs	%f0,%f4
-			fmovs	%f1,%f3
-			fmovs	%f0,%f2
-
-	add	%fp,BIAS,%i0	! return pointer to caller´s top of stack
-
-	ret
-	restore
-
-.zero:	.long	0x0,0x0
-.PIC.zero.up:
-	retl
-	add	%o0,%o7,%o0
-#ifdef DEBUG
-.global	walk_reg_wins
-.type	walk_reg_wins,#function
-walk_reg_wins:
-#endif
-.walk.reg.wins:
-	save	%sp,FRAME,%sp
-	cmp	%i7,%o7
-	be	2f
-	clr	%o0
-	cmp	%o7,0	! compiler never cleans %o7...
-	be	1f	! could have been a leaf function...
-	clr	%o1
-	call	.walk.reg.wins
-	nop
-1:	clr	%o2
-	clr	%o3
-	clr	%o4
-	clr	%o5
-	clr	%o7
-	clr	%l0
-	clr	%l1
-	clr	%l2
-	clr	%l3
-	clr	%l4
-	clr	%l5
-	clr	%l6
-	clr	%l7
-	add	%o0,1,%i0	! used for debugging
-2:	ret
-	restore
-.size	OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu
-
 .global	OPENSSL_atomic_add
 .type	OPENSSL_atomic_add,#function
 .align	32
diff --git a/deps/openssl/openssl/crypto/sparcv9cap.c b/deps/openssl/openssl/crypto/sparcv9cap.c
index b7f109581f5..a0550006e82 100644
--- a/deps/openssl/openssl/crypto/sparcv9cap.c
+++ b/deps/openssl/openssl/crypto/sparcv9cap.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -16,7 +16,7 @@
 #include <unistd.h>
 #include <openssl/bn.h>
 #include "internal/cryptlib.h"
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #if defined(__GNUC__) && defined(__linux)
 __attribute__((visibility("hidden")))
@@ -71,7 +71,7 @@ static void common_handler(int sig)
 }

 #if defined(__sun) && defined(__SVR4)
-#if defined(__GNUC__) && __GNUC__ >= 2
+#if defined(__GNUC__)
 extern unsigned int getisax(unsigned int vec[], unsigned int sz) __attribute__((weak));
 #elif defined(__SUNPRO_C)
 #pragma weak getisax
diff --git a/deps/openssl/openssl/crypto/sparse_array.c b/deps/openssl/openssl/crypto/sparse_array.c
index 24c7fe64a2f..bf5a14ba7a8 100644
--- a/deps/openssl/openssl/crypto/sparse_array.c
+++ b/deps/openssl/openssl/crypto/sparse_array.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2019, Oracle and/or its affiliates.  All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -173,7 +173,7 @@ void *ossl_sa_get(const OPENSSL_SA *sa, ossl_uintmax_t n)

 static ossl_inline void **alloc_node(void)
 {
-    return OPENSSL_zalloc(SA_BLOCK_MAX * sizeof(void *));
+    return OPENSSL_calloc(SA_BLOCK_MAX, sizeof(void *));
 }

 int ossl_sa_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val)
diff --git a/deps/openssl/openssl/crypto/srp/srp_lib.c b/deps/openssl/openssl/crypto/srp/srp_lib.c
index 23fa0dba72e..f957174eaa3 100644
--- a/deps/openssl/openssl/crypto/srp/srp_lib.c
+++ b/deps/openssl/openssl/crypto/srp/srp_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2025 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2004, EdelKey Project. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -39,7 +39,7 @@ static BIGNUM *srp_Calc_xy(const BIGNUM *x, const BIGNUM *y, const BIGNUM *N,
         goto err;
     if (y != N && BN_ucmp(y, N) >= 0)
         goto err;
-    if ((tmp = OPENSSL_malloc(numN * 2)) == NULL)
+    if ((tmp = OPENSSL_malloc_array(numN, 2)) == NULL)
         goto err;
     if (BN_bn2binpad(x, tmp, numN) < 0
         || BN_bn2binpad(y, tmp + numN, numN) < 0
diff --git a/deps/openssl/openssl/crypto/srp/srp_vfy.c b/deps/openssl/openssl/crypto/srp/srp_vfy.c
index be87473bfc5..504c4ad9b88 100644
--- a/deps/openssl/openssl/crypto/srp/srp_vfy.c
+++ b/deps/openssl/openssl/crypto/srp/srp_vfy.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2025 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2004, EdelKey Project. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -84,11 +84,11 @@ static int t_fromb64(unsigned char *a, size_t alen, const char *src)

     /* Add any encoded padding that is required */
     if (padsize != 0
-        && EVP_DecodeUpdate(ctx, a, &outl, pad, padsize) < 0) {
+        && EVP_DecodeUpdate(ctx, a, &outl, pad, (int)padsize) < 0) {
         outl = -1;
         goto err;
     }
-    if (EVP_DecodeUpdate(ctx, a, &outl2, (const unsigned char *)src, size) < 0) {
+    if (EVP_DecodeUpdate(ctx, a, &outl2, (const unsigned char *)src, (int)size) < 0) {
         outl = -1;
         goto err;
     }
@@ -117,7 +117,7 @@ static int t_fromb64(unsigned char *a, size_t alen, const char *src)
          * from the encoded data as we added to the pre-encoded data.
          */
         memmove(a, a + padsize, outl - padsize);
-        outl -= padsize;
+        outl -= (int)padsize;
     }

 err:
@@ -135,7 +135,7 @@ static int t_tob64(char *dst, const unsigned char *src, int size)
     EVP_ENCODE_CTX *ctx = EVP_ENCODE_CTX_new();
     int outl = 0, outl2 = 0;
     unsigned char pad[2] = { 0, 0 };
-    size_t leadz = 0;
+    int leadz = 0;

     if (ctx == NULL)
         return 0;
@@ -675,9 +675,8 @@ char *SRP_create_verifier_ex(const char *user, const char *pass, char **salt,
     if (*salt == NULL) {
         char *tmp_salt;

-        if ((tmp_salt = OPENSSL_malloc(SRP_RANDOM_SALT_LEN * 2)) == NULL) {
+        if ((tmp_salt = OPENSSL_malloc_array(SRP_RANDOM_SALT_LEN, 2)) == NULL)
             goto err;
-        }
         if (!t_tob64(tmp_salt, tmp2, SRP_RANDOM_SALT_LEN)) {
             OPENSSL_free(tmp_salt);
             goto err;
diff --git a/deps/openssl/openssl/crypto/ssl_err.c b/deps/openssl/openssl/crypto/ssl_err.c
deleted file mode 100644
index 6b88675200a..00000000000
--- a/deps/openssl/openssl/crypto/ssl_err.c
+++ /dev/null
@@ -1,635 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/sslerr.h>
-#include "sslerr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA SSL_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY),
-        "application data after close notify" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_APP_DATA_IN_HANDSHAKE),
-        "app data in handshake" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT),
-        "attempt to reuse session in different context" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE),
-        "at least (D)TLS 1.2 needed in Suite B mode" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_CERTIFICATE), "bad certificate" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_CHANGE_CIPHER_SPEC),
-        "bad change cipher spec" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_CIPHER), "bad cipher" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_COMPRESSION_ALGORITHM),
-        "bad compression algorithm" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_DATA), "bad data" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK),
-        "bad data returned by callback" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_DECOMPRESSION), "bad decompression" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_DH_VALUE), "bad dh value" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_DIGEST_LENGTH), "bad digest length" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_EARLY_DATA), "bad early data" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_ECC_CERT), "bad ecc cert" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_ECPOINT), "bad ecpoint" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_EXTENSION), "bad extension" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_HANDSHAKE_LENGTH),
-        "bad handshake length" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_HANDSHAKE_STATE),
-        "bad handshake state" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_HELLO_REQUEST), "bad hello request" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_HRR_VERSION), "bad hrr version" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_KEY_SHARE), "bad key share" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_KEY_UPDATE), "bad key update" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_LEGACY_VERSION), "bad legacy version" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_LENGTH), "bad length" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_PACKET), "bad packet" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_PACKET_LENGTH), "bad packet length" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_PROTOCOL_VERSION_NUMBER),
-        "bad protocol version number" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_PSK), "bad psk" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_PSK_IDENTITY), "bad psk identity" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_RECORD_TYPE), "bad record type" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_RSA_ENCRYPT), "bad rsa encrypt" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_SIGNATURE), "bad signature" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_SRP_A_LENGTH), "bad srp a length" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_SRP_PARAMETERS), "bad srp parameters" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_SRTP_MKI_VALUE), "bad srtp mki value" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST),
-        "bad srtp protection profile list" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_SSL_FILETYPE), "bad ssl filetype" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_VALUE), "bad value" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BAD_WRITE_RETRY), "bad write retry" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BINDER_DOES_NOT_VERIFY),
-        "binder does not verify" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BIO_NOT_SET), "bio not set" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG),
-        "block cipher pad is wrong" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_BN_LIB), "bn lib" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CALLBACK_FAILED), "callback failed" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CANNOT_CHANGE_CIPHER),
-        "cannot change cipher" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CANNOT_GET_GROUP_NAME),
-        "cannot get group name" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CA_DN_LENGTH_MISMATCH),
-        "ca dn length mismatch" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CA_KEY_TOO_SMALL), "ca key too small" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CA_MD_TOO_WEAK), "ca md too weak" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CCS_RECEIVED_EARLY), "ccs received early" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CERTIFICATE_VERIFY_FAILED),
-        "certificate verify failed" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CERT_CB_ERROR), "cert cb error" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CERT_LENGTH_MISMATCH),
-        "cert length mismatch" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED),
-        "ciphersuite digest has changed" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CIPHER_CODE_WRONG_LENGTH),
-        "cipher code wrong length" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CLIENTHELLO_TLSEXT), "clienthello tlsext" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_COMPRESSED_LENGTH_TOO_LONG),
-        "compressed length too long" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_COMPRESSION_DISABLED),
-        "compression disabled" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_COMPRESSION_FAILURE),
-        "compression failure" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE),
-        "compression id not within private range" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_COMPRESSION_LIBRARY_ERROR),
-        "compression library error" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CONNECTION_TYPE_NOT_SET),
-        "connection type not set" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CONN_USE_ONLY), "conn use only" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CONTEXT_NOT_DANE_ENABLED),
-        "context not dane enabled" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_COOKIE_GEN_CALLBACK_FAILURE),
-        "cookie gen callback failure" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_COOKIE_MISMATCH), "cookie mismatch" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_COPY_PARAMETERS_FAILED),
-        "copy parameters failed" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED),
-        "custom ext handler already installed" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DANE_ALREADY_ENABLED),
-        "dane already enabled" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL),
-        "dane cannot override mtype full" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DANE_NOT_ENABLED), "dane not enabled" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DANE_TLSA_BAD_CERTIFICATE),
-        "dane tlsa bad certificate" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE),
-        "dane tlsa bad certificate usage" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DANE_TLSA_BAD_DATA_LENGTH),
-        "dane tlsa bad data length" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH),
-        "dane tlsa bad digest length" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE),
-        "dane tlsa bad matching type" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DANE_TLSA_BAD_PUBLIC_KEY),
-        "dane tlsa bad public key" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DANE_TLSA_BAD_SELECTOR),
-        "dane tlsa bad selector" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DANE_TLSA_NULL_DATA),
-        "dane tlsa null data" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DATA_BETWEEN_CCS_AND_FINISHED),
-        "data between ccs and finished" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DATA_LENGTH_TOO_LONG),
-        "data length too long" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DECRYPTION_FAILED), "decryption failed" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC),
-        "decryption failed or bad record mac" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DH_KEY_TOO_SMALL), "dh key too small" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG),
-        "dh public value length is wrong" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DIGEST_CHECK_FAILED),
-        "digest check failed" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DOMAIN_USE_ONLY), "domain use only" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DTLS_MESSAGE_TOO_BIG),
-        "dtls message too big" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_DUPLICATE_COMPRESSION_ID),
-        "duplicate compression id" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_ECC_CERT_NOT_FOR_SIGNING),
-        "ecc cert not for signing" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE),
-        "ecdh required for suiteb mode" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_EE_KEY_TOO_SMALL), "ee key too small" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_EMPTY_RAW_PUBLIC_KEY),
-        "empty raw public key" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST),
-        "empty srtp protection profile list" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_ENCRYPTED_LENGTH_TOO_LONG),
-        "encrypted length too long" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST),
-        "error in received cipher list" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_ERROR_IN_SYSTEM_DEFAULT_CONFIG),
-        "error in system default config" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN),
-        "error setting tlsa base domain" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE),
-        "exceeds max fragment size" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_EXCESSIVE_MESSAGE_SIZE),
-        "excessive message size" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_EXTENSION_NOT_RECEIVED),
-        "extension not received" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_EXTRA_DATA_IN_MESSAGE),
-        "extra data in message" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_EXT_LENGTH_MISMATCH),
-        "ext length mismatch" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_FAILED_TO_GET_PARAMETER),
-        "failed to get parameter" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_FAILED_TO_INIT_ASYNC),
-        "failed to init async" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_FEATURE_NEGOTIATION_NOT_COMPLETE),
-        "feature negotiation not complete" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_FEATURE_NOT_RENEGOTIABLE),
-        "feature not renegotiable" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_FRAGMENTED_CLIENT_HELLO),
-        "fragmented client hello" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_GOT_A_FIN_BEFORE_A_CCS),
-        "got a fin before a ccs" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_HTTPS_PROXY_REQUEST),
-        "https proxy request" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_HTTP_REQUEST), "http request" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_ILLEGAL_POINT_COMPRESSION),
-        "illegal point compression" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_ILLEGAL_SUITEB_DIGEST),
-        "illegal Suite B digest" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INAPPROPRIATE_FALLBACK),
-        "inappropriate fallback" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INCONSISTENT_COMPRESSION),
-        "inconsistent compression" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INCONSISTENT_EARLY_DATA_ALPN),
-        "inconsistent early data alpn" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INCONSISTENT_EARLY_DATA_SNI),
-        "inconsistent early data sni" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INCONSISTENT_EXTMS), "inconsistent extms" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INSUFFICIENT_SECURITY),
-        "insufficient security" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_ALERT), "invalid alert" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_CCS_MESSAGE),
-        "invalid ccs message" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_CERTIFICATE_OR_ALG),
-        "invalid certificate or alg" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_COMMAND), "invalid command" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_COMPRESSION_ALGORITHM),
-        "invalid compression algorithm" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_CONFIG), "invalid config" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_CONFIGURATION_NAME),
-        "invalid configuration name" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_CONTEXT), "invalid context" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_CT_VALIDATION_TYPE),
-        "invalid ct validation type" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_KEY_UPDATE_TYPE),
-        "invalid key update type" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_MAX_EARLY_DATA),
-        "invalid max early data" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_NULL_CMD_NAME),
-        "invalid null cmd name" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_RAW_PUBLIC_KEY),
-        "invalid raw public key" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_RECORD), "invalid record" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_SEQUENCE_NUMBER),
-        "invalid sequence number" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_SERVERINFO_DATA),
-        "invalid serverinfo data" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_SESSION_ID), "invalid session id" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_SRP_USERNAME),
-        "invalid srp username" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_STATUS_RESPONSE),
-        "invalid status response" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_INVALID_TICKET_KEYS_LENGTH),
-        "invalid ticket keys length" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_LEGACY_SIGALG_DISALLOWED_OR_UNSUPPORTED),
-        "legacy sigalg disallowed or unsupported" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_LENGTH_MISMATCH), "length mismatch" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_LENGTH_TOO_LONG), "length too long" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_LENGTH_TOO_SHORT), "length too short" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_LIBRARY_BUG), "library bug" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_LIBRARY_HAS_NO_CIPHERS),
-        "library has no ciphers" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_LISTENER_USE_ONLY), "listener use only" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MAXIMUM_ENCRYPTED_PKTS_REACHED),
-        "maximum encrypted pkts reached" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_DSA_SIGNING_CERT),
-        "missing dsa signing cert" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_ECDSA_SIGNING_CERT),
-        "missing ecdsa signing cert" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_FATAL), "missing fatal" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_PARAMETERS), "missing parameters" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_PSK_KEX_MODES_EXTENSION),
-        "missing psk kex modes extension" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_QUIC_TLS_FUNCTIONS),
-        "missing quic tls functions" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_RSA_CERTIFICATE),
-        "missing rsa certificate" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_RSA_ENCRYPTING_CERT),
-        "missing rsa encrypting cert" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_RSA_SIGNING_CERT),
-        "missing rsa signing cert" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_SIGALGS_EXTENSION),
-        "missing sigalgs extension" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_SIGNING_CERT),
-        "missing signing cert" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_SRP_PARAM),
-        "can't find SRP server param" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION),
-        "missing supported groups extension" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_SUPPORTED_VERSIONS_EXTENSION),
-        "missing supported versions extension" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_TMP_DH_KEY), "missing tmp dh key" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MISSING_TMP_ECDH_KEY),
-        "missing tmp ecdh key" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA),
-        "mixed handshake and non handshake data" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NOT_ON_RECORD_BOUNDARY),
-        "not on record boundary" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NOT_REPLACING_CERTIFICATE),
-        "not replacing certificate" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NOT_SERVER), "not server" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_APPLICATION_PROTOCOL),
-        "no application protocol" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_CERTIFICATES_RETURNED),
-        "no certificates returned" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_CERTIFICATE_ASSIGNED),
-        "no certificate assigned" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_CERTIFICATE_SET), "no certificate set" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_CHANGE_FOLLOWING_HRR),
-        "no change following hrr" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_CIPHERS_AVAILABLE),
-        "no ciphers available" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_CIPHERS_SPECIFIED),
-        "no ciphers specified" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_CIPHER_MATCH), "no cipher match" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_CLIENT_CERT_METHOD),
-        "no client cert method" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_COMPRESSION_SPECIFIED),
-        "no compression specified" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_COOKIE_CALLBACK_SET),
-        "no cookie callback set" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER),
-        "Peer haven't sent GOST certificate, required for selected ciphersuite" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_METHOD_SPECIFIED),
-        "no method specified" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_PEM_EXTENSIONS), "no pem extensions" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_PRIVATE_KEY_ASSIGNED),
-        "no private key assigned" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_PROTOCOLS_AVAILABLE),
-        "no protocols available" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_RENEGOTIATION), "no renegotiation" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_REQUIRED_DIGEST), "no required digest" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_SHARED_CIPHER), "no shared cipher" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_SHARED_GROUPS), "no shared groups" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS),
-        "no shared signature algorithms" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_SRTP_PROFILES), "no srtp profiles" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_STREAM), "no stream" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_SUITABLE_DIGEST_ALGORITHM),
-        "no suitable digest algorithm" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_SUITABLE_GROUPS), "no suitable groups" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_SUITABLE_KEY_SHARE),
-        "no suitable key share" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_SUITABLE_RECORD_LAYER),
-        "no suitable record layer" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM),
-        "no suitable signature algorithm" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_VALID_SCTS), "no valid scts" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NO_VERIFY_COOKIE_CALLBACK),
-        "no verify cookie callback" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NULL_SSL_CTX), "null ssl ctx" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_NULL_SSL_METHOD_PASSED),
-        "null ssl method passed" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_OCSP_CALLBACK_FAILURE),
-        "ocsp callback failure" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED),
-        "old session cipher not returned" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED),
-        "old session compression algorithm not returned" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_OVERFLOW_ERROR), "overflow error" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_PACKET_LENGTH_TOO_LONG),
-        "packet length too long" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_PARSE_TLSEXT), "parse tlsext" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_PATH_TOO_LONG), "path too long" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE),
-        "peer did not return a certificate" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_PEM_NAME_BAD_PREFIX),
-        "pem name bad prefix" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_PEM_NAME_TOO_SHORT), "pem name too short" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_PIPELINE_FAILURE), "pipeline failure" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_POLL_REQUEST_NOT_SUPPORTED),
-        "poll request not supported" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR),
-        "post handshake auth encoding err" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_PRIVATE_KEY_MISMATCH),
-        "private key mismatch" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_PROTOCOL_IS_SHUTDOWN),
-        "protocol is shutdown" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_PSK_IDENTITY_NOT_FOUND),
-        "psk identity not found" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_PSK_NO_CLIENT_CB), "psk no client cb" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_PSK_NO_SERVER_CB), "psk no server cb" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_QUIC_HANDSHAKE_LAYER_ERROR),
-        "quic handshake layer error" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_QUIC_NETWORK_ERROR), "quic network error" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_QUIC_PROTOCOL_ERROR),
-        "quic protocol error" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_READ_BIO_NOT_SET), "read bio not set" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_READ_TIMEOUT_EXPIRED),
-        "read timeout expired" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_RECORDS_NOT_RELEASED),
-        "records not released" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_RECORD_LAYER_FAILURE),
-        "record layer failure" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_RECORD_LENGTH_MISMATCH),
-        "record length mismatch" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_RECORD_TOO_SMALL), "record too small" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_REMOTE_PEER_ADDRESS_NOT_SET),
-        "remote peer address not set" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_RENEGOTIATE_EXT_TOO_LONG),
-        "renegotiate ext too long" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_RENEGOTIATION_ENCODING_ERR),
-        "renegotiation encoding err" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_RENEGOTIATION_MISMATCH),
-        "renegotiation mismatch" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_REQUEST_PENDING), "request pending" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_REQUEST_SENT), "request sent" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_REQUIRED_CIPHER_MISSING),
-        "required cipher missing" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING),
-        "required compression algorithm missing" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING),
-        "scsv received when renegotiating" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SCT_VERIFICATION_FAILED),
-        "sct verification failed" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SEQUENCE_CTR_WRAPPED),
-        "sequence ctr wrapped" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SERVERHELLO_TLSEXT), "serverhello tlsext" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED),
-        "session id context uninitialized" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHUTDOWN_WHILE_IN_INIT),
-        "shutdown while in init" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SIGNATURE_ALGORITHMS_ERROR),
-        "signature algorithms error" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE),
-        "signature for non signing certificate" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SRP_A_CALC), "error with the srp params" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES),
-        "srtp could not allocate profiles" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG),
-        "srtp protection profile list too long" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE),
-        "srtp unknown protection profile" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH),
-        "ssl3 ext invalid max fragment length" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL3_EXT_INVALID_SERVERNAME),
-        "ssl3 ext invalid servername" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE),
-        "ssl3 ext invalid servername type" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL3_SESSION_ID_TOO_LONG),
-        "ssl3 session id too long" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSLV3_ALERT_BAD_CERTIFICATE),
-        "ssl/tls alert bad certificate" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSLV3_ALERT_BAD_RECORD_MAC),
-        "ssl/tls alert bad record mac" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED),
-        "ssl/tls alert certificate expired" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED),
-        "ssl/tls alert certificate revoked" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN),
-        "ssl/tls alert certificate unknown" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE),
-        "ssl/tls alert decompression failure" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE),
-        "ssl/tls alert handshake failure" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER),
-        "ssl/tls alert illegal parameter" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSLV3_ALERT_NO_CERTIFICATE),
-        "ssl/tls alert no certificate" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE),
-        "ssl/tls alert unexpected message" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE),
-        "ssl/tls alert unsupported certificate" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL_COMMAND_SECTION_EMPTY),
-        "ssl command section empty" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL_COMMAND_SECTION_NOT_FOUND),
-        "ssl command section not found" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION),
-        "ssl ctx has no default ssl version" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL_HANDSHAKE_FAILURE),
-        "ssl handshake failure" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS),
-        "ssl library has no ciphers" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL_NEGATIVE_LENGTH),
-        "ssl negative length" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL_SECTION_EMPTY), "ssl section empty" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL_SECTION_NOT_FOUND),
-        "ssl section not found" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED),
-        "ssl session id callback failed" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL_SESSION_ID_CONFLICT),
-        "ssl session id conflict" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG),
-        "ssl session id context too long" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH),
-        "ssl session id has bad length" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL_SESSION_ID_TOO_LONG),
-        "ssl session id too long" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SSL_SESSION_VERSION_MISMATCH),
-        "ssl session version mismatch" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_STILL_IN_INIT), "still in init" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_STREAM_COUNT_LIMITED),
-        "stream count limited" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_STREAM_FINISHED), "stream finished" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_STREAM_RECV_ONLY), "stream recv only" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_STREAM_RESET), "stream reset" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_STREAM_SEND_ONLY), "stream send only" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED),
-        "tlsv13 alert certificate required" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV13_ALERT_MISSING_EXTENSION),
-        "tlsv13 alert missing extension" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_ACCESS_DENIED),
-        "tlsv1 alert access denied" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_DECODE_ERROR),
-        "tlsv1 alert decode error" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_DECRYPTION_FAILED),
-        "tlsv1 alert decryption failed" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_DECRYPT_ERROR),
-        "tlsv1 alert decrypt error" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION),
-        "tlsv1 alert export restriction" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK),
-        "tlsv1 alert inappropriate fallback" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY),
-        "tlsv1 alert insufficient security" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_INTERNAL_ERROR),
-        "tlsv1 alert internal error" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_NO_APPLICATION_PROTOCOL),
-        "tlsv1 alert no application protocol" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_NO_RENEGOTIATION),
-        "tlsv1 alert no renegotiation" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_PROTOCOL_VERSION),
-        "tlsv1 alert protocol version" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_RECORD_OVERFLOW),
-        "tlsv1 alert record overflow" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_UNKNOWN_CA),
-        "tlsv1 alert unknown ca" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_UNKNOWN_PSK_IDENTITY),
-        "tlsv1 alert unknown psk identity" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_ALERT_USER_CANCELLED),
-        "tlsv1 alert user cancelled" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE),
-        "tlsv1 bad certificate hash value" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE),
-        "tlsv1 bad certificate status response" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE),
-        "tlsv1 certificate unobtainable" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_UNRECOGNIZED_NAME),
-        "tlsv1 unrecognized name" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLSV1_UNSUPPORTED_EXTENSION),
-        "tlsv1 unsupported extension" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL),
-        "tls illegal exporter label" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST),
-        "tls invalid ecpointformat list" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TOO_MANY_KEY_UPDATES),
-        "too many key updates" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TOO_MANY_WARN_ALERTS),
-        "too many warn alerts" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_TOO_MUCH_EARLY_DATA),
-        "too much early data" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS),
-        "unable to find ecdh parameters" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS),
-        "unable to find public key parameters" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES),
-        "unable to load ssl3 md5 routines" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES),
-        "unable to load ssl3 sha1 routines" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNEXPECTED_CCS_MESSAGE),
-        "unexpected ccs message" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNEXPECTED_END_OF_EARLY_DATA),
-        "unexpected end of early data" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNEXPECTED_EOF_WHILE_READING),
-        "unexpected eof while reading" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNEXPECTED_MESSAGE), "unexpected message" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNEXPECTED_RECORD), "unexpected record" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNINITIALIZED), "uninitialized" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNKNOWN_ALERT_TYPE), "unknown alert type" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNKNOWN_CERTIFICATE_TYPE),
-        "unknown certificate type" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNKNOWN_CIPHER_RETURNED),
-        "unknown cipher returned" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNKNOWN_CIPHER_TYPE),
-        "unknown cipher type" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNKNOWN_CMD_NAME), "unknown cmd name" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNKNOWN_COMMAND), "unknown command" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNKNOWN_DIGEST), "unknown digest" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE),
-        "unknown key exchange type" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNKNOWN_MANDATORY_PARAMETER),
-        "unknown mandatory parameter" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNKNOWN_PKEY_TYPE), "unknown pkey type" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNKNOWN_PROTOCOL), "unknown protocol" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNKNOWN_SSL_VERSION),
-        "unknown ssl version" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNKNOWN_STATE), "unknown state" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED),
-        "unsafe legacy renegotiation disabled" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNSOLICITED_EXTENSION),
-        "unsolicited extension" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM),
-        "unsupported compression algorithm" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNSUPPORTED_CONFIG_VALUE),
-        "unsupported config value" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNSUPPORTED_CONFIG_VALUE_CLASS),
-        "unsupported config value class" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNSUPPORTED_CONFIG_VALUE_OP),
-        "unsupported config value op" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE),
-        "unsupported elliptic curve" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNSUPPORTED_PROTOCOL),
-        "unsupported protocol" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNSUPPORTED_SSL_VERSION),
-        "unsupported ssl version" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNSUPPORTED_STATUS_TYPE),
-        "unsupported status type" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNSUPPORTED_WRITE_FLAG),
-        "unsupported write flag" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_USE_SRTP_NOT_NEGOTIATED),
-        "use srtp not negotiated" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_VERSION_TOO_HIGH), "version too high" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_VERSION_TOO_LOW), "version too low" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_WRONG_CERTIFICATE_TYPE),
-        "wrong certificate type" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_WRONG_CIPHER_RETURNED),
-        "wrong cipher returned" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_WRONG_CURVE), "wrong curve" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_WRONG_RPK_TYPE), "wrong rpk type" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_WRONG_SIGNATURE_LENGTH),
-        "wrong signature length" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_WRONG_SIGNATURE_SIZE),
-        "wrong signature size" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_WRONG_SIGNATURE_TYPE),
-        "wrong signature type" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_WRONG_SSL_VERSION), "wrong ssl version" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_WRONG_VERSION_NUMBER),
-        "wrong version number" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_X509_LIB), "x509 lib" },
-    { ERR_PACK(ERR_LIB_SSL, 0, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS),
-        "x509 verification setup problems" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_SSL_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(SSL_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(SSL_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/sslerr.h b/deps/openssl/openssl/crypto/sslerr.h
deleted file mode 100644
index 968f27b00a6..00000000000
--- a/deps/openssl/openssl/crypto/sslerr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_SSLERR_H
-#define OSSL_SSLERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_SSL_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/crypto/stack/stack.c b/deps/openssl/openssl/crypto/stack/stack.c
index 633e9f1bf24..5799bf9d7ca 100644
--- a/deps/openssl/openssl/crypto/stack/stack.c
+++ b/deps/openssl/openssl/crypto/stack/stack.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -31,6 +31,9 @@ struct stack_st {
     int sorted;
     int num_alloc;
     OPENSSL_sk_compfunc comp;
+    int (*cmp_thunk)(OPENSSL_sk_compfunc, const void *, const void *);
+    OPENSSL_sk_freefunc_thunk free_thunk;
+    OPENSSL_sk_copyfunc_thunk copy_thunk;
 };

 OPENSSL_sk_compfunc OPENSSL_sk_set_cmp_func(OPENSSL_STACK *sk,
@@ -38,89 +41,68 @@ OPENSSL_sk_compfunc OPENSSL_sk_set_cmp_func(OPENSSL_STACK *sk,
 {
     OPENSSL_sk_compfunc old = sk->comp;

-    if (sk->comp != c)
+    if (sk->comp != c && sk->num > 1)
         sk->sorted = 0;
     sk->comp = c;

     return old;
 }

-OPENSSL_STACK *OPENSSL_sk_dup(const OPENSSL_STACK *sk)
+static void free_with_thunk(OPENSSL_STACK *sk, OPENSSL_sk_freefunc free_func, const void *data)
 {
-    OPENSSL_STACK *ret;
-
-    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
-        goto err;
-
-    if (sk == NULL) {
-        ret->num = 0;
-        ret->sorted = 0;
-        ret->comp = NULL;
-    } else {
-        /* direct structure assignment */
-        *ret = *sk;
-    }
-
-    if (sk == NULL || sk->num == 0) {
-        /* postpone |ret->data| allocation */
-        ret->data = NULL;
-        ret->num_alloc = 0;
-        return ret;
-    }
-
-    /* duplicate |sk->data| content */
-    ret->data = OPENSSL_malloc(sizeof(*ret->data) * sk->num_alloc);
-    if (ret->data == NULL)
-        goto err;
-    memcpy(ret->data, sk->data, sizeof(void *) * sk->num);
-    return ret;
-
-err:
-    OPENSSL_sk_free(ret);
-    return NULL;
+    if (data == NULL)
+        return;
+    if (sk->free_thunk != NULL)
+        sk->free_thunk(free_func, (void *)data);
+    else
+        free_func((void *)data);
 }

-OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *sk,
+static OPENSSL_STACK *internal_copy(const OPENSSL_STACK *sk,
     OPENSSL_sk_copyfunc copy_func,
     OPENSSL_sk_freefunc free_func)
 {
     OPENSSL_STACK *ret;
     int i;

-    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
+    if ((ret = OPENSSL_sk_new_null()) == NULL)
         goto err;

-    if (sk == NULL) {
-        ret->num = 0;
-        ret->sorted = 0;
-        ret->comp = NULL;
-    } else {
-        /* direct structure assignment */
-        *ret = *sk;
-    }
+    if (sk == NULL)
+        goto done;

-    if (sk == NULL || sk->num == 0) {
-        /* postpone |ret| data allocation */
-        ret->data = NULL;
-        ret->num_alloc = 0;
-        return ret;
-    }
+    /* direct structure assignment */
+    *ret = *sk;
+    ret->data = NULL;
+    ret->num_alloc = 0;

-    ret->num_alloc = sk->num > min_nodes ? sk->num : min_nodes;
-    ret->data = OPENSSL_zalloc(sizeof(*ret->data) * ret->num_alloc);
+    if (ret->num == 0)
+        goto done; /* nothing to copy */
+
+    ret->num_alloc = ret->num > min_nodes ? ret->num : min_nodes;
+    ret->data = OPENSSL_calloc(ret->num_alloc, sizeof(*ret->data));
     if (ret->data == NULL)
         goto err;
-
-    for (i = 0; i < ret->num; ++i) {
-        if (sk->data[i] == NULL)
-            continue;
-        if ((ret->data[i] = copy_func(sk->data[i])) == NULL) {
-            while (--i >= 0)
-                if (ret->data[i] != NULL)
-                    free_func((void *)ret->data[i]);
-            goto err;
+    if (copy_func == NULL) {
+        memcpy(ret->data, sk->data, sizeof(*ret->data) * ret->num);
+    } else {
+        for (i = 0; i < ret->num; ++i) {
+            if (sk->data[i] == NULL)
+                continue;
+            if (ret->copy_thunk != NULL)
+                ret->data[i] = ret->copy_thunk(copy_func, sk->data[i]);
+            else
+                ret->data[i] = copy_func(sk->data[i]);
+
+            if (ret->data[i] == NULL) {
+                while (--i >= 0)
+                    free_with_thunk(ret, free_func, ret->data[i]);
+                goto err;
+            }
         }
     }
+
+done:
     return ret;

 err:
@@ -128,6 +110,18 @@ err:
     return NULL;
 }

+OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *sk,
+    OPENSSL_sk_copyfunc copy_func,
+    OPENSSL_sk_freefunc free_func)
+{
+    return internal_copy(sk, copy_func, free_func);
+}
+
+OPENSSL_STACK *OPENSSL_sk_dup(const OPENSSL_STACK *sk)
+{
+    return internal_copy(sk, NULL, NULL);
+}
+
 OPENSSL_STACK *OPENSSL_sk_new_null(void)
 {
     return OPENSSL_sk_new_reserve(NULL, 0);
@@ -197,7 +191,7 @@ static int sk_reserve(OPENSSL_STACK *st, int n, int exact)
          * At this point, |st->num_alloc| and |st->num| are 0;
          * so |num_alloc| value is |n| or |min_nodes| if greater than |n|.
          */
-        if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL)
+        if ((st->data = OPENSSL_calloc(num_alloc, sizeof(void *))) == NULL)
             return 0;
         st->num_alloc = num_alloc;
         return 1;
@@ -215,7 +209,7 @@ static int sk_reserve(OPENSSL_STACK *st, int n, int exact)
         return 1;
     }

-    tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
+    tmpdata = OPENSSL_realloc_array((void *)st->data, num_alloc, sizeof(void *));
     if (tmpdata == NULL)
         return 0;

@@ -224,6 +218,11 @@ static int sk_reserve(OPENSSL_STACK *st, int n, int exact)
     return 1;
 }

+static ossl_inline int cmp_with_thunk(const OPENSSL_STACK *st, const void *a, const void *b)
+{
+    return (st->cmp_thunk == NULL) ? st->comp(a, b) : st->cmp_thunk(st->comp, a, b);
+}
+
 OPENSSL_STACK *OPENSSL_sk_new_reserve(OPENSSL_sk_compfunc c, int n)
 {
     OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
@@ -232,6 +231,7 @@ OPENSSL_STACK *OPENSSL_sk_new_reserve(OPENSSL_sk_compfunc c, int n)
         return NULL;

     st->comp = c;
+    st->sorted = 1; /* empty or single-element stack is considered sorted */

     if (n <= 0)
         return st;
@@ -256,8 +256,34 @@ int OPENSSL_sk_reserve(OPENSSL_STACK *st, int n)
     return sk_reserve(st, n, 1);
 }

+OPENSSL_STACK *OPENSSL_sk_set_thunks(OPENSSL_STACK *st, OPENSSL_sk_freefunc_thunk f_thunk)
+{
+    if (st != NULL)
+        st->free_thunk = f_thunk;
+
+    return st;
+}
+
+OPENSSL_STACK *OPENSSL_sk_set_cmp_thunks(OPENSSL_STACK *st, int (*c_thunk)(int (*)(const void *, const void *), const void *, const void *))
+{
+    if (st != NULL)
+        st->cmp_thunk = c_thunk;
+
+    return st;
+}
+
+OPENSSL_STACK *OPENSSL_sk_set_copy_thunks(OPENSSL_STACK *st, OPENSSL_sk_copyfunc_thunk cp_thunk)
+{
+    if (st != NULL)
+        st->copy_thunk = cp_thunk;
+
+    return st;
+}
+
 int OPENSSL_sk_insert(OPENSSL_STACK *st, const void *data, int loc)
 {
+    int cmp_ret;
+
     if (st == NULL) {
         ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
@@ -271,14 +297,30 @@ int OPENSSL_sk_insert(OPENSSL_STACK *st, const void *data, int loc)
         return 0;

     if ((loc >= st->num) || (loc < 0)) {
-        st->data[st->num] = data;
+        loc = st->num;
+        st->data[loc] = data;
     } else {
         memmove(&st->data[loc + 1], &st->data[loc],
             sizeof(st->data[0]) * (st->num - loc));
         st->data[loc] = data;
     }
     st->num++;
-    st->sorted = 0;
+    if (st->sorted && st->num > 1) {
+        if (st->comp != NULL) {
+            if (loc > 0) {
+                cmp_ret = cmp_with_thunk(st, &st->data[loc - 1], &st->data[loc]);
+                if (cmp_ret > 0)
+                    st->sorted = 0;
+            }
+            if (loc < st->num - 1) {
+                cmp_ret = cmp_with_thunk(st, &st->data[loc + 1], &st->data[loc]);
+                if (cmp_ret < 0)
+                    st->sorted = 0;
+            }
+        } else {
+            st->sorted = 0;
+        }
+    }
     return st->num;
 }

@@ -290,6 +332,7 @@ static ossl_inline void *internal_delete(OPENSSL_STACK *st, int loc)
         memmove(&st->data[loc], &st->data[loc + 1],
             sizeof(st->data[0]) * (st->num - loc - 1));
     st->num--;
+    st->sorted = st->sorted || st->num <= 1;

     return (void *)ret;
 }
@@ -315,11 +358,12 @@ void *OPENSSL_sk_delete(OPENSSL_STACK *st, int loc)
     return internal_delete(st, loc);
 }

-static int internal_find(OPENSSL_STACK *st, const void *data,
+static int internal_find(const OPENSSL_STACK *st, const void *data,
     int ret_val_options, int *pnum_matched)
 {
     const void *r;
     int i, count = 0;
+    int cmp_ret;
     int *pnum = pnum_matched;

     if (st == NULL || st->num == 0)
@@ -344,8 +388,9 @@ static int internal_find(OPENSSL_STACK *st, const void *data,
     if (!st->sorted) {
         int res = -1;

-        for (i = 0; i < st->num; i++)
-            if (st->comp(&data, st->data + i) == 0) {
+        for (i = 0; i < st->num; i++) {
+            cmp_ret = cmp_with_thunk(st, &data, st->data + i);
+            if (cmp_ret == 0) {
                 if (res == -1)
                     res = i;
                 ++*pnum;
@@ -353,6 +398,7 @@ static int internal_find(OPENSSL_STACK *st, const void *data,
                 if (pnum_matched == NULL)
                     return i;
             }
+        }
         if (res == -1)
             *pnum = 0;
         return res;
@@ -360,7 +406,7 @@ static int internal_find(OPENSSL_STACK *st, const void *data,

     if (pnum_matched != NULL)
         ret_val_options |= OSSL_BSEARCH_FIRST_VALUE_ON_MATCH;
-    r = ossl_bsearch(&data, st->data, st->num, sizeof(void *), st->comp,
+    r = ossl_bsearch(&data, st->data, st->num, sizeof(void *), st->comp, st->cmp_thunk,
         ret_val_options);

     if (pnum_matched != NULL) {
@@ -369,7 +415,8 @@ static int internal_find(OPENSSL_STACK *st, const void *data,
             const void **p = (const void **)r;

             while (p < st->data + st->num) {
-                if (st->comp(&data, p) != 0)
+                cmp_ret = cmp_with_thunk(st, &data, p);
+                if (cmp_ret != 0)
                     break;
                 ++*pnum;
                 ++p;
@@ -380,17 +427,17 @@ static int internal_find(OPENSSL_STACK *st, const void *data,
     return r == NULL ? -1 : (int)((const void **)r - st->data);
 }

-int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
+int OPENSSL_sk_find(const OPENSSL_STACK *st, const void *data)
 {
     return internal_find(st, data, OSSL_BSEARCH_FIRST_VALUE_ON_MATCH, NULL);
 }

-int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data)
+int OPENSSL_sk_find_ex(const OPENSSL_STACK *st, const void *data)
 {
     return internal_find(st, data, OSSL_BSEARCH_VALUE_ON_NOMATCH, NULL);
 }

-int OPENSSL_sk_find_all(OPENSSL_STACK *st, const void *data, int *pnum)
+int OPENSSL_sk_find_all(const OPENSSL_STACK *st, const void *data, int *pnum)
 {
     return internal_find(st, data, OSSL_BSEARCH_FIRST_VALUE_ON_MATCH, pnum);
 }
@@ -435,9 +482,10 @@ void OPENSSL_sk_pop_free(OPENSSL_STACK *st, OPENSSL_sk_freefunc func)

     if (st == NULL)
         return;
+
     for (i = 0; i < st->num; i++)
-        if (st->data[i] != NULL)
-            func((char *)st->data[i]);
+        free_with_thunk(st, func, st->data[i]);
+
     OPENSSL_sk_free(st);
 }

@@ -473,7 +521,7 @@ void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data)
         return NULL;
     }
     st->data[i] = data;
-    st->sorted = 0;
+    st->sorted = st->num <= 1;
     return (void *)st->data[i];
 }

diff --git a/deps/openssl/openssl/crypto/store/store_err.c b/deps/openssl/openssl/crypto/store/store_err.c
deleted file mode 100644
index ee35151cc34..00000000000
--- a/deps/openssl/openssl/crypto/store/store_err.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/storeerr.h>
-#include "crypto/storeerr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA OSSL_STORE_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE),
-        "ambiguous content type" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_BAD_PASSWORD_READ),
-        "bad password read" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC),
-        "error verifying pkcs12 mac" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST),
-        "fingerprint size does not match digest" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_INVALID_SCHEME),
-        "invalid scheme" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_IS_NOT_A), "is not a" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_LOADER_INCOMPLETE),
-        "loader incomplete" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_LOADING_STARTED),
-        "loading started" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_NOT_A_CERTIFICATE),
-        "not a certificate" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_NOT_A_CRL), "not a crl" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_NOT_A_NAME), "not a name" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_NOT_A_PRIVATE_KEY),
-        "not a private key" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_NOT_A_PUBLIC_KEY),
-        "not a public key" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_NOT_PARAMETERS),
-        "not parameters" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_NO_LOADERS_FOUND),
-        "no loaders found" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR),
-        "passphrase callback error" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE),
-        "path must be absolute" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES),
-        "search only supported for directories" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED),
-        "ui process interrupted or cancelled" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_UNREGISTERED_SCHEME),
-        "unregistered scheme" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE),
-        "unsupported content type" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_UNSUPPORTED_OPERATION),
-        "unsupported operation" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE),
-        "unsupported search type" },
-    { ERR_PACK(ERR_LIB_OSSL_STORE, 0, OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED),
-        "uri authority unsupported" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_OSSL_STORE_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(OSSL_STORE_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(OSSL_STORE_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/store/store_lib.c b/deps/openssl/openssl/crypto/store/store_lib.c
index b7a9eaed8f7..1086cbcd5b2 100644
--- a/deps/openssl/openssl/crypto/store/store_lib.c
+++ b/deps/openssl/openssl/crypto/store/store_lib.c
@@ -295,7 +295,7 @@ int OSSL_STORE_expect(OSSL_STORE_CTX *ctx, int expected_type)
     int ret = 1;

     if (ctx == NULL
-        || expected_type < 0 || expected_type > OSSL_STORE_INFO_CRL) {
+        || expected_type < 0 || expected_type > OSSL_STORE_INFO_SKEY) {
         ERR_raise(ERR_LIB_OSSL_STORE, ERR_R_PASSED_INVALID_ARGUMENT);
         return 0;
     }
@@ -694,6 +694,15 @@ OSSL_STORE_INFO *OSSL_STORE_INFO_new_CRL(X509_CRL *crl)
     return info;
 }

+OSSL_STORE_INFO *OSSL_STORE_INFO_new_SKEY(EVP_SKEY *skey)
+{
+    OSSL_STORE_INFO *info = OSSL_STORE_INFO_new(OSSL_STORE_INFO_SKEY, skey);
+
+    if (info == NULL)
+        ERR_raise(ERR_LIB_OSSL_STORE, ERR_R_OSSL_STORE_LIB);
+    return info;
+}
+
 /*
  * Functions to try to extract data from an OSSL_STORE_INFO.
  */
@@ -829,6 +838,24 @@ X509_CRL *OSSL_STORE_INFO_get1_CRL(const OSSL_STORE_INFO *info)
     return NULL;
 }

+EVP_SKEY *OSSL_STORE_INFO_get0_SKEY(const OSSL_STORE_INFO *info)
+{
+    if (info->type == OSSL_STORE_INFO_SKEY)
+        return info->_.skey;
+    return NULL;
+}
+
+EVP_SKEY *OSSL_STORE_INFO_get1_SKEY(const OSSL_STORE_INFO *info)
+{
+    if (info->type == OSSL_STORE_INFO_SKEY) {
+        if (!EVP_SKEY_up_ref(info->_.skey))
+            return NULL;
+        return info->_.skey;
+    }
+    ERR_raise(ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_SYMMETRIC_KEY);
+    return NULL;
+}
+
 /*
  * Free the OSSL_STORE_INFO
  */
@@ -855,6 +882,9 @@ void OSSL_STORE_INFO_free(OSSL_STORE_INFO *info)
         case OSSL_STORE_INFO_CRL:
             X509_CRL_free(info->_.crl);
             break;
+        case OSSL_STORE_INFO_SKEY:
+            EVP_SKEY_free(info->_.skey);
+            break;
         }
         OPENSSL_free(info);
     }
@@ -912,7 +942,7 @@ int OSSL_STORE_supports_search(OSSL_STORE_CTX *ctx, int search_type)
 }

 /* Search term constructors */
-OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_name(X509_NAME *name)
+OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_name(const X509_NAME *name)
 {
     OSSL_STORE_SEARCH *search = OPENSSL_zalloc(sizeof(*search));

@@ -924,7 +954,7 @@ OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_name(X509_NAME *name)
     return search;
 }

-OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_issuer_serial(X509_NAME *name,
+OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_issuer_serial(const X509_NAME *name,
     const ASN1_INTEGER *serial)
 {
     OSSL_STORE_SEARCH *search = OPENSSL_zalloc(sizeof(*search));
@@ -996,7 +1026,7 @@ int OSSL_STORE_SEARCH_get_type(const OSSL_STORE_SEARCH *criterion)
     return criterion->search_type;
 }

-X509_NAME *OSSL_STORE_SEARCH_get0_name(const OSSL_STORE_SEARCH *criterion)
+const X509_NAME *OSSL_STORE_SEARCH_get0_name(const OSSL_STORE_SEARCH *criterion)
 {
     return criterion->name;
 }
diff --git a/deps/openssl/openssl/crypto/store/store_local.h b/deps/openssl/openssl/crypto/store/store_local.h
index f57313e9dfc..995024d5c9e 100644
--- a/deps/openssl/openssl/crypto/store/store_local.h
+++ b/deps/openssl/openssl/crypto/store/store_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,11 +7,13 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_STORE_STORE_LOCAL_H)
+#define OSSL_LIBCRYPTO_STORE_STORE_LOCAL_H
+
 #include <openssl/core_dispatch.h>
 #include "internal/thread_once.h"
 #include "internal/refcount.h"
 #include <openssl/dsa.h>
-#include <openssl/engine.h>
 #include <openssl/evp.h>
 #include <openssl/lhash.h>
 #include <openssl/x509.h>
@@ -38,6 +40,7 @@ struct ossl_store_info_st {
         EVP_PKEY *pkey; /* when type == OSSL_STORE_INFO_PKEY */
         X509 *x509; /* when type == OSSL_STORE_INFO_CERT */
         X509_CRL *crl; /* when type == OSSL_STORE_INFO_CRL */
+        EVP_SKEY *skey; /* when type == OSSL_STORE_INFO_SKEY */
     } _;
 };
 DEFINE_STACK_OF(OSSL_STORE_INFO)
@@ -54,7 +57,7 @@ struct ossl_store_search_st {
      * Used by OSSL_STORE_SEARCH_BY_NAME and
      * OSSL_STORE_SEARCH_BY_ISSUER_SERIAL
      */
-    X509_NAME *name;
+    const X509_NAME *name;

     /* Used by OSSL_STORE_SEARCH_BY_ISSUER_SERIAL */
     const ASN1_INTEGER *serial;
@@ -83,7 +86,6 @@ struct ossl_store_loader_st {
 #ifndef OPENSSL_NO_DEPRECATED_3_0
     /* Legacy stuff */
     const char *scheme;
-    ENGINE *engine;
     OSSL_STORE_open_fn open;
     OSSL_STORE_attach_fn attach;
     OSSL_STORE_ctrl_fn ctrl;
@@ -102,6 +104,7 @@ struct ossl_store_loader_st {
     const char *propdef;
     const char *description;

+    int no_store;
     CRYPTO_REF_COUNT refcnt;

     OSSL_FUNC_store_open_fn *p_open;
@@ -176,3 +179,5 @@ struct ossl_load_result_data_st {
     OSSL_STORE_CTX *ctx;
 };
 OSSL_CALLBACK ossl_store_handle_load_result;
+
+#endif /* !defined(OSSL_LIBCRYPTO_STORE_STORE_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/store/store_meth.c b/deps/openssl/openssl/crypto/store/store_meth.c
index 09252df0096..5b2b6ac57fe 100644
--- a/deps/openssl/openssl/crypto/store/store_meth.c
+++ b/deps/openssl/openssl/crypto/store/store_meth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -16,17 +16,20 @@
 #include "store_local.h"
 #include "crypto/context.h"

-int OSSL_STORE_LOADER_up_ref(OSSL_STORE_LOADER *loader)
+static int up_ref_loader(void *method)
 {
+    OSSL_STORE_LOADER *loader = (OSSL_STORE_LOADER *)method;
     int ref = 0;

     if (loader->prov != NULL)
-        CRYPTO_UP_REF(&loader->refcnt, &ref);
+        return CRYPTO_UP_REF(&loader->refcnt, &ref);
     return 1;
 }

-void OSSL_STORE_LOADER_free(OSSL_STORE_LOADER *loader)
+static void free_loader(void *method)
 {
+    OSSL_STORE_LOADER *loader = (OSSL_STORE_LOADER *)method;
+
     if (loader != NULL && loader->prov != NULL) {
         int i;

@@ -39,6 +42,27 @@ void OSSL_STORE_LOADER_free(OSSL_STORE_LOADER *loader)
     OPENSSL_free(loader);
 }

+int OSSL_STORE_LOADER_up_ref(OSSL_STORE_LOADER *loader)
+{
+#ifdef OPENSSL_NO_CACHED_FETCH
+    return up_ref_loader(loader);
+#else
+    if (loader->no_store != 0)
+        return up_ref_loader(loader);
+    return 1;
+#endif
+}
+
+void OSSL_STORE_LOADER_free(OSSL_STORE_LOADER *loader)
+{
+#ifdef OPENSSL_NO_CACHED_FETCH
+    free_loader(loader);
+#else
+    if (loader != NULL && (loader->no_store != 0))
+        free_loader(loader);
+#endif
+}
+
 /*
  * OSSL_STORE_LOADER_new() expects the scheme as a constant string,
  * which we currently don't have, so we need an alternative allocator.
@@ -61,16 +85,6 @@ static OSSL_STORE_LOADER *new_loader(OSSL_PROVIDER *prov)
     return loader;
 }

-static int up_ref_loader(void *method)
-{
-    return OSSL_STORE_LOADER_up_ref(method);
-}
-
-static void free_loader(void *method)
-{
-    OSSL_STORE_LOADER_free(method);
-}
-
 /* Data to be passed through ossl_method_construct() */
 struct loader_data_st {
     OSSL_LIB_CTX *libctx;
@@ -176,7 +190,7 @@ static int put_loader_in_store(void *store, void *method,
 }

 static void *loader_from_algorithm(int scheme_id, const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov)
+    OSSL_PROVIDER *prov, int no_store)
 {
     OSSL_STORE_LOADER *loader = NULL;
     const OSSL_DISPATCH *fns = algodef->implementation;
@@ -186,6 +200,7 @@ static void *loader_from_algorithm(int scheme_id, const OSSL_ALGORITHM *algodef,
     loader->scheme_id = scheme_id;
     loader->propdef = algodef->property_definition;
     loader->description = algodef->algorithm_description;
+    loader->no_store = no_store;

     for (; fns->function_id != 0; fns++) {
         switch (fns->function_id) {
@@ -237,7 +252,7 @@ static void *loader_from_algorithm(int scheme_id, const OSSL_ALGORITHM *algodef,
         || loader->p_eof == NULL
         || loader->p_close == NULL) {
         /* Only set_ctx_params is optional */
-        OSSL_STORE_LOADER_free(loader);
+        free_loader(loader);
         ERR_raise(ERR_LIB_OSSL_STORE, OSSL_STORE_R_LOADER_INCOMPLETE);
         return NULL;
     }
@@ -250,7 +265,7 @@ static void *loader_from_algorithm(int scheme_id, const OSSL_ALGORITHM *algodef,
  * then call loader_from_algorithm() with that identity number.
  */
 static void *construct_loader(const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov, void *data)
+    OSSL_PROVIDER *prov, void *data, int no_store)
 {
     /*
      * This function is only called if get_loader_from_store() returned
@@ -266,7 +281,7 @@ static void *construct_loader(const OSSL_ALGORITHM *algodef,
     void *method = NULL;

     if (id != 0)
-        method = loader_from_algorithm(id, algodef, prov);
+        method = loader_from_algorithm(id, algodef, prov, no_store);

     /*
      * Flag to indicate that there was actual construction errors.  This
@@ -282,7 +297,7 @@ static void *construct_loader(const OSSL_ALGORITHM *algodef,
 /* Intermediary function to avoid ugly casts, used below */
 static void destruct_loader(void *method, void *data)
 {
-    OSSL_STORE_LOADER_free(method);
+    free_loader(method);
 }

 /* Fetching support.  Can fetch by numeric identity or by scheme */
@@ -302,7 +317,7 @@ inner_loader_fetch(struct loader_data_st *methdata,
     }

     /* If we haven't received a name id yet, try to get one for the name */
-    id = scheme != NULL ? ossl_namemap_name2num(namemap, scheme) : 0;
+    id = ossl_namemap_name2num(namemap, scheme);

     /*
      * If we haven't found the name yet, chances are that the algorithm to
@@ -338,8 +353,19 @@ inner_loader_fetch(struct loader_data_st *methdata,
              */
             if (id == 0)
                 id = ossl_namemap_name2num(namemap, scheme);
-            ossl_method_store_cache_set(store, prov, id, propq, method,
-                up_ref_loader, free_loader);
+            if (id != 0 && methdata->tmp_store == NULL) {
+                ossl_method_store_cache_set(store, prov, id, propq, method,
+                    up_ref_loader, free_loader);
+            } else {
+                /*
+                 * Like with EVP methods, if the provider requests no caching we need
+                 * to take an extra refcount here so that the tmp_stored loader
+                 * lives beyond the freeing of that tmp_store
+                 */
+#ifndef OPENSSL_NO_CACHED_FETCH
+                OSSL_STORE_LOADER_up_ref((OSSL_STORE_LOADER *)method);
+#endif
+            }
         }

         /*
@@ -501,3 +527,11 @@ int OSSL_STORE_LOADER_names_do_all(const OSSL_STORE_LOADER *loader,

     return 1;
 }
+
+const OSSL_PARAM *
+OSSL_STORE_LOADER_settable_ctx_params(const OSSL_STORE_LOADER *loader)
+{
+    if (loader != NULL && loader->p_settable_ctx_params != NULL)
+        return loader->p_settable_ctx_params(NULL);
+    return NULL;
+}
diff --git a/deps/openssl/openssl/crypto/store/store_register.c b/deps/openssl/openssl/crypto/store/store_register.c
index 461d512bea0..c9d789e27b4 100644
--- a/deps/openssl/openssl/crypto/store/store_register.c
+++ b/deps/openssl/openssl/crypto/store/store_register.c
@@ -13,6 +13,7 @@

 #include <openssl/err.h>
 #include <openssl/lhash.h>
+#include "internal/common.h"
 #include "store_local.h"

 static CRYPTO_RWLOCK *registry_lock;
@@ -32,6 +33,8 @@ OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(ENGINE *e, const char *scheme)
 {
     OSSL_STORE_LOADER *res = NULL;

+    if (!ossl_assert(e == NULL))
+        return NULL;
     /*
      * We usually don't check NULL arguments.  For loaders, though, the
      * scheme is crucial and must never be NULL, or the user will get
@@ -46,16 +49,10 @@ OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(ENGINE *e, const char *scheme)
     if ((res = OPENSSL_zalloc(sizeof(*res))) == NULL)
         return NULL;

-    res->engine = e;
     res->scheme = scheme;
     return res;
 }

-const ENGINE *OSSL_STORE_LOADER_get0_engine(const OSSL_STORE_LOADER *loader)
-{
-    return loader->engine;
-}
-
 const char *OSSL_STORE_LOADER_get0_scheme(const OSSL_STORE_LOADER *loader)
 {
     return loader->scheme;
diff --git a/deps/openssl/openssl/crypto/store/store_result.c b/deps/openssl/openssl/crypto/store/store_result.c
index 84f306f1c7a..a47eb2a601f 100644
--- a/deps/openssl/openssl/crypto/store/store_result.c
+++ b/deps/openssl/openssl/crypto/store/store_result.c
@@ -83,6 +83,8 @@ static int try_crl(struct extracted_param_data_st *, OSSL_STORE_INFO **,
     OSSL_LIB_CTX *, const char *);
 static int try_pkcs12(struct extracted_param_data_st *, OSSL_STORE_INFO **,
     OSSL_STORE_CTX *, OSSL_LIB_CTX *, const char *);
+static int try_skey(struct extracted_param_data_st *, OSSL_STORE_INFO **,
+    const OSSL_PROVIDER *, OSSL_LIB_CTX *, const char *);

 int ossl_store_handle_load_result(const OSSL_PARAM params[], void *arg)
 {
@@ -150,6 +152,10 @@ int ossl_store_handle_load_result(const OSSL_PARAM params[], void *arg)
     if (*v == NULL && !try_pkcs12(&helper_data, v, ctx, libctx, propq))
         goto err;
     ERR_pop_to_mark();
+    ERR_set_mark();
+    if (*v == NULL && !try_skey(&helper_data, v, provider, libctx, propq))
+        goto err;
+    ERR_pop_to_mark();

     if (*v == NULL) {
         const char *hint = "";
@@ -365,7 +371,7 @@ static EVP_PKEY *try_key_value_legacy(struct extracted_param_data_st *data,
                  * No need to check the returned value, |new_der|
                  * will be NULL on error anyway.
                  */
-                PKCS12_pbe_crypt(alg, pbuf, plen,
+                PKCS12_pbe_crypt(alg, pbuf, (int)plen,
                     oct->data, oct->length,
                     &new_der, &len, 0);
                 der_len = len;
@@ -495,11 +501,11 @@ static int try_cert(struct extracted_param_data_st *data, OSSL_STORE_INFO **v,
             ignore_trusted = 0;

         if (d2i_X509_AUX(&cert, (const unsigned char **)&data->octet_data,
-                data->octet_data_size)
+                (long)data->octet_data_size)
                 == NULL
             && (!ignore_trusted
                 || d2i_X509(&cert, (const unsigned char **)&data->octet_data,
-                       data->octet_data_size)
+                       (long)data->octet_data_size)
                     == NULL)) {
             X509_free(cert);
             cert = NULL;
@@ -525,7 +531,7 @@ static int try_crl(struct extracted_param_data_st *data, OSSL_STORE_INFO **v,
         X509_CRL *crl;

         crl = d2i_X509_CRL(NULL, (const unsigned char **)&data->octet_data,
-            data->octet_data_size);
+            (long)data->octet_data_size);

         if (crl != NULL)
             /* We determined the object type */
@@ -557,7 +563,7 @@ static int try_pkcs12(struct extracted_param_data_st *data, OSSL_STORE_INFO **v,
         PKCS12 *p12;

         p12 = d2i_PKCS12(NULL, (const unsigned char **)&data->octet_data,
-            data->octet_data_size);
+            (long)data->octet_data_size);

         if (p12 != NULL) {
             char *pass = NULL;
@@ -598,7 +604,7 @@ static int try_pkcs12(struct extracted_param_data_st *data, OSSL_STORE_INFO **v,
                  * we must do it for PKCS12_parse()
                  */
                 pass[tpass_len] = '\0';
-                if (!PKCS12_verify_mac(p12, pass, tpass_len)) {
+                if (!PKCS12_verify_mac(p12, pass, (int)tpass_len)) {
                     ERR_raise_data(ERR_LIB_OSSL_STORE,
                         OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC,
                         tpass_len == 0 ? "empty password" : "maybe wrong password");
@@ -665,3 +671,50 @@ static int try_pkcs12(struct extracted_param_data_st *data, OSSL_STORE_INFO **v,

     return ok;
 }
+
+static int try_skey(struct extracted_param_data_st *data, OSSL_STORE_INFO **v,
+    const OSSL_PROVIDER *provider, OSSL_LIB_CTX *libctx, const char *propq)
+{
+    EVP_SKEY *skey = NULL;
+    const char *skeymgmt_name = data->data_type == NULL
+        ? OSSL_SKEY_TYPE_GENERIC
+        : data->data_type;
+    size_t keysize = 0;
+    unsigned char *keybytes = NULL;
+
+    if (data->object_type != OSSL_OBJECT_SKEY)
+        return 0;
+
+    if (data->octet_data != NULL) {
+        keysize = data->octet_data_size;
+        keybytes = (unsigned char *)data->octet_data;
+        skey = EVP_SKEY_import_raw_key(libctx, skeymgmt_name,
+            keybytes, keysize, propq);
+    } else if (data->ref != NULL) {
+        EVP_SKEYMGMT *skeymgmt = evp_skeymgmt_fetch_from_prov((OSSL_PROVIDER *)provider,
+            skeymgmt_name, propq);
+        OSSL_PARAM params[2];
+
+        /*
+         * We got an internal reference from a particular provider so we need the SKEYMGMT
+         * exactly from this provider
+         */
+        if (skeymgmt == NULL)
+            return 0;
+
+        keysize = data->ref_size;
+        keybytes = (unsigned char *)data->ref;
+        params[0] = OSSL_PARAM_construct_octet_ptr(OSSL_OBJECT_PARAM_REFERENCE,
+            (void **)&keybytes, keysize);
+        params[1] = OSSL_PARAM_construct_end();
+
+        skey = EVP_SKEY_import_SKEYMGMT(libctx, skeymgmt, OSSL_SKEYMGMT_SELECT_ALL, params);
+    }
+
+    if (skey != NULL)
+        *v = OSSL_STORE_INFO_new_SKEY(skey);
+    if (*v == NULL)
+        EVP_SKEY_free(skey);
+
+    return 1;
+}
diff --git a/deps/openssl/openssl/crypto/store/store_strings.c b/deps/openssl/openssl/crypto/store/store_strings.c
index a5d0b6312cf..e8b17e5188e 100644
--- a/deps/openssl/openssl/crypto/store/store_strings.c
+++ b/deps/openssl/openssl/crypto/store/store_strings.c
@@ -11,13 +11,14 @@

 #include "internal/nelem.h"

-static char *type_strings[] = {
+static const char *const type_strings[] = {
     "Name", /* OSSL_STORE_INFO_NAME */
     "Parameters", /* OSSL_STORE_INFO_PARAMS */
     "Public key", /* OSSL_STORE_INFO_PUBKEY */
     "Pkey", /* OSSL_STORE_INFO_PKEY */
     "Certificate", /* OSSL_STORE_INFO_CERT */
-    "CRL" /* OSSL_STORE_INFO_CRL */
+    "CRL", /* OSSL_STORE_INFO_CRL */
+    "Symmetric key" /* OSSL_STORE_INFO_SKEY */
 };

 const char *OSSL_STORE_INFO_type_string(int type)
diff --git a/deps/openssl/openssl/crypto/thread/arch/thread_win.c b/deps/openssl/openssl/crypto/thread/arch/thread_win.c
index 541d0586eb0..2bd649c3233 100644
--- a/deps/openssl/openssl/crypto/thread/arch/thread_win.c
+++ b/deps/openssl/openssl/crypto/thread/arch/thread_win.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,11 +7,11 @@
  * https://www.openssl.org/source/license.html
  */

-#include <internal/thread_arch.h>
+#include "internal/thread_arch.h"
+#include "internal/e_os.h"

 #if defined(OPENSSL_THREADS_WINNT)
 #include <process.h>
-#include <windows.h>

 static unsigned __stdcall thread_start_thunk(LPVOID vthread)
 {
@@ -504,7 +504,7 @@ void ossl_crypto_condvar_broadcast(CRYPTO_CONDVAR *cv_)
     cv->closed = 1;

     ossl_crypto_mutex_unlock(cv->int_m);
-    ReleaseSemaphore(cv->sema, num_wake, NULL);
+    ReleaseSemaphore(cv->sema, (LONG)num_wake, NULL);
 }

 void ossl_crypto_condvar_signal(CRYPTO_CONDVAR *cv_)
@@ -590,10 +590,4 @@ void ossl_crypto_condvar_free(CRYPTO_CONDVAR **cv)
 }

 #endif
-
-void ossl_crypto_mem_barrier(void)
-{
-    MemoryBarrier();
-}
-
 #endif
diff --git a/deps/openssl/openssl/crypto/thread/build.info b/deps/openssl/openssl/crypto/thread/build.info
index b3bada0ed3a..f24cfedf434 100644
--- a/deps/openssl/openssl/crypto/thread/build.info
+++ b/deps/openssl/openssl/crypto/thread/build.info
@@ -5,13 +5,13 @@ $THREADS_ARCH=\
       arch/thread_win.c arch/thread_posix.c arch/thread_none.c

 IF[{- !$disabled{'thread-pool'} -}]
-  IF[{- !$disabled{quic} -}]
+  IF[{- !$disabled{quic} || !$disabled{dtls} -}]
     SHARED_SOURCE[../../libssl]=$THREADS_ARCH
   ENDIF
   $THREADS=\
         api.c internal.c $THREADS_ARCH
 ELSE
-  IF[{- !$disabled{quic} -}]
+  IF[{- !$disabled{quic} || !$disabled{dtls} -}]
     SOURCE[../../libssl]=$THREADS_ARCH
   ENDIF
   $THREADS=api.c arch/thread_win.c
diff --git a/deps/openssl/openssl/crypto/threads_common.c b/deps/openssl/openssl/crypto/threads_common.c
new file mode 100644
index 00000000000..36e965a4ae0
--- /dev/null
+++ b/deps/openssl/openssl/crypto/threads_common.c
@@ -0,0 +1,414 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/**
+ * @file
+ * @brief Thread-local context-specific data management for OpenSSL
+ *
+ * This file implements a mechanism to store and retrieve context-specific
+ * data using OpenSSL's thread-local storage (TLS) system. It provides a way
+ * to associate and manage data based on a combination of a thread-local key
+ * and an `OSSL_LIB_CTX *` context.
+ *
+ * NOTE: This differs from the CRYPTO_THREAD_[get|set]_local api set in that
+ * this api stores a single OS level thread-local key per-process, and manages
+ * subsequent keys using a series of arrays and sparse arrays stored against
+ * that aforementioned thread local key
+ *
+ * Data Design:
+ *
+ * per-thread master key data  -> +--------------+-+
+ *                                |              | |
+ *                                |              | |
+ *                                +--------------+ |
+ *                                +--------------+ |
+ *                                |              | |
+ *                                |              | |
+ *                                +--------------+ |  fixed  array indexed
+ *                                       .         |      by key id
+ *                                       .         |
+ *                                       .         |
+ *                                +--------------+ |
+ *                                |              | |
+ *                                |       |      | |
+ *                                +-------+------+-+
+ *                                        |
+ *           ++---------------+           |
+ *           ||               |<----------+
+ *           ||               |
+ *           |+---------------+
+ *           |+---------------+
+ *           ||               |
+ *           ||               |  sparse array indexed
+ *           |+---------------+     by libctx pointer
+ *           |        .              cast to uintptr_t
+ *           |        .
+ *           |        .
+ *           |+---------------+
+ *           ||        +------+----> +-----------------+
+ *           ||        |      |      |                 |
+ *           ++--------+------+      +-----------------+
+ *                                  per-<thread*ctx> data
+ *
+ * It uses the following lookup pattern:
+ *   1) A global os defined key to a per-thread fixed array
+ *   2) A libcrypto defined key id as an index to (1) to get a sparse array
+ *   3) A Library context pointer as an index to (2) to produce a per
+ *      thread*context data pointer
+ *
+ * Two primary functions are provided:
+ *   - CRYPTO_THREAD_get_local_ex() retrieves data associated with a key and
+ *     context.
+ *   - CRYPTO_THREAD_set_local_ex() associates data with a given key and
+ *     context, allocating tables as needed.
+ *
+ * Internal structures:
+ *   - CTX_TABLE_ENTRY: wraps a context-specific data pointer.
+ *   - MASTER_KEY_ENTRY: maintains a table of CTX_TABLE_ENTRY and an optional
+ *     cleanup function.
+ *
+ * The implementation ensures:
+ *   - Lazy initialization of master key data using CRYPTO_ONCE.
+ *   - Automatic cleanup of all context and key mappings when a thread exits.
+ *
+ * Cleanup routines:
+ *   - clean_ctx_entry: releases context-specific entries.
+ *   - clean_master_key_id: releases all entries for a specific key ID.
+ *   - clean_master_key: top-level cleanup for the thread-local master key.
+ *
+ */
+
+#include <openssl/crypto.h>
+#include <crypto/cryptlib.h>
+#include <crypto/sparse_array.h>
+#include "internal/cryptlib.h"
+#include "internal/threads_common.h"
+
+/**
+ * @struct CTX_TABLE_ENTRY
+ * @brief Represents a wrapper for context-specific data.
+ *
+ * This structure is used to hold a pointer to data that is associated
+ * with a particular `OSSL_LIB_CTX` instance in a thread-local context
+ * mapping. It is stored within a sparse array, allowing efficient
+ * per-context data lookup keyed by a context identifier.
+ *
+ * @var CTX_TABLE_ENTRY::ctx_data
+ * Pointer to the data associated with a given library context.
+ */
+typedef void *CTX_TABLE_ENTRY;
+
+/*
+ * define our sparse array of CTX_TABLE_ENTRY functions
+ */
+DEFINE_SPARSE_ARRAY_OF(CTX_TABLE_ENTRY);
+
+/**
+ * @struct MASTER_KEY_ENTRY
+ * @brief Represents a mapping of context-specific data for a TLS key ID.
+ *
+ * This structure manages a collection of `CTX_TABLE_ENTRY` items, each
+ * associated with a different `OSSL_LIB_CTX` instance. It supports
+ * cleanup of stored data when the thread or key is being destroyed.
+ *
+ * @var MASTER_KEY_ENTRY::ctx_table
+ * Sparse array mapping `OSSL_LIB_CTX` pointers (cast to uintptr_t) to
+ * `CTX_TABLE_ENTRY` structures that hold context-specific data.
+ *
+ */
+typedef struct master_key_entry {
+    SPARSE_ARRAY_OF(CTX_TABLE_ENTRY) *ctx_table;
+} MASTER_KEY_ENTRY;
+
+/**
+ * @brief holds our per thread data with the operating system
+ *
+ * Global thread local storage pointer, used to create a platform
+ * specific thread-local key
+ */
+static CRYPTO_THREAD_LOCAL master_key;
+
+/**
+ * @brief Informs the library if the master key has been set up
+ *
+ * State variable to track if we have initialized the master_key
+ * If this isn't set to 1, then we need to skip any cleanup
+ * in CRYPTO_THREAD_clean_for_fips, as the uninitialized key
+ * will return garbage data
+ */
+static uint8_t master_key_init = 0;
+
+/**
+ * @brief gate variable to do one time init of the master key
+ *
+ * Run once gate for doing one-time initialization
+ */
+static CRYPTO_ONCE master_once = CRYPTO_ONCE_STATIC_INIT;
+
+/**
+ * @brief Cleans up all context-specific entries for a given key ID.
+ *
+ * This function is used to release all context data associated with a
+ * specific thread-local key (identified by `idx`). It iterates over the
+ * context table in the given `MASTER_KEY_ENTRY`, invoking cleanup for each
+ * `CTX_TABLE_ENTRY`, then frees the context table and the entry itself.
+ *
+ * @param idx
+ *        The key ID associated with the `MASTER_KEY_ENTRY`. Unused.
+ *
+ * @param entry
+ *        Pointer to the `MASTER_KEY_ENTRY` containing the context table
+ *        to be cleaned up.
+ *
+ * @param arg
+ *        Unused parameter.
+ */
+static void clean_master_key_id(MASTER_KEY_ENTRY *entry)
+{
+    ossl_sa_CTX_TABLE_ENTRY_free(entry->ctx_table);
+}
+
+/**
+ * @brief Cleans up all master key entries for the current thread.
+ *
+ * This function is the top-level cleanup routine for the thread-local
+ * storage associated with OpenSSL master keys. It is typically registered
+ * as the thread-local storage destructor. It iterates over all
+ * `MASTER_KEY_ENTRY` items in the sparse array, releasing associated
+ * context data and structures.
+ *
+ * @param data
+ *        Pointer to the thread-local `SPARSE_ARRAY_OF(MASTER_KEY_ENTRY)`
+ *        structure to be cleaned up.
+ */
+static void clean_master_key(void *data)
+{
+    MASTER_KEY_ENTRY *mkey = data;
+    int i;
+
+    if (data == NULL)
+        return;
+
+    for (i = 0; i < CRYPTO_THREAD_LOCAL_KEY_MAX; i++) {
+        if (mkey[i].ctx_table != NULL)
+            clean_master_key_id(&mkey[i]);
+    }
+    OPENSSL_free(mkey);
+}
+
+/**
+ * @brief Initializes the thread-local storage for master key data.
+ *
+ * This function sets up the thread-local key used to store per-thread
+ * master key tables. It also registers the `clean_master_key` function
+ * as the destructor to be called when the thread exits.
+ *
+ * This function is intended to be called once using `CRYPTO_THREAD_run_once`
+ * to ensure thread-safe initialization.
+ */
+static void init_master_key(void)
+{
+    /*
+     * Note: We assign a cleanup function here, which is atypical for
+     * uses of CRYPTO_THREAD_init_local.  This is because, nominally
+     * we expect that the use of ossl_init_thread_start will be used
+     * to notify openssl of exiting threads.  However, in this case
+     * we want the metadata for this interface (the sparse arrays) to
+     * stay valid until the thread actually exits, which is what the
+     * clean_master_key function does.  Data held in the sparse arrays
+     * (that is assigned via CRYPTO_THREAD_set_local_ex), are still expected
+     * to be cleaned via the ossl_init_thread_start/stop api.
+     */
+    if (!CRYPTO_THREAD_init_local(&master_key, clean_master_key))
+        return;
+
+    /*
+     * Indicate that the key has been set up.
+     */
+    master_key_init = 1;
+}
+
+/**
+ * @brief Retrieves context-specific data from thread-local storage.
+ *
+ * This function looks up and returns the data associated with a given
+ * thread-local key ID and `OSSL_LIB_CTX` context. The data must have
+ * previously been stored using `CRYPTO_THREAD_set_local_ex()`.
+ *
+ * If the master key table is not yet initialized, it will be lazily
+ * initialized via `init_master_key()`. If the requested key or context
+ * entry does not exist, `NULL` is returned.
+ *
+ * @param id
+ *        The thread-local key ID used to identify the master key entry.
+ *
+ * @param ctx
+ *        Pointer to the `OSSL_LIB_CTX` used to index into the context
+ *        table for the specified key.
+ *
+ * @return A pointer to the stored context-specific data, or NULL if no
+ *         entry is found or initialization fails.
+ */
+void *CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_KEY_ID id, OSSL_LIB_CTX *ctx)
+{
+    MASTER_KEY_ENTRY *mkey;
+    CTX_TABLE_ENTRY ctxd;
+
+    ctx = (ctx == CRYPTO_THREAD_NO_CONTEXT) ? NULL : ossl_lib_ctx_get_concrete(ctx);
+    /*
+     * Make sure the master key has been initialized
+     * NOTE: We use CRYPTO_THREAD_run_once here, rather than the
+     * RUN_ONCE macros.  We do this because this code is included both in
+     * libcrypto, and in fips.[dll|dylib|so].  FIPS attempts to avoid doing
+     * one time initialization of global data, and so suppresses the definition
+     * of RUN_ONCE, etc, meaning the build breaks if we were to use that with
+     * fips-enabled.  However, this is a special case in which we want/need
+     * this one bit of global data to be initialized in both the fips provider
+     * and in libcrypto, so we use CRYPTO_THREAD_run_one directly, which is
+     * always defined.
+     */
+    if (!CRYPTO_THREAD_run_once(&master_once, init_master_key))
+        return NULL;
+
+    if (!ossl_assert(id < CRYPTO_THREAD_LOCAL_KEY_MAX))
+        return NULL;
+
+    /*
+     * Get our master table sparse array, indexed by key id
+     */
+    mkey = CRYPTO_THREAD_get_local(&master_key);
+    if (mkey == NULL)
+        return NULL;
+
+    /*
+     * Get the specific data entry in the master key
+     * table for the key id we are searching for
+     */
+    if (mkey[id].ctx_table == NULL)
+        return NULL;
+
+    /*
+     * If we find an entry above, that will be a sparse array,
+     * indexed by OSSL_LIB_CTX.
+     * Note: Because we're using sparse arrays here, we can do an easy
+     * trick, since we know all OSSL_LIB_CTX pointers are unique.  By casting
+     * the pointer to a unitptr_t, we can use that as an ordinal index into
+     * the sparse array.
+     */
+    ctxd = ossl_sa_CTX_TABLE_ENTRY_get(mkey[id].ctx_table, (uintptr_t)ctx);
+
+    /*
+     * If we find an entry for the passed in context, return its data pointer
+     */
+    return ctxd;
+}
+
+/**
+ * @brief Associates context-specific data with a thread-local key.
+ *
+ * This function stores a pointer to data associated with a specific
+ * thread-local key ID and `OSSL_LIB_CTX` context. It ensures that the
+ * internal thread-local master key table and all necessary sparse array
+ * structures are initialized and allocated as needed.
+ *
+ * If the key or context-specific entry does not already exist, they will
+ * be created. This function allows each thread to maintain separate data
+ * for different library contexts under a shared key identifier.
+ *
+ * @param id
+ *        The thread-local key ID to associate the data with.
+ *
+ * @param ctx
+ *        Pointer to the `OSSL_LIB_CTX` used as a secondary key for storing
+ *        the data.
+ *
+ * @param data
+ *        Pointer to the user-defined context-specific data to store.
+ *
+ * @return 1 on success, or 0 if allocation or initialization fails.
+ */
+int CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_KEY_ID id,
+    OSSL_LIB_CTX *ctx, void *data)
+{
+    MASTER_KEY_ENTRY *mkey;
+
+    ctx = (ctx == CRYPTO_THREAD_NO_CONTEXT) ? NULL : ossl_lib_ctx_get_concrete(ctx);
+    /*
+     * Make sure our master key is initialized
+     * See notes above on the use of CRYPTO_THREAD_run_once here
+     */
+    if (!CRYPTO_THREAD_run_once(&master_once, init_master_key))
+        return 0;
+
+    if (!ossl_assert(id < CRYPTO_THREAD_LOCAL_KEY_MAX))
+        return 0;
+
+    /*
+     * Get our local master key data, which will be
+     * a sparse array indexed by the id parameter
+     */
+    mkey = CRYPTO_THREAD_get_local(&master_key);
+    if (mkey == NULL) {
+        /*
+         * we didn't find one, but that's ok, just initialize it now
+         */
+        mkey = OPENSSL_calloc(CRYPTO_THREAD_LOCAL_KEY_MAX,
+            sizeof(MASTER_KEY_ENTRY));
+        if (mkey == NULL)
+            return 0;
+        /*
+         * make sure to assign it to our master key thread-local storage
+         */
+        if (!CRYPTO_THREAD_set_local(&master_key, mkey)) {
+            OPENSSL_free(mkey);
+            return 0;
+        }
+    }
+
+    /*
+     * Find the entry that we are looking for using our id index
+     */
+    if (mkey[id].ctx_table == NULL) {
+
+        /*
+         * Didn't find it, that's ok, just add it now
+         */
+        mkey[id].ctx_table = ossl_sa_CTX_TABLE_ENTRY_new();
+        if (mkey[id].ctx_table == NULL)
+            return 0;
+    }
+
+    /*
+     * Now go look up our per context entry, using the OSSL_LIB_CTX pointer
+     * that we've been provided.  Note we cast the pointer to a uintptr_t so
+     * as to use it as an index in the sparse array
+     *
+     * Assign to the entry in the table so that we can find it later
+     */
+    return ossl_sa_CTX_TABLE_ENTRY_set(mkey[id].ctx_table,
+        (uintptr_t)ctx, data);
+}
+
+void CRYPTO_THREAD_clean_local(void)
+{
+    MASTER_KEY_ENTRY *mkey;
+
+    /*
+     * If we never initialized the master key, there
+     * is no data to clean, so we are done here
+     */
+    if (master_key_init == 0)
+        return;
+
+    mkey = CRYPTO_THREAD_get_local(&master_key);
+    if (mkey != NULL) {
+        clean_master_key(mkey);
+        CRYPTO_THREAD_set_local(&master_key, NULL);
+    }
+}
diff --git a/deps/openssl/openssl/crypto/threads_none.c b/deps/openssl/openssl/crypto/threads_none.c
index cf2091c2c27..170fa328973 100644
--- a/deps/openssl/openssl/crypto/threads_none.c
+++ b/deps/openssl/openssl/crypto/threads_none.c
@@ -10,7 +10,6 @@
 #include <openssl/crypto.h>
 #include "internal/cryptlib.h"
 #include "internal/rcu.h"
-#include "crypto/cryptlib.h"
 #include "rcu_internal.h"

 #if !defined(OPENSSL_THREADS) || defined(CRYPTO_TDEBUG)
@@ -38,9 +37,9 @@ void ossl_rcu_lock_free(CRYPTO_RCU_LOCK *lock)
     OPENSSL_free(lock);
 }

-void ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock)
+int ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock)
 {
-    return;
+    return 1;
 }

 void ossl_rcu_write_lock(CRYPTO_RCU_LOCK *lock)
@@ -167,7 +166,7 @@ struct thread_local_storage_entry {

 static struct thread_local_storage_entry thread_local_storage[OPENSSL_CRYPTO_THREAD_LOCAL_KEY_MAX];

-int ossl_thread_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))
+int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))
 {
     int entry_idx = 0;

@@ -217,7 +216,7 @@ int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key)

 CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void)
 {
-    return 1;
+    return 0;
 }

 int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)
@@ -281,6 +280,41 @@ int CRYPTO_atomic_load_int(int *val, int *ret, CRYPTO_RWLOCK *lock)
     return 1;
 }

+int CRYPTO_atomic_store_int(int *dst, int val, CRYPTO_RWLOCK *lock)
+{
+    *dst = val;
+
+    return 1;
+}
+
+int CRYPTO_atomic_load_ptr(void **ptr, void **ret, CRYPTO_RWLOCK *lock)
+{
+    *ret = *ptr;
+    return 1;
+}
+
+int CRYPTO_atomic_store_ptr(void **dst, void **val, CRYPTO_RWLOCK *lock)
+{
+    *dst = *val;
+    return 1;
+}
+
+int CRYPTO_atomic_cmp_exch_ptr(void **ptr, void **expect, void *desire, CRYPTO_RWLOCK *lock, int *lock_failed)
+{
+    int lock_sink;
+
+    if (lock_failed == NULL)
+        lock_failed = &lock_sink;
+
+    *lock_failed = 0;
+    if (*ptr == *expect) {
+        *ptr = desire;
+        return 1;
+    }
+    *expect = *ptr;
+    return 0;
+}
+
 int openssl_init_fork_handlers(void)
 {
     return 0;
diff --git a/deps/openssl/openssl/crypto/threads_pthread.c b/deps/openssl/openssl/crypto/threads_pthread.c
index 70e09b75586..7cf820b5467 100644
--- a/deps/openssl/openssl/crypto/threads_pthread.c
+++ b/deps/openssl/openssl/crypto/threads_pthread.c
@@ -10,20 +10,42 @@
 /* We need to use the OPENSSL_fork_*() deprecated APIs */
 #define OPENSSL_SUPPRESS_DEPRECATED

+#if !defined(__GNUC__) || !defined(__ATOMIC_ACQ_REL) || defined(BROKEN_CLANG_ATOMICS) || defined(OPENSSL_NO_STDIO)
+/*
+ * we only enable REPORT_RWLOCK_CONTENTION on clang/gcc when we have
+ * atomics available.  We do this because we need to use an atomic to track
+ * when we can close the log file.  We could use the CRYPTO_atomic_ api
+ * but that requires lock creation which gets us into a bad recursive loop
+ * when we try to initialize the file pointer
+ */
+#ifdef REPORT_RWLOCK_CONTENTION
+#warning "RWLOCK CONTENTION REPORTING NOT SUPPORTED, Disabling"
+#undef REPORT_RWLOCK_CONTENTION
+#endif
+#endif
+
+#ifdef REPORT_RWLOCK_CONTENTION
+#define _GNU_SOURCE
+#include <execinfo.h>
+#include <unistd.h>
+#endif
+
 #include <openssl/crypto.h>
 #include <crypto/cryptlib.h>
+#include <crypto/sparse_array.h>
 #include "internal/cryptlib.h"
+#include "internal/threads_common.h"
 #include "internal/rcu.h"
-#include "rcu_internal.h"
-
-#if defined(__clang__) && defined(__has_feature)
-#if __has_feature(thread_sanitizer)
-#define __SANITIZE_THREAD__
-#endif
+#ifdef REPORT_RWLOCK_CONTENTION
+#include <fcntl.h>
+#include <stdbool.h>
+#include <sys/syscall.h>
+#include <sys/uio.h>
+#include "internal/time.h"
 #endif
+#include "rcu_internal.h"

 #if defined(__SANITIZE_THREAD__)
-#include <sanitizer/tsan_interface.h>
 #define TSAN_FAKE_UNLOCK(x)          \
     __tsan_mutex_pre_unlock((x), 0); \
     __tsan_mutex_post_unlock((x), 0)
@@ -31,27 +53,20 @@
 #define TSAN_FAKE_LOCK(x)          \
     __tsan_mutex_pre_lock((x), 0); \
     __tsan_mutex_post_lock((x), 0, 0)
+
+#define TSAN_LOAD_MEM_ORDER __ATOMIC_ACQUIRE
+#define TSAN_STORE_MEM_ORDER __ATOMIC_RELEASE
 #else
 #define TSAN_FAKE_UNLOCK(x)
 #define TSAN_FAKE_LOCK(x)
+#define TSAN_LOAD_MEM_ORDER __ATOMIC_RELAXED
+#define TSAN_STORE_MEM_ORDER __ATOMIC_RELAXED
 #endif

 #if defined(__sun)
 #include <atomic.h>
 #endif

-#if defined(__apple_build_version__) && __apple_build_version__ < 6000000
-/*
- * OS/X 10.7 and 10.8 had a weird version of clang which has __ATOMIC_ACQUIRE and
- * __ATOMIC_ACQ_REL but which expects only one parameter for __atomic_is_lock_free()
- * rather than two which has signature __atomic_is_lock_free(sizeof(_Atomic(T))).
- * All of this makes impossible to use __atomic_is_lock_free here.
- *
- * See: https://github.com/llvm/llvm-project/commit/a4c2602b714e6c6edb98164550a5ae829b2de760
- */
-#define BROKEN_CLANG_ATOMICS
-#endif
-
 #if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && !defined(OPENSSL_SYS_WINDOWS)

 #if defined(OPENSSL_SYS_UNIX)
@@ -66,7 +81,7 @@
  * implementation
  * Likewise is there a problem with the glibc implementation on riscv.
  */
-#if defined(PTHREAD_RWLOCK_INITIALIZER) && !defined(_KLT_MODEL_) \
+#if defined(PTHREAD_RWLOCK_INITIALIZER) && !defined(_KLT_MODEL_) && !defined(_PUT_MODEL_) \
     && !defined(__riscv)
 #define USE_RWLOCK
 #endif
@@ -95,8 +110,7 @@
  */
 typedef void *pvoid;

-#if defined(__GNUC__) && defined(__ATOMIC_ACQUIRE) && !defined(BROKEN_CLANG_ATOMICS) \
-    && !defined(USE_ATOMIC_FALLBACKS)
+#if defined(OSSL_USE_GCC_ATOMICS)
 #define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
 #define ATOMIC_STORE_N(t, p, v, o) __atomic_store_n(p, v, o)
 #define ATOMIC_STORE(t, p, v, o) __atomic_store(p, v, o)
@@ -295,30 +309,37 @@ static struct rcu_qp *get_hold_current_qp(struct rcu_lock_st *lock)
 static void ossl_rcu_free_local_data(void *arg)
 {
     OSSL_LIB_CTX *ctx = arg;
-    CRYPTO_THREAD_LOCAL *lkey = ossl_lib_ctx_get_rcukey(ctx);
-    struct rcu_thr_data *data = CRYPTO_THREAD_get_local(lkey);
+    struct rcu_thr_data *data = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_RCU_KEY, ctx);

+    CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_RCU_KEY, ctx, NULL);
     OPENSSL_free(data);
-    CRYPTO_THREAD_set_local(lkey, NULL);
 }

-void ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock)
+int ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock)
 {
     struct rcu_thr_data *data;
     int i, available_qp = -1;
-    CRYPTO_THREAD_LOCAL *lkey = ossl_lib_ctx_get_rcukey(lock->ctx);

     /*
      * we're going to access current_qp here so ask the
      * processor to fetch it
      */
-    data = CRYPTO_THREAD_get_local(lkey);
+    data = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_RCU_KEY, lock->ctx);

     if (data == NULL) {
         data = OPENSSL_zalloc(sizeof(*data));
-        OPENSSL_assert(data != NULL);
-        CRYPTO_THREAD_set_local(lkey, data);
-        ossl_init_thread_start(NULL, lock->ctx, ossl_rcu_free_local_data);
+        if (data == NULL)
+            return 0;
+
+        if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_RCU_KEY, lock->ctx, data)) {
+            OPENSSL_free(data);
+            return 0;
+        }
+        if (!ossl_init_thread_start(NULL, lock->ctx, ossl_rcu_free_local_data)) {
+            OPENSSL_free(data);
+            CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_RCU_KEY, lock->ctx, NULL);
+            return 0;
+        }
     }

     for (i = 0; i < MAX_QPS; i++) {
@@ -327,7 +348,7 @@ void ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock)
         /* If we have a hold on this lock already, we're good */
         if (data->thread_qps[i].lock == lock) {
             data->thread_qps[i].depth++;
-            return;
+            return 1;
         }
     }

@@ -339,13 +360,13 @@ void ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock)
     data->thread_qps[available_qp].qp = get_hold_current_qp(lock);
     data->thread_qps[available_qp].depth = 1;
     data->thread_qps[available_qp].lock = lock;
+    return 1;
 }

 void ossl_rcu_read_unlock(CRYPTO_RCU_LOCK *lock)
 {
     int i;
-    CRYPTO_THREAD_LOCAL *lkey = ossl_lib_ctx_get_rcukey(lock->ctx);
-    struct rcu_thr_data *data = CRYPTO_THREAD_get_local(lkey);
+    struct rcu_thr_data *data = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_RCU_KEY, lock->ctx);
     uint64_t ret;

     assert(data != NULL);
@@ -436,7 +457,7 @@ static void retire_qp(CRYPTO_RCU_LOCK *lock, struct rcu_qp *qp)
 static struct rcu_qp *allocate_new_qp_group(CRYPTO_RCU_LOCK *lock,
     uint32_t count)
 {
-    struct rcu_qp *new = OPENSSL_zalloc(sizeof(*new) * count);
+    struct rcu_qp *new = OPENSSL_calloc(count, sizeof(*new));

     lock->group_count = count;
     return new;
@@ -618,11 +639,271 @@ void ossl_rcu_lock_free(CRYPTO_RCU_LOCK *lock)
     OPENSSL_free(rlock);
 }

+#ifdef REPORT_RWLOCK_CONTENTION
+/*
+ * Normally we would use a BIO here to do this, but we create locks during
+ * library initialization, and creating a bio too early, creates a recursive set
+ * of stack calls that leads us to call CRYPTO_thread_run_once while currently
+ * executing the init routine for various run_once functions, which leads to
+ * deadlock.  Avoid that by just using a FILE pointer.  Also note that we
+ * directly use a pthread_mutex_t to protect access from multiple threads
+ * to the contention log file.  We do this because we want to avoid use
+ * of the CRYPTO_THREAD api so as to prevent recursive blocking reports.
+ */
+static CRYPTO_ONCE init_contention_data_flag = CRYPTO_ONCE_STATIC_INIT;
+pthread_mutex_t log_lock = PTHREAD_MUTEX_INITIALIZER;
+CRYPTO_THREAD_LOCAL thread_contention_data;
+
+struct stack_info {
+    unsigned int nptrs;
+    int write;
+    OSSL_TIME start;
+    OSSL_TIME duration;
+    char **strings;
+};
+
+#define STACKS_COUNT 32
+#define BT_BUF_SIZE 1024
+struct stack_traces {
+    int fd;
+    int lock_depth;
+    size_t idx;
+    struct stack_info stacks[STACKS_COUNT];
+};
+
+/* The glibc gettid() definition presents only since 2.30. */
+static ossl_inline pid_t get_tid(void)
+{
+#ifdef OPENSSL_SYS_MACOSX
+    /*
+     * MACOS has the gettid call, but it does something completely different
+     * here than on other unixes.  Specifically it returns the uid of the calling thread
+     * (if set), or -1.  We need to use a MACOS specific call to get the thread id here
+     */
+    uint64_t tid;
+
+    pthread_threadid_np(NULL, &tid);
+    return (pid_t)tid;
+#else
+    return syscall(SYS_gettid);
+#endif
+}
+
+#ifdef FIPS_MODULE
+#define FIPS_SFX "-fips"
+#else
+#define FIPS_SFX ""
+#endif
+static void *init_contention_data(void)
+{
+    struct stack_traces *traces;
+    char fname_fmt[] = "lock-contention-log" FIPS_SFX ".%d.txt";
+    char fname[sizeof(fname_fmt) + sizeof(int) * 3];
+
+    traces = OPENSSL_zalloc(sizeof(struct stack_traces));
+
+    snprintf(fname, sizeof(fname), fname_fmt, get_tid());
+
+    traces->fd = open(fname, O_WRONLY | O_APPEND | O_CLOEXEC | O_CREAT, 0600);
+
+    return traces;
+}
+
+static void destroy_contention_data(void *data)
+{
+    struct stack_traces *st = data;
+
+    close(st->fd);
+    OPENSSL_free(data);
+}
+
+static void init_contention_data_once(void)
+{
+    /*
+     * Create a thread local key here to store our list of stack traces
+     * to be printed when we unlock the lock we are holding
+     */
+    CRYPTO_THREAD_init_local(&thread_contention_data, destroy_contention_data);
+    return;
+}
+
+static struct stack_traces *get_stack_traces(bool init)
+{
+    struct stack_traces *traces = CRYPTO_THREAD_get_local(&thread_contention_data);
+
+    if (!traces && init) {
+        traces = init_contention_data();
+        CRYPTO_THREAD_set_local(&thread_contention_data, traces);
+    }
+
+    return traces;
+}
+
+static void print_stack_traces(struct stack_traces *traces)
+{
+    unsigned int j;
+    struct iovec *iov;
+    int iovcnt;
+
+    while (traces != NULL && traces->idx >= 1) {
+        traces->idx--;
+        dprintf(traces->fd,
+            "lock blocked on %s for %zu usec at time %zu tid %d\n",
+            traces->stacks[traces->idx].write == 1 ? "WRITE" : "READ",
+            ossl_time2us(traces->stacks[traces->idx].duration),
+            ossl_time2us(traces->stacks[traces->idx].start),
+            get_tid());
+        if (traces->stacks[traces->idx].strings != NULL) {
+            static const char lf = '\n';
+
+            iovcnt = traces->stacks[traces->idx].nptrs * 2 + 1;
+            iov = alloca(iovcnt * sizeof(*iov));
+            for (j = 0; j < traces->stacks[traces->idx].nptrs; j++) {
+                iov[2 * j].iov_base = traces->stacks[traces->idx].strings[j];
+                iov[2 * j].iov_len = strlen(traces->stacks[traces->idx].strings[j]);
+                iov[2 * j + 1].iov_base = (char *)&lf;
+                iov[2 * j + 1].iov_len = 1;
+            }
+            iov[traces->stacks[traces->idx].nptrs * 2].iov_base = (char *)&lf;
+            iov[traces->stacks[traces->idx].nptrs * 2].iov_len = 1;
+        } else {
+            static const char no_bt[] = "No stack trace available\n\n";
+
+            iovcnt = 1;
+            iov = alloca(iovcnt * sizeof(*iov));
+            iov[0].iov_base = (char *)no_bt;
+            iov[0].iov_len = sizeof(no_bt) - 1;
+        }
+        writev(traces->fd, iov, iovcnt);
+        free(traces->stacks[traces->idx].strings);
+    }
+}
+
+static ossl_inline void ossl_init_rwlock_contention_data(void)
+{
+    CRYPTO_THREAD_run_once(&init_contention_data_flag, init_contention_data_once);
+}
+
+static int record_lock_contention(pthread_rwlock_t *lock,
+    struct stack_traces *traces, bool write)
+{
+    void *buffer[BT_BUF_SIZE];
+    OSSL_TIME start, end;
+    int ret;
+
+    start = ossl_time_now();
+    ret = (write ? pthread_rwlock_wrlock : pthread_rwlock_rdlock)(lock);
+    if (ret)
+        return ret;
+    end = ossl_time_now();
+    traces->stacks[traces->idx].nptrs = backtrace(buffer, BT_BUF_SIZE);
+    traces->stacks[traces->idx].strings = backtrace_symbols(buffer,
+        traces->stacks[traces->idx].nptrs);
+    traces->stacks[traces->idx].duration = ossl_time_subtract(end, start);
+    traces->stacks[traces->idx].start = start;
+    traces->stacks[traces->idx].write = write;
+    traces->idx++;
+    if (traces->idx >= STACKS_COUNT) {
+        fprintf(stderr, "STACK RECORD OVERFLOW!\n");
+        print_stack_traces(traces);
+    }
+
+    return 0;
+}
+
+static ossl_inline int ossl_rwlock_rdlock(pthread_rwlock_t *lock)
+{
+    struct stack_traces *traces = get_stack_traces(true);
+
+    if (ossl_unlikely(traces == NULL))
+        return ENOMEM;
+
+    traces->lock_depth++;
+    if (pthread_rwlock_tryrdlock(lock)) {
+        int ret = record_lock_contention(lock, traces, false);
+
+        if (ret)
+            traces->lock_depth--;
+
+        return ret;
+    }
+
+    return 0;
+}
+
+static ossl_inline int ossl_rwlock_wrlock(pthread_rwlock_t *lock)
+{
+    struct stack_traces *traces = get_stack_traces(true);
+
+    if (ossl_unlikely(traces == NULL))
+        return ENOMEM;
+
+    traces->lock_depth++;
+    if (pthread_rwlock_trywrlock(lock)) {
+        int ret = record_lock_contention(lock, traces, true);
+
+        if (ret)
+            traces->lock_depth--;
+
+        return ret;
+    }
+
+    return 0;
+}
+
+static ossl_inline int ossl_rwlock_unlock(pthread_rwlock_t *lock)
+{
+    int ret;
+
+    ret = pthread_rwlock_unlock(lock);
+    if (ret)
+        return ret;
+
+    {
+        struct stack_traces *traces = get_stack_traces(false);
+
+        if (traces != NULL) {
+            traces->lock_depth--;
+            assert(traces->lock_depth >= 0);
+            if (traces->lock_depth == 0)
+                print_stack_traces(traces);
+        }
+    }
+
+    return 0;
+}
+
+#else /* !REPORT_RWLOCK_CONTENTION */
+
+#if defined(USE_RWLOCK)
+static ossl_inline void ossl_init_rwlock_contention_data(void)
+{
+}
+
+static ossl_inline int ossl_rwlock_rdlock(pthread_rwlock_t *rwlock)
+{
+    return pthread_rwlock_rdlock(rwlock);
+}
+
+static ossl_inline int ossl_rwlock_wrlock(pthread_rwlock_t *rwlock)
+{
+    return pthread_rwlock_wrlock(rwlock);
+}
+
+static ossl_inline int ossl_rwlock_unlock(pthread_rwlock_t *rwlock)
+{
+    return pthread_rwlock_unlock(rwlock);
+}
+#endif /* USE_RWLOCK */
+#endif /* REPORT_RWLOCK_CONTENTION */
+
 CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
 {
 #ifdef USE_RWLOCK
     CRYPTO_RWLOCK *lock;

+    ossl_init_rwlock_contention_data();
+
     if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL)
         /* Don't set error, to avoid recursion blowup. */
         return NULL;
@@ -666,7 +947,7 @@ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
 __owur int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)
 {
 #ifdef USE_RWLOCK
-    if (!ossl_assert(pthread_rwlock_rdlock(lock) == 0))
+    if (!ossl_assert(ossl_rwlock_rdlock(lock) == 0))
         return 0;
 #else
     if (pthread_mutex_lock(lock) != 0) {
@@ -681,7 +962,7 @@ __owur int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)
 __owur int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock)
 {
 #ifdef USE_RWLOCK
-    if (!ossl_assert(pthread_rwlock_wrlock(lock) == 0))
+    if (!ossl_assert(ossl_rwlock_wrlock(lock) == 0))
         return 0;
 #else
     if (pthread_mutex_lock(lock) != 0) {
@@ -696,7 +977,7 @@ __owur int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock)
 int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock)
 {
 #ifdef USE_RWLOCK
-    if (pthread_rwlock_unlock(lock) != 0)
+    if (ossl_rwlock_unlock(lock) != 0)
         return 0;
 #else
     if (pthread_mutex_unlock(lock) != 0) {
@@ -725,15 +1006,14 @@ void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock)

 int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
 {
-    if (pthread_once(once, init) != 0)
+    if (ossl_unlikely(pthread_once(once, init) != 0))
         return 0;

     return 1;
 }

-int ossl_thread_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))
+int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))
 {
-
     if (pthread_key_create(key, cleanup) != 0)
         return 0;

@@ -773,12 +1053,12 @@ int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)

 int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
 {
-#if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
+#if defined(OSSL_USE_GCC_ATOMICS)
     if (__atomic_is_lock_free(sizeof(*val), val)) {
         *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL);
         return 1;
     }
-#elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
+#elif defined(OSSL_USE_SOLARIS_ATOMICS)
     /* This will work for all future Solaris versions. */
     if (ret != NULL) {
         *ret = atomic_add_int_nv((volatile unsigned int *)val, amount);
@@ -800,12 +1080,12 @@ int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
 int CRYPTO_atomic_add64(uint64_t *val, uint64_t op, uint64_t *ret,
     CRYPTO_RWLOCK *lock)
 {
-#if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
+#if defined(OSSL_USE_GCC_ATOMICS)
     if (__atomic_is_lock_free(sizeof(*val), val)) {
         *ret = __atomic_add_fetch(val, op, __ATOMIC_ACQ_REL);
         return 1;
     }
-#elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
+#elif defined(OSSL_USE_SOLARIS_ATOMICS)
     /* This will work for all future Solaris versions. */
     if (ret != NULL) {
         *ret = atomic_add_64_nv(val, op);
@@ -826,12 +1106,12 @@ int CRYPTO_atomic_add64(uint64_t *val, uint64_t op, uint64_t *ret,
 int CRYPTO_atomic_and(uint64_t *val, uint64_t op, uint64_t *ret,
     CRYPTO_RWLOCK *lock)
 {
-#if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
+#if defined(OSSL_USE_GCC_ATOMICS)
     if (__atomic_is_lock_free(sizeof(*val), val)) {
         *ret = __atomic_and_fetch(val, op, __ATOMIC_ACQ_REL);
         return 1;
     }
-#elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
+#elif defined(OSSL_USE_SOLARIS_ATOMICS)
     /* This will work for all future Solaris versions. */
     if (ret != NULL) {
         *ret = atomic_and_64_nv(val, op);
@@ -852,12 +1132,12 @@ int CRYPTO_atomic_and(uint64_t *val, uint64_t op, uint64_t *ret,
 int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret,
     CRYPTO_RWLOCK *lock)
 {
-#if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
+#if defined(OSSL_USE_GCC_ATOMICS)
     if (__atomic_is_lock_free(sizeof(*val), val)) {
         *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
         return 1;
     }
-#elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
+#elif defined(OSSL_USE_SOLARIS_ATOMICS)
     /* This will work for all future Solaris versions. */
     if (ret != NULL) {
         *ret = atomic_or_64_nv(val, op);
@@ -877,12 +1157,12 @@ int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret,

 int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock)
 {
-#if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
+#if defined(OSSL_USE_GCC_ATOMICS)
     if (__atomic_is_lock_free(sizeof(*val), val)) {
         __atomic_load(val, ret, __ATOMIC_ACQUIRE);
         return 1;
     }
-#elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
+#elif defined(OSSL_USE_SOLARIS_ATOMICS)
     /* This will work for all future Solaris versions. */
     if (ret != NULL) {
         *ret = atomic_or_64_nv(val, 0);
@@ -900,12 +1180,12 @@ int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock)

 int CRYPTO_atomic_store(uint64_t *dst, uint64_t val, CRYPTO_RWLOCK *lock)
 {
-#if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
+#if defined(OSSL_USE_GCC_ATOMICS)
     if (__atomic_is_lock_free(sizeof(*dst), dst)) {
         __atomic_store(dst, &val, __ATOMIC_RELEASE);
         return 1;
     }
-#elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
+#elif defined(OSSL_USE_SOLARIS_ATOMICS)
     /* This will work for all future Solaris versions. */
     if (dst != NULL) {
         atomic_swap_64(dst, val);
@@ -923,12 +1203,12 @@ int CRYPTO_atomic_store(uint64_t *dst, uint64_t val, CRYPTO_RWLOCK *lock)

 int CRYPTO_atomic_load_int(int *val, int *ret, CRYPTO_RWLOCK *lock)
 {
-#if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
+#if defined(OSSL_USE_GCC_ATOMICS)
     if (__atomic_is_lock_free(sizeof(*val), val)) {
         __atomic_load(val, ret, __ATOMIC_ACQUIRE);
         return 1;
     }
-#elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
+#elif defined(OSSL_USE_SOLARIS_ATOMICS)
     /* This will work for all future Solaris versions. */
     if (ret != NULL) {
         *ret = (int)atomic_or_uint_nv((unsigned int *)val, 0);
@@ -944,6 +1224,89 @@ int CRYPTO_atomic_load_int(int *val, int *ret, CRYPTO_RWLOCK *lock)
     return 1;
 }

+int CRYPTO_atomic_store_int(int *dst, int val, CRYPTO_RWLOCK *lock)
+{
+#if defined(OSSL_USE_GCC_ATOMICS)
+    if (__atomic_is_lock_free(sizeof(*dst), dst)) {
+        __atomic_store(dst, &val, __ATOMIC_RELEASE);
+        return 1;
+    }
+#elif defined(OSSL_USE_SOLARIS_ATOMICS)
+    /* This will work for all future Solaris versions. */
+    if (dst != NULL) {
+        atomic_swap_uint((unsigned int)dst, (unsigned int)val);
+        return 1;
+    }
+#endif
+    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
+        return 0;
+    *dst = val;
+    if (!CRYPTO_THREAD_unlock(lock))
+        return 0;
+
+    return 1;
+}
+
+int CRYPTO_atomic_load_ptr(void **ptr, void **ret, CRYPTO_RWLOCK *lock)
+{
+#if defined(__GNUC__) && defined(__ATOMIC_RELAXED) && !defined(BROKEN_CLANG_ATOMICS)
+    *ret = __atomic_load_n(ptr, TSAN_LOAD_MEM_ORDER);
+    return 1;
+#else
+    if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
+        return 0;
+    *ret = *ptr;
+    if (!CRYPTO_THREAD_unlock(lock))
+        return 0;
+    return 1;
+#endif
+}
+
+int CRYPTO_atomic_store_ptr(void **dst, void **val, CRYPTO_RWLOCK *lock)
+{
+#if defined(__GNUC__) && defined(__ATOMIC_RELAXED) && !defined(BROKEN_CLANG_ATOMICS)
+    __atomic_store(dst, val, TSAN_STORE_MEM_ORDER);
+    return 1;
+#else
+    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
+        return 0;
+    *dst = *val;
+    if (!CRYPTO_THREAD_unlock(lock))
+        return 0;
+    return 1;
+#endif
+}
+
+int CRYPTO_atomic_cmp_exch_ptr(void **ptr, void **expect, void *desire, CRYPTO_RWLOCK *lock, int *lock_failed)
+{
+#if defined(__GNUC__) && defined(__ATOMIC_RELAXED) && !defined(BROKEN_CLANG_ATOMICS)
+    if (lock_failed != NULL)
+        *lock_failed = 0;
+    return __atomic_compare_exchange_n(ptr, expect, desire, 0, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED) ? 1 : 0;
+#else
+    int lock_sink;
+    int ret = 0;
+
+    if (lock_failed == NULL)
+        lock_failed = &lock_sink;
+
+    *lock_failed = 0;
+    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock)) {
+        *lock_failed = 1;
+        return 0;
+    }
+    if (*ptr == *expect) {
+        ret = 1;
+        *ptr = desire;
+    } else {
+        *expect = *ptr;
+    }
+    if (!CRYPTO_THREAD_unlock(lock))
+        *lock_failed = 1;
+    return ret;
+#endif
+}
+
 #ifndef FIPS_MODULE
 int openssl_init_fork_handlers(void)
 {
diff --git a/deps/openssl/openssl/crypto/threads_win.c b/deps/openssl/openssl/crypto/threads_win.c
index 158aa2ea91c..22b59f64d0b 100644
--- a/deps/openssl/openssl/crypto/threads_win.c
+++ b/deps/openssl/openssl/crypto/threads_win.c
@@ -7,30 +7,18 @@
  * https://www.openssl.org/source/license.html
  */

-#if defined(_WIN32)
-#include <windows.h>
+#include "internal/e_os.h"
+
 #if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600
 #define USE_RWLOCK
 #endif
-#endif
-#include <assert.h>
-
-/*
- * VC++ 2008 or earlier x86 compilers do not have an inline implementation
- * of InterlockedOr64 for 32bit and will fail to run on Windows XP 32bit.
- * https://docs.microsoft.com/en-us/cpp/intrinsics/interlockedor-intrinsic-functions#requirements
- * To work around this problem, we implement a manual locking mechanism for
- * only VC++ 2008 or earlier x86 compilers.
- */
-
-#if ((defined(_MSC_VER) && defined(_M_IX86) && _MSC_VER <= 1600) || (defined(__MINGW32__) && !defined(__MINGW64__)))
-#define NO_INTERLOCKEDOR64
-#endif

+#include <assert.h>
 #include <openssl/crypto.h>
 #include <crypto/cryptlib.h>
 #include "internal/common.h"
 #include "internal/thread_arch.h"
+#include "internal/threads_common.h"
 #include "internal/rcu.h"
 #include "rcu_internal.h"

@@ -119,14 +107,14 @@ struct rcu_lock_st {
     /* signal to wake threads waiting on prior_lock */
     CRYPTO_CONDVAR *prior_signal;

-    /* lock used with NO_INTERLOCKEDOR64: VS2010 x86 */
+    /* lock used without OSSL_USE_INTERLOCKEDOR64: VS2010 x86, mingw32 */
     CRYPTO_RWLOCK *rw_lock;
 };

 static struct rcu_qp *allocate_new_qp_group(struct rcu_lock_st *lock,
     uint32_t count)
 {
-    struct rcu_qp *new = OPENSSL_zalloc(sizeof(*new) * count);
+    struct rcu_qp *new = OPENSSL_calloc(count, sizeof(*new));

     lock->group_count = count;
     return new;
@@ -195,8 +183,8 @@ void ossl_rcu_lock_free(CRYPTO_RCU_LOCK *lock)
 /* Read side acquisition of the current qp */
 static ossl_inline struct rcu_qp *get_hold_current_qp(CRYPTO_RCU_LOCK *lock)
 {
-    uint32_t qp_idx;
-    uint32_t tmp;
+    uint32_t qp_idx = 0;
+    uint32_t tmp = 0;
     uint64_t tmp64;

     /* get the current qp index */
@@ -219,30 +207,37 @@ static ossl_inline struct rcu_qp *get_hold_current_qp(CRYPTO_RCU_LOCK *lock)
 static void ossl_rcu_free_local_data(void *arg)
 {
     OSSL_LIB_CTX *ctx = arg;
-    CRYPTO_THREAD_LOCAL *lkey = ossl_lib_ctx_get_rcukey(ctx);
-    struct rcu_thr_data *data = CRYPTO_THREAD_get_local(lkey);
+    struct rcu_thr_data *data = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_RCU_KEY, ctx);
+
+    CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_RCU_KEY, ctx, NULL);
     OPENSSL_free(data);
-    CRYPTO_THREAD_set_local(lkey, NULL);
 }

-void ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock)
+int ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock)
 {
     struct rcu_thr_data *data;
     int i;
     int available_qp = -1;
-    CRYPTO_THREAD_LOCAL *lkey = ossl_lib_ctx_get_rcukey(lock->ctx);

     /*
      * we're going to access current_qp here so ask the
      * processor to fetch it
      */
-    data = CRYPTO_THREAD_get_local(lkey);
+    data = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_RCU_KEY, lock->ctx);

     if (data == NULL) {
         data = OPENSSL_zalloc(sizeof(*data));
-        OPENSSL_assert(data != NULL);
-        CRYPTO_THREAD_set_local(lkey, data);
-        ossl_init_thread_start(NULL, lock->ctx, ossl_rcu_free_local_data);
+        if (data == NULL)
+            return 0;
+        if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_RCU_KEY, lock->ctx, data)) {
+            OPENSSL_free(data);
+            return 0;
+        }
+        if (!ossl_init_thread_start(NULL, lock->ctx, ossl_rcu_free_local_data)) {
+            OPENSSL_free(data);
+            CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_RCU_KEY, lock->ctx, NULL);
+            return 0;
+        }
     }

     for (i = 0; i < MAX_QPS; i++) {
@@ -250,7 +245,7 @@ void ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock)
             available_qp = i;
         /* If we have a hold on this lock already, we're good */
         if (data->thread_qps[i].lock == lock)
-            return;
+            return 1;
     }

     /*
@@ -261,6 +256,7 @@ void ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock)
     data->thread_qps[available_qp].qp = get_hold_current_qp(lock);
     data->thread_qps[available_qp].depth = 1;
     data->thread_qps[available_qp].lock = lock;
+    return 1;
 }

 void ossl_rcu_write_lock(CRYPTO_RCU_LOCK *lock)
@@ -275,10 +271,9 @@ void ossl_rcu_write_unlock(CRYPTO_RCU_LOCK *lock)

 void ossl_rcu_read_unlock(CRYPTO_RCU_LOCK *lock)
 {
-    CRYPTO_THREAD_LOCAL *lkey = ossl_lib_ctx_get_rcukey(lock->ctx);
-    struct rcu_thr_data *data = CRYPTO_THREAD_get_local(lkey);
+    struct rcu_thr_data *data = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_RCU_KEY, lock->ctx);
     int i;
-    LONG64 ret;
+    LONG64 ret = 0;

     assert(data != NULL);

@@ -331,17 +326,18 @@ static struct rcu_qp *update_qp(CRYPTO_RCU_LOCK *lock, uint32_t *curr_id)

     /* update the reader index to be the prior qp */
     tmp = lock->current_alloc_idx;
-#if (defined(NO_INTERLOCKEDOR64))
-    CRYPTO_THREAD_write_lock(lock->rw_lock);
+#if (!defined(OSSL_USE_INTERLOCKEDOR64))
+    /* This cannot fail, avoid unused result warning */
+    ossl_unused int r = CRYPTO_THREAD_write_lock(lock->rw_lock);
     lock->reader_idx = tmp;
     CRYPTO_THREAD_unlock(lock->rw_lock);
 #else
     InterlockedExchange((LONG volatile *)&lock->reader_idx, tmp);
 #endif

-    /* wake up any waiters */
-    ossl_crypto_condvar_broadcast(lock->alloc_signal);
     ossl_crypto_mutex_unlock(lock->alloc_lock);
+    /* wake up any waiters */
+    ossl_crypto_condvar_signal(lock->alloc_signal);
     return &lock->qp_group[current_idx];
 }

@@ -350,8 +346,8 @@ static void retire_qp(CRYPTO_RCU_LOCK *lock,
 {
     ossl_crypto_mutex_lock(lock->alloc_lock);
     lock->writers_alloced--;
-    ossl_crypto_condvar_broadcast(lock->alloc_signal);
     ossl_crypto_mutex_unlock(lock->alloc_lock);
+    ossl_crypto_condvar_signal(lock->alloc_signal);
 }

 void ossl_synchronize_rcu(CRYPTO_RCU_LOCK *lock)
@@ -380,8 +376,8 @@ void ossl_synchronize_rcu(CRYPTO_RCU_LOCK *lock)
     } while (count != (uint64_t)0);

     lock->next_to_retire++;
-    ossl_crypto_condvar_broadcast(lock->prior_signal);
     ossl_crypto_mutex_unlock(lock->prior_lock);
+    ossl_crypto_condvar_broadcast(lock->prior_signal);

     retire_qp(lock, qp);

@@ -446,15 +442,11 @@ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
         /* Don't set error, to avoid recursion blowup. */
         return NULL;

-#if !defined(_WIN32_WCE)
     /* 0x400 is the spin count value suggested in the documentation */
     if (!InitializeCriticalSectionAndSpinCount(lock, 0x400)) {
         OPENSSL_free(lock);
         return NULL;
     }
-#else
-    InitializeCriticalSection(lock);
-#endif
 #endif

     return lock;
@@ -557,9 +549,8 @@ int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
     return (*lock == ONCE_DONE);
 }

-int ossl_thread_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))
+int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))
 {
-
     *key = TlsAlloc();
     if (*key == TLS_OUT_OF_INDEXES)
         return 0;
@@ -619,7 +610,7 @@ int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)

 int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
 {
-#if (defined(NO_INTERLOCKEDOR64))
+#if (!defined(OSSL_USE_INTERLOCKEDOR64))
     if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
         return 0;
     *val += amount;
@@ -639,7 +630,7 @@ int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
 int CRYPTO_atomic_add64(uint64_t *val, uint64_t op, uint64_t *ret,
     CRYPTO_RWLOCK *lock)
 {
-#if (defined(NO_INTERLOCKEDOR64))
+#if (!defined(OSSL_USE_INTERLOCKEDOR64))
     if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
         return 0;
     *val += op;
@@ -658,7 +649,7 @@ int CRYPTO_atomic_add64(uint64_t *val, uint64_t op, uint64_t *ret,
 int CRYPTO_atomic_and(uint64_t *val, uint64_t op, uint64_t *ret,
     CRYPTO_RWLOCK *lock)
 {
-#if (defined(NO_INTERLOCKEDOR64))
+#if (!defined(OSSL_USE_INTERLOCKEDOR64))
     if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
         return 0;
     *val &= op;
@@ -677,7 +668,7 @@ int CRYPTO_atomic_and(uint64_t *val, uint64_t op, uint64_t *ret,
 int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret,
     CRYPTO_RWLOCK *lock)
 {
-#if (defined(NO_INTERLOCKEDOR64))
+#if (!defined(OSSL_USE_INTERLOCKEDOR64))
     if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
         return 0;
     *val |= op;
@@ -695,7 +686,7 @@ int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret,

 int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock)
 {
-#if (defined(NO_INTERLOCKEDOR64))
+#if (!defined(OSSL_USE_INTERLOCKEDOR64))
     if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
         return 0;
     *ret = *val;
@@ -711,7 +702,7 @@ int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock)

 int CRYPTO_atomic_store(uint64_t *dst, uint64_t val, CRYPTO_RWLOCK *lock)
 {
-#if (defined(NO_INTERLOCKEDOR64))
+#if (!defined(OSSL_USE_INTERLOCKEDOR64))
     if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
         return 0;
     *dst = val;
@@ -720,14 +711,14 @@ int CRYPTO_atomic_store(uint64_t *dst, uint64_t val, CRYPTO_RWLOCK *lock)

     return 1;
 #else
-    InterlockedExchange64(dst, val);
+    InterlockedExchange64((LONG64 volatile *)dst, val);
     return 1;
 #endif
 }

 int CRYPTO_atomic_load_int(int *val, int *ret, CRYPTO_RWLOCK *lock)
 {
-#if (defined(NO_INTERLOCKEDOR64))
+#if (!defined(OSSL_USE_INTERLOCKEDOR64))
     if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
         return 0;
     *ret = *val;
@@ -742,6 +733,56 @@ int CRYPTO_atomic_load_int(int *val, int *ret, CRYPTO_RWLOCK *lock)
 #endif
 }

+int CRYPTO_atomic_store_int(int *dst, int val, CRYPTO_RWLOCK *lock)
+{
+#if (!defined(OSSL_USE_INTERLOCKEDOR64))
+    if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
+        return 0;
+    *dst = val;
+    if (!CRYPTO_THREAD_unlock(lock))
+        return 0;
+
+    return 1;
+#else
+    InterlockedExchange((LONG volatile *)dst, val);
+    return 1;
+#endif
+}
+
+int CRYPTO_atomic_load_ptr(void **ptr, void **ret, CRYPTO_RWLOCK *lock)
+{
+    /*
+     * Windows doesn't have an atomic to do this properly, but the ms learn
+     * site here:
+     * https://learn.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-interlockedcompareexchangepointer
+     * suggests that using InterlockedCompareExchangePointer can be used to
+     * devise a load operation
+     */
+    *ret = InterlockedCompareExchangePointer(ptr, NULL, NULL);
+    return 1;
+}
+
+int CRYPTO_atomic_store_ptr(void **dst, void **val, CRYPTO_RWLOCK *lock)
+{
+    InterlockedExchangePointer(dst, *val);
+    return 1;
+}
+
+int CRYPTO_atomic_cmp_exch_ptr(void **ptr, void **expect, void *desire, CRYPTO_RWLOCK *lock, int *lock_failed)
+{
+    void *initial;
+
+    if (lock_failed != NULL)
+        *lock_failed = 0;
+
+    /* Load the current pointer value */
+    initial = InterlockedCompareExchangePointer(ptr, desire, *expect);
+    if (*expect == initial)
+        return 1;
+    *expect = initial;
+    return 0;
+}
+
 int openssl_init_fork_handlers(void)
 {
     return 0;
diff --git a/deps/openssl/openssl/crypto/trace.c b/deps/openssl/openssl/crypto/trace.c
index 01a0f84273f..8c72a12417c 100644
--- a/deps/openssl/openssl/crypto/trace.c
+++ b/deps/openssl/openssl/crypto/trace.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -128,8 +128,6 @@ static const struct trace_category_st
           TRACE_CATEGORY_(TLS),
           TRACE_CATEGORY_(TLS_CIPHER),
           TRACE_CATEGORY_(CONF),
-          TRACE_CATEGORY_(ENGINE_TABLE),
-          TRACE_CATEGORY_(ENGINE_REF_COUNT),
           TRACE_CATEGORY_(PKCS5V2),
           TRACE_CATEGORY_(PKCS12_KEYGEN),
           TRACE_CATEGORY_(PKCS12_DECRYPT),
@@ -497,7 +495,7 @@ BIO *OSSL_trace_begin(int category)
             break;
         case CALLBACK_CHANNEL:
             (void)BIO_ctrl(channel, OSSL_TRACE_CTRL_BEGIN,
-                prefix == NULL ? 0 : strlen(prefix), prefix);
+                prefix == NULL ? 0 : (int)strlen(prefix), prefix);
             break;
         }
     }
@@ -526,7 +524,7 @@ void OSSL_trace_end(int category, BIO *channel)
             break;
         case CALLBACK_CHANNEL:
             (void)BIO_ctrl(channel, OSSL_TRACE_CTRL_END,
-                suffix == NULL ? 0 : strlen(suffix), suffix);
+                suffix == NULL ? 0 : (int)strlen(suffix), suffix);
             break;
         }
         current_channel = NULL;
diff --git a/deps/openssl/openssl/crypto/ts/ts_asn1.c b/deps/openssl/openssl/crypto/ts/ts_asn1.c
index 494e4e69d71..1aa21c9776e 100644
--- a/deps/openssl/openssl/crypto/ts/ts_asn1.c
+++ b/deps/openssl/openssl/crypto/ts/ts_asn1.c
@@ -208,6 +208,7 @@ TS_TST_INFO *PKCS7_to_TS_TST_INFO(PKCS7 *token)
     ASN1_TYPE *tst_info_wrapper;
     ASN1_OCTET_STRING *tst_info_der;
     const unsigned char *p;
+    size_t len;

     if (!PKCS7_type_is_signed(token)) {
         ERR_raise(ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE);
@@ -229,6 +230,11 @@ TS_TST_INFO *PKCS7_to_TS_TST_INFO(PKCS7 *token)
         return NULL;
     }
     tst_info_der = tst_info_wrapper->value.octet_string;
-    p = tst_info_der->data;
-    return d2i_TS_TST_INFO(NULL, &p, tst_info_der->length);
+    p = ASN1_STRING_get0_data(tst_info_der);
+    len = ASN1_STRING_get_length(tst_info_der);
+    if (len > INT_MAX) {
+        ERR_raise(ERR_LIB_TS, TS_R_BAD_TYPE);
+        return NULL;
+    }
+    return d2i_TS_TST_INFO(NULL, &p, (int)len);
 }
diff --git a/deps/openssl/openssl/crypto/ts/ts_conf.c b/deps/openssl/openssl/crypto/ts/ts_conf.c
index 3d718fc7382..6359a4db988 100644
--- a/deps/openssl/openssl/crypto/ts/ts_conf.c
+++ b/deps/openssl/openssl/crypto/ts/ts_conf.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,15 +7,11 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
 #include <string.h>

 #include <openssl/crypto.h>
 #include "internal/cryptlib.h"
 #include <openssl/pem.h>
-#include <openssl/engine.h>
 #include <openssl/ts.h>
 #include <openssl/conf_api.h>

@@ -23,7 +19,6 @@
 #define BASE_SECTION "tsa"
 #define ENV_DEFAULT_TSA "default_tsa"
 #define ENV_SERIAL "serial"
-#define ENV_CRYPTO_DEVICE "crypto_device"
 #define ENV_SIGNER_CERT "signer_cert"
 #define ENV_CERTS "certs"
 #define ENV_SIGNER_KEY "signer_key"
@@ -158,51 +153,6 @@ err:
     return ret;
 }

-#ifndef OPENSSL_NO_ENGINE
-
-int TS_CONF_set_crypto_device(CONF *conf, const char *section,
-    const char *device)
-{
-    int ret = 0;
-
-    if (device == NULL)
-        device = NCONF_get_string(conf, section, ENV_CRYPTO_DEVICE);
-
-    if (device && !TS_CONF_set_default_engine(device)) {
-        ts_CONF_invalid(section, ENV_CRYPTO_DEVICE);
-        goto err;
-    }
-    ret = 1;
-err:
-    return ret;
-}
-
-int TS_CONF_set_default_engine(const char *name)
-{
-    ENGINE *e = NULL;
-    int ret = 0;
-
-    if (strcmp(name, "builtin") == 0)
-        return 1;
-
-    if ((e = ENGINE_by_id(name)) == NULL)
-        goto err;
-    if (strcmp(name, "chil") == 0)
-        ENGINE_ctrl(e, ENGINE_CTRL_CHIL_SET_FORKCHECK, 1, 0, 0);
-    if (!ENGINE_set_default(e, ENGINE_METHOD_ALL))
-        goto err;
-    ret = 1;
-
-err:
-    if (!ret)
-        ERR_raise_data(ERR_LIB_TS, TS_R_COULD_NOT_SET_ENGINE,
-            "engine:%s", name);
-    ENGINE_free(e);
-    return ret;
-}
-
-#endif
-
 int TS_CONF_set_signer_cert(CONF *conf, const char *section,
     const char *cert, TS_RESP_CTX *ctx)
 {
@@ -408,14 +358,26 @@ int TS_CONF_set_accuracy(CONF *conf, const char *section, TS_RESP_CTX *ctx)
     for (i = 0; i < sk_CONF_VALUE_num(list); ++i) {
         CONF_VALUE *val = sk_CONF_VALUE_value(list, i);
         if (strcmp(val->name, ENV_VALUE_SECS) == 0) {
-            if (val->value)
-                secs = atoi(val->value);
+            if (val->value != NULL
+                && (!ossl_strtoint(val->value, NULL, 10, &secs)
+                    || secs < 0)) {
+                ts_CONF_invalid(section, ENV_ACCURACY);
+                goto err;
+            }
         } else if (strcmp(val->name, ENV_VALUE_MILLISECS) == 0) {
-            if (val->value)
-                millis = atoi(val->value);
+            if (val->value != NULL
+                && (!ossl_strtoint(val->value, NULL, 10, &millis)
+                    || millis < 0)) {
+                ts_CONF_invalid(section, ENV_ACCURACY);
+                goto err;
+            }
         } else if (strcmp(val->name, ENV_VALUE_MICROSECS) == 0) {
-            if (val->value)
-                micros = atoi(val->value);
+            if (val->value != NULL
+                && (!ossl_strtoint(val->value, NULL, 10, &micros)
+                    || micros < 0)) {
+                ts_CONF_invalid(section, ENV_ACCURACY);
+                goto err;
+            }
         } else {
             ts_CONF_invalid(section, ENV_ACCURACY);
             goto err;
diff --git a/deps/openssl/openssl/crypto/ts/ts_err.c b/deps/openssl/openssl/crypto/ts/ts_err.c
deleted file mode 100644
index fa3f6bc1696..00000000000
--- a/deps/openssl/openssl/crypto/ts/ts_err.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/tserr.h>
-#include "crypto/tserr.h"
-
-#ifndef OPENSSL_NO_TS
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA TS_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_BAD_PKCS7_TYPE), "bad pkcs7 type" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_BAD_TYPE), "bad type" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_CANNOT_LOAD_CERT), "cannot load certificate" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_CANNOT_LOAD_KEY), "cannot load private key" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_CERTIFICATE_VERIFY_ERROR),
-        "certificate verify error" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_COULD_NOT_SET_ENGINE),
-        "could not set engine" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_COULD_NOT_SET_TIME), "could not set time" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_DETACHED_CONTENT), "detached content" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_ESS_ADD_SIGNING_CERT_ERROR),
-        "ess add signing cert error" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR),
-        "ess add signing cert v2 error" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_ESS_SIGNING_CERTIFICATE_ERROR),
-        "ess signing certificate error" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_INVALID_NULL_POINTER),
-        "invalid null pointer" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE),
-        "invalid signer certificate purpose" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_MESSAGE_IMPRINT_MISMATCH),
-        "message imprint mismatch" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_NONCE_MISMATCH), "nonce mismatch" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_NONCE_NOT_RETURNED), "nonce not returned" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_NO_CONTENT), "no content" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_NO_TIME_STAMP_TOKEN), "no time stamp token" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_PKCS7_ADD_SIGNATURE_ERROR),
-        "pkcs7 add signature error" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR),
-        "pkcs7 add signed attr error" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_PKCS7_TO_TS_TST_INFO_FAILED),
-        "pkcs7 to ts tst info failed" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_POLICY_MISMATCH), "policy mismatch" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE),
-        "private key does not match certificate" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_RESPONSE_SETUP_ERROR),
-        "response setup error" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_SIGNATURE_FAILURE), "signature failure" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_THERE_MUST_BE_ONE_SIGNER),
-        "there must be one signer" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_TIME_SYSCALL_ERROR), "time syscall error" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_TOKEN_NOT_PRESENT), "token not present" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_TOKEN_PRESENT), "token present" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_TSA_NAME_MISMATCH), "tsa name mismatch" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_TSA_UNTRUSTED), "tsa untrusted" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_TST_INFO_SETUP_ERROR),
-        "tst info setup error" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_TS_DATASIGN), "ts datasign" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_UNACCEPTABLE_POLICY), "unacceptable policy" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_UNSUPPORTED_MD_ALGORITHM),
-        "unsupported md algorithm" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_UNSUPPORTED_VERSION), "unsupported version" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_VAR_BAD_VALUE), "var bad value" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_VAR_LOOKUP_FAILURE),
-        "cannot find config variable" },
-    { ERR_PACK(ERR_LIB_TS, 0, TS_R_WRONG_CONTENT_TYPE), "wrong content type" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_TS_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(TS_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(TS_str_reasons);
-#endif
-    return 1;
-}
-#else
-NON_EMPTY_TRANSLATION_UNIT
-#endif
diff --git a/deps/openssl/openssl/crypto/ts/ts_lib.c b/deps/openssl/openssl/crypto/ts/ts_lib.c
index d6a279a16df..00b40355512 100644
--- a/deps/openssl/openssl/crypto/ts/ts_lib.c
+++ b/deps/openssl/openssl/crypto/ts/ts_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -27,7 +27,7 @@ int TS_ASN1_INTEGER_print_bio(BIO *bio, const ASN1_INTEGER *num)
         return -1;
     if ((hex = BN_bn2hex(num_bn))) {
         result = BIO_write(bio, "0x", 2) > 0;
-        result = result && BIO_write(bio, hex, strlen(hex)) > 0;
+        result = result && BIO_write(bio, hex, (int)strlen(hex)) > 0;
         OPENSSL_free(hex);
     }
     BN_free(num_bn);
@@ -48,8 +48,8 @@ int TS_OBJ_print_bio(BIO *bio, const ASN1_OBJECT *obj)
 int TS_ext_print_bio(BIO *bio, const STACK_OF(X509_EXTENSION) *extensions)
 {
     int i, critical, n;
-    X509_EXTENSION *ex;
-    ASN1_OBJECT *obj;
+    const X509_EXTENSION *ex;
+    const ASN1_OBJECT *obj;

     BIO_printf(bio, "Extensions:\n");
     n = X509v3_get_ext_count(extensions);
@@ -86,7 +86,7 @@ int TS_MSG_IMPRINT_print_bio(BIO *bio, TS_MSG_IMPRINT *a)
     BIO_printf(bio, "Message data:\n");
     msg = a->hashed_msg;
     BIO_dump_indent(bio, (const char *)ASN1_STRING_get0_data(msg),
-        ASN1_STRING_length(msg), 4);
+        (int)ASN1_STRING_get_length(msg), 4);

     return 1;
 }
diff --git a/deps/openssl/openssl/crypto/ts/ts_local.h b/deps/openssl/openssl/crypto/ts/ts_local.h
index 7aebad0948e..99ce6255751 100644
--- a/deps/openssl/openssl/crypto/ts/ts_local.h
+++ b/deps/openssl/openssl/crypto/ts/ts_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,11 +7,19 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_TS_TS_LOCAL_H)
+#define OSSL_LIBCRYPTO_TS_TS_LOCAL_H
+
+#include <openssl/asn1.h>
+#include <openssl/ts.h>
+#include <openssl/x509.h>
+
 /*-
  * MessageImprint ::= SEQUENCE  {
  *      hashAlgorithm                AlgorithmIdentifier,
  *      hashedMessage                OCTET STRING  }
  */
+
 struct TS_msg_imprint_st {
     X509_ALGOR *hash_algo;
     ASN1_OCTET_STRING *hashed_msg;
@@ -150,3 +158,5 @@ struct TS_verify_ctx {
     /* Must be set only with TS_VFY_TSA_NAME. */
     GENERAL_NAME *tsa_name;
 };
+
+#endif /* !defined(OSSL_LIBCRYPTO_TS_TS_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/ts/ts_req_utils.c b/deps/openssl/openssl/crypto/ts/ts_req_utils.c
index 89e1bda450a..882b379d703 100644
--- a/deps/openssl/openssl/crypto/ts/ts_req_utils.c
+++ b/deps/openssl/openssl/crypto/ts/ts_req_utils.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -162,14 +162,14 @@ int TS_REQ_get_ext_by_critical(TS_REQ *a, int crit, int lastpos)
     return X509v3_get_ext_by_critical(a->extensions, crit, lastpos);
 }

-X509_EXTENSION *TS_REQ_get_ext(TS_REQ *a, int loc)
+const X509_EXTENSION *TS_REQ_get_ext(TS_REQ *a, int loc)
 {
     return X509v3_get_ext(a->extensions, loc);
 }

 X509_EXTENSION *TS_REQ_delete_ext(TS_REQ *a, int loc)
 {
-    return X509v3_delete_ext(a->extensions, loc);
+    return X509v3_delete_extension(&a->extensions, loc);
 }

 int TS_REQ_add_ext(TS_REQ *a, X509_EXTENSION *ex, int loc)
diff --git a/deps/openssl/openssl/crypto/ts/ts_rsp_print.c b/deps/openssl/openssl/crypto/ts/ts_rsp_print.c
index 6d64de84bd8..bd70727b0c2 100644
--- a/deps/openssl/openssl/crypto/ts/ts_rsp_print.c
+++ b/deps/openssl/openssl/crypto/ts/ts_rsp_print.c
@@ -40,7 +40,7 @@ int TS_RESP_print_bio(BIO *bio, TS_RESP *a)

 int TS_STATUS_INFO_print_bio(BIO *bio, TS_STATUS_INFO *a)
 {
-    static const char *status_map[] = {
+    static const char *const status_map[] = {
         "Granted.",
         "Granted with modifications.",
         "Rejected.",
diff --git a/deps/openssl/openssl/crypto/ts/ts_rsp_sign.c b/deps/openssl/openssl/crypto/ts/ts_rsp_sign.c
index b8648ce7b95..0495e59408a 100644
--- a/deps/openssl/openssl/crypto/ts/ts_rsp_sign.c
+++ b/deps/openssl/openssl/crypto/ts/ts_rsp_sign.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,8 @@
  * https://www.openssl.org/source/license.html
  */

+#include <stdio.h>
+
 #include "internal/e_os.h"

 #include <openssl/objects.h>
@@ -16,6 +18,7 @@
 #include "internal/cryptlib.h"
 #include "internal/sizes.h"
 #include "internal/time.h"
+#include "crypto/asn1.h"
 #include "crypto/ess.h"
 #include "ts_local.h"

@@ -298,7 +301,7 @@ int TS_RESP_CTX_set_status_info(TS_RESP_CTX *ctx,
     }
     if (text) {
         if ((utf8_text = ASN1_UTF8STRING_new()) == NULL
-            || !ASN1_STRING_set(utf8_text, text, strlen(text))) {
+            || !ossl_asn1_string_set1_string(utf8_text, text)) {
             ERR_raise(ERR_LIB_TS, ERR_R_ASN1_LIB);
             goto err;
         }
@@ -487,7 +490,7 @@ static int ts_RESP_check_request(TS_RESP_CTX *ctx)
         return 0;
     }
     digest = msg_imprint->hashed_msg;
-    if (digest->length != md_size) {
+    if (ASN1_STRING_get_length(digest) != (size_t)md_size) {
         TS_RESP_CTX_set_status_info(ctx, TS_STATUS_REJECTION,
             "Bad message digest.");
         TS_RESP_CTX_add_failure_info(ctx, TS_INFO_BAD_DATA_FORMAT);
@@ -633,15 +636,19 @@ static int ossl_ess_add1_signing_cert(PKCS7_SIGNER_INFO *si,
     const ESS_SIGNING_CERT *sc)
 {
     ASN1_STRING *seq = NULL;
-    int len = i2d_ESS_SIGNING_CERT(sc, NULL);
-    unsigned char *p, *pp = OPENSSL_malloc(len);
+    int len;
+    unsigned char *p, *pp;

+    len = i2d_ESS_SIGNING_CERT(sc, NULL);
+    if (len <= 0)
+        return 0;
+    pp = OPENSSL_malloc(len);
     if (pp == NULL)
         return 0;

     p = pp;
     i2d_ESS_SIGNING_CERT(sc, &p);
-    if ((seq = ASN1_STRING_new()) == NULL || !ASN1_STRING_set(seq, pp, len)) {
+    if ((seq = ASN1_STRING_new()) == NULL || !ossl_asn1_string_set1_data(seq, pp, len)) {
         ASN1_STRING_free(seq);
         OPENSSL_free(pp);
         return 0;
@@ -660,15 +667,19 @@ static int ossl_ess_add1_signing_cert_v2(PKCS7_SIGNER_INFO *si,
     const ESS_SIGNING_CERT_V2 *sc)
 {
     ASN1_STRING *seq = NULL;
-    int len = i2d_ESS_SIGNING_CERT_V2(sc, NULL);
-    unsigned char *p, *pp = OPENSSL_malloc(len);
+    int len;
+    unsigned char *p, *pp;

+    len = i2d_ESS_SIGNING_CERT_V2(sc, NULL);
+    if (len <= 0)
+        return 0;
+    pp = OPENSSL_malloc(len);
     if (pp == NULL)
         return 0;

     p = pp;
     i2d_ESS_SIGNING_CERT_V2(sc, &p);
-    if ((seq = ASN1_STRING_new()) == NULL || !ASN1_STRING_set(seq, pp, len)) {
+    if ((seq = ASN1_STRING_new()) == NULL || !ossl_asn1_string_set1_data(seq, pp, len)) {
         ASN1_STRING_free(seq);
         OPENSSL_free(pp);
         return 0;
@@ -836,6 +847,7 @@ static ASN1_GENERALIZEDTIME *TS_RESP_set_genTime_with_precision(
     char genTime_str[17 + TS_MAX_CLOCK_PRECISION_DIGITS];
     char *p = genTime_str;
     char *p_end = genTime_str + sizeof(genTime_str);
+    int n;

     if (precision > TS_MAX_CLOCK_PRECISION_DIGITS)
         goto err;
@@ -850,12 +862,15 @@ static ASN1_GENERALIZEDTIME *TS_RESP_set_genTime_with_precision(
      * meet the rfc3161 requirement: "GeneralizedTime syntax can include
      * fraction-of-second details".
      */
-    p += BIO_snprintf(p, p_end - p,
+    n = snprintf(p, p_end - p,
         "%04d%02d%02d%02d%02d%02d",
         tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
         tm->tm_hour, tm->tm_min, tm->tm_sec);
+    if (n < 0 || n >= p_end - p)
+        goto err;
+    p += n;
     if (precision > 0) {
-        BIO_snprintf(p, 2 + precision, ".%06ld", usec);
+        snprintf(p, 2 + precision, ".%06ld", usec);
         p += strlen(p);

         /*
diff --git a/deps/openssl/openssl/crypto/ts/ts_rsp_utils.c b/deps/openssl/openssl/crypto/ts/ts_rsp_utils.c
index 2352c7adb96..3ee394a07e6 100644
--- a/deps/openssl/openssl/crypto/ts/ts_rsp_utils.c
+++ b/deps/openssl/openssl/crypto/ts/ts_rsp_utils.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -323,14 +323,14 @@ int TS_TST_INFO_get_ext_by_critical(TS_TST_INFO *a, int crit, int lastpos)
     return X509v3_get_ext_by_critical(a->extensions, crit, lastpos);
 }

-X509_EXTENSION *TS_TST_INFO_get_ext(TS_TST_INFO *a, int loc)
+const X509_EXTENSION *TS_TST_INFO_get_ext(TS_TST_INFO *a, int loc)
 {
     return X509v3_get_ext(a->extensions, loc);
 }

 X509_EXTENSION *TS_TST_INFO_delete_ext(TS_TST_INFO *a, int loc)
 {
-    return X509v3_delete_ext(a->extensions, loc);
+    return X509v3_delete_extension(&a->extensions, loc);
 }

 int TS_TST_INFO_add_ext(TS_TST_INFO *a, X509_EXTENSION *ex, int loc)
diff --git a/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c b/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c
index bc547342112..5210df04c54 100644
--- a/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c
+++ b/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c
@@ -58,7 +58,7 @@ static const char *ts_status_text[] = {

 #define TS_STATUS_TEXT_SIZE OSSL_NELEM(ts_status_text)

-static struct {
+static const struct {
     int code;
     const char *text;
 } ts_failure_info[] = {
@@ -84,7 +84,7 @@ static struct {
  *      - Verify the signature value.
  *      - Returns the signer certificate in 'signer', if 'signer' is not NULL.
  */
-int TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs,
+int TS_RESP_verify_signature(PKCS7 *token, const STACK_OF(X509) *certs,
     X509_STORE *store, X509 **signer_out)
 {
     STACK_OF(PKCS7_SIGNER_INFO) *sinfos = NULL;
@@ -205,26 +205,34 @@ end:

 static ESS_SIGNING_CERT *ossl_ess_get_signing_cert(const PKCS7_SIGNER_INFO *si)
 {
-    ASN1_TYPE *attr;
+    const ASN1_TYPE *attr;
     const unsigned char *p;
+    size_t len;

     attr = PKCS7_get_signed_attribute(si, NID_id_smime_aa_signingCertificate);
     if (attr == NULL || attr->type != V_ASN1_SEQUENCE)
         return NULL;
-    p = attr->value.sequence->data;
-    return d2i_ESS_SIGNING_CERT(NULL, &p, attr->value.sequence->length);
+    p = ASN1_STRING_get0_data(attr->value.sequence);
+    len = ASN1_STRING_get_length(attr->value.sequence);
+    if (len > INT_MAX)
+        return NULL;
+    return d2i_ESS_SIGNING_CERT(NULL, &p, (int)len);
 }

 static ESS_SIGNING_CERT_V2 *ossl_ess_get_signing_cert_v2(const PKCS7_SIGNER_INFO *si)
 {
-    ASN1_TYPE *attr;
+    const ASN1_TYPE *attr;
     const unsigned char *p;
+    size_t len;

     attr = PKCS7_get_signed_attribute(si, NID_id_smime_aa_signingCertificateV2);
     if (attr == NULL || attr->type != V_ASN1_SEQUENCE)
         return NULL;
-    p = attr->value.sequence->data;
-    return d2i_ESS_SIGNING_CERT_V2(NULL, &p, attr->value.sequence->length);
+    p = ASN1_STRING_get0_data(attr->value.sequence);
+    len = ASN1_STRING_get_length(attr->value.sequence);
+    if (len > INT_MAX)
+        return NULL;
+    return d2i_ESS_SIGNING_CERT_V2(NULL, &p, (int)len);
 }

 static int ts_check_signing_certs(const PKCS7_SIGNER_INFO *si,
@@ -434,17 +442,10 @@ static int ts_compute_imprint(BIO *data, TS_TST_INFO *tst_info,

     OBJ_obj2txt(name, sizeof(name), md_alg_resp->algorithm, 0);

-    (void)ERR_set_mark();
     md = EVP_MD_fetch(NULL, name, NULL);
-
-    if (md == NULL)
-        md = (EVP_MD *)EVP_get_digestbyname(name);
-
     if (md == NULL) {
-        (void)ERR_clear_last_mark();
         goto err;
     }
-    (void)ERR_pop_to_mark();

     length = EVP_MD_get_size(md);
     if (length <= 0)
@@ -489,6 +490,7 @@ static int ts_check_imprints(X509_ALGOR *algor_a,
     TS_MSG_IMPRINT *b = tst_info->msg_imprint;
     X509_ALGOR *algor_b = b->hash_algo;
     int ret = 0;
+    size_t len;

     if (algor_a) {
         if (OBJ_cmp(algor_a->algorithm, algor_b->algorithm))
@@ -502,7 +504,11 @@ static int ts_check_imprints(X509_ALGOR *algor_a,
             goto err;
     }

-    ret = len_a == (unsigned)ASN1_STRING_length(b->hashed_msg) && memcmp(imprint_a, ASN1_STRING_get0_data(b->hashed_msg), len_a) == 0;
+    len = ASN1_STRING_get_length(b->hashed_msg);
+    if (len > INT_MAX)
+        goto err;
+
+    ret = len_a == (unsigned)len && memcmp(imprint_a, ASN1_STRING_get0_data(b->hashed_msg), len) == 0;
 err:
     if (!ret)
         ERR_raise(ERR_LIB_TS, TS_R_MESSAGE_IMPRINT_MISMATCH);
diff --git a/deps/openssl/openssl/crypto/ts/ts_verify_ctx.c b/deps/openssl/openssl/crypto/ts/ts_verify_ctx.c
index ec9993ed9f0..738615dfe8a 100644
--- a/deps/openssl/openssl/crypto/ts/ts_verify_ctx.c
+++ b/deps/openssl/openssl/crypto/ts/ts_verify_ctx.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -142,6 +142,7 @@ TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)
     X509_ALGOR *md_alg;
     ASN1_OCTET_STRING *msg;
     const ASN1_INTEGER *nonce;
+    size_t tmp;

     OPENSSL_assert(req != NULL);
     if (ret)
@@ -162,8 +163,11 @@ TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)
     if ((ret->md_alg = X509_ALGOR_dup(md_alg)) == NULL)
         goto err;
     msg = imprint->hashed_msg;
-    ret->imprint_len = ASN1_STRING_length(msg);
-    if (ret->imprint_len <= 0)
+    tmp = ASN1_STRING_get_length(msg);
+    if (tmp > INT_MAX)
+        goto err;
+    ret->imprint_len = (unsigned int)tmp;
+    if (ret->imprint_len == 0)
         goto err;
     if ((ret->imprint = OPENSSL_malloc(ret->imprint_len)) == NULL)
         goto err;
diff --git a/deps/openssl/openssl/crypto/txt_db/txt_db.c b/deps/openssl/openssl/crypto/txt_db/txt_db.c
index efa33c6f972..902ea2b97ca 100644
--- a/deps/openssl/openssl/crypto/txt_db/txt_db.c
+++ b/deps/openssl/openssl/crypto/txt_db/txt_db.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -40,9 +40,9 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
     ret->qual = NULL;
     if ((ret->data = sk_OPENSSL_PSTRING_new_null()) == NULL)
         goto err;
-    if ((ret->index = OPENSSL_malloc(sizeof(*ret->index) * num)) == NULL)
+    if ((ret->index = OPENSSL_malloc_array(num, sizeof(*ret->index))) == NULL)
         goto err;
-    if ((ret->qual = OPENSSL_malloc(sizeof(*(ret->qual)) * num)) == NULL)
+    if ((ret->qual = OPENSSL_malloc_array(num, sizeof(*(ret->qual)))) == NULL)
         goto err;
     for (i = 0; i < num; i++) {
         ret->index[i] = NULL;
@@ -64,7 +64,7 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
             break;
         if ((offset == 0) && (buf->data[0] == '#'))
             continue;
-        i = strlen(&(buf->data[offset]));
+        i = (int)strlen(&(buf->data[offset]));
         offset += i;
         if (buf->data[offset - 1] != '\n')
             continue;
@@ -201,7 +201,7 @@ long TXT_DB_write(BIO *out, TXT_DB *db)
         l = 0;
         for (j = 0; j < nn; j++) {
             if (pp[j] != NULL)
-                l += strlen(pp[j]);
+                l += (long)strlen(pp[j]);
         }
         if (!BUF_MEM_grow_clean(buf, (int)(l * 2 + nn)))
             goto err;
@@ -220,7 +220,7 @@ long TXT_DB_write(BIO *out, TXT_DB *db)
             *(p++) = '\t';
         }
         p[-1] = '\n';
-        j = p - buf->data;
+        j = (long)(p - buf->data);
         if (BIO_write(out, buf->data, (int)j) != j)
             goto err;
         tot += j;
diff --git a/deps/openssl/openssl/crypto/ui/ui_err.c b/deps/openssl/openssl/crypto/ui/ui_err.c
deleted file mode 100644
index 1c21b3a4f74..00000000000
--- a/deps/openssl/openssl/crypto/ui/ui_err.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/uierr.h>
-#include "crypto/uierr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA UI_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_UI, 0, UI_R_COMMON_OK_AND_CANCEL_CHARACTERS),
-        "common ok and cancel characters" },
-    { ERR_PACK(ERR_LIB_UI, 0, UI_R_INDEX_TOO_LARGE), "index too large" },
-    { ERR_PACK(ERR_LIB_UI, 0, UI_R_INDEX_TOO_SMALL), "index too small" },
-    { ERR_PACK(ERR_LIB_UI, 0, UI_R_NO_RESULT_BUFFER), "no result buffer" },
-    { ERR_PACK(ERR_LIB_UI, 0, UI_R_PROCESSING_ERROR), "processing error" },
-    { ERR_PACK(ERR_LIB_UI, 0, UI_R_RESULT_TOO_LARGE), "result too large" },
-    { ERR_PACK(ERR_LIB_UI, 0, UI_R_RESULT_TOO_SMALL), "result too small" },
-    { ERR_PACK(ERR_LIB_UI, 0, UI_R_SYSASSIGN_ERROR), "sys$assign error" },
-    { ERR_PACK(ERR_LIB_UI, 0, UI_R_SYSDASSGN_ERROR), "sys$dassgn error" },
-    { ERR_PACK(ERR_LIB_UI, 0, UI_R_SYSQIOW_ERROR), "sys$qiow error" },
-    { ERR_PACK(ERR_LIB_UI, 0, UI_R_UNKNOWN_CONTROL_COMMAND),
-        "unknown control command" },
-    { ERR_PACK(ERR_LIB_UI, 0, UI_R_UNKNOWN_TTYGET_ERRNO_VALUE),
-        "unknown ttyget errno value" },
-    { ERR_PACK(ERR_LIB_UI, 0, UI_R_USER_DATA_DUPLICATION_UNSUPPORTED),
-        "user data duplication unsupported" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_UI_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(UI_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(UI_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/ui/ui_lib.c b/deps/openssl/openssl/crypto/ui/ui_lib.c
index 79c8ecc907d..addb6155e23 100644
--- a/deps/openssl/openssl/crypto/ui/ui_lib.c
+++ b/deps/openssl/openssl/crypto/ui/ui_lib.c
@@ -375,9 +375,9 @@ char *UI_construct_prompt(UI *ui, const char *phrase_desc,

         if (phrase_desc == NULL)
             return NULL;
-        len = sizeof(prompt1) - 1 + strlen(phrase_desc);
+        len = sizeof(prompt1) - 1 + (int)strlen(phrase_desc);
         if (object_name != NULL)
-            len += sizeof(prompt2) - 1 + strlen(object_name);
+            len += sizeof(prompt2) - 1 + (int)strlen(object_name);
         len += sizeof(prompt3) - 1;

         if ((prompt = OPENSSL_malloc(len + 1)) == NULL)
@@ -826,7 +826,7 @@ int UI_get_result_string_length(UI_STRING *uis)
     switch (uis->type) {
     case UIT_PROMPT:
     case UIT_VERIFY:
-        return uis->result_len;
+        return (int)uis->result_len;
     case UIT_NONE:
     case UIT_BOOLEAN:
     case UIT_INFO:
@@ -883,7 +883,7 @@ int UI_get_result_maxsize(UI_STRING *uis)

 int UI_set_result(UI *ui, UI_STRING *uis, const char *result)
 {
-    return UI_set_result_ex(ui, uis, result, strlen(result));
+    return UI_set_result_ex(ui, uis, result, (int)strlen(result));
 }

 int UI_set_result_ex(UI *ui, UI_STRING *uis, const char *result, int len)
diff --git a/deps/openssl/openssl/crypto/ui/ui_openssl.c b/deps/openssl/openssl/crypto/ui/ui_openssl.c
index 41823a739f4..0778b2811f4 100644
--- a/deps/openssl/openssl/crypto/ui/ui_openssl.c
+++ b/deps/openssl/openssl/crypto/ui/ui_openssl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -60,11 +60,8 @@
 #endif

 #ifdef WIN_CONSOLE_BUG
-#include <windows.h>
-#ifndef OPENSSL_SYS_WINCE
 #include <wincon.h>
 #endif
-#endif

 /*
  * There are 6 types of terminal interface supported, TERMIO, TERMIOS, VMS,
@@ -166,7 +163,7 @@ static long tty_orig[3], tty_new[3]; /* XXX Is there any guarantee that this
                                       * structures? */
 static long status;
 static unsigned short channel = 0;
-#elif defined(_WIN32) && !defined(_WIN32_WCE)
+#elif defined(_WIN32)
 static DWORD tty_orig, tty_new;
 #else
 #if !defined(OPENSSL_SYS_MSDOS) || defined(__DJGPP__)
@@ -177,12 +174,10 @@ static FILE *tty_in, *tty_out;
 static int is_a_tty;

 /* Declare static functions */
-#if !defined(OPENSSL_SYS_WINCE)
 static int read_till_nl(FILE *);
 static void recsig(int);
 static void pushsig(void);
 static void popsig(void);
-#endif
 #if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32)
 static int noecho_fgets(char *buf, int size, FILE *tty);
 #endif
@@ -256,7 +251,6 @@ static int read_string(UI *ui, UI_STRING *uis)
     return 1;
 }

-#if !defined(OPENSSL_SYS_WINCE)
 /* Internal functions to read a string without echoing */
 static int read_till_nl(FILE *in)
 {
@@ -271,7 +265,6 @@ static int read_till_nl(FILE *in)
 }

 static volatile sig_atomic_t intr_signal;
-#endif

 static int read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl)
 {
@@ -279,7 +272,6 @@ static int read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl)
     int ok;
     char result[BUFSIZ];
     int maxsize = BUFSIZ - 1;
-#if !defined(OPENSSL_SYS_WINCE)
     char *p = NULL;
     int echo_eol = !echo;

@@ -359,9 +351,6 @@ error:

     if (ps >= 1)
         popsig();
-#else
-    ok = 1;
-#endif

     OPENSSL_cleanse(result, BUFSIZ);
     return ok;
@@ -377,7 +366,7 @@ static int open_console(UI *ui)
 #if defined(OPENSSL_SYS_VXWORKS)
     tty_in = stdin;
     tty_out = stderr;
-#elif defined(_WIN32) && !defined(_WIN32_WCE)
+#elif defined(_WIN32)
     if ((tty_out = fopen("conout$", "w")) == NULL)
         tty_out = stderr;

@@ -506,7 +495,7 @@ static int noecho_console(UI *ui)
         }
     }
 #endif
-#if defined(_WIN32) && !defined(_WIN32_WCE)
+#if defined(_WIN32)
     if (is_a_tty) {
         tty_new = tty_orig;
         tty_new &= ~ENABLE_ECHO_INPUT;
@@ -538,7 +527,7 @@ static int echo_console(UI *ui)
         }
     }
 #endif
-#if defined(_WIN32) && !defined(_WIN32_WCE)
+#if defined(_WIN32)
     if (is_a_tty) {
         tty_new = tty_orig;
         SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), tty_new);
@@ -568,7 +557,6 @@ static int close_console(UI *ui)
     return ret;
 }

-#if !defined(OPENSSL_SYS_WINCE)
 /* Internal functions to handle signals and act on them */
 static void pushsig(void)
 {
@@ -649,7 +637,6 @@ static void recsig(int i)
 {
     intr_signal = i;
 }
-#endif

 /* Internal functions specific for Windows */
 #if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32)
@@ -665,11 +652,7 @@ static int noecho_fgets(char *buf, int size, FILE *tty)
             break;
         }
         size--;
-#if defined(_WIN32)
-        i = _getch();
-#else
         i = getch();
-#endif
         if (i == '\r')
             i = '\n';
         *(p++) = i;
diff --git a/deps/openssl/openssl/crypto/vms_rms.h b/deps/openssl/openssl/crypto/vms_rms.h
index fed6cd0fc33..8315d2865c5 100644
--- a/deps/openssl/openssl/crypto/vms_rms.h
+++ b/deps/openssl/openssl/crypto/vms_rms.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_VMS_RMS_H)
+#define OSSL_LIBCRYPTO_VMS_RMS_H
+
 #ifdef NAML$C_MAXRSS

 #define CC_RMS_NAMX cc$rms_naml
@@ -58,3 +61,5 @@
 #endif /* def NAM$M_NO_SHORT_UPCASE [else] */

 #endif /* def NAML$C_MAXRSS [else] */
+
+#endif /* !defined(OSSL_LIBCRYPTO_VMS_RMS_H) */
diff --git a/deps/openssl/openssl/crypto/whrlpool/asm/wp-mmx.pl b/deps/openssl/openssl/crypto/whrlpool/asm/wp-mmx.pl
index ad2528a9e28..8cbd27a21d4 100644
--- a/deps/openssl/openssl/crypto/whrlpool/asm/wp-mmx.pl
+++ b/deps/openssl/openssl/crypto/whrlpool/asm/wp-mmx.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2005-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2005-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,7 +8,7 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. Rights for redistribution and usage in source and binary
 # forms are granted according to the License.
 # ====================================================================
diff --git a/deps/openssl/openssl/crypto/whrlpool/asm/wp-x86_64.pl b/deps/openssl/openssl/crypto/whrlpool/asm/wp-x86_64.pl
index e3421dcbdf1..ff323a4c73b 100644
--- a/deps/openssl/openssl/crypto/whrlpool/asm/wp-x86_64.pl
+++ b/deps/openssl/openssl/crypto/whrlpool/asm/wp-x86_64.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2005-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2005-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,7 +8,7 @@

 #
 # ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+# Written by Andy Polyakov, @dot-asm, initially for use in the OpenSSL
 # project. Rights for redistribution and usage in source and binary
 # forms are granted according to the License.
 # ====================================================================
diff --git a/deps/openssl/openssl/crypto/whrlpool/wp_block.c b/deps/openssl/openssl/crypto/whrlpool/wp_block.c
index dab8cf97935..95ae0a3bc3e 100644
--- a/deps/openssl/openssl/crypto/whrlpool/wp_block.c
+++ b/deps/openssl/openssl/crypto/whrlpool/wp_block.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -44,17 +44,9 @@

 #include "internal/cryptlib.h"
 #include "wp_local.h"
+#include <stdint.h>
 #include <string.h>

-typedef unsigned char u8;
-#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32)
-typedef unsigned __int64 u64;
-#elif defined(__arch64__)
-typedef unsigned long u64;
-#else
-typedef unsigned long long u64;
-#endif
-
 #define ROUNDS 10

 #define STRICT_ALIGNMENT
@@ -69,16 +61,16 @@ typedef unsigned long long u64;

 #ifndef STRICT_ALIGNMENT
 #ifdef __GNUC__
-typedef u64 u64_a1 __attribute((__aligned__(1)));
+typedef uint64_t u64_a1 __attribute((__aligned__(1)));
 #else
-typedef u64 u64_a1;
+typedef uint64_t u64_a1;
 #endif
 #endif

 #if defined(__GNUC__) && !defined(STRICT_ALIGNMENT)
-typedef u64 u64_aX __attribute((__aligned__(1)));
+typedef uint64_t u64_aX __attribute((__aligned__(1)));
 #else
-typedef u64 u64_aX;
+typedef uint64_t u64_aX;
 #endif

 #undef SMALL_REGISTER_BANK
@@ -111,10 +103,10 @@ typedef u64 u64_aX;
 #pragma intrinsic(_rotl64)
 #define ROTATE(a, n) _rotl64((a), n)
 #endif
-#elif defined(__GNUC__) && __GNUC__ >= 2
+#elif defined(__GNUC__)
 #if defined(__x86_64) || defined(__x86_64__)
 #if defined(L_ENDIAN)
-#define ROTATE(a, n) ({ u64 ret; asm ("rolq %1,%0"   \
+#define ROTATE(a, n) ({ uint64_t ret; asm ("rolq %1,%0"   \
                                    : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; })
 #elif defined(B_ENDIAN)
 /*
@@ -124,15 +116,15 @@ typedef u64 u64_aX;
  * won't do same for x86_64? Naturally no. And this line is waiting
  * ready for that brave soul:-)
  */
-#define ROTATE(a, n) ({ u64 ret; asm ("rorq %1,%0"   \
+#define ROTATE(a, n) ({ uint64_t ret; asm ("rorq %1,%0"   \
                                    : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; })
 #endif
 #elif defined(__ia64) || defined(__ia64__)
 #if defined(L_ENDIAN)
-#define ROTATE(a, n) ({ u64 ret; asm ("shrp %0=%1,%1,%2"     \
+#define ROTATE(a, n) ({ uint64_t ret; asm ("shrp %0=%1,%1,%2"     \
                                    : "=r"(ret) : "r"(a),"M"(64-(n))); ret; })
 #elif defined(B_ENDIAN)
-#define ROTATE(a, n) ({ u64 ret; asm ("shrp %0=%1,%1,%2"     \
+#define ROTATE(a, n) ({ uint64_t ret; asm ("shrp %0=%1,%1,%2"     \
                                    : "=r"(ret) : "r"(a),"M"(n)); ret; })
 #endif
 #endif
@@ -210,7 +202,7 @@ typedef u64 u64_aX;
 #define N 2
 #define LL(c0, c1, c2, c3, c4, c5, c6, c7) c0, c1, c2, c3, c4, c5, c6, c7, \
                                            c0, c1, c2, c3, c4, c5, c6, c7
-#define C0(K, i) (((u64 *)(Cx.c + 0))[2 * K.c[(i) * 8 + 0]])
+#define C0(K, i) (((uint64_t *)(Cx.c + 0))[2 * K.c[(i) * 8 + 0]])
 #define C1(K, i) (((u64_a1 *)(Cx.c + 7))[2 * K.c[(i) * 8 + 1]])
 #define C2(K, i) (((u64_a1 *)(Cx.c + 6))[2 * K.c[(i) * 8 + 2]])
 #define C3(K, i) (((u64_a1 *)(Cx.c + 5))[2 * K.c[(i) * 8 + 3]])
@@ -221,8 +213,8 @@ typedef u64 u64_aX;
 #endif

 static const union {
-    u8 c[(256 * N + ROUNDS) * sizeof(u64)];
-    u64 q[(256 * N + ROUNDS)];
+    uint8_t c[(256 * N + ROUNDS) * sizeof(uint64_t)];
+    uint64_t q[(256 * N + ROUNDS)];
 } Cx = {
     { /* Note endian-neutral representation:-) */
         LL(0x18, 0x18, 0x60, 0x18, 0xc0, 0x78, 0x30, 0xd8),
@@ -496,10 +488,10 @@ static const union {
 void whirlpool_block(WHIRLPOOL_CTX *ctx, const void *inp, size_t n)
 {
     int r;
-    const u8 *p = inp;
+    const uint8_t *p = inp;
     union {
-        u64 q[8];
-        u8 c[64];
+        uint64_t q[8];
+        uint8_t c[64];
     } S, K, *H = (void *)ctx->H.q;

 #ifdef GO_FOR_MMX
@@ -507,7 +499,7 @@ void whirlpool_block(WHIRLPOOL_CTX *ctx, const void *inp, size_t n)
 #endif
     do {
 #ifdef OPENSSL_SMALL_FOOTPRINT
-        u64 L[8];
+        uint64_t L[8];
         int i;

         for (i = 0; i < 64; i++)
@@ -526,7 +518,7 @@ void whirlpool_block(WHIRLPOOL_CTX *ctx, const void *inp, size_t n)
         for (i = 0; i < 64; i++)
             H->c[i] ^= S.c[i] ^ p[i];
 #else
-        u64 L0, L1, L2, L3, L4, L5, L6, L7;
+        uint64_t L0, L1, L2, L3, L4, L5, L6, L7;

 #ifdef STRICT_ALIGNMENT
         if ((size_t)p & 7) {
diff --git a/deps/openssl/openssl/crypto/whrlpool/wp_local.h b/deps/openssl/openssl/crypto/whrlpool/wp_local.h
index 73dc2a003da..7bccc35f985 100644
--- a/deps/openssl/openssl/crypto/whrlpool/wp_local.h
+++ b/deps/openssl/openssl/crypto/whrlpool/wp_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,11 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_WHRLPOOL_WP_LOCAL_H)
+#define OSSL_LIBCRYPTO_WHRLPOOL_WP_LOCAL_H
+
 #include <openssl/whrlpool.h>

 void whirlpool_block(WHIRLPOOL_CTX *, const void *, size_t);
+
+#endif /* !defined(OSSL_LIBCRYPTO_WHRLPOOL_WP_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/x509/build.info b/deps/openssl/openssl/crypto/x509/build.info
index c9ed634b86a..5ad2b92fb79 100644
--- a/deps/openssl/openssl/crypto/x509/build.info
+++ b/deps/openssl/openssl/crypto/x509/build.info
@@ -23,3 +23,5 @@ SOURCE[../../libcrypto]=\
 IF[{- !$disabled{'deprecated-3.0'} -}]
   SOURCE[../../libcrypto]=x509type.c
 ENDIF
+
+DEPEND[v3_purp.o]=../objects/obj_dat.h
diff --git a/deps/openssl/openssl/crypto/x509/by_dir.c b/deps/openssl/openssl/crypto/x509/by_dir.c
index df92e1d1d58..2314d21e77c 100644
--- a/deps/openssl/openssl/crypto/x509/by_dir.c
+++ b/deps/openssl/openssl/crypto/x509/by_dir.c
@@ -232,7 +232,7 @@ static int get_cert_by_subject_ex(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
     int i, j, k;
     unsigned long h;
     BUF_MEM *b = NULL;
-    X509_OBJECT stmp, *tmp;
+    X509_OBJECT stmp, *tmp = NULL;
     const char *postfix = "";

     if (name == NULL)
@@ -266,7 +266,7 @@ static int get_cert_by_subject_ex(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
         BY_DIR_HASH htmp, *hent;

         ent = sk_BY_DIR_ENTRY_value(ctx->dirs, i);
-        j = strlen(ent->dir) + 1 + 8 + 6 + 1 + 1;
+        j = (int)strlen(ent->dir) + 1 + 8 + 6 + 1 + 1;
         if (!BUF_MEM_grow(b, j)) {
             ERR_raise(ERR_LIB_X509, ERR_R_BUF_LIB);
             goto finish;
@@ -310,12 +310,12 @@ static int get_cert_by_subject_ex(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
                  * This is special.  When c == '\0', no directory separator
                  * should be added.
                  */
-                BIO_snprintf(b->data, b->max,
+                snprintf(b->data, b->max,
                     "%s%08lx.%s%d", ent->dir, h, postfix, k);
             } else
 #endif
             {
-                BIO_snprintf(b->data, b->max,
+                snprintf(b->data, b->max,
                     "%s%c%08lx.%s%d", ent->dir, c, h, postfix, k);
             }
 #ifndef OPENSSL_NO_POSIX_IO
@@ -359,10 +359,18 @@ static int get_cert_by_subject_ex(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
          *       sorted and sorting the would result in O(n^2 log n) complexity.
          */
         if (k > 0) {
-            if (!X509_STORE_lock(xl->store_ctx))
+            STACK_OF(X509_OBJECT) *objs;
+
+            if (ossl_x509_store_read_lock(xl->store_ctx) == 0)
                 goto finish;
-            j = sk_X509_OBJECT_find(xl->store_ctx->objs, &stmp);
-            tmp = sk_X509_OBJECT_value(xl->store_ctx->objs, j);
+            if (xl->store_ctx->objs_ht)
+                objs = ossl_x509_store_ht_get_by_name(xl->store_ctx, name);
+            else
+                objs = xl->store_ctx->objs;
+            if (objs != NULL) {
+                j = sk_X509_OBJECT_find(objs, &stmp);
+                tmp = sk_X509_OBJECT_value(objs, j);
+            }
             X509_STORE_unlock(xl->store_ctx);
         } else {
             tmp = NULL;
@@ -429,14 +437,6 @@ static int get_cert_by_subject_ex(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
         }
     }
 finish:
-    /* If we changed anything, resort the objects for faster lookup */
-    if (X509_STORE_lock(xl->store_ctx)) {
-        if (!sk_X509_OBJECT_is_sorted(xl->store_ctx->objs)) {
-            sk_X509_OBJECT_sort(xl->store_ctx->objs);
-        }
-        X509_STORE_unlock(xl->store_ctx);
-    }
-
     BUF_MEM_free(b);
     return ok;
 }
diff --git a/deps/openssl/openssl/crypto/x509/by_file.c b/deps/openssl/openssl/crypto/x509/by_file.c
index 5c99557649e..678c1bbb7e1 100644
--- a/deps/openssl/openssl/crypto/x509/by_file.c
+++ b/deps/openssl/openssl/crypto/x509/by_file.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,6 +17,8 @@
 #include <openssl/pem.h>
 #include "x509_local.h"

+#include <crypto/asn1.h>
+
 static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
     long argl, char **ret);
 static int by_file_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argc,
diff --git a/deps/openssl/openssl/crypto/x509/by_store.c b/deps/openssl/openssl/crypto/x509/by_store.c
index 7fc8a3a545e..38496699b3f 100644
--- a/deps/openssl/openssl/crypto/x509/by_store.c
+++ b/deps/openssl/openssl/crypto/x509/by_store.c
@@ -25,7 +25,7 @@ DEFINE_STACK_OF(CACHED_STORE)
 static int cache_objects(X509_LOOKUP *lctx, CACHED_STORE *store,
     const OSSL_STORE_SEARCH *criterion, int depth)
 {
-    int ok = 0;
+    int ok = 1;
     OSSL_STORE_CTX *ctx;
     X509_STORE *xstore = X509_LOOKUP_get_store(lctx);

@@ -52,8 +52,11 @@ static int cache_objects(X509_LOOKUP *lctx, CACHED_STORE *store,
      * but it's a nice optimization when it can be applied (such as on an
      * actual directory with a thousand CA certs).
      */
-    if (criterion != NULL)
+    if (criterion != NULL) {
+        ERR_set_mark();
         OSSL_STORE_find(ctx, criterion);
+        ERR_pop_to_mark();
+    }

     for (;;) {
         OSSL_STORE_INFO *info = OSSL_STORE_load(ctx);
@@ -61,12 +64,16 @@ static int cache_objects(X509_LOOKUP *lctx, CACHED_STORE *store,

         /* NULL means error or "end of file".  Either way, we break. */
         if (info == NULL)
+            /*
+             * Cannot rely on OSSL_STORE_error() here:
+             * file_load() incorrectly reports an error at EOF
+             */
             break;

         infotype = OSSL_STORE_INFO_get_type(info);
-        ok = 0;

-        if (infotype == OSSL_STORE_INFO_NAME) {
+        switch (infotype) {
+        case OSSL_STORE_INFO_NAME:
             /*
              * This is an entry in the "directory" represented by the current
              * uri.  if |depth| allows, dive into it.
@@ -79,27 +86,26 @@ static int cache_objects(X509_LOOKUP *lctx, CACHED_STORE *store,
                 substore.propq = store->propq;
                 ok = cache_objects(lctx, &substore, criterion, depth - 1);
             }
-        } else {
-            /*
-             * We know that X509_STORE_add_{cert|crl} increments the object's
-             * refcount, so we can safely use OSSL_STORE_INFO_get0_{cert,crl}
-             * to get them.
-             */
-            switch (infotype) {
-            case OSSL_STORE_INFO_CERT:
-                ok = X509_STORE_add_cert(xstore,
-                    OSSL_STORE_INFO_get0_CERT(info));
-                break;
-            case OSSL_STORE_INFO_CRL:
-                ok = X509_STORE_add_crl(xstore,
-                    OSSL_STORE_INFO_get0_CRL(info));
-                break;
-            }
+            break;
+        /*
+         * We know that X509_STORE_add_{cert|crl} increments the object's
+         * refcount, so we can safely use OSSL_STORE_INFO_get0_{cert,crl}
+         * to get them.
+         */
+        case OSSL_STORE_INFO_CERT:
+            ok = X509_STORE_add_cert(xstore, OSSL_STORE_INFO_get0_CERT(info));
+            break;
+        case OSSL_STORE_INFO_CRL:
+            ok = X509_STORE_add_crl(xstore, OSSL_STORE_INFO_get0_CRL(info));
+            break;
+        default:
+            /* Ignore all other types (PKEY, PUBKEY, PARAMS) */
+            break;
         }

         OSSL_STORE_INFO_free(info);
         if (!ok)
-            break;
+            break; /* stop on first failure */
     }
     OSSL_STORE_close(ctx);

@@ -211,17 +217,22 @@ static int by_store_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
 {
     OSSL_STORE_SEARCH *criterion = OSSL_STORE_SEARCH_by_name((X509_NAME *)name); /* won't modify it */
     int ok = by_store(ctx, type, criterion, ret);
-    STACK_OF(X509_OBJECT) *store_objects = X509_STORE_get0_objects(X509_LOOKUP_get_store(ctx));
     X509_OBJECT *tmp = NULL;

     OSSL_STORE_SEARCH_free(criterion);

     if (ok) {
+        STACK_OF(X509_OBJECT) *store_objects;
         X509_STORE *store = X509_LOOKUP_get_store(ctx);

         if (!ossl_x509_store_read_lock(store))
             return 0;
-        tmp = X509_OBJECT_retrieve_by_subject(store_objects, type, name);
+        if (store->objs_ht != NULL)
+            store_objects = ossl_x509_store_ht_get_by_name(store, name);
+        else
+            store_objects = store->objs;
+        if (store_objects != NULL)
+            tmp = X509_OBJECT_retrieve_by_subject(store_objects, type, name);
         X509_STORE_unlock(store);
     }

@@ -270,7 +281,7 @@ static int by_store_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
  */

 static X509_LOOKUP_METHOD x509_store_lookup = {
-    "Load certs from STORE URIs",
+    "Load certificates and CRLs from OSSL_STORE URIs",
     NULL, /* new_item */
     by_store_free, /* free */
     NULL, /* init */
diff --git a/deps/openssl/openssl/crypto/x509/ext_dat.h b/deps/openssl/openssl/crypto/x509/ext_dat.h
index 5d4c2fdb86c..02f4a5e158e 100644
--- a/deps/openssl/openssl/crypto/x509/ext_dat.h
+++ b/deps/openssl/openssl/crypto/x509/ext_dat.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,11 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_X509_EXT_DAT_H)
+#define OSSL_LIBCRYPTO_X509_EXT_DAT_H
+
+#include <openssl/x509v3.h>
+
 int ossl_v3_name_cmp(const char *name, const char *cmp);

 extern const X509V3_EXT_METHOD ossl_v3_bcons, ossl_v3_nscert, ossl_v3_key_usage, ossl_v3_ext_ku;
@@ -49,3 +54,5 @@ extern const X509V3_EXT_METHOD ossl_v3_time_specification;
 extern const X509V3_EXT_METHOD ossl_v3_attribute_mappings;
 extern const X509V3_EXT_METHOD ossl_v3_allowed_attribute_assignments;
 extern const X509V3_EXT_METHOD ossl_v3_aa_issuing_dist_point;
+
+#endif /* !defined(OSSL_LIBCRYPTO_X509_EXT_DAT_H) */
diff --git a/deps/openssl/openssl/crypto/x509/pcy_local.h b/deps/openssl/openssl/crypto/x509/pcy_local.h
index 957ea59723b..491b0236d45 100644
--- a/deps/openssl/openssl/crypto/x509/pcy_local.h
+++ b/deps/openssl/openssl/crypto/x509/pcy_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,14 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_LIBCRYPTO_X509_PCY_LOCAL_H)
+#define OSSL_LIBCRYPTO_X509_PCY_LOCAL_H
+
+#include <openssl/asn1.h>
+#include <openssl/safestack.h>
+#include <openssl/types.h>
+#include <openssl/x509v3.h>
+
 typedef struct X509_POLICY_DATA_st X509_POLICY_DATA;

 DEFINE_STACK_OF(X509_POLICY_DATA)
@@ -169,3 +177,5 @@ int ossl_policy_node_match(const X509_POLICY_LEVEL *lvl,
     const X509_POLICY_NODE *node, const ASN1_OBJECT *oid);

 const X509_POLICY_CACHE *ossl_policy_cache_set(X509 *x);
+
+#endif /* !defined(OSSL_LIBCRYPTO_X509_PCY_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/x509/pcy_tree.c b/deps/openssl/openssl/crypto/x509/pcy_tree.c
index f9d9990bd1d..ebc093f6aa4 100644
--- a/deps/openssl/openssl/crypto/x509/pcy_tree.c
+++ b/deps/openssl/openssl/crypto/x509/pcy_tree.c
@@ -187,7 +187,7 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs,
      * policies of anyPolicy.  (RFC 5280 has the TA at depth 0 and the leaf at
      * depth n, we have the leaf at depth 0 and the TA at depth n).
      */
-    if ((tree->levels = OPENSSL_zalloc(sizeof(*tree->levels) * (n + 1))) == NULL) {
+    if ((tree->levels = OPENSSL_calloc(n + 1, sizeof(*tree->levels))) == NULL) {
         OPENSSL_free(tree);
         return X509_PCY_TREE_INTERNAL;
     }
diff --git a/deps/openssl/openssl/crypto/x509/standard_exts.h b/deps/openssl/openssl/crypto/x509/standard_exts.h
index a05213e9032..077b7dee35a 100644
--- a/deps/openssl/openssl/crypto/x509/standard_exts.h
+++ b/deps/openssl/openssl/crypto/x509/standard_exts.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,7 +12,12 @@
  * of the ext_nid values.
  */

-static const X509V3_EXT_METHOD *standard_exts[] = {
+#if !defined(OSSL_LIBCRYPTO_X509_STANDARD_EXTS_H)
+#define OSSL_LIBCRYPTO_X509_STANDARD_EXTS_H
+
+#include "ext_dat.h"
+
+static const X509V3_EXT_METHOD *const standard_exts[] = {
     &ossl_v3_nscert,
     &ossl_v3_ns_ia5_list[0],
     &ossl_v3_ns_ia5_list[1],
@@ -97,3 +102,5 @@ static const X509V3_EXT_METHOD *standard_exts[] = {
 /* Number of standard extensions */

 #define STANDARD_EXTENSION_COUNT OSSL_NELEM(standard_exts)
+
+#endif /* !defined(OSSL_LIBCRYPTO_X509_STANDARD_EXTS_H) */
diff --git a/deps/openssl/openssl/crypto/x509/t_acert.c b/deps/openssl/openssl/crypto/x509/t_acert.c
index 1ef7fab682b..f98c4c46b95 100644
--- a/deps/openssl/openssl/crypto/x509/t_acert.c
+++ b/deps/openssl/openssl/crypto/x509/t_acert.c
@@ -14,9 +14,11 @@
 #include <openssl/objects.h>
 #include <openssl/x509_acert.h>

+#include <crypto/asn1.h>
+
 static int print_attribute(BIO *bp, X509_ATTRIBUTE *a)
 {
-    ASN1_OBJECT *aobj;
+    const ASN1_OBJECT *aobj;
     int i, j, count;
     int ret = 0;

@@ -40,7 +42,7 @@ static int print_attribute(BIO *bp, X509_ATTRIBUTE *a)
         goto err;

     for (i = 0; i < count; i++) {
-        ASN1_TYPE *at;
+        const ASN1_TYPE *at;
         int type;
         ASN1_BIT_STRING *bs;

@@ -242,8 +244,8 @@ int X509_ACERT_print_ex(BIO *bp, X509_ACERT *x, unsigned long nmflags,
             if (BIO_printf(bp, "%8sExtensions:\n", "") <= 0)
                 goto err;
             for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) {
-                ASN1_OBJECT *obj;
-                X509_EXTENSION *ex;
+                const ASN1_OBJECT *obj;
+                const X509_EXTENSION *ex;
                 int critical;

                 ex = sk_X509_EXTENSION_value(exts, i);
diff --git a/deps/openssl/openssl/crypto/x509/t_crl.c b/deps/openssl/openssl/crypto/x509/t_crl.c
index 106616a6912..7dfaaad5eb9 100644
--- a/deps/openssl/openssl/crypto/x509/t_crl.c
+++ b/deps/openssl/openssl/crypto/x509/t_crl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -32,12 +32,12 @@ int X509_CRL_print_fp(FILE *fp, X509_CRL *x)
 }
 #endif

-int X509_CRL_print(BIO *out, X509_CRL *x)
+int X509_CRL_print(BIO *out, const X509_CRL *x)
 {
     return X509_CRL_print_ex(out, x, XN_FLAG_COMPAT);
 }

-int X509_CRL_print_ex(BIO *out, X509_CRL *x, unsigned long nmflag)
+int X509_CRL_print_ex(BIO *out, const X509_CRL *x, unsigned long nmflag)
 {
     STACK_OF(X509_REVOKED) *rev;
     X509_REVOKED *r;
@@ -45,22 +45,28 @@ int X509_CRL_print_ex(BIO *out, X509_CRL *x, unsigned long nmflag)
     const ASN1_BIT_STRING *sig;
     long l;
     int i;
+    char mlch = ' ';
+    int nmindent = 0;
+
+    if ((nmflag & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
+        mlch = '\n';
+        nmindent = 8;
+    }

     BIO_printf(out, "Certificate Revocation List (CRL):\n");
     l = X509_CRL_get_version(x);
     if (l >= X509_CRL_VERSION_1 && l <= X509_CRL_VERSION_2)
-        BIO_printf(out, "%8sVersion %ld (0x%lx)\n", "", l + 1, (unsigned long)l);
+        BIO_printf(out, "%4sVersion %ld (0x%lx)\n", "", l + 1, (unsigned long)l);
     else
-        BIO_printf(out, "%8sVersion unknown (%ld)\n", "", l);
+        BIO_printf(out, "%4sVersion unknown (%ld)\n", "", l);
     X509_CRL_get0_signature(x, &sig, &sig_alg);
-    BIO_puts(out, "    ");
     X509_signature_print(out, sig_alg, NULL);
-    BIO_printf(out, "%8sIssuer: ", "");
-    X509_NAME_print_ex(out, X509_CRL_get_issuer(x), 0, nmflag);
+    BIO_printf(out, "%4sIssuer:%c", "", mlch);
+    X509_NAME_print_ex(out, X509_CRL_get_issuer(x), nmindent, nmflag);
     BIO_puts(out, "\n");
-    BIO_printf(out, "%8sLast Update: ", "");
+    BIO_printf(out, "%4sLast Update: ", "");
     ASN1_TIME_print(out, X509_CRL_get0_lastUpdate(x));
-    BIO_printf(out, "\n%8sNext Update: ", "");
+    BIO_printf(out, "\n%4sNext Update: ", "");
     if (X509_CRL_get0_nextUpdate(x))
         ASN1_TIME_print(out, X509_CRL_get0_nextUpdate(x));
     else
@@ -68,7 +74,7 @@ int X509_CRL_print_ex(BIO *out, X509_CRL *x, unsigned long nmflag)
     BIO_printf(out, "\n");

     X509V3_extensions_print(out, "CRL extensions",
-        X509_CRL_get0_extensions(x), 0, 8);
+        X509_CRL_get0_extensions(x), 0, 4);

     rev = X509_CRL_get_REVOKED(x);

diff --git a/deps/openssl/openssl/crypto/x509/t_req.c b/deps/openssl/openssl/crypto/x509/t_req.c
index fc7f4c74e77..0461b2ff89c 100644
--- a/deps/openssl/openssl/crypto/x509/t_req.c
+++ b/deps/openssl/openssl/crypto/x509/t_req.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,8 +17,10 @@
 #include <openssl/rsa.h>
 #include <openssl/dsa.h>

+#include <crypto/asn1.h>
+
 #ifndef OPENSSL_NO_STDIO
-int X509_REQ_print_fp(FILE *fp, X509_REQ *x)
+int X509_REQ_print_fp(FILE *fp, const X509_REQ *x)
 {
     BIO *b;
     int ret;
@@ -34,8 +36,7 @@ int X509_REQ_print_fp(FILE *fp, X509_REQ *x)
 }
 #endif

-int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags,
-    unsigned long cflag)
+int X509_REQ_print_ex(BIO *bp, const X509_REQ *x, unsigned long nmflags, unsigned long cflag)
 {
     long l;
     int i;
@@ -113,10 +114,10 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags,
                 goto err;
         } else {
             for (i = 0; i < X509_REQ_get_attr_count(x); i++) {
-                ASN1_TYPE *at;
+                const ASN1_TYPE *at;
                 X509_ATTRIBUTE *a;
                 ASN1_BIT_STRING *bs = NULL;
-                ASN1_OBJECT *aobj;
+                const ASN1_OBJECT *aobj;
                 int j, type = 0, count = 1, ii = 0;

                 a = X509_REQ_get_attr(x, i);
@@ -170,8 +171,8 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags,
             if (BIO_printf(bp, "%12sRequested Extensions:\n", "") <= 0)
                 goto err;
             for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) {
-                ASN1_OBJECT *obj;
-                X509_EXTENSION *ex;
+                const ASN1_OBJECT *obj;
+                const X509_EXTENSION *ex;
                 int critical;
                 ex = sk_X509_EXTENSION_value(exts, i);
                 if (BIO_printf(bp, "%16s", "") <= 0)
@@ -212,7 +213,7 @@ err:
     return 0;
 }

-int X509_REQ_print(BIO *bp, X509_REQ *x)
+int X509_REQ_print(BIO *bp, const X509_REQ *x)
 {
     return X509_REQ_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
 }
diff --git a/deps/openssl/openssl/crypto/x509/t_x509.c b/deps/openssl/openssl/crypto/x509/t_x509.c
index ca275201836..8e57d9b3284 100644
--- a/deps/openssl/openssl/crypto/x509/t_x509.c
+++ b/deps/openssl/openssl/crypto/x509/t_x509.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -16,6 +16,7 @@
 #include <openssl/x509v3.h>
 #include "crypto/asn1.h"
 #include "crypto/x509.h"
+#include "crypto/evp.h"

 void OSSL_STACK_OF_X509_free(STACK_OF(X509) *certs)
 {
@@ -23,13 +24,12 @@ void OSSL_STACK_OF_X509_free(STACK_OF(X509) *certs)
 }

 #ifndef OPENSSL_NO_STDIO
-int X509_print_fp(FILE *fp, X509 *x)
+int X509_print_fp(FILE *fp, const X509 *x)
 {
     return X509_print_ex_fp(fp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
 }

-int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag,
-    unsigned long cflag)
+int X509_print_ex_fp(FILE *fp, const X509 *x, unsigned long nmflag, unsigned long cflag)
 {
     BIO *b;
     int ret;
@@ -45,13 +45,12 @@ int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag,
 }
 #endif

-int X509_print(BIO *bp, X509 *x)
+int X509_print(BIO *bp, const X509 *x)
 {
     return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
 }

-int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags,
-    unsigned long cflag)
+int X509_print_ex(BIO *bp, const X509 *x, unsigned long nmflags, unsigned long cflag)
 {
     long l;
     int ret = 0;
@@ -135,7 +134,7 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags,
             goto err;
     }
     if (!(cflag & X509_FLAG_NO_PUBKEY)) {
-        X509_PUBKEY *xpkey = X509_get_X509_PUBKEY(x);
+        const X509_PUBKEY *xpkey = X509_get_X509_PUBKEY(x);
         ASN1_OBJECT *xpoid;
         X509_PUBKEY_get0_param(&xpoid, NULL, NULL, NULL, xpkey);
         if (BIO_write(bp, "        Subject Public Key Info:\n", 33) <= 0)
@@ -194,14 +193,14 @@ err:
     return ret;
 }

-int X509_ocspid_print(BIO *bp, X509 *x)
+int X509_ocspid_print(BIO *bp, const X509 *x)
 {
     unsigned char *der = NULL;
     unsigned char *dertmp;
     int derlen;
     int i;
     unsigned char SHA1md[SHA_DIGEST_LENGTH];
-    ASN1_BIT_STRING *keybstr;
+    const ASN1_BIT_STRING *keybstr;
     const X509_NAME *subj;
     EVP_MD *md = NULL;

@@ -245,7 +244,7 @@ int X509_ocspid_print(BIO *bp, X509 *x)
         goto err;

     if (!EVP_Digest(ASN1_STRING_get0_data(keybstr),
-            ASN1_STRING_length(keybstr), SHA1md, NULL, md, NULL))
+            ASN1_STRING_get_length(keybstr), SHA1md, NULL, md, NULL))
         goto err;
     for (i = 0; i < SHA_DIGEST_LENGTH; i++) {
         if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0)
@@ -269,7 +268,7 @@ int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent)
     n = sig->length;
     s = sig->data;
     for (i = 0; i < n; i++) {
-        if ((i % 18) == 0) {
+        if ((i % 24) == 0) {
             if (i > 0 && BIO_write(bp, "\n", 1) <= 0)
                 return 0;
             if (BIO_indent(bp, indent, indent) <= 0)
@@ -287,7 +286,9 @@ int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent)
 int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg,
     const ASN1_STRING *sig)
 {
+#ifndef OPENSSL_NO_DEPRECATED_3_6
     int sig_nid;
+#endif
     int indent = 4;
     if (BIO_printf(bp, "%*sSignature Algorithm: ", indent, "") <= 0)
         return 0;
@@ -296,16 +297,18 @@ int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg,

     if (sig && BIO_printf(bp, "\n%*sSignature Value:", indent, "") <= 0)
         return 0;
+#ifndef OPENSSL_NO_DEPRECATED_3_6
     sig_nid = OBJ_obj2nid(sigalg->algorithm);
     if (sig_nid != NID_undef) {
         int pkey_nid, dig_nid;
         const EVP_PKEY_ASN1_METHOD *ameth;
         if (OBJ_find_sigid_algs(sig_nid, &dig_nid, &pkey_nid)) {
-            ameth = EVP_PKEY_asn1_find(NULL, pkey_nid);
+            ameth = evp_pkey_asn1_find(pkey_nid);
             if (ameth && ameth->sig_print)
                 return ameth->sig_print(bp, sigalg, sig, indent + 4, 0);
         }
     }
+#endif
     if (BIO_write(bp, "\n", 1) != 1)
         return 0;
     if (sig)
@@ -313,10 +316,10 @@ int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg,
     return 1;
 }

-int X509_aux_print(BIO *out, X509 *x, int indent)
+int X509_aux_print(BIO *out, const X509 *x, int indent)
 {
     char oidstr[80], first;
-    STACK_OF(ASN1_OBJECT) *trust, *reject;
+    const STACK_OF(ASN1_OBJECT) *trust, *reject;
     const unsigned char *alias, *keyid;
     int keyidlen;
     int i;
@@ -371,34 +374,45 @@ int X509_aux_print(BIO *out, X509 *x, int indent)
  * Helper functions for improving certificate verification error diagnostics
  */

-int ossl_x509_print_ex_brief(BIO *bio, X509 *cert, unsigned long neg_cflags)
+int ossl_x509_print_ex_brief(BIO *bio, const X509 *cert, unsigned long neg_cflags)
 {
     unsigned long flags = ASN1_STRFLGS_RFC2253 | ASN1_STRFLGS_ESC_QUOTE | XN_FLAG_SEP_CPLUS_SPC | XN_FLAG_FN_SN;
+    X509_VERIFY_PARAM *vpm = X509_VERIFY_PARAM_new();
+    int error, ret = 0;

-    if (cert == NULL)
-        return BIO_printf(bio, "    (no certificate)\n") > 0;
+    if (vpm == NULL) {
+        ret = BIO_printf(bio, "    (malloc failed)\n") > 0;
+        goto err;
+    }
+    if (cert == NULL) {
+        ret = BIO_printf(bio, "    (no certificate)\n") > 0;
+        goto err;
+    }
     if (BIO_printf(bio, "    certificate\n") <= 0
         || !X509_print_ex(bio, cert, flags, ~X509_FLAG_NO_SUBJECT))
-        return 0;
-    if (X509_check_issued((X509 *)cert, cert) == X509_V_OK) {
+        goto err;
+    if (X509_check_issued(cert, cert) == X509_V_OK) {
         if (BIO_printf(bio, "        self-issued\n") <= 0)
-            return 0;
+            goto err;
     } else {
         if (BIO_printf(bio, " ") <= 0
             || !X509_print_ex(bio, cert, flags, ~X509_FLAG_NO_ISSUER))
-            return 0;
+            goto err;
     }
     if (!X509_print_ex(bio, cert, flags,
             ~(X509_FLAG_NO_SERIAL | X509_FLAG_NO_VALIDITY)))
-        return 0;
-    if (X509_cmp_current_time(X509_get0_notBefore(cert)) > 0)
-        if (BIO_printf(bio, "        not yet valid\n") <= 0)
-            return 0;
-    if (X509_cmp_current_time(X509_get0_notAfter(cert)) < 0)
-        if (BIO_printf(bio, "        no more valid\n") <= 0)
-            return 0;
-    return X509_print_ex(bio, cert, flags,
+        goto err;
+
+    if (!X509_check_certificate_times(vpm, cert, &error)) {
+        if (BIO_printf(bio, "        %s\n", X509_verify_cert_error_string(error)) <= 0)
+            goto err;
+    }
+    ret = X509_print_ex(bio, cert, flags,
         ~neg_cflags & ~X509_FLAG_EXTENSIONS_ONLY_KID);
+
+err:
+    X509_VERIFY_PARAM_free(vpm);
+    return ret;
 }

 static int print_certs(BIO *bio, const STACK_OF(X509) *certs)
diff --git a/deps/openssl/openssl/crypto/x509/v3_aaa.c b/deps/openssl/openssl/crypto/x509/v3_aaa.c
index 64d0791eb4d..ab61780a6ad 100644
--- a/deps/openssl/openssl/crypto/x509/v3_aaa.c
+++ b/deps/openssl/openssl/crypto/x509/v3_aaa.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -39,10 +39,10 @@ static int i2r_ALLOWED_ATTRIBUTES_CHOICE(X509V3_EXT_METHOD *method,
     OSSL_ALLOWED_ATTRIBUTES_CHOICE *a,
     BIO *out, int indent)
 {
-    ASN1_OBJECT *attr_obj;
+    const ASN1_OBJECT *attr_obj;
     int attr_nid, j;
     X509_ATTRIBUTE *attr;
-    ASN1_TYPE *av;
+    const ASN1_TYPE *av;

     switch (a->type) {
     case (OSSL_AAA_ATTRIBUTE_TYPE):
diff --git a/deps/openssl/openssl/crypto/x509/v3_ac_tgt.c b/deps/openssl/openssl/crypto/x509/v3_ac_tgt.c
index b819f765955..5471ba39074 100644
--- a/deps/openssl/openssl/crypto/x509/v3_ac_tgt.c
+++ b/deps/openssl/openssl/crypto/x509/v3_ac_tgt.c
@@ -18,6 +18,9 @@
 #include "ext_dat.h"
 #include "x509_local.h"
 #include "crypto/asn1.h"
+#include "crypto/evp.h"
+
+#include <crypto/asn1.h>

 static int i2r_ISSUER_SERIAL(X509V3_EXT_METHOD *method,
     OSSL_ISSUER_SERIAL *iss,
@@ -104,15 +107,16 @@ static int i2r_OBJECT_DIGEST_INFO(X509V3_EXT_METHOD *method,
     BIO *out, int indent)
 {
     int64_t dot = 0;
+#ifndef OPENSSL_NO_DEPRECATED_3_6
     int sig_nid;
     X509_ALGOR *digalg;
+#endif
     ASN1_STRING *sig;

     if (odi == NULL) {
         ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
-    digalg = &odi->digestAlgorithm;
     sig = &odi->objectDigest;
     if (!ASN1_ENUMERATED_get_int64(&dot, &odi->digestedObjectType)) {
         return 0;
@@ -140,16 +144,19 @@ static int i2r_OBJECT_DIGEST_INFO(X509V3_EXT_METHOD *method,
     BIO_puts(out, "\n");
     if (BIO_printf(out, "\n%*sSignature Value: ", indent, "") <= 0)
         return 0;
+#ifndef OPENSSL_NO_DEPRECATED_3_6
+    digalg = &odi->digestAlgorithm;
     sig_nid = OBJ_obj2nid(odi->digestAlgorithm.algorithm);
     if (sig_nid != NID_undef) {
         int pkey_nid, dig_nid;
         const EVP_PKEY_ASN1_METHOD *ameth;
         if (OBJ_find_sigid_algs(sig_nid, &dig_nid, &pkey_nid)) {
-            ameth = EVP_PKEY_asn1_find(NULL, pkey_nid);
+            ameth = evp_pkey_asn1_find(pkey_nid);
             if (ameth && ameth->sig_print)
                 return ameth->sig_print(out, digalg, sig, indent + 4, 0);
         }
     }
+#endif
     if (BIO_write(out, "\n", 1) != 1)
         return 0;
     if (sig)
diff --git a/deps/openssl/openssl/crypto/x509/v3_addr.c b/deps/openssl/openssl/crypto/x509/v3_addr.c
index c8e865477c6..73ad2345b95 100644
--- a/deps/openssl/openssl/crypto/x509/v3_addr.c
+++ b/deps/openssl/openssl/crypto/x509/v3_addr.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -409,6 +409,11 @@ static int make_addressPrefix(IPAddressOrRange **result, unsigned char *addr,
 {
     int bytelen = (prefixlen + 7) / 8, bitlen = prefixlen % 8;
     IPAddressOrRange *aor;
+    unsigned char *prefix = NULL;
+    uint8_t unused_bits = 0;
+
+    if (bitlen > 0)
+        unused_bits = 8 - bitlen;

     if (prefixlen < 0 || prefixlen > (afilen * 8))
         return 0;
@@ -417,16 +422,23 @@ static int make_addressPrefix(IPAddressOrRange **result, unsigned char *addr,
     aor->type = IPAddressOrRange_addressPrefix;
     if (aor->u.addressPrefix == NULL && (aor->u.addressPrefix = ASN1_BIT_STRING_new()) == NULL)
         goto err;
-    if (!ASN1_BIT_STRING_set(aor->u.addressPrefix, addr, bytelen))
+    if (bytelen > 0) {
+        prefix = OPENSSL_malloc(bytelen);
+        if (prefix == NULL)
+            goto err;
+        memcpy(prefix, addr, bytelen);
+        if (unused_bits)
+            prefix[bytelen - 1] &= ~(0xFF >> bitlen);
+    }
+    if (!ASN1_BIT_STRING_set1(aor->u.addressPrefix, prefix, bytelen, unused_bits))
         goto err;
-    if (bitlen > 0)
-        aor->u.addressPrefix->data[bytelen - 1] &= ~(0xFF >> bitlen);
-    ossl_asn1_string_set_bits_left(aor->u.addressPrefix, 8 - bitlen);
-
     *result = aor;
+
+    OPENSSL_free(prefix);
     return 1;

 err:
+    OPENSSL_free(prefix);
     IPAddressOrRange_free(aor);
     return 0;
 }
@@ -461,9 +473,8 @@ static int make_addressRange(IPAddressOrRange **result,

     for (i = length; i > 0 && min[i - 1] == 0x00; --i)
         ;
-    if (!ASN1_BIT_STRING_set(aor->u.addressRange->min, min, i))
+    if (!ASN1_BIT_STRING_set1(aor->u.addressRange->min, min, i, 0))
         goto err;
-    ossl_asn1_string_set_bits_left(aor->u.addressRange->min, 0);
     if (i > 0) {
         unsigned char b = min[i - 1];
         int j = 1;
@@ -475,9 +486,8 @@ static int make_addressRange(IPAddressOrRange **result,

     for (i = length; i > 0 && max[i - 1] == 0xFF; --i)
         ;
-    if (!ASN1_BIT_STRING_set(aor->u.addressRange->max, max, i))
+    if (!ASN1_BIT_STRING_set1(aor->u.addressRange->max, max, i, 0))
         goto err;
-    ossl_asn1_string_set_bits_left(aor->u.addressRange->max, 0);
     if (i > 0) {
         unsigned char b = max[i - 1];
         int j = 1;
@@ -544,7 +554,7 @@ err:
  * Add an inheritance element.
  */
 int X509v3_addr_add_inherit(IPAddrBlocks *addr,
-    const unsigned afi, const unsigned *safi)
+    unsigned afi, const unsigned *safi)
 {
     IPAddressFamily *f = make_IPAddressFamily(addr, afi, safi);

@@ -595,7 +605,7 @@ static IPAddressOrRanges *make_prefix_or_range(IPAddrBlocks *addr,
 int X509v3_addr_add_prefix(IPAddrBlocks *addr,
     const unsigned afi,
     const unsigned *safi,
-    unsigned char *a, const int prefixlen)
+    unsigned char *a, int prefixlen)
 {
     IPAddressOrRanges *aors = make_prefix_or_range(addr, afi, safi);
     IPAddressOrRange *aor;
@@ -613,7 +623,7 @@ int X509v3_addr_add_prefix(IPAddrBlocks *addr,
  * Add a range.
  */
 int X509v3_addr_add_range(IPAddrBlocks *addr,
-    const unsigned afi,
+    unsigned afi,
     const unsigned *safi,
     unsigned char *min, unsigned char *max)
 {
@@ -652,9 +662,9 @@ static int extract_min_max(IPAddressOrRange *aor,
  * Public wrapper for extract_min_max().
  */
 int X509v3_addr_get_range(IPAddressOrRange *aor,
-    const unsigned afi,
+    unsigned afi,
     unsigned char *min,
-    unsigned char *max, const int length)
+    unsigned char *max, int length)
 {
     int afi_length = length_from_afi(afi);

@@ -679,10 +689,15 @@ static int IPAddressFamily_cmp(const IPAddressFamily *const *a_,
 {
     const ASN1_OCTET_STRING *a = (*a_)->addressFamily;
     const ASN1_OCTET_STRING *b = (*b_)->addressFamily;
-    int len = ((a->length <= b->length) ? a->length : b->length);
-    int cmp = memcmp(a->data, b->data, len);
+    int cmp, len = (a->length <= b->length) ? a->length : b->length;

-    return cmp ? cmp : a->length - b->length;
+    if (len > 0) {
+        cmp = memcmp(a->data, b->data, len);
+        if (cmp != 0)
+            return cmp;
+    }
+
+    return a->length - b->length;
 }

 static int IPAddressFamily_check_len(const IPAddressFamily *f)
@@ -754,6 +769,7 @@ int X509v3_addr_is_canonical(IPAddrBlocks *addr)
         aors = f->ipAddressChoice->u.addressesOrRanges;
         if (sk_IPAddressOrRange_num(aors) == 0)
             return 0;
+
         for (j = 0; j < sk_IPAddressOrRange_num(aors) - 1; j++) {
             IPAddressOrRange *a = sk_IPAddressOrRange_value(aors, j);
             IPAddressOrRange *b = sk_IPAddressOrRange_value(aors, j + 1);
@@ -808,79 +824,136 @@ int X509v3_addr_is_canonical(IPAddrBlocks *addr)

 /*
  * Whack an IPAddressOrRanges into canonical form.
+ *
+ * After the initial sort, the merge runs as a single linear sweep
+ * over the list using a write index.  Adjacent entries are folded
+ * into the previous output by replacing it with a freshly built
+ * merged range; both old entries are then freed and the consumed
+ * source slot is recorded as NULL.  Total cost is O(N log N) sort +
+ * O(N) merge, with no stack deletes inside the loop.
+ *
+ * The NULL slots are closed up by a single compaction pass at the end,
+ * which runs whether the sweep succeeded or failed.  This guarantees
+ * the live stack is always left hole-free, with every occupied slot
+ * non-NULL, so on error the caller may safely inspect, print, encode,
+ * free, or retry canonize on the object.  The sort comparator
+ * dereferences every slot with no NULL guard, so a retry (which
+ * re-sorts) would crash on a hole.  is_canonical tolerates NULL by
+ * returning non-canonical, but the object is still structurally
+ * invalid.
  */
 static int IPAddressOrRanges_canonize(IPAddressOrRanges *aors,
     const unsigned afi)
 {
-    int i, j, length = length_from_afi(afi);
+    int length = length_from_afi(afi);
+    int read, write = 0, n;
+    int ret = 0;

-    /*
-     * Sort the IPAddressOrRanges sequence.
-     */
     sk_IPAddressOrRange_sort(aors);
+    n = sk_IPAddressOrRange_num(aors);

-    /*
-     * Clean up representation issues, punt on duplicates or overlaps.
-     */
-    for (i = 0; i < sk_IPAddressOrRange_num(aors) - 1; i++) {
-        IPAddressOrRange *a = sk_IPAddressOrRange_value(aors, i);
-        IPAddressOrRange *b = sk_IPAddressOrRange_value(aors, i + 1);
-        unsigned char a_min[ADDR_RAW_BUF_LEN], a_max[ADDR_RAW_BUF_LEN];
-        unsigned char b_min[ADDR_RAW_BUF_LEN], b_max[ADDR_RAW_BUF_LEN];
+    for (read = 0; read < n; read++) {
+        IPAddressOrRange *cur = sk_IPAddressOrRange_value(aors, read);
+        unsigned char c_min[ADDR_RAW_BUF_LEN], c_max[ADDR_RAW_BUF_LEN];

-        if (!extract_min_max(a, a_min, a_max, length) || !extract_min_max(b, b_min, b_max, length))
-            return 0;
+        if (!extract_min_max(cur, c_min, c_max, length))
+            goto done;

         /*
-         * Punt inverted ranges.
+         * Punt inverted range.
          */
-        if (memcmp(a_min, a_max, length) > 0 || memcmp(b_min, b_max, length) > 0)
-            return 0;
+        if (memcmp(c_min, c_max, length) > 0)
+            goto done;

-        /*
-         * Punt overlaps.
-         */
-        if (memcmp(a_max, b_min, length) >= 0)
-            return 0;
+        if (write > 0) {
+            IPAddressOrRange *prev = sk_IPAddressOrRange_value(aors,
+                write - 1);
+            unsigned char p_min[ADDR_RAW_BUF_LEN], p_max[ADDR_RAW_BUF_LEN];
+            unsigned char c_min_minus_one[ADDR_RAW_BUF_LEN];
+            int j;
+
+            if (!extract_min_max(prev, p_min, p_max, length))
+                goto done;
+
+            /*
+             * Reject overlap with the previous accepted entry.
+             */
+            if (memcmp(p_max, c_min, length) >= 0)
+                goto done;
+
+            /*
+             * Adjacency test: does c_min - 1 equal p_max?  Work on a
+             * scratch copy so the original c_min stays intact for use
+             * as the lower bound if we end up keeping cur.
+             */
+            memcpy(c_min_minus_one, c_min, length);
+            for (j = length - 1;
+                j >= 0 && c_min_minus_one[j]-- == 0x00;
+                j--)
+                ;
+            if (memcmp(p_max, c_min_minus_one, length) == 0) {
+                IPAddressOrRange *merged;
+
+                if (!make_addressRange(&merged, p_min, c_max, length))
+                    goto done;
+                /*
+                 * Replace prev with merged, free the originals, and
+                 * record the consumed source slot as NULL; the epilogue
+                 * compacts NULLs out of the live stack so it is left
+                 * hole-free whether we succeed or fail.
+                 */
+                (void)sk_IPAddressOrRange_set(aors, write - 1, merged);
+                IPAddressOrRange_free(prev);
+                IPAddressOrRange_free(cur);
+                (void)sk_IPAddressOrRange_set(aors, read, NULL);
+                continue;
+            }
+        }

         /*
-         * Merge if a and b are adjacent.  We check for
-         * adjacency by subtracting one from b_min first.
+         * Keep cur.  Slide it forward into the write slot if we have
+         * fallen behind, and NULL the source slot to avoid duplicate
+         * ownership.
          */
-        for (j = length - 1; j >= 0 && b_min[j]-- == 0x00; j--)
-            ;
-        if (memcmp(a_max, b_min, length) == 0) {
-            IPAddressOrRange *merged;
-
-            if (!make_addressRange(&merged, a_min, b_max, length))
-                return 0;
-            (void)sk_IPAddressOrRange_set(aors, i, merged);
-            (void)sk_IPAddressOrRange_delete(aors, i + 1);
-            IPAddressOrRange_free(a);
-            IPAddressOrRange_free(b);
-            --i;
-            continue;
+        if (write != read) {
+            (void)sk_IPAddressOrRange_set(aors, write, cur);
+            (void)sk_IPAddressOrRange_set(aors, read, NULL);
         }
+        write++;
     }

+    ret = 1;
+
+done:
     /*
-     * Check for inverted final range.
+     * The sweep above NULLs source slots as it folds entries.  Whether
+     * we succeeded or bailed out on an error, the stack must be left
+     * hole-free, with every occupied slot non-NULL, so that the caller
+     * may inspect, print, encode, free, or even retry canonize on the
+     * object without dereferencing NULL.  Slide every non-NULL slot
+     * forward to close the holes, then pop the vacated tail.  On success
+     * this collapses [write..n-1] (all NULL) to length `write`; on error
+     * it removes the possibly empty contiguous run of NULL slots in
+     * [write, read), preserving the processed output in [0, write) and
+     * the untouched original entries in [read, n).
      */
-    j = sk_IPAddressOrRange_num(aors) - 1;
     {
-        IPAddressOrRange *a = sk_IPAddressOrRange_value(aors, j);
+        int w = 0, r;

-        if (a != NULL && a->type == IPAddressOrRange_addressRange) {
-            unsigned char a_min[ADDR_RAW_BUF_LEN], a_max[ADDR_RAW_BUF_LEN];
+        for (r = 0; r < sk_IPAddressOrRange_num(aors); r++) {
+            IPAddressOrRange *v = sk_IPAddressOrRange_value(aors, r);

-            if (!extract_min_max(a, a_min, a_max, length))
-                return 0;
-            if (memcmp(a_min, a_max, length) > 0)
-                return 0;
+            if (v != NULL) {
+                if (w != r)
+                    (void)sk_IPAddressOrRange_set(aors, w, v);
+                w++;
+            }
         }
+        while (sk_IPAddressOrRange_num(aors) > w)
+            (void)sk_IPAddressOrRange_pop(aors);
     }

-    return 1;
+    return ret;
 }

 /*
@@ -1002,8 +1075,8 @@ static void *v2i_IPAddrBlocks(const struct v3_ext_method *method,
             continue;
         }

-        i1 = strspn(s, addr_chars);
-        i2 = i1 + strspn(s + i1, " \t");
+        i1 = (int)strspn(s, addr_chars);
+        i2 = i1 + (int)strspn(s + i1, " \t");
         delim = s[i2++];
         s[i1] = '\0';

@@ -1030,8 +1103,8 @@ static void *v2i_IPAddrBlocks(const struct v3_ext_method *method,
             }
             break;
         case '-':
-            i1 = i2 + strspn(s + i2, " \t");
-            i2 = i1 + strspn(s + i1, addr_chars);
+            i1 = i2 + (int)strspn(s + i2, " \t");
+            i2 = i1 + (int)strspn(s + i1, addr_chars);
             if (i1 == i2 || s[i2] != '\0') {
                 ERR_raise(ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR);
                 X509V3_conf_add_error_name_value(val);
@@ -1210,7 +1283,7 @@ int X509v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b)
  * X509_V_OK.
  */
 static int addr_validate_path_internal(X509_STORE_CTX *ctx,
-    STACK_OF(X509) *chain,
+    const STACK_OF(X509) *chain,
     IPAddrBlocks *ext)
 {
     IPAddrBlocks *child = NULL;
@@ -1344,7 +1417,7 @@ int X509v3_addr_validate_path(X509_STORE_CTX *ctx)
  * RFC 3779 2.3 path validation of an extension.
  * Test whether chain covers extension.
  */
-int X509v3_addr_validate_resource_set(STACK_OF(X509) *chain,
+int X509v3_addr_validate_resource_set(const STACK_OF(X509) *chain,
     IPAddrBlocks *ext, int allow_inheritance)
 {
     if (ext == NULL)
diff --git a/deps/openssl/openssl/crypto/x509/v3_admis.h b/deps/openssl/openssl/crypto/x509/v3_admis.h
index 75a07c1fcdf..fc9b0809410 100644
--- a/deps/openssl/openssl/crypto/x509/v3_admis.h
+++ b/deps/openssl/openssl/crypto/x509/v3_admis.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -10,6 +10,10 @@
 #ifndef OSSL_CRYPTO_X509_V3_ADMIS_H
 #define OSSL_CRYPTO_X509_V3_ADMIS_H

+#include <openssl/asn1.h>
+#include <openssl/safestack.h>
+#include <openssl/x509v3.h>
+
 struct NamingAuthority_st {
     ASN1_OBJECT *namingAuthorityId;
     ASN1_IA5STRING *namingAuthorityUrl;
diff --git a/deps/openssl/openssl/crypto/x509/v3_akid.c b/deps/openssl/openssl/crypto/x509/v3_akid.c
index 9721518ecc0..dc660a42b09 100644
--- a/deps/openssl/openssl/crypto/x509/v3_akid.c
+++ b/deps/openssl/openssl/crypto/x509/v3_akid.c
@@ -66,7 +66,8 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
         extlist = tmpextlist;
     }
     if (akeyid->serial) {
-        tmp = i2s_ASN1_OCTET_STRING(NULL, akeyid->serial);
+        tmp = i2s_ASN1_INTEGER(NULL, akeyid->serial);
+
         if (tmp == NULL) {
             ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
             goto err;
@@ -84,6 +85,13 @@ err:
     return NULL;
 }

+enum qualifier {
+    NEVER,
+    NONSS,
+    MAYBE,
+    GOTTO,
+};
+
 /*-
  * Three explicit tags may be given, where 'keyid' and 'issuer' may be combined:
  * 'none': do not add any authority key identifier.
@@ -97,7 +105,6 @@ static AUTHORITY_KEYID *v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
     X509V3_CTX *ctx,
     STACK_OF(CONF_VALUE) *values)
 {
-    char keyid = 0, issuer = 0;
     int i, n = sk_CONF_VALUE_num(values);
     CONF_VALUE *cnf;
     ASN1_OCTET_STRING *ikeyid = NULL;
@@ -105,33 +112,37 @@ static AUTHORITY_KEYID *v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
     GENERAL_NAMES *gens = NULL;
     GENERAL_NAME *gen = NULL;
     ASN1_INTEGER *serial = NULL;
-    X509_EXTENSION *ext;
+    const X509_EXTENSION *ext;
     X509 *issuer_cert;
     int same_issuer, ss;
     AUTHORITY_KEYID *akeyid = AUTHORITY_KEYID_new();
+    enum qualifier keyid = NEVER, issuer = NEVER;

     if (akeyid == NULL)
         goto err;

-    if (n == 1 && strcmp(sk_CONF_VALUE_value(values, 0)->name, "none") == 0) {
+    if (n == 1 && strcmp(sk_CONF_VALUE_value(values, 0)->name, "none") == 0)
         return akeyid;
-    }

     for (i = 0; i < n; i++) {
+        enum qualifier q = MAYBE;
+
         cnf = sk_CONF_VALUE_value(values, i);
-        if (cnf->value != NULL && strcmp(cnf->value, "always") != 0) {
-            ERR_raise_data(ERR_LIB_X509V3, X509V3_R_UNKNOWN_OPTION,
-                "name=%s option=%s", cnf->name, cnf->value);
-            goto err;
+        if (cnf->value != NULL && *cnf->value != '\0') {
+            if (strcmp(cnf->value, "always") == 0) {
+                q = GOTTO;
+            } else if (strcmp(cnf->value, "nonss") == 0) {
+                q = NONSS;
+            } else {
+                ERR_raise_data(ERR_LIB_X509V3, X509V3_R_UNKNOWN_OPTION,
+                    "name=%s option=%s", cnf->name, cnf->value);
+                goto err;
+            }
         }
-        if (strcmp(cnf->name, "keyid") == 0 && keyid == 0) {
-            keyid = 1;
-            if (cnf->value != NULL)
-                keyid = 2;
+        if (strcmp(cnf->name, "keyid") == 0 && keyid == NEVER) {
+            keyid = q;
         } else if (strcmp(cnf->name, "issuer") == 0 && issuer == 0) {
-            issuer = 1;
-            if (cnf->value != NULL)
-                issuer = 2;
+            issuer = q;
         } else if (strcmp(cnf->name, "none") == 0
             || strcmp(cnf->name, "keyid") == 0
             || strcmp(cnf->name, "issuer") == 0) {
@@ -164,45 +175,69 @@ static AUTHORITY_KEYID *v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
         ss = same_issuer;
     ERR_pop_to_mark();

-    /* unless forced with "always", AKID is suppressed for self-signed certs */
-    if (keyid == 2 || (keyid == 1 && !ss)) {
+    if (keyid > NONSS || (keyid == NONSS && !ss)) {
         /*
-         * prefer any pre-existing subject key identifier of the issuer cert
-         * except issuer cert is same as subject cert and is not self-signed
+         * The subject key identifier of the issuer cert is acceptable unless
+         * the issuer cert is same as subject cert, but the subject will not
+         * be self-signed (i.e. will be signed with a different key).
          */
         i = X509_get_ext_by_NID(issuer_cert, NID_subject_key_identifier, -1);
         if (i >= 0 && (ext = X509_get_ext(issuer_cert, i)) != NULL
             && !(same_issuer && !ss)) {
+
             if ((ikeyid = X509V3_EXT_d2i(ext)) == NULL)
                 goto err;

-            if (ASN1_STRING_length(ikeyid) == 0) /* indicating "none" */ {
+            /* Ignore empty keyids in the issuer cert */
+            if (ASN1_STRING_get_length(ikeyid) == 0) {
                 ASN1_OCTET_STRING_free(ikeyid);
                 ikeyid = NULL;
             }
         }
-        if (ikeyid == NULL && same_issuer && ctx->issuer_pkey != NULL) {
-            /* generate fallback AKID, emulating s2i_skey_id(..., "hash") */
+        /*
+         * If we have that other key in hand, synthesise a fallback AKID,
+         * emulating s2i_skey_id(..., "hash").
+         *
+         * When creating self-signed certificates, we do not synthesise
+         * best-effort keyids, instead the keyid needs be set first.  The
+         * X509V3_EXT_add_nconf_sk() function makes every effort to process the
+         * SKID before the AKID, but some callers may specify extensions
+         * piecemeal.  We don't want to mispredict it being set later and end
+         * up with a "dangling" AKID keyid.
+         */
+        if (ikeyid == NULL && same_issuer && !ss && ctx->issuer_pkey != NULL) {
             X509_PUBKEY *pubkey = NULL;

             if (X509_PUBKEY_set(&pubkey, ctx->issuer_pkey))
                 ikeyid = ossl_x509_pubkey_hash(pubkey);
             X509_PUBKEY_free(pubkey);
         }
-        if (keyid == 2 && ikeyid == NULL) {
+        if (keyid == GOTTO && ikeyid == NULL) {
             ERR_raise(ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID);
             goto err;
         }
     }

-    if (issuer == 2 || (issuer == 1 && !ss && ikeyid == NULL)) {
-        isname = X509_NAME_dup(X509_get_issuer_name(issuer_cert));
-        serial = ASN1_INTEGER_dup(X509_get0_serialNumber(issuer_cert));
-        if (isname == NULL || serial == NULL) {
-            ERR_raise(ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS);
-            goto err;
+    /*
+     * When the same object is specified as both the issuer and subject
+     * certificate, but with a different (forced) issuer public key (so not
+     * self-signed), we don't have access to the true issuer certificate's
+     * serial number, so can't create an isser+serial AKID.
+     */
+    if (!same_issuer || ss) {
+        if (issuer == GOTTO
+            || (ikeyid == NULL
+                && (issuer == MAYBE
+                    || (issuer == NONSS && !ss)))) {
+            isname = X509_NAME_dup(X509_get_issuer_name(issuer_cert));
+            serial = ASN1_INTEGER_dup(X509_get0_serialNumber(issuer_cert));
         }
     }
+    /* "always" fails unless both issuer and serial are available */
+    if (issuer == GOTTO && (isname == NULL || serial == NULL)) {
+        ERR_raise(ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS);
+        goto err;
+    }

     if (isname != NULL) {
         if ((gens = sk_GENERAL_NAME_new_null()) == NULL
diff --git a/deps/openssl/openssl/crypto/x509/v3_asid.c b/deps/openssl/openssl/crypto/x509/v3_asid.c
index a2c7553a724..05aabcc9f66 100644
--- a/deps/openssl/openssl/crypto/x509/v3_asid.c
+++ b/deps/openssl/openssl/crypto/x509/v3_asid.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -347,13 +347,29 @@ int X509v3_asid_is_canonical(ASIdentifiers *asid)

 /*
  * Whack an ASIdentifierChoice into canonical form.
+ *
+ * After the initial sort, the merge runs as a single linear sweep
+ * over the list using a write index.  Each entry is examined once;
+ * adjacent / mergeable entries extend the previous output's upper
+ * bound in O(1) and the consumed source slot is recorded as NULL.
+ * Total cost is O(N log N) sort + O(N) merge, with no stack deletes
+ * inside the loop.
+ *
+ * The NULL slots are closed up by a single compaction pass at the end,
+ * which runs whether the sweep succeeded or failed.  This guarantees
+ * the live stack is always left hole-free, with every occupied slot
+ * non-NULL, so on error the caller may safely inspect, print, encode,
+ * free, or retry canonize on the object.  The sort comparator
+ * dereferences every slot with no NULL guard, and is_canonical's call
+ * to extract_min_max would hit its ossl_assert(aor != NULL) on a hole.
  */
 static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice)
 {
     ASN1_INTEGER *a_max_plus_one = NULL;
     ASN1_INTEGER *orig;
     BIGNUM *bn = NULL;
-    int i, ret = 0;
+    int read, write = 0, n;
+    int ret = 0;

     /*
      * Nothing to do for empty element or inheritance.
@@ -370,112 +386,157 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice)
     }

     /*
-     * We have a non-empty list.  Sort it.
+     * Sort the list, then merge in a single sweep using a write index.
      */
     sk_ASIdOrRange_sort(choice->u.asIdsOrRanges);
+    n = sk_ASIdOrRange_num(choice->u.asIdsOrRanges);

-    /*
-     * Now check for errors and suboptimal encoding, rejecting the
-     * former and fixing the latter.
-     */
-    for (i = 0; i < sk_ASIdOrRange_num(choice->u.asIdsOrRanges) - 1; i++) {
-        ASIdOrRange *a = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i);
-        ASIdOrRange *b = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i + 1);
-        ASN1_INTEGER *a_min = NULL, *a_max = NULL, *b_min = NULL, *b_max = NULL;
+    for (read = 0; read < n; read++) {
+        ASIdOrRange *cur = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, read);
+        ASN1_INTEGER *c_min = NULL, *c_max = NULL;

-        if (!extract_min_max(a, &a_min, &a_max)
-            || !extract_min_max(b, &b_min, &b_max))
+        if (!extract_min_max(cur, &c_min, &c_max))
             goto done;

         /*
-         * Make sure we're properly sorted (paranoia).
+         * Punt inverted range.
          */
-        if (!ossl_assert(ASN1_INTEGER_cmp(a_min, b_min) <= 0))
+        if (ASN1_INTEGER_cmp(c_min, c_max) > 0)
             goto done;

-        /*
-         * Punt inverted ranges.
-         */
-        if (ASN1_INTEGER_cmp(a_min, a_max) > 0 || ASN1_INTEGER_cmp(b_min, b_max) > 0)
-            goto done;
+        if (write > 0) {
+            ASIdOrRange *prev = sk_ASIdOrRange_value(choice->u.asIdsOrRanges,
+                write - 1);
+            ASN1_INTEGER *p_min = NULL, *p_max = NULL;

-        /*
-         * Check for overlaps.
-         */
-        if (ASN1_INTEGER_cmp(a_max, b_min) >= 0) {
-            ERR_raise(ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR);
-            goto done;
-        }
+            if (!extract_min_max(prev, &p_min, &p_max))
+                goto done;

-        /*
-         * Calculate a_max + 1 to check for adjacency.
-         */
-        if ((bn == NULL && (bn = BN_new()) == NULL) || ASN1_INTEGER_to_BN(a_max, bn) == NULL || !BN_add_word(bn, 1)) {
-            ERR_raise(ERR_LIB_X509V3, ERR_R_BN_LIB);
-            goto done;
-        }
+            /*
+             * Make sure we're properly sorted (paranoia).
+             */
+            if (!ossl_assert(ASN1_INTEGER_cmp(p_min, c_min) <= 0))
+                goto done;

-        if ((a_max_plus_one = BN_to_ASN1_INTEGER(bn, orig = a_max_plus_one)) == NULL) {
-            a_max_plus_one = orig;
-            ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
-            goto done;
+            /*
+             * Reject overlap with the previous accepted entry.
+             */
+            if (ASN1_INTEGER_cmp(p_max, c_min) >= 0) {
+                ERR_raise(ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR);
+                goto done;
+            }
+
+            /*
+             * Calculate p_max + 1 to check for adjacency.
+             */
+            if ((bn == NULL && (bn = BN_new()) == NULL)
+                || ASN1_INTEGER_to_BN(p_max, bn) == NULL
+                || !BN_add_word(bn, 1)) {
+                ERR_raise(ERR_LIB_X509V3, ERR_R_BN_LIB);
+                goto done;
+            }
+            if ((a_max_plus_one = BN_to_ASN1_INTEGER(bn,
+                     orig = a_max_plus_one))
+                == NULL) {
+                a_max_plus_one = orig;
+                ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
+                goto done;
+            }
+
+            /*
+             * If prev and cur are adjacent, fold cur into prev.
+             */
+            if (ASN1_INTEGER_cmp(a_max_plus_one, c_min) == 0) {
+                ASRange *r;
+
+                switch (prev->type) {
+                case ASIdOrRange_id:
+                    if ((r = OPENSSL_malloc(sizeof(*r))) == NULL)
+                        goto done;
+                    r->min = p_min;
+                    r->max = c_max;
+                    prev->type = ASIdOrRange_range;
+                    prev->u.range = r;
+                    break;
+                case ASIdOrRange_range:
+                    ASN1_INTEGER_free(prev->u.range->max);
+                    prev->u.range->max = c_max;
+                    break;
+                }
+                /*
+                 * Detach c_max from cur so freeing cur does not free
+                 * the value we just transferred to prev.
+                 */
+                switch (cur->type) {
+                case ASIdOrRange_id:
+                    cur->u.id = NULL;
+                    break;
+                case ASIdOrRange_range:
+                    cur->u.range->max = NULL;
+                    break;
+                }
+                ASIdOrRange_free(cur);
+                /*
+                 * Record the consumed source slot as NULL; the epilogue
+                 * compacts NULLs out of the live stack so it is left
+                 * hole-free whether we succeed or fail.  We do not
+                 * advance `write`.
+                 */
+                (void)sk_ASIdOrRange_set(choice->u.asIdsOrRanges, read, NULL);
+                continue;
+            }
         }

         /*
-         * If a and b are adjacent, merge them.
+         * Keep cur.  Slide it forward into the write slot if we have
+         * fallen behind, and NULL the source slot to avoid duplicate
+         * ownership.
          */
-        if (ASN1_INTEGER_cmp(a_max_plus_one, b_min) == 0) {
-            ASRange *r;
-            switch (a->type) {
-            case ASIdOrRange_id:
-                if ((r = OPENSSL_malloc(sizeof(*r))) == NULL)
-                    goto done;
-                r->min = a_min;
-                r->max = b_max;
-                a->type = ASIdOrRange_range;
-                a->u.range = r;
-                break;
-            case ASIdOrRange_range:
-                ASN1_INTEGER_free(a->u.range->max);
-                a->u.range->max = b_max;
-                break;
-            }
-            switch (b->type) {
-            case ASIdOrRange_id:
-                b->u.id = NULL;
-                break;
-            case ASIdOrRange_range:
-                b->u.range->max = NULL;
-                break;
-            }
-            ASIdOrRange_free(b);
-            (void)sk_ASIdOrRange_delete(choice->u.asIdsOrRanges, i + 1);
-            i--;
-            continue;
+        if (write != read) {
+            (void)sk_ASIdOrRange_set(choice->u.asIdsOrRanges, write, cur);
+            (void)sk_ASIdOrRange_set(choice->u.asIdsOrRanges, read, NULL);
         }
+        write++;
     }

+    ret = 1;
+
+done:
     /*
-     * Check for final inverted range.
+     * The sweep above NULLs source slots as it folds entries.  Whether
+     * we succeeded or bailed out on an error, the stack must be left
+     * hole-free, with every occupied slot non-NULL, so that the caller
+     * may inspect, print, encode, free, or even retry canonize on the
+     * object without dereferencing NULL (the sort comparator in
+     * particular has no NULL guard).  Slide every non-NULL slot forward
+     * to close the holes, then pop the vacated tail.  On success this
+     * collapses [write..n-1] (all NULL) to length `write`; on error it
+     * removes the possibly empty contiguous run of NULL slots in
+     * [write, read), preserving the processed output in [0, write) and
+     * the untouched original entries in [read, n).
      */
-    i = sk_ASIdOrRange_num(choice->u.asIdsOrRanges) - 1;
     {
-        ASIdOrRange *a = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i);
-        ASN1_INTEGER *a_min, *a_max;
-        if (a != NULL && a->type == ASIdOrRange_range) {
-            if (!extract_min_max(a, &a_min, &a_max)
-                || ASN1_INTEGER_cmp(a_min, a_max) > 0)
-                goto done;
+        int w = 0, r;
+
+        for (r = 0; r < sk_ASIdOrRange_num(choice->u.asIdsOrRanges); r++) {
+            ASIdOrRange *v = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, r);
+
+            if (v != NULL) {
+                if (w != r)
+                    (void)sk_ASIdOrRange_set(choice->u.asIdsOrRanges, w, v);
+                w++;
+            }
         }
+        while (sk_ASIdOrRange_num(choice->u.asIdsOrRanges) > w)
+            (void)sk_ASIdOrRange_pop(choice->u.asIdsOrRanges);
     }

-    /* Paranoia */
-    if (!ossl_assert(ASIdentifierChoice_is_canonical(choice)))
-        goto done;
-
-    ret = 1;
+    if (ret) {
+        /* Paranoia */
+        if (!ossl_assert(ASIdentifierChoice_is_canonical(choice)))
+            ret = 0;
+    }

-done:
     ASN1_INTEGER_free(a_max_plus_one);
     BN_free(bn);
     return ret;
@@ -541,20 +602,20 @@ static void *v2i_ASIdentifiers(const struct v3_ext_method *method,
         /*
          * Number, range, or mistake, pick it apart and figure out which.
          */
-        i1 = strspn(val->value, "0123456789");
+        i1 = (int)strspn(val->value, "0123456789");
         if (val->value[i1] == '\0') {
             is_range = 0;
         } else {
             is_range = 1;
-            i2 = i1 + strspn(val->value + i1, " \t");
+            i2 = i1 + (int)strspn(val->value + i1, " \t");
             if (val->value[i2] != '-') {
                 ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_ASNUMBER);
                 X509V3_conf_add_error_name_value(val);
                 goto err;
             }
             i2++;
-            i2 = i2 + strspn(val->value + i2, " \t");
-            i3 = i2 + strspn(val->value + i2, "0123456789");
+            i2 = i2 + (int)strspn(val->value + i2, " \t");
+            i3 = i2 + (int)strspn(val->value + i2, "0123456789");
             if (val->value[i3] != '\0') {
                 ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_ASRANGE);
                 X509V3_conf_add_error_name_value(val);
@@ -717,7 +778,7 @@ int X509v3_asid_subset(ASIdentifiers *a, ASIdentifiers *b)
  * Core code for RFC 3779 3.3 path validation.
  */
 static int asid_validate_path_internal(X509_STORE_CTX *ctx,
-    STACK_OF(X509) *chain,
+    const STACK_OF(X509) *chain,
     ASIdentifiers *ext)
 {
     ASIdOrRanges *child_as = NULL, *child_rdi = NULL;
@@ -856,7 +917,7 @@ int X509v3_asid_validate_path(X509_STORE_CTX *ctx)
  * RFC 3779 3.3 path validation of an extension.
  * Test whether chain covers extension.
  */
-int X509v3_asid_validate_resource_set(STACK_OF(X509) *chain,
+int X509v3_asid_validate_resource_set(const STACK_OF(X509) *chain,
     ASIdentifiers *ext, int allow_inheritance)
 {
     if (ext == NULL)
diff --git a/deps/openssl/openssl/crypto/x509/v3_attrdesc.c b/deps/openssl/openssl/crypto/x509/v3_attrdesc.c
index 997241fac0d..3817b076a16 100644
--- a/deps/openssl/openssl/crypto/x509/v3_attrdesc.c
+++ b/deps/openssl/openssl/crypto/x509/v3_attrdesc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -100,7 +100,11 @@ static int i2r_OSSL_INFO_SYNTAX(X509V3_EXT_METHOD *method,
     case OSSL_INFO_SYNTAX_TYPE_CONTENT:
         if (BIO_printf(out, "%*sContent: ", indent, "") <= 0)
             return 0;
-        if (BIO_printf(out, "%.*s", info->choice.content->length, info->choice.content->data) <= 0)
+        if (BIO_printf(out, "%.*s", info->choice.content->length,
+                info->choice.content->length
+                    ? info->choice.content->data
+                    : (const unsigned char *)"")
+            <= 0)
             return 0;
         if (BIO_puts(out, "\n") <= 0)
             return 0;
@@ -145,18 +149,28 @@ static int i2r_OSSL_ATTRIBUTE_DESCRIPTOR(X509V3_EXT_METHOD *method,
     if (BIO_printf(out, "%*sSyntax:\n", indent, "") <= 0)
         return 0;
     if (BIO_printf(out, "%*s%.*s", indent + 4, "",
-            ad->attributeSyntax->length, ad->attributeSyntax->data)
+            ad->attributeSyntax->length,
+            ad->attributeSyntax->length
+                ? ad->attributeSyntax->data
+                : (const unsigned char *)"")
         <= 0)
         return 0;
     if (BIO_puts(out, "\n\n") <= 0)
         return 0;
     if (ad->name != NULL) {
-        if (BIO_printf(out, "%*sName: %.*s\n", indent, "", ad->name->length, ad->name->data) <= 0)
+        if (BIO_printf(out, "%*sName: %.*s\n", indent, "", ad->name->length,
+                ad->name->length
+                    ? ad->name->data
+                    : (const unsigned char *)"")
+            <= 0)
             return 0;
     }
     if (ad->description != NULL) {
         if (BIO_printf(out, "%*sDescription: %.*s\n", indent, "",
-                ad->description->length, ad->description->data)
+                ad->description->length,
+                ad->description->length
+                    ? ad->description->data
+                    : (const unsigned char *)"")
             <= 0)
             return 0;
     }
diff --git a/deps/openssl/openssl/crypto/x509/v3_authattid.c b/deps/openssl/openssl/crypto/x509/v3_authattid.c
index 829593ed6c8..018ae05449c 100644
--- a/deps/openssl/openssl/crypto/x509/v3_authattid.c
+++ b/deps/openssl/openssl/crypto/x509/v3_authattid.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,6 +14,8 @@
 #include "crypto/asn1.h"
 #include "ext_dat.h"

+#include <crypto/asn1.h>
+
 DECLARE_ASN1_ITEM(OSSL_ISSUER_SERIAL)

 ASN1_ITEM_TEMPLATE(OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX) = ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX, OSSL_ISSUER_SERIAL)
diff --git a/deps/openssl/openssl/crypto/x509/v3_battcons.c b/deps/openssl/openssl/crypto/x509/v3_battcons.c
index 3d030664027..3a9731ee8d5 100644
--- a/deps/openssl/openssl/crypto/x509/v3_battcons.c
+++ b/deps/openssl/openssl/crypto/x509/v3_battcons.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,6 +14,8 @@
 #include "x509_local.h"
 #include "ext_dat.h"

+#include <crypto/asn1.h>
+
 static STACK_OF(CONF_VALUE) *i2v_OSSL_BASIC_ATTR_CONSTRAINTS(
     X509V3_EXT_METHOD *method,
     OSSL_BASIC_ATTR_CONSTRAINTS *battcons,
@@ -59,7 +61,7 @@ static OSSL_BASIC_ATTR_CONSTRAINTS *v2i_OSSL_BASIC_ATTR_CONSTRAINTS(
 {
     OSSL_BASIC_ATTR_CONSTRAINTS *battcons = NULL;
     CONF_VALUE *val;
-    int i;
+    int i, authority_seen = 0;

     if ((battcons = OSSL_BASIC_ATTR_CONSTRAINTS_new()) == NULL) {
         ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
@@ -68,9 +70,20 @@ static OSSL_BASIC_ATTR_CONSTRAINTS *v2i_OSSL_BASIC_ATTR_CONSTRAINTS(
     for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
         val = sk_CONF_VALUE_value(values, i);
         if (strcmp(val->name, "authority") == 0) {
+            if (authority_seen) {
+                ERR_raise_data(ERR_LIB_X509V3, X509V3_R_DUPLICATE_FIELD,
+                    "field=%s", val->name);
+                goto err;
+            }
             if (!X509V3_get_value_bool(val, &battcons->authority))
                 goto err;
+            authority_seen = 1;
         } else if (strcmp(val->name, "pathlen") == 0) {
+            if (battcons->pathlen != NULL) {
+                ERR_raise_data(ERR_LIB_X509V3, X509V3_R_DUPLICATE_FIELD,
+                    "field=%s", val->name);
+                goto err;
+            }
             if (!X509V3_get_value_int(val, &battcons->pathlen))
                 goto err;
         } else {
diff --git a/deps/openssl/openssl/crypto/x509/v3_bcons.c b/deps/openssl/openssl/crypto/x509/v3_bcons.c
index b909966f024..debfc9a3fed 100644
--- a/deps/openssl/openssl/crypto/x509/v3_bcons.c
+++ b/deps/openssl/openssl/crypto/x509/v3_bcons.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -16,6 +16,8 @@
 #include "ext_dat.h"
 #include "x509_local.h"

+#include <crypto/asn1.h>
+
 static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method,
     BASIC_CONSTRAINTS *bcons,
     STACK_OF(CONF_VALUE)
@@ -58,7 +60,7 @@ static BASIC_CONSTRAINTS *v2i_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method,
 {
     BASIC_CONSTRAINTS *bcons = NULL;
     CONF_VALUE *val;
-    int i;
+    int i, ca_seen = 0;

     if ((bcons = BASIC_CONSTRAINTS_new()) == NULL) {
         ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
@@ -67,9 +69,20 @@ static BASIC_CONSTRAINTS *v2i_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method,
     for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
         val = sk_CONF_VALUE_value(values, i);
         if (strcmp(val->name, "CA") == 0) {
+            if (ca_seen) {
+                ERR_raise_data(ERR_LIB_X509V3, X509V3_R_DUPLICATE_FIELD,
+                    "field=%s", val->name);
+                goto err;
+            }
             if (!X509V3_get_value_bool(val, &bcons->ca))
                 goto err;
+            ca_seen = 1;
         } else if (strcmp(val->name, "pathlen") == 0) {
+            if (bcons->pathlen != NULL) {
+                ERR_raise_data(ERR_LIB_X509V3, X509V3_R_DUPLICATE_FIELD,
+                    "field=%s", val->name);
+                goto err;
+            }
             if (!X509V3_get_value_int(val, &bcons->pathlen))
                 goto err;
         } else {
diff --git a/deps/openssl/openssl/crypto/x509/v3_bitst.c b/deps/openssl/openssl/crypto/x509/v3_bitst.c
index be478127b7d..2befd2994b1 100644
--- a/deps/openssl/openssl/crypto/x509/v3_bitst.c
+++ b/deps/openssl/openssl/crypto/x509/v3_bitst.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -28,6 +28,7 @@ static BIT_STRING_BITNAME ns_cert_type_table[] = {
 static BIT_STRING_BITNAME key_usage_type_table[] = {
     { 0, "Digital Signature", "digitalSignature" },
     { 1, "Non Repudiation", "nonRepudiation" },
+    { 1, "Content Commitment", "contentCommitment" },
     { 2, "Key Encipherment", "keyEncipherment" },
     { 3, "Data Encipherment", "dataEncipherment" },
     { 4, "Key Agreement", "keyAgreement" },
@@ -46,7 +47,17 @@ STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
     STACK_OF(CONF_VALUE) *ret)
 {
     BIT_STRING_BITNAME *bnam;
+    int last_seen_bit = -1;
+
     for (bnam = method->usr_data; bnam->lname; bnam++) {
+        /*
+         * If the bitnumber did not change from the last iteration, this entry
+         * is an alias for the previous bit; treat the first result as
+         * canonical and ignore the rest.
+         */
+        if (last_seen_bit == bnam->bitnum)
+            continue;
+        last_seen_bit = bnam->bitnum;
         if (ASN1_BIT_STRING_get_bit(bits, bnam->bitnum))
             X509V3_add_value(bnam->lname, NULL, &ret);
     }
diff --git a/deps/openssl/openssl/crypto/x509/v3_conf.c b/deps/openssl/openssl/crypto/x509/v3_conf.c
index ba2ecd73733..520453a9131 100644
--- a/deps/openssl/openssl/crypto/x509/v3_conf.c
+++ b/deps/openssl/openssl/crypto/x509/v3_conf.c
@@ -307,7 +307,7 @@ static unsigned char *generic_asn1(const char *value, X509V3_CTX *ctx,
 static void delete_ext(STACK_OF(X509_EXTENSION) *sk, X509_EXTENSION *dext)
 {
     int idx;
-    ASN1_OBJECT *obj;
+    const ASN1_OBJECT *obj;

     obj = X509_EXTENSION_get_object(dext);
     while ((idx = X509v3_get_ext_by_OBJ(sk, obj, -1)) >= 0)
@@ -366,6 +366,10 @@ int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, const char *section,
         }
         X509_EXTENSION_free(ext);
     }
+    if (sk != NULL && sk_X509_EXTENSION_num(*sk) == 0) {
+        sk_X509_EXTENSION_free(*sk);
+        *sk = NULL;
+    }
     return 1;
 }

@@ -377,6 +381,7 @@ int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section,
     X509 *cert)
 {
     STACK_OF(X509_EXTENSION) **sk = NULL;
+
     if (cert != NULL)
         sk = &cert->cert_info.extensions;
     return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
@@ -395,6 +400,40 @@ int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section,
     return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
 }

+static int
+update_req_extensions(X509_REQ *req, int *pnid, STACK_OF(X509_EXTENSION) *exts)
+{
+    unsigned char *ext = NULL;
+    int ret = 0, loc = -1, extlen = 0;
+
+    if (pnid == NULL || *pnid == NID_undef)
+        if ((pnid = X509_REQ_get_extension_nids()) == NULL)
+            return 0;
+    loc = X509at_get_attr_by_NID(req->req_info.attributes, *pnid, -1);
+
+    if (exts != NULL) {
+        extlen = ASN1_item_i2d((const ASN1_VALUE *)exts,
+            &ext, ASN1_ITEM_rptr(X509_EXTENSIONS));
+        if (extlen <= 0)
+            return ret;
+    }
+
+    if (loc != -1) {
+        X509_ATTRIBUTE *att = X509_REQ_delete_attr(req, loc);
+
+        if (att == NULL)
+            goto end;
+        X509_ATTRIBUTE_free(att);
+    }
+    if (sk_X509_EXTENSION_num(exts) > 0)
+        ret = X509_REQ_add1_attr_by_NID(req, *pnid, V_ASN1_SEQUENCE, ext, extlen);
+    else
+        ret = 1;
+end:
+    OPENSSL_free(ext);
+    return ret;
+}
+
 /*
  * Add extensions to certificate request. Just check in case req is NULL.
  * Note that on error new elements may remain added to req if req != NULL.
@@ -403,10 +442,26 @@ int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section,
     X509_REQ *req)
 {
     STACK_OF(X509_EXTENSION) *exts = NULL;
-    int ret = X509V3_EXT_add_nconf_sk(conf, ctx, section, &exts);
+    int ret, *pnid = NULL;
+
+    /*
+     * Load current extensions if any, so we can replace any duplicates, possibly
+     * with nothing in the case of empty AKID/SKID.
+     */
+    if (req != NULL) {
+        for (pnid = X509_REQ_get_extension_nids(); *pnid != NID_undef; pnid++) {
+            exts = ossl_x509_req_get1_extensions_by_nid(req, *pnid);
+            if (sk_X509_EXTENSION_num(exts) > 0)
+                break;
+            sk_X509_EXTENSION_free(exts);
+            exts = NULL;
+        }
+    }

-    if (ret && req != NULL && exts != NULL)
-        ret = X509_REQ_add_extensions(req, exts);
+    ret = X509V3_EXT_add_nconf_sk(conf, ctx, section, &exts);
+    /* Replace original extension list (stack) with updated stack */
+    if (ret && req != NULL)
+        ret = update_req_extensions(req, pnid, exts);
     sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free);
     return ret;
 }
@@ -419,9 +474,7 @@ char *X509V3_get_string(X509V3_CTX *ctx, const char *name, const char *section)
         ERR_raise(ERR_LIB_X509V3, X509V3_R_OPERATION_NOT_DEFINED);
         return NULL;
     }
-    if (ctx->db_meth->get_string)
-        return ctx->db_meth->get_string(ctx->db, name, section);
-    return NULL;
+    return ctx->db_meth->get_string(ctx->db, name, section);
 }

 STACK_OF(CONF_VALUE) *X509V3_get_section(X509V3_CTX *ctx, const char *section)
@@ -430,9 +483,7 @@ STACK_OF(CONF_VALUE) *X509V3_get_section(X509V3_CTX *ctx, const char *section)
         ERR_raise(ERR_LIB_X509V3, X509V3_R_OPERATION_NOT_DEFINED);
         return NULL;
     }
-    if (ctx->db_meth->get_section)
-        return ctx->db_meth->get_section(ctx->db, section);
-    return NULL;
+    return ctx->db_meth->get_section(ctx->db, section);
 }

 void X509V3_string_free(X509V3_CTX *ctx, char *str)
@@ -470,24 +521,20 @@ static X509V3_CONF_METHOD nconf_method = {

 void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf)
 {
-    if (ctx == NULL) {
-        ERR_raise(ERR_LIB_X509V3, ERR_R_PASSED_NULL_PARAMETER);
+    if (ctx == NULL)
         return;
-    }
     ctx->db_meth = &nconf_method;
     ctx->db = conf;
 }

-void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req,
+void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject, X509_REQ *req,
     X509_CRL *crl, int flags)
 {
-    if (ctx == NULL) {
-        ERR_raise(ERR_LIB_X509V3, ERR_R_PASSED_NULL_PARAMETER);
+    if (ctx == NULL)
         return;
-    }
     ctx->flags = flags;
     ctx->issuer_cert = issuer;
-    ctx->subject_cert = subj;
+    ctx->subject_cert = subject;
     ctx->subject_req = req;
     ctx->crl = crl;
     ctx->db_meth = NULL;
diff --git a/deps/openssl/openssl/crypto/x509/v3_cpols.c b/deps/openssl/openssl/crypto/x509/v3_cpols.c
index c5a638e8a39..dd164426a51 100644
--- a/deps/openssl/openssl/crypto/x509/v3_cpols.c
+++ b/deps/openssl/openssl/crypto/x509/v3_cpols.c
@@ -18,6 +18,8 @@
 #include "pcy_local.h"
 #include "ext_dat.h"

+#include <crypto/asn1.h>
+
 /* Certificate policies extension support: this one is a bit complex... */

 static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol,
@@ -166,6 +168,7 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx,
     STACK_OF(CONF_VALUE) *polstrs, int ia5org)
 {
     int i;
+    int policyid_seen = 0;
     CONF_VALUE *cnf;
     POLICYINFO *pol;
     POLICYQUALINFO *qual;
@@ -179,12 +182,18 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx,
         if (strcmp(cnf->name, "policyIdentifier") == 0) {
             ASN1_OBJECT *pobj;

+            if (policyid_seen) {
+                ERR_raise_data(ERR_LIB_X509V3, X509V3_R_DUPLICATE_FIELD,
+                    "field=%s", cnf->name);
+                goto err;
+            }
             if ((pobj = OBJ_txt2obj(cnf->value, 0)) == NULL) {
                 ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER);
                 X509V3_conf_err(cnf);
                 goto err;
             }
             pol->policyid = pobj;
+            policyid_seen = 1;

         } else if (!ossl_v3_name_cmp(cnf->name, "CPS")) {
             if (pol->qualifiers == NULL)
@@ -206,8 +215,7 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx,
                 ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
                 goto err;
             }
-            if (!ASN1_STRING_set(qual->d.cpsuri, cnf->value,
-                    strlen(cnf->value))) {
+            if (!ossl_asn1_string_set1_string(qual->d.cpsuri, cnf->value)) {
                 ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
                 goto err;
             }
@@ -242,7 +250,7 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx,
             goto err;
         }
     }
-    if (pol->policyid == NULL) {
+    if (!policyid_seen) {
         ERR_raise(ERR_LIB_X509V3, X509V3_R_NO_POLICY_IDENTIFIER);
         goto err;
     }
@@ -258,7 +266,7 @@ static int displaytext_get_tag_len(const char *tagstr)
 {
     const char *colon = strchr(tagstr, ':');

-    return (colon == NULL) ? -1 : colon - tagstr;
+    return (colon == NULL) ? -1 : (int)(colon - tagstr);
 }

 static int displaytext_str2tag(const char *tagstr, unsigned int *tag_len)
@@ -315,6 +323,11 @@ static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,

         value = cnf->value;
         if (strcmp(cnf->name, "explicitText") == 0) {
+            if (not->exptext != NULL) {
+                ERR_raise_data(ERR_LIB_X509V3, X509V3_R_DUPLICATE_FIELD,
+                    "field=%s", cnf->name);
+                goto err;
+            }
             tag = displaytext_str2tag(value, &tag_len);
             if ((not->exptext = ASN1_STRING_type_new(tag)) == NULL) {
                 ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
@@ -322,8 +335,8 @@ static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
             }
             if (tag_len != 0)
                 value += tag_len + 1;
-            len = strlen(value);
-            if (!ASN1_STRING_set(not->exptext, value, len)) {
+            len = (int)strlen(value);
+            if (!ossl_asn1_string_set1_data(not->exptext, (uint8_t *)value, len)) {
                 ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
                 goto err;
             }
@@ -342,8 +355,7 @@ static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
                 nref->organization->type = V_ASN1_IA5STRING;
             else
                 nref->organization->type = V_ASN1_VISIBLESTRING;
-            if (!ASN1_STRING_set(nref->organization, cnf->value,
-                    strlen(cnf->value))) {
+            if (!ossl_asn1_string_set1_string(nref->organization, cnf->value)) {
                 ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
                 goto err;
             }
@@ -444,7 +456,9 @@ static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals,
         case NID_id_qt_cps:
             BIO_printf(out, "%*sCPS: %.*s", indent, "",
                 qualinfo->d.cpsuri->length,
-                qualinfo->d.cpsuri->data);
+                qualinfo->d.cpsuri->length
+                    ? qualinfo->d.cpsuri->data
+                    : (const unsigned char *)"");
             break;

         case NID_id_qt_unotice:
@@ -469,7 +483,9 @@ static void print_notice(BIO *out, USERNOTICE *notice, int indent)
         ref = notice->noticeref;
         BIO_printf(out, "%*sOrganization: %.*s\n", indent, "",
             ref->organization->length,
-            ref->organization->data);
+            ref->organization->length
+                ? ref->organization->data
+                : (const unsigned char *)"");
         BIO_printf(out, "%*sNumber%s: ", indent, "",
             sk_ASN1_INTEGER_num(ref->noticenos) > 1 ? "s" : "");
         for (i = 0; i < sk_ASN1_INTEGER_num(ref->noticenos); i++) {
@@ -494,7 +510,9 @@ static void print_notice(BIO *out, USERNOTICE *notice, int indent)
     if (notice->exptext)
         BIO_printf(out, "%*sExplicit Text: %.*s", indent, "",
             notice->exptext->length,
-            notice->exptext->data);
+            notice->exptext->length
+                ? notice->exptext->data
+                : (const unsigned char *)"");
 }

 void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent)
diff --git a/deps/openssl/openssl/crypto/x509/v3_crld.c b/deps/openssl/openssl/crypto/x509/v3_crld.c
index 7ce1036d696..24b1b1dbbb6 100644
--- a/deps/openssl/openssl/crypto/x509/v3_crld.c
+++ b/deps/openssl/openssl/crypto/x509/v3_crld.c
@@ -226,6 +226,11 @@ static DIST_POINT *crldp_from_section(X509V3_CTX *ctx,
             if (!set_reasons(&point->reasons, cnf->value))
                 goto err;
         } else if (strcmp(cnf->name, "CRLissuer") == 0) {
+            if (point->CRLissuer != NULL) {
+                ERR_raise_data(ERR_LIB_X509V3, X509V3_R_DUPLICATE_FIELD,
+                    "field=%s", cnf->name);
+                goto err;
+            }
             point->CRLissuer = gnames_from_sectname(ctx, cnf->value);
             if (point->CRLissuer == NULL)
                 goto err;
diff --git a/deps/openssl/openssl/crypto/x509/v3_genn.c b/deps/openssl/openssl/crypto/x509/v3_genn.c
index d63168a77a5..db42d5a4158 100644
--- a/deps/openssl/openssl/crypto/x509/v3_genn.c
+++ b/deps/openssl/openssl/crypto/x509/v3_genn.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -49,13 +49,7 @@ ASN1_ITEM_TEMPLATE(GENERAL_NAMES) = ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF,
 ASN1_ITEM_TEMPLATE_END(GENERAL_NAMES)

 IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAMES)
-
-GENERAL_NAME *GENERAL_NAME_dup(const GENERAL_NAME *a)
-{
-    return (GENERAL_NAME *)ASN1_dup((i2d_of_void *)i2d_GENERAL_NAME,
-        (d2i_of_void *)d2i_GENERAL_NAME,
-        (char *)a);
-}
+IMPLEMENT_ASN1_DUP_FUNCTION(GENERAL_NAME)

 int GENERAL_NAME_set1_X509_NAME(GENERAL_NAME **tgt, const X509_NAME *src)
 {
diff --git a/deps/openssl/openssl/crypto/x509/v3_ia5.c b/deps/openssl/openssl/crypto/x509/v3_ia5.c
index 8a438f816ce..35cc81a2ea2 100644
--- a/deps/openssl/openssl/crypto/x509/v3_ia5.c
+++ b/deps/openssl/openssl/crypto/x509/v3_ia5.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,6 +14,8 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"

+#include <crypto/asn1.h>
+
 const X509V3_EXT_METHOD ossl_v3_ns_ia5_list[8] = {
     EXT_IA5STRING(NID_netscape_base_url),
     EXT_IA5STRING(NID_netscape_revocation_url),
@@ -50,7 +52,7 @@ ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
         ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
         return NULL;
     }
-    if (!ASN1_STRING_set((ASN1_STRING *)ia5, str, strlen(str))) {
+    if (!ossl_asn1_string_set1_string((ASN1_STRING *)ia5, str)) {
         ASN1_IA5STRING_free(ia5);
         return NULL;
     }
diff --git a/deps/openssl/openssl/crypto/x509/v3_info.c b/deps/openssl/openssl/crypto/x509/v3_info.c
index 35100fdd9dd..b987f84fa2d 100644
--- a/deps/openssl/openssl/crypto/x509/v3_info.c
+++ b/deps/openssl/openssl/crypto/x509/v3_info.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -62,7 +62,8 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(
     STACK_OF(CONF_VALUE) *ret)
 {
     ACCESS_DESCRIPTION *desc;
-    int i, nlen;
+    int i;
+    size_t nlen;
     char objtmp[80], *ntmp;
     CONF_VALUE *vtmp;
     STACK_OF(CONF_VALUE) *tret = ret;
@@ -83,7 +84,7 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(
         ntmp = OPENSSL_malloc(nlen);
         if (ntmp == NULL)
             goto err;
-        BIO_snprintf(ntmp, nlen, "%s - %s", objtmp, vtmp->name);
+        snprintf(ntmp, nlen, "%s - %s", objtmp, vtmp->name);
         OPENSSL_free(vtmp->name);
         vtmp->name = ntmp;
     }
diff --git a/deps/openssl/openssl/crypto/x509/v3_ist.c b/deps/openssl/openssl/crypto/x509/v3_ist.c
index bac6dc34f98..aaaa91aacb8 100644
--- a/deps/openssl/openssl/crypto/x509/v3_ist.c
+++ b/deps/openssl/openssl/crypto/x509/v3_ist.c
@@ -15,6 +15,8 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"

+#include <crypto/asn1.h>
+
 /*
  * Issuer Sign Tool (1.2.643.100.112) The name of the tool used to signs the subject (ASN1_SEQUENCE)
  * This extension is required to obtain the status of a qualified certificate at Russian Federation.
@@ -50,28 +52,28 @@ static ISSUER_SIGN_TOOL *v2i_issuer_sign_tool(X509V3_EXT_METHOD *method, X509V3_
         if (strcmp(cnf->name, "signTool") == 0) {
             if (ist->signTool == NULL
                 || cnf->value == NULL
-                || !ASN1_STRING_set(ist->signTool, cnf->value, strlen(cnf->value))) {
+                || !ossl_asn1_string_set1_string(ist->signTool, cnf->value)) {
                 ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
                 goto err;
             }
         } else if (strcmp(cnf->name, "cATool") == 0) {
             if (ist->cATool == NULL
                 || cnf->value == NULL
-                || !ASN1_STRING_set(ist->cATool, cnf->value, strlen(cnf->value))) {
+                || !ossl_asn1_string_set1_string(ist->cATool, cnf->value)) {
                 ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
                 goto err;
             }
         } else if (strcmp(cnf->name, "signToolCert") == 0) {
             if (ist->signToolCert == NULL
                 || cnf->value == NULL
-                || !ASN1_STRING_set(ist->signToolCert, cnf->value, strlen(cnf->value))) {
+                || !ossl_asn1_string_set1_string(ist->signToolCert, cnf->value)) {
                 ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
                 goto err;
             }
         } else if (strcmp(cnf->name, "cAToolCert") == 0) {
             if (ist->cAToolCert == NULL
                 || cnf->value == NULL
-                || !ASN1_STRING_set(ist->cAToolCert, cnf->value, strlen(cnf->value))) {
+                || !ossl_asn1_string_set1_string(ist->cAToolCert, cnf->value)) {
                 ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
                 goto err;
             }
diff --git a/deps/openssl/openssl/crypto/x509/v3_lib.c b/deps/openssl/openssl/crypto/x509/v3_lib.c
index fe6c235c5d1..a4b46d09248 100644
--- a/deps/openssl/openssl/crypto/x509/v3_lib.c
+++ b/deps/openssl/openssl/crypto/x509/v3_lib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,6 +15,7 @@
 #include <openssl/x509v3.h>

 #include "ext_dat.h"
+#include "x509_local.h"

 static STACK_OF(X509V3_EXT_METHOD) *ext_list = NULL;

@@ -70,7 +71,7 @@ const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid)
     return sk_X509V3_EXT_METHOD_value(ext_list, idx);
 }

-const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext)
+const X509V3_EXT_METHOD *X509V3_EXT_get(const X509_EXTENSION *ext)
 {
     int nid;
     if ((nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext))) == NID_undef)
@@ -129,23 +130,57 @@ int X509V3_add_standard_extensions(void)
     return 1;
 }

+int ossl_ignored_x509_extension(const X509_EXTENSION *ex, int flags)
+{
+    /*
+     * Empty OCTET STRINGs and empty SEQUENCEs encode to just two bytes of tag
+     * (0x04 or 0x30) and length (0x00).  We use this fact to suppress empty
+     * AKID and SKID extensions that may be briefly generated when processing
+     * the "= none" value or only ":nonss"-qualified AKIDs when the subject is
+     * self-signed.
+     *
+     * The resulting extension is empty, and must not be retained, but does
+     * serve to drop any previous value of the same extension, when called
+     * via
+     * - X509v3_add_extensions(), or
+     * - either of X509V3_add1_i2d() or X509V3_EXT_add_nconf_sk(),
+     *   with a flags (or ctx->flags) value that allows replacement.
+     */
+    if (ex->value.length == 2
+        && (ex->value.data[0] == 0x30 || ex->value.data[0] == 0x04)) {
+        ASN1_OBJECT *obj = ex->object;
+        ASN1_OBJECT *skid = OBJ_nid2obj(NID_subject_key_identifier);
+        ASN1_OBJECT *akid = OBJ_nid2obj(NID_authority_key_identifier);
+
+        if (OBJ_cmp(obj, skid) == 0 || OBJ_cmp(obj, akid) == 0) {
+            if ((flags & X509V3_ADD_SILENT) == 0)
+                ERR_raise_data(ERR_LIB_X509, X509_R_INVALID_EXTENSION,
+                    "Invalid empty X.509 %s extension", obj->sn);
+            return 1;
+        }
+    }
+    return 0;
+}
+
 /* Return an extension internal structure */

-void *X509V3_EXT_d2i(X509_EXTENSION *ext)
+void *X509V3_EXT_d2i(const X509_EXTENSION *ext)
 {
     const X509V3_EXT_METHOD *method;
     const unsigned char *p;
-    ASN1_STRING *extvalue;
-    int extlen;
+    const ASN1_STRING *extvalue;
+    size_t extlen;

     if ((method = X509V3_EXT_get(ext)) == NULL)
         return NULL;
     extvalue = X509_EXTENSION_get_data(ext);
     p = ASN1_STRING_get0_data(extvalue);
-    extlen = ASN1_STRING_length(extvalue);
+    extlen = ASN1_STRING_get_length(extvalue);
+    if (extlen > INT_MAX)
+        return NULL;
     if (method->it)
-        return ASN1_item_d2i(NULL, &p, extlen, ASN1_ITEM_ptr(method->it));
-    return method->d2i(NULL, &p, extlen);
+        return ASN1_item_d2i(NULL, &p, (int)extlen, ASN1_ITEM_ptr(method->it));
+    return method->d2i(NULL, &p, (int)extlen);
 }

 /*-
@@ -278,9 +313,13 @@ int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value,
     /* If extension exists replace it.. */
     if (extidx >= 0) {
         extmp = sk_X509_EXTENSION_value(*x, extidx);
-        X509_EXTENSION_free(extmp);
-        if (!sk_X509_EXTENSION_set(*x, extidx, ext))
+        if (ossl_ignored_x509_extension(ext, X509V3_ADD_SILENT)) {
+            if (!sk_X509_EXTENSION_delete(*x, extidx))
+                return -1;
+        } else if (!sk_X509_EXTENSION_set(*x, extidx, ext)) {
             return -1;
+        }
+        X509_EXTENSION_free(extmp);
         return 1;
     }

diff --git a/deps/openssl/openssl/crypto/x509/v3_ncons.c b/deps/openssl/openssl/crypto/x509/v3_ncons.c
index a0b97bb7081..5f2710e9f50 100644
--- a/deps/openssl/openssl/crypto/x509/v3_ncons.c
+++ b/deps/openssl/openssl/crypto/x509/v3_ncons.c
@@ -277,10 +277,10 @@ static int add_lengths(int *out, int a, int b)
  *  X509_V_ERR_UNSUPPORTED_NAME_SYNTAX: bad or unsupported syntax of name
  */

-int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc)
+int NAME_CONSTRAINTS_check(const X509 *x, NAME_CONSTRAINTS *nc)
 {
     int r, i, name_count, constraint_count;
-    X509_NAME *nm;
+    const X509_NAME *nm;

     nm = X509_get_subject_name(x);

@@ -299,7 +299,8 @@ int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc)
     if (X509_NAME_entry_count(nm) > 0) {
         GENERAL_NAME gntmp;
         gntmp.type = GEN_DIRNAME;
-        gntmp.d.directoryName = nm;
+        /* XXX casts away const (but does not mutate) */
+        gntmp.d.directoryName = (X509_NAME *)nm;

         r = nc_match(&gntmp, nc);

@@ -317,7 +318,8 @@ int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc)
             if (i == -1)
                 break;
             ne = X509_NAME_get_entry(nm, i);
-            gntmp.d.rfc822Name = X509_NAME_ENTRY_get_data(ne);
+            /* XXX casts away const (but does not mutate) */
+            gntmp.d.rfc822Name = (ASN1_STRING *)X509_NAME_ENTRY_get_data(ne);
             if (gntmp.d.rfc822Name->type != V_ASN1_IA5STRING)
                 return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX;

@@ -338,7 +340,7 @@ int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc)
     return X509_V_OK;
 }

-static int cn2dnsid(ASN1_STRING *cn, unsigned char **dnsid, size_t *idlen)
+static int cn2dnsid(const ASN1_STRING *cn, unsigned char **dnsid, size_t *idlen)
 {
     int utf8_length;
     unsigned char *utf8_value;
@@ -434,7 +436,7 @@ static int cn2dnsid(ASN1_STRING *cn, unsigned char **dnsid, size_t *idlen)
 /*
  * Check CN against DNS-ID name constraints.
  */
-int NAME_CONSTRAINTS_check_CN(X509 *x, NAME_CONSTRAINTS *nc)
+int NAME_CONSTRAINTS_check_CN(const X509 *x, NAME_CONSTRAINTS *nc)
 {
     int r, i;
     const X509_NAME *nm = X509_get_subject_name(x);
@@ -449,8 +451,8 @@ int NAME_CONSTRAINTS_check_CN(X509 *x, NAME_CONSTRAINTS *nc)
     /* Process any commonName attributes in subject name */

     for (i = -1;;) {
-        X509_NAME_ENTRY *ne;
-        ASN1_STRING *cn;
+        const X509_NAME_ENTRY *ne;
+        const ASN1_STRING *cn;
         unsigned char *idval;
         size_t idlen;

@@ -466,7 +468,7 @@ int NAME_CONSTRAINTS_check_CN(X509 *x, NAME_CONSTRAINTS *nc)
         if (idlen == 0)
             continue;

-        stmp.length = idlen;
+        stmp.length = (int)idlen;
         stmp.data = idval;
         r = nc_match(&gntmp, nc);
         OPENSSL_free(idval);
@@ -805,7 +807,7 @@ static int nc_uri(ASN1_IA5STRING *uri, ASN1_IA5STRING *base)
     OPENSSL_free(scheme);
     OPENSSL_free(uri_copy);

-    hostlen = strlen(host);
+    hostlen = (int)strlen(host);

     /* Special case: initial '.' is RHS match */
     if (base->length > 0 && *baseptr == '.') {
diff --git a/deps/openssl/openssl/crypto/x509/v3_pci.c b/deps/openssl/openssl/crypto/x509/v3_pci.c
index 8adbd841350..ce56e4c6a12 100644
--- a/deps/openssl/openssl/crypto/x509/v3_pci.c
+++ b/deps/openssl/openssl/crypto/x509/v3_pci.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -49,6 +49,8 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"

+#include <crypto/asn1.h>
+
 static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext,
     BIO *out, int indent);
 static PROXY_CERT_INFO_EXTENSION *r2i_pci(X509V3_EXT_METHOD *method,
@@ -164,6 +166,13 @@ static int process_pci_value(CONF_VALUE *val,
         } else if (CHECK_AND_SKIP_PREFIX(valp, "file:")) {
             unsigned char buf[2048];
             int n;
+
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+            /*
+             * Prevent fuzzer from mutating input to reading random files.
+             */
+            valp = NULL;
+#endif
             BIO *b = BIO_new_file(valp, "r");
             if (!b) {
                 ERR_raise(ERR_LIB_X509V3, ERR_R_BIO_LIB);
@@ -200,7 +209,7 @@ static int process_pci_value(CONF_VALUE *val,
                 goto err;
             }
         } else if (CHECK_AND_SKIP_PREFIX(valp, "text:")) {
-            val_len = strlen(valp);
+            val_len = (int)strlen(valp);
             tmp_data = OPENSSL_realloc((*policy)->data,
                 (*policy)->length + val_len + 1);
             if (tmp_data) {
diff --git a/deps/openssl/openssl/crypto/x509/v3_pcons.c b/deps/openssl/openssl/crypto/x509/v3_pcons.c
index e8c3d242d9a..c67ade1eb19 100644
--- a/deps/openssl/openssl/crypto/x509/v3_pcons.c
+++ b/deps/openssl/openssl/crypto/x509/v3_pcons.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2003-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -67,9 +67,19 @@ static void *v2i_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD *method,
     for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
         val = sk_CONF_VALUE_value(values, i);
         if (strcmp(val->name, "requireExplicitPolicy") == 0) {
+            if (pcons->requireExplicitPolicy != NULL) {
+                ERR_raise_data(ERR_LIB_X509V3, X509V3_R_DUPLICATE_FIELD,
+                    "field=%s", val->name);
+                goto err;
+            }
             if (!X509V3_get_value_int(val, &pcons->requireExplicitPolicy))
                 goto err;
         } else if (strcmp(val->name, "inhibitPolicyMapping") == 0) {
+            if (pcons->inhibitPolicyMapping != NULL) {
+                ERR_raise_data(ERR_LIB_X509V3, X509V3_R_DUPLICATE_FIELD,
+                    "field=%s", val->name);
+                goto err;
+            }
             if (!X509V3_get_value_int(val, &pcons->inhibitPolicyMapping))
                 goto err;
         } else {
diff --git a/deps/openssl/openssl/crypto/x509/v3_prn.c b/deps/openssl/openssl/crypto/x509/v3_prn.c
index 1992344d85b..e8901831345 100644
--- a/deps/openssl/openssl/crypto/x509/v3_prn.c
+++ b/deps/openssl/openssl/crypto/x509/v3_prn.c
@@ -66,31 +66,33 @@ void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,

 /* Main routine: print out a general extension */

-int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag,
+int X509V3_EXT_print(BIO *out, const X509_EXTENSION *ext, unsigned long flag,
     int indent)
 {
     void *ext_str = NULL;
     char *value = NULL;
-    ASN1_OCTET_STRING *extoct;
+    const ASN1_OCTET_STRING *extoct;
     const unsigned char *p;
-    int extlen;
+    size_t extlen;
     const X509V3_EXT_METHOD *method;
     STACK_OF(CONF_VALUE) *nval = NULL;
     int ok = 1;

     extoct = X509_EXTENSION_get_data(ext);
     p = ASN1_STRING_get0_data(extoct);
-    extlen = ASN1_STRING_length(extoct);
+    extlen = ASN1_STRING_get_length(extoct);
+    if (extlen > INT_MAX)
+        return 0;

     if ((method = X509V3_EXT_get(ext)) == NULL)
-        return unknown_ext_print(out, p, extlen, flag, indent, 0);
+        return unknown_ext_print(out, p, (int)extlen, flag, indent, 0);
     if (method->it)
-        ext_str = ASN1_item_d2i(NULL, &p, extlen, ASN1_ITEM_ptr(method->it));
+        ext_str = ASN1_item_d2i(NULL, &p, (int)extlen, ASN1_ITEM_ptr(method->it));
     else
-        ext_str = method->d2i(NULL, &p, extlen);
+        ext_str = method->d2i(NULL, &p, (int)extlen);

     if (!ext_str)
-        return unknown_ext_print(out, p, extlen, flag, indent, 1);
+        return unknown_ext_print(out, p, (int)extlen, flag, indent, 1);

     if (method->i2s) {
         if ((value = method->i2s(method, ext_str)) == NULL) {
@@ -150,8 +152,8 @@ int X509V3_extensions_print(BIO *bp, const char *title,
     }

     for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) {
-        ASN1_OBJECT *obj;
-        X509_EXTENSION *ex;
+        const ASN1_OBJECT *obj;
+        const X509_EXTENSION *ex;

         ex = sk_X509_EXTENSION_value(exts, i);
         obj = X509_EXTENSION_get_object(ex);
@@ -201,7 +203,7 @@ static int unknown_ext_print(BIO *out, const unsigned char *ext, int extlen,
 }

 #ifndef OPENSSL_NO_STDIO
-int X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent)
+int X509V3_EXT_print_fp(FILE *fp, const X509_EXTENSION *ext, int flag, int indent)
 {
     BIO *bio_tmp;
     int ret;
diff --git a/deps/openssl/openssl/crypto/x509/v3_purp.c b/deps/openssl/openssl/crypto/x509/v3_purp.c
index 29b55903847..fc696c368c1 100644
--- a/deps/openssl/openssl/crypto/x509/v3_purp.c
+++ b/deps/openssl/openssl/crypto/x509/v3_purp.c
@@ -15,6 +15,9 @@
 #include "crypto/x509.h"
 #include "internal/tsan_assist.h"
 #include "x509_local.h"
+#include "crypto/objects/obj_dat.h"
+#include "crypto/siphash.h"
+#include <openssl/rand.h>

 static int check_ssl_ca(const X509 *x);
 static int check_purpose_ssl_client(const X509_PURPOSE *xp, const X509 *x,
@@ -38,6 +41,7 @@ static int no_check_purpose(const X509_PURPOSE *xp, const X509 *x,
     int non_leaf);
 static int check_purpose_ocsp_helper(const X509_PURPOSE *xp, const X509 *x,
     int non_leaf);
+static int check_name_constraints(const NAME_CONSTRAINTS *nc);

 static int xp_cmp(const X509_PURPOSE *const *a, const X509_PURPOSE *const *b);
 static void xptable_free(X509_PURPOSE *p);
@@ -79,18 +83,16 @@ static int xp_cmp(const X509_PURPOSE *const *a, const X509_PURPOSE *const *b)
     return (*a)->purpose - (*b)->purpose;
 }

-/*
- * As much as I'd like to make X509_check_purpose use a "const" X509* I really
- * can't because it does recalculate hashes and do other non-const things.
- * If id == -1 it just calls x509v3_cache_extensions() for its side-effect.
- * Returns 1 on success, 0 if x does not allow purpose, -1 on (internal) error.
- */
-int X509_check_purpose(X509 *x, int id, int non_leaf)
+int X509_check_purpose(const X509 *x, int id, int non_leaf)
 {
     int idx;
     const X509_PURPOSE *pt;

-    if (!ossl_x509v3_cache_extensions(x))
+    /*
+     * TODO: This cast can be dropped when https://github.com/openssl/openssl/pull/30067
+     * gets merged
+     */
+    if (!ossl_x509v3_cache_extensions((X509 *)x))
         return -1;
     if (id == -1)
         return 1;
@@ -306,7 +308,7 @@ static int nid_cmp(const int *a, const int *b)
 DECLARE_OBJ_BSEARCH_CMP_FN(int, int, nid);
 IMPLEMENT_OBJ_BSEARCH_CMP_FN(int, int, nid);

-int X509_supported_extension(X509_EXTENSION *ex)
+int X509_supported_extension(const X509_EXTENSION *ex)
 {
     /*
      * This table is a list of the NIDs of supported extensions: that is
@@ -346,6 +348,8 @@ int X509_supported_extension(X509_EXTENSION *ex)
 }

 /*
+ * Returns 1 on success, 0 if x is invalid.
+ *
  * The full name of a nameRelativeToCRLIssuer distribution point is not
  * computed here.  Doing so for every parsed certificate cost an
  * X509_NAME_dup() of the issuer name per relative distribution point,
@@ -372,17 +376,17 @@ static int setup_dp(DIST_POINT *dp)
     return 1;
 }

-/* Return 1 on success, 0 on error. */
-static int setup_crldp(X509 *x)
+/* Return 1 on success, 0 if x is invalid. */
+static int setup_crldp(const X509 *x, STACK_OF(DIST_POINT) **tmp_crldp)
 {
     int i;

-    x->crldp = X509_get_ext_d2i(x, NID_crl_distribution_points, &i, NULL);
-    if (x->crldp == NULL && i != -1)
+    *tmp_crldp = X509_get_ext_d2i(x, NID_crl_distribution_points, &i, NULL);
+    if (*tmp_crldp == NULL && i != -1)
         return 0;

-    for (i = 0; i < sk_DIST_POINT_num(x->crldp); i++) {
-        if (!setup_dp(sk_DIST_POINT_value(x->crldp, i)))
+    for (i = 0; i < sk_DIST_POINT_num(*tmp_crldp); i++) {
+        if (!setup_dp(sk_DIST_POINT_value(*tmp_crldp, i)))
             return 0;
     }
     return 1;
@@ -405,6 +409,143 @@ static int check_sig_alg_match(const EVP_PKEY *issuer_key, const X509 *subject)
     return X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH;
 }

+/*
+ * Per-scan SipHash keying for the duplicate-extension fall-back table.
+ *
+ * Standard extensions have an assigned NID and are deduplicated with the O(1)
+ * bitset in scan_ext_flags(). Only unknown or dynamically registered OIDs,
+ * whose bytes are fully attacker-controlled on an untrusted certificate, reach
+ * the hash table. An unkeyed hash would let an attacker precompute colliding
+ * OIDs and drive the table into O(n^2) chain walks (hash flooding). Hash the
+ * OID with SipHash under a random key drawn once per scan, mirroring the
+ * defense in ssl/quic/quic_lcidm.c.
+ */
+typedef struct {
+    const ASN1_OBJECT *obj;
+    const uint64_t *key; /* 128-bit SipHash key owned by scan_ext_flags */
+} oid_hte;
+
+static unsigned long oid_hash(const void *p)
+{
+    const oid_hte *e = (const oid_hte *)p;
+    SIPHASH sip = { 0 };
+    unsigned char digest[SIPHASH_MIN_DIGEST_SIZE];
+    unsigned long v = 0;
+
+    if (!SipHash_set_hash_size(&sip, SIPHASH_MIN_DIGEST_SIZE))
+        return 0;
+    if (!SipHash_Init(&sip, (const unsigned char *)e->key, 0, 0))
+        return 0;
+    SipHash_Update(&sip, (const unsigned char *)e->obj->data, e->obj->length);
+
+    if (!SipHash_Final(&sip, digest, sizeof(digest)))
+        return 0;
+    memcpy(&v, digest, sizeof(v) < sizeof(digest) ? sizeof(v) : sizeof(digest));
+    return v;
+}
+
+static int oid_cmp(const void *a, const void *b)
+{
+    return OBJ_cmp(((const oid_hte *)a)->obj, ((const oid_hte *)b)->obj);
+}
+
+/*
+ * Scan all extensions of a certificate to collect extension-related flags.
+ * Detects duplicate extensions (RFC 5280 section 4.2), the presence of a
+ * freshest CRL extension and unsupported critical extensions.
+ *
+ * In the future, if needed, this scanning function could return the index
+ * of the offending extension on error, allowing the caller to identify which
+ * extension caused the problem and report it via ERR_raise_data().
+ */
+static void scan_ext_flags(const X509 *x509, uint32_t *flags)
+{
+    OPENSSL_LHASH *h = NULL;
+    oid_hte *arr = NULL;
+    size_t num_entries = 0;
+    uint64_t k[2]; /* random SipHash key for the fall-back table */
+    uint8_t ex_bitset[(NUM_NID + 7) / 8];
+    int count = X509_get_ext_count(x509);
+
+    memset(ex_bitset, 0, sizeof(ex_bitset));
+    /* A certificate MUST NOT include more than one instance of an extension. */
+    for (int i = 0; i < count; i++) {
+        const X509_EXTENSION *ex = X509_get_ext(x509, i);
+        const ASN1_OBJECT *a = X509_EXTENSION_get_object(ex);
+        int nid = OBJ_obj2nid(a);
+
+        /*
+         * Known NIDs within the build-time bitset limit are checked for
+         * duplicates in constant time. Unknown OIDs and dynamically registered
+         * NIDs that exceed the limit fall back to duplicate detection via a
+         * hash table.
+         */
+        if (nid > NID_undef && nid < NUM_NID) {
+            unsigned int ex_bit = nid;
+
+            if ((ex_bitset[ex_bit >> 3] & (1u << (ex_bit & 7))) != 0) {
+                *flags |= EXFLAG_DUPLICATE;
+                break;
+            }
+            ex_bitset[ex_bit >> 3] |= (1u << (ex_bit & 7));
+        } else {
+            /*
+             * Extensions with unknown NID (NID_undef) and dynamically
+             * registered NIDs are handled here by hashing the OID (data/length).
+             * A zero-length OID should not reach this point, but we check for
+             * it anyway and assign the EXFLAG_INVALID flag if it does.
+             */
+            if (a->length < 1) {
+                *flags |= EXFLAG_INVALID;
+                break;
+            }
+            /*
+             * Create the table and draw a fresh random SipHash key the first
+             * time an attacker-controlled OID is seen, so unkeyed hashing
+             * cannot be used to force O(n^2) collisions (hash flooding).
+             *
+             * The key and the entry wrappers remain valid for the duration of
+             * the scan; the table never outlives this function.
+             *
+             * If the table cannot be set up or an insert fails, fail closed
+             * with EXFLAG_INVALID, as ossl_x509v3_cache_extensions() does for
+             * any other extension it cannot process. Leaving the loop
+             * silently would skip not only the duplicate check but also the
+             * unsupported-critical check for this and every later extension.
+             */
+            if (h == NULL) {
+                if (RAND_bytes_ex(x509->libctx, (unsigned char *)k, sizeof(k), 0) <= 0
+                    || (arr = OPENSSL_malloc_array(count, sizeof(*arr))) == NULL
+                    || (h = OPENSSL_LH_new(oid_hash, oid_cmp)) == NULL) {
+                    *flags |= EXFLAG_INVALID;
+                    break;
+                }
+            }
+            arr[num_entries].obj = a;
+            arr[num_entries].key = k;
+            if (OPENSSL_LH_insert(h, &arr[num_entries]) != NULL) {
+                *flags |= EXFLAG_DUPLICATE;
+                break;
+            }
+            if (OPENSSL_LH_error(h) != 0) {
+                *flags |= EXFLAG_INVALID;
+                break;
+            }
+            num_entries++;
+        }
+        if (nid == NID_freshest_crl)
+            *flags |= EXFLAG_FRESHEST;
+        if (!X509_EXTENSION_get_critical(ex))
+            continue;
+        if (!X509_supported_extension(ex)) {
+            *flags |= EXFLAG_CRITICAL;
+            break;
+        }
+    }
+    OPENSSL_LH_free(h);
+    OPENSSL_free(arr);
+}
+
 #define V1_ROOT (EXFLAG_V1 | EXFLAG_SS)
 #define ku_reject(x, usage) \
     (((x)->ex_flags & EXFLAG_KUSAGE) != 0 && ((x)->ex_kusage & (usage)) == 0)
@@ -419,8 +560,13 @@ static int check_sig_alg_match(const EVP_PKEY *issuer_key, const X509 *subject)
  * x->sha1_hash is filled in, or else EXFLAG_NO_FINGERPRINT is set in x->flags.
  * X509_SIG_INFO_VALID is set in x->flags if x->siginf was filled successfully.
  * Set EXFLAG_INVALID and return 0 in case the certificate is invalid.
+ *
+ * This is usually called by side-effect on objects, and forces us to keep
+ * mutable X509 objects around. We should really make this go away.
+ * In the interest of being able to do so, this function explicitly takes
+ * a const argument and casts away const.
  */
-int ossl_x509v3_cache_extensions(X509 *x)
+int ossl_x509v3_cache_extensions(const X509 *const_x)
 {
     BASIC_CONSTRAINTS *bs;
     PROXY_CERT_INFO_EXTENSION *pci;
@@ -429,35 +575,61 @@ int ossl_x509v3_cache_extensions(X509 *x)
     EXTENDED_KEY_USAGE *extusage;
     int i;
     int res;
+    uint32_t tmp_ex_flags;
+    unsigned char tmp_sha1_hash[SHA_DIGEST_LENGTH];
+    long tmp_ex_pathlen;
+    long tmp_ex_pcpathlen;
+    uint32_t tmp_ex_kusage;
+    uint32_t tmp_ex_xkusage;
+    uint32_t tmp_ex_nscert;
+    ASN1_OCTET_STRING *tmp_skid = NULL;
+    AUTHORITY_KEYID *tmp_akid = NULL;
+    STACK_OF(GENERAL_NAME) *tmp_altname = NULL;
+    NAME_CONSTRAINTS *tmp_nc = NULL;
+    STACK_OF(DIST_POINT) *tmp_crldp = NULL;
+    X509_SIG_INFO tmp_siginf;
+#ifndef OPENSSL_NO_RFC3779
+    STACK_OF(IPAddressFamily) *tmp_rfc3779_addr = NULL;
+    struct ASIdentifiers_st *tmp_rfc3779_asid = NULL;
+#endif
+    int ret = 0;

 #ifdef tsan_ld_acq
     /* Fast lock-free check, see end of the function for details. */
-    if (tsan_ld_acq((TSAN_QUALIFIER int *)&x->ex_cached))
-        return (x->ex_flags & EXFLAG_INVALID) == 0;
+    if (tsan_ld_acq((TSAN_QUALIFIER int *)&const_x->ex_cached)) {
+        ret = (const_x->ex_flags & EXFLAG_INVALID) == 0;
+        goto done;
+    }
 #endif

-    if (!CRYPTO_THREAD_write_lock(x->lock))
-        return 0;
-    if ((x->ex_flags & EXFLAG_SET) != 0) { /* Cert has already been processed */
-        CRYPTO_THREAD_unlock(x->lock);
-        return (x->ex_flags & EXFLAG_INVALID) == 0;
+    if (!CRYPTO_THREAD_read_lock(const_x->lock))
+        goto done;
+    tmp_ex_flags = const_x->ex_flags;
+    tmp_ex_pcpathlen = const_x->ex_pcpathlen;
+    tmp_ex_kusage = const_x->ex_kusage;
+    tmp_ex_nscert = const_x->ex_nscert;
+
+    if ((tmp_ex_flags & EXFLAG_SET) != 0) { /* Cert has already been processed */
+        CRYPTO_THREAD_unlock(const_x->lock);
+        ret = (tmp_ex_flags & EXFLAG_INVALID) == 0;
+        goto done;
     }

     ERR_set_mark();

     /* Cache the SHA1 digest of the cert */
-    if (!X509_digest(x, EVP_sha1(), x->sha1_hash, NULL))
-        x->ex_flags |= EXFLAG_NO_FINGERPRINT;
+    if (!X509_digest(const_x, EVP_sha1(), tmp_sha1_hash, NULL))
+        tmp_ex_flags |= EXFLAG_NO_FINGERPRINT;

     /* V1 should mean no extensions ... */
-    if (X509_get_version(x) == X509_VERSION_1)
-        x->ex_flags |= EXFLAG_V1;
+    if (X509_get_version(const_x) == X509_VERSION_1)
+        tmp_ex_flags |= EXFLAG_V1;

     /* Handle basic constraints */
-    x->ex_pathlen = -1;
-    if ((bs = X509_get_ext_d2i(x, NID_basic_constraints, &i, NULL)) != NULL) {
+    tmp_ex_pathlen = -1;
+    if ((bs = X509_get_ext_d2i(const_x, NID_basic_constraints, &i, NULL)) != NULL) {
         if (bs->ca)
-            x->ex_flags |= EXFLAG_CA;
+            tmp_ex_flags |= EXFLAG_CA;
         if (bs->pathlen != NULL) {
             /*
              * The error case !bs->ca is checked by check_chain()
@@ -465,86 +637,86 @@ int ossl_x509v3_cache_extensions(X509 *x)
              */
             if (bs->pathlen->type == V_ASN1_NEG_INTEGER) {
                 ERR_raise(ERR_LIB_X509V3, X509V3_R_NEGATIVE_PATHLEN);
-                x->ex_flags |= EXFLAG_INVALID;
+                tmp_ex_flags |= EXFLAG_INVALID;
             } else {
-                x->ex_pathlen = ASN1_INTEGER_get(bs->pathlen);
+                tmp_ex_pathlen = ASN1_INTEGER_get(bs->pathlen);
             }
         }
         BASIC_CONSTRAINTS_free(bs);
-        x->ex_flags |= EXFLAG_BCONS;
+        tmp_ex_flags |= EXFLAG_BCONS;
     } else if (i != -1) {
-        x->ex_flags |= EXFLAG_INVALID;
+        tmp_ex_flags |= EXFLAG_INVALID;
     }

     /* Handle proxy certificates */
-    if ((pci = X509_get_ext_d2i(x, NID_proxyCertInfo, &i, NULL)) != NULL) {
-        if ((x->ex_flags & EXFLAG_CA) != 0
-            || X509_get_ext_by_NID(x, NID_subject_alt_name, -1) >= 0
-            || X509_get_ext_by_NID(x, NID_issuer_alt_name, -1) >= 0) {
-            x->ex_flags |= EXFLAG_INVALID;
+    if ((pci = X509_get_ext_d2i(const_x, NID_proxyCertInfo, &i, NULL)) != NULL) {
+        if ((tmp_ex_flags & EXFLAG_CA) != 0
+            || X509_get_ext_by_NID(const_x, NID_subject_alt_name, -1) >= 0
+            || X509_get_ext_by_NID(const_x, NID_issuer_alt_name, -1) >= 0) {
+            tmp_ex_flags |= EXFLAG_INVALID;
         }
         if (pci->pcPathLengthConstraint != NULL)
-            x->ex_pcpathlen = ASN1_INTEGER_get(pci->pcPathLengthConstraint);
+            tmp_ex_pcpathlen = ASN1_INTEGER_get(pci->pcPathLengthConstraint);
         else
-            x->ex_pcpathlen = -1;
+            tmp_ex_pcpathlen = -1;
         PROXY_CERT_INFO_EXTENSION_free(pci);
-        x->ex_flags |= EXFLAG_PROXY;
+        tmp_ex_flags |= EXFLAG_PROXY;
     } else if (i != -1) {
-        x->ex_flags |= EXFLAG_INVALID;
+        tmp_ex_flags |= EXFLAG_INVALID;
     }

     /* Handle (basic) key usage */
-    if ((usage = X509_get_ext_d2i(x, NID_key_usage, &i, NULL)) != NULL) {
-        x->ex_kusage = 0;
+    if ((usage = X509_get_ext_d2i(const_x, NID_key_usage, &i, NULL)) != NULL) {
+        tmp_ex_kusage = 0;
         if (usage->length > 0) {
-            x->ex_kusage = usage->data[0];
+            tmp_ex_kusage = usage->data[0];
             if (usage->length > 1)
-                x->ex_kusage |= usage->data[1] << 8;
+                tmp_ex_kusage |= usage->data[1] << 8;
         }
-        x->ex_flags |= EXFLAG_KUSAGE;
+        tmp_ex_flags |= EXFLAG_KUSAGE;
         ASN1_BIT_STRING_free(usage);
         /* Check for empty key usage according to RFC 5280 section 4.2.1.3 */
-        if (x->ex_kusage == 0) {
+        if (tmp_ex_kusage == 0) {
             ERR_raise(ERR_LIB_X509V3, X509V3_R_EMPTY_KEY_USAGE);
-            x->ex_flags |= EXFLAG_INVALID;
+            tmp_ex_flags |= EXFLAG_INVALID;
         }
     } else if (i != -1) {
-        x->ex_flags |= EXFLAG_INVALID;
+        tmp_ex_flags |= EXFLAG_INVALID;
     }

     /* Handle extended key usage */
-    x->ex_xkusage = 0;
-    if ((extusage = X509_get_ext_d2i(x, NID_ext_key_usage, &i, NULL)) != NULL) {
-        x->ex_flags |= EXFLAG_XKUSAGE;
+    tmp_ex_xkusage = 0;
+    if ((extusage = X509_get_ext_d2i(const_x, NID_ext_key_usage, &i, NULL)) != NULL) {
+        tmp_ex_flags |= EXFLAG_XKUSAGE;
         for (i = 0; i < sk_ASN1_OBJECT_num(extusage); i++) {
             switch (OBJ_obj2nid(sk_ASN1_OBJECT_value(extusage, i))) {
             case NID_server_auth:
-                x->ex_xkusage |= XKU_SSL_SERVER;
+                tmp_ex_xkusage |= XKU_SSL_SERVER;
                 break;
             case NID_client_auth:
-                x->ex_xkusage |= XKU_SSL_CLIENT;
+                tmp_ex_xkusage |= XKU_SSL_CLIENT;
                 break;
             case NID_email_protect:
-                x->ex_xkusage |= XKU_SMIME;
+                tmp_ex_xkusage |= XKU_SMIME;
                 break;
             case NID_code_sign:
-                x->ex_xkusage |= XKU_CODE_SIGN;
+                tmp_ex_xkusage |= XKU_CODE_SIGN;
                 break;
             case NID_ms_sgc:
             case NID_ns_sgc:
-                x->ex_xkusage |= XKU_SGC;
+                tmp_ex_xkusage |= XKU_SGC;
                 break;
             case NID_OCSP_sign:
-                x->ex_xkusage |= XKU_OCSP_SIGN;
+                tmp_ex_xkusage |= XKU_OCSP_SIGN;
                 break;
             case NID_time_stamp:
-                x->ex_xkusage |= XKU_TIMESTAMP;
+                tmp_ex_xkusage |= XKU_TIMESTAMP;
                 break;
             case NID_dvcs:
-                x->ex_xkusage |= XKU_DVCS;
+                tmp_ex_xkusage |= XKU_DVCS;
                 break;
             case NID_anyExtendedKeyUsage:
-                x->ex_xkusage |= XKU_ANYEKU;
+                tmp_ex_xkusage |= XKU_ANYEKU;
                 break;
             default:
                 /* Ignore unknown extended key usage */
@@ -553,112 +725,168 @@ int ossl_x509v3_cache_extensions(X509 *x)
         }
         sk_ASN1_OBJECT_pop_free(extusage, ASN1_OBJECT_free);
     } else if (i != -1) {
-        x->ex_flags |= EXFLAG_INVALID;
+        tmp_ex_flags |= EXFLAG_INVALID;
     }

     /* Handle legacy Netscape extension */
-    if ((ns = X509_get_ext_d2i(x, NID_netscape_cert_type, &i, NULL)) != NULL) {
+    if ((ns = X509_get_ext_d2i(const_x, NID_netscape_cert_type, &i, NULL)) != NULL) {
         if (ns->length > 0)
-            x->ex_nscert = ns->data[0];
+            tmp_ex_nscert = ns->data[0];
         else
-            x->ex_nscert = 0;
-        x->ex_flags |= EXFLAG_NSCERT;
+            tmp_ex_nscert = 0;
+        tmp_ex_flags |= EXFLAG_NSCERT;
         ASN1_BIT_STRING_free(ns);
     } else if (i != -1) {
-        x->ex_flags |= EXFLAG_INVALID;
+        tmp_ex_flags |= EXFLAG_INVALID;
     }

     /* Handle subject key identifier and issuer/authority key identifier */
-    x->skid = X509_get_ext_d2i(x, NID_subject_key_identifier, &i, NULL);
-    if (x->skid == NULL && i != -1)
-        x->ex_flags |= EXFLAG_INVALID;
-
-    x->akid = X509_get_ext_d2i(x, NID_authority_key_identifier, &i, NULL);
-    if (x->akid == NULL && i != -1)
-        x->ex_flags |= EXFLAG_INVALID;
-
-    /* Check if subject name matches issuer */
-    if (X509_NAME_cmp(X509_get_subject_name(x), X509_get_issuer_name(x)) == 0) {
-        x->ex_flags |= EXFLAG_SI; /* Cert is self-issued */
-        if (X509_check_akid(x, x->akid) == X509_V_OK /* SKID matches AKID */
-            /* .. and the signature alg matches the PUBKEY alg: */
-            && check_sig_alg_match(X509_get0_pubkey(x), x) == X509_V_OK)
-            x->ex_flags |= EXFLAG_SS; /* indicate self-signed */
-        /* This is very related to ossl_x509_likely_issued(x, x) == X509_V_OK */
+    tmp_skid = X509_get_ext_d2i(const_x, NID_subject_key_identifier, &i, NULL);
+    if (tmp_skid == NULL && i != -1)
+        tmp_ex_flags |= EXFLAG_INVALID;
+
+    tmp_akid = X509_get_ext_d2i(const_x, NID_authority_key_identifier, &i, NULL);
+    if (tmp_akid == NULL && i != -1)
+        tmp_ex_flags |= EXFLAG_INVALID;
+
+    /* Setting EXFLAG_SS is equivalent to ossl_x509_likely_issued(const_x, const_x) == X509_V_OK */
+    if (X509_NAME_cmp(X509_get_subject_name(const_x), X509_get_issuer_name(const_x)) == 0) {
+        tmp_ex_flags |= EXFLAG_SI; /* Certificate is self-issued: subject == issuer */
+        /*
+         * When the SKID is missing, which is rare for self-issued certs,
+         * we could afford doing the (accurate) actual self-signature check, but
+         * decided against it for efficiency reasons and according to RFC 5280,
+         * CA certs MUST have an SKID and non-root certs MUST have an AKID.
+         *
+         * The cached const_x->skid is not populated until the write-lock
+         * publication below, so the keyid comparison is done directly
+         * against tmp_skid.  X509_check_akid() is retained for its serial
+         * number and issuer name checks.
+         */
+        if ((tmp_akid == NULL || tmp_akid->keyid == NULL || tmp_skid == NULL
+                || ASN1_OCTET_STRING_cmp(tmp_akid->keyid, tmp_skid) == 0)
+            && X509_check_akid(const_x, tmp_akid) == X509_V_OK
+            && check_sig_alg_match(X509_get0_pubkey(const_x), const_x) == X509_V_OK) {
+            /*
+             * Assume self-signed if the signature alg matches the pkey alg and
+             * AKID is missing or matches respective fields in the same cert
+             * Not checking if any given key usage extension allows signing.
+             */
+            tmp_ex_flags |= EXFLAG_SS;
+        }
     }

     /* Handle subject alternative names and various other extensions */
-    x->altname = X509_get_ext_d2i(x, NID_subject_alt_name, &i, NULL);
-    if (x->altname == NULL && i != -1)
-        x->ex_flags |= EXFLAG_INVALID;
-    x->nc = X509_get_ext_d2i(x, NID_name_constraints, &i, NULL);
-    if (x->nc == NULL && i != -1)
-        x->ex_flags |= EXFLAG_INVALID;
+    tmp_altname = X509_get_ext_d2i(const_x, NID_subject_alt_name, &i, NULL);
+    if (tmp_altname == NULL && i != -1)
+        tmp_ex_flags |= EXFLAG_INVALID;
+    tmp_nc = X509_get_ext_d2i(const_x, NID_name_constraints, &i, NULL);
+    if (tmp_nc == NULL && i != -1)
+        tmp_ex_flags |= EXFLAG_INVALID;
+    if (!check_name_constraints(tmp_nc))
+        tmp_ex_flags |= EXFLAG_INVALID;

     /* Handle CRL distribution point entries */
-    res = setup_crldp(x);
+    res = setup_crldp(const_x, &tmp_crldp);
     if (res == 0)
-        x->ex_flags |= EXFLAG_INVALID;
+        tmp_ex_flags |= EXFLAG_INVALID;

 #ifndef OPENSSL_NO_RFC3779
-    x->rfc3779_addr = X509_get_ext_d2i(x, NID_sbgp_ipAddrBlock, &i, NULL);
-    if (x->rfc3779_addr == NULL && i != -1)
-        x->ex_flags |= EXFLAG_INVALID;
-    x->rfc3779_asid = X509_get_ext_d2i(x, NID_sbgp_autonomousSysNum, &i, NULL);
-    if (x->rfc3779_asid == NULL && i != -1)
-        x->ex_flags |= EXFLAG_INVALID;
+    tmp_rfc3779_addr = X509_get_ext_d2i(const_x, NID_sbgp_ipAddrBlock, &i, NULL);
+    if (tmp_rfc3779_addr == NULL && i != -1)
+        tmp_ex_flags |= EXFLAG_INVALID;
+
+    tmp_rfc3779_asid = X509_get_ext_d2i(const_x, NID_sbgp_autonomousSysNum, &i, NULL);
+    if (tmp_rfc3779_asid == NULL && i != -1)
+        tmp_ex_flags |= EXFLAG_INVALID;
 #endif
-    for (i = 0; i < X509_get_ext_count(x); i++) {
-        X509_EXTENSION *ex = X509_get_ext(x, i);
-        int nid = OBJ_obj2nid(X509_EXTENSION_get_object(ex));

-        if (nid == NID_freshest_crl)
-            x->ex_flags |= EXFLAG_FRESHEST;
-        if (!X509_EXTENSION_get_critical(ex))
-            continue;
-        if (!X509_supported_extension(ex)) {
-            x->ex_flags |= EXFLAG_CRITICAL;
-            break;
-        }
-        switch (nid) {
-        case NID_basic_constraints:
-            x->ex_flags |= EXFLAG_BCONS_CRITICAL;
-            break;
-        case NID_authority_key_identifier:
-            x->ex_flags |= EXFLAG_AKID_CRITICAL;
-            break;
-        case NID_subject_key_identifier:
-            x->ex_flags |= EXFLAG_SKID_CRITICAL;
-            break;
-        case NID_subject_alt_name:
-            x->ex_flags |= EXFLAG_SAN_CRITICAL;
-            break;
-        default:
-            break;
-        }
-    }
+    scan_ext_flags(const_x, &tmp_ex_flags);

     /* Set x->siginf, ignoring errors due to unsupported algos */
-    (void)ossl_x509_init_sig_info(x);
+    (void)ossl_x509_init_sig_info(const_x, &tmp_siginf);
+
+    tmp_ex_flags |= EXFLAG_SET; /* Indicate that cert has been processed */
+    ERR_pop_to_mark();
+
+    CRYPTO_THREAD_unlock(const_x->lock);
+    /*
+     * Now that we've done all the compute intensive work under read lock
+     * do all the updating under a write lock
+     */
+    if (!CRYPTO_THREAD_write_lock(const_x->lock))
+        goto done;
+
+    /* See if another thread updated this certificate before we got the write lock. */
+    if ((const_x->ex_flags & EXFLAG_SET) != 0) { /* Cert has already been processed */
+        CRYPTO_THREAD_unlock(const_x->lock);
+        ret = (const_x->ex_flags & EXFLAG_INVALID) == 0;
+        goto done;
+    }
+
+    /* Otherwise, we have the lock, set the cached fields in the cert. */
+    ((X509 *)const_x)->ex_flags = tmp_ex_flags;
+    ((X509 *)const_x)->ex_pathlen = tmp_ex_pathlen;
+    ((X509 *)const_x)->ex_pcpathlen = tmp_ex_pcpathlen;
+    if (!(tmp_ex_flags & EXFLAG_NO_FINGERPRINT))
+        memcpy(((X509 *)const_x)->sha1_hash, tmp_sha1_hash, SHA_DIGEST_LENGTH);
+    if (tmp_ex_flags & EXFLAG_KUSAGE)
+        ((X509 *)const_x)->ex_kusage = tmp_ex_kusage;
+    ((X509 *)const_x)->ex_xkusage = tmp_ex_xkusage;
+    if (tmp_ex_flags & EXFLAG_NSCERT)
+        ((X509 *)const_x)->ex_nscert = tmp_ex_nscert;
+    ASN1_OCTET_STRING_free(((X509 *)const_x)->skid);
+    ((X509 *)const_x)->skid = tmp_skid;
+    tmp_skid = NULL;
+    AUTHORITY_KEYID_free(((X509 *)const_x)->akid);
+    ((X509 *)const_x)->akid = tmp_akid;
+    tmp_akid = NULL;
+    sk_GENERAL_NAME_pop_free(((X509 *)const_x)->altname, GENERAL_NAME_free);
+    ((X509 *)const_x)->altname = tmp_altname;
+    tmp_altname = NULL;
+    NAME_CONSTRAINTS_free(((X509 *)const_x)->nc);
+    ((X509 *)const_x)->nc = tmp_nc;
+    tmp_nc = NULL;
+    sk_DIST_POINT_pop_free(((X509 *)const_x)->crldp, DIST_POINT_free);
+    ((X509 *)const_x)->crldp = tmp_crldp;
+    tmp_crldp = NULL;
+#ifndef OPENSSL_NO_RFC3779
+    sk_IPAddressFamily_pop_free(((X509 *)const_x)->rfc3779_addr, IPAddressFamily_free);
+    ((X509 *)const_x)->rfc3779_addr = tmp_rfc3779_addr;
+    tmp_rfc3779_addr = NULL;
+    ASIdentifiers_free(((X509 *)const_x)->rfc3779_asid);
+    ((X509 *)const_x)->rfc3779_asid = tmp_rfc3779_asid;
+    tmp_rfc3779_asid = NULL;
+#endif
+    ((X509 *)const_x)->siginf = tmp_siginf;

-    x->ex_flags |= EXFLAG_SET; /* Indicate that cert has been processed */
 #ifdef tsan_st_rel
-    tsan_st_rel((TSAN_QUALIFIER int *)&x->ex_cached, 1);
+    tsan_st_rel((TSAN_QUALIFIER int *)&const_x->ex_cached, 1);
     /*
      * Above store triggers fast lock-free check in the beginning of the
      * function. But one has to ensure that the structure is "stable", i.e.
      * all stores are visible on all processors. Hence the release fence.
      */
 #endif
-    ERR_pop_to_mark();
-
-    if ((x->ex_flags & EXFLAG_INVALID) == 0) {
-        CRYPTO_THREAD_unlock(x->lock);
-        return 1;
+    CRYPTO_THREAD_unlock(const_x->lock);
+    if (tmp_ex_flags & EXFLAG_INVALID) {
+        ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_CERTIFICATE);
+        goto done;
     }
-    CRYPTO_THREAD_unlock(x->lock);
-    ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_CERTIFICATE);
-    return 0;
+
+    ret = 1;
+
+done:
+    ASN1_OCTET_STRING_free(tmp_skid);
+    AUTHORITY_KEYID_free(tmp_akid);
+    sk_GENERAL_NAME_pop_free(tmp_altname, GENERAL_NAME_free);
+    NAME_CONSTRAINTS_free(tmp_nc);
+    sk_DIST_POINT_pop_free(tmp_crldp, DIST_POINT_free);
+#ifndef OPENSSL_NO_RFC3779
+    sk_IPAddressFamily_pop_free(tmp_rfc3779_addr, IPAddressFamily_free);
+    ASIdentifiers_free(tmp_rfc3779_asid);
+#endif
+    return ret;
 }

 /*-
@@ -712,7 +940,7 @@ void X509_set_proxy_pathlen(X509 *x, long l)
     x->ex_pcpathlen = l;
 }

-int X509_check_ca(X509 *x)
+int X509_check_ca(const X509 *x)
 {
     /* Note 0 normally means "not a CA" - but in this case means error. */
     if (!ossl_x509v3_cache_extensions(x))
@@ -783,7 +1011,7 @@ static int check_purpose_ns_ssl_server(const X509_PURPOSE *xp, const X509 *x,
     return ku_reject(x, KU_KEY_ENCIPHERMENT) ? 0 : ret;
 }

-/* common S/MIME checks */
+/* common S/MIME client checks */
 static int purpose_smime(const X509 *x, int non_leaf)
 {
     if (xku_reject(x, XKU_SMIME))
@@ -852,7 +1080,7 @@ static int check_purpose_ocsp_helper(const X509_PURPOSE *xp, const X509 *x,
      */
     if (non_leaf)
         return check_ca(x);
-    /* Leaf certificate is checked in OCSP_verify() */
+    /* Leaf certificate is checked in OCSP_basic_verify() */
     return 1;
 }

@@ -935,7 +1163,7 @@ static int check_purpose_code_sign(const X509_PURPOSE *xp, const X509 *x,
     if (i_ext < 0)
         return 0;
     if (i_ext >= 0) {
-        X509_EXTENSION *ext = X509_get_ext((X509 *)x, i_ext);
+        const X509_EXTENSION *ext = X509_get_ext((X509 *)x, i_ext);
         if (!X509_EXTENSION_get_critical(ext))
             return 0;
     }
@@ -957,6 +1185,45 @@ static int no_check_purpose(const X509_PURPOSE *xp, const X509 *x,
     return 1;
 }

+static int check_name_constraints(const NAME_CONSTRAINTS *nc)
+{
+    GENERAL_SUBTREE *sub;
+    int ret = 1;
+
+    if (nc == NULL)
+        goto done;
+
+    for (int i = 0; nc->permittedSubtrees != NULL
+        && i < sk_GENERAL_SUBTREE_num(nc->permittedSubtrees);
+        i++) {
+        sub = sk_GENERAL_SUBTREE_value(nc->permittedSubtrees, i);
+        if (sub->base->type == GEN_OTHERNAME
+            && OBJ_obj2nid(sub->base->d.otherName->type_id)
+                == NID_id_on_SmtpUTF8Mailbox) {
+            /* RFC 9598 prohibits GEN_OTHERNAME email constraints */
+            ERR_raise(ERR_LIB_X509V3, X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE);
+            ret = 0;
+            goto done;
+        }
+    }
+    for (int i = 0; nc->excludedSubtrees != NULL
+        && i < sk_GENERAL_SUBTREE_num(nc->excludedSubtrees);
+        i++) {
+        sub = sk_GENERAL_SUBTREE_value(nc->excludedSubtrees, i);
+        if (sub->base->type == GEN_OTHERNAME
+            && OBJ_obj2nid(sub->base->d.otherName->type_id)
+                == NID_id_on_SmtpUTF8Mailbox) {
+            /* RFC 9598 prohibits GEN_OTHERNAME email constraints */
+            ERR_raise(ERR_LIB_X509V3, X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE);
+            ret = 0;
+            goto done;
+        }
+    }
+
+done:
+    return ret;
+}
+
 /*-
  * Various checks to see if one certificate potentially issued the second.
  * This can be used to prune a set of possible issuer certificates which
@@ -970,7 +1237,7 @@ static int no_check_purpose(const X509_PURPOSE *xp, const X509 *x,
  * Returns 0 for OK, or positive for reason for mismatch
  * where reason codes match those for X509_verify_cert().
  */
-int X509_check_issued(X509 *issuer, X509 *subject)
+int X509_check_issued(const X509 *issuer, const X509 *subject)
 {
     int ret;

@@ -979,8 +1246,13 @@ int X509_check_issued(X509 *issuer, X509 *subject)
     return ossl_x509_signing_allowed(issuer, subject);
 }

-/* do the checks 1., 2., and 3. as described above for X509_check_issued() */
-int ossl_x509_likely_issued(X509 *issuer, X509 *subject)
+/*
+ * Do the checks 1., 2., and 3. as described above for X509_check_issued().
+ * These are very similar to a section of ossl_x509v3_cache_extensions().
+ * If |issuer| equals |subject| (such that self-signature should be checked),
+ * use the EXFLAG_SS result of ossl_x509v3_cache_extensions().
+ */
+int ossl_x509_likely_issued(const X509 *issuer, const X509 *subject)
 {
     int ret;

@@ -989,11 +1261,29 @@ int ossl_x509_likely_issued(X509 *issuer, X509 *subject)
         != 0)
         return X509_V_ERR_SUBJECT_ISSUER_MISMATCH;

-    /* set issuer->skid and subject->akid */
+    /* set issuer->skid, subject->akid, and subject->ex_flags */
     if (!ossl_x509v3_cache_extensions(issuer)
         || !ossl_x509v3_cache_extensions(subject))
         return X509_V_ERR_UNSPECIFIED;

+    if (issuer == subject
+        || (X509_NAME_cmp(X509_get_issuer_name(issuer), X509_get_issuer_name(subject)) == 0
+            && ASN1_INTEGER_cmp(X509_get0_serialNumber(issuer), X509_get0_serialNumber(subject)) == 0))
+        /*
+         * At this point, we can assume that issuer and subject
+         * are semantically the same cert because they are identical
+         * or at least have the same issuer and serial number,
+         * which (for any sane cert issuer) implies equality of the two certs.
+         * In this case, for consistency with chain building and validation,
+         * we make our issuance judgment depend on the presence of EXFLAG_SS.
+         * This is used for corrected chain building in the corner case of
+         * a self-issued but not actually self-signed trust anchor cert
+         * without subject and issuer key identifiers (i.e., no SKID and AKID).
+         */
+        return (issuer->ex_flags & EXFLAG_SS) != 0
+            ? X509_V_OK
+            : X509_V_ERR_CERT_SIGNATURE_FAILURE;
+
     ret = X509_check_akid(issuer, subject->akid);
     if (ret != X509_V_OK)
         return ret;
@@ -1020,6 +1310,12 @@ int ossl_x509_signing_allowed(const X509 *issuer, const X509 *subject)
     return X509_V_OK;
 }

+/*
+ * check if all sub-fields of the authority key identifier information akid,
+ * as far as present, match the respective subjectKeyIdentifier extension (if
+ * present in issuer), serialNumber field, and issuer fields of issuer.
+ * returns X509_V_OK also if akid is NULL because this means no restriction.
+ */
 int X509_check_akid(const X509 *issuer, const AUTHORITY_KEYID *akid)
 {
     if (akid == NULL)
@@ -1056,14 +1352,14 @@ int X509_check_akid(const X509 *issuer, const AUTHORITY_KEYID *akid)
     return X509_V_OK;
 }

-uint32_t X509_get_extension_flags(X509 *x)
+uint32_t X509_get_extension_flags(const X509 *x)
 {
     /* Call for side-effect of computing hash and caching extensions */
     X509_check_purpose(x, -1, 0);
     return x->ex_flags;
 }

-uint32_t X509_get_key_usage(X509 *x)
+uint32_t X509_get_key_usage(const X509 *x)
 {
     /* Call for side-effect of computing hash and caching extensions */
     if (X509_check_purpose(x, -1, 0) != 1)
@@ -1071,7 +1367,7 @@ uint32_t X509_get_key_usage(X509 *x)
     return (x->ex_flags & EXFLAG_KUSAGE) != 0 ? x->ex_kusage : UINT32_MAX;
 }

-uint32_t X509_get_extended_key_usage(X509 *x)
+uint32_t X509_get_extended_key_usage(const X509 *x)
 {
     /* Call for side-effect of computing hash and caching extensions */
     if (X509_check_purpose(x, -1, 0) != 1)
@@ -1079,7 +1375,7 @@ uint32_t X509_get_extended_key_usage(X509 *x)
     return (x->ex_flags & EXFLAG_XKUSAGE) != 0 ? x->ex_xkusage : UINT32_MAX;
 }

-const ASN1_OCTET_STRING *X509_get0_subject_key_id(X509 *x)
+const ASN1_OCTET_STRING *X509_get0_subject_key_id(const X509 *x)
 {
     /* Call for side-effect of computing hash and caching extensions */
     if (X509_check_purpose(x, -1, 0) != 1)
@@ -1087,7 +1383,7 @@ const ASN1_OCTET_STRING *X509_get0_subject_key_id(X509 *x)
     return x->skid;
 }

-const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x)
+const ASN1_OCTET_STRING *X509_get0_authority_key_id(const X509 *x)
 {
     /* Call for side-effect of computing hash and caching extensions */
     if (X509_check_purpose(x, -1, 0) != 1)
@@ -1095,7 +1391,7 @@ const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x)
     return (x->akid != NULL ? x->akid->keyid : NULL);
 }

-const GENERAL_NAMES *X509_get0_authority_issuer(X509 *x)
+const GENERAL_NAMES *X509_get0_authority_issuer(const X509 *x)
 {
     /* Call for side-effect of computing hash and caching extensions */
     if (X509_check_purpose(x, -1, 0) != 1)
@@ -1103,7 +1399,7 @@ const GENERAL_NAMES *X509_get0_authority_issuer(X509 *x)
     return (x->akid != NULL ? x->akid->issuer : NULL);
 }

-const ASN1_INTEGER *X509_get0_authority_serial(X509 *x)
+const ASN1_INTEGER *X509_get0_authority_serial(const X509 *x)
 {
     /* Call for side-effect of computing hash and caching extensions */
     if (X509_check_purpose(x, -1, 0) != 1)
@@ -1111,7 +1407,7 @@ const ASN1_INTEGER *X509_get0_authority_serial(X509 *x)
     return (x->akid != NULL ? x->akid->serial : NULL);
 }

-long X509_get_pathlen(X509 *x)
+long X509_get_pathlen(const X509 *x)
 {
     /* Called for side effect of caching extensions */
     if (X509_check_purpose(x, -1, 0) != 1
@@ -1120,7 +1416,7 @@ long X509_get_pathlen(X509 *x)
     return x->ex_pathlen;
 }

-long X509_get_proxy_pathlen(X509 *x)
+long X509_get_proxy_pathlen(const X509 *x)
 {
     /* Called for side effect of caching extensions */
     if (X509_check_purpose(x, -1, 0) != 1
diff --git a/deps/openssl/openssl/crypto/x509/v3_san.c b/deps/openssl/openssl/crypto/x509/v3_san.c
index 2674b33cc56..0defca074d8 100644
--- a/deps/openssl/openssl/crypto/x509/v3_san.c
+++ b/deps/openssl/openssl/crypto/x509/v3_san.c
@@ -128,7 +128,7 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
             break;
         default:
             if (OBJ_obj2txt(oline, sizeof(oline), gen->d.otherName->type_id, 0) > 0)
-                BIO_snprintf(othername, sizeof(othername), "othername: %s",
+                snprintf(othername, sizeof(othername), "othername: %s",
                     oline);
             else
                 OPENSSL_strlcpy(othername, "othername", sizeof(othername));
@@ -225,27 +225,37 @@ int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen)
         case NID_id_on_SmtpUTF8Mailbox:
             BIO_printf(out, "othername:SmtpUTF8Mailbox:%.*s",
                 gen->d.otherName->value->value.utf8string->length,
-                gen->d.otherName->value->value.utf8string->data);
+                gen->d.otherName->value->value.utf8string->length
+                    ? gen->d.otherName->value->value.utf8string->data
+                    : (const unsigned char *)"");
             break;
         case NID_XmppAddr:
             BIO_printf(out, "othername:XmppAddr:%.*s",
                 gen->d.otherName->value->value.utf8string->length,
-                gen->d.otherName->value->value.utf8string->data);
+                gen->d.otherName->value->value.utf8string->length
+                    ? gen->d.otherName->value->value.utf8string->data
+                    : (const unsigned char *)"");
             break;
         case NID_SRVName:
             BIO_printf(out, "othername:SRVName:%.*s",
                 gen->d.otherName->value->value.ia5string->length,
-                gen->d.otherName->value->value.ia5string->data);
+                gen->d.otherName->value->value.ia5string->length
+                    ? gen->d.otherName->value->value.ia5string->data
+                    : (const unsigned char *)"");
             break;
         case NID_ms_upn:
             BIO_printf(out, "othername:UPN:%.*s",
                 gen->d.otherName->value->value.utf8string->length,
-                gen->d.otherName->value->value.utf8string->data);
+                gen->d.otherName->value->value.utf8string->length
+                    ? gen->d.otherName->value->value.utf8string->data
+                    : (const unsigned char *)"");
             break;
         case NID_NAIRealm:
             BIO_printf(out, "othername:NAIRealm:%.*s",
                 gen->d.otherName->value->value.utf8string->length,
-                gen->d.otherName->value->value.utf8string->data);
+                gen->d.otherName->value->value.utf8string->length
+                    ? gen->d.otherName->value->value.utf8string->data
+                    : (const unsigned char *)"");
             break;
         default:
             BIO_printf(out, "othername:<unsupported>");
@@ -337,7 +347,7 @@ static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens)
 {
     GENERAL_NAMES *ialt = NULL;
     GENERAL_NAME *gen;
-    X509_EXTENSION *ext;
+    const X509_EXTENSION *ext;
     int i, num;

     if (ctx != NULL && (ctx->flags & X509V3_CTX_TEST) != 0)
@@ -418,7 +428,7 @@ err:

 static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p)
 {
-    X509_NAME *nm;
+    const X509_NAME *nm;
     ASN1_IA5STRING *email = NULL;
     X509_NAME_ENTRY *ne;
     GENERAL_NAME *gen = NULL;
@@ -432,19 +442,23 @@ static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p)
         return 0;
     }
     /* Find the subject name */
-    nm = ctx->subject_cert != NULL ? X509_get_subject_name(ctx->subject_cert) : X509_REQ_get_subject_name(ctx->subject_req);
+    nm = ctx->subject_cert != NULL ? X509_get_subject_name(ctx->subject_cert)
+                                   : X509_REQ_get_subject_name(ctx->subject_req);

     /* Now add any email address(es) to STACK */
     while ((i = X509_NAME_get_index_by_NID(nm,
                 NID_pkcs9_emailAddress, i))
         >= 0) {
-        ne = X509_NAME_get_entry(nm, i);
-        email = ASN1_STRING_dup(X509_NAME_ENTRY_get_data(ne));
         if (move_p) {
-            X509_NAME_delete_entry(nm, i);
-            X509_NAME_ENTRY_free(ne);
-            i--;
+            /* We should really not support deleting things in a const object
+             * to rip the pointer out of it. If we truly want a new object
+             * without this in it, we should just construct one without it.
+             */
+            return 0;
         }
+        /* XXX Casts away const */
+        ne = (X509_NAME_ENTRY *)X509_NAME_get_entry(nm, i);
+        email = ASN1_STRING_dup(X509_NAME_ENTRY_get_data(ne));
         if (email == NULL || (gen = GENERAL_NAME_new()) == NULL) {
             ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
             goto err;
@@ -571,7 +585,8 @@ GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out,
     }

     if (is_string) {
-        if ((gen->d.ia5 = ASN1_IA5STRING_new()) == NULL || !ASN1_STRING_set(gen->d.ia5, (unsigned char *)value, strlen(value))) {
+        if ((gen->d.ia5 = ASN1_IA5STRING_new()) == NULL
+            || !ossl_asn1_string_set1_string(gen->d.ia5, value)) {
             ASN1_IA5STRING_free(gen->d.ia5);
             gen->d.ia5 = NULL;
             ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
@@ -632,7 +647,7 @@ static int do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx)
 {
     char *objtmp = NULL;
     const char *p;
-    int objlen;
+    size_t objlen;

     if ((p = strchr(value, ';')) == NULL)
         return 0;
diff --git a/deps/openssl/openssl/crypto/x509/v3_sda.c b/deps/openssl/openssl/crypto/x509/v3_sda.c
index a3ecc3318dc..6887ef88501 100644
--- a/deps/openssl/openssl/crypto/x509/v3_sda.c
+++ b/deps/openssl/openssl/crypto/x509/v3_sda.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -22,7 +22,7 @@ static int i2r_ATTRIBUTES_SYNTAX(X509V3_EXT_METHOD *method,
     BIO *out, int indent)
 {
     X509_ATTRIBUTE *attr;
-    ASN1_TYPE *av;
+    const ASN1_TYPE *av;
     int i, j, attr_nid;

     if (!attrlst) {
@@ -37,7 +37,7 @@ static int i2r_ATTRIBUTES_SYNTAX(X509V3_EXT_METHOD *method,
     }

     for (i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
-        ASN1_OBJECT *attr_obj;
+        const ASN1_OBJECT *attr_obj;
         attr = sk_X509_ATTRIBUTE_value(attrlst, i);
         attr_obj = X509_ATTRIBUTE_get0_object(attr);
         attr_nid = OBJ_obj2nid(attr_obj);
diff --git a/deps/openssl/openssl/crypto/x509/v3_sxnet.c b/deps/openssl/openssl/crypto/x509/v3_sxnet.c
index a27afcfb9da..f0f93953e45 100644
--- a/deps/openssl/openssl/crypto/x509/v3_sxnet.c
+++ b/deps/openssl/openssl/crypto/x509/v3_sxnet.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -168,7 +168,7 @@ int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, const char *user,
         return 0;
     }
     if (userlen == -1)
-        userlen = strlen(user);
+        userlen = (int)strlen(user);
     if (userlen > 64) {
         ERR_raise(ERR_LIB_X509V3, X509V3_R_USER_TOO_LONG);
         return 0;
diff --git a/deps/openssl/openssl/crypto/x509/v3_timespec.c b/deps/openssl/openssl/crypto/x509/v3_timespec.c
index 4b7b07c3d0d..4dcf0fce289 100644
--- a/deps/openssl/openssl/crypto/x509/v3_timespec.c
+++ b/deps/openssl/openssl/crypto/x509/v3_timespec.c
@@ -13,7 +13,7 @@
 #include <crypto/asn1.h>
 #include "ext_dat.h"

-static const char *WEEKDAY_NAMES[7] = {
+static const char *const WEEKDAY_NAMES[7] = {
     "SUN",
     "MON",
     "TUE",
@@ -23,7 +23,7 @@ static const char *WEEKDAY_NAMES[7] = {
     "SAT"
 };

-static const char *WEEK_NAMES[5] = {
+static const char *const WEEK_NAMES[5] = {
     "first",
     "second",
     "third",
@@ -31,7 +31,7 @@ static const char *WEEK_NAMES[5] = {
     "final"
 };

-static const char *MONTH_NAMES[12] = {
+static const char *const MONTH_NAMES[12] = {
     "JAN",
     "FEB",
     "MAR",
@@ -142,7 +142,11 @@ static int i2r_OSSL_TIME_SPEC_ABSOLUTE(X509V3_EXT_METHOD *method,
             return 0;
         if (!ossl_asn1_time_print_ex(out, time->startTime, 0))
             return 0;
-        if (BIO_printf(out, "%.*s", time->startTime->length, time->startTime->data) <= 0)
+        if (BIO_printf(out, "%.*s", time->startTime->length,
+                time->startTime->length
+                    ? time->startTime->data
+                    : (const unsigned char *)"")
+            <= 0)
             return 0;
     } else if (time->endTime != NULL) {
         if (!BIO_puts(out, "Any time until "))
diff --git a/deps/openssl/openssl/crypto/x509/v3_usernotice.c b/deps/openssl/openssl/crypto/x509/v3_usernotice.c
index 9bf1502f758..ce6627bf231 100644
--- a/deps/openssl/openssl/crypto/x509/v3_usernotice.c
+++ b/deps/openssl/openssl/crypto/x509/v3_usernotice.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,8 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"

+#include <crypto/asn1.h>
+
 ASN1_ITEM_TEMPLATE(OSSL_USER_NOTICE_SYNTAX) = ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, OSSL_USER_NOTICE_SYNTAX, USERNOTICE)
 ASN1_ITEM_TEMPLATE_END(OSSL_USER_NOTICE_SYNTAX)

@@ -27,7 +29,9 @@ static int print_notice(BIO *out, USERNOTICE *notice, int indent)
         ref = notice->noticeref;
         if (BIO_printf(out, "%*sOrganization: %.*s\n", indent, "",
                 ref->organization->length,
-                ref->organization->data)
+                ref->organization->length
+                    ? ref->organization->data
+                    : (const unsigned char *)"")
             <= 0)
             return 0;
         if (BIO_printf(out, "%*sNumber%s: ", indent, "",
@@ -59,7 +63,9 @@ static int print_notice(BIO *out, USERNOTICE *notice, int indent)

     return BIO_printf(out, "%*sExplicit Text: %.*s", indent, "",
                notice->exptext->length,
-               notice->exptext->data)
+               notice->exptext->length
+                   ? notice->exptext->data
+                   : (const unsigned char *)"")
         >= 0;
 }

diff --git a/deps/openssl/openssl/crypto/x509/v3_utf8.c b/deps/openssl/openssl/crypto/x509/v3_utf8.c
index d3b4f8a16f9..fcc932f766f 100644
--- a/deps/openssl/openssl/crypto/x509/v3_utf8.c
+++ b/deps/openssl/openssl/crypto/x509/v3_utf8.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,6 +14,8 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"

+#include <crypto/asn1.h>
+
 /*
  * Subject Sign Tool (1.2.643.100.111) The name of the tool used to signs the subject (UTF8String)
  * This extension is required to obtain the status of a qualified certificate at Russian Federation.
@@ -53,7 +55,7 @@ ASN1_UTF8STRING *s2i_ASN1_UTF8STRING(X509V3_EXT_METHOD *method,
         ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
         return NULL;
     }
-    if (!ASN1_STRING_set((ASN1_STRING *)utf8, str, strlen(str))) {
+    if (!ossl_asn1_string_set1_string(utf8, str)) {
         ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
         ASN1_UTF8STRING_free(utf8);
         return NULL;
diff --git a/deps/openssl/openssl/crypto/x509/v3_utl.c b/deps/openssl/openssl/crypto/x509/v3_utl.c
index 99780cf4a32..88c19ab7d29 100644
--- a/deps/openssl/openssl/crypto/x509/v3_utl.c
+++ b/deps/openssl/openssl/crypto/x509/v3_utl.c
@@ -428,7 +428,8 @@ static char *strip_spaces(char *name)

 int ossl_v3_name_cmp(const char *name, const char *cmp)
 {
-    int len, ret;
+    size_t len;
+    int ret;
     char c;

     len = strlen(cmp);
@@ -445,7 +446,7 @@ static int sk_strcmp(const char *const *a, const char *const *b)
     return strcmp(*a, *b);
 }

-STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x)
+STACK_OF(OPENSSL_STRING) *X509_get1_email(const X509 *x)
 {
     GENERAL_NAMES *gens;
     STACK_OF(OPENSSL_STRING) *ret;
@@ -456,7 +457,7 @@ STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x)
     return ret;
 }

-STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x)
+STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(const X509 *x)
 {
     AUTHORITY_INFO_ACCESS *info;
     STACK_OF(OPENSSL_STRING) *ret = NULL;
@@ -478,7 +479,7 @@ STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x)
     return ret;
 }

-STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x)
+STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(const X509_REQ *x)
 {
     GENERAL_NAMES *gens;
     STACK_OF(X509_EXTENSION) *exts;
@@ -496,7 +497,7 @@ static STACK_OF(OPENSSL_STRING) *get_email(const X509_NAME *name,
     GENERAL_NAMES *gens)
 {
     STACK_OF(OPENSSL_STRING) *ret = NULL;
-    X509_NAME_ENTRY *ne;
+    const X509_NAME_ENTRY *ne;
     const ASN1_IA5STRING *email;
     GENERAL_NAME *gen;
     int i = -1;
@@ -865,15 +866,14 @@ static int do_check_string(const ASN1_STRING *a, int cmp_type, equal_fn equal,
     return rv;
 }

-static int do_x509_check(X509 *x, const char *chk, size_t chklen,
-    unsigned int flags, int check_type, char **peername)
+static int do_x509_check(const X509 *x, const char *chk, size_t chklen,
+    unsigned int flags, int check_type, int othername_nid, char **peername)
 {
     GENERAL_NAMES *gens = NULL;
     const X509_NAME *name = NULL;
     int i;
     int cnid = NID_undef;
     int alt_type;
-    int san_present = 0;
     int rv = 0;
     equal_fn equal;

@@ -912,6 +912,8 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen,
             default:
                 continue;
             case GEN_OTHERNAME:
+                if (check_type != GEN_OTHERNAME)
+                    continue;
                 switch (OBJ_obj2nid(gen->d.otherName->type_id)) {
                 default:
                     continue;
@@ -931,17 +933,10 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen,
                      *   SmtpUTF8Mailbox is encoded as UTF8String.
                      *
                      * If it is not a UTF8String then that is unexpected, and
-                     * we ignore the invalid SAN (neither set san_present nor
-                     * consider it a candidate for equality).  This does mean
-                     * that the subject CN may be considered, as would be the
-                     * case when the malformed SmtpUtf8Mailbox SAN is instead
-                     * simply absent.
-                     *
-                     * When CN-ID matching is not desirable, applications can
-                     * choose to turn it off, doing so is at this time a best
-                     * practice.
+                     * we ignore the invalid SAN, so it is not considered a
+                     * candidate for equality.
                      */
-                    if (check_type != GEN_EMAIL
+                    if (othername_nid != NID_id_on_SmtpUTF8Mailbox
                         || gen->d.otherName->value->type != V_ASN1_UTF8STRING)
                         continue;
                     alt_type = 0;
@@ -965,7 +960,6 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen,
                 cstr = gen->d.iPAddress;
                 break;
             }
-            san_present = 1;
             /* Positive on success, negative on error! */
             if ((rv = do_check_string(cstr, alt_type, equal, flags,
                      chk, chklen, peername))
@@ -975,12 +969,17 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen,
         GENERAL_NAMES_free(gens);
         if (rv != 0)
             return rv;
-        if (san_present && !(flags & X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT))
-            return 0;
     }

-    /* We're done if CN-ID is not pertinent */
-    if (cnid == NID_undef || (flags & X509_CHECK_FLAG_NEVER_CHECK_SUBJECT))
+    /*
+     * The subject DN is not consulted by default: the subject commonName or
+     * emailAddress is matched only when the caller explicitly opts in with
+     * X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT, and never when
+     * X509_CHECK_FLAG_NEVER_CHECK_SUBJECT is set.
+     */
+    if (cnid == NID_undef
+        || (flags & X509_CHECK_FLAG_NEVER_CHECK_SUBJECT) != 0
+        || (flags & X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT) == 0)
         return 0;

     i = -1;
@@ -998,7 +997,7 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen,
     return 0;
 }

-int X509_check_host(X509 *x, const char *chk, size_t chklen,
+int ossl_x509_check_host(const X509 *x, const char *chk, size_t chklen,
     unsigned int flags, char **peername)
 {
     if (chk == NULL)
@@ -1014,10 +1013,41 @@ int X509_check_host(X509 *x, const char *chk, size_t chklen,
         return -2;
     if (chklen > 1 && chk[chklen - 1] == '\0')
         --chklen;
-    return do_x509_check(x, chk, chklen, flags, GEN_DNS, peername);
+    return do_x509_check(x, chk, chklen, flags, GEN_DNS, 0, peername);
+}
+
+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+int X509_check_host(const X509 *x, const char *chk, size_t chklen,
+    unsigned int flags, char **peername)
+{
+    return ossl_x509_check_host(x, chk, chklen, flags, peername);
+}
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_1) */
+
+int ossl_x509_check_rfc822(X509 *x, const char *chk, size_t chklen,
+    unsigned int flags)
+{
+    return do_x509_check(x, chk, chklen, flags, GEN_EMAIL, 0, NULL) == 1;
 }

-int X509_check_email(X509 *x, const char *chk, size_t chklen,
+int ossl_x509_check_smtputf8(X509 *x, const char *chk, size_t chklen,
+    unsigned int flags)
+{
+    return do_x509_check(x, chk, chklen, flags, GEN_OTHERNAME,
+               NID_id_on_SmtpUTF8Mailbox, NULL)
+        == 1;
+}
+
+int ossl_x509_check_ip(const X509 *x, const unsigned char *chk, size_t chklen,
+    unsigned int flags)
+{
+    if (chk == NULL)
+        return -2;
+    return do_x509_check(x, (char *)chk, chklen, flags, GEN_IPADD, 0, NULL);
+}
+
+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+int X509_check_email(const X509 *x, const char *chk, size_t chklen,
     unsigned int flags)
 {
     if (chk == NULL)
@@ -1033,18 +1063,23 @@ int X509_check_email(X509 *x, const char *chk, size_t chklen,
         return -2;
     if (chklen > 1 && chk[chklen - 1] == '\0')
         --chklen;
-    return do_x509_check(x, chk, chklen, flags, GEN_EMAIL, NULL);
+    /*
+     * As this is public API, historically it has supported checking
+     * whatever is supplied against both RFC822 and SMTPUTF8.
+     */
+    if (do_x509_check(x, chk, chklen, flags, GEN_EMAIL, 0, NULL) == 1)
+        return 1;
+    return do_x509_check(x, chk, chklen, flags, GEN_OTHERNAME,
+        NID_id_on_SmtpUTF8Mailbox, NULL);
 }

-int X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen,
+int X509_check_ip(const X509 *x, const unsigned char *chk, size_t chklen,
     unsigned int flags)
 {
-    if (chk == NULL)
-        return -2;
-    return do_x509_check(x, (char *)chk, chklen, flags, GEN_IPADD, NULL);
+    return ossl_x509_check_ip(x, chk, chklen, flags);
 }

-int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags)
+int X509_check_ip_asc(const X509 *x, const char *ipasc, unsigned int flags)
 {
     unsigned char ipout[16];
     size_t iplen;
@@ -1054,10 +1089,11 @@ int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags)
     iplen = (size_t)ossl_a2i_ipadd(ipout, ipasc);
     if (iplen == 0)
         return -2;
-    return do_x509_check(x, (char *)ipout, iplen, flags, GEN_IPADD, NULL);
+    return do_x509_check(x, (char *)ipout, iplen, flags, GEN_IPADD, 0, NULL);
 }
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_1) */

-char *ossl_ipaddr_to_asc(unsigned char *p, int len)
+char *ossl_ipaddr_to_asc(const unsigned char *p, int len)
 {
     /*
      * 40 is enough space for the longest IPv6 address + nul terminator byte
@@ -1068,20 +1104,20 @@ char *ossl_ipaddr_to_asc(unsigned char *p, int len)

     switch (len) {
     case 4: /* IPv4 */
-        BIO_snprintf(buf, sizeof(buf), "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
+        snprintf(buf, sizeof(buf), "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
         break;
     case 16: /* IPv6 */
         for (out = buf, i = 8, remain = sizeof(buf);
-            i-- > 0 && bytes >= 0;
+            i-- > 0 && bytes >= 0 && remain > 0;
             remain -= bytes, out += bytes) {
             const char *template = (i > 0 ? "%X:" : "%X");

-            bytes = BIO_snprintf(out, remain, template, p[0] << 8 | p[1]);
+            bytes = snprintf(out, remain, template, p[0] << 8 | p[1]);
             p += 2;
         }
         break;
     default:
-        BIO_snprintf(buf, sizeof(buf), "<invalid length=%d>", len);
+        snprintf(buf, sizeof(buf), "<invalid length=%d>", len);
         break;
     }
     return OPENSSL_strdup(buf);
diff --git a/deps/openssl/openssl/crypto/x509/v3err.c b/deps/openssl/openssl/crypto/x509/v3err.c
deleted file mode 100644
index 96a27aaf488..00000000000
--- a/deps/openssl/openssl/crypto/x509/v3err.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/x509v3err.h>
-#include "crypto/x509v3err.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA X509V3_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_BAD_IP_ADDRESS), "bad ip address" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_BAD_OBJECT), "bad object" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_BAD_OPTION), "bad option" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_BAD_VALUE), "bad value" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_BN_DEC2BN_ERROR), "bn dec2bn error" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_BN_TO_ASN1_INTEGER_ERROR),
-        "bn to asn1 integer error" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_DIRNAME_ERROR), "dirname error" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_DISTPOINT_ALREADY_SET),
-        "distpoint already set" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_DUPLICATE_ZONE_ID),
-        "duplicate zone id" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_EMPTY_KEY_USAGE), "empty key usage" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_ERROR_CONVERTING_ZONE),
-        "error converting zone" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_ERROR_CREATING_EXTENSION),
-        "error creating extension" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_ERROR_IN_EXTENSION),
-        "error in extension" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_EXPECTED_A_SECTION_NAME),
-        "expected a section name" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_EXTENSION_EXISTS),
-        "extension exists" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_EXTENSION_NAME_ERROR),
-        "extension name error" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_EXTENSION_NOT_FOUND),
-        "extension not found" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED),
-        "extension setting not supported" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_EXTENSION_VALUE_ERROR),
-        "extension value error" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_ILLEGAL_EMPTY_EXTENSION),
-        "illegal empty extension" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INCORRECT_POLICY_SYNTAX_TAG),
-        "incorrect policy syntax tag" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_ASNUMBER),
-        "invalid asnumber" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_ASRANGE), "invalid asrange" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_BOOLEAN_STRING),
-        "invalid boolean string" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_CERTIFICATE),
-        "invalid certificate" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_EMPTY_NAME),
-        "invalid empty name" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_EXTENSION_STRING),
-        "invalid extension string" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_INHERITANCE),
-        "invalid inheritance" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_IPADDRESS),
-        "invalid ipaddress" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_MULTIPLE_RDNS),
-        "invalid multiple rdns" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_NAME), "invalid name" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_NULL_ARGUMENT),
-        "invalid null argument" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_NULL_VALUE),
-        "invalid null value" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_NUMBER), "invalid number" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_NUMBERS), "invalid numbers" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_OBJECT_IDENTIFIER),
-        "invalid object identifier" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_OPTION), "invalid option" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_POLICY_IDENTIFIER),
-        "invalid policy identifier" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_PROXY_POLICY_SETTING),
-        "invalid proxy policy setting" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_PURPOSE), "invalid purpose" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_SAFI), "invalid safi" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_SECTION), "invalid section" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_INVALID_SYNTAX), "invalid syntax" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_ISSUER_DECODE_ERROR),
-        "issuer decode error" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_MISSING_VALUE), "missing value" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS),
-        "need organization and numbers" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_NEGATIVE_PATHLEN),
-        "negative pathlen" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_NO_CONFIG_DATABASE),
-        "no config database" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_NO_ISSUER_CERTIFICATE),
-        "no issuer certificate" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_NO_ISSUER_DETAILS),
-        "no issuer details" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_NO_POLICY_IDENTIFIER),
-        "no policy identifier" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED),
-        "no proxy cert policy language defined" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_NO_PUBLIC_KEY), "no public key" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_NO_SUBJECT_DETAILS),
-        "no subject details" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_OPERATION_NOT_DEFINED),
-        "operation not defined" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_OTHERNAME_ERROR), "othername error" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED),
-        "policy language already defined" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_POLICY_PATH_LENGTH),
-        "policy path length" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED),
-        "policy path length already defined" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY),
-        "policy when proxy language requires no policy" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_PURPOSE_NOT_UNIQUE),
-        "purpose not unique" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_SECTION_NOT_FOUND),
-        "section not found" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS),
-        "unable to get issuer details" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID),
-        "unable to get issuer keyid" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT),
-        "unknown bit string argument" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_UNKNOWN_EXTENSION),
-        "unknown extension" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_UNKNOWN_EXTENSION_NAME),
-        "unknown extension name" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_UNKNOWN_OPTION), "unknown option" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_UNKNOWN_VALUE), "unknown value" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_UNSUPPORTED_OPTION),
-        "unsupported option" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_UNSUPPORTED_TYPE),
-        "unsupported type" },
-    { ERR_PACK(ERR_LIB_X509V3, 0, X509V3_R_USER_TOO_LONG), "user too long" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_X509V3_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(X509V3_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(X509V3_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/x509/x509_acert.c b/deps/openssl/openssl/crypto/x509/x509_acert.c
index 6369bd52c16..31d8d82be1a 100644
--- a/deps/openssl/openssl/crypto/x509/x509_acert.c
+++ b/deps/openssl/openssl/crypto/x509/x509_acert.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -301,7 +301,7 @@ int X509_ACERT_add_attr_nconf(CONF *conf, const char *section,
             ret = X509_ACERT_add1_attr_by_txt(acert, v->name,
                 V_ASN1_OCTET_STRING,
                 (unsigned char *)value,
-                strlen(value));
+                (int)strlen(value));
             if (!ret)
                 goto err;
         }
diff --git a/deps/openssl/openssl/crypto/x509/x509_att.c b/deps/openssl/openssl/crypto/x509/x509_att.c
index a0fb4454727..ae4b71c05b2 100644
--- a/deps/openssl/openssl/crypto/x509/x509_att.c
+++ b/deps/openssl/openssl/crypto/x509/x509_att.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -238,11 +238,11 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE)
     return ret;
 }

-void *X509at_get0_data_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *x,
+const void *X509at_get0_data_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *x,
     const ASN1_OBJECT *obj, int lastpos, int type)
 {
     int i = X509at_get_attr_by_OBJ(x, obj, lastpos);
-    X509_ATTRIBUTE *at;
+    const X509_ATTRIBUTE *at;

     if (i == -1)
         return NULL;
@@ -364,8 +364,24 @@ int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,
         }
         atype = stmp->type;
     } else if (len != -1) {
-        if ((stmp = ASN1_STRING_type_new(attrtype)) == NULL
-            || !ASN1_STRING_set(stmp, data, len)) {
+        if ((stmp = ASN1_STRING_type_new(attrtype)) == NULL) {
+            ERR_raise(ERR_LIB_X509, ERR_R_ASN1_LIB);
+            goto err;
+        }
+        if (attrtype == V_ASN1_BIT_STRING) {
+            /*
+             * ossl_asn1_string_set1_data() rejects bit strings, so use the
+             * dedicated bit string setter, with zero unused bits.
+             */
+            if (data == NULL && len > 0) {
+                ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
+                goto err;
+            }
+            if (!ASN1_BIT_STRING_set1(stmp, data, len, 0)) {
+                ERR_raise(ERR_LIB_X509, ERR_R_ASN1_LIB);
+                goto err;
+            }
+        } else if (!ossl_asn1_string_set1_data(stmp, data, len)) {
             ERR_raise(ERR_LIB_X509, ERR_R_ASN1_LIB);
             goto err;
         }
@@ -411,7 +427,7 @@ int X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr)
     return sk_ASN1_TYPE_num(attr->set);
 }

-ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr)
+const ASN1_OBJECT *X509_ATTRIBUTE_get0_object(const X509_ATTRIBUTE *attr)
 {
     if (attr == NULL) {
         ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
@@ -420,10 +436,10 @@ ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr)
     return attr->object;
 }

-void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx,
+const void *X509_ATTRIBUTE_get0_data(const X509_ATTRIBUTE *attr, int idx,
     int atrtype, void *data)
 {
-    ASN1_TYPE *ttmp = X509_ATTRIBUTE_get0_type(attr, idx);
+    const ASN1_TYPE *ttmp = X509_ATTRIBUTE_get0_type(attr, idx);

     if (ttmp == NULL)
         return NULL;
@@ -436,7 +452,7 @@ void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx,
     return ttmp->value.ptr;
 }

-ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx)
+const ASN1_TYPE *X509_ATTRIBUTE_get0_type(const X509_ATTRIBUTE *attr, int idx)
 {
     if (attr == NULL) {
         ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
diff --git a/deps/openssl/openssl/crypto/x509/x509_cmp.c b/deps/openssl/openssl/crypto/x509/x509_cmp.c
index 6d9848d234e..6cf674ea855 100644
--- a/deps/openssl/openssl/crypto/x509/x509_cmp.c
+++ b/deps/openssl/openssl/crypto/x509/x509_cmp.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -34,7 +34,7 @@ int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b)
 }

 #ifndef OPENSSL_NO_MD5
-unsigned long X509_issuer_and_serial_hash(X509 *a)
+unsigned long X509_issuer_and_serial_hash(const X509 *a)
 {
     unsigned long ret = 0;
     EVP_MD_CTX *ctx = EVP_MD_CTX_new();
@@ -97,24 +97,24 @@ int X509_CRL_match(const X509_CRL *a, const X509_CRL *b)
     return rv < 0 ? -1 : rv > 0;
 }

-X509_NAME *X509_get_issuer_name(const X509 *a)
+const X509_NAME *X509_get_issuer_name(const X509 *a)
 {
     return a->cert_info.issuer;
 }

-unsigned long X509_issuer_name_hash(X509 *x)
+unsigned long X509_issuer_name_hash(const X509 *x)
 {
     return X509_NAME_hash_ex(x->cert_info.issuer, NULL, NULL, NULL);
 }

 #ifndef OPENSSL_NO_MD5
-unsigned long X509_issuer_name_hash_old(X509 *x)
+unsigned long X509_issuer_name_hash_old(const X509 *x)
 {
     return X509_NAME_hash_old(x->cert_info.issuer);
 }
 #endif

-X509_NAME *X509_get_subject_name(const X509 *a)
+const X509_NAME *X509_get_subject_name(const X509 *a)
 {
     return a->cert_info.subject;
 }
@@ -129,13 +129,13 @@ const ASN1_INTEGER *X509_get0_serialNumber(const X509 *a)
     return &a->cert_info.serialNumber;
 }

-unsigned long X509_subject_name_hash(X509 *x)
+unsigned long X509_subject_name_hash(const X509 *x)
 {
     return X509_NAME_hash_ex(x->cert_info.subject, NULL, NULL, NULL);
 }

 #ifndef OPENSSL_NO_MD5
-unsigned long X509_subject_name_hash_old(X509 *x)
+unsigned long X509_subject_name_hash_old(const X509 *x)
 {
     return X509_NAME_hash_old(x->cert_info.subject);
 }
@@ -178,7 +178,7 @@ int X509_cmp(const X509 *a, const X509 *b)
     return rv < 0 ? -1 : rv > 0;
 }

-int ossl_x509_add_cert_new(STACK_OF(X509) **p_sk, X509 *cert, int flags)
+int ossl_x509_add_cert_new(STACK_OF(X509) **p_sk, const X509 *cert, int flags)
 {
     if (*p_sk == NULL && (*p_sk = sk_X509_new_null()) == NULL) {
         ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
@@ -187,7 +187,7 @@ int ossl_x509_add_cert_new(STACK_OF(X509) **p_sk, X509 *cert, int flags)
     return X509_add_cert(*p_sk, cert, flags);
 }

-int X509_add_cert(STACK_OF(X509) *sk, X509 *cert, int flags)
+int X509_add_cert(STACK_OF(X509) *sk, const X509 *cert, int flags)
 {
     if (sk == NULL) {
         ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
@@ -213,19 +213,23 @@ int X509_add_cert(STACK_OF(X509) *sk, X509 *cert, int flags)
         if (ret != 0)
             return ret > 0 ? 1 : 0;
     }
-    if ((flags & X509_ADD_FLAG_UP_REF) != 0 && !X509_up_ref(cert))
+    /*
+     * Note: We're technically mutating the cert here, but its just to up
+     * the reference count, so that should be safe, so cast away
+     */
+    if ((flags & X509_ADD_FLAG_UP_REF) != 0 && !X509_up_ref((X509 *)cert))
         return 0;
-    if (!sk_X509_insert(sk, cert,
+    if (!sk_X509_insert(sk, (X509 *)cert,
             (flags & X509_ADD_FLAG_PREPEND) != 0 ? 0 : -1)) {
         if ((flags & X509_ADD_FLAG_UP_REF) != 0)
-            X509_free(cert);
+            X509_free((X509 *)cert);
         ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
         return 0;
     }
     return 1;
 }

-int X509_add_certs(STACK_OF(X509) *sk, STACK_OF(X509) *certs, int flags)
+int X509_add_certs(STACK_OF(X509) *sk, const STACK_OF(X509) *certs, int flags)
 /* compiler would allow 'const' for the certs, yet they may get up-ref'ed */
 {
     if (sk == NULL) {
@@ -235,8 +239,7 @@ int X509_add_certs(STACK_OF(X509) *sk, STACK_OF(X509) *certs, int flags)
     return ossl_x509_add_certs_new(&sk, certs, flags);
 }

-int ossl_x509_add_certs_new(STACK_OF(X509) **p_sk, STACK_OF(X509) *certs,
-    int flags)
+int ossl_x509_add_certs_new(STACK_OF(X509) **p_sk, const STACK_OF(X509) *certs, int flags)
 /* compiler would allow 'const' for the certs, yet they may get up-ref'ed */
 {
     int n = sk_X509_num(certs /* may be NULL */);
@@ -342,7 +345,7 @@ end:
 #endif

 /* Search a stack of X509 for a match */
-X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, const X509_NAME *name,
+X509 *X509_find_by_issuer_and_serial(const STACK_OF(X509) *sk, const X509_NAME *name,
     const ASN1_INTEGER *serial)
 {
     int i;
@@ -362,7 +365,7 @@ X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, const X509_NAME *name,
     return NULL;
 }

-X509 *X509_find_by_subject(STACK_OF(X509) *sk, const X509_NAME *name)
+X509 *X509_find_by_subject(const STACK_OF(X509) *sk, const X509_NAME *name)
 {
     X509 *x509;
     int i;
@@ -382,7 +385,7 @@ EVP_PKEY *X509_get0_pubkey(const X509 *x)
     return X509_PUBKEY_get0(x->cert_info.key);
 }

-EVP_PKEY *X509_get_pubkey(X509 *x)
+EVP_PKEY *X509_get_pubkey(const X509 *x)
 {
     if (x == NULL)
         return NULL;
@@ -467,7 +470,7 @@ static int check_suite_b(EVP_PKEY *pkey, int sign_nid, unsigned long *pflags)
     return X509_V_OK;
 }

-int X509_chain_check_suiteb(int *perror_depth, X509 *x, STACK_OF(X509) *chain,
+int X509_chain_check_suiteb(int *perror_depth, const X509 *x, STACK_OF(X509) *chain,
     unsigned long flags)
 {
     int rv, i, sign_nid;
@@ -553,7 +556,7 @@ int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, unsigned long flags)
 }

 #else
-int X509_chain_check_suiteb(int *perror_depth, X509 *x, STACK_OF(X509) *chain,
+int X509_chain_check_suiteb(int *perror_depth, const X509 *x, STACK_OF(X509) *chain,
     unsigned long flags)
 {
     return 0;
diff --git a/deps/openssl/openssl/crypto/x509/x509_def.c b/deps/openssl/openssl/crypto/x509/x509_def.c
index 5a6ecaf4761..f0e530e1315 100644
--- a/deps/openssl/openssl/crypto/x509/x509_def.c
+++ b/deps/openssl/openssl/crypto/x509/x509_def.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -30,7 +30,7 @@ static char *x509_cert_fileptr = NULL;

 static void get_windows_default_path(char *pathname, const char *suffix)
 {
-    char *ossldir;
+    const char *ossldir;

     ossldir = ossl_get_openssldir();

diff --git a/deps/openssl/openssl/crypto/x509/x509_err.c b/deps/openssl/openssl/crypto/x509/x509_err.c
deleted file mode 100644
index 7ed046fef49..00000000000
--- a/deps/openssl/openssl/crypto/x509/x509_err.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/x509err.h>
-#include "crypto/x509err.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA X509_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_AKID_MISMATCH), "akid mismatch" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_BAD_SELECTOR), "bad selector" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_BAD_X509_FILETYPE), "bad x509 filetype" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_BASE64_DECODE_ERROR),
-        "base64 decode error" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_CANT_CHECK_DH_KEY), "can't check dh key" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_CERTIFICATE_VERIFICATION_FAILED),
-        "certificate verification failed" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_CERT_ALREADY_IN_HASH_TABLE),
-        "cert already in hash table" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_CRL_ALREADY_DELTA), "crl already delta" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_CRL_SIGNATURE_ALGORITHM_MISMATCH),
-        "crl signature algorithm mismatch" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_CRL_VERIFY_FAILURE),
-        "crl verify failure" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_DUPLICATE_ATTRIBUTE),
-        "duplicate attribute" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_ERROR_GETTING_MD_BY_NID),
-        "error getting md by nid" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_ERROR_USING_SIGINF_SET),
-        "error using siginf set" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_IDP_MISMATCH), "idp mismatch" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_INVALID_ATTRIBUTES),
-        "invalid attributes" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_INVALID_DIRECTORY), "invalid directory" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_INVALID_DISTPOINT), "invalid distpoint" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_INVALID_FIELD_NAME),
-        "invalid field name" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_INVALID_TRUST), "invalid trust" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_ISSUER_MISMATCH), "issuer mismatch" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_KEY_TYPE_MISMATCH), "key type mismatch" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_KEY_VALUES_MISMATCH),
-        "key values mismatch" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_LOADING_CERT_DIR), "loading cert dir" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_LOADING_DEFAULTS), "loading defaults" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_METHOD_NOT_SUPPORTED),
-        "method not supported" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_NAME_TOO_LONG), "name too long" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_NEWER_CRL_NOT_NEWER),
-        "newer crl not newer" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_NO_CERTIFICATE_FOUND),
-        "no certificate found" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_NO_CERTIFICATE_OR_CRL_FOUND),
-        "no certificate or crl found" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY),
-        "no cert set for us to verify" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_NO_CRL_FOUND), "no crl found" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_NO_CRL_NUMBER), "no crl number" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_PUBLIC_KEY_DECODE_ERROR),
-        "public key decode error" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_PUBLIC_KEY_ENCODE_ERROR),
-        "public key encode error" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_SHOULD_RETRY), "should retry" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN),
-        "unable to find parameters in chain" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY),
-        "unable to get certs public key" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_UNKNOWN_KEY_TYPE), "unknown key type" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_UNKNOWN_NID), "unknown nid" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_UNKNOWN_PURPOSE_ID),
-        "unknown purpose id" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_UNKNOWN_SIGID_ALGS),
-        "unknown sigid algs" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_UNKNOWN_TRUST_ID), "unknown trust id" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_UNSUPPORTED_ALGORITHM),
-        "unsupported algorithm" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_UNSUPPORTED_VERSION),
-        "unsupported version" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_WRONG_LOOKUP_TYPE), "wrong lookup type" },
-    { ERR_PACK(ERR_LIB_X509, 0, X509_R_WRONG_TYPE), "wrong type" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_X509_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(X509_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(X509_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/crypto/x509/x509_ext.c b/deps/openssl/openssl/crypto/x509/x509_ext.c
index e0b54d6daf8..8c9c5d96bcc 100644
--- a/deps/openssl/openssl/crypto/x509/x509_ext.c
+++ b/deps/openssl/openssl/crypto/x509/x509_ext.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -37,28 +37,20 @@ int X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, int lastpos)
     return X509v3_get_ext_by_critical(x->crl.extensions, crit, lastpos);
 }

-X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc)
+const X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc)
 {
     return X509v3_get_ext(x->crl.extensions, loc);
 }

-static X509_EXTENSION *delete_ext(STACK_OF(X509_EXTENSION) **sk, int loc)
+X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc)
 {
-    X509_EXTENSION *ret = X509v3_delete_ext(*sk, loc);
+    X509_EXTENSION *ret = X509v3_delete_extension(&x->crl.extensions, loc);

-    /* Empty extension lists are omitted. */
-    if (*sk != NULL && sk_X509_EXTENSION_num(*sk) == 0) {
-        sk_X509_EXTENSION_pop_free(*sk, X509_EXTENSION_free);
-        *sk = NULL;
-    }
+    if (ret != NULL)
+        x->crl.enc.modified = 1;
     return ret;
 }

-X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc)
-{
-    return delete_ext(&x->crl.extensions, loc);
-}
-
 void *X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, int *idx)
 {
     return X509V3_get_d2i(x->crl.extensions, nid, crit, idx);
@@ -70,7 +62,7 @@ int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
     return X509V3_add1_i2d(&x->crl.extensions, nid, value, crit, flags);
 }

-int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc)
+int X509_CRL_add_ext(X509_CRL *x, const X509_EXTENSION *ex, int loc)
 {
     return (X509v3_add_ext(&(x->crl.extensions), ex, loc) != NULL);
 }
@@ -92,22 +84,43 @@ int X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, int lastpos)

 int X509_get_ext_by_critical(const X509 *x, int crit, int lastpos)
 {
-    return (X509v3_get_ext_by_critical(x->cert_info.extensions, crit, lastpos));
+    return X509v3_get_ext_by_critical(x->cert_info.extensions, crit, lastpos);
 }

-X509_EXTENSION *X509_get_ext(const X509 *x, int loc)
+const X509_EXTENSION *X509_get_ext(const X509 *x, int loc)
 {
     return X509v3_get_ext(x->cert_info.extensions, loc);
 }

 X509_EXTENSION *X509_delete_ext(X509 *x, int loc)
 {
-    return delete_ext(&x->cert_info.extensions, loc);
+    X509_EXTENSION *ret;
+
+    ret = X509v3_delete_extension(&x->cert_info.extensions, loc);
+    if (ret != NULL)
+        x->cert_info.enc.modified = 1;
+    return ret;
 }

-int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc)
+int X509_add_ext(X509 *x, const X509_EXTENSION *ex, int loc)
 {
-    return (X509v3_add_ext(&(x->cert_info.extensions), ex, loc) != NULL);
+    STACK_OF(X509_EXTENSION) **exts = &x->cert_info.extensions;
+
+    /* x->cert_info.extensions might initially be NULL */
+    if (X509v3_add_ext(exts, ex, loc) == NULL)
+        return 0;
+    /*
+     * An ignored "empty" SKID or AKID extension will appear to be successfully
+     * added, even though nothing is pushed onto the resulting stack.  However,
+     * if the stack was initially NULL or empty, it will now be non-NULL, but
+     * empty, deallocate and make it NULL in that case.
+     */
+    if (sk_X509_EXTENSION_num(*exts) == 0) {
+        sk_X509_EXTENSION_free(*exts);
+        *exts = NULL;
+    }
+    x->cert_info.enc.modified = 1;
+    return 1;
 }

 void *X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx)
@@ -118,6 +131,11 @@ void *X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx)
 int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
     unsigned long flags)
 {
+    /*
+     * Assume modified, sadly the underlying function does not tell us whether
+     * changes were made, or not.
+     */
+    x->cert_info.enc.modified = 1;
     return X509V3_add1_i2d(&x->cert_info.extensions, nid, value, crit,
         flags);
 }
@@ -143,14 +161,14 @@ int X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x, int crit, int lastpo
     return X509v3_get_ext_by_critical(x->extensions, crit, lastpos);
 }

-X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *x, int loc)
+const X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *x, int loc)
 {
     return X509v3_get_ext(x->extensions, loc);
 }

 X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc)
 {
-    return delete_ext(&x->extensions, loc);
+    return X509v3_delete_extension(&x->extensions, loc);
 }

 int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc)
diff --git a/deps/openssl/openssl/crypto/x509/x509_local.h b/deps/openssl/openssl/crypto/x509/x509_local.h
index 07c158369fa..a3433336ca0 100644
--- a/deps/openssl/openssl/crypto/x509/x509_local.h
+++ b/deps/openssl/openssl/crypto/x509/x509_local.h
@@ -1,26 +1,44 @@
 /*
- * Copyright 2014-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2014-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
+#if !defined(OSSL_LIBCRYPTO_X509_X509_LOCAL_H)
+#define OSSL_LIBCRYPTO_X509_X509_LOCAL_H
+
+#include <openssl/safestack.h>
+#include <openssl/x509_vfy.h>

 #include "internal/refcount.h"
+#include "internal/hashtable.h"
+
+#include <crypto/asn1.h>

 #define X509V3_conf_add_error_name_value(val) \
     ERR_add_error_data(4, "name=", (val)->name, ", value=", (val)->value)

+/*
+ * Really all I want is CRYPTO_BUFFER from BoringSSL, but let's just do this
+ * for now.
+ */
+typedef struct ossl_x509_buffer_st {
+    const uint8_t *data;
+    size_t len;
+} X509_BUFFER;
+
+DEFINE_STACK_OF(X509_BUFFER)
+
 /*
  * This structure holds all parameters associated with a verify operation by
  * including an X509_VERIFY_PARAM structure in related structures the
  * parameters used can be customized
  */
-
 struct X509_VERIFY_PARAM_st {
     char *name;
-    time_t check_time; /* Time to use */
+    int64_t check_time; /* Time to use */
     uint32_t inh_flags; /* Inheritance flags */
     unsigned long flags; /* Various verify flags */
     int purpose; /* purpose to check untrusted certificates */
@@ -29,13 +47,16 @@ struct X509_VERIFY_PARAM_st {
     int auth_level; /* Security level for chain verification */
     STACK_OF(ASN1_OBJECT) *policies; /* Permissible policies */
     /* Peer identity details */
-    STACK_OF(OPENSSL_STRING) *hosts; /* Set of acceptable names */
+    STACK_OF(X509_BUFFER) *hosts; /* Set of acceptable names */
+    int (*validate_host)(const char *name, size_t len);
+    STACK_OF(X509_BUFFER) *ips; /* Set of acceptable ip addresses */
+    int (*validate_ip)(const uint8_t *name, size_t len);
+    STACK_OF(X509_BUFFER) *rfc822s; /* Set of acceptable RFC 822 names */
+    int (*validate_rfc822)(const char *name, size_t len);
+    STACK_OF(X509_BUFFER) *smtputf8s; /* Set of acceptable SMTP Utf8 names */
+    int (*validate_smtputf8)(const char *name, size_t len);
     unsigned int hostflags; /* Flags to control matching features */
     char *peername; /* Matching hostname in peer certificate */
-    char *email; /* If not NULL email address to match */
-    size_t emaillen;
-    unsigned char *ip; /* If not NULL IP address to match */
-    size_t iplen; /* Length of IP address */
 };

 /* No error callback if depth < 0 */
@@ -106,6 +127,11 @@ struct x509_lookup_st {
     X509_STORE *store_ctx; /* who owns us */
 };

+HT_START_KEY_DEFN(objs_key)
+HT_DEF_KEY_FIELD(xn_canon, unsigned char *)
+HT_DEF_KEY_FIELD(xn_canon_enclen, int)
+HT_END_KEY_DEFN(OBJS_KEY)
+
 /*
  * This is used to hold everything.  It is used for all certificate
  * validation.  Once we have a certificate chain, the 'verify' function is
@@ -114,7 +140,13 @@ struct x509_lookup_st {
 struct x509_store_st {
     /* The following is a cache of trusted certs */
     int cache; /* if true, stash any hits */
-    STACK_OF(X509_OBJECT) *objs; /* Cache of all objects */
+    /* Maps X509_NAME -> STACK_OF(X509_OBJECT) */
+    HT *objs_ht;
+    /*
+     * Deprecated. Used only in the X509_STORE_get0_objects() for backward
+     * compatibility.
+     */
+    STACK_OF(X509_OBJECT) *objs;
     /* These are external lookup methods */
     STACK_OF(X509_LOOKUP) *get_cert_methods;
     X509_VERIFY_PARAM *param;
@@ -124,9 +156,9 @@ struct x509_store_st {
     /* error callback */
     int (*verify_cb)(int ok, X509_STORE_CTX *ctx);
     /* get issuers cert from ctx */
-    int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
+    X509_STORE_CTX_get_issuer_fn get_issuer;
     /* check issued */
-    int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer);
+    X509_STORE_CTX_check_issued_fn check_issued;
     /* Check revocation status of chain */
     int (*check_revocation)(X509_STORE_CTX *ctx);
     /* retrieve CRL */
@@ -137,9 +169,8 @@ struct x509_store_st {
     int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x);
     /* Check policy status of the chain */
     int (*check_policy)(X509_STORE_CTX *ctx);
-    STACK_OF(X509) *(*lookup_certs)(X509_STORE_CTX *ctx,
+    STACK_OF(X509) *(*lookup_certs)(const X509_STORE_CTX *ctx,
         const X509_NAME *nm);
-    /* cannot constify 'ctx' param due to lookup_certs_sk() in x509_vfy.c */
     STACK_OF(X509_CRL) *(*lookup_crls)(const X509_STORE_CTX *ctx,
         const X509_NAME *nm);
     int (*cleanup)(X509_STORE_CTX *ctx);
@@ -155,8 +186,17 @@ DEFINE_STACK_OF(BY_DIR_ENTRY)
 typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
 DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

-int ossl_x509_likely_issued(X509 *issuer, X509 *subject);
+int ossl_ignored_x509_extension(const X509_EXTENSION *ex, int flags);
+int ossl_x509_likely_issued(const X509 *issuer, const X509 *subject);
 int ossl_x509_signing_allowed(const X509 *issuer, const X509 *subject);
 int ossl_x509_store_ctx_get_by_subject(const X509_STORE_CTX *ctx, X509_LOOKUP_TYPE type,
     const X509_NAME *name, X509_OBJECT *ret);
-int ossl_x509_store_read_lock(X509_STORE *xs);
+__owur int ossl_x509_store_read_lock(X509_STORE *xs);
+STACK_OF(X509_OBJECT) *ossl_x509_store_ht_get_by_name(const X509_STORE *store,
+    const X509_NAME *xn);
+int ossl_x509_check_rfc822(X509 *x, const char *chk, size_t chklen,
+    unsigned int flags);
+int ossl_x509_check_smtputf8(X509 *x, const char *chk, size_t chklen,
+    unsigned int flags);
+
+#endif /* !defined(OSSL_LIBCRYPTO_X509_X509_LOCAL_H) */
diff --git a/deps/openssl/openssl/crypto/x509/x509_lu.c b/deps/openssl/openssl/crypto/x509/x509_lu.c
index 00fe2bbe041..94c12475431 100644
--- a/deps/openssl/openssl/crypto/x509/x509_lu.c
+++ b/deps/openssl/openssl/crypto/x509/x509_lu.c
@@ -9,12 +9,16 @@

 #include <stdio.h>
 #include "internal/cryptlib.h"
+#include "internal/hashtable.h"
+#include "internal/hashfunc.h"
 #include "internal/refcount.h"
 #include <openssl/x509.h>
 #include "crypto/x509.h"
 #include <openssl/x509v3.h>
 #include "x509_local.h"

+#define X509_OBJS_HT_BUCKETS 8
+
 X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method)
 {
     X509_LOOKUP *ret = OPENSSL_zalloc(sizeof(*ret));
@@ -179,12 +183,36 @@ static int x509_object_cmp(const X509_OBJECT *const *a,
     return ret;
 }

+static void objs_ht_free(HT_VALUE *v)
+{
+    STACK_OF(X509_OBJECT) *objs = v->value;
+
+    sk_X509_OBJECT_pop_free(objs, X509_OBJECT_free);
+}
+
+static uint64_t obj_ht_hash(HT_KEY *key)
+{
+    OBJS_KEY *k = (OBJS_KEY *)key;
+
+    return ossl_fnv1a_hash(k->keyfields.xn_canon, k->keyfields.xn_canon_enclen);
+}
+
 X509_STORE *X509_STORE_new(void)
 {
     X509_STORE *ret = OPENSSL_zalloc(sizeof(*ret));
+    HT_CONFIG htconf = {
+        .ht_free_fn = objs_ht_free,
+        .ht_hash_fn = obj_ht_hash,
+        .init_neighborhoods = X509_OBJS_HT_BUCKETS,
+        .no_rcu = 1,
+    };

     if (ret == NULL)
         return NULL;
+    if ((ret->objs_ht = ossl_ht_new(&htconf)) == NULL) {
+        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
+        goto err;
+    }
     if ((ret->objs = sk_X509_OBJECT_new(x509_object_cmp)) == NULL) {
         ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
         goto err;
@@ -218,6 +246,7 @@ err:
     X509_VERIFY_PARAM_free(ret->param);
     sk_X509_OBJECT_free(ret->objs);
     sk_X509_LOOKUP_free(ret->get_cert_methods);
+    ossl_ht_free(ret->objs_ht);
     CRYPTO_THREAD_lock_free(ret->lock);
     OPENSSL_free(ret);
     return NULL;
@@ -250,6 +279,7 @@ void X509_STORE_free(X509_STORE *xs)
     X509_VERIFY_PARAM_free(xs->param);
     CRYPTO_THREAD_lock_free(xs->lock);
     CRYPTO_FREE_REF(&xs->references);
+    ossl_ht_free(xs->objs_ht);
     OPENSSL_free(xs);
 }

@@ -257,7 +287,7 @@ int X509_STORE_up_ref(X509_STORE *xs)
 {
     int i;

-    if (CRYPTO_UP_REF(&xs->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&xs->references, &i))
         return 0;

     REF_PRINT_COUNT("X509_STORE", i, xs);
@@ -310,6 +340,93 @@ X509_OBJECT *X509_STORE_CTX_get_obj_by_subject(X509_STORE_CTX *ctx,
     return ret;
 }

+STACK_OF(X509_OBJECT) *ossl_x509_store_ht_get_by_name(const X509_STORE *store,
+    const X509_NAME *xn)
+{
+    HT_VALUE *v;
+    OBJS_KEY key;
+    int ret;
+
+    if (xn->canon_enc == NULL || xn->modified) {
+        ret = i2d_X509_NAME((X509_NAME *)xn, NULL);
+        if (ret < 0)
+            return NULL;
+    }
+
+    HT_INIT_KEY(&key);
+    HT_SET_KEY_FIELD(&key, xn_canon, xn->canon_enc);
+    HT_SET_KEY_FIELD(&key, xn_canon_enclen, xn->canon_enclen);
+    v = ossl_ht_get(store->objs_ht, TO_HT_KEY(&key));
+    if (v == NULL)
+        return NULL;
+    v = ossl_rcu_deref(&v);
+
+    return v->value;
+}
+
+static int x509_name_objs_ht_insert(const X509_STORE *store, const X509_NAME *xn,
+    STACK_OF(X509_OBJECT) *objs, X509_OBJECT *obj)
+{
+    int ret = 0, added = 0;
+    OBJS_KEY key;
+    HT_VALUE val = { 0 };
+
+    if (objs != NULL) {
+        added = sk_X509_OBJECT_push(objs, obj) != 0;
+        return added;
+    }
+
+    if (xn->canon_enc == NULL || xn->modified) {
+        ret = i2d_X509_NAME((X509_NAME *)xn, NULL);
+        if (ret < 0)
+            return 0;
+    }
+
+    objs = sk_X509_OBJECT_new(x509_object_cmp);
+    if (objs == NULL)
+        return 0;
+
+    added = sk_X509_OBJECT_push(objs, obj) != 0;
+    if (added == 0) {
+        sk_X509_OBJECT_free(objs);
+        return 0;
+    }
+
+    HT_INIT_KEY(&key);
+    HT_SET_KEY_FIELD(&key, xn_canon, xn->canon_enc);
+    HT_SET_KEY_FIELD(&key, xn_canon_enclen, xn->canon_enclen);
+    val.value = (void *)objs;
+    ret = ossl_ht_insert(store->objs_ht, TO_HT_KEY(&key), &val, NULL);
+    if (ret != 1) {
+        sk_X509_OBJECT_free(objs);
+        return 0;
+    }
+
+    return 1;
+}
+
+static int obj_ht_foreach_certs(HT_VALUE *v, void *arg)
+{
+    STACK_OF(X509) **sk = arg;
+    STACK_OF(X509_OBJECT) *objs = v->value;
+    int i, r;
+
+    for (i = 0; i < sk_X509_OBJECT_num(objs); i++) {
+        X509 *cert = X509_OBJECT_get0_X509(sk_X509_OBJECT_value(objs, i));
+
+        if (cert == NULL)
+            continue;
+        r = X509_add_cert(*sk, cert, X509_ADD_FLAG_UP_REF);
+        if (r == 0) {
+            OSSL_STACK_OF_X509_free(*sk);
+            *sk = NULL;
+            return 0;
+        }
+    }
+
+    return 1;
+}
+
 /*
  * May be called with |ret| == NULL just for the side effect of
  * caching all certs matching the given subject DN in |ctx->store->objs|.
@@ -322,7 +439,8 @@ int ossl_x509_store_ctx_get_by_subject(const X509_STORE_CTX *ctx, X509_LOOKUP_TY
 {
     X509_STORE *store = ctx->store;
     X509_LOOKUP *lu;
-    X509_OBJECT stmp, *tmp;
+    X509_OBJECT stmp, *tmp = NULL;
+    STACK_OF(X509_OBJECT) *objs;
     int i, j;

     if (store == NULL)
@@ -333,19 +451,13 @@ int ossl_x509_store_ctx_get_by_subject(const X509_STORE_CTX *ctx, X509_LOOKUP_TY

     if (!ossl_x509_store_read_lock(store))
         return 0;
-    /* Should already be sorted...but just in case */
-    if (!sk_X509_OBJECT_is_sorted(store->objs)) {
-        X509_STORE_unlock(store);
-        /* Take a write lock instead of a read lock */
-        if (!X509_STORE_lock(store))
-            return 0;
-        /*
-         * Another thread might have sorted it in the meantime. But if so,
-         * sk_X509_OBJECT_sort() exits early.
-         */
-        sk_X509_OBJECT_sort(store->objs);
+    if (store->objs_ht != NULL) {
+        objs = ossl_x509_store_ht_get_by_name(store, name);
+        if (objs != NULL)
+            tmp = X509_OBJECT_retrieve_by_subject(objs, type, name);
+    } else {
+        tmp = X509_OBJECT_retrieve_by_subject(store->objs, type, name);
     }
-    tmp = X509_OBJECT_retrieve_by_subject(store->objs, type, name);
     X509_STORE_unlock(store);

     if (tmp == NULL || type == X509_LU_CRL) {
@@ -382,25 +494,23 @@ int X509_STORE_CTX_get_by_subject(const X509_STORE_CTX *ctx,
 {
     return ossl_x509_store_ctx_get_by_subject(ctx, type, name, ret) > 0;
 }
-
-static int x509_store_add(X509_STORE *store, void *x, int crl)
+static int x509_store_add_obj(X509_STORE *store, X509_OBJECT *obj)
 {
-    X509_OBJECT *obj;
+    const X509_NAME *xn;
+    STACK_OF(X509_OBJECT) *objs = NULL;
     int ret = 0, added = 0;

-    if (x == NULL)
-        return 0;
-    obj = X509_OBJECT_new();
-    if (obj == NULL)
-        return 0;
+    if (obj->type == X509_LU_CRL)
+        xn = obj->data.crl->crl.issuer;
+    else
+        xn = obj->data.x509->cert_info.subject;

-    if (crl) {
-        obj->type = X509_LU_CRL;
-        obj->data.crl = (X509_CRL *)x;
-    } else {
-        obj->type = X509_LU_X509;
-        obj->data.x509 = (X509 *)x;
+    if (xn == NULL) {
+        obj->type = X509_LU_NONE;
+        X509_OBJECT_free(obj);
+        return 0;
     }
+
     if (!X509_OBJECT_up_ref_count(obj)) {
         obj->type = X509_LU_NONE;
         X509_OBJECT_free(obj);
@@ -412,11 +522,21 @@ static int x509_store_add(X509_STORE *store, void *x, int crl)
         return 0;
     }

-    if (X509_OBJECT_retrieve_match(store->objs, obj)) {
-        ret = 1;
+    if (store->objs_ht != NULL) {
+        objs = ossl_x509_store_ht_get_by_name(store, xn);
+        if (objs != NULL && X509_OBJECT_retrieve_match(objs, obj)) {
+            ret = 1;
+        } else {
+            added = x509_name_objs_ht_insert(store, xn, objs, obj);
+            ret = added != 0;
+        }
     } else {
-        added = sk_X509_OBJECT_push(store->objs, obj);
-        ret = added != 0;
+        if (X509_OBJECT_retrieve_match(store->objs, obj)) {
+            ret = 1;
+        } else {
+            added = sk_X509_OBJECT_push(store->objs, obj);
+            ret = added != 0;
+        }
     }
     X509_STORE_unlock(store);

@@ -426,9 +546,45 @@ static int x509_store_add(X509_STORE *store, void *x, int crl)
     return ret;
 }

-int X509_STORE_add_cert(X509_STORE *xs, X509 *x)
+static int x509_store_add_x509(X509_STORE *store, const X509 *x)
+{
+    X509_OBJECT *obj;
+
+    if (x == NULL)
+        return 0;
+    obj = X509_OBJECT_new();
+    if (obj == NULL)
+        return 0;
+
+    obj->type = X509_LU_X509;
+    /*
+     * XXX Casts away const, get rid of this once we can have the x509
+     * member of OBJECT be const.
+     */
+    obj->data.x509 = (X509 *)x;
+
+    return x509_store_add_obj(store, obj);
+}
+
+static int x509_store_add_crl(X509_STORE *store, X509_CRL *crl)
 {
-    if (!x509_store_add(xs, x, 0)) {
+    X509_OBJECT *obj;
+
+    if (crl == NULL)
+        return 0;
+    obj = X509_OBJECT_new();
+    if (obj == NULL)
+        return 0;
+
+    obj->type = X509_LU_CRL;
+    obj->data.crl = crl;
+
+    return x509_store_add_obj(store, obj);
+}
+
+int X509_STORE_add_cert(X509_STORE *xs, const X509 *x)
+{
+    if (!x509_store_add_x509(xs, x)) {
         ERR_raise(ERR_LIB_X509, ERR_R_X509_LIB);
         return 0;
     }
@@ -437,7 +593,7 @@ int X509_STORE_add_cert(X509_STORE *xs, X509 *x)

 int X509_STORE_add_crl(X509_STORE *xs, X509_CRL *x)
 {
-    if (!x509_store_add(xs, x, 1)) {
+    if (!x509_store_add_crl(xs, x)) {
         ERR_raise(ERR_LIB_X509, ERR_R_X509_LIB);
         return 0;
     }
@@ -577,11 +733,6 @@ X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,
     return sk_X509_OBJECT_value(h, idx);
 }

-STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(const X509_STORE *xs)
-{
-    return xs->objs;
-}
-
 static X509_OBJECT *x509_object_dup(const X509_OBJECT *obj)
 {
     X509_OBJECT *ret = X509_OBJECT_new();
@@ -599,6 +750,83 @@ static X509_OBJECT *x509_object_dup(const X509_OBJECT *obj)
     return ret;
 }

+#ifndef OPENSSL_NO_DEPRECATED_4_0
+static int obj_ht_to_stack(HT_VALUE *v, void *arg)
+{
+    STACK_OF(X509_OBJECT) **sk = arg;
+    STACK_OF(X509_OBJECT) *objs = v->value;
+    X509_OBJECT *obj;
+    int i;
+
+    for (i = 0; i < sk_X509_OBJECT_num(objs); i++) {
+        obj = sk_X509_OBJECT_value(objs, i);
+        if (sk_X509_OBJECT_push(*sk, obj) == 0)
+            goto err;
+    }
+
+    return 1;
+
+err:
+    sk_X509_OBJECT_zero(*sk);
+
+    return 0;
+}
+
+static int obj_ht_zero_stacks(HT_VALUE *v, void *arg)
+{
+    STACK_OF(X509_OBJECT) *objs = v->value;
+
+    sk_X509_OBJECT_zero(objs);
+
+    return 1;
+}
+
+STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(const X509_STORE *xs)
+{
+    X509_STORE *store = (X509_STORE *)xs;
+
+    if (xs->objs_ht != NULL) {
+        ossl_ht_foreach_until(xs->objs_ht, obj_ht_to_stack, &store->objs);
+        if (sk_X509_OBJECT_num(store->objs) > 0
+            || ossl_ht_count(xs->objs_ht) == 0) {
+            ossl_ht_foreach_until(xs->objs_ht, obj_ht_zero_stacks, NULL);
+            ossl_ht_free(xs->objs_ht);
+            store->objs_ht = NULL;
+        } else {
+            return NULL;
+        }
+    }
+
+    return xs->objs;
+}
+#endif
+
+static int obj_ht_foreach_object(HT_VALUE *v, void *arg)
+{
+    STACK_OF(X509_OBJECT) **sk = arg;
+    STACK_OF(X509_OBJECT) *objs = v->value;
+    X509_OBJECT *dup, *obj;
+    int i;
+
+    for (i = 0; i < sk_X509_OBJECT_num(objs); i++) {
+        obj = sk_X509_OBJECT_value(objs, i);
+        dup = x509_object_dup(obj);
+        if (dup == NULL)
+            goto err;
+        if (sk_X509_OBJECT_push(*sk, dup) == 0)
+            goto err;
+    }
+
+    return 1;
+
+err:
+    X509_OBJECT_free(dup);
+    sk_X509_OBJECT_pop_free(*sk, X509_OBJECT_free);
+    *sk = NULL;
+
+    return 0;
+}
+
 STACK_OF(X509_OBJECT) *X509_STORE_get1_objects(X509_STORE *store)
 {
     STACK_OF(X509_OBJECT) *objs;
@@ -611,17 +839,24 @@ STACK_OF(X509_OBJECT) *X509_STORE_get1_objects(X509_STORE *store)
     if (!ossl_x509_store_read_lock(store))
         return NULL;

-    objs = sk_X509_OBJECT_deep_copy(store->objs, x509_object_dup,
-        X509_OBJECT_free);
+    if (store->objs_ht != NULL) {
+        if ((objs = sk_X509_OBJECT_new(x509_object_cmp)) == NULL) {
+            X509_STORE_unlock(store);
+            return NULL;
+        }
+        ossl_ht_foreach_until(store->objs_ht, obj_ht_foreach_object, &objs);
+    } else {
+        objs = sk_X509_OBJECT_deep_copy(store->objs, x509_object_dup,
+            X509_OBJECT_free);
+    }
     X509_STORE_unlock(store);
+
     return objs;
 }

 STACK_OF(X509) *X509_STORE_get1_all_certs(X509_STORE *store)
 {
-    STACK_OF(X509) *sk;
-    STACK_OF(X509_OBJECT) *objs;
-    int i;
+    STACK_OF(X509) *sk = NULL;

     if (store == NULL) {
         ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
@@ -629,19 +864,23 @@ STACK_OF(X509) *X509_STORE_get1_all_certs(X509_STORE *store)
     }
     if ((sk = sk_X509_new_null()) == NULL)
         return NULL;
-    if (!X509_STORE_lock(store))
+
+    if (!ossl_x509_store_read_lock(store))
         goto out_free;

-    sk_X509_OBJECT_sort(store->objs);
-    objs = X509_STORE_get0_objects(store);
-    for (i = 0; i < sk_X509_OBJECT_num(objs); i++) {
-        X509 *cert = X509_OBJECT_get0_X509(sk_X509_OBJECT_value(objs, i));
+    if (store->objs_ht != NULL) {
+        ossl_ht_foreach_until(store->objs_ht, obj_ht_foreach_certs, &sk);
+    } else {
+        for (int i = 0; i < sk_X509_OBJECT_num(store->objs); i++) {
+            X509 *cert = X509_OBJECT_get0_X509(sk_X509_OBJECT_value(store->objs, i));

-        if (cert != NULL
-            && !X509_add_cert(sk, cert, X509_ADD_FLAG_UP_REF))
-            goto err;
+            if (cert != NULL
+                && !X509_add_cert(sk, cert, X509_ADD_FLAG_UP_REF))
+                goto err;
+        }
     }
     X509_STORE_unlock(store);
+
     return sk;

 err:
@@ -655,24 +894,31 @@ out_free:
  * Collect from |ctx->store| all certs with subject matching |nm|.
  * Returns NULL on internal/fatal error, empty stack if not found.
  */
-STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *ctx,
+STACK_OF(X509) *X509_STORE_CTX_get1_certs(const X509_STORE_CTX *ctx,
     const X509_NAME *nm)
 {
-    int i, idx, cnt;
+    int i, idx = -1, cnt = 0;
     STACK_OF(X509) *sk = NULL;
     X509 *x;
     X509_OBJECT *obj;
     X509_STORE *store = ctx->store;
+    STACK_OF(X509_OBJECT) *objs;

     if (store == NULL)
         return sk_X509_new_null();

-    if (!X509_STORE_lock(store))
+    if (!ossl_x509_store_read_lock(store))
         return NULL;

-    sk_X509_OBJECT_sort(store->objs);
-    idx = x509_object_idx_cnt(store->objs, X509_LU_X509, nm, &cnt);
-    if (idx < 0) {
+    if (store->objs_ht != NULL) {
+        objs = ossl_x509_store_ht_get_by_name(store, nm);
+        if (objs != NULL)
+            idx = x509_object_idx_cnt(objs, X509_LU_X509, nm, &cnt);
+    } else {
+        objs = store->objs;
+        idx = x509_object_idx_cnt(objs, X509_LU_X509, nm, &cnt);
+    }
+    if (idx < 0 || objs == NULL) {
         /*
          * Nothing found in cache: do lookup to possibly add new objects to
          * cache
@@ -681,24 +927,33 @@ STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *ctx,
         i = ossl_x509_store_ctx_get_by_subject(ctx, X509_LU_X509, nm, NULL);
         if (i <= 0)
             return i < 0 ? NULL : sk_X509_new_null();
-        if (!X509_STORE_lock(store))
+        if (!ossl_x509_store_read_lock(store))
             return NULL;
-        sk_X509_OBJECT_sort(store->objs);
-        idx = x509_object_idx_cnt(store->objs, X509_LU_X509, nm, &cnt);
+        if (store->objs_ht != NULL) {
+            objs = ossl_x509_store_ht_get_by_name(store, nm);
+            if (objs == NULL)
+                goto end;
+        } else {
+            objs = store->objs;
+        }
+        idx = x509_object_idx_cnt(objs, X509_LU_X509, nm, &cnt);
     }

     sk = sk_X509_new_null();
     if (idx < 0 || sk == NULL)
         goto end;
-    for (i = 0; i < cnt; i++, idx++) {
-        obj = sk_X509_OBJECT_value(store->objs, idx);
+    for (i = idx; i < sk_X509_OBJECT_num(objs); i++) {
+        obj = sk_X509_OBJECT_value(objs, i);
         x = obj->data.x509;
-        if (!X509_add_cert(sk, x, X509_ADD_FLAG_UP_REF)) {
+        if (obj->type != X509_LU_X509)
+            continue;
+        if (X509_add_cert(sk, x, X509_ADD_FLAG_UP_REF) == 0) {
             X509_STORE_unlock(store);
             OSSL_STACK_OF_X509_free(sk);
             return NULL;
         }
     }
+
 end:
     X509_STORE_unlock(store);
     return sk;
@@ -708,11 +963,12 @@ end:
 STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(const X509_STORE_CTX *ctx,
     const X509_NAME *nm)
 {
-    int i = 1, idx, cnt;
+    int i = 1, idx, cnt = 0;
     STACK_OF(X509_CRL) *sk;
     X509_CRL *x;
     X509_OBJECT *obj;
     X509_STORE *store = ctx->store;
+    STACK_OF(X509_OBJECT) *objs;

     /* Always do lookup to possibly add new CRLs to cache */
     i = ossl_x509_store_ctx_get_by_subject(ctx, X509_LU_CRL, nm, NULL);
@@ -721,20 +977,26 @@ STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(const X509_STORE_CTX *ctx,
     sk = sk_X509_CRL_new_null();
     if (i == 0)
         return sk;
-    if (!X509_STORE_lock(store)) {
+    if (!ossl_x509_store_read_lock(store)) {
         sk_X509_CRL_free(sk);
         return NULL;
     }
-    sk_X509_OBJECT_sort(store->objs);
-    idx = x509_object_idx_cnt(store->objs, X509_LU_CRL, nm, &cnt);
-    if (idx < 0) {
-        X509_STORE_unlock(store);
-        return sk;
+    if (store->objs_ht) {
+        objs = ossl_x509_store_ht_get_by_name(store, nm);
+        if (objs == NULL)
+            goto end;
+    } else {
+        objs = store->objs;
     }
+    idx = x509_object_idx_cnt(objs, X509_LU_CRL, nm, &cnt);
+    if (idx < 0)
+        goto end;

-    for (i = 0; i < cnt; i++, idx++) {
-        obj = sk_X509_OBJECT_value(store->objs, idx);
+    for (i = idx; i < sk_X509_OBJECT_num(objs); i++) {
+        obj = sk_X509_OBJECT_value(objs, i);
         x = obj->data.crl;
+        if (obj->type != X509_LU_CRL)
+            continue;
         if (!X509_CRL_up_ref(x)) {
             X509_STORE_unlock(store);
             sk_X509_CRL_pop_free(sk, X509_CRL_free);
@@ -747,6 +1009,7 @@ STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(const X509_STORE_CTX *ctx,
             return NULL;
         }
     }
+end:
     X509_STORE_unlock(store);
     return sk;
 }
diff --git a/deps/openssl/openssl/crypto/x509/x509_meth.c b/deps/openssl/openssl/crypto/x509/x509_meth.c
index e7b228a33f3..96de9b90861 100644
--- a/deps/openssl/openssl/crypto/x509/x509_meth.c
+++ b/deps/openssl/openssl/crypto/x509/x509_meth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,6 +17,8 @@
 #include <openssl/types.h>
 #include "x509_local.h"

+#include <crypto/asn1.h>
+
 X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name)
 {
     X509_LOOKUP_METHOD *method = OPENSSL_zalloc(sizeof(X509_LOOKUP_METHOD));
diff --git a/deps/openssl/openssl/crypto/x509/x509_obj.c b/deps/openssl/openssl/crypto/x509/x509_obj.c
index 2b313dd52be..e2924a62da4 100644
--- a/deps/openssl/openssl/crypto/x509/x509_obj.c
+++ b/deps/openssl/openssl/crypto/x509/x509_obj.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -67,7 +67,7 @@ char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len)
             i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object);
             s = tmp_buf;
         }
-        l1 = strlen(s);
+        l1 = (int)strlen(s);

         type = ne->value->type;
         num = ne->value->length;
diff --git a/deps/openssl/openssl/crypto/x509/x509_r2x.c b/deps/openssl/openssl/crypto/x509/x509_r2x.c
index b373a2caa42..714ac7222ee 100644
--- a/deps/openssl/openssl/crypto/x509/x509_r2x.c
+++ b/deps/openssl/openssl/crypto/x509/x509_r2x.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,7 +17,7 @@
 #include <openssl/objects.h>
 #include <openssl/buffer.h>

-X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
+X509 *X509_REQ_to_X509(const X509_REQ *r, int days, EVP_PKEY *pkey)
 {
     X509 *ret = NULL;
     X509_CINF *xi = NULL;
diff --git a/deps/openssl/openssl/crypto/x509/x509_req.c b/deps/openssl/openssl/crypto/x509/x509_req.c
index b968c3f41ba..90f9b641f71 100644
--- a/deps/openssl/openssl/crypto/x509/x509_req.c
+++ b/deps/openssl/openssl/crypto/x509/x509_req.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,7 +19,7 @@
 #include <openssl/buffer.h>
 #include <openssl/pem.h>

-X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md)
+X509_REQ *X509_to_X509_REQ(const X509 *x, EVP_PKEY *pkey, const EVP_MD *md)
 {
     X509_REQ *ret;
     X509_REQ_INFO *ri;
@@ -74,7 +74,7 @@ EVP_PKEY *X509_REQ_get0_pubkey(const X509_REQ *req)
     return X509_PUBKEY_get0(req->req_info.pubkey);
 }

-X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req)
+X509_PUBKEY *X509_REQ_get_X509_PUBKEY(const X509_REQ *req)
 {
     return req->req_info.pubkey;
 }
@@ -117,11 +117,11 @@ void X509_REQ_set_extension_nids(int *nids)
     ext_nids = nids;
 }

-static STACK_OF(X509_EXTENSION) *get_extensions_by_nid(const X509_REQ *req,
-    int nid)
+STACK_OF(X509_EXTENSION) *
+ossl_x509_req_get1_extensions_by_nid(const X509_REQ *req, int nid)
 {
     X509_ATTRIBUTE *attr;
-    ASN1_TYPE *ext = NULL;
+    const ASN1_TYPE *ext = NULL;
     const unsigned char *p;
     int idx = X509_REQ_get_attr_by_NID(req, nid, -1);

@@ -139,7 +139,7 @@ static STACK_OF(X509_EXTENSION) *get_extensions_by_nid(const X509_REQ *req,
             ASN1_ITEM_rptr(X509_EXTENSIONS));
 }

-STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(OSSL_FUTURE_CONST X509_REQ *req)
+STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(const X509_REQ *req)
 {
     STACK_OF(X509_EXTENSION) *exts = NULL;
     int *pnid;
@@ -147,7 +147,7 @@ STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(OSSL_FUTURE_CONST X509_REQ *re
     if (req == NULL || ext_nids == NULL)
         return NULL;
     for (pnid = ext_nids; *pnid != NID_undef; pnid++) {
-        exts = get_extensions_by_nid(req, *pnid);
+        exts = ossl_x509_req_get1_extensions_by_nid(req, *pnid);
         if (exts == NULL)
             return NULL;
         if (sk_X509_EXTENSION_num(exts) > 0)
@@ -176,7 +176,7 @@ int X509_REQ_add_extensions_nid(X509_REQ *req,

     loc = X509at_get_attr_by_NID(req->req_info.attributes, nid, -1);
     if (loc != -1) {
-        if ((mod_exts = get_extensions_by_nid(req, nid)) == NULL)
+        if ((mod_exts = ossl_x509_req_get1_extensions_by_nid(req, nid)) == NULL)
             return 0;
         if (X509v3_add_extensions(&mod_exts, exts) == NULL)
             goto end;
@@ -308,7 +308,7 @@ long X509_REQ_get_version(const X509_REQ *req)
     return ASN1_INTEGER_get(req->req_info.version);
 }

-X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req)
+const X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req)
 {
     return req->req_info.subject;
 }
diff --git a/deps/openssl/openssl/crypto/x509/x509_set.c b/deps/openssl/openssl/crypto/x509/x509_set.c
index e6912748ccd..11439bcafb9 100644
--- a/deps/openssl/openssl/crypto/x509/x509_set.c
+++ b/deps/openssl/openssl/crypto/x509/x509_set.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,6 +17,7 @@
 #include <openssl/x509v3.h>
 #include "crypto/asn1.h"
 #include "crypto/x509.h"
+#include "crypto/evp.h"
 #include "x509_local.h"

 int X509_set_version(X509 *x, long version)
@@ -116,7 +117,7 @@ int X509_up_ref(X509 *x)
 {
     int i;

-    if (CRYPTO_UP_REF(&x->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&x->references, &i))
         return 0;

     REF_PRINT_COUNT("X509", i, x);
@@ -139,12 +140,12 @@ const ASN1_TIME *X509_get0_notAfter(const X509 *x)
     return x->cert_info.validity.notAfter;
 }

-ASN1_TIME *X509_getm_notBefore(const X509 *x)
+ASN1_TIME *X509_getm_notBefore(X509 *x)
 {
     return x->cert_info.validity.notBefore;
 }

-ASN1_TIME *X509_getm_notAfter(const X509 *x)
+ASN1_TIME *X509_getm_notAfter(X509 *x)
 {
     return x->cert_info.validity.notAfter;
 }
@@ -154,7 +155,7 @@ int X509_get_signature_type(const X509 *x)
     return EVP_PKEY_type(OBJ_obj2nid(x->sig_alg.algorithm));
 }

-X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x)
+const X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x)
 {
     return x->cert_info.key;
 }
@@ -201,7 +202,7 @@ void X509_SIG_INFO_set(X509_SIG_INFO *siginf, int mdnid, int pknid,
     siginf->flags = flags;
 }

-int X509_get_signature_info(X509 *x, int *mdnid, int *pknid, int *secbits,
+int X509_get_signature_info(const X509 *x, int *mdnid, int *pknid, int *secbits,
     uint32_t *flags)
 {
     X509_check_purpose(x, -1, -1);
@@ -210,10 +211,11 @@ int X509_get_signature_info(X509 *x, int *mdnid, int *pknid, int *secbits,

 /* Modify *siginf according to alg and sig. Return 1 on success, else 0. */
 static int x509_sig_info_init(X509_SIG_INFO *siginf, const X509_ALGOR *alg,
-    const ASN1_STRING *sig, const EVP_PKEY *pubkey)
+    const ASN1_STRING *sig, const EVP_PKEY *pubkey,
+    OSSL_LIB_CTX *libctx, const char *propq)
 {
     int pknid, mdnid, md_size;
-    const EVP_MD *md;
+    EVP_MD *md;
     const EVP_PKEY_ASN1_METHOD *ameth;

     siginf->mdnid = NID_undef;
@@ -231,7 +233,7 @@ static int x509_sig_info_init(X509_SIG_INFO *siginf, const X509_ALGOR *alg,
     switch (mdnid) {
     case NID_undef:
         /* If we have one, use a custom handler for this algorithm */
-        ameth = EVP_PKEY_asn1_find(NULL, pknid);
+        ameth = evp_pkey_asn1_find(pknid);
         if (ameth != NULL && ameth->siginf_set != NULL
             && ameth->siginf_set(siginf, alg, sig))
             break;
@@ -275,11 +277,25 @@ static int x509_sig_info_init(X509_SIG_INFO *siginf, const X509_ALGOR *alg,
         break;
     default:
         /* Security bits: half number of bits in digest */
-        if ((md = EVP_get_digestbynid(mdnid)) == NULL) {
-            ERR_raise(ERR_LIB_X509, X509_R_ERROR_GETTING_MD_BY_NID);
-            return 0;
+        {
+            char md_name[80];
+            ASN1_OBJECT *md_obj = OBJ_nid2obj(mdnid);
+
+            if (md_obj == NULL
+                || i2t_ASN1_OBJECT(md_name, sizeof(md_name), md_obj) <= 0) {
+                ERR_raise_data(ERR_LIB_X509, X509_R_ERROR_GETTING_MD_BY_NID,
+                    "nid=%d", mdnid);
+                return 0;
+            }
+            md = EVP_MD_fetch(libctx, md_name, propq);
+            if (md == NULL) {
+                ERR_raise_data(ERR_LIB_X509, X509_R_ERROR_GETTING_MD_BY_NID,
+                    "nid=%d name=%s", mdnid, md_name);
+                return 0;
+            }
         }
         md_size = EVP_MD_get_size(md);
+        EVP_MD_free(md);
         if (md_size <= 0)
             return 0;
         siginf->secbits = md_size * 4;
@@ -297,8 +313,8 @@ static int x509_sig_info_init(X509_SIG_INFO *siginf, const X509_ALGOR *alg,
 }

 /* Returns 1 on success, 0 on failure */
-int ossl_x509_init_sig_info(X509 *x)
+int ossl_x509_init_sig_info(const X509 *x, X509_SIG_INFO *info)
 {
-    return x509_sig_info_init(&x->siginf, &x->sig_alg, &x->signature,
-        X509_PUBKEY_get0(x->cert_info.key));
+    return x509_sig_info_init(info, &x->sig_alg, &x->signature,
+        X509_PUBKEY_get0(x->cert_info.key), x->libctx, x->propq);
 }
diff --git a/deps/openssl/openssl/crypto/x509/x509_trust.c b/deps/openssl/openssl/crypto/x509/x509_trust.c
index 5c8c81764e6..4b9d82aeafd 100644
--- a/deps/openssl/openssl/crypto/x509/x509_trust.c
+++ b/deps/openssl/openssl/crypto/x509/x509_trust.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,12 +15,12 @@
 static int tr_cmp(const X509_TRUST *const *a, const X509_TRUST *const *b);
 static void trtable_free(X509_TRUST *p);

-static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags);
-static int trust_1oid(X509_TRUST *trust, X509 *x, int flags);
-static int trust_compat(X509_TRUST *trust, X509 *x, int flags);
+static int trust_1oidany(X509_TRUST *trust, const X509 *x, int flags);
+static int trust_1oid(X509_TRUST *trust, const X509 *x, int flags);
+static int trust_compat(X509_TRUST *trust, const X509 *x, int flags);

-static int obj_trust(int id, X509 *x, int flags);
-static int (*default_trust)(int id, X509 *x, int flags) = obj_trust;
+static int obj_trust(int id, const X509 *x, int flags);
+static int (*default_trust)(int id, const X509 *x, int flags) = obj_trust;

 /*
  * WARNING: the following table should be kept in order of trust and without
@@ -54,17 +54,17 @@ static int tr_cmp(const X509_TRUST *const *a, const X509_TRUST *const *b)
     return (*a)->trust - (*b)->trust;
 }

-int (*X509_TRUST_set_default(int (*trust)(int, X509 *, int)))(int, X509 *,
+int (*X509_TRUST_set_default(int (*trust)(int, const X509 *, int)))(int, const X509 *,
     int)
 {
-    int (*oldtrust)(int, X509 *, int);
+    int (*oldtrust)(int, const X509 *, int);
     oldtrust = default_trust;
     default_trust = trust;
     return oldtrust;
 }

 /* Returns X509_TRUST_TRUSTED, X509_TRUST_REJECTED, or X509_TRUST_UNTRUSTED */
-int X509_check_trust(X509 *x, int id, int flags)
+int X509_check_trust(const X509 *x, int id, int flags)
 {
     X509_TRUST *pt;
     int idx;
@@ -124,7 +124,7 @@ int X509_TRUST_set(int *t, int trust)
     return 1;
 }

-int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),
+int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, const X509 *, int),
     const char *name, int arg1, void *arg2)
 {
     int idx;
@@ -214,7 +214,7 @@ int X509_TRUST_get_trust(const X509_TRUST *xp)
     return xp->trust;
 }

-static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags)
+static int trust_1oidany(X509_TRUST *trust, const X509 *x, int flags)
 {
     /*
      * Declare the chain verified if the desired trust OID is not rejected in
@@ -226,7 +226,7 @@ static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags)
     return obj_trust(trust->arg1, x, flags);
 }

-static int trust_1oid(X509_TRUST *trust, X509 *x, int flags)
+static int trust_1oid(X509_TRUST *trust, const X509 *x, int flags)
 {
     /*
      * Declare the chain verified only if the desired trust OID is not
@@ -237,7 +237,7 @@ static int trust_1oid(X509_TRUST *trust, X509 *x, int flags)
     return obj_trust(trust->arg1, x, flags);
 }

-static int trust_compat(X509_TRUST *trust, X509 *x, int flags)
+static int trust_compat(X509_TRUST *trust, const X509 *x, int flags)
 {
     /* Call for side-effect of setting EXFLAG_SS for self-signed-certs */
     if (X509_check_purpose(x, -1, 0) != 1)
@@ -248,7 +248,14 @@ static int trust_compat(X509_TRUST *trust, X509 *x, int flags)
         return X509_TRUST_UNTRUSTED;
 }

-static int obj_trust(int id, X509 *x, int flags)
+/*
+ * |id| is the NID of the extended key usage (EKU) to check for certificate |x|.
+ * Return X509_TRUST_REJECTED if negative trust attributes of |x| prevents it.
+ * Return X509_TRUST_TRUSTED if positive trust attributes of |x| accepts it.
+ * If |flags| includes X509_TRUST_OK_ANY_EKU then anyEKU serves as wildcard.
+ * Return X509_TRUST_UNTRUSTED if no clear decision has been reached here.
+ */
+static int obj_trust(int id, const X509 *x, int flags)
 {
     X509_CERT_AUX *ax = x->aux;
     int i;
diff --git a/deps/openssl/openssl/crypto/x509/x509_txt.c b/deps/openssl/openssl/crypto/x509/x509_txt.c
index b88bd290d0a..3a77e52f32b 100644
--- a/deps/openssl/openssl/crypto/x509/x509_txt.c
+++ b/deps/openssl/openssl/crypto/x509/x509_txt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -40,7 +40,7 @@ const char *X509_verify_cert_error_string(long n)
     case X509_V_ERR_CRL_SIGNATURE_FAILURE:
         return "CRL signature failure";
     case X509_V_ERR_CERT_NOT_YET_VALID:
-        return "certificate is not yet valid";
+        return "certificate is not yet valid or the system clock is incorrect";
     case X509_V_ERR_CERT_HAS_EXPIRED:
         return "certificate has expired";
     case X509_V_ERR_CRL_NOT_YET_VALID:
@@ -173,6 +173,16 @@ const char *X509_verify_cert_error_string(long n)
         return "OCSP verification failed";
     case X509_V_ERR_OCSP_CERT_UNKNOWN:
         return "OCSP unknown cert";
+    case X509_V_ERR_OCSP_RESP_INVALID:
+        return "OCSP response(s) invalid";
+    case X509_V_ERR_OCSP_SIGNATURE_FAILURE:
+        return "OCSP response signature verification failure";
+    case X509_V_ERR_OCSP_NOT_YET_VALID:
+        return "OCSP response not yet valid (contains a date in the future)";
+    case X509_V_ERR_OCSP_HAS_EXPIRED:
+        return "OCSP response has expired";
+    case X509_V_ERR_OCSP_NO_RESPONSE:
+        return "no OCSP response available for certificate";
     case X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM:
         return "Cannot find certificate signature algorithm";
     case X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH:
@@ -213,6 +223,12 @@ const char *X509_verify_cert_error_string(long n)
         return "Certificate public key has explicit ECC parameters";
     case X509_V_ERR_RPK_UNTRUSTED:
         return "Raw public key untrusted, no trusted keys configured";
+    case X509_V_ERR_EMPTY_AUTHORITY_KEY_IDENTIFIER:
+        return "Empty Authority Key Identifier";
+    case X509_V_ERR_AKID_ISSUER_SERIAL_NOT_PAIRED:
+        return "Authority Key Identifier issuer and serial number must be paired";
+    case X509_V_ERR_DUPLICATE_EXTENSION:
+        return "Certificate includes more than one instance of a particular extension";

         /*
          * Entries must be kept consistent with include/openssl/x509_vfy.h.in
diff --git a/deps/openssl/openssl/crypto/x509/x509_v3.c b/deps/openssl/openssl/crypto/x509/x509_v3.c
index 611a5dabd61..d3fc1141638 100644
--- a/deps/openssl/openssl/crypto/x509/x509_v3.c
+++ b/deps/openssl/openssl/crypto/x509/x509_v3.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,6 +17,8 @@
 #include <openssl/x509v3.h>
 #include "x509_local.h"

+#include <crypto/asn1.h>
+
 int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x)
 {
     int ret;
@@ -80,7 +82,7 @@ int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *sk, int crit,
     return -1;
 }

-X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
+const X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
 {
     if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
         return NULL;
@@ -90,16 +92,27 @@ X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)

 X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc)
 {
-    X509_EXTENSION *ret;
+    return sk_X509_EXTENSION_delete(x, loc);
+}

-    if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
+X509_EXTENSION *X509v3_delete_extension(STACK_OF(X509_EXTENSION) **x, int loc)
+{
+    X509_EXTENSION *ext;
+
+    if (x == NULL)
         return NULL;
-    ret = sk_X509_EXTENSION_delete(x, loc);
-    return ret;
+
+    /* Set extensions to NULL when last element dropped */
+    if ((ext = X509v3_delete_ext(*x, loc)) != NULL
+        && sk_X509_EXTENSION_num(*x) == 0) {
+        sk_X509_EXTENSION_free(*x);
+        *x = NULL;
+    }
+    return ext;
 }

 STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
-    X509_EXTENSION *ex, int loc)
+    const X509_EXTENSION *ex, int loc)
 {
     X509_EXTENSION *new_ex = NULL;
     int n;
@@ -118,6 +131,9 @@ STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
     } else
         sk = *x;

+    if (ossl_ignored_x509_extension(ex, X509V3_ADD_SILENT))
+        goto done;
+
     n = sk_X509_EXTENSION_num(sk);
     if (loc > n)
         loc = n;
@@ -132,6 +148,7 @@ STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
         ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
         goto err;
     }
+done:
     if (*x == NULL)
         *x = sk;
     return sk;
@@ -154,8 +171,8 @@ STACK_OF(X509_EXTENSION) *X509v3_add_extensions(STACK_OF(X509_EXTENSION) **targe
     }

     for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) {
-        X509_EXTENSION *ext = sk_X509_EXTENSION_value(exts, i);
-        ASN1_OBJECT *obj = X509_EXTENSION_get_object(ext);
+        const X509_EXTENSION *ext = sk_X509_EXTENSION_value(exts, i);
+        const ASN1_OBJECT *obj = X509_EXTENSION_get_object(ext);
         int idx = X509v3_get_ext_by_OBJ(*target, obj, -1);

         /* Does extension exist in target? */
@@ -237,7 +254,7 @@ int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit)
     return 1;
 }

-int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data)
+int X509_EXTENSION_set_data(X509_EXTENSION *ex, const ASN1_OCTET_STRING *data)
 {
     int i;

@@ -249,14 +266,14 @@ int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data)
     return 1;
 }

-ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex)
+const ASN1_OBJECT *X509_EXTENSION_get_object(const X509_EXTENSION *ex)
 {
     if (ex == NULL)
         return NULL;
     return ex->object;
 }

-ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ex)
+const ASN1_OCTET_STRING *X509_EXTENSION_get_data(const X509_EXTENSION *ex)
 {
     if (ex == NULL)
         return NULL;
diff --git a/deps/openssl/openssl/crypto/x509/x509_vfy.c b/deps/openssl/openssl/crypto/x509/x509_vfy.c
index 091c1530898..032a86d03ab 100644
--- a/deps/openssl/openssl/crypto/x509/x509_vfy.c
+++ b/deps/openssl/openssl/crypto/x509/x509_vfy.c
@@ -7,6 +7,7 @@
  * https://www.openssl.org/source/license.html
  */

+#define OPENSSL_SUPPRESS_DEPRECATED
 #include "internal/deprecated.h"

 #include <stdio.h>
@@ -22,7 +23,9 @@
 #include <openssl/asn1.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
+#include <openssl/ocsp.h>
 #include <openssl/objects.h>
+#include <openssl/posix_time.h>
 #include <openssl/core_names.h>
 #include "internal/dane.h"
 #include "crypto/x509.h"
@@ -49,13 +52,17 @@ static int verify_rpk(X509_STORE_CTX *ctx);
 static int dane_verify(X509_STORE_CTX *ctx);
 static int dane_verify_rpk(X509_STORE_CTX *ctx);
 static int null_callback(int ok, X509_STORE_CTX *e);
-static int check_issued(X509_STORE_CTX *ctx, X509 *x, X509 *issuer);
+static int check_issued(X509_STORE_CTX *ctx, const X509 *x, const X509 *issuer);
 static int check_extensions(X509_STORE_CTX *ctx);
 static int check_name_constraints(X509_STORE_CTX *ctx);
 static int check_id(X509_STORE_CTX *ctx);
 static int check_trust(X509_STORE_CTX *ctx, int num_untrusted);
 static int check_revocation(X509_STORE_CTX *ctx);
-static int check_cert(X509_STORE_CTX *ctx);
+static int revocation_check_end(X509_STORE_CTX *ctx, int check_all);
+#ifndef OPENSSL_NO_OCSP
+static int check_cert_ocsp_resp(X509_STORE_CTX *ctx);
+#endif
+static int check_cert_crl(X509_STORE_CTX *ctx);
 static int check_policy(X509_STORE_CTX *ctx);
 static int check_dane_issuer(X509_STORE_CTX *ctx, int depth);
 static int check_cert_key_level(X509_STORE_CTX *ctx, X509 *cert);
@@ -72,6 +79,8 @@ static void get_delta_sk(X509_STORE_CTX *ctx, X509_CRL **dcrl,
     STACK_OF(X509_CRL) *crls);
 static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl, X509 **pissuer,
     int *pcrl_score);
+static int matching_crl_issuer_and_akid(const X509_CRL *crl,
+    const X509 *issuer, const X509_NAME *crl_issuer_name);
 static int crl_crldp_check(X509 *x, X509_CRL *crl, int crl_score,
     unsigned int *preasons);
 static int check_crl_path(X509_STORE_CTX *ctx, X509 *x);
@@ -93,7 +102,7 @@ static int null_callback(int ok, X509_STORE_CTX *e)
  * to match issuer and subject names (i.e., the cert being self-issued) and any
  * present authority key identifier to match the subject key identifier, etc.
  */
-int X509_self_signed(X509 *cert, int verify_signature)
+int X509_self_signed(const X509 *cert, int verify_signature)
 {
     EVP_PKEY *pkey;

@@ -101,7 +110,7 @@ int X509_self_signed(X509 *cert, int verify_signature)
         ERR_raise(ERR_LIB_X509, X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY);
         return -1;
     }
-    if (!ossl_x509v3_cache_extensions(cert))
+    if (!ossl_x509v3_cache_extensions((X509 *)cert))
         return -1;
     if ((cert->ex_flags & EXFLAG_SS) == 0)
         return 0;
@@ -155,13 +164,13 @@ static int lookup_cert_match(X509 **result, X509_STORE_CTX *ctx, X509 *x)
  *
  * Returns 0 to abort verification with an error, non-zero to continue.
  */
-static int verify_cb_cert(X509_STORE_CTX *ctx, X509 *x, int depth, int err)
+static int verify_cb_cert(X509_STORE_CTX *ctx, const X509 *x, int depth, int err)
 {
     if (depth < 0)
         depth = ctx->error_depth;
     else
         ctx->error_depth = depth;
-    ctx->current_cert = x != NULL ? x : sk_X509_value(ctx->chain, depth);
+    ctx->current_cert = x != NULL ? (X509 *)x : sk_X509_value(ctx->chain, depth);
     if (err != X509_V_OK)
         ctx->error = err;
     return ctx->verify_cb(0, ctx);
@@ -184,6 +193,23 @@ static int verify_cb_crl(X509_STORE_CTX *ctx, int err)
     return ctx->verify_cb(0, ctx);
 }

+#ifndef OPENSSL_NO_OCSP
+/*
+ * Inform the verify callback of an error, OCSP-specific variant.
+ * It is called also on OCSP response errors, if the
+ * X509_V_FLAG_OCSP_RESP_CHECK flag is set.
+ * Here, the error depth and certificate are already set, we just specify
+ * the error number.
+ *
+ * Returns 0 to abort verification with an error, non-zero to continue.
+ */
+static int verify_cb_ocsp(X509_STORE_CTX *ctx, int err)
+{
+    ctx->error = err;
+    return ctx->verify_cb(0, ctx);
+}
+#endif
+
 /* Sadly, returns 0 also on internal error in ctx->verify_cb(). */
 static int check_auth_level(X509_STORE_CTX *ctx)
 {
@@ -389,7 +415,7 @@ static int sk_X509_contains(STACK_OF(X509) *sk, X509 *cert)
  * Maybe not touch X509_STORE_CTX_get1_issuer(), for API backward compatibility.
  */
 static X509 *get0_best_issuer_sk(X509_STORE_CTX *ctx, int check_signing_allowed,
-    int no_dup, STACK_OF(X509) *sk, X509 *x)
+    int no_dup, STACK_OF(X509) *sk, const X509 *x)
 {
     int i;
     X509 *candidate, *issuer = NULL;
@@ -430,7 +456,7 @@ static X509 *get0_best_issuer_sk(X509_STORE_CTX *ctx, int check_signing_allowed,
  *  0 certificate not found.
  * -1 some other error.
  */
-int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x)
+int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, const X509 *x)
 {
     const X509_NAME *xn = X509_get_issuer_name(x);
     X509_OBJECT *obj = X509_OBJECT_new();
@@ -468,7 +494,7 @@ end:
 }

 /* Check that the given certificate |x| is issued by the certificate |issuer| */
-static int check_issued(ossl_unused X509_STORE_CTX *ctx, X509 *x, X509 *issuer)
+static int check_issued(ossl_unused X509_STORE_CTX *ctx, const X509 *x, const X509 *issuer)
 {
     int err = ossl_x509_likely_issued(issuer, x);

@@ -485,7 +511,7 @@ static int check_issued(ossl_unused X509_STORE_CTX *ctx, X509 *x, X509 *issuer)
  * Alternative get_issuer method: look up from a STACK_OF(X509) in other_ctx.
  * Returns -1 on internal error.
  */
-static int get1_best_issuer_other_sk(X509 **issuer, X509_STORE_CTX *ctx, X509 *x)
+static int get1_best_issuer_other_sk(X509 **issuer, X509_STORE_CTX *ctx, const X509 *x)
 {
     *issuer = get0_best_issuer_sk(ctx, 0, 1 /* no_dup */, ctx->other_ctx, x);
     if (*issuer == NULL)
@@ -497,7 +523,7 @@ static int get1_best_issuer_other_sk(X509 **issuer, X509_STORE_CTX *ctx, X509 *x
  * Alternative lookup method: look from a STACK stored in other_ctx.
  * Returns NULL on internal/fatal error, empty stack if not found.
  */
-static STACK_OF(X509) *lookup_certs_sk(X509_STORE_CTX *ctx, const X509_NAME *nm)
+static STACK_OF(X509) *lookup_certs_sk(const X509_STORE_CTX *ctx, const X509_NAME *nm)
 {
     STACK_OF(X509) *sk = sk_X509_new_null();
     X509 *x;
@@ -510,7 +536,6 @@ static STACK_OF(X509) *lookup_certs_sk(X509_STORE_CTX *ctx, const X509_NAME *nm)
         if (X509_NAME_cmp(nm, X509_get_subject_name(x)) == 0) {
             if (!X509_add_cert(sk, x, X509_ADD_FLAG_UP_REF)) {
                 OSSL_STACK_OF_X509_free(sk);
-                ctx->error = X509_V_ERR_OUT_OF_MEM;
                 return NULL;
             }
         }
@@ -603,6 +628,9 @@ static int check_extensions(X509_STORE_CTX *ctx)

     for (i = 0; i < num; i++) {
         x = sk_X509_value(ctx->chain, i);
+        /* RFC 5280, 4.2: a given extension MUST NOT appear more than once */
+        CB_FAIL_IF((x->ex_flags & EXFLAG_DUPLICATE) != 0,
+            ctx, x, i, X509_V_ERR_DUPLICATE_EXTENSION);
         CB_FAIL_IF((ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) == 0
                 && (x->ex_flags & EXFLAG_CRITICAL) != 0,
             ctx, x, i, X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION);
@@ -651,10 +679,6 @@ static int check_extensions(X509_STORE_CTX *ctx)
                 CB_FAIL_IF((x->ex_kusage & KU_KEY_CERT_SIGN) == 0, ctx,
                     x, i, X509_V_ERR_PATHLEN_WITHOUT_KU_KEY_CERT_SIGN);
             }
-            CB_FAIL_IF((x->ex_flags & EXFLAG_CA) != 0
-                    && (x->ex_flags & EXFLAG_BCONS) != 0
-                    && (x->ex_flags & EXFLAG_BCONS_CRITICAL) == 0,
-                ctx, x, i, X509_V_ERR_CA_BCONS_NOT_CRITICAL);
             /* Check Key Usage according to RFC 5280 section 4.2.1.3 */
             if ((x->ex_flags & EXFLAG_CA) != 0) {
                 CB_FAIL_IF((x->ex_flags & EXFLAG_KUSAGE) == 0,
@@ -672,10 +696,6 @@ static int check_extensions(X509_STORE_CTX *ctx)
                            || x->altname == NULL)
                     && X509_NAME_entry_count(X509_get_subject_name(x)) == 0,
                 ctx, x, i, X509_V_ERR_SUBJECT_NAME_EMPTY);
-            CB_FAIL_IF(X509_NAME_entry_count(X509_get_subject_name(x)) == 0
-                    && x->altname != NULL
-                    && (x->ex_flags & EXFLAG_SAN_CRITICAL) == 0,
-                ctx, x, i, X509_V_ERR_EMPTY_SUBJECT_SAN_NOT_CRITICAL);
             /* Check SAN is non-empty according to RFC 5280 section 4.2.1.6 */
             CB_FAIL_IF(x->altname != NULL
                     && sk_GENERAL_NAME_num(x->altname) <= 0,
@@ -683,21 +703,31 @@ static int check_extensions(X509_STORE_CTX *ctx)
             /* Check sig alg consistency acc. to RFC 5280 section 4.1.1.2 */
             CB_FAIL_IF(X509_ALGOR_cmp(&x->sig_alg, &x->cert_info.signature) != 0,
                 ctx, x, i, X509_V_ERR_SIGNATURE_ALGORITHM_INCONSISTENCY);
-            CB_FAIL_IF(x->akid != NULL
-                    && (x->ex_flags & EXFLAG_AKID_CRITICAL) != 0,
-                ctx, x, i, X509_V_ERR_AUTHORITY_KEY_IDENTIFIER_CRITICAL);
-            CB_FAIL_IF(x->skid != NULL
-                    && (x->ex_flags & EXFLAG_SKID_CRITICAL) != 0,
-                ctx, x, i, X509_V_ERR_SUBJECT_KEY_IDENTIFIER_CRITICAL);
             if (X509_get_version(x) >= X509_VERSION_3) {
                 /* Check AKID presence acc. to RFC 5280 section 4.2.1.1 */
-                CB_FAIL_IF(i + 1 < num /*
-                                        * this means not last cert in chain,
-                                        * taken as "generated by conforming CAs"
-                                        */
-                        && (x->akid == NULL || x->akid->keyid == NULL),
-                    ctx,
-                    x, i, X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIER);
+                /*
+                 * This means not last cert in chain, taken as generated by
+                 * conforming CAs and not self-signed.
+                 */
+                unsigned int check_akid = (i + 1 < num)
+                    && ((x->ex_flags & EXFLAG_SS) == 0);
+                CB_FAIL_IF(check_akid != 0 && x->akid == NULL,
+                    ctx, x, i, X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIER);
+                CB_FAIL_IF(check_akid != 0 && x->akid != NULL
+                        && x->akid->keyid == NULL && x->akid->issuer == NULL
+                        && x->akid->serial == NULL,
+                    ctx, x, i, X509_V_ERR_EMPTY_AUTHORITY_KEY_IDENTIFIER);
+                /*
+                 * The authorityCertIssuer and authorityCertSerialNumber fields
+                 * are paired and MUST either both be present or both be absent.
+                 *
+                 * Issuer without serial is ambiguous, and serial without issuer
+                 * is meaningless, leading to unresolvable and misleading issuer
+                 * identification.
+                 */
+                CB_FAIL_IF(x->akid != NULL
+                        && (x->akid->issuer == NULL) != (x->akid->serial == NULL),
+                    ctx, x, i, X509_V_ERR_AKID_ISSUER_SERIAL_NOT_PAIRED);
                 /* Check SKID presence acc. to RFC 5280 section 4.2.1.2 */
                 CB_FAIL_IF((x->ex_flags & EXFLAG_CA) != 0 && x->skid == NULL,
                     ctx, x, i, X509_V_ERR_MISSING_SUBJECT_KEY_IDENTIFIER);
@@ -748,27 +778,6 @@ static int check_extensions(X509_STORE_CTX *ctx)
     return 1;
 }

-static int has_san_id(X509 *x, int gtype)
-{
-    int i;
-    int ret = 0;
-    GENERAL_NAMES *gs = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL);
-
-    if (gs == NULL)
-        return 0;
-
-    for (i = 0; i < sk_GENERAL_NAME_num(gs); i++) {
-        GENERAL_NAME *g = sk_GENERAL_NAME_value(gs, i);
-
-        if (g->type == gtype) {
-            ret = 1;
-            break;
-        }
-    }
-    GENERAL_NAMES_free(gs);
-    return ret;
-}
-
 /*-
  * Returns -1 on internal error.
  * Sadly, returns 0 also on internal error in ctx->verify_cb().
@@ -779,7 +788,7 @@ static int check_name_constraints(X509_STORE_CTX *ctx)

     /* Check name constraints for all certificates */
     for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
-        X509 *x = sk_X509_value(ctx->chain, i);
+        const X509 *x = sk_X509_value(ctx->chain, i);
         int j;

         /* Ignore self-issued certs unless last in chain */
@@ -793,8 +802,9 @@ static int check_name_constraints(X509_STORE_CTX *ctx)
          * (RFC 3820: 3.4, 4.1.3 (a)(4))
          */
         if ((x->ex_flags & EXFLAG_PROXY) != 0) {
-            X509_NAME *tmpsubject = X509_get_subject_name(x);
-            X509_NAME *tmpissuer = X509_get_issuer_name(x);
+            const X509_NAME *tmpsubject = X509_get_subject_name(x);
+            const X509_NAME *tmpissuer = X509_get_issuer_name(x);
+            X509_NAME *tmpsubject2;
             X509_NAME_ENTRY *tmpentry = NULL;
             int last_nid = 0;
             int err = X509_V_OK;
@@ -831,23 +841,23 @@ static int check_name_constraints(X509_STORE_CTX *ctx)
              * Check that the last subject RDN is a commonName, and that
              * all the previous RDNs match the issuer exactly
              */
-            tmpsubject = X509_NAME_dup(tmpsubject);
-            if (tmpsubject == NULL) {
+            tmpsubject2 = X509_NAME_dup(tmpsubject);
+            if (tmpsubject2 == NULL) {
                 ERR_raise(ERR_LIB_X509, ERR_R_ASN1_LIB);
                 ctx->error = X509_V_ERR_OUT_OF_MEM;
                 return -1;
             }

-            tmpentry = X509_NAME_delete_entry(tmpsubject, last_loc);
+            tmpentry = X509_NAME_delete_entry(tmpsubject2, last_loc);
             last_nid = OBJ_obj2nid(X509_NAME_ENTRY_get_object(tmpentry));

             if (last_nid != NID_commonName
-                || X509_NAME_cmp(tmpsubject, tmpissuer) != 0) {
+                || X509_NAME_cmp(tmpsubject2, tmpissuer) != 0) {
                 err = X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION;
             }

             X509_NAME_ENTRY_free(tmpentry);
-            X509_NAME_free(tmpsubject);
+            X509_NAME_free(tmpsubject2);

         proxy_name_done:
             CB_FAIL_IF(err != X509_V_OK, ctx, x, i, err);
@@ -864,20 +874,22 @@ static int check_name_constraints(X509_STORE_CTX *ctx)

             if (nc) {
                 int rv = NAME_CONSTRAINTS_check(x, nc);
-                int ret = 1;

-                /* If EE certificate check commonName too */
+                /*
+                 * Apply DNS name constraints to the EE subject commonName
+                 * only when the commonName may be used for host name checks,
+                 * mirroring do_x509_check(): only when the caller opted in
+                 * with X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT, and never when
+                 * X509_CHECK_FLAG_NEVER_CHECK_SUBJECT is set.
+                 */
                 if (rv == X509_V_OK && i == 0
                     && (ctx->param->hostflags
                            & X509_CHECK_FLAG_NEVER_CHECK_SUBJECT)
                         == 0
-                    && ((ctx->param->hostflags
-                            & X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT)
-                            != 0
-                        || (ret = has_san_id(x, GEN_DNS)) == 0))
+                    && (ctx->param->hostflags
+                           & X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT)
+                        != 0)
                     rv = NAME_CONSTRAINTS_check_CN(x, nc);
-                if (ret < 0)
-                    return ret;

                 switch (rv) {
                 case X509_V_OK:
@@ -901,20 +913,57 @@ static int check_id_error(X509_STORE_CTX *ctx, int errcode)

 static int check_hosts(X509 *x, X509_VERIFY_PARAM *vpm)
 {
-    int i;
-    int n = sk_OPENSSL_STRING_num(vpm->hosts);
-    char *name;
+    const uint8_t *name;
+    int n = sk_X509_BUFFER_num(vpm->hosts);

     if (vpm->peername != NULL) {
         OPENSSL_free(vpm->peername);
         vpm->peername = NULL;
     }
-    for (i = 0; i < n; ++i) {
-        name = sk_OPENSSL_STRING_value(vpm->hosts, i);
-        if (X509_check_host(x, name, 0, vpm->hostflags, &vpm->peername) > 0)
+    for (int i = 0; i < n; ++i) {
+        size_t len = sk_X509_BUFFER_value(vpm->hosts, i)->len;
+        name = sk_X509_BUFFER_value(vpm->hosts, i)->data;
+        if (ossl_x509_check_host(x, (const char *)name, len, vpm->hostflags,
+                &vpm->peername)
+            > 0)
             return 1;
     }
-    return n == 0;
+    return n <= 0;
+}
+
+static int check_email(X509 *x, X509_VERIFY_PARAM *vpm)
+{
+    const uint8_t *name;
+    int nasc = sk_X509_BUFFER_num(vpm->rfc822s);
+    int nutf = sk_X509_BUFFER_num(vpm->smtputf8s);
+
+    for (int i = 0; i < nasc; ++i) {
+        size_t len = sk_X509_BUFFER_value(vpm->rfc822s, i)->len;
+        name = sk_X509_BUFFER_value(vpm->rfc822s, i)->data;
+        if (ossl_x509_check_rfc822(x, (const char *)name, len, vpm->hostflags))
+            return 1;
+    }
+    for (int i = 0; i < nutf; ++i) {
+        size_t len = sk_X509_BUFFER_value(vpm->smtputf8s, i)->len;
+        name = sk_X509_BUFFER_value(vpm->smtputf8s, i)->data;
+        if (ossl_x509_check_smtputf8(x, (const char *)name, len, vpm->hostflags))
+            return 1;
+    }
+    return nasc <= 0 && nutf <= 0;
+}
+
+static int check_ips(X509 *x, X509_VERIFY_PARAM *vpm)
+{
+    const uint8_t *name;
+    int n = sk_X509_BUFFER_num(vpm->ips);
+
+    for (int i = 0; i < n; ++i) {
+        size_t len = sk_X509_BUFFER_value(vpm->ips, i)->len;
+        name = sk_X509_BUFFER_value(vpm->ips, i)->data;
+        if (ossl_x509_check_ip(x, name, len, vpm->hostflags) > 0)
+            return 1;
+    }
+    return n <= 0;
 }

 static int check_id(X509_STORE_CTX *ctx)
@@ -926,18 +975,89 @@ static int check_id(X509_STORE_CTX *ctx)
         if (!check_id_error(ctx, X509_V_ERR_HOSTNAME_MISMATCH))
             return 0;
     }
-    if (vpm->email != NULL
-        && X509_check_email(x, vpm->email, vpm->emaillen, 0) <= 0) {
+
+    if (!check_email(x, vpm)) {
         if (!check_id_error(ctx, X509_V_ERR_EMAIL_MISMATCH))
             return 0;
     }
-    if (vpm->ip != NULL && X509_check_ip(x, vpm->ip, vpm->iplen, 0) <= 0) {
+
+    if (vpm->ips != NULL && check_ips(x, vpm) <= 0) {
         if (!check_id_error(ctx, X509_V_ERR_IP_ADDRESS_MISMATCH))
             return 0;
     }
     return 1;
 }

+/*
+ * Returns 1 is an ASN1 time is valid for an RFC5280 certificate, 0 otherwise
+ */
+static int validate_certificate_time(const ASN1_TIME *ctm)
+{
+    static const size_t utctime_length = sizeof("YYMMDDHHMMSSZ") - 1;
+    static const size_t generalizedtime_length = sizeof("YYYYMMDDHHMMSSZ") - 1;
+    int i;
+#ifdef CHARSET_EBCDIC
+    const char upper_z = 0x5A;
+#else
+    const char upper_z = 'Z';
+#endif
+
+    /*-
+     * Note that ASN.1 allows much more slack in the time format than RFC5280.
+     * In RFC5280, the representation is fixed:
+     * UTCTime: YYMMDDHHMMSSZ
+     * GeneralizedTime: YYYYMMDDHHMMSSZ
+     *
+     * We do NOT currently enforce the following RFC 5280 requirement:
+     * "CAs conforming to this profile MUST always encode certificate
+     *  validity dates through the year 2049 as UTCTime; certificate validity
+     *  dates in 2050 or later MUST be encoded as GeneralizedTime."
+     */
+    switch (ctm->type) {
+    case V_ASN1_UTCTIME:
+        if (ctm->length != (int)(utctime_length))
+            return 0;
+        break;
+    case V_ASN1_GENERALIZEDTIME:
+        if (ctm->length != (int)(generalizedtime_length))
+            return 0;
+        break;
+    default:
+        return 0;
+    }
+
+    /**
+     * Verify the format: the ASN.1 functions we use below allow a more
+     * flexible format than what's mandated by RFC 5280.
+     * Digit and date ranges will be verified in the conversion methods.
+     */
+    for (i = 0; i < ctm->length - 1; i++) {
+        if (!ossl_ascii_isdigit(ctm->data[i]))
+            return 0;
+    }
+    if (ctm->data[ctm->length - 1] != upper_z)
+        return 0;
+
+    return 1;
+}
+
+/* Validate and convert certificate time to a posix time */
+static int certificate_time_to_posix(const ASN1_TIME *ctm, int64_t *out_time)
+{
+    struct tm stm;
+
+    if (!validate_certificate_time(ctm))
+        return 0;
+
+    if (!ASN1_TIME_to_tm(ctm, &stm))
+        return 0;
+
+    if (!OPENSSL_tm_to_posix(&stm, out_time))
+        return 0;
+
+    return 1;
+}
+
 /* Returns -1 on internal error */
 static int check_trust(X509_STORE_CTX *ctx, int num_untrusted)
 {
@@ -1037,32 +1157,240 @@ trusted:
     return X509_TRUST_UNTRUSTED;
 }

+/*
+ * Return the last chain depth whose revocation status should be checked.
+ * With X509_V_FLAG_*_CHECK_ALL and X509_V_FLAG_PARTIAL_CHAIN, revocation
+ * checking stops before the first trusted certificate in the chain.
+ */
+static int revocation_check_end(X509_STORE_CTX *ctx, int check_all)
+{
+    if (!check_all)
+        return 0;
+    return (ctx->param->flags & X509_V_FLAG_PARTIAL_CHAIN) == 0
+        ? sk_X509_num(ctx->chain) - 1
+        : ctx->num_untrusted - 1;
+}
+
 /* Sadly, returns 0 also on internal error. */
 static int check_revocation(X509_STORE_CTX *ctx)
 {
     int i = 0, last = 0, ok = 0;
+    int crl_check_enabled = (ctx->param->flags & X509_V_FLAG_CRL_CHECK) != 0;
+    int crl_check_all_enabled = crl_check_enabled && (ctx->param->flags & X509_V_FLAG_CRL_CHECK_ALL) != 0;
+    int ocsp_check_enabled = (ctx->param->flags & X509_V_FLAG_OCSP_RESP_CHECK) != 0;
+    int ocsp_check_all_enabled = ocsp_check_enabled && (ctx->param->flags & X509_V_FLAG_OCSP_RESP_CHECK_ALL) != 0;

-    if ((ctx->param->flags & X509_V_FLAG_CRL_CHECK) == 0)
+    if (!crl_check_enabled && !ocsp_check_enabled)
         return 1;
-    if ((ctx->param->flags & X509_V_FLAG_CRL_CHECK_ALL) != 0) {
-        last = sk_X509_num(ctx->chain) - 1;
-    } else {
-        /* If checking CRL paths this isn't the EE certificate */
-        if (ctx->parent != NULL)
-            return 1;
-        last = 0;
+
+    if (ocsp_check_enabled) {
+#ifndef OPENSSL_NO_OCSP
+        /*
+         * certificate status checking with OCSP
+         */
+        if (!ocsp_check_all_enabled && !crl_check_all_enabled
+            && ctx->parent != NULL)
+            return 1; /* If checking CRL paths this isn't the EE certificate */
+        last = revocation_check_end(ctx, ocsp_check_all_enabled);
+
+        for (i = 0; i <= last; i++) {
+            ctx->error_depth = i;
+            ctx->current_cert = sk_X509_value(ctx->chain, i);
+
+            /* skip if cert is apparently self-signed */
+            if (ctx->current_cert->ex_flags & EXFLAG_SS)
+                continue;
+
+            /* the issuer certificate is the next in the chain */
+            ctx->current_issuer = sk_X509_value(ctx->chain, i + 1);
+            if (ctx->current_issuer == NULL) {
+                /*
+                 * No issuer exists at i+1 — this is the partial-chain
+                 * trust anchor. OCSP requires an issuer to build the
+                 * CertID, so skip OCSP checking for this certificate.
+                 */
+                if ((ctx->param->flags & X509_V_FLAG_PARTIAL_CHAIN) != 0)
+                    continue;
+                return verify_cb_ocsp(ctx, X509_V_ERR_OCSP_VERIFY_FAILED);
+            }
+
+            ok = check_cert_ocsp_resp(ctx);
+
+            /*
+             * In the case the certificate status is REVOKED, the verification
+             * can stop here.
+             */
+            if (ok == V_OCSP_CERTSTATUS_REVOKED) {
+                return verify_cb_ocsp(ctx, ctx->error != 0 ? ctx->error : X509_V_ERR_OCSP_VERIFY_FAILED);
+            }
+
+            /*
+             * In the case the certificate status is GOOD, continue with the next
+             * certificate.
+             */
+            if (ok == V_OCSP_CERTSTATUS_GOOD)
+                continue;
+
+            /*
+             * As stated in RFC 6961 section 2.2:
+             * If OCSP is not enabled or the client receives a "ocsp_response_list"
+             * that does not contain a response for one or more of the certificates
+             * in the completed certificate chain, the client SHOULD attempt to
+             * validate the certificate using an alternative retrieval method,
+             * such as downloading the relevant CRL;
+             */
+            if (crl_check_all_enabled || (crl_check_enabled && i == 0)) {
+                ok = check_cert_crl(ctx);
+                if (!ok)
+                    return ok;
+            } else {
+                ok = verify_cb_ocsp(ctx, X509_V_ERR_OCSP_VERIFY_FAILED);
+                if (!ok)
+                    return ok;
+            }
+        }
+#endif
     }
-    for (i = 0; i <= last; i++) {
-        ctx->error_depth = i;
-        ok = check_cert(ctx);
-        if (!ok)
-            return ok;
+
+    if (crl_check_enabled && !ocsp_check_all_enabled) {
+        /* certificate status check with CRLs */
+        if (!crl_check_all_enabled && ctx->parent != NULL)
+            return 1; /* If checking CRL paths this isn't the EE certificate */
+        last = revocation_check_end(ctx, crl_check_all_enabled);
+
+        /*
+         * in the case that OCSP is only enabled for the server certificate
+         * and CRL for the complete chain, the rest of the chain has to be
+         * checked here
+         */
+        if (ocsp_check_enabled && crl_check_all_enabled)
+            i = 1;
+        else
+            i = 0;
+        for (; i <= last; i++) {
+            ctx->error_depth = i;
+            ok = check_cert_crl(ctx);
+            if (!ok)
+                return ok;
+        }
     }
+
     return 1;
 }

+#ifndef OPENSSL_NO_OCSP
+static int check_cert_ocsp_resp(X509_STORE_CTX *ctx)
+{
+    int cert_status, crl_reason;
+    int i;
+    OCSP_RESPONSE *resp = NULL;
+    OCSP_BASICRESP *bs = NULL;
+    OCSP_SINGLERESP *sr = NULL;
+    OCSP_CERTID *sr_cert_id = NULL;
+    ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd;
+    ASN1_OBJECT *cert_id_md_oid;
+    EVP_MD *cert_id_md = NULL;
+    OCSP_CERTID *cert_id = NULL;
+    int ret = V_OCSP_CERTSTATUS_UNKNOWN;
+    int num;
+
+    num = sk_OCSP_RESPONSE_num(ctx->ocsp_resp);
+
+    if (num < 0 || num <= ctx->error_depth)
+        return X509_V_ERR_OCSP_NO_RESPONSE;
+
+    if ((resp = sk_OCSP_RESPONSE_value(ctx->ocsp_resp, ctx->error_depth)) == NULL
+        || (bs = OCSP_response_get1_basic(resp)) == NULL)
+        return X509_V_ERR_OCSP_NO_RESPONSE;
+
+    /*
+     * OCSP_response_get1_basic() returns an owning reference, so once bs is
+     * non-NULL it must be released via the end: cleanup label. Route an empty
+     * BasicResponse (no single responses) through end: rather than returning
+     * directly, otherwise bs leaks.
+     */
+    if ((num = OCSP_resp_count(bs)) < 1) {
+        ret = X509_V_ERR_OCSP_NO_RESPONSE;
+        goto end;
+    }
+
+    if (OCSP_response_status(resp) != OCSP_RESPONSE_STATUS_SUCCESSFUL) {
+        OCSP_BASICRESP_free(bs);
+        bs = NULL;
+        ret = X509_V_ERR_OCSP_RESP_INVALID;
+        goto end;
+    }
+
+    if (OCSP_basic_verify(bs, ctx->chain, ctx->store, 0) <= 0) {
+        ret = X509_V_ERR_OCSP_SIGNATURE_FAILURE;
+        goto end;
+    }
+
+    /* find the right single response in the OCSP response */
+    for (i = 0; i < num; i++) {
+        sr = OCSP_resp_get0(bs, i);
+
+        /* determine the md algorithm which was used to create cert id */
+        sr_cert_id = (OCSP_CERTID *)OCSP_SINGLERESP_get0_id(sr);
+        OCSP_id_get0_info(NULL, &cert_id_md_oid, NULL, NULL, sr_cert_id);
+        if (cert_id_md_oid != NULL) {
+            char md_name[80];
+
+            if (i2t_ASN1_OBJECT(md_name, sizeof(md_name), cert_id_md_oid) > 0)
+                cert_id_md = EVP_MD_fetch(ctx->libctx, md_name, ctx->propq);
+        }
+
+        /* search the stack for the requested OCSP response */
+        cert_id = OCSP_cert_to_id(cert_id_md, ctx->current_cert, ctx->current_issuer);
+        EVP_MD_free(cert_id_md);
+        cert_id_md = NULL;
+        if (cert_id == NULL) {
+            ret = X509_V_ERR_OCSP_RESP_INVALID;
+            goto end;
+        }
+
+        if (!OCSP_id_cmp(cert_id, sr_cert_id))
+            break;
+
+        OCSP_CERTID_free(cert_id);
+        cert_id = NULL;
+    }
+
+    if (cert_id == NULL) {
+        ret = X509_V_ERR_OCSP_NO_RESPONSE;
+        goto end;
+    }
+
+    if (OCSP_resp_find_status(bs, cert_id, &cert_status, &crl_reason, &rev,
+            &thisupd, &nextupd)
+        <= 0) {
+        ret = X509_V_ERR_OCSP_RESP_INVALID;
+        goto end;
+    }
+
+    if (cert_status == V_OCSP_CERTSTATUS_GOOD) {
+        /*
+         * Note:
+         * A OCSP stapling result will be accepted up to 5 minutes
+         * after it expired!
+         */
+        if (!OCSP_check_validity(thisupd, nextupd, 300L, -1L))
+            ret = X509_V_ERR_OCSP_HAS_EXPIRED;
+        else
+            ret = V_OCSP_CERTSTATUS_GOOD;
+    } else {
+        ret = cert_status;
+    }
+
+end:
+    OCSP_CERTID_free(cert_id);
+    OCSP_BASICRESP_free(bs);
+    return ret;
+}
+#endif
+
 /* Sadly, returns 0 also on internal error. */
-static int check_cert(X509_STORE_CTX *ctx)
+static int check_cert_crl(X509_STORE_CTX *ctx)
 {
     X509_CRL *crl = NULL, *dcrl = NULL;
     int ok = 0;
@@ -1074,6 +1402,9 @@ static int check_cert(X509_STORE_CTX *ctx)
     ctx->current_crl_score = 0;
     ctx->current_reasons = 0;

+    /* skip if cert is apparently self-signed */
+    if (ctx->current_cert->ex_flags & EXFLAG_SS)
+        return 1;
     if ((x->ex_flags & EXFLAG_PROXY) != 0)
         return 1;

@@ -1100,7 +1431,7 @@ static int check_cert(X509_STORE_CTX *ctx)
             ok = verify_cb_crl(ctx, X509_V_ERR_UNABLE_TO_GET_CRL);
             goto done;
         }
-        ctx->current_crl = crl;
+
         ok = ctx->check_crl(ctx, crl);
         if (!ok)
             goto done;
@@ -1145,55 +1476,56 @@ done:
     return ok;
 }

+/*
+ * returns 1 and sets verification time if time should be checked.
+ * returns 0 if time should not be checked.
+ */
+static int get_verification_time(const X509_VERIFY_PARAM *vpm,
+    int64_t *verification_time)
+{
+    if (vpm != NULL && (vpm->flags & X509_V_FLAG_USE_CHECK_TIME) != 0)
+        *verification_time = vpm->check_time;
+    else
+        *verification_time = (int64_t)time(NULL);
+
+    return vpm == NULL || (vpm->flags & X509_V_FLAG_NO_CHECK_TIME) == 0;
+}
+
 /* Check CRL times against values in X509_STORE_CTX */
-static int check_crl_time(X509_STORE_CTX *ctx, X509_CRL *crl, int notify)
+int ossl_x509_check_crl_time(X509_STORE_CTX *ctx, X509_CRL *crl, int notify)
 {
-    time_t *ptime;
-    int i;
+    int64_t verification_time, last_update, next_update;
+    int err;

-    if ((ctx->param->flags & X509_V_FLAG_USE_CHECK_TIME) != 0)
-        ptime = &ctx->param->check_time;
-    else if ((ctx->param->flags & X509_V_FLAG_NO_CHECK_TIME) != 0)
+    if (!get_verification_time(ctx->param, &verification_time))
         return 1;
-    else
-        ptime = NULL;
-    if (notify)
-        ctx->current_crl = crl;

-    i = X509_cmp_time(X509_CRL_get0_lastUpdate(crl), ptime);
-    if (i == 0) {
-        if (!notify)
+    if (!certificate_time_to_posix(X509_CRL_get0_lastUpdate(crl),
+            &last_update)) {
+        err = X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD;
+        if (!notify || !verify_cb_crl(ctx, err))
             return 0;
-        if (!verify_cb_crl(ctx, X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD))
-            return 0;
-    }
-
-    if (i > 0) {
-        if (!notify)
-            return 0;
-        if (!verify_cb_crl(ctx, X509_V_ERR_CRL_NOT_YET_VALID))
+    } else if (verification_time < last_update) {
+        err = X509_V_ERR_CRL_NOT_YET_VALID;
+        if (!notify || !verify_cb_crl(ctx, err))
             return 0;
     }

     if (X509_CRL_get0_nextUpdate(crl)) {
-        i = X509_cmp_time(X509_CRL_get0_nextUpdate(crl), ptime);
-
-        if (i == 0) {
-            if (!notify)
+        if (!certificate_time_to_posix(X509_CRL_get0_nextUpdate(crl),
+                &next_update)) {
+            err = X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD;
+            if (!notify || !verify_cb_crl(ctx, err))
                 return 0;
-            if (!verify_cb_crl(ctx, X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD))
-                return 0;
-        }
-        /* Ignore expiration of base CRL is delta is valid */
-        if (i < 0 && (ctx->current_crl_score & CRL_SCORE_TIME_DELTA) == 0) {
-            if (!notify || !verify_cb_crl(ctx, X509_V_ERR_CRL_HAS_EXPIRED))
+        } else if (verification_time > next_update
+            /* Ignore expiration of base CRL is delta is valid */
+            && (ctx->current_crl_score & CRL_SCORE_TIME_DELTA) == 0) {
+            err = X509_V_ERR_CRL_HAS_EXPIRED;
+            if (!notify || !verify_cb_crl(ctx, err))
                 return 0;
         }
     }

-    if (notify)
-        ctx->current_crl = NULL;
-
     return 1;
 }

@@ -1259,7 +1591,7 @@ static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl,
  */
 static int crl_extension_match(X509_CRL *a, X509_CRL *b, int nid)
 {
-    ASN1_OCTET_STRING *exta = NULL, *extb = NULL;
+    const ASN1_OCTET_STRING *exta = NULL, *extb = NULL;
     int i = X509_CRL_get_ext_by_NID(a, nid, -1);

     if (i >= 0) {
@@ -1337,7 +1669,7 @@ static void get_delta_sk(X509_STORE_CTX *ctx, X509_CRL **dcrl, int *pscore,

             *dcrl = delta;

-            if (check_crl_time(ctx, delta, 0))
+            if (ossl_x509_check_crl_time(ctx, delta, 0))
                 *pscore |= CRL_SCORE_TIME_DELTA;

             return;
@@ -1391,7 +1723,7 @@ static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer,
         crl_score |= CRL_SCORE_NOCRITICAL;

     /* Check expiration */
-    if (check_crl_time(ctx, crl, 0))
+    if (ossl_x509_check_crl_time(ctx, crl, 0))
         crl_score |= CRL_SCORE_TIME;

     /* Check authority key ID and locate certificate issuer */
@@ -1411,7 +1743,6 @@ static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer,
     }

     *preasons = tmp_reasons;
-
     return crl_score;
 }

@@ -1428,7 +1759,7 @@ static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl,

     crl_issuer = sk_X509_value(ctx->chain, cidx);

-    if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
+    if (matching_crl_issuer_and_akid(crl, crl_issuer, cnm)) {
         if (*pcrl_score & CRL_SCORE_ISSUER_NAME) {
             *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT;
             *pissuer = crl_issuer;
@@ -1438,9 +1769,7 @@ static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl,

     for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
         crl_issuer = sk_X509_value(ctx->chain, cidx);
-        if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))
-            continue;
-        if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
+        if (matching_crl_issuer_and_akid(crl, crl_issuer, cnm)) {
             *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_SAME_PATH;
             *pissuer = crl_issuer;
             return;
@@ -1457,9 +1786,7 @@ static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl,
      */
     for (i = 0; i < sk_X509_num(ctx->untrusted); i++) {
         crl_issuer = sk_X509_value(ctx->untrusted, i);
-        if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm) != 0)
-            continue;
-        if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
+        if (matching_crl_issuer_and_akid(crl, crl_issuer, cnm)) {
             *pissuer = crl_issuer;
             *pcrl_score |= CRL_SCORE_AKID;
             return;
@@ -1467,6 +1794,16 @@ static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl,
     }
 }

+static int matching_crl_issuer_and_akid(const X509_CRL *crl,
+    const X509 *issuer, const X509_NAME *crl_issuer_name)
+{
+    if (issuer == NULL)
+        return 0;
+    if (X509_NAME_cmp(X509_get_subject_name(issuer), crl_issuer_name) != 0)
+        return 0;
+    return X509_check_akid(issuer, crl->akid) == X509_V_OK;
+}
+
 /*
  * Check the path of a CRL issuer certificate. This creates a new
  * X509_STORE_CTX and populates it with most of the parameters from the
@@ -1645,6 +1982,52 @@ static int crldp_check_crlissuer(DIST_POINT *dp, X509_CRL *crl, int crl_score)
     return 0;
 }

+/*
+ * Check whether the distribution point name |idpname| of a CRL's IDP extension
+ * matches the default distribution point that RFC 5280, section 6.3.3, assumes
+ * for CRLs not specified in any of the certificate's distribution points: one
+ * whose fullName consists of the certificate issuer name and the names in the
+ * certificate's issuerAltName extension.  The assumed distribution point is
+ * constructed and matched with idp_check_dp().
+ */
+static int idp_check_issuer(DIST_POINT_NAME *idpname, X509 *x)
+{
+    DIST_POINT_NAME dpname;
+    GENERAL_NAMES *gens;
+    GENERAL_NAME *gen = NULL;
+    X509_NAME *iname = NULL;
+    int ret = 0;
+
+    /*
+     * An undecodable issuerAltName extension is treated as an absent one;
+     * any decoding errors are not left in the error queue.
+     */
+    ERR_set_mark();
+    gens = X509_get_ext_d2i(x, NID_issuer_alt_name, NULL, NULL);
+    ERR_pop_to_mark();
+    if (gens == NULL && (gens = sk_GENERAL_NAME_new_null()) == NULL)
+        return 0;
+    if ((gen = GENERAL_NAME_new()) == NULL
+        || (iname = X509_NAME_dup(X509_get_issuer_name(x))) == NULL)
+        goto end;
+    GENERAL_NAME_set0_value(gen, GEN_DIRNAME, iname);
+    iname = NULL; /* now owned by |gen| */
+    if (!sk_GENERAL_NAME_push(gens, gen))
+        goto end;
+    gen = NULL; /* now owned by |gens| */
+
+    dpname.type = 0; /* fullName */
+    dpname.name.fullname = gens;
+    dpname.dpname = NULL;
+    ret = idp_check_dp(&dpname, NULL, idpname);
+
+end:
+    GENERAL_NAME_free(gen);
+    X509_NAME_free(iname);
+    GENERAL_NAMES_free(gens);
+    return ret;
+}
+
 /* Check CRLDP and IDP */
 static int crl_crldp_check(X509 *x, X509_CRL *crl, int crl_score,
     unsigned int *preasons)
@@ -1687,8 +2070,16 @@ static int crl_crldp_check(X509 *x, X509_CRL *crl, int crl_score,
             return 1;
         }
     }
-    return (crl->idp == NULL || crl->idp->distpoint == NULL)
-        && (crl_score & CRL_SCORE_ISSUER_NAME) != 0;
+    /*
+     * The CRL is not specified in any distribution point of the certificate.
+     * RFC 5280, section 6.3.3, allows such a CRL if it is issued by the
+     * certificate issuer, assuming a distribution point with the reasons and
+     * cRLIssuer fields omitted and a distribution point name consisting of
+     * the certificate issuer name and any issuerAltName entries.
+     */
+    return (crl_score & CRL_SCORE_ISSUER_NAME) != 0
+        && (crl->idp == NULL || crl->idp->distpoint == NULL
+            || idp_check_issuer(crl->idp->distpoint, x));
 }

 /*
@@ -1744,6 +2135,8 @@ static int check_crl(X509_STORE_CTX *ctx, X509_CRL *crl)
     int cnum = ctx->error_depth;
     int chnum = sk_X509_num(ctx->chain) - 1;

+    ctx->current_crl = crl;
+
     /* If we have an alternative CRL issuer cert use that */
     if (ctx->current_issuer != NULL) {
         issuer = ctx->current_issuer;
@@ -1783,7 +2176,7 @@ static int check_crl(X509_STORE_CTX *ctx, X509_CRL *crl)
             return 0;
     }

-    if ((ctx->current_crl_score & CRL_SCORE_TIME) == 0 && !check_crl_time(ctx, crl, 1))
+    if ((ctx->current_crl_score & CRL_SCORE_TIME) == 0 && !ossl_x509_check_crl_time(ctx, crl, 1))
         return 0;

     /* Attempt to get issuer certificate public key */
@@ -1912,6 +2305,66 @@ memerr:
     return -1;
 }

+/*-
+ * Check certificate validity times.
+ *
+ * Returns 1 if the certificate |x| is temporally valid at the
+ * verification time requested by |vpm|, or 0 otherwise. if |error| is
+ * non-NULL, |*error| will be set to 0 when the certificate is
+ * temporally valid, otherwise it will be set to a non-zero error
+ * code.
+ */
+int X509_check_certificate_times(const X509_VERIFY_PARAM *vpm, const X509 *x,
+    int *error)
+{
+    int ret = 0, err = 0;
+    int64_t notafter_seconds, notbefore_seconds, verification_time;
+
+    if (!get_verification_time(vpm, &verification_time)) {
+        ret = 1;
+        goto done;
+    }
+
+    if (!certificate_time_to_posix(X509_get0_notBefore(x), &notbefore_seconds)) {
+        err = X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD;
+        goto done;
+    }
+
+    if (verification_time < notbefore_seconds) {
+        err = X509_V_ERR_CERT_NOT_YET_VALID;
+        goto done;
+    }
+
+    if (!certificate_time_to_posix(X509_get0_notAfter(x), &notafter_seconds)) {
+        err = X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD;
+        goto done;
+    }
+
+    /*
+     * RFC 5280 4.1.2.5:
+     * To indicate that a certificate has no well-defined expiration date,
+     * the notAfter SHOULD be assigned the GeneralizedTime value of
+     * 99991231235959Z. This is INT64_C(253402300799) in epoch seconds.
+     */
+    if (notafter_seconds == INT64_C(253402300799)) {
+        ret = 1;
+        goto done;
+    }
+
+    if (verification_time > notafter_seconds) {
+        err = X509_V_ERR_CERT_HAS_EXPIRED;
+        goto done;
+    }
+
+    ret = 1;
+
+done:
+    if (error != NULL)
+        *error = err;
+
+    return ret;
+}
+
 /*-
  * Check certificate validity times.
  * If depth >= 0, invoke verification callbacks on error, otherwise just return
@@ -1922,27 +2375,43 @@ memerr:
  */
 int ossl_x509_check_cert_time(X509_STORE_CTX *ctx, X509 *x, int depth)
 {
-    time_t *ptime;
-    int i;
+    const X509_VERIFY_PARAM *vpm = ctx->param;
+    int64_t notafter_seconds, notbefore_seconds, verification_time;
+    int err;

-    if ((ctx->param->flags & X509_V_FLAG_USE_CHECK_TIME) != 0)
-        ptime = &ctx->param->check_time;
-    else if ((ctx->param->flags & X509_V_FLAG_NO_CHECK_TIME) != 0)
+    if (!get_verification_time(vpm, &verification_time))
         return 1;
-    else
-        ptime = NULL;

-    i = X509_cmp_time(X509_get0_notBefore(x), ptime);
-    if (i >= 0 && depth < 0)
-        return 0;
-    CB_FAIL_IF(i == 0, ctx, x, depth, X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD);
-    CB_FAIL_IF(i > 0, ctx, x, depth, X509_V_ERR_CERT_NOT_YET_VALID);
+    if (!certificate_time_to_posix(X509_get0_notBefore(x), &notbefore_seconds)) {
+        err = X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD;
+        if (depth < 0 || verify_cb_cert(ctx, x, depth, err) == 0)
+            return 0;
+    } else if (verification_time < notbefore_seconds) {
+        err = X509_V_ERR_CERT_NOT_YET_VALID;
+        if (depth < 0 || verify_cb_cert(ctx, x, depth, err) == 0)
+            return 0;
+    }
+
+    if (!certificate_time_to_posix(X509_get0_notAfter(x), &notafter_seconds)) {
+        err = X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD;
+        if (depth < 0 || verify_cb_cert(ctx, x, depth, err) == 0)
+            return 0;
+    } else {
+        /*
+         * RFC 5280 4.1.2.5:
+         * To indicate that a certificate has no well-defined expiration date,
+         * the notAfter SHOULD be assigned the GeneralizedTime value of
+         * 99991231235959Z. This is INT64_C(253402300799) in epoch seconds.
+         */
+        if (notafter_seconds == INT64_C(253402300799))
+            return 1;
+        if (verification_time > notafter_seconds) {
+            err = X509_V_ERR_CERT_HAS_EXPIRED;
+            if (depth < 0 || verify_cb_cert(ctx, x, depth, err) == 0)
+                return 0;
+        }
+    }

-    i = X509_cmp_time(X509_get0_notAfter(x), ptime);
-    if (i <= 0 && depth < 0)
-        return 0;
-    CB_FAIL_IF(i == 0, ctx, x, depth, X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD);
-    CB_FAIL_IF(i < 0, ctx, x, depth, X509_V_ERR_CERT_HAS_EXPIRED);
     return 1;
 }

@@ -2069,92 +2538,40 @@ static int internal_verify(X509_STORE_CTX *ctx)
     return 1;
 }

+#if !defined(OPENSSL_NO_DEPRECATED_4_0)
 int X509_cmp_current_time(const ASN1_TIME *ctm)
 {
     return X509_cmp_time(ctm, NULL);
 }

 /* returns 0 on error, otherwise 1 if ctm > cmp_time, else -1 */
-int X509_cmp_time(const ASN1_TIME *ctm, time_t *cmp_time)
+int X509_cmp_time(const ASN1_TIME *ctm, const time_t *cmp_time)
 {
-    static const size_t utctime_length = sizeof("YYMMDDHHMMSSZ") - 1;
-    static const size_t generalizedtime_length = sizeof("YYYYMMDDHHMMSSZ") - 1;
-    ASN1_TIME *asn1_cmp_time = NULL;
-    int i, day, sec, ret = 0;
-#ifdef CHARSET_EBCDIC
-    const char upper_z = 0x5A;
-#else
-    const char upper_z = 'Z';
-#endif
-
-    /*-
-     * Note that ASN.1 allows much more slack in the time format than RFC5280.
-     * In RFC5280, the representation is fixed:
-     * UTCTime: YYMMDDHHMMSSZ
-     * GeneralizedTime: YYYYMMDDHHMMSSZ
-     *
-     * We do NOT currently enforce the following RFC 5280 requirement:
-     * "CAs conforming to this profile MUST always encode certificate
-     *  validity dates through the year 2049 as UTCTime; certificate validity
-     *  dates in 2050 or later MUST be encoded as GeneralizedTime."
-     */
-    switch (ctm->type) {
-    case V_ASN1_UTCTIME:
-        if (ctm->length != (int)(utctime_length))
-            return 0;
-        break;
-    case V_ASN1_GENERALIZEDTIME:
-        if (ctm->length != (int)(generalizedtime_length))
-            return 0;
-        break;
-    default:
-        return 0;
-    }
+    int64_t cert_time, posix_time = cmp_time == NULL ? (int64_t)time(NULL) : (int64_t)*cmp_time;

-    /**
-     * Verify the format: the ASN.1 functions we use below allow a more
-     * flexible format than what's mandated by RFC 5280.
-     * Digit and date ranges will be verified in the conversion methods.
-     */
-    for (i = 0; i < ctm->length - 1; i++) {
-        if (!ossl_ascii_isdigit(ctm->data[i]))
-            return 0;
-    }
-    if (ctm->data[ctm->length - 1] != upper_z)
+    if (!certificate_time_to_posix(ctm, &cert_time))
         return 0;

-    /*
-     * There is ASN1_UTCTIME_cmp_time_t but no
-     * ASN1_GENERALIZEDTIME_cmp_time_t or ASN1_TIME_cmp_time_t,
-     * so we go through ASN.1
-     */
-    asn1_cmp_time = X509_time_adj(NULL, 0, cmp_time);
-    if (asn1_cmp_time == NULL)
-        goto err;
-    if (ASN1_TIME_diff(&day, &sec, ctm, asn1_cmp_time) == 0)
-        goto err;
-
-    /*
-     * X509_cmp_time comparison is <=.
-     * The return value 0 is reserved for errors.
-     */
-    ret = (day >= 0 && sec >= 0) ? -1 : 1;
+    if (cert_time > posix_time)
+        return 1;

-err:
-    ASN1_TIME_free(asn1_cmp_time);
-    return ret;
+    /* It's tradition, that makes it OK. Hyrum's law bites forever */
+    return -1;
 }

 /*
  * Return 0 if time should not be checked or reference time is in range,
  * or else 1 if it is past the end, or -1 if it is before the start
+ * treats invalid start and end as times infinitely in the past or
+ * future, respectively. Do not use on untrusted input (meaning
+ * do not use this when validating certificates for actual use)
  */
 int X509_cmp_timeframe(const X509_VERIFY_PARAM *vpm,
     const ASN1_TIME *start, const ASN1_TIME *end)
 {
+    unsigned long flags = vpm == NULL ? 0 : X509_VERIFY_PARAM_get_flags(vpm);
     time_t ref_time;
     time_t *time = NULL;
-    unsigned long flags = vpm == NULL ? 0 : X509_VERIFY_PARAM_get_flags(vpm);

     if ((flags & X509_V_FLAG_USE_CHECK_TIME) != 0) {
         ref_time = X509_VERIFY_PARAM_get_time(vpm);
@@ -2163,25 +2580,48 @@ int X509_cmp_timeframe(const X509_VERIFY_PARAM *vpm,
         return 0; /* this means ok */
     } /* else reference time is the current time */

+    /*
+     * XXX this is public API so we have the entertaining property
+     * that invalid asn1 times for |start| or |end| are effectively
+     * treated as infinitely in the past or future, due to the use
+     * X509_cmp_time, and the 0 return for an invalid time.
+     *
+     * Treating NULL as infinite a bit off but probably mostly harmless
+     * in practice because X509_get0_notBefore and friends do not
+     * return NULL. However, if you can end up using a cert with an
+     * invalid time that whatever signed it did not validate it in a
+     * compatible way with us, You can end up with infinite validity
+     * when you did not expect it. Depending on how you got the
+     * certificate and what you are doing based upon this decision
+     * this could have undesirable consequences.
+     *
+     * (invalid) (invalid) -> 0;
+     * start (invalid) -> returns 0 if start if after time
+     * (invalid) end -> returns 0 if end is before time
+     *
+     * So for better or worse we keep this the way it is and update
+     * the documentation accordingly.
+     */
     if (end != NULL && X509_cmp_time(end, time) < 0)
         return 1;
     if (start != NULL && X509_cmp_time(start, time) > 0)
         return -1;
     return 0;
 }
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_0) */

 ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj)
 {
     return X509_time_adj(s, adj, NULL);
 }

-ASN1_TIME *X509_time_adj(ASN1_TIME *s, long offset_sec, time_t *in_tm)
+ASN1_TIME *X509_time_adj(ASN1_TIME *s, long offset_sec, const time_t *in_tm)
 {
     return X509_time_adj_ex(s, 0, offset_sec, in_tm);
 }

 ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s,
-    int offset_day, long offset_sec, time_t *in_tm)
+    int offset_day, long offset_sec, const time_t *in_tm)
 {
     time_t t;

@@ -2200,7 +2640,7 @@ ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s,
 }

 /* Copy any missing public key parameters up the chain towards pkey */
-int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain)
+int X509_get_pubkey_parameters(EVP_PKEY *pkey, const STACK_OF(X509) *chain)
 {
     EVP_PKEY *ktmp = NULL, *ktmp2;
     int i, j;
@@ -2314,8 +2754,7 @@ X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer,
      * number to correct value too.
      */
     for (i = 0; i < X509_CRL_get_ext_count(newer); i++) {
-        X509_EXTENSION *ext = X509_CRL_get_ext(newer, i);
-
+        const X509_EXTENSION *ext = X509_CRL_get_ext(newer, i);
         if (!X509_CRL_add_ext(crl, ext, -1)) {
             ERR_raise(ERR_LIB_X509, ERR_R_X509_LIB);
             goto err;
@@ -2442,6 +2881,13 @@ void X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk)
     ctx->crls = sk;
 }

+#ifndef OPENSSL_NO_OCSP
+void X509_STORE_CTX_set_ocsp_resp(X509_STORE_CTX *ctx, STACK_OF(OCSP_RESPONSE) *sk)
+{
+    ctx->ocsp_resp = sk;
+}
+#endif
+
 int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose)
 {
     /*
@@ -2462,12 +2908,15 @@ int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust)
 }

 /*
- * This function is used to set the X509_STORE_CTX purpose and trust values.
+ * Use this function to set the X509_STORE_CTX purpose and/or trust id values.
+ * The |def_purpose| argument is used if the given purpose value is 0.
+ * The |purpose| is unchanged if also the def_purpose argument is 0.
+ * The |trust| is unchanged if the given trust value is X509_TRUST_DEFAULT.
  * This is intended to be used when another structure has its own trust and
- * purpose values which (if set) will be inherited by the ctx. If they aren't
- * set then we will usually have a default purpose in mind which should then
- * be used to set the trust value. An example of this is SSL use: an SSL
- * structure will have its own purpose and trust settings which the
+ * purpose values, which (if set) will be inherited by the |ctx|. If they aren't
+ * set then we will usually have a default purpose in mind, which should then
+ * be used to set the trust id. An example of this is SSL use: an SSL
+ * structure will have its own purpose and trust settings, which the
  * application can set: if they aren't set then we use the default of SSL
  * client/server.
  */
@@ -2504,10 +2953,10 @@ int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
             ptmp = X509_PURPOSE_get0(idx);
         }
         /* If trust not set then get from purpose default */
-        if (trust == 0)
+        if (trust == X509_TRUST_DEFAULT)
             trust = ptmp->trust;
     }
-    if (trust != 0) {
+    if (trust != X509_TRUST_DEFAULT) {
         idx = X509_TRUST_get_by_id(trust);
         if (idx == -1) {
             ERR_raise(ERR_LIB_X509, X509_R_UNKNOWN_TRUST_ID);
@@ -2517,7 +2966,7 @@ int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,

     if (ctx->param->purpose == 0 && purpose != 0)
         ctx->param->purpose = purpose;
-    if (ctx->param->trust == 0 && trust != 0)
+    if (ctx->param->trust == X509_TRUST_DEFAULT && trust != X509_TRUST_DEFAULT)
         ctx->param->trust = trust;
     return 1;
 }
@@ -2566,7 +3015,7 @@ int X509_STORE_CTX_init_rpk(X509_STORE_CTX *ctx, X509_STORE *store, EVP_PKEY *rp
     return 1;
 }

-int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
+int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, const X509 *x509,
     STACK_OF(X509) *chain)
 {
     if (ctx == NULL) {
@@ -2576,7 +3025,7 @@ int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
     X509_STORE_CTX_cleanup(ctx);

     ctx->store = store;
-    ctx->cert = x509;
+    ctx->cert = (X509 *)x509; /* XXX casts away const */
     ctx->untrusted = chain;
     ctx->crls = NULL;
     ctx->num_untrusted = 0;
@@ -2598,6 +3047,7 @@ int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
     ctx->rpk = NULL;
     /* Zero ex_data to make sure we're cleanup-safe */
     memset(&ctx->ex_data, 0, sizeof(ctx->ex_data));
+    ctx->ocsp_resp = NULL;

     /* store->cleanup is always 0 in OpenSSL, if set must be idempotent */
     if (store != NULL)
@@ -3683,7 +4133,7 @@ memerr:
     return -1;
 }

-STACK_OF(X509) *X509_build_chain(X509 *target, STACK_OF(X509) *certs,
+STACK_OF(X509) *X509_build_chain(const X509 *target, STACK_OF(X509) *certs,
     X509_STORE *store, int with_self_signed,
     OSSL_LIB_CTX *libctx, const char *propq)
 {
@@ -3703,7 +4153,8 @@ STACK_OF(X509) *X509_build_chain(X509 *target, STACK_OF(X509) *certs,
         goto err;
     if (!finish_chain)
         X509_STORE_CTX_set0_trusted_stack(ctx, certs);
-    if (!ossl_x509_add_cert_new(&ctx->chain, target, X509_ADD_FLAG_UP_REF)) {
+    /* XXX casts away const */
+    if (!ossl_x509_add_cert_new(&ctx->chain, (X509 *)target, X509_ADD_FLAG_UP_REF)) {
         ctx->error = X509_V_ERR_OUT_OF_MEM;
         goto err;
     }
diff --git a/deps/openssl/openssl/crypto/x509/x509_vpm.c b/deps/openssl/openssl/crypto/x509/x509_vpm.c
index ca66f78d2e4..44b116923b2 100644
--- a/deps/openssl/openssl/crypto/x509/x509_vpm.c
+++ b/deps/openssl/openssl/crypto/x509/x509_vpm.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,70 +14,343 @@
 #include <openssl/buffer.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
+
+#include "crypto/ctype.h"
 #include "crypto/x509.h"

 #include "x509_local.h"

+typedef enum {
+    OSSL_CHARSET_NONASCII,
+    OSSL_CHARSET_ASCII,
+    OSSL_CHARSET_ASCII_ALNUM,
+} ossl_charset_t;
+
 /* X509_VERIFY_PARAM functions */

 #define SET_HOST 0
 #define ADD_HOST 1

-static char *str_copy(const char *s)
+static X509_BUFFER *buffer_from_bytes(const uint8_t *bytes, size_t length)
+{
+    X509_BUFFER *buf;
+
+    if ((buf = OPENSSL_zalloc(sizeof(*buf))) != NULL
+        && (buf->data = OPENSSL_memdup(bytes, length)) != NULL) {
+        buf->len = length;
+    } else {
+        OPENSSL_free(buf);
+        buf = NULL;
+    }
+    return buf;
+}
+
+/*
+ * Copies |length| bytes from |bytes| to a new buffer, making the data
+ * A C string. It is an error for the |bytes| to contain any \0 values
+ * within |length|. |bytes| need not itself be \0 terminated, the data
+ * in the buffer will be on success.
+ */
+static X509_BUFFER *buffer_from_string(const uint8_t *bytes, size_t length)
+{
+    X509_BUFFER *buf, *ret = NULL;
+    uint8_t *data = NULL;
+
+    if ((buf = OPENSSL_zalloc(sizeof(*buf))) == NULL)
+        goto err;
+
+    if ((data = (uint8_t *)OPENSSL_strndup((char *)bytes, length)) == NULL)
+        goto err;
+
+    if (strlen((char *)data) != length)
+        goto err;
+
+    ret = buf;
+    buf = NULL;
+    ret->data = data;
+    ret->len = length;
+    data = NULL;
+
+err:
+    OPENSSL_free(buf);
+    OPENSSL_free(data);
+
+    return ret;
+}
+
+static X509_BUFFER *buffer_copy(const X509_BUFFER *b)
+{
+    return buffer_from_bytes(b->data, b->len);
+}
+
+static void buffer_free(X509_BUFFER *b)
+{
+    if (b == NULL)
+        return;
+    OPENSSL_free((void *)b->data);
+    OPENSSL_free(b);
+}
+
+static int replace_buffer_stack(STACK_OF(X509_BUFFER) **dest,
+    STACK_OF(X509_BUFFER) *const *src)
+{
+    sk_X509_BUFFER_pop_free(*dest, buffer_free);
+    *dest = NULL;
+    if (*src != NULL) {
+        *dest = sk_X509_BUFFER_deep_copy(*src, buffer_copy, buffer_free);
+        if (*dest == NULL)
+            return 0;
+    }
+    return 1;
+}
+
+static int buffer_cmp(const X509_BUFFER *const *a, const X509_BUFFER *const *b)
+{
+    if ((*a)->len < (*b)->len)
+        return -1;
+    if ((*a)->len > (*b)->len)
+        return 1;
+    if ((*b)->len == 0)
+        return 0;
+    return memcmp((*a)->data, (*b)->data, (*b)->len);
+}
+
+static void clear_buffer_stack(STACK_OF(X509_BUFFER) **buffer_stack)
 {
-    return OPENSSL_strdup(s);
+    sk_X509_BUFFER_pop_free(*buffer_stack, buffer_free);
+    *buffer_stack = NULL;
+}
+
+static int add_bytes_to_buffer_stack(STACK_OF(X509_BUFFER) **buffer_stack,
+    const uint8_t *name, size_t name_len)
+{
+    STACK_OF(X509_BUFFER) *tmp_stack = NULL;
+    X509_BUFFER *copy = NULL;
+    int ret = 0;
+
+    if ((copy = buffer_from_bytes(name, name_len)) == NULL)
+        goto err;
+
+    tmp_stack = *buffer_stack;
+    if (tmp_stack == NULL && (tmp_stack = sk_X509_BUFFER_new(buffer_cmp)) == NULL)
+        goto err;
+
+    if (!sk_X509_BUFFER_push(tmp_stack, copy))
+        goto err;
+
+    ret = 1;
+    copy = NULL;
+    *buffer_stack = tmp_stack;
+    tmp_stack = NULL;
+
+err:
+    sk_X509_BUFFER_pop_free(tmp_stack, buffer_free);
+    buffer_free(copy);
+
+    return ret;
 }

-static void str_free(char *s)
+static int add_string_to_buffer_stack(STACK_OF(X509_BUFFER) **buffer_stack,
+    const uint8_t *name, size_t name_len)
 {
-    OPENSSL_free(s);
+    STACK_OF(X509_BUFFER) *tmp_stack = NULL;
+    X509_BUFFER *copy = NULL;
+    int ret = 0;
+
+    if ((copy = buffer_from_string(name, name_len)) == NULL)
+        goto err;
+
+    tmp_stack = *buffer_stack;
+    if (tmp_stack == NULL && (tmp_stack = sk_X509_BUFFER_new(buffer_cmp)) == NULL)
+        goto err;
+
+    if (!sk_X509_BUFFER_push(tmp_stack, copy))
+        goto err;
+
+    ret = 1;
+    copy = NULL;
+    *buffer_stack = tmp_stack;
+    tmp_stack = NULL;
+
+err:
+    sk_X509_BUFFER_pop_free(tmp_stack, buffer_free);
+    buffer_free(copy);
+
+    return ret;
 }

-static int int_x509_param_set_hosts(X509_VERIFY_PARAM *vpm, int mode,
-    const char *name, size_t namelen)
+static int validate_string_name(const char *name, size_t *name_len)
 {
-    char *copy;
+    size_t len = *name_len;
+
+    if (name == NULL || len == 0)
+        return 0;

     /*
-     * Refuse names with embedded NUL bytes, except perhaps as final byte.
-     * XXX: Do we need to push an error onto the error stack?
+     * Accept the trailing \0 byte if this is a C string. This is to
+     * preserver behaviour that is traditional for the
+     * set1_[host|email] functions.
      */
-    if (namelen == 0 || name == NULL)
-        namelen = name ? strlen(name) : 0;
-    else if (name != NULL
-        && memchr(name, '\0', namelen > 1 ? namelen - 1 : namelen) != NULL)
+    if (name[len - 1] == '\0')
+        len--;
+
+    /* Refuse the empty string */
+    if (len == 0)
         return 0;
-    if (namelen > 0 && name[namelen - 1] == '\0')
-        --namelen;

-    if (mode == SET_HOST) {
-        sk_OPENSSL_STRING_pop_free(vpm->hosts, str_free);
-        vpm->hosts = NULL;
-    }
-    if (name == NULL || namelen == 0)
+    /* Refuse values with embedded \0 bytes other than at the end */
+    if (memchr(name, '\0', len) != NULL)
+        return 0;
+
+    *name_len = len;
+    return 1;
+}
+
+/*
+ * Default input validation for verification parameter names. As these
+ * could potentially come from untrusted input, doing basic input
+ * validation makes sense, and ensures that subsequent parsing or
+ * comparisons do not need to handle extreme out of range input.
+ */
+
+/* Default ip name input validation */
+static int validate_ip_name(const uint8_t *name, size_t len)
+{
+    if (name != NULL && (len == 4 || len == 16))
+        return 1;
+    return 0;
+}
+
+static ossl_charset_t ossl_name_charset(int c, ossl_charset_t charset)
+{
+    if (ossl_isalnum(c))
         return 1;
+    if (ossl_isascii(c))
+        return charset == OSSL_CHARSET_ASCII
+            || charset == OSSL_CHARSET_NONASCII;
+    return charset == OSSL_CHARSET_NONASCII;
+}

-    copy = OPENSSL_strndup(name, namelen);
-    if (copy == NULL)
+static int is_label_ok(int c, ossl_charset_t charset)
+{
+    if (!ossl_name_charset(c, charset) && c != '_')
         return 0;
+    else
+        return c != '.' && c != '-';
+}
+
+/* Default host name input validation */
+static int validate_hostname_part(const char *name, size_t len,
+    ossl_charset_t charset)
+{
+    size_t i, part_len;
+    char c, prev;

-    if (vpm->hosts == NULL && (vpm->hosts = sk_OPENSSL_STRING_new_null()) == NULL) {
-        OPENSSL_free(copy);
+    if (len < 2 || len > 256)
         return 0;
-    }

-    if (!sk_OPENSSL_STRING_push(vpm->hosts, copy)) {
-        OPENSSL_free(copy);
-        if (sk_OPENSSL_STRING_num(vpm->hosts) == 0) {
-            sk_OPENSSL_STRING_free(vpm->hosts);
-            vpm->hosts = NULL;
+    part_len = 0;
+    prev = '\0';
+    for (i = 0; i < len; i++) {
+        c = name[i];
+        if (c == '.') {
+            /*
+             * Can not start a label with a .
+             * unless it is the very first character.
+             */
+            if (part_len == 0 && i != 0)
+                return 0;
+            /* Can not end a label with a - */
+            if (prev == '-')
+                return 0;
+            part_len = 0;
+        } else {
+            /* Can not start a label with a - */
+            if (part_len == 0 && c == '-') {
+                return 0;
+            }
+            if (!is_label_ok(c, charset) && c != '-')
+                return 0;
+            part_len++;
         }
+        if (part_len > 63)
+            return 0;
+
+        prev = c;
+    }
+    /* Can not end with a . or a _ */
+    if (prev == '.' || prev == '-')
         return 0;
+
+    return 1;
+}
+
+static int validate_local_part(const char *name, size_t len,
+    ossl_charset_t *out_charset)
+{
+    ossl_charset_t charset = OSSL_CHARSET_ASCII;
+    size_t i;
+
+    for (i = 0; i < len; i++) {
+        if (name[i] == '\0')
+            return 0;
+        if (!ossl_isascii(name[i]))
+            charset = OSSL_CHARSET_NONASCII;
     }

+    *out_charset = charset;
     return 1;
 }

+/* Default email name input validation */
+static int validate_email_name(const char *name, size_t len, int rfc822)
+{
+    size_t dns_len, local_len;
+    const char *at, *next, *dnsname;
+    ossl_charset_t local_charset;
+
+    /*
+     * 64 for local part, 1 for @, 255 for domain name
+     */
+    if (len > 320)
+        goto err;
+
+    /* Reject it if there is no @ */
+    if ((at = memchr(name, '@', len)) == NULL)
+        goto err;
+
+    /* Go to the last @ */
+    while ((next = memchr(at + 1, '@', len - (at - name + 1))) != NULL)
+        at = next;
+
+    /* Ensure the local part is not oversize */
+    local_len = at - name;
+    if (local_len > 64)
+        goto err;
+
+    if (!validate_local_part(name, local_len, &local_charset))
+        goto err;
+
+    if (rfc822 && local_charset == OSSL_CHARSET_NONASCII)
+        goto err;
+
+    if (!rfc822 && local_charset == OSSL_CHARSET_ASCII)
+        goto err;
+
+    /* What is after the @ must be valid as a dns name */
+    dnsname = at + 1;
+    dns_len = len - local_len - 1;
+
+    if (rfc822)
+        return validate_hostname_part(dnsname, dns_len, OSSL_CHARSET_ASCII_ALNUM);
+
+    return validate_hostname_part(dnsname, dns_len, OSSL_CHARSET_NONASCII);
+
+err:
+    ERR_raise(ERR_LIB_X509, ERR_R_PASSED_INVALID_ARGUMENT);
+    return 0;
+}
+
 X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void)
 {
     X509_VERIFY_PARAM *param;
@@ -97,10 +370,11 @@ void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param)
     if (param == NULL)
         return;
     sk_ASN1_OBJECT_pop_free(param->policies, ASN1_OBJECT_free);
-    sk_OPENSSL_STRING_pop_free(param->hosts, str_free);
+    clear_buffer_stack(&param->hosts);
+    clear_buffer_stack(&param->ips);
+    clear_buffer_stack(&param->rfc822s);
+    clear_buffer_stack(&param->smtputf8s);
     OPENSSL_free(param->peername);
-    OPENSSL_free(param->email);
-    OPENSSL_free(param->ip);
     OPENSSL_free(param);
 }

@@ -192,24 +466,28 @@ int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *dest,
     x509_verify_param_copy(hostflags, 0);

     if (test_x509_verify_param_copy(hosts, NULL)) {
-        sk_OPENSSL_STRING_pop_free(dest->hosts, str_free);
-        dest->hosts = NULL;
-        if (src->hosts != NULL) {
-            dest->hosts = sk_OPENSSL_STRING_deep_copy(src->hosts, str_copy, str_free);
-            if (dest->hosts == NULL)
-                return 0;
-        }
+        if (!replace_buffer_stack(&dest->hosts, &src->hosts))
+            return 0;
     }
+    x509_verify_param_copy(validate_host, NULL);

-    if (test_x509_verify_param_copy(email, NULL)) {
-        if (!X509_VERIFY_PARAM_set1_email(dest, src->email, src->emaillen))
+    if (test_x509_verify_param_copy(ips, NULL)) {
+        if (!replace_buffer_stack(&dest->ips, &src->ips))
             return 0;
     }
+    x509_verify_param_copy(validate_ip, NULL);

-    if (test_x509_verify_param_copy(ip, NULL)) {
-        if (!X509_VERIFY_PARAM_set1_ip(dest, src->ip, src->iplen))
+    if (test_x509_verify_param_copy(rfc822s, NULL)) {
+        if (!replace_buffer_stack(&dest->rfc822s, &src->rfc822s))
             return 0;
     }
+    x509_verify_param_copy(validate_rfc822, NULL);
+
+    if (test_x509_verify_param_copy(smtputf8s, NULL)) {
+        if (!replace_buffer_stack(&dest->smtputf8s, &src->smtputf8s))
+            return 0;
+    }
+    x509_verify_param_copy(validate_smtputf8, NULL);

     return 1;
 }
@@ -231,31 +509,6 @@ int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to,
     return ret;
 }

-static int int_x509_param_set1(char **pdest, size_t *pdestlen,
-    const char *src, size_t srclen)
-{
-    char *tmp;
-
-    if (src != NULL) {
-        if (srclen == 0)
-            srclen = strlen(src);
-
-        tmp = OPENSSL_malloc(srclen + 1);
-        if (tmp == NULL)
-            return 0;
-        memcpy(tmp, src, srclen);
-        tmp[srclen] = '\0'; /* enforce NUL termination */
-    } else {
-        tmp = NULL;
-        srclen = 0;
-    }
-    OPENSSL_free(*pdest);
-    *pdest = tmp;
-    if (pdestlen != NULL)
-        *pdestlen = srclen;
-    return 1;
-}
-
 int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name)
 {
     OPENSSL_free(param->name);
@@ -322,10 +575,17 @@ void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level)

 time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param)
 {
-    return param->check_time;
+    /* This will be in the time_t range, because the only setter uses time_t */
+    return (time_t)param->check_time;
 }

 void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t)
+{
+    param->check_time = (int64_t)t;
+    param->flags |= X509_V_FLAG_USE_CHECK_TIME;
+}
+
+void ossl_x509_verify_param_set_time_posix(X509_VERIFY_PARAM *param, int64_t t)
 {
     param->check_time = t;
     param->flags |= X509_V_FLAG_USE_CHECK_TIME;
@@ -382,19 +642,169 @@ int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param,

 char *X509_VERIFY_PARAM_get0_host(X509_VERIFY_PARAM *param, int idx)
 {
-    return sk_OPENSSL_STRING_value(param->hosts, idx);
+    X509_BUFFER *buf = sk_X509_BUFFER_value(param->hosts, idx);
+
+    return (buf != NULL) ? (char *)buf->data : NULL;
 }

 int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
-    const char *name, size_t namelen)
+    const char *dnsname, size_t len)
 {
-    return int_x509_param_set_hosts(param, SET_HOST, name, namelen);
+    clear_buffer_stack(&param->hosts);
+    if (dnsname == NULL)
+        return 1;
+    if (len == 0)
+        len = strlen(dnsname);
+    if (len == 0)
+        return 1;
+    return X509_VERIFY_PARAM_add1_host(param, dnsname, len);
 }

 int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
-    const char *name, size_t namelen)
+    const char *dnsname, size_t len)
+{
+    if (dnsname == NULL)
+        return 1;
+    if (len == 0)
+        len = strlen(dnsname);
+    if (len == 0)
+        return 1;
+    if (!validate_string_name(dnsname, &len))
+        return 0;
+    if (param->validate_host != NULL) {
+        if (!param->validate_host(dnsname, len))
+            return 0;
+    } else {
+        if (!validate_hostname_part(dnsname, len, OSSL_CHARSET_ASCII_ALNUM))
+            return 0;
+    }
+    return add_string_to_buffer_stack(&param->hosts, (const uint8_t *)dnsname, len);
+}
+
+void X509_VERIFY_PARAM_set1_host_input_validation(X509_VERIFY_PARAM *param,
+    int (*validate_host)(const char *name, size_t len))
 {
-    return int_x509_param_set_hosts(param, ADD_HOST, name, namelen);
+    param->validate_host = validate_host;
+}
+
+int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
+    const uint8_t *ip, size_t len)
+{
+    clear_buffer_stack(&param->ips);
+    if (ip == NULL)
+        return 1;
+    return X509_VERIFY_PARAM_add1_ip(param, ip, len);
+}
+
+int X509_VERIFY_PARAM_add1_ip(X509_VERIFY_PARAM *param,
+    const uint8_t *ip, size_t len)
+{
+    if (param->validate_ip != NULL) {
+        if (!param->validate_ip(ip, len))
+            return 0;
+    } else {
+        if (!validate_ip_name(ip, len))
+            return 0;
+    }
+    return add_bytes_to_buffer_stack(&param->ips, ip, len);
+}
+
+void X509_VERIFY_PARAM_set1_ip_input_validation(X509_VERIFY_PARAM *param,
+    int (*validate_ip)(const uint8_t *name, size_t len))
+{
+    param->validate_ip = validate_ip;
+}
+
+char *X509_VERIFY_PARAM_get0_email(X509_VERIFY_PARAM *param)
+{
+    X509_BUFFER *buf = sk_X509_BUFFER_value(param->rfc822s, 0);
+
+    if ((buf = sk_X509_BUFFER_value(param->rfc822s, 0)) != NULL
+        || (buf = sk_X509_BUFFER_value(param->smtputf8s, 0)) != NULL)
+        return (char *)buf->data;
+
+    return NULL;
+}
+
+int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
+    const char *email, size_t len)
+{
+    int ret = 0;
+
+    if (X509_VERIFY_PARAM_set1_smtputf8(param, email, len))
+        ret = 1;
+    if (X509_VERIFY_PARAM_set1_rfc822(param, email, len))
+        ret = 1;
+
+    return ret;
+}
+
+int X509_VERIFY_PARAM_set1_smtputf8(X509_VERIFY_PARAM *param,
+    const char *email, size_t len)
+{
+    clear_buffer_stack(&param->smtputf8s);
+    if (email == NULL)
+        return 1;
+    return X509_VERIFY_PARAM_add1_smtputf8(param, email, len);
+}
+
+int X509_VERIFY_PARAM_add1_smtputf8(X509_VERIFY_PARAM *param,
+    const char *email, size_t len)
+{
+    if (len == 0)
+        len = strlen(email);
+    if (!validate_string_name(email, &len))
+        return 0;
+    if (param->validate_smtputf8 != NULL) {
+        if (!param->validate_smtputf8(email, len))
+            return 0;
+    } else {
+        if (!validate_email_name(email, len, /*rfc822 =*/0))
+            return 0;
+    }
+
+    return add_string_to_buffer_stack(&param->smtputf8s,
+        (const uint8_t *)email, len);
+}
+
+void X509_VERIFY_PARAM_set1_smtputf8_input_validation(X509_VERIFY_PARAM *param,
+    int (*validate_smtputf8)(const char *name, size_t len))
+{
+    param->validate_smtputf8 = validate_smtputf8;
+}
+
+int X509_VERIFY_PARAM_set1_rfc822(X509_VERIFY_PARAM *param,
+    const char *email, size_t len)
+{
+    clear_buffer_stack(&param->rfc822s);
+    if (email == NULL)
+        return 1;
+    return X509_VERIFY_PARAM_add1_rfc822(param, email, len);
+}
+
+int X509_VERIFY_PARAM_add1_rfc822(X509_VERIFY_PARAM *param,
+    const char *email, size_t len)
+{
+    if (len == 0)
+        len = strlen(email);
+    if (!validate_string_name(email, &len))
+        return 0;
+    if (param->validate_rfc822 != NULL) {
+        if (!param->validate_rfc822(email, len))
+            return 0;
+    } else {
+        if (!validate_email_name(email, len, /*rfc822 =*/1))
+            return 0;
+    }
+
+    return add_string_to_buffer_stack(&param->rfc822s,
+        (const uint8_t *)email, len);
+}
+
+void X509_VERIFY_PARAM_set1_rfc822_input_validation(X509_VERIFY_PARAM *param,
+    int (*validate_rfc822)(const char *name, size_t len))
+{
+    param->validate_rfc822 = validate_rfc822;
 }

 void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
@@ -431,56 +841,56 @@ void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *to,
         from->peername = NULL;
 }

-char *X509_VERIFY_PARAM_get0_email(X509_VERIFY_PARAM *param)
+static const unsigned char *int_X509_VERIFY_PARAM_get0_ip(X509_VERIFY_PARAM *param, size_t *plen, size_t idx)
 {
-    return param->email;
-}
+    X509_BUFFER *buf;

-int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
-    const char *email, size_t emaillen)
-{
-    return int_x509_param_set1(&param->email, &param->emaillen,
-        email, emaillen);
-}
+    if (idx > INT_MAX)
+        return NULL;

-static unsigned char *int_X509_VERIFY_PARAM_get0_ip(X509_VERIFY_PARAM *param, size_t *plen)
-{
-    if (param == NULL || param->ip == NULL) {
+    if (param == NULL || param->ips == NULL) {
         ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
         return NULL;
     }
-    if (plen != NULL)
-        *plen = param->iplen;
-    return param->ip;
+
+    buf = sk_X509_BUFFER_value(param->ips, (int)idx);
+
+    if (buf != NULL) {
+        if (plen != NULL)
+            *plen = buf->len;
+        return (unsigned char *)buf->data;
+    }
+    return NULL;
 }

 char *X509_VERIFY_PARAM_get1_ip_asc(X509_VERIFY_PARAM *param)
 {
     size_t iplen;
-    unsigned char *ip = int_X509_VERIFY_PARAM_get0_ip(param, &iplen);
+    const unsigned char *ip = int_X509_VERIFY_PARAM_get0_ip(param, &iplen, 0);

-    return ip == NULL ? NULL : ossl_ipaddr_to_asc(ip, iplen);
+    return ip == NULL ? NULL : ossl_ipaddr_to_asc(ip, (int)iplen);
 }

-int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
-    const unsigned char *ip, size_t iplen)
+int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc)
 {
-    if (iplen != 0 && iplen != 4 && iplen != 16) {
-        ERR_raise(ERR_LIB_X509, ERR_R_PASSED_INVALID_ARGUMENT);
+    unsigned char ipout[16];
+    size_t iplen;
+
+    if (ipasc == NULL)
+        return X509_VERIFY_PARAM_set1_ip(param, NULL, 0);
+    if ((iplen = (size_t)ossl_a2i_ipadd(ipout, ipasc)) == 0)
         return 0;
-    }
-    return int_x509_param_set1((char **)&param->ip, &param->iplen,
-        (char *)ip, iplen);
+    return X509_VERIFY_PARAM_set1_ip(param, ipout, iplen);
 }

-int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc)
+int X509_VERIFY_PARAM_add1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc)
 {
     unsigned char ipout[16];
-    size_t iplen = (size_t)ossl_a2i_ipadd(ipout, ipasc);
+    size_t iplen;

-    if (iplen == 0)
+    if ((iplen = (size_t)ossl_a2i_ipadd(ipout, ipasc)) == 0)
         return 0;
-    return X509_VERIFY_PARAM_set1_ip(param, ipout, iplen);
+    return X509_VERIFY_PARAM_add1_ip(param, ipout, iplen);
 }

 int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param)
@@ -498,8 +908,6 @@ const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param)
     return param->name;
 }

-#define vpm_empty_id NULL, 0U, NULL, NULL, 0, NULL, 0
-
 /*
  * Default verify parameters: these are used for various applications and can
  * be overridden by the user specified table. NB: the 'name' field *must* be
@@ -507,66 +915,54 @@ const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param)
  */

 static const X509_VERIFY_PARAM default_table[] = {
-    { "code_sign", /* Code sign parameters */
-        0, /* check time to use */
-        0, /* inheritance flags */
-        0, /* flags */
-        X509_PURPOSE_CODE_SIGN, /* purpose */
-        X509_TRUST_OBJECT_SIGN, /* trust */
-        -1, /* depth */
-        -1, /* auth_level */
-        NULL, /* policies */
-        vpm_empty_id },
-    { "default", /* X509 default parameters */
-        0, /* check time to use */
-        0, /* inheritance flags */
-        X509_V_FLAG_TRUSTED_FIRST, /* flags */
-        0, /* purpose */
-        0, /* trust */
-        100, /* depth */
-        -1, /* auth_level */
-        NULL, /* policies */
-        vpm_empty_id },
-    { "pkcs7", /* S/MIME sign parameters */
-        0, /* check time to use */
-        0, /* inheritance flags */
-        0, /* flags */
-        X509_PURPOSE_SMIME_SIGN, /* purpose */
-        X509_TRUST_EMAIL, /* trust */
-        -1, /* depth */
-        -1, /* auth_level */
-        NULL, /* policies */
-        vpm_empty_id },
-    { "smime_sign", /* S/MIME sign parameters */
-        0, /* check time to use */
-        0, /* inheritance flags */
-        0, /* flags */
-        X509_PURPOSE_SMIME_SIGN, /* purpose */
-        X509_TRUST_EMAIL, /* trust */
-        -1, /* depth */
-        -1, /* auth_level */
-        NULL, /* policies */
-        vpm_empty_id },
-    { "ssl_client", /* SSL/TLS client parameters */
-        0, /* check time to use */
-        0, /* inheritance flags */
-        0, /* flags */
-        X509_PURPOSE_SSL_CLIENT, /* purpose */
-        X509_TRUST_SSL_CLIENT, /* trust */
-        -1, /* depth */
-        -1, /* auth_level */
-        NULL, /* policies */
-        vpm_empty_id },
-    { "ssl_server", /* SSL/TLS server parameters */
-        0, /* check time to use */
-        0, /* inheritance flags */
-        0, /* flags */
-        X509_PURPOSE_SSL_SERVER, /* purpose */
-        X509_TRUST_SSL_SERVER, /* trust */
-        -1, /* depth */
-        -1, /* auth_level */
-        NULL, /* policies */
-        vpm_empty_id }
+    {
+        .name = "code_sign", /* Code sign parameters */
+        .purpose = X509_PURPOSE_CODE_SIGN,
+        .trust = X509_TRUST_OBJECT_SIGN,
+        .depth = -1,
+        .auth_level = -1,
+    },
+    {
+        .name = "default", /* X509 default parameters */
+        .flags = X509_V_FLAG_TRUSTED_FIRST,
+        .depth = 100,
+        .auth_level = -1,
+    },
+    {
+        .name = "pkcs7", /* S/MIME sign parameters */
+        .purpose = X509_PURPOSE_SMIME_SIGN,
+        .trust = X509_TRUST_EMAIL,
+        .depth = -1,
+        .auth_level = -1,
+    },
+    {
+        .name = "smime_encrypt", /* S/MIME encryption parameters */
+        .purpose = X509_PURPOSE_SMIME_ENCRYPT,
+        .trust = X509_TRUST_EMAIL,
+        .depth = -1,
+        .auth_level = -1,
+    },
+    {
+        .name = "smime_sign", /* S/MIME signature parameters */
+        .purpose = X509_PURPOSE_SMIME_SIGN,
+        .trust = X509_TRUST_EMAIL,
+        .depth = -1,
+        .auth_level = -1,
+    },
+    {
+        .name = "ssl_client", /* SSL/TLS client parameters */
+        .purpose = X509_PURPOSE_SSL_CLIENT,
+        .trust = X509_TRUST_SSL_CLIENT,
+        .depth = -1,
+        .auth_level = -1,
+    },
+    {
+        .name = "ssl_server", /* SSL/TLS server parameters */
+        .purpose = X509_PURPOSE_SSL_SERVER,
+        .trust = X509_TRUST_SSL_SERVER,
+        .depth = -1,
+        .auth_level = -1,
+    }
 };

 static STACK_OF(X509_VERIFY_PARAM) *param_table = NULL;
diff --git a/deps/openssl/openssl/crypto/x509/x509aset.c b/deps/openssl/openssl/crypto/x509/x509aset.c
index 03afc4ae566..17b988c67c9 100644
--- a/deps/openssl/openssl/crypto/x509/x509aset.c
+++ b/deps/openssl/openssl/crypto/x509/x509aset.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,6 +12,8 @@
 #include <openssl/x509v3.h>
 #include "x509_acert.h"

+#include <crypto/asn1.h>
+
 static int replace_gentime(ASN1_STRING **dest, const ASN1_GENERALIZEDTIME *src)
 {
     ASN1_STRING *s;
diff --git a/deps/openssl/openssl/crypto/x509/x509cset.c b/deps/openssl/openssl/crypto/x509/x509cset.c
index 6c86bb0d5e0..ec3e1f53603 100644
--- a/deps/openssl/openssl/crypto/x509/x509cset.c
+++ b/deps/openssl/openssl/crypto/x509/x509cset.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -75,7 +75,7 @@ int X509_CRL_up_ref(X509_CRL *crl)
 {
     int i;

-    if (CRYPTO_UP_REF(&crl->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&crl->references, &i))
         return 0;

     REF_PRINT_COUNT("X509_CRL", i, crl);
@@ -110,7 +110,7 @@ ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl)
 }
 #endif

-X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl)
+const X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl)
 {
     return crl->crl.issuer;
 }
@@ -120,11 +120,16 @@ const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl)
     return crl->crl.extensions;
 }

-STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl)
+STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(const X509_CRL *crl)
 {
     return crl->crl.revoked;
 }

+const X509_ALGOR *X509_CRL_get0_tbs_sigalg(const X509_CRL *crl)
+{
+    return &crl->crl.sig_alg;
+}
+
 void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig,
     const X509_ALGOR **palg)
 {
diff --git a/deps/openssl/openssl/crypto/x509/x509name.c b/deps/openssl/openssl/crypto/x509/x509name.c
index 5ecc14c1833..1cb9ad00f4d 100644
--- a/deps/openssl/openssl/crypto/x509/x509name.c
+++ b/deps/openssl/openssl/crypto/x509/x509name.c
@@ -1,11 +1,12 @@
 /*
- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
+#include "internal/deprecated.h"

 #include <stdio.h>
 #include "internal/cryptlib.h"
@@ -16,6 +17,8 @@
 #include <openssl/x509.h>
 #include "crypto/x509.h"

+OSSL_BEGIN_ALLOW_DEPRECATED
+#if !defined(OPENSSL_NO_DEPRECATED_4_0)
 int X509_NAME_get_text_by_NID(const X509_NAME *name, int nid,
     char *buf, int len)
 {
@@ -42,10 +45,13 @@ int X509_NAME_get_text_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
     if (len <= 0)
         return 0;
     i = (data->length > (len - 1)) ? (len - 1) : data->length;
-    memcpy(buf, data->data, i);
+    if (i > 0)
+        memcpy(buf, data->data, i);
     buf[i] = '\0';
     return i;
 }
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_0) */
+OSSL_END_ALLOW_DEPRECATED

 int X509_NAME_entry_count(const X509_NAME *name)
 {
@@ -89,7 +95,7 @@ int X509_NAME_get_index_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
     return -1;
 }

-X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc)
+const X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc)
 {
     if (name == NULL || sk_X509_NAME_ENTRY_num(name->entries) <= loc
         || loc < 0)
@@ -327,9 +333,12 @@ int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
                    OBJ_obj2nid(ne->object))
             ? 1
             : 0;
-    if (len < 0)
-        len = strlen((const char *)bytes);
-    i = ASN1_STRING_set(ne->value, bytes, len);
+    if (len < -1)
+        return 0;
+    if (len == -1)
+        i = ossl_asn1_string_set1_string(ne->value, (const char *)bytes);
+    else
+        i = ossl_asn1_string_set1_data(ne->value, bytes, (size_t)len);
     if (!i)
         return 0;
     if (type != V_ASN1_UNDEF) {
@@ -341,14 +350,14 @@ int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
     return 1;
 }

-ASN1_OBJECT *X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne)
+const ASN1_OBJECT *X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne)
 {
     if (ne == NULL)
         return NULL;
     return ne->object;
 }

-ASN1_STRING *X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne)
+const ASN1_STRING *X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne)
 {
     if (ne == NULL)
         return NULL;
diff --git a/deps/openssl/openssl/crypto/x509/x509spki.c b/deps/openssl/openssl/crypto/x509/x509spki.c
index 142eeb79bd5..3ed4ab9af29 100644
--- a/deps/openssl/openssl/crypto/x509/x509spki.c
+++ b/deps/openssl/openssl/crypto/x509/x509spki.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -34,7 +34,7 @@ NETSCAPE_SPKI *NETSCAPE_SPKI_b64_decode(const char *str, int len)
     int spki_len;
     NETSCAPE_SPKI *spki;
     if (len <= 0)
-        len = strlen(str);
+        len = (int)strlen(str);
     if ((spki_der = OPENSSL_malloc(len + 1)) == NULL)
         return NULL;
     spki_len = EVP_DecodeBlock(spki_der, (const unsigned char *)str, len);
@@ -61,7 +61,7 @@ char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *spki)
     if (der_len <= 0)
         return NULL;
     der_spki = OPENSSL_malloc(der_len);
-    b64_str = OPENSSL_malloc(der_len * 2);
+    b64_str = OPENSSL_malloc_array(der_len, 2);
     if (der_spki == NULL || b64_str == NULL) {
         OPENSSL_free(der_spki);
         OPENSSL_free(b64_str);
diff --git a/deps/openssl/openssl/crypto/x509/x_all.c b/deps/openssl/openssl/crypto/x509/x_all.c
index 1de8274c28c..ef16a7fc884 100644
--- a/deps/openssl/openssl/crypto/x509/x_all.c
+++ b/deps/openssl/openssl/crypto/x509/x_all.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -25,12 +25,111 @@
 #include <openssl/dsa.h>
 #include <openssl/x509v3.h>
 #include "internal/asn1.h"
+#include "crypto/asn1.h"
 #include "crypto/pkcs7.h"
 #include "crypto/x509.h"
 #include "crypto/x509_acert.h"
 #include "crypto/rsa.h"
+#include "x509_local.h"

-int X509_verify(X509 *a, EVP_PKEY *r)
+static void *RSA_new_thunk(void)
+{
+    return RSA_new();
+}
+
+static void *d2i_RSA_PUBKEY_thunk(void **a, const unsigned char **in, long len)
+{
+    return d2i_RSA_PUBKEY((RSA **)a, in, len);
+}
+
+static int i2d_RSA_PUBKEY_thunk(const void *a, unsigned char **out)
+{
+    return i2d_RSA_PUBKEY((const RSA *)a, out);
+}
+
+static void *EVP_PKEY_new_thunk(void)
+{
+    return EVP_PKEY_new();
+}
+
+static void *d2i_AutoPrivateKey_thunk(void **a, const unsigned char **in,
+    long len)
+{
+    return d2i_AutoPrivateKey((EVP_PKEY **)a, in, len);
+}
+
+static void *d2i_PUBKEY_thunk(void **a, const unsigned char **in, long len)
+{
+    return d2i_PUBKEY((EVP_PKEY **)a, in, len);
+}
+
+static int i2d_PrivateKey_thunk(const void *a, unsigned char **out)
+{
+    return i2d_PrivateKey((const EVP_PKEY *)a, out);
+}
+
+static int i2d_PUBKEY_thunk(const void *a, unsigned char **out)
+{
+    return i2d_PUBKEY((const EVP_PKEY *)a, out);
+}
+
+#ifndef OPENSSL_NO_DSA
+static void *DSA_new_thunk(void)
+{
+    return DSA_new();
+}
+
+static void *d2i_DSAPrivateKey_thunk(void **a, const unsigned char **in,
+    long len)
+{
+    return d2i_DSAPrivateKey((DSA **)a, in, len);
+}
+
+static int i2d_DSAPrivateKey_thunk(const void *a, unsigned char **out)
+{
+    return i2d_DSAPrivateKey((const DSA *)a, out);
+}
+
+static void *d2i_DSA_PUBKEY_thunk(void **a, const unsigned char **in, long len)
+{
+    return d2i_DSA_PUBKEY((DSA **)a, in, len);
+}
+
+static int i2d_DSA_PUBKEY_thunk(const void *a, unsigned char **out)
+{
+    return i2d_DSA_PUBKEY((const DSA *)a, out);
+}
+#endif
+
+#ifndef OPENSSL_NO_EC
+static void *EC_KEY_new_thunk(void)
+{
+    return EC_KEY_new();
+}
+
+static void *d2i_EC_PUBKEY_thunk(void **a, const unsigned char **in, long len)
+{
+    return d2i_EC_PUBKEY((EC_KEY **)a, in, len);
+}
+
+static int i2d_EC_PUBKEY_thunk(const void *a, unsigned char **out)
+{
+    return i2d_EC_PUBKEY((const EC_KEY *)a, out);
+}
+
+static void *d2i_ECPrivateKey_thunk(void **a, const unsigned char **in,
+    long len)
+{
+    return d2i_ECPrivateKey((EC_KEY **)a, in, len);
+}
+
+static int i2d_ECPrivateKey_thunk(const void *a, unsigned char **out)
+{
+    return i2d_ECPrivateKey((const EC_KEY *)a, out);
+}
+#endif
+
+int X509_verify(const X509 *a, EVP_PKEY *r)
 {
     if (X509_ALGOR_cmp(&a->sig_alg, &a->cert_info.signature) != 0)
         return 0;
@@ -74,14 +173,32 @@ int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r)
         &a->sig_algor, a->signature, a->spkac, r);
 }

+/* Detect invalid empty SKID or AKID extensions. */
+
+static int bad_keyid_exts(const STACK_OF(X509_EXTENSION) *exts)
+{
+    int i, n = sk_X509_EXTENSION_num(exts);
+
+    for (i = 0; i < n; ++i) {
+        X509_EXTENSION *ext = sk_X509_EXTENSION_value(exts, i);
+
+        if (ossl_ignored_x509_extension(ext, X509V3_ADD_DEFAULT))
+            return 1;
+    }
+    return 0;
+}
+
 int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md)
 {
+    const STACK_OF(X509_EXTENSION) *exts;
+
     if (x == NULL) {
         ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
-    if (sk_X509_EXTENSION_num(X509_get0_extensions(x)) > 0
-        && !X509_set_version(x, X509_VERSION_3))
+    if ((exts = X509_get0_extensions(x)) != NULL
+        && sk_X509_EXTENSION_num(exts) > 0
+        && (bad_keyid_exts(exts) || !X509_set_version(x, X509_VERSION_3)))
         return 0;

     /*
@@ -99,10 +216,14 @@ int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md)

 int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx)
 {
+    const STACK_OF(X509_EXTENSION) *exts;
+
     if (x == NULL) {
         ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
+    if ((exts = X509_get0_extensions(x)) != NULL && bad_keyid_exts(exts))
+        return 0;
     if (sk_X509_EXTENSION_num(X509_get0_extensions(x)) > 0
         && !X509_set_version(x, X509_VERSION_3))
         return 0;
@@ -139,10 +260,18 @@ X509 *X509_load_http(const char *url, BIO *bio, BIO *rbio, int timeout)

 int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md)
 {
+    STACK_OF(X509_EXTENSION) *exts;
+    int bad = 0;
+
     if (x == NULL) {
         ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
+    if ((exts = ossl_x509_req_get1_extensions_by_nid(x, NID_ext_req)) != NULL)
+        bad = bad_keyid_exts(exts);
+    sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free);
+    if (bad)
+        return 0;
     x->req_info.enc.modified = 1;
     return ASN1_item_sign_ex(ASN1_ITEM_rptr(X509_REQ_INFO), &x->sig_alg, NULL,
         x->signature, &x->req_info, NULL,
@@ -151,10 +280,18 @@ int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md)

 int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx)
 {
+    STACK_OF(X509_EXTENSION) *exts;
+    int bad = 0;
+
     if (x == NULL) {
         ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
+    if ((exts = ossl_x509_req_get1_extensions_by_nid(x, NID_ext_req)) != NULL)
+        bad = bad_keyid_exts(exts);
+    sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free);
+    if (bad)
+        return 0;
     x->req_info.enc.modified = 1;
     return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_REQ_INFO),
         &x->sig_alg, NULL, x->signature, &x->req_info,
@@ -350,10 +487,8 @@ RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa)

 RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa)
 {
-    return ASN1_d2i_fp((void *(*)(void))
-                           RSA_new,
-        (D2I_OF(void))d2i_RSA_PUBKEY, fp,
-        (void **)rsa);
+    return ASN1_d2i_fp(RSA_new_thunk, d2i_RSA_PUBKEY_thunk, fp,
+        CHECKED_PPTR_OF(RSA, rsa));
 }

 int i2d_RSAPublicKey_fp(FILE *fp, const RSA *rsa)
@@ -363,7 +498,7 @@ int i2d_RSAPublicKey_fp(FILE *fp, const RSA *rsa)

 int i2d_RSA_PUBKEY_fp(FILE *fp, const RSA *rsa)
 {
-    return ASN1_i2d_fp((I2D_OF(void))i2d_RSA_PUBKEY, fp, rsa);
+    return ASN1_i2d_fp(i2d_RSA_PUBKEY_thunk, fp, rsa);
 }
 #endif

@@ -384,7 +519,8 @@ RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa)

 RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa)
 {
-    return ASN1_d2i_bio_of(RSA, RSA_new, d2i_RSA_PUBKEY, bp, rsa);
+    return ASN1_d2i_bio(RSA_new_thunk, d2i_RSA_PUBKEY_thunk, bp,
+        CHECKED_PPTR_OF(RSA, rsa));
 }

 int i2d_RSAPublicKey_bio(BIO *bp, const RSA *rsa)
@@ -394,50 +530,55 @@ int i2d_RSAPublicKey_bio(BIO *bp, const RSA *rsa)

 int i2d_RSA_PUBKEY_bio(BIO *bp, const RSA *rsa)
 {
-    return ASN1_i2d_bio_of(RSA, i2d_RSA_PUBKEY, bp, rsa);
+    return ASN1_i2d_bio(i2d_RSA_PUBKEY_thunk, bp, rsa);
 }

 #ifndef OPENSSL_NO_DSA
 #ifndef OPENSSL_NO_STDIO
 DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa)
 {
-    return ASN1_d2i_fp_of(DSA, DSA_new, d2i_DSAPrivateKey, fp, dsa);
+    return ASN1_d2i_fp(DSA_new_thunk, d2i_DSAPrivateKey_thunk, fp,
+        CHECKED_PPTR_OF(DSA, dsa));
 }

 int i2d_DSAPrivateKey_fp(FILE *fp, const DSA *dsa)
 {
-    return ASN1_i2d_fp_of(DSA, i2d_DSAPrivateKey, fp, dsa);
+    return ASN1_i2d_fp(i2d_DSAPrivateKey_thunk, fp,
+        CHECKED_PTR_OF(const DSA, dsa));
 }

 DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa)
 {
-    return ASN1_d2i_fp_of(DSA, DSA_new, d2i_DSA_PUBKEY, fp, dsa);
+    return ASN1_d2i_fp(DSA_new_thunk, d2i_DSA_PUBKEY_thunk, fp,
+        CHECKED_PPTR_OF(DSA, dsa));
 }

 int i2d_DSA_PUBKEY_fp(FILE *fp, const DSA *dsa)
 {
-    return ASN1_i2d_fp_of(DSA, i2d_DSA_PUBKEY, fp, dsa);
+    return ASN1_i2d_fp(i2d_DSA_PUBKEY_thunk, fp,
+        CHECKED_PTR_OF(const DSA, dsa));
 }
 #endif

 DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa)
 {
-    return ASN1_d2i_bio_of(DSA, DSA_new, d2i_DSAPrivateKey, bp, dsa);
+    return ASN1_d2i_bio(DSA_new_thunk, d2i_DSAPrivateKey_thunk, bp, (void **)dsa);
 }

 int i2d_DSAPrivateKey_bio(BIO *bp, const DSA *dsa)
 {
-    return ASN1_i2d_bio_of(DSA, i2d_DSAPrivateKey, bp, dsa);
+    return ASN1_i2d_bio(i2d_DSAPrivateKey_thunk, bp,
+        CHECKED_PTR_OF(const DSA, dsa));
 }

 DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa)
 {
-    return ASN1_d2i_bio_of(DSA, DSA_new, d2i_DSA_PUBKEY, bp, dsa);
+    return ASN1_d2i_bio(DSA_new_thunk, d2i_DSA_PUBKEY_thunk, bp, (void **)dsa);
 }

 int i2d_DSA_PUBKEY_bio(BIO *bp, const DSA *dsa)
 {
-    return ASN1_i2d_bio_of(DSA, i2d_DSA_PUBKEY, bp, dsa);
+    return ASN1_i2d_bio(i2d_DSA_PUBKEY_thunk, bp, dsa);
 }

 #endif
@@ -446,49 +587,56 @@ int i2d_DSA_PUBKEY_bio(BIO *bp, const DSA *dsa)
 #ifndef OPENSSL_NO_STDIO
 EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey)
 {
-    return ASN1_d2i_fp_of(EC_KEY, EC_KEY_new, d2i_EC_PUBKEY, fp, eckey);
+    return ASN1_d2i_fp(EC_KEY_new_thunk, d2i_EC_PUBKEY_thunk, fp,
+        CHECKED_PPTR_OF(EC_KEY, eckey));
 }

 int i2d_EC_PUBKEY_fp(FILE *fp, const EC_KEY *eckey)
 {
-    return ASN1_i2d_fp_of(EC_KEY, i2d_EC_PUBKEY, fp, eckey);
+    return ASN1_i2d_fp(i2d_EC_PUBKEY_thunk, fp, CHECKED_PTR_OF(const EC_KEY, eckey));
 }

 EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey)
 {
-    return ASN1_d2i_fp_of(EC_KEY, EC_KEY_new, d2i_ECPrivateKey, fp, eckey);
+    return ASN1_d2i_fp(EC_KEY_new_thunk, d2i_ECPrivateKey_thunk, fp,
+        CHECKED_PPTR_OF(EC_KEY, eckey));
 }

 int i2d_ECPrivateKey_fp(FILE *fp, const EC_KEY *eckey)
 {
-    return ASN1_i2d_fp_of(EC_KEY, i2d_ECPrivateKey, fp, eckey);
+    return ASN1_i2d_fp(i2d_ECPrivateKey_thunk, fp,
+        CHECKED_PTR_OF(const EC_KEY, eckey));
 }
 #endif
 EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey)
 {
-    return ASN1_d2i_bio_of(EC_KEY, EC_KEY_new, d2i_EC_PUBKEY, bp, eckey);
+    return ASN1_d2i_bio(EC_KEY_new_thunk, d2i_EC_PUBKEY_thunk, bp,
+        CHECKED_PPTR_OF(EC_KEY, eckey));
 }

 int i2d_EC_PUBKEY_bio(BIO *bp, const EC_KEY *ecdsa)
 {
-    return ASN1_i2d_bio_of(EC_KEY, i2d_EC_PUBKEY, bp, ecdsa);
+    return ASN1_i2d_bio(i2d_EC_PUBKEY_thunk, bp,
+        CHECKED_PTR_OF(const EC_KEY, ecdsa));
 }

 EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey)
 {
-    return ASN1_d2i_bio_of(EC_KEY, EC_KEY_new, d2i_ECPrivateKey, bp, eckey);
+    return ASN1_d2i_bio(EC_KEY_new_thunk, d2i_ECPrivateKey_thunk, bp,
+        CHECKED_PPTR_OF(EC_KEY, eckey));
 }

 int i2d_ECPrivateKey_bio(BIO *bp, const EC_KEY *eckey)
 {
-    return ASN1_i2d_bio_of(EC_KEY, i2d_ECPrivateKey, bp, eckey);
+    return ASN1_i2d_bio(i2d_ECPrivateKey_thunk, bp,
+        CHECKED_PTR_OF(const EC_KEY, eckey));
 }
 #endif

 int X509_pubkey_digest(const X509 *data, const EVP_MD *type,
     unsigned char *md, unsigned int *len)
 {
-    ASN1_BIT_STRING *key = X509_get0_pubkey_bitstr(data);
+    const ASN1_BIT_STRING *key = X509_get0_pubkey_bitstr(data);

     if (key == NULL)
         return 0;
@@ -584,8 +732,7 @@ ASN1_OCTET_STRING *X509_digest_sig(const X509 *cert,
         }
     } else if ((md = EVP_MD_fetch(cert->libctx, OBJ_nid2sn(mdnid),
                     cert->propq))
-            == NULL
-        && (md = (EVP_MD *)EVP_get_digestbynid(mdnid)) == NULL) {
+        == NULL) {
         ERR_raise(ERR_LIB_X509, X509_R_UNSUPPORTED_ALGORITHM);
         return NULL;
     }
@@ -650,61 +797,57 @@ int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,
 #ifndef OPENSSL_NO_STDIO
 X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8)
 {
-    return ASN1_d2i_fp_of(X509_SIG, X509_SIG_new, d2i_X509_SIG, fp, p8);
+    return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509_SIG), fp, p8);
 }

 int i2d_PKCS8_fp(FILE *fp, const X509_SIG *p8)
 {
-    return ASN1_i2d_fp_of(X509_SIG, i2d_X509_SIG, fp, p8);
+    return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509_SIG), fp, p8);
 }
 #endif

 X509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SIG **p8)
 {
-    return ASN1_d2i_bio_of(X509_SIG, X509_SIG_new, d2i_X509_SIG, bp, p8);
+    return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509_SIG), bp, p8);
 }

 int i2d_PKCS8_bio(BIO *bp, const X509_SIG *p8)
 {
-    return ASN1_i2d_bio_of(X509_SIG, i2d_X509_SIG, bp, p8);
+    return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_SIG), bp, p8);
 }

 #ifndef OPENSSL_NO_STDIO
 X509_PUBKEY *d2i_X509_PUBKEY_fp(FILE *fp, X509_PUBKEY **xpk)
 {
-    return ASN1_d2i_fp_of(X509_PUBKEY, X509_PUBKEY_new, d2i_X509_PUBKEY,
-        fp, xpk);
+    return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509_PUBKEY), fp, xpk);
 }

 int i2d_X509_PUBKEY_fp(FILE *fp, const X509_PUBKEY *xpk)
 {
-    return ASN1_i2d_fp_of(X509_PUBKEY, i2d_X509_PUBKEY, fp, xpk);
+    return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509_PUBKEY), fp, xpk);
 }
 #endif

 X509_PUBKEY *d2i_X509_PUBKEY_bio(BIO *bp, X509_PUBKEY **xpk)
 {
-    return ASN1_d2i_bio_of(X509_PUBKEY, X509_PUBKEY_new, d2i_X509_PUBKEY,
-        bp, xpk);
+    return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509_PUBKEY), bp, xpk);
 }

 int i2d_X509_PUBKEY_bio(BIO *bp, const X509_PUBKEY *xpk)
 {
-    return ASN1_i2d_bio_of(X509_PUBKEY, i2d_X509_PUBKEY, bp, xpk);
+    return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_PUBKEY), bp, xpk);
 }

 #ifndef OPENSSL_NO_STDIO
 PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,
     PKCS8_PRIV_KEY_INFO **p8inf)
 {
-    return ASN1_d2i_fp_of(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_new,
-        d2i_PKCS8_PRIV_KEY_INFO, fp, p8inf);
+    return ASN1_item_d2i_fp(ASN1_ITEM_rptr(PKCS8_PRIV_KEY_INFO), fp, p8inf);
 }

 int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, const PKCS8_PRIV_KEY_INFO *p8inf)
 {
-    return ASN1_i2d_fp_of(PKCS8_PRIV_KEY_INFO, i2d_PKCS8_PRIV_KEY_INFO, fp,
-        p8inf);
+    return ASN1_item_i2d_fp(ASN1_ITEM_rptr(PKCS8_PRIV_KEY_INFO), fp, p8inf);
 }

 int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, const EVP_PKEY *key)
@@ -722,12 +865,14 @@ int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, const EVP_PKEY *key)

 int i2d_PrivateKey_fp(FILE *fp, const EVP_PKEY *pkey)
 {
-    return ASN1_i2d_fp_of(EVP_PKEY, i2d_PrivateKey, fp, pkey);
+    return ASN1_i2d_fp(i2d_PrivateKey_thunk, fp,
+        CHECKED_PTR_OF(const EVP_PKEY, pkey));
 }

 EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a)
 {
-    return ASN1_d2i_fp_of(EVP_PKEY, EVP_PKEY_new, d2i_AutoPrivateKey, fp, a);
+    return ASN1_d2i_fp(EVP_PKEY_new_thunk, d2i_AutoPrivateKey_thunk,
+        fp, CHECKED_PPTR_OF(EVP_PKEY, a));
 }

 EVP_PKEY *d2i_PrivateKey_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
@@ -748,7 +893,8 @@ EVP_PKEY *d2i_PrivateKey_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,

 int i2d_PUBKEY_fp(FILE *fp, const EVP_PKEY *pkey)
 {
-    return ASN1_i2d_fp_of(EVP_PKEY, i2d_PUBKEY, fp, pkey);
+    return ASN1_i2d_fp(i2d_PUBKEY_thunk, fp,
+        CHECKED_PTR_OF(const EVP_PKEY, pkey));
 }

 EVP_PKEY *d2i_PUBKEY_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
@@ -769,7 +915,8 @@ EVP_PKEY *d2i_PUBKEY_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,

 EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a)
 {
-    return ASN1_d2i_fp_of(EVP_PKEY, EVP_PKEY_new, d2i_PUBKEY, fp, a);
+    return ASN1_d2i_fp(EVP_PKEY_new_thunk, d2i_PUBKEY_thunk, fp,
+        CHECKED_PPTR_OF(EVP_PKEY, a));
 }

 #endif
@@ -777,14 +924,12 @@ EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a)
 PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,
     PKCS8_PRIV_KEY_INFO **p8inf)
 {
-    return ASN1_d2i_bio_of(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_new,
-        d2i_PKCS8_PRIV_KEY_INFO, bp, p8inf);
+    return ASN1_item_d2i_bio(ASN1_ITEM_rptr(PKCS8_PRIV_KEY_INFO), bp, p8inf);
 }

 int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, const PKCS8_PRIV_KEY_INFO *p8inf)
 {
-    return ASN1_i2d_bio_of(PKCS8_PRIV_KEY_INFO, i2d_PKCS8_PRIV_KEY_INFO, bp,
-        p8inf);
+    return ASN1_item_i2d_bio(ASN1_ITEM_rptr(PKCS8_PRIV_KEY_INFO), bp, p8inf);
 }

 int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, const EVP_PKEY *key)
@@ -802,12 +947,14 @@ int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, const EVP_PKEY *key)

 int i2d_PrivateKey_bio(BIO *bp, const EVP_PKEY *pkey)
 {
-    return ASN1_i2d_bio_of(EVP_PKEY, i2d_PrivateKey, bp, pkey);
+    return ASN1_i2d_bio(i2d_PrivateKey_thunk, bp,
+        CHECKED_PTR_OF(const EVP_PKEY, pkey));
 }

 EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a)
 {
-    return ASN1_d2i_bio_of(EVP_PKEY, EVP_PKEY_new, d2i_AutoPrivateKey, bp, a);
+    return ASN1_d2i_bio(EVP_PKEY_new_thunk, d2i_AutoPrivateKey_thunk,
+        bp, CHECKED_PPTR_OF(EVP_PKEY, a));
 }

 EVP_PKEY *d2i_PrivateKey_ex_bio(BIO *bp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
@@ -831,7 +978,8 @@ err:

 int i2d_PUBKEY_bio(BIO *bp, const EVP_PKEY *pkey)
 {
-    return ASN1_i2d_bio_of(EVP_PKEY, i2d_PUBKEY, bp, pkey);
+    return ASN1_i2d_bio(i2d_PUBKEY_thunk, bp,
+        CHECKED_PTR_OF(const EVP_PKEY, pkey));
 }

 EVP_PKEY *d2i_PUBKEY_ex_bio(BIO *bp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
@@ -855,7 +1003,8 @@ err:

 EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a)
 {
-    return ASN1_d2i_bio_of(EVP_PKEY, EVP_PKEY_new, d2i_PUBKEY, bp, a);
+    return ASN1_d2i_bio(EVP_PKEY_new_thunk, d2i_PUBKEY_thunk, bp,
+        CHECKED_PPTR_OF(EVP_PKEY, a));
 }

 #ifndef OPENSSL_NO_STDIO
diff --git a/deps/openssl/openssl/crypto/x509/x_attrib.c b/deps/openssl/openssl/crypto/x509/x_attrib.c
index f4c225a8ff2..98a99cc43b7 100644
--- a/deps/openssl/openssl/crypto/x509/x_attrib.c
+++ b/deps/openssl/openssl/crypto/x509/x_attrib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,6 +15,8 @@
 #include "x509_local.h"
 #include <crypto/x509.h>

+#include <crypto/asn1.h>
+
 /*-
  * X509_ATTRIBUTE: this has the following form:
  *
@@ -133,7 +135,9 @@ int ossl_print_attribute_value(BIO *out,
     case V_ASN1_OBJECT_DESCRIPTOR:
         return BIO_printf(out, "%*s%.*s", indent, "",
                    av->value.generalstring->length,
-                   av->value.generalstring->data)
+                   av->value.generalstring->length
+                       ? av->value.generalstring->data
+                       : (const unsigned char *)"")
             >= 0;

         /* EXTERNAL would go here. */
@@ -142,7 +146,9 @@ int ossl_print_attribute_value(BIO *out,
     case V_ASN1_UTF8STRING:
         return BIO_printf(out, "%*s%.*s", indent, "",
                    av->value.utf8string->length,
-                   av->value.utf8string->data)
+                   av->value.utf8string->length
+                       ? av->value.utf8string->data
+                       : (const unsigned char *)"")
             >= 0;

     case V_ASN1_REAL:
@@ -206,25 +212,33 @@ int ossl_print_attribute_value(BIO *out,
     case V_ASN1_NUMERICSTRING:
         return BIO_printf(out, "%*s%.*s", indent, "",
                    av->value.visiblestring->length,
-                   av->value.visiblestring->data)
+                   av->value.visiblestring->length
+                       ? av->value.visiblestring->data
+                       : (const unsigned char *)"")
             >= 0;

     case V_ASN1_PRINTABLESTRING:
         return BIO_printf(out, "%*s%.*s", indent, "",
                    av->value.printablestring->length,
-                   av->value.printablestring->data)
+                   av->value.printablestring->length
+                       ? av->value.printablestring->data
+                       : (const unsigned char *)"")
             >= 0;

     case V_ASN1_T61STRING:
         return BIO_printf(out, "%*s%.*s", indent, "",
                    av->value.t61string->length,
-                   av->value.t61string->data)
+                   av->value.t61string->length
+                       ? av->value.t61string->data
+                       : (const unsigned char *)"")
             >= 0;

     case V_ASN1_IA5STRING:
         return BIO_printf(out, "%*s%.*s", indent, "",
                    av->value.ia5string->length,
-                   av->value.ia5string->data)
+                   av->value.ia5string->length
+                       ? av->value.ia5string->data
+                       : (const unsigned char *)"")
             >= 0;

     /* UniversalString would go here. */
diff --git a/deps/openssl/openssl/crypto/x509/x_crl.c b/deps/openssl/openssl/crypto/x509/x_crl.c
index 1b498ee6b57..33c18147aac 100644
--- a/deps/openssl/openssl/crypto/x509/x_crl.c
+++ b/deps/openssl/openssl/crypto/x509/x_crl.c
@@ -8,7 +8,6 @@
  */

 #include <stdio.h>
-#include "internal/cryptlib.h"
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include "crypto/x509.h"
@@ -80,28 +79,74 @@ ASN1_SEQUENCE_enc(X509_CRL_INFO, enc, crl_inf_cb) = {

 static int crl_set_issuers(X509_CRL *crl)
 {
-
     int i, j;
-    GENERAL_NAMES *gens, *gtmp;
+    GENERAL_NAMES *most_recent_issuer, *gtmp;
     STACK_OF(X509_REVOKED) *revoked;

+    /*
+     * The CRL's nextUpdate field is optional, but we will still verify
+     * lastUpdate and treat missing or invalid values as a failure.
+     */
+    if (crl->crl.lastUpdate == NULL) {
+        crl->flags |= EXFLAG_INVALID;
+        ERR_raise_data(ERR_LIB_ASN1, ASN1_R_ILLEGAL_TIME_VALUE,
+            "lastUpdate in CRL is not well-formed");
+        return 0;
+    }
+
     revoked = X509_CRL_get_REVOKED(crl);

-    gens = NULL;
+    /*
+     * If this extension is not present on the first entry in an indirect CRL,
+     * the certificate issuer defaults to the CRL issuer. Subsequent entries in
+     * an indirect CRL, if this extension is not present, the certificate issuer
+     * for the entry is the same as that for the preceding entry.
+     * https://datatracker.ietf.org/doc/html/rfc5280#section-5.3.3
+     */
+    most_recent_issuer = NULL;
+
     for (i = 0; i < sk_X509_REVOKED_num(revoked); i++) {
         X509_REVOKED *rev = sk_X509_REVOKED_value(revoked, i);
         STACK_OF(X509_EXTENSION) *exts;
         ASN1_ENUMERATED *reason;
         X509_EXTENSION *ext;
+        const ASN1_TIME *rev_date;
+        ASN1_GENERALIZEDTIME *inv_date;
+        int nid;
+
+        /*
+         * The revocation date is a mandatory attribute. If we get NULL here, it
+         * means the validation has failed and an error has been pushed onto the
+         * error stack.
+         */
+        if ((rev_date = X509_REVOKED_get0_revocationDate(rev)) == NULL) {
+            crl->flags |= EXFLAG_INVALID;
+            ERR_raise_data(ERR_LIB_ASN1, ASN1_R_ILLEGAL_TIME_VALUE,
+                "revocationDate in CRL is not well-formed");
+            return 0;
+        }

-        gtmp = X509_REVOKED_get_ext_d2i(rev,
-            NID_certificate_issuer, &j, NULL);
+        gtmp = X509_REVOKED_get_ext_d2i(rev, NID_certificate_issuer, &j, NULL);
         if (gtmp == NULL && j != -1) {
             crl->flags |= EXFLAG_INVALID;
             return 1;
         }

         if (gtmp != NULL) {
+            /*
+             * Validation to ensure Certificate Issuer extensions in CRL
+             * entries only appear when the Indirect CRL flag is TRUE in the
+             * Issuing Distribution Point (IDP) extension, as required by
+             * https://datatracker.ietf.org/doc/html/rfc5280#section-5.3.3
+             */
+            if (crl->idp == NULL || !crl->idp->indirectCRL) {
+                crl->flags |= EXFLAG_INVALID;
+                ERR_raise_data(ERR_LIB_ASN1, ASN1_R_INVALID_VALUE,
+                    "CRL Certificate Issuer extension requires Indirect CRL flag to be set");
+                GENERAL_NAMES_free(gtmp);
+                return 0;
+            }
+
             if (crl->issuers == NULL) {
                 crl->issuers = sk_GENERAL_NAMES_new_null();
                 if (crl->issuers == NULL) {
@@ -113,9 +158,9 @@ static int crl_set_issuers(X509_CRL *crl)
                 GENERAL_NAMES_free(gtmp);
                 return 0;
             }
-            gens = gtmp;
+            most_recent_issuer = gtmp;
         }
-        rev->issuer = gens;
+        rev->issuer = most_recent_issuer;

         reason = X509_REVOKED_get_ext_d2i(rev, NID_crl_reason, &j, NULL);
         if (reason == NULL && j != -1) {
@@ -129,18 +174,31 @@ static int crl_set_issuers(X509_CRL *crl)
         } else
             rev->reason = CRL_REASON_NONE;

-        /* Check for critical CRL entry extensions */
-
+        /* Check for critical CRL entry extensions and validate time. */
         exts = rev->extensions;

         for (j = 0; j < sk_X509_EXTENSION_num(exts); j++) {
             ext = sk_X509_EXTENSION_value(exts, j);
+            nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext));
+
+            /*
+             * If we obtain the extension but the time is NULL, it means that
+             * the validation has failed and the reason will be pushed onto the
+             * error stack.
+             */
+            if (nid == NID_invalidity_date) {
+                if ((inv_date = X509V3_EXT_d2i(ext)) == NULL) {
+                    crl->flags |= EXFLAG_INVALID;
+                    ERR_raise_data(ERR_LIB_ASN1, ASN1_R_ILLEGAL_TIME_VALUE,
+                        "invalidityDate in CRL is not well-formed");
+                    return 0;
+                }
+                ASN1_GENERALIZEDTIME_free(inv_date);
+            }
             if (X509_EXTENSION_get_critical(ext)) {
-                if (OBJ_obj2nid(X509_EXTENSION_get_object(ext))
-                    == NID_certificate_issuer)
+                if (nid == NID_certificate_issuer)
                     continue;
                 crl->flags |= EXFLAG_CRITICAL;
-                break;
             }
         }
     }
@@ -189,9 +247,12 @@ static int crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
     case ASN1_OP_D2I_POST:
         if (!X509_CRL_digest(crl, EVP_sha1(), crl->sha1_hash, NULL))
             crl->flags |= EXFLAG_NO_FINGERPRINT;
-        crl->idp = X509_CRL_get_ext_d2i(crl,
-            NID_issuing_distribution_point, &i,
-            NULL);
+        crl->idp = X509_CRL_get_ext_d2i(crl, NID_issuing_distribution_point, &i, NULL);
+        if (crl->idp == NULL && i != -1) {
+            ERR_raise_data(ERR_LIB_ASN1, ASN1_R_ILLEGAL_OBJECT,
+                "CRL: malformed CRL issuing distribution point");
+            return 0;
+        }
         if (crl->idp != NULL) {
             if (!setup_idp(crl, crl->idp))
                 crl->flags |= EXFLAG_INVALID;
@@ -205,20 +266,21 @@ static int crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
         if (crl->akid == NULL && i != -1)
             crl->flags |= EXFLAG_INVALID;

-        crl->crl_number = X509_CRL_get_ext_d2i(crl,
-            NID_crl_number, &i, NULL);
-        if (crl->crl_number == NULL && i != -1)
-            crl->flags |= EXFLAG_INVALID;
-
-        crl->base_crl_number = X509_CRL_get_ext_d2i(crl,
-            NID_delta_crl, &i,
-            NULL);
-        if (crl->base_crl_number == NULL && i != -1)
-            crl->flags |= EXFLAG_INVALID;
+        crl->crl_number = X509_CRL_get_ext_d2i(crl, NID_crl_number, &i, NULL);
+        if (crl->crl_number == NULL && i != -1) {
+            ERR_raise_data(ERR_LIB_ASN1, ASN1_R_ILLEGAL_OBJECT,
+                "CRL: malformed CRL number extension");
+            return 0;
+        }
+        crl->base_crl_number = X509_CRL_get_ext_d2i(crl, NID_delta_crl, &i, NULL);
+        if (crl->base_crl_number == NULL && i != -1) {
+            ERR_raise_data(ERR_LIB_ASN1, ASN1_R_ILLEGAL_OBJECT,
+                "CRL: malformed Delta CRL Indicator");
+            return 0;
+        }
         /* Delta CRLs must have CRL number */
         if (crl->base_crl_number && !crl->crl_number)
             crl->flags |= EXFLAG_INVALID;
-
         /*
          * See if we have any unhandled critical CRL extensions and indicate
          * this in a flag. We only currently handle IDP so anything else
@@ -355,7 +417,7 @@ X509_CRL *X509_CRL_new_ex(OSSL_LIB_CTX *libctx, const char *propq)
 {
     X509_CRL *crl = NULL;

-    crl = (X509_CRL *)ASN1_item_new((X509_CRL_it()));
+    crl = (X509_CRL *)ASN1_item_new(ASN1_ITEM_rptr(X509_CRL));
     if (!ossl_x509_crl_set0_libctx(crl, libctx, propq)) {
         X509_CRL_free(crl);
         crl = NULL;
@@ -393,7 +455,7 @@ int X509_CRL_get0_by_serial(X509_CRL *crl,
     return 0;
 }

-int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x)
+int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, const X509 *x)
 {
     if (crl->meth->crl_lookup)
         return crl->meth->crl_lookup(crl, ret,
diff --git a/deps/openssl/openssl/crypto/x509/x_exten.c b/deps/openssl/openssl/crypto/x509/x_exten.c
index 51b268433df..405029f81a8 100644
--- a/deps/openssl/openssl/crypto/x509/x_exten.c
+++ b/deps/openssl/openssl/crypto/x509/x_exten.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,6 +13,8 @@
 #include <openssl/asn1t.h>
 #include "x509_local.h"

+#include <crypto/asn1.h>
+
 ASN1_SEQUENCE(X509_EXTENSION) = {
     ASN1_SIMPLE(X509_EXTENSION, object, ASN1_OBJECT),
     ASN1_OPT(X509_EXTENSION, critical, ASN1_FBOOLEAN),
diff --git a/deps/openssl/openssl/crypto/x509/x_ietfatt.c b/deps/openssl/openssl/crypto/x509/x_ietfatt.c
index df68878dad4..6750a088f63 100644
--- a/deps/openssl/openssl/crypto/x509/x_ietfatt.c
+++ b/deps/openssl/openssl/crypto/x509/x_ietfatt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -64,7 +64,7 @@ OSSL_IETF_ATTR_SYNTAX *d2i_OSSL_IETF_ATTR_SYNTAX(OSSL_IETF_ATTR_SYNTAX **a,
     int i;

     ias = (OSSL_IETF_ATTR_SYNTAX *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
-        OSSL_IETF_ATTR_SYNTAX_it());
+        ASN1_ITEM_rptr(OSSL_IETF_ATTR_SYNTAX));
     if (ias == NULL)
         return ias;

@@ -91,7 +91,7 @@ invalid_types:
 int i2d_OSSL_IETF_ATTR_SYNTAX(const OSSL_IETF_ATTR_SYNTAX *a,
     unsigned char **out)
 {
-    return ASN1_item_i2d((const ASN1_VALUE *)a, out, OSSL_IETF_ATTR_SYNTAX_it());
+    return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(OSSL_IETF_ATTR_SYNTAX));
 }

 int OSSL_IETF_ATTR_SYNTAX_get_value_num(const OSSL_IETF_ATTR_SYNTAX *a)
diff --git a/deps/openssl/openssl/crypto/x509/x_name.c b/deps/openssl/openssl/crypto/x509/x_name.c
index 91a1dd2a750..e965dee4c89 100644
--- a/deps/openssl/openssl/crypto/x509/x_name.c
+++ b/deps/openssl/openssl/crypto/x509/x_name.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -224,8 +224,9 @@ static int x509_name_ex_i2d(const ASN1_VALUE **val, unsigned char **out,
         ret = x509_name_canon(a);
         if (!ret)
             return -1;
+        a->modified = 0;
     }
-    ret = a->bytes->length;
+    ret = (int)a->bytes->length;
     if (out != NULL) {
         memcpy(*out, a->bytes->data, ret);
         *out += ret;
@@ -241,8 +242,8 @@ static int x509_name_encode(X509_NAME *a)
     } intname = {
         NULL
     };
-    int len;
-    unsigned char *p;
+    int len, outlen;
+    unsigned char *p, *start;
     STACK_OF(X509_NAME_ENTRY) *entries = NULL;
     X509_NAME_ENTRY *entry;
     int i, set = -1;
@@ -267,16 +268,20 @@ static int x509_name_encode(X509_NAME *a)
     }
     len = ASN1_item_ex_i2d(&intname.a, NULL,
         ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1);
+    if (len < 0)
+        goto err;
     if (!BUF_MEM_grow(a->bytes, len)) {
         ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
         goto err;
     }
     p = (unsigned char *)a->bytes->data;
-    ASN1_item_ex_i2d(&intname.a,
+    start = p;
+    outlen = ASN1_item_ex_i2d(&intname.a,
         &p, ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1);
+    if (outlen != len || p != start + len)
+        goto err;
     sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
         local_sk_X509_NAME_ENTRY_free);
-    a->modified = 0;
     return len;
 cerr:
     ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
@@ -310,14 +315,15 @@ static int x509_name_ex_print(BIO *out, const ASN1_VALUE **pval,

 static int x509_name_canon(X509_NAME *a)
 {
-    unsigned char *p;
+    unsigned char *buf = NULL, *p;
     STACK_OF(STACK_OF_X509_NAME_ENTRY) *intname;
     STACK_OF(X509_NAME_ENTRY) *entries = NULL;
     X509_NAME_ENTRY *entry, *tmpentry = NULL;
-    int i, set = -1, ret = 0, len;
+    int i, set = -1, ret = 0, len, outlen;

     OPENSSL_free(a->canon_enc);
     a->canon_enc = NULL;
+    a->canon_enclen = 0;
     /* Special case: empty X509_NAME => null encoding */
     if (sk_X509_NAME_ENTRY_num(a->entries) == 0) {
         a->canon_enclen = 0;
@@ -364,19 +370,23 @@ static int x509_name_canon(X509_NAME *a)
     len = i2d_name_canon(intname, NULL);
     if (len < 0)
         goto err;
-    a->canon_enclen = len;

-    p = OPENSSL_malloc(a->canon_enclen);
-    if (p == NULL)
+    buf = OPENSSL_malloc(len);
+    if (buf == NULL)
         goto err;
+    p = buf;

-    a->canon_enc = p;
-
-    i2d_name_canon(intname, &p);
+    outlen = i2d_name_canon(intname, &p);
+    if (outlen != len || p != buf + len)
+        goto err;

+    a->canon_enc = buf;
+    a->canon_enclen = len;
+    buf = NULL;
     ret = 1;

 err:
+    OPENSSL_free(buf);
     X509_NAME_ENTRY_free(tmpentry);
     sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname,
         local_sk_X509_NAME_ENTRY_pop_free);
@@ -404,8 +414,10 @@ static int asn1_string_canon(ASN1_STRING *out, const ASN1_STRING *in)

     out->type = V_ASN1_UTF8STRING;
     out->length = ASN1_STRING_to_UTF8(&out->data, in);
-    if (out->length == -1)
+    if (out->length < 0)
         return 0;
+    if (out->length == 0)
+        return 1;

     to = out->data;
     from = to;
@@ -462,7 +474,7 @@ static int asn1_string_canon(ASN1_STRING *out, const ASN1_STRING *in)
         }
     }

-    out->length = to - out->data;
+    out->length = (int)(to - out->data);

     return 1;
 }
@@ -516,7 +528,7 @@ int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase)
     c = s;
     for (;;) {
         if (((*s == '/') && (ossl_isupper(s[1]) && ((s[2] == '=') || (ossl_isupper(s[2]) && (s[3] == '='))))) || (*s == '\0')) {
-            i = s - c;
+            i = (int)(s - c);
             if (BIO_write(bp, c, i) != i)
                 goto err;
             c = s + 1; /* skip following slash */
diff --git a/deps/openssl/openssl/crypto/x509/x_pubkey.c b/deps/openssl/openssl/crypto/x509/x_pubkey.c
index 8e0ee3a2197..df4bccbeef3 100644
--- a/deps/openssl/openssl/crypto/x509/x_pubkey.c
+++ b/deps/openssl/openssl/crypto/x509/x_pubkey.c
@@ -17,7 +17,6 @@
 #include "internal/cryptlib.h"
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
-#include <openssl/engine.h>
 #include "crypto/asn1.h"
 #include "crypto/evp.h"
 #include "crypto/x509.h"
@@ -65,8 +64,7 @@ ASN1_SEQUENCE(X509_PUBKEY_INTERNAL) = {
     ASN1_SIMPLE(X509_PUBKEY, public_key, ASN1_BIT_STRING)
 } static_ASN1_SEQUENCE_END_name(X509_PUBKEY, X509_PUBKEY_INTERNAL)

-X509_PUBKEY
-*ossl_d2i_X509_PUBKEY_INTERNAL(const unsigned char **pp, long len, OSSL_LIB_CTX *libctx, const char *propq)
+X509_PUBKEY *ossl_d2i_X509_PUBKEY_INTERNAL(const unsigned char **pp, long len, OSSL_LIB_CTX *libctx, const char *propq)
 {
     X509_PUBKEY *xpub = OPENSSL_zalloc(sizeof(*xpub));

@@ -201,8 +199,19 @@ static int x509_pubkey_ex_d2i_ex(ASN1_VALUE **pval,
         }
         p = in_saved;

-        if (OBJ_obj2txt(txtoidname, sizeof(txtoidname),
-                pubkey->algor->algorithm, 0)
+        /*
+         * TPM 1.2 Endorsement Key certificates use NID_rsaesOaep in the
+         * SPKI AlgorithmIdentifier with a plain RSAPublicKey body, per
+         * TCG Credential Profiles V1.2 section 3.2.7.  Map the OID to
+         * "RSA" here so the provider decoder is selected; the OAEP
+         * AlgorithmIdentifier parameters are not interpreted.  Keep
+         * this in sync with x509_pubkey_decode() and
+         * ossl_spki2typespki_der_decode().
+         */
+        if (OBJ_obj2nid(pubkey->algor->algorithm) == NID_rsaesOaep) {
+            OPENSSL_strlcpy(txtoidname, "RSA", sizeof(txtoidname));
+        } else if (OBJ_obj2txt(txtoidname, sizeof(txtoidname),
+                       pubkey->algor->algorithm, 0)
             <= 0) {
             ERR_clear_last_mark();
             goto end;
@@ -271,7 +280,7 @@ X509_PUBKEY *X509_PUBKEY_new_ex(OSSL_LIB_CTX *libctx, const char *propq)
 {
     X509_PUBKEY *pubkey = NULL;

-    pubkey = (X509_PUBKEY *)ASN1_item_new_ex(X509_PUBKEY_it(), libctx, propq);
+    pubkey = (X509_PUBKEY *)ASN1_item_new_ex(ASN1_ITEM_rptr(X509_PUBKEY), libctx, propq);
     if (!x509_pubkey_set0_libctx(pubkey, libctx, propq)) {
         X509_PUBKEY_free(pubkey);
         pubkey = NULL;
@@ -297,9 +306,8 @@ X509_PUBKEY *X509_PUBKEY_dup(const X509_PUBKEY *a)
     }
     if ((pubkey->algor = X509_ALGOR_dup(a->algor)) == NULL
         || (pubkey->public_key = ASN1_BIT_STRING_new()) == NULL
-        || !ASN1_BIT_STRING_set(pubkey->public_key,
-            a->public_key->data,
-            a->public_key->length)) {
+        || !ASN1_BIT_STRING_set1(pubkey->public_key,
+            a->public_key->data, a->public_key->length, 0)) {
         x509_pubkey_ex_free((ASN1_VALUE **)&pubkey,
             ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL));
         ERR_raise(ERR_LIB_X509, ERR_R_ASN1_LIB);
@@ -409,18 +417,18 @@ static int x509_pubkey_decode(EVP_PKEY **ppkey, const X509_PUBKEY *key)
     int nid;

     nid = OBJ_obj2nid(key->algor->algorithm);
-    if (!key->flag_force_legacy) {
-#ifndef OPENSSL_NO_ENGINE
-        ENGINE *e = NULL;
-
-        e = ENGINE_get_pkey_meth_engine(nid);
-        if (e == NULL)
-            return 0;
-        ENGINE_finish(e);
-#else
+    if (!key->flag_force_legacy)
         return 0;
-#endif
-    }
+
+    /*
+     * NID_rsaesOaep uses the same underlying RSAPublicKey body as
+     * NID_rsaEncryption (TCG Credential Profiles V1.2 section 3.2.7).
+     * Remap so EVP_PKEY_set_type() below finds the RSA ameth.  Keep
+     * this in sync with x509_pubkey_ex_d2i_ex() and
+     * ossl_spki2typespki_der_decode().
+     */
+    if (nid == NID_rsaesOaep)
+        nid = NID_rsaEncryption;

     pkey = EVP_PKEY_new();
     if (pkey == NULL) {
@@ -579,7 +587,7 @@ int i2d_PUBKEY(const EVP_PKEY *a, unsigned char **pp)
             && out != NULL
             && OSSL_ENCODER_to_bio(ctx, out)
             && BIO_get_mem_ptr(out, &buf) > 0) {
-            ret = buf->length;
+            ret = (int)buf->length;

             if (pp != NULL) {
                 if (*pp == NULL) {
@@ -1011,7 +1019,7 @@ void X509_PUBKEY_set0_public_key(X509_PUBKEY *pub,
     unsigned char *penc, int penclen)
 {
     ASN1_STRING_set0(pub->public_key, penc, penclen);
-    ossl_asn1_string_set_bits_left(pub->public_key, 0);
+    ossl_asn1_bit_string_set_unused_bits(pub->public_key, 0);
 }

 int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj,
@@ -1040,7 +1048,7 @@ int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg,
     return 1;
 }

-ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)
+const ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)
 {
     if (x == NULL)
         return NULL;
diff --git a/deps/openssl/openssl/crypto/x509/x_req.c b/deps/openssl/openssl/crypto/x509/x_req.c
index 6f60df5b041..5137885a5b1 100644
--- a/deps/openssl/openssl/crypto/x509/x_req.c
+++ b/deps/openssl/openssl/crypto/x509/x_req.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -158,7 +158,7 @@ X509_REQ *X509_REQ_new_ex(OSSL_LIB_CTX *libctx, const char *propq)
 {
     X509_REQ *req = NULL;

-    req = (X509_REQ *)ASN1_item_new((X509_REQ_it()));
+    req = (X509_REQ *)ASN1_item_new(ASN1_ITEM_rptr(X509_REQ));
     if (!ossl_x509_req_set0_libctx(req, libctx, propq)) {
         X509_REQ_free(req);
         req = NULL;
diff --git a/deps/openssl/openssl/crypto/x509/x_x509.c b/deps/openssl/openssl/crypto/x509/x_x509.c
index 107d9f2789f..43a19a4d8f7 100644
--- a/deps/openssl/openssl/crypto/x509/x_x509.c
+++ b/deps/openssl/openssl/crypto/x509/x_x509.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -156,7 +156,7 @@ X509 *X509_new_ex(OSSL_LIB_CTX *libctx, const char *propq)
 {
     X509 *cert = NULL;

-    cert = (X509 *)ASN1_item_new_ex(X509_it(), libctx, propq);
+    cert = (X509 *)ASN1_item_new_ex(ASN1_ITEM_rptr(X509), libctx, propq);
     if (!ossl_x509_set0_libctx(cert, libctx, propq)) {
         X509_free(cert);
         cert = NULL;
@@ -197,7 +197,7 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
     if (ret == NULL)
         return NULL;
     /* update length */
-    length -= q - *pp;
+    length -= (long)(q - *pp);
     if (length > 0 && !d2i_X509_CERT_AUX(&ret->aux, &q, length))
         goto err;
     *pp = q;
@@ -304,7 +304,7 @@ void X509_set0_distinguishing_id(X509 *x, ASN1_OCTET_STRING *d_id)
     x->distinguishing_id = d_id;
 }

-ASN1_OCTET_STRING *X509_get0_distinguishing_id(X509 *x)
+const ASN1_OCTET_STRING *X509_get0_distinguishing_id(const X509 *x)
 {
     return x->distinguishing_id;
 }
diff --git a/deps/openssl/openssl/crypto/x509/x_x509a.c b/deps/openssl/openssl/crypto/x509/x_x509a.c
index 009ba6f773a..07f15009bf3 100644
--- a/deps/openssl/openssl/crypto/x509/x_x509a.c
+++ b/deps/openssl/openssl/crypto/x509/x_x509a.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -50,6 +50,8 @@ static X509_CERT_AUX *aux_get(X509 *x)
 int X509_alias_set1(X509 *x, const unsigned char *name, int len)
 {
     X509_CERT_AUX *aux;
+    size_t len_s;
+
     if (!name) {
         if (!x || !x->aux || !x->aux->alias)
             return 1;
@@ -59,14 +61,25 @@ int X509_alias_set1(X509 *x, const unsigned char *name, int len)
     }
     if ((aux = aux_get(x)) == NULL)
         return 0;
+
+    if (len < -1)
+        return 0;
+
+    if (len == -1)
+        len_s = strlen((const char *)name);
+    else
+        len_s = len;
+
     if (aux->alias == NULL && (aux->alias = ASN1_UTF8STRING_new()) == NULL)
         return 0;
-    return ASN1_STRING_set(aux->alias, name, len);
+    return ossl_asn1_string_set1_data(aux->alias, name, len_s);
 }

 int X509_keyid_set1(X509 *x, const unsigned char *id, int len)
 {
     X509_CERT_AUX *aux;
+    size_t len_s;
+
     if (!id) {
         if (!x || !x->aux || !x->aux->keyid)
             return 1;
@@ -76,13 +89,22 @@ int X509_keyid_set1(X509 *x, const unsigned char *id, int len)
     }
     if ((aux = aux_get(x)) == NULL)
         return 0;
+
+    if (len < -1)
+        return 0;
+
+    if (len == -1)
+        len_s = strlen((const char *)id);
+    else
+        len_s = len;
+
     if (aux->keyid == NULL
         && (aux->keyid = ASN1_OCTET_STRING_new()) == NULL)
         return 0;
-    return ASN1_STRING_set(aux->keyid, id, len);
+    return ossl_asn1_string_set1_data(aux->keyid, id, len_s);
 }

-unsigned char *X509_alias_get0(X509 *x, int *len)
+const unsigned char *X509_alias_get0(const X509 *x, int *len)
 {
     if (!x->aux || !x->aux->alias)
         return NULL;
@@ -91,7 +113,7 @@ unsigned char *X509_alias_get0(X509 *x, int *len)
     return x->aux->alias->data;
 }

-unsigned char *X509_keyid_get0(X509 *x, int *len)
+const unsigned char *X509_keyid_get0(const X509 *x, int *len)
 {
     if (!x->aux || !x->aux->keyid)
         return NULL;
@@ -159,14 +181,14 @@ void X509_reject_clear(X509 *x)
     }
 }

-STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(X509 *x)
+const STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(const X509 *x)
 {
     if (x->aux != NULL)
         return x->aux->trust;
     return NULL;
 }

-STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(X509 *x)
+const STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(const X509 *x)
 {
     if (x->aux != NULL)
         return x->aux->reject;
diff --git a/deps/openssl/openssl/crypto/x86_64cpuid.pl b/deps/openssl/openssl/crypto/x86_64cpuid.pl
index f0eb8510ed2..22cf520f0dd 100644
--- a/deps/openssl/openssl/crypto/x86_64cpuid.pl
+++ b/deps/openssl/openssl/crypto/x86_64cpuid.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -339,63 +339,6 @@ CRYPTO_memcmp:
 .size	CRYPTO_memcmp,.-CRYPTO_memcmp
 ___

-print<<___ if (!$win64);
-.globl	OPENSSL_wipe_cpu
-.type	OPENSSL_wipe_cpu,\@abi-omnipotent
-.align	16
-OPENSSL_wipe_cpu:
-.cfi_startproc
-	endbranch
-	pxor	%xmm0,%xmm0
-	pxor	%xmm1,%xmm1
-	pxor	%xmm2,%xmm2
-	pxor	%xmm3,%xmm3
-	pxor	%xmm4,%xmm4
-	pxor	%xmm5,%xmm5
-	pxor	%xmm6,%xmm6
-	pxor	%xmm7,%xmm7
-	pxor	%xmm8,%xmm8
-	pxor	%xmm9,%xmm9
-	pxor	%xmm10,%xmm10
-	pxor	%xmm11,%xmm11
-	pxor	%xmm12,%xmm12
-	pxor	%xmm13,%xmm13
-	pxor	%xmm14,%xmm14
-	pxor	%xmm15,%xmm15
-	xorq	%rcx,%rcx
-	xorq	%rdx,%rdx
-	xorq	%rsi,%rsi
-	xorq	%rdi,%rdi
-	xorq	%r8,%r8
-	xorq	%r9,%r9
-	xorq	%r10,%r10
-	xorq	%r11,%r11
-	leaq	8(%rsp),%rax
-	ret
-.cfi_endproc
-.size	OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu
-___
-print<<___ if ($win64);
-.globl	OPENSSL_wipe_cpu
-.type	OPENSSL_wipe_cpu,\@abi-omnipotent
-.align	16
-OPENSSL_wipe_cpu:
-	pxor	%xmm0,%xmm0
-	pxor	%xmm1,%xmm1
-	pxor	%xmm2,%xmm2
-	pxor	%xmm3,%xmm3
-	pxor	%xmm4,%xmm4
-	pxor	%xmm5,%xmm5
-	xorq	%rcx,%rcx
-	xorq	%rdx,%rdx
-	xorq	%r8,%r8
-	xorq	%r9,%r9
-	xorq	%r10,%r10
-	xorq	%r11,%r11
-	leaq	8(%rsp),%rax
-	ret
-.size	OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu
-___
 {
 my $out="%r10";
 my $cnt="%rcx";
diff --git a/deps/openssl/openssl/crypto/x86cpuid.pl b/deps/openssl/openssl/crypto/x86cpuid.pl
index 35e2c5b0a54..941afa04201 100644
--- a/deps/openssl/openssl/crypto/x86cpuid.pl
+++ b/deps/openssl/openssl/crypto/x86cpuid.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2004-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -268,34 +268,6 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
 	&ret	();
 &function_end_B("OPENSSL_far_spin");

-&function_begin_B("OPENSSL_wipe_cpu","EXTRN\t_OPENSSL_ia32cap_P:DWORD");
-	&xor	("eax","eax");
-	&xor	("edx","edx");
-	&picmeup("ecx","OPENSSL_ia32cap_P");
-	&mov	("ecx",&DWP(0,"ecx"));
-	&bt	(&DWP(0,"ecx"),1);
-	&jnc	(&label("no_x87"));
-	if ($sse2) {
-		&and	("ecx",1<<26|1<<24);	# check SSE2 and FXSR bits
-		&cmp	("ecx",1<<26|1<<24);
-		&jne	(&label("no_sse2"));
-		&pxor	("xmm0","xmm0");
-		&pxor	("xmm1","xmm1");
-		&pxor	("xmm2","xmm2");
-		&pxor	("xmm3","xmm3");
-		&pxor	("xmm4","xmm4");
-		&pxor	("xmm5","xmm5");
-		&pxor	("xmm6","xmm6");
-		&pxor	("xmm7","xmm7");
-	&set_label("no_sse2");
-	}
-	# just a bunch of fldz to zap the fp/mm bank followed by finit...
-	&data_word(0xeed9eed9,0xeed9eed9,0xeed9eed9,0xeed9eed9,0x90e3db9b);
-&set_label("no_x87");
-	&lea	("eax",&DWP(4,"esp"));
-	&ret	();
-&function_end_B("OPENSSL_wipe_cpu");
-
 &function_begin_B("OPENSSL_atomic_add");
 	&mov	("edx",&DWP(4,"esp"));	# fetch the pointer, 1st arg
 	&mov	("ecx",&DWP(8,"esp"));	# fetch the increment, 2nd arg
diff --git a/deps/openssl/openssl/doc/build.info b/deps/openssl/openssl/doc/build.info
index 62c6152c3d8..a7f56576dc7 100644
--- a/deps/openssl/openssl/doc/build.info
+++ b/deps/openssl/openssl/doc/build.info
@@ -8,8 +8,6 @@ DEPEND[html/man1/openssl-asn1parse.html]=man1/openssl-asn1parse.pod
 GENERATE[html/man1/openssl-asn1parse.html]=man1/openssl-asn1parse.pod
 DEPEND[man/man1/openssl-asn1parse.1]=man1/openssl-asn1parse.pod
 GENERATE[man/man1/openssl-asn1parse.1]=man1/openssl-asn1parse.pod
-DEPEND[man1/openssl-asn1parse.pod]{pod}=man1/openssl-asn1parse.pod.in
-GENERATE[man1/openssl-asn1parse.pod]=man1/openssl-asn1parse.pod.in
 DEPEND[html/man1/openssl-ca.html]=man1/openssl-ca.pod
 GENERATE[html/man1/openssl-ca.html]=man1/openssl-ca.pod
 DEPEND[man/man1/openssl-ca.1]=man1/openssl-ca.pod
@@ -26,8 +24,6 @@ DEPEND[html/man1/openssl-cmds.html]=man1/openssl-cmds.pod
 GENERATE[html/man1/openssl-cmds.html]=man1/openssl-cmds.pod
 DEPEND[man/man1/openssl-cmds.1]=man1/openssl-cmds.pod
 GENERATE[man/man1/openssl-cmds.1]=man1/openssl-cmds.pod
-DEPEND[man1/openssl-cmds.pod]{pod}=man1/openssl-cmds.pod.in
-GENERATE[man1/openssl-cmds.pod]=man1/openssl-cmds.pod.in
 DEPEND[html/man1/openssl-cmp.html]=man1/openssl-cmp.pod
 GENERATE[html/man1/openssl-cmp.html]=man1/openssl-cmp.pod
 DEPEND[man/man1/openssl-cmp.1]=man1/openssl-cmp.pod
@@ -40,6 +36,10 @@ DEPEND[man/man1/openssl-cms.1]=man1/openssl-cms.pod
 GENERATE[man/man1/openssl-cms.1]=man1/openssl-cms.pod
 DEPEND[man1/openssl-cms.pod]{pod}=man1/openssl-cms.pod.in
 GENERATE[man1/openssl-cms.pod]=man1/openssl-cms.pod.in
+DEPEND[html/man1/openssl-configutl.html]=man1/openssl-configutl.pod
+GENERATE[html/man1/openssl-configutl.html]=man1/openssl-configutl.pod
+DEPEND[man/man1/openssl-configutl.1]=man1/openssl-configutl.pod
+GENERATE[man/man1/openssl-configutl.1]=man1/openssl-configutl.pod
 DEPEND[html/man1/openssl-crl.html]=man1/openssl-crl.pod
 GENERATE[html/man1/openssl-crl.html]=man1/openssl-crl.pod
 DEPEND[man/man1/openssl-crl.1]=man1/openssl-crl.pod
@@ -82,6 +82,12 @@ DEPEND[man/man1/openssl-ec.1]=man1/openssl-ec.pod
 GENERATE[man/man1/openssl-ec.1]=man1/openssl-ec.pod
 DEPEND[man1/openssl-ec.pod]{pod}=man1/openssl-ec.pod.in
 GENERATE[man1/openssl-ec.pod]=man1/openssl-ec.pod.in
+DEPEND[html/man1/openssl-ech.html]=man1/openssl-ech.pod
+GENERATE[html/man1/openssl-ech.html]=man1/openssl-ech.pod
+DEPEND[man/man1/openssl-ech.1]=man1/openssl-ech.pod
+GENERATE[man/man1/openssl-ech.1]=man1/openssl-ech.pod
+DEPEND[man1/openssl-ech.pod]{pod}=man1/openssl-ech.pod.in
+GENERATE[man1/openssl-ech.pod]=man1/openssl-ech.pod.in
 DEPEND[html/man1/openssl-ecparam.html]=man1/openssl-ecparam.pod
 GENERATE[html/man1/openssl-ecparam.html]=man1/openssl-ecparam.pod
 DEPEND[man/man1/openssl-ecparam.1]=man1/openssl-ecparam.pod
@@ -94,24 +100,14 @@ DEPEND[man/man1/openssl-enc.1]=man1/openssl-enc.pod
 GENERATE[man/man1/openssl-enc.1]=man1/openssl-enc.pod
 DEPEND[man1/openssl-enc.pod]{pod}=man1/openssl-enc.pod.in
 GENERATE[man1/openssl-enc.pod]=man1/openssl-enc.pod.in
-DEPEND[html/man1/openssl-engine.html]=man1/openssl-engine.pod
-GENERATE[html/man1/openssl-engine.html]=man1/openssl-engine.pod
-DEPEND[man/man1/openssl-engine.1]=man1/openssl-engine.pod
-GENERATE[man/man1/openssl-engine.1]=man1/openssl-engine.pod
-DEPEND[man1/openssl-engine.pod]{pod}=man1/openssl-engine.pod.in
-GENERATE[man1/openssl-engine.pod]=man1/openssl-engine.pod.in
 DEPEND[html/man1/openssl-errstr.html]=man1/openssl-errstr.pod
 GENERATE[html/man1/openssl-errstr.html]=man1/openssl-errstr.pod
 DEPEND[man/man1/openssl-errstr.1]=man1/openssl-errstr.pod
 GENERATE[man/man1/openssl-errstr.1]=man1/openssl-errstr.pod
-DEPEND[man1/openssl-errstr.pod]{pod}=man1/openssl-errstr.pod.in
-GENERATE[man1/openssl-errstr.pod]=man1/openssl-errstr.pod.in
 DEPEND[html/man1/openssl-fipsinstall.html]=man1/openssl-fipsinstall.pod
 GENERATE[html/man1/openssl-fipsinstall.html]=man1/openssl-fipsinstall.pod
 DEPEND[man/man1/openssl-fipsinstall.1]=man1/openssl-fipsinstall.pod
 GENERATE[man/man1/openssl-fipsinstall.1]=man1/openssl-fipsinstall.pod
-DEPEND[man1/openssl-fipsinstall.pod]{pod}=man1/openssl-fipsinstall.pod.in
-GENERATE[man1/openssl-fipsinstall.pod]=man1/openssl-fipsinstall.pod.in
 DEPEND[html/man1/openssl-format-options.html]=man1/openssl-format-options.pod
 GENERATE[html/man1/openssl-format-options.html]=man1/openssl-format-options.pod
 DEPEND[man/man1/openssl-format-options.1]=man1/openssl-format-options.pod
@@ -138,8 +134,6 @@ DEPEND[html/man1/openssl-info.html]=man1/openssl-info.pod
 GENERATE[html/man1/openssl-info.html]=man1/openssl-info.pod
 DEPEND[man/man1/openssl-info.1]=man1/openssl-info.pod
 GENERATE[man/man1/openssl-info.1]=man1/openssl-info.pod
-DEPEND[man1/openssl-info.pod]{pod}=man1/openssl-info.pod.in
-GENERATE[man1/openssl-info.pod]=man1/openssl-info.pod.in
 DEPEND[html/man1/openssl-kdf.html]=man1/openssl-kdf.pod
 GENERATE[html/man1/openssl-kdf.html]=man1/openssl-kdf.pod
 DEPEND[man/man1/openssl-kdf.1]=man1/openssl-kdf.pod
@@ -278,8 +272,6 @@ DEPEND[html/man1/openssl-sess_id.html]=man1/openssl-sess_id.pod
 GENERATE[html/man1/openssl-sess_id.html]=man1/openssl-sess_id.pod
 DEPEND[man/man1/openssl-sess_id.1]=man1/openssl-sess_id.pod
 GENERATE[man/man1/openssl-sess_id.1]=man1/openssl-sess_id.pod
-DEPEND[man1/openssl-sess_id.pod]{pod}=man1/openssl-sess_id.pod.in
-GENERATE[man1/openssl-sess_id.pod]=man1/openssl-sess_id.pod.in
 DEPEND[html/man1/openssl-skeyutl.html]=man1/openssl-skeyutl.pod
 GENERATE[html/man1/openssl-skeyutl.html]=man1/openssl-skeyutl.pod
 DEPEND[man/man1/openssl-skeyutl.1]=man1/openssl-skeyutl.pod
@@ -336,8 +328,6 @@ DEPEND[html/man1/openssl-version.html]=man1/openssl-version.pod
 GENERATE[html/man1/openssl-version.html]=man1/openssl-version.pod
 DEPEND[man/man1/openssl-version.1]=man1/openssl-version.pod
 GENERATE[man/man1/openssl-version.1]=man1/openssl-version.pod
-DEPEND[man1/openssl-version.pod]{pod}=man1/openssl-version.pod.in
-GENERATE[man1/openssl-version.pod]=man1/openssl-version.pod.in
 DEPEND[html/man1/openssl-x509.html]=man1/openssl-x509.pod
 GENERATE[html/man1/openssl-x509.html]=man1/openssl-x509.pod
 DEPEND[man/man1/openssl-x509.1]=man1/openssl-x509.pod
@@ -360,6 +350,7 @@ html/man1/openssl-ciphers.html \
 html/man1/openssl-cmds.html \
 html/man1/openssl-cmp.html \
 html/man1/openssl-cms.html \
+html/man1/openssl-configutl.html \
 html/man1/openssl-crl.html \
 html/man1/openssl-crl2pkcs7.html \
 html/man1/openssl-dgst.html \
@@ -367,9 +358,9 @@ html/man1/openssl-dhparam.html \
 html/man1/openssl-dsa.html \
 html/man1/openssl-dsaparam.html \
 html/man1/openssl-ec.html \
+html/man1/openssl-ech.html \
 html/man1/openssl-ecparam.html \
 html/man1/openssl-enc.html \
-html/man1/openssl-engine.html \
 html/man1/openssl-errstr.html \
 html/man1/openssl-fipsinstall.html \
 html/man1/openssl-format-options.html \
@@ -421,6 +412,7 @@ man/man1/openssl-ciphers.1 \
 man/man1/openssl-cmds.1 \
 man/man1/openssl-cmp.1 \
 man/man1/openssl-cms.1 \
+man/man1/openssl-configutl.1 \
 man/man1/openssl-crl.1 \
 man/man1/openssl-crl2pkcs7.1 \
 man/man1/openssl-dgst.1 \
@@ -428,9 +420,9 @@ man/man1/openssl-dhparam.1 \
 man/man1/openssl-dsa.1 \
 man/man1/openssl-dsaparam.1 \
 man/man1/openssl-ec.1 \
+man/man1/openssl-ech.1 \
 man/man1/openssl-ecparam.1 \
 man/man1/openssl-enc.1 \
-man/man1/openssl-engine.1 \
 man/man1/openssl-errstr.1 \
 man/man1/openssl-fipsinstall.1 \
 man/man1/openssl-format-options.1 \
@@ -479,6 +471,14 @@ DEPEND[html/man3/ADMISSIONS.html]=man3/ADMISSIONS.pod
 GENERATE[html/man3/ADMISSIONS.html]=man3/ADMISSIONS.pod
 DEPEND[man/man3/ADMISSIONS.3]=man3/ADMISSIONS.pod
 GENERATE[man/man3/ADMISSIONS.3]=man3/ADMISSIONS.pod
+DEPEND[html/man3/ASN1_BIT_STRING_get_length.html]=man3/ASN1_BIT_STRING_get_length.pod
+GENERATE[html/man3/ASN1_BIT_STRING_get_length.html]=man3/ASN1_BIT_STRING_get_length.pod
+DEPEND[man/man3/ASN1_BIT_STRING_get_length.3]=man3/ASN1_BIT_STRING_get_length.pod
+GENERATE[man/man3/ASN1_BIT_STRING_get_length.3]=man3/ASN1_BIT_STRING_get_length.pod
+DEPEND[html/man3/ASN1_BIT_STRING_new.html]=man3/ASN1_BIT_STRING_new.pod
+GENERATE[html/man3/ASN1_BIT_STRING_new.html]=man3/ASN1_BIT_STRING_new.pod
+DEPEND[man/man3/ASN1_BIT_STRING_new.3]=man3/ASN1_BIT_STRING_new.pod
+GENERATE[man/man3/ASN1_BIT_STRING_new.3]=man3/ASN1_BIT_STRING_new.pod
 DEPEND[html/man3/ASN1_EXTERN_FUNCS.html]=man3/ASN1_EXTERN_FUNCS.pod
 GENERATE[html/man3/ASN1_EXTERN_FUNCS.html]=man3/ASN1_EXTERN_FUNCS.pod
 DEPEND[man/man3/ASN1_EXTERN_FUNCS.3]=man3/ASN1_EXTERN_FUNCS.pod
@@ -827,6 +827,10 @@ DEPEND[html/man3/CMS_add1_signer.html]=man3/CMS_add1_signer.pod
 GENERATE[html/man3/CMS_add1_signer.html]=man3/CMS_add1_signer.pod
 DEPEND[man/man3/CMS_add1_signer.3]=man3/CMS_add1_signer.pod
 GENERATE[man/man3/CMS_add1_signer.3]=man3/CMS_add1_signer.pod
+DEPEND[html/man3/CMS_add_standard_smimecap_ex.html]=man3/CMS_add_standard_smimecap_ex.pod
+GENERATE[html/man3/CMS_add_standard_smimecap_ex.html]=man3/CMS_add_standard_smimecap_ex.pod
+DEPEND[man/man3/CMS_add_standard_smimecap_ex.3]=man3/CMS_add_standard_smimecap_ex.pod
+GENERATE[man/man3/CMS_add_standard_smimecap_ex.3]=man3/CMS_add_standard_smimecap_ex.pod
 DEPEND[html/man3/CMS_compress.html]=man3/CMS_compress.pod
 GENERATE[html/man3/CMS_compress.html]=man3/CMS_compress.pod
 DEPEND[man/man3/CMS_compress.3]=man3/CMS_compress.pod
@@ -1119,10 +1123,6 @@ DEPEND[html/man3/ERR_put_error.html]=man3/ERR_put_error.pod
 GENERATE[html/man3/ERR_put_error.html]=man3/ERR_put_error.pod
 DEPEND[man/man3/ERR_put_error.3]=man3/ERR_put_error.pod
 GENERATE[man/man3/ERR_put_error.3]=man3/ERR_put_error.pod
-DEPEND[html/man3/ERR_remove_state.html]=man3/ERR_remove_state.pod
-GENERATE[html/man3/ERR_remove_state.html]=man3/ERR_remove_state.pod
-DEPEND[man/man3/ERR_remove_state.3]=man3/ERR_remove_state.pod
-GENERATE[man/man3/ERR_remove_state.3]=man3/ERR_remove_state.pod
 DEPEND[html/man3/ERR_set_mark.html]=man3/ERR_set_mark.pod
 GENERATE[html/man3/ERR_set_mark.html]=man3/ERR_set_mark.pod
 DEPEND[man/man3/ERR_set_mark.3]=man3/ERR_set_mark.pod
@@ -1147,10 +1147,6 @@ DEPEND[html/man3/EVP_CIPHER_CTX_get_original_iv.html]=man3/EVP_CIPHER_CTX_get_or
 GENERATE[html/man3/EVP_CIPHER_CTX_get_original_iv.html]=man3/EVP_CIPHER_CTX_get_original_iv.pod
 DEPEND[man/man3/EVP_CIPHER_CTX_get_original_iv.3]=man3/EVP_CIPHER_CTX_get_original_iv.pod
 GENERATE[man/man3/EVP_CIPHER_CTX_get_original_iv.3]=man3/EVP_CIPHER_CTX_get_original_iv.pod
-DEPEND[html/man3/EVP_CIPHER_meth_new.html]=man3/EVP_CIPHER_meth_new.pod
-GENERATE[html/man3/EVP_CIPHER_meth_new.html]=man3/EVP_CIPHER_meth_new.pod
-DEPEND[man/man3/EVP_CIPHER_meth_new.3]=man3/EVP_CIPHER_meth_new.pod
-GENERATE[man/man3/EVP_CIPHER_meth_new.3]=man3/EVP_CIPHER_meth_new.pod
 DEPEND[html/man3/EVP_DigestInit.html]=man3/EVP_DigestInit.pod
 GENERATE[html/man3/EVP_DigestInit.html]=man3/EVP_DigestInit.pod
 DEPEND[man/man3/EVP_DigestInit.3]=man3/EVP_DigestInit.pod
@@ -1163,6 +1159,10 @@ DEPEND[html/man3/EVP_DigestVerifyInit.html]=man3/EVP_DigestVerifyInit.pod
 GENERATE[html/man3/EVP_DigestVerifyInit.html]=man3/EVP_DigestVerifyInit.pod
 DEPEND[man/man3/EVP_DigestVerifyInit.3]=man3/EVP_DigestVerifyInit.pod
 GENERATE[man/man3/EVP_DigestVerifyInit.3]=man3/EVP_DigestVerifyInit.pod
+DEPEND[html/man3/EVP_EC_gen.html]=man3/EVP_EC_gen.pod
+GENERATE[html/man3/EVP_EC_gen.html]=man3/EVP_EC_gen.pod
+DEPEND[man/man3/EVP_EC_gen.3]=man3/EVP_EC_gen.pod
+GENERATE[man/man3/EVP_EC_gen.3]=man3/EVP_EC_gen.pod
 DEPEND[html/man3/EVP_EncodeInit.html]=man3/EVP_EncodeInit.pod
 GENERATE[html/man3/EVP_EncodeInit.html]=man3/EVP_EncodeInit.pod
 DEPEND[man/man3/EVP_EncodeInit.3]=man3/EVP_EncodeInit.pod
@@ -1191,10 +1191,6 @@ DEPEND[html/man3/EVP_MAC.html]=man3/EVP_MAC.pod
 GENERATE[html/man3/EVP_MAC.html]=man3/EVP_MAC.pod
 DEPEND[man/man3/EVP_MAC.3]=man3/EVP_MAC.pod
 GENERATE[man/man3/EVP_MAC.3]=man3/EVP_MAC.pod
-DEPEND[html/man3/EVP_MD_meth_new.html]=man3/EVP_MD_meth_new.pod
-GENERATE[html/man3/EVP_MD_meth_new.html]=man3/EVP_MD_meth_new.pod
-DEPEND[man/man3/EVP_MD_meth_new.3]=man3/EVP_MD_meth_new.pod
-GENERATE[man/man3/EVP_MD_meth_new.3]=man3/EVP_MD_meth_new.pod
 DEPEND[html/man3/EVP_OpenInit.html]=man3/EVP_OpenInit.pod
 GENERATE[html/man3/EVP_OpenInit.html]=man3/EVP_OpenInit.pod
 DEPEND[man/man3/EVP_OpenInit.3]=man3/EVP_OpenInit.pod
@@ -1207,10 +1203,6 @@ DEPEND[html/man3/EVP_PKEY2PKCS8.html]=man3/EVP_PKEY2PKCS8.pod
 GENERATE[html/man3/EVP_PKEY2PKCS8.html]=man3/EVP_PKEY2PKCS8.pod
 DEPEND[man/man3/EVP_PKEY2PKCS8.3]=man3/EVP_PKEY2PKCS8.pod
 GENERATE[man/man3/EVP_PKEY2PKCS8.3]=man3/EVP_PKEY2PKCS8.pod
-DEPEND[html/man3/EVP_PKEY_ASN1_METHOD.html]=man3/EVP_PKEY_ASN1_METHOD.pod
-GENERATE[html/man3/EVP_PKEY_ASN1_METHOD.html]=man3/EVP_PKEY_ASN1_METHOD.pod
-DEPEND[man/man3/EVP_PKEY_ASN1_METHOD.3]=man3/EVP_PKEY_ASN1_METHOD.pod
-GENERATE[man/man3/EVP_PKEY_ASN1_METHOD.3]=man3/EVP_PKEY_ASN1_METHOD.pod
 DEPEND[html/man3/EVP_PKEY_CTX_ctrl.html]=man3/EVP_PKEY_CTX_ctrl.pod
 GENERATE[html/man3/EVP_PKEY_CTX_ctrl.html]=man3/EVP_PKEY_CTX_ctrl.pod
 DEPEND[man/man3/EVP_PKEY_CTX_ctrl.3]=man3/EVP_PKEY_CTX_ctrl.pod
@@ -1255,10 +1247,6 @@ DEPEND[html/man3/EVP_PKEY_CTX_set_tls1_prf_md.html]=man3/EVP_PKEY_CTX_set_tls1_p
 GENERATE[html/man3/EVP_PKEY_CTX_set_tls1_prf_md.html]=man3/EVP_PKEY_CTX_set_tls1_prf_md.pod
 DEPEND[man/man3/EVP_PKEY_CTX_set_tls1_prf_md.3]=man3/EVP_PKEY_CTX_set_tls1_prf_md.pod
 GENERATE[man/man3/EVP_PKEY_CTX_set_tls1_prf_md.3]=man3/EVP_PKEY_CTX_set_tls1_prf_md.pod
-DEPEND[html/man3/EVP_PKEY_asn1_get_count.html]=man3/EVP_PKEY_asn1_get_count.pod
-GENERATE[html/man3/EVP_PKEY_asn1_get_count.html]=man3/EVP_PKEY_asn1_get_count.pod
-DEPEND[man/man3/EVP_PKEY_asn1_get_count.3]=man3/EVP_PKEY_asn1_get_count.pod
-GENERATE[man/man3/EVP_PKEY_asn1_get_count.3]=man3/EVP_PKEY_asn1_get_count.pod
 DEPEND[html/man3/EVP_PKEY_check.html]=man3/EVP_PKEY_check.pod
 GENERATE[html/man3/EVP_PKEY_check.html]=man3/EVP_PKEY_check.pod
 DEPEND[man/man3/EVP_PKEY_check.3]=man3/EVP_PKEY_check.pod
@@ -1327,14 +1315,6 @@ DEPEND[html/man3/EVP_PKEY_keygen.html]=man3/EVP_PKEY_keygen.pod
 GENERATE[html/man3/EVP_PKEY_keygen.html]=man3/EVP_PKEY_keygen.pod
 DEPEND[man/man3/EVP_PKEY_keygen.3]=man3/EVP_PKEY_keygen.pod
 GENERATE[man/man3/EVP_PKEY_keygen.3]=man3/EVP_PKEY_keygen.pod
-DEPEND[html/man3/EVP_PKEY_meth_get_count.html]=man3/EVP_PKEY_meth_get_count.pod
-GENERATE[html/man3/EVP_PKEY_meth_get_count.html]=man3/EVP_PKEY_meth_get_count.pod
-DEPEND[man/man3/EVP_PKEY_meth_get_count.3]=man3/EVP_PKEY_meth_get_count.pod
-GENERATE[man/man3/EVP_PKEY_meth_get_count.3]=man3/EVP_PKEY_meth_get_count.pod
-DEPEND[html/man3/EVP_PKEY_meth_new.html]=man3/EVP_PKEY_meth_new.pod
-GENERATE[html/man3/EVP_PKEY_meth_new.html]=man3/EVP_PKEY_meth_new.pod
-DEPEND[man/man3/EVP_PKEY_meth_new.3]=man3/EVP_PKEY_meth_new.pod
-GENERATE[man/man3/EVP_PKEY_meth_new.3]=man3/EVP_PKEY_meth_new.pod
 DEPEND[html/man3/EVP_PKEY_new.html]=man3/EVP_PKEY_new.pod
 GENERATE[html/man3/EVP_PKEY_new.html]=man3/EVP_PKEY_new.pod
 DEPEND[man/man3/EVP_PKEY_new.3]=man3/EVP_PKEY_new.pod
@@ -2675,6 +2655,10 @@ DEPEND[html/man3/SSL_get_handshake_rtt.html]=man3/SSL_get_handshake_rtt.pod
 GENERATE[html/man3/SSL_get_handshake_rtt.html]=man3/SSL_get_handshake_rtt.pod
 DEPEND[man/man3/SSL_get_handshake_rtt.3]=man3/SSL_get_handshake_rtt.pod
 GENERATE[man/man3/SSL_get_handshake_rtt.3]=man3/SSL_get_handshake_rtt.pod
+DEPEND[html/man3/SSL_get_peer_addr.html]=man3/SSL_get_peer_addr.pod
+GENERATE[html/man3/SSL_get_peer_addr.html]=man3/SSL_get_peer_addr.pod
+DEPEND[man/man3/SSL_get_peer_addr.3]=man3/SSL_get_peer_addr.pod
+GENERATE[man/man3/SSL_get_peer_addr.3]=man3/SSL_get_peer_addr.pod
 DEPEND[html/man3/SSL_get_peer_cert_chain.html]=man3/SSL_get_peer_cert_chain.pod
 GENERATE[html/man3/SSL_get_peer_cert_chain.html]=man3/SSL_get_peer_cert_chain.pod
 DEPEND[man/man3/SSL_get_peer_cert_chain.3]=man3/SSL_get_peer_cert_chain.pod
@@ -2799,6 +2783,10 @@ DEPEND[html/man3/SSL_session_reused.html]=man3/SSL_session_reused.pod
 GENERATE[html/man3/SSL_session_reused.html]=man3/SSL_session_reused.pod
 DEPEND[man/man3/SSL_session_reused.3]=man3/SSL_session_reused.pod
 GENERATE[man/man3/SSL_session_reused.3]=man3/SSL_session_reused.pod
+DEPEND[html/man3/SSL_set1_echstore.html]=man3/SSL_set1_echstore.pod
+GENERATE[html/man3/SSL_set1_echstore.html]=man3/SSL_set1_echstore.pod
+DEPEND[man/man3/SSL_set1_echstore.3]=man3/SSL_set1_echstore.pod
+GENERATE[man/man3/SSL_set1_echstore.3]=man3/SSL_set1_echstore.pod
 DEPEND[html/man3/SSL_set1_host.html]=man3/SSL_set1_host.pod
 GENERATE[html/man3/SSL_set1_host.html]=man3/SSL_set1_host.pod
 DEPEND[man/man3/SSL_set1_host.3]=man3/SSL_set1_host.pod
@@ -3043,10 +3031,18 @@ DEPEND[html/man3/X509_STORE_set_verify_cb_func.html]=man3/X509_STORE_set_verify_
 GENERATE[html/man3/X509_STORE_set_verify_cb_func.html]=man3/X509_STORE_set_verify_cb_func.pod
 DEPEND[man/man3/X509_STORE_set_verify_cb_func.3]=man3/X509_STORE_set_verify_cb_func.pod
 GENERATE[man/man3/X509_STORE_set_verify_cb_func.3]=man3/X509_STORE_set_verify_cb_func.pod
+DEPEND[html/man3/X509_VERIFY_PARAM_set1_host.html]=man3/X509_VERIFY_PARAM_set1_host.pod
+GENERATE[html/man3/X509_VERIFY_PARAM_set1_host.html]=man3/X509_VERIFY_PARAM_set1_host.pod
+DEPEND[man/man3/X509_VERIFY_PARAM_set1_host.3]=man3/X509_VERIFY_PARAM_set1_host.pod
+GENERATE[man/man3/X509_VERIFY_PARAM_set1_host.3]=man3/X509_VERIFY_PARAM_set1_host.pod
 DEPEND[html/man3/X509_VERIFY_PARAM_set_flags.html]=man3/X509_VERIFY_PARAM_set_flags.pod
 GENERATE[html/man3/X509_VERIFY_PARAM_set_flags.html]=man3/X509_VERIFY_PARAM_set_flags.pod
 DEPEND[man/man3/X509_VERIFY_PARAM_set_flags.3]=man3/X509_VERIFY_PARAM_set_flags.pod
 GENERATE[man/man3/X509_VERIFY_PARAM_set_flags.3]=man3/X509_VERIFY_PARAM_set_flags.pod
+DEPEND[html/man3/X509_VERIFY_PARAM_set_hostflags.html]=man3/X509_VERIFY_PARAM_set_hostflags.pod
+GENERATE[html/man3/X509_VERIFY_PARAM_set_hostflags.html]=man3/X509_VERIFY_PARAM_set_hostflags.pod
+DEPEND[man/man3/X509_VERIFY_PARAM_set_hostflags.3]=man3/X509_VERIFY_PARAM_set_hostflags.pod
+GENERATE[man/man3/X509_VERIFY_PARAM_set_hostflags.3]=man3/X509_VERIFY_PARAM_set_hostflags.pod
 DEPEND[html/man3/X509_add_cert.html]=man3/X509_add_cert.pod
 GENERATE[html/man3/X509_add_cert.html]=man3/X509_add_cert.pod
 DEPEND[man/man3/X509_add_cert.3]=man3/X509_add_cert.pod
@@ -3055,6 +3051,10 @@ DEPEND[html/man3/X509_check_ca.html]=man3/X509_check_ca.pod
 GENERATE[html/man3/X509_check_ca.html]=man3/X509_check_ca.pod
 DEPEND[man/man3/X509_check_ca.3]=man3/X509_check_ca.pod
 GENERATE[man/man3/X509_check_ca.3]=man3/X509_check_ca.pod
+DEPEND[html/man3/X509_check_certificate_times.html]=man3/X509_check_certificate_times.pod
+GENERATE[html/man3/X509_check_certificate_times.html]=man3/X509_check_certificate_times.pod
+DEPEND[man/man3/X509_check_certificate_times.3]=man3/X509_check_certificate_times.pod
+GENERATE[man/man3/X509_check_certificate_times.3]=man3/X509_check_certificate_times.pod
 DEPEND[html/man3/X509_check_host.html]=man3/X509_check_host.pod
 GENERATE[html/man3/X509_check_host.html]=man3/X509_check_host.pod
 DEPEND[man/man3/X509_check_host.3]=man3/X509_check_host.pod
@@ -3075,10 +3075,6 @@ DEPEND[html/man3/X509_cmp.html]=man3/X509_cmp.pod
 GENERATE[html/man3/X509_cmp.html]=man3/X509_cmp.pod
 DEPEND[man/man3/X509_cmp.3]=man3/X509_cmp.pod
 GENERATE[man/man3/X509_cmp.3]=man3/X509_cmp.pod
-DEPEND[html/man3/X509_cmp_time.html]=man3/X509_cmp_time.pod
-GENERATE[html/man3/X509_cmp_time.html]=man3/X509_cmp_time.pod
-DEPEND[man/man3/X509_cmp_time.3]=man3/X509_cmp_time.pod
-GENERATE[man/man3/X509_cmp_time.3]=man3/X509_cmp_time.pod
 DEPEND[html/man3/X509_digest.html]=man3/X509_digest.pod
 GENERATE[html/man3/X509_digest.html]=man3/X509_digest.pod
 DEPEND[man/man3/X509_digest.3]=man3/X509_digest.pod
@@ -3175,14 +3171,10 @@ DEPEND[html/man3/d2i_X509.html]=man3/d2i_X509.pod
 GENERATE[html/man3/d2i_X509.html]=man3/d2i_X509.pod
 DEPEND[man/man3/d2i_X509.3]=man3/d2i_X509.pod
 GENERATE[man/man3/d2i_X509.3]=man3/d2i_X509.pod
-DEPEND[html/man3/i2d_CMS_bio_stream.html]=man3/i2d_CMS_bio_stream.pod
-GENERATE[html/man3/i2d_CMS_bio_stream.html]=man3/i2d_CMS_bio_stream.pod
-DEPEND[man/man3/i2d_CMS_bio_stream.3]=man3/i2d_CMS_bio_stream.pod
-GENERATE[man/man3/i2d_CMS_bio_stream.3]=man3/i2d_CMS_bio_stream.pod
-DEPEND[html/man3/i2d_PKCS7_bio_stream.html]=man3/i2d_PKCS7_bio_stream.pod
-GENERATE[html/man3/i2d_PKCS7_bio_stream.html]=man3/i2d_PKCS7_bio_stream.pod
-DEPEND[man/man3/i2d_PKCS7_bio_stream.3]=man3/i2d_PKCS7_bio_stream.pod
-GENERATE[man/man3/i2d_PKCS7_bio_stream.3]=man3/i2d_PKCS7_bio_stream.pod
+DEPEND[html/man3/i2d_ASN1_bio_stream.html]=man3/i2d_ASN1_bio_stream.pod
+GENERATE[html/man3/i2d_ASN1_bio_stream.html]=man3/i2d_ASN1_bio_stream.pod
+DEPEND[man/man3/i2d_ASN1_bio_stream.3]=man3/i2d_ASN1_bio_stream.pod
+GENERATE[man/man3/i2d_ASN1_bio_stream.3]=man3/i2d_ASN1_bio_stream.pod
 DEPEND[html/man3/i2d_re_X509_tbs.html]=man3/i2d_re_X509_tbs.pod
 GENERATE[html/man3/i2d_re_X509_tbs.html]=man3/i2d_re_X509_tbs.pod
 DEPEND[man/man3/i2d_re_X509_tbs.3]=man3/i2d_re_X509_tbs.pod
@@ -3197,6 +3189,8 @@ DEPEND[man/man3/s2i_ASN1_IA5STRING.3]=man3/s2i_ASN1_IA5STRING.pod
 GENERATE[man/man3/s2i_ASN1_IA5STRING.3]=man3/s2i_ASN1_IA5STRING.pod
 IMAGEDOCS[man3]=
 HTMLDOCS[man3]=html/man3/ADMISSIONS.html \
+html/man3/ASN1_BIT_STRING_get_length.html \
+html/man3/ASN1_BIT_STRING_new.html \
 html/man3/ASN1_EXTERN_FUNCS.html \
 html/man3/ASN1_INTEGER_get_int64.html \
 html/man3/ASN1_INTEGER_new.html \
@@ -3284,6 +3278,7 @@ html/man3/CMS_EnvelopedData_create.html \
 html/man3/CMS_add0_cert.html \
 html/man3/CMS_add1_recipient_cert.html \
 html/man3/CMS_add1_signer.html \
+html/man3/CMS_add_standard_smimecap_ex.html \
 html/man3/CMS_compress.html \
 html/man3/CMS_data_create.html \
 html/man3/CMS_decrypt.html \
@@ -3357,17 +3352,16 @@ html/man3/ERR_load_strings.html \
 html/man3/ERR_new.html \
 html/man3/ERR_print_errors.html \
 html/man3/ERR_put_error.html \
-html/man3/ERR_remove_state.html \
 html/man3/ERR_set_mark.html \
 html/man3/EVP_ASYM_CIPHER_free.html \
 html/man3/EVP_BytesToKey.html \
 html/man3/EVP_CIPHER_CTX_get_app_data.html \
 html/man3/EVP_CIPHER_CTX_get_cipher_data.html \
 html/man3/EVP_CIPHER_CTX_get_original_iv.html \
-html/man3/EVP_CIPHER_meth_new.html \
 html/man3/EVP_DigestInit.html \
 html/man3/EVP_DigestSignInit.html \
 html/man3/EVP_DigestVerifyInit.html \
+html/man3/EVP_EC_gen.html \
 html/man3/EVP_EncodeInit.html \
 html/man3/EVP_EncryptInit.html \
 html/man3/EVP_KDF.html \
@@ -3375,11 +3369,9 @@ html/man3/EVP_KEM_free.html \
 html/man3/EVP_KEYEXCH_free.html \
 html/man3/EVP_KEYMGMT.html \
 html/man3/EVP_MAC.html \
-html/man3/EVP_MD_meth_new.html \
 html/man3/EVP_OpenInit.html \
 html/man3/EVP_PBE_CipherInit.html \
 html/man3/EVP_PKEY2PKCS8.html \
-html/man3/EVP_PKEY_ASN1_METHOD.html \
 html/man3/EVP_PKEY_CTX_ctrl.html \
 html/man3/EVP_PKEY_CTX_get0_libctx.html \
 html/man3/EVP_PKEY_CTX_get0_pkey.html \
@@ -3391,7 +3383,6 @@ html/man3/EVP_PKEY_CTX_set_params.html \
 html/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.html \
 html/man3/EVP_PKEY_CTX_set_scrypt_N.html \
 html/man3/EVP_PKEY_CTX_set_tls1_prf_md.html \
-html/man3/EVP_PKEY_asn1_get_count.html \
 html/man3/EVP_PKEY_check.html \
 html/man3/EVP_PKEY_copy_parameters.html \
 html/man3/EVP_PKEY_decapsulate.html \
@@ -3409,8 +3400,6 @@ html/man3/EVP_PKEY_get_size.html \
 html/man3/EVP_PKEY_gettable_params.html \
 html/man3/EVP_PKEY_is_a.html \
 html/man3/EVP_PKEY_keygen.html \
-html/man3/EVP_PKEY_meth_get_count.html \
-html/man3/EVP_PKEY_meth_new.html \
 html/man3/EVP_PKEY_new.html \
 html/man3/EVP_PKEY_print_private.html \
 html/man3/EVP_PKEY_set1_RSA.html \
@@ -3746,6 +3735,7 @@ html/man3/SSL_get_event_timeout.html \
 html/man3/SSL_get_extms_support.html \
 html/man3/SSL_get_fd.html \
 html/man3/SSL_get_handshake_rtt.html \
+html/man3/SSL_get_peer_addr.html \
 html/man3/SSL_get_peer_cert_chain.html \
 html/man3/SSL_get_peer_certificate.html \
 html/man3/SSL_get_peer_signature_nid.html \
@@ -3777,6 +3767,7 @@ html/man3/SSL_read.html \
 html/man3/SSL_read_early_data.html \
 html/man3/SSL_rstate_string.html \
 html/man3/SSL_session_reused.html \
+html/man3/SSL_set1_echstore.html \
 html/man3/SSL_set1_host.html \
 html/man3/SSL_set1_initial_peer_addr.html \
 html/man3/SSL_set1_server_cert_type.html \
@@ -3838,15 +3829,17 @@ html/man3/X509_STORE_add_cert.html \
 html/man3/X509_STORE_get0_param.html \
 html/man3/X509_STORE_new.html \
 html/man3/X509_STORE_set_verify_cb_func.html \
+html/man3/X509_VERIFY_PARAM_set1_host.html \
 html/man3/X509_VERIFY_PARAM_set_flags.html \
+html/man3/X509_VERIFY_PARAM_set_hostflags.html \
 html/man3/X509_add_cert.html \
 html/man3/X509_check_ca.html \
+html/man3/X509_check_certificate_times.html \
 html/man3/X509_check_host.html \
 html/man3/X509_check_issued.html \
 html/man3/X509_check_private_key.html \
 html/man3/X509_check_purpose.html \
 html/man3/X509_cmp.html \
-html/man3/X509_cmp_time.html \
 html/man3/X509_digest.html \
 html/man3/X509_dup.html \
 html/man3/X509_get0_distinguishing_id.html \
@@ -3871,12 +3864,13 @@ html/man3/d2i_PrivateKey.html \
 html/man3/d2i_RSAPrivateKey.html \
 html/man3/d2i_SSL_SESSION.html \
 html/man3/d2i_X509.html \
-html/man3/i2d_CMS_bio_stream.html \
-html/man3/i2d_PKCS7_bio_stream.html \
+html/man3/i2d_ASN1_bio_stream.html \
 html/man3/i2d_re_X509_tbs.html \
 html/man3/o2i_SCT_LIST.html \
 html/man3/s2i_ASN1_IA5STRING.html
 MANDOCS[man3]=man/man3/ADMISSIONS.3 \
+man/man3/ASN1_BIT_STRING_get_length.3 \
+man/man3/ASN1_BIT_STRING_new.3 \
 man/man3/ASN1_EXTERN_FUNCS.3 \
 man/man3/ASN1_INTEGER_get_int64.3 \
 man/man3/ASN1_INTEGER_new.3 \
@@ -3964,6 +3958,7 @@ man/man3/CMS_EnvelopedData_create.3 \
 man/man3/CMS_add0_cert.3 \
 man/man3/CMS_add1_recipient_cert.3 \
 man/man3/CMS_add1_signer.3 \
+man/man3/CMS_add_standard_smimecap_ex.3 \
 man/man3/CMS_compress.3 \
 man/man3/CMS_data_create.3 \
 man/man3/CMS_decrypt.3 \
@@ -4037,17 +4032,16 @@ man/man3/ERR_load_strings.3 \
 man/man3/ERR_new.3 \
 man/man3/ERR_print_errors.3 \
 man/man3/ERR_put_error.3 \
-man/man3/ERR_remove_state.3 \
 man/man3/ERR_set_mark.3 \
 man/man3/EVP_ASYM_CIPHER_free.3 \
 man/man3/EVP_BytesToKey.3 \
 man/man3/EVP_CIPHER_CTX_get_app_data.3 \
 man/man3/EVP_CIPHER_CTX_get_cipher_data.3 \
 man/man3/EVP_CIPHER_CTX_get_original_iv.3 \
-man/man3/EVP_CIPHER_meth_new.3 \
 man/man3/EVP_DigestInit.3 \
 man/man3/EVP_DigestSignInit.3 \
 man/man3/EVP_DigestVerifyInit.3 \
+man/man3/EVP_EC_gen.3 \
 man/man3/EVP_EncodeInit.3 \
 man/man3/EVP_EncryptInit.3 \
 man/man3/EVP_KDF.3 \
@@ -4055,11 +4049,9 @@ man/man3/EVP_KEM_free.3 \
 man/man3/EVP_KEYEXCH_free.3 \
 man/man3/EVP_KEYMGMT.3 \
 man/man3/EVP_MAC.3 \
-man/man3/EVP_MD_meth_new.3 \
 man/man3/EVP_OpenInit.3 \
 man/man3/EVP_PBE_CipherInit.3 \
 man/man3/EVP_PKEY2PKCS8.3 \
-man/man3/EVP_PKEY_ASN1_METHOD.3 \
 man/man3/EVP_PKEY_CTX_ctrl.3 \
 man/man3/EVP_PKEY_CTX_get0_libctx.3 \
 man/man3/EVP_PKEY_CTX_get0_pkey.3 \
@@ -4071,7 +4063,6 @@ man/man3/EVP_PKEY_CTX_set_params.3 \
 man/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 \
 man/man3/EVP_PKEY_CTX_set_scrypt_N.3 \
 man/man3/EVP_PKEY_CTX_set_tls1_prf_md.3 \
-man/man3/EVP_PKEY_asn1_get_count.3 \
 man/man3/EVP_PKEY_check.3 \
 man/man3/EVP_PKEY_copy_parameters.3 \
 man/man3/EVP_PKEY_decapsulate.3 \
@@ -4089,8 +4080,6 @@ man/man3/EVP_PKEY_get_size.3 \
 man/man3/EVP_PKEY_gettable_params.3 \
 man/man3/EVP_PKEY_is_a.3 \
 man/man3/EVP_PKEY_keygen.3 \
-man/man3/EVP_PKEY_meth_get_count.3 \
-man/man3/EVP_PKEY_meth_new.3 \
 man/man3/EVP_PKEY_new.3 \
 man/man3/EVP_PKEY_print_private.3 \
 man/man3/EVP_PKEY_set1_RSA.3 \
@@ -4426,6 +4415,7 @@ man/man3/SSL_get_event_timeout.3 \
 man/man3/SSL_get_extms_support.3 \
 man/man3/SSL_get_fd.3 \
 man/man3/SSL_get_handshake_rtt.3 \
+man/man3/SSL_get_peer_addr.3 \
 man/man3/SSL_get_peer_cert_chain.3 \
 man/man3/SSL_get_peer_certificate.3 \
 man/man3/SSL_get_peer_signature_nid.3 \
@@ -4457,6 +4447,7 @@ man/man3/SSL_read.3 \
 man/man3/SSL_read_early_data.3 \
 man/man3/SSL_rstate_string.3 \
 man/man3/SSL_session_reused.3 \
+man/man3/SSL_set1_echstore.3 \
 man/man3/SSL_set1_host.3 \
 man/man3/SSL_set1_initial_peer_addr.3 \
 man/man3/SSL_set1_server_cert_type.3 \
@@ -4518,15 +4509,17 @@ man/man3/X509_STORE_add_cert.3 \
 man/man3/X509_STORE_get0_param.3 \
 man/man3/X509_STORE_new.3 \
 man/man3/X509_STORE_set_verify_cb_func.3 \
+man/man3/X509_VERIFY_PARAM_set1_host.3 \
 man/man3/X509_VERIFY_PARAM_set_flags.3 \
+man/man3/X509_VERIFY_PARAM_set_hostflags.3 \
 man/man3/X509_add_cert.3 \
 man/man3/X509_check_ca.3 \
+man/man3/X509_check_certificate_times.3 \
 man/man3/X509_check_host.3 \
 man/man3/X509_check_issued.3 \
 man/man3/X509_check_private_key.3 \
 man/man3/X509_check_purpose.3 \
 man/man3/X509_cmp.3 \
-man/man3/X509_cmp_time.3 \
 man/man3/X509_digest.3 \
 man/man3/X509_dup.3 \
 man/man3/X509_get0_distinguishing_id.3 \
@@ -4551,8 +4544,7 @@ man/man3/d2i_PrivateKey.3 \
 man/man3/d2i_RSAPrivateKey.3 \
 man/man3/d2i_SSL_SESSION.3 \
 man/man3/d2i_X509.3 \
-man/man3/i2d_CMS_bio_stream.3 \
-man/man3/i2d_PKCS7_bio_stream.3 \
+man/man3/i2d_ASN1_bio_stream.3 \
 man/man3/i2d_re_X509_tbs.3 \
 man/man3/o2i_SCT_LIST.3 \
 man/man3/s2i_ASN1_IA5STRING.3
@@ -4651,6 +4643,10 @@ DEPEND[html/man7/EVP_KDF-HMAC-DRBG.html]=man7/EVP_KDF-HMAC-DRBG.pod
 GENERATE[html/man7/EVP_KDF-HMAC-DRBG.html]=man7/EVP_KDF-HMAC-DRBG.pod
 DEPEND[man/man7/EVP_KDF-HMAC-DRBG.7]=man7/EVP_KDF-HMAC-DRBG.pod
 GENERATE[man/man7/EVP_KDF-HMAC-DRBG.7]=man7/EVP_KDF-HMAC-DRBG.pod
+DEPEND[html/man7/EVP_KDF-IKEV2KDF.html]=man7/EVP_KDF-IKEV2KDF.pod
+GENERATE[html/man7/EVP_KDF-IKEV2KDF.html]=man7/EVP_KDF-IKEV2KDF.pod
+DEPEND[man/man7/EVP_KDF-IKEV2KDF.7]=man7/EVP_KDF-IKEV2KDF.pod
+GENERATE[man/man7/EVP_KDF-IKEV2KDF.7]=man7/EVP_KDF-IKEV2KDF.pod
 DEPEND[html/man7/EVP_KDF-KB.html]=man7/EVP_KDF-KB.pod
 GENERATE[html/man7/EVP_KDF-KB.html]=man7/EVP_KDF-KB.pod
 DEPEND[man/man7/EVP_KDF-KB.7]=man7/EVP_KDF-KB.pod
@@ -4679,6 +4675,14 @@ DEPEND[html/man7/EVP_KDF-SCRYPT.html]=man7/EVP_KDF-SCRYPT.pod
 GENERATE[html/man7/EVP_KDF-SCRYPT.html]=man7/EVP_KDF-SCRYPT.pod
 DEPEND[man/man7/EVP_KDF-SCRYPT.7]=man7/EVP_KDF-SCRYPT.pod
 GENERATE[man/man7/EVP_KDF-SCRYPT.7]=man7/EVP_KDF-SCRYPT.pod
+DEPEND[html/man7/EVP_KDF-SNMPKDF.html]=man7/EVP_KDF-SNMPKDF.pod
+GENERATE[html/man7/EVP_KDF-SNMPKDF.html]=man7/EVP_KDF-SNMPKDF.pod
+DEPEND[man/man7/EVP_KDF-SNMPKDF.7]=man7/EVP_KDF-SNMPKDF.pod
+GENERATE[man/man7/EVP_KDF-SNMPKDF.7]=man7/EVP_KDF-SNMPKDF.pod
+DEPEND[html/man7/EVP_KDF-SRTPKDF.html]=man7/EVP_KDF-SRTPKDF.pod
+GENERATE[html/man7/EVP_KDF-SRTPKDF.html]=man7/EVP_KDF-SRTPKDF.pod
+DEPEND[man/man7/EVP_KDF-SRTPKDF.7]=man7/EVP_KDF-SRTPKDF.pod
+GENERATE[man/man7/EVP_KDF-SRTPKDF.7]=man7/EVP_KDF-SRTPKDF.pod
 DEPEND[html/man7/EVP_KDF-SS.html]=man7/EVP_KDF-SS.pod
 GENERATE[html/man7/EVP_KDF-SS.html]=man7/EVP_KDF-SS.pod
 DEPEND[man/man7/EVP_KDF-SS.7]=man7/EVP_KDF-SS.pod
@@ -4791,6 +4795,10 @@ DEPEND[html/man7/EVP_MD-MDC2.html]=man7/EVP_MD-MDC2.pod
 GENERATE[html/man7/EVP_MD-MDC2.html]=man7/EVP_MD-MDC2.pod
 DEPEND[man/man7/EVP_MD-MDC2.7]=man7/EVP_MD-MDC2.pod
 GENERATE[man/man7/EVP_MD-MDC2.7]=man7/EVP_MD-MDC2.pod
+DEPEND[html/man7/EVP_MD-ML-DSA-MU.html]=man7/EVP_MD-ML-DSA-MU.pod
+GENERATE[html/man7/EVP_MD-ML-DSA-MU.html]=man7/EVP_MD-ML-DSA-MU.pod
+DEPEND[man/man7/EVP_MD-ML-DSA-MU.7]=man7/EVP_MD-ML-DSA-MU.pod
+GENERATE[man/man7/EVP_MD-ML-DSA-MU.7]=man7/EVP_MD-ML-DSA-MU.pod
 DEPEND[html/man7/EVP_MD-NULL.html]=man7/EVP_MD-NULL.pod
 GENERATE[html/man7/EVP_MD-NULL.html]=man7/EVP_MD-NULL.pod
 DEPEND[man/man7/EVP_MD-NULL.7]=man7/EVP_MD-NULL.pod
@@ -4847,6 +4855,10 @@ DEPEND[html/man7/EVP_PKEY-HMAC.html]=man7/EVP_PKEY-HMAC.pod
 GENERATE[html/man7/EVP_PKEY-HMAC.html]=man7/EVP_PKEY-HMAC.pod
 DEPEND[man/man7/EVP_PKEY-HMAC.7]=man7/EVP_PKEY-HMAC.pod
 GENERATE[man/man7/EVP_PKEY-HMAC.7]=man7/EVP_PKEY-HMAC.pod
+DEPEND[html/man7/EVP_PKEY-LMS.html]=man7/EVP_PKEY-LMS.pod
+GENERATE[html/man7/EVP_PKEY-LMS.html]=man7/EVP_PKEY-LMS.pod
+DEPEND[man/man7/EVP_PKEY-LMS.7]=man7/EVP_PKEY-LMS.pod
+GENERATE[man/man7/EVP_PKEY-LMS.7]=man7/EVP_PKEY-LMS.pod
 DEPEND[html/man7/EVP_PKEY-ML-DSA.html]=man7/EVP_PKEY-ML-DSA.pod
 GENERATE[html/man7/EVP_PKEY-ML-DSA.html]=man7/EVP_PKEY-ML-DSA.pod
 DEPEND[man/man7/EVP_PKEY-ML-DSA.7]=man7/EVP_PKEY-ML-DSA.pod
@@ -4855,6 +4867,10 @@ DEPEND[html/man7/EVP_PKEY-ML-KEM.html]=man7/EVP_PKEY-ML-KEM.pod
 GENERATE[html/man7/EVP_PKEY-ML-KEM.html]=man7/EVP_PKEY-ML-KEM.pod
 DEPEND[man/man7/EVP_PKEY-ML-KEM.7]=man7/EVP_PKEY-ML-KEM.pod
 GENERATE[man/man7/EVP_PKEY-ML-KEM.7]=man7/EVP_PKEY-ML-KEM.pod
+DEPEND[html/man7/EVP_PKEY-MLX-KEM.html]=man7/EVP_PKEY-MLX-KEM.pod
+GENERATE[html/man7/EVP_PKEY-MLX-KEM.html]=man7/EVP_PKEY-MLX-KEM.pod
+DEPEND[man/man7/EVP_PKEY-MLX-KEM.7]=man7/EVP_PKEY-MLX-KEM.pod
+GENERATE[man/man7/EVP_PKEY-MLX-KEM.7]=man7/EVP_PKEY-MLX-KEM.pod
 DEPEND[html/man7/EVP_PKEY-RSA.html]=man7/EVP_PKEY-RSA.pod
 GENERATE[html/man7/EVP_PKEY-RSA.html]=man7/EVP_PKEY-RSA.pod
 DEPEND[man/man7/EVP_PKEY-RSA.7]=man7/EVP_PKEY-RSA.pod
@@ -4919,6 +4935,10 @@ DEPEND[html/man7/EVP_SIGNATURE-HMAC.html]=man7/EVP_SIGNATURE-HMAC.pod
 GENERATE[html/man7/EVP_SIGNATURE-HMAC.html]=man7/EVP_SIGNATURE-HMAC.pod
 DEPEND[man/man7/EVP_SIGNATURE-HMAC.7]=man7/EVP_SIGNATURE-HMAC.pod
 GENERATE[man/man7/EVP_SIGNATURE-HMAC.7]=man7/EVP_SIGNATURE-HMAC.pod
+DEPEND[html/man7/EVP_SIGNATURE-LMS.html]=man7/EVP_SIGNATURE-LMS.pod
+GENERATE[html/man7/EVP_SIGNATURE-LMS.html]=man7/EVP_SIGNATURE-LMS.pod
+DEPEND[man/man7/EVP_SIGNATURE-LMS.7]=man7/EVP_SIGNATURE-LMS.pod
+GENERATE[man/man7/EVP_SIGNATURE-LMS.7]=man7/EVP_SIGNATURE-LMS.pod
 DEPEND[html/man7/EVP_SIGNATURE-ML-DSA.html]=man7/EVP_SIGNATURE-ML-DSA.pod
 GENERATE[html/man7/EVP_SIGNATURE-ML-DSA.html]=man7/EVP_SIGNATURE-ML-DSA.pod
 DEPEND[man/man7/EVP_SIGNATURE-ML-DSA.7]=man7/EVP_SIGNATURE-ML-DSA.pod
@@ -4931,6 +4951,10 @@ DEPEND[html/man7/EVP_SIGNATURE-SLH-DSA.html]=man7/EVP_SIGNATURE-SLH-DSA.pod
 GENERATE[html/man7/EVP_SIGNATURE-SLH-DSA.html]=man7/EVP_SIGNATURE-SLH-DSA.pod
 DEPEND[man/man7/EVP_SIGNATURE-SLH-DSA.7]=man7/EVP_SIGNATURE-SLH-DSA.pod
 GENERATE[man/man7/EVP_SIGNATURE-SLH-DSA.7]=man7/EVP_SIGNATURE-SLH-DSA.pod
+DEPEND[html/man7/EVP_SIGNATURE-SM2.html]=man7/EVP_SIGNATURE-SM2.pod
+GENERATE[html/man7/EVP_SIGNATURE-SM2.html]=man7/EVP_SIGNATURE-SM2.pod
+DEPEND[man/man7/EVP_SIGNATURE-SM2.7]=man7/EVP_SIGNATURE-SM2.pod
+GENERATE[man/man7/EVP_SIGNATURE-SM2.7]=man7/EVP_SIGNATURE-SM2.pod
 DEPEND[html/man7/OSSL_PROVIDER-FIPS.html]=man7/OSSL_PROVIDER-FIPS.pod
 GENERATE[html/man7/OSSL_PROVIDER-FIPS.html]=man7/OSSL_PROVIDER-FIPS.pod
 DEPEND[man/man7/OSSL_PROVIDER-FIPS.7]=man7/OSSL_PROVIDER-FIPS.pod
@@ -5053,6 +5077,10 @@ DEPEND[man/man7/openssl_user_macros.7]=man7/openssl_user_macros.pod
 GENERATE[man/man7/openssl_user_macros.7]=man7/openssl_user_macros.pod
 DEPEND[man7/openssl_user_macros.pod]{pod}=man7/openssl_user_macros.pod.in
 GENERATE[man7/openssl_user_macros.pod]=man7/openssl_user_macros.pod.in
+DEPEND[html/man7/ossl-guide-dtlsv13.html]=man7/ossl-guide-dtlsv13.pod
+GENERATE[html/man7/ossl-guide-dtlsv13.html]=man7/ossl-guide-dtlsv13.pod
+DEPEND[man/man7/ossl-guide-dtlsv13.7]=man7/ossl-guide-dtlsv13.pod
+GENERATE[man/man7/ossl-guide-dtlsv13.7]=man7/ossl-guide-dtlsv13.pod
 DEPEND[html/man7/ossl-guide-introduction.html]=man7/ossl-guide-introduction.pod
 GENERATE[html/man7/ossl-guide-introduction.html]=man7/ossl-guide-introduction.pod
 DEPEND[man/man7/ossl-guide-introduction.7]=man7/ossl-guide-introduction.pod
@@ -5113,6 +5141,10 @@ DEPEND[html/man7/ossl-guide-tls-server-block.html]=man7/ossl-guide-tls-server-bl
 GENERATE[html/man7/ossl-guide-tls-server-block.html]=man7/ossl-guide-tls-server-block.pod
 DEPEND[man/man7/ossl-guide-tls-server-block.7]=man7/ossl-guide-tls-server-block.pod
 GENERATE[man/man7/ossl-guide-tls-server-block.7]=man7/ossl-guide-tls-server-block.pod
+DEPEND[html/man7/ossl-removed-api.html]=man7/ossl-removed-api.pod
+GENERATE[html/man7/ossl-removed-api.html]=man7/ossl-removed-api.pod
+DEPEND[man/man7/ossl-removed-api.7]=man7/ossl-removed-api.pod
+GENERATE[man/man7/ossl-removed-api.7]=man7/ossl-removed-api.pod
 DEPEND[html/man7/ossl_store-file.html]=man7/ossl_store-file.pod
 GENERATE[html/man7/ossl_store-file.html]=man7/ossl_store-file.pod
 DEPEND[man/man7/ossl_store-file.7]=man7/ossl_store-file.pod
@@ -5230,6 +5262,7 @@ html/man7/EVP_CIPHER-SM4.html \
 html/man7/EVP_KDF-ARGON2.html \
 html/man7/EVP_KDF-HKDF.html \
 html/man7/EVP_KDF-HMAC-DRBG.html \
+html/man7/EVP_KDF-IKEV2KDF.html \
 html/man7/EVP_KDF-KB.html \
 html/man7/EVP_KDF-KRB5KDF.html \
 html/man7/EVP_KDF-PBKDF1.html \
@@ -5237,6 +5270,8 @@ html/man7/EVP_KDF-PBKDF2.html \
 html/man7/EVP_KDF-PKCS12KDF.html \
 html/man7/EVP_KDF-PVKKDF.html \
 html/man7/EVP_KDF-SCRYPT.html \
+html/man7/EVP_KDF-SNMPKDF.html \
+html/man7/EVP_KDF-SRTPKDF.html \
 html/man7/EVP_KDF-SS.html \
 html/man7/EVP_KDF-SSHKDF.html \
 html/man7/EVP_KDF-TLS13_KDF.html \
@@ -5265,6 +5300,7 @@ html/man7/EVP_MD-MD4.html \
 html/man7/EVP_MD-MD5-SHA1.html \
 html/man7/EVP_MD-MD5.html \
 html/man7/EVP_MD-MDC2.html \
+html/man7/EVP_MD-ML-DSA-MU.html \
 html/man7/EVP_MD-NULL.html \
 html/man7/EVP_MD-RIPEMD160.html \
 html/man7/EVP_MD-SHA1.html \
@@ -5279,8 +5315,10 @@ html/man7/EVP_PKEY-DSA.html \
 html/man7/EVP_PKEY-EC.html \
 html/man7/EVP_PKEY-FFC.html \
 html/man7/EVP_PKEY-HMAC.html \
+html/man7/EVP_PKEY-LMS.html \
 html/man7/EVP_PKEY-ML-DSA.html \
 html/man7/EVP_PKEY-ML-KEM.html \
+html/man7/EVP_PKEY-MLX-KEM.html \
 html/man7/EVP_PKEY-RSA.html \
 html/man7/EVP_PKEY-SLH-DSA.html \
 html/man7/EVP_PKEY-SM2.html \
@@ -5297,9 +5335,11 @@ html/man7/EVP_SIGNATURE-DSA.html \
 html/man7/EVP_SIGNATURE-ECDSA.html \
 html/man7/EVP_SIGNATURE-ED25519.html \
 html/man7/EVP_SIGNATURE-HMAC.html \
+html/man7/EVP_SIGNATURE-LMS.html \
 html/man7/EVP_SIGNATURE-ML-DSA.html \
 html/man7/EVP_SIGNATURE-RSA.html \
 html/man7/EVP_SIGNATURE-SLH-DSA.html \
+html/man7/EVP_SIGNATURE-SM2.html \
 html/man7/OSSL_PROVIDER-FIPS.html \
 html/man7/OSSL_PROVIDER-base.html \
 html/man7/OSSL_PROVIDER-default.html \
@@ -5330,6 +5370,7 @@ html/man7/openssl-quic-concurrency.html \
 html/man7/openssl-quic.html \
 html/man7/openssl-threads.html \
 html/man7/openssl_user_macros.html \
+html/man7/ossl-guide-dtlsv13.html \
 html/man7/ossl-guide-introduction.html \
 html/man7/ossl-guide-libcrypto-introduction.html \
 html/man7/ossl-guide-libraries-introduction.html \
@@ -5345,6 +5386,7 @@ html/man7/ossl-guide-tls-client-block.html \
 html/man7/ossl-guide-tls-client-non-block.html \
 html/man7/ossl-guide-tls-introduction.html \
 html/man7/ossl-guide-tls-server-block.html \
+html/man7/ossl-removed-api.html \
 html/man7/ossl_store-file.html \
 html/man7/ossl_store.html \
 html/man7/passphrase-encoding.html \
@@ -5387,6 +5429,7 @@ man/man7/EVP_CIPHER-SM4.7 \
 man/man7/EVP_KDF-ARGON2.7 \
 man/man7/EVP_KDF-HKDF.7 \
 man/man7/EVP_KDF-HMAC-DRBG.7 \
+man/man7/EVP_KDF-IKEV2KDF.7 \
 man/man7/EVP_KDF-KB.7 \
 man/man7/EVP_KDF-KRB5KDF.7 \
 man/man7/EVP_KDF-PBKDF1.7 \
@@ -5394,6 +5437,8 @@ man/man7/EVP_KDF-PBKDF2.7 \
 man/man7/EVP_KDF-PKCS12KDF.7 \
 man/man7/EVP_KDF-PVKKDF.7 \
 man/man7/EVP_KDF-SCRYPT.7 \
+man/man7/EVP_KDF-SNMPKDF.7 \
+man/man7/EVP_KDF-SRTPKDF.7 \
 man/man7/EVP_KDF-SS.7 \
 man/man7/EVP_KDF-SSHKDF.7 \
 man/man7/EVP_KDF-TLS13_KDF.7 \
@@ -5422,6 +5467,7 @@ man/man7/EVP_MD-MD4.7 \
 man/man7/EVP_MD-MD5-SHA1.7 \
 man/man7/EVP_MD-MD5.7 \
 man/man7/EVP_MD-MDC2.7 \
+man/man7/EVP_MD-ML-DSA-MU.7 \
 man/man7/EVP_MD-NULL.7 \
 man/man7/EVP_MD-RIPEMD160.7 \
 man/man7/EVP_MD-SHA1.7 \
@@ -5436,8 +5482,10 @@ man/man7/EVP_PKEY-DSA.7 \
 man/man7/EVP_PKEY-EC.7 \
 man/man7/EVP_PKEY-FFC.7 \
 man/man7/EVP_PKEY-HMAC.7 \
+man/man7/EVP_PKEY-LMS.7 \
 man/man7/EVP_PKEY-ML-DSA.7 \
 man/man7/EVP_PKEY-ML-KEM.7 \
+man/man7/EVP_PKEY-MLX-KEM.7 \
 man/man7/EVP_PKEY-RSA.7 \
 man/man7/EVP_PKEY-SLH-DSA.7 \
 man/man7/EVP_PKEY-SM2.7 \
@@ -5454,9 +5502,11 @@ man/man7/EVP_SIGNATURE-DSA.7 \
 man/man7/EVP_SIGNATURE-ECDSA.7 \
 man/man7/EVP_SIGNATURE-ED25519.7 \
 man/man7/EVP_SIGNATURE-HMAC.7 \
+man/man7/EVP_SIGNATURE-LMS.7 \
 man/man7/EVP_SIGNATURE-ML-DSA.7 \
 man/man7/EVP_SIGNATURE-RSA.7 \
 man/man7/EVP_SIGNATURE-SLH-DSA.7 \
+man/man7/EVP_SIGNATURE-SM2.7 \
 man/man7/OSSL_PROVIDER-FIPS.7 \
 man/man7/OSSL_PROVIDER-base.7 \
 man/man7/OSSL_PROVIDER-default.7 \
@@ -5487,6 +5537,7 @@ man/man7/openssl-quic-concurrency.7 \
 man/man7/openssl-quic.7 \
 man/man7/openssl-threads.7 \
 man/man7/openssl_user_macros.7 \
+man/man7/ossl-guide-dtlsv13.7 \
 man/man7/ossl-guide-introduction.7 \
 man/man7/ossl-guide-libcrypto-introduction.7 \
 man/man7/ossl-guide-libraries-introduction.7 \
@@ -5502,6 +5553,7 @@ man/man7/ossl-guide-tls-client-block.7 \
 man/man7/ossl-guide-tls-client-non-block.7 \
 man/man7/ossl-guide-tls-introduction.7 \
 man/man7/ossl-guide-tls-server-block.7 \
+man/man7/ossl-removed-api.7 \
 man/man7/ossl_store-file.7 \
 man/man7/ossl_store.7 \
 man/man7/passphrase-encoding.7 \
diff --git a/deps/openssl/openssl/doc/man1/build.info b/deps/openssl/openssl/doc/man1/build.info
index ee6f243e20b..d5e0c434471 100644
--- a/deps/openssl/openssl/doc/man1/build.info
+++ b/deps/openssl/openssl/doc/man1/build.info
@@ -8,6 +8,7 @@ DEPEND[openssl-ciphers.pod]=../perlvars.pm
 DEPEND[openssl-cmds.pod]=../perlvars.pm
 DEPEND[openssl-cmp.pod]=../perlvars.pm
 DEPEND[openssl-cms.pod]=../perlvars.pm
+DEPEND[openssl-configutl.pod]=../perlvars.pm
 DEPEND[openssl-crl2pkcs7.pod]=../perlvars.pm
 DEPEND[openssl-crl.pod]=../perlvars.pm
 DEPEND[openssl-dgst.pod]=../perlvars.pm
@@ -16,8 +17,8 @@ DEPEND[openssl-dsaparam.pod]=../perlvars.pm
 DEPEND[openssl-dsa.pod]=../perlvars.pm
 DEPEND[openssl-ecparam.pod]=../perlvars.pm
 DEPEND[openssl-ec.pod]=../perlvars.pm
+DEPEND[openssl-ech.pod]=../perlvars.pm
 DEPEND[openssl-enc.pod]=../perlvars.pm
-DEPEND[openssl-engine.pod]=../perlvars.pm
 DEPEND[openssl-errstr.pod]=../perlvars.pm
 DEPEND[openssl-fipsinstall.pod]=../perlvars.pm
 DEPEND[openssl-gendsa.pod]=../perlvars.pm
diff --git a/deps/openssl/openssl/engines/asm/e_padlock-x86.pl b/deps/openssl/openssl/engines/asm/e_padlock-x86.pl
deleted file mode 100644
index 3e9a22fca4b..00000000000
--- a/deps/openssl/openssl/engines/asm/e_padlock-x86.pl
+++ /dev/null
@@ -1,628 +0,0 @@
-#! /usr/bin/env perl
-# Copyright 2011-2023 The OpenSSL Project Authors. All Rights Reserved.
-#
-# Licensed under the Apache License 2.0 (the "License").  You may not use
-# this file except in compliance with the License.  You can obtain a copy
-# in the file LICENSE in the source distribution or at
-# https://www.openssl.org/source/license.html
-
-
-# ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
-# project. The module is, however, dual licensed under OpenSSL and
-# CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
-# ====================================================================
-
-# September 2011
-#
-# Assembler helpers for Padlock engine. Compared to original engine
-# version relying on inline assembler and compiled with gcc 3.4.6 it
-# was measured to provide ~100% improvement on misaligned data in ECB
-# mode and ~75% in CBC mode. For aligned data improvement can be
-# observed for short inputs only, e.g. 45% for 64-byte messages in
-# ECB mode, 20% in CBC. Difference in performance for aligned vs.
-# misaligned data depends on misalignment and is either ~1.8x or 2.9x.
-# These are approximately same factors as for hardware support, so
-# there is little reason to rely on the latter. On the contrary, it
-# might actually hurt performance in mixture of aligned and misaligned
-# buffers, because a) if you choose to flip 'align' flag in control
-# word on per-buffer basis, then you'd have to reload key context,
-# which incurs penalty; b) if you choose to set 'align' flag
-# permanently, it limits performance even for aligned data to ~1/2.
-# All above mentioned results were collected on 1.5GHz C7. Nano on the
-# other hand handles unaligned data more gracefully. Depending on
-# algorithm and how unaligned data is, hardware can be up to 70% more
-# efficient than below software alignment procedures, nor does 'align'
-# flag have affect on aligned performance [if has any meaning at all].
-# Therefore suggestion is to unconditionally set 'align' flag on Nano
-# for optimal performance.
-
-$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
-push(@INC,"${dir}","${dir}../../crypto/perlasm");
-require "x86asm.pl";
-
-$output=pop and open STDOUT,">$output";
-
-&asm_init($ARGV[0]);
-
-%PADLOCK_PREFETCH=(ecb=>128, cbc=>64);	# prefetch errata
-$PADLOCK_CHUNK=512;	# Must be a power of 2 larger than 16
-
-$ctx="edx";
-$out="edi";
-$inp="esi";
-$len="ecx";
-$chunk="ebx";
-
-&function_begin_B("padlock_capability");
-	&push	("ebx");
-	&pushf	();
-	&pop	("eax");
-	&mov	("ecx","eax");
-	&xor	("eax",1<<21);
-	&push	("eax");
-	&popf	();
-	&pushf	();
-	&pop	("eax");
-	&xor	("ecx","eax");
-	&xor	("eax","eax");
-	&bt	("ecx",21);
-	&jnc	(&label("noluck"));
-	&cpuid	();
-	&xor	("eax","eax");
-	&cmp	("ebx","0x".unpack("H*",'tneC'));
-	&jne	(&label("zhaoxin"));
-	&cmp	("edx","0x".unpack("H*",'Hrua'));
-	&jne	(&label("noluck"));
-	&cmp	("ecx","0x".unpack("H*",'slua'));
-	&jne	(&label("noluck"));
-	&jmp	(&label("zhaoxinEnd"));
-&set_label("zhaoxin");
-	&cmp	("ebx","0x".unpack("H*",'hS  '));
-	&jne	(&label("noluck"));
-	&cmp	("edx","0x".unpack("H*",'hgna'));
-	&jne	(&label("noluck"));
-	&cmp	("ecx","0x".unpack("H*",'  ia'));
-	&jne	(&label("noluck"));
-&set_label("zhaoxinEnd");
-	&mov	("eax",0xC0000000);
-	&cpuid	();
-	&mov	("edx","eax");
-	&xor	("eax","eax");
-	&cmp	("edx",0xC0000001);
-	&jb	(&label("noluck"));
-	&mov	("eax",1);
-	&cpuid	();
-	&or	("eax",0x0f);
-	&xor	("ebx","ebx");
-	&and	("eax",0x0fff);
-	&cmp	("eax",0x06ff);		# check for Nano
-	&sete	("bl");
-	&mov	("eax",0xC0000001);
-	&push	("ebx");
-	&cpuid	();
-	&pop	("ebx");
-	&mov	("eax","edx");
-	&shl	("ebx",4);		# bit#4 denotes Nano
-	&and	("eax",0xffffffef);
-	&or	("eax","ebx")
-&set_label("noluck");
-	&pop	("ebx");
-	&ret	();
-&function_end_B("padlock_capability")
-
-&function_begin_B("padlock_key_bswap");
-	&mov	("edx",&wparam(0));
-	&mov	("ecx",&DWP(240,"edx"));
-	&inc	("ecx");
-	&shl	("ecx",2);
-&set_label("bswap_loop");
-	&mov	("eax",&DWP(0,"edx"));
-	&bswap	("eax");
-	&mov	(&DWP(0,"edx"),"eax");
-	&lea	("edx",&DWP(4,"edx"));
-	&sub	("ecx",1);
-	&jnz	(&label("bswap_loop"));
-	&ret	();
-&function_end_B("padlock_key_bswap");
-
-# This is heuristic key context tracing. At first one
-# believes that one should use atomic swap instructions,
-# but it's not actually necessary. Point is that if
-# padlock_saved_context was changed by another thread
-# after we've read it and before we compare it with ctx,
-# our key *shall* be reloaded upon thread context switch
-# and we are therefore set in either case...
-&static_label("padlock_saved_context");
-
-&function_begin_B("padlock_verify_context");
-	&mov	($ctx,&wparam(0));
-	&lea	("eax",($::win32 or $::coff) ? &DWP(&label("padlock_saved_context")) :
-		       &DWP(&label("padlock_saved_context")."-".&label("verify_pic_point")));
-	&pushf	();
-	&call	("_padlock_verify_ctx");
-&set_label("verify_pic_point");
-	&lea	("esp",&DWP(4,"esp"));
-	&ret	();
-&function_end_B("padlock_verify_context");
-
-&function_begin_B("_padlock_verify_ctx");
-	&add	("eax",&DWP(0,"esp")) if(!($::win32 or $::coff));# &padlock_saved_context
-	&bt	(&DWP(4,"esp"),30);		# eflags
-	&jnc	(&label("verified"));
-	&cmp	($ctx,&DWP(0,"eax"));
-	&je	(&label("verified"));
-	&pushf	();
-	&popf	();
-&set_label("verified");
-	&mov	(&DWP(0,"eax"),$ctx);
-	&ret	();
-&function_end_B("_padlock_verify_ctx");
-
-&function_begin_B("padlock_reload_key");
-	&pushf	();
-	&popf	();
-	&ret	();
-&function_end_B("padlock_reload_key");
-
-&function_begin_B("padlock_aes_block");
-	&push	("edi");
-	&push	("esi");
-	&push	("ebx");
-	&mov	($out,&wparam(0));		# must be 16-byte aligned
-	&mov	($inp,&wparam(1));		# must be 16-byte aligned
-	&mov	($ctx,&wparam(2));
-	&mov	($len,1);
-	&lea	("ebx",&DWP(32,$ctx));		# key
-	&lea	($ctx,&DWP(16,$ctx));		# control word
-	&data_byte(0xf3,0x0f,0xa7,0xc8);	# rep xcryptecb
-	&pop	("ebx");
-	&pop	("esi");
-	&pop	("edi");
-	&ret	();
-&function_end_B("padlock_aes_block");
-
-sub generate_mode {
-my ($mode,$opcode) = @_;
-# int padlock_$mode_encrypt(void *out, const void *inp,
-#		struct padlock_cipher_data *ctx, size_t len);
-&function_begin("padlock_${mode}_encrypt");
-	&mov	($out,&wparam(0));
-	&mov	($inp,&wparam(1));
-	&mov	($ctx,&wparam(2));
-	&mov	($len,&wparam(3));
-	&test	($ctx,15);
-	&jnz	(&label("${mode}_abort"));
-	&test	($len,15);
-	&jnz	(&label("${mode}_abort"));
-	&lea	("eax",($::win32 or $::coff) ? &DWP(&label("padlock_saved_context")) :
-		       &DWP(&label("padlock_saved_context")."-".&label("${mode}_pic_point")));
-	&pushf	();
-	&cld	();
-	&call	("_padlock_verify_ctx");
-&set_label("${mode}_pic_point");
-	&lea	($ctx,&DWP(16,$ctx));	# control word
-	&xor	("eax","eax");
-					if ($mode eq "ctr32") {
-	&movq	("mm0",&QWP(-16,$ctx));	# load [upper part of] counter
-					} else {
-	&xor	("ebx","ebx");
-	&test	(&DWP(0,$ctx),1<<5);	# align bit in control word
-	&jnz	(&label("${mode}_aligned"));
-	&test	($out,0x0f);
-	&setz	("al");			# !out_misaligned
-	&test	($inp,0x0f);
-	&setz	("bl");			# !inp_misaligned
-	&test	("eax","ebx");
-	&jnz	(&label("${mode}_aligned"));
-	&neg	("eax");
-					}
-	&mov	($chunk,$PADLOCK_CHUNK);
-	&not	("eax");		# out_misaligned?-1:0
-	&lea	("ebp",&DWP(-24,"esp"));
-	&cmp	($len,$chunk);
-	&cmovc	($chunk,$len);		# chunk=len>PADLOCK_CHUNK?PADLOCK_CHUNK:len
-	&and	("eax",$chunk);		# out_misaligned?chunk:0
-	&mov	($chunk,$len);
-	&neg	("eax");
-	&and	($chunk,$PADLOCK_CHUNK-1);	# chunk=len%PADLOCK_CHUNK
-	&lea	("esp",&DWP(0,"eax","ebp"));	# alloca
-	&mov	("eax",$PADLOCK_CHUNK);
-	&cmovz	($chunk,"eax");			# chunk=chunk?:PADLOCK_CHUNK
-	&mov	("eax","ebp");
-	&and	("ebp",-16);
-	&and	("esp",-16);
-	&mov	(&DWP(16,"ebp"),"eax");
-    if ($PADLOCK_PREFETCH{$mode}) {
-	&cmp	($len,$chunk);
-	&ja	(&label("${mode}_loop"));
-	&mov	("eax",$inp);		# check if prefetch crosses page
-	&cmp	("ebp","esp");
-	&cmove	("eax",$out);
-	&add	("eax",$len);
-	&neg	("eax");
-	&and	("eax",0xfff);		# distance to page boundary
-	&cmp	("eax",$PADLOCK_PREFETCH{$mode});
-	&mov	("eax",-$PADLOCK_PREFETCH{$mode});
-	&cmovae	("eax",$chunk);		# mask=distance<prefetch?-prefetch:-1
-	&and	($chunk,"eax");
-	&jz	(&label("${mode}_unaligned_tail"));
-    }
-	&jmp	(&label("${mode}_loop"));
-
-&set_label("${mode}_loop",16);
-	&mov	(&DWP(0,"ebp"),$out);		# save parameters
-	&mov	(&DWP(4,"ebp"),$inp);
-	&mov	(&DWP(8,"ebp"),$len);
-	&mov	($len,$chunk);
-	&mov	(&DWP(12,"ebp"),$chunk);	# chunk
-						if ($mode eq "ctr32") {
-	&mov	("ecx",&DWP(-4,$ctx));
-	&xor	($out,$out);
-	&mov	("eax",&DWP(-8,$ctx));		# borrow $len
-&set_label("${mode}_prepare");
-	&mov	(&DWP(12,"esp",$out),"ecx");
-	&bswap	("ecx");
-	&movq	(&QWP(0,"esp",$out),"mm0");
-	&inc	("ecx");
-	&mov	(&DWP(8,"esp",$out),"eax");
-	&bswap	("ecx");
-	&lea	($out,&DWP(16,$out));
-	&cmp	($out,$chunk);
-	&jb	(&label("${mode}_prepare"));
-
-	&mov	(&DWP(-4,$ctx),"ecx");
-	&lea	($inp,&DWP(0,"esp"));
-	&lea	($out,&DWP(0,"esp"));
-	&mov	($len,$chunk);
-						} else {
-	&test	($out,0x0f);			# out_misaligned
-	&cmovnz	($out,"esp");
-	&test	($inp,0x0f);			# inp_misaligned
-	&jz	(&label("${mode}_inp_aligned"));
-	&shr	($len,2);
-	&data_byte(0xf3,0xa5);			# rep movsl
-	&sub	($out,$chunk);
-	&mov	($len,$chunk);
-	&mov	($inp,$out);
-&set_label("${mode}_inp_aligned");
-						}
-	&lea	("eax",&DWP(-16,$ctx));		# ivp
-	&lea	("ebx",&DWP(16,$ctx));		# key
-	&shr	($len,4);			# len/=AES_BLOCK_SIZE
-	&data_byte(0xf3,0x0f,0xa7,$opcode);	# rep xcrypt*
-						if ($mode !~ /ecb|ctr/) {
-	&movaps	("xmm0",&QWP(0,"eax"));
-	&movaps	(&QWP(-16,$ctx),"xmm0");	# copy [or refresh] iv
-						}
-	&mov	($out,&DWP(0,"ebp"));		# restore parameters
-	&mov	($chunk,&DWP(12,"ebp"));
-						if ($mode eq "ctr32") {
-	&mov	($inp,&DWP(4,"ebp"));
-	&xor	($len,$len);
-&set_label("${mode}_xor");
-	&movups	("xmm1",&QWP(0,$inp,$len));
-	&lea	($len,&DWP(16,$len));
-	&pxor	("xmm1",&QWP(-16,"esp",$len));
-	&movups	(&QWP(-16,$out,$len),"xmm1");
-	&cmp	($len,$chunk);
-	&jb	(&label("${mode}_xor"));
-						} else {
-	&test	($out,0x0f);
-	&jz	(&label("${mode}_out_aligned"));
-	&mov	($len,$chunk);
-	&lea	($inp,&DWP(0,"esp"));
-	&shr	($len,2);
-	&data_byte(0xf3,0xa5);			# rep movsl
-	&sub	($out,$chunk);
-&set_label("${mode}_out_aligned");
-	&mov	($inp,&DWP(4,"ebp"));
-						}
-	&mov	($len,&DWP(8,"ebp"));
-	&add	($out,$chunk);
-	&add	($inp,$chunk);
-	&sub	($len,$chunk);
-	&mov	($chunk,$PADLOCK_CHUNK);
-    if (!$PADLOCK_PREFETCH{$mode}) {
-	&jnz	(&label("${mode}_loop"));
-    } else {
-	&jz	(&label("${mode}_break"));
-	&cmp	($len,$chunk);
-	&jae	(&label("${mode}_loop"));
-
-&set_label("${mode}_unaligned_tail");
-	&xor	("eax","eax");
-	&cmp	("esp","ebp");
-	&cmove	("eax",$len);
-	&sub	("esp","eax");			# alloca
-	&mov	("eax", $out);			# save parameters
-	&mov	($chunk,$len);
-	&shr	($len,2);
-	&lea	($out,&DWP(0,"esp"));
-	&data_byte(0xf3,0xa5);			# rep movsl
-	&mov	($inp,"esp");
-	&mov	($out,"eax");			# restore parameters
-	&mov	($len,$chunk);
-	&jmp	(&label("${mode}_loop"));
-
-&set_label("${mode}_break",16);
-    }
-						if ($mode ne "ctr32") {
-	&cmp	("esp","ebp");
-	&je	(&label("${mode}_done"));
-						}
-	&pxor	("xmm0","xmm0");
-	&lea	("eax",&DWP(0,"esp"));
-&set_label("${mode}_bzero");
-	&movaps	(&QWP(0,"eax"),"xmm0");
-	&lea	("eax",&DWP(16,"eax"));
-	&cmp	("ebp","eax");
-	&ja	(&label("${mode}_bzero"));
-
-&set_label("${mode}_done");
-	&mov	("ebp",&DWP(16,"ebp"));
-	&lea	("esp",&DWP(24,"ebp"));
-						if ($mode ne "ctr32") {
-	&jmp	(&label("${mode}_exit"));
-
-&set_label("${mode}_aligned",16);
-    if ($PADLOCK_PREFETCH{$mode}) {
-	&lea	("ebp",&DWP(0,$inp,$len));
-	&neg	("ebp");
-	&and	("ebp",0xfff);			# distance to page boundary
-	&xor	("eax","eax");
-	&cmp	("ebp",$PADLOCK_PREFETCH{$mode});
-	&mov	("ebp",$PADLOCK_PREFETCH{$mode}-1);
-	&cmovae	("ebp","eax");
-	&and	("ebp",$len);			# remainder
-	&sub	($len,"ebp");
-	&jz	(&label("${mode}_aligned_tail"));
-    }
-	&lea	("eax",&DWP(-16,$ctx));		# ivp
-	&lea	("ebx",&DWP(16,$ctx));		# key
-	&shr	($len,4);			# len/=AES_BLOCK_SIZE
-	&data_byte(0xf3,0x0f,0xa7,$opcode);	# rep xcrypt*
-						if ($mode ne "ecb") {
-	&movaps	("xmm0",&QWP(0,"eax"));
-	&movaps	(&QWP(-16,$ctx),"xmm0");	# copy [or refresh] iv
-						}
-    if ($PADLOCK_PREFETCH{$mode}) {
-	&test	("ebp","ebp");
-	&jz	(&label("${mode}_exit"));
-
-&set_label("${mode}_aligned_tail");
-	&mov	($len,"ebp");
-	&lea	("ebp",&DWP(-24,"esp"));
-	&mov	("esp","ebp");
-	&mov	("eax","ebp");
-	&sub	("esp",$len);
-	&and	("ebp",-16);
-	&and	("esp",-16);
-	&mov	(&DWP(16,"ebp"),"eax");
-	&mov	("eax", $out);			# save parameters
-	&mov	($chunk,$len);
-	&shr	($len,2);
-	&lea	($out,&DWP(0,"esp"));
-	&data_byte(0xf3,0xa5);			# rep movsl
-	&mov	($inp,"esp");
-	&mov	($out,"eax");			# restore parameters
-	&mov	($len,$chunk);
-	&jmp	(&label("${mode}_loop"));
-    }
-&set_label("${mode}_exit");			}
-	&mov	("eax",1);
-	&lea	("esp",&DWP(4,"esp"));		# popf
-	&emms	()				if ($mode eq "ctr32");
-&set_label("${mode}_abort");
-&function_end("padlock_${mode}_encrypt");
-}
-
-&generate_mode("ecb",0xc8);
-&generate_mode("cbc",0xd0);
-&generate_mode("cfb",0xe0);
-&generate_mode("ofb",0xe8);
-&generate_mode("ctr32",0xc8);	# yes, it implements own CTR with ECB opcode,
-				# because hardware CTR was introduced later
-				# and even has errata on certain C7 stepping.
-				# own implementation *always* works, though
-				# ~15% slower than dedicated hardware...
-
-&function_begin_B("padlock_xstore");
-	&push	("edi");
-	&mov	("edi",&wparam(0));
-	&mov	("edx",&wparam(1));
-	&data_byte(0x0f,0xa7,0xc0);		# xstore
-	&pop	("edi");
-	&ret	();
-&function_end_B("padlock_xstore");
-
-&function_begin_B("_win32_segv_handler");
-	&mov	("eax",1);			# ExceptionContinueSearch
-	&mov	("edx",&wparam(0));		# *ExceptionRecord
-	&mov	("ecx",&wparam(2));		# *ContextRecord
-	&cmp	(&DWP(0,"edx"),0xC0000005)	# ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION
-	&jne	(&label("ret"));
-	&add	(&DWP(184,"ecx"),4);		# skip over rep sha*
-	&mov	("eax",0);			# ExceptionContinueExecution
-&set_label("ret");
-	&ret	();
-&function_end_B("_win32_segv_handler");
-&safeseh("_win32_segv_handler")			if ($::win32);
-
-&function_begin_B("padlock_sha1_oneshot");
-	&push	("edi");
-	&push	("esi");
-	&xor	("eax","eax");
-	&mov	("edi",&wparam(0));
-	&mov	("esi",&wparam(1));
-	&mov	("ecx",&wparam(2));
-    if ($::win32 or $::coff) {
-    	&push	(&::islabel("_win32_segv_handler"));
-	&data_byte(0x64,0xff,0x30);		# push	%fs:(%eax)
-	&data_byte(0x64,0x89,0x20);		# mov	%esp,%fs:(%eax)
-    }
-	&mov	("edx","esp");			# put aside %esp
-	&add	("esp",-128);			# 32 is enough but spec says 128
-	&movups	("xmm0",&QWP(0,"edi"));		# copy-in context
-	&and	("esp",-16);
-	&mov	("eax",&DWP(16,"edi"));
-	&movaps	(&QWP(0,"esp"),"xmm0");
-	&mov	("edi","esp");
-	&mov	(&DWP(16,"esp"),"eax");
-	&xor	("eax","eax");
-	&data_byte(0xf3,0x0f,0xa6,0xc8);	# rep xsha1
-	&movaps	("xmm0",&QWP(0,"esp"));
-	&mov	("eax",&DWP(16,"esp"));
-	&mov	("esp","edx");			# restore %esp
-    if ($::win32 or $::coff) {
-	&data_byte(0x64,0x8f,0x05,0,0,0,0);	# pop	%fs:0
-	&lea	("esp",&DWP(4,"esp"));
-    }
-	&mov	("edi",&wparam(0));
-	&movups	(&QWP(0,"edi"),"xmm0");		# copy-out context
-	&mov	(&DWP(16,"edi"),"eax");
-	&pop	("esi");
-	&pop	("edi");
-	&ret	();
-&function_end_B("padlock_sha1_oneshot");
-
-&function_begin_B("padlock_sha1_blocks");
-	&push	("edi");
-	&push	("esi");
-	&mov	("edi",&wparam(0));
-	&mov	("esi",&wparam(1));
-	&mov	("edx","esp");			# put aside %esp
-	&mov	("ecx",&wparam(2));
-	&add	("esp",-128);
-	&movups	("xmm0",&QWP(0,"edi"));		# copy-in context
-	&and	("esp",-16);
-	&mov	("eax",&DWP(16,"edi"));
-	&movaps	(&QWP(0,"esp"),"xmm0");
-	&mov	("edi","esp");
-	&mov	(&DWP(16,"esp"),"eax");
-	&mov	("eax",-1);
-	&data_byte(0xf3,0x0f,0xa6,0xc8);	# rep xsha1
-	&movaps	("xmm0",&QWP(0,"esp"));
-	&mov	("eax",&DWP(16,"esp"));
-	&mov	("esp","edx");			# restore %esp
-	&mov	("edi",&wparam(0));
-	&movups	(&QWP(0,"edi"),"xmm0");		# copy-out context
-	&mov	(&DWP(16,"edi"),"eax");
- 	&pop	("esi");
-	&pop	("edi");
-	&ret	();
-&function_end_B("padlock_sha1_blocks");
-
-&function_begin_B("padlock_sha256_oneshot");
-	&push	("edi");
-	&push	("esi");
-	&xor	("eax","eax");
-	&mov	("edi",&wparam(0));
-	&mov	("esi",&wparam(1));
-	&mov	("ecx",&wparam(2));
-    if ($::win32 or $::coff) {
-    	&push	(&::islabel("_win32_segv_handler"));
-	&data_byte(0x64,0xff,0x30);		# push	%fs:(%eax)
-	&data_byte(0x64,0x89,0x20);		# mov	%esp,%fs:(%eax)
-    }
-	&mov	("edx","esp");			# put aside %esp
-	&add	("esp",-128);
-	&movups	("xmm0",&QWP(0,"edi"));		# copy-in context
-	&and	("esp",-16);
-	&movups	("xmm1",&QWP(16,"edi"));
-	&movaps	(&QWP(0,"esp"),"xmm0");
-	&mov	("edi","esp");
-	&movaps	(&QWP(16,"esp"),"xmm1");
-	&xor	("eax","eax");
-	&data_byte(0xf3,0x0f,0xa6,0xd0);	# rep xsha256
-	&movaps	("xmm0",&QWP(0,"esp"));
-	&movaps	("xmm1",&QWP(16,"esp"));
-	&mov	("esp","edx");			# restore %esp
-    if ($::win32 or $::coff) {
-	&data_byte(0x64,0x8f,0x05,0,0,0,0);	# pop	%fs:0
-	&lea	("esp",&DWP(4,"esp"));
-    }
-	&mov	("edi",&wparam(0));
-	&movups	(&QWP(0,"edi"),"xmm0");		# copy-out context
-	&movups	(&QWP(16,"edi"),"xmm1");
-	&pop	("esi");
-	&pop	("edi");
-	&ret	();
-&function_end_B("padlock_sha256_oneshot");
-
-&function_begin_B("padlock_sha256_blocks");
-	&push	("edi");
-	&push	("esi");
-	&mov	("edi",&wparam(0));
-	&mov	("esi",&wparam(1));
-	&mov	("ecx",&wparam(2));
-	&mov	("edx","esp");			# put aside %esp
-	&add	("esp",-128);
-	&movups	("xmm0",&QWP(0,"edi"));		# copy-in context
-	&and	("esp",-16);
-	&movups	("xmm1",&QWP(16,"edi"));
-	&movaps	(&QWP(0,"esp"),"xmm0");
-	&mov	("edi","esp");
-	&movaps	(&QWP(16,"esp"),"xmm1");
-	&mov	("eax",-1);
-	&data_byte(0xf3,0x0f,0xa6,0xd0);	# rep xsha256
-	&movaps	("xmm0",&QWP(0,"esp"));
-	&movaps	("xmm1",&QWP(16,"esp"));
-	&mov	("esp","edx");			# restore %esp
-	&mov	("edi",&wparam(0));
-	&movups	(&QWP(0,"edi"),"xmm0");		# copy-out context
-	&movups	(&QWP(16,"edi"),"xmm1");
-	&pop	("esi");
-	&pop	("edi");
-	&ret	();
-&function_end_B("padlock_sha256_blocks");
-
-&function_begin_B("padlock_sha512_blocks");
-	&push	("edi");
-	&push	("esi");
-	&mov	("edi",&wparam(0));
-	&mov	("esi",&wparam(1));
-	&mov	("ecx",&wparam(2));
-	&mov	("edx","esp");			# put aside %esp
-	&add	("esp",-128);
-	&movups	("xmm0",&QWP(0,"edi"));		# copy-in context
-	&and	("esp",-16);
-	&movups	("xmm1",&QWP(16,"edi"));
-	&movups	("xmm2",&QWP(32,"edi"));
-	&movups	("xmm3",&QWP(48,"edi"));
-	&movaps	(&QWP(0,"esp"),"xmm0");
-	&mov	("edi","esp");
-	&movaps	(&QWP(16,"esp"),"xmm1");
-	&movaps	(&QWP(32,"esp"),"xmm2");
-	&movaps	(&QWP(48,"esp"),"xmm3");
-	&data_byte(0xf3,0x0f,0xa6,0xe0);	# rep xsha512
-	&movaps	("xmm0",&QWP(0,"esp"));
-	&movaps	("xmm1",&QWP(16,"esp"));
-	&movaps	("xmm2",&QWP(32,"esp"));
-	&movaps	("xmm3",&QWP(48,"esp"));
-	&mov	("esp","edx");			# restore %esp
-	&mov	("edi",&wparam(0));
-	&movups	(&QWP(0,"edi"),"xmm0");		# copy-out context
-	&movups	(&QWP(16,"edi"),"xmm1");
-	&movups	(&QWP(32,"edi"),"xmm2");
-	&movups	(&QWP(48,"edi"),"xmm3");
-	&pop	("esi");
-	&pop	("edi");
-	&ret	();
-&function_end_B("padlock_sha512_blocks");
-
-&asciz	("VIA Padlock x86 module, CRYPTOGAMS by <appro\@openssl.org>");
-&align	(16);
-
-&dataseg();
-# Essentially this variable belongs in thread local storage.
-# Having this variable global on the other hand can only cause
-# few bogus key reloads [if any at all on signle-CPU system],
-# so we accept the penalty...
-&set_label("padlock_saved_context",4);
-&data_word(0);
-
-&asm_finish();
-
-close STDOUT;
diff --git a/deps/openssl/openssl/engines/asm/e_padlock-x86_64.pl b/deps/openssl/openssl/engines/asm/e_padlock-x86_64.pl
deleted file mode 100644
index b147868851d..00000000000
--- a/deps/openssl/openssl/engines/asm/e_padlock-x86_64.pl
+++ /dev/null
@@ -1,587 +0,0 @@
-#! /usr/bin/env perl
-# Copyright 2011-2023 The OpenSSL Project Authors. All Rights Reserved.
-#
-# Licensed under the Apache License 2.0 (the "License").  You may not use
-# this file except in compliance with the License.  You can obtain a copy
-# in the file LICENSE in the source distribution or at
-# https://www.openssl.org/source/license.html
-
-
-# ====================================================================
-# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
-# project. The module is, however, dual licensed under OpenSSL and
-# CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
-# ====================================================================
-
-# September 2011
-#
-# Assembler helpers for Padlock engine. See even e_padlock-x86.pl for
-# details.
-
-# $output is the last argument if it looks like a file (it has an extension)
-# $flavour is the first argument if it doesn't look like a file
-$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
-$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
-
-$win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/);
-
-$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
-( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or
-( $xlate="${dir}../../crypto/perlasm/x86_64-xlate.pl" and -f $xlate) or
-die "can't locate x86_64-xlate.pl";
-
-open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
-     or die "can't call $xlate: $!";
-*STDOUT=*OUT;
-
-$code=".text\n";
-
-%PADLOCK_PREFETCH=(ecb=>128, cbc=>64, ctr32=>32);	# prefetch errata
-$PADLOCK_CHUNK=512;	# Must be a power of 2 between 32 and 2^20
-
-$ctx="%rdx";
-$out="%rdi";
-$inp="%rsi";
-$len="%rcx";
-$chunk="%rbx";
-
-($arg1,$arg2,$arg3,$arg4)=$win64?("%rcx","%rdx","%r8", "%r9") : # Win64 order
-                                 ("%rdi","%rsi","%rdx","%rcx"); # Unix order
-
-$code.=<<___;
-.globl	padlock_capability
-.type	padlock_capability,\@abi-omnipotent
-.align	16
-padlock_capability:
-	mov	%rbx,%r8
-	xor	%eax,%eax
-	cpuid
-	xor	%eax,%eax
-	cmp	\$`"0x".unpack("H*",'tneC')`,%ebx
-	jne	.Lzhaoxin
-	cmp	\$`"0x".unpack("H*",'Hrua')`,%edx
-	jne	.Lnoluck
-	cmp	\$`"0x".unpack("H*",'slua')`,%ecx
-	jne	.Lnoluck
-	jmp	.LzhaoxinEnd
-.Lzhaoxin:
-	cmp	\$`"0x".unpack("H*",'hS  ')`,%ebx
-	jne	.Lnoluck
-	cmp	\$`"0x".unpack("H*",'hgna')`,%edx
-	jne	.Lnoluck
-	cmp	\$`"0x".unpack("H*",'  ia')`,%ecx
-	jne	.Lnoluck
-.LzhaoxinEnd:
-	mov	\$0xC0000000,%eax
-	cpuid
-	mov	%eax,%edx
-	xor	%eax,%eax
-	cmp	\$0xC0000001,%edx
-	jb	.Lnoluck
-	mov	\$0xC0000001,%eax
-	cpuid
-	mov	%edx,%eax
-	and	\$0xffffffef,%eax
-	or	\$0x10,%eax		# set Nano bit#4
-.Lnoluck:
-	mov	%r8,%rbx
-	ret
-.size	padlock_capability,.-padlock_capability
-
-.globl	padlock_key_bswap
-.type	padlock_key_bswap,\@abi-omnipotent,0
-.align	16
-padlock_key_bswap:
-	mov	240($arg1),%edx
-	inc	%edx
-	shl	\$2,%edx
-.Lbswap_loop:
-	mov	($arg1),%eax
-	bswap	%eax
-	mov	%eax,($arg1)
-	lea	4($arg1),$arg1
-	sub	\$1,%edx
-	jnz	.Lbswap_loop
-	ret
-.size	padlock_key_bswap,.-padlock_key_bswap
-
-.globl	padlock_verify_context
-.type	padlock_verify_context,\@abi-omnipotent
-.align	16
-padlock_verify_context:
-	mov	$arg1,$ctx
-	pushf
-	lea	.Lpadlock_saved_context(%rip),%rax
-	call	_padlock_verify_ctx
-	lea	8(%rsp),%rsp
-	ret
-.size	padlock_verify_context,.-padlock_verify_context
-
-.type	_padlock_verify_ctx,\@abi-omnipotent
-.align	16
-_padlock_verify_ctx:
-	mov	8(%rsp),%r8
-	bt	\$30,%r8
-	jnc	.Lverified
-	cmp	(%rax),$ctx
-	je	.Lverified
-	pushf
-	popf
-.Lverified:
-	mov	$ctx,(%rax)
-	ret
-.size	_padlock_verify_ctx,.-_padlock_verify_ctx
-
-.globl	padlock_reload_key
-.type	padlock_reload_key,\@abi-omnipotent
-.align	16
-padlock_reload_key:
-	pushf
-	popf
-	ret
-.size	padlock_reload_key,.-padlock_reload_key
-
-.globl	padlock_aes_block
-.type	padlock_aes_block,\@function,3
-.align	16
-padlock_aes_block:
-	mov	%rbx,%r8
-	mov	\$1,$len
-	lea	32($ctx),%rbx		# key
-	lea	16($ctx),$ctx		# control word
-	.byte	0xf3,0x0f,0xa7,0xc8	# rep xcryptecb
-	mov	%r8,%rbx
-	ret
-.size	padlock_aes_block,.-padlock_aes_block
-
-.globl	padlock_xstore
-.type	padlock_xstore,\@function,2
-.align	16
-padlock_xstore:
-	mov	%esi,%edx
-	.byte	0x0f,0xa7,0xc0		# xstore
-	ret
-.size	padlock_xstore,.-padlock_xstore
-
-.globl	padlock_sha1_oneshot
-.type	padlock_sha1_oneshot,\@function,3
-.align	16
-padlock_sha1_oneshot:
-	mov	%rdx,%rcx
-	mov	%rdi,%rdx		# put aside %rdi
-	movups	(%rdi),%xmm0		# copy-in context
-	sub	\$128+8,%rsp
-	mov	16(%rdi),%eax
-	movaps	%xmm0,(%rsp)
-	mov	%rsp,%rdi
-	mov	%eax,16(%rsp)
-	xor	%rax,%rax
-	.byte	0xf3,0x0f,0xa6,0xc8	# rep xsha1
-	movaps	(%rsp),%xmm0
-	mov	16(%rsp),%eax
-	add	\$128+8,%rsp
-	movups	%xmm0,(%rdx)		# copy-out context
-	mov	%eax,16(%rdx)
-	ret
-.size	padlock_sha1_oneshot,.-padlock_sha1_oneshot
-
-.globl	padlock_sha1_blocks
-.type	padlock_sha1_blocks,\@function,3
-.align	16
-padlock_sha1_blocks:
-	mov	%rdx,%rcx
-	mov	%rdi,%rdx		# put aside %rdi
-	movups	(%rdi),%xmm0		# copy-in context
-	sub	\$128+8,%rsp
-	mov	16(%rdi),%eax
-	movaps	%xmm0,(%rsp)
-	mov	%rsp,%rdi
-	mov	%eax,16(%rsp)
-	mov	\$-1,%rax
-	.byte	0xf3,0x0f,0xa6,0xc8	# rep xsha1
-	movaps	(%rsp),%xmm0
-	mov	16(%rsp),%eax
-	add	\$128+8,%rsp
-	movups	%xmm0,(%rdx)		# copy-out context
-	mov	%eax,16(%rdx)
-	ret
-.size	padlock_sha1_blocks,.-padlock_sha1_blocks
-
-.globl	padlock_sha256_oneshot
-.type	padlock_sha256_oneshot,\@function,3
-.align	16
-padlock_sha256_oneshot:
-	mov	%rdx,%rcx
-	mov	%rdi,%rdx		# put aside %rdi
-	movups	(%rdi),%xmm0		# copy-in context
-	sub	\$128+8,%rsp
-	movups	16(%rdi),%xmm1
-	movaps	%xmm0,(%rsp)
-	mov	%rsp,%rdi
-	movaps	%xmm1,16(%rsp)
-	xor	%rax,%rax
-	.byte	0xf3,0x0f,0xa6,0xd0	# rep xsha256
-	movaps	(%rsp),%xmm0
-	movaps	16(%rsp),%xmm1
-	add	\$128+8,%rsp
-	movups	%xmm0,(%rdx)		# copy-out context
-	movups	%xmm1,16(%rdx)
-	ret
-.size	padlock_sha256_oneshot,.-padlock_sha256_oneshot
-
-.globl	padlock_sha256_blocks
-.type	padlock_sha256_blocks,\@function,3
-.align	16
-padlock_sha256_blocks:
-	mov	%rdx,%rcx
-	mov	%rdi,%rdx		# put aside %rdi
-	movups	(%rdi),%xmm0		# copy-in context
-	sub	\$128+8,%rsp
-	movups	16(%rdi),%xmm1
-	movaps	%xmm0,(%rsp)
-	mov	%rsp,%rdi
-	movaps	%xmm1,16(%rsp)
-	mov	\$-1,%rax
-	.byte	0xf3,0x0f,0xa6,0xd0	# rep xsha256
-	movaps	(%rsp),%xmm0
-	movaps	16(%rsp),%xmm1
-	add	\$128+8,%rsp
-	movups	%xmm0,(%rdx)		# copy-out context
-	movups	%xmm1,16(%rdx)
-	ret
-.size	padlock_sha256_blocks,.-padlock_sha256_blocks
-
-.globl	padlock_sha512_blocks
-.type	padlock_sha512_blocks,\@function,3
-.align	16
-padlock_sha512_blocks:
-	mov	%rdx,%rcx
-	mov	%rdi,%rdx		# put aside %rdi
-	movups	(%rdi),%xmm0		# copy-in context
-	sub	\$128+8,%rsp
-	movups	16(%rdi),%xmm1
-	movups	32(%rdi),%xmm2
-	movups	48(%rdi),%xmm3
-	movaps	%xmm0,(%rsp)
-	mov	%rsp,%rdi
-	movaps	%xmm1,16(%rsp)
-	movaps	%xmm2,32(%rsp)
-	movaps	%xmm3,48(%rsp)
-	.byte	0xf3,0x0f,0xa6,0xe0	# rep xha512
-	movaps	(%rsp),%xmm0
-	movaps	16(%rsp),%xmm1
-	movaps	32(%rsp),%xmm2
-	movaps	48(%rsp),%xmm3
-	add	\$128+8,%rsp
-	movups	%xmm0,(%rdx)		# copy-out context
-	movups	%xmm1,16(%rdx)
-	movups	%xmm2,32(%rdx)
-	movups	%xmm3,48(%rdx)
-	ret
-.size	padlock_sha512_blocks,.-padlock_sha512_blocks
-___
-
-sub generate_mode {
-my ($mode,$opcode) = @_;
-# int padlock_$mode_encrypt(void *out, const void *inp,
-#		struct padlock_cipher_data *ctx, size_t len);
-$code.=<<___;
-.globl	padlock_${mode}_encrypt
-.type	padlock_${mode}_encrypt,\@function,4
-.align	16
-padlock_${mode}_encrypt:
-	push	%rbp
-	push	%rbx
-
-	xor	%eax,%eax
-	test	\$15,$ctx
-	jnz	.L${mode}_abort
-	test	\$15,$len
-	jnz	.L${mode}_abort
-	lea	.Lpadlock_saved_context(%rip),%rax
-	pushf
-	cld
-	call	_padlock_verify_ctx
-	lea	16($ctx),$ctx		# control word
-	xor	%eax,%eax
-	xor	%ebx,%ebx
-	testl	\$`1<<5`,($ctx)		# align bit in control word
-	jnz	.L${mode}_aligned
-	test	\$0x0f,$out
-	setz	%al			# !out_misaligned
-	test	\$0x0f,$inp
-	setz	%bl			# !inp_misaligned
-	test	%ebx,%eax
-	jnz	.L${mode}_aligned
-	neg	%rax
-	mov	\$$PADLOCK_CHUNK,$chunk
-	not	%rax			# out_misaligned?-1:0
-	lea	(%rsp),%rbp
-	cmp	$chunk,$len
-	cmovc	$len,$chunk		# chunk=len>PADLOCK_CHUNK?PADLOCK_CHUNK:len
-	and	$chunk,%rax		# out_misaligned?chunk:0
-	mov	$len,$chunk
-	neg	%rax
-	and	\$$PADLOCK_CHUNK-1,$chunk	# chunk%=PADLOCK_CHUNK
-	lea	(%rax,%rbp),%rsp
-	mov	\$$PADLOCK_CHUNK,%rax
-	cmovz	%rax,$chunk			# chunk=chunk?:PADLOCK_CHUNK
-___
-$code.=<<___				if ($mode eq "ctr32");
-.L${mode}_reenter:
-	mov	-4($ctx),%eax		# pull 32-bit counter
-	bswap	%eax
-	neg	%eax
-	and	\$`$PADLOCK_CHUNK/16-1`,%eax
-	mov	\$$PADLOCK_CHUNK,$chunk
-	shl	\$4,%eax
-	cmovz	$chunk,%rax
-	cmp	%rax,$len
-	cmova	%rax,$chunk		# don't let counter cross PADLOCK_CHUNK
-	cmovbe	$len,$chunk
-___
-$code.=<<___				if ($PADLOCK_PREFETCH{$mode});
-	cmp	$chunk,$len
-	ja	.L${mode}_loop
-	mov	$inp,%rax		# check if prefetch crosses page
-	cmp	%rsp,%rbp
-	cmove	$out,%rax
-	add	$len,%rax
-	neg	%rax
-	and	\$0xfff,%rax		# distance to page boundary
-	cmp	\$$PADLOCK_PREFETCH{$mode},%rax
-	mov	\$-$PADLOCK_PREFETCH{$mode},%rax
-	cmovae	$chunk,%rax		# mask=distance<prefetch?-prefetch:-1
-	and	%rax,$chunk
-	jz	.L${mode}_unaligned_tail
-___
-$code.=<<___;
-	jmp	.L${mode}_loop
-.align	16
-.L${mode}_loop:
-	cmp	$len,$chunk		# ctr32 artefact
-	cmova	$len,$chunk		# ctr32 artefact
-	mov	$out,%r8		# save parameters
-	mov	$inp,%r9
-	mov	$len,%r10
-	mov	$chunk,$len
-	mov	$chunk,%r11
-	test	\$0x0f,$out		# out_misaligned
-	cmovnz	%rsp,$out
-	test	\$0x0f,$inp		# inp_misaligned
-	jz	.L${mode}_inp_aligned
-	shr	\$3,$len
-	.byte	0xf3,0x48,0xa5		# rep movsq
-	sub	$chunk,$out
-	mov	$chunk,$len
-	mov	$out,$inp
-.L${mode}_inp_aligned:
-	lea	-16($ctx),%rax		# ivp
-	lea	16($ctx),%rbx		# key
-	shr	\$4,$len
-	.byte	0xf3,0x0f,0xa7,$opcode	# rep xcrypt*
-___
-$code.=<<___				if ($mode !~ /ecb|ctr/);
-	movdqa	(%rax),%xmm0
-	movdqa	%xmm0,-16($ctx)		# copy [or refresh] iv
-___
-$code.=<<___				if ($mode eq "ctr32");
-	mov	-4($ctx),%eax		# pull 32-bit counter
-	test	\$0xffff0000,%eax
-	jnz	.L${mode}_no_carry
-	bswap	%eax
-	add	\$0x10000,%eax
-	bswap	%eax
-	mov	%eax,-4($ctx)
-.L${mode}_no_carry:
-___
-$code.=<<___;
-	mov	%r8,$out		# restore parameters
-	mov	%r11,$chunk
-	test	\$0x0f,$out
-	jz	.L${mode}_out_aligned
-	mov	$chunk,$len
-	lea	(%rsp),$inp
-	shr	\$3,$len
-	.byte	0xf3,0x48,0xa5		# rep movsq
-	sub	$chunk,$out
-.L${mode}_out_aligned:
-	mov	%r9,$inp
-	mov	%r10,$len
-	add	$chunk,$out
-	add	$chunk,$inp
-	sub	$chunk,$len
-	mov	\$$PADLOCK_CHUNK,$chunk
-___
-					if (!$PADLOCK_PREFETCH{$mode}) {
-$code.=<<___;
-	jnz	.L${mode}_loop
-___
-					} else {
-$code.=<<___;
-	jz	.L${mode}_break
-	cmp	$chunk,$len
-	jae	.L${mode}_loop
-___
-$code.=<<___				if ($mode eq "ctr32");
-	mov	$len,$chunk
-	mov	$inp,%rax		# check if prefetch crosses page
-	cmp	%rsp,%rbp
-	cmove	$out,%rax
-	add	$len,%rax
-	neg	%rax
-	and	\$0xfff,%rax		# distance to page boundary
-	cmp	\$$PADLOCK_PREFETCH{$mode},%rax
-	mov	\$-$PADLOCK_PREFETCH{$mode},%rax
-	cmovae	$chunk,%rax
-	and	%rax,$chunk
-	jnz	.L${mode}_loop
-___
-$code.=<<___;
-.L${mode}_unaligned_tail:
-	xor	%eax,%eax
-	cmp	%rsp,%rbp
-	cmove	$len,%rax
-	mov	$out,%r8		# save parameters
-	mov	$len,$chunk
-	sub	%rax,%rsp		# alloca
-	shr	\$3,$len
-	lea	(%rsp),$out
-	.byte	0xf3,0x48,0xa5		# rep movsq
-	mov	%rsp,$inp
-	mov	%r8, $out		# restore parameters
-	mov	$chunk,$len
-	jmp	.L${mode}_loop
-.align	16
-.L${mode}_break:
-___
-					}
-$code.=<<___;
-	cmp	%rbp,%rsp
-	je	.L${mode}_done
-
-	pxor	%xmm0,%xmm0
-	lea	(%rsp),%rax
-.L${mode}_bzero:
-	movaps	%xmm0,(%rax)
-	lea	16(%rax),%rax
-	cmp	%rax,%rbp
-	ja	.L${mode}_bzero
-
-.L${mode}_done:
-	lea	(%rbp),%rsp
-	jmp	.L${mode}_exit
-
-.align	16
-.L${mode}_aligned:
-___
-$code.=<<___				if ($mode eq "ctr32");
-	mov	-4($ctx),%eax		# pull 32-bit counter
-	bswap	%eax
-	neg	%eax
-	and	\$0xffff,%eax
-	mov	\$`16*0x10000`,$chunk
-	shl	\$4,%eax
-	cmovz	$chunk,%rax
-	cmp	%rax,$len
-	cmova	%rax,$chunk		# don't let counter cross 2^16
-	cmovbe	$len,$chunk
-	jbe	.L${mode}_aligned_skip
-
-.L${mode}_aligned_loop:
-	mov	$len,%r10		# save parameters
-	mov	$chunk,$len
-	mov	$chunk,%r11
-
-	lea	-16($ctx),%rax		# ivp
-	lea	16($ctx),%rbx		# key
-	shr	\$4,$len		# len/=AES_BLOCK_SIZE
-	.byte	0xf3,0x0f,0xa7,$opcode	# rep xcrypt*
-
-	mov	-4($ctx),%eax		# pull 32-bit counter
-	bswap	%eax
-	add	\$0x10000,%eax
-	bswap	%eax
-	mov	%eax,-4($ctx)
-
-	mov	%r10,$len		# restore parameters
-	sub	%r11,$len
-	mov	\$`16*0x10000`,$chunk
-	jz	.L${mode}_exit
-	cmp	$chunk,$len
-	jae	.L${mode}_aligned_loop
-
-.L${mode}_aligned_skip:
-___
-$code.=<<___				if ($PADLOCK_PREFETCH{$mode});
-	lea	($inp,$len),%rbp
-	neg	%rbp
-	and	\$0xfff,%rbp		# distance to page boundary
-	xor	%eax,%eax
-	cmp	\$$PADLOCK_PREFETCH{$mode},%rbp
-	mov	\$$PADLOCK_PREFETCH{$mode}-1,%rbp
-	cmovae	%rax,%rbp
-	and	$len,%rbp		# remainder
-	sub	%rbp,$len
-	jz	.L${mode}_aligned_tail
-___
-$code.=<<___;
-	lea	-16($ctx),%rax		# ivp
-	lea	16($ctx),%rbx		# key
-	shr	\$4,$len		# len/=AES_BLOCK_SIZE
-	.byte	0xf3,0x0f,0xa7,$opcode	# rep xcrypt*
-___
-$code.=<<___				if ($mode !~ /ecb|ctr/);
-	movdqa	(%rax),%xmm0
-	movdqa	%xmm0,-16($ctx)		# copy [or refresh] iv
-___
-$code.=<<___				if ($PADLOCK_PREFETCH{$mode});
-	test	%rbp,%rbp		# check remainder
-	jz	.L${mode}_exit
-
-.L${mode}_aligned_tail:
-	mov	$out,%r8
-	mov	%rbp,$chunk
-	mov	%rbp,$len
-	lea	(%rsp),%rbp
-	sub	$len,%rsp
-	shr	\$3,$len
-	lea	(%rsp),$out
-	.byte	0xf3,0x48,0xa5		# rep movsq
-	lea	(%r8),$out
-	lea	(%rsp),$inp
-	mov	$chunk,$len
-	jmp	.L${mode}_loop
-___
-$code.=<<___;
-.L${mode}_exit:
-	mov	\$1,%eax
-	lea	8(%rsp),%rsp
-.L${mode}_abort:
-	pop	%rbx
-	pop	%rbp
-	ret
-.size	padlock_${mode}_encrypt,.-padlock_${mode}_encrypt
-___
-}
-
-&generate_mode("ecb",0xc8);
-&generate_mode("cbc",0xd0);
-&generate_mode("cfb",0xe0);
-&generate_mode("ofb",0xe8);
-&generate_mode("ctr32",0xd8);	# all 64-bit CPUs have working CTR...
-
-$code.=<<___;
-.asciz	"VIA Padlock x86_64 module, CRYPTOGAMS by <appro\@openssl.org>"
-.align	16
-.data
-.align	8
-.Lpadlock_saved_context:
-	.quad	0
-___
-$code =~ s/\`([^\`]*)\`/eval($1)/gem;
-
-print $code;
-
-close STDOUT;
diff --git a/deps/openssl/openssl/engines/build.info b/deps/openssl/openssl/engines/build.info
deleted file mode 100644
index 19e3eab0c18..00000000000
--- a/deps/openssl/openssl/engines/build.info
+++ /dev/null
@@ -1,103 +0,0 @@
-IF[{- !$disabled{"engine"} -}]
-  $PADLOCKASM=
-  IF[{- !$disabled{asm} -}]
-    $PADLOCKASM_x86=e_padlock-x86.S
-    $PADLOCKASM_x86_64=e_padlock-x86_64.s
-
-    # Now that we have defined all the arch specific variables, use the
-    # appropriate one, and define the appropriate macros
-    IF[$PADLOCKASM_{- $target{asm_arch} -}]
-      $PADLOCKASM=$PADLOCKASM_{- $target{asm_arch} -}
-      $PADLOCKDEF=PADLOCK_ASM
-    ENDIF
-  ENDIF
-
-  IF[{- $disabled{"dynamic-engine"} -}]
-    LIBS=../libcrypto
-    IF[{- !$disabled{padlockeng} -}]
-      SOURCE[../libcrypto]=e_padlock.c $PADLOCKASM
-      DEFINE[../libcrypto]=$PADLOCKDEF
-    ENDIF
-    IF[{- !$disabled{capieng} -}]
-      SOURCE[../libcrypto]=e_capi.c
-    ENDIF
-    IF[{- !$disabled{afalgeng} -}]
-      SOURCE[../libcrypto]=e_afalg.c
-    ENDIF
-    IF[{- !$disabled{"devcryptoeng"} -}]
-      SOURCE[../libcrypto]=e_devcrypto.c
-    ENDIF
-  ELSE
-    IF[{- !$disabled{padlockeng} -}]
-      MODULES{engine}=padlock
-      SOURCE[padlock]=e_padlock.c $PADLOCKASM
-      DEFINE[padlock]=$PADLOCKDEF
-      DEPEND[padlock]=../libcrypto
-      INCLUDE[padlock]=../include
-      IF[{- defined $target{shared_defflag} -}]
-        SOURCE[padlock]=padlock.ld
-        GENERATE[padlock.ld]=../util/engines.num
-      ENDIF
-    ENDIF
-    IF[{- !$disabled{capieng} -}]
-      MODULES{engine}=capi
-      SOURCE[capi]=e_capi.c
-      DEPEND[capi]=../libcrypto
-      INCLUDE[capi]=../include
-      IF[{- defined $target{shared_defflag} -}]
-        SOURCE[capi]=capi.ld
-        GENERATE[capi.ld]=../util/engines.num
-      ENDIF
-    ENDIF
-    IF[{- !$disabled{afalgeng} -}]
-      MODULES{engine}=afalg
-      SOURCE[afalg]=e_afalg.c
-      DEPEND[afalg]=../libcrypto
-      INCLUDE[afalg]= ../include
-      IF[{- defined $target{shared_defflag} -}]
-        SOURCE[afalg]=afalg.ld
-        GENERATE[afalg.ld]=../util/engines.num
-      ENDIF
-    ENDIF
-    IF[{- !$disabled{"devcryptoeng"} -}]
-      MODULES{engine}=devcrypto
-      SOURCE[devcrypto]=e_devcrypto.c
-      DEPEND[devcrypto]=../libcrypto
-      INCLUDE[devcrypto]=../include
-      IF[{- defined $target{shared_defflag} -}]
-        SOURCE[devcrypto]=devcrypto.ld
-        GENERATE[devcrypto.ld]=../util/engines.num
-      ENDIF
-    ENDIF
-    IF[{- !$disabled{"loadereng"} -}]
-      MODULES{engine}=loader_attic
-      SOURCE[loader_attic]=e_loader_attic.c ../crypto/pem/pvkfmt.c
-      DEFINE[loader_attic]=OPENSSL_NO_PROVIDER_CODE
-      DEPEND[loader_attic]=../libcrypto
-      INCLUDE[loader_attic]=../include
-      IF[{- defined $target{shared_defflag} -}]
-        SOURCE[loader_attic]=loader_attic.ld
-        GENERATE[loader_attic.ld]=../util/engines.num
-      ENDIF
-    ENDIF
-
-    MODULES{noinst,engine}=ossltest dasync
-    SOURCE[dasync]=e_dasync.c
-    DEPEND[dasync]=../libcrypto
-    INCLUDE[dasync]=../include
-    IF[{- defined $target{shared_defflag} -}]
-      SOURCE[dasync]=dasync.ld
-      GENERATE[dasync.ld]=../util/engines.num
-    ENDIF
-
-    SOURCE[ossltest]=e_ossltest.c
-    DEPEND[ossltest]=../libcrypto
-    INCLUDE[ossltest]=../include
-    IF[{- defined $target{shared_defflag} -}]
-      SOURCE[ossltest]=ossltest.ld
-      GENERATE[ossltest.ld]=../util/engines.num
-    ENDIF
-  ENDIF
-  GENERATE[e_padlock-x86.S]=asm/e_padlock-x86.pl
-  GENERATE[e_padlock-x86_64.s]=asm/e_padlock-x86_64.pl
-ENDIF
diff --git a/deps/openssl/openssl/engines/e_afalg.c b/deps/openssl/openssl/engines/e_afalg.c
deleted file mode 100644
index 366a534c916..00000000000
--- a/deps/openssl/openssl/engines/e_afalg.c
+++ /dev/null
@@ -1,956 +0,0 @@
-/*
- * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-/* Required for vmsplice */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <openssl/engine.h>
-#include <openssl/async.h>
-#include <openssl/err.h>
-#include "internal/nelem.h"
-
-#include <sys/socket.h>
-#include <linux/version.h>
-#define K_MAJ 4
-#define K_MIN1 1
-#define K_MIN2 0
-#if LINUX_VERSION_CODE < KERNEL_VERSION(K_MAJ, K_MIN1, K_MIN2) || !defined(AF_ALG)
-#ifndef PEDANTIC
-#warning "AFALG ENGINE requires Kernel Headers >= 4.1.0"
-#warning "Skipping Compilation of AFALG engine"
-#endif
-void engine_load_afalg_int(void);
-void engine_load_afalg_int(void)
-{
-}
-#else
-
-#include <linux/if_alg.h>
-#include <fcntl.h>
-#include <sys/utsname.h>
-
-#include <linux/aio_abi.h>
-#include <sys/syscall.h>
-#include <errno.h>
-
-/* clang-format off */
-# include "e_afalg.h"
-# include "e_afalg_err.c"
-/* clang-format on */
-
-#ifndef SOL_ALG
-#define SOL_ALG 279
-#endif
-
-#ifdef ALG_ZERO_COPY
-#ifndef SPLICE_F_GIFT
-#define SPLICE_F_GIFT (0x08)
-#endif
-#endif
-
-#define ALG_AES_IV_LEN 16
-#define ALG_IV_LEN(len) (sizeof(struct af_alg_iv) + (len))
-#define ALG_OP_TYPE unsigned int
-#define ALG_OP_LEN (sizeof(ALG_OP_TYPE))
-
-#ifdef OPENSSL_NO_DYNAMIC_ENGINE
-void engine_load_afalg_int(void);
-#endif
-
-/* Local Linkage Functions */
-static int afalg_init_aio(afalg_aio *aio);
-static int afalg_fin_cipher_aio(afalg_aio *ptr, int sfd,
-    unsigned char *buf, size_t len);
-static int afalg_create_sk(afalg_ctx *actx, const char *ciphertype,
-    const char *ciphername);
-static int afalg_destroy(ENGINE *e);
-static int afalg_init(ENGINE *e);
-static int afalg_finish(ENGINE *e);
-static const EVP_CIPHER *afalg_aes_cbc(int nid);
-static cbc_handles *get_cipher_handle(int nid);
-static int afalg_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
-    const int **nids, int nid);
-static int afalg_cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-static int afalg_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl);
-static int afalg_cipher_cleanup(EVP_CIPHER_CTX *ctx);
-static int afalg_chk_platform(void);
-
-/* Engine Id and Name */
-static const char *engine_afalg_id = "afalg";
-static const char *engine_afalg_name = "AFALG engine support";
-
-static int afalg_cipher_nids[] = {
-    NID_aes_128_cbc,
-    NID_aes_192_cbc,
-    NID_aes_256_cbc,
-};
-
-static cbc_handles cbc_handle[] = { { AES_KEY_SIZE_128, NULL },
-    { AES_KEY_SIZE_192, NULL },
-    { AES_KEY_SIZE_256, NULL } };
-
-static ossl_inline int io_setup(unsigned n, aio_context_t *ctx)
-{
-    return syscall(__NR_io_setup, n, ctx);
-}
-
-static ossl_inline int eventfd(int n)
-{
-    return syscall(__NR_eventfd2, n, 0);
-}
-
-static ossl_inline int io_destroy(aio_context_t ctx)
-{
-    return syscall(__NR_io_destroy, ctx);
-}
-
-static ossl_inline int io_read(aio_context_t ctx, long n, struct iocb **iocb)
-{
-    return syscall(__NR_io_submit, ctx, n, iocb);
-}
-
-/* A version of 'struct timespec' with 32-bit time_t and nanoseconds.  */
-struct __timespec32 {
-    __kernel_long_t tv_sec;
-    __kernel_long_t tv_nsec;
-};
-
-static ossl_inline int io_getevents(aio_context_t ctx, long min, long max,
-    struct io_event *events,
-    struct timespec *timeout)
-{
-#if defined(__NR_io_pgetevents_time64)
-    /* Check if we are a 32-bit architecture with a 64-bit time_t */
-    if (sizeof(*timeout) != sizeof(struct __timespec32)) {
-        int ret = syscall(__NR_io_pgetevents_time64, ctx, min, max, events,
-            timeout, NULL);
-        if (ret == 0 || errno != ENOSYS)
-            return ret;
-    }
-#endif
-
-#if defined(__NR_io_getevents)
-    if (sizeof(*timeout) == sizeof(struct __timespec32))
-        /*
-         * time_t matches our architecture length, we can just use
-         * __NR_io_getevents
-         */
-        return syscall(__NR_io_getevents, ctx, min, max, events, timeout);
-    else {
-        /*
-         * We don't have __NR_io_pgetevents_time64, but we are using a
-         * 64-bit time_t on a 32-bit architecture. If we can fit the
-         * timeout value in a 32-bit time_t, then let's do that
-         * and then use the __NR_io_getevents syscall.
-         */
-        if (timeout && timeout->tv_sec == (long)timeout->tv_sec) {
-            struct __timespec32 ts32;
-
-            ts32.tv_sec = (__kernel_long_t)timeout->tv_sec;
-            ts32.tv_nsec = (__kernel_long_t)timeout->tv_nsec;
-
-            return syscall(__NR_io_getevents, ctx, min, max, events, &ts32);
-        } else {
-            return syscall(__NR_io_getevents, ctx, min, max, events, NULL);
-        }
-    }
-#endif
-
-    errno = ENOSYS;
-    return -1;
-}
-
-static void afalg_waitfd_cleanup(ASYNC_WAIT_CTX *ctx, const void *key,
-    OSSL_ASYNC_FD waitfd, void *custom)
-{
-    close(waitfd);
-}
-
-static int afalg_setup_async_event_notification(afalg_aio *aio)
-{
-    ASYNC_JOB *job;
-    ASYNC_WAIT_CTX *waitctx;
-    void *custom = NULL;
-    int ret;
-
-    if ((job = ASYNC_get_current_job()) != NULL) {
-        /* Async mode */
-        waitctx = ASYNC_get_wait_ctx(job);
-        if (waitctx == NULL) {
-            ALG_WARN("%s(%d): ASYNC_get_wait_ctx error", __FILE__, __LINE__);
-            return 0;
-        }
-        /* Get waitfd from ASYNC_WAIT_CTX if it is already set */
-        ret = ASYNC_WAIT_CTX_get_fd(waitctx, engine_afalg_id,
-            &aio->efd, &custom);
-        if (ret == 0) {
-            /*
-             * waitfd is not set in ASYNC_WAIT_CTX, create a new one
-             * and set it. efd will be signaled when AIO operation completes
-             */
-            aio->efd = eventfd(0);
-            if (aio->efd == -1) {
-                ALG_PERR("%s(%d): Failed to get eventfd : ", __FILE__,
-                    __LINE__);
-                AFALGerr(AFALG_F_AFALG_SETUP_ASYNC_EVENT_NOTIFICATION,
-                    AFALG_R_EVENTFD_FAILED);
-                return 0;
-            }
-            ret = ASYNC_WAIT_CTX_set_wait_fd(waitctx, engine_afalg_id,
-                aio->efd, custom,
-                afalg_waitfd_cleanup);
-            if (ret == 0) {
-                ALG_WARN("%s(%d): Failed to set wait fd", __FILE__, __LINE__);
-                close(aio->efd);
-                return 0;
-            }
-            /* make fd non-blocking in async mode */
-            if (fcntl(aio->efd, F_SETFL, O_NONBLOCK) != 0) {
-                ALG_WARN("%s(%d): Failed to set event fd as NONBLOCKING",
-                    __FILE__, __LINE__);
-            }
-        }
-        aio->mode = MODE_ASYNC;
-    } else {
-        /* Sync mode */
-        aio->efd = eventfd(0);
-        if (aio->efd == -1) {
-            ALG_PERR("%s(%d): Failed to get eventfd : ", __FILE__, __LINE__);
-            AFALGerr(AFALG_F_AFALG_SETUP_ASYNC_EVENT_NOTIFICATION,
-                AFALG_R_EVENTFD_FAILED);
-            return 0;
-        }
-        aio->mode = MODE_SYNC;
-    }
-    return 1;
-}
-
-static int afalg_init_aio(afalg_aio *aio)
-{
-    int r = -1;
-
-    /* Initialise for AIO */
-    aio->aio_ctx = 0;
-    r = io_setup(MAX_INFLIGHTS, &aio->aio_ctx);
-    if (r < 0) {
-        ALG_PERR("%s(%d): io_setup error : ", __FILE__, __LINE__);
-        AFALGerr(AFALG_F_AFALG_INIT_AIO, AFALG_R_IO_SETUP_FAILED);
-        return 0;
-    }
-
-    memset(aio->cbt, 0, sizeof(aio->cbt));
-    aio->efd = -1;
-    aio->mode = MODE_UNINIT;
-
-    return 1;
-}
-
-static int afalg_fin_cipher_aio(afalg_aio *aio, int sfd, unsigned char *buf,
-    size_t len)
-{
-    int r;
-    int retry = 0;
-    unsigned int done = 0;
-    struct iocb *cb;
-    struct timespec timeout;
-    struct io_event events[MAX_INFLIGHTS];
-    u_int64_t eval = 0;
-
-    timeout.tv_sec = 0;
-    timeout.tv_nsec = 0;
-
-    /* if efd has not been initialised yet do it here */
-    if (aio->mode == MODE_UNINIT) {
-        r = afalg_setup_async_event_notification(aio);
-        if (r == 0)
-            return 0;
-    }
-
-    cb = &(aio->cbt[0 % MAX_INFLIGHTS]);
-    memset(cb, '\0', sizeof(*cb));
-    cb->aio_fildes = sfd;
-    cb->aio_lio_opcode = IOCB_CMD_PREAD;
-    /*
-     * The pointer has to be converted to unsigned value first to avoid
-     * sign extension on cast to 64 bit value in 32-bit builds
-     */
-    cb->aio_buf = (size_t)buf;
-    cb->aio_offset = 0;
-    cb->aio_data = 0;
-    cb->aio_nbytes = len;
-    cb->aio_flags = IOCB_FLAG_RESFD;
-    cb->aio_resfd = aio->efd;
-
-    /*
-     * Perform AIO read on AFALG socket, this in turn performs an async
-     * crypto operation in kernel space
-     */
-    r = io_read(aio->aio_ctx, 1, &cb);
-    if (r < 0) {
-        ALG_PWARN("%s(%d): io_read failed : ", __FILE__, __LINE__);
-        return 0;
-    }
-
-    do {
-        /* While AIO read is being performed pause job */
-        ASYNC_pause_job();
-
-        /* Check for completion of AIO read */
-        r = read(aio->efd, &eval, sizeof(eval));
-        if (r < 0) {
-            if (errno == EAGAIN || errno == EWOULDBLOCK)
-                continue;
-            ALG_PERR("%s(%d): read failed for event fd : ", __FILE__, __LINE__);
-            return 0;
-        } else if (r == 0 || eval <= 0) {
-            ALG_WARN("%s(%d): eventfd read %d bytes, eval = %lu\n", __FILE__,
-                __LINE__, r, eval);
-        }
-        if (eval > 0) {
-
-#ifdef OSSL_SANITIZE_MEMORY
-            /*
-             * In a memory sanitiser build, the changes to memory made by the
-             * system call aren't reliably detected.  By initialising the
-             * memory here, the sanitiser is told that they are okay.
-             */
-            memset(events, 0, sizeof(events));
-#endif
-
-            /* Get results of AIO read */
-            r = io_getevents(aio->aio_ctx, 1, MAX_INFLIGHTS,
-                events, &timeout);
-            if (r > 0) {
-                /*
-                 * events.res indicates the actual status of the operation.
-                 * Handle the error condition first.
-                 */
-                if (events[0].res < 0) {
-                    /*
-                     * Underlying operation cannot be completed at the time
-                     * of previous submission. Resubmit for the operation.
-                     */
-                    if (events[0].res == -EBUSY && retry++ < 3) {
-                        r = io_read(aio->aio_ctx, 1, &cb);
-                        if (r < 0) {
-                            ALG_PERR("%s(%d): retry %d for io_read failed : ",
-                                __FILE__, __LINE__, retry);
-                            return 0;
-                        }
-                        continue;
-                    } else {
-                        char strbuf[32];
-                        /*
-                         * sometimes __s64 is defined as long long int
-                         * but on some archs ( like mips64 or powerpc64 ) it's just long int
-                         *
-                         * to be able to use BIO_snprintf() with %lld without warnings
-                         * copy events[0].res to an long long int variable
-                         *
-                         * because long long int should always be at least 64 bit this should work
-                         */
-                        long long int op_ret = events[0].res;
-
-                        /*
-                         * Retries exceed for -EBUSY or unrecoverable error
-                         * condition for this instance of operation.
-                         */
-                        ALG_WARN("%s(%d): Crypto Operation failed with code %lld\n",
-                            __FILE__, __LINE__, events[0].res);
-                        BIO_snprintf(strbuf, sizeof(strbuf), "%lld", op_ret);
-                        switch (events[0].res) {
-                        case -ENOMEM:
-                            AFALGerr(0, AFALG_R_KERNEL_OP_FAILED);
-                            ERR_add_error_data(3, "-ENOMEM ( code ", strbuf, " )");
-                            break;
-                        default:
-                            AFALGerr(0, AFALG_R_KERNEL_OP_FAILED);
-                            ERR_add_error_data(2, "code ", strbuf);
-                            break;
-                        }
-                        return 0;
-                    }
-                }
-                /* Operation successful. */
-                done = 1;
-            } else if (r < 0) {
-                ALG_PERR("%s(%d): io_getevents failed : ", __FILE__, __LINE__);
-                return 0;
-            } else {
-                ALG_WARN("%s(%d): io_geteventd read 0 bytes\n", __FILE__,
-                    __LINE__);
-            }
-        }
-    } while (!done);
-
-    return 1;
-}
-
-static ossl_inline void afalg_set_op_sk(struct cmsghdr *cmsg,
-    const ALG_OP_TYPE op)
-{
-    cmsg->cmsg_level = SOL_ALG;
-    cmsg->cmsg_type = ALG_SET_OP;
-    cmsg->cmsg_len = CMSG_LEN(ALG_OP_LEN);
-    memcpy(CMSG_DATA(cmsg), &op, ALG_OP_LEN);
-}
-
-static void afalg_set_iv_sk(struct cmsghdr *cmsg, const unsigned char *iv,
-    const unsigned int len)
-{
-    struct af_alg_iv *aiv;
-
-    cmsg->cmsg_level = SOL_ALG;
-    cmsg->cmsg_type = ALG_SET_IV;
-    cmsg->cmsg_len = CMSG_LEN(ALG_IV_LEN(len));
-    aiv = (struct af_alg_iv *)CMSG_DATA(cmsg);
-    aiv->ivlen = len;
-    memcpy(aiv->iv, iv, len);
-}
-
-static ossl_inline int afalg_set_key(afalg_ctx *actx, const unsigned char *key,
-    const int klen)
-{
-    int ret;
-    ret = setsockopt(actx->bfd, SOL_ALG, ALG_SET_KEY, key, klen);
-    if (ret < 0) {
-        ALG_PERR("%s(%d): Failed to set socket option : ", __FILE__, __LINE__);
-        AFALGerr(AFALG_F_AFALG_SET_KEY, AFALG_R_SOCKET_SET_KEY_FAILED);
-        return 0;
-    }
-    return 1;
-}
-
-static int afalg_create_sk(afalg_ctx *actx, const char *ciphertype,
-    const char *ciphername)
-{
-    struct sockaddr_alg sa;
-    int r = -1;
-
-    actx->bfd = actx->sfd = -1;
-
-    memset(&sa, 0, sizeof(sa));
-    sa.salg_family = AF_ALG;
-    OPENSSL_strlcpy((char *)sa.salg_type, ciphertype, sizeof(sa.salg_type));
-    OPENSSL_strlcpy((char *)sa.salg_name, ciphername, sizeof(sa.salg_name));
-
-    actx->bfd = socket(AF_ALG, SOCK_SEQPACKET, 0);
-    if (actx->bfd == -1) {
-        ALG_PERR("%s(%d): Failed to open socket : ", __FILE__, __LINE__);
-        AFALGerr(AFALG_F_AFALG_CREATE_SK, AFALG_R_SOCKET_CREATE_FAILED);
-        goto err;
-    }
-
-    r = bind(actx->bfd, (struct sockaddr *)&sa, sizeof(sa));
-    if (r < 0) {
-        ALG_PERR("%s(%d): Failed to bind socket : ", __FILE__, __LINE__);
-        AFALGerr(AFALG_F_AFALG_CREATE_SK, AFALG_R_SOCKET_BIND_FAILED);
-        goto err;
-    }
-
-    actx->sfd = accept(actx->bfd, NULL, 0);
-    if (actx->sfd < 0) {
-        ALG_PERR("%s(%d): Socket Accept Failed : ", __FILE__, __LINE__);
-        AFALGerr(AFALG_F_AFALG_CREATE_SK, AFALG_R_SOCKET_ACCEPT_FAILED);
-        goto err;
-    }
-
-    return 1;
-
-err:
-    if (actx->bfd >= 0)
-        close(actx->bfd);
-    if (actx->sfd >= 0)
-        close(actx->sfd);
-    actx->bfd = actx->sfd = -1;
-    return 0;
-}
-
-static int afalg_start_cipher_sk(afalg_ctx *actx, const unsigned char *in,
-    size_t inl, const unsigned char *iv,
-    unsigned int enc)
-{
-    struct msghdr msg;
-    struct cmsghdr *cmsg;
-    struct iovec iov;
-    ssize_t sbytes;
-#ifdef ALG_ZERO_COPY
-    int ret;
-#endif
-    char cbuf[CMSG_SPACE(ALG_IV_LEN(ALG_AES_IV_LEN)) + CMSG_SPACE(ALG_OP_LEN)];
-
-    memset(&msg, 0, sizeof(msg));
-    memset(cbuf, 0, sizeof(cbuf));
-    msg.msg_control = cbuf;
-    msg.msg_controllen = sizeof(cbuf);
-
-    /*
-     * cipher direction (i.e. encrypt or decrypt) and iv are sent to the
-     * kernel as part of sendmsg()'s ancillary data
-     */
-    cmsg = CMSG_FIRSTHDR(&msg);
-    afalg_set_op_sk(cmsg, enc);
-    cmsg = CMSG_NXTHDR(&msg, cmsg);
-    afalg_set_iv_sk(cmsg, iv, ALG_AES_IV_LEN);
-
-    /* iov that describes input data */
-    iov.iov_base = (unsigned char *)in;
-    iov.iov_len = inl;
-
-    msg.msg_flags = MSG_MORE;
-
-#ifdef ALG_ZERO_COPY
-    /*
-     * ZERO_COPY mode
-     * Works best when buffer is 4k aligned
-     * OPENS: out of place processing (i.e. out != in)
-     */
-
-    /* Input data is not sent as part of call to sendmsg() */
-    msg.msg_iovlen = 0;
-    msg.msg_iov = NULL;
-
-    /* Sendmsg() sends iv and cipher direction to the kernel */
-    sbytes = sendmsg(actx->sfd, &msg, 0);
-    if (sbytes < 0) {
-        ALG_PERR("%s(%d): sendmsg failed for zero copy cipher operation : ",
-            __FILE__, __LINE__);
-        return 0;
-    }
-
-    /*
-     * vmsplice and splice are used to pin the user space input buffer for
-     * kernel space processing avoiding copies from user to kernel space
-     */
-    ret = vmsplice(actx->zc_pipe[1], &iov, 1, SPLICE_F_GIFT);
-    if (ret < 0) {
-        ALG_PERR("%s(%d): vmsplice failed : ", __FILE__, __LINE__);
-        return 0;
-    }
-
-    ret = splice(actx->zc_pipe[0], NULL, actx->sfd, NULL, inl, 0);
-    if (ret < 0) {
-        ALG_PERR("%s(%d): splice failed : ", __FILE__, __LINE__);
-        return 0;
-    }
-#else
-    msg.msg_iovlen = 1;
-    msg.msg_iov = &iov;
-
-    /* Sendmsg() sends iv, cipher direction and input data to the kernel */
-    sbytes = sendmsg(actx->sfd, &msg, 0);
-    if (sbytes < 0) {
-        ALG_PERR("%s(%d): sendmsg failed for cipher operation : ", __FILE__,
-            __LINE__);
-        return 0;
-    }
-
-    if (sbytes != (ssize_t)inl) {
-        ALG_WARN("Cipher operation send bytes %zd != inlen %zd\n", sbytes,
-            inl);
-        return 0;
-    }
-#endif
-
-    return 1;
-}
-
-static int afalg_cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    int ciphertype;
-    int ret, len;
-    afalg_ctx *actx;
-    const char *ciphername;
-
-    if (ctx == NULL || key == NULL) {
-        ALG_WARN("%s(%d): Null Parameter\n", __FILE__, __LINE__);
-        return 0;
-    }
-
-    if (EVP_CIPHER_CTX_get0_cipher(ctx) == NULL) {
-        ALG_WARN("%s(%d): Cipher object NULL\n", __FILE__, __LINE__);
-        return 0;
-    }
-
-    actx = EVP_CIPHER_CTX_get_cipher_data(ctx);
-    if (actx == NULL) {
-        ALG_WARN("%s(%d): Cipher data NULL\n", __FILE__, __LINE__);
-        return 0;
-    }
-
-    ciphertype = EVP_CIPHER_CTX_get_nid(ctx);
-    switch (ciphertype) {
-    case NID_aes_128_cbc:
-    case NID_aes_192_cbc:
-    case NID_aes_256_cbc:
-        ciphername = "cbc(aes)";
-        break;
-    default:
-        ALG_WARN("%s(%d): Unsupported Cipher type %d\n", __FILE__, __LINE__,
-            ciphertype);
-        return 0;
-    }
-
-    if (ALG_AES_IV_LEN != EVP_CIPHER_CTX_get_iv_length(ctx)) {
-        ALG_WARN("%s(%d): Unsupported IV length :%d\n", __FILE__, __LINE__,
-            EVP_CIPHER_CTX_get_iv_length(ctx));
-        return 0;
-    }
-
-    /* Setup AFALG socket for crypto processing */
-    ret = afalg_create_sk(actx, "skcipher", ciphername);
-    if (ret < 1)
-        return 0;
-
-    if ((len = EVP_CIPHER_CTX_get_key_length(ctx)) <= 0)
-        goto err;
-    ret = afalg_set_key(actx, key, len);
-    if (ret < 1)
-        goto err;
-
-    /* Setup AIO ctx to allow async AFALG crypto processing */
-    if (afalg_init_aio(&actx->aio) == 0)
-        goto err;
-
-#ifdef ALG_ZERO_COPY
-    pipe(actx->zc_pipe);
-#endif
-
-    actx->init_done = MAGIC_INIT_NUM;
-
-    return 1;
-
-err:
-    close(actx->sfd);
-    close(actx->bfd);
-    return 0;
-}
-
-static int afalg_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    afalg_ctx *actx;
-    int ret;
-    char nxtiv[ALG_AES_IV_LEN] = { 0 };
-
-    if (ctx == NULL || out == NULL || in == NULL) {
-        ALG_WARN("NULL parameter passed to function %s(%d)\n", __FILE__,
-            __LINE__);
-        return 0;
-    }
-
-    actx = (afalg_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-    if (actx == NULL || actx->init_done != MAGIC_INIT_NUM) {
-        ALG_WARN("%s afalg ctx passed\n",
-            ctx == NULL ? "NULL" : "Uninitialised");
-        return 0;
-    }
-
-    /*
-     * set iv now for decrypt operation as the input buffer can be
-     * overwritten for inplace operation where in = out.
-     */
-    if (EVP_CIPHER_CTX_is_encrypting(ctx) == 0) {
-        memcpy(nxtiv, in + (inl - ALG_AES_IV_LEN), ALG_AES_IV_LEN);
-    }
-
-    /* Send input data to kernel space */
-    ret = afalg_start_cipher_sk(actx, (unsigned char *)in, inl,
-        EVP_CIPHER_CTX_iv(ctx),
-        EVP_CIPHER_CTX_is_encrypting(ctx));
-    if (ret < 1) {
-        return 0;
-    }
-
-    /* Perform async crypto operation in kernel space */
-    ret = afalg_fin_cipher_aio(&actx->aio, actx->sfd, out, inl);
-    if (ret < 1)
-        return 0;
-
-    if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-        memcpy(EVP_CIPHER_CTX_iv_noconst(ctx), out + (inl - ALG_AES_IV_LEN),
-            ALG_AES_IV_LEN);
-    } else {
-        memcpy(EVP_CIPHER_CTX_iv_noconst(ctx), nxtiv, ALG_AES_IV_LEN);
-    }
-
-    return 1;
-}
-
-static int afalg_cipher_cleanup(EVP_CIPHER_CTX *ctx)
-{
-    afalg_ctx *actx;
-
-    if (ctx == NULL) {
-        ALG_WARN("NULL parameter passed to function %s(%d)\n", __FILE__,
-            __LINE__);
-        return 0;
-    }
-
-    actx = (afalg_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-    if (actx == NULL || actx->init_done != MAGIC_INIT_NUM)
-        return 1;
-
-    close(actx->sfd);
-    close(actx->bfd);
-#ifdef ALG_ZERO_COPY
-    close(actx->zc_pipe[0]);
-    close(actx->zc_pipe[1]);
-#endif
-    /* close efd in sync mode, async mode is closed in afalg_waitfd_cleanup() */
-    if (actx->aio.mode == MODE_SYNC)
-        close(actx->aio.efd);
-    io_destroy(actx->aio.aio_ctx);
-
-    return 1;
-}
-
-static cbc_handles *get_cipher_handle(int nid)
-{
-    switch (nid) {
-    case NID_aes_128_cbc:
-        return &cbc_handle[AES_CBC_128];
-    case NID_aes_192_cbc:
-        return &cbc_handle[AES_CBC_192];
-    case NID_aes_256_cbc:
-        return &cbc_handle[AES_CBC_256];
-    default:
-        return NULL;
-    }
-}
-
-static const EVP_CIPHER *afalg_aes_cbc(int nid)
-{
-    cbc_handles *cipher_handle = get_cipher_handle(nid);
-
-    if (cipher_handle == NULL)
-        return NULL;
-    if (cipher_handle->_hidden == NULL
-        && ((cipher_handle->_hidden = EVP_CIPHER_meth_new(nid,
-                 AES_BLOCK_SIZE,
-                 cipher_handle->key_size))
-                == NULL
-            || !EVP_CIPHER_meth_set_iv_length(cipher_handle->_hidden,
-                AES_IV_LEN)
-            || !EVP_CIPHER_meth_set_flags(cipher_handle->_hidden,
-                EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1)
-            || !EVP_CIPHER_meth_set_init(cipher_handle->_hidden,
-                afalg_cipher_init)
-            || !EVP_CIPHER_meth_set_do_cipher(cipher_handle->_hidden,
-                afalg_do_cipher)
-            || !EVP_CIPHER_meth_set_cleanup(cipher_handle->_hidden,
-                afalg_cipher_cleanup)
-            || !EVP_CIPHER_meth_set_impl_ctx_size(cipher_handle->_hidden,
-                sizeof(afalg_ctx)))) {
-        EVP_CIPHER_meth_free(cipher_handle->_hidden);
-        cipher_handle->_hidden = NULL;
-    }
-    return cipher_handle->_hidden;
-}
-
-static int afalg_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
-    const int **nids, int nid)
-{
-    int r = 1;
-
-    if (cipher == NULL) {
-        *nids = afalg_cipher_nids;
-        return OSSL_NELEM(afalg_cipher_nids);
-    }
-
-    switch (nid) {
-    case NID_aes_128_cbc:
-    case NID_aes_192_cbc:
-    case NID_aes_256_cbc:
-        *cipher = afalg_aes_cbc(nid);
-        break;
-    default:
-        *cipher = NULL;
-        r = 0;
-    }
-    return r;
-}
-
-static int bind_afalg(ENGINE *e)
-{
-    /* Ensure the afalg error handling is set up */
-    unsigned short i;
-    ERR_load_AFALG_strings();
-
-    if (!ENGINE_set_id(e, engine_afalg_id)
-        || !ENGINE_set_name(e, engine_afalg_name)
-        || !ENGINE_set_destroy_function(e, afalg_destroy)
-        || !ENGINE_set_init_function(e, afalg_init)
-        || !ENGINE_set_finish_function(e, afalg_finish)) {
-        AFALGerr(AFALG_F_BIND_AFALG, AFALG_R_INIT_FAILED);
-        return 0;
-    }
-
-    /*
-     * Create _hidden_aes_xxx_cbc by calling afalg_aes_xxx_cbc
-     * now, as bind_aflag can only be called by one thread at a
-     * time.
-     */
-    for (i = 0; i < OSSL_NELEM(afalg_cipher_nids); i++) {
-        if (afalg_aes_cbc(afalg_cipher_nids[i]) == NULL) {
-            AFALGerr(AFALG_F_BIND_AFALG, AFALG_R_INIT_FAILED);
-            return 0;
-        }
-    }
-
-    if (!ENGINE_set_ciphers(e, afalg_ciphers)) {
-        AFALGerr(AFALG_F_BIND_AFALG, AFALG_R_INIT_FAILED);
-        return 0;
-    }
-
-    return 1;
-}
-
-#ifndef OPENSSL_NO_DYNAMIC_ENGINE
-static int bind_helper(ENGINE *e, const char *id)
-{
-    if (id && (strcmp(id, engine_afalg_id) != 0))
-        return 0;
-
-    if (!afalg_chk_platform())
-        return 0;
-
-    if (!bind_afalg(e)) {
-        afalg_destroy(e);
-        return 0;
-    }
-    return 1;
-}
-
-IMPLEMENT_DYNAMIC_CHECK_FN()
-IMPLEMENT_DYNAMIC_BIND_FN(bind_helper)
-#endif
-
-static int afalg_chk_platform(void)
-{
-    int ret;
-    int i;
-    int kver[3] = { -1, -1, -1 };
-    int sock;
-    char *str;
-    struct utsname ut;
-
-    ret = uname(&ut);
-    if (ret != 0) {
-        AFALGerr(AFALG_F_AFALG_CHK_PLATFORM,
-            AFALG_R_FAILED_TO_GET_PLATFORM_INFO);
-        return 0;
-    }
-
-    str = strtok(ut.release, ".");
-    for (i = 0; i < 3 && str != NULL; i++) {
-        kver[i] = atoi(str);
-        str = strtok(NULL, ".");
-    }
-
-    if (KERNEL_VERSION(kver[0], kver[1], kver[2])
-        < KERNEL_VERSION(K_MAJ, K_MIN1, K_MIN2)) {
-        ALG_ERR("ASYNC AFALG not supported this kernel(%d.%d.%d)\n",
-            kver[0], kver[1], kver[2]);
-        ALG_ERR("ASYNC AFALG requires kernel version %d.%d.%d or later\n",
-            K_MAJ, K_MIN1, K_MIN2);
-        AFALGerr(AFALG_F_AFALG_CHK_PLATFORM,
-            AFALG_R_KERNEL_DOES_NOT_SUPPORT_ASYNC_AFALG);
-        return 0;
-    }
-
-    /* Test if we can actually create an AF_ALG socket */
-    sock = socket(AF_ALG, SOCK_SEQPACKET, 0);
-    if (sock == -1) {
-        AFALGerr(AFALG_F_AFALG_CHK_PLATFORM, AFALG_R_SOCKET_CREATE_FAILED);
-        return 0;
-    }
-    close(sock);
-
-    return 1;
-}
-
-#ifdef OPENSSL_NO_DYNAMIC_ENGINE
-static ENGINE *engine_afalg(void)
-{
-    ENGINE *ret = ENGINE_new();
-    if (ret == NULL)
-        return NULL;
-    if (!bind_afalg(ret)) {
-        ENGINE_free(ret);
-        return NULL;
-    }
-    return ret;
-}
-
-void engine_load_afalg_int(void)
-{
-    ENGINE *toadd;
-
-    if (!afalg_chk_platform())
-        return;
-
-    toadd = engine_afalg();
-    if (toadd == NULL)
-        return;
-    ERR_set_mark();
-    ENGINE_add(toadd);
-    /*
-     * If the "add" worked, it gets a structural reference. So either way, we
-     * release our just-created reference.
-     */
-    ENGINE_free(toadd);
-    /*
-     * If the "add" didn't work, it was probably a conflict because it was
-     * already added (eg. someone calling ENGINE_load_blah then calling
-     * ENGINE_load_builtin_engines() perhaps).
-     */
-    ERR_pop_to_mark();
-}
-#endif
-
-static int afalg_init(ENGINE *e)
-{
-    return 1;
-}
-
-static int afalg_finish(ENGINE *e)
-{
-    return 1;
-}
-
-static int free_cbc(void)
-{
-    short unsigned int i;
-    for (i = 0; i < OSSL_NELEM(afalg_cipher_nids); i++) {
-        EVP_CIPHER_meth_free(cbc_handle[i]._hidden);
-        cbc_handle[i]._hidden = NULL;
-    }
-    return 1;
-}
-
-static int afalg_destroy(ENGINE *e)
-{
-    ERR_unload_AFALG_strings();
-    free_cbc();
-    return 1;
-}
-
-#endif /* KERNEL VERSION */
diff --git a/deps/openssl/openssl/engines/e_afalg.ec b/deps/openssl/openssl/engines/e_afalg.ec
deleted file mode 100644
index 6d7420fe5c3..00000000000
--- a/deps/openssl/openssl/engines/e_afalg.ec
+++ /dev/null
@@ -1,3 +0,0 @@
-# The INPUT HEADER is scanned for declarations
-# LIBNAME       INPUT HEADER                    ERROR-TABLE FILE
-L AFALG         e_afalg_err.h                   e_afalg_err.c
diff --git a/deps/openssl/openssl/engines/e_afalg.h b/deps/openssl/openssl/engines/e_afalg.h
deleted file mode 100644
index e8ccf9515e9..00000000000
--- a/deps/openssl/openssl/engines/e_afalg.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_ENGINES_E_AFALG_H
-#define OSSL_ENGINES_E_AFALG_H
-
-#if defined(__GNUC__) && __GNUC__ >= 4 && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L)
-#pragma GCC diagnostic ignored "-Wvariadic-macros"
-#endif
-
-#ifdef ALG_DEBUG
-#define ALG_DGB(x, ...) fprintf(stderr, "ALG_DBG: " x, __VA_ARGS__)
-#define ALG_INFO(x, ...) fprintf(stderr, "ALG_INFO: " x, __VA_ARGS__)
-#define ALG_WARN(x, ...) fprintf(stderr, "ALG_WARN: " x, __VA_ARGS__)
-#else
-#define ALG_DGB(x, ...)
-#define ALG_INFO(x, ...)
-#define ALG_WARN(x, ...)
-#endif
-
-#define ALG_ERR(x, ...) fprintf(stderr, "ALG_ERR: " x, __VA_ARGS__)
-#define ALG_PERR(x, ...)                              \
-    do {                                              \
-        fprintf(stderr, "ALG_PERR: " x, __VA_ARGS__); \
-        perror(NULL);                                 \
-    } while (0)
-#define ALG_PWARN(x, ...)                             \
-    do {                                              \
-        fprintf(stderr, "ALG_PERR: " x, __VA_ARGS__); \
-        perror(NULL);                                 \
-    } while (0)
-
-#ifndef AES_BLOCK_SIZE
-#define AES_BLOCK_SIZE 16
-#endif
-#define AES_KEY_SIZE_128 16
-#define AES_KEY_SIZE_192 24
-#define AES_KEY_SIZE_256 32
-#define AES_IV_LEN 16
-
-#define MAX_INFLIGHTS 1
-
-typedef enum {
-    MODE_UNINIT = 0,
-    MODE_SYNC,
-    MODE_ASYNC
-} op_mode;
-
-enum {
-    AES_CBC_128 = 0,
-    AES_CBC_192,
-    AES_CBC_256
-};
-
-struct cbc_cipher_handles {
-    int key_size;
-    EVP_CIPHER *_hidden;
-};
-
-typedef struct cbc_cipher_handles cbc_handles;
-
-struct afalg_aio_st {
-    int efd;
-    op_mode mode;
-    aio_context_t aio_ctx;
-    struct io_event events[MAX_INFLIGHTS];
-    struct iocb cbt[MAX_INFLIGHTS];
-};
-typedef struct afalg_aio_st afalg_aio;
-
-/*
- * MAGIC Number to identify correct initialisation
- * of afalg_ctx.
- */
-#define MAGIC_INIT_NUM 0x1890671
-
-struct afalg_ctx_st {
-    int init_done;
-    int sfd;
-    int bfd;
-#ifdef ALG_ZERO_COPY
-    int zc_pipe[2];
-#endif
-    afalg_aio aio;
-};
-
-typedef struct afalg_ctx_st afalg_ctx;
-#endif
diff --git a/deps/openssl/openssl/engines/e_afalg.txt b/deps/openssl/openssl/engines/e_afalg.txt
deleted file mode 100644
index 9b5fee84752..00000000000
--- a/deps/openssl/openssl/engines/e_afalg.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 1999-2022 The OpenSSL Project Authors. All Rights Reserved.
-#
-# Licensed under the Apache License 2.0 (the "License").  You may not use
-# this file except in compliance with the License.  You can obtain a copy
-# in the file LICENSE in the source distribution or at
-# https://www.openssl.org/source/license.html
-
-#Reason codes
-AFALG_R_EVENTFD_FAILED:108:eventfd failed
-AFALG_R_FAILED_TO_GET_PLATFORM_INFO:111:failed to get platform info
-AFALG_R_INIT_FAILED:100:init failed
-AFALG_R_IO_SETUP_FAILED:105:io setup failed
-AFALG_R_KERNEL_DOES_NOT_SUPPORT_AFALG:101:kernel does not support afalg
-AFALG_R_KERNEL_DOES_NOT_SUPPORT_ASYNC_AFALG:107:\
-	kernel does not support async afalg
-AFALG_R_KERNEL_OP_FAILED:112:kernel op failed
-AFALG_R_MEM_ALLOC_FAILED:102:mem alloc failed
-AFALG_R_SOCKET_ACCEPT_FAILED:110:socket accept failed
-AFALG_R_SOCKET_BIND_FAILED:103:socket bind failed
-AFALG_R_SOCKET_CREATE_FAILED:109:socket create failed
-AFALG_R_SOCKET_OPERATION_FAILED:104:socket operation failed
-AFALG_R_SOCKET_SET_KEY_FAILED:106:socket set key failed
diff --git a/deps/openssl/openssl/engines/e_afalg_err.c b/deps/openssl/openssl/engines/e_afalg_err.c
deleted file mode 100644
index bd134c7ca34..00000000000
--- a/deps/openssl/openssl/engines/e_afalg_err.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include "e_afalg_err.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static ERR_STRING_DATA AFALG_str_reasons[] = {
-    { ERR_PACK(0, 0, AFALG_R_EVENTFD_FAILED), "eventfd failed" },
-    { ERR_PACK(0, 0, AFALG_R_FAILED_TO_GET_PLATFORM_INFO),
-        "failed to get platform info" },
-    { ERR_PACK(0, 0, AFALG_R_INIT_FAILED), "init failed" },
-    { ERR_PACK(0, 0, AFALG_R_IO_SETUP_FAILED), "io setup failed" },
-    { ERR_PACK(0, 0, AFALG_R_KERNEL_DOES_NOT_SUPPORT_AFALG),
-        "kernel does not support afalg" },
-    { ERR_PACK(0, 0, AFALG_R_KERNEL_DOES_NOT_SUPPORT_ASYNC_AFALG),
-        "kernel does not support async afalg" },
-    { ERR_PACK(0, 0, AFALG_R_KERNEL_OP_FAILED), "kernel op failed" },
-    { ERR_PACK(0, 0, AFALG_R_MEM_ALLOC_FAILED), "mem alloc failed" },
-    { ERR_PACK(0, 0, AFALG_R_SOCKET_ACCEPT_FAILED), "socket accept failed" },
-    { ERR_PACK(0, 0, AFALG_R_SOCKET_BIND_FAILED), "socket bind failed" },
-    { ERR_PACK(0, 0, AFALG_R_SOCKET_CREATE_FAILED), "socket create failed" },
-    { ERR_PACK(0, 0, AFALG_R_SOCKET_OPERATION_FAILED),
-        "socket operation failed" },
-    { ERR_PACK(0, 0, AFALG_R_SOCKET_SET_KEY_FAILED), "socket set key failed" },
-    { 0, NULL }
-};
-
-#endif
-
-static int lib_code = 0;
-static int error_loaded = 0;
-
-static int ERR_load_AFALG_strings(void)
-{
-    if (lib_code == 0)
-        lib_code = ERR_get_next_error_library();
-
-    if (!error_loaded) {
-#ifndef OPENSSL_NO_ERR
-        ERR_load_strings(lib_code, AFALG_str_reasons);
-#endif
-        error_loaded = 1;
-    }
-    return 1;
-}
-
-static void ERR_unload_AFALG_strings(void)
-{
-    if (error_loaded) {
-#ifndef OPENSSL_NO_ERR
-        ERR_unload_strings(lib_code, AFALG_str_reasons);
-#endif
-        error_loaded = 0;
-    }
-}
-
-static void ERR_AFALG_error(int function, int reason, const char *file, int line)
-{
-    if (lib_code == 0)
-        lib_code = ERR_get_next_error_library();
-    ERR_raise(lib_code, reason);
-    ERR_set_debug(file, line, NULL);
-}
diff --git a/deps/openssl/openssl/engines/e_afalg_err.h b/deps/openssl/openssl/engines/e_afalg_err.h
deleted file mode 100644
index 085cb835026..00000000000
--- a/deps/openssl/openssl/engines/e_afalg_err.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_E_AFALG_ERR_H
-#define OSSL_E_AFALG_ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#define AFALGerr(f, r) ERR_AFALG_error(0, (r), OPENSSL_FILE, OPENSSL_LINE)
-
-/*
- * AFALG reason codes.
- */
-#define AFALG_R_EVENTFD_FAILED 108
-#define AFALG_R_FAILED_TO_GET_PLATFORM_INFO 111
-#define AFALG_R_INIT_FAILED 100
-#define AFALG_R_IO_SETUP_FAILED 105
-#define AFALG_R_KERNEL_DOES_NOT_SUPPORT_AFALG 101
-#define AFALG_R_KERNEL_DOES_NOT_SUPPORT_ASYNC_AFALG 107
-#define AFALG_R_KERNEL_OP_FAILED 112
-#define AFALG_R_MEM_ALLOC_FAILED 102
-#define AFALG_R_SOCKET_ACCEPT_FAILED 110
-#define AFALG_R_SOCKET_BIND_FAILED 103
-#define AFALG_R_SOCKET_CREATE_FAILED 109
-#define AFALG_R_SOCKET_OPERATION_FAILED 104
-#define AFALG_R_SOCKET_SET_KEY_FAILED 106
-
-#endif
diff --git a/deps/openssl/openssl/engines/e_capi.c b/deps/openssl/openssl/engines/e_capi.c
deleted file mode 100644
index 447d072cba3..00000000000
--- a/deps/openssl/openssl/engines/e_capi.c
+++ /dev/null
@@ -1,1911 +0,0 @@
-/*
- * Copyright 2008-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#ifdef _WIN32
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0400
-#endif
-#include <windows.h>
-#include <wincrypt.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <malloc.h>
-#ifndef alloca
-#define alloca _alloca
-#endif
-
-#include <openssl/crypto.h>
-
-#ifndef OPENSSL_NO_CAPIENG
-
-#include <openssl/buffer.h>
-#include <openssl/bn.h>
-#include <openssl/rsa.h>
-#include <openssl/dsa.h>
-
-/*
- * This module uses several "new" interfaces, among which is
- * CertGetCertificateContextProperty. CERT_KEY_PROV_INFO_PROP_ID is
- * one of possible values you can pass to function in question. By
- * checking if it's defined we can see if wincrypt.h and accompanying
- * crypt32.lib are in shape. The native MingW32 headers up to and
- * including __W32API_VERSION 3.14 lack of struct DSSPUBKEY and the
- * defines CERT_STORE_PROV_SYSTEM_A and CERT_STORE_READONLY_FLAG,
- * so we check for these too and avoid compiling.
- * Yes, it's rather "weak" test and if compilation fails,
- * then re-configure with -DOPENSSL_NO_CAPIENG.
- */
-#if defined(CERT_KEY_PROV_INFO_PROP_ID) && defined(CERT_STORE_PROV_SYSTEM_A) && defined(CERT_STORE_READONLY_FLAG)
-#define __COMPILE_CAPIENG
-#endif /* CERT_KEY_PROV_INFO_PROP_ID */
-#endif /* OPENSSL_NO_CAPIENG */
-#endif /* _WIN32 */
-
-#ifdef __COMPILE_CAPIENG
-
-#undef X509_EXTENSIONS
-
-/* Definitions which may be missing from earlier version of headers */
-#ifndef CERT_STORE_OPEN_EXISTING_FLAG
-#define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000
-#endif
-
-#ifndef CERT_STORE_CREATE_NEW_FLAG
-#define CERT_STORE_CREATE_NEW_FLAG 0x00002000
-#endif
-
-#ifndef CERT_SYSTEM_STORE_CURRENT_USER
-#define CERT_SYSTEM_STORE_CURRENT_USER 0x00010000
-#endif
-
-#ifndef ALG_SID_SHA_256
-#define ALG_SID_SHA_256 12
-#endif
-#ifndef ALG_SID_SHA_384
-#define ALG_SID_SHA_384 13
-#endif
-#ifndef ALG_SID_SHA_512
-#define ALG_SID_SHA_512 14
-#endif
-
-#ifndef CALG_SHA_256
-#define CALG_SHA_256 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256)
-#endif
-#ifndef CALG_SHA_384
-#define CALG_SHA_384 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384)
-#endif
-#ifndef CALG_SHA_512
-#define CALG_SHA_512 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512)
-#endif
-
-#ifndef PROV_RSA_AES
-#define PROV_RSA_AES 24
-#endif
-
-#include <openssl/engine.h>
-#include <openssl/pem.h>
-#include <openssl/x509v3.h>
-
-/* clang-format off */
-# include "e_capi_err.h"
-# include "e_capi_err.c"
-/* clang-format on */
-
-static const char *engine_capi_id = "capi";
-static const char *engine_capi_name = "CryptoAPI ENGINE";
-
-typedef struct CAPI_CTX_st CAPI_CTX;
-typedef struct CAPI_KEY_st CAPI_KEY;
-
-static void capi_addlasterror(void);
-static void capi_adderror(DWORD err);
-
-static void CAPI_trace(CAPI_CTX *ctx, char *format, ...);
-
-static int capi_list_providers(CAPI_CTX *ctx, BIO *out);
-static int capi_list_containers(CAPI_CTX *ctx, BIO *out);
-int capi_list_certs(CAPI_CTX *ctx, BIO *out, char *storename);
-void capi_free_key(CAPI_KEY *key);
-
-static PCCERT_CONTEXT capi_find_cert(CAPI_CTX *ctx, const char *id,
-    HCERTSTORE hstore);
-
-CAPI_KEY *capi_find_key(CAPI_CTX *ctx, const char *id);
-
-static EVP_PKEY *capi_load_privkey(ENGINE *eng, const char *key_id,
-    UI_METHOD *ui_method, void *callback_data);
-static int capi_rsa_sign(int dtype, const unsigned char *m,
-    unsigned int m_len, unsigned char *sigret,
-    unsigned int *siglen, const RSA *rsa);
-static int capi_rsa_priv_enc(int flen, const unsigned char *from,
-    unsigned char *to, RSA *rsa, int padding);
-static int capi_rsa_priv_dec(int flen, const unsigned char *from,
-    unsigned char *to, RSA *rsa, int padding);
-static int capi_rsa_free(RSA *rsa);
-
-#ifndef OPENSSL_NO_DSA
-static DSA_SIG *capi_dsa_do_sign(const unsigned char *digest, int dlen,
-    DSA *dsa);
-static int capi_dsa_free(DSA *dsa);
-#endif
-
-static int capi_load_ssl_client_cert(ENGINE *e, SSL *ssl,
-    STACK_OF(X509_NAME) *ca_dn, X509 **pcert,
-    EVP_PKEY **pkey, STACK_OF(X509) **pother,
-    UI_METHOD *ui_method,
-    void *callback_data);
-
-static int cert_select_simple(ENGINE *e, SSL *ssl, STACK_OF(X509) *certs);
-#ifdef OPENSSL_CAPIENG_DIALOG
-static int cert_select_dialog(ENGINE *e, SSL *ssl, STACK_OF(X509) *certs);
-#endif
-
-void engine_load_capi_int(void);
-
-typedef PCCERT_CONTEXT(WINAPI *CERTDLG)(HCERTSTORE, HWND, LPCWSTR,
-    LPCWSTR, DWORD, DWORD, void *);
-typedef HWND(WINAPI *GETCONSWIN)(void);
-
-/*
- * This structure contains CAPI ENGINE specific data: it contains various
- * global options and affects how other functions behave.
- */
-
-#define CAPI_DBG_TRACE 2
-#define CAPI_DBG_ERROR 1
-
-struct CAPI_CTX_st {
-    int debug_level;
-    char *debug_file;
-    /* Parameters to use for container lookup */
-    DWORD keytype;
-    LPSTR cspname;
-    DWORD csptype;
-    /* Certificate store name to use */
-    LPSTR storename;
-    LPSTR ssl_client_store;
-    /* System store flags */
-    DWORD store_flags;
-/* Lookup string meanings in load_private_key */
-#define CAPI_LU_SUBSTR 1 /* Substring of subject: uses "storename" */
-#define CAPI_LU_FNAME 2 /* Friendly name: uses storename */
-#define CAPI_LU_CONTNAME 3 /* Container name: uses cspname, keytype */
-    int lookup_method;
-/* Info to dump with dumpcerts option */
-#define CAPI_DMP_SUMMARY 0x1 /* Issuer and serial name strings */
-#define CAPI_DMP_FNAME 0x2 /* Friendly name */
-#define CAPI_DMP_FULL 0x4 /* Full X509_print dump */
-#define CAPI_DMP_PEM 0x8 /* Dump PEM format certificate */
-#define CAPI_DMP_PSKEY 0x10 /* Dump pseudo key (if possible) */
-#define CAPI_DMP_PKEYINFO 0x20 /* Dump key info (if possible) */
-    DWORD dump_flags;
-    int (*client_cert_select)(ENGINE *e, SSL *ssl, STACK_OF(X509) *certs);
-    CERTDLG certselectdlg;
-    GETCONSWIN getconswindow;
-};
-
-static CAPI_CTX *capi_ctx_new(void);
-static void capi_ctx_free(CAPI_CTX *ctx);
-static int capi_ctx_set_provname(CAPI_CTX *ctx, LPSTR pname, DWORD type,
-    int check);
-static int capi_ctx_set_provname_idx(CAPI_CTX *ctx, int idx);
-
-#define CAPI_CMD_LIST_CERTS ENGINE_CMD_BASE
-#define CAPI_CMD_LOOKUP_CERT (ENGINE_CMD_BASE + 1)
-#define CAPI_CMD_DEBUG_LEVEL (ENGINE_CMD_BASE + 2)
-#define CAPI_CMD_DEBUG_FILE (ENGINE_CMD_BASE + 3)
-#define CAPI_CMD_KEYTYPE (ENGINE_CMD_BASE + 4)
-#define CAPI_CMD_LIST_CSPS (ENGINE_CMD_BASE + 5)
-#define CAPI_CMD_SET_CSP_IDX (ENGINE_CMD_BASE + 6)
-#define CAPI_CMD_SET_CSP_NAME (ENGINE_CMD_BASE + 7)
-#define CAPI_CMD_SET_CSP_TYPE (ENGINE_CMD_BASE + 8)
-#define CAPI_CMD_LIST_CONTAINERS (ENGINE_CMD_BASE + 9)
-#define CAPI_CMD_LIST_OPTIONS (ENGINE_CMD_BASE + 10)
-#define CAPI_CMD_LOOKUP_METHOD (ENGINE_CMD_BASE + 11)
-#define CAPI_CMD_STORE_NAME (ENGINE_CMD_BASE + 12)
-#define CAPI_CMD_STORE_FLAGS (ENGINE_CMD_BASE + 13)
-
-static const ENGINE_CMD_DEFN capi_cmd_defns[] = {
-    { CAPI_CMD_LIST_CERTS,
-        "list_certs",
-        "List all certificates in store",
-        ENGINE_CMD_FLAG_NO_INPUT },
-    { CAPI_CMD_LOOKUP_CERT,
-        "lookup_cert",
-        "Lookup and output certificates",
-        ENGINE_CMD_FLAG_STRING },
-    { CAPI_CMD_DEBUG_LEVEL,
-        "debug_level",
-        "debug level (1=errors, 2=trace)",
-        ENGINE_CMD_FLAG_NUMERIC },
-    { CAPI_CMD_DEBUG_FILE,
-        "debug_file",
-        "debugging filename)",
-        ENGINE_CMD_FLAG_STRING },
-    { CAPI_CMD_KEYTYPE,
-        "key_type",
-        "Key type: 1=AT_KEYEXCHANGE (default), 2=AT_SIGNATURE",
-        ENGINE_CMD_FLAG_NUMERIC },
-    { CAPI_CMD_LIST_CSPS,
-        "list_csps",
-        "List all CSPs",
-        ENGINE_CMD_FLAG_NO_INPUT },
-    { CAPI_CMD_SET_CSP_IDX,
-        "csp_idx",
-        "Set CSP by index",
-        ENGINE_CMD_FLAG_NUMERIC },
-    { CAPI_CMD_SET_CSP_NAME,
-        "csp_name",
-        "Set CSP name, (default CSP used if not specified)",
-        ENGINE_CMD_FLAG_STRING },
-    { CAPI_CMD_SET_CSP_TYPE,
-        "csp_type",
-        "Set CSP type, (default RSA_PROV_FULL)",
-        ENGINE_CMD_FLAG_NUMERIC },
-    { CAPI_CMD_LIST_CONTAINERS,
-        "list_containers",
-        "list container names",
-        ENGINE_CMD_FLAG_NO_INPUT },
-    { CAPI_CMD_LIST_OPTIONS,
-        "list_options",
-        "Set list options (1=summary,2=friendly name, 4=full printout, 8=PEM output, 16=XXX, "
-        "32=private key info)",
-        ENGINE_CMD_FLAG_NUMERIC },
-    { CAPI_CMD_LOOKUP_METHOD,
-        "lookup_method",
-        "Set key lookup method (1=substring, 2=friendlyname, 3=container name)",
-        ENGINE_CMD_FLAG_NUMERIC },
-    { CAPI_CMD_STORE_NAME,
-        "store_name",
-        "certificate store name, default \"MY\"",
-        ENGINE_CMD_FLAG_STRING },
-    { CAPI_CMD_STORE_FLAGS,
-        "store_flags",
-        "Certificate store flags: 1 = system store",
-        ENGINE_CMD_FLAG_NUMERIC },
-
-    { 0, NULL, NULL, 0 }
-};
-
-static int capi_idx = -1;
-static int rsa_capi_idx = -1;
-static int dsa_capi_idx = -1;
-static int cert_capi_idx = -1;
-
-static int capi_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void))
-{
-    int ret = 1;
-    CAPI_CTX *ctx;
-    BIO *out;
-    LPSTR tmpstr;
-    if (capi_idx == -1) {
-        CAPIerr(CAPI_F_CAPI_CTRL, CAPI_R_ENGINE_NOT_INITIALIZED);
-        return 0;
-    }
-    ctx = ENGINE_get_ex_data(e, capi_idx);
-    out = BIO_new_fp(stdout, BIO_NOCLOSE);
-    if (out == NULL) {
-        CAPIerr(CAPI_F_CAPI_CTRL, CAPI_R_FILE_OPEN_ERROR);
-        return 0;
-    }
-    switch (cmd) {
-    case CAPI_CMD_LIST_CSPS:
-        ret = capi_list_providers(ctx, out);
-        break;
-
-    case CAPI_CMD_LIST_CERTS:
-        ret = capi_list_certs(ctx, out, NULL);
-        break;
-
-    case CAPI_CMD_LOOKUP_CERT:
-        ret = capi_list_certs(ctx, out, p);
-        break;
-
-    case CAPI_CMD_LIST_CONTAINERS:
-        ret = capi_list_containers(ctx, out);
-        break;
-
-    case CAPI_CMD_STORE_NAME:
-        tmpstr = OPENSSL_strdup(p);
-        if (tmpstr != NULL) {
-            OPENSSL_free(ctx->storename);
-            ctx->storename = tmpstr;
-            CAPI_trace(ctx, "Setting store name to %s\n", p);
-        } else {
-            ret = 0;
-        }
-        break;
-
-    case CAPI_CMD_STORE_FLAGS:
-        if (i & 1) {
-            ctx->store_flags |= CERT_SYSTEM_STORE_LOCAL_MACHINE;
-            ctx->store_flags &= ~CERT_SYSTEM_STORE_CURRENT_USER;
-        } else {
-            ctx->store_flags |= CERT_SYSTEM_STORE_CURRENT_USER;
-            ctx->store_flags &= ~CERT_SYSTEM_STORE_LOCAL_MACHINE;
-        }
-        CAPI_trace(ctx, "Setting flags to %d\n", i);
-        break;
-
-    case CAPI_CMD_DEBUG_LEVEL:
-        ctx->debug_level = (int)i;
-        CAPI_trace(ctx, "Setting debug level to %d\n", ctx->debug_level);
-        break;
-
-    case CAPI_CMD_DEBUG_FILE:
-        tmpstr = OPENSSL_strdup(p);
-        if (tmpstr != NULL) {
-            ctx->debug_file = tmpstr;
-            CAPI_trace(ctx, "Setting debug file to %s\n", ctx->debug_file);
-        } else {
-            ret = 0;
-        }
-        break;
-
-    case CAPI_CMD_KEYTYPE:
-        ctx->keytype = i;
-        CAPI_trace(ctx, "Setting key type to %d\n", ctx->keytype);
-        break;
-
-    case CAPI_CMD_SET_CSP_IDX:
-        ret = capi_ctx_set_provname_idx(ctx, i);
-        break;
-
-    case CAPI_CMD_LIST_OPTIONS:
-        ctx->dump_flags = i;
-        break;
-
-    case CAPI_CMD_LOOKUP_METHOD:
-        if (i < 1 || i > 3) {
-            CAPIerr(CAPI_F_CAPI_CTRL, CAPI_R_INVALID_LOOKUP_METHOD);
-            BIO_free(out);
-            return 0;
-        }
-        ctx->lookup_method = i;
-        break;
-
-    case CAPI_CMD_SET_CSP_NAME:
-        ret = capi_ctx_set_provname(ctx, p, ctx->csptype, 1);
-        break;
-
-    case CAPI_CMD_SET_CSP_TYPE:
-        ctx->csptype = i;
-        break;
-
-    default:
-        CAPIerr(CAPI_F_CAPI_CTRL, CAPI_R_UNKNOWN_COMMAND);
-        ret = 0;
-    }
-
-    BIO_free(out);
-    return ret;
-}
-
-static RSA_METHOD *capi_rsa_method = NULL;
-#ifndef OPENSSL_NO_DSA
-static DSA_METHOD *capi_dsa_method = NULL;
-#endif
-
-static int use_aes_csp = 0;
-static const WCHAR rsa_aes_cspname[] = L"Microsoft Enhanced RSA and AES Cryptographic Provider";
-static const WCHAR rsa_enh_cspname[] = L"Microsoft Enhanced Cryptographic Provider v1.0";
-
-static int capi_init(ENGINE *e)
-{
-    CAPI_CTX *ctx;
-    const RSA_METHOD *ossl_rsa_meth;
-#ifndef OPENSSL_NO_DSA
-    const DSA_METHOD *ossl_dsa_meth;
-#endif
-    HCRYPTPROV hprov;
-
-    if (capi_idx < 0) {
-        capi_idx = ENGINE_get_ex_new_index(0, NULL, NULL, NULL, 0);
-        if (capi_idx < 0) {
-            CAPIerr(CAPI_F_CAPI_INIT, ERR_R_ENGINE_LIB);
-            goto err;
-        }
-
-        cert_capi_idx = X509_get_ex_new_index(0, NULL, NULL, NULL, 0);
-
-        /* Setup RSA_METHOD */
-        rsa_capi_idx = RSA_get_ex_new_index(0, NULL, NULL, NULL, 0);
-        ossl_rsa_meth = RSA_PKCS1_OpenSSL();
-        if (!RSA_meth_set_pub_enc(capi_rsa_method,
-                RSA_meth_get_pub_enc(ossl_rsa_meth))
-            || !RSA_meth_set_pub_dec(capi_rsa_method,
-                RSA_meth_get_pub_dec(ossl_rsa_meth))
-            || !RSA_meth_set_priv_enc(capi_rsa_method, capi_rsa_priv_enc)
-            || !RSA_meth_set_priv_dec(capi_rsa_method, capi_rsa_priv_dec)
-            || !RSA_meth_set_mod_exp(capi_rsa_method,
-                RSA_meth_get_mod_exp(ossl_rsa_meth))
-            || !RSA_meth_set_bn_mod_exp(capi_rsa_method,
-                RSA_meth_get_bn_mod_exp(ossl_rsa_meth))
-            || !RSA_meth_set_finish(capi_rsa_method, capi_rsa_free)
-            || !RSA_meth_set_sign(capi_rsa_method, capi_rsa_sign)) {
-            CAPIerr(CAPI_F_CAPI_INIT, ERR_R_RSA_LIB);
-            goto err;
-        }
-
-#ifndef OPENSSL_NO_DSA
-        /* Setup DSA Method */
-        dsa_capi_idx = DSA_get_ex_new_index(0, NULL, NULL, NULL, 0);
-        ossl_dsa_meth = DSA_OpenSSL();
-        if (!DSA_meth_set_sign(capi_dsa_method, capi_dsa_do_sign)
-            || !DSA_meth_set_verify(capi_dsa_method,
-                DSA_meth_get_verify(ossl_dsa_meth))
-            || !DSA_meth_set_finish(capi_dsa_method, capi_dsa_free)
-            || !DSA_meth_set_mod_exp(capi_dsa_method,
-                DSA_meth_get_mod_exp(ossl_dsa_meth))
-            || !DSA_meth_set_bn_mod_exp(capi_dsa_method,
-                DSA_meth_get_bn_mod_exp(ossl_dsa_meth))) {
-            CAPIerr(CAPI_F_CAPI_INIT, ERR_R_DSA_LIB);
-            goto err;
-        }
-#endif
-    }
-
-    ctx = capi_ctx_new();
-    if (ctx == NULL) {
-        CAPIerr(CAPI_F_CAPI_INIT, ERR_R_CAPI_LIB);
-        goto err;
-    }
-
-    ENGINE_set_ex_data(e, capi_idx, ctx);
-
-#ifdef OPENSSL_CAPIENG_DIALOG
-    {
-        HMODULE cryptui = LoadLibrary(TEXT("CRYPTUI.DLL"));
-        HMODULE kernel = GetModuleHandle(TEXT("KERNEL32.DLL"));
-        if (cryptui)
-            ctx->certselectdlg = (CERTDLG)GetProcAddress(cryptui,
-                "CryptUIDlgSelectCertificateFromStore");
-        if (kernel)
-            ctx->getconswindow = (GETCONSWIN)GetProcAddress(kernel, "GetConsoleWindow");
-        if (cryptui && !OPENSSL_isservice())
-            ctx->client_cert_select = cert_select_dialog;
-    }
-#endif
-
-    /* See if there is RSA+AES CSP */
-    if (CryptAcquireContextW(&hprov, NULL, rsa_aes_cspname, PROV_RSA_AES,
-            CRYPT_VERIFYCONTEXT)) {
-        use_aes_csp = 1;
-        CryptReleaseContext(hprov, 0);
-    }
-
-    return 1;
-
-err:
-    return 0;
-}
-
-static int capi_destroy(ENGINE *e)
-{
-    RSA_meth_free(capi_rsa_method);
-    capi_rsa_method = NULL;
-#ifndef OPENSSL_NO_DSA
-    DSA_meth_free(capi_dsa_method);
-    capi_dsa_method = NULL;
-#endif
-    ERR_unload_CAPI_strings();
-    return 1;
-}
-
-static int capi_finish(ENGINE *e)
-{
-    CAPI_CTX *ctx;
-    ctx = ENGINE_get_ex_data(e, capi_idx);
-    capi_ctx_free(ctx);
-    ENGINE_set_ex_data(e, capi_idx, NULL);
-    return 1;
-}
-
-/*
- * CryptoAPI key application data. This contains a handle to the private key
- * container (for sign operations) and a handle to the key (for decrypt
- * operations).
- */
-
-struct CAPI_KEY_st {
-    /* Associated certificate context (if any) */
-    PCCERT_CONTEXT pcert;
-    HCRYPTPROV hprov;
-    HCRYPTKEY key;
-    DWORD keyspec;
-};
-
-static int bind_capi(ENGINE *e)
-{
-    capi_rsa_method = RSA_meth_new("CryptoAPI RSA method", 0);
-    if (capi_rsa_method == NULL)
-        return 0;
-#ifndef OPENSSL_NO_DSA
-    capi_dsa_method = DSA_meth_new("CryptoAPI DSA method", 0);
-    if (capi_dsa_method == NULL)
-        goto memerr;
-#endif
-    if (!ENGINE_set_id(e, engine_capi_id)
-        || !ENGINE_set_name(e, engine_capi_name)
-        || !ENGINE_set_flags(e, ENGINE_FLAGS_NO_REGISTER_ALL)
-        || !ENGINE_set_init_function(e, capi_init)
-        || !ENGINE_set_finish_function(e, capi_finish)
-        || !ENGINE_set_destroy_function(e, capi_destroy)
-        || !ENGINE_set_RSA(e, capi_rsa_method)
-#ifndef OPENSSL_NO_DSA
-        || !ENGINE_set_DSA(e, capi_dsa_method)
-#endif
-        || !ENGINE_set_load_privkey_function(e, capi_load_privkey)
-        || !ENGINE_set_load_ssl_client_cert_function(e,
-            capi_load_ssl_client_cert)
-        || !ENGINE_set_cmd_defns(e, capi_cmd_defns)
-        || !ENGINE_set_ctrl_function(e, capi_ctrl))
-        goto memerr;
-    ERR_load_CAPI_strings();
-
-    return 1;
-memerr:
-    RSA_meth_free(capi_rsa_method);
-    capi_rsa_method = NULL;
-#ifndef OPENSSL_NO_DSA
-    DSA_meth_free(capi_dsa_method);
-    capi_dsa_method = NULL;
-#endif
-    return 0;
-}
-
-#ifndef OPENSSL_NO_DYNAMIC_ENGINE
-static int bind_helper(ENGINE *e, const char *id)
-{
-    if (id && (strcmp(id, engine_capi_id) != 0))
-        return 0;
-    if (!bind_capi(e))
-        return 0;
-    return 1;
-}
-
-IMPLEMENT_DYNAMIC_CHECK_FN()
-IMPLEMENT_DYNAMIC_BIND_FN(bind_helper)
-#else
-static ENGINE *engine_capi(void)
-{
-    ENGINE *ret = ENGINE_new();
-    if (ret == NULL)
-        return NULL;
-    if (!bind_capi(ret)) {
-        ENGINE_free(ret);
-        return NULL;
-    }
-    return ret;
-}
-
-void engine_load_capi_int(void)
-{
-    /* Copied from eng_[openssl|dyn].c */
-    ENGINE *toadd = engine_capi();
-    if (!toadd)
-        return;
-    ERR_set_mark();
-    ENGINE_add(toadd);
-    /*
-     * If the "add" worked, it gets a structural reference. So either way, we
-     * release our just-created reference.
-     */
-    ENGINE_free(toadd);
-    /*
-     * If the "add" didn't work, it was probably a conflict because it was
-     * already added (eg. someone calling ENGINE_load_blah then calling
-     * ENGINE_load_builtin_engines() perhaps).
-     */
-    ERR_pop_to_mark();
-}
-#endif
-
-static int lend_tobn(BIGNUM *bn, unsigned char *bin, int binlen)
-{
-    int i;
-    /*
-     * Reverse buffer in place: since this is a keyblob structure that will
-     * be freed up after conversion anyway it doesn't matter if we change
-     * it.
-     */
-    for (i = 0; i < binlen / 2; i++) {
-        unsigned char c;
-        c = bin[i];
-        bin[i] = bin[binlen - i - 1];
-        bin[binlen - i - 1] = c;
-    }
-
-    if (!BN_bin2bn(bin, binlen, bn))
-        return 0;
-    return 1;
-}
-
-/* Given a CAPI_KEY get an EVP_PKEY structure */
-
-static EVP_PKEY *capi_get_pkey(ENGINE *eng, CAPI_KEY *key)
-{
-    unsigned char *pubkey = NULL;
-    DWORD len;
-    BLOBHEADER *bh;
-    RSA *rkey = NULL;
-    DSA *dkey = NULL;
-    EVP_PKEY *ret = NULL;
-    if (!CryptExportKey(key->key, 0, PUBLICKEYBLOB, 0, NULL, &len)) {
-        CAPIerr(CAPI_F_CAPI_GET_PKEY, CAPI_R_PUBKEY_EXPORT_LENGTH_ERROR);
-        capi_addlasterror();
-        return NULL;
-    }
-
-    pubkey = OPENSSL_malloc(len);
-
-    if (pubkey == NULL)
-        goto err;
-
-    if (!CryptExportKey(key->key, 0, PUBLICKEYBLOB, 0, pubkey, &len)) {
-        CAPIerr(CAPI_F_CAPI_GET_PKEY, CAPI_R_PUBKEY_EXPORT_ERROR);
-        capi_addlasterror();
-        goto err;
-    }
-
-    bh = (BLOBHEADER *)pubkey;
-    if (bh->bType != PUBLICKEYBLOB) {
-        CAPIerr(CAPI_F_CAPI_GET_PKEY, CAPI_R_INVALID_PUBLIC_KEY_BLOB);
-        goto err;
-    }
-    if (bh->aiKeyAlg == CALG_RSA_SIGN || bh->aiKeyAlg == CALG_RSA_KEYX) {
-        RSAPUBKEY *rp;
-        DWORD rsa_modlen;
-        BIGNUM *e = NULL, *n = NULL;
-        unsigned char *rsa_modulus;
-        rp = (RSAPUBKEY *)(bh + 1);
-        if (rp->magic != 0x31415352) {
-            char magstr[10];
-            BIO_snprintf(magstr, 10, "%lx", rp->magic);
-            CAPIerr(CAPI_F_CAPI_GET_PKEY,
-                CAPI_R_INVALID_RSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER);
-            ERR_add_error_data(2, "magic=0x", magstr);
-            goto err;
-        }
-        rsa_modulus = (unsigned char *)(rp + 1);
-        rkey = RSA_new_method(eng);
-        if (!rkey) {
-            CAPIerr(CAPI_F_CAPI_GET_PKEY, ERR_R_RSA_LIB);
-            goto err;
-        }
-
-        e = BN_new();
-        n = BN_new();
-
-        if (e == NULL || n == NULL) {
-            BN_free(e);
-            BN_free(n);
-            CAPIerr(CAPI_F_CAPI_GET_PKEY, ERR_R_BN_LIB);
-            goto err;
-        }
-
-        RSA_set0_key(rkey, n, e, NULL);
-
-        if (!BN_set_word(e, rp->pubexp)) {
-            CAPIerr(CAPI_F_CAPI_GET_PKEY, ERR_R_BN_LIB);
-            goto err;
-        }
-
-        rsa_modlen = rp->bitlen / 8;
-        if (!lend_tobn(n, rsa_modulus, rsa_modlen)) {
-            CAPIerr(CAPI_F_CAPI_GET_PKEY, ERR_R_BN_LIB);
-            goto err;
-        }
-
-        RSA_set_ex_data(rkey, rsa_capi_idx, key);
-
-        if ((ret = EVP_PKEY_new()) == NULL) {
-            CAPIerr(CAPI_F_CAPI_GET_PKEY, ERR_R_EVP_LIB);
-            goto err;
-        }
-
-        EVP_PKEY_assign_RSA(ret, rkey);
-        rkey = NULL;
-
-#ifndef OPENSSL_NO_DSA
-    } else if (bh->aiKeyAlg == CALG_DSS_SIGN) {
-        DSSPUBKEY *dp;
-        DWORD dsa_plen;
-        unsigned char *btmp;
-        BIGNUM *p, *q, *g, *pub_key;
-        dp = (DSSPUBKEY *)(bh + 1);
-        if (dp->magic != 0x31535344) {
-            char magstr[10];
-            BIO_snprintf(magstr, 10, "%lx", dp->magic);
-            CAPIerr(CAPI_F_CAPI_GET_PKEY,
-                CAPI_R_INVALID_DSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER);
-            ERR_add_error_data(2, "magic=0x", magstr);
-            goto err;
-        }
-        dsa_plen = dp->bitlen / 8;
-        btmp = (unsigned char *)(dp + 1);
-        dkey = DSA_new_method(eng);
-        if (!dkey) {
-            CAPIerr(CAPI_F_CAPI_GET_PKEY, ERR_R_DSA_LIB);
-            goto err;
-        }
-        p = BN_new();
-        q = BN_new();
-        g = BN_new();
-        pub_key = BN_new();
-        if (p == NULL || q == NULL || g == NULL || pub_key == NULL) {
-            BN_free(p);
-            BN_free(q);
-            BN_free(g);
-            BN_free(pub_key);
-            CAPIerr(CAPI_F_CAPI_GET_PKEY, ERR_R_BN_LIB);
-            goto err;
-        }
-        DSA_set0_pqg(dkey, p, q, g);
-        DSA_set0_key(dkey, pub_key, NULL);
-        if (!lend_tobn(p, btmp, dsa_plen)) {
-            CAPIerr(CAPI_F_CAPI_GET_PKEY, ERR_R_CAPI_LIB);
-            goto err;
-        }
-        btmp += dsa_plen;
-        if (!lend_tobn(q, btmp, 20)) {
-            CAPIerr(CAPI_F_CAPI_GET_PKEY, ERR_R_CAPI_LIB);
-            goto err;
-        }
-        btmp += 20;
-        if (!lend_tobn(g, btmp, dsa_plen)) {
-            CAPIerr(CAPI_F_CAPI_GET_PKEY, ERR_R_CAPI_LIB);
-            goto err;
-        }
-        btmp += dsa_plen;
-        if (!lend_tobn(pub_key, btmp, dsa_plen)) {
-            CAPIerr(CAPI_F_CAPI_GET_PKEY, ERR_R_CAPI_LIB);
-            goto err;
-        }
-        btmp += dsa_plen;
-
-        DSA_set_ex_data(dkey, dsa_capi_idx, key);
-
-        if ((ret = EVP_PKEY_new()) == NULL) {
-            CAPIerr(CAPI_F_CAPI_GET_PKEY, ERR_R_EVP_LIB);
-            goto err;
-        }
-
-        EVP_PKEY_assign_DSA(ret, dkey);
-        dkey = NULL;
-#endif
-    } else {
-        char algstr[10];
-        BIO_snprintf(algstr, 10, "%ux", bh->aiKeyAlg);
-        CAPIerr(CAPI_F_CAPI_GET_PKEY,
-            CAPI_R_UNSUPPORTED_PUBLIC_KEY_ALGORITHM);
-        ERR_add_error_data(2, "aiKeyAlg=0x", algstr);
-        goto err;
-    }
-
-err:
-    OPENSSL_free(pubkey);
-    if (!ret) {
-        RSA_free(rkey);
-#ifndef OPENSSL_NO_DSA
-        DSA_free(dkey);
-#endif
-    }
-
-    return ret;
-}
-
-static EVP_PKEY *capi_load_privkey(ENGINE *eng, const char *key_id,
-    UI_METHOD *ui_method, void *callback_data)
-{
-    CAPI_CTX *ctx;
-    CAPI_KEY *key;
-    EVP_PKEY *ret;
-    ctx = ENGINE_get_ex_data(eng, capi_idx);
-
-    if (!ctx) {
-        CAPIerr(CAPI_F_CAPI_LOAD_PRIVKEY, CAPI_R_CANT_FIND_CAPI_CONTEXT);
-        return NULL;
-    }
-
-    key = capi_find_key(ctx, key_id);
-
-    if (!key)
-        return NULL;
-
-    ret = capi_get_pkey(eng, key);
-
-    if (!ret)
-        capi_free_key(key);
-    return ret;
-}
-
-/* CryptoAPI RSA operations */
-
-int capi_rsa_priv_enc(int flen, const unsigned char *from,
-    unsigned char *to, RSA *rsa, int padding)
-{
-    CAPIerr(CAPI_F_CAPI_RSA_PRIV_ENC, CAPI_R_FUNCTION_NOT_SUPPORTED);
-    return -1;
-}
-
-int capi_rsa_sign(int dtype, const unsigned char *m, unsigned int m_len,
-    unsigned char *sigret, unsigned int *siglen, const RSA *rsa)
-{
-    ALG_ID alg;
-    HCRYPTHASH hash;
-    DWORD slen;
-    unsigned int i;
-    int ret = -1;
-    CAPI_KEY *capi_key;
-    CAPI_CTX *ctx;
-
-    ctx = ENGINE_get_ex_data(RSA_get0_engine(rsa), capi_idx);
-
-    CAPI_trace(ctx, "Called CAPI_rsa_sign()\n");
-
-    capi_key = RSA_get_ex_data(rsa, rsa_capi_idx);
-    if (!capi_key) {
-        CAPIerr(CAPI_F_CAPI_RSA_SIGN, CAPI_R_CANT_GET_KEY);
-        return -1;
-    }
-    /* Convert the signature type to a CryptoAPI algorithm ID */
-    switch (dtype) {
-    case NID_sha256:
-        alg = CALG_SHA_256;
-        break;
-
-    case NID_sha384:
-        alg = CALG_SHA_384;
-        break;
-
-    case NID_sha512:
-        alg = CALG_SHA_512;
-        break;
-
-    case NID_sha1:
-        alg = CALG_SHA1;
-        break;
-
-    case NID_md5:
-        alg = CALG_MD5;
-        break;
-
-    case NID_md5_sha1:
-        alg = CALG_SSL3_SHAMD5;
-        break;
-    default: {
-        char algstr[10];
-        BIO_snprintf(algstr, 10, "%x", dtype);
-        CAPIerr(CAPI_F_CAPI_RSA_SIGN, CAPI_R_UNSUPPORTED_ALGORITHM_NID);
-        ERR_add_error_data(2, "NID=0x", algstr);
-        return -1;
-    }
-    }
-
-    /* Create the hash object */
-    if (!CryptCreateHash(capi_key->hprov, alg, 0, 0, &hash)) {
-        CAPIerr(CAPI_F_CAPI_RSA_SIGN, CAPI_R_CANT_CREATE_HASH_OBJECT);
-        capi_addlasterror();
-        return -1;
-    }
-    /* Set the hash value to the value passed */
-
-    if (!CryptSetHashParam(hash, HP_HASHVAL, (unsigned char *)m, 0)) {
-        CAPIerr(CAPI_F_CAPI_RSA_SIGN, CAPI_R_CANT_SET_HASH_VALUE);
-        capi_addlasterror();
-        goto err;
-    }
-
-    /* Finally sign it */
-    slen = RSA_size(rsa);
-    if (!CryptSignHash(hash, capi_key->keyspec, NULL, 0, sigret, &slen)) {
-        CAPIerr(CAPI_F_CAPI_RSA_SIGN, CAPI_R_ERROR_SIGNING_HASH);
-        capi_addlasterror();
-        goto err;
-    } else {
-        ret = 1;
-        /* Inplace byte reversal of signature */
-        for (i = 0; i < slen / 2; i++) {
-            unsigned char c;
-            c = sigret[i];
-            sigret[i] = sigret[slen - i - 1];
-            sigret[slen - i - 1] = c;
-        }
-        *siglen = slen;
-    }
-
-    /* Now cleanup */
-
-err:
-    CryptDestroyHash(hash);
-
-    return ret;
-}
-
-int capi_rsa_priv_dec(int flen, const unsigned char *from,
-    unsigned char *to, RSA *rsa, int padding)
-{
-    int i;
-    unsigned char *tmpbuf;
-    CAPI_KEY *capi_key;
-    CAPI_CTX *ctx;
-    DWORD flags = 0;
-    DWORD dlen;
-
-    if (flen <= 0)
-        return flen;
-
-    ctx = ENGINE_get_ex_data(RSA_get0_engine(rsa), capi_idx);
-
-    CAPI_trace(ctx, "Called capi_rsa_priv_dec()\n");
-
-    capi_key = RSA_get_ex_data(rsa, rsa_capi_idx);
-    if (!capi_key) {
-        CAPIerr(CAPI_F_CAPI_RSA_PRIV_DEC, CAPI_R_CANT_GET_KEY);
-        return -1;
-    }
-
-    switch (padding) {
-    case RSA_PKCS1_PADDING:
-        /* Nothing to do */
-        break;
-#ifdef CRYPT_DECRYPT_RSA_NO_PADDING_CHECK
-    case RSA_NO_PADDING:
-        flags = CRYPT_DECRYPT_RSA_NO_PADDING_CHECK;
-        break;
-#endif
-    default: {
-        char errstr[10];
-        BIO_snprintf(errstr, 10, "%d", padding);
-        CAPIerr(CAPI_F_CAPI_RSA_PRIV_DEC, CAPI_R_UNSUPPORTED_PADDING);
-        ERR_add_error_data(2, "padding=", errstr);
-        return -1;
-    }
-    }
-
-    /* Create temp reverse order version of input */
-    if ((tmpbuf = OPENSSL_malloc(flen)) == NULL)
-        return -1;
-    for (i = 0; i < flen; i++)
-        tmpbuf[flen - i - 1] = from[i];
-
-    /* Finally decrypt it */
-    dlen = flen;
-    if (!CryptDecrypt(capi_key->key, 0, TRUE, flags, tmpbuf, &dlen)) {
-        CAPIerr(CAPI_F_CAPI_RSA_PRIV_DEC, CAPI_R_DECRYPT_ERROR);
-        capi_addlasterror();
-        OPENSSL_cleanse(tmpbuf, dlen);
-        OPENSSL_free(tmpbuf);
-        return -1;
-    } else {
-        memcpy(to, tmpbuf, (flen = (int)dlen));
-    }
-    OPENSSL_cleanse(tmpbuf, flen);
-    OPENSSL_free(tmpbuf);
-
-    return flen;
-}
-
-static int capi_rsa_free(RSA *rsa)
-{
-    CAPI_KEY *capi_key;
-    capi_key = RSA_get_ex_data(rsa, rsa_capi_idx);
-    capi_free_key(capi_key);
-    RSA_set_ex_data(rsa, rsa_capi_idx, 0);
-    return 1;
-}
-
-#ifndef OPENSSL_NO_DSA
-/* CryptoAPI DSA operations */
-
-static DSA_SIG *capi_dsa_do_sign(const unsigned char *digest, int dlen,
-    DSA *dsa)
-{
-    HCRYPTHASH hash;
-    DWORD slen;
-    DSA_SIG *ret = NULL;
-    CAPI_KEY *capi_key;
-    CAPI_CTX *ctx;
-    unsigned char csigbuf[40];
-
-    ctx = ENGINE_get_ex_data(DSA_get0_engine(dsa), capi_idx);
-
-    CAPI_trace(ctx, "Called CAPI_dsa_do_sign()\n");
-
-    capi_key = DSA_get_ex_data(dsa, dsa_capi_idx);
-
-    if (!capi_key) {
-        CAPIerr(CAPI_F_CAPI_DSA_DO_SIGN, CAPI_R_CANT_GET_KEY);
-        return NULL;
-    }
-
-    if (dlen != 20) {
-        CAPIerr(CAPI_F_CAPI_DSA_DO_SIGN, CAPI_R_INVALID_DIGEST_LENGTH);
-        return NULL;
-    }
-
-    /* Create the hash object */
-    if (!CryptCreateHash(capi_key->hprov, CALG_SHA1, 0, 0, &hash)) {
-        CAPIerr(CAPI_F_CAPI_DSA_DO_SIGN, CAPI_R_CANT_CREATE_HASH_OBJECT);
-        capi_addlasterror();
-        return NULL;
-    }
-
-    /* Set the hash value to the value passed */
-    if (!CryptSetHashParam(hash, HP_HASHVAL, (unsigned char *)digest, 0)) {
-        CAPIerr(CAPI_F_CAPI_DSA_DO_SIGN, CAPI_R_CANT_SET_HASH_VALUE);
-        capi_addlasterror();
-        goto err;
-    }
-
-    /* Finally sign it */
-    slen = sizeof(csigbuf);
-    if (!CryptSignHash(hash, capi_key->keyspec, NULL, 0, csigbuf, &slen)) {
-        CAPIerr(CAPI_F_CAPI_DSA_DO_SIGN, CAPI_R_ERROR_SIGNING_HASH);
-        capi_addlasterror();
-        goto err;
-    } else {
-        BIGNUM *r = BN_new(), *s = BN_new();
-
-        if (r == NULL || s == NULL
-            || !lend_tobn(r, csigbuf, 20)
-            || !lend_tobn(s, csigbuf + 20, 20)
-            || (ret = DSA_SIG_new()) == NULL) {
-            BN_free(r); /* BN_free checks for BIGNUM * being NULL */
-            BN_free(s);
-            goto err;
-        }
-        DSA_SIG_set0(ret, r, s);
-    }
-
-    /* Now cleanup */
-
-err:
-    OPENSSL_cleanse(csigbuf, 40);
-    CryptDestroyHash(hash);
-    return ret;
-}
-
-static int capi_dsa_free(DSA *dsa)
-{
-    CAPI_KEY *capi_key;
-    capi_key = DSA_get_ex_data(dsa, dsa_capi_idx);
-    capi_free_key(capi_key);
-    DSA_set_ex_data(dsa, dsa_capi_idx, 0);
-    return 1;
-}
-#endif
-
-static void capi_vtrace(CAPI_CTX *ctx, int level, char *format,
-    va_list argptr)
-{
-    BIO *out;
-
-    if (!ctx || (ctx->debug_level < level) || (!ctx->debug_file))
-        return;
-    out = BIO_new_file(ctx->debug_file, "a+");
-    if (out == NULL) {
-        CAPIerr(CAPI_F_CAPI_VTRACE, CAPI_R_FILE_OPEN_ERROR);
-        return;
-    }
-    BIO_vprintf(out, format, argptr);
-    BIO_free(out);
-}
-
-static void CAPI_trace(CAPI_CTX *ctx, char *format, ...)
-{
-    va_list args;
-    va_start(args, format);
-    capi_vtrace(ctx, CAPI_DBG_TRACE, format, args);
-    va_end(args);
-}
-
-static void capi_addlasterror(void)
-{
-    capi_adderror(GetLastError());
-}
-
-static void capi_adderror(DWORD err)
-{
-    char errstr[10];
-    BIO_snprintf(errstr, 10, "%lX", err);
-    ERR_add_error_data(2, "Error code= 0x", errstr);
-}
-
-static char *wide_to_asc(LPCWSTR wstr)
-{
-    char *str;
-    int len_0, sz;
-    size_t len_1;
-
-    if (!wstr)
-        return NULL;
-
-    len_1 = wcslen(wstr) + 1;
-
-    if (len_1 > INT_MAX) {
-        CAPIerr(CAPI_F_WIDE_TO_ASC, CAPI_R_FUNCTION_NOT_SUPPORTED);
-        return NULL;
-    }
-
-    len_0 = (int)len_1; /* WideCharToMultiByte expects int */
-    sz = WideCharToMultiByte(CP_ACP, 0, wstr, len_0, NULL, 0, NULL, NULL);
-    if (!sz) {
-        CAPIerr(CAPI_F_WIDE_TO_ASC, CAPI_R_WIN32_ERROR);
-        return NULL;
-    }
-    str = OPENSSL_malloc(sz);
-    if (str == NULL)
-        return NULL;
-    if (!WideCharToMultiByte(CP_ACP, 0, wstr, len_0, str, sz, NULL, NULL)) {
-        OPENSSL_free(str);
-        CAPIerr(CAPI_F_WIDE_TO_ASC, CAPI_R_WIN32_ERROR);
-        return NULL;
-    }
-    return str;
-}
-
-static int capi_get_provname(CAPI_CTX *ctx, LPSTR *pname, DWORD *ptype,
-    DWORD idx)
-{
-    DWORD len, err;
-    LPTSTR name;
-    CAPI_trace(ctx, "capi_get_provname, index=%d\n", idx);
-    if (!CryptEnumProviders(idx, NULL, 0, ptype, NULL, &len)) {
-        err = GetLastError();
-        if (err == ERROR_NO_MORE_ITEMS)
-            return 2;
-        CAPIerr(CAPI_F_CAPI_GET_PROVNAME, CAPI_R_CRYPTENUMPROVIDERS_ERROR);
-        capi_adderror(err);
-        return 0;
-    }
-    name = OPENSSL_malloc(len);
-    if (name == NULL)
-        return 0;
-    if (!CryptEnumProviders(idx, NULL, 0, ptype, name, &len)) {
-        err = GetLastError();
-        OPENSSL_free(name);
-        if (err == ERROR_NO_MORE_ITEMS)
-            return 2;
-        CAPIerr(CAPI_F_CAPI_GET_PROVNAME, CAPI_R_CRYPTENUMPROVIDERS_ERROR);
-        capi_adderror(err);
-        return 0;
-    }
-    if (sizeof(TCHAR) != sizeof(char)) {
-        *pname = wide_to_asc((WCHAR *)name);
-        OPENSSL_free(name);
-        if (*pname == NULL)
-            return 0;
-    } else {
-        *pname = (char *)name;
-    }
-    CAPI_trace(ctx, "capi_get_provname, returned name=%s, type=%d\n", *pname,
-        *ptype);
-
-    return 1;
-}
-
-static int capi_list_providers(CAPI_CTX *ctx, BIO *out)
-{
-    DWORD idx, ptype;
-    int ret;
-    LPSTR provname = NULL;
-    CAPI_trace(ctx, "capi_list_providers\n");
-    BIO_printf(out, "Available CSPs:\n");
-    for (idx = 0;; idx++) {
-        ret = capi_get_provname(ctx, &provname, &ptype, idx);
-        if (ret == 2)
-            break;
-        if (ret == 0)
-            break;
-        BIO_printf(out, "%lu. %s, type %lu\n", idx, provname, ptype);
-        OPENSSL_free(provname);
-    }
-    return 1;
-}
-
-static int capi_list_containers(CAPI_CTX *ctx, BIO *out)
-{
-    int ret = 1;
-    HCRYPTPROV hprov;
-    DWORD err, idx, flags, buflen = 0, clen;
-    LPSTR cname;
-    LPWSTR cspname = NULL;
-
-    CAPI_trace(ctx, "Listing containers CSP=%s, type = %d\n", ctx->cspname,
-        ctx->csptype);
-    if (ctx->cspname != NULL) {
-        if ((clen = MultiByteToWideChar(CP_ACP, 0, ctx->cspname, -1,
-                 NULL, 0))) {
-            cspname = alloca(clen * sizeof(WCHAR));
-            MultiByteToWideChar(CP_ACP, 0, ctx->cspname, -1, (WCHAR *)cspname,
-                clen);
-        }
-        if (cspname == NULL) {
-            CAPIerr(CAPI_F_CAPI_LIST_CONTAINERS, ERR_R_MALLOC_FAILURE);
-            capi_addlasterror();
-            return 0;
-        }
-    }
-    if (!CryptAcquireContextW(&hprov, NULL, cspname, ctx->csptype,
-            CRYPT_VERIFYCONTEXT)) {
-        CAPIerr(CAPI_F_CAPI_LIST_CONTAINERS,
-            CAPI_R_CRYPTACQUIRECONTEXT_ERROR);
-        capi_addlasterror();
-        return 0;
-    }
-    if (!CryptGetProvParam(hprov, PP_ENUMCONTAINERS, NULL, &buflen,
-            CRYPT_FIRST)) {
-        CAPIerr(CAPI_F_CAPI_LIST_CONTAINERS, CAPI_R_ENUMCONTAINERS_ERROR);
-        capi_addlasterror();
-        CryptReleaseContext(hprov, 0);
-        return 0;
-    }
-    CAPI_trace(ctx, "Got max container len %d\n", buflen);
-    if (buflen == 0)
-        buflen = 1024;
-    cname = OPENSSL_malloc(buflen);
-    if (cname == NULL)
-        goto err;
-
-    for (idx = 0;; idx++) {
-        clen = buflen;
-        cname[0] = 0;
-
-        if (idx == 0)
-            flags = CRYPT_FIRST;
-        else
-            flags = 0;
-        if (!CryptGetProvParam(hprov, PP_ENUMCONTAINERS, (BYTE *)cname,
-                &clen, flags)) {
-            err = GetLastError();
-            if (err == ERROR_NO_MORE_ITEMS)
-                goto done;
-            CAPIerr(CAPI_F_CAPI_LIST_CONTAINERS, CAPI_R_ENUMCONTAINERS_ERROR);
-            capi_adderror(err);
-            goto err;
-        }
-        CAPI_trace(ctx, "Container name %s, len=%d, index=%d, flags=%d\n",
-            cname, clen, idx, flags);
-        if (!cname[0] && (clen == buflen)) {
-            CAPI_trace(ctx, "Enumerate bug: using workaround\n");
-            goto done;
-        }
-        BIO_printf(out, "%lu. %s\n", idx, cname);
-    }
-err:
-
-    ret = 0;
-
-done:
-    OPENSSL_free(cname);
-    CryptReleaseContext(hprov, 0);
-
-    return ret;
-}
-
-static CRYPT_KEY_PROV_INFO *capi_get_prov_info(CAPI_CTX *ctx,
-    PCCERT_CONTEXT cert)
-{
-    DWORD len;
-    CRYPT_KEY_PROV_INFO *pinfo;
-
-    if (!CertGetCertificateContextProperty(cert, CERT_KEY_PROV_INFO_PROP_ID,
-            NULL, &len))
-        return NULL;
-    pinfo = OPENSSL_malloc(len);
-    if (pinfo == NULL)
-        return NULL;
-    if (!CertGetCertificateContextProperty(cert, CERT_KEY_PROV_INFO_PROP_ID,
-            pinfo, &len)) {
-        CAPIerr(CAPI_F_CAPI_GET_PROV_INFO,
-            CAPI_R_ERROR_GETTING_KEY_PROVIDER_INFO);
-        capi_addlasterror();
-        OPENSSL_free(pinfo);
-        return NULL;
-    }
-    return pinfo;
-}
-
-static void capi_dump_prov_info(CAPI_CTX *ctx, BIO *out,
-    CRYPT_KEY_PROV_INFO *pinfo)
-{
-    char *provname = NULL, *contname = NULL;
-
-    if (pinfo == NULL) {
-        BIO_printf(out, "  No Private Key\n");
-        return;
-    }
-    provname = wide_to_asc(pinfo->pwszProvName);
-    contname = wide_to_asc(pinfo->pwszContainerName);
-    if (provname == NULL || contname == NULL)
-        goto err;
-
-    BIO_printf(out, "  Private Key Info:\n");
-    BIO_printf(out, "    Provider Name:  %s, Provider Type %lu\n", provname,
-        pinfo->dwProvType);
-    BIO_printf(out, "    Container Name: %s, Key Type %lu\n", contname,
-        pinfo->dwKeySpec);
-err:
-    OPENSSL_free(provname);
-    OPENSSL_free(contname);
-}
-
-static char *capi_cert_get_fname(CAPI_CTX *ctx, PCCERT_CONTEXT cert)
-{
-    LPWSTR wfname;
-    DWORD dlen;
-
-    CAPI_trace(ctx, "capi_cert_get_fname\n");
-    if (!CertGetCertificateContextProperty(cert, CERT_FRIENDLY_NAME_PROP_ID,
-            NULL, &dlen))
-        return NULL;
-    wfname = OPENSSL_malloc(dlen);
-    if (wfname == NULL)
-        return NULL;
-    if (CertGetCertificateContextProperty(cert, CERT_FRIENDLY_NAME_PROP_ID,
-            wfname, &dlen)) {
-        char *fname = wide_to_asc(wfname);
-        OPENSSL_free(wfname);
-        return fname;
-    }
-    CAPIerr(CAPI_F_CAPI_CERT_GET_FNAME, CAPI_R_ERROR_GETTING_FRIENDLY_NAME);
-    capi_addlasterror();
-
-    OPENSSL_free(wfname);
-    return NULL;
-}
-
-static void capi_dump_cert(CAPI_CTX *ctx, BIO *out, PCCERT_CONTEXT cert)
-{
-    X509 *x;
-    const unsigned char *p;
-    unsigned long flags = ctx->dump_flags;
-    if (flags & CAPI_DMP_FNAME) {
-        char *fname;
-        fname = capi_cert_get_fname(ctx, cert);
-        if (fname) {
-            BIO_printf(out, "  Friendly Name \"%s\"\n", fname);
-            OPENSSL_free(fname);
-        } else {
-            BIO_printf(out, "  <No Friendly Name>\n");
-        }
-    }
-
-    p = cert->pbCertEncoded;
-    x = d2i_X509(NULL, &p, cert->cbCertEncoded);
-    if (!x)
-        BIO_printf(out, "  <Can't parse certificate>\n");
-    if (flags & CAPI_DMP_SUMMARY) {
-        BIO_printf(out, "  Subject: ");
-        X509_NAME_print_ex(out, X509_get_subject_name(x), 0, XN_FLAG_ONELINE);
-        BIO_printf(out, "\n  Issuer: ");
-        X509_NAME_print_ex(out, X509_get_issuer_name(x), 0, XN_FLAG_ONELINE);
-        BIO_printf(out, "\n");
-    }
-    if (flags & CAPI_DMP_FULL)
-        X509_print_ex(out, x, XN_FLAG_ONELINE, 0);
-
-    if (flags & CAPI_DMP_PKEYINFO) {
-        CRYPT_KEY_PROV_INFO *pinfo;
-        pinfo = capi_get_prov_info(ctx, cert);
-        capi_dump_prov_info(ctx, out, pinfo);
-        OPENSSL_free(pinfo);
-    }
-
-    if (flags & CAPI_DMP_PEM)
-        PEM_write_bio_X509(out, x);
-    X509_free(x);
-}
-
-static HCERTSTORE capi_open_store(CAPI_CTX *ctx, char *storename)
-{
-    HCERTSTORE hstore;
-
-    if (!storename)
-        storename = ctx->storename;
-    if (!storename)
-        storename = "MY";
-    CAPI_trace(ctx, "Opening certificate store %s\n", storename);
-
-    hstore = CertOpenStore(CERT_STORE_PROV_SYSTEM_A, 0, 0,
-        ctx->store_flags, storename);
-    if (!hstore) {
-        CAPIerr(CAPI_F_CAPI_OPEN_STORE, CAPI_R_ERROR_OPENING_STORE);
-        capi_addlasterror();
-    }
-    return hstore;
-}
-
-int capi_list_certs(CAPI_CTX *ctx, BIO *out, char *id)
-{
-    char *storename;
-    int idx;
-    int ret = 1;
-    HCERTSTORE hstore;
-    PCCERT_CONTEXT cert = NULL;
-
-    storename = ctx->storename;
-    if (!storename)
-        storename = "MY";
-    CAPI_trace(ctx, "Listing certs for store %s\n", storename);
-
-    hstore = capi_open_store(ctx, storename);
-    if (!hstore)
-        return 0;
-    if (id) {
-        cert = capi_find_cert(ctx, id, hstore);
-        if (!cert) {
-            ret = 0;
-            goto err;
-        }
-        capi_dump_cert(ctx, out, cert);
-        CertFreeCertificateContext(cert);
-    } else {
-        for (idx = 0;; idx++) {
-            cert = CertEnumCertificatesInStore(hstore, cert);
-            if (!cert)
-                break;
-            BIO_printf(out, "Certificate %d\n", idx);
-            capi_dump_cert(ctx, out, cert);
-        }
-    }
-err:
-    CertCloseStore(hstore, 0);
-    return ret;
-}
-
-static PCCERT_CONTEXT capi_find_cert(CAPI_CTX *ctx, const char *id,
-    HCERTSTORE hstore)
-{
-    PCCERT_CONTEXT cert = NULL;
-    char *fname = NULL;
-    int match;
-    switch (ctx->lookup_method) {
-    case CAPI_LU_SUBSTR:
-        return CertFindCertificateInStore(hstore, X509_ASN_ENCODING, 0,
-            CERT_FIND_SUBJECT_STR_A, id, NULL);
-    case CAPI_LU_FNAME:
-        for (;;) {
-            cert = CertEnumCertificatesInStore(hstore, cert);
-            if (!cert)
-                return NULL;
-            fname = capi_cert_get_fname(ctx, cert);
-            if (fname) {
-                if (strcmp(fname, id))
-                    match = 0;
-                else
-                    match = 1;
-                OPENSSL_free(fname);
-                if (match)
-                    return cert;
-            }
-        }
-    default:
-        return NULL;
-    }
-}
-
-static CAPI_KEY *capi_get_key(CAPI_CTX *ctx, const WCHAR *contname,
-    const WCHAR *provname, DWORD ptype,
-    DWORD keyspec)
-{
-    DWORD dwFlags = 0;
-    CAPI_KEY *key = OPENSSL_malloc(sizeof(*key));
-
-    if (key == NULL)
-        return NULL;
-    /* If PROV_RSA_AES supported use it instead */
-    if (ptype == PROV_RSA_FULL && use_aes_csp && wcscmp(provname, rsa_enh_cspname) == 0) {
-        provname = rsa_aes_cspname;
-        ptype = PROV_RSA_AES;
-    }
-    if (ctx && ctx->debug_level >= CAPI_DBG_TRACE && ctx->debug_file) {
-        /*
-         * above 'if' is [complementary] copy from CAPI_trace and serves
-         * as optimization to minimize [below] malloc-ations
-         */
-        char *_contname = wide_to_asc(contname);
-        char *_provname = wide_to_asc(provname);
-
-        CAPI_trace(ctx, "capi_get_key, contname=%s, provname=%s, type=%d\n",
-            _contname, _provname, ptype);
-        OPENSSL_free(_provname);
-        OPENSSL_free(_contname);
-    }
-    if (ctx->store_flags & CERT_SYSTEM_STORE_LOCAL_MACHINE)
-        dwFlags = CRYPT_MACHINE_KEYSET;
-    if (!CryptAcquireContextW(&key->hprov, contname, provname, ptype,
-            dwFlags)) {
-        CAPIerr(CAPI_F_CAPI_GET_KEY, CAPI_R_CRYPTACQUIRECONTEXT_ERROR);
-        capi_addlasterror();
-        goto err;
-    }
-    if (!CryptGetUserKey(key->hprov, keyspec, &key->key)) {
-        CAPIerr(CAPI_F_CAPI_GET_KEY, CAPI_R_GETUSERKEY_ERROR);
-        capi_addlasterror();
-        CryptReleaseContext(key->hprov, 0);
-        goto err;
-    }
-    key->keyspec = keyspec;
-    key->pcert = NULL;
-    return key;
-
-err:
-    OPENSSL_free(key);
-    return NULL;
-}
-
-static CAPI_KEY *capi_get_cert_key(CAPI_CTX *ctx, PCCERT_CONTEXT cert)
-{
-    CAPI_KEY *key = NULL;
-    CRYPT_KEY_PROV_INFO *pinfo = NULL;
-
-    pinfo = capi_get_prov_info(ctx, cert);
-
-    if (pinfo != NULL)
-        key = capi_get_key(ctx, pinfo->pwszContainerName, pinfo->pwszProvName,
-            pinfo->dwProvType, pinfo->dwKeySpec);
-
-    OPENSSL_free(pinfo);
-    return key;
-}
-
-CAPI_KEY *capi_find_key(CAPI_CTX *ctx, const char *id)
-{
-    PCCERT_CONTEXT cert;
-    HCERTSTORE hstore;
-    CAPI_KEY *key = NULL;
-
-    switch (ctx->lookup_method) {
-    case CAPI_LU_SUBSTR:
-    case CAPI_LU_FNAME:
-        hstore = capi_open_store(ctx, NULL);
-        if (!hstore)
-            return NULL;
-        cert = capi_find_cert(ctx, id, hstore);
-        if (cert) {
-            key = capi_get_cert_key(ctx, cert);
-            CertFreeCertificateContext(cert);
-        }
-        CertCloseStore(hstore, 0);
-        break;
-
-    case CAPI_LU_CONTNAME: {
-        WCHAR *contname, *provname;
-        DWORD len;
-
-        if ((len = MultiByteToWideChar(CP_ACP, 0, id, -1, NULL, 0)) && (contname = alloca(len * sizeof(WCHAR)), MultiByteToWideChar(CP_ACP, 0, id, -1, contname, len)) && (len = MultiByteToWideChar(CP_ACP, 0, ctx->cspname, -1, NULL, 0)) && (provname = alloca(len * sizeof(WCHAR)), MultiByteToWideChar(CP_ACP, 0, ctx->cspname, -1, provname, len)))
-            key = capi_get_key(ctx, contname, provname,
-                ctx->csptype, ctx->keytype);
-    } break;
-    }
-
-    return key;
-}
-
-void capi_free_key(CAPI_KEY *key)
-{
-    if (!key)
-        return;
-    CryptDestroyKey(key->key);
-    CryptReleaseContext(key->hprov, 0);
-    if (key->pcert)
-        CertFreeCertificateContext(key->pcert);
-    OPENSSL_free(key);
-}
-
-/* Initialize a CAPI_CTX structure */
-
-static CAPI_CTX *capi_ctx_new(void)
-{
-    CAPI_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
-
-    if (ctx == NULL)
-        return NULL;
-    ctx->csptype = PROV_RSA_FULL;
-    ctx->dump_flags = CAPI_DMP_SUMMARY | CAPI_DMP_FNAME;
-    ctx->keytype = AT_KEYEXCHANGE;
-    ctx->store_flags = CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_READONLY_FLAG | CERT_SYSTEM_STORE_CURRENT_USER;
-    ctx->lookup_method = CAPI_LU_SUBSTR;
-    ctx->client_cert_select = cert_select_simple;
-    return ctx;
-}
-
-static void capi_ctx_free(CAPI_CTX *ctx)
-{
-    CAPI_trace(ctx, "Calling capi_ctx_free with %lx\n", ctx);
-    if (!ctx)
-        return;
-    OPENSSL_free(ctx->cspname);
-    OPENSSL_free(ctx->debug_file);
-    OPENSSL_free(ctx->storename);
-    OPENSSL_free(ctx->ssl_client_store);
-    OPENSSL_free(ctx);
-}
-
-static int capi_ctx_set_provname(CAPI_CTX *ctx, LPSTR pname, DWORD type,
-    int check)
-{
-    LPSTR tmpcspname;
-
-    CAPI_trace(ctx, "capi_ctx_set_provname, name=%s, type=%d\n", pname, type);
-    if (check) {
-        HCRYPTPROV hprov;
-        LPWSTR name = NULL;
-        DWORD len;
-
-        if ((len = MultiByteToWideChar(CP_ACP, 0, pname, -1, NULL, 0))) {
-            name = alloca(len * sizeof(WCHAR));
-            MultiByteToWideChar(CP_ACP, 0, pname, -1, (WCHAR *)name, len);
-        }
-        if (name == NULL || !CryptAcquireContextW(&hprov, NULL, name, type, CRYPT_VERIFYCONTEXT)) {
-            CAPIerr(CAPI_F_CAPI_CTX_SET_PROVNAME,
-                CAPI_R_CRYPTACQUIRECONTEXT_ERROR);
-            capi_addlasterror();
-            return 0;
-        }
-        CryptReleaseContext(hprov, 0);
-    }
-    tmpcspname = OPENSSL_strdup(pname);
-    if (tmpcspname == NULL)
-        return 0;
-    OPENSSL_free(ctx->cspname);
-    ctx->cspname = tmpcspname;
-    ctx->csptype = type;
-    return 1;
-}
-
-static int capi_ctx_set_provname_idx(CAPI_CTX *ctx, int idx)
-{
-    LPSTR pname;
-    DWORD type;
-    int res;
-    if (capi_get_provname(ctx, &pname, &type, idx) != 1)
-        return 0;
-    res = capi_ctx_set_provname(ctx, pname, type, 0);
-    OPENSSL_free(pname);
-    return res;
-}
-
-static int cert_issuer_match(STACK_OF(X509_NAME) *ca_dn, X509 *x)
-{
-    int i;
-    X509_NAME *nm;
-    /* Special case: empty list: match anything */
-    if (sk_X509_NAME_num(ca_dn) <= 0)
-        return 1;
-    for (i = 0; i < sk_X509_NAME_num(ca_dn); i++) {
-        nm = sk_X509_NAME_value(ca_dn, i);
-        if (!X509_NAME_cmp(nm, X509_get_issuer_name(x)))
-            return 1;
-    }
-    return 0;
-}
-
-static int capi_load_ssl_client_cert(ENGINE *e, SSL *ssl,
-    STACK_OF(X509_NAME) *ca_dn, X509 **pcert,
-    EVP_PKEY **pkey, STACK_OF(X509) **pother,
-    UI_METHOD *ui_method,
-    void *callback_data)
-{
-    STACK_OF(X509) *certs = NULL;
-    X509 *x;
-    char *storename;
-    const unsigned char *p;
-    int i, client_cert_idx;
-    HCERTSTORE hstore;
-    PCCERT_CONTEXT cert = NULL, excert = NULL;
-    CAPI_CTX *ctx;
-    CAPI_KEY *key;
-    ctx = ENGINE_get_ex_data(e, capi_idx);
-
-    *pcert = NULL;
-    *pkey = NULL;
-
-    storename = ctx->ssl_client_store;
-    if (!storename)
-        storename = "MY";
-
-    hstore = capi_open_store(ctx, storename);
-    if (!hstore)
-        return 0;
-    /* Enumerate all certificates collect any matches */
-    for (i = 0;; i++) {
-        cert = CertEnumCertificatesInStore(hstore, cert);
-        if (!cert)
-            break;
-        p = cert->pbCertEncoded;
-        x = d2i_X509(NULL, &p, cert->cbCertEncoded);
-        if (!x) {
-            CAPI_trace(ctx, "Can't Parse Certificate %d\n", i);
-            continue;
-        }
-        if (cert_issuer_match(ca_dn, x)
-            && X509_check_purpose(x, X509_PURPOSE_SSL_CLIENT, 0)) {
-            key = capi_get_cert_key(ctx, cert);
-            if (!key) {
-                X509_free(x);
-                continue;
-            }
-            /*
-             * Match found: attach extra data to it so we can retrieve the
-             * key later.
-             */
-            excert = CertDuplicateCertificateContext(cert);
-            key->pcert = excert;
-            X509_set_ex_data(x, cert_capi_idx, key);
-
-            if (!certs)
-                certs = sk_X509_new_null();
-
-            if (!sk_X509_push(certs, x)) {
-                X509_free(x);
-                continue;
-            }
-        } else {
-            X509_free(x);
-        }
-    }
-
-    if (cert)
-        CertFreeCertificateContext(cert);
-    if (hstore)
-        CertCloseStore(hstore, 0);
-
-    if (!certs)
-        return 0;
-
-    /* Select the appropriate certificate */
-
-    client_cert_idx = ctx->client_cert_select(e, ssl, certs);
-
-    /* Set the selected certificate and free the rest */
-
-    for (i = 0; i < sk_X509_num(certs); i++) {
-        x = sk_X509_value(certs, i);
-        if (i == client_cert_idx)
-            *pcert = x;
-        else {
-            key = X509_get_ex_data(x, cert_capi_idx);
-            capi_free_key(key);
-            X509_free(x);
-        }
-    }
-
-    sk_X509_free(certs);
-
-    if (*pcert == NULL)
-        return 0;
-
-    /* Setup key for selected certificate */
-
-    key = X509_get_ex_data(*pcert, cert_capi_idx);
-    *pkey = capi_get_pkey(e, key);
-    X509_set_ex_data(*pcert, cert_capi_idx, NULL);
-
-    return 1;
-}
-
-/* Simple client cert selection function: always select first */
-
-static int cert_select_simple(ENGINE *e, SSL *ssl, STACK_OF(X509) *certs)
-{
-    return 0;
-}
-
-#ifdef OPENSSL_CAPIENG_DIALOG
-
-/*
- * More complex cert selection function, using standard function
- * CryptUIDlgSelectCertificateFromStore() to produce a dialog box.
- */
-
-/*
- * Definitions which are in cryptuiapi.h but this is not present in older
- * versions of headers.
- */
-
-#ifndef CRYPTUI_SELECT_LOCATION_COLUMN
-#define CRYPTUI_SELECT_LOCATION_COLUMN 0x000000010
-#define CRYPTUI_SELECT_INTENDEDUSE_COLUMN 0x000000004
-#endif
-
-#define dlg_title L"OpenSSL Application SSL Client Certificate Selection"
-#define dlg_prompt L"Select a certificate to use for authentication"
-#define dlg_columns                \
-    CRYPTUI_SELECT_LOCATION_COLUMN \
-    | CRYPTUI_SELECT_INTENDEDUSE_COLUMN
-
-static int cert_select_dialog(ENGINE *e, SSL *ssl, STACK_OF(X509) *certs)
-{
-    X509 *x;
-    HCERTSTORE dstore;
-    PCCERT_CONTEXT cert;
-    CAPI_CTX *ctx;
-    CAPI_KEY *key;
-    HWND hwnd;
-    int i, idx = -1;
-    if (sk_X509_num(certs) == 1)
-        return 0;
-    ctx = ENGINE_get_ex_data(e, capi_idx);
-    /* Create an in memory store of certificates */
-    dstore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
-        CERT_STORE_CREATE_NEW_FLAG, NULL);
-    if (!dstore) {
-        CAPIerr(CAPI_F_CERT_SELECT_DIALOG, CAPI_R_ERROR_CREATING_STORE);
-        capi_addlasterror();
-        goto err;
-    }
-    /* Add all certificates to store */
-    for (i = 0; i < sk_X509_num(certs); i++) {
-        x = sk_X509_value(certs, i);
-        key = X509_get_ex_data(x, cert_capi_idx);
-
-        if (!CertAddCertificateContextToStore(dstore, key->pcert,
-                CERT_STORE_ADD_NEW, NULL)) {
-            CAPIerr(CAPI_F_CERT_SELECT_DIALOG, CAPI_R_ERROR_ADDING_CERT);
-            capi_addlasterror();
-            goto err;
-        }
-    }
-    hwnd = GetForegroundWindow();
-    if (!hwnd)
-        hwnd = GetActiveWindow();
-    if (!hwnd && ctx->getconswindow)
-        hwnd = ctx->getconswindow();
-    /* Call dialog to select one */
-    cert = ctx->certselectdlg(dstore, hwnd, dlg_title, dlg_prompt,
-        dlg_columns, 0, NULL);
-
-    /* Find matching cert from list */
-    if (cert) {
-        for (i = 0; i < sk_X509_num(certs); i++) {
-            x = sk_X509_value(certs, i);
-            key = X509_get_ex_data(x, cert_capi_idx);
-            if (CertCompareCertificate(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, cert->pCertInfo,
-                    key->pcert->pCertInfo)) {
-                idx = i;
-                break;
-            }
-        }
-    }
-
-err:
-    if (dstore)
-        CertCloseStore(dstore, 0);
-    return idx;
-}
-#endif
-
-#else /* !__COMPILE_CAPIENG */
-#include <openssl/engine.h>
-#ifndef OPENSSL_NO_DYNAMIC_ENGINE
-OPENSSL_EXPORT
-int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns);
-OPENSSL_EXPORT
-int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns)
-{
-    return 0;
-}
-
-IMPLEMENT_DYNAMIC_CHECK_FN()
-#else
-void engine_load_capi_int(void);
-void engine_load_capi_int(void)
-{
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/engines/e_capi.ec b/deps/openssl/openssl/engines/e_capi.ec
deleted file mode 100644
index d9c7aa510fd..00000000000
--- a/deps/openssl/openssl/engines/e_capi.ec
+++ /dev/null
@@ -1,3 +0,0 @@
-# The INPUT HEADER is scanned for declarations
-# LIBNAME       INPUT HEADER                    ERROR-TABLE FILE
-L CAPI          e_capi_err.h                    e_capi_err.c
diff --git a/deps/openssl/openssl/engines/e_capi.txt b/deps/openssl/openssl/engines/e_capi.txt
deleted file mode 100644
index 58f4a159623..00000000000
--- a/deps/openssl/openssl/engines/e_capi.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 1999-2023 The OpenSSL Project Authors. All Rights Reserved.
-#
-# Licensed under the Apache License 2.0 (the "License").  You may not use
-# this file except in compliance with the License.  You can obtain a copy
-# in the file LICENSE in the source distribution or at
-# https://www.openssl.org/source/license.html
-
-#Reason codes
-CAPI_R_CANT_CREATE_HASH_OBJECT:100:can't create hash object
-CAPI_R_CANT_FIND_CAPI_CONTEXT:101:can't find capi context
-CAPI_R_CANT_GET_KEY:102:can't get key
-CAPI_R_CANT_SET_HASH_VALUE:103:can't set hash value
-CAPI_R_CRYPTACQUIRECONTEXT_ERROR:104:cryptacquirecontext error
-CAPI_R_CRYPTENUMPROVIDERS_ERROR:105:cryptenumproviders error
-CAPI_R_DECRYPT_ERROR:106:decrypt error
-CAPI_R_ENGINE_NOT_INITIALIZED:107:engine not initialized
-CAPI_R_ENUMCONTAINERS_ERROR:108:enumcontainers error
-CAPI_R_ERROR_ADDING_CERT:109:error adding cert
-CAPI_R_ERROR_CREATING_STORE:110:error creating store
-CAPI_R_ERROR_GETTING_FRIENDLY_NAME:111:error getting friendly name
-CAPI_R_ERROR_GETTING_KEY_PROVIDER_INFO:112:error getting key provider info
-CAPI_R_ERROR_OPENING_STORE:113:error opening store
-CAPI_R_ERROR_SIGNING_HASH:114:error signing hash
-CAPI_R_FILE_OPEN_ERROR:115:file open error
-CAPI_R_FUNCTION_NOT_SUPPORTED:116:function not supported
-CAPI_R_GETUSERKEY_ERROR:117:getuserkey error
-CAPI_R_INVALID_DIGEST_LENGTH:118:invalid digest length
-CAPI_R_INVALID_DSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER:119:\
-	invalid dsa public key blob magic number
-CAPI_R_INVALID_LOOKUP_METHOD:120:invalid lookup method
-CAPI_R_INVALID_PUBLIC_KEY_BLOB:121:invalid public key blob
-CAPI_R_INVALID_RSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER:122:\
-	invalid rsa public key blob magic number
-CAPI_R_PUBKEY_EXPORT_ERROR:123:pubkey export error
-CAPI_R_PUBKEY_EXPORT_LENGTH_ERROR:124:pubkey export length error
-CAPI_R_UNKNOWN_COMMAND:125:unknown command
-CAPI_R_UNSUPPORTED_ALGORITHM_NID:126:unsupported algorithm nid
-CAPI_R_UNSUPPORTED_PADDING:127:unsupported padding
-CAPI_R_UNSUPPORTED_PUBLIC_KEY_ALGORITHM:128:unsupported public key algorithm
-CAPI_R_WIN32_ERROR:129:win32 error
diff --git a/deps/openssl/openssl/engines/e_capi_err.c b/deps/openssl/openssl/engines/e_capi_err.c
deleted file mode 100644
index 3a7782958ab..00000000000
--- a/deps/openssl/openssl/engines/e_capi_err.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include "e_capi_err.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static ERR_STRING_DATA CAPI_str_reasons[] = {
-    { ERR_PACK(0, 0, CAPI_R_CANT_CREATE_HASH_OBJECT), "can't create hash object" },
-    { ERR_PACK(0, 0, CAPI_R_CANT_FIND_CAPI_CONTEXT), "can't find capi context" },
-    { ERR_PACK(0, 0, CAPI_R_CANT_GET_KEY), "can't get key" },
-    { ERR_PACK(0, 0, CAPI_R_CANT_SET_HASH_VALUE), "can't set hash value" },
-    { ERR_PACK(0, 0, CAPI_R_CRYPTACQUIRECONTEXT_ERROR),
-        "cryptacquirecontext error" },
-    { ERR_PACK(0, 0, CAPI_R_CRYPTENUMPROVIDERS_ERROR),
-        "cryptenumproviders error" },
-    { ERR_PACK(0, 0, CAPI_R_DECRYPT_ERROR), "decrypt error" },
-    { ERR_PACK(0, 0, CAPI_R_ENGINE_NOT_INITIALIZED), "engine not initialized" },
-    { ERR_PACK(0, 0, CAPI_R_ENUMCONTAINERS_ERROR), "enumcontainers error" },
-    { ERR_PACK(0, 0, CAPI_R_ERROR_ADDING_CERT), "error adding cert" },
-    { ERR_PACK(0, 0, CAPI_R_ERROR_CREATING_STORE), "error creating store" },
-    { ERR_PACK(0, 0, CAPI_R_ERROR_GETTING_FRIENDLY_NAME),
-        "error getting friendly name" },
-    { ERR_PACK(0, 0, CAPI_R_ERROR_GETTING_KEY_PROVIDER_INFO),
-        "error getting key provider info" },
-    { ERR_PACK(0, 0, CAPI_R_ERROR_OPENING_STORE), "error opening store" },
-    { ERR_PACK(0, 0, CAPI_R_ERROR_SIGNING_HASH), "error signing hash" },
-    { ERR_PACK(0, 0, CAPI_R_FILE_OPEN_ERROR), "file open error" },
-    { ERR_PACK(0, 0, CAPI_R_FUNCTION_NOT_SUPPORTED), "function not supported" },
-    { ERR_PACK(0, 0, CAPI_R_GETUSERKEY_ERROR), "getuserkey error" },
-    { ERR_PACK(0, 0, CAPI_R_INVALID_DIGEST_LENGTH), "invalid digest length" },
-    { ERR_PACK(0, 0, CAPI_R_INVALID_DSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER),
-        "invalid dsa public key blob magic number" },
-    { ERR_PACK(0, 0, CAPI_R_INVALID_LOOKUP_METHOD), "invalid lookup method" },
-    { ERR_PACK(0, 0, CAPI_R_INVALID_PUBLIC_KEY_BLOB), "invalid public key blob" },
-    { ERR_PACK(0, 0, CAPI_R_INVALID_RSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER),
-        "invalid rsa public key blob magic number" },
-    { ERR_PACK(0, 0, CAPI_R_PUBKEY_EXPORT_ERROR), "pubkey export error" },
-    { ERR_PACK(0, 0, CAPI_R_PUBKEY_EXPORT_LENGTH_ERROR),
-        "pubkey export length error" },
-    { ERR_PACK(0, 0, CAPI_R_UNKNOWN_COMMAND), "unknown command" },
-    { ERR_PACK(0, 0, CAPI_R_UNSUPPORTED_ALGORITHM_NID),
-        "unsupported algorithm nid" },
-    { ERR_PACK(0, 0, CAPI_R_UNSUPPORTED_PADDING), "unsupported padding" },
-    { ERR_PACK(0, 0, CAPI_R_UNSUPPORTED_PUBLIC_KEY_ALGORITHM),
-        "unsupported public key algorithm" },
-    { ERR_PACK(0, 0, CAPI_R_WIN32_ERROR), "win32 error" },
-    { 0, NULL }
-};
-
-#endif
-
-static int lib_code = 0;
-static int error_loaded = 0;
-
-static int ERR_load_CAPI_strings(void)
-{
-    if (lib_code == 0)
-        lib_code = ERR_get_next_error_library();
-
-    if (!error_loaded) {
-#ifndef OPENSSL_NO_ERR
-        ERR_load_strings(lib_code, CAPI_str_reasons);
-#endif
-        error_loaded = 1;
-    }
-    return 1;
-}
-
-static void ERR_unload_CAPI_strings(void)
-{
-    if (error_loaded) {
-#ifndef OPENSSL_NO_ERR
-        ERR_unload_strings(lib_code, CAPI_str_reasons);
-#endif
-        error_loaded = 0;
-    }
-}
-
-static void ERR_CAPI_error(int function, int reason, const char *file, int line)
-{
-    if (lib_code == 0)
-        lib_code = ERR_get_next_error_library();
-    ERR_raise(lib_code, reason);
-    ERR_set_debug(file, line, NULL);
-}
-
-static int ERR_CAPI_lib(void)
-{
-    if (lib_code == 0)
-        lib_code = ERR_get_next_error_library();
-    return lib_code;
-}
diff --git a/deps/openssl/openssl/engines/e_capi_err.h b/deps/openssl/openssl/engines/e_capi_err.h
deleted file mode 100644
index 8a0f58f2dad..00000000000
--- a/deps/openssl/openssl/engines/e_capi_err.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_E_CAPI_ERR_H
-#define OSSL_E_CAPI_ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#define CAPIerr(f, r) ERR_CAPI_error(0, (r), OPENSSL_FILE, OPENSSL_LINE)
-#define ERR_R_CAPI_LIB ERR_CAPI_lib()
-
-/*
- * CAPI reason codes.
- */
-#define CAPI_R_CANT_CREATE_HASH_OBJECT 100
-#define CAPI_R_CANT_FIND_CAPI_CONTEXT 101
-#define CAPI_R_CANT_GET_KEY 102
-#define CAPI_R_CANT_SET_HASH_VALUE 103
-#define CAPI_R_CRYPTACQUIRECONTEXT_ERROR 104
-#define CAPI_R_CRYPTENUMPROVIDERS_ERROR 105
-#define CAPI_R_DECRYPT_ERROR 106
-#define CAPI_R_ENGINE_NOT_INITIALIZED 107
-#define CAPI_R_ENUMCONTAINERS_ERROR 108
-#define CAPI_R_ERROR_ADDING_CERT 109
-#define CAPI_R_ERROR_CREATING_STORE 110
-#define CAPI_R_ERROR_GETTING_FRIENDLY_NAME 111
-#define CAPI_R_ERROR_GETTING_KEY_PROVIDER_INFO 112
-#define CAPI_R_ERROR_OPENING_STORE 113
-#define CAPI_R_ERROR_SIGNING_HASH 114
-#define CAPI_R_FILE_OPEN_ERROR 115
-#define CAPI_R_FUNCTION_NOT_SUPPORTED 116
-#define CAPI_R_GETUSERKEY_ERROR 117
-#define CAPI_R_INVALID_DIGEST_LENGTH 118
-#define CAPI_R_INVALID_DSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER 119
-#define CAPI_R_INVALID_LOOKUP_METHOD 120
-#define CAPI_R_INVALID_PUBLIC_KEY_BLOB 121
-#define CAPI_R_INVALID_RSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER 122
-#define CAPI_R_PUBKEY_EXPORT_ERROR 123
-#define CAPI_R_PUBKEY_EXPORT_LENGTH_ERROR 124
-#define CAPI_R_UNKNOWN_COMMAND 125
-#define CAPI_R_UNSUPPORTED_ALGORITHM_NID 126
-#define CAPI_R_UNSUPPORTED_PADDING 127
-#define CAPI_R_UNSUPPORTED_PUBLIC_KEY_ALGORITHM 128
-#define CAPI_R_WIN32_ERROR 129
-
-#endif
diff --git a/deps/openssl/openssl/engines/e_dasync.c b/deps/openssl/openssl/engines/e_dasync.c
deleted file mode 100644
index f801bcdd6d6..00000000000
--- a/deps/openssl/openssl/engines/e_dasync.c
+++ /dev/null
@@ -1,990 +0,0 @@
-/*
- * Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-/*
- * SHA-1 low level APIs are deprecated for public use, but still ok for
- * internal use.  Note, that due to symbols not being exported, only the
- * #defines and structures can be accessed, in this case SHA_CBLOCK and
- * sizeof(SHA_CTX).
- */
-#include "internal/deprecated.h"
-
-#include <openssl/opensslconf.h>
-#if defined(_WIN32)
-#include <windows.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-
-#include <openssl/engine.h>
-#include <openssl/sha.h>
-#include <openssl/aes.h>
-#include <openssl/rsa.h>
-#include <openssl/evp.h>
-#include <openssl/async.h>
-#include <openssl/bn.h>
-#include <openssl/crypto.h>
-#include <openssl/ssl.h>
-#include <openssl/modes.h>
-
-#if defined(OPENSSL_SYS_UNIX) && defined(OPENSSL_THREADS)
-#undef ASYNC_POSIX
-#define ASYNC_POSIX
-#include <unistd.h>
-#elif defined(_WIN32)
-#undef ASYNC_WIN
-#define ASYNC_WIN
-#endif
-
-/* clang-format off */
-#include "e_dasync_err.c"
-/* clang-format on */
-
-/* Engine Id and Name */
-static const char *engine_dasync_id = "dasync";
-static const char *engine_dasync_name = "Dummy Async engine support";
-
-/* Engine Lifetime functions */
-static int dasync_destroy(ENGINE *e);
-static int dasync_init(ENGINE *e);
-static int dasync_finish(ENGINE *e);
-void engine_load_dasync_int(void);
-
-/* Set up digests. Just SHA1 for now */
-static int dasync_digests(ENGINE *e, const EVP_MD **digest,
-    const int **nids, int nid);
-
-static void dummy_pause_job(void);
-
-/* SHA1 */
-static int dasync_sha1_init(EVP_MD_CTX *ctx);
-static int dasync_sha1_update(EVP_MD_CTX *ctx, const void *data,
-    size_t count);
-static int dasync_sha1_final(EVP_MD_CTX *ctx, unsigned char *md);
-
-/*
- * Holds the EVP_MD object for sha1 in this engine. Set up once only during
- * engine bind and can then be reused many times.
- */
-static EVP_MD *_hidden_sha1_md = NULL;
-static const EVP_MD *dasync_sha1(void)
-{
-    return _hidden_sha1_md;
-}
-static void destroy_digests(void)
-{
-    EVP_MD_meth_free(_hidden_sha1_md);
-    _hidden_sha1_md = NULL;
-}
-
-static int dasync_digest_nids(const int **nids)
-{
-    static int digest_nids[2] = { 0, 0 };
-    static int pos = 0;
-    static int init = 0;
-
-    if (!init) {
-        const EVP_MD *md;
-        if ((md = dasync_sha1()) != NULL)
-            digest_nids[pos++] = EVP_MD_get_type(md);
-        digest_nids[pos] = 0;
-        init = 1;
-    }
-    *nids = digest_nids;
-    return pos;
-}
-
-/* RSA */
-static int dasync_pkey(ENGINE *e, EVP_PKEY_METHOD **pmeth,
-    const int **pnids, int nid);
-
-static int dasync_rsa_init(EVP_PKEY_CTX *ctx);
-static void dasync_rsa_cleanup(EVP_PKEY_CTX *ctx);
-static int dasync_rsa_paramgen_init(EVP_PKEY_CTX *ctx);
-static int dasync_rsa_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
-static int dasync_rsa_keygen_init(EVP_PKEY_CTX *ctx);
-static int dasync_rsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
-static int dasync_rsa_encrypt_init(EVP_PKEY_CTX *ctx);
-static int dasync_rsa_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out,
-    size_t *outlen, const unsigned char *in,
-    size_t inlen);
-static int dasync_rsa_decrypt_init(EVP_PKEY_CTX *ctx);
-static int dasync_rsa_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out,
-    size_t *outlen, const unsigned char *in,
-    size_t inlen);
-static int dasync_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2);
-static int dasync_rsa_ctrl_str(EVP_PKEY_CTX *ctx, const char *type,
-    const char *value);
-
-static EVP_PKEY_METHOD *dasync_rsa;
-static const EVP_PKEY_METHOD *dasync_rsa_orig;
-
-/* AES */
-
-static int dasync_aes128_cbc_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
-    void *ptr);
-static int dasync_aes128_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-static int dasync_aes128_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl);
-static int dasync_aes128_cbc_cleanup(EVP_CIPHER_CTX *ctx);
-
-static int dasync_aes256_ctr_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
-    void *ptr);
-static int dasync_aes256_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-static int dasync_aes256_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl);
-static int dasync_aes256_ctr_cleanup(EVP_CIPHER_CTX *ctx);
-
-static int dasync_aes128_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type,
-    int arg, void *ptr);
-static int dasync_aes128_cbc_hmac_sha1_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *iv,
-    int enc);
-static int dasync_aes128_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx,
-    unsigned char *out,
-    const unsigned char *in,
-    size_t inl);
-static int dasync_aes128_cbc_hmac_sha1_cleanup(EVP_CIPHER_CTX *ctx);
-
-struct dasync_pipeline_ctx {
-    void *inner_cipher_data;
-    unsigned int numpipes;
-    unsigned char **inbufs;
-    unsigned char **outbufs;
-    size_t *lens;
-    unsigned char tlsaad[SSL_MAX_PIPELINES][EVP_AEAD_TLS1_AAD_LEN];
-    unsigned int aadctr;
-};
-
-/*
- * Holds the EVP_CIPHER object for aes_128_cbc in this engine. Set up once only
- * during engine bind and can then be reused many times.
- */
-static EVP_CIPHER *_hidden_aes_128_cbc = NULL;
-static const EVP_CIPHER *dasync_aes_128_cbc(void)
-{
-    return _hidden_aes_128_cbc;
-}
-
-static EVP_CIPHER *_hidden_aes_256_ctr = NULL;
-static const EVP_CIPHER *dasync_aes_256_ctr(void)
-{
-    return _hidden_aes_256_ctr;
-}
-
-/*
- * Holds the EVP_CIPHER object for aes_128_cbc_hmac_sha1 in this engine. Set up
- * once only during engine bind and can then be reused many times.
- *
- * This 'stitched' cipher depends on the EVP_aes_128_cbc_hmac_sha1() cipher,
- * which is implemented only if the AES-NI instruction set extension is available
- * (see OPENSSL_IA32CAP(3)). If that's not the case, then this cipher will not
- * be available either.
- *
- * Note: Since it is a legacy mac-then-encrypt cipher, modern TLS peers (which
- * negotiate the encrypt-then-mac extension) won't negotiate it anyway.
- */
-static EVP_CIPHER *_hidden_aes_128_cbc_hmac_sha1 = NULL;
-static const EVP_CIPHER *dasync_aes_128_cbc_hmac_sha1(void)
-{
-    return _hidden_aes_128_cbc_hmac_sha1;
-}
-
-static void destroy_ciphers(void)
-{
-    EVP_CIPHER_meth_free(_hidden_aes_128_cbc);
-    EVP_CIPHER_meth_free(_hidden_aes_256_ctr);
-    EVP_CIPHER_meth_free(_hidden_aes_128_cbc_hmac_sha1);
-    _hidden_aes_128_cbc = NULL;
-    _hidden_aes_256_ctr = NULL;
-    _hidden_aes_128_cbc_hmac_sha1 = NULL;
-}
-
-static int dasync_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
-    const int **nids, int nid);
-
-static int dasync_cipher_nids[] = {
-    NID_aes_128_cbc,
-    NID_aes_256_ctr,
-    NID_aes_128_cbc_hmac_sha1,
-    0
-};
-
-static int bind_dasync(ENGINE *e)
-{
-    /* Setup RSA */
-    if ((dasync_rsa_orig = EVP_PKEY_meth_find(EVP_PKEY_RSA)) == NULL
-        || (dasync_rsa = EVP_PKEY_meth_new(EVP_PKEY_RSA,
-                EVP_PKEY_FLAG_AUTOARGLEN))
-            == NULL)
-        return 0;
-    EVP_PKEY_meth_set_init(dasync_rsa, dasync_rsa_init);
-    EVP_PKEY_meth_set_cleanup(dasync_rsa, dasync_rsa_cleanup);
-    EVP_PKEY_meth_set_paramgen(dasync_rsa, dasync_rsa_paramgen_init,
-        dasync_rsa_paramgen);
-    EVP_PKEY_meth_set_keygen(dasync_rsa, dasync_rsa_keygen_init,
-        dasync_rsa_keygen);
-    EVP_PKEY_meth_set_encrypt(dasync_rsa, dasync_rsa_encrypt_init,
-        dasync_rsa_encrypt);
-    EVP_PKEY_meth_set_decrypt(dasync_rsa, dasync_rsa_decrypt_init,
-        dasync_rsa_decrypt);
-    EVP_PKEY_meth_set_ctrl(dasync_rsa, dasync_rsa_ctrl,
-        dasync_rsa_ctrl_str);
-
-    /* Ensure the dasync error handling is set up */
-    ERR_load_DASYNC_strings();
-
-    if (!ENGINE_set_id(e, engine_dasync_id)
-        || !ENGINE_set_name(e, engine_dasync_name)
-        || !ENGINE_set_pkey_meths(e, dasync_pkey)
-        || !ENGINE_set_digests(e, dasync_digests)
-        || !ENGINE_set_ciphers(e, dasync_ciphers)
-        || !ENGINE_set_destroy_function(e, dasync_destroy)
-        || !ENGINE_set_init_function(e, dasync_init)
-        || !ENGINE_set_finish_function(e, dasync_finish)) {
-        DASYNCerr(DASYNC_F_BIND_DASYNC, DASYNC_R_INIT_FAILED);
-        return 0;
-    }
-
-    /*
-     * Set up the EVP_CIPHER and EVP_MD objects for the ciphers/digests
-     * supplied by this engine
-     */
-    _hidden_sha1_md = EVP_MD_meth_new(NID_sha1, NID_sha1WithRSAEncryption);
-    if (_hidden_sha1_md == NULL
-        || !EVP_MD_meth_set_result_size(_hidden_sha1_md, SHA_DIGEST_LENGTH)
-        || !EVP_MD_meth_set_input_blocksize(_hidden_sha1_md, SHA_CBLOCK)
-        || !EVP_MD_meth_set_app_datasize(_hidden_sha1_md,
-            sizeof(EVP_MD *) + sizeof(SHA_CTX))
-        || !EVP_MD_meth_set_flags(_hidden_sha1_md, EVP_MD_FLAG_DIGALGID_ABSENT)
-        || !EVP_MD_meth_set_init(_hidden_sha1_md, dasync_sha1_init)
-        || !EVP_MD_meth_set_update(_hidden_sha1_md, dasync_sha1_update)
-        || !EVP_MD_meth_set_final(_hidden_sha1_md, dasync_sha1_final)) {
-        EVP_MD_meth_free(_hidden_sha1_md);
-        _hidden_sha1_md = NULL;
-    }
-
-    _hidden_aes_128_cbc = EVP_CIPHER_meth_new(NID_aes_128_cbc,
-        16 /* block size */,
-        16 /* key len */);
-    if (_hidden_aes_128_cbc == NULL
-        || !EVP_CIPHER_meth_set_iv_length(_hidden_aes_128_cbc, 16)
-        || !EVP_CIPHER_meth_set_flags(_hidden_aes_128_cbc,
-            EVP_CIPH_FLAG_DEFAULT_ASN1
-                | EVP_CIPH_CBC_MODE
-                | EVP_CIPH_FLAG_PIPELINE
-                | EVP_CIPH_CUSTOM_COPY)
-        || !EVP_CIPHER_meth_set_init(_hidden_aes_128_cbc,
-            dasync_aes128_init_key)
-        || !EVP_CIPHER_meth_set_do_cipher(_hidden_aes_128_cbc,
-            dasync_aes128_cbc_cipher)
-        || !EVP_CIPHER_meth_set_cleanup(_hidden_aes_128_cbc,
-            dasync_aes128_cbc_cleanup)
-        || !EVP_CIPHER_meth_set_ctrl(_hidden_aes_128_cbc,
-            dasync_aes128_cbc_ctrl)
-        || !EVP_CIPHER_meth_set_impl_ctx_size(_hidden_aes_128_cbc,
-            sizeof(struct dasync_pipeline_ctx))) {
-        EVP_CIPHER_meth_free(_hidden_aes_128_cbc);
-        _hidden_aes_128_cbc = NULL;
-    }
-
-    _hidden_aes_256_ctr = EVP_CIPHER_meth_new(NID_aes_256_ctr,
-        1 /* block size */,
-        32 /* key len */);
-    if (_hidden_aes_256_ctr == NULL
-        || !EVP_CIPHER_meth_set_iv_length(_hidden_aes_256_ctr, 16)
-        || !EVP_CIPHER_meth_set_flags(_hidden_aes_256_ctr,
-            EVP_CIPH_FLAG_DEFAULT_ASN1
-                | EVP_CIPH_CTR_MODE
-                | EVP_CIPH_FLAG_PIPELINE
-                | EVP_CIPH_CUSTOM_COPY)
-        || !EVP_CIPHER_meth_set_init(_hidden_aes_256_ctr,
-            dasync_aes256_init_key)
-        || !EVP_CIPHER_meth_set_do_cipher(_hidden_aes_256_ctr,
-            dasync_aes256_ctr_cipher)
-        || !EVP_CIPHER_meth_set_cleanup(_hidden_aes_256_ctr,
-            dasync_aes256_ctr_cleanup)
-        || !EVP_CIPHER_meth_set_ctrl(_hidden_aes_256_ctr,
-            dasync_aes256_ctr_ctrl)
-        || !EVP_CIPHER_meth_set_impl_ctx_size(_hidden_aes_256_ctr,
-            sizeof(struct dasync_pipeline_ctx))) {
-        EVP_CIPHER_meth_free(_hidden_aes_256_ctr);
-        _hidden_aes_256_ctr = NULL;
-    }
-
-    _hidden_aes_128_cbc_hmac_sha1 = EVP_CIPHER_meth_new(
-        NID_aes_128_cbc_hmac_sha1,
-        16 /* block size */,
-        16 /* key len */);
-    if (_hidden_aes_128_cbc_hmac_sha1 == NULL
-        || !EVP_CIPHER_meth_set_iv_length(_hidden_aes_128_cbc_hmac_sha1, 16)
-        || !EVP_CIPHER_meth_set_flags(_hidden_aes_128_cbc_hmac_sha1,
-            EVP_CIPH_CBC_MODE
-                | EVP_CIPH_FLAG_DEFAULT_ASN1
-                | EVP_CIPH_FLAG_AEAD_CIPHER
-                | EVP_CIPH_FLAG_PIPELINE
-                | EVP_CIPH_CUSTOM_COPY)
-        || !EVP_CIPHER_meth_set_init(_hidden_aes_128_cbc_hmac_sha1,
-            dasync_aes128_cbc_hmac_sha1_init_key)
-        || !EVP_CIPHER_meth_set_do_cipher(_hidden_aes_128_cbc_hmac_sha1,
-            dasync_aes128_cbc_hmac_sha1_cipher)
-        || !EVP_CIPHER_meth_set_cleanup(_hidden_aes_128_cbc_hmac_sha1,
-            dasync_aes128_cbc_hmac_sha1_cleanup)
-        || !EVP_CIPHER_meth_set_ctrl(_hidden_aes_128_cbc_hmac_sha1,
-            dasync_aes128_cbc_hmac_sha1_ctrl)
-        || !EVP_CIPHER_meth_set_impl_ctx_size(_hidden_aes_128_cbc_hmac_sha1,
-            sizeof(struct dasync_pipeline_ctx))) {
-        EVP_CIPHER_meth_free(_hidden_aes_128_cbc_hmac_sha1);
-        _hidden_aes_128_cbc_hmac_sha1 = NULL;
-    }
-
-    return 1;
-}
-
-static void destroy_pkey(void)
-{
-    /*
-     * We don't actually need to free the dasync_rsa method since this is
-     * automatically freed for us by libcrypto.
-     */
-    dasync_rsa_orig = NULL;
-    dasync_rsa = NULL;
-}
-
-#ifndef OPENSSL_NO_DYNAMIC_ENGINE
-static int bind_helper(ENGINE *e, const char *id)
-{
-    if (id && (strcmp(id, engine_dasync_id) != 0))
-        return 0;
-    if (!bind_dasync(e))
-        return 0;
-    return 1;
-}
-
-IMPLEMENT_DYNAMIC_CHECK_FN()
-IMPLEMENT_DYNAMIC_BIND_FN(bind_helper)
-#endif
-
-static ENGINE *engine_dasync(void)
-{
-    ENGINE *ret = ENGINE_new();
-    if (!ret)
-        return NULL;
-    if (!bind_dasync(ret)) {
-        ENGINE_free(ret);
-        return NULL;
-    }
-    return ret;
-}
-
-void engine_load_dasync_int(void)
-{
-    ENGINE *toadd = engine_dasync();
-    if (!toadd)
-        return;
-    ERR_set_mark();
-    ENGINE_add(toadd);
-    /*
-     * If the "add" worked, it gets a structural reference. So either way, we
-     * release our just-created reference.
-     */
-    ENGINE_free(toadd);
-    /*
-     * If the "add" didn't work, it was probably a conflict because it was
-     * already added (eg. someone calling ENGINE_load_blah then calling
-     * ENGINE_load_builtin_engines() perhaps).
-     */
-    ERR_pop_to_mark();
-}
-
-static int dasync_init(ENGINE *e)
-{
-    return 1;
-}
-
-static int dasync_finish(ENGINE *e)
-{
-    return 1;
-}
-
-static int dasync_destroy(ENGINE *e)
-{
-    destroy_digests();
-    destroy_ciphers();
-    destroy_pkey();
-    ERR_unload_DASYNC_strings();
-    return 1;
-}
-
-static int dasync_pkey(ENGINE *e, EVP_PKEY_METHOD **pmeth,
-    const int **pnids, int nid)
-{
-    static const int rnid = EVP_PKEY_RSA;
-
-    if (pmeth == NULL) {
-        *pnids = &rnid;
-        return 1;
-    }
-
-    if (nid == EVP_PKEY_RSA) {
-        *pmeth = dasync_rsa;
-        return 1;
-    }
-
-    *pmeth = NULL;
-    return 0;
-}
-
-static int dasync_digests(ENGINE *e, const EVP_MD **digest,
-    const int **nids, int nid)
-{
-    int ok = 1;
-    if (!digest) {
-        /* We are returning a list of supported nids */
-        return dasync_digest_nids(nids);
-    }
-    /* We are being asked for a specific digest */
-    switch (nid) {
-    case NID_sha1:
-        *digest = dasync_sha1();
-        break;
-    default:
-        ok = 0;
-        *digest = NULL;
-        break;
-    }
-    return ok;
-}
-
-static int dasync_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
-    const int **nids, int nid)
-{
-    int ok = 1;
-    if (cipher == NULL) {
-        /* We are returning a list of supported nids */
-        *nids = dasync_cipher_nids;
-        return (sizeof(dasync_cipher_nids) - 1) / sizeof(dasync_cipher_nids[0]);
-    }
-    /* We are being asked for a specific cipher */
-    switch (nid) {
-    case NID_aes_128_cbc:
-        *cipher = dasync_aes_128_cbc();
-        break;
-    case NID_aes_256_ctr:
-        *cipher = dasync_aes_256_ctr();
-        break;
-    case NID_aes_128_cbc_hmac_sha1:
-        *cipher = dasync_aes_128_cbc_hmac_sha1();
-        break;
-    default:
-        ok = 0;
-        *cipher = NULL;
-        break;
-    }
-    return ok;
-}
-
-static void wait_cleanup(ASYNC_WAIT_CTX *ctx, const void *key,
-    OSSL_ASYNC_FD readfd, void *pvwritefd)
-{
-    OSSL_ASYNC_FD *pwritefd = (OSSL_ASYNC_FD *)pvwritefd;
-#if defined(ASYNC_WIN)
-    CloseHandle(readfd);
-    CloseHandle(*pwritefd);
-#elif defined(ASYNC_POSIX)
-    close(readfd);
-    close(*pwritefd);
-#endif
-    OPENSSL_free(pwritefd);
-}
-
-#define DUMMY_CHAR 'X'
-
-static void dummy_pause_job(void)
-{
-    ASYNC_JOB *job;
-    ASYNC_WAIT_CTX *waitctx;
-    ASYNC_callback_fn callback;
-    void *callback_arg;
-    OSSL_ASYNC_FD pipefds[2] = { 0, 0 };
-    OSSL_ASYNC_FD *writefd;
-#if defined(ASYNC_WIN)
-    DWORD numwritten, numread;
-    char buf = DUMMY_CHAR;
-#elif defined(ASYNC_POSIX)
-    char buf = DUMMY_CHAR;
-#endif
-
-    if ((job = ASYNC_get_current_job()) == NULL)
-        return;
-
-    waitctx = ASYNC_get_wait_ctx(job);
-
-    if (ASYNC_WAIT_CTX_get_callback(waitctx, &callback, &callback_arg) && callback != NULL) {
-        /*
-         * In the Dummy async engine we are cheating. We call the callback that the job
-         * is complete before the call to ASYNC_pause_job(). A real
-         * async engine would only call the callback when the job was actually complete
-         */
-        (*callback)(callback_arg);
-        ASYNC_pause_job();
-        return;
-    }
-
-    if (ASYNC_WAIT_CTX_get_fd(waitctx, engine_dasync_id, &pipefds[0],
-            (void **)&writefd)) {
-        pipefds[1] = *writefd;
-    } else {
-        writefd = OPENSSL_malloc(sizeof(*writefd));
-        if (writefd == NULL)
-            return;
-#if defined(ASYNC_WIN)
-        if (CreatePipe(&pipefds[0], &pipefds[1], NULL, 256) == 0) {
-            OPENSSL_free(writefd);
-            return;
-        }
-#elif defined(ASYNC_POSIX)
-        if (pipe(pipefds) != 0) {
-            OPENSSL_free(writefd);
-            return;
-        }
-#endif
-        *writefd = pipefds[1];
-
-        if (!ASYNC_WAIT_CTX_set_wait_fd(waitctx, engine_dasync_id, pipefds[0],
-                writefd, wait_cleanup)) {
-            wait_cleanup(waitctx, engine_dasync_id, pipefds[0], writefd);
-            return;
-        }
-    }
-    /*
-     * In the Dummy async engine we are cheating. We signal that the job
-     * is complete by waking it before the call to ASYNC_pause_job(). A real
-     * async engine would only wake when the job was actually complete
-     */
-#if defined(ASYNC_WIN)
-    WriteFile(pipefds[1], &buf, 1, &numwritten, NULL);
-#elif defined(ASYNC_POSIX)
-    if (write(pipefds[1], &buf, 1) < 0)
-        return;
-#endif
-
-    /* Ignore errors - we carry on anyway */
-    ASYNC_pause_job();
-
-    /* Clear the wake signal */
-#if defined(ASYNC_WIN)
-    ReadFile(pipefds[0], &buf, 1, &numread, NULL);
-#elif defined(ASYNC_POSIX)
-    if (read(pipefds[0], &buf, 1) < 0)
-        return;
-#endif
-}
-
-/*
- * SHA1 implementation. At the moment we just defer to the standard
- * implementation
- */
-static int dasync_sha1_init(EVP_MD_CTX *ctx)
-{
-    dummy_pause_job();
-
-    return EVP_MD_meth_get_init(EVP_sha1())(ctx);
-}
-
-static int dasync_sha1_update(EVP_MD_CTX *ctx, const void *data,
-    size_t count)
-{
-    dummy_pause_job();
-
-    return EVP_MD_meth_get_update(EVP_sha1())(ctx, data, count);
-}
-
-static int dasync_sha1_final(EVP_MD_CTX *ctx, unsigned char *md)
-{
-    dummy_pause_job();
-
-    return EVP_MD_meth_get_final(EVP_sha1())(ctx, md);
-}
-
-/* Cipher helper functions */
-
-static int dasync_cipher_ctrl_helper(EVP_CIPHER_CTX *ctx, int type, int arg,
-    void *ptr, int aeadcapable,
-    const EVP_CIPHER *ciph)
-{
-    int ret;
-    struct dasync_pipeline_ctx *pipe_ctx = (struct dasync_pipeline_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-
-    if (pipe_ctx == NULL)
-        return 0;
-
-    switch (type) {
-    case EVP_CTRL_COPY: {
-        size_t sz = EVP_CIPHER_impl_ctx_size(ciph);
-        void *inner_cipher_data = OPENSSL_malloc(sz);
-
-        if (inner_cipher_data == NULL)
-            return -1;
-        memcpy(inner_cipher_data, pipe_ctx->inner_cipher_data, sz);
-        pipe_ctx->inner_cipher_data = inner_cipher_data;
-    } break;
-
-    case EVP_CTRL_SET_PIPELINE_OUTPUT_BUFS:
-        pipe_ctx->numpipes = arg;
-        pipe_ctx->outbufs = (unsigned char **)ptr;
-        break;
-
-    case EVP_CTRL_SET_PIPELINE_INPUT_BUFS:
-        pipe_ctx->numpipes = arg;
-        pipe_ctx->inbufs = (unsigned char **)ptr;
-        break;
-
-    case EVP_CTRL_SET_PIPELINE_INPUT_LENS:
-        pipe_ctx->numpipes = arg;
-        pipe_ctx->lens = (size_t *)ptr;
-        break;
-
-    case EVP_CTRL_AEAD_SET_MAC_KEY:
-        if (!aeadcapable)
-            return -1;
-        EVP_CIPHER_CTX_set_cipher_data(ctx, pipe_ctx->inner_cipher_data);
-        ret = EVP_CIPHER_meth_get_ctrl(EVP_aes_128_cbc_hmac_sha1())(ctx, type, arg, ptr);
-        EVP_CIPHER_CTX_set_cipher_data(ctx, pipe_ctx);
-        return ret;
-
-    case EVP_CTRL_AEAD_TLS1_AAD: {
-        unsigned char *p = ptr;
-        unsigned int len;
-
-        if (!aeadcapable || arg != EVP_AEAD_TLS1_AAD_LEN)
-            return -1;
-
-        if (pipe_ctx->aadctr >= SSL_MAX_PIPELINES)
-            return -1;
-
-        memcpy(pipe_ctx->tlsaad[pipe_ctx->aadctr], ptr,
-            EVP_AEAD_TLS1_AAD_LEN);
-        pipe_ctx->aadctr++;
-
-        len = p[arg - 2] << 8 | p[arg - 1];
-
-        if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            if ((p[arg - 4] << 8 | p[arg - 3]) >= TLS1_1_VERSION) {
-                if (len < AES_BLOCK_SIZE)
-                    return 0;
-                len -= AES_BLOCK_SIZE;
-            }
-
-            return ((len + SHA_DIGEST_LENGTH + AES_BLOCK_SIZE)
-                       & -AES_BLOCK_SIZE)
-                - len;
-        } else {
-            return SHA_DIGEST_LENGTH;
-        }
-    }
-
-    default:
-        return 0;
-    }
-
-    return 1;
-}
-
-static int dasync_cipher_init_key_helper(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *iv, int enc,
-    const EVP_CIPHER *cipher)
-{
-    int ret;
-    struct dasync_pipeline_ctx *pipe_ctx = (struct dasync_pipeline_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-
-    if (pipe_ctx->inner_cipher_data == NULL
-        && EVP_CIPHER_impl_ctx_size(cipher) != 0) {
-        pipe_ctx->inner_cipher_data = OPENSSL_zalloc(
-            EVP_CIPHER_impl_ctx_size(cipher));
-        if (pipe_ctx->inner_cipher_data == NULL)
-            return 0;
-    }
-
-    pipe_ctx->numpipes = 0;
-    pipe_ctx->aadctr = 0;
-
-    EVP_CIPHER_CTX_set_cipher_data(ctx, pipe_ctx->inner_cipher_data);
-    ret = EVP_CIPHER_meth_get_init(cipher)(ctx, key, iv, enc);
-    EVP_CIPHER_CTX_set_cipher_data(ctx, pipe_ctx);
-
-    return ret;
-}
-
-static int dasync_cipher_helper(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl,
-    const EVP_CIPHER *cipher)
-{
-    int ret = 1;
-    unsigned int i, pipes;
-    struct dasync_pipeline_ctx *pipe_ctx = (struct dasync_pipeline_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-
-    pipes = pipe_ctx->numpipes;
-    EVP_CIPHER_CTX_set_cipher_data(ctx, pipe_ctx->inner_cipher_data);
-    if (pipes == 0) {
-        if (pipe_ctx->aadctr != 0) {
-            if (pipe_ctx->aadctr != 1)
-                return -1;
-            EVP_CIPHER_meth_get_ctrl(cipher)(ctx, EVP_CTRL_AEAD_TLS1_AAD,
-                EVP_AEAD_TLS1_AAD_LEN,
-                pipe_ctx->tlsaad[0]);
-        }
-        ret = EVP_CIPHER_meth_get_do_cipher(cipher)(ctx, out, in, inl);
-    } else {
-        if (pipe_ctx->aadctr > 0 && pipe_ctx->aadctr != pipes)
-            return -1;
-        for (i = 0; i < pipes; i++) {
-            if (pipe_ctx->aadctr > 0) {
-                EVP_CIPHER_meth_get_ctrl(cipher)(ctx, EVP_CTRL_AEAD_TLS1_AAD,
-                    EVP_AEAD_TLS1_AAD_LEN,
-                    pipe_ctx->tlsaad[i]);
-            }
-            ret = ret && EVP_CIPHER_meth_get_do_cipher(cipher)(ctx, pipe_ctx->outbufs[i], pipe_ctx->inbufs[i], pipe_ctx->lens[i]);
-        }
-        pipe_ctx->numpipes = 0;
-    }
-    pipe_ctx->aadctr = 0;
-    EVP_CIPHER_CTX_set_cipher_data(ctx, pipe_ctx);
-    return ret;
-}
-
-static int dasync_cipher_cleanup_helper(EVP_CIPHER_CTX *ctx,
-    const EVP_CIPHER *cipher)
-{
-    struct dasync_pipeline_ctx *pipe_ctx = (struct dasync_pipeline_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-
-    OPENSSL_clear_free(pipe_ctx->inner_cipher_data,
-        EVP_CIPHER_impl_ctx_size(cipher));
-
-    return 1;
-}
-
-/*
- * AES128 CBC Implementation
- */
-
-static int dasync_aes128_cbc_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
-    void *ptr)
-{
-    return dasync_cipher_ctrl_helper(ctx, type, arg, ptr, 0, EVP_aes_128_cbc());
-}
-
-static int dasync_aes128_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    return dasync_cipher_init_key_helper(ctx, key, iv, enc, EVP_aes_128_cbc());
-}
-
-static int dasync_aes128_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    return dasync_cipher_helper(ctx, out, in, inl, EVP_aes_128_cbc());
-}
-
-static int dasync_aes128_cbc_cleanup(EVP_CIPHER_CTX *ctx)
-{
-    return dasync_cipher_cleanup_helper(ctx, EVP_aes_128_cbc());
-}
-
-static int dasync_aes256_ctr_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
-    void *ptr)
-{
-    return dasync_cipher_ctrl_helper(ctx, type, arg, ptr, 0, EVP_aes_256_ctr());
-}
-
-static int dasync_aes256_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    return dasync_cipher_init_key_helper(ctx, key, iv, enc, EVP_aes_256_ctr());
-}
-
-static int dasync_aes256_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    return dasync_cipher_helper(ctx, out, in, inl, EVP_aes_256_ctr());
-}
-
-static int dasync_aes256_ctr_cleanup(EVP_CIPHER_CTX *ctx)
-{
-    return dasync_cipher_cleanup_helper(ctx, EVP_aes_256_ctr());
-}
-
-/*
- * AES128 CBC HMAC SHA1 Implementation
- */
-
-static int dasync_aes128_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type,
-    int arg, void *ptr)
-{
-    return dasync_cipher_ctrl_helper(ctx, type, arg, ptr, 1, EVP_aes_128_cbc_hmac_sha1());
-}
-
-static int dasync_aes128_cbc_hmac_sha1_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *iv,
-    int enc)
-{
-    /*
-     * We can safely assume that EVP_aes_128_cbc_hmac_sha1() != NULL,
-     * see comment before the definition of dasync_aes_128_cbc_hmac_sha1().
-     */
-    return dasync_cipher_init_key_helper(ctx, key, iv, enc,
-        EVP_aes_128_cbc_hmac_sha1());
-}
-
-static int dasync_aes128_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx,
-    unsigned char *out,
-    const unsigned char *in,
-    size_t inl)
-{
-    return dasync_cipher_helper(ctx, out, in, inl, EVP_aes_128_cbc_hmac_sha1());
-}
-
-static int dasync_aes128_cbc_hmac_sha1_cleanup(EVP_CIPHER_CTX *ctx)
-{
-    /*
-     * We can safely assume that EVP_aes_128_cbc_hmac_sha1() != NULL,
-     * see comment before the definition of dasync_aes_128_cbc_hmac_sha1().
-     */
-    return dasync_cipher_cleanup_helper(ctx, EVP_aes_128_cbc_hmac_sha1());
-}
-
-/*
- * RSA implementation
- */
-static int dasync_rsa_init(EVP_PKEY_CTX *ctx)
-{
-    static int (*pinit)(EVP_PKEY_CTX *ctx);
-
-    if (pinit == NULL)
-        EVP_PKEY_meth_get_init(dasync_rsa_orig, &pinit);
-    return pinit(ctx);
-}
-
-static void dasync_rsa_cleanup(EVP_PKEY_CTX *ctx)
-{
-    static void (*pcleanup)(EVP_PKEY_CTX *ctx);
-
-    if (pcleanup == NULL)
-        EVP_PKEY_meth_get_cleanup(dasync_rsa_orig, &pcleanup);
-    pcleanup(ctx);
-}
-
-static int dasync_rsa_paramgen_init(EVP_PKEY_CTX *ctx)
-{
-    static int (*pparamgen_init)(EVP_PKEY_CTX *ctx);
-
-    if (pparamgen_init == NULL)
-        EVP_PKEY_meth_get_paramgen(dasync_rsa_orig, &pparamgen_init, NULL);
-    return pparamgen_init != NULL ? pparamgen_init(ctx) : 1;
-}
-
-static int dasync_rsa_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
-{
-    static int (*pparamgen)(EVP_PKEY_CTX *c, EVP_PKEY *pkey);
-
-    if (pparamgen == NULL)
-        EVP_PKEY_meth_get_paramgen(dasync_rsa_orig, NULL, &pparamgen);
-    return pparamgen != NULL ? pparamgen(ctx, pkey) : 1;
-}
-
-static int dasync_rsa_keygen_init(EVP_PKEY_CTX *ctx)
-{
-    static int (*pkeygen_init)(EVP_PKEY_CTX *ctx);
-
-    if (pkeygen_init == NULL)
-        EVP_PKEY_meth_get_keygen(dasync_rsa_orig, &pkeygen_init, NULL);
-    return pkeygen_init != NULL ? pkeygen_init(ctx) : 1;
-}
-
-static int dasync_rsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
-{
-    static int (*pkeygen)(EVP_PKEY_CTX *c, EVP_PKEY *pkey);
-
-    if (pkeygen == NULL)
-        EVP_PKEY_meth_get_keygen(dasync_rsa_orig, NULL, &pkeygen);
-    return pkeygen(ctx, pkey);
-}
-
-static int dasync_rsa_encrypt_init(EVP_PKEY_CTX *ctx)
-{
-    static int (*pencrypt_init)(EVP_PKEY_CTX *ctx);
-
-    if (pencrypt_init == NULL)
-        EVP_PKEY_meth_get_encrypt(dasync_rsa_orig, &pencrypt_init, NULL);
-    return pencrypt_init != NULL ? pencrypt_init(ctx) : 1;
-}
-
-static int dasync_rsa_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out,
-    size_t *outlen, const unsigned char *in,
-    size_t inlen)
-{
-    static int (*pencryptfn)(EVP_PKEY_CTX *ctx, unsigned char *out,
-        size_t *outlen, const unsigned char *in,
-        size_t inlen);
-
-    if (pencryptfn == NULL)
-        EVP_PKEY_meth_get_encrypt(dasync_rsa_orig, NULL, &pencryptfn);
-    return pencryptfn(ctx, out, outlen, in, inlen);
-}
-
-static int dasync_rsa_decrypt_init(EVP_PKEY_CTX *ctx)
-{
-    static int (*pdecrypt_init)(EVP_PKEY_CTX *ctx);
-
-    if (pdecrypt_init == NULL)
-        EVP_PKEY_meth_get_decrypt(dasync_rsa_orig, &pdecrypt_init, NULL);
-    return pdecrypt_init != NULL ? pdecrypt_init(ctx) : 1;
-}
-
-static int dasync_rsa_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out,
-    size_t *outlen, const unsigned char *in,
-    size_t inlen)
-{
-    static int (*pdecrypt)(EVP_PKEY_CTX *ctx, unsigned char *out,
-        size_t *outlen, const unsigned char *in,
-        size_t inlen);
-
-    if (pdecrypt == NULL)
-        EVP_PKEY_meth_get_decrypt(dasync_rsa_orig, NULL, &pdecrypt);
-    return pdecrypt(ctx, out, outlen, in, inlen);
-}
-
-static int dasync_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
-{
-    static int (*pctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2);
-
-    if (pctrl == NULL)
-        EVP_PKEY_meth_get_ctrl(dasync_rsa_orig, &pctrl, NULL);
-    return pctrl(ctx, type, p1, p2);
-}
-
-static int dasync_rsa_ctrl_str(EVP_PKEY_CTX *ctx, const char *type,
-    const char *value)
-{
-    static int (*pctrl_str)(EVP_PKEY_CTX *ctx, const char *type,
-        const char *value);
-
-    if (pctrl_str == NULL)
-        EVP_PKEY_meth_get_ctrl(dasync_rsa_orig, NULL, &pctrl_str);
-    return pctrl_str(ctx, type, value);
-}
diff --git a/deps/openssl/openssl/engines/e_dasync.ec b/deps/openssl/openssl/engines/e_dasync.ec
deleted file mode 100644
index 3d56ebcc5f6..00000000000
--- a/deps/openssl/openssl/engines/e_dasync.ec
+++ /dev/null
@@ -1,3 +0,0 @@
-# The INPUT HEADER is scanned for declarations
-# LIBNAME       INPUT HEADER                    ERROR-TABLE FILE
-L DASYNC        e_dasync_err.h                  e_dasync_err.c
diff --git a/deps/openssl/openssl/engines/e_dasync_err.c b/deps/openssl/openssl/engines/e_dasync_err.c
deleted file mode 100644
index eba72fa859b..00000000000
--- a/deps/openssl/openssl/engines/e_dasync_err.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include "e_dasync_err.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static ERR_STRING_DATA DASYNC_str_reasons[] = {
-    { ERR_PACK(0, 0, DASYNC_R_INIT_FAILED), "init failed" },
-    { 0, NULL }
-};
-
-#endif
-
-static int lib_code = 0;
-static int error_loaded = 0;
-
-static int ERR_load_DASYNC_strings(void)
-{
-    if (lib_code == 0)
-        lib_code = ERR_get_next_error_library();
-
-    if (!error_loaded) {
-#ifndef OPENSSL_NO_ERR
-        ERR_load_strings(lib_code, DASYNC_str_reasons);
-#endif
-        error_loaded = 1;
-    }
-    return 1;
-}
-
-static void ERR_unload_DASYNC_strings(void)
-{
-    if (error_loaded) {
-#ifndef OPENSSL_NO_ERR
-        ERR_unload_strings(lib_code, DASYNC_str_reasons);
-#endif
-        error_loaded = 0;
-    }
-}
-
-static void ERR_DASYNC_error(int function, int reason, const char *file, int line)
-{
-    if (lib_code == 0)
-        lib_code = ERR_get_next_error_library();
-    ERR_raise(lib_code, reason);
-    ERR_set_debug(file, line, NULL);
-}
diff --git a/deps/openssl/openssl/engines/e_dasync_err.h b/deps/openssl/openssl/engines/e_dasync_err.h
deleted file mode 100644
index bb774f02c64..00000000000
--- a/deps/openssl/openssl/engines/e_dasync_err.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_E_DASYNC_ERR_H
-#define OSSL_E_DASYNC_ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#define DASYNCerr(f, r) ERR_DASYNC_error(0, (r), OPENSSL_FILE, OPENSSL_LINE)
-
-/*
- * DASYNC reason codes.
- */
-#define DASYNC_R_INIT_FAILED 100
-
-#endif
diff --git a/deps/openssl/openssl/engines/e_devcrypto.c b/deps/openssl/openssl/engines/e_devcrypto.c
deleted file mode 100644
index f66c7f1c1cf..00000000000
--- a/deps/openssl/openssl/engines/e_devcrypto.c
+++ /dev/null
@@ -1,1360 +0,0 @@
-/*
- * Copyright 2017-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* We need to use some deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "internal/e_os.h"
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-#include <assert.h>
-
-#include <openssl/conf.h>
-#include <openssl/evp.h>
-#include <openssl/err.h>
-#include <openssl/engine.h>
-#include <openssl/objects.h>
-#include "crypto/cryptodev.h"
-#include "internal/nelem.h"
-
-/* #define ENGINE_DEVCRYPTO_DEBUG */
-
-#if CRYPTO_ALGORITHM_MIN < CRYPTO_ALGORITHM_MAX
-#define CHECK_BSD_STYLE_MACROS
-#endif
-
-#define engine_devcrypto_id "devcrypto"
-
-/*
- * Use session2_op on FreeBSD which permits requesting specific
- * drivers or classes of drivers at session creation time.
- */
-#ifdef CIOCGSESSION2
-typedef struct session2_op session_op_t;
-#else
-typedef struct session_op session_op_t;
-#endif
-
-/*
- * ONE global file descriptor for all sessions.  This allows operations
- * such as digest session data copying (see digest_copy()), but is also
- * saner...  why re-open /dev/crypto for every session?
- */
-static int cfd = -1;
-#define DEVCRYPTO_REQUIRE_ACCELERATED 0 /* require confirmation of acceleration */
-#define DEVCRYPTO_USE_SOFTWARE 1 /* allow software drivers */
-#define DEVCRYPTO_REJECT_SOFTWARE 2 /* only disallow confirmed software drivers */
-
-#define DEVCRYPTO_DEFAULT_USE_SOFTDRIVERS DEVCRYPTO_REJECT_SOFTWARE
-static int use_softdrivers = DEVCRYPTO_DEFAULT_USE_SOFTDRIVERS;
-
-/*
- * cipher/digest status & acceleration definitions
- * Make sure the defaults are set to 0
- */
-struct driver_info_st {
-    enum devcrypto_status_t {
-        DEVCRYPTO_STATUS_FAILURE = -3, /* unusable for other reason */
-        DEVCRYPTO_STATUS_NO_CIOCCPHASH = -2, /* hash state copy not supported */
-        DEVCRYPTO_STATUS_NO_CIOCGSESSION = -1, /* session open failed */
-        DEVCRYPTO_STATUS_UNKNOWN = 0, /* not tested yet */
-        DEVCRYPTO_STATUS_USABLE = 1 /* algo can be used */
-    } status;
-
-    enum devcrypto_accelerated_t {
-        DEVCRYPTO_NOT_ACCELERATED = -1, /* software implemented */
-        DEVCRYPTO_ACCELERATION_UNKNOWN = 0, /* acceleration support unknown */
-        DEVCRYPTO_ACCELERATED = 1 /* hardware accelerated */
-    } accelerated;
-
-    char *driver_name;
-};
-
-#ifdef OPENSSL_NO_DYNAMIC_ENGINE
-void engine_load_devcrypto_int(void);
-#endif
-
-static int clean_devcrypto_session(session_op_t *sess)
-{
-    if (ioctl(cfd, CIOCFSESSION, &sess->ses) < 0) {
-        ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
-        return 0;
-    }
-    memset(sess, 0, sizeof(*sess));
-    return 1;
-}
-
-/******************************************************************************
- *
- * Ciphers
- *
- * Because they all do the same basic operation, we have only one set of
- * method functions for them all to share, and a mapping table between
- * NIDs and cryptodev IDs, with all the necessary size data.
- *
- *****/
-
-struct cipher_ctx {
-    session_op_t sess;
-    int op; /* COP_ENCRYPT or COP_DECRYPT */
-    unsigned long mode; /* EVP_CIPH_*_MODE */
-
-    /* to handle ctr mode being a stream cipher */
-    unsigned char partial[EVP_MAX_BLOCK_LENGTH];
-    unsigned int blocksize, num;
-};
-
-static const struct cipher_data_st {
-    int nid;
-    int blocksize;
-    int keylen;
-    int ivlen;
-    int flags;
-    int devcryptoid;
-} cipher_data[] = {
-#ifndef OPENSSL_NO_DES
-    { NID_des_cbc, 8, 8, 8, EVP_CIPH_CBC_MODE, CRYPTO_DES_CBC },
-    { NID_des_ede3_cbc, 8, 24, 8, EVP_CIPH_CBC_MODE, CRYPTO_3DES_CBC },
-#endif
-#ifndef OPENSSL_NO_BF
-    { NID_bf_cbc, 8, 16, 8, EVP_CIPH_CBC_MODE, CRYPTO_BLF_CBC },
-#endif
-#ifndef OPENSSL_NO_CAST
-    { NID_cast5_cbc, 8, 16, 8, EVP_CIPH_CBC_MODE, CRYPTO_CAST_CBC },
-#endif
-    { NID_aes_128_cbc, 16, 128 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC },
-    { NID_aes_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC },
-    { NID_aes_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC },
-#ifndef OPENSSL_NO_RC4
-    { NID_rc4, 1, 16, 0, EVP_CIPH_STREAM_CIPHER, CRYPTO_ARC4 },
-#endif
-#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_AES_CTR)
-    { NID_aes_128_ctr, 16, 128 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR },
-    { NID_aes_192_ctr, 16, 192 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR },
-    { NID_aes_256_ctr, 16, 256 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR },
-#endif
-#if 0 /* Not yet supported */
-    { NID_aes_128_xts, 16, 128 / 8 * 2, 16, EVP_CIPH_XTS_MODE, CRYPTO_AES_XTS },
-    { NID_aes_256_xts, 16, 256 / 8 * 2, 16, EVP_CIPH_XTS_MODE, CRYPTO_AES_XTS },
-#endif
-#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_AES_ECB)
-    { NID_aes_128_ecb, 16, 128 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB },
-    { NID_aes_192_ecb, 16, 192 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB },
-    { NID_aes_256_ecb, 16, 256 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB },
-#endif
-#if 0 /* Not yet supported */
-    { NID_aes_128_gcm, 16, 128 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM },
-    { NID_aes_192_gcm, 16, 192 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM },
-    { NID_aes_256_gcm, 16, 256 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM },
-#endif
-#ifndef OPENSSL_NO_CAMELLIA
-    { NID_camellia_128_cbc, 16, 128 / 8, 16, EVP_CIPH_CBC_MODE,
-        CRYPTO_CAMELLIA_CBC },
-    { NID_camellia_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE,
-        CRYPTO_CAMELLIA_CBC },
-    { NID_camellia_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE,
-        CRYPTO_CAMELLIA_CBC },
-#endif
-};
-
-static size_t find_cipher_data_index(int nid)
-{
-    size_t i;
-
-    for (i = 0; i < OSSL_NELEM(cipher_data); i++)
-        if (nid == cipher_data[i].nid)
-            return i;
-    return (size_t)-1;
-}
-
-static size_t get_cipher_data_index(int nid)
-{
-    size_t i = find_cipher_data_index(nid);
-
-    if (i != (size_t)-1)
-        return i;
-
-    /*
-     * Code further down must make sure that only NIDs in the table above
-     * are used.  If any other NID reaches this function, there's a grave
-     * coding error further down.
-     */
-    assert("Code that never should be reached" == NULL);
-    return -1;
-}
-
-static const struct cipher_data_st *get_cipher_data(int nid)
-{
-    return &cipher_data[get_cipher_data_index(nid)];
-}
-
-/*
- * Following are the three necessary functions to map OpenSSL functionality
- * with cryptodev.
- */
-
-static int cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    struct cipher_ctx *cipher_ctx = (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-    const struct cipher_data_st *cipher_d = get_cipher_data(EVP_CIPHER_CTX_get_nid(ctx));
-    int ret;
-
-    /* cleanup a previous session */
-    if (cipher_ctx->sess.ses != 0 && clean_devcrypto_session(&cipher_ctx->sess) == 0)
-        return 0;
-
-    cipher_ctx->sess.cipher = cipher_d->devcryptoid;
-    cipher_ctx->sess.keylen = cipher_d->keylen;
-    cipher_ctx->sess.key = (void *)key;
-    cipher_ctx->op = enc ? COP_ENCRYPT : COP_DECRYPT;
-    cipher_ctx->mode = cipher_d->flags & EVP_CIPH_MODE;
-    cipher_ctx->blocksize = cipher_d->blocksize;
-#ifdef CIOCGSESSION2
-    cipher_ctx->sess.crid = (use_softdrivers == DEVCRYPTO_USE_SOFTWARE) ? CRYPTO_FLAG_SOFTWARE | CRYPTO_FLAG_HARDWARE : CRYPTO_FLAG_HARDWARE;
-    ret = ioctl(cfd, CIOCGSESSION2, &cipher_ctx->sess);
-#else
-    ret = ioctl(cfd, CIOCGSESSION, &cipher_ctx->sess);
-#endif
-    if (ret < 0) {
-        ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
-        return 0;
-    }
-
-    return 1;
-}
-
-static int cipher_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    struct cipher_ctx *cipher_ctx = (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-    struct crypt_op cryp;
-    unsigned char *iv = EVP_CIPHER_CTX_iv_noconst(ctx);
-#if !defined(COP_FLAG_WRITE_IV)
-    unsigned char saved_iv[EVP_MAX_IV_LENGTH];
-    const unsigned char *ivptr;
-    size_t nblocks, ivlen;
-#endif
-
-    memset(&cryp, 0, sizeof(cryp));
-    cryp.ses = cipher_ctx->sess.ses;
-    cryp.len = inl;
-    cryp.src = (void *)in;
-    cryp.dst = (void *)out;
-    cryp.iv = (void *)iv;
-    cryp.op = cipher_ctx->op;
-#if !defined(COP_FLAG_WRITE_IV)
-    cryp.flags = 0;
-
-    ivlen = EVP_CIPHER_CTX_get_iv_length(ctx);
-    if (ivlen > 0)
-        switch (cipher_ctx->mode) {
-        case EVP_CIPH_CBC_MODE:
-            assert(inl >= ivlen);
-            if (!EVP_CIPHER_CTX_is_encrypting(ctx)) {
-                ivptr = in + inl - ivlen;
-                memcpy(saved_iv, ivptr, ivlen);
-            }
-            break;
-
-        case EVP_CIPH_CTR_MODE:
-            break;
-
-        default: /* should not happen */
-            return 0;
-        }
-#else
-    cryp.flags = COP_FLAG_WRITE_IV;
-#endif
-
-    if (ioctl(cfd, CIOCCRYPT, &cryp) < 0) {
-        ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
-        return 0;
-    }
-
-#if !defined(COP_FLAG_WRITE_IV)
-    if (ivlen > 0)
-        switch (cipher_ctx->mode) {
-        case EVP_CIPH_CBC_MODE:
-            assert(inl >= ivlen);
-            if (EVP_CIPHER_CTX_is_encrypting(ctx))
-                ivptr = out + inl - ivlen;
-            else
-                ivptr = saved_iv;
-
-            memcpy(iv, ivptr, ivlen);
-            break;
-
-        case EVP_CIPH_CTR_MODE:
-            nblocks = (inl + cipher_ctx->blocksize - 1)
-                / cipher_ctx->blocksize;
-            do {
-                ivlen--;
-                nblocks += iv[ivlen];
-                iv[ivlen] = (uint8_t)nblocks;
-                nblocks >>= 8;
-            } while (ivlen);
-            break;
-
-        default: /* should not happen */
-            return 0;
-        }
-#endif
-
-    return 1;
-}
-
-static int ctr_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    struct cipher_ctx *cipher_ctx = (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-    size_t nblocks, len;
-
-    /* initial partial block */
-    while (cipher_ctx->num && inl) {
-        (*out++) = *(in++) ^ cipher_ctx->partial[cipher_ctx->num];
-        --inl;
-        cipher_ctx->num = (cipher_ctx->num + 1) % cipher_ctx->blocksize;
-    }
-
-    /* full blocks */
-    if (inl > cipher_ctx->blocksize) {
-        nblocks = inl / cipher_ctx->blocksize;
-        len = nblocks * cipher_ctx->blocksize;
-        if (cipher_do_cipher(ctx, out, in, len) < 1)
-            return 0;
-        inl -= len;
-        out += len;
-        in += len;
-    }
-
-    /* final partial block */
-    if (inl) {
-        memset(cipher_ctx->partial, 0, cipher_ctx->blocksize);
-        if (cipher_do_cipher(ctx, cipher_ctx->partial, cipher_ctx->partial,
-                cipher_ctx->blocksize)
-            < 1)
-            return 0;
-        while (inl--) {
-            out[cipher_ctx->num] = in[cipher_ctx->num]
-                ^ cipher_ctx->partial[cipher_ctx->num];
-            cipher_ctx->num++;
-        }
-    }
-
-    return 1;
-}
-
-static int cipher_ctrl(EVP_CIPHER_CTX *ctx, int type, int p1, void *p2)
-{
-    struct cipher_ctx *cipher_ctx = (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-    EVP_CIPHER_CTX *to_ctx = (EVP_CIPHER_CTX *)p2;
-    struct cipher_ctx *to_cipher_ctx;
-
-    switch (type) {
-
-    case EVP_CTRL_COPY:
-        if (cipher_ctx == NULL)
-            return 1;
-        /* when copying the context, a new session needs to be initialized */
-        to_cipher_ctx = (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(to_ctx);
-        memset(&to_cipher_ctx->sess, 0, sizeof(to_cipher_ctx->sess));
-        return cipher_init(to_ctx, (void *)cipher_ctx->sess.key, EVP_CIPHER_CTX_iv(ctx),
-            (cipher_ctx->op == COP_ENCRYPT));
-
-    case EVP_CTRL_INIT:
-        memset(&cipher_ctx->sess, 0, sizeof(cipher_ctx->sess));
-        return 1;
-
-    default:
-        break;
-    }
-
-    return -1;
-}
-
-static int cipher_cleanup(EVP_CIPHER_CTX *ctx)
-{
-    struct cipher_ctx *cipher_ctx = (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-
-    return clean_devcrypto_session(&cipher_ctx->sess);
-}
-
-/*
- * Keep tables of known nids, associated methods, selected ciphers, and driver
- * info.
- * Note that known_cipher_nids[] isn't necessarily indexed the same way as
- * cipher_data[] above, which the other tables are.
- */
-static int known_cipher_nids[OSSL_NELEM(cipher_data)];
-static int known_cipher_nids_amount = -1; /* -1 indicates not yet initialised */
-static EVP_CIPHER *known_cipher_methods[OSSL_NELEM(cipher_data)] = {
-    NULL,
-};
-static int selected_ciphers[OSSL_NELEM(cipher_data)];
-static struct driver_info_st cipher_driver_info[OSSL_NELEM(cipher_data)];
-
-static int devcrypto_test_cipher(size_t cipher_data_index)
-{
-    return (cipher_driver_info[cipher_data_index].status == DEVCRYPTO_STATUS_USABLE
-        && selected_ciphers[cipher_data_index] == 1
-        && (cipher_driver_info[cipher_data_index].accelerated
-                == DEVCRYPTO_ACCELERATED
-            || use_softdrivers == DEVCRYPTO_USE_SOFTWARE
-            || (cipher_driver_info[cipher_data_index].accelerated
-                    != DEVCRYPTO_NOT_ACCELERATED
-                && use_softdrivers == DEVCRYPTO_REJECT_SOFTWARE)));
-}
-
-static void prepare_cipher_methods(void)
-{
-    size_t i;
-    session_op_t sess;
-    unsigned long cipher_mode;
-#ifdef CIOCGSESSION2
-    struct crypt_find_op fop;
-    enum devcrypto_accelerated_t accelerated;
-#elif defined(CIOCGSESSINFO)
-    struct session_info_op siop;
-#endif
-
-    memset(&cipher_driver_info, 0, sizeof(cipher_driver_info));
-
-    memset(&sess, 0, sizeof(sess));
-    sess.key = (void *)"01234567890123456789012345678901234567890123456789";
-
-    for (i = 0, known_cipher_nids_amount = 0;
-        i < OSSL_NELEM(cipher_data); i++) {
-
-        selected_ciphers[i] = 1;
-        /*
-         * Check that the cipher is usable
-         */
-        sess.cipher = cipher_data[i].devcryptoid;
-        sess.keylen = cipher_data[i].keylen;
-#ifdef CIOCGSESSION2
-        /*
-         * When using CIOCGSESSION2, first try to allocate a hardware
-         * ("accelerated") session.  If that fails, fall back to
-         * allocating a software session.
-         */
-        sess.crid = CRYPTO_FLAG_HARDWARE;
-        if (ioctl(cfd, CIOCGSESSION2, &sess) == 0) {
-            accelerated = DEVCRYPTO_ACCELERATED;
-        } else {
-            sess.crid = CRYPTO_FLAG_SOFTWARE;
-            if (ioctl(cfd, CIOCGSESSION2, &sess) < 0) {
-                cipher_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCGSESSION;
-                continue;
-            }
-            accelerated = DEVCRYPTO_NOT_ACCELERATED;
-        }
-#else
-        if (ioctl(cfd, CIOCGSESSION, &sess) < 0) {
-            cipher_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCGSESSION;
-            continue;
-        }
-#endif
-
-        cipher_mode = cipher_data[i].flags & EVP_CIPH_MODE;
-
-        if ((known_cipher_methods[i] = EVP_CIPHER_meth_new(cipher_data[i].nid,
-                 cipher_mode == EVP_CIPH_CTR_MODE ? 1 : cipher_data[i].blocksize,
-                 cipher_data[i].keylen))
-                == NULL
-            || !EVP_CIPHER_meth_set_iv_length(known_cipher_methods[i],
-                cipher_data[i].ivlen)
-            || !EVP_CIPHER_meth_set_flags(known_cipher_methods[i],
-                cipher_data[i].flags
-                    | EVP_CIPH_CUSTOM_COPY
-                    | EVP_CIPH_CTRL_INIT
-                    | EVP_CIPH_FLAG_DEFAULT_ASN1)
-            || !EVP_CIPHER_meth_set_init(known_cipher_methods[i], cipher_init)
-            || !EVP_CIPHER_meth_set_do_cipher(known_cipher_methods[i],
-                cipher_mode == EVP_CIPH_CTR_MODE ? ctr_do_cipher : cipher_do_cipher)
-            || !EVP_CIPHER_meth_set_ctrl(known_cipher_methods[i], cipher_ctrl)
-            || !EVP_CIPHER_meth_set_cleanup(known_cipher_methods[i],
-                cipher_cleanup)
-            || !EVP_CIPHER_meth_set_impl_ctx_size(known_cipher_methods[i],
-                sizeof(struct cipher_ctx))) {
-            cipher_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE;
-            EVP_CIPHER_meth_free(known_cipher_methods[i]);
-            known_cipher_methods[i] = NULL;
-        } else {
-            cipher_driver_info[i].status = DEVCRYPTO_STATUS_USABLE;
-#ifdef CIOCGSESSION2
-            cipher_driver_info[i].accelerated = accelerated;
-            fop.crid = sess.crid;
-            if (ioctl(cfd, CIOCFINDDEV, &fop) == 0) {
-                cipher_driver_info[i].driver_name = OPENSSL_strndup(fop.name, sizeof(fop.name));
-            }
-#elif defined(CIOCGSESSINFO)
-            siop.ses = sess.ses;
-            if (ioctl(cfd, CIOCGSESSINFO, &siop) < 0) {
-                cipher_driver_info[i].accelerated = DEVCRYPTO_ACCELERATION_UNKNOWN;
-            } else {
-                cipher_driver_info[i].driver_name = OPENSSL_strndup(siop.cipher_info.cra_driver_name,
-                    CRYPTODEV_MAX_ALG_NAME);
-                if (!(siop.flags & SIOP_FLAG_KERNEL_DRIVER_ONLY))
-                    cipher_driver_info[i].accelerated = DEVCRYPTO_NOT_ACCELERATED;
-                else
-                    cipher_driver_info[i].accelerated = DEVCRYPTO_ACCELERATED;
-            }
-#endif /* CIOCGSESSINFO */
-        }
-        ioctl(cfd, CIOCFSESSION, &sess.ses);
-        if (devcrypto_test_cipher(i)) {
-            known_cipher_nids[known_cipher_nids_amount++] = cipher_data[i].nid;
-        }
-    }
-}
-
-static void rebuild_known_cipher_nids(ENGINE *e)
-{
-    size_t i;
-
-    for (i = 0, known_cipher_nids_amount = 0; i < OSSL_NELEM(cipher_data); i++) {
-        if (devcrypto_test_cipher(i))
-            known_cipher_nids[known_cipher_nids_amount++] = cipher_data[i].nid;
-    }
-    ENGINE_unregister_ciphers(e);
-    ENGINE_register_ciphers(e);
-}
-
-static const EVP_CIPHER *get_cipher_method(int nid)
-{
-    size_t i = get_cipher_data_index(nid);
-
-    if (i == (size_t)-1)
-        return NULL;
-    return known_cipher_methods[i];
-}
-
-static int get_cipher_nids(const int **nids)
-{
-    *nids = known_cipher_nids;
-    return known_cipher_nids_amount;
-}
-
-static void destroy_cipher_method(int nid)
-{
-    size_t i = get_cipher_data_index(nid);
-
-    EVP_CIPHER_meth_free(known_cipher_methods[i]);
-    known_cipher_methods[i] = NULL;
-}
-
-static void destroy_all_cipher_methods(void)
-{
-    size_t i;
-
-    for (i = 0; i < OSSL_NELEM(cipher_data); i++) {
-        destroy_cipher_method(cipher_data[i].nid);
-        OPENSSL_free(cipher_driver_info[i].driver_name);
-        cipher_driver_info[i].driver_name = NULL;
-    }
-}
-
-static int devcrypto_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
-    const int **nids, int nid)
-{
-    if (cipher == NULL)
-        return get_cipher_nids(nids);
-
-    *cipher = get_cipher_method(nid);
-
-    return *cipher != NULL;
-}
-
-static void devcrypto_select_all_ciphers(int *cipher_list)
-{
-    size_t i;
-
-    for (i = 0; i < OSSL_NELEM(cipher_data); i++)
-        cipher_list[i] = 1;
-}
-
-static int cryptodev_select_cipher_cb(const char *str, int len, void *usr)
-{
-    int *cipher_list = (int *)usr;
-    char *name;
-    const EVP_CIPHER *EVP;
-    size_t i;
-
-    if (len == 0)
-        return 1;
-    if (usr == NULL || (name = OPENSSL_strndup(str, len)) == NULL)
-        return 0;
-    EVP = EVP_get_cipherbyname(name);
-    if (EVP == NULL)
-        fprintf(stderr, "devcrypto: unknown cipher %s\n", name);
-    else if ((i = find_cipher_data_index(EVP_CIPHER_get_nid(EVP))) != (size_t)-1)
-        cipher_list[i] = 1;
-    else
-        fprintf(stderr, "devcrypto: cipher %s not available\n", name);
-    OPENSSL_free(name);
-    return 1;
-}
-
-static void dump_cipher_info(void)
-{
-    size_t i;
-    const char *name;
-
-    fprintf(stderr, "Information about ciphers supported by the /dev/crypto"
-                    " engine:\n");
-#ifndef CIOCGSESSINFO
-    fprintf(stderr, "CIOCGSESSINFO (session info call) unavailable\n");
-#endif
-    for (i = 0; i < OSSL_NELEM(cipher_data); i++) {
-        name = OBJ_nid2sn(cipher_data[i].nid);
-        fprintf(stderr, "Cipher %s, NID=%d, /dev/crypto info: id=%d, ",
-            name ? name : "unknown", cipher_data[i].nid,
-            cipher_data[i].devcryptoid);
-        if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCGSESSION) {
-            fprintf(stderr, "CIOCGSESSION (session open call) failed\n");
-            continue;
-        }
-        fprintf(stderr, "driver=%s ", cipher_driver_info[i].driver_name ? cipher_driver_info[i].driver_name : "unknown");
-        if (cipher_driver_info[i].accelerated == DEVCRYPTO_ACCELERATED)
-            fprintf(stderr, "(hw accelerated)");
-        else if (cipher_driver_info[i].accelerated == DEVCRYPTO_NOT_ACCELERATED)
-            fprintf(stderr, "(software)");
-        else
-            fprintf(stderr, "(acceleration status unknown)");
-        if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_FAILURE)
-            fprintf(stderr, ". Cipher setup failed");
-        fprintf(stderr, "\n");
-    }
-    fprintf(stderr, "\n");
-}
-
-/*
- * We only support digests if the cryptodev implementation supports multiple
- * data updates and session copying.  Otherwise, we would be forced to maintain
- * a cache, which is perilous if there's a lot of data coming in (if someone
- * wants to checksum an OpenSSL tarball, for example).
- */
-#if defined(CIOCCPHASH) && defined(COP_FLAG_UPDATE) && defined(COP_FLAG_FINAL)
-#define IMPLEMENT_DIGEST
-
-/******************************************************************************
- *
- * Digests
- *
- * Because they all do the same basic operation, we have only one set of
- * method functions for them all to share, and a mapping table between
- * NIDs and cryptodev IDs, with all the necessary size data.
- *
- *****/
-
-struct digest_ctx {
-    session_op_t sess;
-    /* This signals that the init function was called, not that it succeeded. */
-    int init_called;
-    unsigned char digest_res[HASH_MAX_LEN];
-};
-
-static const struct digest_data_st {
-    int nid;
-    int blocksize;
-    int digestlen;
-    int devcryptoid;
-} digest_data[] = {
-#ifndef OPENSSL_NO_MD5
-    { NID_md5, /* MD5_CBLOCK */ 64, 16, CRYPTO_MD5 },
-#endif
-    { NID_sha1, SHA_CBLOCK, 20, CRYPTO_SHA1 },
-#ifndef OPENSSL_NO_RMD160
-#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_RIPEMD160)
-    { NID_ripemd160, /* RIPEMD160_CBLOCK */ 64, 20, CRYPTO_RIPEMD160 },
-#endif
-#endif
-#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_SHA2_224)
-    { NID_sha224, SHA256_CBLOCK, 224 / 8, CRYPTO_SHA2_224 },
-#endif
-#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_SHA2_256)
-    { NID_sha256, SHA256_CBLOCK, 256 / 8, CRYPTO_SHA2_256 },
-#endif
-#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_SHA2_384)
-    { NID_sha384, SHA512_CBLOCK, 384 / 8, CRYPTO_SHA2_384 },
-#endif
-#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_SHA2_512)
-    { NID_sha512, SHA512_CBLOCK, 512 / 8, CRYPTO_SHA2_512 },
-#endif
-};
-
-static size_t find_digest_data_index(int nid)
-{
-    size_t i;
-
-    for (i = 0; i < OSSL_NELEM(digest_data); i++)
-        if (nid == digest_data[i].nid)
-            return i;
-    return (size_t)-1;
-}
-
-static size_t get_digest_data_index(int nid)
-{
-    size_t i = find_digest_data_index(nid);
-
-    if (i != (size_t)-1)
-        return i;
-
-    /*
-     * Code further down must make sure that only NIDs in the table above
-     * are used.  If any other NID reaches this function, there's a grave
-     * coding error further down.
-     */
-    assert("Code that never should be reached" == NULL);
-    return -1;
-}
-
-static const struct digest_data_st *get_digest_data(int nid)
-{
-    return &digest_data[get_digest_data_index(nid)];
-}
-
-/*
- * Following are the five necessary functions to map OpenSSL functionality
- * with cryptodev: init, update, final, cleanup, and copy.
- */
-
-static int digest_init(EVP_MD_CTX *ctx)
-{
-    struct digest_ctx *digest_ctx = (struct digest_ctx *)EVP_MD_CTX_get0_md_data(ctx);
-    const struct digest_data_st *digest_d = get_digest_data(EVP_MD_CTX_get_type(ctx));
-
-    digest_ctx->init_called = 1;
-
-    memset(&digest_ctx->sess, 0, sizeof(digest_ctx->sess));
-    digest_ctx->sess.mac = digest_d->devcryptoid;
-    if (ioctl(cfd, CIOCGSESSION, &digest_ctx->sess) < 0) {
-        ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
-        return 0;
-    }
-    return 1;
-}
-
-static int digest_op(struct digest_ctx *ctx, const void *src, size_t srclen,
-    void *res, unsigned int flags)
-{
-    struct crypt_op cryp;
-
-    memset(&cryp, 0, sizeof(cryp));
-    cryp.ses = ctx->sess.ses;
-    cryp.len = srclen;
-    cryp.src = (void *)src;
-    cryp.dst = NULL;
-    cryp.mac = res;
-    cryp.flags = flags;
-    return ioctl(cfd, CIOCCRYPT, &cryp);
-}
-
-static int digest_update(EVP_MD_CTX *ctx, const void *data, size_t count)
-{
-    struct digest_ctx *digest_ctx = (struct digest_ctx *)EVP_MD_CTX_get0_md_data(ctx);
-
-    if (count == 0)
-        return 1;
-
-    if (digest_ctx == NULL)
-        return 0;
-
-    if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT)) {
-        if (digest_op(digest_ctx, data, count, digest_ctx->digest_res, 0) >= 0)
-            return 1;
-    } else if (digest_op(digest_ctx, data, count, NULL, COP_FLAG_UPDATE) >= 0) {
-        return 1;
-    }
-
-    ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
-    return 0;
-}
-
-static int digest_final(EVP_MD_CTX *ctx, unsigned char *md)
-{
-    struct digest_ctx *digest_ctx = (struct digest_ctx *)EVP_MD_CTX_get0_md_data(ctx);
-
-    if (md == NULL || digest_ctx == NULL)
-        return 0;
-
-    if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT)) {
-        memcpy(md, digest_ctx->digest_res, EVP_MD_CTX_get_size(ctx));
-    } else if (digest_op(digest_ctx, NULL, 0, md, COP_FLAG_FINAL) < 0) {
-        ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
-        return 0;
-    }
-
-    return 1;
-}
-
-static int digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from)
-{
-    struct digest_ctx *digest_from = (struct digest_ctx *)EVP_MD_CTX_get0_md_data(from);
-    struct digest_ctx *digest_to = (struct digest_ctx *)EVP_MD_CTX_get0_md_data(to);
-    struct cphash_op cphash;
-
-    if (digest_from == NULL || digest_from->init_called != 1)
-        return 1;
-
-    if (!digest_init(to)) {
-        ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
-        return 0;
-    }
-
-    cphash.src_ses = digest_from->sess.ses;
-    cphash.dst_ses = digest_to->sess.ses;
-    if (ioctl(cfd, CIOCCPHASH, &cphash) < 0) {
-        ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
-        return 0;
-    }
-    return 1;
-}
-
-static int digest_cleanup(EVP_MD_CTX *ctx)
-{
-    struct digest_ctx *digest_ctx = (struct digest_ctx *)EVP_MD_CTX_get0_md_data(ctx);
-
-    if (digest_ctx == NULL)
-        return 1;
-
-    return clean_devcrypto_session(&digest_ctx->sess);
-}
-
-/*
- * Keep tables of known nids, associated methods, selected digests, and
- * driver info.
- * Note that known_digest_nids[] isn't necessarily indexed the same way as
- * digest_data[] above, which the other tables are.
- */
-static int known_digest_nids[OSSL_NELEM(digest_data)];
-static int known_digest_nids_amount = -1; /* -1 indicates not yet initialised */
-static EVP_MD *known_digest_methods[OSSL_NELEM(digest_data)] = {
-    NULL,
-};
-static int selected_digests[OSSL_NELEM(digest_data)];
-static struct driver_info_st digest_driver_info[OSSL_NELEM(digest_data)];
-
-static int devcrypto_test_digest(size_t digest_data_index)
-{
-    return (digest_driver_info[digest_data_index].status == DEVCRYPTO_STATUS_USABLE
-        && selected_digests[digest_data_index] == 1
-        && (digest_driver_info[digest_data_index].accelerated
-                == DEVCRYPTO_ACCELERATED
-            || use_softdrivers == DEVCRYPTO_USE_SOFTWARE
-            || (digest_driver_info[digest_data_index].accelerated
-                    != DEVCRYPTO_NOT_ACCELERATED
-                && use_softdrivers == DEVCRYPTO_REJECT_SOFTWARE)));
-}
-
-static void rebuild_known_digest_nids(ENGINE *e)
-{
-    size_t i;
-
-    for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data); i++) {
-        if (devcrypto_test_digest(i))
-            known_digest_nids[known_digest_nids_amount++] = digest_data[i].nid;
-    }
-    ENGINE_unregister_digests(e);
-    ENGINE_register_digests(e);
-}
-
-static void prepare_digest_methods(void)
-{
-    size_t i;
-    session_op_t sess1, sess2;
-#ifdef CIOCGSESSINFO
-    struct session_info_op siop;
-#endif
-    struct cphash_op cphash;
-
-    memset(&digest_driver_info, 0, sizeof(digest_driver_info));
-
-    memset(&sess1, 0, sizeof(sess1));
-    memset(&sess2, 0, sizeof(sess2));
-
-    for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data);
-        i++) {
-
-        selected_digests[i] = 1;
-
-        /*
-         * Check that the digest is usable
-         */
-        sess1.mac = digest_data[i].devcryptoid;
-        sess2.ses = 0;
-        if (ioctl(cfd, CIOCGSESSION, &sess1) < 0) {
-            digest_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCGSESSION;
-            goto finish;
-        }
-
-#ifdef CIOCGSESSINFO
-        /* gather hardware acceleration info from the driver */
-        siop.ses = sess1.ses;
-        if (ioctl(cfd, CIOCGSESSINFO, &siop) < 0) {
-            digest_driver_info[i].accelerated = DEVCRYPTO_ACCELERATION_UNKNOWN;
-        } else {
-            digest_driver_info[i].driver_name = OPENSSL_strndup(siop.hash_info.cra_driver_name,
-                CRYPTODEV_MAX_ALG_NAME);
-            if (siop.flags & SIOP_FLAG_KERNEL_DRIVER_ONLY)
-                digest_driver_info[i].accelerated = DEVCRYPTO_ACCELERATED;
-            else
-                digest_driver_info[i].accelerated = DEVCRYPTO_NOT_ACCELERATED;
-        }
-#endif
-
-        /* digest must be capable of hash state copy */
-        sess2.mac = sess1.mac;
-        if (ioctl(cfd, CIOCGSESSION, &sess2) < 0) {
-            digest_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE;
-            goto finish;
-        }
-        cphash.src_ses = sess1.ses;
-        cphash.dst_ses = sess2.ses;
-        if (ioctl(cfd, CIOCCPHASH, &cphash) < 0) {
-            digest_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCCPHASH;
-            goto finish;
-        }
-        if ((known_digest_methods[i] = EVP_MD_meth_new(digest_data[i].nid,
-                 NID_undef))
-                == NULL
-            || !EVP_MD_meth_set_input_blocksize(known_digest_methods[i],
-                digest_data[i].blocksize)
-            || !EVP_MD_meth_set_result_size(known_digest_methods[i],
-                digest_data[i].digestlen)
-            || !EVP_MD_meth_set_init(known_digest_methods[i], digest_init)
-            || !EVP_MD_meth_set_update(known_digest_methods[i], digest_update)
-            || !EVP_MD_meth_set_final(known_digest_methods[i], digest_final)
-            || !EVP_MD_meth_set_copy(known_digest_methods[i], digest_copy)
-            || !EVP_MD_meth_set_cleanup(known_digest_methods[i], digest_cleanup)
-            || !EVP_MD_meth_set_app_datasize(known_digest_methods[i],
-                sizeof(struct digest_ctx))) {
-            digest_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE;
-            EVP_MD_meth_free(known_digest_methods[i]);
-            known_digest_methods[i] = NULL;
-            goto finish;
-        }
-        digest_driver_info[i].status = DEVCRYPTO_STATUS_USABLE;
-    finish:
-        ioctl(cfd, CIOCFSESSION, &sess1.ses);
-        if (sess2.ses != 0)
-            ioctl(cfd, CIOCFSESSION, &sess2.ses);
-        if (devcrypto_test_digest(i))
-            known_digest_nids[known_digest_nids_amount++] = digest_data[i].nid;
-    }
-}
-
-static const EVP_MD *get_digest_method(int nid)
-{
-    size_t i = get_digest_data_index(nid);
-
-    if (i == (size_t)-1)
-        return NULL;
-    return known_digest_methods[i];
-}
-
-static int get_digest_nids(const int **nids)
-{
-    *nids = known_digest_nids;
-    return known_digest_nids_amount;
-}
-
-static void destroy_digest_method(int nid)
-{
-    size_t i = get_digest_data_index(nid);
-
-    EVP_MD_meth_free(known_digest_methods[i]);
-    known_digest_methods[i] = NULL;
-}
-
-static void destroy_all_digest_methods(void)
-{
-    size_t i;
-
-    for (i = 0; i < OSSL_NELEM(digest_data); i++) {
-        destroy_digest_method(digest_data[i].nid);
-        OPENSSL_free(digest_driver_info[i].driver_name);
-        digest_driver_info[i].driver_name = NULL;
-    }
-}
-
-static int devcrypto_digests(ENGINE *e, const EVP_MD **digest,
-    const int **nids, int nid)
-{
-    if (digest == NULL)
-        return get_digest_nids(nids);
-
-    *digest = get_digest_method(nid);
-
-    return *digest != NULL;
-}
-
-static void devcrypto_select_all_digests(int *digest_list)
-{
-    size_t i;
-
-    for (i = 0; i < OSSL_NELEM(digest_data); i++)
-        digest_list[i] = 1;
-}
-
-static int cryptodev_select_digest_cb(const char *str, int len, void *usr)
-{
-    int *digest_list = (int *)usr;
-    char *name;
-    const EVP_MD *EVP;
-    size_t i;
-
-    if (len == 0)
-        return 1;
-    if (usr == NULL || (name = OPENSSL_strndup(str, len)) == NULL)
-        return 0;
-    EVP = EVP_get_digestbyname(name);
-    if (EVP == NULL)
-        fprintf(stderr, "devcrypto: unknown digest %s\n", name);
-    else if ((i = find_digest_data_index(EVP_MD_get_type(EVP))) != (size_t)-1)
-        digest_list[i] = 1;
-    else
-        fprintf(stderr, "devcrypto: digest %s not available\n", name);
-    OPENSSL_free(name);
-    return 1;
-}
-
-static void dump_digest_info(void)
-{
-    size_t i;
-    const char *name;
-
-    fprintf(stderr, "Information about digests supported by the /dev/crypto"
-                    " engine:\n");
-#ifndef CIOCGSESSINFO
-    fprintf(stderr, "CIOCGSESSINFO (session info call) unavailable\n");
-#endif
-
-    for (i = 0; i < OSSL_NELEM(digest_data); i++) {
-        name = OBJ_nid2sn(digest_data[i].nid);
-        fprintf(stderr, "Digest %s, NID=%d, /dev/crypto info: id=%d, driver=%s",
-            name ? name : "unknown", digest_data[i].nid,
-            digest_data[i].devcryptoid,
-            digest_driver_info[i].driver_name ? digest_driver_info[i].driver_name : "unknown");
-        if (digest_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCGSESSION) {
-            fprintf(stderr, ". CIOCGSESSION (session open) failed\n");
-            continue;
-        }
-        if (digest_driver_info[i].accelerated == DEVCRYPTO_ACCELERATED)
-            fprintf(stderr, " (hw accelerated)");
-        else if (digest_driver_info[i].accelerated == DEVCRYPTO_NOT_ACCELERATED)
-            fprintf(stderr, " (software)");
-        else
-            fprintf(stderr, " (acceleration status unknown)");
-        if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_FAILURE)
-            fprintf(stderr, ". Cipher setup failed\n");
-        else if (digest_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCCPHASH)
-            fprintf(stderr, ", CIOCCPHASH failed\n");
-        else
-            fprintf(stderr, ", CIOCCPHASH capable\n");
-    }
-    fprintf(stderr, "\n");
-}
-
-#endif
-
-/******************************************************************************
- *
- * CONTROL COMMANDS
- *
- *****/
-
-#define DEVCRYPTO_CMD_USE_SOFTDRIVERS ENGINE_CMD_BASE
-#define DEVCRYPTO_CMD_CIPHERS (ENGINE_CMD_BASE + 1)
-#define DEVCRYPTO_CMD_DIGESTS (ENGINE_CMD_BASE + 2)
-#define DEVCRYPTO_CMD_DUMP_INFO (ENGINE_CMD_BASE + 3)
-
-static const ENGINE_CMD_DEFN devcrypto_cmds[] = {
-#if defined(CIOCGSESSINFO) || defined(CIOCGSESSION2)
-    { DEVCRYPTO_CMD_USE_SOFTDRIVERS,
-        "USE_SOFTDRIVERS",
-        "specifies whether to use software (not accelerated) drivers (" OPENSSL_MSTR(DEVCRYPTO_REQUIRE_ACCELERATED) "=use only accelerated drivers, " OPENSSL_MSTR(DEVCRYPTO_USE_SOFTWARE) "=allow all drivers, " OPENSSL_MSTR(DEVCRYPTO_REJECT_SOFTWARE) "=use if acceleration can't be determined) [default=" OPENSSL_MSTR(DEVCRYPTO_DEFAULT_USE_SOFTDRIVERS) "]",
-        ENGINE_CMD_FLAG_NUMERIC },
-#endif
-
-    { DEVCRYPTO_CMD_CIPHERS,
-        "CIPHERS",
-        "either ALL, NONE, or a comma-separated list of ciphers to enable [default=ALL]",
-        ENGINE_CMD_FLAG_STRING },
-
-#ifdef IMPLEMENT_DIGEST
-    { DEVCRYPTO_CMD_DIGESTS,
-        "DIGESTS",
-        "either ALL, NONE, or a comma-separated list of digests to enable [default=ALL]",
-        ENGINE_CMD_FLAG_STRING },
-#endif
-
-    { DEVCRYPTO_CMD_DUMP_INFO,
-        "DUMP_INFO",
-        "dump info about each algorithm to stderr; use 'openssl engine -pre DUMP_INFO devcrypto'",
-        ENGINE_CMD_FLAG_NO_INPUT },
-
-    { 0, NULL, NULL, 0 }
-};
-
-static int devcrypto_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void))
-{
-    int *new_list;
-    switch (cmd) {
-#if defined(CIOCGSESSINFO) || defined(CIOCGSESSION2)
-    case DEVCRYPTO_CMD_USE_SOFTDRIVERS:
-        switch (i) {
-        case DEVCRYPTO_REQUIRE_ACCELERATED:
-        case DEVCRYPTO_USE_SOFTWARE:
-        case DEVCRYPTO_REJECT_SOFTWARE:
-            break;
-        default:
-            fprintf(stderr, "devcrypto: invalid value (%ld) for USE_SOFTDRIVERS\n", i);
-            return 0;
-        }
-        if (use_softdrivers == i)
-            return 1;
-        use_softdrivers = i;
-#ifdef IMPLEMENT_DIGEST
-        rebuild_known_digest_nids(e);
-#endif
-        rebuild_known_cipher_nids(e);
-        return 1;
-#endif /* CIOCGSESSINFO || CIOCGSESSION2 */
-
-    case DEVCRYPTO_CMD_CIPHERS:
-        if (p == NULL)
-            return 1;
-        if (OPENSSL_strcasecmp((const char *)p, "ALL") == 0) {
-            devcrypto_select_all_ciphers(selected_ciphers);
-        } else if (OPENSSL_strcasecmp((const char *)p, "NONE") == 0) {
-            memset(selected_ciphers, 0, sizeof(selected_ciphers));
-        } else {
-            new_list = OPENSSL_zalloc(sizeof(selected_ciphers));
-            if (!CONF_parse_list(p, ',', 1, cryptodev_select_cipher_cb, new_list)) {
-                OPENSSL_free(new_list);
-                return 0;
-            }
-            memcpy(selected_ciphers, new_list, sizeof(selected_ciphers));
-            OPENSSL_free(new_list);
-        }
-        rebuild_known_cipher_nids(e);
-        return 1;
-
-#ifdef IMPLEMENT_DIGEST
-    case DEVCRYPTO_CMD_DIGESTS:
-        if (p == NULL)
-            return 1;
-        if (OPENSSL_strcasecmp((const char *)p, "ALL") == 0) {
-            devcrypto_select_all_digests(selected_digests);
-        } else if (OPENSSL_strcasecmp((const char *)p, "NONE") == 0) {
-            memset(selected_digests, 0, sizeof(selected_digests));
-        } else {
-            new_list = OPENSSL_zalloc(sizeof(selected_digests));
-            if (!CONF_parse_list(p, ',', 1, cryptodev_select_digest_cb, new_list)) {
-                OPENSSL_free(new_list);
-                return 0;
-            }
-            memcpy(selected_digests, new_list, sizeof(selected_digests));
-            OPENSSL_free(new_list);
-        }
-        rebuild_known_digest_nids(e);
-        return 1;
-#endif /* IMPLEMENT_DIGEST */
-
-    case DEVCRYPTO_CMD_DUMP_INFO:
-        dump_cipher_info();
-#ifdef IMPLEMENT_DIGEST
-        dump_digest_info();
-#endif
-        return 1;
-
-    default:
-        break;
-    }
-    return 0;
-}
-
-/******************************************************************************
- *
- * LOAD / UNLOAD
- *
- *****/
-
-/*
- * Opens /dev/crypto
- */
-static int open_devcrypto(void)
-{
-    int fd;
-
-    if (cfd >= 0)
-        return 1;
-
-    if ((fd = open("/dev/crypto", O_RDWR, 0)) < 0) {
-#ifndef ENGINE_DEVCRYPTO_DEBUG
-        if (errno != ENOENT && errno != ENXIO)
-#endif
-            fprintf(stderr, "Could not open /dev/crypto: %s\n", strerror(errno));
-        return 0;
-    }
-
-#ifdef CRIOGET
-    if (ioctl(fd, CRIOGET, &cfd) < 0) {
-        fprintf(stderr, "Could not create crypto fd: %s\n", strerror(errno));
-        close(fd);
-        cfd = -1;
-        return 0;
-    }
-    close(fd);
-#else
-    cfd = fd;
-#endif
-
-    return 1;
-}
-
-static int close_devcrypto(void)
-{
-    int ret;
-
-    if (cfd < 0)
-        return 1;
-    ret = close(cfd);
-    cfd = -1;
-    if (ret != 0) {
-        fprintf(stderr, "Error closing /dev/crypto: %s\n", strerror(errno));
-        return 0;
-    }
-    return 1;
-}
-
-static int devcrypto_unload(ENGINE *e)
-{
-    destroy_all_cipher_methods();
-#ifdef IMPLEMENT_DIGEST
-    destroy_all_digest_methods();
-#endif
-
-    close_devcrypto();
-
-    return 1;
-}
-
-static int bind_devcrypto(ENGINE *e)
-{
-
-    if (!ENGINE_set_id(e, engine_devcrypto_id)
-        || !ENGINE_set_name(e, "/dev/crypto engine")
-        || !ENGINE_set_destroy_function(e, devcrypto_unload)
-        || !ENGINE_set_cmd_defns(e, devcrypto_cmds)
-        || !ENGINE_set_ctrl_function(e, devcrypto_ctrl))
-        return 0;
-
-    prepare_cipher_methods();
-#ifdef IMPLEMENT_DIGEST
-    prepare_digest_methods();
-#endif
-
-    return (ENGINE_set_ciphers(e, devcrypto_ciphers)
-#ifdef IMPLEMENT_DIGEST
-        && ENGINE_set_digests(e, devcrypto_digests)
-#endif
-/*
- * Asymmetric ciphers aren't well supported with /dev/crypto.  Among the BSD
- * implementations, it seems to only exist in FreeBSD, and regarding the
- * parameters in its crypt_kop, the manual crypto(4) has this to say:
- *
- *    The semantics of these arguments are currently undocumented.
- *
- * Reading through the FreeBSD source code doesn't give much more than
- * their CRK_MOD_EXP implementation for ubsec.
- *
- * It doesn't look much better with cryptodev-linux.  They have the crypt_kop
- * structure as well as the command (CRK_*) in cryptodev.h, but no support
- * seems to be implemented at all for the moment.
- *
- * At the time of writing, it seems impossible to write proper support for
- * FreeBSD's asym features without some very deep knowledge and access to
- * specific kernel modules.
- *
- * /Richard Levitte, 2017-05-11
- */
-#if 0
-        && ENGINE_set_RSA(e, devcrypto_rsa)
-#ifndef OPENSSL_NO_DSA
-        && ENGINE_set_DSA(e, devcrypto_dsa)
-#endif
-#ifndef OPENSSL_NO_DH
-        && ENGINE_set_DH(e, devcrypto_dh)
-#endif
-#ifndef OPENSSL_NO_EC
-        && ENGINE_set_EC(e, devcrypto_ec)
-#endif
-#endif
-    );
-}
-
-#ifdef OPENSSL_NO_DYNAMIC_ENGINE
-/*
- * In case this engine is built into libcrypto, then it doesn't offer any
- * ability to be dynamically loadable.
- */
-void engine_load_devcrypto_int(void)
-{
-    ENGINE *e = NULL;
-
-    if (!open_devcrypto())
-        return;
-
-    if ((e = ENGINE_new()) == NULL
-        || !bind_devcrypto(e)) {
-        close_devcrypto();
-        ENGINE_free(e);
-        return;
-    }
-
-    ERR_set_mark();
-    ENGINE_add(e);
-    /*
-     * If the "add" worked, it gets a structural reference. So either way, we
-     * release our just-created reference.
-     */
-    ENGINE_free(e); /* Loose our local reference */
-    /*
-     * If the "add" didn't work, it was probably a conflict because it was
-     * already added (eg. someone calling ENGINE_load_blah then calling
-     * ENGINE_load_builtin_engines() perhaps).
-     */
-    ERR_pop_to_mark();
-}
-
-#else
-
-static int bind_helper(ENGINE *e, const char *id)
-{
-    if ((id && (strcmp(id, engine_devcrypto_id) != 0))
-        || !open_devcrypto())
-        return 0;
-    if (!bind_devcrypto(e)) {
-        close_devcrypto();
-        return 0;
-    }
-    return 1;
-}
-
-IMPLEMENT_DYNAMIC_CHECK_FN()
-IMPLEMENT_DYNAMIC_BIND_FN(bind_helper)
-
-#endif
diff --git a/deps/openssl/openssl/engines/e_loader_attic.c b/deps/openssl/openssl/engines/e_loader_attic.c
deleted file mode 100644
index 1141c1535db..00000000000
--- a/deps/openssl/openssl/engines/e_loader_attic.c
+++ /dev/null
@@ -1,1757 +0,0 @@
-/*
- * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* THIS ENGINE IS FOR TESTING PURPOSES ONLY. */
-
-/* This file has quite some overlap with providers/implementations/storemgmt/file_store.c */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include "internal/e_os.h" /* for stat */
-#include <string.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include <openssl/bio.h>
-#include <openssl/dsa.h> /* For d2i_DSAPrivateKey */
-#include <openssl/err.h>
-#include <openssl/evp.h>
-#include <openssl/pem.h>
-#include <openssl/pkcs12.h> /* For the PKCS8 stuff o.O */
-#include <openssl/rsa.h> /* For d2i_RSAPrivateKey */
-#include <openssl/safestack.h>
-#include <openssl/store.h>
-#include <openssl/ui.h>
-#include <openssl/engine.h>
-#include <openssl/x509.h> /* For the PKCS8 stuff o.O */
-#include "internal/asn1.h" /* For asn1_d2i_read_bio */
-#include "internal/o_dir.h"
-#include "internal/cryptlib.h"
-#include "crypto/ctype.h" /* For ossl_isdigit */
-#include "crypto/pem.h" /* For PVK and "blob" PEM headers */
-
-/* clang-format off */
-#include "e_loader_attic_err.c"
-/* clang-format on */
-
-DEFINE_STACK_OF(OSSL_STORE_INFO)
-
-#ifndef S_ISDIR
-#define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR)
-#endif
-
-/*-
- *  Password prompting
- *  ------------------
- */
-
-static char *file_get_pass(const UI_METHOD *ui_method, char *pass,
-    size_t maxsize, const char *desc, const char *info,
-    void *data)
-{
-    UI *ui = UI_new();
-    char *prompt = NULL;
-
-    if (ui == NULL) {
-        ATTICerr(0, ERR_R_UI_LIB);
-        return NULL;
-    }
-
-    if (ui_method != NULL)
-        UI_set_method(ui, ui_method);
-    UI_add_user_data(ui, data);
-
-    if ((prompt = UI_construct_prompt(ui, desc, info)) == NULL) {
-        ATTICerr(0, ERR_R_UI_LIB);
-        pass = NULL;
-    } else if (UI_add_input_string(ui, prompt, UI_INPUT_FLAG_DEFAULT_PWD,
-                   pass, 0, maxsize - 1)
-        <= 0) {
-        ATTICerr(0, ERR_R_UI_LIB);
-        pass = NULL;
-    } else {
-        switch (UI_process(ui)) {
-        case -2:
-            ATTICerr(0, ATTIC_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED);
-            pass = NULL;
-            break;
-        case -1:
-            ATTICerr(0, ERR_R_UI_LIB);
-            pass = NULL;
-            break;
-        default:
-            break;
-        }
-    }
-
-    OPENSSL_free(prompt);
-    UI_free(ui);
-    return pass;
-}
-
-struct pem_pass_data {
-    const UI_METHOD *ui_method;
-    void *data;
-    const char *prompt_desc;
-    const char *prompt_info;
-};
-
-static int file_fill_pem_pass_data(struct pem_pass_data *pass_data,
-    const char *desc, const char *info,
-    const UI_METHOD *ui_method, void *ui_data)
-{
-    if (pass_data == NULL)
-        return 0;
-    pass_data->ui_method = ui_method;
-    pass_data->data = ui_data;
-    pass_data->prompt_desc = desc;
-    pass_data->prompt_info = info;
-    return 1;
-}
-
-/* This is used anywhere a pem_password_cb is needed */
-static int file_get_pem_pass(char *buf, int num, int w, void *data)
-{
-    struct pem_pass_data *pass_data = data;
-    char *pass = file_get_pass(pass_data->ui_method, buf, num,
-        pass_data->prompt_desc, pass_data->prompt_info,
-        pass_data->data);
-
-    return pass == NULL ? 0 : strlen(pass);
-}
-
-/*
- * Check if |str| ends with |suffix| preceded by a space, and if it does,
- * return the index of that space.  If there is no such suffix in |str|,
- * return -1.
- * For |str| == "FOO BAR" and |suffix| == "BAR", the returned value is 3.
- */
-static int check_suffix(const char *str, const char *suffix)
-{
-    int str_len = strlen(str);
-    int suffix_len = strlen(suffix) + 1;
-    const char *p = NULL;
-
-    if (suffix_len >= str_len)
-        return -1;
-    p = str + str_len - suffix_len;
-    if (*p != ' '
-        || strcmp(p + 1, suffix) != 0)
-        return -1;
-    return p - str;
-}
-
-/*
- * EMBEDDED is a special type of OSSL_STORE_INFO, specially for the file
- * handlers, so we define it internally.  This uses the possibility to
- * create an OSSL_STORE_INFO with a generic data pointer and arbitrary
- * type number.
- *
- * This is used by a FILE_HANDLER's try_decode function to signal that it
- * has decoded the incoming blob into a new blob, and that the attempted
- * decoding should be immediately restarted with the new blob, using the
- * new PEM name.
- */
-/* Negative numbers are never used for public OSSL_STORE_INFO types */
-#define STORE_INFO_EMBEDDED -1
-
-/* This is the embedded data */
-struct embedded_st {
-    BUF_MEM *blob;
-    char *pem_name;
-};
-
-/* Helper functions */
-static struct embedded_st *get0_EMBEDDED(OSSL_STORE_INFO *info)
-{
-    return OSSL_STORE_INFO_get0_data(STORE_INFO_EMBEDDED, info);
-}
-
-static void store_info_free(OSSL_STORE_INFO *info)
-{
-    struct embedded_st *data;
-
-    if (info != NULL && (data = get0_EMBEDDED(info)) != NULL) {
-        BUF_MEM_free(data->blob);
-        OPENSSL_free(data->pem_name);
-        OPENSSL_free(data);
-    }
-    OSSL_STORE_INFO_free(info);
-}
-
-static OSSL_STORE_INFO *new_EMBEDDED(const char *new_pem_name,
-    BUF_MEM *embedded)
-{
-    OSSL_STORE_INFO *info = NULL;
-    struct embedded_st *data = NULL;
-
-    if ((data = OPENSSL_zalloc(sizeof(*data))) == NULL)
-        return NULL;
-    if ((info = OSSL_STORE_INFO_new(STORE_INFO_EMBEDDED, data)) == NULL) {
-        ATTICerr(0, ERR_R_OSSL_STORE_LIB);
-        OPENSSL_free(data);
-        return NULL;
-    }
-
-    data->blob = embedded;
-    data->pem_name = new_pem_name == NULL ? NULL : OPENSSL_strdup(new_pem_name);
-
-    if (new_pem_name != NULL && data->pem_name == NULL) {
-        store_info_free(info);
-        info = NULL;
-    }
-
-    return info;
-}
-
-/*-
- *  The file scheme decoders
- *  ------------------------
- *
- *  Each possible data type has its own decoder, which either operates
- *  through a given PEM name, or attempts to decode to see if the blob
- *  it's given is decodable for its data type.  The assumption is that
- *  only the correct data type will match the content.
- */
-
-/*-
- * The try_decode function is called to check if the blob of data can
- * be used by this handler, and if it can, decodes it into a supported
- * OpenSSL type and returns an OSSL_STORE_INFO with the decoded data.
- * Input:
- *    pem_name:     If this blob comes from a PEM file, this holds
- *                  the PEM name.  If it comes from another type of
- *                  file, this is NULL.
- *    pem_header:   If this blob comes from a PEM file, this holds
- *                  the PEM headers.  If it comes from another type of
- *                  file, this is NULL.
- *    blob:         The blob of data to match with what this handler
- *                  can use.
- *    len:          The length of the blob.
- *    handler_ctx:  For a handler marked repeatable, this pointer can
- *                  be used to create a context for the handler.  IT IS
- *                  THE HANDLER'S RESPONSIBILITY TO CREATE AND DESTROY
- *                  THIS CONTEXT APPROPRIATELY, i.e. create on first call
- *                  and destroy when about to return NULL.
- *    matchcount:   A pointer to an int to count matches for this data.
- *                  Usually becomes 0 (no match) or 1 (match!), but may
- *                  be higher in the (unlikely) event that the data matches
- *                  more than one possibility.  The int will always be
- *                  zero when the function is called.
- *    ui_method:    Application UI method for getting a password, pin
- *                  or any other interactive data.
- *    ui_data:      Application data to be passed to ui_method when
- *                  it's called.
- *    libctx:       The library context to be used if applicable
- *    propq:        The property query string for any algorithm fetches
- * Output:
- *    an OSSL_STORE_INFO
- */
-typedef OSSL_STORE_INFO *(*file_try_decode_fn)(const char *pem_name,
-    const char *pem_header,
-    const unsigned char *blob,
-    size_t len, void **handler_ctx,
-    int *matchcount,
-    const UI_METHOD *ui_method,
-    void *ui_data, const char *uri,
-    OSSL_LIB_CTX *libctx,
-    const char *propq);
-/*
- * The eof function should return 1 if there's no more data to be found
- * with the handler_ctx, otherwise 0.  This is only used when the handler is
- * marked repeatable.
- */
-typedef int (*file_eof_fn)(void *handler_ctx);
-/*
- * The destroy_ctx function is used to destroy the handler_ctx that was
- * initiated by a repeatable try_decode function.  This is only used when
- * the handler is marked repeatable.
- */
-typedef void (*file_destroy_ctx_fn)(void **handler_ctx);
-
-typedef struct file_handler_st {
-    const char *name;
-    file_try_decode_fn try_decode;
-    file_eof_fn eof;
-    file_destroy_ctx_fn destroy_ctx;
-
-    /* flags */
-    int repeatable;
-} FILE_HANDLER;
-
-/*
- * PKCS#12 decoder.  It operates by decoding all of the blob content,
- * extracting all the interesting data from it and storing them internally,
- * then serving them one piece at a time.
- */
-static OSSL_STORE_INFO *try_decode_PKCS12(const char *pem_name,
-    const char *pem_header,
-    const unsigned char *blob,
-    size_t len, void **pctx,
-    int *matchcount,
-    const UI_METHOD *ui_method,
-    void *ui_data, const char *uri,
-    OSSL_LIB_CTX *libctx,
-    const char *propq)
-{
-    OSSL_STORE_INFO *store_info = NULL;
-    STACK_OF(OSSL_STORE_INFO) *ctx = *pctx;
-
-    if (ctx == NULL) {
-        /* Initial parsing */
-        PKCS12 *p12;
-
-        if (pem_name != NULL)
-            /* No match, there is no PEM PKCS12 tag */
-            return NULL;
-
-        if ((p12 = d2i_PKCS12(NULL, &blob, len)) != NULL) {
-            char *pass = NULL;
-            char tpass[PEM_BUFSIZE];
-            EVP_PKEY *pkey = NULL;
-            X509 *cert = NULL;
-            STACK_OF(X509) *chain = NULL;
-
-            *matchcount = 1;
-
-            if (!PKCS12_mac_present(p12)
-                || PKCS12_verify_mac(p12, "", 0)
-                || PKCS12_verify_mac(p12, NULL, 0)) {
-                pass = "";
-            } else {
-                if ((pass = file_get_pass(ui_method, tpass, PEM_BUFSIZE,
-                         "PKCS12 import", uri,
-                         ui_data))
-                    == NULL) {
-                    ATTICerr(0, ATTIC_R_PASSPHRASE_CALLBACK_ERROR);
-                    goto p12_end;
-                }
-                if (!PKCS12_verify_mac(p12, pass, strlen(pass))) {
-                    ATTICerr(0, ATTIC_R_ERROR_VERIFYING_PKCS12_MAC);
-                    goto p12_end;
-                }
-            }
-
-            if (PKCS12_parse(p12, pass, &pkey, &cert, &chain)) {
-                OSSL_STORE_INFO *osi_pkey = NULL;
-                OSSL_STORE_INFO *osi_cert = NULL;
-                OSSL_STORE_INFO *osi_ca = NULL;
-                int ok = 1;
-
-                if ((ctx = sk_OSSL_STORE_INFO_new_null()) != NULL) {
-                    if (pkey != NULL) {
-                        if ((osi_pkey = OSSL_STORE_INFO_new_PKEY(pkey)) != NULL
-                            /* clearing pkey here avoids case distinctions */
-                            && (pkey = NULL) == NULL
-                            && sk_OSSL_STORE_INFO_push(ctx, osi_pkey) != 0)
-                            osi_pkey = NULL;
-                        else
-                            ok = 0;
-                    }
-                    if (ok && cert != NULL) {
-                        if ((osi_cert = OSSL_STORE_INFO_new_CERT(cert)) != NULL
-                            /* clearing cert here avoids case distinctions */
-                            && (cert = NULL) == NULL
-                            && sk_OSSL_STORE_INFO_push(ctx, osi_cert) != 0)
-                            osi_cert = NULL;
-                        else
-                            ok = 0;
-                    }
-                    while (ok && sk_X509_num(chain) > 0) {
-                        X509 *ca = sk_X509_value(chain, 0);
-
-                        if ((osi_ca = OSSL_STORE_INFO_new_CERT(ca)) != NULL
-                            && sk_X509_shift(chain) != NULL
-                            && sk_OSSL_STORE_INFO_push(ctx, osi_ca) != 0)
-                            osi_ca = NULL;
-                        else
-                            ok = 0;
-                    }
-                }
-                EVP_PKEY_free(pkey);
-                X509_free(cert);
-                OSSL_STACK_OF_X509_free(chain);
-                store_info_free(osi_pkey);
-                store_info_free(osi_cert);
-                store_info_free(osi_ca);
-                if (!ok) {
-                    sk_OSSL_STORE_INFO_pop_free(ctx, store_info_free);
-                    ctx = NULL;
-                }
-                *pctx = ctx;
-            }
-        }
-    p12_end:
-        PKCS12_free(p12);
-        if (ctx == NULL)
-            return NULL;
-    }
-
-    *matchcount = 1;
-    store_info = sk_OSSL_STORE_INFO_shift(ctx);
-    return store_info;
-}
-
-static int eof_PKCS12(void *ctx_)
-{
-    STACK_OF(OSSL_STORE_INFO) *ctx = ctx_;
-
-    return ctx == NULL || sk_OSSL_STORE_INFO_num(ctx) == 0;
-}
-
-static void destroy_ctx_PKCS12(void **pctx)
-{
-    STACK_OF(OSSL_STORE_INFO) *ctx = *pctx;
-
-    sk_OSSL_STORE_INFO_pop_free(ctx, store_info_free);
-    *pctx = NULL;
-}
-
-static FILE_HANDLER PKCS12_handler = {
-    "PKCS12",
-    try_decode_PKCS12,
-    eof_PKCS12,
-    destroy_ctx_PKCS12,
-    1 /* repeatable */
-};
-
-/*
- * Encrypted PKCS#8 decoder.  It operates by just decrypting the given blob
- * into a new blob, which is returned as an EMBEDDED STORE_INFO.  The whole
- * decoding process will then start over with the new blob.
- */
-static OSSL_STORE_INFO *try_decode_PKCS8Encrypted(const char *pem_name,
-    const char *pem_header,
-    const unsigned char *blob,
-    size_t len, void **pctx,
-    int *matchcount,
-    const UI_METHOD *ui_method,
-    void *ui_data,
-    const char *uri,
-    OSSL_LIB_CTX *libctx,
-    const char *propq)
-{
-    X509_SIG *p8 = NULL;
-    char kbuf[PEM_BUFSIZE];
-    char *pass = NULL;
-    const X509_ALGOR *dalg = NULL;
-    const ASN1_OCTET_STRING *doct = NULL;
-    OSSL_STORE_INFO *store_info = NULL;
-    BUF_MEM *mem = NULL;
-    unsigned char *new_data = NULL;
-    int new_data_len;
-
-    if (pem_name != NULL) {
-        if (strcmp(pem_name, PEM_STRING_PKCS8) != 0)
-            return NULL;
-        *matchcount = 1;
-    }
-
-    if ((p8 = d2i_X509_SIG(NULL, &blob, len)) == NULL)
-        return NULL;
-
-    *matchcount = 1;
-
-    if ((mem = BUF_MEM_new()) == NULL) {
-        ATTICerr(0, ERR_R_BUF_LIB);
-        goto nop8;
-    }
-
-    if ((pass = file_get_pass(ui_method, kbuf, PEM_BUFSIZE,
-             "PKCS8 decrypt pass phrase", uri,
-             ui_data))
-        == NULL) {
-        ATTICerr(0, ATTIC_R_BAD_PASSWORD_READ);
-        goto nop8;
-    }
-
-    X509_SIG_get0(p8, &dalg, &doct);
-    if (!PKCS12_pbe_crypt(dalg, pass, strlen(pass), doct->data, doct->length,
-            &new_data, &new_data_len, 0))
-        goto nop8;
-
-    mem->data = (char *)new_data;
-    mem->max = mem->length = (size_t)new_data_len;
-    X509_SIG_free(p8);
-    p8 = NULL;
-
-    store_info = new_EMBEDDED(PEM_STRING_PKCS8INF, mem);
-    if (store_info == NULL) {
-        ATTICerr(0, ERR_R_OSSL_STORE_LIB);
-        goto nop8;
-    }
-
-    return store_info;
-nop8:
-    X509_SIG_free(p8);
-    BUF_MEM_free(mem);
-    return NULL;
-}
-
-static FILE_HANDLER PKCS8Encrypted_handler = {
-    "PKCS8Encrypted",
-    try_decode_PKCS8Encrypted
-};
-
-/*
- * Private key decoder.  Decodes all sorts of private keys, both PKCS#8
- * encoded ones and old style PEM ones (with the key type is encoded into
- * the PEM name).
- */
-static OSSL_STORE_INFO *try_decode_PrivateKey(const char *pem_name,
-    const char *pem_header,
-    const unsigned char *blob,
-    size_t len, void **pctx,
-    int *matchcount,
-    const UI_METHOD *ui_method,
-    void *ui_data, const char *uri,
-    OSSL_LIB_CTX *libctx,
-    const char *propq)
-{
-    OSSL_STORE_INFO *store_info = NULL;
-    EVP_PKEY *pkey = NULL;
-    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
-
-    if (pem_name != NULL) {
-        if (strcmp(pem_name, PEM_STRING_PKCS8INF) == 0) {
-            PKCS8_PRIV_KEY_INFO *p8inf = d2i_PKCS8_PRIV_KEY_INFO(NULL, &blob, len);
-
-            *matchcount = 1;
-            if (p8inf != NULL)
-                pkey = EVP_PKCS82PKEY_ex(p8inf, libctx, propq);
-            PKCS8_PRIV_KEY_INFO_free(p8inf);
-        } else {
-            int slen;
-            int pkey_id;
-
-            if ((slen = check_suffix(pem_name, "PRIVATE KEY")) > 0
-                && (ameth = EVP_PKEY_asn1_find_str(NULL, pem_name,
-                        slen))
-                    != NULL
-                && EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL,
-                    ameth)) {
-                *matchcount = 1;
-                pkey = d2i_PrivateKey_ex(pkey_id, NULL, &blob, len,
-                    libctx, propq);
-            }
-        }
-    } else {
-        int i;
-#ifndef OPENSSL_NO_ENGINE
-        ENGINE *curengine = ENGINE_get_first();
-
-        while (curengine != NULL) {
-            ENGINE_PKEY_ASN1_METHS_PTR asn1meths = ENGINE_get_pkey_asn1_meths(curengine);
-
-            if (asn1meths != NULL) {
-                const int *nids = NULL;
-                int nids_n = asn1meths(curengine, NULL, &nids, 0);
-
-                for (i = 0; i < nids_n; i++) {
-                    EVP_PKEY_ASN1_METHOD *ameth2 = NULL;
-                    EVP_PKEY *tmp_pkey = NULL;
-                    const unsigned char *tmp_blob = blob;
-                    int pkey_id, pkey_flags;
-
-                    if (!asn1meths(curengine, &ameth2, NULL, nids[i])
-                        || !EVP_PKEY_asn1_get0_info(&pkey_id, NULL,
-                            &pkey_flags, NULL, NULL,
-                            ameth2)
-                        || (pkey_flags & ASN1_PKEY_ALIAS) != 0)
-                        continue;
-
-                    ERR_set_mark(); /* prevent flooding error queue */
-                    tmp_pkey = d2i_PrivateKey_ex(pkey_id, NULL,
-                        &tmp_blob, len,
-                        libctx, propq);
-                    if (tmp_pkey != NULL) {
-                        if (pkey != NULL)
-                            EVP_PKEY_free(tmp_pkey);
-                        else
-                            pkey = tmp_pkey;
-                        (*matchcount)++;
-                    }
-                    ERR_pop_to_mark();
-                }
-            }
-            curengine = ENGINE_get_next(curengine);
-        }
-#endif
-
-        for (i = 0; i < EVP_PKEY_asn1_get_count(); i++) {
-            EVP_PKEY *tmp_pkey = NULL;
-            const unsigned char *tmp_blob = blob;
-            int pkey_id, pkey_flags;
-
-            ameth = EVP_PKEY_asn1_get0(i);
-            if (!EVP_PKEY_asn1_get0_info(&pkey_id, NULL, &pkey_flags, NULL,
-                    NULL, ameth)
-                || (pkey_flags & ASN1_PKEY_ALIAS) != 0)
-                continue;
-
-            ERR_set_mark(); /* prevent flooding error queue */
-            tmp_pkey = d2i_PrivateKey_ex(pkey_id, NULL, &tmp_blob, len,
-                libctx, propq);
-            if (tmp_pkey != NULL) {
-                if (pkey != NULL)
-                    EVP_PKEY_free(tmp_pkey);
-                else
-                    pkey = tmp_pkey;
-                (*matchcount)++;
-            }
-            ERR_pop_to_mark();
-        }
-
-        if (*matchcount > 1) {
-            EVP_PKEY_free(pkey);
-            pkey = NULL;
-        }
-    }
-    if (pkey == NULL)
-        /* No match */
-        return NULL;
-
-    store_info = OSSL_STORE_INFO_new_PKEY(pkey);
-    if (store_info == NULL)
-        EVP_PKEY_free(pkey);
-
-    return store_info;
-}
-
-static FILE_HANDLER PrivateKey_handler = {
-    "PrivateKey",
-    try_decode_PrivateKey
-};
-
-/*
- * Public key decoder.  Only supports SubjectPublicKeyInfo formatted keys.
- */
-static OSSL_STORE_INFO *try_decode_PUBKEY(const char *pem_name,
-    const char *pem_header,
-    const unsigned char *blob,
-    size_t len, void **pctx,
-    int *matchcount,
-    const UI_METHOD *ui_method,
-    void *ui_data, const char *uri,
-    OSSL_LIB_CTX *libctx,
-    const char *propq)
-{
-    OSSL_STORE_INFO *store_info = NULL;
-    EVP_PKEY *pkey = NULL;
-
-    if (pem_name != NULL) {
-        if (strcmp(pem_name, PEM_STRING_PUBLIC) != 0)
-            /* No match */
-            return NULL;
-        *matchcount = 1;
-    }
-
-    if ((pkey = d2i_PUBKEY(NULL, &blob, len)) != NULL) {
-        *matchcount = 1;
-        store_info = OSSL_STORE_INFO_new_PUBKEY(pkey);
-    }
-
-    return store_info;
-}
-
-static FILE_HANDLER PUBKEY_handler = {
-    "PUBKEY",
-    try_decode_PUBKEY
-};
-
-/*
- * Key parameter decoder.
- */
-static OSSL_STORE_INFO *try_decode_params(const char *pem_name,
-    const char *pem_header,
-    const unsigned char *blob,
-    size_t len, void **pctx,
-    int *matchcount,
-    const UI_METHOD *ui_method,
-    void *ui_data, const char *uri,
-    OSSL_LIB_CTX *libctx,
-    const char *propq)
-{
-    OSSL_STORE_INFO *store_info = NULL;
-    EVP_PKEY *pkey = NULL;
-    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
-
-    if (pem_name != NULL) {
-        int slen;
-        int pkey_id;
-
-        if ((slen = check_suffix(pem_name, "PARAMETERS")) > 0
-            && (ameth = EVP_PKEY_asn1_find_str(NULL, pem_name, slen)) != NULL
-            && EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL,
-                ameth)) {
-            *matchcount = 1;
-            pkey = d2i_KeyParams(pkey_id, NULL, &blob, len);
-        }
-    } else {
-        int i;
-
-        for (i = 0; i < EVP_PKEY_asn1_get_count(); i++) {
-            EVP_PKEY *tmp_pkey = NULL;
-            const unsigned char *tmp_blob = blob;
-            int pkey_id, pkey_flags;
-
-            ameth = EVP_PKEY_asn1_get0(i);
-            if (!EVP_PKEY_asn1_get0_info(&pkey_id, NULL, &pkey_flags, NULL,
-                    NULL, ameth)
-                || (pkey_flags & ASN1_PKEY_ALIAS) != 0)
-                continue;
-
-            ERR_set_mark(); /* prevent flooding error queue */
-
-            tmp_pkey = d2i_KeyParams(pkey_id, NULL, &tmp_blob, len);
-
-            if (tmp_pkey != NULL) {
-                if (pkey != NULL)
-                    EVP_PKEY_free(tmp_pkey);
-                else
-                    pkey = tmp_pkey;
-                (*matchcount)++;
-            }
-            ERR_pop_to_mark();
-        }
-
-        if (*matchcount > 1) {
-            EVP_PKEY_free(pkey);
-            pkey = NULL;
-        }
-    }
-    if (pkey == NULL)
-        /* No match */
-        return NULL;
-
-    store_info = OSSL_STORE_INFO_new_PARAMS(pkey);
-    if (store_info == NULL)
-        EVP_PKEY_free(pkey);
-
-    return store_info;
-}
-
-static FILE_HANDLER params_handler = {
-    "params",
-    try_decode_params
-};
-
-/*
- * X.509 certificate decoder.
- */
-static OSSL_STORE_INFO *try_decode_X509Certificate(const char *pem_name,
-    const char *pem_header,
-    const unsigned char *blob,
-    size_t len, void **pctx,
-    int *matchcount,
-    const UI_METHOD *ui_method,
-    void *ui_data,
-    const char *uri,
-    OSSL_LIB_CTX *libctx,
-    const char *propq)
-{
-    OSSL_STORE_INFO *store_info = NULL;
-    X509 *cert = NULL;
-
-    /*
-     * In most cases, we can try to interpret the serialized data as a trusted
-     * cert (X509 + X509_AUX) and fall back to reading it as a normal cert
-     * (just X509), but if the PEM name specifically declares it as a trusted
-     * cert, then no fallback should be engaged.  |ignore_trusted| tells if
-     * the fallback can be used (1) or not (0).
-     */
-    int ignore_trusted = 1;
-
-    if (pem_name != NULL) {
-        if (strcmp(pem_name, PEM_STRING_X509_TRUSTED) == 0)
-            ignore_trusted = 0;
-        else if (strcmp(pem_name, PEM_STRING_X509_OLD) != 0
-            && strcmp(pem_name, PEM_STRING_X509) != 0)
-            /* No match */
-            return NULL;
-        *matchcount = 1;
-    }
-
-    cert = X509_new_ex(libctx, propq);
-    if (cert == NULL)
-        return NULL;
-
-    if ((d2i_X509_AUX(&cert, &blob, len)) != NULL
-        || (ignore_trusted && (d2i_X509(&cert, &blob, len)) != NULL)) {
-        *matchcount = 1;
-        store_info = OSSL_STORE_INFO_new_CERT(cert);
-    }
-
-    if (store_info == NULL)
-        X509_free(cert);
-
-    return store_info;
-}
-
-static FILE_HANDLER X509Certificate_handler = {
-    "X509Certificate",
-    try_decode_X509Certificate
-};
-
-/*
- * X.509 CRL decoder.
- */
-static OSSL_STORE_INFO *try_decode_X509CRL(const char *pem_name,
-    const char *pem_header,
-    const unsigned char *blob,
-    size_t len, void **pctx,
-    int *matchcount,
-    const UI_METHOD *ui_method,
-    void *ui_data, const char *uri,
-    OSSL_LIB_CTX *libctx,
-    const char *propq)
-{
-    OSSL_STORE_INFO *store_info = NULL;
-    X509_CRL *crl = NULL;
-
-    if (pem_name != NULL) {
-        if (strcmp(pem_name, PEM_STRING_X509_CRL) != 0)
-            /* No match */
-            return NULL;
-        *matchcount = 1;
-    }
-
-    if ((crl = d2i_X509_CRL(NULL, &blob, len)) != NULL) {
-        *matchcount = 1;
-        store_info = OSSL_STORE_INFO_new_CRL(crl);
-    }
-
-    if (store_info == NULL)
-        X509_CRL_free(crl);
-
-    return store_info;
-}
-
-static FILE_HANDLER X509CRL_handler = {
-    "X509CRL",
-    try_decode_X509CRL
-};
-
-/*
- * To finish it all off, we collect all the handlers.
- */
-static const FILE_HANDLER *file_handlers[] = {
-    &PKCS12_handler,
-    &PKCS8Encrypted_handler,
-    &X509Certificate_handler,
-    &X509CRL_handler,
-    &params_handler,
-    &PUBKEY_handler,
-    &PrivateKey_handler,
-};
-
-/*-
- *  The loader itself
- *  -----------------
- */
-
-struct ossl_store_loader_ctx_st {
-    char *uri; /* The URI we currently try to load */
-    enum {
-        is_raw = 0,
-        is_pem,
-        is_dir
-    } type;
-    int errcnt;
-#define FILE_FLAG_SECMEM (1 << 0)
-#define FILE_FLAG_ATTACHED (1 << 1)
-    unsigned int flags;
-    union {
-        struct { /* Used with is_raw and is_pem */
-            BIO *file;
-
-            /*
-             * The following are used when the handler is marked as
-             * repeatable
-             */
-            const FILE_HANDLER *last_handler;
-            void *last_handler_ctx;
-        } file;
-        struct { /* Used with is_dir */
-            OPENSSL_DIR_CTX *ctx;
-            int end_reached;
-
-            /*
-             * When a search expression is given, these are filled in.
-             * |search_name| contains the file basename to look for.
-             * The string is exactly 8 characters long.
-             */
-            char search_name[9];
-
-            /*
-             * The directory reading utility we have combines opening with
-             * reading the first name.  To make sure we can detect the end
-             * at the right time, we read early and cache the name.
-             */
-            const char *last_entry;
-            int last_errno;
-        } dir;
-    } _;
-
-    /* Expected object type.  May be unspecified */
-    int expected_type;
-
-    OSSL_LIB_CTX *libctx;
-    char *propq;
-};
-
-static void OSSL_STORE_LOADER_CTX_free(OSSL_STORE_LOADER_CTX *ctx)
-{
-    if (ctx == NULL)
-        return;
-
-    OPENSSL_free(ctx->propq);
-    OPENSSL_free(ctx->uri);
-    if (ctx->type != is_dir) {
-        if (ctx->_.file.last_handler != NULL) {
-            ctx->_.file.last_handler->destroy_ctx(&ctx->_.file.last_handler_ctx);
-            ctx->_.file.last_handler_ctx = NULL;
-            ctx->_.file.last_handler = NULL;
-        }
-    }
-    OPENSSL_free(ctx);
-}
-
-static int file_find_type(OSSL_STORE_LOADER_CTX *ctx)
-{
-    BIO *buff = NULL;
-    char peekbuf[4096] = {
-        0,
-    };
-
-    if ((buff = BIO_new(BIO_f_buffer())) == NULL)
-        return 0;
-
-    ctx->_.file.file = BIO_push(buff, ctx->_.file.file);
-    if (BIO_buffer_peek(ctx->_.file.file, peekbuf, sizeof(peekbuf) - 1) > 0) {
-        peekbuf[sizeof(peekbuf) - 1] = '\0';
-        if (strstr(peekbuf, "-----BEGIN ") != NULL)
-            ctx->type = is_pem;
-    }
-    return 1;
-}
-
-static OSSL_STORE_LOADER_CTX *file_open_ex(const OSSL_STORE_LOADER *loader, const char *uri,
-    OSSL_LIB_CTX *libctx, const char *propq,
-    const UI_METHOD *ui_method, void *ui_data)
-{
-    OSSL_STORE_LOADER_CTX *ctx = NULL;
-    struct stat st;
-    struct {
-        const char *path;
-        unsigned int check_absolute : 1;
-    } path_data[2];
-    size_t path_data_n = 0, i;
-    const char *path, *p = uri, *q;
-
-    /*
-     * First step, just take the URI as is.
-     */
-    path_data[path_data_n].check_absolute = 0;
-    path_data[path_data_n++].path = uri;
-
-    /*
-     * Second step, if the URI appears to start with the "file" scheme,
-     * extract the path and make that the second path to check.
-     * There's a special case if the URI also contains an authority, then
-     * the full URI shouldn't be used as a path anywhere.
-     */
-    if (CHECK_AND_SKIP_CASE_PREFIX(p, "file:")) {
-        q = p;
-        if (CHECK_AND_SKIP_PREFIX(q, "//")) {
-            path_data_n--; /* Invalidate using the full URI */
-            if (CHECK_AND_SKIP_CASE_PREFIX(q, "localhost/")
-                || CHECK_AND_SKIP_PREFIX(q, "/")) {
-                p = q - 1;
-            } else {
-                ATTICerr(0, ATTIC_R_URI_AUTHORITY_UNSUPPORTED);
-                return NULL;
-            }
-        }
-
-        path_data[path_data_n].check_absolute = 1;
-#ifdef _WIN32
-        /* Windows "file:" URIs with a drive letter start with a '/' */
-        if (p[0] == '/' && p[2] == ':' && p[3] == '/') {
-            char c = tolower((unsigned char)p[1]);
-
-            if (c >= 'a' && c <= 'z') {
-                p++;
-                /* We know it's absolute, so no need to check */
-                path_data[path_data_n].check_absolute = 0;
-            }
-        }
-#endif
-        path_data[path_data_n++].path = p;
-    }
-
-    for (i = 0, path = NULL; path == NULL && i < path_data_n; i++) {
-        /*
-         * If the scheme "file" was an explicit part of the URI, the path must
-         * be absolute.  So says RFC 8089
-         */
-        if (path_data[i].check_absolute && path_data[i].path[0] != '/') {
-            ATTICerr(0, ATTIC_R_PATH_MUST_BE_ABSOLUTE);
-            ERR_add_error_data(1, path_data[i].path);
-            return NULL;
-        }
-
-        if (stat(path_data[i].path, &st) < 0) {
-            ERR_raise_data(ERR_LIB_SYS, errno,
-                "calling stat(%s)",
-                path_data[i].path);
-        } else {
-            path = path_data[i].path;
-        }
-    }
-    if (path == NULL) {
-        return NULL;
-    }
-
-    /* Successfully found a working path */
-
-    ctx = OPENSSL_zalloc(sizeof(*ctx));
-    if (ctx == NULL)
-        return NULL;
-    ctx->uri = OPENSSL_strdup(uri);
-    if (ctx->uri == NULL)
-        goto err;
-
-    if (S_ISDIR(st.st_mode)) {
-        ctx->type = is_dir;
-        ctx->_.dir.last_entry = OPENSSL_DIR_read(&ctx->_.dir.ctx, path);
-        ctx->_.dir.last_errno = errno;
-        if (ctx->_.dir.last_entry == NULL) {
-            if (ctx->_.dir.last_errno != 0) {
-                ERR_raise(ERR_LIB_SYS, ctx->_.dir.last_errno);
-                goto err;
-            }
-            ctx->_.dir.end_reached = 1;
-        }
-    } else if ((ctx->_.file.file = BIO_new_file(path, "rb")) == NULL
-        || !file_find_type(ctx)) {
-        BIO_free_all(ctx->_.file.file);
-        goto err;
-    }
-    if (propq != NULL) {
-        ctx->propq = OPENSSL_strdup(propq);
-        if (ctx->propq == NULL)
-            goto err;
-    }
-    ctx->libctx = libctx;
-
-    return ctx;
-err:
-    OSSL_STORE_LOADER_CTX_free(ctx);
-    return NULL;
-}
-
-static OSSL_STORE_LOADER_CTX *file_open(const OSSL_STORE_LOADER *loader, const char *uri,
-    const UI_METHOD *ui_method, void *ui_data)
-{
-    return file_open_ex(loader, uri, NULL, NULL, ui_method, ui_data);
-}
-
-static OSSL_STORE_LOADER_CTX *file_attach(const OSSL_STORE_LOADER *loader, BIO *bp,
-    OSSL_LIB_CTX *libctx, const char *propq,
-    const UI_METHOD *ui_method, void *ui_data)
-{
-    OSSL_STORE_LOADER_CTX *ctx = NULL;
-
-    if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL
-        || (propq != NULL && (ctx->propq = OPENSSL_strdup(propq)) == NULL)) {
-        OSSL_STORE_LOADER_CTX_free(ctx);
-        return NULL;
-    }
-    ctx->libctx = libctx;
-    ctx->flags |= FILE_FLAG_ATTACHED;
-    ctx->_.file.file = bp;
-    if (!file_find_type(ctx)) {
-        /* Safety measure */
-        ctx->_.file.file = NULL;
-        goto err;
-    }
-    return ctx;
-err:
-    OSSL_STORE_LOADER_CTX_free(ctx);
-    return NULL;
-}
-
-static int file_ctrl(OSSL_STORE_LOADER_CTX *ctx, int cmd, va_list args)
-{
-    int ret = 1;
-
-    switch (cmd) {
-    case OSSL_STORE_C_USE_SECMEM: {
-        int on = *(va_arg(args, int *));
-
-        switch (on) {
-        case 0:
-            ctx->flags &= ~FILE_FLAG_SECMEM;
-            break;
-        case 1:
-            ctx->flags |= FILE_FLAG_SECMEM;
-            break;
-        default:
-            ATTICerr(0, ERR_R_PASSED_INVALID_ARGUMENT);
-            ret = 0;
-            break;
-        }
-    } break;
-    default:
-        break;
-    }
-
-    return ret;
-}
-
-static int file_expect(OSSL_STORE_LOADER_CTX *ctx, int expected)
-{
-    ctx->expected_type = expected;
-    return 1;
-}
-
-static int file_find(OSSL_STORE_LOADER_CTX *ctx,
-    const OSSL_STORE_SEARCH *search)
-{
-    /*
-     * If ctx == NULL, the library is looking to know if this loader supports
-     * the given search type.
-     */
-
-    if (OSSL_STORE_SEARCH_get_type(search) == OSSL_STORE_SEARCH_BY_NAME) {
-        unsigned long hash = 0;
-
-        if (ctx == NULL)
-            return 1;
-
-        if (ctx->type != is_dir) {
-            ATTICerr(0, ATTIC_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES);
-            return 0;
-        }
-
-        hash = X509_NAME_hash_ex(OSSL_STORE_SEARCH_get0_name(search),
-            NULL, NULL, NULL);
-        BIO_snprintf(ctx->_.dir.search_name, sizeof(ctx->_.dir.search_name),
-            "%08lx", hash);
-        return 1;
-    }
-
-    if (ctx != NULL)
-        ATTICerr(0, ATTIC_R_UNSUPPORTED_SEARCH_TYPE);
-    return 0;
-}
-
-static OSSL_STORE_INFO *file_load_try_decode(OSSL_STORE_LOADER_CTX *ctx,
-    const char *pem_name,
-    const char *pem_header,
-    unsigned char *data, size_t len,
-    const UI_METHOD *ui_method,
-    void *ui_data, int *matchcount)
-{
-    OSSL_STORE_INFO *result = NULL;
-    BUF_MEM *new_mem = NULL;
-    char *new_pem_name = NULL;
-    int t = 0;
-
-again: {
-    size_t i = 0;
-    void *handler_ctx = NULL;
-    const FILE_HANDLER **matching_handlers = OPENSSL_zalloc(sizeof(*matching_handlers)
-        * OSSL_NELEM(file_handlers));
-
-    if (matching_handlers == NULL)
-        goto err;
-
-    *matchcount = 0;
-    for (i = 0; i < OSSL_NELEM(file_handlers); i++) {
-        const FILE_HANDLER *handler = file_handlers[i];
-        int try_matchcount = 0;
-        void *tmp_handler_ctx = NULL;
-        OSSL_STORE_INFO *tmp_result;
-        unsigned long err;
-
-        ERR_set_mark();
-        tmp_result = handler->try_decode(pem_name, pem_header, data, len,
-            &tmp_handler_ctx, &try_matchcount,
-            ui_method, ui_data, ctx->uri,
-            ctx->libctx, ctx->propq);
-        /* avoid flooding error queue with low-level ASN.1 parse errors */
-        err = ERR_peek_last_error();
-        if (ERR_GET_LIB(err) == ERR_LIB_ASN1
-            && ERR_GET_REASON(err) == ERR_R_NESTED_ASN1_ERROR)
-            ERR_pop_to_mark();
-        else
-            ERR_clear_last_mark();
-
-        if (try_matchcount > 0) {
-
-            matching_handlers[*matchcount] = handler;
-
-            if (handler_ctx)
-                handler->destroy_ctx(&handler_ctx);
-            handler_ctx = tmp_handler_ctx;
-
-            if ((*matchcount += try_matchcount) > 1) {
-                /* more than one match => ambiguous, kill any result */
-                store_info_free(result);
-                store_info_free(tmp_result);
-                if (handler->destroy_ctx != NULL)
-                    handler->destroy_ctx(&handler_ctx);
-                handler_ctx = NULL;
-                tmp_result = NULL;
-                result = NULL;
-            }
-            if (result == NULL)
-                result = tmp_result;
-            if (result == NULL) /* e.g., PKCS#12 file decryption error */
-                break;
-        }
-    }
-
-    if (result != NULL
-        && *matchcount == 1 && matching_handlers[0]->repeatable) {
-        ctx->_.file.last_handler = matching_handlers[0];
-        ctx->_.file.last_handler_ctx = handler_ctx;
-    }
-
-    OPENSSL_free(matching_handlers);
-}
-
-err:
-    OPENSSL_free(new_pem_name);
-    BUF_MEM_free(new_mem);
-
-    if (result != NULL
-        && (t = OSSL_STORE_INFO_get_type(result)) == STORE_INFO_EMBEDDED) {
-        struct embedded_st *embedded = get0_EMBEDDED(result);
-
-        /* "steal" the embedded data */
-        pem_name = new_pem_name = embedded->pem_name;
-        new_mem = embedded->blob;
-        data = (unsigned char *)new_mem->data;
-        len = new_mem->length;
-        embedded->pem_name = NULL;
-        embedded->blob = NULL;
-
-        store_info_free(result);
-        result = NULL;
-        goto again;
-    }
-
-    return result;
-}
-
-static OSSL_STORE_INFO *file_load_try_repeat(OSSL_STORE_LOADER_CTX *ctx,
-    const UI_METHOD *ui_method,
-    void *ui_data)
-{
-    OSSL_STORE_INFO *result = NULL;
-    int try_matchcount = 0;
-
-    if (ctx->_.file.last_handler != NULL) {
-        result = ctx->_.file.last_handler->try_decode(NULL, NULL, NULL, 0,
-            &ctx->_.file.last_handler_ctx,
-            &try_matchcount,
-            ui_method, ui_data, ctx->uri,
-            ctx->libctx, ctx->propq);
-
-        if (result == NULL) {
-            ctx->_.file.last_handler->destroy_ctx(&ctx->_.file.last_handler_ctx);
-            ctx->_.file.last_handler_ctx = NULL;
-            ctx->_.file.last_handler = NULL;
-        }
-    }
-    return result;
-}
-
-static void pem_free_flag(void *pem_data, int secure, size_t num)
-{
-    if (secure)
-        OPENSSL_secure_clear_free(pem_data, num);
-    else
-        OPENSSL_free(pem_data);
-}
-static int file_read_pem(BIO *bp, char **pem_name, char **pem_header,
-    unsigned char **data, long *len,
-    const UI_METHOD *ui_method, void *ui_data,
-    const char *uri, int secure)
-{
-    int i = secure
-        ? PEM_read_bio_ex(bp, pem_name, pem_header, data, len,
-              PEM_FLAG_SECURE | PEM_FLAG_EAY_COMPATIBLE)
-        : PEM_read_bio(bp, pem_name, pem_header, data, len);
-
-    if (i <= 0)
-        return 0;
-
-    /*
-     * 10 is the number of characters in "Proc-Type:", which
-     * PEM_get_EVP_CIPHER_INFO() requires to be present.
-     * If the PEM header has less characters than that, it's
-     * not worth spending cycles on it.
-     */
-    if (strlen(*pem_header) > 10) {
-        EVP_CIPHER_INFO cipher;
-        struct pem_pass_data pass_data;
-
-        if (!PEM_get_EVP_CIPHER_INFO(*pem_header, &cipher)
-            || !file_fill_pem_pass_data(&pass_data, "PEM pass phrase", uri,
-                ui_method, ui_data)
-            || !PEM_do_header(&cipher, *data, len, file_get_pem_pass,
-                &pass_data)) {
-            return 0;
-        }
-    }
-    return 1;
-}
-
-static OSSL_STORE_INFO *file_try_read_msblob(BIO *bp, int *matchcount)
-{
-    OSSL_STORE_INFO *result = NULL;
-    int ispub = -1;
-
-    {
-        unsigned int magic = 0, bitlen = 0;
-        int isdss = 0;
-        unsigned char peekbuf[16] = {
-            0,
-        };
-        const unsigned char *p = peekbuf;
-
-        if (BIO_buffer_peek(bp, peekbuf, sizeof(peekbuf)) <= 0)
-            return 0;
-        if (ossl_do_blob_header(&p, sizeof(peekbuf), &magic, &bitlen,
-                &isdss, &ispub)
-            <= 0)
-            return 0;
-    }
-
-    (*matchcount)++;
-
-    {
-        EVP_PKEY *tmp = ispub
-            ? b2i_PublicKey_bio(bp)
-            : b2i_PrivateKey_bio(bp);
-
-        if (tmp == NULL
-            || (result = OSSL_STORE_INFO_new_PKEY(tmp)) == NULL) {
-            EVP_PKEY_free(tmp);
-            return 0;
-        }
-    }
-
-    return result;
-}
-
-static OSSL_STORE_INFO *file_try_read_PVK(BIO *bp, const UI_METHOD *ui_method,
-    void *ui_data, const char *uri,
-    int *matchcount)
-{
-    OSSL_STORE_INFO *result = NULL;
-
-    {
-        unsigned int saltlen = 0, keylen = 0;
-        int isdss = -1;
-        unsigned char peekbuf[24] = {
-            0,
-        };
-        const unsigned char *p = peekbuf;
-
-        if (BIO_buffer_peek(bp, peekbuf, sizeof(peekbuf)) <= 0)
-            return 0;
-        if (!ossl_do_PVK_header(&p, sizeof(peekbuf), 0, &isdss, &saltlen, &keylen))
-            return 0;
-    }
-
-    (*matchcount)++;
-
-    {
-        EVP_PKEY *tmp = NULL;
-        struct pem_pass_data pass_data;
-
-        if (!file_fill_pem_pass_data(&pass_data, "PVK pass phrase", uri,
-                ui_method, ui_data)
-            || (tmp = b2i_PVK_bio(bp, file_get_pem_pass, &pass_data)) == NULL
-            || (result = OSSL_STORE_INFO_new_PKEY(tmp)) == NULL) {
-            EVP_PKEY_free(tmp);
-            return 0;
-        }
-    }
-
-    return result;
-}
-
-static int file_read_asn1(BIO *bp, unsigned char **data, long *len)
-{
-    BUF_MEM *mem = NULL;
-
-    if (asn1_d2i_read_bio(bp, &mem) < 0)
-        return 0;
-
-    *data = (unsigned char *)mem->data;
-    *len = (long)mem->length;
-    OPENSSL_free(mem);
-
-    return 1;
-}
-
-static int file_name_to_uri(OSSL_STORE_LOADER_CTX *ctx, const char *name,
-    char **data)
-{
-    assert(name != NULL);
-    assert(data != NULL);
-    {
-        const char *pathsep = ossl_ends_with_dirsep(ctx->uri) ? "" : "/";
-        long calculated_length = strlen(ctx->uri) + strlen(pathsep)
-            + strlen(name) + 1 /* \0 */;
-
-        *data = OPENSSL_zalloc(calculated_length);
-        if (*data == NULL)
-            return 0;
-
-        OPENSSL_strlcat(*data, ctx->uri, calculated_length);
-        OPENSSL_strlcat(*data, pathsep, calculated_length);
-        OPENSSL_strlcat(*data, name, calculated_length);
-    }
-    return 1;
-}
-
-static int file_name_check(OSSL_STORE_LOADER_CTX *ctx, const char *name)
-{
-    const char *p = NULL;
-    size_t len = strlen(ctx->_.dir.search_name);
-
-    /* If there are no search criteria, all names are accepted */
-    if (ctx->_.dir.search_name[0] == '\0')
-        return 1;
-
-    /* If the expected type isn't supported, no name is accepted */
-    if (ctx->expected_type != 0
-        && ctx->expected_type != OSSL_STORE_INFO_CERT
-        && ctx->expected_type != OSSL_STORE_INFO_CRL)
-        return 0;
-
-    /*
-     * First, check the basename
-     */
-    if (OPENSSL_strncasecmp(name, ctx->_.dir.search_name, len) != 0
-        || name[len] != '.')
-        return 0;
-    p = &name[len + 1];
-
-    /*
-     * Then, if the expected type is a CRL, check that the extension starts
-     * with 'r'
-     */
-    if (*p == 'r') {
-        p++;
-        if (ctx->expected_type != 0
-            && ctx->expected_type != OSSL_STORE_INFO_CRL)
-            return 0;
-    } else if (ctx->expected_type == OSSL_STORE_INFO_CRL) {
-        return 0;
-    }
-
-    /*
-     * Last, check that the rest of the extension is a decimal number, at
-     * least one digit long.
-     */
-    if (!isdigit((unsigned char)*p))
-        return 0;
-    while (isdigit((unsigned char)*p))
-        p++;
-
-#ifdef __VMS
-    /*
-     * One extra step here, check for a possible generation number.
-     */
-    if (*p == ';')
-        for (p++; *p != '\0'; p++)
-            if (!ossl_isdigit(*p))
-                break;
-#endif
-
-    /*
-     * If we've reached the end of the string at this point, we've successfully
-     * found a fitting file name.
-     */
-    return *p == '\0';
-}
-
-static int file_eof(OSSL_STORE_LOADER_CTX *ctx);
-static int file_error(OSSL_STORE_LOADER_CTX *ctx);
-static OSSL_STORE_INFO *file_load(OSSL_STORE_LOADER_CTX *ctx,
-    const UI_METHOD *ui_method,
-    void *ui_data)
-{
-    OSSL_STORE_INFO *result = NULL;
-
-    ctx->errcnt = 0;
-
-    if (ctx->type == is_dir) {
-        do {
-            char *newname = NULL;
-
-            if (ctx->_.dir.last_entry == NULL) {
-                if (!ctx->_.dir.end_reached) {
-                    assert(ctx->_.dir.last_errno != 0);
-                    ERR_raise(ERR_LIB_SYS, ctx->_.dir.last_errno);
-                    ctx->errcnt++;
-                }
-                return NULL;
-            }
-
-            if (ctx->_.dir.last_entry[0] != '.'
-                && file_name_check(ctx, ctx->_.dir.last_entry)
-                && !file_name_to_uri(ctx, ctx->_.dir.last_entry, &newname))
-                return NULL;
-
-            /*
-             * On the first call (with a NULL context), OPENSSL_DIR_read()
-             * cares about the second argument.  On the following calls, it
-             * only cares that it isn't NULL.  Therefore, we can safely give
-             * it our URI here.
-             */
-            ctx->_.dir.last_entry = OPENSSL_DIR_read(&ctx->_.dir.ctx, ctx->uri);
-            ctx->_.dir.last_errno = errno;
-            if (ctx->_.dir.last_entry == NULL && ctx->_.dir.last_errno == 0)
-                ctx->_.dir.end_reached = 1;
-
-            if (newname != NULL
-                && (result = OSSL_STORE_INFO_new_NAME(newname)) == NULL) {
-                OPENSSL_free(newname);
-                ATTICerr(0, ERR_R_OSSL_STORE_LIB);
-                return NULL;
-            }
-        } while (result == NULL && !file_eof(ctx));
-    } else {
-        int matchcount = -1;
-
-    again:
-        result = file_load_try_repeat(ctx, ui_method, ui_data);
-        if (result != NULL)
-            return result;
-
-        if (file_eof(ctx))
-            return NULL;
-
-        do {
-            char *pem_name = NULL; /* PEM record name */
-            char *pem_header = NULL; /* PEM record header */
-            unsigned char *data = NULL; /* DER encoded data */
-            long len = 0; /* DER encoded data length */
-
-            matchcount = -1;
-            if (ctx->type == is_pem) {
-                if (!file_read_pem(ctx->_.file.file, &pem_name, &pem_header,
-                        &data, &len, ui_method, ui_data, ctx->uri,
-                        (ctx->flags & FILE_FLAG_SECMEM) != 0)) {
-                    ctx->errcnt++;
-                    goto endloop;
-                }
-            } else {
-                if ((result = file_try_read_msblob(ctx->_.file.file,
-                         &matchcount))
-                        != NULL
-                    || (result = file_try_read_PVK(ctx->_.file.file,
-                            ui_method, ui_data, ctx->uri,
-                            &matchcount))
-                        != NULL)
-                    goto endloop;
-
-                if (!file_read_asn1(ctx->_.file.file, &data, &len)) {
-                    ctx->errcnt++;
-                    goto endloop;
-                }
-            }
-
-            result = file_load_try_decode(ctx, pem_name, pem_header, data, len,
-                ui_method, ui_data, &matchcount);
-
-            if (result != NULL)
-                goto endloop;
-
-            /*
-             * If a PEM name matches more than one handler, the handlers are
-             * badly coded.
-             */
-            if (!ossl_assert(pem_name == NULL || matchcount <= 1)) {
-                ctx->errcnt++;
-                goto endloop;
-            }
-
-            if (matchcount > 1) {
-                ATTICerr(0, ATTIC_R_AMBIGUOUS_CONTENT_TYPE);
-            } else if (matchcount == 1) {
-                /*
-                 * If there are other errors on the stack, they already show
-                 * what the problem is.
-                 */
-                if (ERR_peek_error() == 0) {
-                    ATTICerr(0, ATTIC_R_UNSUPPORTED_CONTENT_TYPE);
-                    if (pem_name != NULL)
-                        ERR_add_error_data(3, "PEM type is '", pem_name, "'");
-                }
-            }
-            if (matchcount > 0)
-                ctx->errcnt++;
-
-        endloop:
-            pem_free_flag(pem_name, (ctx->flags & FILE_FLAG_SECMEM) != 0, 0);
-            pem_free_flag(pem_header, (ctx->flags & FILE_FLAG_SECMEM) != 0, 0);
-            pem_free_flag(data, (ctx->flags & FILE_FLAG_SECMEM) != 0, len);
-        } while (matchcount == 0 && !file_eof(ctx) && !file_error(ctx));
-
-        /* We bail out on ambiguity */
-        if (matchcount > 1) {
-            store_info_free(result);
-            return NULL;
-        }
-
-        if (result != NULL
-            && ctx->expected_type != 0
-            && ctx->expected_type != OSSL_STORE_INFO_get_type(result)) {
-            store_info_free(result);
-            goto again;
-        }
-    }
-
-    return result;
-}
-
-static int file_error(OSSL_STORE_LOADER_CTX *ctx)
-{
-    return ctx->errcnt > 0;
-}
-
-static int file_eof(OSSL_STORE_LOADER_CTX *ctx)
-{
-    if (ctx->type == is_dir)
-        return ctx->_.dir.end_reached;
-
-    if (ctx->_.file.last_handler != NULL
-        && !ctx->_.file.last_handler->eof(ctx->_.file.last_handler_ctx))
-        return 0;
-    return BIO_eof(ctx->_.file.file);
-}
-
-static int file_close(OSSL_STORE_LOADER_CTX *ctx)
-{
-    if ((ctx->flags & FILE_FLAG_ATTACHED) == 0) {
-        if (ctx->type == is_dir)
-            OPENSSL_DIR_end(&ctx->_.dir.ctx);
-        else
-            BIO_free_all(ctx->_.file.file);
-    } else {
-        /*
-         * Because file_attach() called file_find_type(), we know that a
-         * BIO_f_buffer() has been pushed on top of the regular BIO.
-         */
-        BIO *buff = ctx->_.file.file;
-
-        /* Detach buff */
-        (void)BIO_pop(ctx->_.file.file);
-        /* Safety measure */
-        ctx->_.file.file = NULL;
-
-        BIO_free(buff);
-    }
-    OSSL_STORE_LOADER_CTX_free(ctx);
-    return 1;
-}
-
-/*-
- * ENGINE management
- */
-
-static const char *loader_attic_id = "loader_attic";
-static const char *loader_attic_name = "'file:' loader";
-
-static OSSL_STORE_LOADER *loader_attic = NULL;
-
-static int loader_attic_init(ENGINE *e)
-{
-    return 1;
-}
-
-static int loader_attic_finish(ENGINE *e)
-{
-    return 1;
-}
-
-static int loader_attic_destroy(ENGINE *e)
-{
-    OSSL_STORE_LOADER *loader = OSSL_STORE_unregister_loader("file");
-
-    if (loader == NULL)
-        return 0;
-
-    ERR_unload_ATTIC_strings();
-    OSSL_STORE_LOADER_free(loader);
-    return 1;
-}
-
-static int bind_loader_attic(ENGINE *e)
-{
-
-    /* Ensure the ATTIC error handling is set up on best effort basis */
-    ERR_load_ATTIC_strings();
-
-    if (/* Create the OSSL_STORE_LOADER */
-        (loader_attic = OSSL_STORE_LOADER_new(e, "file")) == NULL
-        || !OSSL_STORE_LOADER_set_open_ex(loader_attic, file_open_ex)
-        || !OSSL_STORE_LOADER_set_open(loader_attic, file_open)
-        || !OSSL_STORE_LOADER_set_attach(loader_attic, file_attach)
-        || !OSSL_STORE_LOADER_set_ctrl(loader_attic, file_ctrl)
-        || !OSSL_STORE_LOADER_set_expect(loader_attic, file_expect)
-        || !OSSL_STORE_LOADER_set_find(loader_attic, file_find)
-        || !OSSL_STORE_LOADER_set_load(loader_attic, file_load)
-        || !OSSL_STORE_LOADER_set_eof(loader_attic, file_eof)
-        || !OSSL_STORE_LOADER_set_error(loader_attic, file_error)
-        || !OSSL_STORE_LOADER_set_close(loader_attic, file_close)
-        /* Init the engine itself */
-        || !ENGINE_set_id(e, loader_attic_id)
-        || !ENGINE_set_name(e, loader_attic_name)
-        || !ENGINE_set_destroy_function(e, loader_attic_destroy)
-        || !ENGINE_set_init_function(e, loader_attic_init)
-        || !ENGINE_set_finish_function(e, loader_attic_finish)
-        /* Finally, register the method with libcrypto */
-        || !OSSL_STORE_register_loader(loader_attic)) {
-        OSSL_STORE_LOADER_free(loader_attic);
-        loader_attic = NULL;
-        ATTICerr(0, ATTIC_R_INIT_FAILED);
-        return 0;
-    }
-
-    return 1;
-}
-
-#ifdef OPENSSL_NO_DYNAMIC_ENGINE
-#error "Only allowed as dynamically shared object"
-#endif
-
-static int bind_helper(ENGINE *e, const char *id)
-{
-    if (id && (strcmp(id, loader_attic_id) != 0))
-        return 0;
-    if (!bind_loader_attic(e))
-        return 0;
-    return 1;
-}
-
-IMPLEMENT_DYNAMIC_CHECK_FN()
-IMPLEMENT_DYNAMIC_BIND_FN(bind_helper)
diff --git a/deps/openssl/openssl/engines/e_loader_attic.ec b/deps/openssl/openssl/engines/e_loader_attic.ec
deleted file mode 100644
index 525a689fe58..00000000000
--- a/deps/openssl/openssl/engines/e_loader_attic.ec
+++ /dev/null
@@ -1,3 +0,0 @@
-# The INPUT HEADER is scanned for declarations
-# LIBNAME       INPUT HEADER                    ERROR-TABLE FILE
-L ATTIC         e_loader_attic_err.h            e_loader_attic_err.c
diff --git a/deps/openssl/openssl/engines/e_loader_attic.txt b/deps/openssl/openssl/engines/e_loader_attic.txt
deleted file mode 100644
index 4fb8fdf5e8a..00000000000
--- a/deps/openssl/openssl/engines/e_loader_attic.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
-#
-# Licensed under the Apache License 2.0 (the "License").  You may not use
-# this file except in compliance with the License.  You can obtain a copy
-# in the file LICENSE in the source distribution or at
-# https://www.openssl.org/source/license.html
-
-#Reason codes
-ATTIC_R_AMBIGUOUS_CONTENT_TYPE:100:ambiguous content type
-ATTIC_R_BAD_PASSWORD_READ:101:bad password read
-ATTIC_R_ERROR_VERIFYING_PKCS12_MAC:102:error verifying pkcs12 mac
-ATTIC_R_INIT_FAILED:103:init failed
-ATTIC_R_PASSPHRASE_CALLBACK_ERROR:104:passphrase callback error
-ATTIC_R_PATH_MUST_BE_ABSOLUTE:105:path must be absolute
-ATTIC_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES:106:\
-	search only supported for directories
-ATTIC_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED:107:\
-	ui process interrupted or cancelled
-ATTIC_R_UNSUPPORTED_CONTENT_TYPE:108:unsupported content type
-ATTIC_R_UNSUPPORTED_SEARCH_TYPE:109:unsupported search type
-ATTIC_R_URI_AUTHORITY_UNSUPPORTED:110:uri authority unsupported
diff --git a/deps/openssl/openssl/engines/e_loader_attic_err.c b/deps/openssl/openssl/engines/e_loader_attic_err.c
deleted file mode 100644
index 749b0b415ba..00000000000
--- a/deps/openssl/openssl/engines/e_loader_attic_err.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include "e_loader_attic_err.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static ERR_STRING_DATA ATTIC_str_reasons[] = {
-    { ERR_PACK(0, 0, ATTIC_R_AMBIGUOUS_CONTENT_TYPE), "ambiguous content type" },
-    { ERR_PACK(0, 0, ATTIC_R_BAD_PASSWORD_READ), "bad password read" },
-    { ERR_PACK(0, 0, ATTIC_R_ERROR_VERIFYING_PKCS12_MAC),
-        "error verifying pkcs12 mac" },
-    { ERR_PACK(0, 0, ATTIC_R_INIT_FAILED), "init failed" },
-    { ERR_PACK(0, 0, ATTIC_R_PASSPHRASE_CALLBACK_ERROR),
-        "passphrase callback error" },
-    { ERR_PACK(0, 0, ATTIC_R_PATH_MUST_BE_ABSOLUTE), "path must be absolute" },
-    { ERR_PACK(0, 0, ATTIC_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES),
-        "search only supported for directories" },
-    { ERR_PACK(0, 0, ATTIC_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED),
-        "ui process interrupted or cancelled" },
-    { ERR_PACK(0, 0, ATTIC_R_UNSUPPORTED_CONTENT_TYPE),
-        "unsupported content type" },
-    { ERR_PACK(0, 0, ATTIC_R_UNSUPPORTED_SEARCH_TYPE),
-        "unsupported search type" },
-    { ERR_PACK(0, 0, ATTIC_R_URI_AUTHORITY_UNSUPPORTED),
-        "uri authority unsupported" },
-    { 0, NULL }
-};
-
-#endif
-
-static int lib_code = 0;
-static int error_loaded = 0;
-
-static int ERR_load_ATTIC_strings(void)
-{
-    if (lib_code == 0)
-        lib_code = ERR_get_next_error_library();
-
-    if (!error_loaded) {
-#ifndef OPENSSL_NO_ERR
-        ERR_load_strings(lib_code, ATTIC_str_reasons);
-#endif
-        error_loaded = 1;
-    }
-    return 1;
-}
-
-static void ERR_unload_ATTIC_strings(void)
-{
-    if (error_loaded) {
-#ifndef OPENSSL_NO_ERR
-        ERR_unload_strings(lib_code, ATTIC_str_reasons);
-#endif
-        error_loaded = 0;
-    }
-}
-
-static void ERR_ATTIC_error(int function, int reason, const char *file, int line)
-{
-    if (lib_code == 0)
-        lib_code = ERR_get_next_error_library();
-    ERR_raise(lib_code, reason);
-    ERR_set_debug(file, line, NULL);
-}
diff --git a/deps/openssl/openssl/engines/e_loader_attic_err.h b/deps/openssl/openssl/engines/e_loader_attic_err.h
deleted file mode 100644
index eab95c102d5..00000000000
--- a/deps/openssl/openssl/engines/e_loader_attic_err.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_E_LOADER_ATTIC_ERR_H
-#define OSSL_E_LOADER_ATTIC_ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#define ATTICerr(f, r) ERR_ATTIC_error(0, (r), OPENSSL_FILE, OPENSSL_LINE)
-
-/*
- * ATTIC reason codes.
- */
-#define ATTIC_R_AMBIGUOUS_CONTENT_TYPE 100
-#define ATTIC_R_BAD_PASSWORD_READ 101
-#define ATTIC_R_ERROR_VERIFYING_PKCS12_MAC 102
-#define ATTIC_R_INIT_FAILED 103
-#define ATTIC_R_PASSPHRASE_CALLBACK_ERROR 104
-#define ATTIC_R_PATH_MUST_BE_ABSOLUTE 105
-#define ATTIC_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES 106
-#define ATTIC_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED 107
-#define ATTIC_R_UNSUPPORTED_CONTENT_TYPE 108
-#define ATTIC_R_UNSUPPORTED_SEARCH_TYPE 109
-#define ATTIC_R_URI_AUTHORITY_UNSUPPORTED 110
-
-#endif
diff --git a/deps/openssl/openssl/engines/e_ossltest.c b/deps/openssl/openssl/engines/e_ossltest.c
deleted file mode 100644
index 348396209d2..00000000000
--- a/deps/openssl/openssl/engines/e_ossltest.c
+++ /dev/null
@@ -1,920 +0,0 @@
-/*
- * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * This is the OSSLTEST engine. It provides deliberately crippled digest
- * implementations for test purposes. It is highly insecure and must NOT be
- * used for any purpose except testing
- */
-
-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-/*
- * SHA low level APIs are deprecated for public use, but still ok for
- * internal use.  Note, that due to symbols not being exported, only the
- * #defines and type definitions can be accessed, function calls are not
- * available.  The digest lengths, block sizes and sizeof(CTX) are used herein
- * for several different digests.
- */
-#include "internal/deprecated.h"
-
-#include <stdio.h>
-#include <string.h>
-#include "internal/common.h" /* for CHECK_AND_SKIP_CASE_PREFIX */
-
-#include <openssl/engine.h>
-#include <openssl/sha.h>
-#include <openssl/md5.h>
-#include <openssl/rsa.h>
-#include <openssl/evp.h>
-#include <openssl/modes.h>
-#include <openssl/aes.h>
-#include <openssl/rand.h>
-#include <openssl/crypto.h>
-#include <openssl/pem.h>
-#include <crypto/evp.h>
-
-/* clang-format off */
-#include "e_ossltest_err.c"
-/* clang-format on */
-
-/* Engine Id and Name */
-static const char *engine_ossltest_id = "ossltest";
-static const char *engine_ossltest_name = "OpenSSL Test engine support";
-
-/* Engine Lifetime functions */
-static int ossltest_destroy(ENGINE *e);
-static int ossltest_init(ENGINE *e);
-static int ossltest_finish(ENGINE *e);
-void ENGINE_load_ossltest(void);
-
-/* Set up digests */
-static int ossltest_digests(ENGINE *e, const EVP_MD **digest,
-    const int **nids, int nid);
-static const RAND_METHOD *ossltest_rand_method(void);
-
-/* MD5 */
-static int digest_md5_init(EVP_MD_CTX *ctx);
-static int digest_md5_update(EVP_MD_CTX *ctx, const void *data,
-    size_t count);
-static int digest_md5_final(EVP_MD_CTX *ctx, unsigned char *md);
-
-static EVP_MD *_hidden_md5_md = NULL;
-static const EVP_MD *digest_md5(void)
-{
-    if (_hidden_md5_md == NULL) {
-        EVP_MD *md;
-
-        if ((md = EVP_MD_meth_new(NID_md5, NID_md5WithRSAEncryption)) == NULL
-            || !EVP_MD_meth_set_result_size(md, MD5_DIGEST_LENGTH)
-            || !EVP_MD_meth_set_input_blocksize(md, MD5_CBLOCK)
-            || !EVP_MD_meth_set_app_datasize(md,
-                sizeof(EVP_MD *) + sizeof(MD5_CTX))
-            || !EVP_MD_meth_set_flags(md, 0)
-            || !EVP_MD_meth_set_init(md, digest_md5_init)
-            || !EVP_MD_meth_set_update(md, digest_md5_update)
-            || !EVP_MD_meth_set_final(md, digest_md5_final)) {
-            EVP_MD_meth_free(md);
-            md = NULL;
-        }
-        _hidden_md5_md = md;
-    }
-    return _hidden_md5_md;
-}
-
-/* SHA1 */
-static int digest_sha1_init(EVP_MD_CTX *ctx);
-static int digest_sha1_update(EVP_MD_CTX *ctx, const void *data,
-    size_t count);
-static int digest_sha1_final(EVP_MD_CTX *ctx, unsigned char *md);
-
-static EVP_MD *_hidden_sha1_md = NULL;
-static const EVP_MD *digest_sha1(void)
-{
-    if (_hidden_sha1_md == NULL) {
-        EVP_MD *md;
-
-        if ((md = EVP_MD_meth_new(NID_sha1, NID_sha1WithRSAEncryption)) == NULL
-            || !EVP_MD_meth_set_result_size(md, SHA_DIGEST_LENGTH)
-            || !EVP_MD_meth_set_input_blocksize(md, SHA_CBLOCK)
-            || !EVP_MD_meth_set_app_datasize(md,
-                sizeof(EVP_MD *) + sizeof(SHA_CTX))
-            || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_DIGALGID_ABSENT)
-            || !EVP_MD_meth_set_init(md, digest_sha1_init)
-            || !EVP_MD_meth_set_update(md, digest_sha1_update)
-            || !EVP_MD_meth_set_final(md, digest_sha1_final)) {
-            EVP_MD_meth_free(md);
-            md = NULL;
-        }
-        _hidden_sha1_md = md;
-    }
-    return _hidden_sha1_md;
-}
-
-/* SHA256 */
-static int digest_sha256_init(EVP_MD_CTX *ctx);
-static int digest_sha256_update(EVP_MD_CTX *ctx, const void *data,
-    size_t count);
-static int digest_sha256_final(EVP_MD_CTX *ctx, unsigned char *md);
-
-static EVP_MD *_hidden_sha256_md = NULL;
-static const EVP_MD *digest_sha256(void)
-{
-    if (_hidden_sha256_md == NULL) {
-        EVP_MD *md;
-
-        if ((md = EVP_MD_meth_new(NID_sha256, NID_sha256WithRSAEncryption)) == NULL
-            || !EVP_MD_meth_set_result_size(md, SHA256_DIGEST_LENGTH)
-            || !EVP_MD_meth_set_input_blocksize(md, SHA256_CBLOCK)
-            || !EVP_MD_meth_set_app_datasize(md,
-                sizeof(EVP_MD *) + sizeof(SHA256_CTX))
-            || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_DIGALGID_ABSENT)
-            || !EVP_MD_meth_set_init(md, digest_sha256_init)
-            || !EVP_MD_meth_set_update(md, digest_sha256_update)
-            || !EVP_MD_meth_set_final(md, digest_sha256_final)) {
-            EVP_MD_meth_free(md);
-            md = NULL;
-        }
-        _hidden_sha256_md = md;
-    }
-    return _hidden_sha256_md;
-}
-
-/* SHA384/SHA512 */
-static int digest_sha384_init(EVP_MD_CTX *ctx);
-static int digest_sha384_update(EVP_MD_CTX *ctx, const void *data,
-    size_t count);
-static int digest_sha384_final(EVP_MD_CTX *ctx, unsigned char *md);
-
-static int digest_sha512_init(EVP_MD_CTX *ctx);
-static int digest_sha512_update(EVP_MD_CTX *ctx, const void *data,
-    size_t count);
-static int digest_sha512_final(EVP_MD_CTX *ctx, unsigned char *md);
-
-static EVP_MD *_hidden_sha384_md = NULL;
-static const EVP_MD *digest_sha384(void)
-{
-    if (_hidden_sha384_md == NULL) {
-        EVP_MD *md;
-
-        if ((md = EVP_MD_meth_new(NID_sha384, NID_sha384WithRSAEncryption)) == NULL
-            || !EVP_MD_meth_set_result_size(md, SHA384_DIGEST_LENGTH)
-            || !EVP_MD_meth_set_input_blocksize(md, SHA512_CBLOCK)
-            || !EVP_MD_meth_set_app_datasize(md,
-                sizeof(EVP_MD *) + sizeof(SHA512_CTX))
-            || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_DIGALGID_ABSENT)
-            || !EVP_MD_meth_set_init(md, digest_sha384_init)
-            || !EVP_MD_meth_set_update(md, digest_sha384_update)
-            || !EVP_MD_meth_set_final(md, digest_sha384_final)) {
-            EVP_MD_meth_free(md);
-            md = NULL;
-        }
-        _hidden_sha384_md = md;
-    }
-    return _hidden_sha384_md;
-}
-static EVP_MD *_hidden_sha512_md = NULL;
-static const EVP_MD *digest_sha512(void)
-{
-    if (_hidden_sha512_md == NULL) {
-        EVP_MD *md;
-
-        if ((md = EVP_MD_meth_new(NID_sha512, NID_sha512WithRSAEncryption)) == NULL
-            || !EVP_MD_meth_set_result_size(md, SHA512_DIGEST_LENGTH)
-            || !EVP_MD_meth_set_input_blocksize(md, SHA512_CBLOCK)
-            || !EVP_MD_meth_set_app_datasize(md,
-                sizeof(EVP_MD *) + sizeof(SHA512_CTX))
-            || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_DIGALGID_ABSENT)
-            || !EVP_MD_meth_set_init(md, digest_sha512_init)
-            || !EVP_MD_meth_set_update(md, digest_sha512_update)
-            || !EVP_MD_meth_set_final(md, digest_sha512_final)) {
-            EVP_MD_meth_free(md);
-            md = NULL;
-        }
-        _hidden_sha512_md = md;
-    }
-    return _hidden_sha512_md;
-}
-static void destroy_digests(void)
-{
-    EVP_MD_meth_free(_hidden_md5_md);
-    _hidden_md5_md = NULL;
-    EVP_MD_meth_free(_hidden_sha1_md);
-    _hidden_sha1_md = NULL;
-    EVP_MD_meth_free(_hidden_sha256_md);
-    _hidden_sha256_md = NULL;
-    EVP_MD_meth_free(_hidden_sha384_md);
-    _hidden_sha384_md = NULL;
-    EVP_MD_meth_free(_hidden_sha512_md);
-    _hidden_sha512_md = NULL;
-}
-static int ossltest_digest_nids(const int **nids)
-{
-    static int digest_nids[6] = { 0, 0, 0, 0, 0, 0 };
-    static int pos = 0;
-    static int init = 0;
-
-    if (!init) {
-        const EVP_MD *md;
-        if ((md = digest_md5()) != NULL)
-            digest_nids[pos++] = EVP_MD_get_type(md);
-        if ((md = digest_sha1()) != NULL)
-            digest_nids[pos++] = EVP_MD_get_type(md);
-        if ((md = digest_sha256()) != NULL)
-            digest_nids[pos++] = EVP_MD_get_type(md);
-        if ((md = digest_sha384()) != NULL)
-            digest_nids[pos++] = EVP_MD_get_type(md);
-        if ((md = digest_sha512()) != NULL)
-            digest_nids[pos++] = EVP_MD_get_type(md);
-        digest_nids[pos] = 0;
-        init = 1;
-    }
-    *nids = digest_nids;
-    return pos;
-}
-
-/* Setup ciphers */
-static int ossltest_ciphers(ENGINE *, const EVP_CIPHER **,
-    const int **, int);
-
-static int ossltest_cipher_nids[] = {
-    NID_aes_128_cbc, NID_aes_128_gcm,
-    NID_aes_128_cbc_hmac_sha1, 0
-};
-
-/* AES128 */
-
-static int ossltest_aes128_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *iv, int enc);
-static int ossltest_aes128_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl);
-static int ossltest_aes128_gcm_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *iv, int enc);
-static int ossltest_aes128_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl);
-static int ossltest_aes128_gcm_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
-    void *ptr);
-static int ossltest_aes128_cbc_hmac_sha1_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *iv,
-    int enc);
-static int ossltest_aes128_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx,
-    unsigned char *out,
-    const unsigned char *in,
-    size_t inl);
-static int ossltest_aes128_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type,
-    int arg, void *ptr);
-
-typedef struct {
-    size_t payload_length; /* AAD length in decrypt case */
-    unsigned int tls_ver;
-} EVP_AES_HMAC_SHA1;
-
-static EVP_CIPHER *_hidden_aes_128_cbc = NULL;
-static const EVP_CIPHER *ossltest_aes_128_cbc(void)
-{
-    if (_hidden_aes_128_cbc == NULL
-        && ((_hidden_aes_128_cbc = EVP_CIPHER_meth_new(NID_aes_128_cbc,
-                 16 /* block size */,
-                 16 /* key len */))
-                == NULL
-            || !EVP_CIPHER_meth_set_iv_length(_hidden_aes_128_cbc, 16)
-            || !EVP_CIPHER_meth_set_flags(_hidden_aes_128_cbc,
-                EVP_CIPH_FLAG_DEFAULT_ASN1
-                    | EVP_CIPH_CBC_MODE)
-            || !EVP_CIPHER_meth_set_init(_hidden_aes_128_cbc,
-                ossltest_aes128_init_key)
-            || !EVP_CIPHER_meth_set_do_cipher(_hidden_aes_128_cbc,
-                ossltest_aes128_cbc_cipher)
-            || !EVP_CIPHER_meth_set_impl_ctx_size(_hidden_aes_128_cbc,
-                EVP_CIPHER_impl_ctx_size(EVP_aes_128_cbc())))) {
-        EVP_CIPHER_meth_free(_hidden_aes_128_cbc);
-        _hidden_aes_128_cbc = NULL;
-    }
-    return _hidden_aes_128_cbc;
-}
-
-static EVP_CIPHER *_hidden_aes_128_gcm = NULL;
-
-#define AES_GCM_FLAGS (EVP_CIPH_FLAG_DEFAULT_ASN1      \
-    | EVP_CIPH_CUSTOM_IV | EVP_CIPH_FLAG_CUSTOM_CIPHER \
-    | EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CTRL_INIT   \
-    | EVP_CIPH_CUSTOM_COPY | EVP_CIPH_FLAG_AEAD_CIPHER \
-    | EVP_CIPH_GCM_MODE)
-
-static const EVP_CIPHER *ossltest_aes_128_gcm(void)
-{
-    if (_hidden_aes_128_gcm == NULL
-        && ((_hidden_aes_128_gcm = EVP_CIPHER_meth_new(NID_aes_128_gcm,
-                 1 /* block size */,
-                 16 /* key len */))
-                == NULL
-            || !EVP_CIPHER_meth_set_iv_length(_hidden_aes_128_gcm, 12)
-            || !EVP_CIPHER_meth_set_flags(_hidden_aes_128_gcm, AES_GCM_FLAGS)
-            || !EVP_CIPHER_meth_set_init(_hidden_aes_128_gcm,
-                ossltest_aes128_gcm_init_key)
-            || !EVP_CIPHER_meth_set_do_cipher(_hidden_aes_128_gcm,
-                ossltest_aes128_gcm_cipher)
-            || !EVP_CIPHER_meth_set_ctrl(_hidden_aes_128_gcm,
-                ossltest_aes128_gcm_ctrl)
-            || !EVP_CIPHER_meth_set_impl_ctx_size(_hidden_aes_128_gcm,
-                EVP_CIPHER_impl_ctx_size(EVP_aes_128_gcm())))) {
-        EVP_CIPHER_meth_free(_hidden_aes_128_gcm);
-        _hidden_aes_128_gcm = NULL;
-    }
-    return _hidden_aes_128_gcm;
-}
-
-static EVP_CIPHER *_hidden_aes_128_cbc_hmac_sha1 = NULL;
-
-static const EVP_CIPHER *ossltest_aes_128_cbc_hmac_sha1(void)
-{
-    if (_hidden_aes_128_cbc_hmac_sha1 == NULL
-        && ((_hidden_aes_128_cbc_hmac_sha1
-                = EVP_CIPHER_meth_new(NID_aes_128_cbc_hmac_sha1,
-                    16 /* block size */,
-                    16 /* key len */))
-                == NULL
-            || !EVP_CIPHER_meth_set_iv_length(_hidden_aes_128_cbc_hmac_sha1, 16)
-            || !EVP_CIPHER_meth_set_flags(_hidden_aes_128_cbc_hmac_sha1,
-                EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_DEFAULT_ASN1 | EVP_CIPH_FLAG_AEAD_CIPHER)
-            || !EVP_CIPHER_meth_set_init(_hidden_aes_128_cbc_hmac_sha1,
-                ossltest_aes128_cbc_hmac_sha1_init_key)
-            || !EVP_CIPHER_meth_set_do_cipher(_hidden_aes_128_cbc_hmac_sha1,
-                ossltest_aes128_cbc_hmac_sha1_cipher)
-            || !EVP_CIPHER_meth_set_ctrl(_hidden_aes_128_cbc_hmac_sha1,
-                ossltest_aes128_cbc_hmac_sha1_ctrl)
-            || !EVP_CIPHER_meth_set_set_asn1_params(_hidden_aes_128_cbc_hmac_sha1,
-                EVP_CIPH_FLAG_DEFAULT_ASN1 ? NULL : EVP_CIPHER_set_asn1_iv)
-            || !EVP_CIPHER_meth_set_get_asn1_params(_hidden_aes_128_cbc_hmac_sha1,
-                EVP_CIPH_FLAG_DEFAULT_ASN1 ? NULL : EVP_CIPHER_get_asn1_iv)
-            || !EVP_CIPHER_meth_set_impl_ctx_size(_hidden_aes_128_cbc_hmac_sha1,
-                sizeof(EVP_AES_HMAC_SHA1)))) {
-        EVP_CIPHER_meth_free(_hidden_aes_128_cbc_hmac_sha1);
-        _hidden_aes_128_cbc_hmac_sha1 = NULL;
-    }
-    return _hidden_aes_128_cbc_hmac_sha1;
-}
-
-static void destroy_ciphers(void)
-{
-    EVP_CIPHER_meth_free(_hidden_aes_128_cbc);
-    EVP_CIPHER_meth_free(_hidden_aes_128_gcm);
-    EVP_CIPHER_meth_free(_hidden_aes_128_cbc_hmac_sha1);
-    _hidden_aes_128_cbc = NULL;
-    _hidden_aes_128_gcm = NULL;
-    _hidden_aes_128_cbc_hmac_sha1 = NULL;
-}
-
-/* Key loading */
-static EVP_PKEY *load_key(ENGINE *eng, const char *key_id, int pub,
-    UI_METHOD *ui_method, void *ui_data)
-{
-    BIO *in;
-    EVP_PKEY *key;
-
-    if (!CHECK_AND_SKIP_CASE_PREFIX(key_id, "ot:"))
-        return NULL;
-
-    fprintf(stderr, "[ossltest]Loading %s key %s\n",
-        pub ? "Public" : "Private", key_id);
-    in = BIO_new_file(key_id, "r");
-    if (!in)
-        return NULL;
-    if (pub)
-        key = PEM_read_bio_PUBKEY(in, NULL, 0, NULL);
-    else
-        key = PEM_read_bio_PrivateKey(in, NULL, 0, NULL);
-    BIO_free(in);
-    return key;
-}
-
-static EVP_PKEY *ossltest_load_privkey(ENGINE *eng, const char *key_id,
-    UI_METHOD *ui_method, void *ui_data)
-{
-    return load_key(eng, key_id, 0, ui_method, ui_data);
-}
-
-static EVP_PKEY *ossltest_load_pubkey(ENGINE *eng, const char *key_id,
-    UI_METHOD *ui_method, void *ui_data)
-{
-    return load_key(eng, key_id, 1, ui_method, ui_data);
-}
-
-static int bind_ossltest(ENGINE *e)
-{
-    /* Ensure the ossltest error handling is set up */
-    ERR_load_OSSLTEST_strings();
-
-    if (!ENGINE_set_id(e, engine_ossltest_id)
-        || !ENGINE_set_name(e, engine_ossltest_name)
-        || !ENGINE_set_digests(e, ossltest_digests)
-        || !ENGINE_set_ciphers(e, ossltest_ciphers)
-        || !ENGINE_set_RAND(e, ossltest_rand_method())
-        || !ENGINE_set_destroy_function(e, ossltest_destroy)
-        || !ENGINE_set_load_privkey_function(e, ossltest_load_privkey)
-        || !ENGINE_set_load_pubkey_function(e, ossltest_load_pubkey)
-        || !ENGINE_set_init_function(e, ossltest_init)
-        || !ENGINE_set_finish_function(e, ossltest_finish)) {
-        OSSLTESTerr(OSSLTEST_F_BIND_OSSLTEST, OSSLTEST_R_INIT_FAILED);
-        return 0;
-    }
-
-    return 1;
-}
-
-#ifndef OPENSSL_NO_DYNAMIC_ENGINE
-static int bind_helper(ENGINE *e, const char *id)
-{
-    if (id && (strcmp(id, engine_ossltest_id) != 0))
-        return 0;
-    if (!bind_ossltest(e))
-        return 0;
-    return 1;
-}
-
-IMPLEMENT_DYNAMIC_CHECK_FN()
-IMPLEMENT_DYNAMIC_BIND_FN(bind_helper)
-#endif
-
-static ENGINE *engine_ossltest(void)
-{
-    ENGINE *ret = ENGINE_new();
-    if (ret == NULL)
-        return NULL;
-    if (!bind_ossltest(ret)) {
-        ENGINE_free(ret);
-        return NULL;
-    }
-    return ret;
-}
-
-void ENGINE_load_ossltest(void)
-{
-    /* Copied from eng_[openssl|dyn].c */
-    ENGINE *toadd = engine_ossltest();
-    if (!toadd)
-        return;
-    ENGINE_add(toadd);
-    ENGINE_free(toadd);
-    ERR_clear_error();
-}
-
-static int ossltest_init(ENGINE *e)
-{
-    return 1;
-}
-
-static int ossltest_finish(ENGINE *e)
-{
-    return 1;
-}
-
-static int ossltest_destroy(ENGINE *e)
-{
-    destroy_digests();
-    destroy_ciphers();
-    ERR_unload_OSSLTEST_strings();
-    return 1;
-}
-
-static int ossltest_digests(ENGINE *e, const EVP_MD **digest,
-    const int **nids, int nid)
-{
-    int ok = 1;
-    if (!digest) {
-        /* We are returning a list of supported nids */
-        return ossltest_digest_nids(nids);
-    }
-    /* We are being asked for a specific digest */
-    switch (nid) {
-    case NID_md5:
-        *digest = digest_md5();
-        break;
-    case NID_sha1:
-        *digest = digest_sha1();
-        break;
-    case NID_sha256:
-        *digest = digest_sha256();
-        break;
-    case NID_sha384:
-        *digest = digest_sha384();
-        break;
-    case NID_sha512:
-        *digest = digest_sha512();
-        break;
-    default:
-        ok = 0;
-        *digest = NULL;
-        break;
-    }
-    return ok;
-}
-
-static int ossltest_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
-    const int **nids, int nid)
-{
-    int ok = 1;
-    if (!cipher) {
-        /* We are returning a list of supported nids */
-        *nids = ossltest_cipher_nids;
-        return (sizeof(ossltest_cipher_nids) - 1)
-            / sizeof(ossltest_cipher_nids[0]);
-    }
-    /* We are being asked for a specific cipher */
-    switch (nid) {
-    case NID_aes_128_cbc:
-        *cipher = ossltest_aes_128_cbc();
-        break;
-    case NID_aes_128_gcm:
-        *cipher = ossltest_aes_128_gcm();
-        break;
-    case NID_aes_128_cbc_hmac_sha1:
-        *cipher = ossltest_aes_128_cbc_hmac_sha1();
-        break;
-    default:
-        ok = 0;
-        *cipher = NULL;
-        break;
-    }
-    return ok;
-}
-
-static void fill_known_data(unsigned char *md, unsigned int len)
-{
-    unsigned int i;
-
-    for (i = 0; i < len; i++) {
-        md[i] = (unsigned char)(i & 0xff);
-    }
-}
-
-/*
- * MD5 implementation. We go through the motions of doing MD5 by deferring to
- * the standard implementation. Then we overwrite the result with a will defined
- * value, so that all "MD5" digests using the test engine always end up with
- * the same value.
- */
-static int digest_md5_init(EVP_MD_CTX *ctx)
-{
-    return EVP_MD_meth_get_init(EVP_md5())(ctx);
-}
-
-static int digest_md5_update(EVP_MD_CTX *ctx, const void *data,
-    size_t count)
-{
-    return EVP_MD_meth_get_update(EVP_md5())(ctx, data, count);
-}
-
-static int digest_md5_final(EVP_MD_CTX *ctx, unsigned char *md)
-{
-    int ret = EVP_MD_meth_get_final(EVP_md5())(ctx, md);
-
-    if (ret > 0) {
-        fill_known_data(md, MD5_DIGEST_LENGTH);
-    }
-    return ret;
-}
-
-/*
- * SHA1 implementation.
- */
-static int digest_sha1_init(EVP_MD_CTX *ctx)
-{
-    return EVP_MD_meth_get_init(EVP_sha1())(ctx);
-}
-
-static int digest_sha1_update(EVP_MD_CTX *ctx, const void *data,
-    size_t count)
-{
-    return EVP_MD_meth_get_update(EVP_sha1())(ctx, data, count);
-}
-
-static int digest_sha1_final(EVP_MD_CTX *ctx, unsigned char *md)
-{
-    int ret = EVP_MD_meth_get_final(EVP_sha1())(ctx, md);
-
-    if (ret > 0) {
-        fill_known_data(md, SHA_DIGEST_LENGTH);
-    }
-    return ret;
-}
-
-/*
- * SHA256 implementation.
- */
-static int digest_sha256_init(EVP_MD_CTX *ctx)
-{
-    return EVP_MD_meth_get_init(EVP_sha256())(ctx);
-}
-
-static int digest_sha256_update(EVP_MD_CTX *ctx, const void *data,
-    size_t count)
-{
-    return EVP_MD_meth_get_update(EVP_sha256())(ctx, data, count);
-}
-
-static int digest_sha256_final(EVP_MD_CTX *ctx, unsigned char *md)
-{
-    int ret = EVP_MD_meth_get_final(EVP_sha256())(ctx, md);
-
-    if (ret > 0) {
-        fill_known_data(md, SHA256_DIGEST_LENGTH);
-    }
-    return ret;
-}
-
-/*
- * SHA384 implementation.
- */
-static int digest_sha384_init(EVP_MD_CTX *ctx)
-{
-    return EVP_MD_meth_get_init(EVP_sha384())(ctx);
-}
-
-static int digest_sha384_update(EVP_MD_CTX *ctx, const void *data,
-    size_t count)
-{
-    return EVP_MD_meth_get_update(EVP_sha384())(ctx, data, count);
-}
-
-static int digest_sha384_final(EVP_MD_CTX *ctx, unsigned char *md)
-{
-    int ret = EVP_MD_meth_get_final(EVP_sha384())(ctx, md);
-
-    if (ret > 0) {
-        fill_known_data(md, SHA384_DIGEST_LENGTH);
-    }
-    return ret;
-}
-
-/*
- * SHA512 implementation.
- */
-static int digest_sha512_init(EVP_MD_CTX *ctx)
-{
-    return EVP_MD_meth_get_init(EVP_sha512())(ctx);
-}
-
-static int digest_sha512_update(EVP_MD_CTX *ctx, const void *data,
-    size_t count)
-{
-    return EVP_MD_meth_get_update(EVP_sha512())(ctx, data, count);
-}
-
-static int digest_sha512_final(EVP_MD_CTX *ctx, unsigned char *md)
-{
-    int ret = EVP_MD_meth_get_final(EVP_sha512())(ctx, md);
-
-    if (ret > 0) {
-        fill_known_data(md, SHA512_DIGEST_LENGTH);
-    }
-    return ret;
-}
-
-/*
- * AES128 Implementation
- */
-
-static int ossltest_aes128_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    return EVP_CIPHER_meth_get_init(EVP_aes_128_cbc())(ctx, key, iv, enc);
-}
-
-static int ossltest_aes128_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    unsigned char *tmpbuf;
-    int ret;
-
-    tmpbuf = OPENSSL_malloc(inl);
-
-    /* OPENSSL_malloc will return NULL if inl == 0 */
-    if (tmpbuf == NULL && inl > 0)
-        return -1;
-
-    /* Remember what we were asked to encrypt */
-    if (tmpbuf != NULL)
-        memcpy(tmpbuf, in, inl);
-
-    /* Go through the motions of encrypting it */
-    ret = EVP_CIPHER_meth_get_do_cipher(EVP_aes_128_cbc())(ctx, out, in, inl);
-
-    /* Throw it all away and just use the plaintext as the output */
-    if (tmpbuf != NULL)
-        memcpy(out, tmpbuf, inl);
-    OPENSSL_free(tmpbuf);
-
-    return ret;
-}
-
-static int ossltest_aes128_gcm_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    return EVP_CIPHER_meth_get_init(EVP_aes_128_gcm())(ctx, key, iv, enc);
-}
-
-static int ossltest_aes128_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-    const unsigned char *in, size_t inl)
-{
-    unsigned char *tmpbuf = OPENSSL_malloc(inl);
-
-    /* OPENSSL_malloc will return NULL if inl == 0 */
-    if (tmpbuf == NULL && inl > 0)
-        return -1;
-
-    /* Remember what we were asked to encrypt */
-    if (tmpbuf != NULL)
-        memcpy(tmpbuf, in, inl);
-
-    /* Go through the motions of encrypting it */
-    EVP_CIPHER_meth_get_do_cipher(EVP_aes_128_gcm())(ctx, out, in, inl);
-
-    /* Throw it all away and just use the plaintext as the output */
-    if (tmpbuf != NULL && out != NULL)
-        memcpy(out, tmpbuf, inl);
-    OPENSSL_free(tmpbuf);
-
-    return inl;
-}
-
-static int ossltest_aes128_gcm_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
-    void *ptr)
-{
-    /* Pass the ctrl down */
-    int ret = EVP_CIPHER_meth_get_ctrl(EVP_aes_128_gcm())(ctx, type, arg, ptr);
-
-    if (ret <= 0)
-        return ret;
-
-    switch (type) {
-    case EVP_CTRL_AEAD_GET_TAG:
-        /* Always give the same tag */
-        memset(ptr, 0, EVP_GCM_TLS_TAG_LEN);
-        break;
-
-    default:
-        break;
-    }
-
-    return 1;
-}
-
-#define NO_PAYLOAD_LENGTH ((size_t)-1)
-#define data(ctx) ((EVP_AES_HMAC_SHA1 *)EVP_CIPHER_CTX_get_cipher_data(ctx))
-
-static int ossltest_aes128_cbc_hmac_sha1_init_key(EVP_CIPHER_CTX *ctx,
-    const unsigned char *inkey,
-    const unsigned char *iv,
-    int enc)
-{
-    EVP_AES_HMAC_SHA1 *key = data(ctx);
-    key->payload_length = NO_PAYLOAD_LENGTH;
-    return 1;
-}
-
-static int ossltest_aes128_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx,
-    unsigned char *out,
-    const unsigned char *in,
-    size_t len)
-{
-    EVP_AES_HMAC_SHA1 *key = data(ctx);
-    unsigned int l;
-    size_t plen = key->payload_length;
-
-    key->payload_length = NO_PAYLOAD_LENGTH;
-
-    if (len % AES_BLOCK_SIZE)
-        return 0;
-
-    if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-        if (plen == NO_PAYLOAD_LENGTH)
-            plen = len;
-        else if (len != ((plen + SHA_DIGEST_LENGTH + AES_BLOCK_SIZE) & -AES_BLOCK_SIZE))
-            return 0;
-
-        memmove(out, in, plen);
-
-        if (plen != len) { /* "TLS" mode of operation */
-            /* calculate HMAC and append it to payload */
-            fill_known_data(out + plen, SHA_DIGEST_LENGTH);
-
-            /* pad the payload|hmac */
-            plen += SHA_DIGEST_LENGTH;
-            for (l = len - plen - 1; plen < len; plen++)
-                out[plen] = l;
-        }
-    } else {
-        /* decrypt HMAC|padding at once */
-        memmove(out, in, len);
-
-        if (plen != NO_PAYLOAD_LENGTH) { /* "TLS" mode of operation */
-            unsigned int maxpad, pad;
-
-            if (key->tls_ver >= TLS1_1_VERSION) {
-                if (len < (AES_BLOCK_SIZE + SHA_DIGEST_LENGTH + 1))
-                    return 0;
-
-                /* omit explicit iv */
-                in += AES_BLOCK_SIZE;
-                out += AES_BLOCK_SIZE;
-                len -= AES_BLOCK_SIZE;
-            } else if (len < (SHA_DIGEST_LENGTH + 1))
-                return 0;
-
-            /* figure out payload length */
-            pad = out[len - 1];
-            maxpad = len - (SHA_DIGEST_LENGTH + 1);
-            if (pad > maxpad)
-                return 0;
-            for (plen = len - pad - 1; plen < len; plen++)
-                if (out[plen] != pad)
-                    return 0;
-        }
-    }
-
-    return 1;
-}
-
-static int ossltest_aes128_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type,
-    int arg, void *ptr)
-{
-    EVP_AES_HMAC_SHA1 *key = data(ctx);
-
-    switch (type) {
-    case EVP_CTRL_AEAD_SET_MAC_KEY:
-        return 1;
-
-    case EVP_CTRL_AEAD_TLS1_AAD: {
-        unsigned char *p = ptr;
-        unsigned int len;
-
-        if (arg != EVP_AEAD_TLS1_AAD_LEN)
-            return -1;
-
-        len = p[arg - 2] << 8 | p[arg - 1];
-        key->tls_ver = p[arg - 4] << 8 | p[arg - 3];
-
-        if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
-            key->payload_length = len;
-            if (key->tls_ver >= TLS1_1_VERSION) {
-                if (len < AES_BLOCK_SIZE)
-                    return 0;
-                len -= AES_BLOCK_SIZE;
-                p[arg - 2] = len >> 8;
-                p[arg - 1] = len;
-            }
-
-            return (int)(((len + SHA_DIGEST_LENGTH + AES_BLOCK_SIZE) & -AES_BLOCK_SIZE)
-                - len);
-        } else {
-            key->payload_length = arg;
-
-            return SHA_DIGEST_LENGTH;
-        }
-    }
-    default:
-        return -1;
-    }
-}
-
-static int ossltest_rand_bytes(unsigned char *buf, int num)
-{
-    unsigned char val = 1;
-
-    while (--num >= 0)
-        *buf++ = val++;
-    return 1;
-}
-
-static int ossltest_rand_status(void)
-{
-    return 1;
-}
-
-static const RAND_METHOD *ossltest_rand_method(void)
-{
-
-    static RAND_METHOD osslt_rand_meth = {
-        NULL,
-        ossltest_rand_bytes,
-        NULL,
-        NULL,
-        ossltest_rand_bytes,
-        ossltest_rand_status
-    };
-
-    return &osslt_rand_meth;
-}
diff --git a/deps/openssl/openssl/engines/e_ossltest.ec b/deps/openssl/openssl/engines/e_ossltest.ec
deleted file mode 100644
index a4a55ecb3f6..00000000000
--- a/deps/openssl/openssl/engines/e_ossltest.ec
+++ /dev/null
@@ -1,3 +0,0 @@
-# The INPUT HEADER is scanned for declarations
-# LIBNAME       INPUT HEADER                    ERROR-TABLE FILE
-L OSSLTEST      e_ossltest_err.h                e_ossltest_err.c
diff --git a/deps/openssl/openssl/engines/e_ossltest.txt b/deps/openssl/openssl/engines/e_ossltest.txt
deleted file mode 100644
index 645917fe3bb..00000000000
--- a/deps/openssl/openssl/engines/e_ossltest.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
-#
-# Licensed under the Apache License 2.0 (the "License").  You may not use
-# this file except in compliance with the License.  You can obtain a copy
-# in the file LICENSE in the source distribution or at
-# https://www.openssl.org/source/license.html
-
-#Reason codes
-OSSLTEST_R_INIT_FAILED:100:init failed
diff --git a/deps/openssl/openssl/engines/e_ossltest_err.c b/deps/openssl/openssl/engines/e_ossltest_err.c
deleted file mode 100644
index d43b715dd5c..00000000000
--- a/deps/openssl/openssl/engines/e_ossltest_err.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include "e_ossltest_err.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static ERR_STRING_DATA OSSLTEST_str_reasons[] = {
-    { ERR_PACK(0, 0, OSSLTEST_R_INIT_FAILED), "init failed" },
-    { 0, NULL }
-};
-
-#endif
-
-static int lib_code = 0;
-static int error_loaded = 0;
-
-static int ERR_load_OSSLTEST_strings(void)
-{
-    if (lib_code == 0)
-        lib_code = ERR_get_next_error_library();
-
-    if (!error_loaded) {
-#ifndef OPENSSL_NO_ERR
-        ERR_load_strings(lib_code, OSSLTEST_str_reasons);
-#endif
-        error_loaded = 1;
-    }
-    return 1;
-}
-
-static void ERR_unload_OSSLTEST_strings(void)
-{
-    if (error_loaded) {
-#ifndef OPENSSL_NO_ERR
-        ERR_unload_strings(lib_code, OSSLTEST_str_reasons);
-#endif
-        error_loaded = 0;
-    }
-}
-
-static void ERR_OSSLTEST_error(int function, int reason, const char *file, int line)
-{
-    if (lib_code == 0)
-        lib_code = ERR_get_next_error_library();
-    ERR_raise(lib_code, reason);
-    ERR_set_debug(file, line, NULL);
-}
diff --git a/deps/openssl/openssl/engines/e_ossltest_err.h b/deps/openssl/openssl/engines/e_ossltest_err.h
deleted file mode 100644
index 75dbeeeee7b..00000000000
--- a/deps/openssl/openssl/engines/e_ossltest_err.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_E_OSSLTEST_ERR_H
-#define OSSL_E_OSSLTEST_ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#define OSSLTESTerr(f, r) ERR_OSSLTEST_error(0, (r), OPENSSL_FILE, OPENSSL_LINE)
-
-/*
- * OSSLTEST reason codes.
- */
-#define OSSLTEST_R_INIT_FAILED 100
-
-#endif
diff --git a/deps/openssl/openssl/engines/e_padlock.c b/deps/openssl/openssl/engines/e_padlock.c
deleted file mode 100644
index 8eba5ecf086..00000000000
--- a/deps/openssl/openssl/engines/e_padlock.c
+++ /dev/null
@@ -1,760 +0,0 @@
-/*
- * Copyright 2004-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * This file uses the low level AES and engine functions (which are deprecated
- * for non-internal use) in order to implement the padlock engine AES ciphers.
- */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
-#include <stdio.h>
-#include <string.h>
-
-#include <openssl/opensslconf.h>
-#include <openssl/crypto.h>
-#include <openssl/engine.h>
-#include <openssl/evp.h>
-#include <openssl/aes.h>
-#include <openssl/rand.h>
-#include <openssl/err.h>
-#include <openssl/modes.h>
-
-#ifndef OPENSSL_NO_PADLOCKENG
-
-/*
- * VIA PadLock AES is available *ONLY* on some x86 CPUs. Not only that it
- * doesn't exist elsewhere, but it even can't be compiled on other platforms!
- */
-
-#undef COMPILE_PADLOCKENG
-#if defined(PADLOCK_ASM)
-#define COMPILE_PADLOCKENG
-#ifdef OPENSSL_NO_DYNAMIC_ENGINE
-static ENGINE *ENGINE_padlock(void);
-#endif
-#endif
-
-#ifdef OPENSSL_NO_DYNAMIC_ENGINE
-void engine_load_padlock_int(void);
-void engine_load_padlock_int(void)
-{
-/* On non-x86 CPUs it just returns. */
-#ifdef COMPILE_PADLOCKENG
-    ENGINE *toadd = ENGINE_padlock();
-    if (!toadd)
-        return;
-    ERR_set_mark();
-    ENGINE_add(toadd);
-    /*
-     * If the "add" worked, it gets a structural reference. So either way, we
-     * release our just-created reference.
-     */
-    ENGINE_free(toadd);
-    /*
-     * If the "add" didn't work, it was probably a conflict because it was
-     * already added (eg. someone calling ENGINE_load_blah then calling
-     * ENGINE_load_builtin_engines() perhaps).
-     */
-    ERR_pop_to_mark();
-#endif
-}
-
-#endif
-
-#ifdef COMPILE_PADLOCKENG
-
-/* Function for ENGINE detection and control */
-static int padlock_available(void);
-static int padlock_init(ENGINE *e);
-
-/* RNG Stuff */
-static RAND_METHOD padlock_rand;
-
-/* Cipher Stuff */
-static int padlock_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
-    const int **nids, int nid);
-
-/* Engine names */
-static const char *padlock_id = "padlock";
-static char padlock_name[100];
-
-/* Available features */
-static int padlock_use_ace = 0; /* Advanced Cryptography Engine */
-static int padlock_use_rng = 0; /* Random Number Generator */
-
-/* ===== Engine "management" functions ===== */
-
-/* Prepare the ENGINE structure for registration */
-static int padlock_bind_helper(ENGINE *e)
-{
-    /* Check available features */
-    padlock_available();
-
-    /*
-     * RNG is currently disabled for reasons discussed in commentary just
-     * before padlock_rand_bytes function.
-     */
-    padlock_use_rng = 0;
-
-    /* Generate a nice engine name with available features */
-    BIO_snprintf(padlock_name, sizeof(padlock_name),
-        "VIA PadLock (%s, %s)",
-        padlock_use_rng ? "RNG" : "no-RNG",
-        padlock_use_ace ? "ACE" : "no-ACE");
-
-    /* Register everything or return with an error */
-    if (!ENGINE_set_id(e, padlock_id) || !ENGINE_set_name(e, padlock_name) || !ENGINE_set_init_function(e, padlock_init) || (padlock_use_ace && !ENGINE_set_ciphers(e, padlock_ciphers)) || (padlock_use_rng && !ENGINE_set_RAND(e, &padlock_rand))) {
-        return 0;
-    }
-
-    /* Everything looks good */
-    return 1;
-}
-
-#ifdef OPENSSL_NO_DYNAMIC_ENGINE
-/* Constructor */
-static ENGINE *ENGINE_padlock(void)
-{
-    ENGINE *eng = ENGINE_new();
-
-    if (eng == NULL) {
-        return NULL;
-    }
-
-    if (!padlock_bind_helper(eng)) {
-        ENGINE_free(eng);
-        return NULL;
-    }
-
-    return eng;
-}
-#endif
-
-/* Check availability of the engine */
-static int padlock_init(ENGINE *e)
-{
-    return (padlock_use_rng || padlock_use_ace);
-}
-
-#ifndef AES_ASM
-static int padlock_aes_set_encrypt_key(const unsigned char *userKey,
-    const int bits,
-    AES_KEY *key);
-static int padlock_aes_set_decrypt_key(const unsigned char *userKey,
-    const int bits,
-    AES_KEY *key);
-#define AES_ASM
-#define AES_set_encrypt_key padlock_aes_set_encrypt_key
-#define AES_set_decrypt_key padlock_aes_set_decrypt_key
-/* clang-format off */
-#   include "../crypto/aes/aes_core.c"
-/* clang-format on */
-#endif
-
-/*
- * This stuff is needed if this ENGINE is being compiled into a
- * self-contained shared-library.
- */
-#ifndef OPENSSL_NO_DYNAMIC_ENGINE
-static int padlock_bind_fn(ENGINE *e, const char *id)
-{
-    if (id && (strcmp(id, padlock_id) != 0)) {
-        return 0;
-    }
-
-    if (!padlock_bind_helper(e)) {
-        return 0;
-    }
-
-    return 1;
-}
-
-IMPLEMENT_DYNAMIC_CHECK_FN()
-IMPLEMENT_DYNAMIC_BIND_FN(padlock_bind_fn)
-#endif /* !OPENSSL_NO_DYNAMIC_ENGINE */
-/* ===== Here comes the "real" engine ===== */
-
-/* Some AES-related constants */
-#define AES_BLOCK_SIZE 16
-#define AES_KEY_SIZE_128 16
-#define AES_KEY_SIZE_192 24
-#define AES_KEY_SIZE_256 32
-/*
- * Here we store the status information relevant to the current context.
- */
-/*
- * BIG FAT WARNING: Inline assembler in PADLOCK_XCRYPT_ASM() depends on
- * the order of items in this structure.  Don't blindly modify, reorder,
- * etc!
- */
-struct padlock_cipher_data {
-    unsigned char iv[AES_BLOCK_SIZE]; /* Initialization vector */
-    union {
-        unsigned int pad[4];
-        struct {
-            int rounds : 4;
-            int dgst : 1; /* n/a in C3 */
-            int align : 1; /* n/a in C3 */
-            int ciphr : 1; /* n/a in C3 */ /* codespell:ignore */
-            unsigned int keygen : 1;
-            int interm : 1; /* codespell:ignore */
-            unsigned int encdec : 1;
-            int ksize : 2;
-        } b;
-    } cword; /* Control word */
-    AES_KEY ks; /* Encryption key */
-};
-
-/* Interface to assembler module */
-unsigned int padlock_capability(void);
-void padlock_key_bswap(AES_KEY *key);
-void padlock_verify_context(struct padlock_cipher_data *ctx);
-void padlock_reload_key(void);
-void padlock_aes_block(void *out, const void *inp,
-    struct padlock_cipher_data *ctx);
-int padlock_ecb_encrypt(void *out, const void *inp,
-    struct padlock_cipher_data *ctx, size_t len);
-int padlock_cbc_encrypt(void *out, const void *inp,
-    struct padlock_cipher_data *ctx, size_t len);
-int padlock_cfb_encrypt(void *out, const void *inp,
-    struct padlock_cipher_data *ctx, size_t len);
-int padlock_ofb_encrypt(void *out, const void *inp,
-    struct padlock_cipher_data *ctx, size_t len);
-int padlock_ctr32_encrypt(void *out, const void *inp,
-    struct padlock_cipher_data *ctx, size_t len);
-int padlock_xstore(void *out, int edx);
-void padlock_sha1_oneshot(void *ctx, const void *inp, size_t len);
-void padlock_sha1(void *ctx, const void *inp, size_t len);
-void padlock_sha256_oneshot(void *ctx, const void *inp, size_t len);
-void padlock_sha256(void *ctx, const void *inp, size_t len);
-
-/*
- * Load supported features of the CPU to see if the PadLock is available.
- */
-static int padlock_available(void)
-{
-    unsigned int edx = padlock_capability();
-
-    /* Fill up some flags */
-    padlock_use_ace = ((edx & (0x3 << 6)) == (0x3 << 6));
-    padlock_use_rng = ((edx & (0x3 << 2)) == (0x3 << 2));
-
-    return padlock_use_ace + padlock_use_rng;
-}
-
-/* ===== AES encryption/decryption ===== */
-
-#if defined(NID_aes_128_cfb128) && !defined(NID_aes_128_cfb)
-#define NID_aes_128_cfb NID_aes_128_cfb128
-#endif
-
-#if defined(NID_aes_128_ofb128) && !defined(NID_aes_128_ofb)
-#define NID_aes_128_ofb NID_aes_128_ofb128
-#endif
-
-#if defined(NID_aes_192_cfb128) && !defined(NID_aes_192_cfb)
-#define NID_aes_192_cfb NID_aes_192_cfb128
-#endif
-
-#if defined(NID_aes_192_ofb128) && !defined(NID_aes_192_ofb)
-#define NID_aes_192_ofb NID_aes_192_ofb128
-#endif
-
-#if defined(NID_aes_256_cfb128) && !defined(NID_aes_256_cfb)
-#define NID_aes_256_cfb NID_aes_256_cfb128
-#endif
-
-#if defined(NID_aes_256_ofb128) && !defined(NID_aes_256_ofb)
-#define NID_aes_256_ofb NID_aes_256_ofb128
-#endif
-
-/* List of supported ciphers. */
-static const int padlock_cipher_nids[] = {
-    NID_aes_128_ecb,
-    NID_aes_128_cbc,
-    NID_aes_128_cfb,
-    NID_aes_128_ofb,
-    NID_aes_128_ctr,
-
-    NID_aes_192_ecb,
-    NID_aes_192_cbc,
-    NID_aes_192_cfb,
-    NID_aes_192_ofb,
-    NID_aes_192_ctr,
-
-    NID_aes_256_ecb,
-    NID_aes_256_cbc,
-    NID_aes_256_cfb,
-    NID_aes_256_ofb,
-    NID_aes_256_ctr
-};
-
-static int padlock_cipher_nids_num = (sizeof(padlock_cipher_nids) / sizeof(padlock_cipher_nids[0]));
-
-/* Function prototypes ... */
-static int padlock_aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc);
-
-#define NEAREST_ALIGNED(ptr) ((unsigned char *)(ptr) + ((0x10 - ((size_t)(ptr) & 0x0F)) & 0x0F))
-#define ALIGNED_CIPHER_DATA(ctx) ((struct padlock_cipher_data *) \
-        NEAREST_ALIGNED(EVP_CIPHER_CTX_get_cipher_data(ctx)))
-
-static int
-padlock_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out_arg,
-    const unsigned char *in_arg, size_t nbytes)
-{
-    return padlock_ecb_encrypt(out_arg, in_arg,
-        ALIGNED_CIPHER_DATA(ctx), nbytes);
-}
-
-static int
-padlock_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out_arg,
-    const unsigned char *in_arg, size_t nbytes)
-{
-    struct padlock_cipher_data *cdata = ALIGNED_CIPHER_DATA(ctx);
-    int ret;
-
-    memcpy(cdata->iv, EVP_CIPHER_CTX_iv(ctx), AES_BLOCK_SIZE);
-    if ((ret = padlock_cbc_encrypt(out_arg, in_arg, cdata, nbytes)))
-        memcpy(EVP_CIPHER_CTX_iv_noconst(ctx), cdata->iv, AES_BLOCK_SIZE);
-    return ret;
-}
-
-static int
-padlock_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out_arg,
-    const unsigned char *in_arg, size_t nbytes)
-{
-    struct padlock_cipher_data *cdata = ALIGNED_CIPHER_DATA(ctx);
-    size_t chunk;
-
-    if ((chunk = EVP_CIPHER_CTX_get_num(ctx))) { /* borrow chunk variable */
-        unsigned char *ivp = EVP_CIPHER_CTX_iv_noconst(ctx);
-
-        if (chunk >= AES_BLOCK_SIZE)
-            return 0; /* bogus value */
-
-        if (EVP_CIPHER_CTX_is_encrypting(ctx))
-            while (chunk < AES_BLOCK_SIZE && nbytes != 0) {
-                ivp[chunk] = *(out_arg++) = *(in_arg++) ^ ivp[chunk];
-                chunk++, nbytes--;
-            }
-        else
-            while (chunk < AES_BLOCK_SIZE && nbytes != 0) {
-                unsigned char c = *(in_arg++);
-                *(out_arg++) = c ^ ivp[chunk];
-                ivp[chunk++] = c, nbytes--;
-            }
-
-        EVP_CIPHER_CTX_set_num(ctx, chunk % AES_BLOCK_SIZE);
-    }
-
-    if (nbytes == 0)
-        return 1;
-
-    memcpy(cdata->iv, EVP_CIPHER_CTX_iv(ctx), AES_BLOCK_SIZE);
-
-    if ((chunk = nbytes & ~(AES_BLOCK_SIZE - 1))) {
-        if (!padlock_cfb_encrypt(out_arg, in_arg, cdata, chunk))
-            return 0;
-        nbytes -= chunk;
-    }
-
-    if (nbytes) {
-        unsigned char *ivp = cdata->iv;
-
-        out_arg += chunk;
-        in_arg += chunk;
-        EVP_CIPHER_CTX_set_num(ctx, nbytes);
-        if (cdata->cword.b.encdec) {
-            cdata->cword.b.encdec = 0;
-            padlock_reload_key();
-            padlock_aes_block(ivp, ivp, cdata);
-            cdata->cword.b.encdec = 1;
-            padlock_reload_key();
-            while (nbytes) {
-                unsigned char c = *(in_arg++);
-                *(out_arg++) = c ^ *ivp;
-                *(ivp++) = c, nbytes--;
-            }
-        } else {
-            padlock_reload_key();
-            padlock_aes_block(ivp, ivp, cdata);
-            padlock_reload_key();
-            while (nbytes) {
-                *ivp = *(out_arg++) = *(in_arg++) ^ *ivp;
-                ivp++, nbytes--;
-            }
-        }
-    }
-
-    memcpy(EVP_CIPHER_CTX_iv_noconst(ctx), cdata->iv, AES_BLOCK_SIZE);
-
-    return 1;
-}
-
-static int
-padlock_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out_arg,
-    const unsigned char *in_arg, size_t nbytes)
-{
-    struct padlock_cipher_data *cdata = ALIGNED_CIPHER_DATA(ctx);
-    size_t chunk;
-
-    /*
-     * ctx->num is maintained in byte-oriented modes, such as CFB and OFB...
-     */
-    if ((chunk = EVP_CIPHER_CTX_get_num(ctx))) { /* borrow chunk variable */
-        unsigned char *ivp = EVP_CIPHER_CTX_iv_noconst(ctx);
-
-        if (chunk >= AES_BLOCK_SIZE)
-            return 0; /* bogus value */
-
-        while (chunk < AES_BLOCK_SIZE && nbytes != 0) {
-            *(out_arg++) = *(in_arg++) ^ ivp[chunk];
-            chunk++, nbytes--;
-        }
-
-        EVP_CIPHER_CTX_set_num(ctx, chunk % AES_BLOCK_SIZE);
-    }
-
-    if (nbytes == 0)
-        return 1;
-
-    memcpy(cdata->iv, EVP_CIPHER_CTX_iv(ctx), AES_BLOCK_SIZE);
-
-    if ((chunk = nbytes & ~(AES_BLOCK_SIZE - 1))) {
-        if (!padlock_ofb_encrypt(out_arg, in_arg, cdata, chunk))
-            return 0;
-        nbytes -= chunk;
-    }
-
-    if (nbytes) {
-        unsigned char *ivp = cdata->iv;
-
-        out_arg += chunk;
-        in_arg += chunk;
-        EVP_CIPHER_CTX_set_num(ctx, nbytes);
-        padlock_reload_key(); /* empirically found */
-        padlock_aes_block(ivp, ivp, cdata);
-        padlock_reload_key(); /* empirically found */
-        while (nbytes) {
-            *(out_arg++) = *(in_arg++) ^ *ivp;
-            ivp++, nbytes--;
-        }
-    }
-
-    memcpy(EVP_CIPHER_CTX_iv_noconst(ctx), cdata->iv, AES_BLOCK_SIZE);
-
-    return 1;
-}
-
-static void padlock_ctr32_encrypt_glue(const unsigned char *in,
-    unsigned char *out, size_t blocks,
-    struct padlock_cipher_data *ctx,
-    const unsigned char *ivec)
-{
-    memcpy(ctx->iv, ivec, AES_BLOCK_SIZE);
-    padlock_ctr32_encrypt(out, in, ctx, AES_BLOCK_SIZE * blocks);
-}
-
-static int
-padlock_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out_arg,
-    const unsigned char *in_arg, size_t nbytes)
-{
-    struct padlock_cipher_data *cdata = ALIGNED_CIPHER_DATA(ctx);
-    int n = EVP_CIPHER_CTX_get_num(ctx);
-    unsigned int num;
-
-    if (n < 0)
-        return 0;
-    num = (unsigned int)n;
-
-    CRYPTO_ctr128_encrypt_ctr32(in_arg, out_arg, nbytes,
-        cdata, EVP_CIPHER_CTX_iv_noconst(ctx),
-        EVP_CIPHER_CTX_buf_noconst(ctx), &num,
-        (ctr128_f)padlock_ctr32_encrypt_glue);
-
-    EVP_CIPHER_CTX_set_num(ctx, (size_t)num);
-    return 1;
-}
-
-#define EVP_CIPHER_block_size_ECB AES_BLOCK_SIZE
-#define EVP_CIPHER_block_size_CBC AES_BLOCK_SIZE
-#define EVP_CIPHER_block_size_OFB 1
-#define EVP_CIPHER_block_size_CFB 1
-#define EVP_CIPHER_block_size_CTR 1
-
-/*
- * Declaring so many ciphers by hand would be a pain. Instead introduce a bit
- * of preprocessor magic :-)
- */
-#define DECLARE_AES_EVP(ksize, lmode, umode)                                                    \
-    static EVP_CIPHER *_hidden_aes_##ksize##_##lmode = NULL;                                    \
-    static const EVP_CIPHER *padlock_aes_##ksize##_##lmode(void)                                \
-    {                                                                                           \
-        if (_hidden_aes_##ksize##_##lmode == NULL                                               \
-            && ((_hidden_aes_##ksize##_##lmode = EVP_CIPHER_meth_new(NID_aes_##ksize##_##lmode, \
-                     EVP_CIPHER_block_size_##umode,                                             \
-                     AES_KEY_SIZE_##ksize))                                                     \
-                    == NULL                                                                     \
-                || !EVP_CIPHER_meth_set_iv_length(_hidden_aes_##ksize##_##lmode,                \
-                    AES_BLOCK_SIZE)                                                             \
-                || !EVP_CIPHER_meth_set_flags(_hidden_aes_##ksize##_##lmode,                    \
-                    0 | EVP_CIPH_##umode##_MODE)                                                \
-                || !EVP_CIPHER_meth_set_init(_hidden_aes_##ksize##_##lmode,                     \
-                    padlock_aes_init_key)                                                       \
-                || !EVP_CIPHER_meth_set_do_cipher(_hidden_aes_##ksize##_##lmode,                \
-                    padlock_##lmode##_cipher)                                                   \
-                || !EVP_CIPHER_meth_set_impl_ctx_size(_hidden_aes_##ksize##_##lmode,            \
-                    sizeof(struct padlock_cipher_data) + 16)                                    \
-                || !EVP_CIPHER_meth_set_set_asn1_params(_hidden_aes_##ksize##_##lmode,          \
-                    EVP_CIPHER_set_asn1_iv)                                                     \
-                || !EVP_CIPHER_meth_set_get_asn1_params(_hidden_aes_##ksize##_##lmode,          \
-                    EVP_CIPHER_get_asn1_iv))) {                                                 \
-            EVP_CIPHER_meth_free(_hidden_aes_##ksize##_##lmode);                                \
-            _hidden_aes_##ksize##_##lmode = NULL;                                               \
-        }                                                                                       \
-        return _hidden_aes_##ksize##_##lmode;                                                   \
-    }
-
-DECLARE_AES_EVP(128, ecb, ECB)
-DECLARE_AES_EVP(128, cbc, CBC)
-DECLARE_AES_EVP(128, cfb, CFB)
-DECLARE_AES_EVP(128, ofb, OFB)
-DECLARE_AES_EVP(128, ctr, CTR)
-
-DECLARE_AES_EVP(192, ecb, ECB)
-DECLARE_AES_EVP(192, cbc, CBC)
-DECLARE_AES_EVP(192, cfb, CFB)
-DECLARE_AES_EVP(192, ofb, OFB)
-DECLARE_AES_EVP(192, ctr, CTR)
-
-DECLARE_AES_EVP(256, ecb, ECB)
-DECLARE_AES_EVP(256, cbc, CBC)
-DECLARE_AES_EVP(256, cfb, CFB)
-DECLARE_AES_EVP(256, ofb, OFB)
-DECLARE_AES_EVP(256, ctr, CTR)
-
-static int
-padlock_ciphers(ENGINE *e, const EVP_CIPHER **cipher, const int **nids,
-    int nid)
-{
-    /* No specific cipher => return a list of supported nids ... */
-    if (!cipher) {
-        *nids = padlock_cipher_nids;
-        return padlock_cipher_nids_num;
-    }
-
-    /* ... or the requested "cipher" otherwise */
-    switch (nid) {
-    case NID_aes_128_ecb:
-        *cipher = padlock_aes_128_ecb();
-        break;
-    case NID_aes_128_cbc:
-        *cipher = padlock_aes_128_cbc();
-        break;
-    case NID_aes_128_cfb:
-        *cipher = padlock_aes_128_cfb();
-        break;
-    case NID_aes_128_ofb:
-        *cipher = padlock_aes_128_ofb();
-        break;
-    case NID_aes_128_ctr:
-        *cipher = padlock_aes_128_ctr();
-        break;
-
-    case NID_aes_192_ecb:
-        *cipher = padlock_aes_192_ecb();
-        break;
-    case NID_aes_192_cbc:
-        *cipher = padlock_aes_192_cbc();
-        break;
-    case NID_aes_192_cfb:
-        *cipher = padlock_aes_192_cfb();
-        break;
-    case NID_aes_192_ofb:
-        *cipher = padlock_aes_192_ofb();
-        break;
-    case NID_aes_192_ctr:
-        *cipher = padlock_aes_192_ctr();
-        break;
-
-    case NID_aes_256_ecb:
-        *cipher = padlock_aes_256_ecb();
-        break;
-    case NID_aes_256_cbc:
-        *cipher = padlock_aes_256_cbc();
-        break;
-    case NID_aes_256_cfb:
-        *cipher = padlock_aes_256_cfb();
-        break;
-    case NID_aes_256_ofb:
-        *cipher = padlock_aes_256_ofb();
-        break;
-    case NID_aes_256_ctr:
-        *cipher = padlock_aes_256_ctr();
-        break;
-
-    default:
-        /* Sorry, we don't support this NID */
-        *cipher = NULL;
-        return 0;
-    }
-
-    return 1;
-}
-
-/* Prepare the encryption key for PadLock usage */
-static int
-padlock_aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-    const unsigned char *iv, int enc)
-{
-    struct padlock_cipher_data *cdata;
-    int key_len = EVP_CIPHER_CTX_get_key_length(ctx) * 8;
-    unsigned long mode = EVP_CIPHER_CTX_get_mode(ctx);
-
-    if (key == NULL)
-        return 0; /* ERROR */
-
-    cdata = ALIGNED_CIPHER_DATA(ctx);
-    memset(cdata, 0, sizeof(*cdata));
-
-    /* Prepare Control word. */
-    if (mode == EVP_CIPH_OFB_MODE || mode == EVP_CIPH_CTR_MODE)
-        cdata->cword.b.encdec = 0;
-    else
-        cdata->cword.b.encdec = (EVP_CIPHER_CTX_is_encrypting(ctx) == 0);
-    cdata->cword.b.rounds = 10 + (key_len - 128) / 32;
-    cdata->cword.b.ksize = (key_len - 128) / 64;
-
-    switch (key_len) {
-    case 128:
-        /*
-         * PadLock can generate an extended key for AES128 in hardware
-         */
-        memcpy(cdata->ks.rd_key, key, AES_KEY_SIZE_128);
-        cdata->cword.b.keygen = 0;
-        break;
-
-    case 192:
-    case 256:
-        /*
-         * Generate an extended AES key in software. Needed for AES192/AES256
-         */
-        /*
-         * Well, the above applies to Stepping 8 CPUs and is listed as
-         * hardware errata. They most likely will fix it at some point and
-         * then a check for stepping would be due here.
-         */
-        if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE)
-            && !enc)
-            AES_set_decrypt_key(key, key_len, &cdata->ks);
-        else
-            AES_set_encrypt_key(key, key_len, &cdata->ks);
-        /*
-         * OpenSSL C functions use byte-swapped extended key.
-         */
-        padlock_key_bswap(&cdata->ks);
-        cdata->cword.b.keygen = 1;
-        break;
-
-    default:
-        /* ERROR */
-        return 0;
-    }
-
-    /*
-     * This is done to cover for cases when user reuses the
-     * context for new key. The catch is that if we don't do
-     * this, padlock_eas_cipher might proceed with old key...
-     */
-    padlock_reload_key();
-
-    return 1;
-}
-
-/* ===== Random Number Generator ===== */
-/*
- * This code is not engaged. The reason is that it does not comply
- * with recommendations for VIA RNG usage for secure applications
- * (posted at http://www.via.com.tw/en/viac3/c3.jsp) nor does it
- * provide meaningful error control...
- */
-/*
- * Wrapper that provides an interface between the API and the raw PadLock
- * RNG
- */
-static int padlock_rand_bytes(unsigned char *output, int count)
-{
-    unsigned int eax, buf;
-
-    while (count >= 8) {
-        eax = padlock_xstore(output, 0);
-        if (!(eax & (1 << 6)))
-            return 0; /* RNG disabled */
-        /* this ---vv--- covers DC bias, Raw Bits and String Filter */
-        if (eax & (0x1F << 10))
-            return 0;
-        if ((eax & 0x1F) == 0)
-            continue; /* no data, retry... */
-        if ((eax & 0x1F) != 8)
-            return 0; /* fatal failure...  */
-        output += 8;
-        count -= 8;
-    }
-    while (count > 0) {
-        eax = padlock_xstore(&buf, 3);
-        if (!(eax & (1 << 6)))
-            return 0; /* RNG disabled */
-        /* this ---vv--- covers DC bias, Raw Bits and String Filter */
-        if (eax & (0x1F << 10))
-            return 0;
-        if ((eax & 0x1F) == 0)
-            continue; /* no data, retry... */
-        if ((eax & 0x1F) != 1)
-            return 0; /* fatal failure...  */
-        *output++ = (unsigned char)buf;
-        count--;
-    }
-    OPENSSL_cleanse(&buf, sizeof(buf));
-
-    return 1;
-}
-
-/* Dummy but necessary function */
-static int padlock_rand_status(void)
-{
-    return 1;
-}
-
-/* Prepare structure for registration */
-static RAND_METHOD padlock_rand = {
-    NULL, /* seed */
-    padlock_rand_bytes, /* bytes */
-    NULL, /* cleanup */
-    NULL, /* add */
-    padlock_rand_bytes, /* pseudorand */
-    padlock_rand_status, /* rand status */
-};
-
-#endif /* COMPILE_PADLOCKENG */
-#endif /* !OPENSSL_NO_PADLOCKENG */
-
-#if defined(OPENSSL_NO_PADLOCKENG) || !defined(COMPILE_PADLOCKENG)
-#ifndef OPENSSL_NO_DYNAMIC_ENGINE
-OPENSSL_EXPORT
-int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns);
-OPENSSL_EXPORT
-int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns)
-{
-    return 0;
-}
-
-IMPLEMENT_DYNAMIC_CHECK_FN()
-#endif
-#endif
diff --git a/deps/openssl/openssl/exporters/build.info b/deps/openssl/openssl/exporters/build.info
index 9241dc9b0a6..54d5684da2e 100644
--- a/deps/openssl/openssl/exporters/build.info
+++ b/deps/openssl/openssl/exporters/build.info
@@ -19,8 +19,9 @@ DEPEND[openssl.pc]=libcrypto.pc libssl.pc
 DEPEND[""]=openssl.pc

 GENERATE[../installdata.pm]=../util/mkinstallvars.pl \
+    COMMENT="This file provides configuration information for OpenSSL" \
     "PREFIX=$(INSTALLTOP)" BINDIR=bin "LIBDIR=$(LIBDIR)" "libdir=$(libdir)" \
     INCLUDEDIR=include APPLINKDIR=include/openssl \
-    "ENGINESDIR=$(ENGINESDIR)" "MODULESDIR=$(MODULESDIR)" \
+    "MODULESDIR=$(MODULESDIR)" \
     "PKGCONFIGDIR=$(PKGCONFIGDIR)" "CMAKECONFIGDIR=$(CMAKECONFIGDIR)" \
     "LDLIBS=$(LIB_EX_LIBS)" "VERSION=$(VERSION)"
diff --git a/deps/openssl/openssl/exporters/cmake/OpenSSLConfig.cmake.in b/deps/openssl/openssl/exporters/cmake/OpenSSLConfig.cmake.in
index d8d82fec958..e4356053211 100644
--- a/deps/openssl/openssl/exporters/cmake/OpenSSLConfig.cmake.in
+++ b/deps/openssl/openssl/exporters/cmake/OpenSSLConfig.cmake.in
@@ -133,7 +133,6 @@ set(OPENSSL_LIBRARY_DIR "${_ossl_prefix}/{- unixify($OpenSSL::safe::installdata:
 set(OPENSSL_INCLUDE_DIR{- $OUT = '';
                           $OUT .= ' "${_ossl_prefix}/' . $_ . '"'
                               foreach (@OpenSSL::safe::installdata::INCLUDEDIR_REL_PREFIX); -})
-set(OPENSSL_ENGINES_DIR "${_ossl_prefix}/{- unixify($OpenSSL::safe::installdata::LIBDIR_REL_PREFIX[0], 1); -}/{- unixify($OpenSSL::safe::installdata::ENGINESDIR_REL_LIBDIR[0], 1); -}")
 set(OPENSSL_MODULES_DIR "${_ossl_prefix}/{- unixify($OpenSSL::safe::installdata::LIBDIR_REL_PREFIX[0], 1); -}/{- unixify($OpenSSL::safe::installdata::MODULESDIR_REL_LIBDIR[0], 1); -}")
 set(OPENSSL_RUNTIME_DIR "${_ossl_prefix}/{- unixify($OpenSSL::safe::installdata::BINDIR_REL_PREFIX[0], 1); -}")
 {- output_off() if $disabled{uplink}; "" -}
diff --git a/deps/openssl/openssl/exporters/pkg-config/libcrypto.pc.in b/deps/openssl/openssl/exporters/pkg-config/libcrypto.pc.in
index eb6adffa911..b0481093a1e 100644
--- a/deps/openssl/openssl/exporters/pkg-config/libcrypto.pc.in
+++ b/deps/openssl/openssl/exporters/pkg-config/libcrypto.pc.in
@@ -11,8 +11,8 @@ libdir={- if (defined $OpenSSL::safe::installdata::LIBDIR_REL_PREFIX[0]) {
           } -}
 includedir={- $OUT = '';
               $OUT .= '${prefix}/' . $_ . ' '
-                  foreach (@OpenSSL::safe::installdata::INCLUDEDIR_REL_PREFIX); -}
-enginesdir=${libdir}/{- $OpenSSL::safe::installdata::ENGINESDIR_REL_LIBDIR[0] -}
+                  foreach (@OpenSSL::safe::installdata::INCLUDEDIR_REL_PREFIX);
+              $OUT =~ s/\s+\z//; -}
 modulesdir=${libdir}/{- $OpenSSL::safe::installdata::MODULESDIR_REL_LIBDIR[0] -}

 Name: OpenSSL-libcrypto
@@ -25,4 +25,5 @@ Cflags:{- $OUT = ' -I${includedir}';
               $OUT = '';
               $OUT .= ' -I${prefix}/' . $_ . ' '
                   foreach (@OpenSSL::safe::installdata::INCLUDEDIR_REL_PREFIX);
+              $OUT =~ s/\s+\z//;
           } -}
diff --git a/deps/openssl/openssl/exporters/pkg-config/libssl.pc.in b/deps/openssl/openssl/exporters/pkg-config/libssl.pc.in
index 53228dde4a0..50132b75025 100644
--- a/deps/openssl/openssl/exporters/pkg-config/libssl.pc.in
+++ b/deps/openssl/openssl/exporters/pkg-config/libssl.pc.in
@@ -11,7 +11,8 @@ libdir={- if (defined $OpenSSL::safe::installdata::LIBDIR_REL_PREFIX[0]) {
           } -}
 includedir={- $OUT = '';
               $OUT .= '${prefix}/' . $_ . ' '
-                  foreach (@OpenSSL::safe::installdata::INCLUDEDIR_REL_PREFIX); -}
+                  foreach (@OpenSSL::safe::installdata::INCLUDEDIR_REL_PREFIX);
+              $OUT =~ s/\s+\z//; -}

 Name: OpenSSL-libssl
 Description: Secure Sockets Layer and cryptography libraries
@@ -23,4 +24,5 @@ Cflags:{- $OUT = ' -I${includedir}';
               $OUT = '';
               $OUT .= ' -I${prefix}/' . $_ . ' '
                   foreach (@OpenSSL::safe::installdata::INCLUDEDIR_REL_PREFIX);
+              $OUT =~ s/\s+\z//;
           } -}
diff --git a/deps/openssl/openssl/exporters/pkg-config/openssl.pc.in b/deps/openssl/openssl/exporters/pkg-config/openssl.pc.in
index fd3bc9ac86c..3573ed98727 100644
--- a/deps/openssl/openssl/exporters/pkg-config/openssl.pc.in
+++ b/deps/openssl/openssl/exporters/pkg-config/openssl.pc.in
@@ -11,7 +11,8 @@ libdir={- if (defined $OpenSSL::safe::installdata::LIBDIR_REL_PREFIX[0]) {
           } -}
 includedir={- $OUT = '';
               $OUT .= '${prefix}/' . $_ . ' '
-                  foreach (@OpenSSL::safe::installdata::INCLUDEDIR_REL_PREFIX); -}
+                  foreach (@OpenSSL::safe::installdata::INCLUDEDIR_REL_PREFIX);
+              $OUT =~ s/\s+\z//; -}

 Name: OpenSSL
 Description: Secure Sockets Layer and cryptography libraries and tools
diff --git a/deps/openssl/openssl/fuzz/README.md b/deps/openssl/openssl/fuzz/README.md
index 795606fec2c..118ad684e97 100644
--- a/deps/openssl/openssl/fuzz/README.md
+++ b/deps/openssl/openssl/fuzz/README.md
@@ -29,7 +29,7 @@ to the `libFuzzer` library file while configuring; this is represented as
             -fsanitize=fuzzer-no-link \
             enable-ec_nistp_64_gcc_128 -fno-sanitize=alignment \
             enable-weak-ssl-ciphers enable-rc5 enable-md2 \
-            enable-ssl3 enable-ssl3-method enable-nextprotoneg \
+            enable-nextprotoneg \
             --debug

 Clang uses the gcc libstdc++ library so this must also be installed. You can
@@ -95,8 +95,7 @@ prebuilt fuzzer library. This is represented as `$PATH_TO_LIBFUZZER_DIR` below.
             -fsanitize=fuzzer-no-link \
             enable-ec_nistp_64_gcc_128 -fno-sanitize=alignment \
             enable-weak-ssl-ciphers enable-rc5 enable-md2 \
-            enable-ssl3 enable-ssl3-method enable-nextprotoneg \
-            --debug
+            enable-nextprotoneg --debug

 AFL
 ---
@@ -108,9 +107,8 @@ Configure for fuzzing:
     sudo apt-get install afl-clang
     CC=afl-clang-fast ./config enable-fuzz-afl no-shared no-module \
         -DPEDANTIC enable-tls1_3 enable-weak-ssl-ciphers enable-rc5 \
-        enable-md2 enable-ssl3 enable-ssl3-method enable-nextprotoneg \
-        enable-ec_nistp_64_gcc_128 -fno-sanitize=alignment \
-        --debug
+        enable-md2 enable-nextprotoneg enable-ec_nistp_64_gcc_128 \
+        -fno-sanitize=alignment --debug
     make clean
     make

diff --git a/deps/openssl/openssl/fuzz/acert.c b/deps/openssl/openssl/fuzz/acert.c
index 7a1cf796aaa..adff75c3ac6 100644
--- a/deps/openssl/openssl/fuzz/acert.c
+++ b/deps/openssl/openssl/fuzz/acert.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,13 +26,16 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
 {
     const unsigned char *p = buf;
     unsigned char *der = NULL;
+    X509_ACERT *acert;

-    X509_ACERT *acert = d2i_X509_ACERT(NULL, &p, len);
+    acert = d2i_X509_ACERT(NULL, &p, (long)len);
     if (acert != NULL) {
         BIO *bio = BIO_new(BIO_s_null());

-        X509_ACERT_print(bio, acert);
-        BIO_free(bio);
+        if (bio != NULL) {
+            X509_ACERT_print(bio, acert);
+            BIO_free(bio);
+        }

         i2d_X509_ACERT(acert, &der);
         OPENSSL_free(der);
diff --git a/deps/openssl/openssl/fuzz/asn1.c b/deps/openssl/openssl/fuzz/asn1.c
index 340d64923fd..2ceed4b5489 100644
--- a/deps/openssl/openssl/fuzz/asn1.c
+++ b/deps/openssl/openssl/fuzz/asn1.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -211,32 +211,32 @@ static ASN1_ITEM_EXP *item_type[] = {

 static ASN1_PCTX *pctx;

-#define DO_TEST(TYPE, D2I, I2D, PRINT)        \
-    {                                         \
-        const unsigned char *p = buf;         \
-        unsigned char *der = NULL;            \
-        TYPE *type = D2I(NULL, &p, len);      \
-                                              \
-        if (type != NULL) {                   \
-            int len2;                         \
-            BIO *bio = BIO_new(BIO_s_null()); \
-                                              \
-            if (bio != NULL) {                \
-                PRINT(bio, type);             \
-                BIO_free(bio);                \
-            }                                 \
-            len2 = I2D(type, &der);           \
-            if (len2 != 0) { }                \
-            OPENSSL_free(der);                \
-            TYPE##_free(type);                \
-        }                                     \
+#define DO_TEST(TYPE, D2I, I2D, PRINT)         \
+    {                                          \
+        const unsigned char *p = buf;          \
+        unsigned char *der = NULL;             \
+        TYPE *type = D2I(NULL, &p, (long)len); \
+                                               \
+        if (type != NULL) {                    \
+            int len2;                          \
+            BIO *bio = BIO_new(BIO_s_null());  \
+                                               \
+            if (bio != NULL) {                 \
+                PRINT(bio, type);              \
+                BIO_free(bio);                 \
+            }                                  \
+            len2 = I2D(type, &der);            \
+            if (len2 != 0) { }                 \
+            OPENSSL_free(der);                 \
+            TYPE##_free(type);                 \
+        }                                      \
     }

 #define DO_TEST_PRINT_OFFSET(TYPE, D2I, I2D, PRINT) \
     {                                               \
         const unsigned char *p = buf;               \
         unsigned char *der = NULL;                  \
-        TYPE *type = D2I(NULL, &p, len);            \
+        TYPE *type = D2I(NULL, &p, (long)len);      \
                                                     \
         if (type != NULL) {                         \
             BIO *bio = BIO_new(BIO_s_null());       \
@@ -255,7 +255,7 @@ static ASN1_PCTX *pctx;
     {                                             \
         const unsigned char *p = buf;             \
         unsigned char *der = NULL;                \
-        TYPE *type = D2I(NULL, &p, len);          \
+        TYPE *type = D2I(NULL, &p, (long)len);    \
                                                   \
         if (type != NULL) {                       \
             BIO *bio = BIO_new(BIO_s_null());     \
@@ -270,26 +270,25 @@ static ASN1_PCTX *pctx;
         }                                         \
     }

-#define DO_TEST_NO_PRINT(TYPE, D2I, I2D)      \
-    {                                         \
-        const unsigned char *p = buf;         \
-        unsigned char *der = NULL;            \
-        TYPE *type = D2I(NULL, &p, len);      \
-                                              \
-        if (type != NULL) {                   \
-            BIO *bio = BIO_new(BIO_s_null()); \
-                                              \
-            BIO_free(bio);                    \
-            I2D(type, &der);                  \
-            OPENSSL_free(der);                \
-            TYPE##_free(type);                \
-        }                                     \
+#define DO_TEST_NO_PRINT(TYPE, D2I, I2D)       \
+    {                                          \
+        const unsigned char *p = buf;          \
+        unsigned char *der = NULL;             \
+        TYPE *type = D2I(NULL, &p, (long)len); \
+                                               \
+        if (type != NULL) {                    \
+            I2D(type, &der);                   \
+            OPENSSL_free(der);                 \
+            TYPE##_free(type);                 \
+        }                                      \
     }

 int FuzzerInitialize(int *argc, char ***argv)
 {
     FuzzerSetRand();
     pctx = ASN1_PCTX_new();
+    if (pctx == NULL)
+        return 0;
     ASN1_PCTX_set_flags(pctx, ASN1_PCTX_FLAGS_SHOW_ABSENT | ASN1_PCTX_FLAGS_SHOW_SEQUENCE | ASN1_PCTX_FLAGS_SHOW_SSOF | ASN1_PCTX_FLAGS_SHOW_TYPE | ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME);
     ASN1_PCTX_set_str_flags(pctx, ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_SHOW_TYPE | ASN1_STRFLGS_DUMP_ALL);

@@ -309,7 +308,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
         const uint8_t *b = buf;
         unsigned char *der = NULL;
         const ASN1_ITEM *i = ASN1_ITEM_ptr(item_type[n]);
-        ASN1_VALUE *o = ASN1_item_d2i(NULL, &b, len, i);
+        ASN1_VALUE *o = ASN1_item_d2i(NULL, &b, (long)len, i);

         if (o != NULL) {
             /*
diff --git a/deps/openssl/openssl/fuzz/asn1parse.c b/deps/openssl/openssl/fuzz/asn1parse.c
index c25705cf730..201f7b36ea7 100644
--- a/deps/openssl/openssl/fuzz/asn1parse.c
+++ b/deps/openssl/openssl/fuzz/asn1parse.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@ int FuzzerInitialize(int *argc, char ***argv)

 int FuzzerTestOneInput(const uint8_t *buf, size_t len)
 {
-    (void)ASN1_parse_dump(bio_out, buf, len, 0, 0);
+    (void)ASN1_parse_dump(bio_out, buf, (long)len, 0, 0);
     ERR_clear_error();
     return 0;
 }
diff --git a/deps/openssl/openssl/fuzz/bignum.c b/deps/openssl/openssl/fuzz/bignum.c
index 66b41faf108..990efff9303 100644
--- a/deps/openssl/openssl/fuzz/bignum.c
+++ b/deps/openssl/openssl/fuzz/bignum.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,7 +28,6 @@ int FuzzerInitialize(int *argc, char ***argv)

 int FuzzerTestOneInput(const uint8_t *buf, size_t len)
 {
-    int success = 0;
     size_t l1 = 0, l2 = 0, l3 = 0;
     int s1 = 0, s3 = 0;
     BN_CTX *ctx;
@@ -45,6 +44,10 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     b5 = BN_new();
     ctx = BN_CTX_new();

+    if (b1 == NULL || b2 == NULL || b3 == NULL || b4 == NULL || b5 == NULL
+        || ctx == NULL)
+        goto done;
+
     /* Divide the input into three parts, using the values of the first two
      * bytes to choose lengths, which generate b1, b2 and b3. Use three bits
      * of the third byte to choose signs for the three numbers.
@@ -62,23 +65,25 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
         s3 = buf[0] & 4;
         ++buf;
     }
-    OPENSSL_assert(BN_bin2bn(buf, l1, b1) == b1);
+    if (BN_bin2bn(buf, (int)l1, b1) != b1)
+        goto done;
     BN_set_negative(b1, s1);
-    OPENSSL_assert(BN_bin2bn(buf + l1, l2, b2) == b2);
-    OPENSSL_assert(BN_bin2bn(buf + l1 + l2, l3, b3) == b3);
+    if (BN_bin2bn(buf + l1, (int)l2, b2) != b2)
+        goto done;
+    if (BN_bin2bn(buf + l1 + l2, (int)l3, b3) != b3)
+        goto done;
     BN_set_negative(b3, s3);

     /* mod 0 is undefined */
-    if (BN_is_zero(b3)) {
-        success = 1;
+    if (BN_is_zero(b3))
         goto done;
-    }

-    OPENSSL_assert(BN_mod_exp(b4, b1, b2, b3, ctx));
-    OPENSSL_assert(BN_mod_exp_simple(b5, b1, b2, b3, ctx));
+    if (!BN_mod_exp(b4, b1, b2, b3, ctx))
+        goto done;
+    if (!BN_mod_exp_simple(b5, b1, b2, b3, ctx))
+        goto done;

-    success = BN_cmp(b4, b5) == 0;
-    if (!success) {
+    if (BN_cmp(b4, b5) != 0) {
         BN_print_fp(stdout, b1);
         putchar('\n');
         BN_print_fp(stdout, b2);
@@ -92,7 +97,6 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     }

 done:
-    OPENSSL_assert(success);
     BN_free(b1);
     BN_free(b2);
     BN_free(b3);
diff --git a/deps/openssl/openssl/fuzz/bndiv.c b/deps/openssl/openssl/fuzz/bndiv.c
index 7b48ac3dd95..4a6732a7752 100644
--- a/deps/openssl/openssl/fuzz/bndiv.c
+++ b/deps/openssl/openssl/fuzz/bndiv.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -37,6 +37,19 @@ int FuzzerInitialize(int *argc, char ***argv)
     b5 = BN_new();
     ctx = BN_CTX_new();

+    if (b1 == NULL || b2 == NULL || b3 == NULL || b4 == NULL || b5 == NULL
+        || ctx == NULL) {
+        BN_free(b1);
+        BN_free(b2);
+        BN_free(b3);
+        BN_free(b4);
+        BN_free(b5);
+        BN_CTX_free(ctx);
+        b1 = b2 = b3 = b4 = b5 = NULL;
+        ctx = NULL;
+        return 0;
+    }
+
     OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
     ERR_clear_error();

@@ -69,18 +82,19 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
         ++buf;
         l2 = len - l1;
     }
-    OPENSSL_assert(BN_bin2bn(buf, l1, b1) == b1);
+    if (BN_bin2bn(buf, (int)l1, b1) != b1)
+        goto done;
     BN_set_negative(b1, s1);
-    OPENSSL_assert(BN_bin2bn(buf + l1, l2, b2) == b2);
+    if (BN_bin2bn(buf + l1, (int)l2, b2) != b2)
+        goto done;
     BN_set_negative(b2, s2);

     /* divide by 0 is an error */
-    if (BN_is_zero(b2)) {
-        success = 1;
+    if (BN_is_zero(b2))
         goto done;
-    }

-    OPENSSL_assert(BN_div(b3, b4, b1, b2, ctx));
+    if (!BN_div(b3, b4, b1, b2, ctx))
+        goto done;
     if (BN_is_zero(b1))
         success = BN_is_zero(b3) && BN_is_zero(b4);
     else if (BN_is_negative(b1))
@@ -89,8 +103,10 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     else
         success = (BN_is_negative(b3) == BN_is_negative(b2) || BN_is_zero(b3))
             && (!BN_is_negative(b4) || BN_is_zero(b4));
-    OPENSSL_assert(BN_mul(b5, b3, b2, ctx));
-    OPENSSL_assert(BN_add(b5, b5, b4));
+    if (!BN_mul(b5, b3, b2, ctx))
+        goto done;
+    if (!BN_add(b5, b5, b4))
+        goto done;

     success = success && BN_cmp(b5, b1) == 0;
     if (!success) {
@@ -114,7 +130,6 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     }

 done:
-    OPENSSL_assert(success);
     ERR_clear_error();

     return 0;
diff --git a/deps/openssl/openssl/fuzz/build.info b/deps/openssl/openssl/fuzz/build.info
index 552d9fcbceb..cde654c0896 100644
--- a/deps/openssl/openssl/fuzz/build.info
+++ b/deps/openssl/openssl/fuzz/build.info
@@ -10,8 +10,9 @@

 IF[{- !$disabled{"fuzz-afl"} || !$disabled{"fuzz-libfuzzer"} -}]
   PROGRAMS{noinst}=asn1 asn1parse bignum bndiv client conf crl server smime
-  PROGRAMS{noinst}=punycode pem decoder hashtable acert
-  PROGRAMS{noinst}=v3name
+  PROGRAMS{noinst}=pkcs7_verify
+  PROGRAMS{noinst}=pkcs12 punycode pem decoder hashtable acert
+  PROGRAMS{noinst}=v3name x509v3
   PROGRAMS{noinst}=provider

   IF[{- !$disabled{"ml-kem"} -}]
@@ -50,6 +51,10 @@ IF[{- !$disabled{"fuzz-afl"} || !$disabled{"fuzz-libfuzzer"} -}]
     PROGRAMS{noinst}=dtlsclient dtlsserver
   ENDIF

+  IF[{- !$disabled{"ech"} -}]
+    PROGRAMS{noinst}=echconfiglist_parser
+  ENDIF
+
   SOURCE[asn1]=asn1.c driver.c fuzz_rand.c
   INCLUDE[asn1]=../include {- $ex_inc -}
   DEPEND[asn1]=../libcrypto ../libssl {- $ex_lib -}
@@ -82,6 +87,10 @@ IF[{- !$disabled{"fuzz-afl"} || !$disabled{"fuzz-libfuzzer"} -}]
   INCLUDE[cms]=../include {- $ex_inc -}
   DEPEND[cms]=../libcrypto {- $ex_lib -}

+  SOURCE[pkcs12]=pkcs12.c driver.c
+  INCLUDE[pkcs12]=../include {- $ex_inc -}
+  DEPEND[pkcs12]=../libcrypto {- $ex_lib -}
+
   SOURCE[conf]=conf.c driver.c
   INCLUDE[conf]=../include {- $ex_inc -}
   DEPEND[conf]=../libcrypto {- $ex_lib -}
@@ -102,6 +111,10 @@ IF[{- !$disabled{"fuzz-afl"} || !$disabled{"fuzz-libfuzzer"} -}]
   INCLUDE[dtlsserver]=../include {- $ex_inc -}
   DEPEND[dtlsserver]=../libcrypto ../libssl {- $ex_lib -}

+  SOURCE[echconfiglist_parser]=echconfiglist_parser.c driver.c
+  INCLUDE[echconfiglist_parser]=../include {- $ex_inc -}
+  DEPEND[echconfiglist_parser]=../libcrypto ../libssl {- $ex_lib -}
+
   SOURCE[pem]=pem.c driver.c
   INCLUDE[pem]=../include {- $ex_inc -}
   DEPEND[pem]=../libcrypto.a {- $ex_lib -}
@@ -126,10 +139,18 @@ IF[{- !$disabled{"fuzz-afl"} || !$disabled{"fuzz-libfuzzer"} -}]
   INCLUDE[smime]=../include {- $ex_inc -}
   DEPEND[smime]=../libcrypto ../libssl {- $ex_lib -}

+  SOURCE[pkcs7_verify]=pkcs7_verify.c driver.c
+  INCLUDE[pkcs7_verify]=../include {- $ex_inc -}
+  DEPEND[pkcs7_verify]=../libcrypto {- $ex_lib -}
+
   SOURCE[v3name]=v3name.c driver.c
   INCLUDE[v3name]=../include {- $ex_inc -}
   DEPEND[v3name]=../libcrypto.a {- $ex_lib -}

+  SOURCE[x509v3]=x509v3.c driver.c
+  INCLUDE[x509v3]=../include {- $ex_inc -}
+  DEPEND[x509v3]=../libcrypto.a {- $ex_lib -}
+
   SOURCE[quic-client]=quic-client.c driver.c fuzz_rand.c
   INCLUDE[quic-client]=../include {- $ex_inc -}
   DEPEND[quic-client]=../libcrypto.a ../libssl.a {- $ex_lib -}
@@ -172,9 +193,12 @@ IF[{- !$disabled{"fuzz-afl"} || !$disabled{"fuzz-libfuzzer"} -}]
 ENDIF

 IF[{- !$disabled{tests} -}]
+  $FUZZTESTSRC=test-corpus.c ../test/mfail/mfail.c
+
   PROGRAMS{noinst}=asn1-test asn1parse-test bignum-test bndiv-test client-test conf-test crl-test server-test smime-test
-  PROGRAMS{noinst}=punycode-test pem-test decoder-test hashtable-test acert-test
-  PROGRAMS{noinst}=v3name-test
+  PROGRAMS{noinst}=pkcs7_verify-test
+  PROGRAMS{noinst}=pkcs12-test punycode-test pem-test decoder-test hashtable-test acert-test
+  PROGRAMS{noinst}=v3name-test x509v3-test
   PROGRAMS{noinst}=provider-test

   IF[{- !$disabled{"ml-kem"} -}]
@@ -214,127 +238,147 @@ IF[{- !$disabled{tests} -}]
     PROGRAMS{noinst}=dtlsclient-test dtlsserver-test
   ENDIF

-  SOURCE[asn1-test]=asn1.c test-corpus.c fuzz_rand.c
-  INCLUDE[asn1-test]=../include
-  DEPEND[asn1-test]=../libcrypto ../libssl
+  IF[{- !$disabled{"ech"} -}]
+    PROGRAMS{noinst}=echconfiglist_parser-test
+  ENDIF
+
+  SOURCE[asn1-test]=asn1.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[asn1-test]=../include ../test/mfail
+  DEPEND[asn1-test]=../libcrypto.a ../libssl.a

-  SOURCE[asn1parse-test]=asn1parse.c test-corpus.c
-  INCLUDE[asn1parse-test]=../include
-  DEPEND[asn1parse-test]=../libcrypto
+  SOURCE[asn1parse-test]=asn1parse.c $FUZZTESTSRC
+  INCLUDE[asn1parse-test]=../include ../test/mfail
+  DEPEND[asn1parse-test]=../libcrypto.a

-  SOURCE[bignum-test]=bignum.c test-corpus.c
-  INCLUDE[bignum-test]=../include
-  DEPEND[bignum-test]=../libcrypto
+  SOURCE[bignum-test]=bignum.c $FUZZTESTSRC
+  INCLUDE[bignum-test]=../include ../test/mfail
+  DEPEND[bignum-test]=../libcrypto.a

-  SOURCE[bndiv-test]=bndiv.c test-corpus.c
-  INCLUDE[bndiv-test]=../include
-  DEPEND[bndiv-test]=../libcrypto
+  SOURCE[bndiv-test]=bndiv.c $FUZZTESTSRC
+  INCLUDE[bndiv-test]=../include ../test/mfail
+  DEPEND[bndiv-test]=../libcrypto.a

-  SOURCE[client-test]=client.c test-corpus.c fuzz_rand.c
-  INCLUDE[client-test]=../include
-  DEPEND[client-test]=../libcrypto ../libssl
+  SOURCE[client-test]=client.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[client-test]=../include ../test/mfail
+  DEPEND[client-test]=../libcrypto.a ../libssl.a

-  SOURCE[cmp-test]=cmp.c test-corpus.c fuzz_rand.c
-  INCLUDE[cmp-test]=../include
+  SOURCE[cmp-test]=cmp.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[cmp-test]=../include ../test/mfail
   DEPEND[cmp-test]=../libcrypto.a
   # referring to static lib allows using non-exported functions

-  SOURCE[ml-kem-test]=ml-kem.c test-corpus.c fuzz_rand.c
-  INCLUDE[ml-kem-test]=../include
+  SOURCE[ml-kem-test]=ml-kem.c $FUZZTESTSRC
+  INCLUDE[ml-kem-test]=../include ../test/mfail
   DEPEND[ml-kem-test]=../libcrypto.a
   # referring to static lib allows using non-exported functions

-  SOURCE[ml-dsa-test]=ml-dsa.c test-corpus.c fuzz_rand.c
-  INCLUDE[ml-dsa-test]=../include
+  SOURCE[ml-dsa-test]=ml-dsa.c $FUZZTESTSRC
+  INCLUDE[ml-dsa-test]=../include ../test/mfail
   DEPEND[ml-dsa-test]=../libcrypto.a
   # referring to static lib allows using non-exported functions

-  SOURCE[slh-dsa-test]=slh-dsa.c test-corpus.c fuzz_rand.c
-  INCLUDE[slh-dsa-test]=../include
+  SOURCE[slh-dsa-test]=slh-dsa.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[slh-dsa-test]=../include ../test/mfail
   DEPEND[slh-dsa-test]=../libcrypto.a
   # referring to static lib allows using non-exported functions

-  SOURCE[cms-test]=cms.c test-corpus.c
-  INCLUDE[cms-test]=../include
-  DEPEND[cms-test]=../libcrypto
+  SOURCE[cms-test]=cms.c $FUZZTESTSRC
+  INCLUDE[cms-test]=../include ../test/mfail
+  DEPEND[cms-test]=../libcrypto.a
+
+  SOURCE[pkcs12-test]=pkcs12.c $FUZZTESTSRC
+  INCLUDE[pkcs12-test]=../include ../test/mfail
+  DEPEND[pkcs12-test]=../libcrypto.a

-  SOURCE[conf-test]=conf.c test-corpus.c
-  INCLUDE[conf-test]=../include
-  DEPEND[conf-test]=../libcrypto
+  SOURCE[conf-test]=conf.c $FUZZTESTSRC
+  INCLUDE[conf-test]=../include ../test/mfail
+  DEPEND[conf-test]=../libcrypto.a

-  SOURCE[crl-test]=crl.c test-corpus.c
-  INCLUDE[crl-test]=../include
-  DEPEND[crl-test]=../libcrypto
+  SOURCE[crl-test]=crl.c $FUZZTESTSRC
+  INCLUDE[crl-test]=../include ../test/mfail
+  DEPEND[crl-test]=../libcrypto.a

-  SOURCE[ct-test]=ct.c test-corpus.c
-  INCLUDE[ct-test]=../include
-  DEPEND[ct-test]=../libcrypto
+  SOURCE[ct-test]=ct.c $FUZZTESTSRC
+  INCLUDE[ct-test]=../include ../test/mfail
+  DEPEND[ct-test]=../libcrypto.a

-  SOURCE[dtlsclient-test]=dtlsclient.c test-corpus.c fuzz_rand.c
-  INCLUDE[dtlsclient-test]=../include
-  DEPEND[dtlsclient-test]=../libcrypto ../libssl
+  SOURCE[dtlsclient-test]=dtlsclient.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[dtlsclient-test]=../include ../test/mfail
+  DEPEND[dtlsclient-test]=../libcrypto.a ../libssl.a

-  SOURCE[dtlsserver-test]=dtlsserver.c test-corpus.c fuzz_rand.c
-  INCLUDE[dtlsserver-test]=../include
-  DEPEND[dtlsserver-test]=../libcrypto ../libssl
+  SOURCE[dtlsserver-test]=dtlsserver.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[dtlsserver-test]=../include ../test/mfail
+  DEPEND[dtlsserver-test]=../libcrypto.a ../libssl.a

-  SOURCE[pem-test]=pem.c test-corpus.c
-  INCLUDE[pem-test]=../include
+  SOURCE[echconfiglist_parser-test]=echconfiglist_parser.c $FUZZTESTSRC
+  INCLUDE[echconfiglist_parser-test]=../include ../test/mfail
+  DEPEND[echconfiglist_parser-test]=../libcrypto.a ../libssl.a
+
+  SOURCE[pem-test]=pem.c $FUZZTESTSRC
+  INCLUDE[pem-test]=../include ../test/mfail
   DEPEND[pem-test]=../libcrypto.a

-  SOURCE[decoder-test]=decoder.c test-corpus.c fuzz_rand.c
-  INCLUDE[decoder-test]=../include
-  DEPEND[decoder-test]=../libcrypto
+  SOURCE[decoder-test]=decoder.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[decoder-test]=../include ../test/mfail
+  DEPEND[decoder-test]=../libcrypto.a

-  SOURCE[hashtable-test]=hashtable.c test-corpus.c fuzz_rand.c
-  INCLUDE[hashtable-test]=../include
+  SOURCE[hashtable-test]=hashtable.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[hashtable-test]=../include ../test/mfail
   DEPEND[hashtable-test]=../libcrypto.a

-  SOURCE[acert-test]=acert.c test-corpus.c
-  INCLUDE[acert-test]=../include
-  DEPEND[acert-test]=../libcrypto
+  SOURCE[acert-test]=acert.c $FUZZTESTSRC
+  INCLUDE[acert-test]=../include ../test/mfail
+  DEPEND[acert-test]=../libcrypto.a

-  SOURCE[punycode-test]=punycode.c test-corpus.c
-  INCLUDE[punycode-test]=../include
+  SOURCE[punycode-test]=punycode.c $FUZZTESTSRC
+  INCLUDE[punycode-test]=../include ../test/mfail
   DEPEND[punycode-test]=../libcrypto.a

-  SOURCE[smime-test]=smime.c test-corpus.c
-  INCLUDE[smime-test]=../include
-  DEPEND[smime-test]=../libcrypto ../libssl
+  SOURCE[smime-test]=smime.c $FUZZTESTSRC
+  INCLUDE[smime-test]=../include ../test/mfail
+  DEPEND[smime-test]=../libcrypto.a ../libssl.a
+
+  SOURCE[pkcs7_verify-test]=pkcs7_verify.c $FUZZTESTSRC
+  INCLUDE[pkcs7_verify-test]=../include ../test/mfail
+  DEPEND[pkcs7_verify-test]=../libcrypto.a

-  SOURCE[v3name-test]=v3name.c test-corpus.c
-  INCLUDE[v3name-test]=../include
+  SOURCE[v3name-test]=v3name.c $FUZZTESTSRC
+  INCLUDE[v3name-test]=../include ../test/mfail
   DEPEND[v3name-test]=../libcrypto.a

-  SOURCE[quic-client-test]=quic-client.c test-corpus.c fuzz_rand.c
-  INCLUDE[quic-client-test]=../include
+  SOURCE[x509v3-test]=x509v3.c $FUZZTESTSRC
+  INCLUDE[x509v3-test]=../include ../test/mfail
+  DEPEND[x509v3-test]=../libcrypto.a
+
+  SOURCE[quic-client-test]=quic-client.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[quic-client-test]=../include ../test/mfail
   DEPEND[quic-client-test]=../libcrypto.a ../libssl.a

-  SOURCE[quic-server-test]=quic-server.c test-corpus.c fuzz_rand.c
-  INCLUDE[quic-server-test]=../include
+  SOURCE[quic-server-test]=quic-server.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[quic-server-test]=../include ../test/mfail
   DEPEND[quic-server-test]=../libcrypto.a ../libssl.a

-  SOURCE[quic-srtm-test]=quic-srtm.c test-corpus.c fuzz_rand.c
-  INCLUDE[quic-srtm-test]=../include
+  SOURCE[quic-srtm-test]=quic-srtm.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[quic-srtm-test]=../include ../test/mfail
   DEPEND[quic-srtm-test]=../libcrypto.a ../libssl.a

-  SOURCE[quic-lcidm-test]=quic-lcidm.c test-corpus.c fuzz_rand.c
-  INCLUDE[quic-lcidm-test]=../include
+  SOURCE[quic-lcidm-test]=quic-lcidm.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[quic-lcidm-test]=../include ../test/mfail
   DEPEND[quic-lcidm-test]=../libcrypto.a ../libssl.a

-  SOURCE[quic-rcidm-test]=quic-rcidm.c test-corpus.c fuzz_rand.c
-  INCLUDE[quic-rcidm-test]=../include
+  SOURCE[quic-rcidm-test]=quic-rcidm.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[quic-rcidm-test]=../include ../test/mfail
   DEPEND[quic-rcidm-test]=../libcrypto.a ../libssl.a

-  SOURCE[server-test]=server.c test-corpus.c fuzz_rand.c
-  INCLUDE[server-test]=../include
-  DEPEND[server-test]=../libcrypto ../libssl
+  SOURCE[server-test]=server.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[server-test]=../include ../test/mfail
+  DEPEND[server-test]=../libcrypto.a ../libssl.a

-  SOURCE[x509-test]=x509.c test-corpus.c fuzz_rand.c
-  INCLUDE[x509-test]=../include
-  DEPEND[x509-test]=../libcrypto
+  SOURCE[x509-test]=x509.c $FUZZTESTSRC fuzz_rand.c
+  INCLUDE[x509-test]=../include ../test/mfail
+  DEPEND[x509-test]=../libcrypto.a

-  SOURCE[provider-test]=provider.c test-corpus.c
-  INCLUDE[provider-test]=../include
-  DEPEND[provider-test]=../libcrypto
+  SOURCE[provider-test]=provider.c $FUZZTESTSRC
+  INCLUDE[provider-test]=../include ../test/mfail
+  DEPEND[provider-test]=../libcrypto.a
 ENDIF
diff --git a/deps/openssl/openssl/fuzz/client.c b/deps/openssl/openssl/fuzz/client.c
index d5125af994a..8ed77ea8cd5 100644
--- a/deps/openssl/openssl/fuzz/client.c
+++ b/deps/openssl/openssl/fuzz/client.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,9 +18,6 @@
 #include <openssl/err.h>
 #include "fuzzer.h"

-/* unused, to avoid warning. */
-static int idx;
-
 #define FUZZTIME 1485898104

 #define TIME_IMPL(t)       \
@@ -50,7 +47,9 @@ time_t time(time_t *t) TIME_IMPL(t)
     OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL);
     ERR_clear_error();
     CRYPTO_free_ex_index(0, -1);
-    idx = SSL_get_ex_data_X509_STORE_CTX_idx();
+    if (SSL_get_ex_data_X509_STORE_CTX_idx() != 0) {
+        /* Just suppress warning */
+    }
     comp_methods = SSL_COMP_get_compression_methods();
     if (comp_methods != NULL)
         sk_SSL_COMP_sort(comp_methods);
@@ -65,19 +64,21 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     BIO *out;
     SSL_CTX *ctx;

-    if (len == 0)
+    if (len == 0 || len > INT_MAX)
         return 0;

     /* This only fuzzes the initial flow from the client so far. */
-    ctx = SSL_CTX_new(SSLv23_method());
+    ctx = SSL_CTX_new(TLS_method());
     if (ctx == NULL)
         goto end;

     client = SSL_new(ctx);
     if (client == NULL)
         goto end;
-    OPENSSL_assert(SSL_set_min_proto_version(client, 0) == 1);
-    OPENSSL_assert(SSL_set_cipher_list(client, "ALL:eNULL:@SECLEVEL=0") == 1);
+    if (SSL_set_min_proto_version(client, 0) != 1)
+        goto end;
+    if (SSL_set_cipher_list(client, "ALL:eNULL:@SECLEVEL=0") != 1)
+        goto end;
     SSL_set_tlsext_host_name(client, "localhost");
     in = BIO_new(BIO_s_mem());
     if (in == NULL)
@@ -89,7 +90,8 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     }
     SSL_set_bio(client, in, out);
     SSL_set_connect_state(client);
-    OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
+    if ((size_t)BIO_write(in, buf, (int)len) != len)
+        goto end;
     if (SSL_do_handshake(client) == 1) {
         /* Keep reading application data until error or EOF. */
         uint8_t tmp[1024];
diff --git a/deps/openssl/openssl/fuzz/cmp.c b/deps/openssl/openssl/fuzz/cmp.c
index 64ef6e34a9e..ae4dcc033d8 100644
--- a/deps/openssl/openssl/fuzz/cmp.c
+++ b/deps/openssl/openssl/fuzz/cmp.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -172,17 +172,35 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     OSSL_CMP_MSG *msg;
     BIO *in;

-    if (len == 0)
+    if (len == 0 || len > INT_MAX)
         return 0;

     in = BIO_new(BIO_s_mem());
-    OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
+    if (in == NULL) {
+        ERR_clear_error();
+        return 0;
+    }
+    if ((size_t)BIO_write(in, buf, (int)len) != len) {
+        BIO_free(in);
+        ERR_clear_error();
+        return 0;
+    }
+
     msg = d2i_OSSL_CMP_MSG_bio(in, NULL);
     if (msg != NULL) {
         BIO *out = BIO_new(BIO_s_null());
         OSSL_CMP_SRV_CTX *srv_ctx = OSSL_CMP_SRV_CTX_new(NULL, NULL);
         OSSL_CMP_CTX *client_ctx = OSSL_CMP_CTX_new(NULL, NULL);

+        if (out == NULL) {
+            OSSL_CMP_CTX_free(client_ctx);
+            OSSL_CMP_SRV_CTX_free(srv_ctx);
+            OSSL_CMP_MSG_free(msg);
+            BIO_free(in);
+            ERR_clear_error();
+            return 0;
+        }
+
         i2d_OSSL_CMP_MSG_bio(out, msg);
         ASN1_item_print(out, (ASN1_VALUE *)msg, 4,
             ASN1_ITEM_rptr(OSSL_CMP_MSG), NULL);
diff --git a/deps/openssl/openssl/fuzz/cms.c b/deps/openssl/openssl/fuzz/cms.c
index d464429a540..bd67e4f3a89 100644
--- a/deps/openssl/openssl/fuzz/cms.c
+++ b/deps/openssl/openssl/fuzz/cms.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -30,17 +30,27 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     CMS_ContentInfo *cms;
     BIO *in;

-    if (len == 0)
+    if (len == 0 || len > INT_MAX)
         return 0;

     in = BIO_new(BIO_s_mem());
-    OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
+    if (in == NULL) {
+        ERR_clear_error();
+        return 0;
+    }
+    if ((size_t)BIO_write(in, buf, (int)len) != len) {
+        BIO_free(in);
+        ERR_clear_error();
+        return 0;
+    }
     cms = d2i_CMS_bio(in, NULL);
     if (cms != NULL) {
         BIO *out = BIO_new(BIO_s_null());

-        i2d_CMS_bio(out, cms);
-        BIO_free(out);
+        if (out != NULL) {
+            i2d_CMS_bio(out, cms);
+            BIO_free(out);
+        }
         CMS_ContentInfo_free(cms);
     }

diff --git a/deps/openssl/openssl/fuzz/conf.c b/deps/openssl/openssl/fuzz/conf.c
index 72e4b358fd8..5e6b5ea7ad8 100644
--- a/deps/openssl/openssl/fuzz/conf.c
+++ b/deps/openssl/openssl/fuzz/conf.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -29,13 +29,19 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     BIO *in;
     long eline;

-    if (len == 0)
+    if (len == 0 || len > INT_MAX)
         return 0;

     conf = NCONF_new(NULL);
+    if (conf == NULL)
+        return 0;
     in = BIO_new(BIO_s_mem());
-    OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
+    if (in == NULL)
+        goto end;
+    if ((size_t)BIO_write(in, buf, (int)len) != len)
+        goto end;
     NCONF_load_bio(conf, in, &eline);
+end:
     NCONF_free(conf);
     BIO_free(in);
     ERR_clear_error();
diff --git a/deps/openssl/openssl/fuzz/crl.c b/deps/openssl/openssl/fuzz/crl.c
index 9e18dcb94b3..9268c5aae74 100644
--- a/deps/openssl/openssl/fuzz/crl.c
+++ b/deps/openssl/openssl/fuzz/crl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,11 +26,14 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     const unsigned char *p = buf;
     unsigned char *der = NULL;

-    X509_CRL *crl = d2i_X509_CRL(NULL, &p, len);
+    X509_CRL *crl = d2i_X509_CRL(NULL, &p, (long)len);
     if (crl != NULL) {
         BIO *bio = BIO_new(BIO_s_null());
-        X509_CRL_print(bio, crl);
-        BIO_free(bio);
+
+        if (bio != NULL) {
+            X509_CRL_print(bio, crl);
+            BIO_free(bio);
+        }

         i2d_X509_CRL(crl, &der);
         OPENSSL_free(der);
diff --git a/deps/openssl/openssl/fuzz/ct.c b/deps/openssl/openssl/fuzz/ct.c
index b37b11039c0..430419d53da 100644
--- a/deps/openssl/openssl/fuzz/ct.c
+++ b/deps/openssl/openssl/fuzz/ct.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -29,11 +29,14 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
 {
     const uint8_t **pp = &buf;
     unsigned char *der = NULL;
-    STACK_OF(SCT) *scts = d2i_SCT_LIST(NULL, pp, len);
+    STACK_OF(SCT) *scts = d2i_SCT_LIST(NULL, pp, (long)len);
     if (scts != NULL) {
         BIO *bio = BIO_new(BIO_s_null());
-        SCT_LIST_print(scts, bio, 4, "\n", NULL);
-        BIO_free(bio);
+
+        if (bio != NULL) {
+            SCT_LIST_print(scts, bio, 4, "\n", NULL);
+            BIO_free(bio);
+        }

         if (i2d_SCT_LIST(scts, &der)) {
             /* Silence unused result warning */
diff --git a/deps/openssl/openssl/fuzz/decoder.c b/deps/openssl/openssl/fuzz/decoder.c
index 3a9a48ad218..ab5dd3112ba 100644
--- a/deps/openssl/openssl/fuzz/decoder.c
+++ b/deps/openssl/openssl/fuzz/decoder.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,6 +25,8 @@ int FuzzerInitialize(int *argc, char ***argv)
         NULL);

     pctx = ASN1_PCTX_new();
+    if (pctx == NULL)
+        return 0;
     ASN1_PCTX_set_flags(pctx, ASN1_PCTX_FLAGS_SHOW_ABSENT | ASN1_PCTX_FLAGS_SHOW_SEQUENCE | ASN1_PCTX_FLAGS_SHOW_SSOF | ASN1_PCTX_FLAGS_SHOW_TYPE | ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME);
     ASN1_PCTX_set_str_flags(pctx, ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_SHOW_TYPE | ASN1_STRFLGS_DUMP_ALL);

@@ -41,9 +43,15 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     BIO *bio;

     bio = BIO_new(BIO_s_null());
+    if (bio == NULL) {
+        ERR_clear_error();
+        return 0;
+    }
     dctx = OSSL_DECODER_CTX_new_for_pkey(&pkey, NULL, NULL, NULL, 0, NULL,
         NULL);
     if (dctx == NULL) {
+        BIO_free(bio);
+        ERR_clear_error();
         return 0;
     }
     if (OSSL_DECODER_from_data(dctx, &buf, &len)) {
@@ -54,27 +62,29 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
         EVP_PKEY_print_params(bio, pkey, 1, pctx);

         pkey2 = EVP_PKEY_dup(pkey);
-        OPENSSL_assert(pkey2 != NULL);
-        EVP_PKEY_eq(pkey, pkey2);
-        EVP_PKEY_free(pkey2);
+        if (pkey2 != NULL) {
+            EVP_PKEY_eq(pkey, pkey2);
+            EVP_PKEY_free(pkey2);
+        }

         ctx = EVP_PKEY_CTX_new(pkey, NULL);
-        /*
-         * Param check will take too long time on large DH parameters.
-         * Skip it.
-         */
-        if ((!EVP_PKEY_is_a(pkey, "DH") && !EVP_PKEY_is_a(pkey, "DHX"))
-            || EVP_PKEY_get_bits(pkey) <= 2048)
-            EVP_PKEY_param_check(ctx);
+        if (ctx != NULL) {
+            /*
+             * Param check will take too long time on large DH parameters.
+             * Skip it.
+             */
+            if ((!EVP_PKEY_is_a(pkey, "DH") && !EVP_PKEY_is_a(pkey, "DHX"))
+                || EVP_PKEY_get_bits(pkey) <= 2048)
+                EVP_PKEY_param_check(ctx);

-        EVP_PKEY_public_check(ctx);
-        /* Private and pairwise checks are unbounded, skip for large keys. */
-        if (EVP_PKEY_get_bits(pkey) <= 4096) {
-            EVP_PKEY_private_check(ctx);
-            EVP_PKEY_pairwise_check(ctx);
+            EVP_PKEY_public_check(ctx);
+            /* Private and pairwise checks are unbounded, skip for large keys. */
+            if (EVP_PKEY_get_bits(pkey) <= 4096) {
+                EVP_PKEY_private_check(ctx);
+                EVP_PKEY_pairwise_check(ctx);
+            }
+            EVP_PKEY_CTX_free(ctx);
         }
-        OPENSSL_assert(ctx != NULL);
-        EVP_PKEY_CTX_free(ctx);
         EVP_PKEY_free(pkey);
     }
     OSSL_DECODER_CTX_free(dctx);
diff --git a/deps/openssl/openssl/fuzz/dtlsclient.c b/deps/openssl/openssl/fuzz/dtlsclient.c
index 0cbed3ea6b1..0fe3c9eacf9 100644
--- a/deps/openssl/openssl/fuzz/dtlsclient.c
+++ b/deps/openssl/openssl/fuzz/dtlsclient.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,9 +18,6 @@
 #include <openssl/err.h>
 #include "fuzzer.h"

-/* unused, to avoid warning. */
-static int idx;
-
 #define FUZZTIME 1485898104

 #define TIME_IMPL(t)       \
@@ -50,7 +47,9 @@ time_t time(time_t *t) TIME_IMPL(t)
     OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL);
     ERR_clear_error();
     CRYPTO_free_ex_index(0, -1);
-    idx = SSL_get_ex_data_X509_STORE_CTX_idx();
+    if (SSL_get_ex_data_X509_STORE_CTX_idx() != 0) {
+        /* Just suppress warning */
+    }
     comp_methods = SSL_COMP_get_compression_methods();
     if (comp_methods != NULL)
         sk_SSL_COMP_sort(comp_methods);
@@ -65,7 +64,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     BIO *out;
     SSL_CTX *ctx;

-    if (len == 0)
+    if (len == 0 || len > INT_MAX)
         return 0;

     /* This only fuzzes the initial flow from the client so far. */
@@ -76,8 +75,12 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     client = SSL_new(ctx);
     if (client == NULL)
         goto end;
-    OPENSSL_assert(SSL_set_min_proto_version(client, 0) == 1);
-    OPENSSL_assert(SSL_set_cipher_list(client, "ALL:eNULL:@SECLEVEL=0") == 1);
+    if (SSL_set_min_proto_version(client, 0) != 1)
+        goto end;
+    if (SSL_set_max_proto_version(client, 0) != 1)
+        goto end;
+    if (SSL_set_cipher_list(client, "ALL:eNULL:@SECLEVEL=0") != 1)
+        goto end;
     SSL_set_tlsext_host_name(client, "localhost");
     in = BIO_new(BIO_s_mem());
     if (in == NULL)
@@ -89,7 +92,8 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     }
     SSL_set_bio(client, in, out);
     SSL_set_connect_state(client);
-    OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
+    if ((size_t)BIO_write(in, buf, (int)len) != len)
+        goto end;
     if (SSL_do_handshake(client) == 1) {
         /* Keep reading application data until error or EOF. */
         uint8_t tmp[1024];
diff --git a/deps/openssl/openssl/fuzz/dtlsserver.c b/deps/openssl/openssl/fuzz/dtlsserver.c
index 8ade7a3d8c8..e9c825ea814 100644
--- a/deps/openssl/openssl/fuzz/dtlsserver.c
+++ b/deps/openssl/openssl/fuzz/dtlsserver.c
@@ -218,7 +218,6 @@ static const uint8_t RSACertificatePEM[] = {
     0x2d, 0x0a
 };

-#ifndef OPENSSL_NO_DEPRECATED_3_0
 /*
 -----BEGIN PRIVATE KEY-----
 MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC1mQfTLWrNFfUs
@@ -464,10 +463,8 @@ static const uint8_t RSAPrivateKeyPEM[] = {
     0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b,
     0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a
 };
-#endif

 #ifndef OPENSSL_NO_EC
-#ifndef OPENSSL_NO_DEPRECATED_3_0
 /*
 -----BEGIN EC PRIVATE KEY-----
 MHcCAQEEIJLyl7hJjpQL/RhP1x2zS79xdiPJQB683gWeqcqHPeZkoAoGCCqGSM49
@@ -496,7 +493,6 @@ static const char ECDSAPrivateKeyPEM[] = {
     0x4e, 0x44, 0x20, 0x45, 0x43, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54,
     0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a
 };
-#endif

 /*
 -----BEGIN CERTIFICATE-----
@@ -559,7 +555,7 @@ static const char ECDSACertPEM[] = {
 };
 #endif

-#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
+#ifndef OPENSSL_NO_DSA
 /*
 -----BEGIN DSA PRIVATE KEY-----
 MIIBuwIBAAKBgQDdkFKzNABLOha7Eqj7004+p5fhtR6bxpujToMmSZTYi8igVVXP
@@ -739,9 +735,6 @@ static const char DSACertPEM[] = {
 };
 #endif

-/* unused, to avoid warning. */
-static int idx;
-
 #define FUZZTIME 1485898104

 #define TIME_IMPL(t)       \
@@ -771,7 +764,9 @@ time_t time(time_t *t) TIME_IMPL(t)
     OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL);
     ERR_clear_error();
     CRYPTO_free_ex_index(0, -1);
-    idx = SSL_get_ex_data_X509_STORE_CTX_idx();
+    if (SSL_get_ex_data_X509_STORE_CTX_idx() == 0) {
+        /* Just suppress warning */
+    }
     comp_methods = SSL_COMP_get_compression_methods();
     if (comp_methods != NULL)
         sk_SSL_COMP_sort(comp_methods);
@@ -779,121 +774,109 @@ time_t time(time_t *t) TIME_IMPL(t)
     return 1;
 }

-int FuzzerTestOneInput(const uint8_t *buf, size_t len)
+static int use_pem_privkey(SSL_CTX *ctx, const void *pem, size_t pem_len)
 {
-    SSL *server;
-    BIO *in;
-    BIO *out;
     BIO *bio_buf;
-    SSL_CTX *ctx;
-    int ret;
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-    RSA *privkey;
-#endif
-#if !defined(OPENSSL_NO_DEPRECATED_3_0)
     EVP_PKEY *pkey;
-#endif
-    X509 *cert;
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-#ifndef OPENSSL_NO_EC
-    EC_KEY *ecdsakey = NULL;
-#endif
-#endif
-#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
-    DSA *dsakey = NULL;
-#endif
-
-    if (len < 2)
-        return 0;
+    int rv = 0;

-    /* This only fuzzes the initial flow from the client so far. */
-    ctx = SSL_CTX_new(DTLS_server_method());
-
-    ret = SSL_CTX_set_min_proto_version(ctx, 0);
-    OPENSSL_assert(ret == 1);
-    ret = SSL_CTX_set_cipher_list(ctx, "ALL:eNULL:@SECLEVEL=0");
-    OPENSSL_assert(ret == 1);
-
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-    /* RSA */
     bio_buf = BIO_new(BIO_s_mem());
-    OPENSSL_assert((size_t)BIO_write(bio_buf, RSAPrivateKeyPEM, sizeof(RSAPrivateKeyPEM)) == sizeof(RSAPrivateKeyPEM));
-    privkey = PEM_read_bio_RSAPrivateKey(bio_buf, NULL, NULL, NULL);
-    ERR_print_errors_fp(stderr);
-    OPENSSL_assert(privkey != NULL);
+    if (bio_buf == NULL)
+        return 0;
+    if ((size_t)BIO_write(bio_buf, pem, (int)pem_len) != pem_len) {
+        BIO_free(bio_buf);
+        return 0;
+    }
+    pkey = PEM_read_bio_PrivateKey(bio_buf, NULL, NULL, NULL);
     BIO_free(bio_buf);
-    pkey = EVP_PKEY_new();
-    EVP_PKEY_assign_RSA(pkey, privkey);
-    ret = SSL_CTX_use_PrivateKey(ctx, pkey);
-    OPENSSL_assert(ret == 1);
+    if (pkey == NULL)
+        return 0;
+    if (SSL_CTX_use_PrivateKey(ctx, pkey) == 1)
+        rv = 1;
     EVP_PKEY_free(pkey);
-#endif
+    return rv;
+}
+
+static int use_pem_cert(SSL_CTX *ctx, const void *pem, size_t pem_len)
+{
+    BIO *bio_buf;
+    X509 *cert;
+    int rv = 0;

     bio_buf = BIO_new(BIO_s_mem());
-    OPENSSL_assert((size_t)BIO_write(bio_buf, RSACertificatePEM, sizeof(RSACertificatePEM)) == sizeof(RSACertificatePEM));
+    if (bio_buf == NULL)
+        return 0;
+    if ((size_t)BIO_write(bio_buf, pem, (int)pem_len) != pem_len) {
+        BIO_free(bio_buf);
+        return 0;
+    }
     cert = PEM_read_bio_X509(bio_buf, NULL, NULL, NULL);
     BIO_free(bio_buf);
-    OPENSSL_assert(cert != NULL);
-    ret = SSL_CTX_use_certificate(ctx, cert);
-    OPENSSL_assert(ret == 1);
+    if (cert == NULL)
+        return 0;
+    if (SSL_CTX_use_certificate(ctx, cert) == 1)
+        rv = 1;
     X509_free(cert);
+    return rv;
+}
+
+int FuzzerTestOneInput(const uint8_t *buf, size_t len)
+{
+    SSL *server = NULL;
+    BIO *in;
+    BIO *out;
+    SSL_CTX *ctx;
+
+    if (len < 2 || len > INT_MAX)
+        return 0;
+
+    ctx = SSL_CTX_new(DTLS_server_method());
+    if (ctx == NULL)
+        return 0;
+
+    if (SSL_CTX_set_min_proto_version(ctx, 0) != 1)
+        goto end;
+    if (SSL_CTX_set_cipher_list(ctx, "ALL:eNULL:@SECLEVEL=0") != 1)
+        goto end;
+
+    /* RSA */
+    if (!use_pem_privkey(ctx, RSAPrivateKeyPEM, sizeof(RSAPrivateKeyPEM)))
+        goto end;
+    if (!use_pem_cert(ctx, RSACertificatePEM, sizeof(RSACertificatePEM)))
+        goto end;

 #ifndef OPENSSL_NO_EC
-#ifndef OPENSSL_NO_DEPRECATED_3_0
     /* ECDSA */
-    bio_buf = BIO_new(BIO_s_mem());
-    OPENSSL_assert((size_t)BIO_write(bio_buf, ECDSAPrivateKeyPEM, sizeof(ECDSAPrivateKeyPEM)) == sizeof(ECDSAPrivateKeyPEM));
-    ecdsakey = PEM_read_bio_ECPrivateKey(bio_buf, NULL, NULL, NULL);
-    ERR_print_errors_fp(stderr);
-    OPENSSL_assert(ecdsakey != NULL);
-    BIO_free(bio_buf);
-    pkey = EVP_PKEY_new();
-    EVP_PKEY_assign_EC_KEY(pkey, ecdsakey);
-    ret = SSL_CTX_use_PrivateKey(ctx, pkey);
-    OPENSSL_assert(ret == 1);
-    EVP_PKEY_free(pkey);
-#endif
-    bio_buf = BIO_new(BIO_s_mem());
-    OPENSSL_assert((size_t)BIO_write(bio_buf, ECDSACertPEM, sizeof(ECDSACertPEM)) == sizeof(ECDSACertPEM));
-    cert = PEM_read_bio_X509(bio_buf, NULL, NULL, NULL);
-    OPENSSL_assert(cert != NULL);
-    BIO_free(bio_buf);
-    ret = SSL_CTX_use_certificate(ctx, cert);
-    OPENSSL_assert(ret == 1);
-    X509_free(cert);
+    if (!use_pem_privkey(ctx, ECDSAPrivateKeyPEM, sizeof(ECDSAPrivateKeyPEM)))
+        goto end;
+    if (!use_pem_cert(ctx, ECDSACertPEM, sizeof(ECDSACertPEM)))
+        goto end;
 #endif

-#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
+#ifndef OPENSSL_NO_DSA
     /* DSA */
-    bio_buf = BIO_new(BIO_s_mem());
-    OPENSSL_assert((size_t)BIO_write(bio_buf, DSAPrivateKeyPEM, sizeof(DSAPrivateKeyPEM)) == sizeof(DSAPrivateKeyPEM));
-    dsakey = PEM_read_bio_DSAPrivateKey(bio_buf, NULL, NULL, NULL);
-    ERR_print_errors_fp(stderr);
-    OPENSSL_assert(dsakey != NULL);
-    BIO_free(bio_buf);
-    pkey = EVP_PKEY_new();
-    EVP_PKEY_assign_DSA(pkey, dsakey);
-    ret = SSL_CTX_use_PrivateKey(ctx, pkey);
-    OPENSSL_assert(ret == 1);
-    EVP_PKEY_free(pkey);
-
-    bio_buf = BIO_new(BIO_s_mem());
-    OPENSSL_assert((size_t)BIO_write(bio_buf, DSACertPEM, sizeof(DSACertPEM)) == sizeof(DSACertPEM));
-    cert = PEM_read_bio_X509(bio_buf, NULL, NULL, NULL);
-    OPENSSL_assert(cert != NULL);
-    BIO_free(bio_buf);
-    ret = SSL_CTX_use_certificate(ctx, cert);
-    OPENSSL_assert(ret == 1);
-    X509_free(cert);
+    if (!use_pem_privkey(ctx, DSAPrivateKeyPEM, sizeof(DSAPrivateKeyPEM)))
+        goto end;
+    if (!use_pem_cert(ctx, DSACertPEM, sizeof(DSACertPEM)))
+        goto end;
 #endif

     server = SSL_new(ctx);
+    if (server == NULL)
+        goto end;
     in = BIO_new(BIO_s_mem());
+    if (in == NULL)
+        goto end;
     out = BIO_new(BIO_s_mem());
+    if (out == NULL) {
+        BIO_free(in);
+        goto end;
+    }
     SSL_set_bio(server, in, out);
     SSL_set_accept_state(server);

-    OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
+    if ((size_t)BIO_write(in, buf, (int)len) != len)
+        goto end;

     if (SSL_do_handshake(server) == 1) {
         /* Keep reading application data until error or EOF. */
@@ -904,6 +887,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
             }
         }
     }
+end:
     SSL_free(server);
     ERR_clear_error();
     SSL_CTX_free(ctx);
diff --git a/deps/openssl/openssl/fuzz/echconfiglist_parser.c b/deps/openssl/openssl/fuzz/echconfiglist_parser.c
new file mode 100644
index 00000000000..fce416ec4d8
--- /dev/null
+++ b/deps/openssl/openssl/fuzz/echconfiglist_parser.c
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * https://www.openssl.org/source/license.html
+ * or in the file LICENSE in the source distribution.
+ */
+#include <limits.h>
+#include <openssl/ech.h>
+#include <openssl/err.h>
+#include <openssl/bio.h>
+#include <openssl/crypto.h>
+#include <openssl/e_os2.h>
+#include <openssl/byteorder.h>
+#include "fuzzer.h"
+
+static void parse_one(const uint8_t *buf, int len)
+{
+    OSSL_ECHSTORE *es;
+    BIO *in;
+
+    es = OSSL_ECHSTORE_new(NULL, NULL);
+    if (es == NULL)
+        return;
+
+    in = BIO_new_mem_buf(buf, len);
+    if (in == NULL) {
+        OSSL_ECHSTORE_free(es);
+        return;
+    }
+
+    OSSL_ECHSTORE_read_echconfiglist(es, in);
+
+    OSSL_ECHSTORE_free(es);
+    BIO_free(in);
+}
+
+int FuzzerInitialize(int *argc, char ***argv)
+{
+    return 1;
+}
+
+int FuzzerTestOneInput(const uint8_t *buf, size_t len)
+{
+    uint8_t *fixed_buf = NULL;
+    int bio_len;
+    uint16_t outer_len, inner_len;
+
+    if (len > INT_MAX)
+        return 0;
+    bio_len = (int)len;
+
+    /* Target raw without any fixup */
+    parse_one(buf, bio_len);
+
+    /*
+     * ech_decode_and_flatten has a strict size check:
+     * OSSL_ECH_MIN_ECHCONFIG_LEN = 32
+     * OSSL_ECH_MAX_ECHCONFIG_LEN = 1500
+     */
+    if (len < OSSL_ECH_MIN_ECHCONFIG_LEN || len >= OSSL_ECH_MAX_ECHCONFIG_LEN)
+        goto end;
+    outer_len = (uint16_t)(len - 2);
+    inner_len = (uint16_t)(len - 6);
+
+    fixed_buf = OPENSSL_memdup(buf, len);
+    if (fixed_buf == NULL)
+        goto end;
+
+    /* Fix up to pass initial checks*/
+    OPENSSL_store_u16_be(fixed_buf, outer_len);
+    OPENSSL_store_u16_be(fixed_buf + 2, OSSL_ECH_RFC9849_VERSION);
+    OPENSSL_store_u16_be(fixed_buf + 4, inner_len);
+
+    parse_one(fixed_buf, bio_len);
+
+end:
+    OPENSSL_free(fixed_buf);
+    ERR_clear_error();
+
+    return 0;
+}
+
+void FuzzerCleanup(void)
+{
+}
diff --git a/deps/openssl/openssl/fuzz/hashtable.c b/deps/openssl/openssl/fuzz/hashtable.c
index 5e168aad3e7..2e503cc1a45 100644
--- a/deps/openssl/openssl/fuzz/hashtable.c
+++ b/deps/openssl/openssl/fuzz/hashtable.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -12,6 +12,7 @@
  * Test hashtable operation.
  */
 #include <limits.h>
+#include <stdio.h>
 #include <openssl/err.h>
 #include <openssl/bio.h>
 #include <internal/common.h>
@@ -99,11 +100,11 @@ static void fuzz_free_cb(HT_VALUE *v)

 int FuzzerInitialize(int *argc, char ***argv)
 {
-    HT_CONFIG fuzz_conf = { NULL, fuzz_free_cb, NULL, 0, 1 };
+    HT_CONFIG fuzz_conf = { NULL, fuzz_free_cb, NULL, 0, 1, 0 };

     OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
     ERR_clear_error();
-    prediction_table = OPENSSL_zalloc(sizeof(FUZZER_VALUE) * 65537);
+    prediction_table = OPENSSL_calloc(65537, sizeof(FUZZER_VALUE));
     if (prediction_table == NULL)
         return -1;
     fuzzer_table = ossl_ht_new(&fuzz_conf);
@@ -162,22 +163,11 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
         /* set the proper key value */
         HT_SET_KEY_FIELD(&key, fuzzkey, keyval);

+        memcpy(&valptr->value, &buf[3], sizeof(uint64_t));
+
         /* lock the table */
         ossl_ht_write_lock(fuzzer_table);

-        /*
-         * If the value to insert is already allocated
-         * then we expect a conflict in the insert
-         * i.e. we predict a return code of 0 instead
-         * of 1. On replacement, we expect it to succeed
-         * always
-         */
-        if (valptr->flags & FZ_FLAG_ALLOCATED) {
-            if (!IS_REPLACE(op_flags))
-                rc_prediction = 0;
-        }
-
-        memcpy(&valptr->value, &buf[3], sizeof(uint64_t));
         /*
          * do the insert/replace
          */
@@ -188,30 +178,18 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
             rc = ossl_ht_fz_FUZZER_VALUE_insert(fuzzer_table, TO_HT_KEY(&key),
                 valptr, NULL);

-        if (rc == -1)
-            /* failed to grow the hash table due to too many collisions */
-            break;
-
-        /*
-         * mark the entry as being allocated
-         */
-        valptr->flags |= FZ_FLAG_ALLOCATED;
-
         /*
          * unlock the table
          */
         ossl_ht_write_unlock(fuzzer_table);

         /*
-         * Now check to make sure we did the right thing
-         */
-        OPENSSL_assert(rc == rc_prediction);
-
-        /*
-         * successful insertion if there wasn't a conflict
+         * mark the entry as being allocated
          */
-        if (rc_prediction == 1)
+        if (rc == 1) {
+            valptr->flags |= FZ_FLAG_ALLOCATED;
             IS_REPLACE(op_flags) ? replacements++ : inserts++;
+        }
         break;

     case OP_DELETE:
@@ -226,15 +204,6 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
         /* lock the table */
         ossl_ht_write_lock(fuzzer_table);

-        /*
-         * If the value to delete is not already allocated
-         * then we expect a miss in the delete
-         * i.e. we predict a return code of 0 instead
-         * of 1
-         */
-        if (!(valptr->flags & FZ_FLAG_ALLOCATED))
-            rc_prediction = 0;
-
         /*
          * do the delete
          */
@@ -245,22 +214,10 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
          */
         ossl_ht_write_unlock(fuzzer_table);

-        /*
-         * Now check to make sure we did the right thing
-         */
-        OPENSSL_assert(rc == rc_prediction);
-
-        /*
-         * once the unlock is done, the table rcu will have synced
-         * meaning the free function has run, so we can confirm now
-         * that the valptr is no longer allocated
-         */
-        OPENSSL_assert(!(valptr->flags & FZ_FLAG_ALLOCATED));
-
         /*
          * successful deletion if there wasn't a conflict
          */
-        if (rc_prediction == 1)
+        if (rc == 1)
             deletes++;

         break;
@@ -276,7 +233,8 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
         HT_SET_KEY_FIELD(&key, fuzzkey, keyval);

         /* lock the table for reading */
-        ossl_ht_read_lock(fuzzer_table);
+        if (!ossl_ht_read_lock(fuzzer_table))
+            return 0;

         /*
          * If the value to find is not already allocated
@@ -300,24 +258,22 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
         /*
          * Now check to make sure we did the right thing
          */
-        OPENSSL_assert(lval == valptr);
+        if (valptr == NULL)
+            OPENSSL_assert(lval == NULL);
+        else
+            OPENSSL_assert(lval == NULL || lval == valptr);

         /*
          * if we expect a positive lookup, make sure that
          * we can use the _type and to_value functions
          */
-        if (valptr != NULL) {
+        if (valptr != NULL && lval != NULL) {
             OPENSSL_assert(ossl_ht_fz_FUZZER_VALUE_type(v) == 1);

             v = ossl_ht_fz_FUZZER_VALUE_to_value(lval, &tv);
             OPENSSL_assert(v->value == lval);
-        }
-
-        /*
-         * successful lookup if we didn't expect a miss
-         */
-        if (valptr != NULL)
             lookups++;
+        }

         break;

@@ -335,17 +291,17 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
          * lock the table
          */
         ossl_ht_write_lock(fuzzer_table);
-        ossl_ht_flush(fuzzer_table);
+        rc = ossl_ht_flush(fuzzer_table);
         ossl_ht_write_unlock(fuzzer_table);

         /*
          * now check to make sure everything is free
          */
-        for (i = 0; i < USHRT_MAX; i++)
-            OPENSSL_assert((prediction_table[i].flags & FZ_FLAG_ALLOCATED) == 0);
-
-        /* good flush */
-        flushes++;
+        if (rc == 1) {
+            for (i = 0; i < USHRT_MAX; i++)
+                OPENSSL_assert((prediction_table[i].flags & FZ_FLAG_ALLOCATED) == 0);
+            flushes++;
+        }
         break;

     case OP_FOREACH:
@@ -371,11 +327,11 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
             rc_prediction = 1;

         htvlist = ossl_ht_filter(fuzzer_table, 1, filter_iterator, &keyval);
-
-        OPENSSL_assert(htvlist->list_len == (size_t)rc_prediction);
-
-        ossl_ht_value_list_free(htvlist);
-        filters++;
+        if (htvlist != NULL) {
+            OPENSSL_assert(htvlist->list_len == (size_t)rc_prediction);
+            ossl_ht_value_list_free(htvlist);
+            filters++;
+        }
         break;

     default:
@@ -389,5 +345,11 @@ void FuzzerCleanup(void)
 {
     ossl_ht_free(fuzzer_table);
     OPENSSL_free(prediction_table);
+
+    fprintf(stderr, "skipped_values: %zu inserts: %zu replacements: %zu deletes %zu\n"
+                    "flushes: %zu lookups: %zu foreaches %zu filters %zu\n",
+        skipped_values, inserts, replacements, deletes,
+        flushes, lookups, foreaches, filters);
+
     OPENSSL_cleanup();
 }
diff --git a/deps/openssl/openssl/fuzz/ml-dsa.c b/deps/openssl/openssl/fuzz/ml-dsa.c
index fdede95772e..efd65185bda 100644
--- a/deps/openssl/openssl/fuzz/ml-dsa.c
+++ b/deps/openssl/openssl/fuzz/ml-dsa.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -198,7 +198,7 @@ static void create_ml_dsa_raw_key(uint8_t **buf, size_t *len,
      * typically much less (between 1 and 100 bytes) so use RAND_bytes here
      * instead
      */
-    if (!RAND_bytes(key, keylen))
+    if (!RAND_bytes(key, (int)keylen))
         return;

     /*
@@ -254,6 +254,10 @@ static int keygen_ml_dsa_real_key_helper(uint8_t **buf, size_t *len,

     ret = 1;
 err:
+    if (!ret) {
+        EVP_PKEY_free(*key);
+        *key = NULL;
+    }
     EVP_PKEY_CTX_free(ctx);
     return ret;
 }
@@ -659,7 +663,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     /* And run our setup/doit/cleanup sequence */
     if (ops[operation].setup != NULL)
         ops[operation].setup(&buffer_cursor, &len, &in1, &in2);
-    if (ops[operation].doit != NULL)
+    if (ops[operation].doit != NULL && in1 != NULL)
         ops[operation].doit(&buffer_cursor, &len, in1, in2, &out1, &out2);
     if (ops[operation].cleanup != NULL)
         ops[operation].cleanup(in1, in2, out1, out2);
diff --git a/deps/openssl/openssl/fuzz/ml-kem.c b/deps/openssl/openssl/fuzz/ml-kem.c
index a3184e8f321..b74bfbfa98a 100644
--- a/deps/openssl/openssl/fuzz/ml-kem.c
+++ b/deps/openssl/openssl/fuzz/ml-kem.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -166,7 +166,7 @@ static void create_mlkem_raw_key(uint8_t **buf, size_t *len,
      * buffers, but its typically much less (between 1 and 100 bytes)
      * so use RAND_bytes here instead
      */
-    if (!RAND_bytes(key, keylen))
+    if (!RAND_bytes(key, (int)keylen))
         return;

     /*
@@ -289,7 +289,7 @@ static void mlkem_encap_decap(uint8_t **buf, size_t *len, void *key1, void *in2,
         goto err;
     }

-    if (!RAND_bytes(genkey, genkey_len))
+    if (!RAND_bytes(genkey, (int)genkey_len))
         goto err;

     if (EVP_PKEY_encapsulate(ctx, wrapkey, &wrapkey_len, genkey, &genkey_len) <= 0) {
@@ -650,7 +650,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
      */
     if (ops[operation].setup != NULL)
         ops[operation].setup(&buffer_cursor, &len, &in1, &in2);
-    if (ops[operation].doit != NULL)
+    if (ops[operation].doit != NULL && in1 != NULL)
         ops[operation].doit(&buffer_cursor, &len, in1, in2, &out1, &out2);
     if (ops[operation].cleanup != NULL)
         ops[operation].cleanup(in1, in2, out1, out2);
diff --git a/deps/openssl/openssl/fuzz/oids.txt b/deps/openssl/openssl/fuzz/oids.txt
index 307e92ea513..f4c1979113c 100644
--- a/deps/openssl/openssl/fuzz/oids.txt
+++ b/deps/openssl/openssl/fuzz/oids.txt
@@ -1,7 +1,7 @@
 # WARNING: do not edit!
 # Generated by fuzz/mkfuzzoids.pl
 #
-# Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -1344,3 +1344,11 @@ OBJ_SLH_DSA_SHAKE_192s_WITH_SHAKE256="\x60\x86\x48\x01\x65\x03\x04\x03\x2B"
 OBJ_SLH_DSA_SHAKE_192f_WITH_SHAKE256="\x60\x86\x48\x01\x65\x03\x04\x03\x2C"
 OBJ_SLH_DSA_SHAKE_256s_WITH_SHAKE256="\x60\x86\x48\x01\x65\x03\x04\x03\x2D"
 OBJ_SLH_DSA_SHAKE_256f_WITH_SHAKE256="\x60\x86\x48\x01\x65\x03\x04\x03\x2E"
+OBJ_HKDF_SHA256="\x2A\x86\x48\x86\xF7\x0D\x01\x09\x10\x03\x1C"
+OBJ_HKDF_SHA384="\x2A\x86\x48\x86\xF7\x0D\x01\x09\x10\x03\x1D"
+OBJ_HKDF_SHA512="\x2A\x86\x48\x86\xF7\x0D\x01\x09\x10\x03\x1E"
+OBJ_id_smime_ori="\x2A\x86\x48\x86\xF7\x0D\x01\x09\x10\x0D"
+OBJ_id_smime_ori_kem="\x2A\x86\x48\x86\xF7\x0D\x01\x09\x10\x0D\x03"
+OBJ_id_alg_hss_lms_hashsig="\x2A\x86\x48\x86\xF7\x0D\x01\x09\x10\x03\x11"
+OBJ_id_rdna_unsigned="\x2B\x06\x01\x05\x05\x07\x19\x01"
+OBJ_id_alg_unsigned="\x2B\x06\x01\x05\x05\x07\x06\x24"
diff --git a/deps/openssl/openssl/fuzz/pem.c b/deps/openssl/openssl/fuzz/pem.c
index 79c49041e45..cedd688b521 100644
--- a/deps/openssl/openssl/fuzz/pem.c
+++ b/deps/openssl/openssl/fuzz/pem.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,15 +27,23 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     unsigned char *data = NULL;
     long outlen;

-    if (len <= 1)
+    if (len <= 1 || len > INT_MAX)
         return 0;

     in = BIO_new(BIO_s_mem());
-    OPENSSL_assert((size_t)BIO_write(in, buf + 1, len - 1) == len - 1);
+    if (in == NULL) {
+        ERR_clear_error();
+        return 0;
+    }
+    if ((size_t)BIO_write(in, buf + 1, (int)(len - 1)) != len - 1) {
+        BIO_free(in);
+        ERR_clear_error();
+        return 0;
+    }
     if (PEM_read_bio_ex(in, &name, &header, &data, &outlen, buf[0]) == 1) {
         /* Try to read all the data we get to see if allocated properly. */
-        BIO_write(in, name, strlen(name));
-        BIO_write(in, header, strlen(header));
+        BIO_write(in, name, (int)strlen(name));
+        BIO_write(in, header, (int)strlen(header));
         BIO_write(in, data, outlen);
     }
     if (buf[0] & PEM_FLAG_SECURE) {
diff --git a/deps/openssl/openssl/fuzz/pkcs12.c b/deps/openssl/openssl/fuzz/pkcs12.c
new file mode 100644
index 00000000000..74e2b6dd8aa
--- /dev/null
+++ b/deps/openssl/openssl/fuzz/pkcs12.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * https://www.openssl.org/source/license.html
+ * or in the file LICENSE in the source distribution.
+ */
+
+/*
+ * Test PKCS12 parsing with fuzzed input.
+ */
+
+#include <openssl/bio.h>
+#include <openssl/err.h>
+#include <openssl/pkcs12.h>
+#include <openssl/x509.h>
+#include "fuzzer.h"
+
+int FuzzerInitialize(int *argc, char ***argv)
+{
+    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
+    ERR_clear_error();
+    CRYPTO_free_ex_index(0, -1);
+
+    return 1;
+}
+
+int FuzzerTestOneInput(const uint8_t *buf, size_t len)
+{
+    PKCS12 *p12;
+    BIO *in;
+    EVP_PKEY *pkey = NULL;
+    X509 *cert = NULL;
+    STACK_OF(X509) *ca = NULL;
+
+    if (len == 0 || len > INT_MAX)
+        return 0;
+
+    in = BIO_new(BIO_s_mem());
+    if (in == NULL) {
+        ERR_clear_error();
+        return 0;
+    }
+    if ((size_t)BIO_write(in, buf, (int)len) != len) {
+        BIO_free(in);
+        ERR_clear_error();
+        return 0;
+    }
+    p12 = d2i_PKCS12_bio(in, NULL);
+    if (p12 != NULL) {
+        PKCS12_verify_mac(p12, NULL, 0);
+        PKCS12_verify_mac(p12, "", 0);
+
+        PKCS12_parse(p12, NULL, &pkey, &cert, &ca);
+        EVP_PKEY_free(pkey);
+        X509_free(cert);
+        OSSL_STACK_OF_X509_free(ca);
+
+        pkey = NULL;
+        cert = NULL;
+        ca = NULL;
+        PKCS12_parse(p12, "", &pkey, &cert, &ca);
+        EVP_PKEY_free(pkey);
+        X509_free(cert);
+        OSSL_STACK_OF_X509_free(ca);
+
+        PKCS12_free(p12);
+    }
+
+    BIO_free(in);
+    ERR_clear_error();
+
+    return 0;
+}
+
+void FuzzerCleanup(void)
+{
+}
diff --git a/deps/openssl/openssl/fuzz/pkcs7_verify.c b/deps/openssl/openssl/fuzz/pkcs7_verify.c
new file mode 100644
index 00000000000..a167afb13dd
--- /dev/null
+++ b/deps/openssl/openssl/fuzz/pkcs7_verify.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * https://www.openssl.org/source/license.html
+ * or in the file LICENSE in the source distribution.
+ */
+#include <limits.h>
+#include <openssl/bio.h>
+#include <openssl/err.h>
+#include <openssl/pkcs7.h>
+#include "fuzzer.h"
+
+int FuzzerInitialize(int *argc, char ***argv)
+{
+    return 1;
+}
+
+int FuzzerTestOneInput(const uint8_t *buf, size_t len)
+{
+    BIO *indata = NULL;
+    BIO *out = NULL;
+    PKCS7 *p7 = NULL;
+    const unsigned char *in;
+    size_t consumed;
+    size_t remaining;
+
+    if (len > LONG_MAX)
+        return 0;
+
+    in = buf;
+    p7 = d2i_PKCS7(NULL, &in, (long)len);
+    if (p7 == NULL)
+        goto err;
+
+    consumed = (size_t)(in - buf);
+    remaining = len - consumed;
+    if (remaining > INT_MAX)
+        goto err;
+
+    if (consumed < len) {
+        indata = BIO_new_mem_buf(in, (int)remaining);
+        if (indata == NULL)
+            goto err;
+    }
+
+    out = BIO_new(BIO_s_null());
+    if (out == NULL)
+        goto err;
+
+    PKCS7_verify(p7, NULL, NULL, indata, out, PKCS7_NOVERIFY);
+
+err:
+    BIO_free(out);
+    PKCS7_free(p7);
+    BIO_free(indata);
+    ERR_clear_error();
+    return 0;
+}
+
+void FuzzerCleanup(void)
+{
+}
diff --git a/deps/openssl/openssl/fuzz/provider.c b/deps/openssl/openssl/fuzz/provider.c
index 69905223fbb..bc45489a2f0 100644
--- a/deps/openssl/openssl/fuzz/provider.c
+++ b/deps/openssl/openssl/fuzz/provider.c
@@ -115,6 +115,10 @@ static int read_uint(const uint8_t **buf, size_t *len, uint64_t **res)
     }

     *res = OPENSSL_malloc(sizeof(uint64_t));
+    if (*res == NULL) {
+        r = 0;
+        goto end;
+    }
     **res = (uint64_t)**buf;

     *buf += sizeof(uint64_t);
@@ -133,6 +137,10 @@ static int read_int(const uint8_t **buf, size_t *len, int64_t **res)
     }

     *res = OPENSSL_malloc(sizeof(int64_t));
+    if (*res == NULL) {
+        r = 0;
+        goto end;
+    }
     **res = (int64_t)**buf;

     *buf += sizeof(int64_t);
@@ -151,6 +159,10 @@ static int read_double(const uint8_t **buf, size_t *len, double **res)
     }

     *res = OPENSSL_malloc(sizeof(double));
+    if (*res == NULL) {
+        r = 0;
+        goto end;
+    }
     **res = (double)**buf;

     *buf += sizeof(double);
@@ -217,7 +229,7 @@ static int read_octet_string(const uint8_t **buf, size_t *len, char **res)

     *res = (char *)*buf;

-    r = ptr - *buf;
+    r = (int)(ptr - *buf);
     *len -= r;
     *buf = ptr;

@@ -272,7 +284,9 @@ static OSSL_PARAM *fuzz_params(OSSL_PARAM *param, const uint8_t **buf, size_t *l
     for (p = param; p != NULL && p->key != NULL; p++)
         p_num++;

-    fuzzed_parameters = OPENSSL_zalloc(sizeof(OSSL_PARAM) * (p_num + 1));
+    fuzzed_parameters = OPENSSL_calloc(p_num + 1, sizeof(OSSL_PARAM));
+    if (fuzzed_parameters == NULL)
+        return NULL;
     p = fuzzed_parameters;

     for (; param != NULL && param->key != NULL; param++) {
@@ -289,6 +303,11 @@ static OSSL_PARAM *fuzz_params(OSSL_PARAM *param, const uint8_t **buf, size_t *l

         if (!read_int(buf, len, &use_param)) {
             use_param = OPENSSL_malloc(sizeof(uint64_t));
+            if (use_param == NULL) {
+                free_params(fuzzed_parameters);
+                OPENSSL_free(fuzzed_parameters);
+                return NULL;
+            }
             *use_param = 0;
         }

@@ -296,18 +315,48 @@ static OSSL_PARAM *fuzz_params(OSSL_PARAM *param, const uint8_t **buf, size_t *l
         case OSSL_PARAM_INTEGER:
             if (strcmp(param->key, OSSL_KDF_PARAM_ITER) == 0) {
                 p_value_int = OPENSSL_malloc(sizeof(ITERS));
+                if (p_value_int == NULL) {
+                    free_params(fuzzed_parameters);
+                    OPENSSL_free(fuzzed_parameters);
+                    OPENSSL_free(use_param);
+                    return NULL;
+                }
                 *p_value_int = ITERS;
             } else if (strcmp(param->key, OSSL_KDF_PARAM_SCRYPT_N) == 0) {
                 p_value_int = OPENSSL_malloc(sizeof(ITERS));
+                if (p_value_int == NULL) {
+                    free_params(fuzzed_parameters);
+                    OPENSSL_free(fuzzed_parameters);
+                    OPENSSL_free(use_param);
+                    return NULL;
+                }
                 *p_value_int = ITERS;
             } else if (strcmp(param->key, OSSL_KDF_PARAM_SCRYPT_R) == 0) {
                 p_value_int = OPENSSL_malloc(sizeof(BLOCKSIZE));
+                if (p_value_int == NULL) {
+                    free_params(fuzzed_parameters);
+                    OPENSSL_free(fuzzed_parameters);
+                    OPENSSL_free(use_param);
+                    return NULL;
+                }
                 *p_value_int = BLOCKSIZE;
             } else if (strcmp(param->key, OSSL_KDF_PARAM_SCRYPT_P) == 0) {
                 p_value_int = OPENSSL_malloc(sizeof(BLOCKSIZE));
+                if (p_value_int == NULL) {
+                    free_params(fuzzed_parameters);
+                    OPENSSL_free(fuzzed_parameters);
+                    OPENSSL_free(use_param);
+                    return NULL;
+                }
                 *p_value_int = BLOCKSIZE;
             } else if (!*use_param || !read_int(buf, len, &p_value_int)) {
                 p_value_int = OPENSSL_malloc(sizeof(int64_t));
+                if (p_value_int == NULL) {
+                    free_params(fuzzed_parameters);
+                    OPENSSL_free(fuzzed_parameters);
+                    OPENSSL_free(use_param);
+                    return NULL;
+                }
                 *p_value_int = 0;
             }

@@ -318,18 +367,48 @@ static OSSL_PARAM *fuzz_params(OSSL_PARAM *param, const uint8_t **buf, size_t *l
         case OSSL_PARAM_UNSIGNED_INTEGER:
             if (strcmp(param->key, OSSL_KDF_PARAM_ITER) == 0) {
                 p_value_uint = OPENSSL_malloc(sizeof(UITERS));
+                if (p_value_uint == NULL) {
+                    free_params(fuzzed_parameters);
+                    OPENSSL_free(fuzzed_parameters);
+                    OPENSSL_free(use_param);
+                    return NULL;
+                }
                 *p_value_uint = UITERS;
             } else if (strcmp(param->key, OSSL_KDF_PARAM_SCRYPT_N) == 0) {
                 p_value_uint = OPENSSL_malloc(sizeof(UITERS));
+                if (p_value_uint == NULL) {
+                    free_params(fuzzed_parameters);
+                    OPENSSL_free(fuzzed_parameters);
+                    OPENSSL_free(use_param);
+                    return NULL;
+                }
                 *p_value_uint = UITERS;
             } else if (strcmp(param->key, OSSL_KDF_PARAM_SCRYPT_R) == 0) {
                 p_value_uint = OPENSSL_malloc(sizeof(UBLOCKSIZE));
+                if (p_value_uint == NULL) {
+                    free_params(fuzzed_parameters);
+                    OPENSSL_free(fuzzed_parameters);
+                    OPENSSL_free(use_param);
+                    return NULL;
+                }
                 *p_value_uint = UBLOCKSIZE;
             } else if (strcmp(param->key, OSSL_KDF_PARAM_SCRYPT_P) == 0) {
                 p_value_uint = OPENSSL_malloc(sizeof(UBLOCKSIZE));
+                if (p_value_uint == NULL) {
+                    free_params(fuzzed_parameters);
+                    OPENSSL_free(fuzzed_parameters);
+                    OPENSSL_free(use_param);
+                    return NULL;
+                }
                 *p_value_uint = UBLOCKSIZE;
             } else if (!*use_param || !read_uint(buf, len, &p_value_uint)) {
                 p_value_uint = OPENSSL_malloc(sizeof(uint64_t));
+                if (p_value_uint == NULL) {
+                    free_params(fuzzed_parameters);
+                    OPENSSL_free(fuzzed_parameters);
+                    OPENSSL_free(use_param);
+                    return NULL;
+                }
                 *p_value_uint = 0;
             }

@@ -340,6 +419,12 @@ static OSSL_PARAM *fuzz_params(OSSL_PARAM *param, const uint8_t **buf, size_t *l
         case OSSL_PARAM_REAL:
             if (!*use_param || !read_double(buf, len, &p_value_double)) {
                 p_value_double = OPENSSL_malloc(sizeof(double));
+                if (p_value_double == NULL) {
+                    free_params(fuzzed_parameters);
+                    OPENSSL_free(fuzzed_parameters);
+                    OPENSSL_free(use_param);
+                    return NULL;
+                }
                 *p_value_double = 0;
             }

@@ -393,41 +478,57 @@ static int do_evp_cipher(const EVP_CIPHER *evp_cipher, const OSSL_PARAM param[])
 {
     unsigned char outbuf[1024];
     int outlen, tmplen;
-    unsigned char key[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
-    unsigned char iv[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
+    int key_len = EVP_CIPHER_get_key_length(evp_cipher);
+    int iv_len = EVP_CIPHER_get_iv_length(evp_cipher);
+    unsigned char *key = NULL, *iv = NULL;
     const char intext[] = "text";
-    EVP_CIPHER_CTX *ctx;
+    EVP_CIPHER_CTX *ctx = NULL;
+    int i;
+
+    if (key_len <= 0)
+        key_len = 16;
+    if (iv_len <= 0)
+        iv_len = 16;
+
+    key = OPENSSL_zalloc(key_len);
+    iv = OPENSSL_zalloc(iv_len);
+    if (key == NULL || iv == NULL)
+        goto err;
+    for (i = 0; i < key_len; i++)
+        key[i] = (unsigned char)i;
+    for (i = 0; i < iv_len; i++)
+        iv[i] = (unsigned char)(i + 1);

     ctx = EVP_CIPHER_CTX_new();
+    if (ctx == NULL)
+        goto err;

-    if (!EVP_CIPHER_CTX_set_params(ctx, param)) {
-        EVP_CIPHER_CTX_free(ctx);
-        return 0;
-    }
+    if (!EVP_EncryptInit_ex2(ctx, evp_cipher, key, iv, NULL))
+        goto err;

-    if (!EVP_EncryptInit_ex2(ctx, evp_cipher, key, iv, NULL)) {
-        /* Error */
-        EVP_CIPHER_CTX_free(ctx);
-        return 0;
-    }
+    if (!EVP_CIPHER_CTX_set_params(ctx, param))
+        goto err;

-    if (!EVP_EncryptUpdate(ctx, outbuf, &outlen, (const unsigned char *)intext, strlen(intext))) {
-        /* Error */
-        EVP_CIPHER_CTX_free(ctx);
-        return 0;
-    }
+    if (!EVP_EncryptUpdate(ctx, outbuf, &outlen, (const unsigned char *)intext,
+            (int)strlen(intext)))
+        goto err;
     /*
      * Buffer passed to EVP_EncryptFinal() must be after data just
      * encrypted to avoid overwriting it.
      */
-    if (!EVP_EncryptFinal_ex(ctx, outbuf + outlen, &tmplen)) {
-        /* Error */
-        EVP_CIPHER_CTX_free(ctx);
-        return 0;
-    }
+    if (!EVP_EncryptFinal_ex(ctx, outbuf + outlen, &tmplen))
+        goto err;
     outlen += tmplen;
     EVP_CIPHER_CTX_free(ctx);
+    OPENSSL_free(key);
+    OPENSSL_free(iv);
     return 1;
+
+err:
+    EVP_CIPHER_CTX_free(ctx);
+    OPENSSL_free(key);
+    OPENSSL_free(iv);
+    return 0;
 }

 static int do_evp_kdf(EVP_KDF *evp_kdf, const OSSL_PARAM params[])
@@ -557,12 +658,12 @@ static int do_evp_md(EVP_MD *evp_md, const OSSL_PARAM params[])
         goto end;
     }

-    if (!EVP_MD_CTX_set_params(mdctx, params)) {
+    if (!EVP_DigestInit_ex2(mdctx, evp_md, NULL)) {
         r = 0;
         goto end;
     }

-    if (!EVP_DigestInit_ex2(mdctx, evp_md, NULL)) {
+    if (!EVP_MD_CTX_set_params(mdctx, params)) {
         r = 0;
         goto end;
     }
diff --git a/deps/openssl/openssl/fuzz/quic-client.c b/deps/openssl/openssl/fuzz/quic-client.c
index 42716148e25..00238998c7a 100644
--- a/deps/openssl/openssl/fuzz/quic-client.c
+++ b/deps/openssl/openssl/fuzz/quic-client.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,9 +16,6 @@
 #include "internal/time.h"
 #include "internal/quic_ssl.h"

-/* unused, to avoid warning. */
-static int idx;
-
 static OSSL_TIME fake_now;

 static OSSL_TIME fake_now_cb(void *arg)
@@ -35,7 +32,9 @@ int FuzzerInitialize(int *argc, char ***argv)
     OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL);
     ERR_clear_error();
     CRYPTO_free_ex_index(0, -1);
-    idx = SSL_get_ex_data_X509_STORE_CTX_idx();
+    if (SSL_get_ex_data_X509_STORE_CTX_idx() == 0) {
+        /* Just suppress warning */
+    }
     comp_methods = SSL_COMP_get_compression_methods();
     if (comp_methods != NULL)
         sk_SSL_COMP_sort(comp_methods);
@@ -77,6 +76,8 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     if (client == NULL)
         goto end;

+    allstreams[0] = stream = client;
+
     fake_now = ossl_ms2time(1);
     if (!ossl_quic_set_override_now_cb(client, fake_now_cb, NULL))
         goto end;
@@ -90,7 +91,8 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     if (!BIO_ADDR_rawmake(peer_addr, AF_INET, &ina, sizeof(ina), htons(4433)))
         goto end;

-    SSL_set_tlsext_host_name(client, "localhost");
+    if (SSL_set_tlsext_host_name(client, "localhost") != 1)
+        goto end;
     in = BIO_new(BIO_s_dgram_mem());
     if (in == NULL)
         goto end;
@@ -116,7 +118,6 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
             0))
         goto end;

-    allstreams[0] = stream = client;
     for (;;) {
         size_t size;
         uint64_t nxtpktms = 0;
@@ -249,7 +250,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
             break;

         if (size > 0)
-            BIO_write(in, buf + 2, size);
+            BIO_write(in, buf + 2, (int)size);
         len -= size + 2;
         buf += size + 2;
     }
diff --git a/deps/openssl/openssl/fuzz/quic-server.c b/deps/openssl/openssl/fuzz/quic-server.c
index d9677b826f5..2583c94439a 100644
--- a/deps/openssl/openssl/fuzz/quic-server.c
+++ b/deps/openssl/openssl/fuzz/quic-server.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,9 +16,6 @@
 #include "internal/time.h"
 #include "internal/quic_ssl.h"

-/* unused, to avoid warning. */
-static int idx;
-
 static OSSL_TIME fake_now;

 static OSSL_TIME fake_now_cb(void *arg)
@@ -35,7 +32,9 @@ int FuzzerInitialize(int *argc, char ***argv)
     OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL);
     ERR_clear_error();
     CRYPTO_free_ex_index(0, -1);
-    idx = SSL_get_ex_data_X509_STORE_CTX_idx();
+    if (SSL_get_ex_data_X509_STORE_CTX_idx() == 0) {
+        /* Just suppress warning */
+    }
     comp_methods = SSL_COMP_get_compression_methods();
     if (comp_methods != NULL)
         sk_SSL_COMP_sort(comp_methods);
@@ -239,7 +238,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
             break;

         if (size > 0)
-            BIO_write(in, buf + 2, size);
+            BIO_write(in, buf + 2, (int)size);
         len -= size + 2;
         buf += size + 2;
     }
diff --git a/deps/openssl/openssl/fuzz/quic-srtm.c b/deps/openssl/openssl/fuzz/quic-srtm.c
index a7897da7103..9ab365d22d2 100644
--- a/deps/openssl/openssl/fuzz/quic-srtm.c
+++ b/deps/openssl/openssl/fuzz/quic-srtm.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -77,9 +77,9 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
                     sizeof(arg_token.token)))
                 continue; /* just stop */

-            ossl_quic_srtm_add(srtm, (void *)(uintptr_t)arg_opaque,
-                arg_seq_num, &arg_token);
-            ossl_quic_srtm_check(srtm);
+            if (ossl_quic_srtm_add(srtm, (void *)(uintptr_t)arg_opaque,
+                    arg_seq_num, &arg_token))
+                ossl_quic_srtm_check(srtm);
             break;

         case CMD_REMOVE:
@@ -87,17 +87,17 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
                 || !PACKET_get_net_8(&pkt, &arg_seq_num))
                 continue; /* just stop */

-            ossl_quic_srtm_remove(srtm, (void *)(uintptr_t)arg_opaque,
-                arg_seq_num);
-            ossl_quic_srtm_check(srtm);
+            if (ossl_quic_srtm_remove(srtm, (void *)(uintptr_t)arg_opaque,
+                    arg_seq_num, NULL))
+                ossl_quic_srtm_check(srtm);
             break;

         case CMD_CULL:
             if (!PACKET_get_net_8(&pkt, &arg_opaque))
                 continue; /* just stop */

-            ossl_quic_srtm_cull(srtm, (void *)(uintptr_t)arg_opaque);
-            ossl_quic_srtm_check(srtm);
+            if (ossl_quic_srtm_cull(srtm, (void *)(uintptr_t)arg_opaque))
+                ossl_quic_srtm_check(srtm);
             break;

         case CMD_LOOKUP:
@@ -106,9 +106,9 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
                 || !PACKET_get_net_8(&pkt, &arg_idx))
                 continue; /* just stop */

-            ossl_quic_srtm_lookup(srtm, &arg_token, (size_t)arg_idx,
-                NULL, NULL);
-            ossl_quic_srtm_check(srtm);
+            if (ossl_quic_srtm_lookup(srtm, &arg_token, (size_t)arg_idx,
+                    NULL, NULL))
+                ossl_quic_srtm_check(srtm);
             break;

         default:
diff --git a/deps/openssl/openssl/fuzz/server.c b/deps/openssl/openssl/fuzz/server.c
index 550e07d893a..a06d872d1d0 100644
--- a/deps/openssl/openssl/fuzz/server.c
+++ b/deps/openssl/openssl/fuzz/server.c
@@ -25,6 +25,7 @@
 #include <openssl/err.h>
 #include "fuzzer.h"

+#ifndef OPENSSL_NO_DEPRECATED_3_0
 static const uint8_t kCertificateDER[] = {
     0x30, 0x82, 0x02, 0xff, 0x30, 0x82, 0x01, 0xe7,
     0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x11, 0x00,
@@ -125,7 +126,6 @@ static const uint8_t kCertificateDER[] = {
     0x76, 0x8a, 0xbb
 };

-#ifndef OPENSSL_NO_DEPRECATED_3_0
 static const uint8_t kRSAPrivateKeyDER[] = {
     0x30, 0x82, 0x04, 0xa5, 0x02, 0x01, 0x00, 0x02,
     0x82, 0x01, 0x01, 0x00, 0xce, 0x47, 0xcb, 0x11,
@@ -281,7 +281,6 @@ static const uint8_t kRSAPrivateKeyDER[] = {
 #endif

 #ifndef OPENSSL_NO_EC
-#ifndef OPENSSL_NO_DEPRECATED_3_0
 /*
  *  -----BEGIN EC PRIVATE KEY-----
  *  MHcCAQEEIJLyl7hJjpQL/RhP1x2zS79xdiPJQB683gWeqcqHPeZkoAoGCCqGSM49
@@ -310,7 +309,6 @@ static const char ECDSAPrivateKeyPEM[] = {
     0x4e, 0x44, 0x20, 0x45, 0x43, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54,
     0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a
 };
-#endif

 /*
  * -----BEGIN CERTIFICATE-----
@@ -373,7 +371,7 @@ static const char ECDSACertPEM[] = {
 };
 #endif

-#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
+#ifndef OPENSSL_NO_DSA
 /*
  * -----BEGIN DSA PRIVATE KEY-----
  * MIIBuwIBAAKBgQDdkFKzNABLOha7Eqj7004+p5fhtR6bxpujToMmSZTYi8igVVXP
@@ -553,9 +551,6 @@ static const char DSACertPEM[] = {
 };
 #endif

-/* unused, to avoid warning. */
-static int idx;
-
 #define FUZZTIME 1485898104

 #define TIME_IMPL(t)       \
@@ -585,7 +580,9 @@ time_t time(time_t *t) TIME_IMPL(t)
     OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL);
     ERR_clear_error();
     CRYPTO_free_ex_index(0, -1);
-    idx = SSL_get_ex_data_X509_STORE_CTX_idx();
+    if (SSL_get_ex_data_X509_STORE_CTX_idx() == 0) {
+        /* Just suppress warning */
+    }
     comp_methods = SSL_COMP_get_compression_methods();
     if (comp_methods != NULL)
         sk_SSL_COMP_sort(comp_methods);
@@ -593,130 +590,155 @@ time_t time(time_t *t) TIME_IMPL(t)
     return 1;
 }

+#if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DSA)
+static int use_pem_privkey(SSL_CTX *ctx, const void *pem, size_t pem_len)
+{
+    BIO *bio_buf;
+    EVP_PKEY *pkey;
+    int rv = 0;
+
+    bio_buf = BIO_new(BIO_s_mem());
+    if (bio_buf == NULL)
+        return 0;
+    if ((size_t)BIO_write(bio_buf, pem, (int)pem_len) != pem_len) {
+        BIO_free(bio_buf);
+        return 0;
+    }
+    pkey = PEM_read_bio_PrivateKey(bio_buf, NULL, NULL, NULL);
+    BIO_free(bio_buf);
+    if (pkey == NULL)
+        return 0;
+    if (SSL_CTX_use_PrivateKey(ctx, pkey) == 1)
+        rv = 1;
+    EVP_PKEY_free(pkey);
+    return rv;
+}
+
+static int use_pem_cert(SSL_CTX *ctx, const void *pem, size_t pem_len)
+{
+    BIO *bio_buf;
+    X509 *cert;
+    int rv = 0;
+
+    bio_buf = BIO_new(BIO_s_mem());
+    if (bio_buf == NULL)
+        return 0;
+    if ((size_t)BIO_write(bio_buf, pem, (int)pem_len) != pem_len) {
+        BIO_free(bio_buf);
+        return 0;
+    }
+    cert = PEM_read_bio_X509(bio_buf, NULL, NULL, NULL);
+    BIO_free(bio_buf);
+    if (cert == NULL)
+        return 0;
+    if (SSL_CTX_use_certificate(ctx, cert) == 1)
+        rv = 1;
+    X509_free(cert);
+    return rv;
+}
+#endif
+
 int FuzzerTestOneInput(const uint8_t *buf, size_t len)
 {
-    SSL *server;
+    SSL *server = NULL;
     BIO *in;
     BIO *out;
-#if !defined(OPENSSL_NO_EC) \
-    || (!defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0))
-    BIO *bio_buf;
-#endif
     SSL_CTX *ctx;
-    int ret;
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-    RSA *privkey;
-#endif
     const uint8_t *bufp;
-#if !defined(OPENSSL_NO_DEPRECATED_3_0)
-    EVP_PKEY *pkey;
-#endif
-    X509 *cert;
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-#ifndef OPENSSL_NO_EC
-    EC_KEY *ecdsakey = NULL;
-#endif
-#endif
-#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
-    DSA *dsakey = NULL;
+    RSA *privkey = NULL;
+    EVP_PKEY *pkey = NULL;
+    X509 *cert = NULL;
 #endif
     uint8_t opt;
+    int ret;

-    if (len < 2)
+    if (len < 2 || len > INT_MAX)
         return 0;

-    /* This only fuzzes the initial flow from the client so far. */
-    ctx = SSL_CTX_new(SSLv23_method());
-
-    ret = SSL_CTX_set_min_proto_version(ctx, 0);
-    OPENSSL_assert(ret == 1);
-    ret = SSL_CTX_set_cipher_list(ctx, "ALL:eNULL:@SECLEVEL=0");
-    OPENSSL_assert(ret == 1);
+    ctx = SSL_CTX_new(TLS_method());
+    if (ctx == NULL)
+        return 0;
+    if (SSL_CTX_set_min_proto_version(ctx, 0) != 1)
+        goto end;
+    if (SSL_CTX_set_cipher_list(ctx, "ALL:eNULL:@SECLEVEL=0") != 1)
+        goto end;

 #ifndef OPENSSL_NO_DEPRECATED_3_0
     /* RSA */
     bufp = kRSAPrivateKeyDER;
     privkey = d2i_RSAPrivateKey(NULL, &bufp, sizeof(kRSAPrivateKeyDER));
-    OPENSSL_assert(privkey != NULL);
+    if (privkey == NULL)
+        goto end;
     pkey = EVP_PKEY_new();
-    EVP_PKEY_assign_RSA(pkey, privkey);
+    if (pkey == NULL) {
+        RSA_free(privkey);
+        goto end;
+    }
+    if (!EVP_PKEY_assign_RSA(pkey, privkey)) {
+        /* assignment failed; pkey doesn't own privkey, clean both */
+        RSA_free(privkey);
+        EVP_PKEY_free(pkey);
+        goto end;
+    }
     ret = SSL_CTX_use_PrivateKey(ctx, pkey);
-    OPENSSL_assert(ret == 1);
     EVP_PKEY_free(pkey);
-#endif
+    if (ret != 1)
+        goto end;

     bufp = kCertificateDER;
     cert = d2i_X509(NULL, &bufp, sizeof(kCertificateDER));
-    OPENSSL_assert(cert != NULL);
+    if (cert == NULL)
+        goto end;
     ret = SSL_CTX_use_certificate(ctx, cert);
-    OPENSSL_assert(ret == 1);
     X509_free(cert);
+    if (ret != 1)
+        goto end;
+#endif

 #ifndef OPENSSL_NO_EC
-#ifndef OPENSSL_NO_DEPRECATED_3_0
     /* ECDSA */
-    bio_buf = BIO_new(BIO_s_mem());
-    OPENSSL_assert((size_t)BIO_write(bio_buf, ECDSAPrivateKeyPEM, sizeof(ECDSAPrivateKeyPEM)) == sizeof(ECDSAPrivateKeyPEM));
-    ecdsakey = PEM_read_bio_ECPrivateKey(bio_buf, NULL, NULL, NULL);
-    ERR_print_errors_fp(stderr);
-    OPENSSL_assert(ecdsakey != NULL);
-    BIO_free(bio_buf);
-    pkey = EVP_PKEY_new();
-    EVP_PKEY_assign_EC_KEY(pkey, ecdsakey);
-    ret = SSL_CTX_use_PrivateKey(ctx, pkey);
-    OPENSSL_assert(ret == 1);
-    EVP_PKEY_free(pkey);
-#endif
-    bio_buf = BIO_new(BIO_s_mem());
-    OPENSSL_assert((size_t)BIO_write(bio_buf, ECDSACertPEM, sizeof(ECDSACertPEM)) == sizeof(ECDSACertPEM));
-    cert = PEM_read_bio_X509(bio_buf, NULL, NULL, NULL);
-    OPENSSL_assert(cert != NULL);
-    BIO_free(bio_buf);
-    ret = SSL_CTX_use_certificate(ctx, cert);
-    OPENSSL_assert(ret == 1);
-    X509_free(cert);
+    if (!use_pem_privkey(ctx, ECDSAPrivateKeyPEM, sizeof(ECDSAPrivateKeyPEM)))
+        goto end;
+    if (!use_pem_cert(ctx, ECDSACertPEM, sizeof(ECDSACertPEM)))
+        goto end;
 #endif

-#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
+#ifndef OPENSSL_NO_DSA
     /* DSA */
-    bio_buf = BIO_new(BIO_s_mem());
-    OPENSSL_assert((size_t)BIO_write(bio_buf, DSAPrivateKeyPEM, sizeof(DSAPrivateKeyPEM)) == sizeof(DSAPrivateKeyPEM));
-    dsakey = PEM_read_bio_DSAPrivateKey(bio_buf, NULL, NULL, NULL);
-    ERR_print_errors_fp(stderr);
-    OPENSSL_assert(dsakey != NULL);
-    BIO_free(bio_buf);
-    pkey = EVP_PKEY_new();
-    EVP_PKEY_assign_DSA(pkey, dsakey);
-    ret = SSL_CTX_use_PrivateKey(ctx, pkey);
-    OPENSSL_assert(ret == 1);
-    EVP_PKEY_free(pkey);
-
-    bio_buf = BIO_new(BIO_s_mem());
-    OPENSSL_assert((size_t)BIO_write(bio_buf, DSACertPEM, sizeof(DSACertPEM)) == sizeof(DSACertPEM));
-    cert = PEM_read_bio_X509(bio_buf, NULL, NULL, NULL);
-    OPENSSL_assert(cert != NULL);
-    BIO_free(bio_buf);
-    ret = SSL_CTX_use_certificate(ctx, cert);
-    OPENSSL_assert(ret == 1);
-    X509_free(cert);
+    if (!use_pem_privkey(ctx, DSAPrivateKeyPEM, sizeof(DSAPrivateKeyPEM)))
+        goto end;
+    if (!use_pem_cert(ctx, DSACertPEM, sizeof(DSACertPEM)))
+        goto end;
 #endif

     server = SSL_new(ctx);
+    if (server == NULL)
+        goto end;
     in = BIO_new(BIO_s_mem());
+    if (in == NULL)
+        goto end;
     out = BIO_new(BIO_s_mem());
+    if (out == NULL) {
+        BIO_free(in);
+        goto end;
+    }
     SSL_set_bio(server, in, out);
     SSL_set_accept_state(server);

     opt = (uint8_t)buf[len - 1];
     len--;

-    OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
+    if ((size_t)BIO_write(in, buf, (int)len) != len)
+        goto end;

     if ((opt & 0x01) != 0) {
         do {
             char early_buf[16384];
             size_t early_len;
-            ret = SSL_read_early_data(server, early_buf, sizeof(early_buf), &early_len);
+
+            ret = SSL_read_early_data(server, early_buf, sizeof(early_buf),
+                &early_len);

             if (ret != SSL_READ_EARLY_DATA_SUCCESS)
                 break;
@@ -732,6 +754,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
             }
         }
     }
+end:
     SSL_free(server);
     ERR_clear_error();
     SSL_CTX_free(ctx);
diff --git a/deps/openssl/openssl/fuzz/slh-dsa.c b/deps/openssl/openssl/fuzz/slh-dsa.c
index 17238bcf8b3..22153dea425 100644
--- a/deps/openssl/openssl/fuzz/slh-dsa.c
+++ b/deps/openssl/openssl/fuzz/slh-dsa.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -63,26 +63,32 @@ static EVP_PKEY *slh_dsa_gen_key(const char *name, uint32_t keysize,
 {
     EVP_PKEY_CTX *ctx;
     EVP_PKEY *new = NULL;
-    int rc;

     ctx = EVP_PKEY_CTX_new_from_name(NULL, name, NULL);
-    OPENSSL_assert(ctx != NULL);
+    if (ctx == NULL)
+        return NULL;
     if (params != NULL) {
         new = EVP_PKEY_new();
-        OPENSSL_assert(EVP_PKEY_fromdata_init(ctx));
-        if (*param_broken) {
-            rc = EVP_PKEY_fromdata(ctx, &new, EVP_PKEY_KEYPAIR, params);
-            OPENSSL_assert(rc == 0);
+        if (new == NULL)
+            goto out;
+        if (!EVP_PKEY_fromdata_init(ctx)) {
+            EVP_PKEY_free(new);
+            new = NULL;
+            goto out;
+        }
+        if (EVP_PKEY_fromdata(ctx, &new, EVP_PKEY_KEYPAIR, params) != 1) {
             EVP_PKEY_free(new);
             new = NULL;
-        } else {
-            OPENSSL_assert(EVP_PKEY_fromdata(ctx, &new, EVP_PKEY_KEYPAIR, params) == 1);
         }
         goto out;
     }

-    OPENSSL_assert(EVP_PKEY_keygen_init(ctx));
-    OPENSSL_assert(EVP_PKEY_generate(ctx, &new));
+    if (!EVP_PKEY_keygen_init(ctx))
+        goto out;
+    if (!EVP_PKEY_generate(ctx, &new)) {
+        EVP_PKEY_free(new);
+        new = NULL;
+    }

 out:
     EVP_PKEY_CTX_free(ctx);
@@ -221,9 +227,10 @@ static void slh_dsa_gen_key_with_params(uint8_t **buf, size_t *len,
     *buf = consume_uint8t(*buf, len, &selector);
     keytype = select_keytype(selector, &keysize);

-    RAND_bytes(pubbuf, PARAM_BUF_SZ);
-    RAND_bytes(prvbuf, PARAM_BUF_SZ);
-    RAND_bytes(sdbuf, PARAM_BUF_SZ);
+    if (!RAND_bytes(pubbuf, PARAM_BUF_SZ)
+        || !RAND_bytes(prvbuf, PARAM_BUF_SZ)
+        || !RAND_bytes(sdbuf, PARAM_BUF_SZ))
+        return;

     /*
      * select an invalid length if the buffer 0th bit is one
@@ -260,11 +267,6 @@ static void slh_dsa_gen_key_with_params(uint8_t **buf, size_t *len,
     params[2] = OSSL_PARAM_construct_end();

     *out1 = (void *)slh_dsa_gen_key(keytype, keysize, params, &broken);
-
-    if (broken)
-        OPENSSL_assert(*out1 == NULL);
-    else
-        OPENSSL_assert(*out1 != NULL);
     return;
 }

@@ -319,7 +321,6 @@ static void slh_dsa_sign_verify(uint8_t **buf, size_t *len, void *key1,
     OSSL_PARAM params[4];
     int paramidx = 0;
     int intval1, intval2;
-    int expect_init_rc = 1;

     *buf = consume_uint8t(*buf, len, &selector);
     if (*buf == NULL)
@@ -340,10 +341,6 @@ static void slh_dsa_sign_verify(uint8_t **buf, size_t *len, void *key1,
     msg = (unsigned char *)*buf;
     msg_len = *len;

-    /* if msg_len > 255, sign_message_init will fail */
-    if (msg_len > 255 && (selector & 0x1) != 0)
-        expect_init_rc = 0;
-
     *len = 0;

     if (selector & 0x1)
@@ -365,33 +362,39 @@ static void slh_dsa_sign_verify(uint8_t **buf, size_t *len, void *key1,
     params[paramidx] = OSSL_PARAM_construct_end();

     key = (void *)slh_dsa_gen_key(keytype, keylen, NULL, 0);
-    OPENSSL_assert(key != NULL);
+    if (key == NULL)
+        return;
     *out1 = key; /* for cleanup */

     ctx = EVP_PKEY_CTX_new_from_pkey(NULL, key, NULL);
-    OPENSSL_assert(ctx != NULL);
+    if (ctx == NULL)
+        goto out;

     sig_alg = EVP_SIGNATURE_fetch(NULL, keytype, NULL);
-    OPENSSL_assert(sig_alg != NULL);
+    if (sig_alg == NULL)
+        goto out;

-    OPENSSL_assert(EVP_PKEY_sign_message_init(ctx, sig_alg, params) == expect_init_rc);
     /*
      * the context_string parameter can be no more than 255 bytes, so if
-     * our random input buffer is greater than that, we expect failure above,
-     * which we check for.  In that event, there's nothing more we can do here
-     * so bail out
+     * our random input buffer is greater than that, sign_message_init will
+     * fail, in which case there's nothing more we can do here so bail out
      */
-    if (expect_init_rc == 0)
+    if (EVP_PKEY_sign_message_init(ctx, sig_alg, params) != 1)
         goto out;

-    OPENSSL_assert(EVP_PKEY_sign(ctx, NULL, &sig_len, msg, msg_len));
+    if (EVP_PKEY_sign(ctx, NULL, &sig_len, msg, msg_len) != 1)
+        goto out;
     sig = OPENSSL_zalloc(sig_len);
-    OPENSSL_assert(sig != NULL);
+    if (sig == NULL)
+        goto out;

-    OPENSSL_assert(EVP_PKEY_sign(ctx, sig, &sig_len, msg, msg_len));
+    if (EVP_PKEY_sign(ctx, sig, &sig_len, msg, msg_len) != 1)
+        goto out;

-    OPENSSL_assert(EVP_PKEY_verify_message_init(ctx, sig_alg, params));
-    OPENSSL_assert(EVP_PKEY_verify(ctx, sig, sig_len, msg, msg_len));
+    if (EVP_PKEY_verify_message_init(ctx, sig_alg, params) != 1)
+        goto out;
+    if (EVP_PKEY_verify(ctx, sig, sig_len, msg, msg_len) != 1)
+        fprintf(stderr, "Failed to verify message\n");

 out:
     OPENSSL_free(sig);
@@ -417,32 +420,34 @@ out:
 static void slh_dsa_export_import(uint8_t **buf, size_t *len, void *key1,
     void *key2, void **out1, void **out2)
 {
-    int rc;
     EVP_PKEY *alice = (EVP_PKEY *)key1;
     EVP_PKEY *bob = (EVP_PKEY *)key2;
     EVP_PKEY *new = NULL;
     EVP_PKEY_CTX *ctx = NULL;
     OSSL_PARAM *params = NULL;

-    OPENSSL_assert(EVP_PKEY_todata(alice, EVP_PKEY_KEYPAIR, &params) == 1);
+    if (alice == NULL || bob == NULL)
+        return;
+
+    if (!EVP_PKEY_todata(alice, EVP_PKEY_KEYPAIR, &params))
+        goto alice_done;

     ctx = EVP_PKEY_CTX_new_from_pkey(NULL, alice, NULL);
-    OPENSSL_assert(ctx != NULL);
+    if (ctx == NULL)
+        goto alice_done;

-    OPENSSL_assert(EVP_PKEY_fromdata_init(ctx));
+    if (!EVP_PKEY_fromdata_init(ctx))
+        goto alice_done;

     new = EVP_PKEY_new();
-    OPENSSL_assert(new != NULL);
-    OPENSSL_assert(EVP_PKEY_fromdata(ctx, &new, EVP_PKEY_KEYPAIR, params) == 1);
+    if (new == NULL)
+        goto alice_done;
+    if (EVP_PKEY_fromdata(ctx, &new, EVP_PKEY_KEYPAIR, params) != 1)
+        goto alice_done;

-    /*
-     * EVP_PKEY returns:
-     * 1 if the keys are equivalent
-     * 0 if the keys are not equivalent
-     * -1 if the key types are different
-     * -2 if the operation is not supported
-     */
-    OPENSSL_assert(EVP_PKEY_eq(alice, new) == 1);
+    (void)EVP_PKEY_eq(alice, new);
+
+alice_done:
     EVP_PKEY_free(new);
     EVP_PKEY_CTX_free(ctx);
     OSSL_PARAM_free(params);
@@ -450,26 +455,26 @@ static void slh_dsa_export_import(uint8_t **buf, size_t *len, void *key1,
     ctx = NULL;
     new = NULL;

-    OPENSSL_assert(EVP_PKEY_todata(bob, EVP_PKEY_KEYPAIR, &params) == 1);
+    if (!EVP_PKEY_todata(bob, EVP_PKEY_KEYPAIR, &params))
+        goto bob_done;

     ctx = EVP_PKEY_CTX_new_from_pkey(NULL, bob, NULL);
-    OPENSSL_assert(ctx != NULL);
+    if (ctx == NULL)
+        goto bob_done;

-    OPENSSL_assert(EVP_PKEY_fromdata_init(ctx));
+    if (!EVP_PKEY_fromdata_init(ctx))
+        goto bob_done;

     new = EVP_PKEY_new();
-    OPENSSL_assert(new != NULL);
-    OPENSSL_assert(EVP_PKEY_fromdata(ctx, &new, EVP_PKEY_KEYPAIR, params) == 1);
+    if (new == NULL)
+        goto bob_done;
+    if (EVP_PKEY_fromdata(ctx, &new, EVP_PKEY_KEYPAIR, params) != 1)
+        goto bob_done;

-    OPENSSL_assert(EVP_PKEY_eq(bob, new) == 1);
-
-    /*
-     * Depending on the types of eys that get generated
-     * we might get a simple non-equivalence or a type mismatch here
-     */
-    rc = EVP_PKEY_eq(alice, new);
-    OPENSSL_assert(rc == 0 || rc == -1);
+    (void)EVP_PKEY_eq(bob, new);
+    (void)EVP_PKEY_eq(alice, new);

+bob_done:
     EVP_PKEY_CTX_free(ctx);
     EVP_PKEY_free(new);
     OSSL_PARAM_free(params);
@@ -589,7 +594,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
      */
     if (ops[operation].setup != NULL)
         ops[operation].setup(&buffer_cursor, &len, &in1, &in2);
-    if (ops[operation].doit != NULL)
+    if (ops[operation].doit != NULL && in1 != NULL)
         ops[operation].doit(&buffer_cursor, &len, in1, in2, &out1, &out2);
     if (ops[operation].cleanup != NULL)
         ops[operation].cleanup(in1, in2, out1, out2);
diff --git a/deps/openssl/openssl/fuzz/smime.c b/deps/openssl/openssl/fuzz/smime.c
index 18c92ace513..2556e497186 100644
--- a/deps/openssl/openssl/fuzz/smime.c
+++ b/deps/openssl/openssl/fuzz/smime.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,8 +21,18 @@ int FuzzerInitialize(int *argc, char ***argv)

 int FuzzerTestOneInput(const uint8_t *buf, size_t len)
 {
-    BIO *b = BIO_new_mem_buf(buf, len);
-    PKCS7 *p7 = SMIME_read_PKCS7(b, NULL);
+    BIO *b;
+    PKCS7 *p7;
+
+    if (len > INT_MAX)
+        return 0;
+
+    b = BIO_new_mem_buf(buf, (int)len);
+    if (b == NULL) {
+        ERR_clear_error();
+        return 0;
+    }
+    p7 = SMIME_read_PKCS7(b, NULL);

     if (p7 != NULL) {
         STACK_OF(PKCS7_SIGNER_INFO) *p7si = PKCS7_get_signer_info(p7);
diff --git a/deps/openssl/openssl/fuzz/test-corpus.c b/deps/openssl/openssl/fuzz/test-corpus.c
index 783df1a0768..a908f69644c 100644
--- a/deps/openssl/openssl/fuzz/test-corpus.c
+++ b/deps/openssl/openssl/fuzz/test-corpus.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,10 +17,13 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <time.h>
 #include <sys/stat.h>
 #include <openssl/crypto.h>
+#include <openssl/err.h>
 #include "fuzzer.h"
 #include "internal/o_dir.h"
+#include "mfail.h"

 #if defined(_WIN32) && defined(_MAX_PATH) && !defined(PATH_MAX)
 #define PATH_MAX _MAX_PATH
@@ -34,7 +37,45 @@
 #define S_ISREG(m) ((m) & S_IFREG)
 #endif

-static void testfile(const char *pathname)
+static double secs_since(clock_t start)
+{
+    return (double)(clock() - start) / CLOCKS_PER_SEC;
+}
+
+static void run_baseline(const unsigned char *buf, size_t s)
+{
+    FuzzerTestOneInput(buf, s);
+}
+
+static void run_mfail(const unsigned char *buf, size_t s,
+    const char *path, int file_idx)
+{
+    mfail_init(file_idx, MFAIL_FLAG_COUNT);
+    while (mfail_has_next()) {
+        if (mfail_get_phase() == MFAIL_PHASE_COUNTING)
+            fprintf(stderr,
+                "# MFAIL_BEGIN file_idx=%d phase=count\n", file_idx);
+        else
+            fprintf(stderr,
+                "# MFAIL_BEGIN file_idx=%d point=%d/%d\n",
+                file_idx, mfail_get_point(), mfail_get_total());
+
+        mfail_start();
+        FuzzerTestOneInput(buf, s);
+        mfail_end();
+
+        if (mfail_get_phase() == MFAIL_PHASE_COUNTING) {
+            fprintf(stderr, "# %s: %d allocations\n", path, mfail_get_count());
+        } else {
+            fprintf(stderr, "# %s: point %d/%d %s\n", path,
+                mfail_get_point(), mfail_get_total(),
+                mfail_was_triggered() ? "hit" : "unreached");
+        }
+        ERR_clear_error();
+    }
+}
+
+static void testfile(const char *pathname, int file_idx)
 {
     struct stat st;
     FILE *f;
@@ -43,26 +84,52 @@ static void testfile(const char *pathname)

     if (stat(pathname, &st) < 0 || !S_ISREG(st.st_mode))
         return;
-    printf("# %s\n", pathname);
-    fflush(stdout);
+
+    fprintf(stderr, "# CORPUS_FILE file_idx=%d size=%lld path=%s\n",
+        file_idx, (long long)st.st_size, pathname);
     f = fopen(pathname, "rb");
     if (f == NULL)
         return;
     buf = malloc(st.st_size);
-    if (buf != NULL) {
-        s = fread(buf, 1, st.st_size, f);
-        OPENSSL_assert(s == (size_t)st.st_size);
-        FuzzerTestOneInput(buf, s);
-        free(buf);
+    if (buf == NULL) {
+        fclose(f);
+        return;
     }
+    s = fread(buf, 1, st.st_size, f);
+    OPENSSL_assert(s == (size_t)st.st_size);
+
+    if (mfail_is_installed())
+        run_mfail(buf, s, pathname, file_idx);
+    else
+        run_baseline(buf, s);
+
+    free(buf);
     fclose(f);
 }

 int main(int argc, char **argv)
 {
-    int n;
+    int n, mfi_rc;
+    int file_idx = 0;
+    clock_t corpus_start;

-    FuzzerInitialize(&argc, &argv);
+    mfi_rc = mfail_install(1);
+    if (mfi_rc < 0) {
+        fprintf(stderr, "mfail: failed to install allocator hooks\n");
+        return 1;
+    } else if (mfi_rc > 0) {
+        /* Disable buffering for better crash analysis */
+        setvbuf(stdout, NULL, _IOLBF, 0);
+        setvbuf(stderr, NULL, _IOLBF, 0);
+    }
+
+    if (FuzzerInitialize(&argc, &argv) < 0) {
+        if (mfail_is_installed())
+            return 0; /* init failure under mfail is expected */
+        return 1;
+    }
+
+    corpus_start = clock();

     for (n = 1; n < argc; ++n) {
         size_t dirname_len = strlen(argv[n]);
@@ -88,18 +155,20 @@ int main(int argc, char **argv)
                 pathname[dirname_len] = '\0';
             }
             strcpy(pathname + dirname_len, filename);
-            testfile(pathname);
+            testfile(pathname, file_idx++);
         }
         OPENSSL_DIR_end(&ctx);

         /* If it wasn't a directory, treat it as a file instead */
         if (!wasdir)
-            testfile(argv[n]);
+            testfile(argv[n], file_idx++);

         free(pathname);
     }

-    FuzzerCleanup();
+    if (!mfail_is_installed() || mfail_is_count_only())
+        fprintf(stderr, "# corpus_time: %.6f\n", secs_since(corpus_start));

+    FuzzerCleanup();
     return 0;
 }
diff --git a/deps/openssl/openssl/fuzz/v3name.c b/deps/openssl/openssl/fuzz/v3name.c
index 6c330b35356..5cf20bc3386 100644
--- a/deps/openssl/openssl/fuzz/v3name.c
+++ b/deps/openssl/openssl/fuzz/v3name.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2012-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -9,6 +9,7 @@

 #include <string.h>
 #include <openssl/e_os2.h>
+#include <openssl/err.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 #include "internal/nelem.h"
@@ -23,20 +24,23 @@ int FuzzerTestOneInput(const uint8_t *data, size_t size)
 {
     GENERAL_NAME *namesa;
     GENERAL_NAME *namesb;
-
     const unsigned char *derp = data;
+
+    if (size > LONG_MAX)
+        return 0;
+
     /*
      * We create two versions of each GENERAL_NAME so that we ensure when
      * we compare them they are always different pointers.
      */
-    namesa = d2i_GENERAL_NAME(NULL, &derp, size);
+    namesa = d2i_GENERAL_NAME(NULL, &derp, (long)size);
     derp = data;
-    namesb = d2i_GENERAL_NAME(NULL, &derp, size);
-    GENERAL_NAME_cmp(namesa, namesb);
-    if (namesa != NULL)
-        GENERAL_NAME_free(namesa);
-    if (namesb != NULL)
-        GENERAL_NAME_free(namesb);
+    namesb = d2i_GENERAL_NAME(NULL, &derp, (long)size);
+    if (namesa != NULL && namesb != NULL)
+        GENERAL_NAME_cmp(namesa, namesb);
+    GENERAL_NAME_free(namesa);
+    GENERAL_NAME_free(namesb);
+    ERR_clear_error();
     return 0;
 }

diff --git a/deps/openssl/openssl/fuzz/x509.c b/deps/openssl/openssl/fuzz/x509.c
index da96a29e32a..011e2b0fa7b 100644
--- a/deps/openssl/openssl/fuzz/x509.c
+++ b/deps/openssl/openssl/fuzz/x509.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     OCSP_BASICRESP *bs = NULL;
     OCSP_CERTID *id = NULL;

-    x509_1 = d2i_X509(NULL, &p, len);
+    x509_1 = d2i_X509(NULL, &p, (long)len);
     if (x509_1 == NULL)
         goto err;

@@ -66,17 +66,17 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     OPENSSL_free(der);

     len = orig_len - (p - buf);
-    x509_2 = d2i_X509(NULL, &p, len);
+    x509_2 = d2i_X509(NULL, &p, (long)len);
     if (x509_2 == NULL)
         goto err;

     len = orig_len - (p - buf);
-    crl = d2i_X509_CRL(NULL, &p, len);
+    crl = d2i_X509_CRL(NULL, &p, (long)len);
     if (crl == NULL)
         goto err;

     len = orig_len - (p - buf);
-    resp = d2i_OCSP_RESPONSE(NULL, &p, len);
+    resp = d2i_OCSP_RESPONSE(NULL, &p, (long)len);

     store = X509_STORE_new();
     if (store == NULL)
@@ -99,7 +99,8 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     if (ctx == NULL)
         goto err;

-    X509_STORE_CTX_init(ctx, store, x509_1, NULL);
+    if (!X509_STORE_CTX_init(ctx, store, x509_1, NULL))
+        goto err;

     if (crl != NULL) {
         crls = sk_X509_CRL_new_null();
diff --git a/deps/openssl/openssl/fuzz/x509v3.c b/deps/openssl/openssl/fuzz/x509v3.c
new file mode 100644
index 00000000000..d44b958082d
--- /dev/null
+++ b/deps/openssl/openssl/fuzz/x509v3.c
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * https://www.openssl.org/source/license.html
+ * or in the file LICENSE in the source distribution.
+ */
+#include <openssl/bio.h>
+#include <openssl/conf.h>
+#include <openssl/err.h>
+#include <openssl/x509.h>
+#include <openssl/x509v3.h>
+#include "fuzzer.h"
+
+/*
+ * Repeated section references in the string-based extension APIs can cause
+ * quadratic output growth. Limit input size
+ * to keep individual fuzzing iterations small. See:
+ * https://github.com/google/boringssl/blob/f1f2556a5dfa59e147d9d47279cc3f7f8a18b433/fuzz/conf.cc#L22-L25
+ * https://issues.chromium.org/issues/42290485
+ */
+#define MAX_INPUT_SIZE (8 * 1024)
+
+int FuzzerInitialize(int *argc, char ***argv)
+{
+    return 1;
+}
+
+int FuzzerTestOneInput(const uint8_t *buf, size_t len)
+{
+    BIO *in = NULL;
+    CONF *conf = NULL;
+    X509 *cert = NULL;
+    X509V3_CTX ctx;
+
+    if (len == 0)
+        return 0;
+
+    if (len > MAX_INPUT_SIZE)
+        len = MAX_INPUT_SIZE;
+
+    in = BIO_new(BIO_s_mem());
+    if (in == NULL)
+        goto end;
+
+    if ((size_t)BIO_write(in, buf, (int)len) != len)
+        goto end;
+
+    conf = NCONF_new(NULL);
+    if (conf == NULL)
+        goto end;
+
+    if (NCONF_load_bio(conf, in, NULL) <= 0)
+        goto end;
+
+    cert = X509_new();
+    if (cert != NULL) {
+        X509V3_set_ctx(&ctx, cert, cert, NULL, NULL, 0);
+        X509V3_set_nconf(&ctx, conf);
+        X509V3_EXT_add_nconf(conf, &ctx, "default", cert);
+        X509_free(cert);
+    }
+
+    cert = X509_new();
+    if (cert != NULL) {
+        X509V3_set_ctx(&ctx, NULL, NULL, NULL, NULL, 0);
+        X509V3_set_nconf(&ctx, conf);
+        X509V3_EXT_add_nconf(conf, &ctx, "default", cert);
+    }
+
+end:
+    X509_free(cert);
+    NCONF_free(conf);
+    BIO_free(in);
+    ERR_clear_error();
+
+    return 0;
+}
+
+void FuzzerCleanup(void)
+{
+}
diff --git a/deps/openssl/openssl/crypto/arm_arch.h b/deps/openssl/openssl/include/arch/arm_arch.h
similarity index 90%
rename from deps/openssl/openssl/crypto/arm_arch.h
rename to deps/openssl/openssl/include/arch/arm_arch.h
index d570d1eba6c..0721b067f75 100644
--- a/deps/openssl/openssl/crypto/arm_arch.h
+++ b/deps/openssl/openssl/include/arch/arm_arch.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -79,9 +79,10 @@ extern unsigned int OPENSSL_armv8_rsa_neonized;
 #define ARMV8_SHA3 (1 << 11)
 #define ARMV8_UNROLL8_EOR3 (1 << 12)
 #define ARMV8_SVE (1 << 13)
-#define ARMV8_SVE2 (1 << 14)
+#define ARMV9_SVE2 (1 << 14)
 #define ARMV8_HAVE_SHA3_AND_WORTH_USING (1 << 15)
 #define ARMV8_UNROLL12_EOR3 (1 << 16)
+#define ARMV9_SVE2_POLY1305 (1 << 17)

 /*
  * MIDR_EL1 system register
@@ -95,9 +96,11 @@ extern unsigned int OPENSSL_armv8_rsa_neonized;

 #define ARM_CPU_IMP_ARM 0x41
 #define HISI_CPU_IMP 0x48
+#define ARM_CPU_IMP_QCOMM 0x51
 #define ARM_CPU_IMP_APPLE 0x61
 #define ARM_CPU_IMP_MICROSOFT 0x6D
 #define ARM_CPU_IMP_AMPERE 0xC0
+#define ARM_CPU_IMP_NVIDIA 0x4E

 #define ARM_CPU_PART_CORTEX_A72 0xD08
 #define ARM_CPU_PART_N1 0xD0C
@@ -105,6 +108,13 @@ extern unsigned int OPENSSL_armv8_rsa_neonized;
 #define ARM_CPU_PART_N2 0xD49
 #define HISI_CPU_PART_KP920 0xD01
 #define ARM_CPU_PART_V2 0xD4F
+#define ARM_CPU_PART_N3 0xD8E
+#define ARM_CPU_PART_V3_AE 0xD83
+#define ARM_CPU_PART_V3 0xD84
+
+#define QCOM_CPU_PART_ORYON_X1 0x001
+
+#define NVIDIA_CPU_PART_OLYMPUS 0x010

 #define APPLE_CPU_PART_M1_ICESTORM 0x022
 #define APPLE_CPU_PART_M1_FIRESTORM 0x023
@@ -149,8 +159,9 @@ extern unsigned int OPENSSL_armv8_rsa_neonized;

 /*
  * Support macros for
- *   - Armv8.3-A Pointer Authentication and
+ *   - Armv8.3-A Pointer Authentication
  *   - Armv8.5-A Branch Target Identification
+ *   - Armv9.4-A Guarded Control Stack
  * features which require emitting a .note.gnu.property section with the
  * appropriate architecture-dependent feature bits set.
  * Read more: "ELF for the Arm® 64-bit Architecture"
@@ -184,7 +195,13 @@ extern unsigned int OPENSSL_armv8_rsa_neonized;
 #define AARCH64_VALIDATE_LINK_REGISTER
 #endif

-#if GNU_PROPERTY_AARCH64_POINTER_AUTH != 0 || GNU_PROPERTY_AARCH64_BTI != 0
+#if defined(__ARM_FEATURE_GCS_DEFAULT) && __ARM_FEATURE_GCS_DEFAULT == 1
+#define GNU_PROPERTY_AARCH64_GCS (1 << 2)
+#else
+#define GNU_PROPERTY_AARCH64_GCS 0 /* No GCS */
+#endif
+
+#if GNU_PROPERTY_AARCH64_POINTER_AUTH != 0 || GNU_PROPERTY_AARCH64_BTI != 0 || GNU_PROPERTY_AARCH64_GCS != 0
 /* clang-format off */
 .pushsection .note.gnu.property, "a";
 /* clang-format on */
@@ -195,7 +212,7 @@ extern unsigned int OPENSSL_armv8_rsa_neonized;
 .asciz "GNU";
 .long 0xc0000000; /* GNU_PROPERTY_AARCH64_FEATURE_1_AND */
 .long 4;
-.long(GNU_PROPERTY_AARCH64_POINTER_AUTH | GNU_PROPERTY_AARCH64_BTI);
+.long(GNU_PROPERTY_AARCH64_POINTER_AUTH | GNU_PROPERTY_AARCH64_BTI | GNU_PROPERTY_AARCH64_GCS);
 .long 0;
 .popsection;
 #endif
diff --git a/deps/openssl/openssl/crypto/loongarch_arch.h b/deps/openssl/openssl/include/arch/loongarch_arch.h
similarity index 88%
rename from deps/openssl/openssl/crypto/loongarch_arch.h
rename to deps/openssl/openssl/include/arch/loongarch_arch.h
index e1a7f82293f..bfd0584f2bf 100644
--- a/deps/openssl/openssl/crypto/loongarch_arch.h
+++ b/deps/openssl/openssl/include/arch/loongarch_arch.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/crypto/mips_arch.h b/deps/openssl/openssl/include/arch/mips_arch.h
similarity index 94%
rename from deps/openssl/openssl/crypto/mips_arch.h
rename to deps/openssl/openssl/include/arch/mips_arch.h
index ddc1293b2e6..8a23a949e0c 100644
--- a/deps/openssl/openssl/crypto/mips_arch.h
+++ b/deps/openssl/openssl/include/arch/mips_arch.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/include/crypto/ppc_arch.h b/deps/openssl/openssl/include/arch/ppc_arch.h
similarity index 92%
rename from deps/openssl/openssl/include/crypto/ppc_arch.h
rename to deps/openssl/openssl/include/arch/ppc_arch.h
index 5945853ab17..2550507171d 100644
--- a/deps/openssl/openssl/include/crypto/ppc_arch.h
+++ b/deps/openssl/openssl/include/arch/ppc_arch.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2014-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/include/crypto/riscv_arch.def b/deps/openssl/openssl/include/arch/riscv_arch.def
similarity index 97%
rename from deps/openssl/openssl/include/crypto/riscv_arch.def
rename to deps/openssl/openssl/include/arch/riscv_arch.def
index 32147d0939c..8608b4309ee 100644
--- a/deps/openssl/openssl/include/crypto/riscv_arch.def
+++ b/deps/openssl/openssl/include/arch/riscv_arch.def
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
diff --git a/deps/openssl/openssl/include/crypto/riscv_arch.h b/deps/openssl/openssl/include/arch/riscv_arch.h
similarity index 99%
rename from deps/openssl/openssl/include/crypto/riscv_arch.h
rename to deps/openssl/openssl/include/arch/riscv_arch.h
index 782e341c7a5..b83d3b62c6f 100644
--- a/deps/openssl/openssl/include/crypto/riscv_arch.h
+++ b/deps/openssl/openssl/include/arch/riscv_arch.h
@@ -11,6 +11,7 @@
 #define OSSL_CRYPTO_RISCV_ARCH_H

 #include <ctype.h>
+#include <stddef.h>
 #include <stdint.h>

 #if defined(OPENSSL_SYS_LINUX) && !defined(FIPS_MODULE)
diff --git a/deps/openssl/openssl/crypto/s390x_arch.h b/deps/openssl/openssl/include/arch/s390x_arch.h
similarity index 94%
rename from deps/openssl/openssl/crypto/s390x_arch.h
rename to deps/openssl/openssl/include/arch/s390x_arch.h
index c3a805b3594..a52ee7f993f 100644
--- a/deps/openssl/openssl/crypto/s390x_arch.h
+++ b/deps/openssl/openssl/include/arch/s390x_arch.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -31,6 +31,7 @@ void s390x_kma(const unsigned char *aad, size_t alen, const unsigned char *in,
 int s390x_pcc(unsigned int fc, void *param);
 int s390x_kdsa(unsigned int fc, void *param, const unsigned char *in,
     size_t len);
+void OPENSSL_s390x_cleanup(void);

 void s390x_flip_endian32(unsigned char dst[32], const unsigned char src[32]);
 void s390x_flip_endian64(unsigned char dst[64], const unsigned char src[64]);
@@ -203,4 +204,9 @@ extern int OPENSSL_s390xcex_nodev;
 #define S390X_KMAC_IIMP 0x4000
 #define S390X_KMAC_CCUP 0x2000

+/* Are the s390x vector instructions (VX and VXE) supported? */
+/* This is the case for >= z13 (VX) and >= z14 (VXE).        */
+#define S390X_VX_CAPABLE ( \
+    (OPENSSL_s390xcap_P.stfle[2] & S390X_CAPBIT(S390X_VX)) && (OPENSSL_s390xcap_P.stfle[2] & S390X_CAPBIT(S390X_VXE)))
+
 #endif
diff --git a/deps/openssl/openssl/include/crypto/sparc_arch.h b/deps/openssl/openssl/include/arch/sparc_arch.h
similarity index 100%
rename from deps/openssl/openssl/include/crypto/sparc_arch.h
rename to deps/openssl/openssl/include/arch/sparc_arch.h
diff --git a/deps/openssl/openssl/include/crypto/aes_platform.h b/deps/openssl/openssl/include/crypto/aes_platform.h
index 28beba8efb9..6c0d0258e4b 100644
--- a/deps/openssl/openssl/include/crypto/aes_platform.h
+++ b/deps/openssl/openssl/include/crypto/aes_platform.h
@@ -13,6 +13,12 @@

 #include <openssl/aes.h>

+typedef int (*aes_set_encrypt_key_fn)(const unsigned char *key,
+    int bits, AES_KEY *ks);
+
+typedef void (*aes_block128_f)(const unsigned char in[16],
+    unsigned char out[16], const AES_KEY *key);
+
 #ifdef VPAES_ASM
 int vpaes_set_encrypt_key(const unsigned char *userKey, int bits,
     AES_KEY *key);
@@ -61,7 +67,7 @@ void AES_xts_decrypt(const unsigned char *inp, unsigned char *out, size_t len,

 #if defined(OPENSSL_CPUID_OBJ)
 #if (defined(__powerpc__) || defined(__POWERPC__) || defined(_ARCH_PPC))
-#include "crypto/ppc_arch.h"
+#include "arch/ppc_arch.h"
 #ifdef VPAES_ASM
 #define VPAES_CAPABLE (OPENSSL_ppccap_P & PPC_ALTIVEC)
 #endif
@@ -84,17 +90,17 @@ void AES_xts_decrypt(const unsigned char *inp, unsigned char *out, size_t len,
 #define AES_GCM_DEC_BYTES 128
 size_t ppc_aes_gcm_encrypt(const unsigned char *in, unsigned char *out,
     size_t len, const void *key, unsigned char ivec[16],
-    u64 *Xi);
+    uint64_t *Xi);
 size_t ppc_aes_gcm_decrypt(const unsigned char *in, unsigned char *out,
     size_t len, const void *key, unsigned char ivec[16],
-    u64 *Xi);
+    uint64_t *Xi);
 #define AES_GCM_ASM_PPC(gctx) ((gctx)->ctr == aes_p8_ctr32_encrypt_blocks && (gctx)->gcm.funcs.ghash == gcm_ghash_p8)
-void gcm_ghash_p8(u64 Xi[2], const u128 Htable[16], const u8 *inp, size_t len);
+void gcm_ghash_p8(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, size_t len);
 #endif /* OPENSSL_SYS_AIX || OPENSSL_SYS_MACOSX */
 #endif /* PPC */

 #if (defined(__arm__) || defined(__arm) || defined(__aarch64__) || defined(_M_ARM64))
-#include "arm_arch.h"
+#include "arch/arm_arch.h"
 #if __ARM_MAX_ARCH__ >= 7
 #if defined(BSAES_ASM)
 #define BSAES_CAPABLE (OPENSSL_armcap_P & ARMV7_NEON)
@@ -113,6 +119,12 @@ void gcm_ghash_p8(u64 Xi[2], const u128 Htable[16], const u8 *inp, size_t len);
 #define ARMv8_HWAES_CAPABLE (OPENSSL_armcap_P & ARMV8_AES)
 #define HWAES_xts_encrypt aes_v8_xts_encrypt
 #define HWAES_xts_decrypt aes_v8_xts_decrypt
+#define HWAES_CBC_HMAC_SHA1_ETM_CAPABLE (HWAES_CAPABLE && (OPENSSL_armcap_P & ARMV8_SHA1))
+#define HWAES_CBC_HMAC_SHA256_ETM_CAPABLE (HWAES_CAPABLE && (OPENSSL_armcap_P & ARMV8_SHA256))
+#define HWAES_CBC_HMAC_SHA512_ETM_CAPABLE (HWAES_CAPABLE && (OPENSSL_armcap_P & ARMV8_SHA512))
+#ifndef __AARCH64EB__
+#define AES_CBC_HMAC_SHA_ETM_CAPABLE 1
+#endif
 #endif
 #define HWAES_ctr32_encrypt_blocks aes_v8_ctr32_encrypt_blocks
 #define HWAES_ctr32_encrypt_blocks_unroll12_eor3 aes_v8_ctr32_encrypt_blocks_unroll12_eor3
@@ -151,10 +163,10 @@ size_t unroll8_eor3_aes_gcm_dec_192_kernel(const uint8_t *ciphertext, uint64_t p
 size_t unroll8_eor3_aes_gcm_dec_256_kernel(const uint8_t *ciphertext, uint64_t plaintext_length, uint8_t *plaintext,
     uint64_t *Xi, unsigned char ivec[16], const void *key);
 size_t armv8_aes_gcm_encrypt(const unsigned char *in, unsigned char *out, size_t len, const void *key,
-    unsigned char ivec[16], u64 *Xi);
+    unsigned char ivec[16], uint64_t *Xi);
 size_t armv8_aes_gcm_decrypt(const unsigned char *in, unsigned char *out, size_t len, const void *key,
-    unsigned char ivec[16], u64 *Xi);
-void gcm_ghash_v8(u64 Xi[2], const u128 Htable[16], const u8 *inp, size_t len);
+    unsigned char ivec[16], uint64_t *Xi);
+void gcm_ghash_v8(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, size_t len);
 #endif
 #endif
 #endif
@@ -166,12 +178,28 @@ void gcm_ghash_v8(u64 Xi[2], const u128 Htable[16], const u8 *inp, size_t len);
 #endif

 #if defined(__loongarch__) || defined(__loongarch64)
-#include "loongarch_arch.h"
+#include "arch/loongarch_arch.h"
 #if defined(VPAES_ASM)
 #define VPAES_CAPABLE (OPENSSL_loongarch_hwcap_P & LOONGARCH_HWCAP_LSX)
 #endif
 #endif

+#if (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64)) \
+    && !defined(OPENSSL_NO_ASM)                                                        \
+    && ((defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 8))                  \
+        || (defined(__clang__) && (__clang_major__ >= 7))                              \
+        || (defined(_MSC_VER) && (_MSC_VER >= 1927)))
+#define VAES_CBC_ELIGIBLE 1
+#else
+#define VAES_CBC_ELIGIBLE 0
+#endif
+
+#if VAES_CBC_ELIGIBLE
+void ossl_aes_cbc_vaes_decrypt(const unsigned char *in, unsigned char *out,
+    size_t len, const void *key, unsigned char ivec[16], int enc);
+int ossl_aes_cbc_vaes_eligible(void);
+#endif
+
 #if defined(AES_ASM) && !defined(I386_ONLY) && (((defined(__i386) || defined(__i386__) || defined(_M_IX86)) && defined(OPENSSL_IA32_SSE2)) || defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))

 /* AES-NI section */
@@ -192,6 +220,15 @@ int aesni_set_encrypt_key(const unsigned char *userKey, int bits,
 int aesni_set_decrypt_key(const unsigned char *userKey, int bits,
     AES_KEY *key);

+void ossl_aes_cfb128_vaes_enc(const unsigned char *in, unsigned char *out,
+    size_t len, const AES_KEY *ks,
+    const unsigned char ivec[16], ossl_ssize_t *num);
+void ossl_aes_cfb128_vaes_dec(const unsigned char *in, unsigned char *out,
+    size_t len, const AES_KEY *ks,
+    const unsigned char ivec[16], ossl_ssize_t *num);
+
+int ossl_aes_cfb128_vaes_eligible(void);
+
 void aesni_encrypt(const unsigned char *in, unsigned char *out,
     const AES_KEY *key);
 void aesni_decrypt(const unsigned char *in, unsigned char *out,
@@ -272,10 +309,10 @@ void aesni_ccm64_decrypt_blocks(const unsigned char *in,

 #if defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64)
 size_t aesni_gcm_encrypt(const unsigned char *in, unsigned char *out, size_t len,
-    const void *key, unsigned char ivec[16], u64 *Xi);
+    const void *key, unsigned char ivec[16], uint64_t *Xi);
 size_t aesni_gcm_decrypt(const unsigned char *in, unsigned char *out, size_t len,
-    const void *key, unsigned char ivec[16], u64 *Xi);
-void gcm_ghash_avx(u64 Xi[2], const u128 Htable[16], const u8 *in, size_t len);
+    const void *key, unsigned char ivec[16], uint64_t *Xi);
+void gcm_ghash_avx(uint64_t Xi[2], const u128 Htable[16], const uint8_t *in, size_t len);

 #define AES_gcm_encrypt aesni_gcm_encrypt
 #define AES_gcm_decrypt aesni_gcm_decrypt
@@ -285,7 +322,7 @@ void gcm_ghash_avx(u64 Xi[2], const u128 Htable[16], const u8 *in, size_t len);
 #elif defined(AES_ASM) && (defined(__sparc) || defined(__sparc__))

 /* Fujitsu SPARC64 X support */
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #define SPARC_AES_CAPABLE (OPENSSL_sparcv9cap_P[1] & CFR_AES)
 #define HWAES_CAPABLE (OPENSSL_sparcv9cap_P[0] & SPARCV9_FJAESX)
@@ -355,7 +392,7 @@ void aes256_t4_xts_decrypt(const unsigned char *in, unsigned char *out,

 #elif defined(OPENSSL_CPUID_OBJ) && defined(__s390__)
 /* IBM S390X support */
-#include "s390x_arch.h"
+#include "arch/s390x_arch.h"

 /* Convert key size to function code: [16,24,32] -> [18,19,20]. */
 #define S390X_AES_FC(keylen) (S390X_AES_128 + ((((keylen) << 3) - 128) >> 6))
@@ -419,7 +456,7 @@ void aes256_t4_xts_decrypt(const unsigned char *in, unsigned char *out,
 #define S390X_AES_FC(keylen) (S390X_AES_128 + ((((keylen) << 3) - 128) >> 6))
 #elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
 /* RISC-V 64 support */
-#include "riscv_arch.h"
+#include "arch/riscv_arch.h"

 /* Zkne and Zknd extensions (scalar crypto AES). */
 int rv64i_zkne_set_encrypt_key(const unsigned char *userKey, const int bits,
@@ -464,12 +501,12 @@ void rv64i_zvkb_zvkned_ctr32_encrypt_blocks(const unsigned char *in,
 size_t rv64i_zvkb_zvkg_zvkned_aes_gcm_encrypt(const unsigned char *in,
     unsigned char *out, size_t len,
     const void *key,
-    unsigned char ivec[16], u64 *Xi);
+    unsigned char ivec[16], uint64_t *Xi);

 size_t rv64i_zvkb_zvkg_zvkned_aes_gcm_decrypt(const unsigned char *in,
     unsigned char *out, size_t len,
     const void *key,
-    unsigned char ivec[16], u64 *Xi);
+    unsigned char ivec[16], uint64_t *Xi);

 void rv64i_zvbb_zvkg_zvkned_aes_xts_encrypt(const unsigned char *in,
     unsigned char *out, size_t length,
@@ -483,7 +520,7 @@ void rv64i_zvbb_zvkg_zvkned_aes_xts_decrypt(const unsigned char *in,
     const AES_KEY *key2,
     const unsigned char iv[16]);

-void gcm_ghash_rv64i_zvkg(u64 Xi[2], const u128 Htable[16], const u8 *inp,
+void gcm_ghash_rv64i_zvkg(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp,
     size_t len);

 #define AES_GCM_ENC_BYTES 64
@@ -495,7 +532,7 @@ void gcm_ghash_rv64i_zvkg(u64 Xi[2], const u128 Htable[16], const u8 *inp,

 #elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
 /* RISC-V 32 support */
-#include "riscv_arch.h"
+#include "arch/riscv_arch.h"

 int rv32i_zkne_set_encrypt_key(const unsigned char *userKey, const int bits,
     AES_KEY *key);
diff --git a/deps/openssl/openssl/include/crypto/asn1.h b/deps/openssl/openssl/include/crypto/asn1.h
index 1a890fc6bbd..ef5b836313f 100644
--- a/deps/openssl/openssl/include/crypto/asn1.h
+++ b/deps/openssl/openssl/include/crypto/asn1.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,6 +20,37 @@

 #include <openssl/core.h>

+#define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
+/*
+ * This indicates that the ASN1_STRING is not a real value but just a place
+ * holder for the location where indefinite length constructed data should be
+ * inserted in the memory buffer
+ */
+#define ASN1_STRING_FLAG_NDEF 0x010
+/*
+ * This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING
+ * type.
+ */
+#define ASN1_STRING_FLAG_MSTRING 0x040
+/* String is embedded and only content should be freed */
+#define ASN1_STRING_FLAG_EMBED 0x080
+
+/* Data is static and should not be freed. */
+#define ASN1_STRING_FLAG_DATA_NOT_OWNED 0x100
+
+/* This is the base type that holds just about everything :-) */
+struct asn1_string_st {
+    int length;
+    int type;
+    unsigned char *data OPENSSL_NONSTRING;
+    /*
+     * The value of the following field depends on the type being held.  It
+     * is mostly being used for BIT_STRING so if the input data has a
+     * non-zero 'unused bits' value, it will be handled correctly
+     */
+    long flags;
+};
+
 struct evp_pkey_asn1_method_st {
     int pkey_id;
     int pkey_base_id;
@@ -147,11 +178,39 @@ EVP_PKEY *ossl_d2i_PrivateKey_legacy(int keytype, EVP_PKEY **a,
     OSSL_LIB_CTX *libctx, const char *propq);
 X509_ALGOR *ossl_X509_ALGOR_from_nid(int nid, int ptype, void *pval);

-void ossl_asn1_string_set_bits_left(ASN1_STRING *str, unsigned int num);
+void ossl_asn1_bit_string_clear_unused_bits(ASN1_STRING *str);
+void ossl_asn1_bit_string_set_unused_bits(ASN1_STRING *str, unsigned int num);
+
+/**
+ * @brief Set str's data as ASN1_STRING_set1_data() does, and NUL-terminate it.
+ * The terminator is not counted in str->length.
+ * @param str the string to set
+ * @param data the bytes to copy, or NULL to allocate len bytes unset
+ * @param len the number of bytes at data
+ * @returns 1 on success, 0 on failure
+ * @see ASN1_STRING_set1_data(3)
+ */
+int ossl_asn1_string_set1_data(ASN1_STRING *str, const uint8_t *data,
+    size_t len);
+
+/**
+ * @brief Set str's data as ASN1_STRING_set1_string() does, and NUL-terminate it.
+ * The terminator is not counted in str->length.
+ * @param str the string to set
+ * @param c_string the NUL-terminated string to copy
+ * @returns 1 on success, 0 on failure
+ * @see ASN1_STRING_set1_string(3)
+ */
+int ossl_asn1_string_set1_string(ASN1_STRING *str, const char *c_string);

 int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
     long len, const ASN1_ITEM *it, int tag, int aclass,
     char opt, ASN1_TLC *ctx, int depth,
     OSSL_LIB_CTX *libctx, const char *propq);

+ASN1_TIME *ossl_asn1_time_from_tm(ASN1_TIME *s, struct tm *ts, int type);
+
+int ossl_utf8_getc_internal(const unsigned char *str, int len, uint32_t *val);
+int ossl_utf8_putc_internal(unsigned char *str, int len, uint32_t value);
+
 #endif /* ndef OSSL_CRYPTO_ASN1_H */
diff --git a/deps/openssl/openssl/include/crypto/asn1err.h b/deps/openssl/openssl/include/crypto/asn1err.h
deleted file mode 100644
index 62fdfd5e9bf..00000000000
--- a/deps/openssl/openssl/include/crypto/asn1err.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_ASN1ERR_H
-#define OSSL_CRYPTO_ASN1ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_ASN1_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/asyncerr.h b/deps/openssl/openssl/include/crypto/asyncerr.h
deleted file mode 100644
index 6a653247abf..00000000000
--- a/deps/openssl/openssl/include/crypto/asyncerr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_ASYNCERR_H
-#define OSSL_CRYPTO_ASYNCERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_ASYNC_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/bioerr.h b/deps/openssl/openssl/include/crypto/bioerr.h
deleted file mode 100644
index f30975213ef..00000000000
--- a/deps/openssl/openssl/include/crypto/bioerr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_BIOERR_H
-#define OSSL_CRYPTO_BIOERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_BIO_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/bn.h b/deps/openssl/openssl/include/crypto/bn.h
index b729b39f418..b51961c6ebd 100644
--- a/deps/openssl/openssl/include/crypto/bn.h
+++ b/deps/openssl/openssl/include/crypto/bn.h
@@ -112,17 +112,17 @@ int ossl_bn_check_generated_prime(const BIGNUM *w, int checks, BN_CTX *ctx,

 const BIGNUM *ossl_bn_get0_small_factors(void);

-int ossl_bn_rsa_fips186_4_gen_prob_primes(BIGNUM *p, BIGNUM *Xpout,
+int ossl_bn_rsa_fips186_5_gen_prob_primes(BIGNUM *p, BIGNUM *Xpout,
     BIGNUM *p1, BIGNUM *p2,
     const BIGNUM *Xp, const BIGNUM *Xp1,
     const BIGNUM *Xp2, int nlen,
     const BIGNUM *e, BN_CTX *ctx,
-    BN_GENCB *cb);
+    BN_GENCB *cb, uint32_t c);

-int ossl_bn_rsa_fips186_4_derive_prime(BIGNUM *Y, BIGNUM *X, const BIGNUM *Xin,
+int ossl_bn_rsa_fips186_5_derive_prime(BIGNUM *Y, BIGNUM *X, const BIGNUM *Xin,
     const BIGNUM *r1, const BIGNUM *r2,
     int nlen, const BIGNUM *e, BN_CTX *ctx,
-    BN_GENCB *cb);
+    BN_GENCB *cb, uint32_t c);

 OSSL_LIB_CTX *ossl_bn_get_libctx(BN_CTX *ctx);

@@ -141,7 +141,7 @@ int s390x_crt(BIGNUM *r, const BIGNUM *i, const BIGNUM *p, const BIGNUM *q,
 #endif

 int ossl_bn_mont_ctx_set(BN_MONT_CTX *ctx, const BIGNUM *modulus, int ri,
-    const unsigned char *rr, size_t rrlen,
+    const unsigned char *rr, int rrlen,
     uint32_t nlo, uint32_t nhi);

 int ossl_bn_mont_ctx_eq(const BN_MONT_CTX *m1, const BN_MONT_CTX *m2);
diff --git a/deps/openssl/openssl/include/crypto/bn_conf.h b/deps/openssl/openssl/include/crypto/bn_conf.h
deleted file mode 100644
index 79400c6472a..00000000000
--- a/deps/openssl/openssl/include/crypto/bn_conf.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/bn_conf.h"
diff --git a/deps/openssl/openssl/include/crypto/bn_conf.h.in b/deps/openssl/openssl/include/crypto/bn_conf.h.in
deleted file mode 100644
index 1c1126fee06..00000000000
--- a/deps/openssl/openssl/include/crypto/bn_conf.h.in
+++ /dev/null
@@ -1,36 +0,0 @@
-/* clang-format off */
-{- join("\n",map { "/* $_ */" } @autowarntext) -}
-/* clang-format on */
-/*
- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_BN_CONF_H
-#define OSSL_CRYPTO_BN_CONF_H
-#pragma once
-
-/*
- * The contents of this file are not used in the UEFI build, as
- * both 32-bit and 64-bit builds are supported from a single run
- * of the Configure script.
- */
-
-/* Should we define BN_DIV2W here? */
-
-/* Only one for the following should be defined */
-/* clang-format off */
-{- $config{b64l} ? "#define" : "#undef" -} SIXTY_FOUR_BIT_LONG
-    /* clang-format on */
-    /* clang-format off */
-{- $config{b64}  ? "#define" : "#undef" -} SIXTY_FOUR_BIT
-    /* clang-format on */
-    /* clang-format off */
-{- $config{b32}  ? "#define" : "#undef" -} THIRTY_TWO_BIT
-/* clang-format on */
-
-#endif
diff --git a/deps/openssl/openssl/include/crypto/bn_dh.h b/deps/openssl/openssl/include/crypto/bn_dh.h
index a634a6f8f88..c0142bc77e9 100644
--- a/deps/openssl/openssl/include/crypto/bn_dh.h
+++ b/deps/openssl/openssl/include/crypto/bn_dh.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,11 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_CRYPTO_BN_DH_H)
+#define OSSL_CRYPTO_BN_DH_H
+
+#include <openssl/bn.h>
+
 #define declare_dh_bn(x)                       \
     extern const BIGNUM ossl_bignum_dh##x##_p; \
     extern const BIGNUM ossl_bignum_dh##x##_q; \
@@ -41,3 +46,5 @@ extern const BIGNUM ossl_bignum_modp_3072_q;
 extern const BIGNUM ossl_bignum_modp_4096_q;
 extern const BIGNUM ossl_bignum_modp_6144_q;
 extern const BIGNUM ossl_bignum_modp_8192_q;
+
+#endif /* !defined(OSSL_CRYPTO_BN_DH_H) */
diff --git a/deps/openssl/openssl/include/crypto/bn_srp.h b/deps/openssl/openssl/include/crypto/bn_srp.h
index 00b160aad12..831f8d27cf3 100644
--- a/deps/openssl/openssl/include/crypto/bn_srp.h
+++ b/deps/openssl/openssl/include/crypto/bn_srp.h
@@ -1,14 +1,18 @@
 /*
- * Copyright 2014-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2014-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
+#if !defined(OPENSSL_CRYPTO_BN_SRP_H)
+#define OPENSSL_CRYPTO_BN_SRP_H

 #ifndef OPENSSL_NO_SRP

+#include <openssl/bn.h>
+
 extern const BIGNUM ossl_bn_group_1024;

 extern const BIGNUM ossl_bn_group_1536;
@@ -30,3 +34,4 @@ extern const BIGNUM ossl_bn_generator_5;
 extern const BIGNUM ossl_bn_generator_2;

 #endif
+#endif /* !defined(OPENSSL_CRYPTO_BN_SRP_H) */
diff --git a/deps/openssl/openssl/include/crypto/bnerr.h b/deps/openssl/openssl/include/crypto/bnerr.h
deleted file mode 100644
index 96b3a8dfba1..00000000000
--- a/deps/openssl/openssl/include/crypto/bnerr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_BNERR_H
-#define OSSL_CRYPTO_BNERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_BN_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/buffererr.h b/deps/openssl/openssl/include/crypto/buffererr.h
deleted file mode 100644
index 21caac21f54..00000000000
--- a/deps/openssl/openssl/include/crypto/buffererr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_BUFFERERR_H
-#define OSSL_CRYPTO_BUFFERERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_BUF_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/cmac.h b/deps/openssl/openssl/include/crypto/cmac.h
index 4f4eba949e1..5ec521a416c 100644
--- a/deps/openssl/openssl/include/crypto/cmac.h
+++ b/deps/openssl/openssl/include/crypto/cmac.h
@@ -16,7 +16,6 @@
 #include <openssl/params.h>

 int ossl_cmac_init(CMAC_CTX *ctx, const void *key, size_t keylen,
-    const EVP_CIPHER *cipher, ENGINE *impl,
-    const OSSL_PARAM param[]);
+    const EVP_CIPHER *cipher, const OSSL_PARAM param[]);

 #endif /* OSSL_CRYPTO_CMAC_H */
diff --git a/deps/openssl/openssl/include/crypto/cmll_platform.h b/deps/openssl/openssl/include/crypto/cmll_platform.h
index 02ed385c059..f1e28eb8b4f 100644
--- a/deps/openssl/openssl/include/crypto/cmll_platform.h
+++ b/deps/openssl/openssl/include/crypto/cmll_platform.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,7 +14,7 @@
 #if defined(CMLL_ASM) && (defined(__sparc) || defined(__sparc__))

 /* Fujitsu SPARC64 X support */
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #ifndef OPENSSL_NO_CAMELLIA
 #define SPARC_CMLL_CAPABLE (OPENSSL_sparcv9cap_P[1] & CFR_CAMELLIA)
diff --git a/deps/openssl/openssl/include/crypto/cmperr.h b/deps/openssl/openssl/include/crypto/cmperr.h
deleted file mode 100644
index ea3ac24d270..00000000000
--- a/deps/openssl/openssl/include/crypto/cmperr.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_CMPERR_H
-#define OSSL_CRYPTO_CMPERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef OPENSSL_NO_CMP
-
-int ossl_err_load_CMP_strings(void);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/cmserr.h b/deps/openssl/openssl/include/crypto/cmserr.h
deleted file mode 100644
index f9fd933682e..00000000000
--- a/deps/openssl/openssl/include/crypto/cmserr.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_CMSERR_H
-#define OSSL_CRYPTO_CMSERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef OPENSSL_NO_CMS
-
-int ossl_err_load_CMS_strings(void);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/comperr.h b/deps/openssl/openssl/include/crypto/comperr.h
deleted file mode 100644
index b12b70cc8b0..00000000000
--- a/deps/openssl/openssl/include/crypto/comperr.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_COMPERR_H
-#define OSSL_CRYPTO_COMPERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef OPENSSL_NO_COMP
-
-int ossl_err_load_COMP_strings(void);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/conferr.h b/deps/openssl/openssl/include/crypto/conferr.h
deleted file mode 100644
index 4e0474290bb..00000000000
--- a/deps/openssl/openssl/include/crypto/conferr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_CONFERR_H
-#define OSSL_CRYPTO_CONFERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_CONF_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/context.h b/deps/openssl/openssl/include/crypto/context.h
index 1c181933e02..6715f9219d2 100644
--- a/deps/openssl/openssl/include/crypto/context.h
+++ b/deps/openssl/openssl/include/crypto/context.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_CRYPTO_CONTEXT_H)
+#define OSSL_CRYPTO_CONTEXT_H
+
 #include <openssl/core.h>

 void *ossl_provider_store_new(OSSL_LIB_CTX *);
@@ -23,7 +26,7 @@ void *ossl_self_test_set_callback_new(OSSL_LIB_CTX *);
 void *ossl_indicator_set_callback_new(OSSL_LIB_CTX *);
 void *ossl_rand_crng_ctx_new(OSSL_LIB_CTX *);
 int ossl_thread_register_fips(OSSL_LIB_CTX *);
-void *ossl_thread_event_ctx_new(OSSL_LIB_CTX *);
+int ossl_thread_event_ctx_new(OSSL_LIB_CTX *);
 void *ossl_fips_prov_ossl_ctx_new(OSSL_LIB_CTX *);
 #if defined(OPENSSL_THREADS)
 void *ossl_threads_ctx_new(OSSL_LIB_CTX *);
@@ -42,9 +45,11 @@ void ossl_prov_drbg_nonce_ctx_free(void *);
 void ossl_indicator_set_callback_free(void *cb);
 void ossl_self_test_set_callback_free(void *);
 void ossl_rand_crng_ctx_free(void *);
-void ossl_thread_event_ctx_free(void *);
+void ossl_thread_event_ctx_free(OSSL_LIB_CTX *);
 void ossl_fips_prov_ossl_ctx_free(void *);
 void ossl_release_default_drbg_ctx(void);
 #if defined(OPENSSL_THREADS)
 void ossl_threads_ctx_free(void *);
 #endif
+
+#endif /* !defined(OSSL_CRYPTO_CONTEXT_H) */
diff --git a/deps/openssl/openssl/include/crypto/crmferr.h b/deps/openssl/openssl/include/crypto/crmferr.h
deleted file mode 100644
index 8216e7fcf74..00000000000
--- a/deps/openssl/openssl/include/crypto/crmferr.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_CRMFERR_H
-#define OSSL_CRYPTO_CRMFERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef OPENSSL_NO_CRMF
-
-int ossl_err_load_CRMF_strings(void);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/cryptoerr.h b/deps/openssl/openssl/include/crypto/cryptoerr.h
deleted file mode 100644
index f4a2389907a..00000000000
--- a/deps/openssl/openssl/include/crypto/cryptoerr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_CRYPTOERR_H
-#define OSSL_CRYPTO_CRYPTOERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_CRYPTO_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/cterr.h b/deps/openssl/openssl/include/crypto/cterr.h
deleted file mode 100644
index 0af2d31516f..00000000000
--- a/deps/openssl/openssl/include/crypto/cterr.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_CTERR_H
-#define OSSL_CRYPTO_CTERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef OPENSSL_NO_CT
-
-int ossl_err_load_CT_strings(void);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/decoder.h b/deps/openssl/openssl/include/crypto/decoder.h
index fcb914faeb6..ef143f92005 100644
--- a/deps/openssl/openssl/include/crypto/decoder.h
+++ b/deps/openssl/openssl/include/crypto/decoder.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,7 +20,7 @@
  * (provider-object(7)).
  */
 void *ossl_decoder_from_algorithm(int id, const OSSL_ALGORITHM *algodef,
-    OSSL_PROVIDER *prov);
+    OSSL_PROVIDER *prov, int no_store);

 OSSL_DECODER_INSTANCE *
 ossl_decoder_instance_new_forprov(OSSL_DECODER *decoder, void *provctx,
diff --git a/deps/openssl/openssl/include/crypto/decodererr.h b/deps/openssl/openssl/include/crypto/decodererr.h
deleted file mode 100644
index c1aadca3652..00000000000
--- a/deps/openssl/openssl/include/crypto/decodererr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_DECODERERR_H
-#define OSSL_CRYPTO_DECODERERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_OSSL_DECODER_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/des_platform.h b/deps/openssl/openssl/include/crypto/des_platform.h
index e0210c664f7..4805ba784f4 100644
--- a/deps/openssl/openssl/include/crypto/des_platform.h
+++ b/deps/openssl/openssl/include/crypto/des_platform.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,7 +14,7 @@
 #if defined(DES_ASM) && (defined(__sparc) || defined(__sparc__))

 /* Fujitsu SPARC64 X support */
-#include "crypto/sparc_arch.h"
+#include "arch/sparc_arch.h"

 #ifndef OPENSSL_NO_DES
 #define SPARC_DES_CAPABLE (OPENSSL_sparcv9cap_P[1] & CFR_DES)
diff --git a/deps/openssl/openssl/include/crypto/dh.h b/deps/openssl/openssl/include/crypto/dh.h
index 89f25c049df..fb7430cfbaf 100644
--- a/deps/openssl/openssl/include/crypto/dh.h
+++ b/deps/openssl/openssl/include/crypto/dh.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -18,6 +18,7 @@

 DH *ossl_dh_new_by_nid_ex(OSSL_LIB_CTX *libctx, int nid);
 DH *ossl_dh_new_ex(OSSL_LIB_CTX *libctx);
+OSSL_LIB_CTX *ossl_dh_get0_libctx(const DH *dh);
 void ossl_dh_set0_libctx(DH *d, OSSL_LIB_CTX *libctx);
 int ossl_dh_generate_ffc_parameters(DH *dh, int type, int pbits, int qbits,
     BN_GENCB *cb);
@@ -33,9 +34,10 @@ FFC_PARAMS *ossl_dh_get0_params(DH *dh);
 int ossl_dh_get0_nid(const DH *dh);
 int ossl_dh_params_fromdata(DH *dh, const OSSL_PARAM params[]);
 int ossl_dh_key_fromdata(DH *dh, const OSSL_PARAM params[], int include_private);
-int ossl_dh_params_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[]);
-int ossl_dh_key_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[],
-    int include_private);
+int ossl_dh_params_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM *privlen,
+    const FFC_OSSL_PARAMS *pp);
+int ossl_dh_key_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM *pubkey,
+    OSSL_PARAM *privkey, int include_private);
 DH *ossl_dh_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf,
     OSSL_LIB_CTX *libctx, const char *propq);
 int ossl_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
diff --git a/deps/openssl/openssl/include/crypto/dherr.h b/deps/openssl/openssl/include/crypto/dherr.h
deleted file mode 100644
index 00ea8fe667b..00000000000
--- a/deps/openssl/openssl/include/crypto/dherr.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_DHERR_H
-#define OSSL_CRYPTO_DHERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef OPENSSL_NO_DH
-
-int ossl_err_load_DH_strings(void);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/dsa.h b/deps/openssl/openssl/include/crypto/dsa.h
index 73a61e7a88b..c8272a00479 100644
--- a/deps/openssl/openssl/include/crypto/dsa.h
+++ b/deps/openssl/openssl/include/crypto/dsa.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -25,6 +25,7 @@
 #define DSA_PARAMGEN_TYPE_FIPS_DEFAULT 2

 DSA *ossl_dsa_new(OSSL_LIB_CTX *libctx);
+OSSL_LIB_CTX *ossl_dsa_get0_libctx(const DSA *d);
 void ossl_dsa_set0_libctx(DSA *d, OSSL_LIB_CTX *libctx);

 int ossl_dsa_generate_ffc_parameters(DSA *dsa, int type, int pbits, int qbits,
diff --git a/deps/openssl/openssl/include/crypto/dsaerr.h b/deps/openssl/openssl/include/crypto/dsaerr.h
deleted file mode 100644
index f4a886b1ac5..00000000000
--- a/deps/openssl/openssl/include/crypto/dsaerr.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_DSAERR_H
-#define OSSL_CRYPTO_DSAERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef OPENSSL_NO_DSA
-
-int ossl_err_load_DSA_strings(void);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/dso_conf.h b/deps/openssl/openssl/include/crypto/dso_conf.h
deleted file mode 100644
index e7f2afa9872..00000000000
--- a/deps/openssl/openssl/include/crypto/dso_conf.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/dso_conf.h"
diff --git a/deps/openssl/openssl/include/crypto/ec.h b/deps/openssl/openssl/include/crypto/ec.h
index 22f614cccd3..cb648bcf952 100644
--- a/deps/openssl/openssl/include/crypto/ec.h
+++ b/deps/openssl/openssl/include/crypto/ec.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -26,6 +26,55 @@ int evp_pkey_ctx_set_ec_param_enc_prov(EVP_PKEY_CTX *ctx, int param_enc);
 #include <openssl/ec.h>
 #include "crypto/types.h"

+typedef struct ec_params_st {
+    /* Domain parameters */
+    OSSL_PARAM *group_name;
+    OSSL_PARAM *encoding;
+    OSSL_PARAM *pt_format;
+    OSSL_PARAM *field_type;
+    OSSL_PARAM *p;
+    OSSL_PARAM *a;
+    OSSL_PARAM *b;
+    OSSL_PARAM *generator;
+    OSSL_PARAM *order;
+    OSSL_PARAM *cofactor;
+    OSSL_PARAM *seed;
+    OSSL_PARAM *decoded;
+
+    /* Key and other parameters */
+    OSSL_PARAM *pub;
+    OSSL_PARAM *priv;
+    OSSL_PARAM *pub_x;
+    OSSL_PARAM *pub_y;
+    OSSL_PARAM *encoded_pub;
+    OSSL_PARAM *use_cofactor;
+    OSSL_PARAM *include_public;
+    OSSL_PARAM *group_check;
+
+    /* Key information */
+    OSSL_PARAM *bits;
+    OSSL_PARAM *field_degree;
+    OSSL_PARAM *secbits;
+    OSSL_PARAM *maxsize;
+    OSSL_PARAM *seccat;
+    OSSL_PARAM *default_digest;
+
+    /* Characteristic two field information */
+    OSSL_PARAM *char2_m;
+    OSSL_PARAM *char2_type;
+    OSSL_PARAM *char2_tp;
+    OSSL_PARAM *char2_k1;
+    OSSL_PARAM *char2_k2;
+    OSSL_PARAM *char2_k3;
+
+    /* Generation parameters */
+    OSSL_PARAM *dhkem_ikm;
+#ifdef FIPS_MODULE
+    OSSL_PARAM *fips_key_check;
+    OSSL_PARAM *fips_indicator;
+#endif
+} EC_PARAMS;
+
 /*-
  * Computes the multiplicative inverse of x in the range
  * [1,EC_GROUP::order), where EC_GROUP::order is the cardinality of the
@@ -72,11 +121,23 @@ int ossl_ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
     OSSL_PARAM params[], OSSL_LIB_CTX *libctx,
     const char *propq,
     BN_CTX *bnctx, unsigned char **genbuf);
+int ossl_ec_group_todata_parsed(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
+    const EC_PARAMS *params, OSSL_LIB_CTX *libctx,
+    const char *propq,
+    BN_CTX *bnctx, unsigned char **genbuf);
 int ossl_ec_group_fromdata(EC_KEY *ec, const OSSL_PARAM params[]);
+int ossl_ec_group_fromdata_parsed(EC_KEY *ec, const EC_PARAMS *params);
 int ossl_ec_group_set_params(EC_GROUP *group, const OSSL_PARAM params[]);
+int ossl_ec_group_set_params_parsed(EC_GROUP *group, const EC_PARAMS *params);
+EC_GROUP *ossl_ec_group_new_from_params_parsed(const EC_PARAMS *params,
+    OSSL_LIB_CTX *libctx, const char *propq);
 int ossl_ec_key_fromdata(EC_KEY *ecx, const OSSL_PARAM params[],
     int include_private);
+int ossl_ec_key_fromdata_parsed(EC_KEY *ecx, const EC_PARAMS *params,
+    int include_private);
 int ossl_ec_key_otherparams_fromdata(EC_KEY *ec, const OSSL_PARAM params[]);
+int ossl_ec_key_otherparams_fromdata_parsed(EC_KEY *ec,
+    const EC_PARAMS *params);
 int ossl_ec_key_is_foreign(const EC_KEY *ec);
 EC_KEY *ossl_ec_key_dup(const EC_KEY *key, int selection);
 int ossl_x509_algor_is_sm2(const X509_ALGOR *palg);
diff --git a/deps/openssl/openssl/include/crypto/ec_params.h.in b/deps/openssl/openssl/include/crypto/ec_params.h.in
new file mode 100644
index 00000000000..700fa8bae8f
--- /dev/null
+++ b/deps/openssl/openssl/include/crypto/ec_params.h.in
@@ -0,0 +1,263 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_EC_PARAMS_H
+#define OSSL_CRYPTO_EC_PARAMS_H
+
+/* clang-format off */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+#include "crypto/ec.h"
+#include <openssl/core_names.h>
+#include <openssl/err.h>
+#include <openssl/proverr.h>
+
+{-
+our @EC_GROUP_NAME_TYPES = (
+    ['OSSL_PKEY_PARAM_GROUP_NAME',                      'group_name', 'utf8_string'],
+);
+
+our @EC_ENCODING_TYPES = (
+    ['OSSL_PKEY_PARAM_EC_ENCODING',                     'encoding',   'utf8_string'],
+);
+
+our @EC_POINT_FORMAT_TYPES = (
+    ['OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT',      'pt_format',  'utf8_string', 'duplicate: first'],
+);
+
+our @EC_FIELD_TYPE_TYPES = (
+    ['OSSL_PKEY_PARAM_EC_FIELD_TYPE',                   'field_type', 'utf8_string'],
+);
+
+our @EC_EXPLICIT_CURVE_TYPES = (
+    ['OSSL_PKEY_PARAM_EC_P',                            'p',          'BN'],
+    ['OSSL_PKEY_PARAM_EC_A',                            'a',          'BN'],
+    ['OSSL_PKEY_PARAM_EC_B',                            'b',          'BN'],
+    ['OSSL_PKEY_PARAM_EC_GENERATOR',                    'generator',  'octet_string'],
+    ['OSSL_PKEY_PARAM_EC_ORDER',                        'order',      'BN'],
+    ['OSSL_PKEY_PARAM_EC_COFACTOR',                     'cofactor',   'BN'],
+);
+
+our @EC_SEED_TYPES = (
+    ['OSSL_PKEY_PARAM_EC_SEED',                         'seed',       'octet_string'],
+);
+
+our @EC_DECODED_TYPES = (
+    ['OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS', 'decoded',    'int'],
+);
+
+our @EC_DOMAIN_TYPES = (
+    @EC_GROUP_NAME_TYPES,
+    @EC_ENCODING_TYPES,
+    @EC_POINT_FORMAT_TYPES,
+    @EC_FIELD_TYPE_TYPES,
+    @EC_EXPLICIT_CURVE_TYPES,
+    @EC_SEED_TYPES,
+    @EC_DECODED_TYPES,
+);
+
+our @EC_PRIVATE_KEY_TYPES = (
+    ['OSSL_PKEY_PARAM_PRIV_KEY', 'priv', 'BN'],
+);
+
+our @EC_PUBLIC_KEY_TYPES = (
+    ['OSSL_PKEY_PARAM_PUB_KEY', 'pub', 'octet_string'],
+);
+
+our @EC_KEY_TYPES = (
+    @EC_PUBLIC_KEY_TYPES,
+    @EC_PRIVATE_KEY_TYPES,
+);
+
+our @EC_COFACTOR_MODE_TYPES = (
+    ['OSSL_PKEY_PARAM_USE_COFACTOR_ECDH',   'use_cofactor',   'int'],
+);
+
+our @EC_INCLUDE_PUBLIC_TYPES = (
+    ['OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC',   'include_public', 'int'],
+);
+
+our @EC_GROUP_CHECK_TYPES = (
+    ['OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE', 'group_check',    'utf8_string'],
+);
+
+our @EC_OTHER_TYPES = (
+    @EC_COFACTOR_MODE_TYPES,
+    @EC_INCLUDE_PUBLIC_TYPES,
+    @EC_GROUP_CHECK_TYPES,
+);
+
+our @EC_COMMON_INFO_TYPES = (
+    ['OSSL_PKEY_PARAM_BITS',               'bits',           'int'],
+    ['OSSL_PKEY_PARAM_EC_FIELD_DEGREE',    'field_degree',   'int'],
+    ['OSSL_PKEY_PARAM_SECURITY_BITS',      'secbits',        'int'],
+    ['OSSL_PKEY_PARAM_MAX_SIZE',           'maxsize',        'int'],
+);
+
+our @EC_SECURITY_CATEGORY_INFO_TYPES = (
+    ['OSSL_PKEY_PARAM_SECURITY_CATEGORY',  'seccat',         'int'],
+);
+
+our @EC_DIGEST_INFO_TYPES = (
+    ['OSSL_PKEY_PARAM_DEFAULT_DIGEST',     'default_digest', 'utf8_string'],
+);
+
+our @EC_ENCODED_PUBLIC_KEY_TYPES = (
+    ['OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY', 'encoded_pub',    'octet_string'],
+);
+
+our @EC_AFFINE_PUBLIC_KEY_TYPES = (
+    ['OSSL_PKEY_PARAM_EC_PUB_X',           'pub_x',          'BN'],
+    ['OSSL_PKEY_PARAM_EC_PUB_Y',           'pub_y',          'BN'],
+);
+
+our @EC_INFO_TYPES = (
+    @EC_COMMON_INFO_TYPES,
+    @EC_SECURITY_CATEGORY_INFO_TYPES,
+    @EC_DIGEST_INFO_TYPES,
+    @EC_ENCODED_PUBLIC_KEY_TYPES,
+    @EC_AFFINE_PUBLIC_KEY_TYPES,
+);
+
+our @EC2M_INFO_TYPES = (
+    ['OSSL_PKEY_PARAM_EC_CHAR2_M',        'char2_m',    'int',
+     '#if !defined(OPENSSL_NO_EC2M)'],
+    ['OSSL_PKEY_PARAM_EC_CHAR2_TYPE',     'char2_type', 'utf8_string',
+     '#if !defined(OPENSSL_NO_EC2M)'],
+    ['OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS', 'char2_tp',   'int',
+     '#if !defined(OPENSSL_NO_EC2M)'],
+    ['OSSL_PKEY_PARAM_EC_CHAR2_PP_K1',    'char2_k1',   'int',
+     '#if !defined(OPENSSL_NO_EC2M)'],
+    ['OSSL_PKEY_PARAM_EC_CHAR2_PP_K2',    'char2_k2',   'int',
+     '#if !defined(OPENSSL_NO_EC2M)'],
+    ['OSSL_PKEY_PARAM_EC_CHAR2_PP_K3',    'char2_k3',   'int',
+     '#if !defined(OPENSSL_NO_EC2M)'],
+);
+
+our @EC_SETTABLE_TYPES = (
+    @EC_COFACTOR_MODE_TYPES,
+    @EC_ENCODED_PUBLIC_KEY_TYPES,
+    @EC_ENCODING_TYPES,
+    @EC_POINT_FORMAT_TYPES,
+    @EC_SEED_TYPES,
+    @EC_INCLUDE_PUBLIC_TYPES,
+    @EC_GROUP_CHECK_TYPES,
+);
+
+our @EC_DHKEM_GEN_TYPES = (
+    ['OSSL_PKEY_PARAM_DHKEM_IKM',      'dhkem_ikm',      'octet_string', '!fips'],
+);
+
+our @EC_FIPS_GEN_TYPES = (
+    ['OSSL_PKEY_PARAM_FIPS_KEY_CHECK', 'fips_key_check', 'int',          'fips'],
+);
+
+our @EC_GEN_TYPES = (
+    @EC_GROUP_NAME_TYPES,
+    @EC_COFACTOR_MODE_TYPES,
+    @EC_ENCODING_TYPES,
+    @EC_POINT_FORMAT_TYPES,
+    @EC_FIELD_TYPE_TYPES,
+    @EC_GROUP_CHECK_TYPES,
+    @EC_EXPLICIT_CURVE_TYPES,
+    @EC_SEED_TYPES,
+    @EC_DHKEM_GEN_TYPES,
+    @EC_FIPS_GEN_TYPES,
+);
+
+return "";
+-}
+
+/* Selection-specific provider import and export declarations. */
+{-
+my $imexport = "";
+
+# Compact bit flags used to index ec_types in ec_kmgmt.c.
+my $private_key_type = 1;
+my $public_key_type = 2;
+my $domain_type = 4;
+my $other_parameters_type = 8;
+my $all_types = $private_key_type | $public_key_type
+    | $domain_type | $other_parameters_type;
+
+for my $selection ($private_key_type..$all_types) {
+    my @types = ();
+
+    push @types, @EC_PRIVATE_KEY_TYPES
+        if ($selection & $private_key_type);
+    push @types, @EC_PUBLIC_KEY_TYPES
+        if ($selection & $public_key_type);
+    push @types, @EC_DOMAIN_TYPES if ($selection & $domain_type);
+    push @types, @EC_OTHER_TYPES if ($selection & $other_parameters_type);
+    $imexport .= "#define ec_imexport_types_"
+        . "${selection}_st ec_params_st\n";
+    $imexport .= produce_param_decoder(
+        "ec_imexport_types_${selection}", @types);
+    $imexport .= "\n";
+}
+$imexport;
+-}
+
+/* Public EC compatibility functions retain their existing signatures. */
+#define ec_group_fromdata_st ec_params_st
+{- produce_param_decoder('ec_group_fromdata', @EC_DOMAIN_TYPES); -}
+
+#define ec_group_todata_st ec_params_st
+{- produce_param_decoder('ec_group_todata', @EC_DOMAIN_TYPES); -}
+
+#define ec_key_fromdata_st ec_params_st
+{- produce_param_decoder('ec_key_fromdata', @EC_KEY_TYPES); -}
+
+#define ec_key_otherparams_fromdata_st ec_params_st
+{- produce_param_decoder('ec_key_otherparams_fromdata', @EC_OTHER_TYPES,
+                         @EC_POINT_FORMAT_TYPES); -}
+
+#define ec_pkey_import_from_st ec_params_st
+{- produce_param_decoder('ec_pkey_import_from',
+                         (@EC_DOMAIN_TYPES, @EC_KEY_TYPES, @EC_OTHER_TYPES)); -}
+
+/* Keymgmt get and set parameter surfaces. */
+#define ec_get_params_st ec_params_st
+{- produce_param_decoder('ec_get_params',
+                         (@EC_INFO_TYPES, @EC_DOMAIN_TYPES, @EC2M_INFO_TYPES,
+                          @EC_KEY_TYPES, @EC_OTHER_TYPES)); -}
+
+#define sm2_get_params_st ec_params_st
+{- produce_param_decoder('sm2_get_params',
+                         (@EC_COMMON_INFO_TYPES, @EC_DIGEST_INFO_TYPES,
+                          @EC_ENCODED_PUBLIC_KEY_TYPES, @EC_DOMAIN_TYPES,
+                          @EC_KEY_TYPES, @EC_AFFINE_PUBLIC_KEY_TYPES)); -}
+
+#define ec_set_params_st ec_params_st
+{- produce_param_decoder('ec_set_params', @EC_SETTABLE_TYPES); -}
+
+#define sm2_set_params_st ec_params_st
+{- produce_param_decoder('sm2_set_params', @EC_SETTABLE_TYPES); -}
+
+/* Key generation context parameters. */
+#define ec_gen_set_params_st ec_params_st
+{- produce_param_decoder('ec_gen_set_params', @EC_GEN_TYPES); -}
+
+#define sm2_gen_set_params_st ec_params_st
+{- produce_param_decoder('sm2_gen_set_params',
+                         (@EC_GROUP_NAME_TYPES, @EC_ENCODING_TYPES,
+                          @EC_POINT_FORMAT_TYPES, @EC_FIELD_TYPE_TYPES,
+                          @EC_EXPLICIT_CURVE_TYPES, @EC_SEED_TYPES)); -}
+
+#define ec_gen_get_params_st ec_params_st
+{- produce_param_decoder('ec_gen_get_params',
+                         ['OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR',
+                          'fips_indicator', 'int', 'fips']); -}
+
+/* clang-format on */
+
+#endif
diff --git a/deps/openssl/openssl/include/crypto/ecerr.h b/deps/openssl/openssl/include/crypto/ecerr.h
deleted file mode 100644
index 22003a3025c..00000000000
--- a/deps/openssl/openssl/include/crypto/ecerr.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_ECERR_H
-#define OSSL_CRYPTO_ECERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef OPENSSL_NO_EC
-
-int ossl_err_load_EC_strings(void);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/ecx.h b/deps/openssl/openssl/include/crypto/ecx.h
index f388b2e000e..44ddec18d58 100644
--- a/deps/openssl/openssl/include/crypto/ecx.h
+++ b/deps/openssl/openssl/include/crypto/ecx.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -138,7 +138,8 @@ ECX_KEY *ossl_ecx_key_op(const X509_ALGOR *palg,
     OSSL_LIB_CTX *libctx, const char *propq);

 int ossl_ecx_public_from_private(ECX_KEY *key);
-int ossl_ecx_key_fromdata(ECX_KEY *ecx, const OSSL_PARAM params[],
+int ossl_ecx_key_fromdata(ECX_KEY *ecx, const OSSL_PARAM *param_pub_key,
+    const OSSL_PARAM *param_priv_key,
     int include_private);
 ECX_KEY *ossl_ecx_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf,
     OSSL_LIB_CTX *libctx, const char *propq);
diff --git a/deps/openssl/openssl/include/crypto/encodererr.h b/deps/openssl/openssl/include/crypto/encodererr.h
deleted file mode 100644
index db930a5dc2d..00000000000
--- a/deps/openssl/openssl/include/crypto/encodererr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_ENCODERERR_H
-#define OSSL_CRYPTO_ENCODERERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_OSSL_ENCODER_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/engine.h b/deps/openssl/openssl/include/crypto/engine.h
deleted file mode 100644
index fac6ed0966a..00000000000
--- a/deps/openssl/openssl/include/crypto/engine.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/engine.h>
-
-void engine_load_openssl_int(void);
-void engine_load_devcrypto_int(void);
-void engine_load_rdrand_int(void);
-void engine_load_dynamic_int(void);
-void engine_load_padlock_int(void);
-void engine_load_capi_int(void);
-void engine_load_dasync_int(void);
-void engine_load_afalg_int(void);
-void engine_cleanup_int(void);
diff --git a/deps/openssl/openssl/include/crypto/engineerr.h b/deps/openssl/openssl/include/crypto/engineerr.h
deleted file mode 100644
index e5d3c572c88..00000000000
--- a/deps/openssl/openssl/include/crypto/engineerr.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_ENGINEERR_H
-#define OSSL_CRYPTO_ENGINEERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef OPENSSL_NO_ENGINE
-
-int ossl_err_load_ENGINE_strings(void);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/ess.h b/deps/openssl/openssl/include/crypto/ess.h
index c29752117e4..779903e11ce 100644
--- a/deps/openssl/openssl/include/crypto/ess.h
+++ b/deps/openssl/openssl/include/crypto/ess.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,10 @@
 #define OSSL_CRYPTO_ESS_H
 #pragma once

+#include <openssl/asn1.h>
+#include <openssl/ess.h>
+#include <openssl/safestack.h>
+
 /*-
  * IssuerSerial ::= SEQUENCE {
  *        issuer                  GeneralNames,
diff --git a/deps/openssl/openssl/include/crypto/esserr.h b/deps/openssl/openssl/include/crypto/esserr.h
deleted file mode 100644
index 7766d05cd92..00000000000
--- a/deps/openssl/openssl/include/crypto/esserr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_ESSERR_H
-#define OSSL_CRYPTO_ESSERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_ESS_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/evp.h b/deps/openssl/openssl/include/crypto/evp.h
index 443bfe8141a..eca29a74382 100644
--- a/deps/openssl/openssl/include/crypto/evp.h
+++ b/deps/openssl/openssl/include/crypto/evp.h
@@ -119,18 +119,12 @@ struct evp_pkey_ctx_st {

     /* EVP_PKEY identity */
     int legacy_keytype;
-    /* Method associated with this operation */
-    const EVP_PKEY_METHOD *pmeth;
-    /* Engine that implements this method or NULL if builtin */
-    ENGINE *engine;
     /* Key: may be NULL */
     EVP_PKEY *pkey;
     /* Peer key for key agreement, may be NULL */
     EVP_PKEY *peerkey;
     /* Algorithm specific data */
     void *data;
-    /* Indicator if digest_custom needs to be called */
-    unsigned int flag_call_digest_custom : 1;
     /*
      * Used to support taking custody of memory in the case of a provider being
      * used with the deprecated EVP_PKEY_CTX_set_rsa_keygen_pubexp() API. This
@@ -142,73 +136,12 @@ struct evp_pkey_ctx_st {

 #define EVP_PKEY_FLAG_DYNAMIC 1

-struct evp_pkey_method_st {
-    int pkey_id;
-    int flags;
-    int (*init)(EVP_PKEY_CTX *ctx);
-    int (*copy)(EVP_PKEY_CTX *dst, const EVP_PKEY_CTX *src);
-    void (*cleanup)(EVP_PKEY_CTX *ctx);
-    int (*paramgen_init)(EVP_PKEY_CTX *ctx);
-    int (*paramgen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
-    int (*keygen_init)(EVP_PKEY_CTX *ctx);
-    int (*keygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
-    int (*sign_init)(EVP_PKEY_CTX *ctx);
-    int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
-        const unsigned char *tbs, size_t tbslen);
-    int (*verify_init)(EVP_PKEY_CTX *ctx);
-    int (*verify)(EVP_PKEY_CTX *ctx,
-        const unsigned char *sig, size_t siglen,
-        const unsigned char *tbs, size_t tbslen);
-    int (*verify_recover_init)(EVP_PKEY_CTX *ctx);
-    int (*verify_recover)(EVP_PKEY_CTX *ctx,
-        unsigned char *rout, size_t *routlen,
-        const unsigned char *sig, size_t siglen);
-    int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
-    int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
-        EVP_MD_CTX *mctx);
-    int (*verifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
-    int (*verifyctx)(EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen,
-        EVP_MD_CTX *mctx);
-    int (*encrypt_init)(EVP_PKEY_CTX *ctx);
-    int (*encrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
-        const unsigned char *in, size_t inlen);
-    int (*decrypt_init)(EVP_PKEY_CTX *ctx);
-    int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
-        const unsigned char *in, size_t inlen);
-    int (*derive_init)(EVP_PKEY_CTX *ctx);
-    int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
-    int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2);
-    int (*ctrl_str)(EVP_PKEY_CTX *ctx, const char *type, const char *value);
-    int (*digestsign)(EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen,
-        const unsigned char *tbs, size_t tbslen);
-    int (*digestverify)(EVP_MD_CTX *ctx, const unsigned char *sig,
-        size_t siglen, const unsigned char *tbs,
-        size_t tbslen);
-    int (*check)(EVP_PKEY *pkey);
-    int (*public_check)(EVP_PKEY *pkey);
-    int (*param_check)(EVP_PKEY *pkey);
-
-    int (*digest_custom)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
-} /* EVP_PKEY_METHOD */;
-
-DEFINE_STACK_OF_CONST(EVP_PKEY_METHOD)
-
 void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx);

-const EVP_PKEY_METHOD *ossl_dh_pkey_method(void);
-const EVP_PKEY_METHOD *ossl_dhx_pkey_method(void);
-const EVP_PKEY_METHOD *ossl_dsa_pkey_method(void);
-const EVP_PKEY_METHOD *ossl_ec_pkey_method(void);
-const EVP_PKEY_METHOD *ossl_ecx25519_pkey_method(void);
-const EVP_PKEY_METHOD *ossl_ecx448_pkey_method(void);
-const EVP_PKEY_METHOD *ossl_ed25519_pkey_method(void);
-const EVP_PKEY_METHOD *ossl_ed448_pkey_method(void);
-const EVP_PKEY_METHOD *ossl_rsa_pkey_method(void);
-const EVP_PKEY_METHOD *ossl_rsa_pss_pkey_method(void);
-
 struct evp_mac_st {
     OSSL_PROVIDER *prov;
     int name_id;
+    int no_store;
     char *type_name;
     const char *description;

@@ -232,6 +165,7 @@ struct evp_mac_st {
 struct evp_kdf_st {
     OSSL_PROVIDER *prov;
     int name_id;
+    int no_store;
     char *type_name;
     const char *description;
     CRYPTO_REF_COUNT refcnt;
@@ -247,33 +181,23 @@ struct evp_kdf_st {
     OSSL_FUNC_kdf_get_params_fn *get_params;
     OSSL_FUNC_kdf_get_ctx_params_fn *get_ctx_params;
     OSSL_FUNC_kdf_set_ctx_params_fn *set_ctx_params;
+    OSSL_FUNC_kdf_set_skey_fn *set_skey;
+    OSSL_FUNC_kdf_derive_skey_fn *derive_skey;
 };

 #define EVP_ORIG_DYNAMIC 0
 #define EVP_ORIG_GLOBAL 1
-#define EVP_ORIG_METH 2

 struct evp_md_st {
     /* nid */
     int type;

-    /* Legacy structure members */
     int pkey_type;
     int md_size;
     unsigned long flags;
     int origin;
-    int (*init)(EVP_MD_CTX *ctx);
-    int (*update)(EVP_MD_CTX *ctx, const void *data, size_t count);
-    int (*final)(EVP_MD_CTX *ctx, unsigned char *md);
-    int (*copy)(EVP_MD_CTX *to, const EVP_MD_CTX *from);
-    int (*cleanup)(EVP_MD_CTX *ctx);
     int block_size;
-    int ctx_size; /* how big does the ctx->md_data need to be */
-    /* control function */
-    int (*md_ctrl)(EVP_MD_CTX *ctx, int cmd, int p1, void *p2);

-    /* New structure members */
-    /* Above comment to be removed when legacy has gone */
     int name_id;
     char *type_name;
     const char *description;
@@ -294,7 +218,8 @@ struct evp_md_st {
     OSSL_FUNC_digest_gettable_params_fn *gettable_params;
     OSSL_FUNC_digest_settable_ctx_params_fn *settable_ctx_params;
     OSSL_FUNC_digest_gettable_ctx_params_fn *gettable_ctx_params;
-
+    OSSL_FUNC_digest_serialize_fn *serialize;
+    OSSL_FUNC_digest_deserialize_fn *deserialize;
 } /* EVP_MD */;

 struct evp_cipher_st {
@@ -305,32 +230,11 @@ struct evp_cipher_st {
     int key_len;
     int iv_len;

-    /* Legacy structure members */
     /* Various flags */
     unsigned long flags;
     /* How the EVP_CIPHER was created. */
     int origin;
-    /* init key */
-    int (*init)(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-        const unsigned char *iv, int enc);
-    /* encrypt/decrypt data */
-    int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out,
-        const unsigned char *in, size_t inl);
-    /* cleanup ctx */
-    int (*cleanup)(EVP_CIPHER_CTX *);
-    /* how big ctx->cipher_data needs to be */
-    int ctx_size;
-    /* Populate a ASN1_TYPE with parameters */
-    int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *);
-    /* Get parameters from a ASN1_TYPE */
-    int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *);
-    /* Miscellaneous operations */
-    int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr);
-    /* Application data */
-    void *app_data;

-    /* New structure members */
-    /* Above comment to be removed when legacy has gone */
     int name_id;
     char *type_name;
     const char *description;
@@ -358,225 +262,56 @@ struct evp_cipher_st {
     OSSL_FUNC_cipher_decrypt_skey_init_fn *dinit_skey;
 } /* EVP_CIPHER */;

-/* Macros to code block cipher wrappers */
-
-/* Wrapper functions for each cipher mode */
-
-#define EVP_C_DATA(kstruct, ctx) \
-    ((kstruct *)EVP_CIPHER_CTX_get_cipher_data(ctx))
-
-#define BLOCK_CIPHER_ecb_loop()                       \
-    size_t i, bl;                                     \
-    bl = EVP_CIPHER_CTX_get0_cipher(ctx)->block_size; \
-    if (inl < bl)                                     \
-        return 1;                                     \
-    inl -= bl;                                        \
-    for (i = 0; i <= inl; i += bl)
-
-#define BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched)                                                            \
-    static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl)           \
-    {                                                                                                                     \
-        BLOCK_CIPHER_ecb_loop()                                                                                           \
-            cprefix##_ecb_encrypt(in + i, out + i, &EVP_C_DATA(kstruct, ctx)->ksched, EVP_CIPHER_CTX_is_encrypting(ctx)); \
-        return 1;                                                                                                         \
-    }
-
 #define EVP_MAXCHUNK ((size_t)1 << 30)

-#define BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched)                                                      \
-    static int cname##_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl)            \
-    {                                                                                                                      \
-        while (inl >= EVP_MAXCHUNK) {                                                                                      \
-            int num = EVP_CIPHER_CTX_get_num(ctx);                                                                         \
-            cprefix##_ofb##cbits##_encrypt(in, out, (long)EVP_MAXCHUNK, &EVP_C_DATA(kstruct, ctx)->ksched, ctx->iv, &num); \
-            EVP_CIPHER_CTX_set_num(ctx, num);                                                                              \
-            inl -= EVP_MAXCHUNK;                                                                                           \
-            in += EVP_MAXCHUNK;                                                                                            \
-            out += EVP_MAXCHUNK;                                                                                           \
-        }                                                                                                                  \
-        if (inl) {                                                                                                         \
-            int num = EVP_CIPHER_CTX_get_num(ctx);                                                                         \
-            cprefix##_ofb##cbits##_encrypt(in, out, (long)inl, &EVP_C_DATA(kstruct, ctx)->ksched, ctx->iv, &num);          \
-            EVP_CIPHER_CTX_set_num(ctx, num);                                                                              \
-        }                                                                                                                  \
-        return 1;                                                                                                          \
-    }
-
-#define BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched)                                                                                 \
-    static int cname##_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl)                                \
-    {                                                                                                                                          \
-        while (inl >= EVP_MAXCHUNK) {                                                                                                          \
-            cprefix##_cbc_encrypt(in, out, (long)EVP_MAXCHUNK, &EVP_C_DATA(kstruct, ctx)->ksched, ctx->iv, EVP_CIPHER_CTX_is_encrypting(ctx)); \
-            inl -= EVP_MAXCHUNK;                                                                                                               \
-            in += EVP_MAXCHUNK;                                                                                                                \
-            out += EVP_MAXCHUNK;                                                                                                               \
-        }                                                                                                                                      \
-        if (inl)                                                                                                                               \
-            cprefix##_cbc_encrypt(in, out, (long)inl, &EVP_C_DATA(kstruct, ctx)->ksched, ctx->iv, EVP_CIPHER_CTX_is_encrypting(ctx));          \
-        return 1;                                                                                                                              \
-    }
-
-#define BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched)                                                                                       \
-    static int cname##_cfb##cbits##_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl)                                    \
-    {                                                                                                                                                       \
-        size_t chunk = EVP_MAXCHUNK;                                                                                                                        \
-        if (cbits == 1)                                                                                                                                     \
-            chunk >>= 3;                                                                                                                                    \
-        if (inl < chunk)                                                                                                                                    \
-            chunk = inl;                                                                                                                                    \
-        while (inl && inl >= chunk) {                                                                                                                       \
-            int num = EVP_CIPHER_CTX_get_num(ctx);                                                                                                          \
-            cprefix##_cfb##cbits##_encrypt(in, out, (long)((cbits == 1) && !EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS) ? chunk * 8 : chunk), \
-                &EVP_C_DATA(kstruct, ctx)->ksched, ctx->iv,                                                                                                 \
-                &num, EVP_CIPHER_CTX_is_encrypting(ctx));                                                                                                   \
-            EVP_CIPHER_CTX_set_num(ctx, num);                                                                                                               \
-            inl -= chunk;                                                                                                                                   \
-            in += chunk;                                                                                                                                    \
-            out += chunk;                                                                                                                                   \
-            if (inl < chunk)                                                                                                                                \
-                chunk = inl;                                                                                                                                \
-        }                                                                                                                                                   \
-        return 1;                                                                                                                                           \
-    }
-
-#define BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \
-    BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched)             \
-        BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched)  \
-            BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched)     \
-                BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched)
-
 #define BLOCK_CIPHER_def1(cname, nmode, mode, MODE, kstruct, nid, block_size, \
-    key_len, iv_len, flags, init_key, cleanup,                                \
-    set_asn1, get_asn1, ctrl)                                                 \
+    key_len, iv_len, flags)                                                   \
     static const EVP_CIPHER cname##_##mode = {                                \
         nid##_##nmode, block_size, key_len, iv_len,                           \
         flags | EVP_CIPH_##MODE##_MODE,                                       \
-        EVP_ORIG_GLOBAL,                                                      \
-        init_key,                                                             \
-        cname##_##mode##_cipher,                                              \
-        cleanup,                                                              \
-        sizeof(kstruct),                                                      \
-        set_asn1, get_asn1,                                                   \
-        ctrl,                                                                 \
-        NULL                                                                  \
+        EVP_ORIG_GLOBAL                                                       \
     };                                                                        \
     const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }

 #define BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len,         \
-    iv_len, flags, init_key, cleanup, set_asn1,                                \
-    get_asn1, ctrl)                                                            \
+    iv_len, flags)                                                             \
     BLOCK_CIPHER_def1(cname, cbc, cbc, CBC, kstruct, nid, block_size, key_len, \
-        iv_len, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
+        iv_len, flags)

 #define BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len,                 \
-    iv_len, cbits, flags, init_key, cleanup,                               \
-    set_asn1, get_asn1, ctrl)                                              \
+    iv_len, cbits, flags)                                                  \
     BLOCK_CIPHER_def1(cname, cfb##cbits, cfb##cbits, CFB, kstruct, nid, 1, \
-        key_len, iv_len, flags, init_key, cleanup, set_asn1,               \
-        get_asn1, ctrl)
+        key_len, iv_len, flags)

 #define BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len,          \
-    iv_len, cbits, flags, init_key, cleanup,                        \
-    set_asn1, get_asn1, ctrl)                                       \
+    iv_len, cbits, flags)                                           \
     BLOCK_CIPHER_def1(cname, ofb##cbits, ofb, OFB, kstruct, nid, 1, \
-        key_len, iv_len, flags, init_key, cleanup, set_asn1,        \
-        get_asn1, ctrl)
+        key_len, iv_len, flags)

 #define BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len,         \
-    flags, init_key, cleanup, set_asn1,                                        \
-    get_asn1, ctrl)                                                            \
+    flags)                                                                     \
     BLOCK_CIPHER_def1(cname, ecb, ecb, ECB, kstruct, nid, block_size, key_len, \
-        0, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
+        0, flags)

 #define BLOCK_CIPHER_defs(cname, kstruct,                                         \
-    nid, block_size, key_len, iv_len, cbits, flags,                               \
-    init_key, cleanup, set_asn1, get_asn1, ctrl)                                  \
-    BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, iv_len, flags, \
-        init_key, cleanup, set_asn1, get_asn1, ctrl)                              \
+    nid, block_size, key_len, iv_len, cbits, flags)                               \
+    BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, iv_len, flags) \
     BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, iv_len, cbits,             \
-        flags, init_key, cleanup, set_asn1, get_asn1, ctrl)                       \
+        flags)                                                                    \
     BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, iv_len, cbits,             \
-        flags, init_key, cleanup, set_asn1, get_asn1, ctrl)                       \
-    BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, flags,         \
-        init_key, cleanup, set_asn1, get_asn1, ctrl)
-
-/*-
-#define BLOCK_CIPHER_defs(cname, kstruct, \
-                                nid, block_size, key_len, iv_len, flags,\
-                                 init_key, cleanup, set_asn1, get_asn1, ctrl)\
-static const EVP_CIPHER cname##_cbc = {\
-        nid##_cbc, block_size, key_len, iv_len, \
-        flags | EVP_CIPH_CBC_MODE,\
-        EVP_ORIG_GLOBAL,\
-        init_key,\
-        cname##_cbc_cipher,\
-        cleanup,\
-        sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
-                sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
-        set_asn1, get_asn1,\
-        ctrl, \
-        NULL \
-};\
-const EVP_CIPHER *EVP_##cname##_cbc(void) { return &cname##_cbc; }\
-static const EVP_CIPHER cname##_cfb = {\
-        nid##_cfb64, 1, key_len, iv_len, \
-        flags | EVP_CIPH_CFB_MODE,\
-        EVP_ORIG_GLOBAL,\
-        init_key,\
-        cname##_cfb_cipher,\
-        cleanup,\
-        sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
-                sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
-        set_asn1, get_asn1,\
-        ctrl,\
-        NULL \
-};\
-const EVP_CIPHER *EVP_##cname##_cfb(void) { return &cname##_cfb; }\
-static const EVP_CIPHER cname##_ofb = {\
-        nid##_ofb64, 1, key_len, iv_len, \
-        flags | EVP_CIPH_OFB_MODE,\
-        EVP_ORIG_GLOBAL,\
-        init_key,\
-        cname##_ofb_cipher,\
-        cleanup,\
-        sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
-                sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
-        set_asn1, get_asn1,\
-        ctrl,\
-        NULL \
-};\
-const EVP_CIPHER *EVP_##cname##_ofb(void) { return &cname##_ofb; }\
-static const EVP_CIPHER cname##_ecb = {\
-        nid##_ecb, block_size, key_len, iv_len, \
-        flags | EVP_CIPH_ECB_MODE,\
-        EVP_ORIG_GLOBAL,\
-        init_key,\
-        cname##_ecb_cipher,\
-        cleanup,\
-        sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
-                sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
-        set_asn1, get_asn1,\
-        ctrl,\
-        NULL \
-};\
-const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; }
-*/
-
-#define IMPLEMENT_BLOCK_CIPHER(cname, ksched, cprefix, kstruct, nid,        \
-    block_size, key_len, iv_len, cbits,                                     \
-    flags, init_key,                                                        \
-    cleanup, set_asn1, get_asn1, ctrl)                                      \
-    BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched)          \
-        BLOCK_CIPHER_defs(cname, kstruct, nid, block_size, key_len, iv_len, \
-            cbits, flags, init_key, cleanup, set_asn1,                      \
-            get_asn1, ctrl)
+        flags)                                                                    \
+    BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, flags)
+
+#define IMPLEMENT_BLOCK_CIPHER(cname, ksched, cprefix, kstruct, nid,    \
+    block_size, key_len, iv_len, cbits,                                 \
+    flags)                                                              \
+    BLOCK_CIPHER_defs(cname, kstruct, nid, block_size, key_len, iv_len, \
+        cbits, flags)

 #define IMPLEMENT_CFBR(cipher, cprefix, kstruct, ksched, keysize, cbits, iv_len, fl) \
-    BLOCK_CIPHER_func_cfb(cipher##_##keysize, cprefix, cbits, kstruct, ksched)       \
-        BLOCK_CIPHER_def_cfb(cipher##_##keysize, kstruct,                            \
-            NID_##cipher##_##keysize, keysize / 8, iv_len, cbits,                    \
-            (fl) | EVP_CIPH_FLAG_DEFAULT_ASN1,                                       \
-            cipher##_init_key, NULL, NULL, NULL, NULL)
+    BLOCK_CIPHER_def_cfb(cipher##_##keysize, kstruct,                                \
+        NID_##cipher##_##keysize, keysize / 8, iv_len, cbits,                        \
+        (fl) | EVP_CIPH_FLAG_DEFAULT_ASN1)

 typedef struct {
     unsigned char iv[EVP_MAX_IV_LENGTH];
@@ -677,8 +412,6 @@ struct evp_pkey_st {
      * a pointer to a low level key and possibly a pointer to an engine.
      */
     const EVP_PKEY_ASN1_METHOD *ameth;
-    ENGINE *engine;
-    ENGINE *pmeth_engine; /* If not NULL public key ENGINE to use */

     /* Union to store the reference to an origin legacy key */
     union legacy_pkey_st pkey;
@@ -731,6 +464,7 @@ struct evp_pkey_st {
     struct {
         int bits;
         int security_bits;
+        int security_category;
         int size;
     } cache;
 }; /* EVP_PKEY */
@@ -767,7 +501,6 @@ struct evp_skey_st {
 void openssl_add_all_ciphers_int(void);
 void openssl_add_all_digests_int(void);
 void evp_cleanup_int(void);
-void evp_app_cleanup_int(void);
 void *evp_pkey_export_to_provider(EVP_PKEY *pk, OSSL_LIB_CTX *libctx,
     EVP_KEYMGMT **keymgmt,
     const char *propquery);
@@ -804,7 +537,7 @@ void *evp_keymgmt_util_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt,
 OP_CACHE_ELEM *evp_keymgmt_util_find_operation_cache(EVP_PKEY *pk,
     EVP_KEYMGMT *keymgmt,
     int selection);
-int evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk);
+void evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk);
 int evp_keymgmt_util_cache_keydata(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt,
     void *keydata, int selection);
 void evp_keymgmt_util_cache_keyinfo(EVP_PKEY *pk);
@@ -824,7 +557,7 @@ const char *evp_keymgmt_util_query_operation_name(EVP_KEYMGMT *keymgmt,
 /*
  * KEYMGMT provider interface functions
  */
-void *evp_keymgmt_newdata(const EVP_KEYMGMT *keymgmt);
+void *evp_keymgmt_newdata(const EVP_KEYMGMT *keymgmt, const OSSL_PARAM params[]);
 void evp_keymgmt_freedata(const EVP_KEYMGMT *keymgmt, void *keyddata);
 int evp_keymgmt_get_params(const EVP_KEYMGMT *keymgmt,
     void *keydata, OSSL_PARAM params[]);
@@ -870,6 +603,7 @@ EVP_KEYMGMT *evp_keymgmt_fetch_from_prov(OSSL_PROVIDER *prov,
 /*
  * SKEYMGMT provider interface functions
  */
+EVP_SKEY *evp_skey_alloc(EVP_SKEYMGMT *skeymgmt);
 void evp_skeymgmt_freedata(const EVP_SKEYMGMT *keymgmt, void *keyddata);
 void *evp_skeymgmt_import(const EVP_SKEYMGMT *skeymgmt, int selection, const OSSL_PARAM params[]);
 int evp_skeymgmt_export(const EVP_SKEYMGMT *skeymgmt, void *keydata,
@@ -997,4 +731,14 @@ int evp_pkey_decrypt_alloc(EVP_PKEY_CTX *ctx, unsigned char **outp,
 int ossl_md2hmacnid(int mdnid);
 int ossl_hmac2mdnid(int hmac_nid);

+const EVP_PKEY_ASN1_METHOD *evp_pkey_asn1_find(int type);
+const EVP_PKEY_ASN1_METHOD *evp_pkey_asn1_find_str(const char *str, int len);
+int evp_pkey_asn1_get_count(void);
+const EVP_PKEY_ASN1_METHOD *evp_pkey_asn1_get0(int idx);
+int evp_pkey_asn1_get0_info(int *ppkey_id, int *ppkey_base_id,
+    int *ppkey_flags, const char **pinfo,
+    const char **ppem_str,
+    const EVP_PKEY_ASN1_METHOD *ameth);
+const EVP_PKEY_ASN1_METHOD *evp_pkey_get0_asn1(const EVP_PKEY *pkey);
+
 #endif /* OSSL_CRYPTO_EVP_H */
diff --git a/deps/openssl/openssl/include/crypto/evperr.h b/deps/openssl/openssl/include/crypto/evperr.h
deleted file mode 100644
index 1a91b62fce5..00000000000
--- a/deps/openssl/openssl/include/crypto/evperr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_EVPERR_H
-#define OSSL_CRYPTO_EVPERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_EVP_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/lms.h b/deps/openssl/openssl/include/crypto/lms.h
new file mode 100644
index 00000000000..e36ddb63cca
--- /dev/null
+++ b/deps/openssl/openssl/include/crypto/lms.h
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * Internal LMS/LM_OTS functions for other submodules,
+ * not for application use
+ */
+
+#ifndef OSSL_CRYPTO_LMS_H
+#define OSSL_CRYPTO_LMS_H
+#pragma once
+#ifndef OPENSSL_NO_LMS
+#include "types.h"
+#include <openssl/params.h>
+
+/*
+ * Numeric identifiers associated with Leighton-Micali Signatures (LMS)
+ * parameter sets are defined in
+ * https://www.iana.org/assignments/leighton-micali-signatures/leighton-micali-signatures.xhtml
+ * which is referenced from SP800-208.
+ */
+#define OSSL_LMS_TYPE_SHA256_N32_H5 0x00000005
+#define OSSL_LMS_TYPE_SHA256_N32_H10 0x00000006
+#define OSSL_LMS_TYPE_SHA256_N32_H15 0x00000007
+#define OSSL_LMS_TYPE_SHA256_N32_H20 0x00000008
+#define OSSL_LMS_TYPE_SHA256_N32_H25 0x00000009
+#define OSSL_LMS_TYPE_SHA256_N24_H5 0x0000000A
+#define OSSL_LMS_TYPE_SHA256_N24_H10 0x0000000B
+#define OSSL_LMS_TYPE_SHA256_N24_H15 0x0000000C
+#define OSSL_LMS_TYPE_SHA256_N24_H20 0x0000000D
+#define OSSL_LMS_TYPE_SHA256_N24_H25 0x0000000E
+#define OSSL_LMS_TYPE_SHAKE_N32_H5 0x0000000F
+#define OSSL_LMS_TYPE_SHAKE_N32_H10 0x00000010
+#define OSSL_LMS_TYPE_SHAKE_N32_H15 0x00000011
+#define OSSL_LMS_TYPE_SHAKE_N32_H20 0x00000012
+#define OSSL_LMS_TYPE_SHAKE_N32_H25 0x00000013
+#define OSSL_LMS_TYPE_SHAKE_N24_H5 0x00000014
+#define OSSL_LMS_TYPE_SHAKE_N24_H10 0x00000015
+#define OSSL_LMS_TYPE_SHAKE_N24_H15 0x00000016
+#define OSSL_LMS_TYPE_SHAKE_N24_H20 0x00000017
+#define OSSL_LMS_TYPE_SHAKE_N24_H25 0x00000018
+
+#define OSSL_LM_OTS_TYPE_SHA256_N32_W1 0x00000001
+#define OSSL_LM_OTS_TYPE_SHA256_N32_W2 0x00000002
+#define OSSL_LM_OTS_TYPE_SHA256_N32_W4 0x00000003
+#define OSSL_LM_OTS_TYPE_SHA256_N32_W8 0x00000004
+#define OSSL_LM_OTS_TYPE_SHA256_N24_W1 0x00000005
+#define OSSL_LM_OTS_TYPE_SHA256_N24_W2 0x00000006
+#define OSSL_LM_OTS_TYPE_SHA256_N24_W4 0x00000007
+#define OSSL_LM_OTS_TYPE_SHA256_N24_W8 0x00000008
+#define OSSL_LM_OTS_TYPE_SHAKE_N32_W1 0x00000009
+#define OSSL_LM_OTS_TYPE_SHAKE_N32_W2 0x0000000A
+#define OSSL_LM_OTS_TYPE_SHAKE_N32_W4 0x0000000B
+#define OSSL_LM_OTS_TYPE_SHAKE_N32_W8 0x0000000C
+#define OSSL_LM_OTS_TYPE_SHAKE_N24_W1 0x0000000D
+#define OSSL_LM_OTS_TYPE_SHAKE_N24_W2 0x0000000E
+#define OSSL_LM_OTS_TYPE_SHAKE_N24_W4 0x0000000F
+#define OSSL_LM_OTS_TYPE_SHAKE_N24_W8 0x00000010
+
+/* Constants used for verifying */
+#define LMS_SIZE_q 4
+
+/* XDR sizes when encoding and decoding */
+#define LMS_SIZE_I 16
+#define LMS_SIZE_LMS_TYPE 4
+#define LMS_SIZE_OTS_TYPE 4
+#define LMS_MAX_DIGEST_SIZE 32
+#define LMS_MAX_PUBKEY \
+    (LMS_SIZE_LMS_TYPE + LMS_SIZE_OTS_TYPE + LMS_SIZE_I + LMS_MAX_DIGEST_SIZE)
+
+/*
+ * Refer to RFC 8554 Section 4.1.
+ * See also lm_ots_params[]
+ */
+typedef struct lm_ots_params_st {
+    /*
+     * The OTS type associates an id with a set of OTS parameters
+     * e.g. OSSL_LM_OTS_TYPE_SHAKE_N32_W1
+     */
+    uint32_t lm_ots_type;
+    uint32_t n; /* Hash output size in bytes (32 or 24) */
+    /*
+     * The width of the Winternitz coefficients in bits. One of (1, 2, 4, 8)
+     * Higher values of w are slower (~2^w computations) but have smaller
+     * signatures.
+     */
+    uint32_t w;
+    /*
+     * The number of n-byte elements used for an LMOTS signature.
+     * One of (265, 133, 67, 34) for n = 32, for w=1,2,4,8
+     * One of (200, 101, 51, 26) for n = 24, for w=1,2,4,8
+     */
+    uint32_t p;
+    /*
+     * The size of the shift needed to move the checksum so
+     * that it appears in the checksum digits.
+     * See RFC 8554 Appendix B.  LM-OTS Parameter Options
+     */
+    uint32_t ls;
+    const char *digestname; /* Hash Name */
+} LM_OTS_PARAMS;
+
+/* See lms_params[] */
+typedef struct lms_params_st {
+    /*
+     * The lms type associates an id with a set of parameters to define the
+     * Digest and Height of a LMS tree.
+     * e.g, OSSL_LMS_TYPE_SHA256_N24_H25
+     */
+    uint32_t lms_type;
+    const char *digestname; /* One of SHA256, SHA256-192, or SHAKE256 */
+    uint32_t n; /* The Digest size (either 24 or 32), Useful for setting up SHAKE */
+    uint32_t h; /* The height of a LMS tree which is one of 5, 10, 15, 20, 25) */
+    size_t bit_strength;
+} LMS_PARAMS;
+
+typedef struct lms_pub_key_st {
+    /*
+     * A buffer containing an encoded public key of the form
+     * u32str(lmstype) || u32str(otstype) || I[16] || K[n]
+     */
+    unsigned char *encoded; /* encoded public key data */
+    size_t encodedlen;
+    /*
+     * K is the LMS tree's root public key (Called T(1))
+     * It is n bytes long (the hash size).
+     * It is a pointer into the encoded buffer
+     */
+    unsigned char *K;
+} LMS_PUB_KEY;
+
+typedef struct lms_key_st {
+    const LMS_PARAMS *lms_params;
+    const LM_OTS_PARAMS *ots_params;
+    OSSL_LIB_CTX *libctx;
+    unsigned char *Id; /* A pointer to 16 bytes (I[16]) */
+    LMS_PUB_KEY pub;
+} LMS_KEY;
+
+const LMS_PARAMS *ossl_lms_params_get(uint32_t lms_type);
+const LM_OTS_PARAMS *ossl_lm_ots_params_get(uint32_t ots_type);
+
+LMS_KEY *ossl_lms_key_new(OSSL_LIB_CTX *libctx);
+void ossl_lms_key_free(LMS_KEY *lmskey);
+int ossl_lms_key_equal(const LMS_KEY *key1, const LMS_KEY *key2, int selection);
+int ossl_lms_key_valid(const LMS_KEY *key, int selection);
+int ossl_lms_key_has(const LMS_KEY *key, int selection);
+
+int ossl_lms_pubkey_from_params(const OSSL_PARAM *pub, LMS_KEY *lmskey);
+int ossl_lms_pubkey_decode(const unsigned char *pub, size_t publen,
+    LMS_KEY *lmskey);
+size_t ossl_lms_pubkey_length(const unsigned char *data, size_t datalen);
+
+const uint8_t *ossl_lms_key_get_pub(const LMS_KEY *key);
+size_t ossl_lms_key_get_pub_len(const LMS_KEY *key);
+size_t ossl_lms_key_get_collision_strength_bits(const LMS_KEY *key);
+size_t ossl_lms_key_get_sig_len(const LMS_KEY *key);
+
+#endif /* OPENSSL_NO_LMS */
+#endif /* OSSL_CRYPTO_LMS_H */
diff --git a/deps/openssl/openssl/include/crypto/lms_sig.h b/deps/openssl/openssl/include/crypto/lms_sig.h
new file mode 100644
index 00000000000..59beb231150
--- /dev/null
+++ b/deps/openssl/openssl/include/crypto/lms_sig.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * Internal LMS/LM_OTS functions for other submodules,
+ * not for application use
+ *
+ * Refer to RFC 8554 Sections 5.4 & 4.5 for information related to
+ * LMS Signatures & LM_OTS Signature Generation respectively.
+ */
+
+#ifndef OSSL_CRYPTO_LMS_SIG_H
+#define OSSL_CRYPTO_LMS_SIG_H
+#pragma once
+#ifndef OPENSSL_NO_LMS
+#include "lms.h"
+#include "internal/packet.h"
+
+/* The values defined for 8 byte TAGS */
+extern const uint16_t OSSL_LMS_D_PBLC; /* 8080 */
+extern const uint16_t OSSL_LMS_D_MESG; /* 8181 */
+extern const uint16_t OSSL_LMS_D_LEAF; /* 8282 */
+extern const uint16_t OSSL_LMS_D_INTR; /* 8383 */
+
+/* Used by OTS signature when calculating Q || Cksm(Q) */
+#define LMS_SIZE_CHECKSUM 2
+#define LMS_SIZE_QSUM 2
+
+/*
+ * An object for storing a One-Time Signature
+ * See RFC 8554 Section 4.5
+ */
+typedef struct lm_ots_sig_st {
+    const LM_OTS_PARAMS *params;
+    /* For verify operations the following pointers are not allocated */
+    unsigned char *C; /* A salt value of size n */
+    unsigned char *y; /* The trailing part of a signature of size p * n */
+} LM_OTS_SIG;
+
+/*
+ * An object for storing a LMS signature
+ * See RFC 8554 Section 5.4
+ */
+typedef struct lms_signature_st {
+    uint32_t q;
+    LM_OTS_SIG sig;
+    const LMS_PARAMS *params; /* contains the LMS type */
+    unsigned char *paths; /* size is h * m */
+} LMS_SIG;
+
+LMS_SIG *ossl_lms_sig_new(void);
+void ossl_lms_sig_free(LMS_SIG *sig);
+LMS_SIG *ossl_lms_sig_from_pkt(PACKET *pkt, const LMS_KEY *pub);
+int ossl_lms_sig_decode(LMS_SIG **out, LMS_KEY *pub,
+    const unsigned char *sig, size_t siglen);
+int ossl_lms_sig_verify(const LMS_SIG *lms_sig, const LMS_KEY *pub,
+    const EVP_MD *md,
+    const unsigned char *msg, size_t msglen);
+
+int ossl_lm_ots_compute_pubkey(EVP_MD_CTX *ctx, EVP_MD_CTX *ctxIq,
+    const LM_OTS_SIG *sig, const LM_OTS_PARAMS *pub,
+    const unsigned char *Id, uint32_t q,
+    const unsigned char *msg, size_t msglen,
+    unsigned char *Kc);
+uint16_t ossl_lm_ots_params_checksum(const LM_OTS_PARAMS *params,
+    const unsigned char *S);
+
+#endif /* OPENSSL_NO_LMS */
+#endif /* OSSL_CRYPTO_LMS_SIG_H */
diff --git a/deps/openssl/openssl/include/crypto/lms_util.h b/deps/openssl/openssl/include/crypto/lms_util.h
new file mode 100644
index 00000000000..083c87400ce
--- /dev/null
+++ b/deps/openssl/openssl/include/crypto/lms_util.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* @brief Internal LMS helper functions */
+
+#if !defined(OSSL_CRYPTO_LMS_UTIL_H)
+#define OSSL_CRYPTO_LMS_UTIL_H
+
+#include "internal/packet.h"
+#include <openssl/params.h>
+#include <openssl/core_names.h>
+#include <openssl/evp.h>
+
+#include "crypto/lms.h"
+
+/*
+ * This LMS implementation assumes that the hash algorithm must be the same for
+ * LMS params and OTS params. Since OpenSSL does not have a "SHAKE256-192"
+ * algorithm, we have to check the digest size as well as the name.
+ * This macro can be used to compare 2 LMS_PARAMS, LMS_PARAMS and LM_OTS_PARAMS.
+ */
+#define HASH_NOT_MATCHED(a, b) \
+    (a)->n != (b)->n || (strcmp((a)->digestname, (b)->digestname) != 0)
+
+/*
+ * See RFC 8554 Section 3.1.3: Strings of w-bit Elements
+ * w: Is one of {1,2,4,8}
+ */
+static ossl_unused ossl_inline uint8_t lms_ots_coef(const unsigned char *S, uint16_t i, uint8_t w)
+{
+    uint8_t bitmask = (1 << w) - 1;
+    uint8_t shift = 8 - (w * (i % (8 / w)) + w);
+    int id = (i * w) / 8;
+
+    return (S[id] >> shift) & bitmask;
+}
+
+static ossl_unused ossl_inline int lms_evp_md_ctx_init(EVP_MD_CTX *ctx, const EVP_MD *md,
+    const LMS_PARAMS *lms_params)
+{
+    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+    OSSL_PARAM *p = NULL;
+
+    /* The OpenSSL SHAKE implementation requires the xoflen to be set */
+    if (strncmp(lms_params->digestname, "SHAKE", 5) == 0) {
+        params[0] = OSSL_PARAM_construct_uint32(OSSL_DIGEST_PARAM_XOFLEN,
+            (uint32_t *)&lms_params->n);
+        p = params;
+    }
+    return EVP_DigestInit_ex2(ctx, md, p);
+}
+
+#endif /* !defined(OSSL_CRYPTO_LMS_UTIL_H) */
diff --git a/deps/openssl/openssl/include/crypto/md32_common.h b/deps/openssl/openssl/include/crypto/md32_common.inc
similarity index 82%
rename from deps/openssl/openssl/include/crypto/md32_common.h
rename to deps/openssl/openssl/include/crypto/md32_common.inc
index 6cc60d8d0d7..53c3bf7936b 100644
--- a/deps/openssl/openssl/include/crypto/md32_common.h
+++ b/deps/openssl/openssl/include/crypto/md32_common.inc
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -68,6 +68,10 @@
 #pragma once

 #include <openssl/crypto.h>
+/*
+ * For ossl_(un)likely
+ */
+#include <internal/common.h>

 #if !defined(DATA_ORDER_IS_BIG_ENDIAN) && !defined(DATA_ORDER_IS_LITTLE_ENDIAN)
 #error "DATA_ORDER must be defined!"
@@ -100,7 +104,7 @@
 #define ROTATE(a, n) (((a) << (n)) | (((a) & 0xffffffff) >> (32 - (n))))

 #ifndef PEDANTIC
-#if defined(__GNUC__) && __GNUC__ >= 2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
+#if defined(__GNUC__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 #if defined(__riscv_zbb) || defined(__riscv_zbkb)
 #if __riscv_xlen == 64
 #undef ROTATE
@@ -116,6 +120,11 @@
                        : "=r"(ret)                    \
                        : "r"(x), "i"(32 - (n))); ret; })
 #endif
+#  elif defined(__e2k__)
+#   undef ROTATE
+#   define ROTATE(a,n)  ( (__builtin_constant_p(n) && (n) > 16) \
+                          ? __builtin_e2k_scrs((a), 32 - (n))   \
+                          : __builtin_e2k_scls((a),      (n))   )
 #endif
 #endif
 #endif
@@ -150,28 +159,41 @@
  * Time for some action :-)
  */

+#ifdef HASH_UPDATE_THUNK
+int HASH_UPDATE(void *cp, const unsigned char *data_, size_t len);
+int HASH_UPDATE(void *cp, const unsigned char *data_, size_t len)
+#else
 int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len)
+#endif
 {
+#ifdef HASH_UPDATE_THUNK
+    HASH_CTX *c = (HASH_CTX *)cp;
+#endif
     const unsigned char *data = data_;
     unsigned char *p;
     HASH_LONG l;
     size_t n;

-    if (len == 0)
+    if (ossl_unlikely(len == 0))
         return 1;

     l = (c->Nl + (((HASH_LONG)len) << 3)) & 0xffffffffUL;
-    if (l < c->Nl) /* overflow */
+    if (ossl_unlikely(l < c->Nl)) /* overflow */
         c->Nh++;
     c->Nh += (HASH_LONG)(len >> 29); /* might cause compiler warning on
                                       * 16-bit */
     c->Nl = l;

     n = c->num;
-    if (n != 0) {
+    if (ossl_likely(n != 0)) {
+        /* Gets here if we already have buffered input data */
         p = (unsigned char *)c->data;

         if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
+            /*
+             * If there is enough input to fill the buffer then fill the
+             * buffer and process a single chunk.
+             */
             memcpy(p + n, data, HASH_CBLOCK - n);
             HASH_BLOCK_DATA_ORDER(c, p, 1);
             n = HASH_CBLOCK - n;
@@ -186,20 +208,22 @@ int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len)
              */
             memset(p, 0, HASH_CBLOCK); /* keep it zeroed */
         } else {
+            /* Otherwise just keep filling the buffer */
             memcpy(p + n, data, len);
             c->num += (unsigned int)len;
             return 1;
         }
     }

-    n = len / HASH_CBLOCK;
+    n = len / HASH_CBLOCK; /* Get number of input chunks (e.g. multiple of 512 bits for SHA256) */
     if (n > 0) {
+        /* Process chunks */
         HASH_BLOCK_DATA_ORDER(c, data, n);
         n *= HASH_CBLOCK;
         data += n;
         len -= n;
     }
-
+    /* Buffer any left over data */
     if (len != 0) {
         p = (unsigned char *)c->data;
         c->num = (unsigned int)len;
@@ -210,7 +234,7 @@ int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len)

 void HASH_TRANSFORM(HASH_CTX *c, const unsigned char *data)
 {
-    HASH_BLOCK_DATA_ORDER(c, data, 1);
+    HASH_BLOCK_DATA_ORDER(c, data, 1); /* Process a single chunk */
 }

 int HASH_FINAL(unsigned char *md, HASH_CTX *c)
@@ -218,16 +242,26 @@ int HASH_FINAL(unsigned char *md, HASH_CTX *c)
     unsigned char *p = (unsigned char *)c->data;
     size_t n = c->num;

+    /*
+     * Pad the input by adding a 1 bit + K zero bits + input length (L)
+     * as a 64 bit value. K must align the data to a chunk boundary.
+     */
     p[n] = 0x80; /* there is always room for one */
     n++;

     if (n > (HASH_CBLOCK - 8)) {
+        /*
+         * If there is not enough room in the buffer to add L, then fill the
+         * current buffer with zeros, and process the chunk
+         */
         memset(p + n, 0, HASH_CBLOCK - n);
         n = 0;
         HASH_BLOCK_DATA_ORDER(c, p, 1);
     }
+    /* Add zero padding - but leave enough room for L */
     memset(p + n, 0, HASH_CBLOCK - 8 - n);

+    /* Add the 64 bit L value to the end of the buffer */
     p += HASH_CBLOCK - 8;
 #if defined(DATA_ORDER_IS_BIG_ENDIAN)
     (void)HOST_l2c(c->Nh, p);
@@ -237,6 +271,7 @@ int HASH_FINAL(unsigned char *md, HASH_CTX *c)
     (void)HOST_l2c(c->Nh, p);
 #endif
     p -= HASH_CBLOCK;
+    /* Process the final padded chunk */
     HASH_BLOCK_DATA_ORDER(c, p, 1);
     c->num = 0;
     OPENSSL_cleanse(p, HASH_CBLOCK);
diff --git a/deps/openssl/openssl/include/crypto/ml_dsa.h b/deps/openssl/openssl/include/crypto/ml_dsa.h
index d1b65b84f4d..831a6740a1b 100644
--- a/deps/openssl/openssl/include/crypto/ml_dsa.h
+++ b/deps/openssl/openssl/include/crypto/ml_dsa.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -22,6 +22,8 @@

 #define ML_DSA_ENTROPY_LEN 32

+#define ML_DSA_MU_BYTES 64 /* Size of the Hash for the message representative */
+
 /* See FIPS 204 Section 4 Table 1 & Table 2 */
 #define ML_DSA_44_PRIV_LEN 2560
 #define ML_DSA_44_PUB_LEN 1312
@@ -78,6 +80,7 @@ __owur ML_DSA_KEY *ossl_ml_dsa_key_new(OSSL_LIB_CTX *libctx, const char *propq,
     int evp_type);
 /* Factory reset for keys that fail initialisation */
 void ossl_ml_dsa_key_reset(ML_DSA_KEY *key);
+__owur int ossl_ml_dsa_key_fetch_digests(ML_DSA_KEY *key, const char *propq);
 __owur int ossl_ml_dsa_key_pub_alloc(ML_DSA_KEY *key);
 __owur int ossl_ml_dsa_key_priv_alloc(ML_DSA_KEY *key);
 void ossl_ml_dsa_key_free(ML_DSA_KEY *key);
@@ -97,6 +100,7 @@ int ossl_ml_dsa_set_prekey(ML_DSA_KEY *key, int flags_set, int flags_clr,
     const uint8_t *seed, size_t seed_len,
     const uint8_t *sk, size_t sk_len);
 __owur size_t ossl_ml_dsa_key_get_collision_strength_bits(const ML_DSA_KEY *key);
+__owur int ossl_ml_dsa_key_get_security_category(const ML_DSA_KEY *key);
 __owur size_t ossl_ml_dsa_key_get_sig_len(const ML_DSA_KEY *key);
 __owur int ossl_ml_dsa_key_matches(const ML_DSA_KEY *key, int evp_type);
 __owur const char *ossl_ml_dsa_key_get_name(const ML_DSA_KEY *key);
@@ -106,6 +110,15 @@ __owur int ossl_ml_dsa_key_public_from_private(ML_DSA_KEY *key);
 __owur int ossl_ml_dsa_pk_decode(ML_DSA_KEY *key, const uint8_t *in, size_t in_len);
 __owur int ossl_ml_dsa_sk_decode(ML_DSA_KEY *key, const uint8_t *in, size_t in_len);

+__owur EVP_MD_CTX *ossl_ml_dsa_mu_init(const ML_DSA_KEY *key, int encode,
+    const uint8_t *ctx, size_t ctx_len);
+
+__owur EVP_MD_CTX *ossl_ml_dsa_mu_init_int(EVP_MD *shake256_md,
+    const uint8_t *tr, size_t tr_len, int encode, int prehash,
+    const uint8_t *ctx, size_t ctx_len);
+__owur int ossl_ml_dsa_mu_update(EVP_MD_CTX *md_ctx, const uint8_t *msg, size_t msg_len);
+__owur int ossl_ml_dsa_mu_finalize(EVP_MD_CTX *md_ctx, uint8_t *mu, size_t mu_len);
+
 __owur int ossl_ml_dsa_sign(const ML_DSA_KEY *priv, int msg_is_mu,
     const uint8_t *msg, size_t msg_len,
     const uint8_t *context, size_t context_len,
diff --git a/deps/openssl/openssl/include/crypto/ml_kem.h b/deps/openssl/openssl/include/crypto/ml_kem.h
index dbe91923647..a4455dc71b3 100644
--- a/deps/openssl/openssl/include/crypto/ml_kem.h
+++ b/deps/openssl/openssl/include/crypto/ml_kem.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -98,6 +98,7 @@
 #define ML_KEM_512_DU 10
 #define ML_KEM_512_DV 4
 #define ML_KEM_512_SECBITS 128
+#define ML_KEM_512_SECURITY_CATEGORY 1

 #define EVP_PKEY_ML_KEM_768 NID_ML_KEM_768
 #define ML_KEM_768_BITS 768
@@ -107,6 +108,7 @@
 #define ML_KEM_768_DU 10
 #define ML_KEM_768_DV 4
 #define ML_KEM_768_SECBITS 192
+#define ML_KEM_768_SECURITY_CATEGORY 3

 #define EVP_PKEY_ML_KEM_1024 NID_ML_KEM_1024
 #define ML_KEM_1024_BITS 1024
@@ -116,6 +118,7 @@
 #define ML_KEM_1024_DU 11
 #define ML_KEM_1024_DV 5
 #define ML_KEM_1024_SECBITS 256
+#define ML_KEM_1024_SECURITY_CATEGORY 5

 #define ML_KEM_KEY_RANDOM_PCT (1 << 0)
 #define ML_KEM_KEY_FIXED_PCT (1 << 1)
@@ -148,6 +151,7 @@ typedef struct {
     int du;
     int dv;
     int secbits;
+    int security_category;
 } ML_KEM_VINFO;

 /* Retrieve global variant-specific parameters */
@@ -187,10 +191,14 @@ typedef struct ossl_ml_kem_key_st {
     /*
      * Fixed-size built-in buffer, which holds the |rho| and the public key
      * |pkhash| in that order, once we have expanded key material.
-     * With seed-only keys, that are not yet expanded, this instead holds the
+     */
+    uint8_t rho_pkhash[64]; /* |rho| + |pkhash| */
+
+    /*
+     * With seed-only keys, that are not yet expanded, this holds the
      * |z| and |d| components in that order.
      */
-    uint8_t seedbuf[64]; /* |rho| + |pkhash| / |z| + |d| */
+    uint8_t *seedbuf; /* |z| + |d| temporary secure storage buffer */
     uint8_t *encoded_dk; /* Unparsed P8 private key */
 } ML_KEM_KEY;

@@ -223,6 +231,8 @@ void ossl_ml_kem_key_free(ML_KEM_KEY *key);
  */
 ML_KEM_KEY *ossl_ml_kem_key_dup(const ML_KEM_KEY *key, int selection);

+__owur int ossl_ml_kem_key_fetch_digest(ML_KEM_KEY *key, const char *propq);
+
 /*
  * ----- Import or generate key material.
  */
diff --git a/deps/openssl/openssl/include/crypto/modes.h b/deps/openssl/openssl/include/crypto/modes.h
index 918d4e04b54..c7c31fd7ff9 100644
--- a/deps/openssl/openssl/include/crypto/modes.h
+++ b/deps/openssl/openssl/include/crypto/modes.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2010-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -8,83 +8,82 @@
  */

 /* This header can move into provider when legacy support is removed */
+#if !defined(OSSL_CRYPTO_MODES_H)
+#define OSSL_CRYPTO_MODES_H
+
+#include <stdint.h>
+
 #include <openssl/modes.h>

 #if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
-typedef __int64 i64;
-typedef unsigned __int64 u64;
 #define U64(C) C##UI64
 #elif defined(__arch64__)
-typedef long i64;
-typedef unsigned long u64;
 #define U64(C) C##UL
 #else
-typedef long long i64;
-typedef unsigned long long u64;
 #define U64(C) C##ULL
 #endif

-typedef unsigned int u32;
-typedef unsigned char u8;
-
 #define STRICT_ALIGNMENT 1
 #ifndef PEDANTIC
-#if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || defined(__aarch64__) || defined(__s390__) || defined(__s390x__)
+#if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || defined(__aarch64__) || defined(__s390__) || defined(__s390x__) || defined(__e2k__)
 #undef STRICT_ALIGNMENT
 #endif
 #endif

 #if !defined(PEDANTIC) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
-#if defined(__GNUC__) && __GNUC__ >= 2
+#if defined(__GNUC__)
 #if defined(__x86_64) || defined(__x86_64__)
-#define BSWAP8(x) ({ u64 ret_=(x);                   \
+#define BSWAP8(x) ({ uint64_t ret_=(x);                   \
                         asm ("bswapq %0"                \
                         : "+r"(ret_));   ret_; })
-#define BSWAP4(x) ({ u32 ret_=(x);                   \
+#define BSWAP4(x) ({ uint32_t ret_=(x);                   \
                         asm ("bswapl %0"                \
                         : "+r"(ret_));   ret_; })
 #elif (defined(__i386) || defined(__i386__)) && !defined(I386_ONLY)
-#define BSWAP8(x) ({ u32 lo_=(u64)(x)>>32,hi_=(x);   \
+#define BSWAP8(x) ({ uint32_t lo_=(uint64_t)(x)>>32,hi_=(x);   \
                         asm ("bswapl %0; bswapl %1"     \
                         : "+r"(hi_),"+r"(lo_));         \
-                        (u64)hi_<<32|lo_; })
-#define BSWAP4(x) ({ u32 ret_=(x);                   \
+                        (uint64_t)hi_<<32|lo_; })
+#define BSWAP4(x) ({ uint32_t ret_=(x);                   \
                         asm ("bswapl %0"                \
                         : "+r"(ret_));   ret_; })
 #elif defined(__aarch64__)
 #if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-#define BSWAP8(x) ({ u64 ret_;                       \
+#define BSWAP8(x) ({ uint64_t ret_;                       \
                         asm ("rev %0,%1"                \
                         : "=r"(ret_) : "r"(x)); ret_; })
-#define BSWAP4(x) ({ u32 ret_;                       \
+#define BSWAP4(x) ({ uint32_t ret_;                       \
                         asm ("rev %w0,%w1"              \
                         : "=r"(ret_) : "r"(x)); ret_; })
 #endif
 #elif (defined(__arm__) || defined(__arm)) && !defined(STRICT_ALIGNMENT)
-#define BSWAP8(x) ({ u32 lo_=(u64)(x)>>32,hi_=(x);   \
+#define BSWAP8(x) ({ uint32_t lo_=(uint64_t)(x)>>32,hi_=(x);   \
                         asm ("rev %0,%0; rev %1,%1"     \
                         : "+r"(hi_),"+r"(lo_));         \
-                        (u64)hi_<<32|lo_; })
-#define BSWAP4(x) ({ u32 ret_;                       \
+                        (uint64_t)hi_<<32|lo_; })
+#define BSWAP4(x) ({ uint32_t ret_;                       \
                         asm ("rev %0,%1"                \
-                        : "=r"(ret_) : "r"((u32)(x)));  \
+                        : "=r"(ret_) : "r"((uint32_t)(x)));  \
                         ret_; })
 #elif (defined(__riscv_zbb) || defined(__riscv_zbkb)) && __riscv_xlen == 64
-#define BSWAP8(x) ({ u64 ret_=(x);                   \
+#define BSWAP8(x) ({ uint64_t ret_=(x);                   \
                         asm ("rev8 %0,%0"               \
                         : "+r"(ret_));   ret_; })
-#define BSWAP4(x) ({ u32 ret_=(x);                   \
+#define BSWAP4(x) ({ uint32_t ret_=(x);                   \
                         asm ("rev8 %0,%0; srli %0,%0,32"\
                         : "+&r"(ret_));  ret_; })
+#elif defined(__e2k__)
+#define BSWAP8(x) __builtin_bswap64(x)
+#define BSWAP4(x) __builtin_bswap32(x)
 #endif
 #elif defined(_MSC_VER)
 #if _MSC_VER >= 1300
 #include <stdlib.h>
 #pragma intrinsic(_byteswap_uint64, _byteswap_ulong)
-#define BSWAP8(x) _byteswap_uint64((u64)(x))
-#define BSWAP4(x) _byteswap_ulong((u32)(x))
+#define BSWAP8(x) _byteswap_uint64((uint64_t)(x))
+#define BSWAP4(x) _byteswap_ulong((uint32_t)(x))
 #elif defined(_M_IX86)
-__inline u32 _bswap4(u32 val) {
+__inline uint32_t _bswap4(uint32_t val) {
     _asm mov eax, val _asm bswap eax
 }
 #define BSWAP4(x) _bswap4(x)
@@ -92,19 +91,19 @@ __inline u32 _bswap4(u32 val) {
 #endif
 #endif
 #if defined(BSWAP4) && !defined(STRICT_ALIGNMENT)
-#define GETU32(p) BSWAP4(*(const u32 *)(p))
-#define PUTU32(p, v) *(u32 *)(p) = BSWAP4(v)
+#define GETU32(p) BSWAP4(*(const uint32_t *)(p))
+#define PUTU32(p, v) *(uint32_t *)(p) = BSWAP4(v)
 #else
-#define GETU32(p) ((u32)(p)[0] << 24 | (u32)(p)[1] << 16 | (u32)(p)[2] << 8 | (u32)(p)[3])
-#define PUTU32(p, v) ((p)[0] = (u8)((v) >> 24), (p)[1] = (u8)((v) >> 16), (p)[2] = (u8)((v) >> 8), (p)[3] = (u8)(v))
+#define GETU32(p) ((uint32_t)(p)[0] << 24 | (uint32_t)(p)[1] << 16 | (uint32_t)(p)[2] << 8 | (uint32_t)(p)[3])
+#define PUTU32(p, v) ((p)[0] = (uint8_t)((v) >> 24), (p)[1] = (uint8_t)((v) >> 16), (p)[2] = (uint8_t)((v) >> 8), (p)[3] = (uint8_t)(v))
 #endif
 /*- GCM definitions */ typedef struct {
-    u64 hi, lo;
+    uint64_t hi, lo;
 } u128;

-typedef void (*gcm_init_fn)(u128 Htable[16], const u64 H[2]);
-typedef void (*gcm_ghash_fn)(u64 Xi[2], const u128 Htable[16], const u8 *inp, size_t len);
-typedef void (*gcm_gmult_fn)(u64 Xi[2], const u128 Htable[16]);
+typedef void (*gcm_init_fn)(u128 Htable[16], const uint64_t H[2]);
+typedef void (*gcm_ghash_fn)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, size_t len);
+typedef void (*gcm_gmult_fn)(uint64_t Xi[2], const u128 Htable[16]);
 struct gcm_funcs_st {
     gcm_init_fn ginit;
     gcm_ghash_fn ghash;
@@ -114,9 +113,9 @@ struct gcm_funcs_st {
 struct gcm128_context {
     /* Following 6 names follow names in GCM specification */
     union {
-        u64 u[2];
-        u32 d[4];
-        u8 c[16];
+        uint64_t u[2];
+        uint32_t d[4];
+        uint8_t c[16];
         size_t t[16 / sizeof(size_t)];
     } Yi, EKi, EK0, len, Xi, H;
     /*
@@ -134,10 +133,10 @@ struct gcm128_context {
 };

 /* GHASH functions */
-void ossl_gcm_init_4bit(u128 Htable[16], const u64 H[2]);
-void ossl_gcm_ghash_4bit(u64 Xi[2], const u128 Htable[16],
-    const u8 *inp, size_t len);
-void ossl_gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16]);
+void ossl_gcm_init_4bit(u128 Htable[16], const uint64_t H[2]);
+void ossl_gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16],
+    const uint8_t *inp, size_t len);
+void ossl_gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]);

 /*
  * The maximum permitted number of cipher blocks per data unit in XTS mode.
@@ -158,10 +157,10 @@ int ossl_crypto_xts128gb_encrypt(const XTS128_CONTEXT *ctx,

 struct ccm128_context {
     union {
-        u64 u[2];
-        u8 c[16];
+        uint64_t u[2];
+        uint8_t c[16];
     } nonce, cmac;
-    u64 blocks;
+    uint64_t blocks;
     block128_f block;
     void *key;
 };
@@ -169,7 +168,7 @@ struct ccm128_context {
 #ifndef OPENSSL_NO_OCB

 typedef union {
-    u64 a[2];
+    uint64_t a[2];
     unsigned char c[16];
 } OCB_BLOCK;
 #define ocb_block16_xor(in1, in2, out)        \
@@ -197,8 +196,8 @@ struct ocb128_context {
     OCB_BLOCK *l;
     /* Must be reset for each session */
     struct {
-        u64 blocks_hashed;
-        u64 blocks_processed;
+        uint64_t blocks_hashed;
+        uint64_t blocks_processed;
         OCB_BLOCK offset_aad;
         OCB_BLOCK sum;
         OCB_BLOCK offset;
@@ -229,3 +228,5 @@ struct siv128_context {
 };

 #endif /* OPENSSL_NO_SIV */
+
+#endif /* !defined(OSSL_CRYPTO_MODES_H) */
diff --git a/deps/openssl/openssl/include/crypto/objects.h b/deps/openssl/openssl/include/crypto/objects.h
index f22e9287723..7bc9c4d725d 100644
--- a/deps/openssl/openssl/include/crypto/objects.h
+++ b/deps/openssl/openssl/include/crypto/objects.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,11 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_CRYPTO_OBJECTS_H)
+#define OSSL_CRYPTO_OBJECTS_H
+
 #include <openssl/objects.h>

 void ossl_obj_cleanup_int(void);
+
+#endif /* !defined(OSSL_CRYPTO_OBJECTS_H) */
diff --git a/deps/openssl/openssl/include/crypto/objectserr.h b/deps/openssl/openssl/include/crypto/objectserr.h
deleted file mode 100644
index 47fc698aa13..00000000000
--- a/deps/openssl/openssl/include/crypto/objectserr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_OBJECTSERR_H
-#define OSSL_CRYPTO_OBJECTSERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_OBJ_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/ocsperr.h b/deps/openssl/openssl/include/crypto/ocsperr.h
deleted file mode 100644
index d05a0324c0b..00000000000
--- a/deps/openssl/openssl/include/crypto/ocsperr.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_OCSPERR_H
-#define OSSL_CRYPTO_OCSPERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef OPENSSL_NO_OCSP
-
-int ossl_err_load_OCSP_strings(void);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/pemerr.h b/deps/openssl/openssl/include/crypto/pemerr.h
deleted file mode 100644
index 3a2aa022610..00000000000
--- a/deps/openssl/openssl/include/crypto/pemerr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_PEMERR_H
-#define OSSL_CRYPTO_PEMERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_PEM_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/pkcs12err.h b/deps/openssl/openssl/include/crypto/pkcs12err.h
deleted file mode 100644
index d1f1a521027..00000000000
--- a/deps/openssl/openssl/include/crypto/pkcs12err.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_PKCS12ERR_H
-#define OSSL_CRYPTO_PKCS12ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_PKCS12_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/pkcs7.h b/deps/openssl/openssl/include/crypto/pkcs7.h
index bf0e6bf6074..df9d123fce7 100644
--- a/deps/openssl/openssl/include/crypto/pkcs7.h
+++ b/deps/openssl/openssl/include/crypto/pkcs7.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,8 @@
 #define OSSL_CRYPTO_PKCS7_H
 #pragma once

+#include <openssl/pkcs7.h>
+
 void ossl_pkcs7_resolve_libctx(PKCS7 *p7);

 void ossl_pkcs7_set0_libctx(PKCS7 *p7, OSSL_LIB_CTX *ctx);
diff --git a/deps/openssl/openssl/include/crypto/pkcs7err.h b/deps/openssl/openssl/include/crypto/pkcs7err.h
deleted file mode 100644
index 68d071b936f..00000000000
--- a/deps/openssl/openssl/include/crypto/pkcs7err.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_PKCS7ERR_H
-#define OSSL_CRYPTO_PKCS7ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_PKCS7_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/rand.h b/deps/openssl/openssl/include/crypto/rand.h
index 712614c9c88..183fd5ec571 100644
--- a/deps/openssl/openssl/include/crypto/rand.h
+++ b/deps/openssl/openssl/include/crypto/rand.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -23,7 +23,12 @@
 #include "crypto/rand_pool.h"

 #if defined(__APPLE__) && !defined(OPENSSL_NO_APPLE_CRYPTO_RANDOM)
+#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
 #include <Availability.h>
+#else
+#include <TargetConditionals.h>
+#include <AvailabilityMacros.h>
+#endif
 #if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000)
 #define OPENSSL_APPLE_CRYPTO_RANDOM 1
 #include <CommonCrypto/CommonCryptoError.h>
@@ -34,6 +39,16 @@
 /*
  * Defines related to seed sources
  */
+
+/* Name of the seed source used to seed the primary DRBG. */
+#ifndef OPENSSL_NO_FIPS_JITTER
+#define OPENSSL_SEED_SRC_NAME "JITTER"
+#elif defined(OPENSSL_DEFAULT_SEED_SRC)
+#define OPENSSL_SEED_SRC_NAME OPENSSL_MSTR(OPENSSL_DEFAULT_SEED_SRC)
+#else
+#define OPENSSL_SEED_SRC_NAME "SEED-SRC"
+#endif
+
 #ifndef DEVRANDOM
 /*
  * set this to a comma-separated list of 'random' device files to try out. By
@@ -138,6 +153,8 @@ int ossl_pool_add_nonce_data(RAND_POOL *pool);
 EVP_RAND_CTX *ossl_rand_get0_private_noncreating(OSSL_LIB_CTX *ctx);
 #else
 EVP_RAND_CTX *ossl_rand_get0_seed_noncreating(OSSL_LIB_CTX *ctx);
+EVP_RAND_CTX *ossl_rand_get0_seed(OSSL_LIB_CTX *ctx);
+int ossl_rand_seed_source_strict(OSSL_LIB_CTX *ctx);
 #endif

 /* Generate a uniformly distributed random integer in the interval [0, upper) */
diff --git a/deps/openssl/openssl/include/crypto/randerr.h b/deps/openssl/openssl/include/crypto/randerr.h
deleted file mode 100644
index b6c91c7f980..00000000000
--- a/deps/openssl/openssl/include/crypto/randerr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_RANDERR_H
-#define OSSL_CRYPTO_RANDERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_RAND_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/rsa.h b/deps/openssl/openssl/include/crypto/rsa.h
index 98423bc85fa..a57702aa1d1 100644
--- a/deps/openssl/openssl/include/crypto/rsa.h
+++ b/deps/openssl/openssl/include/crypto/rsa.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,6 +17,58 @@

 #define RSA_MIN_MODULUS_BITS 512

+#ifdef FIPS_MODULE
+#define OSSL_RSA_PARAM_MAX_PRIMES 2
+#else
+#define OSSL_RSA_PARAM_MAX_PRIMES 10
+#endif
+
+typedef struct rsa_params_st {
+    OSSL_PARAM *n;
+    OSSL_PARAM *e;
+    OSSL_PARAM *d;
+    OSSL_PARAM *a;
+    OSSL_PARAM *b;
+    OSSL_PARAM *bits;
+    OSSL_PARAM *secbits;
+    OSSL_PARAM *maxsize;
+    OSSL_PARAM *seccat;
+    OSSL_PARAM *default_digest;
+    OSSL_PARAM *mandatory_digest;
+
+    /* PSS specific params */
+    OSSL_PARAM *digest;
+    OSSL_PARAM *digest_props;
+    OSSL_PARAM *maskgenfunc;
+    OSSL_PARAM *mgf1_digest;
+    OSSL_PARAM *pss_saltlen;
+
+    /* import specific params */
+    OSSL_PARAM *derive;
+
+#ifdef FIPS_MODULE
+    struct {
+        OSSL_PARAM *xp;
+        OSSL_PARAM *xp1;
+        OSSL_PARAM *xp2;
+        OSSL_PARAM *xq;
+        OSSL_PARAM *xq1;
+        OSSL_PARAM *xq2;
+        OSSL_PARAM *p1;
+        OSSL_PARAM *p2;
+        OSSL_PARAM *q1;
+        OSSL_PARAM *q2;
+    } fips;
+#endif
+
+    OSSL_PARAM *primes;
+    struct {
+        OSSL_PARAM *factors[OSSL_RSA_PARAM_MAX_PRIMES];
+        OSSL_PARAM *exps[OSSL_RSA_PARAM_MAX_PRIMES];
+        OSSL_PARAM *coeffs[OSSL_RSA_PARAM_MAX_PRIMES - 1];
+    } mp;
+} RSA_PARAMS;
+
 typedef struct rsa_pss_params_30_st {
     int hash_algorithm_nid;
     struct {
@@ -73,13 +125,19 @@ RSA *ossl_rsa_dup(const RSA *rsa, int selection);

 int ossl_rsa_todata(RSA *rsa, OSSL_PARAM_BLD *bld, OSSL_PARAM params[],
     int include_private);
+int ossl_rsa_todata_parsed(RSA *rsa, OSSL_PARAM_BLD *bld,
+    const RSA_PARAMS *params, int include_private);
 int ossl_rsa_fromdata(RSA *rsa, const OSSL_PARAM params[], int include_private);
+int ossl_rsa_fromdata_parsed(RSA *rsa, const RSA_PARAMS *params,
+    int include_private);
 int ossl_rsa_pss_params_30_todata(const RSA_PSS_PARAMS_30 *pss,
     OSSL_PARAM_BLD *bld, OSSL_PARAM params[]);
+int ossl_rsa_pss_params_30_todata_parsed(const RSA_PSS_PARAMS_30 *pss,
+    OSSL_PARAM_BLD *bld, const RSA_PARAMS *params);
 int ossl_rsa_pss_params_30_fromdata(RSA_PSS_PARAMS_30 *pss_params,
-    int *defaults_set,
-    const OSSL_PARAM params[],
-    OSSL_LIB_CTX *libctx);
+    int *defaults_set, const OSSL_PARAM params[], OSSL_LIB_CTX *libctx);
+int ossl_rsa_pss_params_30_fromdata_parsed(RSA_PSS_PARAMS_30 *pss_params,
+    int *defaults_set, const RSA_PARAMS *params, OSSL_LIB_CTX *libctx);
 int ossl_rsa_set0_pss_params(RSA *r, RSA_PSS_PARAMS *pss);
 int ossl_rsa_pss_get_param_unverified(const RSA_PSS_PARAMS *pss,
     const EVP_MD **pmd, const EVP_MD **pmgf1md,
@@ -124,16 +182,23 @@ ASN1_STRING *ossl_rsa_ctx_to_pss_string(EVP_PKEY_CTX *pkctx);
 int ossl_rsa_pss_to_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pkctx,
     const X509_ALGOR *sigalg, EVP_PKEY *pkey);

+int ossl_rsa_generate_multi_prime_key(RSA *rsa, int bits, int primes,
+    BIGNUM *e_value, BN_GENCB *cb,
+    uint32_t a, uint32_t b);
+
 #if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
 int ossl_rsa_acvp_test_gen_params_new(OSSL_PARAM **dst, const OSSL_PARAM src[]);
+int ossl_rsa_acvp_test_gen_params_new_parsed(OSSL_PARAM **dst,
+    const RSA_PARAMS *params);
 void ossl_rsa_acvp_test_gen_params_free(OSSL_PARAM *dst);

 int ossl_rsa_acvp_test_set_params(RSA *r, const OSSL_PARAM params[]);
 int ossl_rsa_acvp_test_get_params(RSA *r, OSSL_PARAM params[]);
+int ossl_rsa_acvp_test_get_params_parsed(RSA *r, const RSA_PARAMS *params);
 typedef struct rsa_acvp_test_st RSA_ACVP_TEST;
 void ossl_rsa_acvp_test_free(RSA_ACVP_TEST *t);
 #else
-#define RSA_ACVP_TEST void
+typedef void RSA_ACVP_TEST;
 #endif
 int ossl_rsa_check_factors(RSA *r);

diff --git a/deps/openssl/openssl/include/crypto/rsa_params.h.in b/deps/openssl/openssl/include/crypto/rsa_params.h.in
new file mode 100644
index 00000000000..e7fcf95cc1c
--- /dev/null
+++ b/deps/openssl/openssl/include/crypto/rsa_params.h.in
@@ -0,0 +1,246 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_RSA_PARAMS_H
+#define OSSL_CRYPTO_RSA_PARAMS_H
+
+/* clang-format off */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+#include "crypto/rsa.h"
+#include <openssl/core_names.h>
+#include <openssl/err.h>
+#include <openssl/proverr.h>
+
+{-
+our @RSA_KEY_MP_TYPES = (
+    ['OSSL_PKEY_PARAM_RSA_FACTOR1',      'mp.factors[0]', 'BN'],
+    ['OSSL_PKEY_PARAM_RSA_FACTOR2',      'mp.factors[1]', 'BN'],
+    ['OSSL_PKEY_PARAM_RSA_FACTOR3',      'mp.factors[2]', 'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_FACTOR4',      'mp.factors[3]', 'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_FACTOR5',      'mp.factors[4]', 'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_FACTOR6',      'mp.factors[5]', 'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_FACTOR7',      'mp.factors[6]', 'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_FACTOR8',      'mp.factors[7]', 'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_FACTOR9',      'mp.factors[8]', 'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_FACTOR10',     'mp.factors[9]', 'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_EXPONENT1',    'mp.exps[0]',    'BN'],
+    ['OSSL_PKEY_PARAM_RSA_EXPONENT2',    'mp.exps[1]',    'BN'],
+    ['OSSL_PKEY_PARAM_RSA_EXPONENT3',    'mp.exps[2]',    'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_EXPONENT4',    'mp.exps[3]',    'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_EXPONENT5',    'mp.exps[4]',    'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_EXPONENT6',    'mp.exps[5]',    'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_EXPONENT7',    'mp.exps[6]',    'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_EXPONENT8',    'mp.exps[7]',    'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_EXPONENT9',    'mp.exps[8]',    'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_EXPONENT10',   'mp.exps[9]',    'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_COEFFICIENT1', 'mp.coeffs[0]',  'BN'],
+    ['OSSL_PKEY_PARAM_RSA_COEFFICIENT2', 'mp.coeffs[1]',  'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_COEFFICIENT3', 'mp.coeffs[2]',  'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_COEFFICIENT4', 'mp.coeffs[3]',  'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_COEFFICIENT5', 'mp.coeffs[4]',  'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_COEFFICIENT6', 'mp.coeffs[5]',  'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_COEFFICIENT7', 'mp.coeffs[6]',  'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_COEFFICIENT8', 'mp.coeffs[7]',  'BN', '!fips'],
+    ['OSSL_PKEY_PARAM_RSA_COEFFICIENT9', 'mp.coeffs[8]',  'BN', '!fips'],
+);
+
+our @RSA_KEY_TYPES = (
+    ['OSSL_PKEY_PARAM_RSA_N', 'n', 'BN'],
+    ['OSSL_PKEY_PARAM_RSA_E', 'e', 'BN'],
+    ['OSSL_PKEY_PARAM_RSA_D', 'd', 'BN'],
+    @RSA_KEY_MP_TYPES
+);
+
+our @RSA_PSS_IMPORT_TYPES = (
+    ['OSSL_PKEY_PARAM_RSA_DIGEST',       'digest',       'utf8_string'],
+    ['OSSL_PKEY_PARAM_RSA_DIGEST_PROPS', 'digest_props', 'utf8_string'],
+    ['OSSL_PKEY_PARAM_RSA_MASKGENFUNC',  'maskgenfunc',  'utf8_string'],
+    ['OSSL_PKEY_PARAM_RSA_MGF1_DIGEST',  'mgf1_digest',  'utf8_string'],
+    ['OSSL_PKEY_PARAM_RSA_PSS_SALTLEN',  'pss_saltlen',  'int'],
+);
+
+our @RSA_PSS_EXPORT_TYPES = (
+    ['OSSL_PKEY_PARAM_RSA_DIGEST',      'digest',      'utf8_string'],
+    ['OSSL_PKEY_PARAM_RSA_MASKGENFUNC', 'maskgenfunc', 'utf8_string'],
+    ['OSSL_PKEY_PARAM_RSA_MGF1_DIGEST', 'mgf1_digest', 'utf8_string'],
+    ['OSSL_PKEY_PARAM_RSA_PSS_SALTLEN', 'pss_saltlen', 'int'],
+);
+
+our @RSA_GEN_BASIC_TYPES = (
+    ['OSSL_PKEY_PARAM_RSA_BITS',   'bits',   'size_t'],
+    ['OSSL_PKEY_PARAM_RSA_PRIMES', 'primes', 'size_t'],
+    ['OSSL_PKEY_PARAM_RSA_E',      'e',      'BN'],
+    ['OSSL_PKEY_PARAM_RSA_A',      'a',      'uint32'],
+    ['OSSL_PKEY_PARAM_RSA_B',      'b',      'uint32'],
+);
+
+our @RSA_ACVP_INPUT_TYPES = (
+    ['OSSL_PKEY_PARAM_RSA_TEST_XP',  'fips.xp',  'BN', 'fips'],
+    ['OSSL_PKEY_PARAM_RSA_TEST_XP1', 'fips.xp1', 'BN', 'fips'],
+    ['OSSL_PKEY_PARAM_RSA_TEST_XP2', 'fips.xp2', 'BN', 'fips'],
+    ['OSSL_PKEY_PARAM_RSA_TEST_XQ',  'fips.xq',  'BN', 'fips'],
+    ['OSSL_PKEY_PARAM_RSA_TEST_XQ1', 'fips.xq1', 'BN', 'fips'],
+    ['OSSL_PKEY_PARAM_RSA_TEST_XQ2', 'fips.xq2', 'BN', 'fips'],
+);
+
+our @RSA_ACVP_OUTPUT_TYPES = (
+    ['OSSL_PKEY_PARAM_RSA_TEST_P1', 'fips.p1', 'BN', 'fips'],
+    ['OSSL_PKEY_PARAM_RSA_TEST_P2', 'fips.p2', 'BN', 'fips'],
+    ['OSSL_PKEY_PARAM_RSA_TEST_Q1', 'fips.q1', 'BN', 'fips'],
+    ['OSSL_PKEY_PARAM_RSA_TEST_Q2', 'fips.q2', 'BN', 'fips'],
+);
+
+return "";
+-}
+
+/* Key component parsing used by the public compatibility wrappers. */
+#define rsa_key_fromdata_st rsa_params_st
+{- produce_param_decoder('rsa_key_fromdata',
+                         (@RSA_KEY_TYPES,
+                          ['OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ', 'derive', 'int']
+                         )); -}
+
+#define rsa_key_todata_st rsa_params_st
+{- produce_param_decoder('rsa_key_todata',
+                         (@RSA_KEY_TYPES, @RSA_ACVP_OUTPUT_TYPES)); -}
+
+#define rsa_pss_fromdata_st rsa_params_st
+{- produce_param_decoder('rsa_pss_fromdata', @RSA_PSS_IMPORT_TYPES); -}
+
+#define rsa_pss_todata_st rsa_params_st
+{- produce_param_decoder('rsa_pss_todata', @RSA_PSS_EXPORT_TYPES); -}
+
+/*
+ * Parameters processed by plain RSA get_params(), including conditional ACVP
+ * data.
+ */
+#define rsa_get_params_st rsa_params_st
+{- produce_param_decoder('rsa_get_params',
+                         (['OSSL_PKEY_PARAM_BITS',              'bits',            'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_BITS',     'secbits',          'int'],
+                          ['OSSL_PKEY_PARAM_MAX_SIZE',          'maxsize',          'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_CATEGORY', 'seccat',           'int'],
+                          ['OSSL_PKEY_PARAM_DEFAULT_DIGEST',    'default_digest',   'utf8_string'],
+                          @RSA_KEY_TYPES,
+                          @RSA_ACVP_OUTPUT_TYPES
+                         )); -}
+
+/* Parameters processed by RSA-PSS get_params(). */
+#define rsapss_get_params_st rsa_params_st
+{- produce_param_decoder('rsapss_get_params',
+                         (['OSSL_PKEY_PARAM_BITS',              'bits',            'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_BITS',     'secbits',          'int'],
+                          ['OSSL_PKEY_PARAM_MAX_SIZE',          'maxsize',          'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_CATEGORY', 'seccat',           'int'],
+                          ['OSSL_PKEY_PARAM_DEFAULT_DIGEST',    'default_digest',   'utf8_string'],
+                          ['OSSL_PKEY_PARAM_MANDATORY_DIGEST',  'mandatory_digest', 'utf8_string'],
+                          @RSA_KEY_TYPES,
+                          @RSA_PSS_EXPORT_TYPES,
+                          @RSA_ACVP_OUTPUT_TYPES
+                         )); -}
+
+/* Plain RSA generation parameters. */
+#define rsa_gen_set_params_st rsa_params_st
+{- produce_param_decoder('rsa_gen_set_params',
+                         (@RSA_GEN_BASIC_TYPES,
+                          @RSA_ACVP_INPUT_TYPES
+                         )); -}
+
+#define rsapss_gen_set_params_st rsa_params_st
+{- produce_param_decoder('rsapss_gen_set_params',
+                         (@RSA_GEN_BASIC_TYPES,
+                          @RSA_PSS_IMPORT_TYPES,
+                          @RSA_ACVP_INPUT_TYPES
+                         )); -}
+
+/* Legacy EVP_PKEY import-from callbacks retain their existing signatures. */
+#define rsa_pkey_import_from_st rsa_params_st
+{- produce_param_decoder('rsa_pkey_import_from',
+                         (@RSA_KEY_TYPES,
+                          ['OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ', 'derive', 'int']
+                         )); -}
+
+#define rsa_pss_pkey_import_from_st rsa_params_st
+{- produce_param_decoder('rsa_pss_pkey_import_from',
+                         (@RSA_KEY_TYPES,
+                          ['OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ', 'derive', 'int'],
+                          @RSA_PSS_IMPORT_TYPES
+                         )); -}
+
+/* FIPS ACVP helpers also use the generated trie. */
+#define rsa_acvp_input_st rsa_params_st
+{- produce_param_decoder('rsa_acvp_input', @RSA_ACVP_INPUT_TYPES); -}
+
+#define rsa_acvp_output_st rsa_params_st
+{- produce_param_decoder('rsa_acvp_output', @RSA_ACVP_OUTPUT_TYPES); -}
+
+/* Selection-specific import and export declarations. */
+#define rsa_key_import_types_st rsa_params_st
+{- produce_param_decoder('rsa_key_import_types',
+                         (@RSA_KEY_TYPES,
+                          ['OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ', 'derive', 'int']
+                         )); -}
+
+#define rsa_key_export_types_st
+#define rsa_key_export_types_decoder
+{- produce_param_decoder('rsa_key_export_types', @RSA_KEY_TYPES); -}
+
+#define rsa_other_import_types_st rsa_params_st
+{- produce_param_decoder('rsa_other_import_types'); -}
+
+#define rsa_other_export_types_st
+#define rsa_other_export_types_decoder
+{- produce_param_decoder('rsa_other_export_types'); -}
+
+#define rsa_all_import_types_st rsa_params_st
+{- produce_param_decoder('rsa_all_import_types',
+                         (@RSA_KEY_TYPES,
+                          ['OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ', 'derive', 'int']
+                         )); -}
+
+#define rsa_all_export_types_st
+#define rsa_all_export_types_decoder
+{- produce_param_decoder('rsa_all_export_types', @RSA_KEY_TYPES); -}
+
+#define rsapss_key_import_types_st rsa_params_st
+{- produce_param_decoder('rsapss_key_import_types',
+                         (@RSA_KEY_TYPES,
+                          ['OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ', 'derive', 'int']
+                         )); -}
+
+#define rsapss_key_export_types_st
+#define rsapss_key_export_types_decoder
+{- produce_param_decoder('rsapss_key_export_types', @RSA_KEY_TYPES); -}
+
+#define rsapss_other_import_types_st rsa_params_st
+{- produce_param_decoder('rsapss_other_import_types', @RSA_PSS_IMPORT_TYPES); -}
+
+#define rsapss_other_export_types_st
+#define rsapss_other_export_types_decoder
+{- produce_param_decoder('rsapss_other_export_types', @RSA_PSS_EXPORT_TYPES); -}
+
+#define rsapss_all_import_types_st rsa_params_st
+{- produce_param_decoder('rsapss_all_import_types',
+                         (@RSA_KEY_TYPES,
+                          ['OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ', 'derive', 'int'],
+                          @RSA_PSS_IMPORT_TYPES
+                         )); -}
+
+#define rsapss_all_export_types_st
+#define rsapss_all_export_types_decoder
+{- produce_param_decoder('rsapss_all_export_types',
+                         (@RSA_KEY_TYPES, @RSA_PSS_EXPORT_TYPES)); -}
+
+/* clang-format on */
+
+#endif
diff --git a/deps/openssl/openssl/include/crypto/rsaerr.h b/deps/openssl/openssl/include/crypto/rsaerr.h
deleted file mode 100644
index d295eef80d2..00000000000
--- a/deps/openssl/openssl/include/crypto/rsaerr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_RSAERR_H
-#define OSSL_CRYPTO_RSAERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_RSA_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/security_bits.h b/deps/openssl/openssl/include/crypto/security_bits.h
index 56fe8d2573d..1db3c904a28 100644
--- a/deps/openssl/openssl/include/crypto/security_bits.h
+++ b/deps/openssl/openssl/include/crypto/security_bits.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,8 @@
 #define OSSL_SECURITY_BITS_H
 #pragma once

+#include <stdint.h>
+
 uint16_t ossl_ifc_ffc_compute_security_bits(int n);

 #endif
diff --git a/deps/openssl/openssl/include/crypto/sha.h b/deps/openssl/openssl/include/crypto/sha.h
index fed23f1a667..f2be474f9ea 100644
--- a/deps/openssl/openssl/include/crypto/sha.h
+++ b/deps/openssl/openssl/include/crypto/sha.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2018, Oracle and/or its affiliates.  All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -14,10 +14,25 @@

 #include <openssl/sha.h>

+#ifndef OPENSSL_NO_DEPRECATED_3_0
+/* This is inside a deprecated block because SHA256_CTX was marked deprecated */
 int ossl_sha256_192_init(SHA256_CTX *c);
 int sha512_224_init(SHA512_CTX *);
 int sha512_256_init(SHA512_CTX *);
 int ossl_sha1_ctrl(SHA_CTX *ctx, int cmd, int mslen, void *ms);
+#endif
+
 unsigned char *ossl_sha1(const unsigned char *d, size_t n, unsigned char *md);

+int ossl_sp800_185_right_encode(unsigned char *out,
+    size_t out_max_len, size_t *out_len,
+    size_t bits);
+int ossl_sp800_185_encode_string(unsigned char *out,
+    size_t out_max_len, size_t *out_len,
+    const unsigned char *in, size_t in_len);
+int ossl_sp800_185_bytepad(unsigned char *out, size_t out_len_max, size_t *out_len,
+    const unsigned char *in1, size_t in1_len,
+    const unsigned char *in2, size_t in2_len,
+    size_t w);
+
 #endif
diff --git a/deps/openssl/openssl/include/crypto/siphash.h b/deps/openssl/openssl/include/crypto/siphash.h
index 3ffdc055e69..fc6b7661f6d 100644
--- a/deps/openssl/openssl/include/crypto/siphash.h
+++ b/deps/openssl/openssl/include/crypto/siphash.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,6 +12,7 @@
 #pragma once

 #include <stddef.h>
+#include <stdint.h>

 #define SIPHASH_BLOCK_SIZE 8
 #define SIPHASH_KEY_SIZE 16
diff --git a/deps/openssl/openssl/include/crypto/siv.h b/deps/openssl/openssl/include/crypto/siv.h
index b4f04a80c8a..52d3fb8c9bc 100644
--- a/deps/openssl/openssl/include/crypto/siv.h
+++ b/deps/openssl/openssl/include/crypto/siv.h
@@ -1,14 +1,20 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
+#if !defined(OPENSSL_CRYPTO_SIV_H)
+#define OPENSSL_CRYPTO_SIV_H

 #ifndef OPENSSL_NO_SIV

+#include <stddef.h>
+
+#include <openssl/evp.h>
+
 typedef struct siv128_context SIV128_CONTEXT;

 SIV128_CONTEXT *ossl_siv128_new(const unsigned char *key, int klen,
@@ -31,3 +37,4 @@ int ossl_siv128_cleanup(SIV128_CONTEXT *ctx);
 int ossl_siv128_speed(SIV128_CONTEXT *ctx, int arg);

 #endif /* OPENSSL_NO_SIV */
+#endif /* !defined (OPENSSL_CRYPTO_SIV_H) */
diff --git a/deps/openssl/openssl/include/crypto/slh_dsa.h b/deps/openssl/openssl/include/crypto/slh_dsa.h
index b823a312b04..041991bdcc8 100644
--- a/deps/openssl/openssl/include/crypto/slh_dsa.h
+++ b/deps/openssl/openssl/include/crypto/slh_dsa.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -33,7 +33,8 @@ __owur int ossl_slh_dsa_key_equal(const SLH_DSA_KEY *key1, const SLH_DSA_KEY *ke
     int selection);
 __owur int ossl_slh_dsa_key_has(const SLH_DSA_KEY *key, int selection);
 __owur int ossl_slh_dsa_key_pairwise_check(const SLH_DSA_KEY *key);
-__owur int ossl_slh_dsa_key_fromdata(SLH_DSA_KEY *key, const OSSL_PARAM *params,
+__owur int ossl_slh_dsa_key_fromdata(SLH_DSA_KEY *key, const OSSL_PARAM *pub,
+    const OSSL_PARAM *param_priv,
     int include_private);
 __owur int ossl_slh_dsa_generate_key(SLH_DSA_HASH_CTX *ctx, SLH_DSA_KEY *out,
     OSSL_LIB_CTX *libctx,
@@ -48,6 +49,7 @@ __owur int ossl_slh_dsa_set_pub(SLH_DSA_KEY *key, const uint8_t *pub,
     size_t pub_len);
 __owur size_t ossl_slh_dsa_key_get_priv_len(const SLH_DSA_KEY *key);
 __owur size_t ossl_slh_dsa_key_get_n(const SLH_DSA_KEY *key);
+__owur int ossl_slh_dsa_key_get_security_category(const SLH_DSA_KEY *key);
 __owur size_t ossl_slh_dsa_key_get_sig_len(const SLH_DSA_KEY *key);
 __owur const char *ossl_slh_dsa_key_get_name(const SLH_DSA_KEY *key);
 __owur int ossl_slh_dsa_key_get_type(const SLH_DSA_KEY *key);
@@ -55,6 +57,8 @@ __owur int ossl_slh_dsa_key_type_matches(const SLH_DSA_KEY *key, const char *alg
 __owur SLH_DSA_HASH_CTX *ossl_slh_dsa_hash_ctx_new(const SLH_DSA_KEY *key);
 void ossl_slh_dsa_hash_ctx_free(SLH_DSA_HASH_CTX *ctx);
 __owur SLH_DSA_HASH_CTX *ossl_slh_dsa_hash_ctx_dup(const SLH_DSA_HASH_CTX *src);
+__owur int ossl_slh_dsa_hash_ctx_prehash_pk_seed(SLH_DSA_HASH_CTX *ctx,
+    const uint8_t *pkseed, size_t n);

 __owur int ossl_slh_dsa_sign(SLH_DSA_HASH_CTX *slh_ctx,
     const uint8_t *msg, size_t msg_len,
diff --git a/deps/openssl/openssl/include/crypto/sm2.h b/deps/openssl/openssl/include/crypto/sm2.h
index 246d644c279..2830cf97d5b 100644
--- a/deps/openssl/openssl/include/crypto/sm2.h
+++ b/deps/openssl/openssl/include/crypto/sm2.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2017 Ribose Inc. All Rights Reserved.
  * Ported from Ribose contributions from Botan.
  *
@@ -22,9 +22,6 @@

 int ossl_sm2_key_private_check(const EC_KEY *eckey);

-/* The default user id as specified in GM/T 0009-2012 */
-#define SM2_DEFAULT_USERID "1234567812345678"
-
 int ossl_sm2_compute_z_digest(uint8_t *out,
     const EVP_MD *digest,
     const uint8_t *id,
diff --git a/deps/openssl/openssl/include/crypto/sm2err.h b/deps/openssl/openssl/include/crypto/sm2err.h
deleted file mode 100644
index 3dc4f7d93a1..00000000000
--- a/deps/openssl/openssl/include/crypto/sm2err.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_SM2ERR_H
-#define OSSL_CRYPTO_SM2ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef OPENSSL_NO_SM2
-
-int ossl_err_load_SM2_strings(void);
-
-/*
- * SM2 reason codes.
- */
-#define SM2_R_ASN1_ERROR 100
-#define SM2_R_BAD_SIGNATURE 101
-#define SM2_R_BUFFER_TOO_SMALL 107
-#define SM2_R_DIST_ID_TOO_LARGE 110
-#define SM2_R_ID_NOT_SET 112
-#define SM2_R_ID_TOO_LARGE 111
-#define SM2_R_INVALID_CURVE 108
-#define SM2_R_INVALID_DIGEST 102
-#define SM2_R_INVALID_DIGEST_TYPE 103
-#define SM2_R_INVALID_ENCODING 104
-#define SM2_R_INVALID_FIELD 105
-#define SM2_R_INVALID_PRIVATE_KEY 113
-#define SM2_R_NO_PARAMETERS_SET 109
-#define SM2_R_USER_ID_TOO_LARGE 106
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/sm4_platform.h b/deps/openssl/openssl/include/crypto/sm4_platform.h
index e6f663ef55d..74b3a701f92 100644
--- a/deps/openssl/openssl/include/crypto/sm4_platform.h
+++ b/deps/openssl/openssl/include/crypto/sm4_platform.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,7 +13,7 @@

 #if defined(OPENSSL_CPUID_OBJ)
 #if defined(__aarch64__) || defined(_M_ARM64)
-#include "arm_arch.h"
+#include "arch/arm_arch.h"
 extern unsigned int OPENSSL_arm_midr;
 static inline int vpsm4_capable(void)
 {
@@ -37,7 +37,7 @@ static inline int vpsm4_ex_capable(void)
 #define HWSM4_ctr32_encrypt_blocks sm4_v8_ctr32_encrypt_blocks
 #elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
 /* RV64 support */
-#include "riscv_arch.h"
+#include "arch/riscv_arch.h"
 /* Zvksed extension (vector crypto SM4). */
 int rv64i_zvksed_sm4_set_encrypt_key(const unsigned char *userKey,
     SM4_KEY *key);
@@ -47,7 +47,24 @@ void rv64i_zvksed_sm4_encrypt(const unsigned char *in, unsigned char *out,
     const SM4_KEY *key);
 void rv64i_zvksed_sm4_decrypt(const unsigned char *in, unsigned char *out,
     const SM4_KEY *key);
-#endif /* RV64 */
+void rv64i_zvksed_sm4_cbc_encrypt(const unsigned char *in, unsigned char *out,
+    size_t len, const SM4_KEY *key,
+    unsigned char *iv, int enc);
+void rv64i_zvksed_sm4_cbc_decrypt(const unsigned char *in, unsigned char *out,
+    size_t len, const SM4_KEY *key,
+    unsigned char *iv, int enc);
+#elif (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
+/* Intel x86_64 support */
+#include "internal/cryptlib.h"
+#define HWSM4_CAPABLE_X86_64 \
+    ((OPENSSL_ia32cap_P[2] & (1 << 5)) && (OPENSSL_ia32cap_P[5] & (1 << 2)))
+int hw_x86_64_sm4_set_key(const unsigned char *userKey, SM4_KEY *key);
+int hw_x86_64_sm4_set_decryption_key(const unsigned char *userKey, SM4_KEY *key);
+void hw_x86_64_sm4_encrypt(const unsigned char *in, unsigned char *out,
+    const SM4_KEY *key);
+void hw_x86_64_sm4_decrypt(const unsigned char *in, unsigned char *out,
+    const SM4_KEY *key);
+#endif
 #endif /* OPENSSL_CPUID_OBJ */

 #if defined(HWSM4_CAPABLE)
diff --git a/deps/openssl/openssl/include/crypto/sparse_array.h b/deps/openssl/openssl/include/crypto/sparse_array.h
index 5ac2e359ee6..e8de36a1f09 100644
--- a/deps/openssl/openssl/include/crypto/sparse_array.h
+++ b/deps/openssl/openssl/include/crypto/sparse_array.h
@@ -22,6 +22,8 @@ extern "C" {

 #define DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, ctype)                                                              \
     SPARSE_ARRAY_OF(type);                                                                                        \
+    typedef void (*sa_##type##_leaffunc)(ossl_uintmax_t idx, type *t);                                            \
+    typedef void (*sa_##type##_leaffunc_arg)(ossl_uintmax_t idx, type *t, void *arg);                             \
     static ossl_unused ossl_inline SPARSE_ARRAY_OF(type) *ossl_sa_##type##_new(void)                              \
     {                                                                                                             \
         return (SPARSE_ARRAY_OF(type) *)ossl_sa_new();                                                            \
@@ -41,20 +43,40 @@ extern "C" {
     {                                                                                                             \
         return ossl_sa_num((OPENSSL_SA *)sa);                                                                     \
     }                                                                                                             \
+    static ossl_unused void                                                                                       \
+    ossl_sa_##type##_doall_thunk(ossl_uintmax_t idx, void *leaf, void *arg)                                       \
+    {                                                                                                             \
+        sa_##type##_leaffunc fn = *(sa_##type##_leaffunc *)arg;                                                   \
+        (*fn)(idx, (type *)leaf);                                                                                 \
+    }                                                                                                             \
     static ossl_unused ossl_inline void                                                                           \
     ossl_sa_##type##_doall(const SPARSE_ARRAY_OF(type) *sa,                                                       \
         void (*leaf)(ossl_uintmax_t, type *))                                                                     \
     {                                                                                                             \
-        ossl_sa_doall((OPENSSL_SA *)sa,                                                                           \
-            (void (*)(ossl_uintmax_t, void *))leaf);                                                              \
+        ossl_sa_doall_arg((OPENSSL_SA *)sa, ossl_sa_##type##_doall_thunk, &leaf);                                 \
+    }                                                                                                             \
+    struct ossl_sa_##type##_doall_thunk {                                                                         \
+        sa_##type##_leaffunc_arg fn;                                                                              \
+        void *arg;                                                                                                \
+    };                                                                                                            \
+    static ossl_unused void                                                                                       \
+    ossl_sa_##type##_doall_arg_thunk(ossl_uintmax_t idx, void *leaf, void *arg)                                   \
+    {                                                                                                             \
+        struct ossl_sa_##type##_doall_thunk *t = arg;                                                             \
+                                                                                                                  \
+        (*t->fn)(idx, (type *)leaf, t->arg);                                                                      \
     }                                                                                                             \
     static ossl_unused ossl_inline void                                                                           \
     ossl_sa_##type##_doall_arg(const SPARSE_ARRAY_OF(type) *sa,                                                   \
         void (*leaf)(ossl_uintmax_t, type *, void *),                                                             \
         void *arg)                                                                                                \
     {                                                                                                             \
+        struct ossl_sa_##type##_doall_thunk t;                                                                    \
+                                                                                                                  \
+        t.fn = leaf;                                                                                              \
+        t.arg = arg;                                                                                              \
         ossl_sa_doall_arg((OPENSSL_SA *)sa,                                                                       \
-            (void (*)(ossl_uintmax_t, void *, void *))leaf, arg);                                                 \
+            ossl_sa_##type##_doall_arg_thunk, &t);                                                                \
     }                                                                                                             \
     static ossl_unused ossl_inline ctype *ossl_sa_##type##_get(const SPARSE_ARRAY_OF(type) *sa, ossl_uintmax_t n) \
     {                                                                                                             \
diff --git a/deps/openssl/openssl/include/crypto/storeerr.h b/deps/openssl/openssl/include/crypto/storeerr.h
deleted file mode 100644
index 33bed4cc24b..00000000000
--- a/deps/openssl/openssl/include/crypto/storeerr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_STOREERR_H
-#define OSSL_CRYPTO_STOREERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_OSSL_STORE_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/tserr.h b/deps/openssl/openssl/include/crypto/tserr.h
deleted file mode 100644
index 31c9da41f3d..00000000000
--- a/deps/openssl/openssl/include/crypto/tserr.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_TSERR_H
-#define OSSL_CRYPTO_TSERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef OPENSSL_NO_TS
-
-int ossl_err_load_TS_strings(void);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/uierr.h b/deps/openssl/openssl/include/crypto/uierr.h
deleted file mode 100644
index dbd14967913..00000000000
--- a/deps/openssl/openssl/include/crypto/uierr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_UIERR_H
-#define OSSL_CRYPTO_UIERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_UI_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/x509.h b/deps/openssl/openssl/include/crypto/x509.h
index f83e807f2be..22b33808935 100644
--- a/deps/openssl/openssl/include/crypto/x509.h
+++ b/deps/openssl/openssl/include/crypto/x509.h
@@ -15,9 +15,12 @@
 #include <openssl/asn1.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
+#include <openssl/x509_vfy.h>
 #include <openssl/conf.h>
 #include "crypto/types.h"

+#include <crypto/asn1.h>
+
 /* Internal X509 structures and functions: not for application use */

 /* Note: unless otherwise stated a field pointer is mandatory and should
@@ -217,11 +220,12 @@ struct x509_store_ctx_st { /* X509_STORE_CTX */
     X509_STORE *store;
     /* The following are set by the caller */
     /* The cert to check */
-    X509 *cert;
+    X509 *cert; /* XXX should really be made const */
     /* chain of X509s - untrusted - passed in */
     STACK_OF(X509) *untrusted;
     /* set of CRLs passed in */
     STACK_OF(X509_CRL) *crls;
+    STACK_OF(OCSP_RESPONSE) *ocsp_resp;
     X509_VERIFY_PARAM *param;
     /* Other info for use with get_issuer() */
     void *other_ctx;
@@ -231,9 +235,9 @@ struct x509_store_ctx_st { /* X509_STORE_CTX */
     /* error callback */
     int (*verify_cb)(int ok, X509_STORE_CTX *ctx);
     /* get issuers cert from ctx */
-    int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
+    X509_STORE_CTX_get_issuer_fn get_issuer;
     /* check issued */
-    int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer);
+    X509_STORE_CTX_check_issued_fn check_issued;
     /* Check revocation status of chain */
     int (*check_revocation)(X509_STORE_CTX *ctx);
     /* retrieve CRL */
@@ -244,7 +248,7 @@ struct x509_store_ctx_st { /* X509_STORE_CTX */
     int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x);
     /* Check policy status of the chain */
     int (*check_policy)(X509_STORE_CTX *ctx);
-    STACK_OF(X509) *(*lookup_certs)(X509_STORE_CTX *ctx,
+    STACK_OF(X509) *(*lookup_certs)(const X509_STORE_CTX *ctx,
         const X509_NAME *nm);
     /* cannot constify 'ctx' param due to lookup_certs_sk() in x509_vfy.c */
     STACK_OF(X509_CRL) *(*lookup_crls)(const X509_STORE_CTX *ctx,
@@ -264,7 +268,7 @@ struct x509_store_ctx_st { /* X509_STORE_CTX */
     /* When something goes wrong, this is why */
     int error_depth;
     int error;
-    X509 *current_cert;
+    X509 *current_cert; /* XXX should really be made const */
     /* cert currently being tested as valid issuer */
     X509 *current_issuer;
     /* current CRL */
@@ -312,11 +316,12 @@ struct x509_object_st {

 int ossl_a2i_ipadd(unsigned char *ipout, const char *ipasc);
 int ossl_x509_set1_time(int *modified, ASN1_TIME **ptm, const ASN1_TIME *tm);
-int ossl_x509_print_ex_brief(BIO *bio, X509 *cert, unsigned long neg_cflags);
-int ossl_x509v3_cache_extensions(X509 *x);
+int ossl_x509_print_ex_brief(BIO *bio, const X509 *cert, unsigned long neg_cflags);
+int ossl_x509v3_cache_extensions(const X509 *x);
+int ossl_x509_init_sig_info(const X509 *x, X509_SIG_INFO *info);
+
 X509_NAME *ossl_dist_point_name_full(const struct DIST_POINT_NAME_st *dpn,
     const X509_NAME *iname);
-int ossl_x509_init_sig_info(X509 *x);

 int ossl_x509_set0_libctx(X509 *x, OSSL_LIB_CTX *libctx, const char *propq);
 int ossl_x509_crl_set0_libctx(X509_CRL *x, OSSL_LIB_CTX *libctx,
@@ -326,11 +331,12 @@ int ossl_x509_req_set0_libctx(X509_REQ *x, OSSL_LIB_CTX *libctx,
 int ossl_asn1_item_digest_ex(const ASN1_ITEM *it, const EVP_MD *type,
     void *data, unsigned char *md, unsigned int *len,
     OSSL_LIB_CTX *libctx, const char *propq);
-int ossl_x509_add_cert_new(STACK_OF(X509) **sk, X509 *cert, int flags);
-int ossl_x509_add_certs_new(STACK_OF(X509) **p_sk, STACK_OF(X509) *certs,
-    int flags);
+int ossl_x509_add_cert_new(STACK_OF(X509) **sk, const X509 *cert, int flags);
+int ossl_x509_add_certs_new(STACK_OF(X509) **p_sk, const STACK_OF(X509) *certs, int flags);

 STACK_OF(X509_ATTRIBUTE) *ossl_x509at_dup(const STACK_OF(X509_ATTRIBUTE) *x);
+STACK_OF(X509_EXTENSION) *
+ossl_x509_req_get1_extensions_by_nid(const X509_REQ *req, int nid);

 int ossl_x509_PUBKEY_get0_libctx(OSSL_LIB_CTX **plibctx, const char **ppropq,
     const X509_PUBKEY *key);
@@ -399,5 +405,16 @@ int ossl_print_attribute_value(BIO *out,

 int ossl_serial_number_print(BIO *out, const ASN1_INTEGER *bs, int indent);
 int ossl_bio_print_hex(BIO *out, unsigned char *buf, int len);
+int ossl_x509_compare_asn1_time(const X509_VERIFY_PARAM *vpm,
+    const ASN1_TIME *time, int *comparison);
+/* No error callback if depth < 0 */
+int ossl_x509_check_cert_time(X509_STORE_CTX *ctx, X509 *x, int depth);
+int ossl_x509_check_crl_time(X509_STORE_CTX *ctx, X509_CRL *crl, int notify);
+int ossl_posix_to_asn1_time(int64_t posix_time, ASN1_TIME **out_time);
+void ossl_x509_verify_param_set_time_posix(X509_VERIFY_PARAM *param, int64_t t);
+int ossl_x509_check_host(const X509 *x, const char *chk, size_t chklen,
+    unsigned int flags, char **peername);
+int ossl_x509_check_ip(const X509 *x, const unsigned char *chk, size_t chklen,
+    unsigned int flags);

 #endif /* OSSL_CRYPTO_X509_H */
diff --git a/deps/openssl/openssl/include/crypto/x509_acert.h b/deps/openssl/openssl/include/crypto/x509_acert.h
index 083133c8e34..0ee38db4cf2 100644
--- a/deps/openssl/openssl/include/crypto/x509_acert.h
+++ b/deps/openssl/openssl/include/crypto/x509_acert.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,6 +13,8 @@

 #include <openssl/x509_acert.h>

+#include <crypto/asn1.h>
+
 #define OSSL_ODI_TYPE_PUBLIC_KEY 0
 #define OSSL_ODI_TYPE_PUBLIC_KEY_CERT 1
 #define OSSL_ODI_TYPE_OTHER 2
diff --git a/deps/openssl/openssl/include/crypto/x509err.h b/deps/openssl/openssl/include/crypto/x509err.h
deleted file mode 100644
index 4d4572861bc..00000000000
--- a/deps/openssl/openssl/include/crypto/x509err.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_X509ERR_H
-#define OSSL_CRYPTO_X509ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_X509_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/crypto/x509v3err.h b/deps/openssl/openssl/include/crypto/x509v3err.h
deleted file mode 100644
index b3874fc4721..00000000000
--- a/deps/openssl/openssl/include/crypto/x509v3err.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_CRYPTO_X509V3ERR_H
-#define OSSL_CRYPTO_X509V3ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_X509V3_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/internal/bio.h b/deps/openssl/openssl/include/internal/bio.h
index 371421139c4..bec4242b261 100644
--- a/deps/openssl/openssl/include/internal/bio.h
+++ b/deps/openssl/openssl/include/internal/bio.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -44,6 +44,16 @@ int bread_conv(BIO *bio, char *data, size_t datal, size_t *read);
 #define BIO_CTRL_CLEAR_KTLS_TX_CTRL_MSG 75
 #define BIO_CTRL_SET_KTLS_TX_ZEROCOPY_SENDFILE 90

+/* Internal BIO flags */
+
+#define BIO_FLAGS_AUTO_EOF 0x80
+
+/*
+ * This is used with memory BIOs:
+ * BIO_FLAGS_MEM_LEGACY_EOF means legacy behaviour of BIO_eof()
+ */
+#define BIO_FLAGS_MEM_LEGACY_EOF 0x1000
+
 /*
  * This is used with socket BIOs:
  * BIO_FLAGS_KTLS_TX means we are using ktls with this BIO for sending.
diff --git a/deps/openssl/openssl/include/internal/bio_tfo.h b/deps/openssl/openssl/include/internal/bio_tfo.h
index bfce90afafe..b9c8e8c677c 100644
--- a/deps/openssl/openssl/include/internal/bio_tfo.h
+++ b/deps/openssl/openssl/include/internal/bio_tfo.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,6 +13,9 @@
  */

 /* If a supported OS is added here, update test/bio_tfo_test.c */
+#if !defined(OSSL_INTERNAL_BIO_TFO_H)
+#define OSSL_INTERNAL_BIO_TFO_H
+
 #if defined(TCP_FASTOPEN) && !defined(OPENSSL_NO_TFO)

 #if defined(OPENSSL_SYS_MACOSX) || defined(__FreeBSD__)
@@ -149,3 +152,5 @@
 #endif

 #endif
+
+#endif /* !defined(OSSL_INTERNAL_BIO_TFO_H) */
diff --git a/deps/openssl/openssl/include/internal/common.h b/deps/openssl/openssl/include/internal/common.h
index 5de7279691a..d81a04333c4 100644
--- a/deps/openssl/openssl/include/internal/common.h
+++ b/deps/openssl/openssl/include/internal/common.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -27,12 +27,15 @@
 #endif

 #if defined(__GNUC__) || defined(__clang__)
+#define ALIGN16 __attribute((aligned(16)))
 #define ALIGN32 __attribute((aligned(32)))
 #define ALIGN64 __attribute((aligned(64)))
 #elif defined(_MSC_VER)
+#define ALIGN16 __declspec(align(16))
 #define ALIGN32 __declspec(align(32))
 #define ALIGN64 __declspec(align(64))
 #else
+#define ALIGN16
 #define ALIGN32
 #define ALIGN64
 #endif
@@ -106,7 +109,6 @@ __owur static ossl_inline int ossl_assert_int(int expr, const char *exprstr,
     l |= (((unsigned long)(*((c)++))) << 16),       \
     l |= (((unsigned long)(*((c)++))) << 24))

-/* NOTE - c is not incremented as per c2l */
 #define c2ln(c, l1, l2, n)                           \
     {                                                \
         c += n;                                      \
@@ -114,18 +116,25 @@ __owur static ossl_inline int ossl_assert_int(int expr, const char *exprstr,
         switch (n) {                                 \
         case 8:                                      \
             l2 = ((unsigned long)(*(--(c)))) << 24;  \
+        /* fall through */                           \
         case 7:                                      \
             l2 |= ((unsigned long)(*(--(c)))) << 16; \
+        /* fall through */                           \
         case 6:                                      \
             l2 |= ((unsigned long)(*(--(c)))) << 8;  \
+        /* fall through */                           \
         case 5:                                      \
             l2 |= ((unsigned long)(*(--(c))));       \
+        /* fall through */                           \
         case 4:                                      \
             l1 = ((unsigned long)(*(--(c)))) << 24;  \
+        /* fall through */                           \
         case 3:                                      \
             l1 |= ((unsigned long)(*(--(c)))) << 16; \
+        /* fall through */                           \
         case 2:                                      \
             l1 |= ((unsigned long)(*(--(c)))) << 8;  \
+        /* fall through */                           \
         case 1:                                      \
             l1 |= ((unsigned long)(*(--(c))));       \
         }                                            \
@@ -150,6 +159,37 @@ __owur static ossl_inline int ossl_assert_int(int expr, const char *exprstr,
     l |= ((uint64_t)(*((c)++))) << 8,                 \
     l |= ((uint64_t)(*((c)++))))

+#define n2ln(c, l1, l2, n)                           \
+    {                                                \
+        c += n;                                      \
+        l1 = l2 = 0;                                 \
+        switch (n) {                                 \
+        case 8:                                      \
+            l2 = ((unsigned long)(*(--(c))));        \
+        /* fall through */                           \
+        case 7:                                      \
+            l2 |= ((unsigned long)(*(--(c)))) << 8;  \
+        /* fall through */                           \
+        case 6:                                      \
+            l2 |= ((unsigned long)(*(--(c)))) << 16; \
+        /* fall through */                           \
+        case 5:                                      \
+            l2 |= ((unsigned long)(*(--(c)))) << 24; \
+        /* fall through */                           \
+        case 4:                                      \
+            l1 = ((unsigned long)(*(--(c))));        \
+        /* fall through */                           \
+        case 3:                                      \
+            l1 |= ((unsigned long)(*(--(c)))) << 8;  \
+        /* fall through */                           \
+        case 2:                                      \
+            l1 |= ((unsigned long)(*(--(c)))) << 16; \
+        /* fall through */                           \
+        case 1:                                      \
+            l1 |= ((unsigned long)(*(--(c)))) << 24; \
+        }                                            \
+    }
+
 #define l2n(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
     *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                \
     *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                 \
@@ -164,25 +204,62 @@ __owur static ossl_inline int ossl_assert_int(int expr, const char *exprstr,
     *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                  \
     *((c)++) = (unsigned char)(((l)) & 0xff))

-/* NOTE - c is not incremented as per l2c */
+/* NOTE - c is not incremented as per l2n */
+#define l2nn(l1, l2, c, n)                                   \
+    {                                                        \
+        c += n;                                              \
+        switch (n) {                                         \
+        case 8:                                              \
+            *(--(c)) = (unsigned char)(((l2)) & 0xff);       \
+        /* fall through */                                   \
+        case 7:                                              \
+            *(--(c)) = (unsigned char)(((l2) >> 8) & 0xff);  \
+        /* fall through */                                   \
+        case 6:                                              \
+            *(--(c)) = (unsigned char)(((l2) >> 16) & 0xff); \
+        /* fall through */                                   \
+        case 5:                                              \
+            *(--(c)) = (unsigned char)(((l2) >> 24) & 0xff); \
+        /* fall through */                                   \
+        case 4:                                              \
+            *(--(c)) = (unsigned char)(((l1)) & 0xff);       \
+        /* fall through */                                   \
+        case 3:                                              \
+            *(--(c)) = (unsigned char)(((l1) >> 8) & 0xff);  \
+        /* fall through */                                   \
+        case 2:                                              \
+            *(--(c)) = (unsigned char)(((l1) >> 16) & 0xff); \
+        /* fall through */                                   \
+        case 1:                                              \
+            *(--(c)) = (unsigned char)(((l1) >> 24) & 0xff); \
+        }                                                    \
+    }
+
 #define l2cn(l1, l2, c, n)                                   \
     {                                                        \
         c += n;                                              \
         switch (n) {                                         \
         case 8:                                              \
             *(--(c)) = (unsigned char)(((l2) >> 24) & 0xff); \
+        /* fall through */                                   \
         case 7:                                              \
             *(--(c)) = (unsigned char)(((l2) >> 16) & 0xff); \
+        /* fall through */                                   \
         case 6:                                              \
             *(--(c)) = (unsigned char)(((l2) >> 8) & 0xff);  \
+        /* fall through */                                   \
         case 5:                                              \
             *(--(c)) = (unsigned char)(((l2)) & 0xff);       \
+        /* fall through */                                   \
         case 4:                                              \
             *(--(c)) = (unsigned char)(((l1) >> 24) & 0xff); \
+        /* fall through */                                   \
         case 3:                                              \
             *(--(c)) = (unsigned char)(((l1) >> 16) & 0xff); \
+        /* fall through */                                   \
         case 2:                                              \
             *(--(c)) = (unsigned char)(((l1) >> 8) & 0xff);  \
+        /* fall through */                                   \
         case 1:                                              \
             *(--(c)) = (unsigned char)(((l1)) & 0xff);       \
         }                                                    \
@@ -200,6 +277,10 @@ __owur static ossl_inline int ossl_assert_int(int expr, const char *exprstr,
                         (c)[2] = (unsigned char)(((l)) & 0xff)),     \
     (c) += 3)

+#define l3n2(c, l) (l = ((uint64_t)(*((c)++))) << 16, \
+    l |= ((uint64_t)(*((c)++))) << 8,                 \
+    l |= ((uint64_t)(*((c)++))))
+
 static ossl_inline int ossl_ends_with_dirsep(const char *path)
 {
     if (*path != '\0')
@@ -245,7 +326,6 @@ static ossl_inline int ossl_is_absolute_path(const char *path)
 }

 const char *ossl_get_openssldir(void);
-const char *ossl_get_enginesdir(void);
 const char *ossl_get_modulesdir(void);
 const char *ossl_get_wininstallcontext(void);

diff --git a/deps/openssl/openssl/include/internal/conf.h b/deps/openssl/openssl/include/internal/conf.h
index e4fb787798a..c917ed9c6bb 100644
--- a/deps/openssl/openssl/include/internal/conf.h
+++ b/deps/openssl/openssl/include/internal/conf.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,9 @@
 #define OSSL_INTERNAL_CONF_H
 #pragma once

+#include "internal/dso.h"
+#include "internal/thread_once.h"
+
 #include <openssl/conf.h>

 #define DEFAULT_CONF_MFLAGS \
@@ -22,8 +25,43 @@ struct ossl_init_settings_st {
     unsigned long flags;
 };

+/*
+ * This structure contains a data about supported modules. entries in this
+ * table correspond to either dynamic or static modules.
+ */
+
+struct conf_module_st {
+    /* DSO of this module or NULL if static */
+    DSO *dso;
+    /* Name of the module */
+    char *name;
+    /* Init function */
+    conf_init_func *init;
+    /* Finish function */
+    conf_finish_func *finish;
+    /* Number of successfully initialized modules */
+    int links;
+    void *usr_data;
+};
+
+/*
+ * This structure contains information about modules that have been
+ * successfully initialized. There may be more than one entry for a given
+ * module.
+ */
+
+struct conf_imodule_st {
+    CONF_MODULE *pmod;
+    OSSL_LIB_CTX *libctx;
+    char *name;
+    char *value;
+    unsigned long flags;
+    void *usr_data;
+};
+
 int ossl_config_int(const OPENSSL_INIT_SETTINGS *);
 void ossl_no_config_int(void);
 void ossl_config_modules_free(void);
+int ossl_conf_parse_bool(const char *value, int *result);

 #endif
diff --git a/deps/openssl/openssl/include/internal/constant_time.h b/deps/openssl/openssl/include/internal/constant_time.h
index 34f2b78329d..168b3e8880f 100644
--- a/deps/openssl/openssl/include/internal/constant_time.h
+++ b/deps/openssl/openssl/include/internal/constant_time.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2014-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -146,7 +146,7 @@ static ossl_inline uint64_t constant_time_lt_64(uint64_t a, uint64_t b)
     return constant_time_msb_64(a ^ ((a ^ b) | ((a - b) ^ b)));
 }

-#ifdef BN_ULONG
+#ifdef BN_BYTES
 static ossl_inline BN_ULONG value_barrier_bn(BN_ULONG a)
 {
 #if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
@@ -477,4 +477,73 @@ static ossl_inline void constant_time_lookup(void *out,
  */
 void err_clear_last_constant_time(int clear);

+/*
+ * Return whether a value that can only be 0 or 1 is non-zero, in constant time
+ * in practice!  The return value is a mask that is all ones if true, and all
+ * zeros otherwise (twos-complement arithmetic assumed for unsigned values).
+ *
+ * Although this is used in constant-time selects, we omit a value barrier
+ * here.  Value barriers impede auto-vectorization (likely because it forces
+ * the value to transit through a general-purpose register). On AArch64, this
+ * is a difference of 2x.
+ *
+ * We usually add value barriers to selects because Clang turns consecutive
+ * selects with the same condition into a branch instead of CMOV/CSEL.
+ * Omitting it seems to be safe so far (David Benjamin, Chromium).  This is
+ * used in the |reduce_once| functions in ML-KEM and ML-DSA in BoringSSL, and
+ * is now also used in OpenSSL.  Any use in new contexts requires careful prior
+ * evaluation and should otherwise be avoided.
+ */
+#if 0
+#define constish_time_true(b) (~constant_time_is_zero(b));
+#else
+#define constish_time_true(b) (0u - (b))
+#endif
+
+/*
+ * Valgrind-based constant-time validation helpers.
+ *
+ * CONSTTIME_SECRET marks a region of memory as secret.  Valgrind's memcheck
+ * tool will then flag any control-flow branch or memory index that depends on
+ * those bytes as an error, because the branch/index would vary with the secret
+ * and could therefore leak it via a timing side-channel.
+ *
+ * CONSTTIME_DECLASSIFY marks a region as no longer secret.  Call this:
+ *   - on values that are derived from, but do not expose, secret data (e.g.
+ *     the rejection decision in ML-DSA, or the public outputs of a KEM), and
+ *   - on all secret regions before returning from a function, so that callers
+ *     do not inherit spurious "uninitialised" state from Valgrind's perspective.
+ *
+ * Both macros are no-ops unless the library is built with
+ * enable-ct-validation (which defines OPENSSL_CONSTANT_TIME_VALIDATION and
+ * requires valgrind headers at build time).
+ */
+#if defined(OPENSSL_CONSTANT_TIME_VALIDATION)
+#include <valgrind/memcheck.h>
+#define CONSTTIME_SECRET(ptr, len) VALGRIND_MAKE_MEM_UNDEFINED((ptr), (len))
+#define CONSTTIME_DECLASSIFY(ptr, len) VALGRIND_MAKE_MEM_DEFINED((ptr), (len))
+#else
+#define CONSTTIME_SECRET(ptr, len)
+#define CONSTTIME_DECLASSIFY(ptr, len)
+#endif
+
+static ossl_inline uint32_t constant_time_declassify_u32(uint32_t v)
+{
+    /*
+     * Return |v| through a value barrier to be safe. Valgrind-based
+     * constant-time validation is partly to check the compiler has not undone
+     * any constant-time work. Any place |OPENSSL_CONSTANT_TIME_VALIDATION|
+     * influences optimizations, this validation is inaccurate.
+     *
+     * However, by sending pointers through valgrind, we likely inhibit escape
+     * analysis. On local variables, particularly booleans, we likely
+     * significantly impact optimizations.
+     *
+     * Thus, to be safe, stick a value barrier, in hopes of comparably
+     * inhibiting compiler analysis.
+     */
+    CONSTTIME_DECLASSIFY(&v, sizeof(v));
+    return value_barrier_32(v);
+}
+
 #endif /* OSSL_INTERNAL_CONSTANT_TIME_H */
diff --git a/deps/openssl/openssl/include/internal/core.h b/deps/openssl/openssl/include/internal/core.h
index ea4b57e18bb..ad49160c546 100644
--- a/deps/openssl/openssl/include/internal/core.h
+++ b/deps/openssl/openssl/include/internal/core.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,9 @@
 #define OSSL_INTERNAL_CORE_H
 #pragma once

+#include <openssl/conf.h>
+#include <openssl/types.h>
+
 /*
  * namespaces:
  *
@@ -41,7 +44,7 @@ typedef struct ossl_method_construct_method_st {
         const char *name, const char *propdef, void *data);
     /* Construct a new method */
     void *(*construct)(const OSSL_ALGORITHM *algodef, OSSL_PROVIDER *prov,
-        void *data);
+        void *data, int no_store);
     /* Destruct a method */
     void (*destruct)(void *method, void *data);
 } OSSL_METHOD_CONSTRUCT_METHOD;
@@ -68,4 +71,7 @@ __owur int ossl_lib_ctx_write_lock(OSSL_LIB_CTX *ctx);
 __owur int ossl_lib_ctx_read_lock(OSSL_LIB_CTX *ctx);
 int ossl_lib_ctx_unlock(OSSL_LIB_CTX *ctx);
 int ossl_lib_ctx_is_child(OSSL_LIB_CTX *ctx);
+int ossl_lib_ctx_attach_ssl_conf_imodule(OSSL_LIB_CTX *ctx, CONF_IMODULE *md);
+int ossl_lib_ctx_detach_ssl_conf_imodule(OSSL_LIB_CTX *ctx, CONF_IMODULE *md);
+
 #endif
diff --git a/deps/openssl/openssl/include/internal/cryptlib.h b/deps/openssl/openssl/include/internal/cryptlib.h
index a4451ca9eee..1a367b3238b 100644
--- a/deps/openssl/openssl/include/internal/cryptlib.h
+++ b/deps/openssl/openssl/include/internal/cryptlib.h
@@ -46,7 +46,6 @@ int openssl_get_fork_id(void);

 char *ossl_safe_getenv(const char *name);

-extern CRYPTO_RWLOCK *memdbg_lock;
 int openssl_strerror_r(int errnum, char *buf, size_t buflen);
 #if !defined(OPENSSL_NO_STDIO)
 FILE *openssl_fopen(const char *filename, const char *mode);
@@ -101,9 +100,9 @@ typedef struct ossl_ex_data_global_st {
 #define OSSL_LIB_CTX_DRBG_INDEX 5
 #define OSSL_LIB_CTX_DRBG_NONCE_INDEX 6
 /* slot 7 unused, was CRNG test data and can be reused */
-#ifdef FIPS_MODULE
-#define OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX 8
-#endif
+/*
+ * slot 8 unused, was OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX
+ */
 #define OSSL_LIB_CTX_FIPS_PROV_INDEX 9
 #define OSSL_LIB_CTX_ENCODER_STORE_INDEX 10
 #define OSSL_LIB_CTX_DECODER_STORE_INDEX 11
@@ -118,10 +117,12 @@ typedef struct ossl_ex_data_global_st {
 #define OSSL_LIB_CTX_DECODER_CACHE_INDEX 20
 #define OSSL_LIB_CTX_COMP_METHODS 21
 #define OSSL_LIB_CTX_INDICATOR_CB_INDEX 22
-#define OSSL_LIB_CTX_MAX_INDEXES 22
+#define OSSL_LIB_CTX_SSL_CONF_IMODULE 23
+#define OSSL_LIB_CTX_MAX_INDEXES 23

 OSSL_LIB_CTX *ossl_lib_ctx_get_concrete(OSSL_LIB_CTX *ctx);
 int ossl_lib_ctx_is_default(OSSL_LIB_CTX *ctx);
+int ossl_lib_ctx_is_default_nocreate(OSSL_LIB_CTX *ctx);
 int ossl_lib_ctx_is_global_default(OSSL_LIB_CTX *ctx);

 /* Functions to retrieve pointers to data by index */
@@ -131,11 +132,7 @@ void ossl_lib_ctx_default_deinit(void);
 OSSL_EX_DATA_GLOBAL *ossl_lib_ctx_get_ex_data_global(OSSL_LIB_CTX *ctx);

 const char *ossl_lib_ctx_get_descriptor(OSSL_LIB_CTX *libctx);
-CRYPTO_THREAD_LOCAL *ossl_lib_ctx_get_rcukey(OSSL_LIB_CTX *libctx);
-
-int ossl_thread_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *));

-OSSL_LIB_CTX *ossl_crypto_ex_data_get_ossl_lib_ctx(const CRYPTO_EX_DATA *ad);
 int ossl_crypto_new_ex_data_ex(OSSL_LIB_CTX *ctx, int class_index, void *obj,
     CRYPTO_EX_DATA *ad);
 int ossl_crypto_get_ex_new_index_ex(OSSL_LIB_CTX *ctx, int class_index,
@@ -154,16 +151,45 @@ int ossl_crypto_free_ex_index_ex(OSSL_LIB_CTX *ctx, int class_index, int idx);

 const void *ossl_bsearch(const void *key, const void *base, int num,
     int size, int (*cmp)(const void *, const void *),
+    int (*cmp_thunk)(int (*real_cmp_fn)(const void *, const void *), const void *, const void *),
     int flags);

+/**
+ * @brief Join a stack of ASN1_UTF8STRINGs into one allocated string.
+ *
+ * Concatenates the elements of text, separated by sep, into a newly allocated
+ * NUL terminated string. The element data is copied in full and may itself
+ * contain embedded NUL bytes, so a caller that treats the result as a C string
+ * will see it truncated at the first such byte.
+ *
+ * @param text the stack of ASN1_UTF8STRINGs to join
+ * @param sep separator placed between elements, or NULL for none
+ * @param max_len maximum length of the result, excluding the NUL terminator,
+ *                or 0 for no restriction
+ * @returns a newly allocated string to be freed with OPENSSL_free(), or NULL on
+ *          error or if the result would exceed max_len
+ */
 char *ossl_sk_ASN1_UTF8STRING2text(STACK_OF(ASN1_UTF8STRING) *text,
     const char *sep, size_t max_len);
-char *ossl_ipaddr_to_asc(unsigned char *p, int len);
+char *ossl_ipaddr_to_asc(const unsigned char *p, int len);

 char *ossl_buf2hexstr_sep(const unsigned char *buf, long buflen, char sep);
 unsigned char *ossl_hexstr2buf_sep(const char *str, long *buflen,
     const char sep);

+/*
+ * Parse a signed long with validation; see OPENSSL_strtoul() for the rules.
+ * Returns 1 on success (and stores the result in |*result|), 0 on failure.
+ */
+int ossl_strtol(const char *str, char **endptr, int base, long *result);
+
+/*
+ * As ossl_strtol() but stores the result in an int, additionally failing if
+ * the parsed value does not fit in an int.
+ * Returns 1 on success (and stores the result in |*result|), 0 on failure.
+ */
+int ossl_strtoint(const char *str, char **endptr, int base, int *result);
+
 /**
  *  Writes |n| value in hex format into |buf|,
  *  and returns the number of bytes written
diff --git a/deps/openssl/openssl/include/internal/dane.h b/deps/openssl/openssl/include/internal/dane.h
index 9c040eedc68..cd3b17a6652 100644
--- a/deps/openssl/openssl/include/internal/dane.h
+++ b/deps/openssl/openssl/include/internal/dane.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,7 @@
 #define OSSL_INTERNAL_DANE_H
 #pragma once

+#include <openssl/evp.h>
 #include <openssl/safestack.h>

 /*-
diff --git a/deps/openssl/openssl/include/internal/dgram_conn_lookup.h b/deps/openssl/openssl/include/internal/dgram_conn_lookup.h
new file mode 100644
index 00000000000..5bd69c08886
--- /dev/null
+++ b/deps/openssl/openssl/include/internal/dgram_conn_lookup.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_INTERNAL_DGRAM_CONN_LOOKUP_H
+#define OSSL_INTERNAL_DGRAM_CONN_LOOKUP_H
+#pragma once
+
+#include <openssl/ssl.h>
+#include "internal/dgram_demux.h"
+
+#ifndef OPENSSL_NO_DTLS
+
+/*
+ * DGRAM_CONN_LOOKUP - Address-based connection lookup for DTLS
+ * =============================================================
+ *
+ * This provides connection lookup by peer address (IP:port) for DTLS.
+ * QUIC uses its own QUIC_LCIDM for CID-based lookup and does not use
+ * this interface.
+ *
+ * The lookup uses the peer address from the DGRAM_URXE to find the
+ * associated connection.
+ */
+
+/* Forward declarations */
+typedef struct dgram_conn_lookup_st DGRAM_CONN_LOOKUP;
+typedef struct dgram_conn_lookup_methods_st DGRAM_CONN_LOOKUP_METHODS;
+
+/* Callback type for iterating over connections */
+typedef void (*ossl_dgram_conn_lookup_iter_fn)(SSL *ssl, const BIO_ADDR *peer,
+    void *arg);
+
+struct dgram_conn_lookup_methods_st {
+    SSL *(*lookup)(DGRAM_CONN_LOOKUP *lookup, const DGRAM_URXE *e);
+    int (*register_conn)(DGRAM_CONN_LOOKUP *lookup, const DGRAM_URXE *e, SSL *ssl);
+    int (*register_conn_addr)(DGRAM_CONN_LOOKUP *lookup, const BIO_ADDR *peer, SSL *ssl);
+    int (*unregister_conn)(DGRAM_CONN_LOOKUP *lookup, const BIO_ADDR *peer);
+    void (*foreach)(DGRAM_CONN_LOOKUP *lookup, ossl_dgram_conn_lookup_iter_fn cb,
+        void *arg);
+    void (*free)(DGRAM_CONN_LOOKUP *lookup);
+    size_t (*num_items)(const DGRAM_CONN_LOOKUP *lookup);
+};
+
+struct dgram_conn_lookup_st {
+    const DGRAM_CONN_LOOKUP_METHODS *methods;
+    void *impl_data;
+};
+
+/* Factory function for address-based lookup (DTLS) */
+DGRAM_CONN_LOOKUP *ossl_dgram_conn_lookup_new_addr(void);
+
+/*
+ * Public API - calls through methods table.
+ */
+SSL *ossl_dgram_conn_lookup_find(DGRAM_CONN_LOOKUP *lookup,
+    const DGRAM_URXE *e);
+int ossl_dgram_conn_lookup_register(DGRAM_CONN_LOOKUP *lookup,
+    const DGRAM_URXE *e, SSL *ssl);
+int ossl_dgram_conn_lookup_register_addr(DGRAM_CONN_LOOKUP *lookup,
+    const BIO_ADDR *peer,
+    SSL *ssl);
+int ossl_dgram_conn_lookup_unregister(DGRAM_CONN_LOOKUP *lookup,
+    const BIO_ADDR *peer);
+void ossl_dgram_conn_lookup_foreach(DGRAM_CONN_LOOKUP *lookup,
+    ossl_dgram_conn_lookup_iter_fn cb,
+    void *arg);
+void ossl_dgram_conn_lookup_free(DGRAM_CONN_LOOKUP *lookup);
+size_t ossl_dgram_conn_lookup_num_items(const DGRAM_CONN_LOOKUP *lookup);
+
+#endif /* OPENSSL_NO_DTLS */
+#endif /* OSSL_INTERNAL_DGRAM_CONN_LOOKUP_H */
diff --git a/deps/openssl/openssl/include/internal/dgram_demux.h b/deps/openssl/openssl/include/internal/dgram_demux.h
new file mode 100644
index 00000000000..f735c6a455e
--- /dev/null
+++ b/deps/openssl/openssl/include/internal/dgram_demux.h
@@ -0,0 +1,284 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_DGRAM_DEMUX_H
+#define OSSL_DGRAM_DEMUX_H
+#pragma once
+
+#include <openssl/ssl.h>
+#include "internal/bio_addr.h"
+#include "internal/time.h"
+#include "internal/list.h"
+
+#if !defined(OPENSSL_NO_QUIC) || !defined(OPENSSL_NO_DTLS)
+
+/*
+ * Generic Datagram Demuxer
+ * ========================
+ *
+ * The datagram demuxer is responsible for receiving datagrams from the network
+ * via a datagram BIO. It maintains a pool of Unprocessed RX Entries (URXEs)
+ * for efficient batch receiving via BIO_recvmmsg().
+ *
+ * The demuxer is protocol-agnostic. It receives datagrams and invokes a
+ * callback for each one. The callback is responsible for routing the datagram
+ * to the appropriate connection (e.g., by DCID for QUIC, or by peer address
+ * for DTLS).
+ */
+
+/* Forward declarations */
+typedef struct dgram_demux_st DGRAM_DEMUX;
+typedef struct dgram_urxe_st DGRAM_URXE;
+
+/*
+ * URXE (Unprocessed RX Entry) structure.
+ *
+ * This structure is exposed so that callers can manage URXEs in their own
+ * queues when needed. The data buffer follows immediately after this structure.
+ *
+ * This structure includes fields used by QUIC (processed, hpr_removed, deferred)
+ * which are unused by DTLS. This allows QUIC_URXE to be a simple typedef to
+ * DGRAM_URXE, enabling QUIC_DEMUX to wrap DGRAM_DEMUX without list type issues.
+ */
+struct dgram_urxe_st {
+    OSSL_LIST_MEMBER(urxe, DGRAM_URXE);
+
+    /*
+     * The URXE data starts after this structure so we don't need a pointer.
+     * data_len stores the current length (i.e., the length of the received
+     * datagram) and alloc_len stores the allocation length. The URXE will be
+     * reallocated if we need a larger allocation than is available, though this
+     * should not be common as we will have a good idea of worst-case MTUs up
+     * front.
+     */
+    size_t data_len, alloc_len;
+
+    /*
+     * Bitfields per packet. processed indicates the packet has been processed
+     * and must not be processed again, hpr_removed indicates header protection
+     * has already been removed. Used by QUIC QRX only; not used by the demuxer
+     * or DTLS.
+     */
+    uint64_t processed, hpr_removed;
+
+    /*
+     * This monotonically increases with each datagram received. It is used for
+     * diagnostic purposes only.
+     */
+    uint64_t datagram_id;
+
+    /*
+     * Address of peer we received the datagram from, and the local interface
+     * address we received it on. If local address support is not enabled, local
+     * is zeroed.
+     */
+    BIO_ADDR peer, local;
+
+    /*
+     * Time at which datagram was received (or ossl_time_zero()) if a now
+     * function was not provided).
+     */
+    OSSL_TIME time;
+
+    /*
+     * Used by the QUIC QRX to mark whether a datagram has been deferred.
+     * Not used by the demuxer or DTLS.
+     */
+    char deferred;
+
+    /*
+     * Used by the DEMUX to track if a URXE has been handed out. Used primarily
+     * for debugging purposes.
+     */
+    char demux_state;
+};
+
+/* Values for demux_state field */
+#define URXE_DEMUX_STATE_FREE 0 /* on urx_free list */
+#define URXE_DEMUX_STATE_PENDING 1 /* on urx_pending list */
+#define URXE_DEMUX_STATE_ISSUED 2 /* on neither list */
+
+/* Maximum number of datagrams received in a single call (one batch). */
+#define DEMUX_MAX_MSGS_PER_CALL 32
+
+/*
+ * Free-list limit used by the DTLS listener: two receive batches, so one
+ * full batch can always be cached. Enforced by
+ * ossl_dgram_demux_release_urxe() once set with
+ * ossl_dgram_demux_set_max_free_urxe(); the default 0 is unbounded.
+ */
+#define DEMUX_MAX_FREE_URXE (2 * DEMUX_MAX_MSGS_PER_CALL)
+
+/* List structure tracking a queue of URXEs. */
+DEFINE_LIST_OF(urxe, DGRAM_URXE);
+typedef OSSL_LIST(urxe) DGRAM_URXE_LIST;
+
+/*
+ * List management helpers. These are used by the demuxer but can also be used
+ * by users of the demuxer to manage URXEs.
+ */
+void ossl_dgram_urxe_remove(DGRAM_URXE_LIST *l, DGRAM_URXE *e);
+void ossl_dgram_urxe_insert_head(DGRAM_URXE_LIST *l, DGRAM_URXE *e);
+void ossl_dgram_urxe_insert_tail(DGRAM_URXE_LIST *l, DGRAM_URXE *e);
+
+/*
+ * Callback function type for datagram routing.
+ *
+ * Called when a datagram is received. e is a URXE containing the datagram
+ * payload. It is permissible for the callee to mutate this buffer; once the
+ * demuxer calls this callback, it will never read the buffer again.
+ *
+ * The callee must arrange for ossl_dgram_demux_release_urxe or
+ * ossl_dgram_demux_reinject_urxe to be called on the URXE at some point in the
+ * future (this need not be before the callback returns).
+ *
+ * At the time the callback is made, the URXE will not be in any queue,
+ * therefore the callee can use the prev and next fields as it wishes.
+ */
+typedef void(ossl_dgram_demux_cb_fn)(DGRAM_URXE *e, void *arg);
+
+/*
+ * Creates a new demuxer. The given BIO is used to receive datagrams from the
+ * network using BIO_recvmmsg.
+ *
+ * threadsafe: If non-zero, enables internal locking for thread safety. Use this
+ *             when the demux may be accessed from multiple threads (DTLS
+ *             where connections share a demux). Pass 0 if thread safety is
+ *             handled at a higher level (QUIC).
+ *
+ * now is an optional function used to determine the time a datagram was
+ * received. now_arg is an opaque argument passed to the function. If now is
+ * NULL, ossl_time_zero() is used as the datagram reception time.
+ */
+DGRAM_DEMUX *ossl_dgram_demux_new(BIO *net_bio,
+    int threadsafe,
+    OSSL_TIME (*now)(void *arg),
+    void *now_arg);
+
+/*
+ * Destroy a demuxer. All URXEs must have been released back to the demuxer
+ * before calling this. No-op if demux is NULL.
+ */
+void ossl_dgram_demux_free(DGRAM_DEMUX *demux);
+
+/*
+ * Changes the BIO which the demuxer reads from. This also sets the MTU if the
+ * BIO supports querying the MTU.
+ */
+void ossl_dgram_demux_set_bio(DGRAM_DEMUX *demux, BIO *net_bio);
+
+/*
+ * Changes the MTU in bytes we use to receive datagrams.
+ * Returns 1 on success, 0 if mtu is below minimum.
+ */
+int ossl_dgram_demux_set_mtu(DGRAM_DEMUX *demux, unsigned int mtu);
+
+/*
+ * Sets the maximum number of URXEs cached on the free list; 0 (the
+ * default) leaves it unbounded.
+ */
+void ossl_dgram_demux_set_max_free_urxe(DGRAM_DEMUX *demux, size_t max_free);
+
+/*
+ * Returns the number of URXEs currently cached on the free list.
+ */
+size_t ossl_dgram_demux_get_free_list_len(DGRAM_DEMUX *demux);
+
+/*
+ * Set the default packet handler. This is called for every incoming datagram.
+ * If a default packet handler is not set, received datagrams are silently
+ * dropped. A default packet handler may be unset by passing NULL.
+ *
+ * The handler is responsible for ensuring that ossl_dgram_demux_reinject_urxe
+ * or ossl_dgram_demux_release_urxe is called on the passed packet at some
+ * point in the future, which may or may not be before the handler returns.
+ */
+void ossl_dgram_demux_set_default_handler(DGRAM_DEMUX *demux,
+    ossl_dgram_demux_cb_fn *cb,
+    void *cb_arg);
+
+/*
+ * Releases a URXE back to the demuxer. No reference must be made to the URXE or
+ * its buffer after calling this function. The URXE must not be in any queue;
+ * that is, its prev and next pointers must be NULL.
+ */
+void ossl_dgram_demux_release_urxe(DGRAM_DEMUX *demux, DGRAM_URXE *e);
+
+/*
+ * Reinjects a URXE back into the pending queue. This is useful when a packet
+ * needs to be reprocessed. Once this has been called, the caller must not
+ * touch the URXE anymore and must not also call ossl_dgram_demux_release_urxe().
+ *
+ * The URXE is reinjected at the head of the queue, so it will be reprocessed
+ * immediately.
+ */
+void ossl_dgram_demux_reinject_urxe(DGRAM_DEMUX *demux, DGRAM_URXE *e);
+
+/*
+ * Process any unprocessed RX'd datagrams, by calling registered callbacks,
+ * reading more datagrams from the BIO if necessary.
+ *
+ * Returns one of the following values:
+ *
+ *     DGRAM_DEMUX_PUMP_RES_OK
+ *         At least one incoming datagram was processed.
+ *
+ *     DGRAM_DEMUX_PUMP_RES_TRANSIENT_FAIL
+ *         No more incoming datagrams are currently available.
+ *         Call again later.
+ *
+ *     DGRAM_DEMUX_PUMP_RES_PERMANENT_FAIL
+ *         Either the network read BIO has failed in a non-transient fashion, or
+ *         an internal state, assertion or allocation error occurred. The caller
+ *         should tear down the connection.
+ */
+#define DGRAM_DEMUX_PUMP_RES_OK 1
+#define DGRAM_DEMUX_PUMP_RES_TRANSIENT_FAIL (-1)
+#define DGRAM_DEMUX_PUMP_RES_PERMANENT_FAIL (-2)
+
+int ossl_dgram_demux_pump(DGRAM_DEMUX *demux);
+
+/*
+ * Artificially inject a packet into the demuxer for testing purposes. The
+ * buffer must not exceed the URXE size being used by the demuxer.
+ *
+ * If peer or local are NULL, their respective fields are zeroed in the injected
+ * URXE.
+ *
+ * Returns 1 on success or 0 on failure.
+ */
+int ossl_dgram_demux_inject(DGRAM_DEMUX *demux,
+    const unsigned char *buf,
+    size_t buf_len,
+    const BIO_ADDR *peer,
+    const BIO_ADDR *local);
+
+/*
+ * Returns 1 if there are any pending URXEs.
+ */
+int ossl_dgram_demux_has_pending(const DGRAM_DEMUX *demux);
+
+/*
+ * Accessor for URXE data buffer. This returns a pointer to the data buffer
+ * that follows the URXE structure.
+ */
+static ossl_unused ossl_inline unsigned char *
+ossl_dgram_urxe_data(const DGRAM_URXE *e)
+{
+    return (unsigned char *)&e[1];
+}
+
+static ossl_unused ossl_inline unsigned char *
+ossl_dgram_urxe_data_end(const DGRAM_URXE *e)
+{
+    return ossl_dgram_urxe_data(e) + e->data_len;
+}
+
+#endif /* !OPENSSL_NO_QUIC || !OPENSSL_NO_DTLS */
+#endif /* OSSL_DGRAM_DEMUX_H */
diff --git a/deps/openssl/openssl/include/internal/dsoerr.h b/deps/openssl/openssl/include/internal/dsoerr.h
deleted file mode 100644
index 3b1de62fccc..00000000000
--- a/deps/openssl/openssl/include/internal/dsoerr.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_INTERNAL_DSOERR_H
-#define OSSL_INTERNAL_DSOERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_DSO_strings(void);
-
-/*
- * DSO reason codes.
- */
-#define DSO_R_CTRL_FAILED 100
-#define DSO_R_DSO_ALREADY_LOADED 110
-#define DSO_R_EMPTY_FILE_STRUCTURE 113
-#define DSO_R_FAILURE 114
-#define DSO_R_FILENAME_TOO_BIG 101
-#define DSO_R_FINISH_FAILED 102
-#define DSO_R_INCORRECT_FILE_SYNTAX 115
-#define DSO_R_LOAD_FAILED 103
-#define DSO_R_NAME_TRANSLATION_FAILED 109
-#define DSO_R_NO_FILENAME 111
-#define DSO_R_NULL_HANDLE 104
-#define DSO_R_SET_FILENAME_FAILED 112
-#define DSO_R_STACK_ERROR 105
-#define DSO_R_SYM_FAILURE 106
-#define DSO_R_UNLOAD_FAILED 107
-#define DSO_R_UNSUPPORTED 108
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/internal/dtls_record_rx.h b/deps/openssl/openssl/include/internal/dtls_record_rx.h
new file mode 100644
index 00000000000..2be3b11a637
--- /dev/null
+++ b/deps/openssl/openssl/include/internal/dtls_record_rx.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_DTLS_RECORD_RX_H
+#define OSSL_DTLS_RECORD_RX_H
+#pragma once
+
+#include "internal/dgram_demux.h"
+#include "internal/thread_arch.h"
+
+#ifndef OPENSSL_NO_DTLS
+
+/*
+ * Maximum datagrams queued per connection in DTLS_RX::urxe_pending: a
+ * count, not a byte cap. On overflow the oldest datagram is evicted
+ * (DTLS permits datagram loss). Each queued URXE holds a buffer of the
+ * listener's maximum datagram size, so 128 entries cost about 295 KB per
+ * connection at the default 2000-byte size - roughly one default kernel
+ * socket receive buffer, the bound that queuing into userspace would
+ * otherwise bypass.
+ */
+#define OSSL_DTLS_RX_DEFAULT_MAX_QUEUED 128
+
+typedef struct dtls_rx_st {
+    DGRAM_DEMUX *demux;
+    DGRAM_URXE_LIST urxe_pending;
+    CRYPTO_MUTEX *mutex;
+} DTLS_RX;
+
+/*
+ * Creates a new DTLS_RX structe. The demuxer is
+ * provided and owned by the DTLS listener.
+ */
+DTLS_RX *ossl_dtls_rx_new(DGRAM_DEMUX *demux);
+
+/*
+ * Frees a DTLS_RX struct. The demuxer is not freed, as it is
+ * owned by the DTLS listener. The list is walked and freed.
+ */
+void ossl_dtls_rx_free(DTLS_RX *rx);
+
+/*
+ * Injects a received URXE into the DTLS_RX struct.
+ */
+void ossl_dtls_rx_inject_urxe(DTLS_RX *rx, DGRAM_URXE *e);
+
+/*
+ * Release the URXE from the DTLS_RX struct.
+ */
+void ossl_dtls_rx_release_urxe(DTLS_RX *rx, DGRAM_URXE *e);
+
+/*
+ * Reads a datagram from the DTLS_RX struct.
+ */
+DGRAM_URXE *ossl_dtls_read_datagram(DTLS_RX *rx);
+
+#endif /* OPENSSL_NO_DTLS */
+#endif /* OSSL_DTLS_RECORD_RX_H */
diff --git a/deps/openssl/openssl/include/internal/e_os.h b/deps/openssl/openssl/include/internal/e_os.h
index d287d910554..4fb1840f618 100644
--- a/deps/openssl/openssl/include/internal/e_os.h
+++ b/deps/openssl/openssl/include/internal/e_os.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -83,31 +83,41 @@
 #endif

 #ifdef WINDOWS
-#if !defined(_WIN32_WCE) && !defined(_WIN32_WINNT)
+#if !defined(_WIN32_WINNT)
 /*
- * Defining _WIN32_WINNT here in e_os.h implies certain "discipline."
- * Most notably we ought to check for availability of each specific
- * routine that was introduced after denoted _WIN32_WINNT with
- * GetProcAddress(). Normally newer functions are masked with higher
- * _WIN32_WINNT in SDK headers. So that if you wish to use them in
- * some module, you'd need to override _WIN32_WINNT definition in
- * the target module in order to "reach for" prototypes, but replace
- * calls to new functions with indirect calls. Alternatively it
- * might be possible to achieve the goal by /DELAYLOAD-ing .DLLs
- * and check for current OS version instead.
+ * The _WIN32_WINNT is described here:
+ * https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170
+ * In a nutshell the macro defines minimal required Windows version where
+ * the resulting application is guaranteed to run on. If left undefined here,
+ * then the definition is provided by the Windows SDK found on host where
+ * application is being built.
+ *
+ * OpenSSL defaults to version 0x501, which matches Windows XP, meaning the
+ * compiled library will use APIs available on Windows XP and later.  User may
+ * override the version specified here at build time using command as
+ * follows:
+ *     perl ./Configure "-D_WIN32_WINNT=0x...." ...
+ *
+ * The list of recognized constants (as found in the link above) is as follows:
+ * 	0x0400 // Windows NT 4.0
+ *	0x0500 // Windows 2000
+ *	0x0501 // Windows XP
+ *	0x0502 // Windows Server 2003
+ *	0x0600 // Windows Vista, Windows Server 2008, Windows Vista
+ *	0x0601 // Windows 7
+ *	0x0602 // Windows 8
+ *	0x0603 // Windows 8.1
+ *	0x0A00 // Windows 10
  */
-#define _WIN32_WINNT 0x0501
+#define _WIN32_WINNT 0x0600
 #endif
 #include <windows.h>
 #include <stdio.h>
 #include <stddef.h>
 #include <errno.h>
-#if defined(_WIN32_WCE) && !defined(EACCES)
-#define EACCES 13
-#endif
 #include <string.h>
 #include <malloc.h>
-#if defined(_MSC_VER) && !defined(_WIN32_WCE) && !defined(_DLL) && defined(stdin)
+#if defined(_MSC_VER) && !defined(_DLL) && defined(stdin)
 #if _MSC_VER >= 1300 && _MSC_VER < 1600
 #undef stdin
 #undef stdout
@@ -123,10 +133,6 @@ FILE *__iob_func(void);
 #include <io.h>
 #include <fcntl.h>

-#ifdef OPENSSL_SYS_WINCE
-#define OPENSSL_NO_POSIX_IO
-#endif
-
 #define EXIT(n) exit(n)
 #define LIST_SEPARATOR_CHAR ';'
 #ifndef W_OK
@@ -135,11 +141,7 @@ FILE *__iob_func(void);
 #ifndef R_OK
 #define R_OK 4
 #endif
-#ifdef OPENSSL_SYS_WINCE
-#define DEFAULT_HOME ""
-#else
 #define DEFAULT_HOME "C:"
-#endif

 /* Avoid Visual Studio 13 GetVersion deprecated problems */
 #if defined(_MSC_VER) && _MSC_VER >= 1800
@@ -150,6 +152,20 @@ FILE *__iob_func(void);
 #define check_win_minplat(x) (LOBYTE(LOWORD(GetVersion())) >= (x))
 #endif

+/*
+ * MSVC versions earlier than Visual Studio 2015 (_MSC_VER < 1900) do not
+ * declare or define C99 snprintf or vsnprintf.  Definitions are supplied
+ * by crypto/msvc2013_snprintf.c, which is built only on the matching
+ * Configure target variants.
+ */
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#include <stdarg.h>
+int msvc_translate_printf_format(const char *format, const char **out,
+    char **tmp);
+int snprintf(char *buf, size_t n, const char *fmt, ...);
+int vsnprintf(char *buf, size_t n, const char *fmt, va_list args);
+#endif
+
 #else /* The non-microsoft world */

 #if defined(OPENSSL_SYS_VXWORKS)
@@ -219,7 +235,7 @@ FILE *__iob_func(void);
 /***********************************************/

 #if defined(OPENSSL_SYS_WINDOWS)
-#if defined(_MSC_VER) && (_MSC_VER >= 1310) && !defined(_WIN32_WCE)
+#if defined(_MSC_VER) && (_MSC_VER >= 1310)
 #define open _open
 #define fdopen _fdopen
 #define close _close
@@ -243,7 +259,7 @@ FILE *__iob_func(void);
 #include <sockLib.h>
 #include <taskLib.h>

-#define TTY_STRUCT int
+typedef int TTY_STRUCT;
 #define sleep(a) taskDelay((a) * sysClkRateGet())

 /*
@@ -339,7 +355,7 @@ inline int nssgetpid(void)
  * There is no locale_t on NONSTOP.
  */
 #if defined(OPENSSL_SYS_WINDOWS)
-#define locale_t _locale_t
+typedef _locale_t locale_t;
 #define freelocale _free_locale
 #define strcasecmp_l _stricmp_l
 #define strncasecmp_l _strnicmp_l
@@ -353,3 +369,48 @@ inline int nssgetpid(void)
 #endif

 #endif
+
+/*
+ * Can we use a global destructor?  We can use a global destructor via
+ * __attribute__ on anything like a modern gcc/clang.  We can also use
+ * it via dllmain on anything win32/win64.
+ *
+ * Older things may not do this.
+ * The assumption here is then if you don't have destructor support,
+ * it is safe to call OPENSSL_cleanup before an application exits
+ * because no library it is linked with will run code in a destructor
+ * that will call into OpenSSL after exit() happens.
+ *
+ */
+#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64)
+#define OSSL_CLEANUP_USING_DESTRUCTOR
+#define OSSL_DLLMAIN_DESTRUCTOR
+/*
+ * destructor will be installed in libcrypto's dllmain.c
+ * This means effectively anything not win16 or dos will handle
+ * this.
+ */
+void ossl_cleanup_destructor(void);
+#else
+#if defined(__has_attribute)
+#if __has_attribute(destructor)
+/*
+ * This seems to have been a thing with any gcc or clang since the
+ * early 2000's. So this could pretty much instead be just unconditional
+ * on __GNUC__ or __clang__.
+ */
+#define OSSL_CLEANUP_USING_DESTRUCTOR
+/* destructor is installed by compiler */
+void ossl_cleanup_destructor(void) __attribute__((destructor));
+#else
+/* We are not using a destructor */
+/*
+ * So we are on something that is not close to Windows or being
+ * compiled with a modern GCC/Clang derivative. either way
+ * this probably means something like a toolchain that is
+ * more than 20 years old.
+ */
+void ossl_cleanup_destructor(void);
+#endif /* defined (__has_attribute(destructor) */
+#endif /* defined (__has_attribute) */
+#endif /* defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) */
diff --git a/deps/openssl/openssl/include/internal/e_winsock.h b/deps/openssl/openssl/include/internal/e_winsock.h
index c2a08ebed1a..1ea73833481 100644
--- a/deps/openssl/openssl/include/internal/e_winsock.h
+++ b/deps/openssl/openssl/include/internal/e_winsock.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,22 +12,35 @@
 #pragma once

 #ifdef WINDOWS
-#if !defined(_WIN32_WCE) && !defined(_WIN32_WINNT)
+#if !defined(_WIN32_WINNT)
 /*
- * Defining _WIN32_WINNT here in e_winsock.h implies certain "discipline."
- * Most notably we ought to check for availability of each specific
- * routine that was introduced after denoted _WIN32_WINNT with
- * GetProcAddress(). Normally newer functions are masked with higher
- * _WIN32_WINNT in SDK headers. So that if you wish to use them in
- * some module, you'd need to override _WIN32_WINNT definition in
- * the target module in order to "reach for" prototypes, but replace
- * calls to new functions with indirect calls. Alternatively it
- * might be possible to achieve the goal by /DELAYLOAD-ing .DLLs
- * and check for current OS version instead.
+ * The _WIN32_WINNT is described here:
+ * https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170
+ * In a nutshell the macro defines minimal required Windows version where
+ * the resulting application is guaranteed to run on. If left undefined here,
+ * then the definition is provided by the Windows SDK found on host where
+ * application is being built.
+ *
+ * OpenSSL defaults to version 0x501, which matches Windows XP, meaning the
+ * compiled library will use APIs available on Windows XP and later.  User may
+ * override the version specified here at build time using command as
+ * follows:
+ *     perl ./Configure "-D_WIN32_WINNT=0x...." ...
+ *
+ * The list of recognized constants (as found in the link above) is as follows:
+ * 	0x0400 // Windows NT 4.0
+ *	0x0500 // Windows 2000
+ *	0x0501 // Windows XP
+ *	0x0502 // Windows Server 2003
+ *	0x0600 // Windows Vista, Windows Server 2008, Windows Vista
+ *	0x0601 // Windows 7
+ *	0x0602 // Windows 8
+ *	0x0603 // Windows 8.1
+ *	0x0A00 // Windows 10
  */
 #define _WIN32_WINNT 0x0501
 #endif
-#if defined(_WIN32_WINNT) || defined(_WIN32_WCE)
+#if defined(_WIN32_WINNT)
 /*
  * Just like defining _WIN32_WINNT including winsock2.h implies
  * certain "discipline" for maintaining [broad] binary compatibility.
diff --git a/deps/openssl/openssl/include/internal/ech_helpers.h b/deps/openssl/openssl/include/internal/ech_helpers.h
new file mode 100644
index 00000000000..20dc876d56f
--- /dev/null
+++ b/deps/openssl/openssl/include/internal/ech_helpers.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * These functions are ECH helpers that are used within the library but
+ * also by ECH test code.
+ */
+
+#ifndef OPENSSL_ECH_HELPERS_H
+#define OPENSSL_ECH_HELPERS_H
+#pragma once
+
+#include <stddef.h>
+#include <stdint.h>
+
+#ifndef OPENSSL_NO_ECH
+
+/*
+ * the max HPKE 'info' we'll process is the max ECHConfig size
+ * (OSSL_ECH_MAX_ECHCONFIG_LEN) plus OSSL_ECH_CONTEXT_STRING(len=7) + 1
+ */
+#define OSSL_ECH_MAX_INFO_LEN (OSSL_ECH_MAX_ECHCONFIG_LEN + 8)
+
+int ossl_ech_make_enc_info(const unsigned char *encoding,
+    size_t encoding_length,
+    unsigned char *info, size_t *info_len);
+
+/*
+ * Given a CH find the offsets of the session id, extensions and ECH
+ * ch is the encoded client hello
+ * ch_len is the length of ch
+ * sessid_off returns offset of session_id length
+ * exts_off points to offset of extensions
+ * exts_len returns length of extensions
+ * ech_off returns offset of ECH
+ * echtype returns the ext type of the ECH
+ * ech_len returns the length of the ECH
+ * sni_off returns offset of (outer) SNI
+ * sni_len returns the length of the SNI
+ * inner 1 if the ECH is marked as an inner, 0 for outer
+ * return 1 for success, other otherwise
+ *
+ * Offsets are set to zero if relevant thing not found.
+ * Offsets are returned to the type or length field in question.
+ *
+ * Note: input here is untrusted!
+ */
+int ossl_ech_helper_get_ch_offsets(const unsigned char *ch, size_t ch_len,
+    size_t *sessid_off, size_t *exts_off,
+    size_t *exts_len,
+    size_t *ech_off, uint16_t *echtype,
+    size_t *ech_len, size_t *sni_off,
+    size_t *sni_len, int *inner);
+
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/internal/endian.h b/deps/openssl/openssl/include/internal/endian.h
index 51c10873cd3..4292fa917f6 100644
--- a/deps/openssl/openssl/include/internal/endian.h
+++ b/deps/openssl/openssl/include/internal/endian.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -18,7 +18,7 @@
  *
  * L_ENDIAN and B_ENDIAN can be used at preprocessor time. They can be set
  * in the configarion using the lib_cppflags variable. If neither is
- * set, it will fall back to code works with either endianness.
+ * set, it will fall back to code that works with either endianness.
  */

 #if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__)
diff --git a/deps/openssl/openssl/include/internal/err.h b/deps/openssl/openssl/include/internal/err.h
index 41b28ac4731..51a8d876938 100644
--- a/deps/openssl/openssl/include/internal/err.h
+++ b/deps/openssl/openssl/include/internal/err.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,8 @@
 #define OSSL_INTERNAL_ERR_H
 #pragma once

+#define ERR_NUM_ERRORS 16
+
 void err_free_strings_int(void);

 #endif
diff --git a/deps/openssl/openssl/include/internal/ffc.h b/deps/openssl/openssl/include/internal/ffc.h
index fd56b07e94b..cc9c4580a25 100644
--- a/deps/openssl/openssl/include/internal/ffc.h
+++ b/deps/openssl/openssl/include/internal/ffc.h
@@ -122,6 +122,23 @@ typedef struct ffc_params_st {
     int keylength;
 } FFC_PARAMS;

+typedef struct {
+    OSSL_PARAM *p; /* OSSL_PKEY_PARAM_FFC_P */
+    OSSL_PARAM *q; /* OSSL_PKEY_PARAM_FFC_Q */
+    OSSL_PARAM *g; /* OSSL_PKEY_PARAM_FFC_G */
+    OSSL_PARAM *cofactor; /* OSSL_PKEY_PARAM_FFC_COFACTOR */
+    OSSL_PARAM *g_index; /* OSSL_PKEY_PARAM_FFC_GINDEX */
+    OSSL_PARAM *p_counter; /* OSSL_PKEY_PARAM_FFC_PCOUNTER */
+    OSSL_PARAM *h; /* OSSL_PKEY_PARAM_FFC_H */
+    OSSL_PARAM *seed; /* OSSL_PKEY_PARAM_FFC_SEED */
+    OSSL_PARAM *group_name; /* OSSL_PKEY_PARAM_GROUP_NAME */
+    OSSL_PARAM *validate_pq; /* OSSL_PKEY_PARAM_FFC_VALIDATE_PQ */
+    OSSL_PARAM *validate_g; /* OSSL_PKEY_PARAM_FFC_VALIDATE_G */
+    OSSL_PARAM *validate_legacy; /* OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY */
+    OSSL_PARAM *digest; /* OSSL_PKEY_PARAM_FFC_DIGEST */
+    OSSL_PARAM *propq; /* OSSL_PKEY_PARAM_FFC_DIGEST_PROPS */
+} FFC_OSSL_PARAMS;
+
 void ossl_ffc_params_init(FFC_PARAMS *params);
 void ossl_ffc_params_cleanup(FFC_PARAMS *params);
 void ossl_ffc_params_set0_pqg(FFC_PARAMS *params, BIGNUM *p, BIGNUM *q,
@@ -198,7 +215,7 @@ int ossl_ffc_validate_private_key(const BIGNUM *upper, const BIGNUM *priv_key,
     int *ret);

 int ossl_ffc_params_todata(const FFC_PARAMS *ffc, OSSL_PARAM_BLD *tmpl,
-    OSSL_PARAM params[]);
+    const FFC_OSSL_PARAMS *pp);
 int ossl_ffc_params_fromdata(FFC_PARAMS *ffc, const OSSL_PARAM params[]);

 typedef struct dh_named_group_st DH_NAMED_GROUP;
diff --git a/deps/openssl/openssl/include/internal/fips.h b/deps/openssl/openssl/include/internal/fips.h
index 2e02ff77b7b..47d12130072 100644
--- a/deps/openssl/openssl/include/internal/fips.h
+++ b/deps/openssl/openssl/include/internal/fips.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,11 +11,133 @@
 #define OSSL_INTERNAL_FIPS_H
 #pragma once

+#include <openssl/types.h>
+
 #ifdef FIPS_MODULE

 /* Return 1 if the FIPS self tests are running and 0 otherwise */
 int ossl_fips_self_testing(void);

+/*
+ * Each enum here corresponds to a test in the st_all_tests array
+ * in self_test_data.c, any change done here requires tests to be
+ * adjusted accordingly.
+ */
+typedef enum {
+    ST_ID_DRBG_HASH,
+    ST_ID_DRBG_CTR,
+    ST_ID_DRBG_HMAC,
+    ST_ID_CIPHER_AES_256_GCM,
+    ST_ID_CIPHER_AES_128_ECB,
+#ifndef OPENSSL_NO_DES
+    ST_ID_CIPHER_DES_EDE3_ECB,
+#endif
+#ifndef OPENSSL_NO_ML_KEM
+    ST_ID_ASYM_KEYGEN_ML_KEM,
+#endif
+#ifndef OPENSSL_NO_ML_DSA
+    ST_ID_ASYM_KEYGEN_ML_DSA,
+#endif
+#ifndef OPENSSL_NO_SLH_DSA
+    ST_ID_ASYM_KEYGEN_SLH_DSA,
+#endif
+    ST_ID_SIG_RSA_SHA256,
+#ifndef OPENSSL_NO_EC
+    ST_ID_SIG_ECDSA_SHA256,
+#ifndef OPENSSL_NO_HMAC_DRBG_KDF
+    ST_ID_SIG_DET_ECDSA_SHA256,
+#endif
+#ifndef OPENSSL_NO_EC2M
+    ST_ID_SIG_E2CM_ECDSA_SHA256,
+#endif
+#ifndef OPENSSL_NO_ECX
+    ST_ID_SIG_ED448,
+    ST_ID_SIG_ED25519,
+#endif
+#endif
+#ifndef OPENSSL_NO_DSA
+    ST_ID_SIG_DSA_SHA256,
+#endif
+#ifndef OPENSSL_NO_ML_DSA
+    ST_ID_SIG_ML_DSA_65,
+#endif
+#ifndef OPENSSL_NO_SLH_DSA
+    ST_ID_SIG_SLH_DSA_SHA2_128F,
+    ST_ID_SIG_SLH_DSA_SHAKE_128F,
+#endif /* OPENSSL_NO_SLH_DSA */
+#ifndef OPENSSL_NO_LMS
+    ST_ID_SIG_LMS,
+#endif
+#ifndef OPENSSL_NO_ML_KEM
+    ST_ID_KEM_ML_KEM,
+#endif
+    ST_ID_ASYM_CIPHER_RSA_ENC,
+    ST_ID_ASYM_CIPHER_RSA_DEC,
+    ST_ID_ASYM_CIPHER_RSA_DEC_CRT,
+#ifndef OPENSSL_NO_DH
+    ST_ID_KA_DH,
+#endif
+#ifndef OPENSSL_NO_EC
+    ST_ID_KA_ECDH,
+#endif
+    ST_ID_KDF_TLS13_EXTRACT,
+    ST_ID_KDF_TLS13_EXPAND,
+    ST_ID_KDF_TLS12_PRF,
+    ST_ID_KDF_PBKDF2,
+#ifndef OPENSSL_NO_KBKDF
+    ST_ID_KDF_KBKDF,
+    ST_ID_KDF_KBKDF_KMAC,
+#endif
+    ST_ID_KDF_HKDF,
+#ifndef OPENSSL_NO_IKEV2KDF
+    ST_ID_KDF_IKEV2KDF_GEN,
+    ST_ID_KDF_IKEV2KDF_DKM1,
+    ST_ID_KDF_IKEV2KDF_DKM2,
+    ST_ID_KDF_IKEV2KDF_DKM3,
+    ST_ID_KDF_IKEV2KDF_REKEY,
+#endif
+#ifndef OPENSSL_NO_SNMPKDF
+    ST_ID_KDF_SNMPKDF,
+#endif
+#ifndef OPENSSL_NO_SRTPKDF
+    ST_ID_KDF_SRTPKDF,
+#endif
+#ifndef OPENSSL_NO_SSKDF
+    ST_ID_KDF_SSKDF,
+#endif
+#ifndef OPENSSL_NO_X963KDF
+    ST_ID_KDF_X963KDF,
+#endif
+#ifndef OPENSSL_NO_X942KDF
+    ST_ID_KDF_X942KDF,
+#endif
+    ST_ID_MAC_HMAC,
+    ST_ID_DIGEST_SHA1,
+    ST_ID_DIGEST_SHA256,
+    ST_ID_DIGEST_SHA512,
+    ST_ID_DIGEST_SHA3_256,
+    ST_ID_MAX
+} self_test_id_t;
+
+int ossl_deferred_self_test(OSSL_LIB_CTX *libctx, self_test_id_t id);
+int ossl_self_test_in_progress(self_test_id_t id);
+
+/* Helper definitions to keep some of the ciphercommon.h macros simple */
+#define ST_ID_CIPHER_aes ST_ID_CIPHER_AES_128_ECB
+#define ST_ID_CIPHER_AES_128_CCM ST_ID_CIPHER_AES_128_ECB
+#define ST_ID_CIPHER_AES_128_OCB ST_ID_CIPHER_AES_128_ECB
+#define ST_ID_CIPHER_AES_128_WRP ST_ID_CIPHER_AES_128_ECB
+#define ST_ID_CIPHER_AES_128_XTS ST_ID_CIPHER_AES_128_ECB
+/* Helper definitions to keep some of the digestcommon.h macros simple */
+#define ST_ID_DIGEST_sha1 ST_ID_DIGEST_SHA1
+#define ST_ID_DIGEST_sha224 ST_ID_DIGEST_SHA256
+#define ST_ID_DIGEST_sha256 ST_ID_DIGEST_SHA256
+#define ST_ID_DIGEST_sha256_192_internal ST_ID_DIGEST_SHA256
+#define ST_ID_DIGEST_sha384 ST_ID_DIGEST_SHA512
+#define ST_ID_DIGEST_sha512 ST_ID_DIGEST_SHA512
+#define ST_ID_DIGEST_sha512_224 ST_ID_DIGEST_SHA512
+#define ST_ID_DIGEST_sha512_256 ST_ID_DIGEST_SHA512
+
 #endif /* FIPS_MODULE */

 #endif
diff --git a/deps/openssl/openssl/include/internal/hashtable.h b/deps/openssl/openssl/include/internal/hashtable.h
index 8bfa5392361..9aad6530974 100644
--- a/deps/openssl/openssl/include/internal/hashtable.h
+++ b/deps/openssl/openssl/include/internal/hashtable.h
@@ -13,6 +13,7 @@

 #include <stddef.h>
 #include <stdint.h>
+#include <string.h>
 #include <openssl/e_os2.h>
 #include <internal/rcu.h>
 #include "crypto/context.h"
@@ -23,7 +24,9 @@ typedef struct ht_internal_st HT;
  * Represents a key to a hashtable
  */
 typedef struct ht_key_header_st {
+    uint64_t cached_hash;
     size_t keysize;
+    size_t bufsize;
     uint8_t *keybuf;
 } HT_KEY;

@@ -50,10 +53,11 @@ typedef struct ht_value_list_st {
 typedef struct ht_config_st {
     OSSL_LIB_CTX *ctx;
     void (*ht_free_fn)(HT_VALUE *obj);
-    uint64_t (*ht_hash_fn)(uint8_t *key, size_t keylen);
+    uint64_t (*ht_hash_fn)(HT_KEY *key);
     size_t init_neighborhoods;
     uint32_t collision_check;
     uint32_t lockless_reads;
+    uint32_t no_rcu;
 } HT_CONFIG;

 /*
@@ -106,17 +110,90 @@ typedef struct ht_config_st {
 /*
  * Initializes a key
  */
-#define HT_INIT_KEY(key)                                                \
-    do {                                                                \
-        memset((key), 0, sizeof(*(key)));                               \
-        (key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY));  \
-        (key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
+#define HT_INIT_KEY(key)                                                                           \
+    do {                                                                                           \
+        memset((key), 0, sizeof(*(key)));                                                          \
+        (key)->key_header.keysize = (key)->key_header.bufsize = (sizeof(*(key)) - sizeof(HT_KEY)); \
+        (key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY));                            \
+    } while (0)
+
+/*
+ * Initializes a key as a raw buffer
+ * This operates identically to HT_INIT_KEY
+ * but it treats the provided key as a raw buffer
+ * and iteratively accounts the running amount of
+ * data copied into the key from the caller.
+ *
+ * This MUST be used with the RAW macros below:
+ * HT_COPY_RAW_KEY
+ * HT_COPY_RAW_KEY_CASE
+ */
+#define HT_INIT_RAW_KEY(key)           \
+    do {                               \
+        HT_INIT_KEY((key));            \
+        (key)->key_header.keysize = 0; \
+    } while (0)
+
+/*
+ * Helper function to copy raw data into a key
+ * This should not be called independently
+ * use the HT_COPY_RAW_KEY macro instead
+ */
+static ossl_inline ossl_unused int ossl_key_raw_copy(HT_KEY *key, const uint8_t *buf, size_t len)
+{
+    if (key->keysize + len > key->bufsize)
+        return 0;
+    memcpy(&key->keybuf[key->keysize], buf, len);
+    key->keysize += len;
+    return 1;
+}
+
+/*
+ * Copy data directly into a key
+ * When initialized with HT_INIT_RAW_KEY, this macro
+ * can be used to copy packed data into a key for hashtable usage
+ * It is advantageous as it limits the amount of data that needs to
+ * be hashed when doing inserts/lookups/deletes, as it tracks how much
+ * key data is actually valid
+ */
+#define HT_COPY_RAW_KEY(key, buf, len) ossl_key_raw_copy(key, buf, len)
+
+/*
+ * Similar to HT_COPY_RAW_KEY but accepts a character buffer, and copies
+ * data while converting case for case insensitive matches
+ */
+#define HT_COPY_RAW_KEY_CASE(key, buf, len)                                            \
+    do {                                                                               \
+        size_t tmplen = (size_t)(len);                                                 \
+        if (tmplen > (key)->bufsize - (key)->keysize)                                  \
+            tmplen = (key)->bufsize - (key)->keysize;                                  \
+        ossl_ht_strcase((key), (char *)&((key)->keybuf[(key)->keysize]), buf, tmplen); \
+        (key)->keysize += tmplen;                                                      \
+    } while (0)
+
+#define HT_INIT_KEY_CACHED(key, hash)         \
+    do {                                      \
+        HT_INIT_KEY((key));                   \
+        (key)->key_header.cached_hash = hash; \
     } while (0)

+#define HT_INIT_KEY_EXTERNAL(key, buf, len) \
+    do {                                    \
+        HT_INIT_KEY((key));                 \
+        (key)->key_header.keybuf = (buf);   \
+        (key)->key_header.keysize = (len);  \
+    } while (0)
+
+#define HT_KEY_GET_HASH(key) (key)->key_header.cached_hash
+
 /*
  * Resets a hash table key to a known state
  */
-#define HT_KEY_RESET(key) memset((key)->key_header.keybuf, 0, (key)->key_header.keysize)
+#define HT_KEY_RESET(key)                                               \
+    do {                                                                \
+        memset((key)->key_header.keybuf, 0, (key)->key_header.keysize); \
+        (key)->key_header.cached_hash = 0;                              \
+    } while (0)

 /*
  * Sets a scalar field in a hash table key
@@ -139,9 +216,9 @@ typedef struct ht_config_st {
  * This is useful for instances in which we want upper and lower case
  * key value to hash to the same entry
  */
-#define HT_SET_KEY_STRING_CASE(key, member, value)                                            \
-    do {                                                                                      \
-        ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) - 1); \
+#define HT_SET_KEY_STRING_CASE(key, member, value)                                                  \
+    do {                                                                                            \
+        ossl_ht_strcase(NULL, (key)->keyfields.member, value, sizeof((key)->keyfields.member) - 1); \
     } while (0)

 /*
@@ -158,12 +235,12 @@ typedef struct ht_config_st {
     } while (0)

 /* Same as HT_SET_KEY_STRING_CASE but also takes length of the string. */
-#define HT_SET_KEY_STRING_CASE_N(key, member, value, len)                                         \
-    do {                                                                                          \
-        if (len < sizeof((key)->keyfields.member))                                                \
-            ossl_ht_strcase((key)->keyfields.member, value, len);                                 \
-        else                                                                                      \
-            ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) - 1); \
+#define HT_SET_KEY_STRING_CASE_N(key, member, value, len)                                               \
+    do {                                                                                                \
+        if ((size_t)len < sizeof((key)->keyfields.member))                                              \
+            ossl_ht_strcase(NULL, (key)->keyfields.member, value, len);                                 \
+        else                                                                                            \
+            ossl_ht_strcase(NULL, (key)->keyfields.member, value, sizeof((key)->keyfields.member) - 1); \
     } while (0)

 /*
@@ -208,7 +285,7 @@ typedef struct ht_config_st {
         inval.type_id = &name##_##vtype##_id;                                  \
         rc = ossl_ht_insert(h, key, &inval, olddata == NULL ? NULL : &oval);   \
         if (oval != NULL)                                                      \
-            *olddata = (vtype *)oval->value;                                   \
+            *olddata = (vtype *)ossl_ht_inner_value(h, oval);                  \
         return rc;                                                             \
     }                                                                          \
                                                                                \
@@ -230,7 +307,7 @@ typedef struct ht_config_st {
         vv = ossl_ht_get(h, key);                                              \
         if (vv == NULL)                                                        \
             return NULL;                                                       \
-        *v = ossl_rcu_deref(&vv);                                              \
+        *v = ossl_ht_deref_value(h, &vv);                                      \
         return ossl_ht_##name##_##vtype##_from_value(*v);                      \
     }                                                                          \
                                                                                \
@@ -260,9 +337,9 @@ typedef struct ht_config_st {
 /*
  * Helper function to construct case insensitive keys
  */
-static void ossl_unused ossl_ht_strcase(char *tgt, const char *src, int len)
+static ossl_inline ossl_unused void ossl_ht_strcase(HT_KEY *key, char *tgt, const char *src, size_t len)
 {
-    int i;
+    size_t i;
 #if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)
     const long int case_adjust = ~0x40;
 #else
@@ -272,6 +349,14 @@ static void ossl_unused ossl_ht_strcase(char *tgt, const char *src, int len)
     if (src == NULL)
         return;

+    /*
+     * If we're passed a key, we're doing raw key copies
+     * so check that we don't overflow here, and truncate if
+     * we copy more space than we have available
+     */
+    if (key != NULL && key->keysize + len > key->bufsize)
+        len = (size_t)(key->bufsize - key->keysize);
+
     for (i = 0; i < len && src[i] != '\0'; i++)
         tgt[i] = case_adjust & src[i];
 }
@@ -289,7 +374,7 @@ void ossl_ht_free(HT *htable);
 /*
  * Lock the table for reading
  */
-void ossl_ht_read_lock(HT *htable);
+int ossl_ht_read_lock(HT *htable);

 /*
  * Lock the table for writing
@@ -314,7 +399,9 @@ int ossl_ht_flush(HT *htable);
 /*
  * Inserts an element to a hash table, optionally returning
  * replaced data to caller
- * Returns 1 if the insert was successful, 0 on error
+ * Returns 1 if the insert was successful, 0 on duplicate without
+ * replacement, invalid input, or another non-allocation failure, and -1
+ * on allocation failure or if the table could not be grown.
  */
 int ossl_ht_insert(HT *htable, HT_KEY *key, HT_VALUE *data,
     HT_VALUE **olddata);
@@ -361,4 +448,49 @@ void ossl_ht_value_list_free(HT_VALUE_LIST *list);
  */
 HT_VALUE *ossl_ht_get(HT *htable, HT_KEY *key);

+/**
+ * ossl_ht_deref_value - Dereference a value stored in a hash table entry
+ * @h:   The hash table handle
+ * @val: Pointer to the value pointer inside the hash table
+ *
+ * This helper returns the actual value stored in a hash table entry,
+ * with awareness of whether the table is configured for RCU (Read-Copy-Update)
+ * safe lookups.
+ *
+ * If the hash table is configured to use RCU lookups, the function
+ * calls ossl_rcu_deref() to safely read the value under RCU protection.
+ * This ensures that the caller sees a consistent pointer in concurrent environments.
+ *
+ * If RCU is not enabled (i.e. `h->config.no_rcu` is true), the function
+ * simply dereferences @val directly.
+ *
+ * Return:
+ * A pointer to the dereferenced hash table value (`HT_VALUE *`), or NULL if
+ * the underlying pointer is NULL.
+ */
+HT_VALUE *ossl_ht_deref_value(HT *p, HT_VALUE **val);
+
+/**
+ * ossl_ht_inner_value - Extract the user payload from a hash table value
+ * @h: The hash table handle
+ * @v: The hash table value wrapper (HT_VALUE)
+ *
+ * This helper returns the user-provided payload stored inside a
+ * hash table value container. The behavior differs depending on
+ * whether the hash table is configured to use RCU (Read-Copy-Update)
+ * for concurrency control.
+ *
+ * - If RCU is enabled, the function simply returns `v->value` without
+ *   modifying or freeing the container.
+ *
+ * - If RCU is disabled the container structure `v` is no longer needed once
+ *   the inner pointer has been extracted. In this case, the function frees
+ *   `v` and returns the inner `value` pointer directly.
+ *
+ * Return:
+ * A pointer to the user payload (`void *`) contained in the hash table
+ * value wrapper.
+ */
+void *ossl_ht_inner_value(HT *h, HT_VALUE *v);
+
 #endif
diff --git a/deps/openssl/openssl/include/internal/hpke_util.h b/deps/openssl/openssl/include/internal/hpke_util.h
index 9c52ba46938..ae0b518020a 100644
--- a/deps/openssl/openssl/include/internal/hpke_util.h
+++ b/deps/openssl/openssl/include/internal/hpke_util.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,11 @@
 #define OSSL_INTERNAL_HPKE_UTIL_H
 #pragma once

+#include <stdint.h>
+
+#include <openssl/hpke.h>
+#include <openssl/types.h>
+
 /* Constants from RFC 9180 Section 7.1 and 7.3 */
 #define OSSL_HPKE_MAX_SECRET 64
 #define OSSL_HPKE_MAX_PUBLIC 133
diff --git a/deps/openssl/openssl/include/internal/json_enc.h b/deps/openssl/openssl/include/internal/json_enc.h
index 973debe525c..bdfee33c398 100644
--- a/deps/openssl/openssl/include/internal/json_enc.h
+++ b/deps/openssl/openssl/include/internal/json_enc.h
@@ -10,6 +10,7 @@
 #ifndef OSSL_JSON_ENC_H
 #define OSSL_JSON_ENC_H

+#include <stdbool.h>
 #include <openssl/bio.h>

 /*
@@ -194,7 +195,7 @@ void ossl_json_key(OSSL_JSON_ENC *json, const char *key);
 void ossl_json_null(OSSL_JSON_ENC *json);

 /* Encode a JSON boolean value. */
-void ossl_json_bool(OSSL_JSON_ENC *json, int value);
+void ossl_json_bool(OSSL_JSON_ENC *json, bool value);

 /* Encode a JSON integer from a uint64_t. */
 void ossl_json_u64(OSSL_JSON_ENC *json, uint64_t value);
diff --git a/deps/openssl/openssl/include/internal/ktls.h b/deps/openssl/openssl/include/internal/ktls.h
index 83f66b9dba9..cf14728fa51 100644
--- a/deps/openssl/openssl/include/internal/ktls.h
+++ b/deps/openssl/openssl/include/internal/ktls.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -97,8 +97,8 @@ static ossl_inline int ktls_enable_tx_zerocopy_sendfile(int fd)
  * the entire record is pushed to TCP. It is impossible to send a partial
  * record using this control message.
  */
-static ossl_inline int ktls_send_ctrl_message(int fd, unsigned char record_type,
-    const void *data, size_t length)
+static ossl_inline int ktls_send_ctrl_message(int fd,
+    unsigned char record_type, const void *data, size_t length, int flags)
 {
     struct msghdr msg = { 0 };
     int cmsg_len = sizeof(record_type);
@@ -120,7 +120,7 @@ static ossl_inline int ktls_send_ctrl_message(int fd, unsigned char record_type,
     msg.msg_iov = &msg_iov;
     msg.msg_iovlen = 1;

-    return sendmsg(fd, &msg, 0);
+    return sendmsg(fd, &msg, flags);
 }

 #ifdef OPENSSL_NO_KTLS_RX
@@ -201,16 +201,10 @@ static ossl_inline int ktls_read_record(int fd, void *data, size_t length)
  * KTLS enables the sendfile system call to send data from a file over
  * TLS.
  */
-static ossl_inline ossl_ssize_t ktls_sendfile(int s, int fd, off_t off,
-    size_t size, int flags)
+static ossl_inline int ktls_sendfile(int s, int fd, off_t off, size_t size,
+    ossl_ssize_t *sbytes, int flags)
 {
-    off_t sbytes = 0;
-    int ret;
-
-    ret = sendfile(fd, s, off, size, NULL, &sbytes, flags);
-    if (ret == -1 && sbytes == 0)
-        return -1;
-    return sbytes;
+    return sendfile(fd, s, off, size, NULL, sbytes, flags);
 }

 #endif /* __FreeBSD__ */
@@ -340,8 +334,8 @@ static ossl_inline int ktls_enable_tx_zerocopy_sendfile(int fd)
  * the entire record is pushed to TCP. It is impossible to send a partial
  * record using this control message.
  */
-static ossl_inline int ktls_send_ctrl_message(int fd, unsigned char record_type,
-    const void *data, size_t length)
+static ossl_inline int ktls_send_ctrl_message(int fd,
+    unsigned char record_type, const void *data, size_t length, int flags)
 {
     struct msghdr msg;
     int cmsg_len = sizeof(record_type);
@@ -367,16 +361,25 @@ static ossl_inline int ktls_send_ctrl_message(int fd, unsigned char record_type,
     msg.msg_iov = &msg_iov;
     msg.msg_iovlen = 1;

-    return sendmsg(fd, &msg, 0);
+    return sendmsg(fd, &msg, flags);
 }

 /*
  * KTLS enables the sendfile system call to send data from a file over TLS.
  * @flags are ignored on Linux. (placeholder for FreeBSD sendfile)
  * */
-static ossl_inline ossl_ssize_t ktls_sendfile(int s, int fd, off_t off, size_t size, int flags)
+static ossl_inline int ktls_sendfile(int s, int fd, off_t off, size_t size, ossl_ssize_t *sbytes, int flags)
 {
-    return sendfile(s, fd, &off, size);
+    ossl_ssize_t sent;
+
+    sent = sendfile(s, fd, &off, size);
+    if (sent >= 0) {
+        *sbytes = sent;
+        return 0;
+    } else {
+        *sbytes = 0;
+        return -1;
+    }
 }

 #ifdef OPENSSL_NO_KTLS_RX
@@ -407,7 +410,7 @@ static ossl_inline int ktls_read_record(int fd, void *data, size_t length)
     unsigned char *p = data;
     const size_t prepend_length = SSL3_RT_HEADER_LENGTH;

-    if (length < prepend_length + EVP_GCM_TLS_TAG_LEN) {
+    if (length < prepend_length) {
         errno = EINVAL;
         return -1;
     }
@@ -417,17 +420,27 @@ static ossl_inline int ktls_read_record(int fd, void *data, size_t length)
     msg.msg_controllen = sizeof(cmsgbuf.buf);

     msg_iov.iov_base = p + prepend_length;
-    msg_iov.iov_len = length - prepend_length - EVP_GCM_TLS_TAG_LEN;
+    msg_iov.iov_len = length - prepend_length;
     msg.msg_iov = &msg_iov;
     msg.msg_iovlen = 1;

+    memset(p, 0, prepend_length);
+
     ret = recvmsg(fd, &msg, 0);
     if (ret < 0)
         return ret;

+    if ((msg.msg_flags & (MSG_EOR | MSG_CTRUNC)) != MSG_EOR) {
+        errno = EMSGSIZE;
+        return -1;
+    }
+
     if (msg.msg_controllen > 0) {
         cmsg = CMSG_FIRSTHDR(&msg);
-        if (cmsg->cmsg_type == TLS_GET_RECORD_TYPE) {
+        if (cmsg != NULL
+            && cmsg->cmsg_level == SOL_TLS
+            && cmsg->cmsg_type == TLS_GET_RECORD_TYPE
+            && cmsg->cmsg_len >= CMSG_LEN(sizeof(unsigned char))) {
             p[0] = *((unsigned char *)CMSG_DATA(cmsg));
             p[1] = TLS1_2_VERSION_MAJOR;
             p[2] = TLS1_2_VERSION_MINOR;
diff --git a/deps/openssl/openssl/include/internal/mem_alloc_utils.h b/deps/openssl/openssl/include/internal/mem_alloc_utils.h
new file mode 100644
index 00000000000..12b37de746f
--- /dev/null
+++ b/deps/openssl/openssl/include/internal/mem_alloc_utils.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * Utility overflow checking and reporting functions
+ */
+
+#ifndef OSSL_INTERNAL_CHECK_SIZE_OVERFLOW_H
+#define OSSL_INTERNAL_CHECK_SIZE_OVERFLOW_H
+
+#include <limits.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#include "internal/common.h"
+#include "internal/safe_math.h"
+
+#include <openssl/cryptoerr.h>
+#include <openssl/err.h>
+
+OSSL_SAFE_MATH_UNSIGNED(size_t, size_t)
+
+/*
+ * A helper open-coded aligned alloc implementation around CRYPTO_malloc(),
+ * for use in cases where non-standard malloc implementation is (or may be,
+ * as it is the case of the FIPS module) used, or posix_memalign
+ * is not available.
+ */
+void *ossl_malloc_align(size_t num, size_t alignment, void **freeptr,
+    const char *file, int line);
+
+/*
+ * A helper routine to report memory allocation errors.
+ * Similar to the ERR_raise() macro, but accepts explicit file/line arguments,
+ * pre-defines the library to ERR_LIB_CRYPTO, and avoids emitting an error
+ * if both file set to NULL and line set to 0.
+ */
+static ossl_inline ossl_unused void
+ossl_report_alloc_err_ex(const char *const file, const int line,
+    const int reason)
+{
+    /*
+     * ossl_err_get_state_int() in err.c uses CRYPTO_zalloc(num, NULL, 0) for
+     * ERR_STATE allocation. Prevent mem alloc error loop while reporting error.
+     */
+    if (file != NULL || line != 0) {
+        ERR_new();
+        ERR_set_debug(file, line, NULL);
+        ERR_set_error(ERR_LIB_CRYPTO, reason, NULL);
+    }
+}
+
+/* Report a memory allocation failure. */
+static ossl_inline ossl_unused void
+ossl_report_alloc_err(const char *const file, const int line)
+{
+    ossl_report_alloc_err_ex(file, line, ERR_R_MALLOC_FAILURE);
+}
+
+/* Report an integer overflow during allocation size calculation. */
+static ossl_inline ossl_unused void
+ossl_report_alloc_err_of(const char *const file, const int line)
+{
+    ossl_report_alloc_err_ex(file, line, CRYPTO_R_INTEGER_OVERFLOW);
+}
+
+/* Report invalid memory allocation call arguments. */
+static ossl_inline ossl_unused void
+ossl_report_alloc_err_inv(const char *const file, const int line)
+{
+    ossl_report_alloc_err_ex(file, line, ERR_R_PASSED_INVALID_ARGUMENT);
+}
+
+/*
+ * Check the result of num and size multiplication for overflow
+ * and set error if it is the case;  return true if there was no overflow,
+ * false if there was.
+ */
+static ossl_inline ossl_unused bool
+ossl_size_mul(const size_t num, const size_t size, size_t *bytes,
+    const char *const file, const int line)
+{
+    int err = 0;
+    *bytes = safe_mul_size_t(num, size, &err);
+
+    if (ossl_unlikely(err != 0)) {
+        ossl_report_alloc_err_of(file, line);
+
+        return false;
+    }
+
+    return true;
+}
+
+/*
+ * Check the result of size1 and size2 addition for overflow
+ * and set error if it is the case;  returns true if there was no overflow,
+ * false if there was.
+ */
+static ossl_inline ossl_unused bool
+ossl_size_add(const size_t size1, const size_t size2, size_t *bytes,
+    const char *const file, const int line)
+{
+    int err = 0;
+    *bytes = safe_add_size_t(size1, size2, &err);
+
+    if (ossl_unlikely(err != 0)) {
+        ossl_report_alloc_err_of(file, line);
+
+        return false;
+    }
+
+    return true;
+}
+
+#endif /* OSSL_INTERNAL_CHECK_SIZE_OVERFLOW_H */
diff --git a/deps/openssl/openssl/include/internal/namemap.h b/deps/openssl/openssl/include/internal/namemap.h
index f74a7d72d50..1a9e39adf30 100644
--- a/deps/openssl/openssl/include/internal/namemap.h
+++ b/deps/openssl/openssl/include/internal/namemap.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_INTERNAL_NAMEMAP_H)
+#define OSSL_INTERNAL_NAMEMAP_H
+
 #include "internal/cryptlib.h"

 typedef struct ossl_namemap_st OSSL_NAMEMAP;
@@ -28,7 +31,7 @@ int ossl_namemap_name2num(const OSSL_NAMEMAP *namemap, const char *name);
 int ossl_namemap_name2num_n(const OSSL_NAMEMAP *namemap,
     const char *name, size_t name_len);
 const char *ossl_namemap_num2name(const OSSL_NAMEMAP *namemap, int number,
-    size_t idx);
+    int idx);
 int ossl_namemap_doall_names(const OSSL_NAMEMAP *namemap, int number,
     void (*fn)(const char *name, void *data),
     void *data);
@@ -39,3 +42,5 @@ int ossl_namemap_doall_names(const OSSL_NAMEMAP *namemap, int number,
  */
 int ossl_namemap_add_names(OSSL_NAMEMAP *namemap, int number,
     const char *names, const char separator);
+
+#endif /* !defined(OSSL_INTERNAL_NAMEMAP_H) */
diff --git a/deps/openssl/openssl/include/internal/numbers.h b/deps/openssl/openssl/include/internal/numbers.h
index 38d9d102fe8..f13ac7b8aeb 100644
--- a/deps/openssl/openssl/include/internal/numbers.h
+++ b/deps/openssl/openssl/include/internal/numbers.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -105,4 +105,12 @@ typedef __uint128_t uint128_t;
 #define OSSL_UINTMAX_MAX __MAXUINT__(ossl_uintmax_t)
 #endif

+/* Fix for cross compiling 64-bit PowerPC on OS X 10.4 */
+#if defined(__APPLE__) && defined(_ARCH_PPC64)
+#ifdef SIZE_MAX
+#undef SIZE_MAX
+#endif
+#define SIZE_MAX __MAXUINT__(uint64_t)
+#endif
+
 #endif
diff --git a/deps/openssl/openssl/include/internal/packet.h b/deps/openssl/openssl/include/internal/packet.h
index e5de4d43283..e15e0db83c0 100644
--- a/deps/openssl/openssl/include/internal/packet.h
+++ b/deps/openssl/openssl/include/internal/packet.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -22,6 +22,8 @@
 typedef struct {
     /* Pointer to where we are currently reading from */
     const unsigned char *curr;
+    /* Pointer to the start of the message */
+    const unsigned char *msgstart;
     /* Number of bytes remaining */
     size_t remaining;
 } PACKET;
@@ -52,6 +54,15 @@ static ossl_inline const unsigned char *PACKET_end(const PACKET *pkt)
     return pkt->curr + pkt->remaining;
 }

+/*
+ * Returns a pointer to the very start of the buffer. If this is a sub packet
+ * this will be the start of the buffer for the top of the PACKET tree.
+ */
+static ossl_inline const unsigned char *PACKET_msg_start(const PACKET *pkt)
+{
+    return pkt->msgstart;
+}
+
 /*
  * Returns a pointer to the PACKET's current position.
  * For use in non-PACKETized APIs.
@@ -74,7 +85,7 @@ __owur static ossl_inline int PACKET_buf_init(PACKET *pkt,
     if (len > (size_t)(SIZE_MAX / 2))
         return 0;

-    pkt->curr = buf;
+    pkt->curr = pkt->msgstart = buf;
     pkt->remaining = len;
     return 1;
 }
@@ -82,7 +93,7 @@ __owur static ossl_inline int PACKET_buf_init(PACKET *pkt,
 /* Initialize a PACKET to hold zero bytes. */
 static ossl_inline void PACKET_null_init(PACKET *pkt)
 {
-    pkt->curr = NULL;
+    pkt->curr = pkt->msgstart = NULL;
     pkt->remaining = 0;
 }

@@ -110,7 +121,11 @@ __owur static ossl_inline int PACKET_peek_sub_packet(const PACKET *pkt,
     if (PACKET_remaining(pkt) < len)
         return 0;

-    return PACKET_buf_init(subpkt, pkt->curr, len);
+    if (!PACKET_buf_init(subpkt, pkt->curr, len))
+        return 0;
+
+    subpkt->msgstart = pkt->msgstart;
+    return 1;
 }

 /*
@@ -228,6 +243,37 @@ __owur static ossl_inline int PACKET_peek_net_4(const PACKET *pkt,
     return 1;
 }

+/*
+ * Peek ahead at 6 bytes in network order from |pkt| and store the value in
+ * |*data|
+ */
+__owur static ossl_inline int PACKET_peek_net_6(const PACKET *pkt,
+    uint64_t *data)
+{
+    if (PACKET_remaining(pkt) < 6)
+        return 0;
+
+    *data = ((uint64_t)(*(pkt->curr))) << 40;
+    *data |= ((uint64_t)(*(pkt->curr + 1))) << 32;
+    *data |= ((uint64_t)(*(pkt->curr + 2))) << 24;
+    *data |= ((uint64_t)(*(pkt->curr + 3))) << 16;
+    *data |= ((uint64_t)(*(pkt->curr + 4))) << 8;
+    *data |= *(pkt->curr + 5);
+
+    return 1;
+}
+
+/* Get 6 bytes in network order from |pkt| and store the value in |*data| */
+__owur static ossl_inline int PACKET_get_net_6(PACKET *pkt, uint64_t *data)
+{
+    if (!PACKET_peek_net_6(pkt, data))
+        return 0;
+
+    packet_forward(pkt, 6);
+
+    return 1;
+}
+
 /*
  * Peek ahead at 8 bytes in network order from |pkt| and store the value in
  * |*data|
@@ -274,6 +320,24 @@ __owur static ossl_inline int PACKET_get_net_4_len(PACKET *pkt, size_t *data)
     return ret;
 }

+/**
+ * @brief Get 4 bytes in network order from |pkt| and store the value in |*data|
+ * Similar to PACKET_get_net_4() except the data is uint32_t
+ *
+ * @param pkt Contains a buffer to read from
+ * @param data The object to write the data to.
+ * @returns 1 on success, or 0 otherwise.
+ */
+static ossl_unused ossl_inline int PACKET_get_net_4_len_u32(PACKET *pkt, uint32_t *data)
+{
+    size_t i = 0;
+    int ret = PACKET_get_net_4_len(pkt, &i);
+
+    if (ret)
+        *data = (uint32_t)i;
+    return ret;
+}
+
 /* Get 8 bytes in network order from |pkt| and store the value in |*data| */
 __owur static ossl_inline int PACKET_get_net_8(PACKET *pkt, uint64_t *data)
 {
@@ -523,6 +587,7 @@ __owur static ossl_inline int PACKET_get_length_prefixed_1(PACKET *pkt,

     *pkt = tmp;
     subpkt->curr = data;
+    subpkt->msgstart = pkt->msgstart;
     subpkt->remaining = length;

     return 1;
@@ -544,6 +609,7 @@ __owur static ossl_inline int PACKET_as_length_prefixed_1(PACKET *pkt,

     *pkt = tmp;
     subpkt->curr = data;
+    subpkt->msgstart = pkt->msgstart;
     subpkt->remaining = length;

     return 1;
@@ -569,6 +635,7 @@ __owur static ossl_inline int PACKET_get_length_prefixed_2(PACKET *pkt,

     *pkt = tmp;
     subpkt->curr = data;
+    subpkt->msgstart = pkt->msgstart;
     subpkt->remaining = length;

     return 1;
@@ -591,6 +658,7 @@ __owur static ossl_inline int PACKET_as_length_prefixed_2(PACKET *pkt,

     *pkt = tmp;
     subpkt->curr = data;
+    subpkt->msgstart = pkt->msgstart;
     subpkt->remaining = length;

     return 1;
@@ -615,6 +683,7 @@ __owur static ossl_inline int PACKET_get_length_prefixed_3(PACKET *pkt,

     *pkt = tmp;
     subpkt->curr = data;
+    subpkt->msgstart = pkt->msgstart;
     subpkt->remaining = length;

     return 1;
@@ -757,6 +826,18 @@ int WPACKET_finish(WPACKET *pkt);
  */
 int WPACKET_fill_lengths(WPACKET *pkt);

+/*
+ * Initialise a new sub-packet. Additionally |lenbytes| of data is preallocated
+ * at the current position in |pkt| to store the sub-packets length once we know
+ * it. The sub-packet start is set at |offset| from current position in |pkt|
+ * Don't call this directly. Use the convenience macros below instead.
+ */
+int WPACKET_start_sub_packet_at_offset_len__(WPACKET *pkt, size_t lenbytes,
+    size_t offset);
+
+#define WPACKET_start_sub_packet_u24_at_offset(pkt, offset) \
+    WPACKET_start_sub_packet_at_offset_len__((pkt), 3, (offset))
+
 /*
  * Initialise a new sub-packet. Additionally |lenbytes| of data is preallocated
  * at the start of the sub-packet to store its length once we know it. Don't
@@ -875,6 +956,8 @@ int WPACKET_put_bytes__(WPACKET *pkt, uint64_t val, size_t bytes);
     WPACKET_put_bytes__((pkt), (val), 3)
 #define WPACKET_put_bytes_u32(pkt, val) \
     WPACKET_put_bytes__((pkt), (val), 4)
+#define WPACKET_put_bytes_u48(pkt, val) \
+    WPACKET_put_bytes__((pkt), (val), 6)
 #define WPACKET_put_bytes_u64(pkt, val) \
     WPACKET_put_bytes__((pkt), (val), 8)

diff --git a/deps/openssl/openssl/include/internal/param_build_set.h b/deps/openssl/openssl/include/internal/param_build_set.h
index c7785a12e61..a01cf2d1c92 100644
--- a/deps/openssl/openssl/include/internal/param_build_set.h
+++ b/deps/openssl/openssl/include/internal/param_build_set.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -44,8 +44,4 @@ int ossl_param_build_set_signed_bn(OSSL_PARAM_BLD *bld, OSSL_PARAM *p,
 int ossl_param_build_set_signed_bn_pad(OSSL_PARAM_BLD *bld, OSSL_PARAM *p,
     const char *key, const BIGNUM *bn,
     size_t sz);
-int ossl_param_build_set_multi_key_bn(OSSL_PARAM_BLD *bld, OSSL_PARAM *p,
-    const char *names[],
-    STACK_OF(BIGNUM_const) *stk);
-
 #endif /* OSSL_INTERNAL_PARAM_BUILD_SET_H */
diff --git a/deps/openssl/openssl/include/internal/param_names.h b/deps/openssl/openssl/include/internal/param_names.h
deleted file mode 100644
index 2878ad3c8c3..00000000000
--- a/deps/openssl/openssl/include/internal/param_names.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/param_names.h"
diff --git a/deps/openssl/openssl/include/internal/params.h b/deps/openssl/openssl/include/internal/params.h
index d0d309886d9..d9234c8dd1f 100644
--- a/deps/openssl/openssl/include/internal/params.h
+++ b/deps/openssl/openssl/include/internal/params.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_INTERNAL_PARAMS_H)
+#define OSSL_INTERNAL_PARAMS_H
+
 #include <stddef.h>
 #include <openssl/params.h>

@@ -19,8 +22,12 @@
  * *out and *out_len are guaranteed to be untouched if this function
  * doesn't return success.
  */
+int ossl_param_get1_octet_string_from_param(const OSSL_PARAM *p,
+    unsigned char **out,
+    size_t *out_len);
 int ossl_param_get1_octet_string(const OSSL_PARAM *params, const char *name,
     unsigned char **out, size_t *out_len);
+
 /*
  * Concatenate all of the matching params together.
  * *out will point to an allocated buffer on successful return.
@@ -28,11 +35,12 @@ int ossl_param_get1_octet_string(const OSSL_PARAM *params, const char *name,
  *
  * Passing 0 for maxsize means unlimited size output.
  *
- * Returns 1 on success, 0 on failure and -1 if there are no matching params.
+ * Returns 1 on success and 0 on failure.
  *
  * *out and *out_len are guaranteed to be untouched if this function
  * doesn't return success.
  */
-int ossl_param_get1_concat_octet_string(const OSSL_PARAM *params, const char *name,
-    unsigned char **out, size_t *out_len,
-    size_t maxsize);
+int ossl_param_get1_concat_octet_string(size_t n, OSSL_PARAM *params[],
+    unsigned char **out, size_t *out_len);
+
+#endif /* !defined(OSSL_INTERNAL_PARAMS_H) */
diff --git a/deps/openssl/openssl/include/internal/passphrase.h b/deps/openssl/openssl/include/internal/passphrase.h
index 803622867b7..078feae5cc2 100644
--- a/deps/openssl/openssl/include/internal/passphrase.h
+++ b/deps/openssl/openssl/include/internal/passphrase.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,8 @@
 #define OSSL_INTERNAL_PASSPHRASE_H
 #pragma once

+#include <openssl/ui.h>
+
 /*
  * This is a passphrase reader bridge with bells and whistles.
  *
diff --git a/deps/openssl/openssl/include/internal/priority_queue.h b/deps/openssl/openssl/include/internal/priority_queue.h
index 9941f4e27d5..e702c573c39 100644
--- a/deps/openssl/openssl/include/internal/priority_queue.h
+++ b/deps/openssl/openssl/include/internal/priority_queue.h
@@ -16,56 +16,56 @@

 #define PRIORITY_QUEUE_OF(type) OSSL_PRIORITY_QUEUE_##type

-#define DEFINE_PRIORITY_QUEUE_OF_INTERNAL(type, ctype)                                                                             \
-    typedef struct ossl_priority_queue_st_##type PRIORITY_QUEUE_OF(type);                                                          \
-    static ossl_unused ossl_inline PRIORITY_QUEUE_OF(type) *ossl_pqueue_##type##_new(int (*compare)(const ctype *, const ctype *)) \
-    {                                                                                                                              \
-        return (PRIORITY_QUEUE_OF(type) *)ossl_pqueue_new(                                                                         \
-            (int (*)(const void *, const void *))compare);                                                                         \
-    }                                                                                                                              \
-    static ossl_unused ossl_inline void                                                                                            \
-    ossl_pqueue_##type##_free(PRIORITY_QUEUE_OF(type) *pq)                                                                         \
-    {                                                                                                                              \
-        ossl_pqueue_free((OSSL_PQUEUE *)pq);                                                                                       \
-    }                                                                                                                              \
-    static ossl_unused ossl_inline void                                                                                            \
-    ossl_pqueue_##type##_pop_free(PRIORITY_QUEUE_OF(type) *pq,                                                                     \
-        void (*freefunc)(ctype *))                                                                                                 \
-    {                                                                                                                              \
-        ossl_pqueue_pop_free((OSSL_PQUEUE *)pq, (void (*)(void *))freefunc);                                                       \
-    }                                                                                                                              \
-    static ossl_unused ossl_inline int                                                                                             \
-    ossl_pqueue_##type##_reserve(PRIORITY_QUEUE_OF(type) *pq, size_t n)                                                            \
-    {                                                                                                                              \
-        return ossl_pqueue_reserve((OSSL_PQUEUE *)pq, n);                                                                          \
-    }                                                                                                                              \
-    static ossl_unused ossl_inline size_t                                                                                          \
-    ossl_pqueue_##type##_num(const PRIORITY_QUEUE_OF(type) *pq)                                                                    \
-    {                                                                                                                              \
-        return ossl_pqueue_num((OSSL_PQUEUE *)pq);                                                                                 \
-    }                                                                                                                              \
-    static ossl_unused ossl_inline int                                                                                             \
-    ossl_pqueue_##type##_push(PRIORITY_QUEUE_OF(type) *pq,                                                                         \
-        ctype *data, size_t *elem)                                                                                                 \
-    {                                                                                                                              \
-        return ossl_pqueue_push((OSSL_PQUEUE *)pq, (void *)data, elem);                                                            \
-    }                                                                                                                              \
-    static ossl_unused ossl_inline ctype *                                                                                         \
-    ossl_pqueue_##type##_peek(const PRIORITY_QUEUE_OF(type) *pq)                                                                   \
-    {                                                                                                                              \
-        return (type *)ossl_pqueue_peek((OSSL_PQUEUE *)pq);                                                                        \
-    }                                                                                                                              \
-    static ossl_unused ossl_inline ctype *                                                                                         \
-    ossl_pqueue_##type##_pop(PRIORITY_QUEUE_OF(type) *pq)                                                                          \
-    {                                                                                                                              \
-        return (type *)ossl_pqueue_pop((OSSL_PQUEUE *)pq);                                                                         \
-    }                                                                                                                              \
-    static ossl_unused ossl_inline ctype *                                                                                         \
-    ossl_pqueue_##type##_remove(PRIORITY_QUEUE_OF(type) *pq,                                                                       \
-        size_t elem)                                                                                                               \
-    {                                                                                                                              \
-        return (type *)ossl_pqueue_remove((OSSL_PQUEUE *)pq, elem);                                                                \
-    }                                                                                                                              \
+#define DEFINE_PRIORITY_QUEUE_OF_INTERNAL(type, ctype)                                                                           \
+    typedef struct ossl_priority_queue_st_##type PRIORITY_QUEUE_OF(type);                                                        \
+    static ossl_unused ossl_inline PRIORITY_QUEUE_OF(type) *ossl_pqueue_##type##_new(int (*compare)(const void *, const void *)) \
+    {                                                                                                                            \
+        return (PRIORITY_QUEUE_OF(type) *)ossl_pqueue_new(                                                                       \
+            compare);                                                                                                            \
+    }                                                                                                                            \
+    static ossl_unused ossl_inline void                                                                                          \
+    ossl_pqueue_##type##_free(PRIORITY_QUEUE_OF(type) *pq)                                                                       \
+    {                                                                                                                            \
+        ossl_pqueue_free((OSSL_PQUEUE *)pq);                                                                                     \
+    }                                                                                                                            \
+    static ossl_unused ossl_inline void                                                                                          \
+    ossl_pqueue_##type##_pop_free(PRIORITY_QUEUE_OF(type) *pq,                                                                   \
+        void (*freefunc)(void *))                                                                                                \
+    {                                                                                                                            \
+        ossl_pqueue_pop_free((OSSL_PQUEUE *)pq, freefunc);                                                                       \
+    }                                                                                                                            \
+    static ossl_unused ossl_inline int                                                                                           \
+    ossl_pqueue_##type##_reserve(PRIORITY_QUEUE_OF(type) *pq, size_t n)                                                          \
+    {                                                                                                                            \
+        return ossl_pqueue_reserve((OSSL_PQUEUE *)pq, n);                                                                        \
+    }                                                                                                                            \
+    static ossl_unused ossl_inline size_t                                                                                        \
+    ossl_pqueue_##type##_num(const PRIORITY_QUEUE_OF(type) *pq)                                                                  \
+    {                                                                                                                            \
+        return ossl_pqueue_num((OSSL_PQUEUE *)pq);                                                                               \
+    }                                                                                                                            \
+    static ossl_unused ossl_inline int                                                                                           \
+    ossl_pqueue_##type##_push(PRIORITY_QUEUE_OF(type) *pq,                                                                       \
+        ctype *data, size_t *elem)                                                                                               \
+    {                                                                                                                            \
+        return ossl_pqueue_push((OSSL_PQUEUE *)pq, (void *)data, elem);                                                          \
+    }                                                                                                                            \
+    static ossl_unused ossl_inline ctype *                                                                                       \
+    ossl_pqueue_##type##_peek(const PRIORITY_QUEUE_OF(type) *pq)                                                                 \
+    {                                                                                                                            \
+        return (type *)ossl_pqueue_peek((OSSL_PQUEUE *)pq);                                                                      \
+    }                                                                                                                            \
+    static ossl_unused ossl_inline ctype *                                                                                       \
+    ossl_pqueue_##type##_pop(PRIORITY_QUEUE_OF(type) *pq)                                                                        \
+    {                                                                                                                            \
+        return (type *)ossl_pqueue_pop((OSSL_PQUEUE *)pq);                                                                       \
+    }                                                                                                                            \
+    static ossl_unused ossl_inline ctype *                                                                                       \
+    ossl_pqueue_##type##_remove(PRIORITY_QUEUE_OF(type) *pq,                                                                     \
+        size_t elem)                                                                                                             \
+    {                                                                                                                            \
+        return (type *)ossl_pqueue_remove((OSSL_PQUEUE *)pq, elem);                                                              \
+    }                                                                                                                            \
     struct ossl_priority_queue_st_##type

 #define DEFINE_PRIORITY_QUEUE_OF(type) \
diff --git a/deps/openssl/openssl/include/internal/propertyerr.h b/deps/openssl/openssl/include/internal/propertyerr.h
deleted file mode 100644
index 94e2c90955d..00000000000
--- a/deps/openssl/openssl/include/internal/propertyerr.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_INTERNAL_PROPERTYERR_H
-#define OSSL_INTERNAL_PROPERTYERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_PROP_strings(void);
-
-/*
- * PROP reason codes.
- */
-#define PROP_R_NAME_TOO_LONG 100
-#define PROP_R_NOT_AN_ASCII_CHARACTER 101
-#define PROP_R_NOT_AN_HEXADECIMAL_DIGIT 102
-#define PROP_R_NOT_AN_IDENTIFIER 103
-#define PROP_R_NOT_AN_OCTAL_DIGIT 104
-#define PROP_R_NOT_A_DECIMAL_DIGIT 105
-#define PROP_R_NO_MATCHING_STRING_DELIMITER 106
-#define PROP_R_NO_VALUE 107
-#define PROP_R_PARSE_FAILED 108
-#define PROP_R_STRING_TOO_LONG 109
-#define PROP_R_TRAILING_CHARACTERS 110
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/internal/qlog.h b/deps/openssl/openssl/include/internal/qlog.h
index 0455f21b48c..8c8174fbfdb 100644
--- a/deps/openssl/openssl/include/internal/qlog.h
+++ b/deps/openssl/openssl/include/internal/qlog.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,7 @@
 #define OSSL_QLOG_H

 #include <openssl/ssl.h>
+#include <stdbool.h>
 #include "internal/quic_types.h"
 #include "internal/time.h"

@@ -20,10 +21,11 @@ typedef struct qlog_st QLOG;

 enum {
     QLOG_EVENT_TYPE_NONE,
-
+/* clang-format off */
 #define QLOG_EVENT(cat, name) QLOG_EVENT_TYPE_##cat##_##name,
-#include "internal/qlog_events.h"
+#include "internal/qlog_events.inc"
 #undef QLOG_EVENT
+    /* clang-format on */

     QLOG_EVENT_TYPE_NUM
 };
@@ -110,7 +112,7 @@ void ossl_qlog_str_len(QLOG *qlog, const char *name,
     const char *value, size_t value_len);
 void ossl_qlog_u64(QLOG *qlog, const char *name, uint64_t value);
 void ossl_qlog_i64(QLOG *qlog, const char *name, int64_t value);
-void ossl_qlog_bool(QLOG *qlog, const char *name, int value);
+void ossl_qlog_bool(QLOG *qlog, const char *name, bool value);
 void ossl_qlog_bin(QLOG *qlog, const char *name,
     const void *value, size_t value_len);

diff --git a/deps/openssl/openssl/include/internal/qlog_events.h b/deps/openssl/openssl/include/internal/qlog_events.inc
similarity index 89%
rename from deps/openssl/openssl/include/internal/qlog_events.h
rename to deps/openssl/openssl/include/internal/qlog_events.inc
index 6dd44bf3656..6fcc060a630 100644
--- a/deps/openssl/openssl/include/internal/qlog_events.h
+++ b/deps/openssl/openssl/include/internal/qlog_events.inc
@@ -1,11 +1,12 @@
 /*
- * Copyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
+
 QLOG_EVENT(connectivity, connection_started)
 QLOG_EVENT(connectivity, connection_state_updated)
 QLOG_EVENT(connectivity, connection_closed)
diff --git a/deps/openssl/openssl/include/internal/quic_channel.h b/deps/openssl/openssl/include/internal/quic_channel.h
index 54e8b92298b..47a6202164c 100644
--- a/deps/openssl/openssl/include/internal/quic_channel.h
+++ b/deps/openssl/openssl/include/internal/quic_channel.h
@@ -15,6 +15,7 @@
 #include "internal/quic_record_tx.h"
 #include "internal/quic_wire.h"
 #include "internal/quic_predef.h"
+#include "internal/quic_demux.h"
 #include "internal/qlog.h"
 #include "internal/time.h"
 #include "internal/thread.h"
@@ -128,6 +129,20 @@ typedef struct quic_channel_args_st {

     /* Title to use for the qlog session, or NULL. */
     const char *qlog_title;
+
+    /* Transport parameter values for the channel. */
+    uint64_t max_idle_timeout;
+    uint64_t max_udp_payload_size;
+    uint64_t init_max_data;
+    uint64_t init_max_stream_data_bidi_local;
+    uint64_t init_max_stream_data_bidi_remote;
+    uint64_t init_max_stream_data_uni;
+    uint64_t init_max_streams_bidi;
+    uint64_t init_max_streams_uni;
+    uint64_t max_ack_delay;
+    uint64_t active_conn_id_limit;
+    unsigned char ack_delay_exponent;
+    unsigned char disable_active_migration;
 } QUIC_CHANNEL_ARGS;

 /* Represents the cause for a connection's termination. */
@@ -316,6 +331,9 @@ OSSL_STATM *ossl_quic_channel_get_statm(QUIC_CHANNEL *ch);
 /* Gets the TLS handshake layer used with the channel. */
 SSL *ossl_quic_channel_get0_tls(QUIC_CHANNEL *ch);

+/* Attaches the TLS layer to a deferred channel. */
+int ossl_quic_channel_set0_tls(QUIC_CHANNEL *ch, SSL *ssl);
+
 /* Gets the channels short header connection id length */
 size_t ossl_quic_channel_get_short_header_conn_id_len(QUIC_CHANNEL *ch);

@@ -342,6 +360,8 @@ int ossl_quic_channel_is_terminated(const QUIC_CHANNEL *ch);
 int ossl_quic_channel_is_active(const QUIC_CHANNEL *ch);
 int ossl_quic_channel_is_handshake_complete(const QUIC_CHANNEL *ch);
 int ossl_quic_channel_is_handshake_confirmed(const QUIC_CHANNEL *ch);
+int ossl_quic_channel_is_server(const QUIC_CHANNEL *ch);
+void ossl_quic_channel_notify_flush_done(QUIC_CHANNEL *ch);

 QUIC_PORT *ossl_quic_channel_get0_port(QUIC_CHANNEL *ch);
 QUIC_ENGINE *ossl_quic_channel_get0_engine(QUIC_CHANNEL *ch);
@@ -455,17 +475,76 @@ uint64_t ossl_quic_channel_get_remote_stream_count_avail(const QUIC_CHANNEL *ch,
 int ossl_quic_channel_have_generated_transport_params(const QUIC_CHANNEL *ch);

 /* Configures the idle timeout to request from peer (milliseconds, 0=no timeout). */
-void ossl_quic_channel_set_max_idle_timeout_request(QUIC_CHANNEL *ch, uint64_t ms);
-/* Get the configured idle timeout to request from peer. */
+int ossl_quic_channel_set_max_idle_timeout_request(QUIC_CHANNEL *ch, uint64_t ms);
+/* Gets the configured idle timeout to request from peer. */
 uint64_t ossl_quic_channel_get_max_idle_timeout_request(const QUIC_CHANNEL *ch);
-/* Get the idle timeout requested by the peer. */
+/* Gets the idle timeout requested by the peer. */
 uint64_t ossl_quic_channel_get_max_idle_timeout_peer_request(const QUIC_CHANNEL *ch);
-/* Get the idle timeout actually negotiated. */
+/* Gets the idle timeout actually negotiated. */
 uint64_t ossl_quic_channel_get_max_idle_timeout_actual(const QUIC_CHANNEL *ch);

+/* Configures the maximum UDP payload size to advertise to the peer (bytes). */
+int ossl_quic_channel_set_max_udp_payload_size_request(QUIC_CHANNEL *ch, uint64_t size);
+/* Gets the configured maximum UDP payload size to advertise to the peer. */
+uint64_t ossl_quic_channel_get_max_udp_payload_size_request(const QUIC_CHANNEL *ch);
+/* Gets the maximum UDP payload size advertised by the peer. */
+uint64_t ossl_quic_channel_get_max_udp_payload_size_peer_request(const QUIC_CHANNEL *ch);
+
+/* Configures the maximum data to advertise to the peer (bytes). */
+int ossl_quic_channel_set_max_data_request(QUIC_CHANNEL *ch, uint64_t max_data);
+/* Gets the configured maximum data to advertise to the peer. */
+uint64_t ossl_quic_channel_get_max_data_request(const QUIC_CHANNEL *ch);
+/* Gets the maximum data advertised by the peer. */
+uint64_t ossl_quic_channel_get_max_data_peer_request(const QUIC_CHANNEL *ch);
+
+/* Configures the maximum stream data for a bidi/uni remote/local stream to advertise to the peer (bytes). */
+int ossl_quic_channel_set_max_stream_data_request(QUIC_CHANNEL *ch, uint64_t max_data, int is_uni, int is_remote);
+/* Gets the configured maximum stream data for a bidi/uni remote/local stream to advertise to the peer. */
+uint64_t ossl_quic_channel_get_max_stream_data_request(const QUIC_CHANNEL *ch, int is_uni, int is_remote);
+/* Gets the maximum stream data for a bidi/uni remote/local stream advertised by the peer. */
+uint64_t ossl_quic_channel_get_max_stream_data_peer_request(const QUIC_CHANNEL *ch, int is_uni, int is_remote);
+
+/* Configures the maximum bidi/uni streams to advertise to the peer. */
+int ossl_quic_channel_set_max_streams_request(QUIC_CHANNEL *ch, uint64_t max_streams, int is_uni);
+/* Gets the configured maximum bidi/uni streams to advertise to the peer. */
+uint64_t ossl_quic_channel_get_max_streams_request(const QUIC_CHANNEL *ch, int is_uni);
+/* Gets the maximum bidi/uni streams advertised by the peer. */
+uint64_t ossl_quic_channel_get_max_streams_peer_request(const QUIC_CHANNEL *ch, int is_uni);
+
+/* Configures the ACK delay exponent to advertise to the peer. */
+int ossl_quic_channel_set_ack_delay_exponent_request(QUIC_CHANNEL *ch, uint64_t exp);
+/* Gets the configured ACK delay exponent to advertise to the peer. */
+uint64_t ossl_quic_channel_get_ack_delay_exponent_request(const QUIC_CHANNEL *ch);
+/* Gets the ACK delay exponent advertised by the peer. */
+uint64_t ossl_quic_channel_get_ack_delay_exponent_peer_request(const QUIC_CHANNEL *ch);
+
+/* Configures the maximum ACK delay to advertise to the peer (milliseconds). */
+int ossl_quic_channel_set_max_ack_delay_request(QUIC_CHANNEL *ch, uint64_t ms);
+/* Gets the configured maximum ACK delay to advertise to the peer. */
+uint64_t ossl_quic_channel_get_max_ack_delay_request(const QUIC_CHANNEL *ch);
+/* Gets the maximum ACK delay advertised by the peer. */
+uint64_t ossl_quic_channel_get_max_ack_delay_peer_request(const QUIC_CHANNEL *ch);
+
+/* Configures the disable active migration flag to advertise to the peer. */
+int ossl_quic_channel_set_disable_active_migration_request(QUIC_CHANNEL *ch, uint64_t disable);
+/* Gets the configured disable active migration flag to advertise to the peer. */
+uint64_t ossl_quic_channel_get_disable_active_migration_request(const QUIC_CHANNEL *ch);
+/* Gets the disable active migration flag advertised by the peer. */
+uint64_t ossl_quic_channel_get_disable_active_migration_peer_request(const QUIC_CHANNEL *ch);
+
+/* Configures the active connection ID limit to advertise to the peer. */
+int ossl_quic_channel_set_active_conn_id_limit_request(QUIC_CHANNEL *ch, uint64_t limit);
+/* Gets the configured active connection ID limit to advertise to the peer. */
+uint64_t ossl_quic_channel_get_active_conn_id_limit_request(const QUIC_CHANNEL *ch);
+/* Gets the active connection ID limit advertised by the peer. */
+uint64_t ossl_quic_channel_get_active_conn_id_limit_peer_request(const QUIC_CHANNEL *ch);
+
 int ossl_quic_bind_channel(QUIC_CHANNEL *ch, const BIO_ADDR *peer,
     const QUIC_CONN_ID *dcid, const QUIC_CONN_ID *odcid);

+void ossl_quic_channel_set_tcause(QUIC_CHANNEL *ch, uint64_t app_error_code,
+    const char *app_reason);
+
 void ossl_ch_reset_rx_state(QUIC_CHANNEL *ch);
 uint64_t ossl_quic_channel_get_path_challenge_count(const QUIC_CHANNEL *ch);
 uint64_t ossl_quic_channel_get_path_response_count(const QUIC_CHANNEL *ch);
diff --git a/deps/openssl/openssl/include/internal/quic_demux.h b/deps/openssl/openssl/include/internal/quic_demux.h
index a1bb344dc46..4e2180c2ba1 100644
--- a/deps/openssl/openssl/include/internal/quic_demux.h
+++ b/deps/openssl/openssl/include/internal/quic_demux.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -16,6 +16,7 @@
 #include "internal/bio_addr.h"
 #include "internal/time.h"
 #include "internal/list.h"
+#include "internal/dgram_demux.h"

 #ifndef OPENSSL_NO_QUIC

@@ -86,57 +87,14 @@
 /* Maximum number of packets we allow to exist in one datagram. */
 #define QUIC_MAX_PKT_PER_URXE (sizeof(uint64_t) * 8)

-struct quic_urxe_st {
-    OSSL_LIST_MEMBER(urxe, QUIC_URXE);
-
-    /*
-     * The URXE data starts after this structure so we don't need a pointer.
-     * data_len stores the current length (i.e., the length of the received
-     * datagram) and alloc_len stores the allocation length. The URXE will be
-     * reallocated if we need a larger allocation than is available, though this
-     * should not be common as we will have a good idea of worst-case MTUs up
-     * front.
-     */
-    size_t data_len, alloc_len;
-
-    /*
-     * Bitfields per packet. processed indicates the packet has been processed
-     * and must not be processed again, hpr_removed indicates header protection
-     * has already been removed. Used by QRX only; not used by the demuxer.
-     */
-    uint64_t processed, hpr_removed;
-
-    /*
-     * This monotonically increases with each datagram received. It is used for
-     * diagnostic purposes only.
-     */
-    uint64_t datagram_id;
-
-    /*
-     * Address of peer we received the datagram from, and the local interface
-     * address we received it on. If local address support is not enabled, local
-     * is zeroed.
-     */
-    BIO_ADDR peer, local;
-
-    /*
-     * Time at which datagram was received (or ossl_time_zero()) if a now
-     * function was not provided).
-     */
-    OSSL_TIME time;
-
-    /*
-     * Used by the QRX to mark whether a datagram has been deferred. Used by the
-     * QRX only; not used by the demuxer.
-     */
-    char deferred;
-
-    /*
-     * Used by the DEMUX to track if a URXE has been handed out. Used primarily
-     * for debugging purposes.
-     */
-    char demux_state;
-};
+/*
+ * QUIC_URXE is a typedef to DGRAM_URXE. The DGRAM_URXE structure includes
+ * QUIC-specific fields (processed, hpr_removed, deferred) that are used by
+ * the QRX but ignored by DTLS. This allows list and demuxer operations to
+ * be shared.
+ */
+typedef DGRAM_URXE QUIC_URXE;
+typedef DGRAM_URXE_LIST QUIC_URXE_LIST;

 /* Accessors for URXE buffer. */
 static ossl_unused ossl_inline unsigned char *
@@ -151,17 +109,26 @@ ossl_quic_urxe_data_end(const QUIC_URXE *e)
     return ossl_quic_urxe_data(e) + e->data_len;
 }

-/* List structure tracking a queue of URXEs. */
-DEFINE_LIST_OF(urxe, QUIC_URXE);
-typedef OSSL_LIST(urxe) QUIC_URXE_LIST;
-
 /*
- * List management helpers. These are used by the demuxer but can also be used
- * by users of the demuxer to manage URXEs.
+ * List management helpers. These delegate to the DGRAM_URXE list functions.
  */
-void ossl_quic_urxe_remove(QUIC_URXE_LIST *l, QUIC_URXE *e);
-void ossl_quic_urxe_insert_head(QUIC_URXE_LIST *l, QUIC_URXE *e);
-void ossl_quic_urxe_insert_tail(QUIC_URXE_LIST *l, QUIC_URXE *e);
+static ossl_unused ossl_inline void
+ossl_quic_urxe_remove(QUIC_URXE_LIST *l, QUIC_URXE *e)
+{
+    ossl_dgram_urxe_remove(l, e);
+}
+
+static ossl_unused ossl_inline void
+ossl_quic_urxe_insert_head(QUIC_URXE_LIST *l, QUIC_URXE *e)
+{
+    ossl_dgram_urxe_insert_head(l, e);
+}
+
+static ossl_unused ossl_inline void
+ossl_quic_urxe_insert_tail(QUIC_URXE_LIST *l, QUIC_URXE *e)
+{
+    ossl_dgram_urxe_insert_tail(l, e);
+}

 /*
  * Called when a datagram is received for a given connection ID.
diff --git a/deps/openssl/openssl/include/internal/quic_lcidm.h b/deps/openssl/openssl/include/internal/quic_lcidm.h
index 66421e8ac1b..3ebb45c7b6c 100644
--- a/deps/openssl/openssl/include/internal/quic_lcidm.h
+++ b/deps/openssl/openssl/include/internal/quic_lcidm.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -254,7 +254,7 @@ int ossl_quic_lcidm_debug_add(QUIC_LCIDM *lcidm, void *opaque,

 /*
  * Obtain a local connection id which is not used yet.
- * Returns 1 on succes, 0 on failure.
+ * Returns 1 on success, 0 on failure.
  */
 int ossl_quic_lcidm_get_unused_cid(QUIC_LCIDM *lcidm, QUIC_CONN_ID *cid);

diff --git a/deps/openssl/openssl/include/internal/quic_port.h b/deps/openssl/openssl/include/internal/quic_port.h
index 88fb126e994..bd590939fa8 100644
--- a/deps/openssl/openssl/include/internal/quic_port.h
+++ b/deps/openssl/openssl/include/internal/quic_port.h
@@ -47,8 +47,8 @@ typedef struct quic_port_args_st {
      * connection object for the incoming channel
      * user_ssl_arg is expected to point to a quic listener object
      */
-    SSL *(*get_conn_user_ssl)(QUIC_CHANNEL *ch, void *arg);
-    void *user_ssl_arg;
+    SSL *(*get_conn_user_ssl)(QUIC_CHANNEL *ch, QUIC_LISTENER *ql);
+    QUIC_LISTENER *ql;

     /*
      * This SSL_CTX will be used when constructing the handshake layer object
@@ -95,6 +95,9 @@ QUIC_CHANNEL *ossl_quic_port_create_incoming(QUIC_PORT *port, SSL *tls);
  */
 QUIC_CHANNEL *ossl_quic_port_pop_incoming(QUIC_PORT *port);

+/* Returns the first incoming channel without removing it, or NULL. */
+QUIC_CHANNEL *ossl_quic_port_peek_incoming(QUIC_PORT *port);
+
 /* Returns 1 if there is at least one connection incoming. */
 int ossl_quic_port_have_incoming(QUIC_PORT *port);

@@ -140,6 +143,51 @@ OSSL_TIME ossl_quic_port_get_time(QUIC_PORT *port);
 int ossl_quic_port_get_rx_short_dcid_len(const QUIC_PORT *port);
 int ossl_quic_port_get_tx_init_dcid_len(const QUIC_PORT *port);

+/* Configures the idle timeout to request from peer (milliseconds, 0=no timeout). */
+void ossl_quic_port_set_max_idle_timeout(QUIC_PORT *port, uint64_t ms);
+/* Gets the configured idle timeout to request from peer. */
+uint64_t ossl_quic_port_get_max_idle_timeout(const QUIC_PORT *port);
+
+/* Configures the maximum UDP payload size to advertise to the peer (bytes). */
+void ossl_quic_port_set_max_udp_payload_size(QUIC_PORT *port, uint64_t size);
+/* Gets the configured maximum UDP payload size to advertise to the peer. */
+uint64_t ossl_quic_port_get_max_udp_payload_size(const QUIC_PORT *port);
+
+/* Configures the maximum data to advertise to the peer (bytes). */
+void ossl_quic_port_set_init_max_data(QUIC_PORT *port, uint64_t max_data);
+/* Gets the configured maximum data to advertise to the peer. */
+uint64_t ossl_quic_port_get_init_max_data(const QUIC_PORT *port);
+
+/* Configures the maximum stream data for a bidi/uni remote/local stream to advertise to the peer (bytes). */
+void ossl_quic_port_set_init_max_stream_data(QUIC_PORT *port, uint64_t max_data, int is_uni, int is_remote);
+/* Gets the configured maximum stream data for a bidi/uni remote/local stream to advertise to the peer. */
+uint64_t ossl_quic_port_get_init_max_stream_data(const QUIC_PORT *port, int is_uni, int is_remote);
+
+/* Configures the maximum bidi/uni streams to advertise to the peer. */
+void ossl_quic_port_set_init_max_streams(QUIC_PORT *port, uint64_t max_streams, int is_uni);
+/* Gets the configured maximum bidi/uni streams to advertise to the peer. */
+uint64_t ossl_quic_port_get_init_max_streams(const QUIC_PORT *port, int is_uni);
+
+/* Configures the ACK delay exponent to advertise to the peer. */
+void ossl_quic_port_set_ack_delay_exponent(QUIC_PORT *port, uint64_t exp);
+/* Gets the configured ACK delay exponent to advertise to the peer. */
+uint64_t ossl_quic_port_get_ack_delay_exponent(const QUIC_PORT *port);
+
+/* Configures the maximum ACK delay to advertise to the peer (milliseconds). */
+void ossl_quic_port_set_max_ack_delay(QUIC_PORT *port, uint64_t ms);
+/* Gets the configured maximum ACK delay to advertise to the peer. */
+uint64_t ossl_quic_port_get_max_ack_delay(const QUIC_PORT *port);
+
+/* Configures the disable active migration flag to advertise to the peer. */
+void ossl_quic_port_set_disable_active_migration(QUIC_PORT *port, uint64_t disable);
+/* Gets the configured disable active migration flag to advertise to the peer. */
+uint64_t ossl_quic_port_get_disable_active_migration(const QUIC_PORT *port);
+
+/* Configures the active connection ID limit to advertise to the peer. */
+void ossl_quic_port_set_active_conn_id_limit(QUIC_PORT *port, uint64_t limit);
+/* Gets the configured active connection ID limit to advertise to the peer. */
+uint64_t ossl_quic_port_get_active_conn_id_limit(const QUIC_PORT *port);
+
 /* Returns 1 if the port is running/healthy, 0 if it has failed. */
 int ossl_quic_port_is_running(const QUIC_PORT *port);

@@ -159,6 +207,15 @@ size_t ossl_quic_port_get_num_incoming_channels(const QUIC_PORT *port);
 /* Sets if incoming connections should currently be allowed. */
 void ossl_quic_port_set_allow_incoming(QUIC_PORT *port, int allow_incoming);

+#define PEELOFF_LISTEN -1
+#define PEELOFF_ACCEPT 1
+#define PEELOFF_UNSET 0
+/*
+ * Sets flag to indicate we are using SSL_listen_ex to get connections
+ * returns 1 if set was successful, or 0 if the set fails
+ */
+int ossl_quic_port_test_and_set_peeloff(QUIC_PORT *port, int using_peeloff);
+
 /* Returns 1 if we are using addressed mode on the read side. */
 int ossl_quic_port_is_addressed_r(const QUIC_PORT *port);

diff --git a/deps/openssl/openssl/include/internal/quic_predef.h b/deps/openssl/openssl/include/internal/quic_predef.h
index 7ed19fcb2e0..485b07d5bf6 100644
--- a/deps/openssl/openssl/include/internal/quic_predef.h
+++ b/deps/openssl/openssl/include/internal/quic_predef.h
@@ -37,7 +37,6 @@ typedef struct ossl_qtx_pkt_st OSSL_QTX_PKT;
 typedef struct quic_tick_result_st QUIC_TICK_RESULT;
 typedef struct quic_srtm_st QUIC_SRTM;
 typedef struct quic_lcidm_st QUIC_LCIDM;
-typedef struct quic_urxe_st QUIC_URXE;
 typedef struct quic_engine_st QUIC_ENGINE;
 typedef struct quic_obj_st QUIC_OBJ;
 typedef struct quic_conn_st QUIC_CONNECTION;
diff --git a/deps/openssl/openssl/include/internal/quic_reactor.h b/deps/openssl/openssl/include/internal/quic_reactor.h
index dffc37d7549..3dfeb895eb4 100644
--- a/deps/openssl/openssl/include/internal/quic_reactor.h
+++ b/deps/openssl/openssl/include/internal/quic_reactor.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -139,6 +139,12 @@ struct quic_reactor_st {

     /* 1 if a block_until_pred call has put the notifier in the signalled state. */
     unsigned int signalled_notifier : 1;
+
+    /*
+     * Bumped each time the notifier is drained. Lets a phase-2 waiter identify
+     * the signal cycle it participated in (see two-phase leave below).
+     */
+    uint64_t notify_generation;
 };

 /* Create an OS notifier? */
@@ -251,11 +257,15 @@ int ossl_quic_reactor_block_until_pred(QUIC_REACTOR *rtor,
  * via the notifier. The reactor mutex must be held while calling these
  * functions.
  *
- * The number of 'active' calls to these functions (i.e., the number of enter
- * calls which have yet to be matched with a subsequent leave call) must *at all
- * times* equal the number of threads blocking on the reactor. In other words, a
- * single thread is not permitted to use these functions "recursively". Failing
- * to adhere to this rule will result in deadlock.
+ * An active registration is an enter call which has not yet been matched by a
+ * subsequent deregister or leave call. A thread may have at most one active
+ * registration for a given reactor; recursive registration will result in
+ * deadlock. A thread which has deregistered may still wait for the notifier in
+ * phase 2, but is no longer counted as an active registration.
+ *
+ * A thread with an active registration on any reactor must not tick a reactor.
+ * A tick can block while notifying other registered threads, which would
+ * prevent the ticking thread from deregistering and can result in deadlock.
  *
  * This means that if a caller has the concept of multiple concurrent blocking
  * calls on the same thread on the same reactor (which may occur in some
@@ -279,6 +289,23 @@ int ossl_quic_reactor_block_until_pred(QUIC_REACTOR *rtor,
 void ossl_quic_reactor_enter_blocking_section(QUIC_REACTOR *rtor);
 void ossl_quic_reactor_leave_blocking_section(QUIC_REACTOR *rtor);

+/*
+ * Two-phase leave for callers registered with multiple reactors. First call
+ * deregister_blocking_section() for every reactor; only then call
+ * wait_for_notifier_clear() for each deregistration that returned 1. This
+ * avoids waiting on one reactor while still registered with another.
+ *
+ * deregister_blocking_section() never blocks, requires the reactor mutex, and
+ * stores the signal generation to await in *gen. wait_for_notifier_clear()
+ * acquires the mutex itself and waits only for that generation. Single-reactor
+ * callers may continue to use leave_blocking_section(), whose combined wait is
+ * likewise bounded to the signal generation observed during deregistration.
+ */
+int ossl_quic_reactor_deregister_blocking_section(QUIC_REACTOR *rtor,
+    uint64_t *gen);
+void ossl_quic_reactor_wait_for_notifier_clear(QUIC_REACTOR *rtor,
+    uint64_t gen);
+
 #endif

 #endif
diff --git a/deps/openssl/openssl/include/internal/quic_reactor_wait_ctx.h b/deps/openssl/openssl/include/internal/quic_reactor_wait_ctx.h
index 8adc94d161a..b20bd5c8bc9 100644
--- a/deps/openssl/openssl/include/internal/quic_reactor_wait_ctx.h
+++ b/deps/openssl/openssl/include/internal/quic_reactor_wait_ctx.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -56,12 +56,14 @@
  * QUIC_REACTOR_WAIT_CTX before commencing a blocking operation, and then calls
  * ossl_quic_reactor_wait_ctx_enter() whenever encountering a reactor involved
  * in the imminent blocking operation. Later it must ensure it calls
- * ossl_quic_reactor_wait_ctx_leave() the same number of times for each reactor.
- * enter() and leave() may be called multiple times for the same reactor and
- * wait context so long as the number of calls is balanced. The last leave()
- * call for a given thread's wait context *and a given reactor* causes that
- * reactor to do the inter-thread notification housekeeping needed for
- * multithreaded blocking to work correctly.
+ * ossl_quic_reactor_wait_ctx_deregister() the same number of times for
+ * each reactor. enter() and deregister() may be called multiple times for
+ * the same reactor and wait context so long as the number of calls is balanced.
+ * The last deregister() call for a given thread's wait context *and a given
+ * reactor* begins the reactor's inter-thread notification housekeeping
+ * (deregistration, which never blocks); ossl_quic_reactor_wait_ctx_drain()
+ * completes it. Both phases are needed for multithreaded blocking to work
+ * correctly.
  *
  * The gist is that a simple reactor-level counter of active concurrent blocking
  * calls across all threads is not accurate and we need an accurate count of how
@@ -75,7 +77,8 @@
  *   (QUIC_REACTOR *) -> (outstanding call count)
  *
  * When the count for a reactor transitions from 0 to a nonzero value, or vice
- * versa, ossl_quic_reactor_(enter/leave)_blocking_section() is called once.
+ * versa, ossl_quic_reactor_enter_blocking_section() /
+ * ossl_quic_reactor_deregister_blocking_section() is called once.
  *
  * The internal implementation is based on linked lists as we expect the actual
  * number of reactors involved in a given blocking operation to be very small,
@@ -97,19 +100,31 @@ void ossl_quic_reactor_wait_ctx_init(QUIC_REACTOR_WAIT_CTX *ctx);
 int ossl_quic_reactor_wait_ctx_enter(QUIC_REACTOR_WAIT_CTX *ctx,
     QUIC_REACTOR *rtor);

-/* Downrefs a given reactor. */
-void ossl_quic_reactor_wait_ctx_leave(QUIC_REACTOR_WAIT_CTX *ctx,
-    QUIC_REACTOR *rtor);
-
 /*
  * Destroys a wait context. Must be called after calling init().
  *
  * Precondition: All prior calls to ossl_quic_reactor_wait_ctx_enter() must have
- * been balanced with corresponding leave() calls before calling this
- * (unchecked).
+ * been balanced with corresponding deregister() calls, and
+ * ossl_quic_reactor_wait_ctx_drain() must have run for any reactor left
+ * signalled, before calling this (unchecked).
  */
 void ossl_quic_reactor_wait_ctx_cleanup(QUIC_REACTOR_WAIT_CTX *ctx);

+/*
+ * Two-phase leave support (see quic_reactor.h for the rationale and the
+ * deadlock it avoids). wait_ctx_deregister() is phase 1: it decrements
+ * the per-thread refcount and, on the 1->0 transition, deregisters from the
+ * reactor without blocking, recording whether phase 2 must wait and the
+ * generation to wait for. Caller must hold the reactor mutex.
+ * wait_ctx_drain() is phase 2: for every reactor phase 1 left signalled, it
+ * waits for that signal cycle to clear, acquiring each reactor's mutex
+ * internally.
+ */
+void ossl_quic_reactor_wait_ctx_deregister(QUIC_REACTOR_WAIT_CTX *ctx,
+    QUIC_REACTOR *rtor);
+
+void ossl_quic_reactor_wait_ctx_drain(QUIC_REACTOR_WAIT_CTX *ctx);
+
 #endif

 #endif
diff --git a/deps/openssl/openssl/include/internal/quic_record_tx.h b/deps/openssl/openssl/include/internal/quic_record_tx.h
index b2be046f8c6..d983d8bc792 100644
--- a/deps/openssl/openssl/include/internal/quic_record_tx.h
+++ b/deps/openssl/openssl/include/internal/quic_record_tx.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -306,6 +306,9 @@ size_t ossl_qtx_get_unflushed_pkt_count(OSSL_QTX *qtx);
  */
 void ossl_qtx_set_bio(OSSL_QTX *qtx, BIO *bio);

+/* Changes the MTU in bytes we use to send datagrams. */
+int ossl_qtx_set_mtu(OSSL_QTX *qtx, unsigned int mtu);
+
 /* Changes the MDPL. */
 int ossl_qtx_set_mdpl(OSSL_QTX *qtx, size_t mdpl);

diff --git a/deps/openssl/openssl/include/internal/quic_srtm.h b/deps/openssl/openssl/include/internal/quic_srtm.h
index 1a8f55da5df..251b71d457c 100644
--- a/deps/openssl/openssl/include/internal/quic_srtm.h
+++ b/deps/openssl/openssl/include/internal/quic_srtm.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,7 @@
 #define OSSL_INTERNAL_QUIC_SRTM_H
 #pragma once

+#include <stdint.h>
 #include "internal/e_os.h"
 #include "internal/time.h"
 #include "internal/quic_types.h"
@@ -69,11 +70,22 @@ void ossl_quic_srtm_free(QUIC_SRTM *srtm);
 int ossl_quic_srtm_add(QUIC_SRTM *srtm, void *opaque, uint64_t seq_num,
     const QUIC_STATELESS_RESET_TOKEN *token);

-/*
- * Removes an entry by identifying it via its (opaque, seq_num) tuple.
- * Returns 1 if the entry was found and removed, and 0 if it was not found.
+/**
+ * @brief Removes an entry identified by its (opaque, seq_num) tuple.
+ *
+ * The absence of a matching entry is not an error.
+ *
+ * @param srtm     SRTM instance to remove the entry from.
+ * @param opaque   Opaque pointer identifying the entry.
+ * @param seq_num  Sequence number identifying the entry.
+ * @param match    If non-NULL, @c *match is set to 1 if a matching entry was
+ *                 found or to 0 if not. May be NULL if this information is not
+ *                 required.
+ *
+ * @returns 1 on success and 0 on internal error.
  */
-int ossl_quic_srtm_remove(QUIC_SRTM *srtm, void *opaque, uint64_t seq_num);
+int ossl_quic_srtm_remove(QUIC_SRTM *srtm, void *opaque, uint64_t seq_num,
+    uint8_t *match);

 /*
  * Removes all entries (opaque, *) with the given opaque pointer.
diff --git a/deps/openssl/openssl/include/internal/quic_ssl.h b/deps/openssl/openssl/include/internal/quic_ssl.h
index a9c17e1087a..f7e554a9f04 100644
--- a/deps/openssl/openssl/include/internal/quic_ssl.h
+++ b/deps/openssl/openssl/include/internal/quic_ssl.h
@@ -107,8 +107,6 @@ __owur int ossl_quic_get_stream_type(SSL *s);
 __owur uint64_t ossl_quic_get_stream_id(SSL *s);
 __owur int ossl_quic_is_stream_local(SSL *s);
 __owur int ossl_quic_set_default_stream_mode(SSL *s, uint32_t mode);
-__owur SSL *ossl_quic_detach_stream(SSL *s);
-__owur int ossl_quic_attach_stream(SSL *conn, SSL *stream);
 __owur int ossl_quic_set_incoming_stream_policy(SSL *s, int policy,
     uint64_t aec);
 __owur SSL *ossl_quic_accept_stream(SSL *s, uint64_t flags);
@@ -120,6 +118,8 @@ __owur int ossl_quic_set_value_uint(SSL *s, uint32_t class_, uint32_t id,
 __owur SSL *ossl_quic_accept_connection(SSL *ssl, uint64_t flags);
 __owur size_t ossl_quic_get_accept_connection_queue_len(SSL *ssl);
 __owur int ossl_quic_listen(SSL *ssl);
+__owur int ossl_quic_get_peer_addr(SSL *ssl, BIO_ADDR *peer_addr);
+__owur int ossl_quic_peeloff_conn(SSL *listener, SSL *new_conn);

 __owur int ossl_quic_stream_reset(SSL *ssl,
     const SSL_STREAM_RESET_ARGS *args,
@@ -177,8 +177,14 @@ int ossl_quic_set_diag_title(SSL_CTX *ctx, const char *title);
 int ossl_quic_conn_poll_events(SSL *ssl, uint64_t events, int do_tick,
     uint64_t *revents);
 int ossl_quic_get_notifier_fd(SSL *ssl);
+/*
+ * Blocking-section registration. Multi-reactor callers (e.g. SSL_poll) must
+ * use ossl_quic_deregister_blocking_section() (phase 1, non-blocking) followed
+ * by ossl_quic_reactor_wait_ctx_drain() (phase 2); see quic_reactor.h.
+ */
 void ossl_quic_enter_blocking_section(SSL *ssl, QUIC_REACTOR_WAIT_CTX *wctx);
-void ossl_quic_leave_blocking_section(SSL *ssl, QUIC_REACTOR_WAIT_CTX *wctx);
+void ossl_quic_deregister_blocking_section(SSL *ssl,
+    QUIC_REACTOR_WAIT_CTX *wctx);
 QUIC_PORT *ossl_quic_listener_get_port(SSL *s);

 #endif
diff --git a/deps/openssl/openssl/include/internal/quic_stream_map.h b/deps/openssl/openssl/include/internal/quic_stream_map.h
index 53ed1fe94c9..3556bef38b9 100644
--- a/deps/openssl/openssl/include/internal/quic_stream_map.h
+++ b/deps/openssl/openssl/include/internal/quic_stream_map.h
@@ -137,16 +137,17 @@ struct quic_stream_st {
      *
      * DO NOT test these pointers (sstream, rstream) for NULL. Determine the
      * state of the send or receive stream part first using the appropriate
-     * function; then the invariant of that state guarantees that sstream or
-     * rstream either is or is not NULL respectively, therefore there is no
-     * valid use case for testing these pointers for NULL. In particular, a
-     * stream with a send part can still have sstream as NULL, and a stream with
-     * a receive part can still have rstream as NULL. QUIC_SSTREAM and
-     * QUIC_RSTREAM are stream buffer resource management objects which exist
-     * only when they need to for buffer management purposes. The existence or
-     * non-existence of a QUIC_SSTREAM or QUIC_RSTREAM object does not
-     * correspond with whether a stream's respective send or receive part
-     * logically exists or not.
+     * function (ossl_quic_stream_has_send_buffer() resp.
+     * ossl_quic_stream_has_recv_buffer()  ; then the invariant of that state
+     * guarantees that sstream or rstream either is or is not NULL respectively,
+     * therefore there is no valid use case for testing these pointers for NULL.
+     * In particular, stream with a send part can still have sstream as NULL,
+     * and a stream with a receive part can still have rstream as NULL.
+     * QUIC_SSTREAM and QUIC_RSTREAM are stream buffer resource management
+     * objects which exist only when they need to for buffer management
+     * purposes. The existence or non-existence of a QUIC_SSTREAM or
+     * QUIC_RSTREAM object does not correspond with whether a stream's
+     * respective send or receive part logically exists or not.
      */
     QUIC_SSTREAM *sstream; /* NULL if RX-only */
     QUIC_RSTREAM *rstream; /* NULL if TX only */
@@ -509,7 +510,7 @@ static ossl_inline ossl_unused int ossl_quic_stream_recv_get_final_size(const QU
  * Determines the number of bytes available still to be read, and (if
  * include_fin is 1) whether a FIN or reset has yet to be read.
  */
-static ossl_inline ossl_unused int ossl_quic_stream_recv_pending(const QUIC_STREAM *s,
+static ossl_inline ossl_unused size_t ossl_quic_stream_recv_pending(const QUIC_STREAM *s,
     int include_fin)
 {
     size_t avail;
@@ -554,6 +555,7 @@ static ossl_inline ossl_unused int ossl_quic_stream_recv_pending(const QUIC_STRE
  */
 struct quic_stream_map_st {
     LHASH_OF(QUIC_STREAM) *map;
+    QUIC_CHANNEL *ch;
     QUIC_STREAM_LIST_NODE active_list;
     QUIC_STREAM_LIST_NODE accept_list;
     QUIC_STREAM_LIST_NODE ready_for_gc_list;
@@ -564,7 +566,6 @@ struct quic_stream_map_st {
     void *get_stream_limit_cb_arg;
     QUIC_RXFC *max_streams_bidi_rxfc;
     QUIC_RXFC *max_streams_uni_rxfc;
-    int is_server;
 };

 /*
@@ -585,7 +586,7 @@ int ossl_quic_stream_map_init(QUIC_STREAM_MAP *qsm,
     void *get_stream_limit_cb_arg,
     QUIC_RXFC *max_streams_bidi_rxfc,
     QUIC_RXFC *max_streams_uni_rxfc,
-    int is_server);
+    QUIC_CHANNEL *ch);

 /*
  * Any streams still in the map will be released as though
@@ -832,6 +833,13 @@ void ossl_quic_stream_map_push_accept_queue(QUIC_STREAM_MAP *qsm,
  */
 QUIC_STREAM *ossl_quic_stream_map_peek_accept_queue(QUIC_STREAM_MAP *qsm);

+/*
+ * Returns the next item to be popped from the accept queue matching the given
+ * stream type, or NULL if it there are no items that match.
+ */
+QUIC_STREAM *ossl_quic_stream_map_find_in_accept_queue(QUIC_STREAM_MAP *qsm,
+    int is_uni);
+
 /*
  * Retires an incoming stream for the purposes of MAX_STREAMS RXFC, so that the
  * peer is granted credit for another stream. rtt is the estimated connection
diff --git a/deps/openssl/openssl/include/internal/quic_thread_assist.h b/deps/openssl/openssl/include/internal/quic_thread_assist.h
index fbfac146dab..a4a55a39790 100644
--- a/deps/openssl/openssl/include/internal/quic_thread_assist.h
+++ b/deps/openssl/openssl/include/internal/quic_thread_assist.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,8 @@
 #define OSSL_QUIC_THREAD_ASSIST_H

 #include <openssl/ssl.h>
+
+#include "internal/quic_channel.h"
 #include "internal/thread.h"
 #include "internal/time.h"

diff --git a/deps/openssl/openssl/include/internal/quic_tls.h b/deps/openssl/openssl/include/internal/quic_tls.h
index 707f7df9e37..03b755e960a 100644
--- a/deps/openssl/openssl/include/internal/quic_tls.h
+++ b/deps/openssl/openssl/include/internal/quic_tls.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -89,6 +89,9 @@ typedef struct quic_tls_args_st {

 QUIC_TLS *ossl_quic_tls_new(const QUIC_TLS_ARGS *args);

+/* Attach an SSL to an unconfigured, deferred handshake layer. */
+int ossl_quic_tls_set0_ssl(QUIC_TLS *qtls, SSL *ssl);
+
 void ossl_quic_tls_free(QUIC_TLS *qtls);

 int ossl_quic_tls_configure(QUIC_TLS *qtls);
diff --git a/deps/openssl/openssl/include/internal/quic_trace.h b/deps/openssl/openssl/include/internal/quic_trace.h
index f462ce0c009..d772a062ebe 100644
--- a/deps/openssl/openssl/include/internal/quic_trace.h
+++ b/deps/openssl/openssl/include/internal/quic_trace.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,6 +12,10 @@

 #ifndef OPENSSL_NO_QUIC

+#include <stddef.h>
+
+#include <openssl/ssl.h>
+
 int ossl_quic_trace(int write_p, int version, int content_type,
     const void *buf, size_t msglen, SSL *ssl, void *arg);

diff --git a/deps/openssl/openssl/include/internal/quic_txp.h b/deps/openssl/openssl/include/internal/quic_txp.h
index d94a79620d2..ef1faff5475 100644
--- a/deps/openssl/openssl/include/internal/quic_txp.h
+++ b/deps/openssl/openssl/include/internal/quic_txp.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -155,6 +155,10 @@ int ossl_quic_tx_packetiser_set_cur_scid(OSSL_QUIC_TX_PACKETISER *txp,
 int ossl_quic_tx_packetiser_set_peer(OSSL_QUIC_TX_PACKETISER *txp,
     const BIO_ADDR *peer);

+/* Change the ACK delay exponent the TXP uses to encode ACK frames. */
+int ossl_quic_tx_packetiser_set_ack_delay_exponent(OSSL_QUIC_TX_PACKETISER *txp,
+    uint32_t exp);
+
 /*
  * Change the QLOG instance retrieval function in use after instantiation.
  */
diff --git a/deps/openssl/openssl/include/internal/quic_types.h b/deps/openssl/openssl/include/internal/quic_types.h
index 8636912cd9e..984a9774dad 100644
--- a/deps/openssl/openssl/include/internal/quic_types.h
+++ b/deps/openssl/openssl/include/internal/quic_types.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -96,16 +96,17 @@ int ossl_quic_gen_rand_conn_id(OSSL_LIB_CTX *libctx, size_t len,

 #define QUIC_MIN_INITIAL_DGRAM_LEN 1200

+#define QUIC_MAX_MAX_UDP_PAYLOAD_SIZE 65527 /* RFC 9000 s. 18.2 */
+#define QUIC_DEFAULT_MAX_UDP_PAYLOAD_SIZE QUIC_MAX_MAX_UDP_PAYLOAD_SIZE
+
 #define QUIC_DEFAULT_ACK_DELAY_EXP 3
 #define QUIC_MAX_ACK_DELAY_EXP 20

 #define QUIC_DEFAULT_MAX_ACK_DELAY 25
+#define QUIC_MAX_MAX_ACK_DELAY 16383 /* RFC 9000 s. 18.2 */

 #define QUIC_MIN_ACTIVE_CONN_ID_LIMIT 2

-/* Arbitrary choice of default idle timeout (not an RFC value). */
-#define QUIC_DEFAULT_IDLE_TIMEOUT 30000
-
 #define QUIC_STATELESS_RESET_TOKEN_LEN 16

 typedef struct {
diff --git a/deps/openssl/openssl/include/internal/quic_vlint.h b/deps/openssl/openssl/include/internal/quic_vlint.h
index 61012f6da7d..b5750b23b90 100644
--- a/deps/openssl/openssl/include/internal/quic_vlint.h
+++ b/deps/openssl/openssl/include/internal/quic_vlint.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -54,7 +54,7 @@ static ossl_unused ossl_inline size_t ossl_quic_vlint_encode_len(uint64_t v)
 }

 /*
- * This function writes a QUIC varable-length encoded integer to buf.
+ * This function writes a QUIC variable-length encoded integer to buf.
  * The smallest usable representation is used.
  *
  * It is the caller's responsibility to ensure that the buffer is big enough by
@@ -96,7 +96,7 @@ void ossl_quic_vlint_encode_n(unsigned char *buf, uint64_t v, int n);
  */
 static ossl_unused ossl_inline size_t ossl_quic_vlint_decode_len(uint8_t first_byte)
 {
-    return 1U << ((first_byte & 0xC0) >> 6);
+    return (size_t)(1U << ((first_byte & 0xC0) >> 6));
 }

 /*
diff --git a/deps/openssl/openssl/include/internal/quic_wire.h b/deps/openssl/openssl/include/internal/quic_wire.h
index f2efabaeba1..8efd73979af 100644
--- a/deps/openssl/openssl/include/internal/quic_wire.h
+++ b/deps/openssl/openssl/include/internal/quic_wire.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -424,7 +424,7 @@ int ossl_quic_wire_encode_frame_conn_close(WPACKET *pkt,

 /*
  * Encodes a QUIC HANDSHAKE_DONE frame to the packet writer. This frame type
- * takes no arguiments.
+ * takes no arguments.
  */
 int ossl_quic_wire_encode_frame_handshake_done(WPACKET *pkt);

diff --git a/deps/openssl/openssl/include/internal/quic_wire_pkt.h b/deps/openssl/openssl/include/internal/quic_wire_pkt.h
index 657bad58b05..8014056c671 100644
--- a/deps/openssl/openssl/include/internal/quic_wire_pkt.h
+++ b/deps/openssl/openssl/include/internal/quic_wire_pkt.h
@@ -545,7 +545,7 @@ int ossl_quic_wire_get_pkt_hdr_dst_conn_id(const unsigned char *buf,
  * function returns non-zero does not guarantee that
  * ossl_quic_wire_encode_pkt_hdr() will succeed.
  */
-int ossl_quic_wire_get_encoded_pkt_hdr_len(size_t short_conn_id_len,
+size_t ossl_quic_wire_get_encoded_pkt_hdr_len(size_t short_conn_id_len,
     const QUIC_PKT_HDR *hdr);

 /*
diff --git a/deps/openssl/openssl/include/internal/rcu.h b/deps/openssl/openssl/include/internal/rcu.h
index b5403fbd772..780846d9399 100644
--- a/deps/openssl/openssl/include/internal/rcu.h
+++ b/deps/openssl/openssl/include/internal/rcu.h
@@ -21,7 +21,7 @@ typedef struct rcu_cb_item CRYPTO_RCU_CB_ITEM;

 CRYPTO_RCU_LOCK *ossl_rcu_lock_new(int num_writers, OSSL_LIB_CTX *ctx);
 void ossl_rcu_lock_free(CRYPTO_RCU_LOCK *lock);
-void ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock);
+int ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock);
 void ossl_rcu_write_lock(CRYPTO_RCU_LOCK *lock);
 void ossl_rcu_write_unlock(CRYPTO_RCU_LOCK *lock);
 void ossl_rcu_read_unlock(CRYPTO_RCU_LOCK *lock);
diff --git a/deps/openssl/openssl/include/internal/recordmethod.h b/deps/openssl/openssl/include/internal/recordmethod.h
index eedded636c2..21f82e6bdcd 100644
--- a/deps/openssl/openssl/include/internal/recordmethod.h
+++ b/deps/openssl/openssl/include/internal/recordmethod.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -56,6 +56,8 @@ typedef struct ossl_record_layer_st OSSL_RECORD_LAYER;
 struct ossl_record_template_st {
     unsigned char type;
     unsigned int version;
+    uint64_t sequence_number;
+    uint64_t epoch;
     const unsigned char *buf;
     size_t buflen;
 };
@@ -114,15 +116,17 @@ struct ossl_record_method_st {
         const char *propq, int vers,
         int role, int direction,
         int level,
-        uint16_t epoch,
+        uint64_t epoch,
         unsigned char *secret,
         size_t secretlen,
+        unsigned char *snkey,
         unsigned char *key,
         size_t keylen,
         unsigned char *iv,
         size_t ivlen,
         unsigned char *mackey,
         size_t mackeylen,
+        const EVP_CIPHER *snciph,
         const EVP_CIPHER *ciph,
         size_t taglen,
         int mactype,
@@ -132,8 +136,7 @@ struct ossl_record_method_st {
         BIO *prev,
         BIO *transport,
         BIO *next,
-        BIO_ADDR *local,
-        BIO_ADDR *peer,
+        int use_urxe,
         const OSSL_PARAM *settings,
         const OSSL_PARAM *options,
         const OSSL_DISPATCH *fns,
@@ -224,7 +227,7 @@ struct ossl_record_method_st {
      */
     int (*read_record)(OSSL_RECORD_LAYER *rl, void **rechandle, int *rversion,
         uint8_t *type, const unsigned char **data, size_t *datalen,
-        uint16_t *epoch, unsigned char *seq_num);
+        uint64_t *epoch, uint64_t *seq_num);
     /*
      * Release length bytes from a buffer associated with a record previously
      * read with read_record. Once all the bytes from a record are released, the
@@ -246,6 +249,21 @@ struct ossl_record_method_st {
      */
     int (*set1_bio)(OSSL_RECORD_LAYER *rl, BIO *bio);

+    /*
+     * Update the peer address for DTLS write record layers. When set
+     * (family != AF_UNSPEC), the record layer will use BIO_sendmmsg()
+     * with this address instead of BIO_write(). This is used by
+     * listener-created connections that share the listener's network BIO.
+     */
+    int (*set1_peer)(OSSL_RECORD_LAYER *rl, const BIO_ADDR *peer);
+
+    /*
+     * Set whether to use the URXE queue for reading. This is used by
+     * listener-created DTLS connections that receive data via the
+     * listener's demux rather than directly from a BIO.
+     */
+    void (*set_use_urxe)(OSSL_RECORD_LAYER *rl, int use_urxe);
+
     /* Called when protocol negotiation selects a protocol version to use */
     int (*set_protocol_version)(OSSL_RECORD_LAYER *rl, int version);

@@ -306,6 +324,31 @@ struct ossl_record_method_st {
      */
     int (*increment_sequence_ctr)(OSSL_RECORD_LAYER *rl);

+    /*
+     * Get the Sequence number
+     */
+    int (*get_sequence)(OSSL_RECORD_LAYER *rl, uint64_t *sequence);
+
+    /*
+     * Set the Sequence number to a specific value
+     */
+    int (*set_sequence)(OSSL_RECORD_LAYER *rl, uint64_t sequence);
+
+    /*
+     * Get the Epoch value
+     */
+    int (*get_epoch)(OSSL_RECORD_LAYER *rl, uint64_t *epoch);
+
+    /*
+     * Set the current MTU length to be used for the record layer.
+     */
+    int (*set_curr_mtu)(OSSL_RECORD_LAYER *rl, size_t curr_mtu);
+
+    /*
+     * Return number of records in the queue of unprocessed records
+     */
+    size_t (*unprocessed_records)(OSSL_RECORD_LAYER *rl);
+
     /*
      * Allocate read or write buffers. Does nothing if already allocated.
      * Assumes default buffer length and 1 pipeline.
@@ -317,6 +360,14 @@ struct ossl_record_method_st {
      * data. Buffers are automatically reallocated on next read/write.
      */
     int (*free_buffers)(OSSL_RECORD_LAYER *rl);
+
+    /*
+     * DTLS only. Instead of freeing previous record layer hand it over
+     * so that a retransmission arriving for the previous epoch can still
+     * be processed correctly. The current record layer takes ownership
+     * of the previous record layer.
+     */
+    int (*set_prev_epoch_rl)(OSSL_RECORD_LAYER *rl, OSSL_RECORD_LAYER *prev);
 };

 /* Standard built-in record methods */
diff --git a/deps/openssl/openssl/include/internal/refcount.h b/deps/openssl/openssl/include/internal/refcount.h
index 52a588bc3cb..7cc4ce660e1 100644
--- a/deps/openssl/openssl/include/internal/refcount.h
+++ b/deps/openssl/openssl/include/internal/refcount.h
@@ -14,6 +14,8 @@
 #include <openssl/trace.h>
 #include <openssl/err.h>

+#include <stdbool.h>
+
 #if defined(OPENSSL_THREADS) && !defined(OPENSSL_DEV_NO_ATOMICS)
 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
     && !defined(__STDC_NO_ATOMICS__)
@@ -36,10 +38,10 @@ typedef struct {
     _Atomic int val;
 } CRYPTO_REF_COUNT;

-static inline int CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
+static inline bool CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
 {
     *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
-    return 1;
+    return true;
 }

 /*
@@ -68,12 +70,6 @@ static inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
     return 1;
 }

-static inline int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
-{
-    *ret = atomic_load_explicit(&refcnt->val, memory_order_acquire);
-    return 1;
-}
-
 #elif defined(__GNUC__) && defined(__ATOMIC_RELAXED) && __GCC_ATOMIC_INT_LOCK_FREE > 0

 #define HAVE_ATOMICS 1
@@ -82,10 +78,10 @@ typedef struct {
     int val;
 } CRYPTO_REF_COUNT;

-static __inline__ int CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
+static __inline__ bool CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
 {
     *ret = __atomic_fetch_add(&refcnt->val, 1, __ATOMIC_RELAXED) + 1;
-    return 1;
+    return true;
 }

 static __inline__ int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
@@ -96,12 +92,6 @@ static __inline__ int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
     return 1;
 }

-static __inline__ int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
-{
-    *ret = __atomic_load_n(&refcnt->val, __ATOMIC_RELAXED);
-    return 1;
-}
-
 #elif defined(__ICL) && defined(_WIN32)
 #include <intrin.h>
 #define HAVE_ATOMICS 1
@@ -110,10 +100,10 @@ typedef struct {
     volatile long val;
 } CRYPTO_REF_COUNT;

-static __inline int CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
+static __inline bool CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
 {
     *ret = _InterlockedExchangeAdd(&refcnt->val, 1) + 1;
-    return 1;
+    return true;
 }

 static __inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
@@ -122,12 +112,6 @@ static __inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
     return 1;
 }

-static __inline int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
-{
-    *ret = _InterlockedExchangeAdd(&refcnt->val, 0);
-    return 1;
-}
-
 #elif defined(_MSC_VER) && _MSC_VER >= 1200

 #define HAVE_ATOMICS 1
@@ -136,16 +120,16 @@ typedef struct {
     volatile long val;
 } CRYPTO_REF_COUNT;

-#if (defined(_M_ARM) && _M_ARM >= 7 && !defined(_WIN32_WCE)) || defined(_M_ARM64)
+#if (defined(_M_ARM) && _M_ARM >= 7) || defined(_M_ARM64)
 #include <intrin.h>
 #if defined(_M_ARM64) && !defined(_ARM_BARRIER_ISH)
 #define _ARM_BARRIER_ISH _ARM64_BARRIER_ISH
 #endif

-static __inline int CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
+static __inline bool CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
 {
     *ret = _InterlockedExchangeAdd_nf(&refcnt->val, 1) + 1;
-    return 1;
+    return true;
 }

 static __inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
@@ -154,29 +138,13 @@ static __inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
     return 1;
 }

-static __inline int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
-{
-    *ret = _InterlockedExchangeAdd_acq(&refcnt->val, 0);
-    return 1;
-}
-
 #else
-#if !defined(_WIN32_WCE)
 #pragma intrinsic(_InterlockedExchangeAdd)
-#else
-#if _WIN32_WCE >= 0x600
-extern long __cdecl _InterlockedExchangeAdd(long volatile *, long);
-#else
-/* under Windows CE we still have old-style Interlocked* functions */
-extern long __cdecl InterlockedExchangeAdd(long volatile *, long);
-#define _InterlockedExchangeAdd InterlockedExchangeAdd
-#endif
-#endif

-static __inline int CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
+static __inline bool CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
 {
     *ret = _InterlockedExchangeAdd(&refcnt->val, 1) + 1;
-    return 1;
+    return true;
 }

 static __inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
@@ -185,12 +153,6 @@ static __inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
     return 1;
 }

-static __inline int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
-{
-    *ret = _InterlockedExchangeAdd(&refcnt->val, 0);
-    return 1;
-}
-
 #endif

 #endif
@@ -212,10 +174,10 @@ typedef struct {

 #ifdef OPENSSL_THREADS

-static ossl_unused ossl_inline int CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt,
+static ossl_unused ossl_inline bool CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt,
     int *ret)
 {
-    return CRYPTO_atomic_add(&refcnt->val, 1, ret, refcnt->lock);
+    return CRYPTO_atomic_add(&refcnt->val, 1, ret, refcnt->lock) ? true : false;
 }

 static ossl_unused ossl_inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt,
@@ -224,12 +186,6 @@ static ossl_unused ossl_inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt,
     return CRYPTO_atomic_add(&refcnt->val, -1, ret, refcnt->lock);
 }

-static ossl_unused ossl_inline int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt,
-    int *ret)
-{
-    return CRYPTO_atomic_load_int(&refcnt->val, ret, refcnt->lock);
-}
-
 #define CRYPTO_NEW_FREE_DEFINED 1
 static ossl_unused ossl_inline int CRYPTO_NEW_REF(CRYPTO_REF_COUNT *refcnt, int n)
 {
@@ -250,12 +206,12 @@ static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)

 #else /* OPENSSL_THREADS */

-static ossl_unused ossl_inline int CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt,
+static ossl_unused ossl_inline bool CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt,
     int *ret)
 {
     refcnt->val++;
     *ret = refcnt->val;
-    return 1;
+    return true;
 }

 static ossl_unused ossl_inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt,
@@ -266,13 +222,6 @@ static ossl_unused ossl_inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt,
     return 1;
 }

-static ossl_unused ossl_inline int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt,
-    int *ret)
-{
-    *ret = refcnt->val;
-    return 1;
-}
-
 #endif /* OPENSSL_THREADS */
 #endif

diff --git a/deps/openssl/openssl/include/internal/ring_buf.h b/deps/openssl/openssl/include/internal/ring_buf.h
index cc70bfaeac9..c8110e40ab4 100644
--- a/deps/openssl/openssl/include/internal/ring_buf.h
+++ b/deps/openssl/openssl/include/internal/ring_buf.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,7 +11,12 @@
 #define OSSL_INTERNAL_RING_BUF_H
 #pragma once

+#include <assert.h>
+#include <string.h>
+
 #include <openssl/e_os2.h> /* For 'ossl_inline' */
+#include <openssl/crypto.h>
+
 #include "internal/safe_math.h"

 /*
diff --git a/deps/openssl/openssl/include/internal/sha3.h b/deps/openssl/openssl/include/internal/sha3.h
index d67aa1e19f5..0e0ab76fb56 100644
--- a/deps/openssl/openssl/include/internal/sha3.h
+++ b/deps/openssl/openssl/include/internal/sha3.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,14 +17,14 @@

 #define KECCAK1600_WIDTH 1600
 #define SHA3_MDSIZE(bitlen) (bitlen / 8)
-#define KMAC_MDSIZE(bitlen) 2 * (bitlen / 8)
+#define CSHAKE_KECCAK_MDSIZE(bitlen) 2 * (bitlen / 8)
 #define SHA3_BLOCKSIZE(bitlen) (KECCAK1600_WIDTH - bitlen * 2) / 8

 typedef struct keccak_st KECCAK1600_CTX;

-typedef size_t(sha3_absorb_fn)(void *vctx, const void *in, size_t inlen);
-typedef int(sha3_final_fn)(void *vctx, unsigned char *out, size_t outlen);
-typedef int(sha3_squeeze_fn)(void *vctx, unsigned char *out, size_t outlen);
+typedef size_t(sha3_absorb_fn)(KECCAK1600_CTX *vctx, const unsigned char *in, size_t inlen);
+typedef int(sha3_final_fn)(KECCAK1600_CTX *vctx, unsigned char *out, size_t outlen);
+typedef int(sha3_squeeze_fn)(KECCAK1600_CTX *vctx, unsigned char *out, size_t outlen);

 typedef struct prov_sha3_meth_st {
     sha3_absorb_fn *absorb;
@@ -48,15 +48,92 @@ struct keccak_st {
     int xof_state;
 };

+KECCAK1600_CTX *ossl_shake256_new(void);
 void ossl_sha3_reset(KECCAK1600_CTX *ctx);
 int ossl_sha3_init(KECCAK1600_CTX *ctx, unsigned char pad, size_t bitlen);
 int ossl_keccak_init(KECCAK1600_CTX *ctx, unsigned char pad,
     size_t typelen, size_t mdlen);
-int ossl_sha3_update(KECCAK1600_CTX *ctx, const void *_inp, size_t len);
+
+int ossl_sha3_absorb(KECCAK1600_CTX *ctx, const unsigned char *in, size_t len);
 int ossl_sha3_final(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen);
 int ossl_sha3_squeeze(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen);

+size_t ossl_sha3_absorb_default(KECCAK1600_CTX *ctx, const unsigned char *inp, size_t len);
+int ossl_sha3_final_default(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen);
+int ossl_shake_squeeze_default(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen);
+
 size_t SHA3_absorb(uint64_t A[5][5], const unsigned char *inp, size_t len,
     size_t r);

+/* Multi-buffer (x4) Keccak-f[1600] context and API */
+#if defined(KECCAK1600_ASM)                                                               \
+    && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64)) \
+    && !defined(OPENSSL_NO_ASM)
+
+/* Runtime capability check for AVX512VL */
+int SHA3_avx512vl_capable(void);
+
+/* Context for 4-way parallel SHAKE operations */
+typedef struct {
+    /* 4 interleaved Keccak states (800 bytes)
+       plus 8 bytes to store the number of
+       already absorbed or not yet squeezed bytes */
+    uint64_t A[(25 * 4) + 1];
+    size_t rate; /* Rate in bytes: 168 (SHAKE-128) or 136 (SHAKE-256) */
+    unsigned finalized; /* Has finalize been called? 0=no, 1=yes */
+} KECCAK1600_X4_AVX512VL_CTX;
+
+/* SHAKE-128 x4 incremental API */
+void ossl_sha3_shake128_x4_inc_init_avx512vl(KECCAK1600_X4_AVX512VL_CTX *ctx);
+
+void ossl_sha3_shake128_x4_inc_absorb_avx512vl(
+    KECCAK1600_X4_AVX512VL_CTX *ctx,
+    const void *in0, const void *in1,
+    const void *in2, const void *in3,
+    size_t inlen);
+
+void ossl_sha3_shake128_x4_inc_cleanup_avx512vl(KECCAK1600_X4_AVX512VL_CTX *ctx);
+
+void ossl_sha3_shake128_x4_inc_squeeze_avx512vl(
+    void *out0, void *out1,
+    void *out2, void *out3,
+    size_t outlen,
+    KECCAK1600_X4_AVX512VL_CTX *ctx);
+
+/* SHAKE-256 x4 incremental API */
+void ossl_sha3_shake256_x4_inc_init_avx512vl(KECCAK1600_X4_AVX512VL_CTX *ctx);
+
+void ossl_sha3_shake256_x4_inc_absorb_avx512vl(
+    KECCAK1600_X4_AVX512VL_CTX *ctx,
+    const void *in0, const void *in1,
+    const void *in2, const void *in3,
+    size_t inlen);
+
+void ossl_sha3_shake256_x4_inc_cleanup_avx512vl(KECCAK1600_X4_AVX512VL_CTX *ctx);
+
+void ossl_sha3_shake256_x4_inc_squeeze_avx512vl(
+    void *out0, void *out1,
+    void *out2, void *out3,
+    size_t outlen,
+    KECCAK1600_X4_AVX512VL_CTX *ctx);
+
+/* Single-call SHAKE x4 APIs (wrapper functions) */
+void ossl_sha3_shake128_x4_avx512vl(
+    void *out0, void *out1,
+    void *out2, void *out3,
+    size_t outlen,
+    const void *in0, const void *in1,
+    const void *in2, const void *in3,
+    size_t inlen);
+
+void ossl_sha3_shake256_x4_avx512vl(
+    void *out0, void *out1,
+    void *out2, void *out3,
+    size_t outlen,
+    const void *in0, const void *in1,
+    const void *in2, const void *in3,
+    size_t inlen);
+
+#endif /* KECCAK1600_ASM && x86_64 && !OPENSSL_NO_ASM */
+
 #endif /* OSSL_INTERNAL_SHA3_H */
diff --git a/deps/openssl/openssl/include/internal/skey.h b/deps/openssl/openssl/include/internal/skey.h
index a4b6c6e6a9e..b731ce5dc33 100644
--- a/deps/openssl/openssl/include/internal/skey.h
+++ b/deps/openssl/openssl/include/internal/skey.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -10,6 +10,10 @@
 #ifndef OSSL_CRYPTO_SKEY_H
 #define OSSL_CRYPTO_SKEY_H

+#include <stddef.h>
+
+#include <openssl/types.h>
+
 /* Known symmetric key type definitions */
 #define SKEY_TYPE_GENERIC 1 /* generic bytes container unknown key types */
 #define SKEY_TYPE_AES 2 /* AES keys */
@@ -27,6 +31,15 @@ struct prov_skey_st {

     unsigned char *data;
     size_t length;
+
+    /* Metadata — set during import, returned during export / get_key_id */
+    char *alias;
+    unsigned char *local_keyid;
+    size_t local_keyid_len;
+    unsigned char *algorithm_oid;
+    size_t algorithm_oid_len;
+    unsigned char *algorithm_params;
+    size_t algorithm_params_len;
 };

 #endif /* OSSL_CRYPTO_SKEY_H */
diff --git a/deps/openssl/openssl/include/internal/sm3.h b/deps/openssl/openssl/include/internal/sm3.h
index 32a05ae9ef7..0c4c53d2fce 100644
--- a/deps/openssl/openssl/include/internal/sm3.h
+++ b/deps/openssl/openssl/include/internal/sm3.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2017 Ribose Inc. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -13,6 +13,8 @@
 #define OSSL_INTERNAL_SM3_H
 #pragma once

+#include <stddef.h>
+
 #include <openssl/opensslconf.h>

 #ifdef OPENSSL_NO_SM3
@@ -20,7 +22,7 @@
 #endif

 #define SM3_DIGEST_LENGTH 32
-#define SM3_WORD unsigned int
+typedef unsigned int SM3_WORD;

 #define SM3_CBLOCK 64
 #define SM3_LBLOCK (SM3_CBLOCK / 4)
diff --git a/deps/openssl/openssl/include/internal/sockets.h b/deps/openssl/openssl/include/internal/sockets.h
index 877bbd7145b..1da34aa7b06 100644
--- a/deps/openssl/openssl/include/internal/sockets.h
+++ b/deps/openssl/openssl/include/internal/sockets.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -37,18 +37,11 @@
 #include <netdb.h>
 #include <arpa/inet.h>
 #include <netinet/tcp.h>
-#elif defined(_WIN32_WCE) && _WIN32_WCE < 410
-#define getservbyname _masked_declaration_getservbyname
 #endif
 #if !defined(IPPROTO_IP)
 /* winsock[2].h was included already? */
 #include "internal/e_winsock.h"
 #endif
-#ifdef getservbyname
-/* this is used to be wcecompat/include/winsock_extras.h */
-#undef getservbyname
-struct servent *PASCAL getservbyname(const char *, const char *);
-#endif

 #ifdef _WIN64
 /*
@@ -73,6 +66,15 @@ struct servent *PASCAL getservbyname(const char *, const char *);
 #define SHUT_RDWR SD_BOTH
 #endif

+/*
+ * Recent MINGW versions use Windows-style unsigned INVALID_SOCKET.
+ * Since OpenSSL uses int, this only silences an already-ignored warning.
+ */
+#if defined(__MINGW32__) && defined(INVALID_SOCKET)
+#undef INVALID_SOCKET
+#define INVALID_SOCKET (INT_PTR)(~0)
+#endif
+
 #else
 #if defined(__APPLE__)
 /*
@@ -176,23 +178,40 @@ typedef size_t socklen_t; /* Currently appears to be missing on VMS */
 #define get_last_socket_error_is_eintr() (get_last_socket_error() == WSAEINTR)
 #define readsocket(s, b, n) recv((s), (b), (n), 0)
 #define writesocket(s, b, n) send((s), (b), (n), 0)
+#define writesocket_ex(s, b, n, f) send((s), (b), (n), (f))
 #elif defined(__DJGPP__)
 #define closesocket(s) close_s(s)
 #define readsocket(s, b, n) read_s(s, b, n)
 #define writesocket(s, b, n) send(s, b, n, 0)
+#define writesocket_ex(s, b, n, f) send(s, b, n, f)
 #elif defined(OPENSSL_SYS_VMS)
 #define ioctlsocket(a, b, c) ioctl(a, b, c)
 #define closesocket(s) close(s)
 #define readsocket(s, b, n) recv((s), (b), (n), 0)
 #define writesocket(s, b, n) send((s), (b), (n), 0)
+#define writesocket_ex(s, b, n, f) send((s), (b), (n), (f))
 #elif defined(OPENSSL_SYS_VXWORKS)
 #define ioctlsocket(a, b, c) ioctl((a), (b), (int)(c))
 #define closesocket(s) close(s)
 #define readsocket(s, b, n) read((s), (b), (n))
 #define writesocket(s, b, n) write((s), (char *)(b), (n))
+static ossl_inline int writesocket_ex(int s, char *b, int n, int f)
+{
+    if (f == 0)
+        return writesocket(s, b, n);
+    errno = EINVAL;
+    return -1;
+}
 #elif defined(OPENSSL_SYS_TANDEM)
 #define readsocket(s, b, n) read((s), (b), (n))
 #define writesocket(s, b, n) write((s), (b), (n))
+static ossl_inline int writesocket_ex(int s, const void *b, int n, int f)
+{
+    if (f == 0)
+        return writesocket(s, b, n);
+    errno = EINVAL;
+    return -1;
+}
 #define ioctlsocket(a, b, c) ioctl(a, b, c)
 #define closesocket(s) close(s)
 #else
@@ -200,10 +219,11 @@ typedef size_t socklen_t; /* Currently appears to be missing on VMS */
 #define closesocket(s) close(s)
 #define readsocket(s, b, n) read((s), (b), (n))
 #define writesocket(s, b, n) write((s), (b), (n))
+#define writesocket_ex(s, b, n, f) ((f) == 0) ? write((s), (b), (n)) : send((s), (b), (n), (f))
 #endif

 /* also in apps/include/apps.h */
-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINCE)
+#if defined(OPENSSL_SYS_WIN32)
 #define openssl_fdset(a, b) FD_SET((unsigned int)(a), b)
 #else
 #define openssl_fdset(a, b) FD_SET(a, b)
diff --git a/deps/openssl/openssl/include/internal/ssl.h b/deps/openssl/openssl/include/internal/ssl.h
index 5093f779e24..5de1399a986 100644
--- a/deps/openssl/openssl/include/internal/ssl.h
+++ b/deps/openssl/openssl/include/internal/ssl.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -18,16 +18,14 @@ typedef void (*ossl_msg_cb)(int write_p, int version, int content_type,

 int ossl_ssl_get_error(const SSL *s, int i, int check_err);

-/*
- * Test to see if an SSL_CTX is using a QUIC method
- * This is public in the master branch
- * but made private for current stable branches
- */
-int SSL_CTX_is_quic(const SSL_CTX *c);
-
 /* Set if this is the QUIC handshake layer */
 #define TLS1_FLAGS_QUIC 0x2000
 /* Set if this is our QUIC handshake layer */
 #define TLS1_FLAGS_QUIC_INTERNAL 0x4000

+/* We limit the number of key shares sent */
+#ifndef OPENSSL_CLIENT_MAX_KEY_SHARES
+#define OPENSSL_CLIENT_MAX_KEY_SHARES 4
+#endif
+
 #endif
diff --git a/deps/openssl/openssl/include/internal/ssl3_cbc.h b/deps/openssl/openssl/include/internal/ssl3_cbc.h
index 4c102693a0f..32e4e0b1965 100644
--- a/deps/openssl/openssl/include/internal/ssl3_cbc.h
+++ b/deps/openssl/openssl/include/internal/ssl3_cbc.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,16 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_INTERNAL_SSL3_CBC_H)
+#define OSSL_INTERNAL_SSL3_CBC_H
+
 #include <openssl/evp.h>

 /* tls_pad.c */
-int ssl3_cbc_remove_padding_and_mac(size_t *reclen,
-    size_t origreclen,
-    unsigned char *recdata,
-    unsigned char **mac,
-    int *alloced,
-    size_t block_size, size_t mac_size,
-    OSSL_LIB_CTX *libctx);

 int tls1_cbc_remove_padding_and_mac(size_t *reclen,
     size_t origreclen,
@@ -37,4 +33,6 @@ __owur int ssl3_cbc_digest_record(const EVP_MD *md,
     size_t data_size,
     size_t data_plus_mac_plus_padding_size,
     const unsigned char *mac_secret,
-    size_t mac_secret_length, char is_sslv3);
+    size_t mac_secret_length);
+
+#endif /* !defined(OSSL_INTERNAL_SSL3_CBC_H) */
diff --git a/deps/openssl/openssl/include/internal/ssl_unwrap.h b/deps/openssl/openssl/include/internal/ssl_unwrap.h
index ec6dbffa924..3c0f5ecfe1c 100644
--- a/deps/openssl/openssl/include/internal/ssl_unwrap.h
+++ b/deps/openssl/openssl/include/internal/ssl_unwrap.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -46,10 +46,18 @@ struct ssl_connection_st *ossl_quic_obj_get0_handshake_layer(QUIC_OBJ *obj);
     SSL_CONNECTION_FROM_SSL_ONLY_int(ssl, const)
 #endif

+#ifndef OPENSSL_NO_DTLS
+
+#define IS_DTLS(ssl) \
+    ((ssl) != NULL && ((ssl)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS) != 0)
+#else
+#define IS_DTLS(ssl) 0
+#endif
+
 #ifndef OPENSSL_NO_QUIC

 #define IS_QUIC_METHOD(m) \
-    ((m) == OSSL_QUIC_client_method() || (m) == OSSL_QUIC_client_thread_method() || (m) == OSSL_QUIC_server_method())
+    ((m) == OSSL_QUIC_client_method() || (m) == OSSL_QUIC_client_thread_method() || (m) == OSSL_QUIC_server_method() || (m) == OSSL_QUIC_method())

 #define IS_QUIC_CTX(ctx) IS_QUIC_METHOD((ctx)->method)

diff --git a/deps/openssl/openssl/include/internal/sslconf.h b/deps/openssl/openssl/include/internal/sslconf.h
index a7cec01bf62..45a41781540 100644
--- a/deps/openssl/openssl/include/internal/sslconf.h
+++ b/deps/openssl/openssl/include/internal/sslconf.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,11 +11,36 @@
 #define OSSL_INTERNAL_SSLCONF_H
 #pragma once

+#include <stddef.h>
+
+#include <openssl/conf.h>
+
 typedef struct ssl_conf_cmd_st SSL_CONF_CMD;

-const SSL_CONF_CMD *conf_ssl_get(size_t idx, const char **name, size_t *cnt);
-int conf_ssl_name_find(const char *name, size_t *idx);
-void conf_ssl_get_cmd(const SSL_CONF_CMD *cmd, size_t idx, char **cmdstr,
-    char **arg);
+/*
+ * SSL library configuration module placeholder. We load it here but defer
+ * all decisions about its contents to libssl.
+ */
+
+struct ssl_conf_name_st {
+    /* Name of this set of commands */
+    char *name;
+    /* List of commands */
+    SSL_CONF_CMD *cmds;
+    /* Number of commands */
+    size_t cmd_count;
+};
+
+struct ssl_conf_cmd_st {
+    /* Command */
+    char *cmd;
+    /* Argument */
+    char *arg;
+};
+
+const SSL_CONF_CMD *conf_ssl_get(CONF_IMODULE *m, size_t idx, const char **name,
+    size_t *cnt);
+int conf_ssl_name_find(CONF_IMODULE *m, const char *name, size_t *idx);
+void conf_ssl_get_cmd(const SSL_CONF_CMD *c, size_t idx, char **cmd, char **arg);

 #endif
diff --git a/deps/openssl/openssl/include/internal/statem.h b/deps/openssl/openssl/include/internal/statem.h
index a41ed322703..027853eccd6 100644
--- a/deps/openssl/openssl/include/internal/statem.h
+++ b/deps/openssl/openssl/include/internal/statem.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -9,6 +9,11 @@
 #ifndef OSSL_INTERNAL_STATEM_H
 #define OSSL_INTERNAL_STATEM_H

+#include <stddef.h>
+
+#include <openssl/e_os2.h>
+#include <openssl/ssl.h>
+
 /*****************************************************************************
  *                                                                           *
  * These enums should be considered PRIVATE to the state machine. No         *
@@ -81,6 +86,12 @@ typedef enum {
     CON_FUNC_DONT_SEND
 } CON_FUNC_RETURN;

+typedef enum {
+    ERROR_STATE_NOERROR = 0,
+    ERROR_STATE_SSL,
+    ERROR_STATE_SYSCALL
+} ERROR_STATE;
+
 typedef int (*ossl_statem_mutate_handshake_cb)(const unsigned char *msgin,
     size_t inlen,
     unsigned char **msgout,
@@ -106,6 +117,11 @@ struct ossl_statem_st {
     OSSL_HANDSHAKE_STATE hand_state;
     /* The handshake state requested by an API call (e.g. HelloRequest) */
     OSSL_HANDSHAKE_STATE request_state;
+    /* The handshake state to resume after sending an ACK */
+    OSSL_HANDSHAKE_STATE deferred_ack_state;
+    /* The handshake state before receiving an ACK */
+    OSSL_HANDSHAKE_STATE pre_ack_hand_state;
+    ERROR_STATE error_state;
     int in_init;
     int read_state_first_init;
     /* true when we are actually in SSL_accept() or SSL_connect() */
@@ -124,6 +140,8 @@ struct ossl_statem_st {
     ossl_statem_finish_mutate_handshake_cb finish_mutate_handshake_cb;
     void *mutatearg;
     unsigned int write_in_progress : 1;
+    /* Send an ACK for an already processed post-handshake message */
+    unsigned int ack_for_retransmit : 1;
 };
 typedef struct ossl_statem_st OSSL_STATEM;

diff --git a/deps/openssl/openssl/include/internal/thread_arch.h b/deps/openssl/openssl/include/internal/thread_arch.h
index d7fc08a8afa..fed6923394b 100644
--- a/deps/openssl/openssl/include/internal/thread_arch.h
+++ b/deps/openssl/openssl/include/internal/thread_arch.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,12 +11,9 @@
 #define OSSL_INTERNAL_THREAD_ARCH_H
 #include <openssl/configuration.h>
 #include <openssl/e_os2.h>
+#include "internal/e_os.h"
 #include "internal/time.h"

-#if defined(_WIN32)
-#include <windows.h>
-#endif
-
 #if defined(OPENSSL_THREADS) && defined(OPENSSL_SYS_UNIX)
 #define OPENSSL_THREADS_POSIX
 #elif defined(OPENSSL_THREADS) && defined(OPENSSL_SYS_VMS)
diff --git a/deps/openssl/openssl/include/internal/threads_common.h b/deps/openssl/openssl/include/internal/threads_common.h
new file mode 100644
index 00000000000..179edc5d7df
--- /dev/null
+++ b/deps/openssl/openssl/include/internal/threads_common.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef _CRYPTO_THREADS_COMMON_H_
+#define _CRYPTO_THREADS_COMMON_H_
+
+#include <openssl/types.h>
+
+#if defined(__clang__) && defined(__has_feature)
+#if __has_feature(thread_sanitizer)
+#define __SANITIZE_THREAD__
+#endif
+#endif
+
+#if defined(__SANITIZE_THREAD__)
+#include <sanitizer/tsan_interface.h>
+extern void AnnotateBenignRaceSized(const char *f, int l,
+    const volatile void *mem, unsigned int size, const char *desc);
+#define TSAN_BENIGN(x, desc) \
+    AnnotateBenignRaceSized(__FILE__, __LINE__, (x), sizeof(*(x)), desc);
+#else
+#define TSAN_BENIGN(x, desc)
+#endif
+
+typedef enum {
+    CRYPTO_THREAD_LOCAL_RCU_KEY = 0,
+    CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY,
+    CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY,
+    CRYPTO_THREAD_LOCAL_ERR_KEY,
+    CRYPTO_THREAD_LOCAL_ASYNC_CTX_KEY,
+    CRYPTO_THREAD_LOCAL_ASYNC_POOL_KEY,
+    CRYPTO_THREAD_LOCAL_TEVENT_KEY,
+    CRYPTO_THREAD_LOCAL_TANDEM_ID_KEY,
+    CRYPTO_THREAD_LOCAL_FIPS_DEFERRED_KEY,
+    CRYPTO_THREAD_LOCAL_RAND_SEED_KEY,
+    CRYPTO_THREAD_LOCAL_KEY_MAX
+} CRYPTO_THREAD_LOCAL_KEY_ID;
+
+#define CRYPTO_THREAD_NO_CONTEXT (void *)1
+
+void *CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_KEY_ID id,
+    OSSL_LIB_CTX *ctx);
+int CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_KEY_ID id,
+    OSSL_LIB_CTX *ctx, void *data);
+
+void CRYPTO_THREAD_clean_local(void);
+
+/* Do atomics work? */
+
+#if defined(__apple_build_version__) && __apple_build_version__ < 6000000
+/*
+ * OS/X 10.7 and 10.8 had a weird version of clang which has __ATOMIC_ACQUIRE and
+ * __ATOMIC_ACQ_REL but which expects only one parameter for __atomic_is_lock_free()
+ * rather than two which has signature __atomic_is_lock_free(sizeof(_Atomic(T))).
+ * All of this makes impossible to use __atomic_is_lock_free here.
+ *
+ * See: https://github.com/llvm/llvm-project/commit/a4c2602b714e6c6edb98164550a5ae829b2de760
+ */
+#define BROKEN_CLANG_ATOMICS
+#endif
+
+/*
+ * VC++ 2008 or earlier x86 compilers do not have an inline implementation
+ * of InterlockedOr64 for 32bit and will fail to run on Windows XP 32bit.
+ * https://docs.microsoft.com/en-us/cpp/intrinsics/interlockedor-intrinsic-functions#requirements
+ * To work around this problem, we implement a manual locking mechanism for
+ * only VC++ 2008 or earlier x86 compilers.
+ */
+
+#if defined(_MSC_VER)
+#if (!defined(_M_IX86) || _MSC_VER > 1600)
+#define OSSL_USE_INTERLOCKEDOR64
+#endif
+#elif defined(__MINGW64__)
+#define OSSL_USE_INTERLOCKEDOR64
+#endif
+
+#if defined(__GNUC__) && defined(__ATOMIC_ACQUIRE) && !defined(BROKEN_CLANG_ATOMICS) \
+    && !defined(USE_ATOMIC_FALLBACKS)
+#define OSSL_USE_GCC_ATOMICS
+#elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
+#define OSSL_USE_SOLARIS_ATOMICS
+#endif
+
+/* Allow us to know if atomics will be implemented with a fallback lock or not. */
+#if defined(OSSL_USE_GCC_ATOMICS) || defined(OSSL_USE_SOLARIS_ATOMICS) || defined(OSSL_USE_INTERLOCKEDOR64)
+#define OSSL_ATOMICS_LOCKLESS
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/internal/time.h b/deps/openssl/openssl/include/internal/time.h
index db182484277..c6f4c633353 100644
--- a/deps/openssl/openssl/include/internal/time.h
+++ b/deps/openssl/openssl/include/internal/time.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -54,8 +54,7 @@ typedef struct {
 OSSL_SAFE_MATH_UNSIGNED(time, uint64_t)

 /* Convert a tick count into a time */
-static ossl_unused ossl_inline OSSL_TIME
-ossl_ticks2time(uint64_t ticks)
+static ossl_unused ossl_inline OSSL_TIME ossl_ticks2time(uint64_t ticks)
 {
     OSSL_TIME r;

@@ -64,8 +63,7 @@ ossl_ticks2time(uint64_t ticks)
 }

 /* Convert a time to a tick count */
-static ossl_unused ossl_inline uint64_t
-ossl_time2ticks(OSSL_TIME t)
+static ossl_unused ossl_inline uint64_t ossl_time2ticks(OSSL_TIME t)
 {
     return t.t;
 }
@@ -74,14 +72,12 @@ ossl_time2ticks(OSSL_TIME t)
 OSSL_TIME ossl_time_now(void);

 /* The beginning and end of the time range */
-static ossl_unused ossl_inline OSSL_TIME
-ossl_time_zero(void)
+static ossl_unused ossl_inline OSSL_TIME ossl_time_zero(void)
 {
     return ossl_ticks2time(0);
 }

-static ossl_unused ossl_inline OSSL_TIME
-ossl_time_infinite(void)
+static ossl_unused ossl_inline OSSL_TIME ossl_time_infinite(void)
 {
     return ossl_ticks2time(~(uint64_t)0);
 }
@@ -110,8 +106,7 @@ static ossl_unused ossl_inline struct timeval ossl_time_to_timeval(OSSL_TIME t)
 }

 /* Convert timeval to time */
-static ossl_unused ossl_inline OSSL_TIME
-ossl_time_from_timeval(struct timeval tv)
+static ossl_unused ossl_inline OSSL_TIME ossl_time_from_timeval(struct timeval tv)
 {
     OSSL_TIME t;

@@ -124,16 +119,13 @@ ossl_time_from_timeval(struct timeval tv)
 }

 /* Convert OSSL_TIME to time_t */
-static ossl_unused ossl_inline
-    time_t
-    ossl_time_to_time_t(OSSL_TIME t)
+static ossl_unused ossl_inline time_t ossl_time_to_time_t(OSSL_TIME t)
 {
     return (time_t)(t.t / OSSL_TIME_SECOND);
 }

 /* Convert time_t to OSSL_TIME */
-static ossl_unused ossl_inline OSSL_TIME
-ossl_time_from_time_t(time_t t)
+static ossl_unused ossl_inline OSSL_TIME ossl_time_from_time_t(time_t t)
 {
     OSSL_TIME ot;

@@ -164,8 +156,7 @@ static ossl_unused ossl_inline int ossl_time_is_infinite(OSSL_TIME t)
     return ossl_time_compare(t, ossl_time_infinite()) == 0;
 }

-static ossl_unused ossl_inline OSSL_TIME
-ossl_time_add(OSSL_TIME a, OSSL_TIME b)
+static ossl_unused ossl_inline OSSL_TIME ossl_time_add(OSSL_TIME a, OSSL_TIME b)
 {
     OSSL_TIME r;
     int err = 0;
@@ -174,8 +165,7 @@ ossl_time_add(OSSL_TIME a, OSSL_TIME b)
     return err ? ossl_time_infinite() : r;
 }

-static ossl_unused ossl_inline OSSL_TIME
-ossl_time_subtract(OSSL_TIME a, OSSL_TIME b)
+static ossl_unused ossl_inline OSSL_TIME ossl_time_subtract(OSSL_TIME a, OSSL_TIME b)
 {
     OSSL_TIME r;
     int err = 0;
@@ -185,15 +175,13 @@ ossl_time_subtract(OSSL_TIME a, OSSL_TIME b)
 }

 /* Returns |a - b|. */
-static ossl_unused ossl_inline OSSL_TIME
-ossl_time_abs_difference(OSSL_TIME a, OSSL_TIME b)
+static ossl_unused ossl_inline OSSL_TIME ossl_time_abs_difference(OSSL_TIME a, OSSL_TIME b)
 {
     return a.t > b.t ? ossl_time_subtract(a, b)
                      : ossl_time_subtract(b, a);
 }

-static ossl_unused ossl_inline OSSL_TIME
-ossl_time_multiply(OSSL_TIME a, uint64_t b)
+static ossl_unused ossl_inline OSSL_TIME ossl_time_multiply(OSSL_TIME a, uint64_t b)
 {
     OSSL_TIME r;
     int err = 0;
@@ -202,8 +190,7 @@ ossl_time_multiply(OSSL_TIME a, uint64_t b)
     return err ? ossl_time_infinite() : r;
 }

-static ossl_unused ossl_inline OSSL_TIME
-ossl_time_divide(OSSL_TIME a, uint64_t b)
+static ossl_unused ossl_inline OSSL_TIME ossl_time_divide(OSSL_TIME a, uint64_t b)
 {
     OSSL_TIME r;
     int err = 0;
@@ -212,8 +199,7 @@ ossl_time_divide(OSSL_TIME a, uint64_t b)
     return err ? ossl_time_zero() : r;
 }

-static ossl_unused ossl_inline OSSL_TIME
-ossl_time_muldiv(OSSL_TIME a, uint64_t b, uint64_t c)
+static ossl_unused ossl_inline OSSL_TIME ossl_time_muldiv(OSSL_TIME a, uint64_t b, uint64_t c)
 {
     OSSL_TIME r;
     int err = 0;
@@ -223,15 +209,13 @@ ossl_time_muldiv(OSSL_TIME a, uint64_t b, uint64_t c)
 }

 /* Return higher of the two given time values. */
-static ossl_unused ossl_inline OSSL_TIME
-ossl_time_max(OSSL_TIME a, OSSL_TIME b)
+static ossl_unused ossl_inline OSSL_TIME ossl_time_max(OSSL_TIME a, OSSL_TIME b)
 {
     return a.t > b.t ? a : b;
 }

 /* Return the lower of the two given time values. */
-static ossl_unused ossl_inline OSSL_TIME
-ossl_time_min(OSSL_TIME a, OSSL_TIME b)
+static ossl_unused ossl_inline OSSL_TIME ossl_time_min(OSSL_TIME a, OSSL_TIME b)
 {
     return a.t < b.t ? a : b;
 }
diff --git a/deps/openssl/openssl/include/internal/tlsgroups.h b/deps/openssl/openssl/include/internal/tlsgroups.h
index 1fd41993ea7..f12e142b9a4 100644
--- a/deps/openssl/openssl/include/internal/tlsgroups.h
+++ b/deps/openssl/openssl/include/internal/tlsgroups.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,10 @@
 #define OSSL_INTERNAL_TLSGROUPS_H
 #pragma once

+#include <stdint.h>
+
+#include <openssl/e_os2.h> /* For 'ossl_inline' */
+
 #define OSSL_TLS_GROUP_ID_sect163k1 0x0001
 #define OSSL_TLS_GROUP_ID_sect163r1 0x0002
 #define OSSL_TLS_GROUP_ID_sect163r2 0x0003
@@ -51,6 +55,7 @@
 #define OSSL_TLS_GROUP_ID_gc512A 0x0026
 #define OSSL_TLS_GROUP_ID_gc512B 0x0027
 #define OSSL_TLS_GROUP_ID_gc512C 0x0028
+#define OSSL_TLS_GROUP_ID_curveSM2 0x0029
 #define OSSL_TLS_GROUP_ID_ffdhe2048 0x0100
 #define OSSL_TLS_GROUP_ID_ffdhe3072 0x0101
 #define OSSL_TLS_GROUP_ID_ffdhe4096 0x0102
@@ -62,5 +67,25 @@
 #define OSSL_TLS_GROUP_ID_SecP256r1MLKEM768 0x11EB
 #define OSSL_TLS_GROUP_ID_X25519MLKEM768 0x11EC
 #define OSSL_TLS_GROUP_ID_SecP384r1MLKEM1024 0x11ED
+#define OSSL_TLS_GROUP_ID_curveSM2MLKEM768 0x11EE
+
+/*
+ * RFC 7919: "Codepoints ... between 256 and 511, inclusive ... are set aside
+ * for FFDHE groups"
+ */
+#define OSSL_TLS_GROUP_ID_FFDHE_START 0x0100 /* inclusive */
+#define OSSL_TLS_GROUP_ID_FFDHE_END 0x01FF /* inclusive */
+
+static ossl_inline int is_ecdhe_group(const uint16_t group_id)
+{
+    /* This includes the usual EC groups, and also ECX, GOST ... */
+    return group_id < OSSL_TLS_GROUP_ID_FFDHE_START;
+}
+
+static ossl_inline int is_ffdhe_group(const uint16_t group_id)
+{
+    return group_id >= OSSL_TLS_GROUP_ID_FFDHE_START
+        && group_id <= OSSL_TLS_GROUP_ID_FFDHE_END;
+}

 #endif
diff --git a/deps/openssl/openssl/include/internal/tlssigalgs.h b/deps/openssl/openssl/include/internal/tlssigalgs.h
new file mode 100644
index 00000000000..f5aea80f64c
--- /dev/null
+++ b/deps/openssl/openssl/include/internal/tlssigalgs.h
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_INTERNAL_TLSSIGALGS_H
+#define OSSL_INTERNAL_TLSSIGALGS_H
+#pragma once
+
+/* Sigalgs values */
+#define TLSEXT_SIGALG_ecdsa_secp256r1_sha256 0x0403
+#define TLSEXT_SIGALG_ecdsa_secp384r1_sha384 0x0503
+#define TLSEXT_SIGALG_ecdsa_secp521r1_sha512 0x0603
+#define TLSEXT_SIGALG_ecdsa_sha224 0x0303
+#define TLSEXT_SIGALG_ecdsa_sha1 0x0203
+#define TLSEXT_SIGALG_rsa_pss_rsae_sha256 0x0804
+#define TLSEXT_SIGALG_rsa_pss_rsae_sha384 0x0805
+#define TLSEXT_SIGALG_rsa_pss_rsae_sha512 0x0806
+#define TLSEXT_SIGALG_rsa_pss_pss_sha256 0x0809
+#define TLSEXT_SIGALG_rsa_pss_pss_sha384 0x080a
+#define TLSEXT_SIGALG_rsa_pss_pss_sha512 0x080b
+#define TLSEXT_SIGALG_rsa_pkcs1_sha256 0x0401
+#define TLSEXT_SIGALG_rsa_pkcs1_sha384 0x0501
+#define TLSEXT_SIGALG_rsa_pkcs1_sha512 0x0601
+#define TLSEXT_SIGALG_rsa_pkcs1_sha224 0x0301
+#define TLSEXT_SIGALG_rsa_pkcs1_sha1 0x0201
+#define TLSEXT_SIGALG_dsa_sha256 0x0402
+#define TLSEXT_SIGALG_dsa_sha384 0x0502
+#define TLSEXT_SIGALG_dsa_sha512 0x0602
+#define TLSEXT_SIGALG_dsa_sha224 0x0302
+#define TLSEXT_SIGALG_dsa_sha1 0x0202
+#define TLSEXT_SIGALG_gostr34102012_256_intrinsic 0x0840
+#define TLSEXT_SIGALG_gostr34102012_512_intrinsic 0x0841
+#define TLSEXT_SIGALG_gostr34102012_256_gostr34112012_256 0xeeee
+#define TLSEXT_SIGALG_gostr34102012_512_gostr34112012_512 0xefef
+#define TLSEXT_SIGALG_gostr34102001_gostr3411 0xeded
+
+#define TLSEXT_SIGALG_sm2sig_sm3 0x0708
+#define TLSEXT_SIGALG_ed25519 0x0807
+#define TLSEXT_SIGALG_ed448 0x0808
+#define TLSEXT_SIGALG_ecdsa_brainpoolP256r1_sha256 0x081a
+#define TLSEXT_SIGALG_ecdsa_brainpoolP384r1_sha384 0x081b
+#define TLSEXT_SIGALG_ecdsa_brainpoolP512r1_sha512 0x081c
+#define TLSEXT_SIGALG_mldsa44 0x0904
+#define TLSEXT_SIGALG_mldsa65 0x0905
+#define TLSEXT_SIGALG_mldsa87 0x0906
+
+#define TLSEXT_SIGALG_slhdsa_sha2_128s 0x0911
+#define TLSEXT_SIGALG_slhdsa_sha2_128f 0x0912
+#define TLSEXT_SIGALG_slhdsa_sha2_192s 0x0913
+#define TLSEXT_SIGALG_slhdsa_sha2_192f 0x0914
+#define TLSEXT_SIGALG_slhdsa_sha2_256s 0x0915
+#define TLSEXT_SIGALG_slhdsa_sha2_256f 0x0916
+#define TLSEXT_SIGALG_slhdsa_shake_128s 0x0917
+#define TLSEXT_SIGALG_slhdsa_shake_128f 0x0918
+#define TLSEXT_SIGALG_slhdsa_shake_192s 0x0919
+#define TLSEXT_SIGALG_slhdsa_shake_192f 0x091a
+#define TLSEXT_SIGALG_slhdsa_shake_256s 0x091b
+#define TLSEXT_SIGALG_slhdsa_shake_256f 0x091c
+
+/* Sigalgs names */
+#define TLSEXT_SIGALG_ecdsa_secp256r1_sha256_name "ecdsa_secp256r1_sha256"
+#define TLSEXT_SIGALG_ecdsa_secp384r1_sha384_name "ecdsa_secp384r1_sha384"
+#define TLSEXT_SIGALG_ecdsa_secp521r1_sha512_name "ecdsa_secp521r1_sha512"
+#define TLSEXT_SIGALG_ecdsa_sha224_name "ecdsa_sha224"
+#define TLSEXT_SIGALG_ecdsa_sha1_name "ecdsa_sha1"
+#define TLSEXT_SIGALG_rsa_pss_rsae_sha256_name "rsa_pss_rsae_sha256"
+#define TLSEXT_SIGALG_rsa_pss_rsae_sha384_name "rsa_pss_rsae_sha384"
+#define TLSEXT_SIGALG_rsa_pss_rsae_sha512_name "rsa_pss_rsae_sha512"
+#define TLSEXT_SIGALG_rsa_pss_pss_sha256_name "rsa_pss_pss_sha256"
+#define TLSEXT_SIGALG_rsa_pss_pss_sha384_name "rsa_pss_pss_sha384"
+#define TLSEXT_SIGALG_rsa_pss_pss_sha512_name "rsa_pss_pss_sha512"
+#define TLSEXT_SIGALG_rsa_pkcs1_sha256_name "rsa_pkcs1_sha256"
+#define TLSEXT_SIGALG_rsa_pkcs1_sha384_name "rsa_pkcs1_sha384"
+#define TLSEXT_SIGALG_rsa_pkcs1_sha512_name "rsa_pkcs1_sha512"
+#define TLSEXT_SIGALG_rsa_pkcs1_sha224_name "rsa_pkcs1_sha224"
+#define TLSEXT_SIGALG_rsa_pkcs1_sha1_name "rsa_pkcs1_sha1"
+#define TLSEXT_SIGALG_dsa_sha256_name "dsa_sha256"
+#define TLSEXT_SIGALG_dsa_sha384_name "dsa_sha384"
+#define TLSEXT_SIGALG_dsa_sha512_name "dsa_sha512"
+#define TLSEXT_SIGALG_dsa_sha224_name "dsa_sha224"
+#define TLSEXT_SIGALG_dsa_sha1_name "dsa_sha1"
+#define TLSEXT_SIGALG_gostr34102012_256_intrinsic_name "gostr34102012_256"
+#define TLSEXT_SIGALG_gostr34102012_512_intrinsic_name "gostr34102012_512"
+#define TLSEXT_SIGALG_gostr34102012_256_intrinsic_alias "gost2012_256"
+#define TLSEXT_SIGALG_gostr34102012_512_intrinsic_alias "gost2012_512"
+#define TLSEXT_SIGALG_gostr34102012_256_gostr34112012_256_name "gost2012_256"
+#define TLSEXT_SIGALG_gostr34102012_512_gostr34112012_512_name "gost2012_512"
+#define TLSEXT_SIGALG_gostr34102001_gostr3411_name "gost2001_gost94"
+
+#define TLSEXT_SIGALG_sm2sig_sm3_name "sm2sig_sm3"
+#define TLSEXT_SIGALG_ed25519_name "ed25519"
+#define TLSEXT_SIGALG_ed448_name "ed448"
+#define TLSEXT_SIGALG_ecdsa_brainpoolP256r1_sha256_name "ecdsa_brainpoolP256r1tls13_sha256"
+#define TLSEXT_SIGALG_ecdsa_brainpoolP384r1_sha384_name "ecdsa_brainpoolP384r1tls13_sha384"
+#define TLSEXT_SIGALG_ecdsa_brainpoolP512r1_sha512_name "ecdsa_brainpoolP512r1tls13_sha512"
+#define TLSEXT_SIGALG_ecdsa_brainpoolP256r1_sha256_alias "ecdsa_brainpoolP256r1_sha256"
+#define TLSEXT_SIGALG_ecdsa_brainpoolP384r1_sha384_alias "ecdsa_brainpoolP384r1_sha384"
+#define TLSEXT_SIGALG_ecdsa_brainpoolP512r1_sha512_alias "ecdsa_brainpoolP512r1_sha512"
+#define TLSEXT_SIGALG_mldsa44_name "mldsa44"
+#define TLSEXT_SIGALG_mldsa65_name "mldsa65"
+#define TLSEXT_SIGALG_mldsa87_name "mldsa87"
+
+#define TLSEXT_SIGALG_slhdsa_sha2_128s_name "slhdsa_sha2_128s"
+#define TLSEXT_SIGALG_slhdsa_sha2_128f_name "slhdsa_sha2_128f"
+#define TLSEXT_SIGALG_slhdsa_sha2_192s_name "slhdsa_sha2_192s"
+#define TLSEXT_SIGALG_slhdsa_sha2_192f_name "slhdsa_sha2_192f"
+#define TLSEXT_SIGALG_slhdsa_sha2_256s_name "slhdsa_sha2_256s"
+#define TLSEXT_SIGALG_slhdsa_sha2_256f_name "slhdsa_sha2_256f"
+#define TLSEXT_SIGALG_slhdsa_shake_128s_name "slhdsa_shake_128s"
+#define TLSEXT_SIGALG_slhdsa_shake_128f_name "slhdsa_shake_128f"
+#define TLSEXT_SIGALG_slhdsa_shake_192s_name "slhdsa_shake_192s"
+#define TLSEXT_SIGALG_slhdsa_shake_192f_name "slhdsa_shake_192f"
+#define TLSEXT_SIGALG_slhdsa_shake_256s_name "slhdsa_shake_256s"
+#define TLSEXT_SIGALG_slhdsa_shake_256f_name "slhdsa_shake_256f"
+
+#endif
diff --git a/deps/openssl/openssl/include/internal/to_hex.h b/deps/openssl/openssl/include/internal/to_hex.h
index 36f4671c66b..f43f64a3c10 100644
--- a/deps/openssl/openssl/include/internal/to_hex.h
+++ b/deps/openssl/openssl/include/internal/to_hex.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,6 +11,8 @@
 #define OSSL_INTERNAL_TO_HEX_H
 #pragma once

+#include <openssl/e_os2.h>
+
 static ossl_inline size_t to_hex(char *buf, uint8_t n, const char hexdig[17])
 {
     *buf++ = hexdig[(n >> 4) & 0xf];
diff --git a/deps/openssl/openssl/include/internal/tsan_assist.h b/deps/openssl/openssl/include/internal/tsan_assist.h
index 87dbaba78f1..a4e87504a16 100644
--- a/deps/openssl/openssl/include/internal/tsan_assist.h
+++ b/deps/openssl/openssl/include/internal/tsan_assist.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -78,7 +78,7 @@
 #endif

 #elif defined(_MSC_VER) && _MSC_VER >= 1200 \
-    && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || defined(_M_ARM64) || (defined(_M_ARM) && _M_ARM >= 7 && !defined(_WIN32_WCE)))
+    && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || defined(_M_ARM64) || (defined(_M_ARM) && _M_ARM >= 7))
 /*
  * There is subtle dependency on /volatile:<iso|ms> command-line option.
  * "ms" implies same semantic as memory_order_acquire for loads and
@@ -99,10 +99,10 @@
 #define _InterlockedExchangeAdd64 _InterlockedExchangeAdd64_nf
 #pragma intrinsic(_InterlockedExchangeAdd64_nf)
 #pragma intrinsic(__iso_volatile_load64, __iso_volatile_store64)
-#define tsan_load(ptr) (sizeof(*(ptr)) == 8 ? __iso_volatile_load64(ptr) \
-                                            : __iso_volatile_load32(ptr))
-#define tsan_store(ptr, val) (sizeof(*(ptr)) == 8 ? __iso_volatile_store64((ptr), (val)) \
-                                                  : __iso_volatile_store32((ptr), (val)))
+#define tsan_load(ptr) (sizeof(*(ptr)) == 8 ? __iso_volatile_load64((void *)(ptr)) \
+                                            : __iso_volatile_load32((void *)(ptr)))
+#define tsan_store(ptr, val) (sizeof(*(ptr)) == 8 ? __iso_volatile_store64(((void *)(ptr)), (val)) \
+                                                  : __iso_volatile_store32((void *)(ptr), (val)))
 #else
 #define tsan_load(ptr) __iso_volatile_load32(ptr)
 #define tsan_store(ptr, val) __iso_volatile_store32((ptr), (val))
@@ -114,8 +114,8 @@
 #pragma intrinsic(_InterlockedExchangeAdd)
 #ifdef _WIN64
 #pragma intrinsic(_InterlockedExchangeAdd64)
-#define tsan_add(ptr, n) (sizeof(*(ptr)) == 8 ? _InterlockedExchangeAdd64((ptr), (n)) \
-                                              : _InterlockedExchangeAdd((ptr), (n)))
+#define tsan_add(ptr, n) (sizeof(*(ptr)) == 8 ? _InterlockedExchangeAdd64((void *)(ptr), (n)) \
+                                              : _InterlockedExchangeAdd((void *)(ptr), (n)))
 #else
 #define tsan_add(ptr, n) _InterlockedExchangeAdd((ptr), (n))
 #endif
@@ -137,7 +137,25 @@

 #define tsan_load(ptr) (*(ptr))
 #define tsan_store(ptr, val) (*(ptr) = (val))
-#define tsan_add(ptr, n) (*(ptr) += (n))
+
+static ossl_inline ossl_unused int64_t tsan_add_fallback64(int64_t *ptr, int64_t n)
+{
+    int64_t old = *ptr;
+    *ptr = old + n;
+    return old;
+}
+
+static ossl_inline ossl_unused int32_t tsan_add_fallback32(int32_t *ptr, int32_t n)
+{
+    int32_t old = *ptr;
+    *ptr = old + n;
+    return old;
+}
+
+#define tsan_add(ptr, n)                                              \
+    (sizeof(*(ptr)) == 8 ? tsan_add_fallback64((int64_t *)(ptr), (n)) \
+                         : tsan_add_fallback32((int32_t *)(ptr), (n)))
+
 /*
  * Lack of tsan_ld_acq and tsan_ld_rel means that compiler support is not
  * sophisticated enough to support them. Code that relies on them should be
diff --git a/deps/openssl/openssl/include/internal/unicode.h b/deps/openssl/openssl/include/internal/unicode.h
index 4ef53cd69c2..0add94d1116 100644
--- a/deps/openssl/openssl/include/internal/unicode.h
+++ b/deps/openssl/openssl/include/internal/unicode.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,10 +11,13 @@
 #define OSSL_INTERNAL_UNICODE_H
 #pragma once

+#include <openssl/e_os2.h>
+#include <stdint.h>
+
 typedef enum {
-    SURROGATE_MIN = 0xd800UL,
-    SURROGATE_MAX = 0xdfffUL,
-    UNICODE_MAX = 0x10ffffUL,
+    SURROGATE_MIN = UINT32_C(0xd800),
+    SURROGATE_MAX = UINT32_C(0xdfff),
+    UNICODE_MAX = UINT32_C(0x10ffff),
     UNICODE_LIMIT
 } UNICODE_CONSTANTS;

diff --git a/deps/openssl/openssl/include/internal/zeroization.h b/deps/openssl/openssl/include/internal/zeroization.h
new file mode 100644
index 00000000000..d30baa869a8
--- /dev/null
+++ b/deps/openssl/openssl/include/internal/zeroization.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * Utility functions for handling OPENSSL_PEDANTIC_ZEROIZATION.
+ *
+ * ISO 19790:2012/Cor.1:2015 7.9 requires cryptographic module to provide
+ * methods to zeroise all unprotected security sensitive parameters
+ * (which includes both Critical/Private and Public security parameters).
+ *
+ * To comply with these (arguably, unnecessarily onerous) requirements,
+ * freeing of public parameters is done via ossl_public_security_param_free()
+ * and ossl_public_security_param_bn_free() functions, and those implement
+ * the required behaviour if OPENSSL_PEDANTIC_ZEROIZATION is defined.
+ */
+
+#ifndef OSSL_INTERNAL_ZEROIZATION_H
+#define OSSL_INTERNAL_ZEROIZATION_H
+
+#include <openssl/bn.h>
+#include <openssl/crypto.h>
+#include <openssl/e_os2.h>
+
+static ossl_unused ossl_inline void
+ossl_public_param_free(void *ptr, size_t size)
+{
+#ifdef OPENSSL_PEDANTIC_ZEROIZATION
+    OPENSSL_clear_free(ptr, size);
+#else
+    OPENSSL_free(ptr);
+#endif
+}
+
+static ossl_unused ossl_inline void
+ossl_public_bn_free(BIGNUM *bn)
+{
+#ifdef OPENSSL_PEDANTIC_ZEROIZATION
+    BN_clear_free(bn);
+#else
+    BN_free(bn);
+#endif
+}
+
+#endif /* OSSL_INTERNAL_ZEROIZATION_H */
diff --git a/deps/openssl/openssl/include/openssl/aes.h b/deps/openssl/openssl/include/openssl/aes.h
index 2b6c6839882..cb00f4b504f 100644
--- a/deps/openssl/openssl/include/openssl/aes.h
+++ b/deps/openssl/openssl/include/openssl/aes.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -47,10 +47,10 @@ typedef struct aes_key_st AES_KEY;
 #ifndef OPENSSL_NO_DEPRECATED_3_0
 OSSL_DEPRECATEDIN_3_0 const char *AES_options(void);
 OSSL_DEPRECATEDIN_3_0
-int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
+int AES_set_encrypt_key(const unsigned char *userKey, int bits,
     AES_KEY *key);
 OSSL_DEPRECATEDIN_3_0
-int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
+int AES_set_decrypt_key(const unsigned char *userKey, int bits,
     AES_KEY *key);
 OSSL_DEPRECATEDIN_3_0
 void AES_encrypt(const unsigned char *in, unsigned char *out,
@@ -60,23 +60,23 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
     const AES_KEY *key);
 OSSL_DEPRECATEDIN_3_0
 void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
-    const AES_KEY *key, const int enc);
+    const AES_KEY *key, int enc);
 OSSL_DEPRECATEDIN_3_0
 void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const AES_KEY *key,
-    unsigned char *ivec, const int enc);
+    unsigned char *ivec, int enc);
 OSSL_DEPRECATEDIN_3_0
 void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const AES_KEY *key,
-    unsigned char *ivec, int *num, const int enc);
+    unsigned char *ivec, int *num, int enc);
 OSSL_DEPRECATEDIN_3_0
 void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const AES_KEY *key,
-    unsigned char *ivec, int *num, const int enc);
+    unsigned char *ivec, int *num, int enc);
 OSSL_DEPRECATEDIN_3_0
 void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const AES_KEY *key,
-    unsigned char *ivec, int *num, const int enc);
+    unsigned char *ivec, int *num, int enc);
 OSSL_DEPRECATEDIN_3_0
 void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const AES_KEY *key,
@@ -86,12 +86,12 @@ void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
 OSSL_DEPRECATEDIN_3_0
 void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const AES_KEY *key,
-    unsigned char *ivec, const int enc);
+    unsigned char *ivec, int enc);
 /* NB: the IV is _four_ blocks long */
 OSSL_DEPRECATEDIN_3_0
 void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
     size_t length, const AES_KEY *key, const AES_KEY *key2,
-    const unsigned char *ivec, const int enc);
+    const unsigned char *ivec, int enc);
 OSSL_DEPRECATEDIN_3_0
 int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
     unsigned char *out, const unsigned char *in,
diff --git a/deps/openssl/openssl/include/openssl/asn1.h b/deps/openssl/openssl/include/openssl/asn1.h
deleted file mode 100644
index cd9fc7cc706..00000000000
--- a/deps/openssl/openssl/include/openssl/asn1.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/asn1.h"
diff --git a/deps/openssl/openssl/include/openssl/asn1.h.in b/deps/openssl/openssl/include/openssl/asn1.h.in
index fd1fb05a1c9..4962a203c90 100644
--- a/deps/openssl/openssl/include/openssl/asn1.h.in
+++ b/deps/openssl/openssl/include/openssl/asn1.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -138,42 +138,8 @@ extern "C" {
 -}
 /* clang-format on */

-#define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
-/*
- * This indicates that the ASN1_STRING is not a real value but just a place
- * holder for the location where indefinite length constructed data should be
- * inserted in the memory buffer
- */
-#define ASN1_STRING_FLAG_NDEF 0x010
-
-/*
- * This flag is used by the CMS code to indicate that a string is not
- * complete and is a place holder for content when it had all been accessed.
- * The flag will be reset when content has been written to it.
- */
-
-#define ASN1_STRING_FLAG_CONT 0x020
-/*
- * This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING
- * type.
- */
-#define ASN1_STRING_FLAG_MSTRING 0x040
-/* String is embedded and only content should be freed */
-#define ASN1_STRING_FLAG_EMBED 0x080
-/* String should be parsed in RFC 5280's time format */
-#define ASN1_STRING_FLAG_X509_TIME 0x100
 /* This is the base type that holds just about everything :-) */
-struct asn1_string_st {
-    int length;
-    int type;
-    unsigned char *data;
-    /*
-     * The value of the following field depends on the type being held.  It
-     * is mostly being used for BIT_STRING so if the input data has a
-     * non-zero 'unused bits' value, it will be handled correctly
-     */
-    long flags;
-};
+struct asn1_string_st;

 /*
  * ASN1_ENCODING structure: this is used to save the received encoding of an
@@ -217,7 +183,7 @@ struct asn1_string_table_st {
 -}
 /* clang-format on */

-/* size limits: this stuff is taken straight from RFC2459 */
+/* size limits: this stuff is taken straight from RFC 5280 */

 #define ub_name 32768
 #define ub_common_name 64
@@ -233,7 +199,10 @@ struct asn1_string_table_st {
  */
 typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
 typedef struct ASN1_TLC_st ASN1_TLC;
-/* This is just an opaque pointer */
+/*
+ * This is deliberately used as an opaque pointer to a structure that
+ * is never defined. In other words it will behave like void *
+ */
 typedef struct ASN1_VALUE_st ASN1_VALUE;

 /* Declare ASN1 functions: the implement macro is in asn1t.h */
@@ -552,7 +521,11 @@ void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t);
 -}
 /* clang-format on */

-DECLARE_ASN1_FUNCTIONS(ASN1_OBJECT)
+#ifndef OPENSSL_NO_DEPRECATED_4_0
+OSSL_DEPRECATEDIN_4_0 ASN1_OBJECT *ASN1_OBJECT_new(void);
+#endif /* OPENSSL_NO_DEPRECATED_4_0 */
+void ASN1_OBJECT_free(ASN1_OBJECT *a);
+DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(extern, ASN1_OBJECT, ASN1_OBJECT)

 ASN1_STRING *ASN1_STRING_new(void);
 void ASN1_STRING_free(ASN1_STRING *a);
@@ -560,35 +533,51 @@ void ASN1_STRING_clear_free(ASN1_STRING *a);
 int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str);
 DECLARE_ASN1_DUP_FUNCTION(ASN1_STRING)
 ASN1_STRING *ASN1_STRING_type_new(int type);
+ASN1_STRING *ASN1_STRING_new_not_owned(int type, const uint8_t *data,
+    size_t length);
 int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b);
 /*
  * Since this is used to store all sorts of things, via macros, for now,
  * make its data void *
  */
+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+OSSL_DEPRECATEDIN_4_1_FOR("use ASN1_STRING_set1_data() or ASN1_STRING_set1_string()")
 int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
-void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
+OSSL_DEPRECATEDIN_4_1_FOR("use ASN1_STRING_get_length()")
 int ASN1_STRING_length(const ASN1_STRING *x);
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_1) */
+void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
+int ASN1_STRING_set1_data(ASN1_STRING *str, const uint8_t *data, size_t len);
+int ASN1_STRING_set1_string(ASN1_STRING *str, const char *cstring);
+size_t ASN1_STRING_get_length(const ASN1_STRING *x);
 #ifndef OPENSSL_NO_DEPRECATED_3_0
 OSSL_DEPRECATEDIN_3_0 void ASN1_STRING_length_set(ASN1_STRING *x, int n);
 #endif
 int ASN1_STRING_type(const ASN1_STRING *x);
-#ifndef OPENSSL_NO_DEPRECATED_1_1_0
-OSSL_DEPRECATEDIN_1_1_0 unsigned char *ASN1_STRING_data(ASN1_STRING *x);
-#endif
 const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x);

 DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING)
-int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length);
+#ifndef OPENSSL_NO_DEPRECATED_4_1
+OSSL_DEPRECATEDIN_4_1_FOR("use ASN1_BIT_STRING_set1()")
+int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a,
+    unsigned char *d, int length);
+#endif
 int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
 int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n);
 int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a,
     const unsigned char *flags, int flags_len);

-int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+OSSL_DEPRECATEDIN_4_1 int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
     BIT_STRING_BITNAME *tbl, int indent);
-int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl);
-int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value,
+OSSL_DEPRECATEDIN_4_1 int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl);
+OSSL_DEPRECATEDIN_4_1 int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value,
     BIT_STRING_BITNAME *tbl);
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_1) */
+int ASN1_BIT_STRING_get_length(const ASN1_BIT_STRING *abs, size_t *length,
+    int *unused_bits);
+int ASN1_BIT_STRING_set1(ASN1_BIT_STRING *abs, const uint8_t *data,
+    size_t length, int unused_bits);

 /* clang-format off */
 {-
@@ -641,8 +630,10 @@ DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING)
 DECLARE_ASN1_FUNCTIONS(ASN1_NULL)
 DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING)

-int UTF8_getc(const unsigned char *str, int len, unsigned long *val);
-int UTF8_putc(unsigned char *str, int len, unsigned long value);
+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+OSSL_DEPRECATEDIN_4_1 int UTF8_getc(const unsigned char *str, int len, unsigned long *val);
+OSSL_DEPRECATEDIN_4_1 int UTF8_putc(unsigned char *str, int len, unsigned long value);
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_1) */

 /* clang-format off */
 {-
diff --git a/deps/openssl/openssl/include/openssl/asn1err.h b/deps/openssl/openssl/include/openssl/asn1err.h
deleted file mode 100644
index 91756141b0f..00000000000
--- a/deps/openssl/openssl/include/openssl/asn1err.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_ASN1ERR_H
-#define OPENSSL_ASN1ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * ASN1 reason codes.
- */
-#define ASN1_R_ADDING_OBJECT 171
-#define ASN1_R_ASN1_PARSE_ERROR 203
-#define ASN1_R_ASN1_SIG_PARSE_ERROR 204
-#define ASN1_R_AUX_ERROR 100
-#define ASN1_R_BAD_OBJECT_HEADER 102
-#define ASN1_R_BAD_TEMPLATE 230
-#define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 214
-#define ASN1_R_BN_LIB 105
-#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106
-#define ASN1_R_BUFFER_TOO_SMALL 107
-#define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108
-#define ASN1_R_CONTEXT_NOT_INITIALISED 217
-#define ASN1_R_DATA_IS_WRONG 109
-#define ASN1_R_DECODE_ERROR 110
-#define ASN1_R_DEPTH_EXCEEDED 174
-#define ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED 198
-#define ASN1_R_ENCODE_ERROR 112
-#define ASN1_R_ERROR_GETTING_TIME 173
-#define ASN1_R_ERROR_LOADING_SECTION 172
-#define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114
-#define ASN1_R_EXPECTING_AN_INTEGER 115
-#define ASN1_R_EXPECTING_AN_OBJECT 116
-#define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119
-#define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120
-#define ASN1_R_FIELD_MISSING 121
-#define ASN1_R_FIRST_NUM_TOO_LARGE 122
-#define ASN1_R_GENERALIZEDTIME_IS_TOO_SHORT 232
-#define ASN1_R_HEADER_TOO_LONG 123
-#define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175
-#define ASN1_R_ILLEGAL_BOOLEAN 176
-#define ASN1_R_ILLEGAL_CHARACTERS 124
-#define ASN1_R_ILLEGAL_FORMAT 177
-#define ASN1_R_ILLEGAL_HEX 178
-#define ASN1_R_ILLEGAL_IMPLICIT_TAG 179
-#define ASN1_R_ILLEGAL_INTEGER 180
-#define ASN1_R_ILLEGAL_NEGATIVE_VALUE 226
-#define ASN1_R_ILLEGAL_NESTED_TAGGING 181
-#define ASN1_R_ILLEGAL_NULL 125
-#define ASN1_R_ILLEGAL_NULL_VALUE 182
-#define ASN1_R_ILLEGAL_OBJECT 183
-#define ASN1_R_ILLEGAL_OPTIONAL_ANY 126
-#define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170
-#define ASN1_R_ILLEGAL_PADDING 221
-#define ASN1_R_ILLEGAL_TAGGED_ANY 127
-#define ASN1_R_ILLEGAL_TIME_VALUE 184
-#define ASN1_R_ILLEGAL_ZERO_CONTENT 222
-#define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185
-#define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128
-#define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 220
-#define ASN1_R_INVALID_BMPSTRING_LENGTH 129
-#define ASN1_R_INVALID_DIGIT 130
-#define ASN1_R_INVALID_MIME_TYPE 205
-#define ASN1_R_INVALID_MODIFIER 186
-#define ASN1_R_INVALID_NUMBER 187
-#define ASN1_R_INVALID_OBJECT_ENCODING 216
-#define ASN1_R_INVALID_SCRYPT_PARAMETERS 227
-#define ASN1_R_INVALID_SEPARATOR 131
-#define ASN1_R_INVALID_STRING_TABLE_VALUE 218
-#define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133
-#define ASN1_R_INVALID_UTF8STRING 134
-#define ASN1_R_INVALID_VALUE 219
-#define ASN1_R_LENGTH_TOO_LONG 231
-#define ASN1_R_LIST_ERROR 188
-#define ASN1_R_MIME_NO_CONTENT_TYPE 206
-#define ASN1_R_MIME_PARSE_ERROR 207
-#define ASN1_R_MIME_SIG_PARSE_ERROR 208
-#define ASN1_R_MISSING_EOC 137
-#define ASN1_R_MISSING_SECOND_NUMBER 138
-#define ASN1_R_MISSING_VALUE 189
-#define ASN1_R_MSTRING_NOT_UNIVERSAL 139
-#define ASN1_R_MSTRING_WRONG_TAG 140
-#define ASN1_R_NESTED_ASN1_STRING 197
-#define ASN1_R_NESTED_TOO_DEEP 201
-#define ASN1_R_NON_HEX_CHARACTERS 141
-#define ASN1_R_NOT_ASCII_FORMAT 190
-#define ASN1_R_NOT_ENOUGH_DATA 142
-#define ASN1_R_NO_CONTENT_TYPE 209
-#define ASN1_R_NO_MATCHING_CHOICE_TYPE 143
-#define ASN1_R_NO_MULTIPART_BODY_FAILURE 210
-#define ASN1_R_NO_MULTIPART_BOUNDARY 211
-#define ASN1_R_NO_SIG_CONTENT_TYPE 212
-#define ASN1_R_NULL_IS_WRONG_LENGTH 144
-#define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191
-#define ASN1_R_ODD_NUMBER_OF_CHARS 145
-#define ASN1_R_SECOND_NUMBER_TOO_LARGE 147
-#define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148
-#define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149
-#define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192
-#define ASN1_R_SHORT_LINE 150
-#define ASN1_R_SIG_INVALID_MIME_TYPE 213
-#define ASN1_R_STREAMING_NOT_SUPPORTED 202
-#define ASN1_R_STRING_TOO_LONG 151
-#define ASN1_R_STRING_TOO_SHORT 152
-#define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154
-#define ASN1_R_TIME_NOT_ASCII_FORMAT 193
-#define ASN1_R_TOO_LARGE 223
-#define ASN1_R_TOO_LONG 155
-#define ASN1_R_TOO_SMALL 224
-#define ASN1_R_TYPE_NOT_CONSTRUCTED 156
-#define ASN1_R_TYPE_NOT_PRIMITIVE 195
-#define ASN1_R_UNEXPECTED_EOC 159
-#define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 215
-#define ASN1_R_UNKNOWN_DIGEST 229
-#define ASN1_R_UNKNOWN_FORMAT 160
-#define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161
-#define ASN1_R_UNKNOWN_OBJECT_TYPE 162
-#define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163
-#define ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM 199
-#define ASN1_R_UNKNOWN_TAG 194
-#define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164
-#define ASN1_R_UNSUPPORTED_CIPHER 228
-#define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167
-#define ASN1_R_UNSUPPORTED_TYPE 196
-#define ASN1_R_UTCTIME_IS_TOO_SHORT 233
-#define ASN1_R_WRONG_INTEGER_TYPE 225
-#define ASN1_R_WRONG_PUBLIC_KEY_TYPE 200
-#define ASN1_R_WRONG_TAG 168
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/asn1t.h b/deps/openssl/openssl/include/openssl/asn1t.h
deleted file mode 100644
index 6ff4f574949..00000000000
--- a/deps/openssl/openssl/include/openssl/asn1t.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/asn1t.h"
diff --git a/deps/openssl/openssl/include/openssl/asn1t.h.in b/deps/openssl/openssl/include/openssl/asn1t.h.in
index ca8bbc2517d..1564aae371e 100644
--- a/deps/openssl/openssl/include/openssl/asn1t.h.in
+++ b/deps/openssl/openssl/include/openssl/asn1t.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -747,6 +747,7 @@ typedef struct ASN1_STREAM_ARG_st {
 #define ASN1_OP_DUP_POST 15
 #define ASN1_OP_GET0_LIBCTX 16
 #define ASN1_OP_GET0_PROPQ 17
+#define ASN1_OP_GET0_STREAM_CONTENT 18

 /* Macro to implement a primitive type */
 #define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0)
diff --git a/deps/openssl/openssl/include/openssl/asyncerr.h b/deps/openssl/openssl/include/openssl/asyncerr.h
deleted file mode 100644
index 41bd4a0391a..00000000000
--- a/deps/openssl/openssl/include/openssl/asyncerr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_ASYNCERR_H
-#define OPENSSL_ASYNCERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * ASYNC reason codes.
- */
-#define ASYNC_R_FAILED_TO_SET_POOL 101
-#define ASYNC_R_FAILED_TO_SWAP_CONTEXT 102
-#define ASYNC_R_INIT_FAILED 105
-#define ASYNC_R_INVALID_POOL_SIZE 103
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/bio.h b/deps/openssl/openssl/include/openssl/bio.h
deleted file mode 100644
index dcece3cb4d6..00000000000
--- a/deps/openssl/openssl/include/openssl/bio.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/bio.h"
diff --git a/deps/openssl/openssl/include/openssl/bio.h.in b/deps/openssl/openssl/include/openssl/bio.h.in
index ba8e81e7084..a2a5972980d 100644
--- a/deps/openssl/openssl/include/openssl/bio.h.in
+++ b/deps/openssl/openssl/include/openssl/bio.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -230,6 +230,17 @@ extern "C" {
 #define BIO_FLAGS_UPLINK 0
 #endif

+/* the BIO FLAGS values 0x10 to 0x80 are reserved for internal use */
+
+/*
+ * BIO FLAGS in the range 0x0100..0x8000 are BIO-type specific.
+ * Their meaning is defined by the particular BIO implementation and
+ * is not shared across different BIO types. The same bit value may
+ * have a different meaning or no meaning at all in other BIOs.
+ * Such flags may be part of the public API or internal to the BIO.
+ */
+
+/* This is used with base64 BIO */
 #define BIO_FLAGS_BASE64_NO_NL 0x100

 /*
@@ -241,8 +252,6 @@ extern "C" {
 #define BIO_FLAGS_NONCLEAR_RST 0x400
 #define BIO_FLAGS_IN_EOF 0x800

-/* the BIO FLAGS values 0x1000 to 0x8000 are reserved for internal KTLS flags */
-
 typedef union bio_addr_st BIO_ADDR;
 typedef struct bio_addrinfo_st BIO_ADDRINFO;

@@ -475,6 +484,7 @@ typedef struct bio_poll_descriptor_st {
 #define BIO_C_SET_SOCK_TYPE 157
 #define BIO_C_GET_SOCK_TYPE 158
 #define BIO_C_GET_DGRAM_BIO 159
+#define BIO_C_SET_SEND_FLAGS 160

 #define BIO_set_app_data(s, arg) BIO_set_ex_data(s, 0, arg)
 #define BIO_get_app_data(s) BIO_get_ex_data(s, 0)
@@ -607,7 +617,6 @@ int BIO_read_filename(BIO *b, const char *name);
 #define BIO_dup_state(b, ret) BIO_ctrl(b, BIO_CTRL_DUP, 0, (char *)(ret))

 #define BIO_reset(b) (int)BIO_ctrl(b, BIO_CTRL_RESET, 0, NULL)
-#define BIO_eof(b) (int)BIO_ctrl(b, BIO_CTRL_EOF, 0, NULL)
 #define BIO_set_close(b, c) (int)BIO_ctrl(b, BIO_CTRL_SET_CLOSE, (c), NULL)
 #define BIO_get_close(b) (int)BIO_ctrl(b, BIO_CTRL_GET_CLOSE, 0, NULL)
 #define BIO_pending(b) (int)BIO_ctrl(b, BIO_CTRL_PENDING, 0, NULL)
@@ -733,6 +742,7 @@ __owur int BIO_get_wpoll_descriptor(BIO *b, BIO_POLL_DESCRIPTOR *desc);
 int BIO_puts(BIO *bp, const char *buf);
 int BIO_indent(BIO *b, int indent, int max);
 long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg);
+int BIO_eof(BIO *b);
 long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp);
 void *BIO_ptr_ctrl(BIO *bp, int cmd, long larg);
 long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg);
@@ -796,7 +806,9 @@ int BIO_sock_should_retry(int i);
 int BIO_sock_non_fatal_error(int error);
 int BIO_err_is_non_fatal(unsigned int errcode);
 int BIO_socket_wait(int fd, int for_read, time_t max_time);
+int BIO_socket_ready(int fd, int for_read);
 #endif
+long BIO_set_send_flags(BIO *b, int flags);
 int BIO_wait(BIO *bio, time_t max_time, unsigned int nap_milliseconds);
 int BIO_do_connect_retry(BIO *bio, int timeout, int nap_milliseconds);

@@ -921,33 +933,24 @@ void BIO_copy_next_retry(BIO *b);
  */

 #define ossl_bio__attr__(x)
-#if defined(__GNUC__) && defined(__STDC_VERSION__)    \
-    && !defined(__MINGW32__) && !defined(__MINGW64__) \
+#if defined(__GNUC__) && !defined(__MINGW32__) && !defined(__MINGW64__) \
     && !defined(__APPLE__)
-/*
- * Because we support the 'z' modifier, which made its appearance in C99,
- * we can't use __attribute__ with pre C99 dialects.
- */
-#if __STDC_VERSION__ >= 199901L
 #undef ossl_bio__attr__
 #define ossl_bio__attr__ __attribute__
-#if __GNUC__ * 10 + __GNUC_MINOR__ >= 44
-#define ossl_bio__printf__ __gnu_printf__
-#else
-#define ossl_bio__printf__ __printf__
-#endif
-#endif
 #endif
 int BIO_printf(BIO *bio, const char *format, ...)
-    ossl_bio__attr__((__format__(ossl_bio__printf__, 2, 3)));
+    ossl_bio__attr__((__format__(__printf__, 2, 3)));
 int BIO_vprintf(BIO *bio, const char *format, va_list args)
-    ossl_bio__attr__((__format__(ossl_bio__printf__, 2, 0)));
+    ossl_bio__attr__((__format__(__printf__, 2, 0)));
+#ifndef OPENSSL_NO_DEPRECATED_4_1
+OSSL_DEPRECATEDIN_4_1_FOR("use snprintf()")
 int BIO_snprintf(char *buf, size_t n, const char *format, ...)
-    ossl_bio__attr__((__format__(ossl_bio__printf__, 3, 4)));
+    ossl_bio__attr__((__format__(__printf__, 3, 4)));
+OSSL_DEPRECATEDIN_4_1_FOR("use vsnprintf()")
 int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
-    ossl_bio__attr__((__format__(ossl_bio__printf__, 3, 0)));
+    ossl_bio__attr__((__format__(__printf__, 3, 0)));
+#endif
 #undef ossl_bio__attr__
-#undef ossl_bio__printf__

 BIO_METHOD *BIO_meth_new(int type, const char *name);
 void BIO_meth_free(BIO_METHOD *biom);
diff --git a/deps/openssl/openssl/include/openssl/bioerr.h b/deps/openssl/openssl/include/openssl/bioerr.h
deleted file mode 100644
index b4ee5c68bee..00000000000
--- a/deps/openssl/openssl/include/openssl/bioerr.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_BIOERR_H
-#define OPENSSL_BIOERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * BIO reason codes.
- */
-#define BIO_R_ACCEPT_ERROR 100
-#define BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET 141
-#define BIO_R_AMBIGUOUS_HOST_OR_SERVICE 129
-#define BIO_R_BAD_FOPEN_MODE 101
-#define BIO_R_BROKEN_PIPE 124
-#define BIO_R_CONNECT_ERROR 103
-#define BIO_R_CONNECT_TIMEOUT 147
-#define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107
-#define BIO_R_GETSOCKNAME_ERROR 132
-#define BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS 133
-#define BIO_R_GETTING_SOCKTYPE 134
-#define BIO_R_INVALID_ARGUMENT 125
-#define BIO_R_INVALID_SOCKET 135
-#define BIO_R_IN_USE 123
-#define BIO_R_LENGTH_TOO_LONG 102
-#define BIO_R_LISTEN_V6_ONLY 136
-#define BIO_R_LOCAL_ADDR_NOT_AVAILABLE 111
-#define BIO_R_LOOKUP_RETURNED_NOTHING 142
-#define BIO_R_MALFORMED_HOST_OR_SERVICE 130
-#define BIO_R_NBIO_CONNECT_ERROR 110
-#define BIO_R_NON_FATAL 112
-#define BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED 143
-#define BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED 144
-#define BIO_R_NO_PORT_DEFINED 113
-#define BIO_R_NO_SUCH_FILE 128
-#define BIO_R_NULL_PARAMETER 115 /* unused */
-#define BIO_R_TFO_DISABLED 106
-#define BIO_R_TFO_NO_KERNEL_SUPPORT 108
-#define BIO_R_TRANSFER_ERROR 104
-#define BIO_R_TRANSFER_TIMEOUT 105
-#define BIO_R_UNABLE_TO_BIND_SOCKET 117
-#define BIO_R_UNABLE_TO_CREATE_SOCKET 118
-#define BIO_R_UNABLE_TO_KEEPALIVE 137
-#define BIO_R_UNABLE_TO_LISTEN_SOCKET 119
-#define BIO_R_UNABLE_TO_NODELAY 138
-#define BIO_R_UNABLE_TO_REUSEADDR 139
-#define BIO_R_UNABLE_TO_TFO 109
-#define BIO_R_UNAVAILABLE_IP_FAMILY 145
-#define BIO_R_UNINITIALIZED 120
-#define BIO_R_UNKNOWN_INFO_TYPE 140
-#define BIO_R_UNSUPPORTED_IP_FAMILY 146
-#define BIO_R_UNSUPPORTED_METHOD 121
-#define BIO_R_UNSUPPORTED_PROTOCOL_FAMILY 131
-#define BIO_R_WRITE_TO_READ_ONLY_BIO 126
-#define BIO_R_WSASTARTUP 122
-#define BIO_R_PORT_MISMATCH 150
-#define BIO_R_PEER_ADDR_NOT_AVAILABLE 151
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/blowfish.h b/deps/openssl/openssl/include/openssl/blowfish.h
index 49c74e946ce..a1f678855b8 100644
--- a/deps/openssl/openssl/include/openssl/blowfish.h
+++ b/deps/openssl/openssl/include/openssl/blowfish.h
@@ -36,7 +36,7 @@ extern "C" {
  * ! BF_LONG has to be at least 32 bits wide.                     !
  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  */
-#define BF_LONG unsigned int
+typedef unsigned int BF_LONG;

 #define BF_ROUNDS 16

diff --git a/deps/openssl/openssl/include/openssl/bn.h b/deps/openssl/openssl/include/openssl/bn.h
index b7a3cd8e230..fa708eb8051 100644
--- a/deps/openssl/openssl/include/openssl/bn.h
+++ b/deps/openssl/openssl/include/openssl/bn.h
@@ -34,7 +34,7 @@ extern "C" {
  * 64-bit processor with LP64 ABI
  */
 #ifdef SIXTY_FOUR_BIT_LONG
-#define BN_ULONG unsigned long
+typedef unsigned long BN_ULONG;
 #define BN_BYTES 8
 #endif

@@ -42,12 +42,12 @@ extern "C" {
  * 64-bit processor other than LP64 ABI
  */
 #ifdef SIXTY_FOUR_BIT
-#define BN_ULONG unsigned long long
+typedef unsigned long long BN_ULONG;
 #define BN_BYTES 8
 #endif

 #ifdef THIRTY_TWO_BIT
-#define BN_ULONG unsigned int
+typedef unsigned int BN_ULONG;
 #define BN_BYTES 4
 #endif

diff --git a/deps/openssl/openssl/include/openssl/bnerr.h b/deps/openssl/openssl/include/openssl/bnerr.h
deleted file mode 100644
index dbbcd699bba..00000000000
--- a/deps/openssl/openssl/include/openssl/bnerr.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_BNERR_H
-#define OPENSSL_BNERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * BN reason codes.
- */
-#define BN_R_ARG2_LT_ARG3 100
-#define BN_R_BAD_RECIPROCAL 101
-#define BN_R_BIGNUM_TOO_LONG 114
-#define BN_R_BITS_TOO_SMALL 118
-#define BN_R_CALLED_WITH_EVEN_MODULUS 102
-#define BN_R_DIV_BY_ZERO 103
-#define BN_R_ENCODING_ERROR 104
-#define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105
-#define BN_R_INPUT_NOT_REDUCED 110
-#define BN_R_INVALID_LENGTH 106
-#define BN_R_INVALID_RANGE 115
-#define BN_R_INVALID_SHIFT 119
-#define BN_R_NOT_A_SQUARE 111
-#define BN_R_NOT_INITIALIZED 107
-#define BN_R_NO_INVERSE 108
-#define BN_R_NO_PRIME_CANDIDATE 121
-#define BN_R_NO_SOLUTION 116
-#define BN_R_NO_SUITABLE_DIGEST 120
-#define BN_R_PRIVATE_KEY_TOO_LARGE 117
-#define BN_R_P_IS_NOT_PRIME 112
-#define BN_R_TOO_MANY_ITERATIONS 113
-#define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/buffererr.h b/deps/openssl/openssl/include/openssl/buffererr.h
deleted file mode 100644
index 4fa0da44be2..00000000000
--- a/deps/openssl/openssl/include/openssl/buffererr.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_BUFFERERR_H
-#define OPENSSL_BUFFERERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * BUF reason codes.
- */
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/camellia.h b/deps/openssl/openssl/include/openssl/camellia.h
index aec94e4efc9..e03b8efe2d5 100644
--- a/deps/openssl/openssl/include/openssl/camellia.h
+++ b/deps/openssl/openssl/include/openssl/camellia.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -56,7 +56,7 @@ typedef struct camellia_key_st CAMELLIA_KEY;
 #endif /* OPENSSL_NO_DEPRECATED_3_0 */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
 OSSL_DEPRECATEDIN_3_0 int Camellia_set_key(const unsigned char *userKey,
-    const int bits,
+    int bits,
     CAMELLIA_KEY *key);
 OSSL_DEPRECATEDIN_3_0 void Camellia_encrypt(const unsigned char *in,
     unsigned char *out,
@@ -67,34 +67,34 @@ OSSL_DEPRECATEDIN_3_0 void Camellia_decrypt(const unsigned char *in,
 OSSL_DEPRECATEDIN_3_0 void Camellia_ecb_encrypt(const unsigned char *in,
     unsigned char *out,
     const CAMELLIA_KEY *key,
-    const int enc);
+    int enc);
 OSSL_DEPRECATEDIN_3_0 void Camellia_cbc_encrypt(const unsigned char *in,
     unsigned char *out,
     size_t length,
     const CAMELLIA_KEY *key,
     unsigned char *ivec,
-    const int enc);
+    int enc);
 OSSL_DEPRECATEDIN_3_0 void Camellia_cfb128_encrypt(const unsigned char *in,
     unsigned char *out,
     size_t length,
     const CAMELLIA_KEY *key,
     unsigned char *ivec,
     int *num,
-    const int enc);
+    int enc);
 OSSL_DEPRECATEDIN_3_0 void Camellia_cfb1_encrypt(const unsigned char *in,
     unsigned char *out,
     size_t length,
     const CAMELLIA_KEY *key,
     unsigned char *ivec,
     int *num,
-    const int enc);
+    int enc);
 OSSL_DEPRECATEDIN_3_0 void Camellia_cfb8_encrypt(const unsigned char *in,
     unsigned char *out,
     size_t length,
     const CAMELLIA_KEY *key,
     unsigned char *ivec,
     int *num,
-    const int enc);
+    int enc);
 OSSL_DEPRECATEDIN_3_0 void Camellia_ofb128_encrypt(const unsigned char *in,
     unsigned char *out,
     size_t length,
diff --git a/deps/openssl/openssl/include/openssl/cast.h b/deps/openssl/openssl/include/openssl/cast.h
index af943124821..7babdb66fe8 100644
--- a/deps/openssl/openssl/include/openssl/cast.h
+++ b/deps/openssl/openssl/include/openssl/cast.h
@@ -31,7 +31,7 @@ extern "C" {
 #define CAST_ENCRYPT 1
 #define CAST_DECRYPT 0

-#define CAST_LONG unsigned int
+typedef unsigned int CAST_LONG;

 typedef struct cast_key_st {
     CAST_LONG data[32];
diff --git a/deps/openssl/openssl/include/openssl/cmac.h b/deps/openssl/openssl/include/openssl/cmac.h
index c72da7ecdcb..99ef1a252b3 100644
--- a/deps/openssl/openssl/include/openssl/cmac.h
+++ b/deps/openssl/openssl/include/openssl/cmac.h
@@ -36,7 +36,8 @@ OSSL_DEPRECATEDIN_3_0 EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx);
 OSSL_DEPRECATEDIN_3_0 int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in);
 OSSL_DEPRECATEDIN_3_0 int CMAC_Init(CMAC_CTX *ctx,
     const void *key, size_t keylen,
-    const EVP_CIPHER *cipher, ENGINE *impl);
+    const EVP_CIPHER *cipher,
+    ENGINE *impl /* must be NULL */);
 OSSL_DEPRECATEDIN_3_0 int CMAC_Update(CMAC_CTX *ctx,
     const void *data, size_t dlen);
 OSSL_DEPRECATEDIN_3_0 int CMAC_Final(CMAC_CTX *ctx,
diff --git a/deps/openssl/openssl/include/openssl/cmp.h b/deps/openssl/openssl/include/openssl/cmp.h
deleted file mode 100644
index 7c8a6dc96fc..00000000000
--- a/deps/openssl/openssl/include/openssl/cmp.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/cmp.h"
diff --git a/deps/openssl/openssl/include/openssl/cmp.h.in b/deps/openssl/openssl/include/openssl/cmp.h.in
index 8f3a835462b..6ae08e1872b 100644
--- a/deps/openssl/openssl/include/openssl/cmp.h.in
+++ b/deps/openssl/openssl/include/openssl/cmp.h.in
@@ -376,6 +376,7 @@ const char *OSSL_CMP_CTX_get0_propq(const OSSL_CMP_CTX *ctx);
 #define OSSL_CMP_OPT_IGNORE_KEYUSAGE 35
 #define OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR 36
 #define OSSL_CMP_OPT_NO_CACHE_EXTRACERTS 37
+#define OSSL_CMP_OPT_NONMATCHED_ERROR_NONCES 38
 int OSSL_CMP_CTX_set_option(OSSL_CMP_CTX *ctx, int opt, int val);
 int OSSL_CMP_CTX_get_option(const OSSL_CMP_CTX *ctx, int opt);
 /* CMP-specific callback for logging and outputting the error queue: */
@@ -509,8 +510,9 @@ OSSL_CMP_MSG *OSSL_CMP_CTX_server_perform(OSSL_CMP_CTX *client_ctx,
     const OSSL_CMP_MSG *req);
 OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(OSSL_LIB_CTX *libctx, const char *propq);
 void OSSL_CMP_SRV_CTX_free(OSSL_CMP_SRV_CTX *srv_ctx);
-typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_cert_request_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, const OSSL_CMP_MSG *req, int certReqId,
-    const OSSL_CRMF_MSG *crm, const X509_REQ *p10cr,
+typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_cert_request_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
+    const OSSL_CMP_MSG *req, int certReqId,
+    const OSSL_CRMF_MSG *crm, const X509_REQ *p10,
     X509 **certOut, STACK_OF(X509) **chainOut, STACK_OF(X509) **caPubs);
 typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_rr_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
     const OSSL_CMP_MSG *req,
diff --git a/deps/openssl/openssl/include/openssl/cmperr.h b/deps/openssl/openssl/include/openssl/cmperr.h
deleted file mode 100644
index b07ac6d6c6d..00000000000
--- a/deps/openssl/openssl/include/openssl/cmperr.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_CMPERR_H
-#define OPENSSL_CMPERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-#ifndef OPENSSL_NO_CMP
-
-/*
- * CMP reason codes.
- */
-#define CMP_R_ALGORITHM_NOT_SUPPORTED 139
-#define CMP_R_BAD_CHECKAFTER_IN_POLLREP 167
-#define CMP_R_BAD_REQUEST_ID 108
-#define CMP_R_CERTHASH_UNMATCHED 156
-#define CMP_R_CERTID_NOT_FOUND 109
-#define CMP_R_CERTIFICATE_NOT_ACCEPTED 169
-#define CMP_R_CERTIFICATE_NOT_FOUND 112
-#define CMP_R_CERTREQMSG_NOT_FOUND 157
-#define CMP_R_CERTRESPONSE_NOT_FOUND 113
-#define CMP_R_CERT_AND_KEY_DO_NOT_MATCH 114
-#define CMP_R_CHECKAFTER_OUT_OF_RANGE 181
-#define CMP_R_ENCOUNTERED_KEYUPDATEWARNING 176
-#define CMP_R_ENCOUNTERED_WAITING 162
-#define CMP_R_ERROR_CALCULATING_PROTECTION 115
-#define CMP_R_ERROR_CREATING_CERTCONF 116
-#define CMP_R_ERROR_CREATING_CERTREP 117
-#define CMP_R_ERROR_CREATING_CERTREQ 163
-#define CMP_R_ERROR_CREATING_ERROR 118
-#define CMP_R_ERROR_CREATING_GENM 119
-#define CMP_R_ERROR_CREATING_GENP 120
-#define CMP_R_ERROR_CREATING_PKICONF 122
-#define CMP_R_ERROR_CREATING_POLLREP 123
-#define CMP_R_ERROR_CREATING_POLLREQ 124
-#define CMP_R_ERROR_CREATING_RP 125
-#define CMP_R_ERROR_CREATING_RR 126
-#define CMP_R_ERROR_PARSING_PKISTATUS 107
-#define CMP_R_ERROR_PROCESSING_MESSAGE 158
-#define CMP_R_ERROR_PROTECTING_MESSAGE 127
-#define CMP_R_ERROR_SETTING_CERTHASH 128
-#define CMP_R_ERROR_UNEXPECTED_CERTCONF 160
-#define CMP_R_ERROR_VALIDATING_PROTECTION 140
-#define CMP_R_ERROR_VALIDATING_SIGNATURE 171
-#define CMP_R_EXPECTED_POLLREQ 104
-#define CMP_R_FAILED_BUILDING_OWN_CHAIN 164
-#define CMP_R_FAILED_EXTRACTING_CENTRAL_GEN_KEY 203
-#define CMP_R_FAILED_EXTRACTING_PUBKEY 141
-#define CMP_R_FAILURE_OBTAINING_RANDOM 110
-#define CMP_R_FAIL_INFO_OUT_OF_RANGE 129
-#define CMP_R_GENERATE_CERTREQTEMPLATE 197
-#define CMP_R_GENERATE_CRLSTATUS 198
-#define CMP_R_GETTING_GENP 192
-#define CMP_R_GET_ITAV 199
-#define CMP_R_INVALID_ARGS 100
-#define CMP_R_INVALID_GENP 193
-#define CMP_R_INVALID_KEYSPEC 202
-#define CMP_R_INVALID_OPTION 174
-#define CMP_R_INVALID_ROOTCAKEYUPDATE 195
-#define CMP_R_MISSING_CENTRAL_GEN_KEY 204
-#define CMP_R_MISSING_CERTID 165
-#define CMP_R_MISSING_KEY_INPUT_FOR_CREATING_PROTECTION 130
-#define CMP_R_MISSING_KEY_USAGE_DIGITALSIGNATURE 142
-#define CMP_R_MISSING_P10CSR 121
-#define CMP_R_MISSING_PBM_SECRET 166
-#define CMP_R_MISSING_PRIVATE_KEY 131
-#define CMP_R_MISSING_PRIVATE_KEY_FOR_POPO 190
-#define CMP_R_MISSING_PROTECTION 143
-#define CMP_R_MISSING_PUBLIC_KEY 183
-#define CMP_R_MISSING_REFERENCE_CERT 168
-#define CMP_R_MISSING_SECRET 178
-#define CMP_R_MISSING_SENDER_IDENTIFICATION 111
-#define CMP_R_MISSING_TRUST_ANCHOR 179
-#define CMP_R_MISSING_TRUST_STORE 144
-#define CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED 161
-#define CMP_R_MULTIPLE_RESPONSES_NOT_SUPPORTED 170
-#define CMP_R_MULTIPLE_SAN_SOURCES 102
-#define CMP_R_NO_STDIO 194
-#define CMP_R_NO_SUITABLE_SENDER_CERT 145
-#define CMP_R_NULL_ARGUMENT 103
-#define CMP_R_PKIBODY_ERROR 146
-#define CMP_R_PKISTATUSINFO_NOT_FOUND 132
-#define CMP_R_POLLING_FAILED 172
-#define CMP_R_POTENTIALLY_INVALID_CERTIFICATE 147
-#define CMP_R_RECEIVED_ERROR 180
-#define CMP_R_RECIPNONCE_UNMATCHED 148
-#define CMP_R_REQUEST_NOT_ACCEPTED 149
-#define CMP_R_REQUEST_REJECTED_BY_SERVER 182
-#define CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED 150
-#define CMP_R_SRVCERT_DOES_NOT_VALIDATE_MSG 151
-#define CMP_R_TOTAL_TIMEOUT 184
-#define CMP_R_TRANSACTIONID_UNMATCHED 152
-#define CMP_R_TRANSFER_ERROR 159
-#define CMP_R_UNCLEAN_CTX 191
-#define CMP_R_UNEXPECTED_CENTRAL_GEN_KEY 205
-#define CMP_R_UNEXPECTED_CERTPROFILE 196
-#define CMP_R_UNEXPECTED_CRLSTATUSLIST 201
-#define CMP_R_UNEXPECTED_PKIBODY 133
-#define CMP_R_UNEXPECTED_PKISTATUS 185
-#define CMP_R_UNEXPECTED_POLLREQ 105
-#define CMP_R_UNEXPECTED_PVNO 153
-#define CMP_R_UNEXPECTED_SENDER 106
-#define CMP_R_UNKNOWN_ALGORITHM_ID 134
-#define CMP_R_UNKNOWN_CERT_TYPE 135
-#define CMP_R_UNKNOWN_CRL_ISSUER 200
-#define CMP_R_UNKNOWN_PKISTATUS 186
-#define CMP_R_UNSUPPORTED_ALGORITHM 136
-#define CMP_R_UNSUPPORTED_KEY_TYPE 137
-#define CMP_R_UNSUPPORTED_PKIBODY 101
-#define CMP_R_UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC 154
-#define CMP_R_VALUE_TOO_LARGE 175
-#define CMP_R_VALUE_TOO_SMALL 177
-#define CMP_R_WRONG_ALGORITHM_OID 138
-#define CMP_R_WRONG_CERTID 189
-#define CMP_R_WRONG_CERTID_IN_RP 187
-#define CMP_R_WRONG_PBM_VALUE 155
-#define CMP_R_WRONG_RP_COMPONENT_COUNT 188
-#define CMP_R_WRONG_SERIAL_IN_RP 173
-
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/openssl/cms.h b/deps/openssl/openssl/include/openssl/cms.h
deleted file mode 100644
index 33a00775c9f..00000000000
--- a/deps/openssl/openssl/include/openssl/cms.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/cms.h"
diff --git a/deps/openssl/openssl/include/openssl/cms.h.in b/deps/openssl/openssl/include/openssl/cms.h.in
index dc87758514a..b7e8d723035 100644
--- a/deps/openssl/openssl/include/openssl/cms.h.in
+++ b/deps/openssl/openssl/include/openssl/cms.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 2008-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -74,6 +74,12 @@ CMS_ContentInfo *CMS_ContentInfo_new_ex(OSSL_LIB_CTX *libctx, const char *propq)
 #define CMS_RECIPINFO_KEK 2
 #define CMS_RECIPINFO_PASS 3
 #define CMS_RECIPINFO_OTHER 4
+#define CMS_RECIPINFO_KEM 5
+
+#define CMS_VERIFY_RESULT 0
+#define CMS_VERIFY_CERT 1
+#define CMS_VERIFY_ATTR 2
+#define CMS_VERIFY_CONTENT 3

 /* S/MIME related flags */

@@ -103,11 +109,13 @@ CMS_ContentInfo *CMS_ContentInfo_new_ex(OSSL_LIB_CTX *libctx, const char *propq)
 #define CMS_CADES 0x100000
 #define CMS_USE_ORIGINATOR_KEYID 0x200000
 #define CMS_NO_SIGNING_TIME 0x400000
+#define CMS_VERIFY_PARTIAL 0x800000

 const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms);

 BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
 int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);
+int CMS_dataFinal_ex(CMS_ContentInfo *cms, BIO *bio, BIO *data);

 ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
 int CMS_is_detached(CMS_ContentInfo *cms);
@@ -116,7 +124,9 @@ int CMS_set_detached(CMS_ContentInfo *cms, int detached);
 #ifdef OPENSSL_PEM_H
 DECLARE_PEM_rw(CMS, CMS_ContentInfo)
 #endif
-int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+OSSL_DEPRECATEDIN_4_1 int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_1) */
 CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);
 int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);

@@ -135,16 +145,13 @@ int CMS_final_digest(CMS_ContentInfo *cms,
     unsigned int flags);

 CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey,
-    STACK_OF(X509) *certs, BIO *data,
-    unsigned int flags);
+    const STACK_OF(X509) *certs, BIO *data, unsigned int flags);
 CMS_ContentInfo *CMS_sign_ex(X509 *signcert, EVP_PKEY *pkey,
-    STACK_OF(X509) *certs, BIO *data,
-    unsigned int flags, OSSL_LIB_CTX *libctx,
-    const char *propq);
+    const STACK_OF(X509) *certs, BIO *data,
+    unsigned int flags, OSSL_LIB_CTX *libctx, const char *propq);

-CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si,
-    X509 *signcert, EVP_PKEY *pkey,
-    STACK_OF(X509) *certs, unsigned int flags);
+CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, X509 *signcert,
+    EVP_PKEY *pkey, const STACK_OF(X509) *certs, unsigned int flags);

 int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);
 CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
@@ -174,18 +181,17 @@ CMS_ContentInfo *CMS_EncryptedData_encrypt_ex(BIO *in, const EVP_CIPHER *cipher,
 int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
     const unsigned char *key, size_t keylen);

-int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
+int CMS_verify(CMS_ContentInfo *cms, const STACK_OF(X509) *certs,
     X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);

 int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
-    STACK_OF(X509) *certs,
-    X509_STORE *store, unsigned int flags);
+    const STACK_OF(X509) *certs, X509_STORE *store, unsigned int flags);

 STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms);

-CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
+CMS_ContentInfo *CMS_encrypt(const STACK_OF(X509) *certs, BIO *in,
     const EVP_CIPHER *cipher, unsigned int flags);
-CMS_ContentInfo *CMS_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
+CMS_ContentInfo *CMS_encrypt_ex(const STACK_OF(X509) *certs, BIO *in,
     const EVP_CIPHER *cipher, unsigned int flags,
     OSSL_LIB_CTX *libctx, const char *propq);

@@ -291,28 +297,33 @@ EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si);
 STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);

 void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
+X509 *CMS_SignerInfo_get0_signer_cert(const CMS_SignerInfo *si);
 int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,
     ASN1_OCTET_STRING **keyid,
     X509_NAME **issuer, ASN1_INTEGER **sno);
 int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
-int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
+int CMS_set1_signers_certs(CMS_ContentInfo *cms, const STACK_OF(X509) *certs,
     unsigned int flags);
 void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk,
     X509 **signer, X509_ALGOR **pdig,
     X509_ALGOR **psig);
 ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
+int CMS_SignerInfo_get_verification_result(const CMS_SignerInfo *si, int type);
 int CMS_SignerInfo_sign(CMS_SignerInfo *si);
 int CMS_SignerInfo_verify(CMS_SignerInfo *si);
 int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
+int CMS_SignerInfo_verify_ex(CMS_SignerInfo *si, BIO *chain, BIO *data);
 BIO *CMS_SignedData_verify(CMS_SignedData *sd, BIO *detached_data,
-    STACK_OF(X509) *scerts, X509_STORE *store,
-    STACK_OF(X509) *extra, STACK_OF(X509_CRL) *crls,
+    const STACK_OF(X509) *scerts, X509_STORE *store,
+    const STACK_OF(X509) *extra, const STACK_OF(X509_CRL) *crls,
     unsigned int flags,
     OSSL_LIB_CTX *libctx, const char *propq);

 int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs);
 int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs,
     int algnid, int keysize);
+int CMS_add_standard_smimecap_ex(STACK_OF(X509_ALGOR) **smcap,
+    OSSL_LIB_CTX *libctx, const char *propq);
 int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap);

 int CMS_signed_get_attr_count(const CMS_SignerInfo *si);
@@ -332,7 +343,7 @@ int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si,
 int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,
     const char *attrname, int type,
     const void *bytes, int len);
-void *CMS_signed_get0_data_by_OBJ(const CMS_SignerInfo *si,
+const void *CMS_signed_get0_data_by_OBJ(const CMS_SignerInfo *si,
     const ASN1_OBJECT *oid,
     int lastpos, int type);

@@ -353,7 +364,7 @@ int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si,
 int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si,
     const char *attrname, int type,
     const void *bytes, int len);
-void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
+const void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
     int lastpos, int type);

 int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
@@ -405,6 +416,14 @@ int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,
 int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg,
     ASN1_OCTET_STRING *ukm, int keylen);

+int CMS_RecipientInfo_kemri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
+int CMS_RecipientInfo_kemri_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
+EVP_CIPHER_CTX *CMS_RecipientInfo_kemri_get0_ctx(CMS_RecipientInfo *ri);
+X509_ALGOR *CMS_RecipientInfo_kemri_get0_kdf_alg(CMS_RecipientInfo *ri);
+int CMS_RecipientInfo_kemri_set_ukm(CMS_RecipientInfo *ri,
+    const unsigned char *ukm,
+    int ukmLength);
+
 /* Backward compatibility for spelling errors. */
 #define CMS_R_UNKNOWN_DIGEST_ALGORITM CMS_R_UNKNOWN_DIGEST_ALGORITHM
 #define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE \
diff --git a/deps/openssl/openssl/include/openssl/cmserr.h b/deps/openssl/openssl/include/openssl/cmserr.h
deleted file mode 100644
index 8c12c5664fd..00000000000
--- a/deps/openssl/openssl/include/openssl/cmserr.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_CMSERR_H
-#define OPENSSL_CMSERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-#ifndef OPENSSL_NO_CMS
-
-/*
- * CMS reason codes.
- */
-#define CMS_R_ADD_SIGNER_ERROR 99
-#define CMS_R_ATTRIBUTE_ERROR 161
-#define CMS_R_CERTIFICATE_ALREADY_PRESENT 175
-#define CMS_R_CERTIFICATE_HAS_NO_KEYID 160
-#define CMS_R_CERTIFICATE_VERIFY_ERROR 100
-#define CMS_R_CIPHER_AEAD_IN_ENVELOPED_DATA 200
-#define CMS_R_CIPHER_AEAD_SET_TAG_ERROR 184
-#define CMS_R_CIPHER_GET_TAG 185
-#define CMS_R_CIPHER_INITIALISATION_ERROR 101
-#define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR 102
-#define CMS_R_CMS_DATAFINAL_ERROR 103
-#define CMS_R_CMS_LIB 104
-#define CMS_R_CONTENTIDENTIFIER_MISMATCH 170
-#define CMS_R_CONTENT_NOT_FOUND 105
-#define CMS_R_CONTENT_TYPE_MISMATCH 171
-#define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA 106
-#define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA 107
-#define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA 108
-#define CMS_R_CONTENT_VERIFY_ERROR 109
-#define CMS_R_CTRL_ERROR 110
-#define CMS_R_CTRL_FAILURE 111
-#define CMS_R_DECODE_ERROR 187
-#define CMS_R_DECRYPT_ERROR 112
-#define CMS_R_ERROR_GETTING_PUBLIC_KEY 113
-#define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE 114
-#define CMS_R_ERROR_SETTING_KEY 115
-#define CMS_R_ERROR_SETTING_RECIPIENTINFO 116
-#define CMS_R_ERROR_UNSUPPORTED_STATIC_KEY_AGREEMENT 196
-#define CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR 183
-#define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH 117
-#define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER 176
-#define CMS_R_INVALID_KEY_LENGTH 118
-#define CMS_R_INVALID_LABEL 190
-#define CMS_R_INVALID_OAEP_PARAMETERS 191
-#define CMS_R_KDF_PARAMETER_ERROR 186
-#define CMS_R_MD_BIO_INIT_ERROR 119
-#define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH 120
-#define CMS_R_MESSAGEDIGEST_WRONG_LENGTH 121
-#define CMS_R_MSGSIGDIGEST_ERROR 172
-#define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE 162
-#define CMS_R_MSGSIGDIGEST_WRONG_LENGTH 163
-#define CMS_R_NEED_ONE_SIGNER 164
-#define CMS_R_NOT_A_SIGNED_RECEIPT 165
-#define CMS_R_NOT_ENCRYPTED_DATA 122
-#define CMS_R_NOT_KEK 123
-#define CMS_R_NOT_KEY_AGREEMENT 181
-#define CMS_R_NOT_KEY_TRANSPORT 124
-#define CMS_R_NOT_PWRI 177
-#define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 125
-#define CMS_R_NO_CIPHER 126
-#define CMS_R_NO_CONTENT 127
-#define CMS_R_NO_CONTENT_TYPE 173
-#define CMS_R_NO_DEFAULT_DIGEST 128
-#define CMS_R_NO_DIGEST_SET 129
-#define CMS_R_NO_KEY 130
-#define CMS_R_NO_KEY_OR_CERT 174
-#define CMS_R_NO_MATCHING_DIGEST 131
-#define CMS_R_NO_MATCHING_RECIPIENT 132
-#define CMS_R_NO_MATCHING_SIGNATURE 166
-#define CMS_R_NO_MSGSIGDIGEST 167
-#define CMS_R_NO_PASSWORD 178
-#define CMS_R_NO_PRIVATE_KEY 133
-#define CMS_R_NO_PUBLIC_KEY 134
-#define CMS_R_NO_RECEIPT_REQUEST 168
-#define CMS_R_NO_SIGNERS 135
-#define CMS_R_OPERATION_UNSUPPORTED 182
-#define CMS_R_PEER_KEY_ERROR 188
-#define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 136
-#define CMS_R_RECEIPT_DECODE_ERROR 169
-#define CMS_R_RECIPIENT_ERROR 137
-#define CMS_R_SHARED_INFO_ERROR 189
-#define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND 138
-#define CMS_R_SIGNFINAL_ERROR 139
-#define CMS_R_SMIME_TEXT_ERROR 140
-#define CMS_R_STORE_INIT_ERROR 141
-#define CMS_R_TYPE_NOT_COMPRESSED_DATA 142
-#define CMS_R_TYPE_NOT_DATA 143
-#define CMS_R_TYPE_NOT_DIGESTED_DATA 144
-#define CMS_R_TYPE_NOT_ENCRYPTED_DATA 145
-#define CMS_R_TYPE_NOT_ENVELOPED_DATA 146
-#define CMS_R_UNABLE_TO_FINALIZE_CONTEXT 147
-#define CMS_R_UNKNOWN_CIPHER 148
-#define CMS_R_UNKNOWN_DIGEST_ALGORITHM 149
-#define CMS_R_UNKNOWN_ID 150
-#define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151
-#define CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM 194
-#define CMS_R_UNSUPPORTED_CONTENT_TYPE 152
-#define CMS_R_UNSUPPORTED_ENCRYPTION_TYPE 192
-#define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153
-#define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM 179
-#define CMS_R_UNSUPPORTED_LABEL_SOURCE 193
-#define CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE 155
-#define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154
-#define CMS_R_UNSUPPORTED_SIGNATURE_ALGORITHM 195
-#define CMS_R_UNSUPPORTED_TYPE 156
-#define CMS_R_UNWRAP_ERROR 157
-#define CMS_R_UNWRAP_FAILURE 180
-#define CMS_R_VERIFICATION_FAILURE 158
-#define CMS_R_WRAP_ERROR 159
-
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/openssl/comp.h b/deps/openssl/openssl/include/openssl/comp.h
deleted file mode 100644
index 2c5927233fc..00000000000
--- a/deps/openssl/openssl/include/openssl/comp.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/comp.h"
diff --git a/deps/openssl/openssl/include/openssl/comperr.h b/deps/openssl/openssl/include/openssl/comperr.h
deleted file mode 100644
index 90ec7c1144b..00000000000
--- a/deps/openssl/openssl/include/openssl/comperr.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_COMPERR_H
-#define OPENSSL_COMPERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-#ifndef OPENSSL_NO_COMP
-
-/*
- * COMP reason codes.
- */
-#define COMP_R_BROTLI_DECODE_ERROR 102
-#define COMP_R_BROTLI_ENCODE_ERROR 103
-#define COMP_R_BROTLI_NOT_SUPPORTED 104
-#define COMP_R_ZLIB_DEFLATE_ERROR 99
-#define COMP_R_ZLIB_INFLATE_ERROR 100
-#define COMP_R_ZLIB_NOT_SUPPORTED 101
-#define COMP_R_ZSTD_COMPRESS_ERROR 105
-#define COMP_R_ZSTD_DECODE_ERROR 106
-#define COMP_R_ZSTD_DECOMPRESS_ERROR 107
-#define COMP_R_ZSTD_NOT_SUPPORTED 108
-
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/openssl/conf.h b/deps/openssl/openssl/include/openssl/conf.h
deleted file mode 100644
index 2712886cafc..00000000000
--- a/deps/openssl/openssl/include/openssl/conf.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/conf.h"
diff --git a/deps/openssl/openssl/include/openssl/conferr.h b/deps/openssl/openssl/include/openssl/conferr.h
deleted file mode 100644
index 0b984dd65d4..00000000000
--- a/deps/openssl/openssl/include/openssl/conferr.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_CONFERR_H
-#define OPENSSL_CONFERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * CONF reason codes.
- */
-#define CONF_R_ERROR_LOADING_DSO 110
-#define CONF_R_INVALID_PRAGMA 122
-#define CONF_R_LIST_CANNOT_BE_NULL 115
-#define CONF_R_MANDATORY_BRACES_IN_VARIABLE_EXPANSION 123
-#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100
-#define CONF_R_MISSING_EQUAL_SIGN 101
-#define CONF_R_MISSING_INIT_FUNCTION 112
-#define CONF_R_MODULE_INITIALIZATION_ERROR 109
-#define CONF_R_NO_CLOSE_BRACE 102
-#define CONF_R_NO_CONF 105
-#define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106
-#define CONF_R_NO_SECTION 107
-#define CONF_R_NO_SUCH_FILE 114
-#define CONF_R_NO_VALUE 108
-#define CONF_R_NUMBER_TOO_LARGE 121
-#define CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION 124
-#define CONF_R_RECURSIVE_DIRECTORY_INCLUDE 111
-#define CONF_R_RECURSIVE_SECTION_REFERENCE 126
-#define CONF_R_RELATIVE_PATH 125
-#define CONF_R_SSL_COMMAND_SECTION_EMPTY 117
-#define CONF_R_SSL_COMMAND_SECTION_NOT_FOUND 118
-#define CONF_R_SSL_SECTION_EMPTY 119
-#define CONF_R_SSL_SECTION_NOT_FOUND 120
-#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103
-#define CONF_R_UNKNOWN_MODULE_NAME 113
-#define CONF_R_VARIABLE_EXPANSION_TOO_LONG 116
-#define CONF_R_VARIABLE_HAS_NO_VALUE 104
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/configuration.h b/deps/openssl/openssl/include/openssl/configuration.h
deleted file mode 100644
index 8ffad996047..00000000000
--- a/deps/openssl/openssl/include/openssl/configuration.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/configuration.h"
diff --git a/deps/openssl/openssl/include/openssl/configuration.h.in b/deps/openssl/openssl/include/openssl/configuration.h.in
index 4e7bff16c7b..51e442d4f17 100644
--- a/deps/openssl/openssl/include/openssl/configuration.h.in
+++ b/deps/openssl/openssl/include/openssl/configuration.h.in
@@ -54,7 +54,10 @@ extern "C" {
 /* clang-format on */

 /*
- * The following are cipher-specific, but are part of the public API.
+ * The UEFI build supports both 32-bit and 64-bit builds from a single run
+ * of the Configure script.  To allow this, they define THIRTY_TWO_BIT and
+ * SIXTY_FOUR_BIT appropriately for their builds, and we should not touch
+ * them in that case.
  */
 #if !defined(OPENSSL_SYS_UEFI)
     /* clang-format off */
@@ -72,6 +75,9 @@ extern "C" {
 /* clang-format on */
 #endif

+/*
+ * The following are cipher-specific, but are part of the public API.
+ */
 /* clang-format off */
 # define RC4_INT {- $config{rc4_int} -}
 /* clang-format on */
diff --git a/deps/openssl/openssl/include/openssl/core_dispatch.h b/deps/openssl/openssl/include/openssl/core_dispatch.h
index 2e87cd638b3..176f8c426c6 100644
--- a/deps/openssl/openssl/include/openssl/core_dispatch.h
+++ b/deps/openssl/openssl/include/openssl/core_dispatch.h
@@ -315,6 +315,8 @@ OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_alert,
 #define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS 13
 #define OSSL_FUNC_DIGEST_SQUEEZE 14
 #define OSSL_FUNC_DIGEST_COPYCTX 15
+#define OSSL_FUNC_DIGEST_SERIALIZE 16
+#define OSSL_FUNC_DIGEST_DESERIALIZE 17

 OSSL_CORE_MAKE_FUNC(void *, digest_newctx, (void *provctx))
 OSSL_CORE_MAKE_FUNC(int, digest_init, (void *dctx, const OSSL_PARAM params[]))
@@ -345,6 +347,10 @@ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_settable_ctx_params,
     (void *dctx, void *provctx))
 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_gettable_ctx_params,
     (void *dctx, void *provctx))
+OSSL_CORE_MAKE_FUNC(int, digest_serialize,
+    (void *dctx, unsigned char *out, size_t *outl))
+OSSL_CORE_MAKE_FUNC(int, digest_deserialize,
+    (void *dctx, const unsigned char *in, size_t inl))

 /* Symmetric Ciphers */

@@ -451,6 +457,58 @@ OSSL_CORE_MAKE_FUNC(int, mac_set_ctx_params,
     (void *mctx, const OSSL_PARAM params[]))
 OSSL_CORE_MAKE_FUNC(int, mac_init_skey, (void *mctx, void *key, const OSSL_PARAM params[]))

+/*-
+ * Symmetric key management
+ *
+ * The Key Management takes care of provider side of symmetric key objects, and
+ * includes essentially everything that manipulates the keys  themselves and
+ * their parameters.
+ *
+ * The key objects are commonly referred to as |keydata|, and it MUST be able
+ * to contain parameters if the key has any, and the secret key.
+ *
+ * Key objects are created with OSSL_FUNC_skeymgmt_import() (there is no
+ * dedicated memory allocation function), exported with
+ * OSSL_FUNC_skeymgmt_export() and destroyed with OSSL_FUNC_keymgmt_free().
+ *
+ */
+
+/* Key data subset selection - individual bits */
+#define OSSL_SKEYMGMT_SELECT_PARAMETERS 0x01
+#define OSSL_SKEYMGMT_SELECT_SECRET_KEY 0x02
+
+/* Key data subset selection - combinations */
+#define OSSL_SKEYMGMT_SELECT_ALL \
+    (OSSL_SKEYMGMT_SELECT_PARAMETERS | OSSL_SKEYMGMT_SELECT_SECRET_KEY)
+
+#define OSSL_FUNC_SKEYMGMT_FREE 1
+#define OSSL_FUNC_SKEYMGMT_IMPORT 2
+#define OSSL_FUNC_SKEYMGMT_EXPORT 3
+#define OSSL_FUNC_SKEYMGMT_GENERATE 4
+#define OSSL_FUNC_SKEYMGMT_GET_KEY_ID 5
+#define OSSL_FUNC_SKEYMGMT_IMP_SETTABLE_PARAMS 6
+#define OSSL_FUNC_SKEYMGMT_GEN_SETTABLE_PARAMS 7
+#define OSSL_FUNC_SKEYMGMT_GET_LOCAL_KEYID 8
+#define OSSL_FUNC_SKEYMGMT_GET_ALGORITHM_ID 9
+
+OSSL_CORE_MAKE_FUNC(void, skeymgmt_free, (void *keydata))
+OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
+    skeymgmt_imp_settable_params, (void *provctx))
+OSSL_CORE_MAKE_FUNC(void *, skeymgmt_import, (void *provctx, int selection, const OSSL_PARAM params[]))
+OSSL_CORE_MAKE_FUNC(int, skeymgmt_export,
+    (void *keydata, int selection,
+        OSSL_CALLBACK *param_cb, void *cbarg))
+OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
+    skeymgmt_gen_settable_params, (void *provctx))
+OSSL_CORE_MAKE_FUNC(void *, skeymgmt_generate, (void *provctx, const OSSL_PARAM params[]))
+OSSL_CORE_MAKE_FUNC(const char *, skeymgmt_get_key_id, (void *keydata))
+OSSL_CORE_MAKE_FUNC(int, skeymgmt_get_local_keyid,
+    (void *keydata, const unsigned char **id, size_t *len))
+OSSL_CORE_MAKE_FUNC(int, skeymgmt_get_algorithm_id,
+    (void *keydata,
+        const unsigned char **oid, size_t *oid_len,
+        const unsigned char **params, size_t *params_len))
+
 /* KDFs and PRFs */

 #define OSSL_FUNC_KDF_NEWCTX 1
@@ -464,6 +522,8 @@ OSSL_CORE_MAKE_FUNC(int, mac_init_skey, (void *mctx, void *key, const OSSL_PARAM
 #define OSSL_FUNC_KDF_GET_PARAMS 9
 #define OSSL_FUNC_KDF_GET_CTX_PARAMS 10
 #define OSSL_FUNC_KDF_SET_CTX_PARAMS 11
+#define OSSL_FUNC_KDF_SET_SKEY 12
+#define OSSL_FUNC_KDF_DERIVE_SKEY 13

 OSSL_CORE_MAKE_FUNC(void *, kdf_newctx, (void *provctx))
 OSSL_CORE_MAKE_FUNC(void *, kdf_dupctx, (void *src))
@@ -480,6 +540,9 @@ OSSL_CORE_MAKE_FUNC(int, kdf_get_ctx_params,
     (void *kctx, OSSL_PARAM params[]))
 OSSL_CORE_MAKE_FUNC(int, kdf_set_ctx_params,
     (void *kctx, const OSSL_PARAM params[]))
+OSSL_CORE_MAKE_FUNC(int, kdf_set_skey,
+    (void *kctx, void *skeydata, const char *paramname))
+OSSL_CORE_MAKE_FUNC(void *, kdf_derive_skey, (void *ctx, const char *key_type, void *provctx, OSSL_FUNC_skeymgmt_import_fn *import, size_t keylen, const OSSL_PARAM params[]))

 /* RAND */

@@ -608,6 +671,8 @@ OSSL_CORE_MAKE_FUNC(void, rand_clear_seed,
 /* Basic key object creation */
 #define OSSL_FUNC_KEYMGMT_NEW 1
 OSSL_CORE_MAKE_FUNC(void *, keymgmt_new, (void *provctx))
+#define OSSL_FUNC_KEYMGMT_NEW_EX 17
+OSSL_CORE_MAKE_FUNC(void *, keymgmt_new_ex, (void *provctx, const OSSL_PARAM params[]))

 /* Generation, a more complex constructor */
 #define OSSL_FUNC_KEYMGMT_GEN_INIT 2
@@ -719,6 +784,7 @@ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_export_types_ex,
 #define OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS 8
 #define OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS 9
 #define OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS 10
+#define OSSL_FUNC_KEYEXCH_DERIVE_SKEY 11

 OSSL_CORE_MAKE_FUNC(void *, keyexch_newctx, (void *provctx))
 OSSL_CORE_MAKE_FUNC(int, keyexch_init, (void *ctx, void *provkey, const OSSL_PARAM params[]))
@@ -732,6 +798,7 @@ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keyexch_settable_ctx_params,
 OSSL_CORE_MAKE_FUNC(int, keyexch_get_ctx_params, (void *ctx, OSSL_PARAM params[]))
 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keyexch_gettable_ctx_params,
     (void *ctx, void *provctx))
+OSSL_CORE_MAKE_FUNC(void *, keyexch_derive_skey, (void *ctx, const char *key_type, void *provctx, OSSL_FUNC_skeymgmt_import_fn *import, size_t keylen, const OSSL_PARAM params[]))

 /* Signature */

@@ -835,50 +902,6 @@ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_settable_ctx_md_params,
     (void *ctx))
 OSSL_CORE_MAKE_FUNC(const char **, signature_query_key_types, (void))

-/*-
- * Symmetric key management
- *
- * The Key Management takes care of provider side of symmetric key objects, and
- * includes essentially everything that manipulates the keys  themselves and
- * their parameters.
- *
- * The key objects are commonly referred to as |keydata|, and it MUST be able
- * to contain parameters if the key has any, and the secret key.
- *
- * Key objects are created with OSSL_FUNC_skeymgmt_import() (there is no
- * dedicated memory allocation function), exported with
- * OSSL_FUNC_skeymgmt_export() and destroyed with OSSL_FUNC_keymgmt_free().
- *
- */
-
-/* Key data subset selection - individual bits */
-#define OSSL_SKEYMGMT_SELECT_PARAMETERS 0x01
-#define OSSL_SKEYMGMT_SELECT_SECRET_KEY 0x02
-
-/* Key data subset selection - combinations */
-#define OSSL_SKEYMGMT_SELECT_ALL \
-    (OSSL_SKEYMGMT_SELECT_PARAMETERS | OSSL_SKEYMGMT_SELECT_SECRET_KEY)
-
-#define OSSL_FUNC_SKEYMGMT_FREE 1
-#define OSSL_FUNC_SKEYMGMT_IMPORT 2
-#define OSSL_FUNC_SKEYMGMT_EXPORT 3
-#define OSSL_FUNC_SKEYMGMT_GENERATE 4
-#define OSSL_FUNC_SKEYMGMT_GET_KEY_ID 5
-#define OSSL_FUNC_SKEYMGMT_IMP_SETTABLE_PARAMS 6
-#define OSSL_FUNC_SKEYMGMT_GEN_SETTABLE_PARAMS 7
-
-OSSL_CORE_MAKE_FUNC(void, skeymgmt_free, (void *keydata))
-OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
-    skeymgmt_imp_settable_params, (void *provctx))
-OSSL_CORE_MAKE_FUNC(void *, skeymgmt_import, (void *provctx, int selection, const OSSL_PARAM params[]))
-OSSL_CORE_MAKE_FUNC(int, skeymgmt_export,
-    (void *keydata, int selection,
-        OSSL_CALLBACK *param_cb, void *cbarg))
-OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
-    skeymgmt_gen_settable_params, (void *provctx))
-OSSL_CORE_MAKE_FUNC(void *, skeymgmt_generate, (void *provctx, const OSSL_PARAM params[]))
-OSSL_CORE_MAKE_FUNC(const char *, skeymgmt_get_key_id, (void *keydata))
-
 /* Asymmetric Ciphers */

 #define OSSL_FUNC_ASYM_CIPHER_NEWCTX 1
diff --git a/deps/openssl/openssl/include/openssl/core_names.h b/deps/openssl/openssl/include/openssl/core_names.h
deleted file mode 100644
index b7b7d7c73d1..00000000000
--- a/deps/openssl/openssl/include/openssl/core_names.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/core_names.h"
diff --git a/deps/openssl/openssl/include/openssl/core_names.h.in b/deps/openssl/openssl/include/openssl/core_names.h.in
index 897a7a94cc5..7d8080f59e7 100644
--- a/deps/openssl/openssl/include/openssl/core_names.h.in
+++ b/deps/openssl/openssl/include/openssl/core_names.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -68,10 +68,16 @@ extern "C" {

 /* Known KDF names */
 #define OSSL_KDF_NAME_HKDF "HKDF"
+#define OSSL_KDF_NAME_HKDF_SHA256 "HKDF-SHA256"
+#define OSSL_KDF_NAME_HKDF_SHA384 "HKDF-SHA384"
+#define OSSL_KDF_NAME_HKDF_SHA512 "HKDF-SHA512"
+#define OSSL_KDF_NAME_IKEV2KDF "IKEV2KDF"
 #define OSSL_KDF_NAME_TLS1_3_KDF "TLS13-KDF"
 #define OSSL_KDF_NAME_PBKDF1 "PBKDF1"
 #define OSSL_KDF_NAME_PBKDF2 "PBKDF2"
 #define OSSL_KDF_NAME_SCRYPT "SCRYPT"
+#define OSSL_KDF_NAME_SNMPKDF "SNMPKDF"
+#define OSSL_KDF_NAME_SRTPKDF "SRTPKDF"
 #define OSSL_KDF_NAME_SSHKDF "SSHKDF"
 #define OSSL_KDF_NAME_SSKDF "SSKDF"
 #define OSSL_KDF_NAME_TLS1_PRF "TLS1-PRF"
@@ -115,9 +121,6 @@ extern "C" {
 #define OSSL_KEM_PARAM_OPERATION_RSASVE "RSASVE"
 #define OSSL_KEM_PARAM_OPERATION_DHKEM "DHKEM"

-/* Provider configuration variables */
-#define OSSL_PKEY_RETAIN_SEED "pkey_retain_seed"
-
 /* Parameter name definitions - generated by util/perl/OpenSSL/paramnames.pm */
 /* clang-format off */
 {- generate_public_macros(); -}
diff --git a/deps/openssl/openssl/include/openssl/core_object.h b/deps/openssl/openssl/include/openssl/core_object.h
index df0c79436d8..d6d46a914f6 100644
--- a/deps/openssl/openssl/include/openssl/core_object.h
+++ b/deps/openssl/openssl/include/openssl/core_object.h
@@ -29,6 +29,7 @@ extern "C" {
 #define OSSL_OBJECT_PKEY 2 /* EVP_PKEY * */
 #define OSSL_OBJECT_CERT 3 /* X509 * */
 #define OSSL_OBJECT_CRL 4 /* X509_CRL * */
+#define OSSL_OBJECT_SKEY 5 /* EVP_SKEY * */

 /*
  * The rest of the associated OSSL_PARAM elements is described in core_names.h
diff --git a/deps/openssl/openssl/include/openssl/crmf.h b/deps/openssl/openssl/include/openssl/crmf.h
deleted file mode 100644
index 4103852ecb2..00000000000
--- a/deps/openssl/openssl/include/openssl/crmf.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/crmf.h"
diff --git a/deps/openssl/openssl/include/openssl/crmf.h.in b/deps/openssl/openssl/include/openssl/crmf.h.in
index 3d9cbf4320b..c327b07a87a 100644
--- a/deps/openssl/openssl/include/openssl/crmf.h.in
+++ b/deps/openssl/openssl/include/openssl/crmf.h.in
@@ -1,7 +1,7 @@
 /*-
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright Nokia 2007-2019
  * Copyright Siemens AG 2015-2019
  *
@@ -196,7 +196,7 @@ EVP_PKEY *OSSL_CRMF_ENCRYPTEDKEY_get1_pkey(const OSSL_CRMF_ENCRYPTEDKEY *encrypt
     X509_STORE *ts, STACK_OF(X509) *extra, EVP_PKEY *pkey,
     X509 *cert, ASN1_OCTET_STRING *secret,
     OSSL_LIB_CTX *libctx, const char *propq);
-int OSSL_CRMF_MSG_centralkeygen_requested(const OSSL_CRMF_MSG *crm, const X509_REQ *p10cr);
+int OSSL_CRMF_MSG_centralkeygen_requested(const OSSL_CRMF_MSG *crm, const X509_REQ *p10);
 #ifndef OPENSSL_NO_CMS
 OSSL_CRMF_ENCRYPTEDKEY *OSSL_CRMF_ENCRYPTEDKEY_init_envdata(CMS_EnvelopedData *envdata);
 #endif
diff --git a/deps/openssl/openssl/include/openssl/crmferr.h b/deps/openssl/openssl/include/openssl/crmferr.h
deleted file mode 100644
index 22153940eeb..00000000000
--- a/deps/openssl/openssl/include/openssl/crmferr.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_CRMFERR_H
-#define OPENSSL_CRMFERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-#ifndef OPENSSL_NO_CRMF
-
-/*
- * CRMF reason codes.
- */
-#define CRMF_R_BAD_PBM_ITERATIONCOUNT 100
-#define CRMF_R_CMS_NOT_SUPPORTED 122
-#define CRMF_R_CRMFERROR 102
-#define CRMF_R_ERROR 103
-#define CRMF_R_ERROR_DECODING_CERTIFICATE 104
-#define CRMF_R_ERROR_DECODING_ENCRYPTEDKEY 123
-#define CRMF_R_ERROR_DECRYPTING_CERTIFICATE 105
-#define CRMF_R_ERROR_DECRYPTING_ENCRYPTEDKEY 124
-#define CRMF_R_ERROR_DECRYPTING_ENCRYPTEDVALUE 125
-#define CRMF_R_ERROR_DECRYPTING_SYMMETRIC_KEY 106
-#define CRMF_R_ERROR_SETTING_PURPOSE 126
-#define CRMF_R_ERROR_VERIFYING_ENCRYPTEDKEY 127
-#define CRMF_R_FAILURE_OBTAINING_RANDOM 107
-#define CRMF_R_ITERATIONCOUNT_BELOW_100 108
-#define CRMF_R_MALFORMED_IV 101
-#define CRMF_R_NULL_ARGUMENT 109
-#define CRMF_R_POPOSKINPUT_NOT_SUPPORTED 113
-#define CRMF_R_POPO_INCONSISTENT_CENTRAL_KEYGEN 128
-#define CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY 117
-#define CRMF_R_POPO_MISSING 121
-#define CRMF_R_POPO_MISSING_PUBLIC_KEY 118
-#define CRMF_R_POPO_MISSING_SUBJECT 119
-#define CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED 120
-#define CRMF_R_SETTING_MAC_ALGOR_FAILURE 110
-#define CRMF_R_SETTING_OWF_ALGOR_FAILURE 111
-#define CRMF_R_UNSUPPORTED_ALGORITHM 112
-#define CRMF_R_UNSUPPORTED_CIPHER 114
-#define CRMF_R_UNSUPPORTED_METHOD_FOR_CREATING_POPO 115
-#define CRMF_R_UNSUPPORTED_POPO_METHOD 116
-
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/openssl/crypto.h b/deps/openssl/openssl/include/openssl/crypto.h
deleted file mode 100644
index 6d0e701ebd3..00000000000
--- a/deps/openssl/openssl/include/openssl/crypto.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/crypto.h"
diff --git a/deps/openssl/openssl/include/openssl/crypto.h.in b/deps/openssl/openssl/include/openssl/crypto.h.in
index 696eabb5b49..a9ade25b155 100644
--- a/deps/openssl/openssl/include/openssl/crypto.h.in
+++ b/deps/openssl/openssl/include/openssl/crypto.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -97,6 +97,11 @@ int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret,
 int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock);
 int CRYPTO_atomic_load_int(int *val, int *ret, CRYPTO_RWLOCK *lock);
 int CRYPTO_atomic_store(uint64_t *dst, uint64_t val, CRYPTO_RWLOCK *lock);
+int CRYPTO_atomic_store_int(int *dst, int val, CRYPTO_RWLOCK *lock);
+int CRYPTO_atomic_load_ptr(void **ptr, void **ret, CRYPTO_RWLOCK *lock);
+int CRYPTO_atomic_store_ptr(void **dst, void **val, CRYPTO_RWLOCK *lock);
+int CRYPTO_atomic_cmp_exch_ptr(void **ptr, void **expect, void *desire, CRYPTO_RWLOCK *lock,
+    int *lock_failed);

 /* No longer needed, so this is a no-op */
 #define OPENSSL_malloc_init() \
@@ -107,13 +112,25 @@ int CRYPTO_atomic_store(uint64_t *dst, uint64_t val, CRYPTO_RWLOCK *lock);
     CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
 #define OPENSSL_zalloc(num) \
     CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
+#define OPENSSL_malloc_array(num, size) \
+    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
+#define OPENSSL_calloc(num, size) \
+    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
 #define OPENSSL_aligned_alloc(num, alignment, freeptr) \
     CRYPTO_aligned_alloc(num, alignment, freeptr,      \
         OPENSSL_FILE, OPENSSL_LINE)
+#define OPENSSL_aligned_alloc_array(num, size, alignment, freeptr) \
+    CRYPTO_aligned_alloc_array(num, size, alignment, freeptr,      \
+        OPENSSL_FILE, OPENSSL_LINE)
 #define OPENSSL_realloc(addr, num) \
     CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
 #define OPENSSL_clear_realloc(addr, old_num, num) \
     CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
+#define OPENSSL_realloc_array(addr, num, size) \
+    CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
+#define OPENSSL_clear_realloc_array(addr, old_num, num, size) \
+    CRYPTO_clear_realloc_array(addr, old_num, num, size,      \
+        OPENSSL_FILE, OPENSSL_LINE)
 #define OPENSSL_clear_free(addr, num) \
     CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
 #define OPENSSL_free(addr) \
@@ -128,6 +145,10 @@ int CRYPTO_atomic_store(uint64_t *dst, uint64_t val, CRYPTO_RWLOCK *lock);
     CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
 #define OPENSSL_secure_zalloc(num) \
     CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
+#define OPENSSL_secure_malloc_array(num, size) \
+    CRYPTO_secure_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
+#define OPENSSL_secure_calloc(num, size) \
+    CRYPTO_secure_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
 #define OPENSSL_secure_free(addr) \
     CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
 #define OPENSSL_secure_clear_free(addr, num) \
@@ -339,9 +360,16 @@ void CRYPTO_get_mem_functions(CRYPTO_malloc_fn *malloc_fn,

 OSSL_CRYPTO_ALLOC void *CRYPTO_malloc(size_t num, const char *file, int line);
 OSSL_CRYPTO_ALLOC void *CRYPTO_zalloc(size_t num, const char *file, int line);
+OSSL_CRYPTO_ALLOC void *CRYPTO_malloc_array(size_t num, size_t size,
+    const char *file, int line);
+OSSL_CRYPTO_ALLOC void *CRYPTO_calloc(size_t num, size_t size,
+    const char *file, int line);
 OSSL_CRYPTO_ALLOC void *CRYPTO_aligned_alloc(size_t num, size_t align,
     void **freeptr, const char *file,
     int line);
+OSSL_CRYPTO_ALLOC void *CRYPTO_aligned_alloc_array(size_t num, size_t size,
+    size_t align, void **freeptr,
+    const char *file, int line);
 void *CRYPTO_memdup(const void *str, size_t siz, const char *file, int line);
 char *CRYPTO_strdup(const char *str, const char *file, int line);
 char *CRYPTO_strndup(const char *str, size_t s, const char *file, int line);
@@ -350,11 +378,19 @@ void CRYPTO_clear_free(void *ptr, size_t num, const char *file, int line);
 void *CRYPTO_realloc(void *addr, size_t num, const char *file, int line);
 void *CRYPTO_clear_realloc(void *addr, size_t old_num, size_t num,
     const char *file, int line);
+void *CRYPTO_realloc_array(void *addr, size_t num, size_t size,
+    const char *file, int line);
+void *CRYPTO_clear_realloc_array(void *addr, size_t old_num, size_t num,
+    size_t size, const char *file, int line);

 int CRYPTO_secure_malloc_init(size_t sz, size_t minsize);
 int CRYPTO_secure_malloc_done(void);
 OSSL_CRYPTO_ALLOC void *CRYPTO_secure_malloc(size_t num, const char *file, int line);
 OSSL_CRYPTO_ALLOC void *CRYPTO_secure_zalloc(size_t num, const char *file, int line);
+OSSL_CRYPTO_ALLOC void *CRYPTO_secure_malloc_array(size_t num, size_t size,
+    const char *file, int line);
+OSSL_CRYPTO_ALLOC void *CRYPTO_secure_calloc(size_t num, size_t size,
+    const char *file, int line);
 void CRYPTO_secure_free(void *ptr, const char *file, int line);
 void CRYPTO_secure_clear_free(void *ptr, size_t num,
     const char *file, int line);
@@ -456,13 +492,6 @@ int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len);
 #define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
 #define OPENSSL_INIT_NO_LOAD_CONFIG 0x00000080L
 #define OPENSSL_INIT_ASYNC 0x00000100L
-#define OPENSSL_INIT_ENGINE_RDRAND 0x00000200L
-#define OPENSSL_INIT_ENGINE_DYNAMIC 0x00000400L
-#define OPENSSL_INIT_ENGINE_OPENSSL 0x00000800L
-#define OPENSSL_INIT_ENGINE_CRYPTODEV 0x00001000L
-#define OPENSSL_INIT_ENGINE_CAPI 0x00002000L
-#define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L
-#define OPENSSL_INIT_ENGINE_AFALG 0x00008000L
 /* FREE:                                     0x00010000L */
 #define OPENSSL_INIT_ATFORK 0x00020000L
 /* OPENSSL_INIT_BASE_ONLY                    0x00040000L */
@@ -476,15 +505,22 @@ int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len);
 /* FREE: 0x80000000L */
 /* Max OPENSSL_INIT flag value is 0x80000000 */

-/* openssl and dasync not counted as builtin */
-#define OPENSSL_INIT_ENGINE_ALL_BUILTIN                       \
-    (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
-        | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | OPENSSL_INIT_ENGINE_PADLOCK)
+/* ENGINEs are no longer available */
+#define OPENSSL_INIT_ENGINE_ALL_BUILTIN 0
+
+#ifdef OPENSSL_ENGINE_STUBS
+#define OPENSSL_INIT_ENGINE_RDRAND 0
+#define OPENSSL_INIT_ENGINE_DYNAMIC 0
+#define OPENSSL_INIT_ENGINE_OPENSSL 0
+#define OPENSSL_INIT_ENGINE_CRYPTODEV 0
+#define OPENSSL_INIT_ENGINE_CAPI 0
+#define OPENSSL_INIT_ENGINE_PADLOCK 0
+#define OPENSSL_INIT_ENGINE_AFALG 0
+#endif

 /* Library initialisation functions */
 void OPENSSL_cleanup(void);
 int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
-int OPENSSL_atexit(void (*handler)(void));
 void OPENSSL_thread_stop(void);
 void OPENSSL_thread_stop_ex(OSSL_LIB_CTX *ctx);

diff --git a/deps/openssl/openssl/include/openssl/cryptoerr.h b/deps/openssl/openssl/include/openssl/cryptoerr.h
deleted file mode 100644
index 626e3e9be57..00000000000
--- a/deps/openssl/openssl/include/openssl/cryptoerr.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_CRYPTOERR_H
-#define OPENSSL_CRYPTOERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * CRYPTO reason codes.
- */
-#define CRYPTO_R_BAD_ALGORITHM_NAME 117
-#define CRYPTO_R_CONFLICTING_NAMES 118
-#define CRYPTO_R_HEX_STRING_TOO_SHORT 121
-#define CRYPTO_R_ILLEGAL_HEX_DIGIT 102
-#define CRYPTO_R_INSUFFICIENT_DATA_SPACE 106
-#define CRYPTO_R_INSUFFICIENT_PARAM_SIZE 107
-#define CRYPTO_R_INSUFFICIENT_SECURE_DATA_SPACE 108
-#define CRYPTO_R_INTEGER_OVERFLOW 127
-#define CRYPTO_R_INVALID_NEGATIVE_VALUE 122
-#define CRYPTO_R_INVALID_NULL_ARGUMENT 109
-#define CRYPTO_R_INVALID_OSSL_PARAM_TYPE 110
-#define CRYPTO_R_NO_PARAMS_TO_MERGE 131
-#define CRYPTO_R_NO_SPACE_FOR_TERMINATING_NULL 128
-#define CRYPTO_R_ODD_NUMBER_OF_DIGITS 103
-#define CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY 123
-#define CRYPTO_R_PARAM_NOT_INTEGER_TYPE 124
-#define CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE 129
-#define CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED 125
-#define CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT 130
-#define CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION 126
-#define CRYPTO_R_PROVIDER_ALREADY_EXISTS 104
-#define CRYPTO_R_PROVIDER_SECTION_ERROR 105
-#define CRYPTO_R_RANDOM_SECTION_ERROR 119
-#define CRYPTO_R_SECURE_MALLOC_FAILURE 111
-#define CRYPTO_R_STRING_TOO_LONG 112
-#define CRYPTO_R_TOO_MANY_BYTES 113
-#define CRYPTO_R_TOO_MANY_NAMES 132
-#define CRYPTO_R_TOO_MANY_RECORDS 114
-#define CRYPTO_R_TOO_SMALL_BUFFER 116
-#define CRYPTO_R_UNKNOWN_NAME_IN_RANDOM_SECTION 120
-#define CRYPTO_R_ZERO_LENGTH_NUMBER 115
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/cryptoerr_legacy.h b/deps/openssl/openssl/include/openssl/cryptoerr_legacy.h
index b1388a5b57b..0f170526a45 100644
--- a/deps/openssl/openssl/include/openssl/cryptoerr_legacy.h
+++ b/deps/openssl/openssl/include/openssl/cryptoerr_legacy.h
@@ -51,9 +51,6 @@ OSSL_DEPRECATEDIN_3_0 int ERR_load_DSA_strings(void);
 #ifndef OPENSSL_NO_EC
 OSSL_DEPRECATEDIN_3_0 int ERR_load_EC_strings(void);
 #endif
-#ifndef OPENSSL_NO_ENGINE
-OSSL_DEPRECATEDIN_3_0 int ERR_load_ENGINE_strings(void);
-#endif
 OSSL_DEPRECATEDIN_3_0 int ERR_load_ERR_strings(void);
 OSSL_DEPRECATEDIN_3_0 int ERR_load_EVP_strings(void);
 OSSL_DEPRECATEDIN_3_0 int ERR_load_KDF_strings(void);
@@ -751,7 +748,46 @@ OSSL_DEPRECATEDIN_3_0 int ERR_load_X509V3_strings(void);
 #define EC_F_VALIDATE_ECX_DERIVE 0
 #endif

-#ifndef OPENSSL_NO_ENGINE
+#ifdef OPENSSL_ENGINE_STUBS
+/*
+ * ENGINE reason codes.
+ */
+#define ENGINE_R_ALREADY_LOADED 0
+#define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 0
+#define ENGINE_R_CMD_NOT_EXECUTABLE 0
+#define ENGINE_R_COMMAND_TAKES_INPUT 0
+#define ENGINE_R_COMMAND_TAKES_NO_INPUT 0
+#define ENGINE_R_CONFLICTING_ENGINE_ID 0
+#define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 0
+#define ENGINE_R_DSO_FAILURE 0
+#define ENGINE_R_DSO_NOT_FOUND 0
+#define ENGINE_R_ENGINES_SECTION_ERROR 0
+#define ENGINE_R_ENGINE_CONFIGURATION_ERROR 0
+#define ENGINE_R_ENGINE_IS_NOT_IN_LIST 0
+#define ENGINE_R_ENGINE_SECTION_ERROR 0
+#define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 0
+#define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 0
+#define ENGINE_R_FINISH_FAILED 0
+#define ENGINE_R_ID_OR_NAME_MISSING 0
+#define ENGINE_R_INIT_FAILED 0
+#define ENGINE_R_INTERNAL_LIST_ERROR 0
+#define ENGINE_R_INVALID_ARGUMENT 0
+#define ENGINE_R_INVALID_CMD_NAME 0
+#define ENGINE_R_INVALID_CMD_NUMBER 0
+#define ENGINE_R_INVALID_INIT_VALUE 0
+#define ENGINE_R_INVALID_STRING 0
+#define ENGINE_R_NOT_INITIALISED 0
+#define ENGINE_R_NOT_LOADED 0
+#define ENGINE_R_NO_CONTROL_FUNCTION 0
+#define ENGINE_R_NO_INDEX 0
+#define ENGINE_R_NO_LOAD_FUNCTION 0
+#define ENGINE_R_NO_REFERENCE 0
+#define ENGINE_R_NO_SUCH_ENGINE 0
+#define ENGINE_R_UNIMPLEMENTED_CIPHER 0
+#define ENGINE_R_UNIMPLEMENTED_DIGEST 0
+#define ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD 0
+#define ENGINE_R_VERSION_INCOMPATIBILITY 0
+
 /*
  * ENGINE function codes.
  */
diff --git a/deps/openssl/openssl/include/openssl/ct.h b/deps/openssl/openssl/include/openssl/ct.h
deleted file mode 100644
index 7ebb8438713..00000000000
--- a/deps/openssl/openssl/include/openssl/ct.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/ct.h"
diff --git a/deps/openssl/openssl/include/openssl/ct.h.in b/deps/openssl/openssl/include/openssl/ct.h.in
index a6103980d43..4b0d866d249 100644
--- a/deps/openssl/openssl/include/openssl/ct.h.in
+++ b/deps/openssl/openssl/include/openssl/ct.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -499,6 +499,14 @@ CTLOG_STORE *CTLOG_STORE_new(void);
  */
 void CTLOG_STORE_free(CTLOG_STORE *store);

+/*
+ * Adds a CT log to a CTLOG_STORE.
+ * Takes ownership of the CTLOG on success - the caller must not free it after
+ * a successful call. On failure, the caller retains ownership.
+ * Returns 1 on success, 0 on failure.
+ */
+__owur int CTLOG_STORE_add0_log(CTLOG_STORE *store, CTLOG *log);
+
 /*
  * Finds a CT log in the store based on its log ID.
  * Returns the CT log, or NULL if no match is found.
diff --git a/deps/openssl/openssl/include/openssl/cterr.h b/deps/openssl/openssl/include/openssl/cterr.h
deleted file mode 100644
index 950b7b388cc..00000000000
--- a/deps/openssl/openssl/include/openssl/cterr.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_CTERR_H
-#define OPENSSL_CTERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-#ifndef OPENSSL_NO_CT
-
-/*
- * CT reason codes.
- */
-#define CT_R_BASE64_DECODE_ERROR 108
-#define CT_R_INVALID_LOG_ID_LENGTH 100
-#define CT_R_LOG_CONF_INVALID 109
-#define CT_R_LOG_CONF_INVALID_KEY 110
-#define CT_R_LOG_CONF_MISSING_DESCRIPTION 111
-#define CT_R_LOG_CONF_MISSING_KEY 112
-#define CT_R_LOG_KEY_INVALID 113
-#define CT_R_SCT_FUTURE_TIMESTAMP 116
-#define CT_R_SCT_INVALID 104
-#define CT_R_SCT_INVALID_SIGNATURE 107
-#define CT_R_SCT_LIST_INVALID 105
-#define CT_R_SCT_LOG_ID_MISMATCH 114
-#define CT_R_SCT_NOT_SET 106
-#define CT_R_SCT_UNSUPPORTED_VERSION 115
-#define CT_R_UNRECOGNIZED_SIGNATURE_NID 101
-#define CT_R_UNSUPPORTED_ENTRY_TYPE 102
-#define CT_R_UNSUPPORTED_VERSION 103
-
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/openssl/decodererr.h b/deps/openssl/openssl/include/openssl/decodererr.h
deleted file mode 100644
index 5fdeace4f97..00000000000
--- a/deps/openssl/openssl/include/openssl/decodererr.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_DECODERERR_H
-#define OPENSSL_DECODERERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * OSSL_DECODER reason codes.
- */
-#define OSSL_DECODER_R_COULD_NOT_DECODE_OBJECT 101
-#define OSSL_DECODER_R_DECODER_NOT_FOUND 102
-#define OSSL_DECODER_R_MISSING_GET_PARAMS 100
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/dh.h b/deps/openssl/openssl/include/openssl/dh.h
index 6d0abe2d217..0da0d95644f 100644
--- a/deps/openssl/openssl/include/openssl/dh.h
+++ b/deps/openssl/openssl/include/openssl/dh.h
@@ -205,7 +205,7 @@ OSSL_DEPRECATEDIN_3_0 const DH_METHOD *DH_OpenSSL(void);
 OSSL_DEPRECATEDIN_3_0 void DH_set_default_method(const DH_METHOD *meth);
 OSSL_DEPRECATEDIN_3_0 const DH_METHOD *DH_get_default_method(void);
 OSSL_DEPRECATEDIN_3_0 int DH_set_method(DH *dh, const DH_METHOD *meth);
-OSSL_DEPRECATEDIN_3_0 DH *DH_new_method(ENGINE *engine);
+OSSL_DEPRECATEDIN_3_0 DH *DH_new_method(ENGINE *engine /* must be NULL */);

 OSSL_DEPRECATEDIN_3_0 DH *DH_new(void);
 OSSL_DEPRECATEDIN_3_0 void DH_free(DH *dh);
@@ -275,7 +275,6 @@ OSSL_DEPRECATEDIN_3_0 const BIGNUM *DH_get0_pub_key(const DH *dh);
 OSSL_DEPRECATEDIN_3_0 void DH_clear_flags(DH *dh, int flags);
 OSSL_DEPRECATEDIN_3_0 int DH_test_flags(const DH *dh, int flags);
 OSSL_DEPRECATEDIN_3_0 void DH_set_flags(DH *dh, int flags);
-OSSL_DEPRECATEDIN_3_0 ENGINE *DH_get0_engine(DH *d);
 OSSL_DEPRECATEDIN_3_0 long DH_get_length(const DH *dh);
 OSSL_DEPRECATEDIN_3_0 int DH_set_length(DH *dh, long length);

diff --git a/deps/openssl/openssl/include/openssl/dherr.h b/deps/openssl/openssl/include/openssl/dherr.h
deleted file mode 100644
index 753659be16f..00000000000
--- a/deps/openssl/openssl/include/openssl/dherr.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_DHERR_H
-#define OPENSSL_DHERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-#ifndef OPENSSL_NO_DH
-
-/*
- * DH reason codes.
- */
-#define DH_R_BAD_FFC_PARAMETERS 127
-#define DH_R_BAD_GENERATOR 101
-#define DH_R_BN_DECODE_ERROR 109
-#define DH_R_BN_ERROR 106
-#define DH_R_CHECK_INVALID_J_VALUE 115
-#define DH_R_CHECK_INVALID_Q_VALUE 116
-#define DH_R_CHECK_PUBKEY_INVALID 122
-#define DH_R_CHECK_PUBKEY_TOO_LARGE 123
-#define DH_R_CHECK_PUBKEY_TOO_SMALL 124
-#define DH_R_CHECK_P_NOT_PRIME 117
-#define DH_R_CHECK_P_NOT_SAFE_PRIME 118
-#define DH_R_CHECK_Q_NOT_PRIME 119
-#define DH_R_DECODE_ERROR 104
-#define DH_R_INVALID_PARAMETER_NAME 110
-#define DH_R_INVALID_PARAMETER_NID 114
-#define DH_R_INVALID_PUBKEY 102
-#define DH_R_INVALID_SECRET 128
-#define DH_R_INVALID_SIZE 129
-#define DH_R_KDF_PARAMETER_ERROR 112
-#define DH_R_KEYS_NOT_SET 108
-#define DH_R_MISSING_PUBKEY 125
-#define DH_R_MODULUS_TOO_LARGE 103
-#define DH_R_MODULUS_TOO_SMALL 126
-#define DH_R_NOT_SUITABLE_GENERATOR 120
-#define DH_R_NO_PARAMETERS_SET 107
-#define DH_R_NO_PRIVATE_VALUE 100
-#define DH_R_PARAMETER_ENCODING_ERROR 105
-#define DH_R_PEER_KEY_ERROR 111
-#define DH_R_Q_TOO_LARGE 130
-#define DH_R_SHARED_INFO_ERROR 113
-#define DH_R_UNABLE_TO_CHECK_GENERATOR 121
-
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/openssl/dsa.h b/deps/openssl/openssl/include/openssl/dsa.h
index 61baa64bee7..93eebe64ba7 100644
--- a/deps/openssl/openssl/include/openssl/dsa.h
+++ b/deps/openssl/openssl/include/openssl/dsa.h
@@ -127,7 +127,7 @@ OSSL_DEPRECATEDIN_3_0 int DSA_set_method(DSA *dsa, const DSA_METHOD *);
 OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *DSA_get_method(DSA *d);

 OSSL_DEPRECATEDIN_3_0 DSA *DSA_new(void);
-OSSL_DEPRECATEDIN_3_0 DSA *DSA_new_method(ENGINE *engine);
+OSSL_DEPRECATEDIN_3_0 DSA *DSA_new_method(ENGINE *engine /* must be NULL */);
 OSSL_DEPRECATEDIN_3_0 void DSA_free(DSA *r);
 /* "up" the DSA object's reference count */
 OSSL_DEPRECATEDIN_3_0 int DSA_up_ref(DSA *r);
@@ -217,7 +217,6 @@ OSSL_DEPRECATEDIN_3_0 const BIGNUM *DSA_get0_priv_key(const DSA *d);
 OSSL_DEPRECATEDIN_3_0 void DSA_clear_flags(DSA *d, int flags);
 OSSL_DEPRECATEDIN_3_0 int DSA_test_flags(const DSA *d, int flags);
 OSSL_DEPRECATEDIN_3_0 void DSA_set_flags(DSA *d, int flags);
-OSSL_DEPRECATEDIN_3_0 ENGINE *DSA_get0_engine(DSA *d);

 OSSL_DEPRECATEDIN_3_0 DSA_METHOD *DSA_meth_new(const char *name, int flags);
 OSSL_DEPRECATEDIN_3_0 void DSA_meth_free(DSA_METHOD *dsam);
diff --git a/deps/openssl/openssl/include/openssl/dsaerr.h b/deps/openssl/openssl/include/openssl/dsaerr.h
deleted file mode 100644
index cc5f4bfbb7c..00000000000
--- a/deps/openssl/openssl/include/openssl/dsaerr.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_DSAERR_H
-#define OPENSSL_DSAERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-#ifndef OPENSSL_NO_DSA
-
-/*
- * DSA reason codes.
- */
-#define DSA_R_BAD_FFC_PARAMETERS 114
-#define DSA_R_BAD_Q_VALUE 102
-#define DSA_R_BN_DECODE_ERROR 108
-#define DSA_R_BN_ERROR 109
-#define DSA_R_DECODE_ERROR 104
-#define DSA_R_INVALID_DIGEST_TYPE 106
-#define DSA_R_INVALID_PARAMETERS 112
-#define DSA_R_MISSING_PARAMETERS 101
-#define DSA_R_MISSING_PRIVATE_KEY 111
-#define DSA_R_MODULUS_TOO_LARGE 103
-#define DSA_R_NO_PARAMETERS_SET 107
-#define DSA_R_PARAMETER_ENCODING_ERROR 105
-#define DSA_R_P_NOT_PRIME 115
-#define DSA_R_Q_NOT_PRIME 113
-#define DSA_R_SEED_LEN_SMALL 110
-#define DSA_R_TOO_MANY_RETRIES 116
-
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/openssl/dtls1.h b/deps/openssl/openssl/include/openssl/dtls1.h
index 0b42948d02d..a0863556efc 100644
--- a/deps/openssl/openssl/include/openssl/dtls1.h
+++ b/deps/openssl/openssl/include/openssl/dtls1.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -27,17 +27,19 @@ extern "C" {
 /* DTLS*_VERSION constants are defined in prov_ssl.h */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
 #define DTLS_MIN_VERSION DTLS1_VERSION
-#define DTLS_MAX_VERSION DTLS1_2_VERSION
+#define DTLS_MAX_VERSION DTLS1_3_VERSION
 #endif
 #define DTLS1_VERSION_MAJOR 0xFE

 /* Special value for method supporting multiple versions */
 #define DTLS_ANY_VERSION 0x1FFFF

-/* lengths of messages */
+/* DTLS records and messages lengths and offsets */

 #define DTLS1_COOKIE_LENGTH 255

+#define DTLS1_RT_HEADER_SEQ_OFFS 5
+#define DTLS1_RT_HEADER_SEQ_LEN 6
 #define DTLS1_RT_HEADER_LENGTH 13

 #define DTLS1_HM_HEADER_LENGTH 12
@@ -51,6 +53,18 @@ extern "C" {

 #define DTLS1_TMO_ALERT_COUNT 12

+/* DTLS 1.3 Unified header */
+#define DTLS13_UNI_HDR_FIXED_LENGTH 5
+#define DTLS13_UNI_HDR_FIX_BITS 0x20
+#define DTLS13_UNI_HDR_CID_BIT 0x10
+#define DTLS13_UNI_HDR_SEQ_BIT 0x08
+#define DTLS13_UNI_HDR_SEQ_OFF 1
+#define DTLS13_UNI_HDR_LEN_BIT 0x04
+#define DTLS13_UNI_HDR_FIX_BITS_MASK 0xe0
+#define DTLS13_UNI_HDR_EPOCH_BITS_MASK 0x03
+
+#define DTLS13_CIPHERTEXT_MINSIZE 16
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/deps/openssl/openssl/include/openssl/e_os2.h b/deps/openssl/openssl/include/openssl/e_os2.h
index 86a572bb12e..8cec931f55d 100644
--- a/deps/openssl/openssl/include/openssl/e_os2.h
+++ b/deps/openssl/openssl/include/openssl/e_os2.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -72,14 +72,11 @@ extern "C" {
 #if defined(OPENSSL_SYS_WINNT)
 #undef OPENSSL_SYS_UNIX
 #endif
-#if defined(OPENSSL_SYS_WINCE)
-#undef OPENSSL_SYS_UNIX
-#endif
 #endif
 #endif

 /* Anything that tries to look like Microsoft is "Windows" */
-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE)
+#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT)
 #undef OPENSSL_SYS_UNIX
 #define OPENSSL_SYS_WINDOWS
 #ifndef OPENSSL_SYS_MSDOS
@@ -184,33 +181,6 @@ extern "C" {
 #define OPENSSL_EXTERN extern
 #endif

-#ifdef _WIN32
-#ifdef _WIN64
-#define ossl_ssize_t __int64
-#define OSSL_SSIZE_MAX _I64_MAX
-#else
-#define ossl_ssize_t int
-#define OSSL_SSIZE_MAX INT_MAX
-#endif
-#endif
-
-#if defined(OPENSSL_SYS_UEFI) && !defined(ossl_ssize_t)
-#define ossl_ssize_t INTN
-#define OSSL_SSIZE_MAX MAX_INTN
-#endif
-
-#ifndef ossl_ssize_t
-#include <sys/types.h>
-#define ossl_ssize_t ssize_t
-#if defined(SSIZE_MAX)
-#define OSSL_SSIZE_MAX SSIZE_MAX
-#elif defined(_POSIX_SSIZE_MAX)
-#define OSSL_SSIZE_MAX _POSIX_SSIZE_MAX
-#else
-#define OSSL_SSIZE_MAX ((ssize_t)(SIZE_MAX >> 1))
-#endif
-#endif
-
 #if defined(UNUSEDRESULT_DEBUG)
 #define __owur __attribute__((__warn_unused_result__))
 #else
@@ -230,24 +200,15 @@ typedef UINT32 uint32_t;
 typedef INT64 int64_t;
 typedef UINT64 uint64_t;
 typedef UINTN uintptr_t;
+#ifndef OSSL_SSIZE_MAX
+typedef INTN ossl_ssize_t;
+#define OSSL_SSIZE_MAX MAX_INTN
+#endif
 #elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__osf__) || defined(__sgi) || defined(__hpux) || defined(OPENSSL_SYS_VMS) || defined(__OpenBSD__)
 #include <inttypes.h>
 #undef OPENSSL_NO_INTTYPES_H
 /* Because the specs say that inttypes.h includes stdint.h if present */
 #undef OPENSSL_NO_STDINT_H
-#elif defined(_MSC_VER) && _MSC_VER < 1600
-/*
- * minimally required typdefs for systems not supporting inttypes.h or
- * stdint.h: currently just older VC++
- */
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef short int16_t;
-typedef unsigned short uint16_t;
-typedef int int32_t;
-typedef unsigned int uint32_t;
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
 #elif defined(OPENSSL_SYS_TANDEM)
 #include <stdint.h>
 #include <sys/types.h>
@@ -255,6 +216,29 @@ typedef unsigned __int64 uint64_t;
 #include <stdint.h>
 #undef OPENSSL_NO_STDINT_H
 #endif
+
+#ifdef _WIN32
+#ifdef _WIN64
+typedef int64_t ossl_ssize_t;
+#define OSSL_SSIZE_MAX INT64_MAX
+#else
+typedef int ossl_ssize_t;
+#define OSSL_SSIZE_MAX INT_MAX
+#endif
+#endif
+
+#ifndef OSSL_SSIZE_MAX
+#include <sys/types.h>
+typedef ssize_t ossl_ssize_t;
+#if defined(SSIZE_MAX)
+#define OSSL_SSIZE_MAX SSIZE_MAX
+#elif defined(_POSIX_SSIZE_MAX)
+#define OSSL_SSIZE_MAX _POSIX_SSIZE_MAX
+#else
+#define OSSL_SSIZE_MAX ((ssize_t)(SIZE_MAX >> 1))
+#endif
+#endif
+
 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && defined(INTMAX_MAX) && defined(UINTMAX_MAX)
 typedef intmax_t ossl_intmax_t;
 typedef uintmax_t ossl_uintmax_t;
@@ -269,7 +253,7 @@ typedef uint64_t ossl_uintmax_t;
 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 /* just use inline */
 #define ossl_inline inline
-#elif defined(__GNUC__) && __GNUC__ >= 2
+#elif defined(__GNUC__)
 #define ossl_inline __inline__
 #elif defined(_MSC_VER)
 /*
@@ -287,7 +271,7 @@ typedef uint64_t ossl_uintmax_t;

 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__cplusplus)
 #define ossl_noreturn _Noreturn
-#elif defined(__GNUC__) && __GNUC__ >= 2
+#elif defined(__GNUC__)
 #define ossl_noreturn __attribute__((noreturn))
 #else
 #define ossl_noreturn
@@ -300,6 +284,22 @@ typedef uint64_t ossl_uintmax_t;
 #define ossl_unused
 #endif

+/*
+ * OPENSSL_NONSTRING: mark a char/unsigned char buffer object or struct field
+ * whose contents are not necessarily NUL terminated, so that misuse with C
+ * string functions (strlen(), strcpy(), "%s", ...) is diagnosed by compilers
+ * that support the attribute. It has no effect elsewhere.
+ */
+#if defined(__has_attribute)
+#if __has_attribute(nonstring)
+#define OPENSSL_NONSTRING __attribute__((nonstring))
+#else
+#define OPENSSL_NONSTRING
+#endif
+#else
+#define OPENSSL_NONSTRING
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/deps/openssl/openssl/include/openssl/e_ostime.h b/deps/openssl/openssl/include/openssl/e_ostime.h
index c0f1c547db7..2927aee409f 100644
--- a/deps/openssl/openssl/include/openssl/e_ostime.h
+++ b/deps/openssl/openssl/include/openssl/e_ostime.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -21,6 +21,7 @@
  * substantial set of headers on some platforms (e.g. <winsock2.h> on Win32).
  */

+/* IWYU pragma: begin_exports */
 #if defined(OPENSSL_SYS_WINDOWS)
 #if !defined(_WINSOCKAPI_)
 /*
@@ -34,5 +35,6 @@
 #else
 #include <sys/time.h>
 #endif
+/* IWYU pragma: end_exports */

 #endif
diff --git a/deps/openssl/openssl/include/openssl/ec.h b/deps/openssl/openssl/include/openssl/ec.h
index cdde09ca62b..2119a9b85f0 100644
--- a/deps/openssl/openssl/include/openssl/ec.h
+++ b/deps/openssl/openssl/include/openssl/ec.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -20,8 +20,6 @@
 #include <openssl/opensslconf.h>
 #include <openssl/types.h>

-#include <string.h>
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -253,6 +251,14 @@ const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group);
  */
 int EC_GROUP_order_bits(const EC_GROUP *group);

+/** Gets the symmetric-equivalent security bit size an EC_GROUP.
+ * This is rounded down to one of the standard sizes, (80, 112,
+ * 128, 192, 256) or reported as-is when smaller than 80.
+ *  \param  group  EC_GROUP object
+ *  \return symmetric-equivalent security bits.
+ */
+int EC_GROUP_security_bits(const EC_GROUP *group);
+
 /** Gets the cofactor of a EC_GROUP
  *  \param  group     EC_GROUP object
  *  \param  cofactor  BIGNUM to which the cofactor is copied
@@ -1032,12 +1038,6 @@ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_dup(const EC_KEY *src);
  */
 OSSL_DEPRECATEDIN_3_0 int EC_KEY_up_ref(EC_KEY *key);

-/** Returns the ENGINE object of a EC_KEY object
- *  \param  eckey  EC_KEY object
- *  \return the ENGINE object (possibly NULL).
- */
-OSSL_DEPRECATEDIN_3_0 ENGINE *EC_KEY_get0_engine(const EC_KEY *eckey);
-
 /** Returns the EC_GROUP object of a EC_KEY object
  *  \param  key  EC_KEY object
  *  \return the EC_GROUP object (possibly NULL).
@@ -1548,8 +1548,6 @@ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth,
         EC_KEY *eckey));
 #endif /* OPENSSL_NO_DEPRECATED_3_0 */

-#define EVP_EC_gen(curve) \
-    EVP_PKEY_Q_keygen(NULL, NULL, "EC", (char *)(strstr(curve, "")))
 /* strstr is used to enable type checking for the variadic string arg */
 #define ECParameters_dup(x) ASN1_dup_of(EC_KEY, i2d_ECParameters, \
     d2i_ECParameters, x)
diff --git a/deps/openssl/openssl/include/openssl/ecdh.h b/deps/openssl/openssl/include/openssl/ecdh.h
index 56bd4cc2ce0..8d8d0e69117 100644
--- a/deps/openssl/openssl/include/openssl/ecdh.h
+++ b/deps/openssl/openssl/include/openssl/ecdh.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,4 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_OPENSSL_ECDH_H)
+#define OSSL_OPENSSL_ECDH_H
+
 #include <openssl/ec.h>
+
+#endif /* !defined(OSSL_OPENSSL_ECDH_H) */
diff --git a/deps/openssl/openssl/include/openssl/ecdsa.h b/deps/openssl/openssl/include/openssl/ecdsa.h
index 56bd4cc2ce0..1fd6713f973 100644
--- a/deps/openssl/openssl/include/openssl/ecdsa.h
+++ b/deps/openssl/openssl/include/openssl/ecdsa.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,4 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_OPENSSL_ECDSA_H)
+#define OSSL_OPENSSL_ECDSA_H
+
 #include <openssl/ec.h>
+
+#endif /* !defined(OSSL_OPENSSL_ECDSA_H) */
diff --git a/deps/openssl/openssl/include/openssl/ecerr.h b/deps/openssl/openssl/include/openssl/ecerr.h
deleted file mode 100644
index e4d26aa1115..00000000000
--- a/deps/openssl/openssl/include/openssl/ecerr.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_ECERR_H
-#define OPENSSL_ECERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-#ifndef OPENSSL_NO_EC
-
-/*
- * EC reason codes.
- */
-#define EC_R_ASN1_ERROR 115
-#define EC_R_BAD_SIGNATURE 156
-#define EC_R_BIGNUM_OUT_OF_RANGE 144
-#define EC_R_BUFFER_TOO_SMALL 100
-#define EC_R_CANNOT_INVERT 165
-#define EC_R_COORDINATES_OUT_OF_RANGE 146
-#define EC_R_CURVE_DOES_NOT_SUPPORT_ECDH 160
-#define EC_R_CURVE_DOES_NOT_SUPPORT_ECDSA 170
-#define EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING 159
-#define EC_R_DECODE_ERROR 142
-#define EC_R_DISCRIMINANT_IS_ZERO 118
-#define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119
-#define EC_R_EXPLICIT_PARAMS_NOT_SUPPORTED 127
-#define EC_R_FAILED_MAKING_PUBLIC_KEY 166
-#define EC_R_FIELD_TOO_LARGE 143
-#define EC_R_GF2M_NOT_SUPPORTED 147
-#define EC_R_GROUP2PKPARAMETERS_FAILURE 120
-#define EC_R_I2D_ECPKPARAMETERS_FAILURE 121
-#define EC_R_INCOMPATIBLE_OBJECTS 101
-#define EC_R_INVALID_A 168
-#define EC_R_INVALID_ARGUMENT 112
-#define EC_R_INVALID_B 169
-#define EC_R_INVALID_COFACTOR 171
-#define EC_R_INVALID_COMPRESSED_POINT 110
-#define EC_R_INVALID_COMPRESSION_BIT 109
-#define EC_R_INVALID_CURVE 141
-#define EC_R_INVALID_DIGEST 151
-#define EC_R_INVALID_DIGEST_TYPE 138
-#define EC_R_INVALID_ENCODING 102
-#define EC_R_INVALID_FIELD 103
-#define EC_R_INVALID_FORM 104
-#define EC_R_INVALID_GENERATOR 173
-#define EC_R_INVALID_GROUP_ORDER 122
-#define EC_R_INVALID_KEY 116
-#define EC_R_INVALID_LENGTH 117
-#define EC_R_INVALID_NAMED_GROUP_CONVERSION 174
-#define EC_R_INVALID_OUTPUT_LENGTH 161
-#define EC_R_INVALID_P 172
-#define EC_R_INVALID_PEER_KEY 133
-#define EC_R_INVALID_PENTANOMIAL_BASIS 132
-#define EC_R_INVALID_PRIVATE_KEY 123
-#define EC_R_INVALID_SEED 175
-#define EC_R_INVALID_TRINOMIAL_BASIS 137
-#define EC_R_KDF_PARAMETER_ERROR 148
-#define EC_R_KEYS_NOT_SET 140
-#define EC_R_LADDER_POST_FAILURE 136
-#define EC_R_LADDER_PRE_FAILURE 153
-#define EC_R_LADDER_STEP_FAILURE 162
-#define EC_R_MISSING_OID 167
-#define EC_R_MISSING_PARAMETERS 124
-#define EC_R_MISSING_PRIVATE_KEY 125
-#define EC_R_NEED_NEW_SETUP_VALUES 157
-#define EC_R_NOT_A_NIST_PRIME 135
-#define EC_R_NOT_IMPLEMENTED 126
-#define EC_R_NOT_INITIALIZED 111
-#define EC_R_NO_PARAMETERS_SET 139
-#define EC_R_NO_PRIVATE_VALUE 154
-#define EC_R_OPERATION_NOT_SUPPORTED 152
-#define EC_R_PASSED_NULL_PARAMETER 134
-#define EC_R_PEER_KEY_ERROR 149
-#define EC_R_POINT_ARITHMETIC_FAILURE 155
-#define EC_R_POINT_AT_INFINITY 106
-#define EC_R_POINT_COORDINATES_BLIND_FAILURE 163
-#define EC_R_POINT_IS_NOT_ON_CURVE 107
-#define EC_R_RANDOM_NUMBER_GENERATION_FAILED 158
-#define EC_R_SHARED_INFO_ERROR 150
-#define EC_R_SLOT_FULL 108
-#define EC_R_TOO_MANY_RETRIES 176
-#define EC_R_UNDEFINED_GENERATOR 113
-#define EC_R_UNDEFINED_ORDER 128
-#define EC_R_UNKNOWN_COFACTOR 164
-#define EC_R_UNKNOWN_GROUP 129
-#define EC_R_UNKNOWN_ORDER 114
-#define EC_R_UNSUPPORTED_FIELD 131
-#define EC_R_WRONG_CURVE_PARAMETERS 145
-#define EC_R_WRONG_ORDER 130
-
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/openssl/ech.h b/deps/openssl/openssl/include/openssl/ech.h
new file mode 100644
index 00000000000..a8c928440b2
--- /dev/null
+++ b/deps/openssl/openssl/include/openssl/ech.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * Externally-visible data structures and prototypes for handling
+ * shared-mode Encrypted ClientHello (ECH).
+ */
+#ifndef OPENSSL_ECH_H
+#define OPENSSL_ECH_H
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <openssl/ssl.h>
+#include <openssl/hpke.h>
+
+#ifndef OPENSSL_NO_ECH
+
+/*
+ * Some externally visible limits - most used for sanity checks that could be
+ * bigger if needed, but that work for now
+ */
+#define OSSL_ECH_MAX_PAYLOAD_LEN 1500 /* max ECH ciphertext to en/decode */
+#define OSSL_ECH_MIN_ECHCONFIG_LEN 32 /* min for all encodings */
+#define OSSL_ECH_MAX_ECHCONFIG_LEN 1500 /* max for all encodings */
+#define OSSL_ECH_MAX_ECHCONFIGEXT_LEN 512 /* ECHConfig extension max */
+#define OSSL_ECH_MAX_MAXNAMELEN 255 /* ECHConfig max for max name length */
+#define OSSL_ECH_MAX_PUBLICNAME 255 /* max ECHConfig public name length */
+#define OSSL_ECH_MAX_ALPNLEN 255 /* max alpn length */
+#define OSSL_ECH_OUTERS_MAX 20 /* max extensions we compress via outer-exts */
+#define OSSL_ECH_ALLEXTS_MAX 32 /* max total number of extension we allow */
+
+/*
+ * ECH version. We only support RFC 9849 as of now.  As/if new ECHConfig
+ * versions are added, those will be noted here.
+ */
+#define OSSL_ECH_RFC9849_VERSION 0xfe0d /* official ECHConfig version */
+/* latest version from an RFC */
+#define OSSL_ECH_CURRENT_VERSION OSSL_ECH_RFC9849_VERSION
+
+/* Return codes from SSL_ech_get1_status */
+#define SSL_ECH_STATUS_BACKEND 4 /* ECH backend: saw an ech_is_inner */
+#define SSL_ECH_STATUS_GREASE_ECH 3 /* GREASEd and got an ECH in return */
+#define SSL_ECH_STATUS_GREASE 2 /* ECH GREASE happened  */
+#define SSL_ECH_STATUS_SUCCESS 1 /* Success */
+#define SSL_ECH_STATUS_FAILED 0 /* Some internal or protocol error */
+#define SSL_ECH_STATUS_BAD_CALL -100 /* Some in/out arguments were NULL */
+#define SSL_ECH_STATUS_NOT_TRIED -101 /* ECH wasn't attempted  */
+#define SSL_ECH_STATUS_BAD_NAME -102 /* ECH ok but server cert bad */
+#define SSL_ECH_STATUS_NOT_CONFIGURED -103 /* ECH wasn't configured */
+#define SSL_ECH_STATUS_FAILED_ECH -105 /* Tried, failed, got an ECH, from a good name */
+#define SSL_ECH_STATUS_FAILED_ECH_BAD_NAME -106 /* Tried, failed, got an ECH, from a bad name */
+
+/* if a caller wants to index the last entry in the store */
+#define OSSL_ECHSTORE_LAST -1
+/* if a caller wants all entries in the store, e.g. to print public values */
+#define OSSL_ECHSTORE_ALL -2
+
+/* Values for the for_retry inputs */
+#define OSSL_ECH_FOR_RETRY 1
+#define OSSL_ECH_NO_RETRY 0
+
+/*
+ * API calls built around OSSL_ECHSTORE
+ */
+OSSL_ECHSTORE *OSSL_ECHSTORE_new(OSSL_LIB_CTX *libctx, const char *propq);
+void OSSL_ECHSTORE_free(OSSL_ECHSTORE *es);
+int OSSL_ECHSTORE_new_config(OSSL_ECHSTORE *es,
+    uint16_t echversion, uint8_t max_name_length,
+    const char *public_name, OSSL_HPKE_SUITE suite);
+int OSSL_ECHSTORE_write_pem(OSSL_ECHSTORE *es, int index, BIO *out);
+int OSSL_ECHSTORE_read_echconfiglist(OSSL_ECHSTORE *es, BIO *in);
+int OSSL_ECHSTORE_get1_info(OSSL_ECHSTORE *es, int index, time_t *loaded_secs,
+    char **public_name, char **echconfig,
+    int *has_private, int *for_retry);
+int OSSL_ECHSTORE_downselect(OSSL_ECHSTORE *es, int index);
+int OSSL_ECHSTORE_set1_key_and_read_pem(OSSL_ECHSTORE *es, EVP_PKEY *priv,
+    BIO *in, int for_retry);
+int OSSL_ECHSTORE_read_pem(OSSL_ECHSTORE *es, BIO *in, int for_retry);
+int OSSL_ECHSTORE_num_entries(const OSSL_ECHSTORE *es, int *numentries);
+int OSSL_ECHSTORE_num_keys(OSSL_ECHSTORE *es, int *numkeys);
+int OSSL_ECHSTORE_flush_keys(OSSL_ECHSTORE *es, time_t age);
+
+/*
+ * APIs relating OSSL_ECHSTORE to SSL/SSL_CTX
+ */
+int SSL_CTX_set1_echstore(SSL_CTX *ctx, OSSL_ECHSTORE *es);
+int SSL_set1_echstore(SSL *s, OSSL_ECHSTORE *es);
+
+OSSL_ECHSTORE *SSL_CTX_get1_echstore(const SSL_CTX *ctx);
+OSSL_ECHSTORE *SSL_get1_echstore(const SSL *s);
+
+int SSL_ech_set1_server_names(SSL *s, const char *inner_name,
+    const char *outer_name, int no_outer);
+int SSL_ech_set1_outer_server_name(SSL *s, const char *outer_name, int no_outer);
+/*
+ * Note that this function returns 1 for success and 0 for error. This
+ * contrasts with SSL_set1_alpn_protos() which (unusually for OpenSSL)
+ * returns 0 for success and 1 on error.
+ */
+int SSL_ech_set1_outer_alpn_protos(SSL *s, const unsigned char *protos,
+    const size_t protos_len);
+
+int SSL_ech_get1_status(SSL *s, char **inner_sni, char **outer_sni);
+int SSL_ech_set1_grease_suite(SSL *s, const char *suite);
+int SSL_ech_set_grease_type(SSL *s, uint16_t type);
+typedef unsigned int (*SSL_ech_cb_func)(SSL *s, const char *str);
+void SSL_ech_set_callback(SSL *s, SSL_ech_cb_func f);
+int SSL_ech_get1_retry_config(SSL *s, unsigned char **ec, size_t *eclen);
+
+/*
+ * Note that this function returns 1 for success and 0 for error. This
+ * contrasts with SSL_set1_alpn_protos() which (unusually for OpenSSL)
+ * returns 0 for success and 1 on error.
+ */
+int SSL_CTX_ech_set1_outer_alpn_protos(SSL_CTX *s, const unsigned char *protos,
+    const size_t protos_len);
+void SSL_CTX_ech_set_callback(SSL_CTX *ctx, SSL_ech_cb_func f);
+int SSL_set1_ech_config_list(SSL *ssl, const uint8_t *ecl, size_t ecl_len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/encoder.h b/deps/openssl/openssl/include/openssl/encoder.h
index 9138c07276b..20545309bef 100644
--- a/deps/openssl/openssl/include/openssl/encoder.h
+++ b/deps/openssl/openssl/include/openssl/encoder.h
@@ -50,6 +50,8 @@ const OSSL_PARAM *OSSL_ENCODER_settable_ctx_params(OSSL_ENCODER *encoder);
 OSSL_ENCODER_CTX *OSSL_ENCODER_CTX_new(void);
 int OSSL_ENCODER_CTX_set_params(OSSL_ENCODER_CTX *ctx,
     const OSSL_PARAM params[]);
+int OSSL_ENCODER_CTX_ctrl_string(OSSL_ENCODER_CTX *ctx,
+    const char *name, const char *val);
 void OSSL_ENCODER_CTX_free(OSSL_ENCODER_CTX *ctx);

 /* Utilities that help set specific parameters */
diff --git a/deps/openssl/openssl/include/openssl/encodererr.h b/deps/openssl/openssl/include/openssl/encodererr.h
deleted file mode 100644
index e07174c3acd..00000000000
--- a/deps/openssl/openssl/include/openssl/encodererr.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_ENCODERERR_H
-#define OPENSSL_ENCODERERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * OSSL_ENCODER reason codes.
- */
-#define OSSL_ENCODER_R_ENCODER_NOT_FOUND 101
-#define OSSL_ENCODER_R_INCORRECT_PROPERTY_QUERY 100
-#define OSSL_ENCODER_R_MISSING_GET_PARAMS 102
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/engine.h b/deps/openssl/openssl/include/openssl/engine.h
index 73f6d86aaf7..27501b11a1a 100644
--- a/deps/openssl/openssl/include/openssl/engine.h
+++ b/deps/openssl/openssl/include/openssl/engine.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -19,7 +19,72 @@

 #include <openssl/opensslconf.h>

-#ifndef OPENSSL_NO_ENGINE
+/*
+ * Engine support is gone. Definitions here are provided for the source code
+ * compatibility only. They are meant to keep compilation working for legacy
+ * projects that, for whatever reason, cannot remove/disable old legacy code.
+ *
+ * We deliberately keep the OPENSSL_NO_ENGINE macro around as it is supplied
+ * when the build is configured with the `no-engine` option. OpenSSL 4.0 keeps
+ * the `no-engine` option around.
+ *
+ * Note, we have to use a compile-time message to warn only if the API is really
+ * used. To avoid complex macros, we kind of abuse the existing OSSL_DEPRECATED
+ * macros.
+ */
+
+#ifdef OPENSSL_ENGINE_STUBS
+#define ENGINE_INFO_MSG \
+    " API symbol is replaced with stub to avoid linker error."
+
+#define ENGINE_FUNC(ret_type, name, args, default_val) \
+    OSSL_DEPRECATED_MESSAGE(#name ENGINE_INFO_MSG)     \
+    static ossl_inline ret_type name args              \
+    {                                                  \
+        return default_val; /* stub return */          \
+    }
+
+#define ENGINE_FUNC_NOARGS(ret_type, name, default_val) \
+    OSSL_DEPRECATED_MESSAGE(#name ENGINE_INFO_MSG)      \
+    static ossl_inline ret_type name(void)              \
+    {                                                   \
+        return default_val; /* stub return */           \
+    }
+
+#define ENGINE_VOID_FUNC(name, args)               \
+    OSSL_DEPRECATED_MESSAGE(#name ENGINE_INFO_MSG) \
+    static ossl_inline void name args              \
+    {                                              \
+    }
+
+#define ENGINE_VOID_FUNC_NOARGS(name)              \
+    OSSL_DEPRECATED_MESSAGE(#name ENGINE_INFO_MSG) \
+    static ossl_inline void name(void)             \
+    {                                              \
+    }
+#else /* OPENSSL_ENGINE_STUBS */
+#define ENGINE_INFO_MSG \
+    " API symbol is removed. Define OPENSSL_ENGINE_STUBS to mask linker errors."
+
+#define ENGINE_FUNC(ret_type, name, args, default_val) \
+    OSSL_DEPRECATED_MESSAGE(#name ENGINE_INFO_MSG)     \
+    ret_type name args;
+
+#define ENGINE_FUNC_NOARGS(ret_type, name, default_val) \
+    OSSL_DEPRECATED_MESSAGE(#name ENGINE_INFO_MSG)      \
+    ret_type name(void);
+
+#define ENGINE_VOID_FUNC(name, args)               \
+    OSSL_DEPRECATED_MESSAGE(#name ENGINE_INFO_MSG) \
+    void name args;
+
+#define ENGINE_VOID_FUNC_NOARGS(name)              \
+    OSSL_DEPRECATED_MESSAGE(#name ENGINE_INFO_MSG) \
+    void name(void);
+#endif /* OPENSSL_ENGINE_STUBS */
+
+#ifdef ENGINE_FUNC
+
 #ifndef OPENSSL_NO_DEPRECATED_1_1_0
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
@@ -38,6 +103,15 @@
 extern "C" {
 #endif

+/* Ignore stubs unused arguments */
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-value"
+#elif defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-value"
+#endif
+
 /*
  * These flags are used to control combinations of algorithm (methods) by
  * bitwise "OR"ing.
@@ -315,47 +389,52 @@ typedef int (*ENGINE_PKEY_ASN1_METHS_PTR)(ENGINE *, EVP_PKEY_ASN1_METHOD **,

 /* Get the first/last "ENGINE" type available. */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_first(void);
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_last(void);
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_first(void); */
+ENGINE_FUNC_NOARGS(ENGINE *, ENGINE_get_first, NULL)
+
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_last(void); */
+ENGINE_FUNC_NOARGS(ENGINE *, ENGINE_get_last, NULL)
+
 #endif
 /* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_next(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_prev(ENGINE *e);
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_next(ENGINE *e); */
+ENGINE_FUNC(ENGINE *, ENGINE_get_next, (ENGINE *e), NULL)
+
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_prev(ENGINE *e); */
+ENGINE_FUNC(ENGINE *, ENGINE_get_prev, (ENGINE *e), NULL)
+
 #endif
 /* Add another "ENGINE" type into the array. */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 int ENGINE_add(ENGINE *e);
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_add(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_add, (ENGINE *e), 0)
 #endif
 /* Remove an existing "ENGINE" type from the array. */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 int ENGINE_remove(ENGINE *e);
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_remove(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_remove, (ENGINE *e), 0)
 #endif
 /* Retrieve an engine from the list by its unique "id" value. */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_by_id(const char *id);
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_by_id(const char *id); */
+ENGINE_FUNC(ENGINE *, ENGINE_by_id, (const char *id), NULL)
 #endif

 #ifndef OPENSSL_NO_DEPRECATED_1_1_0
-#define ENGINE_load_openssl() \
-    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_OPENSSL, NULL)
-#define ENGINE_load_dynamic() \
-    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_DYNAMIC, NULL)
+ENGINE_FUNC_NOARGS(int, ENGINE_load_openssl, 0)
+ENGINE_FUNC_NOARGS(int, ENGINE_load_dynamic, 0)
+ENGINE_FUNC_NOARGS(int, ENGINE_load_cryptodev, 0)
+ENGINE_FUNC_NOARGS(int, ENGINE_load_rdrand, 0)
 #ifndef OPENSSL_NO_STATIC_ENGINE
-#define ENGINE_load_padlock() \
-    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_PADLOCK, NULL)
-#define ENGINE_load_capi() \
-    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CAPI, NULL)
-#define ENGINE_load_afalg() \
-    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_AFALG, NULL)
-#endif
-#define ENGINE_load_cryptodev() \
-    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CRYPTODEV, NULL)
-#define ENGINE_load_rdrand() \
-    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_RDRAND, NULL)
+ENGINE_FUNC_NOARGS(int, ENGINE_load_padlock, 0)
+ENGINE_FUNC_NOARGS(int, ENGINE_load_capi, 0)
+ENGINE_FUNC_NOARGS(int, ENGINE_load_afalg, 0)
+#endif
 #endif
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 void ENGINE_load_builtin_engines(void);
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_load_builtin_engines(void); */
+ENGINE_VOID_FUNC_NOARGS(ENGINE_load_builtin_engines)
 #endif

 /*
@@ -363,8 +442,11 @@ OSSL_DEPRECATEDIN_3_0 void ENGINE_load_builtin_engines(void);
  * "registry" handling.
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 unsigned int ENGINE_get_table_flags(void);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_set_table_flags(unsigned int flags);
+/* OSSL_DEPRECATEDIN_3_0 unsigned int ENGINE_get_table_flags(void); */
+ENGINE_FUNC_NOARGS(unsigned int, ENGINE_get_table_flags, 0)
+
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_set_table_flags(unsigned int flags); */
+ENGINE_VOID_FUNC(ENGINE_set_table_flags, (unsigned int flags))
 #endif

 /*- Manage registration of ENGINEs per "table". For each type, there are 3
@@ -375,33 +457,60 @@ OSSL_DEPRECATEDIN_3_0 void ENGINE_set_table_flags(unsigned int flags);
  * Cleanup is automatically registered from each table when required.
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 int ENGINE_register_RSA(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_RSA(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_RSA(void);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_register_DSA(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_DSA(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_DSA(void);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_register_EC(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_EC(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_EC(void);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_register_DH(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_DH(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_DH(void);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_register_RAND(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_RAND(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_RAND(void);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_register_ciphers(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_ciphers(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_ciphers(void);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_register_digests(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_digests(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_digests(void);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_register_pkey_meths(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_pkey_meths(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_meths(void);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_register_pkey_asn1_meths(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_pkey_asn1_meths(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_asn1_meths(void);
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_register_RSA(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_register_RSA, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_RSA(ENGINE *e); */
+ENGINE_VOID_FUNC(ENGINE_unregister_RSA, (ENGINE *e))
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_RSA(void); */
+ENGINE_VOID_FUNC_NOARGS(ENGINE_register_all_RSA)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_register_DSA(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_register_DSA, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_DSA(ENGINE *e); */
+ENGINE_VOID_FUNC(ENGINE_unregister_DSA, (ENGINE *e))
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_DSA(void); */
+ENGINE_VOID_FUNC_NOARGS(ENGINE_register_all_DSA)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_register_EC(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_register_EC, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_EC(ENGINE *e); */
+ENGINE_VOID_FUNC(ENGINE_unregister_EC, (ENGINE *e))
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_EC(void); */
+ENGINE_VOID_FUNC_NOARGS(ENGINE_register_all_EC)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_register_DH(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_register_DH, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_DH(ENGINE *e); */
+ENGINE_VOID_FUNC(ENGINE_unregister_DH, (ENGINE *e))
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_DH(void); */
+ENGINE_VOID_FUNC_NOARGS(ENGINE_register_all_DH)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_register_RAND(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_register_RAND, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_RAND(ENGINE *e); */
+ENGINE_VOID_FUNC(ENGINE_unregister_RAND, (ENGINE *e))
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_RAND(void); */
+ENGINE_VOID_FUNC_NOARGS(ENGINE_register_all_RAND)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_register_ciphers(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_register_ciphers, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_ciphers(ENGINE *e); */
+ENGINE_VOID_FUNC(ENGINE_unregister_ciphers, (ENGINE *e))
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_ciphers(void); */
+ENGINE_VOID_FUNC_NOARGS(ENGINE_register_all_ciphers)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_register_digests(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_register_digests, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_digests(ENGINE *e); */
+ENGINE_VOID_FUNC(ENGINE_unregister_digests, (ENGINE *e))
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_digests(void); */
+ENGINE_VOID_FUNC_NOARGS(ENGINE_register_all_digests)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_register_pkey_meths(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_register_pkey_meths, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_pkey_meths(ENGINE *e); */
+ENGINE_VOID_FUNC(ENGINE_unregister_pkey_meths, (ENGINE *e))
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_meths(void); */
+ENGINE_VOID_FUNC_NOARGS(ENGINE_register_all_pkey_meths)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_register_pkey_asn1_meths(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_register_pkey_asn1_meths, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_pkey_asn1_meths(ENGINE *e); */
+ENGINE_VOID_FUNC(ENGINE_unregister_pkey_asn1_meths, (ENGINE *e))
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_asn1_meths(void); */
+ENGINE_VOID_FUNC_NOARGS(ENGINE_register_all_pkey_asn1_meths)
 #endif

 /*
@@ -411,8 +520,10 @@ OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_asn1_meths(void);
  * more selective initialisation.
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 int ENGINE_register_complete(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_register_all_complete(void);
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_register_complete(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_register_complete, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_register_all_complete(void); */
+ENGINE_FUNC_NOARGS(int, ENGINE_register_all_complete, 0)
 #endif

 /*
@@ -426,8 +537,11 @@ OSSL_DEPRECATEDIN_3_0 int ENGINE_register_all_complete(void);
  * references in such situations.
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p,
-    void (*f)(void));
+/*
+ * OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p,
+ *                                       void (*f) (void));
+ */
+ENGINE_FUNC(int, ENGINE_ctrl, (ENGINE *e, int cmd, long i, void *p, void (*f)(void)), 0)
 #endif

 /*
@@ -437,7 +551,8 @@ OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p,
  * ENGINE_ctrl_cmd_string(), only ENGINE_ctrl().
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 int ENGINE_cmd_is_executable(ENGINE *e, int cmd);
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_cmd_is_executable(ENGINE *e, int cmd); */
+ENGINE_FUNC(int, ENGINE_cmd_is_executable, (ENGINE *e, int cmd), 0)
 #endif

 /*
@@ -447,9 +562,12 @@ OSSL_DEPRECATEDIN_3_0 int ENGINE_cmd_is_executable(ENGINE *e, int cmd);
  * on how to use the cmd_name and cmd_optional.
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
-    long i, void *p, void (*f)(void),
-    int cmd_optional);
+/*
+ * OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
+ *                                           long i, void *p, void (*f) (void),
+ *                                           int cmd_optional);
+ */
+ENGINE_FUNC(int, ENGINE_ctrl_cmd, (ENGINE *e, const char *cmd_name, long i, void *p, void (*f)(void), int cmd_optional), 0)
 #endif

 /*
@@ -475,9 +593,13 @@ OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
  * same ENGINE-enabled devices, across applications.
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0
-int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
-    int cmd_optional);
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
+ *                            int cmd_optional);
+ */
+ENGINE_FUNC(int, ENGINE_ctrl_cmd_string,
+    (ENGINE *e, const char *cmd_name, const char *arg, int cmd_optional), 0)
 #endif

 /*
@@ -489,49 +611,130 @@ int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
  * exposed and break binary compatibility!
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_new(void);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_free(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_up_ref(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_id(ENGINE *e, const char *id);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_name(ENGINE *e, const char *name);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ecdsa_meth);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth);
-OSSL_DEPRECATEDIN_3_0
-int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f);
-OSSL_DEPRECATEDIN_3_0
-int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
-OSSL_DEPRECATEDIN_3_0
-int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
-OSSL_DEPRECATEDIN_3_0
-int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
-OSSL_DEPRECATEDIN_3_0
-int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f);
-OSSL_DEPRECATEDIN_3_0
-int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
-OSSL_DEPRECATEDIN_3_0
-int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
-    ENGINE_SSL_CLIENT_CERT_PTR loadssl_f);
-OSSL_DEPRECATEDIN_3_0
-int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
-OSSL_DEPRECATEDIN_3_0
-int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
-OSSL_DEPRECATEDIN_3_0
-int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);
-OSSL_DEPRECATEDIN_3_0
-int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_flags(ENGINE *e, int flags);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_cmd_defns(ENGINE *e,
-    const ENGINE_CMD_DEFN *defns);
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_new(void); */
+ENGINE_FUNC_NOARGS(ENGINE *, ENGINE_new, NULL)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_free(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_free, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_up_ref(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_up_ref, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_set_id(ENGINE *e, const char *id); */
+ENGINE_FUNC(int, ENGINE_set_id, (ENGINE *e, const char *id), 0)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_set_name(ENGINE *e, const char *name); */
+ENGINE_FUNC(int, ENGINE_set_name, (ENGINE *e, const char *name), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth);
+ */
+ENGINE_FUNC(int, ENGINE_set_RSA, (ENGINE *e, const RSA_METHOD *rsa_meth), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth);
+ */
+ENGINE_FUNC(int, ENGINE_set_DSA, (ENGINE *e, const DSA_METHOD *dsa_meth), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ecdsa_meth);
+ */
+ENGINE_FUNC(int, ENGINE_set_EC, (ENGINE *e, const EC_KEY_METHOD *ecdsa_meth), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth);
+ */
+ENGINE_FUNC(int, ENGINE_set_DH, (ENGINE *e, const DH_METHOD *dh_meth), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth);
+ */
+ENGINE_FUNC(int, ENGINE_set_RAND, (ENGINE *e, const RAND_METHOD *rand_meth), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f);
+ */
+ENGINE_FUNC(int, ENGINE_set_destroy_function,
+    (ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
+ */
+ENGINE_FUNC(int, ENGINE_set_init_function,
+    (ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
+ */
+ENGINE_FUNC(int, ENGINE_set_finish_function,
+    (ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
+ */
+ENGINE_FUNC(int, ENGINE_set_ctrl_function,
+    (ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f);
+ */
+ENGINE_FUNC(int, ENGINE_set_load_privkey_function,
+    (ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
+ */
+ENGINE_FUNC(int, ENGINE_set_load_pubkey_function,
+    (ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
+ *                                      ENGINE_SSL_CLIENT_CERT_PTR loadssl_f);
+ */
+ENGINE_FUNC(int, ENGINE_set_load_ssl_client_cert_function,
+    (ENGINE *e, ENGINE_SSL_CLIENT_CERT_PTR loadssl_f), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
+ */
+ENGINE_FUNC(int, ENGINE_set_ciphers, (ENGINE *e, ENGINE_CIPHERS_PTR f), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
+ */
+ENGINE_FUNC(int, ENGINE_set_digests, (ENGINE *e, ENGINE_DIGESTS_PTR f), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);
+ */
+ENGINE_FUNC(int, ENGINE_set_pkey_meths, (ENGINE *e, ENGINE_PKEY_METHS_PTR f), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f);
+ */
+ENGINE_FUNC(int, ENGINE_set_pkey_asn1_meths, (ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f),
+    0)
+/*
+ * OSSL_DEPRECATEDIN_3_0 int ENGINE_set_flags(ENGINE *e, int flags);
+ */
+ENGINE_FUNC(int, ENGINE_set_flags, (ENGINE *e, int flags), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns);
+ */
+ENGINE_FUNC(int, ENGINE_set_cmd_defns, (ENGINE *e, const ENGINE_CMD_DEFN *defns), 0)
 #endif
 /* These functions allow control over any per-structure ENGINE data. */
+#ifndef OPENSSL_ENGINE_STUBS
 #define ENGINE_get_ex_new_index(l, p, newf, dupf, freef) \
     CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ENGINE, l, p, newf, dupf, freef)
+#else
+ENGINE_FUNC(int, ENGINE_get_ex_new_index, (long l, void *p, CRYPTO_EX_new *newf, CRYPTO_EX_dup *dupf, CRYPTO_EX_free *freef), 0)
+#endif
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);
-OSSL_DEPRECATEDIN_3_0 void *ENGINE_get_ex_data(const ENGINE *e, int idx);
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);
+ */
+ENGINE_FUNC(int, ENGINE_set_ex_data, (ENGINE *e, int idx, void *arg), 0)
+/* OSSL_DEPRECATEDIN_3_0 void *ENGINE_get_ex_data(const ENGINE *e, int idx); */
+ENGINE_FUNC(void *, ENGINE_get_ex_data, (ENGINE *e, int idx), NULL)
 #endif

 #ifndef OPENSSL_NO_DEPRECATED_1_1_0
@@ -551,53 +754,132 @@ OSSL_DEPRECATEDIN_3_0 void *ENGINE_get_ex_data(const ENGINE *e, int idx);
  * obtained a structural reference may be problematic!
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_id(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_name(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 const DH_METHOD *ENGINE_get_DH(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0
-ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0
-ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0
-ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0
-ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0
-ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0
-ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0
-ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0
-ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0
-ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0
-ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0
-ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0
-const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
-OSSL_DEPRECATEDIN_3_0
-const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);
-OSSL_DEPRECATEDIN_3_0
-const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);
-OSSL_DEPRECATEDIN_3_0
-const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);
-OSSL_DEPRECATEDIN_3_0
-const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
-    const char *str,
-    int len);
-OSSL_DEPRECATEDIN_3_0
-const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
-    const char *str, int len);
-OSSL_DEPRECATEDIN_3_0
-const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_get_flags(const ENGINE *e);
+/* OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_id(const ENGINE *e); */
+ENGINE_FUNC(const char *, ENGINE_get_id, (const ENGINE *e), NULL)
+/* OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_name(const ENGINE *e); */
+ENGINE_FUNC(const char *, ENGINE_get_name, (const ENGINE *e), NULL)
+/* OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e); */
+ENGINE_FUNC(const RSA_METHOD *, ENGINE_get_RSA, (const ENGINE *e), NULL)
+/* OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e); */
+ENGINE_FUNC(const DSA_METHOD *, ENGINE_get_DSA, (const ENGINE *e), NULL)
+/* OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e); */
+ENGINE_FUNC(const EC_KEY_METHOD *, ENGINE_get_EC, (const ENGINE *e), NULL)
+/* OSSL_DEPRECATEDIN_3_0 const DH_METHOD *ENGINE_get_DH(const ENGINE *e); */
+ENGINE_FUNC(const DH_METHOD *, ENGINE_get_DH, (const ENGINE *e), NULL)
+/* OSSL_DEPRECATEDIN_3_0 const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e); */
+ENGINE_FUNC(const RAND_METHOD *, ENGINE_get_RAND, (const ENGINE *e), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);
+ */
+ENGINE_FUNC(ENGINE_GEN_INT_FUNC_PTR, ENGINE_get_destroy_function,
+    (const ENGINE *e), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e);
+ */
+ENGINE_FUNC(ENGINE_GEN_INT_FUNC_PTR, ENGINE_get_init_function,
+    (const ENGINE *e), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
+ */
+ENGINE_FUNC(ENGINE_GEN_INT_FUNC_PTR, ENGINE_get_finish_function,
+    (const ENGINE *e), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
+ */
+ENGINE_FUNC(ENGINE_CTRL_FUNC_PTR, ENGINE_get_ctrl_function,
+    (const ENGINE *e), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
+ */
+ENGINE_FUNC(ENGINE_LOAD_KEY_PTR, ENGINE_get_load_privkey_function,
+    (const ENGINE *e), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
+ */
+ENGINE_FUNC(ENGINE_LOAD_KEY_PTR, ENGINE_get_load_pubkey_function,
+    (const ENGINE *e), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0 ENGINE_SSL_CLIENT_CERT_PTR
+ * ENGINE_get_ssl_client_cert_function(const ENGINE *e);
+ */
+ENGINE_FUNC(ENGINE_SSL_CLIENT_CERT_PTR, ENGINE_get_ssl_client_cert_function,
+    (const ENGINE *e), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
+ */
+ENGINE_FUNC(ENGINE_CIPHERS_PTR, ENGINE_get_ciphers,
+    (const ENGINE *e), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
+ */
+ENGINE_FUNC(ENGINE_DIGESTS_PTR, ENGINE_get_digests,
+    (const ENGINE *e), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);
+ */
+ENGINE_FUNC(ENGINE_PKEY_METHS_PTR, ENGINE_get_pkey_meths,
+    (const ENGINE *e), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e);
+ */
+ENGINE_FUNC(ENGINE_PKEY_ASN1_METHS_PTR, ENGINE_get_pkey_asn1_meths,
+    (const ENGINE *e), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
+ */
+ENGINE_FUNC(const EVP_CIPHER *, ENGINE_get_cipher,
+    (ENGINE *e, int nid), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);
+ */
+ENGINE_FUNC(const EVP_MD *, ENGINE_get_digest,
+    (ENGINE *e, int nid), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);
+ */
+ENGINE_FUNC(const EVP_PKEY_METHOD *, ENGINE_get_pkey_meth,
+    (ENGINE *e, int nid), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);
+ */
+ENGINE_FUNC(const EVP_PKEY_ASN1_METHOD *, ENGINE_get_pkey_asn1_meth,
+    (ENGINE *e, int nid), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
+ *                                             const char *str, int len);
+ */
+ENGINE_FUNC(const EVP_PKEY_ASN1_METHOD *, ENGINE_get_pkey_asn1_meth_str,
+    (ENGINE *e, const char *str, int len), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
+ *                                             const char *str, int len);
+ */
+ENGINE_FUNC(const EVP_PKEY_ASN1_METHOD *, ENGINE_pkey_asn1_find_str,
+    (ENGINE **pe, const char *str, int len), NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);
+ */
+ENGINE_FUNC(const ENGINE_CMD_DEFN *, ENGINE_get_cmd_defns,
+    (const ENGINE *e), NULL)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_get_flags(const ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_get_flags, (const ENGINE *e), 0)
 #endif

 /*
@@ -619,7 +901,8 @@ OSSL_DEPRECATEDIN_3_0 int ENGINE_get_flags(const ENGINE *e);
  * and cannot initialise.
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 int ENGINE_init(ENGINE *e);
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_init(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_init, (ENGINE *e), 0)
 #endif
 /*
  * Free a functional reference to an engine type. This does not require a
@@ -627,7 +910,8 @@ OSSL_DEPRECATEDIN_3_0 int ENGINE_init(ENGINE *e);
  * reference.
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 int ENGINE_finish(ENGINE *e);
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_finish(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_finish, (ENGINE *e), 0)
 #endif

 /*
@@ -636,17 +920,36 @@ OSSL_DEPRECATEDIN_3_0 int ENGINE_finish(ENGINE *e);
  * whatever.
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0
-EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
-    UI_METHOD *ui_method, void *callback_data);
-OSSL_DEPRECATEDIN_3_0
-EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
-    UI_METHOD *ui_method, void *callback_data);
-OSSL_DEPRECATEDIN_3_0
-int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s, STACK_OF(X509_NAME) *ca_dn,
-    X509 **pcert, EVP_PKEY **ppkey,
-    STACK_OF(X509) **pother,
-    UI_METHOD *ui_method, void *callback_data);
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
+ *                                   UI_METHOD *ui_method, void *callback_data);
+ */
+ENGINE_FUNC(EVP_PKEY *, ENGINE_load_private_key,
+    (ENGINE *e, const char *key_id, UI_METHOD *ui_method,
+        void *callback_data),
+    NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
+ *                                  UI_METHOD *ui_method, void *callback_data);
+ */
+ENGINE_FUNC(EVP_PKEY *, ENGINE_load_public_key,
+    (ENGINE *e, const char *key_id, UI_METHOD *ui_method,
+        void *callback_data),
+    NULL)
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s, STACK_OF(X509_NAME) *ca_dn,
+ *                                 X509 **pcert, EVP_PKEY **ppkey,
+ *                                 STACK_OF(X509) **pother,
+ *                                 UI_METHOD *ui_method, void *callback_data);
+ */
+ENGINE_FUNC(int, ENGINE_load_ssl_client_cert,
+    (ENGINE *e, SSL *s, STACK_OF(X509_NAME) *ca_dn, X509 **pcert,
+        EVP_PKEY **ppkey, STACK_OF(X509) **pother, UI_METHOD *ui_method,
+        void *callback_data),
+    0)
 #endif

 /*
@@ -656,24 +959,33 @@ int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s, STACK_OF(X509_NAME) *ca_dn,
  * discarded.
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_RSA(void);
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_RSA(void); */
+ENGINE_FUNC_NOARGS(ENGINE *, ENGINE_get_default_RSA, NULL)
 #endif
 /* Same for the other "methods" */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_DSA(void);
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_EC(void);
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_DH(void);
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_RAND(void);
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_DSA(void); */
+ENGINE_FUNC_NOARGS(ENGINE *, ENGINE_get_default_DSA, NULL)
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_EC(void); */
+ENGINE_FUNC_NOARGS(ENGINE *, ENGINE_get_default_EC, NULL)
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_DH(void); */
+ENGINE_FUNC_NOARGS(ENGINE *, ENGINE_get_default_DH, NULL)
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_RAND(void); */
+ENGINE_FUNC_NOARGS(ENGINE *, ENGINE_get_default_RAND, NULL)
 #endif
 /*
  * These functions can be used to get a functional reference to perform
  * ciphering or digesting corresponding to "nid".
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_cipher_engine(int nid);
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_digest_engine(int nid);
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_meth_engine(int nid);
-OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid);
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_cipher_engine(int nid); */
+ENGINE_FUNC(ENGINE *, ENGINE_get_cipher_engine, (int nid), NULL)
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_digest_engine(int nid); */
+ENGINE_FUNC(ENGINE *, ENGINE_get_digest_engine, (int nid), NULL)
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_meth_engine(int nid); */
+ENGINE_FUNC(ENGINE *, ENGINE_get_pkey_meth_engine, (int nid), NULL)
+/* OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid); */
+ENGINE_FUNC(ENGINE *, ENGINE_get_pkey_asn1_meth_engine, (int nid), NULL)
 #endif

 /*
@@ -683,20 +995,32 @@ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid);
  * reference 'e'.
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_RSA(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_string(ENGINE *e,
-    const char *def_list);
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_RSA(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_set_default_RSA, (ENGINE *e), 0)
+/*
+ * OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_string(ENGINE *e,
+ *                                                     const char *def_list);
+ */
+ENGINE_FUNC(int, ENGINE_set_default_string, (ENGINE *e, const char *def_list), 0)
 #endif
 /* Same for the other "methods" */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_DSA(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_EC(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_DH(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_RAND(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_ciphers(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_digests(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_meths(ENGINE *e);
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_asn1_meths(ENGINE *e);
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_DSA(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_set_default_DSA, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_EC(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_set_default_EC, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_DH(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_set_default_DH, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_RAND(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_set_default_RAND, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_ciphers(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_set_default_ciphers, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_digests(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_set_default_digests, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_meths(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_set_default_pkey_meths, (ENGINE *e), 0)
+/* OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_asn1_meths(ENGINE *e); */
+ENGINE_FUNC(int, ENGINE_set_default_pkey_asn1_meths, (ENGINE *e), 0)
 #endif

 /*
@@ -707,8 +1031,13 @@ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_asn1_meths(ENGINE *e);
  * selective functions.
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default(ENGINE *e, unsigned int flags);
-OSSL_DEPRECATEDIN_3_0 void ENGINE_add_conf_module(void);
+/*
+ * OSSL_DEPRECATEDIN_3_0
+ * int ENGINE_set_default(ENGINE *e, unsigned int flags);
+ */
+ENGINE_FUNC(int, ENGINE_set_default, (ENGINE *e, unsigned int flags), 0)
+/* OSSL_DEPRECATEDIN_3_0 void ENGINE_add_conf_module(void); */
+ENGINE_VOID_FUNC_NOARGS(ENGINE_add_conf_module)
 #endif

 /* Deprecated functions ... */
@@ -756,15 +1085,11 @@ typedef struct st_dynamic_fns {
 } dynamic_fns;

 /*
- * The version checking function should be of this prototype. NB: The
- * ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading
- * code. If this function returns zero, it indicates a (potential) version
+ * The version checking function should be of this prototype.
+ * As a stub, this function returns zero, it indicates a (potential) version
  * incompatibility and the loaded library doesn't believe it can proceed.
- * Otherwise, the returned value is the (latest) version supported by the
- * loading library. The loader may still decide that the loaded code's
- * version is unsatisfactory and could veto the load. The function is
- * expected to be implemented with the symbol name "v_check", and a default
- * implementation can be fully instantiated with
+ * The function is expected to be implemented with the symbol name "v_check",
+ * and a default implementation can be fully instantiated with
  * IMPLEMENT_DYNAMIC_CHECK_FN().
  */
 typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version);
@@ -772,24 +1097,15 @@ typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version);
     OPENSSL_EXPORT unsigned long v_check(unsigned long v); \
     OPENSSL_EXPORT unsigned long v_check(unsigned long v)  \
     {                                                      \
-        if (v >= OSSL_DYNAMIC_OLDEST)                      \
-            return OSSL_DYNAMIC_VERSION;                   \
         return 0;                                          \
     }

 /*
  * This function is passed the ENGINE structure to initialise with its own
  * function and command settings. It should not adjust the structural or
- * functional reference counts. If this function returns zero, (a) the load
- * will be aborted, (b) the previous ENGINE state will be memcpy'd back onto
- * the structure, and (c) the shared library will be unloaded. So
- * implementations should do their own internal cleanup in failure
- * circumstances otherwise they could leak. The 'id' parameter, if non-NULL,
- * represents the ENGINE id that the loader is looking for. If this is NULL,
- * the shared library can choose to return failure or to initialise a
- * 'default' ENGINE. If non-NULL, the shared library must initialise only an
- * ENGINE matching the passed 'id'. The function is expected to be
- * implemented with the symbol name "bind_engine". A standard implementation
+ * functional reference counts. As a stub, this function returns zero, the load
+ * will be aborted. The function is expected to be implemented with the symbol
+ * name "bind_engine". A standard implementation
  * can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where the parameter
  * 'fn' is a callback function that populates the ENGINE structure and
  * returns an int value (zero for failure). 'fn' should have prototype;
@@ -803,16 +1119,7 @@ typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id,
     OPENSSL_EXPORT                                                      \
     int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns)  \
     {                                                                   \
-        if (ENGINE_get_static_state() == fns->static_state)             \
-            goto skip_cbs;                                              \
-        CRYPTO_set_mem_functions(fns->mem_fns.malloc_fn,                \
-            fns->mem_fns.realloc_fn,                                    \
-            fns->mem_fns.free_fn);                                      \
-        OPENSSL_init_crypto(OPENSSL_INIT_NO_ATEXIT, NULL);              \
-    skip_cbs:                                                           \
-        if (!fn(e, id))                                                 \
-            return 0;                                                   \
-        return 1;                                                       \
+        return 0;                                                       \
     }

 /*
@@ -826,16 +1133,79 @@ typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id,
  * static data and let the loading application and loaded ENGINE compare
  * their respective values.
  */
-void *ENGINE_get_static_state(void);
+/* void *ENGINE_get_static_state(void); */
+ENGINE_FUNC_NOARGS(void *, ENGINE_get_static_state, NULL)

 #if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
 #ifndef OPENSSL_NO_DEPRECATED_1_1_0
-OSSL_DEPRECATEDIN_1_1_0 void ENGINE_setup_bsd_cryptodev(void);
+/* OSSL_DEPRECATEDIN_1_1_0 void ENGINE_setup_bsd_cryptodev(void); */
+ENGINE_VOID_FUNC_NOARGS(ENGINE_setup_bsd_cryptodev)
 #endif
 #endif

+/*
+ * Stubs for ENGINE-related API functions that were removed
+ * from other headers.
+ */
+
+#ifndef OPENSSL_NO_DEPRECATED_3_0
+/* int EVP_PKEY_set1_engine(EVP_PKEY *pkey, ENGINE *e); */
+ENGINE_FUNC(int, EVP_PKEY_set1_engine, (EVP_PKEY *pkey, ENGINE *e), 0)
+
+/* ENGINE *EVP_PKEY_get0_engine(const EVP_PKEY *pkey); */
+ENGINE_FUNC(ENGINE *, EVP_PKEY_get0_engine, (const EVP_PKEY *pkey), NULL)
+
+/* ENGINE *DH_get0_engine(DH *d); */
+ENGINE_FUNC(ENGINE *, DH_get0_engine, (DH *d), NULL)
+
+/* ENGINE *RSA_get0_engine(const RSA *r); */
+ENGINE_FUNC(ENGINE *, RSA_get0_engine, (const RSA *r), NULL)
+
+/* ENGINE *DSA_get0_engine(DSA *d); */
+ENGINE_FUNC(ENGINE *, DSA_get0_engine, (DSA *d), NULL)
+
+/* ENGINE *EC_KEY_get0_engine(const EC_KEY *eckey); */
+ENGINE_FUNC(ENGINE *, EC_KEY_get0_engine, (const EC_KEY *eckey), NULL)
+
+/* const ENGINE *OSSL_STORE_LOADER_get0_engine(const OSSL_STORE_LOADER *loader); */
+ENGINE_FUNC(const ENGINE *, OSSL_STORE_LOADER_get0_engine, (const OSSL_STORE_LOADER *loader),
+    NULL)
+
+/* int RAND_set_rand_engine(ENGINE *engine); */
+ENGINE_FUNC(int, RAND_set_rand_engine, (ENGINE *engine), 0)
+
+/* int ERR_load_ENGINE_strings(void); */
+ENGINE_FUNC_NOARGS(int, ERR_load_ENGINE_strings, 1)
+#endif
+
+/*
+ * int TS_CONF_set_crypto_device(CONF *conf, const char *section,
+ *                              const char *device);
+ */
+ENGINE_FUNC(int, TS_CONF_set_crypto_device,
+    (CONF *conf, const char *section, const char *device), 0)
+
+/* int TS_CONF_set_default_engine(const char *name); */
+ENGINE_FUNC(int, TS_CONF_set_default_engine, (const char *name), 0)
+
+/* int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e); */
+ENGINE_FUNC(int, SSL_CTX_set_client_cert_engine, (SSL_CTX *ctx, ENGINE *e), 0)
+
 #ifdef __cplusplus
 }
 #endif
-#endif /* OPENSSL_NO_ENGINE */
+
+#undef ENGINE_INFO_MSG
+#undef ENGINE_FUNC
+#undef ENGINE_VOID_FUNC
+#undef ENGINE_FUNC_NOARGS
+#undef ENGINE_VOID_FUNC_NOARGS
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#elif defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
+#endif
 #endif /* OPENSSL_ENGINE_H */
diff --git a/deps/openssl/openssl/include/openssl/engineerr.h b/deps/openssl/openssl/include/openssl/engineerr.h
index 7cdfb8aa648..7ede4c162f1 100644
--- a/deps/openssl/openssl/include/openssl/engineerr.h
+++ b/deps/openssl/openssl/include/openssl/engineerr.h
@@ -16,46 +16,4 @@
 #include <openssl/symhacks.h>
 #include <openssl/cryptoerr_legacy.h>

-#ifndef OPENSSL_NO_ENGINE
-
-/*
- * ENGINE reason codes.
- */
-#define ENGINE_R_ALREADY_LOADED 100
-#define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133
-#define ENGINE_R_CMD_NOT_EXECUTABLE 134
-#define ENGINE_R_COMMAND_TAKES_INPUT 135
-#define ENGINE_R_COMMAND_TAKES_NO_INPUT 136
-#define ENGINE_R_CONFLICTING_ENGINE_ID 103
-#define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119
-#define ENGINE_R_DSO_FAILURE 104
-#define ENGINE_R_DSO_NOT_FOUND 132
-#define ENGINE_R_ENGINES_SECTION_ERROR 148
-#define ENGINE_R_ENGINE_CONFIGURATION_ERROR 102
-#define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105
-#define ENGINE_R_ENGINE_SECTION_ERROR 149
-#define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128
-#define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129
-#define ENGINE_R_FINISH_FAILED 106
-#define ENGINE_R_ID_OR_NAME_MISSING 108
-#define ENGINE_R_INIT_FAILED 109
-#define ENGINE_R_INTERNAL_LIST_ERROR 110
-#define ENGINE_R_INVALID_ARGUMENT 143
-#define ENGINE_R_INVALID_CMD_NAME 137
-#define ENGINE_R_INVALID_CMD_NUMBER 138
-#define ENGINE_R_INVALID_INIT_VALUE 151
-#define ENGINE_R_INVALID_STRING 150
-#define ENGINE_R_NOT_INITIALISED 117
-#define ENGINE_R_NOT_LOADED 112
-#define ENGINE_R_NO_CONTROL_FUNCTION 120
-#define ENGINE_R_NO_INDEX 144
-#define ENGINE_R_NO_LOAD_FUNCTION 125
-#define ENGINE_R_NO_REFERENCE 130
-#define ENGINE_R_NO_SUCH_ENGINE 116
-#define ENGINE_R_UNIMPLEMENTED_CIPHER 146
-#define ENGINE_R_UNIMPLEMENTED_DIGEST 147
-#define ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD 101
-#define ENGINE_R_VERSION_INCOMPATIBILITY 145
-
-#endif
 #endif
diff --git a/deps/openssl/openssl/include/openssl/err.h b/deps/openssl/openssl/include/openssl/err.h
deleted file mode 100644
index bf482070474..00000000000
--- a/deps/openssl/openssl/include/openssl/err.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/err.h"
diff --git a/deps/openssl/openssl/include/openssl/err.h.in b/deps/openssl/openssl/include/openssl/err.h.in
index d451f82eca6..de27183c00f 100644
--- a/deps/openssl/openssl/include/openssl/err.h.in
+++ b/deps/openssl/openssl/include/openssl/err.h.in
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -52,25 +52,6 @@ extern "C" {
 #define ERR_TXT_MALLOCED 0x01
 #define ERR_TXT_STRING 0x02

-#if !defined(OPENSSL_NO_DEPRECATED_3_0) || defined(OSSL_FORCE_ERR_STATE)
-#define ERR_FLAG_MARK 0x01
-#define ERR_FLAG_CLEAR 0x02
-
-#define ERR_NUM_ERRORS 16
-struct err_state_st {
-    int err_flags[ERR_NUM_ERRORS];
-    int err_marks[ERR_NUM_ERRORS];
-    unsigned long err_buffer[ERR_NUM_ERRORS];
-    char *err_data[ERR_NUM_ERRORS];
-    size_t err_data_size[ERR_NUM_ERRORS];
-    int err_data_flags[ERR_NUM_ERRORS];
-    char *err_file[ERR_NUM_ERRORS];
-    int err_line[ERR_NUM_ERRORS];
-    char *err_func[ERR_NUM_ERRORS];
-    int top, bottom;
-};
-#endif
-
 /* library */
 #define ERR_LIB_NONE 1
 #define ERR_LIB_SYS 2
@@ -282,34 +263,6 @@ static ossl_unused ossl_inline int ERR_COMMON_ERROR(unsigned long errcode)
 #define ERR_PACK(lib, func, reason) \
     ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))

-#ifndef OPENSSL_NO_DEPRECATED_3_0
-#define SYS_F_FOPEN 0
-#define SYS_F_CONNECT 0
-#define SYS_F_GETSERVBYNAME 0
-#define SYS_F_SOCKET 0
-#define SYS_F_IOCTLSOCKET 0
-#define SYS_F_BIND 0
-#define SYS_F_LISTEN 0
-#define SYS_F_ACCEPT 0
-#define SYS_F_WSASTARTUP 0
-#define SYS_F_OPENDIR 0
-#define SYS_F_FREAD 0
-#define SYS_F_GETADDRINFO 0
-#define SYS_F_GETNAMEINFO 0
-#define SYS_F_SETSOCKOPT 0
-#define SYS_F_GETSOCKOPT 0
-#define SYS_F_GETSOCKNAME 0
-#define SYS_F_GETHOSTBYNAME 0
-#define SYS_F_FFLUSH 0
-#define SYS_F_OPEN 0
-#define SYS_F_CLOSE 0
-#define SYS_F_IOCTL 0
-#define SYS_F_STAT 0
-#define SYS_F_FCNTL 0
-#define SYS_F_FSTAT 0
-#define SYS_F_SENDFILE 0
-#endif
-
 /*
  * All ERR_R_ codes must be combined with ERR_RFLAG_COMMON.
  */
@@ -475,15 +428,6 @@ int ERR_unload_strings(int lib, ERR_STRING_DATA *str);
     while (0)              \
     continue
 #endif
-#ifndef OPENSSL_NO_DEPRECATED_1_1_0
-OSSL_DEPRECATEDIN_1_1_0 void ERR_remove_thread_state(void *);
-#endif
-#ifndef OPENSSL_NO_DEPRECATED_1_0_0
-OSSL_DEPRECATEDIN_1_0_0 void ERR_remove_state(unsigned long pid);
-#endif
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 ERR_STATE *ERR_get_state(void);
-#endif

 int ERR_get_next_error_library(void);

diff --git a/deps/openssl/openssl/include/openssl/ess.h b/deps/openssl/openssl/include/openssl/ess.h
deleted file mode 100644
index 64cc0162251..00000000000
--- a/deps/openssl/openssl/include/openssl/ess.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/ess.h"
diff --git a/deps/openssl/openssl/include/openssl/ess.h.in b/deps/openssl/openssl/include/openssl/ess.h.in
index 62aaec1726e..096ba45b3a9 100644
--- a/deps/openssl/openssl/include/openssl/ess.h.in
+++ b/deps/openssl/openssl/include/openssl/ess.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -77,7 +77,12 @@ int OSSL_ESS_check_signing_certs(const ESS_SIGNING_CERT *ss,
     const ESS_SIGNING_CERT_V2 *ssv2,
     const STACK_OF(X509) *chain,
     int require_signing_cert);
-
+int OSSL_ESS_check_signing_certs_ex(const ESS_SIGNING_CERT *ss,
+    const ESS_SIGNING_CERT_V2 *ssv2,
+    const STACK_OF(X509) *chain,
+    OSSL_LIB_CTX *libctx,
+    const char *propq,
+    int require_signing_cert);
 #ifdef __cplusplus
 }
 #endif
diff --git a/deps/openssl/openssl/include/openssl/esserr.h b/deps/openssl/openssl/include/openssl/esserr.h
deleted file mode 100644
index 46881293cb0..00000000000
--- a/deps/openssl/openssl/include/openssl/esserr.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_ESSERR_H
-#define OPENSSL_ESSERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * ESS reason codes.
- */
-#define ESS_R_EMPTY_ESS_CERT_ID_LIST 107
-#define ESS_R_ESS_CERT_DIGEST_ERROR 103
-#define ESS_R_ESS_CERT_ID_NOT_FOUND 104
-#define ESS_R_ESS_CERT_ID_WRONG_ORDER 105
-#define ESS_R_ESS_DIGEST_ALG_UNKNOWN 106
-#define ESS_R_ESS_SIGNING_CERTIFICATE_ERROR 102
-#define ESS_R_ESS_SIGNING_CERT_ADD_ERROR 100
-#define ESS_R_ESS_SIGNING_CERT_V2_ADD_ERROR 101
-#define ESS_R_MISSING_SIGNING_CERTIFICATE_ATTRIBUTE 108
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/evp.h b/deps/openssl/openssl/include/openssl/evp.h
index e83ad131834..55503411eb9 100644
--- a/deps/openssl/openssl/include/openssl/evp.h
+++ b/deps/openssl/openssl/include/openssl/evp.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,6 +17,7 @@
 #endif

 #include <stdarg.h>
+#include <string.h>

 #ifndef OPENSSL_NO_STDIO
 #include <stdio.h>
@@ -98,6 +99,7 @@
 #define EVP_PKEY_SLH_DSA_SHAKE_192F NID_SLH_DSA_SHAKE_192f
 #define EVP_PKEY_SLH_DSA_SHAKE_256S NID_SLH_DSA_SHAKE_256s
 #define EVP_PKEY_SLH_DSA_SHAKE_256F NID_SLH_DSA_SHAKE_256f
+#define EVP_PKEY_HSS_LMS NID_id_alg_hss_lms_hashsig

 /* Special indicator that the object is uniquely provider side */
 #define EVP_PKEY_KEYMGMT -1
@@ -120,6 +122,7 @@ int EVP_set_default_properties(OSSL_LIB_CTX *libctx, const char *propq);
 char *EVP_get1_default_properties(OSSL_LIB_CTX *libctx);
 int EVP_default_properties_is_fips_enabled(OSSL_LIB_CTX *libctx);
 int EVP_default_properties_enable_fips(OSSL_LIB_CTX *libctx, int enable);
+#define FIPS_mode() EVP_default_properties_is_fips_enabled(NULL)

 #define EVP_PKEY_MO_SIGN 0x0001
 #define EVP_PKEY_MO_VERIFY 0x0002
@@ -127,51 +130,6 @@ int EVP_default_properties_enable_fips(OSSL_LIB_CTX *libctx, int enable);
 #define EVP_PKEY_MO_DECRYPT 0x0008

 #ifndef EVP_MD
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 EVP_MD *EVP_MD_meth_new(int md_type, int pkey_type);
-OSSL_DEPRECATEDIN_3_0 EVP_MD *EVP_MD_meth_dup(const EVP_MD *md);
-OSSL_DEPRECATEDIN_3_0 void EVP_MD_meth_free(EVP_MD *md);
-OSSL_DEPRECATEDIN_3_0
-int EVP_MD_meth_set_input_blocksize(EVP_MD *md, int blocksize);
-OSSL_DEPRECATEDIN_3_0
-int EVP_MD_meth_set_result_size(EVP_MD *md, int resultsize);
-OSSL_DEPRECATEDIN_3_0
-int EVP_MD_meth_set_app_datasize(EVP_MD *md, int datasize);
-OSSL_DEPRECATEDIN_3_0
-int EVP_MD_meth_set_flags(EVP_MD *md, unsigned long flags);
-OSSL_DEPRECATEDIN_3_0
-int EVP_MD_meth_set_init(EVP_MD *md, int (*init)(EVP_MD_CTX *ctx));
-OSSL_DEPRECATEDIN_3_0
-int EVP_MD_meth_set_update(EVP_MD *md, int (*update)(EVP_MD_CTX *ctx, const void *data, size_t count));
-OSSL_DEPRECATEDIN_3_0
-int EVP_MD_meth_set_final(EVP_MD *md, int (*final)(EVP_MD_CTX *ctx, unsigned char *md));
-OSSL_DEPRECATEDIN_3_0
-int EVP_MD_meth_set_copy(EVP_MD *md, int (*copy)(EVP_MD_CTX *to, const EVP_MD_CTX *from));
-OSSL_DEPRECATEDIN_3_0
-int EVP_MD_meth_set_cleanup(EVP_MD *md, int (*cleanup)(EVP_MD_CTX *ctx));
-OSSL_DEPRECATEDIN_3_0
-int EVP_MD_meth_set_ctrl(EVP_MD *md, int (*ctrl)(EVP_MD_CTX *ctx, int cmd, int p1, void *p2));
-OSSL_DEPRECATEDIN_3_0 int EVP_MD_meth_get_input_blocksize(const EVP_MD *md);
-OSSL_DEPRECATEDIN_3_0 int EVP_MD_meth_get_result_size(const EVP_MD *md);
-OSSL_DEPRECATEDIN_3_0 int EVP_MD_meth_get_app_datasize(const EVP_MD *md);
-OSSL_DEPRECATEDIN_3_0 unsigned long EVP_MD_meth_get_flags(const EVP_MD *md);
-OSSL_DEPRECATEDIN_3_0
-int (*EVP_MD_meth_get_init(const EVP_MD *md))(EVP_MD_CTX *ctx);
-OSSL_DEPRECATEDIN_3_0
-int (*EVP_MD_meth_get_update(const EVP_MD *md))(EVP_MD_CTX *ctx,
-    const void *data, size_t count);
-OSSL_DEPRECATEDIN_3_0
-int (*EVP_MD_meth_get_final(const EVP_MD *md))(EVP_MD_CTX *ctx,
-    unsigned char *md);
-OSSL_DEPRECATEDIN_3_0
-int (*EVP_MD_meth_get_copy(const EVP_MD *md))(EVP_MD_CTX *to,
-    const EVP_MD_CTX *from);
-OSSL_DEPRECATEDIN_3_0
-int (*EVP_MD_meth_get_cleanup(const EVP_MD *md))(EVP_MD_CTX *ctx);
-OSSL_DEPRECATEDIN_3_0
-int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))(EVP_MD_CTX *ctx, int cmd,
-    int p1, void *p2);
-#endif
 /* digest can only handle a single block */
 #define EVP_MD_FLAG_ONESHOT 0x0001

@@ -197,6 +155,8 @@ int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))(EVP_MD_CTX *ctx, int cmd,
 /* Note if suitable for use in FIPS mode */
 #define EVP_MD_FLAG_FIPS 0x0400

+#define EVP_MD_FLAG_NO_STORE 0x0800
+
 /* Digest ctrls */

 #define EVP_MD_CTRL_DIGALGID 0x1
@@ -246,63 +206,6 @@ int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))(EVP_MD_CTX *ctx, int cmd,
 #define EVP_MD_CTX_FLAG_FINALISE 0x0200
 /* NOTE: 0x0400 and 0x0800 are reserved for internal usage */

-#ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0
-EVP_CIPHER *EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len);
-OSSL_DEPRECATEDIN_3_0
-EVP_CIPHER *EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher);
-OSSL_DEPRECATEDIN_3_0
-void EVP_CIPHER_meth_free(EVP_CIPHER *cipher);
-OSSL_DEPRECATEDIN_3_0
-int EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher, int iv_len);
-OSSL_DEPRECATEDIN_3_0
-int EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher, unsigned long flags);
-OSSL_DEPRECATEDIN_3_0
-int EVP_CIPHER_meth_set_impl_ctx_size(EVP_CIPHER *cipher, int ctx_size);
-OSSL_DEPRECATEDIN_3_0
-int EVP_CIPHER_meth_set_init(EVP_CIPHER *cipher,
-    int (*init)(EVP_CIPHER_CTX *ctx,
-        const unsigned char *key,
-        const unsigned char *iv,
-        int enc));
-OSSL_DEPRECATEDIN_3_0
-int EVP_CIPHER_meth_set_do_cipher(EVP_CIPHER *cipher,
-    int (*do_cipher)(EVP_CIPHER_CTX *ctx,
-        unsigned char *out,
-        const unsigned char *in,
-        size_t inl));
-OSSL_DEPRECATEDIN_3_0
-int EVP_CIPHER_meth_set_cleanup(EVP_CIPHER *cipher,
-    int (*cleanup)(EVP_CIPHER_CTX *));
-OSSL_DEPRECATEDIN_3_0
-int EVP_CIPHER_meth_set_set_asn1_params(EVP_CIPHER *cipher,
-    int (*set_asn1_parameters)(EVP_CIPHER_CTX *,
-        ASN1_TYPE *));
-OSSL_DEPRECATEDIN_3_0
-int EVP_CIPHER_meth_set_get_asn1_params(EVP_CIPHER *cipher,
-    int (*get_asn1_parameters)(EVP_CIPHER_CTX *,
-        ASN1_TYPE *));
-OSSL_DEPRECATEDIN_3_0
-int EVP_CIPHER_meth_set_ctrl(EVP_CIPHER *cipher,
-    int (*ctrl)(EVP_CIPHER_CTX *, int type,
-        int arg, void *ptr));
-OSSL_DEPRECATEDIN_3_0 int (*EVP_CIPHER_meth_get_init(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    const unsigned char *iv,
-    int enc);
-OSSL_DEPRECATEDIN_3_0 int (*EVP_CIPHER_meth_get_do_cipher(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx,
-    unsigned char *out,
-    const unsigned char *in,
-    size_t inl);
-OSSL_DEPRECATEDIN_3_0 int (*EVP_CIPHER_meth_get_cleanup(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *);
-OSSL_DEPRECATEDIN_3_0 int (*EVP_CIPHER_meth_get_set_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *,
-    ASN1_TYPE *);
-OSSL_DEPRECATEDIN_3_0 int (*EVP_CIPHER_meth_get_get_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *,
-    ASN1_TYPE *);
-OSSL_DEPRECATEDIN_3_0 int (*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, int type,
-    int arg, void *ptr);
-#endif
-
 /* Values for cipher flags */

 /* Modes for ciphers */
@@ -365,6 +268,9 @@ OSSL_DEPRECATEDIN_3_0 int (*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))(
 /* For supplementary wrap cipher support */
 #define EVP_CIPH_FLAG_GET_WRAP_CIPHER 0x4000000
 #define EVP_CIPH_FLAG_INVERSE_CIPHER 0x8000000
+#define EVP_CIPH_FLAG_ENC_THEN_MAC 0x10000000
+/* flag to indicate that this cipher isn't cached, and so should be refcounted*/
+#define EVP_CIPH_FLAG_NO_STORE 0x20000000

 /*
  * Cipher context flag to indicate we can handle wrap mode: if allowed in
@@ -510,10 +416,12 @@ typedef int(EVP_PBE_KEYGEN_EX)(EVP_CIPHER_CTX *ctx, const char *pass,
     (rsa))
 #endif

+#ifndef OPENSSL_NO_DEPRECATED_3_6
 #ifndef OPENSSL_NO_DSA
 #define EVP_PKEY_assign_DSA(pkey, dsa) EVP_PKEY_assign((pkey), EVP_PKEY_DSA, \
     (dsa))
 #endif
+#endif

 #if !defined(OPENSSL_NO_DH) && !defined(OPENSSL_NO_DEPRECATED_3_0)
 #define EVP_PKEY_assign_DH(pkey, dh) EVP_PKEY_assign((pkey), EVP_PKEY_DH, (dh))
@@ -521,18 +429,23 @@ typedef int(EVP_PBE_KEYGEN_EX)(EVP_CIPHER_CTX *ctx, const char *pass,

 #ifndef OPENSSL_NO_DEPRECATED_3_0
 #ifndef OPENSSL_NO_EC
-#define EVP_PKEY_assign_EC_KEY(pkey, eckey) \
-    EVP_PKEY_assign((pkey), EVP_PKEY_EC, (eckey))
+#define EVP_PKEY_assign_EC_KEY(pkey, eckey) EVP_PKEY_assign((pkey), \
+    EVP_PKEY_EC,                                                    \
+    (eckey))
 #endif
 #endif
+#ifndef OPENSSL_NO_DEPRECATED_3_6
 #ifndef OPENSSL_NO_SIPHASH
 #define EVP_PKEY_assign_SIPHASH(pkey, shkey) EVP_PKEY_assign((pkey), \
-    EVP_PKEY_SIPHASH, (shkey))
+    EVP_PKEY_SIPHASH,                                                \
+    (shkey))
 #endif

 #ifndef OPENSSL_NO_POLY1305
 #define EVP_PKEY_assign_POLY1305(pkey, polykey) EVP_PKEY_assign((pkey), \
-    EVP_PKEY_POLY1305, (polykey))
+    EVP_PKEY_POLY1305,                                                  \
+    (polykey))
+#endif
 #endif

 /* Add some extra combinations */
@@ -567,13 +480,7 @@ EVP_MD *EVP_MD_CTX_get1_md(EVP_MD_CTX *ctx);
 #ifndef OPENSSL_NO_DEPRECATED_3_0
 OSSL_DEPRECATEDIN_3_0
 const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx);
-OSSL_DEPRECATEDIN_3_0
-int (*EVP_MD_CTX_update_fn(EVP_MD_CTX *ctx))(EVP_MD_CTX *ctx,
-    const void *data, size_t count);
-OSSL_DEPRECATEDIN_3_0
-void EVP_MD_CTX_set_update_fn(EVP_MD_CTX *ctx,
-    int (*update)(EVP_MD_CTX *ctx,
-        const void *data, size_t count));
+
 #endif
 int EVP_MD_CTX_get_size_ex(const EVP_MD_CTX *ctx);

@@ -587,8 +494,11 @@ int EVP_MD_CTX_get_size_ex(const EVP_MD_CTX *ctx);
 EVP_PKEY_CTX *EVP_MD_CTX_get_pkey_ctx(const EVP_MD_CTX *ctx);
 #define EVP_MD_CTX_pkey_ctx EVP_MD_CTX_get_pkey_ctx
 void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx);
+#ifndef OPENSSL_NO_DEPRECATED_4_0
+OSSL_DEPRECATEDIN_4_0
 void *EVP_MD_CTX_get0_md_data(const EVP_MD_CTX *ctx);
 #define EVP_MD_CTX_md_data EVP_MD_CTX_get0_md_data
+#endif

 int EVP_CIPHER_get_nid(const EVP_CIPHER *cipher);
 #define EVP_CIPHER_nid EVP_CIPHER_get_nid
@@ -648,9 +558,12 @@ int EVP_CIPHER_CTX_get_original_iv(EVP_CIPHER_CTX *ctx, void *buf, size_t len);
 OSSL_DEPRECATEDIN_3_0
 unsigned char *EVP_CIPHER_CTX_buf_noconst(EVP_CIPHER_CTX *ctx);
 #endif
-int EVP_CIPHER_CTX_get_num(const EVP_CIPHER_CTX *ctx);
+#ifndef OPENSSL_NO_DEPRECATED_4_1
+OSSL_DEPRECATEDIN_4_1 int EVP_CIPHER_CTX_get_num(const EVP_CIPHER_CTX *ctx);
 #define EVP_CIPHER_CTX_num EVP_CIPHER_CTX_get_num
-int EVP_CIPHER_CTX_set_num(EVP_CIPHER_CTX *ctx, int num);
+OSSL_DEPRECATEDIN_4_1 int EVP_CIPHER_CTX_set_num(EVP_CIPHER_CTX *ctx, int num);
+#endif
+
 EVP_CIPHER_CTX *EVP_CIPHER_CTX_dup(const EVP_CIPHER_CTX *in);
 int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in);
 void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx);
@@ -666,7 +579,7 @@ void *EVP_CIPHER_CTX_set_cipher_data(EVP_CIPHER_CTX *ctx, void *cipher_data);
 #define EVP_CIPHER_CTX_get_mode(c) EVP_CIPHER_get_mode(EVP_CIPHER_CTX_get0_cipher(c))
 #define EVP_CIPHER_CTX_mode EVP_CIPHER_CTX_get_mode

-#define EVP_ENCODE_LENGTH(l) ((((l) + 2) / 3 * 4) + ((l) / 48 + 1) * 2 + 80)
+#define EVP_ENCODE_LENGTH(l) (((((size_t)(l)) + 2) / 3 * 4) + (((size_t)(l)) / 48 + 1) * 2 + 80)
 #define EVP_DECODE_LENGTH(l) (((l) + 3) / 4 * 3 + 80)

 #define EVP_SignInit_ex(a, b, c) EVP_DigestInit_ex(a, b, c)
@@ -725,7 +638,7 @@ int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags);
 __owur int EVP_DigestInit_ex2(EVP_MD_CTX *ctx, const EVP_MD *type,
     const OSSL_PARAM params[]);
 __owur int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type,
-    ENGINE *impl);
+    ENGINE *impl /* must be NULL */);
 __owur int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d,
     size_t cnt);
 __owur int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md,
@@ -745,6 +658,10 @@ __owur int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, unsigned char *out,
     size_t outlen);
 __owur int EVP_DigestSqueeze(EVP_MD_CTX *ctx, unsigned char *out,
     size_t outlen);
+__owur int EVP_MD_CTX_serialize(EVP_MD_CTX *ctx, unsigned char *out,
+    size_t *outlen);
+__owur int EVP_MD_CTX_deserialize(EVP_MD_CTX *ctx, const unsigned char *in,
+    size_t inlen);

 __owur EVP_MD *EVP_MD_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
     const char *properties);
@@ -770,7 +687,8 @@ int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags);
 __owur int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
     const unsigned char *key, const unsigned char *iv);
 __owur int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,
-    const EVP_CIPHER *cipher, ENGINE *impl,
+    const EVP_CIPHER *cipher,
+    ENGINE *impl /* must be NULL */,
     const unsigned char *key,
     const unsigned char *iv);
 __owur int EVP_EncryptInit_ex2(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
@@ -787,7 +705,8 @@ __owur int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out,
 __owur int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
     const unsigned char *key, const unsigned char *iv);
 __owur int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx,
-    const EVP_CIPHER *cipher, ENGINE *impl,
+    const EVP_CIPHER *cipher,
+    ENGINE *impl /* must be NULL */,
     const unsigned char *key,
     const unsigned char *iv);
 __owur int EVP_DecryptInit_ex2(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
@@ -805,7 +724,8 @@ __owur int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
     const unsigned char *key, const unsigned char *iv,
     int enc);
 __owur int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx,
-    const EVP_CIPHER *cipher, ENGINE *impl,
+    const EVP_CIPHER *cipher,
+    ENGINE *impl /* must be NULL */,
     const unsigned char *key,
     const unsigned char *iv, int enc);
 __owur int EVP_CipherInit_SKEY(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
@@ -863,7 +783,8 @@ __owur int EVP_DigestSignInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
     const char *props, EVP_PKEY *pkey,
     const OSSL_PARAM params[]);
 __owur int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
-    const EVP_MD *type, ENGINE *e,
+    const EVP_MD *type,
+    ENGINE *e /* must be NULL */,
     EVP_PKEY *pkey);
 __owur int EVP_DigestSignUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize);
 __owur int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
@@ -874,7 +795,8 @@ __owur int EVP_DigestVerifyInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
     const char *props, EVP_PKEY *pkey,
     const OSSL_PARAM params[]);
 __owur int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
-    const EVP_MD *type, ENGINE *e,
+    const EVP_MD *type,
+    ENGINE *e /* must be NULL */,
     EVP_PKEY *pkey);
 int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize);
 __owur int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig,
@@ -933,7 +855,6 @@ int EVP_CIPHER_CTX_get_algor(EVP_CIPHER_CTX *ctx, X509_ALGOR **alg);
 const BIO_METHOD *BIO_f_md(void);
 const BIO_METHOD *BIO_f_base64(void);
 const BIO_METHOD *BIO_f_cipher(void);
-const BIO_METHOD *BIO_f_reliable(void);
 __owur int BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k,
     const unsigned char *i, int enc);

@@ -1361,6 +1282,7 @@ int EVP_PKEY_get_bits(const EVP_PKEY *pkey);
 #define EVP_PKEY_bits EVP_PKEY_get_bits
 int EVP_PKEY_get_security_bits(const EVP_PKEY *pkey);
 #define EVP_PKEY_security_bits EVP_PKEY_get_security_bits
+int EVP_PKEY_get_security_category(const EVP_PKEY *pkey);
 int EVP_PKEY_get_size(const EVP_PKEY *pkey);
 #define EVP_PKEY_size EVP_PKEY_get_size
 int EVP_PKEY_can_sign(const EVP_PKEY *pkey);
@@ -1368,12 +1290,6 @@ int EVP_PKEY_set_type(EVP_PKEY *pkey, int type);
 int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len);
 int EVP_PKEY_set_type_by_keymgmt(EVP_PKEY *pkey, EVP_KEYMGMT *keymgmt);
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-#ifndef OPENSSL_NO_ENGINE
-OSSL_DEPRECATEDIN_3_0
-int EVP_PKEY_set1_engine(EVP_PKEY *pkey, ENGINE *e);
-OSSL_DEPRECATEDIN_3_0
-ENGINE *EVP_PKEY_get0_engine(const EVP_PKEY *pkey);
-#endif
 OSSL_DEPRECATEDIN_3_0
 int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key);
 OSSL_DEPRECATEDIN_3_0
@@ -1447,6 +1363,7 @@ EVP_PKEY *d2i_AutoPrivateKey_ex(EVP_PKEY **a, const unsigned char **pp,
 EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
     long length);
 int i2d_PrivateKey(const EVP_PKEY *a, unsigned char **pp);
+int i2d_PKCS8PrivateKey(const EVP_PKEY *a, unsigned char **pp);

 int i2d_KeyParams(const EVP_PKEY *a, unsigned char **pp);
 EVP_PKEY *d2i_KeyParams(int type, EVP_PKEY **a, const unsigned char **pp,
@@ -1605,118 +1522,6 @@ int EVP_PBE_get(int *ptype, int *ppbe_nid, size_t num);
 #define ASN1_PKEY_CTRL_GET1_TLS_ENCPT 0xa
 #define ASN1_PKEY_CTRL_CMS_IS_RI_TYPE_SUPPORTED 0xb

-int EVP_PKEY_asn1_get_count(void);
-const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx);
-const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type);
-const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,
-    const char *str, int len);
-int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth);
-int EVP_PKEY_asn1_add_alias(int to, int from);
-int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id,
-    int *ppkey_flags, const char **pinfo,
-    const char **ppem_str,
-    const EVP_PKEY_ASN1_METHOD *ameth);
-
-const EVP_PKEY_ASN1_METHOD *EVP_PKEY_get0_asn1(const EVP_PKEY *pkey);
-EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags,
-    const char *pem_str,
-    const char *info);
-void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,
-    const EVP_PKEY_ASN1_METHOD *src);
-void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth);
-void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*pub_decode)(EVP_PKEY *pk,
-        const X509_PUBKEY *pub),
-    int (*pub_encode)(X509_PUBKEY *pub,
-        const EVP_PKEY *pk),
-    int (*pub_cmp)(const EVP_PKEY *a,
-        const EVP_PKEY *b),
-    int (*pub_print)(BIO *out,
-        const EVP_PKEY *pkey,
-        int indent, ASN1_PCTX *pctx),
-    int (*pkey_size)(const EVP_PKEY *pk),
-    int (*pkey_bits)(const EVP_PKEY *pk));
-void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*priv_decode)(EVP_PKEY *pk,
-        const PKCS8_PRIV_KEY_INFO
-            *p8inf),
-    int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8,
-        const EVP_PKEY *pk),
-    int (*priv_print)(BIO *out,
-        const EVP_PKEY *pkey,
-        int indent,
-        ASN1_PCTX *pctx));
-void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*param_decode)(EVP_PKEY *pkey,
-        const unsigned char **pder,
-        int derlen),
-    int (*param_encode)(const EVP_PKEY *pkey,
-        unsigned char **pder),
-    int (*param_missing)(const EVP_PKEY *pk),
-    int (*param_copy)(EVP_PKEY *to,
-        const EVP_PKEY *from),
-    int (*param_cmp)(const EVP_PKEY *a,
-        const EVP_PKEY *b),
-    int (*param_print)(BIO *out,
-        const EVP_PKEY *pkey,
-        int indent,
-        ASN1_PCTX *pctx));
-
-void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,
-    void (*pkey_free)(EVP_PKEY *pkey));
-void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*pkey_ctrl)(EVP_PKEY *pkey, int op,
-        long arg1, void *arg2));
-void EVP_PKEY_asn1_set_item(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*item_verify)(EVP_MD_CTX *ctx,
-        const ASN1_ITEM *it,
-        const void *data,
-        const X509_ALGOR *a,
-        const ASN1_BIT_STRING *sig,
-        EVP_PKEY *pkey),
-    int (*item_sign)(EVP_MD_CTX *ctx,
-        const ASN1_ITEM *it,
-        const void *data,
-        X509_ALGOR *alg1,
-        X509_ALGOR *alg2,
-        ASN1_BIT_STRING *sig));
-
-void EVP_PKEY_asn1_set_siginf(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*siginf_set)(X509_SIG_INFO *siginf,
-        const X509_ALGOR *alg,
-        const ASN1_STRING *sig));
-
-void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*pkey_check)(const EVP_PKEY *pk));
-
-void EVP_PKEY_asn1_set_public_check(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*pkey_pub_check)(const EVP_PKEY *pk));
-
-void EVP_PKEY_asn1_set_param_check(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*pkey_param_check)(const EVP_PKEY *pk));
-
-void EVP_PKEY_asn1_set_set_priv_key(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*set_priv_key)(EVP_PKEY *pk,
-        const unsigned char
-            *priv,
-        size_t len));
-void EVP_PKEY_asn1_set_set_pub_key(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*set_pub_key)(EVP_PKEY *pk,
-        const unsigned char *pub,
-        size_t len));
-void EVP_PKEY_asn1_set_get_priv_key(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*get_priv_key)(const EVP_PKEY *pk,
-        unsigned char *priv,
-        size_t *len));
-void EVP_PKEY_asn1_set_get_pub_key(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*get_pub_key)(const EVP_PKEY *pk,
-        unsigned char *pub,
-        size_t *len));
-
-void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth,
-    int (*pkey_security_bits)(const EVP_PKEY
-            *pk));
-
 int EVP_PKEY_CTX_get_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
 int EVP_PKEY_CTX_set_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);

@@ -1802,19 +1607,6 @@ int EVP_PKEY_CTX_set_mac_key(EVP_PKEY_CTX *ctx, const unsigned char *key,
  * Method handles all operations: don't assume any digest related defaults.
  */
 #define EVP_PKEY_FLAG_SIGCTX_CUSTOM 4
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type);
-OSSL_DEPRECATEDIN_3_0 EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags);
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags,
-    const EVP_PKEY_METHOD *meth);
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst,
-    const EVP_PKEY_METHOD *src);
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth);
-OSSL_DEPRECATEDIN_3_0 int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth);
-OSSL_DEPRECATEDIN_3_0 int EVP_PKEY_meth_remove(const EVP_PKEY_METHOD *pmeth);
-OSSL_DEPRECATEDIN_3_0 size_t EVP_PKEY_meth_get_count(void);
-OSSL_DEPRECATEDIN_3_0 const EVP_PKEY_METHOD *EVP_PKEY_meth_get0(size_t idx);
-#endif

 EVP_KEYMGMT *EVP_KEYMGMT_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
     const char *properties);
@@ -1852,8 +1644,8 @@ int EVP_SKEYMGMT_names_do_all(const EVP_SKEYMGMT *keymgmt,
 const OSSL_PARAM *EVP_SKEYMGMT_get0_gen_settable_params(const EVP_SKEYMGMT *skeymgmt);
 const OSSL_PARAM *EVP_SKEYMGMT_get0_imp_settable_params(const EVP_SKEYMGMT *skeymgmt);

-EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
-EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
+EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e /* must be NULL */);
+EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e /* must be NULL */);
 EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_name(OSSL_LIB_CTX *libctx,
     const char *name,
     const char *propquery);
@@ -1887,19 +1679,19 @@ int EVP_PKEY_CTX_md(EVP_PKEY_CTX *ctx, int optype, int cmd, const char *md);
 int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx);
 void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen);

-EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e,
+EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e /* must be NULL */,
     const unsigned char *key, int keylen);
 EVP_PKEY *EVP_PKEY_new_raw_private_key_ex(OSSL_LIB_CTX *libctx,
     const char *keytype,
     const char *propq,
     const unsigned char *priv, size_t len);
-EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e,
+EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e /* must be NULL */,
     const unsigned char *priv,
     size_t len);
 EVP_PKEY *EVP_PKEY_new_raw_public_key_ex(OSSL_LIB_CTX *libctx,
     const char *keytype, const char *propq,
     const unsigned char *pub, size_t len);
-EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e,
+EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e /* must be NULL */,
     const unsigned char *pub,
     size_t len);
 int EVP_PKEY_get_raw_private_key(const EVP_PKEY *pkey, unsigned char *priv,
@@ -1909,7 +1701,8 @@ int EVP_PKEY_get_raw_public_key(const EVP_PKEY *pkey, unsigned char *pub,

 #ifndef OPENSSL_NO_DEPRECATED_3_0
 OSSL_DEPRECATEDIN_3_0
-EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv,
+EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e /* must be NULL */,
+    const unsigned char *priv,
     size_t len, const EVP_CIPHER *cipher);
 #endif

@@ -1942,6 +1735,7 @@ int EVP_SIGNATURE_names_do_all(const EVP_SIGNATURE *signature,
     void *data);
 const OSSL_PARAM *EVP_SIGNATURE_gettable_ctx_params(const EVP_SIGNATURE *sig);
 const OSSL_PARAM *EVP_SIGNATURE_settable_ctx_params(const EVP_SIGNATURE *sig);
+int EVP_SIGNATURE_has_message_update(const EVP_SIGNATURE *sig);

 void EVP_ASYM_CIPHER_free(EVP_ASYM_CIPHER *cipher);
 int EVP_ASYM_CIPHER_up_ref(EVP_ASYM_CIPHER *cipher);
@@ -2027,6 +1821,9 @@ int EVP_PKEY_derive_set_peer_ex(EVP_PKEY_CTX *ctx, EVP_PKEY *peer,
     int validate_peer);
 int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer);
 int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
+EVP_SKEY *EVP_PKEY_derive_SKEY(EVP_PKEY_CTX *ctx, EVP_SKEYMGMT *mgmt,
+    const char *key_type, const char *propquery,
+    size_t keylen, const OSSL_PARAM params[]);

 int EVP_PKEY_encapsulate_init(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[]);
 int EVP_PKEY_auth_encapsulate_init(EVP_PKEY_CTX *ctx, EVP_PKEY *authpriv,
@@ -2103,103 +1900,6 @@ void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb);
 EVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx);

 int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx);
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth,
-    int (*init)(EVP_PKEY_CTX *ctx));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth, int (*copy)(EVP_PKEY_CTX *dst, const EVP_PKEY_CTX *src));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth, void (*cleanup)(EVP_PKEY_CTX *ctx));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth, int (*paramgen_init)(EVP_PKEY_CTX *ctx),
-    int (*paramgen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth, int (*keygen_init)(EVP_PKEY_CTX *ctx),
-    int (*keygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth, int (*sign_init)(EVP_PKEY_CTX *ctx),
-    int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
-        const unsigned char *tbs, size_t tbslen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth, int (*verify_init)(EVP_PKEY_CTX *ctx),
-    int (*verify)(EVP_PKEY_CTX *ctx, const unsigned char *sig, size_t siglen,
-        const unsigned char *tbs, size_t tbslen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth, int (*verify_recover_init)(EVP_PKEY_CTX *ctx),
-    int (*verify_recover)(EVP_PKEY_CTX *ctx, unsigned char *sig,
-        size_t *siglen, const unsigned char *tbs,
-        size_t tbslen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth, int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx),
-    int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
-        EVP_MD_CTX *mctx));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth, int (*verifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx),
-    int (*verifyctx)(EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen,
-        EVP_MD_CTX *mctx));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth, int (*encrypt_init)(EVP_PKEY_CTX *ctx),
-    int (*encryptfn)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
-        const unsigned char *in, size_t inlen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth, int (*decrypt_init)(EVP_PKEY_CTX *ctx),
-    int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
-        const unsigned char *in, size_t inlen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth, int (*derive_init)(EVP_PKEY_CTX *ctx),
-    int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2),
-    int (*ctrl_str)(EVP_PKEY_CTX *ctx, const char *type, const char *value));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_digestsign(EVP_PKEY_METHOD *pmeth,
-    int (*digestsign)(EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen,
-        const unsigned char *tbs, size_t tbslen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_digestverify(EVP_PKEY_METHOD *pmeth,
-    int (*digestverify)(EVP_MD_CTX *ctx, const unsigned char *sig,
-        size_t siglen, const unsigned char *tbs,
-        size_t tbslen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_check(EVP_PKEY_METHOD *pmeth, int (*check)(EVP_PKEY *pkey));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_public_check(EVP_PKEY_METHOD *pmeth, int (*check)(EVP_PKEY *pkey));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_param_check(EVP_PKEY_METHOD *pmeth, int (*check)(EVP_PKEY *pkey));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_digest_custom(EVP_PKEY_METHOD *pmeth, int (*digest_custom)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth, int (**pinit)(EVP_PKEY_CTX *ctx));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth, int (**pcopy)(EVP_PKEY_CTX *dst, const EVP_PKEY_CTX *src));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth, void (**pcleanup)(EVP_PKEY_CTX *ctx));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth, int (**pparamgen_init)(EVP_PKEY_CTX *ctx),
-    int (**pparamgen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth, int (**pkeygen_init)(EVP_PKEY_CTX *ctx),
-    int (**pkeygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth, int (**psign_init)(EVP_PKEY_CTX *ctx),
-    int (**psign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
-        const unsigned char *tbs, size_t tbslen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth, int (**pverify_init)(EVP_PKEY_CTX *ctx),
-    int (**pverify)(EVP_PKEY_CTX *ctx, const unsigned char *sig,
-        size_t siglen, const unsigned char *tbs, size_t tbslen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth,
-    int (**pverify_recover_init)(EVP_PKEY_CTX *ctx),
-    int (**pverify_recover)(EVP_PKEY_CTX *ctx, unsigned char *sig,
-        size_t *siglen, const unsigned char *tbs,
-        size_t tbslen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth,
-    int (**psignctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx),
-    int (**psignctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
-        EVP_MD_CTX *mctx));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth,
-    int (**pverifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx),
-    int (**pverifyctx)(EVP_PKEY_CTX *ctx, const unsigned char *sig,
-        int siglen, EVP_MD_CTX *mctx));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth, int (**pencrypt_init)(EVP_PKEY_CTX *ctx),
-    int (**pencryptfn)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
-        const unsigned char *in, size_t inlen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth, int (**pdecrypt_init)(EVP_PKEY_CTX *ctx),
-    int (**pdecrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
-        const unsigned char *in, size_t inlen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth, int (**pderive_init)(EVP_PKEY_CTX *ctx),
-    int (**pderive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth,
-    int (**pctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2),
-    int (**pctrl_str)(EVP_PKEY_CTX *ctx, const char *type,
-        const char *value));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_digestsign(const EVP_PKEY_METHOD *pmeth,
-    int (**digestsign)(EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen,
-        const unsigned char *tbs, size_t tbslen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_digestverify(const EVP_PKEY_METHOD *pmeth,
-    int (**digestverify)(EVP_MD_CTX *ctx, const unsigned char *sig,
-        size_t siglen, const unsigned char *tbs,
-        size_t tbslen));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_check(const EVP_PKEY_METHOD *pmeth, int (**pcheck)(EVP_PKEY *pkey));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_public_check(const EVP_PKEY_METHOD *pmeth, int (**pcheck)(EVP_PKEY *pkey));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_param_check(const EVP_PKEY_METHOD *pmeth, int (**pcheck)(EVP_PKEY *pkey));
-OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_digest_custom(const EVP_PKEY_METHOD *pmeth,
-    int (**pdigest_custom)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx));
-#endif

 void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange);
 int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange);
@@ -2237,6 +1937,8 @@ EVP_SKEY *EVP_SKEY_generate(OSSL_LIB_CTX *libctx, const char *skeymgmtname,
 EVP_SKEY *EVP_SKEY_import_raw_key(OSSL_LIB_CTX *libctx, const char *skeymgmtname,
     unsigned char *key, size_t keylen,
     const char *propquery);
+EVP_SKEY *EVP_SKEY_import_SKEYMGMT(OSSL_LIB_CTX *libctx, EVP_SKEYMGMT *skeymgmt,
+    int selection, const OSSL_PARAM *params);
 int EVP_SKEY_get0_raw_key(const EVP_SKEY *skey, const unsigned char **key,
     size_t *len);
 const char *EVP_SKEY_get0_key_id(const EVP_SKEY *skey);
@@ -2248,6 +1950,24 @@ const char *EVP_SKEY_get0_skeymgmt_name(const EVP_SKEY *skey);
 const char *EVP_SKEY_get0_provider_name(const EVP_SKEY *skey);
 EVP_SKEY *EVP_SKEY_to_provider(EVP_SKEY *skey, OSSL_LIB_CTX *libctx,
     OSSL_PROVIDER *prov, const char *propquery);
+int EVP_SKEY_get0_local_keyid(const EVP_SKEY *skey,
+    const unsigned char **id, size_t *len);
+int EVP_SKEY_get0_algorithm_id(const EVP_SKEY *skey,
+    const unsigned char **oid, size_t *oid_len,
+    const unsigned char **params, size_t *params_len);
+
+/*
+ * The seemingly redundant expression (char *)(strstr(curve, "")) serves to
+ * cast const char * to char *, while avoiding accidental casting of improper
+ * (non-string) types.
+ * The direct cast of the result of strstr() to char * is necessary in C++,
+ * where strstr can return const char *.
+ */
+#define EVP_EC_gen(curve)               \
+    EVP_PKEY_Q_keygen(NULL, NULL, "EC", \
+        (curve) ? (char *)(strstr(curve, "")) : NULL)
+int EVP_EC_affine2oct(const BIGNUM *x, const BIGNUM *y, size_t field_len,
+    unsigned char **pbuf, size_t *pbsize);

 #ifdef __cplusplus
 }
diff --git a/deps/openssl/openssl/include/openssl/evperr.h b/deps/openssl/openssl/include/openssl/evperr.h
deleted file mode 100644
index 06dd95f4e25..00000000000
--- a/deps/openssl/openssl/include/openssl/evperr.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_EVPERR_H
-#define OPENSSL_EVPERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * EVP reason codes.
- */
-#define EVP_R_AES_KEY_SETUP_FAILED 143
-#define EVP_R_ARIA_KEY_SETUP_FAILED 176
-#define EVP_R_BAD_ALGORITHM_NAME 200
-#define EVP_R_BAD_DECRYPT 100
-#define EVP_R_BAD_KEY_LENGTH 195
-#define EVP_R_BUFFER_TOO_SMALL 155
-#define EVP_R_CACHE_CONSTANTS_FAILED 225
-#define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157
-#define EVP_R_CANNOT_GET_PARAMETERS 197
-#define EVP_R_CANNOT_SET_PARAMETERS 198
-#define EVP_R_CIPHER_NOT_GCM_MODE 184
-#define EVP_R_CIPHER_PARAMETER_ERROR 122
-#define EVP_R_COMMAND_NOT_SUPPORTED 147
-#define EVP_R_CONFLICTING_ALGORITHM_NAME 201
-#define EVP_R_COPY_ERROR 173
-#define EVP_R_CTRL_NOT_IMPLEMENTED 132
-#define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133
-#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138
-#define EVP_R_DECODE_ERROR 114
-#define EVP_R_DEFAULT_QUERY_PARSE_ERROR 210
-#define EVP_R_DIFFERENT_KEY_TYPES 101
-#define EVP_R_DIFFERENT_PARAMETERS 153
-#define EVP_R_ERROR_LOADING_SECTION 165
-#define EVP_R_EXPECTING_AN_HMAC_KEY 174
-#define EVP_R_EXPECTING_AN_RSA_KEY 127
-#define EVP_R_EXPECTING_A_DH_KEY 128
-#define EVP_R_EXPECTING_A_DSA_KEY 129
-#define EVP_R_EXPECTING_A_ECX_KEY 219
-#define EVP_R_EXPECTING_A_EC_KEY 142
-#define EVP_R_EXPECTING_A_POLY1305_KEY 164
-#define EVP_R_EXPECTING_A_SIPHASH_KEY 175
-#define EVP_R_FINAL_ERROR 188
-#define EVP_R_GENERATE_ERROR 214
-#define EVP_R_GETTING_ALGORITHMIDENTIFIER_NOT_SUPPORTED 229
-#define EVP_R_GET_RAW_KEY_FAILED 182
-#define EVP_R_ILLEGAL_SCRYPT_PARAMETERS 171
-#define EVP_R_INACCESSIBLE_DOMAIN_PARAMETERS 204
-#define EVP_R_INACCESSIBLE_KEY 203
-#define EVP_R_INITIALIZATION_ERROR 134
-#define EVP_R_INPUT_NOT_INITIALIZED 111
-#define EVP_R_INVALID_CUSTOM_LENGTH 185
-#define EVP_R_INVALID_DIGEST 152
-#define EVP_R_INVALID_IV_LENGTH 194
-#define EVP_R_INVALID_KEY 163
-#define EVP_R_INVALID_KEY_LENGTH 130
-#define EVP_R_INVALID_LENGTH 221
-#define EVP_R_INVALID_NULL_ALGORITHM 218
-#define EVP_R_INVALID_OPERATION 148
-#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
-#define EVP_R_INVALID_SALT_LENGTH 186
-#define EVP_R_INVALID_SECRET_LENGTH 223
-#define EVP_R_INVALID_SEED_LENGTH 220
-#define EVP_R_INVALID_VALUE 222
-#define EVP_R_KEYMGMT_EXPORT_FAILURE 205
-#define EVP_R_KEY_SETUP_FAILED 180
-#define EVP_R_LOCKING_NOT_SUPPORTED 213
-#define EVP_R_MEMORY_LIMIT_EXCEEDED 172
-#define EVP_R_MESSAGE_DIGEST_IS_NULL 159
-#define EVP_R_METHOD_NOT_SUPPORTED 144
-#define EVP_R_MISSING_PARAMETERS 103
-#define EVP_R_NOT_ABLE_TO_COPY_CTX 190
-#define EVP_R_NOT_XOF_OR_INVALID_LENGTH 178
-#define EVP_R_NO_CIPHER_SET 131
-#define EVP_R_NO_DEFAULT_DIGEST 158
-#define EVP_R_NO_DIGEST_SET 139
-#define EVP_R_NO_IMPORT_FUNCTION 206
-#define EVP_R_NO_KEYMGMT_AVAILABLE 199
-#define EVP_R_NO_KEYMGMT_PRESENT 196
-#define EVP_R_NO_KEY_SET 154
-#define EVP_R_NO_OPERATION_SET 149
-#define EVP_R_NULL_MAC_PKEY_CTX 208
-#define EVP_R_ONLY_ONESHOT_SUPPORTED 177
-#define EVP_R_OPERATION_NOT_INITIALIZED 151
-#define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150
-#define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_SIGNATURE_TYPE 226
-#define EVP_R_OUTPUT_WOULD_OVERFLOW 202
-#define EVP_R_PARAMETER_TOO_LARGE 187
-#define EVP_R_PARTIALLY_OVERLAPPING 162
-#define EVP_R_PBKDF2_ERROR 181
-#define EVP_R_PIPELINE_NOT_SUPPORTED 230
-#define EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED 179
-#define EVP_R_PRIVATE_KEY_DECODE_ERROR 145
-#define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146
-#define EVP_R_PROVIDER_ASYM_CIPHER_FAILURE 232
-#define EVP_R_PROVIDER_ASYM_CIPHER_NOT_SUPPORTED 235
-#define EVP_R_PROVIDER_KEYMGMT_FAILURE 233
-#define EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED 236
-#define EVP_R_PROVIDER_SIGNATURE_FAILURE 234
-#define EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED 237
-#define EVP_R_PUBLIC_KEY_NOT_RSA 106
-#define EVP_R_SETTING_XOF_FAILED 227
-#define EVP_R_SET_DEFAULT_PROPERTY_FAILURE 209
-#define EVP_R_SIGNATURE_TYPE_AND_KEY_TYPE_INCOMPATIBLE 228
-#define EVP_R_TOO_MANY_PIPES 231
-#define EVP_R_TOO_MANY_RECORDS 183
-#define EVP_R_UNABLE_TO_ENABLE_LOCKING 212
-#define EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE 215
-#define EVP_R_UNABLE_TO_GET_RANDOM_STRENGTH 216
-#define EVP_R_UNABLE_TO_LOCK_CONTEXT 211
-#define EVP_R_UNABLE_TO_SET_CALLBACKS 217
-#define EVP_R_UNKNOWN_BITS 166
-#define EVP_R_UNKNOWN_CIPHER 160
-#define EVP_R_UNKNOWN_DIGEST 161
-#define EVP_R_UNKNOWN_KEY_TYPE 207
-#define EVP_R_UNKNOWN_MAX_SIZE 167
-#define EVP_R_UNKNOWN_OPTION 169
-#define EVP_R_UNKNOWN_PBE_ALGORITHM 121
-#define EVP_R_UNKNOWN_SECURITY_BITS 168
-#define EVP_R_UNSUPPORTED_ALGORITHM 156
-#define EVP_R_UNSUPPORTED_CIPHER 107
-#define EVP_R_UNSUPPORTED_KEYLENGTH 123
-#define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124
-#define EVP_R_UNSUPPORTED_KEY_SIZE 108
-#define EVP_R_UNSUPPORTED_KEY_TYPE 224
-#define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135
-#define EVP_R_UNSUPPORTED_PRF 125
-#define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118
-#define EVP_R_UNSUPPORTED_SALT_TYPE 126
-#define EVP_R_UPDATE_ERROR 189
-#define EVP_R_WRAP_MODE_NOT_ALLOWED 170
-#define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109
-#define EVP_R_XTS_DATA_UNIT_IS_TOO_LARGE 191
-#define EVP_R_XTS_DUPLICATED_KEYS 192
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/fips_names.h b/deps/openssl/openssl/include/openssl/fips_names.h
index 3e310bb4a8f..22ffdf5a2cb 100644
--- a/deps/openssl/openssl/include/openssl/fips_names.h
+++ b/deps/openssl/openssl/include/openssl/fips_names.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -38,6 +38,12 @@ extern "C" {
  */
 #define OSSL_PROV_FIPS_PARAM_CONDITIONAL_ERRORS "conditional-errors"

+/*
+ * A boolean that determines if all the FIPS conditional self-test are executed
+ * at module startup or deferred and run only when an algorithm is invoked
+ */
+#define OSSL_PROV_FIPS_PARAM_DEFER_TESTS "defer-tests"
+
 /* The following are provided for backwards compatibility */
 #define OSSL_PROV_FIPS_PARAM_SECURITY_CHECKS OSSL_PROV_PARAM_SECURITY_CHECKS
 #define OSSL_PROV_FIPS_PARAM_TLS1_PRF_EMS_CHECK OSSL_PROV_PARAM_TLS1_PRF_EMS_CHECK
diff --git a/deps/openssl/openssl/include/openssl/fipskey.h b/deps/openssl/openssl/include/openssl/fipskey.h
deleted file mode 100644
index c012013d98d..00000000000
--- a/deps/openssl/openssl/include/openssl/fipskey.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/fipskey.h"
diff --git a/deps/openssl/openssl/include/openssl/hmac.h b/deps/openssl/openssl/include/openssl/hmac.h
index cb866b22787..a608098a257 100644
--- a/deps/openssl/openssl/include/openssl/hmac.h
+++ b/deps/openssl/openssl/include/openssl/hmac.h
@@ -41,7 +41,8 @@ OSSL_DEPRECATEDIN_1_1_0 __owur int HMAC_Init(HMAC_CTX *ctx,
 #endif
 #ifndef OPENSSL_NO_DEPRECATED_3_0
 OSSL_DEPRECATEDIN_3_0 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
-    const EVP_MD *md, ENGINE *impl);
+    const EVP_MD *md,
+    ENGINE *impl /* must be NULL */);
 OSSL_DEPRECATEDIN_3_0 int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data,
     size_t len);
 OSSL_DEPRECATEDIN_3_0 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md,
diff --git a/deps/openssl/openssl/include/openssl/httperr.h b/deps/openssl/openssl/include/openssl/httperr.h
deleted file mode 100644
index 4c1cc6ad6bf..00000000000
--- a/deps/openssl/openssl/include/openssl/httperr.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_HTTPERR_H
-#define OPENSSL_HTTPERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * HTTP reason codes.
- */
-#define HTTP_R_ASN1_LEN_EXCEEDS_MAX_RESP_LEN 108
-#define HTTP_R_CONNECT_FAILURE 100
-#define HTTP_R_CONTENT_TYPE_MISMATCH 131
-#define HTTP_R_ERROR_PARSING_ASN1_LENGTH 109
-#define HTTP_R_ERROR_PARSING_CONTENT_LENGTH 119
-#define HTTP_R_ERROR_PARSING_URL 101
-#define HTTP_R_ERROR_RECEIVING 103
-#define HTTP_R_ERROR_SENDING 102
-#define HTTP_R_FAILED_READING_DATA 128
-#define HTTP_R_HEADER_PARSE_ERROR 126
-#define HTTP_R_INCONSISTENT_CONTENT_LENGTH 120
-#define HTTP_R_INVALID_PORT_NUMBER 123
-#define HTTP_R_INVALID_URL_PATH 125
-#define HTTP_R_INVALID_URL_SCHEME 124
-#define HTTP_R_MAX_RESP_LEN_EXCEEDED 117
-#define HTTP_R_MISSING_ASN1_ENCODING 110
-#define HTTP_R_MISSING_CONTENT_TYPE 121
-#define HTTP_R_MISSING_REDIRECT_LOCATION 111
-#define HTTP_R_RECEIVED_ERROR 105
-#define HTTP_R_RECEIVED_WRONG_HTTP_VERSION 106
-#define HTTP_R_REDIRECTION_FROM_HTTPS_TO_HTTP 112
-#define HTTP_R_REDIRECTION_NOT_ENABLED 116
-#define HTTP_R_RESPONSE_LINE_TOO_LONG 113
-#define HTTP_R_RESPONSE_PARSE_ERROR 104
-#define HTTP_R_RESPONSE_TOO_MANY_HDRLINES 130
-#define HTTP_R_RETRY_TIMEOUT 129
-#define HTTP_R_SERVER_CANCELED_CONNECTION 127
-#define HTTP_R_SOCK_NOT_SUPPORTED 122
-#define HTTP_R_STATUS_CODE_UNSUPPORTED 114
-#define HTTP_R_TLS_NOT_ENABLED 107
-#define HTTP_R_TOO_MANY_REDIRECTIONS 115
-#define HTTP_R_UNEXPECTED_CONTENT_TYPE 118
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/kdf.h b/deps/openssl/openssl/include/openssl/kdf.h
index d06ca6c69de..aee4aa1bc60 100644
--- a/deps/openssl/openssl/include/openssl/kdf.h
+++ b/deps/openssl/openssl/include/openssl/kdf.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -37,12 +37,22 @@ const char *EVP_KDF_get0_description(const EVP_KDF *kdf);
 int EVP_KDF_is_a(const EVP_KDF *kdf, const char *name);
 const char *EVP_KDF_get0_name(const EVP_KDF *kdf);
 const OSSL_PROVIDER *EVP_KDF_get0_provider(const EVP_KDF *kdf);
-const EVP_KDF *EVP_KDF_CTX_kdf(EVP_KDF_CTX *ctx);
+const EVP_KDF *EVP_KDF_CTX_get0_kdf(const EVP_KDF_CTX *ctx);
+EVP_KDF *EVP_KDF_CTX_get1_kdf(const EVP_KDF_CTX *ctx);
+
+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+OSSL_DEPRECATEDIN_4_1_FOR("use EVP_KDF_CTX_get0_kdf()")
+const EVP_KDF *EVP_KDF_CTX_kdf(const EVP_KDF_CTX *ctx);
+#endif /* !OPENSSL_NO_DEPRECATED_4_1 */

 void EVP_KDF_CTX_reset(EVP_KDF_CTX *ctx);
 size_t EVP_KDF_CTX_get_kdf_size(EVP_KDF_CTX *ctx);
 int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen,
     const OSSL_PARAM params[]);
+int EVP_KDF_CTX_set_SKEY(EVP_KDF_CTX *ctx, EVP_SKEY *key, const char *paramname);
+EVP_SKEY *EVP_KDF_derive_SKEY(EVP_KDF_CTX *ctx, EVP_SKEYMGMT *mgmt,
+    const char *key_type, const char *propquery,
+    size_t keylen, const OSSL_PARAM params[]);
 int EVP_KDF_get_params(EVP_KDF *kdf, OSSL_PARAM params[]);
 int EVP_KDF_CTX_get_params(EVP_KDF_CTX *ctx, OSSL_PARAM params[]);
 int EVP_KDF_CTX_set_params(EVP_KDF_CTX *ctx, const OSSL_PARAM params[]);
@@ -63,6 +73,10 @@ int EVP_KDF_names_do_all(const EVP_KDF *kdf,
 #define EVP_KDF_HKDF_MODE_EXTRACT_ONLY 1
 #define EVP_KDF_HKDF_MODE_EXPAND_ONLY 2

+#define EVP_KDF_IKEV2_MODE_GEN 0
+#define EVP_KDF_IKEV2_MODE_DKM 1
+#define EVP_KDF_IKEV2_MODE_REKEY 2
+
 #define EVP_KDF_SSHKDF_TYPE_INITIAL_IV_CLI_TO_SRV 65
 #define EVP_KDF_SSHKDF_TYPE_INITIAL_IV_SRV_TO_CLI 66
 #define EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_CLI_TO_SRV 67
diff --git a/deps/openssl/openssl/include/openssl/lhash.h b/deps/openssl/openssl/include/openssl/lhash.h
deleted file mode 100644
index 8d824f5cfe6..00000000000
--- a/deps/openssl/openssl/include/openssl/lhash.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/lhash.h"
diff --git a/deps/openssl/openssl/include/openssl/macros.h b/deps/openssl/openssl/include/openssl/macros.h
index 315c1389c6d..96b83256542 100644
--- a/deps/openssl/openssl/include/openssl/macros.h
+++ b/deps/openssl/openssl/include/openssl/macros.h
@@ -11,7 +11,7 @@
 #define OPENSSL_MACROS_H
 #pragma once

-#include <openssl/opensslconf.h>
+#include <openssl/configuration.h>
 #include <openssl/opensslv.h>

 /* Helper macros for CPP string composition */
@@ -42,41 +42,50 @@
 #define OSSL_DEPRECATED(since) \
     __declspec(deprecated("Since OpenSSL " #since))
 #define OSSL_DEPRECATED_FOR(since, message) \
-    __declspec(deprecated("Since OpenSSL " #since ";" message))
+    __declspec(deprecated("Since OpenSSL " #since "; " message))
+#define OSSL_DEPRECATED_MESSAGE(message) __declspec(deprecated(message))
 #elif _MSC_VER >= 1310
 #define OSSL_DEPRECATED(since) __declspec(deprecated)
 #define OSSL_DEPRECATED_FOR(since, message) __declspec(deprecated)
+#define OSSL_DEPRECATED_MESSAGE(message) __declspec(deprecated)
 #endif
+#define OSSL_BEGIN_ALLOW_DEPRECATED \
+    __pragma(warning(push)) __pragma(warning(disable : 4996))
+#define OSSL_END_ALLOW_DEPRECATED __pragma(warning(pop))
 #elif defined(__GNUC__)
-/*
- * According to GCC documentation, deprecations with message appeared in
- * GCC 4.5.0
- */
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
 #define OSSL_DEPRECATED(since) \
     __attribute__((deprecated("Since OpenSSL " #since)))
 #define OSSL_DEPRECATED_FOR(since, message) \
-    __attribute__((deprecated("Since OpenSSL " #since ";" message)))
-#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
-#define OSSL_DEPRECATED(since) __attribute__((deprecated))
-#define OSSL_DEPRECATED_FOR(since, message) __attribute__((deprecated))
-#endif
+    __attribute__((deprecated("Since OpenSSL " #since "; " message)))
+#define OSSL_DEPRECATED_MESSAGE(message) __attribute__((deprecated(message)))
+#define OSSL_BEGIN_ALLOW_DEPRECATED \
+    _Pragma("GCC diagnostic push")  \
+        _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
+#define OSSL_END_ALLOW_DEPRECATED _Pragma("GCC diagnostic pop")
 #elif defined(__SUNPRO_C)
 #if (__SUNPRO_C >= 0x5130)
 #define OSSL_DEPRECATED(since) __attribute__((deprecated))
 #define OSSL_DEPRECATED_FOR(since, message) __attribute__((deprecated))
+#define OSSL_DEPRECATED_MESSAGE(message) __attribute__((deprecated))
 #endif
+#define OSSL_BEGIN_ALLOW_DEPRECATED \
+    #pragma error_messages(off, E_DEPRECATED_ATT, E_DEPRECATED_ATT_MESS)
+#define OSSL_END_ALLOW_DEPRECATED \
+    #pragma error_messages(on, E_DEPRECATED_ATT, E_DEPRECATED_ATT_MESS)
 #endif
 #endif
 #endif

 /*
  * Still not defined?  Then define no-op macros. This means these macros
- * are unsuitable for use in a typedef.
+ * are unsuitable for use in a typedef except OSSL_DEPRECATED_MESSAGE.
  */
 #ifndef OSSL_DEPRECATED
 #define OSSL_DEPRECATED(since) extern
 #define OSSL_DEPRECATED_FOR(since, message) extern
+#define OSSL_DEPRECATED_MESSAGE(message)
+#define OSSL_BEGIN_ALLOW_DEPRECATED
+#define OSSL_END_ALLOW_DEPRECATED
 #endif

 /*
@@ -168,6 +177,9 @@
  * 'no-deprecated'.
  */

+#undef OPENSSL_NO_DEPRECATED_4_1
+#undef OPENSSL_NO_DEPRECATED_4_0
+#undef OPENSSL_NO_DEPRECATED_3_6
 #undef OPENSSL_NO_DEPRECATED_3_5
 #undef OPENSSL_NO_DEPRECATED_3_4
 #undef OPENSSL_NO_DEPRECATED_3_1
@@ -179,6 +191,39 @@
 #undef OPENSSL_NO_DEPRECATED_1_0_0
 #undef OPENSSL_NO_DEPRECATED_0_9_8

+#if OPENSSL_API_LEVEL >= 40100
+#ifndef OPENSSL_NO_DEPRECATED
+#define OSSL_DEPRECATEDIN_4_1 OSSL_DEPRECATED(4.1)
+#define OSSL_DEPRECATEDIN_4_1_FOR(msg) OSSL_DEPRECATED_FOR(4.1, msg)
+#else
+#define OPENSSL_NO_DEPRECATED_4_1
+#endif
+#else
+#define OSSL_DEPRECATEDIN_4_1
+#define OSSL_DEPRECATEDIN_4_1_FOR(msg)
+#endif
+#if OPENSSL_API_LEVEL >= 40000
+#ifndef OPENSSL_NO_DEPRECATED
+#define OSSL_DEPRECATEDIN_4_0 OSSL_DEPRECATED(4.0)
+#define OSSL_DEPRECATEDIN_4_0_FOR(msg) OSSL_DEPRECATED_FOR(4.0, msg)
+#else
+#define OPENSSL_NO_DEPRECATED_4_0
+#endif
+#else
+#define OSSL_DEPRECATEDIN_4_0
+#define OSSL_DEPRECATEDIN_4_0_FOR(msg)
+#endif
+#if OPENSSL_API_LEVEL >= 30600
+#ifndef OPENSSL_NO_DEPRECATED
+#define OSSL_DEPRECATEDIN_3_6 OSSL_DEPRECATED(3.6)
+#define OSSL_DEPRECATEDIN_3_6_FOR(msg) OSSL_DEPRECATED_FOR(3.6, msg)
+#else
+#define OPENSSL_NO_DEPRECATED_3_6
+#endif
+#else
+#define OSSL_DEPRECATEDIN_3_6
+#define OSSL_DEPRECATEDIN_3_6_FOR(msg)
+#endif
 #if OPENSSL_API_LEVEL >= 30500
 #ifndef OPENSSL_NO_DEPRECATED
 #define OSSL_DEPRECATEDIN_3_5 OSSL_DEPRECATED(3.5)
@@ -321,7 +366,7 @@
 #if defined(__STDC_VERSION__)
 #if __STDC_VERSION__ >= 199901L
 #define OPENSSL_FUNC __func__
-#elif defined(__GNUC__) && __GNUC__ >= 2
+#elif defined(__GNUC__)
 #define OPENSSL_FUNC __FUNCTION__
 #endif
 #elif defined(_MSC_VER)
diff --git a/deps/openssl/openssl/include/openssl/md4.h b/deps/openssl/openssl/include/openssl/md4.h
index d60fe4a667d..06993aaa54c 100644
--- a/deps/openssl/openssl/include/openssl/md4.h
+++ b/deps/openssl/openssl/include/openssl/md4.h
@@ -34,7 +34,7 @@ extern "C" {
  * ! MD4_LONG has to be at least 32 bits wide.                     !
  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  */
-#define MD4_LONG unsigned int
+typedef unsigned int MD4_LONG;

 #define MD4_CBLOCK 64
 #define MD4_LBLOCK (MD4_CBLOCK / 4)
diff --git a/deps/openssl/openssl/include/openssl/md5.h b/deps/openssl/openssl/include/openssl/md5.h
index 0ec3d1ce956..9f65778104b 100644
--- a/deps/openssl/openssl/include/openssl/md5.h
+++ b/deps/openssl/openssl/include/openssl/md5.h
@@ -33,7 +33,7 @@ extern "C" {
  * ! MD5_LONG has to be at least 32 bits wide.                     !
  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  */
-#define MD5_LONG unsigned int
+typedef unsigned int MD5_LONG;

 #define MD5_CBLOCK 64
 #define MD5_LBLOCK (MD5_CBLOCK / 4)
diff --git a/deps/openssl/openssl/include/openssl/obj_mac.h b/deps/openssl/openssl/include/openssl/obj_mac.h
deleted file mode 100644
index bbce70f3652..00000000000
--- a/deps/openssl/openssl/include/openssl/obj_mac.h
+++ /dev/null
@@ -1,6636 +0,0 @@
-/*
- * WARNING: do not edit!
- * Generated by crypto/objects/objects.pl
- *
- * Copyright 2000-2025 The OpenSSL Project Authors. All Rights Reserved.
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_OBJ_MAC_H
-# define OPENSSL_OBJ_MAC_H
-# pragma once
-
-#define SN_undef                        "UNDEF"
-#define LN_undef                        "undefined"
-#define NID_undef                       0
-#define OBJ_undef                       0L
-
-#define SN_itu_t                "ITU-T"
-#define LN_itu_t                "itu-t"
-#define NID_itu_t               645
-#define OBJ_itu_t               0L
-
-#define NID_ccitt               404
-#define OBJ_ccitt               OBJ_itu_t
-
-#define SN_iso          "ISO"
-#define LN_iso          "iso"
-#define NID_iso         181
-#define OBJ_iso         1L
-
-#define SN_joint_iso_itu_t              "JOINT-ISO-ITU-T"
-#define LN_joint_iso_itu_t              "joint-iso-itu-t"
-#define NID_joint_iso_itu_t             646
-#define OBJ_joint_iso_itu_t             2L
-
-#define NID_joint_iso_ccitt             393
-#define OBJ_joint_iso_ccitt             OBJ_joint_iso_itu_t
-
-#define SN_member_body          "member-body"
-#define LN_member_body          "ISO Member Body"
-#define NID_member_body         182
-#define OBJ_member_body         OBJ_iso,2L
-
-#define SN_identified_organization              "identified-organization"
-#define NID_identified_organization             676
-#define OBJ_identified_organization             OBJ_iso,3L
-
-#define SN_gmac         "GMAC"
-#define LN_gmac         "gmac"
-#define NID_gmac                1195
-#define OBJ_gmac                OBJ_iso,0L,9797L,3L,4L
-
-#define SN_hmac_md5             "HMAC-MD5"
-#define LN_hmac_md5             "hmac-md5"
-#define NID_hmac_md5            780
-#define OBJ_hmac_md5            OBJ_identified_organization,6L,1L,5L,5L,8L,1L,1L
-
-#define SN_hmac_sha1            "HMAC-SHA1"
-#define LN_hmac_sha1            "hmac-sha1"
-#define NID_hmac_sha1           781
-#define OBJ_hmac_sha1           OBJ_identified_organization,6L,1L,5L,5L,8L,1L,2L
-
-#define SN_x509ExtAdmission             "x509ExtAdmission"
-#define LN_x509ExtAdmission             "Professional Information or basis for Admission"
-#define NID_x509ExtAdmission            1093
-#define OBJ_x509ExtAdmission            OBJ_identified_organization,36L,8L,3L,3L
-
-#define SN_certicom_arc         "certicom-arc"
-#define NID_certicom_arc                677
-#define OBJ_certicom_arc                OBJ_identified_organization,132L
-
-#define SN_ieee         "ieee"
-#define NID_ieee                1170
-#define OBJ_ieee                OBJ_identified_organization,111L
-
-#define SN_ieee_siswg           "ieee-siswg"
-#define LN_ieee_siswg           "IEEE Security in Storage Working Group"
-#define NID_ieee_siswg          1171
-#define OBJ_ieee_siswg          OBJ_ieee,2L,1619L
-
-#define SN_international_organizations          "international-organizations"
-#define LN_international_organizations          "International Organizations"
-#define NID_international_organizations         647
-#define OBJ_international_organizations         OBJ_joint_iso_itu_t,23L
-
-#define SN_wap          "wap"
-#define NID_wap         678
-#define OBJ_wap         OBJ_international_organizations,43L
-
-#define SN_wap_wsg              "wap-wsg"
-#define NID_wap_wsg             679
-#define OBJ_wap_wsg             OBJ_wap,1L
-
-#define SN_selected_attribute_types             "selected-attribute-types"
-#define LN_selected_attribute_types             "Selected Attribute Types"
-#define NID_selected_attribute_types            394
-#define OBJ_selected_attribute_types            OBJ_joint_iso_itu_t,5L,1L,5L
-
-#define SN_clearance            "clearance"
-#define NID_clearance           395
-#define OBJ_clearance           OBJ_selected_attribute_types,55L
-
-#define SN_ISO_US               "ISO-US"
-#define LN_ISO_US               "ISO US Member Body"
-#define NID_ISO_US              183
-#define OBJ_ISO_US              OBJ_member_body,840L
-
-#define SN_X9_57                "X9-57"
-#define LN_X9_57                "X9.57"
-#define NID_X9_57               184
-#define OBJ_X9_57               OBJ_ISO_US,10040L
-
-#define SN_X9cm         "X9cm"
-#define LN_X9cm         "X9.57 CM ?"
-#define NID_X9cm                185
-#define OBJ_X9cm                OBJ_X9_57,4L
-
-#define SN_ISO_CN               "ISO-CN"
-#define LN_ISO_CN               "ISO CN Member Body"
-#define NID_ISO_CN              1140
-#define OBJ_ISO_CN              OBJ_member_body,156L
-
-#define SN_oscca                "oscca"
-#define NID_oscca               1141
-#define OBJ_oscca               OBJ_ISO_CN,10197L
-
-#define SN_sm_scheme            "sm-scheme"
-#define NID_sm_scheme           1142
-#define OBJ_sm_scheme           OBJ_oscca,1L
-
-#define SN_dsa          "DSA"
-#define LN_dsa          "dsaEncryption"
-#define NID_dsa         116
-#define OBJ_dsa         OBJ_X9cm,1L
-
-#define SN_dsaWithSHA1          "DSA-SHA1"
-#define LN_dsaWithSHA1          "dsaWithSHA1"
-#define NID_dsaWithSHA1         113
-#define OBJ_dsaWithSHA1         OBJ_X9cm,3L
-
-#define SN_ansi_X9_62           "ansi-X9-62"
-#define LN_ansi_X9_62           "ANSI X9.62"
-#define NID_ansi_X9_62          405
-#define OBJ_ansi_X9_62          OBJ_ISO_US,10045L
-
-#define OBJ_X9_62_id_fieldType          OBJ_ansi_X9_62,1L
-
-#define SN_X9_62_prime_field            "prime-field"
-#define NID_X9_62_prime_field           406
-#define OBJ_X9_62_prime_field           OBJ_X9_62_id_fieldType,1L
-
-#define SN_X9_62_characteristic_two_field               "characteristic-two-field"
-#define NID_X9_62_characteristic_two_field              407
-#define OBJ_X9_62_characteristic_two_field              OBJ_X9_62_id_fieldType,2L
-
-#define SN_X9_62_id_characteristic_two_basis            "id-characteristic-two-basis"
-#define NID_X9_62_id_characteristic_two_basis           680
-#define OBJ_X9_62_id_characteristic_two_basis           OBJ_X9_62_characteristic_two_field,3L
-
-#define SN_X9_62_onBasis                "onBasis"
-#define NID_X9_62_onBasis               681
-#define OBJ_X9_62_onBasis               OBJ_X9_62_id_characteristic_two_basis,1L
-
-#define SN_X9_62_tpBasis                "tpBasis"
-#define NID_X9_62_tpBasis               682
-#define OBJ_X9_62_tpBasis               OBJ_X9_62_id_characteristic_two_basis,2L
-
-#define SN_X9_62_ppBasis                "ppBasis"
-#define NID_X9_62_ppBasis               683
-#define OBJ_X9_62_ppBasis               OBJ_X9_62_id_characteristic_two_basis,3L
-
-#define OBJ_X9_62_id_publicKeyType              OBJ_ansi_X9_62,2L
-
-#define SN_X9_62_id_ecPublicKey         "id-ecPublicKey"
-#define NID_X9_62_id_ecPublicKey                408
-#define OBJ_X9_62_id_ecPublicKey                OBJ_X9_62_id_publicKeyType,1L
-
-#define OBJ_X9_62_ellipticCurve         OBJ_ansi_X9_62,3L
-
-#define OBJ_X9_62_c_TwoCurve            OBJ_X9_62_ellipticCurve,0L
-
-#define SN_X9_62_c2pnb163v1             "c2pnb163v1"
-#define NID_X9_62_c2pnb163v1            684
-#define OBJ_X9_62_c2pnb163v1            OBJ_X9_62_c_TwoCurve,1L
-
-#define SN_X9_62_c2pnb163v2             "c2pnb163v2"
-#define NID_X9_62_c2pnb163v2            685
-#define OBJ_X9_62_c2pnb163v2            OBJ_X9_62_c_TwoCurve,2L
-
-#define SN_X9_62_c2pnb163v3             "c2pnb163v3"
-#define NID_X9_62_c2pnb163v3            686
-#define OBJ_X9_62_c2pnb163v3            OBJ_X9_62_c_TwoCurve,3L
-
-#define SN_X9_62_c2pnb176v1             "c2pnb176v1"
-#define NID_X9_62_c2pnb176v1            687
-#define OBJ_X9_62_c2pnb176v1            OBJ_X9_62_c_TwoCurve,4L
-
-#define SN_X9_62_c2tnb191v1             "c2tnb191v1"
-#define NID_X9_62_c2tnb191v1            688
-#define OBJ_X9_62_c2tnb191v1            OBJ_X9_62_c_TwoCurve,5L
-
-#define SN_X9_62_c2tnb191v2             "c2tnb191v2"
-#define NID_X9_62_c2tnb191v2            689
-#define OBJ_X9_62_c2tnb191v2            OBJ_X9_62_c_TwoCurve,6L
-
-#define SN_X9_62_c2tnb191v3             "c2tnb191v3"
-#define NID_X9_62_c2tnb191v3            690
-#define OBJ_X9_62_c2tnb191v3            OBJ_X9_62_c_TwoCurve,7L
-
-#define SN_X9_62_c2onb191v4             "c2onb191v4"
-#define NID_X9_62_c2onb191v4            691
-#define OBJ_X9_62_c2onb191v4            OBJ_X9_62_c_TwoCurve,8L
-
-#define SN_X9_62_c2onb191v5             "c2onb191v5"
-#define NID_X9_62_c2onb191v5            692
-#define OBJ_X9_62_c2onb191v5            OBJ_X9_62_c_TwoCurve,9L
-
-#define SN_X9_62_c2pnb208w1             "c2pnb208w1"
-#define NID_X9_62_c2pnb208w1            693
-#define OBJ_X9_62_c2pnb208w1            OBJ_X9_62_c_TwoCurve,10L
-
-#define SN_X9_62_c2tnb239v1             "c2tnb239v1"
-#define NID_X9_62_c2tnb239v1            694
-#define OBJ_X9_62_c2tnb239v1            OBJ_X9_62_c_TwoCurve,11L
-
-#define SN_X9_62_c2tnb239v2             "c2tnb239v2"
-#define NID_X9_62_c2tnb239v2            695
-#define OBJ_X9_62_c2tnb239v2            OBJ_X9_62_c_TwoCurve,12L
-
-#define SN_X9_62_c2tnb239v3             "c2tnb239v3"
-#define NID_X9_62_c2tnb239v3            696
-#define OBJ_X9_62_c2tnb239v3            OBJ_X9_62_c_TwoCurve,13L
-
-#define SN_X9_62_c2onb239v4             "c2onb239v4"
-#define NID_X9_62_c2onb239v4            697
-#define OBJ_X9_62_c2onb239v4            OBJ_X9_62_c_TwoCurve,14L
-
-#define SN_X9_62_c2onb239v5             "c2onb239v5"
-#define NID_X9_62_c2onb239v5            698
-#define OBJ_X9_62_c2onb239v5            OBJ_X9_62_c_TwoCurve,15L
-
-#define SN_X9_62_c2pnb272w1             "c2pnb272w1"
-#define NID_X9_62_c2pnb272w1            699
-#define OBJ_X9_62_c2pnb272w1            OBJ_X9_62_c_TwoCurve,16L
-
-#define SN_X9_62_c2pnb304w1             "c2pnb304w1"
-#define NID_X9_62_c2pnb304w1            700
-#define OBJ_X9_62_c2pnb304w1            OBJ_X9_62_c_TwoCurve,17L
-
-#define SN_X9_62_c2tnb359v1             "c2tnb359v1"
-#define NID_X9_62_c2tnb359v1            701
-#define OBJ_X9_62_c2tnb359v1            OBJ_X9_62_c_TwoCurve,18L
-
-#define SN_X9_62_c2pnb368w1             "c2pnb368w1"
-#define NID_X9_62_c2pnb368w1            702
-#define OBJ_X9_62_c2pnb368w1            OBJ_X9_62_c_TwoCurve,19L
-
-#define SN_X9_62_c2tnb431r1             "c2tnb431r1"
-#define NID_X9_62_c2tnb431r1            703
-#define OBJ_X9_62_c2tnb431r1            OBJ_X9_62_c_TwoCurve,20L
-
-#define OBJ_X9_62_primeCurve            OBJ_X9_62_ellipticCurve,1L
-
-#define SN_X9_62_prime192v1             "prime192v1"
-#define NID_X9_62_prime192v1            409
-#define OBJ_X9_62_prime192v1            OBJ_X9_62_primeCurve,1L
-
-#define SN_X9_62_prime192v2             "prime192v2"
-#define NID_X9_62_prime192v2            410
-#define OBJ_X9_62_prime192v2            OBJ_X9_62_primeCurve,2L
-
-#define SN_X9_62_prime192v3             "prime192v3"
-#define NID_X9_62_prime192v3            411
-#define OBJ_X9_62_prime192v3            OBJ_X9_62_primeCurve,3L
-
-#define SN_X9_62_prime239v1             "prime239v1"
-#define NID_X9_62_prime239v1            412
-#define OBJ_X9_62_prime239v1            OBJ_X9_62_primeCurve,4L
-
-#define SN_X9_62_prime239v2             "prime239v2"
-#define NID_X9_62_prime239v2            413
-#define OBJ_X9_62_prime239v2            OBJ_X9_62_primeCurve,5L
-
-#define SN_X9_62_prime239v3             "prime239v3"
-#define NID_X9_62_prime239v3            414
-#define OBJ_X9_62_prime239v3            OBJ_X9_62_primeCurve,6L
-
-#define SN_X9_62_prime256v1             "prime256v1"
-#define NID_X9_62_prime256v1            415
-#define OBJ_X9_62_prime256v1            OBJ_X9_62_primeCurve,7L
-
-#define OBJ_X9_62_id_ecSigType          OBJ_ansi_X9_62,4L
-
-#define SN_ecdsa_with_SHA1              "ecdsa-with-SHA1"
-#define NID_ecdsa_with_SHA1             416
-#define OBJ_ecdsa_with_SHA1             OBJ_X9_62_id_ecSigType,1L
-
-#define SN_ecdsa_with_Recommended               "ecdsa-with-Recommended"
-#define NID_ecdsa_with_Recommended              791
-#define OBJ_ecdsa_with_Recommended              OBJ_X9_62_id_ecSigType,2L
-
-#define SN_ecdsa_with_Specified         "ecdsa-with-Specified"
-#define NID_ecdsa_with_Specified                792
-#define OBJ_ecdsa_with_Specified                OBJ_X9_62_id_ecSigType,3L
-
-#define SN_ecdsa_with_SHA224            "ecdsa-with-SHA224"
-#define NID_ecdsa_with_SHA224           793
-#define OBJ_ecdsa_with_SHA224           OBJ_ecdsa_with_Specified,1L
-
-#define SN_ecdsa_with_SHA256            "ecdsa-with-SHA256"
-#define NID_ecdsa_with_SHA256           794
-#define OBJ_ecdsa_with_SHA256           OBJ_ecdsa_with_Specified,2L
-
-#define SN_ecdsa_with_SHA384            "ecdsa-with-SHA384"
-#define NID_ecdsa_with_SHA384           795
-#define OBJ_ecdsa_with_SHA384           OBJ_ecdsa_with_Specified,3L
-
-#define SN_ecdsa_with_SHA512            "ecdsa-with-SHA512"
-#define NID_ecdsa_with_SHA512           796
-#define OBJ_ecdsa_with_SHA512           OBJ_ecdsa_with_Specified,4L
-
-#define OBJ_secg_ellipticCurve          OBJ_certicom_arc,0L
-
-#define SN_secp112r1            "secp112r1"
-#define NID_secp112r1           704
-#define OBJ_secp112r1           OBJ_secg_ellipticCurve,6L
-
-#define SN_secp112r2            "secp112r2"
-#define NID_secp112r2           705
-#define OBJ_secp112r2           OBJ_secg_ellipticCurve,7L
-
-#define SN_secp128r1            "secp128r1"
-#define NID_secp128r1           706
-#define OBJ_secp128r1           OBJ_secg_ellipticCurve,28L
-
-#define SN_secp128r2            "secp128r2"
-#define NID_secp128r2           707
-#define OBJ_secp128r2           OBJ_secg_ellipticCurve,29L
-
-#define SN_secp160k1            "secp160k1"
-#define NID_secp160k1           708
-#define OBJ_secp160k1           OBJ_secg_ellipticCurve,9L
-
-#define SN_secp160r1            "secp160r1"
-#define NID_secp160r1           709
-#define OBJ_secp160r1           OBJ_secg_ellipticCurve,8L
-
-#define SN_secp160r2            "secp160r2"
-#define NID_secp160r2           710
-#define OBJ_secp160r2           OBJ_secg_ellipticCurve,30L
-
-#define SN_secp192k1            "secp192k1"
-#define NID_secp192k1           711
-#define OBJ_secp192k1           OBJ_secg_ellipticCurve,31L
-
-#define SN_secp224k1            "secp224k1"
-#define NID_secp224k1           712
-#define OBJ_secp224k1           OBJ_secg_ellipticCurve,32L
-
-#define SN_secp224r1            "secp224r1"
-#define NID_secp224r1           713
-#define OBJ_secp224r1           OBJ_secg_ellipticCurve,33L
-
-#define SN_secp256k1            "secp256k1"
-#define NID_secp256k1           714
-#define OBJ_secp256k1           OBJ_secg_ellipticCurve,10L
-
-#define SN_secp384r1            "secp384r1"
-#define NID_secp384r1           715
-#define OBJ_secp384r1           OBJ_secg_ellipticCurve,34L
-
-#define SN_secp521r1            "secp521r1"
-#define NID_secp521r1           716
-#define OBJ_secp521r1           OBJ_secg_ellipticCurve,35L
-
-#define SN_sect113r1            "sect113r1"
-#define NID_sect113r1           717
-#define OBJ_sect113r1           OBJ_secg_ellipticCurve,4L
-
-#define SN_sect113r2            "sect113r2"
-#define NID_sect113r2           718
-#define OBJ_sect113r2           OBJ_secg_ellipticCurve,5L
-
-#define SN_sect131r1            "sect131r1"
-#define NID_sect131r1           719
-#define OBJ_sect131r1           OBJ_secg_ellipticCurve,22L
-
-#define SN_sect131r2            "sect131r2"
-#define NID_sect131r2           720
-#define OBJ_sect131r2           OBJ_secg_ellipticCurve,23L
-
-#define SN_sect163k1            "sect163k1"
-#define NID_sect163k1           721
-#define OBJ_sect163k1           OBJ_secg_ellipticCurve,1L
-
-#define SN_sect163r1            "sect163r1"
-#define NID_sect163r1           722
-#define OBJ_sect163r1           OBJ_secg_ellipticCurve,2L
-
-#define SN_sect163r2            "sect163r2"
-#define NID_sect163r2           723
-#define OBJ_sect163r2           OBJ_secg_ellipticCurve,15L
-
-#define SN_sect193r1            "sect193r1"
-#define NID_sect193r1           724
-#define OBJ_sect193r1           OBJ_secg_ellipticCurve,24L
-
-#define SN_sect193r2            "sect193r2"
-#define NID_sect193r2           725
-#define OBJ_sect193r2           OBJ_secg_ellipticCurve,25L
-
-#define SN_sect233k1            "sect233k1"
-#define NID_sect233k1           726
-#define OBJ_sect233k1           OBJ_secg_ellipticCurve,26L
-
-#define SN_sect233r1            "sect233r1"
-#define NID_sect233r1           727
-#define OBJ_sect233r1           OBJ_secg_ellipticCurve,27L
-
-#define SN_sect239k1            "sect239k1"
-#define NID_sect239k1           728
-#define OBJ_sect239k1           OBJ_secg_ellipticCurve,3L
-
-#define SN_sect283k1            "sect283k1"
-#define NID_sect283k1           729
-#define OBJ_sect283k1           OBJ_secg_ellipticCurve,16L
-
-#define SN_sect283r1            "sect283r1"
-#define NID_sect283r1           730
-#define OBJ_sect283r1           OBJ_secg_ellipticCurve,17L
-
-#define SN_sect409k1            "sect409k1"
-#define NID_sect409k1           731
-#define OBJ_sect409k1           OBJ_secg_ellipticCurve,36L
-
-#define SN_sect409r1            "sect409r1"
-#define NID_sect409r1           732
-#define OBJ_sect409r1           OBJ_secg_ellipticCurve,37L
-
-#define SN_sect571k1            "sect571k1"
-#define NID_sect571k1           733
-#define OBJ_sect571k1           OBJ_secg_ellipticCurve,38L
-
-#define SN_sect571r1            "sect571r1"
-#define NID_sect571r1           734
-#define OBJ_sect571r1           OBJ_secg_ellipticCurve,39L
-
-#define OBJ_wap_wsg_idm_ecid            OBJ_wap_wsg,4L
-
-#define SN_wap_wsg_idm_ecid_wtls1               "wap-wsg-idm-ecid-wtls1"
-#define NID_wap_wsg_idm_ecid_wtls1              735
-#define OBJ_wap_wsg_idm_ecid_wtls1              OBJ_wap_wsg_idm_ecid,1L
-
-#define SN_wap_wsg_idm_ecid_wtls3               "wap-wsg-idm-ecid-wtls3"
-#define NID_wap_wsg_idm_ecid_wtls3              736
-#define OBJ_wap_wsg_idm_ecid_wtls3              OBJ_wap_wsg_idm_ecid,3L
-
-#define SN_wap_wsg_idm_ecid_wtls4               "wap-wsg-idm-ecid-wtls4"
-#define NID_wap_wsg_idm_ecid_wtls4              737
-#define OBJ_wap_wsg_idm_ecid_wtls4              OBJ_wap_wsg_idm_ecid,4L
-
-#define SN_wap_wsg_idm_ecid_wtls5               "wap-wsg-idm-ecid-wtls5"
-#define NID_wap_wsg_idm_ecid_wtls5              738
-#define OBJ_wap_wsg_idm_ecid_wtls5              OBJ_wap_wsg_idm_ecid,5L
-
-#define SN_wap_wsg_idm_ecid_wtls6               "wap-wsg-idm-ecid-wtls6"
-#define NID_wap_wsg_idm_ecid_wtls6              739
-#define OBJ_wap_wsg_idm_ecid_wtls6              OBJ_wap_wsg_idm_ecid,6L
-
-#define SN_wap_wsg_idm_ecid_wtls7               "wap-wsg-idm-ecid-wtls7"
-#define NID_wap_wsg_idm_ecid_wtls7              740
-#define OBJ_wap_wsg_idm_ecid_wtls7              OBJ_wap_wsg_idm_ecid,7L
-
-#define SN_wap_wsg_idm_ecid_wtls8               "wap-wsg-idm-ecid-wtls8"
-#define NID_wap_wsg_idm_ecid_wtls8              741
-#define OBJ_wap_wsg_idm_ecid_wtls8              OBJ_wap_wsg_idm_ecid,8L
-
-#define SN_wap_wsg_idm_ecid_wtls9               "wap-wsg-idm-ecid-wtls9"
-#define NID_wap_wsg_idm_ecid_wtls9              742
-#define OBJ_wap_wsg_idm_ecid_wtls9              OBJ_wap_wsg_idm_ecid,9L
-
-#define SN_wap_wsg_idm_ecid_wtls10              "wap-wsg-idm-ecid-wtls10"
-#define NID_wap_wsg_idm_ecid_wtls10             743
-#define OBJ_wap_wsg_idm_ecid_wtls10             OBJ_wap_wsg_idm_ecid,10L
-
-#define SN_wap_wsg_idm_ecid_wtls11              "wap-wsg-idm-ecid-wtls11"
-#define NID_wap_wsg_idm_ecid_wtls11             744
-#define OBJ_wap_wsg_idm_ecid_wtls11             OBJ_wap_wsg_idm_ecid,11L
-
-#define SN_wap_wsg_idm_ecid_wtls12              "wap-wsg-idm-ecid-wtls12"
-#define NID_wap_wsg_idm_ecid_wtls12             745
-#define OBJ_wap_wsg_idm_ecid_wtls12             OBJ_wap_wsg_idm_ecid,12L
-
-#define SN_cast5_cbc            "CAST5-CBC"
-#define LN_cast5_cbc            "cast5-cbc"
-#define NID_cast5_cbc           108
-#define OBJ_cast5_cbc           OBJ_ISO_US,113533L,7L,66L,10L
-
-#define SN_cast5_ecb            "CAST5-ECB"
-#define LN_cast5_ecb            "cast5-ecb"
-#define NID_cast5_ecb           109
-
-#define SN_cast5_cfb64          "CAST5-CFB"
-#define LN_cast5_cfb64          "cast5-cfb"
-#define NID_cast5_cfb64         110
-
-#define SN_cast5_ofb64          "CAST5-OFB"
-#define LN_cast5_ofb64          "cast5-ofb"
-#define NID_cast5_ofb64         111
-
-#define LN_pbeWithMD5AndCast5_CBC               "pbeWithMD5AndCast5CBC"
-#define NID_pbeWithMD5AndCast5_CBC              112
-#define OBJ_pbeWithMD5AndCast5_CBC              OBJ_ISO_US,113533L,7L,66L,12L
-
-#define SN_id_PasswordBasedMAC          "id-PasswordBasedMAC"
-#define LN_id_PasswordBasedMAC          "password based MAC"
-#define NID_id_PasswordBasedMAC         782
-#define OBJ_id_PasswordBasedMAC         OBJ_ISO_US,113533L,7L,66L,13L
-
-#define SN_id_DHBasedMac                "id-DHBasedMac"
-#define LN_id_DHBasedMac                "Diffie-Hellman based MAC"
-#define NID_id_DHBasedMac               783
-#define OBJ_id_DHBasedMac               OBJ_ISO_US,113533L,7L,66L,30L
-
-#define SN_rsadsi               "rsadsi"
-#define LN_rsadsi               "RSA Data Security, Inc."
-#define NID_rsadsi              1
-#define OBJ_rsadsi              OBJ_ISO_US,113549L
-
-#define SN_pkcs         "pkcs"
-#define LN_pkcs         "RSA Data Security, Inc. PKCS"
-#define NID_pkcs                2
-#define OBJ_pkcs                OBJ_rsadsi,1L
-
-#define SN_pkcs1                "pkcs1"
-#define NID_pkcs1               186
-#define OBJ_pkcs1               OBJ_pkcs,1L
-
-#define LN_rsaEncryption                "rsaEncryption"
-#define NID_rsaEncryption               6
-#define OBJ_rsaEncryption               OBJ_pkcs1,1L
-
-#define SN_md2WithRSAEncryption         "RSA-MD2"
-#define LN_md2WithRSAEncryption         "md2WithRSAEncryption"
-#define NID_md2WithRSAEncryption                7
-#define OBJ_md2WithRSAEncryption                OBJ_pkcs1,2L
-
-#define SN_md4WithRSAEncryption         "RSA-MD4"
-#define LN_md4WithRSAEncryption         "md4WithRSAEncryption"
-#define NID_md4WithRSAEncryption                396
-#define OBJ_md4WithRSAEncryption                OBJ_pkcs1,3L
-
-#define SN_md5WithRSAEncryption         "RSA-MD5"
-#define LN_md5WithRSAEncryption         "md5WithRSAEncryption"
-#define NID_md5WithRSAEncryption                8
-#define OBJ_md5WithRSAEncryption                OBJ_pkcs1,4L
-
-#define SN_sha1WithRSAEncryption                "RSA-SHA1"
-#define LN_sha1WithRSAEncryption                "sha1WithRSAEncryption"
-#define NID_sha1WithRSAEncryption               65
-#define OBJ_sha1WithRSAEncryption               OBJ_pkcs1,5L
-
-#define SN_rsaesOaep            "RSAES-OAEP"
-#define LN_rsaesOaep            "rsaesOaep"
-#define NID_rsaesOaep           919
-#define OBJ_rsaesOaep           OBJ_pkcs1,7L
-
-#define SN_mgf1         "MGF1"
-#define LN_mgf1         "mgf1"
-#define NID_mgf1                911
-#define OBJ_mgf1                OBJ_pkcs1,8L
-
-#define SN_pSpecified           "PSPECIFIED"
-#define LN_pSpecified           "pSpecified"
-#define NID_pSpecified          935
-#define OBJ_pSpecified          OBJ_pkcs1,9L
-
-#define SN_rsassaPss            "RSASSA-PSS"
-#define LN_rsassaPss            "rsassaPss"
-#define NID_rsassaPss           912
-#define OBJ_rsassaPss           OBJ_pkcs1,10L
-
-#define SN_sha256WithRSAEncryption              "RSA-SHA256"
-#define LN_sha256WithRSAEncryption              "sha256WithRSAEncryption"
-#define NID_sha256WithRSAEncryption             668
-#define OBJ_sha256WithRSAEncryption             OBJ_pkcs1,11L
-
-#define SN_sha384WithRSAEncryption              "RSA-SHA384"
-#define LN_sha384WithRSAEncryption              "sha384WithRSAEncryption"
-#define NID_sha384WithRSAEncryption             669
-#define OBJ_sha384WithRSAEncryption             OBJ_pkcs1,12L
-
-#define SN_sha512WithRSAEncryption              "RSA-SHA512"
-#define LN_sha512WithRSAEncryption              "sha512WithRSAEncryption"
-#define NID_sha512WithRSAEncryption             670
-#define OBJ_sha512WithRSAEncryption             OBJ_pkcs1,13L
-
-#define SN_sha224WithRSAEncryption              "RSA-SHA224"
-#define LN_sha224WithRSAEncryption              "sha224WithRSAEncryption"
-#define NID_sha224WithRSAEncryption             671
-#define OBJ_sha224WithRSAEncryption             OBJ_pkcs1,14L
-
-#define SN_sha512_224WithRSAEncryption          "RSA-SHA512/224"
-#define LN_sha512_224WithRSAEncryption          "sha512-224WithRSAEncryption"
-#define NID_sha512_224WithRSAEncryption         1145
-#define OBJ_sha512_224WithRSAEncryption         OBJ_pkcs1,15L
-
-#define SN_sha512_256WithRSAEncryption          "RSA-SHA512/256"
-#define LN_sha512_256WithRSAEncryption          "sha512-256WithRSAEncryption"
-#define NID_sha512_256WithRSAEncryption         1146
-#define OBJ_sha512_256WithRSAEncryption         OBJ_pkcs1,16L
-
-#define SN_pkcs3                "pkcs3"
-#define NID_pkcs3               27
-#define OBJ_pkcs3               OBJ_pkcs,3L
-
-#define LN_dhKeyAgreement               "dhKeyAgreement"
-#define NID_dhKeyAgreement              28
-#define OBJ_dhKeyAgreement              OBJ_pkcs3,1L
-
-#define SN_pkcs5                "pkcs5"
-#define NID_pkcs5               187
-#define OBJ_pkcs5               OBJ_pkcs,5L
-
-#define SN_pbeWithMD2AndDES_CBC         "PBE-MD2-DES"
-#define LN_pbeWithMD2AndDES_CBC         "pbeWithMD2AndDES-CBC"
-#define NID_pbeWithMD2AndDES_CBC                9
-#define OBJ_pbeWithMD2AndDES_CBC                OBJ_pkcs5,1L
-
-#define SN_pbeWithMD5AndDES_CBC         "PBE-MD5-DES"
-#define LN_pbeWithMD5AndDES_CBC         "pbeWithMD5AndDES-CBC"
-#define NID_pbeWithMD5AndDES_CBC                10
-#define OBJ_pbeWithMD5AndDES_CBC                OBJ_pkcs5,3L
-
-#define SN_pbeWithMD2AndRC2_CBC         "PBE-MD2-RC2-64"
-#define LN_pbeWithMD2AndRC2_CBC         "pbeWithMD2AndRC2-CBC"
-#define NID_pbeWithMD2AndRC2_CBC                168
-#define OBJ_pbeWithMD2AndRC2_CBC                OBJ_pkcs5,4L
-
-#define SN_pbeWithMD5AndRC2_CBC         "PBE-MD5-RC2-64"
-#define LN_pbeWithMD5AndRC2_CBC         "pbeWithMD5AndRC2-CBC"
-#define NID_pbeWithMD5AndRC2_CBC                169
-#define OBJ_pbeWithMD5AndRC2_CBC                OBJ_pkcs5,6L
-
-#define SN_pbeWithSHA1AndDES_CBC                "PBE-SHA1-DES"
-#define LN_pbeWithSHA1AndDES_CBC                "pbeWithSHA1AndDES-CBC"
-#define NID_pbeWithSHA1AndDES_CBC               170
-#define OBJ_pbeWithSHA1AndDES_CBC               OBJ_pkcs5,10L
-
-#define SN_pbeWithSHA1AndRC2_CBC                "PBE-SHA1-RC2-64"
-#define LN_pbeWithSHA1AndRC2_CBC                "pbeWithSHA1AndRC2-CBC"
-#define NID_pbeWithSHA1AndRC2_CBC               68
-#define OBJ_pbeWithSHA1AndRC2_CBC               OBJ_pkcs5,11L
-
-#define LN_id_pbkdf2            "PBKDF2"
-#define NID_id_pbkdf2           69
-#define OBJ_id_pbkdf2           OBJ_pkcs5,12L
-
-#define LN_pbes2                "PBES2"
-#define NID_pbes2               161
-#define OBJ_pbes2               OBJ_pkcs5,13L
-
-#define LN_pbmac1               "PBMAC1"
-#define NID_pbmac1              162
-#define OBJ_pbmac1              OBJ_pkcs5,14L
-
-#define SN_pkcs7                "pkcs7"
-#define NID_pkcs7               20
-#define OBJ_pkcs7               OBJ_pkcs,7L
-
-#define LN_pkcs7_data           "pkcs7-data"
-#define NID_pkcs7_data          21
-#define OBJ_pkcs7_data          OBJ_pkcs7,1L
-
-#define LN_pkcs7_signed         "pkcs7-signedData"
-#define NID_pkcs7_signed                22
-#define OBJ_pkcs7_signed                OBJ_pkcs7,2L
-
-#define LN_pkcs7_enveloped              "pkcs7-envelopedData"
-#define NID_pkcs7_enveloped             23
-#define OBJ_pkcs7_enveloped             OBJ_pkcs7,3L
-
-#define LN_pkcs7_signedAndEnveloped             "pkcs7-signedAndEnvelopedData"
-#define NID_pkcs7_signedAndEnveloped            24
-#define OBJ_pkcs7_signedAndEnveloped            OBJ_pkcs7,4L
-
-#define LN_pkcs7_digest         "pkcs7-digestData"
-#define NID_pkcs7_digest                25
-#define OBJ_pkcs7_digest                OBJ_pkcs7,5L
-
-#define LN_pkcs7_encrypted              "pkcs7-encryptedData"
-#define NID_pkcs7_encrypted             26
-#define OBJ_pkcs7_encrypted             OBJ_pkcs7,6L
-
-#define SN_pkcs9                "pkcs9"
-#define NID_pkcs9               47
-#define OBJ_pkcs9               OBJ_pkcs,9L
-
-#define LN_pkcs9_emailAddress           "emailAddress"
-#define NID_pkcs9_emailAddress          48
-#define OBJ_pkcs9_emailAddress          OBJ_pkcs9,1L
-
-#define LN_pkcs9_unstructuredName               "unstructuredName"
-#define NID_pkcs9_unstructuredName              49
-#define OBJ_pkcs9_unstructuredName              OBJ_pkcs9,2L
-
-#define LN_pkcs9_contentType            "contentType"
-#define NID_pkcs9_contentType           50
-#define OBJ_pkcs9_contentType           OBJ_pkcs9,3L
-
-#define LN_pkcs9_messageDigest          "messageDigest"
-#define NID_pkcs9_messageDigest         51
-#define OBJ_pkcs9_messageDigest         OBJ_pkcs9,4L
-
-#define LN_pkcs9_signingTime            "signingTime"
-#define NID_pkcs9_signingTime           52
-#define OBJ_pkcs9_signingTime           OBJ_pkcs9,5L
-
-#define LN_pkcs9_countersignature               "countersignature"
-#define NID_pkcs9_countersignature              53
-#define OBJ_pkcs9_countersignature              OBJ_pkcs9,6L
-
-#define LN_pkcs9_challengePassword              "challengePassword"
-#define NID_pkcs9_challengePassword             54
-#define OBJ_pkcs9_challengePassword             OBJ_pkcs9,7L
-
-#define LN_pkcs9_unstructuredAddress            "unstructuredAddress"
-#define NID_pkcs9_unstructuredAddress           55
-#define OBJ_pkcs9_unstructuredAddress           OBJ_pkcs9,8L
-
-#define LN_pkcs9_extCertAttributes              "extendedCertificateAttributes"
-#define NID_pkcs9_extCertAttributes             56
-#define OBJ_pkcs9_extCertAttributes             OBJ_pkcs9,9L
-
-#define SN_ext_req              "extReq"
-#define LN_ext_req              "Extension Request"
-#define NID_ext_req             172
-#define OBJ_ext_req             OBJ_pkcs9,14L
-
-#define SN_SMIMECapabilities            "SMIME-CAPS"
-#define LN_SMIMECapabilities            "S/MIME Capabilities"
-#define NID_SMIMECapabilities           167
-#define OBJ_SMIMECapabilities           OBJ_pkcs9,15L
-
-#define SN_SMIME                "SMIME"
-#define LN_SMIME                "S/MIME"
-#define NID_SMIME               188
-#define OBJ_SMIME               OBJ_pkcs9,16L
-
-#define SN_id_smime_mod         "id-smime-mod"
-#define NID_id_smime_mod                189
-#define OBJ_id_smime_mod                OBJ_SMIME,0L
-
-#define SN_id_smime_ct          "id-smime-ct"
-#define NID_id_smime_ct         190
-#define OBJ_id_smime_ct         OBJ_SMIME,1L
-
-#define SN_id_smime_aa          "id-smime-aa"
-#define NID_id_smime_aa         191
-#define OBJ_id_smime_aa         OBJ_SMIME,2L
-
-#define SN_id_smime_alg         "id-smime-alg"
-#define NID_id_smime_alg                192
-#define OBJ_id_smime_alg                OBJ_SMIME,3L
-
-#define SN_id_smime_cd          "id-smime-cd"
-#define NID_id_smime_cd         193
-#define OBJ_id_smime_cd         OBJ_SMIME,4L
-
-#define SN_id_smime_spq         "id-smime-spq"
-#define NID_id_smime_spq                194
-#define OBJ_id_smime_spq                OBJ_SMIME,5L
-
-#define SN_id_smime_cti         "id-smime-cti"
-#define NID_id_smime_cti                195
-#define OBJ_id_smime_cti                OBJ_SMIME,6L
-
-#define SN_id_smime_mod_cms             "id-smime-mod-cms"
-#define NID_id_smime_mod_cms            196
-#define OBJ_id_smime_mod_cms            OBJ_id_smime_mod,1L
-
-#define SN_id_smime_mod_ess             "id-smime-mod-ess"
-#define NID_id_smime_mod_ess            197
-#define OBJ_id_smime_mod_ess            OBJ_id_smime_mod,2L
-
-#define SN_id_smime_mod_oid             "id-smime-mod-oid"
-#define NID_id_smime_mod_oid            198
-#define OBJ_id_smime_mod_oid            OBJ_id_smime_mod,3L
-
-#define SN_id_smime_mod_msg_v3          "id-smime-mod-msg-v3"
-#define NID_id_smime_mod_msg_v3         199
-#define OBJ_id_smime_mod_msg_v3         OBJ_id_smime_mod,4L
-
-#define SN_id_smime_mod_ets_eSignature_88               "id-smime-mod-ets-eSignature-88"
-#define NID_id_smime_mod_ets_eSignature_88              200
-#define OBJ_id_smime_mod_ets_eSignature_88              OBJ_id_smime_mod,5L
-
-#define SN_id_smime_mod_ets_eSignature_97               "id-smime-mod-ets-eSignature-97"
-#define NID_id_smime_mod_ets_eSignature_97              201
-#define OBJ_id_smime_mod_ets_eSignature_97              OBJ_id_smime_mod,6L
-
-#define SN_id_smime_mod_ets_eSigPolicy_88               "id-smime-mod-ets-eSigPolicy-88"
-#define NID_id_smime_mod_ets_eSigPolicy_88              202
-#define OBJ_id_smime_mod_ets_eSigPolicy_88              OBJ_id_smime_mod,7L
-
-#define SN_id_smime_mod_ets_eSigPolicy_97               "id-smime-mod-ets-eSigPolicy-97"
-#define NID_id_smime_mod_ets_eSigPolicy_97              203
-#define OBJ_id_smime_mod_ets_eSigPolicy_97              OBJ_id_smime_mod,8L
-
-#define SN_id_smime_ct_receipt          "id-smime-ct-receipt"
-#define NID_id_smime_ct_receipt         204
-#define OBJ_id_smime_ct_receipt         OBJ_id_smime_ct,1L
-
-#define SN_id_smime_ct_authData         "id-smime-ct-authData"
-#define NID_id_smime_ct_authData                205
-#define OBJ_id_smime_ct_authData                OBJ_id_smime_ct,2L
-
-#define SN_id_smime_ct_publishCert              "id-smime-ct-publishCert"
-#define NID_id_smime_ct_publishCert             206
-#define OBJ_id_smime_ct_publishCert             OBJ_id_smime_ct,3L
-
-#define SN_id_smime_ct_TSTInfo          "id-smime-ct-TSTInfo"
-#define NID_id_smime_ct_TSTInfo         207
-#define OBJ_id_smime_ct_TSTInfo         OBJ_id_smime_ct,4L
-
-#define SN_id_smime_ct_TDTInfo          "id-smime-ct-TDTInfo"
-#define NID_id_smime_ct_TDTInfo         208
-#define OBJ_id_smime_ct_TDTInfo         OBJ_id_smime_ct,5L
-
-#define SN_id_smime_ct_contentInfo              "id-smime-ct-contentInfo"
-#define NID_id_smime_ct_contentInfo             209
-#define OBJ_id_smime_ct_contentInfo             OBJ_id_smime_ct,6L
-
-#define SN_id_smime_ct_DVCSRequestData          "id-smime-ct-DVCSRequestData"
-#define NID_id_smime_ct_DVCSRequestData         210
-#define OBJ_id_smime_ct_DVCSRequestData         OBJ_id_smime_ct,7L
-
-#define SN_id_smime_ct_DVCSResponseData         "id-smime-ct-DVCSResponseData"
-#define NID_id_smime_ct_DVCSResponseData                211
-#define OBJ_id_smime_ct_DVCSResponseData                OBJ_id_smime_ct,8L
-
-#define SN_id_smime_ct_compressedData           "id-smime-ct-compressedData"
-#define NID_id_smime_ct_compressedData          786
-#define OBJ_id_smime_ct_compressedData          OBJ_id_smime_ct,9L
-
-#define SN_id_smime_ct_contentCollection                "id-smime-ct-contentCollection"
-#define NID_id_smime_ct_contentCollection               1058
-#define OBJ_id_smime_ct_contentCollection               OBJ_id_smime_ct,19L
-
-#define SN_id_smime_ct_authEnvelopedData                "id-smime-ct-authEnvelopedData"
-#define NID_id_smime_ct_authEnvelopedData               1059
-#define OBJ_id_smime_ct_authEnvelopedData               OBJ_id_smime_ct,23L
-
-#define SN_id_ct_routeOriginAuthz               "id-ct-routeOriginAuthz"
-#define NID_id_ct_routeOriginAuthz              1234
-#define OBJ_id_ct_routeOriginAuthz              OBJ_id_smime_ct,24L
-
-#define SN_id_ct_rpkiManifest           "id-ct-rpkiManifest"
-#define NID_id_ct_rpkiManifest          1235
-#define OBJ_id_ct_rpkiManifest          OBJ_id_smime_ct,26L
-
-#define SN_id_ct_asciiTextWithCRLF              "id-ct-asciiTextWithCRLF"
-#define NID_id_ct_asciiTextWithCRLF             787
-#define OBJ_id_ct_asciiTextWithCRLF             OBJ_id_smime_ct,27L
-
-#define SN_id_ct_xml            "id-ct-xml"
-#define NID_id_ct_xml           1060
-#define OBJ_id_ct_xml           OBJ_id_smime_ct,28L
-
-#define SN_id_ct_rpkiGhostbusters               "id-ct-rpkiGhostbusters"
-#define NID_id_ct_rpkiGhostbusters              1236
-#define OBJ_id_ct_rpkiGhostbusters              OBJ_id_smime_ct,35L
-
-#define SN_id_ct_resourceTaggedAttest           "id-ct-resourceTaggedAttest"
-#define NID_id_ct_resourceTaggedAttest          1237
-#define OBJ_id_ct_resourceTaggedAttest          OBJ_id_smime_ct,36L
-
-#define SN_id_ct_geofeedCSVwithCRLF             "id-ct-geofeedCSVwithCRLF"
-#define NID_id_ct_geofeedCSVwithCRLF            1246
-#define OBJ_id_ct_geofeedCSVwithCRLF            OBJ_id_smime_ct,47L
-
-#define SN_id_ct_signedChecklist                "id-ct-signedChecklist"
-#define NID_id_ct_signedChecklist               1247
-#define OBJ_id_ct_signedChecklist               OBJ_id_smime_ct,48L
-
-#define SN_id_ct_ASPA           "id-ct-ASPA"
-#define NID_id_ct_ASPA          1250
-#define OBJ_id_ct_ASPA          OBJ_id_smime_ct,49L
-
-#define SN_id_ct_signedTAL              "id-ct-signedTAL"
-#define NID_id_ct_signedTAL             1284
-#define OBJ_id_ct_signedTAL             OBJ_id_smime_ct,50L
-
-#define SN_id_ct_rpkiSignedPrefixList           "id-ct-rpkiSignedPrefixList"
-#define NID_id_ct_rpkiSignedPrefixList          1320
-#define OBJ_id_ct_rpkiSignedPrefixList          OBJ_id_smime_ct,51L
-
-#define SN_id_smime_aa_receiptRequest           "id-smime-aa-receiptRequest"
-#define NID_id_smime_aa_receiptRequest          212
-#define OBJ_id_smime_aa_receiptRequest          OBJ_id_smime_aa,1L
-
-#define SN_id_smime_aa_securityLabel            "id-smime-aa-securityLabel"
-#define NID_id_smime_aa_securityLabel           213
-#define OBJ_id_smime_aa_securityLabel           OBJ_id_smime_aa,2L
-
-#define SN_id_smime_aa_mlExpandHistory          "id-smime-aa-mlExpandHistory"
-#define NID_id_smime_aa_mlExpandHistory         214
-#define OBJ_id_smime_aa_mlExpandHistory         OBJ_id_smime_aa,3L
-
-#define SN_id_smime_aa_contentHint              "id-smime-aa-contentHint"
-#define NID_id_smime_aa_contentHint             215
-#define OBJ_id_smime_aa_contentHint             OBJ_id_smime_aa,4L
-
-#define SN_id_smime_aa_msgSigDigest             "id-smime-aa-msgSigDigest"
-#define NID_id_smime_aa_msgSigDigest            216
-#define OBJ_id_smime_aa_msgSigDigest            OBJ_id_smime_aa,5L
-
-#define SN_id_smime_aa_encapContentType         "id-smime-aa-encapContentType"
-#define NID_id_smime_aa_encapContentType                217
-#define OBJ_id_smime_aa_encapContentType                OBJ_id_smime_aa,6L
-
-#define SN_id_smime_aa_contentIdentifier                "id-smime-aa-contentIdentifier"
-#define NID_id_smime_aa_contentIdentifier               218
-#define OBJ_id_smime_aa_contentIdentifier               OBJ_id_smime_aa,7L
-
-#define SN_id_smime_aa_macValue         "id-smime-aa-macValue"
-#define NID_id_smime_aa_macValue                219
-#define OBJ_id_smime_aa_macValue                OBJ_id_smime_aa,8L
-
-#define SN_id_smime_aa_equivalentLabels         "id-smime-aa-equivalentLabels"
-#define NID_id_smime_aa_equivalentLabels                220
-#define OBJ_id_smime_aa_equivalentLabels                OBJ_id_smime_aa,9L
-
-#define SN_id_smime_aa_contentReference         "id-smime-aa-contentReference"
-#define NID_id_smime_aa_contentReference                221
-#define OBJ_id_smime_aa_contentReference                OBJ_id_smime_aa,10L
-
-#define SN_id_smime_aa_encrypKeyPref            "id-smime-aa-encrypKeyPref"
-#define NID_id_smime_aa_encrypKeyPref           222
-#define OBJ_id_smime_aa_encrypKeyPref           OBJ_id_smime_aa,11L
-
-#define SN_id_smime_aa_signingCertificate               "id-smime-aa-signingCertificate"
-#define NID_id_smime_aa_signingCertificate              223
-#define OBJ_id_smime_aa_signingCertificate              OBJ_id_smime_aa,12L
-
-#define SN_id_smime_aa_smimeEncryptCerts                "id-smime-aa-smimeEncryptCerts"
-#define NID_id_smime_aa_smimeEncryptCerts               224
-#define OBJ_id_smime_aa_smimeEncryptCerts               OBJ_id_smime_aa,13L
-
-#define SN_id_smime_aa_timeStampToken           "id-smime-aa-timeStampToken"
-#define NID_id_smime_aa_timeStampToken          225
-#define OBJ_id_smime_aa_timeStampToken          OBJ_id_smime_aa,14L
-
-#define SN_id_smime_aa_ets_sigPolicyId          "id-smime-aa-ets-sigPolicyId"
-#define NID_id_smime_aa_ets_sigPolicyId         226
-#define OBJ_id_smime_aa_ets_sigPolicyId         OBJ_id_smime_aa,15L
-
-#define SN_id_smime_aa_ets_commitmentType               "id-smime-aa-ets-commitmentType"
-#define NID_id_smime_aa_ets_commitmentType              227
-#define OBJ_id_smime_aa_ets_commitmentType              OBJ_id_smime_aa,16L
-
-#define SN_id_smime_aa_ets_signerLocation               "id-smime-aa-ets-signerLocation"
-#define NID_id_smime_aa_ets_signerLocation              228
-#define OBJ_id_smime_aa_ets_signerLocation              OBJ_id_smime_aa,17L
-
-#define SN_id_smime_aa_ets_signerAttr           "id-smime-aa-ets-signerAttr"
-#define NID_id_smime_aa_ets_signerAttr          229
-#define OBJ_id_smime_aa_ets_signerAttr          OBJ_id_smime_aa,18L
-
-#define SN_id_smime_aa_ets_otherSigCert         "id-smime-aa-ets-otherSigCert"
-#define NID_id_smime_aa_ets_otherSigCert                230
-#define OBJ_id_smime_aa_ets_otherSigCert                OBJ_id_smime_aa,19L
-
-#define SN_id_smime_aa_ets_contentTimestamp             "id-smime-aa-ets-contentTimestamp"
-#define NID_id_smime_aa_ets_contentTimestamp            231
-#define OBJ_id_smime_aa_ets_contentTimestamp            OBJ_id_smime_aa,20L
-
-#define SN_id_smime_aa_ets_CertificateRefs              "id-smime-aa-ets-CertificateRefs"
-#define NID_id_smime_aa_ets_CertificateRefs             232
-#define OBJ_id_smime_aa_ets_CertificateRefs             OBJ_id_smime_aa,21L
-
-#define SN_id_smime_aa_ets_RevocationRefs               "id-smime-aa-ets-RevocationRefs"
-#define NID_id_smime_aa_ets_RevocationRefs              233
-#define OBJ_id_smime_aa_ets_RevocationRefs              OBJ_id_smime_aa,22L
-
-#define SN_id_smime_aa_ets_certValues           "id-smime-aa-ets-certValues"
-#define NID_id_smime_aa_ets_certValues          234
-#define OBJ_id_smime_aa_ets_certValues          OBJ_id_smime_aa,23L
-
-#define SN_id_smime_aa_ets_revocationValues             "id-smime-aa-ets-revocationValues"
-#define NID_id_smime_aa_ets_revocationValues            235
-#define OBJ_id_smime_aa_ets_revocationValues            OBJ_id_smime_aa,24L
-
-#define SN_id_smime_aa_ets_escTimeStamp         "id-smime-aa-ets-escTimeStamp"
-#define NID_id_smime_aa_ets_escTimeStamp                236
-#define OBJ_id_smime_aa_ets_escTimeStamp                OBJ_id_smime_aa,25L
-
-#define SN_id_smime_aa_ets_certCRLTimestamp             "id-smime-aa-ets-certCRLTimestamp"
-#define NID_id_smime_aa_ets_certCRLTimestamp            237
-#define OBJ_id_smime_aa_ets_certCRLTimestamp            OBJ_id_smime_aa,26L
-
-#define SN_id_smime_aa_ets_archiveTimeStamp             "id-smime-aa-ets-archiveTimeStamp"
-#define NID_id_smime_aa_ets_archiveTimeStamp            238
-#define OBJ_id_smime_aa_ets_archiveTimeStamp            OBJ_id_smime_aa,27L
-
-#define SN_id_smime_aa_signatureType            "id-smime-aa-signatureType"
-#define NID_id_smime_aa_signatureType           239
-#define OBJ_id_smime_aa_signatureType           OBJ_id_smime_aa,28L
-
-#define SN_id_smime_aa_dvcs_dvc         "id-smime-aa-dvcs-dvc"
-#define NID_id_smime_aa_dvcs_dvc                240
-#define OBJ_id_smime_aa_dvcs_dvc                OBJ_id_smime_aa,29L
-
-#define SN_id_aa_ets_attrCertificateRefs                "id-aa-ets-attrCertificateRefs"
-#define NID_id_aa_ets_attrCertificateRefs               1261
-#define OBJ_id_aa_ets_attrCertificateRefs               OBJ_id_smime_aa,44L
-
-#define SN_id_aa_ets_attrRevocationRefs         "id-aa-ets-attrRevocationRefs"
-#define NID_id_aa_ets_attrRevocationRefs                1262
-#define OBJ_id_aa_ets_attrRevocationRefs                OBJ_id_smime_aa,45L
-
-#define SN_id_smime_aa_signingCertificateV2             "id-smime-aa-signingCertificateV2"
-#define NID_id_smime_aa_signingCertificateV2            1086
-#define OBJ_id_smime_aa_signingCertificateV2            OBJ_id_smime_aa,47L
-
-#define SN_id_aa_ets_archiveTimestampV2         "id-aa-ets-archiveTimestampV2"
-#define NID_id_aa_ets_archiveTimestampV2                1280
-#define OBJ_id_aa_ets_archiveTimestampV2                OBJ_id_smime_aa,48L
-
-#define SN_id_smime_alg_ESDHwith3DES            "id-smime-alg-ESDHwith3DES"
-#define NID_id_smime_alg_ESDHwith3DES           241
-#define OBJ_id_smime_alg_ESDHwith3DES           OBJ_id_smime_alg,1L
-
-#define SN_id_smime_alg_ESDHwithRC2             "id-smime-alg-ESDHwithRC2"
-#define NID_id_smime_alg_ESDHwithRC2            242
-#define OBJ_id_smime_alg_ESDHwithRC2            OBJ_id_smime_alg,2L
-
-#define SN_id_smime_alg_3DESwrap                "id-smime-alg-3DESwrap"
-#define NID_id_smime_alg_3DESwrap               243
-#define OBJ_id_smime_alg_3DESwrap               OBJ_id_smime_alg,3L
-
-#define SN_id_smime_alg_RC2wrap         "id-smime-alg-RC2wrap"
-#define NID_id_smime_alg_RC2wrap                244
-#define OBJ_id_smime_alg_RC2wrap                OBJ_id_smime_alg,4L
-
-#define SN_id_smime_alg_ESDH            "id-smime-alg-ESDH"
-#define NID_id_smime_alg_ESDH           245
-#define OBJ_id_smime_alg_ESDH           OBJ_id_smime_alg,5L
-
-#define SN_id_smime_alg_CMS3DESwrap             "id-smime-alg-CMS3DESwrap"
-#define NID_id_smime_alg_CMS3DESwrap            246
-#define OBJ_id_smime_alg_CMS3DESwrap            OBJ_id_smime_alg,6L
-
-#define SN_id_smime_alg_CMSRC2wrap              "id-smime-alg-CMSRC2wrap"
-#define NID_id_smime_alg_CMSRC2wrap             247
-#define OBJ_id_smime_alg_CMSRC2wrap             OBJ_id_smime_alg,7L
-
-#define SN_id_alg_PWRI_KEK              "id-alg-PWRI-KEK"
-#define NID_id_alg_PWRI_KEK             893
-#define OBJ_id_alg_PWRI_KEK             OBJ_id_smime_alg,9L
-
-#define SN_id_smime_cd_ldap             "id-smime-cd-ldap"
-#define NID_id_smime_cd_ldap            248
-#define OBJ_id_smime_cd_ldap            OBJ_id_smime_cd,1L
-
-#define SN_id_smime_spq_ets_sqt_uri             "id-smime-spq-ets-sqt-uri"
-#define NID_id_smime_spq_ets_sqt_uri            249
-#define OBJ_id_smime_spq_ets_sqt_uri            OBJ_id_smime_spq,1L
-
-#define SN_id_smime_spq_ets_sqt_unotice         "id-smime-spq-ets-sqt-unotice"
-#define NID_id_smime_spq_ets_sqt_unotice                250
-#define OBJ_id_smime_spq_ets_sqt_unotice                OBJ_id_smime_spq,2L
-
-#define SN_id_smime_cti_ets_proofOfOrigin               "id-smime-cti-ets-proofOfOrigin"
-#define NID_id_smime_cti_ets_proofOfOrigin              251
-#define OBJ_id_smime_cti_ets_proofOfOrigin              OBJ_id_smime_cti,1L
-
-#define SN_id_smime_cti_ets_proofOfReceipt              "id-smime-cti-ets-proofOfReceipt"
-#define NID_id_smime_cti_ets_proofOfReceipt             252
-#define OBJ_id_smime_cti_ets_proofOfReceipt             OBJ_id_smime_cti,2L
-
-#define SN_id_smime_cti_ets_proofOfDelivery             "id-smime-cti-ets-proofOfDelivery"
-#define NID_id_smime_cti_ets_proofOfDelivery            253
-#define OBJ_id_smime_cti_ets_proofOfDelivery            OBJ_id_smime_cti,3L
-
-#define SN_id_smime_cti_ets_proofOfSender               "id-smime-cti-ets-proofOfSender"
-#define NID_id_smime_cti_ets_proofOfSender              254
-#define OBJ_id_smime_cti_ets_proofOfSender              OBJ_id_smime_cti,4L
-
-#define SN_id_smime_cti_ets_proofOfApproval             "id-smime-cti-ets-proofOfApproval"
-#define NID_id_smime_cti_ets_proofOfApproval            255
-#define OBJ_id_smime_cti_ets_proofOfApproval            OBJ_id_smime_cti,5L
-
-#define SN_id_smime_cti_ets_proofOfCreation             "id-smime-cti-ets-proofOfCreation"
-#define NID_id_smime_cti_ets_proofOfCreation            256
-#define OBJ_id_smime_cti_ets_proofOfCreation            OBJ_id_smime_cti,6L
-
-#define LN_friendlyName         "friendlyName"
-#define NID_friendlyName                156
-#define OBJ_friendlyName                OBJ_pkcs9,20L
-
-#define LN_localKeyID           "localKeyID"
-#define NID_localKeyID          157
-#define OBJ_localKeyID          OBJ_pkcs9,21L
-
-#define OBJ_ms_corp             1L,3L,6L,1L,4L,1L,311L
-
-#define SN_ms_csp_name          "CSPName"
-#define LN_ms_csp_name          "Microsoft CSP Name"
-#define NID_ms_csp_name         417
-#define OBJ_ms_csp_name         OBJ_ms_corp,17L,1L
-
-#define SN_LocalKeySet          "LocalKeySet"
-#define LN_LocalKeySet          "Microsoft Local Key set"
-#define NID_LocalKeySet         856
-#define OBJ_LocalKeySet         OBJ_ms_corp,17L,2L
-
-#define OBJ_certTypes           OBJ_pkcs9,22L
-
-#define LN_x509Certificate              "x509Certificate"
-#define NID_x509Certificate             158
-#define OBJ_x509Certificate             OBJ_certTypes,1L
-
-#define LN_sdsiCertificate              "sdsiCertificate"
-#define NID_sdsiCertificate             159
-#define OBJ_sdsiCertificate             OBJ_certTypes,2L
-
-#define OBJ_crlTypes            OBJ_pkcs9,23L
-
-#define LN_x509Crl              "x509Crl"
-#define NID_x509Crl             160
-#define OBJ_x509Crl             OBJ_crlTypes,1L
-
-#define SN_id_aa_CMSAlgorithmProtection         "id-aa-CMSAlgorithmProtection"
-#define NID_id_aa_CMSAlgorithmProtection                1263
-#define OBJ_id_aa_CMSAlgorithmProtection                OBJ_pkcs9,52L
-
-#define OBJ_pkcs12              OBJ_pkcs,12L
-
-#define OBJ_pkcs12_pbeids               OBJ_pkcs12,1L
-
-#define SN_pbe_WithSHA1And128BitRC4             "PBE-SHA1-RC4-128"
-#define LN_pbe_WithSHA1And128BitRC4             "pbeWithSHA1And128BitRC4"
-#define NID_pbe_WithSHA1And128BitRC4            144
-#define OBJ_pbe_WithSHA1And128BitRC4            OBJ_pkcs12_pbeids,1L
-
-#define SN_pbe_WithSHA1And40BitRC4              "PBE-SHA1-RC4-40"
-#define LN_pbe_WithSHA1And40BitRC4              "pbeWithSHA1And40BitRC4"
-#define NID_pbe_WithSHA1And40BitRC4             145
-#define OBJ_pbe_WithSHA1And40BitRC4             OBJ_pkcs12_pbeids,2L
-
-#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC           "PBE-SHA1-3DES"
-#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC           "pbeWithSHA1And3-KeyTripleDES-CBC"
-#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC          146
-#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC          OBJ_pkcs12_pbeids,3L
-
-#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC           "PBE-SHA1-2DES"
-#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC           "pbeWithSHA1And2-KeyTripleDES-CBC"
-#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC          147
-#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC          OBJ_pkcs12_pbeids,4L
-
-#define SN_pbe_WithSHA1And128BitRC2_CBC         "PBE-SHA1-RC2-128"
-#define LN_pbe_WithSHA1And128BitRC2_CBC         "pbeWithSHA1And128BitRC2-CBC"
-#define NID_pbe_WithSHA1And128BitRC2_CBC                148
-#define OBJ_pbe_WithSHA1And128BitRC2_CBC                OBJ_pkcs12_pbeids,5L
-
-#define SN_pbe_WithSHA1And40BitRC2_CBC          "PBE-SHA1-RC2-40"
-#define LN_pbe_WithSHA1And40BitRC2_CBC          "pbeWithSHA1And40BitRC2-CBC"
-#define NID_pbe_WithSHA1And40BitRC2_CBC         149
-#define OBJ_pbe_WithSHA1And40BitRC2_CBC         OBJ_pkcs12_pbeids,6L
-
-#define OBJ_pkcs12_Version1             OBJ_pkcs12,10L
-
-#define OBJ_pkcs12_BagIds               OBJ_pkcs12_Version1,1L
-
-#define LN_keyBag               "keyBag"
-#define NID_keyBag              150
-#define OBJ_keyBag              OBJ_pkcs12_BagIds,1L
-
-#define LN_pkcs8ShroudedKeyBag          "pkcs8ShroudedKeyBag"
-#define NID_pkcs8ShroudedKeyBag         151
-#define OBJ_pkcs8ShroudedKeyBag         OBJ_pkcs12_BagIds,2L
-
-#define LN_certBag              "certBag"
-#define NID_certBag             152
-#define OBJ_certBag             OBJ_pkcs12_BagIds,3L
-
-#define LN_crlBag               "crlBag"
-#define NID_crlBag              153
-#define OBJ_crlBag              OBJ_pkcs12_BagIds,4L
-
-#define LN_secretBag            "secretBag"
-#define NID_secretBag           154
-#define OBJ_secretBag           OBJ_pkcs12_BagIds,5L
-
-#define LN_safeContentsBag              "safeContentsBag"
-#define NID_safeContentsBag             155
-#define OBJ_safeContentsBag             OBJ_pkcs12_BagIds,6L
-
-#define SN_md2          "MD2"
-#define LN_md2          "md2"
-#define NID_md2         3
-#define OBJ_md2         OBJ_rsadsi,2L,2L
-
-#define SN_md4          "MD4"
-#define LN_md4          "md4"
-#define NID_md4         257
-#define OBJ_md4         OBJ_rsadsi,2L,4L
-
-#define SN_md5          "MD5"
-#define LN_md5          "md5"
-#define NID_md5         4
-#define OBJ_md5         OBJ_rsadsi,2L,5L
-
-#define SN_md5_sha1             "MD5-SHA1"
-#define LN_md5_sha1             "md5-sha1"
-#define NID_md5_sha1            114
-
-#define LN_hmacWithMD5          "hmacWithMD5"
-#define NID_hmacWithMD5         797
-#define OBJ_hmacWithMD5         OBJ_rsadsi,2L,6L
-
-#define LN_hmacWithSHA1         "hmacWithSHA1"
-#define NID_hmacWithSHA1                163
-#define OBJ_hmacWithSHA1                OBJ_rsadsi,2L,7L
-
-#define SN_sm2          "SM2"
-#define LN_sm2          "sm2"
-#define NID_sm2         1172
-#define OBJ_sm2         OBJ_sm_scheme,301L
-
-#define SN_sm3          "SM3"
-#define LN_sm3          "sm3"
-#define NID_sm3         1143
-#define OBJ_sm3         OBJ_sm_scheme,401L
-
-#define SN_sm3WithRSAEncryption         "RSA-SM3"
-#define LN_sm3WithRSAEncryption         "sm3WithRSAEncryption"
-#define NID_sm3WithRSAEncryption                1144
-#define OBJ_sm3WithRSAEncryption                OBJ_sm_scheme,504L
-
-#define SN_SM2_with_SM3         "SM2-SM3"
-#define LN_SM2_with_SM3         "SM2-with-SM3"
-#define NID_SM2_with_SM3                1204
-#define OBJ_SM2_with_SM3                OBJ_sm_scheme,501L
-
-#define LN_hmacWithSM3          "hmacWithSM3"
-#define NID_hmacWithSM3         1281
-#define OBJ_hmacWithSM3         OBJ_sm3,3L,1L
-
-#define LN_hmacWithSHA224               "hmacWithSHA224"
-#define NID_hmacWithSHA224              798
-#define OBJ_hmacWithSHA224              OBJ_rsadsi,2L,8L
-
-#define LN_hmacWithSHA256               "hmacWithSHA256"
-#define NID_hmacWithSHA256              799
-#define OBJ_hmacWithSHA256              OBJ_rsadsi,2L,9L
-
-#define LN_hmacWithSHA384               "hmacWithSHA384"
-#define NID_hmacWithSHA384              800
-#define OBJ_hmacWithSHA384              OBJ_rsadsi,2L,10L
-
-#define LN_hmacWithSHA512               "hmacWithSHA512"
-#define NID_hmacWithSHA512              801
-#define OBJ_hmacWithSHA512              OBJ_rsadsi,2L,11L
-
-#define LN_hmacWithSHA512_224           "hmacWithSHA512-224"
-#define NID_hmacWithSHA512_224          1193
-#define OBJ_hmacWithSHA512_224          OBJ_rsadsi,2L,12L
-
-#define LN_hmacWithSHA512_256           "hmacWithSHA512-256"
-#define NID_hmacWithSHA512_256          1194
-#define OBJ_hmacWithSHA512_256          OBJ_rsadsi,2L,13L
-
-#define SN_rc2_cbc              "RC2-CBC"
-#define LN_rc2_cbc              "rc2-cbc"
-#define NID_rc2_cbc             37
-#define OBJ_rc2_cbc             OBJ_rsadsi,3L,2L
-
-#define SN_rc2_ecb              "RC2-ECB"
-#define LN_rc2_ecb              "rc2-ecb"
-#define NID_rc2_ecb             38
-
-#define SN_rc2_cfb64            "RC2-CFB"
-#define LN_rc2_cfb64            "rc2-cfb"
-#define NID_rc2_cfb64           39
-
-#define SN_rc2_ofb64            "RC2-OFB"
-#define LN_rc2_ofb64            "rc2-ofb"
-#define NID_rc2_ofb64           40
-
-#define SN_rc2_40_cbc           "RC2-40-CBC"
-#define LN_rc2_40_cbc           "rc2-40-cbc"
-#define NID_rc2_40_cbc          98
-
-#define SN_rc2_64_cbc           "RC2-64-CBC"
-#define LN_rc2_64_cbc           "rc2-64-cbc"
-#define NID_rc2_64_cbc          166
-
-#define SN_rc4          "RC4"
-#define LN_rc4          "rc4"
-#define NID_rc4         5
-#define OBJ_rc4         OBJ_rsadsi,3L,4L
-
-#define SN_rc4_40               "RC4-40"
-#define LN_rc4_40               "rc4-40"
-#define NID_rc4_40              97
-
-#define SN_des_ede3_cbc         "DES-EDE3-CBC"
-#define LN_des_ede3_cbc         "des-ede3-cbc"
-#define NID_des_ede3_cbc                44
-#define OBJ_des_ede3_cbc                OBJ_rsadsi,3L,7L
-
-#define SN_rc5_cbc              "RC5-CBC"
-#define LN_rc5_cbc              "rc5-cbc"
-#define NID_rc5_cbc             120
-#define OBJ_rc5_cbc             OBJ_rsadsi,3L,8L
-
-#define SN_rc5_ecb              "RC5-ECB"
-#define LN_rc5_ecb              "rc5-ecb"
-#define NID_rc5_ecb             121
-
-#define SN_rc5_cfb64            "RC5-CFB"
-#define LN_rc5_cfb64            "rc5-cfb"
-#define NID_rc5_cfb64           122
-
-#define SN_rc5_ofb64            "RC5-OFB"
-#define LN_rc5_ofb64            "rc5-ofb"
-#define NID_rc5_ofb64           123
-
-#define SN_ms_ext_req           "msExtReq"
-#define LN_ms_ext_req           "Microsoft Extension Request"
-#define NID_ms_ext_req          171
-#define OBJ_ms_ext_req          OBJ_ms_corp,2L,1L,14L
-
-#define SN_ms_code_ind          "msCodeInd"
-#define LN_ms_code_ind          "Microsoft Individual Code Signing"
-#define NID_ms_code_ind         134
-#define OBJ_ms_code_ind         OBJ_ms_corp,2L,1L,21L
-
-#define SN_ms_code_com          "msCodeCom"
-#define LN_ms_code_com          "Microsoft Commercial Code Signing"
-#define NID_ms_code_com         135
-#define OBJ_ms_code_com         OBJ_ms_corp,2L,1L,22L
-
-#define SN_ms_ctl_sign          "msCTLSign"
-#define LN_ms_ctl_sign          "Microsoft Trust List Signing"
-#define NID_ms_ctl_sign         136
-#define OBJ_ms_ctl_sign         OBJ_ms_corp,10L,3L,1L
-
-#define SN_ms_sgc               "msSGC"
-#define LN_ms_sgc               "Microsoft Server Gated Crypto"
-#define NID_ms_sgc              137
-#define OBJ_ms_sgc              OBJ_ms_corp,10L,3L,3L
-
-#define SN_ms_efs               "msEFS"
-#define LN_ms_efs               "Microsoft Encrypted File System"
-#define NID_ms_efs              138
-#define OBJ_ms_efs              OBJ_ms_corp,10L,3L,4L
-
-#define SN_ms_smartcard_login           "msSmartcardLogin"
-#define LN_ms_smartcard_login           "Microsoft Smartcard Login"
-#define NID_ms_smartcard_login          648
-#define OBJ_ms_smartcard_login          OBJ_ms_corp,20L,2L,2L
-
-#define SN_ms_upn               "msUPN"
-#define LN_ms_upn               "Microsoft User Principal Name"
-#define NID_ms_upn              649
-#define OBJ_ms_upn              OBJ_ms_corp,20L,2L,3L
-
-#define SN_ms_ntds_sec_ext              "ms-ntds-sec-ext"
-#define LN_ms_ntds_sec_ext              "Microsoft NTDS CA Extension"
-#define NID_ms_ntds_sec_ext             1292
-#define OBJ_ms_ntds_sec_ext             OBJ_ms_corp,25L,2L
-
-#define SN_ms_ntds_obj_sid              "ms-ntds-obj-sid"
-#define LN_ms_ntds_obj_sid              "Microsoft NTDS AD objectSid"
-#define NID_ms_ntds_obj_sid             1291
-#define OBJ_ms_ntds_obj_sid             OBJ_ms_corp,25L,2L,1L
-
-#define SN_ms_cert_templ                "ms-cert-templ"
-#define LN_ms_cert_templ                "Microsoft certificate template"
-#define NID_ms_cert_templ               1293
-#define OBJ_ms_cert_templ               OBJ_ms_corp,21L,7L
-
-#define SN_ms_app_policies              "ms-app-policies"
-#define LN_ms_app_policies              "Microsoft Application Policies Extension"
-#define NID_ms_app_policies             1294
-#define OBJ_ms_app_policies             OBJ_ms_corp,21L,10L
-
-#define SN_idea_cbc             "IDEA-CBC"
-#define LN_idea_cbc             "idea-cbc"
-#define NID_idea_cbc            34
-#define OBJ_idea_cbc            1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L
-
-#define SN_idea_ecb             "IDEA-ECB"
-#define LN_idea_ecb             "idea-ecb"
-#define NID_idea_ecb            36
-
-#define SN_idea_cfb64           "IDEA-CFB"
-#define LN_idea_cfb64           "idea-cfb"
-#define NID_idea_cfb64          35
-
-#define SN_idea_ofb64           "IDEA-OFB"
-#define LN_idea_ofb64           "idea-ofb"
-#define NID_idea_ofb64          46
-
-#define SN_bf_cbc               "BF-CBC"
-#define LN_bf_cbc               "bf-cbc"
-#define NID_bf_cbc              91
-#define OBJ_bf_cbc              1L,3L,6L,1L,4L,1L,3029L,1L,2L
-
-#define SN_bf_ecb               "BF-ECB"
-#define LN_bf_ecb               "bf-ecb"
-#define NID_bf_ecb              92
-
-#define SN_bf_cfb64             "BF-CFB"
-#define LN_bf_cfb64             "bf-cfb"
-#define NID_bf_cfb64            93
-
-#define SN_bf_ofb64             "BF-OFB"
-#define LN_bf_ofb64             "bf-ofb"
-#define NID_bf_ofb64            94
-
-#define SN_id_pkix              "PKIX"
-#define NID_id_pkix             127
-#define OBJ_id_pkix             1L,3L,6L,1L,5L,5L,7L
-
-#define SN_id_pkix_mod          "id-pkix-mod"
-#define NID_id_pkix_mod         258
-#define OBJ_id_pkix_mod         OBJ_id_pkix,0L
-
-#define SN_id_pe                "id-pe"
-#define NID_id_pe               175
-#define OBJ_id_pe               OBJ_id_pkix,1L
-
-#define SN_id_qt                "id-qt"
-#define NID_id_qt               259
-#define OBJ_id_qt               OBJ_id_pkix,2L
-
-#define SN_id_kp                "id-kp"
-#define NID_id_kp               128
-#define OBJ_id_kp               OBJ_id_pkix,3L
-
-#define SN_id_it                "id-it"
-#define NID_id_it               260
-#define OBJ_id_it               OBJ_id_pkix,4L
-
-#define SN_id_pkip              "id-pkip"
-#define NID_id_pkip             261
-#define OBJ_id_pkip             OBJ_id_pkix,5L
-
-#define SN_id_alg               "id-alg"
-#define NID_id_alg              262
-#define OBJ_id_alg              OBJ_id_pkix,6L
-
-#define SN_id_cmc               "id-cmc"
-#define NID_id_cmc              263
-#define OBJ_id_cmc              OBJ_id_pkix,7L
-
-#define SN_id_on                "id-on"
-#define NID_id_on               264
-#define OBJ_id_on               OBJ_id_pkix,8L
-
-#define SN_id_pda               "id-pda"
-#define NID_id_pda              265
-#define OBJ_id_pda              OBJ_id_pkix,9L
-
-#define SN_id_aca               "id-aca"
-#define NID_id_aca              266
-#define OBJ_id_aca              OBJ_id_pkix,10L
-
-#define SN_id_qcs               "id-qcs"
-#define NID_id_qcs              267
-#define OBJ_id_qcs              OBJ_id_pkix,11L
-
-#define SN_id_cp                "id-cp"
-#define NID_id_cp               1238
-#define OBJ_id_cp               OBJ_id_pkix,14L
-
-#define SN_id_cct               "id-cct"
-#define NID_id_cct              268
-#define OBJ_id_cct              OBJ_id_pkix,12L
-
-#define SN_id_ppl               "id-ppl"
-#define NID_id_ppl              662
-#define OBJ_id_ppl              OBJ_id_pkix,21L
-
-#define SN_id_ad                "id-ad"
-#define NID_id_ad               176
-#define OBJ_id_ad               OBJ_id_pkix,48L
-
-#define SN_id_pkix1_explicit_88         "id-pkix1-explicit-88"
-#define NID_id_pkix1_explicit_88                269
-#define OBJ_id_pkix1_explicit_88                OBJ_id_pkix_mod,1L
-
-#define SN_id_pkix1_implicit_88         "id-pkix1-implicit-88"
-#define NID_id_pkix1_implicit_88                270
-#define OBJ_id_pkix1_implicit_88                OBJ_id_pkix_mod,2L
-
-#define SN_id_pkix1_explicit_93         "id-pkix1-explicit-93"
-#define NID_id_pkix1_explicit_93                271
-#define OBJ_id_pkix1_explicit_93                OBJ_id_pkix_mod,3L
-
-#define SN_id_pkix1_implicit_93         "id-pkix1-implicit-93"
-#define NID_id_pkix1_implicit_93                272
-#define OBJ_id_pkix1_implicit_93                OBJ_id_pkix_mod,4L
-
-#define SN_id_mod_crmf          "id-mod-crmf"
-#define NID_id_mod_crmf         273
-#define OBJ_id_mod_crmf         OBJ_id_pkix_mod,5L
-
-#define SN_id_mod_cmc           "id-mod-cmc"
-#define NID_id_mod_cmc          274
-#define OBJ_id_mod_cmc          OBJ_id_pkix_mod,6L
-
-#define SN_id_mod_kea_profile_88                "id-mod-kea-profile-88"
-#define NID_id_mod_kea_profile_88               275
-#define OBJ_id_mod_kea_profile_88               OBJ_id_pkix_mod,7L
-
-#define SN_id_mod_kea_profile_93                "id-mod-kea-profile-93"
-#define NID_id_mod_kea_profile_93               276
-#define OBJ_id_mod_kea_profile_93               OBJ_id_pkix_mod,8L
-
-#define SN_id_mod_cmp           "id-mod-cmp"
-#define NID_id_mod_cmp          277
-#define OBJ_id_mod_cmp          OBJ_id_pkix_mod,9L
-
-#define SN_id_mod_qualified_cert_88             "id-mod-qualified-cert-88"
-#define NID_id_mod_qualified_cert_88            278
-#define OBJ_id_mod_qualified_cert_88            OBJ_id_pkix_mod,10L
-
-#define SN_id_mod_qualified_cert_93             "id-mod-qualified-cert-93"
-#define NID_id_mod_qualified_cert_93            279
-#define OBJ_id_mod_qualified_cert_93            OBJ_id_pkix_mod,11L
-
-#define SN_id_mod_attribute_cert                "id-mod-attribute-cert"
-#define NID_id_mod_attribute_cert               280
-#define OBJ_id_mod_attribute_cert               OBJ_id_pkix_mod,12L
-
-#define SN_id_mod_timestamp_protocol            "id-mod-timestamp-protocol"
-#define NID_id_mod_timestamp_protocol           281
-#define OBJ_id_mod_timestamp_protocol           OBJ_id_pkix_mod,13L
-
-#define SN_id_mod_ocsp          "id-mod-ocsp"
-#define NID_id_mod_ocsp         282
-#define OBJ_id_mod_ocsp         OBJ_id_pkix_mod,14L
-
-#define SN_id_mod_dvcs          "id-mod-dvcs"
-#define NID_id_mod_dvcs         283
-#define OBJ_id_mod_dvcs         OBJ_id_pkix_mod,15L
-
-#define SN_id_mod_cmp2000               "id-mod-cmp2000"
-#define NID_id_mod_cmp2000              284
-#define OBJ_id_mod_cmp2000              OBJ_id_pkix_mod,16L
-
-#define SN_id_mod_cmp2000_02            "id-mod-cmp2000-02"
-#define NID_id_mod_cmp2000_02           1251
-#define OBJ_id_mod_cmp2000_02           OBJ_id_pkix_mod,50L
-
-#define SN_id_mod_cmp2021_88            "id-mod-cmp2021-88"
-#define NID_id_mod_cmp2021_88           1252
-#define OBJ_id_mod_cmp2021_88           OBJ_id_pkix_mod,99L
-
-#define SN_id_mod_cmp2021_02            "id-mod-cmp2021-02"
-#define NID_id_mod_cmp2021_02           1253
-#define OBJ_id_mod_cmp2021_02           OBJ_id_pkix_mod,100L
-
-#define SN_info_access          "authorityInfoAccess"
-#define LN_info_access          "Authority Information Access"
-#define NID_info_access         177
-#define OBJ_info_access         OBJ_id_pe,1L
-
-#define SN_biometricInfo                "biometricInfo"
-#define LN_biometricInfo                "Biometric Info"
-#define NID_biometricInfo               285
-#define OBJ_biometricInfo               OBJ_id_pe,2L
-
-#define SN_qcStatements         "qcStatements"
-#define NID_qcStatements                286
-#define OBJ_qcStatements                OBJ_id_pe,3L
-
-#define SN_ac_auditIdentity             "ac-auditIdentity"
-#define LN_ac_auditIdentity             "X509v3 Audit Identity"
-#define NID_ac_auditIdentity            287
-#define OBJ_ac_auditIdentity            OBJ_id_pe,4L
-
-#define NID_ac_auditEntity              1323
-#define OBJ_ac_auditEntity              OBJ_ac_auditIdentity
-
-#define SN_ac_targeting         "ac-targeting"
-#define NID_ac_targeting                288
-#define OBJ_ac_targeting                OBJ_id_pe,5L
-
-#define SN_aaControls           "aaControls"
-#define NID_aaControls          289
-#define OBJ_aaControls          OBJ_id_pe,6L
-
-#define SN_sbgp_ipAddrBlock             "sbgp-ipAddrBlock"
-#define NID_sbgp_ipAddrBlock            290
-#define OBJ_sbgp_ipAddrBlock            OBJ_id_pe,7L
-
-#define SN_sbgp_autonomousSysNum                "sbgp-autonomousSysNum"
-#define NID_sbgp_autonomousSysNum               291
-#define OBJ_sbgp_autonomousSysNum               OBJ_id_pe,8L
-
-#define SN_sbgp_routerIdentifier                "sbgp-routerIdentifier"
-#define NID_sbgp_routerIdentifier               292
-#define OBJ_sbgp_routerIdentifier               OBJ_id_pe,9L
-
-#define SN_ac_proxying          "ac-proxying"
-#define NID_ac_proxying         397
-#define OBJ_ac_proxying         OBJ_id_pe,10L
-
-#define SN_sinfo_access         "subjectInfoAccess"
-#define LN_sinfo_access         "Subject Information Access"
-#define NID_sinfo_access                398
-#define OBJ_sinfo_access                OBJ_id_pe,11L
-
-#define SN_proxyCertInfo                "proxyCertInfo"
-#define LN_proxyCertInfo                "Proxy Certificate Information"
-#define NID_proxyCertInfo               663
-#define OBJ_proxyCertInfo               OBJ_id_pe,14L
-
-#define SN_tlsfeature           "tlsfeature"
-#define LN_tlsfeature           "TLS Feature"
-#define NID_tlsfeature          1020
-#define OBJ_tlsfeature          OBJ_id_pe,24L
-
-#define SN_sbgp_ipAddrBlockv2           "sbgp-ipAddrBlockv2"
-#define NID_sbgp_ipAddrBlockv2          1239
-#define OBJ_sbgp_ipAddrBlockv2          OBJ_id_pe,28L
-
-#define SN_sbgp_autonomousSysNumv2              "sbgp-autonomousSysNumv2"
-#define NID_sbgp_autonomousSysNumv2             1240
-#define OBJ_sbgp_autonomousSysNumv2             OBJ_id_pe,29L
-
-#define SN_id_qt_cps            "id-qt-cps"
-#define LN_id_qt_cps            "Policy Qualifier CPS"
-#define NID_id_qt_cps           164
-#define OBJ_id_qt_cps           OBJ_id_qt,1L
-
-#define SN_id_qt_unotice                "id-qt-unotice"
-#define LN_id_qt_unotice                "Policy Qualifier User Notice"
-#define NID_id_qt_unotice               165
-#define OBJ_id_qt_unotice               OBJ_id_qt,2L
-
-#define SN_textNotice           "textNotice"
-#define NID_textNotice          293
-#define OBJ_textNotice          OBJ_id_qt,3L
-
-#define SN_server_auth          "serverAuth"
-#define LN_server_auth          "TLS Web Server Authentication"
-#define NID_server_auth         129
-#define OBJ_server_auth         OBJ_id_kp,1L
-
-#define SN_client_auth          "clientAuth"
-#define LN_client_auth          "TLS Web Client Authentication"
-#define NID_client_auth         130
-#define OBJ_client_auth         OBJ_id_kp,2L
-
-#define SN_code_sign            "codeSigning"
-#define LN_code_sign            "Code Signing"
-#define NID_code_sign           131
-#define OBJ_code_sign           OBJ_id_kp,3L
-
-#define SN_email_protect                "emailProtection"
-#define LN_email_protect                "E-mail Protection"
-#define NID_email_protect               132
-#define OBJ_email_protect               OBJ_id_kp,4L
-
-#define SN_ipsecEndSystem               "ipsecEndSystem"
-#define LN_ipsecEndSystem               "IPSec End System"
-#define NID_ipsecEndSystem              294
-#define OBJ_ipsecEndSystem              OBJ_id_kp,5L
-
-#define SN_ipsecTunnel          "ipsecTunnel"
-#define LN_ipsecTunnel          "IPSec Tunnel"
-#define NID_ipsecTunnel         295
-#define OBJ_ipsecTunnel         OBJ_id_kp,6L
-
-#define SN_ipsecUser            "ipsecUser"
-#define LN_ipsecUser            "IPSec User"
-#define NID_ipsecUser           296
-#define OBJ_ipsecUser           OBJ_id_kp,7L
-
-#define SN_time_stamp           "timeStamping"
-#define LN_time_stamp           "Time Stamping"
-#define NID_time_stamp          133
-#define OBJ_time_stamp          OBJ_id_kp,8L
-
-#define SN_OCSP_sign            "OCSPSigning"
-#define LN_OCSP_sign            "OCSP Signing"
-#define NID_OCSP_sign           180
-#define OBJ_OCSP_sign           OBJ_id_kp,9L
-
-#define SN_dvcs         "DVCS"
-#define LN_dvcs         "dvcs"
-#define NID_dvcs                297
-#define OBJ_dvcs                OBJ_id_kp,10L
-
-#define SN_ipsec_IKE            "ipsecIKE"
-#define LN_ipsec_IKE            "ipsec Internet Key Exchange"
-#define NID_ipsec_IKE           1022
-#define OBJ_ipsec_IKE           OBJ_id_kp,17L
-
-#define SN_capwapAC             "capwapAC"
-#define LN_capwapAC             "Ctrl/provision WAP Access"
-#define NID_capwapAC            1023
-#define OBJ_capwapAC            OBJ_id_kp,18L
-
-#define SN_capwapWTP            "capwapWTP"
-#define LN_capwapWTP            "Ctrl/Provision WAP Termination"
-#define NID_capwapWTP           1024
-#define OBJ_capwapWTP           OBJ_id_kp,19L
-
-#define SN_sshClient            "secureShellClient"
-#define LN_sshClient            "SSH Client"
-#define NID_sshClient           1025
-#define OBJ_sshClient           OBJ_id_kp,21L
-
-#define SN_sshServer            "secureShellServer"
-#define LN_sshServer            "SSH Server"
-#define NID_sshServer           1026
-#define OBJ_sshServer           OBJ_id_kp,22L
-
-#define SN_sendRouter           "sendRouter"
-#define LN_sendRouter           "Send Router"
-#define NID_sendRouter          1027
-#define OBJ_sendRouter          OBJ_id_kp,23L
-
-#define SN_sendProxiedRouter            "sendProxiedRouter"
-#define LN_sendProxiedRouter            "Send Proxied Router"
-#define NID_sendProxiedRouter           1028
-#define OBJ_sendProxiedRouter           OBJ_id_kp,24L
-
-#define SN_sendOwner            "sendOwner"
-#define LN_sendOwner            "Send Owner"
-#define NID_sendOwner           1029
-#define OBJ_sendOwner           OBJ_id_kp,25L
-
-#define SN_sendProxiedOwner             "sendProxiedOwner"
-#define LN_sendProxiedOwner             "Send Proxied Owner"
-#define NID_sendProxiedOwner            1030
-#define OBJ_sendProxiedOwner            OBJ_id_kp,26L
-
-#define SN_cmcCA                "cmcCA"
-#define LN_cmcCA                "CMC Certificate Authority"
-#define NID_cmcCA               1131
-#define OBJ_cmcCA               OBJ_id_kp,27L
-
-#define SN_cmcRA                "cmcRA"
-#define LN_cmcRA                "CMC Registration Authority"
-#define NID_cmcRA               1132
-#define OBJ_cmcRA               OBJ_id_kp,28L
-
-#define SN_cmcArchive           "cmcArchive"
-#define LN_cmcArchive           "CMC Archive Server"
-#define NID_cmcArchive          1219
-#define OBJ_cmcArchive          OBJ_id_kp,29L
-
-#define SN_id_kp_bgpsec_router          "id-kp-bgpsec-router"
-#define LN_id_kp_bgpsec_router          "BGPsec Router"
-#define NID_id_kp_bgpsec_router         1220
-#define OBJ_id_kp_bgpsec_router         OBJ_id_kp,30L
-
-#define SN_id_kp_BrandIndicatorforMessageIdentification         "id-kp-BrandIndicatorforMessageIdentification"
-#define LN_id_kp_BrandIndicatorforMessageIdentification         "Brand Indicator for Message Identification"
-#define NID_id_kp_BrandIndicatorforMessageIdentification                1221
-#define OBJ_id_kp_BrandIndicatorforMessageIdentification                OBJ_id_kp,31L
-
-#define SN_cmKGA                "cmKGA"
-#define LN_cmKGA                "Certificate Management Key Generation Authority"
-#define NID_cmKGA               1222
-#define OBJ_cmKGA               OBJ_id_kp,32L
-
-#define SN_id_it_caProtEncCert          "id-it-caProtEncCert"
-#define NID_id_it_caProtEncCert         298
-#define OBJ_id_it_caProtEncCert         OBJ_id_it,1L
-
-#define SN_id_it_signKeyPairTypes               "id-it-signKeyPairTypes"
-#define NID_id_it_signKeyPairTypes              299
-#define OBJ_id_it_signKeyPairTypes              OBJ_id_it,2L
-
-#define SN_id_it_encKeyPairTypes                "id-it-encKeyPairTypes"
-#define NID_id_it_encKeyPairTypes               300
-#define OBJ_id_it_encKeyPairTypes               OBJ_id_it,3L
-
-#define SN_id_it_preferredSymmAlg               "id-it-preferredSymmAlg"
-#define NID_id_it_preferredSymmAlg              301
-#define OBJ_id_it_preferredSymmAlg              OBJ_id_it,4L
-
-#define SN_id_it_caKeyUpdateInfo                "id-it-caKeyUpdateInfo"
-#define NID_id_it_caKeyUpdateInfo               302
-#define OBJ_id_it_caKeyUpdateInfo               OBJ_id_it,5L
-
-#define SN_id_it_currentCRL             "id-it-currentCRL"
-#define NID_id_it_currentCRL            303
-#define OBJ_id_it_currentCRL            OBJ_id_it,6L
-
-#define SN_id_it_unsupportedOIDs                "id-it-unsupportedOIDs"
-#define NID_id_it_unsupportedOIDs               304
-#define OBJ_id_it_unsupportedOIDs               OBJ_id_it,7L
-
-#define SN_id_it_subscriptionRequest            "id-it-subscriptionRequest"
-#define NID_id_it_subscriptionRequest           305
-#define OBJ_id_it_subscriptionRequest           OBJ_id_it,8L
-
-#define SN_id_it_subscriptionResponse           "id-it-subscriptionResponse"
-#define NID_id_it_subscriptionResponse          306
-#define OBJ_id_it_subscriptionResponse          OBJ_id_it,9L
-
-#define SN_id_it_keyPairParamReq                "id-it-keyPairParamReq"
-#define NID_id_it_keyPairParamReq               307
-#define OBJ_id_it_keyPairParamReq               OBJ_id_it,10L
-
-#define SN_id_it_keyPairParamRep                "id-it-keyPairParamRep"
-#define NID_id_it_keyPairParamRep               308
-#define OBJ_id_it_keyPairParamRep               OBJ_id_it,11L
-
-#define SN_id_it_revPassphrase          "id-it-revPassphrase"
-#define NID_id_it_revPassphrase         309
-#define OBJ_id_it_revPassphrase         OBJ_id_it,12L
-
-#define SN_id_it_implicitConfirm                "id-it-implicitConfirm"
-#define NID_id_it_implicitConfirm               310
-#define OBJ_id_it_implicitConfirm               OBJ_id_it,13L
-
-#define SN_id_it_confirmWaitTime                "id-it-confirmWaitTime"
-#define NID_id_it_confirmWaitTime               311
-#define OBJ_id_it_confirmWaitTime               OBJ_id_it,14L
-
-#define SN_id_it_origPKIMessage         "id-it-origPKIMessage"
-#define NID_id_it_origPKIMessage                312
-#define OBJ_id_it_origPKIMessage                OBJ_id_it,15L
-
-#define SN_id_it_suppLangTags           "id-it-suppLangTags"
-#define NID_id_it_suppLangTags          784
-#define OBJ_id_it_suppLangTags          OBJ_id_it,16L
-
-#define SN_id_it_caCerts                "id-it-caCerts"
-#define NID_id_it_caCerts               1223
-#define OBJ_id_it_caCerts               OBJ_id_it,17L
-
-#define SN_id_it_rootCaKeyUpdate                "id-it-rootCaKeyUpdate"
-#define NID_id_it_rootCaKeyUpdate               1224
-#define OBJ_id_it_rootCaKeyUpdate               OBJ_id_it,18L
-
-#define SN_id_it_certReqTemplate                "id-it-certReqTemplate"
-#define NID_id_it_certReqTemplate               1225
-#define OBJ_id_it_certReqTemplate               OBJ_id_it,19L
-
-#define SN_id_it_rootCaCert             "id-it-rootCaCert"
-#define NID_id_it_rootCaCert            1254
-#define OBJ_id_it_rootCaCert            OBJ_id_it,20L
-
-#define SN_id_it_certProfile            "id-it-certProfile"
-#define NID_id_it_certProfile           1255
-#define OBJ_id_it_certProfile           OBJ_id_it,21L
-
-#define SN_id_it_crlStatusList          "id-it-crlStatusList"
-#define NID_id_it_crlStatusList         1256
-#define OBJ_id_it_crlStatusList         OBJ_id_it,22L
-
-#define SN_id_it_crls           "id-it-crls"
-#define NID_id_it_crls          1257
-#define OBJ_id_it_crls          OBJ_id_it,23L
-
-#define SN_id_regCtrl           "id-regCtrl"
-#define NID_id_regCtrl          313
-#define OBJ_id_regCtrl          OBJ_id_pkip,1L
-
-#define SN_id_regInfo           "id-regInfo"
-#define NID_id_regInfo          314
-#define OBJ_id_regInfo          OBJ_id_pkip,2L
-
-#define SN_id_regCtrl_regToken          "id-regCtrl-regToken"
-#define NID_id_regCtrl_regToken         315
-#define OBJ_id_regCtrl_regToken         OBJ_id_regCtrl,1L
-
-#define SN_id_regCtrl_authenticator             "id-regCtrl-authenticator"
-#define NID_id_regCtrl_authenticator            316
-#define OBJ_id_regCtrl_authenticator            OBJ_id_regCtrl,2L
-
-#define SN_id_regCtrl_pkiPublicationInfo                "id-regCtrl-pkiPublicationInfo"
-#define NID_id_regCtrl_pkiPublicationInfo               317
-#define OBJ_id_regCtrl_pkiPublicationInfo               OBJ_id_regCtrl,3L
-
-#define SN_id_regCtrl_pkiArchiveOptions         "id-regCtrl-pkiArchiveOptions"
-#define NID_id_regCtrl_pkiArchiveOptions                318
-#define OBJ_id_regCtrl_pkiArchiveOptions                OBJ_id_regCtrl,4L
-
-#define SN_id_regCtrl_oldCertID         "id-regCtrl-oldCertID"
-#define NID_id_regCtrl_oldCertID                319
-#define OBJ_id_regCtrl_oldCertID                OBJ_id_regCtrl,5L
-
-#define SN_id_regCtrl_protocolEncrKey           "id-regCtrl-protocolEncrKey"
-#define NID_id_regCtrl_protocolEncrKey          320
-#define OBJ_id_regCtrl_protocolEncrKey          OBJ_id_regCtrl,6L
-
-#define SN_id_regCtrl_altCertTemplate           "id-regCtrl-altCertTemplate"
-#define NID_id_regCtrl_altCertTemplate          1258
-#define OBJ_id_regCtrl_altCertTemplate          OBJ_id_regCtrl,7L
-
-#define SN_id_regCtrl_algId             "id-regCtrl-algId"
-#define NID_id_regCtrl_algId            1259
-#define OBJ_id_regCtrl_algId            OBJ_id_regCtrl,11L
-
-#define SN_id_regCtrl_rsaKeyLen         "id-regCtrl-rsaKeyLen"
-#define NID_id_regCtrl_rsaKeyLen                1260
-#define OBJ_id_regCtrl_rsaKeyLen                OBJ_id_regCtrl,12L
-
-#define SN_id_regInfo_utf8Pairs         "id-regInfo-utf8Pairs"
-#define NID_id_regInfo_utf8Pairs                321
-#define OBJ_id_regInfo_utf8Pairs                OBJ_id_regInfo,1L
-
-#define SN_id_regInfo_certReq           "id-regInfo-certReq"
-#define NID_id_regInfo_certReq          322
-#define OBJ_id_regInfo_certReq          OBJ_id_regInfo,2L
-
-#define SN_id_alg_des40         "id-alg-des40"
-#define NID_id_alg_des40                323
-#define OBJ_id_alg_des40                OBJ_id_alg,1L
-
-#define SN_id_alg_noSignature           "id-alg-noSignature"
-#define NID_id_alg_noSignature          324
-#define OBJ_id_alg_noSignature          OBJ_id_alg,2L
-
-#define SN_id_alg_dh_sig_hmac_sha1              "id-alg-dh-sig-hmac-sha1"
-#define NID_id_alg_dh_sig_hmac_sha1             325
-#define OBJ_id_alg_dh_sig_hmac_sha1             OBJ_id_alg,3L
-
-#define SN_id_alg_dh_pop                "id-alg-dh-pop"
-#define NID_id_alg_dh_pop               326
-#define OBJ_id_alg_dh_pop               OBJ_id_alg,4L
-
-#define SN_id_cmc_statusInfo            "id-cmc-statusInfo"
-#define NID_id_cmc_statusInfo           327
-#define OBJ_id_cmc_statusInfo           OBJ_id_cmc,1L
-
-#define SN_id_cmc_identification                "id-cmc-identification"
-#define NID_id_cmc_identification               328
-#define OBJ_id_cmc_identification               OBJ_id_cmc,2L
-
-#define SN_id_cmc_identityProof         "id-cmc-identityProof"
-#define NID_id_cmc_identityProof                329
-#define OBJ_id_cmc_identityProof                OBJ_id_cmc,3L
-
-#define SN_id_cmc_dataReturn            "id-cmc-dataReturn"
-#define NID_id_cmc_dataReturn           330
-#define OBJ_id_cmc_dataReturn           OBJ_id_cmc,4L
-
-#define SN_id_cmc_transactionId         "id-cmc-transactionId"
-#define NID_id_cmc_transactionId                331
-#define OBJ_id_cmc_transactionId                OBJ_id_cmc,5L
-
-#define SN_id_cmc_senderNonce           "id-cmc-senderNonce"
-#define NID_id_cmc_senderNonce          332
-#define OBJ_id_cmc_senderNonce          OBJ_id_cmc,6L
-
-#define SN_id_cmc_recipientNonce                "id-cmc-recipientNonce"
-#define NID_id_cmc_recipientNonce               333
-#define OBJ_id_cmc_recipientNonce               OBJ_id_cmc,7L
-
-#define SN_id_cmc_addExtensions         "id-cmc-addExtensions"
-#define NID_id_cmc_addExtensions                334
-#define OBJ_id_cmc_addExtensions                OBJ_id_cmc,8L
-
-#define SN_id_cmc_encryptedPOP          "id-cmc-encryptedPOP"
-#define NID_id_cmc_encryptedPOP         335
-#define OBJ_id_cmc_encryptedPOP         OBJ_id_cmc,9L
-
-#define SN_id_cmc_decryptedPOP          "id-cmc-decryptedPOP"
-#define NID_id_cmc_decryptedPOP         336
-#define OBJ_id_cmc_decryptedPOP         OBJ_id_cmc,10L
-
-#define SN_id_cmc_lraPOPWitness         "id-cmc-lraPOPWitness"
-#define NID_id_cmc_lraPOPWitness                337
-#define OBJ_id_cmc_lraPOPWitness                OBJ_id_cmc,11L
-
-#define SN_id_cmc_getCert               "id-cmc-getCert"
-#define NID_id_cmc_getCert              338
-#define OBJ_id_cmc_getCert              OBJ_id_cmc,15L
-
-#define SN_id_cmc_getCRL                "id-cmc-getCRL"
-#define NID_id_cmc_getCRL               339
-#define OBJ_id_cmc_getCRL               OBJ_id_cmc,16L
-
-#define SN_id_cmc_revokeRequest         "id-cmc-revokeRequest"
-#define NID_id_cmc_revokeRequest                340
-#define OBJ_id_cmc_revokeRequest                OBJ_id_cmc,17L
-
-#define SN_id_cmc_regInfo               "id-cmc-regInfo"
-#define NID_id_cmc_regInfo              341
-#define OBJ_id_cmc_regInfo              OBJ_id_cmc,18L
-
-#define SN_id_cmc_responseInfo          "id-cmc-responseInfo"
-#define NID_id_cmc_responseInfo         342
-#define OBJ_id_cmc_responseInfo         OBJ_id_cmc,19L
-
-#define SN_id_cmc_queryPending          "id-cmc-queryPending"
-#define NID_id_cmc_queryPending         343
-#define OBJ_id_cmc_queryPending         OBJ_id_cmc,21L
-
-#define SN_id_cmc_popLinkRandom         "id-cmc-popLinkRandom"
-#define NID_id_cmc_popLinkRandom                344
-#define OBJ_id_cmc_popLinkRandom                OBJ_id_cmc,22L
-
-#define SN_id_cmc_popLinkWitness                "id-cmc-popLinkWitness"
-#define NID_id_cmc_popLinkWitness               345
-#define OBJ_id_cmc_popLinkWitness               OBJ_id_cmc,23L
-
-#define SN_id_cmc_confirmCertAcceptance         "id-cmc-confirmCertAcceptance"
-#define NID_id_cmc_confirmCertAcceptance                346
-#define OBJ_id_cmc_confirmCertAcceptance                OBJ_id_cmc,24L
-
-#define SN_id_on_personalData           "id-on-personalData"
-#define NID_id_on_personalData          347
-#define OBJ_id_on_personalData          OBJ_id_on,1L
-
-#define SN_id_on_permanentIdentifier            "id-on-permanentIdentifier"
-#define LN_id_on_permanentIdentifier            "Permanent Identifier"
-#define NID_id_on_permanentIdentifier           858
-#define OBJ_id_on_permanentIdentifier           OBJ_id_on,3L
-
-#define SN_id_on_hardwareModuleName             "id-on-hardwareModuleName"
-#define LN_id_on_hardwareModuleName             "Hardware Module Name"
-#define NID_id_on_hardwareModuleName            1321
-#define OBJ_id_on_hardwareModuleName            OBJ_id_on,4L
-
-#define SN_XmppAddr             "id-on-xmppAddr"
-#define LN_XmppAddr             "XmppAddr"
-#define NID_XmppAddr            1209
-#define OBJ_XmppAddr            OBJ_id_on,5L
-
-#define SN_SRVName              "id-on-dnsSRV"
-#define LN_SRVName              "SRVName"
-#define NID_SRVName             1210
-#define OBJ_SRVName             OBJ_id_on,7L
-
-#define SN_NAIRealm             "id-on-NAIRealm"
-#define LN_NAIRealm             "NAIRealm"
-#define NID_NAIRealm            1211
-#define OBJ_NAIRealm            OBJ_id_on,8L
-
-#define SN_id_on_SmtpUTF8Mailbox                "id-on-SmtpUTF8Mailbox"
-#define LN_id_on_SmtpUTF8Mailbox                "Smtp UTF8 Mailbox"
-#define NID_id_on_SmtpUTF8Mailbox               1208
-#define OBJ_id_on_SmtpUTF8Mailbox               OBJ_id_on,9L
-
-#define SN_id_pda_dateOfBirth           "id-pda-dateOfBirth"
-#define NID_id_pda_dateOfBirth          348
-#define OBJ_id_pda_dateOfBirth          OBJ_id_pda,1L
-
-#define SN_id_pda_placeOfBirth          "id-pda-placeOfBirth"
-#define NID_id_pda_placeOfBirth         349
-#define OBJ_id_pda_placeOfBirth         OBJ_id_pda,2L
-
-#define SN_id_pda_gender                "id-pda-gender"
-#define NID_id_pda_gender               351
-#define OBJ_id_pda_gender               OBJ_id_pda,3L
-
-#define SN_id_pda_countryOfCitizenship          "id-pda-countryOfCitizenship"
-#define NID_id_pda_countryOfCitizenship         352
-#define OBJ_id_pda_countryOfCitizenship         OBJ_id_pda,4L
-
-#define SN_id_pda_countryOfResidence            "id-pda-countryOfResidence"
-#define NID_id_pda_countryOfResidence           353
-#define OBJ_id_pda_countryOfResidence           OBJ_id_pda,5L
-
-#define SN_id_aca_authenticationInfo            "id-aca-authenticationInfo"
-#define NID_id_aca_authenticationInfo           354
-#define OBJ_id_aca_authenticationInfo           OBJ_id_aca,1L
-
-#define SN_id_aca_accessIdentity                "id-aca-accessIdentity"
-#define NID_id_aca_accessIdentity               355
-#define OBJ_id_aca_accessIdentity               OBJ_id_aca,2L
-
-#define SN_id_aca_chargingIdentity              "id-aca-chargingIdentity"
-#define NID_id_aca_chargingIdentity             356
-#define OBJ_id_aca_chargingIdentity             OBJ_id_aca,3L
-
-#define SN_id_aca_group         "id-aca-group"
-#define NID_id_aca_group                357
-#define OBJ_id_aca_group                OBJ_id_aca,4L
-
-#define SN_id_aca_role          "id-aca-role"
-#define NID_id_aca_role         358
-#define OBJ_id_aca_role         OBJ_id_aca,5L
-
-#define SN_id_aca_encAttrs              "id-aca-encAttrs"
-#define NID_id_aca_encAttrs             399
-#define OBJ_id_aca_encAttrs             OBJ_id_aca,6L
-
-#define SN_id_qcs_pkixQCSyntax_v1               "id-qcs-pkixQCSyntax-v1"
-#define NID_id_qcs_pkixQCSyntax_v1              359
-#define OBJ_id_qcs_pkixQCSyntax_v1              OBJ_id_qcs,1L
-
-#define SN_ipAddr_asNumber              "ipAddr-asNumber"
-#define NID_ipAddr_asNumber             1241
-#define OBJ_ipAddr_asNumber             OBJ_id_cp,2L
-
-#define SN_ipAddr_asNumberv2            "ipAddr-asNumberv2"
-#define NID_ipAddr_asNumberv2           1242
-#define OBJ_ipAddr_asNumberv2           OBJ_id_cp,3L
-
-#define SN_id_cct_crs           "id-cct-crs"
-#define NID_id_cct_crs          360
-#define OBJ_id_cct_crs          OBJ_id_cct,1L
-
-#define SN_id_cct_PKIData               "id-cct-PKIData"
-#define NID_id_cct_PKIData              361
-#define OBJ_id_cct_PKIData              OBJ_id_cct,2L
-
-#define SN_id_cct_PKIResponse           "id-cct-PKIResponse"
-#define NID_id_cct_PKIResponse          362
-#define OBJ_id_cct_PKIResponse          OBJ_id_cct,3L
-
-#define SN_id_ppl_anyLanguage           "id-ppl-anyLanguage"
-#define LN_id_ppl_anyLanguage           "Any language"
-#define NID_id_ppl_anyLanguage          664
-#define OBJ_id_ppl_anyLanguage          OBJ_id_ppl,0L
-
-#define SN_id_ppl_inheritAll            "id-ppl-inheritAll"
-#define LN_id_ppl_inheritAll            "Inherit all"
-#define NID_id_ppl_inheritAll           665
-#define OBJ_id_ppl_inheritAll           OBJ_id_ppl,1L
-
-#define SN_Independent          "id-ppl-independent"
-#define LN_Independent          "Independent"
-#define NID_Independent         667
-#define OBJ_Independent         OBJ_id_ppl,2L
-
-#define SN_ad_OCSP              "OCSP"
-#define LN_ad_OCSP              "OCSP"
-#define NID_ad_OCSP             178
-#define OBJ_ad_OCSP             OBJ_id_ad,1L
-
-#define SN_ad_ca_issuers                "caIssuers"
-#define LN_ad_ca_issuers                "CA Issuers"
-#define NID_ad_ca_issuers               179
-#define OBJ_ad_ca_issuers               OBJ_id_ad,2L
-
-#define SN_ad_timeStamping              "ad_timestamping"
-#define LN_ad_timeStamping              "AD Time Stamping"
-#define NID_ad_timeStamping             363
-#define OBJ_ad_timeStamping             OBJ_id_ad,3L
-
-#define SN_ad_dvcs              "AD_DVCS"
-#define LN_ad_dvcs              "ad dvcs"
-#define NID_ad_dvcs             364
-#define OBJ_ad_dvcs             OBJ_id_ad,4L
-
-#define SN_caRepository         "caRepository"
-#define LN_caRepository         "CA Repository"
-#define NID_caRepository                785
-#define OBJ_caRepository                OBJ_id_ad,5L
-
-#define SN_rpkiManifest         "rpkiManifest"
-#define LN_rpkiManifest         "RPKI Manifest"
-#define NID_rpkiManifest                1243
-#define OBJ_rpkiManifest                OBJ_id_ad,10L
-
-#define SN_signedObject         "signedObject"
-#define LN_signedObject         "Signed Object"
-#define NID_signedObject                1244
-#define OBJ_signedObject                OBJ_id_ad,11L
-
-#define SN_rpkiNotify           "rpkiNotify"
-#define LN_rpkiNotify           "RPKI Notify"
-#define NID_rpkiNotify          1245
-#define OBJ_rpkiNotify          OBJ_id_ad,13L
-
-#define OBJ_id_pkix_OCSP                OBJ_ad_OCSP
-
-#define SN_id_pkix_OCSP_basic           "basicOCSPResponse"
-#define LN_id_pkix_OCSP_basic           "Basic OCSP Response"
-#define NID_id_pkix_OCSP_basic          365
-#define OBJ_id_pkix_OCSP_basic          OBJ_id_pkix_OCSP,1L
-
-#define SN_id_pkix_OCSP_Nonce           "Nonce"
-#define LN_id_pkix_OCSP_Nonce           "OCSP Nonce"
-#define NID_id_pkix_OCSP_Nonce          366
-#define OBJ_id_pkix_OCSP_Nonce          OBJ_id_pkix_OCSP,2L
-
-#define SN_id_pkix_OCSP_CrlID           "CrlID"
-#define LN_id_pkix_OCSP_CrlID           "OCSP CRL ID"
-#define NID_id_pkix_OCSP_CrlID          367
-#define OBJ_id_pkix_OCSP_CrlID          OBJ_id_pkix_OCSP,3L
-
-#define SN_id_pkix_OCSP_acceptableResponses             "acceptableResponses"
-#define LN_id_pkix_OCSP_acceptableResponses             "Acceptable OCSP Responses"
-#define NID_id_pkix_OCSP_acceptableResponses            368
-#define OBJ_id_pkix_OCSP_acceptableResponses            OBJ_id_pkix_OCSP,4L
-
-#define SN_id_pkix_OCSP_noCheck         "noCheck"
-#define LN_id_pkix_OCSP_noCheck         "OCSP No Check"
-#define NID_id_pkix_OCSP_noCheck                369
-#define OBJ_id_pkix_OCSP_noCheck                OBJ_id_pkix_OCSP,5L
-
-#define SN_id_pkix_OCSP_archiveCutoff           "archiveCutoff"
-#define LN_id_pkix_OCSP_archiveCutoff           "OCSP Archive Cutoff"
-#define NID_id_pkix_OCSP_archiveCutoff          370
-#define OBJ_id_pkix_OCSP_archiveCutoff          OBJ_id_pkix_OCSP,6L
-
-#define SN_id_pkix_OCSP_serviceLocator          "serviceLocator"
-#define LN_id_pkix_OCSP_serviceLocator          "OCSP Service Locator"
-#define NID_id_pkix_OCSP_serviceLocator         371
-#define OBJ_id_pkix_OCSP_serviceLocator         OBJ_id_pkix_OCSP,7L
-
-#define SN_id_pkix_OCSP_extendedStatus          "extendedStatus"
-#define LN_id_pkix_OCSP_extendedStatus          "Extended OCSP Status"
-#define NID_id_pkix_OCSP_extendedStatus         372
-#define OBJ_id_pkix_OCSP_extendedStatus         OBJ_id_pkix_OCSP,8L
-
-#define SN_id_pkix_OCSP_valid           "valid"
-#define NID_id_pkix_OCSP_valid          373
-#define OBJ_id_pkix_OCSP_valid          OBJ_id_pkix_OCSP,9L
-
-#define SN_id_pkix_OCSP_path            "path"
-#define NID_id_pkix_OCSP_path           374
-#define OBJ_id_pkix_OCSP_path           OBJ_id_pkix_OCSP,10L
-
-#define SN_id_pkix_OCSP_trustRoot               "trustRoot"
-#define LN_id_pkix_OCSP_trustRoot               "Trust Root"
-#define NID_id_pkix_OCSP_trustRoot              375
-#define OBJ_id_pkix_OCSP_trustRoot              OBJ_id_pkix_OCSP,11L
-
-#define SN_algorithm            "algorithm"
-#define LN_algorithm            "algorithm"
-#define NID_algorithm           376
-#define OBJ_algorithm           1L,3L,14L,3L,2L
-
-#define SN_md5WithRSA           "RSA-NP-MD5"
-#define LN_md5WithRSA           "md5WithRSA"
-#define NID_md5WithRSA          104
-#define OBJ_md5WithRSA          OBJ_algorithm,3L
-
-#define SN_des_ecb              "DES-ECB"
-#define LN_des_ecb              "des-ecb"
-#define NID_des_ecb             29
-#define OBJ_des_ecb             OBJ_algorithm,6L
-
-#define SN_des_cbc              "DES-CBC"
-#define LN_des_cbc              "des-cbc"
-#define NID_des_cbc             31
-#define OBJ_des_cbc             OBJ_algorithm,7L
-
-#define SN_des_ofb64            "DES-OFB"
-#define LN_des_ofb64            "des-ofb"
-#define NID_des_ofb64           45
-#define OBJ_des_ofb64           OBJ_algorithm,8L
-
-#define SN_des_cfb64            "DES-CFB"
-#define LN_des_cfb64            "des-cfb"
-#define NID_des_cfb64           30
-#define OBJ_des_cfb64           OBJ_algorithm,9L
-
-#define SN_rsaSignature         "rsaSignature"
-#define NID_rsaSignature                377
-#define OBJ_rsaSignature                OBJ_algorithm,11L
-
-#define SN_dsa_2                "DSA-old"
-#define LN_dsa_2                "dsaEncryption-old"
-#define NID_dsa_2               67
-#define OBJ_dsa_2               OBJ_algorithm,12L
-
-#define SN_dsaWithSHA           "DSA-SHA"
-#define LN_dsaWithSHA           "dsaWithSHA"
-#define NID_dsaWithSHA          66
-#define OBJ_dsaWithSHA          OBJ_algorithm,13L
-
-#define SN_shaWithRSAEncryption         "RSA-SHA"
-#define LN_shaWithRSAEncryption         "shaWithRSAEncryption"
-#define NID_shaWithRSAEncryption                42
-#define OBJ_shaWithRSAEncryption                OBJ_algorithm,15L
-
-#define SN_des_ede_ecb          "DES-EDE"
-#define LN_des_ede_ecb          "des-ede"
-#define NID_des_ede_ecb         32
-#define OBJ_des_ede_ecb         OBJ_algorithm,17L
-
-#define SN_des_ede3_ecb         "DES-EDE3"
-#define LN_des_ede3_ecb         "des-ede3"
-#define NID_des_ede3_ecb                33
-
-#define SN_des_ede_cbc          "DES-EDE-CBC"
-#define LN_des_ede_cbc          "des-ede-cbc"
-#define NID_des_ede_cbc         43
-
-#define SN_des_ede_cfb64                "DES-EDE-CFB"
-#define LN_des_ede_cfb64                "des-ede-cfb"
-#define NID_des_ede_cfb64               60
-
-#define SN_des_ede3_cfb64               "DES-EDE3-CFB"
-#define LN_des_ede3_cfb64               "des-ede3-cfb"
-#define NID_des_ede3_cfb64              61
-
-#define SN_des_ede_ofb64                "DES-EDE-OFB"
-#define LN_des_ede_ofb64                "des-ede-ofb"
-#define NID_des_ede_ofb64               62
-
-#define SN_des_ede3_ofb64               "DES-EDE3-OFB"
-#define LN_des_ede3_ofb64               "des-ede3-ofb"
-#define NID_des_ede3_ofb64              63
-
-#define SN_desx_cbc             "DESX-CBC"
-#define LN_desx_cbc             "desx-cbc"
-#define NID_desx_cbc            80
-
-#define SN_sha          "SHA"
-#define LN_sha          "sha"
-#define NID_sha         41
-#define OBJ_sha         OBJ_algorithm,18L
-
-#define SN_sha1         "SHA1"
-#define LN_sha1         "sha1"
-#define NID_sha1                64
-#define OBJ_sha1                OBJ_algorithm,26L
-
-#define SN_dsaWithSHA1_2                "DSA-SHA1-old"
-#define LN_dsaWithSHA1_2                "dsaWithSHA1-old"
-#define NID_dsaWithSHA1_2               70
-#define OBJ_dsaWithSHA1_2               OBJ_algorithm,27L
-
-#define SN_sha1WithRSA          "RSA-SHA1-2"
-#define LN_sha1WithRSA          "sha1WithRSA"
-#define NID_sha1WithRSA         115
-#define OBJ_sha1WithRSA         OBJ_algorithm,29L
-
-#define SN_ripemd160            "RIPEMD160"
-#define LN_ripemd160            "ripemd160"
-#define NID_ripemd160           117
-#define OBJ_ripemd160           1L,3L,36L,3L,2L,1L
-
-#define SN_ripemd160WithRSA             "RSA-RIPEMD160"
-#define LN_ripemd160WithRSA             "ripemd160WithRSA"
-#define NID_ripemd160WithRSA            119
-#define OBJ_ripemd160WithRSA            1L,3L,36L,3L,3L,1L,2L
-
-#define SN_blake2bmac           "BLAKE2BMAC"
-#define LN_blake2bmac           "blake2bmac"
-#define NID_blake2bmac          1201
-#define OBJ_blake2bmac          1L,3L,6L,1L,4L,1L,1722L,12L,2L,1L
-
-#define SN_blake2smac           "BLAKE2SMAC"
-#define LN_blake2smac           "blake2smac"
-#define NID_blake2smac          1202
-#define OBJ_blake2smac          1L,3L,6L,1L,4L,1L,1722L,12L,2L,2L
-
-#define SN_blake2b512           "BLAKE2b512"
-#define LN_blake2b512           "blake2b512"
-#define NID_blake2b512          1056
-#define OBJ_blake2b512          OBJ_blake2bmac,16L
-
-#define SN_blake2s256           "BLAKE2s256"
-#define LN_blake2s256           "blake2s256"
-#define NID_blake2s256          1057
-#define OBJ_blake2s256          OBJ_blake2smac,8L
-
-#define SN_sxnet                "SXNetID"
-#define LN_sxnet                "Strong Extranet ID"
-#define NID_sxnet               143
-#define OBJ_sxnet               1L,3L,101L,1L,4L,1L
-
-#define SN_X500         "X500"
-#define LN_X500         "directory services (X.500)"
-#define NID_X500                11
-#define OBJ_X500                2L,5L
-
-#define SN_X509         "X509"
-#define NID_X509                12
-#define OBJ_X509                OBJ_X500,4L
-
-#define SN_commonName           "CN"
-#define LN_commonName           "commonName"
-#define NID_commonName          13
-#define OBJ_commonName          OBJ_X509,3L
-
-#define SN_surname              "SN"
-#define LN_surname              "surname"
-#define NID_surname             100
-#define OBJ_surname             OBJ_X509,4L
-
-#define LN_serialNumber         "serialNumber"
-#define NID_serialNumber                105
-#define OBJ_serialNumber                OBJ_X509,5L
-
-#define SN_countryName          "C"
-#define LN_countryName          "countryName"
-#define NID_countryName         14
-#define OBJ_countryName         OBJ_X509,6L
-
-#define SN_localityName         "L"
-#define LN_localityName         "localityName"
-#define NID_localityName                15
-#define OBJ_localityName                OBJ_X509,7L
-
-#define SN_stateOrProvinceName          "ST"
-#define LN_stateOrProvinceName          "stateOrProvinceName"
-#define NID_stateOrProvinceName         16
-#define OBJ_stateOrProvinceName         OBJ_X509,8L
-
-#define SN_streetAddress                "street"
-#define LN_streetAddress                "streetAddress"
-#define NID_streetAddress               660
-#define OBJ_streetAddress               OBJ_X509,9L
-
-#define SN_organizationName             "O"
-#define LN_organizationName             "organizationName"
-#define NID_organizationName            17
-#define OBJ_organizationName            OBJ_X509,10L
-
-#define SN_organizationalUnitName               "OU"
-#define LN_organizationalUnitName               "organizationalUnitName"
-#define NID_organizationalUnitName              18
-#define OBJ_organizationalUnitName              OBJ_X509,11L
-
-#define SN_title                "title"
-#define LN_title                "title"
-#define NID_title               106
-#define OBJ_title               OBJ_X509,12L
-
-#define LN_description          "description"
-#define NID_description         107
-#define OBJ_description         OBJ_X509,13L
-
-#define LN_searchGuide          "searchGuide"
-#define NID_searchGuide         859
-#define OBJ_searchGuide         OBJ_X509,14L
-
-#define LN_businessCategory             "businessCategory"
-#define NID_businessCategory            860
-#define OBJ_businessCategory            OBJ_X509,15L
-
-#define LN_postalAddress                "postalAddress"
-#define NID_postalAddress               861
-#define OBJ_postalAddress               OBJ_X509,16L
-
-#define LN_postalCode           "postalCode"
-#define NID_postalCode          661
-#define OBJ_postalCode          OBJ_X509,17L
-
-#define LN_postOfficeBox                "postOfficeBox"
-#define NID_postOfficeBox               862
-#define OBJ_postOfficeBox               OBJ_X509,18L
-
-#define LN_physicalDeliveryOfficeName           "physicalDeliveryOfficeName"
-#define NID_physicalDeliveryOfficeName          863
-#define OBJ_physicalDeliveryOfficeName          OBJ_X509,19L
-
-#define LN_telephoneNumber              "telephoneNumber"
-#define NID_telephoneNumber             864
-#define OBJ_telephoneNumber             OBJ_X509,20L
-
-#define LN_telexNumber          "telexNumber"
-#define NID_telexNumber         865
-#define OBJ_telexNumber         OBJ_X509,21L
-
-#define LN_teletexTerminalIdentifier            "teletexTerminalIdentifier"
-#define NID_teletexTerminalIdentifier           866
-#define OBJ_teletexTerminalIdentifier           OBJ_X509,22L
-
-#define LN_facsimileTelephoneNumber             "facsimileTelephoneNumber"
-#define NID_facsimileTelephoneNumber            867
-#define OBJ_facsimileTelephoneNumber            OBJ_X509,23L
-
-#define LN_x121Address          "x121Address"
-#define NID_x121Address         868
-#define OBJ_x121Address         OBJ_X509,24L
-
-#define LN_internationaliSDNNumber              "internationaliSDNNumber"
-#define NID_internationaliSDNNumber             869
-#define OBJ_internationaliSDNNumber             OBJ_X509,25L
-
-#define LN_registeredAddress            "registeredAddress"
-#define NID_registeredAddress           870
-#define OBJ_registeredAddress           OBJ_X509,26L
-
-#define LN_destinationIndicator         "destinationIndicator"
-#define NID_destinationIndicator                871
-#define OBJ_destinationIndicator                OBJ_X509,27L
-
-#define LN_preferredDeliveryMethod              "preferredDeliveryMethod"
-#define NID_preferredDeliveryMethod             872
-#define OBJ_preferredDeliveryMethod             OBJ_X509,28L
-
-#define LN_presentationAddress          "presentationAddress"
-#define NID_presentationAddress         873
-#define OBJ_presentationAddress         OBJ_X509,29L
-
-#define LN_supportedApplicationContext          "supportedApplicationContext"
-#define NID_supportedApplicationContext         874
-#define OBJ_supportedApplicationContext         OBJ_X509,30L
-
-#define SN_member               "member"
-#define NID_member              875
-#define OBJ_member              OBJ_X509,31L
-
-#define SN_owner                "owner"
-#define NID_owner               876
-#define OBJ_owner               OBJ_X509,32L
-
-#define LN_roleOccupant         "roleOccupant"
-#define NID_roleOccupant                877
-#define OBJ_roleOccupant                OBJ_X509,33L
-
-#define SN_seeAlso              "seeAlso"
-#define NID_seeAlso             878
-#define OBJ_seeAlso             OBJ_X509,34L
-
-#define LN_userPassword         "userPassword"
-#define NID_userPassword                879
-#define OBJ_userPassword                OBJ_X509,35L
-
-#define LN_userCertificate              "userCertificate"
-#define NID_userCertificate             880
-#define OBJ_userCertificate             OBJ_X509,36L
-
-#define LN_cACertificate                "cACertificate"
-#define NID_cACertificate               881
-#define OBJ_cACertificate               OBJ_X509,37L
-
-#define LN_authorityRevocationList              "authorityRevocationList"
-#define NID_authorityRevocationList             882
-#define OBJ_authorityRevocationList             OBJ_X509,38L
-
-#define LN_certificateRevocationList            "certificateRevocationList"
-#define NID_certificateRevocationList           883
-#define OBJ_certificateRevocationList           OBJ_X509,39L
-
-#define LN_crossCertificatePair         "crossCertificatePair"
-#define NID_crossCertificatePair                884
-#define OBJ_crossCertificatePair                OBJ_X509,40L
-
-#define SN_name         "name"
-#define LN_name         "name"
-#define NID_name                173
-#define OBJ_name                OBJ_X509,41L
-
-#define SN_givenName            "GN"
-#define LN_givenName            "givenName"
-#define NID_givenName           99
-#define OBJ_givenName           OBJ_X509,42L
-
-#define SN_initials             "initials"
-#define LN_initials             "initials"
-#define NID_initials            101
-#define OBJ_initials            OBJ_X509,43L
-
-#define LN_generationQualifier          "generationQualifier"
-#define NID_generationQualifier         509
-#define OBJ_generationQualifier         OBJ_X509,44L
-
-#define LN_x500UniqueIdentifier         "x500UniqueIdentifier"
-#define NID_x500UniqueIdentifier                503
-#define OBJ_x500UniqueIdentifier                OBJ_X509,45L
-
-#define SN_dnQualifier          "dnQualifier"
-#define LN_dnQualifier          "dnQualifier"
-#define NID_dnQualifier         174
-#define OBJ_dnQualifier         OBJ_X509,46L
-
-#define LN_enhancedSearchGuide          "enhancedSearchGuide"
-#define NID_enhancedSearchGuide         885
-#define OBJ_enhancedSearchGuide         OBJ_X509,47L
-
-#define LN_protocolInformation          "protocolInformation"
-#define NID_protocolInformation         886
-#define OBJ_protocolInformation         OBJ_X509,48L
-
-#define LN_distinguishedName            "distinguishedName"
-#define NID_distinguishedName           887
-#define OBJ_distinguishedName           OBJ_X509,49L
-
-#define LN_uniqueMember         "uniqueMember"
-#define NID_uniqueMember                888
-#define OBJ_uniqueMember                OBJ_X509,50L
-
-#define LN_houseIdentifier              "houseIdentifier"
-#define NID_houseIdentifier             889
-#define OBJ_houseIdentifier             OBJ_X509,51L
-
-#define LN_supportedAlgorithms          "supportedAlgorithms"
-#define NID_supportedAlgorithms         890
-#define OBJ_supportedAlgorithms         OBJ_X509,52L
-
-#define LN_deltaRevocationList          "deltaRevocationList"
-#define NID_deltaRevocationList         891
-#define OBJ_deltaRevocationList         OBJ_X509,53L
-
-#define SN_dmdName              "dmdName"
-#define NID_dmdName             892
-#define OBJ_dmdName             OBJ_X509,54L
-
-#define LN_pseudonym            "pseudonym"
-#define NID_pseudonym           510
-#define OBJ_pseudonym           OBJ_X509,65L
-
-#define SN_role         "role"
-#define LN_role         "role"
-#define NID_role                400
-#define OBJ_role                OBJ_X509,72L
-
-#define LN_organizationIdentifier               "organizationIdentifier"
-#define NID_organizationIdentifier              1089
-#define OBJ_organizationIdentifier              OBJ_X509,97L
-
-#define SN_countryCode3c                "c3"
-#define LN_countryCode3c                "countryCode3c"
-#define NID_countryCode3c               1090
-#define OBJ_countryCode3c               OBJ_X509,98L
-
-#define SN_countryCode3n                "n3"
-#define LN_countryCode3n                "countryCode3n"
-#define NID_countryCode3n               1091
-#define OBJ_countryCode3n               OBJ_X509,99L
-
-#define LN_dnsName              "dnsName"
-#define NID_dnsName             1092
-#define OBJ_dnsName             OBJ_X509,100L
-
-#define SN_X500algorithms               "X500algorithms"
-#define LN_X500algorithms               "directory services - algorithms"
-#define NID_X500algorithms              378
-#define OBJ_X500algorithms              OBJ_X500,8L
-
-#define SN_rsa          "RSA"
-#define LN_rsa          "rsa"
-#define NID_rsa         19
-#define OBJ_rsa         OBJ_X500algorithms,1L,1L
-
-#define SN_mdc2WithRSA          "RSA-MDC2"
-#define LN_mdc2WithRSA          "mdc2WithRSA"
-#define NID_mdc2WithRSA         96
-#define OBJ_mdc2WithRSA         OBJ_X500algorithms,3L,100L
-
-#define SN_mdc2         "MDC2"
-#define LN_mdc2         "mdc2"
-#define NID_mdc2                95
-#define OBJ_mdc2                OBJ_X500algorithms,3L,101L
-
-#define SN_id_ce                "id-ce"
-#define NID_id_ce               81
-#define OBJ_id_ce               OBJ_X500,29L
-
-#define SN_subject_directory_attributes         "subjectDirectoryAttributes"
-#define LN_subject_directory_attributes         "X509v3 Subject Directory Attributes"
-#define NID_subject_directory_attributes                769
-#define OBJ_subject_directory_attributes                OBJ_id_ce,9L
-
-#define SN_subject_key_identifier               "subjectKeyIdentifier"
-#define LN_subject_key_identifier               "X509v3 Subject Key Identifier"
-#define NID_subject_key_identifier              82
-#define OBJ_subject_key_identifier              OBJ_id_ce,14L
-
-#define SN_key_usage            "keyUsage"
-#define LN_key_usage            "X509v3 Key Usage"
-#define NID_key_usage           83
-#define OBJ_key_usage           OBJ_id_ce,15L
-
-#define SN_private_key_usage_period             "privateKeyUsagePeriod"
-#define LN_private_key_usage_period             "X509v3 Private Key Usage Period"
-#define NID_private_key_usage_period            84
-#define OBJ_private_key_usage_period            OBJ_id_ce,16L
-
-#define SN_subject_alt_name             "subjectAltName"
-#define LN_subject_alt_name             "X509v3 Subject Alternative Name"
-#define NID_subject_alt_name            85
-#define OBJ_subject_alt_name            OBJ_id_ce,17L
-
-#define SN_issuer_alt_name              "issuerAltName"
-#define LN_issuer_alt_name              "X509v3 Issuer Alternative Name"
-#define NID_issuer_alt_name             86
-#define OBJ_issuer_alt_name             OBJ_id_ce,18L
-
-#define SN_basic_constraints            "basicConstraints"
-#define LN_basic_constraints            "X509v3 Basic Constraints"
-#define NID_basic_constraints           87
-#define OBJ_basic_constraints           OBJ_id_ce,19L
-
-#define SN_crl_number           "crlNumber"
-#define LN_crl_number           "X509v3 CRL Number"
-#define NID_crl_number          88
-#define OBJ_crl_number          OBJ_id_ce,20L
-
-#define SN_crl_reason           "CRLReason"
-#define LN_crl_reason           "X509v3 CRL Reason Code"
-#define NID_crl_reason          141
-#define OBJ_crl_reason          OBJ_id_ce,21L
-
-#define SN_invalidity_date              "invalidityDate"
-#define LN_invalidity_date              "Invalidity Date"
-#define NID_invalidity_date             142
-#define OBJ_invalidity_date             OBJ_id_ce,24L
-
-#define SN_delta_crl            "deltaCRL"
-#define LN_delta_crl            "X509v3 Delta CRL Indicator"
-#define NID_delta_crl           140
-#define OBJ_delta_crl           OBJ_id_ce,27L
-
-#define SN_issuing_distribution_point           "issuingDistributionPoint"
-#define LN_issuing_distribution_point           "X509v3 Issuing Distribution Point"
-#define NID_issuing_distribution_point          770
-#define OBJ_issuing_distribution_point          OBJ_id_ce,28L
-
-#define SN_certificate_issuer           "certificateIssuer"
-#define LN_certificate_issuer           "X509v3 Certificate Issuer"
-#define NID_certificate_issuer          771
-#define OBJ_certificate_issuer          OBJ_id_ce,29L
-
-#define SN_name_constraints             "nameConstraints"
-#define LN_name_constraints             "X509v3 Name Constraints"
-#define NID_name_constraints            666
-#define OBJ_name_constraints            OBJ_id_ce,30L
-
-#define SN_crl_distribution_points              "crlDistributionPoints"
-#define LN_crl_distribution_points              "X509v3 CRL Distribution Points"
-#define NID_crl_distribution_points             103
-#define OBJ_crl_distribution_points             OBJ_id_ce,31L
-
-#define SN_certificate_policies         "certificatePolicies"
-#define LN_certificate_policies         "X509v3 Certificate Policies"
-#define NID_certificate_policies                89
-#define OBJ_certificate_policies                OBJ_id_ce,32L
-
-#define SN_any_policy           "anyPolicy"
-#define LN_any_policy           "X509v3 Any Policy"
-#define NID_any_policy          746
-#define OBJ_any_policy          OBJ_certificate_policies,0L
-
-#define SN_policy_mappings              "policyMappings"
-#define LN_policy_mappings              "X509v3 Policy Mappings"
-#define NID_policy_mappings             747
-#define OBJ_policy_mappings             OBJ_id_ce,33L
-
-#define SN_authority_key_identifier             "authorityKeyIdentifier"
-#define LN_authority_key_identifier             "X509v3 Authority Key Identifier"
-#define NID_authority_key_identifier            90
-#define OBJ_authority_key_identifier            OBJ_id_ce,35L
-
-#define SN_policy_constraints           "policyConstraints"
-#define LN_policy_constraints           "X509v3 Policy Constraints"
-#define NID_policy_constraints          401
-#define OBJ_policy_constraints          OBJ_id_ce,36L
-
-#define SN_ext_key_usage                "extendedKeyUsage"
-#define LN_ext_key_usage                "X509v3 Extended Key Usage"
-#define NID_ext_key_usage               126
-#define OBJ_ext_key_usage               OBJ_id_ce,37L
-
-#define SN_authority_attribute_identifier               "authorityAttributeIdentifier"
-#define LN_authority_attribute_identifier               "X509v3 Authority Attribute Identifier"
-#define NID_authority_attribute_identifier              1295
-#define OBJ_authority_attribute_identifier              OBJ_id_ce,38L
-
-#define SN_role_spec_cert_identifier            "roleSpecCertIdentifier"
-#define LN_role_spec_cert_identifier            "X509v3 Role Specification Certificate Identifier"
-#define NID_role_spec_cert_identifier           1296
-#define OBJ_role_spec_cert_identifier           OBJ_id_ce,39L
-
-#define SN_basic_att_constraints                "basicAttConstraints"
-#define LN_basic_att_constraints                "X509v3 Basic Attribute Certificate Constraints"
-#define NID_basic_att_constraints               1297
-#define OBJ_basic_att_constraints               OBJ_id_ce,41L
-
-#define SN_delegated_name_constraints           "delegatedNameConstraints"
-#define LN_delegated_name_constraints           "X509v3 Delegated Name Constraints"
-#define NID_delegated_name_constraints          1298
-#define OBJ_delegated_name_constraints          OBJ_id_ce,42L
-
-#define SN_time_specification           "timeSpecification"
-#define LN_time_specification           "X509v3 Time Specification"
-#define NID_time_specification          1299
-#define OBJ_time_specification          OBJ_id_ce,43L
-
-#define SN_freshest_crl         "freshestCRL"
-#define LN_freshest_crl         "X509v3 Freshest CRL"
-#define NID_freshest_crl                857
-#define OBJ_freshest_crl                OBJ_id_ce,46L
-
-#define SN_attribute_descriptor         "attributeDescriptor"
-#define LN_attribute_descriptor         "X509v3 Attribute Descriptor"
-#define NID_attribute_descriptor                1300
-#define OBJ_attribute_descriptor                OBJ_id_ce,48L
-
-#define SN_user_notice          "userNotice"
-#define LN_user_notice          "X509v3 User Notice"
-#define NID_user_notice         1301
-#define OBJ_user_notice         OBJ_id_ce,49L
-
-#define SN_soa_identifier               "sOAIdentifier"
-#define LN_soa_identifier               "X509v3 Source of Authority Identifier"
-#define NID_soa_identifier              1302
-#define OBJ_soa_identifier              OBJ_id_ce,50L
-
-#define SN_acceptable_cert_policies             "acceptableCertPolicies"
-#define LN_acceptable_cert_policies             "X509v3 Acceptable Certification Policies"
-#define NID_acceptable_cert_policies            1303
-#define OBJ_acceptable_cert_policies            OBJ_id_ce,52L
-
-#define SN_inhibit_any_policy           "inhibitAnyPolicy"
-#define LN_inhibit_any_policy           "X509v3 Inhibit Any Policy"
-#define NID_inhibit_any_policy          748
-#define OBJ_inhibit_any_policy          OBJ_id_ce,54L
-
-#define SN_target_information           "targetInformation"
-#define LN_target_information           "X509v3 AC Targeting"
-#define NID_target_information          402
-#define OBJ_target_information          OBJ_id_ce,55L
-
-#define SN_no_rev_avail         "noRevAvail"
-#define LN_no_rev_avail         "X509v3 No Revocation Available"
-#define NID_no_rev_avail                403
-#define OBJ_no_rev_avail                OBJ_id_ce,56L
-
-#define SN_acceptable_privilege_policies                "acceptablePrivPolicies"
-#define LN_acceptable_privilege_policies                "X509v3 Acceptable Privilege Policies"
-#define NID_acceptable_privilege_policies               1304
-#define OBJ_acceptable_privilege_policies               OBJ_id_ce,57L
-
-#define SN_indirect_issuer              "indirectIssuer"
-#define LN_indirect_issuer              "X509v3 Indirect Issuer"
-#define NID_indirect_issuer             1305
-#define OBJ_indirect_issuer             OBJ_id_ce,61L
-
-#define SN_no_assertion         "noAssertion"
-#define LN_no_assertion         "X509v3 No Assertion"
-#define NID_no_assertion                1306
-#define OBJ_no_assertion                OBJ_id_ce,62L
-
-#define SN_id_aa_issuing_distribution_point             "aAissuingDistributionPoint"
-#define LN_id_aa_issuing_distribution_point             "X509v3 Attribute Authority Issuing Distribution Point"
-#define NID_id_aa_issuing_distribution_point            1307
-#define OBJ_id_aa_issuing_distribution_point            OBJ_id_ce,63L
-
-#define SN_issued_on_behalf_of          "issuedOnBehalfOf"
-#define LN_issued_on_behalf_of          "X509v3 Issued On Behalf Of"
-#define NID_issued_on_behalf_of         1308
-#define OBJ_issued_on_behalf_of         OBJ_id_ce,64L
-
-#define SN_single_use           "singleUse"
-#define LN_single_use           "X509v3 Single Use"
-#define NID_single_use          1309
-#define OBJ_single_use          OBJ_id_ce,65L
-
-#define SN_group_ac             "groupAC"
-#define LN_group_ac             "X509v3 Group Attribute Certificate"
-#define NID_group_ac            1310
-#define OBJ_group_ac            OBJ_id_ce,66L
-
-#define SN_allowed_attribute_assignments                "allowedAttributeAssignments"
-#define LN_allowed_attribute_assignments                "X509v3 Allowed Attribute Assignments"
-#define NID_allowed_attribute_assignments               1311
-#define OBJ_allowed_attribute_assignments               OBJ_id_ce,67L
-
-#define SN_attribute_mappings           "attributeMappings"
-#define LN_attribute_mappings           "X509v3 Attribute Mappings"
-#define NID_attribute_mappings          1312
-#define OBJ_attribute_mappings          OBJ_id_ce,68L
-
-#define SN_holder_name_constraints              "holderNameConstraints"
-#define LN_holder_name_constraints              "X509v3 Holder Name Constraints"
-#define NID_holder_name_constraints             1313
-#define OBJ_holder_name_constraints             OBJ_id_ce,69L
-
-#define SN_authorization_validation             "authorizationValidation"
-#define LN_authorization_validation             "X509v3 Authorization Validation"
-#define NID_authorization_validation            1314
-#define OBJ_authorization_validation            OBJ_id_ce,70L
-
-#define SN_prot_restrict                "protRestrict"
-#define LN_prot_restrict                "X509v3 Protocol Restriction"
-#define NID_prot_restrict               1315
-#define OBJ_prot_restrict               OBJ_id_ce,71L
-
-#define SN_subject_alt_public_key_info          "subjectAltPublicKeyInfo"
-#define LN_subject_alt_public_key_info          "X509v3 Subject Alternative Public Key Info"
-#define NID_subject_alt_public_key_info         1316
-#define OBJ_subject_alt_public_key_info         OBJ_id_ce,72L
-
-#define SN_alt_signature_algorithm              "altSignatureAlgorithm"
-#define LN_alt_signature_algorithm              "X509v3 Alternative Signature Algorithm"
-#define NID_alt_signature_algorithm             1317
-#define OBJ_alt_signature_algorithm             OBJ_id_ce,73L
-
-#define SN_alt_signature_value          "altSignatureValue"
-#define LN_alt_signature_value          "X509v3 Alternative Signature Value"
-#define NID_alt_signature_value         1318
-#define OBJ_alt_signature_value         OBJ_id_ce,74L
-
-#define SN_associated_information               "associatedInformation"
-#define LN_associated_information               "X509v3 Associated Information"
-#define NID_associated_information              1319
-#define OBJ_associated_information              OBJ_id_ce,75L
-
-#define SN_anyExtendedKeyUsage          "anyExtendedKeyUsage"
-#define LN_anyExtendedKeyUsage          "Any Extended Key Usage"
-#define NID_anyExtendedKeyUsage         910
-#define OBJ_anyExtendedKeyUsage         OBJ_ext_key_usage,0L
-
-#define SN_netscape             "Netscape"
-#define LN_netscape             "Netscape Communications Corp."
-#define NID_netscape            57
-#define OBJ_netscape            2L,16L,840L,1L,113730L
-
-#define SN_netscape_cert_extension              "nsCertExt"
-#define LN_netscape_cert_extension              "Netscape Certificate Extension"
-#define NID_netscape_cert_extension             58
-#define OBJ_netscape_cert_extension             OBJ_netscape,1L
-
-#define SN_netscape_data_type           "nsDataType"
-#define LN_netscape_data_type           "Netscape Data Type"
-#define NID_netscape_data_type          59
-#define OBJ_netscape_data_type          OBJ_netscape,2L
-
-#define SN_netscape_cert_type           "nsCertType"
-#define LN_netscape_cert_type           "Netscape Cert Type"
-#define NID_netscape_cert_type          71
-#define OBJ_netscape_cert_type          OBJ_netscape_cert_extension,1L
-
-#define SN_netscape_base_url            "nsBaseUrl"
-#define LN_netscape_base_url            "Netscape Base Url"
-#define NID_netscape_base_url           72
-#define OBJ_netscape_base_url           OBJ_netscape_cert_extension,2L
-
-#define SN_netscape_revocation_url              "nsRevocationUrl"
-#define LN_netscape_revocation_url              "Netscape Revocation Url"
-#define NID_netscape_revocation_url             73
-#define OBJ_netscape_revocation_url             OBJ_netscape_cert_extension,3L
-
-#define SN_netscape_ca_revocation_url           "nsCaRevocationUrl"
-#define LN_netscape_ca_revocation_url           "Netscape CA Revocation Url"
-#define NID_netscape_ca_revocation_url          74
-#define OBJ_netscape_ca_revocation_url          OBJ_netscape_cert_extension,4L
-
-#define SN_netscape_renewal_url         "nsRenewalUrl"
-#define LN_netscape_renewal_url         "Netscape Renewal Url"
-#define NID_netscape_renewal_url                75
-#define OBJ_netscape_renewal_url                OBJ_netscape_cert_extension,7L
-
-#define SN_netscape_ca_policy_url               "nsCaPolicyUrl"
-#define LN_netscape_ca_policy_url               "Netscape CA Policy Url"
-#define NID_netscape_ca_policy_url              76
-#define OBJ_netscape_ca_policy_url              OBJ_netscape_cert_extension,8L
-
-#define SN_netscape_ssl_server_name             "nsSslServerName"
-#define LN_netscape_ssl_server_name             "Netscape SSL Server Name"
-#define NID_netscape_ssl_server_name            77
-#define OBJ_netscape_ssl_server_name            OBJ_netscape_cert_extension,12L
-
-#define SN_netscape_comment             "nsComment"
-#define LN_netscape_comment             "Netscape Comment"
-#define NID_netscape_comment            78
-#define OBJ_netscape_comment            OBJ_netscape_cert_extension,13L
-
-#define SN_netscape_cert_sequence               "nsCertSequence"
-#define LN_netscape_cert_sequence               "Netscape Certificate Sequence"
-#define NID_netscape_cert_sequence              79
-#define OBJ_netscape_cert_sequence              OBJ_netscape_data_type,5L
-
-#define SN_ns_sgc               "nsSGC"
-#define LN_ns_sgc               "Netscape Server Gated Crypto"
-#define NID_ns_sgc              139
-#define OBJ_ns_sgc              OBJ_netscape,4L,1L
-
-#define SN_org          "ORG"
-#define LN_org          "org"
-#define NID_org         379
-#define OBJ_org         OBJ_iso,3L
-
-#define SN_dod          "DOD"
-#define LN_dod          "dod"
-#define NID_dod         380
-#define OBJ_dod         OBJ_org,6L
-
-#define SN_iana         "IANA"
-#define LN_iana         "iana"
-#define NID_iana                381
-#define OBJ_iana                OBJ_dod,1L
-
-#define OBJ_internet            OBJ_iana
-
-#define SN_Directory            "directory"
-#define LN_Directory            "Directory"
-#define NID_Directory           382
-#define OBJ_Directory           OBJ_internet,1L
-
-#define SN_Management           "mgmt"
-#define LN_Management           "Management"
-#define NID_Management          383
-#define OBJ_Management          OBJ_internet,2L
-
-#define SN_Experimental         "experimental"
-#define LN_Experimental         "Experimental"
-#define NID_Experimental                384
-#define OBJ_Experimental                OBJ_internet,3L
-
-#define SN_Private              "private"
-#define LN_Private              "Private"
-#define NID_Private             385
-#define OBJ_Private             OBJ_internet,4L
-
-#define SN_Security             "security"
-#define LN_Security             "Security"
-#define NID_Security            386
-#define OBJ_Security            OBJ_internet,5L
-
-#define SN_SNMPv2               "snmpv2"
-#define LN_SNMPv2               "SNMPv2"
-#define NID_SNMPv2              387
-#define OBJ_SNMPv2              OBJ_internet,6L
-
-#define LN_Mail         "Mail"
-#define NID_Mail                388
-#define OBJ_Mail                OBJ_internet,7L
-
-#define SN_Enterprises          "enterprises"
-#define LN_Enterprises          "Enterprises"
-#define NID_Enterprises         389
-#define OBJ_Enterprises         OBJ_Private,1L
-
-#define SN_dcObject             "dcobject"
-#define LN_dcObject             "dcObject"
-#define NID_dcObject            390
-#define OBJ_dcObject            OBJ_Enterprises,1466L,344L
-
-#define SN_id_kp_wisun_fan_device               "id-kp-wisun-fan-device"
-#define LN_id_kp_wisun_fan_device               "Wi-SUN Alliance Field Area Network (FAN)"
-#define NID_id_kp_wisun_fan_device              1322
-#define OBJ_id_kp_wisun_fan_device              OBJ_Enterprises,45605L,1L
-
-#define SN_mime_mhs             "mime-mhs"
-#define LN_mime_mhs             "MIME MHS"
-#define NID_mime_mhs            504
-#define OBJ_mime_mhs            OBJ_Mail,1L
-
-#define SN_mime_mhs_headings            "mime-mhs-headings"
-#define LN_mime_mhs_headings            "mime-mhs-headings"
-#define NID_mime_mhs_headings           505
-#define OBJ_mime_mhs_headings           OBJ_mime_mhs,1L
-
-#define SN_mime_mhs_bodies              "mime-mhs-bodies"
-#define LN_mime_mhs_bodies              "mime-mhs-bodies"
-#define NID_mime_mhs_bodies             506
-#define OBJ_mime_mhs_bodies             OBJ_mime_mhs,2L
-
-#define SN_id_hex_partial_message               "id-hex-partial-message"
-#define LN_id_hex_partial_message               "id-hex-partial-message"
-#define NID_id_hex_partial_message              507
-#define OBJ_id_hex_partial_message              OBJ_mime_mhs_headings,1L
-
-#define SN_id_hex_multipart_message             "id-hex-multipart-message"
-#define LN_id_hex_multipart_message             "id-hex-multipart-message"
-#define NID_id_hex_multipart_message            508
-#define OBJ_id_hex_multipart_message            OBJ_mime_mhs_headings,2L
-
-#define SN_zlib_compression             "ZLIB"
-#define LN_zlib_compression             "zlib compression"
-#define NID_zlib_compression            125
-#define OBJ_zlib_compression            OBJ_id_smime_alg,8L
-
-#define OBJ_csor                2L,16L,840L,1L,101L,3L
-
-#define OBJ_nistAlgorithms              OBJ_csor,4L
-
-#define OBJ_aes         OBJ_nistAlgorithms,1L
-
-#define SN_aes_128_ecb          "AES-128-ECB"
-#define LN_aes_128_ecb          "aes-128-ecb"
-#define NID_aes_128_ecb         418
-#define OBJ_aes_128_ecb         OBJ_aes,1L
-
-#define SN_aes_128_cbc          "AES-128-CBC"
-#define LN_aes_128_cbc          "aes-128-cbc"
-#define NID_aes_128_cbc         419
-#define OBJ_aes_128_cbc         OBJ_aes,2L
-
-#define SN_aes_128_ofb128               "AES-128-OFB"
-#define LN_aes_128_ofb128               "aes-128-ofb"
-#define NID_aes_128_ofb128              420
-#define OBJ_aes_128_ofb128              OBJ_aes,3L
-
-#define SN_aes_128_cfb128               "AES-128-CFB"
-#define LN_aes_128_cfb128               "aes-128-cfb"
-#define NID_aes_128_cfb128              421
-#define OBJ_aes_128_cfb128              OBJ_aes,4L
-
-#define SN_id_aes128_wrap               "id-aes128-wrap"
-#define NID_id_aes128_wrap              788
-#define OBJ_id_aes128_wrap              OBJ_aes,5L
-
-#define SN_aes_128_gcm          "id-aes128-GCM"
-#define LN_aes_128_gcm          "aes-128-gcm"
-#define NID_aes_128_gcm         895
-#define OBJ_aes_128_gcm         OBJ_aes,6L
-
-#define SN_aes_128_ccm          "id-aes128-CCM"
-#define LN_aes_128_ccm          "aes-128-ccm"
-#define NID_aes_128_ccm         896
-#define OBJ_aes_128_ccm         OBJ_aes,7L
-
-#define SN_id_aes128_wrap_pad           "id-aes128-wrap-pad"
-#define NID_id_aes128_wrap_pad          897
-#define OBJ_id_aes128_wrap_pad          OBJ_aes,8L
-
-#define SN_aes_192_ecb          "AES-192-ECB"
-#define LN_aes_192_ecb          "aes-192-ecb"
-#define NID_aes_192_ecb         422
-#define OBJ_aes_192_ecb         OBJ_aes,21L
-
-#define SN_aes_192_cbc          "AES-192-CBC"
-#define LN_aes_192_cbc          "aes-192-cbc"
-#define NID_aes_192_cbc         423
-#define OBJ_aes_192_cbc         OBJ_aes,22L
-
-#define SN_aes_192_ofb128               "AES-192-OFB"
-#define LN_aes_192_ofb128               "aes-192-ofb"
-#define NID_aes_192_ofb128              424
-#define OBJ_aes_192_ofb128              OBJ_aes,23L
-
-#define SN_aes_192_cfb128               "AES-192-CFB"
-#define LN_aes_192_cfb128               "aes-192-cfb"
-#define NID_aes_192_cfb128              425
-#define OBJ_aes_192_cfb128              OBJ_aes,24L
-
-#define SN_id_aes192_wrap               "id-aes192-wrap"
-#define NID_id_aes192_wrap              789
-#define OBJ_id_aes192_wrap              OBJ_aes,25L
-
-#define SN_aes_192_gcm          "id-aes192-GCM"
-#define LN_aes_192_gcm          "aes-192-gcm"
-#define NID_aes_192_gcm         898
-#define OBJ_aes_192_gcm         OBJ_aes,26L
-
-#define SN_aes_192_ccm          "id-aes192-CCM"
-#define LN_aes_192_ccm          "aes-192-ccm"
-#define NID_aes_192_ccm         899
-#define OBJ_aes_192_ccm         OBJ_aes,27L
-
-#define SN_id_aes192_wrap_pad           "id-aes192-wrap-pad"
-#define NID_id_aes192_wrap_pad          900
-#define OBJ_id_aes192_wrap_pad          OBJ_aes,28L
-
-#define SN_aes_256_ecb          "AES-256-ECB"
-#define LN_aes_256_ecb          "aes-256-ecb"
-#define NID_aes_256_ecb         426
-#define OBJ_aes_256_ecb         OBJ_aes,41L
-
-#define SN_aes_256_cbc          "AES-256-CBC"
-#define LN_aes_256_cbc          "aes-256-cbc"
-#define NID_aes_256_cbc         427
-#define OBJ_aes_256_cbc         OBJ_aes,42L
-
-#define SN_aes_256_ofb128               "AES-256-OFB"
-#define LN_aes_256_ofb128               "aes-256-ofb"
-#define NID_aes_256_ofb128              428
-#define OBJ_aes_256_ofb128              OBJ_aes,43L
-
-#define SN_aes_256_cfb128               "AES-256-CFB"
-#define LN_aes_256_cfb128               "aes-256-cfb"
-#define NID_aes_256_cfb128              429
-#define OBJ_aes_256_cfb128              OBJ_aes,44L
-
-#define SN_id_aes256_wrap               "id-aes256-wrap"
-#define NID_id_aes256_wrap              790
-#define OBJ_id_aes256_wrap              OBJ_aes,45L
-
-#define SN_aes_256_gcm          "id-aes256-GCM"
-#define LN_aes_256_gcm          "aes-256-gcm"
-#define NID_aes_256_gcm         901
-#define OBJ_aes_256_gcm         OBJ_aes,46L
-
-#define SN_aes_256_ccm          "id-aes256-CCM"
-#define LN_aes_256_ccm          "aes-256-ccm"
-#define NID_aes_256_ccm         902
-#define OBJ_aes_256_ccm         OBJ_aes,47L
-
-#define SN_id_aes256_wrap_pad           "id-aes256-wrap-pad"
-#define NID_id_aes256_wrap_pad          903
-#define OBJ_id_aes256_wrap_pad          OBJ_aes,48L
-
-#define SN_aes_128_xts          "AES-128-XTS"
-#define LN_aes_128_xts          "aes-128-xts"
-#define NID_aes_128_xts         913
-#define OBJ_aes_128_xts         OBJ_ieee_siswg,0L,1L,1L
-
-#define SN_aes_256_xts          "AES-256-XTS"
-#define LN_aes_256_xts          "aes-256-xts"
-#define NID_aes_256_xts         914
-#define OBJ_aes_256_xts         OBJ_ieee_siswg,0L,1L,2L
-
-#define SN_aes_128_cfb1         "AES-128-CFB1"
-#define LN_aes_128_cfb1         "aes-128-cfb1"
-#define NID_aes_128_cfb1                650
-
-#define SN_aes_192_cfb1         "AES-192-CFB1"
-#define LN_aes_192_cfb1         "aes-192-cfb1"
-#define NID_aes_192_cfb1                651
-
-#define SN_aes_256_cfb1         "AES-256-CFB1"
-#define LN_aes_256_cfb1         "aes-256-cfb1"
-#define NID_aes_256_cfb1                652
-
-#define SN_aes_128_cfb8         "AES-128-CFB8"
-#define LN_aes_128_cfb8         "aes-128-cfb8"
-#define NID_aes_128_cfb8                653
-
-#define SN_aes_192_cfb8         "AES-192-CFB8"
-#define LN_aes_192_cfb8         "aes-192-cfb8"
-#define NID_aes_192_cfb8                654
-
-#define SN_aes_256_cfb8         "AES-256-CFB8"
-#define LN_aes_256_cfb8         "aes-256-cfb8"
-#define NID_aes_256_cfb8                655
-
-#define SN_aes_128_ctr          "AES-128-CTR"
-#define LN_aes_128_ctr          "aes-128-ctr"
-#define NID_aes_128_ctr         904
-
-#define SN_aes_192_ctr          "AES-192-CTR"
-#define LN_aes_192_ctr          "aes-192-ctr"
-#define NID_aes_192_ctr         905
-
-#define SN_aes_256_ctr          "AES-256-CTR"
-#define LN_aes_256_ctr          "aes-256-ctr"
-#define NID_aes_256_ctr         906
-
-#define SN_aes_128_ocb          "AES-128-OCB"
-#define LN_aes_128_ocb          "aes-128-ocb"
-#define NID_aes_128_ocb         958
-
-#define SN_aes_192_ocb          "AES-192-OCB"
-#define LN_aes_192_ocb          "aes-192-ocb"
-#define NID_aes_192_ocb         959
-
-#define SN_aes_256_ocb          "AES-256-OCB"
-#define LN_aes_256_ocb          "aes-256-ocb"
-#define NID_aes_256_ocb         960
-
-#define SN_des_cfb1             "DES-CFB1"
-#define LN_des_cfb1             "des-cfb1"
-#define NID_des_cfb1            656
-
-#define SN_des_cfb8             "DES-CFB8"
-#define LN_des_cfb8             "des-cfb8"
-#define NID_des_cfb8            657
-
-#define SN_des_ede3_cfb1                "DES-EDE3-CFB1"
-#define LN_des_ede3_cfb1                "des-ede3-cfb1"
-#define NID_des_ede3_cfb1               658
-
-#define SN_des_ede3_cfb8                "DES-EDE3-CFB8"
-#define LN_des_ede3_cfb8                "des-ede3-cfb8"
-#define NID_des_ede3_cfb8               659
-
-#define OBJ_nist_hashalgs               OBJ_nistAlgorithms,2L
-
-#define SN_sha256               "SHA256"
-#define LN_sha256               "sha256"
-#define NID_sha256              672
-#define OBJ_sha256              OBJ_nist_hashalgs,1L
-
-#define SN_sha384               "SHA384"
-#define LN_sha384               "sha384"
-#define NID_sha384              673
-#define OBJ_sha384              OBJ_nist_hashalgs,2L
-
-#define SN_sha512               "SHA512"
-#define LN_sha512               "sha512"
-#define NID_sha512              674
-#define OBJ_sha512              OBJ_nist_hashalgs,3L
-
-#define SN_sha224               "SHA224"
-#define LN_sha224               "sha224"
-#define NID_sha224              675
-#define OBJ_sha224              OBJ_nist_hashalgs,4L
-
-#define SN_sha512_224           "SHA512-224"
-#define LN_sha512_224           "sha512-224"
-#define NID_sha512_224          1094
-#define OBJ_sha512_224          OBJ_nist_hashalgs,5L
-
-#define SN_sha512_256           "SHA512-256"
-#define LN_sha512_256           "sha512-256"
-#define NID_sha512_256          1095
-#define OBJ_sha512_256          OBJ_nist_hashalgs,6L
-
-#define SN_sha3_224             "SHA3-224"
-#define LN_sha3_224             "sha3-224"
-#define NID_sha3_224            1096
-#define OBJ_sha3_224            OBJ_nist_hashalgs,7L
-
-#define SN_sha3_256             "SHA3-256"
-#define LN_sha3_256             "sha3-256"
-#define NID_sha3_256            1097
-#define OBJ_sha3_256            OBJ_nist_hashalgs,8L
-
-#define SN_sha3_384             "SHA3-384"
-#define LN_sha3_384             "sha3-384"
-#define NID_sha3_384            1098
-#define OBJ_sha3_384            OBJ_nist_hashalgs,9L
-
-#define SN_sha3_512             "SHA3-512"
-#define LN_sha3_512             "sha3-512"
-#define NID_sha3_512            1099
-#define OBJ_sha3_512            OBJ_nist_hashalgs,10L
-
-#define SN_shake128             "SHAKE128"
-#define LN_shake128             "shake128"
-#define NID_shake128            1100
-#define OBJ_shake128            OBJ_nist_hashalgs,11L
-
-#define SN_shake256             "SHAKE256"
-#define LN_shake256             "shake256"
-#define NID_shake256            1101
-#define OBJ_shake256            OBJ_nist_hashalgs,12L
-
-#define SN_hmac_sha3_224                "id-hmacWithSHA3-224"
-#define LN_hmac_sha3_224                "hmac-sha3-224"
-#define NID_hmac_sha3_224               1102
-#define OBJ_hmac_sha3_224               OBJ_nist_hashalgs,13L
-
-#define SN_hmac_sha3_256                "id-hmacWithSHA3-256"
-#define LN_hmac_sha3_256                "hmac-sha3-256"
-#define NID_hmac_sha3_256               1103
-#define OBJ_hmac_sha3_256               OBJ_nist_hashalgs,14L
-
-#define SN_hmac_sha3_384                "id-hmacWithSHA3-384"
-#define LN_hmac_sha3_384                "hmac-sha3-384"
-#define NID_hmac_sha3_384               1104
-#define OBJ_hmac_sha3_384               OBJ_nist_hashalgs,15L
-
-#define SN_hmac_sha3_512                "id-hmacWithSHA3-512"
-#define LN_hmac_sha3_512                "hmac-sha3-512"
-#define NID_hmac_sha3_512               1105
-#define OBJ_hmac_sha3_512               OBJ_nist_hashalgs,16L
-
-#define SN_kmac128              "KMAC128"
-#define LN_kmac128              "kmac128"
-#define NID_kmac128             1196
-#define OBJ_kmac128             OBJ_nist_hashalgs,19L
-
-#define SN_kmac256              "KMAC256"
-#define LN_kmac256              "kmac256"
-#define NID_kmac256             1197
-#define OBJ_kmac256             OBJ_nist_hashalgs,20L
-
-#define OBJ_dsa_with_sha2               OBJ_nistAlgorithms,3L
-
-#define SN_dsa_with_SHA224              "dsa_with_SHA224"
-#define NID_dsa_with_SHA224             802
-#define OBJ_dsa_with_SHA224             OBJ_dsa_with_sha2,1L
-
-#define SN_dsa_with_SHA256              "dsa_with_SHA256"
-#define NID_dsa_with_SHA256             803
-#define OBJ_dsa_with_SHA256             OBJ_dsa_with_sha2,2L
-
-#define OBJ_sigAlgs             OBJ_nistAlgorithms,3L
-
-#define SN_dsa_with_SHA384              "id-dsa-with-sha384"
-#define LN_dsa_with_SHA384              "dsa_with_SHA384"
-#define NID_dsa_with_SHA384             1106
-#define OBJ_dsa_with_SHA384             OBJ_sigAlgs,3L
-
-#define SN_dsa_with_SHA512              "id-dsa-with-sha512"
-#define LN_dsa_with_SHA512              "dsa_with_SHA512"
-#define NID_dsa_with_SHA512             1107
-#define OBJ_dsa_with_SHA512             OBJ_sigAlgs,4L
-
-#define SN_dsa_with_SHA3_224            "id-dsa-with-sha3-224"
-#define LN_dsa_with_SHA3_224            "dsa_with_SHA3-224"
-#define NID_dsa_with_SHA3_224           1108
-#define OBJ_dsa_with_SHA3_224           OBJ_sigAlgs,5L
-
-#define SN_dsa_with_SHA3_256            "id-dsa-with-sha3-256"
-#define LN_dsa_with_SHA3_256            "dsa_with_SHA3-256"
-#define NID_dsa_with_SHA3_256           1109
-#define OBJ_dsa_with_SHA3_256           OBJ_sigAlgs,6L
-
-#define SN_dsa_with_SHA3_384            "id-dsa-with-sha3-384"
-#define LN_dsa_with_SHA3_384            "dsa_with_SHA3-384"
-#define NID_dsa_with_SHA3_384           1110
-#define OBJ_dsa_with_SHA3_384           OBJ_sigAlgs,7L
-
-#define SN_dsa_with_SHA3_512            "id-dsa-with-sha3-512"
-#define LN_dsa_with_SHA3_512            "dsa_with_SHA3-512"
-#define NID_dsa_with_SHA3_512           1111
-#define OBJ_dsa_with_SHA3_512           OBJ_sigAlgs,8L
-
-#define SN_ecdsa_with_SHA3_224          "id-ecdsa-with-sha3-224"
-#define LN_ecdsa_with_SHA3_224          "ecdsa_with_SHA3-224"
-#define NID_ecdsa_with_SHA3_224         1112
-#define OBJ_ecdsa_with_SHA3_224         OBJ_sigAlgs,9L
-
-#define SN_ecdsa_with_SHA3_256          "id-ecdsa-with-sha3-256"
-#define LN_ecdsa_with_SHA3_256          "ecdsa_with_SHA3-256"
-#define NID_ecdsa_with_SHA3_256         1113
-#define OBJ_ecdsa_with_SHA3_256         OBJ_sigAlgs,10L
-
-#define SN_ecdsa_with_SHA3_384          "id-ecdsa-with-sha3-384"
-#define LN_ecdsa_with_SHA3_384          "ecdsa_with_SHA3-384"
-#define NID_ecdsa_with_SHA3_384         1114
-#define OBJ_ecdsa_with_SHA3_384         OBJ_sigAlgs,11L
-
-#define SN_ecdsa_with_SHA3_512          "id-ecdsa-with-sha3-512"
-#define LN_ecdsa_with_SHA3_512          "ecdsa_with_SHA3-512"
-#define NID_ecdsa_with_SHA3_512         1115
-#define OBJ_ecdsa_with_SHA3_512         OBJ_sigAlgs,12L
-
-#define SN_RSA_SHA3_224         "id-rsassa-pkcs1-v1_5-with-sha3-224"
-#define LN_RSA_SHA3_224         "RSA-SHA3-224"
-#define NID_RSA_SHA3_224                1116
-#define OBJ_RSA_SHA3_224                OBJ_sigAlgs,13L
-
-#define SN_RSA_SHA3_256         "id-rsassa-pkcs1-v1_5-with-sha3-256"
-#define LN_RSA_SHA3_256         "RSA-SHA3-256"
-#define NID_RSA_SHA3_256                1117
-#define OBJ_RSA_SHA3_256                OBJ_sigAlgs,14L
-
-#define SN_RSA_SHA3_384         "id-rsassa-pkcs1-v1_5-with-sha3-384"
-#define LN_RSA_SHA3_384         "RSA-SHA3-384"
-#define NID_RSA_SHA3_384                1118
-#define OBJ_RSA_SHA3_384                OBJ_sigAlgs,15L
-
-#define SN_RSA_SHA3_512         "id-rsassa-pkcs1-v1_5-with-sha3-512"
-#define LN_RSA_SHA3_512         "RSA-SHA3-512"
-#define NID_RSA_SHA3_512                1119
-#define OBJ_RSA_SHA3_512                OBJ_sigAlgs,16L
-
-#define SN_ML_DSA_44            "id-ml-dsa-44"
-#define LN_ML_DSA_44            "ML-DSA-44"
-#define NID_ML_DSA_44           1457
-#define OBJ_ML_DSA_44           OBJ_sigAlgs,17L
-
-#define SN_ML_DSA_65            "id-ml-dsa-65"
-#define LN_ML_DSA_65            "ML-DSA-65"
-#define NID_ML_DSA_65           1458
-#define OBJ_ML_DSA_65           OBJ_sigAlgs,18L
-
-#define SN_ML_DSA_87            "id-ml-dsa-87"
-#define LN_ML_DSA_87            "ML-DSA-87"
-#define NID_ML_DSA_87           1459
-#define OBJ_ML_DSA_87           OBJ_sigAlgs,19L
-
-#define SN_SLH_DSA_SHA2_128s            "id-slh-dsa-sha2-128s"
-#define LN_SLH_DSA_SHA2_128s            "SLH-DSA-SHA2-128s"
-#define NID_SLH_DSA_SHA2_128s           1460
-#define OBJ_SLH_DSA_SHA2_128s           OBJ_sigAlgs,20L
-
-#define SN_SLH_DSA_SHA2_128f            "id-slh-dsa-sha2-128f"
-#define LN_SLH_DSA_SHA2_128f            "SLH-DSA-SHA2-128f"
-#define NID_SLH_DSA_SHA2_128f           1461
-#define OBJ_SLH_DSA_SHA2_128f           OBJ_sigAlgs,21L
-
-#define SN_SLH_DSA_SHA2_192s            "id-slh-dsa-sha2-192s"
-#define LN_SLH_DSA_SHA2_192s            "SLH-DSA-SHA2-192s"
-#define NID_SLH_DSA_SHA2_192s           1462
-#define OBJ_SLH_DSA_SHA2_192s           OBJ_sigAlgs,22L
-
-#define SN_SLH_DSA_SHA2_192f            "id-slh-dsa-sha2-192f"
-#define LN_SLH_DSA_SHA2_192f            "SLH-DSA-SHA2-192f"
-#define NID_SLH_DSA_SHA2_192f           1463
-#define OBJ_SLH_DSA_SHA2_192f           OBJ_sigAlgs,23L
-
-#define SN_SLH_DSA_SHA2_256s            "id-slh-dsa-sha2-256s"
-#define LN_SLH_DSA_SHA2_256s            "SLH-DSA-SHA2-256s"
-#define NID_SLH_DSA_SHA2_256s           1464
-#define OBJ_SLH_DSA_SHA2_256s           OBJ_sigAlgs,24L
-
-#define SN_SLH_DSA_SHA2_256f            "id-slh-dsa-sha2-256f"
-#define LN_SLH_DSA_SHA2_256f            "SLH-DSA-SHA2-256f"
-#define NID_SLH_DSA_SHA2_256f           1465
-#define OBJ_SLH_DSA_SHA2_256f           OBJ_sigAlgs,25L
-
-#define SN_SLH_DSA_SHAKE_128s           "id-slh-dsa-shake-128s"
-#define LN_SLH_DSA_SHAKE_128s           "SLH-DSA-SHAKE-128s"
-#define NID_SLH_DSA_SHAKE_128s          1466
-#define OBJ_SLH_DSA_SHAKE_128s          OBJ_sigAlgs,26L
-
-#define SN_SLH_DSA_SHAKE_128f           "id-slh-dsa-shake-128f"
-#define LN_SLH_DSA_SHAKE_128f           "SLH-DSA-SHAKE-128f"
-#define NID_SLH_DSA_SHAKE_128f          1467
-#define OBJ_SLH_DSA_SHAKE_128f          OBJ_sigAlgs,27L
-
-#define SN_SLH_DSA_SHAKE_192s           "id-slh-dsa-shake-192s"
-#define LN_SLH_DSA_SHAKE_192s           "SLH-DSA-SHAKE-192s"
-#define NID_SLH_DSA_SHAKE_192s          1468
-#define OBJ_SLH_DSA_SHAKE_192s          OBJ_sigAlgs,28L
-
-#define SN_SLH_DSA_SHAKE_192f           "id-slh-dsa-shake-192f"
-#define LN_SLH_DSA_SHAKE_192f           "SLH-DSA-SHAKE-192f"
-#define NID_SLH_DSA_SHAKE_192f          1469
-#define OBJ_SLH_DSA_SHAKE_192f          OBJ_sigAlgs,29L
-
-#define SN_SLH_DSA_SHAKE_256s           "id-slh-dsa-shake-256s"
-#define LN_SLH_DSA_SHAKE_256s           "SLH-DSA-SHAKE-256s"
-#define NID_SLH_DSA_SHAKE_256s          1470
-#define OBJ_SLH_DSA_SHAKE_256s          OBJ_sigAlgs,30L
-
-#define SN_SLH_DSA_SHAKE_256f           "id-slh-dsa-shake-256f"
-#define LN_SLH_DSA_SHAKE_256f           "SLH-DSA-SHAKE-256f"
-#define NID_SLH_DSA_SHAKE_256f          1471
-#define OBJ_SLH_DSA_SHAKE_256f          OBJ_sigAlgs,31L
-
-#define SN_HASH_ML_DSA_44_WITH_SHA512           "id-hash-ml-dsa-44-with-sha512"
-#define LN_HASH_ML_DSA_44_WITH_SHA512           "HASH-ML-DSA-44-WITH-SHA512"
-#define NID_HASH_ML_DSA_44_WITH_SHA512          1472
-#define OBJ_HASH_ML_DSA_44_WITH_SHA512          OBJ_sigAlgs,32L
-
-#define SN_HASH_ML_DSA_65_WITH_SHA512           "id-hash-ml-dsa-65-with-sha512"
-#define LN_HASH_ML_DSA_65_WITH_SHA512           "HASH-ML-DSA-65-WITH-SHA512"
-#define NID_HASH_ML_DSA_65_WITH_SHA512          1473
-#define OBJ_HASH_ML_DSA_65_WITH_SHA512          OBJ_sigAlgs,33L
-
-#define SN_HASH_ML_DSA_87_WITH_SHA512           "id-hash-ml-dsa-87-with-sha512"
-#define LN_HASH_ML_DSA_87_WITH_SHA512           "HASH-ML-DSA-87-WITH-SHA512"
-#define NID_HASH_ML_DSA_87_WITH_SHA512          1474
-#define OBJ_HASH_ML_DSA_87_WITH_SHA512          OBJ_sigAlgs,34L
-
-#define SN_SLH_DSA_SHA2_128s_WITH_SHA256                "id-hash-slh-dsa-sha2-128s-with-sha256"
-#define LN_SLH_DSA_SHA2_128s_WITH_SHA256                "SLH-DSA-SHA2-128s-WITH-SHA256"
-#define NID_SLH_DSA_SHA2_128s_WITH_SHA256               1475
-#define OBJ_SLH_DSA_SHA2_128s_WITH_SHA256               OBJ_sigAlgs,35L
-
-#define SN_SLH_DSA_SHA2_128f_WITH_SHA256                "id-hash-slh-dsa-sha2-128f-with-sha256"
-#define LN_SLH_DSA_SHA2_128f_WITH_SHA256                "SLH-DSA-SHA2-128f-WITH-SHA256"
-#define NID_SLH_DSA_SHA2_128f_WITH_SHA256               1476
-#define OBJ_SLH_DSA_SHA2_128f_WITH_SHA256               OBJ_sigAlgs,36L
-
-#define SN_SLH_DSA_SHA2_192s_WITH_SHA512                "id-hash-slh-dsa-sha2-192s-with-sha512"
-#define LN_SLH_DSA_SHA2_192s_WITH_SHA512                "SLH-DSA-SHA2-192s-WITH-SHA512"
-#define NID_SLH_DSA_SHA2_192s_WITH_SHA512               1477
-#define OBJ_SLH_DSA_SHA2_192s_WITH_SHA512               OBJ_sigAlgs,37L
-
-#define SN_SLH_DSA_SHA2_192f_WITH_SHA512                "id-hash-slh-dsa-sha2-192f-with-sha512"
-#define LN_SLH_DSA_SHA2_192f_WITH_SHA512                "SLH-DSA-SHA2-192f-WITH-SHA512"
-#define NID_SLH_DSA_SHA2_192f_WITH_SHA512               1478
-#define OBJ_SLH_DSA_SHA2_192f_WITH_SHA512               OBJ_sigAlgs,38L
-
-#define SN_SLH_DSA_SHA2_256s_WITH_SHA512                "id-hash-slh-dsa-sha2-256s-with-sha512"
-#define LN_SLH_DSA_SHA2_256s_WITH_SHA512                "SLH-DSA-SHA2-256s-WITH-SHA512"
-#define NID_SLH_DSA_SHA2_256s_WITH_SHA512               1479
-#define OBJ_SLH_DSA_SHA2_256s_WITH_SHA512               OBJ_sigAlgs,39L
-
-#define SN_SLH_DSA_SHA2_256f_WITH_SHA512                "id-hash-slh-dsa-sha2-256f-with-sha512"
-#define LN_SLH_DSA_SHA2_256f_WITH_SHA512                "SLH-DSA-SHA2-256f-WITH-SHA512"
-#define NID_SLH_DSA_SHA2_256f_WITH_SHA512               1480
-#define OBJ_SLH_DSA_SHA2_256f_WITH_SHA512               OBJ_sigAlgs,40L
-
-#define SN_SLH_DSA_SHAKE_128s_WITH_SHAKE128             "id-hash-slh-dsa-shake-128s-with-shake128"
-#define LN_SLH_DSA_SHAKE_128s_WITH_SHAKE128             "SLH-DSA-SHAKE-128s-WITH-SHAKE128"
-#define NID_SLH_DSA_SHAKE_128s_WITH_SHAKE128            1481
-#define OBJ_SLH_DSA_SHAKE_128s_WITH_SHAKE128            OBJ_sigAlgs,41L
-
-#define SN_SLH_DSA_SHAKE_128f_WITH_SHAKE128             "id-hash-slh-dsa-shake-128f-with-shake128"
-#define LN_SLH_DSA_SHAKE_128f_WITH_SHAKE128             "SLH-DSA-SHAKE-128f-WITH-SHAKE128"
-#define NID_SLH_DSA_SHAKE_128f_WITH_SHAKE128            1482
-#define OBJ_SLH_DSA_SHAKE_128f_WITH_SHAKE128            OBJ_sigAlgs,42L
-
-#define SN_SLH_DSA_SHAKE_192s_WITH_SHAKE256             "id-hash-slh-dsa-shake-192s-with-shake256"
-#define LN_SLH_DSA_SHAKE_192s_WITH_SHAKE256             "SLH-DSA-SHAKE-192s-WITH-SHAKE256"
-#define NID_SLH_DSA_SHAKE_192s_WITH_SHAKE256            1483
-#define OBJ_SLH_DSA_SHAKE_192s_WITH_SHAKE256            OBJ_sigAlgs,43L
-
-#define SN_SLH_DSA_SHAKE_192f_WITH_SHAKE256             "id-hash-slh-dsa-shake-192f-with-shake256"
-#define LN_SLH_DSA_SHAKE_192f_WITH_SHAKE256             "SLH-DSA-SHAKE-192f-WITH-SHAKE256"
-#define NID_SLH_DSA_SHAKE_192f_WITH_SHAKE256            1484
-#define OBJ_SLH_DSA_SHAKE_192f_WITH_SHAKE256            OBJ_sigAlgs,44L
-
-#define SN_SLH_DSA_SHAKE_256s_WITH_SHAKE256             "id-hash-slh-dsa-shake-256s-with-shake256"
-#define LN_SLH_DSA_SHAKE_256s_WITH_SHAKE256             "SLH-DSA-SHAKE-256s-WITH-SHAKE256"
-#define NID_SLH_DSA_SHAKE_256s_WITH_SHAKE256            1485
-#define OBJ_SLH_DSA_SHAKE_256s_WITH_SHAKE256            OBJ_sigAlgs,45L
-
-#define SN_SLH_DSA_SHAKE_256f_WITH_SHAKE256             "id-hash-slh-dsa-shake-256f-with-shake256"
-#define LN_SLH_DSA_SHAKE_256f_WITH_SHAKE256             "SLH-DSA-SHAKE-256f-WITH-SHAKE256"
-#define NID_SLH_DSA_SHAKE_256f_WITH_SHAKE256            1486
-#define OBJ_SLH_DSA_SHAKE_256f_WITH_SHAKE256            OBJ_sigAlgs,46L
-
-#define SN_hold_instruction_code                "holdInstructionCode"
-#define LN_hold_instruction_code                "Hold Instruction Code"
-#define NID_hold_instruction_code               430
-#define OBJ_hold_instruction_code               OBJ_id_ce,23L
-
-#define OBJ_holdInstruction             OBJ_X9_57,2L
-
-#define SN_hold_instruction_none                "holdInstructionNone"
-#define LN_hold_instruction_none                "Hold Instruction None"
-#define NID_hold_instruction_none               431
-#define OBJ_hold_instruction_none               OBJ_holdInstruction,1L
-
-#define SN_hold_instruction_call_issuer         "holdInstructionCallIssuer"
-#define LN_hold_instruction_call_issuer         "Hold Instruction Call Issuer"
-#define NID_hold_instruction_call_issuer                432
-#define OBJ_hold_instruction_call_issuer                OBJ_holdInstruction,2L
-
-#define SN_hold_instruction_reject              "holdInstructionReject"
-#define LN_hold_instruction_reject              "Hold Instruction Reject"
-#define NID_hold_instruction_reject             433
-#define OBJ_hold_instruction_reject             OBJ_holdInstruction,3L
-
-#define SN_itu_t_identified_organization                "itu-t-identified-organization"
-#define NID_itu_t_identified_organization               1264
-#define OBJ_itu_t_identified_organization               OBJ_itu_t,4L
-
-#define SN_etsi         "etsi"
-#define NID_etsi                1265
-#define OBJ_etsi                OBJ_itu_t_identified_organization,0L
-
-#define SN_electronic_signature_standard                "electronic-signature-standard"
-#define NID_electronic_signature_standard               1266
-#define OBJ_electronic_signature_standard               OBJ_etsi,1733L
-
-#define SN_ess_attributes               "ess-attributes"
-#define NID_ess_attributes              1267
-#define OBJ_ess_attributes              OBJ_electronic_signature_standard,2L
-
-#define SN_id_aa_ets_mimeType           "id-aa-ets-mimeType"
-#define NID_id_aa_ets_mimeType          1268
-#define OBJ_id_aa_ets_mimeType          OBJ_ess_attributes,1L
-
-#define SN_id_aa_ets_longTermValidation         "id-aa-ets-longTermValidation"
-#define NID_id_aa_ets_longTermValidation                1269
-#define OBJ_id_aa_ets_longTermValidation                OBJ_ess_attributes,2L
-
-#define SN_id_aa_ets_SignaturePolicyDocument            "id-aa-ets-SignaturePolicyDocument"
-#define NID_id_aa_ets_SignaturePolicyDocument           1270
-#define OBJ_id_aa_ets_SignaturePolicyDocument           OBJ_ess_attributes,3L
-
-#define SN_id_aa_ets_archiveTimestampV3         "id-aa-ets-archiveTimestampV3"
-#define NID_id_aa_ets_archiveTimestampV3                1271
-#define OBJ_id_aa_ets_archiveTimestampV3                OBJ_ess_attributes,4L
-
-#define SN_id_aa_ATSHashIndex           "id-aa-ATSHashIndex"
-#define NID_id_aa_ATSHashIndex          1272
-#define OBJ_id_aa_ATSHashIndex          OBJ_ess_attributes,5L
-
-#define SN_cades                "cades"
-#define NID_cades               1273
-#define OBJ_cades               OBJ_etsi,19122L
-
-#define SN_cades_attributes             "cades-attributes"
-#define NID_cades_attributes            1274
-#define OBJ_cades_attributes            OBJ_cades,1L
-
-#define SN_id_aa_ets_signerAttrV2               "id-aa-ets-signerAttrV2"
-#define NID_id_aa_ets_signerAttrV2              1275
-#define OBJ_id_aa_ets_signerAttrV2              OBJ_cades_attributes,1L
-
-#define SN_id_aa_ets_sigPolicyStore             "id-aa-ets-sigPolicyStore"
-#define NID_id_aa_ets_sigPolicyStore            1276
-#define OBJ_id_aa_ets_sigPolicyStore            OBJ_cades_attributes,3L
-
-#define SN_id_aa_ATSHashIndex_v2                "id-aa-ATSHashIndex-v2"
-#define NID_id_aa_ATSHashIndex_v2               1277
-#define OBJ_id_aa_ATSHashIndex_v2               OBJ_cades_attributes,4L
-
-#define SN_id_aa_ATSHashIndex_v3                "id-aa-ATSHashIndex-v3"
-#define NID_id_aa_ATSHashIndex_v3               1278
-#define OBJ_id_aa_ATSHashIndex_v3               OBJ_cades_attributes,5L
-
-#define SN_signedAssertion              "signedAssertion"
-#define NID_signedAssertion             1279
-#define OBJ_signedAssertion             OBJ_cades_attributes,6L
-
-#define SN_data         "data"
-#define NID_data                434
-#define OBJ_data                OBJ_itu_t,9L
-
-#define SN_pss          "pss"
-#define NID_pss         435
-#define OBJ_pss         OBJ_data,2342L
-
-#define SN_ucl          "ucl"
-#define NID_ucl         436
-#define OBJ_ucl         OBJ_pss,19200300L
-
-#define SN_pilot                "pilot"
-#define NID_pilot               437
-#define OBJ_pilot               OBJ_ucl,100L
-
-#define LN_pilotAttributeType           "pilotAttributeType"
-#define NID_pilotAttributeType          438
-#define OBJ_pilotAttributeType          OBJ_pilot,1L
-
-#define LN_pilotAttributeSyntax         "pilotAttributeSyntax"
-#define NID_pilotAttributeSyntax                439
-#define OBJ_pilotAttributeSyntax                OBJ_pilot,3L
-
-#define LN_pilotObjectClass             "pilotObjectClass"
-#define NID_pilotObjectClass            440
-#define OBJ_pilotObjectClass            OBJ_pilot,4L
-
-#define LN_pilotGroups          "pilotGroups"
-#define NID_pilotGroups         441
-#define OBJ_pilotGroups         OBJ_pilot,10L
-
-#define LN_iA5StringSyntax              "iA5StringSyntax"
-#define NID_iA5StringSyntax             442
-#define OBJ_iA5StringSyntax             OBJ_pilotAttributeSyntax,4L
-
-#define LN_caseIgnoreIA5StringSyntax            "caseIgnoreIA5StringSyntax"
-#define NID_caseIgnoreIA5StringSyntax           443
-#define OBJ_caseIgnoreIA5StringSyntax           OBJ_pilotAttributeSyntax,5L
-
-#define LN_pilotObject          "pilotObject"
-#define NID_pilotObject         444
-#define OBJ_pilotObject         OBJ_pilotObjectClass,3L
-
-#define LN_pilotPerson          "pilotPerson"
-#define NID_pilotPerson         445
-#define OBJ_pilotPerson         OBJ_pilotObjectClass,4L
-
-#define SN_account              "account"
-#define NID_account             446
-#define OBJ_account             OBJ_pilotObjectClass,5L
-
-#define SN_document             "document"
-#define NID_document            447
-#define OBJ_document            OBJ_pilotObjectClass,6L
-
-#define SN_room         "room"
-#define NID_room                448
-#define OBJ_room                OBJ_pilotObjectClass,7L
-
-#define LN_documentSeries               "documentSeries"
-#define NID_documentSeries              449
-#define OBJ_documentSeries              OBJ_pilotObjectClass,9L
-
-#define SN_Domain               "domain"
-#define LN_Domain               "Domain"
-#define NID_Domain              392
-#define OBJ_Domain              OBJ_pilotObjectClass,13L
-
-#define LN_rFC822localPart              "rFC822localPart"
-#define NID_rFC822localPart             450
-#define OBJ_rFC822localPart             OBJ_pilotObjectClass,14L
-
-#define LN_dNSDomain            "dNSDomain"
-#define NID_dNSDomain           451
-#define OBJ_dNSDomain           OBJ_pilotObjectClass,15L
-
-#define LN_domainRelatedObject          "domainRelatedObject"
-#define NID_domainRelatedObject         452
-#define OBJ_domainRelatedObject         OBJ_pilotObjectClass,17L
-
-#define LN_friendlyCountry              "friendlyCountry"
-#define NID_friendlyCountry             453
-#define OBJ_friendlyCountry             OBJ_pilotObjectClass,18L
-
-#define LN_simpleSecurityObject         "simpleSecurityObject"
-#define NID_simpleSecurityObject                454
-#define OBJ_simpleSecurityObject                OBJ_pilotObjectClass,19L
-
-#define LN_pilotOrganization            "pilotOrganization"
-#define NID_pilotOrganization           455
-#define OBJ_pilotOrganization           OBJ_pilotObjectClass,20L
-
-#define LN_pilotDSA             "pilotDSA"
-#define NID_pilotDSA            456
-#define OBJ_pilotDSA            OBJ_pilotObjectClass,21L
-
-#define LN_qualityLabelledData          "qualityLabelledData"
-#define NID_qualityLabelledData         457
-#define OBJ_qualityLabelledData         OBJ_pilotObjectClass,22L
-
-#define SN_userId               "UID"
-#define LN_userId               "userId"
-#define NID_userId              458
-#define OBJ_userId              OBJ_pilotAttributeType,1L
-
-#define LN_textEncodedORAddress         "textEncodedORAddress"
-#define NID_textEncodedORAddress                459
-#define OBJ_textEncodedORAddress                OBJ_pilotAttributeType,2L
-
-#define SN_rfc822Mailbox                "mail"
-#define LN_rfc822Mailbox                "rfc822Mailbox"
-#define NID_rfc822Mailbox               460
-#define OBJ_rfc822Mailbox               OBJ_pilotAttributeType,3L
-
-#define SN_info         "info"
-#define NID_info                461
-#define OBJ_info                OBJ_pilotAttributeType,4L
-
-#define LN_favouriteDrink               "favouriteDrink"
-#define NID_favouriteDrink              462
-#define OBJ_favouriteDrink              OBJ_pilotAttributeType,5L
-
-#define LN_roomNumber           "roomNumber"
-#define NID_roomNumber          463
-#define OBJ_roomNumber          OBJ_pilotAttributeType,6L
-
-#define SN_photo                "photo"
-#define NID_photo               464
-#define OBJ_photo               OBJ_pilotAttributeType,7L
-
-#define LN_userClass            "userClass"
-#define NID_userClass           465
-#define OBJ_userClass           OBJ_pilotAttributeType,8L
-
-#define SN_host         "host"
-#define NID_host                466
-#define OBJ_host                OBJ_pilotAttributeType,9L
-
-#define SN_manager              "manager"
-#define NID_manager             467
-#define OBJ_manager             OBJ_pilotAttributeType,10L
-
-#define LN_documentIdentifier           "documentIdentifier"
-#define NID_documentIdentifier          468
-#define OBJ_documentIdentifier          OBJ_pilotAttributeType,11L
-
-#define LN_documentTitle                "documentTitle"
-#define NID_documentTitle               469
-#define OBJ_documentTitle               OBJ_pilotAttributeType,12L
-
-#define LN_documentVersion              "documentVersion"
-#define NID_documentVersion             470
-#define OBJ_documentVersion             OBJ_pilotAttributeType,13L
-
-#define LN_documentAuthor               "documentAuthor"
-#define NID_documentAuthor              471
-#define OBJ_documentAuthor              OBJ_pilotAttributeType,14L
-
-#define LN_documentLocation             "documentLocation"
-#define NID_documentLocation            472
-#define OBJ_documentLocation            OBJ_pilotAttributeType,15L
-
-#define LN_homeTelephoneNumber          "homeTelephoneNumber"
-#define NID_homeTelephoneNumber         473
-#define OBJ_homeTelephoneNumber         OBJ_pilotAttributeType,20L
-
-#define SN_secretary            "secretary"
-#define NID_secretary           474
-#define OBJ_secretary           OBJ_pilotAttributeType,21L
-
-#define LN_otherMailbox         "otherMailbox"
-#define NID_otherMailbox                475
-#define OBJ_otherMailbox                OBJ_pilotAttributeType,22L
-
-#define LN_lastModifiedTime             "lastModifiedTime"
-#define NID_lastModifiedTime            476
-#define OBJ_lastModifiedTime            OBJ_pilotAttributeType,23L
-
-#define LN_lastModifiedBy               "lastModifiedBy"
-#define NID_lastModifiedBy              477
-#define OBJ_lastModifiedBy              OBJ_pilotAttributeType,24L
-
-#define SN_domainComponent              "DC"
-#define LN_domainComponent              "domainComponent"
-#define NID_domainComponent             391
-#define OBJ_domainComponent             OBJ_pilotAttributeType,25L
-
-#define LN_aRecord              "aRecord"
-#define NID_aRecord             478
-#define OBJ_aRecord             OBJ_pilotAttributeType,26L
-
-#define LN_pilotAttributeType27         "pilotAttributeType27"
-#define NID_pilotAttributeType27                479
-#define OBJ_pilotAttributeType27                OBJ_pilotAttributeType,27L
-
-#define LN_mXRecord             "mXRecord"
-#define NID_mXRecord            480
-#define OBJ_mXRecord            OBJ_pilotAttributeType,28L
-
-#define LN_nSRecord             "nSRecord"
-#define NID_nSRecord            481
-#define OBJ_nSRecord            OBJ_pilotAttributeType,29L
-
-#define LN_sOARecord            "sOARecord"
-#define NID_sOARecord           482
-#define OBJ_sOARecord           OBJ_pilotAttributeType,30L
-
-#define LN_cNAMERecord          "cNAMERecord"
-#define NID_cNAMERecord         483
-#define OBJ_cNAMERecord         OBJ_pilotAttributeType,31L
-
-#define LN_associatedDomain             "associatedDomain"
-#define NID_associatedDomain            484
-#define OBJ_associatedDomain            OBJ_pilotAttributeType,37L
-
-#define LN_associatedName               "associatedName"
-#define NID_associatedName              485
-#define OBJ_associatedName              OBJ_pilotAttributeType,38L
-
-#define LN_homePostalAddress            "homePostalAddress"
-#define NID_homePostalAddress           486
-#define OBJ_homePostalAddress           OBJ_pilotAttributeType,39L
-
-#define LN_personalTitle                "personalTitle"
-#define NID_personalTitle               487
-#define OBJ_personalTitle               OBJ_pilotAttributeType,40L
-
-#define LN_mobileTelephoneNumber                "mobileTelephoneNumber"
-#define NID_mobileTelephoneNumber               488
-#define OBJ_mobileTelephoneNumber               OBJ_pilotAttributeType,41L
-
-#define LN_pagerTelephoneNumber         "pagerTelephoneNumber"
-#define NID_pagerTelephoneNumber                489
-#define OBJ_pagerTelephoneNumber                OBJ_pilotAttributeType,42L
-
-#define LN_friendlyCountryName          "friendlyCountryName"
-#define NID_friendlyCountryName         490
-#define OBJ_friendlyCountryName         OBJ_pilotAttributeType,43L
-
-#define SN_uniqueIdentifier             "uid"
-#define LN_uniqueIdentifier             "uniqueIdentifier"
-#define NID_uniqueIdentifier            102
-#define OBJ_uniqueIdentifier            OBJ_pilotAttributeType,44L
-
-#define LN_organizationalStatus         "organizationalStatus"
-#define NID_organizationalStatus                491
-#define OBJ_organizationalStatus                OBJ_pilotAttributeType,45L
-
-#define LN_janetMailbox         "janetMailbox"
-#define NID_janetMailbox                492
-#define OBJ_janetMailbox                OBJ_pilotAttributeType,46L
-
-#define LN_mailPreferenceOption         "mailPreferenceOption"
-#define NID_mailPreferenceOption                493
-#define OBJ_mailPreferenceOption                OBJ_pilotAttributeType,47L
-
-#define LN_buildingName         "buildingName"
-#define NID_buildingName                494
-#define OBJ_buildingName                OBJ_pilotAttributeType,48L
-
-#define LN_dSAQuality           "dSAQuality"
-#define NID_dSAQuality          495
-#define OBJ_dSAQuality          OBJ_pilotAttributeType,49L
-
-#define LN_singleLevelQuality           "singleLevelQuality"
-#define NID_singleLevelQuality          496
-#define OBJ_singleLevelQuality          OBJ_pilotAttributeType,50L
-
-#define LN_subtreeMinimumQuality                "subtreeMinimumQuality"
-#define NID_subtreeMinimumQuality               497
-#define OBJ_subtreeMinimumQuality               OBJ_pilotAttributeType,51L
-
-#define LN_subtreeMaximumQuality                "subtreeMaximumQuality"
-#define NID_subtreeMaximumQuality               498
-#define OBJ_subtreeMaximumQuality               OBJ_pilotAttributeType,52L
-
-#define LN_personalSignature            "personalSignature"
-#define NID_personalSignature           499
-#define OBJ_personalSignature           OBJ_pilotAttributeType,53L
-
-#define LN_dITRedirect          "dITRedirect"
-#define NID_dITRedirect         500
-#define OBJ_dITRedirect         OBJ_pilotAttributeType,54L
-
-#define SN_audio                "audio"
-#define NID_audio               501
-#define OBJ_audio               OBJ_pilotAttributeType,55L
-
-#define LN_documentPublisher            "documentPublisher"
-#define NID_documentPublisher           502
-#define OBJ_documentPublisher           OBJ_pilotAttributeType,56L
-
-#define SN_id_set               "id-set"
-#define LN_id_set               "Secure Electronic Transactions"
-#define NID_id_set              512
-#define OBJ_id_set              OBJ_international_organizations,42L
-
-#define SN_set_ctype            "set-ctype"
-#define LN_set_ctype            "content types"
-#define NID_set_ctype           513
-#define OBJ_set_ctype           OBJ_id_set,0L
-
-#define SN_set_msgExt           "set-msgExt"
-#define LN_set_msgExt           "message extensions"
-#define NID_set_msgExt          514
-#define OBJ_set_msgExt          OBJ_id_set,1L
-
-#define SN_set_attr             "set-attr"
-#define NID_set_attr            515
-#define OBJ_set_attr            OBJ_id_set,3L
-
-#define SN_set_policy           "set-policy"
-#define NID_set_policy          516
-#define OBJ_set_policy          OBJ_id_set,5L
-
-#define SN_set_certExt          "set-certExt"
-#define LN_set_certExt          "certificate extensions"
-#define NID_set_certExt         517
-#define OBJ_set_certExt         OBJ_id_set,7L
-
-#define SN_set_brand            "set-brand"
-#define NID_set_brand           518
-#define OBJ_set_brand           OBJ_id_set,8L
-
-#define SN_setct_PANData                "setct-PANData"
-#define NID_setct_PANData               519
-#define OBJ_setct_PANData               OBJ_set_ctype,0L
-
-#define SN_setct_PANToken               "setct-PANToken"
-#define NID_setct_PANToken              520
-#define OBJ_setct_PANToken              OBJ_set_ctype,1L
-
-#define SN_setct_PANOnly                "setct-PANOnly"
-#define NID_setct_PANOnly               521
-#define OBJ_setct_PANOnly               OBJ_set_ctype,2L
-
-#define SN_setct_OIData         "setct-OIData"
-#define NID_setct_OIData                522
-#define OBJ_setct_OIData                OBJ_set_ctype,3L
-
-#define SN_setct_PI             "setct-PI"
-#define NID_setct_PI            523
-#define OBJ_setct_PI            OBJ_set_ctype,4L
-
-#define SN_setct_PIData         "setct-PIData"
-#define NID_setct_PIData                524
-#define OBJ_setct_PIData                OBJ_set_ctype,5L
-
-#define SN_setct_PIDataUnsigned         "setct-PIDataUnsigned"
-#define NID_setct_PIDataUnsigned                525
-#define OBJ_setct_PIDataUnsigned                OBJ_set_ctype,6L
-
-#define SN_setct_HODInput               "setct-HODInput"
-#define NID_setct_HODInput              526
-#define OBJ_setct_HODInput              OBJ_set_ctype,7L
-
-#define SN_setct_AuthResBaggage         "setct-AuthResBaggage"
-#define NID_setct_AuthResBaggage                527
-#define OBJ_setct_AuthResBaggage                OBJ_set_ctype,8L
-
-#define SN_setct_AuthRevReqBaggage              "setct-AuthRevReqBaggage"
-#define NID_setct_AuthRevReqBaggage             528
-#define OBJ_setct_AuthRevReqBaggage             OBJ_set_ctype,9L
-
-#define SN_setct_AuthRevResBaggage              "setct-AuthRevResBaggage"
-#define NID_setct_AuthRevResBaggage             529
-#define OBJ_setct_AuthRevResBaggage             OBJ_set_ctype,10L
-
-#define SN_setct_CapTokenSeq            "setct-CapTokenSeq"
-#define NID_setct_CapTokenSeq           530
-#define OBJ_setct_CapTokenSeq           OBJ_set_ctype,11L
-
-#define SN_setct_PInitResData           "setct-PInitResData"
-#define NID_setct_PInitResData          531
-#define OBJ_setct_PInitResData          OBJ_set_ctype,12L
-
-#define SN_setct_PI_TBS         "setct-PI-TBS"
-#define NID_setct_PI_TBS                532
-#define OBJ_setct_PI_TBS                OBJ_set_ctype,13L
-
-#define SN_setct_PResData               "setct-PResData"
-#define NID_setct_PResData              533
-#define OBJ_setct_PResData              OBJ_set_ctype,14L
-
-#define SN_setct_AuthReqTBS             "setct-AuthReqTBS"
-#define NID_setct_AuthReqTBS            534
-#define OBJ_setct_AuthReqTBS            OBJ_set_ctype,16L
-
-#define SN_setct_AuthResTBS             "setct-AuthResTBS"
-#define NID_setct_AuthResTBS            535
-#define OBJ_setct_AuthResTBS            OBJ_set_ctype,17L
-
-#define SN_setct_AuthResTBSX            "setct-AuthResTBSX"
-#define NID_setct_AuthResTBSX           536
-#define OBJ_setct_AuthResTBSX           OBJ_set_ctype,18L
-
-#define SN_setct_AuthTokenTBS           "setct-AuthTokenTBS"
-#define NID_setct_AuthTokenTBS          537
-#define OBJ_setct_AuthTokenTBS          OBJ_set_ctype,19L
-
-#define SN_setct_CapTokenData           "setct-CapTokenData"
-#define NID_setct_CapTokenData          538
-#define OBJ_setct_CapTokenData          OBJ_set_ctype,20L
-
-#define SN_setct_CapTokenTBS            "setct-CapTokenTBS"
-#define NID_setct_CapTokenTBS           539
-#define OBJ_setct_CapTokenTBS           OBJ_set_ctype,21L
-
-#define SN_setct_AcqCardCodeMsg         "setct-AcqCardCodeMsg"
-#define NID_setct_AcqCardCodeMsg                540
-#define OBJ_setct_AcqCardCodeMsg                OBJ_set_ctype,22L
-
-#define SN_setct_AuthRevReqTBS          "setct-AuthRevReqTBS"
-#define NID_setct_AuthRevReqTBS         541
-#define OBJ_setct_AuthRevReqTBS         OBJ_set_ctype,23L
-
-#define SN_setct_AuthRevResData         "setct-AuthRevResData"
-#define NID_setct_AuthRevResData                542
-#define OBJ_setct_AuthRevResData                OBJ_set_ctype,24L
-
-#define SN_setct_AuthRevResTBS          "setct-AuthRevResTBS"
-#define NID_setct_AuthRevResTBS         543
-#define OBJ_setct_AuthRevResTBS         OBJ_set_ctype,25L
-
-#define SN_setct_CapReqTBS              "setct-CapReqTBS"
-#define NID_setct_CapReqTBS             544
-#define OBJ_setct_CapReqTBS             OBJ_set_ctype,26L
-
-#define SN_setct_CapReqTBSX             "setct-CapReqTBSX"
-#define NID_setct_CapReqTBSX            545
-#define OBJ_setct_CapReqTBSX            OBJ_set_ctype,27L
-
-#define SN_setct_CapResData             "setct-CapResData"
-#define NID_setct_CapResData            546
-#define OBJ_setct_CapResData            OBJ_set_ctype,28L
-
-#define SN_setct_CapRevReqTBS           "setct-CapRevReqTBS"
-#define NID_setct_CapRevReqTBS          547
-#define OBJ_setct_CapRevReqTBS          OBJ_set_ctype,29L
-
-#define SN_setct_CapRevReqTBSX          "setct-CapRevReqTBSX"
-#define NID_setct_CapRevReqTBSX         548
-#define OBJ_setct_CapRevReqTBSX         OBJ_set_ctype,30L
-
-#define SN_setct_CapRevResData          "setct-CapRevResData"
-#define NID_setct_CapRevResData         549
-#define OBJ_setct_CapRevResData         OBJ_set_ctype,31L
-
-#define SN_setct_CredReqTBS             "setct-CredReqTBS"
-#define NID_setct_CredReqTBS            550
-#define OBJ_setct_CredReqTBS            OBJ_set_ctype,32L
-
-#define SN_setct_CredReqTBSX            "setct-CredReqTBSX"
-#define NID_setct_CredReqTBSX           551
-#define OBJ_setct_CredReqTBSX           OBJ_set_ctype,33L
-
-#define SN_setct_CredResData            "setct-CredResData"
-#define NID_setct_CredResData           552
-#define OBJ_setct_CredResData           OBJ_set_ctype,34L
-
-#define SN_setct_CredRevReqTBS          "setct-CredRevReqTBS"
-#define NID_setct_CredRevReqTBS         553
-#define OBJ_setct_CredRevReqTBS         OBJ_set_ctype,35L
-
-#define SN_setct_CredRevReqTBSX         "setct-CredRevReqTBSX"
-#define NID_setct_CredRevReqTBSX                554
-#define OBJ_setct_CredRevReqTBSX                OBJ_set_ctype,36L
-
-#define SN_setct_CredRevResData         "setct-CredRevResData"
-#define NID_setct_CredRevResData                555
-#define OBJ_setct_CredRevResData                OBJ_set_ctype,37L
-
-#define SN_setct_PCertReqData           "setct-PCertReqData"
-#define NID_setct_PCertReqData          556
-#define OBJ_setct_PCertReqData          OBJ_set_ctype,38L
-
-#define SN_setct_PCertResTBS            "setct-PCertResTBS"
-#define NID_setct_PCertResTBS           557
-#define OBJ_setct_PCertResTBS           OBJ_set_ctype,39L
-
-#define SN_setct_BatchAdminReqData              "setct-BatchAdminReqData"
-#define NID_setct_BatchAdminReqData             558
-#define OBJ_setct_BatchAdminReqData             OBJ_set_ctype,40L
-
-#define SN_setct_BatchAdminResData              "setct-BatchAdminResData"
-#define NID_setct_BatchAdminResData             559
-#define OBJ_setct_BatchAdminResData             OBJ_set_ctype,41L
-
-#define SN_setct_CardCInitResTBS                "setct-CardCInitResTBS"
-#define NID_setct_CardCInitResTBS               560
-#define OBJ_setct_CardCInitResTBS               OBJ_set_ctype,42L
-
-#define SN_setct_MeAqCInitResTBS                "setct-MeAqCInitResTBS"
-#define NID_setct_MeAqCInitResTBS               561
-#define OBJ_setct_MeAqCInitResTBS               OBJ_set_ctype,43L
-
-#define SN_setct_RegFormResTBS          "setct-RegFormResTBS"
-#define NID_setct_RegFormResTBS         562
-#define OBJ_setct_RegFormResTBS         OBJ_set_ctype,44L
-
-#define SN_setct_CertReqData            "setct-CertReqData"
-#define NID_setct_CertReqData           563
-#define OBJ_setct_CertReqData           OBJ_set_ctype,45L
-
-#define SN_setct_CertReqTBS             "setct-CertReqTBS"
-#define NID_setct_CertReqTBS            564
-#define OBJ_setct_CertReqTBS            OBJ_set_ctype,46L
-
-#define SN_setct_CertResData            "setct-CertResData"
-#define NID_setct_CertResData           565
-#define OBJ_setct_CertResData           OBJ_set_ctype,47L
-
-#define SN_setct_CertInqReqTBS          "setct-CertInqReqTBS"
-#define NID_setct_CertInqReqTBS         566
-#define OBJ_setct_CertInqReqTBS         OBJ_set_ctype,48L
-
-#define SN_setct_ErrorTBS               "setct-ErrorTBS"
-#define NID_setct_ErrorTBS              567
-#define OBJ_setct_ErrorTBS              OBJ_set_ctype,49L
-
-#define SN_setct_PIDualSignedTBE                "setct-PIDualSignedTBE"
-#define NID_setct_PIDualSignedTBE               568
-#define OBJ_setct_PIDualSignedTBE               OBJ_set_ctype,50L
-
-#define SN_setct_PIUnsignedTBE          "setct-PIUnsignedTBE"
-#define NID_setct_PIUnsignedTBE         569
-#define OBJ_setct_PIUnsignedTBE         OBJ_set_ctype,51L
-
-#define SN_setct_AuthReqTBE             "setct-AuthReqTBE"
-#define NID_setct_AuthReqTBE            570
-#define OBJ_setct_AuthReqTBE            OBJ_set_ctype,52L
-
-#define SN_setct_AuthResTBE             "setct-AuthResTBE"
-#define NID_setct_AuthResTBE            571
-#define OBJ_setct_AuthResTBE            OBJ_set_ctype,53L
-
-#define SN_setct_AuthResTBEX            "setct-AuthResTBEX"
-#define NID_setct_AuthResTBEX           572
-#define OBJ_setct_AuthResTBEX           OBJ_set_ctype,54L
-
-#define SN_setct_AuthTokenTBE           "setct-AuthTokenTBE"
-#define NID_setct_AuthTokenTBE          573
-#define OBJ_setct_AuthTokenTBE          OBJ_set_ctype,55L
-
-#define SN_setct_CapTokenTBE            "setct-CapTokenTBE"
-#define NID_setct_CapTokenTBE           574
-#define OBJ_setct_CapTokenTBE           OBJ_set_ctype,56L
-
-#define SN_setct_CapTokenTBEX           "setct-CapTokenTBEX"
-#define NID_setct_CapTokenTBEX          575
-#define OBJ_setct_CapTokenTBEX          OBJ_set_ctype,57L
-
-#define SN_setct_AcqCardCodeMsgTBE              "setct-AcqCardCodeMsgTBE"
-#define NID_setct_AcqCardCodeMsgTBE             576
-#define OBJ_setct_AcqCardCodeMsgTBE             OBJ_set_ctype,58L
-
-#define SN_setct_AuthRevReqTBE          "setct-AuthRevReqTBE"
-#define NID_setct_AuthRevReqTBE         577
-#define OBJ_setct_AuthRevReqTBE         OBJ_set_ctype,59L
-
-#define SN_setct_AuthRevResTBE          "setct-AuthRevResTBE"
-#define NID_setct_AuthRevResTBE         578
-#define OBJ_setct_AuthRevResTBE         OBJ_set_ctype,60L
-
-#define SN_setct_AuthRevResTBEB         "setct-AuthRevResTBEB"
-#define NID_setct_AuthRevResTBEB                579
-#define OBJ_setct_AuthRevResTBEB                OBJ_set_ctype,61L
-
-#define SN_setct_CapReqTBE              "setct-CapReqTBE"
-#define NID_setct_CapReqTBE             580
-#define OBJ_setct_CapReqTBE             OBJ_set_ctype,62L
-
-#define SN_setct_CapReqTBEX             "setct-CapReqTBEX"
-#define NID_setct_CapReqTBEX            581
-#define OBJ_setct_CapReqTBEX            OBJ_set_ctype,63L
-
-#define SN_setct_CapResTBE              "setct-CapResTBE"
-#define NID_setct_CapResTBE             582
-#define OBJ_setct_CapResTBE             OBJ_set_ctype,64L
-
-#define SN_setct_CapRevReqTBE           "setct-CapRevReqTBE"
-#define NID_setct_CapRevReqTBE          583
-#define OBJ_setct_CapRevReqTBE          OBJ_set_ctype,65L
-
-#define SN_setct_CapRevReqTBEX          "setct-CapRevReqTBEX"
-#define NID_setct_CapRevReqTBEX         584
-#define OBJ_setct_CapRevReqTBEX         OBJ_set_ctype,66L
-
-#define SN_setct_CapRevResTBE           "setct-CapRevResTBE"
-#define NID_setct_CapRevResTBE          585
-#define OBJ_setct_CapRevResTBE          OBJ_set_ctype,67L
-
-#define SN_setct_CredReqTBE             "setct-CredReqTBE"
-#define NID_setct_CredReqTBE            586
-#define OBJ_setct_CredReqTBE            OBJ_set_ctype,68L
-
-#define SN_setct_CredReqTBEX            "setct-CredReqTBEX"
-#define NID_setct_CredReqTBEX           587
-#define OBJ_setct_CredReqTBEX           OBJ_set_ctype,69L
-
-#define SN_setct_CredResTBE             "setct-CredResTBE"
-#define NID_setct_CredResTBE            588
-#define OBJ_setct_CredResTBE            OBJ_set_ctype,70L
-
-#define SN_setct_CredRevReqTBE          "setct-CredRevReqTBE"
-#define NID_setct_CredRevReqTBE         589
-#define OBJ_setct_CredRevReqTBE         OBJ_set_ctype,71L
-
-#define SN_setct_CredRevReqTBEX         "setct-CredRevReqTBEX"
-#define NID_setct_CredRevReqTBEX                590
-#define OBJ_setct_CredRevReqTBEX                OBJ_set_ctype,72L
-
-#define SN_setct_CredRevResTBE          "setct-CredRevResTBE"
-#define NID_setct_CredRevResTBE         591
-#define OBJ_setct_CredRevResTBE         OBJ_set_ctype,73L
-
-#define SN_setct_BatchAdminReqTBE               "setct-BatchAdminReqTBE"
-#define NID_setct_BatchAdminReqTBE              592
-#define OBJ_setct_BatchAdminReqTBE              OBJ_set_ctype,74L
-
-#define SN_setct_BatchAdminResTBE               "setct-BatchAdminResTBE"
-#define NID_setct_BatchAdminResTBE              593
-#define OBJ_setct_BatchAdminResTBE              OBJ_set_ctype,75L
-
-#define SN_setct_RegFormReqTBE          "setct-RegFormReqTBE"
-#define NID_setct_RegFormReqTBE         594
-#define OBJ_setct_RegFormReqTBE         OBJ_set_ctype,76L
-
-#define SN_setct_CertReqTBE             "setct-CertReqTBE"
-#define NID_setct_CertReqTBE            595
-#define OBJ_setct_CertReqTBE            OBJ_set_ctype,77L
-
-#define SN_setct_CertReqTBEX            "setct-CertReqTBEX"
-#define NID_setct_CertReqTBEX           596
-#define OBJ_setct_CertReqTBEX           OBJ_set_ctype,78L
-
-#define SN_setct_CertResTBE             "setct-CertResTBE"
-#define NID_setct_CertResTBE            597
-#define OBJ_setct_CertResTBE            OBJ_set_ctype,79L
-
-#define SN_setct_CRLNotificationTBS             "setct-CRLNotificationTBS"
-#define NID_setct_CRLNotificationTBS            598
-#define OBJ_setct_CRLNotificationTBS            OBJ_set_ctype,80L
-
-#define SN_setct_CRLNotificationResTBS          "setct-CRLNotificationResTBS"
-#define NID_setct_CRLNotificationResTBS         599
-#define OBJ_setct_CRLNotificationResTBS         OBJ_set_ctype,81L
-
-#define SN_setct_BCIDistributionTBS             "setct-BCIDistributionTBS"
-#define NID_setct_BCIDistributionTBS            600
-#define OBJ_setct_BCIDistributionTBS            OBJ_set_ctype,82L
-
-#define SN_setext_genCrypt              "setext-genCrypt"
-#define LN_setext_genCrypt              "generic cryptogram"
-#define NID_setext_genCrypt             601
-#define OBJ_setext_genCrypt             OBJ_set_msgExt,1L
-
-#define SN_setext_miAuth                "setext-miAuth"
-#define LN_setext_miAuth                "merchant initiated auth"
-#define NID_setext_miAuth               602
-#define OBJ_setext_miAuth               OBJ_set_msgExt,3L
-
-#define SN_setext_pinSecure             "setext-pinSecure"
-#define NID_setext_pinSecure            603
-#define OBJ_setext_pinSecure            OBJ_set_msgExt,4L
-
-#define SN_setext_pinAny                "setext-pinAny"
-#define NID_setext_pinAny               604
-#define OBJ_setext_pinAny               OBJ_set_msgExt,5L
-
-#define SN_setext_track2                "setext-track2"
-#define NID_setext_track2               605
-#define OBJ_setext_track2               OBJ_set_msgExt,7L
-
-#define SN_setext_cv            "setext-cv"
-#define LN_setext_cv            "additional verification"
-#define NID_setext_cv           606
-#define OBJ_setext_cv           OBJ_set_msgExt,8L
-
-#define SN_set_policy_root              "set-policy-root"
-#define NID_set_policy_root             607
-#define OBJ_set_policy_root             OBJ_set_policy,0L
-
-#define SN_setCext_hashedRoot           "setCext-hashedRoot"
-#define NID_setCext_hashedRoot          608
-#define OBJ_setCext_hashedRoot          OBJ_set_certExt,0L
-
-#define SN_setCext_certType             "setCext-certType"
-#define NID_setCext_certType            609
-#define OBJ_setCext_certType            OBJ_set_certExt,1L
-
-#define SN_setCext_merchData            "setCext-merchData"
-#define NID_setCext_merchData           610
-#define OBJ_setCext_merchData           OBJ_set_certExt,2L
-
-#define SN_setCext_cCertRequired                "setCext-cCertRequired"
-#define NID_setCext_cCertRequired               611
-#define OBJ_setCext_cCertRequired               OBJ_set_certExt,3L
-
-#define SN_setCext_tunneling            "setCext-tunneling"
-#define NID_setCext_tunneling           612
-#define OBJ_setCext_tunneling           OBJ_set_certExt,4L
-
-#define SN_setCext_setExt               "setCext-setExt"
-#define NID_setCext_setExt              613
-#define OBJ_setCext_setExt              OBJ_set_certExt,5L
-
-#define SN_setCext_setQualf             "setCext-setQualf"
-#define NID_setCext_setQualf            614
-#define OBJ_setCext_setQualf            OBJ_set_certExt,6L
-
-#define SN_setCext_PGWYcapabilities             "setCext-PGWYcapabilities"
-#define NID_setCext_PGWYcapabilities            615
-#define OBJ_setCext_PGWYcapabilities            OBJ_set_certExt,7L
-
-#define SN_setCext_TokenIdentifier              "setCext-TokenIdentifier"
-#define NID_setCext_TokenIdentifier             616
-#define OBJ_setCext_TokenIdentifier             OBJ_set_certExt,8L
-
-#define SN_setCext_Track2Data           "setCext-Track2Data"
-#define NID_setCext_Track2Data          617
-#define OBJ_setCext_Track2Data          OBJ_set_certExt,9L
-
-#define SN_setCext_TokenType            "setCext-TokenType"
-#define NID_setCext_TokenType           618
-#define OBJ_setCext_TokenType           OBJ_set_certExt,10L
-
-#define SN_setCext_IssuerCapabilities           "setCext-IssuerCapabilities"
-#define NID_setCext_IssuerCapabilities          619
-#define OBJ_setCext_IssuerCapabilities          OBJ_set_certExt,11L
-
-#define SN_setAttr_Cert         "setAttr-Cert"
-#define NID_setAttr_Cert                620
-#define OBJ_setAttr_Cert                OBJ_set_attr,0L
-
-#define SN_setAttr_PGWYcap              "setAttr-PGWYcap"
-#define LN_setAttr_PGWYcap              "payment gateway capabilities"
-#define NID_setAttr_PGWYcap             621
-#define OBJ_setAttr_PGWYcap             OBJ_set_attr,1L
-
-#define SN_setAttr_TokenType            "setAttr-TokenType"
-#define NID_setAttr_TokenType           622
-#define OBJ_setAttr_TokenType           OBJ_set_attr,2L
-
-#define SN_setAttr_IssCap               "setAttr-IssCap"
-#define LN_setAttr_IssCap               "issuer capabilities"
-#define NID_setAttr_IssCap              623
-#define OBJ_setAttr_IssCap              OBJ_set_attr,3L
-
-#define SN_set_rootKeyThumb             "set-rootKeyThumb"
-#define NID_set_rootKeyThumb            624
-#define OBJ_set_rootKeyThumb            OBJ_setAttr_Cert,0L
-
-#define SN_set_addPolicy                "set-addPolicy"
-#define NID_set_addPolicy               625
-#define OBJ_set_addPolicy               OBJ_setAttr_Cert,1L
-
-#define SN_setAttr_Token_EMV            "setAttr-Token-EMV"
-#define NID_setAttr_Token_EMV           626
-#define OBJ_setAttr_Token_EMV           OBJ_setAttr_TokenType,1L
-
-#define SN_setAttr_Token_B0Prime                "setAttr-Token-B0Prime"
-#define NID_setAttr_Token_B0Prime               627
-#define OBJ_setAttr_Token_B0Prime               OBJ_setAttr_TokenType,2L
-
-#define SN_setAttr_IssCap_CVM           "setAttr-IssCap-CVM"
-#define NID_setAttr_IssCap_CVM          628
-#define OBJ_setAttr_IssCap_CVM          OBJ_setAttr_IssCap,3L
-
-#define SN_setAttr_IssCap_T2            "setAttr-IssCap-T2"
-#define NID_setAttr_IssCap_T2           629
-#define OBJ_setAttr_IssCap_T2           OBJ_setAttr_IssCap,4L
-
-#define SN_setAttr_IssCap_Sig           "setAttr-IssCap-Sig"
-#define NID_setAttr_IssCap_Sig          630
-#define OBJ_setAttr_IssCap_Sig          OBJ_setAttr_IssCap,5L
-
-#define SN_setAttr_GenCryptgrm          "setAttr-GenCryptgrm"
-#define LN_setAttr_GenCryptgrm          "generate cryptogram"
-#define NID_setAttr_GenCryptgrm         631
-#define OBJ_setAttr_GenCryptgrm         OBJ_setAttr_IssCap_CVM,1L
-
-#define SN_setAttr_T2Enc                "setAttr-T2Enc"
-#define LN_setAttr_T2Enc                "encrypted track 2"
-#define NID_setAttr_T2Enc               632
-#define OBJ_setAttr_T2Enc               OBJ_setAttr_IssCap_T2,1L
-
-#define SN_setAttr_T2cleartxt           "setAttr-T2cleartxt"
-#define LN_setAttr_T2cleartxt           "cleartext track 2"
-#define NID_setAttr_T2cleartxt          633
-#define OBJ_setAttr_T2cleartxt          OBJ_setAttr_IssCap_T2,2L
-
-#define SN_setAttr_TokICCsig            "setAttr-TokICCsig"
-#define LN_setAttr_TokICCsig            "ICC or token signature"
-#define NID_setAttr_TokICCsig           634
-#define OBJ_setAttr_TokICCsig           OBJ_setAttr_IssCap_Sig,1L
-
-#define SN_setAttr_SecDevSig            "setAttr-SecDevSig"
-#define LN_setAttr_SecDevSig            "secure device signature"
-#define NID_setAttr_SecDevSig           635
-#define OBJ_setAttr_SecDevSig           OBJ_setAttr_IssCap_Sig,2L
-
-#define SN_set_brand_IATA_ATA           "set-brand-IATA-ATA"
-#define NID_set_brand_IATA_ATA          636
-#define OBJ_set_brand_IATA_ATA          OBJ_set_brand,1L
-
-#define SN_set_brand_Diners             "set-brand-Diners"
-#define NID_set_brand_Diners            637
-#define OBJ_set_brand_Diners            OBJ_set_brand,30L
-
-#define SN_set_brand_AmericanExpress            "set-brand-AmericanExpress"
-#define NID_set_brand_AmericanExpress           638
-#define OBJ_set_brand_AmericanExpress           OBJ_set_brand,34L
-
-#define SN_set_brand_JCB                "set-brand-JCB"
-#define NID_set_brand_JCB               639
-#define OBJ_set_brand_JCB               OBJ_set_brand,35L
-
-#define SN_set_brand_Visa               "set-brand-Visa"
-#define NID_set_brand_Visa              640
-#define OBJ_set_brand_Visa              OBJ_set_brand,4L
-
-#define SN_set_brand_MasterCard         "set-brand-MasterCard"
-#define NID_set_brand_MasterCard                641
-#define OBJ_set_brand_MasterCard                OBJ_set_brand,5L
-
-#define SN_set_brand_Novus              "set-brand-Novus"
-#define NID_set_brand_Novus             642
-#define OBJ_set_brand_Novus             OBJ_set_brand,6011L
-
-#define SN_des_cdmf             "DES-CDMF"
-#define LN_des_cdmf             "des-cdmf"
-#define NID_des_cdmf            643
-#define OBJ_des_cdmf            OBJ_rsadsi,3L,10L
-
-#define SN_rsaOAEPEncryptionSET         "rsaOAEPEncryptionSET"
-#define NID_rsaOAEPEncryptionSET                644
-#define OBJ_rsaOAEPEncryptionSET                OBJ_rsadsi,1L,1L,6L
-
-#define SN_ipsec3               "Oakley-EC2N-3"
-#define LN_ipsec3               "ipsec3"
-#define NID_ipsec3              749
-
-#define SN_ipsec4               "Oakley-EC2N-4"
-#define LN_ipsec4               "ipsec4"
-#define NID_ipsec4              750
-
-#define SN_whirlpool            "whirlpool"
-#define NID_whirlpool           804
-#define OBJ_whirlpool           OBJ_iso,0L,10118L,3L,0L,55L
-
-#define SN_cryptopro            "cryptopro"
-#define NID_cryptopro           805
-#define OBJ_cryptopro           OBJ_member_body,643L,2L,2L
-
-#define SN_cryptocom            "cryptocom"
-#define NID_cryptocom           806
-#define OBJ_cryptocom           OBJ_member_body,643L,2L,9L
-
-#define SN_id_tc26              "id-tc26"
-#define NID_id_tc26             974
-#define OBJ_id_tc26             OBJ_member_body,643L,7L,1L
-
-#define SN_id_GostR3411_94_with_GostR3410_2001          "id-GostR3411-94-with-GostR3410-2001"
-#define LN_id_GostR3411_94_with_GostR3410_2001          "GOST R 34.11-94 with GOST R 34.10-2001"
-#define NID_id_GostR3411_94_with_GostR3410_2001         807
-#define OBJ_id_GostR3411_94_with_GostR3410_2001         OBJ_cryptopro,3L
-
-#define SN_id_GostR3411_94_with_GostR3410_94            "id-GostR3411-94-with-GostR3410-94"
-#define LN_id_GostR3411_94_with_GostR3410_94            "GOST R 34.11-94 with GOST R 34.10-94"
-#define NID_id_GostR3411_94_with_GostR3410_94           808
-#define OBJ_id_GostR3411_94_with_GostR3410_94           OBJ_cryptopro,4L
-
-#define SN_id_GostR3411_94              "md_gost94"
-#define LN_id_GostR3411_94              "GOST R 34.11-94"
-#define NID_id_GostR3411_94             809
-#define OBJ_id_GostR3411_94             OBJ_cryptopro,9L
-
-#define SN_id_HMACGostR3411_94          "id-HMACGostR3411-94"
-#define LN_id_HMACGostR3411_94          "HMAC GOST 34.11-94"
-#define NID_id_HMACGostR3411_94         810
-#define OBJ_id_HMACGostR3411_94         OBJ_cryptopro,10L
-
-#define SN_id_GostR3410_2001            "gost2001"
-#define LN_id_GostR3410_2001            "GOST R 34.10-2001"
-#define NID_id_GostR3410_2001           811
-#define OBJ_id_GostR3410_2001           OBJ_cryptopro,19L
-
-#define SN_id_GostR3410_94              "gost94"
-#define LN_id_GostR3410_94              "GOST R 34.10-94"
-#define NID_id_GostR3410_94             812
-#define OBJ_id_GostR3410_94             OBJ_cryptopro,20L
-
-#define SN_id_Gost28147_89              "gost89"
-#define LN_id_Gost28147_89              "GOST 28147-89"
-#define NID_id_Gost28147_89             813
-#define OBJ_id_Gost28147_89             OBJ_cryptopro,21L
-
-#define SN_gost89_cnt           "gost89-cnt"
-#define NID_gost89_cnt          814
-
-#define SN_gost89_cnt_12                "gost89-cnt-12"
-#define NID_gost89_cnt_12               975
-
-#define SN_gost89_cbc           "gost89-cbc"
-#define NID_gost89_cbc          1009
-
-#define SN_gost89_ecb           "gost89-ecb"
-#define NID_gost89_ecb          1010
-
-#define SN_gost89_ctr           "gost89-ctr"
-#define NID_gost89_ctr          1011
-
-#define SN_id_Gost28147_89_MAC          "gost-mac"
-#define LN_id_Gost28147_89_MAC          "GOST 28147-89 MAC"
-#define NID_id_Gost28147_89_MAC         815
-#define OBJ_id_Gost28147_89_MAC         OBJ_cryptopro,22L
-
-#define SN_gost_mac_12          "gost-mac-12"
-#define NID_gost_mac_12         976
-
-#define SN_id_GostR3411_94_prf          "prf-gostr3411-94"
-#define LN_id_GostR3411_94_prf          "GOST R 34.11-94 PRF"
-#define NID_id_GostR3411_94_prf         816
-#define OBJ_id_GostR3411_94_prf         OBJ_cryptopro,23L
-
-#define SN_id_GostR3410_2001DH          "id-GostR3410-2001DH"
-#define LN_id_GostR3410_2001DH          "GOST R 34.10-2001 DH"
-#define NID_id_GostR3410_2001DH         817
-#define OBJ_id_GostR3410_2001DH         OBJ_cryptopro,98L
-
-#define SN_id_GostR3410_94DH            "id-GostR3410-94DH"
-#define LN_id_GostR3410_94DH            "GOST R 34.10-94 DH"
-#define NID_id_GostR3410_94DH           818
-#define OBJ_id_GostR3410_94DH           OBJ_cryptopro,99L
-
-#define SN_id_Gost28147_89_CryptoPro_KeyMeshing         "id-Gost28147-89-CryptoPro-KeyMeshing"
-#define NID_id_Gost28147_89_CryptoPro_KeyMeshing                819
-#define OBJ_id_Gost28147_89_CryptoPro_KeyMeshing                OBJ_cryptopro,14L,1L
-
-#define SN_id_Gost28147_89_None_KeyMeshing              "id-Gost28147-89-None-KeyMeshing"
-#define NID_id_Gost28147_89_None_KeyMeshing             820
-#define OBJ_id_Gost28147_89_None_KeyMeshing             OBJ_cryptopro,14L,0L
-
-#define SN_id_GostR3411_94_TestParamSet         "id-GostR3411-94-TestParamSet"
-#define NID_id_GostR3411_94_TestParamSet                821
-#define OBJ_id_GostR3411_94_TestParamSet                OBJ_cryptopro,30L,0L
-
-#define SN_id_GostR3411_94_CryptoProParamSet            "id-GostR3411-94-CryptoProParamSet"
-#define NID_id_GostR3411_94_CryptoProParamSet           822
-#define OBJ_id_GostR3411_94_CryptoProParamSet           OBJ_cryptopro,30L,1L
-
-#define SN_id_Gost28147_89_TestParamSet         "id-Gost28147-89-TestParamSet"
-#define NID_id_Gost28147_89_TestParamSet                823
-#define OBJ_id_Gost28147_89_TestParamSet                OBJ_cryptopro,31L,0L
-
-#define SN_id_Gost28147_89_CryptoPro_A_ParamSet         "id-Gost28147-89-CryptoPro-A-ParamSet"
-#define NID_id_Gost28147_89_CryptoPro_A_ParamSet                824
-#define OBJ_id_Gost28147_89_CryptoPro_A_ParamSet                OBJ_cryptopro,31L,1L
-
-#define SN_id_Gost28147_89_CryptoPro_B_ParamSet         "id-Gost28147-89-CryptoPro-B-ParamSet"
-#define NID_id_Gost28147_89_CryptoPro_B_ParamSet                825
-#define OBJ_id_Gost28147_89_CryptoPro_B_ParamSet                OBJ_cryptopro,31L,2L
-
-#define SN_id_Gost28147_89_CryptoPro_C_ParamSet         "id-Gost28147-89-CryptoPro-C-ParamSet"
-#define NID_id_Gost28147_89_CryptoPro_C_ParamSet                826
-#define OBJ_id_Gost28147_89_CryptoPro_C_ParamSet                OBJ_cryptopro,31L,3L
-
-#define SN_id_Gost28147_89_CryptoPro_D_ParamSet         "id-Gost28147-89-CryptoPro-D-ParamSet"
-#define NID_id_Gost28147_89_CryptoPro_D_ParamSet                827
-#define OBJ_id_Gost28147_89_CryptoPro_D_ParamSet                OBJ_cryptopro,31L,4L
-
-#define SN_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet         "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet"
-#define NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet                828
-#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet                OBJ_cryptopro,31L,5L
-
-#define SN_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet         "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet"
-#define NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet                829
-#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet                OBJ_cryptopro,31L,6L
-
-#define SN_id_Gost28147_89_CryptoPro_RIC_1_ParamSet             "id-Gost28147-89-CryptoPro-RIC-1-ParamSet"
-#define NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet            830
-#define OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet            OBJ_cryptopro,31L,7L
-
-#define SN_id_GostR3410_94_TestParamSet         "id-GostR3410-94-TestParamSet"
-#define NID_id_GostR3410_94_TestParamSet                831
-#define OBJ_id_GostR3410_94_TestParamSet                OBJ_cryptopro,32L,0L
-
-#define SN_id_GostR3410_94_CryptoPro_A_ParamSet         "id-GostR3410-94-CryptoPro-A-ParamSet"
-#define NID_id_GostR3410_94_CryptoPro_A_ParamSet                832
-#define OBJ_id_GostR3410_94_CryptoPro_A_ParamSet                OBJ_cryptopro,32L,2L
-
-#define SN_id_GostR3410_94_CryptoPro_B_ParamSet         "id-GostR3410-94-CryptoPro-B-ParamSet"
-#define NID_id_GostR3410_94_CryptoPro_B_ParamSet                833
-#define OBJ_id_GostR3410_94_CryptoPro_B_ParamSet                OBJ_cryptopro,32L,3L
-
-#define SN_id_GostR3410_94_CryptoPro_C_ParamSet         "id-GostR3410-94-CryptoPro-C-ParamSet"
-#define NID_id_GostR3410_94_CryptoPro_C_ParamSet                834
-#define OBJ_id_GostR3410_94_CryptoPro_C_ParamSet                OBJ_cryptopro,32L,4L
-
-#define SN_id_GostR3410_94_CryptoPro_D_ParamSet         "id-GostR3410-94-CryptoPro-D-ParamSet"
-#define NID_id_GostR3410_94_CryptoPro_D_ParamSet                835
-#define OBJ_id_GostR3410_94_CryptoPro_D_ParamSet                OBJ_cryptopro,32L,5L
-
-#define SN_id_GostR3410_94_CryptoPro_XchA_ParamSet              "id-GostR3410-94-CryptoPro-XchA-ParamSet"
-#define NID_id_GostR3410_94_CryptoPro_XchA_ParamSet             836
-#define OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet             OBJ_cryptopro,33L,1L
-
-#define SN_id_GostR3410_94_CryptoPro_XchB_ParamSet              "id-GostR3410-94-CryptoPro-XchB-ParamSet"
-#define NID_id_GostR3410_94_CryptoPro_XchB_ParamSet             837
-#define OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet             OBJ_cryptopro,33L,2L
-
-#define SN_id_GostR3410_94_CryptoPro_XchC_ParamSet              "id-GostR3410-94-CryptoPro-XchC-ParamSet"
-#define NID_id_GostR3410_94_CryptoPro_XchC_ParamSet             838
-#define OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet             OBJ_cryptopro,33L,3L
-
-#define SN_id_GostR3410_2001_TestParamSet               "id-GostR3410-2001-TestParamSet"
-#define NID_id_GostR3410_2001_TestParamSet              839
-#define OBJ_id_GostR3410_2001_TestParamSet              OBJ_cryptopro,35L,0L
-
-#define SN_id_GostR3410_2001_CryptoPro_A_ParamSet               "id-GostR3410-2001-CryptoPro-A-ParamSet"
-#define NID_id_GostR3410_2001_CryptoPro_A_ParamSet              840
-#define OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet              OBJ_cryptopro,35L,1L
-
-#define SN_id_GostR3410_2001_CryptoPro_B_ParamSet               "id-GostR3410-2001-CryptoPro-B-ParamSet"
-#define NID_id_GostR3410_2001_CryptoPro_B_ParamSet              841
-#define OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet              OBJ_cryptopro,35L,2L
-
-#define SN_id_GostR3410_2001_CryptoPro_C_ParamSet               "id-GostR3410-2001-CryptoPro-C-ParamSet"
-#define NID_id_GostR3410_2001_CryptoPro_C_ParamSet              842
-#define OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet              OBJ_cryptopro,35L,3L
-
-#define SN_id_GostR3410_2001_CryptoPro_XchA_ParamSet            "id-GostR3410-2001-CryptoPro-XchA-ParamSet"
-#define NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet           843
-#define OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet           OBJ_cryptopro,36L,0L
-
-#define SN_id_GostR3410_2001_CryptoPro_XchB_ParamSet            "id-GostR3410-2001-CryptoPro-XchB-ParamSet"
-#define NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet           844
-#define OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet           OBJ_cryptopro,36L,1L
-
-#define SN_id_GostR3410_94_a            "id-GostR3410-94-a"
-#define NID_id_GostR3410_94_a           845
-#define OBJ_id_GostR3410_94_a           OBJ_id_GostR3410_94,1L
-
-#define SN_id_GostR3410_94_aBis         "id-GostR3410-94-aBis"
-#define NID_id_GostR3410_94_aBis                846
-#define OBJ_id_GostR3410_94_aBis                OBJ_id_GostR3410_94,2L
-
-#define SN_id_GostR3410_94_b            "id-GostR3410-94-b"
-#define NID_id_GostR3410_94_b           847
-#define OBJ_id_GostR3410_94_b           OBJ_id_GostR3410_94,3L
-
-#define SN_id_GostR3410_94_bBis         "id-GostR3410-94-bBis"
-#define NID_id_GostR3410_94_bBis                848
-#define OBJ_id_GostR3410_94_bBis                OBJ_id_GostR3410_94,4L
-
-#define SN_id_Gost28147_89_cc           "id-Gost28147-89-cc"
-#define LN_id_Gost28147_89_cc           "GOST 28147-89 Cryptocom ParamSet"
-#define NID_id_Gost28147_89_cc          849
-#define OBJ_id_Gost28147_89_cc          OBJ_cryptocom,1L,6L,1L
-
-#define SN_id_GostR3410_94_cc           "gost94cc"
-#define LN_id_GostR3410_94_cc           "GOST 34.10-94 Cryptocom"
-#define NID_id_GostR3410_94_cc          850
-#define OBJ_id_GostR3410_94_cc          OBJ_cryptocom,1L,5L,3L
-
-#define SN_id_GostR3410_2001_cc         "gost2001cc"
-#define LN_id_GostR3410_2001_cc         "GOST 34.10-2001 Cryptocom"
-#define NID_id_GostR3410_2001_cc                851
-#define OBJ_id_GostR3410_2001_cc                OBJ_cryptocom,1L,5L,4L
-
-#define SN_id_GostR3411_94_with_GostR3410_94_cc         "id-GostR3411-94-with-GostR3410-94-cc"
-#define LN_id_GostR3411_94_with_GostR3410_94_cc         "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom"
-#define NID_id_GostR3411_94_with_GostR3410_94_cc                852
-#define OBJ_id_GostR3411_94_with_GostR3410_94_cc                OBJ_cryptocom,1L,3L,3L
-
-#define SN_id_GostR3411_94_with_GostR3410_2001_cc               "id-GostR3411-94-with-GostR3410-2001-cc"
-#define LN_id_GostR3411_94_with_GostR3410_2001_cc               "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom"
-#define NID_id_GostR3411_94_with_GostR3410_2001_cc              853
-#define OBJ_id_GostR3411_94_with_GostR3410_2001_cc              OBJ_cryptocom,1L,3L,4L
-
-#define SN_id_GostR3410_2001_ParamSet_cc                "id-GostR3410-2001-ParamSet-cc"
-#define LN_id_GostR3410_2001_ParamSet_cc                "GOST R 3410-2001 Parameter Set Cryptocom"
-#define NID_id_GostR3410_2001_ParamSet_cc               854
-#define OBJ_id_GostR3410_2001_ParamSet_cc               OBJ_cryptocom,1L,8L,1L
-
-#define SN_id_tc26_algorithms           "id-tc26-algorithms"
-#define NID_id_tc26_algorithms          977
-#define OBJ_id_tc26_algorithms          OBJ_id_tc26,1L
-
-#define SN_id_tc26_sign         "id-tc26-sign"
-#define NID_id_tc26_sign                978
-#define OBJ_id_tc26_sign                OBJ_id_tc26_algorithms,1L
-
-#define SN_id_GostR3410_2012_256                "gost2012_256"
-#define LN_id_GostR3410_2012_256                "GOST R 34.10-2012 with 256 bit modulus"
-#define NID_id_GostR3410_2012_256               979
-#define OBJ_id_GostR3410_2012_256               OBJ_id_tc26_sign,1L
-
-#define SN_id_GostR3410_2012_512                "gost2012_512"
-#define LN_id_GostR3410_2012_512                "GOST R 34.10-2012 with 512 bit modulus"
-#define NID_id_GostR3410_2012_512               980
-#define OBJ_id_GostR3410_2012_512               OBJ_id_tc26_sign,2L
-
-#define SN_id_tc26_digest               "id-tc26-digest"
-#define NID_id_tc26_digest              981
-#define OBJ_id_tc26_digest              OBJ_id_tc26_algorithms,2L
-
-#define SN_id_GostR3411_2012_256                "md_gost12_256"
-#define LN_id_GostR3411_2012_256                "GOST R 34.11-2012 with 256 bit hash"
-#define NID_id_GostR3411_2012_256               982
-#define OBJ_id_GostR3411_2012_256               OBJ_id_tc26_digest,2L
-
-#define SN_id_GostR3411_2012_512                "md_gost12_512"
-#define LN_id_GostR3411_2012_512                "GOST R 34.11-2012 with 512 bit hash"
-#define NID_id_GostR3411_2012_512               983
-#define OBJ_id_GostR3411_2012_512               OBJ_id_tc26_digest,3L
-
-#define SN_id_tc26_signwithdigest               "id-tc26-signwithdigest"
-#define NID_id_tc26_signwithdigest              984
-#define OBJ_id_tc26_signwithdigest              OBJ_id_tc26_algorithms,3L
-
-#define SN_id_tc26_signwithdigest_gost3410_2012_256             "id-tc26-signwithdigest-gost3410-2012-256"
-#define LN_id_tc26_signwithdigest_gost3410_2012_256             "GOST R 34.10-2012 with GOST R 34.11-2012 (256 bit)"
-#define NID_id_tc26_signwithdigest_gost3410_2012_256            985
-#define OBJ_id_tc26_signwithdigest_gost3410_2012_256            OBJ_id_tc26_signwithdigest,2L
-
-#define SN_id_tc26_signwithdigest_gost3410_2012_512             "id-tc26-signwithdigest-gost3410-2012-512"
-#define LN_id_tc26_signwithdigest_gost3410_2012_512             "GOST R 34.10-2012 with GOST R 34.11-2012 (512 bit)"
-#define NID_id_tc26_signwithdigest_gost3410_2012_512            986
-#define OBJ_id_tc26_signwithdigest_gost3410_2012_512            OBJ_id_tc26_signwithdigest,3L
-
-#define SN_id_tc26_mac          "id-tc26-mac"
-#define NID_id_tc26_mac         987
-#define OBJ_id_tc26_mac         OBJ_id_tc26_algorithms,4L
-
-#define SN_id_tc26_hmac_gost_3411_2012_256              "id-tc26-hmac-gost-3411-2012-256"
-#define LN_id_tc26_hmac_gost_3411_2012_256              "HMAC GOST 34.11-2012 256 bit"
-#define NID_id_tc26_hmac_gost_3411_2012_256             988
-#define OBJ_id_tc26_hmac_gost_3411_2012_256             OBJ_id_tc26_mac,1L
-
-#define SN_id_tc26_hmac_gost_3411_2012_512              "id-tc26-hmac-gost-3411-2012-512"
-#define LN_id_tc26_hmac_gost_3411_2012_512              "HMAC GOST 34.11-2012 512 bit"
-#define NID_id_tc26_hmac_gost_3411_2012_512             989
-#define OBJ_id_tc26_hmac_gost_3411_2012_512             OBJ_id_tc26_mac,2L
-
-#define SN_id_tc26_cipher               "id-tc26-cipher"
-#define NID_id_tc26_cipher              990
-#define OBJ_id_tc26_cipher              OBJ_id_tc26_algorithms,5L
-
-#define SN_id_tc26_cipher_gostr3412_2015_magma          "id-tc26-cipher-gostr3412-2015-magma"
-#define NID_id_tc26_cipher_gostr3412_2015_magma         1173
-#define OBJ_id_tc26_cipher_gostr3412_2015_magma         OBJ_id_tc26_cipher,1L
-
-#define SN_magma_ctr_acpkm              "magma-ctr-acpkm"
-#define NID_magma_ctr_acpkm             1174
-#define OBJ_magma_ctr_acpkm             OBJ_id_tc26_cipher_gostr3412_2015_magma,1L
-
-#define SN_magma_ctr_acpkm_omac         "magma-ctr-acpkm-omac"
-#define NID_magma_ctr_acpkm_omac                1175
-#define OBJ_magma_ctr_acpkm_omac                OBJ_id_tc26_cipher_gostr3412_2015_magma,2L
-
-#define SN_id_tc26_cipher_gostr3412_2015_kuznyechik             "id-tc26-cipher-gostr3412-2015-kuznyechik"
-#define NID_id_tc26_cipher_gostr3412_2015_kuznyechik            1176
-#define OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik            OBJ_id_tc26_cipher,2L
-
-#define SN_kuznyechik_ctr_acpkm         "kuznyechik-ctr-acpkm"
-#define NID_kuznyechik_ctr_acpkm                1177
-#define OBJ_kuznyechik_ctr_acpkm                OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik,1L
-
-#define SN_kuznyechik_ctr_acpkm_omac            "kuznyechik-ctr-acpkm-omac"
-#define NID_kuznyechik_ctr_acpkm_omac           1178
-#define OBJ_kuznyechik_ctr_acpkm_omac           OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik,2L
-
-#define SN_id_tc26_agreement            "id-tc26-agreement"
-#define NID_id_tc26_agreement           991
-#define OBJ_id_tc26_agreement           OBJ_id_tc26_algorithms,6L
-
-#define SN_id_tc26_agreement_gost_3410_2012_256         "id-tc26-agreement-gost-3410-2012-256"
-#define NID_id_tc26_agreement_gost_3410_2012_256                992
-#define OBJ_id_tc26_agreement_gost_3410_2012_256                OBJ_id_tc26_agreement,1L
-
-#define SN_id_tc26_agreement_gost_3410_2012_512         "id-tc26-agreement-gost-3410-2012-512"
-#define NID_id_tc26_agreement_gost_3410_2012_512                993
-#define OBJ_id_tc26_agreement_gost_3410_2012_512                OBJ_id_tc26_agreement,2L
-
-#define SN_id_tc26_wrap         "id-tc26-wrap"
-#define NID_id_tc26_wrap                1179
-#define OBJ_id_tc26_wrap                OBJ_id_tc26_algorithms,7L
-
-#define SN_id_tc26_wrap_gostr3412_2015_magma            "id-tc26-wrap-gostr3412-2015-magma"
-#define NID_id_tc26_wrap_gostr3412_2015_magma           1180
-#define OBJ_id_tc26_wrap_gostr3412_2015_magma           OBJ_id_tc26_wrap,1L
-
-#define SN_magma_kexp15         "magma-kexp15"
-#define NID_magma_kexp15                1181
-#define OBJ_magma_kexp15                OBJ_id_tc26_wrap_gostr3412_2015_magma,1L
-
-#define SN_id_tc26_wrap_gostr3412_2015_kuznyechik               "id-tc26-wrap-gostr3412-2015-kuznyechik"
-#define NID_id_tc26_wrap_gostr3412_2015_kuznyechik              1182
-#define OBJ_id_tc26_wrap_gostr3412_2015_kuznyechik              OBJ_id_tc26_wrap,2L
-
-#define SN_kuznyechik_kexp15            "kuznyechik-kexp15"
-#define NID_kuznyechik_kexp15           1183
-#define OBJ_kuznyechik_kexp15           OBJ_id_tc26_wrap_gostr3412_2015_kuznyechik,1L
-
-#define SN_id_tc26_constants            "id-tc26-constants"
-#define NID_id_tc26_constants           994
-#define OBJ_id_tc26_constants           OBJ_id_tc26,2L
-
-#define SN_id_tc26_sign_constants               "id-tc26-sign-constants"
-#define NID_id_tc26_sign_constants              995
-#define OBJ_id_tc26_sign_constants              OBJ_id_tc26_constants,1L
-
-#define SN_id_tc26_gost_3410_2012_256_constants         "id-tc26-gost-3410-2012-256-constants"
-#define NID_id_tc26_gost_3410_2012_256_constants                1147
-#define OBJ_id_tc26_gost_3410_2012_256_constants                OBJ_id_tc26_sign_constants,1L
-
-#define SN_id_tc26_gost_3410_2012_256_paramSetA         "id-tc26-gost-3410-2012-256-paramSetA"
-#define LN_id_tc26_gost_3410_2012_256_paramSetA         "GOST R 34.10-2012 (256 bit) ParamSet A"
-#define NID_id_tc26_gost_3410_2012_256_paramSetA                1148
-#define OBJ_id_tc26_gost_3410_2012_256_paramSetA                OBJ_id_tc26_gost_3410_2012_256_constants,1L
-
-#define SN_id_tc26_gost_3410_2012_256_paramSetB         "id-tc26-gost-3410-2012-256-paramSetB"
-#define LN_id_tc26_gost_3410_2012_256_paramSetB         "GOST R 34.10-2012 (256 bit) ParamSet B"
-#define NID_id_tc26_gost_3410_2012_256_paramSetB                1184
-#define OBJ_id_tc26_gost_3410_2012_256_paramSetB                OBJ_id_tc26_gost_3410_2012_256_constants,2L
-
-#define SN_id_tc26_gost_3410_2012_256_paramSetC         "id-tc26-gost-3410-2012-256-paramSetC"
-#define LN_id_tc26_gost_3410_2012_256_paramSetC         "GOST R 34.10-2012 (256 bit) ParamSet C"
-#define NID_id_tc26_gost_3410_2012_256_paramSetC                1185
-#define OBJ_id_tc26_gost_3410_2012_256_paramSetC                OBJ_id_tc26_gost_3410_2012_256_constants,3L
-
-#define SN_id_tc26_gost_3410_2012_256_paramSetD         "id-tc26-gost-3410-2012-256-paramSetD"
-#define LN_id_tc26_gost_3410_2012_256_paramSetD         "GOST R 34.10-2012 (256 bit) ParamSet D"
-#define NID_id_tc26_gost_3410_2012_256_paramSetD                1186
-#define OBJ_id_tc26_gost_3410_2012_256_paramSetD                OBJ_id_tc26_gost_3410_2012_256_constants,4L
-
-#define SN_id_tc26_gost_3410_2012_512_constants         "id-tc26-gost-3410-2012-512-constants"
-#define NID_id_tc26_gost_3410_2012_512_constants                996
-#define OBJ_id_tc26_gost_3410_2012_512_constants                OBJ_id_tc26_sign_constants,2L
-
-#define SN_id_tc26_gost_3410_2012_512_paramSetTest              "id-tc26-gost-3410-2012-512-paramSetTest"
-#define LN_id_tc26_gost_3410_2012_512_paramSetTest              "GOST R 34.10-2012 (512 bit) testing parameter set"
-#define NID_id_tc26_gost_3410_2012_512_paramSetTest             997
-#define OBJ_id_tc26_gost_3410_2012_512_paramSetTest             OBJ_id_tc26_gost_3410_2012_512_constants,0L
-
-#define SN_id_tc26_gost_3410_2012_512_paramSetA         "id-tc26-gost-3410-2012-512-paramSetA"
-#define LN_id_tc26_gost_3410_2012_512_paramSetA         "GOST R 34.10-2012 (512 bit) ParamSet A"
-#define NID_id_tc26_gost_3410_2012_512_paramSetA                998
-#define OBJ_id_tc26_gost_3410_2012_512_paramSetA                OBJ_id_tc26_gost_3410_2012_512_constants,1L
-
-#define SN_id_tc26_gost_3410_2012_512_paramSetB         "id-tc26-gost-3410-2012-512-paramSetB"
-#define LN_id_tc26_gost_3410_2012_512_paramSetB         "GOST R 34.10-2012 (512 bit) ParamSet B"
-#define NID_id_tc26_gost_3410_2012_512_paramSetB                999
-#define OBJ_id_tc26_gost_3410_2012_512_paramSetB                OBJ_id_tc26_gost_3410_2012_512_constants,2L
-
-#define SN_id_tc26_gost_3410_2012_512_paramSetC         "id-tc26-gost-3410-2012-512-paramSetC"
-#define LN_id_tc26_gost_3410_2012_512_paramSetC         "GOST R 34.10-2012 (512 bit) ParamSet C"
-#define NID_id_tc26_gost_3410_2012_512_paramSetC                1149
-#define OBJ_id_tc26_gost_3410_2012_512_paramSetC                OBJ_id_tc26_gost_3410_2012_512_constants,3L
-
-#define SN_id_tc26_digest_constants             "id-tc26-digest-constants"
-#define NID_id_tc26_digest_constants            1000
-#define OBJ_id_tc26_digest_constants            OBJ_id_tc26_constants,2L
-
-#define SN_id_tc26_cipher_constants             "id-tc26-cipher-constants"
-#define NID_id_tc26_cipher_constants            1001
-#define OBJ_id_tc26_cipher_constants            OBJ_id_tc26_constants,5L
-
-#define SN_id_tc26_gost_28147_constants         "id-tc26-gost-28147-constants"
-#define NID_id_tc26_gost_28147_constants                1002
-#define OBJ_id_tc26_gost_28147_constants                OBJ_id_tc26_cipher_constants,1L
-
-#define SN_id_tc26_gost_28147_param_Z           "id-tc26-gost-28147-param-Z"
-#define LN_id_tc26_gost_28147_param_Z           "GOST 28147-89 TC26 parameter set"
-#define NID_id_tc26_gost_28147_param_Z          1003
-#define OBJ_id_tc26_gost_28147_param_Z          OBJ_id_tc26_gost_28147_constants,1L
-
-#define SN_INN          "INN"
-#define LN_INN          "INN"
-#define NID_INN         1004
-#define OBJ_INN         OBJ_member_body,643L,3L,131L,1L,1L
-
-#define SN_OGRN         "OGRN"
-#define LN_OGRN         "OGRN"
-#define NID_OGRN                1005
-#define OBJ_OGRN                OBJ_member_body,643L,100L,1L
-
-#define SN_SNILS                "SNILS"
-#define LN_SNILS                "SNILS"
-#define NID_SNILS               1006
-#define OBJ_SNILS               OBJ_member_body,643L,100L,3L
-
-#define SN_OGRNIP               "OGRNIP"
-#define LN_OGRNIP               "OGRNIP"
-#define NID_OGRNIP              1226
-#define OBJ_OGRNIP              OBJ_member_body,643L,100L,5L
-
-#define SN_subjectSignTool              "subjectSignTool"
-#define LN_subjectSignTool              "Signing Tool of Subject"
-#define NID_subjectSignTool             1007
-#define OBJ_subjectSignTool             OBJ_member_body,643L,100L,111L
-
-#define SN_issuerSignTool               "issuerSignTool"
-#define LN_issuerSignTool               "Signing Tool of Issuer"
-#define NID_issuerSignTool              1008
-#define OBJ_issuerSignTool              OBJ_member_body,643L,100L,112L
-
-#define SN_classSignTool                "classSignTool"
-#define LN_classSignTool                "Class of Signing Tool"
-#define NID_classSignTool               1227
-#define OBJ_classSignTool               OBJ_member_body,643L,100L,113L
-
-#define SN_classSignToolKC1             "classSignToolKC1"
-#define LN_classSignToolKC1             "Class of Signing Tool KC1"
-#define NID_classSignToolKC1            1228
-#define OBJ_classSignToolKC1            OBJ_member_body,643L,100L,113L,1L
-
-#define SN_classSignToolKC2             "classSignToolKC2"
-#define LN_classSignToolKC2             "Class of Signing Tool KC2"
-#define NID_classSignToolKC2            1229
-#define OBJ_classSignToolKC2            OBJ_member_body,643L,100L,113L,2L
-
-#define SN_classSignToolKC3             "classSignToolKC3"
-#define LN_classSignToolKC3             "Class of Signing Tool KC3"
-#define NID_classSignToolKC3            1230
-#define OBJ_classSignToolKC3            OBJ_member_body,643L,100L,113L,3L
-
-#define SN_classSignToolKB1             "classSignToolKB1"
-#define LN_classSignToolKB1             "Class of Signing Tool KB1"
-#define NID_classSignToolKB1            1231
-#define OBJ_classSignToolKB1            OBJ_member_body,643L,100L,113L,4L
-
-#define SN_classSignToolKB2             "classSignToolKB2"
-#define LN_classSignToolKB2             "Class of Signing Tool KB2"
-#define NID_classSignToolKB2            1232
-#define OBJ_classSignToolKB2            OBJ_member_body,643L,100L,113L,5L
-
-#define SN_classSignToolKA1             "classSignToolKA1"
-#define LN_classSignToolKA1             "Class of Signing Tool KA1"
-#define NID_classSignToolKA1            1233
-#define OBJ_classSignToolKA1            OBJ_member_body,643L,100L,113L,6L
-
-#define SN_kuznyechik_ecb               "kuznyechik-ecb"
-#define NID_kuznyechik_ecb              1012
-
-#define SN_kuznyechik_ctr               "kuznyechik-ctr"
-#define NID_kuznyechik_ctr              1013
-
-#define SN_kuznyechik_ofb               "kuznyechik-ofb"
-#define NID_kuznyechik_ofb              1014
-
-#define SN_kuznyechik_cbc               "kuznyechik-cbc"
-#define NID_kuznyechik_cbc              1015
-
-#define SN_kuznyechik_cfb               "kuznyechik-cfb"
-#define NID_kuznyechik_cfb              1016
-
-#define SN_kuznyechik_mac               "kuznyechik-mac"
-#define NID_kuznyechik_mac              1017
-
-#define SN_magma_ecb            "magma-ecb"
-#define NID_magma_ecb           1187
-
-#define SN_magma_ctr            "magma-ctr"
-#define NID_magma_ctr           1188
-
-#define SN_magma_ofb            "magma-ofb"
-#define NID_magma_ofb           1189
-
-#define SN_magma_cbc            "magma-cbc"
-#define NID_magma_cbc           1190
-
-#define SN_magma_cfb            "magma-cfb"
-#define NID_magma_cfb           1191
-
-#define SN_magma_mac            "magma-mac"
-#define NID_magma_mac           1192
-
-#define SN_camellia_128_cbc             "CAMELLIA-128-CBC"
-#define LN_camellia_128_cbc             "camellia-128-cbc"
-#define NID_camellia_128_cbc            751
-#define OBJ_camellia_128_cbc            1L,2L,392L,200011L,61L,1L,1L,1L,2L
-
-#define SN_camellia_192_cbc             "CAMELLIA-192-CBC"
-#define LN_camellia_192_cbc             "camellia-192-cbc"
-#define NID_camellia_192_cbc            752
-#define OBJ_camellia_192_cbc            1L,2L,392L,200011L,61L,1L,1L,1L,3L
-
-#define SN_camellia_256_cbc             "CAMELLIA-256-CBC"
-#define LN_camellia_256_cbc             "camellia-256-cbc"
-#define NID_camellia_256_cbc            753
-#define OBJ_camellia_256_cbc            1L,2L,392L,200011L,61L,1L,1L,1L,4L
-
-#define SN_id_camellia128_wrap          "id-camellia128-wrap"
-#define NID_id_camellia128_wrap         907
-#define OBJ_id_camellia128_wrap         1L,2L,392L,200011L,61L,1L,1L,3L,2L
-
-#define SN_id_camellia192_wrap          "id-camellia192-wrap"
-#define NID_id_camellia192_wrap         908
-#define OBJ_id_camellia192_wrap         1L,2L,392L,200011L,61L,1L,1L,3L,3L
-
-#define SN_id_camellia256_wrap          "id-camellia256-wrap"
-#define NID_id_camellia256_wrap         909
-#define OBJ_id_camellia256_wrap         1L,2L,392L,200011L,61L,1L,1L,3L,4L
-
-#define OBJ_ntt_ds              0L,3L,4401L,5L
-
-#define OBJ_camellia            OBJ_ntt_ds,3L,1L,9L
-
-#define SN_camellia_128_ecb             "CAMELLIA-128-ECB"
-#define LN_camellia_128_ecb             "camellia-128-ecb"
-#define NID_camellia_128_ecb            754
-#define OBJ_camellia_128_ecb            OBJ_camellia,1L
-
-#define SN_camellia_128_ofb128          "CAMELLIA-128-OFB"
-#define LN_camellia_128_ofb128          "camellia-128-ofb"
-#define NID_camellia_128_ofb128         766
-#define OBJ_camellia_128_ofb128         OBJ_camellia,3L
-
-#define SN_camellia_128_cfb128          "CAMELLIA-128-CFB"
-#define LN_camellia_128_cfb128          "camellia-128-cfb"
-#define NID_camellia_128_cfb128         757
-#define OBJ_camellia_128_cfb128         OBJ_camellia,4L
-
-#define SN_camellia_128_gcm             "CAMELLIA-128-GCM"
-#define LN_camellia_128_gcm             "camellia-128-gcm"
-#define NID_camellia_128_gcm            961
-#define OBJ_camellia_128_gcm            OBJ_camellia,6L
-
-#define SN_camellia_128_ccm             "CAMELLIA-128-CCM"
-#define LN_camellia_128_ccm             "camellia-128-ccm"
-#define NID_camellia_128_ccm            962
-#define OBJ_camellia_128_ccm            OBJ_camellia,7L
-
-#define SN_camellia_128_ctr             "CAMELLIA-128-CTR"
-#define LN_camellia_128_ctr             "camellia-128-ctr"
-#define NID_camellia_128_ctr            963
-#define OBJ_camellia_128_ctr            OBJ_camellia,9L
-
-#define SN_camellia_128_cmac            "CAMELLIA-128-CMAC"
-#define LN_camellia_128_cmac            "camellia-128-cmac"
-#define NID_camellia_128_cmac           964
-#define OBJ_camellia_128_cmac           OBJ_camellia,10L
-
-#define SN_camellia_192_ecb             "CAMELLIA-192-ECB"
-#define LN_camellia_192_ecb             "camellia-192-ecb"
-#define NID_camellia_192_ecb            755
-#define OBJ_camellia_192_ecb            OBJ_camellia,21L
-
-#define SN_camellia_192_ofb128          "CAMELLIA-192-OFB"
-#define LN_camellia_192_ofb128          "camellia-192-ofb"
-#define NID_camellia_192_ofb128         767
-#define OBJ_camellia_192_ofb128         OBJ_camellia,23L
-
-#define SN_camellia_192_cfb128          "CAMELLIA-192-CFB"
-#define LN_camellia_192_cfb128          "camellia-192-cfb"
-#define NID_camellia_192_cfb128         758
-#define OBJ_camellia_192_cfb128         OBJ_camellia,24L
-
-#define SN_camellia_192_gcm             "CAMELLIA-192-GCM"
-#define LN_camellia_192_gcm             "camellia-192-gcm"
-#define NID_camellia_192_gcm            965
-#define OBJ_camellia_192_gcm            OBJ_camellia,26L
-
-#define SN_camellia_192_ccm             "CAMELLIA-192-CCM"
-#define LN_camellia_192_ccm             "camellia-192-ccm"
-#define NID_camellia_192_ccm            966
-#define OBJ_camellia_192_ccm            OBJ_camellia,27L
-
-#define SN_camellia_192_ctr             "CAMELLIA-192-CTR"
-#define LN_camellia_192_ctr             "camellia-192-ctr"
-#define NID_camellia_192_ctr            967
-#define OBJ_camellia_192_ctr            OBJ_camellia,29L
-
-#define SN_camellia_192_cmac            "CAMELLIA-192-CMAC"
-#define LN_camellia_192_cmac            "camellia-192-cmac"
-#define NID_camellia_192_cmac           968
-#define OBJ_camellia_192_cmac           OBJ_camellia,30L
-
-#define SN_camellia_256_ecb             "CAMELLIA-256-ECB"
-#define LN_camellia_256_ecb             "camellia-256-ecb"
-#define NID_camellia_256_ecb            756
-#define OBJ_camellia_256_ecb            OBJ_camellia,41L
-
-#define SN_camellia_256_ofb128          "CAMELLIA-256-OFB"
-#define LN_camellia_256_ofb128          "camellia-256-ofb"
-#define NID_camellia_256_ofb128         768
-#define OBJ_camellia_256_ofb128         OBJ_camellia,43L
-
-#define SN_camellia_256_cfb128          "CAMELLIA-256-CFB"
-#define LN_camellia_256_cfb128          "camellia-256-cfb"
-#define NID_camellia_256_cfb128         759
-#define OBJ_camellia_256_cfb128         OBJ_camellia,44L
-
-#define SN_camellia_256_gcm             "CAMELLIA-256-GCM"
-#define LN_camellia_256_gcm             "camellia-256-gcm"
-#define NID_camellia_256_gcm            969
-#define OBJ_camellia_256_gcm            OBJ_camellia,46L
-
-#define SN_camellia_256_ccm             "CAMELLIA-256-CCM"
-#define LN_camellia_256_ccm             "camellia-256-ccm"
-#define NID_camellia_256_ccm            970
-#define OBJ_camellia_256_ccm            OBJ_camellia,47L
-
-#define SN_camellia_256_ctr             "CAMELLIA-256-CTR"
-#define LN_camellia_256_ctr             "camellia-256-ctr"
-#define NID_camellia_256_ctr            971
-#define OBJ_camellia_256_ctr            OBJ_camellia,49L
-
-#define SN_camellia_256_cmac            "CAMELLIA-256-CMAC"
-#define LN_camellia_256_cmac            "camellia-256-cmac"
-#define NID_camellia_256_cmac           972
-#define OBJ_camellia_256_cmac           OBJ_camellia,50L
-
-#define SN_camellia_128_cfb1            "CAMELLIA-128-CFB1"
-#define LN_camellia_128_cfb1            "camellia-128-cfb1"
-#define NID_camellia_128_cfb1           760
-
-#define SN_camellia_192_cfb1            "CAMELLIA-192-CFB1"
-#define LN_camellia_192_cfb1            "camellia-192-cfb1"
-#define NID_camellia_192_cfb1           761
-
-#define SN_camellia_256_cfb1            "CAMELLIA-256-CFB1"
-#define LN_camellia_256_cfb1            "camellia-256-cfb1"
-#define NID_camellia_256_cfb1           762
-
-#define SN_camellia_128_cfb8            "CAMELLIA-128-CFB8"
-#define LN_camellia_128_cfb8            "camellia-128-cfb8"
-#define NID_camellia_128_cfb8           763
-
-#define SN_camellia_192_cfb8            "CAMELLIA-192-CFB8"
-#define LN_camellia_192_cfb8            "camellia-192-cfb8"
-#define NID_camellia_192_cfb8           764
-
-#define SN_camellia_256_cfb8            "CAMELLIA-256-CFB8"
-#define LN_camellia_256_cfb8            "camellia-256-cfb8"
-#define NID_camellia_256_cfb8           765
-
-#define OBJ_aria                1L,2L,410L,200046L,1L,1L
-
-#define SN_aria_128_ecb         "ARIA-128-ECB"
-#define LN_aria_128_ecb         "aria-128-ecb"
-#define NID_aria_128_ecb                1065
-#define OBJ_aria_128_ecb                OBJ_aria,1L
-
-#define SN_aria_128_cbc         "ARIA-128-CBC"
-#define LN_aria_128_cbc         "aria-128-cbc"
-#define NID_aria_128_cbc                1066
-#define OBJ_aria_128_cbc                OBJ_aria,2L
-
-#define SN_aria_128_cfb128              "ARIA-128-CFB"
-#define LN_aria_128_cfb128              "aria-128-cfb"
-#define NID_aria_128_cfb128             1067
-#define OBJ_aria_128_cfb128             OBJ_aria,3L
-
-#define SN_aria_128_ofb128              "ARIA-128-OFB"
-#define LN_aria_128_ofb128              "aria-128-ofb"
-#define NID_aria_128_ofb128             1068
-#define OBJ_aria_128_ofb128             OBJ_aria,4L
-
-#define SN_aria_128_ctr         "ARIA-128-CTR"
-#define LN_aria_128_ctr         "aria-128-ctr"
-#define NID_aria_128_ctr                1069
-#define OBJ_aria_128_ctr                OBJ_aria,5L
-
-#define SN_aria_192_ecb         "ARIA-192-ECB"
-#define LN_aria_192_ecb         "aria-192-ecb"
-#define NID_aria_192_ecb                1070
-#define OBJ_aria_192_ecb                OBJ_aria,6L
-
-#define SN_aria_192_cbc         "ARIA-192-CBC"
-#define LN_aria_192_cbc         "aria-192-cbc"
-#define NID_aria_192_cbc                1071
-#define OBJ_aria_192_cbc                OBJ_aria,7L
-
-#define SN_aria_192_cfb128              "ARIA-192-CFB"
-#define LN_aria_192_cfb128              "aria-192-cfb"
-#define NID_aria_192_cfb128             1072
-#define OBJ_aria_192_cfb128             OBJ_aria,8L
-
-#define SN_aria_192_ofb128              "ARIA-192-OFB"
-#define LN_aria_192_ofb128              "aria-192-ofb"
-#define NID_aria_192_ofb128             1073
-#define OBJ_aria_192_ofb128             OBJ_aria,9L
-
-#define SN_aria_192_ctr         "ARIA-192-CTR"
-#define LN_aria_192_ctr         "aria-192-ctr"
-#define NID_aria_192_ctr                1074
-#define OBJ_aria_192_ctr                OBJ_aria,10L
-
-#define SN_aria_256_ecb         "ARIA-256-ECB"
-#define LN_aria_256_ecb         "aria-256-ecb"
-#define NID_aria_256_ecb                1075
-#define OBJ_aria_256_ecb                OBJ_aria,11L
-
-#define SN_aria_256_cbc         "ARIA-256-CBC"
-#define LN_aria_256_cbc         "aria-256-cbc"
-#define NID_aria_256_cbc                1076
-#define OBJ_aria_256_cbc                OBJ_aria,12L
-
-#define SN_aria_256_cfb128              "ARIA-256-CFB"
-#define LN_aria_256_cfb128              "aria-256-cfb"
-#define NID_aria_256_cfb128             1077
-#define OBJ_aria_256_cfb128             OBJ_aria,13L
-
-#define SN_aria_256_ofb128              "ARIA-256-OFB"
-#define LN_aria_256_ofb128              "aria-256-ofb"
-#define NID_aria_256_ofb128             1078
-#define OBJ_aria_256_ofb128             OBJ_aria,14L
-
-#define SN_aria_256_ctr         "ARIA-256-CTR"
-#define LN_aria_256_ctr         "aria-256-ctr"
-#define NID_aria_256_ctr                1079
-#define OBJ_aria_256_ctr                OBJ_aria,15L
-
-#define SN_aria_128_cfb1                "ARIA-128-CFB1"
-#define LN_aria_128_cfb1                "aria-128-cfb1"
-#define NID_aria_128_cfb1               1080
-
-#define SN_aria_192_cfb1                "ARIA-192-CFB1"
-#define LN_aria_192_cfb1                "aria-192-cfb1"
-#define NID_aria_192_cfb1               1081
-
-#define SN_aria_256_cfb1                "ARIA-256-CFB1"
-#define LN_aria_256_cfb1                "aria-256-cfb1"
-#define NID_aria_256_cfb1               1082
-
-#define SN_aria_128_cfb8                "ARIA-128-CFB8"
-#define LN_aria_128_cfb8                "aria-128-cfb8"
-#define NID_aria_128_cfb8               1083
-
-#define SN_aria_192_cfb8                "ARIA-192-CFB8"
-#define LN_aria_192_cfb8                "aria-192-cfb8"
-#define NID_aria_192_cfb8               1084
-
-#define SN_aria_256_cfb8                "ARIA-256-CFB8"
-#define LN_aria_256_cfb8                "aria-256-cfb8"
-#define NID_aria_256_cfb8               1085
-
-#define SN_aria_128_ccm         "ARIA-128-CCM"
-#define LN_aria_128_ccm         "aria-128-ccm"
-#define NID_aria_128_ccm                1120
-#define OBJ_aria_128_ccm                OBJ_aria,37L
-
-#define SN_aria_192_ccm         "ARIA-192-CCM"
-#define LN_aria_192_ccm         "aria-192-ccm"
-#define NID_aria_192_ccm                1121
-#define OBJ_aria_192_ccm                OBJ_aria,38L
-
-#define SN_aria_256_ccm         "ARIA-256-CCM"
-#define LN_aria_256_ccm         "aria-256-ccm"
-#define NID_aria_256_ccm                1122
-#define OBJ_aria_256_ccm                OBJ_aria,39L
-
-#define SN_aria_128_gcm         "ARIA-128-GCM"
-#define LN_aria_128_gcm         "aria-128-gcm"
-#define NID_aria_128_gcm                1123
-#define OBJ_aria_128_gcm                OBJ_aria,34L
-
-#define SN_aria_192_gcm         "ARIA-192-GCM"
-#define LN_aria_192_gcm         "aria-192-gcm"
-#define NID_aria_192_gcm                1124
-#define OBJ_aria_192_gcm                OBJ_aria,35L
-
-#define SN_aria_256_gcm         "ARIA-256-GCM"
-#define LN_aria_256_gcm         "aria-256-gcm"
-#define NID_aria_256_gcm                1125
-#define OBJ_aria_256_gcm                OBJ_aria,36L
-
-#define SN_kisa         "KISA"
-#define LN_kisa         "kisa"
-#define NID_kisa                773
-#define OBJ_kisa                OBJ_member_body,410L,200004L
-
-#define SN_seed_ecb             "SEED-ECB"
-#define LN_seed_ecb             "seed-ecb"
-#define NID_seed_ecb            776
-#define OBJ_seed_ecb            OBJ_kisa,1L,3L
-
-#define SN_seed_cbc             "SEED-CBC"
-#define LN_seed_cbc             "seed-cbc"
-#define NID_seed_cbc            777
-#define OBJ_seed_cbc            OBJ_kisa,1L,4L
-
-#define SN_seed_cfb128          "SEED-CFB"
-#define LN_seed_cfb128          "seed-cfb"
-#define NID_seed_cfb128         779
-#define OBJ_seed_cfb128         OBJ_kisa,1L,5L
-
-#define SN_seed_ofb128          "SEED-OFB"
-#define LN_seed_ofb128          "seed-ofb"
-#define NID_seed_ofb128         778
-#define OBJ_seed_ofb128         OBJ_kisa,1L,6L
-
-#define SN_sm4_ecb              "SM4-ECB"
-#define LN_sm4_ecb              "sm4-ecb"
-#define NID_sm4_ecb             1133
-#define OBJ_sm4_ecb             OBJ_sm_scheme,104L,1L
-
-#define SN_sm4_cbc              "SM4-CBC"
-#define LN_sm4_cbc              "sm4-cbc"
-#define NID_sm4_cbc             1134
-#define OBJ_sm4_cbc             OBJ_sm_scheme,104L,2L
-
-#define SN_sm4_ofb128           "SM4-OFB"
-#define LN_sm4_ofb128           "sm4-ofb"
-#define NID_sm4_ofb128          1135
-#define OBJ_sm4_ofb128          OBJ_sm_scheme,104L,3L
-
-#define SN_sm4_cfb128           "SM4-CFB"
-#define LN_sm4_cfb128           "sm4-cfb"
-#define NID_sm4_cfb128          1137
-#define OBJ_sm4_cfb128          OBJ_sm_scheme,104L,4L
-
-#define SN_sm4_cfb1             "SM4-CFB1"
-#define LN_sm4_cfb1             "sm4-cfb1"
-#define NID_sm4_cfb1            1136
-#define OBJ_sm4_cfb1            OBJ_sm_scheme,104L,5L
-
-#define SN_sm4_cfb8             "SM4-CFB8"
-#define LN_sm4_cfb8             "sm4-cfb8"
-#define NID_sm4_cfb8            1138
-#define OBJ_sm4_cfb8            OBJ_sm_scheme,104L,6L
-
-#define SN_sm4_ctr              "SM4-CTR"
-#define LN_sm4_ctr              "sm4-ctr"
-#define NID_sm4_ctr             1139
-#define OBJ_sm4_ctr             OBJ_sm_scheme,104L,7L
-
-#define SN_sm4_gcm              "SM4-GCM"
-#define LN_sm4_gcm              "sm4-gcm"
-#define NID_sm4_gcm             1248
-#define OBJ_sm4_gcm             OBJ_sm_scheme,104L,8L
-
-#define SN_sm4_ccm              "SM4-CCM"
-#define LN_sm4_ccm              "sm4-ccm"
-#define NID_sm4_ccm             1249
-#define OBJ_sm4_ccm             OBJ_sm_scheme,104L,9L
-
-#define SN_sm4_xts              "SM4-XTS"
-#define LN_sm4_xts              "sm4-xts"
-#define NID_sm4_xts             1290
-#define OBJ_sm4_xts             OBJ_sm_scheme,104L,10L
-
-#define SN_hmac         "HMAC"
-#define LN_hmac         "hmac"
-#define NID_hmac                855
-
-#define SN_cmac         "CMAC"
-#define LN_cmac         "cmac"
-#define NID_cmac                894
-
-#define SN_rc4_hmac_md5         "RC4-HMAC-MD5"
-#define LN_rc4_hmac_md5         "rc4-hmac-md5"
-#define NID_rc4_hmac_md5                915
-
-#define SN_aes_128_cbc_hmac_sha1                "AES-128-CBC-HMAC-SHA1"
-#define LN_aes_128_cbc_hmac_sha1                "aes-128-cbc-hmac-sha1"
-#define NID_aes_128_cbc_hmac_sha1               916
-
-#define SN_aes_192_cbc_hmac_sha1                "AES-192-CBC-HMAC-SHA1"
-#define LN_aes_192_cbc_hmac_sha1                "aes-192-cbc-hmac-sha1"
-#define NID_aes_192_cbc_hmac_sha1               917
-
-#define SN_aes_256_cbc_hmac_sha1                "AES-256-CBC-HMAC-SHA1"
-#define LN_aes_256_cbc_hmac_sha1                "aes-256-cbc-hmac-sha1"
-#define NID_aes_256_cbc_hmac_sha1               918
-
-#define SN_aes_128_cbc_hmac_sha256              "AES-128-CBC-HMAC-SHA256"
-#define LN_aes_128_cbc_hmac_sha256              "aes-128-cbc-hmac-sha256"
-#define NID_aes_128_cbc_hmac_sha256             948
-
-#define SN_aes_192_cbc_hmac_sha256              "AES-192-CBC-HMAC-SHA256"
-#define LN_aes_192_cbc_hmac_sha256              "aes-192-cbc-hmac-sha256"
-#define NID_aes_192_cbc_hmac_sha256             949
-
-#define SN_aes_256_cbc_hmac_sha256              "AES-256-CBC-HMAC-SHA256"
-#define LN_aes_256_cbc_hmac_sha256              "aes-256-cbc-hmac-sha256"
-#define NID_aes_256_cbc_hmac_sha256             950
-
-#define SN_chacha20_poly1305            "ChaCha20-Poly1305"
-#define LN_chacha20_poly1305            "chacha20-poly1305"
-#define NID_chacha20_poly1305           1018
-
-#define SN_chacha20             "ChaCha20"
-#define LN_chacha20             "chacha20"
-#define NID_chacha20            1019
-
-#define SN_dhpublicnumber               "dhpublicnumber"
-#define LN_dhpublicnumber               "X9.42 DH"
-#define NID_dhpublicnumber              920
-#define OBJ_dhpublicnumber              OBJ_ISO_US,10046L,2L,1L
-
-#define SN_brainpoolP160r1              "brainpoolP160r1"
-#define NID_brainpoolP160r1             921
-#define OBJ_brainpoolP160r1             1L,3L,36L,3L,3L,2L,8L,1L,1L,1L
-
-#define SN_brainpoolP160t1              "brainpoolP160t1"
-#define NID_brainpoolP160t1             922
-#define OBJ_brainpoolP160t1             1L,3L,36L,3L,3L,2L,8L,1L,1L,2L
-
-#define SN_brainpoolP192r1              "brainpoolP192r1"
-#define NID_brainpoolP192r1             923
-#define OBJ_brainpoolP192r1             1L,3L,36L,3L,3L,2L,8L,1L,1L,3L
-
-#define SN_brainpoolP192t1              "brainpoolP192t1"
-#define NID_brainpoolP192t1             924
-#define OBJ_brainpoolP192t1             1L,3L,36L,3L,3L,2L,8L,1L,1L,4L
-
-#define SN_brainpoolP224r1              "brainpoolP224r1"
-#define NID_brainpoolP224r1             925
-#define OBJ_brainpoolP224r1             1L,3L,36L,3L,3L,2L,8L,1L,1L,5L
-
-#define SN_brainpoolP224t1              "brainpoolP224t1"
-#define NID_brainpoolP224t1             926
-#define OBJ_brainpoolP224t1             1L,3L,36L,3L,3L,2L,8L,1L,1L,6L
-
-#define SN_brainpoolP256r1              "brainpoolP256r1"
-#define NID_brainpoolP256r1             927
-#define OBJ_brainpoolP256r1             1L,3L,36L,3L,3L,2L,8L,1L,1L,7L
-
-#define SN_brainpoolP256r1tls13         "brainpoolP256r1tls13"
-#define NID_brainpoolP256r1tls13                1285
-
-#define SN_brainpoolP256t1              "brainpoolP256t1"
-#define NID_brainpoolP256t1             928
-#define OBJ_brainpoolP256t1             1L,3L,36L,3L,3L,2L,8L,1L,1L,8L
-
-#define SN_brainpoolP320r1              "brainpoolP320r1"
-#define NID_brainpoolP320r1             929
-#define OBJ_brainpoolP320r1             1L,3L,36L,3L,3L,2L,8L,1L,1L,9L
-
-#define SN_brainpoolP320t1              "brainpoolP320t1"
-#define NID_brainpoolP320t1             930
-#define OBJ_brainpoolP320t1             1L,3L,36L,3L,3L,2L,8L,1L,1L,10L
-
-#define SN_brainpoolP384r1              "brainpoolP384r1"
-#define NID_brainpoolP384r1             931
-#define OBJ_brainpoolP384r1             1L,3L,36L,3L,3L,2L,8L,1L,1L,11L
-
-#define SN_brainpoolP384r1tls13         "brainpoolP384r1tls13"
-#define NID_brainpoolP384r1tls13                1286
-
-#define SN_brainpoolP384t1              "brainpoolP384t1"
-#define NID_brainpoolP384t1             932
-#define OBJ_brainpoolP384t1             1L,3L,36L,3L,3L,2L,8L,1L,1L,12L
-
-#define SN_brainpoolP512r1              "brainpoolP512r1"
-#define NID_brainpoolP512r1             933
-#define OBJ_brainpoolP512r1             1L,3L,36L,3L,3L,2L,8L,1L,1L,13L
-
-#define SN_brainpoolP512r1tls13         "brainpoolP512r1tls13"
-#define NID_brainpoolP512r1tls13                1287
-
-#define SN_brainpoolP512t1              "brainpoolP512t1"
-#define NID_brainpoolP512t1             934
-#define OBJ_brainpoolP512t1             1L,3L,36L,3L,3L,2L,8L,1L,1L,14L
-
-#define OBJ_x9_63_scheme                1L,3L,133L,16L,840L,63L,0L
-
-#define OBJ_secg_scheme         OBJ_certicom_arc,1L
-
-#define SN_dhSinglePass_stdDH_sha1kdf_scheme            "dhSinglePass-stdDH-sha1kdf-scheme"
-#define NID_dhSinglePass_stdDH_sha1kdf_scheme           936
-#define OBJ_dhSinglePass_stdDH_sha1kdf_scheme           OBJ_x9_63_scheme,2L
-
-#define SN_dhSinglePass_stdDH_sha224kdf_scheme          "dhSinglePass-stdDH-sha224kdf-scheme"
-#define NID_dhSinglePass_stdDH_sha224kdf_scheme         937
-#define OBJ_dhSinglePass_stdDH_sha224kdf_scheme         OBJ_secg_scheme,11L,0L
-
-#define SN_dhSinglePass_stdDH_sha256kdf_scheme          "dhSinglePass-stdDH-sha256kdf-scheme"
-#define NID_dhSinglePass_stdDH_sha256kdf_scheme         938
-#define OBJ_dhSinglePass_stdDH_sha256kdf_scheme         OBJ_secg_scheme,11L,1L
-
-#define SN_dhSinglePass_stdDH_sha384kdf_scheme          "dhSinglePass-stdDH-sha384kdf-scheme"
-#define NID_dhSinglePass_stdDH_sha384kdf_scheme         939
-#define OBJ_dhSinglePass_stdDH_sha384kdf_scheme         OBJ_secg_scheme,11L,2L
-
-#define SN_dhSinglePass_stdDH_sha512kdf_scheme          "dhSinglePass-stdDH-sha512kdf-scheme"
-#define NID_dhSinglePass_stdDH_sha512kdf_scheme         940
-#define OBJ_dhSinglePass_stdDH_sha512kdf_scheme         OBJ_secg_scheme,11L,3L
-
-#define SN_dhSinglePass_cofactorDH_sha1kdf_scheme               "dhSinglePass-cofactorDH-sha1kdf-scheme"
-#define NID_dhSinglePass_cofactorDH_sha1kdf_scheme              941
-#define OBJ_dhSinglePass_cofactorDH_sha1kdf_scheme              OBJ_x9_63_scheme,3L
-
-#define SN_dhSinglePass_cofactorDH_sha224kdf_scheme             "dhSinglePass-cofactorDH-sha224kdf-scheme"
-#define NID_dhSinglePass_cofactorDH_sha224kdf_scheme            942
-#define OBJ_dhSinglePass_cofactorDH_sha224kdf_scheme            OBJ_secg_scheme,14L,0L
-
-#define SN_dhSinglePass_cofactorDH_sha256kdf_scheme             "dhSinglePass-cofactorDH-sha256kdf-scheme"
-#define NID_dhSinglePass_cofactorDH_sha256kdf_scheme            943
-#define OBJ_dhSinglePass_cofactorDH_sha256kdf_scheme            OBJ_secg_scheme,14L,1L
-
-#define SN_dhSinglePass_cofactorDH_sha384kdf_scheme             "dhSinglePass-cofactorDH-sha384kdf-scheme"
-#define NID_dhSinglePass_cofactorDH_sha384kdf_scheme            944
-#define OBJ_dhSinglePass_cofactorDH_sha384kdf_scheme            OBJ_secg_scheme,14L,2L
-
-#define SN_dhSinglePass_cofactorDH_sha512kdf_scheme             "dhSinglePass-cofactorDH-sha512kdf-scheme"
-#define NID_dhSinglePass_cofactorDH_sha512kdf_scheme            945
-#define OBJ_dhSinglePass_cofactorDH_sha512kdf_scheme            OBJ_secg_scheme,14L,3L
-
-#define SN_dh_std_kdf           "dh-std-kdf"
-#define NID_dh_std_kdf          946
-
-#define SN_dh_cofactor_kdf              "dh-cofactor-kdf"
-#define NID_dh_cofactor_kdf             947
-
-#define SN_ct_precert_scts              "ct_precert_scts"
-#define LN_ct_precert_scts              "CT Precertificate SCTs"
-#define NID_ct_precert_scts             951
-#define OBJ_ct_precert_scts             1L,3L,6L,1L,4L,1L,11129L,2L,4L,2L
-
-#define SN_ct_precert_poison            "ct_precert_poison"
-#define LN_ct_precert_poison            "CT Precertificate Poison"
-#define NID_ct_precert_poison           952
-#define OBJ_ct_precert_poison           1L,3L,6L,1L,4L,1L,11129L,2L,4L,3L
-
-#define SN_ct_precert_signer            "ct_precert_signer"
-#define LN_ct_precert_signer            "CT Precertificate Signer"
-#define NID_ct_precert_signer           953
-#define OBJ_ct_precert_signer           1L,3L,6L,1L,4L,1L,11129L,2L,4L,4L
-
-#define SN_ct_cert_scts         "ct_cert_scts"
-#define LN_ct_cert_scts         "CT Certificate SCTs"
-#define NID_ct_cert_scts                954
-#define OBJ_ct_cert_scts                1L,3L,6L,1L,4L,1L,11129L,2L,4L,5L
-
-#define SN_jurisdictionLocalityName             "jurisdictionL"
-#define LN_jurisdictionLocalityName             "jurisdictionLocalityName"
-#define NID_jurisdictionLocalityName            955
-#define OBJ_jurisdictionLocalityName            OBJ_ms_corp,60L,2L,1L,1L
-
-#define SN_jurisdictionStateOrProvinceName              "jurisdictionST"
-#define LN_jurisdictionStateOrProvinceName              "jurisdictionStateOrProvinceName"
-#define NID_jurisdictionStateOrProvinceName             956
-#define OBJ_jurisdictionStateOrProvinceName             OBJ_ms_corp,60L,2L,1L,2L
-
-#define SN_jurisdictionCountryName              "jurisdictionC"
-#define LN_jurisdictionCountryName              "jurisdictionCountryName"
-#define NID_jurisdictionCountryName             957
-#define OBJ_jurisdictionCountryName             OBJ_ms_corp,60L,2L,1L,3L
-
-#define SN_id_scrypt            "id-scrypt"
-#define LN_id_scrypt            "scrypt"
-#define NID_id_scrypt           973
-#define OBJ_id_scrypt           1L,3L,6L,1L,4L,1L,11591L,4L,11L
-
-#define SN_tls1_prf             "TLS1-PRF"
-#define LN_tls1_prf             "tls1-prf"
-#define NID_tls1_prf            1021
-
-#define SN_hkdf         "HKDF"
-#define LN_hkdf         "hkdf"
-#define NID_hkdf                1036
-
-#define SN_sshkdf               "SSHKDF"
-#define LN_sshkdf               "sshkdf"
-#define NID_sshkdf              1203
-
-#define SN_sskdf                "SSKDF"
-#define LN_sskdf                "sskdf"
-#define NID_sskdf               1205
-
-#define SN_x942kdf              "X942KDF"
-#define LN_x942kdf              "x942kdf"
-#define NID_x942kdf             1207
-
-#define SN_x963kdf              "X963KDF"
-#define LN_x963kdf              "x963kdf"
-#define NID_x963kdf             1206
-
-#define SN_id_pkinit            "id-pkinit"
-#define NID_id_pkinit           1031
-#define OBJ_id_pkinit           1L,3L,6L,1L,5L,2L,3L
-
-#define SN_pkInitClientAuth             "pkInitClientAuth"
-#define LN_pkInitClientAuth             "PKINIT Client Auth"
-#define NID_pkInitClientAuth            1032
-#define OBJ_pkInitClientAuth            OBJ_id_pkinit,4L
-
-#define SN_pkInitKDC            "pkInitKDC"
-#define LN_pkInitKDC            "Signing KDC Response"
-#define NID_pkInitKDC           1033
-#define OBJ_pkInitKDC           OBJ_id_pkinit,5L
-
-#define SN_X25519               "X25519"
-#define NID_X25519              1034
-#define OBJ_X25519              1L,3L,101L,110L
-
-#define SN_X448         "X448"
-#define NID_X448                1035
-#define OBJ_X448                1L,3L,101L,111L
-
-#define SN_ED25519              "ED25519"
-#define NID_ED25519             1087
-#define OBJ_ED25519             1L,3L,101L,112L
-
-#define SN_ED448                "ED448"
-#define NID_ED448               1088
-#define OBJ_ED448               1L,3L,101L,113L
-
-#define SN_kx_rsa               "KxRSA"
-#define LN_kx_rsa               "kx-rsa"
-#define NID_kx_rsa              1037
-
-#define SN_kx_ecdhe             "KxECDHE"
-#define LN_kx_ecdhe             "kx-ecdhe"
-#define NID_kx_ecdhe            1038
-
-#define SN_kx_dhe               "KxDHE"
-#define LN_kx_dhe               "kx-dhe"
-#define NID_kx_dhe              1039
-
-#define SN_kx_ecdhe_psk         "KxECDHE-PSK"
-#define LN_kx_ecdhe_psk         "kx-ecdhe-psk"
-#define NID_kx_ecdhe_psk                1040
-
-#define SN_kx_dhe_psk           "KxDHE-PSK"
-#define LN_kx_dhe_psk           "kx-dhe-psk"
-#define NID_kx_dhe_psk          1041
-
-#define SN_kx_rsa_psk           "KxRSA_PSK"
-#define LN_kx_rsa_psk           "kx-rsa-psk"
-#define NID_kx_rsa_psk          1042
-
-#define SN_kx_psk               "KxPSK"
-#define LN_kx_psk               "kx-psk"
-#define NID_kx_psk              1043
-
-#define SN_kx_srp               "KxSRP"
-#define LN_kx_srp               "kx-srp"
-#define NID_kx_srp              1044
-
-#define SN_kx_gost              "KxGOST"
-#define LN_kx_gost              "kx-gost"
-#define NID_kx_gost             1045
-
-#define SN_kx_gost18            "KxGOST18"
-#define LN_kx_gost18            "kx-gost18"
-#define NID_kx_gost18           1218
-
-#define SN_kx_any               "KxANY"
-#define LN_kx_any               "kx-any"
-#define NID_kx_any              1063
-
-#define SN_auth_rsa             "AuthRSA"
-#define LN_auth_rsa             "auth-rsa"
-#define NID_auth_rsa            1046
-
-#define SN_auth_ecdsa           "AuthECDSA"
-#define LN_auth_ecdsa           "auth-ecdsa"
-#define NID_auth_ecdsa          1047
-
-#define SN_auth_psk             "AuthPSK"
-#define LN_auth_psk             "auth-psk"
-#define NID_auth_psk            1048
-
-#define SN_auth_dss             "AuthDSS"
-#define LN_auth_dss             "auth-dss"
-#define NID_auth_dss            1049
-
-#define SN_auth_gost01          "AuthGOST01"
-#define LN_auth_gost01          "auth-gost01"
-#define NID_auth_gost01         1050
-
-#define SN_auth_gost12          "AuthGOST12"
-#define LN_auth_gost12          "auth-gost12"
-#define NID_auth_gost12         1051
-
-#define SN_auth_srp             "AuthSRP"
-#define LN_auth_srp             "auth-srp"
-#define NID_auth_srp            1052
-
-#define SN_auth_null            "AuthNULL"
-#define LN_auth_null            "auth-null"
-#define NID_auth_null           1053
-
-#define SN_auth_any             "AuthANY"
-#define LN_auth_any             "auth-any"
-#define NID_auth_any            1064
-
-#define SN_poly1305             "Poly1305"
-#define LN_poly1305             "poly1305"
-#define NID_poly1305            1061
-
-#define SN_siphash              "SipHash"
-#define LN_siphash              "siphash"
-#define NID_siphash             1062
-
-#define SN_ffdhe2048            "ffdhe2048"
-#define NID_ffdhe2048           1126
-
-#define SN_ffdhe3072            "ffdhe3072"
-#define NID_ffdhe3072           1127
-
-#define SN_ffdhe4096            "ffdhe4096"
-#define NID_ffdhe4096           1128
-
-#define SN_ffdhe6144            "ffdhe6144"
-#define NID_ffdhe6144           1129
-
-#define SN_ffdhe8192            "ffdhe8192"
-#define NID_ffdhe8192           1130
-
-#define SN_modp_1536            "modp_1536"
-#define NID_modp_1536           1212
-
-#define SN_modp_2048            "modp_2048"
-#define NID_modp_2048           1213
-
-#define SN_modp_3072            "modp_3072"
-#define NID_modp_3072           1214
-
-#define SN_modp_4096            "modp_4096"
-#define NID_modp_4096           1215
-
-#define SN_modp_6144            "modp_6144"
-#define NID_modp_6144           1216
-
-#define SN_modp_8192            "modp_8192"
-#define NID_modp_8192           1217
-
-#define SN_ISO_UA               "ISO-UA"
-#define NID_ISO_UA              1150
-#define OBJ_ISO_UA              OBJ_member_body,804L
-
-#define SN_ua_pki               "ua-pki"
-#define NID_ua_pki              1151
-#define OBJ_ua_pki              OBJ_ISO_UA,2L,1L,1L,1L
-
-#define SN_dstu28147            "dstu28147"
-#define LN_dstu28147            "DSTU Gost 28147-2009"
-#define NID_dstu28147           1152
-#define OBJ_dstu28147           OBJ_ua_pki,1L,1L,1L
-
-#define SN_dstu28147_ofb                "dstu28147-ofb"
-#define LN_dstu28147_ofb                "DSTU Gost 28147-2009 OFB mode"
-#define NID_dstu28147_ofb               1153
-#define OBJ_dstu28147_ofb               OBJ_dstu28147,2L
-
-#define SN_dstu28147_cfb                "dstu28147-cfb"
-#define LN_dstu28147_cfb                "DSTU Gost 28147-2009 CFB mode"
-#define NID_dstu28147_cfb               1154
-#define OBJ_dstu28147_cfb               OBJ_dstu28147,3L
-
-#define SN_dstu28147_wrap               "dstu28147-wrap"
-#define LN_dstu28147_wrap               "DSTU Gost 28147-2009 key wrap"
-#define NID_dstu28147_wrap              1155
-#define OBJ_dstu28147_wrap              OBJ_dstu28147,5L
-
-#define SN_hmacWithDstu34311            "hmacWithDstu34311"
-#define LN_hmacWithDstu34311            "HMAC DSTU Gost 34311-95"
-#define NID_hmacWithDstu34311           1156
-#define OBJ_hmacWithDstu34311           OBJ_ua_pki,1L,1L,2L
-
-#define SN_dstu34311            "dstu34311"
-#define LN_dstu34311            "DSTU Gost 34311-95"
-#define NID_dstu34311           1157
-#define OBJ_dstu34311           OBJ_ua_pki,1L,2L,1L
-
-#define SN_dstu4145le           "dstu4145le"
-#define LN_dstu4145le           "DSTU 4145-2002 little endian"
-#define NID_dstu4145le          1158
-#define OBJ_dstu4145le          OBJ_ua_pki,1L,3L,1L,1L
-
-#define SN_dstu4145be           "dstu4145be"
-#define LN_dstu4145be           "DSTU 4145-2002 big endian"
-#define NID_dstu4145be          1159
-#define OBJ_dstu4145be          OBJ_dstu4145le,1L,1L
-
-#define SN_uacurve0             "uacurve0"
-#define LN_uacurve0             "DSTU curve 0"
-#define NID_uacurve0            1160
-#define OBJ_uacurve0            OBJ_dstu4145le,2L,0L
-
-#define SN_uacurve1             "uacurve1"
-#define LN_uacurve1             "DSTU curve 1"
-#define NID_uacurve1            1161
-#define OBJ_uacurve1            OBJ_dstu4145le,2L,1L
-
-#define SN_uacurve2             "uacurve2"
-#define LN_uacurve2             "DSTU curve 2"
-#define NID_uacurve2            1162
-#define OBJ_uacurve2            OBJ_dstu4145le,2L,2L
-
-#define SN_uacurve3             "uacurve3"
-#define LN_uacurve3             "DSTU curve 3"
-#define NID_uacurve3            1163
-#define OBJ_uacurve3            OBJ_dstu4145le,2L,3L
-
-#define SN_uacurve4             "uacurve4"
-#define LN_uacurve4             "DSTU curve 4"
-#define NID_uacurve4            1164
-#define OBJ_uacurve4            OBJ_dstu4145le,2L,4L
-
-#define SN_uacurve5             "uacurve5"
-#define LN_uacurve5             "DSTU curve 5"
-#define NID_uacurve5            1165
-#define OBJ_uacurve5            OBJ_dstu4145le,2L,5L
-
-#define SN_uacurve6             "uacurve6"
-#define LN_uacurve6             "DSTU curve 6"
-#define NID_uacurve6            1166
-#define OBJ_uacurve6            OBJ_dstu4145le,2L,6L
-
-#define SN_uacurve7             "uacurve7"
-#define LN_uacurve7             "DSTU curve 7"
-#define NID_uacurve7            1167
-#define OBJ_uacurve7            OBJ_dstu4145le,2L,7L
-
-#define SN_uacurve8             "uacurve8"
-#define LN_uacurve8             "DSTU curve 8"
-#define NID_uacurve8            1168
-#define OBJ_uacurve8            OBJ_dstu4145le,2L,8L
-
-#define SN_uacurve9             "uacurve9"
-#define LN_uacurve9             "DSTU curve 9"
-#define NID_uacurve9            1169
-#define OBJ_uacurve9            OBJ_dstu4145le,2L,9L
-
-#define SN_aes_128_siv          "AES-128-SIV"
-#define LN_aes_128_siv          "aes-128-siv"
-#define NID_aes_128_siv         1198
-
-#define SN_aes_192_siv          "AES-192-SIV"
-#define LN_aes_192_siv          "aes-192-siv"
-#define NID_aes_192_siv         1199
-
-#define SN_aes_256_siv          "AES-256-SIV"
-#define LN_aes_256_siv          "aes-256-siv"
-#define NID_aes_256_siv         1200
-
-#define SN_oracle               "oracle-organization"
-#define LN_oracle               "Oracle organization"
-#define NID_oracle              1282
-#define OBJ_oracle              OBJ_joint_iso_itu_t,16L,840L,1L,113894L
-
-#define SN_oracle_jdk_trustedkeyusage           "oracle-jdk-trustedkeyusage"
-#define LN_oracle_jdk_trustedkeyusage           "Trusted key usage (Oracle)"
-#define NID_oracle_jdk_trustedkeyusage          1283
-#define OBJ_oracle_jdk_trustedkeyusage          OBJ_oracle,746875L,1L,1L
-
-#define SN_brotli               "brotli"
-#define LN_brotli               "Brotli compression"
-#define NID_brotli              1288
-
-#define SN_zstd         "zstd"
-#define LN_zstd         "Zstandard compression"
-#define NID_zstd                1289
-
-#define SN_tcg          "tcg"
-#define LN_tcg          "Trusted Computing Group"
-#define NID_tcg         1324
-#define OBJ_tcg         2L,23L,133L
-
-#define SN_tcg_tcpaSpecVersion          "tcg-tcpaSpecVersion"
-#define NID_tcg_tcpaSpecVersion         1325
-#define OBJ_tcg_tcpaSpecVersion         OBJ_tcg,1L
-
-#define SN_tcg_attribute                "tcg-attribute"
-#define LN_tcg_attribute                "Trusted Computing Group Attributes"
-#define NID_tcg_attribute               1326
-#define OBJ_tcg_attribute               OBJ_tcg,2L
-
-#define SN_tcg_protocol         "tcg-protocol"
-#define LN_tcg_protocol         "Trusted Computing Group Protocols"
-#define NID_tcg_protocol                1327
-#define OBJ_tcg_protocol                OBJ_tcg,3L
-
-#define SN_tcg_algorithm                "tcg-algorithm"
-#define LN_tcg_algorithm                "Trusted Computing Group Algorithms"
-#define NID_tcg_algorithm               1328
-#define OBJ_tcg_algorithm               OBJ_tcg,4L
-
-#define SN_tcg_platformClass            "tcg-platformClass"
-#define LN_tcg_platformClass            "Trusted Computing Group Platform Classes"
-#define NID_tcg_platformClass           1329
-#define OBJ_tcg_platformClass           OBJ_tcg,5L
-
-#define SN_tcg_ce               "tcg-ce"
-#define LN_tcg_ce               "Trusted Computing Group Certificate Extensions"
-#define NID_tcg_ce              1330
-#define OBJ_tcg_ce              OBJ_tcg,6L
-
-#define SN_tcg_kp               "tcg-kp"
-#define LN_tcg_kp               "Trusted Computing Group Key Purposes"
-#define NID_tcg_kp              1331
-#define OBJ_tcg_kp              OBJ_tcg,8L
-
-#define SN_tcg_ca               "tcg-ca"
-#define LN_tcg_ca               "Trusted Computing Group Certificate Policies"
-#define NID_tcg_ca              1332
-#define OBJ_tcg_ca              OBJ_tcg,11L
-
-#define SN_tcg_address          "tcg-address"
-#define LN_tcg_address          "Trusted Computing Group Address Formats"
-#define NID_tcg_address         1333
-#define OBJ_tcg_address         OBJ_tcg,17L
-
-#define SN_tcg_registry         "tcg-registry"
-#define LN_tcg_registry         "Trusted Computing Group Registry"
-#define NID_tcg_registry                1334
-#define OBJ_tcg_registry                OBJ_tcg,18L
-
-#define SN_tcg_traits           "tcg-traits"
-#define LN_tcg_traits           "Trusted Computing Group Traits"
-#define NID_tcg_traits          1335
-#define OBJ_tcg_traits          OBJ_tcg,19L
-
-#define SN_tcg_common           "tcg-common"
-#define LN_tcg_common           "Trusted Computing Group Common"
-#define NID_tcg_common          1336
-#define OBJ_tcg_common          OBJ_tcg_platformClass,1L
-
-#define SN_tcg_at_platformManufacturerStr               "tcg-at-platformManufacturerStr"
-#define LN_tcg_at_platformManufacturerStr               "TCG Platform Manufacturer String"
-#define NID_tcg_at_platformManufacturerStr              1337
-#define OBJ_tcg_at_platformManufacturerStr              OBJ_tcg_common,1L
-
-#define SN_tcg_at_platformManufacturerId                "tcg-at-platformManufacturerId"
-#define LN_tcg_at_platformManufacturerId                "TCG Platform Manufacturer ID"
-#define NID_tcg_at_platformManufacturerId               1338
-#define OBJ_tcg_at_platformManufacturerId               OBJ_tcg_common,2L
-
-#define SN_tcg_at_platformConfigUri             "tcg-at-platformConfigUri"
-#define LN_tcg_at_platformConfigUri             "TCG Platform Configuration URI"
-#define NID_tcg_at_platformConfigUri            1339
-#define OBJ_tcg_at_platformConfigUri            OBJ_tcg_common,3L
-
-#define SN_tcg_at_platformModel         "tcg-at-platformModel"
-#define LN_tcg_at_platformModel         "TCG Platform Model"
-#define NID_tcg_at_platformModel                1340
-#define OBJ_tcg_at_platformModel                OBJ_tcg_common,4L
-
-#define SN_tcg_at_platformVersion               "tcg-at-platformVersion"
-#define LN_tcg_at_platformVersion               "TCG Platform Version"
-#define NID_tcg_at_platformVersion              1341
-#define OBJ_tcg_at_platformVersion              OBJ_tcg_common,5L
-
-#define SN_tcg_at_platformSerial                "tcg-at-platformSerial"
-#define LN_tcg_at_platformSerial                "TCG Platform Serial Number"
-#define NID_tcg_at_platformSerial               1342
-#define OBJ_tcg_at_platformSerial               OBJ_tcg_common,6L
-
-#define SN_tcg_at_platformConfiguration         "tcg-at-platformConfiguration"
-#define LN_tcg_at_platformConfiguration         "TCG Platform Configuration"
-#define NID_tcg_at_platformConfiguration                1343
-#define OBJ_tcg_at_platformConfiguration                OBJ_tcg_common,7L
-
-#define SN_tcg_at_platformIdentifier            "tcg-at-platformIdentifier"
-#define LN_tcg_at_platformIdentifier            "TCG Platform Identifier"
-#define NID_tcg_at_platformIdentifier           1344
-#define OBJ_tcg_at_platformIdentifier           OBJ_tcg_common,8L
-
-#define SN_tcg_at_tpmManufacturer               "tcg-at-tpmManufacturer"
-#define LN_tcg_at_tpmManufacturer               "TPM Manufacturer"
-#define NID_tcg_at_tpmManufacturer              1345
-#define OBJ_tcg_at_tpmManufacturer              OBJ_tcg_attribute,1L
-
-#define SN_tcg_at_tpmModel              "tcg-at-tpmModel"
-#define LN_tcg_at_tpmModel              "TPM Model"
-#define NID_tcg_at_tpmModel             1346
-#define OBJ_tcg_at_tpmModel             OBJ_tcg_attribute,2L
-
-#define SN_tcg_at_tpmVersion            "tcg-at-tpmVersion"
-#define LN_tcg_at_tpmVersion            "TPM Version"
-#define NID_tcg_at_tpmVersion           1347
-#define OBJ_tcg_at_tpmVersion           OBJ_tcg_attribute,3L
-
-#define SN_tcg_at_securityQualities             "tcg-at-securityQualities"
-#define LN_tcg_at_securityQualities             "Security Qualities"
-#define NID_tcg_at_securityQualities            1348
-#define OBJ_tcg_at_securityQualities            OBJ_tcg_attribute,10L
-
-#define SN_tcg_at_tpmProtectionProfile          "tcg-at-tpmProtectionProfile"
-#define LN_tcg_at_tpmProtectionProfile          "TPM Protection Profile"
-#define NID_tcg_at_tpmProtectionProfile         1349
-#define OBJ_tcg_at_tpmProtectionProfile         OBJ_tcg_attribute,11L
-
-#define SN_tcg_at_tpmSecurityTarget             "tcg-at-tpmSecurityTarget"
-#define LN_tcg_at_tpmSecurityTarget             "TPM Security Target"
-#define NID_tcg_at_tpmSecurityTarget            1350
-#define OBJ_tcg_at_tpmSecurityTarget            OBJ_tcg_attribute,12L
-
-#define SN_tcg_at_tbbProtectionProfile          "tcg-at-tbbProtectionProfile"
-#define LN_tcg_at_tbbProtectionProfile          "TBB Protection Profile"
-#define NID_tcg_at_tbbProtectionProfile         1351
-#define OBJ_tcg_at_tbbProtectionProfile         OBJ_tcg_attribute,13L
-
-#define SN_tcg_at_tbbSecurityTarget             "tcg-at-tbbSecurityTarget"
-#define LN_tcg_at_tbbSecurityTarget             "TBB Security Target"
-#define NID_tcg_at_tbbSecurityTarget            1352
-#define OBJ_tcg_at_tbbSecurityTarget            OBJ_tcg_attribute,14L
-
-#define SN_tcg_at_tpmIdLabel            "tcg-at-tpmIdLabel"
-#define LN_tcg_at_tpmIdLabel            "TPM ID Label"
-#define NID_tcg_at_tpmIdLabel           1353
-#define OBJ_tcg_at_tpmIdLabel           OBJ_tcg_attribute,15L
-
-#define SN_tcg_at_tpmSpecification              "tcg-at-tpmSpecification"
-#define LN_tcg_at_tpmSpecification              "TPM Specification"
-#define NID_tcg_at_tpmSpecification             1354
-#define OBJ_tcg_at_tpmSpecification             OBJ_tcg_attribute,16L
-
-#define SN_tcg_at_tcgPlatformSpecification              "tcg-at-tcgPlatformSpecification"
-#define LN_tcg_at_tcgPlatformSpecification              "TPM Platform Specification"
-#define NID_tcg_at_tcgPlatformSpecification             1355
-#define OBJ_tcg_at_tcgPlatformSpecification             OBJ_tcg_attribute,17L
-
-#define SN_tcg_at_tpmSecurityAssertions         "tcg-at-tpmSecurityAssertions"
-#define LN_tcg_at_tpmSecurityAssertions         "TPM Security Assertions"
-#define NID_tcg_at_tpmSecurityAssertions                1356
-#define OBJ_tcg_at_tpmSecurityAssertions                OBJ_tcg_attribute,18L
-
-#define SN_tcg_at_tbbSecurityAssertions         "tcg-at-tbbSecurityAssertions"
-#define LN_tcg_at_tbbSecurityAssertions         "TBB Security Assertions"
-#define NID_tcg_at_tbbSecurityAssertions                1357
-#define OBJ_tcg_at_tbbSecurityAssertions                OBJ_tcg_attribute,19L
-
-#define SN_tcg_at_tcgCredentialSpecification            "tcg-at-tcgCredentialSpecification"
-#define LN_tcg_at_tcgCredentialSpecification            "TCG Credential Specification"
-#define NID_tcg_at_tcgCredentialSpecification           1358
-#define OBJ_tcg_at_tcgCredentialSpecification           OBJ_tcg_attribute,23L
-
-#define SN_tcg_at_tcgCredentialType             "tcg-at-tcgCredentialType"
-#define LN_tcg_at_tcgCredentialType             "TCG Credential Type"
-#define NID_tcg_at_tcgCredentialType            1359
-#define OBJ_tcg_at_tcgCredentialType            OBJ_tcg_attribute,25L
-
-#define SN_tcg_at_previousPlatformCertificates          "tcg-at-previousPlatformCertificates"
-#define LN_tcg_at_previousPlatformCertificates          "TCG Previous Platform Certificates"
-#define NID_tcg_at_previousPlatformCertificates         1360
-#define OBJ_tcg_at_previousPlatformCertificates         OBJ_tcg_attribute,26L
-
-#define SN_tcg_at_tbbSecurityAssertions_v3              "tcg-at-tbbSecurityAssertions-v3"
-#define LN_tcg_at_tbbSecurityAssertions_v3              "TCG TBB Security Assertions V3"
-#define NID_tcg_at_tbbSecurityAssertions_v3             1361
-#define OBJ_tcg_at_tbbSecurityAssertions_v3             OBJ_tcg_attribute,27L
-
-#define SN_tcg_at_cryptographicAnchors          "tcg-at-cryptographicAnchors"
-#define LN_tcg_at_cryptographicAnchors          "TCG Cryptographic Anchors"
-#define NID_tcg_at_cryptographicAnchors         1362
-#define OBJ_tcg_at_cryptographicAnchors         OBJ_tcg_attribute,28L
-
-#define SN_tcg_at_platformConfiguration_v1              "tcg-at-platformConfiguration-v1"
-#define LN_tcg_at_platformConfiguration_v1              "Platform Configuration Version 1"
-#define NID_tcg_at_platformConfiguration_v1             1363
-#define OBJ_tcg_at_platformConfiguration_v1             OBJ_tcg_at_platformConfiguration,1L
-
-#define SN_tcg_at_platformConfiguration_v2              "tcg-at-platformConfiguration-v2"
-#define LN_tcg_at_platformConfiguration_v2              "Platform Configuration Version 2"
-#define NID_tcg_at_platformConfiguration_v2             1364
-#define OBJ_tcg_at_platformConfiguration_v2             OBJ_tcg_at_platformConfiguration,2L
-
-#define SN_tcg_at_platformConfiguration_v3              "tcg-at-platformConfiguration-v3"
-#define LN_tcg_at_platformConfiguration_v3              "Platform Configuration Version 3"
-#define NID_tcg_at_platformConfiguration_v3             1365
-#define OBJ_tcg_at_platformConfiguration_v3             OBJ_tcg_at_platformConfiguration,3L
-
-#define SN_tcg_at_platformConfigUri_v3          "tcg-at-platformConfigUri-v3"
-#define LN_tcg_at_platformConfigUri_v3          "Platform Configuration URI Version 3"
-#define NID_tcg_at_platformConfigUri_v3         1366
-#define OBJ_tcg_at_platformConfigUri_v3         OBJ_tcg_at_platformConfiguration,4L
-
-#define SN_tcg_algorithm_null           "tcg-algorithm-null"
-#define LN_tcg_algorithm_null           "TCG NULL Algorithm"
-#define NID_tcg_algorithm_null          1367
-#define OBJ_tcg_algorithm_null          OBJ_tcg_algorithm,1L
-
-#define SN_tcg_kp_EKCertificate         "tcg-kp-EKCertificate"
-#define LN_tcg_kp_EKCertificate         "Endorsement Key Certificate"
-#define NID_tcg_kp_EKCertificate                1368
-#define OBJ_tcg_kp_EKCertificate                OBJ_tcg_kp,1L
-
-#define SN_tcg_kp_PlatformAttributeCertificate          "tcg-kp-PlatformAttributeCertificate"
-#define LN_tcg_kp_PlatformAttributeCertificate          "Platform Attribute Certificate"
-#define NID_tcg_kp_PlatformAttributeCertificate         1369
-#define OBJ_tcg_kp_PlatformAttributeCertificate         OBJ_tcg_kp,2L
-
-#define SN_tcg_kp_AIKCertificate                "tcg-kp-AIKCertificate"
-#define LN_tcg_kp_AIKCertificate                "Attestation Identity Key Certificate"
-#define NID_tcg_kp_AIKCertificate               1370
-#define OBJ_tcg_kp_AIKCertificate               OBJ_tcg_kp,3L
-
-#define SN_tcg_kp_PlatformKeyCertificate                "tcg-kp-PlatformKeyCertificate"
-#define LN_tcg_kp_PlatformKeyCertificate                "Platform Key Certificate"
-#define NID_tcg_kp_PlatformKeyCertificate               1371
-#define OBJ_tcg_kp_PlatformKeyCertificate               OBJ_tcg_kp,4L
-
-#define SN_tcg_kp_DeltaPlatformAttributeCertificate             "tcg-kp-DeltaPlatformAttributeCertificate"
-#define LN_tcg_kp_DeltaPlatformAttributeCertificate             "Delta Platform Attribute Certificate"
-#define NID_tcg_kp_DeltaPlatformAttributeCertificate            1372
-#define OBJ_tcg_kp_DeltaPlatformAttributeCertificate            OBJ_tcg_kp,5L
-
-#define SN_tcg_kp_DeltaPlatformKeyCertificate           "tcg-kp-DeltaPlatformKeyCertificate"
-#define LN_tcg_kp_DeltaPlatformKeyCertificate           "Delta Platform Key Certificate"
-#define NID_tcg_kp_DeltaPlatformKeyCertificate          1373
-#define OBJ_tcg_kp_DeltaPlatformKeyCertificate          OBJ_tcg_kp,6L
-
-#define SN_tcg_kp_AdditionalPlatformAttributeCertificate                "tcg-kp-AdditionalPlatformAttributeCertificate"
-#define LN_tcg_kp_AdditionalPlatformAttributeCertificate                "Additional Platform Attribute Certificate"
-#define NID_tcg_kp_AdditionalPlatformAttributeCertificate               1374
-#define OBJ_tcg_kp_AdditionalPlatformAttributeCertificate               OBJ_tcg_kp,7L
-
-#define SN_tcg_kp_AdditionalPlatformKeyCertificate              "tcg-kp-AdditionalPlatformKeyCertificate"
-#define LN_tcg_kp_AdditionalPlatformKeyCertificate              "Additional Platform Key Certificate"
-#define NID_tcg_kp_AdditionalPlatformKeyCertificate             1375
-#define OBJ_tcg_kp_AdditionalPlatformKeyCertificate             OBJ_tcg_kp,8L
-
-#define SN_tcg_ce_relevantCredentials           "tcg-ce-relevantCredentials"
-#define LN_tcg_ce_relevantCredentials           "Relevant Credentials"
-#define NID_tcg_ce_relevantCredentials          1376
-#define OBJ_tcg_ce_relevantCredentials          OBJ_tcg_ce,2L
-
-#define SN_tcg_ce_relevantManifests             "tcg-ce-relevantManifests"
-#define LN_tcg_ce_relevantManifests             "Relevant Manifests"
-#define NID_tcg_ce_relevantManifests            1377
-#define OBJ_tcg_ce_relevantManifests            OBJ_tcg_ce,3L
-
-#define SN_tcg_ce_virtualPlatformAttestationService             "tcg-ce-virtualPlatformAttestationService"
-#define LN_tcg_ce_virtualPlatformAttestationService             "Virtual Platform Attestation Service"
-#define NID_tcg_ce_virtualPlatformAttestationService            1378
-#define OBJ_tcg_ce_virtualPlatformAttestationService            OBJ_tcg_ce,4L
-
-#define SN_tcg_ce_migrationControllerAttestationService         "tcg-ce-migrationControllerAttestationService"
-#define LN_tcg_ce_migrationControllerAttestationService         "Migration Controller Attestation Service"
-#define NID_tcg_ce_migrationControllerAttestationService                1379
-#define OBJ_tcg_ce_migrationControllerAttestationService                OBJ_tcg_ce,5L
-
-#define SN_tcg_ce_migrationControllerRegistrationService                "tcg-ce-migrationControllerRegistrationService"
-#define LN_tcg_ce_migrationControllerRegistrationService                "Migration Controller Registration Service"
-#define NID_tcg_ce_migrationControllerRegistrationService               1380
-#define OBJ_tcg_ce_migrationControllerRegistrationService               OBJ_tcg_ce,6L
-
-#define SN_tcg_ce_virtualPlatformBackupService          "tcg-ce-virtualPlatformBackupService"
-#define LN_tcg_ce_virtualPlatformBackupService          "Virtual Platform Backup Service"
-#define NID_tcg_ce_virtualPlatformBackupService         1381
-#define OBJ_tcg_ce_virtualPlatformBackupService         OBJ_tcg_ce,7L
-
-#define SN_tcg_prt_tpmIdProtocol                "tcg-prt-tpmIdProtocol"
-#define LN_tcg_prt_tpmIdProtocol                "TCG TPM Protocol"
-#define NID_tcg_prt_tpmIdProtocol               1382
-#define OBJ_tcg_prt_tpmIdProtocol               OBJ_tcg_protocol,1L
-
-#define SN_tcg_address_ethernetmac              "tcg-address-ethernetmac"
-#define LN_tcg_address_ethernetmac              "Ethernet MAC Address"
-#define NID_tcg_address_ethernetmac             1383
-#define OBJ_tcg_address_ethernetmac             OBJ_tcg_address,1L
-
-#define SN_tcg_address_wlanmac          "tcg-address-wlanmac"
-#define LN_tcg_address_wlanmac          "WLAN MAC Address"
-#define NID_tcg_address_wlanmac         1384
-#define OBJ_tcg_address_wlanmac         OBJ_tcg_address,2L
-
-#define SN_tcg_address_bluetoothmac             "tcg-address-bluetoothmac"
-#define LN_tcg_address_bluetoothmac             "Bluetooth MAC Address"
-#define NID_tcg_address_bluetoothmac            1385
-#define OBJ_tcg_address_bluetoothmac            OBJ_tcg_address,3L
-
-#define SN_tcg_registry_componentClass          "tcg-registry-componentClass"
-#define LN_tcg_registry_componentClass          "TCG Component Class"
-#define NID_tcg_registry_componentClass         1386
-#define OBJ_tcg_registry_componentClass         OBJ_tcg_registry,3L
-
-#define SN_tcg_registry_componentClass_tcg              "tcg-registry-componentClass-tcg"
-#define LN_tcg_registry_componentClass_tcg              "Trusted Computed Group Registry"
-#define NID_tcg_registry_componentClass_tcg             1387
-#define OBJ_tcg_registry_componentClass_tcg             OBJ_tcg_registry_componentClass,1L
-
-#define SN_tcg_registry_componentClass_ietf             "tcg-registry-componentClass-ietf"
-#define LN_tcg_registry_componentClass_ietf             "Internet Engineering Task Force Registry"
-#define NID_tcg_registry_componentClass_ietf            1388
-#define OBJ_tcg_registry_componentClass_ietf            OBJ_tcg_registry_componentClass,2L
-
-#define SN_tcg_registry_componentClass_dmtf             "tcg-registry-componentClass-dmtf"
-#define LN_tcg_registry_componentClass_dmtf             "Distributed Management Task Force Registry"
-#define NID_tcg_registry_componentClass_dmtf            1389
-#define OBJ_tcg_registry_componentClass_dmtf            OBJ_tcg_registry_componentClass,3L
-
-#define SN_tcg_registry_componentClass_pcie             "tcg-registry-componentClass-pcie"
-#define LN_tcg_registry_componentClass_pcie             "PCIE Component Class"
-#define NID_tcg_registry_componentClass_pcie            1390
-#define OBJ_tcg_registry_componentClass_pcie            OBJ_tcg_registry_componentClass,4L
-
-#define SN_tcg_registry_componentClass_disk             "tcg-registry-componentClass-disk"
-#define LN_tcg_registry_componentClass_disk             "Disk Component Class"
-#define NID_tcg_registry_componentClass_disk            1391
-#define OBJ_tcg_registry_componentClass_disk            OBJ_tcg_registry_componentClass,5L
-
-#define SN_tcg_cap_verifiedPlatformCertificate          "tcg-cap-verifiedPlatformCertificate"
-#define LN_tcg_cap_verifiedPlatformCertificate          "TCG Verified Platform Certificate CA Policy"
-#define NID_tcg_cap_verifiedPlatformCertificate         1392
-#define OBJ_tcg_cap_verifiedPlatformCertificate         OBJ_tcg_ca,4L
-
-#define SN_tcg_tr_ID            "tcg-tr-ID"
-#define LN_tcg_tr_ID            "TCG Trait Identifiers"
-#define NID_tcg_tr_ID           1393
-#define OBJ_tcg_tr_ID           OBJ_tcg_traits,1L
-
-#define SN_tcg_tr_category              "tcg-tr-category"
-#define LN_tcg_tr_category              "TCG Trait Categories"
-#define NID_tcg_tr_category             1394
-#define OBJ_tcg_tr_category             OBJ_tcg_traits,2L
-
-#define SN_tcg_tr_registry              "tcg-tr-registry"
-#define LN_tcg_tr_registry              "TCG Trait Registries"
-#define NID_tcg_tr_registry             1395
-#define OBJ_tcg_tr_registry             OBJ_tcg_traits,3L
-
-#define SN_tcg_tr_ID_Boolean            "tcg-tr-ID-Boolean"
-#define LN_tcg_tr_ID_Boolean            "Boolean Trait"
-#define NID_tcg_tr_ID_Boolean           1396
-#define OBJ_tcg_tr_ID_Boolean           OBJ_tcg_tr_ID,1L
-
-#define SN_tcg_tr_ID_CertificateIdentifier              "tcg-tr-ID-CertificateIdentifier"
-#define LN_tcg_tr_ID_CertificateIdentifier              "Certificate Identifier Trait"
-#define NID_tcg_tr_ID_CertificateIdentifier             1397
-#define OBJ_tcg_tr_ID_CertificateIdentifier             OBJ_tcg_tr_ID,2L
-
-#define SN_tcg_tr_ID_CommonCriteria             "tcg-tr-ID-CommonCriteria"
-#define LN_tcg_tr_ID_CommonCriteria             "Common Criteria Trait"
-#define NID_tcg_tr_ID_CommonCriteria            1398
-#define OBJ_tcg_tr_ID_CommonCriteria            OBJ_tcg_tr_ID,3L
-
-#define SN_tcg_tr_ID_componentClass             "tcg-tr-ID-componentClass"
-#define LN_tcg_tr_ID_componentClass             "Component Class Trait"
-#define NID_tcg_tr_ID_componentClass            1399
-#define OBJ_tcg_tr_ID_componentClass            OBJ_tcg_tr_ID,4L
-
-#define SN_tcg_tr_ID_componentIdentifierV11             "tcg-tr-ID-componentIdentifierV11"
-#define LN_tcg_tr_ID_componentIdentifierV11             "Component Identifier V1.1 Trait"
-#define NID_tcg_tr_ID_componentIdentifierV11            1400
-#define OBJ_tcg_tr_ID_componentIdentifierV11            OBJ_tcg_tr_ID,5L
-
-#define SN_tcg_tr_ID_FIPSLevel          "tcg-tr-ID-FIPSLevel"
-#define LN_tcg_tr_ID_FIPSLevel          "FIPS Level Trait"
-#define NID_tcg_tr_ID_FIPSLevel         1401
-#define OBJ_tcg_tr_ID_FIPSLevel         OBJ_tcg_tr_ID,6L
-
-#define SN_tcg_tr_ID_ISO9000Level               "tcg-tr-ID-ISO9000Level"
-#define LN_tcg_tr_ID_ISO9000Level               "ISO 9000 Level Trait"
-#define NID_tcg_tr_ID_ISO9000Level              1402
-#define OBJ_tcg_tr_ID_ISO9000Level              OBJ_tcg_tr_ID,7L
-
-#define SN_tcg_tr_ID_networkMAC         "tcg-tr-ID-networkMAC"
-#define LN_tcg_tr_ID_networkMAC         "Network MAC Trait"
-#define NID_tcg_tr_ID_networkMAC                1403
-#define OBJ_tcg_tr_ID_networkMAC                OBJ_tcg_tr_ID,8L
-
-#define SN_tcg_tr_ID_OID                "tcg-tr-ID-OID"
-#define LN_tcg_tr_ID_OID                "Object Identifier Trait"
-#define NID_tcg_tr_ID_OID               1404
-#define OBJ_tcg_tr_ID_OID               OBJ_tcg_tr_ID,9L
-
-#define SN_tcg_tr_ID_PEN                "tcg-tr-ID-PEN"
-#define LN_tcg_tr_ID_PEN                "Private Enterprise Number Trait"
-#define NID_tcg_tr_ID_PEN               1405
-#define OBJ_tcg_tr_ID_PEN               OBJ_tcg_tr_ID,10L
-
-#define SN_tcg_tr_ID_platformFirmwareCapabilities               "tcg-tr-ID-platformFirmwareCapabilities"
-#define LN_tcg_tr_ID_platformFirmwareCapabilities               "Platform Firmware Capabilities Trait"
-#define NID_tcg_tr_ID_platformFirmwareCapabilities              1406
-#define OBJ_tcg_tr_ID_platformFirmwareCapabilities              OBJ_tcg_tr_ID,11L
-
-#define SN_tcg_tr_ID_platformFirmwareSignatureVerification              "tcg-tr-ID-platformFirmwareSignatureVerification"
-#define LN_tcg_tr_ID_platformFirmwareSignatureVerification              "Platform Firmware Signature Verification Trait"
-#define NID_tcg_tr_ID_platformFirmwareSignatureVerification             1407
-#define OBJ_tcg_tr_ID_platformFirmwareSignatureVerification             OBJ_tcg_tr_ID,12L
-
-#define SN_tcg_tr_ID_platformFirmwareUpdateCompliance           "tcg-tr-ID-platformFirmwareUpdateCompliance"
-#define LN_tcg_tr_ID_platformFirmwareUpdateCompliance           "Platform Firmware Update Compliance Trait"
-#define NID_tcg_tr_ID_platformFirmwareUpdateCompliance          1408
-#define OBJ_tcg_tr_ID_platformFirmwareUpdateCompliance          OBJ_tcg_tr_ID,13L
-
-#define SN_tcg_tr_ID_platformHardwareCapabilities               "tcg-tr-ID-platformHardwareCapabilities"
-#define LN_tcg_tr_ID_platformHardwareCapabilities               "Platform Hardware Capabilities Trait"
-#define NID_tcg_tr_ID_platformHardwareCapabilities              1409
-#define OBJ_tcg_tr_ID_platformHardwareCapabilities              OBJ_tcg_tr_ID,14L
-
-#define SN_tcg_tr_ID_RTM                "tcg-tr-ID-RTM"
-#define LN_tcg_tr_ID_RTM                "Root of Trust for Measurement Trait"
-#define NID_tcg_tr_ID_RTM               1410
-#define OBJ_tcg_tr_ID_RTM               OBJ_tcg_tr_ID,15L
-
-#define SN_tcg_tr_ID_status             "tcg-tr-ID-status"
-#define LN_tcg_tr_ID_status             "Attribute Status Trait"
-#define NID_tcg_tr_ID_status            1411
-#define OBJ_tcg_tr_ID_status            OBJ_tcg_tr_ID,16L
-
-#define SN_tcg_tr_ID_URI                "tcg-tr-ID-URI"
-#define LN_tcg_tr_ID_URI                "Uniform Resource Identifier Trait"
-#define NID_tcg_tr_ID_URI               1412
-#define OBJ_tcg_tr_ID_URI               OBJ_tcg_tr_ID,17L
-
-#define SN_tcg_tr_ID_UTF8String         "tcg-tr-ID-UTF8String"
-#define LN_tcg_tr_ID_UTF8String         "UTF8String Trait"
-#define NID_tcg_tr_ID_UTF8String                1413
-#define OBJ_tcg_tr_ID_UTF8String                OBJ_tcg_tr_ID,18L
-
-#define SN_tcg_tr_ID_IA5String          "tcg-tr-ID-IA5String"
-#define LN_tcg_tr_ID_IA5String          "IA5String Trait"
-#define NID_tcg_tr_ID_IA5String         1414
-#define OBJ_tcg_tr_ID_IA5String         OBJ_tcg_tr_ID,19L
-
-#define SN_tcg_tr_ID_PEMCertString              "tcg-tr-ID-PEMCertString"
-#define LN_tcg_tr_ID_PEMCertString              "PEM-Encoded Certificate String Trait"
-#define NID_tcg_tr_ID_PEMCertString             1415
-#define OBJ_tcg_tr_ID_PEMCertString             OBJ_tcg_tr_ID,20L
-
-#define SN_tcg_tr_ID_PublicKey          "tcg-tr-ID-PublicKey"
-#define LN_tcg_tr_ID_PublicKey          "Public Key Trait"
-#define NID_tcg_tr_ID_PublicKey         1416
-#define OBJ_tcg_tr_ID_PublicKey         OBJ_tcg_tr_ID,21L
-
-#define SN_tcg_tr_cat_platformManufacturer              "tcg-tr-cat-platformManufacturer"
-#define LN_tcg_tr_cat_platformManufacturer              "Platform Manufacturer Trait Category"
-#define NID_tcg_tr_cat_platformManufacturer             1417
-#define OBJ_tcg_tr_cat_platformManufacturer             OBJ_tcg_tr_category,1L
-
-#define SN_tcg_tr_cat_platformModel             "tcg-tr-cat-platformModel"
-#define LN_tcg_tr_cat_platformModel             "Platform Model Trait Category"
-#define NID_tcg_tr_cat_platformModel            1418
-#define OBJ_tcg_tr_cat_platformModel            OBJ_tcg_tr_category,2L
-
-#define SN_tcg_tr_cat_platformVersion           "tcg-tr-cat-platformVersion"
-#define LN_tcg_tr_cat_platformVersion           "Platform Version Trait Category"
-#define NID_tcg_tr_cat_platformVersion          1419
-#define OBJ_tcg_tr_cat_platformVersion          OBJ_tcg_tr_category,3L
-
-#define SN_tcg_tr_cat_platformSerial            "tcg-tr-cat-platformSerial"
-#define LN_tcg_tr_cat_platformSerial            "Platform Serial Trait Category"
-#define NID_tcg_tr_cat_platformSerial           1420
-#define OBJ_tcg_tr_cat_platformSerial           OBJ_tcg_tr_category,4L
-
-#define SN_tcg_tr_cat_platformManufacturerIdentifier            "tcg-tr-cat-platformManufacturerIdentifier"
-#define LN_tcg_tr_cat_platformManufacturerIdentifier            "Platform Manufacturer Identifier Trait Category"
-#define NID_tcg_tr_cat_platformManufacturerIdentifier           1421
-#define OBJ_tcg_tr_cat_platformManufacturerIdentifier           OBJ_tcg_tr_category,5L
-
-#define SN_tcg_tr_cat_platformOwnership         "tcg-tr-cat-platformOwnership"
-#define LN_tcg_tr_cat_platformOwnership         "Platform Ownership Trait Category"
-#define NID_tcg_tr_cat_platformOwnership                1422
-#define OBJ_tcg_tr_cat_platformOwnership                OBJ_tcg_tr_category,6L
-
-#define SN_tcg_tr_cat_componentClass            "tcg-tr-cat-componentClass"
-#define LN_tcg_tr_cat_componentClass            "Component Class Trait Category"
-#define NID_tcg_tr_cat_componentClass           1423
-#define OBJ_tcg_tr_cat_componentClass           OBJ_tcg_tr_category,7L
-
-#define SN_tcg_tr_cat_componentManufacturer             "tcg-tr-cat-componentManufacturer"
-#define LN_tcg_tr_cat_componentManufacturer             "Component Manufacturer Trait Category"
-#define NID_tcg_tr_cat_componentManufacturer            1424
-#define OBJ_tcg_tr_cat_componentManufacturer            OBJ_tcg_tr_category,8L
-
-#define SN_tcg_tr_cat_componentModel            "tcg-tr-cat-componentModel"
-#define LN_tcg_tr_cat_componentModel            "Component Model Trait Category"
-#define NID_tcg_tr_cat_componentModel           1425
-#define OBJ_tcg_tr_cat_componentModel           OBJ_tcg_tr_category,9L
-
-#define SN_tcg_tr_cat_componentSerial           "tcg-tr-cat-componentSerial"
-#define LN_tcg_tr_cat_componentSerial           "Component Serial Trait Category"
-#define NID_tcg_tr_cat_componentSerial          1426
-#define OBJ_tcg_tr_cat_componentSerial          OBJ_tcg_tr_category,10L
-
-#define SN_tcg_tr_cat_componentStatus           "tcg-tr-cat-componentStatus"
-#define LN_tcg_tr_cat_componentStatus           "Component Status Trait Category"
-#define NID_tcg_tr_cat_componentStatus          1427
-#define OBJ_tcg_tr_cat_componentStatus          OBJ_tcg_tr_category,11L
-
-#define SN_tcg_tr_cat_componentLocation         "tcg-tr-cat-componentLocation"
-#define LN_tcg_tr_cat_componentLocation         "Component Location Trait Category"
-#define NID_tcg_tr_cat_componentLocation                1428
-#define OBJ_tcg_tr_cat_componentLocation                OBJ_tcg_tr_category,12L
-
-#define SN_tcg_tr_cat_componentRevision         "tcg-tr-cat-componentRevision"
-#define LN_tcg_tr_cat_componentRevision         "Component Revision Trait Category"
-#define NID_tcg_tr_cat_componentRevision                1429
-#define OBJ_tcg_tr_cat_componentRevision                OBJ_tcg_tr_category,13L
-
-#define SN_tcg_tr_cat_componentFieldReplaceable         "tcg-tr-cat-componentFieldReplaceable"
-#define LN_tcg_tr_cat_componentFieldReplaceable         "Component Field Replaceable Trait Category"
-#define NID_tcg_tr_cat_componentFieldReplaceable                1430
-#define OBJ_tcg_tr_cat_componentFieldReplaceable                OBJ_tcg_tr_category,14L
-
-#define SN_tcg_tr_cat_EKCertificate             "tcg-tr-cat-EKCertificate"
-#define LN_tcg_tr_cat_EKCertificate             "EK Certificate Trait Category"
-#define NID_tcg_tr_cat_EKCertificate            1431
-#define OBJ_tcg_tr_cat_EKCertificate            OBJ_tcg_tr_category,15L
-
-#define SN_tcg_tr_cat_IAKCertificate            "tcg-tr-cat-IAKCertificate"
-#define LN_tcg_tr_cat_IAKCertificate            "IAK Certificate Trait Category"
-#define NID_tcg_tr_cat_IAKCertificate           1432
-#define OBJ_tcg_tr_cat_IAKCertificate           OBJ_tcg_tr_category,16L
-
-#define SN_tcg_tr_cat_IDevIDCertificate         "tcg-tr-cat-IDevIDCertificate"
-#define LN_tcg_tr_cat_IDevIDCertificate         "IDevID Certificate Trait Category"
-#define NID_tcg_tr_cat_IDevIDCertificate                1433
-#define OBJ_tcg_tr_cat_IDevIDCertificate                OBJ_tcg_tr_category,17L
-
-#define SN_tcg_tr_cat_DICECertificate           "tcg-tr-cat-DICECertificate"
-#define LN_tcg_tr_cat_DICECertificate           "DICE Certificate Trait Category"
-#define NID_tcg_tr_cat_DICECertificate          1434
-#define OBJ_tcg_tr_cat_DICECertificate          OBJ_tcg_tr_category,18L
-
-#define SN_tcg_tr_cat_SPDMCertificate           "tcg-tr-cat-SPDMCertificate"
-#define LN_tcg_tr_cat_SPDMCertificate           "SPDM Certificate Trait Category"
-#define NID_tcg_tr_cat_SPDMCertificate          1435
-#define OBJ_tcg_tr_cat_SPDMCertificate          OBJ_tcg_tr_category,19L
-
-#define SN_tcg_tr_cat_PEMCertificate            "tcg-tr-cat-PEMCertificate"
-#define LN_tcg_tr_cat_PEMCertificate            "PEM Certificate Trait Category"
-#define NID_tcg_tr_cat_PEMCertificate           1436
-#define OBJ_tcg_tr_cat_PEMCertificate           OBJ_tcg_tr_category,20L
-
-#define SN_tcg_tr_cat_PlatformCertificate               "tcg-tr-cat-PlatformCertificate"
-#define LN_tcg_tr_cat_PlatformCertificate               "Platform Certificate Trait Category"
-#define NID_tcg_tr_cat_PlatformCertificate              1437
-#define OBJ_tcg_tr_cat_PlatformCertificate              OBJ_tcg_tr_category,21L
-
-#define SN_tcg_tr_cat_DeltaPlatformCertificate          "tcg-tr-cat-DeltaPlatformCertificate"
-#define LN_tcg_tr_cat_DeltaPlatformCertificate          "Delta Platform Certificate Trait Category"
-#define NID_tcg_tr_cat_DeltaPlatformCertificate         1438
-#define OBJ_tcg_tr_cat_DeltaPlatformCertificate         OBJ_tcg_tr_category,22L
-
-#define SN_tcg_tr_cat_RebasePlatformCertificate         "tcg-tr-cat-RebasePlatformCertificate"
-#define LN_tcg_tr_cat_RebasePlatformCertificate         "Rebase Platform Certificate Trait Category"
-#define NID_tcg_tr_cat_RebasePlatformCertificate                1439
-#define OBJ_tcg_tr_cat_RebasePlatformCertificate                OBJ_tcg_tr_category,23L
-
-#define SN_tcg_tr_cat_genericCertificate                "tcg-tr-cat-genericCertificate"
-#define LN_tcg_tr_cat_genericCertificate                "Generic Certificate Trait Category"
-#define NID_tcg_tr_cat_genericCertificate               1440
-#define OBJ_tcg_tr_cat_genericCertificate               OBJ_tcg_tr_category,24L
-
-#define SN_tcg_tr_cat_CommonCriteria            "tcg-tr-cat-CommonCriteria"
-#define LN_tcg_tr_cat_CommonCriteria            "Common Criteria Trait Category"
-#define NID_tcg_tr_cat_CommonCriteria           1441
-#define OBJ_tcg_tr_cat_CommonCriteria           OBJ_tcg_tr_category,25L
-
-#define SN_tcg_tr_cat_componentIdentifierV11            "tcg-tr-cat-componentIdentifierV11"
-#define LN_tcg_tr_cat_componentIdentifierV11            "Component Identifier V1.1 Trait Category"
-#define NID_tcg_tr_cat_componentIdentifierV11           1442
-#define OBJ_tcg_tr_cat_componentIdentifierV11           OBJ_tcg_tr_category,26L
-
-#define SN_tcg_tr_cat_FIPSLevel         "tcg-tr-cat-FIPSLevel"
-#define LN_tcg_tr_cat_FIPSLevel         "FIPS Level Trait Category"
-#define NID_tcg_tr_cat_FIPSLevel                1443
-#define OBJ_tcg_tr_cat_FIPSLevel                OBJ_tcg_tr_category,27L
-
-#define SN_tcg_tr_cat_ISO9000           "tcg-tr-cat-ISO9000"
-#define LN_tcg_tr_cat_ISO9000           "ISO 9000 Trait Category"
-#define NID_tcg_tr_cat_ISO9000          1444
-#define OBJ_tcg_tr_cat_ISO9000          OBJ_tcg_tr_category,28L
-
-#define SN_tcg_tr_cat_networkMAC                "tcg-tr-cat-networkMAC"
-#define LN_tcg_tr_cat_networkMAC                "Network MAC Trait Category"
-#define NID_tcg_tr_cat_networkMAC               1445
-#define OBJ_tcg_tr_cat_networkMAC               OBJ_tcg_tr_category,29L
-
-#define SN_tcg_tr_cat_attestationProtocol               "tcg-tr-cat-attestationProtocol"
-#define LN_tcg_tr_cat_attestationProtocol               "Attestation Protocol Trait Category"
-#define NID_tcg_tr_cat_attestationProtocol              1446
-#define OBJ_tcg_tr_cat_attestationProtocol              OBJ_tcg_tr_category,30L
-
-#define SN_tcg_tr_cat_PEN               "tcg-tr-cat-PEN"
-#define LN_tcg_tr_cat_PEN               "Private Enterprise Number Trait Category"
-#define NID_tcg_tr_cat_PEN              1447
-#define OBJ_tcg_tr_cat_PEN              OBJ_tcg_tr_category,31L
-
-#define SN_tcg_tr_cat_platformFirmwareCapabilities              "tcg-tr-cat-platformFirmwareCapabilities"
-#define LN_tcg_tr_cat_platformFirmwareCapabilities              "Platform Firmware Capabilities Trait Category"
-#define NID_tcg_tr_cat_platformFirmwareCapabilities             1448
-#define OBJ_tcg_tr_cat_platformFirmwareCapabilities             OBJ_tcg_tr_category,32L
-
-#define SN_tcg_tr_cat_platformHardwareCapabilities              "tcg-tr-cat-platformHardwareCapabilities"
-#define LN_tcg_tr_cat_platformHardwareCapabilities              "Platform Hardware Capabilities Trait Category"
-#define NID_tcg_tr_cat_platformHardwareCapabilities             1449
-#define OBJ_tcg_tr_cat_platformHardwareCapabilities             OBJ_tcg_tr_category,33L
-
-#define SN_tcg_tr_cat_platformFirmwareSignatureVerification             "tcg-tr-cat-platformFirmwareSignatureVerification"
-#define LN_tcg_tr_cat_platformFirmwareSignatureVerification             "Platform Firmware Signature Verification Trait Category"
-#define NID_tcg_tr_cat_platformFirmwareSignatureVerification            1450
-#define OBJ_tcg_tr_cat_platformFirmwareSignatureVerification            OBJ_tcg_tr_category,34L
-
-#define SN_tcg_tr_cat_platformFirmwareUpdateCompliance          "tcg-tr-cat-platformFirmwareUpdateCompliance"
-#define LN_tcg_tr_cat_platformFirmwareUpdateCompliance          "Platform Firmware Update Compliance Trait Category"
-#define NID_tcg_tr_cat_platformFirmwareUpdateCompliance         1451
-#define OBJ_tcg_tr_cat_platformFirmwareUpdateCompliance         OBJ_tcg_tr_category,35L
-
-#define SN_tcg_tr_cat_RTM               "tcg-tr-cat-RTM"
-#define LN_tcg_tr_cat_RTM               "Root of Trust of Measurement Trait Category"
-#define NID_tcg_tr_cat_RTM              1452
-#define OBJ_tcg_tr_cat_RTM              OBJ_tcg_tr_category,36L
-
-#define SN_tcg_tr_cat_PublicKey         "tcg-tr-cat-PublicKey"
-#define LN_tcg_tr_cat_PublicKey         "Public Key Trait Category"
-#define NID_tcg_tr_cat_PublicKey                1453
-#define OBJ_tcg_tr_cat_PublicKey                OBJ_tcg_tr_category,37L
-
-#define OBJ_nistKems            OBJ_nistAlgorithms,4L
-
-#define SN_ML_KEM_512           "id-alg-ml-kem-512"
-#define LN_ML_KEM_512           "ML-KEM-512"
-#define NID_ML_KEM_512          1454
-#define OBJ_ML_KEM_512          OBJ_nistKems,1L
-
-#define SN_ML_KEM_768           "id-alg-ml-kem-768"
-#define LN_ML_KEM_768           "ML-KEM-768"
-#define NID_ML_KEM_768          1455
-#define OBJ_ML_KEM_768          OBJ_nistKems,2L
-
-#define SN_ML_KEM_1024          "id-alg-ml-kem-1024"
-#define LN_ML_KEM_1024          "ML-KEM-1024"
-#define NID_ML_KEM_1024         1456
-#define OBJ_ML_KEM_1024         OBJ_nistKems,3L
-
-#endif /* OPENSSL_OBJ_MAC_H */
-
-#ifndef OPENSSL_NO_DEPRECATED_3_0
-
-#define SN_id_tc26_cipher_gostr3412_2015_magma_ctracpkm SN_magma_ctr_acpkm
-#define NID_id_tc26_cipher_gostr3412_2015_magma_ctracpkm NID_magma_ctr_acpkm
-#define OBJ_id_tc26_cipher_gostr3412_2015_magma_ctracpkm OBJ_magma_ctr_acpkm
-
-#define SN_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac SN_magma_ctr_acpkm_omac
-#define NID_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac NID_magma_ctr_acpkm_omac
-#define OBJ_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac OBJ_magma_ctr_acpkm_omac
-
-#define SN_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm SN_kuznyechik_ctr_acpkm
-#define NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm NID_kuznyechik_ctr_acpkm
-#define OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm OBJ_kuznyechik_ctr_acpkm
-
-#define SN_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac SN_kuznyechik_ctr_acpkm_omac
-#define NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac NID_kuznyechik_ctr_acpkm_omac
-#define OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac OBJ_kuznyechik_ctr_acpkm_omac
-
-#define SN_id_tc26_wrap_gostr3412_2015_magma_kexp15 SN_magma_kexp15
-#define NID_id_tc26_wrap_gostr3412_2015_magma_kexp15 NID_magma_kexp15
-#define OBJ_id_tc26_wrap_gostr3412_2015_magma_kexp15 OBJ_magma_kexp15
-
-#define SN_id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15 SN_kuznyechik_kexp15
-#define NID_id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15 NID_kuznyechik_kexp15
-#define OBJ_id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15 OBJ_kuznyechik_kexp15
-
-#define SN_grasshopper_ecb SN_kuznyechik_ecb
-#define NID_grasshopper_ecb NID_kuznyechik_ecb
-
-#define SN_grasshopper_ctr SN_kuznyechik_ctr
-#define NID_grasshopper_ctr NID_kuznyechik_ctr
-
-#define SN_grasshopper_ofb SN_kuznyechik_ofb
-#define NID_grasshopper_ofb NID_kuznyechik_ofb
-
-#define SN_grasshopper_cbc SN_kuznyechik_cbc
-#define NID_grasshopper_cbc NID_kuznyechik_cbc
-
-#define SN_grasshopper_cfb SN_kuznyechik_cfb
-#define NID_grasshopper_cfb NID_kuznyechik_cfb
-
-#define SN_grasshopper_mac SN_kuznyechik_mac
-#define NID_grasshopper_mac NID_kuznyechik_mac
-
-#endif /* OPENSSL_NO_DEPRECATED_3_0 */
diff --git a/deps/openssl/openssl/include/openssl/objectserr.h b/deps/openssl/openssl/include/openssl/objectserr.h
deleted file mode 100644
index 2927561135f..00000000000
--- a/deps/openssl/openssl/include/openssl/objectserr.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_OBJECTSERR_H
-#define OPENSSL_OBJECTSERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * OBJ reason codes.
- */
-#define OBJ_R_OID_EXISTS 102
-#define OBJ_R_UNKNOWN_NID 101
-#define OBJ_R_UNKNOWN_OBJECT_NAME 103
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/ocsp.h b/deps/openssl/openssl/include/openssl/ocsp.h
deleted file mode 100644
index 5b13afedf36..00000000000
--- a/deps/openssl/openssl/include/openssl/ocsp.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/ocsp.h"
diff --git a/deps/openssl/openssl/include/openssl/ocsp.h.in b/deps/openssl/openssl/include/openssl/ocsp.h.in
index d2cfd9c1163..ce33a4d8fc1 100644
--- a/deps/openssl/openssl/include/openssl/ocsp.h.in
+++ b/deps/openssl/openssl/include/openssl/ocsp.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -144,9 +144,13 @@ typedef struct ocsp_service_locator_st OCSP_SERVICELOC;
 #define PEM_STRING_OCSP_REQUEST "OCSP REQUEST"
 #define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE"

-#define d2i_OCSP_REQUEST_bio(bp, p) ASN1_d2i_bio_of(OCSP_REQUEST, OCSP_REQUEST_new, d2i_OCSP_REQUEST, bp, p)
+#define d2i_OCSP_REQUEST_bio(bp, p)                                  \
+    ((OCSP_REQUEST *)ASN1_item_d2i_bio(ASN1_ITEM_rptr(OCSP_REQUEST), \
+        (bp), CHECKED_PPTR_OF(OCSP_REQUEST, p)))

-#define d2i_OCSP_RESPONSE_bio(bp, p) ASN1_d2i_bio_of(OCSP_RESPONSE, OCSP_RESPONSE_new, d2i_OCSP_RESPONSE, bp, p)
+#define d2i_OCSP_RESPONSE_bio(bp, p)                                   \
+    ((OCSP_RESPONSE *)ASN1_item_d2i_bio(ASN1_ITEM_rptr(OCSP_RESPONSE), \
+        (bp), CHECKED_PPTR_OF(OCSP_RESPONSE, p)))

 #define PEM_read_bio_OCSP_REQUEST(bp, x, cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \
     (d2i_of_void *)d2i_OCSP_REQUEST, PEM_STRING_OCSP_REQUEST,                   \
@@ -164,9 +168,13 @@ typedef struct ocsp_service_locator_st OCSP_SERVICELOC;
     PEM_ASN1_write_bio((i2d_of_void *)i2d_OCSP_RESPONSE, PEM_STRING_OCSP_RESPONSE, \
         bp, (char *)(o), NULL, NULL, 0, NULL, NULL)

-#define i2d_OCSP_RESPONSE_bio(bp, o) ASN1_i2d_bio_of(OCSP_RESPONSE, i2d_OCSP_RESPONSE, bp, o)
+#define i2d_OCSP_RESPONSE_bio(bp, o)                 \
+    ASN1_item_i2d_bio(ASN1_ITEM_rptr(OCSP_RESPONSE), \
+        (bp), CHECKED_PTR_OF(const OCSP_RESPONSE, o))

-#define i2d_OCSP_REQUEST_bio(bp, o) ASN1_i2d_bio_of(OCSP_REQUEST, i2d_OCSP_REQUEST, bp, o)
+#define i2d_OCSP_REQUEST_bio(bp, o)                 \
+    ASN1_item_i2d_bio(ASN1_ITEM_rptr(OCSP_REQUEST), \
+        (bp), CHECKED_PTR_OF(const OCSP_REQUEST, o))

 #define ASN1_BIT_STRING_digest(data, type, md, len) \
     ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING), type, data, md, len)
@@ -224,7 +232,7 @@ int OCSP_request_sign(OCSP_REQUEST *req,
     X509 *signer,
     EVP_PKEY *key,
     const EVP_MD *dgst,
-    STACK_OF(X509) *certs, unsigned long flags);
+    const STACK_OF(X509) *certs, unsigned long flags);

 int OCSP_response_status(OCSP_RESPONSE *resp);
 OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
@@ -233,7 +241,7 @@ const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs);
 const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs);
 const OCSP_RESPDATA *OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs);
 int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer,
-    STACK_OF(X509) *extra_certs);
+    const STACK_OF(X509) *extra_certs);

 int OCSP_resp_count(OCSP_BASICRESP *bs);
 OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);
@@ -259,7 +267,7 @@ int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
 int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
     ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec);

-int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
+int OCSP_request_verify(OCSP_REQUEST *req, const STACK_OF(X509) *certs,
     X509_STORE *store, unsigned long flags);

 #define OCSP_parse_url(url, host, port, path, ssl) \
@@ -285,10 +293,10 @@ OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp,
 int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert);
 int OCSP_basic_sign(OCSP_BASICRESP *brsp,
     X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
-    STACK_OF(X509) *certs, unsigned long flags);
+    const STACK_OF(X509) *certs, unsigned long flags);
 int OCSP_basic_sign_ctx(OCSP_BASICRESP *brsp,
     X509 *signer, EVP_MD_CTX *ctx,
-    STACK_OF(X509) *certs, unsigned long flags);
+    const STACK_OF(X509) *certs, unsigned long flags);
 int OCSP_RESPID_set_by_name(OCSP_RESPID *respid, X509 *cert);
 int OCSP_RESPID_set_by_key_ex(OCSP_RESPID *respid, X509 *cert,
     OSSL_LIB_CTX *libctx, const char *propq);
@@ -310,24 +318,24 @@ int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos);
 int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, const ASN1_OBJECT *obj,
     int lastpos);
 int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos);
-X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
+const X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
 X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
 void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit,
     int *idx);
 int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit,
     unsigned long flags);
-int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc);
+int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, const X509_EXTENSION *ex, int loc);

 int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x);
 int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos);
 int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, const ASN1_OBJECT *obj, int lastpos);
 int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos);
-X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);
+const X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);
 X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
 void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
 int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
     unsigned long flags);
-int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc);
+int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, const X509_EXTENSION *ex, int loc);

 int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x);
 int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos);
@@ -335,13 +343,13 @@ int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, const ASN1_OBJECT *obj,
     int lastpos);
 int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit,
     int lastpos);
-X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
+const X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
 X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
 void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit,
     int *idx);
 int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value,
     int crit, unsigned long flags);
-int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc);
+int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, const X509_EXTENSION *ex, int loc);

 int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x);
 int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos);
@@ -349,13 +357,13 @@ int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, const ASN1_OBJECT *obj,
     int lastpos);
 int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit,
     int lastpos);
-X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
+const X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
 X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
 void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit,
     int *idx);
 int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value,
     int crit, unsigned long flags);
-int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc);
+int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, const X509_EXTENSION *ex, int loc);
 const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x);

 DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)
@@ -381,7 +389,7 @@ const char *OCSP_crl_reason_str(long s);
 int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST *a, unsigned long flags);
 int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags);

-int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
+int OCSP_basic_verify(OCSP_BASICRESP *bs, const STACK_OF(X509) *certs,
     X509_STORE *st, unsigned long flags);

 #ifdef __cplusplus
diff --git a/deps/openssl/openssl/include/openssl/ocsperr.h b/deps/openssl/openssl/include/openssl/ocsperr.h
deleted file mode 100644
index 18e035e8a4e..00000000000
--- a/deps/openssl/openssl/include/openssl/ocsperr.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_OCSPERR_H
-#define OPENSSL_OCSPERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-#ifndef OPENSSL_NO_OCSP
-
-/*
- * OCSP reason codes.
- */
-#define OCSP_R_CERTIFICATE_VERIFY_ERROR 101
-#define OCSP_R_DIGEST_ERR 102
-#define OCSP_R_DIGEST_NAME_ERR 106
-#define OCSP_R_DIGEST_SIZE_ERR 107
-#define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122
-#define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123
-#define OCSP_R_MISSING_OCSPSIGNING_USAGE 103
-#define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124
-#define OCSP_R_NOT_BASIC_RESPONSE 104
-#define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105
-#define OCSP_R_NO_RESPONSE_DATA 108
-#define OCSP_R_NO_REVOKED_TIME 109
-#define OCSP_R_NO_SIGNER_KEY 130
-#define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110
-#define OCSP_R_REQUEST_NOT_SIGNED 128
-#define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111
-#define OCSP_R_ROOT_CA_NOT_TRUSTED 112
-#define OCSP_R_SIGNATURE_FAILURE 117
-#define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118
-#define OCSP_R_STATUS_EXPIRED 125
-#define OCSP_R_STATUS_NOT_YET_VALID 126
-#define OCSP_R_STATUS_TOO_OLD 127
-#define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119
-#define OCSP_R_UNKNOWN_NID 120
-#define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129
-
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/openssl/opensslv.h b/deps/openssl/openssl/include/openssl/opensslv.h
deleted file mode 100644
index 078cfba40fb..00000000000
--- a/deps/openssl/openssl/include/openssl/opensslv.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/opensslv.h"
diff --git a/deps/openssl/openssl/include/openssl/ossl_typ.h b/deps/openssl/openssl/include/openssl/ossl_typ.h
index a562299b9f9..fa396e92170 100644
--- a/deps/openssl/openssl/include/openssl/ossl_typ.h
+++ b/deps/openssl/openssl/include/openssl/ossl_typ.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,4 +13,9 @@
  * This header file only exists for compatibility reasons with older
  * applications which #include <openssl/ossl_typ.h>.
  */
+#if !defined(OSSL_OPENSSL_OSSL_TYP_H)
+#define OSSL_OPENSSL_OSSL_TYP_H
+
 #include <openssl/types.h>
+
+#endif /* !defined(OSSL_OPENSSL_OSSL_TYP_H) */
diff --git a/deps/openssl/openssl/include/openssl/params.h b/deps/openssl/openssl/include/openssl/params.h
index 73e0d41b717..05320896c34 100644
--- a/deps/openssl/openssl/include/openssl/params.h
+++ b/deps/openssl/openssl/include/openssl/params.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2019, Oracle and/or its affiliates.  All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -156,6 +156,10 @@ void OSSL_PARAM_set_all_unmodified(OSSL_PARAM *p);
 OSSL_PARAM *OSSL_PARAM_dup(const OSSL_PARAM *p);
 OSSL_PARAM *OSSL_PARAM_merge(const OSSL_PARAM *p1, const OSSL_PARAM *p2);
 void OSSL_PARAM_free(OSSL_PARAM *p);
+void OSSL_PARAM_clear_free(OSSL_PARAM *p);
+
+int OSSL_PARAM_set_octet_string_or_ptr(OSSL_PARAM *p, const void *val,
+    size_t len);

 #ifdef __cplusplus
 }
diff --git a/deps/openssl/openssl/include/openssl/pem.h b/deps/openssl/openssl/include/openssl/pem.h
index fa64aaf4ca2..115c8f27331 100644
--- a/deps/openssl/openssl/include/openssl/pem.h
+++ b/deps/openssl/openssl/include/openssl/pem.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -60,6 +60,7 @@ extern "C" {
 #define PEM_STRING_SM2PRIVATEKEY "SM2 PRIVATE KEY"
 #define PEM_STRING_SM2PARAMETERS "SM2 PARAMETERS"
 #define PEM_STRING_ACERT "ATTRIBUTE CERTIFICATE"
+#define PEM_STRING_ECHCONFIG "ECHCONFIG"

 #define PEM_TYPE_ENCRYPTED 10
 #define PEM_TYPE_MIC_ONLY 20
@@ -116,8 +117,26 @@ extern "C" {
 #define IMPLEMENT_PEM_read_fp(name, type, str, asn1)                        \
     type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u) \
     {                                                                       \
-        return PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str, fp,            \
-            (void **)x, cb, u);                                             \
+        BIO *b;                                                             \
+        const unsigned char *p = NULL;                                      \
+        unsigned char *data = NULL;                                         \
+        long len;                                                           \
+        type *ret = NULL;                                                   \
+                                                                            \
+        if ((b = BIO_new(BIO_s_file())) == NULL) {                          \
+            ERR_raise(ERR_LIB_PEM, ERR_R_BUF_LIB);                          \
+            return NULL;                                                    \
+        }                                                                   \
+        BIO_set_fp(b, fp, BIO_NOCLOSE);                                     \
+        if (PEM_bytes_read_bio(&data, &len, NULL, str, b, cb, u)) {         \
+            p = data;                                                       \
+            ret = d2i_##asn1(x, &p, len);                                   \
+            if (ret == NULL)                                                \
+                ERR_raise(ERR_LIB_PEM, ERR_R_ASN1_LIB);                     \
+        }                                                                   \
+        BIO_free(b);                                                        \
+        OPENSSL_free(data);                                                 \
+        return ret;                                                         \
     }

 #define IMPLEMENT_PEM_write_fp(name, type, str, asn1)              \
@@ -145,12 +164,24 @@ extern "C" {
 #endif
 #endif

-#define IMPLEMENT_PEM_read_bio(name, type, str, asn1)                \
-    type *PEM_read_bio_##name(BIO *bp, type **x,                     \
-        pem_password_cb *cb, void *u)                                \
-    {                                                                \
-        return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str, bp, \
-            (void **)x, cb, u);                                      \
+#define IMPLEMENT_PEM_read_bio(name, type, str, asn1)   \
+    type *PEM_read_bio_##name(BIO *bp, type **x,        \
+        pem_password_cb *cb, void *u)                   \
+    {                                                   \
+        const unsigned char *p = NULL;                  \
+        unsigned char *data = NULL;                     \
+        long len;                                       \
+        type *ret = NULL;                               \
+                                                        \
+        if (!PEM_bytes_read_bio(&data, &len, NULL, str, \
+                bp, cb, u))                             \
+            return NULL;                                \
+        p = data;                                       \
+        ret = d2i_##asn1(x, &p, len);                   \
+        if (ret == NULL)                                \
+            ERR_raise(ERR_LIB_PEM, ERR_R_ASN1_LIB);     \
+        OPENSSL_free(data);                             \
+        return ret;                                     \
     }

 #define IMPLEMENT_PEM_write_bio(name, type, str, asn1)                 \
diff --git a/deps/openssl/openssl/include/openssl/pemerr.h b/deps/openssl/openssl/include/openssl/pemerr.h
deleted file mode 100644
index eb3c9a1d94f..00000000000
--- a/deps/openssl/openssl/include/openssl/pemerr.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_PEMERR_H
-#define OPENSSL_PEMERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * PEM reason codes.
- */
-#define PEM_R_BAD_BASE64_DECODE 100
-#define PEM_R_BAD_DECRYPT 101
-#define PEM_R_BAD_END_LINE 102
-#define PEM_R_BAD_IV_CHARS 103
-#define PEM_R_BAD_MAGIC_NUMBER 116
-#define PEM_R_BAD_PASSWORD_READ 104
-#define PEM_R_BAD_VERSION_NUMBER 117
-#define PEM_R_BIO_WRITE_FAILURE 118
-#define PEM_R_CIPHER_IS_NULL 127
-#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115
-#define PEM_R_EXPECTING_DSS_KEY_BLOB 131
-#define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119
-#define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120
-#define PEM_R_EXPECTING_RSA_KEY_BLOB 132
-#define PEM_R_HEADER_TOO_LONG 128
-#define PEM_R_INCONSISTENT_HEADER 121
-#define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122
-#define PEM_R_KEYBLOB_TOO_SHORT 123
-#define PEM_R_MISSING_DEK_IV 129
-#define PEM_R_NOT_DEK_INFO 105
-#define PEM_R_NOT_ENCRYPTED 106
-#define PEM_R_NOT_PROC_TYPE 107
-#define PEM_R_NO_START_LINE 108
-#define PEM_R_PROBLEMS_GETTING_PASSWORD 109
-#define PEM_R_PVK_DATA_TOO_SHORT 124
-#define PEM_R_PVK_TOO_SHORT 125
-#define PEM_R_READ_KEY 111
-#define PEM_R_SHORT_HEADER 112
-#define PEM_R_UNEXPECTED_DEK_IV 130
-#define PEM_R_UNSUPPORTED_CIPHER 113
-#define PEM_R_UNSUPPORTED_ENCRYPTION 114
-#define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126
-#define PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE 110
-#define PEM_R_UNSUPPORTED_PVK_KEY_TYPE 133
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/pkcs12.h b/deps/openssl/openssl/include/openssl/pkcs12.h
deleted file mode 100644
index 2d7e2c08e99..00000000000
--- a/deps/openssl/openssl/include/openssl/pkcs12.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/pkcs12.h"
diff --git a/deps/openssl/openssl/include/openssl/pkcs12.h.in b/deps/openssl/openssl/include/openssl/pkcs12.h.in
index 67d0bdb23ae..6555322be31 100644
--- a/deps/openssl/openssl/include/openssl/pkcs12.h.in
+++ b/deps/openssl/openssl/include/openssl/pkcs12.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -47,8 +47,14 @@ extern "C" {

 #define PKCS12_MAC_KEY_LENGTH 20

-/* The macro is expected to be used only internally. Kept for backwards compatibility. */
-#define PKCS12_SALT_LEN 8
+/*
+ * The macro is expected to be used only internally. Kept for
+ * backwards compatibility. NIST requires 16, previous value was
+ * 8. Allow to override this at compile time.
+ */
+#ifndef PKCS12_SALT_LEN
+#define PKCS12_SALT_LEN 16
+#endif

 /* It's not clear if these are actually needed... */
 #define PKCS12_key_gen PKCS12_key_gen_utf8
@@ -95,11 +101,11 @@ typedef struct pkcs12_bag_st PKCS12_BAGS;

 #endif
 #ifndef OPENSSL_NO_DEPRECATED_1_1_0
-OSSL_DEPRECATEDIN_1_1_0 ASN1_TYPE *PKCS12_get_attr(const PKCS12_SAFEBAG *bag,
+OSSL_DEPRECATEDIN_1_1_0 const ASN1_TYPE *PKCS12_get_attr(const PKCS12_SAFEBAG *bag,
     int attr_nid);
 #endif

-ASN1_TYPE *PKCS8_get_attr(PKCS8_PRIV_KEY_INFO *p8, int attr_nid);
+const ASN1_TYPE *PKCS8_get_attr(PKCS8_PRIV_KEY_INFO *p8, int attr_nid);
 int PKCS12_mac_present(const PKCS12 *p12);
 void PKCS12_get0_mac(const ASN1_OCTET_STRING **pmac,
     const X509_ALGOR **pmacalg,
@@ -185,7 +191,7 @@ STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass,
 int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes);
 STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12);

-int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,
+int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, const unsigned char *name,
     int namelen);
 int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
     int namelen);
@@ -200,7 +206,7 @@ int PKCS12_add1_attr_by_NID(PKCS12_SAFEBAG *bag, int nid, int type,
 int PKCS12_add1_attr_by_txt(PKCS12_SAFEBAG *bag, const char *attrname, int type,
     const unsigned char *bytes, int len);
 int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage);
-ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs,
+const ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs,
     int attr_nid);
 char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
 const STACK_OF(X509_ATTRIBUTE) *
diff --git a/deps/openssl/openssl/include/openssl/pkcs12err.h b/deps/openssl/openssl/include/openssl/pkcs12err.h
deleted file mode 100644
index 2ad38f88ff5..00000000000
--- a/deps/openssl/openssl/include/openssl/pkcs12err.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_PKCS12ERR_H
-#define OPENSSL_PKCS12ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * PKCS12 reason codes.
- */
-#define PKCS12_R_CALLBACK_FAILED 115
-#define PKCS12_R_CANT_PACK_STRUCTURE 100
-#define PKCS12_R_CONTENT_TYPE_NOT_DATA 121
-#define PKCS12_R_DECODE_ERROR 101
-#define PKCS12_R_ENCODE_ERROR 102
-#define PKCS12_R_ENCRYPT_ERROR 103
-#define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120
-#define PKCS12_R_INVALID_NULL_ARGUMENT 104
-#define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105
-#define PKCS12_R_INVALID_TYPE 112
-#define PKCS12_R_IV_GEN_ERROR 106
-#define PKCS12_R_KEY_GEN_ERROR 107
-#define PKCS12_R_MAC_ABSENT 108
-#define PKCS12_R_MAC_GENERATION_ERROR 109
-#define PKCS12_R_MAC_SETUP_ERROR 110
-#define PKCS12_R_MAC_STRING_SET_ERROR 111
-#define PKCS12_R_MAC_VERIFY_FAILURE 113
-#define PKCS12_R_PARSE_ERROR 114
-#define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116
-#define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118
-#define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/pkcs7.h b/deps/openssl/openssl/include/openssl/pkcs7.h
deleted file mode 100644
index b553f9d0f05..00000000000
--- a/deps/openssl/openssl/include/openssl/pkcs7.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/pkcs7.h"
diff --git a/deps/openssl/openssl/include/openssl/pkcs7.h.in b/deps/openssl/openssl/include/openssl/pkcs7.h.in
index 1d57255ae74..c9edcdd7acb 100644
--- a/deps/openssl/openssl/include/openssl/pkcs7.h.in
+++ b/deps/openssl/openssl/include/openssl/pkcs7.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -91,6 +91,7 @@ typedef struct pkcs7_recip_info_st {
 typedef struct pkcs7_signed_st {
     ASN1_INTEGER *version; /* version 1 */
     STACK_OF(X509_ALGOR) *md_algs; /* md used */
+    /* untrusted certificates for chain building, may include signer certs: */
     STACK_OF(X509) *cert; /* [ 0 ] */ /* name should be 'certificates' */
     STACK_OF(X509_CRL) *crl; /* [ 1 ] */ /* name should be 'crls' */
     STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
@@ -118,6 +119,7 @@ typedef struct pkcs7_enveloped_st {
 typedef struct pkcs7_signedandenveloped_st {
     ASN1_INTEGER *version; /* version 1 */
     STACK_OF(X509_ALGOR) *md_algs; /* md used */
+    /* untrusted certificates for chain building, may include signer certs: */
     STACK_OF(X509) *cert; /* [ 0 ] */ /* name should be 'certificates' */
     STACK_OF(X509_CRL) *crl; /* [ 1 ] */ /* name should be 'crls' */
     STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
@@ -284,7 +286,7 @@ int PKCS7_content_new(PKCS7 *p7, int nid);
 int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx,
     BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si);
 int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
-    X509 *signer);
+    const X509 *signer);

 BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio);
 int PKCS7_dataFinal(PKCS7 *p7, BIO *bio);
@@ -303,40 +305,39 @@ void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc);
 int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);
 int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);
 int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher);
-int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7);
+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+OSSL_DEPRECATEDIN_4_1 int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7);
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_1) */

 PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);
 ASN1_OCTET_STRING *PKCS7_get_octet_string(PKCS7 *p7);
-ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
+const ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
 int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type,
     void *data);
 int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
     void *value);
-ASN1_TYPE *PKCS7_get_attribute(const PKCS7_SIGNER_INFO *si, int nid);
-ASN1_TYPE *PKCS7_get_signed_attribute(const PKCS7_SIGNER_INFO *si, int nid);
+const ASN1_TYPE *PKCS7_get_attribute(const PKCS7_SIGNER_INFO *si, int nid);
+const ASN1_TYPE *PKCS7_get_signed_attribute(const PKCS7_SIGNER_INFO *si, int nid);
 int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,
     STACK_OF(X509_ATTRIBUTE) *sk);
 int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,
     STACK_OF(X509_ATTRIBUTE) *sk);

-PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
+PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, const STACK_OF(X509) *certs,
     BIO *data, int flags);
-PKCS7 *PKCS7_sign_ex(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
-    BIO *data, int flags, OSSL_LIB_CTX *libctx,
-    const char *propq);
+PKCS7 *PKCS7_sign_ex(X509 *signcert, EVP_PKEY *pkey, const STACK_OF(X509) *certs,
+    BIO *data, int flags, OSSL_LIB_CTX *libctx, const char *propq);

 PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,
     X509 *signcert, EVP_PKEY *pkey,
     const EVP_MD *md, int flags);

 int PKCS7_final(PKCS7 *p7, BIO *data, int flags);
-int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
+int PKCS7_verify(PKCS7 *p7, const STACK_OF(X509) *certs, X509_STORE *store,
     BIO *indata, BIO *out, int flags);
-STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,
-    int flags);
-PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
-    int flags);
-PKCS7 *PKCS7_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
+STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, const STACK_OF(X509) *certs, int flags);
+PKCS7 *PKCS7_encrypt(const STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, int flags);
+PKCS7 *PKCS7_encrypt_ex(const STACK_OF(X509) *certs, BIO *in,
     const EVP_CIPHER *cipher, int flags,
     OSSL_LIB_CTX *libctx, const char *propq);
 int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data,
diff --git a/deps/openssl/openssl/include/openssl/pkcs7err.h b/deps/openssl/openssl/include/openssl/pkcs7err.h
deleted file mode 100644
index 358fe1018fb..00000000000
--- a/deps/openssl/openssl/include/openssl/pkcs7err.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_PKCS7ERR_H
-#define OPENSSL_PKCS7ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * PKCS7 reason codes.
- */
-#define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117
-#define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144
-#define PKCS7_R_CIPHER_NOT_INITIALIZED 116
-#define PKCS7_R_CONTENT_AND_DATA_PRESENT 118
-#define PKCS7_R_CTRL_ERROR 152
-#define PKCS7_R_DECRYPT_ERROR 119
-#define PKCS7_R_DIGEST_FAILURE 101
-#define PKCS7_R_ENCRYPTION_CTRL_FAILURE 149
-#define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150
-#define PKCS7_R_ERROR_ADDING_RECIPIENT 120
-#define PKCS7_R_ERROR_SETTING_CIPHER 121
-#define PKCS7_R_INVALID_NULL_POINTER 143
-#define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155
-#define PKCS7_R_NO_CONTENT 122
-#define PKCS7_R_NO_DEFAULT_DIGEST 151
-#define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND 154
-#define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115
-#define PKCS7_R_NO_SIGNATURES_ON_DATA 123
-#define PKCS7_R_NO_SIGNERS 142
-#define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104
-#define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124
-#define PKCS7_R_PKCS7_ADD_SIGNER_ERROR 153
-#define PKCS7_R_PKCS7_DATASIGN 145
-#define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127
-#define PKCS7_R_SIGNATURE_FAILURE 105
-#define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128
-#define PKCS7_R_SIGNING_CTRL_FAILURE 147
-#define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 148
-#define PKCS7_R_SMIME_TEXT_ERROR 129
-#define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106
-#define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107
-#define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108
-#define PKCS7_R_UNKNOWN_DIGEST_TYPE 109
-#define PKCS7_R_UNKNOWN_OPERATION 110
-#define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111
-#define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112
-#define PKCS7_R_WRONG_CONTENT_TYPE 113
-#define PKCS7_R_WRONG_PKCS7_TYPE 114
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/posix_time.h b/deps/openssl/openssl/include/openssl/posix_time.h
new file mode 100644
index 00000000000..1cdaa22829e
--- /dev/null
+++ b/deps/openssl/openssl/include/openssl/posix_time.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OPENSSL_HEADER_POSIX_TIME_H
+#define OPENSSL_HEADER_POSIX_TIME_H
+#include <stdint.h>
+#include <time.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+/*
+ * OPENSSL_posix_to_tm converts a int64_t POSIX time value in |time|,
+ * which must be in the range of year 0000 to 9999, to a broken out
+ * time value in |tm|. It returns one on success and zero on error.
+ */
+int OPENSSL_posix_to_tm(int64_t time, struct tm *out_tm);
+
+/*
+ * OPENSSL_tm_to_posix converts a time value between the years 0 and
+ * 9999 in |tm| to a POSIX time value in |out|. One is returned on
+ * success, zero is returned on failure. It is a failure if |tm|
+ * contains out of range values.
+ */
+int OPENSSL_tm_to_posix(const struct tm *tm, int64_t *out);
+
+/*
+ * OPENSSL_timegm converts a time value between the years 0 and 9999
+ * in |tm| to a time_t value in |out|. One is returned on success,
+ * zero is returned on failure. It is a failure if the converted time
+ * can not be represented in a time_t, or if the tm contains out of
+ * range values.
+ */
+int OPENSSL_timegm(const struct tm *tm, time_t *out);
+
+#if defined(__cplusplus)
+} /* extern C */
+#endif
+
+#endif /* OPENSSL_HEADER_POSIX_TIME_H */
diff --git a/deps/openssl/openssl/include/openssl/prov_ssl.h b/deps/openssl/openssl/include/openssl/prov_ssl.h
index 269c3b80573..2d2682b466c 100644
--- a/deps/openssl/openssl/include/openssl/prov_ssl.h
+++ b/deps/openssl/openssl/include/openssl/prov_ssl.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -27,11 +27,17 @@ extern "C" {
 #define TLS1_3_VERSION 0x0304
 #define DTLS1_VERSION 0xFEFF
 #define DTLS1_2_VERSION 0xFEFD
+#define DTLS1_3_VERSION 0xFEFC
 #define DTLS1_BAD_VER 0x0100

+#define PROTO_VERSION_UNSET 0
+
 /* QUIC uses a 4 byte unsigned version number */
 #define OSSL_QUIC1_VERSION 0x0000001

+/* Maximum plaintext length: defined by SSL/TLS standards */
+#define SSL3_RT_MAX_PLAIN_LENGTH 16384
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/deps/openssl/openssl/include/openssl/proverr.h b/deps/openssl/openssl/include/openssl/proverr.h
deleted file mode 100644
index 3dff4b75482..00000000000
--- a/deps/openssl/openssl/include/openssl/proverr.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_PROVERR_H
-#define OPENSSL_PROVERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * PROV reason codes.
- */
-#define PROV_R_ADDITIONAL_INPUT_TOO_LONG 184
-#define PROV_R_ALGORITHM_MISMATCH 173
-#define PROV_R_ALREADY_INSTANTIATED 185
-#define PROV_R_BAD_DECRYPT 100
-#define PROV_R_BAD_ENCODING 141
-#define PROV_R_BAD_LENGTH 142
-#define PROV_R_BAD_TLS_CLIENT_VERSION 161
-#define PROV_R_BN_ERROR 160
-#define PROV_R_CIPHER_OPERATION_FAILED 102
-#define PROV_R_COFACTOR_REQUIRED 236
-#define PROV_R_DERIVATION_FUNCTION_INIT_FAILED 205
-#define PROV_R_DIGEST_NOT_ALLOWED 174
-#define PROV_R_EMS_NOT_ENABLED 233
-#define PROV_R_ENTROPY_SOURCE_FAILED_CONTINUOUS_TESTS 244
-#define PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK 186
-#define PROV_R_ERROR_INSTANTIATING_DRBG 188
-#define PROV_R_ERROR_RETRIEVING_ENTROPY 189
-#define PROV_R_ERROR_RETRIEVING_NONCE 190
-#define PROV_R_FAILED_DURING_DERIVATION 164
-#define PROV_R_FAILED_TO_CREATE_LOCK 180
-#define PROV_R_FAILED_TO_DECRYPT 162
-#define PROV_R_FAILED_TO_GENERATE_KEY 121
-#define PROV_R_FAILED_TO_GET_PARAMETER 103
-#define PROV_R_FAILED_TO_SET_PARAMETER 104
-#define PROV_R_FAILED_TO_SIGN 175
-#define PROV_R_FINAL_CALL_OUT_OF_ORDER 237
-#define PROV_R_FIPS_MODULE_CONDITIONAL_ERROR 227
-#define PROV_R_FIPS_MODULE_ENTERING_ERROR_STATE 224
-#define PROV_R_FIPS_MODULE_IMPORT_PCT_ERROR 253
-#define PROV_R_FIPS_MODULE_IN_ERROR_STATE 225
-#define PROV_R_GENERATE_ERROR 191
-#define PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 165
-#define PROV_R_INDICATOR_INTEGRITY_FAILURE 210
-#define PROV_R_INIT_CALL_OUT_OF_ORDER 238
-#define PROV_R_INSUFFICIENT_DRBG_STRENGTH 181
-#define PROV_R_INVALID_AAD 108
-#define PROV_R_INVALID_AEAD 231
-#define PROV_R_INVALID_CONFIG_DATA 211
-#define PROV_R_INVALID_CONSTANT_LENGTH 157
-#define PROV_R_INVALID_CURVE 176
-#define PROV_R_INVALID_CUSTOM_LENGTH 111
-#define PROV_R_INVALID_DATA 115
-#define PROV_R_INVALID_DIGEST 122
-#define PROV_R_INVALID_DIGEST_LENGTH 166
-#define PROV_R_INVALID_DIGEST_SIZE 218
-#define PROV_R_INVALID_EDDSA_INSTANCE_FOR_ATTEMPTED_OPERATION 243
-#define PROV_R_INVALID_INPUT_LENGTH 230
-#define PROV_R_INVALID_ITERATION_COUNT 123
-#define PROV_R_INVALID_IV_LENGTH 109
-#define PROV_R_INVALID_KDF 232
-#define PROV_R_INVALID_KEY 158
-#define PROV_R_INVALID_KEY_LENGTH 105
-#define PROV_R_INVALID_MAC 151
-#define PROV_R_INVALID_MEMORY_SIZE 235
-#define PROV_R_INVALID_MGF1_MD 167
-#define PROV_R_INVALID_MODE 125
-#define PROV_R_INVALID_OUTPUT_LENGTH 217
-#define PROV_R_INVALID_PADDING_MODE 168
-#define PROV_R_INVALID_PREHASHED_DIGEST_LENGTH 241
-#define PROV_R_INVALID_PUBINFO 198
-#define PROV_R_INVALID_SALT_LENGTH 112
-#define PROV_R_INVALID_SEED_LENGTH 154
-#define PROV_R_INVALID_SIGNATURE_SIZE 179
-#define PROV_R_INVALID_STATE 212
-#define PROV_R_INVALID_TAG 110
-#define PROV_R_INVALID_TAG_LENGTH 118
-#define PROV_R_INVALID_THREAD_POOL_SIZE 234
-#define PROV_R_INVALID_UKM_LENGTH 200
-#define PROV_R_INVALID_X931_DIGEST 170
-#define PROV_R_IN_ERROR_STATE 192
-#define PROV_R_KEY_SETUP_FAILED 101
-#define PROV_R_KEY_SIZE_TOO_SMALL 171
-#define PROV_R_LENGTH_TOO_LARGE 202
-#define PROV_R_MISMATCHING_DOMAIN_PARAMETERS 203
-#define PROV_R_MISSING_CEK_ALG 144
-#define PROV_R_MISSING_CIPHER 155
-#define PROV_R_MISSING_CONFIG_DATA 213
-#define PROV_R_MISSING_CONSTANT 156
-#define PROV_R_MISSING_KEY 128
-#define PROV_R_MISSING_MAC 150
-#define PROV_R_MISSING_MESSAGE_DIGEST 129
-#define PROV_R_MISSING_OID 209
-#define PROV_R_MISSING_PASS 130
-#define PROV_R_MISSING_SALT 131
-#define PROV_R_MISSING_SECRET 132
-#define PROV_R_MISSING_SEED 140
-#define PROV_R_MISSING_SESSION_ID 133
-#define PROV_R_MISSING_TYPE 134
-#define PROV_R_MISSING_XCGHASH 135
-#define PROV_R_ML_DSA_NO_FORMAT 245
-#define PROV_R_ML_KEM_NO_FORMAT 246
-#define PROV_R_MODULE_INTEGRITY_FAILURE 214
-#define PROV_R_NOT_A_PRIVATE_KEY 221
-#define PROV_R_NOT_A_PUBLIC_KEY 220
-#define PROV_R_NOT_INSTANTIATED 193
-#define PROV_R_NOT_PARAMETERS 226
-#define PROV_R_NOT_SUPPORTED 136
-#define PROV_R_NOT_XOF_OR_INVALID_LENGTH 113
-#define PROV_R_NO_INSTANCE_ALLOWED 242
-#define PROV_R_NO_KEY_SET 114
-#define PROV_R_NO_PARAMETERS_SET 177
-#define PROV_R_NULL_LENGTH_POINTER 247
-#define PROV_R_NULL_OUTPUT_BUFFER 248
-#define PROV_R_ONESHOT_CALL_OUT_OF_ORDER 239
-#define PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 178
-#define PROV_R_OUTPUT_BUFFER_TOO_SMALL 106
-#define PROV_R_PARENT_CANNOT_GENERATE_RANDOM_NUMBERS 228
-#define PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED 187
-#define PROV_R_PARENT_LOCKING_NOT_ENABLED 182
-#define PROV_R_PARENT_STRENGTH_TOO_WEAK 194
-#define PROV_R_PATH_MUST_BE_ABSOLUTE 219
-#define PROV_R_PERSONALISATION_STRING_TOO_LONG 195
-#define PROV_R_PSS_SALTLEN_TOO_SMALL 172
-#define PROV_R_REQUEST_TOO_LARGE_FOR_DRBG 196
-#define PROV_R_REQUIRE_CTR_MODE_CIPHER 206
-#define PROV_R_RESEED_ERROR 197
-#define PROV_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES 222
-#define PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT 229
-#define PROV_R_SELF_TEST_KAT_FAILURE 215
-#define PROV_R_SELF_TEST_POST_FAILURE 216
-#define PROV_R_TAG_NOT_NEEDED 120
-#define PROV_R_TAG_NOT_SET 119
-#define PROV_R_TOO_MANY_RECORDS 126
-#define PROV_R_UNABLE_TO_FIND_CIPHERS 207
-#define PROV_R_UNABLE_TO_GET_PARENT_STRENGTH 199
-#define PROV_R_UNABLE_TO_GET_PASSPHRASE 159
-#define PROV_R_UNABLE_TO_INITIALISE_CIPHERS 208
-#define PROV_R_UNABLE_TO_LOAD_SHA256 147
-#define PROV_R_UNABLE_TO_LOCK_PARENT 201
-#define PROV_R_UNABLE_TO_RESEED 204
-#define PROV_R_UNEXPECTED_KEY_PARAMETERS 249
-#define PROV_R_UNSUPPORTED_CEK_ALG 145
-#define PROV_R_UNSUPPORTED_KEY_SIZE 153
-#define PROV_R_UNSUPPORTED_MAC_TYPE 137
-#define PROV_R_UNSUPPORTED_NUMBER_OF_ROUNDS 152
-#define PROV_R_UNSUPPORTED_SELECTION 250
-#define PROV_R_UPDATE_CALL_OUT_OF_ORDER 240
-#define PROV_R_URI_AUTHORITY_UNSUPPORTED 223
-#define PROV_R_VALUE_ERROR 138
-#define PROV_R_WRONG_CIPHERTEXT_SIZE 251
-#define PROV_R_WRONG_FINAL_BLOCK_LENGTH 107
-#define PROV_R_WRONG_OUTPUT_BUFFER_SIZE 139
-#define PROV_R_XOF_DIGESTS_NOT_ALLOWED 183
-#define PROV_R_XTS_DATA_UNIT_IS_TOO_LARGE 148
-#define PROV_R_XTS_DUPLICATED_KEYS 149
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/quic.h b/deps/openssl/openssl/include/openssl/quic.h
index 657969bc8ac..34b6fd7d375 100644
--- a/deps/openssl/openssl/include/openssl/quic.h
+++ b/deps/openssl/openssl/include/openssl/quic.h
@@ -67,6 +67,11 @@ __owur const SSL_METHOD *OSSL_QUIC_client_thread_method(void);
  */
 __owur const SSL_METHOD *OSSL_QUIC_server_method(void);

+/*
+ * Method used for QUIC client/server connection
+ */
+__owur const SSL_METHOD *OSSL_QUIC_method(void);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/deps/openssl/openssl/include/openssl/rand.h b/deps/openssl/openssl/include/openssl/rand.h
index 7272309fba7..72c17b60f1b 100644
--- a/deps/openssl/openssl/include/openssl/rand.h
+++ b/deps/openssl/openssl/include/openssl/rand.h
@@ -48,9 +48,6 @@ struct rand_meth_st {

 OSSL_DEPRECATEDIN_3_0 int RAND_set_rand_method(const RAND_METHOD *meth);
 OSSL_DEPRECATEDIN_3_0 const RAND_METHOD *RAND_get_rand_method(void);
-#ifndef OPENSSL_NO_ENGINE
-OSSL_DEPRECATEDIN_3_0 int RAND_set_rand_engine(ENGINE *engine);
-#endif

 OSSL_DEPRECATEDIN_3_0 RAND_METHOD *RAND_OpenSSL(void);
 #endif /* OPENSSL_NO_DEPRECATED_3_0 */
diff --git a/deps/openssl/openssl/include/openssl/randerr.h b/deps/openssl/openssl/include/openssl/randerr.h
deleted file mode 100644
index 6107cdd4816..00000000000
--- a/deps/openssl/openssl/include/openssl/randerr.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_RANDERR_H
-#define OPENSSL_RANDERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * RAND reason codes.
- */
-#define RAND_R_ADDITIONAL_INPUT_TOO_LONG 102
-#define RAND_R_ALREADY_INSTANTIATED 103
-#define RAND_R_ARGUMENT_OUT_OF_RANGE 105
-#define RAND_R_CANNOT_OPEN_FILE 121
-#define RAND_R_DRBG_ALREADY_INITIALIZED 129
-#define RAND_R_DRBG_NOT_INITIALISED 104
-#define RAND_R_ENTROPY_INPUT_TOO_LONG 106
-#define RAND_R_ENTROPY_OUT_OF_RANGE 124
-#define RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED 127
-#define RAND_R_ERROR_INITIALISING_DRBG 107
-#define RAND_R_ERROR_INSTANTIATING_DRBG 108
-#define RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT 109
-#define RAND_R_ERROR_RETRIEVING_ENTROPY 110
-#define RAND_R_ERROR_RETRIEVING_NONCE 111
-#define RAND_R_FAILED_TO_CREATE_LOCK 126
-#define RAND_R_FUNC_NOT_IMPLEMENTED 101
-#define RAND_R_FWRITE_ERROR 123
-#define RAND_R_GENERATE_ERROR 112
-#define RAND_R_INSUFFICIENT_DRBG_STRENGTH 139
-#define RAND_R_INTERNAL_ERROR 113
-#define RAND_R_INVALID_PROPERTY_QUERY 137
-#define RAND_R_IN_ERROR_STATE 114
-#define RAND_R_NOT_A_REGULAR_FILE 122
-#define RAND_R_NOT_INSTANTIATED 115
-#define RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED 128
-#define RAND_R_PARENT_LOCKING_NOT_ENABLED 130
-#define RAND_R_PARENT_STRENGTH_TOO_WEAK 131
-#define RAND_R_PERSONALISATION_STRING_TOO_LONG 116
-#define RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED 133
-#define RAND_R_PRNG_NOT_SEEDED 100
-#define RAND_R_RANDOM_POOL_IS_EMPTY 142
-#define RAND_R_RANDOM_POOL_OVERFLOW 125
-#define RAND_R_RANDOM_POOL_UNDERFLOW 134
-#define RAND_R_REQUEST_TOO_LARGE_FOR_DRBG 117
-#define RAND_R_RESEED_ERROR 118
-#define RAND_R_SELFTEST_FAILURE 119
-#define RAND_R_TOO_LITTLE_NONCE_REQUESTED 135
-#define RAND_R_TOO_MUCH_NONCE_REQUESTED 136
-#define RAND_R_UNABLE_TO_CREATE_DRBG 143
-#define RAND_R_UNABLE_TO_FETCH_DRBG 144
-#define RAND_R_UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER 141
-#define RAND_R_UNABLE_TO_GET_PARENT_STRENGTH 138
-#define RAND_R_UNABLE_TO_LOCK_PARENT 140
-#define RAND_R_UNSUPPORTED_DRBG_FLAGS 132
-#define RAND_R_UNSUPPORTED_DRBG_TYPE 120
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/rc5.h b/deps/openssl/openssl/include/openssl/rc5.h
index 2e91e985409..e13cf9c8d4c 100644
--- a/deps/openssl/openssl/include/openssl/rc5.h
+++ b/deps/openssl/openssl/include/openssl/rc5.h
@@ -30,7 +30,7 @@ extern "C" {
 #define RC5_ENCRYPT 1
 #define RC5_DECRYPT 0

-#define RC5_32_INT unsigned int
+typedef unsigned int RC5_32_INT;

 /*
  * This are the only values supported.  Tweak the code if you want more The
diff --git a/deps/openssl/openssl/include/openssl/ripemd.h b/deps/openssl/openssl/include/openssl/ripemd.h
index a72d1dad0a1..e0bab4d374b 100644
--- a/deps/openssl/openssl/include/openssl/ripemd.h
+++ b/deps/openssl/openssl/include/openssl/ripemd.h
@@ -29,7 +29,7 @@ extern "C" {
 #endif
 #if !defined(OPENSSL_NO_DEPRECATED_3_0)

-#define RIPEMD160_LONG unsigned int
+typedef unsigned int RIPEMD160_LONG;

 #define RIPEMD160_CBLOCK 64
 #define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK / 4)
diff --git a/deps/openssl/openssl/include/openssl/rsa.h b/deps/openssl/openssl/include/openssl/rsa.h
index 08335e0750b..d9ae71b3831 100644
--- a/deps/openssl/openssl/include/openssl/rsa.h
+++ b/deps/openssl/openssl/include/openssl/rsa.h
@@ -210,7 +210,7 @@ int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, unsigned char **label);

 #ifndef OPENSSL_NO_DEPRECATED_3_0
 OSSL_DEPRECATEDIN_3_0 RSA *RSA_new(void);
-OSSL_DEPRECATEDIN_3_0 RSA *RSA_new_method(ENGINE *engine);
+OSSL_DEPRECATEDIN_3_0 RSA *RSA_new_method(ENGINE *engine /* must be NULL */);
 OSSL_DEPRECATEDIN_3_0 int RSA_bits(const RSA *rsa);
 OSSL_DEPRECATEDIN_3_0 int RSA_size(const RSA *rsa);
 OSSL_DEPRECATEDIN_3_0 int RSA_security_bits(const RSA *rsa);
@@ -253,7 +253,6 @@ OSSL_DEPRECATEDIN_3_0 void RSA_clear_flags(RSA *r, int flags);
 OSSL_DEPRECATEDIN_3_0 int RSA_test_flags(const RSA *r, int flags);
 OSSL_DEPRECATEDIN_3_0 void RSA_set_flags(RSA *r, int flags);
 OSSL_DEPRECATEDIN_3_0 int RSA_get_version(RSA *r);
-OSSL_DEPRECATEDIN_3_0 ENGINE *RSA_get0_engine(const RSA *r);
 #endif /* !OPENSSL_NO_DEPRECATED_3_0 */

 #define EVP_RSA_gen(bits) \
diff --git a/deps/openssl/openssl/include/openssl/rsaerr.h b/deps/openssl/openssl/include/openssl/rsaerr.h
deleted file mode 100644
index 8432f5f6552..00000000000
--- a/deps/openssl/openssl/include/openssl/rsaerr.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_RSAERR_H
-#define OPENSSL_RSAERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * RSA reason codes.
- */
-#define RSA_R_ALGORITHM_MISMATCH 100
-#define RSA_R_BAD_E_VALUE 101
-#define RSA_R_BAD_FIXED_HEADER_DECRYPT 102
-#define RSA_R_BAD_PAD_BYTE_COUNT 103
-#define RSA_R_BAD_SIGNATURE 104
-#define RSA_R_BLOCK_TYPE_IS_NOT_01 106
-#define RSA_R_BLOCK_TYPE_IS_NOT_02 107
-#define RSA_R_DATA_GREATER_THAN_MOD_LEN 108
-#define RSA_R_DATA_TOO_LARGE 109
-#define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110
-#define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132
-#define RSA_R_DATA_TOO_SMALL 111
-#define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122
-#define RSA_R_DIGEST_DOES_NOT_MATCH 158
-#define RSA_R_DIGEST_NOT_ALLOWED 145
-#define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112
-#define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124
-#define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125
-#define RSA_R_D_E_NOT_CONGRUENT_TO_1 123
-#define RSA_R_FIRST_OCTET_INVALID 133
-#define RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 144
-#define RSA_R_INVALID_DIGEST 157
-#define RSA_R_INVALID_DIGEST_LENGTH 143
-#define RSA_R_INVALID_HEADER 137
-#define RSA_R_INVALID_KEYPAIR 171
-#define RSA_R_INVALID_KEY_LENGTH 173
-#define RSA_R_INVALID_LABEL 160
-#define RSA_R_INVALID_LENGTH 181
-#define RSA_R_INVALID_MESSAGE_LENGTH 131
-#define RSA_R_INVALID_MGF1_MD 156
-#define RSA_R_INVALID_MODULUS 174
-#define RSA_R_INVALID_MULTI_PRIME_KEY 167
-#define RSA_R_INVALID_OAEP_PARAMETERS 161
-#define RSA_R_INVALID_PADDING 138
-#define RSA_R_INVALID_PADDING_MODE 141
-#define RSA_R_INVALID_PSS_PARAMETERS 149
-#define RSA_R_INVALID_PSS_SALTLEN 146
-#define RSA_R_INVALID_REQUEST 175
-#define RSA_R_INVALID_SALT_LENGTH 150
-#define RSA_R_INVALID_STRENGTH 176
-#define RSA_R_INVALID_TRAILER 139
-#define RSA_R_INVALID_X931_DIGEST 142
-#define RSA_R_IQMP_NOT_INVERSE_OF_Q 126
-#define RSA_R_KEY_PRIME_NUM_INVALID 165
-#define RSA_R_KEY_SIZE_TOO_SMALL 120
-#define RSA_R_LAST_OCTET_INVALID 134
-#define RSA_R_MGF1_DIGEST_NOT_ALLOWED 152
-#define RSA_R_MISSING_PRIVATE_KEY 179
-#define RSA_R_MODULUS_TOO_LARGE 105
-#define RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R 168
-#define RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D 169
-#define RSA_R_MP_R_NOT_PRIME 170
-#define RSA_R_NO_PUBLIC_EXPONENT 140
-#define RSA_R_NULL_BEFORE_BLOCK_MISSING 113
-#define RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES 172
-#define RSA_R_N_DOES_NOT_EQUAL_P_Q 127
-#define RSA_R_OAEP_DECODING_ERROR 121
-#define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148
-#define RSA_R_PADDING_CHECK_FAILED 114
-#define RSA_R_PAIRWISE_TEST_FAILURE 177
-#define RSA_R_PKCS_DECODING_ERROR 159
-#define RSA_R_PSS_SALTLEN_TOO_SMALL 164
-#define RSA_R_PUB_EXPONENT_OUT_OF_RANGE 178
-#define RSA_R_P_NOT_PRIME 128
-#define RSA_R_Q_NOT_PRIME 129
-#define RSA_R_RANDOMNESS_SOURCE_STRENGTH_INSUFFICIENT 180
-#define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130
-#define RSA_R_SLEN_CHECK_FAILED 136
-#define RSA_R_SLEN_RECOVERY_FAILED 135
-#define RSA_R_SSLV3_ROLLBACK_ATTACK 115
-#define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116
-#define RSA_R_UNKNOWN_ALGORITHM_TYPE 117
-#define RSA_R_UNKNOWN_DIGEST 166
-#define RSA_R_UNKNOWN_MASK_DIGEST 151
-#define RSA_R_UNKNOWN_PADDING_TYPE 118
-#define RSA_R_UNSUPPORTED_ENCRYPTION_TYPE 162
-#define RSA_R_UNSUPPORTED_LABEL_SOURCE 163
-#define RSA_R_UNSUPPORTED_MASK_ALGORITHM 153
-#define RSA_R_UNSUPPORTED_MASK_PARAMETER 154
-#define RSA_R_UNSUPPORTED_SIGNATURE_TYPE 155
-#define RSA_R_VALUE_MISSING 147
-#define RSA_R_WRONG_SIGNATURE_LENGTH 119
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/safestack.h b/deps/openssl/openssl/include/openssl/safestack.h
deleted file mode 100644
index 989eafb3302..00000000000
--- a/deps/openssl/openssl/include/openssl/safestack.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/safestack.h"
diff --git a/deps/openssl/openssl/include/openssl/safestack.h.in b/deps/openssl/openssl/include/openssl/safestack.h.in
index a88409ba415..64ac28be049 100644
--- a/deps/openssl/openssl/include/openssl/safestack.h.in
+++ b/deps/openssl/openssl/include/openssl/safestack.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -36,34 +36,52 @@ extern "C" {
 #define STACK_OF(type) struct stack_st_##type

 /* Helper macro for internal use */
-#define SKM_DEFINE_STACK_OF_INTERNAL(t1, t2, t3)                                                                \
-    STACK_OF(t1);                                                                                               \
-    typedef int (*sk_##t1##_compfunc)(const t3 *const *a, const t3 *const *b);                                  \
-    typedef void (*sk_##t1##_freefunc)(t3 * a);                                                                 \
-    typedef t3 *(*sk_##t1##_copyfunc)(const t3 *a);                                                             \
-    static ossl_unused ossl_inline t2 *ossl_check_##t1##_type(t2 *ptr)                                          \
-    {                                                                                                           \
-        return ptr;                                                                                             \
-    }                                                                                                           \
-    static ossl_unused ossl_inline const OPENSSL_STACK *ossl_check_const_##t1##_sk_type(const STACK_OF(t1) *sk) \
-    {                                                                                                           \
-        return (const OPENSSL_STACK *)sk;                                                                       \
-    }                                                                                                           \
-    static ossl_unused ossl_inline OPENSSL_STACK *ossl_check_##t1##_sk_type(STACK_OF(t1) *sk)                   \
-    {                                                                                                           \
-        return (OPENSSL_STACK *)sk;                                                                             \
-    }                                                                                                           \
-    static ossl_unused ossl_inline OPENSSL_sk_compfunc ossl_check_##t1##_compfunc_type(sk_##t1##_compfunc cmp)  \
-    {                                                                                                           \
-        return (OPENSSL_sk_compfunc)cmp;                                                                        \
-    }                                                                                                           \
-    static ossl_unused ossl_inline OPENSSL_sk_copyfunc ossl_check_##t1##_copyfunc_type(sk_##t1##_copyfunc cpy)  \
-    {                                                                                                           \
-        return (OPENSSL_sk_copyfunc)cpy;                                                                        \
-    }                                                                                                           \
-    static ossl_unused ossl_inline OPENSSL_sk_freefunc ossl_check_##t1##_freefunc_type(sk_##t1##_freefunc fr)   \
-    {                                                                                                           \
-        return (OPENSSL_sk_freefunc)fr;                                                                         \
+#define SKM_DEFINE_STACK_OF_INTERNAL(t1, t2, t3)                                                                         \
+    STACK_OF(t1);                                                                                                        \
+    typedef int (*sk_##t1##_compfunc)(const t3 *const *a, const t3 *const *b);                                           \
+    typedef void (*sk_##t1##_freefunc)(t3 * a);                                                                          \
+    typedef t3 *(*sk_##t1##_copyfunc)(const t3 *a);                                                                      \
+    static ossl_inline void sk_##t1##_freefunc_thunk(OPENSSL_sk_freefunc freefunc_arg, void *ptr)                        \
+    {                                                                                                                    \
+        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                  \
+        freefunc((t3 *)ptr);                                                                                             \
+    }                                                                                                                    \
+    static ossl_inline void *sk_##t1##_copyfunc_thunk(OPENSSL_sk_copyfunc copyfunc_arg, const void *ptr)                 \
+    {                                                                                                                    \
+        sk_##t1##_copyfunc copyfunc = (sk_##t1##_copyfunc)copyfunc_arg;                                                  \
+        return (void *)copyfunc((const t3 *)ptr);                                                                        \
+    }                                                                                                                    \
+    static ossl_inline int sk_##t1##_cmpfunc_thunk(int (*cmp)(const void *, const void *), const void *a, const void *b) \
+    {                                                                                                                    \
+        int (*realcmp)(const t3 *const *a, const t3 *const *b) = (int (*)(const t3 *const *a, const t3 *const *b))(cmp); \
+        const t3 *const *at = (const t3 *const *)a;                                                                      \
+        const t3 *const *bt = (const t3 *const *)b;                                                                      \
+                                                                                                                         \
+        return realcmp(at, bt);                                                                                          \
+    }                                                                                                                    \
+    static ossl_unused ossl_inline t2 *ossl_check_##t1##_type(t2 *ptr)                                                   \
+    {                                                                                                                    \
+        return ptr;                                                                                                      \
+    }                                                                                                                    \
+    static ossl_unused ossl_inline const OPENSSL_STACK *ossl_check_const_##t1##_sk_type(const STACK_OF(t1) *sk)          \
+    {                                                                                                                    \
+        return (const OPENSSL_STACK *)sk;                                                                                \
+    }                                                                                                                    \
+    static ossl_unused ossl_inline OPENSSL_STACK *ossl_check_##t1##_sk_type(STACK_OF(t1) *sk)                            \
+    {                                                                                                                    \
+        return (OPENSSL_STACK *)sk;                                                                                      \
+    }                                                                                                                    \
+    static ossl_unused ossl_inline OPENSSL_sk_compfunc ossl_check_##t1##_compfunc_type(sk_##t1##_compfunc cmp)           \
+    {                                                                                                                    \
+        return (OPENSSL_sk_compfunc)cmp;                                                                                 \
+    }                                                                                                                    \
+    static ossl_unused ossl_inline OPENSSL_sk_copyfunc ossl_check_##t1##_copyfunc_type(sk_##t1##_copyfunc cpy)           \
+    {                                                                                                                    \
+        return (OPENSSL_sk_copyfunc)cpy;                                                                                 \
+    }                                                                                                                    \
+    static ossl_unused ossl_inline OPENSSL_sk_freefunc ossl_check_##t1##_freefunc_type(sk_##t1##_freefunc fr)            \
+    {                                                                                                                    \
+        return (OPENSSL_sk_freefunc)fr;                                                                                  \
     }

 #define SKM_DEFINE_STACK_OF(t1, t2, t3)                                                                                    \
@@ -71,6 +89,24 @@ extern "C" {
     typedef int (*sk_##t1##_compfunc)(const t3 *const *a, const t3 *const *b);                                             \
     typedef void (*sk_##t1##_freefunc)(t3 * a);                                                                            \
     typedef t3 *(*sk_##t1##_copyfunc)(const t3 *a);                                                                        \
+    static ossl_inline void sk_##t1##_freefunc_thunk(OPENSSL_sk_freefunc freefunc_arg, void *ptr)                          \
+    {                                                                                                                      \
+        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                    \
+        freefunc((t3 *)ptr);                                                                                               \
+    }                                                                                                                      \
+    static ossl_inline void *sk_##t1##_copyfunc_thunk(OPENSSL_sk_copyfunc copyfunc_arg, const void *ptr)                   \
+    {                                                                                                                      \
+        sk_##t1##_copyfunc copyfunc = (sk_##t1##_copyfunc)copyfunc_arg;                                                    \
+        return (void *)copyfunc((const t3 *)ptr);                                                                          \
+    }                                                                                                                      \
+    static ossl_inline int sk_##t1##_cmpfunc_thunk(int (*cmp)(const void *, const void *), const void *a, const void *b)   \
+    {                                                                                                                      \
+        int (*realcmp)(const t3 *const *a, const t3 *const *b) = (int (*)(const t3 *const *a, const t3 *const *b))(cmp);   \
+        const t3 *const *at = (const t3 *const *)a;                                                                        \
+        const t3 *const *bt = (const t3 *const *)b;                                                                        \
+                                                                                                                           \
+        return realcmp(at, bt);                                                                                            \
+    }                                                                                                                      \
     static ossl_unused ossl_inline int sk_##t1##_num(const STACK_OF(t1) *sk)                                               \
     {                                                                                                                      \
         return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
@@ -81,15 +117,33 @@ extern "C" {
     }                                                                                                                      \
     static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new(sk_##t1##_compfunc compare)                                 \
     {                                                                                                                      \
-        return (STACK_OF(t1) *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare);                                               \
+        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare);                                                 \
+        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
+                                                                                                                           \
+        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
+        OPENSSL_sk_set_cmp_thunks(ret, sk_##t1##_cmpfunc_thunk);                                                           \
+        OPENSSL_sk_set_copy_thunks(ret, sk_##t1##_copyfunc_thunk);                                                         \
+        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
     }                                                                                                                      \
     static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_null(void)                                                  \
     {                                                                                                                      \
-        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
+        OPENSSL_STACK *ret = OPENSSL_sk_new_null();                                                                        \
+        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
+                                                                                                                           \
+        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
+        OPENSSL_sk_set_cmp_thunks(ret, sk_##t1##_cmpfunc_thunk);                                                           \
+        OPENSSL_sk_set_copy_thunks(ret, sk_##t1##_copyfunc_thunk);                                                         \
+        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
     }                                                                                                                      \
     static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_reserve(sk_##t1##_compfunc compare, int n)                  \
     {                                                                                                                      \
-        return (STACK_OF(t1) *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n);                                    \
+        OPENSSL_STACK *ret = OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n);                                      \
+        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
+                                                                                                                           \
+        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
+        OPENSSL_sk_set_cmp_thunks(ret, sk_##t1##_cmpfunc_thunk);                                                           \
+        OPENSSL_sk_set_copy_thunks(ret, sk_##t1##_copyfunc_thunk);                                                         \
+        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
     }                                                                                                                      \
     static ossl_unused ossl_inline int sk_##t1##_reserve(STACK_OF(t1) *sk, int n)                                          \
     {                                                                                                                      \
@@ -130,6 +184,11 @@ extern "C" {
     }                                                                                                                      \
     static ossl_unused ossl_inline void sk_##t1##_pop_free(STACK_OF(t1) *sk, sk_##t1##_freefunc freefunc)                  \
     {                                                                                                                      \
+        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
+                                                                                                                           \
+        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
+        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
+                                                                                                                           \
         OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
     }                                                                                                                      \
     static ossl_unused ossl_inline int sk_##t1##_insert(STACK_OF(t1) *sk, t2 *ptr, int idx)                                \
@@ -140,17 +199,18 @@ extern "C" {
     {                                                                                                                      \
         return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr);                                          \
     }                                                                                                                      \
-    static ossl_unused ossl_inline int sk_##t1##_find(STACK_OF(t1) *sk, t2 *ptr)                                           \
+    static ossl_unused ossl_inline int sk_##t1##_find(const STACK_OF(t1) *sk, t2 *ptr)                                     \
     {                                                                                                                      \
-        return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
+        return OPENSSL_sk_find((const OPENSSL_STACK *)sk, (const void *)ptr);                                              \
     }                                                                                                                      \
-    static ossl_unused ossl_inline int sk_##t1##_find_ex(STACK_OF(t1) *sk, t2 *ptr)                                        \
+    static ossl_unused ossl_inline int sk_##t1##_find_ex(const STACK_OF(t1) *sk, t2 *ptr)                                  \
     {                                                                                                                      \
-        return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr);                                                 \
+        return OPENSSL_sk_find_ex((const OPENSSL_STACK *)sk, (const void *)ptr);                                           \
     }                                                                                                                      \
-    static ossl_unused ossl_inline int sk_##t1##_find_all(STACK_OF(t1) *sk, t2 *ptr, int *pnum)                            \
+    static ossl_unused ossl_inline int sk_##t1##_find_all(const STACK_OF(t1) *sk, t2 *ptr,                                 \
+        int *pnum)                                                                                                         \
     {                                                                                                                      \
-        return OPENSSL_sk_find_all((OPENSSL_STACK *)sk, (const void *)ptr, pnum);                                          \
+        return OPENSSL_sk_find_all((const OPENSSL_STACK *)sk, (const void *)ptr, pnum);                                    \
     }                                                                                                                      \
     static ossl_unused ossl_inline void sk_##t1##_sort(STACK_OF(t1) *sk)                                                   \
     {                                                                                                                      \
@@ -162,15 +222,27 @@ extern "C" {
     }                                                                                                                      \
     static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_dup(const STACK_OF(t1) *sk)                                     \
     {                                                                                                                      \
-        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk);                                                  \
+        OPENSSL_STACK *ret = OPENSSL_sk_dup((const OPENSSL_STACK *)sk);                                                    \
+        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
+                                                                                                                           \
+        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
+        OPENSSL_sk_set_cmp_thunks(ret, sk_##t1##_cmpfunc_thunk);                                                           \
+        OPENSSL_sk_set_copy_thunks(ret, sk_##t1##_copyfunc_thunk);                                                         \
+        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
     }                                                                                                                      \
     static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_deep_copy(const STACK_OF(t1) *sk,                               \
         sk_##t1##_copyfunc copyfunc,                                                                                       \
         sk_##t1##_freefunc freefunc)                                                                                       \
     {                                                                                                                      \
-        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk,                                             \
+        OPENSSL_STACK *ret = OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk,                                               \
             (OPENSSL_sk_copyfunc)copyfunc,                                                                                 \
             (OPENSSL_sk_freefunc)freefunc);                                                                                \
+        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
+                                                                                                                           \
+        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
+        OPENSSL_sk_set_cmp_thunks(ret, sk_##t1##_cmpfunc_thunk);                                                           \
+        OPENSSL_sk_set_copy_thunks(ret, sk_##t1##_copyfunc_thunk);                                                         \
+        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
     }                                                                                                                      \
     static ossl_unused ossl_inline sk_##t1##_compfunc sk_##t1##_set_cmp_func(STACK_OF(t1) *sk, sk_##t1##_compfunc compare) \
     {                                                                                                                      \
diff --git a/deps/openssl/openssl/include/openssl/self_test.h b/deps/openssl/openssl/include/openssl/self_test.h
index de736794a99..02c8f9ba1db 100644
--- a/deps/openssl/openssl/include/openssl/self_test.h
+++ b/deps/openssl/openssl/include/openssl/self_test.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -38,6 +38,7 @@ extern "C" {
 #define OSSL_SELF_TEST_TYPE_KAT_ASYM_KEYGEN "KAT_AsymmetricKeyGeneration"
 #define OSSL_SELF_TEST_TYPE_KAT_KEM "KAT_KEM"
 #define OSSL_SELF_TEST_TYPE_KAT_DIGEST "KAT_Digest"
+#define OSSL_SELF_TEST_TYPE_KAT_MAC "KAT_Mac"
 #define OSSL_SELF_TEST_TYPE_KAT_SIGNATURE "KAT_Signature"
 #define OSSL_SELF_TEST_TYPE_PCT_SIGNATURE "PCT_Signature"
 #define OSSL_SELF_TEST_TYPE_KAT_KDF "KAT_KDF"
@@ -67,7 +68,9 @@ extern "C" {
 #define OSSL_SELF_TEST_DESC_SIGN_DSA "DSA"
 #define OSSL_SELF_TEST_DESC_SIGN_RSA "RSA"
 #define OSSL_SELF_TEST_DESC_SIGN_ECDSA "ECDSA"
+#define OSSL_SELF_TEST_DESC_SIGN_DetECDSA "DetECDSA"
 #define OSSL_SELF_TEST_DESC_SIGN_EDDSA "EDDSA"
+#define OSSL_SELF_TEST_DESC_SIGN_LMS "LMS"
 #define OSSL_SELF_TEST_DESC_SIGN_ML_DSA "ML-DSA"
 #define OSSL_SELF_TEST_DESC_SIGN_SLH_DSA "SLH-DSA"
 #define OSSL_SELF_TEST_DESC_KEM "KEM"
@@ -77,10 +80,17 @@ extern "C" {
 #define OSSL_SELF_TEST_DESC_KA_DH "DH"
 #define OSSL_SELF_TEST_DESC_KA_ECDH "ECDH"
 #define OSSL_SELF_TEST_DESC_KDF_HKDF "HKDF"
+#define OSSL_SELF_TEST_DESC_KDF_IKEV2KDF_GEN "IKEV2KDF_GEN"
+#define OSSL_SELF_TEST_DESC_KDF_IKEV2KDF_DKM1 "IKEV2KDF_DKM"
+#define OSSL_SELF_TEST_DESC_KDF_IKEV2KDF_DKM2 "IKEV2KDF_DKM(Child_SA)"
+#define OSSL_SELF_TEST_DESC_KDF_IKEV2KDF_DKM3 "IKEV2KDF_DKM(Child_DH)"
+#define OSSL_SELF_TEST_DESC_KDF_IKEV2KDF_REKEY "IKEV2KDF_REKEY"
 #define OSSL_SELF_TEST_DESC_KDF_SSKDF "SSKDF"
 #define OSSL_SELF_TEST_DESC_KDF_X963KDF "X963KDF"
 #define OSSL_SELF_TEST_DESC_KDF_X942KDF "X942KDF"
 #define OSSL_SELF_TEST_DESC_KDF_PBKDF2 "PBKDF2"
+#define OSSL_SELF_TEST_DESC_KDF_SNMPKDF "SNMPKDF"
+#define OSSL_SELF_TEST_DESC_KDF_SRTPKDF "SRTPKDF"
 #define OSSL_SELF_TEST_DESC_KDF_SSHKDF "SSHKDF"
 #define OSSL_SELF_TEST_DESC_KDF_TLS12_PRF "TLS12_PRF"
 #define OSSL_SELF_TEST_DESC_KDF_KBKDF "KBKDF"
diff --git a/deps/openssl/openssl/include/openssl/sha.h b/deps/openssl/openssl/include/openssl/sha.h
index 52b02661f62..fec107d13f3 100644
--- a/deps/openssl/openssl/include/openssl/sha.h
+++ b/deps/openssl/openssl/include/openssl/sha.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -31,7 +31,7 @@ extern "C" {
  * ! SHA_LONG has to be at least 32 bits wide.                    !
  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  */
-#define SHA_LONG unsigned int
+typedef unsigned int SHA_LONG;

 #define SHA_LBLOCK 16
 #define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
@@ -60,10 +60,11 @@ unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
                                         * big-endian values. */

 typedef struct SHA256state_st {
-    SHA_LONG h[8];
-    SHA_LONG Nl, Nh;
-    SHA_LONG data[SHA_LBLOCK];
-    unsigned int num, md_len;
+    SHA_LONG h[8]; /* Hash values (32 bytes) */
+    SHA_LONG Nl, Nh; /* The length of the message in bits is stored into 64 bits */
+    SHA_LONG data[SHA_LBLOCK]; /* Buffer used to store input less than 512 bits */
+    unsigned int num; /* The size of the partial buffered input in data[] */
+    unsigned int md_len; /* The output size (used for truncation) */
 } SHA256_CTX;

 OSSL_DEPRECATEDIN_3_0 int SHA224_Init(SHA256_CTX *c);
@@ -100,11 +101,11 @@ unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md);
  */
 #define SHA512_CBLOCK (SHA_LBLOCK * 8)
 #if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
-#define SHA_LONG64 unsigned __int64
+typedef unsigned __int64 SHA_LONG64;
 #elif defined(__arch64__)
-#define SHA_LONG64 unsigned long
+typedef unsigned long SHA_LONG64;
 #else
-#define SHA_LONG64 unsigned long long
+typedef unsigned long long SHA_LONG64;
 #endif

 typedef struct SHA512state_st {
diff --git a/deps/openssl/openssl/include/openssl/srp.h b/deps/openssl/openssl/include/openssl/srp.h
deleted file mode 100644
index 9df42dad4c3..00000000000
--- a/deps/openssl/openssl/include/openssl/srp.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/srp.h"
diff --git a/deps/openssl/openssl/include/openssl/ssl.h b/deps/openssl/openssl/include/openssl/ssl.h
deleted file mode 100644
index eb74ca98a97..00000000000
--- a/deps/openssl/openssl/include/openssl/ssl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/ssl.h"
diff --git a/deps/openssl/openssl/include/openssl/ssl.h.in b/deps/openssl/openssl/include/openssl/ssl.h.in
index 90be33cb4f1..bdf5d201c95 100644
--- a/deps/openssl/openssl/include/openssl/ssl.h.in
+++ b/deps/openssl/openssl/include/openssl/ssl.h.in
@@ -46,6 +46,9 @@ use OpenSSL::stackhash qw(generate_stack_macros generate_const_stack_macros);
 #include <openssl/ct.h>
 #include <openssl/sslerr.h>
 #include <openssl/prov_ssl.h>
+#ifndef OPENSSL_NO_ECH
+#include <openssl/ech.h>
+#endif
 #ifndef OPENSSL_NO_STDIO
 #include <stdio.h>
 #endif
@@ -78,7 +81,6 @@ extern "C" {
 #define SSL_TXT_LOW "LOW"
 #define SSL_TXT_MEDIUM "MEDIUM"
 #define SSL_TXT_HIGH "HIGH"
-#define SSL_TXT_FIPS "FIPS"

 #define SSL_TXT_aNULL "aNULL"
 #define SSL_TXT_eNULL "eNULL"
@@ -163,7 +165,6 @@ extern "C" {
 #define SSL_TXT_SHA256 "SHA256"
 #define SSL_TXT_SHA384 "SHA384"

-#define SSL_TXT_SSLV3 "SSLv3"
 #define SSL_TXT_TLSV1 "TLSv1"
 #define SSL_TXT_TLSV1_1 "TLSv1.1"
 #define SSL_TXT_TLSV1_2 "TLSv1.2"
@@ -337,7 +338,7 @@ typedef int (*SSL_async_callback_fn)(SSL *s, void *arg);
 #define SSL_OP_LEGACY_SERVER_CONNECT SSL_OP_BIT(2)
 /* Enable support for Kernel TLS */
 #define SSL_OP_ENABLE_KTLS SSL_OP_BIT(3)
-#define SSL_OP_TLSEXT_PADDING SSL_OP_BIT(4)
+/* SSL_OP_BIT(4) was SSL_OP_TLSEXT_PADDING, now a no-op */
 #define SSL_OP_SAFARI_ECDHE_ECDSA_BUG SSL_OP_BIT(6)
 #define SSL_OP_IGNORE_UNEXPECTED_EOF SSL_OP_BIT(7)
 #define SSL_OP_ALLOW_CLIENT_RENEGOTIATION SSL_OP_BIT(8)
@@ -345,7 +346,7 @@ typedef int (*SSL_async_callback_fn)(SSL *s, void *arg);
 /* In TLSv1.3 allow a non-(ec)dhe based kex_mode */
 #define SSL_OP_ALLOW_NO_DHE_KEX SSL_OP_BIT(10)
 /*
- * Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added
+ * Disable TLS 1.0 CBC vulnerability workaround that was added
  * in OpenSSL 0.9.6d.  Usually (depending on the application protocol)
  * the workaround is not needed.  Unfortunately some broken SSL/TLS
  * implementations cannot handle it at all, which is why we include it
@@ -380,13 +381,16 @@ typedef int (*SSL_async_callback_fn)(SSL *s, void *arg);
 #define SSL_OP_ENABLE_MIDDLEBOX_COMPAT SSL_OP_BIT(20)
 /*
  * Prioritize Chacha20Poly1305 when client does.
- * Modifies SSL_OP_CIPHER_SERVER_PREFERENCE
+ * Modifies SSL_OP_SERVER_PREFERENCE
  */
 #define SSL_OP_PRIORITIZE_CHACHA SSL_OP_BIT(21)
 /*
- * Set on servers to choose the cipher according to server's preferences.
+ * Set on servers to choose cipher, curve or group according to server's
+ * preferences.
  */
-#define SSL_OP_CIPHER_SERVER_PREFERENCE SSL_OP_BIT(22)
+#define SSL_OP_SERVER_PREFERENCE SSL_OP_BIT(22)
+/* Equivalent definition for backwards compatibility: */
+#define SSL_OP_CIPHER_SERVER_PREFERENCE SSL_OP_SERVER_PREFERENCE
 /*
  * If set, a server will allow a client to issue an SSLv3.0 version
  * number as latest version supported in the premaster secret, even when
@@ -406,6 +410,7 @@ typedef int (*SSL_async_callback_fn)(SSL *s, void *arg);
 #define SSL_OP_NO_TLSv1_3 SSL_OP_BIT(29)
 #define SSL_OP_NO_DTLSv1 SSL_OP_BIT(26)
 #define SSL_OP_NO_DTLSv1_2 SSL_OP_BIT(27)
+#define SSL_OP_NO_DTLSv1_3 SSL_OP_BIT(29)
 /* Disallow all renegotiation */
 #define SSL_OP_NO_RENEGOTIATION SSL_OP_BIT(30)
 /*
@@ -425,8 +430,32 @@ typedef int (*SSL_async_callback_fn)(SSL *s, void *arg);
 #define SSL_OP_NO_RX_CERTIFICATE_COMPRESSION SSL_OP_BIT(33)
 /* Enable KTLS TX zerocopy on Linux */
 #define SSL_OP_ENABLE_KTLS_TX_ZEROCOPY_SENDFILE SSL_OP_BIT(34)
-
 #define SSL_OP_PREFER_NO_DHE_KEX SSL_OP_BIT(35)
+#define SSL_OP_LEGACY_EC_POINT_FORMATS SSL_OP_BIT(36)
+
+#ifndef OPENSSL_NO_ECH
+/* Set this to tell client to emit greased ECH values */
+#define SSL_OP_ECH_GREASE SSL_OP_BIT(37)
+/*
+ * If this is set then the server side will attempt trial decryption
+ * of ECHs even if there is no matching ECH config_id. That's a bit
+ * inefficient, but more privacy friendly.
+ */
+#define SSL_OP_ECH_TRIALDECRYPT SSL_OP_BIT(38)
+/*
+ * If set, clients will ignore the supplied ECH config_id and replace
+ * that with a random value.
+ */
+#define SSL_OP_ECH_IGNORE_CID SSL_OP_BIT(39)
+/*
+ * If set, servers will add GREASEy ECHConfig values to those sent
+ * in retry_configs.
+ */
+#define SSL_OP_ECH_GREASE_RETRY_CONFIG SSL_OP_BIT(40)
+#endif
+
+/* RFC 8701: Send GREASE values in ClientHello */
+#define SSL_OP_GREASE SSL_OP_BIT(41)

 /*
  * Option "collections."
@@ -440,7 +469,7 @@ typedef int (*SSL_async_callback_fn)(SSL *s, void *arg);
 /* Various bug workarounds that should be rather harmless. */
 #define SSL_OP_ALL                                                    \
     (SSL_OP_CRYPTOPRO_TLSEXT_BUG | SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS \
-        | SSL_OP_TLSEXT_PADDING | SSL_OP_SAFARI_ECDHE_ECDSA_BUG)
+        | SSL_OP_SAFARI_ECDHE_ECDSA_BUG)

 /*
  * OBSOLETE OPTIONS retained for compatibility
@@ -463,6 +492,7 @@ typedef int (*SSL_async_callback_fn)(SSL *s, void *arg);
 #define SSL_OP_PKCS1_CHECK_2 0x0
 #define SSL_OP_NETSCAPE_CA_DN_BUG 0x0
 #define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0
+#define SSL_OP_TLSEXT_PADDING 0x0

 /*
  * Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success
@@ -750,9 +780,6 @@ void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx,
         EVP_PKEY **pkey));
 int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))(SSL *ssl, X509 **x509,
     EVP_PKEY **pkey);
-#ifndef OPENSSL_NO_ENGINE
-__owur int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e);
-#endif
 void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx,
     int (*app_gen_cookie_cb)(SSL *ssl,
         unsigned char
@@ -803,7 +830,7 @@ void SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data,
 #endif

 __owur int SSL_select_next_proto(unsigned char **out, unsigned char *outlen,
-    const unsigned char *in, unsigned int inlen,
+    const unsigned char *server, unsigned int server_len,
     const unsigned char *client,
     unsigned int client_len);

@@ -826,6 +853,10 @@ void SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx,
     void *arg);
 void SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data,
     unsigned int *len);
+void SSL_CTX_get0_alpn_protos(SSL_CTX *ctx, const unsigned char **protos,
+    unsigned int *protos_len);
+void SSL_get0_alpn_protos(SSL *ssl, const unsigned char **protos,
+    unsigned int *protos_len);

 #ifndef OPENSSL_NO_PSK
 /*
@@ -1066,7 +1097,11 @@ typedef enum {
     TLS_ST_EARLY_DATA,
     TLS_ST_PENDING_EARLY_DATA_END,
     TLS_ST_CW_END_OF_EARLY_DATA,
-    TLS_ST_SR_END_OF_EARLY_DATA
+    TLS_ST_SR_END_OF_EARLY_DATA,
+    TLS_ST_CR_ACK,
+    TLS_ST_CW_ACK,
+    TLS_ST_SR_ACK,
+    TLS_ST_SW_ACK
 } OSSL_HANDSHAKE_STATE;

 /*
@@ -1195,6 +1230,9 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
 #define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION
 #define SSL_AD_MISSING_EXTENSION TLS13_AD_MISSING_EXTENSION
 #define SSL_AD_CERTIFICATE_REQUIRED TLS13_AD_CERTIFICATE_REQUIRED
+#ifndef OPENSSL_NO_ECH
+#define SSL_AD_ECH_REQUIRED TLS1_AD_ECH_REQUIRED
+#endif
 #define SSL_AD_UNSUPPORTED_EXTENSION TLS1_AD_UNSUPPORTED_EXTENSION
 #define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE
 #define SSL_AD_UNRECOGNIZED_NAME TLS1_AD_UNRECOGNIZED_NAME
@@ -1343,6 +1381,8 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
 #define SSL_CTRL_GET0_IMPLEMENTED_GROUPS 139
 #define SSL_CTRL_GET_SIGNATURE_NAME 140
 #define SSL_CTRL_GET_PEER_SIGNATURE_NAME 141
+#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP_EX 142
+#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP_EX 143
 #define SSL_CERT_SET_FIRST 1
 #define SSL_CERT_SET_NEXT 2
 #define SSL_CERT_SET_SERVER 3
@@ -1829,6 +1869,9 @@ int SSL_up_ref(SSL *s);
 int SSL_is_dtls(const SSL *s);
 int SSL_is_tls(const SSL *s);
 int SSL_is_quic(const SSL *s);
+int SSL_CTX_is_quic(const SSL_CTX *c);
+int SSL_CTX_is_server(const SSL_CTX *c);
+
 __owur int SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx,
     unsigned int sid_ctx_len);

@@ -1837,8 +1880,14 @@ __owur int SSL_set_purpose(SSL *ssl, int purpose);
 __owur int SSL_CTX_set_trust(SSL_CTX *ctx, int trust);
 __owur int SSL_set_trust(SSL *ssl, int trust);

-__owur int SSL_set1_host(SSL *s, const char *host);
-__owur int SSL_add1_host(SSL *s, const char *host);
+#ifndef OPENSSL_NO_DEPRECATED_4_0
+OSSL_DEPRECATEDIN_4_0 __owur int SSL_set1_host(SSL *s, const char *host);
+OSSL_DEPRECATEDIN_4_0 __owur int SSL_add1_host(SSL *s, const char *host);
+#endif /* OPENSSL_NO_DEPRECATED_4_0 */
+__owur int SSL_set1_dnsname(SSL *s, const char *dnsname);
+__owur int SSL_add1_dnsname(SSL *s, const char *dnsname);
+__owur int SSL_set1_ipaddr(SSL *s, const char *ipaddr);
+__owur int SSL_add1_ipaddr(SSL *s, const char *ipaddr);
 __owur const char *SSL_get0_peername(SSL *s);
 void SSL_set_hostflags(SSL *s, unsigned int flags);

@@ -1918,7 +1967,9 @@ typedef int (*SSL_new_pending_conn_cb_fn)(SSL_CTX *ctx, SSL *new_ssl,
 void SSL_CTX_set_new_pending_conn_cb(SSL_CTX *c, SSL_new_pending_conn_cb_fn cb,
     void *arg);

-int SSL_client_hello_isv2(SSL *s);
+#ifndef OPENSSL_NO_DEPRECATED_4_0
+OSSL_DEPRECATEDIN_4_0 int SSL_client_hello_isv2(SSL *s);
+#endif
 unsigned int SSL_client_hello_get0_legacy_version(SSL *s);
 size_t SSL_client_hello_get0_random(SSL *s, const unsigned char **out);
 size_t SSL_client_hello_get0_session_id(SSL *s, const unsigned char **out);
@@ -1996,14 +2047,6 @@ OSSL_DEPRECATEDIN_3_0
 __owur int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth);
 #endif

-#ifndef OPENSSL_NO_SSL3_METHOD
-#ifndef OPENSSL_NO_DEPRECATED_1_1_0
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *SSLv3_method(void); /* SSLv3 */
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *SSLv3_server_method(void);
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *SSLv3_client_method(void);
-#endif
-#endif
-
 #define SSLv23_method TLS_method
 #define SSLv23_server_method TLS_server_method
 #define SSLv23_client_method TLS_client_method
@@ -2013,47 +2056,6 @@ __owur const SSL_METHOD *TLS_method(void);
 __owur const SSL_METHOD *TLS_server_method(void);
 __owur const SSL_METHOD *TLS_client_method(void);

-#ifndef OPENSSL_NO_TLS1_METHOD
-#ifndef OPENSSL_NO_DEPRECATED_1_1_0
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_server_method(void);
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_client_method(void);
-#endif
-#endif
-
-#ifndef OPENSSL_NO_TLS1_1_METHOD
-#ifndef OPENSSL_NO_DEPRECATED_1_1_0
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_1_method(void); /* TLSv1.1 */
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_1_server_method(void);
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_1_client_method(void);
-#endif
-#endif
-
-#ifndef OPENSSL_NO_TLS1_2_METHOD
-#ifndef OPENSSL_NO_DEPRECATED_1_1_0
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_2_method(void); /* TLSv1.2 */
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_2_server_method(void);
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_2_client_method(void);
-#endif
-#endif
-
-#ifndef OPENSSL_NO_DTLS1_METHOD
-#ifndef OPENSSL_NO_DEPRECATED_1_1_0
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_server_method(void);
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_client_method(void);
-#endif
-#endif
-
-#ifndef OPENSSL_NO_DTLS1_2_METHOD
-/* DTLSv1.2 */
-#ifndef OPENSSL_NO_DEPRECATED_1_1_0
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_2_method(void);
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_2_server_method(void);
-OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_2_client_method(void);
-#endif
-#endif
-
 __owur const SSL_METHOD *DTLS_method(void); /* DTLS 1.0 and 1.2 */
 __owur const SSL_METHOD *DTLS_server_method(void); /* DTLS 1.0 and 1.2 */
 __owur const SSL_METHOD *DTLS_client_method(void); /* DTLS 1.0 and 1.2 */
@@ -2305,6 +2307,7 @@ size_t SSL_CTX_get_num_tickets(const SSL_CTX *ctx);
 /* QUIC support */
 int SSL_handle_events(SSL *s);
 __owur int SSL_get_event_timeout(SSL *s, struct timeval *tv, int *is_infinite);
+__owur int SSL_get_peer_addr(SSL *ssl, BIO_ADDR *peer_addr);
 __owur int SSL_get_rpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *desc);
 __owur int SSL_get_wpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *desc);
 __owur int SSL_net_read_desired(SSL *s);
@@ -2318,6 +2321,8 @@ __owur int SSL_is_connection(SSL *s);
 __owur int SSL_is_listener(SSL *ssl);
 __owur SSL *SSL_get0_listener(SSL *s);
 #define SSL_LISTENER_FLAG_NO_VALIDATE (1UL << 1)
+#define SSL_LISTENER_FLAG_ADDRESS_VALIDATION (1UL << 2)
+#define SSL_LISTENER_FLAG_SINGLE_THREAD (1UL << 3)
 __owur SSL *SSL_new_listener(SSL_CTX *ctx, uint64_t flags);
 __owur SSL *SSL_new_listener_from(SSL *ssl, uint64_t flags);
 __owur SSL *SSL_new_from_listener(SSL *ssl, uint64_t flags);
@@ -2365,6 +2370,8 @@ __owur SSL *SSL_new_stream(SSL *s, uint64_t flags);
 __owur int SSL_set_incoming_stream_policy(SSL *s, int policy, uint64_t aec);

 #define SSL_ACCEPT_STREAM_NO_BLOCK (1U << 0)
+#define SSL_ACCEPT_STREAM_UNI (1U << 1)
+#define SSL_ACCEPT_STREAM_BIDI (1U << 2)
 __owur SSL *SSL_accept_stream(SSL *s, uint64_t flags);
 __owur size_t SSL_get_accept_stream_queue_len(SSL *s);

@@ -2441,8 +2448,18 @@ __owur int SSL_get_conn_close_info(SSL *ssl,
 #define SSL_VALUE_STREAM_WRITE_BUF_SIZE 7
 #define SSL_VALUE_STREAM_WRITE_BUF_USED 8
 #define SSL_VALUE_STREAM_WRITE_BUF_AVAIL 9
+#define SSL_VALUE_QUIC_UDP_PAYLOAD_SIZE_MAX 10
+#define SSL_VALUE_QUIC_WINDOWCON 11
+#define SSL_VALUE_QUIC_WINDOWBSTR 12
+#define SSL_VALUE_QUIC_WINDOWUSTR 13
+#define SSL_VALUE_QUIC_ACK_DELAY_EXPONENT 14
+#define SSL_VALUE_QUIC_ACK_DELAY_MAX 15
 #define SSL_VALUE_QUIC_MAX_PENDING_CONNS 16

+#define SSL_VALUE_DTLS_LISTENER_MAX_PENDING_CONNS 17
+#define SSL_VALUE_DTLS_LISTENER_PENDING_TIMEOUT 18
+#define SSL_VALUE_DTLS_LISTENER_MAX_DGRAM_SIZE 19
+
 #define SSL_VALUE_EVENT_HANDLING_MODE_INHERIT 0
 #define SSL_VALUE_EVENT_HANDLING_MODE_IMPLICIT 1
 #define SSL_VALUE_EVENT_HANDLING_MODE_EXPLICIT 2
@@ -2580,6 +2597,8 @@ void SSL_trace(int write_p, int version, int content_type,
 int DTLSv1_listen(SSL *s, BIO_ADDR *client);
 #endif

+int SSL_listen_ex(SSL *listener, SSL *new_conn);
+
 #ifndef OPENSSL_NO_CT

 /*
@@ -2778,8 +2797,11 @@ __owur void *SSL_CTX_get0_security_ex_data(const SSL_CTX *ctx);
 int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);

 #ifndef OPENSSL_NO_UNIT_TEST
+#ifndef OPENSSL_NO_DEPRECATED_4_1
+OSSL_DEPRECATEDIN_4_1
 __owur const struct openssl_ssl_test_functions *SSL_test_functions(void);
 #endif
+#endif

 __owur int SSL_free_buffers(SSL *ssl);
 __owur int SSL_alloc_buffers(SSL *ssl);
diff --git a/deps/openssl/openssl/include/openssl/ssl3.h b/deps/openssl/openssl/include/openssl/ssl3.h
index f35b6eadb0f..b588fe1259c 100644
--- a/deps/openssl/openssl/include/openssl/ssl3.h
+++ b/deps/openssl/openssl/include/openssl/ssl3.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -173,8 +173,6 @@ extern "C" {

 #define SSL3_RT_MAX_EXTRA (16384)

-/* Maximum plaintext length: defined by SSL/TLS standards */
-#define SSL3_RT_MAX_PLAIN_LENGTH 16384
 /* Maximum compression overhead: defined by SSL/TLS standards */
 #define SSL3_RT_MAX_COMPRESSED_OVERHEAD 1024

@@ -220,6 +218,7 @@ extern "C" {
 #define SSL3_RT_ALERT 21
 #define SSL3_RT_HANDSHAKE 22
 #define SSL3_RT_APPLICATION_DATA 23
+#define SSL3_RT_ACK 26 /* RFC 9147 */

 /* Pseudo content types to indicate additional parameters */
 #define TLS1_RT_CRYPTO 0x1000
@@ -333,6 +332,9 @@ extern "C" {
 #define SSL3_MT_MESSAGE_HASH 254
 #define DTLS1_MT_HELLO_VERIFY_REQUEST 3

+/* Dummy message type for handling ACK like a normal handshake message */
+#define DTLS13_MT_ACK 0x0126
+
 /* Dummy message type for handling CCS like a normal handshake message */
 #define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101

@@ -346,6 +348,7 @@ extern "C" {
 #define SSL3_CC_EARLY 0x040
 #define SSL3_CC_HANDSHAKE 0x080
 #define SSL3_CC_APPLICATION 0x100
+#define SSL3_CC_COMP_CERT 0x200
 #define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT | SSL3_CC_WRITE)
 #define SSL3_CHANGE_CIPHER_SERVER_READ (SSL3_CC_SERVER | SSL3_CC_READ)
 #define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT | SSL3_CC_READ)
diff --git a/deps/openssl/openssl/include/openssl/sslerr.h b/deps/openssl/openssl/include/openssl/sslerr.h
deleted file mode 100644
index 6993255b199..00000000000
--- a/deps/openssl/openssl/include/openssl/sslerr.h
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_SSLERR_H
-#define OPENSSL_SSLERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/sslerr_legacy.h>
-
-/*
- * SSL reason codes.
- */
-#define SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY 291
-#define SSL_R_APP_DATA_IN_HANDSHAKE 100
-#define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272
-#define SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE 158
-#define SSL_R_BAD_CERTIFICATE 348
-#define SSL_R_BAD_CHANGE_CIPHER_SPEC 103
-#define SSL_R_BAD_CIPHER 186
-#define SSL_R_BAD_COMPRESSION_ALGORITHM 326
-#define SSL_R_BAD_DATA 390
-#define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106
-#define SSL_R_BAD_DECOMPRESSION 107
-#define SSL_R_BAD_DH_VALUE 102
-#define SSL_R_BAD_DIGEST_LENGTH 111
-#define SSL_R_BAD_EARLY_DATA 233
-#define SSL_R_BAD_ECC_CERT 304
-#define SSL_R_BAD_ECPOINT 306
-#define SSL_R_BAD_EXTENSION 110
-#define SSL_R_BAD_HANDSHAKE_LENGTH 332
-#define SSL_R_BAD_HANDSHAKE_STATE 236
-#define SSL_R_BAD_HELLO_REQUEST 105
-#define SSL_R_BAD_HRR_VERSION 263
-#define SSL_R_BAD_KEY_SHARE 108
-#define SSL_R_BAD_KEY_UPDATE 122
-#define SSL_R_BAD_LEGACY_VERSION 292
-#define SSL_R_BAD_LENGTH 271
-#define SSL_R_BAD_PACKET 240
-#define SSL_R_BAD_PACKET_LENGTH 115
-#define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116
-#define SSL_R_BAD_PSK 219
-#define SSL_R_BAD_PSK_IDENTITY 114
-#define SSL_R_BAD_RECORD_TYPE 443
-#define SSL_R_BAD_RSA_ENCRYPT 119
-#define SSL_R_BAD_SIGNATURE 123
-#define SSL_R_BAD_SRP_A_LENGTH 347
-#define SSL_R_BAD_SRP_PARAMETERS 371
-#define SSL_R_BAD_SRTP_MKI_VALUE 352
-#define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 353
-#define SSL_R_BAD_SSL_FILETYPE 124
-#define SSL_R_BAD_VALUE 384
-#define SSL_R_BAD_WRITE_RETRY 127
-#define SSL_R_BINDER_DOES_NOT_VERIFY 253
-#define SSL_R_BIO_NOT_SET 128
-#define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129
-#define SSL_R_BN_LIB 130
-#define SSL_R_CALLBACK_FAILED 234
-#define SSL_R_CANNOT_CHANGE_CIPHER 109
-#define SSL_R_CANNOT_GET_GROUP_NAME 299
-#define SSL_R_CA_DN_LENGTH_MISMATCH 131
-#define SSL_R_CA_KEY_TOO_SMALL 397
-#define SSL_R_CA_MD_TOO_WEAK 398
-#define SSL_R_CCS_RECEIVED_EARLY 133
-#define SSL_R_CERTIFICATE_VERIFY_FAILED 134
-#define SSL_R_CERT_CB_ERROR 377
-#define SSL_R_CERT_LENGTH_MISMATCH 135
-#define SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED 218
-#define SSL_R_CIPHER_CODE_WRONG_LENGTH 137
-#define SSL_R_CLIENTHELLO_TLSEXT 226
-#define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140
-#define SSL_R_COMPRESSION_DISABLED 343
-#define SSL_R_COMPRESSION_FAILURE 141
-#define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 307
-#define SSL_R_COMPRESSION_LIBRARY_ERROR 142
-#define SSL_R_CONNECTION_TYPE_NOT_SET 144
-#define SSL_R_CONN_USE_ONLY 356
-#define SSL_R_CONTEXT_NOT_DANE_ENABLED 167
-#define SSL_R_COOKIE_GEN_CALLBACK_FAILURE 400
-#define SSL_R_COOKIE_MISMATCH 308
-#define SSL_R_COPY_PARAMETERS_FAILED 296
-#define SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED 206
-#define SSL_R_DANE_ALREADY_ENABLED 172
-#define SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL 173
-#define SSL_R_DANE_NOT_ENABLED 175
-#define SSL_R_DANE_TLSA_BAD_CERTIFICATE 180
-#define SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE 184
-#define SSL_R_DANE_TLSA_BAD_DATA_LENGTH 189
-#define SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH 192
-#define SSL_R_DANE_TLSA_BAD_MATCHING_TYPE 200
-#define SSL_R_DANE_TLSA_BAD_PUBLIC_KEY 201
-#define SSL_R_DANE_TLSA_BAD_SELECTOR 202
-#define SSL_R_DANE_TLSA_NULL_DATA 203
-#define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145
-#define SSL_R_DATA_LENGTH_TOO_LONG 146
-#define SSL_R_DECRYPTION_FAILED 147
-#define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281
-#define SSL_R_DH_KEY_TOO_SMALL 394
-#define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148
-#define SSL_R_DIGEST_CHECK_FAILED 149
-#define SSL_R_DOMAIN_USE_ONLY 422
-#define SSL_R_DTLS_MESSAGE_TOO_BIG 334
-#define SSL_R_DUPLICATE_COMPRESSION_ID 309
-#define SSL_R_ECC_CERT_NOT_FOR_SIGNING 318
-#define SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE 374
-#define SSL_R_EE_KEY_TOO_SMALL 399
-#define SSL_R_EMPTY_RAW_PUBLIC_KEY 349
-#define SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST 354
-#define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150
-#define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151
-#define SSL_R_ERROR_IN_SYSTEM_DEFAULT_CONFIG 419
-#define SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN 204
-#define SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE 194
-#define SSL_R_EXCESSIVE_MESSAGE_SIZE 152
-#define SSL_R_EXTENSION_NOT_RECEIVED 279
-#define SSL_R_EXTRA_DATA_IN_MESSAGE 153
-#define SSL_R_EXT_LENGTH_MISMATCH 163
-#define SSL_R_FAILED_TO_GET_PARAMETER 316
-#define SSL_R_FAILED_TO_INIT_ASYNC 405
-#define SSL_R_FEATURE_NEGOTIATION_NOT_COMPLETE 417
-#define SSL_R_FEATURE_NOT_RENEGOTIABLE 413
-#define SSL_R_FRAGMENTED_CLIENT_HELLO 401
-#define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154
-#define SSL_R_HTTPS_PROXY_REQUEST 155
-#define SSL_R_HTTP_REQUEST 156
-#define SSL_R_ILLEGAL_POINT_COMPRESSION 162
-#define SSL_R_ILLEGAL_SUITEB_DIGEST 380
-#define SSL_R_INAPPROPRIATE_FALLBACK 373
-#define SSL_R_INCONSISTENT_COMPRESSION 340
-#define SSL_R_INCONSISTENT_EARLY_DATA_ALPN 222
-#define SSL_R_INCONSISTENT_EARLY_DATA_SNI 231
-#define SSL_R_INCONSISTENT_EXTMS 104
-#define SSL_R_INSUFFICIENT_SECURITY 241
-#define SSL_R_INVALID_ALERT 205
-#define SSL_R_INVALID_CCS_MESSAGE 260
-#define SSL_R_INVALID_CERTIFICATE_OR_ALG 238
-#define SSL_R_INVALID_COMMAND 280
-#define SSL_R_INVALID_COMPRESSION_ALGORITHM 341
-#define SSL_R_INVALID_CONFIG 283
-#define SSL_R_INVALID_CONFIGURATION_NAME 113
-#define SSL_R_INVALID_CONTEXT 282
-#define SSL_R_INVALID_CT_VALIDATION_TYPE 212
-#define SSL_R_INVALID_KEY_UPDATE_TYPE 120
-#define SSL_R_INVALID_MAX_EARLY_DATA 174
-#define SSL_R_INVALID_NULL_CMD_NAME 385
-#define SSL_R_INVALID_RAW_PUBLIC_KEY 350
-#define SSL_R_INVALID_RECORD 317
-#define SSL_R_INVALID_SEQUENCE_NUMBER 402
-#define SSL_R_INVALID_SERVERINFO_DATA 388
-#define SSL_R_INVALID_SESSION_ID 999
-#define SSL_R_INVALID_SRP_USERNAME 357
-#define SSL_R_INVALID_STATUS_RESPONSE 328
-#define SSL_R_INVALID_TICKET_KEYS_LENGTH 325
-#define SSL_R_LEGACY_SIGALG_DISALLOWED_OR_UNSUPPORTED 333
-#define SSL_R_LENGTH_MISMATCH 159
-#define SSL_R_LENGTH_TOO_LONG 404
-#define SSL_R_LENGTH_TOO_SHORT 160
-#define SSL_R_LIBRARY_BUG 274
-#define SSL_R_LIBRARY_HAS_NO_CIPHERS 161
-#define SSL_R_LISTENER_USE_ONLY 421
-#define SSL_R_MAXIMUM_ENCRYPTED_PKTS_REACHED 395
-#define SSL_R_MISSING_DSA_SIGNING_CERT 165
-#define SSL_R_MISSING_ECDSA_SIGNING_CERT 381
-#define SSL_R_MISSING_FATAL 256
-#define SSL_R_MISSING_PARAMETERS 290
-#define SSL_R_MISSING_PSK_KEX_MODES_EXTENSION 310
-#define SSL_R_MISSING_QUIC_TLS_FUNCTIONS 423
-#define SSL_R_MISSING_RSA_CERTIFICATE 168
-#define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169
-#define SSL_R_MISSING_RSA_SIGNING_CERT 170
-#define SSL_R_MISSING_SIGALGS_EXTENSION 112
-#define SSL_R_MISSING_SIGNING_CERT 221
-#define SSL_R_MISSING_SRP_PARAM 358
-#define SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION 209
-#define SSL_R_MISSING_SUPPORTED_VERSIONS_EXTENSION 420
-#define SSL_R_MISSING_TMP_DH_KEY 171
-#define SSL_R_MISSING_TMP_ECDH_KEY 311
-#define SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA 293
-#define SSL_R_NOT_ON_RECORD_BOUNDARY 182
-#define SSL_R_NOT_REPLACING_CERTIFICATE 289
-#define SSL_R_NOT_SERVER 284
-#define SSL_R_NO_APPLICATION_PROTOCOL 235
-#define SSL_R_NO_CERTIFICATES_RETURNED 176
-#define SSL_R_NO_CERTIFICATE_ASSIGNED 177
-#define SSL_R_NO_CERTIFICATE_SET 179
-#define SSL_R_NO_CHANGE_FOLLOWING_HRR 214
-#define SSL_R_NO_CIPHERS_AVAILABLE 181
-#define SSL_R_NO_CIPHERS_SPECIFIED 183
-#define SSL_R_NO_CIPHER_MATCH 185
-#define SSL_R_NO_CLIENT_CERT_METHOD 331
-#define SSL_R_NO_COMPRESSION_SPECIFIED 187
-#define SSL_R_NO_COOKIE_CALLBACK_SET 287
-#define SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER 330
-#define SSL_R_NO_METHOD_SPECIFIED 188
-#define SSL_R_NO_PEM_EXTENSIONS 389
-#define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190
-#define SSL_R_NO_PROTOCOLS_AVAILABLE 191
-#define SSL_R_NO_RENEGOTIATION 339
-#define SSL_R_NO_REQUIRED_DIGEST 324
-#define SSL_R_NO_SHARED_CIPHER 193
-#define SSL_R_NO_SHARED_GROUPS 410
-#define SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS 376
-#define SSL_R_NO_SRTP_PROFILES 359
-#define SSL_R_NO_STREAM 355
-#define SSL_R_NO_SUITABLE_DIGEST_ALGORITHM 297
-#define SSL_R_NO_SUITABLE_GROUPS 295
-#define SSL_R_NO_SUITABLE_KEY_SHARE 101
-#define SSL_R_NO_SUITABLE_RECORD_LAYER 322
-#define SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM 118
-#define SSL_R_NO_VALID_SCTS 216
-#define SSL_R_NO_VERIFY_COOKIE_CALLBACK 403
-#define SSL_R_NULL_SSL_CTX 195
-#define SSL_R_NULL_SSL_METHOD_PASSED 196
-#define SSL_R_OCSP_CALLBACK_FAILURE 305
-#define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197
-#define SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED 344
-#define SSL_R_OVERFLOW_ERROR 237
-#define SSL_R_PACKET_LENGTH_TOO_LONG 198
-#define SSL_R_PARSE_TLSEXT 227
-#define SSL_R_PATH_TOO_LONG 270
-#define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199
-#define SSL_R_PEM_NAME_BAD_PREFIX 391
-#define SSL_R_PEM_NAME_TOO_SHORT 392
-#define SSL_R_PIPELINE_FAILURE 406
-#define SSL_R_POLL_REQUEST_NOT_SUPPORTED 418
-#define SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR 278
-#define SSL_R_PRIVATE_KEY_MISMATCH 288
-#define SSL_R_PROTOCOL_IS_SHUTDOWN 207
-#define SSL_R_PSK_IDENTITY_NOT_FOUND 223
-#define SSL_R_PSK_NO_CLIENT_CB 224
-#define SSL_R_PSK_NO_SERVER_CB 225
-#define SSL_R_QUIC_HANDSHAKE_LAYER_ERROR 393
-#define SSL_R_QUIC_NETWORK_ERROR 387
-#define SSL_R_QUIC_PROTOCOL_ERROR 382
-#define SSL_R_READ_BIO_NOT_SET 211
-#define SSL_R_READ_TIMEOUT_EXPIRED 312
-#define SSL_R_RECORDS_NOT_RELEASED 321
-#define SSL_R_RECORD_LAYER_FAILURE 313
-#define SSL_R_RECORD_LENGTH_MISMATCH 213
-#define SSL_R_RECORD_TOO_SMALL 298
-#define SSL_R_REMOTE_PEER_ADDRESS_NOT_SET 346
-#define SSL_R_RENEGOTIATE_EXT_TOO_LONG 335
-#define SSL_R_RENEGOTIATION_ENCODING_ERR 336
-#define SSL_R_RENEGOTIATION_MISMATCH 337
-#define SSL_R_REQUEST_PENDING 285
-#define SSL_R_REQUEST_SENT 286
-#define SSL_R_REQUIRED_CIPHER_MISSING 215
-#define SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING 342
-#define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING 345
-#define SSL_R_SCT_VERIFICATION_FAILED 208
-#define SSL_R_SEQUENCE_CTR_WRAPPED 327
-#define SSL_R_SERVERHELLO_TLSEXT 275
-#define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277
-#define SSL_R_SHUTDOWN_WHILE_IN_INIT 407
-#define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360
-#define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220
-#define SSL_R_SRP_A_CALC 361
-#define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 362
-#define SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG 363
-#define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 364
-#define SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH 232
-#define SSL_R_SSL3_EXT_INVALID_SERVERNAME 319
-#define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE 320
-#define SSL_R_SSL3_SESSION_ID_TOO_LONG 300
-#define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042
-#define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020
-#define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045
-#define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044
-#define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046
-#define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030
-#define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040
-#define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047
-#define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041
-#define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
-#define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043
-#define SSL_R_SSL_COMMAND_SECTION_EMPTY 117
-#define SSL_R_SSL_COMMAND_SECTION_NOT_FOUND 125
-#define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228
-#define SSL_R_SSL_HANDSHAKE_FAILURE 229
-#define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230
-#define SSL_R_SSL_NEGATIVE_LENGTH 372
-#define SSL_R_SSL_SECTION_EMPTY 126
-#define SSL_R_SSL_SECTION_NOT_FOUND 136
-#define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 301
-#define SSL_R_SSL_SESSION_ID_CONFLICT 302
-#define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273
-#define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303
-#define SSL_R_SSL_SESSION_ID_TOO_LONG 408
-#define SSL_R_SSL_SESSION_VERSION_MISMATCH 210
-#define SSL_R_STILL_IN_INIT 121
-#define SSL_R_STREAM_COUNT_LIMITED 411
-#define SSL_R_STREAM_FINISHED 365
-#define SSL_R_STREAM_RECV_ONLY 366
-#define SSL_R_STREAM_RESET 375
-#define SSL_R_STREAM_SEND_ONLY 379
-#define SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED 1116
-#define SSL_R_TLSV13_ALERT_MISSING_EXTENSION 1109
-#define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049
-#define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050
-#define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021
-#define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051
-#define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060
-#define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086
-#define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071
-#define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080
-#define SSL_R_TLSV1_ALERT_NO_APPLICATION_PROTOCOL 1120
-#define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100
-#define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070
-#define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022
-#define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048
-#define SSL_R_TLSV1_ALERT_UNKNOWN_PSK_IDENTITY 1115
-#define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090
-#define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114
-#define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113
-#define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111
-#define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112
-#define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110
-#define SSL_R_TLS_ILLEGAL_EXPORTER_LABEL 367
-#define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157
-#define SSL_R_TOO_MANY_KEY_UPDATES 132
-#define SSL_R_TOO_MANY_WARN_ALERTS 409
-#define SSL_R_TOO_MUCH_EARLY_DATA 164
-#define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 314
-#define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239
-#define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242
-#define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243
-#define SSL_R_UNEXPECTED_CCS_MESSAGE 262
-#define SSL_R_UNEXPECTED_END_OF_EARLY_DATA 178
-#define SSL_R_UNEXPECTED_EOF_WHILE_READING 294
-#define SSL_R_UNEXPECTED_MESSAGE 244
-#define SSL_R_UNEXPECTED_RECORD 245
-#define SSL_R_UNINITIALIZED 276
-#define SSL_R_UNKNOWN_ALERT_TYPE 246
-#define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247
-#define SSL_R_UNKNOWN_CIPHER_RETURNED 248
-#define SSL_R_UNKNOWN_CIPHER_TYPE 249
-#define SSL_R_UNKNOWN_CMD_NAME 386
-#define SSL_R_UNKNOWN_COMMAND 139
-#define SSL_R_UNKNOWN_DIGEST 368
-#define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250
-#define SSL_R_UNKNOWN_MANDATORY_PARAMETER 323
-#define SSL_R_UNKNOWN_PKEY_TYPE 251
-#define SSL_R_UNKNOWN_PROTOCOL 252
-#define SSL_R_UNKNOWN_SSL_VERSION 254
-#define SSL_R_UNKNOWN_STATE 255
-#define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED 338
-#define SSL_R_UNSOLICITED_EXTENSION 217
-#define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257
-#define SSL_R_UNSUPPORTED_CONFIG_VALUE 414
-#define SSL_R_UNSUPPORTED_CONFIG_VALUE_CLASS 415
-#define SSL_R_UNSUPPORTED_CONFIG_VALUE_OP 416
-#define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 315
-#define SSL_R_UNSUPPORTED_PROTOCOL 258
-#define SSL_R_UNSUPPORTED_SSL_VERSION 259
-#define SSL_R_UNSUPPORTED_STATUS_TYPE 329
-#define SSL_R_UNSUPPORTED_WRITE_FLAG 412
-#define SSL_R_USE_SRTP_NOT_NEGOTIATED 369
-#define SSL_R_VERSION_TOO_HIGH 166
-#define SSL_R_VERSION_TOO_LOW 396
-#define SSL_R_WRONG_CERTIFICATE_TYPE 383
-#define SSL_R_WRONG_CIPHER_RETURNED 261
-#define SSL_R_WRONG_CURVE 378
-#define SSL_R_WRONG_RPK_TYPE 351
-#define SSL_R_WRONG_SIGNATURE_LENGTH 264
-#define SSL_R_WRONG_SIGNATURE_SIZE 265
-#define SSL_R_WRONG_SIGNATURE_TYPE 370
-#define SSL_R_WRONG_SSL_VERSION 266
-#define SSL_R_WRONG_VERSION_NUMBER 267
-#define SSL_R_X509_LIB 268
-#define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/sslerr_legacy.h b/deps/openssl/openssl/include/openssl/sslerr_legacy.h
index 8cf1ebd7b02..fd3453e4137 100644
--- a/deps/openssl/openssl/include/openssl/sslerr_legacy.h
+++ b/deps/openssl/openssl/include/openssl/sslerr_legacy.h
@@ -461,6 +461,26 @@ OSSL_DEPRECATEDIN_3_0 int ERR_load_SSL_strings(void);
 #define SSL_F_WRITE_STATE_MACHINE 0
 #endif

+#ifndef OPENSSL_NO_DEPRECATED_4_0
+
+#define SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH 232
+#define SSL_R_SSL3_EXT_INVALID_SERVERNAME 319
+#define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE 320
+#define SSL_R_SSL3_SESSION_ID_TOO_LONG 300
+#define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042
+#define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020
+#define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045
+#define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044
+#define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046
+#define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030
+#define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040
+#define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047
+#define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041
+#define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
+#define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043
+
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/deps/openssl/openssl/include/openssl/stack.h b/deps/openssl/openssl/include/openssl/stack.h
index 82ef52ab72a..7cab36c4f64 100644
--- a/deps/openssl/openssl/include/openssl/stack.h
+++ b/deps/openssl/openssl/include/openssl/stack.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -24,7 +24,9 @@ typedef struct stack_st OPENSSL_STACK; /* Use STACK_OF(...) instead */

 typedef int (*OPENSSL_sk_compfunc)(const void *, const void *);
 typedef void (*OPENSSL_sk_freefunc)(void *);
+typedef void (*OPENSSL_sk_freefunc_thunk)(OPENSSL_sk_freefunc, void *);
 typedef void *(*OPENSSL_sk_copyfunc)(const void *);
+typedef void *(*OPENSSL_sk_copyfunc_thunk)(OPENSSL_sk_copyfunc, const void *);

 int OPENSSL_sk_num(const OPENSSL_STACK *);
 void *OPENSSL_sk_value(const OPENSSL_STACK *, int);
@@ -34,18 +36,21 @@ void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data);
 OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc cmp);
 OPENSSL_STACK *OPENSSL_sk_new_null(void);
 OPENSSL_STACK *OPENSSL_sk_new_reserve(OPENSSL_sk_compfunc c, int n);
+OPENSSL_STACK *OPENSSL_sk_set_thunks(OPENSSL_STACK *st, OPENSSL_sk_freefunc_thunk f_thunk);
+OPENSSL_STACK *OPENSSL_sk_set_cmp_thunks(OPENSSL_STACK *st, int (*c_thunk)(int (*)(const void *, const void *), const void *, const void *));
+OPENSSL_STACK *OPENSSL_sk_set_copy_thunks(OPENSSL_STACK *st, OPENSSL_sk_copyfunc_thunk cp_thunk);
 int OPENSSL_sk_reserve(OPENSSL_STACK *st, int n);
 void OPENSSL_sk_free(OPENSSL_STACK *);
-void OPENSSL_sk_pop_free(OPENSSL_STACK *st, void (*func)(void *));
+void OPENSSL_sk_pop_free(OPENSSL_STACK *st, OPENSSL_sk_freefunc func);
 OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *,
     OPENSSL_sk_copyfunc c,
     OPENSSL_sk_freefunc f);
 int OPENSSL_sk_insert(OPENSSL_STACK *sk, const void *data, int where);
 void *OPENSSL_sk_delete(OPENSSL_STACK *st, int loc);
 void *OPENSSL_sk_delete_ptr(OPENSSL_STACK *st, const void *p);
-int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data);
-int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data);
-int OPENSSL_sk_find_all(OPENSSL_STACK *st, const void *data, int *pnum);
+int OPENSSL_sk_find(const OPENSSL_STACK *st, const void *data);
+int OPENSSL_sk_find_ex(const OPENSSL_STACK *st, const void *data);
+int OPENSSL_sk_find_all(const OPENSSL_STACK *st, const void *data, int *pnum);
 int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data);
 int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data);
 void *OPENSSL_sk_shift(OPENSSL_STACK *st);
diff --git a/deps/openssl/openssl/include/openssl/store.h b/deps/openssl/openssl/include/openssl/store.h
index 53c68516f8e..980971aa0e6 100644
--- a/deps/openssl/openssl/include/openssl/store.h
+++ b/deps/openssl/openssl/include/openssl/store.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -160,6 +160,7 @@ OSSL_STORE_CTX *OSSL_STORE_attach(BIO *bio, const char *scheme,
 #define OSSL_STORE_INFO_PKEY 4 /* EVP_PKEY * */
 #define OSSL_STORE_INFO_CERT 5 /* X509 * */
 #define OSSL_STORE_INFO_CRL 6 /* X509_CRL * */
+#define OSSL_STORE_INFO_SKEY 7 /* EVP_SKEY * */

 /*
  * Functions to generate OSSL_STORE_INFOs, one function for each type we
@@ -176,6 +177,7 @@ OSSL_STORE_INFO *OSSL_STORE_INFO_new_PUBKEY(EVP_PKEY *pubkey);
 OSSL_STORE_INFO *OSSL_STORE_INFO_new_PKEY(EVP_PKEY *pkey);
 OSSL_STORE_INFO *OSSL_STORE_INFO_new_CERT(X509 *x509);
 OSSL_STORE_INFO *OSSL_STORE_INFO_new_CRL(X509_CRL *crl);
+OSSL_STORE_INFO *OSSL_STORE_INFO_new_SKEY(EVP_SKEY *skey);

 /*
  * Functions to try to extract data from a OSSL_STORE_INFO.
@@ -196,6 +198,8 @@ X509 *OSSL_STORE_INFO_get0_CERT(const OSSL_STORE_INFO *info);
 X509 *OSSL_STORE_INFO_get1_CERT(const OSSL_STORE_INFO *info);
 X509_CRL *OSSL_STORE_INFO_get0_CRL(const OSSL_STORE_INFO *info);
 X509_CRL *OSSL_STORE_INFO_get1_CRL(const OSSL_STORE_INFO *info);
+EVP_SKEY *OSSL_STORE_INFO_get0_SKEY(const OSSL_STORE_INFO *info);
+EVP_SKEY *OSSL_STORE_INFO_get1_SKEY(const OSSL_STORE_INFO *info);

 const char *OSSL_STORE_INFO_type_string(int type);

@@ -223,8 +227,8 @@ int OSSL_STORE_supports_search(OSSL_STORE_CTX *ctx, int search_type);
  * The input is considered to be owned by the caller, and must therefore
  * remain present throughout the lifetime of the returned OSSL_STORE_SEARCH
  */
-OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_name(X509_NAME *name);
-OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_issuer_serial(X509_NAME *name,
+OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_name(const X509_NAME *name);
+OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_issuer_serial(const X509_NAME *name,
     const ASN1_INTEGER
         *serial);
 OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_key_fingerprint(const EVP_MD *digest,
@@ -238,7 +242,7 @@ void OSSL_STORE_SEARCH_free(OSSL_STORE_SEARCH *search);

 /* Search term accessors */
 int OSSL_STORE_SEARCH_get_type(const OSSL_STORE_SEARCH *criterion);
-X509_NAME *OSSL_STORE_SEARCH_get0_name(const OSSL_STORE_SEARCH *criterion);
+const X509_NAME *OSSL_STORE_SEARCH_get0_name(const OSSL_STORE_SEARCH *criterion);
 const ASN1_INTEGER *OSSL_STORE_SEARCH_get0_serial(const OSSL_STORE_SEARCH
         *criterion);
 const unsigned char *OSSL_STORE_SEARCH_get0_bytes(const OSSL_STORE_SEARCH
@@ -259,8 +263,6 @@ int OSSL_STORE_find(OSSL_STORE_CTX *ctx, const OSSL_STORE_SEARCH *search);
  *  ---------------------------------------------------
  */

-typedef struct ossl_store_loader_st OSSL_STORE_LOADER;
-
 OSSL_STORE_LOADER *OSSL_STORE_LOADER_fetch(OSSL_LIB_CTX *libctx,
     const char *scheme,
     const char *properties);
@@ -279,6 +281,8 @@ void OSSL_STORE_LOADER_do_all_provided(OSSL_LIB_CTX *libctx,
 int OSSL_STORE_LOADER_names_do_all(const OSSL_STORE_LOADER *loader,
     void (*fn)(const char *name, void *data),
     void *data);
+const OSSL_PARAM *
+OSSL_STORE_LOADER_settable_ctx_params(const OSSL_STORE_LOADER *loader);

 /*-
  *  Function to register a loader for the given URI scheme.
@@ -312,7 +316,8 @@ typedef int (*OSSL_STORE_close_fn)(OSSL_STORE_LOADER_CTX *ctx);
 #endif
 #ifndef OPENSSL_NO_DEPRECATED_3_0
 OSSL_DEPRECATEDIN_3_0
-OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(ENGINE *e, const char *scheme);
+OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(ENGINE *e /* must be NULL */,
+    const char *scheme);
 OSSL_DEPRECATEDIN_3_0
 int OSSL_STORE_LOADER_set_open(OSSL_STORE_LOADER *loader,
     OSSL_STORE_open_fn open_function);
@@ -344,8 +349,6 @@ OSSL_DEPRECATEDIN_3_0
 int OSSL_STORE_LOADER_set_close(OSSL_STORE_LOADER *loader,
     OSSL_STORE_close_fn close_function);
 OSSL_DEPRECATEDIN_3_0
-const ENGINE *OSSL_STORE_LOADER_get0_engine(const OSSL_STORE_LOADER *loader);
-OSSL_DEPRECATEDIN_3_0
 const char *OSSL_STORE_LOADER_get0_scheme(const OSSL_STORE_LOADER *loader);
 OSSL_DEPRECATEDIN_3_0
 int OSSL_STORE_register_loader(OSSL_STORE_LOADER *loader);
diff --git a/deps/openssl/openssl/include/openssl/storeerr.h b/deps/openssl/openssl/include/openssl/storeerr.h
deleted file mode 100644
index a61bee11125..00000000000
--- a/deps/openssl/openssl/include/openssl/storeerr.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_STOREERR_H
-#define OPENSSL_STOREERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * OSSL_STORE reason codes.
- */
-#define OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE 107
-#define OSSL_STORE_R_BAD_PASSWORD_READ 115
-#define OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC 113
-#define OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST 121
-#define OSSL_STORE_R_INVALID_SCHEME 106
-#define OSSL_STORE_R_IS_NOT_A 112
-#define OSSL_STORE_R_LOADER_INCOMPLETE 116
-#define OSSL_STORE_R_LOADING_STARTED 117
-#define OSSL_STORE_R_NOT_A_CERTIFICATE 100
-#define OSSL_STORE_R_NOT_A_CRL 101
-#define OSSL_STORE_R_NOT_A_NAME 103
-#define OSSL_STORE_R_NOT_A_PRIVATE_KEY 102
-#define OSSL_STORE_R_NOT_A_PUBLIC_KEY 122
-#define OSSL_STORE_R_NOT_PARAMETERS 104
-#define OSSL_STORE_R_NO_LOADERS_FOUND 123
-#define OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR 114
-#define OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE 108
-#define OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES 119
-#define OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED 109
-#define OSSL_STORE_R_UNREGISTERED_SCHEME 105
-#define OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE 110
-#define OSSL_STORE_R_UNSUPPORTED_OPERATION 118
-#define OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE 120
-#define OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED 111
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/tls1.h b/deps/openssl/openssl/include/openssl/tls1.h
index 931ee790fb0..f43dedc5ad9 100644
--- a/deps/openssl/openssl/include/openssl/tls1.h
+++ b/deps/openssl/openssl/include/openssl/tls1.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  * Copyright 2005 Nokia. All rights reserved.
  *
@@ -78,6 +78,9 @@ extern "C" {
 #define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114
 #define TLS1_AD_UNKNOWN_PSK_IDENTITY 115 /* fatal */
 #define TLS1_AD_NO_APPLICATION_PROTOCOL 120 /* fatal */
+#ifndef OPENSSL_NO_ECH
+#define TLS1_AD_ECH_REQUIRED 121 /* fatal */
+#endif

 /* ExtensionType values from RFC3546 / RFC4366 / RFC6066 */
 #define TLSEXT_TYPE_server_name 0
@@ -167,6 +170,11 @@ extern "C" {
 #define TLSEXT_TYPE_next_proto_neg 13172
 #endif

+#ifndef OPENSSL_NO_ECH
+#define TLSEXT_TYPE_ech 0xfe0d
+#define TLSEXT_TYPE_outer_extensions 0xfd00
+#endif
+
 /* NameType value from RFC3546 */
 #define TLSEXT_NAMETYPE_host_name 0
 /* status request value from RFC3546 */
@@ -247,7 +255,7 @@ int SSL_set_tlsext_max_fragment_length(SSL *ssl, uint8_t mode);

 #define TLSEXT_MAXLEN_host_name 255

-__owur const char *SSL_get_servername(const SSL *s, const int type);
+__owur const char *SSL_get_servername(const SSL *s, int type);
 __owur int SSL_get_servername_type(const SSL *s);
 /*
  * SSL_export_keying_material exports a value derived from the master secret,
@@ -277,6 +285,11 @@ __owur int SSL_export_keying_material_early(SSL *s, unsigned char *out,
 int SSL_get_peer_signature_type_nid(const SSL *s, int *pnid);
 int SSL_get_signature_type_nid(const SSL *s, int *pnid);

+int SSL_get0_sigalg(SSL *s, int idx, unsigned int *codepoint,
+    const char **name);
+int SSL_get0_shared_sigalg(SSL *s, int idx, unsigned int *codepoint,
+    const char **name);
+
 int SSL_get_sigalgs(SSL *s, int idx,
     int *psign, int *phash, int *psignandhash,
     unsigned char *rsig, unsigned char *rhash);
@@ -324,6 +337,12 @@ __owur int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain)
 #define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \
     SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP, arglen, arg)

+#define SSL_get0_tlsext_status_ocsp_resp_ex(ssl, arg) \
+    SSL_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP_EX, 0, arg)
+
+#define SSL_set0_tlsext_status_ocsp_resp_ex(ssl, arg) \
+    SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP_EX, 0, arg)
+
 #define SSL_CTX_set_tlsext_servername_callback(ctx, cb)           \
     SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TLSEXT_SERVERNAME_CB, \
         (void (*)(void))cb)
@@ -655,6 +674,10 @@ int SSL_CTX_set_tlsext_ticket_key_evp_cb(SSL_CTX *ctx, int (*fp)(SSL *, unsigned
 #define TLS1_CK_RSA_PSK_WITH_ARIA_128_GCM_SHA256 0x0300C06E
 #define TLS1_CK_RSA_PSK_WITH_ARIA_256_GCM_SHA384 0x0300C06F

+/* SM ciphersuites from RFC8998 */
+#define TLS1_3_CK_SM4_GCM_SM3 0x030000C6
+#define TLS1_3_CK_SM4_CCM_SM3 0x030000C7
+
 /* a bundle of RFC standard cipher names, generated from ssl3_ciphers[] */
 #define TLS1_RFC_RSA_WITH_AES_128_SHA "TLS_RSA_WITH_AES_128_CBC_SHA"
 #define TLS1_RFC_DHE_DSS_WITH_AES_128_SHA "TLS_DHE_DSS_WITH_AES_128_CBC_SHA"
@@ -847,6 +870,8 @@ int SSL_CTX_set_tlsext_ticket_key_evp_cb(SSL_CTX *ctx, int (*fp)(SSL *, unsigned
 #define TLS1_RFC_DHE_PSK_WITH_ARIA_256_GCM_SHA384 "TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384"
 #define TLS1_RFC_RSA_PSK_WITH_ARIA_128_GCM_SHA256 "TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256"
 #define TLS1_RFC_RSA_PSK_WITH_ARIA_256_GCM_SHA384 "TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384"
+#define TLS1_3_RFC_SM4_GCM_SM3 "TLS_SM4_GCM_SM3"
+#define TLS1_3_RFC_SM4_CCM_SM3 "TLS_SM4_CCM_SM3"

 /*
  * XXX Backward compatibility alert: Older versions of OpenSSL gave some DHE
@@ -1078,10 +1103,6 @@ int SSL_CTX_set_tlsext_ticket_key_evp_cb(SSL_CTX *ctx, int (*fp)(SSL *, unsigned
 #define TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256 "ECDH-RSA-AES128-GCM-SHA256"
 #define TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384 "ECDH-RSA-AES256-GCM-SHA384"

-/* TLS v1.2 PSK GCM ciphersuites from RFC5487 */
-#define TLS1_TXT_PSK_WITH_AES_128_GCM_SHA256 "PSK-AES128-GCM-SHA256"
-#define TLS1_TXT_PSK_WITH_AES_256_GCM_SHA384 "PSK-AES256-GCM-SHA384"
-
 /* ECDHE PSK ciphersuites from RFC 5489 */
 #define TLS1_TXT_ECDHE_PSK_WITH_RC4_128_SHA "ECDHE-PSK-RC4-SHA"
 #define TLS1_TXT_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA "ECDHE-PSK-3DES-EDE-CBC-SHA"
@@ -1191,9 +1212,6 @@ int SSL_CTX_set_tlsext_ticket_key_evp_cb(SSL_CTX *ctx, int (*fp)(SSL *, unsigned
 /* ASCII: "client write key", in hex for EBCDIC compatibility */
 #define TLS_MD_CLIENT_WRITE_KEY_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79"
 #define TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE 16
-/* ASCII: "server write key", in hex for EBCDIC compatibility */
-#define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79"
-#define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16
 /* ASCII: "IV block", in hex for EBCDIC compatibility */
 #define TLS_MD_IV_BLOCK_CONST "\x49\x56\x20\x62\x6c\x6f\x63\x6b"
 #define TLS_MD_IV_BLOCK_CONST_SIZE 8
diff --git a/deps/openssl/openssl/include/openssl/trace.h b/deps/openssl/openssl/include/openssl/trace.h
index ff0fba72958..236134bd434 100644
--- a/deps/openssl/openssl/include/openssl/trace.h
+++ b/deps/openssl/openssl/include/openssl/trace.h
@@ -43,22 +43,20 @@ extern "C" {
 #define OSSL_TRACE_CATEGORY_TLS 3
 #define OSSL_TRACE_CATEGORY_TLS_CIPHER 4
 #define OSSL_TRACE_CATEGORY_CONF 5
-#define OSSL_TRACE_CATEGORY_ENGINE_TABLE 6
-#define OSSL_TRACE_CATEGORY_ENGINE_REF_COUNT 7
-#define OSSL_TRACE_CATEGORY_PKCS5V2 8
-#define OSSL_TRACE_CATEGORY_PKCS12_KEYGEN 9
-#define OSSL_TRACE_CATEGORY_PKCS12_DECRYPT 10
-#define OSSL_TRACE_CATEGORY_X509V3_POLICY 11
-#define OSSL_TRACE_CATEGORY_BN_CTX 12
-#define OSSL_TRACE_CATEGORY_CMP 13
-#define OSSL_TRACE_CATEGORY_STORE 14
-#define OSSL_TRACE_CATEGORY_DECODER 15
-#define OSSL_TRACE_CATEGORY_ENCODER 16
-#define OSSL_TRACE_CATEGORY_REF_COUNT 17
-#define OSSL_TRACE_CATEGORY_HTTP 18
-#define OSSL_TRACE_CATEGORY_PROVIDER 19
-#define OSSL_TRACE_CATEGORY_QUERY 20
-#define OSSL_TRACE_CATEGORY_NUM 21
+#define OSSL_TRACE_CATEGORY_PKCS5V2 6
+#define OSSL_TRACE_CATEGORY_PKCS12_KEYGEN 7
+#define OSSL_TRACE_CATEGORY_PKCS12_DECRYPT 8
+#define OSSL_TRACE_CATEGORY_X509V3_POLICY 9
+#define OSSL_TRACE_CATEGORY_BN_CTX 10
+#define OSSL_TRACE_CATEGORY_CMP 11
+#define OSSL_TRACE_CATEGORY_STORE 12
+#define OSSL_TRACE_CATEGORY_DECODER 13
+#define OSSL_TRACE_CATEGORY_ENCODER 14
+#define OSSL_TRACE_CATEGORY_REF_COUNT 15
+#define OSSL_TRACE_CATEGORY_HTTP 16
+#define OSSL_TRACE_CATEGORY_PROVIDER 17
+#define OSSL_TRACE_CATEGORY_QUERY 18
+#define OSSL_TRACE_CATEGORY_NUM 19
 /* KEEP THIS LIST IN SYNC with trace_categories[] in crypto/trace.c */

 /* Returns the trace category number for the given |name| */
diff --git a/deps/openssl/openssl/include/openssl/ts.h b/deps/openssl/openssl/include/openssl/ts.h
index edb6ca17bd7..ac6b988041e 100644
--- a/deps/openssl/openssl/include/openssl/ts.h
+++ b/deps/openssl/openssl/include/openssl/ts.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -155,7 +155,7 @@ int TS_REQ_get_ext_count(TS_REQ *a);
 int TS_REQ_get_ext_by_NID(TS_REQ *a, int nid, int lastpos);
 int TS_REQ_get_ext_by_OBJ(TS_REQ *a, const ASN1_OBJECT *obj, int lastpos);
 int TS_REQ_get_ext_by_critical(TS_REQ *a, int crit, int lastpos);
-X509_EXTENSION *TS_REQ_get_ext(TS_REQ *a, int loc);
+const X509_EXTENSION *TS_REQ_get_ext(TS_REQ *a, int loc);
 X509_EXTENSION *TS_REQ_delete_ext(TS_REQ *a, int loc);
 int TS_REQ_add_ext(TS_REQ *a, X509_EXTENSION *ex, int loc);
 void *TS_REQ_get_ext_d2i(TS_REQ *a, int nid, int *crit, int *idx);
@@ -217,7 +217,7 @@ int TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos);
 int TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, const ASN1_OBJECT *obj,
     int lastpos);
 int TS_TST_INFO_get_ext_by_critical(TS_TST_INFO *a, int crit, int lastpos);
-X509_EXTENSION *TS_TST_INFO_get_ext(TS_TST_INFO *a, int loc);
+const X509_EXTENSION *TS_TST_INFO_get_ext(TS_TST_INFO *a, int loc);
 X509_EXTENSION *TS_TST_INFO_delete_ext(TS_TST_INFO *a, int loc);
 int TS_TST_INFO_add_ext(TS_TST_INFO *a, X509_EXTENSION *ex, int loc);
 void *TS_TST_INFO_get_ext_d2i(TS_TST_INFO *a, int nid, int *crit, int *idx);
@@ -358,7 +358,7 @@ TS_RESP *TS_RESP_create_response(TS_RESP_CTX *ctx, BIO *req_bio);
  * they are defined in ts/ts_resp_verify.c.
  */

-int TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs,
+int TS_RESP_verify_signature(PKCS7 *token, const STACK_OF(X509) *certs,
     X509_STORE *store, X509 **signer_out);

 /* Context structure for the generic verify method. */
@@ -418,19 +418,19 @@ void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx);
 int TS_VERIFY_CTX_set_flags(TS_VERIFY_CTX *ctx, int f);
 int TS_VERIFY_CTX_add_flags(TS_VERIFY_CTX *ctx, int f);
 #ifndef OPENSSL_NO_DEPRECATED_3_4
-OSSL_DEPRECATEDIN_3_4_FOR("Unclear semantics, replace with TS_VERIFY_CTX_set0_data().")
+OSSL_DEPRECATEDIN_3_4_FOR("unclear semantics, replace with TS_VERIFY_CTX_set0_data()")
 BIO *TS_VERIFY_CTX_set_data(TS_VERIFY_CTX *ctx, BIO *b);
 #endif
 int TS_VERIFY_CTX_set0_data(TS_VERIFY_CTX *ctx, BIO *b);
 #ifndef OPENSSL_NO_DEPRECATED_3_4
-OSSL_DEPRECATEDIN_3_4_FOR("Unclear semantics, replace with TS_VERIFY_CTX_set0_imprint().")
+OSSL_DEPRECATEDIN_3_4_FOR("unclear semantics, replace with TS_VERIFY_CTX_set0_imprint()")
 unsigned char *TS_VERIFY_CTX_set_imprint(TS_VERIFY_CTX *ctx,
     unsigned char *hexstr, long len);
 #endif
 int TS_VERIFY_CTX_set0_imprint(TS_VERIFY_CTX *ctx,
     unsigned char *hexstr, long len);
 #ifndef OPENSSL_NO_DEPRECATED_3_4
-OSSL_DEPRECATEDIN_3_4_FOR("Unclear semantics, replace with TS_VERIFY_CTX_set0_store().")
+OSSL_DEPRECATEDIN_3_4_FOR("unclear semantics, replace with TS_VERIFY_CTX_set0_store()")
 X509_STORE *TS_VERIFY_CTX_set_store(TS_VERIFY_CTX *ctx, X509_STORE *s);
 #endif
 int TS_VERIFY_CTX_set0_store(TS_VERIFY_CTX *ctx, X509_STORE *s);
@@ -438,7 +438,7 @@ int TS_VERIFY_CTX_set0_store(TS_VERIFY_CTX *ctx, X509_STORE *s);
 #define TS_VERIFY_CTS_set_certs(ctx, cert) TS_VERIFY_CTX_set_certs(ctx, cert)
 #endif
 #ifndef OPENSSL_NO_DEPRECATED_3_4
-OSSL_DEPRECATEDIN_3_4_FOR("Unclear semantics, replace with TS_VERIFY_CTX_set0_certs().")
+OSSL_DEPRECATEDIN_3_4_FOR("unclear semantics, replace with TS_VERIFY_CTX_set0_certs()")
 STACK_OF(X509) *TS_VERIFY_CTX_set_certs(TS_VERIFY_CTX *ctx, STACK_OF(X509) *certs);
 #endif
 int TS_VERIFY_CTX_set0_certs(TS_VERIFY_CTX *ctx, STACK_OF(X509) *certs);
@@ -486,11 +486,6 @@ EVP_PKEY *TS_CONF_load_key(const char *file, const char *pass);
 const char *TS_CONF_get_tsa_section(CONF *conf, const char *section);
 int TS_CONF_set_serial(CONF *conf, const char *section, TS_serial_cb cb,
     TS_RESP_CTX *ctx);
-#ifndef OPENSSL_NO_ENGINE
-int TS_CONF_set_crypto_device(CONF *conf, const char *section,
-    const char *device);
-int TS_CONF_set_default_engine(const char *name);
-#endif
 int TS_CONF_set_signer_cert(CONF *conf, const char *section,
     const char *cert, TS_RESP_CTX *ctx);
 int TS_CONF_set_certs(CONF *conf, const char *section, const char *certs,
diff --git a/deps/openssl/openssl/include/openssl/tserr.h b/deps/openssl/openssl/include/openssl/tserr.h
deleted file mode 100644
index 0bec94a37cd..00000000000
--- a/deps/openssl/openssl/include/openssl/tserr.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_TSERR_H
-#define OPENSSL_TSERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-#ifndef OPENSSL_NO_TS
-
-/*
- * TS reason codes.
- */
-#define TS_R_BAD_PKCS7_TYPE 132
-#define TS_R_BAD_TYPE 133
-#define TS_R_CANNOT_LOAD_CERT 137
-#define TS_R_CANNOT_LOAD_KEY 138
-#define TS_R_CERTIFICATE_VERIFY_ERROR 100
-#define TS_R_COULD_NOT_SET_ENGINE 127
-#define TS_R_COULD_NOT_SET_TIME 115
-#define TS_R_DETACHED_CONTENT 134
-#define TS_R_ESS_ADD_SIGNING_CERT_ERROR 116
-#define TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR 139
-#define TS_R_ESS_SIGNING_CERTIFICATE_ERROR 101
-#define TS_R_INVALID_NULL_POINTER 102
-#define TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE 117
-#define TS_R_MESSAGE_IMPRINT_MISMATCH 103
-#define TS_R_NONCE_MISMATCH 104
-#define TS_R_NONCE_NOT_RETURNED 105
-#define TS_R_NO_CONTENT 106
-#define TS_R_NO_TIME_STAMP_TOKEN 107
-#define TS_R_PKCS7_ADD_SIGNATURE_ERROR 118
-#define TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR 119
-#define TS_R_PKCS7_TO_TS_TST_INFO_FAILED 129
-#define TS_R_POLICY_MISMATCH 108
-#define TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 120
-#define TS_R_RESPONSE_SETUP_ERROR 121
-#define TS_R_SIGNATURE_FAILURE 109
-#define TS_R_THERE_MUST_BE_ONE_SIGNER 110
-#define TS_R_TIME_SYSCALL_ERROR 122
-#define TS_R_TOKEN_NOT_PRESENT 130
-#define TS_R_TOKEN_PRESENT 131
-#define TS_R_TSA_NAME_MISMATCH 111
-#define TS_R_TSA_UNTRUSTED 112
-#define TS_R_TST_INFO_SETUP_ERROR 123
-#define TS_R_TS_DATASIGN 124
-#define TS_R_UNACCEPTABLE_POLICY 125
-#define TS_R_UNSUPPORTED_MD_ALGORITHM 126
-#define TS_R_UNSUPPORTED_VERSION 113
-#define TS_R_VAR_BAD_VALUE 135
-#define TS_R_VAR_LOOKUP_FAILURE 136
-#define TS_R_WRONG_CONTENT_TYPE 114
-
-#endif
-#endif
diff --git a/deps/openssl/openssl/include/openssl/types.h b/deps/openssl/openssl/include/openssl/types.h
index f9c43735676..cfc021ef1a0 100644
--- a/deps/openssl/openssl/include/openssl/types.h
+++ b/deps/openssl/openssl/include/openssl/types.h
@@ -11,6 +11,7 @@
  * Unfortunate workaround to avoid symbol conflict with wincrypt.h
  * See https://github.com/openssl/openssl/issues/9981
  */
+
 #ifdef _WIN32
 #define WINCRYPT_USE_SYMBOL_PREFIX
 #undef X509_NAME
@@ -33,32 +34,26 @@ extern "C" {
 #include <openssl/safestack.h>
 #include <openssl/macros.h>

-#if OPENSSL_VERSION_MAJOR >= 4
-#define OSSL_FUTURE_CONST const
-#else
-#define OSSL_FUTURE_CONST
-#endif
-
 typedef struct ossl_provider_st OSSL_PROVIDER; /* Provider Object */

 #ifdef NO_ASN1_TYPEDEFS
-#define ASN1_INTEGER ASN1_STRING
-#define ASN1_ENUMERATED ASN1_STRING
-#define ASN1_BIT_STRING ASN1_STRING
-#define ASN1_OCTET_STRING ASN1_STRING
-#define ASN1_PRINTABLESTRING ASN1_STRING
-#define ASN1_T61STRING ASN1_STRING
-#define ASN1_IA5STRING ASN1_STRING
-#define ASN1_UTCTIME ASN1_STRING
-#define ASN1_GENERALIZEDTIME ASN1_STRING
-#define ASN1_TIME ASN1_STRING
-#define ASN1_GENERALSTRING ASN1_STRING
-#define ASN1_UNIVERSALSTRING ASN1_STRING
-#define ASN1_BMPSTRING ASN1_STRING
-#define ASN1_VISIBLESTRING ASN1_STRING
-#define ASN1_UTF8STRING ASN1_STRING
-#define ASN1_BOOLEAN int
-#define ASN1_NULL int
+typedef ASN1_STRING ASN1_INTEGER;
+typedef ASN1_STRING ASN1_ENUMERATED;
+typedef ASN1_STRING ASN1_BIT_STRING;
+typedef ASN1_STRING ASN1_OCTET_STRING;
+typedef ASN1_STRING ASN1_PRINTABLESTRING;
+typedef ASN1_STRING ASN1_T61STRING;
+typedef ASN1_STRING ASN1_IA5STRING;
+typedef ASN1_STRING ASN1_UTCTIME;
+typedef ASN1_STRING ASN1_GENERALIZEDTIME;
+typedef ASN1_STRING ASN1_TIME;
+typedef ASN1_STRING ASN1_GENERALSTRING;
+typedef ASN1_STRING ASN1_UNIVERSALSTRING;
+typedef ASN1_STRING ASN1_BMPSTRING;
+typedef ASN1_STRING ASN1_VISIBLESTRING;
+typedef ASN1_STRING ASN1_UTF8STRING;
+typedef int ASN1_BOOLEAN;
+typedef int ASN1_NULL;
 #else
 typedef struct asn1_string_st ASN1_INTEGER;
 typedef struct asn1_string_st ASN1_ENUMERATED;
@@ -165,7 +160,6 @@ typedef struct ec_key_method_st EC_KEY_METHOD;
 #endif

 typedef struct rand_meth_st RAND_METHOD;
-typedef struct rand_drbg_st RAND_DRBG;

 typedef struct ssl_dane_st SSL_DANE;
 typedef struct x509_st X509;
@@ -225,6 +219,7 @@ typedef struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX;

 typedef struct ossl_store_info_st OSSL_STORE_INFO;
 typedef struct ossl_store_search_st OSSL_STORE_SEARCH;
+typedef struct ossl_store_loader_st OSSL_STORE_LOADER;

 typedef struct ossl_lib_ctx_st OSSL_LIB_CTX;

@@ -243,6 +238,11 @@ typedef struct ossl_decoder_ctx_st OSSL_DECODER_CTX;

 typedef struct ossl_self_test_st OSSL_SELF_TEST;

+#ifndef OPENSSL_NO_ECH
+/* opaque type for ECH related information */
+typedef struct ossl_echstore_st OSSL_ECHSTORE;
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/deps/openssl/openssl/include/openssl/ui.h b/deps/openssl/openssl/include/openssl/ui.h
deleted file mode 100644
index f5edb766b4f..00000000000
--- a/deps/openssl/openssl/include/openssl/ui.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/ui.h"
diff --git a/deps/openssl/openssl/include/openssl/uierr.h b/deps/openssl/openssl/include/openssl/uierr.h
deleted file mode 100644
index 5201b0311df..00000000000
--- a/deps/openssl/openssl/include/openssl/uierr.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_UIERR_H
-#define OPENSSL_UIERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * UI reason codes.
- */
-#define UI_R_COMMON_OK_AND_CANCEL_CHARACTERS 104
-#define UI_R_INDEX_TOO_LARGE 102
-#define UI_R_INDEX_TOO_SMALL 103
-#define UI_R_NO_RESULT_BUFFER 105
-#define UI_R_PROCESSING_ERROR 107
-#define UI_R_RESULT_TOO_LARGE 100
-#define UI_R_RESULT_TOO_SMALL 101
-#define UI_R_SYSASSIGN_ERROR 109
-#define UI_R_SYSDASSGN_ERROR 110
-#define UI_R_SYSQIOW_ERROR 111
-#define UI_R_UNKNOWN_CONTROL_COMMAND 106
-#define UI_R_UNKNOWN_TTYGET_ERRNO_VALUE 108
-#define UI_R_USER_DATA_DUPLICATION_UNSUPPORTED 112
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/x509.h b/deps/openssl/openssl/include/openssl/x509.h
deleted file mode 100644
index ed28bd68cb2..00000000000
--- a/deps/openssl/openssl/include/openssl/x509.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/x509.h"
diff --git a/deps/openssl/openssl/include/openssl/x509.h.in b/deps/openssl/openssl/include/openssl/x509.h.in
index d7ce34482b0..cb556ecbe88 100644
--- a/deps/openssl/openssl/include/openssl/x509.h.in
+++ b/deps/openssl/openssl/include/openssl/x509.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -327,8 +327,8 @@ void *X509_CRL_get_meth_data(X509_CRL *crl);

 const char *X509_verify_cert_error_string(long n);

-int X509_verify(X509 *a, EVP_PKEY *r);
-int X509_self_signed(X509 *cert, int verify_signature);
+int X509_verify(const X509 *a, EVP_PKEY *r);
+int X509_self_signed(const X509 *cert, int verify_signature);

 int X509_REQ_verify_ex(X509_REQ *a, EVP_PKEY *r, OSSL_LIB_CTX *libctx,
     const char *propq);
@@ -341,7 +341,7 @@ char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x);
 EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x);
 int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey);

-int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki);
+int NETSCAPE_SPKI_print(BIO *out, const NETSCAPE_SPKI *spki);

 int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent);
 int X509_signature_print(BIO *bp, const X509_ALGOR *alg,
@@ -488,20 +488,25 @@ int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype,
     void *pval);
 void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype,
     const void **ppval, const X509_ALGOR *algor);
-void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);
+int X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);
 int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b);
 int X509_ALGOR_copy(X509_ALGOR *dest, const X509_ALGOR *src);

 DECLARE_ASN1_DUP_FUNCTION(X509_NAME)
 DECLARE_ASN1_DUP_FUNCTION(X509_NAME_ENTRY)

-int X509_cmp_time(const ASN1_TIME *s, time_t *t);
-int X509_cmp_current_time(const ASN1_TIME *s);
-int X509_cmp_timeframe(const X509_VERIFY_PARAM *vpm,
-    const ASN1_TIME *start, const ASN1_TIME *end);
-ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *t);
+#ifndef OPENSSL_NO_DEPRECATED_4_0
+OSSL_DEPRECATEDIN_4_0 int X509_cmp_time(const ASN1_TIME *s, const time_t *t);
+OSSL_DEPRECATEDIN_4_0 int X509_cmp_current_time(const ASN1_TIME *s);
+OSSL_DEPRECATEDIN_4_0 int X509_cmp_timeframe(const X509_VERIFY_PARAM *vpm,
+    const ASN1_TIME *start,
+    const ASN1_TIME *end);
+#endif
+int X509_check_certificate_times(const X509_VERIFY_PARAM *vpm, const X509 *x,
+    int *error);
+ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, const time_t *t);
 ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s,
-    int offset_day, long offset_sec, time_t *t);
+    int offset_day, long offset_sec, const time_t *t);
 ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj);

 const char *X509_get_default_cert_area(void);
@@ -511,8 +516,8 @@ const char *X509_get_default_cert_dir_env(void);
 const char *X509_get_default_cert_file_env(void);
 const char *X509_get_default_private_dir(void);

-X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
-X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey);
+X509_REQ *X509_to_X509_REQ(const X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
+X509 *X509_REQ_to_X509(const X509_REQ *r, int days, EVP_PKEY *pkey);

 DECLARE_ASN1_FUNCTIONS(X509_ALGOR)
 DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS)
@@ -524,8 +529,8 @@ X509_PUBKEY *X509_PUBKEY_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
 int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey);
 EVP_PKEY *X509_PUBKEY_get0(const X509_PUBKEY *key);
 EVP_PKEY *X509_PUBKEY_get(const X509_PUBKEY *key);
-int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain);
-long X509_get_pathlen(X509 *x);
+int X509_get_pubkey_parameters(EVP_PKEY *pkey, const STACK_OF(X509) *chain);
+long X509_get_pathlen(const X509 *x);
 DECLARE_ASN1_ENCODE_FUNCTIONS_only(EVP_PKEY, PUBKEY)
 EVP_PKEY *d2i_PUBKEY_ex(EVP_PKEY **a, const unsigned char **pp, long length,
     OSSL_LIB_CTX *libctx, const char *propq);
@@ -583,7 +588,7 @@ int X509_SIG_INFO_get(const X509_SIG_INFO *siginf, int *mdnid, int *pknid,
 void X509_SIG_INFO_set(X509_SIG_INFO *siginf, int mdnid, int pknid,
     int secbits, uint32_t flags);

-int X509_get_signature_info(X509 *x, int *mdnid, int *pknid, int *secbits,
+int X509_get_signature_info(const X509 *x, int *mdnid, int *pknid, int *secbits,
     uint32_t *flags);

 void X509_get0_signature(const ASN1_BIT_STRING **psig,
@@ -591,14 +596,14 @@ void X509_get0_signature(const ASN1_BIT_STRING **psig,
 int X509_get_signature_nid(const X509 *x);

 void X509_set0_distinguishing_id(X509 *x, ASN1_OCTET_STRING *d_id);
-ASN1_OCTET_STRING *X509_get0_distinguishing_id(X509 *x);
+const ASN1_OCTET_STRING *X509_get0_distinguishing_id(const X509 *x);
 void X509_REQ_set0_distinguishing_id(X509_REQ *x, ASN1_OCTET_STRING *d_id);
 ASN1_OCTET_STRING *X509_REQ_get0_distinguishing_id(X509_REQ *x);

 int X509_alias_set1(X509 *x, const unsigned char *name, int len);
 int X509_keyid_set1(X509 *x, const unsigned char *id, int len);
-unsigned char *X509_alias_get0(X509 *x, int *len);
-unsigned char *X509_keyid_get0(X509 *x, int *len);
+const unsigned char *X509_alias_get0(const X509 *x, int *len);
+const unsigned char *X509_keyid_get0(const X509 *x, int *len);

 DECLARE_ASN1_FUNCTIONS(X509_REVOKED)
 DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO)
@@ -608,7 +613,7 @@ X509_CRL *X509_CRL_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
 int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
 int X509_CRL_get0_by_serial(X509_CRL *crl,
     X509_REVOKED **ret, const ASN1_INTEGER *serial);
-int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x);
+int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, const X509 *x);

 X509_PKEY *X509_PKEY_new(void);
 void X509_PKEY_free(X509_PKEY *a);
@@ -658,16 +663,15 @@ int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);
 ASN1_INTEGER *X509_get_serialNumber(X509 *x);
 const ASN1_INTEGER *X509_get0_serialNumber(const X509 *x);
 int X509_set_issuer_name(X509 *x, const X509_NAME *name);
-X509_NAME *X509_get_issuer_name(const X509 *a);
+const X509_NAME *X509_get_issuer_name(const X509 *a);
 int X509_set_subject_name(X509 *x, const X509_NAME *name);
-X509_NAME *X509_get_subject_name(const X509 *a);
+const X509_NAME *X509_get_subject_name(const X509 *a);
 const ASN1_TIME *X509_get0_notBefore(const X509 *x);
-ASN1_TIME *X509_getm_notBefore(const X509 *x);
+ASN1_TIME *X509_getm_notBefore(X509 *x);
 int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm);
 const ASN1_TIME *X509_get0_notAfter(const X509 *x);
-ASN1_TIME *X509_getm_notAfter(const X509 *x);
+ASN1_TIME *X509_getm_notAfter(X509 *x);
 int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm);
-int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
 int X509_up_ref(X509 *x);
 int X509_get_signature_type(const X509 *x);

@@ -678,25 +682,26 @@ int X509_get_signature_type(const X509 *x);
 #define X509_set_notAfter X509_set1_notAfter
 #endif

+int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
+EVP_PKEY *X509_get_pubkey(const X509 *x); /* deprecated */
+EVP_PKEY *X509_get0_pubkey(const X509 *x);
 /*
  * This one is only used so that a binary form can output, as in
  * i2d_X509_PUBKEY(X509_get_X509_PUBKEY(x), &buf)
  */
-X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x);
+const X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x);
 const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x);
 void X509_get0_uids(const X509 *x, const ASN1_BIT_STRING **piuid,
     const ASN1_BIT_STRING **psuid);
 const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x);

-EVP_PKEY *X509_get0_pubkey(const X509 *x);
-EVP_PKEY *X509_get_pubkey(X509 *x);
-ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x);
+const ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x);

 #define X509_REQ_VERSION_1 0

 long X509_REQ_get_version(const X509_REQ *req);
 int X509_REQ_set_version(X509_REQ *x, long version);
-X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req);
+const X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req);
 int X509_REQ_set_subject_name(X509_REQ *req, const X509_NAME *name);
 void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
     const X509_ALGOR **palg);
@@ -705,13 +710,13 @@ int X509_REQ_set1_signature_algo(X509_REQ *req, X509_ALGOR *palg);
 int X509_REQ_get_signature_nid(const X509_REQ *req);
 int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp);
 int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
-EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req);
+EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req); /* deprecated */
 EVP_PKEY *X509_REQ_get0_pubkey(const X509_REQ *req);
-X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req);
+X509_PUBKEY *X509_REQ_get_X509_PUBKEY(const X509_REQ *req);
 int X509_REQ_extension_nid(int nid);
 int *X509_REQ_get_extension_nids(void);
 void X509_REQ_set_extension_nids(int *nids);
-STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(OSSL_FUTURE_CONST X509_REQ *req);
+STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(const X509_REQ *req);
 int X509_REQ_add_extensions_nid(X509_REQ *req,
     const STACK_OF(X509_EXTENSION) *exts, int nid);
 int X509_REQ_add_extensions(X509_REQ *req, const STACK_OF(X509_EXTENSION) *ext);
@@ -754,9 +759,10 @@ const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl);
 OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl);
 OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl);
 #endif
-X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl);
+const X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl);
 const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl);
-STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl);
+STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(const X509_CRL *crl);
+const X509_ALGOR *X509_CRL_get0_tbs_sigalg(const X509_CRL *crl);
 void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig,
     const X509_ALGOR **palg);
 int X509_CRL_get_signature_nid(const X509_CRL *crl);
@@ -776,24 +782,24 @@ int X509_REQ_check_private_key(const X509_REQ *req, EVP_PKEY *pkey);

 int X509_check_private_key(const X509 *cert, const EVP_PKEY *pkey);
 int X509_chain_check_suiteb(int *perror_depth,
-    X509 *x, STACK_OF(X509) *chain,
+    const X509 *x, STACK_OF(X509) *chain,
     unsigned long flags);
 int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, unsigned long flags);
 void OSSL_STACK_OF_X509_free(STACK_OF(X509) *certs);
 STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain);

 int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b);
-unsigned long X509_issuer_and_serial_hash(X509 *a);
+unsigned long X509_issuer_and_serial_hash(const X509 *a);

 int X509_issuer_name_cmp(const X509 *a, const X509 *b);
-unsigned long X509_issuer_name_hash(X509 *a);
+unsigned long X509_issuer_name_hash(const X509 *a);

 int X509_subject_name_cmp(const X509 *a, const X509 *b);
-unsigned long X509_subject_name_hash(X509 *x);
+unsigned long X509_subject_name_hash(const X509 *x);

 #ifndef OPENSSL_NO_MD5
-unsigned long X509_issuer_name_hash_old(X509 *a);
-unsigned long X509_subject_name_hash_old(X509 *x);
+unsigned long X509_issuer_name_hash_old(const X509 *a);
+unsigned long X509_subject_name_hash_old(const X509 *x);
 #endif

 #define X509_ADD_FLAG_DEFAULT 0
@@ -801,8 +807,8 @@ unsigned long X509_subject_name_hash_old(X509 *x);
 #define X509_ADD_FLAG_PREPEND 0x2
 #define X509_ADD_FLAG_NO_DUP 0x4
 #define X509_ADD_FLAG_NO_SS 0x8
-int X509_add_cert(STACK_OF(X509) *sk, X509 *cert, int flags);
-int X509_add_certs(STACK_OF(X509) *sk, STACK_OF(X509) *certs, int flags);
+int X509_add_cert(STACK_OF(X509) *sk, const X509 *cert, int flags);
+int X509_add_certs(STACK_OF(X509) *sk, const STACK_OF(X509) *certs, int flags);

 int X509_cmp(const X509 *a, const X509 *b);
 int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);
@@ -817,35 +823,32 @@ unsigned long X509_NAME_hash_old(const X509_NAME *x);

 int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
 int X509_CRL_match(const X509_CRL *a, const X509_CRL *b);
-int X509_aux_print(BIO *out, X509 *x, int indent);
+int X509_aux_print(BIO *out, const X509 *x, int indent);
 #ifndef OPENSSL_NO_STDIO
-int X509_print_ex_fp(FILE *bp, X509 *x, unsigned long nmflag,
-    unsigned long cflag);
-int X509_print_fp(FILE *bp, X509 *x);
+int X509_print_ex_fp(FILE *bp, const X509 *x, unsigned long nmflag, unsigned long cflag);
+int X509_print_fp(FILE *bp, const X509 *x);
 int X509_CRL_print_fp(FILE *bp, X509_CRL *x);
-int X509_REQ_print_fp(FILE *bp, X509_REQ *req);
-int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent,
-    unsigned long flags);
+int X509_REQ_print_fp(FILE *bp, const X509_REQ *req);
+int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent, unsigned long flags);
 #endif

 int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase);
-int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent,
-    unsigned long flags);
-int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflag,
-    unsigned long cflag);
-int X509_print(BIO *bp, X509 *x);
-int X509_ocspid_print(BIO *bp, X509 *x);
-int X509_CRL_print_ex(BIO *out, X509_CRL *x, unsigned long nmflag);
-int X509_CRL_print(BIO *bp, X509_CRL *x);
-int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag,
-    unsigned long cflag);
-int X509_REQ_print(BIO *bp, X509_REQ *req);
+int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent, unsigned long flags);
+int X509_print_ex(BIO *bp, const X509 *x, unsigned long nmflag, unsigned long cflag);
+int X509_print(BIO *bp, const X509 *x);
+int X509_ocspid_print(BIO *bp, const X509 *x);
+int X509_CRL_print_ex(BIO *out, const X509_CRL *x, unsigned long nmflag);
+int X509_CRL_print(BIO *bp, const X509_CRL *x);
+int X509_REQ_print_ex(BIO *bp, const X509_REQ *x, unsigned long nmflag, unsigned long cflag);
+int X509_REQ_print(BIO *bp, const X509_REQ *req);

 int X509_NAME_entry_count(const X509_NAME *name);
-int X509_NAME_get_text_by_NID(const X509_NAME *name, int nid,
-    char *buf, int len);
-int X509_NAME_get_text_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
-    char *buf, int len);
+#if !defined(OPENSSL_NO_DEPRECATED_4_0)
+OSSL_DEPRECATEDIN_4_0 int X509_NAME_get_text_by_NID(const X509_NAME *name,
+    int nid, char *buf, int len);
+OSSL_DEPRECATEDIN_4_0 int X509_NAME_get_text_by_OBJ(const X509_NAME *name,
+    const ASN1_OBJECT *obj, char *buf, int len);
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_0) */

 /*
  * NOTE: you should be passing -1, not 0 as lastpos. The functions that use
@@ -854,7 +857,7 @@ int X509_NAME_get_text_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
 int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, int lastpos);
 int X509_NAME_get_index_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
     int lastpos);
-X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc);
+const X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc);
 X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc);
 int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne,
     int loc, int set);
@@ -882,8 +885,8 @@ X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
 int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, const ASN1_OBJECT *obj);
 int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
     const unsigned char *bytes, int len);
-ASN1_OBJECT *X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne);
-ASN1_STRING *X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne);
+const ASN1_OBJECT *X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne);
+const ASN1_STRING *X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne);
 int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne);

 int X509_NAME_get0_der(const X509_NAME *nm, const unsigned char **pder,
@@ -896,10 +899,11 @@ int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x,
     const ASN1_OBJECT *obj, int lastpos);
 int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x,
     int crit, int lastpos);
-X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc);
+const X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc);
 X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc);
+X509_EXTENSION *X509v3_delete_extension(STACK_OF(X509_EXTENSION) **x, int loc);
 STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
-    X509_EXTENSION *ex, int loc);
+    const X509_EXTENSION *ex, int loc);
 STACK_OF(X509_EXTENSION) *X509v3_add_extensions(STACK_OF(X509_EXTENSION) **target,
     const STACK_OF(X509_EXTENSION) *exts);

@@ -907,9 +911,9 @@ int X509_get_ext_count(const X509 *x);
 int X509_get_ext_by_NID(const X509 *x, int nid, int lastpos);
 int X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, int lastpos);
 int X509_get_ext_by_critical(const X509 *x, int crit, int lastpos);
-X509_EXTENSION *X509_get_ext(const X509 *x, int loc);
+const X509_EXTENSION *X509_get_ext(const X509 *x, int loc);
 X509_EXTENSION *X509_delete_ext(X509 *x, int loc);
-int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);
+int X509_add_ext(X509 *x, const X509_EXTENSION *ex, int loc);
 void *X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx);
 int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
     unsigned long flags);
@@ -919,9 +923,9 @@ int X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, int lastpos);
 int X509_CRL_get_ext_by_OBJ(const X509_CRL *x, const ASN1_OBJECT *obj,
     int lastpos);
 int X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, int lastpos);
-X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc);
+const X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc);
 X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc);
-int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);
+int X509_CRL_add_ext(X509_CRL *x, const X509_EXTENSION *ex, int loc);
 void *X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, int *idx);
 int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
     unsigned long flags);
@@ -932,7 +936,7 @@ int X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, const ASN1_OBJECT *obj,
     int lastpos);
 int X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x, int crit,
     int lastpos);
-X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *x, int loc);
+const X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *x, int loc);
 X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc);
 int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc);
 void *X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid, int *crit,
@@ -948,9 +952,9 @@ X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
     ASN1_OCTET_STRING *data);
 int X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj);
 int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
-int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data);
-ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex);
-ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
+int X509_EXTENSION_set_data(X509_EXTENSION *ex, const ASN1_OCTET_STRING *data);
+const ASN1_OBJECT *X509_EXTENSION_get_object(const X509_EXTENSION *ex);
+const ASN1_OCTET_STRING *X509_EXTENSION_get_data(const X509_EXTENSION *ne);
 int X509_EXTENSION_get_critical(const X509_EXTENSION *ex);

 int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x);
@@ -979,7 +983,7 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE)
     int type,
     const unsigned char *bytes,
     int len);
-void *X509at_get0_data_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *x,
+const void *X509at_get0_data_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *x,
     const ASN1_OBJECT *obj, int lastpos, int type);
 X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
     int atrtype, const void *data,
@@ -995,11 +999,11 @@ X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
 int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj);
 int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,
     const void *data, int len);
-void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype,
-    void *data);
+const void *X509_ATTRIBUTE_get0_data(const X509_ATTRIBUTE *attr, int idx,
+    int atrtype, void *data);
 int X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr);
-ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr);
-ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx);
+const ASN1_OBJECT *X509_ATTRIBUTE_get0_object(const X509_ATTRIBUTE *attr);
+const ASN1_TYPE *X509_ATTRIBUTE_get0_type(const X509_ATTRIBUTE *attr, int idx);

 int EVP_PKEY_get_attr_count(const EVP_PKEY *key);
 int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos);
@@ -1019,9 +1023,9 @@ int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key,
     const unsigned char *bytes, int len);

 /* lookup a cert from a X509 STACK */
-X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, const X509_NAME *name,
+X509 *X509_find_by_issuer_and_serial(const STACK_OF(X509) *sk, const X509_NAME *name,
     const ASN1_INTEGER *serial);
-X509 *X509_find_by_subject(STACK_OF(X509) *sk, const X509_NAME *name);
+X509 *X509_find_by_subject(const STACK_OF(X509) *sk, const X509_NAME *name);

 DECLARE_ASN1_FUNCTIONS(PBEPARAM)
 DECLARE_ASN1_FUNCTIONS(PBE2PARAM)
diff --git a/deps/openssl/openssl/include/openssl/x509_acert.h b/deps/openssl/openssl/include/openssl/x509_acert.h
deleted file mode 100644
index 331904d4184..00000000000
--- a/deps/openssl/openssl/include/openssl/x509_acert.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/x509_acert.h"
diff --git a/deps/openssl/openssl/include/openssl/x509_vfy.h b/deps/openssl/openssl/include/openssl/x509_vfy.h
deleted file mode 100644
index 9270a3ee097..00000000000
--- a/deps/openssl/openssl/include/openssl/x509_vfy.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/x509_vfy.h"
diff --git a/deps/openssl/openssl/include/openssl/x509_vfy.h.in b/deps/openssl/openssl/include/openssl/x509_vfy.h.in
index ce9d7bb9b1d..1d20703a76f 100644
--- a/deps/openssl/openssl/include/openssl/x509_vfy.h.in
+++ b/deps/openssl/openssl/include/openssl/x509_vfy.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -41,6 +41,8 @@ use OpenSSL::stackhash qw(generate_stack_macros);
 extern "C" {
 #endif

+DEFINE_STACK_OF(OCSP_RESPONSE)
+
 /*-
 SSL_CTX -> X509_STORE
                 -> X509_LOOKUP
@@ -81,7 +83,7 @@ typedef enum {
 typedef struct x509_trust_st {
     int trust;
     int flags;
-    int (*check_trust)(struct x509_trust_st *, X509 *, int);
+    int (*check_trust)(struct x509_trust_st *, const X509 *, int);
     char *name;
     int arg1;
     void *arg2;
@@ -125,7 +127,7 @@ int X509_TRUST_set(int *t, int trust);
 int X509_TRUST_get_count(void);
 X509_TRUST *X509_TRUST_get0(int idx);
 int X509_TRUST_get_by_id(int id);
-int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),
+int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, const X509 *, int),
     const char *name, int arg1, void *arg2);
 void X509_TRUST_cleanup(void);
 int X509_TRUST_get_flags(const X509_TRUST *xp);
@@ -137,16 +139,16 @@ int X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj);
 int X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj);
 void X509_trust_clear(X509 *x);
 void X509_reject_clear(X509 *x);
-STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(X509 *x);
-STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(X509 *x);
+const STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(const X509 *x);
+const STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(const X509 *x);

-int (*X509_TRUST_set_default(int (*trust)(int, X509 *, int)))(int, X509 *,
+int (*X509_TRUST_set_default(int (*trust)(int, const X509 *, int)))(int, const X509 *,
     int);
-int X509_check_trust(X509 *x, int id, int flags);
+int X509_check_trust(const X509 *x, int id, int flags);

 int X509_verify_cert(X509_STORE_CTX *ctx);
 int X509_STORE_CTX_verify(X509_STORE_CTX *ctx);
-STACK_OF(X509) *X509_build_chain(X509 *target, STACK_OF(X509) *certs,
+STACK_OF(X509) *X509_build_chain(const X509 *target, STACK_OF(X509) *certs,
     X509_STORE *store, int with_self_signed,
     OSSL_LIB_CTX *libctx, const char *propq);

@@ -156,9 +158,9 @@ typedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *);
 int X509_STORE_CTX_print_verify_cb(int ok, X509_STORE_CTX *ctx);
 typedef int (*X509_STORE_CTX_verify_fn)(X509_STORE_CTX *);
 typedef int (*X509_STORE_CTX_get_issuer_fn)(X509 **issuer,
-    X509_STORE_CTX *ctx, X509 *x);
+    X509_STORE_CTX *ctx, const X509 *x);
 typedef int (*X509_STORE_CTX_check_issued_fn)(X509_STORE_CTX *ctx,
-    X509 *x, X509 *issuer);
+    const X509 *x, const X509 *issuer);
 typedef int (*X509_STORE_CTX_check_revocation_fn)(X509_STORE_CTX *ctx);
 typedef int (*X509_STORE_CTX_get_crl_fn)(X509_STORE_CTX *ctx,
     X509_CRL **crl, X509 *x);
@@ -167,7 +169,7 @@ typedef int (*X509_STORE_CTX_cert_crl_fn)(X509_STORE_CTX *ctx,
     X509_CRL *crl, X509 *x);
 typedef int (*X509_STORE_CTX_check_policy_fn)(X509_STORE_CTX *ctx);
 typedef STACK_OF(X509)
-    *(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx,
+    *(*X509_STORE_CTX_lookup_certs_fn)(const X509_STORE_CTX *ctx,
         const X509_NAME *nm);
 typedef STACK_OF(X509_CRL)
     *(*X509_STORE_CTX_lookup_crls_fn)(const X509_STORE_CTX *ctx,
@@ -323,6 +325,20 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
 #define X509_V_ERR_EC_KEY_EXPLICIT_PARAMS 94
 #define X509_V_ERR_RPK_UNTRUSTED 95

+/* additional OCSP status errors */
+#define X509_V_ERR_OCSP_RESP_INVALID 96
+#define X509_V_ERR_OCSP_SIGNATURE_FAILURE 97
+#define X509_V_ERR_OCSP_NOT_YET_VALID 98
+#define X509_V_ERR_OCSP_HAS_EXPIRED 99
+#define X509_V_ERR_OCSP_NO_RESPONSE 100
+#define X509_V_ERR_CRL_VERIFY_FAILED 101
+
+/* additional AKID errors */
+#define X509_V_ERR_EMPTY_AUTHORITY_KEY_IDENTIFIER 102
+#define X509_V_ERR_AKID_ISSUER_SERIAL_NOT_PAIRED 103
+
+#define X509_V_ERR_DUPLICATE_EXTENSION 104
+
 /* Certificate verify flags */
 #ifndef OPENSSL_NO_DEPRECATED_1_1_0
 #define X509_V_FLAG_CB_ISSUER_CHECK 0x0 /* Deprecated */
@@ -374,6 +390,11 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
 /* Do not check certificate/CRL validity against current time */
 #define X509_V_FLAG_NO_CHECK_TIME 0x200000

+/* Verify OCSP stapling response for server certificate */
+#define X509_V_FLAG_OCSP_RESP_CHECK 0x400000
+/* Verify OCSP stapling responses for whole chain */
+#define X509_V_FLAG_OCSP_RESP_CHECK_ALL 0x800000
+
 #define X509_VP_FLAG_DEFAULT 0x1
 #define X509_VP_FLAG_OVERWRITE 0x2
 #define X509_VP_FLAG_RESET_FLAGS 0x4
@@ -406,10 +427,13 @@ void X509_STORE_free(X509_STORE *xs);
 int X509_STORE_lock(X509_STORE *xs);
 int X509_STORE_unlock(X509_STORE *xs);
 int X509_STORE_up_ref(X509_STORE *xs);
+#ifndef OPENSSL_NO_DEPRECATED_4_0
+OSSL_DEPRECATEDIN_4_0_FOR("use X509_STORE_get1_objects()")
 STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(const X509_STORE *xs);
+#endif
 STACK_OF(X509_OBJECT) *X509_STORE_get1_objects(X509_STORE *xs);
 STACK_OF(X509) *X509_STORE_get1_all_certs(X509_STORE *xs);
-STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *xs,
+STACK_OF(X509) *X509_STORE_CTX_get1_certs(const X509_STORE_CTX *xs,
     const X509_NAME *nm);
 STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(const X509_STORE_CTX *st,
     const X509_NAME *nm);
@@ -472,11 +496,11 @@ void *X509_STORE_get_ex_data(const X509_STORE *xs, int idx);
 X509_STORE_CTX *X509_STORE_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
 X509_STORE_CTX *X509_STORE_CTX_new(void);

-int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
+int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, const X509 *x);

 void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
 int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *trust_store,
-    X509 *target, STACK_OF(X509) *untrusted);
+    const X509 *target, STACK_OF(X509) *untrusted);
 int X509_STORE_CTX_init_rpk(X509_STORE_CTX *ctx, X509_STORE *trust_store,
     EVP_PKEY *rpk);
 void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
@@ -597,7 +621,7 @@ int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method,
 X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias(
     const X509_LOOKUP_METHOD *method);

-int X509_STORE_add_cert(X509_STORE *xs, X509 *x);
+int X509_STORE_add_cert(X509_STORE *xs, const X509 *x);
 int X509_STORE_add_crl(X509_STORE *xs, X509_CRL *x);

 int X509_STORE_CTX_get_by_subject(const X509_STORE_CTX *vs,
@@ -677,6 +701,9 @@ void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *target);
 void X509_STORE_CTX_set0_rpk(X509_STORE_CTX *ctx, EVP_PKEY *target);
 void X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk);
 void X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk);
+#ifndef OPENSSL_NO_OCSP
+void X509_STORE_CTX_set_ocsp_resp(X509_STORE_CTX *ctx, STACK_OF(OCSP_RESPONSE) *sk);
+#endif
 int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);
 int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust);
 int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
@@ -737,6 +764,8 @@ int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
     const char *name, size_t namelen);
 int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
     const char *name, size_t namelen);
+void X509_VERIFY_PARAM_set1_host_input_validation(X509_VERIFY_PARAM *param,
+    int (*validate_host)(const char *name, size_t len));
 void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
     unsigned int flags);
 unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param);
@@ -745,11 +774,29 @@ void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *);
 char *X509_VERIFY_PARAM_get0_email(X509_VERIFY_PARAM *param);
 int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
     const char *email, size_t emaillen);
+int X509_VERIFY_PARAM_set1_rfc822(X509_VERIFY_PARAM *param,
+    const char *email, size_t emaillen);
+int X509_VERIFY_PARAM_add1_rfc822(X509_VERIFY_PARAM *param,
+    const char *email, size_t len);
+void X509_VERIFY_PARAM_set1_rfc822_input_validation(X509_VERIFY_PARAM *param,
+    int (*validate_rfc822)(const char *name, size_t len));
+int X509_VERIFY_PARAM_set1_smtputf8(X509_VERIFY_PARAM *param,
+    const char *email, size_t emaillen);
+int X509_VERIFY_PARAM_add1_smtputf8(X509_VERIFY_PARAM *param,
+    const char *email, size_t len);
+void X509_VERIFY_PARAM_set1_smtputf8_input_validation(X509_VERIFY_PARAM *param,
+    int (*validate_smtputf8)(const char *name, size_t len));
 char *X509_VERIFY_PARAM_get1_ip_asc(X509_VERIFY_PARAM *param);
 int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
-    const unsigned char *ip, size_t iplen);
+    const uint8_t *ip, size_t iplen);
+void X509_VERIFY_PARAM_set1_ip_input_validation(X509_VERIFY_PARAM *param,
+    int (*validate_ip)(const uint8_t *name, size_t len));
 int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param,
     const char *ipasc);
+int X509_VERIFY_PARAM_add1_ip(X509_VERIFY_PARAM *param,
+    const uint8_t *ip, size_t len);
+int X509_VERIFY_PARAM_add1_ip_asc(X509_VERIFY_PARAM *param,
+    const char *ipasc);

 int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param);
 int X509_VERIFY_PARAM_get_auth_level(const X509_VERIFY_PARAM *param);
diff --git a/deps/openssl/openssl/include/openssl/x509err.h b/deps/openssl/openssl/include/openssl/x509err.h
deleted file mode 100644
index 4bbff54a380..00000000000
--- a/deps/openssl/openssl/include/openssl/x509err.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_X509ERR_H
-#define OPENSSL_X509ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * X509 reason codes.
- */
-#define X509_R_AKID_MISMATCH 110
-#define X509_R_BAD_SELECTOR 133
-#define X509_R_BAD_X509_FILETYPE 100
-#define X509_R_BASE64_DECODE_ERROR 118
-#define X509_R_CANT_CHECK_DH_KEY 114
-#define X509_R_CERTIFICATE_VERIFICATION_FAILED 139
-#define X509_R_CERT_ALREADY_IN_HASH_TABLE 101
-#define X509_R_CRL_ALREADY_DELTA 127
-#define X509_R_CRL_SIGNATURE_ALGORITHM_MISMATCH 147
-#define X509_R_CRL_VERIFY_FAILURE 131
-#define X509_R_DUPLICATE_ATTRIBUTE 140
-#define X509_R_ERROR_GETTING_MD_BY_NID 141
-#define X509_R_ERROR_USING_SIGINF_SET 142
-#define X509_R_IDP_MISMATCH 128
-#define X509_R_INVALID_ATTRIBUTES 138
-#define X509_R_INVALID_DIRECTORY 113
-#define X509_R_INVALID_DISTPOINT 143
-#define X509_R_INVALID_FIELD_NAME 119
-#define X509_R_INVALID_TRUST 123
-#define X509_R_ISSUER_MISMATCH 129
-#define X509_R_KEY_TYPE_MISMATCH 115
-#define X509_R_KEY_VALUES_MISMATCH 116
-#define X509_R_LOADING_CERT_DIR 103
-#define X509_R_LOADING_DEFAULTS 104
-#define X509_R_METHOD_NOT_SUPPORTED 124
-#define X509_R_NAME_TOO_LONG 134
-#define X509_R_NEWER_CRL_NOT_NEWER 132
-#define X509_R_NO_CERTIFICATE_FOUND 135
-#define X509_R_NO_CERTIFICATE_OR_CRL_FOUND 136
-#define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105
-#define X509_R_NO_CRL_FOUND 137
-#define X509_R_NO_CRL_NUMBER 130
-#define X509_R_PUBLIC_KEY_DECODE_ERROR 125
-#define X509_R_PUBLIC_KEY_ENCODE_ERROR 126
-#define X509_R_SHOULD_RETRY 106
-#define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107
-#define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108
-#define X509_R_UNKNOWN_KEY_TYPE 117
-#define X509_R_UNKNOWN_NID 109
-#define X509_R_UNKNOWN_PURPOSE_ID 121
-#define X509_R_UNKNOWN_SIGID_ALGS 144
-#define X509_R_UNKNOWN_TRUST_ID 120
-#define X509_R_UNSUPPORTED_ALGORITHM 111
-#define X509_R_UNSUPPORTED_VERSION 145
-#define X509_R_WRONG_LOOKUP_TYPE 112
-#define X509_R_WRONG_TYPE 122
-
-#endif
diff --git a/deps/openssl/openssl/include/openssl/x509v3.h b/deps/openssl/openssl/include/openssl/x509v3.h
deleted file mode 100644
index 5629ae9a3a9..00000000000
--- a/deps/openssl/openssl/include/openssl/x509v3.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../config/x509v3.h"
diff --git a/deps/openssl/openssl/include/openssl/x509v3.h.in b/deps/openssl/openssl/include/openssl/x509v3.h.in
index 29231d22dec..21def64b947 100644
--- a/deps/openssl/openssl/include/openssl/x509v3.h.in
+++ b/deps/openssl/openssl/include/openssl/x509v3.h.in
@@ -1,7 +1,7 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -443,11 +443,20 @@ struct ISSUING_DIST_POINT_st {
 #define EXFLAG_FRESHEST 0x1000
 #define EXFLAG_SS 0x2000 /* cert is apparently self-signed */

+#define EXFLAG_NO_FINGERPRINT 0x100000
+
+/*
+ * The following flags are no longer used. On X509_V_FLAG_X509_STRICT they were
+ * previously enforced as checks on critical extensions but this behavior has
+ * been removed.
+ */
 #define EXFLAG_BCONS_CRITICAL 0x10000
 #define EXFLAG_AKID_CRITICAL 0x20000
 #define EXFLAG_SKID_CRITICAL 0x40000
 #define EXFLAG_SAN_CRITICAL 0x80000
-#define EXFLAG_NO_FINGERPRINT 0x100000
+
+/* A certificate MUST NOT include more than one instance of an extension. */
+#define EXFLAG_DUPLICATE 0x200000

 /* https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.3 */
 #define KU_DIGITAL_SIGNATURE X509v3_KU_DIGITAL_SIGNATURE
@@ -621,8 +630,8 @@ DECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT)

 int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, const X509_NAME *iname);

-int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc);
-int NAME_CONSTRAINTS_check_CN(X509 *x, NAME_CONSTRAINTS *nc);
+int NAME_CONSTRAINTS_check(const X509 *x, NAME_CONSTRAINTS *nc);
+int NAME_CONSTRAINTS_check_CN(const X509 *x, NAME_CONSTRAINTS *nc);

 DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION)
 DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS)
@@ -715,11 +724,11 @@ int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist);
 int X509V3_EXT_add_alias(int nid_to, int nid_from);
 void X509V3_EXT_cleanup(void);

-const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext);
+const X509V3_EXT_METHOD *X509V3_EXT_get(const X509_EXTENSION *ext);
 const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid);
 int X509V3_add_standard_extensions(void);
 STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line);
-void *X509V3_EXT_d2i(X509_EXTENSION *ext);
+void *X509V3_EXT_d2i(const X509_EXTENSION *ext);
 void *X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x, int nid, int *crit,
     int *idx);

@@ -735,31 +744,31 @@ int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value,

 void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,
     int ml);
-int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag,
+int X509V3_EXT_print(BIO *out, const X509_EXTENSION *ext, unsigned long flag,
     int indent);
 #ifndef OPENSSL_NO_STDIO
-int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent);
+int X509V3_EXT_print_fp(FILE *out, const X509_EXTENSION *ext, int flag, int indent);
 #endif
 int X509V3_extensions_print(BIO *out, const char *title,
     const STACK_OF(X509_EXTENSION) *exts,
     unsigned long flag, int indent);

-int X509_check_ca(X509 *x);
-int X509_check_purpose(X509 *x, int id, int ca);
-int X509_supported_extension(X509_EXTENSION *ex);
-int X509_check_issued(X509 *issuer, X509 *subject);
+int X509_check_ca(const X509 *x);
+int X509_check_purpose(const X509 *x, int id, int ca);
+int X509_supported_extension(const X509_EXTENSION *ex);
+int X509_check_issued(const X509 *issuer, const X509 *subject);
 int X509_check_akid(const X509 *issuer, const AUTHORITY_KEYID *akid);
 void X509_set_proxy_flag(X509 *x);
 void X509_set_proxy_pathlen(X509 *x, long l);
-long X509_get_proxy_pathlen(X509 *x);
+long X509_get_proxy_pathlen(const X509 *x);

-uint32_t X509_get_extension_flags(X509 *x);
-uint32_t X509_get_key_usage(X509 *x);
-uint32_t X509_get_extended_key_usage(X509 *x);
-const ASN1_OCTET_STRING *X509_get0_subject_key_id(X509 *x);
-const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x);
-const GENERAL_NAMES *X509_get0_authority_issuer(X509 *x);
-const ASN1_INTEGER *X509_get0_authority_serial(X509 *x);
+uint32_t X509_get_extension_flags(const X509 *x);
+uint32_t X509_get_key_usage(const X509 *x);
+uint32_t X509_get_extended_key_usage(const X509 *x);
+const ASN1_OCTET_STRING *X509_get0_subject_key_id(const X509 *x);
+const ASN1_OCTET_STRING *X509_get0_authority_key_id(const X509 *x);
+const GENERAL_NAMES *X509_get0_authority_issuer(const X509 *x);
+const ASN1_INTEGER *X509_get0_authority_serial(const X509 *x);

 int X509_PURPOSE_get_count(void);
 int X509_PURPOSE_get_unused_id(OSSL_LIB_CTX *libctx);
@@ -777,10 +786,10 @@ char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp);
 int X509_PURPOSE_get_trust(const X509_PURPOSE *xp);
 int X509_PURPOSE_set(int *p, int purpose);

-STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x);
-STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x);
+STACK_OF(OPENSSL_STRING) *X509_get1_email(const X509 *x);
+STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(const X509_REQ *x);
 void X509_email_free(STACK_OF(OPENSSL_STRING) *sk);
-STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x);
+STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(const X509 *x);

 /* Flags for X509_check_* functions */

@@ -805,13 +814,15 @@ STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x);
  */
 #define _X509_CHECK_FLAG_DOT_SUBDOMAINS 0x8000

-int X509_check_host(X509 *x, const char *chk, size_t chklen,
+#if !defined(OPENSSL_NO_DEPRECATED_4_1)
+OSSL_DEPRECATEDIN_4_1 int X509_check_host(const X509 *x, const char *chk, size_t chklen,
     unsigned int flags, char **peername);
-int X509_check_email(X509 *x, const char *chk, size_t chklen,
+OSSL_DEPRECATEDIN_4_1 int X509_check_email(const X509 *x, const char *chk, size_t chklen,
     unsigned int flags);
-int X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen,
+OSSL_DEPRECATEDIN_4_1 int X509_check_ip(const X509 *x, const unsigned char *chk, size_t chklen,
     unsigned int flags);
-int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags);
+OSSL_DEPRECATEDIN_4_1 int X509_check_ip_asc(const X509 *x, const char *ipasc, unsigned int flags);
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_1) */

 ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc);
 ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc);
@@ -922,7 +933,7 @@ DECLARE_ASN1_FUNCTIONS(IPAddressChoice)
 DECLARE_ASN1_FUNCTIONS(IPAddressFamily)

 /*
- * API tag for elements of the ASIdentifer SEQUENCE.
+ * API tag for elements of the ASIdentifier SEQUENCE.
  */
 #define V3_ASID_ASNUM 0
 #define V3_ASID_RDI 1
@@ -945,17 +956,17 @@ int X509v3_asid_add_inherit(ASIdentifiers *asid, int which);
 int X509v3_asid_add_id_or_range(ASIdentifiers *asid, int which,
     ASN1_INTEGER *min, ASN1_INTEGER *max);
 int X509v3_addr_add_inherit(IPAddrBlocks *addr,
-    const unsigned afi, const unsigned *safi);
+    unsigned afi, const unsigned *safi);
 int X509v3_addr_add_prefix(IPAddrBlocks *addr,
-    const unsigned afi, const unsigned *safi,
+    unsigned afi, const unsigned *safi,
     unsigned char *a, const int prefixlen);
 int X509v3_addr_add_range(IPAddrBlocks *addr,
-    const unsigned afi, const unsigned *safi,
+    unsigned afi, const unsigned *safi,
     unsigned char *min, unsigned char *max);
 unsigned X509v3_addr_get_afi(const IPAddressFamily *f);
-int X509v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi,
+int X509v3_addr_get_range(IPAddressOrRange *aor, unsigned afi,
     unsigned char *min, unsigned char *max,
-    const int length);
+    int length);

 /*
  * Canonical forms.
@@ -978,10 +989,10 @@ int X509v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b);
  */
 int X509v3_asid_validate_path(X509_STORE_CTX *);
 int X509v3_addr_validate_path(X509_STORE_CTX *);
-int X509v3_asid_validate_resource_set(STACK_OF(X509) *chain,
+int X509v3_asid_validate_resource_set(const STACK_OF(X509) *chain,
     ASIdentifiers *ext,
     int allow_inheritance);
-int X509v3_addr_validate_resource_set(STACK_OF(X509) *chain,
+int X509v3_addr_validate_resource_set(const STACK_OF(X509) *chain,
     IPAddrBlocks *ext, int allow_inheritance);

 #endif /* OPENSSL_NO_RFC3779 */
diff --git a/deps/openssl/openssl/include/openssl/x509v3err.h b/deps/openssl/openssl/include/openssl/x509v3err.h
deleted file mode 100644
index 19f938626bd..00000000000
--- a/deps/openssl/openssl/include/openssl/x509v3err.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_X509V3ERR_H
-#define OPENSSL_X509V3ERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-#include <openssl/cryptoerr_legacy.h>
-
-/*
- * X509V3 reason codes.
- */
-#define X509V3_R_BAD_IP_ADDRESS 118
-#define X509V3_R_BAD_OBJECT 119
-#define X509V3_R_BAD_OPTION 170
-#define X509V3_R_BAD_VALUE 171
-#define X509V3_R_BN_DEC2BN_ERROR 100
-#define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101
-#define X509V3_R_DIRNAME_ERROR 149
-#define X509V3_R_DISTPOINT_ALREADY_SET 160
-#define X509V3_R_DUPLICATE_ZONE_ID 133
-#define X509V3_R_EMPTY_KEY_USAGE 169
-#define X509V3_R_ERROR_CONVERTING_ZONE 131
-#define X509V3_R_ERROR_CREATING_EXTENSION 144
-#define X509V3_R_ERROR_IN_EXTENSION 128
-#define X509V3_R_EXPECTED_A_SECTION_NAME 137
-#define X509V3_R_EXTENSION_EXISTS 145
-#define X509V3_R_EXTENSION_NAME_ERROR 115
-#define X509V3_R_EXTENSION_NOT_FOUND 102
-#define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103
-#define X509V3_R_EXTENSION_VALUE_ERROR 116
-#define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151
-#define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152
-#define X509V3_R_INVALID_ASNUMBER 162
-#define X509V3_R_INVALID_ASRANGE 163
-#define X509V3_R_INVALID_BOOLEAN_STRING 104
-#define X509V3_R_INVALID_CERTIFICATE 158
-#define X509V3_R_INVALID_EMPTY_NAME 108
-#define X509V3_R_INVALID_EXTENSION_STRING 105
-#define X509V3_R_INVALID_INHERITANCE 165
-#define X509V3_R_INVALID_IPADDRESS 166
-#define X509V3_R_INVALID_MULTIPLE_RDNS 161
-#define X509V3_R_INVALID_NAME 106
-#define X509V3_R_INVALID_NULL_ARGUMENT 107
-#define X509V3_R_INVALID_NULL_VALUE 109
-#define X509V3_R_INVALID_NUMBER 140
-#define X509V3_R_INVALID_NUMBERS 141
-#define X509V3_R_INVALID_OBJECT_IDENTIFIER 110
-#define X509V3_R_INVALID_OPTION 138
-#define X509V3_R_INVALID_POLICY_IDENTIFIER 134
-#define X509V3_R_INVALID_PROXY_POLICY_SETTING 153
-#define X509V3_R_INVALID_PURPOSE 146
-#define X509V3_R_INVALID_SAFI 164
-#define X509V3_R_INVALID_SECTION 135
-#define X509V3_R_INVALID_SYNTAX 143
-#define X509V3_R_ISSUER_DECODE_ERROR 126
-#define X509V3_R_MISSING_VALUE 124
-#define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 142
-#define X509V3_R_NEGATIVE_PATHLEN 168
-#define X509V3_R_NO_CONFIG_DATABASE 136
-#define X509V3_R_NO_ISSUER_CERTIFICATE 121
-#define X509V3_R_NO_ISSUER_DETAILS 127
-#define X509V3_R_NO_POLICY_IDENTIFIER 139
-#define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 154
-#define X509V3_R_NO_PUBLIC_KEY 114
-#define X509V3_R_NO_SUBJECT_DETAILS 125
-#define X509V3_R_OPERATION_NOT_DEFINED 148
-#define X509V3_R_OTHERNAME_ERROR 147
-#define X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED 155
-#define X509V3_R_POLICY_PATH_LENGTH 156
-#define X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED 157
-#define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159
-#define X509V3_R_PURPOSE_NOT_UNIQUE 173
-#define X509V3_R_SECTION_NOT_FOUND 150
-#define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 122
-#define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 123
-#define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 111
-#define X509V3_R_UNKNOWN_EXTENSION 129
-#define X509V3_R_UNKNOWN_EXTENSION_NAME 130
-#define X509V3_R_UNKNOWN_OPTION 120
-#define X509V3_R_UNKNOWN_VALUE 172
-#define X509V3_R_UNSUPPORTED_OPTION 117
-#define X509V3_R_UNSUPPORTED_TYPE 167
-#define X509V3_R_USER_TOO_LONG 132
-
-#endif
diff --git a/deps/openssl/openssl/ms/applink.c b/deps/openssl/openssl/ms/applink.c
index 40aa9466757..079abb0c957 100644
--- a/deps/openssl/openssl/ms/applink.c
+++ b/deps/openssl/openssl/ms/applink.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -35,6 +35,12 @@

 #ifndef APPMACROS_ONLY

+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
+#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+#endif
+
 /*
  * Normally, do not define APPLINK_NO_INCLUDES.  Define it if you are using
  * symbol preprocessing and do not want the preprocessing to affect the
@@ -97,6 +103,14 @@ static int app_fsetmod(FILE *fp, char mod)
 extern "C" {
 #endif

+/*
+ * The AppLink table exposes the legacy CRT signatures used by ms/uplink.h.
+ */
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4996)
+#endif
+
 __declspec(dllexport) void **
 #if defined(__BORLANDC__)
     /*
@@ -145,6 +159,14 @@ __declspec(dllexport) void **
     return OPENSSL_ApplinkTable;
 }

+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/deps/openssl/openssl/ms/uplink-ia64.pl b/deps/openssl/openssl/ms/uplink-ia64.pl
deleted file mode 100755
index 757e77d29ff..00000000000
--- a/deps/openssl/openssl/ms/uplink-ia64.pl
+++ /dev/null
@@ -1,60 +0,0 @@
-#! /usr/bin/env perl
-# Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
-#
-# Licensed under the Apache License 2.0 (the "License").  You may not use
-# this file except in compliance with the License.  You can obtain a copy
-# in the file LICENSE in the source distribution or at
-# https://www.openssl.org/source/license.html
-
-$output = pop and open STDOUT,">$output";
-
-$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
-push(@INC,"${dir}.");
-
-require "uplink-common.pl";
-
-local $V=8;	# max number of args uplink functions may accept...
-my $loc0 = "r".(32+$V);
-print <<___;
-.text
-.global	OPENSSL_Uplink#
-.type	OPENSSL_Uplink#,\@function
-
-___
-for ($i=1;$i<=$N;$i++) {
-print <<___;
-.proc	lazy$i#
-lazy$i:
-	.prologue
-{ .mii;	.save	ar.pfs,$loc0
-	alloc	loc0=ar.pfs,$V,3,2,0
-	.save	b0,loc1
-	mov	loc1=b0
-	addl	loc2=\@ltoff(OPENSSL_UplinkTable#),gp	};;
-	.body
-{ .mmi;	ld8	out0=[loc2]
-	mov	out1=$i					};;
-{ .mib;	add	loc2=8*$i,out0
-	br.call.sptk.many	b0=OPENSSL_Uplink#	};;
-{ .mmi;	ld8	r31=[loc2];;
-	ld8	r30=[r31],8				};;
-{ .mii;	ld8	gp=[r31]
-	mov	b6=r30
-	mov	b0=loc1					};;
-{ .mib;	mov	ar.pfs=loc0
-	br.many	b6					};;
-.endp	lazy$i#
-
-___
-}
-print <<___;
-.data
-.global OPENSSL_UplinkTable#
-OPENSSL_UplinkTable:    data8   $N      // amount of following entries
-___
-for ($i=1;$i<=$N;$i++) {   print "      data8   \@fptr(lazy$i#)\n";   }
-print <<___;
-.size   OPENSSL_UplinkTable,.-OPENSSL_UplinkTable#
-___
-
-close STDOUT;
diff --git a/deps/openssl/openssl/ms/uplink.c b/deps/openssl/openssl/ms/uplink.c
index dae851e4384..e9511389216 100644
--- a/deps/openssl/openssl/ms/uplink.c
+++ b/deps/openssl/openssl/ms/uplink.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */

-#if (defined(_WIN64) || defined(_WIN32_WCE)) && !defined(UNICODE)
+#if defined(_WIN64) && !defined(UNICODE)
 #define UNICODE
 #endif
 #if defined(UNICODE) && !defined(_UNICODE)
@@ -17,11 +17,19 @@
 #define UNICODE
 #endif

+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wpedantic"
+#pragma GCC diagnostic ignored "-Wcast-function-type"
+#pragma GCC diagnostic ignored "-Wstrict-prototypes"
+#endif
+
 #include <windows.h>
 #include <tchar.h>
 #include <stdio.h>
+#include <stddef.h>
 #include "uplink.h"
 void OPENSSL_showfatal(const char *, ...);
+void OPENSSL_Uplink(volatile void **table, int index);

 static TCHAR msg[128];

@@ -72,7 +80,6 @@ void OPENSSL_Uplink(volatile void **table, int index)

         if (applinktable == NULL) {
             void **(*applink)();
-
             applink = (void **(*)())GetProcAddress(h, "OPENSSL_Applink");
             if (applink == NULL) {
                 apphandle = (HMODULE)-1;
@@ -89,7 +96,7 @@ void OPENSSL_Uplink(volatile void **table, int index)
         } else
             p = applinktable;

-        if (index > (int)p[0])
+        if (index > (intptr_t)p[0])
             break;

         if (p[index])
diff --git a/deps/openssl/openssl/ms/uplink.h b/deps/openssl/openssl/ms/uplink.h
index 06825b68ad5..0de07bf792d 100644
--- a/deps/openssl/openssl/ms/uplink.h
+++ b/deps/openssl/openssl/ms/uplink.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,27 +12,27 @@

 extern void *OPENSSL_UplinkTable[];

-#define UP_stdin (*(void *(*)(void))OPENSSL_UplinkTable[APPLINK_STDIN])()
-#define UP_stdout (*(void *(*)(void))OPENSSL_UplinkTable[APPLINK_STDOUT])()
-#define UP_stderr (*(void *(*)(void))OPENSSL_UplinkTable[APPLINK_STDERR])()
-#define UP_fprintf (*(int (*)(void *, const char *, ...))OPENSSL_UplinkTable[APPLINK_FPRINTF])
-#define UP_fgets (*(char *(*)(char *, int, void *))OPENSSL_UplinkTable[APPLINK_FGETS])
-#define UP_fread (*(size_t (*)(void *, size_t, size_t, void *))OPENSSL_UplinkTable[APPLINK_FREAD])
-#define UP_fwrite (*(size_t (*)(const void *, size_t, size_t, void *))OPENSSL_UplinkTable[APPLINK_FWRITE])
-#define UP_fsetmod (*(int (*)(void *, char))OPENSSL_UplinkTable[APPLINK_FSETMOD])
-#define UP_feof (*(int (*)(void *))OPENSSL_UplinkTable[APPLINK_FEOF])
-#define UP_fclose (*(int (*)(void *))OPENSSL_UplinkTable[APPLINK_FCLOSE])
+#define UP_stdin (*(void *(*)(void))(uintptr_t)OPENSSL_UplinkTable[APPLINK_STDIN])()
+#define UP_stdout (*(void *(*)(void))(uintptr_t)OPENSSL_UplinkTable[APPLINK_STDOUT])()
+#define UP_stderr (*(void *(*)(void))(uintptr_t)OPENSSL_UplinkTable[APPLINK_STDERR])()
+#define UP_fprintf (*(int (*)(void *, const char *, ...))(uintptr_t)OPENSSL_UplinkTable[APPLINK_FPRINTF])
+#define UP_fgets (*(char *(*)(char *, int, void *))(uintptr_t)OPENSSL_UplinkTable[APPLINK_FGETS])
+#define UP_fread (*(size_t (*)(void *, size_t, size_t, void *))(uintptr_t)OPENSSL_UplinkTable[APPLINK_FREAD])
+#define UP_fwrite (*(size_t (*)(const void *, size_t, size_t, void *))(uintptr_t)OPENSSL_UplinkTable[APPLINK_FWRITE])
+#define UP_fsetmod (*(int (*)(void *, char))(uintptr_t)OPENSSL_UplinkTable[APPLINK_FSETMOD])
+#define UP_feof (*(int (*)(void *))(uintptr_t)OPENSSL_UplinkTable[APPLINK_FEOF])
+#define UP_fclose (*(int (*)(void *))(uintptr_t)OPENSSL_UplinkTable[APPLINK_FCLOSE])

-#define UP_fopen (*(void *(*)(const char *, const char *))OPENSSL_UplinkTable[APPLINK_FOPEN])
-#define UP_fseek (*(int (*)(void *, long, int))OPENSSL_UplinkTable[APPLINK_FSEEK])
-#define UP_ftell (*(long (*)(void *))OPENSSL_UplinkTable[APPLINK_FTELL])
-#define UP_fflush (*(int (*)(void *))OPENSSL_UplinkTable[APPLINK_FFLUSH])
-#define UP_ferror (*(int (*)(void *))OPENSSL_UplinkTable[APPLINK_FERROR])
-#define UP_clearerr (*(void (*)(void *))OPENSSL_UplinkTable[APPLINK_CLEARERR])
-#define UP_fileno (*(int (*)(void *))OPENSSL_UplinkTable[APPLINK_FILENO])
+#define UP_fopen (*(void *(*)(const char *, const char *))(uintptr_t)OPENSSL_UplinkTable[APPLINK_FOPEN])
+#define UP_fseek (*(int (*)(void *, long, int))(uintptr_t)OPENSSL_UplinkTable[APPLINK_FSEEK])
+#define UP_ftell (*(long (*)(void *))(uintptr_t)OPENSSL_UplinkTable[APPLINK_FTELL])
+#define UP_fflush (*(int (*)(void *))(uintptr_t)OPENSSL_UplinkTable[APPLINK_FFLUSH])
+#define UP_ferror (*(int (*)(void *))(uintptr_t)OPENSSL_UplinkTable[APPLINK_FERROR])
+#define UP_clearerr (*(void (*)(void *))(uintptr_t)OPENSSL_UplinkTable[APPLINK_CLEARERR])
+#define UP_fileno (*(int (*)(void *))(uintptr_t)OPENSSL_UplinkTable[APPLINK_FILENO])

-#define UP_open (*(int (*)(const char *, int, ...))OPENSSL_UplinkTable[APPLINK_OPEN])
-#define UP_read (*(ossl_ssize_t (*)(int, void *, size_t))OPENSSL_UplinkTable[APPLINK_READ])
-#define UP_write (*(ossl_ssize_t (*)(int, const void *, size_t))OPENSSL_UplinkTable[APPLINK_WRITE])
-#define UP_lseek (*(long (*)(int, long, int))OPENSSL_UplinkTable[APPLINK_LSEEK])
-#define UP_close (*(int (*)(int))OPENSSL_UplinkTable[APPLINK_CLOSE])
+#define UP_open (*(int (*)(const char *, int, ...))(uintptr_t)OPENSSL_UplinkTable[APPLINK_OPEN])
+#define UP_read (*(ossl_ssize_t (*)(int, void *, size_t))(uintptr_t)OPENSSL_UplinkTable[APPLINK_READ])
+#define UP_write (*(ossl_ssize_t (*)(int, const void *, size_t))(uintptr_t)OPENSSL_UplinkTable[APPLINK_WRITE])
+#define UP_lseek (*(long (*)(int, long, int))(uintptr_t)OPENSSL_UplinkTable[APPLINK_LSEEK])
+#define UP_close (*(int (*)(int))(uintptr_t)OPENSSL_UplinkTable[APPLINK_CLOSE])
diff --git a/deps/openssl/openssl/providers/build.info b/deps/openssl/openssl/providers/build.info
index 9277d8fe7d5..2558cd2faa3 100644
--- a/deps/openssl/openssl/providers/build.info
+++ b/deps/openssl/openssl/providers/build.info
@@ -49,7 +49,7 @@ LIBS{noinst}=$LIBDEFAULT $LIBCOMMON
 $COMMON_INCLUDES=../crypto ../include implementations/include common/include \
     fips/include

-INCLUDE[$LIBCOMMON]=$COMMON_INCLUDES
+INCLUDE[$LIBCOMMON]=.. $COMMON_INCLUDES
 INCLUDE[$LIBFIPS]=.. $COMMON_INCLUDES
 INCLUDE[$LIBLEGACY]=.. $COMMON_INCLUDES
 INCLUDE[$LIBDEFAULT]=.. $COMMON_INCLUDES
@@ -67,6 +67,10 @@ SOURCE[$LIBFIPS]=$LIBCOMMON
 DEPEND[$LIBLEGACY]=$LIBCOMMON
 DEPEND[$LIBDEFAULT]=$LIBCOMMON

+IF[{- $target{needs_c99_snprintf_compat} -}]
+  SOURCE[$LIBFIPS]=../crypto/msvc2013_snprintf.c
+ENDIF
+
 #
 # Default provider stuff
 #
@@ -179,4 +183,4 @@ SOURCE[$NULLGOAL]=nullprov.c prov_running.c

 # template library, not used anywhere. It's merely here to ensure that the object files build
 LIBS{noinst}=libtemplate.a
-INCLUDE[libtemplate.a]=$COMMON_INCLUDES
+INCLUDE[libtemplate.a]=.. $COMMON_INCLUDES
diff --git a/deps/openssl/openssl/providers/common/capabilities.c b/deps/openssl/openssl/providers/common/capabilities.c
index 48bc7eb79d4..1f281695f9c 100644
--- a/deps/openssl/openssl/providers/common/capabilities.c
+++ b/deps/openssl/openssl/providers/common/capabilities.c
@@ -16,6 +16,7 @@
 #include <openssl/params.h>
 #include "internal/nelem.h"
 #include "internal/tlsgroups.h"
+#include "internal/tlssigalgs.h"
 #include "prov/providercommon.h"
 #include "internal/e_os.h"
 #include "crypto/ml_kem.h"
@@ -77,20 +78,22 @@ static const TLS_GROUP_CONSTANTS group_list[] = {
     /* 27 */ { OSSL_TLS_GROUP_ID_brainpoolP512r1, 256, TLS1_VERSION, TLS1_2_VERSION, DTLS1_VERSION, DTLS1_2_VERSION, 0 },
     /* 28 */ { OSSL_TLS_GROUP_ID_x25519, 128, TLS1_VERSION, 0, DTLS1_VERSION, 0, 0 },
     /* 29 */ { OSSL_TLS_GROUP_ID_x448, 224, TLS1_VERSION, 0, DTLS1_VERSION, 0, 0 },
-    /* 30 */ { OSSL_TLS_GROUP_ID_brainpoolP256r1_tls13, 128, TLS1_3_VERSION, 0, -1, -1, 0 },
-    /* 31 */ { OSSL_TLS_GROUP_ID_brainpoolP384r1_tls13, 192, TLS1_3_VERSION, 0, -1, -1, 0 },
-    /* 32 */ { OSSL_TLS_GROUP_ID_brainpoolP512r1_tls13, 256, TLS1_3_VERSION, 0, -1, -1, 0 },
-    /* 33 */ { OSSL_TLS_GROUP_ID_ffdhe2048, 112, TLS1_3_VERSION, 0, -1, -1, 0 },
-    /* 34 */ { OSSL_TLS_GROUP_ID_ffdhe3072, 128, TLS1_3_VERSION, 0, -1, -1, 0 },
-    /* 35 */ { OSSL_TLS_GROUP_ID_ffdhe4096, 128, TLS1_3_VERSION, 0, -1, -1, 0 },
-    /* 36 */ { OSSL_TLS_GROUP_ID_ffdhe6144, 128, TLS1_3_VERSION, 0, -1, -1, 0 },
-    /* 37 */ { OSSL_TLS_GROUP_ID_ffdhe8192, 192, TLS1_3_VERSION, 0, -1, -1, 0 },
-    /* 38 */ { OSSL_TLS_GROUP_ID_mlkem512, ML_KEM_512_SECBITS, TLS1_3_VERSION, 0, -1, -1, 1 },
-    /* 39 */ { OSSL_TLS_GROUP_ID_mlkem768, ML_KEM_768_SECBITS, TLS1_3_VERSION, 0, -1, -1, 1 },
-    /* 40 */ { OSSL_TLS_GROUP_ID_mlkem1024, ML_KEM_1024_SECBITS, TLS1_3_VERSION, 0, -1, -1, 1 },
-    /* 41 */ { OSSL_TLS_GROUP_ID_X25519MLKEM768, ML_KEM_768_SECBITS, TLS1_3_VERSION, 0, -1, -1, 1 },
-    /* 42 */ { OSSL_TLS_GROUP_ID_SecP256r1MLKEM768, ML_KEM_768_SECBITS, TLS1_3_VERSION, 0, -1, -1, 1 },
-    /* 43 */ { OSSL_TLS_GROUP_ID_SecP384r1MLKEM1024, ML_KEM_1024_SECBITS, TLS1_3_VERSION, 0, -1, -1, 1 },
+    /* 30 */ { OSSL_TLS_GROUP_ID_brainpoolP256r1_tls13, 128, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 0 },
+    /* 31 */ { OSSL_TLS_GROUP_ID_brainpoolP384r1_tls13, 192, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 0 },
+    /* 32 */ { OSSL_TLS_GROUP_ID_brainpoolP512r1_tls13, 256, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 0 },
+    /* 33 */ { OSSL_TLS_GROUP_ID_ffdhe2048, 112, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 0 },
+    /* 34 */ { OSSL_TLS_GROUP_ID_ffdhe3072, 128, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 0 },
+    /* 35 */ { OSSL_TLS_GROUP_ID_ffdhe4096, 128, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 0 },
+    /* 36 */ { OSSL_TLS_GROUP_ID_ffdhe6144, 128, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 0 },
+    /* 37 */ { OSSL_TLS_GROUP_ID_ffdhe8192, 192, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 0 },
+    /* 38 */ { OSSL_TLS_GROUP_ID_mlkem512, ML_KEM_512_SECBITS, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 1 },
+    /* 39 */ { OSSL_TLS_GROUP_ID_mlkem768, ML_KEM_768_SECBITS, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 1 },
+    /* 40 */ { OSSL_TLS_GROUP_ID_mlkem1024, ML_KEM_1024_SECBITS, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 1 },
+    /* 41 */ { OSSL_TLS_GROUP_ID_X25519MLKEM768, ML_KEM_768_SECBITS, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 1 },
+    /* 42 */ { OSSL_TLS_GROUP_ID_SecP256r1MLKEM768, ML_KEM_768_SECBITS, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 1 },
+    /* 43 */ { OSSL_TLS_GROUP_ID_SecP384r1MLKEM1024, ML_KEM_1024_SECBITS, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 1 },
+    /* 44 */ { OSSL_TLS_GROUP_ID_curveSM2, 128, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 0 },
+    /* 45 */ { OSSL_TLS_GROUP_ID_curveSM2MLKEM768, ML_KEM_768_SECBITS, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0, 1 },
 };

 #define TLS_GROUP_ENTRY(tlsname, realname, algorithm, idx)              \
@@ -187,6 +190,12 @@ static const OSSL_PARAM param_group_list[][11] = {
     TLS_GROUP_ENTRY("brainpoolP256r1tls13", "brainpoolP256r1", "EC", 30),
     TLS_GROUP_ENTRY("brainpoolP384r1tls13", "brainpoolP384r1", "EC", 31),
     TLS_GROUP_ENTRY("brainpoolP512r1tls13", "brainpoolP512r1", "EC", 32),
+#ifndef OPENSSL_NO_SM2
+    TLS_GROUP_ENTRY("curveSM2", "SM2", "curveSM2", 44),
+#if !defined(OPENSSL_NO_ML_KEM)
+    TLS_GROUP_ENTRY("curveSM2MLKEM768", "", "curveSM2MLKEM768", 45),
+#endif
+#endif
 #endif
 #ifndef OPENSSL_NO_ML_KEM
     TLS_GROUP_ENTRY("SecP256r1MLKEM768", "", "SecP256r1MLKEM768", 42),
@@ -272,7 +281,8 @@ static int tls_group_capability(OSSL_CALLBACK *cb, void *arg)

 /* --------------------------------------------------------------- */

-#if !defined(OPENSSL_NO_ML_DSA)
+#if !defined(OPENSSL_NO_ML_DSA) || !defined(OPENSSL_NO_SLH_DSA) \
+    || (!defined(FIPS_MODULE) && !defined(OPENSSL_NO_SM2) && !defined(OPENSSL_NO_SM3))

 typedef struct tls_sigalg_constants_st {
     unsigned int code_point;
@@ -283,10 +293,23 @@ typedef struct tls_sigalg_constants_st {
     int max_dtls; /* Maximum DTLS version (or 0 for undefined) */
 } TLS_SIGALG_CONSTANTS;

-static const TLS_SIGALG_CONSTANTS sigalg_constants_list[3] = {
-    { 0x0904, 128, TLS1_3_VERSION, 0, -1, -1 },
-    { 0x0905, 192, TLS1_3_VERSION, 0, -1, -1 },
-    { 0x0906, 256, TLS1_3_VERSION, 0, -1, -1 },
+static const TLS_SIGALG_CONSTANTS sigalg_constants_list[] = {
+    { TLSEXT_SIGALG_mldsa44, 128, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_mldsa65, 192, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_mldsa87, 256, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_slhdsa_sha2_128s, 128, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_slhdsa_sha2_128f, 128, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_slhdsa_sha2_192s, 192, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_slhdsa_sha2_192f, 192, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_slhdsa_sha2_256s, 256, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_slhdsa_sha2_256f, 256, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_slhdsa_shake_128s, 128, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_slhdsa_shake_128f, 128, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_slhdsa_shake_192s, 192, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_slhdsa_shake_192f, 192, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_slhdsa_shake_256s, 256, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_slhdsa_shake_256f, 256, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
+    { TLSEXT_SIGALG_sm2sig_sm3, 128, TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
 };

 #define TLS_SIGALG_ENTRY(tlsname, algorithm, oid, idx)               \
@@ -313,15 +336,34 @@ static const TLS_SIGALG_CONSTANTS sigalg_constants_list[3] = {
     }

 static const OSSL_PARAM param_sigalg_list[][10] = {
+#ifndef OPENSSL_NO_ML_DSA
     TLS_SIGALG_ENTRY("mldsa44", "ML-DSA-44", "2.16.840.1.101.3.4.3.17", 0),
     TLS_SIGALG_ENTRY("mldsa65", "ML-DSA-65", "2.16.840.1.101.3.4.3.18", 1),
     TLS_SIGALG_ENTRY("mldsa87", "ML-DSA-87", "2.16.840.1.101.3.4.3.19", 2),
+#endif
+#ifndef OPENSSL_NO_SLH_DSA
+    TLS_SIGALG_ENTRY("slhdsa_sha2_128s", "SLH-DSA-SHA2-128s", "2.16.840.1.101.3.4.3.20", 3),
+    TLS_SIGALG_ENTRY("slhdsa_sha2_128f", "SLH-DSA-SHA2-128f", "2.16.840.1.101.3.4.3.21", 4),
+    TLS_SIGALG_ENTRY("slhdsa_sha2_192s", "SLH-DSA-SHA2-192s", "2.16.840.1.101.3.4.3.22", 5),
+    TLS_SIGALG_ENTRY("slhdsa_sha2_192f", "SLH-DSA-SHA2-192f", "2.16.840.1.101.3.4.3.23", 6),
+    TLS_SIGALG_ENTRY("slhdsa_sha2_256s", "SLH-DSA-SHA2-256s", "2.16.840.1.101.3.4.3.24", 7),
+    TLS_SIGALG_ENTRY("slhdsa_sha2_256f", "SLH-DSA-SHA2-256f", "2.16.840.1.101.3.4.3.25", 8),
+    TLS_SIGALG_ENTRY("slhdsa_shake_128s", "SLH-DSA-SHAKE-128s", "2.16.840.1.101.3.4.3.26", 9),
+    TLS_SIGALG_ENTRY("slhdsa_shake_128f", "SLH-DSA-SHAKE-128f", "2.16.840.1.101.3.4.3.27", 10),
+    TLS_SIGALG_ENTRY("slhdsa_shake_192s", "SLH-DSA-SHAKE-192s", "2.16.840.1.101.3.4.3.28", 11),
+    TLS_SIGALG_ENTRY("slhdsa_shake_192f", "SLH-DSA-SHAKE-192f", "2.16.840.1.101.3.4.3.29", 12),
+    TLS_SIGALG_ENTRY("slhdsa_shake_256s", "SLH-DSA-SHAKE-256s", "2.16.840.1.101.3.4.3.30", 13),
+    TLS_SIGALG_ENTRY("slhdsa_shake_256f", "SLH-DSA-SHAKE-256f", "2.16.840.1.101.3.4.3.31", 14),
+#endif
+#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_SM2) && !defined(OPENSSL_NO_SM3)
+    TLS_SIGALG_ENTRY("sm2sig_sm3", "SM2", "1.2.156.10197.1 501", 15),
+#endif
 };
-#endif /* OPENSSL_NO_ML_DSA */
+#endif

 static int tls_sigalg_capability(OSSL_CALLBACK *cb, void *arg)
 {
-#if !defined(OPENSSL_NO_ML_DSA)
+#if defined(TLS_SIGALG_ENTRY)
     size_t i;

     for (i = 0; i < OSSL_NELEM(param_sigalg_list); i++)
diff --git a/deps/openssl/openssl/providers/common/der/HKDF.asn1 b/deps/openssl/openssl/providers/common/der/HKDF.asn1
new file mode 100644
index 00000000000..40145f9abee
--- /dev/null
+++ b/deps/openssl/openssl/providers/common/der/HKDF.asn1
@@ -0,0 +1,16 @@
+-- Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+--
+-- Licensed under the Apache License 2.0 (the "License").  You may not use
+-- this file except in compliance with the License.  You can obtain a copy
+-- in the file LICENSE in the source distribution or at
+-- https://www.openssl.org/source/license.html
+
+-- -------------------------------------------------------------------
+-- Taken from https://datatracker.ietf.org/doc/rfc8619/
+
+id-smime OBJECT IDENTIFIER ::= { 1 2 840 113549 1 9 16 }
+id-alg OBJECT IDENTIFIER ::= { id-smime  3 }
+
+id-alg-hkdf-with-sha256 OBJECT IDENTIFIER ::= { id-alg 28 }
+id-alg-hkdf-with-sha384 OBJECT IDENTIFIER ::= { id-alg 29 }
+id-alg-hkdf-with-sha512 OBJECT IDENTIFIER ::= { id-alg 30 }
diff --git a/deps/openssl/openssl/providers/common/der/build.info b/deps/openssl/openssl/providers/common/der/build.info
index cc881be85bd..efa34700d10 100644
--- a/deps/openssl/openssl/providers/common/der/build.info
+++ b/deps/openssl/openssl/providers/common/der/build.info
@@ -81,7 +81,7 @@ IF[{- !$disabled{'ml-dsa'} -}]
   DEPEND[$DER_ML_DSA_GEN]=oids_to_c.pm ML_DSA.asn1

   DEPEND[${DER_ML_DSA_GEN/.c/.o}]=$DER_ML_DSA_H
-  DEPEND[${DER_ML_DSA_AUX/.c/.o}]=$DER_ML_DSA_H
+  DEPEND[${DER_ML_DSA_AUX/.c/.o}]=$DER_ML_DSA_H $DER_DIGESTS_H
   GENERATE[$DER_ML_DSA_H]=$INCDIR/der_ml_dsa.h.in
   DEPEND[$DER_ML_DSA_H]=oids_to_c.pm ML_DSA.asn1
 ENDIF
@@ -127,9 +127,20 @@ IF[{- !$disabled{'slh-dsa'} -}]
   DEPEND[$DER_SLH_DSA_H]=oids_to_c.pm SLH_DSA.asn1
 ENDIF

+#----- HKDF
+$DER_HKDF_H=$INCDIR/der_hkdf.h
+$DER_HKDF_GEN=der_hkdf_gen.c
+
+GENERATE[$DER_HKDF_GEN]=der_hkdf_gen.c.in
+DEPEND[$DER_HKDF_GEN]=oids_to_c.pm HKDF.asn1
+
+DEPEND[${DER_HKDF_GEN/.c/.o}]=$DER_HKDF_H
+GENERATE[$DER_HKDF_H]=$INCDIR/der_hkdf.h.in
+DEPEND[$DER_HKDF_H]=oids_to_c.pm HKDF.asn1
+
 #----- Conclusion

-$COMMON= $DER_RSA_COMMON $DER_DIGESTS_GEN $DER_WRAP_GEN
+$COMMON= $DER_RSA_COMMON $DER_DIGESTS_GEN $DER_WRAP_GEN $DER_HKDF_GEN

 IF[{- !$disabled{dsa} -}]
   $COMMON = $COMMON $DER_DSA_GEN $DER_DSA_AUX
diff --git a/deps/openssl/openssl/crypto/params_idx.c.in b/deps/openssl/openssl/providers/common/der/der_hkdf_gen.c.in
similarity index 50%
rename from deps/openssl/openssl/crypto/params_idx.c.in
rename to deps/openssl/openssl/providers/common/der/der_hkdf_gen.c.in
index e8a229388b1..99fb84b5376 100644
--- a/deps/openssl/openssl/crypto/params_idx.c.in
+++ b/deps/openssl/openssl/providers/common/der/der_hkdf_gen.c.in
@@ -1,25 +1,21 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
-/* clang-format off */
-{-
-use OpenSSL::paramnames qw(produce_decoder);
--}
-/* clang-format on */

-#include "internal/e_os.h"
-#include "internal/param_names.h"
-#include <string.h>
+#include "prov/der_hkdf.h"

-/* Machine generated TRIE -- generated by util/perl/OpenSSL/paramnames.pm */
+/* Well known OIDs precompiled */
 /* clang-format off */
-{- produce_decoder(); -}
+{-
+    $OUT = oids_to_c::process_leaves('providers/common/der/HKDF.asn1',
+                                     { dir => $config{sourcedir},
+                                       filter => \&oids_to_c::filter_to_C });
+-}
 /* clang-format on */
-/* End of TRIE */
diff --git a/deps/openssl/openssl/providers/common/der/der_ml_dsa_key.c b/deps/openssl/openssl/providers/common/der/der_ml_dsa_key.c
index a042f634e79..e2d55a6d1d7 100644
--- a/deps/openssl/openssl/providers/common/der/der_ml_dsa_key.c
+++ b/deps/openssl/openssl/providers/common/der/der_ml_dsa_key.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,30 +12,67 @@
  * internal use.
  */
 #include "internal/deprecated.h"
-
+#include <openssl/obj_mac.h>
+#include <openssl/evp.h>
 #include "internal/packet.h"
 #include "prov/der_ml_dsa.h"
+#include "prov/der_pq_dsa.h"
+#include "prov/der_digests.h"
+
+#define SET_OID(oid, oidlen, oidname)  \
+    (oid) = ossl_der_oid_id_##oidname; \
+    (oidlen) = sizeof(ossl_der_oid_id_##oidname)
+
+#define SET_DIGEST_OID(oidname, digestsz) \
+    SET_OID(*oid, *oidlen, oidname);      \
+    *sz = digestsz

 int ossl_DER_w_algorithmIdentifier_ML_DSA(WPACKET *pkt, int tag, ML_DSA_KEY *key)
 {
-    const uint8_t *alg;
-    size_t len;
+    const uint8_t *oid;
+    size_t oidlen;
     const char *name = ossl_ml_dsa_key_get_name(key);

     if (OPENSSL_strcasecmp(name, "ML-DSA-44") == 0) {
-        alg = ossl_der_oid_id_ml_dsa_44;
-        len = sizeof(ossl_der_oid_id_ml_dsa_44);
+        SET_OID(oid, oidlen, ml_dsa_44);
     } else if (OPENSSL_strcasecmp(name, "ML-DSA-65") == 0) {
-        alg = ossl_der_oid_id_ml_dsa_65;
-        len = sizeof(ossl_der_oid_id_ml_dsa_65);
+        SET_OID(oid, oidlen, ml_dsa_65);
     } else if (OPENSSL_strcasecmp(name, "ML-DSA-87") == 0) {
-        alg = ossl_der_oid_id_ml_dsa_87;
-        len = sizeof(ossl_der_oid_id_ml_dsa_87);
+        SET_OID(oid, oidlen, ml_dsa_87);
     } else {
         return 0;
     }
     return ossl_DER_w_begin_sequence(pkt, tag)
         /* No parameters */
-        && ossl_DER_w_precompiled(pkt, -1, alg, len)
+        && ossl_DER_w_precompiled(pkt, -1, oid, oidlen)
         && ossl_DER_w_end_sequence(pkt, tag);
 }
+
+int ossl_der_oid_pq_dsa_prehash_digest(const char *oid_digest_name,
+    const uint8_t **oid, size_t *oidlen, size_t *sz)
+{
+    if (OPENSSL_strcasecmp(oid_digest_name, "SHAKE-256") == 0) {
+        SET_DIGEST_OID(shake256, 64);
+    } else if (OPENSSL_strcasecmp(oid_digest_name, "SHAKE-128") == 0) {
+        SET_DIGEST_OID(shake128, 32);
+    } else if (OPENSSL_strcasecmp(oid_digest_name, "SHA-224") == 0) {
+        SET_DIGEST_OID(sha224, 28);
+    } else if (OPENSSL_strcasecmp(oid_digest_name, "SHA-256") == 0) {
+        SET_DIGEST_OID(sha256, 32);
+    } else if (OPENSSL_strcasecmp(oid_digest_name, "SHA-384") == 0) {
+        SET_DIGEST_OID(sha384, 48);
+    } else if (OPENSSL_strcasecmp(oid_digest_name, "SHA-512") == 0) {
+        SET_DIGEST_OID(sha512, 64);
+    } else if (OPENSSL_strcasecmp(oid_digest_name, "SHA3-224") == 0) {
+        SET_DIGEST_OID(sha3_224, 28);
+    } else if (OPENSSL_strcasecmp(oid_digest_name, "SHA3-256") == 0) {
+        SET_DIGEST_OID(sha3_256, 32);
+    } else if (OPENSSL_strcasecmp(oid_digest_name, "SHA3-384") == 0) {
+        SET_DIGEST_OID(sha3_384, 48);
+    } else if (OPENSSL_strcasecmp(oid_digest_name, "SHA3-512") == 0) {
+        SET_DIGEST_OID(sha3_512, 64);
+    } else {
+        return 0;
+    }
+    return 1;
+}
diff --git a/deps/openssl/openssl/providers/common/der/oids_to_c.pm b/deps/openssl/openssl/providers/common/der/oids_to_c.pm
index 6f57df09b93..d8d0640dc54 100644
--- a/deps/openssl/openssl/providers/common/der/oids_to_c.pm
+++ b/deps/openssl/openssl/providers/common/der/oids_to_c.pm
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -80,7 +80,7 @@ sub _process {
         # print STDERR "-----BEGIN DEBUG-----\n";
         # print STDERR $text;
         # print STDERR "-----END DEBUG-----\n";
-        use re 'debugcolor';
+        use re 'debug';
         while ($text =~ m/${OID_def_re}/sg) {
             my $comment = $&;
             my $name = $1;
diff --git a/deps/openssl/openssl/providers/common/include/prov/bio.h b/deps/openssl/openssl/providers/common/include/prov/bio.h
index 24419952480..33b1ff9023b 100644
--- a/deps/openssl/openssl/providers/common/include/prov/bio.h
+++ b/deps/openssl/openssl/providers/common/include/prov/bio.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_BIO_H)
+#define OSSL_PROVIDERS_COMMON_INCLUDE_PROV_BIO_H
+
 #include <stdarg.h>
 #include <openssl/bio.h>
 #include <openssl/core.h>
@@ -30,3 +33,5 @@ int ossl_prov_bio_printf(OSSL_CORE_BIO *bio, const char *format, ...);

 BIO_METHOD *ossl_bio_prov_init_bio_method(void);
 BIO *ossl_bio_new_from_core_bio(PROV_CTX *provctx, OSSL_CORE_BIO *corebio);
+
+#endif /* !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_BIO_H) */
diff --git a/deps/openssl/openssl/include/internal/param_names.h.in b/deps/openssl/openssl/providers/common/include/prov/der_hkdf.h.in
similarity index 51%
rename from deps/openssl/openssl/include/internal/param_names.h.in
rename to deps/openssl/openssl/providers/common/include/prov/der_hkdf.h.in
index cb1378b3908..4a166541e16 100644
--- a/deps/openssl/openssl/include/internal/param_names.h.in
+++ b/deps/openssl/openssl/providers/common/include/prov/der_hkdf.h.in
@@ -1,22 +1,21 @@
 /*
  * {- join("\n * ", @autowarntext) -}
  *
- * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
-/* clang-format off */
-{-
-use OpenSSL::paramnames qw(generate_internal_macros);
--}
-/* clang-format on */

-int ossl_param_find_pidx(const char *s);
+#include "internal/der.h"

-/* Parameter name definitions - generated by util/perl/OpenSSL/paramnames.pm */
+/* Well known OIDs precompiled */
 /* clang-format off */
-{- generate_internal_macros(); -}
+{-
+    $OUT = oids_to_c::process_leaves('providers/common/der/HKDF.asn1',
+                                     { dir => $config{sourcedir},
+                                       filter => \&oids_to_c::filter_to_H });
+-}
 /* clang-format on */
diff --git a/deps/openssl/openssl/providers/common/include/prov/der_pq_dsa.h b/deps/openssl/openssl/providers/common/include/prov/der_pq_dsa.h
new file mode 100644
index 00000000000..1ac4d80bf52
--- /dev/null
+++ b/deps/openssl/openssl/providers/common/include/prov/der_pq_dsa.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#if !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_DER_PQ_DSA_H)
+#define OSSL_PROVIDERS_COMMON_INCLUDE_PROV_DER_PQ_DSA_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+int ossl_der_oid_pq_dsa_prehash_digest(const char *oid_digest_name,
+    const uint8_t **oid, size_t *oidlen, size_t *sz);
+
+#endif /* !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_DER_PQ_DSA_H) */
diff --git a/deps/openssl/openssl/providers/common/include/prov/proverr.h b/deps/openssl/openssl/providers/common/include/prov/proverr.h
deleted file mode 100644
index a2829caed0f..00000000000
--- a/deps/openssl/openssl/providers/common/include/prov/proverr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OSSL_PROVERR_H
-#define OSSL_PROVERR_H
-#pragma once
-
-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ossl_err_load_PROV_strings(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/deps/openssl/openssl/providers/common/include/prov/provider_util.h b/deps/openssl/openssl/providers/common/include/prov/provider_util.h
index 503e632186d..06f66bb1711 100644
--- a/deps/openssl/openssl/providers/common/include/prov/provider_util.h
+++ b/deps/openssl/openssl/providers/common/include/prov/provider_util.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_PROVIDER_UTIL_H)
+#define OSSL_PROVIDERS_COMMON_INCLUDE_PROV_PROVIDER_UTIL_H
+
 #include <openssl/provider.h>
 #include <openssl/types.h>

@@ -18,9 +21,6 @@ typedef struct {
      */
     const EVP_CIPHER *cipher; /* cipher */
     EVP_CIPHER *alloc_cipher; /* fetched cipher */
-
-    /* Conditions for legacy EVP_CIPHER uses */
-    ENGINE *engine; /* cipher engine */
 } PROV_CIPHER;

 typedef struct {
@@ -31,21 +31,16 @@ typedef struct {
      */
     const EVP_MD *md; /* digest */
     EVP_MD *alloc_md; /* fetched digest */
-
-    /* Conditions for legacy EVP_MD uses */
-    ENGINE *engine; /* digest engine */
 } PROV_DIGEST;

 /* Cipher functions */
 /*
  * Load a cipher from the specified parameters with the specified context.
- * The params "properties", "engine" and "cipher" are used to determine the
- * implementation used.  If a provider cannot be found, it falls back to trying
- * non-provider based implementations.
+ * The params "propq" and "cipher" are used to determine the
+ * implementation used.
  */
-int ossl_prov_cipher_load_from_params(PROV_CIPHER *pc,
-    const OSSL_PARAM params[],
-    OSSL_LIB_CTX *ctx);
+int ossl_prov_cipher_load(PROV_CIPHER *pc, const OSSL_PARAM *cipher,
+    const OSSL_PARAM *propq, OSSL_LIB_CTX *ctx);

 /* Reset the PROV_CIPHER fields and free any allocated cipher reference */
 void ossl_prov_cipher_reset(PROV_CIPHER *pc);
@@ -53,9 +48,8 @@ void ossl_prov_cipher_reset(PROV_CIPHER *pc);
 /* Clone a PROV_CIPHER structure into a second */
 int ossl_prov_cipher_copy(PROV_CIPHER *dst, const PROV_CIPHER *src);

-/* Query the cipher and associated engine (if any) */
+/* Query the cipher (if any) */
 const EVP_CIPHER *ossl_prov_cipher_cipher(const PROV_CIPHER *pc);
-ENGINE *ossl_prov_cipher_engine(const PROV_CIPHER *pc);

 /* Digest functions */

@@ -68,13 +62,11 @@ const EVP_MD *ossl_prov_digest_fetch(PROV_DIGEST *pd, OSSL_LIB_CTX *libctx,

 /*
  * Load a digest from the specified parameters with the specified context.
- * The params "properties", "engine" and "digest" are used to determine the
- * implementation used.  If a provider cannot be found, it falls back to trying
- * non-provider based implementations.
+ * The params "propq" and "digest" are used to determine the
+ * implementation used.
  */
-int ossl_prov_digest_load_from_params(PROV_DIGEST *pd,
-    const OSSL_PARAM params[],
-    OSSL_LIB_CTX *ctx);
+int ossl_prov_digest_load(PROV_DIGEST *pd, const OSSL_PARAM *digest,
+    const OSSL_PARAM *propq, OSSL_LIB_CTX *ctx);

 /* Reset the PROV_DIGEST fields and free any allocated digest reference */
 void ossl_prov_digest_reset(PROV_DIGEST *pd);
@@ -82,9 +74,8 @@ void ossl_prov_digest_reset(PROV_DIGEST *pd);
 /* Clone a PROV_DIGEST structure into a second */
 int ossl_prov_digest_copy(PROV_DIGEST *dst, const PROV_DIGEST *src);

-/* Query the digest and associated engine (if any) */
+/* Query the digest (if any) */
 const EVP_MD *ossl_prov_digest_md(const PROV_DIGEST *pd);
-ENGINE *ossl_prov_digest_engine(const PROV_DIGEST *pd);

 /* Set a specific md, resets current digests first */
 void ossl_prov_digest_set_md(PROV_DIGEST *pd, EVP_MD *md);
@@ -94,38 +85,17 @@ void ossl_prov_digest_set_md(PROV_DIGEST *pd, EVP_MD *md);
  * If any of the supplied ciphername/mdname etc are NULL then the values
  * from the supplied params (if non NULL) are used instead.
  */
+int ossl_prov_macctx_load(EVP_MAC_CTX **macctx,
+    const OSSL_PARAM *pmac, const OSSL_PARAM *pcipher,
+    const OSSL_PARAM *pdigest, const OSSL_PARAM *propq,
+    const char *macname, const char *ciphername,
+    const char *mdname, OSSL_LIB_CTX *libctx);
+
 int ossl_prov_set_macctx(EVP_MAC_CTX *macctx,
-    const OSSL_PARAM params[],
     const char *ciphername,
     const char *mdname,
-    const char *engine,
     const char *properties,
-    const unsigned char *key,
-    size_t keylen);
-
-/* MAC functions */
-/*
- * Load an EVP_MAC_CTX* from the specified parameters with the specified
- * library context.
- * The params "mac" and "properties" are used to determine the implementation
- * used, and the parameters "digest", "cipher", "engine" and "properties" are
- * passed to the MAC via the created MAC context if they are given.
- * If there is already a created MAC context, it will be replaced if the "mac"
- * parameter is found, otherwise it will simply be used as is, and passed the
- * parameters to pilfer as it sees fit.
- *
- * As an option, a MAC name may be explicitly given, and if it is, the "mac"
- * parameter will be ignored.
- * Similarly, as an option, a cipher name or a digest name may be explicitly
- * given, and if any of them is, the "digest" and "cipher" parameters are
- * ignored.
- */
-int ossl_prov_macctx_load_from_params(EVP_MAC_CTX **macctx,
-    const OSSL_PARAM params[],
-    const char *macname,
-    const char *ciphername,
-    const char *mdname,
-    OSSL_LIB_CTX *ctx);
+    const OSSL_PARAM param[]);

 typedef struct ag_capable_st {
     OSSL_ALGORITHM alg;
@@ -142,3 +112,5 @@ void ossl_prov_cache_exported_algorithms(const OSSL_ALGORITHM_CAPABLE *in,
 /* Duplicate a lump of memory safely */
 int ossl_prov_memdup(const void *src, size_t src_len,
     unsigned char **dest, size_t *dest_len);
+
+#endif /* !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_PROVIDER_UTIL_H) */
diff --git a/deps/openssl/openssl/providers/common/include/prov/providercommon.h b/deps/openssl/openssl/providers/common/include/prov/providercommon.h
index 4a1a043a84e..b07b5097e8b 100644
--- a/deps/openssl/openssl/providers/common/include/prov/providercommon.h
+++ b/deps/openssl/openssl/providers/common/include/prov/providercommon.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_PROVIDERCOMMON_H)
+#define OSSL_PROVIDERS_COMMON_INCLUDE_PROV_PROVIDERCOMMON_H
+
 #include <openssl/provider.h>
 #include <openssl/core_dispatch.h>

@@ -14,6 +17,9 @@ const OSSL_CORE_HANDLE *FIPS_get_core_handle(OSSL_LIB_CTX *ctx);

 int ossl_cipher_capable_aes_cbc_hmac_sha1(void);
 int ossl_cipher_capable_aes_cbc_hmac_sha256(void);
+int ossl_cipher_capable_aes_cbc_hmac_sha1_etm(void);
+int ossl_cipher_capable_aes_cbc_hmac_sha256_etm(void);
+int ossl_cipher_capable_aes_cbc_hmac_sha512_etm(void);

 OSSL_FUNC_provider_get_capabilities_fn ossl_prov_get_capabilities;

@@ -27,3 +33,5 @@ static ossl_inline int ossl_param_is_empty(const OSSL_PARAM params[])
 {
     return params == NULL || params->key == NULL;
 }
+
+#endif /* !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_PROVIDERCOMMON_H) */
diff --git a/deps/openssl/openssl/providers/common/include/prov/securitycheck.h b/deps/openssl/openssl/providers/common/include/prov/securitycheck.h
index 29a2b7fbf81..a4974e9af11 100644
--- a/deps/openssl/openssl/providers/common/include/prov/securitycheck.h
+++ b/deps/openssl/openssl/providers/common/include/prov/securitycheck.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_SECURITYCHECK_H)
+#define OSSL_PROVIDERS_COMMON_INCLUDE_PROV_SECURITYCHECK_H
+
 #include "crypto/types.h"
 #include <openssl/ec.h>

@@ -36,4 +39,5 @@ int ossl_digest_get_approved_nid(const EVP_MD *md);

 /* Functions that have different implementations for the FIPS_MODULE */
 int ossl_digest_rsa_sign_get_md_nid(const EVP_MD *md);
-int ossl_fips_config_securitycheck_enabled(OSSL_LIB_CTX *libctx);
+
+#endif /* !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_SECURITYCHECK_H) */
diff --git a/deps/openssl/openssl/providers/common/provider_err.c b/deps/openssl/openssl/providers/common/provider_err.c
deleted file mode 100644
index 170bb7f63af..00000000000
--- a/deps/openssl/openssl/providers/common/provider_err.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/err.h>
-#include <openssl/proverr.h>
-#include "include/prov/proverr.h"
-
-#ifndef OPENSSL_NO_ERR
-
-static const ERR_STRING_DATA PROV_str_reasons[] = {
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_ADDITIONAL_INPUT_TOO_LONG),
-        "additional input too long" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_ALGORITHM_MISMATCH),
-        "algorithm mismatch" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_ALREADY_INSTANTIATED),
-        "already instantiated" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_BAD_DECRYPT), "bad decrypt" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_BAD_ENCODING), "bad encoding" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_BAD_LENGTH), "bad length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_BAD_TLS_CLIENT_VERSION),
-        "bad tls client version" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_BN_ERROR), "bn error" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_CIPHER_OPERATION_FAILED),
-        "cipher operation failed" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_COFACTOR_REQUIRED), "cofactor required" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_DERIVATION_FUNCTION_INIT_FAILED),
-        "derivation function init failed" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_DIGEST_NOT_ALLOWED),
-        "digest not allowed" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_EMS_NOT_ENABLED), "ems not enabled" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_ENTROPY_SOURCE_FAILED_CONTINUOUS_TESTS),
-        "entropy source failed continuous tests" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK),
-        "entropy source strength too weak" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_ERROR_INSTANTIATING_DRBG),
-        "error instantiating drbg" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_ERROR_RETRIEVING_ENTROPY),
-        "error retrieving entropy" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_ERROR_RETRIEVING_NONCE),
-        "error retrieving nonce" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_FAILED_DURING_DERIVATION),
-        "failed during derivation" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_FAILED_TO_CREATE_LOCK),
-        "failed to create lock" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_FAILED_TO_DECRYPT), "failed to decrypt" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_FAILED_TO_GENERATE_KEY),
-        "failed to generate key" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_FAILED_TO_GET_PARAMETER),
-        "failed to get parameter" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_FAILED_TO_SET_PARAMETER),
-        "failed to set parameter" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_FAILED_TO_SIGN), "failed to sign" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_FINAL_CALL_OUT_OF_ORDER),
-        "final call out of order" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_FIPS_MODULE_CONDITIONAL_ERROR),
-        "fips module conditional error" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_FIPS_MODULE_ENTERING_ERROR_STATE),
-        "fips module entering error state" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_FIPS_MODULE_IMPORT_PCT_ERROR),
-        "fips module import pct error" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_FIPS_MODULE_IN_ERROR_STATE),
-        "fips module in error state" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_GENERATE_ERROR), "generate error" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE),
-        "illegal or unsupported padding mode" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INDICATOR_INTEGRITY_FAILURE),
-        "indicator integrity failure" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INIT_CALL_OUT_OF_ORDER),
-        "init call out of order" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INSUFFICIENT_DRBG_STRENGTH),
-        "insufficient drbg strength" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_AAD), "invalid aad" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_AEAD), "invalid aead" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_CONFIG_DATA),
-        "invalid config data" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_CONSTANT_LENGTH),
-        "invalid constant length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_CURVE), "invalid curve" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_CUSTOM_LENGTH),
-        "invalid custom length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_DATA), "invalid data" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_DIGEST), "invalid digest" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_DIGEST_LENGTH),
-        "invalid digest length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_DIGEST_SIZE),
-        "invalid digest size" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_EDDSA_INSTANCE_FOR_ATTEMPTED_OPERATION),
-        "invalid eddsa instance for attempted operation" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_INPUT_LENGTH),
-        "invalid input length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_ITERATION_COUNT),
-        "invalid iteration count" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_IV_LENGTH), "invalid iv length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_KDF), "invalid kdf" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_KEY), "invalid key" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_KEY_LENGTH),
-        "invalid key length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_MAC), "invalid mac" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_MEMORY_SIZE),
-        "invalid memory size" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_MGF1_MD), "invalid mgf1 md" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_MODE), "invalid mode" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_OUTPUT_LENGTH),
-        "invalid output length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_PADDING_MODE),
-        "invalid padding mode" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_PREHASHED_DIGEST_LENGTH),
-        "invalid prehashed digest length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_PUBINFO), "invalid pubinfo" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_SALT_LENGTH),
-        "invalid salt length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_SEED_LENGTH),
-        "invalid seed length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_SIGNATURE_SIZE),
-        "invalid signature size" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_STATE), "invalid state" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_TAG), "invalid tag" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_TAG_LENGTH),
-        "invalid tag length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_THREAD_POOL_SIZE),
-        "invalid thread pool size" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_UKM_LENGTH),
-        "invalid ukm length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_INVALID_X931_DIGEST),
-        "invalid x931 digest" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_IN_ERROR_STATE), "in error state" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_KEY_SETUP_FAILED), "key setup failed" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_KEY_SIZE_TOO_SMALL),
-        "key size too small" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_LENGTH_TOO_LARGE), "length too large" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISMATCHING_DOMAIN_PARAMETERS),
-        "mismatching domain parameters" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_CEK_ALG), "missing cek alg" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_CIPHER), "missing cipher" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_CONFIG_DATA),
-        "missing config data" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_CONSTANT), "missing constant" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_KEY), "missing key" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_MAC), "missing mac" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_MESSAGE_DIGEST),
-        "missing message digest" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_OID), "missing OID" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_PASS), "missing pass" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_SALT), "missing salt" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_SECRET), "missing secret" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_SEED), "missing seed" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_SESSION_ID),
-        "missing session id" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_TYPE), "missing type" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MISSING_XCGHASH), "missing xcghash" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_ML_DSA_NO_FORMAT), "ml dsa no format" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_ML_KEM_NO_FORMAT), "ml kem no format" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_MODULE_INTEGRITY_FAILURE),
-        "module integrity failure" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_NOT_A_PRIVATE_KEY), "not a private key" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_NOT_A_PUBLIC_KEY), "not a public key" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_NOT_INSTANTIATED), "not instantiated" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_NOT_PARAMETERS), "not parameters" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_NOT_SUPPORTED), "not supported" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_NOT_XOF_OR_INVALID_LENGTH),
-        "not xof or invalid length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_NO_INSTANCE_ALLOWED),
-        "no instance allowed" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_NO_KEY_SET), "no key set" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_NO_PARAMETERS_SET), "no parameters set" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_NULL_LENGTH_POINTER),
-        "null length pointer" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_NULL_OUTPUT_BUFFER),
-        "null output buffer" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_ONESHOT_CALL_OUT_OF_ORDER),
-        "oneshot call out of order" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE),
-        "operation not supported for this keytype" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_OUTPUT_BUFFER_TOO_SMALL),
-        "output buffer too small" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_PARENT_CANNOT_GENERATE_RANDOM_NUMBERS),
-        "parent cannot generate random numbers" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED),
-        "parent cannot supply entropy seed" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_PARENT_LOCKING_NOT_ENABLED),
-        "parent locking not enabled" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_PARENT_STRENGTH_TOO_WEAK),
-        "parent strength too weak" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_PATH_MUST_BE_ABSOLUTE),
-        "path must be absolute" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_PERSONALISATION_STRING_TOO_LONG),
-        "personalisation string too long" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_PSS_SALTLEN_TOO_SMALL),
-        "pss saltlen too small" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_REQUEST_TOO_LARGE_FOR_DRBG),
-        "request too large for drbg" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_REQUIRE_CTR_MODE_CIPHER),
-        "require ctr mode cipher" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_RESEED_ERROR), "reseed error" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES),
-        "search only supported for directories" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT),
-        "seed sources must not have a parent" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_SELF_TEST_KAT_FAILURE),
-        "self test kat failure" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_SELF_TEST_POST_FAILURE),
-        "self test post failure" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_TAG_NOT_NEEDED), "tag not needed" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_TAG_NOT_SET), "tag not set" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_TOO_MANY_RECORDS), "too many records" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_UNABLE_TO_FIND_CIPHERS),
-        "unable to find ciphers" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_UNABLE_TO_GET_PARENT_STRENGTH),
-        "unable to get parent strength" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_UNABLE_TO_GET_PASSPHRASE),
-        "unable to get passphrase" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_UNABLE_TO_INITIALISE_CIPHERS),
-        "unable to initialise ciphers" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_UNABLE_TO_LOAD_SHA256),
-        "unable to load sha256" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_UNABLE_TO_LOCK_PARENT),
-        "unable to lock parent" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_UNABLE_TO_RESEED), "unable to reseed" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_UNEXPECTED_KEY_PARAMETERS),
-        "unexpected key parameters" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_UNSUPPORTED_CEK_ALG),
-        "unsupported cek alg" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_UNSUPPORTED_KEY_SIZE),
-        "unsupported key size" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_UNSUPPORTED_MAC_TYPE),
-        "unsupported mac type" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_UNSUPPORTED_NUMBER_OF_ROUNDS),
-        "unsupported number of rounds" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_UNSUPPORTED_SELECTION),
-        "unsupported selection" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_UPDATE_CALL_OUT_OF_ORDER),
-        "update call out of order" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_URI_AUTHORITY_UNSUPPORTED),
-        "uri authority unsupported" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_VALUE_ERROR), "value error" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_WRONG_CIPHERTEXT_SIZE),
-        "wrong ciphertext size" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_WRONG_FINAL_BLOCK_LENGTH),
-        "wrong final block length" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_WRONG_OUTPUT_BUFFER_SIZE),
-        "wrong output buffer size" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_XOF_DIGESTS_NOT_ALLOWED),
-        "xof digests not allowed" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_XTS_DATA_UNIT_IS_TOO_LARGE),
-        "xts data unit is too large" },
-    { ERR_PACK(ERR_LIB_PROV, 0, PROV_R_XTS_DUPLICATED_KEYS),
-        "xts duplicated keys" },
-    { 0, NULL }
-};
-
-#endif
-
-int ossl_err_load_PROV_strings(void)
-{
-#ifndef OPENSSL_NO_ERR
-    if (ERR_reason_error_string(PROV_str_reasons[0].error) == NULL)
-        ERR_load_strings_const(PROV_str_reasons);
-#endif
-    return 1;
-}
diff --git a/deps/openssl/openssl/providers/common/provider_util.c b/deps/openssl/openssl/providers/common/provider_util.c
index 88d69bc10d6..e66b101a357 100644
--- a/deps/openssl/openssl/providers/common/provider_util.c
+++ b/deps/openssl/openssl/providers/common/provider_util.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,15 +7,11 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
 #include <openssl/evp.h>
 #include <openssl/core_names.h>
 #include <openssl/err.h>
 #include <openssl/proverr.h>
 #ifndef FIPS_MODULE
-#include <openssl/engine.h>
 #include "crypto/evp.h"
 #endif
 #include "prov/providercommon.h"
@@ -26,104 +22,44 @@ void ossl_prov_cipher_reset(PROV_CIPHER *pc)
     EVP_CIPHER_free(pc->alloc_cipher);
     pc->alloc_cipher = NULL;
     pc->cipher = NULL;
-#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
-    ENGINE_finish(pc->engine);
-#endif
-    pc->engine = NULL;
 }

 int ossl_prov_cipher_copy(PROV_CIPHER *dst, const PROV_CIPHER *src)
 {
     if (src->alloc_cipher != NULL && !EVP_CIPHER_up_ref(src->alloc_cipher))
         return 0;
-#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
-    if (src->engine != NULL && !ENGINE_init(src->engine)) {
-        EVP_CIPHER_free(src->alloc_cipher);
-        return 0;
-    }
-#endif
-    dst->engine = src->engine;
     dst->cipher = src->cipher;
     dst->alloc_cipher = src->alloc_cipher;
     return 1;
 }

-static int load_common(const OSSL_PARAM params[], const char **propquery,
-    ENGINE **engine)
+static int set_propq(const OSSL_PARAM *propq, const char **propquery)
 {
-    const OSSL_PARAM *p;
-
     *propquery = NULL;
-    p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_PROPERTIES);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
-            return 0;
-        *propquery = p->data;
-    }
-
-#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
-    ENGINE_finish(*engine);
-#endif
-    *engine = NULL;
-    /* Inside the FIPS module, we don't support legacy ciphers */
-#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
-    p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_ENGINE);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
-            return 0;
-        /* Get a structural reference */
-        *engine = ENGINE_by_id(p->data);
-        if (*engine == NULL)
+    if (propq != NULL) {
+        if (propq->data_type != OSSL_PARAM_UTF8_STRING)
             return 0;
-        /* Get a functional reference */
-        if (!ENGINE_init(*engine)) {
-            ENGINE_free(*engine);
-            *engine = NULL;
-            return 0;
-        }
-        /* Free the structural reference */
-        ENGINE_free(*engine);
+        *propquery = propq->data;
     }
-#endif
     return 1;
 }

-int ossl_prov_cipher_load_from_params(PROV_CIPHER *pc,
-    const OSSL_PARAM params[],
-    OSSL_LIB_CTX *ctx)
+int ossl_prov_cipher_load(PROV_CIPHER *pc, const OSSL_PARAM *cipher,
+    const OSSL_PARAM *propq, OSSL_LIB_CTX *ctx)
 {
-    const OSSL_PARAM *p;
     const char *propquery;

-    if (ossl_param_is_empty(params))
-        return 1;
-
-    if (!load_common(params, &propquery, &pc->engine))
+    if (!set_propq(propq, &propquery))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_CIPHER);
-    if (p == NULL)
+    if (cipher == NULL)
         return 1;
-    if (p->data_type != OSSL_PARAM_UTF8_STRING)
+    if (cipher->data_type != OSSL_PARAM_UTF8_STRING)
         return 0;

     EVP_CIPHER_free(pc->alloc_cipher);
-    ERR_set_mark();
-    pc->cipher = pc->alloc_cipher = EVP_CIPHER_fetch(ctx, p->data, propquery);
-#ifndef FIPS_MODULE /* Inside the FIPS module, we don't support legacy ciphers */
-    if (pc->cipher == NULL) {
-        const EVP_CIPHER *cipher;
-
-        cipher = EVP_get_cipherbyname(p->data);
-        /* Do not use global EVP_CIPHERs */
-        if (cipher != NULL && cipher->origin != EVP_ORIG_GLOBAL)
-            pc->cipher = cipher;
-    }
-#endif
-    if (pc->cipher != NULL)
-        ERR_pop_to_mark();
-    else
-        ERR_clear_last_mark();
+    pc->cipher = pc->alloc_cipher = EVP_CIPHER_fetch(ctx, cipher->data,
+        propquery);
     return pc->cipher != NULL;
 }

@@ -132,33 +68,17 @@ const EVP_CIPHER *ossl_prov_cipher_cipher(const PROV_CIPHER *pc)
     return pc->cipher;
 }

-ENGINE *ossl_prov_cipher_engine(const PROV_CIPHER *pc)
-{
-    return pc->engine;
-}
-
 void ossl_prov_digest_reset(PROV_DIGEST *pd)
 {
     EVP_MD_free(pd->alloc_md);
     pd->alloc_md = NULL;
     pd->md = NULL;
-#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
-    ENGINE_finish(pd->engine);
-#endif
-    pd->engine = NULL;
 }

 int ossl_prov_digest_copy(PROV_DIGEST *dst, const PROV_DIGEST *src)
 {
     if (src->alloc_md != NULL && !EVP_MD_up_ref(src->alloc_md))
         return 0;
-#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
-    if (src->engine != NULL && !ENGINE_init(src->engine)) {
-        EVP_MD_free(src->alloc_md);
-        return 0;
-    }
-#endif
-    dst->engine = src->engine;
     dst->md = src->md;
     dst->alloc_md = src->alloc_md;
     return 1;
@@ -173,41 +93,20 @@ const EVP_MD *ossl_prov_digest_fetch(PROV_DIGEST *pd, OSSL_LIB_CTX *libctx,
     return pd->md;
 }

-int ossl_prov_digest_load_from_params(PROV_DIGEST *pd,
-    const OSSL_PARAM params[],
-    OSSL_LIB_CTX *ctx)
+int ossl_prov_digest_load(PROV_DIGEST *pd, const OSSL_PARAM *digest,
+    const OSSL_PARAM *propq, OSSL_LIB_CTX *ctx)
 {
-    const OSSL_PARAM *p;
     const char *propquery;

-    if (ossl_param_is_empty(params))
-        return 1;
-
-    if (!load_common(params, &propquery, &pd->engine))
+    if (!set_propq(propq, &propquery))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST);
-    if (p == NULL)
+    if (digest == NULL)
         return 1;
-    if (p->data_type != OSSL_PARAM_UTF8_STRING)
+    if (digest->data_type != OSSL_PARAM_UTF8_STRING)
         return 0;

-    ERR_set_mark();
-    ossl_prov_digest_fetch(pd, ctx, p->data, propquery);
-#ifndef FIPS_MODULE /* Inside the FIPS module, we don't support legacy digests */
-    if (pd->md == NULL) {
-        const EVP_MD *md;
-
-        md = EVP_get_digestbyname(p->data);
-        /* Do not use global EVP_MDs */
-        if (md != NULL && md->origin != EVP_ORIG_GLOBAL)
-            pd->md = md;
-    }
-#endif
-    if (pd->md != NULL)
-        ERR_pop_to_mark();
-    else
-        ERR_clear_last_mark();
+    ossl_prov_digest_fetch(pd, ctx, digest->data, propquery);
     return pd->md != NULL;
 }

@@ -222,51 +121,15 @@ const EVP_MD *ossl_prov_digest_md(const PROV_DIGEST *pd)
     return pd->md;
 }

-ENGINE *ossl_prov_digest_engine(const PROV_DIGEST *pd)
-{
-    return pd->engine;
-}
-
 int ossl_prov_set_macctx(EVP_MAC_CTX *macctx,
-    const OSSL_PARAM params[],
     const char *ciphername,
     const char *mdname,
-    const char *engine,
     const char *properties,
-    const unsigned char *key,
-    size_t keylen)
+    const OSSL_PARAM param[])
 {
-    const OSSL_PARAM *p;
-    OSSL_PARAM mac_params[6], *mp = mac_params;
-
-    if (params != NULL) {
-        if (mdname == NULL) {
-            if ((p = OSSL_PARAM_locate_const(params,
-                     OSSL_ALG_PARAM_DIGEST))
-                != NULL) {
-                if (p->data_type != OSSL_PARAM_UTF8_STRING)
-                    return 0;
-                mdname = p->data;
-            }
-        }
-        if (ciphername == NULL) {
-            if ((p = OSSL_PARAM_locate_const(params,
-                     OSSL_ALG_PARAM_CIPHER))
-                != NULL) {
-                if (p->data_type != OSSL_PARAM_UTF8_STRING)
-                    return 0;
-                ciphername = p->data;
-            }
-        }
-        if (engine == NULL) {
-            if ((p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_ENGINE))
-                != NULL) {
-                if (p->data_type != OSSL_PARAM_UTF8_STRING)
-                    return 0;
-                engine = p->data;
-            }
-        }
-    }
+    OSSL_PARAM mac_params[5], *mp = mac_params, *mergep;
+    int free_merge = 0;
+    int ret;

     if (mdname != NULL)
         *mp++ = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST,
@@ -278,45 +141,46 @@ int ossl_prov_set_macctx(EVP_MAC_CTX *macctx,
         *mp++ = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_PROPERTIES,
             (char *)properties, 0);

-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    if (engine != NULL)
-        *mp++ = OSSL_PARAM_construct_utf8_string(OSSL_ALG_PARAM_ENGINE,
-            (char *)engine, 0);
-#endif
+    *mp = OSSL_PARAM_construct_end();

-    if (key != NULL)
-        *mp++ = OSSL_PARAM_construct_octet_string(OSSL_MAC_PARAM_KEY,
-            (unsigned char *)key,
-            keylen);
+    /*
+     * OSSL_PARAM_merge returns NULL and sets an error if either
+     * list passed to it is NULL, and we aren't guaranteed that the
+     * passed in value of param is not NULL here.
+     * Given that we just want the union of the two lists, even if one
+     * is empty, we have to check for that case, and if param is NULL,
+     * just use the mac_params list.  In turn we only free the merge
+     * result if we actually did the merge
+     */
+    if (param == NULL) {
+        mergep = mac_params;
+    } else {
+        free_merge = 1;
+        mergep = OSSL_PARAM_merge(mac_params, param);
+        if (mergep == NULL)
+            return 0;
+    }

-    *mp = OSSL_PARAM_construct_end();
+    ret = EVP_MAC_CTX_set_params(macctx, mergep);

-    return EVP_MAC_CTX_set_params(macctx, mac_params);
+    if (free_merge == 1)
+        OSSL_PARAM_free(mergep);
+    return ret;
 }

-int ossl_prov_macctx_load_from_params(EVP_MAC_CTX **macctx,
-    const OSSL_PARAM params[],
-    const char *macname,
-    const char *ciphername,
-    const char *mdname,
-    OSSL_LIB_CTX *libctx)
+int ossl_prov_macctx_load(EVP_MAC_CTX **macctx,
+    const OSSL_PARAM *pmac, const OSSL_PARAM *pcipher,
+    const OSSL_PARAM *pdigest, const OSSL_PARAM *propq,
+    const char *macname, const char *ciphername,
+    const char *mdname, OSSL_LIB_CTX *libctx)
 {
-    const OSSL_PARAM *p;
     const char *properties = NULL;

-    if (macname == NULL
-        && (p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_MAC)) != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
+    if (macname == NULL && pmac != NULL)
+        if (!OSSL_PARAM_get_utf8_string_ptr(pmac, &macname))
             return 0;
-        macname = p->data;
-    }
-    if ((p = OSSL_PARAM_locate_const(params,
-             OSSL_ALG_PARAM_PROPERTIES))
-        != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
-            return 0;
-        properties = p->data;
-    }
+    if (propq != NULL && !OSSL_PARAM_get_utf8_string_ptr(propq, &properties))
+        return 0;

     /* If we got a new mac name, we make a new EVP_MAC_CTX */
     if (macname != NULL) {
@@ -337,8 +201,14 @@ int ossl_prov_macctx_load_from_params(EVP_MAC_CTX **macctx,
     if (*macctx == NULL)
         return 1;

-    if (ossl_prov_set_macctx(*macctx, params, ciphername, mdname, NULL,
-            properties, NULL, 0))
+    if (ciphername == NULL && pcipher != NULL)
+        if (!OSSL_PARAM_get_utf8_string_ptr(pcipher, &ciphername))
+            return 0;
+    if (mdname == NULL && pdigest != NULL)
+        if (!OSSL_PARAM_get_utf8_string_ptr(pdigest, &mdname))
+            return 0;
+
+    if (ossl_prov_set_macctx(*macctx, ciphername, mdname, properties, NULL))
         return 1;

     EVP_MAC_CTX_free(*macctx);
diff --git a/deps/openssl/openssl/providers/common/securitycheck_default.c b/deps/openssl/openssl/providers/common/securitycheck_default.c
index 42823ffe14c..865f684d578 100644
--- a/deps/openssl/openssl/providers/common/securitycheck_default.c
+++ b/deps/openssl/openssl/providers/common/securitycheck_default.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -16,12 +16,6 @@
 #include "prov/securitycheck.h"
 #include "internal/nelem.h"

-/* Disable the security checks in the default provider */
-int ossl_fips_config_securitycheck_enabled(OSSL_LIB_CTX *libctx)
-{
-    return 0;
-}
-
 int ossl_digest_rsa_sign_get_md_nid(const EVP_MD *md)
 {
     int mdnid;
diff --git a/deps/openssl/openssl/providers/common/securitycheck_fips.c b/deps/openssl/openssl/providers/common/securitycheck_fips.c
index e6764170228..cf285324947 100644
--- a/deps/openssl/openssl/providers/common/securitycheck_fips.c
+++ b/deps/openssl/openssl/providers/common/securitycheck_fips.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,15 +19,6 @@
 #include <openssl/obj_mac.h>
 #include "prov/securitycheck.h"

-int ossl_fips_config_securitycheck_enabled(OSSL_LIB_CTX *libctx)
-{
-#if !defined(OPENSSL_NO_FIPS_SECURITYCHECKS)
-    return ossl_fips_config_security_checks(libctx);
-#else
-    return 0;
-#endif /* OPENSSL_NO_FIPS_SECURITYCHECKS */
-}
-
 int ossl_digest_rsa_sign_get_md_nid(const EVP_MD *md)
 {
     return ossl_digest_get_approved_nid(md);
@@ -41,7 +32,7 @@ int ossl_fips_ind_rsa_key_check(OSSL_FIPS_IND *ind, int id,

     if (!key_approved) {
         if (!ossl_FIPS_IND_on_unapproved(ind, id, libctx, desc, "Key size",
-                ossl_fips_config_securitycheck_enabled)) {
+                FIPS_CONFIG_SECURITY_CHECKS)) {
             ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH,
                 "operation: %s", desc);
             return 0;
@@ -66,7 +57,7 @@ int ossl_fips_ind_ec_key_check(OSSL_FIPS_IND *ind, int id,

     if (!strength_allowed || !curve_allowed) {
         if (!ossl_FIPS_IND_on_unapproved(ind, id, libctx, desc, "EC Key",
-                ossl_fips_config_securitycheck_enabled)) {
+                FIPS_CONFIG_SECURITY_CHECKS)) {
             if (!curve_allowed)
                 ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_CURVE);
             if (!strength_allowed)
@@ -87,7 +78,7 @@ int ossl_fips_ind_digest_exch_check(OSSL_FIPS_IND *ind, int id,

     if (!approved) {
         if (!ossl_FIPS_IND_on_unapproved(ind, id, libctx, desc, "Digest",
-                ossl_fips_config_securitycheck_enabled)) {
+                FIPS_CONFIG_SECURITY_CHECKS)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DIGEST);
             return 0;
         }
@@ -100,7 +91,7 @@ int ossl_fips_ind_digest_sign_check(OSSL_FIPS_IND *ind, int id,
     int nid, int sha1_allowed,
     int sha512_trunc_allowed,
     const char *desc,
-    OSSL_FIPS_IND_CHECK_CB *config_check_f)
+    enum fips_config_id config_id)
 {
     int approved;
     const char *op = "none";
@@ -124,8 +115,7 @@ int ossl_fips_ind_digest_sign_check(OSSL_FIPS_IND *ind, int id,
     }

     if (!approved) {
-        if (!ossl_FIPS_IND_on_unapproved(ind, id, libctx, desc, op,
-                config_check_f)) {
+        if (!ossl_FIPS_IND_on_unapproved(ind, id, libctx, desc, op, config_id)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DIGEST);
             return 0;
         }
diff --git a/deps/openssl/openssl/providers/decoders.inc b/deps/openssl/openssl/providers/decoders.inc
index e285cd689e7..767df659976 100644
--- a/deps/openssl/openssl/providers/decoders.inc
+++ b/deps/openssl/openssl/providers/decoders.inc
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -25,111 +25,117 @@
 #define DECODER_STRUCTURE_RSA                           "rsa"

 /* Arguments are prefixed with '_' to avoid build breaks on certain platforms */
-#define DECODER(_name, _input, _output, _fips)                          \
+#define DECODER(_name, _input, _output, _fips, desc)                    \
     { _name,                                                            \
       "provider=" DECODER_PROVIDER ",fips=" #_fips ",input=" #_input,   \
-      (ossl_##_input##_to_##_output##_decoder_functions) }
-#define DECODER_w_structure(_name, _input, _structure, _output, _fips)  \
+      (ossl_##_input##_to_##_output##_decoder_functions), desc }
+#define DECODER_w_structure(_name, _input, _structure, _output, _fips, desc)  \
     { _name,                                                            \
       "provider=" DECODER_PROVIDER ",fips=" #_fips ",input=" #_input    \
       ",structure=" DECODER_STRUCTURE_##_structure,                     \
-      (ossl_##_structure##_##_input##_to_##_output##_decoder_functions) }
+      (ossl_##_structure##_##_input##_to_##_output##_decoder_functions),\
+      desc }

 #ifndef OPENSSL_NO_DH
-DECODER_w_structure("DH", der, PrivateKeyInfo, dh, yes),
-DECODER_w_structure("DH", der, SubjectPublicKeyInfo, dh, yes),
-DECODER_w_structure("DH", der, type_specific_params, dh, yes),
-DECODER_w_structure("DH", der, DH, dh, yes),
-DECODER_w_structure("DHX", der, PrivateKeyInfo, dhx, yes),
-DECODER_w_structure("DHX", der, SubjectPublicKeyInfo, dhx, yes),
-DECODER_w_structure("DHX", der, type_specific_params, dhx, yes),
-DECODER_w_structure("DHX", der, DHX, dhx, yes),
+DECODER_w_structure("DH", der, PrivateKeyInfo, dh, yes, "PKItoDH-DER"),
+DECODER_w_structure("DH", der, SubjectPublicKeyInfo, dh, yes, "SPKItoDH-DER"),
+DECODER_w_structure("DH", der, type_specific_params, dh, yes, "TStoDH-DER"),
+DECODER_w_structure("DH", der, DH, dh, yes, "DERtoDH"),
+DECODER_w_structure("DHX", der, PrivateKeyInfo, dhx, yes,"PKItoDHX-DER"),
+DECODER_w_structure("DHX", der, SubjectPublicKeyInfo, dhx, yes, "SPKItoDHX-DER"),
+DECODER_w_structure("DHX", der, type_specific_params, dhx, yes, "TStoDHX-DER"),
+DECODER_w_structure("DHX", der, DHX, dhx, yes, "DERtoDHX"),
 #endif
 #ifndef OPENSSL_NO_DSA
-DECODER_w_structure("DSA", der, PrivateKeyInfo, dsa, yes),
-DECODER_w_structure("DSA", der, SubjectPublicKeyInfo, dsa, yes),
-DECODER_w_structure("DSA", der, type_specific, dsa, yes),
-DECODER_w_structure("DSA", der, DSA, dsa, yes),
-DECODER("DSA", msblob, dsa, yes),
-DECODER("DSA", pvk, dsa, yes),
+DECODER_w_structure("DSA", der, PrivateKeyInfo, dsa, yes, "PKItoDSA-DER"),
+DECODER_w_structure("DSA", der, SubjectPublicKeyInfo, dsa, yes, "SPKItoDSA-DER"),
+DECODER_w_structure("DSA", der, type_specific, dsa, yes, "TStoDSA-DER"),
+DECODER_w_structure("DSA", der, DSA, dsa, yes, "DERtoDSA"),
+DECODER("DSA", msblob, dsa, yes, "MSBLOBtoDSA"),
+DECODER("DSA", pvk, dsa, yes, "PVKtoDSA"),
 #endif
 #ifndef OPENSSL_NO_EC
-DECODER_w_structure("EC", der, PrivateKeyInfo, ec, yes),
-DECODER_w_structure("EC", der, SubjectPublicKeyInfo, ec, yes),
-DECODER_w_structure("EC", der, type_specific_no_pub, ec, yes),
-DECODER_w_structure("EC", der, EC, ec, yes),
+DECODER_w_structure("EC", der, PrivateKeyInfo, ec, yes, "PKItoEC-DER"),
+DECODER_w_structure("EC", der, SubjectPublicKeyInfo, ec, yes, "SPKItoEC-DER"),
+DECODER_w_structure("EC", der, type_specific_no_pub, ec, yes, "TStoEC-DER"),
+DECODER_w_structure("EC", der, EC, ec, yes, "DERtoEC"),
 # ifndef OPENSSL_NO_ECX
-DECODER_w_structure("ED25519", der, PrivateKeyInfo, ed25519, yes),
-DECODER_w_structure("ED25519", der, SubjectPublicKeyInfo, ed25519, yes),
-DECODER_w_structure("ED448", der, PrivateKeyInfo, ed448, yes),
-DECODER_w_structure("ED448", der, SubjectPublicKeyInfo, ed448, yes),
-DECODER_w_structure("X25519", der, PrivateKeyInfo, x25519, yes),
-DECODER_w_structure("X25519", der, SubjectPublicKeyInfo, x25519, yes),
-DECODER_w_structure("X448", der, PrivateKeyInfo, x448, yes),
-DECODER_w_structure("X448", der, SubjectPublicKeyInfo, x448, yes),
+DECODER_w_structure("ED25519", der, PrivateKeyInfo, ed25519, yes, "PKItoED25519-DER"),
+DECODER_w_structure("ED25519", der, SubjectPublicKeyInfo, ed25519, yes, "SPKItoED25519-DER"),
+DECODER_w_structure("ED448", der, PrivateKeyInfo, ed448, yes, "PKItoED448-DER"),
+DECODER_w_structure("ED448", der, SubjectPublicKeyInfo, ed448, yes, "SPKItoED448-DER"),
+DECODER_w_structure("X25519", der, PrivateKeyInfo, x25519, yes, "PKItoX25519-DER"),
+DECODER_w_structure("X25519", der, SubjectPublicKeyInfo, x25519, yes, "SPKItoX25519-DER"),
+DECODER_w_structure("X448", der, PrivateKeyInfo, x448, yes, "PKItoX448-DER"),
+DECODER_w_structure("X448", der, SubjectPublicKeyInfo, x448, yes, "SPKItoX448-DER"),
 # endif
 # ifndef OPENSSL_NO_SM2
-DECODER_w_structure("SM2", der, PrivateKeyInfo, sm2, no),
-DECODER_w_structure("SM2", der, SubjectPublicKeyInfo, sm2, no),
-DECODER_w_structure("SM2", der, type_specific_no_pub, sm2, no),
+DECODER_w_structure("SM2", der, PrivateKeyInfo, sm2, no, "PKItoSM2-DER"),
+DECODER_w_structure("SM2", der, SubjectPublicKeyInfo, sm2, no, "SPKItoSM2-DER"),
+DECODER_w_structure("SM2", der, type_specific_no_pub, sm2, no, "TStoSM2-DER"),
 # endif
 #endif
 #ifndef OPENSSL_NO_ML_KEM
-DECODER_w_structure("ML-KEM-512", der, PrivateKeyInfo, ml_kem_512, yes),
-DECODER_w_structure("ML-KEM-512", der, SubjectPublicKeyInfo, ml_kem_512, yes),
-DECODER_w_structure("ML-KEM-768", der, PrivateKeyInfo, ml_kem_768, yes),
-DECODER_w_structure("ML-KEM-768", der, SubjectPublicKeyInfo, ml_kem_768, yes),
-DECODER_w_structure("ML-KEM-1024", der, PrivateKeyInfo, ml_kem_1024, yes),
-DECODER_w_structure("ML-KEM-1024", der, SubjectPublicKeyInfo, ml_kem_1024, yes),
+DECODER_w_structure("ML-KEM-512", der, PrivateKeyInfo, ml_kem_512, yes, "PKItoML-KEM-512-DER"),
+DECODER_w_structure("ML-KEM-512", der, SubjectPublicKeyInfo, ml_kem_512, yes, "SPKItoML-KEM-512-DER"),
+DECODER_w_structure("ML-KEM-768", der, PrivateKeyInfo, ml_kem_768, yes, "PKItoML-KEM-768-DER"),
+DECODER_w_structure("ML-KEM-768", der, SubjectPublicKeyInfo, ml_kem_768, yes, "SPKItoML-KEM-768-DER"),
+DECODER_w_structure("ML-KEM-1024", der, PrivateKeyInfo, ml_kem_1024, yes, "PKItoML-KEM-1024-DER"),
+DECODER_w_structure("ML-KEM-1024", der, SubjectPublicKeyInfo, ml_kem_1024, yes, "SPKItoML-KEM-1024-DER"),
 #endif
 #ifndef OPENSSL_NO_SLH_DSA
-DECODER_w_structure( "SLH-DSA-SHA2-128s", der, PrivateKeyInfo, slh_dsa_sha2_128s, yes),
-DECODER_w_structure( "SLH-DSA-SHA2-128f", der, PrivateKeyInfo, slh_dsa_sha2_128f, yes),
-DECODER_w_structure( "SLH-DSA-SHA2-192s", der, PrivateKeyInfo, slh_dsa_sha2_192s, yes),
-DECODER_w_structure( "SLH-DSA-SHA2-192f", der, PrivateKeyInfo, slh_dsa_sha2_192f, yes),
-DECODER_w_structure( "SLH-DSA-SHA2-256s", der, PrivateKeyInfo, slh_dsa_sha2_256s, yes),
-DECODER_w_structure( "SLH-DSA-SHA2-256f", der, PrivateKeyInfo, slh_dsa_sha2_256f, yes),
-DECODER_w_structure("SLH-DSA-SHAKE-128s", der, PrivateKeyInfo, slh_dsa_shake_128s, yes),
-DECODER_w_structure("SLH-DSA-SHAKE-128f", der, PrivateKeyInfo, slh_dsa_shake_128f, yes),
-DECODER_w_structure("SLH-DSA-SHAKE-192s", der, PrivateKeyInfo, slh_dsa_shake_192s, yes),
-DECODER_w_structure("SLH-DSA-SHAKE-192f", der, PrivateKeyInfo, slh_dsa_shake_192f, yes),
-DECODER_w_structure("SLH-DSA-SHAKE-256s", der, PrivateKeyInfo, slh_dsa_shake_256s, yes),
-DECODER_w_structure("SLH-DSA-SHAKE-256f", der, PrivateKeyInfo, slh_dsa_shake_256f, yes),
-DECODER_w_structure( "SLH-DSA-SHA2-128s", der, SubjectPublicKeyInfo, slh_dsa_sha2_128s, yes),
-DECODER_w_structure( "SLH-DSA-SHA2-128f", der, SubjectPublicKeyInfo, slh_dsa_sha2_128f, yes),
-DECODER_w_structure( "SLH-DSA-SHA2-192s", der, SubjectPublicKeyInfo, slh_dsa_sha2_192s, yes),
-DECODER_w_structure( "SLH-DSA-SHA2-192f", der, SubjectPublicKeyInfo, slh_dsa_sha2_192f, yes),
-DECODER_w_structure( "SLH-DSA-SHA2-256s", der, SubjectPublicKeyInfo, slh_dsa_sha2_256s, yes),
-DECODER_w_structure( "SLH-DSA-SHA2-256f", der, SubjectPublicKeyInfo, slh_dsa_sha2_256f, yes),
-DECODER_w_structure("SLH-DSA-SHAKE-128s", der, SubjectPublicKeyInfo, slh_dsa_shake_128s, yes),
-DECODER_w_structure("SLH-DSA-SHAKE-128f", der, SubjectPublicKeyInfo, slh_dsa_shake_128f, yes),
-DECODER_w_structure("SLH-DSA-SHAKE-192s", der, SubjectPublicKeyInfo, slh_dsa_shake_192s, yes),
-DECODER_w_structure("SLH-DSA-SHAKE-192f", der, SubjectPublicKeyInfo, slh_dsa_shake_192f, yes),
-DECODER_w_structure("SLH-DSA-SHAKE-256s", der, SubjectPublicKeyInfo, slh_dsa_shake_256s, yes),
-DECODER_w_structure("SLH-DSA-SHAKE-256f", der, SubjectPublicKeyInfo, slh_dsa_shake_256f, yes),
+DECODER_w_structure( "SLH-DSA-SHA2-128s", der, PrivateKeyInfo, slh_dsa_sha2_128s, yes, "PKItoSLH-DSA-SHA2-128s"),
+DECODER_w_structure( "SLH-DSA-SHA2-128f", der, PrivateKeyInfo, slh_dsa_sha2_128f, yes, "PKItoSLH-DSA-SHA2-128f"),
+DECODER_w_structure( "SLH-DSA-SHA2-192s", der, PrivateKeyInfo, slh_dsa_sha2_192s, yes, "PKItoSLH-DSA-SHA2-192s"),
+DECODER_w_structure( "SLH-DSA-SHA2-192f", der, PrivateKeyInfo, slh_dsa_sha2_192f, yes, "PKItoSLH-DSA-SHA2-192f"),
+DECODER_w_structure( "SLH-DSA-SHA2-256s", der, PrivateKeyInfo, slh_dsa_sha2_256s, yes, "PKItoSLH-DSA-SHA2-256s"),
+DECODER_w_structure( "SLH-DSA-SHA2-256f", der, PrivateKeyInfo, slh_dsa_sha2_256f, yes, "PKItoSLH-DSA-SHA2-256f"),
+DECODER_w_structure("SLH-DSA-SHAKE-128s", der, PrivateKeyInfo, slh_dsa_shake_128s, yes, "PKItoSLH-DSA-SHAKE-128s"),
+DECODER_w_structure("SLH-DSA-SHAKE-128f", der, PrivateKeyInfo, slh_dsa_shake_128f, yes, "PKItoSLH-DSA-SHAKE-128f"),
+DECODER_w_structure("SLH-DSA-SHAKE-192s", der, PrivateKeyInfo, slh_dsa_shake_192s, yes, "PKItoSLH-DSA-SHAKE-192s"),
+DECODER_w_structure("SLH-DSA-SHAKE-192f", der, PrivateKeyInfo, slh_dsa_shake_192f, yes, "PKItoSLH-DSA-SHAKE-192f"),
+DECODER_w_structure("SLH-DSA-SHAKE-256s", der, PrivateKeyInfo, slh_dsa_shake_256s, yes, "PKItoSLH-DSA-SHAKE-256s"),
+DECODER_w_structure("SLH-DSA-SHAKE-256f", der, PrivateKeyInfo, slh_dsa_shake_256f, yes, "PKItoSLH-DSA-SHAKE-256f"),
+DECODER_w_structure( "SLH-DSA-SHA2-128s", der, SubjectPublicKeyInfo, slh_dsa_sha2_128s, yes, "SPKItoSLH-DSA-SHA2-128s"),
+DECODER_w_structure( "SLH-DSA-SHA2-128f", der, SubjectPublicKeyInfo, slh_dsa_sha2_128f, yes, "SPKItoSLH-DSA-SHA2-128f"),
+DECODER_w_structure( "SLH-DSA-SHA2-192s", der, SubjectPublicKeyInfo, slh_dsa_sha2_192s, yes, "SPKItoSLH-DSA-SHA2-192s"),
+DECODER_w_structure( "SLH-DSA-SHA2-192f", der, SubjectPublicKeyInfo, slh_dsa_sha2_192f, yes, "SPKItoSLH-DSA-SHA2-192f"),
+DECODER_w_structure( "SLH-DSA-SHA2-256s", der, SubjectPublicKeyInfo, slh_dsa_sha2_256s, yes, "SPKItoSLH-DSA-SHA2-256s"),
+DECODER_w_structure( "SLH-DSA-SHA2-256f", der, SubjectPublicKeyInfo, slh_dsa_sha2_256f, yes, "SPKItoSLH-DSA-SHA2-256f"),
+DECODER_w_structure("SLH-DSA-SHAKE-128s", der, SubjectPublicKeyInfo, slh_dsa_shake_128s, yes, "SPKItoSLH-DSA-SHAKE-128s"),
+DECODER_w_structure("SLH-DSA-SHAKE-128f", der, SubjectPublicKeyInfo, slh_dsa_shake_128f, yes, "SPKItoSLH-DSA-SHAKE-128f"),
+DECODER_w_structure("SLH-DSA-SHAKE-192s", der, SubjectPublicKeyInfo, slh_dsa_shake_192s, yes, "SPKItoSLH-DSA-SHAKE-192s"),
+DECODER_w_structure("SLH-DSA-SHAKE-192f", der, SubjectPublicKeyInfo, slh_dsa_shake_192f, yes, "SPKItoSLH-DSA-SHAKE-192f"),
+DECODER_w_structure("SLH-DSA-SHAKE-256s", der, SubjectPublicKeyInfo, slh_dsa_shake_256s, yes, "SPKItoSLH-DSA-SHAKE-256s"),
+DECODER_w_structure("SLH-DSA-SHAKE-256f", der, SubjectPublicKeyInfo, slh_dsa_shake_256f, yes, "SPKItoSLH-DSA-SHAKE-256f"),
 #endif /* OPENSSL_NO_SLH_DSA */
-DECODER_w_structure("RSA", der, PrivateKeyInfo, rsa, yes),
-DECODER_w_structure("RSA", der, SubjectPublicKeyInfo, rsa, yes),
-DECODER_w_structure("RSA", der, type_specific_keypair, rsa, yes),
-DECODER_w_structure("RSA", der, RSA, rsa, yes),
-DECODER_w_structure("RSA-PSS", der, PrivateKeyInfo, rsapss, yes),
-DECODER_w_structure("RSA-PSS", der, SubjectPublicKeyInfo, rsapss, yes),
-DECODER("RSA", msblob, rsa, yes),
-DECODER("RSA", pvk, rsa, yes),
+DECODER_w_structure("RSA", der, PrivateKeyInfo, rsa, yes, "PKItoRSA-DER"),
+DECODER_w_structure("RSA", der, SubjectPublicKeyInfo, rsa, yes, "SPKItoRSA-DER"),
+DECODER_w_structure("RSA", der, type_specific_keypair, rsa, yes, "TStoKEYPAIRtoRSA-DER"),
+DECODER_w_structure("RSA", der, RSA, rsa, yes, "DERtoRSA"),
+DECODER_w_structure("RSA-PSS", der, PrivateKeyInfo, rsapss, yes, "PKItoRSA-PSS-DER"),
+DECODER_w_structure("RSA-PSS", der, SubjectPublicKeyInfo, rsapss, yes, "SPKItoRSA-PSS-DER"),
+DECODER("RSA", msblob, rsa, yes, "MSBLOBtoRSA"),
+DECODER("RSA", pvk, rsa, yes, "PVKtoRSA"),
 #ifndef OPENSSL_NO_ML_DSA
-DECODER_w_structure("ML-DSA-44", der, PrivateKeyInfo, ml_dsa_44, yes),
-DECODER_w_structure("ML-DSA-65", der, PrivateKeyInfo, ml_dsa_65, yes),
-DECODER_w_structure("ML-DSA-87", der, PrivateKeyInfo, ml_dsa_87, yes),
-DECODER_w_structure("ML-DSA-44", der, SubjectPublicKeyInfo, ml_dsa_44, yes),
-DECODER_w_structure("ML-DSA-65", der, SubjectPublicKeyInfo, ml_dsa_65, yes),
-DECODER_w_structure("ML-DSA-87", der, SubjectPublicKeyInfo, ml_dsa_87, yes),
+DECODER_w_structure("ML-DSA-44", der, PrivateKeyInfo, ml_dsa_44, yes, "PKItoML-DSA-44-DER"),
+DECODER_w_structure("ML-DSA-65", der, PrivateKeyInfo, ml_dsa_65, yes, "PKItoML-DSA-65-DER"),
+DECODER_w_structure("ML-DSA-87", der, PrivateKeyInfo, ml_dsa_87, yes, "PKItoML-DSA-87-DER"),
+DECODER_w_structure("ML-DSA-44", der, SubjectPublicKeyInfo, ml_dsa_44, yes, "SPKItoML-DSA-44-DER"),
+DECODER_w_structure("ML-DSA-65", der, SubjectPublicKeyInfo, ml_dsa_65, yes, "SPKItoML-DSA-65-DER"),
+DECODER_w_structure("ML-DSA-87", der, SubjectPublicKeyInfo, ml_dsa_87, yes, "SPKItoML-DSA-87-DER"),
 #endif /* OPENSSL_NO_ML_DSA */

+#ifndef OPENSSL_NO_LMS
+DECODER("LMS", xdr, lms, yes, "XDRtoLMS"),
+DECODER_w_structure("LMS", der, SubjectPublicKeyInfo, lms, yes, "SPKItoLMS-DER"),
+#endif
+
 /*
  * A decoder that takes a SubjectPublicKeyInfo and figures out the types of key
  * that it contains. The output is the same SubjectPublicKeyInfo.
  */
-DECODER_w_structure("DER", der, SubjectPublicKeyInfo, der, yes),
+DECODER_w_structure("DER", der, SubjectPublicKeyInfo, der, yes, "SPKItoDER"),
 /*
  * General-purpose PEM to DER decoder.  When the user-specified data structure
  * is a possibly encrypted PKCS#8 PrivateKeyInfo or a SubjectPublicKeyInfo
@@ -138,10 +144,10 @@ DECODER_w_structure("DER", der, SubjectPublicKeyInfo, der, yes),
  * algorithm name or OID, and delegates further decoding in DER form to the
  * identified algorithm.
  */
-DECODER("DER", pem, der, yes),
+DECODER("DER", pem, der, yes, "PEMtoDER"),
 /*
  * A decoder that recognises PKCS#8 EncryptedPrivateKeyInfo structure and
  * decrypts it, obtaining the algorithm name or OID, and delegates the
  * unencrypted PrivateKeyInfo in DER form to the identified algorithm.
  */
-DECODER_w_structure("DER", der, EncryptedPrivateKeyInfo, der, yes),
+DECODER_w_structure("DER", der, EncryptedPrivateKeyInfo, der, yes, "EPKItoDER"),
diff --git a/deps/openssl/openssl/providers/defltprov.c b/deps/openssl/openssl/providers/defltprov.c
index de2a46515e1..1f39b34d6e1 100644
--- a/deps/openssl/openssl/providers/defltprov.c
+++ b/deps/openssl/openssl/providers/defltprov.c
@@ -99,7 +99,7 @@ static const OSSL_ALGORITHM deflt_digests[] = {
     { PROV_NAMES_SHA1, "provider=default", ossl_sha1_functions },
     { PROV_NAMES_SHA2_224, "provider=default", ossl_sha224_functions },
     { PROV_NAMES_SHA2_256, "provider=default", ossl_sha256_functions },
-    { PROV_NAMES_SHA2_256_192, "provider=default", ossl_sha256_192_functions },
+    { PROV_NAMES_SHA2_256_192, "provider=default", ossl_sha256_192_internal_functions },
     { PROV_NAMES_SHA2_384, "provider=default", ossl_sha384_functions },
     { PROV_NAMES_SHA2_512, "provider=default", ossl_sha512_functions },
     { PROV_NAMES_SHA2_512_224, "provider=default", ossl_sha512_224_functions },
@@ -120,15 +120,18 @@ static const OSSL_ALGORITHM deflt_digests[] = {
      * KECCAK-KMAC-128 and KECCAK-KMAC-256 as hashes are mostly useful for
      * the KMAC-128 and KMAC-256.
      */
-    { PROV_NAMES_KECCAK_KMAC_128, "provider=default",
-        ossl_keccak_kmac_128_functions },
-    { PROV_NAMES_KECCAK_KMAC_256, "provider=default",
-        ossl_keccak_kmac_256_functions },
+    { PROV_NAMES_CSHAKE_KECCAK_128, "provider=default",
+        ossl_cshake_keccak_128_functions },
+    { PROV_NAMES_CSHAKE_KECCAK_256, "provider=default",
+        ossl_cshake_keccak_256_functions },

     /* Our primary name:NIST name */
     { PROV_NAMES_SHAKE_128, "provider=default", ossl_shake_128_functions },
     { PROV_NAMES_SHAKE_256, "provider=default", ossl_shake_256_functions },

+    { PROV_NAMES_CSHAKE_128, "provider=default", ossl_cshake_128_functions },
+    { PROV_NAMES_CSHAKE_256, "provider=default", ossl_cshake_256_functions },
+
 #ifndef OPENSSL_NO_BLAKE2
     /*
      * https://blake2.net/ doesn't specify size variants,
@@ -155,6 +158,9 @@ static const OSSL_ALGORITHM deflt_digests[] = {
 #endif /* OPENSSL_NO_RMD160 */

     { PROV_NAMES_NULL, "provider=default", ossl_nullmd_functions },
+#ifndef OPENSSL_NO_ML_DSA
+    { PROV_NAMES_ML_DSA_MU, "provider=default", ossl_ml_dsa_mu_functions },
+#endif
     { NULL, NULL, NULL }
 };

@@ -225,6 +231,24 @@ static const OSSL_ALGORITHM_CAPABLE deflt_ciphers[] = {
         ossl_cipher_capable_aes_cbc_hmac_sha256),
     ALGC(PROV_NAMES_AES_256_CBC_HMAC_SHA256, ossl_aes256cbc_hmac_sha256_functions,
         ossl_cipher_capable_aes_cbc_hmac_sha256),
+    ALGC(PROV_NAMES_AES_128_CBC_HMAC_SHA1_ETM, ossl_aes128cbc_hmac_sha1_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha1_etm),
+    ALGC(PROV_NAMES_AES_192_CBC_HMAC_SHA1_ETM, ossl_aes192cbc_hmac_sha1_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha1_etm),
+    ALGC(PROV_NAMES_AES_256_CBC_HMAC_SHA1_ETM, ossl_aes256cbc_hmac_sha1_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha1_etm),
+    ALGC(PROV_NAMES_AES_128_CBC_HMAC_SHA256_ETM, ossl_aes128cbc_hmac_sha256_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha256_etm),
+    ALGC(PROV_NAMES_AES_192_CBC_HMAC_SHA256_ETM, ossl_aes192cbc_hmac_sha256_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha256_etm),
+    ALGC(PROV_NAMES_AES_256_CBC_HMAC_SHA256_ETM, ossl_aes256cbc_hmac_sha256_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha256_etm),
+    ALGC(PROV_NAMES_AES_128_CBC_HMAC_SHA512_ETM, ossl_aes128cbc_hmac_sha512_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha512_etm),
+    ALGC(PROV_NAMES_AES_192_CBC_HMAC_SHA512_ETM, ossl_aes192cbc_hmac_sha512_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha512_etm),
+    ALGC(PROV_NAMES_AES_256_CBC_HMAC_SHA512_ETM, ossl_aes256cbc_hmac_sha512_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha512_etm),
 #ifndef OPENSSL_NO_ARIA
     ALG(PROV_NAMES_ARIA_256_GCM, ossl_aria256gcm_functions),
     ALG(PROV_NAMES_ARIA_192_GCM, ossl_aria192gcm_functions),
@@ -336,22 +360,48 @@ static const OSSL_ALGORITHM deflt_macs[] = {

 static const OSSL_ALGORITHM deflt_kdfs[] = {
     { PROV_NAMES_HKDF, "provider=default", ossl_kdf_hkdf_functions },
+    { PROV_NAMES_HKDF_SHA256, "provider=default", ossl_kdf_hkdf_sha256_functions },
+    { PROV_NAMES_HKDF_SHA384, "provider=default", ossl_kdf_hkdf_sha384_functions },
+    { PROV_NAMES_HKDF_SHA512, "provider=default", ossl_kdf_hkdf_sha512_functions },
     { PROV_NAMES_TLS1_3_KDF, "provider=default",
         ossl_kdf_tls1_3_kdf_functions },
-    { PROV_NAMES_SSKDF, "provider=default", ossl_kdf_sskdf_functions },
+    { PROV_NAMES_TLS1_PRF, "provider=default", ossl_kdf_tls1_prf_functions },
     { PROV_NAMES_PBKDF2, "provider=default", ossl_kdf_pbkdf2_functions },
     { PROV_NAMES_PKCS12KDF, "provider=default", ossl_kdf_pkcs12_functions },
+#ifndef OPENSSL_NO_IKEV2KDF
+    { PROV_NAMES_IKEV2KDF, "provider=default", ossl_kdf_ikev2kdf_functions },
+#endif
+#ifndef OPENSSL_NO_SSKDF
+    { PROV_NAMES_SSKDF, "provider=default", ossl_kdf_sskdf_functions },
+#endif
+#ifndef OPENSSL_NO_SNMPKDF
+    { PROV_NAMES_SNMPKDF, "provider=default", ossl_kdf_snmpkdf_functions },
+#endif
+#ifndef OPENSSL_NO_SRTPKDF
+    { PROV_NAMES_SRTPKDF, "provider=default", ossl_kdf_srtpkdf_functions },
+#endif
+#ifndef OPENSSL_NO_SSHKDF
     { PROV_NAMES_SSHKDF, "provider=default", ossl_kdf_sshkdf_functions },
+#endif
+#ifndef OPENSSL_NO_X963KDF
     { PROV_NAMES_X963KDF, "provider=default", ossl_kdf_x963_kdf_functions },
-    { PROV_NAMES_TLS1_PRF, "provider=default", ossl_kdf_tls1_prf_functions },
+#endif
+#ifndef OPENSSL_NO_KBKDF
     { PROV_NAMES_KBKDF, "provider=default", ossl_kdf_kbkdf_functions },
+#endif
+#ifndef OPENSSL_NO_X942KDF
     { PROV_NAMES_X942KDF_ASN1, "provider=default", ossl_kdf_x942_kdf_functions },
+#endif
 #ifndef OPENSSL_NO_SCRYPT
     { PROV_NAMES_SCRYPT, "provider=default", ossl_kdf_scrypt_functions },
 #endif
+#ifndef OPENSSL_NO_KRB5KDF
     { PROV_NAMES_KRB5KDF, "provider=default", ossl_kdf_krb5kdf_functions },
+#endif
+#ifndef OPENSSL_NO_HMAC_DRBG_KDF
     { PROV_NAMES_HMAC_DRBG_KDF, "provider=default",
         ossl_kdf_hmac_drbg_functions },
+#endif
 #ifndef OPENSSL_NO_ARGON2
     { PROV_NAMES_ARGON2I, "provider=default", ossl_kdf_argon2i_functions },
     { PROV_NAMES_ARGON2D, "provider=default", ossl_kdf_argon2d_functions },
@@ -462,6 +512,9 @@ static const OSSL_ALGORITHM deflt_signature[] = {
 #ifndef OPENSSL_NO_CMAC
     { PROV_NAMES_CMAC, "provider=default", ossl_mac_legacy_cmac_signature_functions },
 #endif
+#ifndef OPENSSL_NO_LMS
+    { PROV_NAMES_LMS, "provider=default", ossl_lms_signature_functions },
+#endif
 #ifndef OPENSSL_NO_SLH_DSA
     { PROV_NAMES_SLH_DSA_SHA2_128S, "provider=default",
         ossl_slh_dsa_sha2_128s_signature_functions, PROV_DESCS_SLH_DSA_SHA2_128S },
@@ -513,12 +566,15 @@ static const OSSL_ALGORITHM deflt_asym_kem[] = {
     { PROV_NAMES_ML_KEM_768, "provider=default", ossl_ml_kem_asym_kem_functions },
     { PROV_NAMES_ML_KEM_1024, "provider=default", ossl_ml_kem_asym_kem_functions },
 #if !defined(OPENSSL_NO_ECX)
-    { "X25519MLKEM768", "provider=default", ossl_mlx_kem_asym_kem_functions },
-    { "X448MLKEM1024", "provider=default", ossl_mlx_kem_asym_kem_functions },
+    { PROV_NAMES_X25519MLKEM768, "provider=default", ossl_mlx_kem_asym_kem_functions },
+    { PROV_NAMES_X448MLKEM1024, "provider=default", ossl_mlx_kem_asym_kem_functions },
 #endif
 #if !defined(OPENSSL_NO_EC)
-    { "SecP256r1MLKEM768", "provider=default", ossl_mlx_kem_asym_kem_functions },
-    { "SecP384r1MLKEM1024", "provider=default", ossl_mlx_kem_asym_kem_functions },
+    { PROV_NAMES_SecP256r1MLKEM768, "provider=default", ossl_mlx_kem_asym_kem_functions },
+    { PROV_NAMES_SecP384r1MLKEM1024, "provider=default", ossl_mlx_kem_asym_kem_functions },
+#endif
+#if !defined(OPENSSL_NO_SM2)
+    { PROV_NAMES_curveSM2MLKEM768, "provider=default", ossl_mlx_kem_asym_kem_functions },
 #endif
 #endif
     { NULL, NULL, NULL }
@@ -586,6 +642,12 @@ static const OSSL_ALGORITHM deflt_keymgmt[] = {
 #ifndef OPENSSL_NO_SM2
     { PROV_NAMES_SM2, "provider=default", ossl_sm2_keymgmt_functions,
         PROV_DESCS_SM2 },
+    { PROV_NAMES_curveSM2, "provider=default", ossl_curve_sm2_keymgmt_functions,
+        PROV_DESCS_curveSM2 },
+#endif
+#ifndef OPENSSL_NO_LMS
+    { PROV_NAMES_LMS, "provider=default", ossl_lms_keymgmt_functions,
+        PROV_DESCS_LMS },
 #endif
 #ifndef OPENSSL_NO_ML_KEM
     { PROV_NAMES_ML_KEM_512, "provider=default", ossl_ml_kem_512_keymgmt_functions,
@@ -606,6 +668,10 @@ static const OSSL_ALGORITHM deflt_keymgmt[] = {
     { PROV_NAMES_SecP384r1MLKEM1024, "provider=default", ossl_mlx_p384_kem_kmgmt_functions,
         PROV_DESCS_SecP384r1MLKEM1024 },
 #endif
+#if !defined(OPENSSL_NO_SM2)
+    { PROV_NAMES_curveSM2MLKEM768, "provider=default", ossl_mlx_curve_sm2_kem_kmgmt_functions,
+        PROV_DESCS_curveSM2MLKEM768 },
+#endif
 #endif
 #ifndef OPENSSL_NO_SLH_DSA
     { PROV_NAMES_SLH_DSA_SHA2_128S, "provider=default", ossl_slh_dsa_sha2_128s_keymgmt_functions,
diff --git a/deps/openssl/openssl/providers/encoders.inc b/deps/openssl/openssl/providers/encoders.inc
index 5257536d7df..1ab0d3a75d6 100644
--- a/deps/openssl/openssl/providers/encoders.inc
+++ b/deps/openssl/openssl/providers/encoders.inc
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -91,6 +91,9 @@ ENCODER_TEXT("SLH-DSA-SHAKE-192f", slh_dsa_shake_192f, yes),
 ENCODER_TEXT("SLH-DSA-SHAKE-256s", slh_dsa_shake_256s, yes),
 ENCODER_TEXT("SLH-DSA-SHAKE-256f", slh_dsa_shake_256f, yes),
 #endif
+#ifndef OPENSSL_NO_LMS
+ENCODER_TEXT("LMS", lms, yes),
+#endif

 /*
  * Entries for key type specific output formats.  The structure name on these
@@ -422,3 +425,8 @@ ENCODER_w_structure("DHX", dhx, yes, pem, X9_42),
 ENCODER_w_structure("EC", ec, yes, der, X9_62),
 ENCODER_w_structure("EC", ec, yes, pem, X9_62),
 #endif
+
+#ifndef OPENSSL_NO_LMS
+ENCODER_w_structure("LMS", lms, yes, der, SubjectPublicKeyInfo),
+ENCODER_w_structure("LMS", lms, yes, pem, SubjectPublicKeyInfo),
+#endif /* OPENSSL_NO_LMS */
diff --git a/deps/openssl/openssl/providers/fips-sources.checksums b/deps/openssl/openssl/providers/fips-sources.checksums
index 0da9e82cb00..d5088b01f99 100644
--- a/deps/openssl/openssl/providers/fips-sources.checksums
+++ b/deps/openssl/openssl/providers/fips-sources.checksums
@@ -1,594 +1,582 @@
 1adbe13eff4750e389446101753e40402977dacf1493eb7ba053654bb37bd0e8  crypto/aes/aes_cbc.c
-a328908d0d04366e7160884001170c494751a2555e935b7ba3feab88a0b977f8  crypto/aes/aes_core.c
+b77933ece99f9d639fa7aafc5cf4b5387c88febff563815434f73f80c0e8b4a7  crypto/aes/aes_cbc_vaes_intrinsic.c
+a4b51eefc365fc994754d24237dca9308f0570c6329c51b493163cd1c343fdf7  crypto/aes/aes_core.c
 3fac41ce96acb9189eac2d5571425c3ff33a34c884ae7e275e1fd3068b5fc662  crypto/aes/aes_ecb.c
-da4942231014063d9e4fe1db91b6eb1b8f233904d169f3f1b8be7c6a59728d2e  crypto/aes/aes_local.h
+88204cb877dec5929e1f89dea7bc8bb3f453c993f3a05e0729d083cdb707dce7  crypto/aes/aes_local.h
 7414fa4526ba20ee966125e8f7e428e4c75cd9021a79f1151a4bacb28d2f10da  crypto/aes/aes_misc.c
-6979c133f76f4623e62e6e970deae70fa025e713a72b71aead5a048d49e47f6f  crypto/aes/asm/aes-586.pl
-92be9ff608331a432e95247a8f4fb9e46897d0cb76f2b6db809b61d44287964a  crypto/aes/asm/aes-armv4.pl
-953897f86e2de9fa27ef411155ab3aed133af94885f1507e76449c142da78656  crypto/aes/asm/aes-c64xplus.pl
-00196f01f5218ad731e6a058d406078f7228a9756d9d73f51c0d0c2a68f885af  crypto/aes/asm/aes-ia64.S
-88b6f8396cd9d86004743d5c3b0f72b7b8c3d5a2b00b0bbb761ba91ae5a7cdc8  crypto/aes/asm/aes-mips.pl
-7ff9c96ef3d591d45d776fa4b244601ea0d9328e289aeab1e1b92436ce7d02ad  crypto/aes/asm/aes-parisc.pl
-f1244cdeadcb4e48f35bc5df19d4cfaf07e0086ad951b84f07ff6966501faa5b  crypto/aes/asm/aes-ppc.pl
-f8cc2144b6cc9998d2c55ef446e451a31edde01eae624cb23de02b6b25b82420  crypto/aes/asm/aes-riscv32-zkn.pl
-fe42d33e668beeadd43aa7e67cbe82d3ce3b92c3223c1cc0a34d5cac5b5d501d  crypto/aes/asm/aes-riscv64-zkn.pl
-e1f3805332eb811d9d0c9377b67fe0681063364f1af84d8598f7daa30da65b4d  crypto/aes/asm/aes-riscv64-zvbb-zvkg-zvkned.pl
-ecd9bdfaf25cdd3d8ec0c50cb4306d98374da1c6056e27e0cf31a057dc5ee150  crypto/aes/asm/aes-riscv64-zvkb-zvkned.pl
-972e037dc955511eff7a371462af483e23dba86afeef25031abe1005eee635f3  crypto/aes/asm/aes-riscv64-zvkned.pl
-f1d8b7a3da1ec053d38be4fc776fef1e4fba328bfa2bfd928c2a2cd3b14f08ff  crypto/aes/asm/aes-riscv64.pl
-290ae2a09826d24e83763415a021e328d41a163f41cff8c9e3b882e973677f33  crypto/aes/asm/aes-s390x.pl
-ee4e8cacef972942d2a89c1a83c984df9cad87c61a54383403c5c4864c403ba1  crypto/aes/asm/aes-sparcv9.pl
-391497550eaca253f64b2aba7ba2e53c6bae7dff01583bc6bfc12e930bb7e217  crypto/aes/asm/aes-x86_64.pl
-3b5ee174fa52d732d882ab4b2ffe59235d3bff66651714f32e743fcadaf1d970  crypto/aes/asm/aesfx-sparcv9.pl
-e220d630965eb2672dca757aefcb9654928288772fd495da3a495b405b5f21ff  crypto/aes/asm/aesni-mb-x86_64.pl
-83a08babb80e15606bb52c6b4fcd1a6416d3b165b9cbfa42678ebe2e27c3b8d4  crypto/aes/asm/aesni-sha1-x86_64.pl
-6808938757a489c3827e6da78f9ce227d88efcc29c3467fa0329b50b761523eb  crypto/aes/asm/aesni-sha256-x86_64.pl
-4ff74d4e629a88ef5a9e3d3f5b340fc0a4793d16d7cc7f1b70da62512a856248  crypto/aes/asm/aesni-x86.pl
-25881237d026cebd96877a2ea2729db1ce512875cb2a10ca0cd1d6ddf4b51a3b  crypto/aes/asm/aesni-x86_64.pl
-00dd3a64df71ebd61fd35d2a6179d07cc86fc156cce1541ef176ecafb815f4bb  crypto/aes/asm/aesni-xts-avx512.pl
-0489a10fbb1a8ca3652848d5c1e14e519501e189bad3e5827a573c26df359691  crypto/aes/asm/aesp8-ppc.pl
-e397a5781893e97dd90a5a52049633be12a43f379ec5751bca2a6350c39444c8  crypto/aes/asm/aest4-sparcv9.pl
-578142d03bc47353952fca2027eb63ec97ce9a1379c0f3c7ac0fdf110eb3378b  crypto/aes/asm/aesv8-armx.pl
-5e8005fdb6641df465bdda20c3476f7176e6bcd63d5073044a0c02a327c7f172  crypto/aes/asm/bsaes-armv7.pl
-12cd3c8a9ce7153c577ff6238d81ec1947dfc43ee80cb15ee886cdf811969417  crypto/aes/asm/bsaes-armv8.pl
-c72f6cbf3b9900d956e05003ec8df758b29b43519c7801d677c3f992bc589d4e  crypto/aes/asm/bsaes-x86_64.pl
-41e737a3c2985564dd7f7a56fbf3e6ea9c93f1e27e2b64ed13767faaac71a11a  crypto/aes/asm/vpaes-armv8.pl
-7ec25456a8ad4127c3bec83550d8ec411a12b506dfcbd4f1dadac2c66e468c22  crypto/aes/asm/vpaes-loongarch64.pl
-c3541865cd02d81101cdbab4877ed82772e6980d2c677b9008b38fa1b26d36d4  crypto/aes/asm/vpaes-ppc.pl
+793c1af13d28ec05895c2d33e2882df4cda6361004a9e0c6025447353ae86331  crypto/aes/asm/aes-586.pl
+bbab787ebab9385502f5dd10ef63fd99e7bcca4e786d8a16981fe830581fc8db  crypto/aes/asm/aes-armv4.pl
+96e1ce4849089b7a467a4f622aec668a63624876a8b40cba26e84e7b471261ae  crypto/aes/asm/aes-c64xplus.pl
+55ae102f171fc623f567cbc2c9166f737936d76c6bc3dbcdb5cecf569cad6f76  crypto/aes/asm/aes-cbc-vaes-x86_64.pl
+7c3d8e3b191ebac5bd4767d099669d5a2aede36fda695fb4cf9d204b5c8dd803  crypto/aes/asm/aes-cfb-avx512.pl
+d0fa153afa8b6d86f5dd5e8b472458913d25a553425b0d4189e405eeca65b313  crypto/aes/asm/aes-ia64.S
+b4ef595194fe1692e1ab2b561f385da01b277cf004902e8fc99e8ac5389bbd35  crypto/aes/asm/aes-mips.pl
+aec8e840e21399d82a8727e9e1b545c78e5672bfeaa43209399ff5d802a281af  crypto/aes/asm/aes-parisc.pl
+37236228f6414d932fada6e5a7dca7d711c1de754672064e2aff79ec9e15fc72  crypto/aes/asm/aes-ppc.pl
+e169a64f92b984f51792bf9bc491e54fbf1af52da76610c5ef1da0cd72893250  crypto/aes/asm/aes-riscv32-zkn.pl
+5718962a86f1d737b410366280416a0595c7d8df96bd2e58c4c0d7289389d200  crypto/aes/asm/aes-riscv64-zkn.pl
+8179f94715211cf8d69f17b5a785e4243f96d0728f31038e0016ad4fd860630c  crypto/aes/asm/aes-riscv64-zvbb-zvkg-zvkned.pl
+6a252373a3c20ab39b9e343b924af2182a1804a2c426b952d655c373927befe9  crypto/aes/asm/aes-riscv64-zvkb-zvkned.pl
+8219b1ba305eb76e1a0352898391c2a75e850a046aab64839b3567460d34170a  crypto/aes/asm/aes-riscv64-zvkned.pl
+ff7c8f37bbbdb7e1d3620506ee289651db8d8eda0675afb49de5ff3f6aeba6ab  crypto/aes/asm/aes-riscv64.pl
+79db6f8ca2c6aa40206fdd9882bbe67d5dd4089af8fe709dbee7d1ed6a0e89ff  crypto/aes/asm/aes-s390x.pl
+41ab65944b0744efa950ee0d6f98bc27adcb463e9d3b3f87cbf520b3801d102b  crypto/aes/asm/aes-sha1-armv8.pl
+7619f6ed0abb5574678db221bd558fc392e6edc873b2ec7aa51191b99ba00c09  crypto/aes/asm/aes-sha256-armv8.pl
+67474f4cb9afe42c29d22400115ef5b900c4c30862681e26c4ff567edae0fdbb  crypto/aes/asm/aes-sha512-armv8.pl
+133ba35d77002abcd430414749c4e98c4a319630da898e45ff8dbc5800176df1  crypto/aes/asm/aes-sparcv9.pl
+e507d1be7b7a1b2c35f8309f195de9edbf1f30891b99684c834b32f950f51970  crypto/aes/asm/aes-x86_64.pl
+87d8fcc854891465638b9c6072a82ba4e46a4e8f1d266b542e980a2219d5bbcb  crypto/aes/asm/aesfx-sparcv9.pl
+1abb89c110e5436bbb9687615eb81e1132e79ef8da8f28bd2c6a3bb97d99fd37  crypto/aes/asm/aesni-mb-x86_64.pl
+d14852172b3cb3309668a51f497ad45dde7d59ec40e744e19433a502fd1252d3  crypto/aes/asm/aesni-sha1-x86_64.pl
+3748a9b549e7be5809a4b6e4ddabe15943978f512f561bd5543bde44c0208ac9  crypto/aes/asm/aesni-sha256-x86_64.pl
+a95ee8f58a6751e6e8375e62fb6fcd4cf79a2c96f328e634f5a03a787d0ce267  crypto/aes/asm/aesni-x86.pl
+9d2628c860be50612f05c99ee3f8db2c2d127c50cb0ba85875b28522d6c76bc2  crypto/aes/asm/aesni-x86_64.pl
+f4ee934d9c4d70aeffa342a0dbe58360ef6802086f123b34cf3186314217c511  crypto/aes/asm/aesni-xts-avx512.pl
+f5f0702f3c439df07dc5912ebf5232e17d4ece52ca87e99217851aac091d404d  crypto/aes/asm/aesp8-ppc.pl
+a5807ed92ec8a16d123061487c385bf1f65e50878cee95c8e8096844454129f8  crypto/aes/asm/aest4-sparcv9.pl
+adc65ef913056df715ca0581d6946d83a032e0e24d7617a2ff67efd7fa872501  crypto/aes/asm/aesv8-armx.pl
+1a9c4dd478dd825d258c989cd6861a74b46cf1a6ea00cca71e306d9a369e930e  crypto/aes/asm/bsaes-armv7.pl
+342f15eb59db6048ab5b1eefc4373c06f556606ae6d7a044c6e7148fa2000d87  crypto/aes/asm/bsaes-armv8.pl
+c22a4a276257db7c7a44ae8ddae3575f46dfdf65f14893985c73173294946c2a  crypto/aes/asm/bsaes-x86_64.pl
+e6583e8b505df68e817923f41cd1382e38ab6911c1ff2615a97ba47c1fcf9c4d  crypto/aes/asm/vpaes-armv8.pl
+11e17be338aa5b5548902b84b7100156e2ab5492b6b2ba8df48c4390a410fe5a  crypto/aes/asm/vpaes-loongarch64.pl
+ef0f2fdd6a0b21d7aa594c2a1f83d2e6bc0f3c61655a1571c2ecb1d2eb193542  crypto/aes/asm/vpaes-ppc.pl
 3ec24185750a995377516bc2fb2eae8b1c52094c6fff093bff591837fc12d6c3  crypto/aes/asm/vpaes-x86.pl
-c6935d2ab7925022cb3d76446536ff01b1a1b8eb7eac619d034a29aad17ed45f  crypto/aes/asm/vpaes-x86_64.pl
-2bc67270155e2d6c7da87d9070e005ee79cea18311004907edfd6a078003532a  crypto/alphacpuid.pl
-269e52f8867c13ca75d2f88ec1f89b692cb8c6c3ee89abe2fd3c1821925191d8  crypto/arm64cpuid.pl
-b0242943b097f7640f1b3c33313934a98caf45d47d4403e9e53d826f6d2dc0c4  crypto/armcap.c
-d9f923daabe7537d1063b182f9f220655abd182ef4c55a0194a7ee8d6030b5bd  crypto/armv4cpuid.pl
+0bdd2083d4454e46ec8d8ddd667a304684411f4d2ea9549237ae02260e13f009  crypto/aes/asm/vpaes-x86_64.pl
+132c91241e571ea360250d28f8ae368a9efa07cd11afe014e316be07da38de8f  crypto/aligned_alloc.c
+46fe58bf9bd1b4a3e4b7688abc85fdd38328fe6baaf1db85bfd84cb0710d5914  crypto/alphacpuid.pl
+92ce22da9063dc3ca88b5ef643b9ca02b72ec08bfe713b982370c1290a043f93  crypto/arm64cpuid.pl
+e0e8987948f3c2e2ca6e3d08a77ec3dfa9836e505dfd9f15c205cf2198b06a3d  crypto/armcap.c
+68bfc2d78fe2c7607d4e7df04929666cb8100f149a593603f383911980bd4261  crypto/armv4cpuid.pl
+779ea664cd73b8bf2e286cd4d01bfa04ff1543dbed821c79978b98fb80f76576  crypto/array_alloc.c
 e886d814c34492504cc9a2451c67fd8c0b4e83e8618f931632400cfe522b6e4d  crypto/asn1_dsa.c
-819c9fd2b0cae9aab81c3cbd1815c2e22949d75f132f649b5883812d0bbaa39a  crypto/bn/asm/alpha-mont.pl
-565edec9b6fa0702c07ab2f7507b0a45fb2ab649ed509fd79013ea7378bb5891  crypto/bn/asm/armv4-gf2m.pl
-5469ab174b62361c6ced8f5c1007c462700761c1aae72f0d2928ca39e57d47a1  crypto/bn/asm/armv4-mont.pl
-1a2c890bcb9d96b24ef025c4894f89c56e83c05eb0db9532ba3b17a50753c2c2  crypto/bn/asm/armv8-mont.pl
+0a9477f2b8dfef0c34e5c215894605ea5860bd6fccad0f2c46f7575fc0a8bfec  crypto/bn/asm/alpha-mont.pl
+c06c6f3591131cb3532e07a17374689ba26dfe10f1566e8b0a739bea2ac9d25b  crypto/bn/asm/armv4-gf2m.pl
+c1d0e9e4e583a907e381303550290cfc0835cb29ef27521a8eb167468c2eb41c  crypto/bn/asm/armv4-mont.pl
+30e78a46dced48933cfd59d0ac96fa5d4063a3c5025d307c13c21f30865d165f  crypto/bn/asm/armv8-mont.pl
 cb4ad7b7461fcb8e2a0d52881158d0211b79544842d4eae36fc566869a2d62c8  crypto/bn/asm/bn-586.pl
-636da7e2a66272a81f9c99e90b36c6f132ad6236c739e8b9f2e7315f30b72edd  crypto/bn/asm/c64xplus-gf2m.pl
+10fb73a6cc1bc064ebdcf6d7fe3c7407ea1c28b0d65ad0123046f8b1518fa75a  crypto/bn/asm/c64xplus-gf2m.pl
 c86664fb974362ee52a454c83c2c4b23fd5b7d64b3c9e23ef1e0dfd130a46ee5  crypto/bn/asm/co-586.pl
-199b9b100f194a2a128c14f2a71be5a04d50d069666d90ca5b69baee1318ccb7  crypto/bn/asm/ia64-mont.pl
-a511aafbf76647a0c83705d4491c898a5584d300aa449fa6166c8803372946eb  crypto/bn/asm/ia64.S
-687c5d6606fdfd0e242005972d15db74a9cbac2b8a9a54a56fcb1e99d3880ff3  crypto/bn/asm/mips-mont.pl
-5cb8b5381d03aa76d456a594ff7d2dcb2ede310debb43031868af55ddb832523  crypto/bn/asm/mips.pl
-b27ec5181e387e812925bb26823b830f49d7a6e4971b6d11ea583f5632a1504b  crypto/bn/asm/parisc-mont.pl
-9973523b361db963eea4938a7a8a3adc692e1a4e1aec4fa1f1e57dc93da37921  crypto/bn/asm/ppc-mont.pl
-59cd27e1e10c4984b7fb684b27f491e7634473b1bcff197a07e0ca653124aa9a  crypto/bn/asm/ppc.pl
-0b3350f56d423a4df918a08e90c7c66227c4449a9f9c44096eacc254ebc65f9f  crypto/bn/asm/ppc64-mont-fixed.pl
-a25be64867ab837d93855af232e2bfa71b85b2c6f00e35e620fdc5618187fb6f  crypto/bn/asm/ppc64-mont.pl
-d48aded8547aa44a4af0d76d4675320628c66ba54e6fda865804953eefa8e853  crypto/bn/asm/rsaz-2k-avx512.pl
-ae2e714dc003867c31136f939f8d47eb35eac3de36dbeea8f028a48d03b964ec  crypto/bn/asm/rsaz-2k-avxifma.pl
-6b5f35bf328f19b3add87a9715736ca92a8165920264311e20d3477a41a90a82  crypto/bn/asm/rsaz-3k-avx512.pl
-b0ef4c3bb3a835066e9f7cafab22efc9d668b6debf5b9b9ec312cabae9412631  crypto/bn/asm/rsaz-3k-avxifma.pl
-ca2d4486ee67f2015a8580664f3bbc28c23201205a2422d3a972cdf6ba59147a  crypto/bn/asm/rsaz-4k-avx512.pl
-80b0e7aca0ebee78fb3c651723e7f0eaac43a5b6a2bcf87b98a454a248abb945  crypto/bn/asm/rsaz-4k-avxifma.pl
-7d686b484ea2bb65091c6ed3e74d5f4063ed4a8ecc09b7bef8d3a3aa57c4121e  crypto/bn/asm/rsaz-avx2.pl
-bec7e89c5a33652bbff20c95a6fe82bd96f7f2f61a3544c122f3af6f4f162110  crypto/bn/asm/rsaz-x86_64.pl
-30fedf48dfc5fec1c2044b6c226dd9fc42a92522cc589797a23a79d452bdd2cf  crypto/bn/asm/s390x-gf2m.pl
-590388d69d7ac3a0e9af4014792f4f0fdb9552719e8fb48ebc7e5dfca2a491d4  crypto/bn/asm/s390x-mont.pl
+03b0fd6b7d0d5eda5f247ad16031e0475a9cd29231322b88adc21ea1c2e52963  crypto/bn/asm/ia64-mont.pl
+f73e00dd24d22d664390e2d25397a45410094eb39e07f0c9ba9a421c6bb53358  crypto/bn/asm/ia64.S
+dba7618bffdde638576c5e4f31d1fcabfaf67b89d028eb8ff04f0c8aa54fcc5d  crypto/bn/asm/mips-mont.pl
+29cbd1deb5f29bd4196755a74896b73ddd80bae23e79ff36e1ff42c596e70fca  crypto/bn/asm/mips.pl
+9a46c5171d34dbdf4b1605c41ded9503d92ae7ce8413ddb7b538b76defcfc150  crypto/bn/asm/parisc-mont.pl
+37d90121a9026f8c21c21a1c3c817a27a21b643b357f31c40039ac8e54955bfe  crypto/bn/asm/ppc-mont.pl
+1c057083546fa1a3bb1b9819dc5110f5a3b11b7bf5a2fb275012323bd7412403  crypto/bn/asm/ppc.pl
+04c9b5d2494c06e6f8a47c35274ddf53ae46b65e6abc297bd41e5beb735a3e8e  crypto/bn/asm/ppc64-mont-fixed.pl
+38820581b2ee29de8a88a5e3e7a6760d72174366452c1c6dfdf2bb2993e0df87  crypto/bn/asm/ppc64-mont.pl
+eae1d6954ab3a5c2bcc17b3159755b81e80ea46ff2144ad5e6b6cc4bbfd63ef4  crypto/bn/asm/riscv64-mont.pl
+691f0eba6fd13ec177a8e4dcf934f83355e0b4237efb2095ed8e35fbff2cc705  crypto/bn/asm/rsaz-2k-avx512.pl
+c4b8556aac1af7b2d1bda8351e5b04dcbfe73c058085bb35c7ebd27ff4321a7c  crypto/bn/asm/rsaz-2k-avxifma.pl
+0ff42f8870ed3d6cec20248c7cc0cb61afdc82720bedb191be978d164b6724aa  crypto/bn/asm/rsaz-3k-avx512.pl
+8d4e8835051ff235934163297167feb6a4e2039e761bcf152e06b2a15ef9ecf5  crypto/bn/asm/rsaz-3k-avxifma.pl
+79d06465a12ab7a9ec689c212dfdb09ea0bfb3cc25c63910fe0cd458ef0f3480  crypto/bn/asm/rsaz-4k-avx512.pl
+d8f0d167159a5120641aa2ac4f55d09b298f1bfb054003f14b1d9824c0c9bf41  crypto/bn/asm/rsaz-4k-avxifma.pl
+a81113d9f37499498b0f84da101da8f6c7569f703b31e62227f011648a391d24  crypto/bn/asm/rsaz-avx2.pl
+78d52a373c2e047cd734b5a75c3073ccaff7de2002652910ce3449e85068b747  crypto/bn/asm/rsaz-x86_64.pl
+3228692b32bdf96be6e033e6c24ee3610eb72dc6e28c3e8582857bcf3f0d2134  crypto/bn/asm/s390x-gf2m.pl
+eaf166b509d192ac662d47f9d8c34a11e1c557e5c774256d96cfeb22a8cf78f0  crypto/bn/asm/s390x-mont.pl
 aa02597f3dc09cfbc190aedb75711859ba0f3efff87067ebfba1ec78ebee40d7  crypto/bn/asm/s390x.S
-2f7cbc2c3d93b1bbc4953dda38b9ae0ab3a0a8331a0418d94d9b286183736c9e  crypto/bn/asm/sparct4-mont.pl
-ca21a9ccbc54e19fb7c2e6cdf286ce7cb08b0fba960c777c6edce5c57ccc2101  crypto/bn/asm/sparcv8.S
-fbc93c8dbbecefe66086f58fe9719ed87b13b2cdc61454a10e841228296fecef  crypto/bn/asm/sparcv8plus.S
-127832c1e3d298aad805236776488f5f8836b6a0fdbce3f6b42678163df3909f  crypto/bn/asm/sparcv9-gf2m.pl
-0ad54f0cdf6a52ee0b0aab03800cb2b6beb39b138378b93e151cfd6b1aa2f2d6  crypto/bn/asm/sparcv9-mont.pl
-b69083f78b4b4f7097de4462d16649532fb82c453a82cdd9cc1393122661d6e2  crypto/bn/asm/sparcv9a-mont.pl
-d404375a21d33396824a3da212d6646d4f3150dd141ee4b4a250aefae3482efb  crypto/bn/asm/via-mont.pl
-d24f3e97239c8eed5efc721521b025b7256c15e67a54ea6b5c4cf8f7cd0f89ea  crypto/bn/asm/vis3-mont.pl
-89278854f44d95be916516609ce6f79dcd346bab52574b9b6336a9952aa94bee  crypto/bn/asm/x86-gf2m.pl
-90d4ae234c08267adce9ed38d56e0edc223f7480cb9605f5d7399d0b3914c6be  crypto/bn/asm/x86-mont.pl
-0e3e572cd864bcb9222cdad7ca4e8dae4250f6f76c2b66e1f0e46df1cc0cf371  crypto/bn/asm/x86_64-gcc.c
-709ddee92e9222ee0ed27bfb90db556e85e2d302e4a9131afa25fdc14c4d858f  crypto/bn/asm/x86_64-gf2m.pl
-4ad5e97a7ed376d2cc079a3eabfbdc0cce3fe6e61751324ef18b72d24f7851d6  crypto/bn/asm/x86_64-mont.pl
-11eebbeb8ae59158e780d74300b333de9705aefdde73cff280286c053c8743da  crypto/bn/asm/x86_64-mont5.pl
-7c81cd72fbf6f2dd85cbcbf40027301c98c1701928d3199edb2b8fdf04a5ca5e  crypto/bn/bn_add.c
-529933a6592cf82abde515dae10db17833a16ec29cb89ec577c0a184838fe27b  crypto/bn/bn_asm.c
-feef3a84a40034291286882d483ac23ab55631c3c93f40ba0ea98944916ff3ec  crypto/bn/bn_blind.c
+87d49e83a7df467097fdfc577aa206be9ee622c40fcbbbe5133b35d9783b7816  crypto/bn/asm/sparct4-mont.pl
+f3b3f3ec50e38d02a82fb51d823d4449446f954a9ae8e5beb5874b907bdaa437  crypto/bn/asm/sparcv8.S
+3c42b4fb3697b347f13dfdf556b3c209c10738b6234406f552af7519b4637750  crypto/bn/asm/sparcv8plus.S
+503ea6aef1109b7dc0053e02e3b0b0541e3a133b956e17ef10671d97cc7ece22  crypto/bn/asm/sparcv9-gf2m.pl
+07992e066b99f924373295585c10a1799cdb956d6ee92ab0f8c3fb2be639a6cd  crypto/bn/asm/sparcv9-mont.pl
+ad9d64c670c7d89d7c9de2772bb08478ed5efad1744876075e1eabf1b9f5bace  crypto/bn/asm/sparcv9a-mont.pl
+bf3336df4063c29118961f411852df79b46c1a3981cdf055382f501339eeabb4  crypto/bn/asm/via-mont.pl
+721b1bb921d8e8b82043df25348d45fea9a190cd7834b2bfa0661be0a9b6c460  crypto/bn/asm/vis3-mont.pl
+fcdb8846dd6fb1b8297a8a2dc75915a2c5608434c7bc05e68a8b637b06961575  crypto/bn/asm/x86-gf2m.pl
+0ed86280d18597b4a933609efffe1df991d0a0fc82e3cbe88f6ef06f947d7e55  crypto/bn/asm/x86-mont.pl
+439b325e3b32858bfeaf673bb7cb76b8d1c68c663e2387f5f0648de524733b2e  crypto/bn/asm/x86_64-gcc.c
+8dc17b03325a13540db8a40bd2f92a7ce8244e04daf0d59775596f376895c718  crypto/bn/asm/x86_64-gf2m.pl
+77c3572af72d572bc22d84607292dcf820f3d0f0c2488e3b352e06266f22ab75  crypto/bn/asm/x86_64-mont.pl
+cbe935f00f10f1c4f971110e923554092ac1e780e679b60aa558a91339cf1dd0  crypto/bn/asm/x86_64-mont5.pl
+74c8018546f8f72761a71c5d04c4301b07869168139ae0064b1932f86a828181  crypto/bn/bn_add.c
+15e79a49cb16ceb28b33f1a06e5d4cd05b7899c8a92819cab72937212aa6639b  crypto/bn/bn_asm.c
+cd5922b43407173e1331dede5a6d8d94f2d519a0d9f39b6017199392621c2ecc  crypto/bn/bn_blind.c
 1b8f89064c287669a834fe032ef823796f7355ed7e6da08d6c56c0a4cd0bba01  crypto/bn/bn_const.c
-eee3d2710144b0e860c57e84f5adc6b2bf64fc27cbd202a8ca2630aefed3b84c  crypto/bn/bn_conv.c
-282f06fbdeb991d90337787c6407020e940b6d5e187a06866f1a7787c10a0c1b  crypto/bn/bn_ctx.c
+daad6ff1ad4912d05749978e87af5fe1985ae31160cb87202401fc8db7c7502a  crypto/bn/bn_conv.c
+33458c8fe9a56103f678a40d8cdc8cd2e222c229c1e079326403683872cea5a2  crypto/bn/bn_ctx.c
 b1b1c5fb8a45fde5755dfd5da62b68100b94f8c492c950719c108c384ea7f3c4  crypto/bn/bn_dh.c
-4824f271f0ddc487b5991fbd92f7f7695aeeac234e076078f37da027999cdd88  crypto/bn/bn_div.c
-f1e98f178356791a3d54f586c19d1639d8e89b2cf6e6a4de783327ceada296a2  crypto/bn/bn_exp.c
+559abf65c9dc7a4c80a92fef6bf6a5691acc9609c5a6587bb5377d25a950bed0  crypto/bn/bn_div.c
+e3a43d63aea9c93bff0671b3c513ab9b713c7dd8b36cf8267906cb8524354801  crypto/bn/bn_exp.c
 ce5219203bf869561297978d6d416357a441864cd801865503dfd455c481960c  crypto/bn/bn_exp2.c
-18ac3f6fe64225f72243689199839ea2ce2aa61d80b084bc4cd9efe1c7cc9d89  crypto/bn/bn_gcd.c
-b643fdcd91ad7dfcfa97a0bb235221b024b8a77faa7890f0bcb9681ea2c64c49  crypto/bn/bn_gf2m.c
-b736a80e3b66f414a803a36ab0c4b9333cf70fda21d873c4584450dfaac52902  crypto/bn/bn_intern.c
-ff147e5e032cc7c772b73a91fc6e24d8d9516e642d29354445d1f82d64b1d924  crypto/bn/bn_kron.c
-c4bae573e4e7132106b1151e8983cb63200dd9e49dc464e805f0fc50d55374d0  crypto/bn/bn_lib.c
-cd7bade0f2e223fe34f6e2f8cc87098ac8f0af96ec62ada5e67f6a2344d48ef0  crypto/bn/bn_local.h
-b494fd85387afa7816422922e52987e0faefc3c890c972e7d4fe04f620dfc59a  crypto/bn/bn_mod.c
-39a8fe0bb625b4c11b74998ce6fd99b7655228aaa7d7ad3076f61741937ae14d  crypto/bn/bn_mont.c
+179e043e60d89243c0f66d74229296d713475c47262f997accb96fe4d66c98c8  crypto/bn/bn_gcd.c
+6022e6f394c6e4b944f49f2ec4ea88f0caebebda784751ef08e38136f9ab89e5  crypto/bn/bn_gf2m.c
+57403258d547c4e1fbc016cc22f672874d91906f83958220fe597fe89b6d82b7  crypto/bn/bn_intern.c
+08762de7f117a35e5882bd3ee105aae89f2855609c55d55cd726483e2581e91b  crypto/bn/bn_kron.c
+e0572fe2a7c2fd8b0c511700dce328610272a8bebad590f00ef35b3fa7650abb  crypto/bn/bn_lib.c
+5573802bf23ee99b41532bac5d36fecbaa18e03cb16098ea20253d1cef420ee8  crypto/bn/bn_local.h
+ba379f0d86ba8112e164a658b4d1f3d6c3f3245e05aef8f2e1c9dcf90507e06a  crypto/bn/bn_mod.c
+b25a37dff27fc0ba2befebd363a97c1a460abe19ce32e9b7380ab158bcd31739  crypto/bn/bn_mont.c
 c2a5230efbda6844b7b2eb10447b054496ae5029130d332536de6c3b12dc58a3  crypto/bn/bn_mpi.c
-488dde761d25fb2eabd8acbea5b3b83520db7733480fab6499f60b8bf680b1ed  crypto/bn/bn_mul.c
-e80177361897632ac9f013415dee8f6d2d942a8b51a4daf84fc7ba51d9d75270  crypto/bn/bn_nist.c
-0aa8a381dc6ed47746ec90aa739aff1eece4474d92abdd3f9036e7dcb72ee891  crypto/bn/bn_prime.c
-c56ad3073108a0de21c5820a48beae2bccdbf5aa8075ec21738878222eb9adc3  crypto/bn/bn_prime.h
+4d1aaebf3ca938895ec2f42e24e06ab4d296a835ed75dbeff7168eec21631fd8  crypto/bn/bn_mul.c
+ffc098f79d07f553032fdb77ed9e075e08db5a34bbcf30912d8277df71529c01  crypto/bn/bn_nist.c
+2e3733db00275398a3fe074c22ad45d8b91ea150b199b77eb645c323d7d43c02  crypto/bn/bn_prime.c
+42bce149af266d791ae53c6ef672c52ff1e06ae741f1c5686c540375b1df53c4  crypto/bn/bn_prime.pl
 af5af7057643ee8d35e3a2d5f7b55e37647db46700f2818edc295d727450d521  crypto/bn/bn_rand.c
-b5cc902624b3af2149c9ea91f9d18bea56302144e87dfe49105ec6789b73764b  crypto/bn/bn_recp.c
-c4ef2dd742bcd76c40df08a3108a3cf2854d53e93ebf59bf549c3ebc3b0e47cc  crypto/bn/bn_rsa_fips186_4.c
-6889866bca4673bccb8adf870859a867757ccd3c8ad4652675615afff710add3  crypto/bn/bn_shift.c
-97559e9e071a06b8cffa37b7df27af638de84c51d5da190a879752f39e2b6368  crypto/bn/bn_sqr.c
-c748baddfec6734bb50facbadf151a1f22f8a885c677acfb08b4f814e96f0d52  crypto/bn/bn_sqrt.c
+a2584cde4ab7f11544497ce5fba1d9391ddaed80f08ae13a38059df24d1958d8  crypto/bn/bn_recp.c
+d21093afc3d81b0ae37dc81717ba73229bf678ffe67283c83eb74f9cffd85df9  crypto/bn/bn_rsa_fips186_5.c
+e04f7460a2ab3b3bd9db332d99afbf8c7a3919866ad4314a5a5ad95b23ec6399  crypto/bn/bn_shift.c
+1a92d0701a7b7660eab9bf861f63b831232896b88cf2b64e56a6713fc6ce34a9  crypto/bn/bn_sqr.c
+101783b0311459bbd262dee87a5f9e6ede7c48011892c955f29c7d3991b25d29  crypto/bn/bn_sqrt.c
 f42996cdd94f18fe0858552be7123e75cb3ced0ebd7dcb90a0c73740090dcac9  crypto/bn/bn_word.c
 2f048ca8e8ddc5e2b8b82775197f79334381dd90bab417b2855bfeee07b99db8  crypto/bn/rsaz_exp.c
-b89075a1c43de2e27a29db217c11c1fb4ec04f4270d0106c0679dd44f98eee58  crypto/bn/rsaz_exp.h
-3c934b8abf163b95caf236647153d42d8d48f10f2f5f8b21c013362b1cb8aa8b  crypto/bn/rsaz_exp_x2.c
-f6c72754667c90e3466243f9d21ce6a799db8e58c8b78b2707129dcc540adc3c  crypto/bsearch.c
+45f7212a616e33db1310126e213fdaded8e3dc8a200b0520306cf423c485e58d  crypto/bn/rsaz_exp.h
+40a6f24c3575238dbb47958b613684d46c8c442f203cf07ef02f6cadcbebc31d  crypto/bn/rsaz_exp_x2.c
+72b85ca219bfdc7f990e07cc15decd9f46a12fd71cdc7c2331916c5009e5f48e  crypto/bsearch.c
 82117f6a7cfc31fc86ecd9629bd3bf614126b8e8b2c23717a03ff5c1db7c3c5c  crypto/buffer/buffer.c
-5f43844b5d8665de9ab895f93599150a327d73ec2674bbf7d7c512d30163022d  crypto/c64xpluscpuid.pl
-205f0be0317343b17003f261b427008aad1b31aacc6979c4557fc837e9548b92  crypto/cmac/cmac.c
-1d2760fae983b7fdba8fbb63b0f357dc161f6d0f0695f6b73e8d92ed19899185  crypto/context.c
+b99af1c5b04b34af14774966372dd90651c462797753b5f0576822671cd5c40f  crypto/c64xpluscpuid.pl
+63835e57e16d3e463dc3ec8d1dbf907aa0824b59cbbc309983ff62546655d644  crypto/cmac/cmac.c
+a43e38df1c793b8c7b0c92df683f34d2a5333ec95bc8f7a8f6aafde57d08f734  crypto/context.c
 ce92403350443d08cab02566b928013eabaf2d5ff5e2947f7e6d322cb8ec82fc  crypto/core_algorithm.c
-ab29529cca1308302d852999f2790c404a4dc0ef8cd6653260739f70b2f22758  crypto/core_fetch.c
-0e3519aec0d93b0700d1175616b8bfca9c045989fad515d2202dd7dff9caa5ac  crypto/core_namemap.c
+f60bf67fe65d87f65f90d78bb276ea5902375b5310a29ceded2c00957705747c  crypto/core_fetch.c
+0ac6ca997cf3f30376fabd431cc395cda3fc06b5f89a713507b4618537b57a17  crypto/core_namemap.c
 a62f653b8a6ee765be704980425617e04e1d242f9735efaf35fc6e00815ff2a7  crypto/cpuid.c
-a73118d14eeb232ff250ae908204ddd7cf33deba5f3ca68a2dbb51b020946b0e  crypto/cryptlib.c
+4a2185347200b40b7762182c68a0187df9f127240d3496a7c6daa57327b39b4b  crypto/cryptlib.c
 0145299d43dbb60e85ef6b97cf7496dec55cc37b75433e1403c11adfa3e90c5f  crypto/ctype.c
 b9fabcf8480b8c9c7847a0c9af0fcc13b6c4b4a4558d5e445e6409221e6f8113  crypto/der_writer.c
 135ef65f7602432f8c87ad18fdd90b867f1c46b1c631522d56181fbed2106b05  crypto/des/des_enc.c
-7c2cea4c850398158b4aff172b242de0cc436b66f62fc701ccca3fe5489925a5  crypto/des/des_local.h
+71bc23093274c53717e42cae83e3f56b57233f59cd2f23447f6b8de4068cc7e3  crypto/des/des_local.h
 eeef5722ad56bf1af2ff71681bcc8b8525bc7077e973c98cee920ce9bcc66c81  crypto/des/ecb3_enc.c
 c1e015556147b40c854bf0ab275c54235f99001d04c6d49f158fba6865eb5439  crypto/des/fcrypt_b.c
 499513b3ad386fe694c4e04b3c8a9fd4c4e18fc44bb6c4f94d6bf2d9362a3a5a  crypto/des/ncbc_enc.c
 dc2e7899593032fdf0fcab18f5549c52f12bad2225aac9a08c4622ffee34b193  crypto/des/set_key.c
-41b7fc5e67814311b878684e3f29cff60e228f1516f670d81bf43130f2668ae8  crypto/des/spr.h
-b842e39f34996d74cdc9b9be5fc93c27fc91ef6141fae83163e09f6b0eff1e09  crypto/dh/dh_backend.c
+ed645417b91920caf3575d1086e6380663f2260ef2300702726fb7415810a836  crypto/des/spr.h
+82b6cd90a74f0249bbf7e93c035d649d91fe3aef39cc8d507e61f4802ac652ce  crypto/deterministic_nonce.c
+3a852fcc48213f90caddcffd219a7f955be93eff519fe8b28086c68926314ce7  crypto/dh/dh_backend.c
 380d55ea09a50ba3ece173e64db90782efae08ca56ac51cb4d31b9a303b429ea  crypto/dh/dh_check.c
 c117ac4fd24369c7813ac9dc9685640700a82bb32b0f7e038e85afd6c8db75c7  crypto/dh/dh_gen.c
 1149e214ed664540434912e284730a3c87385172e4c6d1c944ea56659e2dd762  crypto/dh/dh_group_params.c
 a539a8930035fee3b723d74a1d13e931ff69a2b523c83d4a2d0d9db6c78ba902  crypto/dh/dh_kdf.c
-8ecf50b2e54727d9ae05b2cb03b3162986eba6a03c20dce82b67195cb11e5adb  crypto/dh/dh_key.c
-7eae94965827bc5b0178269e85c77d6671c85255dc1f05e90b0f14500c765cce  crypto/dh/dh_lib.c
-a9166c3cc60f4281e9d471c64145e0a78fc9dc43b8bc9e5de96d91eb7d277da3  crypto/dh/dh_local.h
-40065939139ac28aa52838aa54d257da82fce73504557f7a9ad34d13824e0cb9  crypto/dsa/dsa_backend.c
+b48d4c07adc4287c86623999e01eb33d7073cea4bfe77064ab062a18da1194db  crypto/dh/dh_key.c
+56dc245ef79b2c0e07884d5a177748e4e05b62def366d709df242321bf95c50e  crypto/dh/dh_lib.c
+e023c36aff127d1d6f691dce6b4b22c6ea9a139818801e1622a0ded64d3bad76  crypto/dh/dh_local.h
+5dd3bc53fc951a30eb3c5cb8be7121032d3f4f482ce48e7cddb05d571956fd20  crypto/dsa/dsa_backend.c
 786d6c65ced7ee4e25f5dd7c3150259ec95b6aa321a7590d905757b8139f8230  crypto/dsa/dsa_check.c
 ae727bf6319eb57e682de35d75ea357921987953b3688365c710e7fba51c7c58  crypto/dsa/dsa_gen.c
 43f8fba4f50fbc94b1532a7667c9cfdc91b357e8658fd5fe0dcd302ea93ae9a0  crypto/dsa/dsa_key.c
-7d44106570c0ff9a44de874ea2daeaa87ea4c814fef6af0a26f655120a54f529  crypto/dsa/dsa_lib.c
-98ce52d325d2409d7851f1e1226755136f115c884d227d2ae3e4f9b61fc323b8  crypto/dsa/dsa_local.h
-3428bc7602f344f8b8d4a5807b0a7e982cbead1ec28be73ad77b5f849b034993  crypto/dsa/dsa_ossl.c
+47ff13f42316ce03d263976c6fb21232f28ab172be918b6317a93f9e995e4c23  crypto/dsa/dsa_lib.c
+f0e66bdcab35a1cff2b1c16d6e452e3275ee27a49d35d370ad5a2f69ce02e483  crypto/dsa/dsa_local.h
+be80e507b446b6b5c7c5a4adef95192e0a1312a2b668204a94bb7cf68ca82f82  crypto/dsa/dsa_ossl.c
 3a38575de4b1409653f330f241848e6c7b554dec44c2415a5ae1baf90fb47ac0  crypto/dsa/dsa_sign.c
 53fa10cc87ac63e35df661882852dc46ae68e6fee83b842f1aeefe00b8900ee1  crypto/dsa/dsa_vrf.c
-5335741d0f6c1afac107c9ec66e6b5436bd2164535f114c23cdc2a199560c28a  crypto/ec/asm/ecp_nistp384-ppc64.pl
-d9722ad8c6b6e209865a921f3cda831d09bf54a55cacd1edd9802edb6559190a  crypto/ec/asm/ecp_nistp521-ppc64.pl
-78ad06b88fcc8689a3a846b82f9ee01546e5734acd1bccf2494e523b71dc74d1  crypto/ec/asm/ecp_nistz256-armv4.pl
-9463569b439ccee629540d5e02b586f9cc6a87ff382066efe430ac0b85bca281  crypto/ec/asm/ecp_nistz256-armv8.pl
-3715ddd921425f3018741037f01455ed26a840ace08691a800708170a66cf4d2  crypto/ec/asm/ecp_nistz256-ppc64.pl
-cfe7e75a2fddc87a7251684469a8808b9da82b2f5725eafad5806920f89932bd  crypto/ec/asm/ecp_nistz256-sparcv9.pl
-922725c4761cfa567af6ed9ecab04f2c7729ae2595f2fc0fa46dc67879dc87b0  crypto/ec/asm/ecp_nistz256-x86.pl
-f5c4f8c74a44c8723293e3bb64c0c2cf75dc354466ac9f93ebfdab1df34b64c4  crypto/ec/asm/ecp_nistz256-x86_64.pl
-cc727533130f5f1a29229929b3d4e8454585d647be25d6344f3c6a0240998368  crypto/ec/asm/x25519-ppc64.pl
-ee576a748991bb2cf0a37437e46a23dd55dfd35d989e087d122c7cf0f332eb2a  crypto/ec/asm/x25519-x86_64.pl
+103a3693afd8b1a9ba78f7e62a93442a87734419c9bb4a445590f675e86fcd7e  crypto/ec/asm/ecp_nistp384-ppc64.pl
+786779d7014bc04846832f80638743784a3850c7ee36e4a8062fe8eb7ac31c9b  crypto/ec/asm/ecp_nistp521-ppc64.pl
+1682a682f1e7d4c568dcfae1e24a01cb9ebfe4c4833b962090e0fd088027a684  crypto/ec/asm/ecp_nistz256-armv4.pl
+41331cfcaa5c9c989fc7162e7d3af9e91779bd36d16de4d12b8f924437fad531  crypto/ec/asm/ecp_nistz256-armv8.pl
+1dfc8df4833dd357544da06c6f846decb02dbcf53b61ffb365de868db77de669  crypto/ec/asm/ecp_nistz256-ppc64.pl
+3c1c7b681ba3ea85b0fc78007a86ecedb7adc072ba1f0afdcf65dcdd95b8cd0d  crypto/ec/asm/ecp_nistz256-sparcv9.pl
+66064bb1a2cf6491b05c90dbfbf124298fc6a85db2c020dc65348bb9b7b52755  crypto/ec/asm/ecp_nistz256-x86.pl
+a3e7a06fdf7a0d78c9f47f19efe84376f466d5291188d4dec2fafdbc3dcf8da9  crypto/ec/asm/ecp_nistz256-x86_64.pl
+e806141073aa3792e2748f6feeee6d3017124b3bc6059a9eca0d53a2f5785346  crypto/ec/asm/x25519-ppc64.pl
+99645c97401e4b55881c431029f3e188eeef22bb9b46de9e7fc2a57569e42e57  crypto/ec/asm/x25519-x86_64.pl
 2e7b5d2a3eff0b8a90c1de3f28a7bf59b1057e7694c0e36909e774343cef609f  crypto/ec/curve25519.c
 784c03c3f81fd0c363cd0500fbd95f3e49c65f47a249f7ba25fad42a41d3eea2  crypto/ec/curve448/arch_32/f_impl32.c
-8e75602d4d492316d318bac147eaa09d87b0eeda0d450e18683d935673ab61b0  crypto/ec/curve448/arch_64/arch_intrinsics.h
-4cccf81b42c6b8caff7a641280b2b01400c5ca94f8124eeca774569c19e155e3  crypto/ec/curve448/arch_64/f_impl.h
+5e012dbb838ec0533aed7689cd82324f9b4e239792777376e92f873f7318dca9  crypto/ec/curve448/arch_64/arch_intrinsics.inc
 fc28c768e210c98e8d77c7c57c48eacede226083b95c58dd0bdfdc4efb12cbfb  crypto/ec/curve448/arch_64/f_impl64.c
-385a8c6b68b212ab7ea8acd47cd2e0601a0b3ce7356e28b84842aa9acc1437fe  crypto/ec/curve448/curve448.c
+f79eb20d039357d8b7187d2ca1d68c2ed0a4727896588f30efd4dd50a885b704  crypto/ec/curve448/curve448.c
 92a1cca23f4c139e679f61726d17d475a5eae016460b9cdaaf5b2d996d940ca5  crypto/ec/curve448/curve448_local.h
 6bc188cae67754cfdc9e4420ca2a208292f34c0c3aa5a25930146b92111e9640  crypto/ec/curve448/curve448_tables.c
 8d6546f15baec96755625593a9bc7f781092fa4dde846ba6b488a31585b47a8e  crypto/ec/curve448/curve448utils.h
-490496e1c06d1f3ba9474ddd98e07fe11cac2838dd3937f35541f69ae798e67a  crypto/ec/curve448/ed448.h
-b65aa613ee9f74bfc7fd00be16087c431bdf092a7e6943238eee9e54ca3adf00  crypto/ec/curve448/eddsa.c
+14c1ae3dffa8f8f854fe2242c825aa48b2dcea06cd9402a2428982ffbc10c472  crypto/ec/curve448/ed448.h
+eb36ed67152fc698d0ceb27870ead659006a5c44223bda501ee4c1f38103d818  crypto/ec/curve448/eddsa.c
 5aa20e2a4a9ae3a30d7400f3d666238f890004c3dfb66933873e7daa0026fe3e  crypto/ec/curve448/f_generic.c
-81ab2c5bcf5b036f649804f494e1b2ee5d5b2f900dd56b5dc55bac04a63a57ad  crypto/ec/curve448/field.h
+ebca70eb99c3877118eb1967fdc542efe0e8567edf46aeca870790247748028c  crypto/ec/curve448/field.h
 77bc6dd8c7d14a21760eb5e0dbf336eecc78835faa2f6f846824798303109d41  crypto/ec/curve448/point_448.h
 e29e78402540a4eaa853b1b9931aba66be0fdf1c82c6334587a69235e42f759a  crypto/ec/curve448/scalar.c
-606e5f72d40cef708cb4f7bbabc00bcd2b87fc0165854ade1b55ab2c021a8df2  crypto/ec/curve448/word.h
-f4490c0b575b79e63a897b1e85a87ede2645a2c521e67db461b3192884450d9d  crypto/ec/ec2_oct.c
-5d3567b3b6d3922fd82641acff29ed12b1028e83eb0c175132ce7f3470b9db6c  crypto/ec/ec2_smpl.c
+1d20868365c9f78a16de469756c3810a1f2db6c9b699dc9ec9a0868fa1bc7060  crypto/ec/curve448/word.h
+1f0ae0a59de6141ac9dc1b294444807555e3b6e747c7fef7314f90fba77dd322  crypto/ec/ec2_oct.c
+c23841b40837ddb4a07aecf2eeb7d39001bfd88b0fc35382580732d9eb702eea  crypto/ec/ec2_smpl.c
 a1f22814f501780591da20de5e724895438094824fce440fd026850c46ad8149  crypto/ec/ec_asn1.c
-dfbccf591879eecbd9ed75da1fbe6c7b1672d07648fd43b37755dfe248253bb2  crypto/ec/ec_backend.c
+7f6d0eb80575a583e7e81f0b1e2c4bea070dffcadb32e44ea51c3f58ec12e533  crypto/ec/ec_backend.c
 3a3c4f4767513b4fbbabdea2918d7c7d105eb573334a7fd893b866989463c4d2  crypto/ec/ec_check.c
-f3991bfc65a7371b84afd0cc328e3cbd4736edf7267e4b731dd82677bfab047a  crypto/ec/ec_curve.c
+236f02fe2602088a3ffdb3fcd6a8211db4f2014246bc90c134ce472b80a15208  crypto/ec/ec_curve.c
 8cfd0dcfb5acbf6105691a2d5e2826dba1ff3906707bc9dd6ff9bffcc306468f  crypto/ec/ec_cvt.c
-b94eb087740dde2bf697cfbc5e8a17efd80e84c5072c9c72f8ed2f9155976d37  crypto/ec/ec_key.c
-35515133fb3c33c5736a9f744e835b9fc0775193357ab2492f11d0f63503c65e  crypto/ec/ec_kmeth.c
-652a1544120bf0fecde46a8e18cc28fffcb7cd864be2e2b84c99d571ba320e64  crypto/ec/ec_lib.c
-0d113ac5dbdb420ba3d1c060f4fa3300fc0a81b571a919c2b176022fdca89878  crypto/ec/ec_local.h
-714bb2e01c5f814dd3d63296b93111a9a94b50a441ba85291a9cf9ee5748f42e  crypto/ec/ec_mult.c
+040b00015f640eeb9db5e1589b0a314d80421a3cdd09fa92ba4939cb6d6486ac  crypto/ec/ec_key.c
+62bed8d5fd7389e991bdc4a6f0ab4a7dcd929952b2ee34e567c06b25bb06cfd9  crypto/ec/ec_kmeth.c
+53414114df475556b196c24498e52dccee35ed0353e708c7444a3a35475ba527  crypto/ec/ec_lib.c
+ebe9ca2a6d10c484a65e8106e657b495873c1a34c9d5a1e8b78d7d9f360e2bdc  crypto/ec/ec_local.h
+f250770ab269bbc4a8113e873dbab6166c1058905bba2c5aa4a55eb2c5a0b2f7  crypto/ec/ec_mult.c
 c2a81f5f56d304038183ba6b02fdcba8767833f61773ec483e73b330b67ae59b  crypto/ec/ec_oct.c
 c7fba2f2c33f67dafa23caef8c3abd12f5336274a9a07d412b83be0366969ee6  crypto/ec/ecdh_kdf.c
 b86a943ae62145438a7214539ceb3e0de5a30e17a6e59742c6e30991db730ab6  crypto/ec/ecdh_ossl.c
-b75bc58f7c1a7996e227a0f22ab6c644ce987836cdcf1c5b794b936855ac984f  crypto/ec/ecdsa_ossl.c
+f698d8d3f57b38e1ecd96ee06e76c503b4b7d52b07cd6927c0fdedc7b86036f8  crypto/ec/ecdsa_ossl.c
 927661d7d67d93209ce21691d4604c25a3f643eef924e8bf1c03d29f196bef22  crypto/ec/ecdsa_sign.c
 f686cea8c8a3259d95c1e6142813d9da47b6d624c62f26c7e4a16d5607cddb35  crypto/ec/ecdsa_vrf.c
-141cfc1459214555b623517a054a9e8d5e4065a11301237b7247be2c6f397a0a  crypto/ec/ecp_mont.c
+1c6e9f8bec7028b5bfb8faf1231f9d65ecde89fb131beb04d3e513fe8014505e  crypto/ec/ecp_mont.c
 13b30f34aeeb0c98747239bfe91b5f0f14e91b2c1f11db62ebb5950c7219daa0  crypto/ec/ecp_nist.c
-a42137b3d46051e9205d6f1eeb45b83e517f2b8a5ba8d23d7254374cb25c6fcd  crypto/ec/ecp_nistz256.c
-f38971ee893608f00d1ddd77d889aac9558509bda62d2e1b3eecd9bfa0c29095  crypto/ec/ecp_oct.c
-3a6441d716d7157abe8e9a2edb80d462257bbf602aafbb219463392352b088be  crypto/ec/ecp_smpl.c
-99571b1724562bdb06b03fe1d7f6f19ffb7f1a9df543bf74127b54948957a7ce  crypto/ec/ecx_backend.c
-5ee19c357c318b2948ff5d9118a626a6207af2b2eade7d8536051d4a522668d3  crypto/ec/ecx_backend.h
-8e50fd1e60ad1ac824e704375096e41f4ae535e533a3334d78c481e34d9d0fb8  crypto/ec/ecx_key.c
-ed0217e7c2049b44a454b40e7e18385eadb34bce1bcf54337f420cbf988775da  crypto/evp/asymcipher.c
+dfbed11b7fe019acf377f40aacbcf2366018776cbc3754e55e0a387c41db669c  crypto/ec/ecp_nistz256.c
+d6e604cb04490bd604fbfca00a5095d62b1763ce0812fec7d3fad122a226e741  crypto/ec/ecp_oct.c
+6648cbee3c740f7c8b6c2ae2b20468247a3f4f2648c950f5c77ba2fccca180dd  crypto/ec/ecp_smpl.c
+f58e722dfcbe74a1ed28ca0716685ce9dd3c49ca0e585d10adda3e7f273968c6  crypto/ec/ecx_backend.c
+8310da9236c29d3491db25cf9aaf64f4fb2c3273a31f19a1cc789e555a962910  crypto/ec/ecx_backend.h
+28c82ee212123c7da522747cbec521eda5640e977abcc02ced0f586fa6177113  crypto/ec/ecx_key.c
+ec4ce97d492fa4418a706aadc8d24ee7255772aeea19b5e6e6bd8cc74625f3c6  crypto/evp/asymcipher.c
 1f64d4752074f954af4f290788e4332e3874ba3282bd03d3e1d1f5ce4b0888bc  crypto/evp/dh_support.c
-0e9e206dd4b179ad09e1475949ce9ddb5bce0e0d66072477d94b7788c57e70d9  crypto/evp/digest.c
-4ffc3fc5ee5f0dcadf1516f1cc29338f0f4d85c59881c06d5a777cf4e47a6d5f  crypto/evp/ec_support.c
-8bf5ddf1c8e352a9f9241c7275d3a8cbbd633fc0f93f609158d15aee7af5a9d0  crypto/evp/evp_enc.c
-8683c25d4bcb598375a04d4682399c9eef095225b49498afe819e5193e9cc117  crypto/evp/evp_fetch.c
-6d9106f27ee707814e346879fda8008b75cb5714700060f65134a4fadff1c48c  crypto/evp/evp_lib.c
-e997e921669076c51e230ccb2e36b1c6755fe408c61b1177d2aa67529cab15f3  crypto/evp/evp_local.h
-8963ef06e4d228f7067917434f60f0502dc4bbdf3b271649498b734f4074bfb0  crypto/evp/evp_rand.c
+3791ccf51401ba76e793d46bb82021510f3832afad128a416f3a0192b0ca5d7d  crypto/evp/digest.c
+392e18d618024188db1987f420fbc0cd7b896e33083bfdb36247dd718cf1ed5a  crypto/evp/ec_support.c
+8258f083541b3dcb63f06fc91561f4c5a2ac6d611927d191b0205e14fb3c5f9f  crypto/evp/evp_enc.c
+667a17cfcc7c5a3aa52e05f3ba319b52e87f3b1c2d08f0d9cc4bff623a8533e8  crypto/evp/evp_fetch.c
+7b0fd301ef9954007ab4db2f6e8572dc6270ca17761cdf9757fc7ea225849e48  crypto/evp/evp_lib.c
+b36dae47360b48ff92773de8d8affbacf85456a29a3576d136ffda2682ab64cc  crypto/evp/evp_local.h
+dff5f95e7ce972915f260b6e0bb542b57c8a7771e1db9376b2fe8181915d2a35  crypto/evp/evp_pkey_type.c
+2a26c96c465eb751b7544d952af444b34e7eeb79ebb6f2e94c9097b0295735c7  crypto/evp/evp_rand.c
 0bdae4714221662282dccd5b1f2485370d24e463c11bdbb71a310f34616954fe  crypto/evp/evp_utils.c
-1d78745866dde8224eec50c8553a15b51aa14bc3313969479806b3c3024c7282  crypto/evp/exchange.c
-294284ad040fe4b74845f91b1903c961c757e1ef3fcc2ffa35f43f37f1655e64  crypto/evp/kdf_lib.c
-532f0ff4ab32068f160016f39cd520fadfbd09b81b3b3b562bf543acafb38889  crypto/evp/kdf_meth.c
-d911878128b90b98f3a4a1fb844ef3a20d35eafda3f80773dac8ce93c55bc352  crypto/evp/kem.c
-84cebe10a50c88d0db12a90ad751eae43c7ba2954bc9f42f0c1490d66eac5bb8  crypto/evp/keymgmt_lib.c
-80a5e310a3c3f551ca8e1992793ffbddc525274f90dbf4f36217b57acbc8bd94  crypto/evp/keymgmt_meth.c
-15654f58c113d6eb7100caacd00ceae68113edfd6a921f6af1bea4040fa58f5d  crypto/evp/mac_lib.c
-8f9d191eda167c24fb579818d432dc12321fc559ba59b9be96ab4c9c3953911c  crypto/evp/mac_meth.c
-daf742357baa65ba164c8bc34044d7bf92bc1f94b010a41a315411dd0fbf4471  crypto/evp/p_lib.c
-02d6b04f2237ceb8e81da8287c06a8e60315a812e719b5a0603455feb1ae4628  crypto/evp/pmeth_check.c
-eb34179ed538e971dd4f27040bb5b17bf4e0958eaaca4abb4eb5b841486dec86  crypto/evp/pmeth_gn.c
-09640d3d887c88f4989863330ce1d17516f07543155ce474e8bc4c01c152e80a  crypto/evp/pmeth_lib.c
-ba4ff38738cbcfd3841d53a2fab92227638ceca176d3ffe50e486c9dcbabb5dd  crypto/evp/s_lib.c
-cdeabcc155b3ca14afa3dbffea7dffbec528814a126a09e4253c25bf9fad2b77  crypto/evp/signature.c
-30af153213f8b008955486000c5a92507dc694c4af9ac6ed6fef3f290efa3e52  crypto/evp/skeymgmt_meth.c
-64f7e366e681930ba10267272b87dba223b9744a01c27ba0504a4941802a580d  crypto/ex_data.c
+611547a86fa5c07932d348760ca838a483ee201946c86889d30da8a461d3b221  crypto/evp/exchange.c
+c55e3b0a2e8e9fab282343463909b4c4139a40449e9c2eaf1c81aad2b9001f17  crypto/evp/kdf_lib.c
+d2f75dcd0f0194a464b8ed4035c988599e8cdc1cb63711b9a30939401c671c22  crypto/evp/kdf_meth.c
+955b84ca25e9118fcf0b9dfdfa77c57cd0c8608c431c71e1a0a05a2a27f81d0c  crypto/evp/kem.c
+a7ed6f797fe62f950f549aab6c13bc7357bd59de140feb8af9437c7a3117422e  crypto/evp/keymgmt_lib.c
+94ef431b1bb2c96cca3806b8fdb100bb9d9f7afc1fbf417d6f03b7043657eeae  crypto/evp/keymgmt_meth.c
+b68fa4796b20a4735f4779371859b27b5d55f145f791d7cade8ef90c7d85bca7  crypto/evp/mac_lib.c
+9b812a03bf763f3fe2dc9b86daeef05d8b9946f7efe43b6d312bc487340f8aed  crypto/evp/mac_meth.c
+b09d2c6cb6307a287af190aa744ea6ac78618cb9522e7cedf324de76d24bbab3  crypto/evp/p_lib.c
+eb7ad84686854874250101adf52a3498c7e08ea63e5de17845d35f2a66461148  crypto/evp/pmeth_check.c
+05c6934d0d8befa8f551323db31a9a908bba7e9cfebe1161a2bfb0eb4c3b36a5  crypto/evp/pmeth_gn.c
+10de135d3bf315ea2f1e97a2aff46e0911dd074a3af5fd429a437192ea72f2c3  crypto/evp/pmeth_lib.c
+1d4ac1c4a0bf0a5e7a99d98dcfc96f8569bbc718df3a2ae208f776dc681e4eb8  crypto/evp/signature.c
+82738dd892e0cfa1897f58ed21a8ba66b5505ad774a484eaa0edf70d1b69b359  crypto/evp/skeymgmt_meth.c
+d40ee57a311a8aed79b1995e4667c6191d4a6d073eec343a6d9ce432830e9a16  crypto/ex_data.c
 d986ec74995b05ff65a68df320ab45894ba35d7be4906f8d78ca5fca294a4e6c  crypto/ffc/ffc_backend.c
 f4f84cade98907fa9905334b6c3c046b430b12b1460edac0617d82ca763620ab  crypto/ffc/ffc_dh.c
 854378f57707e31ad02cca6eec94369f91f327288d3665713e249c12f7b13211  crypto/ffc/ffc_key_generate.c
 4e973d956d4ec2087994de8e963be1a512da1441f22e6e7b9cd7ee536e3ff834  crypto/ffc/ffc_key_validate.c
-a1e87ba5b3aca0520fdac72b7a5ba408865fb85ed142c6b76514b39cc21adac4  crypto/ffc/ffc_params.c
-bb208ef3a2c7ebdc518bd38f2f07a17cff356040f1c5d68eea13bd9275897a52  crypto/ffc/ffc_params_generate.c
+66d6e500db31398dcce7e3b402ccf5f333b9912561157848776b8977f5e756b4  crypto/ffc/ffc_params.c
+56c52c6df6cd9282296f24b395e6a78deb35248e79a26186a75fc508262c47f7  crypto/ffc/ffc_params_generate.c
 e9a500ddbe96cb5b302fd2db74fac0924a6ac45732df5ee1c09e82b19d06ccfd  crypto/ffc/ffc_params_validate.c
 f172c8c2112ee82716a7bc3a3e05d5cc26188c66b9d768ac1ff906845063d2cc  crypto/hashtable/hashfunc.c
-ed523d9793ff9db947857bca354067d17b8de5a4b28604dbf902320e62d93e33  crypto/hashtable/hashtable.c
-9a63ec43c8b9a55e0b135394a659026c1d1236978ebbb5df0e3c4c5c58b62ef4  crypto/hmac/hmac.c
-907dd44e0bf873eebefcb4d82975b72ecec9e0f3c348c79314450fdaa78d4073  crypto/hmac/hmac_local.h
-0e2d6129504d15ffaf5baa63158ccec0e4b6193a8275333956d8f868ef35127e  crypto/ia64cpuid.S
-29c020cf599c24ef9969a42e00e690a7b463c20dd90356b0a4117ca31b13db6f  crypto/initthread.c
-75cb26369ee61de428f1ce982460fe193684b8f87d8f29169329262502fa88af  crypto/lhash/lhash.c
-22261096a117533e78012f5f18586b6a81edb3e09ae8b206b5eb9a0a5c054adc  crypto/lhash/lhash_local.h
-899ba6a9049a61d5b175637907f747f58863cd8950409cefac8fbc8f574f970c  crypto/loongarch64cpuid.pl
-460a7af09cde89a820b091522ada1310cfcec99c60aee505f94c48c35e9a29e8  crypto/loongarchcap.c
+21b74f0abd0f84390c90398bb2812565e183e0f35b2561ff20a52941ae67a86b  crypto/hashtable/hashtable.c
+95cbfbdd853f415d886928834f59d01a5fd08c71a154268c881dcbcc1131abc0  crypto/hmac/hmac.c
+f1e386f65db354b5a0c4248d3df6ee690881aaa3fd4049fdc443f9eeb635f8e7  crypto/hmac/hmac_local.h
+f9743f1646fbd8b61a2dd0422f42934912c1bfc95f6dcc38fa0a567e3e6b4e95  crypto/ia64cpuid.S
+99727373714d17bfaadf837581cb82b95100604fabb5926c22dc68e4fda08d57  crypto/initthread.c
+863a23d7441e71e065c4d1a29c17eb2e575bbb03ab31407ead9e7ad2c16a2c9a  crypto/lhash/lhash.c
+256d8ee6275df46ba94b882cdb7b3c7210ac1b4b0602748ff6fe8af3b27981f5  crypto/lhash/lhash_local.h
+f66ff2d5e6fcf5c858b46bce16ee991126d362df0bc0ebe26213272c7f02db7f  crypto/loongarch64cpuid.pl
+d3ae6c0273dc6e955fb878ae689460a72dd9fdac93b2c9e19b79d2c78a304a37  crypto/loongarchcap.c
 f866aafae928db1b439ac950dc90744a2397dfe222672fe68b3798396190c8b0  crypto/mem_clr.c
-1812ee360303b9fdcebe6dd0690944646bd9605ee67e3554c691cf5993293c46  crypto/ml_dsa/ml_dsa_encoders.c
-825105b0a2c4844b2b4229001650ff7e61e1348e52f1072210f70b97cd4adb71  crypto/ml_dsa/ml_dsa_hash.h
-2bebd01093de6f77dabb8b6e5ac3deaad9104904956691e22d80f105a3e526c2  crypto/ml_dsa/ml_dsa_key.c
-579c1a12a5c5f014476a6bf695dc271f63074fb187e23ffc3f9ccb5b7ea044f1  crypto/ml_dsa/ml_dsa_key.h
+5e33547e2f6775a89701b311712e6a3ee6e2a64a8f283eae9e61a4a01c392e69  crypto/ml_dsa/asm/ml_dsa_ntt-x86_64.pl
+023bf73b6e04d9c999815d7ec84297943aa9766e1ab5a72a1869c95a377ce851  crypto/ml_dsa/ml_dsa_encoders.c
+39c6f4c50a388eb16197539132a97cc15b0b74b93ecfc2263a36a0423c2e15b0  crypto/ml_dsa/ml_dsa_hash.h
+7c7431a60e0729ebca444a8e91d16fa928b61c99396cc0538aed9ddcd5942e61  crypto/ml_dsa/ml_dsa_key.c
+44cde1c60f0df46f8e44d2e0e070782314b4c623e8b44862f939f397e702d367  crypto/ml_dsa/ml_dsa_key.h
 3f98eb0467033d0a40867ef1c1036dcfea5d231eeac2321196f7d7c7243edace  crypto/ml_dsa/ml_dsa_key_compress.c
-170292bfc8761e39b688ccfb21b3660af6e1a875aa38ff7448cc22f71f5874c5  crypto/ml_dsa/ml_dsa_local.h
+5b349bf96432658dd8b02c6e9ad60d6fc154d704d0116adb5697c6ae65debbee  crypto/ml_dsa/ml_dsa_local.h
 6ac18f9ef27efc7fddc38ad5edec94fcf76a972ca9fcb6bdc5472673d885d238  crypto/ml_dsa/ml_dsa_matrix.c
-ff65c82c56e341f47df03d0c74de7fb537de0e68a4fa23fa07a9fdb51c511f1c  crypto/ml_dsa/ml_dsa_matrix.h
-c2652262227348b8bb053a239e8491b26f08d6fadc47ba3471302f5797ae1c62  crypto/ml_dsa/ml_dsa_ntt.c
+e2704808c86c370d2bbedf14c20746f8ccb3436cc59b7d458ec93adb8c6f8f06  crypto/ml_dsa/ml_dsa_matrix.h
+9054eb27f005696fc7cb9d35ac4e4ec6f06f1486f9d355fd9aee049a6d1481c1  crypto/ml_dsa/ml_dsa_ntt.c
 3e0980e67842c4d8637fa449ac41e9d650c614c1074c29f1021605d229a4f73d  crypto/ml_dsa/ml_dsa_params.c
-10e37ab3ee09a45d99007665e073efb2b062c819f30af8694c6b0f411eb33822  crypto/ml_dsa/ml_dsa_poly.h
-abb4f2263fb9b6d08911e1b8e2df2c2de636d6255f7cf3eee594f50dedcefc0c  crypto/ml_dsa/ml_dsa_sample.c
-f1cbf5ebe46fe456e338a496193bf028d48a28bb3d4804591094babe84d83b25  crypto/ml_dsa/ml_dsa_sign.c
-5217ef237e21872205703b95577290c34898423466a465c7bd609b2eb4627964  crypto/ml_dsa/ml_dsa_sign.h
-afc44b2cdf6a03555cebcc0398179b44f5810098d0b17dcb2b0c0c62023d6964  crypto/ml_dsa/ml_dsa_vector.h
-dd95a5261fd1624e1e93270b0dc9404c887506a402d55521a5074975db833fd6  crypto/ml_kem/ml_kem.c
-36e24eae5d38cc9666ae40e4e8a2dc12328e1159fea68447cb19dab174d25adf  crypto/modes/asm/aes-gcm-armv8-unroll8_64.pl
-33357356cd739d4ae89d52f0804b6900e4b94d8829323819c6f64c8908e978df  crypto/modes/asm/aes-gcm-armv8_64.pl
-573c286991352233cb068d0e218c5cb1e6fe5d07a924496dbccca95fa82e1d4d  crypto/modes/asm/aes-gcm-avx512.pl
-8fab6574aa99ee635d564dbe68b014562b61af37fa4f151210690837cdae6707  crypto/modes/asm/aes-gcm-ppc.pl
-dd0de5ca8913a941cfff781a42fba43227e133976a24d0fddebf63909f7e010a  crypto/modes/asm/aes-gcm-riscv64-zvkb-zvkg-zvkned.pl
-a4fad5a5cb112929323632e4f3f5fce7d6f0ceb6ea2e3ed1a4a2165f05fbf0b5  crypto/modes/asm/aesni-gcm-x86_64.pl
-c2e874a8deb418b5d8c935b2e256370566a5150e040c9fa008cdb5b463c26904  crypto/modes/asm/ghash-alpha.pl
-6bc7d63569c73d7020ede481f2de05221ac92403c7cc11e7263ada7644f6aa9b  crypto/modes/asm/ghash-armv4.pl
-097975df63370de7ebea012d17de14fc1f361fb83acf03b432a99ae7d5bceb24  crypto/modes/asm/ghash-c64xplus.pl
-fdde3bc48b37790c6e0006014da71e7a831bbb4fdbfcda2d01dbe0ceb0ba88fa  crypto/modes/asm/ghash-ia64.pl
-e472d73d06933667a51a0af973479993eed333c71b43af03095450acb36dbeb4  crypto/modes/asm/ghash-parisc.pl
-e6d6ce559210aee1e97f098683e290c221cc90f6f4f8047b331e8071a8387559  crypto/modes/asm/ghash-riscv64-zvkb-zvbc.pl
-4c960949a5b7688f9019e177c24382dd1e78f6d343f3c4326bebbc065eb3a9f2  crypto/modes/asm/ghash-riscv64-zvkg.pl
-494b4b36fd7c7d0e464be76f723c46ae7ad173593ff0556525edfdc974e66c32  crypto/modes/asm/ghash-riscv64.pl
-92071f9c046f312c4eb7df483f385bc71ade863392e1acf3e821912bcc5cfaa7  crypto/modes/asm/ghash-s390x.pl
-6af1a05981e1d41e4dea51e58938360e3abc4a4f58e179908242466d032b1a8a  crypto/modes/asm/ghash-sparcv9.pl
-26f55a57e77f774d17dfba93d757f78edfa3a03f68a71ffa37ccf3bfc468b1e2  crypto/modes/asm/ghash-x86.pl
-3d746cc0cf6cca866e34cdbbd79f5660244033fa440ed82aaaa9dd16cebf821f  crypto/modes/asm/ghash-x86_64.pl
-a4e9f2e496bd9362b17a1b5989aa4682647cefcff6117f0607122a9e11a9dfd9  crypto/modes/asm/ghashp8-ppc.pl
-92f17ee53bd40123358ce5b37bcd6063bfa7d6860dd734d4ac585249c03a6b32  crypto/modes/asm/ghashv8-armx.pl
+083df153906787ab2eb39a0aa4bc774d85fab2a2aa10e80e535a909c5dccd6ab  crypto/ml_dsa/ml_dsa_poly.h
+d80307d35ccf787dc1595692093c71e705d51989051feccecb38cb09130ba087  crypto/ml_dsa/ml_dsa_sample.c
+e170630ab923d95eacded0018f350528ce0013f68872c11e0b5d3548226d1994  crypto/ml_dsa/ml_dsa_sample_hw_x86_64.inc
+e48950e5753ed1175dddc7da22cafc8da3ca45ddb85368b90b3f1bccde4baa74  crypto/ml_dsa/ml_dsa_sign.c
+22b263740ae86950030206a0c421c31983491e56759f3a4621bcdb7badca0d36  crypto/ml_dsa/ml_dsa_sign.h
+7bd522972de2539857984908ba665a693c002e337682d52f90e2df63158cd5b4  crypto/ml_dsa/ml_dsa_vector.h
+9ae4228f321a845cc5125492ed31eb39b55ac38832ccebbd05509a2fe9346cca  crypto/ml_kem/ml_kem.c
+6906e197c84ae0d828748d47c47d565fd912076c35a65ea304e306fee4a17157  crypto/modes/asm/aes-gcm-armv8-unroll8_64.pl
+a1d87ada629d7c1e487524f475b9c2b01a700d981e092ef6895e3f32d2dd79e8  crypto/modes/asm/aes-gcm-armv8_64.pl
+0374354e64c74c1ce20c06a9f06477bc2e8c3a06c943b30800d169a23a9c91e7  crypto/modes/asm/aes-gcm-avx512.pl
+7ec48551ef004c2f48a51c46b31c1a5f5b88c1075da4e7860def699a58b2a000  crypto/modes/asm/aes-gcm-ppc.pl
+b7104ee749d555127a08609c7df5056b56d9aee19c90f3c42b42d69cf7caba03  crypto/modes/asm/aes-gcm-riscv64-zvkb-zvkg-zvkned.pl
+7bad3e6f60f2169f920f76339575ed1332b2259fdfb8cf4ca74962cff4a7eaef  crypto/modes/asm/aesni-gcm-x86_64.pl
+0d10ce3c9ee1016312ba124de3beb8740bc13d5a1bc06dd6c4693a22df05e954  crypto/modes/asm/ghash-alpha.pl
+7ec9e9aca52b50d4dfffe6d4da4fccfa839487f478db5dbccfb9029baca348c5  crypto/modes/asm/ghash-armv4.pl
+326b715e289adc979840d8037cce526e6ec4d0917495c75ffc53e78ed39d8ed0  crypto/modes/asm/ghash-c64xplus.pl
+4fa4a0dc1a96252f6c2369ee55ad753e6c41402d3e8cbe7afeea71a7e35c9cc1  crypto/modes/asm/ghash-ia64.pl
+175c15708f8749fdd8f85f729ced44e8c2bd1d42528f5f1fbd908c71213a07ae  crypto/modes/asm/ghash-parisc.pl
+9140d35aa157dae5c98b2c950248d15dffddd16c11a0f092c4a79b0a460b2d54  crypto/modes/asm/ghash-riscv64-zvkb-zvbc.pl
+c786210922836f2ee9f7806b6cb7a5749511285004cf7eed95b3979bf5685bb7  crypto/modes/asm/ghash-riscv64-zvkg.pl
+b353c76f30ed3bcde79e1280a53acbd7172d1924124c33bf2fd5830396e7ac0f  crypto/modes/asm/ghash-riscv64.pl
+03269b327d5055e7c37992e989b75e1e6cbdf3878a6709f8ffd8e3e13d171e07  crypto/modes/asm/ghash-s390x.pl
+920385de6904c52e69d093d5abb75774964e46f96d343262b88a58aa8e7f64d7  crypto/modes/asm/ghash-sparcv9.pl
+f41a5e32029807f239a10f39573033149266564bab65c0e460b2b4dbe75e1ea7  crypto/modes/asm/ghash-x86.pl
+d96c50281525773a51bc6b30ba3f62e401039ea203ffad8702bf65e5f943fbba  crypto/modes/asm/ghash-x86_64.pl
+270757e9893c605162a1f96db1927aa2a98b758a640a6f69cbd124433c9e603a  crypto/modes/asm/ghashp8-ppc.pl
+6046fa0334247fa4a2d57dcfb5a7df4ad3b4208b74f4ee9b94f168556a59531c  crypto/modes/asm/ghashv8-armx.pl
 ca4be187fc1805d498f2adb823509f0519e214644029c18d331b5b01a0891a9d  crypto/modes/cbc128.c
-979ec7af2df2bd6cad5218ba1dac44316e04447c0a1420bf849ad2ee3402a373  crypto/modes/ccm128.c
+2a6e6a6d617ca931ba38f07850c547b920a9ac654ec1f5249f0a8abcd609c935  crypto/modes/ccm128.c
 00d68c071ecc99c471ec0af7e393f5b5ad38bd89483227291cf4cab08ad74964  crypto/modes/cfb128.c
-2a0ab07286b70ce4aa0caf3b5b4be2c00eed3a6d855e9542ae94d0e1f586b1e3  crypto/modes/ctr128.c
-59be0f955b16434efc2618109a01571884c6876af785f1db5dad69786124b341  crypto/modes/gcm128.c
+bdab424f63a346d60f6d07fb4c0d9fab48cc85b4c64583d9801cb43392be2c48  crypto/modes/ctr128.c
+2ac13ae869304fce0f248115bd0e7f48edc08152b0e20e4f2e666e8767bc45fa  crypto/modes/gcm128.c
 b431ff38c3a85943f71be0d76b063dbe2930967629b8721465b8152ab7867296  crypto/modes/ofb128.c
-c5674daa4bbe66c2ac8044f83df67ddff8e0585ae091adde9ffe083f64e92a29  crypto/modes/wrap128.c
-0a10e0cae6f4ac164afe97a64df09c8412145c8a25f387ff3a53ff7495572cbc  crypto/modes/xts128.c
-9a34ad9ae361f689b0b98c454092e89567d0bfc969c08a14c8001e60976920b2  crypto/modes/xts128gb.c
-515e110e01867d6527bec758a264473b62cb7edff213816e2197faf6e96ec048  crypto/o_str.c
-44594139dab6ada1f34f9c6887c97e258c1204b833a6c20f58097f17d0f1645e  crypto/packet.c
-671b4c1211bd55bae70a2a2d1eca0c9c25a4428c30311ea9511427e345d5ab64  crypto/param_build.c
-d4fb8ecfed73be390c269bd16c76c1a9db6425d6d35787302b3b4c57e465b3db  crypto/param_build_set.c
-d362864eab6707ba2f4efd65c91dd90d669721f2d8fdebc875fd1d2957154396  crypto/params.c
-c0e0ba07ca5d4acfe450e4ae53a10ed254097ed2f537f01a4a43a9f5b5cab501  crypto/params_dup.c
-fc2432f5a76784d4ca47db1803c8b19acbaea26987f8e33dd8cc5571f8101b40  crypto/params_from_text.c
-ed6956c34da5127fbf8f1a067654b617c261039743a12fd1d296a1dd01b05c26  crypto/params_idx.c.in
-1a81e7483e250ef96f7024f75be884b8830801b47cbdb2d4159637666681b350  crypto/ppccap.c
-46fa4994a6234a98a2845d9337475913f6bc229f1928abc82224de7edf2784b8  crypto/ppccpuid.pl
+4c2cdcc761cea83f65144acb094103b26d252278ec80db7ea7032b17b25a8e3b  crypto/modes/wrap128.c
+cdd53ad2af48dbad3b68dec8cb902d4cd26bfb5fef43c2469140fe0be97c620d  crypto/modes/xts128.c
+217561385ce8d6bc343d9724eaed448d53fa97446deee3bbcb9956ed0d625e2f  crypto/modes/xts128gb.c
+3b1fa6a6158a42cd186a9c2f25909a13f4dc4e37ef18425dd22995ab8575f1a9  crypto/o_str.c
+985d7a019a8648b2768ac44caf76c582010d02472acd7d6f750225d14a5de4e7  crypto/objects/objects.pl
+334ca8ee920a8b00a698e1f2f239b33d70056b866333129902bc1e1e83798ef2  crypto/packet.c
+f061cf845509153d3aa301746a9182a94cc7cf3e09720223e817b9b55594f5a9  crypto/param_build.c
+01d89a771ab23f96857539fb0149d2e4db92269228089d86dfeecf0bf1893ac4  crypto/param_build_set.c
+d880778d542d5d4d1788ac54df26bb842726d3344d8f1b83254c9e36bac20ab7  crypto/params.c
+538c45b8c28e54a0ccc7c3ca446ff5cedbf8ed711b69d67dba7e1acc3327fc80  crypto/params_dup.c
+6c193cfc31c3ba5d6234a09d32198a15ab8a40258824ad7d79ac9fed8faf54e7  crypto/params_from_text.c
+f05472fb0cb8104f21eb2381dc4fd314425a3e4e93622f89595ca58c0d22ea0e  crypto/ppccap.c
+bc316512d4f520323fdda48c5236799b7438db66d1743924ee731df68964ba11  crypto/ppccpuid.pl
 42eff8da564cd8004f2d17fb01686d24977d931c37c7e6de693e7d414c2d7914  crypto/property/defn_cache.c
-f6c43fb6fee4b40dfcafbc388d6081b72a8030aac0557ae1e3a501f4011acf00  crypto/property/property.c
-7f936270992015923e5f6e81b1afad0148b9034693d3cf4665465f839a28c81f  crypto/property/property_local.h
-71ccd54b74799afe44ec12e1ec8b6b7ece60bc25a00b9b49044ade025a2c39f8  crypto/property/property_parse.c
-237079e82943c40d4df9cb6214cf9bc9a84905e4f799eee19a5e0ee4c2d4be4c  crypto/property/property_query.c
+8eb072558c8b1eeb322b84bc919c5b29898ba2deb5c87b48a6d9f5e4acf54bc5  crypto/property/property.c
+e8100495a62f53f95e38a7c4748ce47973a2a70b799468de1d5a26ca8639f5bb  crypto/property/property_local.h
+2577c6f712200633fd27236928d4e857248ff9ace2c8858e9295185e0b07571c  crypto/property/property_parse.c
+fce93d3e7da046501120573317248945945845a7aca1344e36a386d44504f441  crypto/property/property_query.c
 5b35510efa119157e9e217996870778d1ab5f69612cc1bcc8a6df372a625e875  crypto/property/property_string.c
-979017d686a02761b6ccd5188bd938a0ca1092e6d70dd24de13dbb806448a2b4  crypto/provider_core.c
-aa58d7800d3ccf2989b0de3c2e2710dfac36c88dc51659129897b0dfd2162527  crypto/provider_local.h
+f319002443b029e36c4962d0d283a613787460d293447330fc69363b5df64245  crypto/provider_core.c
+2142e38017cb142e0901eeb38dc12bc435ca367fdba05a613e8506076133a6f2  crypto/provider_local.h
 5ba2e1c74ddcd0453d02e32612299d1eef18eff8493a7606c15d0dc3738ad1d9  crypto/provider_predefined.c
-1e919f7f3c860eb21bf2f6f868dae076c64c53f1ad794c6764f69329724c3fc2  crypto/rand/rand_lib.c
+87ad98160d380c4e1e8729a922d889e7fa4976ed2990d306cb2239bc4ed8479b  crypto/rand/rand_lib.c
 9e162caba63741e3df4d0f1c49a7555263ebc120cfb643546ea7e34d3f5eb862  crypto/rand/rand_local.h
-dce7413b4c4e588c9a099c6fd7c6c9a397e034f259a2027d4ea8bdfe149164fa  crypto/rcu_internal.h
-0c1d3e0e857e9e4f84752a8ef0b619d8af0d81427b52facbd0174e685dac9a47  crypto/riscv32cpuid.pl
-231263dffc16987f5288592ebf4c0738902d5146bfc16bcd8a157e044cb697da  crypto/riscv64cpuid.pl
-32e427d3d75f7b2d37e2765e2d2c111d45ca5871200be98e8943219dc475e458  crypto/riscvcap.c
-f0c8792a99132e0b9c027cfa7370f45594a115934cdc9e8f23bdd64abecaf7fd  crypto/rsa/rsa_acvp_test_params.c
-b1584c4a1a5f83a1fd43d854ce72bb11735aa34945f2b2f983228f36f27fdad2  crypto/rsa/rsa_backend.c
+9e523dff5c62a0a779135f76db25b846d90bf36973417b4c3fac682e4ced5705  crypto/rcu_internal.h
+6ff9cac4f1fe14d1b588f952391bfdb8c982d97c32d21a1894c26537ad76ca0b  crypto/riscv32cpuid.pl
+b7c97c6ae3468d0d86005adb0939263164d37281406cca031a120a21e506dece  crypto/riscv64cpuid.pl
+759c3d109401d500748e57137025f2a6070d36f72c729a65a6b39f33255eed4b  crypto/riscvcap.c
+eac38a6e61721c1a6c769a6854b6b0158b99bc696aabe30bda37197d9220ef94  crypto/rsa/rsa_acvp_test_params.c
+6b04a82053d271ac15ff48a02c12025e9fcf56032e393bfe95d1007a15bd6596  crypto/rsa/rsa_backend.c
 38a102cd1da1f6ca5a46e6a22f018237964336274385f5c70cbedcaa6997647e  crypto/rsa/rsa_chk.c
-e762c599b17d5c89f4b1c9eb7d0ca1f04a95d815c86a3e72c30b231ce57fb199  crypto/rsa/rsa_crpt.c
-157eec6c45b95ed974324055f594885c50e33616af3af06efb558d651a786c69  crypto/rsa/rsa_gen.c
-f22bc4e2c3acab83e67820c906c1caf048ec1f0d4fcb7472c1bec753c75f8e93  crypto/rsa/rsa_lib.c
-969a13b951b8a77337fef84437b1aeec49ab1c73ecbceeb4b0df2174ae16a9a2  crypto/rsa/rsa_local.h
+793fbad15585312a0a1452eaea2c7590c6bdb4a8d8083eaa0ed0539b5021f913  crypto/rsa/rsa_crpt.c
+4e2bb2f1bdba81c6a13f09857f3cf5e8f8bb3ebf263a4b8201f3455a3eb7af87  crypto/rsa/rsa_gen.c
+fe3a05a150a0377584c3acb30d4349aac801ab302b87752c0ae9c0415c18218a  crypto/rsa/rsa_lib.c
+47b04c9ec369f85037f78a5f84f281180eb99c91518f8576fe92c7a3b21e1181  crypto/rsa/rsa_local.h
 cf0b75cd54b61b9b9a290ef18d0ddce9fb26a029a54eb3f720d9b25188440f00  crypto/rsa/rsa_mp_names.c
 5c60f6e05db82e13178d805deb1947b8eee4a905e6e77523d3b288da70a46bb5  crypto/rsa/rsa_none.c
 cf7e95467a6e6681069ba0c6a0befeb631b499d9b2ab12db0e93967746686f11  crypto/rsa/rsa_oaep.c
-c3706c33eea448ef1d4fee50034dd9224207261a40cba2e4cc348331a3e72953  crypto/rsa/rsa_ossl.c
+269dbeab273200fc5e7f35cedb5e2b748c59cb816c23d4d3a7cf4c69cac47a3d  crypto/rsa/rsa_ossl.c
 a7e1d7e68d93c1956d69547e2ccf7052965832a2254b2181cdb80580cb76059a  crypto/rsa/rsa_pk1.c
 1ab7069966decfbd479179f137d6d33be2b48eaf4aca5a44c996e86df7aee7d2  crypto/rsa/rsa_pss.c
 bf6d300b7e7e9e512a47c5bd1f8713806ae3033a140d83dfae4a16ad58d11170  crypto/rsa/rsa_schemes.c
 58db0509f34d970a2f206d468f718c17513970315d5d5ec92822fe6f4b6523fa  crypto/rsa/rsa_sign.c
-5ded8ea2bfd59110420f865699a2036e59ea5d2c547d02d751b20aa415fb3050  crypto/rsa/rsa_sp800_56b_check.c
-dc0af42319118811e1fa250f1647634f510f9ffcd720ea5141db4fd090938c46  crypto/rsa/rsa_sp800_56b_gen.c
+94015adec5a97f80a45dbeffcb4af9fb7edd4f2d8991a7cb6b162c9214d1a60d  crypto/rsa/rsa_sp800_56b_check.c
+05a1b9e1ab8b456d6b1ee35dd28a535e3bfa00ae23b87ffe5ba62109a391e670  crypto/rsa/rsa_sp800_56b_gen.c
 1c1c2aeeb18bf1d69e8f134315b7e50d8f43d30eb1aa5bf42983eec9136a2fdc  crypto/rsa/rsa_x931.c
-7b9eaa3a6e4bf0412be6961b2135407a682904dd5ccc63ba2a5438b41e608765  crypto/s390xcap.c
-26a9a2a744a59f4071277b5f03f48897a5470ea6a76ea4494f68a8d05a096f65  crypto/s390xcpuid.pl
+72e25c2393a6d0901f50d145ca540cee71d74065fe3e8dd838ca415bf4f0dea6  crypto/s390xcap.c
+2aafd401b855308ba3b0279c89e41a91931ee69253d66c46b97a722bbe08f7e2  crypto/s390xcpuid.pl
 5208fa95788e28d0ce9a22a6199329bf235a203bc70c3bc4c5aa0ba1052d56ae  crypto/self_test_core.c
-8f31ece930473524b73fe7729a71cf925e8083ae8883c179d710c45ce748952a  crypto/sha/asm/keccak1600-armv4.pl
-94751245b4ef1fabb755e8fe53dd0bb26029900e97c4111e5d9a56458ccced98  crypto/sha/asm/keccak1600-armv8.pl
-12b7acce2fba0bc0e1ca07842ec84be6a022f141c86e077abb42c864af1d8d9c  crypto/sha/asm/keccak1600-avx2.pl
-faf0cccb685d5abc807e08db194f847c67b940da2fc3c235c210dc31d73a5334  crypto/sha/asm/keccak1600-avx512.pl
-be1e7dd9998e3f31cfa6e1b17bc198aeec584a8b76820e38f71d51b05f8a9f2a  crypto/sha/asm/keccak1600-avx512vl.pl
-33bdcc6f7668460c3bdf779633e43bfad62b937042a73acb007b462fc5b0a034  crypto/sha/asm/keccak1600-c64x.pl
-09fc831dd39bd90a701e9b16d9e9987cc215252a22e1e0355f5da6c495fca35a  crypto/sha/asm/keccak1600-mmx.pl
-6689c3adaa270bd88026ca686ce76b8aaa83a7cadf3954d84d3cf89c044cc958  crypto/sha/asm/keccak1600-ppc64.pl
-79dec13ccbee4a6758a22d92bfd5694565416219e48b6894dfb63c6b0029ae28  crypto/sha/asm/keccak1600-s390x.pl
-3fb93b9440f5c3008b5c876a8106acc5f8d38f1afedd79381f0befec7dd7d72b  crypto/sha/asm/keccak1600-x86_64.pl
-831b8b02ab25d78ba6300ce960d96c13439bfba5844e13061e19c4e25cbacc3d  crypto/sha/asm/keccak1600p8-ppc.pl
-131d338bc716d9b5d4c1d3e8de213aa621f7581f91ec0ee7e2e56a9a94f1822b  crypto/sha/asm/sha1-586.pl
-c96e87d4f5311cd73bbdf499acc03418588be12426d878e157dd67e0099e0219  crypto/sha/asm/sha1-alpha.pl
-695ef6f8041f37f4b39cb7099e9c7c3a29d6f823823df7333530d375f5f5e01b  crypto/sha/asm/sha1-armv4-large.pl
-cb32284af92d99d7046b99dd5bbd894d53531f7b99d351235a939c542680193b  crypto/sha/asm/sha1-armv8.pl
-11d332b4e058e9fa418d6633316d2e9f9bf520a08b2d933e877bdf38b2edefcf  crypto/sha/asm/sha1-c64xplus.pl
-32ff0e701a7b8f25bcfe8477b20795de54f536527bd87d3ce694fd9aaae356d4  crypto/sha/asm/sha1-ia64.pl
-9fdde42e62c5a5c0457316ac35e6f6f940061634ab1e44a1ef5cdbacb656d738  crypto/sha/asm/sha1-mb-x86_64.pl
-0f5c63cf09e950d1b488935ab3b5562e3e9d5cd1a563fb88a41e3dae90a35e6d  crypto/sha/asm/sha1-mips.pl
-b5ffd7b6dbb04c05de7efa2945adb67ea845e7e61a3bf163a532f7b6acdf4267  crypto/sha/asm/sha1-parisc.pl
-482cd23ca6ec38d6f62b90c68f9f20643579c50f2c0fbb0dab1c10a0e35efe77  crypto/sha/asm/sha1-ppc.pl
-28cf69efd53d7a5a8c32e0f8db32c193f41b91faf44f5f59944334bc3f5aa337  crypto/sha/asm/sha1-s390x.pl
-7fd355b412ddfa1c510e0ba3284f75b1c0d621b6db2ecb1d2a935d5cdb706628  crypto/sha/asm/sha1-sparcv9.pl
-24554e68b0e7b7db7b635ff149549015f623ca0bcd9ae90439586a2076f6ae80  crypto/sha/asm/sha1-sparcv9a.pl
-74d197cdd72400cabbff7e173f72c8976723081508b095dc995e8cd1abf3daa6  crypto/sha/asm/sha1-thumb.pl
-a579c0ab82151f8879bac23ef1ffb198dfbf9b02d2015c500a232baafc6a3722  crypto/sha/asm/sha1-x86_64.pl
-494390ee974a00a0bfdb0ee46116efa45379b5e63988c0a3be9ff6183be2359d  crypto/sha/asm/sha256-586.pl
-0f01f7b5b0699f1e8ca260439d009febfa5b85b9e7b0933d236467e383aaaa2e  crypto/sha/asm/sha256-armv4.pl
-93ddc97651ee3e779144a3c6b3e46a1bc4aa81e75cd7b9df068a2aef8743d25f  crypto/sha/asm/sha256-c64xplus.pl
-478035fb599566f468f68ae9a3c5311b1e9c6257de6c47a7a32082c8aee41c8d  crypto/sha/asm/sha256-mb-x86_64.pl
-b14670492f24cd0d2fedf8780e981b7da123203395c085334d4571b619b0a610  crypto/sha/asm/sha256-riscv64-zvkb-zvknha_or_zvknhb.pl
-dd82e1311703abb019975fc7b61fb87d67e1ed916dddd065aced051e851114b9  crypto/sha/asm/sha512-586.pl
-16e68ac669860c5bf8e4db81cd3d64fc2c22168e129c2597e94b0f56fafcdfa8  crypto/sha/asm/sha512-armv4.pl
-c5c34b4633ce01517188f7179821e1bf50faf9c7d7255d34ab7c066b20920eb6  crypto/sha/asm/sha512-armv8.pl
-6f548a088feae3b6faa179653ba449df9d3f5cda1e0561e5b5f120b32274d1eb  crypto/sha/asm/sha512-c64xplus.pl
-9fa54fbc34fd881f4b344374b9b4f8fb15b641424be7af9a31c71af89ae5d577  crypto/sha/asm/sha512-ia64.pl
-fb06844e7c3b014a58dccc8ec6020c71843cfdc5be08288bc7d204f0a840c474  crypto/sha/asm/sha512-mips.pl
-11548f06d213947104a80898e000218ec0d6ff3f6913f6582de498476482ce9f  crypto/sha/asm/sha512-parisc.pl
-7c0c490ce6bb11a228853aecad5e164ce84e5bdabb8a6658ae7184782076c7d3  crypto/sha/asm/sha512-ppc.pl
-07804b96dda856cffaef291641c4ae7f59288ed1e65e38823cfdcb74f8ac5295  crypto/sha/asm/sha512-riscv64-zvkb-zvknhb.pl
-38e0455fd6a2b93a7a5385379ca92bc6526585ca1eb4af365fac4c78f7285c72  crypto/sha/asm/sha512-s390x.pl
-0611845c52091b0208dd41f22ddef9dd1e68d3d92fa4c4360738b840a6314de6  crypto/sha/asm/sha512-sparcv9.pl
-14b563ed790d9bd76b0f45e27b75b5fa46d393d7bea8704d2894004adc3f4ac6  crypto/sha/asm/sha512-x86_64.pl
-8725cabb8d695c576619f19283b034074a3fa0f1c0be952a9dbe9793be15b907  crypto/sha/asm/sha512p8-ppc.pl
+3e5ee4eb747472c88551edd6a48eb7b4330a4fc452eea263ad8aa4255df0000c  crypto/sha/asm/keccak1600-armv4.pl
+87ef49f2f47357c1f0912b22eca1305641a5873a4d959379140e92a7432832b1  crypto/sha/asm/keccak1600-armv8.pl
+7c27d9c9da79214ccecb240629019f4e2debdba27210f5170a6f3a3857bbe94c  crypto/sha/asm/keccak1600-avx2.pl
+143130638124b6d07f3bc4f8677a286db31d524a71625152629eb1f9bd434a53  crypto/sha/asm/keccak1600-avx512.pl
+b7f1f4e69d41812dba39226aea0942fb2e3a638308c3130b0c83bb636a258ce6  crypto/sha/asm/keccak1600-avx512vl.pl
+18e5996c0a32335587b2f06bc0c6071acd2c1f9e94d9ea284d02dcffc7879dcb  crypto/sha/asm/keccak1600-c64x.pl
+2395b8b2e66dcfe8edcb402275000f6e0b2ef360f702c9af6b9bc94d7f1dc159  crypto/sha/asm/keccak1600-mmx.pl
+520154ccd4914696da01fa63c0edc814ae31ad3d61dc8923fea4dd87d8ba776b  crypto/sha/asm/keccak1600-ppc64.pl
+ad95e092dcd69411209499c47b53569c9b38e92747a052bcff927fbef603eb6a  crypto/sha/asm/keccak1600-s390x.pl
+e485942ed7f7bf1f376059ed2e5e194907348f44a4308dfc4bbc2d8be05fed99  crypto/sha/asm/keccak1600-x86_64.pl
+af173b53537e18453705a3843e0629334b37e8ca03483a2b164fd48252289da3  crypto/sha/asm/keccak1600p8-ppc.pl
+02a7f0608e8c9257f6136bbe1ec7db0869669d6185a9dab92ee7a491b57025a4  crypto/sha/asm/keccak1600x4-avx512vl.pl
+88fcd1affd6248cecced55943233123e83200724bdb4375dc50db9c7c8d10c58  crypto/sha/asm/sha1-586.pl
+58378cb694b61022d70956ab344331d7577f9a26431acd00a60bed91229b29eb  crypto/sha/asm/sha1-alpha.pl
+8576b406e8596c8ac56a351a92175accfcf4121dd3dbffc59bae7d0ece0b0dab  crypto/sha/asm/sha1-armv4-large.pl
+45e94fb91cc4b4a620bc6f7e1f402d2d2ec174f0e95052b7aee903e8ae43cbd5  crypto/sha/asm/sha1-armv8.pl
+790680438c562a88df6c6f57414f61e2f1de696aae564c82e6ff833bd5a6d7b3  crypto/sha/asm/sha1-c64xplus.pl
+9e898aa25b009746ae1b6d59bd3bb250e845b96c0c2c0de47262f36e3bdb8030  crypto/sha/asm/sha1-ia64.pl
+d5b48f5c7b7c0df9021647db197afb84429ac50cbf7910b24eae823492e574bd  crypto/sha/asm/sha1-mb-x86_64.pl
+bac612ad4f4468d37029e28668226145bc91b0ea5de0c01fe01a7699d3b155c1  crypto/sha/asm/sha1-mips.pl
+c7ab165675d451820ebb0779eb127ec7e1292019d067ac9695688097156a6c5d  crypto/sha/asm/sha1-parisc.pl
+901ba1ccd75ae6cfdc8332ff2365540a652a214317be28178e6a9791dfdfdb0d  crypto/sha/asm/sha1-ppc.pl
+94bdf0d13c27f5e0fb326903bef2a98569a884b7e5f5d51e55854276c91105ad  crypto/sha/asm/sha1-s390x.pl
+68db366f13e563ee846b44803a83e47e5909f77ffa75d12ae75daf6c19250219  crypto/sha/asm/sha1-sparcv9.pl
+13276a3511fc0ff4ca0ae0f2c9bd8823f95ed88ac336528ba112329d845a1e29  crypto/sha/asm/sha1-sparcv9a.pl
+2f22676d49707cedff20a3a3cff21934b93da164ff2849c5eeff1caf85672bdb  crypto/sha/asm/sha1-thumb.pl
+ba6dfa91be6e69d9947c4618ca72aa7de3a1ecbc565f806c98ec66e2087f50a1  crypto/sha/asm/sha1-x86_64.pl
+7274c02e3a418c354afeb447bd565c7d2fcef8db60fadfd5a336d196c9830561  crypto/sha/asm/sha256-586.pl
+0863e4bc9abcff3ddb85366b85aeb96a0ed55f4cedb3d02ccbbf01f670e553ea  crypto/sha/asm/sha256-armv4.pl
+6b8967b077d436936ed35edff401f3849a0ee9584d72eaa0fa5b14b838584827  crypto/sha/asm/sha256-c64xplus.pl
+70a60ee1dd87d63def18ce29e852371815d8160504d12cff56bd7d1c05ef7cbd  crypto/sha/asm/sha256-loongarch64.pl
+8773c5700e10457f777d50cbb000740e7d2ab92e3409117d897531c46c70fb18  crypto/sha/asm/sha256-mb-x86_64.pl
+60685aa8bc36b84bcfcfce6cd1032f5dba5b6842aaad5aca22e7d1280b70fc04  crypto/sha/asm/sha256-riscv64-zbb.pl
+8bd86c98b6ca967d351582bad71f0a6586f7e084ed337c78c6e7d7d927fdf078  crypto/sha/asm/sha256-riscv64-zvkb-zvknha_or_zvknhb.pl
+6023a473eafb92cd4bc0584d0e85f92c2bf57b4cde6cc2f6d2a930e3955d7d7d  crypto/sha/asm/sha512-586.pl
+59aa9c3ad147278a541672a6edd9826fb4b91a859e4dfaad1a07f534a12c1f9e  crypto/sha/asm/sha512-armv4.pl
+2ebb034955ff154a8432c5c21d414bb9781232559eddd14edcc135ad72e712e4  crypto/sha/asm/sha512-armv8.pl
+b620385bb40853156a1a0e4ad1169eb45c66583c7fb045c818d388f54e5a2b20  crypto/sha/asm/sha512-c64xplus.pl
+feb4283e1bb2a36f0a98d4cd7b43ac78c40b72efeab8d58b4f0aad8b65a1d2ba  crypto/sha/asm/sha512-ia64.pl
+03302cb8fd3d580ae9dbad2eb65fd6d542893a86e481caef2286d42fbcd0b5fc  crypto/sha/asm/sha512-loongarch64.pl
+25c2bbaf0da5fe56c663ff7b926cf3284a2845df9911172316a8384e15ab7ef5  crypto/sha/asm/sha512-mips.pl
+3b9ba893f84e56bd26e40907ad178884aa61ee529133691d87b7746c9ad13ed3  crypto/sha/asm/sha512-parisc.pl
+952ef1b10e8bbe3f638cc798b91ab9c5b47b66ed8fe94647b1beec9874f2e71e  crypto/sha/asm/sha512-ppc.pl
+5db1dd8fdf9245e320e2e56e555ee75f56fc7f49e102fecfb82285bb525aa491  crypto/sha/asm/sha512-riscv64-zbb.pl
+901cc96f156549f4ecca65d0315aa7d1c2c108f911aef3c4884cbaebbac2bc08  crypto/sha/asm/sha512-riscv64-zvkb-zvknhb.pl
+648db5b748d07367579dd60cb551526081fd45c5dfaac989c5b1496d8af631e9  crypto/sha/asm/sha512-s390x.pl
+58ed1513cd35553f83424bb0441a77af0efd467165a190b91990b124ecdb9b84  crypto/sha/asm/sha512-sparcv9.pl
+15d484a736f2cc259eb1207513d6f7c1236b7789bcfb94cf6a1e4d2f8c2d0dc5  crypto/sha/asm/sha512-x86_64.pl
+16ecc37bb09a47ad590fe8d8bbb4c9f583812348464bc83e1eaf117a05f50fec  crypto/sha/asm/sha512p8-ppc.pl
 93858e3b530333a129127b8df8cd3326cf55b770238b4fff2474c4e6e3def1dd  crypto/sha/keccak1600.c
 306cacd3f86e5cacaca74c58ef862516515e5c0cafaff48636d537fd84f1c2fb  crypto/sha/sha1dgst.c
-c7adfc319bcd667608b7cf94d386b57b8d84dac510107c445213d008a219bac3  crypto/sha/sha256.c
-ee90d100405c4d08284e2f72525d523424a4c62b91aa0f8fea8e88ae71582c81  crypto/sha/sha3.c
-a7e074a2f2cea0c33e7875eacc8adb465b5802e4c1d100cda79ac3dd52cdb453  crypto/sha/sha512.c
-61ab6d7d7da9e65120ec59cfa9f5ede785502ae371696c3e4e04e039743ca111  crypto/sha/sha_local.h
+977a5eec2260fb431c4f0f2342510b754099c981e7a0a71fe8ad44b61812561f  crypto/sha/sha256.c
+28aa674a4132986ee1897c136da6da2c80ae79fc87b01ce652f3e449bad11adf  crypto/sha/sha3.c
+db0f16a4cb9c86f971b4defbee9dccd77345766f64efc45e0f1bc8d448bfb3e3  crypto/sha/sha3_encode.c
+a11b8ddd91272bfa7c16b44e7245c46bc64d3fa69189f10d090b2e7e9c5f9199  crypto/sha/sha3_x4_avx512vl.c
+e6ec6fa358faecd55e8f34896836027cddfa9817434dc82fb2d15fab4679b2b4  crypto/sha/sha512.c
+c23f344a1a288741e76c4280f24999a8f83fed4b3f721c9c5e3f803829709e95  crypto/sha/sha_local.h
 dfd99e02830973ab349409ac6ba0ee901ba7736216030965bd7e5a54356abd7c  crypto/slh_dsa/slh_adrs.c
-c9b270de1259d9fa71a4d352786357bcf1dd3d22075edab84501e2f8e550b271  crypto/slh_dsa/slh_adrs.h
+247a37a0a6763fd2472e01d27c9162d0821bf5787719ca10a2774f9a643e8392  crypto/slh_dsa/slh_adrs.h
 26566d0e641456101bd17338dbbb16f59dfacd34f76cff5882133a0ab7323130  crypto/slh_dsa/slh_dsa.c
-6b88a8ca514dd2ead7808bf08ea7c7e89125cdcfae8f0db4f3518069382fdfa0  crypto/slh_dsa/slh_dsa_hash_ctx.c
-924e686178fdc5984d1a09b02d91e04d4b9c4eb818ee384107ca64357c237e39  crypto/slh_dsa/slh_dsa_key.c
-4c7981f7db69025f52495c549fb3b3a76be62b9e13072c3f3b7f1dedeaf8cc91  crypto/slh_dsa/slh_dsa_key.h
-f8007c0f93908810f138f872809cd49013e22192907f4c38d290b6c4566230f5  crypto/slh_dsa/slh_dsa_local.h
+af39e0ae447d88ec8fa16dc3b05588d68527540d96821ac6d6f1c1ac368ea72b  crypto/slh_dsa/slh_dsa_hash_ctx.c
+3e2f65a316bf8b13319c9f2ea911feb55eba973f8a171c1702f1ba426774dd76  crypto/slh_dsa/slh_dsa_key.c
+8c12c3b167708727ad3ecf33cb854870106512a2d5c2ce4846f9ed0cf7c999c8  crypto/slh_dsa/slh_dsa_key.h
+2fd9f207756ada903e54d7b6bdad8ce53215e6f985b2a98572e5d843f270c269  crypto/slh_dsa/slh_dsa_local.h
 6d3f3c0be706c1dd871db863f2344f709a2b7fbb60a0d91298aeb2222f767a87  crypto/slh_dsa/slh_fors.c
-f6f5286c6ce9f37cbb527144ec09fd86ae796ac3e71f0bdbb45b5a08a0692122  crypto/slh_dsa/slh_hash.c
-3af167addbfd97f831f2a1981133bf4e2b62b95dc9477767797f7e4a653556db  crypto/slh_dsa/slh_hash.h
+0b30525e0c5436dbf120f133522dc767d86d546530e6456e97aa322ad1ed3f79  crypto/slh_dsa/slh_hash.c
+2eddb199ee2e08d9d1929de29adb91a92eed04dd51b61d055ef8d19e03a28b5e  crypto/slh_dsa/slh_hash.h
 1eebf59ebd0859be5a8deddd2f664f99158060904234532af608a44dd6d92d19  crypto/slh_dsa/slh_hypertree.c
 1ce9b4f4f90a6f82005c9cdc0ea1f6b6876556c76f8bfd95f4c003a1c195a266  crypto/slh_dsa/slh_params.c
-86b16a2c36d708cb880ba49648bb3051c2997188c8ea6aec9292534b97232c7f  crypto/slh_dsa/slh_params.h
-668a2431034f8c604970ed531e32b7b20b6b710e258d1db0a8eb06a13d900f0e  crypto/slh_dsa/slh_wots.c
+fd3ec58cfd1a5b9473dad3cc8061376c0fca5a87bc917bd44123bd960227703d  crypto/slh_dsa/slh_params.h
+9730bc92de7d84035899f6bd146e235d2239a85266d98c4ffa59ec57646f2aaf  crypto/slh_dsa/slh_wots.c
 37fff5f88dd8bcd0ad8cdbab130c5a9a018422fe59b141bdb11bcee8fd1b046f  crypto/slh_dsa/slh_xmss.c
-9ef5a01caccc2eb15f72e367d0424737040ac8018479bbbbce3d216c655765c2  crypto/sparccpuid.S
-b462d1efe0acd798e1ec5f37fd1c824a587e1773e6a6f984d5a332581573ecbc  crypto/sparcv9cap.c
-9e16e8641ac5ec2cb2fcc8e4796af5b698d6fa4ce85e374bd8f5b4edb51e6428  crypto/sparse_array.c
-7eb112f9e86bf53f4382b77464591100cc67d44da90b793ea461c6e9500ca8c8  crypto/stack/stack.c
+567e7a1c118691b36c2484bbcd32d1b7ffd47add996eeb35b3ad0e7810c21161  crypto/sparccpuid.S
+11dc0907c256e37a0da3075906e6868e1dc3a0d0dd612a39a281e40dad75dedc  crypto/sparcv9cap.c
+51b5a944b67582044afc852e2d16135f382835c3b519271f820878a933ebe348  crypto/sparse_array.c
+32c5f00b33508ecf709f0b8b9979af7d7958db12ebbf948c00d96bf23d74317a  crypto/stack/stack.c
 c0c4fd0f112465c6766072e25268c2f9019430e2c08c3c0a4271603d24d79f04  crypto/thread/api.c
 e298c753be277ad9a2ac0132d9897cb4c85607dbb2d11cfefd0c98e0f6a723d9  crypto/thread/arch.c
 5c02ff77d290ca0deb19672c1ed6fc0f47a0d630f61398a204a2684a7d418f0a  crypto/thread/arch/thread_none.c
 cb214ad206ea69ab98d24a727a47d3a4c614fce709e6b7fe6997dbaeed92f0fc  crypto/thread/arch/thread_posix.c
-f06b08138d73b834471abc4a3ba43b2be838f7196c937c3e933694d6cd69f74d  crypto/thread/arch/thread_win.c
+619d77aa1275cb3eb3db63ecd3bfa225ab3bc97f38ff0b2f0b9024f60f3544c9  crypto/thread/arch/thread_win.c
 55953eb5a84d03e8d915ee867ddf8ec8be8c5eb444ea0b21b12a040a57e2c2c1  crypto/thread/internal.c
+e48a9d83c64bd31842437e25d4b3d315701e9e5a4d10862412f17f2103889c6e  crypto/threads_common.c
 2e5955d706b96c487e4875ffbe208fac15bdca06b33cee916d5343978c14efa1  crypto/threads_lib.c
-b3743dfd1c13fe70dc57a5a0b2ec540ab3afa748699eb6ef36f56f4d36d06ef3  crypto/threads_none.c
-7b97b0f57f6b7cac89c1b8bd03bee34fb39d33cfae1632e75571ba106a5b9442  crypto/threads_pthread.c
-a4692ad34bd148e06344672e08a3ba928719ca5af4d11ba54d97926759dcda0b  crypto/threads_win.c
+8ce87fc586d2665d6d53c601cb22f656558a4caadfa7b6088fb689d59a91a114  crypto/threads_none.c
+33441fef79bbfc8264312d0d203c001aa7260cc7163c116057db62a6a491ae27  crypto/threads_pthread.c
+eb77c301a6ad0cd02462a9a3c97af422783fdbd985af56a587dbc96c4d414fa1  crypto/threads_win.c
 93f8fe09f96492a6be6772ddbf0cc37912fc2a90acb7faea378da1735fe20f6f  crypto/time.c
-88c5f9f4d2611223d283ebd2ae10ae5ecbb9972d00f747d93fcb74b62641e3f9  crypto/x86_64cpuid.pl
-085d9fe93adf232f1ff838be9235046c2c2abe2daeb0e6342921d8f2e955dc18  crypto/x86cpuid.pl
-6486afb23846d3c11c3a655e7e6cae24f8cdaf5dd4d6a887b5a04c53f52895b0  include/crypto/aes_platform.h
-8b68c7b69b8da6e729789dbd99d45c341458786e2bc0e2c6c6a341e6792d6b10  include/crypto/asn1.h
+d47f1900229a1e595e5e48cabce554075718c5ac9d9d1b083012913b9ea36732  crypto/x86_64cpuid.pl
+980c86ea30dabb27f318ac3bf7441155caca85530e5c9688f82c3ca153e26cda  crypto/x86cpuid.pl
+c4dd8a542ebba1ae20cee48e5ff20a4ddf68ee46be439b90f1e0709f825cf487  include/crypto/aes_platform.h
+e92402ab6c4f2700b9db83759bc2f78b6f64bd246148990c15aef44cfebfa50b  include/crypto/asn1.h
 9acd69adc80fbf9fa88fed4bcc7b3c0ba87e2add98d7ba311d8b092a2d5a0d2c  include/crypto/asn1_dsa.h
-6bde5251ab151b60da8d420536a17c214b38bd19f2bc37f0d924b3af4b8dfc22  include/crypto/bn.h
-ef5ff8ad445370d0c8ef519bb791265bc09eead2ed0a086e1ec06bb7ed846b38  include/crypto/bn_conf.h.in
-7a43a4898fcc8446065e6c99249bcc14e475716e8c1d40d50408c0ab179520e6  include/crypto/bn_dh.h
-f63ce4d5b80d0927cddd2e0e2d791b96ffa3cc9ef00a4f3ab921ff50ca6bcf50  include/crypto/cmac.h
-66d6f120bef9ff1bb33867a1071a315528a616c0ae0c64fa88d70710cccb8b5b  include/crypto/context.h
+96739aec157cb0ed9c5da18c6e9f9805bf1b109d4e971a82c860f137687a2d0b  include/crypto/bn.h
+2f4961d93df8332e58e0500925c7c35dccd179f46b389e3258ec712222297151  include/crypto/bn_dh.h
+8ca9d3c460dfcc437cf99b9412208a555d2dbdc01081c327765729c94ac133c1  include/crypto/cmac.h
+348ef240d54ee43d95e40936c571b218f27fb5a7ba21369dbeed7a29c571ba03  include/crypto/context.h
 273da25316489e04e5dd0675a5e8baf2f9e51080de06bfcd85b29ebbbd7c063d  include/crypto/cryptlib.h
 8a55e7d62cd241e1f37e48ebc0deee22ed793ccfe094c46138a41d856f26e015  include/crypto/ctype.h
-fb109231b7f7fc2e83dd39ec6ef14d88f6ee60cc91ef1efd0c49fa7eeaa50ace  include/crypto/decoder.h
-96632debc11dad16535e48708a3d89df7c2c0cef9843e4bee271071bcd3d15d9  include/crypto/des_platform.h
-9645e766f7536a94ff83136a5023a7f65cc2e99ba4a77a07a812060fc09136ea  include/crypto/dh.h
-df517a9f3b7633667d40b63a17a51e41f9d98633fc1f7b26530198cf41945f11  include/crypto/dsa.h
-2a146319aa6f2788d0c072fcf197b23fd394910a11366df34c1dc4fa2d896e0f  include/crypto/ec.h
-8ab1f61c74e53ae4a99170a2ee64951f16eaf9da54fecaa6e0580381e5ddb89d  include/crypto/ecx.h
-7efa69a026d7f019e0106bc7c9cd393e0a0e161c4fb99108956db428d25780fa  include/crypto/evp.h
+2bf927a09b5a409aa2ddf8390500f549b425ff4a0c4bc24c9520cd38295cc5f5  include/crypto/decoder.h
+60fae5119740085488c0c96efdc278b17915c29f04cc5ffd7503b288ec9030e0  include/crypto/des_platform.h
+1f94e0ce9b3e4b3bf80e8777261d22fe6d5bbecfc79fb3be805daba738b7551a  include/crypto/dh.h
+07da49c53dab98e3a50b3d8a21953227ead3aedae570c80584b9c2ce5988d20b  include/crypto/dsa.h
+c88b1ecda000ed04f1384fe9656d9daf6ce0ad6f6bdaeaff5975318e66f5eaed  include/crypto/ec.h
+1358210d72d55cf7f5a10049e8c2cb704a3a4825f51067ca1b67ef1173492270  include/crypto/ec_params.h.in
+8eef8896afdccc8c90c548e0d11b290c004df3231a1777e8205b88c04645c4b5  include/crypto/ecx.h
+356c020bb43ef9cc74196ba5202b6ba27a556c5c1634d813934acab81776c874  include/crypto/evp.h
 fc22d8a6d80875c8c45c51a449069b936eadb9621aa9c0bcc8c5d493eed1e52c  include/crypto/lhash.h
-394bf7158529c28dfbd0487fa34de70b9252677b5e3e34c98ddc33a250218642  include/crypto/md32_common.h
-44c2fc3942f4b6737a8b666c22da39fb594762d72d2227b6dd87dba49514c358  include/crypto/ml_dsa.h
-d95678b387fab70450767cabe6415392f09a4c6412181d17e908c73724fc0275  include/crypto/ml_kem.h
-b7a00f7e37fb4054d371438f270e67eb584eacb9b13fe29536dac90e8371436d  include/crypto/modes.h
-3940520e7cb800ab573f60c6c0ecfc431436969ebddcbf0fba1a0fec91d9785a  include/crypto/rand.h
+ab213f48a42742b4c206e90c3b25a73a9de2911b8f5e0b0a3b1ef2429abebd61  include/crypto/md32_common.inc
+47a92e596adaf252ed86d3c363e1b7d1893445aaef302eb50cf18473c3c08541  include/crypto/ml_dsa.h
+60b558f2990b9f390dee864dbd15372a98dc2dd95c4701c088a5a804198e7421  include/crypto/ml_kem.h
+10bfb1eb1af9617d47b6a6575249d01123c64523022b0dd07a22a82d9390eb97  include/crypto/modes.h
+7a873c39719cc5a2c5f03fb5652e1acb72c76147eacfbb8c6e393de985726484  include/crypto/rand.h
 b4fc407f0ed2c4a1795bcdbef3ccdc68be327ae40bd401fcb1066df0a63bda7b  include/crypto/rand_pool.h
-fd4a274688b694aaf010235e6ffd3fd1afd87bc5cee9cae1e4e8be69bf96a5cf  include/crypto/rsa.h
-3f28391ed526d791a578e76a40961592e15ae2bf62b81d5924525e1f21684659  include/crypto/security_bits.h
-70b36014254ca6cbe4126573ea6a71069cc278a6ceaa36412343f19b204c4c13  include/crypto/sha.h
-127ede705ecfa8ec504e57cdee1210c5d7a9044121ff05d1dcf72955958346ed  include/crypto/slh_dsa.h
-688facd89683d1df2428ba08b22128a4fcbf93c844570518a4764146af87a231  include/crypto/sparse_array.h
+439cbdd09695d1c55870c27a89ccad4e91f1852ff8f8b2914e5e3f5b7414c2a4  include/crypto/rsa.h
+e0333468855777f69f0dc54d5c98a8c37da4ce7c469b486e2810d2c2af916790  include/crypto/rsa_params.h.in
+0f42d85c523845a1baeeb68534a088435bb32c9c49fd6058ad2c9bbd3566c232  include/crypto/security_bits.h
+95904882055bb9a1732c38b99ec45a2895d41e6009ab952e36264bef5389ba45  include/crypto/sha.h
+169800966e382419cdcb30265fe786708f9b9ccc4fbb1b8c17641a7fbf4cb369  include/crypto/slh_dsa.h
+829d4a2b037f97eb7af18c4af12b69cdc05da78f069c244610300edb9c1500ba  include/crypto/sparse_array.h
 eb1f4f50bafdd357aa15b54f60f5ecde10876253038f00bf518fbf60840addc1  include/crypto/types.h
-fd5e610fe38804f5de05931706b8efc717663a892f74aa6aee30301ff5e31a25  include/internal/bio.h
-d32565e2b426131dc2415e60a97c94570ca982d29ddd97d2e23d6b9f73b1d81c  include/internal/common.h
-8aa995b12b9fa877110526d5861a7c3403b95aa9d6338e7c3556c54882bad73b  include/internal/constant_time.h
-5170643b2ca16e894d94c9e9fcf8bd80843de0b6539b31b14bf0e4dcaff3f2a9  include/internal/core.h
-4295b7a3f366f5500cee45b0716fded3d9895b9efe6b8b6090efc5be000450d4  include/internal/cryptlib.h
+8901a5cd447c85fc4703203732cd1e9b5abec3057dc6e81d42a723ddaf141a54  include/internal/bio.h
+77f0ae1270615845f9c7c882c0bdafe6cfd78222195b8f4b07530bd15a7ded3e  include/internal/common.h
+9d5b2446c6079b16a978fa7ea7331b86c196958a14282bec87ae2fb0f4314310  include/internal/conf.h
+7428e90224e06ec45ed9637cffad5997e668da0e0b7b00842bc968375b5f87f6  include/internal/constant_time.h
+3042ba0527a0925e01c3ccdc9f451d73e3774dc1113baaecfc16532dcfb01648  include/internal/core.h
+911d7522863ab8c2259e708386e4d208b7a8a1b5b44ce6fcff08c05c5b604c45  include/internal/cryptlib.h
 cd215e01800987b008be87ccf85823fc98be0c578262a7720cbb6e9ac3dd81fa  include/internal/deprecated.h
 178940dc972f22a8a481a16fd63a86e7468e88cbaa1db5fd68c2b1ae64cb6865  include/internal/der.h
 0dba4a6565caebfef82a8dc90d6ba208b2c61445123724769d5ee84ebbb0a610  include/internal/deterministic_nonce.h
 984b04ad2f0a2036fa157099c3b1ed5300c079a665c8d26d3451eefd06fc1e25  include/internal/dso.h
-e5fcc33def2500935c7706ab8dc1b5d44a4a4135ec8135b9bde55f4d8a4c191a  include/internal/dsoerr.h
-a8fe7b60008099c0efcc5f2ca214c68e91efe8e60f2c99fd89553101cb469b40  include/internal/e_os.h
-4c6d7d437065e39b8609d10aee66855a7820b25569fa06477ec5db818cd2d406  include/internal/e_winsock.h
+beb309cb070ffb3c3c6a39d973f5b0c433a6269f3e720285a777d62731f2521b  include/internal/e_os.h
+998d9abd4b6a542b7f419fbe451495c6f798b3a8be24a24d2009a09eba5d5601  include/internal/e_winsock.h
 f799af7ba63ccbe14c468625c4bf3669cb9405825ffea57435eee7e7973f2fbe  include/internal/encoder.h
 b41a5d9a7bdf60df169e327b41f16489830b82393dd663d1f89f81da4483eaa7  include/internal/endian.h
-9bafa62442fdeda25b97fdbe8e8bf8ea62a5b5167adb2ac7ebbb13db271673f9  include/internal/ffc.h
-0a82ff0abab6ab815f9cb523b9643854346b47ff276f8868d1cbe48efc1b20ee  include/internal/fips.h
+18007208e049b62e62a416543c37c4b64f81ef6e00188ec0b2016f206e260a2f  include/internal/ffc.h
+357f4769dbe44383685576a644a4b3aefa3071b8b02c95efb8d3f64bf4f3054d  include/internal/fips.h
 923d4fb14a08f9b251b9bf9727bc50930d0279e8b63243faf85374bdcbbfc4e0  include/internal/hashfunc.h
-d76c942d91e97f8954852ec7ae5a790a591b44762bba31930af585ed5f861fe0  include/internal/hashtable.h
-f6f30785e3eced1ccdd4b149286ff2b8bbb860eb7e070cbe54c997aa022854da  include/internal/namemap.h
+99d94123b69d42b4d91342a07d2122cf4235e7744baad6a077f84b93d71cc285  include/internal/hashtable.h
+8bec24775cec004597d27718631a77902b3b764651b493884496d430eb401a91  include/internal/list.h
+e93523559408ad5ded0fc87ccbc43213f4dd449ad98c2df3d3b6116f2d3a217c  include/internal/mem_alloc_utils.h
+3fd1c5ab0038214039112e1f74f30e572fe9db13a120dcdaddce34950dd90290  include/internal/namemap.h
 c367e6120d26a2b629f4db7e179973e33fb095e1102d5c7a69c744b88ebe4469  include/internal/nelem.h
-eef3ec603b9877bd24a8fa1dbcd7752618fa74943b045515720bb0ca61394ae5  include/internal/numbers.h
-12428b2682bf2bfedb10e351a5201d32e02d1e89e7287f5e86b7bfbecd89a983  include/internal/packet.h
-52686e2cd1049e7b0cd6c6a4085952bb83a04823215c42b1b8e6da19b2511d83  include/internal/param_build_set.h
-5c6c98b1a642b999c909c7cfb91e7925422fbd0b9eca56210ea745bc20668783  include/internal/param_names.h.in
-46d7980258a8d11353af3e3dab87c368eec054e46ac8a0facec68b23ba94d91b  include/internal/params.h
+f95b3f0ef8a5c47b8be185f4f4ec3baaa6304ed3f7a608fa3aec3c99af0e10d6  include/internal/numbers.h
+2d851ff441c835518d6a4328c614a7d1d49bbaf88fb57b7a41312006bb164e68  include/internal/packet.h
+677319c4ee2abaa8752a1a60e6002eb54bd2cbb8601e4227ff1b75ee2a6c837e  include/internal/param_build_set.h
+84b4977424564d536834bea5a913173ba55d7cb280e28ad01cb24d8a96dee53d  include/internal/params.h
 ee75ecd35b3ae90c51ace957ab7ce06de3c7d5064b97a878241ff65cc943a6db  include/internal/property.h
-7aeac9a78efb9ea5147f639cd474e6c2538acc1b9d255ba19dc661fe22bcd94d  include/internal/propertyerr.h
 5b108c19f064ec47fffe1b3fe310d4693b6db3920b8cc2e5dc05595751ab0f3b  include/internal/provider.h
-097ff0f3c25c99df484ec9defca0834fcbdab81ee7e4f40ddc64b95e845dc794  include/internal/rcu.h
-524dc86da257175bc489d80d3ff9b57ea2e74cd0548f6575e2543a1344c9639e  include/internal/refcount.h
+0a16bdf16ba4e75f70535ffbd3e27acd9df32b2c9ef30af901e5a112b9e8649f  include/internal/rcu.h
+a95f2eb512e23f9628dec78ac17d4e6ef67714fc6206bbf1b12243b6e13bc565  include/internal/refcount.h
 f77c0844cc44bd92965647cd8cb6addb210f0300a8d1090da8c26e4382e87c2c  include/internal/safe_math.h
-7d5f4c3db807f108096590f28dd1ae92c05b2af25f827309157e727abb783e7a  include/internal/sha3.h
+17f6585bc81ad324d00aaacd558e0176dbe22cc7cbdb353c8c9072fa40000a58  include/internal/sha3.h
 8e672cc0620606b044f63b8446125f5233d64e3eea59df54c1fcca6bc90ba537  include/internal/sizes.h
-188be736ff23a2202fe594e6d49a7ccf4c23a7baa86e2dac5d58360f21d9c986  include/internal/skey.h
-abf03dc8635f2925bdc2299feabe115f8d5d6eaa450b421172ded222872386ba  include/internal/ssl3_cbc.h
+6b1d59c45ed2bd1b049796e67c4d08309fa25914741bf7ac72e3e41447e27916  include/internal/skey.h
+13f5026187ffd14e25b07c7599cef394056816f4a396d0ed0d2da1b5a67e775e  include/internal/ssl3_cbc.h
 780bf5e9a5852e8776a3b9984993a91f27f3f7b1501e1b2185f5a8f448b0d848  include/internal/symhacks.h
 fb5bdada32614d7214569dc111b8bbc43592886799f0536b844a64a2541727cb  include/internal/thread.h
-a8fa7ddc1e54ca296bda9ee05a7a39bb7e803eb0567cc75a9b949b80cada7552  include/internal/thread_arch.h
+0b643d952f420db92958ba36651efcc48af3569c297efe6c66b31970fc686e44  include/internal/thread_arch.h
 1cc86957e734ce34acd949b9e9e9d588a6c82afb68a09c787fb69f5e4cb20b1a  include/internal/thread_once.h
-07af0c702bf779720f6849dcc54b59235a5ac87513c77d6123aa334d71f5a7b3  include/internal/time.h
-2a4f456b95ae6c60a1bd7be966400f7aa12f791ece6f2d31a22acae6fd77c623  include/internal/tlsgroups.h
-79db205cd380711f09748b4ab020442050acaa0a8a940e2be38c4916e23dd1ff  include/internal/to_hex.h
-47c827eb0766d6aa82cec54648fc57b33a3dfec8539cab7bce161cf73455abaa  include/internal/tsan_assist.h
-0eea6c204f1b202ee75407a1f5fb2a13715169ec3c0fc675d9e2ea64d13f25dc  include/openssl/aes.h
-17136e1636365f445ffad27a1fa41aa5e148429d38538ee273034b38a72cc8ba  include/openssl/asn1.h.in
-0e28b492fc1f2da095ea42267480c9961a4f8cde3314e409f90395af8c65357e  include/openssl/asn1err.h
-77a9f9595cee6448c6217a8388127593a34a0d0a585197a5f8100fcb792f76ec  include/openssl/asn1t.h.in
-aebe1d2efd1f7667f3fe5552ec8d5e9bd3d5659fca7d201d47c58b41d1070be1  include/openssl/async.h
-92c66c0660117eef03d49e586625e47b3b35a35189c66ed2ec57aa71f14c4da1  include/openssl/asyncerr.h
-1af8a6c86dedb83887e9baae99ea7dba6576eeb6a991f62865b10d5efdd9d6fa  include/openssl/bio.h.in
-40491414172d977a4667589fa2f269d7deaae675555b8348d96f315d1a6253bb  include/openssl/bioerr.h
-bbf263e1e83951f12893f063fc7dd1e2c03773f109ee2262111b61b0a05fd696  include/openssl/bn.h
-c506c9bfbac7368335fb2a8a627755ce2b8547a251d885242a89c9f8ff3bf079  include/openssl/bnerr.h
+5b463bf92166e29e204b39d61e429519aa7e83dd6bcef8e14ec520972e2dc8bd  include/internal/threads_common.h
+e9f51092f519bcd826942a5310c05c9f943fd63a92c5d0053d49a2489531be33  include/internal/time.h
+2383f5a41e656e374ef76d32bbf85cfaac9f852608ab3f618f1da2d1f273c7a8  include/internal/tlsgroups.h
+b25e3644be98a7ec10dee5f62d5ee514fd352436184acd8c5428142aaecd89d9  include/internal/tlssigalgs.h
+302629396c89b383fa202d540458f8a156f4ff506e7d0a87d5128514d9e9e040  include/internal/to_hex.h
+411ae2d50baeb706c63bd276f9d35b6c2acbfa003061af517fe5977d2ae135aa  include/internal/tsan_assist.h
+2b9c5270ece34eb081176cf94f7a998725b7b53c70e9eb9bf8a4ccdec10c099f  include/internal/zeroization.h
+3e6bbff5295764bfee6fec91a8807e9fa345a7dcba70d55062df1a8d6f98758c  include/openssl/aes.h
+839f50fa340c8c3b041c7ac0ea071ef70ee32164dd80ac2741c77fe7e9df0e7f  include/openssl/asn1.h.in
+7b78d6a39e77c8f537968fd89cf8696e318170074e48ff5ee50ff4df6fd4a14a  include/openssl/asn1t.h.in
+619f726ec5b75fc83cbcc24ac7182d99d1ef70eda8dab1a1e41099501393d85b  include/openssl/bio.h.in
+ba17c035e356438090eb963766707b968e668022470e1669b8230d95aeae944a  include/openssl/bn.h
 c70499c9109b083beb69d1b17807266b041d0ff28694d5bc1ab7cf2a59331c39  include/openssl/buffer.h
-5bce6559638266f060eaa16b3b90738bbd5292d62230b6b3b1e22b88836a5030  include/openssl/buffererr.h
 2a83e38101abb3c2da0e07f9bf7012d8167a3c1588df65c36652c4f72aeafc27  include/openssl/byteorder.h
-3c38e3f1d500263b971b851b1c92b69a29252b44991e8afaaf3c36ceda1dd700  include/openssl/cmac.h
-a11471a2d9f47686ba4cc005f305000913a7a1af3efb324fa114b541cae012bb  include/openssl/comp.h.in
-759d8087b2861f806f510d22e0cb40e760170ed07176ec0568807e35cbd0de10  include/openssl/comperr.h
+0d499118db0c65974b768a048460a5ce2aa9b80154763856571fbfa6490703a6  include/openssl/cmac.h
+b5b67e56450ac882e39c1a82d46e446f46c747c7771d850f488261575c1df162  include/openssl/cms.h.in
 1cd9648cc536f25cff10656096ebb1d9353adf3ad855d1c25a22b142ec1705e0  include/openssl/conf.h.in
-3517c480b3211d384d4b36fa48d8dce8923fcccd99fefae68635b3f82eb0acb6  include/openssl/conferr.h
 4e195b6f7a734756e21c4269cc245b292e1a563aaec5644402929d0eac423c41  include/openssl/configuration.h.in
 f76830b31c947d86c2e6a302ab8df6b83076f8d29120bce9a58195551eb48e1a  include/openssl/conftypes.h
 a013fca5cc6b5cc26eb1c76eaeba31e99408e88fe89c343a44cc0b22f8e63eab  include/openssl/core.h
-8486d6f6818911651b0f3ba02366a362b0d4d988f014089a4f3a3f6ecca7926c  include/openssl/core_dispatch.h
-b47e5195bcf209e120858a2c671eaf0589fbd1baf1c5f69237ab94651772808a  include/openssl/core_names.h.in
-e623d4e8d36d7e0f0825fe5cb48e1176be19c0bedc5053fce488aa48602f351c  include/openssl/crypto.h.in
-128ef415305b704d51461ab98c688c69fde868acb5f5f74c92b2d0517823e71a  include/openssl/cryptoerr.h
-9a636172a3453f4e23b48198effdd92dee425c9359996b498e388a3d21d16dc5  include/openssl/cryptoerr_legacy.h
-b0e905aec1814217d0a67e3fefbea1dd309fda7c06f554277e0f2ab38ad0254d  include/openssl/ct.h.in
-3b37f5f3481829692b206d24791ba34ef0c54e19c54806beb1e8a0d3e0b877cd  include/openssl/cterr.h
+b374269dd2f45187e9aff9055df2de82829e783943a8e554359f8ac20ddc8f71  include/openssl/core_dispatch.h
+72acc617c93ee36ec7f4a279a8b32edd7bee68546c8a23f24351f32b1c2d6043  include/openssl/core_names.h.in
+5ae850f05cddf04205fe946bc226918430e68b2740c62b85ef13bc8dc3576602  include/openssl/crypto.h.in
+2e5b0109741b7d37a0d1a5c0c8ae9b9320bc9b0e71c3e05093d27f14f598295e  include/openssl/cryptoerr_legacy.h
 a147bf48583b902b3db0d30dd2a9565f1c9f3ec94dd57652e31be4c67b7d2593  include/openssl/decoder.h
-8d8a2f1286cf40264a80e090d377edaabfa4b040dc0e5314ac41406e0dcb0fdc  include/openssl/decodererr.h
 402c76d3a33378f6dad64778503581e4f80e2ec46ac24c84646234a06acac5dc  include/openssl/des.h
-f5c9ba84d4395938de063bcf9946ab73b41432f6e60e7c1a47f369b5d07041f8  include/openssl/dh.h
-5658c7f5cd57d74c7644c63c6328e80469fab9d3e29dd734f1433cf3019dd4ab  include/openssl/dherr.h
-5eff0626259806221a6dff0e6b50de3298444e3e82a2464cfe2ffce32f1c2f3d  include/openssl/dsa.h
-d526f8def9e4bb31ff85dbc9494e6b3fe1ab15f424a8e53b3b8fff9dcc40c803  include/openssl/dsaerr.h
-68eef9eb4bafb28fa290eda68dfe2c318d48dc10da3151a424027edd7a454203  include/openssl/dtls1.h
-b18230928e536447af72346cf8d98da599c99f8fef74bd5f7bdd7a8dbb012f33  include/openssl/e_os2.h
-11ec3d0149e69d8ed089a8bdf6aee0c6d61dc1a304f3b566fc1987559f5cc723  include/openssl/e_ostime.h
+148f89bd4ce3a7e24d70b7ee459b666961f1a43e961bb6936f41026f6ed7c278  include/openssl/dh.h
+181833ed01a0ddd7ee9977c65e34c6aaedf63afbed74e7340c0faca42ee7b3ec  include/openssl/dsa.h
+f0ae483215cfaa5d61a55374a06a0fc987f2ab3d1af437f1dc61a619f5943613  include/openssl/e_os2.h
 fcb8e2174725eef1279ba8ed046e56c99805796a13eb789ff78aadf7a73e6c76  include/openssl/ebcdic.h
-b1b7e6f9a0d0e5fc3d37ef73f0eac099cb6164c2cd4dfc750c3607f6e0736598  include/openssl/ec.h
-9c56b594bfde630c9b8df2fe0c691c74cf79fffb1c1b5e2034ade844e6e3c7d3  include/openssl/ecerr.h
-a2f2fccf0c06e6bb81eed9cb396d61b530fe306e40cb63a94b09067e22077b22  include/openssl/encoder.h
-28c28e8ab2b5ee05f96f2fb0800bbbbcffa63309dbec140dca7866ba1265d225  include/openssl/encodererr.h
-19ac60a505cbd27dcdb1b81993695896777e9743932b320aec60508538943c52  include/openssl/err.h.in
-022f402ced258bc1ee64ffacaa958b6f07a0973af6dc5a2ebb316d5043b57947  include/openssl/evp.h
-19f97e48aa1ecd695d296218e454db62f860ec858d865466c9134e71939b9bee  include/openssl/evperr.h
-587fde964a9a71b8e1086daaf43af4c931f86a156eff47097804ef4762430a0a  include/openssl/fips_names.h
+fab81b1fdd6df131a62f06380dd7ab361f235cb7abcf0e591d729bcd9e7126a5  include/openssl/ec.h
+07d47054034660f93646c0aa86aaa1314e8c973ea4eb0642e5b09820359a5571  include/openssl/encoder.h
+d6ca2a3ad4ded065bcfd8cb8de68215186662c277631bd17bd7b542b7fefd1e5  include/openssl/err.h.in
+084348c607a97b2e91967a79aee19bfe3ded6afe2202d4551b7481f6ea0b3a19  include/openssl/evp.h
+0399e15a86163ebe1bd31da2de617d4455f63fce42da741ceca0c1df08066b80  include/openssl/fips_names.h
 f29f8b7f23486e11b5307234d0f3efc56afc9a1321ac9792429493fadeb4a08e  include/openssl/fipskey.h.in
-e7b4468f152d139d17354eec68771432729d10757e7b3232f48699c250681e42  include/openssl/hmac.h
+24d2351e5cd9ff4608b4262519cbd806d267f62c2f480adc4169a150d6355f34  include/openssl/hmac.h
 a7c65894dd0f3730769d56a46bc6e4777c9bd7c8826998373d2ccdd9a346f840  include/openssl/http.h
 1dc0dce58de44226fc0afb51073c39933fb65dfd3a0131c4eff17bcb93018665  include/openssl/indicator.h
-36b0013002d44397aa41b021ec13433230221aa9722ce5fc31648f08d27ac448  include/openssl/kdf.h
+9606f8f3728b3edd1b95be84c6df79b118018a51b9f7ff0b1e53325eb93d307a  include/openssl/kdf.h
 f4a6b9adcd0158222878f5c55e3b40c620361d328bc624ce22d4937c0c054fbf  include/openssl/lhash.h.in
-3a6bbc7833212d862484513a0f1ec895450c8377290a644c17061051fecd162c  include/openssl/macros.h
+f22ee02bbe0ad86f49ae4ffd1dd5d0cbf6de266fb9c094857dffac1a1fce51fe  include/openssl/macros.h
 0da95b5743f5c12ba1a30c1ef84f9fe57ccd5816febb1b5fd3a4f573ec885cd8  include/openssl/ml_kem.h
 06f0d4621c344401f280a4e69e48ba987a0600b7f52ee16b25c4620277b081f9  include/openssl/modes.h
-6d40e3edc18bac56826b2beb9439e7e43a680867a0a9ae1d3f75e07dc72b024d  include/openssl/obj_mac.h
 a4127bd23a35828e90addb54b6a1cdfa6a1864038690fcc63053604629fb6f3f  include/openssl/objects.h
-884f19dffa0b6e0f03fb565cc61cf800993eafe7fc9df0ca2feef67e3b199963  include/openssl/objectserr.h
 429571177fe9a2ce5fffce21697ecf197bd9b645bdbc578a146418ce8286e9eb  include/openssl/opensslconf.h
 76386f806a801eba4c0172c52dc0e04e2deb192aa867f9d3e9d98a4d5a932d4a  include/openssl/opensslv.h.in
 4c4640740b5de9debbc82bcb5b3e02282c145e440e40dea478a804b8c3498065  include/openssl/param_build.h
-a9d03ecff3e67ba62eeb03663843148607c0b15c1a91ba3e28d4f7c5335c31bc  include/openssl/params.h
-ba1c36e0244a980f619eb956f05c16402d395ce88ed80963a7e3513ef55db70d  include/openssl/pem.h
-53d727f596ec45e747a4d79de98d62b1e36c7900d6e0b4269774d118d6c341f2  include/openssl/pemerr.h
-2fa9d02862a00a33fd3841640654fc705ae3d88cb91c1978fa09e87bf2976504  include/openssl/pkcs7.h.in
-2b25ec134dace5f5e1b0d52650d72c61c2243720358c0b3e645ad956b27d897b  include/openssl/pkcs7err.h
-a15b0b69bc1e31d0091ad32f04021d4fba9750cf9e3c9c0d2509358543cac380  include/openssl/prov_ssl.h
-21a6860d346cfed56d6ba85424a9725bcfc30105697d942b51fe11a4cf7f52d2  include/openssl/proverr.h
+3a9bfb4f64a2cba78546c02aa1b6f4593ce7adfd8ed7b37e007916bcc954e8cc  include/openssl/params.h
+3b0bdeaaeeb584692d2126b82e4d853f4f936d46694e9cbef95b79f3d8000767  include/openssl/pkcs7.h.in
+2f72e2a9ad00bdb14d003b28220e3e1ef59a3fd19c4f6a7bd931ddd8799827eb  include/openssl/prov_ssl.h
 d0fffeeaf8a20f6c86e8a6bfaeb1eab7c00188b1844c109ead4232c8dfb3705b  include/openssl/provider.h
-0adc54a200e16d7decdba93d7df19dffb99317bce2edd6cfeff6bd6444cf12dc  include/openssl/quic.h
-c467dcada2506c820e2dcb002dff9d797aaf9527c8778871d79d79a93bc673e7  include/openssl/rand.h
-23d76dfea708747bdc2ffac41e25b156a22d2d0cb744323a3b9859c54bfbb98a  include/openssl/randerr.h
-06dd86ec673693fc7c47a8b8489a72b648a56a667469064fbbfc91bcf20ad650  include/openssl/rsa.h
-6f79765285a8244f6c1858b86db8e390e4bc6c7905a7e4576973316612f7b015  include/openssl/rsaerr.h
-546e4277a9897ed5c01b9ab30168e82f4acf9a6a20da430ebf7dd698d5f888fc  include/openssl/safestack.h.in
-695683de2485c3b83d9116877f5d5ca3eb84a3bbb599f6bb02c9e595e7102b41  include/openssl/self_test.h
-4ab7b74e5d3810eac254c05b74a26a33af9ed526a06530feca758276593d3b2f  include/openssl/sha.h
-7a885aefe6213df0e0ba5136ba504e862cdfd8f05e1248b69dba03b8d4049f40  include/openssl/srtp.h
-b1b74cafc5ec9a5ec91df8c88e33d759e30476c3a2b2cd0dc23c20a22503963a  include/openssl/ssl.h.in
-bd952356cadf11d266630f4800a340d15f86d01a129ed20891d6357b4cb55a34  include/openssl/ssl2.h
-5915184833e25d2ec0e745583ba190a492100b797c30197f163af1a89183ca93  include/openssl/ssl3.h
-6c7312595fe8b200f06c9ddef7eacc358381f4fa712775850d8c6fb0858b9ab4  include/openssl/sslerr.h
-149f6038fb11f9090b5ab141d46c2da66ef244d06f5c5ba4a8ccf4063b31ab78  include/openssl/sslerr_legacy.h
-07f25b18b5acfb8733db85a258c6f3aac0c8f436f0a3095c8d885a741f6287f4  include/openssl/stack.h
+c712b7eeca499c968893efbc2964e100d257fb5add90152f6c35403192744040  include/openssl/rand.h
+4c93d2209b91002ed5f0e4abd4591e6949e60ff044a37da03172a13cc9067151  include/openssl/rsa.h
+6110f3dbde2b83456f4d8fe36885c8422ba49daf06308458d37466daea58aa2f  include/openssl/safestack.h.in
+8a942b471f64248a420bde94f91347469cf429b22d7a0a5f0da6342b6fba2236  include/openssl/self_test.h
+1e5408273c5d453a35b00bbff90c899f31acef09da52f63e80b0ad7f93c7f1e7  include/openssl/sha.h
+b254fc24197cadeb1eacf992501573f25ae6a2a2705189775a3d469dbda4490a  include/openssl/stack.h
 d381d0b4113f0fa18b3e421eae303fc84daf84eacb1236cb6e9976409a2d33a9  include/openssl/symhacks.h
 fc527427bafa6862d9e3847c961dd6cbbcccc39d25762c65ad3b99fae9599e2e  include/openssl/thread.h
-cdd1dab6344a7d700e8146191882d82766e158e9b789f994c3f9984ccff1c656  include/openssl/tls1.h
-a481e8762c694b3dac0e74aac8626fe60fa94962a14914f1f6969ea1214c40b1  include/openssl/trace.h
-9e04a3e9ca5352adffbdd75a5ea5237e8ff96a8c0a842368cc3a29de006b2ee7  include/openssl/types.h
-62e0cddeedfc217ac02bf37f3669ccea8d0822a88a74a8ec82b844a85b2700aa  include/openssl/x509.h.in
-869959c3d557d2ace84f38b7a8d0f23b3b0854de7f952f46310e828af04554dd  include/openssl/x509_vfy.h.in
-53a45ca5d00026ef0a256f7ff27f5708d5af0a44177a0fc4b209ec054d44e18c  include/openssl/x509err.h
+2f0b0b7d7384d901bd5a6f161f821cdd4a4d0db07148431fc3d549aa553d129f  include/openssl/trace.h
+52c3892ddc32bb44bda1e41f659f8bb94e946dd677323d96ee39935176659167  include/openssl/types.h
+76683d46aba0e790ba708d2eacb751a8bbff0796091d30dcd2b344f3f1e8461f  include/openssl/x509.h.in
+382ecfb0f0fc07299c2b5cb03c45a9deaab899785ea8f148660e0f9d43c61529  include/openssl/x509_vfy.h.in
+761b4894e9f48094a875401323c18631263e1922a90dc182ff3c4c2fa3b965bc  include/openssl/x509v3.h.in
 c0a9551efccf43f3dd748d4fd8ec897ddaabbc629c00ec1ad76ce983e1195a13  providers/common/bio_prov.c
-b45ed8347714ba15d91fb52e80c75b5670bcf27a9f36a75430c7953eafd8097f  providers/common/capabilities.c
+89ae360e61afe68cea62a39bf2cba3ac7e38baa41e63545f1aedf9122a1c8bc1  providers/common/capabilities.c
 f94b7435d4ec888ec30df1c611afa8b9eedbb59e905a2c7cb17cfc8c4b9b85b8  providers/common/der/der_digests_gen.c.in
 424d7b2ece984a0904b80c73e541400c6e2d50a285c397dd323b440a4f2a8d8e  providers/common/der/der_dsa_gen.c.in
 27ff361a5fbfc97cd41690ab26639708961d0507b60912f55f5919649842c6ae  providers/common/der/der_dsa_key.c
@@ -598,8 +586,9 @@ b8f2f94daeaf20c636c90e386284c246cfded0c8275411fa02fe68b534520b95  providers/comm
 9104cd39dddd6e1a6e8f267656482131f4d0765e96fdced1f7344817a1c8ed7e  providers/common/der/der_ec_sig.c
 03a5620654438c58a8f971398e68922a3f33a519e2c92edb141d13ef4cbc4651  providers/common/der/der_ecx_gen.c.in
 f3b089fd3dcccc8e3ebfbbdbf87c47d58330f82bd0e2a1223da74977930cccf1  providers/common/der/der_ecx_key.c
+4572df6882ddee3c00a72b7a13e39e0c6a26251394aceaa25378b79c5c12b48c  providers/common/der/der_hkdf_gen.c.in
 4132ea0bbb9dcdc44d90ca072b7a8d715dca0875d426aa12d770e60d5f0d46cc  providers/common/der/der_ml_dsa_gen.c.in
-341a74d94c93a9fbe663e489801fa586d8ff306615e230d2b1c74354003c90e0  providers/common/der/der_ml_dsa_key.c
+28bfca8e235b00fb9c5c5a564a5d6a5d390e31f1437d8fe3cdfa558aa79e6183  providers/common/der/der_ml_dsa_key.c
 5b3b0ae8da0fad1f7ba8b5fba2206210884728bf69a8aa00644036eb51953467  providers/common/der/der_rsa_gen.c.in
 6faa11a45867a626a8d9b63fc737867625cb1d15010bfe05ae6ae167be491e63  providers/common/der/der_rsa_key.c
 7e8d579986f53eaf1875d677e5cf4adfd4ccf79db0275368f6cac580ab6007ca  providers/common/der/der_rsa_sig.c
@@ -607,144 +596,153 @@ f3b089fd3dcccc8e3ebfbbdbf87c47d58330f82bd0e2a1223da74977930cccf1  providers/comm
 5d0e18a680f82632bda6ee9fb9ef61993ce0f2bc9884451e946a25130f27fc99  providers/common/der/der_slh_dsa_key.c
 0b18bc007f296e16f6210956f5b6ab612b77d8a95170f12ae32764125901db6d  providers/common/der/der_wrap_gen.c.in
 d447cd774869da68a2cc0bbb19c547ee6ed4858c7aee1f3d5bba7796f97823a9  providers/common/digest_to_nid.c
-440c8ce0a4ca9f63157202bbfa26e12fec25847215fbae3416274124604ada6e  providers/common/include/prov/bio.h
+da16552c0d4cb90c116c55c7cbc739b8c957c97b5e4180fa1ba524599390bdab  providers/common/include/prov/bio.h
 18ce379903b078446945da9116026da8639b4b0d81d357f86f9674a2a5cb94ef  providers/common/include/prov/der_digests.h.in
 c0a020765feb7ededc7e6f20b2b140dca09f347cc72404a5c7971df82b2f9ad0  providers/common/include/prov/der_dsa.h.in
 6024645ac9e165685b0a44a20feb342355eb06c07b7c7954508a125348570aea  providers/common/include/prov/der_ec.h.in
 5b6b7d8d12011c48195b7db8f65bc4bc4a48fb753763a3ce5006dc227b5139d7  providers/common/include/prov/der_ecx.h.in
+d0bdefe8353562f61c8c58cdba46b67e6a1fa5cc3b9b21605f619f7605fbeb60  providers/common/include/prov/der_hkdf.h.in
 ceea7616712e6ec4ff475a806998d66354d228f634e733a75e345bf78da32958  providers/common/include/prov/der_ml_dsa.h.in
+8eda99cba58c342dcd1418b0fa7c367a0520686f6f9f2fbb235661b7a5f5d94d  providers/common/include/prov/der_pq_dsa.h
 ce605f32413b09d33ce5795de9498a08183895c3347f33344f9ae5d31c29ccac  providers/common/include/prov/der_rsa.h.in
 a36d6762f74d9ac4f437e634e60f2b4de1ff5416bb6dd5d2cffe2e4556556b1b  providers/common/include/prov/der_slh_dsa.h.in
 6c1fa3f229c6f049c3ac152c4c265f3eb056d94221b82df95a15400649690e93  providers/common/include/prov/der_wrap.h.in
-e5c7da25b919ac4d2d84f21c9d552f29c2b06ba4445401bd4e361be45f4f8d30  providers/common/include/prov/proverr.h
 dff610c91cb41d9d6ea4084119d496a7e1d7973fc7831323d4b353f2b57acdfb  providers/common/include/prov/provider_ctx.h
-c02d1fa866192dee1bf6d06338714efad5e7cae6ac0470ba20820599b4f811e8  providers/common/include/prov/provider_util.h
-f221ca9b117c9cccb776bb230f71b86553ce6c24196bea120124a4be7b8a712f  providers/common/include/prov/providercommon.h
-4a6e35be7600e78633324422f019443747a62777eba4987efc50f900c43fda25  providers/common/include/prov/securitycheck.h
+3e85dba040878ad0a437bcfb08965aff4c4c1179679658b61e7ad5eb55771ab3  providers/common/include/prov/provider_util.h
+87b2c2fabd81dc0e1e8fb7fb8aa99a7bad58d3aac420afa778c9811dd0b0f959  providers/common/include/prov/providercommon.h
+7c6743102724255c28a6ac1085263ea4b7ce064ae665815289c96e78f0149e2d  providers/common/include/prov/securitycheck.h
 f3e31bd6776b55c924bbba8ad0f0727096b1d407b1d8b22f1f1a0f969a03fc4f  providers/common/provider_ctx.c
-3e6952b454f26cf8e2fa953bb3a75da76b1c3d634f1e42107c75b859265618fc  providers/common/provider_err.c
 9c835f67256a6657b04ad7c2bb7e724aa40cc8b636a06e9409026758bede799f  providers/common/provider_seeding.c
-ca5a852a6aa77140bd3cea619bd48f8e807a6be4ba5cd760b1790189fc16dc19  providers/common/provider_util.c
+bf6193d6a5ff6222e2382f0d0c3321ffeb1534a9ad78fe594aa838761aad3162  providers/common/provider_util.c
 b10730f4d302344579c09f43d5f9c5538bb6b4acd60de7430c24269fc522d5a5  providers/common/securitycheck.c
-e2f8f00519d81aa16f1c30e8cbf9a0d8e898a1cb5c8b38bb01dd9ab513e34c9e  providers/common/securitycheck_fips.c
+b8550dadf2f12a98b30ae39eba026f5f959e8f889df39fcf9eea0cbe7f4a3244  providers/common/securitycheck_fips.c
 abd5997bc33b681a4ab275978b92aebca0806a4a3f0c2f41dacf11b3b6f4e101  providers/fips/fips_entry.c
-76030d77364e05fb61253e7c6a33bee9881046d141fb087a58bb88aa5b413629  providers/fips/fipsindicator.c
-f0f1486219ddb5817b5105c36f384cb9ef095ddceec50966fe178f4b4177028c  providers/fips/fipsprov.c
-a348a9ff9480f20fff582093c7cb16bbf9e341648a32f54328f023c4e748314f  providers/fips/include/fips/fipsindicator.h
-ef204adc49776214dbb299265bc4f2c40b48848cbea4c25b8029f2b46a5c9797  providers/fips/include/fips_indicator_params.inc
-f2581d7b4e105f2bb6d30908f3c2d9959313be08cec6dbeb49030c125a7676d3  providers/fips/include/fips_selftest_params.inc
-7b80823bb5613e17e8576789ec77712d89c81e7beb6ce50b58037e925e465abd  providers/fips/include/fipscommon.h
-c00c429b0e022db3ef9b08b3400627a1f268fb071e84d0538fb68c060da6a3db  providers/fips/self_test.c
-5c2c6c2f69e2eb01b88fa35630f27948e00dd2c2fd351735c74f34ccb2005cbe  providers/fips/self_test.h
-b2fbcd63fa91f8179e94a045bc1981e2b009f9d587b59559a1e0e7e85f28036d  providers/fips/self_test_data.inc
-aab0bbdaa8e70f6cf9c3871d62b1efc6029cbe386c5d6318d7bc730da0fa8f19  providers/fips/self_test_kats.c
-d942921caa433ae9e62959b0ad1caad277b50d005ffc439c6d0e7b0886dba882  providers/implementations/asymciphers/rsa_enc.c
-c2f1b12c64fc369dfc3b9bc9e76a76de7280e6429adaee55d332eb1971ad1879  providers/implementations/ciphers/cipher_aes.c
-6ba7d817081cf0d87ba7bfb38cd9d70e41505480bb8bc796ef896f68d4514ea6  providers/implementations/ciphers/cipher_aes.h
-92b66f5bb84cfd8424fe56ce07bc3d639dc01c2a9d6c4359acd820e8b8b252ef  providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
-1b4f19be0c2bbea99e5fce0f93189c687a03cac634f0e37a51466ee7e3510735  providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.h
-a579a933e7756b502510a42679e06dca2737bda9e53edda578e28eae56b98577  providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c
-4e5e5c6478cf72f6840aa5d9edc50fe27aaa3ea39a428f602056172b0f00d541  providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c
-1b6d31811a6729f0c75c7c7ccfb7d3a75ab6001605b229593187918a592da789  providers/implementations/ciphers/cipher_aes_ccm.c
-00f36bf48e522dbb5ec71df0ec13e387955fa3672e6ff90e8a412ae95c4a642f  providers/implementations/ciphers/cipher_aes_ccm.h
-8049497bb1a3a6d5549d25ab31cf43afdf2e97ca789caed6502c19da3be44ae8  providers/implementations/ciphers/cipher_aes_ccm_hw.c
-302b3819ff9fdfed750185421616b248b0e1233d75b45a065490fe4762b42f55  providers/implementations/ciphers/cipher_aes_ccm_hw_aesni.inc
-a8eaca99a71521ff8ac4ffcf08315e59220f7e0b7f505ecddad04fadd021ec14  providers/implementations/ciphers/cipher_aes_cts.inc
-14de031ae6a95653f7d819bfdb2abaf873f884b8313901bee4c2ec3ffc286712  providers/implementations/ciphers/cipher_aes_gcm.c
-79f5a732820d2512a7f4fc2a99ece7e6e2523a51e62561eb67a4b70d5538b0c4  providers/implementations/ciphers/cipher_aes_gcm.h
-68fcbf7b1a8e801fcd2f5bbc2ed1f834feeb5572cac83c1f8aae82ccfb2815ab  providers/implementations/ciphers/cipher_aes_gcm_hw.c
-be18c20e0197f25fe7b9e0268657a2271a69d216b89cb100f082fa5fcaad1e07  providers/implementations/ciphers/cipher_aes_gcm_hw_aesni.inc
-60c4f604cf9b5457be48f31cc24ca21729660381081b2dbf99f362a013a09684  providers/implementations/ciphers/cipher_aes_gcm_hw_vaes_avx512.inc
-e2886780637db72b12c9bc488d81647ed55a7f5c850efd4bdbf88ef7127e1913  providers/implementations/ciphers/cipher_aes_hw.c
-89de794c090192459d99d95bc4a422e7782e62192cd0fdb3bdef4128cfedee68  providers/implementations/ciphers/cipher_aes_hw_aesni.inc
-b88e88831695dfc165ce83e64802ffb8240f1f696d9c67f350b9ff1b2e913212  providers/implementations/ciphers/cipher_aes_ocb.c
-88138a1aff9705e608c0557653be92eb4de65b152555a2b79ec8b2a8fae73e8f  providers/implementations/ciphers/cipher_aes_ocb.h
-6c3a89771719b36d6917d23464be5441836378393731af96ba165fd788df1a41  providers/implementations/ciphers/cipher_aes_ocb_hw.c
-c7aac28a9dca1ad46e5bce4de93e07dffec1f89fab82394c3ff7cf1bda8b483f  providers/implementations/ciphers/cipher_aes_wrp.c
-64a3b4a93173d10dff623b65821eaf141e2cbb081cc0bc7199797ead714a8742  providers/implementations/ciphers/cipher_aes_xts.c
-ff870fcdc063e2e9f99693e4dad5f2128130591b05928bb5395f60ddcf81b1cf  providers/implementations/ciphers/cipher_aes_xts.h
+dea7baa9717092a8c2b623bfd29fb16a5fecb4ebb2841de21a415e77cdfb40c9  providers/fips/fipsindicator.c
+4d1268debd72b6b5d078d21062dcea72f9cfb17fd0c95477c1e874e62d66bbef  providers/fips/fipsprov.c
+83cb741bd1833cd7346fbc9414d58a24e899943af9cb17f536ce7a81edea95c3  providers/fips/include/fips/fipsindicator.h
+4816988279bfd01c4dec1352489099c58a300fba70a28714d29d0ac57bd1f210  providers/fips/include/fipscommon.h
+5e00a45680b9f283005d63354aa05c29ee343a0b564e0d73861877fcae8f30a7  providers/fips/self_test.c
+dc13c409d5957dfbb0e5879bd9c714334f2fe619824ab424ca98b46db66045bd  providers/fips/self_test.h
+6ec16306973f6d52fe5462b326badb8691ae3c09b6b33c50c1b9fa7900e9f658  providers/fips/self_test_data.c
+de7b698cf016eff809715b72e2a838532679b38d55b7756f7e2f3a3f2649b2ba  providers/fips/self_test_kats.c
+775b222ef65c2ef3d877356f65ba4c7f12a4b7ec17f45524b716c966bebe8871  providers/implementations/asymciphers/rsa_enc.c
+ee8dcd4e46ff407797872f5594d04404fff8202e2cffb4685c37ef5d543560ef  providers/implementations/ciphers/cipher_aes.c
+a326ab08a90c13a7e3c6c16e17b4dc6d55f5e698824c776d18bad8d3873166d7  providers/implementations/ciphers/cipher_aes.h
+6cd2fe215eee7711d23f4cc0be7ec295350706e820d40f1ffda7d44c2d238f81  providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
+78f960c104f089f43487e0beb9633b7bd0fc168312a6db0c4ab4b9e3fbca4ec8  providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.h
+348e680f78849c37cb87bf0c95212f73e364165958c8c6aa7c947d9d0dbd6a57  providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_etm_hw.c
+e411dd8ab774a6368df12b08dea29ee2494ea4174c66b1999e53d80beb7777c8  providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c
+56a70eed1965425cf9dd6b3b693679359b56127d3e9e7eff50f4bed8491095a8  providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_etm_hw.c
+761ca489c440e56d1146dc2d56d85086f9e7e6192e9a4f1703e28c579bdca593  providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c
+6fd920324e43b2ac621dc96a9a2973e3d652cb50f85e7e480050fc499a1a8e43  providers/implementations/ciphers/cipher_aes_cbc_hmac_sha512_etm_hw.c
+3ceb53650e3fc3642acbe13b6683006e43e0f79b5457045ebbd7d826bd4a3557  providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.c
+2c5b070e0561b61763b0a0b559d205822e4a3cb5eaa0edba0315f1b073287df3  providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.h
+dbde94765165b5ba43ab2f9a58499c7b08f85403fc0be5606ffcbd299e2dfbcc  providers/implementations/ciphers/cipher_aes_ccm.c
+241c0b2f84c6e00f650764559ee3798b9d55f27840b5c772eb3c36eb4fdb74d0  providers/implementations/ciphers/cipher_aes_ccm.h
+dc74f6180f52f917477969d25ccfa5114c28e955a8f4a4b4f7ef0f3f821d241f  providers/implementations/ciphers/cipher_aes_ccm_hw.c
+a80320d377d8dd8ba8d82c99b144401a03329ba157e62171813da72bee0ce88e  providers/implementations/ciphers/cipher_aes_gcm.c
+59ba5d733162436bd2f925a24a89ddcfcd4d7b1c5436588d3659e30c7e8e4d9d  providers/implementations/ciphers/cipher_aes_gcm.h
+fb4656171d8a05256c3f489249233d0b8d063cd1738267b618dc86f564c60da2  providers/implementations/ciphers/cipher_aes_gcm_hw.c
+a145887f536869acf924f19942084cfd16b288a0de7db7ccbfd8023a77a0d630  providers/implementations/ciphers/cipher_aes_gcm_hw_ppc.c
+b68a7a78691306dc0158722a78804240ca0a522b22264d9e69662b297ac480ab  providers/implementations/ciphers/cipher_aes_hw.c
+a50e306a0fad6a20f464c107291376e63cbf4652ebb3e1ea356d8ff1d57f329e  providers/implementations/ciphers/cipher_aes_hw_aesni.c
+5ce9cf7b79f17e5016e2785ffb8ca1f8a6b6202832a8974f70137f271e8f8688  providers/implementations/ciphers/cipher_aes_hw_armv8.c
+006ab6cfd93eb2ca3f2b1cc3858c04087e6c78e528999821d2bc9ee82cda162d  providers/implementations/ciphers/cipher_aes_hw_rv32i.c
+548fc02c2fd384047950a692e008cb28e4b3bcc49e5e3fae0aa7b6ecf2474266  providers/implementations/ciphers/cipher_aes_hw_rv64i.c
+ede48034be45a6c0a0ee66a37bc42c07945146c437897e6e90043d10c6db42d1  providers/implementations/ciphers/cipher_aes_hw_s390x.c
+c58f79911106ec449818578d5bee79718ca7eef2e8ead1f3b4e07d8aad3d54ba  providers/implementations/ciphers/cipher_aes_hw_t4.c
+dd5134041a455f56987146900b7cd376642022e64166a4ad7d4f1a9440073c09  providers/implementations/ciphers/cipher_aes_ocb.c
+cc1aab4ef55dd459d3240ddde6c9a7023301f9da61a76938e8b3eec3cb0caf5e  providers/implementations/ciphers/cipher_aes_ocb.h
+b9cb159602c57cf06a8eeecb9f301aa3673dac0a9154dcc60dc24e8e4bd55df8  providers/implementations/ciphers/cipher_aes_ocb_hw.c
+fb6a566d1d1ec28bb3449dc60b86084f94b3a4ab8bbe834f78d608a4bc3f0cee  providers/implementations/ciphers/cipher_aes_wrp.c
+9471a9daf1fcb7766c3fd3cc3fd8ea42d373c35961d34b1c83196ac25987a8e2  providers/implementations/ciphers/cipher_aes_xts.c
+4f6a0a049878cdde40c2537b45f1cd16f219366d9da3b942a558ed70a9f54fdf  providers/implementations/ciphers/cipher_aes_xts.h
 281157d1da4d7285d878978e6d42d0d33b3a6bc16e3bc5b6879e39093a7d70da  providers/implementations/ciphers/cipher_aes_xts_fips.c
-ad271c002ce6a8e23ee928b2131f7bbeaf864dbaa381b6c6d18dc1d702d285c4  providers/implementations/ciphers/cipher_aes_xts_hw.c
-dc4626becaabc3990549483d9ef5f05c7dd9a9c2cf9be96ade3ba6a6e203f7f5  providers/implementations/ciphers/cipher_cts.c
-83c892e95bb3f0e0d0824f92d9792033265de1a224d8a92f119abb94994552d9  providers/implementations/ciphers/cipher_cts.h
+30c226c7768d59e49d078738d9a360aae3e11c0971cd109a0f4faecdea83110d  providers/implementations/ciphers/cipher_aes_xts_hw.c
+97f2f84bd44aa1b9c97768e7d14d6d132ffce80663488f184fa789d7ea1b8ec7  providers/implementations/ciphers/cipher_cts.c
+bc3ec200e5f13b36e5d682c589ce171b6d6e1da3a76f0ceedb916ed28eca0ec4  providers/implementations/ciphers/cipher_cts.h
 1fce446497c98a84043257700ff02bb8ba04cdbb8ac92b15ca09404490e48016  providers/implementations/ciphers/cipher_tdes.c
-9cfdcc860a03b6e7ced8cc21bcbbc1c070c89aefab04b07f213c7a3db1895553  providers/implementations/ciphers/cipher_tdes.h
-00b931090e26ce9a62ee4ea125586f439a9906db5d7b914ffc67d293a57c7c00  providers/implementations/ciphers/cipher_tdes_common.c
+5351100e7e262b46db84f06b8653802f1166dc3a1965c6f18fc920dc91749b30  providers/implementations/ciphers/cipher_tdes.h
+8a6d64a4876f0159ca18b47025f1c78acb09429223c80f73717821110f3951ea  providers/implementations/ciphers/cipher_tdes_common.c
 cca34f1c7baf3a98964f7ce19a59e06d1eaf2ada121a0d4a438f4078a072b325  providers/implementations/ciphers/cipher_tdes_hw.c
-b3d0f1a614a8a15bd9cff60dcfa0371c3bcc26d597c58c07fe9dc1c290aee84a  providers/implementations/ciphers/ciphercommon.c
-ab9a2edb23aa61cf31da6addd8674a6028f93399eceeeee35a56ee770338fd6c  providers/implementations/ciphers/ciphercommon_block.c
-de3a998c57842a6de643ec8fd9e4fd6763c7092afb3cb5e83be87016c5d4cc01  providers/implementations/ciphers/ciphercommon_ccm.c
+5fa2f02b8de00a9c8b34e71e619062bfce0413c9cb3e3e3107ced4fca265009f  providers/implementations/ciphers/ciphercommon.c
+2afe5bdf23e7facf956f8a1591c10ad06088fe82b3af846ef3132c7e17bdaf82  providers/implementations/ciphers/ciphercommon_block.c
+bb7632f5e32c5993eda21ae3ba87fca538e9a99022404473c4890cafea48c5be  providers/implementations/ciphers/ciphercommon_ccm.c
 6632a555d5bcd5af67d0355ce46c2906bb3a0dcdf1651595b29189c40a5ca675  providers/implementations/ciphers/ciphercommon_ccm_hw.c
-bc12afbe8844ea598837427b0addec6b608cfda26abc07c96767d38b6b4147f9  providers/implementations/ciphers/ciphercommon_gcm.c
+c9bf23a8d0827462e142ace9c967180fe3b7ceb43a34b1d028e98904af8ae64b  providers/implementations/ciphers/ciphercommon_gcm.c
 bb67eaa7a98494ca938726f9218213870fc97dd87b56bda950626cc794baf20b  providers/implementations/ciphers/ciphercommon_gcm_hw.c
 8bf2b4bef8167740ae3fffc9f0cf73327a1b4ee361e63da22c257cca0e1e2971  providers/implementations/ciphers/ciphercommon_hw.c
-c4b1cb143de15acc396ce2e03fdd165defd25ebc831de9cdfacf408ea883c666  providers/implementations/ciphers/ciphercommon_local.h
-8968fa98952f8f265661c70f2f7e723fca0f80b62ab3faa911025bc41e544a02  providers/implementations/digests/digestcommon.c
-ae449102b3434800656536ed7ede4a2786ec97350c01df8c45d0431c12e9e700  providers/implementations/digests/sha2_prov.c
-0ec4b36a2c3401df5f3c814371867c9bda1055843c88107a319ffd05288d586a  providers/implementations/digests/sha3_prov.c
-5b2e4b63e416cc9cd81c27f7acd547df1c580838ac2051d6db56fa9d5569cc8f  providers/implementations/exchange/dh_exch.c
-e1b33fcc05c60254849b9a01e416885ce93ea9e315b9877ac7ab420003b2ec3c  providers/implementations/exchange/ecdh_exch.c
-d44c5a6d3156392757415f34afc1ab164fb0e9cd1e97977386d7cd13f3555df5  providers/implementations/exchange/ecx_exch.c
+6292f6f2fb30a0c93e000d5a30d8703e25764ef0b38d38f1172d59c08bbcb97d  providers/implementations/ciphers/ciphercommon_local.h
+a639cb1b3285e41fa4372bda7b74c66a358a0b7a038cfc9a9c171e5f15beb932  providers/implementations/digests/cshake_prov.c
+b680a2e4bc430b681bb5a6857c173cd5214c11f046bfa747286cd4f08eb5f707  providers/implementations/digests/digestcommon.c
+5ef05ffce97dcd1d29a5647f4c8edcd5375da138a1352fd67746d4f074f6d7aa  providers/implementations/digests/ml_dsa_mu_prov.c
+794505a44c44f8d835d8e5232691ccc809ab1eb03ebcd62a2432b6c75ab0c1af  providers/implementations/digests/sha2_prov.c
+ad5684d9be1f831c05e696a74981308ba1965f94ef5dc02bceef502ae1df47da  providers/implementations/digests/sha3_prov.c
+611f6ec04fb043973b92aa7d7b851b1f458f89efae2d5c5311aaccf4d97fd304  providers/implementations/exchange/dh_exch.c
+eb00f306a98ac77fc6f2fe7f34d2ae5766e72c37b76145e892793173a879c590  providers/implementations/exchange/ecdh_exch.c
+85d51569b5fcd2b341d86b1f4eb78174812a02d4c00e6d4983b4453d0796fd40  providers/implementations/exchange/ecx_exch.c
 b1115636f53bf70f417b183cafeb6d38e230d11d8de731e6896ba60cc850d931  providers/implementations/exchange/kdf_exch.c
-6ec1132020ff0ea45eb2f3e43cf1e5f29f0d2ce1d3adde27431befa626eb3f62  providers/implementations/include/prov/ciphercommon.h
-f1dd49b30604d9b8e948c135329a270a4d3e04857f7f9159a3e84f46a024d59d  providers/implementations/include/prov/ciphercommon_aead.h
-af38be5b3d16c3ced0028bc9b3fbe957a6a817e23967bacc7df65566ba107edb  providers/implementations/include/prov/ciphercommon_ccm.h
-35d1c063e840c9cd5114c5e57b007a19868982a82d8e40a99b2935c9f1f5e05e  providers/implementations/include/prov/ciphercommon_gcm.h
-624f0f709ba1ad87579cda6f2dd76ca0b17c332969a76baba9acecd05a749713  providers/implementations/include/prov/digestcommon.h
-1baf1c06b20a0eb8ec271452544922d67c1cc168dbe9853b259191de4bd99918  providers/implementations/include/prov/ecx.h
+359a5077fd07dd2ee7c145b7170b317820e0d3fd40454b156b90a3edcb2de612  providers/implementations/include/prov/ciphercommon.h
+138b7525ad6c672dd0aefd3badcd683f5dbe36414031c99d893e19b0a2a3fc9f  providers/implementations/include/prov/ciphercommon_aead.h
+81027be248ea67351ea3a99cb8ce444a26931ba23fca4101f743ca9453138aea  providers/implementations/include/prov/ciphercommon_ccm.h
+cc1f569b7496736510fe643e0e12e97111a62b44b3bce228079d80c66e0789c7  providers/implementations/include/prov/ciphercommon_gcm.h
+1fc29fab9f0aba31bf93dd24b860c08414f23feabdbcc72bd08e8d18f9832d4d  providers/implementations/include/prov/digestcommon.h
+904c8e419cdb7396191e2929cdac5ee32d6edfd620730742ad894b7f007ca7b5  providers/implementations/include/prov/drbg.h
+a728d88d639e090c8ac4d402a44688f1ff43690ca6a82cc659143c119404526d  providers/implementations/include/prov/ecx.h
 b0d1f6fc3c9220fe6d4656e487bad8df16b6f840054018b95b2752ea9aef822d  providers/implementations/include/prov/hmac_drbg.h
-3542340567e409ab68be299aac67cdb1045ab8e8987023d4fc3c209c9779a0ba  providers/implementations/include/prov/implementations.h
-05eedab6b16c80025f72281fa619d9480c437b800cb821b761fe4c05bc9d3af0  providers/implementations/include/prov/kdfexchange.h
-4014246d44fa3f34aad5372c75d3f7eea528f1cf1798e30d5627e7620a356631  providers/implementations/include/prov/macsignature.h
-b41c9a4e90d951a2d0e796b1cbbdbe8cb6fc18306d9b70be7a489249c11c294a  providers/implementations/include/prov/ml_dsa.h
-511ad835639f071e99eaff6dcbf516999d108ea8b3f5f3f027e0982a916cf3c3  providers/implementations/include/prov/ml_kem.h
+b5d93d2cf0197319695dca610cb525129dae5900ec6987847719fb8da2dd4bc6  providers/implementations/include/prov/implementations.h
+fff5e4e34ffac0520ee8b351ef8445f2040d3b1d7d467d93eddcc8f015756937  providers/implementations/include/prov/kdfexchange.h
+0b6a6b74f335e10a2233f70fc02ea2673393a3668fa5be409f8ae560c4893338  providers/implementations/include/prov/macsignature.h
+88cb1046cda544e67db055a4c7e57b075a94950130ac0463d11dcfd7e4ce8107  providers/implementations/include/prov/ml_dsa.h
+20e07d060977d08ffc9d568633e702d5c8537b366ae87ec83822faea20043a3f  providers/implementations/include/prov/ml_kem.h
 8b678d26c077e9135171aa27a8038041f320aa17a3441240865c54859c864ebb  providers/implementations/include/prov/mlx_kem.h
-af1adbeaa97de9b550f987e4badfa3809ba8c734bf7b90b830882cd95175d667  providers/implementations/include/prov/names.h
-b9f8781167f274ccd8b643b3bb6c4e1108fb27b2aae588518261af9415228dae  providers/implementations/include/prov/seeding.h
-2c7a8075740b5aaa0025611c7e6507ea6fb4aa9674518a8b7d1fac4afb90c376  providers/implementations/kdfs/hkdf.c
-fa132932654a12ce80d687322ad1920846c03d5c022d255074ecb116ff2687fe  providers/implementations/kdfs/kbkdf.c
-06fe9cf7db51e48ea3b5106d44a4cfa3fbc2e0afdbf0de7867854525effa7bb3  providers/implementations/kdfs/pbkdf2.c
-c0778565abff112c0c5257329a7750ec4605e62f26cc36851fa1fbee6e03c70c  providers/implementations/kdfs/pbkdf2.h
-abe2b0f3711eaa34846e155cffc9242e4051c45de896f747afd5ac9d87f637dc  providers/implementations/kdfs/pbkdf2_fips.c
-005016cd3d2b9f9d7288d5b7cc71eff3f603199117f6758464dc9778e1ddfc18  providers/implementations/kdfs/sshkdf.c
-a9a5a3ba575b1a372f5a09135667ac1b0e303f8b19b0707804390aba9e266eca  providers/implementations/kdfs/sskdf.c
-f01cbd7c5351d4aa9ae667627503b2cfef6fc0695e7a42296b7bf015c9a418b3  providers/implementations/kdfs/tls1_prf.c
-79122582eb010bd151e9e682f4bed44cb434a378781d33e95700f5b1365b1847  providers/implementations/kdfs/x942kdf.c
-e8d1737df0d274d2d7b00ecf3fc3de7a4482b993bd40ef4fcd2c0f3fab3bc3ea  providers/implementations/kem/ml_kem_kem.c
-23ff6d6f0f716c7f79ea7b60433530455843b2c7f387217aec639b67cd2139e7  providers/implementations/kem/mlx_kem.c
-ff22e920552b82db3dab51b09f9dd2fd038ef0d57fb76cea5578e703653d28c9  providers/implementations/kem/rsa_kem.c
-728b75a11d47584e2b4d1035609dbd79be98814b706c06445ae678485e266cb7  providers/implementations/keymgmt/dh_kmgmt.c
-c0446d1b2101ddd977063516b87d23f424cdca33473f293db4c3974b674169b0  providers/implementations/keymgmt/dsa_kmgmt.c
-45480796e6ea50cbe9529c17f9fa04228a9126dc7e7e32971519eeb6d6ac267c  providers/implementations/keymgmt/ec_kmgmt.c
-258ae17bb2dd87ed1511a8eb3fe99eed9b77f5c2f757215ff6b3d0e8791fc251  providers/implementations/keymgmt/ec_kmgmt_imexport.inc
-c505dadc65ef749c18655df5594b77926a61a015764cf78ced39ee348a4909aa  providers/implementations/keymgmt/ecx_kmgmt.c
-daf35a7ab961ef70aefca981d80407935904c5da39dca6692432d6e6bc98759d  providers/implementations/keymgmt/kdf_legacy_kmgmt.c
-b89dfb851375a78f255183a2777bdba41c85d4ba85786a4bf0678851d23b6720  providers/implementations/keymgmt/mac_legacy_kmgmt.c
-4caf110da5fbe9c2cc2bbf765ccc53ef15e69f8bd47f7158f691d4b97b846670  providers/implementations/keymgmt/ml_dsa_kmgmt.c
-966aba7035631c53c0cd84f831784353f1d9871dadd0623cb1bcdeef34010796  providers/implementations/keymgmt/ml_kem_kmgmt.c
-a649bf60a638a42521f6e5b8b3010b5524fb7e2478e7f03f8c82bbfdd83c2f73  providers/implementations/keymgmt/mlx_kmgmt.c
-0c66b24fa26849c1bd09bf8086d24c4a34bcefc3aa876c6186017b9b5f0bedfa  providers/implementations/keymgmt/rsa_kmgmt.c
-1aa554eee1a5aad4add58f72497e0c25c37f52b42b6c6eec6d16e6d70c92fcdf  providers/implementations/keymgmt/slh_dsa_kmgmt.c
-2a66bc54579cb1fcd72674a1e60a7a1f798c13ab964a45e5603bed699268354f  providers/implementations/macs/cmac_prov.c
-78d1c62a30c458357d3c70adf4b66a7fa9a391135da9328560341a70b3b52934  providers/implementations/macs/gmac_prov.c
-2d6b8c42c67e3e43d8d0035463cbff590dabb7da815f9e437a3a72d4b6596319  providers/implementations/macs/hmac_prov.c
-40686337be4261685f176bb10042d903d46ab10c90e10ac42d3842e9b5ddd960  providers/implementations/macs/kmac_prov.c
-0ebc5a48655a697231918644397308e64914c32421e9b8ee7afd7779b6a2fdb8  providers/implementations/rands/drbg.c
-d2805527aa28c27dc0d10f3e35b64e18626691b3c864806dd644b7dd1640ec49  providers/implementations/rands/drbg_ctr.c
-e624059b1c9f878655d6a21a4c295c43d147ea913f638a2d007a1a68379180f8  providers/implementations/rands/drbg_hash.c
-3aa1dd31f0db1ab0a7a5a3037f722e284587c244126810268622fae65bef77d7  providers/implementations/rands/drbg_hmac.c
-841617c81d6d5eae5ea59064e8b45947d436d3e53b49283329d17016866d8f34  providers/implementations/rands/drbg_local.h
-355bd437dde9ecd1da89f42691147f2b5cf9a012ff5f55062bf83b6bead1e181  providers/implementations/rands/fips_crng_test.c
-90ea602ec88f7c0a78f3e7c801cdd3574a221f04497121a9ea7dcb05b7ee6765  providers/implementations/rands/test_rng.c
-c6c709dfd8b1be036e2a5232d3b21dc25f0150f2aae24cc7db6b09cd790a04ee  providers/implementations/signature/dsa_sig.c
-cda60439dd7eaa7e90e599f789cb3092967b57bee36c7b58dce2477793b5f487  providers/implementations/signature/ecdsa_sig.c
-218bcd28611b02027314f8f7b7d6b5b5164574873b5188efc2a9e6a907aeeb33  providers/implementations/signature/eddsa_sig.c
-31f588fe2e38fe1c6c5a3cb9cdffedf5a4b3994357c57fae2ff900702d75ff23  providers/implementations/signature/mac_legacy_sig.c
-3f4449310fa024ee485121e6aaa4b11fca2c0b9c9a9484990f9cea5723de7e4c  providers/implementations/signature/ml_dsa_sig.c
-5712b5a289cc279a9136238d979b86febe83c9af15120f78a48fd0c1dd107e5a  providers/implementations/signature/rsa_sig.c
-abf792c38bbb727ea7c4e574453150f40d096a8f8e188e6bae95d1a37057b10f  providers/implementations/signature/slh_dsa_sig.c
-21f537f9083f0341d9d1b0ace090a8d8f0b2b9e9cf76771c359b6ea00667a469  providers/implementations/skeymgmt/aes_skmgmt.c
-2dbf9b8e738fad556c3248fb554ff4cc269ade3c86fa3d2786ba9b6d6016bf22  providers/implementations/skeymgmt/generic.c
-9ba8db9b0e18847ef79ecb77fbc383d8762694be29dfb7d269df6f02dc977222  providers/implementations/skeymgmt/skeymgmt_lcl.h
-c816491e0a634fb84ae61ef7362c366b34f200201a134dd9ac75457f487106d8  ssl/record/methods/ssl3_cbc.c
-a8914c1661c53bcb0f435ec280c35c5a135e6c71296554c7322186847e194683  ssl/record/methods/tls_pad.c
+42c3dfee2b33f4216afd165df9ce28d38ba0c84cbfc090e238f03cc22d62299b  providers/implementations/include/prov/names.h
+462dbc1209f0281c1c4301e19fbb0b180d951584010da1430d9cd043cc5778b3  providers/implementations/include/prov/seeding.h
+a8ce7c57945c6209da1be94dcb35b5067a088139e0918ae0723bcc17df3792bc  providers/implementations/include/prov/skeymgmt_lcl.h
+ab4c9694d2d918304991ca85772e6ac65cdc33e44ae6de3efbdc45bd49d9f706  providers/implementations/kdfs/hkdf.c
+e8b4e8ebd10872ee42beeeffff7458b1d2991833edbc763e2275ce4060867b0c  providers/implementations/kdfs/hmacdrbg_kdf.c
+821d4b8166f151c95ab9eb27f7fd661b26ac08dc7b77deccd593dcc59206de91  providers/implementations/kdfs/ikev2kdf.c
+84a83391cd7215a0d3d822f59cd08a465f82467b0e7ab4c369a266a248a99e27  providers/implementations/kdfs/kbkdf.c
+ac8b12984dd6712d5edf372575e381fc98c05d56ab03047434d0366ac698c954  providers/implementations/kdfs/pbkdf2.c
+7d9923c486d6751c3065c6748ea5d186fa2302f802818306cdee9ffdc3ac9d2f  providers/implementations/kdfs/snmpkdf.c
+ad7977d3357e95cb7d25dc8646ff0e9f16a24c7d2e5924750fc69035fbb5b089  providers/implementations/kdfs/srtpkdf.c
+4f70b937d163759b713335a194ca44ca084ce2e58c8a6d15c27e5f1bc61b17c3  providers/implementations/kdfs/sshkdf.c
+ecac95b5cfe9864793c0d9339acbdd2f0c07938a3e3ab7a007fcf5120f57ff83  providers/implementations/kdfs/sskdf.c
+85d950d15affed86179aaae679c13cef87c35261922227bf6599b53703f54a1e  providers/implementations/kdfs/tls1_prf.c
+7cf4c1f999a5046ffa1bc7ed2b7e9e575970a71159adb5c4cd21998bebaabe4a  providers/implementations/kdfs/x942kdf.c
+2d5e050823bbcb669eacdd7d0a9330808a35c237c8c722cb6676431fd60c05e5  providers/implementations/kem/ml_kem_kem.c
+38866b46c0c513b919764da57c507ca646e80cc9bb261ce53d47fac6a550447b  providers/implementations/kem/mlx_kem.c
+45fbb2d6229202ac99ccbd23e4cd1a424080c5ece1332a787c9ddc0f6441c6cb  providers/implementations/kem/rsa_kem.c
+842044fa8a651a56cc82336590b030bec59d25b868c841855bfa38b8e863c579  providers/implementations/keymgmt/dh_kmgmt.c
+d34296ae8595aa1ed90b5652ab7e8fb7e2c5131f5dac7b69eeed7f0fdc2cb6ad  providers/implementations/keymgmt/dsa_kmgmt.c
+eb2d1166a10fa324cd5bded35a739729cd0e693253d927df6737a252ce426e67  providers/implementations/keymgmt/ec_kmgmt.c
+4bdffb8f27db1c2c7727301590a7cb0f8d4c04d979f77921f34754346e837d0e  providers/implementations/keymgmt/ecx_kmgmt.c
+dc53ca39327f8ebf9f065afe57ccf74df497056dada597f6929f8bc265e7b732  providers/implementations/keymgmt/kdf_legacy_kmgmt.c
+a1afb4d73a07dfa617ae4dc4a0d361ba19403bd5e8f89c9a2c6ccbb93b8ae5f2  providers/implementations/keymgmt/mac_legacy_kmgmt.c
+536e25f9b9a7db69957823dd5aa6630865bc963d9cf0e13b7010aae74ea2009d  providers/implementations/keymgmt/ml_dsa_kmgmt.c
+8f4bcab49404f146095bf023e6dbb28a1dc4acb837d51881582fa13fba84c286  providers/implementations/keymgmt/ml_kem_kmgmt.c
+2c40277ee050d6223f3d978a7c56424945738a2f5886fc6feb189074e4fede7d  providers/implementations/keymgmt/mlx_kmgmt.c
+5adc17c8ae103e15bf251b78c7640bcc1b95214b4fd03b0da62dc0fb22b6f53f  providers/implementations/keymgmt/rsa_kmgmt.c
+7e655c204c3791299b682f4f07ba598462e5ff943a6f680de761c98400aa8069  providers/implementations/keymgmt/slh_dsa_kmgmt.c
+b254f523171368c68b74978282811b22c406744ba8a3982aa46db12cd6eae961  providers/implementations/macs/cmac_prov.c
+833f4263e0fd7d1cec9a3ac05fc2a2b0539cf2cd805ca64d6054750f28ccd039  providers/implementations/macs/gmac_prov.c
+f0271cadea2c0c182d2ba7bd744e60557c543d55028956a8062de04dfe0f6189  providers/implementations/macs/hmac_prov.c
+ce7866f670bb5b80b8fec42c79ed439e3f1f7edbab561f9a10042ccdbec2e855  providers/implementations/macs/kmac_prov.c
+9a796599b6aa54cd7851a04e4929b47f172b9818259b5debd22858a1faee6e2e  providers/implementations/rands/drbg.c
+7a4ddd75c4df60342154a1e08da480e4bde0c3607d2ae825f43e1ddd71f4d819  providers/implementations/rands/drbg_ctr.c
+a65fb53d9b840f0e1c67fe64de2268e20b51f87c4e5fd2f4f057e9f549c8644e  providers/implementations/rands/drbg_hash.c
+232ca3e184258eef7cd83611975f0c77fff557dd7dd7c3b6147266efd2d103a0  providers/implementations/rands/drbg_hmac.c
+7715f89d9f03a1088e7fc65da1c32417e2f9455c031802a79639fdabf270db5a  providers/implementations/rands/fips_crng_test.c
+e5e41c1246cd779057adb86f7bc06cd74b606f02127dcc55afc020789825fcd3  providers/implementations/rands/test_rng.c
+1c589393350cb573929f0604fba9f3abfb78ea3a77f892b8b497874be22b41a3  providers/implementations/signature/dsa_sig.c
+0f69c91461cd360ac45e81b50c02a47d51d12fe0e314f00e35e4082622f46edd  providers/implementations/signature/ecdsa_sig.c
+6f496e72102ce535452c36e8998e3987f020a5936151d937c8f6703e8675bbec  providers/implementations/signature/eddsa_sig.c
+df709aed058e50fc9c825d5a23f8fa6018f4680b9cf326af0476bac27a94d688  providers/implementations/signature/mac_legacy_sig.c
+1dec2216e335a0caa568d753a2f36f3db40067b9f55f0fd544a3e79f34ebd90d  providers/implementations/signature/ml_dsa_sig.c
+7071104fe5c53043635b9de4199f13604a4af9e078ab441c075f487e85325568  providers/implementations/signature/rsa_sig.c
+e8f09acc2ee2e11059ee6702402eb7acdf68cc60caa2e48134ba5f9b12e7c50a  providers/implementations/signature/slh_dsa_sig.c
+6d3fa2d15a1a5ce52954a30574554f80cd401fac8e3175aa136204b2888fed6d  providers/implementations/skeymgmt/aes_skmgmt.c
+3d39d2293b9642c722e65e46c1689c42a30b981730c1e6c317ffcf197b9b1ac7  providers/implementations/skeymgmt/generic.c
+aa5a7a9e521c3281fdd55cc6a5deb5721c8d067ac1433979c6f2748871ca8d2f  ssl/record/methods/ssl3_cbc.c
+04f33a330e073222366d31b3498c775ec77bf491e9d27aa7ed65c8ab5f615897  ssl/record/methods/tls_pad.c
+6a064336295b488084050dbb511bf0127b0d91bac54d9132f2162a58b923f095  util/mkerr.pl
diff --git a/deps/openssl/openssl/providers/fips.checksum b/deps/openssl/openssl/providers/fips.checksum
index f65a3e29770..ae128f4ea50 100644
--- a/deps/openssl/openssl/providers/fips.checksum
+++ b/deps/openssl/openssl/providers/fips.checksum
@@ -1 +1 @@
-ee49eb47504f27ba763309e94f373e49f3d2fd1f6f750fce28329184bfdb1f01  providers/fips-sources.checksums
+fc55c7cc2820af63932b7936ffdbea3fb50e72a1b574e0e591d8f95a277d89e9  providers/fips-sources.checksums
diff --git a/deps/openssl/openssl/providers/fips.module.sources b/deps/openssl/openssl/providers/fips.module.sources
index 765df15d284..b2604379179 100644
--- a/deps/openssl/openssl/providers/fips.module.sources
+++ b/deps/openssl/openssl/providers/fips.module.sources
@@ -1,4 +1,5 @@
 crypto/aes/aes_cbc.c
+crypto/aes/aes_cbc_vaes_intrinsic.c
 crypto/aes/aes_core.c
 crypto/aes/aes_ecb.c
 crypto/aes/aes_local.h
@@ -6,6 +7,8 @@ crypto/aes/aes_misc.c
 crypto/aes/asm/aes-586.pl
 crypto/aes/asm/aes-armv4.pl
 crypto/aes/asm/aes-c64xplus.pl
+crypto/aes/asm/aes-cbc-vaes-x86_64.pl
+crypto/aes/asm/aes-cfb-avx512.pl
 crypto/aes/asm/aes-ia64.S
 crypto/aes/asm/aes-mips.pl
 crypto/aes/asm/aes-parisc.pl
@@ -17,6 +20,9 @@ crypto/aes/asm/aes-riscv64-zvkb-zvkned.pl
 crypto/aes/asm/aes-riscv64-zvkned.pl
 crypto/aes/asm/aes-riscv64.pl
 crypto/aes/asm/aes-s390x.pl
+crypto/aes/asm/aes-sha1-armv8.pl
+crypto/aes/asm/aes-sha256-armv8.pl
+crypto/aes/asm/aes-sha512-armv8.pl
 crypto/aes/asm/aes-sparcv9.pl
 crypto/aes/asm/aes-x86_64.pl
 crypto/aes/asm/aesfx-sparcv9.pl
@@ -37,10 +43,12 @@ crypto/aes/asm/vpaes-loongarch64.pl
 crypto/aes/asm/vpaes-ppc.pl
 crypto/aes/asm/vpaes-x86.pl
 crypto/aes/asm/vpaes-x86_64.pl
+crypto/aligned_alloc.c
 crypto/alphacpuid.pl
 crypto/arm64cpuid.pl
 crypto/armcap.c
 crypto/armv4cpuid.pl
+crypto/array_alloc.c
 crypto/asn1_dsa.c
 crypto/bn/asm/alpha-mont.pl
 crypto/bn/asm/armv4-gf2m.pl
@@ -58,6 +66,7 @@ crypto/bn/asm/ppc-mont.pl
 crypto/bn/asm/ppc.pl
 crypto/bn/asm/ppc64-mont-fixed.pl
 crypto/bn/asm/ppc64-mont.pl
+crypto/bn/asm/riscv64-mont.pl
 crypto/bn/asm/rsaz-2k-avx512.pl
 crypto/bn/asm/rsaz-2k-avxifma.pl
 crypto/bn/asm/rsaz-3k-avx512.pl
@@ -105,10 +114,10 @@ crypto/bn/bn_mpi.c
 crypto/bn/bn_mul.c
 crypto/bn/bn_nist.c
 crypto/bn/bn_prime.c
-crypto/bn/bn_prime.h
+crypto/bn/bn_prime.pl
 crypto/bn/bn_rand.c
 crypto/bn/bn_recp.c
-crypto/bn/bn_rsa_fips186_4.c
+crypto/bn/bn_rsa_fips186_5.c
 crypto/bn/bn_shift.c
 crypto/bn/bn_sqr.c
 crypto/bn/bn_sqrt.c
@@ -135,6 +144,7 @@ crypto/des/fcrypt_b.c
 crypto/des/ncbc_enc.c
 crypto/des/set_key.c
 crypto/des/spr.h
+crypto/deterministic_nonce.c
 crypto/dh/dh_backend.c
 crypto/dh/dh_check.c
 crypto/dh/dh_gen.c
@@ -164,8 +174,7 @@ crypto/ec/asm/x25519-ppc64.pl
 crypto/ec/asm/x25519-x86_64.pl
 crypto/ec/curve25519.c
 crypto/ec/curve448/arch_32/f_impl32.c
-crypto/ec/curve448/arch_64/arch_intrinsics.h
-crypto/ec/curve448/arch_64/f_impl.h
+crypto/ec/curve448/arch_64/arch_intrinsics.inc
 crypto/ec/curve448/arch_64/f_impl64.c
 crypto/ec/curve448/curve448.c
 crypto/ec/curve448/curve448_local.h
@@ -212,6 +221,7 @@ crypto/evp/evp_enc.c
 crypto/evp/evp_fetch.c
 crypto/evp/evp_lib.c
 crypto/evp/evp_local.h
+crypto/evp/evp_pkey_type.c
 crypto/evp/evp_rand.c
 crypto/evp/evp_utils.c
 crypto/evp/exchange.c
@@ -226,7 +236,6 @@ crypto/evp/p_lib.c
 crypto/evp/pmeth_check.c
 crypto/evp/pmeth_gn.c
 crypto/evp/pmeth_lib.c
-crypto/evp/s_lib.c
 crypto/evp/signature.c
 crypto/evp/skeymgmt_meth.c
 crypto/ex_data.c
@@ -248,6 +257,7 @@ crypto/lhash/lhash_local.h
 crypto/loongarch64cpuid.pl
 crypto/loongarchcap.c
 crypto/mem_clr.c
+crypto/ml_dsa/asm/ml_dsa_ntt-x86_64.pl
 crypto/ml_dsa/ml_dsa_encoders.c
 crypto/ml_dsa/ml_dsa_hash.h
 crypto/ml_dsa/ml_dsa_key.c
@@ -260,6 +270,7 @@ crypto/ml_dsa/ml_dsa_ntt.c
 crypto/ml_dsa/ml_dsa_params.c
 crypto/ml_dsa/ml_dsa_poly.h
 crypto/ml_dsa/ml_dsa_sample.c
+crypto/ml_dsa/ml_dsa_sample_hw_x86_64.inc
 crypto/ml_dsa/ml_dsa_sign.c
 crypto/ml_dsa/ml_dsa_sign.h
 crypto/ml_dsa/ml_dsa_vector.h
@@ -294,13 +305,13 @@ crypto/modes/wrap128.c
 crypto/modes/xts128.c
 crypto/modes/xts128gb.c
 crypto/o_str.c
+crypto/objects/objects.pl
 crypto/packet.c
 crypto/param_build.c
 crypto/param_build_set.c
 crypto/params.c
 crypto/params_dup.c
 crypto/params_from_text.c
-crypto/params_idx.c.in
 crypto/ppccap.c
 crypto/ppccpuid.pl
 crypto/property/defn_cache.c
@@ -350,6 +361,7 @@ crypto/sha/asm/keccak1600-ppc64.pl
 crypto/sha/asm/keccak1600-s390x.pl
 crypto/sha/asm/keccak1600-x86_64.pl
 crypto/sha/asm/keccak1600p8-ppc.pl
+crypto/sha/asm/keccak1600x4-avx512vl.pl
 crypto/sha/asm/sha1-586.pl
 crypto/sha/asm/sha1-alpha.pl
 crypto/sha/asm/sha1-armv4-large.pl
@@ -368,16 +380,20 @@ crypto/sha/asm/sha1-x86_64.pl
 crypto/sha/asm/sha256-586.pl
 crypto/sha/asm/sha256-armv4.pl
 crypto/sha/asm/sha256-c64xplus.pl
+crypto/sha/asm/sha256-loongarch64.pl
 crypto/sha/asm/sha256-mb-x86_64.pl
+crypto/sha/asm/sha256-riscv64-zbb.pl
 crypto/sha/asm/sha256-riscv64-zvkb-zvknha_or_zvknhb.pl
 crypto/sha/asm/sha512-586.pl
 crypto/sha/asm/sha512-armv4.pl
 crypto/sha/asm/sha512-armv8.pl
 crypto/sha/asm/sha512-c64xplus.pl
 crypto/sha/asm/sha512-ia64.pl
+crypto/sha/asm/sha512-loongarch64.pl
 crypto/sha/asm/sha512-mips.pl
 crypto/sha/asm/sha512-parisc.pl
 crypto/sha/asm/sha512-ppc.pl
+crypto/sha/asm/sha512-riscv64-zbb.pl
 crypto/sha/asm/sha512-riscv64-zvkb-zvknhb.pl
 crypto/sha/asm/sha512-s390x.pl
 crypto/sha/asm/sha512-sparcv9.pl
@@ -387,6 +403,8 @@ crypto/sha/keccak1600.c
 crypto/sha/sha1dgst.c
 crypto/sha/sha256.c
 crypto/sha/sha3.c
+crypto/sha/sha3_encode.c
+crypto/sha/sha3_x4_avx512vl.c
 crypto/sha/sha512.c
 crypto/sha/sha_local.h
 crypto/slh_dsa/slh_adrs.c
@@ -414,6 +432,7 @@ crypto/thread/arch/thread_none.c
 crypto/thread/arch/thread_posix.c
 crypto/thread/arch/thread_win.c
 crypto/thread/internal.c
+crypto/threads_common.c
 crypto/threads_lib.c
 crypto/threads_none.c
 crypto/threads_pthread.c
@@ -425,7 +444,6 @@ include/crypto/aes_platform.h
 include/crypto/asn1.h
 include/crypto/asn1_dsa.h
 include/crypto/bn.h
-include/crypto/bn_conf.h.in
 include/crypto/bn_dh.h
 include/crypto/cmac.h
 include/crypto/context.h
@@ -436,16 +454,18 @@ include/crypto/des_platform.h
 include/crypto/dh.h
 include/crypto/dsa.h
 include/crypto/ec.h
+include/crypto/ec_params.h.in
 include/crypto/ecx.h
 include/crypto/evp.h
 include/crypto/lhash.h
-include/crypto/md32_common.h
+include/crypto/md32_common.inc
 include/crypto/ml_dsa.h
 include/crypto/ml_kem.h
 include/crypto/modes.h
 include/crypto/rand.h
 include/crypto/rand_pool.h
 include/crypto/rsa.h
+include/crypto/rsa_params.h.in
 include/crypto/security_bits.h
 include/crypto/sha.h
 include/crypto/slh_dsa.h
@@ -453,6 +473,7 @@ include/crypto/sparse_array.h
 include/crypto/types.h
 include/internal/bio.h
 include/internal/common.h
+include/internal/conf.h
 include/internal/constant_time.h
 include/internal/core.h
 include/internal/cryptlib.h
@@ -460,7 +481,6 @@ include/internal/deprecated.h
 include/internal/der.h
 include/internal/deterministic_nonce.h
 include/internal/dso.h
-include/internal/dsoerr.h
 include/internal/e_os.h
 include/internal/e_winsock.h
 include/internal/encoder.h
@@ -469,15 +489,15 @@ include/internal/ffc.h
 include/internal/fips.h
 include/internal/hashfunc.h
 include/internal/hashtable.h
+include/internal/list.h
+include/internal/mem_alloc_utils.h
 include/internal/namemap.h
 include/internal/nelem.h
 include/internal/numbers.h
 include/internal/packet.h
 include/internal/param_build_set.h
-include/internal/param_names.h.in
 include/internal/params.h
 include/internal/property.h
-include/internal/propertyerr.h
 include/internal/provider.h
 include/internal/rcu.h
 include/internal/refcount.h
@@ -490,56 +510,40 @@ include/internal/symhacks.h
 include/internal/thread.h
 include/internal/thread_arch.h
 include/internal/thread_once.h
+include/internal/threads_common.h
 include/internal/time.h
 include/internal/tlsgroups.h
+include/internal/tlssigalgs.h
 include/internal/to_hex.h
 include/internal/tsan_assist.h
+include/internal/zeroization.h
 include/openssl/aes.h
 include/openssl/asn1.h.in
-include/openssl/asn1err.h
 include/openssl/asn1t.h.in
-include/openssl/async.h
-include/openssl/asyncerr.h
 include/openssl/bio.h.in
-include/openssl/bioerr.h
 include/openssl/bn.h
-include/openssl/bnerr.h
 include/openssl/buffer.h
-include/openssl/buffererr.h
 include/openssl/byteorder.h
 include/openssl/cmac.h
-include/openssl/comp.h.in
-include/openssl/comperr.h
+include/openssl/cms.h.in
 include/openssl/conf.h.in
-include/openssl/conferr.h
 include/openssl/configuration.h.in
 include/openssl/conftypes.h
 include/openssl/core.h
 include/openssl/core_dispatch.h
 include/openssl/core_names.h.in
 include/openssl/crypto.h.in
-include/openssl/cryptoerr.h
 include/openssl/cryptoerr_legacy.h
-include/openssl/ct.h.in
-include/openssl/cterr.h
 include/openssl/decoder.h
-include/openssl/decodererr.h
 include/openssl/des.h
 include/openssl/dh.h
-include/openssl/dherr.h
 include/openssl/dsa.h
-include/openssl/dsaerr.h
-include/openssl/dtls1.h
 include/openssl/e_os2.h
-include/openssl/e_ostime.h
 include/openssl/ebcdic.h
 include/openssl/ec.h
-include/openssl/ecerr.h
 include/openssl/encoder.h
-include/openssl/encodererr.h
 include/openssl/err.h.in
 include/openssl/evp.h
-include/openssl/evperr.h
 include/openssl/fips_names.h
 include/openssl/fipskey.h.in
 include/openssl/hmac.h
@@ -550,43 +554,27 @@ include/openssl/lhash.h.in
 include/openssl/macros.h
 include/openssl/ml_kem.h
 include/openssl/modes.h
-include/openssl/obj_mac.h
 include/openssl/objects.h
-include/openssl/objectserr.h
 include/openssl/opensslconf.h
 include/openssl/opensslv.h.in
 include/openssl/param_build.h
 include/openssl/params.h
-include/openssl/pem.h
-include/openssl/pemerr.h
 include/openssl/pkcs7.h.in
-include/openssl/pkcs7err.h
 include/openssl/prov_ssl.h
-include/openssl/proverr.h
 include/openssl/provider.h
-include/openssl/quic.h
 include/openssl/rand.h
-include/openssl/randerr.h
 include/openssl/rsa.h
-include/openssl/rsaerr.h
 include/openssl/safestack.h.in
 include/openssl/self_test.h
 include/openssl/sha.h
-include/openssl/srtp.h
-include/openssl/ssl.h.in
-include/openssl/ssl2.h
-include/openssl/ssl3.h
-include/openssl/sslerr.h
-include/openssl/sslerr_legacy.h
 include/openssl/stack.h
 include/openssl/symhacks.h
 include/openssl/thread.h
-include/openssl/tls1.h
 include/openssl/trace.h
 include/openssl/types.h
 include/openssl/x509.h.in
 include/openssl/x509_vfy.h.in
-include/openssl/x509err.h
+include/openssl/x509v3.h.in
 providers/common/bio_prov.c
 providers/common/capabilities.c
 providers/common/der/der_digests_gen.c.in
@@ -598,6 +586,7 @@ providers/common/der/der_ec_key.c
 providers/common/der/der_ec_sig.c
 providers/common/der/der_ecx_gen.c.in
 providers/common/der/der_ecx_key.c
+providers/common/der/der_hkdf_gen.c.in
 providers/common/der/der_ml_dsa_gen.c.in
 providers/common/der/der_ml_dsa_key.c
 providers/common/der/der_rsa_gen.c.in
@@ -612,85 +601,112 @@ providers/common/include/prov/der_digests.h.in
 providers/common/include/prov/der_dsa.h.in
 providers/common/include/prov/der_ec.h.in
 providers/common/include/prov/der_ecx.h.in
+providers/common/include/prov/der_hkdf.h.in
 providers/common/include/prov/der_ml_dsa.h.in
+providers/common/include/prov/der_pq_dsa.h
 providers/common/include/prov/der_rsa.h.in
 providers/common/include/prov/der_slh_dsa.h.in
 providers/common/include/prov/der_wrap.h.in
-providers/common/include/prov/proverr.h
 providers/common/include/prov/provider_ctx.h
 providers/common/include/prov/provider_util.h
 providers/common/include/prov/providercommon.h
 providers/common/include/prov/securitycheck.h
 providers/common/provider_ctx.c
-providers/common/provider_err.c
 providers/common/provider_seeding.c
 providers/common/provider_util.c
 providers/common/securitycheck.c
 providers/common/securitycheck_fips.c
 providers/fips/fips_entry.c
 providers/fips/fipsindicator.c
+providers/fips/fipsparams.inc.in
 providers/fips/fipsprov.c
 providers/fips/include/fips/fipsindicator.h
-providers/fips/include/fips_indicator_params.inc
-providers/fips/include/fips_selftest_params.inc
 providers/fips/include/fipscommon.h
 providers/fips/self_test.c
 providers/fips/self_test.h
-providers/fips/self_test_data.inc
+providers/fips/self_test_data.c
 providers/fips/self_test_kats.c
 providers/implementations/asymciphers/rsa_enc.c
+providers/implementations/asymciphers/rsa_enc.inc.in
 providers/implementations/ciphers/cipher_aes.c
 providers/implementations/ciphers/cipher_aes.h
 providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
 providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.h
+providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc.in
+providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_etm_hw.c
 providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c
+providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_etm_hw.c
 providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c
+providers/implementations/ciphers/cipher_aes_cbc_hmac_sha512_etm_hw.c
+providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.c
+providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.h
 providers/implementations/ciphers/cipher_aes_ccm.c
 providers/implementations/ciphers/cipher_aes_ccm.h
 providers/implementations/ciphers/cipher_aes_ccm_hw.c
-providers/implementations/ciphers/cipher_aes_ccm_hw_aesni.inc
-providers/implementations/ciphers/cipher_aes_cts.inc
 providers/implementations/ciphers/cipher_aes_gcm.c
 providers/implementations/ciphers/cipher_aes_gcm.h
 providers/implementations/ciphers/cipher_aes_gcm_hw.c
-providers/implementations/ciphers/cipher_aes_gcm_hw_aesni.inc
-providers/implementations/ciphers/cipher_aes_gcm_hw_vaes_avx512.inc
+providers/implementations/ciphers/cipher_aes_gcm_hw_ppc.c
 providers/implementations/ciphers/cipher_aes_hw.c
-providers/implementations/ciphers/cipher_aes_hw_aesni.inc
+providers/implementations/ciphers/cipher_aes_hw_aesni.c
+providers/implementations/ciphers/cipher_aes_hw_armv8.c
+providers/implementations/ciphers/cipher_aes_hw_rv32i.c
+providers/implementations/ciphers/cipher_aes_hw_rv64i.c
+providers/implementations/ciphers/cipher_aes_hw_s390x.c
+providers/implementations/ciphers/cipher_aes_hw_t4.c
 providers/implementations/ciphers/cipher_aes_ocb.c
 providers/implementations/ciphers/cipher_aes_ocb.h
+providers/implementations/ciphers/cipher_aes_ocb.inc.in
 providers/implementations/ciphers/cipher_aes_ocb_hw.c
 providers/implementations/ciphers/cipher_aes_wrp.c
+providers/implementations/ciphers/cipher_aes_wrp.inc.in
 providers/implementations/ciphers/cipher_aes_xts.c
 providers/implementations/ciphers/cipher_aes_xts.h
+providers/implementations/ciphers/cipher_aes_xts.inc.in
 providers/implementations/ciphers/cipher_aes_xts_fips.c
 providers/implementations/ciphers/cipher_aes_xts_hw.c
 providers/implementations/ciphers/cipher_cts.c
 providers/implementations/ciphers/cipher_cts.h
+providers/implementations/ciphers/cipher_cts.inc.in
 providers/implementations/ciphers/cipher_tdes.c
 providers/implementations/ciphers/cipher_tdes.h
+providers/implementations/ciphers/cipher_tdes.inc.in
 providers/implementations/ciphers/cipher_tdes_common.c
 providers/implementations/ciphers/cipher_tdes_hw.c
 providers/implementations/ciphers/ciphercommon.c
+providers/implementations/ciphers/ciphercommon.inc.in
 providers/implementations/ciphers/ciphercommon_block.c
 providers/implementations/ciphers/ciphercommon_ccm.c
+providers/implementations/ciphers/ciphercommon_ccm.inc.in
 providers/implementations/ciphers/ciphercommon_ccm_hw.c
 providers/implementations/ciphers/ciphercommon_gcm.c
+providers/implementations/ciphers/ciphercommon_gcm.inc.in
 providers/implementations/ciphers/ciphercommon_gcm_hw.c
 providers/implementations/ciphers/ciphercommon_hw.c
 providers/implementations/ciphers/ciphercommon_local.h
+providers/implementations/digests/cshake_prov.c
+providers/implementations/digests/cshake_prov.inc.in
 providers/implementations/digests/digestcommon.c
+providers/implementations/digests/digestcommon.inc.in
+providers/implementations/digests/ml_dsa_mu_prov.c
+providers/implementations/digests/ml_dsa_mu_prov.inc.in
 providers/implementations/digests/sha2_prov.c
+providers/implementations/digests/sha2_prov.inc.in
 providers/implementations/digests/sha3_prov.c
+providers/implementations/digests/sha3_prov.inc.in
 providers/implementations/exchange/dh_exch.c
+providers/implementations/exchange/dh_exch.inc.in
 providers/implementations/exchange/ecdh_exch.c
+providers/implementations/exchange/ecdh_exch.inc.in
 providers/implementations/exchange/ecx_exch.c
+providers/implementations/exchange/ecx_exch.inc.in
 providers/implementations/exchange/kdf_exch.c
 providers/implementations/include/prov/ciphercommon.h
 providers/implementations/include/prov/ciphercommon_aead.h
 providers/implementations/include/prov/ciphercommon_ccm.h
 providers/implementations/include/prov/ciphercommon_gcm.h
 providers/implementations/include/prov/digestcommon.h
+providers/implementations/include/prov/drbg.h
 providers/implementations/include/prov/ecx.h
 providers/implementations/include/prov/hmac_drbg.h
 providers/implementations/include/prov/implementations.h
@@ -701,50 +717,92 @@ providers/implementations/include/prov/ml_kem.h
 providers/implementations/include/prov/mlx_kem.h
 providers/implementations/include/prov/names.h
 providers/implementations/include/prov/seeding.h
+providers/implementations/include/prov/skeymgmt_lcl.h
 providers/implementations/kdfs/hkdf.c
+providers/implementations/kdfs/hkdf.inc.in
+providers/implementations/kdfs/hmacdrbg_kdf.c
+providers/implementations/kdfs/hmacdrbg_kdf.inc.in
+providers/implementations/kdfs/ikev2kdf.c
+providers/implementations/kdfs/ikev2kdf.inc.in
 providers/implementations/kdfs/kbkdf.c
+providers/implementations/kdfs/kbkdf.inc.in
 providers/implementations/kdfs/pbkdf2.c
-providers/implementations/kdfs/pbkdf2.h
-providers/implementations/kdfs/pbkdf2_fips.c
+providers/implementations/kdfs/pbkdf2.inc.in
+providers/implementations/kdfs/snmpkdf.c
+providers/implementations/kdfs/snmpkdf.inc.in
+providers/implementations/kdfs/srtpkdf.c
+providers/implementations/kdfs/srtpkdf.inc.in
 providers/implementations/kdfs/sshkdf.c
+providers/implementations/kdfs/sshkdf.inc.in
 providers/implementations/kdfs/sskdf.c
+providers/implementations/kdfs/sskdf.inc.in
 providers/implementations/kdfs/tls1_prf.c
+providers/implementations/kdfs/tls1_prf.inc.in
 providers/implementations/kdfs/x942kdf.c
+providers/implementations/kdfs/x942kdf.inc.in
+providers/implementations/kdfs/x963kdf.inc.in
 providers/implementations/kem/ml_kem_kem.c
+providers/implementations/kem/ml_kem_kem.inc.in
 providers/implementations/kem/mlx_kem.c
+providers/implementations/kem/mlx_kem.inc.in
 providers/implementations/kem/rsa_kem.c
+providers/implementations/kem/rsa_kem.inc.in
 providers/implementations/keymgmt/dh_kmgmt.c
+providers/implementations/keymgmt/dh_kmgmt.inc.in
 providers/implementations/keymgmt/dsa_kmgmt.c
+providers/implementations/keymgmt/dsa_kmgmt.inc.in
 providers/implementations/keymgmt/ec_kmgmt.c
-providers/implementations/keymgmt/ec_kmgmt_imexport.inc
 providers/implementations/keymgmt/ecx_kmgmt.c
+providers/implementations/keymgmt/ecx_kmgmt.inc.in
 providers/implementations/keymgmt/kdf_legacy_kmgmt.c
+providers/implementations/keymgmt/keymgmtcommon.inc.in
 providers/implementations/keymgmt/mac_legacy_kmgmt.c
+providers/implementations/keymgmt/mac_legacy_kmgmt.inc.in
 providers/implementations/keymgmt/ml_dsa_kmgmt.c
+providers/implementations/keymgmt/ml_dsa_kmgmt.inc.in
 providers/implementations/keymgmt/ml_kem_kmgmt.c
+providers/implementations/keymgmt/ml_kem_kmgmt.inc.in
 providers/implementations/keymgmt/mlx_kmgmt.c
+providers/implementations/keymgmt/mlx_kmgmt.inc.in
 providers/implementations/keymgmt/rsa_kmgmt.c
 providers/implementations/keymgmt/slh_dsa_kmgmt.c
+providers/implementations/keymgmt/slh_dsa_kmgmt.inc.in
 providers/implementations/macs/cmac_prov.c
+providers/implementations/macs/cmac_prov.inc.in
 providers/implementations/macs/gmac_prov.c
+providers/implementations/macs/gmac_prov.inc.in
 providers/implementations/macs/hmac_prov.c
+providers/implementations/macs/hmac_prov.inc.in
 providers/implementations/macs/kmac_prov.c
+providers/implementations/macs/kmac_prov.inc.in
 providers/implementations/rands/drbg.c
 providers/implementations/rands/drbg_ctr.c
+providers/implementations/rands/drbg_ctr.inc.in
 providers/implementations/rands/drbg_hash.c
+providers/implementations/rands/drbg_hash.inc.in
 providers/implementations/rands/drbg_hmac.c
-providers/implementations/rands/drbg_local.h
+providers/implementations/rands/drbg_hmac.inc.in
 providers/implementations/rands/fips_crng_test.c
+providers/implementations/rands/fips_crng_test.inc.in
 providers/implementations/rands/test_rng.c
+providers/implementations/rands/test_rng.inc.in
 providers/implementations/signature/dsa_sig.c
+providers/implementations/signature/dsa_sig.inc.in
 providers/implementations/signature/ecdsa_sig.c
+providers/implementations/signature/ecdsa_sig.inc.in
 providers/implementations/signature/eddsa_sig.c
+providers/implementations/signature/eddsa_sig.inc.in
 providers/implementations/signature/mac_legacy_sig.c
+providers/implementations/signature/mac_legacy_sig.inc.in
 providers/implementations/signature/ml_dsa_sig.c
+providers/implementations/signature/ml_dsa_sig.inc.in
 providers/implementations/signature/rsa_sig.c
+providers/implementations/signature/rsa_sig.inc.in
 providers/implementations/signature/slh_dsa_sig.c
+providers/implementations/signature/slh_dsa_sig.inc.in
 providers/implementations/skeymgmt/aes_skmgmt.c
 providers/implementations/skeymgmt/generic.c
-providers/implementations/skeymgmt/skeymgmt_lcl.h
+providers/implementations/skeymgmt/generic.inc.in
 ssl/record/methods/ssl3_cbc.c
 ssl/record/methods/tls_pad.c
+util/mkerr.pl
diff --git a/deps/openssl/openssl/providers/fips/build.info b/deps/openssl/openssl/providers/fips/build.info
index 9756ad3f792..895c5e9d990 100644
--- a/deps/openssl/openssl/providers/fips/build.info
+++ b/deps/openssl/openssl/providers/fips/build.info
@@ -1,6 +1,10 @@
 # We include the provider implementation into ../libfips.a, so that all
 # platforms can resolve symbols in other members of that library.
-SOURCE[../libfips.a]=fipsprov.c self_test.c self_test_kats.c fipsindicator.c
+SOURCE[../libfips.a]=fipsprov.c self_test.c self_test_data.c self_test_kats.c fipsindicator.c

 # It is necessary to have an explicit entry point
 SOURCE[../fips]=fips_entry.c
+
+DEPEND[]=fipsparams.inc
+DEPEND[fipsparams.inc]=../../util/perl|OpenSSL/fipsparams.pm
+GENERATE[fipsparams.inc]=fipsparams.inc.in
diff --git a/deps/openssl/openssl/providers/fips/fipsindicator.c b/deps/openssl/openssl/providers/fips/fipsindicator.c
index 8aba61a007c..0c2949775db 100644
--- a/deps/openssl/openssl/providers/fips/fipsindicator.c
+++ b/deps/openssl/openssl/providers/fips/fipsindicator.c
@@ -58,7 +58,7 @@ int ossl_FIPS_IND_get_settable(const OSSL_FIPS_IND *ind, int id)
 int ossl_FIPS_IND_on_unapproved(OSSL_FIPS_IND *ind, int id,
     OSSL_LIB_CTX *libctx,
     const char *algname, const char *opname,
-    OSSL_FIPS_IND_CHECK_CB *config_check_fn)
+    enum fips_config_id config_id)
 {
     /* Set to unapproved. Once unapproved mode is set this will not be reset */
     ind->approved = 0;
@@ -69,19 +69,16 @@ int ossl_FIPS_IND_on_unapproved(OSSL_FIPS_IND *ind, int id,
      * assumed to be strict.
      */
     if (ossl_FIPS_IND_get_settable(ind, id) == OSSL_FIPS_IND_STATE_TOLERANT
-        || (config_check_fn != NULL
-            && config_check_fn(libctx) == OSSL_FIPS_IND_STATE_TOLERANT)) {
+        || (ossl_fips_config(libctx, config_id) == OSSL_FIPS_IND_STATE_TOLERANT)) {
         return ossl_FIPS_IND_callback(libctx, algname, opname);
     }
     /* Strict mode gets here: This returns an error */
     return 0;
 }

-int ossl_FIPS_IND_set_ctx_param(OSSL_FIPS_IND *ind, int id,
-    const OSSL_PARAM params[], const char *name)
+int ossl_FIPS_IND_set_ctx_param(OSSL_FIPS_IND *ind, int id, const OSSL_PARAM *p)
 {
     int in = 0;
-    const OSSL_PARAM *p = OSSL_PARAM_locate_const(params, name);

     if (p != NULL) {
         if (!OSSL_PARAM_get_int(p, &in))
@@ -91,40 +88,34 @@ int ossl_FIPS_IND_set_ctx_param(OSSL_FIPS_IND *ind, int id,
     return 1;
 }

-int ossl_FIPS_IND_get_ctx_param(const OSSL_FIPS_IND *ind, OSSL_PARAM params[])
+int ossl_FIPS_IND_set_ctx_param_locate(OSSL_FIPS_IND *ind, int id,
+    const OSSL_PARAM params[],
+    const char *name)
 {
-    OSSL_PARAM *p = OSSL_PARAM_locate(params, OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR);
+    const OSSL_PARAM *p = OSSL_PARAM_locate_const(params, name);

-    return p == NULL || OSSL_PARAM_set_int(p, ind->approved);
+    return ossl_FIPS_IND_set_ctx_param(ind, id, p);
 }

-int ossl_FIPS_IND_get_ctx_param_conditional(const OSSL_FIPS_IND *ind,
-    OSSL_PARAM params[], int condition)
+int ossl_FIPS_IND_get_ctx_param(const OSSL_FIPS_IND *ind, OSSL_PARAM *p)
 {
-    OSSL_PARAM *p = OSSL_PARAM_locate(params,
-        OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR);
-
-    return p == NULL || OSSL_PARAM_set_int(p, condition && (ind == NULL || ind->approved));
+    return p == NULL || OSSL_PARAM_set_int(p, ind->approved);
 }

-const OSSL_PARAM *ossl_FIPS_IND_gettable_ctx_params(ossl_unused void *ctx,
-    ossl_unused void *provctx)
+int ossl_FIPS_IND_get_ctx_param_conditional(const OSSL_FIPS_IND *ind,
+    OSSL_PARAM *p, int condition)
 {
-    static const OSSL_PARAM gettable_ctx_params[] = {
-        OSSL_PARAM_int(OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR, NULL),
-        OSSL_PARAM_END
-    };
-
-    return gettable_ctx_params;
+    return p == NULL
+        || OSSL_PARAM_set_int(p,
+            condition && (ind == NULL || ind->approved));
 }

-int ossl_FIPS_IND_get_ctx_param_approved(ossl_unused void *ctx,
+int ossl_FIPS_IND_get_ctx_param_locate(const OSSL_FIPS_IND *ind,
     OSSL_PARAM params[])
 {
-    OSSL_PARAM *p = OSSL_PARAM_locate(params,
-        OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR);
+    OSSL_PARAM *p = OSSL_PARAM_locate(params, OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR);

-    return p == NULL || OSSL_PARAM_set_int(p, 1);
+    return p == NULL || ossl_FIPS_IND_get_ctx_param(ind, p);
 }

 /*
diff --git a/deps/openssl/openssl/providers/fips/fipsparams.inc.in b/deps/openssl/openssl/providers/fips/fipsparams.inc.in
new file mode 100644
index 00000000000..e898c93ee4f
--- /dev/null
+++ b/deps/openssl/openssl/providers/fips/fipsparams.inc.in
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * Handles the loading of FIPS algorithm conditional options from a config file
+ * passed from the core using OSSL_PARAM.
+ *
+ * The perl function produce_fips_params() generates code that:
+ * - Defines the FIPS_PARAMS structure with fields for each item.
+ * - Creates a function init_fips_params() to initialize the structure with default values.
+ * - Creates a function fips_get_params_from_core() to retrieve values from the core.
+ * - Defines a macro OSSL_FIPS_PARAMS_DEFN_TYPES listing the parameters.
+ * - Creates a function return_fips_params() to return values to the core.
+ * - Creates accessor functions for parameters marked as 'indicator'.
+ *
+ * The fields of the table below are:
+ * 1. field:       The name of the field in the FIPS_PARAMS structure.
+ * 2. name:        The OSSL_PARAM name used to identify the parameter.
+ * 3. type:        The C type of the field (e.g., "unsigned char" or "const char *").
+ * 4. default:     The default value for the field.
+ * 5. description: A tag indicating usage. If set to 'indicator', an accessor function
+ *                 ossl_fips_config_<field>() is generated.
+ */
+{- use OpenSSL::fipsparams qw(produce_fips_params); -}
+{- produce_fips_params(
+        [ 'security_checks', 'SECURITY_CHECKS', 'unsigned char', '1', 'indicator' ],
+        [ 'tls1_prf_ems_check', 'TLS1_PRF_EMS_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'no_short_mac', 'NO_SHORT_MAC', 'unsigned char', '1', 'indicator' ],
+        [ 'hmac_key_check', 'HMAC_KEY_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'kmac_key_check', 'KMAC_KEY_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'restricted_drbg_digests', 'DRBG_TRUNC_DIGEST', 'unsigned char', '0', 'indicator' ],
+        [ 'signature_digest_check', 'SIGNATURE_DIGEST_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'hkdf_digest_check', 'HKDF_DIGEST_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'tls13_kdf_digest_check', 'TLS13_KDF_DIGEST_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'tls1_prf_digest_check', 'TLS1_PRF_DIGEST_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'sshkdf_digest_check', 'SSHKDF_DIGEST_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'sskdf_digest_check', 'SSKDF_DIGEST_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'x963kdf_digest_check', 'X963KDF_DIGEST_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'dsa_sign_disallowed', 'DSA_SIGN_DISABLED', 'unsigned char', '0', 'indicator' ],
+        [ 'tdes_encrypt_disallowed', 'TDES_ENCRYPT_DISABLED', 'unsigned char', '0', 'indicator' ],
+        [ 'rsa_pkcs15_padding_disabled', 'RSA_PKCS15_PAD_DISABLED', 'unsigned char', '0', 'indicator' ],
+        [ 'rsa_pss_saltlen_check', 'RSA_PSS_SALTLEN_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'rsa_sign_x931_disallowed', 'RSA_SIGN_X931_PAD_DISABLED', 'unsigned char', '0', 'indicator' ],
+        [ 'hkdf_key_check', 'HKDF_KEY_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'kbkdf_key_check', 'KBKDF_KEY_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'tls13_kdf_key_check', 'TLS13_KDF_KEY_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'tls1_prf_key_check', 'TLS1_PRF_KEY_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'sshkdf_key_check', 'SSHKDF_KEY_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'sskdf_key_check', 'SSKDF_KEY_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'x963kdf_key_check', 'X963KDF_KEY_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'x942kdf_key_check', 'X942KDF_KEY_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'pbkdf2_lower_bound_check', 'PBKDF2_LOWER_BOUND_CHECK', 'unsigned char', '1', 'indicator' ],
+        [ 'ecdh_cofactor_check', 'ECDH_COFACTOR_CHECK', 'unsigned char', '0', 'indicator' ],
+        [ 'module_filename', 'OSSL_PROV_PARAM_CORE_MODULE_FILENAME', 'const char *', 'NULL', 'selftest' ],
+        [ 'module_checksum_data', 'OSSL_PROV_FIPS_PARAM_MODULE_MAC', 'const char *', 'NULL', 'selftest' ],
+        [ 'conditional_error_check', 'OSSL_PROV_FIPS_PARAM_CONDITIONAL_ERRORS', 'unsigned char', '1', 'selftest' ],
+        [ 'defer_tests', 'OSSL_PROV_FIPS_PARAM_DEFER_TESTS', 'unsigned char', '0', 'selftest' ]) -}
diff --git a/deps/openssl/openssl/providers/fips/fipsprov.c b/deps/openssl/openssl/providers/fips/fipsprov.c
index 3c749018bcf..b07c5c7607e 100644
--- a/deps/openssl/openssl/providers/fips/fipsprov.c
+++ b/deps/openssl/openssl/providers/fips/fipsprov.c
@@ -16,6 +16,7 @@
 #include <openssl/rand.h> /* RAND_get0_public() */
 #include <openssl/proverr.h>
 #include <openssl/indicator.h>
+#include <openssl/self_test.h>
 #include "internal/cryptlib.h"
 #include "internal/provider.h"
 #include "prov/implementations.h"
@@ -29,6 +30,10 @@
 #include "crypto/context.h"
 #include "fipscommon.h"
 #include "internal/core.h"
+#include "internal/fips.h"
+#include "internal/mem_alloc_utils.h"
+#include "internal/thread_once.h"
+#include "internal/threads_common.h"

 static const char FIPS_DEFAULT_PROPERTIES[] = "provider=fips,fips=yes";
 static const char FIPS_UNAPPROVED_PROPERTIES[] = "provider=fips,fips=no";
@@ -44,8 +49,10 @@ static OSSL_FUNC_provider_query_operation_fn fips_query;
 static OSSL_FUNC_provider_query_operation_fn fips_query_internal;
 static OSSL_FUNC_provider_random_bytes_fn fips_random_bytes;

-#define ALGC(NAMES, FUNC, CHECK) \
-    { { NAMES, FIPS_DEFAULT_PROPERTIES, FUNC }, CHECK }
+#define ALGC(NAMES, FUNC, CHECK)                        \
+    {                                                   \
+        { NAMES, FIPS_DEFAULT_PROPERTIES, FUNC }, CHECK \
+    }
 #define ALG(NAMES, FUNC) ALGC(NAMES, FUNC, NULL)

 extern OSSL_FUNC_core_thread_start_fn *c_thread_start;
@@ -81,26 +88,22 @@ static OSSL_FUNC_self_test_cb_fn *c_stcbfn = NULL;
 static OSSL_FUNC_indicator_cb_fn *c_indcbfn = NULL;
 static OSSL_FUNC_core_get_libctx_fn *c_get_libctx = NULL;

-typedef struct {
-    const char *option;
-    unsigned char enabled;
-} FIPS_OPTION;
+#include "providers/fips/fipsparams.inc"

 typedef struct fips_global_st {
     const OSSL_CORE_HANDLE *handle;
     SELF_TEST_POST_PARAMS selftest_params;

-#define OSSL_FIPS_PARAM(structname, paramname, initvalue) \
-    FIPS_OPTION fips_##structname;
-#include "fips_indicator_params.inc"
-#undef OSSL_FIPS_PARAM
+    FIPS_PARAMS fips_params;
+
+    /* Guards access to deferred self-test */
+    CRYPTO_RWLOCK *deferred_lock;

 } FIPS_GLOBAL;

-static void init_fips_option(FIPS_OPTION *opt, int enabled)
+static ossl_inline FIPS_PARAMS *get_fips_params(FIPS_GLOBAL *fgbl)
 {
-    opt->enabled = enabled;
-    opt->option = enabled ? "1" : "0";
+    return &fgbl->fips_params;
 }

 void *ossl_fips_prov_ossl_ctx_new(OSSL_LIB_CTX *libctx)
@@ -110,16 +113,15 @@ void *ossl_fips_prov_ossl_ctx_new(OSSL_LIB_CTX *libctx)
     if (fgbl == NULL)
         return NULL;

-#define OSSL_FIPS_PARAM(structname, paramname, initvalue) \
-    init_fips_option(&fgbl->fips_##structname, initvalue);
-#include "fips_indicator_params.inc"
-#undef OSSL_FIPS_PARAM
+    init_fips_params(&fgbl->fips_params);

     return fgbl;
 }

 void ossl_fips_prov_ossl_ctx_free(void *fgbl)
 {
+    if (((FIPS_GLOBAL *)fgbl)->deferred_lock)
+        CRYPTO_THREAD_lock_free(((FIPS_GLOBAL *)fgbl)->deferred_lock);
     OPENSSL_free(fgbl);
 }

@@ -137,43 +139,6 @@ static int fips_random_bytes(ossl_unused void *vprov, int which,
     return RAND_bytes_ex(libctx, buf, n, strength);
 }

-/*
- * Parameters to retrieve from the core provider
- * NOTE: inside core_get_params() these will be loaded from config items
- * stored inside prov->parameters
- */
-static int fips_get_params_from_core(FIPS_GLOBAL *fgbl)
-{
-    OSSL_PARAM core_params[32], *p = core_params;
-
-#define OSSL_FIPS_PARAM(structname, paramname)                 \
-    *p++ = OSSL_PARAM_construct_utf8_ptr(                      \
-        paramname, (char **)&fgbl->selftest_params.structname, \
-        sizeof(fgbl->selftest_params.structname));
-
-/* Parameters required for self testing */
-#include "fips_selftest_params.inc"
-#undef OSSL_FIPS_PARAM
-
-/* FIPS indicator options can be enabled or disabled independently */
-#define OSSL_FIPS_PARAM(structname, paramname, initvalue) \
-    *p++ = OSSL_PARAM_construct_utf8_ptr(                 \
-        OSSL_PROV_PARAM_##paramname,                      \
-        (char **)&fgbl->fips_##structname.option,         \
-        sizeof(fgbl->fips_##structname.option));
-#include "fips_indicator_params.inc"
-#undef OSSL_FIPS_PARAM
-
-    *p = OSSL_PARAM_construct_end();
-
-    if (!c_get_params(fgbl->handle, core_params)) {
-        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
-        return 0;
-    }
-
-    return 1;
-}
-
 static const OSSL_PARAM *fips_gettable_params(void *provctx)
 {
     /* Parameters we provide to the core */
@@ -182,12 +147,7 @@ static const OSSL_PARAM *fips_gettable_params(void *provctx)
         OSSL_PARAM_DEFN(OSSL_PROV_PARAM_VERSION, OSSL_PARAM_UTF8_PTR, NULL, 0),
         OSSL_PARAM_DEFN(OSSL_PROV_PARAM_BUILDINFO, OSSL_PARAM_UTF8_PTR, NULL, 0),
         OSSL_PARAM_DEFN(OSSL_PROV_PARAM_STATUS, OSSL_PARAM_INTEGER, NULL, 0),
-
-#define OSSL_FIPS_PARAM(structname, paramname, initvalue) \
-    OSSL_PARAM_DEFN(OSSL_PROV_PARAM_##paramname, OSSL_PARAM_INTEGER, NULL, 0),
-#include "fips_indicator_params.inc"
-#undef OSSL_FIPS_PARAM
-
+        OSSL_FIPS_PARAMS_DEFN_TYPES,
         OSSL_PARAM_END
     };
     return fips_param_types;
@@ -212,14 +172,7 @@ static int fips_get_params(void *provctx, OSSL_PARAM params[])
     if (p != NULL && !OSSL_PARAM_set_int(p, ossl_prov_is_running()))
         return 0;

-#define OSSL_FIPS_PARAM(structname, paramname, initvalue)                     \
-    p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_##paramname);               \
-    if (p != NULL && !OSSL_PARAM_set_int(p, fgbl->fips_##structname.enabled)) \
-        return 0;
-#include "fips_indicator_params.inc"
-#undef OSSL_FIPS_PARAM
-
-    return 1;
+    return return_fips_params(params, &fgbl->fips_params);
 }

 static void set_self_test_cb(FIPS_GLOBAL *fgbl)
@@ -241,7 +194,7 @@ static int fips_self_test(void *provctx)
         OSSL_LIB_CTX_FIPS_PROV_INDEX);

     set_self_test_cb(fgbl);
-    return SELF_TEST_post(&fgbl->selftest_params, 1) ? 1 : 0;
+    return SELF_TEST_post(&fgbl->selftest_params, fgbl, 1) ? 1 : 0;
 }

 /*
@@ -268,35 +221,44 @@ static int fips_self_test(void *provctx)
  * NIST uses, or that are used for ASN.1 OBJECT IDENTIFIERs, or names
  * we have used historically.
  */
-static const OSSL_ALGORITHM fips_digests[] = {
-    /* Our primary name:NiST name[:our older names] */
-    { PROV_NAMES_SHA1, FIPS_DEFAULT_PROPERTIES, ossl_sha1_functions },
-    { PROV_NAMES_SHA2_224, FIPS_DEFAULT_PROPERTIES, ossl_sha224_functions },
-    { PROV_NAMES_SHA2_256, FIPS_DEFAULT_PROPERTIES, ossl_sha256_functions },
-    { PROV_NAMES_SHA2_384, FIPS_DEFAULT_PROPERTIES, ossl_sha384_functions },
-    { PROV_NAMES_SHA2_512, FIPS_DEFAULT_PROPERTIES, ossl_sha512_functions },
-    { PROV_NAMES_SHA2_512_224, FIPS_DEFAULT_PROPERTIES,
-        ossl_sha512_224_functions },
-    { PROV_NAMES_SHA2_512_256, FIPS_DEFAULT_PROPERTIES,
-        ossl_sha512_256_functions },
-
-    /* We agree with NIST here, so one name only */
-    { PROV_NAMES_SHA3_224, FIPS_DEFAULT_PROPERTIES, ossl_sha3_224_functions },
-    { PROV_NAMES_SHA3_256, FIPS_DEFAULT_PROPERTIES, ossl_sha3_256_functions },
-    { PROV_NAMES_SHA3_384, FIPS_DEFAULT_PROPERTIES, ossl_sha3_384_functions },
-    { PROV_NAMES_SHA3_512, FIPS_DEFAULT_PROPERTIES, ossl_sha3_512_functions },
-
-    { PROV_NAMES_SHAKE_128, FIPS_DEFAULT_PROPERTIES, ossl_shake_128_functions },
-    { PROV_NAMES_SHAKE_256, FIPS_DEFAULT_PROPERTIES, ossl_shake_256_functions },

-    /*
-     * KECCAK-KMAC-128 and KECCAK-KMAC-256 as hashes are mostly useful for
-     * KMAC128 and KMAC256.
-     */
-    { PROV_NAMES_KECCAK_KMAC_128, FIPS_DEFAULT_PROPERTIES,
-        ossl_keccak_kmac_128_functions },
-    { PROV_NAMES_KECCAK_KMAC_256, FIPS_DEFAULT_PROPERTIES,
-        ossl_keccak_kmac_256_functions },
+#define FIPS_DIGESTS_COMMON()                                                          \
+    { PROV_NAMES_SHA1, FIPS_DEFAULT_PROPERTIES, ossl_sha1_functions },                 \
+        { PROV_NAMES_SHA2_224, FIPS_DEFAULT_PROPERTIES, ossl_sha224_functions },       \
+        { PROV_NAMES_SHA2_256, FIPS_DEFAULT_PROPERTIES, ossl_sha256_functions },       \
+        { PROV_NAMES_SHA2_384, FIPS_DEFAULT_PROPERTIES, ossl_sha384_functions },       \
+        { PROV_NAMES_SHA2_512, FIPS_DEFAULT_PROPERTIES, ossl_sha512_functions },       \
+        { PROV_NAMES_SHA2_512_224, FIPS_DEFAULT_PROPERTIES,                            \
+            ossl_sha512_224_functions },                                               \
+        { PROV_NAMES_SHA2_512_256, FIPS_DEFAULT_PROPERTIES,                            \
+            ossl_sha512_256_functions },                                               \
+        { PROV_NAMES_SHA3_224, FIPS_DEFAULT_PROPERTIES, ossl_sha3_224_functions },     \
+        { PROV_NAMES_SHA3_256, FIPS_DEFAULT_PROPERTIES, ossl_sha3_256_functions },     \
+        { PROV_NAMES_SHA3_384, FIPS_DEFAULT_PROPERTIES, ossl_sha3_384_functions },     \
+        { PROV_NAMES_SHA3_512, FIPS_DEFAULT_PROPERTIES, ossl_sha3_512_functions },     \
+        { PROV_NAMES_SHAKE_128, FIPS_DEFAULT_PROPERTIES, ossl_shake_128_functions },   \
+        { PROV_NAMES_SHAKE_256, FIPS_DEFAULT_PROPERTIES, ossl_shake_256_functions },   \
+        { PROV_NAMES_CSHAKE_128, FIPS_DEFAULT_PROPERTIES, ossl_cshake_128_functions }, \
+    {                                                                                  \
+        PROV_NAMES_CSHAKE_256, FIPS_DEFAULT_PROPERTIES, ossl_cshake_256_functions      \
+    }
+
+static const OSSL_ALGORITHM fips_digests[] = {
+    FIPS_DIGESTS_COMMON(),
+#ifndef OPENSSL_NO_ML_DSA
+    { PROV_NAMES_ML_DSA_MU, FIPS_DEFAULT_PROPERTIES, ossl_ml_dsa_mu_functions },
+#endif
+    { NULL, NULL, NULL }
+};
+static const OSSL_ALGORITHM fips_digests_internal[] = {
+    FIPS_DIGESTS_COMMON(),
+    /* Used by LMS/HSS */
+    { PROV_NAMES_SHA2_256_192, FIPS_DEFAULT_PROPERTIES,
+        ossl_sha256_192_internal_functions },
+    { PROV_NAMES_CSHAKE_KECCAK_128, FIPS_DEFAULT_PROPERTIES,
+        ossl_cshake_keccak_128_functions },
+    { PROV_NAMES_CSHAKE_KECCAK_256, FIPS_DEFAULT_PROPERTIES,
+        ossl_cshake_keccak_256_functions },
     { NULL, NULL, NULL }
 };

@@ -354,6 +316,24 @@ static const OSSL_ALGORITHM_CAPABLE fips_ciphers[] = {
         ossl_cipher_capable_aes_cbc_hmac_sha256),
     ALGC(PROV_NAMES_AES_256_CBC_HMAC_SHA256, ossl_aes256cbc_hmac_sha256_functions,
         ossl_cipher_capable_aes_cbc_hmac_sha256),
+    ALGC(PROV_NAMES_AES_128_CBC_HMAC_SHA1_ETM, ossl_aes128cbc_hmac_sha1_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha1_etm),
+    ALGC(PROV_NAMES_AES_192_CBC_HMAC_SHA1_ETM, ossl_aes192cbc_hmac_sha1_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha1_etm),
+    ALGC(PROV_NAMES_AES_256_CBC_HMAC_SHA1_ETM, ossl_aes256cbc_hmac_sha1_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha1_etm),
+    ALGC(PROV_NAMES_AES_128_CBC_HMAC_SHA256_ETM, ossl_aes128cbc_hmac_sha256_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha256_etm),
+    ALGC(PROV_NAMES_AES_192_CBC_HMAC_SHA256_ETM, ossl_aes192cbc_hmac_sha256_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha256_etm),
+    ALGC(PROV_NAMES_AES_256_CBC_HMAC_SHA256_ETM, ossl_aes256cbc_hmac_sha256_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha256_etm),
+    ALGC(PROV_NAMES_AES_128_CBC_HMAC_SHA512_ETM, ossl_aes128cbc_hmac_sha512_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha512_etm),
+    ALGC(PROV_NAMES_AES_192_CBC_HMAC_SHA512_ETM, ossl_aes192cbc_hmac_sha512_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha512_etm),
+    ALGC(PROV_NAMES_AES_256_CBC_HMAC_SHA512_ETM, ossl_aes256cbc_hmac_sha512_etm_functions,
+        ossl_cipher_capable_aes_cbc_hmac_sha512_etm),
 #ifndef OPENSSL_NO_DES
     ALG(PROV_NAMES_DES_EDE3_ECB, ossl_tdes_ede3_ecb_functions),
     ALG(PROV_NAMES_DES_EDE3_CBC, ossl_tdes_ede3_cbc_functions),
@@ -383,20 +363,83 @@ static const OSSL_ALGORITHM fips_macs_internal[] = {
     { NULL, NULL, NULL }
 };

+/* clang-format off */
+#define FIPS_KDFS_COMMON()                                                               \
+    { PROV_NAMES_HKDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_hkdf_functions },               \
+    { PROV_NAMES_HKDF_SHA256, FIPS_DEFAULT_PROPERTIES, ossl_kdf_hkdf_sha256_functions }, \
+    { PROV_NAMES_HKDF_SHA384, FIPS_DEFAULT_PROPERTIES, ossl_kdf_hkdf_sha384_functions }, \
+    { PROV_NAMES_HKDF_SHA512, FIPS_DEFAULT_PROPERTIES, ossl_kdf_hkdf_sha512_functions }, \
+    { PROV_NAMES_TLS1_3_KDF, FIPS_DEFAULT_PROPERTIES,  ossl_kdf_tls1_3_kdf_functions },  \
+    { PROV_NAMES_PBKDF2, FIPS_DEFAULT_PROPERTIES, ossl_kdf_pbkdf2_functions },           \
+    { PROV_NAMES_TLS1_PRF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_tls1_prf_functions }
+/* clang-format on */
+
+/*
+ * NOTE:
+ *  Any algorithms added to this table need to be copied to fips_kdfs_internal[].
+ */
 static const OSSL_ALGORITHM fips_kdfs[] = {
-    { PROV_NAMES_HKDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_hkdf_functions },
-    { PROV_NAMES_TLS1_3_KDF, FIPS_DEFAULT_PROPERTIES,
-        ossl_kdf_tls1_3_kdf_functions },
+    FIPS_KDFS_COMMON(),
+#ifndef OPENSSL_NO_IKEV2KDF
+    { PROV_NAMES_IKEV2KDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_ikev2kdf_functions },
+#endif
+#ifndef OPENSSL_NO_SSKDF
     { PROV_NAMES_SSKDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_sskdf_functions },
-    { PROV_NAMES_PBKDF2, FIPS_DEFAULT_PROPERTIES, ossl_kdf_pbkdf2_functions },
+#endif
+#ifndef OPENSSL_NO_SNMPKDF
+    { PROV_NAMES_SNMPKDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_snmpkdf_functions },
+#endif
+#ifndef OPENSSL_NO_SRTPKDF
+    { PROV_NAMES_SRTPKDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_srtpkdf_functions },
+#endif
+#ifndef OPENSSL_NO_SSHKDF
     { PROV_NAMES_SSHKDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_sshkdf_functions },
-    { PROV_NAMES_X963KDF, FIPS_DEFAULT_PROPERTIES,
-        ossl_kdf_x963_kdf_functions },
+#endif
+#ifndef OPENSSL_NO_KBKDF
+    { PROV_NAMES_KBKDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_kbkdf_functions },
+#endif
+#ifndef OPENSSL_NO_X942KDF
     { PROV_NAMES_X942KDF_ASN1, FIPS_DEFAULT_PROPERTIES,
         ossl_kdf_x942_kdf_functions },
-    { PROV_NAMES_TLS1_PRF, FIPS_DEFAULT_PROPERTIES,
-        ossl_kdf_tls1_prf_functions },
+#endif
+#ifndef OPENSSL_NO_X963KDF
+    { PROV_NAMES_X963KDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_x963_kdf_functions },
+#endif
+    { NULL, NULL, NULL }
+};
+
+static const OSSL_ALGORITHM fips_kdfs_internal[] = {
+    FIPS_KDFS_COMMON(),
+#ifndef OPENSSL_NO_IKEV2KDF
+    { PROV_NAMES_IKEV2KDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_ikev2kdf_functions },
+#endif
+#ifndef OPENSSL_NO_SSKDF
+    { PROV_NAMES_SSKDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_sskdf_functions },
+#endif
+#ifndef OPENSSL_NO_SNMPKDF
+    { PROV_NAMES_SNMPKDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_snmpkdf_functions },
+#endif
+#ifndef OPENSSL_NO_SRTPKDF
+    { PROV_NAMES_SRTPKDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_srtpkdf_functions },
+#endif
+#ifndef OPENSSL_NO_SSHKDF
+    { PROV_NAMES_SSHKDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_sshkdf_functions },
+#endif
+#ifndef OPENSSL_NO_KBKDF
     { PROV_NAMES_KBKDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_kbkdf_functions },
+#endif
+#ifndef OPENSSL_NO_X942KDF
+    { PROV_NAMES_X942KDF_ASN1, FIPS_DEFAULT_PROPERTIES,
+        ossl_kdf_x942_kdf_functions },
+#endif
+#ifndef OPENSSL_NO_X963KDF
+    { PROV_NAMES_X963KDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_x963_kdf_functions },
+#endif
+
+#ifndef OPENSSL_NO_HMAC_DRBG_KDF
+    /* For deterministic ECDSA */
+    { PROV_NAMES_HMAC_DRBG_KDF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_hmac_drbg_functions },
+#endif
     { NULL, NULL, NULL }
 };

@@ -498,6 +541,9 @@ static const OSSL_ALGORITHM fips_signature[] = {
     { PROV_NAMES_CMAC, FIPS_DEFAULT_PROPERTIES,
         ossl_mac_legacy_cmac_signature_functions },
 #endif
+#ifndef OPENSSL_NO_LMS
+    { PROV_NAMES_LMS, FIPS_DEFAULT_PROPERTIES, ossl_lms_signature_functions },
+#endif
 #ifndef OPENSSL_NO_SLH_DSA
     { PROV_NAMES_SLH_DSA_SHA2_128S, FIPS_DEFAULT_PROPERTIES,
         ossl_slh_dsa_sha2_128s_signature_functions, PROV_DESCS_SLH_DSA_SHA2_128S },
@@ -539,12 +585,12 @@ static const OSSL_ALGORITHM fips_asym_kem[] = {
     { PROV_NAMES_ML_KEM_768, FIPS_DEFAULT_PROPERTIES, ossl_ml_kem_asym_kem_functions },
     { PROV_NAMES_ML_KEM_1024, FIPS_DEFAULT_PROPERTIES, ossl_ml_kem_asym_kem_functions },
 #if !defined(OPENSSL_NO_ECX)
-    { "X25519MLKEM768", FIPS_DEFAULT_PROPERTIES, ossl_mlx_kem_asym_kem_functions },
-    { "X448MLKEM1024", FIPS_UNAPPROVED_PROPERTIES, ossl_mlx_kem_asym_kem_functions },
+    { PROV_NAMES_X25519MLKEM768, FIPS_DEFAULT_PROPERTIES, ossl_mlx_kem_asym_kem_functions },
+    { PROV_NAMES_X448MLKEM1024, FIPS_UNAPPROVED_PROPERTIES, ossl_mlx_kem_asym_kem_functions },
 #endif
 #if !defined(OPENSSL_NO_EC)
-    { "SecP256r1MLKEM768", FIPS_DEFAULT_PROPERTIES, ossl_mlx_kem_asym_kem_functions },
-    { "SecP384r1MLKEM1024", FIPS_DEFAULT_PROPERTIES, ossl_mlx_kem_asym_kem_functions },
+    { PROV_NAMES_SecP256r1MLKEM768, FIPS_DEFAULT_PROPERTIES, ossl_mlx_kem_asym_kem_functions },
+    { PROV_NAMES_SecP384r1MLKEM1024, FIPS_DEFAULT_PROPERTIES, ossl_mlx_kem_asym_kem_functions },
 #endif
 #endif
     { NULL, NULL, NULL }
@@ -597,6 +643,10 @@ static const OSSL_ALGORITHM fips_keymgmt[] = {
     { PROV_NAMES_CMAC, FIPS_DEFAULT_PROPERTIES,
         ossl_cmac_legacy_keymgmt_functions, PROV_DESCS_CMAC_SIGN },
 #endif
+#ifndef OPENSSL_NO_LMS
+    { PROV_NAMES_LMS, FIPS_DEFAULT_PROPERTIES, ossl_lms_keymgmt_functions,
+        PROV_DESCS_LMS },
+#endif
 #ifndef OPENSSL_NO_ML_KEM
     { PROV_NAMES_ML_KEM_512, FIPS_DEFAULT_PROPERTIES, ossl_ml_kem_512_keymgmt_functions,
         PROV_DESCS_ML_KEM_512 },
@@ -646,6 +696,14 @@ static const OSSL_ALGORITHM fips_keymgmt[] = {
     { NULL, NULL, NULL }
 };

+static const OSSL_ALGORITHM fips_skeymgmt[] = {
+    { PROV_NAMES_AES, FIPS_DEFAULT_PROPERTIES, ossl_aes_skeymgmt_functions,
+        PROV_DESCS_AES },
+    { PROV_NAMES_GENERIC, FIPS_DEFAULT_PROPERTIES, ossl_generic_skeymgmt_functions,
+        PROV_DESCS_GENERIC },
+    { NULL, NULL, NULL }
+};
+
 static const OSSL_ALGORITHM *fips_query(void *provctx, int operation_id,
     int *no_cache)
 {
@@ -675,6 +733,8 @@ static const OSSL_ALGORITHM *fips_query(void *provctx, int operation_id,
         return fips_asym_cipher;
     case OSSL_OP_KEM:
         return fips_asym_kem;
+    case OSSL_OP_SKEYMGMT:
+        return fips_skeymgmt;
     }
     return NULL;
 }
@@ -682,17 +742,26 @@ static const OSSL_ALGORITHM *fips_query(void *provctx, int operation_id,
 static const OSSL_ALGORITHM *fips_query_internal(void *provctx, int operation_id,
     int *no_cache)
 {
-    if (operation_id == OSSL_OP_MAC) {
-        *no_cache = 0;
-        if (!ossl_prov_is_running())
-            return NULL;
+    *no_cache = 0;
+
+    if (!ossl_prov_is_running())
+        return NULL;
+
+    switch (operation_id) {
+    case OSSL_OP_DIGEST:
+        return fips_digests_internal;
+    case OSSL_OP_MAC:
         return fips_macs_internal;
+    case OSSL_OP_KDF:
+        return fips_kdfs_internal;
     }
+
     return fips_query(provctx, operation_id, no_cache);
 }

 static void fips_teardown(void *provctx)
 {
+    /* Also free deferred variables when the FIPS Global context is killed */
     OSSL_LIB_CTX_free(PROV_LIBCTX_OF(provctx));
     ossl_prov_ctx_free(provctx);
 }
@@ -897,45 +966,45 @@ int OSSL_provider_init_int(const OSSL_CORE_HANDLE *handle,
     if (!ossl_provider_activate_fallbacks(libctx))
         goto err;

+    /* Retrieve all FIPS parameters from core so they can be used later */
+    if (!fips_get_params_from_core(fgbl->handle, &fgbl->fips_params)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+        goto err;
+    }
+
+    /* disable security_checks if needed */
+#ifdef OPENSSL_NO_FIPS_SECURITYCHECKS
+    fgbl->fips_params.security_checks = 0;
+#endif
+
     /*
      * We did initial set up of selftest_params in a local copy, because we
      * could not create fgbl until c_CRYPTO_zalloc was defined in the loop
      * above.
      */
     fgbl->selftest_params = selftest_params;
-
+    fgbl->selftest_params.module_filename = fgbl->fips_params.module_filename;
+    fgbl->selftest_params.module_checksum_data = fgbl->fips_params.module_checksum_data;
+    fgbl->selftest_params.defer_tests = fgbl->fips_params.defer_tests;
     fgbl->selftest_params.libctx = libctx;

     set_self_test_cb(fgbl);
-
-    if (!fips_get_params_from_core(fgbl)) {
-        /* Error already raised */
-        goto err;
-    }
     /*
      * Disable the conditional error check if it's disabled in the fips config
      * file.
      */
-    if (fgbl->selftest_params.conditional_error_check != NULL
-        && strcmp(fgbl->selftest_params.conditional_error_check, "0") == 0)
+    if (fgbl->fips_params.conditional_error_check == 0)
         SELF_TEST_disable_conditional_error_state();

-    /* Enable or disable FIPS provider options */
-#define OSSL_FIPS_PARAM(structname, paramname, unused)             \
-    if (fgbl->fips_##structname.option != NULL) {                  \
-        if (strcmp(fgbl->fips_##structname.option, "1") == 0)      \
-            fgbl->fips_##structname.enabled = 1;                   \
-        else if (strcmp(fgbl->fips_##structname.option, "0") == 0) \
-            fgbl->fips_##structname.enabled = 0;                   \
-        else                                                       \
-            goto err;                                              \
-    }
-#include "fips_indicator_params.inc"
-#undef OSSL_FIPS_PARAM
-
     ossl_prov_cache_exported_algorithms(fips_ciphers, exported_fips_ciphers);

-    if (!SELF_TEST_post(&fgbl->selftest_params, 0)) {
+    /* initialize deferred self-test infrastructure */
+    if ((fgbl->deferred_lock = CRYPTO_THREAD_lock_new()) == NULL) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_CREATE_LOCK);
+        goto err;
+    }
+
+    if (!SELF_TEST_post(&fgbl->selftest_params, fgbl, 0)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_SELF_TEST_POST_FAILURE);
         goto err;
     }
@@ -1118,9 +1187,20 @@ int CRYPTO_secure_allocated(const void *ptr)
 void *CRYPTO_aligned_alloc(size_t num, size_t align, void **freeptr,
     const char *file, int line)
 {
-    return NULL;
+    return ossl_malloc_align(num, align, freeptr, file, line);
 }

+/*
+ * The public BIO_snprintf() prototype is hidden when the public headers
+ * are built with OPENSSL_NO_DEPRECATED_4_1, but the FIPS module still
+ * defines and exports the symbol for callers compiled into the module.
+ * Provide a local prototype in that configuration so the definition is
+ * well-formed.
+ */
+#ifdef OPENSSL_NO_DEPRECATED_4_1
+int BIO_snprintf(char *buf, size_t n, const char *format, ...);
+#endif
+
 int BIO_snprintf(char *buf, size_t n, const char *format, ...)
 {
     va_list args;
@@ -1132,16 +1212,6 @@ int BIO_snprintf(char *buf, size_t n, const char *format, ...)
     return ret;
 }

-#define OSSL_FIPS_PARAM(structname, paramname, unused)                                   \
-    int ossl_fips_config_##structname(OSSL_LIB_CTX *libctx)                              \
-    {                                                                                    \
-        FIPS_GLOBAL *fgbl = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_FIPS_PROV_INDEX); \
-                                                                                         \
-        return fgbl->fips_##structname.enabled;                                          \
-    }
-#include "fips_indicator_params.inc"
-#undef OSSL_FIPS_PARAM
-
 void OSSL_SELF_TEST_get_callback(OSSL_LIB_CTX *libctx, OSSL_CALLBACK **cb,
     void **cbarg)
 {
@@ -1171,3 +1241,196 @@ void OSSL_INDICATOR_get_callback(OSSL_LIB_CTX *libctx,
             *cb = NULL;
     }
 }
+
+/* These functions should only ever be called from SELF_TEST_post()
+ * otherwise deadlocks may arise */
+int SELF_TEST_lock_deferred(void *fips_global)
+{
+    FIPS_GLOBAL *fgbl = (FIPS_GLOBAL *)fips_global;
+    int ret = 0;
+
+    /* First get the lock */
+    if (CRYPTO_THREAD_write_lock(fgbl->deferred_lock))
+        /* then mark that we are executing tests on this thread */
+        if (CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_FIPS_DEFERRED_KEY,
+                fgbl->selftest_params.libctx, (void *)0xC001))
+            ret = 1;
+        else
+            CRYPTO_THREAD_unlock(fgbl->deferred_lock);
+    else
+        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_STATE);
+
+    return ret;
+}
+
+void SELF_TEST_unlock_deferred(void *fips_global)
+{
+    FIPS_GLOBAL *fgbl = (FIPS_GLOBAL *)fips_global;
+
+    /* clear thread local mark before exiting block */
+    CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_FIPS_DEFERRED_KEY,
+        fgbl->selftest_params.libctx, NULL);
+    /* release lock before returning */
+    CRYPTO_THREAD_unlock(fgbl->deferred_lock);
+}
+
+static int FIPS_kat_deferred(OSSL_LIB_CTX *libctx, self_test_id_t id)
+{
+    FIPS_GLOBAL *fgbl = ossl_lib_ctx_get_data(libctx,
+        OSSL_LIB_CTX_FIPS_PROV_INDEX);
+    int ret = 0;
+
+    if (fgbl == NULL) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_STATE);
+        return 0;
+    }
+
+    /*
+     * before we do anything, make sure a local test is not already in
+     * progress or we'll deadlock
+     */
+    if (CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_FIPS_DEFERRED_KEY,
+            libctx)
+        != NULL) {
+        enum st_test_state state;
+        /*
+         * record this test as invoked by the original test, for marking
+         * it later as also satisfied
+         */
+        if (!ossl_get_self_test_state(id, &state))
+            return 0;
+        if (state == SELF_TEST_STATE_DEFER)
+            /* ignore errors, worst case we do additional testing */
+            ossl_set_self_test_state(id, SELF_TEST_STATE_IMPLICIT);
+        /*
+         * A self test is in progress for this thread so we let this
+         * thread continue and perform the test while all other
+         * threads wait for it to complete.
+         */
+        return 1;
+    }
+
+    if (CRYPTO_THREAD_write_lock(fgbl->deferred_lock)) {
+        OSSL_SELF_TEST *st = NULL;
+        bool unset_key = false;
+        OSSL_CALLBACK *cb = NULL;
+        void *cb_arg = NULL;
+
+        /*
+         * check again as another thread may have just performed this
+         * test and marked it as passed.
+         * NOTE: SELF_TEST_STATE_INIT is not a vald state here,
+         * deferred testing is only valid when SELF_TEST_post
+         * marks tests with SELF_TEST_STATE_DEFER, under lock.
+         *
+         * NOTE: we do not need an atomic read, because writes are
+         * guaranteed to happen only with the deferred_lock held
+         */
+        switch (st_all_tests[id].state) {
+        case SELF_TEST_STATE_DEFER:
+            break;
+        case SELF_TEST_STATE_PASSED:
+            ret = 1;
+            goto done;
+        default:
+            /* something is broken */
+            ret = 0;
+            goto done;
+        }
+
+        /* mark that we are executing a test on the local thread */
+        if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_FIPS_DEFERRED_KEY,
+                libctx, (void *)0xC001))
+            goto done;
+
+        unset_key = true;
+
+        if (c_stcbfn != NULL && c_get_libctx != NULL)
+            c_stcbfn(c_get_libctx(FIPS_get_core_handle(libctx)), &cb, &cb_arg);
+
+        if ((st = OSSL_SELF_TEST_new(cb, cb_arg)) == NULL)
+            goto done;
+
+        ret = SELF_TEST_kats_execute(st, libctx, id, 1);
+
+    done:
+        OSSL_SELF_TEST_free(st);
+        if (unset_key)
+            CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_FIPS_DEFERRED_KEY,
+                libctx, NULL);
+        CRYPTO_THREAD_unlock(fgbl->deferred_lock);
+    }
+    return ret;
+}
+
+static void deferred_test_error(int category)
+{
+    const char *category_name = "Unknown Category Test";
+
+    switch (category) {
+    case SELF_TEST_KAT_CIPHER:
+        category_name = OSSL_SELF_TEST_TYPE_KAT_CIPHER;
+        break;
+    case SELF_TEST_KAT_ASYM_CIPHER:
+        category_name = OSSL_SELF_TEST_TYPE_KAT_ASYM_CIPHER;
+        break;
+    case SELF_TEST_KAT_ASYM_KEYGEN:
+        category_name = OSSL_SELF_TEST_TYPE_KAT_ASYM_KEYGEN;
+        break;
+    case SELF_TEST_KAT_KEM:
+        category_name = OSSL_SELF_TEST_TYPE_KAT_KEM;
+        break;
+    case SELF_TEST_KAT_DIGEST:
+        category_name = OSSL_SELF_TEST_TYPE_KAT_DIGEST;
+        break;
+    case SELF_TEST_KAT_SIGNATURE:
+        category_name = OSSL_SELF_TEST_TYPE_KAT_SIGNATURE;
+        break;
+    case SELF_TEST_KAT_KDF:
+        category_name = OSSL_SELF_TEST_TYPE_KAT_KDF;
+        break;
+    case SELF_TEST_KAT_KAS:
+        category_name = OSSL_SELF_TEST_TYPE_KAT_KA;
+        break;
+    case SELF_TEST_DRBG:
+        category_name = OSSL_SELF_TEST_TYPE_DRBG;
+        break;
+    }
+    ossl_set_error_state(category_name);
+}
+
+int ossl_deferred_self_test(OSSL_LIB_CTX *libctx, self_test_id_t id)
+{
+    enum st_test_state state;
+    int ret;
+
+    if (id >= ST_ID_MAX) {
+        ossl_set_error_state(NULL);
+        return 0;
+    }
+
+    /*
+     * Return immediately if the test is marked as passed.
+     *
+     * NOTE: This would normally call for an atomic read, however we want
+     * to avoid contention in the general case where the test is always in
+     * PASSED state. This is true 100% of the time when tests are not deferred,
+     * and true 99% of the time when tests are deferred. For the remaining 1% of
+     * the time, if we race and do not read a PASSED value, the worst case is
+     * that this function continues until it obtains a lock in FIPS_deferred()
+     * and then it will recheck this value and immediately exit.
+     */
+
+    TSAN_BENIGN(&st_all_tests[id].state, "Fails safe, avoids contention")
+    if (st_all_tests[id].state == SELF_TEST_STATE_PASSED)
+        return 1;
+
+    ret = FIPS_kat_deferred(libctx, id);
+    if (!ossl_get_self_test_state(id, &state)) {
+        ossl_set_error_state(NULL);
+        return 0;
+    }
+    if (!ret || state == SELF_TEST_STATE_FAILED)
+        deferred_test_error(st_all_tests[id].category);
+    return ret;
+}
diff --git a/deps/openssl/openssl/providers/fips/include/fips/fipsindicator.h b/deps/openssl/openssl/providers/fips/include/fips/fipsindicator.h
index a6fe5dec7f4..94d5b9fefb2 100644
--- a/deps/openssl/openssl/providers/fips/include/fips/fipsindicator.h
+++ b/deps/openssl/openssl/providers/fips/include/fips/fipsindicator.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */

-#ifndef OSSL_PROVIDERS_FIPSINDICATOR_H
-#define OSSL_PROVIDERS_FIPSINDICATOR_H
+#if !defined(OSSL_PROVIDERS_FIPS_INCLUDE_FIPS_FIPSINDICATOR_H)
+#define OSSL_PROVIDERS_FIPS_INCLUDE_FIPS_FIPSINDICATOR_H

 #ifdef FIPS_MODULE

@@ -70,16 +70,17 @@ void ossl_FIPS_IND_set_approved(OSSL_FIPS_IND *ind);
 void ossl_FIPS_IND_set_settable(OSSL_FIPS_IND *ind, int id, int enable);
 int ossl_FIPS_IND_get_settable(const OSSL_FIPS_IND *ind, int id);
 int ossl_FIPS_IND_on_unapproved(OSSL_FIPS_IND *ind, int id, OSSL_LIB_CTX *libctx,
-    const char *algname, const char *opname,
-    OSSL_FIPS_IND_CHECK_CB *config_check_fn);
-int ossl_FIPS_IND_set_ctx_param(OSSL_FIPS_IND *ind, int id,
-    const OSSL_PARAM params[], const char *name);
+    const char *algname, const char *opname, enum fips_config_id config_id);
+int ossl_FIPS_IND_set_ctx_param(OSSL_FIPS_IND *ind, int id, const OSSL_PARAM *p);
+int ossl_FIPS_IND_set_ctx_param_locate(OSSL_FIPS_IND *ind, int id,
+    const OSSL_PARAM params[],
+    const char *name);
 int ossl_FIPS_IND_get_ctx_param(const OSSL_FIPS_IND *ind,
-    OSSL_PARAM params[]);
+    OSSL_PARAM *p);
 int ossl_FIPS_IND_get_ctx_param_conditional(const OSSL_FIPS_IND *ind,
-    OSSL_PARAM params[], int condition);
-const OSSL_PARAM *ossl_FIPS_IND_gettable_ctx_params(void *ctx, void *provctx);
-int ossl_FIPS_IND_get_ctx_param_approved(void *ctx, OSSL_PARAM params[]);
+    OSSL_PARAM *p, int condition);
+int ossl_FIPS_IND_get_ctx_param_locate(const OSSL_FIPS_IND *ind,
+    OSSL_PARAM params[]);
 void ossl_FIPS_IND_copy(OSSL_FIPS_IND *dst, const OSSL_FIPS_IND *src);

 /* Place this in the algorithm ctx structure */
@@ -103,8 +104,8 @@ void ossl_FIPS_IND_copy(OSSL_FIPS_IND *dst, const OSSL_FIPS_IND *src);
  * If there is more than 1 strict check flag per algorithm ctx, the id represents
  * the index.
  */
-#define OSSL_FIPS_IND_ON_UNAPPROVED(ctx, id, libctx, algname, opname, config_check_fn) \
-    ossl_FIPS_IND_on_unapproved(&ctx->indicator, id, libctx, algname, opname, config_check_fn)
+#define OSSL_FIPS_IND_ON_UNAPPROVED(ctx, id, libctx, algname, opname, config_id) \
+    ossl_FIPS_IND_on_unapproved(&ctx->indicator, id, libctx, algname, opname, config_id)

 #define OSSL_FIPS_IND_SETTABLE_CTX_PARAM(name) \
     OSSL_PARAM_int(name, NULL),
@@ -114,27 +115,26 @@ void ossl_FIPS_IND_copy(OSSL_FIPS_IND *dst, const OSSL_FIPS_IND *src);
  * The name must match the param used by OSSL_FIPS_IND_SETTABLE_CTX_PARAM
  */
 #define OSSL_FIPS_IND_SET_CTX_PARAM(ctx, id, params, name) \
-    ossl_FIPS_IND_set_ctx_param(&((ctx)->indicator), id, params, name)
+    ossl_FIPS_IND_set_ctx_param_locate(&((ctx)->indicator), id, params, name)
+
+#define OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, id, p) \
+    ossl_FIPS_IND_set_ctx_param(&((ctx)->indicator), id, p)

 #define OSSL_FIPS_IND_GETTABLE_CTX_PARAM() \
     OSSL_PARAM_int(OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR, NULL),

 #define OSSL_FIPS_IND_GET_CTX_PARAM(ctx, prms) \
-    ossl_FIPS_IND_get_ctx_param(&((ctx)->indicator), prms)
-
-#define OSSL_FIPS_IND_GET_CTX_PARAM_CONDITIONAL(ctx, prms, condition) \
-    ossl_FIPS_IND_get_ctx_param_conditional(&((ctx)->indicator), prms, condition)
+    ossl_FIPS_IND_get_ctx_param_locate(&((ctx)->indicator), prms)

-#define OSSL_FIPS_IND_GET_CTX_PARAM_APPROVED(ctx, prms) \
-    ossl_FIPS_IND_get_ctx_param_approved(ctx, prms)
+#define OSSL_FIPS_IND_GET_CTX_FROM_PARAM(ctx, p) \
+    ossl_FIPS_IND_get_ctx_param(&((ctx)->indicator), p)

-#define OSSL_FIPS_IND_DISPATCH(get_id, gettable_id, get_fn) \
-    { get_id, (void (*)(void))get_fn },                     \
-        { gettable_id, (void (*)(void))ossl_FIPS_IND_gettable_ctx_params },
+#define OSSL_FIPS_IND_GET_CTX_FROM_PARAM_CONDITIONAL(ctx, p, condition) \
+    ossl_FIPS_IND_get_ctx_param_conditional(                            \
+        &((ctx)->indicator), p, condition)

-#define OSSL_FIPS_IND_APPROVED_DISPATCH(get_id, gettable_id) \
-    OSSL_FIPS_IND_DISPATCH(get_id, gettable_id,              \
-        ossl_FIPS_IND_get_ctx_param_approved)
+#define OSSL_FIPS_IND_GET_PARAM_CONDITIONAL(p, condition) \
+    ossl_FIPS_IND_get_ctx_param_conditional(NULL, p, condition)

 #define OSSL_FIPS_IND_GET(ctx) (&((ctx)->indicator))

@@ -157,7 +157,7 @@ int ossl_fips_ind_digest_sign_check(OSSL_FIPS_IND *ind, int id,
     int nid, int sha1_allowed,
     int sha512_trunc_allowed,
     const char *desc,
-    OSSL_FIPS_IND_CHECK_CB *config_check_f);
+    enum fips_config_id config_id);

 #else
 #define OSSL_FIPS_IND_DECLARE
@@ -166,14 +166,14 @@ int ossl_fips_ind_digest_sign_check(OSSL_FIPS_IND *ind, int id,
 #define OSSL_FIPS_IND_ON_UNAPPROVED(ctx, id, libctx, algname, opname, configopt_fn)
 #define OSSL_FIPS_IND_SETTABLE_CTX_PARAM(name)
 #define OSSL_FIPS_IND_SET_CTX_PARAM(ctx, id, params, name) 1
+#define OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, id, p) 1
 #define OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
 #define OSSL_FIPS_IND_GET_CTX_PARAM(ctx, params) 1
-#define OSSL_FIPS_IND_GET_CTX_PARAM_CONDITIONAL(ctx, params, condition) 1
-#define OSSL_FIPS_IND_GET_CTX_PARAM_APPROVED(ctx, params) 1
-#define OSSL_FIPS_IND_DISPATCH(get_id, gettable_id, get_fn)
-#define OSSL_FIPS_IND_APPROVED_DISPATCH(get_id, gettable_id)
+#define OSSL_FIPS_IND_GET_CTX_FROM_PARAM(ctx, params) 1
+#define OSSL_FIPS_IND_GET_CTX_FROM_PARAM_CONDITIONAL(ctx, p, condition) 1
+#define OSSL_FIPS_IND_GET_PARAM_CONDITIONAL(p, condition) 1
 #define OSSL_FIPS_IND_COPY(dst, src)

 #endif

-#endif /* OSSL_PROVIDERS_FIPSINDICATOR_H */
+#endif /* !defined(OSSL_PROVIDERS_FIPS_INCLUDE_FIPS_FIPSINDICATOR_H) */
diff --git a/deps/openssl/openssl/providers/fips/include/fips_indicator_params.inc b/deps/openssl/openssl/providers/fips/include/fips_indicator_params.inc
deleted file mode 100644
index 78f9fc06551..00000000000
--- a/deps/openssl/openssl/providers/fips/include/fips_indicator_params.inc
+++ /dev/null
@@ -1,28 +0,0 @@
-OSSL_FIPS_PARAM(security_checks, SECURITY_CHECKS, 1)
-OSSL_FIPS_PARAM(tls1_prf_ems_check, TLS1_PRF_EMS_CHECK, 0)
-OSSL_FIPS_PARAM(no_short_mac, NO_SHORT_MAC, 1)
-OSSL_FIPS_PARAM(hmac_key_check, HMAC_KEY_CHECK, 0)
-OSSL_FIPS_PARAM(kmac_key_check, KMAC_KEY_CHECK, 0)
-OSSL_FIPS_PARAM(restricted_drbg_digests, DRBG_TRUNC_DIGEST, 0)
-OSSL_FIPS_PARAM(signature_digest_check, SIGNATURE_DIGEST_CHECK, 0)
-OSSL_FIPS_PARAM(hkdf_digest_check, HKDF_DIGEST_CHECK, 0)
-OSSL_FIPS_PARAM(tls13_kdf_digest_check, TLS13_KDF_DIGEST_CHECK, 0)
-OSSL_FIPS_PARAM(tls1_prf_digest_check, TLS1_PRF_DIGEST_CHECK, 0)
-OSSL_FIPS_PARAM(sshkdf_digest_check, SSHKDF_DIGEST_CHECK, 0)
-OSSL_FIPS_PARAM(sskdf_digest_check, SSKDF_DIGEST_CHECK, 0)
-OSSL_FIPS_PARAM(x963kdf_digest_check, X963KDF_DIGEST_CHECK, 0)
-OSSL_FIPS_PARAM(dsa_sign_disallowed, DSA_SIGN_DISABLED, 0)
-OSSL_FIPS_PARAM(tdes_encrypt_disallowed, TDES_ENCRYPT_DISABLED, 0)
-OSSL_FIPS_PARAM(rsa_pkcs15_padding_disabled, RSA_PKCS15_PAD_DISABLED, 0)
-OSSL_FIPS_PARAM(rsa_pss_saltlen_check, RSA_PSS_SALTLEN_CHECK, 0)
-OSSL_FIPS_PARAM(rsa_sign_x931_disallowed, RSA_SIGN_X931_PAD_DISABLED, 0)
-OSSL_FIPS_PARAM(hkdf_key_check, HKDF_KEY_CHECK, 0)
-OSSL_FIPS_PARAM(kbkdf_key_check, KBKDF_KEY_CHECK, 0)
-OSSL_FIPS_PARAM(tls13_kdf_key_check, TLS13_KDF_KEY_CHECK, 0)
-OSSL_FIPS_PARAM(tls1_prf_key_check, TLS1_PRF_KEY_CHECK, 0)
-OSSL_FIPS_PARAM(sshkdf_key_check, SSHKDF_KEY_CHECK, 0)
-OSSL_FIPS_PARAM(sskdf_key_check, SSKDF_KEY_CHECK, 0)
-OSSL_FIPS_PARAM(x963kdf_key_check, X963KDF_KEY_CHECK, 0)
-OSSL_FIPS_PARAM(x942kdf_key_check, X942KDF_KEY_CHECK, 0)
-OSSL_FIPS_PARAM(pbkdf2_lower_bound_check, PBKDF2_LOWER_BOUND_CHECK, 1)
-OSSL_FIPS_PARAM(ecdh_cofactor_check, ECDH_COFACTOR_CHECK, 0)
diff --git a/deps/openssl/openssl/providers/fips/include/fips_selftest_params.inc b/deps/openssl/openssl/providers/fips/include/fips_selftest_params.inc
deleted file mode 100644
index df942d9cea6..00000000000
--- a/deps/openssl/openssl/providers/fips/include/fips_selftest_params.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-OSSL_FIPS_PARAM(module_filename, OSSL_PROV_PARAM_CORE_MODULE_FILENAME)
-OSSL_FIPS_PARAM(module_checksum_data, OSSL_PROV_FIPS_PARAM_MODULE_MAC)
-OSSL_FIPS_PARAM(conditional_error_check, OSSL_PROV_FIPS_PARAM_CONDITIONAL_ERRORS)
diff --git a/deps/openssl/openssl/providers/fips/include/fipscommon.h b/deps/openssl/openssl/providers/fips/include/fipscommon.h
index c8df9a8ac4f..31970a589b0 100644
--- a/deps/openssl/openssl/providers/fips/include/fipscommon.h
+++ b/deps/openssl/openssl/providers/fips/include/fipscommon.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,12 +7,18 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_FIPS_INCLUDE_FIPSCOMMON_H)
+#define OSSL_PROVIDERS_FIPS_INCLUDE_FIPSCOMMON_H
+
 #ifdef FIPS_MODULE
 #include <openssl/types.h>

-#define OSSL_FIPS_PARAM(structname, paramname, unused) \
-    int ossl_fips_config_##structname(OSSL_LIB_CTX *libctx);
-#include "fips_indicator_params.inc"
-#undef OSSL_FIPS_PARAM
+#define FIPSPARAMS_AS_HEADER
+#include "providers/fips/fipsparams.inc"
+#undef FIPSPARAMS_AS_HEADER
+
+int ossl_fips_config(OSSL_LIB_CTX *libctx, enum fips_config_id id);

 #endif
+
+#endif /* !defined(OSSL_PROVIDERS_FIPS_INCLUDE_FIPSCOMMON_H) */
diff --git a/deps/openssl/openssl/providers/fips/self_test.c b/deps/openssl/openssl/providers/fips/self_test.c
index aa5a8c76581..391e3686263 100644
--- a/deps/openssl/openssl/providers/fips/self_test.c
+++ b/deps/openssl/openssl/providers/fips/self_test.c
@@ -18,6 +18,7 @@
 #include <openssl/rand.h>
 #include "internal/e_os.h"
 #include "internal/fips.h"
+#include "internal/threads_common.h"
 #include "internal/tsan_assist.h"
 #include "prov/providercommon.h"
 #include "crypto/rand.h"
@@ -68,6 +69,27 @@ DEFINE_RUN_ONCE_STATIC(do_fips_self_test_init)
     return self_test_lock != NULL;
 }

+static CRYPTO_RWLOCK *self_test_states_lock = NULL;
+static CRYPTO_ONCE fips_self_test_states_lock_init = CRYPTO_ONCE_STATIC_INIT;
+
+DEFINE_RUN_ONCE_STATIC(do_fips_self_test_states_lock_init)
+{
+    self_test_states_lock = CRYPTO_THREAD_lock_new();
+    return self_test_states_lock != NULL;
+}
+
+int ossl_get_self_test_state(self_test_id_t id, enum st_test_state *state)
+{
+    return CRYPTO_atomic_load_int((int *)&st_all_tests[id].state, (int *)state,
+        self_test_states_lock);
+}
+
+int ossl_set_self_test_state(self_test_id_t id, enum st_test_state state)
+{
+    return CRYPTO_atomic_store_int((int *)&st_all_tests[id].state, state,
+        self_test_states_lock);
+}
+
 /*
  * Declarations for the DEP entry/exit points.
  * Ones not required or incorrect need to be undefined or redefined respectively.
@@ -177,68 +199,11 @@ DEP_INIT_ATTRIBUTE void init(void)
 DEP_FINI_ATTRIBUTE void cleanup(void)
 {
     CRYPTO_THREAD_lock_free(self_test_lock);
+    CRYPTO_THREAD_clean_local();
 }
 #endif

 #if !defined(OPENSSL_NO_FIPS_POST)
-/*
- * We need an explicit HMAC-SHA-256 KAT even though it is also
- * checked as part of the KDF KATs.  Refer IG 10.3.
- */
-static const unsigned char hmac_kat_pt[] = {
-    0xdd, 0x0c, 0x30, 0x33, 0x35, 0xf9, 0xe4, 0x2e,
-    0xc2, 0xef, 0xcc, 0xbf, 0x07, 0x95, 0xee, 0xa2
-};
-static const unsigned char hmac_kat_key[] = {
-    0xf4, 0x55, 0x66, 0x50, 0xac, 0x31, 0xd3, 0x54,
-    0x61, 0x61, 0x0b, 0xac, 0x4e, 0xd8, 0x1b, 0x1a,
-    0x18, 0x1b, 0x2d, 0x8a, 0x43, 0xea, 0x28, 0x54,
-    0xcb, 0xae, 0x22, 0xca, 0x74, 0x56, 0x08, 0x13
-};
-static const unsigned char hmac_kat_digest[] = {
-    0xf5, 0xf5, 0xe5, 0xf2, 0x66, 0x49, 0xe2, 0x40,
-    0xfc, 0x9e, 0x85, 0x7f, 0x2b, 0x9a, 0xbe, 0x28,
-    0x20, 0x12, 0x00, 0x92, 0x82, 0x21, 0x3e, 0x51,
-    0x44, 0x5d, 0xe3, 0x31, 0x04, 0x01, 0x72, 0x6b
-};
-
-static int integrity_self_test(OSSL_SELF_TEST *ev, OSSL_LIB_CTX *libctx)
-{
-    int ok = 0;
-    unsigned char out[EVP_MAX_MD_SIZE];
-    size_t out_len = 0;
-
-    OSSL_PARAM params[2];
-    EVP_MAC *mac = EVP_MAC_fetch(libctx, MAC_NAME, NULL);
-    EVP_MAC_CTX *ctx = EVP_MAC_CTX_new(mac);
-
-    OSSL_SELF_TEST_onbegin(ev, OSSL_SELF_TEST_TYPE_KAT_INTEGRITY,
-        OSSL_SELF_TEST_DESC_INTEGRITY_HMAC);
-
-    params[0] = OSSL_PARAM_construct_utf8_string("digest", DIGEST_NAME, 0);
-    params[1] = OSSL_PARAM_construct_end();
-
-    if (ctx == NULL
-        || mac == NULL
-        || !EVP_MAC_init(ctx, hmac_kat_key, sizeof(hmac_kat_key), params)
-        || !EVP_MAC_update(ctx, hmac_kat_pt, sizeof(hmac_kat_pt))
-        || !EVP_MAC_final(ctx, out, &out_len, MAX_MD_SIZE))
-        goto err;
-
-    /* Optional corruption */
-    OSSL_SELF_TEST_oncorrupt_byte(ev, out);
-
-    if (out_len != sizeof(hmac_kat_digest)
-        || memcmp(out, hmac_kat_digest, out_len) != 0)
-        goto err;
-    ok = 1;
-err:
-    OSSL_SELF_TEST_onend(ev, ok);
-    EVP_MAC_free(mac);
-    EVP_MAC_CTX_free(ctx);
-    return ok;
-}
-
 /*
  * Calculate the HMAC SHA256 of data read using a BIO and read_cb, and verify
  * the result matches the expected value.
@@ -257,7 +222,7 @@ static int verify_integrity(OSSL_CORE_BIO *bio, OSSL_FUNC_BIO_read_ex_fn read_ex
     EVP_MAC_CTX *ctx = NULL;
     OSSL_PARAM params[2], *p = params;

-    if (!integrity_self_test(ev, libctx))
+    if (!SELF_TEST_kats_execute(ev, libctx, ST_ID_MAC_HMAC, 0))
         goto err;

     OSSL_SELF_TEST_onbegin(ev, event_type, OSSL_SELF_TEST_DESC_INTEGRITY_HMAC);
@@ -313,7 +278,8 @@ int ossl_fips_self_testing(void)
 }

 /* This API is triggered either on loading of the FIPS module or on demand */
-int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, int on_demand_test)
+int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, void *fips_global,
+    int on_demand_test)
 {
     int loclstate;
 #if !defined(OPENSSL_NO_FIPS_POST)
@@ -329,6 +295,9 @@ int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, int on_demand_test)
     if (!RUN_ONCE(&fips_self_test_init, do_fips_self_test_init))
         return 0;

+    if (!RUN_ONCE(&fips_self_test_states_lock_init, do_fips_self_test_states_lock_init))
+        return 0;
+
     loclstate = tsan_load(&FIPS_state);

     if (loclstate == FIPS_STATE_RUNNING) {
@@ -356,11 +325,14 @@ int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, int on_demand_test)
         return 0;
     }

-    if (st == NULL
-        || st->module_checksum_data == NULL) {
+    if (st == NULL) {
         ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_CONFIG_DATA);
         goto end;
     }
+    if (st->module_checksum_data == NULL) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FIPS_MODULE_MISSING_CHECKSUM);
+        goto end;
+    }

     ev = OSSL_SELF_TEST_new(st->cb, st->cb_arg);
     if (ev == NULL)
@@ -374,17 +346,56 @@ int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, int on_demand_test)
     }
     bio_module = (*st->bio_new_file_cb)(st->module_filename, "rb");

-    /* Always check the integrity of the fips module */
-    if (bio_module == NULL
-        || !verify_integrity(bio_module, st->bio_read_ex_cb,
-            module_checksum, checksum_len, st->libctx,
-            ev, OSSL_SELF_TEST_TYPE_MODULE_INTEGRITY)) {
-        ERR_raise(ERR_LIB_PROV, PROV_R_MODULE_INTEGRITY_FAILURE);
-        goto end;
-    }
+    /* This section can be called on demand and that could race with deferred
+     * tests being executed in another thread, so we use helpers to get
+     * proper locking around this critical section */
+
+    if (SELF_TEST_lock_deferred(fips_global)) {
+        int errored = 0;
+
+        /* Always check the integrity of the fips module */
+        if (bio_module == NULL
+            || !verify_integrity(bio_module, st->bio_read_ex_cb,
+                module_checksum, checksum_len, st->libctx,
+                ev, OSSL_SELF_TEST_TYPE_MODULE_INTEGRITY)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_MODULE_INTEGRITY_FAILURE);
+            errored = 1;
+            goto locked_end;
+        }
+
+        if (st->defer_tests == 1) {
+            /* Mark all non executed tests as deferred */
+            for (int i = 0; i < ST_ID_MAX; i++) {
+                if (st_all_tests[i].state == SELF_TEST_STATE_INIT) {
+                    if (!ossl_set_self_test_state(i, SELF_TEST_STATE_DEFER)) {
+                        errored = 1;
+                        goto locked_end;
+                    }
+                }
+            }
+        }
+
+        if (on_demand_test) {
+            /* ensure all states are cleared so all tests are forcibly
+             * repeated */
+            for (int i = 0; i < ST_ID_MAX; i++) {
+                if (!ossl_set_self_test_state(i, SELF_TEST_STATE_INIT)) {
+                    errored = 1;
+                    goto locked_end;
+                }
+            }
+        }

-    if (!SELF_TEST_kats(ev, st->libctx)) {
-        ERR_raise(ERR_LIB_PROV, PROV_R_SELF_TEST_KAT_FAILURE);
+        if (!SELF_TEST_kats(ev, st->libctx)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_SELF_TEST_KAT_FAILURE);
+            errored = 1;
+        }
+
+    locked_end:
+        SELF_TEST_unlock_deferred(fips_global);
+        if (errored)
+            goto end;
+    } else {
         goto end;
     }

diff --git a/deps/openssl/openssl/providers/fips/self_test.h b/deps/openssl/openssl/providers/fips/self_test.h
index 3aaa27218d3..05c5285e540 100644
--- a/deps/openssl/openssl/providers/fips/self_test.h
+++ b/deps/openssl/openssl/providers/fips/self_test.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,17 +7,21 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_FIPS_SELF_TEST_H)
+#define OSSL_PROVIDERS_FIPS_SELF_TEST_H
+
 #include <openssl/core_dispatch.h>
 #include <openssl/types.h>
 #include <openssl/self_test.h>
+#include "internal/fips.h"

 typedef struct self_test_post_params_st {
     /* FIPS module integrity check parameters */
     const char *module_filename; /* Module file to perform MAC on */
     const char *module_checksum_data; /* Expected module MAC integrity */

-    /* Used for continuous tests */
-    const char *conditional_error_check;
+    /* Used to decide whether to defer tests or not */
+    unsigned char defer_tests;

     /* BIO callbacks supplied to the FIPS provider */
     OSSL_FUNC_BIO_new_file_fn *bio_new_file_cb;
@@ -30,7 +34,151 @@ typedef struct self_test_post_params_st {

 } SELF_TEST_POST_PARAMS;

-int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, int on_demand_test);
-int SELF_TEST_kats(OSSL_SELF_TEST *event, OSSL_LIB_CTX *libctx);
+int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, void *fips_global,
+    int on_demand_test);
+int SELF_TEST_kats_execute(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx,
+    self_test_id_t id, int switch_rand);
+int SELF_TEST_kats(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx);
+int SELF_TEST_lock_deferred(void *fips_global);
+void SELF_TEST_unlock_deferred(void *fips_global);

 void SELF_TEST_disable_conditional_error_state(void);
+
+/* KAT tests categories */
+enum st_test_category {
+    SELF_TEST_INTEGRITY = 0, /* currently unused */
+    SELF_TEST_KAT_DIGEST,
+    SELF_TEST_KAT_CIPHER,
+    SELF_TEST_KAT_SIGNATURE,
+    SELF_TEST_KAT_KDF,
+    SELF_TEST_DRBG,
+    SELF_TEST_KAT_KAS,
+    SELF_TEST_KAT_ASYM_KEYGEN,
+    SELF_TEST_KAT_KEM,
+    SELF_TEST_KAT_ASYM_CIPHER,
+    SELF_TEST_KAT_MAC,
+};
+
+enum st_test_state {
+    SELF_TEST_STATE_INIT = 0, /* Test has not been execute yet */
+    SELF_TEST_STATE_IN_PROGRESS, /* Test is currently being executed */
+    SELF_TEST_STATE_PASSED, /* Test is marked as passed */
+    SELF_TEST_STATE_FAILED, /* Test failed */
+    SELF_TEST_STATE_IMPLICIT, /* Marks test as implicitly handled */
+    SELF_TEST_STATE_DEFER, /* Like INIT, but mark test as deferred */
+};
+
+/* used to store raw parameters for keys and algorithms */
+typedef struct st_kat_param_st {
+    const char *name; /* an OSSL_PARAM name */
+    size_t type; /* the type associated with the data */
+    const void *data; /* unsigned char [], or char [] depending on the type */
+    size_t data_len; /* the length of the data */
+} ST_KAT_PARAM;
+
+typedef struct st_const_buffer_st {
+    const unsigned char *buf;
+    size_t len;
+} ST_BUFFER;
+
+#define CIPHER_MODE_ENCRYPT 1
+#define CIPHER_MODE_DECRYPT 2
+#define CIPHER_MODE_ALL (CIPHER_MODE_ENCRYPT | CIPHER_MODE_DECRYPT)
+
+typedef struct st_kat_cipher_st {
+    int mode;
+    ST_BUFFER key;
+    ST_BUFFER iv;
+    ST_BUFFER aad;
+    ST_BUFFER tag;
+} ST_KAT_CIPHER;
+
+typedef struct st_kat_asym_cipher_st {
+    int encrypt;
+    const ST_KAT_PARAM *key;
+    const ST_KAT_PARAM *postinit;
+} ST_KAT_ASYM_CIPHER;
+
+typedef struct st_kat_keygen_st {
+    const ST_KAT_PARAM *keygen_params;
+    const ST_KAT_PARAM *expected_params;
+} ST_KAT_ASYM_KEYGEN;
+
+typedef struct st_kat_kem_st {
+    const ST_KAT_PARAM *key;
+    ST_BUFFER cipher_text;
+    ST_BUFFER entropy;
+    ST_BUFFER secret;
+    ST_BUFFER reject_secret;
+} ST_KAT_KEM;
+
+/* FIPS 140-3 only allows DSA verification for legacy purposes */
+#define SIGNATURE_MODE_VERIFY_ONLY 1
+#define SIGNATURE_MODE_SIGN_ONLY 2
+#define SIGNATURE_MODE_DIGESTED 4
+#define SIGNATURE_MODE_SIG_DIGESTED 8
+
+typedef struct st_kat_sign_st {
+    const char *keytype;
+    int mode;
+    const ST_KAT_PARAM *key;
+    ST_BUFFER entropy;
+    ST_BUFFER nonce;
+    ST_BUFFER persstr;
+    const ST_KAT_PARAM *init;
+    const ST_KAT_PARAM *verify;
+} ST_KAT_SIGN;
+
+typedef struct st_kat_kdf_st {
+    const ST_KAT_PARAM *params;
+} ST_KAT_KDF;
+
+typedef struct st_kat_kas_st {
+    const ST_KAT_PARAM *key_group;
+    const ST_KAT_PARAM *key_host_data;
+    const ST_KAT_PARAM *key_peer_data;
+} ST_KAT_KAS;
+
+typedef struct st_kat_drbg_st {
+    const char *param_name;
+    const char *param_value;
+    ST_BUFFER entropyin;
+    ST_BUFFER nonce;
+    ST_BUFFER persstr;
+    ST_BUFFER entropyinpr1;
+    ST_BUFFER entropyinpr2;
+    ST_BUFFER entropyaddin1;
+    ST_BUFFER entropyaddin2;
+} ST_KAT_DRBG;
+
+typedef struct st_kat_mac_st {
+    const ST_KAT_PARAM *params;
+} ST_KAT_MAC;
+
+typedef struct self_test_st {
+    self_test_id_t id;
+    const char *algorithm;
+    const char *desc;
+    enum st_test_category category;
+    enum st_test_state state;
+    ST_BUFFER pt;
+    ST_BUFFER expected; /* Set to NULL if this value changes */
+    union {
+        ST_KAT_CIPHER cipher;
+        ST_KAT_ASYM_CIPHER ac;
+        ST_KAT_ASYM_KEYGEN akgen;
+        ST_KAT_KEM kem;
+        ST_KAT_SIGN sig;
+        ST_KAT_KDF kdf;
+        ST_KAT_KAS kas;
+        ST_KAT_DRBG drbg;
+        ST_KAT_MAC mac;
+    } u;
+    const self_test_id_t *depends_on;
+} ST_DEFINITION;
+
+extern ST_DEFINITION st_all_tests[ST_ID_MAX];
+int ossl_get_self_test_state(self_test_id_t id, enum st_test_state *state);
+int ossl_set_self_test_state(self_test_id_t id, enum st_test_state state);
+
+#endif /* !defined(OSSL_PROVIDERS_FIPS_SELF_TEST_H) */
diff --git a/deps/openssl/openssl/providers/fips/self_test_data.inc b/deps/openssl/openssl/providers/fips/self_test_data.c
similarity index 69%
rename from deps/openssl/openssl/providers/fips/self_test_data.inc
rename to deps/openssl/openssl/providers/fips/self_test_data.c
index 4a0ce24cbb3..dcb7552952e 100644
--- a/deps/openssl/openssl/providers/fips/self_test_data.inc
+++ b/deps/openssl/openssl/providers/fips/self_test_data.c
@@ -16,158 +16,32 @@
  * they are tested as part of a higher level algorithm (such as HMAC).
  */

+#include <openssl/kdf.h>
+#include <openssl/core_names.h>
+#include "self_test.h"
+#include "crypto/ml_kem.h"
+#include "internal/nelem.h"
+
 /* Macros to build Self test data */
-#define ITM(x) ((void *)&x), sizeof(x)
-#define ITM_STR(x) ((void *)&x), (sizeof(x) - 1)
+#define ITM(x) ((const void *)&x), sizeof(x)
+#define ITM_STR(x) ((const void *)&x), (sizeof(x) - 1)
+#define ITM_BUF(x) \
+    { ((const unsigned char *)&x), sizeof(x) }
+#define ITM_BUF_STR(x) \
+    { ((const unsigned char *)&x), (sizeof(x) - 1) }

 #define ST_KAT_PARAM_END() { "", 0, NULL, 0 }
-#define ST_KAT_PARAM_BIGNUM(name, data)                                        \
+#define ST_KAT_PARAM_BIGNUM(name, data) \
     { name, OSSL_PARAM_UNSIGNED_INTEGER, ITM(data) }
-#define ST_KAT_PARAM_OCTET(name, data)                                         \
+#define ST_KAT_PARAM_OCTET(name, data) \
     { name, OSSL_PARAM_OCTET_STRING, ITM(data) }
-#define ST_KAT_PARAM_UTF8STRING(name, data)                                    \
+#define ST_KAT_PARAM_UTF8STRING(name, data) \
     { name, OSSL_PARAM_UTF8_STRING, ITM_STR(data) }
-#define ST_KAT_PARAM_UTF8CHAR(name, data)                                      \
+#define ST_KAT_PARAM_UTF8CHAR(name, data) \
     { name, OSSL_PARAM_UTF8_STRING, ITM(data) }
-#define ST_KAT_PARAM_INT(name, i)                                              \
+#define ST_KAT_PARAM_INT(name, i) \
     { name, OSSL_PARAM_INTEGER, ITM(i) }

-/* used to store raw parameters for keys and algorithms */
-typedef struct st_kat_param_st {
-    const char *name;  /* an OSSL_PARAM name */
-    size_t type;       /* the type associated with the data */
-    const void *data;  /* unsigned char [], or char [] depending on the type */
-    size_t data_len;   /* the length of the data */
-} ST_KAT_PARAM;
-
-typedef struct st_kat_st {
-    const char *desc;
-    const char *algorithm;
-    const unsigned char *pt;
-    size_t pt_len;
-    const unsigned char *expected;
-    size_t expected_len;
-} ST_KAT;
-
-#define CIPHER_MODE_ENCRYPT 1
-#define CIPHER_MODE_DECRYPT 2
-#define CIPHER_MODE_ALL     (CIPHER_MODE_ENCRYPT | CIPHER_MODE_DECRYPT)
-
-/* FIPS 140-3 only allows DSA verification for legacy purposes */
-#define SIGNATURE_MODE_VERIFY_ONLY  1
-#define SIGNATURE_MODE_SIGN_ONLY    2
-#define SIGNATURE_MODE_DIGESTED     4
-#define SIGNATURE_MODE_SIG_DIGESTED 8
-
-typedef ST_KAT ST_KAT_DIGEST;
-typedef struct st_kat_cipher_st {
-    ST_KAT base;
-    int mode;
-    const unsigned char *key;
-    size_t key_len;
-    const unsigned char *iv;
-    size_t iv_len;
-    const unsigned char *aad;
-    size_t aad_len;
-    const unsigned char *tag;
-    size_t tag_len;
-} ST_KAT_CIPHER;
-
-typedef struct st_kat_kdf_st {
-    const char *desc;
-    const char *algorithm;
-    const ST_KAT_PARAM *params;
-    const unsigned char *expected;
-    size_t expected_len;
-} ST_KAT_KDF;
-
-typedef struct st_kat_drbg_st {
-    const char *desc;
-    const char *algorithm;
-    const char *param_name;
-    char *param_value;
-    const unsigned char *entropyin;
-    size_t entropyinlen;
-    const unsigned char *nonce;
-    size_t noncelen;
-    const unsigned char *persstr;
-    size_t persstrlen;
-    const unsigned char *entropyinpr1;
-    size_t entropyinpr1len;
-    const unsigned char *entropyinpr2;
-    size_t entropyinpr2len;
-    const unsigned char *entropyaddin1;
-    size_t entropyaddin1len;
-    const unsigned char *entropyaddin2;
-    size_t entropyaddin2len;
-    const unsigned char *expected;
-    size_t expectedlen;
-} ST_KAT_DRBG;
-
-typedef struct st_kat_kas_st {
-    const char *desc;
-    const char *algorithm;
-
-    const ST_KAT_PARAM *key_group;
-    const ST_KAT_PARAM *key_host_data;
-    const ST_KAT_PARAM *key_peer_data;
-
-    const unsigned char *expected;
-    size_t expected_len;
-} ST_KAT_KAS;
-
-typedef struct st_kat_sign_st {
-    const char *desc;
-    const char *keytype;
-    const char *sigalgorithm;
-    int mode;
-    const ST_KAT_PARAM *key;
-    const unsigned char *msg;
-    size_t msg_len;
-    const unsigned char *entropy;
-    size_t entropy_len;
-    const unsigned char *nonce;
-    size_t nonce_len;
-    const unsigned char *persstr;
-    size_t persstr_len;
-    const unsigned char *sig_expected; /* Set to NULL if this value changes */
-    size_t sig_expected_len;
-    const ST_KAT_PARAM *init;
-    const ST_KAT_PARAM *verify;
-} ST_KAT_SIGN;
-
-typedef struct st_kat_asym_cipher_st {
-    const char *desc;
-    const char *algorithm;
-    int encrypt;
-    const ST_KAT_PARAM *key;
-    const ST_KAT_PARAM *postinit;
-    const unsigned char *in;
-    size_t in_len;
-    const unsigned char *expected;
-    size_t expected_len;
-} ST_KAT_ASYM_CIPHER;
-
-typedef struct st_kat_keygen_st {
-    const char *desc;
-    const char *algorithm;
-    const ST_KAT_PARAM *keygen_params;
-    const ST_KAT_PARAM *expected_params;
-} ST_KAT_ASYM_KEYGEN;
-
-typedef struct st_kat_kem_st {
-    const char *desc;
-    const char *algorithm;
-    const ST_KAT_PARAM *key;
-    const unsigned char *cipher_text;
-    size_t cipher_text_len;
-    const unsigned char *entropy;
-    size_t entropy_len;
-    const unsigned char *secret;
-    size_t secret_len;
-    const unsigned char *reject_secret;
-} ST_KAT_KEM;
-
 /*- DIGEST SELF TEST DATA */
 static const unsigned char sha1_pt[] = "abc";
 static const unsigned char sha1_digest[] = {
@@ -175,6 +49,13 @@ static const unsigned char sha1_digest[] = {
     0xBA, 0x3E, 0x25, 0x71, 0x78, 0x50, 0xC2, 0x6C,
     0x9C, 0xD0, 0xD8, 0x9D
 };
+static const unsigned char sha256_pt[] = "abc";
+static const unsigned char sha256_digest[] = {
+    0xBA, 0x78, 0x16, 0xBF, 0x8F, 0x01, 0xCF, 0xEA,
+    0x41, 0x41, 0x40, 0xDE, 0x5D, 0xAE, 0x22, 0x23,
+    0xB0, 0x03, 0x61, 0xA3, 0x96, 0x17, 0x7A, 0x9C,
+    0xB4, 0x10, 0xFF, 0x61, 0xF2, 0x00, 0x15, 0xAD
+};
 static const unsigned char sha512_pt[] = "abc";
 static const unsigned char sha512_digest[] = {
     0xDD, 0xAF, 0x35, 0xA1, 0x93, 0x61, 0x7A, 0xBA, 0xCC, 0x41, 0x73, 0x49,
@@ -191,33 +72,6 @@ static const unsigned char sha3_256_digest[] = {
     0x89, 0x77, 0x7f, 0x05, 0x1e, 0x40, 0x46, 0xae
 };

-/*
- * Note:
- *  SHA256 is tested by higher level algorithms so a
- *  CAST is not needed.
- */
-static const ST_KAT_DIGEST st_kat_digest_tests[] =
-{
-    {
-         OSSL_SELF_TEST_DESC_MD_SHA1,
-         "SHA1",
-         ITM_STR(sha1_pt),
-         ITM(sha1_digest),
-    },
-    {
-         OSSL_SELF_TEST_DESC_MD_SHA2,
-         "SHA512",
-         ITM_STR(sha512_pt),
-         ITM(sha512_digest),
-    },
-    {
-         OSSL_SELF_TEST_DESC_MD_SHA3,
-         "SHA3-256",
-         ITM(sha3_256_pt),
-         ITM(sha3_256_digest),
-    },
-};
-
 /*- CIPHER TEST DATA */

 /* AES-256 GCM test data */
@@ -262,6 +116,11 @@ static const unsigned char aes_128_ecb_ct[] = {
     0x4e, 0xaa, 0x6f, 0xb4, 0xdb, 0xf7, 0x84, 0x65
 };

+static const self_test_id_t aes_ecb_depends_on[] = {
+    ST_ID_CIPHER_AES_256_GCM,
+    ST_ID_MAX
+};
+
 #ifndef OPENSSL_NO_DES
 /*
  * TDES-ECB test data from
@@ -281,43 +140,137 @@ static const unsigned char tdes_pt[] = {
 };
 #endif

-static const ST_KAT_CIPHER st_kat_cipher_tests[] = {
-    {
-        {
-            OSSL_SELF_TEST_DESC_CIPHER_AES_GCM,
-            "AES-256-GCM",
-            ITM(aes_256_gcm_pt),
-            ITM(aes_256_gcm_ct)
-        },
-        CIPHER_MODE_ENCRYPT | CIPHER_MODE_DECRYPT,
-        ITM(aes_256_gcm_key),
-        ITM(aes_256_gcm_iv),
-        ITM(aes_256_gcm_aad),
-        ITM(aes_256_gcm_tag)
-    },
-    {
-        {
-            OSSL_SELF_TEST_DESC_CIPHER_AES_ECB,
-            "AES-128-ECB",
-            ITM(aes_128_ecb_pt),
-            ITM(aes_128_ecb_ct)
-        },
-        CIPHER_MODE_DECRYPT,
-        ITM(aes_128_ecb_key)
-    },
-#ifndef OPENSSL_NO_DES
-    {
-        {
-            OSSL_SELF_TEST_DESC_CIPHER_TDES,
-            "DES-EDE3-ECB",
-            ITM(tdes_pt),
-            ITM(tdes_ct)
-        },
-        CIPHER_MODE_DECRYPT,
-        ITM(tdes_key)
-    }
-#endif
+#ifndef OPENSSL_NO_LMS
+/*
+ * Test vector from
+ * https://datatracker.ietf.org/doc/html/draft-fluhrer-lms-more-parm-sets-15#name-test-cases
+ */
+
+static const unsigned char sha256_192_pub[] = {
+    0x00, 0x00, 0x00, 0x0A,
+    0x00, 0x00, 0x00, 0x08,
+    0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+    0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+    0x2c, 0x57, 0x14, 0x50, 0xae, 0xd9, 0x9c, 0xfb,
+    0x4f, 0x4a, 0xc2, 0x85, 0xda, 0x14, 0x88, 0x27,
+    0x96, 0x61, 0x83, 0x14, 0x50, 0x8b, 0x12, 0xd2
+};
+
+static const unsigned char sha256_192_msg[] = {
+    0x54, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x73,
+    0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72,
+    0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x2d,
+    0x31, 0x39, 0x32, 0x0a
+};
+
+static const unsigned char sha256_192_sig[] = {
+    /* L = 1,  q = 5 */
+    0x00, 0x00, 0x00, 0x05,
+    0x00, 0x00, 0x00, 0x08,
+    0x0b, 0x50, 0x40, 0xa1, 0x8c, 0x1b, 0x5c, 0xab,
+    0xcb, 0xc8, 0x5b, 0x04, 0x74, 0x02, 0xec, 0x62,
+    0x94, 0xa3, 0x0d, 0xd8, 0xda, 0x8f, 0xc3, 0xda,
+    0xe1, 0x3b, 0x9f, 0x08, 0x75, 0xf0, 0x93, 0x61,
+    0xdc, 0x77, 0xfc, 0xc4, 0x48, 0x1e, 0xa4, 0x63,
+    0xc0, 0x73, 0x71, 0x62, 0x49, 0x71, 0x91, 0x93,
+    0x61, 0x4b, 0x83, 0x5b, 0x46, 0x94, 0xc0, 0x59,
+    0xf1, 0x2d, 0x3a, 0xed, 0xd3, 0x4f, 0x3d, 0xb9,
+    0x3f, 0x35, 0x80, 0xfb, 0x88, 0x74, 0x3b, 0x8b,
+    0x3d, 0x06, 0x48, 0xc0, 0x53, 0x7b, 0x7a, 0x50,
+    0xe4, 0x33, 0xd7, 0xea, 0x9d, 0x66, 0x72, 0xff,
+    0xfc, 0x5f, 0x42, 0x77, 0x0f, 0xea, 0xb4, 0xf9,
+    0x8e, 0xb3, 0xf3, 0xb2, 0x3f, 0xd2, 0x06, 0x1e,
+    0x4d, 0x0b, 0x38, 0xf8, 0x32, 0x86, 0x0a, 0xe7,
+    0x66, 0x73, 0xad, 0x1a, 0x1a, 0x52, 0xa9, 0x00,
+    0x5d, 0xcf, 0x1b, 0xfb, 0x56, 0xfe, 0x16, 0xff,
+    0x72, 0x36, 0x27, 0x61, 0x2f, 0x9a, 0x48, 0xf7,
+    0x90, 0xf3, 0xc4, 0x7a, 0x67, 0xf8, 0x70, 0xb8,
+    0x1e, 0x91, 0x9d, 0x99, 0x91, 0x9c, 0x8d, 0xb4,
+    0x81, 0x68, 0x83, 0x8c, 0xec, 0xe0, 0xab, 0xfb,
+    0x68, 0x3d, 0xa4, 0x8b, 0x92, 0x09, 0x86, 0x8b,
+    0xe8, 0xec, 0x10, 0xc6, 0x3d, 0x8b, 0xf8, 0x0d,
+    0x36, 0x49, 0x8d, 0xfc, 0x20, 0x5d, 0xc4, 0x5d,
+    0x0d, 0xd8, 0x70, 0x57, 0x2d, 0x6d, 0x8f, 0x1d,
+    0x90, 0x17, 0x7c, 0xf5, 0x13, 0x7b, 0x8b, 0xbf,
+    0x7b, 0xcb, 0x67, 0xa4, 0x6f, 0x86, 0xf2, 0x6c,
+    0xfa, 0x5a, 0x44, 0xcb, 0xca, 0xa4, 0xe1, 0x8d,
+    0xa0, 0x99, 0xa9, 0x8b, 0x0b, 0x3f, 0x96, 0xd5,
+    0xac, 0x8a, 0xc3, 0x75, 0xd8, 0xda, 0x2a, 0x7c,
+    0x24, 0x80, 0x04, 0xba, 0x11, 0xd7, 0xac, 0x77,
+    0x5b, 0x92, 0x18, 0x35, 0x9c, 0xdd, 0xab, 0x4c,
+    0xf8, 0xcc, 0xc6, 0xd5, 0x4c, 0xb7, 0xe1, 0xb3,
+    0x5a, 0x36, 0xdd, 0xc9, 0x26, 0x5c, 0x08, 0x70,
+    0x63, 0xd2, 0xfc, 0x67, 0x42, 0xa7, 0x17, 0x78,
+    0x76, 0x47, 0x6a, 0x32, 0x4b, 0x03, 0x29, 0x5b,
+    0xfe, 0xd9, 0x9f, 0x2e, 0xaf, 0x1f, 0x38, 0x97,
+    0x05, 0x83, 0xc1, 0xb2, 0xb6, 0x16, 0xaa, 0xd0,
+    0xf3, 0x1c, 0xd7, 0xa4, 0xb1, 0xbb, 0x0a, 0x51,
+    0xe4, 0x77, 0xe9, 0x4a, 0x01, 0xbb, 0xb4, 0xd6,
+    0xf8, 0x86, 0x6e, 0x25, 0x28, 0xa1, 0x59, 0xdf,
+    0x3d, 0x6c, 0xe2, 0x44, 0xd2, 0xb6, 0x51, 0x8d,
+    0x1f, 0x02, 0x12, 0x28, 0x5a, 0x3c, 0x2d, 0x4a,
+    0x92, 0x70, 0x54, 0xa1, 0xe1, 0x62, 0x0b, 0x5b,
+    0x02, 0xaa, 0xb0, 0xc8, 0xc1, 0x0e, 0xd4, 0x8a,
+    0xe5, 0x18, 0xea, 0x73, 0xcb, 0xa8, 0x1f, 0xcf,
+    0xff, 0x88, 0xbf, 0xf4, 0x61, 0xda, 0xc5, 0x1e,
+    0x7a, 0xb4, 0xca, 0x75, 0xf4, 0x7a, 0x62, 0x59,
+    0xd2, 0x48, 0x20, 0xb9, 0x99, 0x57, 0x92, 0xd1,
+    0x39, 0xf6, 0x1a, 0xe2, 0xa8, 0x18, 0x6a, 0xe4,
+    0xe3, 0xc9, 0xbf, 0xe0, 0xaf, 0x2c, 0xc7, 0x17,
+    0xf4, 0x24, 0xf4, 0x1a, 0xa6, 0x7f, 0x03, 0xfa,
+    0xed, 0xb0, 0x66, 0x51, 0x15, 0xf2, 0x06, 0x7a,
+    0x46, 0x84, 0x3a, 0x4c, 0xbb, 0xd2, 0x97, 0xd5,
+    0xe8, 0x3b, 0xc1, 0xaa, 0xfc, 0x18, 0xd1, 0xd0,
+    0x3b, 0x3d, 0x89, 0x4e, 0x85, 0x95, 0xa6, 0x52,
+    0x60, 0x73, 0xf0, 0x2a, 0xb0, 0xf0, 0x8b, 0x99,
+    0xfd, 0x9e, 0xb2, 0x08, 0xb5, 0x9f, 0xf6, 0x31,
+    0x7e, 0x55, 0x45, 0xe6, 0xf9, 0xad, 0x5f, 0x9c,
+    0x18, 0x3a, 0xbd, 0x04, 0x3d, 0x5a, 0xcd, 0x6e,
+    0xb2, 0xdd, 0x4d, 0xa3, 0xf0, 0x2d, 0xbc, 0x31,
+    0x67, 0xb4, 0x68, 0x72, 0x0a, 0x4b, 0x8b, 0x92,
+    0xdd, 0xfe, 0x79, 0x60, 0x99, 0x8b, 0xb7, 0xa0,
+    0xec, 0xf2, 0xa2, 0x6a, 0x37, 0x59, 0x82, 0x99,
+    0x41, 0x3f, 0x7b, 0x2a, 0xec, 0xd3, 0x9a, 0x30,
+    0xce, 0xc5, 0x27, 0xb4, 0xd9, 0x71, 0x0c, 0x44,
+    0x73, 0x63, 0x90, 0x22, 0x45, 0x1f, 0x50, 0xd0,
+    0x1c, 0x04, 0x57, 0x12, 0x5d, 0xa0, 0xfa, 0x44,
+    0x29, 0xc0, 0x7d, 0xad, 0x85, 0x9c, 0x84, 0x6c,
+    0xbb, 0xd9, 0x3a, 0xb5, 0xb9, 0x1b, 0x01, 0xbc,
+    0x77, 0x0b, 0x08, 0x9c, 0xfe, 0xde, 0x6f, 0x65,
+    0x1e, 0x86, 0xdd, 0x7c, 0x15, 0x98, 0x9c, 0x8b,
+    0x53, 0x21, 0xde, 0xa9, 0xca, 0x60, 0x8c, 0x71,
+    0xfd, 0x86, 0x23, 0x23, 0x07, 0x2b, 0x82, 0x7c,
+    0xee, 0x7a, 0x7e, 0x28, 0xe4, 0xe2, 0xb9, 0x99,
+    0x64, 0x72, 0x33, 0xc3, 0x45, 0x69, 0x44, 0xbb,
+    0x7a, 0xef, 0x91, 0x87, 0xc9, 0x6b, 0x3f, 0x5b,
+    0x79, 0xfb, 0x98, 0xbc, 0x76, 0xc3, 0x57, 0x4d,
+    0xd0, 0x6f, 0x0e, 0x95, 0x68, 0x5e, 0x5b, 0x3a,
+    0xef, 0x3a, 0x54, 0xc4, 0x15, 0x5f, 0xe3, 0xad,
+    0x81, 0x77, 0x49, 0x62, 0x9c, 0x30, 0xad, 0xbe,
+    0x89, 0x7c, 0x4f, 0x44, 0x54, 0xc8, 0x6c, 0x49,
+    0x00, 0x00, 0x00, 0x0a,
+    0xe9, 0xca, 0x10, 0xea, 0xa8, 0x11, 0xb2, 0x2a,
+    0xe0, 0x7f, 0xb1, 0x95, 0xe3, 0x59, 0x0a, 0x33,
+    0x4e, 0xa6, 0x42, 0x09, 0x94, 0x2f, 0xba, 0xe3,
+    0x38, 0xd1, 0x9f, 0x15, 0x21, 0x82, 0xc8, 0x07,
+    0xd3, 0xc4, 0x0b, 0x18, 0x9d, 0x3f, 0xcb, 0xea,
+    0x94, 0x2f, 0x44, 0x68, 0x24, 0x39, 0xb1, 0x91,
+    0x33, 0x2d, 0x33, 0xae, 0x0b, 0x76, 0x1a, 0x2a,
+    0x8f, 0x98, 0x4b, 0x56, 0xb2, 0xac, 0x2f, 0xd4,
+    0xab, 0x08, 0x22, 0x3a, 0x69, 0xed, 0x1f, 0x77,
+    0x19, 0xc7, 0xaa, 0x7e, 0x9e, 0xee, 0x96, 0x50,
+    0x4b, 0x0e, 0x60, 0xc6, 0xbb, 0x5c, 0x94, 0x2d,
+    0x69, 0x5f, 0x04, 0x93, 0xeb, 0x25, 0xf8, 0x0a,
+    0x58, 0x71, 0xcf, 0xfd, 0x13, 0x1d, 0x0e, 0x04,
+    0xff, 0xe5, 0x06, 0x5b, 0xc7, 0x87, 0x5e, 0x82,
+    0xd3, 0x4b, 0x40, 0xb6, 0x9d, 0xd9, 0xf3, 0xc1
+};
+
+static const ST_KAT_PARAM lms_key[] = {
+    ST_KAT_PARAM_OCTET(OSSL_PKEY_PARAM_PUB_KEY, sha256_192_pub),
+    ST_KAT_PARAM_END()
 };
+#endif /* OPENSSL_NO_LMS */

 static const char hkdf_digest[] = "SHA256";
 /*
@@ -354,6 +307,286 @@ static const ST_KAT_PARAM hkdf_params[] = {
     ST_KAT_PARAM_END()
 };

+#ifndef OPENSSL_NO_IKEV2KDF
+static const char ikev2kdf_digest[] = "SHA256";
+
+static const unsigned char ikev2kdf_ni[] = {
+    0x36, 0x51, 0xfe, 0xf5, 0xc9, 0xc3, 0x5e, 0x93
+};
+
+static const unsigned char ikev2kdf_nr[] = {
+    0xc0, 0x9a, 0x8b, 0x90, 0xa3, 0xf0, 0x4d, 0x59
+};
+
+static const unsigned char ikev2kdf_spi_init[] = {
+    0x8e, 0x5c, 0x3a, 0xe5, 0x07, 0x22, 0x16, 0x84
+};
+
+static const unsigned char ikev2kdf_spi_resp[] = {
+    0xb1, 0xf2, 0x01, 0xbb, 0x15, 0x5c, 0x3a, 0xcd
+};
+
+static const unsigned char ikev2kdf_gir[] = {
+    0xd0, 0x84, 0xa3, 0x01, 0x66, 0xa5, 0x0f, 0xb7, 0x32, 0x5c, 0x39, 0x60,
+    0x87, 0x4a, 0x83, 0x94, 0x49, 0xef, 0x97, 0x41, 0xc2, 0xf4, 0xf9, 0x47,
+    0xd0, 0x20, 0x1d, 0xd8, 0xc1, 0x26, 0x92, 0x73, 0xd7, 0x95, 0x09, 0xf3,
+    0x7e, 0x3c, 0xa3, 0xeb, 0x4f, 0xa2, 0xfe, 0x2a, 0x28, 0x25, 0x4e, 0x28,
+    0x9c, 0xd3, 0xf3, 0x4d, 0xad, 0x4e, 0xb4, 0xdf, 0x1a, 0x07, 0x68, 0x5a,
+    0x4b, 0x8a, 0x94, 0xfa, 0x61, 0xe2, 0x49, 0x1f, 0x75, 0x98, 0xb3, 0xce,
+    0x65, 0x54, 0x7f, 0xf1, 0x33, 0xb3, 0xf6, 0x3d, 0x1a, 0xc4, 0x17, 0x5e,
+    0xaa, 0x69, 0x50, 0x33, 0xf3, 0xce, 0xdb, 0x02, 0x6a, 0x68, 0x73, 0xa3,
+    0x64, 0x55, 0x17, 0x2a, 0x85, 0x40, 0xb8, 0xa5, 0xd2, 0x3a, 0x01, 0x43,
+    0xbe, 0xd0, 0x39, 0x0e, 0xe4, 0x9b, 0x16, 0x82, 0x69, 0xd7, 0x5f, 0xff,
+    0xee, 0x9f, 0xb6, 0x2b, 0xe9, 0x65, 0x99, 0x3c
+};
+
+static const unsigned char ikev2kdf_new_gir[] = {
+    0x52, 0xf0, 0x0a, 0xb1, 0x74, 0xc2, 0x5d, 0x5b, 0x71, 0x39, 0xae, 0x5f,
+    0xf4, 0xe8, 0xe9, 0xed, 0xde, 0xe5, 0x99, 0x2d, 0x2e, 0x36, 0xad, 0xf8,
+    0xa5, 0x59, 0xff, 0xd9, 0x0d, 0xab, 0x14, 0x42, 0xe4, 0xfb, 0xe4, 0x29,
+    0xd3, 0x20, 0xc0, 0xf3, 0x35, 0x52, 0xa1, 0x7d, 0x15, 0x57, 0xfa, 0x41,
+    0xea, 0x70, 0xe8, 0xfb, 0x91, 0x6c, 0x4f, 0xa2, 0x7e, 0xd5, 0x2b, 0x5f,
+    0x8e, 0xbd, 0x84, 0x61, 0xaf, 0xa7, 0x8f, 0x11, 0x59, 0x15, 0x9a, 0x64,
+    0x05, 0x5a, 0xc5, 0xf6, 0x31, 0x9e, 0x29, 0xc2, 0x8e, 0xae, 0x58, 0xcb,
+    0xc6, 0x84, 0x77, 0x70, 0xf3, 0x2c, 0x3f, 0xed, 0x1d, 0x04, 0x75, 0x04,
+    0x84, 0xf8, 0x54, 0x79, 0x0f, 0x95, 0xe9, 0xec, 0x01, 0xbc, 0x5b, 0xc4,
+    0x61, 0xf2, 0x49, 0x66, 0x46, 0x2e, 0x35, 0x95, 0x11, 0x32, 0x93, 0x05,
+    0x03, 0x8e, 0x94, 0xde, 0xb6, 0xdd, 0x42, 0xc2
+};
+
+static const unsigned char ikev2kdf_expected_seedkey[] = {
+    0xEF, 0xAA, 0x7A, 0xB0, 0xEA, 0xA8, 0x5A, 0x3D,
+    0x0B, 0xE2, 0x10, 0x0C, 0xD4, 0xB6, 0xFE, 0x00,
+    0xFF, 0x50, 0x25, 0xA9, 0xEA, 0xFD, 0xDB, 0x3E,
+    0xF5, 0x18, 0xE9, 0xF0, 0xD3, 0xFE, 0x60, 0xE6
+};
+
+static const unsigned char ikev2kdf_expected_dkm[] = {
+    0x46, 0x2B, 0x9D, 0xD5, 0x25, 0xD4, 0xFD, 0x71,
+    0x16, 0x91, 0x74, 0x27, 0x27, 0x79, 0xE7, 0x04,
+    0xBA, 0xF6, 0x2C, 0x62, 0x31, 0x77, 0x9A, 0xE9,
+    0xEF, 0xE8, 0xC5, 0x8B, 0x21, 0x91, 0x6B, 0x42,
+    0x01, 0x01, 0x64, 0xAF, 0x21, 0x11, 0xEB, 0xD7,
+    0x62, 0xF6, 0x91, 0x6C, 0xA9, 0xA6, 0xF0, 0xEE,
+    0x05, 0xC8, 0xB3, 0x20, 0xE4, 0xEE, 0x27, 0x70,
+    0x55, 0x21, 0xDE, 0x25, 0x89, 0xAD, 0xEA, 0x18,
+    0x78, 0xF1, 0xA5, 0x51, 0x73, 0x8A, 0xF7, 0xC8,
+    0x8D, 0xC4, 0xF0, 0xBB, 0x0C, 0x09, 0x6A, 0x3F,
+    0x7D, 0x1F, 0x1A, 0x67, 0x0F, 0xC7, 0x9F, 0x49,
+    0xF6, 0x78, 0xD6, 0x0D, 0x66, 0x5B, 0xB3, 0x71,
+    0x0C, 0x86, 0x57, 0xF0, 0x3B, 0xA9, 0xF6, 0x2B,
+    0x9A, 0x81, 0x8D, 0x7A, 0x22, 0x89, 0x68, 0xC5,
+    0x06, 0xE2, 0x37, 0xAE, 0x95, 0x02, 0xAA, 0x6D,
+    0xB3, 0x95, 0xC6, 0x1E, 0xA6, 0xA3, 0xE7, 0x95,
+    0x04, 0xF8, 0x6B, 0x73, 0x68, 0xBF, 0xB5, 0x42,
+    0x3D, 0xF7, 0x9E, 0x48, 0x80, 0x9B, 0xBC, 0xCD,
+    0x49, 0xFD, 0x82, 0x6D, 0x02, 0x4F, 0x63, 0xD7,
+    0xC2, 0xA5, 0x56, 0x64, 0x00, 0xA1, 0x2E, 0x73,
+    0x6A, 0xA0, 0x34, 0x51, 0x04, 0x28, 0xF5, 0xEA,
+    0x00, 0x8F, 0xE2, 0xFC, 0x16, 0x88, 0x6F, 0xA3,
+    0x88, 0x27, 0x4E, 0xA6, 0xC2, 0xB4, 0xFC, 0xFC,
+    0x61, 0x41, 0xBF, 0x04, 0xF8, 0x20, 0x7E, 0xF8,
+    0xAF, 0xC2, 0x24, 0xEA, 0x10, 0x59, 0xCB, 0x22,
+    0x0D, 0xC0, 0xB2, 0x3A, 0xC0, 0xE4, 0xCC, 0xDA,
+    0x49, 0x5A, 0x4E, 0x13, 0x1B, 0x1D, 0x56, 0xE2,
+    0x23, 0xAB, 0xA5, 0xA4, 0x8E, 0x8E, 0xD1, 0xF5
+};
+
+/* sk_d = the first 32 bytes (SHA256) of ikev2kdf_expected_dkm */
+static const unsigned char ikev2kdf_sk_d[] = {
+    0x46, 0x2B, 0x9D, 0xD5, 0x25, 0xD4, 0xFD, 0x71,
+    0x16, 0x91, 0x74, 0x27, 0x27, 0x79, 0xE7, 0x04,
+    0xBA, 0xF6, 0x2C, 0x62, 0x31, 0x77, 0x9A, 0xE9,
+    0xEF, 0xE8, 0xC5, 0x8B, 0x21, 0x91, 0x6B, 0x42
+};
+
+static const unsigned char ikev2kdf_expected_dkm_sa[] = {
+    0x23, 0x64, 0x76, 0x77, 0xE7, 0xD4, 0x03, 0xFA,
+    0x1E, 0x30, 0x06, 0xF1, 0x98, 0x40, 0xAE, 0xE1,
+    0x8A, 0xD9, 0xFE, 0xCC, 0x42, 0x15, 0x81, 0x4C,
+    0x41, 0x31, 0xBD, 0xEB, 0xA9, 0x84, 0x33, 0xD8,
+    0xB0, 0xE3, 0x1B, 0xFB, 0xBD, 0xDF, 0x82, 0x2A,
+    0xBC, 0xCE, 0x5E, 0x06, 0x48, 0x6A, 0xA3, 0x88,
+    0x02, 0x2B, 0x75, 0xE2, 0x7E, 0x1E, 0x68, 0xAA,
+    0x59, 0x83, 0x02, 0x8B, 0x65, 0x28, 0x2C, 0x73,
+    0x0C, 0x5D, 0x49, 0xEF, 0x76, 0x06, 0x77, 0x03,
+    0x76, 0xCF, 0xDE, 0xC4, 0x1F, 0x7C, 0xC4, 0x35,
+    0xD8, 0x16, 0x02, 0x99, 0x89, 0xBC, 0x35, 0x3D,
+    0x3B, 0x67, 0xB9, 0xFD, 0x11, 0x68, 0xDD, 0xCB,
+    0x89, 0x78, 0x85, 0x0D, 0xA9, 0xB7, 0x52, 0xAE,
+    0xE6, 0xA3, 0x0D, 0x00, 0x86, 0xD2, 0xC4, 0xD7,
+    0x4E, 0xC0, 0xE0, 0x36, 0x48, 0xA0, 0xDA, 0xD3,
+    0x34, 0xFA, 0xF5, 0xFE, 0x88, 0x08, 0x4E, 0x67,
+    0xB0, 0xF3, 0xE8, 0xFE, 0xE8, 0xB5, 0xE1, 0xBD,
+    0x38, 0x50, 0xDB, 0x54, 0x0F, 0x1F, 0xB8, 0xCF,
+    0xFE, 0x23, 0xC9, 0xE9, 0x2C, 0xDA, 0x20, 0x93,
+    0x73, 0xF3, 0x54, 0x88, 0x0C, 0x24, 0x6C, 0x75,
+    0x3E, 0x2A, 0x0E, 0xCA, 0x9C, 0xB7, 0x3B, 0x99,
+    0x10, 0xA8, 0x53, 0x1C, 0x40, 0x10, 0xE6, 0x76,
+    0x8F, 0xA2, 0x9F, 0x90, 0x9E, 0x60, 0xAF, 0x77,
+    0x7F, 0xED, 0x6E, 0x73, 0x9C, 0x3C, 0xFD, 0xA0,
+    0x34, 0x67, 0xE9, 0x15, 0xD6, 0xF0, 0x3F, 0xCE,
+    0x9C, 0x41, 0xF5, 0xF9, 0xD5, 0x78, 0xF8, 0x91,
+    0x2D, 0x66, 0xA7, 0x54, 0x57, 0xE7, 0x9E, 0xE1,
+    0xD5, 0xBC, 0xC2, 0xBE, 0x5C, 0x2F, 0x9B, 0xAE
+};
+
+static const unsigned char ikev2kdf_expected_dkm_dh[] = {
+    0x6A, 0x91, 0x93, 0x87, 0xA5, 0xFA, 0x28, 0x35,
+    0xFE, 0x8A, 0x82, 0x37, 0xE4, 0xA1, 0x48, 0x45,
+    0xBD, 0x2B, 0x99, 0x30, 0xDB, 0x87, 0xEF, 0xF7,
+    0xAD, 0xF2, 0x68, 0xF6, 0x21, 0x86, 0x00, 0x49,
+    0x02, 0xDB, 0xA9, 0xAA, 0x94, 0x2D, 0x02, 0x59,
+    0xA0, 0xED, 0xC4, 0x12, 0x0B, 0x93, 0x2A, 0x50,
+    0x38, 0x65, 0xB5, 0x7B, 0xA8, 0xFB, 0x88, 0x11,
+    0x7E, 0xF5, 0xDF, 0x7B, 0x26, 0x79, 0x9C, 0xD8,
+    0xBA, 0x37, 0xAA, 0x54, 0x38, 0x10, 0x8C, 0xB1,
+    0xA4, 0xFE, 0x11, 0x79, 0x07, 0xC9, 0xD0, 0x59,
+    0x7B, 0x70, 0x8C, 0x3F, 0x11, 0x15, 0x1F, 0xEF,
+    0xD6, 0x24, 0xD2, 0x31, 0x72, 0x02, 0xB7, 0xC8,
+    0x14, 0x30, 0x60, 0x0E, 0x6F, 0xCB, 0xB6, 0xE1,
+    0xA8, 0xDF, 0x2B, 0x48, 0x61, 0xEF, 0x23, 0x63,
+    0xD5, 0x3D, 0xE1, 0xBE, 0x69, 0x05, 0x7B, 0x0C,
+    0xF6, 0x63, 0x4A, 0x7E, 0x7B, 0xFA, 0x97, 0xB3,
+    0xC2, 0x81, 0x06, 0x23, 0xE2, 0xBD, 0x67, 0x57,
+    0x73, 0x87, 0x77, 0x17, 0x70, 0x36, 0xE9, 0xC3,
+    0xA3, 0x97, 0x94, 0x45, 0x69, 0x54, 0xBD, 0x41,
+    0xFC, 0x44, 0x4A, 0x12, 0x50, 0x7A, 0xB9, 0xCA,
+    0xC6, 0x9A, 0x05, 0x40, 0xD1, 0x3C, 0x29, 0xDB,
+    0x85, 0x10, 0xF5, 0x66, 0xA6, 0x91, 0x69, 0x1B,
+    0xAA, 0x2D, 0x95, 0x69, 0xDA, 0xCC, 0x99, 0x0D,
+    0x56, 0xA4, 0x54, 0xBB, 0x44, 0x4B, 0xCB, 0xBE,
+    0x87, 0x51, 0xB0, 0x55, 0x0A, 0x52, 0x78, 0x81,
+    0x2F, 0xC5, 0xAB, 0x4F, 0x28, 0x99, 0x0D, 0xD6,
+    0xD6, 0x08, 0x53, 0x8D, 0x7D, 0xDD, 0xE2, 0x4D,
+    0xC8, 0x1B, 0xDA, 0xAC, 0xA7, 0x75, 0x1F, 0xDE
+};
+
+static const unsigned char ikev2kdf_expected_rekey[] = {
+    0x90, 0x72, 0x2C, 0x42, 0xBD, 0x84, 0x9E, 0x9B,
+    0x72, 0xD2, 0x40, 0xFC, 0x25, 0x41, 0x74, 0x27,
+    0x0F, 0xA8, 0x29, 0x5D, 0xE6, 0xF0, 0x33, 0x8D,
+    0xAF, 0xC3, 0x03, 0xA9, 0xEC, 0x10, 0x4F, 0x12
+};
+
+static const int ikev2kdf_mode_gen = EVP_KDF_IKEV2_MODE_GEN;
+static const ST_KAT_PARAM ikev2kdf_gen_params[] = {
+    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, ikev2kdf_digest),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_IKEV2KDF_NI, ikev2kdf_ni),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_IKEV2KDF_NR, ikev2kdf_nr),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_SECRET, ikev2kdf_gir),
+    ST_KAT_PARAM_INT(OSSL_KDF_PARAM_MODE, ikev2kdf_mode_gen),
+    ST_KAT_PARAM_END()
+};
+
+static const int ikev2kdf_mode_dkm = EVP_KDF_IKEV2_MODE_DKM;
+static const ST_KAT_PARAM ikev2kdf_dkm_params_dkm[] = {
+    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, ikev2kdf_digest),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_IKEV2KDF_NI, ikev2kdf_ni),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_IKEV2KDF_NR, ikev2kdf_nr),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_IKEV2KDF_SPII, ikev2kdf_spi_init),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_IKEV2KDF_SPIR, ikev2kdf_spi_resp),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_SEED, ikev2kdf_expected_seedkey),
+    ST_KAT_PARAM_INT(OSSL_KDF_PARAM_MODE, ikev2kdf_mode_dkm),
+    ST_KAT_PARAM_END()
+};
+
+static const ST_KAT_PARAM ikev2kdf_dkm_params_sa[] = {
+    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, ikev2kdf_digest),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_IKEV2KDF_NI, ikev2kdf_ni),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_IKEV2KDF_NR, ikev2kdf_nr),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_KEY, ikev2kdf_sk_d),
+    ST_KAT_PARAM_INT(OSSL_KDF_PARAM_MODE, ikev2kdf_mode_dkm),
+    ST_KAT_PARAM_END()
+};
+
+static const ST_KAT_PARAM ikev2kdf_dkm_params_dh[] = {
+    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, ikev2kdf_digest),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_IKEV2KDF_NI, ikev2kdf_ni),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_IKEV2KDF_NR, ikev2kdf_nr),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_KEY, ikev2kdf_sk_d),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_SECRET, ikev2kdf_new_gir),
+    ST_KAT_PARAM_INT(OSSL_KDF_PARAM_MODE, ikev2kdf_mode_dkm),
+    ST_KAT_PARAM_END()
+};
+
+static const int ikev2kdf_mode_rekey = EVP_KDF_IKEV2_MODE_REKEY;
+
+static const ST_KAT_PARAM ikev2kdf_rekey_params[] = {
+    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, ikev2kdf_digest),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_IKEV2KDF_NI, ikev2kdf_ni),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_IKEV2KDF_NR, ikev2kdf_nr),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_SECRET, ikev2kdf_new_gir),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_KEY, ikev2kdf_sk_d),
+    ST_KAT_PARAM_INT(OSSL_KDF_PARAM_MODE, ikev2kdf_mode_rekey),
+    ST_KAT_PARAM_END()
+};
+#endif
+
+#ifndef OPENSSL_NO_SNMPKDF
+static const char snmpkdf_digest[] = "SHA256";
+static const unsigned char snmpkdf_eid[] = {
+    0x80, 0x00, 0x02, 0xb8, 0x05, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde,
+    0xf0, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56,
+    0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56
+};
+static const unsigned char snmpkdf_password[] = {
+    0x74, 0x63, 0x6f, 0x54, 0x49, 0x48, 0x6d, 0x77, 0x63, 0x46, 0x6c, 0x50,
+    0x52, 0x65, 0x52, 0x4a
+};
+static const unsigned char snmpkdf_expected[] = {
+    0xE2, 0x3C, 0xCD, 0xA8, 0xCE, 0x93, 0x51, 0x79,
+    0xA9, 0xF0, 0x38, 0xAA, 0xEA, 0x08, 0xA0, 0xFA,
+    0x03, 0x11, 0x9D, 0x80, 0xA8, 0xCF, 0x2E, 0x98,
+    0x9F, 0xAD, 0x33, 0x2C, 0x20, 0x77, 0xE0, 0x52
+};
+static const ST_KAT_PARAM snmpkdf_params[] = {
+    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, snmpkdf_digest),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_SNMPKDF_EID, snmpkdf_eid),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_PASSWORD, snmpkdf_password),
+    ST_KAT_PARAM_END()
+};
+#endif
+
+#ifndef OPENSSL_NO_SRTPKDF
+static const char srtpkdf_cipher[] = "AES-256-CTR";
+static const int srtpkdf_kdr = 0x100;
+
+static const unsigned char srtpkdf_key[] = {
+    0x4b, 0x26, 0xfa, 0xdc, 0x0a, 0x9b, 0xe8, 0x23,
+    0xdc, 0xd6, 0xab, 0xc8, 0x2c, 0x04, 0x39, 0x75,
+    0xa6, 0x03, 0xf0, 0x05, 0x87, 0xb8, 0x75, 0x34,
+    0x60, 0xba, 0xf0, 0x50, 0x2e, 0xee, 0x66, 0xbb
+};
+
+static const unsigned char srtpkdf_salt[] = {
+    0x99, 0x74, 0xa3, 0x00, 0x33, 0x28, 0x84, 0xfb,
+    0xfa, 0x03, 0x71, 0x8c, 0xe0, 0xe0
+};
+
+static const unsigned char srtpkdf_index[] = {
+    0x6e, 0xe6, 0x30, 0x14
+};
+
+static const int srtpkdf_label = 5;
+
+static const unsigned char srtpkdf_expected[] = {
+    0x5c, 0x4e, 0x98, 0xd3, 0x29, 0x6e, 0x00, 0x9b,
+    0x45, 0x38, 0x09, 0x6d, 0x72, 0xe4
+};
+
+static const ST_KAT_PARAM srtpkdf_params[] = {
+    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_CIPHER, srtpkdf_cipher),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_KEY, srtpkdf_key),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_SALT, srtpkdf_salt),
+    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_SRTPKDF_INDEX, srtpkdf_index),
+    ST_KAT_PARAM_INT(OSSL_KDF_PARAM_SRTPKDF_KDR, srtpkdf_kdr),
+    ST_KAT_PARAM_INT(OSSL_KDF_PARAM_SRTPKDF_LABEL, srtpkdf_label),
+    ST_KAT_PARAM_END()
+};
+#endif
+
+#ifndef OPENSSL_NO_SSKDF
 static const char sskdf_digest[] = "SHA256";
 static const unsigned char sskdf_secret[] = {
     0x6d, 0xbd, 0xc2, 0x3f, 0x04, 0x54, 0x88, 0xe4,
@@ -382,7 +615,9 @@ static const ST_KAT_PARAM sskdf_params[] = {
     ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_INFO, sskdf_otherinfo),
     ST_KAT_PARAM_END()
 };
+#endif /* OPENSSL_NO_SSKDF */

+#ifndef OPENSSL_NO_X942KDF
 static const char x942kdf_digest[] = "SHA256";
 static const char x942kdf_cekalg[] = "AES-128-WRAP";
 static const unsigned char x942kdf_secret[] = {
@@ -400,7 +635,9 @@ static const ST_KAT_PARAM x942kdf_params[] = {
     ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_KEY, x942kdf_secret),
     ST_KAT_PARAM_END()
 };
+#endif /* OPENSSL_NO_X942KDF */

+#ifndef OPENSSL_NO_X963KDF
 static const char x963kdf_digest[] = "SHA256";
 static const unsigned char x963kdf_otherinfo[] = {
     0x75, 0xee, 0xf8, 0x1a, 0xa3, 0x04, 0x1e, 0x33,
@@ -423,6 +660,7 @@ static const ST_KAT_PARAM x963kdf_params[] = {
     ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_INFO, x963kdf_otherinfo),
     ST_KAT_PARAM_END()
 };
+#endif /* OPENSSL_NO_X963KDF */

 static const char pbkdf2_digest[] = "SHA256";
 /*
@@ -470,7 +708,7 @@ static const unsigned char tls12prf_secret[] = {
     0x11, 0x76, 0x45, 0x55, 0x39, 0xe7, 0x05, 0xbe,
     0x73, 0x08, 0x90, 0x60, 0x2c, 0x28, 0x9a, 0x50,
     0x01, 0xe3, 0x4e, 0xeb, 0x3a, 0x04, 0x3e, 0x5d,
-    0x52, 0xa6, 0x5e, 0x66, 0x12, 0x51, 0x88, 0xbf,
+    0x52, 0xa6, 0x5e, 0x66, 0x12, 0x51, 0x88, 0xbf
 };
 static const unsigned char tls12prf_seed[] = {
     'k', 'e', 'y', ' ', 'e', 'x', 'p', 'a', 'n', 's', 'i', 'o', 'n',
@@ -481,8 +719,8 @@ static const unsigned char tls12prf_seed[] = {
     0x62, 0xe1, 0xfd, 0x91, 0xf2, 0x3f, 0x55, 0x8a,
     0x60, 0x5f, 0x28, 0x47, 0x8c, 0x58, 0xcf, 0x72,
     0x63, 0x7b, 0x89, 0x78, 0x4d, 0x95, 0x9d, 0xf7,
-    0xe9, 0x46, 0xd3, 0xf0, 0x7b, 0xd1, 0xb6, 0x16,
- };
+    0xe9, 0x46, 0xd3, 0xf0, 0x7b, 0xd1, 0xb6, 0x16
+};
 static const unsigned char tls12prf_expected[] = {
     0xd0, 0x61, 0x39, 0x88, 0x9f, 0xff, 0xac, 0x1e,
     0x3a, 0x71, 0x86, 0x5f, 0x50, 0x4a, 0xa5, 0xd0,
@@ -499,7 +737,7 @@ static const unsigned char tls12prf_expected[] = {
     0x1a, 0xd6, 0xf6, 0x8b, 0x43, 0x49, 0x5b, 0x10,
     0xa6, 0x83, 0x75, 0x5e, 0xa2, 0xb8, 0x58, 0xd7,
     0x0c, 0xca, 0xc7, 0xec, 0x8b, 0x05, 0x3c, 0x6b,
-    0xd4, 0x1c, 0xa2, 0x99, 0xd4, 0xe5, 0x19, 0x28,
+    0xd4, 0x1c, 0xa2, 0x99, 0xd4, 0xe5, 0x19, 0x28
 };
 static const ST_KAT_PARAM tls12prf_params[] = {
     ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, tls12prf_digest),
@@ -508,19 +746,20 @@ static const ST_KAT_PARAM tls12prf_params[] = {
     ST_KAT_PARAM_END()
 };

+#ifndef OPENSSL_NO_KBKDF
 static const char kbkdf_digest[] = "SHA256";
 static const char kbkdf_mac[] = "HMAC";
 static const unsigned char kbkdf_salt[] = { 'p', 'r', 'f' };
 static const unsigned char kbkdf_prfinput[] = { 't', 'e', 's', 't' };
 static unsigned char kbkdf_key[] = {
     0x37, 0x05, 0xD9, 0x60, 0x80, 0xC1, 0x77, 0x28,
-    0xA0, 0xE8, 0x00, 0xEA, 0xB6, 0xE0, 0xD2, 0x3C,
+    0xA0, 0xE8, 0x00, 0xEA, 0xB6, 0xE0, 0xD2, 0x3C
 };
 static unsigned char kbkdf_expected[] = {
     0x9D, 0x18, 0x86, 0x16, 0xF6, 0x38, 0x52, 0xFE,
     0x86, 0x91, 0x5B, 0xB8, 0x40, 0xB4, 0xA8, 0x86,
     0xFF, 0x3E, 0x6B, 0xB0, 0xF8, 0x19, 0xB4, 0x9B,
-    0x89, 0x33, 0x93, 0xD3, 0x93, 0x85, 0x42, 0x95,
+    0x89, 0x33, 0x93, 0xD3, 0x93, 0x85, 0x42, 0x95
 };
 static const ST_KAT_PARAM kbkdf_params[] = {
     ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, kbkdf_digest),
@@ -534,21 +773,21 @@ static const ST_KAT_PARAM kbkdf_params[] = {
 static const char kbkdf_kmac_mac[] = "KMAC128";
 static unsigned char kbkdf_kmac_label[] = {
     0xB5, 0xB5, 0xF3, 0x71, 0x9F, 0xBE, 0x5B, 0x3D,
-    0x7B, 0x8D, 0x05, 0xA1, 0xD3, 0x25, 0x19, 0x50,
+    0x7B, 0x8D, 0x05, 0xA1, 0xD3, 0x25, 0x19, 0x50
 };
 static unsigned char kbkdf_kmac_context[] = {
     0x36, 0x60, 0x0E, 0xF3, 0xC3, 0x70, 0xB5, 0xEF,
-    0x58, 0xBE, 0xF1, 0xBA, 0x1C, 0xF2, 0x74, 0xCB,
+    0x58, 0xBE, 0xF1, 0xBA, 0x1C, 0xF2, 0x74, 0xCB
 };
 static unsigned char kbkdf_kmac_key[] = {
     0xB2, 0x51, 0x4C, 0xC1, 0xD5, 0xCD, 0x7B, 0x6B,
-    0xA3, 0x3C, 0x90, 0x05, 0xBD, 0xAC, 0x32, 0x2A,
+    0xA3, 0x3C, 0x90, 0x05, 0xBD, 0xAC, 0x32, 0x2A
 };
 static unsigned char kbkdf_kmac_expected[] = {
     0xB1, 0x58, 0xEE, 0xB1, 0x34, 0xA4, 0xDD, 0x9D,
     0xAC, 0x52, 0xBD, 0x9E, 0x30, 0xE8, 0x0D, 0x76,
     0x42, 0x57, 0x01, 0x89, 0x5F, 0x82, 0x74, 0xB9,
-    0xEB, 0x3E, 0x84, 0xD8, 0xA5, 0xDE, 0x6E, 0x54,
+    0xEB, 0x3E, 0x84, 0xD8, 0xA5, 0xDE, 0x6E, 0x54
 };
 static const ST_KAT_PARAM kbkdf_kmac_params[] = {
     ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_MAC, kbkdf_kmac_mac),
@@ -558,15 +797,22 @@ static const ST_KAT_PARAM kbkdf_kmac_params[] = {
     ST_KAT_PARAM_END()
 };

+static const self_test_id_t kbkdf_depends_on[] = {
+    ST_ID_KDF_KBKDF,
+    ST_ID_KDF_KBKDF_KMAC,
+    ST_ID_MAX
+};
+#endif /* OPENSSL_NO_KBKDF */
+
 static const char tls13_kdf_digest[] = "SHA256";
 static int tls13_kdf_extract_mode = EVP_KDF_HKDF_MODE_EXTRACT_ONLY;
 static int tls13_kdf_expand_mode = EVP_KDF_HKDF_MODE_EXPAND_ONLY;
 static const unsigned char tls13_kdf_prefix[] = {
-    0x74, 0x6C, 0x73, 0x31, 0x33, 0x20          /* "tls13 " */
+    0x74, 0x6C, 0x73, 0x31, 0x33, 0x20 /* "tls13 " */
 };
 static const unsigned char tls13_kdf_client_early_secret_label[] = {
     0x63, 0x20, 0x65, 0x20, 0x74, 0x72, 0x61, 0x66,
-    0x66, 0x69, 0x63                            /* "c e traffic"*/
+    0x66, 0x69, 0x63 /* "c e traffic"*/
 };
 static const unsigned char tls13_kdf_psk[] = {
     0xF8, 0xAF, 0x6A, 0xEA, 0x2D, 0x39, 0x7B, 0xAF,
@@ -606,85 +852,29 @@ static const ST_KAT_PARAM tls13_kdf_client_early_secret_params[] = {
     ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_DATA, tls13_kdf_client_hello_hash),
     ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_PREFIX, tls13_kdf_prefix),
     ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_LABEL,
-                       tls13_kdf_client_early_secret_label),
+        tls13_kdf_client_early_secret_label),
     ST_KAT_PARAM_END()
 };

 /*
- * NOTES:
- * According to FIPS 140-3 10.3.A Note18: SSH KDF is not required, since it is
- * sufficient to self-test the underlying SHA hash functions.
+ * When calling the HKDF newctx function we do not necessarily know which of
+ * the variants will be used, so we just test them all at once
  */
-static const ST_KAT_KDF st_kat_kdf_tests[] =
-{
-    {
-        OSSL_SELF_TEST_DESC_KDF_TLS13_EXTRACT,
-        OSSL_KDF_NAME_TLS1_3_KDF,
-        tls13_kdf_early_secret_params,
-        ITM(tls13_kdf_early_secret)
-    },
-    {
-        OSSL_SELF_TEST_DESC_KDF_TLS13_EXPAND,
-        OSSL_KDF_NAME_TLS1_3_KDF,
-        tls13_kdf_client_early_secret_params,
-        ITM(tls13_kdf_client_early_traffic_secret)
-    },
-    {
-        OSSL_SELF_TEST_DESC_KDF_TLS12_PRF,
-        OSSL_KDF_NAME_TLS1_PRF,
-        tls12prf_params,
-        ITM(tls12prf_expected)
-    },
-    {
-        OSSL_SELF_TEST_DESC_KDF_PBKDF2,
-        OSSL_KDF_NAME_PBKDF2,
-        pbkdf2_params,
-        ITM(pbkdf2_expected)
-    },
-    {
-        OSSL_SELF_TEST_DESC_KDF_KBKDF,
-        OSSL_KDF_NAME_KBKDF,
-        kbkdf_params,
-        ITM(kbkdf_expected)
-    },
-    {
-        OSSL_SELF_TEST_DESC_KDF_KBKDF_KMAC,
-        OSSL_KDF_NAME_KBKDF,
-        kbkdf_kmac_params,
-        ITM(kbkdf_kmac_expected)
-    },
-    {
-        OSSL_SELF_TEST_DESC_KDF_HKDF,
-        OSSL_KDF_NAME_HKDF,
-        hkdf_params,
-        ITM(hkdf_expected)
-    },
-    {
-        OSSL_SELF_TEST_DESC_KDF_SSKDF,
-        OSSL_KDF_NAME_SSKDF,
-        sskdf_params,
-        ITM(sskdf_expected)
-    },
-    {
-        OSSL_SELF_TEST_DESC_KDF_X963KDF,
-        OSSL_KDF_NAME_X963KDF,
-        x963kdf_params,
-        ITM(x963kdf_expected)
-    },
-    {
-        OSSL_SELF_TEST_DESC_KDF_X942KDF,
-        OSSL_KDF_NAME_X942KDF_ASN1,
-        x942kdf_params,
-        ITM(x942kdf_expected)
-    },
+static const self_test_id_t hkdf_depends_on[] = {
+#ifndef OPENSSL_NO_KBKDF
+    ST_ID_KDF_KBKDF,
+#endif
+    ST_ID_KDF_TLS13_EXTRACT,
+    ST_ID_KDF_TLS13_EXPAND,
+    ST_ID_MAX
 };

 /*-
-* DRBG test vectors are a small subset of
-* https://csrc.nist.rip/groups/STM/cavp/documents/drbg/drbgtestvectors.zip
-* Using the folder drbgvectors_pr_true
-* Generated for CAVS 14.3.
-*/
+ * DRBG test vectors are a small subset of
+ * https://csrc.nist.rip/groups/STM/cavp/documents/drbg/drbgtestvectors.zip
+ * Using the folder drbgvectors_pr_true
+ * Generated for CAVS 14.3.
+ */

 /*
  * Hash_DRBG.rsp
@@ -868,46 +1058,6 @@ static const unsigned char drbg_hmac_sha2_pr_expected[] = {
     0x8e, 0x30, 0x05, 0x0e, 0x04, 0x97, 0xfb, 0x0a
 };

-static const ST_KAT_DRBG st_kat_drbg_tests[] =
-{
-    {
-        OSSL_SELF_TEST_DESC_DRBG_HASH,
-        "HASH-DRBG", "digest", "SHA256",
-        ITM(drbg_hash_sha256_pr_entropyin),
-        ITM(drbg_hash_sha256_pr_nonce),
-        ITM(drbg_hash_sha256_pr_persstr),
-        ITM(drbg_hash_sha256_pr_entropyinpr0),
-        ITM(drbg_hash_sha256_pr_entropyinpr1),
-        ITM(drbg_hash_sha256_pr_addin0),
-        ITM(drbg_hash_sha256_pr_addin1),
-        ITM(drbg_hash_sha256_pr_expected)
-    },
-    {
-        OSSL_SELF_TEST_DESC_DRBG_CTR,
-        "CTR-DRBG", "cipher", "AES-128-CTR",
-        ITM(drbg_ctr_aes128_pr_df_entropyin),
-        ITM(drbg_ctr_aes128_pr_df_nonce),
-        ITM(drbg_ctr_aes128_pr_df_persstr),
-        ITM(drbg_ctr_aes128_pr_df_entropyinpr0),
-        ITM(drbg_ctr_aes128_pr_df_entropyinpr1),
-        ITM(drbg_ctr_aes128_pr_df_addin0),
-        ITM(drbg_ctr_aes128_pr_df_addin1),
-        ITM(drbg_ctr_aes128_pr_df_expected)
-    },
-    {
-        OSSL_SELF_TEST_DESC_DRBG_HMAC,
-        "HMAC-DRBG", "digest", "SHA256",
-        ITM(drbg_hmac_sha2_pr_entropyin),
-        ITM(drbg_hmac_sha2_pr_nonce),
-        ITM(drbg_hmac_sha2_pr_persstr),
-        ITM(drbg_hmac_sha2_pr_entropyinpr0),
-        ITM(drbg_hmac_sha2_pr_entropyinpr1),
-        ITM(drbg_hmac_sha2_pr_addin0),
-        ITM(drbg_hmac_sha2_pr_addin1),
-        ITM(drbg_hmac_sha2_pr_expected)
-    }
-};
-
 /* KEY EXCHANGE TEST DATA */

 #ifndef OPENSSL_NO_DH
@@ -1042,7 +1192,6 @@ static const ST_KAT_PARAM dh_peer_key[] = {
 };
 #endif /* OPENSSL_NO_DH */

-
 #ifndef OPENSSL_NO_EC
 static const char ecdh_curve_name[] = "prime256v1";
 static const unsigned char ecdh_privd[] = {
@@ -1095,32 +1244,6 @@ static const unsigned char ecdh_secret_expected[] = {
 };
 #endif /* OPENSSL_NO_EC */

-#if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_EC)
-static const ST_KAT_KAS st_kat_kas_tests[] =
-{
-# ifndef OPENSSL_NO_DH
-    {
-        OSSL_SELF_TEST_DESC_KA_DH,
-        "DH",
-        dh_group,
-        dh_host_key,
-        dh_peer_key,
-        ITM(dh_secret_expected)
-    },
-# endif /* OPENSSL_NO_DH */
-# ifndef OPENSSL_NO_EC
-    {
-        OSSL_SELF_TEST_DESC_KA_ECDH,
-        "EC",
-        ecdh_group,
-        ecdh_host_key,
-        ecdh_peer_key,
-        ITM(ecdh_secret_expected)
-    },
-# endif /* OPENSSL_NO_EC */
-};
-#endif /* !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_EC) */
-
 /* RSA key data */
 static const unsigned char rsa_n[] = {
     0xDB, 0x10, 0x1A, 0xC2, 0xA3, 0xF1, 0xDC, 0xFF,
@@ -1357,8 +1480,8 @@ static const unsigned char rsa_expected_sig[256] = {
 };

 static const unsigned char rsa_asym_plaintext_encrypt[256] = {
-   0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
-   0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+    0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+    0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10
 };
 static const unsigned char rsa_asym_expected_encrypt[256] = {
     0x54, 0xac, 0x23, 0x96, 0x1d, 0x82, 0x5d, 0x8b,
@@ -1392,38 +1515,60 @@ static const unsigned char rsa_asym_expected_encrypt[256] = {
     0x4f, 0x0f, 0xad, 0xc7, 0xd0, 0xaa, 0x47, 0xd9,
     0x9f, 0x85, 0x1b, 0x2e, 0x6c, 0x3c, 0x57, 0x04,
     0x29, 0xf4, 0xf5, 0x66, 0x7d, 0x93, 0x4a, 0xaa,
-    0x05, 0x52, 0x55, 0xc1, 0xc6, 0x06, 0x90, 0xab,
+    0x05, 0x52, 0x55, 0xc1, 0xc6, 0x06, 0x90, 0xab
+};
+
+static const self_test_id_t rsaenc_depends_on[] = {
+    ST_ID_ASYM_CIPHER_RSA_ENC,
+    ST_ID_ASYM_CIPHER_RSA_DEC,
+    ST_ID_ASYM_CIPHER_RSA_DEC_CRT,
+    ST_ID_MAX
 };

 #ifndef OPENSSL_NO_EC
 /* ECDSA key data */
-static const char ecd_prime_curve_name[] = "secp224r1";
+static const char ecd_prime_curve_name[] = "prime256v1";
 static const unsigned char ecd_prime_priv[] = {
-    0x98, 0x1f, 0xb5, 0xf1, 0xfc, 0x87, 0x1d, 0x7d,
-    0xde, 0x1e, 0x01, 0x64, 0x09, 0x9b, 0xe7, 0x1b,
-    0x9f, 0xad, 0x63, 0xdd, 0x33, 0x01, 0xd1, 0x50,
-    0x80, 0x93, 0x50, 0x30
+    0x9a, 0x98, 0xc3, 0x61, 0x56, 0xee, 0xe8, 0x27,
+    0xc3, 0x9c, 0x3d, 0xfc, 0x27, 0x05, 0x7a, 0x0d,
+    0x5a, 0x99, 0xd8, 0x24, 0xd9, 0xc5, 0x34, 0xff,
+    0xe1, 0xc1, 0x5d, 0x40, 0x1c, 0x66, 0x00, 0x17
 };
 static const unsigned char ecd_prime_pub[] = {
-    0x04, 0x95, 0x47, 0x99, 0x44, 0x29, 0x8f, 0x51,
-    0x39, 0xe2, 0x53, 0xec, 0x79, 0xb0, 0x4d, 0xde,
-    0x87, 0x1a, 0x76, 0x54, 0xd5, 0x96, 0xb8, 0x7a,
-    0x6d, 0xf4, 0x1c, 0x2c, 0x87, 0x91, 0x5f, 0xd5,
-    0x31, 0xdd, 0x24, 0xe5, 0x78, 0xd9, 0x08, 0x24,
-    0x8a, 0x49, 0x99, 0xec, 0x55, 0xf2, 0x82, 0xb3,
-    0xc4, 0xb7, 0x33, 0x68, 0xe4, 0x24, 0xa9, 0x12,
-    0x82
+    0x04, 0x17, 0xcc, 0x94, 0xc3, 0x83, 0x0b, 0xb9,
+    0x59, 0xbc, 0xf3, 0x09, 0x20, 0x05, 0xdf, 0x5e,
+    0x45, 0x5f, 0x1e, 0x5e, 0x5b, 0x57, 0x19, 0xb3,
+    0x47, 0x2e, 0xc7, 0x29, 0x43, 0xef, 0x17, 0xe2,
+    0x7c, 0xdc, 0x18, 0xf5, 0xc3, 0xf7, 0x77, 0xb5,
+    0x0c, 0xff, 0x44, 0x12, 0x8b, 0x44, 0x33, 0x5f,
+    0x87, 0x17, 0xb2, 0x55, 0xd8, 0x9e, 0xb2, 0xb8,
+    0x85, 0x19, 0x12, 0x99, 0x5b, 0xcf, 0x73, 0x80,
+    0xdf
 };
 static const unsigned char ecdsa_prime_expected_sig[] = {
-    0x30, 0x3d, 0x02, 0x1c, 0x48, 0x4f, 0x3c, 0x97,
-    0x5b, 0xfa, 0x40, 0x6c, 0xdb, 0xd6, 0x70, 0xb5,
-    0xbd, 0x2d, 0xd0, 0xc6, 0x22, 0x93, 0x5a, 0x88,
-    0x56, 0xd0, 0xaf, 0x0a, 0x94, 0x92, 0x20, 0x01,
-    0x02, 0x1d, 0x00, 0xa4, 0x80, 0xe0, 0x47, 0x88,
-    0x8a, 0xef, 0x2a, 0x47, 0x9d, 0x81, 0x9a, 0xbf,
-    0x45, 0xc3, 0x6f, 0x9e, 0x2e, 0xc1, 0x44, 0x9f,
-    0xfd, 0x79, 0xdb, 0x90, 0x3e, 0xb9, 0xb2
+    0x30, 0x46, 0x02, 0x21, 0000, 0xa8, 0x6b, 0xdb,
+    0x4e, 0xed, 0x9f, 0xd5, 0x5f, 0x62, 0x34, 0xd3,
+    0xd1, 0x4e, 0xed, 0xdf, 0x17, 0xaa, 0x9a, 0xd5,
+    0x6c, 0xa1, 0xee, 0x29, 0x39, 0x34, 0x03, 0x82,
+    0x83, 0x93, 0x6e, 0x4a, 0xc9, 0x02, 0x21, 0000,
+    0xd2, 0xed, 0x1e, 0x76, 0x75, 0x51, 0xa4, 0x38,
+    0x78, 0x98, 0xec, 0x9d, 0x03, 0x34, 0xae, 0xe8,
+    0x0f, 0x94, 0x8c, 0xc3, 0x68, 0xdb, 0xf1, 0xa8,
+    0x40, 0xde, 0x71, 0x07, 0x8b, 0x42, 0x14, 0xd9
+};
+#ifndef OPENSSL_NO_HMAC_DRBG_KDF
+static const unsigned char ecdsa_prime_expected_detsig[] = {
+    0x30, 0x44, 0x02, 0x20, 0x7f, 0x21, 0x74, 0x46,
+    0x56, 0x3b, 0x20, 0x19, 0xae, 0xd1, 0x0f, 0xa1,
+    0xef, 0x01, 0x76, 0xaf, 0x9b, 0x77, 0xe0, 0x7e,
+    0xef, 0xbb, 0x5e, 0x22, 0x37, 0xdd, 0x91, 0x27,
+    0xfe, 0x96, 0x5a, 0x54, 0x02, 0x20, 0x68, 0x0a,
+    0xb2, 0xe3, 0x84, 0xe2, 0x09, 0x08, 0x4b, 0x1a,
+    0x81, 0x7d, 0xdc, 0xb6, 0xcd, 0x95, 0x03, 0x9c,
+    0xc3, 0x9d, 0xbe, 0x49, 0xc3, 0x97, 0x22, 0xe6,
+    0x8e, 0xb4, 0x34, 0xfd, 0x79, 0xa8
 };
+#endif
 static const ST_KAT_PARAM ecdsa_prime_key[] = {
     ST_KAT_PARAM_UTF8STRING(OSSL_PKEY_PARAM_GROUP_NAME, ecd_prime_curve_name),
     ST_KAT_PARAM_OCTET(OSSL_PKEY_PARAM_PUB_KEY, ecd_prime_pub),
@@ -1431,34 +1576,44 @@ static const ST_KAT_PARAM ecdsa_prime_key[] = {
     ST_KAT_PARAM_END()
 };

-# ifndef OPENSSL_NO_EC2M
-static const char ecd_bin_curve_name[] = "sect233r1";
+static int ecdsa_nonce_type = 1;
+static const ST_KAT_PARAM ecdsa_sig_params[] = {
+    ST_KAT_PARAM_INT(OSSL_SIGNATURE_PARAM_NONCE_TYPE, ecdsa_nonce_type),
+    ST_KAT_PARAM_END()
+};
+
+#ifndef OPENSSL_NO_EC2M
+static const char ecd_bin_curve_name[] = "sect283r1";
 static const unsigned char ecd_bin_priv[] = {
-    0x00, 0x6d, 0xd6, 0x39, 0x9d, 0x2a, 0xa2, 0xc8,
-    0x8c, 0xfc, 0x7b, 0x80, 0x66, 0xaa, 0xe1, 0xaa,
-    0xba, 0xee, 0xcb, 0xfd, 0xc9, 0xe5, 0x36, 0x38,
-    0x2e, 0xf7, 0x37, 0x6d, 0xd3, 0x20
+    0x03, 0x6f, 0x76, 0x1e, 0x13, 0x62, 0xee, 0x8f,
+    0xd0, 0x86, 0x5e, 0x9c, 0xbc, 0x00, 0x19, 0xbd,
+    0x11, 0x73, 0xc7, 0xec, 0x46, 0x1f, 0xea, 0x11,
+    0x97, 0x24, 0x06, 0xfe, 0x63, 0xf5, 0xd6, 0x2d,
+    0xa7, 0x67, 0xc3, 0xec
 };
 static const unsigned char ecd_bin_pub[] = {
-    0x04, 0x00, 0x06, 0xe2, 0x56, 0xf7, 0x37, 0xf9,
-    0xea, 0xb6, 0xd1, 0x0f, 0x59, 0xfa, 0x23, 0xc3,
-    0x93, 0xa8, 0xb2, 0x26, 0xe2, 0x5c, 0x08, 0xbe,
-    0x63, 0x49, 0x26, 0xdc, 0xc7, 0x1e, 0x6f, 0x01,
-    0x32, 0x3b, 0xe6, 0x54, 0x8d, 0xc1, 0x13, 0x3e,
-    0x54, 0xb2, 0x66, 0x89, 0xb2, 0x82, 0x0a, 0x72,
-    0x02, 0xa8, 0xe9, 0x6f, 0x54, 0xfd, 0x3a, 0x6b,
-    0x99, 0xb6, 0x8f, 0x80, 0x46
+    0x04, 0x06, 0x2c, 0xfb, 0xb6, 0xce, 0xcc, 0x78,
+    0xc3, 0xb1, 0xb0, 0xbc, 0xe9, 0xf9, 0x3c, 0xbb,
+    0xd0, 0x59, 0x75, 0x89, 0x0c, 0x22, 0xa2, 0xa6,
+    0xfe, 0x40, 0x09, 0x79, 0x73, 0x61, 0000, 0x93,
+    0x49, 0x43, 0x43, 0xb6, 0xe2, 0x07, 0xc7, 0x20,
+    0x67, 0x76, 0x2b, 0x9d, 0x1e, 0x92, 0x3c, 0x7d,
+    0x95, 0x22, 0x87, 0xa0, 0x90, 0x1a, 0xd3, 0x7c,
+    0xd8, 0x37, 0x3e, 0x61, 0x41, 0x3c, 0x8a, 0x7c,
+    0x8d, 0x9a, 0x14, 0x71, 0xaa, 0xa0, 0xad, 0x4a,
+    0xc7
 };
 static const unsigned char ecdsa_bin_expected_sig[] = {
-    0x30, 0x3f, 0x02, 0x1d, 0x58, 0xe9, 0xd0, 0x84,
-    0x5c, 0xad, 0x29, 0x03, 0xf6, 0xa6, 0xbc, 0xe0,
-    0x24, 0x6d, 0x9e, 0x79, 0x5d, 0x1e, 0xe8, 0x5a,
-    0xc3, 0x31, 0x0a, 0xa9, 0xfb, 0xe3, 0x99, 0x54,
-    0x11, 0x02, 0x1e, 0x00, 0xa3, 0x44, 0x28, 0xa3,
-    0x70, 0x97, 0x98, 0x17, 0xd7, 0xa6, 0xad, 0x91,
-    0xaf, 0x41, 0x69, 0xb6, 0x06, 0x99, 0x39, 0xc7,
-    0x63, 0xa4, 0x6a, 0x81, 0xe4, 0x9a, 0x9d, 0x15,
-    0x8b
+    0x30, 0x4c, 0x02, 0x24, 0x02, 0xc5, 0x63, 0xe8,
+    0x01, 0x6d, 0x1d, 0xa6, 0xf3, 0x14, 0x01, 0x54,
+    0x50, 0xe0, 0x65, 0x65, 0x55, 0xb6, 0x3c, 0xc1,
+    0xf1, 0xfa, 0x27, 0xfd, 0x97, 0xfd, 0x6e, 0x57,
+    0xa6, 0x17, 0x6d, 0xf9, 0xf5, 0x1c, 0xdc, 0x49,
+    0x02, 0x24, 0x01, 0xa5, 0xfb, 0x75, 0x5e, 0xc4,
+    0xd3, 0xeb, 0x1a, 0xad, 0xb7, 0x08, 0xc3, 0x1e,
+    0xb8, 0xe3, 0x1c, 0x94, 0x5a, 0xd6, 0x50, 0xb8,
+    0x77, 0x0b, 0xd7, 0xad, 0x1d, 0x06, 0x64, 0x15,
+    0xca, 0x20, 0xae, 0xf3, 0x4d, 0x54
 };
 static const ST_KAT_PARAM ecdsa_bin_key[] = {
     ST_KAT_PARAM_UTF8STRING(OSSL_PKEY_PARAM_GROUP_NAME, ecd_bin_curve_name),
@@ -1466,9 +1621,21 @@ static const ST_KAT_PARAM ecdsa_bin_key[] = {
     ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_PRIV_KEY, ecd_bin_priv),
     ST_KAT_PARAM_END()
 };
-# endif /* OPENSSL_NO_EC2M */
+#endif /* OPENSSL_NO_EC2M */

-# ifndef OPENSSL_NO_ECX
+/*
+ * ECDSA has 3 tests to run, so we use dependencies to cause
+ * all of them to be run if needed by simply calling one of them
+ */
+static const self_test_id_t ecdsa_depends_on[] = {
+    ST_ID_SIG_DET_ECDSA_SHA256,
+#ifndef OPENSSL_NO_EC2M
+    ST_ID_SIG_E2CM_ECDSA_SHA256,
+#endif
+    ST_ID_MAX
+};
+
+#ifndef OPENSSL_NO_ECX
 static const unsigned char ecx_sig_msg[] = {
     0x64, 0xa6, 0x5f, 0x3c, 0xde, 0xdc, 0xdd, 0x66,
     0x81, 0x1e, 0x29, 0x15
@@ -1512,14 +1679,14 @@ static const unsigned char ed448_pub[] = {
     0x80
 };
 static const unsigned char ed448_priv[] = {
-   0x25, 0x8c, 0xdd, 0x4a, 0xda, 0x32, 0xed, 0x9c,
-   0x9f, 0xf5, 0x4e, 0x63, 0x75, 0x6a, 0xe5, 0x82,
-   0xfb, 0x8f, 0xab, 0x2a, 0xc7, 0x21, 0xf2, 0xc8,
-   0xe6, 0x76, 0xa7, 0x27, 0x68, 0x51, 0x3d, 0x93,
-   0x9f, 0x63, 0xdd, 0xdb, 0x55, 0x60, 0x91, 0x33,
-   0xf2, 0x9a, 0xdf, 0x86, 0xec, 0x99, 0x29, 0xdc,
-   0xcb, 0x52, 0xc1, 0xc5, 0xfd, 0x2f, 0xf7, 0xe2,
-   0x1b
+    0x25, 0x8c, 0xdd, 0x4a, 0xda, 0x32, 0xed, 0x9c,
+    0x9f, 0xf5, 0x4e, 0x63, 0x75, 0x6a, 0xe5, 0x82,
+    0xfb, 0x8f, 0xab, 0x2a, 0xc7, 0x21, 0xf2, 0xc8,
+    0xe6, 0x76, 0xa7, 0x27, 0x68, 0x51, 0x3d, 0x93,
+    0x9f, 0x63, 0xdd, 0xdb, 0x55, 0x60, 0x91, 0x33,
+    0xf2, 0x9a, 0xdf, 0x86, 0xec, 0x99, 0x29, 0xdc,
+    0xcb, 0x52, 0xc1, 0xc5, 0xfd, 0x2f, 0xf7, 0xe2,
+    0x1b
 };
 static const ST_KAT_PARAM ed448_key[] = {
     ST_KAT_PARAM_OCTET(OSSL_PKEY_PARAM_PUB_KEY, ed448_pub),
@@ -1527,23 +1694,23 @@ static const ST_KAT_PARAM ed448_key[] = {
     ST_KAT_PARAM_END()
 };
 static const unsigned char ed448_expected_sig[] = {
-   0x7e, 0xee, 0xab, 0x7c, 0x4e, 0x50, 0xfb, 0x79,
-   0x9b, 0x41, 0x8e, 0xe5, 0xe3, 0x19, 0x7f, 0xf6,
-   0xbf, 0x15, 0xd4, 0x3a, 0x14, 0xc3, 0x43, 0x89,
-   0xb5, 0x9d, 0xd1, 0xa7, 0xb1, 0xb8, 0x5b, 0x4a,
-   0xe9, 0x04, 0x38, 0xac, 0xa6, 0x34, 0xbe, 0xa4,
-   0x5e, 0x3a, 0x26, 0x95, 0xf1, 0x27, 0x0f, 0x07,
-   0xfd, 0xcd, 0xf7, 0xc6, 0x2b, 0x8e, 0xfe, 0xaf,
-   0x00, 0xb4, 0x5c, 0x2c, 0x96, 0xba, 0x45, 0x7e,
-   0xb1, 0xa8, 0xbf, 0x07, 0x5a, 0x3d, 0xb2, 0x8e,
-   0x5c, 0x24, 0xf6, 0xb9, 0x23, 0xed, 0x4a, 0xd7,
-   0x47, 0xc3, 0xc9, 0xe0, 0x3c, 0x70, 0x79, 0xef,
-   0xb8, 0x7c, 0xb1, 0x10, 0xd3, 0xa9, 0x98, 0x61,
-   0xe7, 0x20, 0x03, 0xcb, 0xae, 0x6d, 0x6b, 0x8b,
-   0x82, 0x7e, 0x4e, 0x6c, 0x14, 0x30, 0x64, 0xff,
-   0x3c, 0x00
-};
-# endif /* OPENSSL_NO_ECX */
+    0x7e, 0xee, 0xab, 0x7c, 0x4e, 0x50, 0xfb, 0x79,
+    0x9b, 0x41, 0x8e, 0xe5, 0xe3, 0x19, 0x7f, 0xf6,
+    0xbf, 0x15, 0xd4, 0x3a, 0x14, 0xc3, 0x43, 0x89,
+    0xb5, 0x9d, 0xd1, 0xa7, 0xb1, 0xb8, 0x5b, 0x4a,
+    0xe9, 0x04, 0x38, 0xac, 0xa6, 0x34, 0xbe, 0xa4,
+    0x5e, 0x3a, 0x26, 0x95, 0xf1, 0x27, 0x0f, 0x07,
+    0xfd, 0xcd, 0xf7, 0xc6, 0x2b, 0x8e, 0xfe, 0xaf,
+    0x00, 0xb4, 0x5c, 0x2c, 0x96, 0xba, 0x45, 0x7e,
+    0xb1, 0xa8, 0xbf, 0x07, 0x5a, 0x3d, 0xb2, 0x8e,
+    0x5c, 0x24, 0xf6, 0xb9, 0x23, 0xed, 0x4a, 0xd7,
+    0x47, 0xc3, 0xc9, 0xe0, 0x3c, 0x70, 0x79, 0xef,
+    0xb8, 0x7c, 0xb1, 0x10, 0xd3, 0xa9, 0x98, 0x61,
+    0xe7, 0x20, 0x03, 0xcb, 0xae, 0x6d, 0x6b, 0x8b,
+    0x82, 0x7e, 0x4e, 0x6c, 0x14, 0x30, 0x64, 0xff,
+    0x3c, 0x00
+};
+#endif /* OPENSSL_NO_ECX */
 #endif /* OPENSSL_NO_EC */

 #ifndef OPENSSL_NO_DSA
@@ -1677,252 +1844,255 @@ static const ST_KAT_PARAM dsa_key[] = {
 #endif /* OPENSSL_NO_DSA */

 #ifndef OPENSSL_NO_ML_DSA
-static const unsigned char ml_dsa_65_pub_key[] = {
-    0x3b, 0x5c, 0xb0, 0x79, 0xd2, 0xce, 0x76, 0x2b,
-    0x3b, 0x95, 0x7c, 0x26, 0x69, 0x8f, 0xe7, 0x01,
-    0xb9, 0x6b, 0x50, 0xa3, 0x2c, 0x73, 0x67, 0xcf,
-    0x9e, 0xf4, 0xb8, 0x7d, 0xe3, 0xaf, 0x27, 0x77,
-    0xc6, 0x7c, 0x34, 0xb7, 0x30, 0x4d, 0x01, 0xa4,
-    0xaa, 0xce, 0x16, 0x7c, 0x13, 0x2b, 0x30, 0x6c,
-    0x88, 0x31, 0xe4, 0x90, 0xf5, 0xc2, 0x80, 0xf5,
-    0xe8, 0xb9, 0x2d, 0x7a, 0x83, 0x17, 0xfc, 0xbb,
-    0x13, 0x6f, 0x18, 0x75, 0x5b, 0x40, 0x39, 0x2d,
-    0x47, 0x56, 0x15, 0xc7, 0x1c, 0x6e, 0x9a, 0x95,
-    0x7b, 0x6b, 0x77, 0x9f, 0x86, 0x38, 0x0e, 0xee,
-    0xc0, 0x82, 0x6c, 0x3c, 0xae, 0xc0, 0xcf, 0x5a,
-    0x85, 0x49, 0xb1, 0x0c, 0x2d, 0x0e, 0x51, 0x73,
-    0xf0, 0xe7, 0xad, 0x3b, 0xa7, 0x3f, 0xf5, 0x75,
-    0xb9, 0xb4, 0x63, 0xb9, 0xf0, 0x0a, 0xf4, 0x29,
-    0x90, 0x20, 0x72, 0x46, 0x8c, 0x7a, 0xaa, 0x86,
-    0xb7, 0x4e, 0xa7, 0x65, 0x23, 0xef, 0xec, 0x46,
-    0x67, 0x02, 0xf1, 0xbb, 0x88, 0xc7, 0xa4, 0xfc,
-    0x66, 0x52, 0x07, 0x67, 0x68, 0xa2, 0x72, 0xe8,
-    0x8a, 0x53, 0x97, 0xe6, 0x89, 0x96, 0x95, 0x9e,
-    0x6a, 0xe9, 0xa4, 0x7d, 0x19, 0x19, 0x5f, 0xb4,
-    0x77, 0x52, 0x17, 0xd6, 0xf2, 0xea, 0x7f, 0xfc,
-    0x5c, 0xd5, 0x18, 0x16, 0x8c, 0xc2, 0x2e, 0x31,
-    0xf8, 0x98, 0x4b, 0x72, 0xa1, 0x80, 0xb6, 0x5c,
-    0x32, 0x19, 0x2f, 0xe0, 0xae, 0x74, 0xf4, 0xc4,
-    0x0a, 0xe0, 0x54, 0x52, 0x46, 0x9e, 0xf3, 0xb9,
-    0x6c, 0x56, 0xd1, 0xe8, 0x99, 0x29, 0x39, 0x95,
-    0x30, 0xa2, 0x6a, 0xc6, 0x32, 0x8a, 0xa6, 0x02,
-    0x6a, 0x39, 0x2e, 0x13, 0x20, 0xbc, 0xf8, 0x7a,
-    0x09, 0xb6, 0xa7, 0xd1, 0x39, 0xa5, 0x12, 0x02,
-    0x81, 0x47, 0x8c, 0xc0, 0x1e, 0xfd, 0xf3, 0x28,
-    0xe5, 0x34, 0xec, 0xf0, 0xfc, 0x3f, 0x22, 0x16,
-    0xd2, 0xfe, 0xf0, 0xca, 0xaa, 0x6f, 0x82, 0xdd,
-    0xd6, 0x83, 0xaf, 0xf9, 0xeb, 0x1d, 0xa8, 0x45,
-    0x39, 0x63, 0xa5, 0xde, 0xee, 0x7d, 0x91, 0xe3,
-    0xaa, 0xcc, 0x07, 0x92, 0xce, 0x50, 0xfd, 0xe4,
-    0xa8, 0x50, 0x91, 0xd5, 0xec, 0xc1, 0x1b, 0x57,
-    0x92, 0x37, 0x68, 0xf8, 0xd6, 0x32, 0x55, 0xba,
-    0x65, 0xae, 0xb6, 0xc3, 0x9f, 0x6c, 0x18, 0xc5,
-    0x12, 0x17, 0x9a, 0x04, 0x29, 0xab, 0x14, 0x94,
-    0xbb, 0x13, 0x79, 0x5e, 0xb9, 0xf0, 0x62, 0x03,
-    0xe0, 0xa4, 0x91, 0xba, 0x81, 0x4b, 0xaa, 0xf1,
-    0x82, 0x47, 0x83, 0x43, 0x5f, 0x1e, 0x2d, 0x48,
-    0x40, 0x56, 0xe4, 0x29, 0x79, 0x01, 0xd5, 0x89,
-    0xaf, 0xa4, 0x56, 0x9e, 0x38, 0x62, 0x03, 0xa0,
-    0xe7, 0x9f, 0x08, 0x1f, 0xca, 0xd4, 0x31, 0x48,
-    0xf6, 0x68, 0xe0, 0xcc, 0x28, 0xff, 0x06, 0x97,
-    0x67, 0x4b, 0x70, 0x78, 0xa0, 0x2a, 0xf9, 0x46,
-    0x80, 0x6d, 0x37, 0xfb, 0xb3, 0x17, 0x12, 0xf0,
-    0x95, 0xc7, 0xee, 0x31, 0x54, 0x75, 0xdf, 0x2a,
-    0xa8, 0x7d, 0xff, 0x97, 0xbb, 0x45, 0x49, 0x55,
-    0xd5, 0xac, 0x9c, 0x6f, 0x0e, 0xc3, 0x94, 0x96,
-    0xc4, 0x9e, 0x9c, 0x45, 0x31, 0xcb, 0x23, 0xed,
-    0x21, 0xf1, 0xfe, 0xe9, 0xf9, 0x8c, 0xb6, 0x8e,
-    0x72, 0x6e, 0xdd, 0x37, 0x1c, 0xc7, 0xd6, 0x6b,
-    0x36, 0x35, 0xa0, 0x67, 0x54, 0x00, 0x65, 0x2c,
-    0xc8, 0xa4, 0xa0, 0x9e, 0x72, 0xd7, 0xc9, 0x3c,
-    0x8c, 0x78, 0x1a, 0xf8, 0x80, 0xad, 0xc4, 0x99,
-    0xc7, 0x35, 0x4e, 0x89, 0x3b, 0x4f, 0xa6, 0x9d,
-    0x5d, 0xce, 0x66, 0x4d, 0x82, 0xef, 0x47, 0x73,
-    0xa8, 0xc5, 0x14, 0x20, 0xdd, 0x57, 0x92, 0x10,
-    0x95, 0x8a, 0xe1, 0xac, 0x82, 0xec, 0x39, 0xe7,
-    0x2c, 0xa6, 0xfd, 0x50, 0x68, 0x0c, 0x3e, 0xcf,
-    0xbc, 0xc5, 0x12, 0xfe, 0x30, 0xc8, 0xb7, 0xb4,
-    0x84, 0xd8, 0x1d, 0x67, 0x54, 0x9d, 0x20, 0x49,
-    0xa5, 0xfd, 0xf9, 0x18, 0xef, 0xc2, 0xd2, 0xcd,
-    0xb7, 0x54, 0x2b, 0x31, 0x12, 0xf9, 0xaa, 0x8e,
-    0x0a, 0x29, 0x0c, 0x37, 0xd2, 0x7c, 0xcd, 0xc5,
-    0x0b, 0x98, 0x25, 0x97, 0x0b, 0x5a, 0xf7, 0x07,
-    0x91, 0x98, 0xd1, 0x42, 0xdf, 0xc4, 0xf9, 0x42,
-    0x97, 0xda, 0x20, 0xf4, 0x88, 0xe1, 0x6b, 0xd4,
-    0x85, 0xf5, 0x1d, 0xca, 0x2a, 0xba, 0x30, 0xc5,
-    0xdf, 0x9d, 0x4d, 0xb8, 0xb0, 0x30, 0x54, 0x61,
-    0xcf, 0x91, 0x6f, 0x90, 0xa5, 0x25, 0x05, 0x9b,
-    0x2b, 0x3e, 0x13, 0xcd, 0xcd, 0x40, 0x59, 0x7c,
-    0x92, 0x9b, 0x51, 0x81, 0x0d, 0x58, 0x32, 0x0a,
-    0x43, 0xbd, 0x01, 0xb4, 0xb8, 0x0b, 0xd5, 0xee,
-    0x0d, 0x67, 0x70, 0x59, 0xd7, 0x47, 0x4f, 0xe5,
-    0x84, 0x07, 0x75, 0x3e, 0x54, 0xfb, 0x5d, 0xd1,
-    0x3f, 0x72, 0x6e, 0xae, 0xf9, 0x4b, 0x7b, 0x57,
-    0xe0, 0xde, 0x8b, 0x8b, 0x12, 0x1b, 0x10, 0x3b,
-    0x5e, 0x17, 0xd1, 0x72, 0x18, 0x3d, 0xff, 0xc6,
-    0x83, 0xa5, 0xaf, 0xf9, 0x30, 0xae, 0xb7, 0x47,
-    0x46, 0x5d, 0xac, 0xba, 0x35, 0x04, 0x35, 0x0b,
-    0x42, 0x48, 0x7c, 0xa1, 0x00, 0x1a, 0xea, 0xea,
-    0x5f, 0x93, 0x2b, 0xb7, 0xe5, 0x8f, 0x91, 0x3c,
-    0x00, 0x98, 0x51, 0x40, 0xee, 0x11, 0x50, 0x70,
-    0x40, 0xe4, 0x28, 0xd4, 0x79, 0x2d, 0xcd, 0x82,
-    0xaf, 0x3f, 0xb2, 0xfc, 0x96, 0x8d, 0xbe, 0x79,
-    0xa3, 0xcd, 0xac, 0x35, 0x4b, 0x5e, 0xb4, 0x81,
-    0x0e, 0x6a, 0xde, 0x1f, 0x7e, 0xb0, 0x37, 0x3e,
-    0xdc, 0xe0, 0x21, 0xcc, 0x9f, 0x90, 0x26, 0xb6,
-    0x8a, 0x1d, 0xb3, 0x1e, 0xec, 0x7a, 0x88, 0x28,
-    0x95, 0xe2, 0xc2, 0x1d, 0x07, 0xb1, 0xfa, 0xc6,
-    0x21, 0x1b, 0x5e, 0x54, 0x7b, 0x37, 0x0e, 0x63,
-    0xff, 0xdd, 0x70, 0xf9, 0xea, 0x2f, 0x2d, 0x98,
-    0xe1, 0xbe, 0x37, 0xd0, 0x1f, 0x45, 0x5a, 0x63,
-    0xad, 0x44, 0xbc, 0x5f, 0xc6, 0x23, 0x8a, 0xac,
-    0x12, 0x71, 0xd5, 0xa2, 0x8b, 0xfc, 0x97, 0xbb,
-    0x00, 0x4b, 0xd7, 0x09, 0xa6, 0xaf, 0x40, 0x08,
-    0x6c, 0x8d, 0x10, 0x4a, 0x01, 0x34, 0xc1, 0x2c,
-    0x92, 0x30, 0x0a, 0x85, 0x8f, 0x3f, 0x08, 0xdd,
-    0xff, 0x9c, 0x10, 0xd1, 0x03, 0x03, 0x84, 0x1f,
-    0xf8, 0x4e, 0xf2, 0xe3, 0xd1, 0xd3, 0xb9, 0xdf,
-    0xfc, 0x97, 0x1c, 0xcf, 0x8a, 0x29, 0xe6, 0x59,
-    0x04, 0xe2, 0x87, 0x27, 0xbb, 0xb9, 0x96, 0xd0,
-    0x20, 0x2e, 0x91, 0x48, 0xaa, 0xbf, 0x53, 0x4a,
-    0x34, 0xb5, 0x0e, 0x11, 0xce, 0xf8, 0x65, 0xa6,
-    0x0d, 0x45, 0xda, 0xbf, 0x6a, 0xfb, 0x81, 0xe4,
-    0x7c, 0x8c, 0xa0, 0x4b, 0x00, 0x1b, 0xd7, 0x73,
-    0x61, 0x80, 0xc0, 0x6b, 0x60, 0xde, 0xf3, 0x32,
-    0xae, 0x62, 0x35, 0x66, 0xdd, 0xde, 0x53, 0x61,
-    0x86, 0xe9, 0x44, 0xf3, 0x01, 0x7b, 0xaa, 0xe7,
-    0x31, 0xd4, 0x5b, 0x06, 0x52, 0x0f, 0xf4, 0x90,
-    0x5c, 0x82, 0x3e, 0x12, 0x28, 0x88, 0x7f, 0xfc,
-    0xb8, 0xee, 0x17, 0x34, 0x4e, 0xc3, 0x2a, 0xfb,
-    0x84, 0x1b, 0x0f, 0xba, 0x51, 0x64, 0x96, 0x22,
-    0x0d, 0x88, 0x9b, 0xf2, 0x72, 0x04, 0x55, 0x44,
-    0x6a, 0x14, 0x2b, 0xa0, 0xc2, 0xbe, 0x9e, 0x7b,
-    0x48, 0x32, 0xa7, 0xf6, 0x11, 0xae, 0x60, 0xfb,
-    0xf8, 0x38, 0x67, 0x16, 0xdf, 0xdf, 0x46, 0x96,
-    0xd7, 0x6c, 0x39, 0xa2, 0xad, 0xf7, 0xb7, 0x78,
-    0x32, 0x2c, 0xba, 0xae, 0x33, 0x5a, 0x88, 0x4b,
-    0x40, 0x1f, 0x88, 0xcd, 0xe7, 0x8f, 0x50, 0x5e,
-    0xd8, 0x80, 0x82, 0x7b, 0x46, 0xc7, 0x07, 0x71,
-    0x4f, 0x3b, 0xca, 0x9d, 0x73, 0x7c, 0xdb, 0xeb,
-    0x4c, 0x37, 0xdd, 0xb4, 0xb8, 0x61, 0xf3, 0xdf,
-    0xb2, 0xb5, 0x34, 0x27, 0xec, 0xeb, 0xba, 0xcc,
-    0xdc, 0xe9, 0xde, 0x47, 0x2e, 0xe9, 0x3b, 0xa1,
-    0x36, 0xf1, 0x66, 0xdf, 0xc8, 0x70, 0x7f, 0x39,
-    0x82, 0xb3, 0x8c, 0x47, 0x9a, 0x45, 0x59, 0x2e,
-    0x30, 0x9b, 0xaf, 0x7c, 0xad, 0x43, 0x38, 0x6e,
-    0x05, 0x7d, 0x8b, 0xac, 0x5f, 0x70, 0x63, 0xeb,
-    0x85, 0xee, 0xab, 0xa4, 0x57, 0x1d, 0x63, 0xac,
-    0x48, 0x45, 0x74, 0xca, 0x0c, 0xa8, 0x65, 0x05,
-    0x1a, 0x47, 0xa1, 0x2f, 0x4b, 0x96, 0x26, 0x9e,
-    0xee, 0xec, 0x37, 0x57, 0xbf, 0xa0, 0x2b, 0x75,
-    0xf5, 0x9b, 0xb5, 0x1d, 0x12, 0x8a, 0x61, 0x9c,
-    0x8d, 0x2a, 0x7e, 0xee, 0x05, 0x2b, 0x85, 0x7c,
-    0x6f, 0x34, 0xc4, 0xcd, 0xd5, 0xd0, 0xac, 0xf9,
-    0x79, 0x24, 0xe7, 0x0f, 0x41, 0x95, 0xe2, 0x9a,
-    0x22, 0x32, 0xa5, 0x98, 0x2e, 0x82, 0xc0, 0x07,
-    0xf4, 0x74, 0x68, 0x00, 0xf9, 0x35, 0x5e, 0x12,
-    0xfe, 0xa2, 0x0e, 0x15, 0x96, 0x83, 0x84, 0x31,
-    0xc4, 0x25, 0xda, 0x7a, 0xec, 0x07, 0x15, 0xe4,
-    0x7d, 0xc5, 0xf5, 0xe1, 0xc5, 0xba, 0x9a, 0x59,
-    0x76, 0xae, 0x4e, 0x54, 0x27, 0x5e, 0xa9, 0x0d,
-    0xa0, 0xd3, 0xcd, 0x99, 0x39, 0x76, 0x6d, 0x58,
-    0xdf, 0x8a, 0xa9, 0x9e, 0x21, 0x22, 0x48, 0x7c,
-    0x0c, 0x13, 0xfa, 0x86, 0x63, 0x74, 0x92, 0xf4,
-    0xe5, 0x5d, 0xbf, 0xe4, 0x2d, 0xd7, 0xa1, 0xe3,
-    0x0f, 0xc6, 0x3e, 0x82, 0xa0, 0xcc, 0xfa, 0x38,
-    0x55, 0x36, 0x9b, 0x22, 0xd0, 0xb8, 0x7f, 0x3f,
-    0x0f, 0x35, 0x01, 0xf9, 0x6f, 0xa6, 0x51, 0x77,
-    0x21, 0xb7, 0x7a, 0x81, 0xca, 0x83, 0x6b, 0xec,
-    0xa7, 0x71, 0x12, 0x6d, 0x22, 0x78, 0xb1, 0xc8,
-    0x37, 0xda, 0x1d, 0xd1, 0x9c, 0xa5, 0x6c, 0xfa,
-    0xd3, 0x4b, 0x87, 0x39, 0x6f, 0x59, 0xe1, 0xec,
-    0x4a, 0xe5, 0x0e, 0x72, 0x2b, 0x31, 0x18, 0xd9,
-    0x54, 0x6a, 0x4c, 0xc3, 0xe0, 0x58, 0x3b, 0xd8,
-    0xe8, 0x65, 0xc1, 0x98, 0xed, 0x64, 0x7b, 0xb1,
-    0xee, 0xa9, 0x54, 0x95, 0x37, 0x98, 0x68, 0xca,
-    0x83, 0xef, 0xc5, 0x1b, 0x23, 0x71, 0x5c, 0x1a,
-    0xe6, 0xc0, 0xce, 0x2e, 0x16, 0x59, 0x79, 0xf4,
-    0x94, 0x43, 0xd8, 0xb1, 0x2e, 0xe3, 0xb9, 0xa0,
-    0x95, 0x80, 0x66, 0xdd, 0x1d, 0xdd, 0x0d, 0x78,
-    0x9d, 0xc3, 0x91, 0x60, 0x16, 0x8b, 0xc5, 0x39,
-    0xad, 0xdb, 0xa3, 0xc1, 0xd2, 0x8d, 0xa0, 0x78,
-    0x75, 0x68, 0xa6, 0xb9, 0x15, 0x57, 0x0b, 0x06,
-    0x64, 0x55, 0xd7, 0x07, 0x53, 0xf9, 0x8b, 0xd9,
-    0x97, 0x46, 0xca, 0x04, 0x95, 0xd4, 0x3c, 0xd3,
-    0x8f, 0x0a, 0x53, 0x27, 0xe6, 0xd4, 0xb4, 0x7b,
-    0x70, 0x12, 0x12, 0xc5, 0x14, 0xa0, 0x53, 0xe5,
-    0xd4, 0x30, 0xaa, 0xcc, 0xec, 0x03, 0x0a, 0x36,
-    0x21, 0x9f, 0x81, 0x16, 0x6d, 0x1d, 0x53, 0x6e,
-    0x08, 0xae, 0xf7, 0x05, 0xd9, 0x73, 0x5a, 0x45,
-    0x3a, 0x52, 0x3e, 0xeb, 0x67, 0x49, 0xe1, 0x1a,
-    0x8a, 0x4c, 0xd9, 0x83, 0x64, 0xd8, 0x16, 0x37,
-    0x1c, 0x6b, 0x1c, 0x0d, 0x8f, 0x6a, 0xbf, 0x21,
-    0xf1, 0x4f, 0x4c, 0x55, 0x6f, 0xe0, 0x5c, 0xa7,
-    0xb1, 0x7b, 0x57, 0xa9, 0xa2, 0xb4, 0x9d, 0x53,
-    0x7f, 0x0f, 0xb0, 0x21, 0x95, 0x70, 0x3a, 0x0d,
-    0xa2, 0xc1, 0x52, 0x26, 0xad, 0xa7, 0x48, 0x66,
-    0x2a, 0xfc, 0xaa, 0xaf, 0x25, 0x02, 0x58, 0x80,
-    0xbe, 0xe7, 0xe4, 0x2a, 0x50, 0xe5, 0x46, 0x13,
-    0xaa, 0x57, 0x0e, 0x6e, 0xee, 0xa9, 0x9e, 0x19,
-    0xa3, 0x92, 0x8e, 0xc6, 0x3d, 0x76, 0xbb, 0x12,
-    0xe2, 0x78, 0x77, 0x99, 0x6a, 0x06, 0xc4, 0x45,
-    0x1f, 0x45, 0xe1, 0xf6, 0x65, 0x1f, 0xba, 0xe4,
-    0xf6, 0xca, 0xa9, 0x62, 0xa9, 0x2c, 0x3a, 0x2d,
-    0x8d, 0x34, 0xe2, 0x32, 0x6e, 0x4a, 0x52, 0x9f,
-    0x3d, 0xcf, 0xab, 0xe8, 0x63, 0x66, 0x3f, 0x06,
-    0xa3, 0xaa, 0xd5, 0xcb, 0x5d, 0x41, 0xb8, 0xe7,
-    0x0a, 0x6b, 0x45, 0x90, 0x3a, 0xf0, 0xe5, 0x7f,
-    0x7e, 0xde, 0x68, 0x20, 0x5e, 0x5a, 0x31, 0x3a,
-    0x5c, 0x25, 0xb3, 0x82, 0xc7, 0x1e, 0x7d, 0x4d,
-    0xd0, 0x23, 0x9f, 0x22, 0x1a, 0x54, 0x0b, 0xe4,
-    0x3c, 0x1c, 0xc5, 0x24, 0x39, 0x4d, 0x96, 0x90,
-    0xce, 0xc9, 0x3a, 0x07, 0x45, 0x01, 0x9e, 0xb6,
-    0x55, 0x1b, 0xdc, 0xe0, 0x3b, 0xe8, 0x92, 0x57,
-    0x43, 0x12, 0x9b, 0x11, 0x3f, 0x81, 0x5a, 0xca,
-    0xc5, 0x85, 0x39, 0x25, 0x6d, 0xe4, 0x30, 0xef,
-    0x83, 0x21, 0xed, 0x9c, 0xb3, 0xcf, 0x10, 0xe6,
-    0xa1, 0x46, 0x10, 0x9a, 0x7b, 0xaf, 0x5f, 0x75,
-    0x99, 0x62, 0xc1, 0xf4, 0x2c, 0x28, 0x0a, 0x8a,
-    0xc7, 0xd2, 0xb4, 0x75, 0xb9, 0x66, 0x70, 0x9a,
-    0xaf, 0xe3, 0xf1, 0x2f, 0xf2, 0xb0, 0x59, 0x9c,
-    0x1e, 0x1a, 0xbd, 0xa9, 0x15, 0x55, 0x95, 0x4c,
-    0x5b, 0x78, 0x0b, 0x2c, 0x00, 0xbb, 0xf9, 0x8b,
-    0xeb, 0x72, 0x4f, 0xfb, 0xa4, 0x3a, 0xa0, 0x04,
-    0x45, 0x32, 0x02, 0x6c, 0x16, 0x52, 0x3f, 0x4a,
-    0x0a, 0x77, 0x64, 0xf4, 0x74, 0xed, 0x60, 0x6b,
-    0x5e, 0x43, 0xa7, 0xe3, 0x84, 0x7e, 0xda, 0xf0,
-    0xb1, 0x9e, 0x6d, 0x90, 0x9c, 0x32, 0xae, 0xba,
-    0x7c, 0xfb, 0x72, 0x22, 0x27, 0x9c, 0xe1, 0x85,
-    0xe1, 0xf6, 0x22, 0x4c, 0x3c, 0x4a, 0xd6, 0xed,
-    0x4c, 0xa7, 0x79, 0x59, 0xb5, 0x5b, 0x91, 0x65,
-    0x3f, 0x93, 0x97, 0x8d, 0xd7, 0xd0, 0xab, 0x17,
-    0x2f, 0x13, 0x74, 0x53, 0x69, 0x74, 0xf8, 0x6b,
-    0x39, 0x5c, 0x64, 0x5b, 0x3d, 0x75, 0xca, 0x85,
-    0x0e, 0xda, 0x0f, 0x01, 0x34, 0xa3, 0x67, 0x8e,
-    0x26, 0x6f, 0x26, 0x3c, 0xd0, 0xd9, 0xae, 0xe8,
-    0x52, 0x13, 0x7f, 0xf8, 0x69, 0x62, 0xfc, 0x9a,
-    0xc0, 0x0c, 0x66, 0x2e, 0x57, 0x21, 0x75, 0xb0,
-    0xb3, 0x8c, 0xf6, 0x97, 0x44, 0x46, 0x65, 0x15,
-    0x79, 0xd5, 0x6b, 0x68, 0x96, 0x47, 0xc1, 0xba,
-    0x75, 0x46, 0x87, 0x76, 0x7d, 0x2d, 0xac, 0xf3,
-    0x16, 0xae, 0xfb, 0x7e, 0x41, 0xe4, 0xae, 0x15,
-    0xc2, 0x51, 0x69, 0x71, 0x0b, 0x63, 0x20, 0x6a,
-    0xbd, 0xad, 0xce, 0x2a, 0x94, 0xac, 0xcf, 0x15,
-    0x4e, 0xdc, 0x8e, 0x2a, 0x48, 0xed, 0xb3, 0x48,
-    0x95, 0xf4, 0x41, 0xf3, 0x52, 0xef, 0x62, 0x90,
-    0x10, 0x30, 0x42, 0xec, 0xf9, 0x30, 0x25, 0xc3,
-    0xc5, 0x47, 0x76, 0xb5, 0x37, 0xeb, 0x9e, 0x87,
-    0xbe, 0x5c, 0x24, 0xa5, 0x34, 0xdd, 0x92, 0xa1,
-    0x20, 0x7d, 0xa7, 0x94, 0xa2, 0x67, 0x26, 0x70,
-    0xfe, 0xc9, 0x3f, 0x21, 0xd1, 0xc2, 0x5a, 0xb1,
-    0xaa, 0xac, 0x14, 0x1a, 0xe4, 0xdb, 0x71, 0x7e,
-    0x9c, 0xc2, 0x52, 0x59, 0xc9, 0x58, 0xca, 0x88,
-    0x71, 0x4f, 0x90, 0xb1, 0xbb, 0xac, 0x80, 0x53,
-    0x21, 0xfb, 0xff, 0xfd, 0x1e, 0x9f, 0xc0, 0x59,
-    0x8d, 0x80, 0x8e, 0x85, 0xa9, 0x3b, 0xd3, 0x20,
-    0x3b, 0x91, 0x16, 0x49, 0xb2, 0x2a, 0xa4, 0xe2,
-    0x30, 0xb2, 0x76, 0xf6, 0x92, 0x71, 0x37, 0x1b
-};
+/*
+ * currently unused
+ * static const unsigned char ml_dsa_65_pub_key[] = {
+ *     0x3b, 0x5c, 0xb0, 0x79, 0xd2, 0xce, 0x76, 0x2b,
+ *     0x3b, 0x95, 0x7c, 0x26, 0x69, 0x8f, 0xe7, 0x01,
+ *     0xb9, 0x6b, 0x50, 0xa3, 0x2c, 0x73, 0x67, 0xcf,
+ *     0x9e, 0xf4, 0xb8, 0x7d, 0xe3, 0xaf, 0x27, 0x77,
+ *     0xc6, 0x7c, 0x34, 0xb7, 0x30, 0x4d, 0x01, 0xa4,
+ *     0xaa, 0xce, 0x16, 0x7c, 0x13, 0x2b, 0x30, 0x6c,
+ *     0x88, 0x31, 0xe4, 0x90, 0xf5, 0xc2, 0x80, 0xf5,
+ *     0xe8, 0xb9, 0x2d, 0x7a, 0x83, 0x17, 0xfc, 0xbb,
+ *     0x13, 0x6f, 0x18, 0x75, 0x5b, 0x40, 0x39, 0x2d,
+ *     0x47, 0x56, 0x15, 0xc7, 0x1c, 0x6e, 0x9a, 0x95,
+ *     0x7b, 0x6b, 0x77, 0x9f, 0x86, 0x38, 0x0e, 0xee,
+ *     0xc0, 0x82, 0x6c, 0x3c, 0xae, 0xc0, 0xcf, 0x5a,
+ *     0x85, 0x49, 0xb1, 0x0c, 0x2d, 0x0e, 0x51, 0x73,
+ *     0xf0, 0xe7, 0xad, 0x3b, 0xa7, 0x3f, 0xf5, 0x75,
+ *     0xb9, 0xb4, 0x63, 0xb9, 0xf0, 0x0a, 0xf4, 0x29,
+ *     0x90, 0x20, 0x72, 0x46, 0x8c, 0x7a, 0xaa, 0x86,
+ *     0xb7, 0x4e, 0xa7, 0x65, 0x23, 0xef, 0xec, 0x46,
+ *     0x67, 0x02, 0xf1, 0xbb, 0x88, 0xc7, 0xa4, 0xfc,
+ *     0x66, 0x52, 0x07, 0x67, 0x68, 0xa2, 0x72, 0xe8,
+ *     0x8a, 0x53, 0x97, 0xe6, 0x89, 0x96, 0x95, 0x9e,
+ *     0x6a, 0xe9, 0xa4, 0x7d, 0x19, 0x19, 0x5f, 0xb4,
+ *     0x77, 0x52, 0x17, 0xd6, 0xf2, 0xea, 0x7f, 0xfc,
+ *     0x5c, 0xd5, 0x18, 0x16, 0x8c, 0xc2, 0x2e, 0x31,
+ *     0xf8, 0x98, 0x4b, 0x72, 0xa1, 0x80, 0xb6, 0x5c,
+ *     0x32, 0x19, 0x2f, 0xe0, 0xae, 0x74, 0xf4, 0xc4,
+ *     0x0a, 0xe0, 0x54, 0x52, 0x46, 0x9e, 0xf3, 0xb9,
+ *     0x6c, 0x56, 0xd1, 0xe8, 0x99, 0x29, 0x39, 0x95,
+ *     0x30, 0xa2, 0x6a, 0xc6, 0x32, 0x8a, 0xa6, 0x02,
+ *     0x6a, 0x39, 0x2e, 0x13, 0x20, 0xbc, 0xf8, 0x7a,
+ *     0x09, 0xb6, 0xa7, 0xd1, 0x39, 0xa5, 0x12, 0x02,
+ *     0x81, 0x47, 0x8c, 0xc0, 0x1e, 0xfd, 0xf3, 0x28,
+ *     0xe5, 0x34, 0xec, 0xf0, 0xfc, 0x3f, 0x22, 0x16,
+ *     0xd2, 0xfe, 0xf0, 0xca, 0xaa, 0x6f, 0x82, 0xdd,
+ *     0xd6, 0x83, 0xaf, 0xf9, 0xeb, 0x1d, 0xa8, 0x45,
+ *     0x39, 0x63, 0xa5, 0xde, 0xee, 0x7d, 0x91, 0xe3,
+ *     0xaa, 0xcc, 0x07, 0x92, 0xce, 0x50, 0xfd, 0xe4,
+ *     0xa8, 0x50, 0x91, 0xd5, 0xec, 0xc1, 0x1b, 0x57,
+ *     0x92, 0x37, 0x68, 0xf8, 0xd6, 0x32, 0x55, 0xba,
+ *     0x65, 0xae, 0xb6, 0xc3, 0x9f, 0x6c, 0x18, 0xc5,
+ *     0x12, 0x17, 0x9a, 0x04, 0x29, 0xab, 0x14, 0x94,
+ *     0xbb, 0x13, 0x79, 0x5e, 0xb9, 0xf0, 0x62, 0x03,
+ *     0xe0, 0xa4, 0x91, 0xba, 0x81, 0x4b, 0xaa, 0xf1,
+ *     0x82, 0x47, 0x83, 0x43, 0x5f, 0x1e, 0x2d, 0x48,
+ *     0x40, 0x56, 0xe4, 0x29, 0x79, 0x01, 0xd5, 0x89,
+ *     0xaf, 0xa4, 0x56, 0x9e, 0x38, 0x62, 0x03, 0xa0,
+ *     0xe7, 0x9f, 0x08, 0x1f, 0xca, 0xd4, 0x31, 0x48,
+ *     0xf6, 0x68, 0xe0, 0xcc, 0x28, 0xff, 0x06, 0x97,
+ *     0x67, 0x4b, 0x70, 0x78, 0xa0, 0x2a, 0xf9, 0x46,
+ *     0x80, 0x6d, 0x37, 0xfb, 0xb3, 0x17, 0x12, 0xf0,
+ *     0x95, 0xc7, 0xee, 0x31, 0x54, 0x75, 0xdf, 0x2a,
+ *     0xa8, 0x7d, 0xff, 0x97, 0xbb, 0x45, 0x49, 0x55,
+ *     0xd5, 0xac, 0x9c, 0x6f, 0x0e, 0xc3, 0x94, 0x96,
+ *     0xc4, 0x9e, 0x9c, 0x45, 0x31, 0xcb, 0x23, 0xed,
+ *     0x21, 0xf1, 0xfe, 0xe9, 0xf9, 0x8c, 0xb6, 0x8e,
+ *     0x72, 0x6e, 0xdd, 0x37, 0x1c, 0xc7, 0xd6, 0x6b,
+ *     0x36, 0x35, 0xa0, 0x67, 0x54, 0x00, 0x65, 0x2c,
+ *     0xc8, 0xa4, 0xa0, 0x9e, 0x72, 0xd7, 0xc9, 0x3c,
+ *     0x8c, 0x78, 0x1a, 0xf8, 0x80, 0xad, 0xc4, 0x99,
+ *     0xc7, 0x35, 0x4e, 0x89, 0x3b, 0x4f, 0xa6, 0x9d,
+ *     0x5d, 0xce, 0x66, 0x4d, 0x82, 0xef, 0x47, 0x73,
+ *     0xa8, 0xc5, 0x14, 0x20, 0xdd, 0x57, 0x92, 0x10,
+ *     0x95, 0x8a, 0xe1, 0xac, 0x82, 0xec, 0x39, 0xe7,
+ *     0x2c, 0xa6, 0xfd, 0x50, 0x68, 0x0c, 0x3e, 0xcf,
+ *     0xbc, 0xc5, 0x12, 0xfe, 0x30, 0xc8, 0xb7, 0xb4,
+ *     0x84, 0xd8, 0x1d, 0x67, 0x54, 0x9d, 0x20, 0x49,
+ *     0xa5, 0xfd, 0xf9, 0x18, 0xef, 0xc2, 0xd2, 0xcd,
+ *     0xb7, 0x54, 0x2b, 0x31, 0x12, 0xf9, 0xaa, 0x8e,
+ *     0x0a, 0x29, 0x0c, 0x37, 0xd2, 0x7c, 0xcd, 0xc5,
+ *     0x0b, 0x98, 0x25, 0x97, 0x0b, 0x5a, 0xf7, 0x07,
+ *     0x91, 0x98, 0xd1, 0x42, 0xdf, 0xc4, 0xf9, 0x42,
+ *     0x97, 0xda, 0x20, 0xf4, 0x88, 0xe1, 0x6b, 0xd4,
+ *     0x85, 0xf5, 0x1d, 0xca, 0x2a, 0xba, 0x30, 0xc5,
+ *     0xdf, 0x9d, 0x4d, 0xb8, 0xb0, 0x30, 0x54, 0x61,
+ *     0xcf, 0x91, 0x6f, 0x90, 0xa5, 0x25, 0x05, 0x9b,
+ *     0x2b, 0x3e, 0x13, 0xcd, 0xcd, 0x40, 0x59, 0x7c,
+ *     0x92, 0x9b, 0x51, 0x81, 0x0d, 0x58, 0x32, 0x0a,
+ *     0x43, 0xbd, 0x01, 0xb4, 0xb8, 0x0b, 0xd5, 0xee,
+ *     0x0d, 0x67, 0x70, 0x59, 0xd7, 0x47, 0x4f, 0xe5,
+ *     0x84, 0x07, 0x75, 0x3e, 0x54, 0xfb, 0x5d, 0xd1,
+ *     0x3f, 0x72, 0x6e, 0xae, 0xf9, 0x4b, 0x7b, 0x57,
+ *     0xe0, 0xde, 0x8b, 0x8b, 0x12, 0x1b, 0x10, 0x3b,
+ *     0x5e, 0x17, 0xd1, 0x72, 0x18, 0x3d, 0xff, 0xc6,
+ *     0x83, 0xa5, 0xaf, 0xf9, 0x30, 0xae, 0xb7, 0x47,
+ *     0x46, 0x5d, 0xac, 0xba, 0x35, 0x04, 0x35, 0x0b,
+ *     0x42, 0x48, 0x7c, 0xa1, 0x00, 0x1a, 0xea, 0xea,
+ *     0x5f, 0x93, 0x2b, 0xb7, 0xe5, 0x8f, 0x91, 0x3c,
+ *     0x00, 0x98, 0x51, 0x40, 0xee, 0x11, 0x50, 0x70,
+ *     0x40, 0xe4, 0x28, 0xd4, 0x79, 0x2d, 0xcd, 0x82,
+ *     0xaf, 0x3f, 0xb2, 0xfc, 0x96, 0x8d, 0xbe, 0x79,
+ *     0xa3, 0xcd, 0xac, 0x35, 0x4b, 0x5e, 0xb4, 0x81,
+ *     0x0e, 0x6a, 0xde, 0x1f, 0x7e, 0xb0, 0x37, 0x3e,
+ *     0xdc, 0xe0, 0x21, 0xcc, 0x9f, 0x90, 0x26, 0xb6,
+ *     0x8a, 0x1d, 0xb3, 0x1e, 0xec, 0x7a, 0x88, 0x28,
+ *     0x95, 0xe2, 0xc2, 0x1d, 0x07, 0xb1, 0xfa, 0xc6,
+ *     0x21, 0x1b, 0x5e, 0x54, 0x7b, 0x37, 0x0e, 0x63,
+ *     0xff, 0xdd, 0x70, 0xf9, 0xea, 0x2f, 0x2d, 0x98,
+ *     0xe1, 0xbe, 0x37, 0xd0, 0x1f, 0x45, 0x5a, 0x63,
+ *     0xad, 0x44, 0xbc, 0x5f, 0xc6, 0x23, 0x8a, 0xac,
+ *     0x12, 0x71, 0xd5, 0xa2, 0x8b, 0xfc, 0x97, 0xbb,
+ *     0x00, 0x4b, 0xd7, 0x09, 0xa6, 0xaf, 0x40, 0x08,
+ *     0x6c, 0x8d, 0x10, 0x4a, 0x01, 0x34, 0xc1, 0x2c,
+ *     0x92, 0x30, 0x0a, 0x85, 0x8f, 0x3f, 0x08, 0xdd,
+ *     0xff, 0x9c, 0x10, 0xd1, 0x03, 0x03, 0x84, 0x1f,
+ *     0xf8, 0x4e, 0xf2, 0xe3, 0xd1, 0xd3, 0xb9, 0xdf,
+ *     0xfc, 0x97, 0x1c, 0xcf, 0x8a, 0x29, 0xe6, 0x59,
+ *     0x04, 0xe2, 0x87, 0x27, 0xbb, 0xb9, 0x96, 0xd0,
+ *     0x20, 0x2e, 0x91, 0x48, 0xaa, 0xbf, 0x53, 0x4a,
+ *     0x34, 0xb5, 0x0e, 0x11, 0xce, 0xf8, 0x65, 0xa6,
+ *     0x0d, 0x45, 0xda, 0xbf, 0x6a, 0xfb, 0x81, 0xe4,
+ *     0x7c, 0x8c, 0xa0, 0x4b, 0x00, 0x1b, 0xd7, 0x73,
+ *     0x61, 0x80, 0xc0, 0x6b, 0x60, 0xde, 0xf3, 0x32,
+ *     0xae, 0x62, 0x35, 0x66, 0xdd, 0xde, 0x53, 0x61,
+ *     0x86, 0xe9, 0x44, 0xf3, 0x01, 0x7b, 0xaa, 0xe7,
+ *     0x31, 0xd4, 0x5b, 0x06, 0x52, 0x0f, 0xf4, 0x90,
+ *     0x5c, 0x82, 0x3e, 0x12, 0x28, 0x88, 0x7f, 0xfc,
+ *     0xb8, 0xee, 0x17, 0x34, 0x4e, 0xc3, 0x2a, 0xfb,
+ *     0x84, 0x1b, 0x0f, 0xba, 0x51, 0x64, 0x96, 0x22,
+ *     0x0d, 0x88, 0x9b, 0xf2, 0x72, 0x04, 0x55, 0x44,
+ *     0x6a, 0x14, 0x2b, 0xa0, 0xc2, 0xbe, 0x9e, 0x7b,
+ *     0x48, 0x32, 0xa7, 0xf6, 0x11, 0xae, 0x60, 0xfb,
+ *     0xf8, 0x38, 0x67, 0x16, 0xdf, 0xdf, 0x46, 0x96,
+ *     0xd7, 0x6c, 0x39, 0xa2, 0xad, 0xf7, 0xb7, 0x78,
+ *     0x32, 0x2c, 0xba, 0xae, 0x33, 0x5a, 0x88, 0x4b,
+ *     0x40, 0x1f, 0x88, 0xcd, 0xe7, 0x8f, 0x50, 0x5e,
+ *     0xd8, 0x80, 0x82, 0x7b, 0x46, 0xc7, 0x07, 0x71,
+ *     0x4f, 0x3b, 0xca, 0x9d, 0x73, 0x7c, 0xdb, 0xeb,
+ *     0x4c, 0x37, 0xdd, 0xb4, 0xb8, 0x61, 0xf3, 0xdf,
+ *     0xb2, 0xb5, 0x34, 0x27, 0xec, 0xeb, 0xba, 0xcc,
+ *     0xdc, 0xe9, 0xde, 0x47, 0x2e, 0xe9, 0x3b, 0xa1,
+ *     0x36, 0xf1, 0x66, 0xdf, 0xc8, 0x70, 0x7f, 0x39,
+ *     0x82, 0xb3, 0x8c, 0x47, 0x9a, 0x45, 0x59, 0x2e,
+ *     0x30, 0x9b, 0xaf, 0x7c, 0xad, 0x43, 0x38, 0x6e,
+ *     0x05, 0x7d, 0x8b, 0xac, 0x5f, 0x70, 0x63, 0xeb,
+ *     0x85, 0xee, 0xab, 0xa4, 0x57, 0x1d, 0x63, 0xac,
+ *     0x48, 0x45, 0x74, 0xca, 0x0c, 0xa8, 0x65, 0x05,
+ *     0x1a, 0x47, 0xa1, 0x2f, 0x4b, 0x96, 0x26, 0x9e,
+ *     0xee, 0xec, 0x37, 0x57, 0xbf, 0xa0, 0x2b, 0x75,
+ *     0xf5, 0x9b, 0xb5, 0x1d, 0x12, 0x8a, 0x61, 0x9c,
+ *     0x8d, 0x2a, 0x7e, 0xee, 0x05, 0x2b, 0x85, 0x7c,
+ *     0x6f, 0x34, 0xc4, 0xcd, 0xd5, 0xd0, 0xac, 0xf9,
+ *     0x79, 0x24, 0xe7, 0x0f, 0x41, 0x95, 0xe2, 0x9a,
+ *     0x22, 0x32, 0xa5, 0x98, 0x2e, 0x82, 0xc0, 0x07,
+ *     0xf4, 0x74, 0x68, 0x00, 0xf9, 0x35, 0x5e, 0x12,
+ *     0xfe, 0xa2, 0x0e, 0x15, 0x96, 0x83, 0x84, 0x31,
+ *     0xc4, 0x25, 0xda, 0x7a, 0xec, 0x07, 0x15, 0xe4,
+ *     0x7d, 0xc5, 0xf5, 0xe1, 0xc5, 0xba, 0x9a, 0x59,
+ *     0x76, 0xae, 0x4e, 0x54, 0x27, 0x5e, 0xa9, 0x0d,
+ *     0xa0, 0xd3, 0xcd, 0x99, 0x39, 0x76, 0x6d, 0x58,
+ *     0xdf, 0x8a, 0xa9, 0x9e, 0x21, 0x22, 0x48, 0x7c,
+ *     0x0c, 0x13, 0xfa, 0x86, 0x63, 0x74, 0x92, 0xf4,
+ *     0xe5, 0x5d, 0xbf, 0xe4, 0x2d, 0xd7, 0xa1, 0xe3,
+ *     0x0f, 0xc6, 0x3e, 0x82, 0xa0, 0xcc, 0xfa, 0x38,
+ *     0x55, 0x36, 0x9b, 0x22, 0xd0, 0xb8, 0x7f, 0x3f,
+ *     0x0f, 0x35, 0x01, 0xf9, 0x6f, 0xa6, 0x51, 0x77,
+ *     0x21, 0xb7, 0x7a, 0x81, 0xca, 0x83, 0x6b, 0xec,
+ *     0xa7, 0x71, 0x12, 0x6d, 0x22, 0x78, 0xb1, 0xc8,
+ *     0x37, 0xda, 0x1d, 0xd1, 0x9c, 0xa5, 0x6c, 0xfa,
+ *     0xd3, 0x4b, 0x87, 0x39, 0x6f, 0x59, 0xe1, 0xec,
+ *     0x4a, 0xe5, 0x0e, 0x72, 0x2b, 0x31, 0x18, 0xd9,
+ *     0x54, 0x6a, 0x4c, 0xc3, 0xe0, 0x58, 0x3b, 0xd8,
+ *     0xe8, 0x65, 0xc1, 0x98, 0xed, 0x64, 0x7b, 0xb1,
+ *     0xee, 0xa9, 0x54, 0x95, 0x37, 0x98, 0x68, 0xca,
+ *     0x83, 0xef, 0xc5, 0x1b, 0x23, 0x71, 0x5c, 0x1a,
+ *     0xe6, 0xc0, 0xce, 0x2e, 0x16, 0x59, 0x79, 0xf4,
+ *     0x94, 0x43, 0xd8, 0xb1, 0x2e, 0xe3, 0xb9, 0xa0,
+ *     0x95, 0x80, 0x66, 0xdd, 0x1d, 0xdd, 0x0d, 0x78,
+ *     0x9d, 0xc3, 0x91, 0x60, 0x16, 0x8b, 0xc5, 0x39,
+ *     0xad, 0xdb, 0xa3, 0xc1, 0xd2, 0x8d, 0xa0, 0x78,
+ *     0x75, 0x68, 0xa6, 0xb9, 0x15, 0x57, 0x0b, 0x06,
+ *     0x64, 0x55, 0xd7, 0x07, 0x53, 0xf9, 0x8b, 0xd9,
+ *     0x97, 0x46, 0xca, 0x04, 0x95, 0xd4, 0x3c, 0xd3,
+ *     0x8f, 0x0a, 0x53, 0x27, 0xe6, 0xd4, 0xb4, 0x7b,
+ *     0x70, 0x12, 0x12, 0xc5, 0x14, 0xa0, 0x53, 0xe5,
+ *     0xd4, 0x30, 0xaa, 0xcc, 0xec, 0x03, 0x0a, 0x36,
+ *     0x21, 0x9f, 0x81, 0x16, 0x6d, 0x1d, 0x53, 0x6e,
+ *     0x08, 0xae, 0xf7, 0x05, 0xd9, 0x73, 0x5a, 0x45,
+ *     0x3a, 0x52, 0x3e, 0xeb, 0x67, 0x49, 0xe1, 0x1a,
+ *     0x8a, 0x4c, 0xd9, 0x83, 0x64, 0xd8, 0x16, 0x37,
+ *     0x1c, 0x6b, 0x1c, 0x0d, 0x8f, 0x6a, 0xbf, 0x21,
+ *     0xf1, 0x4f, 0x4c, 0x55, 0x6f, 0xe0, 0x5c, 0xa7,
+ *     0xb1, 0x7b, 0x57, 0xa9, 0xa2, 0xb4, 0x9d, 0x53,
+ *     0x7f, 0x0f, 0xb0, 0x21, 0x95, 0x70, 0x3a, 0x0d,
+ *     0xa2, 0xc1, 0x52, 0x26, 0xad, 0xa7, 0x48, 0x66,
+ *     0x2a, 0xfc, 0xaa, 0xaf, 0x25, 0x02, 0x58, 0x80,
+ *     0xbe, 0xe7, 0xe4, 0x2a, 0x50, 0xe5, 0x46, 0x13,
+ *     0xaa, 0x57, 0x0e, 0x6e, 0xee, 0xa9, 0x9e, 0x19,
+ *     0xa3, 0x92, 0x8e, 0xc6, 0x3d, 0x76, 0xbb, 0x12,
+ *     0xe2, 0x78, 0x77, 0x99, 0x6a, 0x06, 0xc4, 0x45,
+ *     0x1f, 0x45, 0xe1, 0xf6, 0x65, 0x1f, 0xba, 0xe4,
+ *     0xf6, 0xca, 0xa9, 0x62, 0xa9, 0x2c, 0x3a, 0x2d,
+ *     0x8d, 0x34, 0xe2, 0x32, 0x6e, 0x4a, 0x52, 0x9f,
+ *     0x3d, 0xcf, 0xab, 0xe8, 0x63, 0x66, 0x3f, 0x06,
+ *     0xa3, 0xaa, 0xd5, 0xcb, 0x5d, 0x41, 0xb8, 0xe7,
+ *     0x0a, 0x6b, 0x45, 0x90, 0x3a, 0xf0, 0xe5, 0x7f,
+ *     0x7e, 0xde, 0x68, 0x20, 0x5e, 0x5a, 0x31, 0x3a,
+ *     0x5c, 0x25, 0xb3, 0x82, 0xc7, 0x1e, 0x7d, 0x4d,
+ *     0xd0, 0x23, 0x9f, 0x22, 0x1a, 0x54, 0x0b, 0xe4,
+ *     0x3c, 0x1c, 0xc5, 0x24, 0x39, 0x4d, 0x96, 0x90,
+ *     0xce, 0xc9, 0x3a, 0x07, 0x45, 0x01, 0x9e, 0xb6,
+ *     0x55, 0x1b, 0xdc, 0xe0, 0x3b, 0xe8, 0x92, 0x57,
+ *     0x43, 0x12, 0x9b, 0x11, 0x3f, 0x81, 0x5a, 0xca,
+ *     0xc5, 0x85, 0x39, 0x25, 0x6d, 0xe4, 0x30, 0xef,
+ *     0x83, 0x21, 0xed, 0x9c, 0xb3, 0xcf, 0x10, 0xe6,
+ *     0xa1, 0x46, 0x10, 0x9a, 0x7b, 0xaf, 0x5f, 0x75,
+ *     0x99, 0x62, 0xc1, 0xf4, 0x2c, 0x28, 0x0a, 0x8a,
+ *     0xc7, 0xd2, 0xb4, 0x75, 0xb9, 0x66, 0x70, 0x9a,
+ *     0xaf, 0xe3, 0xf1, 0x2f, 0xf2, 0xb0, 0x59, 0x9c,
+ *     0x1e, 0x1a, 0xbd, 0xa9, 0x15, 0x55, 0x95, 0x4c,
+ *     0x5b, 0x78, 0x0b, 0x2c, 0x00, 0xbb, 0xf9, 0x8b,
+ *     0xeb, 0x72, 0x4f, 0xfb, 0xa4, 0x3a, 0xa0, 0x04,
+ *     0x45, 0x32, 0x02, 0x6c, 0x16, 0x52, 0x3f, 0x4a,
+ *     0x0a, 0x77, 0x64, 0xf4, 0x74, 0xed, 0x60, 0x6b,
+ *     0x5e, 0x43, 0xa7, 0xe3, 0x84, 0x7e, 0xda, 0xf0,
+ *     0xb1, 0x9e, 0x6d, 0x90, 0x9c, 0x32, 0xae, 0xba,
+ *     0x7c, 0xfb, 0x72, 0x22, 0x27, 0x9c, 0xe1, 0x85,
+ *     0xe1, 0xf6, 0x22, 0x4c, 0x3c, 0x4a, 0xd6, 0xed,
+ *     0x4c, 0xa7, 0x79, 0x59, 0xb5, 0x5b, 0x91, 0x65,
+ *     0x3f, 0x93, 0x97, 0x8d, 0xd7, 0xd0, 0xab, 0x17,
+ *     0x2f, 0x13, 0x74, 0x53, 0x69, 0x74, 0xf8, 0x6b,
+ *     0x39, 0x5c, 0x64, 0x5b, 0x3d, 0x75, 0xca, 0x85,
+ *     0x0e, 0xda, 0x0f, 0x01, 0x34, 0xa3, 0x67, 0x8e,
+ *     0x26, 0x6f, 0x26, 0x3c, 0xd0, 0xd9, 0xae, 0xe8,
+ *     0x52, 0x13, 0x7f, 0xf8, 0x69, 0x62, 0xfc, 0x9a,
+ *     0xc0, 0x0c, 0x66, 0x2e, 0x57, 0x21, 0x75, 0xb0,
+ *     0xb3, 0x8c, 0xf6, 0x97, 0x44, 0x46, 0x65, 0x15,
+ *     0x79, 0xd5, 0x6b, 0x68, 0x96, 0x47, 0xc1, 0xba,
+ *     0x75, 0x46, 0x87, 0x76, 0x7d, 0x2d, 0xac, 0xf3,
+ *     0x16, 0xae, 0xfb, 0x7e, 0x41, 0xe4, 0xae, 0x15,
+ *     0xc2, 0x51, 0x69, 0x71, 0x0b, 0x63, 0x20, 0x6a,
+ *     0xbd, 0xad, 0xce, 0x2a, 0x94, 0xac, 0xcf, 0x15,
+ *     0x4e, 0xdc, 0x8e, 0x2a, 0x48, 0xed, 0xb3, 0x48,
+ *     0x95, 0xf4, 0x41, 0xf3, 0x52, 0xef, 0x62, 0x90,
+ *     0x10, 0x30, 0x42, 0xec, 0xf9, 0x30, 0x25, 0xc3,
+ *     0xc5, 0x47, 0x76, 0xb5, 0x37, 0xeb, 0x9e, 0x87,
+ *     0xbe, 0x5c, 0x24, 0xa5, 0x34, 0xdd, 0x92, 0xa1,
+ *     0x20, 0x7d, 0xa7, 0x94, 0xa2, 0x67, 0x26, 0x70,
+ *     0xfe, 0xc9, 0x3f, 0x21, 0xd1, 0xc2, 0x5a, 0xb1,
+ *     0xaa, 0xac, 0x14, 0x1a, 0xe4, 0xdb, 0x71, 0x7e,
+ *     0x9c, 0xc2, 0x52, 0x59, 0xc9, 0x58, 0xca, 0x88,
+ *     0x71, 0x4f, 0x90, 0xb1, 0xbb, 0xac, 0x80, 0x53,
+ *     0x21, 0xfb, 0xff, 0xfd, 0x1e, 0x9f, 0xc0, 0x59,
+ *     0x8d, 0x80, 0x8e, 0x85, 0xa9, 0x3b, 0xd3, 0x20,
+ *     0x3b, 0x91, 0x16, 0x49, 0xb2, 0x2a, 0xa4, 0xe2,
+ *     0x30, 0xb2, 0x76, 0xf6, 0x92, 0x71, 0x37, 0x1b
+ * };
+ */

 static const unsigned char ml_dsa_65_priv_key[] = {
     0x3b, 0x5c, 0xb0, 0x79, 0xd2, 0xce, 0x76, 0x2b,
@@ -2903,15 +3073,15 @@ static const uint8_t slh_dsa_sha2_128f_keygen_pub[] = {

 static const ST_KAT_PARAM slh_dsa_sha2_128f_keygen_init_params[] = {
     ST_KAT_PARAM_OCTET(OSSL_PKEY_PARAM_SLH_DSA_SEED,
-                       slh_dsa_sha2_128f_keygen_entropy),
+        slh_dsa_sha2_128f_keygen_entropy),
     ST_KAT_PARAM_END()
 };

 static const ST_KAT_PARAM slh_dsa_128f_keygen_expected_params[] = {
     ST_KAT_PARAM_OCTET(OSSL_PKEY_PARAM_PRIV_KEY,
-                       slh_dsa_sha2_128f_keygen_priv_pub),
+        slh_dsa_sha2_128f_keygen_priv_pub),
     ST_KAT_PARAM_OCTET(OSSL_PKEY_PARAM_PUB_KEY,
-                       slh_dsa_sha2_128f_keygen_pub),
+        slh_dsa_sha2_128f_keygen_pub),
     ST_KAT_PARAM_END()
 };

@@ -2945,7 +3115,7 @@ static const unsigned char slh_dsa_shake_128f_priv_pub[] = {
     0xbb, 0xc7, 0x43, 0x06, 0xf7, 0x5d, 0xc2, 0xda, 0xf7, 0x37, 0x2b, 0x3c, 0x98, 0x41, 0xa4, 0xd6,
     0x85, 0x2c, 0x17, 0xb4, 0x59, 0xf1, 0x69, 0x2b, 0x8e, 0x9a, 0x1a, 0x0d, 0xac, 0xe5, 0xba, 0x26,
     0x38, 0x0c, 0x99, 0x30, 0x4a, 0x0d, 0xdd, 0x32, 0xf3, 0x44, 0xb9, 0x51, 0x44, 0xe1, 0xfd, 0xef,
-    0x60, 0xbb, 0xc2, 0x34, 0x0e, 0x08, 0x77, 0x0f, 0xb4, 0x1a, 0x80, 0xa7, 0x6c, 0xb0, 0x8e, 0x34,
+    0x60, 0xbb, 0xc2, 0x34, 0x0e, 0x08, 0x77, 0x0f, 0xb4, 0x1a, 0x80, 0xa7, 0x6c, 0xb0, 0x8e, 0x34
 };

 static const ST_KAT_PARAM slh_dsa_shake_128f_key_params[] = {
@@ -2964,7 +3134,7 @@ static const unsigned char slh_dsa_shake_128f_sig_digest[] = {
     0xb7, 0xeb, 0x1f, 0x00, 0x33, 0x41, 0xff, 0x11,
     0x3f, 0xc7, 0x4d, 0xce, 0x90, 0x6c, 0x55, 0xf7,
     0x4a, 0x54, 0x8b, 0x86, 0xc1, 0xb1, 0x08, 0x48,
-    0x89, 0x77, 0x00, 0x72, 0x03, 0x92, 0xd1, 0xa6,
+    0x89, 0x77, 0x00, 0x72, 0x03, 0x92, 0xd1, 0xa6
 };
 #endif /* OPENSSL_NO_SLH_DSA */

@@ -2984,118 +3154,6 @@ static const unsigned char sig_kat_persstr[] = {
     0xac, 0x54, 0x4f, 0xce, 0x57, 0xf1, 0x5e, 0x11
 };

-static const ST_KAT_SIGN st_kat_sign_tests[] = {
-    {
-        OSSL_SELF_TEST_DESC_SIGN_RSA,
-        "RSA", "RSA-SHA256", 0,
-        rsa_crt_key,
-        ITM_STR(rsa_sig_msg),
-        ITM(sig_kat_entropyin),
-        ITM(sig_kat_nonce),
-        ITM(sig_kat_persstr),
-        ITM(rsa_expected_sig)
-    },
-#ifndef OPENSSL_NO_EC
-    {
-        OSSL_SELF_TEST_DESC_SIGN_ECDSA,
-        "EC", "ECDSA-SHA256", 0,
-        ecdsa_prime_key,
-        ITM_STR(rsa_sig_msg),
-        ITM(sig_kat_entropyin),
-        ITM(sig_kat_nonce),
-        ITM(sig_kat_persstr),
-        ITM(ecdsa_prime_expected_sig)
-    },
-# ifndef OPENSSL_NO_EC2M
-    {
-        OSSL_SELF_TEST_DESC_SIGN_ECDSA,
-        "EC", "ECDSA-SHA256", 0,
-        ecdsa_bin_key,
-        ITM_STR(rsa_sig_msg),
-        ITM(sig_kat_entropyin),
-        ITM(sig_kat_nonce),
-        ITM(sig_kat_persstr),
-        ITM(ecdsa_bin_expected_sig)
-    },
-# endif
-# ifndef OPENSSL_NO_ECX
-    {
-        OSSL_SELF_TEST_DESC_SIGN_EDDSA,
-        "ED448", "ED448", 0,
-        ed448_key,
-        ITM(ecx_sig_msg),
-        NULL, 0, NULL, 0, NULL, 0,
-        ITM(ed448_expected_sig),
-    },
-    {
-        OSSL_SELF_TEST_DESC_SIGN_EDDSA,
-        "ED25519", "ED25519", 0,
-        ed25519_key,
-        ITM(ecx_sig_msg),
-        NULL, 0, NULL, 0, NULL, 0,
-        ITM(ed25519_expected_sig),
-    },
-# endif /* OPENSSL_NO_ECX */
-#endif /* OPENSSL_NO_EC */
-#ifndef OPENSSL_NO_DSA
-    {
-        OSSL_SELF_TEST_DESC_SIGN_DSA,
-        "DSA", "DSA-SHA256", SIGNATURE_MODE_VERIFY_ONLY,
-        dsa_key,
-        ITM_STR(rsa_sig_msg),
-        ITM(sig_kat_entropyin),
-        ITM(sig_kat_nonce),
-        ITM(sig_kat_persstr),
-        ITM(dsa_expected_sig)
-    },
-#endif /* OPENSSL_NO_DSA */
-
-#ifndef OPENSSL_NO_ML_DSA
-    {
-        OSSL_SELF_TEST_DESC_SIGN_ML_DSA,
-        "ML-DSA-65", "ML-DSA-65", 0,
-        ml_dsa_key,
-        ITM(ml_dsa_65_msg),
-        NULL, 0,
-        NULL, 0,
-        NULL, 0,
-        ITM(ml_dsa_65_sig),
-        ml_dsa_sig_init,
-        ml_dsa_sig_init
-    },
-#endif /* OPENSSL_NO_ML_DSA */
-#ifndef OPENSSL_NO_SLH_DSA
-    /*
-     * FIPS 140-3 IG 10.3.A.16 Note 29 says:
-     *
-     *  It is recommended (but not required) that if the module implements
-     *   both "s" and "f" algorithms, the module self-test at least one of
-     *   each "s" and "f" algorithm.
-     *
-     * Because the "s" version is so slow, we only test the "f" versions
-     * here.
-     */
-    {
-        OSSL_SELF_TEST_DESC_SIGN_SLH_DSA,
-        "SLH-DSA-SHA2-128f", "SLH-DSA-SHA2-128f", SIGNATURE_MODE_SIG_DIGESTED,
-        slh_dsa_sha2_128f_key_params,
-        ITM(slh_dsa_sha2_sig_msg),
-        NULL, 0, NULL, 0, NULL, 0,
-        ITM(slh_dsa_sha2_128f_sig_digest),
-        slh_dsa_sig_params, slh_dsa_sig_params
-    },
-    {
-        OSSL_SELF_TEST_DESC_SIGN_SLH_DSA,
-        "SLH-DSA-SHAKE-128f", "SLH-DSA-SHAKE-128f", SIGNATURE_MODE_SIG_DIGESTED,
-        slh_dsa_shake_128f_key_params,
-        ITM(slh_dsa_shake_sig_msg),
-        NULL, 0, NULL, 0, NULL, 0,
-        ITM(slh_dsa_shake_128f_sig_digest),
-        slh_dsa_sig_params, slh_dsa_sig_params
-    },
-#endif /* OPENSSL_NO_SLH_DSA */
-};
-
 #if !defined(OPENSSL_NO_ML_DSA)
 static const ST_KAT_PARAM ml_dsa_keygen_params[] = {
     ST_KAT_PARAM_OCTET(OSSL_PKEY_PARAM_ML_DSA_SEED, sig_kat_entropyin),
@@ -3462,79 +3520,729 @@ static const ST_KAT_PARAM ml_kem_key[] = {
     ST_KAT_PARAM_OCTET(OSSL_PKEY_PARAM_PRIV_KEY, ml_kem_512_private_key),
     ST_KAT_PARAM_END()
 };
+#endif /* OPENSSL_NO_ML_KEM */

-static const ST_KAT_KEM st_kat_kem_tests[] = {
-    {
-        OSSL_SELF_TEST_DESC_KEM,
-        "ML-KEM-512",
-        ml_kem_key,
-        ITM(ml_kem_512_cipher_text),
-        ITM(ml_kem_512_entropy),
-        ITM(ml_kem_512_secret),
-        ml_kem_512_reject_secret    /* No length because same as _secret's */
-    },
+/*
+ * We need an explicit HMAC-SHA-256 KAT even though it is also
+ * checked as part of the KDF KATs.  Refer IG 10.3.
+ */
+static const char hmac_kat_digest[] = "SHA256";
+static const unsigned char hmac_kat_pt[] = {
+    0xdd, 0x0c, 0x30, 0x33, 0x35, 0xf9, 0xe4, 0x2e,
+    0xc2, 0xef, 0xcc, 0xbf, 0x07, 0x95, 0xee, 0xa2
+};
+static const unsigned char hmac_kat_key[] = {
+    0xf4, 0x55, 0x66, 0x50, 0xac, 0x31, 0xd3, 0x54,
+    0x61, 0x61, 0x0b, 0xac, 0x4e, 0xd8, 0x1b, 0x1a,
+    0x18, 0x1b, 0x2d, 0x8a, 0x43, 0xea, 0x28, 0x54,
+    0xcb, 0xae, 0x22, 0xca, 0x74, 0x56, 0x08, 0x13
+};
+static const unsigned char hmac_kat_expected[] = {
+    0xf5, 0xf5, 0xe5, 0xf2, 0x66, 0x49, 0xe2, 0x40,
+    0xfc, 0x9e, 0x85, 0x7f, 0x2b, 0x9a, 0xbe, 0x28,
+    0x20, 0x12, 0x00, 0x92, 0x82, 0x21, 0x3e, 0x51,
+    0x44, 0x5d, 0xe3, 0x31, 0x04, 0x01, 0x72, 0x6b
+};
+static const ST_KAT_PARAM hmac_kat_params[] = {
+    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, hmac_kat_digest),
+    ST_KAT_PARAM_OCTET(OSSL_MAC_PARAM_KEY, hmac_kat_key),
+    ST_KAT_PARAM_END()
 };
-#endif /* OPENSSL_NO_ML_KEM */

-#if !defined(OPENSSL_NO_ML_KEM) || !defined(OPENSSL_NO_ML_DSA) || !defined(OPENSSL_NO_SLH_DSA)
-static const ST_KAT_ASYM_KEYGEN st_kat_asym_keygen_tests[] = {
-# if !defined(OPENSSL_NO_ML_KEM)
+ST_DEFINITION st_all_tests[ST_ID_MAX] = {
+    {
+        ST_ID_DRBG_HASH,
+        "HASH-DRBG",
+        OSSL_SELF_TEST_DESC_DRBG_HASH,
+        SELF_TEST_DRBG,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(drbg_hash_sha256_pr_expected),
+        .u.drbg = {
+            "digest",
+            "SHA256",
+            ITM_BUF(drbg_hash_sha256_pr_entropyin),
+            ITM_BUF(drbg_hash_sha256_pr_nonce),
+            ITM_BUF(drbg_hash_sha256_pr_persstr),
+            ITM_BUF(drbg_hash_sha256_pr_entropyinpr0),
+            ITM_BUF(drbg_hash_sha256_pr_entropyinpr1),
+            ITM_BUF(drbg_hash_sha256_pr_addin0),
+            ITM_BUF(drbg_hash_sha256_pr_addin1),
+        },
+    },
+    {
+        ST_ID_DRBG_CTR,
+        "CTR-DRBG",
+        OSSL_SELF_TEST_DESC_DRBG_CTR,
+        SELF_TEST_DRBG,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(drbg_ctr_aes128_pr_df_expected),
+        .u.drbg = {
+            "cipher",
+            "AES-128-CTR",
+            ITM_BUF(drbg_ctr_aes128_pr_df_entropyin),
+            ITM_BUF(drbg_ctr_aes128_pr_df_nonce),
+            ITM_BUF(drbg_ctr_aes128_pr_df_persstr),
+            ITM_BUF(drbg_ctr_aes128_pr_df_entropyinpr0),
+            ITM_BUF(drbg_ctr_aes128_pr_df_entropyinpr1),
+            ITM_BUF(drbg_ctr_aes128_pr_df_addin0),
+            ITM_BUF(drbg_ctr_aes128_pr_df_addin1),
+        },
+    },
+    {
+        ST_ID_DRBG_HMAC,
+        "HMAC-DRBG",
+        OSSL_SELF_TEST_DESC_DRBG_HMAC,
+        SELF_TEST_DRBG,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(drbg_hmac_sha2_pr_expected),
+        .u.drbg = {
+            "digest",
+            "SHA256",
+            ITM_BUF(drbg_hmac_sha2_pr_entropyin),
+            ITM_BUF(drbg_hmac_sha2_pr_nonce),
+            ITM_BUF(drbg_hmac_sha2_pr_persstr),
+            ITM_BUF(drbg_hmac_sha2_pr_entropyinpr0),
+            ITM_BUF(drbg_hmac_sha2_pr_entropyinpr1),
+            ITM_BUF(drbg_hmac_sha2_pr_addin0),
+            ITM_BUF(drbg_hmac_sha2_pr_addin1),
+        },
+    },
+    {
+        ST_ID_CIPHER_AES_256_GCM,
+        "AES-256-GCM",
+        OSSL_SELF_TEST_DESC_CIPHER_AES_GCM,
+        SELF_TEST_KAT_CIPHER,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF(aes_256_gcm_pt),
+        ITM_BUF(aes_256_gcm_ct),
+        .u.cipher = {
+            CIPHER_MODE_ENCRYPT | CIPHER_MODE_DECRYPT,
+            ITM_BUF(aes_256_gcm_key),
+            ITM_BUF(aes_256_gcm_iv),
+            ITM_BUF(aes_256_gcm_aad),
+            ITM_BUF(aes_256_gcm_tag),
+        },
+    },
+    {
+        ST_ID_CIPHER_AES_128_ECB,
+        "AES-128-ECB",
+        OSSL_SELF_TEST_DESC_CIPHER_AES_ECB,
+        SELF_TEST_KAT_CIPHER,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF(aes_128_ecb_pt),
+        ITM_BUF(aes_128_ecb_ct),
+        .u.cipher = {
+            CIPHER_MODE_DECRYPT,
+            ITM_BUF(aes_128_ecb_key),
+        },
+        .depends_on = aes_ecb_depends_on,
+    },
+#ifndef OPENSSL_NO_DES
+    {
+        ST_ID_CIPHER_DES_EDE3_ECB,
+        "DES-EDE3-ECB",
+        OSSL_SELF_TEST_DESC_CIPHER_TDES,
+        SELF_TEST_KAT_CIPHER,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF(tdes_pt),
+        ITM_BUF(tdes_ct),
+        .u.cipher = {
+            CIPHER_MODE_DECRYPT,
+            ITM_BUF(tdes_key),
+        },
+    },
+#endif
+#ifndef OPENSSL_NO_ML_KEM
     /*
      * FIPS 140-3 IG 10.3.A resolution 14 mandates a CAST for ML-KEM
      * key generation.
      */
     {
-        OSSL_SELF_TEST_DESC_KEYGEN_ML_KEM,
+        ST_ID_ASYM_KEYGEN_ML_KEM,
         "ML-KEM-512",
-        ml_kem_keygen_params,
-        ml_kem_key
+        OSSL_SELF_TEST_DESC_KEYGEN_ML_KEM,
+        SELF_TEST_KAT_ASYM_KEYGEN,
+        SELF_TEST_STATE_INIT,
+        .u.akgen = {
+            ml_kem_keygen_params,
+            ml_kem_key,
+        },
     },
-# endif
-# if !defined(OPENSSL_NO_ML_DSA)
+#endif
+#ifndef OPENSSL_NO_ML_DSA
     {
-        OSSL_SELF_TEST_DESC_KEYGEN_ML_DSA,
+        ST_ID_ASYM_KEYGEN_ML_DSA,
         "ML-DSA-65",
-        ml_dsa_keygen_params,
-        ml_dsa_key
+        OSSL_SELF_TEST_DESC_KEYGEN_ML_DSA,
+        SELF_TEST_KAT_ASYM_KEYGEN,
+        SELF_TEST_STATE_INIT,
+        .u.akgen = {
+            ml_dsa_keygen_params,
+            ml_dsa_key,
+        },
     },
-# endif
-# if !defined(OPENSSL_NO_SLH_DSA)
+#endif
+#ifndef OPENSSL_NO_SLH_DSA
     {
+        ST_ID_ASYM_KEYGEN_SLH_DSA,
+        "SLH-DSA-SHA2-128f",
         OSSL_SELF_TEST_DESC_KEYGEN_SLH_DSA,
+        SELF_TEST_KAT_ASYM_KEYGEN,
+        SELF_TEST_STATE_INIT,
+        .u.akgen = {
+            slh_dsa_sha2_128f_keygen_init_params,
+            slh_dsa_128f_keygen_expected_params,
+        },
+    },
+#endif
+    {
+        ST_ID_SIG_RSA_SHA256,
+        "RSA-SHA256",
+        OSSL_SELF_TEST_DESC_SIGN_RSA,
+        SELF_TEST_KAT_SIGNATURE,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF_STR(rsa_sig_msg),
+        ITM_BUF(rsa_expected_sig),
+        .u.sig = {
+            "RSA",
+            0,
+            rsa_crt_key,
+            ITM_BUF(sig_kat_entropyin),
+            ITM_BUF(sig_kat_nonce),
+            ITM_BUF(sig_kat_persstr),
+        },
+    },
+#ifndef OPENSSL_NO_EC
+    {
+        ST_ID_SIG_ECDSA_SHA256,
+        "ECDSA-SHA256",
+        OSSL_SELF_TEST_DESC_SIGN_ECDSA,
+        SELF_TEST_KAT_SIGNATURE,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF_STR(rsa_sig_msg),
+        ITM_BUF(ecdsa_prime_expected_sig),
+        .u.sig = {
+            "EC",
+            0,
+            ecdsa_prime_key,
+            ITM_BUF(sig_kat_entropyin),
+            ITM_BUF(sig_kat_nonce),
+            ITM_BUF(sig_kat_persstr),
+        },
+        .depends_on = ecdsa_depends_on,
+    },
+#ifndef OPENSSL_NO_HMAC_DRBG_KDF
+    {
+        ST_ID_SIG_DET_ECDSA_SHA256,
+        "ECDSA-SHA256",
+        OSSL_SELF_TEST_DESC_SIGN_DetECDSA,
+        SELF_TEST_KAT_SIGNATURE,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF_STR(rsa_sig_msg),
+        ITM_BUF(ecdsa_prime_expected_detsig),
+        .u.sig = {
+            "EC",
+            0,
+            ecdsa_prime_key,
+            .init = ecdsa_sig_params,
+        },
+    },
+#endif
+#ifndef OPENSSL_NO_EC2M
+    {
+        ST_ID_SIG_E2CM_ECDSA_SHA256,
+        "ECDSA-SHA256",
+        OSSL_SELF_TEST_DESC_SIGN_ECDSA,
+        SELF_TEST_KAT_SIGNATURE,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF_STR(rsa_sig_msg),
+        ITM_BUF(ecdsa_bin_expected_sig),
+        .u.sig = {
+            "EC",
+            0,
+            ecdsa_bin_key,
+            ITM_BUF(sig_kat_entropyin),
+            ITM_BUF(sig_kat_nonce),
+            ITM_BUF(sig_kat_persstr),
+        },
+    },
+#endif
+#ifndef OPENSSL_NO_ECX
+    {
+        ST_ID_SIG_ED448,
+        "ED448",
+        OSSL_SELF_TEST_DESC_SIGN_EDDSA,
+        SELF_TEST_KAT_SIGNATURE,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF(ecx_sig_msg),
+        ITM_BUF(ed448_expected_sig),
+        .u.sig = {
+            "ED448",
+            0,
+            ed448_key,
+        },
+    },
+    {
+        ST_ID_SIG_ED25519,
+        "ED25519",
+        OSSL_SELF_TEST_DESC_SIGN_EDDSA,
+        SELF_TEST_KAT_SIGNATURE,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF(ecx_sig_msg),
+        ITM_BUF(ed25519_expected_sig),
+        .u.sig = {
+            "ED25519",
+            0,
+            ed25519_key,
+        },
+    },
+#endif /* OPENSSL_NO_ECX */
+#endif /* OPENSSL_NO_EC */
+#ifndef OPENSSL_NO_DSA
+    {
+        ST_ID_SIG_DSA_SHA256,
+        "DSA-SHA256",
+        OSSL_SELF_TEST_DESC_SIGN_DSA,
+        SELF_TEST_KAT_SIGNATURE,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF_STR(rsa_sig_msg),
+        ITM_BUF(dsa_expected_sig),
+        .u.sig = {
+            "DSA",
+            SIGNATURE_MODE_VERIFY_ONLY,
+            dsa_key,
+            ITM_BUF(sig_kat_entropyin),
+            ITM_BUF(sig_kat_nonce),
+            ITM_BUF(sig_kat_persstr),
+        },
+    },
+#endif /* OPENSSL_NO_DSA */
+#ifndef OPENSSL_NO_ML_DSA
+    {
+        ST_ID_SIG_ML_DSA_65,
+        "ML-DSA-65",
+        OSSL_SELF_TEST_DESC_SIGN_ML_DSA,
+        SELF_TEST_KAT_SIGNATURE,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF(ml_dsa_65_msg),
+        ITM_BUF(ml_dsa_65_sig),
+        .u.sig = {
+            "ML-DSA-65",
+            0,
+            ml_dsa_key,
+            .init = ml_dsa_sig_init,
+            .verify = ml_dsa_sig_init,
+        },
+    },
+#endif /* OPENSSL_NO_ML_DSA */
+#ifndef OPENSSL_NO_SLH_DSA
+    /*
+     * FIPS 140-3 IG 10.3.A.16 Note 29 says:
+     *
+     *  It is recommended (but not required) that if the module implements
+     *   both "s" and "f" algorithms, the module self-test at least one of
+     *   each "s" and "f" algorithm.
+     *
+     * Because the "s" version is so slow, we only test the "f" versions
+     * here.
+     */
+    {
+        ST_ID_SIG_SLH_DSA_SHA2_128F,
         "SLH-DSA-SHA2-128f",
-        slh_dsa_sha2_128f_keygen_init_params,
-        slh_dsa_128f_keygen_expected_params
+        OSSL_SELF_TEST_DESC_SIGN_SLH_DSA,
+        SELF_TEST_KAT_SIGNATURE,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF(slh_dsa_sha2_sig_msg),
+        ITM_BUF(slh_dsa_sha2_128f_sig_digest),
+        .u.sig = {
+            "SLH-DSA-SHA2-128f",
+            SIGNATURE_MODE_SIG_DIGESTED,
+            slh_dsa_sha2_128f_key_params,
+            .init = slh_dsa_sig_params,
+            .verify = slh_dsa_sig_params,
+        },
     },
-# endif
-};
-#endif /* !OPENSSL_NO_ML_DSA || !OPENSSL_NO_SLH_DSA */
-
-static const ST_KAT_ASYM_CIPHER st_kat_asym_cipher_tests[] = {
     {
-        OSSL_SELF_TEST_DESC_ASYM_RSA_ENC,
-        "RSA",
-        1,
-        rsa_pub_key,
-        rsa_enc_params,
-        ITM(rsa_asym_plaintext_encrypt),
-        ITM(rsa_asym_expected_encrypt),
+        ST_ID_SIG_SLH_DSA_SHAKE_128F,
+        "SLH-DSA-SHAKE-128f",
+        OSSL_SELF_TEST_DESC_SIGN_SLH_DSA,
+        SELF_TEST_KAT_SIGNATURE,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF(slh_dsa_shake_sig_msg),
+        ITM_BUF(slh_dsa_shake_128f_sig_digest),
+        .u.sig = {
+            "SLH-DSA-SHAKE-128f",
+            SIGNATURE_MODE_SIG_DIGESTED,
+            slh_dsa_shake_128f_key_params,
+            .init = slh_dsa_sig_params,
+            .verify = slh_dsa_sig_params,
+        },
+    },
+#endif /* OPENSSL_NO_SLH_DSA */
+/*
+ * FIPS 140-3 IG 10.3.A Note 5 mandates a CAST for LMS.
+ *
+ * It permits this to be omitted if HSS is also implemented and has
+ * the relevant self tests.  Once HSS is implemented, this test can be
+ * removed.  This IG permits the digest's CAST to be subsumed into this
+ * test, however, because this will be removed, the underlying digest
+ * test has been retained elsewhere lest it is accidentally omitted.
+ */
+#ifndef OPENSSL_NO_LMS
+    {
+        ST_ID_SIG_LMS,
+        "LMS",
+        OSSL_SELF_TEST_DESC_SIGN_LMS,
+        SELF_TEST_KAT_SIGNATURE,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF(sha256_192_msg),
+        ITM_BUF(sha256_192_sig),
+        .u.sig = {
+            "LMS",
+            SIGNATURE_MODE_VERIFY_ONLY,
+            lms_key,
+        },
     },
+#endif
+#ifndef OPENSSL_NO_ML_KEM
     {
-        OSSL_SELF_TEST_DESC_ASYM_RSA_DEC,
+        ST_ID_KEM_ML_KEM,
+        "ML-KEM-512",
+        OSSL_SELF_TEST_DESC_KEM,
+        SELF_TEST_KAT_KEM,
+        SELF_TEST_STATE_INIT,
+        .u.kem = {
+            ml_kem_key,
+            ITM_BUF(ml_kem_512_cipher_text),
+            ITM_BUF(ml_kem_512_entropy),
+            ITM_BUF(ml_kem_512_secret),
+            ITM_BUF(ml_kem_512_reject_secret),
+        },
+    },
+#endif
+    {
+        ST_ID_ASYM_CIPHER_RSA_ENC,
         "RSA",
-        0,
-        rsa_priv_key,
-        rsa_enc_params,
-        ITM(rsa_asym_expected_encrypt),
-        ITM(rsa_asym_plaintext_encrypt),
+        OSSL_SELF_TEST_DESC_ASYM_RSA_ENC,
+        SELF_TEST_KAT_ASYM_CIPHER,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF(rsa_asym_plaintext_encrypt),
+        ITM_BUF(rsa_asym_expected_encrypt),
+        .u.ac = {
+            1,
+            rsa_pub_key,
+            rsa_enc_params,
+        },
+        .depends_on = rsaenc_depends_on,
     },
     {
+        ST_ID_ASYM_CIPHER_RSA_DEC,
+        "RSA",
         OSSL_SELF_TEST_DESC_ASYM_RSA_DEC,
+        SELF_TEST_KAT_ASYM_CIPHER,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF(rsa_asym_expected_encrypt),
+        ITM_BUF(rsa_asym_plaintext_encrypt),
+        .u.ac = {
+            0,
+            rsa_priv_key,
+            rsa_enc_params,
+        },
+        .depends_on = rsaenc_depends_on,
+    },
+    {
+        ST_ID_ASYM_CIPHER_RSA_DEC_CRT,
         "RSA",
-        0,
-        rsa_crt_key,
-        rsa_enc_params,
-        ITM(rsa_asym_expected_encrypt),
-        ITM(rsa_asym_plaintext_encrypt),
+        OSSL_SELF_TEST_DESC_ASYM_RSA_DEC,
+        SELF_TEST_KAT_ASYM_CIPHER,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF(rsa_asym_expected_encrypt),
+        ITM_BUF(rsa_asym_plaintext_encrypt),
+        .u.ac = {
+            0,
+            rsa_crt_key,
+            rsa_enc_params,
+        },
+        .depends_on = rsaenc_depends_on,
+    },
+#ifndef OPENSSL_NO_DH
+    {
+        ST_ID_KA_DH,
+        "DH",
+        OSSL_SELF_TEST_DESC_KA_DH,
+        SELF_TEST_KAT_KAS,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(dh_secret_expected),
+        .u.kas = {
+            dh_group,
+            dh_host_key,
+            dh_peer_key,
+        },
+    },
+#endif
+#ifndef OPENSSL_NO_EC
+    {
+        ST_ID_KA_ECDH,
+        "EC",
+        OSSL_SELF_TEST_DESC_KA_ECDH,
+        SELF_TEST_KAT_KAS,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(ecdh_secret_expected),
+        .u.kas = {
+            ecdh_group,
+            ecdh_host_key,
+            ecdh_peer_key,
+        },
+    },
+#endif
+    {
+        ST_ID_KDF_TLS13_EXTRACT,
+        OSSL_KDF_NAME_TLS1_3_KDF,
+        OSSL_SELF_TEST_DESC_KDF_TLS13_EXTRACT,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(tls13_kdf_early_secret),
+        .u.kdf = {
+            tls13_kdf_early_secret_params,
+        },
+        .depends_on = hkdf_depends_on,
+    },
+    {
+        ST_ID_KDF_TLS13_EXPAND,
+        OSSL_KDF_NAME_TLS1_3_KDF,
+        OSSL_SELF_TEST_DESC_KDF_TLS13_EXPAND,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(tls13_kdf_client_early_traffic_secret),
+        .u.kdf = {
+            tls13_kdf_client_early_secret_params,
+        },
+        .depends_on = hkdf_depends_on,
+    },
+    {
+        ST_ID_KDF_TLS12_PRF,
+        OSSL_KDF_NAME_TLS1_PRF,
+        OSSL_SELF_TEST_DESC_KDF_TLS12_PRF,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(tls12prf_expected),
+        .u.kdf = {
+            tls12prf_params,
+        },
+    },
+    {
+        ST_ID_KDF_PBKDF2,
+        OSSL_KDF_NAME_PBKDF2,
+        OSSL_SELF_TEST_DESC_KDF_PBKDF2,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(pbkdf2_expected),
+        .u.kdf = {
+            pbkdf2_params,
+        },
+    },
+#ifndef OPENSSL_NO_KBKDF
+    {
+        ST_ID_KDF_KBKDF,
+        OSSL_KDF_NAME_KBKDF,
+        OSSL_SELF_TEST_DESC_KDF_KBKDF,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(kbkdf_expected),
+        .u.kdf = {
+            kbkdf_params,
+        },
+        .depends_on = kbkdf_depends_on,
+    },
+    {
+        ST_ID_KDF_KBKDF_KMAC,
+        OSSL_KDF_NAME_KBKDF,
+        OSSL_SELF_TEST_DESC_KDF_KBKDF_KMAC,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(kbkdf_kmac_expected),
+        .u.kdf = {
+            kbkdf_kmac_params,
+        },
+        .depends_on = kbkdf_depends_on,
+    },
+#endif
+    {
+        ST_ID_KDF_HKDF,
+        OSSL_KDF_NAME_HKDF,
+        OSSL_SELF_TEST_DESC_KDF_HKDF,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(hkdf_expected),
+        .u.kdf = {
+            hkdf_params,
+        },
+        .depends_on = hkdf_depends_on,
+    },
+#ifndef OPENSSL_NO_IKEV2KDF
+    {
+        ST_ID_KDF_IKEV2KDF_GEN,
+        OSSL_KDF_NAME_IKEV2KDF,
+        OSSL_SELF_TEST_DESC_KDF_IKEV2KDF_GEN,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(ikev2kdf_expected_seedkey),
+        .u.kdf = {
+            ikev2kdf_gen_params,
+        },
+    },
+    {
+        ST_ID_KDF_IKEV2KDF_DKM1,
+        OSSL_KDF_NAME_IKEV2KDF,
+        OSSL_SELF_TEST_DESC_KDF_IKEV2KDF_DKM1,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(ikev2kdf_expected_dkm),
+        .u.kdf = {
+            ikev2kdf_dkm_params_dkm,
+        },
+    },
+    {
+        ST_ID_KDF_IKEV2KDF_DKM2,
+        OSSL_KDF_NAME_IKEV2KDF,
+        OSSL_SELF_TEST_DESC_KDF_IKEV2KDF_DKM2,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(ikev2kdf_expected_dkm_sa),
+        .u.kdf = {
+            ikev2kdf_dkm_params_sa,
+        },
+    },
+    {
+        ST_ID_KDF_IKEV2KDF_DKM3,
+        OSSL_KDF_NAME_IKEV2KDF,
+        OSSL_SELF_TEST_DESC_KDF_IKEV2KDF_DKM3,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(ikev2kdf_expected_dkm_dh),
+        .u.kdf = {
+            ikev2kdf_dkm_params_dh,
+        },
+    },
+    {
+        ST_ID_KDF_IKEV2KDF_REKEY,
+        OSSL_KDF_NAME_IKEV2KDF,
+        OSSL_SELF_TEST_DESC_KDF_IKEV2KDF_REKEY,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(ikev2kdf_expected_rekey),
+        .u.kdf = {
+            ikev2kdf_rekey_params,
+        },
+    },
+#endif
+#ifndef OPENSSL_NO_SNMPKDF
+    {
+        ST_ID_KDF_SNMPKDF,
+        OSSL_KDF_NAME_SNMPKDF,
+        OSSL_SELF_TEST_DESC_KDF_SNMPKDF,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(snmpkdf_expected),
+        .u.kdf = {
+            snmpkdf_params,
+        },
+    },
+#endif
+#ifndef OPENSSL_NO_SRTPKDF
+    {
+        ST_ID_KDF_SRTPKDF,
+        OSSL_KDF_NAME_SRTPKDF,
+        OSSL_SELF_TEST_DESC_KDF_SRTPKDF,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(srtpkdf_expected),
+        .u.kdf = {
+            srtpkdf_params,
+        },
+    },
+#endif
+#ifndef OPENSSL_NO_SSKDF
+    {
+        ST_ID_KDF_SSKDF,
+        OSSL_KDF_NAME_SSKDF,
+        OSSL_SELF_TEST_DESC_KDF_SSKDF,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(sskdf_expected),
+        .u.kdf = { sskdf_params },
+    },
+#endif
+#ifndef OPENSSL_NO_X963KDF
+    {
+        ST_ID_KDF_X963KDF,
+        OSSL_KDF_NAME_X963KDF,
+        OSSL_SELF_TEST_DESC_KDF_X963KDF,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(x963kdf_expected),
+        .u.kdf = { x963kdf_params },
+    },
+#endif
+#ifndef OPENSSL_NO_X942KDF
+    {
+        ST_ID_KDF_X942KDF,
+        OSSL_KDF_NAME_X942KDF_ASN1,
+        OSSL_SELF_TEST_DESC_KDF_X942KDF,
+        SELF_TEST_KAT_KDF,
+        SELF_TEST_STATE_INIT,
+        .expected = ITM_BUF(x942kdf_expected),
+        .u.kdf = {
+            x942kdf_params,
+        },
+    },
+#endif
+    {
+        ST_ID_MAC_HMAC,
+        "HMAC",
+        OSSL_SELF_TEST_DESC_INTEGRITY_HMAC,
+        SELF_TEST_KAT_MAC,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF(hmac_kat_pt),
+        ITM_BUF(hmac_kat_expected),
+        .u.mac = {
+            hmac_kat_params,
+        },
+    },
+    {
+        ST_ID_DIGEST_SHA1,
+        "SHA1",
+        OSSL_SELF_TEST_DESC_MD_SHA1,
+        SELF_TEST_KAT_DIGEST,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF_STR(sha1_pt),
+        ITM_BUF(sha1_digest),
+    },
+    {
+        ST_ID_DIGEST_SHA256,
+        "SHA256",
+        OSSL_SELF_TEST_DESC_MD_SHA2,
+        SELF_TEST_KAT_DIGEST,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF_STR(sha256_pt),
+        ITM_BUF(sha256_digest),
+    },
+    {
+        ST_ID_DIGEST_SHA512,
+        "SHA512",
+        OSSL_SELF_TEST_DESC_MD_SHA2,
+        SELF_TEST_KAT_DIGEST,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF_STR(sha512_pt),
+        ITM_BUF(sha512_digest),
+    },
+    {
+        ST_ID_DIGEST_SHA3_256,
+        "SHA3-256",
+        OSSL_SELF_TEST_DESC_MD_SHA3,
+        SELF_TEST_KAT_DIGEST,
+        SELF_TEST_STATE_INIT,
+        ITM_BUF(sha3_256_pt),
+        ITM_BUF(sha3_256_digest),
     },
 };
diff --git a/deps/openssl/openssl/providers/fips/self_test_kats.c b/deps/openssl/openssl/providers/fips/self_test_kats.c
index 0559a30cd69..f2d5c439d9e 100644
--- a/deps/openssl/openssl/providers/fips/self_test_kats.c
+++ b/deps/openssl/openssl/providers/fips/self_test_kats.c
@@ -12,14 +12,24 @@
 #include <openssl/kdf.h>
 #include <openssl/core_names.h>
 #include <openssl/param_build.h>
+#include <openssl/proverr.h>
 #include <openssl/rand.h>
 #include "crypto/ml_dsa.h"
 #include "crypto/rand.h"
 #include "internal/cryptlib.h"
-#include "internal/nelem.h"
 #include "self_test.h"
-#include "crypto/ml_kem.h"
-#include "self_test_data.inc"
+
+#if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_EC)
+#define SELF_TEST_KA_ENABLED 1
+#endif
+
+#if !defined(OPENSSL_NO_ML_DSA) || !defined(OPENSSL_NO_SLH_DSA)
+#define SELF_TEST_ASYM_KEYGEN_ENABLED 1
+#endif
+
+#if !defined(OPENSSL_NO_ML_KEM)
+#define SELF_TEST_KEM_ENABLED 1
+#endif

 static int set_kat_drbg(OSSL_LIB_CTX *ctx,
     const unsigned char *entropy, size_t entropy_len,
@@ -27,7 +37,7 @@ static int set_kat_drbg(OSSL_LIB_CTX *ctx,
     const unsigned char *persstr, size_t persstr_len);
 static int reset_main_drbg(OSSL_LIB_CTX *ctx);

-static int self_test_digest(const ST_KAT_DIGEST *t, OSSL_SELF_TEST *st,
+static int self_test_digest(const ST_DEFINITION *t, OSSL_SELF_TEST *st,
     OSSL_LIB_CTX *libctx)
 {
     int ok = 0;
@@ -41,15 +51,15 @@ static int self_test_digest(const ST_KAT_DIGEST *t, OSSL_SELF_TEST *st,
     if (ctx == NULL
         || md == NULL
         || !EVP_DigestInit_ex(ctx, md, NULL)
-        || !EVP_DigestUpdate(ctx, t->pt, t->pt_len)
+        || !EVP_DigestUpdate(ctx, t->pt.buf, t->pt.len)
         || !EVP_DigestFinal(ctx, out, &out_len))
         goto err;

     /* Optional corruption */
     OSSL_SELF_TEST_oncorrupt_byte(st, out);

-    if (out_len != t->expected_len
-        || memcmp(out, t->expected, out_len) != 0)
+    if (out_len != t->expected.len
+        || memcmp(out, t->expected.buf, out_len) != 0)
         goto err;
     ok = 1;
 err:
@@ -71,29 +81,29 @@ static int cipher_init(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,

     /* Flag required for Key wrapping */
     EVP_CIPHER_CTX_set_flags(ctx, EVP_CIPHER_CTX_FLAG_WRAP_ALLOW);
-    if (t->tag == NULL) {
+    if (t->tag.buf == NULL) {
         /* Use a normal cipher init */
-        return EVP_CipherInit_ex(ctx, cipher, NULL, t->key, t->iv, enc)
+        return EVP_CipherInit_ex(ctx, cipher, NULL, t->key.buf, t->iv.buf, enc)
             && EVP_CIPHER_CTX_set_padding(ctx, pad);
     }

     /* The authenticated cipher init */
     if (!enc)
-        in_tag = (unsigned char *)t->tag;
+        in_tag = (unsigned char *)t->tag.buf;

     return EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, enc)
-        && (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, t->iv_len, NULL) > 0)
+        && (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, (int)t->iv.len, NULL) > 0)
         && (in_tag == NULL
-            || EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, t->tag_len,
+            || EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, (int)t->tag.len,
                    in_tag)
                 > 0)
-        && EVP_CipherInit_ex(ctx, NULL, NULL, t->key, t->iv, enc)
+        && EVP_CipherInit_ex(ctx, NULL, NULL, t->key.buf, t->iv.buf, enc)
         && EVP_CIPHER_CTX_set_padding(ctx, pad)
-        && EVP_CipherUpdate(ctx, NULL, &tmp, t->aad, t->aad_len);
+        && EVP_CipherUpdate(ctx, NULL, &tmp, t->aad.buf, (int)t->aad.len);
 }

 /* Test a single KAT for encrypt/decrypt */
-static int self_test_cipher(const ST_KAT_CIPHER *t, OSSL_SELF_TEST *st,
+static int self_test_cipher(const ST_DEFINITION *t, OSSL_SELF_TEST *st,
     OSSL_LIB_CTX *libctx)
 {
     int ret = 0, encrypt = 1, len = 0, ct_len = 0, pt_len = 0;
@@ -102,51 +112,51 @@ static int self_test_cipher(const ST_KAT_CIPHER *t, OSSL_SELF_TEST *st,
     unsigned char ct_buf[256] = { 0 };
     unsigned char pt_buf[256] = { 0 };

-    OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_KAT_CIPHER, t->base.desc);
+    OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_KAT_CIPHER, t->desc);

     ctx = EVP_CIPHER_CTX_new();
     if (ctx == NULL)
         goto err;
-    cipher = EVP_CIPHER_fetch(libctx, t->base.algorithm, NULL);
+    cipher = EVP_CIPHER_fetch(libctx, t->algorithm, NULL);
     if (cipher == NULL)
         goto err;

     /* Encrypt plain text message */
-    if ((t->mode & CIPHER_MODE_ENCRYPT) != 0) {
-        if (!cipher_init(ctx, cipher, t, encrypt)
-            || !EVP_CipherUpdate(ctx, ct_buf, &len, t->base.pt,
-                t->base.pt_len)
+    if ((t->u.cipher.mode & CIPHER_MODE_ENCRYPT) != 0) {
+        if (!cipher_init(ctx, cipher, &t->u.cipher, encrypt)
+            || !EVP_CipherUpdate(ctx, ct_buf, &len, t->pt.buf,
+                (int)t->pt.len)
             || !EVP_CipherFinal_ex(ctx, ct_buf + len, &ct_len))
             goto err;

         OSSL_SELF_TEST_oncorrupt_byte(st, ct_buf);
         ct_len += len;
-        if (ct_len != (int)t->base.expected_len
-            || memcmp(t->base.expected, ct_buf, ct_len) != 0)
+        if (ct_len != (int)t->expected.len
+            || memcmp(t->expected.buf, ct_buf, ct_len) != 0)
             goto err;

-        if (t->tag != NULL) {
+        if (t->u.cipher.tag.buf != NULL) {
             unsigned char tag[16] = { 0 };

-            if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, t->tag_len,
-                    tag)
+            if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG,
+                    (int)t->u.cipher.tag.len, tag)
                     <= 0
-                || memcmp(tag, t->tag, t->tag_len) != 0)
+                || memcmp(tag, t->u.cipher.tag.buf, t->u.cipher.tag.len) != 0)
                 goto err;
         }
     }

     /* Decrypt cipher text */
-    if ((t->mode & CIPHER_MODE_DECRYPT) != 0) {
-        if (!(cipher_init(ctx, cipher, t, !encrypt)
+    if ((t->u.cipher.mode & CIPHER_MODE_DECRYPT) != 0) {
+        if (!(cipher_init(ctx, cipher, &t->u.cipher, !encrypt)
                 && EVP_CipherUpdate(ctx, pt_buf, &len,
-                    t->base.expected, t->base.expected_len)
+                    t->expected.buf, (int)t->expected.len)
                 && EVP_CipherFinal_ex(ctx, pt_buf + len, &pt_len)))
             goto err;
         OSSL_SELF_TEST_oncorrupt_byte(st, pt_buf);
         pt_len += len;
-        if (pt_len != (int)t->base.pt_len
-            || memcmp(pt_buf, t->base.pt, pt_len) != 0)
+        if (pt_len != (int)t->pt.len
+            || memcmp(pt_buf, t->pt.buf, pt_len) != 0)
             goto err;
     }

@@ -172,7 +182,7 @@ static int add_params(OSSL_PARAM_BLD *bld, const ST_KAT_PARAM *params,
             BIGNUM *bn = BN_CTX_get(ctx);

             if (bn == NULL
-                || (BN_bin2bn(p->data, p->data_len, bn) == NULL)
+                || (BN_bin2bn(p->data, (int)p->data_len, bn) == NULL)
                 || !OSSL_PARAM_BLD_push_BN(bld, p->name, bn))
                 goto err;
             break;
@@ -203,7 +213,7 @@ err:
     return ret;
 }

-#if defined(__GNUC__) && __GNUC__ >= 4
+#if defined(__GNUC__)
 #define SENTINEL __attribute__((sentinel))
 #endif

@@ -246,11 +256,11 @@ err:
     return params;
 }

-static int self_test_kdf(const ST_KAT_KDF *t, OSSL_SELF_TEST *st,
+static int self_test_kdf(const ST_DEFINITION *t, OSSL_SELF_TEST *st,
     OSSL_LIB_CTX *libctx)
 {
     int ret = 0;
-    unsigned char out[128];
+    unsigned char out[256];
     EVP_KDF *kdf = NULL;
     EVP_KDF_CTX *ctx = NULL;
     OSSL_PARAM *params = NULL;
@@ -265,18 +275,18 @@ static int self_test_kdf(const ST_KAT_KDF *t, OSSL_SELF_TEST *st,
     if (ctx == NULL)
         goto err;

-    params = kat_params_to_ossl_params(libctx, t->params, NULL);
+    params = kat_params_to_ossl_params(libctx, t->u.kdf.params, NULL);
     if (params == NULL)
         goto err;

-    if (t->expected_len > sizeof(out))
+    if (t->expected.len > sizeof(out))
         goto err;
-    if (EVP_KDF_derive(ctx, out, t->expected_len, params) <= 0)
+    if (EVP_KDF_derive(ctx, out, t->expected.len, params) <= 0)
         goto err;

     OSSL_SELF_TEST_oncorrupt_byte(st, out);

-    if (memcmp(out, t->expected, t->expected_len) != 0)
+    if (memcmp(out, t->expected.buf, t->expected.len) != 0)
         goto err;

     ret = 1;
@@ -284,11 +294,14 @@ err:
     EVP_KDF_free(kdf);
     EVP_KDF_CTX_free(ctx);
     OSSL_PARAM_free(params);
+#ifdef OPENSSL_PEDANTIC_ZEROIZATION
+    OPENSSL_cleanse(out, 256);
+#endif
     OSSL_SELF_TEST_onend(st, ret);
     return ret;
 }

-static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_SELF_TEST *st,
+static int self_test_drbg(const ST_DEFINITION *t, OSSL_SELF_TEST *st,
     OSSL_LIB_CTX *libctx)
 {
     int ret = 0;
@@ -328,38 +341,38 @@ static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_SELF_TEST *st,

     strength = EVP_RAND_get_strength(drbg);

-    drbg_params[0] = OSSL_PARAM_construct_utf8_string(t->param_name,
-        t->param_value, 0);
-    /* This is only used by HMAC-DRBG but it is ignored by the others */
-    drbg_params[1] = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_MAC, "HMAC", 0);
+    drbg_params[0] = OSSL_PARAM_construct_utf8_string(t->u.drbg.param_name,
+        (char *)t->u.drbg.param_value, 0);
     if (!EVP_RAND_CTX_set_params(drbg, drbg_params))
         goto err;

     drbg_params[0] = OSSL_PARAM_construct_octet_string(OSSL_RAND_PARAM_TEST_ENTROPY,
-        (void *)t->entropyin,
-        t->entropyinlen);
+        (void *)t->u.drbg.entropyin.buf,
+        t->u.drbg.entropyin.len);
     drbg_params[1] = OSSL_PARAM_construct_octet_string(OSSL_RAND_PARAM_TEST_NONCE,
-        (void *)t->nonce, t->noncelen);
+        (void *)t->u.drbg.nonce.buf,
+        t->u.drbg.nonce.len);
     if (!EVP_RAND_instantiate(test, strength, 0, NULL, 0, drbg_params))
         goto err;
-    if (!EVP_RAND_instantiate(drbg, strength, 0, t->persstr, t->persstrlen,
-            NULL))
+    if (!EVP_RAND_instantiate(drbg, strength, 0, t->u.drbg.persstr.buf,
+            t->u.drbg.persstr.len, NULL))
         goto err;

     drbg_params[0] = OSSL_PARAM_construct_octet_string(OSSL_RAND_PARAM_TEST_ENTROPY,
-        (void *)t->entropyinpr1,
-        t->entropyinpr1len);
+        (void *)t->u.drbg.entropyinpr1.buf,
+        t->u.drbg.entropyinpr1.len);
     if (!EVP_RAND_CTX_set_params(test, drbg_params))
         goto err;

-    if (!EVP_RAND_generate(drbg, out, t->expectedlen, strength,
+    if (!EVP_RAND_generate(drbg, out, t->expected.len, strength,
             prediction_resistance,
-            t->entropyaddin1, t->entropyaddin1len))
+            t->u.drbg.entropyaddin1.buf,
+            t->u.drbg.entropyaddin1.len))
         goto err;

     drbg_params[0] = OSSL_PARAM_construct_octet_string(OSSL_RAND_PARAM_TEST_ENTROPY,
-        (void *)t->entropyinpr2,
-        t->entropyinpr2len);
+        (void *)t->u.drbg.entropyinpr2.buf,
+        t->u.drbg.entropyinpr2.len);
     if (!EVP_RAND_CTX_set_params(test, drbg_params))
         goto err;

@@ -367,14 +380,15 @@ static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_SELF_TEST *st,
      * This calls ossl_prov_drbg_reseed() internally when
      * prediction_resistance = 1
      */
-    if (!EVP_RAND_generate(drbg, out, t->expectedlen, strength,
+    if (!EVP_RAND_generate(drbg, out, t->expected.len, strength,
             prediction_resistance,
-            t->entropyaddin2, t->entropyaddin2len))
+            t->u.drbg.entropyaddin2.buf,
+            t->u.drbg.entropyaddin2.len))
         goto err;

     OSSL_SELF_TEST_oncorrupt_byte(st, out);

-    if (memcmp(out, t->expected, t->expectedlen) != 0)
+    if (memcmp(out, t->expected.buf, t->expected.len) != 0)
         goto err;

     if (!EVP_RAND_uninstantiate(drbg))
@@ -394,8 +408,8 @@ err:
     return ret;
 }

-#if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_EC)
-static int self_test_ka(const ST_KAT_KAS *t,
+#if defined(SELF_TEST_KA_ENABLED)
+static int self_test_ka(const ST_DEFINITION *t,
     OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
 {
     int ret = 0;
@@ -404,17 +418,17 @@ static int self_test_ka(const ST_KAT_KAS *t,
     OSSL_PARAM *params = NULL;
     OSSL_PARAM *params_peer = NULL;
     unsigned char secret[256];
-    size_t secret_len = t->expected_len;
+    size_t secret_len = t->expected.len;

     OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_KAT_KA, t->desc);

     if (secret_len > sizeof(secret))
         goto err;

-    params = kat_params_to_ossl_params(libctx, t->key_group,
-        t->key_host_data, NULL);
-    params_peer = kat_params_to_ossl_params(libctx, t->key_group,
-        t->key_peer_data, NULL);
+    params = kat_params_to_ossl_params(libctx, t->u.kas.key_group,
+        t->u.kas.key_host_data, NULL);
+    params_peer = kat_params_to_ossl_params(libctx, t->u.kas.key_group,
+        t->u.kas.key_peer_data, NULL);
     if (params == NULL || params_peer == NULL)
         goto err;

@@ -441,8 +455,8 @@ static int self_test_ka(const ST_KAT_KAS *t,

     OSSL_SELF_TEST_oncorrupt_byte(st, secret);

-    if (secret_len != t->expected_len
-        || memcmp(secret, t->expected, t->expected_len) != 0)
+    if (secret_len != t->expected.len
+        || memcmp(secret, t->expected.buf, t->expected.len) != 0)
         goto err;
     ret = 1;
 err:
@@ -455,7 +469,7 @@ err:
     OSSL_SELF_TEST_onend(st, ret);
     return ret;
 }
-#endif /* !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_EC) */
+#endif /* defined(SELF_TEST_KA_ENABLED) */

 static int digest_signature(const uint8_t *sig, size_t sig_len,
     uint8_t *out, size_t *out_len,
@@ -477,7 +491,7 @@ static int digest_signature(const uint8_t *sig, size_t sig_len,
     return ret;
 }

-static int self_test_digest_sign(const ST_KAT_SIGN *t,
+static int self_test_digest_sign(const ST_DEFINITION *t,
     OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
 {
     int ret = 0;
@@ -491,25 +505,26 @@ static int self_test_digest_sign(const ST_KAT_SIGN *t,
     int digested = 0;
     const char *typ = OSSL_SELF_TEST_TYPE_KAT_SIGNATURE;

-    if (t->sig_expected_len > sizeof(sig))
+    if (t->expected.len > sizeof(sig))
         goto err;

-    if (t->sig_expected == NULL)
+    if (t->expected.buf == NULL)
         typ = OSSL_SELF_TEST_TYPE_PCT_SIGNATURE;

     OSSL_SELF_TEST_onbegin(st, typ, t->desc);

-    if (t->entropy != NULL) {
-        if (!set_kat_drbg(libctx, t->entropy, t->entropy_len,
-                t->nonce, t->nonce_len, t->persstr, t->persstr_len))
+    if (t->u.sig.entropy.buf != NULL) {
+        if (!set_kat_drbg(libctx, t->u.sig.entropy.buf, t->u.sig.entropy.len,
+                t->u.sig.nonce.buf, t->u.sig.nonce.len,
+                t->u.sig.persstr.buf, t->u.sig.persstr.len))
             goto err;
     }

-    paramskey = kat_params_to_ossl_params(libctx, t->key, NULL);
-    paramsinit = kat_params_to_ossl_params(libctx, t->init, NULL);
-    paramsverify = kat_params_to_ossl_params(libctx, t->verify, NULL);
+    paramskey = kat_params_to_ossl_params(libctx, t->u.sig.key, NULL);
+    paramsinit = kat_params_to_ossl_params(libctx, t->u.sig.init, NULL);
+    paramsverify = kat_params_to_ossl_params(libctx, t->u.sig.verify, NULL);

-    fromctx = EVP_PKEY_CTX_new_from_name(libctx, t->keytype, NULL);
+    fromctx = EVP_PKEY_CTX_new_from_name(libctx, t->u.sig.keytype, NULL);
     if (fromctx == NULL
         || paramskey == NULL
         || paramsinit == NULL
@@ -519,18 +534,18 @@ static int self_test_digest_sign(const ST_KAT_SIGN *t,
         || EVP_PKEY_fromdata(fromctx, &pkey, EVP_PKEY_KEYPAIR, paramskey) <= 0)
         goto err;

-    sigalg = EVP_SIGNATURE_fetch(libctx, t->sigalgorithm, NULL);
+    sigalg = EVP_SIGNATURE_fetch(libctx, t->algorithm, NULL);
     if (sigalg == NULL)
         goto err;
     ctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, NULL);
     if (ctx == NULL)
         goto err;

-    digested = ((t->mode & SIGNATURE_MODE_DIGESTED) != 0);
+    digested = ((t->u.sig.mode & SIGNATURE_MODE_DIGESTED) != 0);

-    if ((t->mode & SIGNATURE_MODE_VERIFY_ONLY) != 0) {
-        siglen = t->sig_expected_len;
-        memcpy(psig, t->sig_expected, siglen);
+    if ((t->u.sig.mode & SIGNATURE_MODE_VERIFY_ONLY) != 0) {
+        siglen = t->expected.len;
+        memcpy(psig, t->expected.buf, siglen);
     } else {
         if (digested) {
             if (EVP_PKEY_sign_init_ex2(ctx, sigalg, paramsinit) <= 0)
@@ -540,8 +555,8 @@ static int self_test_digest_sign(const ST_KAT_SIGN *t,
                 goto err;
         }
         siglen = sizeof(sig);
-        if ((t->mode & SIGNATURE_MODE_SIG_DIGESTED) != 0) {
-            if (EVP_PKEY_sign(ctx, NULL, &siglen, t->msg, t->msg_len) <= 0)
+        if ((t->u.sig.mode & SIGNATURE_MODE_SIG_DIGESTED) != 0) {
+            if (EVP_PKEY_sign(ctx, NULL, &siglen, t->pt.buf, t->pt.len) <= 0)
                 goto err;
             if (siglen > sizeof(sig)) {
                 psig = OPENSSL_malloc(siglen);
@@ -549,28 +564,28 @@ static int self_test_digest_sign(const ST_KAT_SIGN *t,
                     goto err;
             }
         }
-        if (EVP_PKEY_sign(ctx, psig, &siglen, t->msg, t->msg_len) <= 0)
+        if (EVP_PKEY_sign(ctx, psig, &siglen, t->pt.buf, t->pt.len) <= 0)
             goto err;

-        if (t->sig_expected != NULL) {
-            if ((t->mode & SIGNATURE_MODE_SIG_DIGESTED) != 0) {
+        if (t->expected.buf != NULL) {
+            if ((t->u.sig.mode & SIGNATURE_MODE_SIG_DIGESTED) != 0) {
                 uint8_t digested_sig[EVP_MAX_MD_SIZE];
                 size_t digested_sig_len = 0;

                 if (!digest_signature(psig, siglen, digested_sig,
                         &digested_sig_len, libctx)
-                    || digested_sig_len != t->sig_expected_len
-                    || memcmp(digested_sig, t->sig_expected, t->sig_expected_len) != 0)
+                    || digested_sig_len != t->expected.len
+                    || memcmp(digested_sig, t->expected.buf, t->expected.len) != 0)
                     goto err;
             } else {
-                if (siglen != t->sig_expected_len
-                    || memcmp(psig, t->sig_expected, t->sig_expected_len) != 0)
+                if (siglen != t->expected.len
+                    || memcmp(psig, t->expected.buf, t->expected.len) != 0)
                     goto err;
             }
         }
     }

-    if ((t->mode & SIGNATURE_MODE_SIGN_ONLY) == 0) {
+    if ((t->u.sig.mode & SIGNATURE_MODE_SIGN_ONLY) == 0) {
         if (digested) {
             if (EVP_PKEY_verify_init_ex2(ctx, sigalg, paramsverify) <= 0)
                 goto err;
@@ -579,7 +594,7 @@ static int self_test_digest_sign(const ST_KAT_SIGN *t,
                 goto err;
         }
         OSSL_SELF_TEST_oncorrupt_byte(st, psig);
-        if (EVP_PKEY_verify(ctx, psig, siglen, t->msg, t->msg_len) <= 0)
+        if (EVP_PKEY_verify(ctx, psig, siglen, t->pt.buf, t->pt.len) <= 0)
             goto err;
     }
     ret = 1;
@@ -593,7 +608,7 @@ err:
     OSSL_PARAM_free(paramskey);
     OSSL_PARAM_free(paramsinit);
     OSSL_PARAM_free(paramsverify);
-    if (t->entropy != NULL) {
+    if (t->u.sig.entropy.buf != NULL) {
         if (!reset_main_drbg(libctx))
             ret = 0;
     }
@@ -601,11 +616,11 @@ err:
     return ret;
 }

-#if !defined(OPENSSL_NO_ML_DSA) || !defined(OPENSSL_NO_SLH_DSA)
+#if defined(SELF_TEST_ASYM_KEYGEN_ENABLED)
 /*
  * Test that a deterministic key generation produces the correct key
  */
-static int self_test_asym_keygen(const ST_KAT_ASYM_KEYGEN *t, OSSL_SELF_TEST *st,
+static int self_test_asym_keygen(const ST_DEFINITION *t, OSSL_SELF_TEST *st,
     OSSL_LIB_CTX *libctx)
 {
     int ret = 0;
@@ -621,8 +636,9 @@ static int self_test_asym_keygen(const ST_KAT_ASYM_KEYGEN *t, OSSL_SELF_TEST *st
     key_ctx = EVP_PKEY_CTX_new_from_name(libctx, t->algorithm, NULL);
     if (key_ctx == NULL)
         goto err;
-    if (t->keygen_params != NULL) {
-        key_params = kat_params_to_ossl_params(libctx, t->keygen_params, NULL);
+    if (t->u.akgen.keygen_params != NULL) {
+        key_params = kat_params_to_ossl_params(libctx, t->u.akgen.keygen_params,
+            NULL);
         if (key_params == NULL)
             goto err;
     }
@@ -631,7 +647,7 @@ static int self_test_asym_keygen(const ST_KAT_ASYM_KEYGEN *t, OSSL_SELF_TEST *st
         || EVP_PKEY_generate(key_ctx, &key) != 1)
         goto err;

-    for (expected = t->expected_params; expected->data != NULL; ++expected) {
+    for (expected = t->u.akgen.expected_params; expected->data != NULL; ++expected) {
         if (expected->type != OSSL_PARAM_OCTET_STRING
             || !EVP_PKEY_get_octet_string_param(key, expected->name,
                 out, sizeof(out), &out_len))
@@ -650,9 +666,9 @@ err:
     OSSL_SELF_TEST_onend(st, ret);
     return ret;
 }
-#endif /* OPENSSL_NO_ML_DSA */
+#endif /* defined(SELF_TEST_ASYM_KEYGEN_ENABLED) */

-#ifndef OPENSSL_NO_ML_KEM
+#if defined(SELF_TEST_KEM_ENABLED)
 /*
  * FIPS 140-3 IG 10.3.A resolution 14 mandates a CAST for ML-KEM
  * encapsulation.
@@ -663,7 +679,7 @@ static int self_test_kem_encapsulate(const ST_KAT_KEM *t, OSSL_SELF_TEST *st,
     int ret = 0;
     EVP_PKEY_CTX *ctx;
     unsigned char *wrapped = NULL, *secret = NULL;
-    size_t wrappedlen = t->cipher_text_len, secretlen = t->secret_len;
+    size_t wrappedlen = t->cipher_text.len, secretlen = t->secret.len;
     OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };

     OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_KAT_KEM,
@@ -674,8 +690,8 @@ static int self_test_kem_encapsulate(const ST_KAT_KEM *t, OSSL_SELF_TEST *st,
         goto err;

     *params = OSSL_PARAM_construct_octet_string(OSSL_KEM_PARAM_IKME,
-        (unsigned char *)t->entropy,
-        t->entropy_len);
+        (unsigned char *)t->entropy.buf,
+        t->entropy.len);
     if (EVP_PKEY_encapsulate_init(ctx, params) <= 0)
         goto err;

@@ -691,13 +707,13 @@ static int self_test_kem_encapsulate(const ST_KAT_KEM *t, OSSL_SELF_TEST *st,

     /* Compare outputs */
     OSSL_SELF_TEST_oncorrupt_byte(st, wrapped);
-    if (wrappedlen != t->cipher_text_len
-        || memcmp(wrapped, t->cipher_text, t->cipher_text_len) != 0)
+    if (wrappedlen != t->cipher_text.len
+        || memcmp(wrapped, t->cipher_text.buf, t->cipher_text.len) != 0)
         goto err;

     OSSL_SELF_TEST_oncorrupt_byte(st, secret);
-    if (secretlen != t->secret_len
-        || memcmp(secret, t->secret, t->secret_len) != 0)
+    if (secretlen != t->secret.len
+        || memcmp(secret, t->secret.buf, t->secret.len) != 0)
         goto err;

     ret = 1;
@@ -720,19 +736,19 @@ static int self_test_kem_decapsulate(const ST_KAT_KEM *t, OSSL_SELF_TEST *st,
     int ret = 0;
     EVP_PKEY_CTX *ctx = NULL;
     unsigned char *secret = NULL, *alloced = NULL;
-    const unsigned char *test_secret = t->secret;
-    const unsigned char *cipher_text = t->cipher_text;
-    size_t secretlen = t->secret_len;
+    const unsigned char *test_secret = t->secret.buf;
+    const unsigned char *cipher_text = t->cipher_text.buf;
+    size_t secretlen = t->secret.len;

     OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_KAT_KEM,
         reject ? OSSL_SELF_TEST_DESC_DECAP_KEM_FAIL
                : OSSL_SELF_TEST_DESC_DECAP_KEM);

     if (reject) {
-        cipher_text = alloced = OPENSSL_zalloc(t->cipher_text_len);
+        cipher_text = alloced = OPENSSL_zalloc(t->cipher_text.len);
         if (alloced == NULL)
             goto err;
-        test_secret = t->reject_secret;
+        test_secret = t->reject_secret.buf;
     }

     ctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, "");
@@ -749,14 +765,14 @@ static int self_test_kem_decapsulate(const ST_KAT_KEM *t, OSSL_SELF_TEST *st,

     /* Decapsulate */
     if (EVP_PKEY_decapsulate(ctx, secret, &secretlen,
-            cipher_text, t->cipher_text_len)
+            cipher_text, t->cipher_text.len)
         <= 0)
         goto err;

     /* Compare output */
     OSSL_SELF_TEST_oncorrupt_byte(st, secret);
-    if (secretlen != t->secret_len
-        || memcmp(secret, test_secret, t->secret_len) != 0)
+    if (secretlen != t->secret.len
+        || memcmp(secret, test_secret, t->secret.len) != 0)
         goto err;

     ret = 1;
@@ -777,7 +793,7 @@ err:
  * 2b  ML-KEM decapsulation implicit rejection path
  * 3   ML-KEM key generation
  */
-static int self_test_kem(const ST_KAT_KEM *t, OSSL_SELF_TEST *st,
+static int self_test_kem(const ST_DEFINITION *t, OSSL_SELF_TEST *st,
     OSSL_LIB_CTX *libctx)
 {
     int ret = 0;
@@ -788,7 +804,7 @@ static int self_test_kem(const ST_KAT_KEM *t, OSSL_SELF_TEST *st,
     ctx = EVP_PKEY_CTX_new_from_name(libctx, t->algorithm, NULL);
     if (ctx == NULL)
         goto err;
-    params = kat_params_to_ossl_params(libctx, t->key, NULL);
+    params = kat_params_to_ossl_params(libctx, t->u.kem.key, NULL);
     if (params == NULL)
         goto err;

@@ -796,9 +812,9 @@ static int self_test_kem(const ST_KAT_KEM *t, OSSL_SELF_TEST *st,
         || EVP_PKEY_fromdata(ctx, &pkey, EVP_PKEY_KEYPAIR, params) <= 0)
         goto err;

-    if (!self_test_kem_encapsulate(t, st, libctx, pkey)
-        || !self_test_kem_decapsulate(t, st, libctx, pkey, 0)
-        || !self_test_kem_decapsulate(t, st, libctx, pkey, 1))
+    if (!self_test_kem_encapsulate(&t->u.kem, st, libctx, pkey)
+        || !self_test_kem_decapsulate(&t->u.kem, st, libctx, pkey, 0)
+        || !self_test_kem_decapsulate(&t->u.kem, st, libctx, pkey, 1))
         goto err;

     ret = 1;
@@ -808,7 +824,7 @@ err:
     OSSL_PARAM_free(params);
     return ret;
 }
-#endif
+#endif /* defined(SELF_TEST_KEM_ENABLED) */

 /*
  * Test an encrypt or decrypt KAT..
@@ -816,7 +832,7 @@ err:
  * FIPS 140-2 IG D.9 states that separate KAT tests are needed for encrypt
  * and decrypt..
  */
-static int self_test_asym_cipher(const ST_KAT_ASYM_CIPHER *t, OSSL_SELF_TEST *st,
+static int self_test_asym_cipher(const ST_DEFINITION *t, OSSL_SELF_TEST *st,
     OSSL_LIB_CTX *libctx)
 {
     int ret = 0;
@@ -837,7 +853,7 @@ static int self_test_asym_cipher(const ST_KAT_ASYM_CIPHER *t, OSSL_SELF_TEST *st
     /* Load a public or private key from data */
     keybld = OSSL_PARAM_BLD_new();
     if (keybld == NULL
-        || !add_params(keybld, t->key, bnctx))
+        || !add_params(keybld, t->u.ac.key, bnctx))
         goto err;
     keyparams = OSSL_PARAM_BLD_to_param(keybld);
     keyctx = EVP_PKEY_CTX_new_from_name(libctx, t->algorithm, NULL);
@@ -850,16 +866,16 @@ static int self_test_asym_cipher(const ST_KAT_ASYM_CIPHER *t, OSSL_SELF_TEST *st
     /* Create a EVP_PKEY_CTX to use for the encrypt or decrypt operation */
     encctx = EVP_PKEY_CTX_new_from_pkey(libctx, key, NULL);
     if (encctx == NULL
-        || (t->encrypt && EVP_PKEY_encrypt_init(encctx) <= 0)
-        || (!t->encrypt && EVP_PKEY_decrypt_init(encctx) <= 0))
+        || (t->u.ac.encrypt && EVP_PKEY_encrypt_init(encctx) <= 0)
+        || (!t->u.ac.encrypt && EVP_PKEY_decrypt_init(encctx) <= 0))
         goto err;

     /* Add any additional parameters such as padding */
-    if (t->postinit != NULL) {
+    if (t->u.ac.postinit != NULL) {
         initbld = OSSL_PARAM_BLD_new();
         if (initbld == NULL)
             goto err;
-        if (!add_params(initbld, t->postinit, bnctx))
+        if (!add_params(initbld, t->u.ac.postinit, bnctx))
             goto err;
         initparams = OSSL_PARAM_BLD_to_param(initbld);
         if (initparams == NULL)
@@ -868,21 +884,21 @@ static int self_test_asym_cipher(const ST_KAT_ASYM_CIPHER *t, OSSL_SELF_TEST *st
             goto err;
     }

-    if (t->encrypt) {
+    if (t->u.ac.encrypt) {
         if (EVP_PKEY_encrypt(encctx, out, &outlen,
-                t->in, t->in_len)
+                t->pt.buf, t->pt.len)
             <= 0)
             goto err;
     } else {
         if (EVP_PKEY_decrypt(encctx, out, &outlen,
-                t->in, t->in_len)
+                t->pt.buf, t->pt.len)
             <= 0)
             goto err;
     }
     /* Check the KAT */
     OSSL_SELF_TEST_oncorrupt_byte(st, out);
-    if (outlen != t->expected_len
-        || memcmp(out, t->expected, t->expected_len) != 0)
+    if (outlen != t->expected.len
+        || memcmp(out, t->expected.buf, t->expected.len) != 0)
         goto err;

     ret = 1;
@@ -899,103 +915,52 @@ err:
     return ret;
 }

-/*
- * Test a data driven list of KAT's for digest algorithms.
- * All tests are run regardless of if they fail or not.
- * Return 0 if any test fails.
- */
-static int self_test_digests(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
-{
-    int i, ret = 1;
-
-    for (i = 0; i < (int)OSSL_NELEM(st_kat_digest_tests); ++i) {
-        if (!self_test_digest(&st_kat_digest_tests[i], st, libctx))
-            ret = 0;
-    }
-    return ret;
-}
-
-static int self_test_ciphers(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
-{
-    int i, ret = 1;
-
-    for (i = 0; i < (int)OSSL_NELEM(st_kat_cipher_tests); ++i) {
-        if (!self_test_cipher(&st_kat_cipher_tests[i], st, libctx))
-            ret = 0;
-    }
-    return ret;
-}
-
-static int self_test_kems(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
-{
-    int ret = 1;
-#ifndef OPENSSL_NO_ML_KEM
-    int i;
-
-    for (i = 0; i < (int)OSSL_NELEM(st_kat_kem_tests); ++i) {
-        if (!self_test_kem(&st_kat_kem_tests[i], st, libctx))
-            ret = 0;
-    }
-#endif
-    return ret;
-}
-
-static int self_test_asym_ciphers(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
+/* Test MAC algorithms */
+static int self_test_mac(const ST_DEFINITION *t, OSSL_SELF_TEST *st,
+    OSSL_LIB_CTX *libctx)
 {
-    int i, ret = 1;
-
-    for (i = 0; i < (int)OSSL_NELEM(st_kat_asym_cipher_tests); ++i) {
-        if (!self_test_asym_cipher(&st_kat_asym_cipher_tests[i], st, libctx))
-            ret = 0;
-    }
-    return ret;
-}
+    int ret = 0;
+    unsigned char out[EVP_MAX_MD_SIZE];
+    size_t out_len = 0;
+    EVP_MAC *mac = NULL;
+    EVP_MAC_CTX *ctx = NULL;
+    OSSL_PARAM *params = NULL;

-static int self_test_kdfs(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
-{
-    int i, ret = 1;
+    /* Currently used for integrity */
+    OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_KAT_MAC, t->desc);

-    for (i = 0; i < (int)OSSL_NELEM(st_kat_kdf_tests); ++i) {
-        if (!self_test_kdf(&st_kat_kdf_tests[i], st, libctx))
-            ret = 0;
-    }
-    return ret;
-}
+    mac = EVP_MAC_fetch(libctx, t->algorithm, "");
+    if (mac == NULL)
+        goto err;

-static int self_test_drbgs(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
-{
-    int i, ret = 1;
+    ctx = EVP_MAC_CTX_new(mac);
+    if (ctx == NULL)
+        goto err;

-    for (i = 0; i < (int)OSSL_NELEM(st_kat_drbg_tests); ++i) {
-        if (!self_test_drbg(&st_kat_drbg_tests[i], st, libctx))
-            ret = 0;
-    }
-    return ret;
-}
+    params = kat_params_to_ossl_params(libctx, t->u.mac.params, NULL);
+    if (params == NULL)
+        goto err;

-static int self_test_kas(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
-{
-    int ret = 1;
-#if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_EC)
-    int i;
+    if (t->expected.len > sizeof(out))
+        goto err;

-    for (i = 0; i < (int)OSSL_NELEM(st_kat_kas_tests); ++i) {
-        if (!self_test_ka(&st_kat_kas_tests[i], st, libctx))
-            ret = 0;
-    }
-#endif
+    if (!EVP_MAC_init(ctx, NULL, 0, params)
+        || !EVP_MAC_update(ctx, t->pt.buf, t->pt.len)
+        || !EVP_MAC_final(ctx, out, &out_len, EVP_MAX_MD_SIZE))
+        goto err;

-    return ret;
-}
+    OSSL_SELF_TEST_oncorrupt_byte(st, out);

-static int self_test_signatures(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
-{
-    int i, ret = 1;
+    if ((out_len != t->expected.len)
+        || memcmp(out, t->expected.buf, t->expected.len) != 0)
+        goto err;

-    for (i = 0; i < (int)OSSL_NELEM(st_kat_sign_tests); ++i) {
-        if (!self_test_digest_sign(&st_kat_sign_tests[i], st, libctx))
-            ret = 0;
-    }
+    ret = 1;
+err:
+    EVP_MAC_free(mac);
+    EVP_MAC_CTX_free(ctx);
+    OSSL_PARAM_free(params);
+    OSSL_SELF_TEST_onend(st, ret);
     return ret;
 }

@@ -1143,33 +1108,198 @@ static int setup_main_random(OSSL_LIB_CTX *libctx)
     return 1;
 err:
     EVP_RAND_CTX_free(main_rand);
+    /* Ensure this global variable does not reference freed memory */
+    main_rand = NULL;
     return 0;
 }

-static int self_test_asym_keygens(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
+static int SELF_TEST_kats_single(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx,
+    self_test_id_t id)
 {
-#if !defined(OPENSSL_NO_ML_DSA) || !defined(OPENSSL_NO_SLH_DSA)
-    int i, ret = 1;
+    int ret;

-    for (i = 0; i < (int)OSSL_NELEM(st_kat_asym_keygen_tests); ++i) {
-        if (!self_test_asym_keygen(&st_kat_asym_keygen_tests[i], st, libctx))
-            ret = 0;
+    switch (st_all_tests[id].category) {
+    case SELF_TEST_KAT_DIGEST:
+        ret = self_test_digest(&st_all_tests[id], st, libctx);
+        break;
+    case SELF_TEST_KAT_CIPHER:
+        ret = self_test_cipher(&st_all_tests[id], st, libctx);
+        break;
+    case SELF_TEST_KAT_SIGNATURE:
+        ret = self_test_digest_sign(&st_all_tests[id], st, libctx);
+        break;
+    case SELF_TEST_KAT_KDF:
+        ret = self_test_kdf(&st_all_tests[id], st, libctx);
+        break;
+    case SELF_TEST_DRBG:
+        ret = self_test_drbg(&st_all_tests[id], st, libctx);
+        break;
+#if defined(SELF_TEST_KA_ENABLED)
+    case SELF_TEST_KAT_KAS:
+        ret = self_test_ka(&st_all_tests[id], st, libctx);
+        break;
+#endif
+#if defined(SELF_TEST_ASYM_KEYGEN_ENABLED)
+    case SELF_TEST_KAT_ASYM_KEYGEN:
+        ret = self_test_asym_keygen(&st_all_tests[id], st, libctx);
+        break;
+#endif
+#if defined(SELF_TEST_KEM_ENABLED)
+    case SELF_TEST_KAT_KEM:
+        ret = self_test_kem(&st_all_tests[id], st, libctx);
+        break;
+#endif
+    case SELF_TEST_KAT_ASYM_CIPHER:
+        ret = self_test_asym_cipher(&st_all_tests[id], st, libctx);
+        break;
+    case SELF_TEST_KAT_MAC:
+        ret = self_test_mac(&st_all_tests[id], st, libctx);
+        break;
+    default:
+        ret = 0;
+        break;
     }
+    if (ret) {
+        if (!ossl_set_self_test_state(id, SELF_TEST_STATE_PASSED))
+            return 0;
+    } else {
+        ossl_set_self_test_state(id, SELF_TEST_STATE_FAILED);
+        ERR_raise(ERR_LIB_PROV, PROV_R_SELF_TEST_KAT_FAILURE);
+    }
+
     return ret;
-#else
+}
+
+static int SELF_TEST_kat_deps(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx,
+    ST_DEFINITION *test)
+{
+    if (test->depends_on == NULL)
+        return 0;
+
+    for (int i = 0; test->depends_on[i] != ST_ID_MAX; i++)
+        if (!SELF_TEST_kats_execute(st, libctx, test->depends_on[i], 0))
+            return 0;
+
     return 1;
-#endif /* OPENSSL_NO_ML_DSA */
+}
+
+/*
+ * Run a single algorithm KAT, and its dependencies.
+ * Return 1 if successful, otherwise return 0.
+ */
+int SELF_TEST_kats_execute(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx,
+    self_test_id_t id, int switch_rand)
+{
+    EVP_RAND_CTX *saved_rand = NULL;
+    int ret;
+
+    if (id >= ST_ID_MAX || st_all_tests[id].id != id) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_CONFIG_DATA);
+        return 0;
+    }
+
+    /*
+     * Dependency chains may cause a test to be referenced multiple times,
+     * immediately return if not in initial state.
+     * NOTE: In this function state can be read w/o atomics because this
+     * function is always executed under lock. However we need to use
+     * atomics to set the state so that other threads reading state always
+     * read a correct value.
+     */
+    switch (st_all_tests[id].state) {
+    case SELF_TEST_STATE_INIT:
+    case SELF_TEST_STATE_DEFER:
+        break;
+    case SELF_TEST_STATE_FAILED:
+        return 0;
+    case SELF_TEST_STATE_IN_PROGRESS:
+    case SELF_TEST_STATE_PASSED:
+    case SELF_TEST_STATE_IMPLICIT:
+        return 1;
+    }
+
+    if (switch_rand) {
+        saved_rand = ossl_rand_get0_private_noncreating(libctx);
+        if (saved_rand != NULL && !EVP_RAND_CTX_up_ref(saved_rand))
+            return 0;
+        if (!setup_main_random(libctx)
+            || !RAND_set0_private(libctx, main_rand)) {
+            /* Decrement saved_rand reference counter */
+            EVP_RAND_CTX_free(saved_rand);
+            EVP_RAND_CTX_free(main_rand);
+            /* Ensure this global variable does not reference freed memory */
+            main_rand = NULL;
+            return 0;
+        }
+    }
+
+    /* Mark test as in progress */
+    if (!ossl_set_self_test_state(id, SELF_TEST_STATE_IN_PROGRESS))
+        return 0;
+
+    /* check if there are dependent tests to run */
+    if (st_all_tests[id].depends_on) {
+        if (!SELF_TEST_kat_deps(st, libctx, &st_all_tests[id])) {
+            ret = 0;
+            goto done;
+        }
+    }
+
+    /* may have already been run through dependency chains */
+    switch (st_all_tests[id].state) {
+    case SELF_TEST_STATE_IN_PROGRESS:
+        ret = SELF_TEST_kats_single(st, libctx, id);
+        break;
+    case SELF_TEST_STATE_PASSED:
+        ret = 1;
+        break;
+    default:
+        /* ensure all states are set to failed if we get here */
+        ossl_set_self_test_state(id, SELF_TEST_STATE_FAILED);
+        ret = 0;
+    }
+
+    /*
+     * if an implicit algorithm has explicit dependencies we want to
+     * ensure they are all executed as well otherwise we could not
+     * mark it as passed.
+     */
+    if (st_all_tests[id].state == SELF_TEST_STATE_PASSED)
+        for (int i = 0; i < ST_ID_MAX; i++) {
+            if (st_all_tests[i].state == SELF_TEST_STATE_IMPLICIT
+                && st_all_tests[i].depends_on != NULL)
+                if (!(ret = SELF_TEST_kat_deps(st, libctx, &st_all_tests[i])))
+                    break;
+        }
+
+done:
+    /*
+     * now mark (pass or fail) all the algorithm tests that have been marked
+     * by this test implicitly tested.
+     */
+    for (int i = 0; i < ST_ID_MAX; i++) {
+        if (st_all_tests[i].state == SELF_TEST_STATE_IMPLICIT)
+            ossl_set_self_test_state(i, st_all_tests[id].state);
+    }
+
+    if (switch_rand) {
+        RAND_set0_private(libctx, saved_rand);
+        /* The above call will cause main_rand to be freed */
+        main_rand = NULL;
+    }
+    return ret;
 }

 /*
  * Run the algorithm KAT's.
  * Return 1 is successful, otherwise return 0.
- * This runs all the tests regardless of if any fail.
+ * This runs all the tests regardless of if any fail, but it will not forcibly
+ * run tests that have been implicitly satisfied.
  */
 int SELF_TEST_kats(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
 {
     EVP_RAND_CTX *saved_rand = ossl_rand_get0_private_noncreating(libctx);
-    int ret = 1;
+    int i, ret = 1;

     if (saved_rand != NULL && !EVP_RAND_CTX_up_ref(saved_rand))
         return 0;
@@ -1178,28 +1308,34 @@ int SELF_TEST_kats(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
         /* Decrement saved_rand reference counter */
         EVP_RAND_CTX_free(saved_rand);
         EVP_RAND_CTX_free(main_rand);
+        /* Ensure this global variable does not reference freed memory */
+        main_rand = NULL;
         return 0;
     }

-    if (!self_test_digests(st, libctx))
-        ret = 0;
-    if (!self_test_ciphers(st, libctx))
-        ret = 0;
-    if (!self_test_signatures(st, libctx))
-        ret = 0;
-    if (!self_test_kdfs(st, libctx))
-        ret = 0;
-    if (!self_test_drbgs(st, libctx))
-        ret = 0;
-    if (!self_test_kas(st, libctx))
-        ret = 0;
-    if (!self_test_asym_keygens(st, libctx))
-        ret = 0;
-    if (!self_test_kems(st, libctx))
-        ret = 0;
-    if (!self_test_asym_ciphers(st, libctx))
-        ret = 0;
+    for (i = 0; i < ST_ID_MAX; i++) {
+        if (st_all_tests[i].state == SELF_TEST_STATE_INIT)
+            if (!SELF_TEST_kats_execute(st, libctx, i, 0))
+                ret = 0;
+    }

     RAND_set0_private(libctx, saved_rand);
+    /* The above call will cause main_rand to be freed */
+    main_rand = NULL;
     return ret;
 }
+
+int ossl_self_test_in_progress(self_test_id_t id)
+{
+    enum st_test_state state;
+
+    if (id >= ST_ID_MAX)
+        return 0;
+
+    if (!ossl_get_self_test_state(id, &state))
+        return 0;
+
+    if (state == SELF_TEST_STATE_IN_PROGRESS)
+        return 1;
+    return 0;
+}
diff --git a/deps/openssl/openssl/providers/implementations/asymciphers/rsa_enc.c b/deps/openssl/openssl/providers/implementations/asymciphers/rsa_enc.c
index 4995b00102f..6baf5534087 100644
--- a/deps/openssl/openssl/providers/implementations/asymciphers/rsa_enc.c
+++ b/deps/openssl/openssl/providers/implementations/asymciphers/rsa_enc.c
@@ -24,6 +24,8 @@
 /* Just for SSL_MAX_MASTER_KEY_LENGTH */
 #include <openssl/prov_ssl.h>
 #include "internal/constant_time.h"
+#include "internal/cryptlib.h"
+#include "internal/fips.h"
 #include "internal/sizes.h"
 #include "crypto/rsa.h"
 #include "prov/provider_ctx.h"
@@ -31,6 +33,7 @@
 #include "prov/providercommon.h"
 #include "prov/securitycheck.h"
 #include <stdlib.h>
+#include "providers/implementations/asymciphers/rsa_enc.inc"

 static OSSL_FUNC_asym_cipher_newctx_fn rsa_newctx;
 static OSSL_FUNC_asym_cipher_encrypt_init_fn rsa_encrypt_init;
@@ -84,6 +87,13 @@ static void *rsa_newctx(void *provctx)

     if (!ossl_prov_is_running())
         return NULL;
+
+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_ASYM_CIPHER_RSA_ENC))
+        return NULL;
+#endif
+
     prsactx = OPENSSL_zalloc(sizeof(PROV_RSA_CTX));
     if (prsactx == NULL)
         return NULL;
@@ -163,7 +173,7 @@ static int rsa_encrypt(void *vprsactx, unsigned char *out, size_t *outlen,
         && !OSSL_FIPS_IND_ON_UNAPPROVED(prsactx, OSSL_FIPS_IND_SETTABLE1,
             prsactx->libctx, "RSA Encrypt",
             "PKCS#1 v1.5 padding",
-            ossl_fips_config_rsa_pkcs15_padding_disabled)) {
+            FIPS_CONFIG_RSA_PKCS15_PAD_DISABLED)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_PADDING_MODE);
         return 0;
     }
@@ -199,9 +209,9 @@ static int rsa_encrypt(void *vprsactx, unsigned char *out, size_t *outlen,
             }
         }
         ret = ossl_rsa_padding_add_PKCS1_OAEP_mgf1_ex(prsactx->libctx, tbuf,
-            rsasize, in, inlen,
+            rsasize, in, (int)inlen,
             prsactx->oaep_label,
-            prsactx->oaep_labellen,
+            (int)prsactx->oaep_labellen,
             prsactx->oaep_md,
             prsactx->mgf1_md);

@@ -213,7 +223,7 @@ static int rsa_encrypt(void *vprsactx, unsigned char *out, size_t *outlen,
             RSA_NO_PADDING);
         OPENSSL_free(tbuf);
     } else {
-        ret = RSA_public_encrypt(inlen, in, out, prsactx->rsa,
+        ret = RSA_public_encrypt((int)inlen, in, out, prsactx->rsa,
             prsactx->pad_mode);
     }
     /* A ret value of 0 is not an error */
@@ -265,7 +275,7 @@ static int rsa_decrypt(void *vprsactx, unsigned char *out, size_t *outlen,

         if ((tbuf = OPENSSL_malloc(len)) == NULL)
             return 0;
-        ret = RSA_private_decrypt(inlen, in, tbuf, prsactx->rsa,
+        ret = RSA_private_decrypt((int)inlen, in, tbuf, prsactx->rsa,
             RSA_NO_PADDING);
         /*
          * With no padding then, on success ret should be len, otherwise an
@@ -285,10 +295,10 @@ static int rsa_decrypt(void *vprsactx, unsigned char *out, size_t *outlen,
                     return 0;
                 }
             }
-            ret = RSA_padding_check_PKCS1_OAEP_mgf1(out, outsize, tbuf,
-                len, len,
+            ret = RSA_padding_check_PKCS1_OAEP_mgf1(out, (int)outsize, tbuf,
+                (int)len, (int)len,
                 prsactx->oaep_label,
-                prsactx->oaep_labellen,
+                (int)prsactx->oaep_labellen,
                 prsactx->oaep_md,
                 prsactx->mgf1_md);
         } else {
@@ -308,7 +318,7 @@ static int rsa_decrypt(void *vprsactx, unsigned char *out, size_t *outlen,
             pad_mode = RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING;
         else
             pad_mode = prsactx->pad_mode;
-        ret = RSA_private_decrypt(inlen, in, out, prsactx->rsa, pad_mode);
+        ret = RSA_private_decrypt((int)inlen, in, out, prsactx->rsa, pad_mode);
     }
     *outlen = constant_time_select_s(constant_time_msb_s(ret), *outlen, ret);
     ret = constant_time_select_int(constant_time_msb(ret), 0, 1);
@@ -371,19 +381,17 @@ static void *rsa_dupctx(void *vprsactx)
 static int rsa_get_ctx_params(void *vprsactx, OSSL_PARAM *params)
 {
     PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
-    OSSL_PARAM *p;
+    struct rsa_get_ctx_params_st p;

-    if (prsactx == NULL)
+    if (prsactx == NULL || !rsa_get_ctx_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_PAD_MODE);
-    if (p != NULL)
-        switch (p->data_type) {
-        case OSSL_PARAM_INTEGER: /* Support for legacy pad mode number */
-            if (!OSSL_PARAM_set_int(p, prsactx->pad_mode))
+    if (p.pad != NULL) {
+        if (p.pad->data_type != OSSL_PARAM_UTF8_STRING) {
+            /* Support for legacy pad mode number */
+            if (!OSSL_PARAM_set_int(p.pad, prsactx->pad_mode))
                 return 0;
-            break;
-        case OSSL_PARAM_UTF8_STRING: {
+        } else {
             int i;
             const char *word = NULL;

@@ -395,99 +403,81 @@ static int rsa_get_ctx_params(void *vprsactx, OSSL_PARAM *params)
             }

             if (word != NULL) {
-                if (!OSSL_PARAM_set_utf8_string(p, word))
+                if (!OSSL_PARAM_set_utf8_string(p.pad, word))
                     return 0;
             } else {
                 ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
             }
-        } break;
-        default:
-            return 0;
         }
+    }

-    p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST);
-    if (p != NULL && !OSSL_PARAM_set_utf8_string(p, prsactx->oaep_md == NULL ? "" : EVP_MD_get0_name(prsactx->oaep_md)))
+    if (p.oaep != NULL && !OSSL_PARAM_set_utf8_string(p.oaep, prsactx->oaep_md == NULL ? "" : EVP_MD_get0_name(prsactx->oaep_md)))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST);
-    if (p != NULL) {
+    if (p.mgf1 != NULL) {
         EVP_MD *mgf1_md = prsactx->mgf1_md == NULL ? prsactx->oaep_md
                                                    : prsactx->mgf1_md;

-        if (!OSSL_PARAM_set_utf8_string(p, mgf1_md == NULL ? "" : EVP_MD_get0_name(mgf1_md)))
+        if (!OSSL_PARAM_set_utf8_string(p.mgf1, mgf1_md == NULL ? "" : EVP_MD_get0_name(mgf1_md)))
             return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL);
-    if (p != NULL && !OSSL_PARAM_set_octet_ptr(p, prsactx->oaep_label, prsactx->oaep_labellen))
+    if (p.label != NULL
+        && !OSSL_PARAM_set_octet_ptr(p.label, prsactx->oaep_label,
+            prsactx->oaep_labellen))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, prsactx->client_version))
+    if (p.tlsver != NULL
+        && !OSSL_PARAM_set_uint(p.tlsver, prsactx->client_version))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, prsactx->alt_version))
+    if (p.negver != NULL
+        && !OSSL_PARAM_set_uint(p.negver, prsactx->alt_version))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, prsactx->implicit_rejection))
+    if (p.imrej != NULL
+        && !OSSL_PARAM_set_uint(p.imrej, prsactx->implicit_rejection))
         return 0;
-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(prsactx, params))
+
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(prsactx, p.ind))
         return 0;
+
     return 1;
 }

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_PAD_MODE, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST, NULL, 0),
-    OSSL_PARAM_DEFN(OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL, OSSL_PARAM_OCTET_PTR,
-        NULL, 0),
-    OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION, NULL),
-    OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION, NULL),
-    OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION, NULL),
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *rsa_gettable_ctx_params(ossl_unused void *vprsactx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return rsa_get_ctx_params_list;
 }

 static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
 {
     PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
-    const OSSL_PARAM *p;
+    struct rsa_set_ctx_params_st p;
     char mdname[OSSL_MAX_NAME_SIZE];
     char mdprops[OSSL_MAX_PROPQUERY_SIZE] = { '\0' };
     char *str = NULL;
+    int count = 0;

-    if (prsactx == NULL)
+    if (prsactx == NULL || !rsa_set_ctx_params_decoder(params, &p, &count))
         return 0;
-    if (ossl_param_is_empty(params))
+    if (count == 0)
         return 1;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_ASYM_CIPHER_PARAM_FIPS_KEY_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE0, p.ind_k))
         return 0;
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE1, params,
-            OSSL_ASYM_CIPHER_PARAM_FIPS_RSA_PKCS15_PAD_DISABLED))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE1, p.ind_pad))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST);
-    if (p != NULL) {
+    if (p.oaep != NULL) {
         str = mdname;
-        if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(mdname)))
+        if (!OSSL_PARAM_get_utf8_string(p.oaep, &str, sizeof(mdname)))
             return 0;

-        p = OSSL_PARAM_locate_const(params,
-            OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS);
-        if (p != NULL) {
+        if (p.oaep_pq != NULL) {
             str = mdprops;
-            if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(mdprops)))
+            if (!OSSL_PARAM_get_utf8_string(p.oaep_pq, &str, sizeof(mdprops)))
                 return 0;
         }

@@ -498,30 +488,25 @@ static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
             return 0;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_PAD_MODE);
-    if (p != NULL) {
+    if (p.pad != NULL) {
         int pad_mode = 0;

-        switch (p->data_type) {
-        case OSSL_PARAM_INTEGER: /* Support for legacy pad mode number */
-            if (!OSSL_PARAM_get_int(p, &pad_mode))
+        if (p.pad->data_type != OSSL_PARAM_UTF8_STRING) {
+            /* Support for legacy pad mode as a number */
+            if (!OSSL_PARAM_get_int(p.pad, &pad_mode))
                 return 0;
-            break;
-        case OSSL_PARAM_UTF8_STRING: {
+        } else {
             int i;

-            if (p->data == NULL)
+            if (p.pad->data == NULL)
                 return 0;

             for (i = 0; padding_item[i].id != 0; i++) {
-                if (strcmp(p->data, padding_item[i].ptr) == 0) {
+                if (strcmp(p.pad->data, padding_item[i].ptr) == 0) {
                     pad_mode = padding_item[i].id;
                     break;
                 }
             }
-        } break;
-        default:
-            return 0;
         }

         /*
@@ -538,17 +523,14 @@ static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
         prsactx->pad_mode = pad_mode;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST);
-    if (p != NULL) {
+    if (p.mgf1 != NULL) {
         str = mdname;
-        if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(mdname)))
+        if (!OSSL_PARAM_get_utf8_string(p.mgf1, &str, sizeof(mdname)))
             return 0;

-        p = OSSL_PARAM_locate_const(params,
-            OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS);
-        if (p != NULL) {
+        if (p.mgf1_pq != NULL) {
             str = mdprops;
-            if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(mdprops)))
+            if (!OSSL_PARAM_get_utf8_string(p.mgf1_pq, &str, sizeof(mdprops)))
                 return 0;
         } else {
             str = NULL;
@@ -561,65 +543,47 @@ static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
             return 0;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL);
-    if (p != NULL) {
+    if (p.label != NULL) {
         void *tmp_label = NULL;
         size_t tmp_labellen;

-        if (!OSSL_PARAM_get_octet_string(p, &tmp_label, 0, &tmp_labellen))
+        if (!OSSL_PARAM_get_octet_string(p.label, &tmp_label, 0, &tmp_labellen))
             return 0;
         OPENSSL_free(prsactx->oaep_label);
         prsactx->oaep_label = (unsigned char *)tmp_label;
         prsactx->oaep_labellen = tmp_labellen;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION);
-    if (p != NULL) {
+    if (p.tlsver != NULL) {
         unsigned int client_version;

-        if (!OSSL_PARAM_get_uint(p, &client_version))
+        if (!OSSL_PARAM_get_uint(p.tlsver, &client_version))
             return 0;
         prsactx->client_version = client_version;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION);
-    if (p != NULL) {
+    if (p.negver != NULL) {
         unsigned int alt_version;

-        if (!OSSL_PARAM_get_uint(p, &alt_version))
+        if (!OSSL_PARAM_get_uint(p.negver, &alt_version))
             return 0;
         prsactx->alt_version = alt_version;
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION);
-    if (p != NULL) {
+
+    if (p.imrej != NULL) {
         unsigned int implicit_rejection;

-        if (!OSSL_PARAM_get_uint(p, &implicit_rejection))
+        if (!OSSL_PARAM_get_uint(p.imrej, &implicit_rejection))
             return 0;
         prsactx->implicit_rejection = implicit_rejection;
     }
     return 1;
 }

-static const OSSL_PARAM known_settable_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_PAD_MODE, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL, NULL, 0),
-    OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION, NULL),
-    OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION, NULL),
-    OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION, NULL),
-    OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_ASYM_CIPHER_PARAM_FIPS_KEY_CHECK)
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_ASYM_CIPHER_PARAM_FIPS_RSA_PKCS15_PAD_DISABLED)
-            OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *rsa_settable_ctx_params(ossl_unused void *vprsactx,
     ossl_unused void *provctx)
 {
-    return known_settable_ctx_params;
+    return rsa_set_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_rsa_asym_cipher_functions[] = {
diff --git a/deps/openssl/openssl/providers/implementations/asymciphers/rsa_enc.inc.in b/deps/openssl/openssl/providers/implementations/asymciphers/rsa_enc.inc.in
new file mode 100644
index 00000000000..cdf38828a0c
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/asymciphers/rsa_enc.inc.in
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder produce_param_decoder_with_count);
+-}
+
+{- produce_param_decoder('rsa_get_ctx_params',
+                         (['OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST',             'oaep',   'utf8_string'],
+                          ['OSSL_ASYM_CIPHER_PARAM_PAD_MODE',                'pad',    'utf8_string'],
+                          ['OSSL_ASYM_CIPHER_PARAM_PAD_MODE',                'pad',    'int'],
+                          ['OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST',             'mgf1',   'utf8_string'],
+                          ['OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL',              'label',  'octet_ptr'],
+                          ['OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION',      'tlsver', 'uint'],
+                          ['OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION',  'negver', 'uint'],
+                          ['OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION',      'imrej',  'uint'],
+                          ['OSSL_ASYM_CIPHER_PARAM_FIPS_APPROVED_INDICATOR', 'ind',    'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder_with_count('rsa_set_ctx_params',
+                         (['OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST',                  'oaep',    'utf8_string'],
+                          ['OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS',            'oaep_pq', 'utf8_string'],
+                          ['OSSL_ASYM_CIPHER_PARAM_PAD_MODE',                     'pad',     'utf8_string'],
+                          ['OSSL_ASYM_CIPHER_PARAM_PAD_MODE',                     'pad',     'int'],
+                          ['OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST',                  'mgf1',    'utf8_string'],
+                          ['OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS',            'mgf1_pq', 'utf8_string'],
+                          ['OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL',                   'label',   'octet_string'],
+                          ['OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION',           'tlsver',  'uint'],
+                          ['OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION',       'negver',  'uint'],
+                          ['OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION',           'imrej',   'uint'],
+                          ['OSSL_ASYM_CIPHER_PARAM_FIPS_KEY_CHECK',               'ind_k',   'int', 'fips'],
+                          ['OSSL_ASYM_CIPHER_PARAM_FIPS_RSA_PKCS15_PAD_DISABLED', 'ind_pad', 'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/asymciphers/sm2_enc.c b/deps/openssl/openssl/providers/implementations/asymciphers/sm2_enc.c
index d872132af54..8fb98fbe5d7 100644
--- a/deps/openssl/openssl/providers/implementations/asymciphers/sm2_enc.c
+++ b/deps/openssl/openssl/providers/implementations/asymciphers/sm2_enc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,10 +17,12 @@
 #include <openssl/err.h>
 #include <openssl/proverr.h>
 #include "crypto/sm2.h"
+#include "internal/cryptlib.h"
 #include "prov/provider_ctx.h"
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
 #include "prov/provider_util.h"
+#include "providers/implementations/asymciphers/sm2_enc.inc"

 static OSSL_FUNC_asym_cipher_newctx_fn sm2_newctx;
 static OSSL_FUNC_asym_cipher_encrypt_init_fn sm2_init;
@@ -157,60 +159,47 @@ static void *sm2_dupctx(void *vpsm2ctx)
 static int sm2_get_ctx_params(void *vpsm2ctx, OSSL_PARAM *params)
 {
     PROV_SM2_CTX *psm2ctx = (PROV_SM2_CTX *)vpsm2ctx;
-    OSSL_PARAM *p;
+    struct sm2_get_ctx_params_st p;

-    if (vpsm2ctx == NULL)
+    if (psm2ctx == NULL || !sm2_get_ctx_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_DIGEST);
-    if (p != NULL) {
+    if (p.digest != NULL) {
         const EVP_MD *md = ossl_prov_digest_md(&psm2ctx->md);

-        if (!OSSL_PARAM_set_utf8_string(p, md == NULL ? "" : EVP_MD_get0_name(md)))
+        if (!OSSL_PARAM_set_utf8_string(p.digest,
+                md == NULL ? "" : EVP_MD_get0_name(md)))
             return 0;
     }

     return 1;
 }

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_DIGEST, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *sm2_gettable_ctx_params(ossl_unused void *vpsm2ctx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return sm2_get_ctx_params_list;
 }

 static int sm2_set_ctx_params(void *vpsm2ctx, const OSSL_PARAM params[])
 {
     PROV_SM2_CTX *psm2ctx = (PROV_SM2_CTX *)vpsm2ctx;
+    struct sm2_set_ctx_params_st p;

-    if (psm2ctx == NULL)
+    if (psm2ctx == NULL || !sm2_set_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    if (!ossl_prov_digest_load_from_params(&psm2ctx->md, params,
+    if (!ossl_prov_digest_load(&psm2ctx->md, p.digest, p.propq,
             psm2ctx->libctx))
         return 0;

     return 1;
 }

-static const OSSL_PARAM known_settable_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_DIGEST, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_PROPERTIES, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_ENGINE, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *sm2_settable_ctx_params(ossl_unused void *vpsm2ctx,
     ossl_unused void *provctx)
 {
-    return known_settable_ctx_params;
+    return sm2_set_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_sm2_asym_cipher_functions[] = {
diff --git a/deps/openssl/openssl/providers/implementations/asymciphers/sm2_enc.inc.in b/deps/openssl/openssl/providers/implementations/asymciphers/sm2_enc.inc.in
new file mode 100644
index 00000000000..7ad4185bc56
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/asymciphers/sm2_enc.inc.in
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('sm2_get_ctx_params',
+                         (['OSSL_ASYM_CIPHER_PARAM_DIGEST',  'digest',   'utf8_string'],
+                         )); -}
+
+{- produce_param_decoder('sm2_set_ctx_params',
+                         (['OSSL_ASYM_CIPHER_PARAM_DIGEST',     'digest', 'utf8_string'],
+                          ['OSSL_ASYM_CIPHER_PARAM_PROPERTIES', 'propq',  'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/build.info b/deps/openssl/openssl/providers/implementations/ciphers/build.info
index 5dd16565c2e..d3acd423e94 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/build.info
+++ b/deps/openssl/openssl/providers/implementations/ciphers/build.info
@@ -95,10 +95,15 @@ SOURCE[$COMMON_GOAL]=\
         ciphercommon_hw.c ciphercommon_block.c \
         ciphercommon_gcm_hw.c ciphercommon_ccm_hw.c

-# These sources contain FIPS-provider-specific parameter handling.
+# These sources contain parameter decoders conditioned on FIPS_MODULE.
 SOURCE[$CIPHER_COMMON_GOAL]=ciphercommon.c
 SOURCE[$AEAD_COMMON_GOAL]=ciphercommon_gcm.c ciphercommon_ccm.c

+INCLUDE[cipher_aes_cbc_hmac_sha.o cipher_aes_cbc_hmac_sha_etm.o \
+        cipher_aes_gcm_siv.o cipher_aes_ocb.o cipher_aes_siv.o \
+        cipher_aes_wrp.o cipher_aes_xts.o ciphercommon.o cipher_chacha20.o \
+        cipher_chacha20_poly1305.o cipher_rc4_hmac_md5.o cipher_sm4_xts.o]=.
+
 IF[{- !$disabled{des} -}]
   SOURCE[$TDES_1_GOAL]=cipher_tdes.c cipher_tdes_common.c cipher_tdes_hw.c
 ENDIF
@@ -107,13 +112,20 @@ SOURCE[$NULL_GOAL]=\
         cipher_null.c

 SOURCE[$AES_GOAL]=\
-        cipher_aes.c cipher_aes_hw.c \
+        cipher_aes.c cipher_aes_hw.c cipher_aes_hw_aesni.c \
+        cipher_aes_hw_armv8.c cipher_aes_hw_rv32i.c cipher_aes_hw_rv64i.c \
+        cipher_aes_hw_s390x.c cipher_aes_hw_t4.c \
         cipher_aes_xts.c cipher_aes_xts_hw.c \
         cipher_aes_gcm.c cipher_aes_gcm_hw.c \
+        cipher_aes_gcm_hw_ppc.c \
         cipher_aes_ccm.c cipher_aes_ccm_hw.c \
         cipher_aes_wrp.c \
         cipher_aes_cbc_hmac_sha.c \
         cipher_aes_cbc_hmac_sha256_hw.c cipher_aes_cbc_hmac_sha1_hw.c \
+        cipher_aes_cbc_hmac_sha_etm.c \
+        cipher_aes_cbc_hmac_sha1_etm_hw.c \
+        cipher_aes_cbc_hmac_sha256_etm_hw.c \
+        cipher_aes_cbc_hmac_sha512_etm_hw.c \
         cipher_cts.c
 DEFINE[$AES_GOAL]=$AESXTSDEF

diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes.c
index 62fe6f8e8df..5508890f20d 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,14 +14,17 @@
  */
 #include "internal/deprecated.h"

-/* Dispatch functions for AES cipher modes ecb, cbc, ofb, cfb, ctr */
+/* Dispatch functions for AES cipher modes ecb, cbc, cts, ofb, cfb, ctr */

+#include "cipher_cts.h"
 #include "cipher_aes.h"
 #include "prov/implementations.h"
 #include "prov/providercommon.h"

 static OSSL_FUNC_cipher_freectx_fn aes_freectx;
 static OSSL_FUNC_cipher_dupctx_fn aes_dupctx;
+static OSSL_FUNC_cipher_encrypt_init_fn aes_cbc_cts_einit;
+static OSSL_FUNC_cipher_decrypt_init_fn aes_cbc_cts_dinit;

 static void aes_freectx(void *vctx)
 {
@@ -43,10 +46,31 @@ static void *aes_dupctx(void *ctx)
     if (ret == NULL)
         return NULL;
     in->base.hw->copyctx(&ret->base, &in->base);
-
+    if (!ossl_cipher_generic_dupctx_tlsmac(&ret->base, &in->base)) {
+        OPENSSL_clear_free(ret, sizeof(*ret));
+        return NULL;
+    }
     return ret;
 }

+static int aes_cbc_cts_einit(void *ctx, const unsigned char *key, size_t keylen,
+    const unsigned char *iv, size_t ivlen,
+    const OSSL_PARAM params[])
+{
+    if (!ossl_cipher_generic_einit(ctx, key, keylen, iv, ivlen, NULL))
+        return 0;
+    return ossl_cipher_cbc_cts_set_ctx_params(ctx, params);
+}
+
+static int aes_cbc_cts_dinit(void *ctx, const unsigned char *key, size_t keylen,
+    const unsigned char *iv, size_t ivlen,
+    const OSSL_PARAM params[])
+{
+    if (!ossl_cipher_generic_dinit(ctx, key, keylen, iv, ivlen, NULL))
+        return 0;
+    return ossl_cipher_cbc_cts_set_ctx_params(ctx, params);
+}
+
 /* ossl_aes256ecb_functions */
 IMPLEMENT_generic_cipher(aes, AES, ecb, ECB, 0, 256, 128, 0, block)
 /* ossl_aes192ecb_functions */
@@ -90,4 +114,9 @@ IMPLEMENT_generic_cipher(aes, AES, ctr, CTR, 0, 192, 8, 128, stream)
 /* ossl_aes128ctr_functions */
 IMPLEMENT_generic_cipher(aes, AES, ctr, CTR, 0, 128, 8, 128, stream)

-#include "cipher_aes_cts.inc"
+/* ossl_aes256cbc_cts_functions */
+IMPLEMENT_cts_cipher(aes, AES, cbc, CBC, PROV_CIPHER_FLAG_CTS, 256, 128, 128, block)
+/* ossl_aes192cbc_cts_functions */
+IMPLEMENT_cts_cipher(aes, AES, cbc, CBC, PROV_CIPHER_FLAG_CTS, 192, 128, 128, block)
+/* ossl_aes128cbc_cts_functions */
+IMPLEMENT_cts_cipher(aes, AES, cbc, CBC, PROV_CIPHER_FLAG_CTS, 128, 128, 128, block)
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes.h
index 22e09c1a96b..78bd8dcef46 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_H
+
 #include <openssl/aes.h>
 #include "prov/ciphercommon.h"
 #include "crypto/aes_platform.h"
@@ -50,12 +53,51 @@ typedef struct prov_aes_ctx_st {

 } PROV_AES_CTX;

-#define ossl_prov_cipher_hw_aes_ofb ossl_prov_cipher_hw_aes_ofb128
-#define ossl_prov_cipher_hw_aes_cfb ossl_prov_cipher_hw_aes_cfb128
+/* Note that XTS, CCM and GCM modes are handled with separate abstractions
+ * so they are not listed here */
+enum aes_modes {
+    AES_MODE_ECB = 1,
+    AES_MODE_CBC,
+    AES_MODE_CFB128,
+    AES_MODE_CFB8,
+    AES_MODE_CFB1,
+    AES_MODE_OFB128,
+    AES_MODE_CTR,
+};
+
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ecb(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cbc(size_t keybits);
-const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ofb128(size_t keybits);
+#define ossl_prov_cipher_hw_aes_cfb ossl_prov_cipher_hw_aes_cfb128
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb128(size_t keybits);
-const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb1(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb8(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb1(size_t keybits);
+#define ossl_prov_cipher_hw_aes_ofb ossl_prov_cipher_hw_aes_ofb128
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ofb128(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ctr(size_t keybits);
+
+int ossl_cipher_set_aes_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen,
+    aes_set_encrypt_key_fn fn_set_key, aes_block128_f fn_block,
+    ecb128_f fn_ecb, cbc128_f fn_cbc, ctr128_f fn_ctr);
+
+int ossl_cipher_hw_aes_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen);
+
+void ossl_cipher_aes_copyctx(PROV_CIPHER_CTX *dst, const PROV_CIPHER_CTX *src);
+
+#if defined(AESNI_CAPABLE)
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aesni(enum aes_modes mode);
+#elif defined(ARMv8_HWAES_CAPABLE)
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_arm(enum aes_modes mode);
+#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rv32i(enum aes_modes mode);
+#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rv64i(enum aes_modes mode);
+#elif defined(S390X_aes_128_CAPABLE)
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_s390x(enum aes_modes mode,
+    size_t keybits);
+#elif defined(SPARC_AES_CAPABLE)
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_t4(enum aes_modes mode);
+#endif
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
index 3bb92e7f655..b1dddce8ad7 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
@@ -19,11 +19,9 @@
 /* For SSL3_VERSION and TLS1_VERSION */
 #include <openssl/prov_ssl.h>
 #include <openssl/proverr.h>
-#include <openssl/ssl3.h>
 #include "cipher_aes_cbc_hmac_sha.h"
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
-#include "fips/fipsindicator.h"

 #ifndef AES_CBC_HMAC_SHA_CAPABLE
 #define IMPLEMENT_CIPHER(nm, sub, kbits, blkbits, ivbits, flags) \
@@ -32,6 +30,8 @@
     };
 #else

+#include "providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc"
+
 #define AES_CBC_HMAC_SHA_FLAGS (PROV_CIPHER_FLAG_AEAD \
     | PROV_CIPHER_FLAG_TLS1_MULTIBLOCK)

@@ -81,52 +81,38 @@ static int aes_dinit(void *ctx, const unsigned char *key, size_t keylen,
     return aes_set_ctx_params(ctx, params);
 }

-static const OSSL_PARAM cipher_aes_known_settable_ctx_params[] = {
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_MAC_KEY, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TLS1_AAD, NULL, 0),
-#if !defined(OPENSSL_NO_MULTIBLOCK)
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD, NULL, 0),
-    OSSL_PARAM_uint(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN, NULL, 0),
-#endif /* !defined(OPENSSL_NO_MULTIBLOCK) */
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_END
-};
 const OSSL_PARAM *aes_settable_ctx_params(ossl_unused void *cctx,
     ossl_unused void *provctx)
 {
-    return cipher_aes_known_settable_ctx_params;
+    return aes_cbc_hmac_sha_set_ctx_params_list;
 }

 static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_AES_HMAC_SHA_CTX *ctx = (PROV_AES_HMAC_SHA_CTX *)vctx;
-    PROV_CIPHER_HW_AES_HMAC_SHA *hw = (PROV_CIPHER_HW_AES_HMAC_SHA *)ctx->hw;
-    const OSSL_PARAM *p;
+    PROV_CIPHER_HW_AES_HMAC_SHA *hw;
+    struct aes_cbc_hmac_sha_set_ctx_params_st p;
     int ret = 1;
 #if !defined(OPENSSL_NO_MULTIBLOCK)
     EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM mb_param;
 #endif

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !aes_cbc_hmac_sha_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_MAC_KEY);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+    hw = (PROV_CIPHER_HW_AES_HMAC_SHA *)ctx->hw;
+
+    if (p.key != NULL) {
+        if (p.key->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        hw->init_mac_key(ctx, p->data, p->data_size);
+        hw->init_mac_key(ctx, p.key->data, p.key->data_size);
     }

 #if !defined(OPENSSL_NO_MULTIBLOCK)
-    p = OSSL_PARAM_locate_const(params,
-        OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT);
-    if (p != NULL
-        && !OSSL_PARAM_get_size_t(p, &ctx->multiblock_max_send_fragment)) {
+    if (p.maxfrag != NULL
+        && !OSSL_PARAM_get_size_t(p.maxfrag, &ctx->multiblock_max_send_fragment)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
         return 0;
     }
@@ -139,22 +125,19 @@ static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
      *   ctx->multiblock_interleave
      *   ctx->multiblock_aad_packlen
      */
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD);
-    if (p != NULL) {
-        const OSSL_PARAM *p1 = OSSL_PARAM_locate_const(params,
-            OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE);
-        if (p->data_type != OSSL_PARAM_OCTET_STRING
-            || p->data == NULL
-            || p->data_size < EVP_AEAD_TLS1_AAD_LEN
-            || !aes_get_multiblock_interleave(p1, &mb_param.interleave)
-            || tls1_aad_plaintext_len(p->data) > SSL3_RT_MAX_PLAIN_LENGTH
-            || p->data_size
+    if (p.mb_aad != NULL) {
+        if (p.mb_aad->data_type != OSSL_PARAM_OCTET_STRING
+            || p.mb_aad->data == NULL
+            || p.mb_aad->data_size < EVP_AEAD_TLS1_AAD_LEN
+            || !aes_get_multiblock_interleave(p.ileave, &mb_param.interleave)
+            || tls1_aad_plaintext_len(p.mb_aad->data) > SSL3_RT_MAX_PLAIN_LENGTH
+            || p.mb_aad->data_size
                 > (size_t)SSL3_RT_MAX_PLAIN_LENGTH * mb_param.interleave) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        mb_param.inp = p->data;
-        mb_param.len = p->data_size;
+        mb_param.inp = p.mb_aad->data;
+        mb_param.len = p.mb_aad->data_size;
         if (hw->tls1_multiblock_aad(vctx, &mb_param) <= 0)
             return 0;
     }
@@ -168,49 +151,41 @@ static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
      * The outputs of tls1_multiblock_encrypt are:
      *   ctx->multiblock_encrypt_len
      */
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC);
-    if (p != NULL) {
-        const OSSL_PARAM *p1 = OSSL_PARAM_locate_const(params,
-            OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE);
-        const OSSL_PARAM *pin = OSSL_PARAM_locate_const(params,
-            OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN);
-
-        if (p->data_type != OSSL_PARAM_OCTET_STRING
-            || p->data == NULL
-            || pin == NULL
-            || pin->data_type != OSSL_PARAM_OCTET_STRING
-            || pin->data == NULL
-            || pin->data_size == 0
-            || p->data_size != pin->data_size
-            || !aes_get_multiblock_interleave(p1, &mb_param.interleave)
-            || pin->data_size
+    if (p.enc != NULL) {
+        if (p.enc->data_type != OSSL_PARAM_OCTET_STRING
+            || p.enc->data == NULL
+            || p.enc_in == NULL
+            || p.enc_in->data_type != OSSL_PARAM_OCTET_STRING
+            || p.enc_in->data == NULL
+            || p.enc_in->data_size == 0
+            || p.enc->data_size != p.enc_in->data_size
+            || !aes_get_multiblock_interleave(p.ileave, &mb_param.interleave)
+            || p.enc_in->data_size
                 > (size_t)SSL3_RT_MAX_PLAIN_LENGTH * mb_param.interleave) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        mb_param.out = p->data;
-        mb_param.inp = pin->data;
-        mb_param.len = pin->data_size;
+        mb_param.out = p.enc->data;
+        mb_param.inp = p.enc_in->data;
+        mb_param.len = p.enc_in->data_size;
         if (hw->tls1_multiblock_encrypt(vctx, &mb_param) <= 0)
             return 0;
     }
 #endif /* !defined(OPENSSL_NO_MULTIBLOCK) */

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_TLS1_AAD);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+    if (p.tlsaad != NULL) {
+        if (p.tlsaad->data_type != OSSL_PARAM_OCTET_STRING || p.tlsaad->data_size > INT_MAX) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        if (hw->set_tls1_aad(ctx, p->data, p->data_size) <= 0)
+        if (hw->set_tls1_aad(ctx, p.tlsaad->data, (int)p.tlsaad->data_size) <= 0)
             return 0;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL) {
+    if (p.keylen != NULL) {
         size_t keylen;

-        if (!OSSL_PARAM_get_size_t(p, &keylen)) {
+        if (!OSSL_PARAM_get_size_t(p.keylen, &keylen)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -220,14 +195,12 @@ static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
         }
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_VERSION);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_uint(p, &ctx->base.tlsversion)) {
+    if (p.tlsver != NULL) {
+        if (!OSSL_PARAM_get_uint(p.tlsver, &ctx->base.tlsversion)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        if (ctx->base.tlsversion == SSL3_VERSION
-            || ctx->base.tlsversion == TLS1_VERSION) {
+        if (ctx->base.tlsversion == TLS1_VERSION) {
             if (!ossl_assert(ctx->base.removetlsfixed >= AES_BLOCK_SIZE)) {
                 ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
                 return 0;
@@ -245,90 +218,76 @@ static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static int aes_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_AES_HMAC_SHA_CTX *ctx = (PROV_AES_HMAC_SHA_CTX *)vctx;
-    OSSL_PARAM *p;
+    struct aes_cbc_hmac_sha_get_ctx_params_st p;
+
+    if (ctx == NULL || !aes_cbc_hmac_sha_get_ctx_params_decoder(params, &p))
+        return 0;

 #if !defined(OPENSSL_NO_MULTIBLOCK)
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE);
-    if (p != NULL) {
+    if (p.max != NULL) {
         PROV_CIPHER_HW_AES_HMAC_SHA *hw = (PROV_CIPHER_HW_AES_HMAC_SHA *)ctx->hw;
         size_t len = hw->tls1_multiblock_max_bufsize(ctx);

-        if (!OSSL_PARAM_set_size_t(p, len)) {
+        if (!OSSL_PARAM_set_size_t(p.max, len)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
             return 0;
         }
     }

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->multiblock_interleave)) {
+    if (p.inter != NULL
+        && !OSSL_PARAM_set_uint(p.inter, ctx->multiblock_interleave)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD_PACKLEN);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->multiblock_aad_packlen)) {
+    if (p.packlen != NULL
+        && !OSSL_PARAM_set_uint(p.packlen, ctx->multiblock_aad_packlen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->multiblock_encrypt_len)) {
+    if (p.enclen != NULL
+        && !OSSL_PARAM_set_size_t(p.enclen, ctx->multiblock_encrypt_len)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
 #endif /* !defined(OPENSSL_NO_MULTIBLOCK) */

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->tls_aad_pad)) {
+    if (p.pad != NULL && !OSSL_PARAM_set_size_t(p.pad, ctx->tls_aad_pad)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->base.keylen)) {
+
+    if (p.keylen != NULL && !OSSL_PARAM_set_size_t(p.keylen, ctx->base.keylen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->base.ivlen)) {
+
+    if (p.ivlen != NULL && !OSSL_PARAM_set_size_t(p.ivlen, ctx->base.ivlen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IV);
-    if (p != NULL
-        && !OSSL_PARAM_set_octet_string(p, ctx->base.oiv, ctx->base.ivlen)
-        && !OSSL_PARAM_set_octet_ptr(p, &ctx->base.oiv, ctx->base.ivlen)) {
+
+    if (p.iv != NULL
+        && !OSSL_PARAM_set_octet_string_or_ptr(p.iv, ctx->base.oiv,
+            ctx->base.ivlen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_UPDATED_IV);
-    if (p != NULL
-        && !OSSL_PARAM_set_octet_string(p, ctx->base.iv, ctx->base.ivlen)
-        && !OSSL_PARAM_set_octet_ptr(p, &ctx->base.iv, ctx->base.ivlen)) {
+
+    if (p.upd_iv != NULL
+        && !OSSL_PARAM_set_octet_string_or_ptr(p.upd_iv, ctx->base.iv,
+            ctx->base.ivlen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    return OSSL_FIPS_IND_GET_CTX_PARAM_APPROVED(ctx, params);
+    return 1;
 }

-static const OSSL_PARAM cipher_aes_known_gettable_ctx_params[] = {
-#if !defined(OPENSSL_NO_MULTIBLOCK)
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE, NULL),
-    OSSL_PARAM_uint(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE, NULL),
-    OSSL_PARAM_uint(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD_PACKLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN, NULL),
-#endif /* !defined(OPENSSL_NO_MULTIBLOCK) */
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_IVLEN, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_IV, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_UPDATED_IV, NULL, 0),
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
 const OSSL_PARAM *aes_gettable_ctx_params(ossl_unused void *cctx,
     ossl_unused void *provctx)
 {
-    return cipher_aes_known_gettable_ctx_params;
+    return aes_cbc_hmac_sha_get_ctx_params_list;
 }

 static void base_init(void *provctx, PROV_AES_HMAC_SHA_CTX *ctx,
@@ -351,6 +310,15 @@ static void *aes_cbc_hmac_sha1_newctx(void *provctx, size_t kbits,
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_CIPHER_AES_128_ECB))
+        return NULL;
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_DIGEST_SHA1))
+        return NULL;
+#endif
+
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx != NULL)
         base_init(provctx, &ctx->base_ctx,
@@ -362,6 +330,7 @@ static void *aes_cbc_hmac_sha1_newctx(void *provctx, size_t kbits,
 static void *aes_cbc_hmac_sha1_dupctx(void *provctx)
 {
     PROV_AES_HMAC_SHA1_CTX *ctx = provctx;
+    PROV_AES_HMAC_SHA1_CTX *dctx;

     if (!ossl_prov_is_running())
         return NULL;
@@ -369,7 +338,14 @@ static void *aes_cbc_hmac_sha1_dupctx(void *provctx)
     if (ctx == NULL)
         return NULL;

-    return OPENSSL_memdup(ctx, sizeof(*ctx));
+    dctx = OPENSSL_memdup(ctx, sizeof(*ctx));
+    if (dctx != NULL
+        && !ossl_cipher_generic_dupctx_tlsmac(&dctx->base_ctx.base,
+            &ctx->base_ctx.base)) {
+        OPENSSL_clear_free(dctx, sizeof(*dctx));
+        return NULL;
+    }
+    return dctx;
 }

 static void aes_cbc_hmac_sha1_freectx(void *vctx)
@@ -391,6 +367,15 @@ static void *aes_cbc_hmac_sha256_newctx(void *provctx, size_t kbits,
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_CIPHER_AES_128_ECB))
+        return NULL;
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_DIGEST_SHA256))
+        return NULL;
+#endif
+
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx != NULL)
         base_init(provctx, &ctx->base_ctx,
@@ -402,11 +387,22 @@ static void *aes_cbc_hmac_sha256_newctx(void *provctx, size_t kbits,
 static void *aes_cbc_hmac_sha256_dupctx(void *provctx)
 {
     PROV_AES_HMAC_SHA256_CTX *ctx = provctx;
+    PROV_AES_HMAC_SHA256_CTX *dctx;

     if (!ossl_prov_is_running())
         return NULL;

-    return OPENSSL_memdup(ctx, sizeof(*ctx));
+    if (ctx == NULL)
+        return NULL;
+
+    dctx = OPENSSL_memdup(ctx, sizeof(*ctx));
+    if (dctx != NULL
+        && !ossl_cipher_generic_dupctx_tlsmac(&dctx->base_ctx.base,
+            &ctx->base_ctx.base)) {
+        OPENSSL_clear_free(dctx, sizeof(*dctx));
+        return NULL;
+    }
+    return dctx;
 }

 static void aes_cbc_hmac_sha256_freectx(void *vctx)
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.h
index 97831da9e78..67050cdd5e7 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CBC_HMAC_SHA_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CBC_HMAC_SHA_H
+
 #include "prov/ciphercommon.h"
 #include "crypto/aes_platform.h"

@@ -63,3 +66,5 @@ typedef struct prov_aes_hmac_sha256_ctx_st {
 #define NO_PAYLOAD_LENGTH ((size_t)-1)

 #endif /* AES_CBC_HMAC_SHA_CAPABLE */
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CBC_HMAC_SHA_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc.in
new file mode 100644
index 00000000000..4a50dace772
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc.in
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('aes_cbc_hmac_sha_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT',
+                           'maxfrag',  'size_t',       "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+                          ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD',
+                           'mb_aad',   'octet_string', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+                          ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE',
+                           'ileave',   'uint',         "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+                          ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC',
+                           'enc',      'octet_string', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+                          ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN',
+                           'enc_in',   'octet_string', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+                          ['OSSL_CIPHER_PARAM_AEAD_MAC_KEY',  'key',    'octet_string'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD', 'tlsaad', 'octet_string'],
+                          ['OSSL_CIPHER_PARAM_KEYLEN',        'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_TLS_VERSION',   'tlsver', 'uint' ],
+                         )); -}
+
+{- produce_param_decoder('aes_cbc_hmac_sha_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE',
+                           'max',     'size_t', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+                          ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE',
+                           'inter',   'uint',   "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+                          ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD_PACKLEN',
+                           'packlen', 'uint',   "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+                          ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN',
+                           'enclen',  'size_t', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+                          ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD', 'pad',    'size_t'],
+                          ['OSSL_CIPHER_PARAM_KEYLEN',            'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',             'ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_IV',                'iv',     'octet_string'],
+                          ['OSSL_CIPHER_PARAM_UPDATED_IV',        'upd_iv', 'octet_string'],
+                          ['OSSL_CIPHER_PARAM_FIPS_APPROVED_INDICATOR', 'fips indicator', 'int'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_etm_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_etm_hw.c
new file mode 100644
index 00000000000..d5e85111e4a
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_etm_hw.c
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+#include "internal/deprecated.h"
+#include "cipher_aes_cbc_hmac_sha_etm.h"
+
+#if !defined(AES_CBC_HMAC_SHA_ETM_CAPABLE)
+int ossl_cipher_capable_aes_cbc_hmac_sha1_etm(void)
+{
+    return 0;
+}
+
+const PROV_CIPHER_HW_AES_HMAC_SHA_ETM *ossl_prov_cipher_hw_aes_cbc_hmac_sha1_etm(void)
+{
+    return NULL;
+}
+#else
+void sha1_block_data_order(void *c, const void *p, size_t len);
+
+#if defined(__aarch64__) || defined(_M_ARM64)
+int asm_aescbc_sha1_hmac(const uint8_t *csrc, uint8_t *cdst, uint64_t clen,
+    uint8_t *dsrc, uint8_t *ddst, uint64_t dlen,
+    CIPH_DIGEST *arg);
+void asm_sha1_hmac_aescbc_dec(const uint8_t *csrc, uint8_t *cdst, uint64_t clen,
+    const unsigned char *dsrc, uint8_t *ddst, size_t dlen,
+    CIPH_DIGEST *arg);
+#define HWAES128_ENC_CBC_SHA1_ETM asm_aescbc_sha1_hmac
+#define HWAES128_DEC_CBC_SHA1_ETM asm_sha1_hmac_aescbc_dec
+#endif
+
+int ossl_cipher_capable_aes_cbc_hmac_sha1_etm(void)
+{
+    return HWAES_CBC_HMAC_SHA1_ETM_CAPABLE;
+}
+
+static int aes_cbc_hmac_sha1_init_key(PROV_CIPHER_CTX *vctx,
+    const unsigned char *key, size_t keylen)
+{
+    int ret;
+    PROV_AES_HMAC_SHA_ETM_CTX *ctx = (PROV_AES_HMAC_SHA_ETM_CTX *)vctx;
+    PROV_AES_HMAC_SHA1_ETM_CTX *sctx = (PROV_AES_HMAC_SHA1_ETM_CTX *)vctx;
+
+    if (ctx->base.enc)
+        ret = aes_v8_set_encrypt_key(key, keylen * 8, &ctx->ks);
+    else
+        ret = aes_v8_set_decrypt_key(key, keylen * 8, &ctx->ks);
+
+    SHA1_Init(&sctx->head); /* handy when benchmarking */
+    sctx->tail = sctx->head;
+
+    return ret < 0 ? 0 : 1;
+}
+
+static void ciph_digest_arg_init(CIPH_DIGEST *arg, PROV_CIPHER_CTX *vctx)
+{
+    PROV_AES_HMAC_SHA_ETM_CTX *ctx = (PROV_AES_HMAC_SHA_ETM_CTX *)vctx;
+    PROV_AES_HMAC_SHA1_ETM_CTX *sctx = (PROV_AES_HMAC_SHA1_ETM_CTX *)vctx;
+
+    arg->cipher.key = (uint8_t *)&(ctx->ks);
+    arg->cipher.key_rounds = ctx->ks.rounds;
+    arg->cipher.iv = (uint8_t *)&(ctx->base.iv);
+    arg->digest.hmac.i_key_pad = (uint8_t *)&(sctx->head);
+    arg->digest.hmac.o_key_pad = (uint8_t *)&(sctx->tail);
+}
+
+static int hwaes_cbc_hmac_sha1_etm(PROV_CIPHER_CTX *vctx,
+    unsigned char *out,
+    const unsigned char *in, size_t len)
+{
+    PROV_AES_HMAC_SHA_ETM_CTX *ctx = (PROV_AES_HMAC_SHA_ETM_CTX *)vctx;
+    CIPH_DIGEST arg = { 0 };
+
+    ciph_digest_arg_init(&arg, vctx);
+
+    if (len % AES_BLOCK_SIZE) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_INPUT_LENGTH);
+        return 0;
+    }
+    if (ctx->base.enc) {
+        HWAES128_ENC_CBC_SHA1_ETM(in, out, len, out, ctx->tag, len, &arg);
+        return 1;
+    } else {
+        if (ctx->taglen == 0) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_SET);
+            return 0;
+        }
+        HWAES128_DEC_CBC_SHA1_ETM(in, out, len, in, ctx->tag, len, &arg);
+        if (CRYPTO_memcmp(ctx->exp_tag, ctx->tag, ctx->taglen)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG);
+            return 0;
+        }
+        return 1;
+    }
+}
+
+static void sha1_update(SHA_CTX *c, const void *data, size_t len)
+{
+    const unsigned char *ptr = data;
+    size_t res;
+
+    if ((res = c->num)) {
+        res = SHA_CBLOCK - res;
+        if (len < res)
+            res = len;
+        SHA1_Update(c, ptr, res);
+        ptr += res;
+        len -= res;
+    }
+
+    res = len % SHA_CBLOCK;
+    len -= res;
+
+    if (len) {
+        sha1_block_data_order(c, ptr, len / SHA_CBLOCK);
+
+        ptr += len;
+        c->Nh += len >> 29;
+        c->Nl += len <<= 3;
+        if (c->Nl < (unsigned int)len)
+            c->Nh++;
+    }
+
+    if (res)
+        SHA1_Update(c, ptr, res);
+}
+
+static void aes_cbc_hmac_sha1_set_mac_key(void *vctx,
+    const unsigned char *mac, size_t len)
+{
+    PROV_AES_HMAC_SHA1_ETM_CTX *ctx = (PROV_AES_HMAC_SHA1_ETM_CTX *)vctx;
+    unsigned int i;
+    unsigned char hmac_key[64];
+
+    memset(hmac_key, 0, sizeof(hmac_key));
+
+    if (len > (int)sizeof(hmac_key)) {
+        SHA1_Init(&ctx->head);
+        sha1_update(&ctx->head, mac, len);
+        SHA1_Final(hmac_key, &ctx->head);
+    } else {
+        memcpy(hmac_key, mac, len);
+    }
+
+    for (i = 0; i < sizeof(hmac_key); i++)
+        hmac_key[i] ^= 0x36; /* ipad */
+    SHA1_Init(&ctx->head);
+    sha1_update(&ctx->head, hmac_key, sizeof(hmac_key));
+
+    for (i = 0; i < sizeof(hmac_key); i++)
+        hmac_key[i] ^= 0x36 ^ 0x5c; /* opad */
+    SHA1_Init(&ctx->tail);
+    sha1_update(&ctx->tail, hmac_key, sizeof(hmac_key));
+
+    OPENSSL_cleanse(hmac_key, sizeof(hmac_key));
+}
+
+static int aes_cbc_hmac_sha1_cipher(PROV_CIPHER_CTX *vctx,
+    unsigned char *out,
+    const unsigned char *in, size_t len)
+{
+    return hwaes_cbc_hmac_sha1_etm(vctx, out, in, len);
+}
+
+static const PROV_CIPHER_HW_AES_HMAC_SHA_ETM cipher_hw_aes_hmac_sha1_etm = {
+    { aes_cbc_hmac_sha1_init_key,
+        aes_cbc_hmac_sha1_cipher },
+    aes_cbc_hmac_sha1_set_mac_key
+};
+
+const PROV_CIPHER_HW_AES_HMAC_SHA_ETM *ossl_prov_cipher_hw_aes_cbc_hmac_sha1_etm(void)
+{
+    return &cipher_hw_aes_hmac_sha1_etm;
+}
+#endif
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c
index e884c6501a7..2554dc13afd 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -50,9 +50,9 @@ static int aesni_cbc_hmac_sha1_init_key(PROV_CIPHER_CTX *vctx,
     PROV_AES_HMAC_SHA1_CTX *sctx = (PROV_AES_HMAC_SHA1_CTX *)vctx;

     if (ctx->base.enc)
-        ret = aesni_set_encrypt_key(key, keylen * 8, &ctx->ks);
+        ret = aesni_set_encrypt_key(key, (int)(keylen * 8), &ctx->ks);
     else
-        ret = aesni_set_decrypt_key(key, keylen * 8, &ctx->ks);
+        ret = aesni_set_decrypt_key(key, (int)(keylen * 8), &ctx->ks);

     SHA1_Init(&sctx->head); /* handy when benchmarking */
     sctx->tail = sctx->head;
@@ -87,8 +87,8 @@ static void sha1_update(SHA_CTX *c, const void *data, size_t len)
         sha1_block_data_order(c, ptr, len / SHA_CBLOCK);

         ptr += len;
-        c->Nh += len >> 29;
-        c->Nl += len <<= 3;
+        c->Nh += (unsigned int)(len >> 29);
+        c->Nl += (unsigned int)(len <<= 3);
         if (c->Nl < (unsigned int)len)
             c->Nh++;
     }
@@ -112,7 +112,7 @@ typedef struct {
     const unsigned char *inp;
     unsigned char *out;
     int blocks;
-    u64 iv[2];
+    uint64_t iv[2];
 } CIPH_DESC;

 void sha1_multi_block(SHA1_MB_CTX *, const HASH_DESC *, int);
@@ -129,17 +129,17 @@ static size_t tls1_multi_block_encrypt(void *vctx,
     CIPH_DESC ciph_d[8];
     unsigned char storage[sizeof(SHA1_MB_CTX) + 32];
     union {
-        u64 q[16];
-        u32 d[32];
-        u8 c[128];
+        uint64_t q[16];
+        uint32_t d[32];
+        uint8_t c[128];
     } blocks[8];
     SHA1_MB_CTX *mctx;
     unsigned int frag, last, packlen, i;
     unsigned int x4 = 4 * n4x, minblocks, processed = 0;
     size_t ret = 0;
-    u8 *IVs;
+    uint8_t *IVs;
 #if defined(BSWAP8)
-    u64 seqnum;
+    uint64_t seqnum;
 #endif

     /* ask for IVs in bulk */
@@ -195,16 +195,16 @@ static size_t tls1_multi_block_encrypt(void *vctx,
         blocks[i].q[0] = BSWAP8(seqnum + i);
 #else
         for (carry = i, j = 8; j--;) {
-            blocks[i].c[j] = ((u8 *)sctx->md.data)[j] + carry;
+            blocks[i].c[j] = ((uint8_t *)sctx->md.data)[j] + carry;
             carry = (blocks[i].c[j] - carry) >> (sizeof(carry) * 8 - 1);
         }
 #endif
-        blocks[i].c[8] = ((u8 *)sctx->md.data)[8];
-        blocks[i].c[9] = ((u8 *)sctx->md.data)[9];
-        blocks[i].c[10] = ((u8 *)sctx->md.data)[10];
+        blocks[i].c[8] = ((uint8_t *)sctx->md.data)[8];
+        blocks[i].c[9] = ((uint8_t *)sctx->md.data)[9];
+        blocks[i].c[10] = ((uint8_t *)sctx->md.data)[10];
         /* fix length */
-        blocks[i].c[11] = (u8)(len >> 8);
-        blocks[i].c[12] = (u8)(len);
+        blocks[i].c[11] = (uint8_t)(len >> 8);
+        blocks[i].c[12] = (uint8_t)(len);

         memcpy(blocks[i].c + 13, hash_d[i].ptr, 64 - 13);
         hash_d[i].ptr += 64 - 13;
@@ -349,11 +349,11 @@ static size_t tls1_multi_block_encrypt(void *vctx,
         len += 16; /* account for explicit iv */

         /* arrange header */
-        out0[0] = ((u8 *)sctx->md.data)[8];
-        out0[1] = ((u8 *)sctx->md.data)[9];
-        out0[2] = ((u8 *)sctx->md.data)[10];
-        out0[3] = (u8)(len >> 8);
-        out0[4] = (u8)(len);
+        out0[0] = ((uint8_t *)sctx->md.data)[8];
+        out0[1] = ((uint8_t *)sctx->md.data)[9];
+        out0[2] = ((uint8_t *)sctx->md.data)[10];
+        out0[3] = (uint8_t)(len >> 8);
+        out0[4] = (uint8_t)(len);

         ret += len + 5;
         inp += frag;
@@ -403,8 +403,8 @@ static int aesni_cbc_hmac_sha1_cipher(PROV_CIPHER_CTX *vctx,
             blocks *= SHA_CBLOCK;
             aes_off += blocks;
             sha_off += blocks;
-            sctx->md.Nh += blocks >> 29;
-            sctx->md.Nl += blocks <<= 3;
+            sctx->md.Nh += (unsigned int)(blocks >> 29);
+            sctx->md.Nl += (unsigned int)(blocks <<= 3);
             if (sctx->md.Nl < (unsigned int)blocks)
                 sctx->md.Nh++;
         } else {
@@ -425,7 +425,7 @@ static int aesni_cbc_hmac_sha1_cipher(PROV_CIPHER_CTX *vctx,

             /* pad the payload|hmac */
             plen += SHA_DIGEST_LENGTH;
-            for (l = len - plen - 1; plen < len; plen++)
+            for (l = (unsigned int)(len - plen - 1); plen < len; plen++)
                 out[plen] = l;
             /* encrypt HMAC|padding at once */
             aesni_cbc_encrypt(out + aes_off, out + aes_off, len - aes_off,
@@ -471,7 +471,7 @@ static int aesni_cbc_hmac_sha1_cipher(PROV_CIPHER_CTX *vctx,

             /* figure out payload length */
             pad = out[len - 1];
-            maxpad = len - (SHA_DIGEST_LENGTH + 1);
+            maxpad = (unsigned int)(len - (SHA_DIGEST_LENGTH + 1));
             maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8);
             maxpad &= 255;

@@ -483,12 +483,12 @@ static int aesni_cbc_hmac_sha1_cipher(PROV_CIPHER_CTX *vctx,
              * we'll use the maxpad value instead of the supplied pad to make
              * sure we perform well defined pointer arithmetic.
              */
-            pad = constant_time_select(mask, pad, maxpad);
+            pad = constant_time_select((unsigned int)mask, pad, maxpad);

             inp_len = len - (SHA_DIGEST_LENGTH + pad + 1);

-            ctx->aux.tls_aad[plen - 2] = inp_len >> 8;
-            ctx->aux.tls_aad[plen - 1] = inp_len;
+            ctx->aux.tls_aad[plen - 2] = (unsigned char)(inp_len >> 8);
+            ctx->aux.tls_aad[plen - 1] = (unsigned char)inp_len;

             /* calculate HMAC */
             sctx->md = sctx->head;
@@ -506,7 +506,7 @@ static int aesni_cbc_hmac_sha1_cipher(PROV_CIPHER_CTX *vctx,
             }

             /* but pretend as if we hashed padded payload */
-            bitlen = sctx->md.Nl + (inp_len << 3); /* at most 18 bits */
+            bitlen = sctx->md.Nl + (unsigned int)(inp_len << 3); /* at most 18 bits */
 #ifdef BSWAP4
             bitlen = BSWAP4(bitlen);
 #else
@@ -726,7 +726,7 @@ static int aesni_cbc_hmac_sha1_tls1_multiblock_aad(
             if (inp_len >= 8192 && OPENSSL_ia32cap_P[2] & (1 << 5))
                 n4x = 2; /* AVX2 */
         } else if ((n4x = param->interleave / 4) && n4x <= 2)
-            inp_len = param->len;
+            inp_len = (unsigned int)param->len;
         else
             return -1;

diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_etm_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_etm_hw.c
new file mode 100644
index 00000000000..3effaef6a45
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_etm_hw.c
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+#include "internal/deprecated.h"
+#include "cipher_aes_cbc_hmac_sha_etm.h"
+
+#if !defined(AES_CBC_HMAC_SHA_ETM_CAPABLE)
+int ossl_cipher_capable_aes_cbc_hmac_sha256_etm(void)
+{
+    return 0;
+}
+
+const PROV_CIPHER_HW_AES_HMAC_SHA_ETM *ossl_prov_cipher_hw_aes_cbc_hmac_sha256_etm(void)
+{
+    return NULL;
+}
+#else
+void sha256_block_data_order(void *c, const void *p, size_t len);
+
+#if defined(__aarch64__) || defined(_M_ARM64)
+int asm_aescbc_sha256_hmac(const uint8_t *csrc, uint8_t *cdst, uint64_t clen,
+    uint8_t *dsrc, uint8_t *ddst, uint64_t dlen,
+    CIPH_DIGEST *arg);
+void asm_sha256_hmac_aescbc_dec(const uint8_t *csrc, uint8_t *cdst, uint64_t clen,
+    const unsigned char *dsrc, uint8_t *ddst, size_t dlen,
+    CIPH_DIGEST *arg);
+#define HWAES128_ENC_CBC_SHA256_ETM asm_aescbc_sha256_hmac
+#define HWAES128_DEC_CBC_SHA256_ETM asm_sha256_hmac_aescbc_dec
+#endif
+
+int ossl_cipher_capable_aes_cbc_hmac_sha256_etm(void)
+{
+    return HWAES_CBC_HMAC_SHA256_ETM_CAPABLE;
+}
+
+static int aes_cbc_hmac_sha256_init_key(PROV_CIPHER_CTX *vctx,
+    const unsigned char *key, size_t keylen)
+{
+    int ret;
+    PROV_AES_HMAC_SHA_ETM_CTX *ctx = (PROV_AES_HMAC_SHA_ETM_CTX *)vctx;
+    PROV_AES_HMAC_SHA256_ETM_CTX *sctx = (PROV_AES_HMAC_SHA256_ETM_CTX *)vctx;
+
+    if (ctx->base.enc)
+        ret = aes_v8_set_encrypt_key(key, keylen * 8, &ctx->ks);
+    else
+        ret = aes_v8_set_decrypt_key(key, keylen * 8, &ctx->ks);
+
+    SHA256_Init(&sctx->head); /* handy when benchmarking */
+    sctx->tail = sctx->head;
+
+    return ret < 0 ? 0 : 1;
+}
+
+static void ciph_digest_arg_init(CIPH_DIGEST *arg, PROV_CIPHER_CTX *vctx)
+{
+    PROV_AES_HMAC_SHA_ETM_CTX *ctx = (PROV_AES_HMAC_SHA_ETM_CTX *)vctx;
+    PROV_AES_HMAC_SHA256_ETM_CTX *sctx = (PROV_AES_HMAC_SHA256_ETM_CTX *)vctx;
+
+    arg->cipher.key = (uint8_t *)&(ctx->ks);
+    arg->cipher.key_rounds = ctx->ks.rounds;
+    arg->cipher.iv = (uint8_t *)&(ctx->base.iv);
+    arg->digest.hmac.i_key_pad = (uint8_t *)&(sctx->head);
+    arg->digest.hmac.o_key_pad = (uint8_t *)&(sctx->tail);
+}
+
+static int hwaes_cbc_hmac_sha256_etm(PROV_CIPHER_CTX *vctx,
+    unsigned char *out,
+    const unsigned char *in, size_t len)
+{
+    PROV_AES_HMAC_SHA_ETM_CTX *ctx = (PROV_AES_HMAC_SHA_ETM_CTX *)vctx;
+    CIPH_DIGEST arg = { 0 };
+
+    ciph_digest_arg_init(&arg, vctx);
+
+    if (len % AES_BLOCK_SIZE) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_INPUT_LENGTH);
+        return 0;
+    }
+    if (ctx->base.enc) {
+        HWAES128_ENC_CBC_SHA256_ETM(in, out, len, out, ctx->tag, len, &arg);
+        return 1;
+    } else {
+        if (ctx->taglen == 0) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_SET);
+            return 0;
+        }
+        HWAES128_DEC_CBC_SHA256_ETM(in, out, len, in, ctx->tag, len, &arg);
+        if (CRYPTO_memcmp(ctx->exp_tag, ctx->tag, ctx->taglen)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG);
+            return 0;
+        }
+        return 1;
+    }
+}
+
+static void sha256_update(SHA256_CTX *c, const void *data, size_t len)
+{
+    const unsigned char *ptr = data;
+    size_t res;
+
+    if ((res = c->num)) {
+        res = SHA256_CBLOCK - res;
+        if (len < res)
+            res = len;
+        SHA256_Update(c, ptr, res);
+        ptr += res;
+        len -= res;
+    }
+
+    res = len % SHA256_CBLOCK;
+    len -= res;
+
+    if (len) {
+        sha256_block_data_order(c, ptr, len / SHA256_CBLOCK);
+
+        ptr += len;
+        c->Nh += len >> 29;
+        c->Nl += len <<= 3;
+        if (c->Nl < (unsigned int)len)
+            c->Nh++;
+    }
+
+    if (res)
+        SHA256_Update(c, ptr, res);
+}
+
+static void aes_cbc_hmac_sha256_set_mac_key(void *vctx,
+    const unsigned char *mac, size_t len)
+{
+    PROV_AES_HMAC_SHA256_ETM_CTX *ctx = (PROV_AES_HMAC_SHA256_ETM_CTX *)vctx;
+    unsigned int i;
+    unsigned char hmac_key[64];
+
+    memset(hmac_key, 0, sizeof(hmac_key));
+
+    if (len > (int)sizeof(hmac_key)) {
+        SHA256_Init(&ctx->head);
+        sha256_update(&ctx->head, mac, len);
+        SHA256_Final(hmac_key, &ctx->head);
+    } else {
+        memcpy(hmac_key, mac, len);
+    }
+
+    for (i = 0; i < sizeof(hmac_key); i++)
+        hmac_key[i] ^= 0x36; /* ipad */
+    SHA256_Init(&ctx->head);
+    sha256_update(&ctx->head, hmac_key, sizeof(hmac_key));
+
+    for (i = 0; i < sizeof(hmac_key); i++)
+        hmac_key[i] ^= 0x36 ^ 0x5c; /* opad */
+    SHA256_Init(&ctx->tail);
+    sha256_update(&ctx->tail, hmac_key, sizeof(hmac_key));
+
+    OPENSSL_cleanse(hmac_key, sizeof(hmac_key));
+}
+
+static int aes_cbc_hmac_sha256_cipher(PROV_CIPHER_CTX *vctx,
+    unsigned char *out,
+    const unsigned char *in, size_t len)
+{
+    return hwaes_cbc_hmac_sha256_etm(vctx, out, in, len);
+}
+
+static const PROV_CIPHER_HW_AES_HMAC_SHA_ETM cipher_hw_aes_hmac_sha256_etm = {
+    { aes_cbc_hmac_sha256_init_key,
+        aes_cbc_hmac_sha256_cipher },
+    aes_cbc_hmac_sha256_set_mac_key
+};
+
+const PROV_CIPHER_HW_AES_HMAC_SHA_ETM *ossl_prov_cipher_hw_aes_cbc_hmac_sha256_etm(void)
+{
+    return &cipher_hw_aes_hmac_sha256_etm;
+}
+#endif
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c
index b1c508d5b5f..a55f38bbb42 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -52,9 +52,9 @@ static int aesni_cbc_hmac_sha256_init_key(PROV_CIPHER_CTX *vctx,
     PROV_AES_HMAC_SHA256_CTX *sctx = (PROV_AES_HMAC_SHA256_CTX *)vctx;

     if (ctx->base.enc)
-        ret = aesni_set_encrypt_key(key, ctx->base.keylen * 8, &ctx->ks);
+        ret = aesni_set_encrypt_key(key, (int)(ctx->base.keylen * 8), &ctx->ks);
     else
-        ret = aesni_set_decrypt_key(key, ctx->base.keylen * 8, &ctx->ks);
+        ret = aesni_set_decrypt_key(key, (int)(ctx->base.keylen * 8), &ctx->ks);

     SHA256_Init(&sctx->head); /* handy when benchmarking */
     sctx->tail = sctx->head;
@@ -91,8 +91,8 @@ static void sha256_update(SHA256_CTX *c, const void *data, size_t len)
         sha256_block_data_order(c, ptr, len / SHA256_CBLOCK);

         ptr += len;
-        c->Nh += len >> 29;
-        c->Nl += len <<= 3;
+        c->Nh += (unsigned int)(len >> 29);
+        c->Nl += (unsigned int)(len <<= 3);
         if (c->Nl < (unsigned int)len)
             c->Nh++;
     }
@@ -116,7 +116,7 @@ typedef struct {
     const unsigned char *inp;
     unsigned char *out;
     int blocks;
-    u64 iv[2];
+    uint64_t iv[2];
 } CIPH_DESC;

 void sha256_multi_block(SHA256_MB_CTX *, const HASH_DESC *, int);
@@ -133,17 +133,17 @@ static size_t tls1_multi_block_encrypt(void *vctx,
     CIPH_DESC ciph_d[8];
     unsigned char storage[sizeof(SHA256_MB_CTX) + 32];
     union {
-        u64 q[16];
-        u32 d[32];
-        u8 c[128];
+        uint64_t q[16];
+        uint32_t d[32];
+        uint8_t c[128];
     } blocks[8];
     SHA256_MB_CTX *mctx;
     unsigned int frag, last, packlen, i;
     unsigned int x4 = 4 * n4x, minblocks, processed = 0;
     size_t ret = 0;
-    u8 *IVs;
+    uint8_t *IVs;
 #if defined(BSWAP8)
-    u64 seqnum;
+    uint64_t seqnum;
 #endif

     /* ask for IVs in bulk */
@@ -203,16 +203,16 @@ static size_t tls1_multi_block_encrypt(void *vctx,
         blocks[i].q[0] = BSWAP8(seqnum + i);
 #else
         for (carry = i, j = 8; j--;) {
-            blocks[i].c[j] = ((u8 *)sctx->md.data)[j] + carry;
+            blocks[i].c[j] = ((uint8_t *)sctx->md.data)[j] + carry;
             carry = (blocks[i].c[j] - carry) >> (sizeof(carry) * 8 - 1);
         }
 #endif
-        blocks[i].c[8] = ((u8 *)sctx->md.data)[8];
-        blocks[i].c[9] = ((u8 *)sctx->md.data)[9];
-        blocks[i].c[10] = ((u8 *)sctx->md.data)[10];
+        blocks[i].c[8] = ((uint8_t *)sctx->md.data)[8];
+        blocks[i].c[9] = ((uint8_t *)sctx->md.data)[9];
+        blocks[i].c[10] = ((uint8_t *)sctx->md.data)[10];
         /* fix length */
-        blocks[i].c[11] = (u8)(len >> 8);
-        blocks[i].c[12] = (u8)(len);
+        blocks[i].c[11] = (uint8_t)(len >> 8);
+        blocks[i].c[12] = (uint8_t)(len);

         memcpy(blocks[i].c + 13, hash_d[i].ptr, 64 - 13);
         hash_d[i].ptr += 64 - 13;
@@ -372,11 +372,11 @@ static size_t tls1_multi_block_encrypt(void *vctx,
         len += 16; /* account for explicit iv */

         /* arrange header */
-        out0[0] = ((u8 *)sctx->md.data)[8];
-        out0[1] = ((u8 *)sctx->md.data)[9];
-        out0[2] = ((u8 *)sctx->md.data)[10];
-        out0[3] = (u8)(len >> 8);
-        out0[4] = (u8)(len);
+        out0[0] = ((uint8_t *)sctx->md.data)[8];
+        out0[1] = ((uint8_t *)sctx->md.data)[9];
+        out0[2] = ((uint8_t *)sctx->md.data)[10];
+        out0[3] = (uint8_t)(len >> 8);
+        out0[4] = (uint8_t)(len);

         ret += len + 5;
         inp += frag;
@@ -441,8 +441,8 @@ static int aesni_cbc_hmac_sha256_cipher(PROV_CIPHER_CTX *vctx,
             blocks *= SHA256_CBLOCK;
             aes_off += blocks;
             sha_off += blocks;
-            sctx->md.Nh += blocks >> 29;
-            sctx->md.Nl += blocks <<= 3;
+            sctx->md.Nh += (unsigned int)(blocks >> 29);
+            sctx->md.Nl += (unsigned int)(blocks <<= 3);
             if (sctx->md.Nl < (unsigned int)blocks)
                 sctx->md.Nh++;
         } else {
@@ -463,7 +463,7 @@ static int aesni_cbc_hmac_sha256_cipher(PROV_CIPHER_CTX *vctx,

             /* pad the payload|hmac */
             plen += SHA256_DIGEST_LENGTH;
-            for (l = len - plen - 1; plen < len; plen++)
+            for (l = (unsigned int)(len - plen - 1); plen < len; plen++)
                 out[plen] = l;
             /* encrypt HMAC|padding at once */
             aesni_cbc_encrypt(out + aes_off, out + aes_off, len - aes_off,
@@ -507,7 +507,7 @@ static int aesni_cbc_hmac_sha256_cipher(PROV_CIPHER_CTX *vctx,

             /* figure out payload length */
             pad = out[len - 1];
-            maxpad = len - (SHA256_DIGEST_LENGTH + 1);
+            maxpad = (unsigned int)(len - (SHA256_DIGEST_LENGTH + 1));
             maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8);
             maxpad &= 255;

@@ -519,12 +519,12 @@ static int aesni_cbc_hmac_sha256_cipher(PROV_CIPHER_CTX *vctx,
              * we'll use the maxpad value instead of the supplied pad to make
              * sure we perform well defined pointer arithmetic.
              */
-            pad = constant_time_select(mask, pad, maxpad);
+            pad = constant_time_select((unsigned int)mask, pad, maxpad);

             inp_len = len - (SHA256_DIGEST_LENGTH + pad + 1);

-            ctx->aux.tls_aad[plen - 2] = inp_len >> 8;
-            ctx->aux.tls_aad[plen - 1] = inp_len;
+            ctx->aux.tls_aad[plen - 2] = (unsigned char)(inp_len >> 8);
+            ctx->aux.tls_aad[plen - 1] = (unsigned char)(inp_len);

             /* calculate HMAC */
             sctx->md = sctx->head;
@@ -542,7 +542,7 @@ static int aesni_cbc_hmac_sha256_cipher(PROV_CIPHER_CTX *vctx,
             }

             /* but pretend as if we hashed padded payload */
-            bitlen = sctx->md.Nl + (inp_len << 3); /* at most 18 bits */
+            bitlen = sctx->md.Nl + (unsigned int)(inp_len << 3); /* at most 18 bits */
 #ifdef BSWAP4
             bitlen = BSWAP4(bitlen);
 #else
@@ -777,7 +777,7 @@ static int aesni_cbc_hmac_sha256_tls1_multiblock_aad(
             if (inp_len >= 8192 && OPENSSL_ia32cap_P[2] & (1 << 5))
                 n4x = 2; /* AVX2 */
         } else if ((n4x = param->interleave / 4) && n4x <= 2)
-            inp_len = param->len;
+            inp_len = (unsigned int)param->len;
         else
             return -1;

diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha512_etm_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha512_etm_hw.c
new file mode 100644
index 00000000000..84ebfcb1b21
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha512_etm_hw.c
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * All low level APIs are deprecated for public use, but still ok for internal
+ * use where we're using them to implement the higher level EVP interface, as is
+ * the case here.
+ */
+#include "internal/deprecated.h"
+#include "cipher_aes_cbc_hmac_sha_etm.h"
+
+#if !defined(AES_CBC_HMAC_SHA_ETM_CAPABLE)
+int ossl_cipher_capable_aes_cbc_hmac_sha512_etm(void)
+{
+    return 0;
+}
+
+const PROV_CIPHER_HW_AES_HMAC_SHA_ETM *ossl_prov_cipher_hw_aes_cbc_hmac_sha512_etm(void)
+{
+    return NULL;
+}
+#else
+#if defined(__aarch64__) || defined(_M_ARM64)
+void asm_aescbc_sha512_hmac(const uint8_t *csrc, uint8_t *cdst, uint64_t clen,
+    uint8_t *dsrc, uint8_t *ddst, uint64_t dlen,
+    CIPH_DIGEST *arg);
+void asm_sha512_hmac_aescbc_dec(const uint8_t *csrc, uint8_t *cdst, uint64_t clen,
+    uint8_t *dsrc, uint8_t *ddst, uint64_t dlen,
+    CIPH_DIGEST *arg);
+#define HWAES_ENC_CBC_SHA512_ETM asm_aescbc_sha512_hmac
+#define HWAES_DEC_CBC_SHA512_ETM asm_sha512_hmac_aescbc_dec
+#endif
+
+int ossl_cipher_capable_aes_cbc_hmac_sha512_etm(void)
+{
+    return HWAES_CBC_HMAC_SHA512_ETM_CAPABLE;
+}
+
+static int hwaes_cbc_hmac_sha512_init_key(PROV_CIPHER_CTX *vctx,
+    const unsigned char *key,
+    size_t keylen)
+{
+    int ret;
+    PROV_AES_HMAC_SHA_ETM_CTX *ctx = (PROV_AES_HMAC_SHA_ETM_CTX *)vctx;
+    PROV_AES_HMAC_SHA512_ETM_CTX *sctx = (PROV_AES_HMAC_SHA512_ETM_CTX *)vctx;
+
+    if (ctx->base.enc)
+        ret = aes_v8_set_encrypt_key(key, ctx->base.keylen * 8, &ctx->ks);
+    else
+        ret = aes_v8_set_decrypt_key(key, ctx->base.keylen * 8, &ctx->ks);
+
+    SHA512_Init(&sctx->head); /* handy when benchmarking */
+    sctx->tail = sctx->head;
+
+    return ret < 0 ? 0 : 1;
+}
+
+void sha512_block_data_order(void *c, const void *p, size_t len);
+
+static void sha512_update(SHA512_CTX *c, const void *data, size_t len)
+{
+    const unsigned char *ptr = data;
+    size_t res;
+
+    if ((res = c->num)) {
+        res = SHA512_CBLOCK - res;
+        if (len < res)
+            res = len;
+        SHA512_Update(c, ptr, res);
+        ptr += res;
+        len -= res;
+    }
+
+    res = len % SHA512_CBLOCK;
+    len -= res;
+
+    if (len) {
+        sha512_block_data_order(c, ptr, len / SHA512_CBLOCK);
+
+        ptr += len;
+        c->Nh += len >> 61;
+        c->Nl += len <<= 3;
+        if (c->Nl < (unsigned int)len)
+            c->Nh++;
+    }
+
+    if (res)
+        SHA512_Update(c, ptr, res);
+}
+
+static void ciph_digest_arg_init(CIPH_DIGEST *arg, PROV_CIPHER_CTX *vctx)
+{
+    PROV_AES_HMAC_SHA_ETM_CTX *ctx = (PROV_AES_HMAC_SHA_ETM_CTX *)vctx;
+    PROV_AES_HMAC_SHA512_ETM_CTX *sctx = (PROV_AES_HMAC_SHA512_ETM_CTX *)vctx;
+
+    arg->cipher.key = (uint8_t *)&(ctx->ks);
+    arg->cipher.key_rounds = ctx->ks.rounds;
+    arg->cipher.iv = (uint8_t *)&(ctx->base.iv);
+    arg->digest.hmac.i_key_pad = (uint8_t *)&(sctx->head);
+    arg->digest.hmac.o_key_pad = (uint8_t *)&(sctx->tail);
+}
+
+static int hwaes_cbc_hmac_sha512_etm(PROV_CIPHER_CTX *vctx,
+    unsigned char *out,
+    const unsigned char *in, size_t len)
+{
+    PROV_AES_HMAC_SHA_ETM_CTX *ctx = (PROV_AES_HMAC_SHA_ETM_CTX *)vctx;
+    CIPH_DIGEST arg = { 0 };
+
+    ciph_digest_arg_init(&arg, vctx);
+
+    if (len % AES_BLOCK_SIZE) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_INPUT_LENGTH);
+        return 0;
+    }
+
+    if (ctx->base.enc) {
+        HWAES_ENC_CBC_SHA512_ETM(in, out, len, out, ctx->tag, len, &arg);
+        return 1;
+    } else {
+        if (ctx->taglen == 0) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_SET);
+            return 0;
+        }
+        HWAES_DEC_CBC_SHA512_ETM(in, out, len, out, ctx->tag, len, &arg);
+        if (CRYPTO_memcmp(ctx->exp_tag, ctx->tag, ctx->taglen)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG);
+            return 0;
+        }
+        return 1;
+    }
+}
+
+static int hwaes_cbc_hmac_sha512_cipher(PROV_CIPHER_CTX *vctx,
+    unsigned char *out,
+    const unsigned char *in, size_t len)
+{
+    return hwaes_cbc_hmac_sha512_etm(vctx, out, in, len);
+}
+
+static void hwaes_cbc_hmac_sha512_set_mac_key(void *vctx,
+    const unsigned char *mackey,
+    size_t len)
+{
+    PROV_AES_HMAC_SHA512_ETM_CTX *ctx = (PROV_AES_HMAC_SHA512_ETM_CTX *)vctx;
+    unsigned int i;
+    unsigned char hmac_key[128];
+
+    memset(hmac_key, 0, sizeof(hmac_key));
+
+    if (len > sizeof(hmac_key)) {
+        SHA512_Init(&ctx->head);
+        sha512_update(&ctx->head, mackey, len);
+        SHA512_Final(hmac_key, &ctx->head);
+    } else {
+        memcpy(hmac_key, mackey, len);
+    }
+
+    for (i = 0; i < sizeof(hmac_key); i++)
+        hmac_key[i] ^= 0x36; /* ipad */
+    SHA512_Init(&ctx->head);
+    sha512_update(&ctx->head, hmac_key, sizeof(hmac_key));
+
+    for (i = 0; i < sizeof(hmac_key); i++)
+        hmac_key[i] ^= 0x36 ^ 0x5c; /* opad */
+    SHA512_Init(&ctx->tail);
+    sha512_update(&ctx->tail, hmac_key, sizeof(hmac_key));
+
+    OPENSSL_cleanse(hmac_key, sizeof(hmac_key));
+}
+
+static const PROV_CIPHER_HW_AES_HMAC_SHA_ETM cipher_hw_aes_hmac_sha512_etm = {
+    { hwaes_cbc_hmac_sha512_init_key,
+        hwaes_cbc_hmac_sha512_cipher },
+    hwaes_cbc_hmac_sha512_set_mac_key
+};
+
+const PROV_CIPHER_HW_AES_HMAC_SHA_ETM *ossl_prov_cipher_hw_aes_cbc_hmac_sha512_etm(void)
+{
+    return &cipher_hw_aes_hmac_sha512_etm;
+}
+
+#endif /* !defined(AES_CBC_HMAC_SHA_CAPABLE) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.c
new file mode 100644
index 00000000000..f1b6cefbd2e
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.c
@@ -0,0 +1,365 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "internal/deprecated.h"
+
+#include "cipher_aes_cbc_hmac_sha_etm.h"
+#include "prov/providercommon.h"
+#include "prov/ciphercommon_aead.h"
+#include "prov/implementations.h"
+
+#ifndef AES_CBC_HMAC_SHA_ETM_CAPABLE
+#define IMPLEMENT_CIPHER(nm, sub, kbits, blkbits, ivbits, flags) \
+    const OSSL_DISPATCH ossl_##nm##kbits##sub##_functions[] = {  \
+        OSSL_DISPATCH_END                                        \
+    };
+#else
+
+#include "providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.inc"
+
+static OSSL_FUNC_cipher_encrypt_init_fn aes_einit;
+static OSSL_FUNC_cipher_decrypt_init_fn aes_dinit;
+static OSSL_FUNC_cipher_gettable_ctx_params_fn aes_gettable_ctx_params;
+static OSSL_FUNC_cipher_settable_ctx_params_fn aes_settable_ctx_params;
+#define aes_gettable_params ossl_cipher_generic_gettable_params
+#define aes_update ossl_cipher_generic_stream_update
+#define aes_final ossl_cipher_generic_stream_final
+#define aes_cipher ossl_cipher_generic_cipher
+
+static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+{
+    PROV_AES_HMAC_SHA_ETM_CTX *ctx = (PROV_AES_HMAC_SHA_ETM_CTX *)vctx;
+    PROV_CIPHER_HW_AES_HMAC_SHA_ETM *hw;
+    struct aes_cbc_hmac_sha_etm_set_ctx_params_st p;
+
+    if (ctx == NULL || !aes_cbc_hmac_sha_etm_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    hw = (PROV_CIPHER_HW_AES_HMAC_SHA_ETM *)ctx->hw;
+    if (p.key != NULL) {
+        if (p.key->data_type != OSSL_PARAM_OCTET_STRING) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
+        }
+        hw->init_mac_key(ctx, p.key->data, p.key->data_size);
+    }
+
+    if (p.keylen != NULL) {
+        size_t keylen;
+
+        if (!OSSL_PARAM_get_size_t(p.keylen, &keylen)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
+        }
+        if (ctx->base.keylen != keylen) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
+            return 0;
+        }
+    }
+
+    if (p.mac != NULL) {
+        size_t sz;
+        void *vp;
+
+        vp = &ctx->exp_tag;
+        if (!OSSL_PARAM_get_octet_string(p.mac, &vp, AES_CBC_MAX_HMAC_SIZE, &sz)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
+        }
+        if (sz == 0) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG);
+            return 0;
+        }
+        ctx->taglen = sz;
+    }
+
+    return 1;
+}
+
+static int aes_einit(void *ctx, const unsigned char *key, size_t keylen,
+    const unsigned char *iv, size_t ivlen,
+    const OSSL_PARAM params[])
+{
+    if (!ossl_cipher_generic_einit(ctx, key, keylen, iv, ivlen, NULL))
+        return 0;
+    return aes_set_ctx_params(ctx, params);
+}
+
+static int aes_dinit(void *ctx, const unsigned char *key, size_t keylen,
+    const unsigned char *iv, size_t ivlen,
+    const OSSL_PARAM params[])
+{
+    if (!ossl_cipher_generic_dinit(ctx, key, keylen, iv, ivlen, NULL))
+        return 0;
+    return aes_set_ctx_params(ctx, params);
+}
+
+static int aes_get_ctx_params(void *vctx, OSSL_PARAM params[])
+{
+    PROV_AES_HMAC_SHA_ETM_CTX *ctx = (PROV_AES_HMAC_SHA_ETM_CTX *)vctx;
+    struct aes_cbc_hmac_sha_etm_get_ctx_params_st p;
+    size_t sz;
+
+    if (ctx == NULL || !aes_cbc_hmac_sha_etm_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.keylen != NULL && !OSSL_PARAM_set_size_t(p.keylen, ctx->base.keylen)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+        return 0;
+    }
+
+    if (p.ivlen != NULL && !OSSL_PARAM_set_size_t(p.ivlen, ctx->base.ivlen)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+        return 0;
+    }
+
+    if (p.iv != NULL
+        && !OSSL_PARAM_set_octet_string(p.iv, ctx->base.oiv, ctx->base.ivlen)
+        && !OSSL_PARAM_set_octet_ptr(p.iv, &ctx->base.oiv, ctx->base.ivlen)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+        return 0;
+    }
+
+    if (p.upd_iv != NULL
+        && !OSSL_PARAM_set_octet_string(p.upd_iv, ctx->base.iv, ctx->base.ivlen)
+        && !OSSL_PARAM_set_octet_ptr(p.upd_iv, &ctx->base.iv, ctx->base.ivlen)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+        return 0;
+    }
+
+    if (p.mac != NULL) {
+        sz = p.mac->data_size;
+        if (sz == 0
+            || sz > AES_CBC_MAX_HMAC_SIZE
+            || !ctx->base.enc
+            || ctx->taglen == UNINITIALISED_SIZET) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG);
+            return 0;
+        }
+        if (!OSSL_PARAM_set_octet_string(p.mac, ctx->tag, sz)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+            return 0;
+        }
+    }
+    return 1;
+}
+
+const OSSL_PARAM *aes_gettable_ctx_params(ossl_unused void *cctx,
+    ossl_unused void *provctx)
+{
+    return aes_cbc_hmac_sha_etm_get_ctx_params_list;
+}
+
+const OSSL_PARAM *aes_settable_ctx_params(ossl_unused void *cctx,
+    ossl_unused void *provctx)
+{
+    return aes_cbc_hmac_sha_etm_set_ctx_params_list;
+}
+
+static void base_ctx_init(void *provctx, PROV_AES_HMAC_SHA_ETM_CTX *ctx,
+    const PROV_CIPHER_HW_AES_HMAC_SHA_ETM *meths,
+    size_t kbits, size_t blkbits, size_t ivbits,
+    uint64_t flags)
+{
+    ossl_cipher_generic_initkey(&ctx->base, kbits, blkbits, ivbits,
+        EVP_CIPH_CBC_MODE, flags,
+        &meths->base, provctx);
+    ctx->hw = (PROV_CIPHER_HW_AES_HMAC_SHA_ETM *)ctx->base.hw;
+}
+
+static void *aes_cbc_hmac_sha1_etm_newctx(void *provctx, size_t kbits,
+    size_t blkbits, size_t ivbits,
+    uint64_t flags)
+{
+    PROV_AES_HMAC_SHA1_ETM_CTX *ctx;
+
+    if (!ossl_prov_is_running())
+        return NULL;
+
+    ctx = OPENSSL_zalloc(sizeof(*ctx));
+    if (ctx != NULL)
+        base_ctx_init(provctx, &ctx->base_ctx,
+            ossl_prov_cipher_hw_aes_cbc_hmac_sha1_etm(), kbits, blkbits,
+            ivbits, flags);
+    return ctx;
+}
+
+static void aes_cbc_hmac_sha1_etm_freectx(void *vctx)
+{
+    PROV_AES_HMAC_SHA1_ETM_CTX *ctx = (PROV_AES_HMAC_SHA1_ETM_CTX *)vctx;
+
+    if (ctx != NULL) {
+        ossl_cipher_generic_reset_ctx((PROV_CIPHER_CTX *)vctx);
+        OPENSSL_clear_free(ctx, sizeof(*ctx));
+    }
+}
+
+static void *aes_cbc_hmac_sha1_etm_dupctx(void *provctx)
+{
+    PROV_AES_HMAC_SHA1_ETM_CTX *ctx = provctx;
+    PROV_AES_HMAC_SHA1_ETM_CTX *dctx;
+
+    if (ctx == NULL)
+        return NULL;
+
+    dctx = OPENSSL_memdup(ctx, sizeof(*ctx));
+    if (dctx != NULL
+        && !ossl_cipher_generic_dupctx_tlsmac(&dctx->base_ctx.base,
+            &ctx->base_ctx.base)) {
+        OPENSSL_clear_free(dctx, sizeof(*dctx));
+        return NULL;
+    }
+    return dctx;
+}
+
+static void *aes_cbc_hmac_sha256_etm_newctx(void *provctx, size_t kbits,
+    size_t blkbits, size_t ivbits,
+    uint64_t flags)
+{
+    PROV_AES_HMAC_SHA256_ETM_CTX *ctx;
+
+    if (!ossl_prov_is_running())
+        return NULL;
+
+    ctx = OPENSSL_zalloc(sizeof(*ctx));
+    if (ctx != NULL)
+        base_ctx_init(provctx, &ctx->base_ctx,
+            ossl_prov_cipher_hw_aes_cbc_hmac_sha256_etm(), kbits, blkbits,
+            ivbits, flags);
+    return ctx;
+}
+
+static void aes_cbc_hmac_sha256_etm_freectx(void *vctx)
+{
+    PROV_AES_HMAC_SHA256_ETM_CTX *ctx = (PROV_AES_HMAC_SHA256_ETM_CTX *)vctx;
+
+    if (ctx != NULL) {
+        ossl_cipher_generic_reset_ctx((PROV_CIPHER_CTX *)vctx);
+        OPENSSL_clear_free(ctx, sizeof(*ctx));
+    }
+}
+
+static void *aes_cbc_hmac_sha256_etm_dupctx(void *provctx)
+{
+    PROV_AES_HMAC_SHA256_ETM_CTX *ctx = provctx;
+    PROV_AES_HMAC_SHA256_ETM_CTX *dctx;
+
+    if (ctx == NULL)
+        return NULL;
+
+    dctx = OPENSSL_memdup(ctx, sizeof(*ctx));
+    if (dctx != NULL
+        && !ossl_cipher_generic_dupctx_tlsmac(&dctx->base_ctx.base,
+            &ctx->base_ctx.base)) {
+        OPENSSL_clear_free(dctx, sizeof(*dctx));
+        return NULL;
+    }
+    return dctx;
+}
+
+static void *aes_cbc_hmac_sha512_etm_newctx(void *provctx, size_t kbits,
+    size_t blkbits, size_t ivbits,
+    uint64_t flags)
+{
+    PROV_AES_HMAC_SHA512_ETM_CTX *ctx;
+
+    if (!ossl_prov_is_running())
+        return NULL;
+
+    ctx = OPENSSL_zalloc(sizeof(*ctx));
+    if (ctx != NULL)
+        base_ctx_init(provctx, &ctx->base_ctx,
+            ossl_prov_cipher_hw_aes_cbc_hmac_sha512_etm(), kbits, blkbits,
+            ivbits, flags);
+    return ctx;
+}
+
+static void aes_cbc_hmac_sha512_etm_freectx(void *vctx)
+{
+    PROV_AES_HMAC_SHA512_ETM_CTX *ctx = (PROV_AES_HMAC_SHA512_ETM_CTX *)vctx;
+
+    if (ctx != NULL) {
+        ossl_cipher_generic_reset_ctx((PROV_CIPHER_CTX *)vctx);
+        OPENSSL_clear_free(ctx, sizeof(*ctx));
+    }
+}
+
+static void *aes_cbc_hmac_sha512_etm_dupctx(void *provctx)
+{
+    PROV_AES_HMAC_SHA512_ETM_CTX *ctx = provctx;
+    PROV_AES_HMAC_SHA512_ETM_CTX *dctx;
+
+    if (ctx == NULL)
+        return NULL;
+
+    dctx = OPENSSL_memdup(ctx, sizeof(*ctx));
+    if (dctx != NULL
+        && !ossl_cipher_generic_dupctx_tlsmac(&dctx->base_ctx.base,
+            &ctx->base_ctx.base)) {
+        OPENSSL_clear_free(dctx, sizeof(*dctx));
+        return NULL;
+    }
+    return dctx;
+}
+
+#define IMPLEMENT_CIPHER(nm, sub, kbits, blkbits, ivbits, flags)                    \
+    static OSSL_FUNC_cipher_newctx_fn nm##_##kbits##_##sub##_newctx;                \
+    static void *nm##_##kbits##_##sub##_newctx(void *provctx)                       \
+    {                                                                               \
+        return nm##_##sub##_newctx(provctx, kbits, blkbits, ivbits, flags);         \
+    }                                                                               \
+    static OSSL_FUNC_cipher_get_params_fn nm##_##kbits##_##sub##_get_params;        \
+    static int nm##_##kbits##_##sub##_get_params(OSSL_PARAM params[])               \
+    {                                                                               \
+        return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,            \
+            flags, kbits, blkbits, ivbits);                                         \
+    }                                                                               \
+    const OSSL_DISPATCH ossl_##nm##kbits##sub##_functions[] = {                     \
+        { OSSL_FUNC_CIPHER_NEWCTX, (void (*)(void))nm##_##kbits##_##sub##_newctx }, \
+        { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void))nm##_##sub##_freectx },         \
+        { OSSL_FUNC_CIPHER_DUPCTX, (void (*)(void))nm##_##sub##_dupctx },           \
+        { OSSL_FUNC_CIPHER_ENCRYPT_INIT, (void (*)(void))nm##_einit },              \
+        { OSSL_FUNC_CIPHER_DECRYPT_INIT, (void (*)(void))nm##_dinit },              \
+        { OSSL_FUNC_CIPHER_UPDATE, (void (*)(void))nm##_update },                   \
+        { OSSL_FUNC_CIPHER_FINAL, (void (*)(void))nm##_final },                     \
+        { OSSL_FUNC_CIPHER_CIPHER, (void (*)(void))nm##_cipher },                   \
+        { OSSL_FUNC_CIPHER_GET_PARAMS,                                              \
+            (void (*)(void))nm##_##kbits##_##sub##_get_params },                    \
+        { OSSL_FUNC_CIPHER_GETTABLE_PARAMS,                                         \
+            (void (*)(void))nm##_gettable_params },                                 \
+        { OSSL_FUNC_CIPHER_GET_CTX_PARAMS,                                          \
+            (void (*)(void))nm##_get_ctx_params },                                  \
+        { OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS,                                     \
+            (void (*)(void))nm##_gettable_ctx_params },                             \
+        { OSSL_FUNC_CIPHER_SET_CTX_PARAMS,                                          \
+            (void (*)(void))nm##_set_ctx_params },                                  \
+        { OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS,                                     \
+            (void (*)(void))nm##_settable_ctx_params },                             \
+        OSSL_DISPATCH_END                                                           \
+    };
+#endif /* AES_CBC_HMAC_SHA_ETM_CAPABLE */
+
+/* ossl_aes128cbc_hmac_sha1_etm_functions */
+IMPLEMENT_CIPHER(aes, cbc_hmac_sha1_etm, 128, 128, 128, EVP_CIPH_FLAG_ENC_THEN_MAC)
+/* ossl_aes192cbc_hmac_sha1_etm_functions */
+IMPLEMENT_CIPHER(aes, cbc_hmac_sha1_etm, 192, 128, 128, EVP_CIPH_FLAG_ENC_THEN_MAC)
+/* ossl_aes256cbc_hmac_sha1_etm_functions */
+IMPLEMENT_CIPHER(aes, cbc_hmac_sha1_etm, 256, 128, 128, EVP_CIPH_FLAG_ENC_THEN_MAC)
+/* ossl_aes128cbc_hmac_sha256_etm_functions */
+IMPLEMENT_CIPHER(aes, cbc_hmac_sha256_etm, 128, 128, 128, EVP_CIPH_FLAG_ENC_THEN_MAC)
+/* ossl_aes192cbc_hmac_sha256_etm_functions */
+IMPLEMENT_CIPHER(aes, cbc_hmac_sha256_etm, 192, 128, 128, EVP_CIPH_FLAG_ENC_THEN_MAC)
+/* ossl_aes256cbc_hmac_sha256_etm_functions */
+IMPLEMENT_CIPHER(aes, cbc_hmac_sha256_etm, 256, 128, 128, EVP_CIPH_FLAG_ENC_THEN_MAC)
+/* ossl_aes128cbc_hmac_sha512_etm_functions */
+IMPLEMENT_CIPHER(aes, cbc_hmac_sha512_etm, 128, 128, 128, EVP_CIPH_FLAG_ENC_THEN_MAC)
+/* ossl_aes192cbc_hmac_sha512_etm_functions */
+IMPLEMENT_CIPHER(aes, cbc_hmac_sha512_etm, 192, 128, 128, EVP_CIPH_FLAG_ENC_THEN_MAC)
+/* ossl_aes256cbc_hmac_sha512_etm_functions */
+IMPLEMENT_CIPHER(aes, cbc_hmac_sha512_etm, 256, 128, 128, EVP_CIPH_FLAG_ENC_THEN_MAC)
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.h
new file mode 100644
index 00000000000..179891b38f8
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CBC_HMAC_SHA_ETM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CBC_HMAC_SHA_ETM_H
+
+#include <openssl/proverr.h>
+#include "prov/ciphercommon.h"
+#include "crypto/aes_platform.h"
+
+int ossl_cipher_capable_aes_cbc_hmac_sha1_etm(void);
+int ossl_cipher_capable_aes_cbc_hmac_sha256_etm(void);
+int ossl_cipher_capable_aes_cbc_hmac_sha512_etm(void);
+
+typedef struct prov_cipher_hw_aes_hmac_sha_ctx_etm_st {
+    PROV_CIPHER_HW base; /* must be first */
+    void (*init_mac_key)(void *ctx, const unsigned char *inkey, size_t inlen);
+} PROV_CIPHER_HW_AES_HMAC_SHA_ETM;
+
+const PROV_CIPHER_HW_AES_HMAC_SHA_ETM *ossl_prov_cipher_hw_aes_cbc_hmac_sha1_etm(void);
+const PROV_CIPHER_HW_AES_HMAC_SHA_ETM *ossl_prov_cipher_hw_aes_cbc_hmac_sha256_etm(void);
+const PROV_CIPHER_HW_AES_HMAC_SHA_ETM *ossl_prov_cipher_hw_aes_cbc_hmac_sha512_etm(void);
+
+#ifdef AES_CBC_HMAC_SHA_ETM_CAPABLE
+#include <openssl/aes.h>
+#include <openssl/sha.h>
+
+#define AES_CBC_MAX_HMAC_SIZE 64
+
+typedef struct prov_aes_hmac_sha_etm_ctx_st {
+    PROV_CIPHER_CTX base;
+    AES_KEY ks;
+    const PROV_CIPHER_HW_AES_HMAC_SHA_ETM *hw;
+    unsigned char tag[AES_CBC_MAX_HMAC_SIZE];
+    unsigned char exp_tag[AES_CBC_MAX_HMAC_SIZE];
+    size_t taglen;
+} PROV_AES_HMAC_SHA_ETM_CTX;
+
+typedef struct prov_aes_hmac_sha1_etm_ctx_st {
+    PROV_AES_HMAC_SHA_ETM_CTX base_ctx;
+    SHA_CTX head, tail;
+} PROV_AES_HMAC_SHA1_ETM_CTX;
+
+typedef struct prov_aes_hmac_sha256_etm_ctx_st {
+    PROV_AES_HMAC_SHA_ETM_CTX base_ctx;
+    SHA256_CTX head, tail;
+} PROV_AES_HMAC_SHA256_ETM_CTX;
+
+typedef struct prov_aes_hmac_sha512_etm_ctx_st {
+    PROV_AES_HMAC_SHA_ETM_CTX base_ctx;
+    SHA512_CTX head, tail, md;
+} PROV_AES_HMAC_SHA512_ETM_CTX;
+
+typedef struct {
+    struct {
+        uint8_t *key;
+        uint8_t key_rounds;
+        uint8_t *iv;
+    } cipher;
+    struct {
+        struct {
+            uint8_t *i_key_pad;
+            uint8_t *o_key_pad;
+        } hmac;
+    } digest;
+} CIPH_DIGEST;
+
+#endif /* AES_CBC_HMAC_SHA_ETM_CAPABLE */
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CBC_HMAC_SHA_ETM_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.inc.in
new file mode 100644
index 00000000000..7a97963012a
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.inc.in
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('aes_cbc_hmac_sha_etm_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_AEAD_MAC_KEY', 'key',    'octet_string'],
+                          ['OSSL_CIPHER_PARAM_KEYLEN',       'keylen', 'size_t'],
+                          ['OSSL_CIPHER_HMAC_PARAM_MAC',     'mac',    'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('aes_cbc_hmac_sha_etm_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',     'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',      'ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_IV',         'iv',     'octet_string'],
+                          ['OSSL_CIPHER_PARAM_UPDATED_IV', 'upd_iv', 'octet_string'],
+                          ['OSSL_CIPHER_HMAC_PARAM_MAC',   'mac',    'octet_string'],
+                          ['OSSL_CIPHER_PARAM_FIPS_APPROVED_INDICATOR', 'fips indicator', 'int'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm.c
index 34d6bf468d8..f245703faef 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -24,9 +24,7 @@ static void *aes_ccm_newctx(void *provctx, size_t keybits)
 {
     PROV_AES_CCM_CTX *ctx;

-    if (!ossl_prov_is_running())
-        return NULL;
-
+    CIPHER_PROV_CHECK(provctx, AES_128_CCM);
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx != NULL)
         ossl_ccm_initctx(&ctx->base, keybits, ossl_prov_aes_hw_ccm(keybits));
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm.h
index 089792ee8a8..5359c44f92b 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CCM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CCM_H
+
 #include <openssl/aes.h>
 #include "prov/ciphercommon.h"
 #include "prov/ciphercommon_ccm.h"
@@ -45,4 +48,27 @@ typedef struct prov_aes_ccm_ctx_st {
     } ccm;
 } PROV_AES_CCM_CTX;

+int ossl_cipher_set_ccm_aes_initkey(PROV_CCM_CTX *ctx,
+    const unsigned char *key, size_t keylen,
+    aes_set_encrypt_key_fn fn_set_key, aes_block128_f fn_block,
+    ccm128_f fn_ccm_enc, ccm128_f fn_ccm_dec);
+
 const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keylen);
+
+#if defined(AESNI_CAPABLE)
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm_aesni(void);
+#endif
+#if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm_rv32i(void);
+#endif
+#if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm_rv64i(void);
+#endif
+#if defined(S390X_aes_128_CAPABLE)
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm_s390x(size_t keybits);
+#endif
+#if defined(SPARC_AES_CAPABLE)
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm_t4(void);
+#endif
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CCM_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw.c
index 5556175b083..57d00f7f9cc 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,36 +14,50 @@
  * non-internal use) in order to implement provider AES ciphers.
  */
 #include "internal/deprecated.h"
-
+#include <openssl/proverr.h>
 #include "cipher_aes_ccm.h"

-#define AES_HW_CCM_SET_KEY_FN(fn_set_enc_key, fn_blk, fn_ccm_enc, fn_ccm_dec) \
-    fn_set_enc_key(key, keylen * 8, &actx->ccm.ks.ks);                        \
-    CRYPTO_ccm128_init(&ctx->ccm_ctx, ctx->m, ctx->l, &actx->ccm.ks.ks,       \
-        (block128_f)fn_blk);                                                  \
-    ctx->str = ctx->enc ? (ccm128_f)fn_ccm_enc : (ccm128_f)fn_ccm_dec;        \
+int ossl_cipher_set_ccm_aes_initkey(PROV_CCM_CTX *ctx,
+    const unsigned char *key, size_t keylen,
+    aes_set_encrypt_key_fn fn_set_key, aes_block128_f fn_block,
+    ccm128_f fn_ccm_enc, ccm128_f fn_ccm_dec)
+{
+    PROV_AES_CCM_CTX *actx = (PROV_AES_CCM_CTX *)ctx;
+    AES_KEY *ks = &actx->ccm.ks.ks;
+
+    int ret = fn_set_key(key, (int)(keylen * 8), ks);
+    if (ret < 0) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
+        return 0;
+    }
+    CRYPTO_ccm128_init(&ctx->ccm_ctx, (unsigned int)ctx->m,
+        (unsigned int)ctx->l, ks, (block128_f)fn_block);
+
+    ctx->str = ctx->enc ? fn_ccm_enc : fn_ccm_dec;
     ctx->key_set = 1;

+    return 1;
+}
+
 static int ccm_generic_aes_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
     size_t keylen)
 {
-    PROV_AES_CCM_CTX *actx = (PROV_AES_CCM_CTX *)ctx;
-
 #ifdef HWAES_CAPABLE
     if (HWAES_CAPABLE) {
-        AES_HW_CCM_SET_KEY_FN(HWAES_set_encrypt_key, HWAES_encrypt, NULL, NULL);
-    } else
-#endif /* HWAES_CAPABLE */
+        return ossl_cipher_set_ccm_aes_initkey(ctx, key, keylen,
+            HWAES_set_encrypt_key, HWAES_encrypt, NULL, NULL);
+    }
+#endif

 #ifdef VPAES_CAPABLE
-        if (VPAES_CAPABLE) {
-        AES_HW_CCM_SET_KEY_FN(vpaes_set_encrypt_key, vpaes_encrypt, NULL, NULL);
-    } else
-#endif
-    {
-        AES_HW_CCM_SET_KEY_FN(AES_set_encrypt_key, AES_encrypt, NULL, NULL)
+    if (VPAES_CAPABLE) {
+        return ossl_cipher_set_ccm_aes_initkey(ctx, key, keylen,
+            vpaes_set_encrypt_key, vpaes_encrypt, NULL, NULL);
     }
-    return 1;
+#endif
+
+    return ossl_cipher_set_ccm_aes_initkey(ctx, key, keylen,
+        AES_set_encrypt_key, AES_encrypt, NULL, NULL);
 }

 static const PROV_CCM_HW aes_ccm = {
@@ -55,19 +69,21 @@ static const PROV_CCM_HW aes_ccm = {
     ossl_ccm_generic_gettag
 };

-#if defined(S390X_aes_128_CAPABLE)
-#include "cipher_aes_ccm_hw_s390x.inc"
-#elif defined(AESNI_CAPABLE)
-#include "cipher_aes_ccm_hw_aesni.inc"
-#elif defined(SPARC_AES_CAPABLE)
-#include "cipher_aes_ccm_hw_t4.inc"
-#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
-#include "cipher_aes_ccm_hw_rv64i.inc"
-#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
-#include "cipher_aes_ccm_hw_rv32i.inc"
-#else
 const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keybits)
 {
+    const PROV_CCM_HW *aes_ccm_hw = NULL;
+#if defined(AESNI_CAPABLE)
+    aes_ccm_hw = ossl_prov_aes_hw_ccm_aesni();
+#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
+    aes_ccm_hw = ossl_prov_aes_hw_ccm_rv32i();
+#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
+    aes_ccm_hw = ossl_prov_aes_hw_ccm_rv64i();
+#elif defined(S390X_aes_128_CAPABLE)
+    aes_ccm_hw = ossl_prov_aes_hw_ccm_s390x(keybits);
+#elif defined(SPARC_AES_CAPABLE)
+    aes_ccm_hw = ossl_prov_aes_hw_ccm_t4();
+#endif
+    if (aes_ccm_hw != NULL)
+        return aes_ccm_hw;
     return &aes_ccm;
 }
-#endif
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_aesni.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_aesni.inc
deleted file mode 100644
index 579e5a3d4f1..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_aesni.inc
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * AES-NI support for AES CCM.
- * This file is included by cipher_aes_ccm_hw.c
- */
-
-static int ccm_aesni_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
-                             size_t keylen)
-{
-    PROV_AES_CCM_CTX *actx = (PROV_AES_CCM_CTX *)ctx;
-
-    AES_HW_CCM_SET_KEY_FN(aesni_set_encrypt_key, aesni_encrypt,
-                          aesni_ccm64_encrypt_blocks,
-                          aesni_ccm64_decrypt_blocks);
-    return 1;
-}
-
-static const PROV_CCM_HW aesni_ccm = {
-    ccm_aesni_initkey,
-    ossl_ccm_generic_setiv,
-    ossl_ccm_generic_setaad,
-    ossl_ccm_generic_auth_encrypt,
-    ossl_ccm_generic_auth_decrypt,
-    ossl_ccm_generic_gettag
-};
-
-const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keybits)
-{
-    return AESNI_CAPABLE ? &aesni_ccm : &aes_ccm;
-}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_rv32i.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_rv32i.inc
deleted file mode 100644
index 7cfe0fc4ce8..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_rv32i.inc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * RISC-V 32 ZKND ZKNE support for AES CCM.
- * This file is included by cipher_aes_ccm_hw.c
- */
-
-static int ccm_rv32i_zknd_zkne_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
-                                       size_t keylen)
-{
-    PROV_AES_CCM_CTX *actx = (PROV_AES_CCM_CTX *)ctx;
-
-    AES_HW_CCM_SET_KEY_FN(rv32i_zkne_set_encrypt_key, rv32i_zkne_encrypt,
-                          NULL, NULL);
-    return 1;
-}
-
-static int ccm_rv32i_zbkb_zknd_zkne_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
-                                            size_t keylen)
-{
-    PROV_AES_CCM_CTX *actx = (PROV_AES_CCM_CTX *)ctx;
-
-    AES_HW_CCM_SET_KEY_FN(rv32i_zbkb_zkne_set_encrypt_key, rv32i_zkne_encrypt,
-                          NULL, NULL);
-    return 1;
-}
-
-static const PROV_CCM_HW rv32i_zknd_zkne_ccm = {
-    ccm_rv32i_zknd_zkne_initkey,
-    ossl_ccm_generic_setiv,
-    ossl_ccm_generic_setaad,
-    ossl_ccm_generic_auth_encrypt,
-    ossl_ccm_generic_auth_decrypt,
-    ossl_ccm_generic_gettag
-};
-
-static const PROV_CCM_HW rv32i_zbkb_zknd_zkne_ccm = {
-    ccm_rv32i_zbkb_zknd_zkne_initkey,
-    ossl_ccm_generic_setiv,
-    ossl_ccm_generic_setaad,
-    ossl_ccm_generic_auth_encrypt,
-    ossl_ccm_generic_auth_decrypt,
-    ossl_ccm_generic_gettag
-};
-
-const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keybits)
-{
-    if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE())
-        return &rv32i_zbkb_zknd_zkne_ccm;
-    if (RISCV_HAS_ZKND_AND_ZKNE())
-        return &rv32i_zknd_zkne_ccm;
-    return &aes_ccm;
-}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_rv64i.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_rv64i.inc
deleted file mode 100644
index f2353bb3b8f..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_rv64i.inc
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * RISC-V 64 ZKND ZKNE support for AES CCM.
- * This file is included by cipher_aes_ccm_hw.c
- */
-
-static int ccm_rv64i_zknd_zkne_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
-                             size_t keylen)
-{
-    PROV_AES_CCM_CTX *actx = (PROV_AES_CCM_CTX *)ctx;
-
-    AES_HW_CCM_SET_KEY_FN(rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt,
-                          NULL, NULL);
-    return 1;
-}
-
-static const PROV_CCM_HW rv64i_zknd_zkne_ccm = {
-    ccm_rv64i_zknd_zkne_initkey,
-    ossl_ccm_generic_setiv,
-    ossl_ccm_generic_setaad,
-    ossl_ccm_generic_auth_encrypt,
-    ossl_ccm_generic_auth_decrypt,
-    ossl_ccm_generic_gettag
-};
-
-/*-
- * RISC-V RV64 ZVKNED support for AES CCM.
- * This file is included by cipher_aes_ccm_hw.c
- */
-
-static int ccm_rv64i_zvkned_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
-                                    size_t keylen)
-{
-    PROV_AES_CCM_CTX *actx = (PROV_AES_CCM_CTX *)ctx;
-
-    /* Zvkned only supports 128 and 256 bit keys for key schedule generation. */
-    if (keylen * 8 == 128 || keylen * 8 == 256) {
-        AES_HW_CCM_SET_KEY_FN(rv64i_zvkned_set_encrypt_key, rv64i_zvkned_encrypt,
-                              NULL, NULL);
-    } else {
-        AES_HW_CCM_SET_KEY_FN(AES_set_encrypt_key, rv64i_zvkned_encrypt, NULL, NULL)
-    }
-    return 1;
-}
-
-static const PROV_CCM_HW rv64i_zvkned_ccm = {
-    ccm_rv64i_zvkned_initkey,
-    ossl_ccm_generic_setiv,
-    ossl_ccm_generic_setaad,
-    ossl_ccm_generic_auth_encrypt,
-    ossl_ccm_generic_auth_decrypt,
-    ossl_ccm_generic_gettag
-};
-
-const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keybits)
-{
-    if (RISCV_HAS_ZVKNED() && riscv_vlen() >= 128)
-        return &rv64i_zvkned_ccm;
-    else if (RISCV_HAS_ZKND_AND_ZKNE())
-        return &rv64i_zknd_zkne_ccm;
-    else
-        return &aes_ccm;
-}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_s390x.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_s390x.inc
deleted file mode 100644
index 7253f03a7ef..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_s390x.inc
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * S390X support for AES CCM.
- * This file is included by cipher_aes_ccm_hw.c
- */
-
-#define S390X_CCM_AAD_FLAG 0x40
-
-static int s390x_aes_ccm_initkey(PROV_CCM_CTX *ctx,
-                                 const unsigned char *key, size_t keylen)
-{
-    PROV_AES_CCM_CTX *sctx = (PROV_AES_CCM_CTX *)ctx;
-
-    sctx->ccm.s390x.fc = S390X_AES_FC(keylen);
-    memcpy(&sctx->ccm.s390x.kmac.k, key, keylen);
-    /* Store encoded m and l. */
-    sctx->ccm.s390x.nonce.b[0] = ((ctx->l - 1) & 0x7)
-                                | (((ctx->m - 2) >> 1) & 0x7) << 3;
-    memset(sctx->ccm.s390x.nonce.b + 1, 0, sizeof(sctx->ccm.s390x.nonce.b));
-    sctx->ccm.s390x.blocks = 0;
-    ctx->key_set = 1;
-    return 1;
-}
-
-static int s390x_aes_ccm_setiv(PROV_CCM_CTX *ctx,
-                               const unsigned char *nonce, size_t noncelen,
-                               size_t mlen)
-{
-    PROV_AES_CCM_CTX *sctx = (PROV_AES_CCM_CTX *)ctx;
-
-    sctx->ccm.s390x.nonce.b[0] &= ~S390X_CCM_AAD_FLAG;
-    sctx->ccm.s390x.nonce.g[1] = mlen;
-    memcpy(sctx->ccm.s390x.nonce.b + 1, nonce, 15 - ctx->l);
-    return 1;
-}
-
-/*-
- * Process additional authenticated data. Code is big-endian.
- */
-static int s390x_aes_ccm_setaad(PROV_CCM_CTX *ctx,
-                                const unsigned char *aad, size_t alen)
-{
-    PROV_AES_CCM_CTX *sctx = (PROV_AES_CCM_CTX *)ctx;
-    unsigned char *ptr;
-    int i, rem;
-
-    if (!alen)
-        return 1;
-
-    sctx->ccm.s390x.nonce.b[0] |= S390X_CCM_AAD_FLAG;
-
-    /* Suppress 'type-punned pointer dereference' warning. */
-    ptr = sctx->ccm.s390x.buf.b;
-
-    if (alen < ((1 << 16) - (1 << 8))) {
-        *(uint16_t *)ptr = alen;
-        i = 2;
-    } else if (sizeof(alen) == 8
-               && alen >= (size_t)1 << (32 % (sizeof(alen) * 8))) {
-        *(uint16_t *)ptr = 0xffff;
-        *(uint64_t *)(ptr + 2) = alen;
-        i = 10;
-    } else {
-        *(uint16_t *)ptr = 0xfffe;
-        *(uint32_t *)(ptr + 2) = alen;
-        i = 6;
-    }
-
-    while (i < 16 && alen) {
-        sctx->ccm.s390x.buf.b[i] = *aad;
-        ++aad;
-        --alen;
-        ++i;
-    }
-    while (i < 16) {
-        sctx->ccm.s390x.buf.b[i] = 0;
-        ++i;
-    }
-
-    sctx->ccm.s390x.kmac.icv.g[0] = 0;
-    sctx->ccm.s390x.kmac.icv.g[1] = 0;
-    s390x_kmac(sctx->ccm.s390x.nonce.b, 32, sctx->ccm.s390x.fc,
-               &sctx->ccm.s390x.kmac);
-    sctx->ccm.s390x.blocks += 2;
-
-    rem = alen & 0xf;
-    alen &= ~(size_t)0xf;
-    if (alen) {
-        s390x_kmac(aad, alen, sctx->ccm.s390x.fc, &sctx->ccm.s390x.kmac);
-        sctx->ccm.s390x.blocks += alen >> 4;
-        aad += alen;
-    }
-    if (rem) {
-        for (i = 0; i < rem; i++)
-            sctx->ccm.s390x.kmac.icv.b[i] ^= aad[i];
-
-        s390x_km(sctx->ccm.s390x.kmac.icv.b, 16,
-                 sctx->ccm.s390x.kmac.icv.b, sctx->ccm.s390x.fc,
-                 sctx->ccm.s390x.kmac.k);
-        sctx->ccm.s390x.blocks++;
-    }
-    return 1;
-}
-
-/*-
- * En/de-crypt plain/cipher-text. Compute tag from plaintext. Returns 1 for
- * success.
- */
-static int s390x_aes_ccm_auth_encdec(PROV_CCM_CTX *ctx,
-                                     const unsigned char *in,
-                                     unsigned char *out, size_t len, int enc)
-{
-    PROV_AES_CCM_CTX *sctx = (PROV_AES_CCM_CTX *)ctx;
-    size_t n, rem;
-    unsigned int i, l, num;
-    unsigned char flags;
-
-    flags = sctx->ccm.s390x.nonce.b[0];
-    if (!(flags & S390X_CCM_AAD_FLAG)) {
-        s390x_km(sctx->ccm.s390x.nonce.b, 16, sctx->ccm.s390x.kmac.icv.b,
-                 sctx->ccm.s390x.fc, sctx->ccm.s390x.kmac.k);
-        sctx->ccm.s390x.blocks++;
-    }
-    l = flags & 0x7;
-    sctx->ccm.s390x.nonce.b[0] = l;
-
-    /*-
-     * Reconstruct length from encoded length field
-     * and initialize it with counter value.
-     */
-    n = 0;
-    for (i = 15 - l; i < 15; i++) {
-        n |= sctx->ccm.s390x.nonce.b[i];
-        sctx->ccm.s390x.nonce.b[i] = 0;
-        n <<= 8;
-    }
-    n |= sctx->ccm.s390x.nonce.b[15];
-    sctx->ccm.s390x.nonce.b[15] = 1;
-
-    if (n != len)
-        return 0;      /* length mismatch */
-
-    if (enc) {
-        /* Two operations per block plus one for tag encryption */
-        sctx->ccm.s390x.blocks += (((len + 15) >> 4) << 1) + 1;
-        if (sctx->ccm.s390x.blocks > (1ULL << 61))
-            return 0;      /* too much data */
-    }
-
-    num = 0;
-    rem = len & 0xf;
-    len &= ~(size_t)0xf;
-
-    if (enc) {
-        /* mac-then-encrypt */
-        if (len)
-            s390x_kmac(in, len, sctx->ccm.s390x.fc, &sctx->ccm.s390x.kmac);
-        if (rem) {
-            for (i = 0; i < rem; i++)
-                sctx->ccm.s390x.kmac.icv.b[i] ^= in[len + i];
-
-            s390x_km(sctx->ccm.s390x.kmac.icv.b, 16,
-                     sctx->ccm.s390x.kmac.icv.b,
-                     sctx->ccm.s390x.fc, sctx->ccm.s390x.kmac.k);
-        }
-
-        CRYPTO_ctr128_encrypt_ctr32(in, out, len + rem, &sctx->ccm.ks.ks,
-                                    sctx->ccm.s390x.nonce.b, sctx->ccm.s390x.buf.b,
-                                    &num, (ctr128_f)AES_ctr32_encrypt);
-    } else {
-        /* decrypt-then-mac */
-        CRYPTO_ctr128_encrypt_ctr32(in, out, len + rem, &sctx->ccm.ks.ks,
-                                    sctx->ccm.s390x.nonce.b, sctx->ccm.s390x.buf.b,
-                                    &num, (ctr128_f)AES_ctr32_encrypt);
-
-        if (len)
-            s390x_kmac(out, len, sctx->ccm.s390x.fc, &sctx->ccm.s390x.kmac);
-        if (rem) {
-            for (i = 0; i < rem; i++)
-                sctx->ccm.s390x.kmac.icv.b[i] ^= out[len + i];
-
-            s390x_km(sctx->ccm.s390x.kmac.icv.b, 16,
-                     sctx->ccm.s390x.kmac.icv.b,
-                     sctx->ccm.s390x.fc, sctx->ccm.s390x.kmac.k);
-        }
-    }
-    /* encrypt tag */
-    for (i = 15 - l; i < 16; i++)
-        sctx->ccm.s390x.nonce.b[i] = 0;
-
-    s390x_km(sctx->ccm.s390x.nonce.b, 16, sctx->ccm.s390x.buf.b,
-             sctx->ccm.s390x.fc, sctx->ccm.s390x.kmac.k);
-    sctx->ccm.s390x.kmac.icv.g[0] ^= sctx->ccm.s390x.buf.g[0];
-    sctx->ccm.s390x.kmac.icv.g[1] ^= sctx->ccm.s390x.buf.g[1];
-
-    sctx->ccm.s390x.nonce.b[0] = flags;    /* restore flags field */
-    return 1;
-}
-
-
-static int s390x_aes_ccm_gettag(PROV_CCM_CTX *ctx,
-                                unsigned char *tag, size_t tlen)
-{
-    PROV_AES_CCM_CTX *sctx = (PROV_AES_CCM_CTX *)ctx;
-
-    if (tlen > ctx->m)
-        return 0;
-    memcpy(tag, sctx->ccm.s390x.kmac.icv.b, tlen);
-    return 1;
-}
-
-static int s390x_aes_ccm_auth_encrypt(PROV_CCM_CTX *ctx,
-                                      const unsigned char *in,
-                                      unsigned char *out, size_t len,
-                                      unsigned char *tag, size_t taglen)
-{
-    int rv;
-
-    rv = s390x_aes_ccm_auth_encdec(ctx, in, out, len, 1);
-    if (rv && tag != NULL)
-        rv = s390x_aes_ccm_gettag(ctx, tag, taglen);
-    return rv;
-}
-
-static int s390x_aes_ccm_auth_decrypt(PROV_CCM_CTX *ctx,
-                                      const unsigned char *in,
-                                      unsigned char *out, size_t len,
-                                      unsigned char *expected_tag,
-                                      size_t taglen)
-{
-    int rv = 0;
-    PROV_AES_CCM_CTX *sctx = (PROV_AES_CCM_CTX *)ctx;
-
-    rv = s390x_aes_ccm_auth_encdec(ctx, in, out, len, 0);
-    if (rv) {
-        if (CRYPTO_memcmp(sctx->ccm.s390x.kmac.icv.b, expected_tag, ctx->m) != 0)
-            rv = 0;
-    }
-    if (rv == 0)
-        OPENSSL_cleanse(out, len);
-    return rv;
-}
-
-static const PROV_CCM_HW s390x_aes_ccm = {
-    s390x_aes_ccm_initkey,
-    s390x_aes_ccm_setiv,
-    s390x_aes_ccm_setaad,
-    s390x_aes_ccm_auth_encrypt,
-    s390x_aes_ccm_auth_decrypt,
-    s390x_aes_ccm_gettag
-};
-
-const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keybits)
-{
-    if ((keybits == 128 && S390X_aes_128_ccm_CAPABLE)
-         || (keybits == 192 && S390X_aes_192_ccm_CAPABLE)
-         || (keybits == 256 && S390X_aes_256_ccm_CAPABLE))
-        return &s390x_aes_ccm;
-    return &aes_ccm;
-}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_t4.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_t4.inc
deleted file mode 100644
index a676d411b59..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw_t4.inc
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * Fujitsu SPARC64 X support for AES CCM.
- * This file is included by cipher_aes_ccm_hw.c
- */
-
-static int ccm_t4_aes_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
-                              size_t keylen)
-{
-    PROV_AES_CCM_CTX *actx = (PROV_AES_CCM_CTX *)ctx;
-
-    AES_HW_CCM_SET_KEY_FN(aes_t4_set_encrypt_key, aes_t4_encrypt, NULL, NULL);
-    return 1;
-}
-
-static const PROV_CCM_HW t4_aes_ccm = {
-    ccm_t4_aes_initkey,
-    ossl_ccm_generic_setiv,
-    ossl_ccm_generic_setaad,
-    ossl_ccm_generic_auth_encrypt,
-    ossl_ccm_generic_auth_decrypt,
-    ossl_ccm_generic_gettag
-};
-
-const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keybits)
-{
-    return SPARC_AES_CAPABLE ? &t4_aes_ccm : &aes_ccm;
-}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cts.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cts.inc
deleted file mode 100644
index 1fb5ec3553f..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_cts.inc
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* Dispatch functions for AES CBC CTS ciphers */
-
-#include <openssl/proverr.h>
-#include "cipher_cts.h"
-
-#define CTS_FLAGS PROV_CIPHER_FLAG_CTS
-
-static OSSL_FUNC_cipher_encrypt_init_fn aes_cbc_cts_einit;
-static OSSL_FUNC_cipher_decrypt_init_fn aes_cbc_cts_dinit;
-static OSSL_FUNC_cipher_get_ctx_params_fn aes_cbc_cts_get_ctx_params;
-static OSSL_FUNC_cipher_set_ctx_params_fn aes_cbc_cts_set_ctx_params;
-static OSSL_FUNC_cipher_gettable_ctx_params_fn aes_cbc_cts_gettable_ctx_params;
-static OSSL_FUNC_cipher_settable_ctx_params_fn aes_cbc_cts_settable_ctx_params;
-
-CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_START(aes_cbc_cts)
-OSSL_PARAM_utf8_string(OSSL_CIPHER_PARAM_CTS_MODE, NULL, 0),
-CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_END(aes_cbc_cts)
-
-static int aes_cbc_cts_einit(void *ctx, const unsigned char *key, size_t keylen,
-                             const unsigned char *iv, size_t ivlen,
-                             const OSSL_PARAM params[])
-{
-    if (!ossl_cipher_generic_einit(ctx, key, keylen, iv, ivlen, NULL))
-        return 0;
-    return aes_cbc_cts_set_ctx_params(ctx, params);
-}
-
-static int aes_cbc_cts_dinit(void *ctx, const unsigned char *key, size_t keylen,
-                             const unsigned char *iv, size_t ivlen,
-                             const OSSL_PARAM params[])
-{
-    if (!ossl_cipher_generic_dinit(ctx, key, keylen, iv, ivlen, NULL))
-        return 0;
-    return aes_cbc_cts_set_ctx_params(ctx, params);
-}
-
-static int aes_cbc_cts_get_ctx_params(void *vctx, OSSL_PARAM params[])
-{
-    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
-    OSSL_PARAM *p;
-
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_CTS_MODE);
-    if (p != NULL) {
-        const char *name = ossl_cipher_cbc_cts_mode_id2name(ctx->cts_mode);
-
-        if (name == NULL || !OSSL_PARAM_set_utf8_string(p, name)) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
-            return 0;
-        }
-    }
-    return ossl_cipher_generic_get_ctx_params(vctx, params);
-}
-
-CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_START(aes_cbc_cts)
-OSSL_PARAM_utf8_string(OSSL_CIPHER_PARAM_CTS_MODE, NULL, 0),
-CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_END(aes_cbc_cts)
-
-static int aes_cbc_cts_set_ctx_params(void *vctx, const OSSL_PARAM params[])
-{
-    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
-    const OSSL_PARAM *p;
-    int id;
-
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_CTS_MODE);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
-            goto err;
-        id = ossl_cipher_cbc_cts_mode_name2id(p->data);
-        if (id < 0)
-            goto err;
-
-        ctx->cts_mode = (unsigned int)id;
-    }
-    return ossl_cipher_generic_set_ctx_params(vctx, params);
-err:
-    ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
-    return 0;
-}
-
-/* ossl_aes256cbc_cts_functions */
-IMPLEMENT_cts_cipher(aes, AES, cbc, CBC, CTS_FLAGS, 256, 128, 128, block)
-/* ossl_aes192cbc_cts_functions */
-IMPLEMENT_cts_cipher(aes, AES, cbc, CBC, CTS_FLAGS, 192, 128, 128, block)
-/* ossl_aes128cbc_cts_functions */
-IMPLEMENT_cts_cipher(aes, AES, cbc, CBC, CTS_FLAGS, 128, 128, 128, block)
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm.c
index 0a813de47ae..a83b39b4213 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -24,9 +24,7 @@ static void *aes_gcm_newctx(void *provctx, size_t keybits)
 {
     PROV_AES_GCM_CTX *ctx;

-    if (!ossl_prov_is_running())
-        return NULL;
-
+    CIPHER_PROV_CHECK(provctx, AES_256_GCM);
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx != NULL)
         ossl_gcm_initctx(provctx, &ctx->base, keybits,
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm.h
index 0cd1d5a1ade..d5db88e9bae 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_GCM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_GCM_H
+
 #include <openssl/aes.h>
 #include "prov/ciphercommon.h"
 #include "prov/ciphercommon_gcm.h"
@@ -42,4 +45,34 @@ typedef struct prov_aes_gcm_ctx_st {
     } plat;
 } PROV_AES_GCM_CTX;

+int ossl_aes_gcm_hw_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
+    size_t keylen, aes_set_encrypt_key_fn fn_set_key,
+    aes_block128_f fn_block, ctr128_f fn_ctr);
+
+int ossl_generic_aes_gcm_cipher_update(PROV_GCM_CTX *ctx,
+    const unsigned char *in, size_t len, unsigned char *out);
+
 const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits);
+#if defined(AESNI_CAPABLE)
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_aesni(void);
+#endif
+#if defined(AES_PMULL_CAPABLE) && defined(AES_GCM_ASM)
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_armv8(void);
+#endif
+#if defined(PPC_AES_GCM_CAPABLE) && defined(_ARCH_PPC64)
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_ppc(size_t keybits);
+#endif
+#if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_rv32i(void);
+#endif
+#if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_rv64i(void);
+#endif
+#if defined(S390X_aes_128_CAPABLE)
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_s390x(size_t keybits);
+#endif
+#if defined(SPARC_AES_CAPABLE)
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_t4(void);
+#endif
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_GCM_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw.c
index d2b7437cde3..d5699ddf91e 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,52 +14,71 @@
  * non-internal use) in order to implement provider AES ciphers.
  */
 #include "internal/deprecated.h"
-
+#include <openssl/proverr.h>
 #include "cipher_aes_gcm.h"

-static int aes_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
-    size_t keylen)
+int ossl_aes_gcm_hw_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
+    size_t keylen, aes_set_encrypt_key_fn fn_set_key,
+    aes_block128_f fn_block, ctr128_f fn_ctr)
 {
     PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
     AES_KEY *ks = &actx->ks.ks;

+    int ret = fn_set_key(key, (int)(keylen * 8), ks);
+    if (ret < 0) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
+        return 0;
+    }
+
+    CRYPTO_gcm128_init(&ctx->gcm, ks, (block128_f)fn_block);
+    ctx->ctr = fn_ctr;
+    ctx->key_set = 1;
+
+    return 1;
+}
+
+static int aes_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
+    size_t keylen)
+{
 #ifdef HWAES_CAPABLE
     if (HWAES_CAPABLE) {
 #ifdef HWAES_ctr32_encrypt_blocks
-        GCM_HW_SET_KEY_CTR_FN(ks, HWAES_set_encrypt_key, HWAES_encrypt,
-            HWAES_ctr32_encrypt_blocks);
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen, HWAES_set_encrypt_key,
+            HWAES_encrypt, HWAES_ctr32_encrypt_blocks);
 #else
-        GCM_HW_SET_KEY_CTR_FN(ks, HWAES_set_encrypt_key, HWAES_encrypt, NULL);
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen, HWAES_set_encrypt_key,
+            HWAES_encrypt, NULL);
 #endif /* HWAES_ctr32_encrypt_blocks */
     } else
 #endif /* HWAES_CAPABLE */

 #ifdef BSAES_CAPABLE
         if (BSAES_CAPABLE) {
-        GCM_HW_SET_KEY_CTR_FN(ks, AES_set_encrypt_key, AES_encrypt,
-            ossl_bsaes_ctr32_encrypt_blocks);
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen, AES_set_encrypt_key,
+            AES_encrypt, (ctr128_f)ossl_bsaes_ctr32_encrypt_blocks);
     } else
 #endif /* BSAES_CAPABLE */

 #ifdef VPAES_CAPABLE
         if (VPAES_CAPABLE) {
-        GCM_HW_SET_KEY_CTR_FN(ks, vpaes_set_encrypt_key, vpaes_encrypt, NULL);
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen, vpaes_set_encrypt_key,
+            vpaes_encrypt, NULL);
     } else
 #endif /* VPAES_CAPABLE */

     {
 #ifdef AES_CTR_ASM
-        GCM_HW_SET_KEY_CTR_FN(ks, AES_set_encrypt_key, AES_encrypt,
-            AES_ctr32_encrypt);
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen, AES_set_encrypt_key,
+            AES_encrypt, (ctr128_f)AES_ctr32_encrypt);
 #else
-        GCM_HW_SET_KEY_CTR_FN(ks, AES_set_encrypt_key, AES_encrypt, NULL);
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen, AES_set_encrypt_key,
+            AES_encrypt, NULL);
 #endif /* AES_CTR_ASM */
     }
-    return 1;
 }

-static int generic_aes_gcm_cipher_update(PROV_GCM_CTX *ctx, const unsigned char *in,
-    size_t len, unsigned char *out)
+int ossl_generic_aes_gcm_cipher_update(PROV_GCM_CTX *ctx,
+    const unsigned char *in, size_t len, unsigned char *out)
 {
     if (ctx->enc) {
         if (ctx->ctr != NULL) {
@@ -127,28 +146,33 @@ static const PROV_GCM_HW aes_gcm = {
     aes_gcm_initkey,
     ossl_gcm_setiv,
     ossl_gcm_aad_update,
-    generic_aes_gcm_cipher_update,
+    ossl_generic_aes_gcm_cipher_update,
     ossl_gcm_cipher_final,
     ossl_gcm_one_shot
 };

-#if defined(S390X_aes_128_CAPABLE)
-#include "cipher_aes_gcm_hw_s390x.inc"
-#elif defined(AESNI_CAPABLE)
-#include "cipher_aes_gcm_hw_aesni.inc"
-#elif defined(SPARC_AES_CAPABLE)
-#include "cipher_aes_gcm_hw_t4.inc"
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
+{
+    const PROV_GCM_HW *aes_gcm_hw = NULL;
+
+#if defined(AESNI_CAPABLE)
+    aes_gcm_hw = ossl_prov_aes_hw_gcm_aesni();
 #elif defined(AES_PMULL_CAPABLE) && defined(AES_GCM_ASM)
-#include "cipher_aes_gcm_hw_armv8.inc"
+    aes_gcm_hw = ossl_prov_aes_hw_gcm_armv8();
 #elif defined(PPC_AES_GCM_CAPABLE) && defined(_ARCH_PPC64)
-#include "cipher_aes_gcm_hw_ppc.inc"
-#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
-#include "cipher_aes_gcm_hw_rv64i.inc"
+    aes_gcm_hw = ossl_prov_aes_hw_gcm_ppc(keybits);
 #elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
-#include "cipher_aes_gcm_hw_rv32i.inc"
-#else
-const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
-{
-    return &aes_gcm;
-}
+    aes_gcm_hw = ossl_prov_aes_hw_gcm_rv32i();
+#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
+    aes_gcm_hw = ossl_prov_aes_hw_gcm_rv64i();
+#elif defined(S390X_aes_128_CAPABLE)
+    aes_gcm_hw = ossl_prov_aes_hw_gcm_s390x(keybits);
+#elif defined(SPARC_AES_CAPABLE)
+    aes_gcm_hw = ossl_prov_aes_hw_gcm_t4();
 #endif
+
+    if (aes_gcm_hw == NULL)
+        aes_gcm_hw = &aes_gcm;
+
+    return aes_gcm_hw;
+}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_aesni.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_aesni.inc
deleted file mode 100644
index 92f41b8cd6e..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_aesni.inc
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2001-2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * AES-NI support for AES GCM.
- * This file is included by cipher_aes_gcm_hw.c
- */
-
-static int aesni_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
-                             size_t keylen)
-{
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    AES_KEY *ks = &actx->ks.ks;
-    GCM_HW_SET_KEY_CTR_FN(ks, aesni_set_encrypt_key, aesni_encrypt,
-                          aesni_ctr32_encrypt_blocks);
-    return 1;
-}
-
-static const PROV_GCM_HW aesni_gcm = {
-    aesni_gcm_initkey,
-    ossl_gcm_setiv,
-    ossl_gcm_aad_update,
-    generic_aes_gcm_cipher_update,
-    ossl_gcm_cipher_final,
-    ossl_gcm_one_shot
-};
-
-#include "cipher_aes_gcm_hw_vaes_avx512.inc"
-
-const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
-{
-#ifdef VAES_GCM_ENABLED
-    if (ossl_vaes_vpclmulqdq_capable())
-        return &vaes_gcm;
-    else
-#endif
-    if (AESNI_CAPABLE)
-        return &aesni_gcm;
-    else
-        return &aes_gcm;
-}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_armv8.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_armv8.inc
deleted file mode 100644
index 60fff493d80..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_armv8.inc
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * Crypto extension support for AES GCM.
- * This file is included by cipher_aes_gcm_hw.c
- */
-
-size_t armv8_aes_gcm_encrypt(const unsigned char *in, unsigned char *out, size_t len,
-                             const void *key, unsigned char ivec[16], u64 *Xi)
-{
-    AES_KEY *aes_key = (AES_KEY *)key;
-    size_t align_bytes = len - len % 16;
-
-    switch(aes_key->rounds) {
-        case 10:
-            if (IS_CPU_SUPPORT_UNROLL8_EOR3()) {
-                unroll8_eor3_aes_gcm_enc_128_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
-            } else {
-                aes_gcm_enc_128_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
-            }
-            break;
-        case 12:
-            if (IS_CPU_SUPPORT_UNROLL8_EOR3()) {
-                unroll8_eor3_aes_gcm_enc_192_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
-            } else {
-                aes_gcm_enc_192_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
-            }
-            break;
-        case 14:
-            if (IS_CPU_SUPPORT_UNROLL8_EOR3()) {
-                unroll8_eor3_aes_gcm_enc_256_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
-            } else {
-                aes_gcm_enc_256_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
-            }
-            break;
-    }
-    return align_bytes;
-}
-
-size_t armv8_aes_gcm_decrypt(const unsigned char *in, unsigned char *out, size_t len,
-                             const void *key, unsigned char ivec[16], u64 *Xi)
-{
-    AES_KEY *aes_key = (AES_KEY *)key;
-    size_t align_bytes = len - len % 16;
-
-    switch(aes_key->rounds) {
-        case 10:
-            if (IS_CPU_SUPPORT_UNROLL8_EOR3()) {
-                unroll8_eor3_aes_gcm_dec_128_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
-            } else {
-                aes_gcm_dec_128_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
-            }
-            break;
-        case 12:
-            if (IS_CPU_SUPPORT_UNROLL8_EOR3()) {
-                unroll8_eor3_aes_gcm_dec_192_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
-            } else {
-                aes_gcm_dec_192_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
-            }
-            break;
-        case 14:
-            if (IS_CPU_SUPPORT_UNROLL8_EOR3()) {
-                unroll8_eor3_aes_gcm_dec_256_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
-            } else {
-                aes_gcm_dec_256_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
-            }
-            break;
-    }
-    return align_bytes;
-}
-
-static int armv8_aes_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
-                                 size_t keylen)
-{
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    AES_KEY *ks = &actx->ks.ks;
-
-    if (AES_UNROLL12_EOR3_CAPABLE) {
-        GCM_HW_SET_KEY_CTR_FN(ks, aes_v8_set_encrypt_key, aes_v8_encrypt,
-                              aes_v8_ctr32_encrypt_blocks_unroll12_eor3);
-    } else {
-        GCM_HW_SET_KEY_CTR_FN(ks, aes_v8_set_encrypt_key, aes_v8_encrypt,
-                              aes_v8_ctr32_encrypt_blocks);
-    }
-    return 1;
-}
-
-
-static const PROV_GCM_HW armv8_aes_gcm = {
-    armv8_aes_gcm_initkey,
-    ossl_gcm_setiv,
-    ossl_gcm_aad_update,
-    generic_aes_gcm_cipher_update,
-    ossl_gcm_cipher_final,
-    ossl_gcm_one_shot
-};
-
-const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
-{
-    return AES_PMULL_CAPABLE ? &armv8_aes_gcm : &aes_gcm;
-}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_ppc.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_ppc.c
similarity index 66%
rename from deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_ppc.inc
rename to deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_ppc.c
index a1df534f2a7..71bf11ffd44 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_ppc.inc
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_ppc.c
@@ -9,53 +9,53 @@

 /*-
  * PPC support for AES GCM.
- * This file is included by cipher_aes_gcm_hw.c
+ * This file is used by cipher_aes_gcm_hw.c
  */
+#include "internal/deprecated.h"
+#include "cipher_aes_gcm.h"
+
+#if defined(PPC_AES_GCM_CAPABLE) && defined(_ARCH_PPC64)

 static int aes_ppc_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
-                               size_t keylen)
+    size_t keylen)
 {
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    AES_KEY *ks = &actx->ks.ks;
-
-    GCM_HW_SET_KEY_CTR_FN(ks, aes_p8_set_encrypt_key, aes_p8_encrypt,
-                          aes_p8_ctr32_encrypt_blocks);
-    return 1;
+    return ossl_aes_gcm_hw_initkey(ctx, key, keylen, aes_p8_set_encrypt_key,
+        aes_p8_encrypt, aes_p8_ctr32_encrypt_blocks);
 }

-static inline u32 UTO32(unsigned char *buf)
+static inline uint32_t UTO32(unsigned char *buf)
 {
-    return ((u32) buf[0] << 24) | ((u32) buf[1] << 16) | ((u32) buf[2] << 8) | ((u32) buf[3]);
+    return ((uint32_t)buf[0] << 24) | ((uint32_t)buf[1] << 16) | ((uint32_t)buf[2] << 8) | ((uint32_t)buf[3]);
 }

-static inline u32 add32TOU(unsigned char buf[4], u32 n)
+static inline uint32_t add32TOU(unsigned char buf[4], uint32_t n)
 {
-    u32 r;
+    uint32_t r;

     r = UTO32(buf);
     r += n;
-    buf[0] = (unsigned char) (r >> 24) & 0xFF;
-    buf[1] = (unsigned char) (r >> 16) & 0xFF;
-    buf[2] = (unsigned char) (r >> 8) & 0xFF;
-    buf[3] = (unsigned char) r & 0xFF;
+    buf[0] = (unsigned char)(r >> 24) & 0xFF;
+    buf[1] = (unsigned char)(r >> 16) & 0xFF;
+    buf[2] = (unsigned char)(r >> 8) & 0xFF;
+    buf[3] = (unsigned char)r & 0xFF;
     return r;
 }

 static size_t ppc_aes_gcm_crypt(const unsigned char *in, unsigned char *out, size_t len,
-                                const void *key, unsigned char ivec[16], u64 *Xi, int encrypt)
+    const void *key, unsigned char ivec[16], uint64_t *Xi, int encrypt)
 {
     size_t s = 0;
     size_t ndone = 0;
     int ctr_reset = 0;
-    u64 blocks_unused;
-    u64 nb = len / 16;
-    u64 next_ctr = 0;
+    uint64_t blocks_unused;
+    uint64_t nb = len / 16;
+    uint64_t next_ctr = 0;
     unsigned char ctr_saved[12];

     memcpy(ctr_saved, ivec, 12);

     while (nb) {
-        blocks_unused = (u64) 0xffffffffU + 1 - (u64) UTO32 (ivec + 12);
+        blocks_unused = (uint64_t)0xffffffffU + 1 - (uint64_t)UTO32(ivec + 12);
         if (nb > blocks_unused) {
             len = blocks_unused * 16;
             nb -= blocks_unused;
@@ -71,7 +71,7 @@ static size_t ppc_aes_gcm_crypt(const unsigned char *in, unsigned char *out, siz
                     : ppc_aes_gcm_decrypt(in, out, len, key, ivec, Xi);

         /* add counter to ivec */
-        add32TOU(ivec + 12, (u32) next_ctr);
+        add32TOU(ivec + 12, (uint32_t)next_ctr);
         if (ctr_reset) {
             ctr_reset = 0;
             in += len;
@@ -85,7 +85,7 @@ static size_t ppc_aes_gcm_crypt(const unsigned char *in, unsigned char *out, siz
 }

 static int ppc_aes_gcm_cipher_update(PROV_GCM_CTX *ctx, const unsigned char *in,
-                                     size_t len, unsigned char *out)
+    size_t len, unsigned char *out)
 {
     if (ctx->enc) {
         if (ctx->ctr != NULL) {
@@ -98,14 +98,14 @@ static int ppc_aes_gcm_cipher_update(PROV_GCM_CTX *ctx, const unsigned char *in,
                     return 0;

                 bulk = ppc_aes_gcm_crypt(in + res, out + res, len - res,
-                                         ctx->gcm.key,
-                                         ctx->gcm.Yi.c, ctx->gcm.Xi.u, 1);
+                    ctx->gcm.key,
+                    ctx->gcm.Yi.c, ctx->gcm.Xi.u, 1);

                 ctx->gcm.len.u[1] += bulk;
                 bulk += res;
             }
             if (CRYPTO_gcm128_encrypt_ctr32(&ctx->gcm, in + bulk, out + bulk,
-                                            len - bulk, ctx->ctr))
+                    len - bulk, ctx->ctr))
                 return 0;
         } else {
             if (CRYPTO_gcm128_encrypt(&ctx->gcm, in, out, len))
@@ -122,14 +122,14 @@ static int ppc_aes_gcm_cipher_update(PROV_GCM_CTX *ctx, const unsigned char *in,
                     return 0;

                 bulk = ppc_aes_gcm_crypt(in + res, out + res, len - res,
-                                         ctx->gcm.key,
-                                         ctx->gcm.Yi.c, ctx->gcm.Xi.u, 0);
+                    ctx->gcm.key,
+                    ctx->gcm.Yi.c, ctx->gcm.Xi.u, 0);

                 ctx->gcm.len.u[1] += bulk;
                 bulk += res;
             }
             if (CRYPTO_gcm128_decrypt_ctr32(&ctx->gcm, in + bulk, out + bulk,
-                                            len - bulk, ctx->ctr))
+                    len - bulk, ctx->ctr))
                 return 0;
         } else {
             if (CRYPTO_gcm128_decrypt(&ctx->gcm, in, out, len))
@@ -148,8 +148,9 @@ static const PROV_GCM_HW aes_ppc_gcm = {
     ossl_gcm_one_shot
 };

-const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_ppc(size_t keybits)
 {
-    return PPC_AES_GCM_CAPABLE ? &aes_ppc_gcm : &aes_gcm;
+    return PPC_AES_GCM_CAPABLE ? &aes_ppc_gcm : NULL;
 }

+#endif
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_rv32i.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_rv32i.inc
deleted file mode 100644
index bf3f98df163..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_rv32i.inc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * RISC-V 32 ZKND ZKNE support for AES GCM.
- * This file is included by cipher_aes_gcm_hw.c
- */
-
-static int rv32i_zknd_zkne_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
-                                       size_t keylen)
-{
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    AES_KEY *ks = &actx->ks.ks;
-
-    GCM_HW_SET_KEY_CTR_FN(ks, rv32i_zkne_set_encrypt_key, rv32i_zkne_encrypt,
-                          NULL);
-    return 1;
-}
-
-static int rv32i_zbkb_zknd_zkne_gcm_initkey(PROV_GCM_CTX *ctx,
-                                            const unsigned char *key,
-                                            size_t keylen)
-{
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    AES_KEY *ks = &actx->ks.ks;
-
-    GCM_HW_SET_KEY_CTR_FN(ks, rv32i_zbkb_zkne_set_encrypt_key, rv32i_zkne_encrypt,
-                          NULL);
-    return 1;
-}
-
-static const PROV_GCM_HW rv32i_zknd_zkne_gcm = {
-    rv32i_zknd_zkne_gcm_initkey,
-    ossl_gcm_setiv,
-    ossl_gcm_aad_update,
-    generic_aes_gcm_cipher_update,
-    ossl_gcm_cipher_final,
-    ossl_gcm_one_shot
-};
-
-static const PROV_GCM_HW rv32i_zbkb_zknd_zkne_gcm = {
-    rv32i_zbkb_zknd_zkne_gcm_initkey,
-    ossl_gcm_setiv,
-    ossl_gcm_aad_update,
-    generic_aes_gcm_cipher_update,
-    ossl_gcm_cipher_final,
-    ossl_gcm_one_shot
-};
-
-const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
-{
-    if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE())
-        return &rv32i_zbkb_zknd_zkne_gcm;
-    if (RISCV_HAS_ZKND_AND_ZKNE())
-        return &rv32i_zknd_zkne_gcm;
-    return &aes_gcm;
-}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc
deleted file mode 100644
index a824a6358cc..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * RISC-V 64 support for AES GCM.
- * This file is included by cipher_aes_gcm_hw.c
- */
-
-/*-
- * RISC-V 64 ZKND and ZKNE support for AES GCM.
- */
-static int rv64i_zknd_zkne_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
-                                       size_t keylen)
-{
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    AES_KEY *ks = &actx->ks.ks;
-    GCM_HW_SET_KEY_CTR_FN(ks, rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt,
-                          NULL);
-    return 1;
-}
-
-static const PROV_GCM_HW rv64i_zknd_zkne_gcm = {
-    rv64i_zknd_zkne_gcm_initkey,
-    ossl_gcm_setiv,
-    ossl_gcm_aad_update,
-    generic_aes_gcm_cipher_update,
-    ossl_gcm_cipher_final,
-    ossl_gcm_one_shot
-};
-
-/*-
- * RISC-V RV64 ZVKNED support for AES GCM.
- */
-static int rv64i_zvkned_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
-                                    size_t keylen)
-{
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    AES_KEY *ks = &actx->ks.ks;
-
-    /*
-     * Zvkned only supports 128 and 256 bit keys for key schedule generation.
-     * For AES-192 case, we could fallback to `AES_set_encrypt_key`.
-     */
-    if (keylen * 8 == 128 || keylen * 8 == 256) {
-        GCM_HW_SET_KEY_CTR_FN(ks, rv64i_zvkned_set_encrypt_key,
-                              rv64i_zvkned_encrypt, NULL);
-    } else {
-        GCM_HW_SET_KEY_CTR_FN(ks, AES_set_encrypt_key,
-                              rv64i_zvkned_encrypt, NULL);
-    }
-
-    return 1;
-}
-
-static const PROV_GCM_HW rv64i_zvkned_gcm = {
-    rv64i_zvkned_gcm_initkey,
-    ossl_gcm_setiv,
-    ossl_gcm_aad_update,
-    generic_aes_gcm_cipher_update,
-    ossl_gcm_cipher_final,
-    ossl_gcm_one_shot
-};
-
-/*-
- * RISC-V RV64 ZVKB, ZVKG and ZVKNED support for AES GCM.
- */
-static int rv64i_zvkb_zvkg_zvkned_gcm_initkey(PROV_GCM_CTX *ctx,
-                                              const unsigned char *key,
-                                              size_t keylen) {
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    AES_KEY *ks = &actx->ks.ks;
-
-    /*
-     * Zvkned only supports 128 and 256 bit keys for key schedule generation.
-     * For AES-192 case, we could fallback to `AES_set_encrypt_key`.
-     */
-    if (keylen * 8 == 128 || keylen * 8 == 256) {
-        GCM_HW_SET_KEY_CTR_FN(ks, rv64i_zvkned_set_encrypt_key,
-                              rv64i_zvkned_encrypt,
-                              rv64i_zvkb_zvkned_ctr32_encrypt_blocks);
-    } else {
-        GCM_HW_SET_KEY_CTR_FN(ks, AES_set_encrypt_key,
-                              rv64i_zvkned_encrypt,
-                              rv64i_zvkb_zvkned_ctr32_encrypt_blocks);
-    }
-
-    return 1;
-}
-
-static const PROV_GCM_HW rv64i_zvkb_zvkg_zvkned_gcm = {
-    rv64i_zvkb_zvkg_zvkned_gcm_initkey,
-    ossl_gcm_setiv,
-    ossl_gcm_aad_update,
-    generic_aes_gcm_cipher_update,
-    ossl_gcm_cipher_final,
-    ossl_gcm_one_shot
-};
-
-const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits) {
-    if (RISCV_HAS_ZVKNED() && riscv_vlen() >= 128) {
-      if (RISCV_HAS_ZVKB() && RISCV_HAS_ZVKG())
-        return &rv64i_zvkb_zvkg_zvkned_gcm;
-      return &rv64i_zvkned_gcm;
-    }
-
-    if (RISCV_HAS_ZKND_AND_ZKNE()) {
-      return &rv64i_zknd_zkne_gcm;
-    }
-
-    return &aes_gcm;
-}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_s390x.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_s390x.inc
deleted file mode 100644
index a36c48e3ec4..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_s390x.inc
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * IBM S390X support for AES GCM.
- * This file is included by cipher_aes_gcm_hw.c
- */
-
-/* iv + padding length for iv lengths != 12 */
-#define S390X_gcm_ivpadlen(i)  ((((i) + 15) >> 4 << 4) + 16)
-
-/* Additional flag or'ed to fc for decryption */
-#define S390X_gcm_decrypt_flag(ctx) (((ctx)->enc) ? 0 : S390X_DECRYPT)
-
-#define S390X_gcm_fc(A,C) ((A)->plat.s390x.fc | (A)->plat.s390x.hsflag |\
-                            S390X_gcm_decrypt_flag((C)))
-
-static int s390x_aes_gcm_initkey(PROV_GCM_CTX *ctx,
-                                 const unsigned char *key, size_t keylen)
-{
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-
-    ctx->key_set = 1;
-    memcpy(&actx->plat.s390x.param.kma.k, key, keylen);
-    actx->plat.s390x.fc = S390X_AES_FC(keylen);
-    return 1;
-}
-
-static int s390x_aes_gcm_setiv(PROV_GCM_CTX *ctx, const unsigned char *iv,
-                               size_t ivlen)
-{
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    S390X_KMA_PARAMS *kma = &actx->plat.s390x.param.kma;
-
-    kma->t.g[0] = 0;
-    kma->t.g[1] = 0;
-    kma->tpcl = 0;
-    kma->taadl = 0;
-    actx->plat.s390x.mreslen = 0;
-    actx->plat.s390x.areslen = 0;
-    actx->plat.s390x.kreslen = 0;
-
-    if (ivlen == GCM_IV_DEFAULT_SIZE) {
-        memcpy(&kma->j0, iv, ivlen);
-        kma->j0.w[3] = 1;
-        kma->cv.w = 1;
-        actx->plat.s390x.hsflag = 0;
-    } else {
-        unsigned long long ivbits = ivlen << 3;
-        size_t len = S390X_gcm_ivpadlen(ivlen);
-        unsigned char iv_zero_pad[S390X_gcm_ivpadlen(GCM_IV_MAX_SIZE)];
-        /*
-         * The IV length needs to be zero padded to be a multiple of 16 bytes
-         * followed by 8 bytes of zeros and 8 bytes for the IV length.
-         * The GHASH of this value can then be calculated.
-         */
-        memcpy(iv_zero_pad, iv, ivlen);
-        memset(iv_zero_pad + ivlen, 0, len - ivlen);
-        memcpy(iv_zero_pad + len - sizeof(ivbits), &ivbits, sizeof(ivbits));
-        /*
-         * Calculate the ghash of the iv - the result is stored into the tag
-         * param.
-         */
-        s390x_kma(iv_zero_pad, len, NULL, 0, NULL, actx->plat.s390x.fc, kma);
-        actx->plat.s390x.hsflag = S390X_KMA_HS; /* The hash subkey is set */
-
-        /* Copy the 128 bit GHASH result into J0 and clear the tag */
-        kma->j0.g[0] = kma->t.g[0];
-        kma->j0.g[1] = kma->t.g[1];
-        kma->t.g[0] = 0;
-        kma->t.g[1] = 0;
-        /* Set the 32 bit counter */
-        kma->cv.w = kma->j0.w[3];
-    }
-    return 1;
-}
-
-static int s390x_aes_gcm_cipher_final(PROV_GCM_CTX *ctx, unsigned char *tag)
-{
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    S390X_KMA_PARAMS *kma = &actx->plat.s390x.param.kma;
-    unsigned char out[AES_BLOCK_SIZE];
-    unsigned int fc;
-    int rc;
-
-    kma->taadl <<= 3;
-    kma->tpcl <<= 3;
-    fc = S390X_gcm_fc(actx, ctx) | S390X_KMA_LAAD | S390X_KMA_LPC;
-    s390x_kma(actx->plat.s390x.ares, actx->plat.s390x.areslen,
-              actx->plat.s390x.mres, actx->plat.s390x.mreslen, out,
-              fc, kma);
-
-    /* gctx->mres already returned to the caller */
-    OPENSSL_cleanse(out, actx->plat.s390x.mreslen);
-
-    if (ctx->enc) {
-        ctx->taglen = GCM_TAG_MAX_SIZE;
-        memcpy(tag, kma->t.b, ctx->taglen);
-        rc = 1;
-    } else {
-        rc = (CRYPTO_memcmp(tag, kma->t.b, ctx->taglen) == 0);
-    }
-    return rc;
-}
-
-static int s390x_aes_gcm_one_shot(PROV_GCM_CTX *ctx,
-                                  unsigned char *aad, size_t aad_len,
-                                  const unsigned char *in, size_t in_len,
-                                  unsigned char *out,
-                                  unsigned char *tag, size_t taglen)
-{
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    S390X_KMA_PARAMS *kma = &actx->plat.s390x.param.kma;
-    unsigned int fc;
-    int rc;
-
-    kma->taadl = aad_len << 3;
-    kma->tpcl = in_len << 3;
-    fc = S390X_gcm_fc(actx, ctx) | S390X_KMA_LAAD | S390X_KMA_LPC;
-    s390x_kma(aad, aad_len, in, in_len, out, fc, kma);
-
-    if (ctx->enc) {
-        memcpy(tag, kma->t.b, taglen);
-        rc = 1;
-    } else {
-        rc = (CRYPTO_memcmp(tag, kma->t.b, taglen) == 0);
-    }
-    return rc;
-}
-
-/*
- * Process additional authenticated data. Returns 1 on success. Code is
- * big-endian.
- */
-static int s390x_aes_gcm_aad_update(PROV_GCM_CTX *ctx,
-                                    const unsigned char *aad, size_t len)
-{
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    S390X_KMA_PARAMS *kma = &actx->plat.s390x.param.kma;
-    unsigned long long alen;
-    unsigned int fc;
-    int n, rem;
-
-    /* If already processed pt/ct then error */
-    if (kma->tpcl != 0)
-        return 0;
-
-    /* update the total aad length */
-    alen = kma->taadl + len;
-    if (alen > (U64(1) << 61) || (sizeof(len) == 8 && alen < len))
-        return 0;
-    kma->taadl = alen;
-
-    /* check if there is any existing aad data from a previous add */
-    n = actx->plat.s390x.areslen;
-    if (n) {
-        /* add additional data to a buffer until it has 16 bytes */
-        while (n && len) {
-            actx->plat.s390x.ares[n] = *aad;
-            ++aad;
-            --len;
-            n = (n + 1) & 0xf;
-        }
-        /* ctx->ares contains a complete block if offset has wrapped around */
-        if (!n) {
-            fc = S390X_gcm_fc(actx, ctx);
-            s390x_kma(actx->plat.s390x.ares, 16, NULL, 0, NULL, fc, kma);
-            actx->plat.s390x.hsflag = S390X_KMA_HS;
-        }
-        actx->plat.s390x.areslen = n;
-    }
-
-    /* If there are leftover bytes (< 128 bits) save them for next time */
-    rem = len & 0xf;
-    /* Add any remaining 16 byte blocks (128 bit each) */
-    len &= ~(size_t)0xf;
-    if (len) {
-        fc = S390X_gcm_fc(actx, ctx);
-        s390x_kma(aad, len, NULL, 0, NULL, fc, kma);
-        actx->plat.s390x.hsflag = S390X_KMA_HS;
-        aad += len;
-    }
-
-    if (rem) {
-        actx->plat.s390x.areslen = rem;
-
-        do {
-            --rem;
-            actx->plat.s390x.ares[rem] = aad[rem];
-        } while (rem);
-    }
-    return 1;
-}
-
-/*-
- * En/de-crypt plain/cipher-text and authenticate ciphertext. Returns 1 for
- * success. Code is big-endian.
- */
-static int s390x_aes_gcm_cipher_update(PROV_GCM_CTX *ctx,
-                                       const unsigned char *in, size_t len,
-                                       unsigned char *out)
-{
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    S390X_KMA_PARAMS *kma = &actx->plat.s390x.param.kma;
-    const unsigned char *inptr;
-    unsigned long long mlen;
-    unsigned int fc;
-    union {
-        unsigned int w[4];
-        unsigned char b[16];
-    } buf;
-    size_t inlen;
-    int n, rem, i;
-
-    mlen = kma->tpcl + len;
-    if (mlen > ((U64(1) << 36) - 32) || (sizeof(len) == 8 && mlen < len))
-        return 0;
-    kma->tpcl = mlen;
-
-    fc = S390X_gcm_fc(actx, ctx) | S390X_KMA_LAAD;
-    n = actx->plat.s390x.mreslen;
-    if (n) {
-        inptr = in;
-        inlen = len;
-        while (n && inlen) {
-            actx->plat.s390x.mres[n] = *inptr;
-            n = (n + 1) & 0xf;
-            ++inptr;
-            --inlen;
-        }
-        /* ctx->mres contains a complete block if offset has wrapped around */
-        if (!n) {
-            s390x_kma(actx->plat.s390x.ares, actx->plat.s390x.areslen,
-                      actx->plat.s390x.mres, 16, buf.b, fc, kma);
-            actx->plat.s390x.hsflag = S390X_KMA_HS;
-            fc |= S390X_KMA_HS;
-            actx->plat.s390x.areslen = 0;
-
-            /* previous call already encrypted/decrypted its remainder,
-             * see comment below */
-            n = actx->plat.s390x.mreslen;
-            while (n) {
-                *out = buf.b[n];
-                n = (n + 1) & 0xf;
-                ++out;
-                ++in;
-                --len;
-            }
-            actx->plat.s390x.mreslen = 0;
-        }
-    }
-
-    rem = len & 0xf;
-
-    len &= ~(size_t)0xf;
-    if (len) {
-        s390x_kma(actx->plat.s390x.ares, actx->plat.s390x.areslen, in, len, out,
-                  fc, kma);
-        in += len;
-        out += len;
-        actx->plat.s390x.hsflag = S390X_KMA_HS;
-        actx->plat.s390x.areslen = 0;
-    }
-
-    /*-
-     * If there is a remainder, it has to be saved such that it can be
-     * processed by kma later. However, we also have to do the for-now
-     * unauthenticated encryption/decryption part here and now...
-     */
-    if (rem) {
-        if (!actx->plat.s390x.mreslen) {
-            buf.w[0] = kma->j0.w[0];
-            buf.w[1] = kma->j0.w[1];
-            buf.w[2] = kma->j0.w[2];
-            buf.w[3] = kma->cv.w + 1;
-            s390x_km(buf.b, 16, actx->plat.s390x.kres,
-                     fc & 0x1f, &kma->k);
-        }
-
-        n = actx->plat.s390x.mreslen;
-        for (i = 0; i < rem; i++) {
-            actx->plat.s390x.mres[n + i] = in[i];
-            out[i] = in[i] ^ actx->plat.s390x.kres[n + i];
-        }
-        actx->plat.s390x.mreslen += rem;
-    }
-    return 1;
-}
-
-static const PROV_GCM_HW s390x_aes_gcm = {
-    s390x_aes_gcm_initkey,
-    s390x_aes_gcm_setiv,
-    s390x_aes_gcm_aad_update,
-    s390x_aes_gcm_cipher_update,
-    s390x_aes_gcm_cipher_final,
-    s390x_aes_gcm_one_shot
-};
-
-const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
-{
-    if ((keybits == 128 && S390X_aes_128_gcm_CAPABLE)
-         || (keybits == 192 && S390X_aes_192_gcm_CAPABLE)
-         || (keybits == 256 && S390X_aes_256_gcm_CAPABLE))
-        return &s390x_aes_gcm;
-    return &aes_gcm;
-}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_t4.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_t4.inc
deleted file mode 100644
index 2b3a6d1d5ea..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_t4.inc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * Fujitsu SPARC64 X support for AES GCM.
- * This file is included by cipher_aes_gcm_hw.c
- */
-
-static int t4_aes_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
-                              size_t keylen)
-{
-    ctr128_f ctr;
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    AES_KEY *ks = &actx->ks.ks;
-
-
-    switch (keylen) {
-    case 16:
-        ctr = (ctr128_f)aes128_t4_ctr32_encrypt;
-        break;
-    case 24:
-        ctr = (ctr128_f)aes192_t4_ctr32_encrypt;
-        break;
-    case 32:
-        ctr = (ctr128_f)aes256_t4_ctr32_encrypt;
-        break;
-    default:
-        return 0;
-    }
-
-    GCM_HW_SET_KEY_CTR_FN(ks, aes_t4_set_encrypt_key, aes_t4_encrypt, ctr);
-    return 1;
-}
-
-static const PROV_GCM_HW t4_aes_gcm = {
-    t4_aes_gcm_initkey,
-    ossl_gcm_setiv,
-    ossl_gcm_aad_update,
-    generic_aes_gcm_cipher_update,
-    ossl_gcm_cipher_final,
-    ossl_gcm_one_shot
-};
-const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
-{
-    return SPARC_AES_CAPABLE ? &t4_aes_gcm : &aes_gcm;
-}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_vaes_avx512.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_vaes_avx512.inc
deleted file mode 100644
index c892c0754e8..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_vaes_avx512.inc
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright 2021-2022 The OpenSSL Project Authors. All Rights Reserved.
- * Copyright (c) 2021, Intel Corporation. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * AVX512 VAES + VPCLMULDQD support for AES GCM.
- * This file is included by cipher_aes_gcm_hw_aesni.inc
- */
-
-#undef VAES_GCM_ENABLED
-#if (defined(__x86_64) || defined(__x86_64__) || \
-     defined(_M_AMD64) || defined(_M_X64))
-# define VAES_GCM_ENABLED
-
-/* Returns non-zero when AVX512F + VAES + VPCLMULDQD combination is available */
-int ossl_vaes_vpclmulqdq_capable(void);
-
-# define OSSL_AES_GCM_UPDATE(direction)                                 \
-    void ossl_aes_gcm_ ## direction ## _avx512(const void *ks,          \
-                                               void *gcm128ctx,         \
-                                               unsigned int *pblocklen, \
-                                               const unsigned char *in, \
-                                               size_t len,              \
-                                               unsigned char *out);
-
-OSSL_AES_GCM_UPDATE(encrypt)
-OSSL_AES_GCM_UPDATE(decrypt)
-
-void ossl_aes_gcm_init_avx512(const void *ks, void *gcm128ctx);
-void ossl_aes_gcm_setiv_avx512(const void *ks, void *gcm128ctx,
-                               const unsigned char *iv, size_t ivlen);
-void ossl_aes_gcm_update_aad_avx512(void *gcm128ctx, const unsigned char *aad,
-                                    size_t aadlen);
-void ossl_aes_gcm_finalize_avx512(void *gcm128ctx, unsigned int pblocklen);
-
-void ossl_gcm_gmult_avx512(u64 Xi[2], const void *gcm128ctx);
-
-static int vaes_gcm_setkey(PROV_GCM_CTX *ctx, const unsigned char *key,
-                           size_t keylen)
-{
-    GCM128_CONTEXT *gcmctx = &ctx->gcm;
-    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
-    AES_KEY *ks = &actx->ks.ks;
-
-    aesni_set_encrypt_key(key, keylen * 8, ks);
-    memset(gcmctx, 0, sizeof(*gcmctx));
-    gcmctx->key = ks;
-    ctx->key_set = 1;
-
-    ossl_aes_gcm_init_avx512(ks, gcmctx);
-
-    return 1;
-}
-
-static int vaes_gcm_setiv(PROV_GCM_CTX *ctx, const unsigned char *iv,
-                          size_t ivlen)
-{
-    GCM128_CONTEXT *gcmctx = &ctx->gcm;
-
-    gcmctx->Yi.u[0] = 0;           /* Current counter */
-    gcmctx->Yi.u[1] = 0;
-    gcmctx->Xi.u[0] = 0;           /* AAD hash */
-    gcmctx->Xi.u[1] = 0;
-    gcmctx->len.u[0] = 0;          /* AAD length */
-    gcmctx->len.u[1] = 0;          /* Message length */
-    gcmctx->ares = 0;
-    gcmctx->mres = 0;
-
-    /* IV is limited by 2^64 bits, thus 2^61 bytes */
-    if (ivlen > (U64(1) << 61))
-        return 0;
-
-    ossl_aes_gcm_setiv_avx512(gcmctx->key, gcmctx, iv, ivlen);
-
-    return 1;
-}
-
-static int vaes_gcm_aadupdate(PROV_GCM_CTX *ctx,
-                              const unsigned char *aad,
-                              size_t aad_len)
-{
-    GCM128_CONTEXT *gcmctx = &ctx->gcm;
-    u64 alen = gcmctx->len.u[0];
-    unsigned int ares;
-    size_t i, lenBlks;
-
-    /* Bad sequence: call of AAD update after message processing */
-    if (gcmctx->len.u[1] > 0)
-        return 0;
-
-    alen += aad_len;
-    /* AAD is limited by 2^64 bits, thus 2^61 bytes */
-    if ((alen > (U64(1) << 61)) || (alen < aad_len))
-        return 0;
-
-    gcmctx->len.u[0] = alen;
-
-    ares = gcmctx->ares;
-    /* Partial AAD block left from previous AAD update calls */
-    if (ares > 0) {
-        /*
-         * Fill partial block buffer till full block
-         * (note, the hash is stored reflected)
-         */
-        while (ares > 0 && aad_len > 0) {
-            gcmctx->Xi.c[15 - ares] ^= *(aad++);
-            --aad_len;
-            ares = (ares + 1) % AES_BLOCK_SIZE;
-        }
-        /* Full block gathered */
-        if (ares == 0) {
-            ossl_gcm_gmult_avx512(gcmctx->Xi.u, gcmctx);
-        } else { /* no more AAD */
-            gcmctx->ares = ares;
-            return 1;
-        }
-    }
-
-    /* Bulk AAD processing */
-    lenBlks = aad_len & ((size_t)(-AES_BLOCK_SIZE));
-    if (lenBlks > 0) {
-        ossl_aes_gcm_update_aad_avx512(gcmctx, aad, lenBlks);
-        aad += lenBlks;
-        aad_len -= lenBlks;
-    }
-
-    /* Add remaining AAD to the hash (note, the hash is stored reflected) */
-    if (aad_len > 0) {
-        ares = aad_len;
-        for (i = 0; i < aad_len; i++)
-            gcmctx->Xi.c[15 - i] ^= aad[i];
-    }
-
-    gcmctx->ares = ares;
-
-    return 1;
-}
-
-static int vaes_gcm_cipherupdate(PROV_GCM_CTX *ctx, const unsigned char *in,
-                                 size_t len, unsigned char *out)
-{
-    GCM128_CONTEXT *gcmctx = &ctx->gcm;
-    u64 mlen = gcmctx->len.u[1];
-
-    mlen += len;
-    if (mlen > ((U64(1) << 36) - 32) || (mlen < len))
-        return 0;
-
-    gcmctx->len.u[1] = mlen;
-
-    /* Finalize GHASH(AAD) if AAD partial blocks left unprocessed */
-    if (gcmctx->ares > 0) {
-        ossl_gcm_gmult_avx512(gcmctx->Xi.u, gcmctx);
-        gcmctx->ares = 0;
-    }
-
-    if (ctx->enc)
-        ossl_aes_gcm_encrypt_avx512(gcmctx->key, gcmctx, &gcmctx->mres, in, len, out);
-    else
-        ossl_aes_gcm_decrypt_avx512(gcmctx->key, gcmctx, &gcmctx->mres, in, len, out);
-
-    return 1;
-}
-
-static int vaes_gcm_cipherfinal(PROV_GCM_CTX *ctx, unsigned char *tag)
-{
-    GCM128_CONTEXT *gcmctx = &ctx->gcm;
-    unsigned int *res = &gcmctx->mres;
-
-    /* Finalize AAD processing */
-    if (gcmctx->ares > 0)
-        res = &gcmctx->ares;
-
-    ossl_aes_gcm_finalize_avx512(gcmctx, *res);
-
-    if (ctx->enc) {
-        ctx->taglen = GCM_TAG_MAX_SIZE;
-        memcpy(tag, gcmctx->Xi.c,
-               ctx->taglen <= sizeof(gcmctx->Xi.c) ? ctx->taglen :
-               sizeof(gcmctx->Xi.c));
-        *res = 0;
-    } else {
-        return !CRYPTO_memcmp(gcmctx->Xi.c, tag, ctx->taglen);
-    }
-
-    return 1;
-}
-
-static const PROV_GCM_HW vaes_gcm = {
-    vaes_gcm_setkey,
-    vaes_gcm_setiv,
-    vaes_gcm_aadupdate,
-    vaes_gcm_cipherupdate,
-    vaes_gcm_cipherfinal,
-    ossl_gcm_one_shot
-};
-
-#endif
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv.c
index 484993e5a5e..ea343eb810c 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -21,6 +21,7 @@
 #include "prov/ciphercommon_aead.h"
 #include "prov/provider_ctx.h"
 #include "cipher_aes_gcm_siv.h"
+#include "providers/implementations/ciphers/cipher_aes_gcm_siv.inc"

 static int ossl_aes_gcm_siv_set_ctx_params(void *vctx, const OSSL_PARAM params[]);

@@ -175,77 +176,78 @@ static int ossl_aes_gcm_siv_stream_final(void *vctx, unsigned char *out, size_t
 static int ossl_aes_gcm_siv_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_AES_GCM_SIV_CTX *ctx = (PROV_AES_GCM_SIV_CTX *)vctx;
-    OSSL_PARAM *p;
+    struct ossl_aes_gcm_siv_get_ctx_params_st p;

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD_TAG);
-    if (p != NULL && p->data_type == OSSL_PARAM_OCTET_STRING) {
-        if (!ctx->enc || !ctx->generated_tag
-            || p->data_size != sizeof(ctx->tag)
-            || !OSSL_PARAM_set_octet_string(p, ctx->tag, sizeof(ctx->tag))) {
+    if (ctx == NULL || !ossl_aes_gcm_siv_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.tag != NULL && p.tag->data_type == OSSL_PARAM_OCTET_STRING) {
+        if (!ctx->enc || !ctx->generated_tag) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_SET);
+            return 0;
+        }
+        if (p.tag->data_size != sizeof(ctx->tag)
+            || !OSSL_PARAM_set_octet_string(p.tag, ctx->tag,
+                sizeof(ctx->tag))) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
             return 0;
         }
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD_TAGLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, sizeof(ctx->tag))) {
+
+    if (p.taglen != NULL && !OSSL_PARAM_set_size_t(p.taglen, sizeof(ctx->tag))) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->key_len)) {
+
+    if (p.keylen != NULL && !OSSL_PARAM_set_size_t(p.keylen, ctx->key_len)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
     return 1;
 }

-static const OSSL_PARAM aes_gcm_siv_known_gettable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_AEAD_TAGLEN, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TAG, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *ossl_aes_gcm_siv_gettable_ctx_params(ossl_unused void *cctx,
     ossl_unused void *provctx)
 {
-    return aes_gcm_siv_known_gettable_ctx_params;
+    return ossl_aes_gcm_siv_get_ctx_params_list;
 }

 static int ossl_aes_gcm_siv_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_AES_GCM_SIV_CTX *ctx = (PROV_AES_GCM_SIV_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct aes_gcm_siv_set_ctx_params_st p;
     unsigned int speed = 0;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !aes_gcm_siv_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_TAG);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING
-            || p->data_size != sizeof(ctx->user_tag)) {
+    if (p.tag != NULL) {
+        if (p.tag->data_type != OSSL_PARAM_OCTET_STRING
+            || p.tag->data_size != sizeof(ctx->user_tag)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
         if (!ctx->enc) {
-            memcpy(ctx->user_tag, p->data, sizeof(ctx->tag));
+            memcpy(ctx->user_tag, p.tag->data, sizeof(ctx->tag));
             ctx->have_user_tag = 1;
+        } else if (p.tag->data != NULL) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_NEEDED);
+            return 0;
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_SPEED);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_uint(p, &speed)) {
+
+    if (p.speed != NULL) {
+        if (!OSSL_PARAM_get_uint(p.speed, &speed)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
         ctx->speed = !!speed;
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL) {
+
+    if (p.keylen != NULL) {
         size_t key_len;

-        if (!OSSL_PARAM_get_size_t(p, &key_len)) {
+        if (!OSSL_PARAM_get_size_t(p.keylen, &key_len)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -258,16 +260,10 @@ static int ossl_aes_gcm_siv_set_ctx_params(void *vctx, const OSSL_PARAM params[]
     return 1;
 }

-static const OSSL_PARAM aes_gcm_siv_known_settable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_uint(OSSL_CIPHER_PARAM_SPEED, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TAG, NULL, 0),
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *ossl_aes_gcm_siv_settable_ctx_params(ossl_unused void *cctx,
     ossl_unused void *provctx)
 {
-    return aes_gcm_siv_known_settable_ctx_params;
+    return aes_gcm_siv_set_ctx_params_list;
 }

 #define IMPLEMENT_cipher(alg, lc, UCMODE, flags, kbits, blkbits, ivbits)                                   \
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv.h
index dbee05bedac..e6842bb8923 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_GCM_SIV_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_GCM_SIV_H
+
 #include <openssl/aes.h>
 #include "prov/ciphercommon.h"
 #include "crypto/aes_platform.h"
@@ -74,3 +77,5 @@ static ossl_inline uint64_t GSWAP8(uint64_t n)
     result <<= 32;
     return result | GSWAP4(n >> 32);
 }
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_GCM_SIV_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv.inc.in
new file mode 100644
index 00000000000..891d3b976d0
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv.inc.in
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ossl_aes_gcm_siv_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',      'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAG',    'tag',    'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('aes_gcm_siv_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',      'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_SPEED',       'speed',  'uint'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAG',    'tag',    'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv_hw.c
index c1079e0e787..d387973894d 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv_hw.c
@@ -15,6 +15,7 @@
 #include "internal/deprecated.h"

 #include <openssl/evp.h>
+#include <openssl/proverr.h>
 #include <internal/endian.h>
 #include <prov/implementations.h>
 #include "cipher_aes_gcm_siv.h"
@@ -151,8 +152,6 @@ static int aes_gcm_siv_encrypt(PROV_AES_GCM_SIV_CTX *ctx, const unsigned char *i
     DECLARE_IS_ENDIAN;

     ctx->generated_tag = 0;
-    if (!ctx->speed && ctx->used_enc)
-        return 0;
     /* need to check the size of the input! */
     if (len64 > ((int64_t)1 << 36))
         return 0;
@@ -172,7 +171,7 @@ static int aes_gcm_siv_encrypt(PROV_AES_GCM_SIV_CTX *ctx, const unsigned char *i
         ossl_polyval_ghash_hash(ctx->Htable, S_s, ctx->aad, UP16(ctx->aad_len));
     }
     if (DOWN16(len) > 0)
-        ossl_polyval_ghash_hash(ctx->Htable, S_s, (uint8_t *)in, DOWN16(len));
+        ossl_polyval_ghash_hash(ctx->Htable, S_s, in, DOWN16(len));
     if (!IS16(len)) {
         /* deal with padding - probably easier to memset the padding first rather than calculate */
         memset(padding, 0, sizeof(padding));
@@ -212,8 +211,6 @@ static int aes_gcm_siv_decrypt(PROV_AES_GCM_SIV_CTX *ctx, const unsigned char *i
     DECLARE_IS_ENDIAN;

     ctx->generated_tag = 0;
-    if (!ctx->speed && ctx->used_dec)
-        return 0;
     /* need to check the size of the input! */
     if (len64 > ((int64_t)1 << 36))
         return 0;
@@ -268,7 +265,10 @@ static int aes_gcm_siv_finish(PROV_AES_GCM_SIV_CTX *ctx)
     int ret = 0;

     if (ctx->enc) {
-        /* Generate the tag when Final is the first empty-message operation. */
+        /*
+         * generate the tag on FINAL so an init/final with no update
+         * (an empty message) still produces it, matching the other AEADs
+         */
         if (ctx->generated_tag == 0
             && aes_gcm_siv_encrypt(ctx, NULL, NULL, 0) == 0)
             return 0;
@@ -279,6 +279,8 @@ static int aes_gcm_siv_finish(PROV_AES_GCM_SIV_CTX *ctx)
         return 0;
     ret = CRYPTO_memcmp(ctx->tag, ctx->user_tag, sizeof(ctx->tag)) == 0;
     ret &= ctx->have_user_tag;
+    if (ret == 0 && ctx->have_user_tag)
+        ERR_raise(ERR_LIB_PROV, PROV_R_BAD_DECRYPT);
     return ret;
 }

@@ -291,6 +293,18 @@ static int aes_gcm_siv_cipher(void *vctx, unsigned char *out,
     if (in == NULL)
         return aes_gcm_siv_finish(ctx);

+    /*
+     * SIV derives the CTR IV from the tag, which depends on the whole plaintext,
+     * so the payload cannot be streamed.
+     * Payload must arrive in a single update, after which the tag is fixed.
+     * Any later AAD or payload update is therefore out of order and errors out.
+     * The speed benchmark test is exempt.
+     */
+    if (!ctx->speed && (ctx->used_enc || ctx->used_dec)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_UPDATE_CALL_OUT_OF_ORDER);
+        return 0;
+    }
+
     /* Deal with associated data */
     if (out == NULL)
         return aes_gcm_siv_aad(ctx, in, len);
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv_polyval.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv_polyval.c
index 5c9988cabf2..6c7a717eb18 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv_polyval.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_siv_polyval.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -71,7 +71,7 @@ void ossl_polyval_ghash_init(u128 Htable[16], const uint64_t H[2])
         tmp[1] = GSWAP8(tmp[1]);
     }

-    ossl_gcm_init_4bit(Htable, (u64 *)tmp);
+    ossl_gcm_init_4bit(Htable, (uint64_t *)tmp);
 }

 /* Implementation of POLYVAL via existing GHASH implementation */
@@ -89,7 +89,7 @@ void ossl_polyval_ghash_hash(const u128 Htable[16], uint8_t *tag, const uint8_t
      */
     for (i = 0; i < len; i += 16) {
         byte_reverse16((uint8_t *)tmp, &inp[i]);
-        ossl_gcm_ghash_4bit((u64 *)out, Htable, (uint8_t *)tmp, 16);
+        ossl_gcm_ghash_4bit((uint64_t *)out, Htable, (uint8_t *)tmp, 16);
     }
     byte_reverse16(tag, (uint8_t *)out);
 }
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw.c
index 635b465a5e5..03ddb469471 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -16,152 +16,273 @@
 #include <openssl/proverr.h>
 #include "cipher_aes.h"

-static int cipher_hw_aes_initkey(PROV_CIPHER_CTX *dat,
-    const unsigned char *key, size_t keylen)
+int ossl_cipher_set_aes_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen,
+    aes_set_encrypt_key_fn fn_set_key, aes_block128_f fn_block,
+    ecb128_f fn_ecb, cbc128_f fn_cbc, ctr128_f fn_ctr)
 {
-    int ret;
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-    AES_KEY *ks = &adat->ks.ks;
+    PROV_AES_CTX *actx = (PROV_AES_CTX *)ctx;
+    AES_KEY *ks = &actx->ks.ks;

-    dat->ks = ks;
+    int ret = fn_set_key(key, (int)(keylen * 8), ks);
+    if (ret < 0) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
+        return 0;
+    }
+    ctx->ks = ks;
+
+    ctx->block = (block128_f)fn_block;
+
+    switch (ctx->mode) {
+    case EVP_CIPH_ECB_MODE:
+        ctx->stream.ecb = fn_ecb;
+        break;
+    case EVP_CIPH_CBC_MODE:
+        ctx->stream.cbc = fn_cbc;
+        break;
+    case EVP_CIPH_CTR_MODE:
+        ctx->stream.ctr = fn_ctr;
+        break;
+    default:
+        memset(&ctx->stream, 0, sizeof(ctx->stream));
+        break;
+    }
+
+    return 1;
+}

-    if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
-        && !dat->enc) {
 #ifdef HWAES_CAPABLE
-        if (HWAES_CAPABLE) {
-            ret = HWAES_set_decrypt_key(key, keylen * 8, ks);
-            dat->block = (block128_f)HWAES_decrypt;
-            dat->stream.cbc = NULL;
-#ifdef HWAES_cbc_encrypt
-            if (dat->mode == EVP_CIPH_CBC_MODE)
-                dat->stream.cbc = (cbc128_f)HWAES_cbc_encrypt;
-#endif
+static int hwaes_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    if (HWAES_CAPABLE) {
+        ecb128_f fn_ecb = NULL;
+        cbc128_f fn_cbc = NULL;
+        ctr128_f fn_ctr = NULL;
 #ifdef HWAES_ecb_encrypt
-            if (dat->mode == EVP_CIPH_ECB_MODE)
-                dat->stream.ecb = (ecb128_f)HWAES_ecb_encrypt;
+        fn_ecb = (ecb128_f)HWAES_ecb_encrypt;
 #endif
-        } else
+#ifdef HWAES_cbc_encrypt
+        fn_cbc = (cbc128_f)HWAES_cbc_encrypt;
 #endif
-#ifdef BSAES_CAPABLE
-            if (BSAES_CAPABLE && dat->mode == EVP_CIPH_CBC_MODE) {
-            ret = AES_set_decrypt_key(key, keylen * 8, ks);
-            dat->block = (block128_f)AES_decrypt;
-            dat->stream.cbc = (cbc128_f)ossl_bsaes_cbc_encrypt;
-        } else
+#ifdef HWAES_ctr32_encrypt_blocks
+        fn_ctr = (ctr128_f)HWAES_ctr32_encrypt_blocks;
 #endif
+        if ((ctx->mode == EVP_CIPH_ECB_MODE || ctx->mode == EVP_CIPH_CBC_MODE)
+            && !ctx->enc)
+            return ossl_cipher_set_aes_initkey(ctx, key, keylen,
+                HWAES_set_decrypt_key, HWAES_decrypt, fn_ecb, fn_cbc, fn_ctr);
+        else
+            return ossl_cipher_set_aes_initkey(ctx, key, keylen,
+                HWAES_set_encrypt_key, HWAES_encrypt, fn_ecb, fn_cbc, fn_ctr);
+    }
+    return -1;
+}
+#endif /* HWAES_CAPABLE */
+
+#ifdef BSAES_CAPABLE
+static int bsaes_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    if (BSAES_CAPABLE) {
+        if (ctx->mode == EVP_CIPH_CBC_MODE && !ctx->enc)
+            return ossl_cipher_set_aes_initkey(ctx, key, keylen,
+                AES_set_decrypt_key, AES_decrypt, NULL,
+                (cbc128_f)ossl_bsaes_cbc_encrypt, NULL);
+        else if (ctx->mode == EVP_CIPH_CTR_MODE)
+            return ossl_cipher_set_aes_initkey(ctx, key, keylen,
+                AES_set_encrypt_key, AES_encrypt, NULL, NULL,
+                (ctr128_f)ossl_bsaes_ctr32_encrypt_blocks);
+    }
+    return -1;
+}
+#endif /* BSAES_CAPABLE */
+
 #ifdef VPAES_CAPABLE
-            if (VPAES_CAPABLE) {
-            ret = vpaes_set_decrypt_key(key, keylen * 8, ks);
-            dat->block = (block128_f)vpaes_decrypt;
-            dat->stream.cbc = (dat->mode == EVP_CIPH_CBC_MODE)
-                ? (cbc128_f)vpaes_cbc_encrypt
-                : NULL;
-        } else
-#endif
-        {
-            ret = AES_set_decrypt_key(key, keylen * 8, ks);
-            dat->block = (block128_f)AES_decrypt;
-            dat->stream.cbc = (dat->mode == EVP_CIPH_CBC_MODE)
-                ? (cbc128_f)AES_cbc_encrypt
-                : NULL;
+static int vpaes_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    if (VPAES_CAPABLE) {
+        if ((ctx->mode == EVP_CIPH_ECB_MODE || ctx->mode == EVP_CIPH_CBC_MODE)
+            && !ctx->enc) {
+            return ossl_cipher_set_aes_initkey(ctx, key, keylen,
+                vpaes_set_decrypt_key, vpaes_decrypt, NULL,
+                (cbc128_f)vpaes_cbc_encrypt, NULL);
+        } else {
+            return ossl_cipher_set_aes_initkey(ctx, key, keylen,
+                vpaes_set_encrypt_key, vpaes_encrypt, NULL,
+                (cbc128_f)vpaes_cbc_encrypt, NULL);
         }
-    } else
+    }
+    return -1;
+}
+#endif /* VPAES_CAPABLE */
+
+int ossl_cipher_hw_aes_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    int ret = 0;
+
 #ifdef HWAES_CAPABLE
-        if (HWAES_CAPABLE) {
-        ret = HWAES_set_encrypt_key(key, keylen * 8, ks);
-        dat->block = (block128_f)HWAES_encrypt;
-        dat->stream.cbc = NULL;
-#ifdef HWAES_cbc_encrypt
-        if (dat->mode == EVP_CIPH_CBC_MODE)
-            dat->stream.cbc = (cbc128_f)HWAES_cbc_encrypt;
-        else
-#endif
-#ifdef HWAES_ecb_encrypt
-            if (dat->mode == EVP_CIPH_ECB_MODE)
-            dat->stream.ecb = (ecb128_f)HWAES_ecb_encrypt;
-        else
-#endif
-#ifdef HWAES_ctr32_encrypt_blocks
-            if (dat->mode == EVP_CIPH_CTR_MODE)
-            dat->stream.ctr = (ctr128_f)HWAES_ctr32_encrypt_blocks;
-        else
-#endif
-            (void)0; /* terminate potentially open 'else' */
-    } else
+    ret = hwaes_initkey(ctx, key, keylen);
+    if (ret >= 0)
+        return ret;
 #endif
+
 #ifdef BSAES_CAPABLE
-        if (BSAES_CAPABLE && dat->mode == EVP_CIPH_CTR_MODE) {
-        ret = AES_set_encrypt_key(key, keylen * 8, ks);
-        dat->block = (block128_f)AES_encrypt;
-        dat->stream.ctr = (ctr128_f)ossl_bsaes_ctr32_encrypt_blocks;
-    } else
+    ret = bsaes_initkey(ctx, key, keylen);
+    if (ret >= 0)
+        return ret;
 #endif
+
 #ifdef VPAES_CAPABLE
-        if (VPAES_CAPABLE) {
-        ret = vpaes_set_encrypt_key(key, keylen * 8, ks);
-        dat->block = (block128_f)vpaes_encrypt;
-        dat->stream.cbc = (dat->mode == EVP_CIPH_CBC_MODE)
-            ? (cbc128_f)vpaes_cbc_encrypt
-            : NULL;
-    } else
+    ret = vpaes_initkey(ctx, key, keylen);
+    if (ret >= 0)
+        return ret;
 #endif
-    {
-        ret = AES_set_encrypt_key(key, keylen * 8, ks);
-        dat->block = (block128_f)AES_encrypt;
-        dat->stream.cbc = (dat->mode == EVP_CIPH_CBC_MODE)
-            ? (cbc128_f)AES_cbc_encrypt
-            : NULL;
+
+    if ((ctx->mode == EVP_CIPH_ECB_MODE || ctx->mode == EVP_CIPH_CBC_MODE)
+        && !ctx->enc) {
+        ret = ossl_cipher_set_aes_initkey(ctx, key, keylen,
+            AES_set_decrypt_key, AES_decrypt, NULL, (cbc128_f)AES_cbc_encrypt,
+            NULL);
+    } else {
+        ctr128_f fn_ctr = NULL;
 #ifdef AES_CTR_ASM
-        if (dat->mode == EVP_CIPH_CTR_MODE)
-            dat->stream.ctr = (ctr128_f)AES_ctr32_encrypt;
+        fn_ctr = (ctr128_f)AES_ctr32_encrypt;
 #endif
+        ret = ossl_cipher_set_aes_initkey(ctx, key, keylen,
+            AES_set_encrypt_key, AES_encrypt, NULL, (cbc128_f)AES_cbc_encrypt,
+            fn_ctr);
     }

-    if (ret < 0) {
-        ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
-        return 0;
-    }
+    return ret;
+}

-    return 1;
+void ossl_cipher_aes_copyctx(PROV_CIPHER_CTX *dst,
+    const PROV_CIPHER_CTX *src)
+{
+    PROV_AES_CTX *sctx = (PROV_AES_CTX *)src;
+    PROV_AES_CTX *dctx = (PROV_AES_CTX *)dst;
+
+    *dctx = *sctx;
+    dst->ks = &dctx->ks.ks;
 }

-IMPLEMENT_CIPHER_HW_COPYCTX(cipher_hw_aes_copyctx, PROV_AES_CTX)
-
-#define PROV_CIPHER_HW_aes_mode(mode)                   \
-    static const PROV_CIPHER_HW aes_##mode = {          \
-        cipher_hw_aes_initkey,                          \
-        ossl_cipher_hw_generic_##mode,                  \
-        cipher_hw_aes_copyctx                           \
-    };                                                  \
-    PROV_CIPHER_HW_declare(mode)                        \
-        const PROV_CIPHER_HW *                          \
-        ossl_prov_cipher_hw_aes_##mode(size_t keybits)  \
-    {                                                   \
-        PROV_CIPHER_HW_select(mode) return &aes_##mode; \
-    }
+static const PROV_CIPHER_HW aes_ecb = {
+    ossl_cipher_hw_aes_initkey,
+    ossl_cipher_hw_generic_ecb,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aes_cbc = {
+    ossl_cipher_hw_aes_initkey,
+    ossl_cipher_hw_generic_cbc,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aes_cfb128 = {
+    ossl_cipher_hw_aes_initkey,
+    ossl_cipher_hw_generic_cfb128,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aes_cfb8 = {
+    ossl_cipher_hw_aes_initkey,
+    ossl_cipher_hw_generic_cfb8,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aes_cfb1 = {
+    ossl_cipher_hw_aes_initkey,
+    ossl_cipher_hw_generic_cfb1,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aes_ofb128 = {
+    ossl_cipher_hw_aes_initkey,
+    ossl_cipher_hw_generic_ofb128,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aes_ctr = {
+    ossl_cipher_hw_aes_initkey,
+    ossl_cipher_hw_generic_ctr,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_mode(enum aes_modes mode,
+    size_t keybits)
+{
+    const PROV_CIPHER_HW *aes_hw_mode = NULL;

 #if defined(AESNI_CAPABLE)
-#include "cipher_aes_hw_aesni.inc"
-#elif defined(SPARC_AES_CAPABLE)
-#include "cipher_aes_hw_t4.inc"
-#elif defined(S390X_aes_128_CAPABLE)
-#include "cipher_aes_hw_s390x.inc"
-#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
-#include "cipher_aes_hw_rv64i.inc"
-#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
-#include "cipher_aes_hw_rv32i.inc"
+    aes_hw_mode = ossl_prov_cipher_hw_aesni(mode);
 #elif defined(ARMv8_HWAES_CAPABLE)
-#include "cipher_aes_hw_armv8.inc"
-#else
-/* The generic case */
-#define PROV_CIPHER_HW_declare(mode)
-#define PROV_CIPHER_HW_select(mode)
+    aes_hw_mode = ossl_prov_cipher_hw_arm(mode);
+#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
+    aes_hw_mode = ossl_prov_cipher_hw_rv32i(mode);
+#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
+    aes_hw_mode = ossl_prov_cipher_hw_rv64i(mode);
+#elif defined(S390X_aes_128_CAPABLE)
+    aes_hw_mode = ossl_prov_cipher_hw_s390x(mode, keybits);
+#elif defined(SPARC_AES_CAPABLE)
+    aes_hw_mode = ossl_prov_cipher_hw_t4(mode);
 #endif

-PROV_CIPHER_HW_aes_mode(cbc)
-    PROV_CIPHER_HW_aes_mode(ecb)
-        PROV_CIPHER_HW_aes_mode(ofb128)
-            PROV_CIPHER_HW_aes_mode(cfb128)
-                PROV_CIPHER_HW_aes_mode(cfb1)
-                    PROV_CIPHER_HW_aes_mode(cfb8)
-                        PROV_CIPHER_HW_aes_mode(ctr)
+    if (aes_hw_mode == NULL) {
+        switch (mode) {
+        case AES_MODE_ECB:
+            return &aes_ecb;
+        case AES_MODE_CBC:
+            return &aes_cbc;
+        case AES_MODE_CFB128:
+            return &aes_cfb128;
+        case AES_MODE_CFB8:
+            return &aes_cfb8;
+        case AES_MODE_CFB1:
+            return &aes_cfb1;
+        case AES_MODE_OFB128:
+            return &aes_ofb128;
+        case AES_MODE_CTR:
+            return &aes_ctr;
+        }
+    }
+
+    return aes_hw_mode;
+}
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ecb(size_t keybits)
+{
+    return ossl_prov_cipher_hw_aes_mode(AES_MODE_ECB, keybits);
+}
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cbc(size_t keybits)
+{
+    return ossl_prov_cipher_hw_aes_mode(AES_MODE_CBC, keybits);
+}
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb128(size_t keybits)
+{
+    return ossl_prov_cipher_hw_aes_mode(AES_MODE_CFB128, keybits);
+}
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb8(size_t keybits)
+{
+    return ossl_prov_cipher_hw_aes_mode(AES_MODE_CFB8, keybits);
+}
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb1(size_t keybits)
+{
+    return ossl_prov_cipher_hw_aes_mode(AES_MODE_CFB1, keybits);
+}
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ofb128(size_t keybits)
+{
+    return ossl_prov_cipher_hw_aes_mode(AES_MODE_OFB128, keybits);
+}
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ctr(size_t keybits)
+{
+    return ossl_prov_cipher_hw_aes_mode(AES_MODE_CTR, keybits);
+}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_aesni.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_aesni.c
new file mode 100644
index 00000000000..d98e3ba5b97
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_aesni.c
@@ -0,0 +1,499 @@
+/*
+ * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*-
+ * AES-NI support for all hardware accelerated AES modes.
+ */
+
+#include "internal/deprecated.h"
+#include "cipher_aes.h"
+#include "cipher_aes_gcm.h"
+#include "cipher_aes_ccm.h"
+#include "cipher_aes_xts.h"
+
+#if defined(AESNI_CAPABLE)
+
+/* MODES: ecb, cbc, cfb, ofb, ctr */
+
+/* generates AES round keys for AES-NI and VAES implementations */
+static int cipher_hw_aesni_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    if ((ctx->mode == EVP_CIPH_ECB_MODE || ctx->mode == EVP_CIPH_CBC_MODE)
+        && !ctx->enc) {
+        return ossl_cipher_set_aes_initkey(ctx, key, keylen,
+            aesni_set_decrypt_key, aesni_decrypt, NULL,
+            (cbc128_f)aesni_cbc_encrypt, NULL);
+    } else {
+        return ossl_cipher_set_aes_initkey(ctx, key, keylen,
+            aesni_set_encrypt_key, aesni_encrypt, NULL,
+            (cbc128_f)aesni_cbc_encrypt, (ctr128_f)aesni_ctr32_encrypt_blocks);
+    }
+}
+
+static int cipher_hw_aesni_ecb(PROV_CIPHER_CTX *ctx, unsigned char *out,
+    const unsigned char *in, size_t len)
+{
+    if (len < ctx->blocksize)
+        return 1;
+
+    aesni_ecb_encrypt(in, out, len, ctx->ks, ctx->enc);
+
+    return 1;
+}
+
+static const PROV_CIPHER_HW aesni_ecb = {
+    cipher_hw_aesni_initkey,
+    cipher_hw_aesni_ecb,
+    ossl_cipher_aes_copyctx
+};
+
+static int cipher_hw_aesni_cbc(PROV_CIPHER_CTX *ctx, unsigned char *out,
+    const unsigned char *in, size_t len)
+{
+    aesni_cbc_encrypt(in, out, len, ctx->ks, ctx->iv, ctx->enc);
+
+    return 1;
+}
+
+static const PROV_CIPHER_HW aesni_cbc = {
+    cipher_hw_aesni_initkey,
+    cipher_hw_aesni_cbc,
+    ossl_cipher_aes_copyctx
+};
+
+#if VAES_CBC_ELIGIBLE
+/*
+ * CBC decryption is fully parallel, so VAES accelerates it; CBC encryption is
+ * inherently serial and stays on the aesni_cbc_encrypt assembly routine.  VAES
+ * is only worthwhile once the payload is large enough to amortize the per-call
+ * key broadcast, so small buffers also fall back to the assembly routine.
+ */
+static int aes_cbc_vaes_wrapper(
+    PROV_CIPHER_CTX *ctx,
+    unsigned char *out,
+    const unsigned char *in,
+    size_t len)
+{
+    if (!ctx->enc && len >= 256) {
+        ossl_aes_cbc_vaes_decrypt(in, out, len, ctx->ks, ctx->iv, ctx->enc);
+        return 1;
+    }
+
+    aesni_cbc_encrypt(in, out, len, ctx->ks, ctx->iv, ctx->enc);
+    return 1;
+}
+
+static const PROV_CIPHER_HW aesni_vaes_cbc = {
+    cipher_hw_aesni_initkey,
+    aes_cbc_vaes_wrapper,
+    ossl_cipher_aes_copyctx
+};
+#endif /* VAES_CBC_ELIGIBLE */
+
+#if (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
+/* active in 64-bit builds when AES-NI, AVX512F, and VAES are detected */
+#define VAES_CFB128_ELIGIBLE 1
+#else
+#define VAES_CFB128_ELIGIBLE 0
+#endif
+
+#if VAES_CFB128_ELIGIBLE
+static int aes_cfb128_vaes_encdec_wrapper(
+    PROV_CIPHER_CTX *ctx,
+    unsigned char *out,
+    const unsigned char *in,
+    size_t len)
+{
+    ossl_ssize_t num;
+
+    num = (ossl_ssize_t)ctx->num;
+
+    if (num < 0) {
+        /* behavior from CRYPTO_cfb128_encrypt */
+        ctx->num = -1;
+        return 1;
+    }
+
+    if (ctx->enc)
+        ossl_aes_cfb128_vaes_enc(in, out, len, ctx->ks, ctx->iv, &num);
+    else
+        ossl_aes_cfb128_vaes_dec(in, out, len, ctx->ks, ctx->iv, &num);
+
+    ctx->num = (int)num;
+
+    return 1;
+}
+
+static const PROV_CIPHER_HW aesni_vaes_cfb128 = {
+    cipher_hw_aesni_initkey,
+    aes_cfb128_vaes_encdec_wrapper,
+    ossl_cipher_aes_copyctx
+};
+#endif /* VAES_CFB128_ELIGIBLE */
+
+static const PROV_CIPHER_HW aesni_cfb128 = {
+    cipher_hw_aesni_initkey,
+    ossl_cipher_hw_generic_cfb128,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aesni_cfb8 = {
+    cipher_hw_aesni_initkey,
+    ossl_cipher_hw_generic_cfb8,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aesni_cfb1 = {
+    cipher_hw_aesni_initkey,
+    ossl_cipher_hw_generic_cfb1,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aesni_ofb128 = {
+    cipher_hw_aesni_initkey,
+    ossl_cipher_hw_generic_ofb128,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aesni_ctr = {
+    cipher_hw_aesni_initkey,
+    ossl_cipher_hw_generic_ctr,
+    ossl_cipher_aes_copyctx
+};
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aesni(enum aes_modes mode)
+{
+    if (AESNI_CAPABLE) {
+        switch (mode) {
+        case AES_MODE_ECB:
+            return &aesni_ecb;
+        case AES_MODE_CBC:
+#if VAES_CBC_ELIGIBLE
+            if (ossl_aes_cbc_vaes_eligible())
+                return &aesni_vaes_cbc;
+#endif
+            return &aesni_cbc;
+        case AES_MODE_CFB128:
+#if VAES_CFB128_ELIGIBLE
+            if (ossl_aes_cfb128_vaes_eligible())
+                return &aesni_vaes_cfb128;
+#endif
+            return &aesni_cfb128;
+        case AES_MODE_CFB8:
+            return &aesni_cfb8;
+        case AES_MODE_CFB1:
+            return &aesni_cfb1;
+        case AES_MODE_OFB128:
+            return &aesni_ofb128;
+        case AES_MODE_CTR:
+            return &aesni_ctr;
+        default:
+            return NULL;
+        }
+    }
+    return NULL;
+}
+
+/* MODES: GCM */
+
+static int aesni_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
+    size_t keylen)
+{
+    return ossl_aes_gcm_hw_initkey(ctx, key, keylen, aesni_set_encrypt_key,
+        aesni_encrypt, aesni_ctr32_encrypt_blocks);
+}
+
+static const PROV_GCM_HW aesni_gcm = {
+    aesni_gcm_initkey,
+    ossl_gcm_setiv,
+    ossl_gcm_aad_update,
+    ossl_generic_aes_gcm_cipher_update,
+    ossl_gcm_cipher_final,
+    ossl_gcm_one_shot
+};
+
+/*-
+ * AVX512 VAES + VPCLMULDQD support for AES GCM.
+ */
+
+#undef VAES_GCM_ENABLED
+#if (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
+#define VAES_GCM_ENABLED
+
+/* Returns non-zero when AVX512F + VAES + VPCLMULDQD combination is available */
+int ossl_vaes_vpclmulqdq_capable(void);
+
+void ossl_aes_gcm_encrypt_avx512(const void *ks, void *gcm128ctx,
+    unsigned int *pblocklen, const unsigned char *in, size_t len,
+    unsigned char *out);
+void ossl_aes_gcm_decrypt_avx512(const void *ks, void *gcm128ctx,
+    unsigned int *pblocklen, const unsigned char *in, size_t len,
+    unsigned char *out);
+
+void ossl_aes_gcm_init_avx512(const void *ks, void *gcm128ctx);
+void ossl_aes_gcm_setiv_avx512(const void *ks, void *gcm128ctx,
+    const unsigned char *iv, size_t ivlen);
+void ossl_aes_gcm_update_aad_avx512(void *gcm128ctx, const unsigned char *aad,
+    size_t aadlen);
+void ossl_aes_gcm_finalize_avx512(void *gcm128ctx, unsigned int pblocklen);
+
+void ossl_gcm_gmult_avx512(uint64_t Xi[2], const void *gcm128ctx);
+
+static int vaes_gcm_setkey(PROV_GCM_CTX *ctx, const unsigned char *key,
+    size_t keylen)
+{
+    GCM128_CONTEXT *gcmctx = &ctx->gcm;
+    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
+    AES_KEY *ks = &actx->ks.ks;
+
+    aesni_set_encrypt_key(key, (int)(keylen * 8), ks);
+    memset(gcmctx, 0, sizeof(*gcmctx));
+    gcmctx->key = ks;
+    ctx->key_set = 1;
+
+    ossl_aes_gcm_init_avx512(ks, gcmctx);
+
+    return 1;
+}
+
+static int vaes_gcm_setiv(PROV_GCM_CTX *ctx, const unsigned char *iv,
+    size_t ivlen)
+{
+    GCM128_CONTEXT *gcmctx = &ctx->gcm;
+
+    gcmctx->Yi.u[0] = 0; /* Current counter */
+    gcmctx->Yi.u[1] = 0;
+    gcmctx->Xi.u[0] = 0; /* AAD hash */
+    gcmctx->Xi.u[1] = 0;
+    gcmctx->len.u[0] = 0; /* AAD length */
+    gcmctx->len.u[1] = 0; /* Message length */
+    gcmctx->ares = 0;
+    gcmctx->mres = 0;
+
+    /* IV is limited by 2^64 bits, thus 2^61 bytes */
+#if SIZE_MAX > 0xFFFFFFFFu
+    if (ivlen > (U64(1) << 61))
+        return 0;
+#endif
+
+    ossl_aes_gcm_setiv_avx512(gcmctx->key, gcmctx, iv, ivlen);
+
+    return 1;
+}
+
+static int vaes_gcm_aadupdate(PROV_GCM_CTX *ctx,
+    const unsigned char *aad,
+    size_t aad_len)
+{
+    GCM128_CONTEXT *gcmctx = &ctx->gcm;
+    uint64_t alen = gcmctx->len.u[0];
+    unsigned int ares;
+    size_t i, lenBlks;
+
+    /* Bad sequence: call of AAD update after message processing */
+    if (gcmctx->len.u[1] > 0)
+        return 0;
+
+    alen += aad_len;
+    /* AAD is limited by 2^64 bits, thus 2^61 bytes */
+    if ((alen > (U64(1) << 61)) || (alen < aad_len))
+        return 0;
+
+    gcmctx->len.u[0] = alen;
+
+    ares = gcmctx->ares;
+    /* Partial AAD block left from previous AAD update calls */
+    if (ares > 0) {
+        /*
+         * Fill partial block buffer till full block
+         * (note, the hash is stored reflected)
+         */
+        while (ares > 0 && aad_len > 0) {
+            gcmctx->Xi.c[15 - ares] ^= *(aad++);
+            --aad_len;
+            ares = (ares + 1) % AES_BLOCK_SIZE;
+        }
+        /* Full block gathered */
+        if (ares == 0) {
+            ossl_gcm_gmult_avx512(gcmctx->Xi.u, gcmctx);
+        } else { /* no more AAD */
+            gcmctx->ares = ares;
+            return 1;
+        }
+    }
+
+    /* Bulk AAD processing */
+    lenBlks = aad_len & ((size_t)(-AES_BLOCK_SIZE));
+    if (lenBlks > 0) {
+        ossl_aes_gcm_update_aad_avx512(gcmctx, aad, lenBlks);
+        aad += lenBlks;
+        aad_len -= lenBlks;
+    }
+
+    /* Add remaining AAD to the hash (note, the hash is stored reflected) */
+    if (aad_len > 0) {
+        ares = (unsigned int)aad_len;
+        for (i = 0; i < aad_len; i++)
+            gcmctx->Xi.c[15 - i] ^= aad[i];
+    }
+
+    gcmctx->ares = ares;
+
+    return 1;
+}
+
+static int vaes_gcm_cipherupdate(PROV_GCM_CTX *ctx, const unsigned char *in,
+    size_t len, unsigned char *out)
+{
+    GCM128_CONTEXT *gcmctx = &ctx->gcm;
+    uint64_t mlen = gcmctx->len.u[1];
+
+    mlen += len;
+    if (mlen > ((U64(1) << 36) - 32) || (mlen < len))
+        return 0;
+
+    gcmctx->len.u[1] = mlen;
+
+    /* Finalize GHASH(AAD) if AAD partial blocks left unprocessed */
+    if (gcmctx->ares > 0) {
+        ossl_gcm_gmult_avx512(gcmctx->Xi.u, gcmctx);
+        gcmctx->ares = 0;
+    }
+
+    if (ctx->enc)
+        ossl_aes_gcm_encrypt_avx512(gcmctx->key, gcmctx, &gcmctx->mres, in, len, out);
+    else
+        ossl_aes_gcm_decrypt_avx512(gcmctx->key, gcmctx, &gcmctx->mres, in, len, out);
+
+    return 1;
+}
+
+static int vaes_gcm_cipherfinal(PROV_GCM_CTX *ctx, unsigned char *tag)
+{
+    GCM128_CONTEXT *gcmctx = &ctx->gcm;
+    unsigned int *res = &gcmctx->mres;
+
+    /* Finalize AAD processing */
+    if (gcmctx->ares > 0)
+        res = &gcmctx->ares;
+
+    ossl_aes_gcm_finalize_avx512(gcmctx, *res);
+
+    if (ctx->enc) {
+        ctx->taglen = GCM_TAG_MAX_SIZE;
+        memcpy(tag, gcmctx->Xi.c,
+            ctx->taglen <= sizeof(gcmctx->Xi.c) ? ctx->taglen : sizeof(gcmctx->Xi.c));
+        *res = 0;
+    } else {
+        return !CRYPTO_memcmp(gcmctx->Xi.c, tag, ctx->taglen);
+    }
+
+    return 1;
+}
+
+static const PROV_GCM_HW vaes_gcm = {
+    vaes_gcm_setkey,
+    vaes_gcm_setiv,
+    vaes_gcm_aadupdate,
+    vaes_gcm_cipherupdate,
+    vaes_gcm_cipherfinal,
+    ossl_gcm_one_shot
+};
+
+#endif
+
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_aesni(void)
+{
+#ifdef VAES_GCM_ENABLED
+    if (ossl_vaes_vpclmulqdq_capable())
+        return &vaes_gcm;
+#endif
+    if (AESNI_CAPABLE)
+        return &aesni_gcm;
+
+    return NULL;
+}
+
+/* MODES: CCM */
+
+static int ccm_aesni_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
+    size_t keylen)
+{
+    return ossl_cipher_set_ccm_aes_initkey(ctx, key, keylen,
+        aesni_set_encrypt_key, aesni_encrypt, aesni_ccm64_encrypt_blocks,
+        aesni_ccm64_decrypt_blocks);
+}
+
+static const PROV_CCM_HW aesni_ccm = {
+    ccm_aesni_initkey,
+    ossl_ccm_generic_setiv,
+    ossl_ccm_generic_setaad,
+    ossl_ccm_generic_auth_encrypt,
+    ossl_ccm_generic_auth_decrypt,
+    ossl_ccm_generic_gettag
+};
+
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm_aesni(void)
+{
+    if (AESNI_CAPABLE)
+        return &aesni_ccm;
+    return NULL;
+}
+
+/* MODES: XTS */
+
+static int cipher_hw_aesni_xts_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    void (*aesni_xts_enc)(const unsigned char *in,
+        unsigned char *out,
+        size_t length,
+        const AES_KEY *key1, const AES_KEY *key2,
+        const unsigned char iv[16]);
+    void (*aesni_xts_dec)(const unsigned char *in,
+        unsigned char *out,
+        size_t length,
+        const AES_KEY *key1, const AES_KEY *key2,
+        const unsigned char iv[16]);
+
+    aesni_xts_enc = aesni_xts_encrypt;
+    aesni_xts_dec = aesni_xts_decrypt;
+
+#if (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
+    if (aesni_xts_avx512_eligible()) {
+        if (keylen == 64) {
+            aesni_xts_enc = aesni_xts_256_encrypt_avx512;
+            aesni_xts_dec = aesni_xts_256_decrypt_avx512;
+        } else if (keylen == 32) {
+            aesni_xts_enc = aesni_xts_128_encrypt_avx512;
+            aesni_xts_dec = aesni_xts_128_decrypt_avx512;
+        }
+    }
+#endif
+
+    return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+        aesni_set_encrypt_key, aesni_set_decrypt_key,
+        aesni_encrypt, aesni_decrypt, aesni_xts_enc, aesni_xts_dec);
+}
+
+static const PROV_CIPHER_HW aesni_xts = {
+    cipher_hw_aesni_xts_initkey,
+    NULL,
+    ossl_cipher_hw_aes_xts_copyctx
+};
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_aesni(void)
+{
+    if (AESNI_CAPABLE)
+        return &aesni_xts;
+    return NULL;
+}
+
+#endif
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_aesni.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_aesni.inc
deleted file mode 100644
index 33b9046054e..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_aesni.inc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * AES-NI support for AES modes ecb, cbc, ofb, cfb, ctr.
- * This file is included by cipher_aes_hw.c
- */
-
-#define cipher_hw_aesni_ofb128 ossl_cipher_hw_generic_ofb128
-#define cipher_hw_aesni_cfb128 ossl_cipher_hw_generic_cfb128
-#define cipher_hw_aesni_cfb8   ossl_cipher_hw_generic_cfb8
-#define cipher_hw_aesni_cfb1   ossl_cipher_hw_generic_cfb1
-#define cipher_hw_aesni_ctr    ossl_cipher_hw_generic_ctr
-
-static int cipher_hw_aesni_initkey(PROV_CIPHER_CTX *dat,
-                                   const unsigned char *key, size_t keylen)
-{
-    int ret;
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-    AES_KEY *ks = &adat->ks.ks;
-
-    dat->ks = ks;
-
-    if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
-        && !dat->enc) {
-        ret = aesni_set_decrypt_key(key, keylen * 8, ks);
-        dat->block = (block128_f) aesni_decrypt;
-        dat->stream.cbc = dat->mode == EVP_CIPH_CBC_MODE ?
-            (cbc128_f) aesni_cbc_encrypt : NULL;
-    } else {
-        ret = aesni_set_encrypt_key(key, keylen * 8, ks);
-        dat->block = (block128_f) aesni_encrypt;
-        if (dat->mode == EVP_CIPH_CBC_MODE)
-            dat->stream.cbc = (cbc128_f) aesni_cbc_encrypt;
-        else if (dat->mode == EVP_CIPH_CTR_MODE)
-            dat->stream.ctr = (ctr128_f) aesni_ctr32_encrypt_blocks;
-        else
-            dat->stream.cbc = NULL;
-    }
-
-    if (ret < 0) {
-        ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
-        return 0;
-    }
-
-    return 1;
-}
-
-static int cipher_hw_aesni_cbc(PROV_CIPHER_CTX *ctx, unsigned char *out,
-                               const unsigned char *in, size_t len)
-{
-    const AES_KEY *ks = ctx->ks;
-
-    aesni_cbc_encrypt(in, out, len, ks, ctx->iv, ctx->enc);
-
-    return 1;
-}
-
-static int cipher_hw_aesni_ecb(PROV_CIPHER_CTX *ctx, unsigned char *out,
-                               const unsigned char *in, size_t len)
-{
-    if (len < ctx->blocksize)
-        return 1;
-
-    aesni_ecb_encrypt(in, out, len, ctx->ks, ctx->enc);
-
-    return 1;
-}
-
-#define PROV_CIPHER_HW_declare(mode)                                           \
-static const PROV_CIPHER_HW aesni_##mode = {                                   \
-    cipher_hw_aesni_initkey,                                                   \
-    cipher_hw_aesni_##mode,                                                    \
-    cipher_hw_aes_copyctx                                                      \
-};
-#define PROV_CIPHER_HW_select(mode)                                            \
-if (AESNI_CAPABLE)                                                             \
-    return &aesni_##mode;
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_armv8.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_armv8.c
new file mode 100644
index 00000000000..673206b6d2e
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_armv8.c
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * ARMv8 support for all hardware accelerated AES modes.
+ */
+
+#include "internal/deprecated.h"
+#include "cipher_aes.h"
+#include "cipher_aes_gcm.h"
+
+#if defined(ARMv8_HWAES_CAPABLE)
+
+/* MODES: ctr */
+
+static int cipher_hw_aes_arm_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    if (!ossl_cipher_hw_aes_initkey(ctx, key, keylen))
+        return 0;
+
+    if (AES_UNROLL12_EOR3_CAPABLE && ctx->mode == EVP_CIPH_CTR_MODE)
+        ctx->stream.ctr = (ctr128_f)HWAES_ctr32_encrypt_blocks_unroll12_eor3;
+
+    return 1;
+}
+
+static const PROV_CIPHER_HW arm_ctr = {
+    cipher_hw_aes_arm_initkey,
+    ossl_cipher_hw_generic_ctr,
+    ossl_cipher_aes_copyctx
+};
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_arm(enum aes_modes mode)
+{
+    if (ARMv8_HWAES_CAPABLE && mode == AES_MODE_CTR)
+        return &arm_ctr;
+    return NULL;
+}
+
+#endif
+
+/* MODES: GCM */
+
+#if defined(AES_PMULL_CAPABLE) && defined(AES_GCM_ASM)
+
+size_t armv8_aes_gcm_encrypt(const unsigned char *in, unsigned char *out, size_t len,
+    const void *key, unsigned char ivec[16], uint64_t *Xi)
+{
+    AES_KEY *aes_key = (AES_KEY *)key;
+    size_t align_bytes = len - len % 16;
+
+    switch (aes_key->rounds) {
+    case 10:
+        if (IS_CPU_SUPPORT_UNROLL8_EOR3()) {
+            unroll8_eor3_aes_gcm_enc_128_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
+        } else {
+            aes_gcm_enc_128_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
+        }
+        break;
+    case 12:
+        if (IS_CPU_SUPPORT_UNROLL8_EOR3()) {
+            unroll8_eor3_aes_gcm_enc_192_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
+        } else {
+            aes_gcm_enc_192_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
+        }
+        break;
+    case 14:
+        if (IS_CPU_SUPPORT_UNROLL8_EOR3()) {
+            unroll8_eor3_aes_gcm_enc_256_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
+        } else {
+            aes_gcm_enc_256_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
+        }
+        break;
+    }
+    return align_bytes;
+}
+
+size_t armv8_aes_gcm_decrypt(const unsigned char *in, unsigned char *out, size_t len,
+    const void *key, unsigned char ivec[16], uint64_t *Xi)
+{
+    AES_KEY *aes_key = (AES_KEY *)key;
+    size_t align_bytes = len - len % 16;
+
+    switch (aes_key->rounds) {
+    case 10:
+        if (IS_CPU_SUPPORT_UNROLL8_EOR3()) {
+            unroll8_eor3_aes_gcm_dec_128_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
+        } else {
+            aes_gcm_dec_128_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
+        }
+        break;
+    case 12:
+        if (IS_CPU_SUPPORT_UNROLL8_EOR3()) {
+            unroll8_eor3_aes_gcm_dec_192_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
+        } else {
+            aes_gcm_dec_192_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
+        }
+        break;
+    case 14:
+        if (IS_CPU_SUPPORT_UNROLL8_EOR3()) {
+            unroll8_eor3_aes_gcm_dec_256_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
+        } else {
+            aes_gcm_dec_256_kernel(in, align_bytes * 8, out, (uint64_t *)Xi, ivec, key);
+        }
+        break;
+    }
+    return align_bytes;
+}
+
+static int armv8_aes_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
+    size_t keylen)
+{
+    if (AES_UNROLL12_EOR3_CAPABLE) {
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen,
+            aes_v8_set_encrypt_key, aes_v8_encrypt,
+            aes_v8_ctr32_encrypt_blocks_unroll12_eor3);
+    } else {
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen,
+            aes_v8_set_encrypt_key, aes_v8_encrypt,
+            aes_v8_ctr32_encrypt_blocks);
+    }
+}
+
+static const PROV_GCM_HW armv8_aes_gcm = {
+    armv8_aes_gcm_initkey,
+    ossl_gcm_setiv,
+    ossl_gcm_aad_update,
+    ossl_generic_aes_gcm_cipher_update,
+    ossl_gcm_cipher_final,
+    ossl_gcm_one_shot
+};
+
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_armv8(void)
+{
+    return AES_PMULL_CAPABLE ? &armv8_aes_gcm : NULL;
+}
+
+#endif
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_armv8.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_armv8.inc
deleted file mode 100644
index 3f73c79290a..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_armv8.inc
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * Crypto extension support for AES modes ecb, cbc, ofb, cfb, ctr.
- * This file is included by cipher_aes_hw.c
- */
-
-static int cipher_hw_aes_arm_initkey(PROV_CIPHER_CTX *dat,
-                                                       const unsigned char *key,
-                                                       size_t keylen)
-{
-    int ret = cipher_hw_aes_initkey(dat, key, keylen);
-    if (AES_UNROLL12_EOR3_CAPABLE && dat->mode == EVP_CIPH_CTR_MODE)
-        dat->stream.ctr = (ctr128_f)HWAES_ctr32_encrypt_blocks_unroll12_eor3;
-
-    return ret;
-}
-
-#define PROV_CIPHER_HW_declare(mode)                                           \
-static const PROV_CIPHER_HW aes_arm_##mode = {                                 \
-    cipher_hw_aes_arm_initkey,                                                 \
-    ossl_cipher_hw_generic_##mode,                                             \
-    cipher_hw_aes_copyctx                                                      \
-};
-#define PROV_CIPHER_HW_select(mode)                                            \
-if (ARMv8_HWAES_CAPABLE)                                                         \
-    return &aes_arm_##mode;
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_rv32i.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_rv32i.c
new file mode 100644
index 00000000000..eeb26a89484
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_rv32i.c
@@ -0,0 +1,211 @@
+/*
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*-
+ * RISC-V 32 ZKND ZKNE support for all hardware accelerated AES modes.
+ */
+
+#include "internal/deprecated.h"
+#include "cipher_aes.h"
+#include "cipher_aes_gcm.h"
+#include "cipher_aes_ccm.h"
+#include "cipher_aes_xts.h"
+
+#if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
+
+/* MODES: ecb, cbc, cfb, ofb, ctr */
+
+static int cipher_hw_rv32i_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    if ((ctx->mode == EVP_CIPH_ECB_MODE || ctx->mode == EVP_CIPH_CBC_MODE)
+        && !ctx->enc) {
+        if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE())
+            return ossl_cipher_set_aes_initkey(ctx, key, keylen,
+                rv32i_zbkb_zknd_zkne_set_decrypt_key, rv32i_zknd_decrypt,
+                NULL, NULL, NULL);
+        else
+            return ossl_cipher_set_aes_initkey(ctx, key, keylen,
+                rv32i_zknd_zkne_set_decrypt_key, rv32i_zknd_decrypt,
+                NULL, NULL, NULL);
+    } else {
+        if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE())
+            return ossl_cipher_set_aes_initkey(ctx, key, keylen,
+                rv32i_zbkb_zkne_set_encrypt_key, rv32i_zkne_encrypt,
+                NULL, NULL, NULL);
+        else
+            return ossl_cipher_set_aes_initkey(ctx, key, keylen,
+                rv32i_zkne_set_encrypt_key, rv32i_zkne_encrypt,
+                NULL, NULL, NULL);
+    }
+}
+
+static const PROV_CIPHER_HW rv32i_ecb = {
+    cipher_hw_rv32i_initkey,
+    ossl_cipher_hw_generic_ecb,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW rv32i_cbc = {
+    cipher_hw_rv32i_initkey,
+    ossl_cipher_hw_generic_cbc,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW rv32i_cfb128 = {
+    cipher_hw_rv32i_initkey,
+    ossl_cipher_hw_generic_cfb128,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW rv32i_cfb8 = {
+    cipher_hw_rv32i_initkey,
+    ossl_cipher_hw_generic_cfb8,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW rv32i_cfb1 = {
+    cipher_hw_rv32i_initkey,
+    ossl_cipher_hw_generic_cfb1,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW rv32i_ofb128 = {
+    cipher_hw_rv32i_initkey,
+    ossl_cipher_hw_generic_ofb128,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW rv32i_ctr = {
+    cipher_hw_rv32i_initkey,
+    ossl_cipher_hw_generic_ctr,
+    ossl_cipher_aes_copyctx
+};
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rv32i(enum aes_modes mode)
+{
+    if (RISCV_HAS_ZKND_AND_ZKNE()) {
+        switch (mode) {
+        case AES_MODE_ECB:
+            return &rv32i_ecb;
+        case AES_MODE_CBC:
+            return &rv32i_cbc;
+        case AES_MODE_CFB128:
+            return &rv32i_cfb128;
+        case AES_MODE_CFB8:
+            return &rv32i_cfb8;
+        case AES_MODE_CFB1:
+            return &rv32i_cfb1;
+        case AES_MODE_OFB128:
+            return &rv32i_ofb128;
+        case AES_MODE_CTR:
+            return &rv32i_ctr;
+        default:
+            return NULL;
+        }
+    }
+    return NULL;
+}
+
+/* MODES: GCM */
+
+static int aes_gcm_rv32i_initkey(PROV_GCM_CTX *ctx,
+    const unsigned char *key,
+    size_t keylen)
+{
+    if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE()) {
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen,
+            rv32i_zbkb_zkne_set_encrypt_key, rv32i_zkne_encrypt, NULL);
+    } else if (RISCV_HAS_ZKND_AND_ZKNE()) {
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen,
+            rv32i_zkne_set_encrypt_key, rv32i_zkne_encrypt, NULL);
+    }
+    return 0;
+}
+
+static const PROV_GCM_HW aes_gcm_rv32i = {
+    aes_gcm_rv32i_initkey,
+    ossl_gcm_setiv,
+    ossl_gcm_aad_update,
+    ossl_generic_aes_gcm_cipher_update,
+    ossl_gcm_cipher_final,
+    ossl_gcm_one_shot
+};
+
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_rv32i(void)
+{
+    if (RISCV_HAS_ZKND_AND_ZKNE())
+        return &aes_gcm_rv32i;
+    return NULL;
+}
+
+/* MODES: CCM */
+
+static int aes_ccm_rv32i_initkey(PROV_CCM_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE()) {
+        return ossl_cipher_set_ccm_aes_initkey(ctx, key, keylen,
+            rv32i_zbkb_zkne_set_encrypt_key, rv32i_zkne_encrypt, NULL, NULL);
+    } else if (RISCV_HAS_ZKND_AND_ZKNE()) {
+        return ossl_cipher_set_ccm_aes_initkey(ctx, key, keylen,
+            rv32i_zkne_set_encrypt_key, rv32i_zkne_encrypt, NULL, NULL);
+    }
+    return 0;
+}
+
+static const PROV_CCM_HW aes_ccm_rv32i = {
+    aes_ccm_rv32i_initkey,
+    ossl_ccm_generic_setiv,
+    ossl_ccm_generic_setaad,
+    ossl_ccm_generic_auth_encrypt,
+    ossl_ccm_generic_auth_decrypt,
+    ossl_ccm_generic_gettag
+};
+
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm_rv32i(void)
+{
+    if (RISCV_HAS_ZKND_AND_ZKNE())
+        return &aes_ccm_rv32i;
+    return NULL;
+}
+
+/* MODES: XTS */
+
+static int cipher_hw_aes_xts_rv32i_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE())
+        return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+            rv32i_zbkb_zkne_set_encrypt_key,
+            rv32i_zbkb_zknd_zkne_set_decrypt_key,
+            rv32i_zkne_encrypt, rv32i_zknd_decrypt, NULL, NULL);
+
+    if (RISCV_HAS_ZKND_AND_ZKNE())
+        return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+            rv32i_zkne_set_encrypt_key, rv32i_zknd_zkne_set_decrypt_key,
+            rv32i_zkne_encrypt, rv32i_zknd_decrypt, NULL, NULL);
+
+    return 0;
+}
+
+static const PROV_CIPHER_HW aes_xts_rv32i = {
+    cipher_hw_aes_xts_rv32i_initkey,
+    NULL,
+    ossl_cipher_hw_aes_xts_copyctx
+};
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_rv32i(void)
+{
+    if (RISCV_HAS_ZKND_AND_ZKNE())
+        return &aes_xts_rv32i;
+    return NULL;
+}
+
+#endif
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_rv32i.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_rv32i.inc
deleted file mode 100644
index f6c652c32d9..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_rv32i.inc
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * RISC-V 32 ZKND ZKNE support for AES modes ecb, cbc, ofb, cfb, ctr.
- * This file is included by cipher_aes_hw.c
- */
-
-#define cipher_hw_rv32i_zknd_zkne_cbc    ossl_cipher_hw_generic_cbc
-#define cipher_hw_rv32i_zknd_zkne_ecb    ossl_cipher_hw_generic_ecb
-#define cipher_hw_rv32i_zknd_zkne_ofb128 ossl_cipher_hw_generic_ofb128
-#define cipher_hw_rv32i_zknd_zkne_cfb128 ossl_cipher_hw_generic_cfb128
-#define cipher_hw_rv32i_zknd_zkne_cfb8   ossl_cipher_hw_generic_cfb8
-#define cipher_hw_rv32i_zknd_zkne_cfb1   ossl_cipher_hw_generic_cfb1
-#define cipher_hw_rv32i_zknd_zkne_ctr    ossl_cipher_hw_generic_ctr
-
-#define cipher_hw_rv32i_zbkb_zknd_zkne_cbc    ossl_cipher_hw_generic_cbc
-#define cipher_hw_rv32i_zbkb_zknd_zkne_ecb    ossl_cipher_hw_generic_ecb
-#define cipher_hw_rv32i_zbkb_zknd_zkne_ofb128 ossl_cipher_hw_generic_ofb128
-#define cipher_hw_rv32i_zbkb_zknd_zkne_cfb128 ossl_cipher_hw_generic_cfb128
-#define cipher_hw_rv32i_zbkb_zknd_zkne_cfb8   ossl_cipher_hw_generic_cfb8
-#define cipher_hw_rv32i_zbkb_zknd_zkne_cfb1   ossl_cipher_hw_generic_cfb1
-#define cipher_hw_rv32i_zbkb_zknd_zkne_ctr    ossl_cipher_hw_generic_ctr
-
-static int cipher_hw_rv32i_zknd_zkne_initkey(PROV_CIPHER_CTX *dat,
-                                             const unsigned char *key, size_t keylen)
-{
-    int ret;
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-    AES_KEY *ks = &adat->ks.ks;
-
-    dat->ks = ks;
-
-    if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
-        && !dat->enc) {
-        ret = rv32i_zknd_zkne_set_decrypt_key(key, keylen * 8, ks);
-        dat->block = (block128_f) rv32i_zknd_decrypt;
-        dat->stream.cbc = NULL;
-    } else {
-        ret = rv32i_zkne_set_encrypt_key(key, keylen * 8, ks);
-        dat->block = (block128_f) rv32i_zkne_encrypt;
-        dat->stream.cbc = NULL;
-    }
-
-    if (ret < 0) {
-        ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
-        return 0;
-    }
-
-    return 1;
-}
-
-static int cipher_hw_rv32i_zbkb_zknd_zkne_initkey(PROV_CIPHER_CTX *dat,
-                                                  const unsigned char *key, size_t keylen)
-{
-    int ret;
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-    AES_KEY *ks = &adat->ks.ks;
-
-    dat->ks = ks;
-
-    if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
-        && !dat->enc) {
-        ret = rv32i_zbkb_zknd_zkne_set_decrypt_key(key, keylen * 8, ks);
-        dat->block = (block128_f) rv32i_zknd_decrypt;
-        dat->stream.cbc = NULL;
-    } else {
-        ret = rv32i_zbkb_zkne_set_encrypt_key(key, keylen * 8, ks);
-        dat->block = (block128_f) rv32i_zkne_encrypt;
-        dat->stream.cbc = NULL;
-    }
-
-    if (ret < 0) {
-        ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
-        return 0;
-    }
-
-    return 1;
-}
-
-#define PROV_CIPHER_HW_declare(mode)                                           \
-static const PROV_CIPHER_HW rv32i_zknd_zkne_##mode = {                         \
-    cipher_hw_rv32i_zknd_zkne_initkey,                                         \
-    cipher_hw_rv32i_zknd_zkne_##mode,                                          \
-    cipher_hw_aes_copyctx                                                      \
-};                                                                             \
-static const PROV_CIPHER_HW rv32i_zbkb_zknd_zkne_##mode = {                    \
-    cipher_hw_rv32i_zbkb_zknd_zkne_initkey,                                    \
-    cipher_hw_rv32i_zbkb_zknd_zkne_##mode,                                     \
-    cipher_hw_aes_copyctx                                                      \
-};
-#define PROV_CIPHER_HW_select(mode)                                            \
-if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE())                                        \
-    return &rv32i_zbkb_zknd_zkne_##mode;                                       \
-if (RISCV_HAS_ZKND_AND_ZKNE())                                                 \
-    return &rv32i_zknd_zkne_##mode;
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_rv64i.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_rv64i.c
new file mode 100644
index 00000000000..fa1e3f2b2ad
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_rv64i.c
@@ -0,0 +1,348 @@
+/*
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*-
+ * RISC-V 64 ZKND ZKNE / ZVKNED support for all hardware accelerated AES modes.
+ */
+
+#include "internal/deprecated.h"
+#include "cipher_aes.h"
+#include "cipher_aes_gcm.h"
+#include "cipher_aes_ccm.h"
+#include "cipher_aes_xts.h"
+
+#if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
+
+static int zvkned_key_schedule_supported(size_t keylen)
+{
+    if (keylen * 8 == 128 || keylen * 8 == 256) {
+        return 1;
+    }
+    return 0;
+}
+
+/* MODES: ecb, cbc, cfb, ofb, ctr */
+
+static int cipher_hw_rv64i_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    if (RISCV_HAS_ZVKNED() && riscv_vlen() >= 128) {
+        /*
+         * Zvkned only supports 128 and 256 bit keys for key schedule
+         * generation. For the AES-192 case, we fallback to the generic
+         * `AES_set_encrypt_key`. All Zvkned-based implementations use the
+         * same `encrypt-key` scheduling for both encryption and decryption.
+         */
+        aes_set_encrypt_key_fn fn_set_key = AES_set_encrypt_key;
+        aes_block128_f fn_block = NULL;
+
+        if (zvkned_key_schedule_supported(keylen)) {
+            fn_set_key = rv64i_zvkned_set_encrypt_key;
+        }
+        ecb128_f fn_ecb = ctx->enc ? (ecb128_f)rv64i_zvkned_ecb_encrypt : (ecb128_f)rv64i_zvkned_ecb_decrypt;
+        cbc128_f fn_cbc = ctx->enc ? (cbc128_f)rv64i_zvkned_cbc_encrypt : (cbc128_f)rv64i_zvkned_cbc_decrypt;
+        ctr128_f fn_ctr = RISCV_HAS_ZVKB() ? (ctr128_f)rv64i_zvkb_zvkned_ctr32_encrypt_blocks : NULL;
+
+        /* Zvkned supports aes-128/192/256 encryption and decryption. */
+        if ((ctx->mode == EVP_CIPH_ECB_MODE || ctx->mode == EVP_CIPH_CBC_MODE)
+            && !ctx->enc) {
+            fn_block = rv64i_zvkned_decrypt;
+        } else {
+            fn_block = rv64i_zvkned_encrypt;
+        }
+        return ossl_cipher_set_aes_initkey(ctx, key, keylen, fn_set_key,
+            fn_block, fn_ecb, fn_cbc, fn_ctr);
+    } else if (RISCV_HAS_ZKND_AND_ZKNE()) {
+        if ((ctx->mode == EVP_CIPH_ECB_MODE || ctx->mode == EVP_CIPH_CBC_MODE)
+            && !ctx->enc) {
+            return ossl_cipher_set_aes_initkey(ctx, key, keylen,
+                rv64i_zknd_set_decrypt_key, rv64i_zknd_decrypt,
+                NULL, NULL, NULL);
+        } else {
+            return ossl_cipher_set_aes_initkey(ctx, key, keylen,
+                rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt,
+                NULL, NULL, NULL);
+        }
+    }
+    return 0;
+}
+
+static const PROV_CIPHER_HW rv64i_ecb = {
+    cipher_hw_rv64i_initkey,
+    ossl_cipher_hw_generic_ecb,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW rv64i_cbc = {
+    cipher_hw_rv64i_initkey,
+    ossl_cipher_hw_generic_cbc,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW rv64i_cfb128 = {
+    cipher_hw_rv64i_initkey,
+    ossl_cipher_hw_generic_cfb128,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW rv64i_cfb8 = {
+    cipher_hw_rv64i_initkey,
+    ossl_cipher_hw_generic_cfb8,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW rv64i_cfb1 = {
+    cipher_hw_rv64i_initkey,
+    ossl_cipher_hw_generic_cfb1,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW rv64i_ofb128 = {
+    cipher_hw_rv64i_initkey,
+    ossl_cipher_hw_generic_ofb128,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW rv64i_ctr = {
+    cipher_hw_rv64i_initkey,
+    ossl_cipher_hw_generic_ctr,
+    ossl_cipher_aes_copyctx
+};
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rv64i(enum aes_modes mode)
+{
+    if ((RISCV_HAS_ZVKNED() && riscv_vlen() >= 128)
+        || RISCV_HAS_ZKND_AND_ZKNE()) {
+        switch (mode) {
+        case AES_MODE_ECB:
+            return &rv64i_ecb;
+        case AES_MODE_CBC:
+            return &rv64i_cbc;
+        case AES_MODE_CFB128:
+            return &rv64i_cfb128;
+        case AES_MODE_CFB8:
+            return &rv64i_cfb8;
+        case AES_MODE_CFB1:
+            return &rv64i_cfb1;
+        case AES_MODE_OFB128:
+            return &rv64i_ofb128;
+        case AES_MODE_CTR:
+            return &rv64i_ctr;
+        default:
+            return NULL;
+        }
+    }
+    return NULL;
+}
+
+/* MODES: GCM */
+
+/*-
+ * RISC-V 64 ZKND and ZKNE support for AES GCM.
+ */
+static int rv64i_zknd_zkne_gcm_initkey(PROV_GCM_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    return ossl_aes_gcm_hw_initkey(ctx, key, keylen,
+        rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt, NULL);
+}
+
+static const PROV_GCM_HW rv64i_zknd_zkne_gcm = {
+    rv64i_zknd_zkne_gcm_initkey,
+    ossl_gcm_setiv,
+    ossl_gcm_aad_update,
+    ossl_generic_aes_gcm_cipher_update,
+    ossl_gcm_cipher_final,
+    ossl_gcm_one_shot
+};
+
+/*-
+ * RISC-V RV64 ZVKNED support for AES GCM.
+ */
+static int rv64i_zvkned_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
+    size_t keylen)
+{
+    /*
+     * Zvkned only supports 128 and 256 bit keys for key schedule generation.
+     * For AES-192 case, we could fallback to `AES_set_encrypt_key`.
+     */
+    if (zvkned_key_schedule_supported(keylen)) {
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen,
+            rv64i_zvkned_set_encrypt_key, rv64i_zvkned_encrypt, NULL);
+    } else {
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen,
+            AES_set_encrypt_key, rv64i_zvkned_encrypt, NULL);
+    }
+}
+
+static const PROV_GCM_HW rv64i_zvkned_gcm = {
+    rv64i_zvkned_gcm_initkey,
+    ossl_gcm_setiv,
+    ossl_gcm_aad_update,
+    ossl_generic_aes_gcm_cipher_update,
+    ossl_gcm_cipher_final,
+    ossl_gcm_one_shot
+};
+
+/*-
+ * RISC-V RV64 ZVKB, ZVKG and ZVKNED support for AES GCM.
+ */
+static int rv64i_zvkb_zvkg_zvkned_gcm_initkey(PROV_GCM_CTX *ctx,
+    const unsigned char *key,
+    size_t keylen)
+{
+    /*
+     * Zvkned only supports 128 and 256 bit keys for key schedule generation.
+     * For AES-192 case, we could fallback to `AES_set_encrypt_key`.
+     */
+    if (zvkned_key_schedule_supported(keylen)) {
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen,
+            rv64i_zvkned_set_encrypt_key, rv64i_zvkned_encrypt,
+            rv64i_zvkb_zvkned_ctr32_encrypt_blocks);
+    } else {
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen,
+            AES_set_encrypt_key, rv64i_zvkned_encrypt,
+            rv64i_zvkb_zvkned_ctr32_encrypt_blocks);
+    }
+}
+
+static const PROV_GCM_HW rv64i_zvkb_zvkg_zvkned_gcm = {
+    rv64i_zvkb_zvkg_zvkned_gcm_initkey,
+    ossl_gcm_setiv,
+    ossl_gcm_aad_update,
+    ossl_generic_aes_gcm_cipher_update,
+    ossl_gcm_cipher_final,
+    ossl_gcm_one_shot
+};
+
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_rv64i(void)
+{
+    if (RISCV_HAS_ZVKNED() && riscv_vlen() >= 128) {
+        if (RISCV_HAS_ZVKB() && RISCV_HAS_ZVKG())
+            return &rv64i_zvkb_zvkg_zvkned_gcm;
+        return &rv64i_zvkned_gcm;
+    }
+
+    if (RISCV_HAS_ZKND_AND_ZKNE()) {
+        return &rv64i_zknd_zkne_gcm;
+    }
+
+    return NULL;
+}
+
+/* MODES: CCM */
+
+static int ccm_rv64i_zknd_zkne_initkey(PROV_CCM_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    return ossl_cipher_set_ccm_aes_initkey(ctx, key, keylen,
+        rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt, NULL, NULL);
+}
+
+static const PROV_CCM_HW rv64i_zknd_zkne_ccm = {
+    ccm_rv64i_zknd_zkne_initkey,
+    ossl_ccm_generic_setiv,
+    ossl_ccm_generic_setaad,
+    ossl_ccm_generic_auth_encrypt,
+    ossl_ccm_generic_auth_decrypt,
+    ossl_ccm_generic_gettag
+};
+
+/*-
+ * RISC-V RV64 ZVKNED support for AES CCM.
+ * This file is included by cipher_aes_ccm_hw.c
+ */
+
+static int ccm_rv64i_zvkned_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
+    size_t keylen)
+{
+    /* Zvkned only supports 128 and 256 bit keys for key schedule generation. */
+    if (zvkned_key_schedule_supported(keylen)) {
+        return ossl_cipher_set_ccm_aes_initkey(ctx, key, keylen,
+            rv64i_zvkned_set_encrypt_key, rv64i_zvkned_encrypt, NULL, NULL);
+    } else {
+        return ossl_cipher_set_ccm_aes_initkey(ctx, key, keylen,
+            AES_set_encrypt_key, rv64i_zvkned_encrypt, NULL, NULL);
+    }
+}
+
+static const PROV_CCM_HW rv64i_zvkned_ccm = {
+    ccm_rv64i_zvkned_initkey,
+    ossl_ccm_generic_setiv,
+    ossl_ccm_generic_setaad,
+    ossl_ccm_generic_auth_encrypt,
+    ossl_ccm_generic_auth_decrypt,
+    ossl_ccm_generic_gettag
+};
+
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm_rv64i(void)
+{
+    if (RISCV_HAS_ZVKNED() && riscv_vlen() >= 128)
+        return &rv64i_zvkned_ccm;
+    else if (RISCV_HAS_ZKND_AND_ZKNE())
+        return &rv64i_zknd_zkne_ccm;
+    else
+        return NULL;
+}
+
+/* MODES: XTS */
+
+static int cipher_hw_aes_xts_rv64i_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    if (RISCV_HAS_ZVBB() && RISCV_HAS_ZVKG() && RISCV_HAS_ZVKNED() && riscv_vlen() >= 128) {
+        /* Zvkned only supports 128 and 256 bit keys. */
+        if (zvkned_key_schedule_supported(keylen / 2)) {
+            return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+                rv64i_zvkned_set_encrypt_key, rv64i_zvkned_set_decrypt_key,
+                rv64i_zvkned_encrypt, rv64i_zvkned_decrypt,
+                rv64i_zvbb_zvkg_zvkned_aes_xts_encrypt,
+                rv64i_zvbb_zvkg_zvkned_aes_xts_decrypt);
+        }
+        return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+            AES_set_encrypt_key, AES_set_encrypt_key,
+            rv64i_zvkned_encrypt, rv64i_zvkned_decrypt, NULL, NULL);
+    }
+
+    if (RISCV_HAS_ZVKNED() && riscv_vlen() >= 128) {
+        /* Zvkned only supports 128 and 256 bit keys. */
+        if (zvkned_key_schedule_supported(keylen / 2)) {
+            return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+                rv64i_zvkned_set_encrypt_key, rv64i_zvkned_set_decrypt_key,
+                rv64i_zvkned_encrypt, rv64i_zvkned_decrypt, NULL, NULL);
+        }
+        return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+            AES_set_encrypt_key, AES_set_encrypt_key,
+            rv64i_zvkned_encrypt, rv64i_zvkned_decrypt, NULL, NULL);
+    }
+
+    if (RISCV_HAS_ZKND_AND_ZKNE()) {
+        return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+            rv64i_zkne_set_encrypt_key, rv64i_zknd_set_decrypt_key,
+            rv64i_zkne_encrypt, rv64i_zknd_decrypt, NULL, NULL);
+    }
+
+    return 0;
+}
+
+static const PROV_CIPHER_HW aes_xts_rv64i = {
+    cipher_hw_aes_xts_rv64i_initkey,
+    NULL,
+    ossl_cipher_hw_aes_xts_copyctx
+};
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_rv64i(void)
+{
+    if ((RISCV_HAS_ZVKNED() && riscv_vlen() >= 128)
+        || RISCV_HAS_ZKND_AND_ZKNE())
+        return &aes_xts_rv64i;
+    return NULL;
+}
+
+#endif
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_rv64i.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_rv64i.inc
deleted file mode 100644
index 07d479303d9..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_rv64i.inc
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * RISC-V 64 ZKND ZKNE support for AES modes ecb, cbc, ofb, cfb, ctr.
- * This file is included by cipher_aes_hw.c
- */
-
-#define cipher_hw_rv64i_zknd_zkne_cbc    ossl_cipher_hw_generic_cbc
-#define cipher_hw_rv64i_zknd_zkne_ecb    ossl_cipher_hw_generic_ecb
-#define cipher_hw_rv64i_zknd_zkne_ofb128 ossl_cipher_hw_generic_ofb128
-#define cipher_hw_rv64i_zknd_zkne_cfb128 ossl_cipher_hw_generic_cfb128
-#define cipher_hw_rv64i_zknd_zkne_cfb8   ossl_cipher_hw_generic_cfb8
-#define cipher_hw_rv64i_zknd_zkne_cfb1   ossl_cipher_hw_generic_cfb1
-#define cipher_hw_rv64i_zknd_zkne_ctr    ossl_cipher_hw_generic_ctr
-
-static int cipher_hw_rv64i_zknd_zkne_initkey(PROV_CIPHER_CTX *dat,
-                                   const unsigned char *key, size_t keylen)
-{
-    int ret;
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-    AES_KEY *ks = &adat->ks.ks;
-
-    dat->ks = ks;
-
-    if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
-        && !dat->enc) {
-        ret = rv64i_zknd_set_decrypt_key(key, keylen * 8, ks);
-        dat->block = (block128_f) rv64i_zknd_decrypt;
-        dat->stream.cbc = NULL;
-    } else {
-        ret = rv64i_zkne_set_encrypt_key(key, keylen * 8, ks);
-        dat->block = (block128_f) rv64i_zkne_encrypt;
-        dat->stream.cbc = NULL;
-    }
-
-    if (ret < 0) {
-        ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
-        return 0;
-    }
-
-    return 1;
-}
-
-/*-
- * RISC-V RV64 ZVKNED support for AES modes ecb, cbc, ofb, cfb, ctr.
- * This file is included by cipher_aes_hw.c
- */
-
-#define cipher_hw_rv64i_zvkned_cbc    ossl_cipher_hw_generic_cbc
-#define cipher_hw_rv64i_zvkned_ecb    ossl_cipher_hw_generic_ecb
-#define cipher_hw_rv64i_zvkned_ofb128 ossl_cipher_hw_generic_ofb128
-#define cipher_hw_rv64i_zvkned_cfb128 ossl_cipher_hw_generic_cfb128
-#define cipher_hw_rv64i_zvkned_cfb8   ossl_cipher_hw_generic_cfb8
-#define cipher_hw_rv64i_zvkned_cfb1   ossl_cipher_hw_generic_cfb1
-#define cipher_hw_rv64i_zvkned_ctr    ossl_cipher_hw_generic_ctr
-
-static int cipher_hw_rv64i_zvkned_initkey(PROV_CIPHER_CTX *dat,
-                                          const unsigned char *key,
-                                          size_t keylen)
-{
-    int ret;
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-    AES_KEY *ks = &adat->ks.ks;
-
-    dat->ks = ks;
-
-    /*
-     * Zvkned only supports 128 and 256 bit keys for key schedule generation.
-     * For AES-192 case, we could fallback to `AES_set_encrypt_key`.
-     * All Zvkned-based implementations use the same `encrypt-key` scheduling
-     * for both encryption and decryption.
-     */
-    if (keylen * 8 == 128 || keylen * 8 == 256) {
-        ret = rv64i_zvkned_set_encrypt_key(key, keylen * 8, ks);
-    } else {
-        ret = AES_set_encrypt_key(key, keylen * 8, ks);
-    }
-
-    if (dat->mode == EVP_CIPH_CBC_MODE) {
-        if (dat->enc) {
-            dat->stream.cbc = (cbc128_f) rv64i_zvkned_cbc_encrypt;
-        } else {
-            dat->stream.cbc = (cbc128_f) rv64i_zvkned_cbc_decrypt;
-        }
-    } else if (dat->mode == EVP_CIPH_CTR_MODE) {
-        if (RISCV_HAS_ZVKB()) {
-            dat->stream.ctr = (ctr128_f) rv64i_zvkb_zvkned_ctr32_encrypt_blocks;
-        }
-    } else if (dat->mode == EVP_CIPH_ECB_MODE) {
-        if (dat->enc) {
-            dat->stream.ecb = (ecb128_f) rv64i_zvkned_ecb_encrypt;
-        } else {
-            dat->stream.ecb = (ecb128_f) rv64i_zvkned_ecb_decrypt;
-        }
-    }
-
-    /* Zvkned supports aes-128/192/256 encryption and decryption. */
-    if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE) &&
-        !dat->enc) {
-        dat->block = (block128_f) rv64i_zvkned_decrypt;
-    } else {
-        dat->block = (block128_f) rv64i_zvkned_encrypt;
-    }
-
-    if (ret < 0) {
-        ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
-        return 0;
-    }
-
-    return 1;
-}
-
-#define PROV_CIPHER_HW_declare(mode)                                           \
-static const PROV_CIPHER_HW rv64i_zknd_zkne_##mode = {                         \
-    cipher_hw_rv64i_zknd_zkne_initkey,                                         \
-    cipher_hw_rv64i_zknd_zkne_##mode,                                          \
-    cipher_hw_aes_copyctx                                                      \
-};                                                                             \
-static const PROV_CIPHER_HW rv64i_zvkned_##mode = {                            \
-    cipher_hw_rv64i_zvkned_initkey,                                            \
-    cipher_hw_rv64i_zvkned_##mode,                                             \
-    cipher_hw_aes_copyctx                                                      \
-};
-#define PROV_CIPHER_HW_select(mode)                                            \
-if (RISCV_HAS_ZVKNED() && riscv_vlen() >= 128)                                 \
-    return &rv64i_zvkned_##mode;                                               \
-else if (RISCV_HAS_ZKND_AND_ZKNE())                                            \
-    return &rv64i_zknd_zkne_##mode;
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_s390x.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_s390x.c
new file mode 100644
index 00000000000..e9e81f47467
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_s390x.c
@@ -0,0 +1,947 @@
+/*
+ * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * IBM S390X support for all hardware accelerated AES modes.
+ */
+
+#include "internal/deprecated.h"
+#include <openssl/proverr.h>
+#include "cipher_aes.h"
+#include "cipher_aes_gcm.h"
+#include "cipher_aes_ccm.h"
+#include "cipher_aes_xts.h"
+#include <stdio.h>
+
+#if defined(S390X_aes_128_CAPABLE)
+
+/* MODES: ecb, cfb, ofb */
+
+static int s390x_aes_ecb_initkey(PROV_CIPHER_CTX *dat,
+    const unsigned char *key, size_t keylen)
+{
+    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
+
+    adat->plat.s390x.fc = S390X_AES_FC(keylen);
+    memcpy(adat->plat.s390x.param.km.k, key, keylen);
+    return 1;
+}
+
+static int s390x_aes_ecb_cipher_hw(PROV_CIPHER_CTX *dat, unsigned char *out,
+    const unsigned char *in, size_t len)
+{
+    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
+    unsigned int modifier = adat->base.enc ? 0 : S390X_DECRYPT;
+
+    s390x_km(in, len, out, adat->plat.s390x.fc | modifier,
+        &adat->plat.s390x.param.km);
+    return 1;
+}
+
+static const PROV_CIPHER_HW s390x_aes_ecb = {
+    s390x_aes_ecb_initkey,
+    s390x_aes_ecb_cipher_hw,
+    ossl_cipher_aes_copyctx
+};
+
+static int s390x_aes_ofb128_initkey(PROV_CIPHER_CTX *dat,
+    const unsigned char *key, size_t keylen)
+{
+    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
+
+    memcpy(adat->plat.s390x.param.kmo_kmf.k, key, keylen);
+    adat->plat.s390x.fc = S390X_AES_FC(keylen);
+    return 1;
+}
+
+static int s390x_aes_ofb128_cipher_hw(PROV_CIPHER_CTX *dat, unsigned char *out,
+    const unsigned char *in, size_t len)
+{
+    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
+    int n = dat->num;
+    int rem;
+
+    memcpy(adat->plat.s390x.param.kmo_kmf.cv, dat->iv, dat->ivlen);
+    while (n && len) {
+        *out = *in ^ adat->plat.s390x.param.kmo_kmf.cv[n];
+        n = (n + 1) & 0xf;
+        --len;
+        ++in;
+        ++out;
+    }
+
+    rem = len & 0xf;
+
+    len &= ~(size_t)0xf;
+    if (len) {
+        s390x_kmo(in, len, out, adat->plat.s390x.fc,
+            &adat->plat.s390x.param.kmo_kmf);
+
+        out += len;
+        in += len;
+    }
+
+    if (rem) {
+        s390x_km(adat->plat.s390x.param.kmo_kmf.cv, 16,
+            adat->plat.s390x.param.kmo_kmf.cv,
+            adat->plat.s390x.fc,
+            adat->plat.s390x.param.kmo_kmf.k);
+
+        while (rem--) {
+            out[n] = in[n] ^ adat->plat.s390x.param.kmo_kmf.cv[n];
+            ++n;
+        }
+    }
+
+    memcpy(dat->iv, adat->plat.s390x.param.kmo_kmf.cv, dat->ivlen);
+    dat->num = n;
+    return 1;
+}
+
+static const PROV_CIPHER_HW s390x_aes_ofb128 = {
+    s390x_aes_ofb128_initkey,
+    s390x_aes_ofb128_cipher_hw,
+    ossl_cipher_aes_copyctx
+};
+
+static int s390x_aes_cfb128_initkey(PROV_CIPHER_CTX *dat,
+    const unsigned char *key, size_t keylen)
+{
+    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
+
+    adat->plat.s390x.fc = S390X_AES_FC(keylen);
+    adat->plat.s390x.fc |= 16 << 24; /* 16 bytes cipher feedback */
+    memcpy(adat->plat.s390x.param.kmo_kmf.k, key, keylen);
+    return 1;
+}
+
+static int s390x_aes_cfb128_cipher_hw(PROV_CIPHER_CTX *dat, unsigned char *out,
+    const unsigned char *in, size_t len)
+{
+    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
+    unsigned int modifier = adat->base.enc ? 0 : S390X_DECRYPT;
+    int n = dat->num;
+    int rem;
+    unsigned char tmp;
+
+    memcpy(adat->plat.s390x.param.kmo_kmf.cv, dat->iv, dat->ivlen);
+    while (n && len) {
+        tmp = *in;
+        *out = adat->plat.s390x.param.kmo_kmf.cv[n] ^ tmp;
+        adat->plat.s390x.param.kmo_kmf.cv[n] = dat->enc ? *out : tmp;
+        n = (n + 1) & 0xf;
+        --len;
+        ++in;
+        ++out;
+    }
+
+    rem = len & 0xf;
+
+    len &= ~(size_t)0xf;
+    if (len) {
+        s390x_kmf(in, len, out, adat->plat.s390x.fc | modifier,
+            &adat->plat.s390x.param.kmo_kmf);
+
+        out += len;
+        in += len;
+    }
+
+    if (rem) {
+        s390x_km(adat->plat.s390x.param.kmo_kmf.cv, 16,
+            adat->plat.s390x.param.kmo_kmf.cv,
+            S390X_AES_FC(dat->keylen),
+            adat->plat.s390x.param.kmo_kmf.k);
+
+        while (rem--) {
+            tmp = in[n];
+            out[n] = adat->plat.s390x.param.kmo_kmf.cv[n] ^ tmp;
+            adat->plat.s390x.param.kmo_kmf.cv[n] = dat->enc ? out[n] : tmp;
+            ++n;
+        }
+    }
+
+    memcpy(dat->iv, adat->plat.s390x.param.kmo_kmf.cv, dat->ivlen);
+    dat->num = n;
+    return 1;
+}
+
+static const PROV_CIPHER_HW s390x_aes_cfb128 = {
+    s390x_aes_cfb128_initkey,
+    s390x_aes_cfb128_cipher_hw,
+    ossl_cipher_aes_copyctx
+};
+
+static int s390x_aes_cfb8_initkey(PROV_CIPHER_CTX *dat,
+    const unsigned char *key, size_t keylen)
+{
+    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
+
+    adat->plat.s390x.fc = S390X_AES_FC(keylen);
+    adat->plat.s390x.fc |= 1 << 24; /* 1 byte cipher feedback */
+    memcpy(adat->plat.s390x.param.kmo_kmf.k, key, keylen);
+    return 1;
+}
+
+static int s390x_aes_cfb8_cipher_hw(PROV_CIPHER_CTX *dat, unsigned char *out,
+    const unsigned char *in, size_t len)
+{
+    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
+    unsigned int modifier = adat->base.enc ? 0 : S390X_DECRYPT;
+
+    memcpy(adat->plat.s390x.param.kmo_kmf.cv, dat->iv, dat->ivlen);
+    s390x_kmf(in, len, out, adat->plat.s390x.fc | modifier,
+        &adat->plat.s390x.param.kmo_kmf);
+    memcpy(dat->iv, adat->plat.s390x.param.kmo_kmf.cv, dat->ivlen);
+    return 1;
+}
+
+static const PROV_CIPHER_HW s390x_aes_cfb8 = {
+    s390x_aes_cfb8_initkey,
+    s390x_aes_cfb8_cipher_hw,
+    ossl_cipher_aes_copyctx
+};
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_s390x(enum aes_modes mode,
+    size_t keybits)
+{
+    switch (mode) {
+    case AES_MODE_ECB:
+        if ((keybits == 128 && S390X_aes_128_ecb_CAPABLE)
+            || (keybits == 192 && S390X_aes_192_ecb_CAPABLE)
+            || (keybits == 256 && S390X_aes_256_ecb_CAPABLE))
+            return &s390x_aes_ecb;
+        break;
+    case AES_MODE_CFB128:
+        if ((keybits == 128 && S390X_aes_128_cfb_CAPABLE)
+            || (keybits == 192 && S390X_aes_192_cfb_CAPABLE)
+            || (keybits == 256 && S390X_aes_256_cfb_CAPABLE))
+            return &s390x_aes_cfb128;
+        break;
+    case AES_MODE_CFB8:
+        if ((keybits == 128 && S390X_aes_128_cfb8_CAPABLE)
+            || (keybits == 192 && S390X_aes_192_cfb8_CAPABLE)
+            || (keybits == 256 && S390X_aes_256_cfb8_CAPABLE))
+            return &s390x_aes_cfb8;
+        break;
+    case AES_MODE_OFB128:
+        if ((keybits == 128 && S390X_aes_128_ofb_CAPABLE)
+            || (keybits == 192 && S390X_aes_192_ofb_CAPABLE)
+            || (keybits == 256 && S390X_aes_256_ofb_CAPABLE))
+            return &s390x_aes_ofb128;
+        break;
+    default:
+        break;
+    }
+    return NULL;
+}
+
+/* MODES: GCM */
+
+/* iv + padding length for iv lengths != 12 */
+#define S390X_gcm_ivpadlen(i) ((((i) + 15) >> 4 << 4) + 16)
+
+/* Additional flag or'ed to fc for decryption */
+#define S390X_gcm_decrypt_flag(ctx) (((ctx)->enc) ? 0 : S390X_DECRYPT)
+
+#define S390X_gcm_fc(A, C) ((A)->plat.s390x.fc | (A)->plat.s390x.hsflag | S390X_gcm_decrypt_flag((C)))
+
+static int s390x_aes_gcm_initkey(PROV_GCM_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
+
+    ctx->key_set = 1;
+    memcpy(&actx->plat.s390x.param.kma.k, key, keylen);
+    actx->plat.s390x.fc = S390X_AES_FC(keylen);
+    return 1;
+}
+
+static int s390x_aes_gcm_setiv(PROV_GCM_CTX *ctx, const unsigned char *iv,
+    size_t ivlen)
+{
+    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
+    S390X_KMA_PARAMS *kma = &actx->plat.s390x.param.kma;
+
+    kma->t.g[0] = 0;
+    kma->t.g[1] = 0;
+    kma->tpcl = 0;
+    kma->taadl = 0;
+    actx->plat.s390x.mreslen = 0;
+    actx->plat.s390x.areslen = 0;
+    actx->plat.s390x.kreslen = 0;
+
+    if (ivlen == GCM_IV_DEFAULT_SIZE) {
+        memcpy(&kma->j0, iv, ivlen);
+        kma->j0.w[3] = 1;
+        kma->cv.w = 1;
+        actx->plat.s390x.hsflag = 0;
+    } else {
+        unsigned long long ivbits = ivlen << 3;
+        size_t len = S390X_gcm_ivpadlen(ivlen);
+        unsigned char iv_zero_pad[S390X_gcm_ivpadlen(GCM_IV_MAX_SIZE)];
+        /*
+         * The IV length needs to be zero padded to be a multiple of 16 bytes
+         * followed by 8 bytes of zeros and 8 bytes for the IV length.
+         * The GHASH of this value can then be calculated.
+         */
+        memcpy(iv_zero_pad, iv, ivlen);
+        memset(iv_zero_pad + ivlen, 0, len - ivlen);
+        memcpy(iv_zero_pad + len - sizeof(ivbits), &ivbits, sizeof(ivbits));
+        /*
+         * Calculate the ghash of the iv - the result is stored into the tag
+         * param.
+         */
+        s390x_kma(iv_zero_pad, len, NULL, 0, NULL, actx->plat.s390x.fc, kma);
+        actx->plat.s390x.hsflag = S390X_KMA_HS; /* The hash subkey is set */
+
+        /* Copy the 128 bit GHASH result into J0 and clear the tag */
+        kma->j0.g[0] = kma->t.g[0];
+        kma->j0.g[1] = kma->t.g[1];
+        kma->t.g[0] = 0;
+        kma->t.g[1] = 0;
+        /* Set the 32 bit counter */
+        kma->cv.w = kma->j0.w[3];
+    }
+    return 1;
+}
+
+static int s390x_aes_gcm_cipher_final(PROV_GCM_CTX *ctx, unsigned char *tag)
+{
+    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
+    S390X_KMA_PARAMS *kma = &actx->plat.s390x.param.kma;
+    unsigned char out[AES_BLOCK_SIZE];
+    unsigned int fc;
+    int rc;
+
+    kma->taadl <<= 3;
+    kma->tpcl <<= 3;
+    fc = S390X_gcm_fc(actx, ctx) | S390X_KMA_LAAD | S390X_KMA_LPC;
+    s390x_kma(actx->plat.s390x.ares, actx->plat.s390x.areslen,
+        actx->plat.s390x.mres, actx->plat.s390x.mreslen, out,
+        fc, kma);
+
+    /* gctx->mres already returned to the caller */
+    OPENSSL_cleanse(out, actx->plat.s390x.mreslen);
+
+    if (ctx->enc) {
+        ctx->taglen = GCM_TAG_MAX_SIZE;
+        memcpy(tag, kma->t.b, ctx->taglen);
+        rc = 1;
+    } else {
+        rc = (CRYPTO_memcmp(tag, kma->t.b, ctx->taglen) == 0);
+    }
+    return rc;
+}
+
+static int s390x_aes_gcm_one_shot(PROV_GCM_CTX *ctx,
+    unsigned char *aad, size_t aad_len,
+    const unsigned char *in, size_t in_len,
+    unsigned char *out,
+    unsigned char *tag, size_t taglen)
+{
+    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
+    S390X_KMA_PARAMS *kma = &actx->plat.s390x.param.kma;
+    unsigned int fc;
+    int rc;
+
+    kma->taadl = aad_len << 3;
+    kma->tpcl = in_len << 3;
+    fc = S390X_gcm_fc(actx, ctx) | S390X_KMA_LAAD | S390X_KMA_LPC;
+    s390x_kma(aad, aad_len, in, in_len, out, fc, kma);
+
+    if (ctx->enc) {
+        memcpy(tag, kma->t.b, taglen);
+        rc = 1;
+    } else {
+        rc = (CRYPTO_memcmp(tag, kma->t.b, taglen) == 0);
+    }
+    return rc;
+}
+
+/*
+ * Process additional authenticated data. Returns 1 on success. Code is
+ * big-endian.
+ */
+static int s390x_aes_gcm_aad_update(PROV_GCM_CTX *ctx,
+    const unsigned char *aad, size_t len)
+{
+    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
+    S390X_KMA_PARAMS *kma = &actx->plat.s390x.param.kma;
+    unsigned long long alen;
+    unsigned int fc;
+    int n, rem;
+
+    /* If already processed pt/ct then error */
+    if (kma->tpcl != 0)
+        return 0;
+
+    /* update the total aad length */
+    alen = kma->taadl + len;
+    if (alen > (U64(1) << 61) || (sizeof(len) == 8 && alen < len))
+        return 0;
+    kma->taadl = alen;
+
+    /* check if there is any existing aad data from a previous add */
+    n = actx->plat.s390x.areslen;
+    if (n) {
+        /* add additional data to a buffer until it has 16 bytes */
+        while (n && len) {
+            actx->plat.s390x.ares[n] = *aad;
+            ++aad;
+            --len;
+            n = (n + 1) & 0xf;
+        }
+        /* ctx->ares contains a complete block if offset has wrapped around */
+        if (!n) {
+            fc = S390X_gcm_fc(actx, ctx);
+            s390x_kma(actx->plat.s390x.ares, 16, NULL, 0, NULL, fc, kma);
+            actx->plat.s390x.hsflag = S390X_KMA_HS;
+        }
+        actx->plat.s390x.areslen = n;
+    }
+
+    /* If there are leftover bytes (< 128 bits) save them for next time */
+    rem = len & 0xf;
+    /* Add any remaining 16 byte blocks (128 bit each) */
+    len &= ~(size_t)0xf;
+    if (len) {
+        fc = S390X_gcm_fc(actx, ctx);
+        s390x_kma(aad, len, NULL, 0, NULL, fc, kma);
+        actx->plat.s390x.hsflag = S390X_KMA_HS;
+        aad += len;
+    }
+
+    if (rem) {
+        actx->plat.s390x.areslen = rem;
+
+        do {
+            --rem;
+            actx->plat.s390x.ares[rem] = aad[rem];
+        } while (rem);
+    }
+    return 1;
+}
+
+/*-
+ * En/de-crypt plain/cipher-text and authenticate ciphertext. Returns 1 for
+ * success. Code is big-endian.
+ */
+static int s390x_aes_gcm_cipher_update(PROV_GCM_CTX *ctx,
+    const unsigned char *in, size_t len,
+    unsigned char *out)
+{
+    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
+    S390X_KMA_PARAMS *kma = &actx->plat.s390x.param.kma;
+    const unsigned char *inptr;
+    unsigned long long mlen;
+    unsigned int fc;
+    union {
+        unsigned int w[4];
+        unsigned char b[16];
+    } buf;
+    size_t inlen;
+    int n, rem, i;
+
+    mlen = kma->tpcl + len;
+    if (mlen > ((U64(1) << 36) - 32) || (sizeof(len) == 8 && mlen < len))
+        return 0;
+    kma->tpcl = mlen;
+
+    fc = S390X_gcm_fc(actx, ctx) | S390X_KMA_LAAD;
+    n = actx->plat.s390x.mreslen;
+    if (n) {
+        inptr = in;
+        inlen = len;
+        while (n && inlen) {
+            actx->plat.s390x.mres[n] = *inptr;
+            n = (n + 1) & 0xf;
+            ++inptr;
+            --inlen;
+        }
+        /* ctx->mres contains a complete block if offset has wrapped around */
+        if (!n) {
+            s390x_kma(actx->plat.s390x.ares, actx->plat.s390x.areslen,
+                actx->plat.s390x.mres, 16, buf.b, fc, kma);
+            actx->plat.s390x.hsflag = S390X_KMA_HS;
+            fc |= S390X_KMA_HS;
+            actx->plat.s390x.areslen = 0;
+
+            /* previous call already encrypted/decrypted its remainder,
+             * see comment below */
+            n = actx->plat.s390x.mreslen;
+            while (n) {
+                *out = buf.b[n];
+                n = (n + 1) & 0xf;
+                ++out;
+                ++in;
+                --len;
+            }
+            actx->plat.s390x.mreslen = 0;
+        }
+    }
+
+    rem = len & 0xf;
+
+    len &= ~(size_t)0xf;
+    if (len) {
+        s390x_kma(actx->plat.s390x.ares, actx->plat.s390x.areslen, in, len, out,
+            fc, kma);
+        in += len;
+        out += len;
+        actx->plat.s390x.hsflag = S390X_KMA_HS;
+        actx->plat.s390x.areslen = 0;
+    }
+
+    /*-
+     * If there is a remainder, it has to be saved such that it can be
+     * processed by kma later. However, we also have to do the for-now
+     * unauthenticated encryption/decryption part here and now...
+     */
+    if (rem) {
+        if (!actx->plat.s390x.mreslen) {
+            buf.w[0] = kma->j0.w[0];
+            buf.w[1] = kma->j0.w[1];
+            buf.w[2] = kma->j0.w[2];
+            buf.w[3] = kma->cv.w + 1;
+            s390x_km(buf.b, 16, actx->plat.s390x.kres,
+                fc & 0x1f, &kma->k);
+        }
+
+        n = actx->plat.s390x.mreslen;
+        for (i = 0; i < rem; i++) {
+            actx->plat.s390x.mres[n + i] = in[i];
+            out[i] = in[i] ^ actx->plat.s390x.kres[n + i];
+        }
+        actx->plat.s390x.mreslen += rem;
+    }
+    return 1;
+}
+
+static const PROV_GCM_HW s390x_aes_gcm = {
+    s390x_aes_gcm_initkey,
+    s390x_aes_gcm_setiv,
+    s390x_aes_gcm_aad_update,
+    s390x_aes_gcm_cipher_update,
+    s390x_aes_gcm_cipher_final,
+    s390x_aes_gcm_one_shot
+};
+
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_s390x(size_t keybits)
+{
+    if ((keybits == 128 && S390X_aes_128_gcm_CAPABLE)
+        || (keybits == 192 && S390X_aes_192_gcm_CAPABLE)
+        || (keybits == 256 && S390X_aes_256_gcm_CAPABLE))
+        return &s390x_aes_gcm;
+    return NULL;
+}
+
+/* MODES: CCM */
+
+#define S390X_CCM_AAD_FLAG 0x40
+
+static int s390x_aes_ccm_initkey(PROV_CCM_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    PROV_AES_CCM_CTX *sctx = (PROV_AES_CCM_CTX *)ctx;
+
+    sctx->ccm.s390x.fc = S390X_AES_FC(keylen);
+    memcpy(&sctx->ccm.s390x.kmac.k, key, keylen);
+    /* Store encoded m and l. */
+    sctx->ccm.s390x.nonce.b[0] = ((ctx->l - 1) & 0x7)
+        | (((ctx->m - 2) >> 1) & 0x7) << 3;
+    memset(sctx->ccm.s390x.nonce.b + 1, 0, sizeof(sctx->ccm.s390x.nonce.b));
+    sctx->ccm.s390x.blocks = 0;
+    ctx->key_set = 1;
+    return 1;
+}
+
+static int s390x_aes_ccm_setiv(PROV_CCM_CTX *ctx,
+    const unsigned char *nonce, size_t noncelen,
+    size_t mlen)
+{
+    PROV_AES_CCM_CTX *sctx = (PROV_AES_CCM_CTX *)ctx;
+
+    sctx->ccm.s390x.nonce.b[0] &= ~S390X_CCM_AAD_FLAG;
+    sctx->ccm.s390x.nonce.g[1] = mlen;
+    memcpy(sctx->ccm.s390x.nonce.b + 1, nonce, 15 - ctx->l);
+    return 1;
+}
+
+/*-
+ * Process additional authenticated data. Code is big-endian.
+ */
+static int s390x_aes_ccm_setaad(PROV_CCM_CTX *ctx,
+    const unsigned char *aad, size_t alen)
+{
+    PROV_AES_CCM_CTX *sctx = (PROV_AES_CCM_CTX *)ctx;
+    unsigned char *ptr;
+    int i, rem;
+
+    if (!alen)
+        return 1;
+
+    sctx->ccm.s390x.nonce.b[0] |= S390X_CCM_AAD_FLAG;
+
+    /* Suppress 'type-punned pointer dereference' warning. */
+    ptr = sctx->ccm.s390x.buf.b;
+
+    if (alen < ((1 << 16) - (1 << 8))) {
+        *(uint16_t *)ptr = alen;
+        i = 2;
+    } else if (sizeof(alen) == 8
+        && alen >= (size_t)1 << (32 % (sizeof(alen) * 8))) {
+        *(uint16_t *)ptr = 0xffff;
+        *(uint64_t *)(ptr + 2) = alen;
+        i = 10;
+    } else {
+        *(uint16_t *)ptr = 0xfffe;
+        *(uint32_t *)(ptr + 2) = alen;
+        i = 6;
+    }
+
+    while (i < 16 && alen) {
+        sctx->ccm.s390x.buf.b[i] = *aad;
+        ++aad;
+        --alen;
+        ++i;
+    }
+    while (i < 16) {
+        sctx->ccm.s390x.buf.b[i] = 0;
+        ++i;
+    }
+
+    sctx->ccm.s390x.kmac.icv.g[0] = 0;
+    sctx->ccm.s390x.kmac.icv.g[1] = 0;
+    s390x_kmac(sctx->ccm.s390x.nonce.b, 32, sctx->ccm.s390x.fc,
+        &sctx->ccm.s390x.kmac);
+    sctx->ccm.s390x.blocks += 2;
+
+    rem = alen & 0xf;
+    alen &= ~(size_t)0xf;
+    if (alen) {
+        s390x_kmac(aad, alen, sctx->ccm.s390x.fc, &sctx->ccm.s390x.kmac);
+        sctx->ccm.s390x.blocks += alen >> 4;
+        aad += alen;
+    }
+    if (rem) {
+        for (i = 0; i < rem; i++)
+            sctx->ccm.s390x.kmac.icv.b[i] ^= aad[i];
+
+        s390x_km(sctx->ccm.s390x.kmac.icv.b, 16,
+            sctx->ccm.s390x.kmac.icv.b, sctx->ccm.s390x.fc,
+            sctx->ccm.s390x.kmac.k);
+        sctx->ccm.s390x.blocks++;
+    }
+    return 1;
+}
+
+/*-
+ * En/de-crypt plain/cipher-text. Compute tag from plaintext. Returns 1 for
+ * success.
+ */
+static int s390x_aes_ccm_auth_encdec(PROV_CCM_CTX *ctx,
+    const unsigned char *in,
+    unsigned char *out, size_t len, int enc)
+{
+    PROV_AES_CCM_CTX *sctx = (PROV_AES_CCM_CTX *)ctx;
+    size_t n, rem;
+    unsigned int i, l, num;
+    unsigned char flags;
+
+    flags = sctx->ccm.s390x.nonce.b[0];
+    if (!(flags & S390X_CCM_AAD_FLAG)) {
+        s390x_km(sctx->ccm.s390x.nonce.b, 16, sctx->ccm.s390x.kmac.icv.b,
+            sctx->ccm.s390x.fc, sctx->ccm.s390x.kmac.k);
+        sctx->ccm.s390x.blocks++;
+    }
+    l = flags & 0x7;
+    sctx->ccm.s390x.nonce.b[0] = l;
+
+    /*-
+     * Reconstruct length from encoded length field
+     * and initialize it with counter value.
+     */
+    n = 0;
+    for (i = 15 - l; i < 15; i++) {
+        n |= sctx->ccm.s390x.nonce.b[i];
+        sctx->ccm.s390x.nonce.b[i] = 0;
+        n <<= 8;
+    }
+    n |= sctx->ccm.s390x.nonce.b[15];
+    sctx->ccm.s390x.nonce.b[15] = 1;
+
+    if (n != len)
+        return 0; /* length mismatch */
+
+    if (enc) {
+        /* Two operations per block plus one for tag encryption */
+        sctx->ccm.s390x.blocks += (((len + 15) >> 4) << 1) + 1;
+        if (sctx->ccm.s390x.blocks > (1ULL << 61))
+            return 0; /* too much data */
+    }
+
+    num = 0;
+    rem = len & 0xf;
+    len &= ~(size_t)0xf;
+
+    if (enc) {
+        /* mac-then-encrypt */
+        if (len)
+            s390x_kmac(in, len, sctx->ccm.s390x.fc, &sctx->ccm.s390x.kmac);
+        if (rem) {
+            for (i = 0; i < rem; i++)
+                sctx->ccm.s390x.kmac.icv.b[i] ^= in[len + i];
+
+            s390x_km(sctx->ccm.s390x.kmac.icv.b, 16,
+                sctx->ccm.s390x.kmac.icv.b,
+                sctx->ccm.s390x.fc, sctx->ccm.s390x.kmac.k);
+        }
+
+        CRYPTO_ctr128_encrypt_ctr32(in, out, len + rem, &sctx->ccm.ks.ks,
+            sctx->ccm.s390x.nonce.b, sctx->ccm.s390x.buf.b,
+            &num, (ctr128_f)AES_ctr32_encrypt);
+    } else {
+        /* decrypt-then-mac */
+        CRYPTO_ctr128_encrypt_ctr32(in, out, len + rem, &sctx->ccm.ks.ks,
+            sctx->ccm.s390x.nonce.b, sctx->ccm.s390x.buf.b,
+            &num, (ctr128_f)AES_ctr32_encrypt);
+
+        if (len)
+            s390x_kmac(out, len, sctx->ccm.s390x.fc, &sctx->ccm.s390x.kmac);
+        if (rem) {
+            for (i = 0; i < rem; i++)
+                sctx->ccm.s390x.kmac.icv.b[i] ^= out[len + i];
+
+            s390x_km(sctx->ccm.s390x.kmac.icv.b, 16,
+                sctx->ccm.s390x.kmac.icv.b,
+                sctx->ccm.s390x.fc, sctx->ccm.s390x.kmac.k);
+        }
+    }
+    /* encrypt tag */
+    for (i = 15 - l; i < 16; i++)
+        sctx->ccm.s390x.nonce.b[i] = 0;
+
+    s390x_km(sctx->ccm.s390x.nonce.b, 16, sctx->ccm.s390x.buf.b,
+        sctx->ccm.s390x.fc, sctx->ccm.s390x.kmac.k);
+    sctx->ccm.s390x.kmac.icv.g[0] ^= sctx->ccm.s390x.buf.g[0];
+    sctx->ccm.s390x.kmac.icv.g[1] ^= sctx->ccm.s390x.buf.g[1];
+
+    sctx->ccm.s390x.nonce.b[0] = flags; /* restore flags field */
+    return 1;
+}
+
+static int s390x_aes_ccm_gettag(PROV_CCM_CTX *ctx,
+    unsigned char *tag, size_t tlen)
+{
+    PROV_AES_CCM_CTX *sctx = (PROV_AES_CCM_CTX *)ctx;
+
+    if (tlen > ctx->m)
+        return 0;
+    memcpy(tag, sctx->ccm.s390x.kmac.icv.b, tlen);
+    return 1;
+}
+
+static int s390x_aes_ccm_auth_encrypt(PROV_CCM_CTX *ctx,
+    const unsigned char *in,
+    unsigned char *out, size_t len,
+    unsigned char *tag, size_t taglen)
+{
+    int rv;
+
+    rv = s390x_aes_ccm_auth_encdec(ctx, in, out, len, 1);
+    if (rv && tag != NULL)
+        rv = s390x_aes_ccm_gettag(ctx, tag, taglen);
+    return rv;
+}
+
+static int s390x_aes_ccm_auth_decrypt(PROV_CCM_CTX *ctx,
+    const unsigned char *in,
+    unsigned char *out, size_t len,
+    unsigned char *expected_tag,
+    size_t taglen)
+{
+    int rv = 0;
+    PROV_AES_CCM_CTX *sctx = (PROV_AES_CCM_CTX *)ctx;
+
+    rv = s390x_aes_ccm_auth_encdec(ctx, in, out, len, 0);
+    if (rv) {
+        if (CRYPTO_memcmp(sctx->ccm.s390x.kmac.icv.b, expected_tag, ctx->m) != 0)
+            rv = 0;
+    }
+    if (rv == 0)
+        OPENSSL_cleanse(out, len);
+    return rv;
+}
+
+static const PROV_CCM_HW s390x_aes_ccm = {
+    s390x_aes_ccm_initkey,
+    s390x_aes_ccm_setiv,
+    s390x_aes_ccm_setaad,
+    s390x_aes_ccm_auth_encrypt,
+    s390x_aes_ccm_auth_decrypt,
+    s390x_aes_ccm_gettag
+};
+
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm_s390x(size_t keybits)
+{
+    if ((keybits == 128 && S390X_aes_128_ccm_CAPABLE)
+        || (keybits == 192 && S390X_aes_192_ccm_CAPABLE)
+        || (keybits == 256 && S390X_aes_256_ccm_CAPABLE))
+        return &s390x_aes_ccm;
+    return NULL;
+}
+
+#endif
+
+/* MODES: XTS */
+
+#if defined(AES_XTS_S390X)
+
+int s390x_aes_xts_cipher_stream(PROV_AES_XTS_CTX *xctx,
+    unsigned char *out, size_t *outl,
+    const unsigned char *in, size_t inl)
+{
+    S390X_KM_XTS_PARAMS *km = &xctx->plat.s390x.param.km;
+    unsigned char *param = (unsigned char *)km + xctx->plat.s390x.offset;
+    unsigned int fc = xctx->plat.s390x.fc;
+    unsigned char tmp[2][AES_BLOCK_SIZE];
+    unsigned char nap_n1[AES_BLOCK_SIZE];
+    unsigned char drop[AES_BLOCK_SIZE];
+    size_t len_incomplete, len_complete;
+
+    len_incomplete = inl % AES_BLOCK_SIZE;
+    len_complete = (len_incomplete == 0) ? inl : (inl / AES_BLOCK_SIZE - 1) * AES_BLOCK_SIZE;
+
+    if (len_complete > 0)
+        s390x_km(in, len_complete, out, fc, param);
+    if (len_incomplete == 0)
+        goto out;
+
+    memcpy(tmp, in + len_complete, AES_BLOCK_SIZE + len_incomplete);
+    /* swap NAP for decrypt */
+    if (fc & S390X_DECRYPT) {
+        memcpy(nap_n1, km->nap, AES_BLOCK_SIZE);
+        s390x_km(tmp[0], AES_BLOCK_SIZE, drop, fc, param);
+    }
+    s390x_km(tmp[0], AES_BLOCK_SIZE, tmp[0], fc, param);
+    if (fc & S390X_DECRYPT)
+        memcpy(km->nap, nap_n1, AES_BLOCK_SIZE);
+
+    memcpy(tmp[1] + len_incomplete, tmp[0] + len_incomplete,
+        AES_BLOCK_SIZE - len_incomplete);
+    s390x_km(tmp[1], AES_BLOCK_SIZE, out + len_complete, fc, param);
+    memcpy(out + len_complete + AES_BLOCK_SIZE, tmp[0], len_incomplete);
+
+    /* do not expose temporary data */
+    OPENSSL_cleanse(tmp, sizeof(tmp));
+out:
+    memcpy(xctx->base.iv, km->tweak, AES_BLOCK_SIZE);
+    *outl = inl;
+
+    return 1;
+}
+
+static int cipher_hw_aes_xts_s390x_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    PROV_AES_XTS_CTX *xctx = (PROV_AES_XTS_CTX *)ctx;
+    S390X_KM_XTS_PARAMS *km = &xctx->plat.s390x.param.km;
+    unsigned int fc, offs;
+    unsigned int dec = 0;
+    int supported = 0;
+
+    if (key != NULL) {
+        switch (keylen) {
+        case 128 / 8 * 2:
+            fc = S390X_XTS_AES_128_MSA10;
+            offs = 32;
+            break;
+        case 256 / 8 * 2:
+            fc = S390X_XTS_AES_256_MSA10;
+            offs = 0;
+            break;
+        default:
+            fc = 0;
+            break;
+        }
+    } else {
+        fc = xctx->plat.s390x.fc & ~S390X_DECRYPT;
+        offs = xctx->plat.s390x.offset;
+    }
+
+    if (fc != 0)
+        supported = (OPENSSL_s390xcap_P.km[1] && S390X_CAPBIT(fc));
+    if (!supported) {
+        xctx->plat.s390x.fc = 0;
+        xctx->plat.s390x.offset = 0;
+        return 0;
+    }
+
+    if (xctx->base.iv_set) {
+        if (xctx->base.ivlen > sizeof(km->tweak)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
+            return 0;
+        }
+        memcpy(km->tweak, xctx->base.iv, xctx->base.ivlen);
+        xctx->plat.s390x.iv_set = 1;
+    }
+
+    if (key != NULL) {
+        memcpy(km->key + offs, key, keylen);
+        xctx->plat.s390x.key_set = 1;
+    }
+
+    if (xctx->base.enc == 0)
+        dec = S390X_DECRYPT;
+
+    xctx->plat.s390x.fc = fc | dec;
+    xctx->plat.s390x.offset = offs;
+
+    memset(km->nap, 0, sizeof(km->nap));
+    km->nap[0] = 0x1;
+
+    return 1;
+}
+
+static void cipher_hw_aes_xts_s390x_copyctx(PROV_CIPHER_CTX *dst,
+    const PROV_CIPHER_CTX *src)
+{
+    PROV_AES_XTS_CTX *sctx = (PROV_AES_XTS_CTX *)src;
+    PROV_AES_XTS_CTX *dctx = (PROV_AES_XTS_CTX *)dst;
+
+    *dctx = *sctx;
+    dctx->xts.key1 = NULL;
+    dctx->xts.key2 = NULL;
+}
+
+static const PROV_CIPHER_HW aes_xts_s390x = {
+    cipher_hw_aes_xts_s390x_initkey,
+    NULL,
+    cipher_hw_aes_xts_s390x_copyctx
+};
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_s390x(size_t keybits)
+{
+    switch (keybits) {
+    case (128 * 2):
+        if (OPENSSL_s390xcap_P.km[1] && S390X_CAPBIT(S390X_XTS_AES_128_MSA10))
+            return &aes_xts_s390x;
+        break;
+    case (256 * 2):
+        if (OPENSSL_s390xcap_P.km[1] && S390X_CAPBIT(S390X_XTS_AES_256_MSA10))
+            return &aes_xts_s390x;
+        break;
+    default:
+        break;
+    }
+
+    return NULL;
+}
+
+#endif
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_s390x.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_s390x.inc
deleted file mode 100644
index 6c4a4cc9951..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_s390x.inc
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright 2001-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * IBM S390X support for AES modes ecb, cbc, ofb, cfb, ctr.
- * This file is included by cipher_aes_hw.c
- */
-
-#include "s390x_arch.h"
-
-#include <stdio.h>
-
-#define s390x_aes_cbc_initkey    cipher_hw_aes_initkey
-#define s390x_aes_cfb1_initkey   cipher_hw_aes_initkey
-#define s390x_aes_ctr_initkey    cipher_hw_aes_initkey
-#define s390x_aes_cbc_cipher_hw  ossl_cipher_hw_generic_cbc
-#define s390x_aes_cfb1_cipher_hw ossl_cipher_hw_generic_cfb1
-#define s390x_aes_ctr_cipher_hw  ossl_cipher_hw_generic_ctr
-
-#define S390X_aes_128_ofb128_CAPABLE S390X_aes_128_ofb_CAPABLE
-#define S390X_aes_192_ofb128_CAPABLE S390X_aes_192_ofb_CAPABLE
-#define S390X_aes_256_ofb128_CAPABLE S390X_aes_256_ofb_CAPABLE
-#define S390X_aes_128_cfb128_CAPABLE S390X_aes_128_cfb_CAPABLE
-#define S390X_aes_192_cfb128_CAPABLE S390X_aes_192_cfb_CAPABLE
-#define S390X_aes_256_cfb128_CAPABLE S390X_aes_256_cfb_CAPABLE
-
-static int s390x_aes_ecb_initkey(PROV_CIPHER_CTX *dat,
-                                 const unsigned char *key, size_t keylen)
-{
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-
-    adat->plat.s390x.fc = S390X_AES_FC(keylen);
-    memcpy(adat->plat.s390x.param.km.k, key, keylen);
-    return 1;
-}
-
-static int s390x_aes_ecb_cipher_hw(PROV_CIPHER_CTX *dat, unsigned char *out,
-                                   const unsigned char *in, size_t len)
-{
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-    unsigned int modifier = adat->base.enc ? 0 : S390X_DECRYPT;
-
-    s390x_km(in, len, out, adat->plat.s390x.fc | modifier,
-             &adat->plat.s390x.param.km);
-    return 1;
-}
-
-static int s390x_aes_ofb128_initkey(PROV_CIPHER_CTX *dat,
-                                    const unsigned char *key, size_t keylen)
-{
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-
-    memcpy(adat->plat.s390x.param.kmo_kmf.k, key, keylen);
-    adat->plat.s390x.fc = S390X_AES_FC(keylen);
-    return 1;
-}
-
-static int s390x_aes_ofb128_cipher_hw(PROV_CIPHER_CTX *dat, unsigned char *out,
-                                      const unsigned char *in, size_t len)
-{
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-    int n = dat->num;
-    int rem;
-
-    memcpy(adat->plat.s390x.param.kmo_kmf.cv, dat->iv, dat->ivlen);
-    while (n && len) {
-        *out = *in ^ adat->plat.s390x.param.kmo_kmf.cv[n];
-        n = (n + 1) & 0xf;
-        --len;
-        ++in;
-        ++out;
-    }
-
-    rem = len & 0xf;
-
-    len &= ~(size_t)0xf;
-    if (len) {
-        s390x_kmo(in, len, out, adat->plat.s390x.fc,
-                  &adat->plat.s390x.param.kmo_kmf);
-
-        out += len;
-        in += len;
-    }
-
-    if (rem) {
-        s390x_km(adat->plat.s390x.param.kmo_kmf.cv, 16,
-                 adat->plat.s390x.param.kmo_kmf.cv,
-                 adat->plat.s390x.fc,
-                 adat->plat.s390x.param.kmo_kmf.k);
-
-        while (rem--) {
-            out[n] = in[n] ^ adat->plat.s390x.param.kmo_kmf.cv[n];
-            ++n;
-        }
-    }
-
-    memcpy(dat->iv, adat->plat.s390x.param.kmo_kmf.cv, dat->ivlen);
-    dat->num = n;
-    return 1;
-}
-
-static int s390x_aes_cfb128_initkey(PROV_CIPHER_CTX *dat,
-                                    const unsigned char *key, size_t keylen)
-{
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-
-    adat->plat.s390x.fc = S390X_AES_FC(keylen);
-    adat->plat.s390x.fc |= 16 << 24;   /* 16 bytes cipher feedback */
-    memcpy(adat->plat.s390x.param.kmo_kmf.k, key, keylen);
-    return 1;
-}
-
-static int s390x_aes_cfb128_cipher_hw(PROV_CIPHER_CTX *dat, unsigned char *out,
-                                      const unsigned char *in, size_t len)
-{
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-    unsigned int modifier = adat->base.enc ? 0 : S390X_DECRYPT;
-    int n = dat->num;
-    int rem;
-    unsigned char tmp;
-
-    memcpy(adat->plat.s390x.param.kmo_kmf.cv, dat->iv, dat->ivlen);
-    while (n && len) {
-        tmp = *in;
-        *out = adat->plat.s390x.param.kmo_kmf.cv[n] ^ tmp;
-        adat->plat.s390x.param.kmo_kmf.cv[n] = dat->enc ? *out : tmp;
-        n = (n + 1) & 0xf;
-        --len;
-        ++in;
-        ++out;
-    }
-
-    rem = len & 0xf;
-
-    len &= ~(size_t)0xf;
-    if (len) {
-        s390x_kmf(in, len, out, adat->plat.s390x.fc | modifier,
-                  &adat->plat.s390x.param.kmo_kmf);
-
-        out += len;
-        in += len;
-    }
-
-    if (rem) {
-        s390x_km(adat->plat.s390x.param.kmo_kmf.cv, 16,
-                 adat->plat.s390x.param.kmo_kmf.cv,
-                 S390X_AES_FC(dat->keylen),
-                 adat->plat.s390x.param.kmo_kmf.k);
-
-        while (rem--) {
-            tmp = in[n];
-            out[n] = adat->plat.s390x.param.kmo_kmf.cv[n] ^ tmp;
-            adat->plat.s390x.param.kmo_kmf.cv[n] = dat->enc ? out[n] : tmp;
-            ++n;
-        }
-    }
-
-    memcpy(dat->iv, adat->plat.s390x.param.kmo_kmf.cv, dat->ivlen);
-    dat->num = n;
-    return 1;
-}
-
-static int s390x_aes_cfb8_initkey(PROV_CIPHER_CTX *dat,
-                                  const unsigned char *key, size_t keylen)
-{
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-
-    adat->plat.s390x.fc = S390X_AES_FC(keylen);
-    adat->plat.s390x.fc |= 1 << 24;   /* 1 byte cipher feedback */
-    memcpy(adat->plat.s390x.param.kmo_kmf.k, key, keylen);
-    return 1;
-}
-
-static int s390x_aes_cfb8_cipher_hw(PROV_CIPHER_CTX *dat, unsigned char *out,
-                                    const unsigned char *in, size_t len)
-{
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-    unsigned int modifier = adat->base.enc ? 0 : S390X_DECRYPT;
-
-    memcpy(adat->plat.s390x.param.kmo_kmf.cv, dat->iv, dat->ivlen);
-    s390x_kmf(in, len, out, adat->plat.s390x.fc | modifier,
-              &adat->plat.s390x.param.kmo_kmf);
-    memcpy(dat->iv, adat->plat.s390x.param.kmo_kmf.cv, dat->ivlen);
-    return 1;
-}
-
-#define PROV_CIPHER_HW_declare(mode)                                           \
-static const PROV_CIPHER_HW s390x_aes_##mode = {                               \
-    s390x_aes_##mode##_initkey,                                                \
-    s390x_aes_##mode##_cipher_hw,                                              \
-    cipher_hw_aes_copyctx                                                      \
-};
-#define PROV_CIPHER_HW_select(mode)                                            \
-if ((keybits == 128 && S390X_aes_128_##mode##_CAPABLE)                         \
-     || (keybits == 192 && S390X_aes_192_##mode##_CAPABLE)                     \
-     || (keybits == 256 && S390X_aes_256_##mode##_CAPABLE))                    \
-    return &s390x_aes_##mode;
-
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_t4.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_t4.c
new file mode 100644
index 00000000000..514a7a737f0
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_t4.c
@@ -0,0 +1,252 @@
+/*
+ * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*-
+ * Sparc t4 support for all hardware accelerated AES modes.
+ */
+
+#include "internal/deprecated.h"
+#include <openssl/proverr.h>
+#include "cipher_aes.h"
+#include "cipher_aes_gcm.h"
+#include "cipher_aes_ccm.h"
+#include "cipher_aes_xts.h"
+
+#if defined(SPARC_AES_CAPABLE)
+
+/* MODES: ecb, cbc, cfb, ofb, ctr */
+
+static int t4_set_encrypt_key(const unsigned char *key, int bits, AES_KEY *ks)
+{
+    aes_t4_set_encrypt_key(key, bits, ks);
+    return 0;
+}
+
+static int t4_set_decrypt_key(const unsigned char *key, int bits, AES_KEY *ks)
+{
+    aes_t4_set_decrypt_key(key, bits, ks);
+    return 0;
+}
+
+static int cipher_hw_aes_t4_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    cbc128_f fn_cbc = NULL;
+    if ((ctx->mode == EVP_CIPH_ECB_MODE || ctx->mode == EVP_CIPH_CBC_MODE)
+        && !ctx->enc) {
+        switch (keylen) {
+        case 16:
+            fn_cbc = (cbc128_f)aes128_t4_cbc_decrypt;
+            break;
+        case 24:
+            fn_cbc = (cbc128_f)aes192_t4_cbc_decrypt;
+            break;
+        case 32:
+            fn_cbc = (cbc128_f)aes256_t4_cbc_decrypt;
+            break;
+        default:
+            ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
+            return 0;
+        }
+        return ossl_cipher_set_aes_initkey(ctx, key, keylen, t4_set_decrypt_key,
+            aes_t4_decrypt, NULL, fn_cbc, NULL);
+    } else {
+        ctr128_f fn_ctr = NULL;
+        switch (keylen) {
+        case 16:
+            fn_cbc = (cbc128_f)aes128_t4_cbc_encrypt;
+            fn_ctr = (ctr128_f)aes128_t4_ctr32_encrypt;
+            break;
+        case 24:
+            fn_cbc = (cbc128_f)aes192_t4_cbc_encrypt;
+            fn_ctr = (ctr128_f)aes192_t4_ctr32_encrypt;
+            break;
+        case 32:
+            fn_cbc = (cbc128_f)aes256_t4_cbc_encrypt;
+            fn_ctr = (ctr128_f)aes256_t4_ctr32_encrypt;
+            break;
+        default:
+            ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
+            return 0;
+        }
+        return ossl_cipher_set_aes_initkey(ctx, key, keylen, t4_set_encrypt_key,
+            aes_t4_encrypt, NULL, fn_cbc, fn_ctr);
+    }
+}
+
+static const PROV_CIPHER_HW aes_t4_ecb = {
+    cipher_hw_aes_t4_initkey,
+    ossl_cipher_hw_generic_ecb,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aes_t4_cbc = {
+    cipher_hw_aes_t4_initkey,
+    ossl_cipher_hw_generic_cbc,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aes_t4_cfb128 = {
+    cipher_hw_aes_t4_initkey,
+    ossl_cipher_hw_generic_cfb128,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aes_t4_cfb8 = {
+    cipher_hw_aes_t4_initkey,
+    ossl_cipher_hw_generic_cfb8,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aes_t4_cfb1 = {
+    cipher_hw_aes_t4_initkey,
+    ossl_cipher_hw_generic_cfb1,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aes_t4_ofb128 = {
+    cipher_hw_aes_t4_initkey,
+    ossl_cipher_hw_generic_ofb128,
+    ossl_cipher_aes_copyctx
+};
+
+static const PROV_CIPHER_HW aes_t4_ctr = {
+    cipher_hw_aes_t4_initkey,
+    ossl_cipher_hw_generic_ctr,
+    ossl_cipher_aes_copyctx
+};
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_t4(enum aes_modes mode)
+{
+    if (SPARC_AES_CAPABLE) {
+        switch (mode) {
+        case AES_MODE_ECB:
+            return &aes_t4_ecb;
+        case AES_MODE_CBC:
+            return &aes_t4_cbc;
+        case AES_MODE_CFB128:
+            return &aes_t4_cfb128;
+        case AES_MODE_CFB8:
+            return &aes_t4_cfb8;
+        case AES_MODE_CFB1:
+            return &aes_t4_cfb1;
+        case AES_MODE_OFB128:
+            return &aes_t4_ofb128;
+        case AES_MODE_CTR:
+            return &aes_t4_ctr;
+        default:
+            return NULL;
+        }
+    }
+    return NULL;
+}
+
+/* MODES: GCM */
+
+static int t4_aes_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
+    size_t keylen)
+{
+    switch (keylen) {
+    case 16:
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen,
+            t4_set_encrypt_key, aes_t4_encrypt,
+            (ctr128_f)aes128_t4_ctr32_encrypt);
+    case 24:
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen,
+            t4_set_encrypt_key, aes_t4_encrypt,
+            (ctr128_f)aes192_t4_ctr32_encrypt);
+    case 32:
+        return ossl_aes_gcm_hw_initkey(ctx, key, keylen,
+            t4_set_encrypt_key, aes_t4_encrypt,
+            (ctr128_f)aes256_t4_ctr32_encrypt);
+    default:
+        return 0;
+    }
+}
+
+static const PROV_GCM_HW t4_aes_gcm = {
+    t4_aes_gcm_initkey,
+    ossl_gcm_setiv,
+    ossl_gcm_aad_update,
+    ossl_generic_aes_gcm_cipher_update,
+    ossl_gcm_cipher_final,
+    ossl_gcm_one_shot
+};
+
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_t4(void)
+{
+    return SPARC_AES_CAPABLE ? &t4_aes_gcm : NULL;
+}
+
+/* MODES: CCM */
+
+static int ccm_t4_aes_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
+    size_t keylen)
+{
+    return ossl_cipher_set_ccm_aes_initkey(ctx, key, keylen,
+        t4_set_encrypt_key, aes_t4_encrypt, NULL, NULL);
+}
+
+static const PROV_CCM_HW t4_aes_ccm = {
+    ccm_t4_aes_initkey,
+    ossl_ccm_generic_setiv,
+    ossl_ccm_generic_setaad,
+    ossl_ccm_generic_auth_encrypt,
+    ossl_ccm_generic_auth_decrypt,
+    ossl_ccm_generic_gettag
+};
+
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm_t4(void)
+{
+    if (SPARC_AES_CAPABLE)
+        return &t4_aes_ccm;
+    return NULL;
+}
+
+/* MODES: XTS */
+
+static int cipher_hw_aes_xts_t4_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    OSSL_xts_stream_fn stream_enc = NULL;
+    OSSL_xts_stream_fn stream_dec = NULL;
+
+    /* Note: keylen is the size of 2 keys */
+    switch (keylen) {
+    case 32:
+        stream_enc = aes128_t4_xts_encrypt;
+        stream_dec = aes128_t4_xts_decrypt;
+        break;
+    case 64:
+        stream_enc = aes256_t4_xts_encrypt;
+        stream_dec = aes256_t4_xts_decrypt;
+        break;
+    default:
+        return 0;
+    }
+
+    return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+        t4_set_encrypt_key, t4_set_decrypt_key,
+        aes_t4_encrypt, aes_t4_decrypt, stream_enc, stream_dec);
+}
+
+static const PROV_CIPHER_HW aes_xts_t4 = {
+    cipher_hw_aes_xts_t4_initkey,
+    NULL,
+    ossl_cipher_hw_aes_xts_copyctx
+};
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_t4(void)
+{
+    if (SPARC_AES_CAPABLE)
+        return &aes_xts_t4;
+    return NULL;
+}
+
+#endif
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_t4.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_t4.inc
deleted file mode 100644
index 28454fc5089..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_hw_t4.inc
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * Sparc t4 support for AES modes ecb, cbc, ofb, cfb, ctr.
- * This file is included by cipher_aes_hw.c
- */
-
-static int cipher_hw_aes_t4_initkey(PROV_CIPHER_CTX *dat,
-                                    const unsigned char *key, size_t keylen)
-{
-    int ret, bits;
-    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
-    AES_KEY *ks = &adat->ks.ks;
-
-    dat->ks = (const void *)ks; /* used by cipher_hw_generic_XXX */
-
-    bits = keylen * 8;
-    if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
-        && !dat->enc) {
-        ret = 0;
-        aes_t4_set_decrypt_key(key, bits, ks);
-        dat->block = (block128_f)aes_t4_decrypt;
-        switch (bits) {
-        case 128:
-            dat->stream.cbc = dat->mode == EVP_CIPH_CBC_MODE ?
-                (cbc128_f)aes128_t4_cbc_decrypt : NULL;
-            break;
-        case 192:
-            dat->stream.cbc = dat->mode == EVP_CIPH_CBC_MODE ?
-                (cbc128_f)aes192_t4_cbc_decrypt : NULL;
-            break;
-        case 256:
-            dat->stream.cbc = dat->mode == EVP_CIPH_CBC_MODE ?
-                (cbc128_f)aes256_t4_cbc_decrypt : NULL;
-            break;
-        default:
-            ret = -1;
-        }
-    } else {
-        ret = 0;
-        aes_t4_set_encrypt_key(key, bits, ks);
-        dat->block = (block128_f)aes_t4_encrypt;
-        switch (bits) {
-        case 128:
-            if (dat->mode == EVP_CIPH_CBC_MODE)
-                dat->stream.cbc = (cbc128_f)aes128_t4_cbc_encrypt;
-            else if (dat->mode == EVP_CIPH_CTR_MODE)
-                dat->stream.ctr = (ctr128_f)aes128_t4_ctr32_encrypt;
-            else
-                dat->stream.cbc = NULL;
-            break;
-        case 192:
-            if (dat->mode == EVP_CIPH_CBC_MODE)
-                dat->stream.cbc = (cbc128_f)aes192_t4_cbc_encrypt;
-            else if (dat->mode == EVP_CIPH_CTR_MODE)
-                dat->stream.ctr = (ctr128_f)aes192_t4_ctr32_encrypt;
-            else
-                dat->stream.cbc = NULL;
-            break;
-        case 256:
-            if (dat->mode == EVP_CIPH_CBC_MODE)
-                dat->stream.cbc = (cbc128_f)aes256_t4_cbc_encrypt;
-            else if (dat->mode == EVP_CIPH_CTR_MODE)
-                dat->stream.ctr = (ctr128_f)aes256_t4_ctr32_encrypt;
-            else
-                dat->stream.cbc = NULL;
-            break;
-        default:
-            ret = -1;
-        }
-    }
-
-    if (ret < 0) {
-        ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
-        return 0;
-    }
-
-    return 1;
-}
-
-#define PROV_CIPHER_HW_declare(mode)                                           \
-static const PROV_CIPHER_HW aes_t4_##mode = {                                  \
-    cipher_hw_aes_t4_initkey,                                                  \
-    ossl_cipher_hw_generic_##mode,                                             \
-    cipher_hw_aes_copyctx                                                      \
-};
-#define PROV_CIPHER_HW_select(mode)                                            \
-    if (SPARC_AES_CAPABLE)                                                     \
-        return &aes_t4_##mode;
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.c
index 62e5a0c1a76..433e0265980 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.c
@@ -19,6 +19,7 @@
 #include "prov/providercommon.h"
 #include "prov/ciphercommon_aead.h"
 #include "prov/implementations.h"
+#include "providers/implementations/ciphers/cipher_aes_ocb.inc"

 #define AES_OCB_FLAGS AEAD_FLAGS

@@ -67,7 +68,14 @@ static ossl_inline int aes_generic_ocb_gettag(PROV_AES_OCB_CTX *ctx,

 static ossl_inline int aes_generic_ocb_final(PROV_AES_OCB_CTX *ctx)
 {
-    return (CRYPTO_ocb128_finish(&ctx->ocb, ctx->tag, ctx->taglen) == 0);
+    int ret = CRYPTO_ocb128_finish(&ctx->ocb, ctx->tag, ctx->taglen);
+
+    /* ret: -1 = bad tag length, 0 = tag verified, otherwise = tag mismatch */
+    if (ret == -1)
+        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG_LENGTH);
+    else if (ret != 0)
+        ERR_raise(ERR_LIB_PROV, PROV_R_BAD_DECRYPT);
+    return ret == 0;
 }

 static ossl_inline void aes_generic_ocb_cleanup(PROV_AES_OCB_CTX *ctx)
@@ -306,9 +314,7 @@ static void *aes_ocb_newctx(void *provctx, size_t kbits, size_t blkbits,
 {
     PROV_AES_OCB_CTX *ctx;

-    if (!ossl_prov_is_running())
-        return NULL;
-
+    CIPHER_PROV_CHECK(provctx, AES_128_OCB);
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx != NULL) {
         ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, mode, flags,
@@ -348,43 +354,48 @@ static void *aes_ocb_dupctx(void *vctx)
     return ret;
 }

+static const OSSL_PARAM *cipher_ocb_settable_ctx_params(ossl_unused void *cctx,
+    ossl_unused void *p_ctx)
+{
+    return aes_ocb_set_ctx_params_list;
+}
+
 static int aes_ocb_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_AES_OCB_CTX *ctx = (PROV_AES_OCB_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct aes_ocb_set_ctx_params_st p;
     size_t sz;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !aes_ocb_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_TAG);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+    if (p.tag != NULL) {
+        if (p.tag->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        if (p->data == NULL) {
+        if (p.tag->data == NULL) {
             /* Tag len must be 0 to 16 */
-            if (p->data_size > OCB_MAX_TAG_LEN) {
+            if (p.tag->data_size > OCB_MAX_TAG_LEN) {
                 ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG_LENGTH);
                 return 0;
             }
-            ctx->taglen = p->data_size;
+            ctx->taglen = p.tag->data_size;
         } else {
             if (ctx->base.enc) {
-                ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
+                ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_NEEDED);
                 return 0;
             }
-            if (p->data_size != ctx->taglen) {
+            if (p.tag->data_size != ctx->taglen) {
                 ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG_LENGTH);
                 return 0;
             }
-            memcpy(ctx->tag, p->data, p->data_size);
+            memcpy(ctx->tag, p.tag->data, p.tag->data_size);
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_IVLEN);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &sz)) {
+
+    if (p.ivlen != NULL) {
+        if (!OSSL_PARAM_get_size_t(p.ivlen, &sz)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -396,11 +407,11 @@ static int aes_ocb_set_ctx_params(void *vctx, const OSSL_PARAM params[])
             ctx->iv_state = IV_STATE_UNINITIALISED;
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL) {
+
+    if (p.keylen != NULL) {
         size_t keylen;

-        if (!OSSL_PARAM_get_size_t(p, &keylen)) {
+        if (!OSSL_PARAM_get_size_t(p.keylen, &keylen)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -412,95 +423,79 @@ static int aes_ocb_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     return 1;
 }

+static const OSSL_PARAM *cipher_ocb_gettable_ctx_params(ossl_unused void *cctx,
+    ossl_unused void *p_ctx)
+{
+    return aes_ocb_get_ctx_params_list;
+}
+
 static int aes_ocb_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_AES_OCB_CTX *ctx = (PROV_AES_OCB_CTX *)vctx;
-    OSSL_PARAM *p;
+    struct aes_ocb_get_ctx_params_st p;
+
+    if (ctx == NULL || !aes_ocb_get_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->base.ivlen)) {
+    if (p.ivlen != NULL && !OSSL_PARAM_set_size_t(p.ivlen, ctx->base.ivlen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->base.keylen)) {
+
+    if (p.keylen != NULL && !OSSL_PARAM_set_size_t(p.keylen, ctx->base.keylen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD_TAGLEN);
-    if (p != NULL) {
-        if (!OSSL_PARAM_set_size_t(p, ctx->taglen)) {
+
+    if (p.taglen != NULL) {
+        if (!OSSL_PARAM_set_size_t(p.taglen, ctx->taglen)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
             return 0;
         }
     }

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IV);
-    if (p != NULL) {
-        if (ctx->base.ivlen > p->data_size) {
+    if (p.iv != NULL) {
+        if (ctx->base.ivlen > p.iv->data_size) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
             return 0;
         }
-        if (!OSSL_PARAM_set_octet_string(p, ctx->base.oiv, ctx->base.ivlen)
-            && !OSSL_PARAM_set_octet_ptr(p, &ctx->base.oiv, ctx->base.ivlen)) {
+        if (!OSSL_PARAM_set_octet_string_or_ptr(p.iv, ctx->base.oiv,
+                ctx->base.ivlen)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
             return 0;
         }
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_UPDATED_IV);
-    if (p != NULL) {
-        if (ctx->base.ivlen > p->data_size) {
+
+    if (p.upd_iv != NULL) {
+        if (ctx->base.ivlen > p.upd_iv->data_size) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
             return 0;
         }
-        if (!OSSL_PARAM_set_octet_string(p, ctx->base.iv, ctx->base.ivlen)
-            && !OSSL_PARAM_set_octet_ptr(p, &ctx->base.iv, ctx->base.ivlen)) {
+        if (!OSSL_PARAM_set_octet_string_or_ptr(p.upd_iv, ctx->base.iv,
+                ctx->base.ivlen)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
             return 0;
         }
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD_TAG);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+
+    if (p.tag != NULL) {
+        if (p.tag->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        if (!ctx->base.enc || p->data_size != ctx->taglen) {
+        if (!ctx->base.enc) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_SET);
+            return 0;
+        }
+        if (p.tag->data_size != ctx->taglen) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG_LENGTH);
             return 0;
         }
-        memcpy(p->data, ctx->tag, ctx->taglen);
+        memcpy(p.tag->data, ctx->tag, ctx->taglen);
     }
     return 1;
 }

-static const OSSL_PARAM cipher_ocb_known_gettable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_IVLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_AEAD_TAGLEN, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_IV, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_UPDATED_IV, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TAG, NULL, 0),
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM *cipher_ocb_gettable_ctx_params(ossl_unused void *cctx,
-    ossl_unused void *p_ctx)
-{
-    return cipher_ocb_known_gettable_ctx_params;
-}
-
-static const OSSL_PARAM cipher_ocb_known_settable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_AEAD_IVLEN, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TAG, NULL, 0),
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM *cipher_ocb_settable_ctx_params(ossl_unused void *cctx,
-    ossl_unused void *p_ctx)
-{
-    return cipher_ocb_known_settable_ctx_params;
-}
-
 static int aes_ocb_cipher(void *vctx, unsigned char *out, size_t *outl,
     size_t outsize, const unsigned char *in, size_t inl)
 {
@@ -509,7 +504,11 @@ static int aes_ocb_cipher(void *vctx, unsigned char *out, size_t *outl,
     if (!ossl_prov_is_running())
         return 0;

-    /* NULL input indicates Final, which must generate or check the tag. */
+    /*
+     * EVP_Cipher() MUST CHECK THE TAG
+     * in == NULL indicates finalize, so hand it to the finalize path
+     * (which checks the tag on decrypt / produces it on encrypt)
+     */
     if (in == NULL)
         return aes_ocb_block_final(vctx, out, outl, outsize);

diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.h
index b0348256034..4825761a957 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_OCB_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_OCB_H
+
 #include <openssl/aes.h>
 #include "prov/ciphercommon.h"
 #include "crypto/aes_platform.h"
@@ -37,3 +40,5 @@ typedef struct prov_aes_ocb_ctx_st {
 } PROV_AES_OCB_CTX;

 const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ocb(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_OCB_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.inc.in
new file mode 100644
index 00000000000..48c46894f0a
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.inc.in
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('aes_ocb_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',     'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_IVLEN', 'ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAG',   'tag',    'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('aes_ocb_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',      'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',       'ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IV',          'iv',     'octet_string'],
+                          ['OSSL_CIPHER_PARAM_UPDATED_IV',  'upd_iv', 'octet_string'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAG',    'tag',    'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb_hw.c
index e643e1b5968..fc347b11f96 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,8 +19,8 @@
     fn_block_enc, fn_block_dec,                                                 \
     fn_stream_enc, fn_stream_dec)                                               \
     CRYPTO_ocb128_cleanup(&ctx->ocb);                                           \
-    fn_set_enc_key(key, keylen * 8, &ctx->ksenc.ks);                            \
-    fn_set_dec_key(key, keylen * 8, &ctx->ksdec.ks);                            \
+    fn_set_enc_key(key, (int)(keylen * 8), &ctx->ksenc.ks);                     \
+    fn_set_dec_key(key, (int)(keylen * 8), &ctx->ksdec.ks);                     \
     if (!CRYPTO_ocb128_init(&ctx->ocb, &ctx->ksenc.ks, &ctx->ksdec.ks,          \
             (block128_f)fn_block_enc, (block128_f)fn_block_dec,                 \
             ctx->base.enc ? (ocb128_f)fn_stream_enc : (ocb128_f)fn_stream_dec)) \
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv.c
index 08a8ac079d3..3c358f33e10 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv.c
@@ -21,6 +21,7 @@
 #include "prov/providercommon.h"
 #include "prov/ciphercommon_aead.h"
 #include "prov/provider_ctx.h"
+#include "providers/implementations/ciphers/cipher_aes_siv.inc"

 #define siv_stream_update siv_cipher
 #define SIV_FLAGS AEAD_FLAGS
@@ -150,76 +151,75 @@ static int siv_stream_final(void *vctx, unsigned char *out, size_t *outl,
 static int aes_siv_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_AES_SIV_CTX *ctx = (PROV_AES_SIV_CTX *)vctx;
-    SIV128_CONTEXT *sctx = &ctx->siv;
-    OSSL_PARAM *p;
+    SIV128_CONTEXT *sctx;
+    struct aes_siv_get_ctx_params_st p;
+
+    if (ctx == NULL || !aes_siv_get_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD_TAG);
-    if (p != NULL && p->data_type == OSSL_PARAM_OCTET_STRING) {
+    sctx = &ctx->siv;
+
+    if (p.tag != NULL) {
         if (!ctx->enc
-            || p->data_size != ctx->taglen
-            || !OSSL_PARAM_set_octet_string(p, &sctx->tag.byte, ctx->taglen)) {
+            || p.tag->data_type != OSSL_PARAM_OCTET_STRING
+            || p.tag->data_size != ctx->taglen
+            || !OSSL_PARAM_set_octet_string(p.tag, &sctx->tag.byte,
+                ctx->taglen)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
             return 0;
         }
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD_TAGLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->taglen)) {
+
+    if (p.taglen != NULL && !OSSL_PARAM_set_size_t(p.taglen, ctx->taglen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->keylen)) {
+
+    if (p.keylen != NULL && !OSSL_PARAM_set_size_t(p.keylen, ctx->keylen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
     return 1;
 }

-static const OSSL_PARAM aes_siv_known_gettable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_AEAD_TAGLEN, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TAG, NULL, 0),
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *aes_siv_gettable_ctx_params(ossl_unused void *cctx,
     ossl_unused void *provctx)
 {
-    return aes_siv_known_gettable_ctx_params;
+    return aes_siv_get_ctx_params_list;
 }

 static int aes_siv_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_AES_SIV_CTX *ctx = (PROV_AES_SIV_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct aes_siv_set_ctx_params_st p;
     unsigned int speed = 0;
     SIV128_CONTEXT *sctx = &ctx->siv;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !aes_siv_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_TAG);
-    if (p != NULL) {
+    if (p.tag != NULL) {
         if (ctx->enc)
             return 1;
-        if (p->data_type != OSSL_PARAM_OCTET_STRING
-            || !ctx->hw->settag(ctx, p->data, p->data_size)) {
+        if (p.tag->data_type != OSSL_PARAM_OCTET_STRING
+            || !ctx->hw->settag(ctx, p.tag->data, p.tag->data_size)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_SPEED);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_uint(p, &speed)) {
+
+    if (p.speed != NULL) {
+        if (!OSSL_PARAM_get_uint(p.speed, &speed)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
         ctx->hw->setspeed(ctx, (int)speed);
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL) {
+
+    if (p.keylen != NULL) {
         size_t keylen;

-        if (!OSSL_PARAM_get_size_t(p, &keylen)) {
+        if (!OSSL_PARAM_get_size_t(p.keylen, &keylen)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -232,16 +232,10 @@ static int aes_siv_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     return 1;
 }

-static const OSSL_PARAM aes_siv_known_settable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_uint(OSSL_CIPHER_PARAM_SPEED, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TAG, NULL, 0),
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *aes_siv_settable_ctx_params(ossl_unused void *cctx,
     ossl_unused void *provctx)
 {
-    return aes_siv_known_settable_ctx_params;
+    return aes_siv_set_ctx_params_list;
 }

 #define IMPLEMENT_cipher(alg, lc, UCMODE, flags, kbits, blkbits, ivbits)         \
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv.h
index 28f6668a29a..ef58aa6a61a 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_SIV_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_SIV_H
+
 #include "prov/ciphercommon.h"
 #include "crypto/aes_platform.h"
 #include "crypto/siv.h"
@@ -34,3 +37,5 @@ typedef struct prov_siv_ctx_st {
 } PROV_AES_SIV_CTX;

 const PROV_CIPHER_HW_AES_SIV *ossl_prov_cipher_hw_aes_siv(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_SIV_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv.inc.in
new file mode 100644
index 00000000000..cdbfd5ef191
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv.inc.in
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('aes_siv_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',      'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAG',    'tag',    'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('aes_siv_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',   'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_SPEED',    'speed',  'uint'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag',    'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv_hw.c
index d24124065e1..a1db52ade62 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_siv_hw.c
@@ -52,7 +52,7 @@ static int aes_siv_initkey(void *vctx, const unsigned char *key, size_t keylen)
      * klen is the length of the underlying cipher, not the input key,
      * which should be twice as long
      */
-    return ossl_siv128_init(sctx, key, klen, ctx->cbc, ctx->ctr, libctx,
+    return ossl_siv128_init(sctx, key, (int)klen, ctx->cbc, ctx->ctr, libctx,
         propq);
 }

diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_wrp.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_wrp.c
index b8e7db39a31..ec94ea7fd42 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_wrp.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_wrp.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,6 +17,7 @@
 #include "cipher_aes.h"
 #include "prov/providercommon.h"
 #include "prov/implementations.h"
+#include "providers/implementations/ciphers/cipher_aes_wrp.inc"

 /* AES wrap with padding has IV length of 4, without padding 8 */
 #define AES_WRAP_PAD_IVLEN 4
@@ -43,18 +44,17 @@ typedef struct prov_aes_wrap_ctx_st {
         AES_KEY ks;
     } ks;
     aeswrap_fn wrapfn;
+    int updated;

 } PROV_AES_WRAP_CTX;

-static void *aes_wrap_newctx(size_t kbits, size_t blkbits,
+static void *aes_wrap_newctx(void *provctx, size_t kbits, size_t blkbits,
     size_t ivbits, unsigned int mode, uint64_t flags)
 {
     PROV_AES_WRAP_CTX *wctx;
     PROV_CIPHER_CTX *ctx;

-    if (!ossl_prov_is_running())
-        return NULL;
-
+    CIPHER_PROV_CHECK(provctx, AES_128_WRP);
     wctx = OPENSSL_zalloc(sizeof(*wctx));
     ctx = (PROV_CIPHER_CTX *)wctx;
     if (ctx != NULL) {
@@ -76,14 +76,10 @@ static void *aes_wrap_dupctx(void *wctx)
     if (ctx == NULL)
         return NULL;
     dctx = OPENSSL_memdup(ctx, sizeof(*ctx));
-
-    if (dctx != NULL && dctx->base.tlsmac != NULL && dctx->base.alloced) {
-        dctx->base.tlsmac = OPENSSL_memdup(dctx->base.tlsmac,
-            dctx->base.tlsmacsize);
-        if (dctx->base.tlsmac == NULL) {
-            OPENSSL_free(dctx);
-            dctx = NULL;
-        }
+    if (dctx != NULL
+        && !ossl_cipher_generic_dupctx_tlsmac(&dctx->base, &ctx->base)) {
+        OPENSSL_clear_free(dctx, sizeof(*dctx));
+        return NULL;
     }
     return dctx;
 }
@@ -106,6 +102,7 @@ static int aes_wrap_init(void *vctx, const unsigned char *key,
     if (!ossl_prov_is_running())
         return 0;

+    wctx->updated = 0;
     ctx->enc = enc;
     if (ctx->pad)
         wctx->wrapfn = enc ? CRYPTO_128_wrap_pad : CRYPTO_128_unwrap_pad;
@@ -137,12 +134,13 @@ static int aes_wrap_init(void *vctx, const unsigned char *key,
         else
             use_forward_transform = !ctx->enc;
         if (use_forward_transform) {
-            AES_set_encrypt_key(key, keylen * 8, &wctx->ks.ks);
+            AES_set_encrypt_key(key, (int)(keylen * 8), &wctx->ks.ks);
             ctx->block = (block128_f)AES_encrypt;
         } else {
-            AES_set_decrypt_key(key, keylen * 8, &wctx->ks.ks);
+            AES_set_decrypt_key(key, (int)(keylen * 8), &wctx->ks.ks);
             ctx->block = (block128_f)AES_decrypt;
         }
+        ctx->key_set = 1;
     }
     return aes_wrap_set_ctx_params(ctx, params);
 }
@@ -174,7 +172,7 @@ static int aes_wrap_cipher_internal(void *vctx, unsigned char *out,
         return 0;

     /* Input length must always be non-zero */
-    if (inlen == 0) {
+    if (inlen == 0 || inlen > INT_MAX) {
         ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_INPUT_LENGTH);
         return -1;
     }
@@ -197,17 +195,31 @@ static int aes_wrap_cipher_internal(void *vctx, unsigned char *out,
             if (pad)
                 inlen = (inlen + 7) / 8 * 8;
             /* 8 byte prefix */
-            return inlen + 8;
+            return (int)(inlen + 8);
         } else {
             /*
              * If not padding output will be exactly 8 bytes smaller than
              * input. If padding it will be at least 8 bytes smaller but we
              * don't know how much.
              */
-            return inlen - 8;
+            return (int)(inlen - 8);
         }
     }

+    /*
+     * Multiple calls to update are not allowed, since the algorithm
+     * relies on all fields being present.
+     */
+    if (wctx->updated) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_UPDATE_CALL_OUT_OF_ORDER);
+        return -1;
+    }
+    if (!ctx->key_set) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_NO_KEY_SET);
+        return -1;
+    }
+    wctx->updated = 1;
+
     rv = wctx->wrapfn(&wctx->ks.ks, ctx->iv_set ? ctx->iv : NULL, out, in,
         inlen, ctx->block);
     if (!rv) {
@@ -236,7 +248,7 @@ static int aes_wrap_cipher(void *vctx,
     const unsigned char *in, size_t inl)
 {
     PROV_AES_WRAP_CTX *ctx = (PROV_AES_WRAP_CTX *)vctx;
-    size_t len;
+    int len;

     if (!ossl_prov_is_running())
         return 0;
@@ -255,22 +267,27 @@ static int aes_wrap_cipher(void *vctx,
     if (len <= 0)
         return 0;

-    *outl = len;
+    *outl = (size_t)len;
     return 1;
 }

+static const OSSL_PARAM *aes_wrap_settable_ctx_params(ossl_unused void *cctx,
+    ossl_unused void *provctx)
+{
+    return aes_wrap_set_ctx_params_list;
+}
+
 static int aes_wrap_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct aes_wrap_set_ctx_params_st p;
     size_t keylen = 0;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !aes_wrap_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &keylen)) {
+    if (p.keylen != NULL) {
+        if (!OSSL_PARAM_get_size_t(p.keylen, &keylen)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -292,7 +309,7 @@ static int aes_wrap_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     static OSSL_FUNC_cipher_newctx_fn aes_##kbits##fname##_newctx;              \
     static void *aes_##kbits##fname##_newctx(void *provctx)                     \
     {                                                                           \
-        return aes_##mode##_newctx(kbits, blkbits, ivbits,                      \
+        return aes_##mode##_newctx(provctx, kbits, blkbits, ivbits,             \
             EVP_CIPH_##UCMODE##_MODE, flags);                                   \
     }                                                                           \
     const OSSL_DISPATCH ossl_##aes##kbits##fname##_functions[] = {              \
@@ -310,12 +327,12 @@ static int aes_wrap_set_ctx_params(void *vctx, const OSSL_PARAM params[])
             (void (*)(void))ossl_cipher_generic_gettable_params },              \
         { OSSL_FUNC_CIPHER_GET_CTX_PARAMS,                                      \
             (void (*)(void))ossl_cipher_generic_get_ctx_params },               \
-        { OSSL_FUNC_CIPHER_SET_CTX_PARAMS,                                      \
-            (void (*)(void))aes_wrap_set_ctx_params },                          \
         { OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS,                                 \
             (void (*)(void))ossl_cipher_generic_gettable_ctx_params },          \
+        { OSSL_FUNC_CIPHER_SET_CTX_PARAMS,                                      \
+            (void (*)(void))aes_wrap_set_ctx_params },                          \
         { OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS,                                 \
-            (void (*)(void))ossl_cipher_generic_settable_ctx_params },          \
+            (void (*)(void))aes_wrap_settable_ctx_params },                     \
         OSSL_DISPATCH_END                                                       \
     }

diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_wrp.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_wrp.inc.in
new file mode 100644
index 00000000000..3d2aa1526e4
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_wrp.inc.in
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('aes_wrap_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts.c
index e0aeed723ab..54820469a98 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts.c
@@ -1,6 +1,6 @@

 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,6 +19,7 @@
 #include "cipher_aes_xts.h"
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
+#include "providers/implementations/ciphers/cipher_aes_xts.inc"

 #define AES_XTS_FLAGS PROV_CIPHER_FLAG_CUSTOM_IV
 #define AES_XTS_IV_BITS 128
@@ -62,10 +63,6 @@ static int aes_xts_check_keys_differ(const unsigned char *key, size_t bytes,
     return 1;
 }

-#ifdef AES_XTS_S390X
-#include "cipher_aes_xts_s390x.inc"
-#endif
-
 /*-
  * Provider dispatch functions
  */
@@ -95,6 +92,13 @@ static int aes_xts_init(void *vctx, const unsigned char *key, size_t keylen,
         if (!ctx->hw->init(ctx, key, keylen))
             return 0;
     }
+#ifdef AES_XTS_S390X
+    else if (xctx->plat.s390x.fc && ctx->iv_set) {
+        /* special handle iv-only update */
+        if (!ctx->hw->init(ctx, NULL, 0))
+            return 0;
+    }
+#endif
     return aes_xts_set_ctx_params(ctx, params);
 }

@@ -102,10 +106,6 @@ static int aes_xts_einit(void *vctx, const unsigned char *key, size_t keylen,
     const unsigned char *iv, size_t ivlen,
     const OSSL_PARAM params[])
 {
-#ifdef AES_XTS_S390X
-    if (s390x_aes_xts_einit(vctx, key, keylen, iv, ivlen, params) == 1)
-        return 1;
-#endif
     return aes_xts_init(vctx, key, keylen, iv, ivlen, params, 1);
 }

@@ -113,10 +113,6 @@ static int aes_xts_dinit(void *vctx, const unsigned char *key, size_t keylen,
     const unsigned char *iv, size_t ivlen,
     const OSSL_PARAM params[])
 {
-#ifdef AES_XTS_S390X
-    if (s390x_aes_xts_dinit(vctx, key, keylen, iv, ivlen, params) == 1)
-        return 1;
-#endif
     return aes_xts_init(vctx, key, keylen, iv, ivlen, params, 0);
 }

@@ -125,9 +121,7 @@ static void *aes_xts_newctx(void *provctx, unsigned int mode, uint64_t flags,
 {
     PROV_AES_XTS_CTX *ctx;

-    if (!ossl_prov_is_running())
-        return NULL;
-
+    CIPHER_PROV_CHECK(provctx, AES_128_XTS);
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx != NULL) {
         ossl_cipher_generic_initkey(&ctx->base, kbits, blkbits, ivbits, mode,
@@ -153,11 +147,6 @@ static void *aes_xts_dupctx(void *vctx)
     if (!ossl_prov_is_running())
         return NULL;

-#ifdef AES_XTS_S390X
-    if (in->plat.s390x.fc)
-        return s390x_aes_xts_dupctx(vctx);
-#endif
-
     if (in->xts.key1 != NULL) {
         if (in->xts.key1 != &in->ks1)
             return NULL;
@@ -178,20 +167,24 @@ static int aes_xts_cipher(void *vctx, unsigned char *out, size_t *outl,
 {
     PROV_AES_XTS_CTX *ctx = (PROV_AES_XTS_CTX *)vctx;

-#ifdef AES_XTS_S390X
-    if (ctx->plat.s390x.fc)
-        return s390x_aes_xts_cipher(vctx, out, outl, outsize, in, inl);
-#endif
-
     if (!ossl_prov_is_running()
-        || ctx->xts.key1 == NULL
-        || ctx->xts.key2 == NULL
-        || !ctx->base.iv_set
-        || out == NULL
+        || inl < AES_BLOCK_SIZE
         || in == NULL
-        || inl < AES_BLOCK_SIZE)
+        || out == NULL)
         return 0;

+#ifdef AES_XTS_S390X
+    if (ctx->plat.s390x.fc) {
+        if (!ctx->plat.s390x.iv_set || !ctx->plat.s390x.key_set)
+            return 0;
+    } else
+#endif
+    {
+        if (ctx->xts.key1 == NULL || ctx->xts.key2 == NULL
+            || !ctx->base.iv_set)
+            return 0;
+    }
+
     /*
      * Impose a limit of 2^20 blocks per data unit as specified by
      * IEEE Std 1619-2018.  The earlier and obsolete IEEE Std 1619-2007
@@ -203,6 +196,11 @@ static int aes_xts_cipher(void *vctx, unsigned char *out, size_t *outl,
         return 0;
     }

+#ifdef AES_XTS_S390X
+    if (ctx->plat.s390x.fc)
+        return s390x_aes_xts_cipher_stream(ctx, out, outl, in, inl);
+#endif
+
     if (ctx->stream != NULL)
         (*ctx->stream)(in, out, inl, ctx->xts.key1, ctx->xts.key2, ctx->base.iv);
     else if (CRYPTO_xts128_encrypt(&ctx->xts, ctx->base.iv, in, out, inl,
@@ -241,30 +239,24 @@ static int aes_xts_stream_final(void *vctx, unsigned char *out, size_t *outl,
     return 1;
 }

-static const OSSL_PARAM aes_xts_known_settable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *aes_xts_settable_ctx_params(ossl_unused void *cctx,
     ossl_unused void *provctx)
 {
-    return aes_xts_known_settable_ctx_params;
+    return aes_xts_set_ctx_params_list;
 }

 static int aes_xts_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct aes_xts_set_ctx_params_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !aes_xts_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL) {
+    if (p.keylen != NULL) {
         size_t keylen;

-        if (!OSSL_PARAM_get_size_t(p, &keylen)) {
+        if (!OSSL_PARAM_get_size_t(p.keylen, &keylen)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts.h
index 2ffc143f21f..45bb7980dbc 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_XTS_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_XTS_H
+
 #include <openssl/aes.h>
 #include "prov/ciphercommon.h"
 #include "crypto/aes_platform.h"
@@ -57,4 +60,39 @@ typedef struct prov_aes_xts_ctx_st {
     } plat;
 } PROV_AES_XTS_CTX;

+int ossl_cipher_set_aes_xts_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen,
+    aes_set_encrypt_key_fn fn_set_enc_key,
+    aes_set_encrypt_key_fn fn_set_dec_key,
+    aes_block128_f fn_block_enc, aes_block128_f fn_block_dec,
+    OSSL_xts_stream_fn fn_stream_enc, OSSL_xts_stream_fn fn_stream_dec);
+
+void ossl_cipher_hw_aes_xts_copyctx(PROV_CIPHER_CTX *dst,
+    const PROV_CIPHER_CTX *src);
+
+#if defined(AESNI_CAPABLE)
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_aesni(void);
+#endif
+
+#if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_rv32i(void);
+#endif
+
+#if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_rv64i(void);
+#endif
+
+#ifdef AES_XTS_S390X
+int s390x_aes_xts_cipher_stream(PROV_AES_XTS_CTX *xctx,
+    unsigned char *out, size_t *outl,
+    const unsigned char *in, size_t inl);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_s390x(size_t keybits);
+#endif
+
+#if defined(SPARC_AES_CAPABLE)
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_t4(void);
+#endif
+
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_XTS_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts.inc.in
new file mode 100644
index 00000000000..24eb61ed8d3
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts.inc.in
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('aes_xts_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts_hw.c
index 5de5cf5ab79..5e2be923821 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,32 +15,37 @@

 #include "cipher_aes_xts.h"

-#define XTS_SET_KEY_FN(fn_set_enc_key, fn_set_dec_key,           \
-    fn_block_enc, fn_block_dec,                                  \
-    fn_stream_enc, fn_stream_dec)                                \
-    {                                                            \
-        size_t bytes = keylen / 2;                               \
-        size_t bits = bytes * 8;                                 \
-                                                                 \
-        if (ctx->enc) {                                          \
-            fn_set_enc_key(key, bits, &xctx->ks1.ks);            \
-            xctx->xts.block1 = (block128_f)fn_block_enc;         \
-        } else {                                                 \
-            fn_set_dec_key(key, bits, &xctx->ks1.ks);            \
-            xctx->xts.block1 = (block128_f)fn_block_dec;         \
-        }                                                        \
-        fn_set_enc_key(key + bytes, bits, &xctx->ks2.ks);        \
-        xctx->xts.block2 = (block128_f)fn_block_enc;             \
-        xctx->xts.key1 = &xctx->ks1;                             \
-        xctx->xts.key2 = &xctx->ks2;                             \
-        xctx->stream = ctx->enc ? fn_stream_enc : fn_stream_dec; \
+int ossl_cipher_set_aes_xts_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen,
+    aes_set_encrypt_key_fn fn_set_enc_key,
+    aes_set_encrypt_key_fn fn_set_dec_key,
+    aes_block128_f fn_block_enc, aes_block128_f fn_block_dec,
+    OSSL_xts_stream_fn fn_stream_enc, OSSL_xts_stream_fn fn_stream_dec)
+{
+    PROV_AES_XTS_CTX *xctx = (PROV_AES_XTS_CTX *)ctx;
+    size_t bytes = keylen / 2;
+    size_t bits = bytes * 8;
+
+    if (ctx->enc) {
+        fn_set_enc_key(key, (int)bits, &xctx->ks1.ks);
+        xctx->xts.block1 = (block128_f)fn_block_enc;
+    } else {
+        fn_set_dec_key(key, (int)bits, &xctx->ks1.ks);
+        xctx->xts.block1 = (block128_f)fn_block_dec;
     }
+    fn_set_enc_key(key + bytes, (int)bits, &xctx->ks2.ks);
+    xctx->xts.block2 = (block128_f)fn_block_enc;
+    xctx->xts.key1 = &xctx->ks1;
+    xctx->xts.key2 = &xctx->ks2;
+    xctx->stream = ctx->enc ? fn_stream_enc : fn_stream_dec;
+
+    return 1;
+}

 static int cipher_hw_aes_xts_generic_initkey(PROV_CIPHER_CTX *ctx,
     const unsigned char *key,
     size_t keylen)
 {
-    PROV_AES_XTS_CTX *xctx = (PROV_AES_XTS_CTX *)ctx;
     OSSL_xts_stream_fn stream_enc = NULL;
     OSSL_xts_stream_fn stream_dec = NULL;

@@ -57,37 +62,36 @@ static int cipher_hw_aes_xts_generic_initkey(PROV_CIPHER_CTX *ctx,
 #ifdef HWAES_xts_decrypt
         stream_dec = HWAES_xts_decrypt;
 #endif /* HWAES_xts_decrypt */
-        XTS_SET_KEY_FN(HWAES_set_encrypt_key, HWAES_set_decrypt_key,
-            HWAES_encrypt, HWAES_decrypt,
-            stream_enc, stream_dec);
-        return 1;
-    } else
+        return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+            HWAES_set_encrypt_key, HWAES_set_decrypt_key,
+            HWAES_encrypt, HWAES_decrypt, stream_enc, stream_dec);
+    }
 #endif /* HWAES_CAPABLE */

 #ifdef BSAES_CAPABLE
-        if (BSAES_CAPABLE) {
+    if (BSAES_CAPABLE) {
         stream_enc = ossl_bsaes_xts_encrypt;
         stream_dec = ossl_bsaes_xts_decrypt;
-    } else
+        return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+            AES_set_encrypt_key, AES_set_decrypt_key,
+            AES_encrypt, AES_decrypt, stream_enc, stream_dec);
+    }
 #endif /* BSAES_CAPABLE */
+
 #ifdef VPAES_CAPABLE
-        if (VPAES_CAPABLE) {
-        XTS_SET_KEY_FN(vpaes_set_encrypt_key, vpaes_set_decrypt_key,
+    if (VPAES_CAPABLE) {
+        return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+            vpaes_set_encrypt_key, vpaes_set_decrypt_key,
             vpaes_encrypt, vpaes_decrypt, stream_enc, stream_dec);
-        return 1;
-    } else
-#endif /* VPAES_CAPABLE */
-    {
-        (void)0;
     }
-    {
-        XTS_SET_KEY_FN(AES_set_encrypt_key, AES_set_decrypt_key,
-            AES_encrypt, AES_decrypt, stream_enc, stream_dec);
-    }
-    return 1;
+#endif /* VPAES_CAPABLE */
+
+    return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+        AES_set_encrypt_key, AES_set_decrypt_key,
+        AES_encrypt, AES_decrypt, stream_enc, stream_dec);
 }

-static void cipher_hw_aes_xts_copyctx(PROV_CIPHER_CTX *dst,
+void ossl_cipher_hw_aes_xts_copyctx(PROV_CIPHER_CTX *dst,
     const PROV_CIPHER_CTX *src)
 {
     PROV_AES_XTS_CTX *sctx = (PROV_AES_XTS_CTX *)src;
@@ -98,234 +102,30 @@ static void cipher_hw_aes_xts_copyctx(PROV_CIPHER_CTX *dst,
     dctx->xts.key2 = &dctx->ks2.ks;
 }

-#if defined(AESNI_CAPABLE)
+static const PROV_CIPHER_HW aes_generic_xts = {
+    cipher_hw_aes_xts_generic_initkey,
+    NULL,
+    ossl_cipher_hw_aes_xts_copyctx
+};

-static int cipher_hw_aesni_xts_initkey(PROV_CIPHER_CTX *ctx,
-    const unsigned char *key, size_t keylen)
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts(size_t keybits)
 {
-    PROV_AES_XTS_CTX *xctx = (PROV_AES_XTS_CTX *)ctx;
-
-    void (*aesni_xts_enc)(const unsigned char *in,
-        unsigned char *out,
-        size_t length,
-        const AES_KEY *key1, const AES_KEY *key2,
-        const unsigned char iv[16]);
-    void (*aesni_xts_dec)(const unsigned char *in,
-        unsigned char *out,
-        size_t length,
-        const AES_KEY *key1, const AES_KEY *key2,
-        const unsigned char iv[16]);
-
-    aesni_xts_enc = aesni_xts_encrypt;
-    aesni_xts_dec = aesni_xts_decrypt;
-
-#if (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
-    if (aesni_xts_avx512_eligible()) {
-        if (keylen == 64) {
-            aesni_xts_enc = aesni_xts_256_encrypt_avx512;
-            aesni_xts_dec = aesni_xts_256_decrypt_avx512;
-        } else if (keylen == 32) {
-            aesni_xts_enc = aesni_xts_128_encrypt_avx512;
-            aesni_xts_dec = aesni_xts_128_decrypt_avx512;
-        }
-    }
-#endif
-
-    XTS_SET_KEY_FN(aesni_set_encrypt_key, aesni_set_decrypt_key,
-        aesni_encrypt, aesni_decrypt,
-        aesni_xts_enc, aesni_xts_dec);
-    return 1;
-}
-
-#define PROV_CIPHER_HW_declare_xts()          \
-    static const PROV_CIPHER_HW aesni_xts = { \
-        cipher_hw_aesni_xts_initkey,          \
-        NULL,                                 \
-        cipher_hw_aes_xts_copyctx             \
-    };
-#define PROV_CIPHER_HW_select_xts() \
-    if (AESNI_CAPABLE)              \
-        return &aesni_xts;
+    const PROV_CIPHER_HW *aes_xts_hw = NULL;

+#if defined(AESNI_CAPABLE)
+    aes_xts_hw = ossl_prov_cipher_hw_aes_xts_aesni();
 #elif defined(SPARC_AES_CAPABLE)
-
-static int cipher_hw_aes_xts_t4_initkey(PROV_CIPHER_CTX *ctx,
-    const unsigned char *key, size_t keylen)
-{
-    PROV_AES_XTS_CTX *xctx = (PROV_AES_XTS_CTX *)ctx;
-    OSSL_xts_stream_fn stream_enc = NULL;
-    OSSL_xts_stream_fn stream_dec = NULL;
-
-    /* Note: keylen is the size of 2 keys */
-    switch (keylen) {
-    case 32:
-        stream_enc = aes128_t4_xts_encrypt;
-        stream_dec = aes128_t4_xts_decrypt;
-        break;
-    case 64:
-        stream_enc = aes256_t4_xts_encrypt;
-        stream_dec = aes256_t4_xts_decrypt;
-        break;
-    default:
-        return 0;
-    }
-
-    XTS_SET_KEY_FN(aes_t4_set_encrypt_key, aes_t4_set_decrypt_key,
-        aes_t4_encrypt, aes_t4_decrypt,
-        stream_enc, stream_dec);
-    return 1;
-}
-
-#define PROV_CIPHER_HW_declare_xts()           \
-    static const PROV_CIPHER_HW aes_xts_t4 = { \
-        cipher_hw_aes_xts_t4_initkey,          \
-        NULL,                                  \
-        cipher_hw_aes_xts_copyctx              \
-    };
-#define PROV_CIPHER_HW_select_xts() \
-    if (SPARC_AES_CAPABLE)          \
-        return &aes_xts_t4;
-
-#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
-
-static int cipher_hw_aes_xts_rv64i_zknd_zkne_initkey(PROV_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    size_t keylen)
-{
-    PROV_AES_XTS_CTX *xctx = (PROV_AES_XTS_CTX *)ctx;
-    OSSL_xts_stream_fn stream_enc = NULL;
-    OSSL_xts_stream_fn stream_dec = NULL;
-
-    XTS_SET_KEY_FN(rv64i_zkne_set_encrypt_key, rv64i_zknd_set_decrypt_key,
-        rv64i_zkne_encrypt, rv64i_zknd_decrypt,
-        stream_enc, stream_dec);
-    return 1;
-}
-
-static int cipher_hw_aes_xts_rv64i_zvbb_zvkg_zvkned_initkey(
-    PROV_CIPHER_CTX *ctx, const unsigned char *key, size_t keylen)
-{
-    PROV_AES_XTS_CTX *xctx = (PROV_AES_XTS_CTX *)ctx;
-    OSSL_xts_stream_fn stream_enc = NULL;
-    OSSL_xts_stream_fn stream_dec = NULL;
-
-    /* Zvkned only supports 128 and 256 bit keys. */
-    if (keylen * 8 == 128 * 2 || keylen * 8 == 256 * 2) {
-        XTS_SET_KEY_FN(rv64i_zvkned_set_encrypt_key,
-            rv64i_zvkned_set_decrypt_key, rv64i_zvkned_encrypt,
-            rv64i_zvkned_decrypt,
-            rv64i_zvbb_zvkg_zvkned_aes_xts_encrypt,
-            rv64i_zvbb_zvkg_zvkned_aes_xts_decrypt);
-    } else {
-        XTS_SET_KEY_FN(AES_set_encrypt_key, AES_set_encrypt_key,
-            rv64i_zvkned_encrypt, rv64i_zvkned_decrypt,
-            stream_enc, stream_dec);
-    }
-    return 1;
-}
-
-static int cipher_hw_aes_xts_rv64i_zvkned_initkey(PROV_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    size_t keylen)
-{
-    PROV_AES_XTS_CTX *xctx = (PROV_AES_XTS_CTX *)ctx;
-    OSSL_xts_stream_fn stream_enc = NULL;
-    OSSL_xts_stream_fn stream_dec = NULL;
-
-    /* Zvkned only supports 128 and 256 bit keys. */
-    if (keylen * 8 == 128 * 2 || keylen * 8 == 256 * 2) {
-        XTS_SET_KEY_FN(rv64i_zvkned_set_encrypt_key,
-            rv64i_zvkned_set_decrypt_key,
-            rv64i_zvkned_encrypt, rv64i_zvkned_decrypt,
-            stream_enc, stream_dec);
-    } else {
-        XTS_SET_KEY_FN(AES_set_encrypt_key, AES_set_encrypt_key,
-            rv64i_zvkned_encrypt, rv64i_zvkned_decrypt,
-            stream_enc, stream_dec);
-    }
-    return 1;
-}
-
-#define PROV_CIPHER_HW_declare_xts()                               \
-    static const PROV_CIPHER_HW aes_xts_rv64i_zknd_zkne = {        \
-        cipher_hw_aes_xts_rv64i_zknd_zkne_initkey,                 \
-        NULL,                                                      \
-        cipher_hw_aes_xts_copyctx                                  \
-    };                                                             \
-    static const PROV_CIPHER_HW aes_xts_rv64i_zvkned = {           \
-        cipher_hw_aes_xts_rv64i_zvkned_initkey,                    \
-        NULL,                                                      \
-        cipher_hw_aes_xts_copyctx                                  \
-    };                                                             \
-    static const PROV_CIPHER_HW aes_xts_rv64i_zvbb_zvkg_zvkned = { \
-        cipher_hw_aes_xts_rv64i_zvbb_zvkg_zvkned_initkey,          \
-        NULL,                                                      \
-        cipher_hw_aes_xts_copyctx                                  \
-    };
-
-#define PROV_CIPHER_HW_select_xts()                                                        \
-    if (RISCV_HAS_ZVBB() && RISCV_HAS_ZVKG() && RISCV_HAS_ZVKNED() && riscv_vlen() >= 128) \
-        return &aes_xts_rv64i_zvbb_zvkg_zvkned;                                            \
-    if (RISCV_HAS_ZVKNED() && riscv_vlen() >= 128)                                         \
-        return &aes_xts_rv64i_zvkned;                                                      \
-    else if (RISCV_HAS_ZKND_AND_ZKNE())                                                    \
-        return &aes_xts_rv64i_zknd_zkne;
-
+    aes_xts_hw = ossl_prov_cipher_hw_aes_xts_t4();
 #elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
-
-static int cipher_hw_aes_xts_rv32i_zknd_zkne_initkey(PROV_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    size_t keylen)
-{
-    PROV_AES_XTS_CTX *xctx = (PROV_AES_XTS_CTX *)ctx;
-
-    XTS_SET_KEY_FN(rv32i_zkne_set_encrypt_key, rv32i_zknd_zkne_set_decrypt_key,
-        rv32i_zkne_encrypt, rv32i_zknd_decrypt,
-        NULL, NULL);
-    return 1;
-}
-
-static int cipher_hw_aes_xts_rv32i_zbkb_zknd_zkne_initkey(PROV_CIPHER_CTX *ctx,
-    const unsigned char *key,
-    size_t keylen)
-{
-    PROV_AES_XTS_CTX *xctx = (PROV_AES_XTS_CTX *)ctx;
-
-    XTS_SET_KEY_FN(rv32i_zbkb_zkne_set_encrypt_key, rv32i_zbkb_zknd_zkne_set_decrypt_key,
-        rv32i_zkne_encrypt, rv32i_zknd_decrypt,
-        NULL, NULL);
-    return 1;
-}
-
-#define PROV_CIPHER_HW_declare_xts()                             \
-    static const PROV_CIPHER_HW aes_xts_rv32i_zknd_zkne = {      \
-        cipher_hw_aes_xts_rv32i_zknd_zkne_initkey,               \
-        NULL,                                                    \
-        cipher_hw_aes_xts_copyctx                                \
-    };                                                           \
-    static const PROV_CIPHER_HW aes_xts_rv32i_zbkb_zknd_zkne = { \
-        cipher_hw_aes_xts_rv32i_zbkb_zknd_zkne_initkey,          \
-        NULL,                                                    \
-        cipher_hw_aes_xts_copyctx                                \
-    };
-#define PROV_CIPHER_HW_select_xts()           \
-    if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE())   \
-        return &aes_xts_rv32i_zbkb_zknd_zkne; \
-    if (RISCV_HAS_ZKND_AND_ZKNE())            \
-        return &aes_xts_rv32i_zknd_zkne;
-#else
-/* The generic case */
-#define PROV_CIPHER_HW_declare_xts()
-#define PROV_CIPHER_HW_select_xts()
+    aes_xts_hw = ossl_prov_cipher_hw_aes_xts_rv32i();
+#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
+    aes_xts_hw = ossl_prov_cipher_hw_aes_xts_rv64i();
+#elif defined(AES_XTS_S390X)
+    aes_xts_hw = ossl_prov_cipher_hw_aes_xts_s390x(keybits);
 #endif

-static const PROV_CIPHER_HW aes_generic_xts = {
-    cipher_hw_aes_xts_generic_initkey,
-    NULL,
-    cipher_hw_aes_xts_copyctx
-};
-PROV_CIPHER_HW_declare_xts()
-    const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts(size_t keybits)
-{
-    PROV_CIPHER_HW_select_xts() return &aes_generic_xts;
+    if (aes_xts_hw == NULL)
+        return &aes_generic_xts;
+
+    return aes_xts_hw;
 }
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts_s390x.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts_s390x.inc
deleted file mode 100644
index 77341b3bbd4..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_xts_s390x.inc
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include "crypto/s390x_arch.h"
-
-static OSSL_FUNC_cipher_encrypt_init_fn s390x_aes_xts_einit;
-static OSSL_FUNC_cipher_decrypt_init_fn s390x_aes_xts_dinit;
-static OSSL_FUNC_cipher_cipher_fn s390x_aes_xts_cipher;
-static OSSL_FUNC_cipher_dupctx_fn s390x_aes_xts_dupctx;
-
-static int s390x_aes_xts_init(void *vctx, const unsigned char *key,
-                              size_t keylen, const unsigned char *iv,
-                              size_t ivlen, const OSSL_PARAM params[],
-                              unsigned int dec)
-{
-    PROV_AES_XTS_CTX *xctx = (PROV_AES_XTS_CTX *)vctx;
-    S390X_KM_XTS_PARAMS *km = &xctx->plat.s390x.param.km;
-    unsigned int fc, offs;
-
-    switch (xctx->base.keylen) {
-    case 128 / 8 * 2:
-        fc = S390X_XTS_AES_128_MSA10;
-        offs = 32;
-        break;
-    case 256 / 8 * 2:
-        fc = S390X_XTS_AES_256_MSA10;
-        offs = 0;
-        break;
-    default:
-        goto not_supported;
-    }
-
-    if (!(OPENSSL_s390xcap_P.km[1] && S390X_CAPBIT(fc)))
-        goto not_supported;
-
-    if (iv != NULL) {
-        if (ivlen != xctx->base.ivlen
-                || ivlen > sizeof(km->tweak)) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
-            return 0;
-        }
-        memcpy(km->tweak, iv, ivlen);
-        xctx->plat.s390x.iv_set = 1;
-    }
-
-    if (key != NULL) {
-        if (keylen != xctx->base.keylen) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
-            return 0;
-        }
-        if (!aes_xts_check_keys_differ(key, keylen / 2, !dec))
-            return 0;
-
-        memcpy(km->key + offs, key, keylen);
-        xctx->plat.s390x.key_set = 1;
-    }
-
-    xctx->plat.s390x.fc = fc | dec;
-    xctx->plat.s390x.offset = offs;
-
-    memset(km->nap, 0, sizeof(km->nap));
-    km->nap[0] = 0x1;
-
-    return aes_xts_set_ctx_params(xctx, params);
-
-not_supported:
-    xctx->plat.s390x.fc = 0;
-    xctx->plat.s390x.offset = 0;
-    return 0;
-}
-
-static int s390x_aes_xts_einit(void *vctx, const unsigned char *key,
-                               size_t keylen, const unsigned char *iv,
-                               size_t ivlen, const OSSL_PARAM params[])
-{
-    return s390x_aes_xts_init(vctx, key, keylen, iv, ivlen, params, 0);
-}
-
-static int s390x_aes_xts_dinit(void *vctx, const unsigned char *key,
-                               size_t keylen, const unsigned char *iv,
-                               size_t ivlen, const OSSL_PARAM params[])
-{
-    return s390x_aes_xts_init(vctx, key, keylen, iv, ivlen, params,
-                              S390X_DECRYPT);
-}
-
-static void *s390x_aes_xts_dupctx(void *vctx)
-{
-    PROV_AES_XTS_CTX *in = (PROV_AES_XTS_CTX *)vctx;
-    PROV_AES_XTS_CTX *ret = OPENSSL_zalloc(sizeof(*in));
-
-    if (ret != NULL)
-        *ret = *in;
-
-    return ret;
-}
-
-static int s390x_aes_xts_cipher(void *vctx, unsigned char *out, size_t *outl,
-                                size_t outsize, const unsigned char *in,
-                                size_t inl)
-{
-    PROV_AES_XTS_CTX *xctx = (PROV_AES_XTS_CTX *)vctx;
-    S390X_KM_XTS_PARAMS *km = &xctx->plat.s390x.param.km;
-    unsigned char *param = (unsigned char *)km + xctx->plat.s390x.offset;
-    unsigned int fc = xctx->plat.s390x.fc;
-    unsigned char tmp[2][AES_BLOCK_SIZE];
-    unsigned char nap_n1[AES_BLOCK_SIZE];
-    unsigned char drop[AES_BLOCK_SIZE];
-    size_t len_incomplete, len_complete;
-
-    if (!ossl_prov_is_running()
-            || inl < AES_BLOCK_SIZE
-            || in == NULL
-            || out == NULL
-            || !xctx->plat.s390x.iv_set
-            || !xctx->plat.s390x.key_set)
-        return 0;
-
-    /*
-     * Impose a limit of 2^20 blocks per data unit as specified by
-     * IEEE Std 1619-2018.  The earlier and obsolete IEEE Std 1619-2007
-     * indicated that this was a SHOULD NOT rather than a MUST NOT.
-     * NIST SP 800-38E mandates the same limit.
-     */
-    if (inl > XTS_MAX_BLOCKS_PER_DATA_UNIT * AES_BLOCK_SIZE) {
-        ERR_raise(ERR_LIB_PROV, PROV_R_XTS_DATA_UNIT_IS_TOO_LARGE);
-        return 0;
-    }
-
-    len_incomplete = inl % AES_BLOCK_SIZE;
-    len_complete = (len_incomplete == 0) ? inl :
-                       (inl / AES_BLOCK_SIZE - 1) * AES_BLOCK_SIZE;
-
-    if (len_complete > 0)
-        s390x_km(in, len_complete, out, fc, param);
-    if (len_incomplete == 0)
-       goto out;
-
-    memcpy(tmp, in + len_complete, AES_BLOCK_SIZE + len_incomplete);
-    /* swap NAP for decrypt */
-    if (fc & S390X_DECRYPT) {
-        memcpy(nap_n1, km->nap, AES_BLOCK_SIZE);
-        s390x_km(tmp[0], AES_BLOCK_SIZE, drop, fc, param);
-    }
-    s390x_km(tmp[0], AES_BLOCK_SIZE, tmp[0], fc, param);
-    if (fc & S390X_DECRYPT)
-        memcpy(km->nap, nap_n1, AES_BLOCK_SIZE);
-
-    memcpy(tmp[1] + len_incomplete, tmp[0] + len_incomplete,
-           AES_BLOCK_SIZE - len_incomplete);
-    s390x_km(tmp[1], AES_BLOCK_SIZE, out + len_complete, fc, param);
-    memcpy(out + len_complete + AES_BLOCK_SIZE, tmp[0], len_incomplete);
-
-    /* do not expose temporary data */
-    OPENSSL_cleanse(tmp, sizeof(tmp));
-out:
-    memcpy(xctx->base.iv, km->tweak, AES_BLOCK_SIZE);
-    *outl = inl;
-
-    return 1;
-}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria.h
index 563262aee8b..059e742017f 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_H
+
 #include "crypto/aria.h"
 #include "prov/ciphercommon.h"

@@ -27,3 +30,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_cfb128(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_cfb1(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_cfb8(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_ctr(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_ccm.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_ccm.h
index 7de71e7c001..fadb6c40799 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_ccm.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_ccm.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_CCM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_CCM_H
+
 #include "crypto/aria.h"
 #include "prov/ciphercommon.h"
 #include "prov/ciphercommon_ccm.h"
@@ -20,3 +23,5 @@ typedef struct prov_aria_ccm_ctx_st {
 } PROV_ARIA_CCM_CTX;

 const PROV_CCM_HW *ossl_prov_aria_hw_ccm(size_t keylen);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_CCM_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_ccm_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_ccm_hw.c
index 6c5a4203057..e6585e5cfd9 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_ccm_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_ccm_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -18,8 +18,9 @@ static int ccm_aria_initkey(PROV_CCM_CTX *ctx,
 {
     PROV_ARIA_CCM_CTX *actx = (PROV_ARIA_CCM_CTX *)ctx;

-    ossl_aria_set_encrypt_key(key, keylen * 8, &actx->ks.ks);
-    CRYPTO_ccm128_init(&ctx->ccm_ctx, ctx->m, ctx->l, &actx->ks.ks,
+    ossl_aria_set_encrypt_key(key, (int)(keylen * 8), &actx->ks.ks);
+    CRYPTO_ccm128_init(&ctx->ccm_ctx, (unsigned int)ctx->m,
+        (unsigned int)ctx->l, &actx->ks.ks,
         (block128_f)ossl_aria_encrypt);
     ctx->str = NULL;
     ctx->key_set = 1;
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_gcm.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_gcm.h
index 622053a5594..906c61d4b10 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_gcm.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_gcm.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_GCM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_GCM_H
+
 #include "crypto/aria.h"
 #include "prov/ciphercommon.h"
 #include "prov/ciphercommon_gcm.h"
@@ -20,3 +23,5 @@ typedef struct prov_aria_gcm_ctx_st {
 } PROV_ARIA_GCM_CTX;

 const PROV_GCM_HW *ossl_prov_aria_hw_gcm(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_GCM_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_gcm_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_gcm_hw.c
index f4c8646103f..5ada0c0efc1 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_gcm_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_gcm_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,7 +19,11 @@ static int aria_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
     PROV_ARIA_GCM_CTX *actx = (PROV_ARIA_GCM_CTX *)ctx;
     ARIA_KEY *ks = &actx->ks.ks;

-    GCM_HW_SET_KEY_CTR_FN(ks, ossl_aria_set_encrypt_key, ossl_aria_encrypt, NULL);
+    ossl_aria_set_encrypt_key(key, (int)(keylen * 8), ks);
+    CRYPTO_gcm128_init(&ctx->gcm, ks, (block128_f)ossl_aria_encrypt);
+    ctx->ctr = NULL;
+    ctx->key_set = 1;
+
     return 1;
 }

diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_hw.c
index 12ba59a46a2..3046e86d543 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aria_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -18,9 +18,9 @@ static int cipher_hw_aria_initkey(PROV_CIPHER_CTX *dat,
     ARIA_KEY *ks = &adat->ks.ks;

     if (dat->enc || (mode != EVP_CIPH_ECB_MODE && mode != EVP_CIPH_CBC_MODE))
-        ret = ossl_aria_set_encrypt_key(key, keylen * 8, ks);
+        ret = ossl_aria_set_encrypt_key(key, (int)(keylen * 8), ks);
     else
-        ret = ossl_aria_set_decrypt_key(key, keylen * 8, ks);
+        ret = ossl_aria_set_decrypt_key(key, (int)(keylen * 8), ks);
     if (ret < 0) {
         ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
         return 0;
@@ -44,9 +44,9 @@ IMPLEMENT_CIPHER_HW_COPYCTX(cipher_hw_aria_copyctx, PROV_ARIA_CTX)
     }

 PROV_CIPHER_HW_aria_mode(cbc)
-    PROV_CIPHER_HW_aria_mode(ecb)
-        PROV_CIPHER_HW_aria_mode(ofb128)
-            PROV_CIPHER_HW_aria_mode(cfb128)
-                PROV_CIPHER_HW_aria_mode(cfb1)
-                    PROV_CIPHER_HW_aria_mode(cfb8)
-                        PROV_CIPHER_HW_aria_mode(ctr)
+PROV_CIPHER_HW_aria_mode(ecb)
+PROV_CIPHER_HW_aria_mode(ofb128)
+PROV_CIPHER_HW_aria_mode(cfb128)
+PROV_CIPHER_HW_aria_mode(cfb1)
+PROV_CIPHER_HW_aria_mode(cfb8)
+PROV_CIPHER_HW_aria_mode(ctr)
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_blowfish.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_blowfish.h
index 18c824fed1e..30063fc22ec 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_blowfish.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_blowfish.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_BLOWFISH_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_BLOWFISH_H
+
 #include <openssl/blowfish.h>
 #include "prov/ciphercommon.h"

@@ -22,3 +25,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_blowfish_cbc(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_blowfish_ecb(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_blowfish_ofb64(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_blowfish_cfb64(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_BLOWFISH_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_blowfish_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_blowfish_hw.c
index 5cbc4886fa4..9deb7f8e10c 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_blowfish_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_blowfish_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,7 +20,7 @@ static int cipher_hw_blowfish_initkey(PROV_CIPHER_CTX *ctx,
 {
     PROV_BLOWFISH_CTX *bctx = (PROV_BLOWFISH_CTX *)ctx;

-    BF_set_key(&bctx->ks.ks, keylen, key);
+    BF_set_key(&bctx->ks.ks, (int)keylen, key);
     return 1;
 }

diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia.c
index 0d4bab73c8c..43040b7a045 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,14 +13,17 @@
  */
 #include "internal/deprecated.h"

-/* Dispatch functions for CAMELLIA cipher modes ecb, cbc, ofb, cfb, ctr */
+/* Dispatch functions for CAMELLIA cipher modes ecb, cbc, cts, ofb, cfb, ctr */

+#include "cipher_cts.h"
 #include "cipher_camellia.h"
 #include "prov/implementations.h"
 #include "prov/providercommon.h"

 static OSSL_FUNC_cipher_freectx_fn camellia_freectx;
 static OSSL_FUNC_cipher_dupctx_fn camellia_dupctx;
+static OSSL_FUNC_cipher_encrypt_init_fn camellia_cbc_cts_einit;
+static OSSL_FUNC_cipher_decrypt_init_fn camellia_cbc_cts_dinit;

 static void camellia_freectx(void *vctx)
 {
@@ -46,6 +49,24 @@ static void *camellia_dupctx(void *ctx)
     return ret;
 }

+static int camellia_cbc_cts_einit(void *ctx, const unsigned char *key, size_t keylen,
+    const unsigned char *iv, size_t ivlen,
+    const OSSL_PARAM params[])
+{
+    if (!ossl_cipher_generic_einit(ctx, key, keylen, iv, ivlen, NULL))
+        return 0;
+    return ossl_cipher_cbc_cts_set_ctx_params(ctx, params);
+}
+
+static int camellia_cbc_cts_dinit(void *ctx, const unsigned char *key, size_t keylen,
+    const unsigned char *iv, size_t ivlen,
+    const OSSL_PARAM params[])
+{
+    if (!ossl_cipher_generic_dinit(ctx, key, keylen, iv, ivlen, NULL))
+        return 0;
+    return ossl_cipher_cbc_cts_set_ctx_params(ctx, params);
+}
+
 /* ossl_camellia256ecb_functions */
 IMPLEMENT_generic_cipher(camellia, CAMELLIA, ecb, ECB, 0, 256, 128, 0, block)
 /* ossl_camellia192ecb_functions */
@@ -89,4 +110,9 @@ IMPLEMENT_generic_cipher(camellia, CAMELLIA, ctr, CTR, 0, 192, 8, 128, stream)
 /* ossl_camellia128ctr_functions */
 IMPLEMENT_generic_cipher(camellia, CAMELLIA, ctr, CTR, 0, 128, 8, 128, stream)

-#include "cipher_camellia_cts.inc"
+/* ossl_camellia256cbc_cts_functions */
+IMPLEMENT_cts_cipher(camellia, CAMELLIA, cbc, CBC, PROV_CIPHER_FLAG_CTS, 256, 128, 128, block)
+/* ossl_camellia192cbc_cts_functions */
+IMPLEMENT_cts_cipher(camellia, CAMELLIA, cbc, CBC, PROV_CIPHER_FLAG_CTS, 192, 128, 128, block)
+/* ossl_camellia128cbc_cts_functions */
+IMPLEMENT_cts_cipher(camellia, CAMELLIA, cbc, CBC, PROV_CIPHER_FLAG_CTS, 128, 128, 128, block)
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia.h
index 2c1156ae92d..e2cd5d26a20 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CAMELLIA_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CAMELLIA_H
+
 #include <openssl/camellia.h>
 #include "prov/ciphercommon.h"
 #include "crypto/cmll_platform.h"
@@ -28,3 +31,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_cfb128(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_cfb1(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_cfb8(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_ctr(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CAMELLIA_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia_cts.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia_cts.inc
deleted file mode 100644
index 84ea992b8da..00000000000
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia_cts.inc
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/* Dispatch functions for CAMELLIA CBC CTS ciphers */
-
-#include <openssl/proverr.h>
-#include "cipher_cts.h"
-
-#define CTS_FLAGS PROV_CIPHER_FLAG_CTS
-
-static OSSL_FUNC_cipher_encrypt_init_fn camellia_cbc_cts_einit;
-static OSSL_FUNC_cipher_decrypt_init_fn camellia_cbc_cts_dinit;
-static OSSL_FUNC_cipher_get_ctx_params_fn camellia_cbc_cts_get_ctx_params;
-static OSSL_FUNC_cipher_set_ctx_params_fn camellia_cbc_cts_set_ctx_params;
-static OSSL_FUNC_cipher_gettable_ctx_params_fn camellia_cbc_cts_gettable_ctx_params;
-static OSSL_FUNC_cipher_settable_ctx_params_fn camellia_cbc_cts_settable_ctx_params;
-
-CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_START(camellia_cbc_cts)
-OSSL_PARAM_utf8_string(OSSL_CIPHER_PARAM_CTS_MODE, NULL, 0),
-CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_END(camellia_cbc_cts)
-
-static int camellia_cbc_cts_einit(void *ctx, const unsigned char *key, size_t keylen,
-                             const unsigned char *iv, size_t ivlen,
-                             const OSSL_PARAM params[])
-{
-    if (!ossl_cipher_generic_einit(ctx, key, keylen, iv, ivlen, NULL))
-        return 0;
-    return camellia_cbc_cts_set_ctx_params(ctx, params);
-}
-
-static int camellia_cbc_cts_dinit(void *ctx, const unsigned char *key, size_t keylen,
-                             const unsigned char *iv, size_t ivlen,
-                             const OSSL_PARAM params[])
-{
-    if (!ossl_cipher_generic_dinit(ctx, key, keylen, iv, ivlen, NULL))
-        return 0;
-    return camellia_cbc_cts_set_ctx_params(ctx, params);
-}
-
-static int camellia_cbc_cts_get_ctx_params(void *vctx, OSSL_PARAM params[])
-{
-    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
-    OSSL_PARAM *p;
-
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_CTS_MODE);
-    if (p != NULL) {
-        const char *name = ossl_cipher_cbc_cts_mode_id2name(ctx->cts_mode);
-
-        if (name == NULL || !OSSL_PARAM_set_utf8_string(p, name)) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
-            return 0;
-        }
-    }
-    return ossl_cipher_generic_get_ctx_params(vctx, params);
-}
-
-CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_START(camellia_cbc_cts)
-OSSL_PARAM_utf8_string(OSSL_CIPHER_PARAM_CTS_MODE, NULL, 0),
-CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_END(camellia_cbc_cts)
-
-static int camellia_cbc_cts_set_ctx_params(void *vctx, const OSSL_PARAM params[])
-{
-    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
-    const OSSL_PARAM *p;
-    int id;
-
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_CTS_MODE);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
-            goto err;
-        id = ossl_cipher_cbc_cts_mode_name2id(p->data);
-        if (id < 0)
-            goto err;
-
-        ctx->cts_mode = (unsigned int)id;
-    }
-    return ossl_cipher_generic_set_ctx_params(vctx, params);
-err:
-    ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
-    return 0;
-}
-
-/* ossl_camellia256cbc_cts_functions */
-IMPLEMENT_cts_cipher(camellia, CAMELLIA, cbc, CBC, CTS_FLAGS, 256, 128, 128, block)
-/* ossl_camellia192cbc_cts_functions */
-IMPLEMENT_cts_cipher(camellia, CAMELLIA, cbc, CBC, CTS_FLAGS, 192, 128, 128, block)
-/* ossl_camellia128cbc_cts_functions */
-IMPLEMENT_cts_cipher(camellia, CAMELLIA, cbc, CBC, CTS_FLAGS, 128, 128, 128, block)
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia_hw.c
index 652cdf9d4a9..cb600fc976b 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_camellia_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -25,7 +25,7 @@ static int cipher_hw_camellia_initkey(PROV_CIPHER_CTX *dat,
     CAMELLIA_KEY *ks = &adat->ks.ks;

     dat->ks = ks;
-    ret = Camellia_set_key(key, keylen * 8, ks);
+    ret = Camellia_set_key(key, (int)(keylen * 8), ks);
     if (ret < 0) {
         ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
         return 0;
@@ -64,9 +64,9 @@ IMPLEMENT_CIPHER_HW_COPYCTX(cipher_hw_camellia_copyctx, PROV_CAMELLIA_CTX)
     }

 PROV_CIPHER_HW_camellia_mode(cbc)
-    PROV_CIPHER_HW_camellia_mode(ecb)
-        PROV_CIPHER_HW_camellia_mode(ofb128)
-            PROV_CIPHER_HW_camellia_mode(cfb128)
-                PROV_CIPHER_HW_camellia_mode(cfb1)
-                    PROV_CIPHER_HW_camellia_mode(cfb8)
-                        PROV_CIPHER_HW_camellia_mode(ctr)
+PROV_CIPHER_HW_camellia_mode(ecb)
+PROV_CIPHER_HW_camellia_mode(ofb128)
+PROV_CIPHER_HW_camellia_mode(cfb128)
+PROV_CIPHER_HW_camellia_mode(cfb1)
+PROV_CIPHER_HW_camellia_mode(cfb8)
+PROV_CIPHER_HW_camellia_mode(ctr)
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_cast.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_cast.h
index d0451861e32..5dc07b10263 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_cast.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_cast.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CAST_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CAST_H
+
 #include <openssl/cast.h>
 #include "prov/ciphercommon.h"

@@ -22,3 +25,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_cast5_cbc(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_cast5_ecb(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_cast5_ofb64(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_cast5_cfb64(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CAST_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_cast5_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_cast5_hw.c
index e4ccc8aa095..a9d4250ba3a 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_cast5_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_cast5_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,7 +20,7 @@ static int cipher_hw_cast5_initkey(PROV_CIPHER_CTX *ctx,
 {
     PROV_CAST_CTX *bctx = (PROV_CAST_CTX *)ctx;

-    CAST_set_key(&(bctx->ks.ks), keylen, key);
+    CAST_set_key(&(bctx->ks.ks), (int)keylen, key);
     return 1;
 }

diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20.c
index 43566462354..67a95f8d8c1 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -10,9 +10,11 @@
 /* Dispatch functions for chacha20 cipher */

 #include <openssl/proverr.h>
+#include <openssl/params.h>
 #include "cipher_chacha20.h"
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
+#include "providers/implementations/ciphers/cipher_chacha20.inc"

 #define CHACHA20_KEYLEN (CHACHA_KEY_SIZE)
 #define CHACHA20_BLKLEN (1)
@@ -31,6 +33,13 @@ static OSSL_FUNC_cipher_settable_ctx_params_fn chacha20_settable_ctx_params;
 #define chacha20_update ossl_cipher_generic_stream_update
 #define chacha20_final ossl_cipher_generic_stream_final
 #define chacha20_gettable_params ossl_cipher_generic_gettable_params
+#define CHACHA_U32TOU8(ct, st)                 \
+    do {                                       \
+        (ct)[3] = (unsigned char)((st) >> 24); \
+        (ct)[2] = (unsigned char)((st) >> 16); \
+        (ct)[1] = (unsigned char)((st) >> 8);  \
+        (ct)[0] = (unsigned char)(st);         \
+    } while (0)

 void ossl_chacha20_initctx(PROV_CHACHA20_CTX *ctx)
 {
@@ -70,16 +79,14 @@ static void *chacha20_dupctx(void *vctx)
     PROV_CHACHA20_CTX *ctx = (PROV_CHACHA20_CTX *)vctx;
     PROV_CHACHA20_CTX *dupctx = NULL;

-    if (ctx != NULL) {
-        dupctx = OPENSSL_memdup(ctx, sizeof(*dupctx));
-        if (dupctx != NULL && dupctx->base.tlsmac != NULL && dupctx->base.alloced) {
-            dupctx->base.tlsmac = OPENSSL_memdup(dupctx->base.tlsmac,
-                dupctx->base.tlsmacsize);
-            if (dupctx->base.tlsmac == NULL) {
-                OPENSSL_free(dupctx);
-                dupctx = NULL;
-            }
-        }
+    if (ctx == NULL)
+        return NULL;
+
+    dupctx = OPENSSL_memdup(ctx, sizeof(*dupctx));
+    if (dupctx != NULL
+        && !ossl_cipher_generic_dupctx_tlsmac(&dupctx->base, &ctx->base)) {
+        OPENSSL_clear_free(dupctx, sizeof(*dupctx));
+        return NULL;
     }
     return dupctx;
 }
@@ -94,44 +101,53 @@ static int chacha20_get_params(OSSL_PARAM params[])

 static int chacha20_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    PROV_CHACHA20_CTX *ctx = (PROV_CHACHA20_CTX *)vctx;
+    unsigned char ivbuf[CHACHA20_IVLEN];
+    struct chacha20_get_ctx_params_st p;
+
+    if (ctx == NULL || !chacha20_get_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, CHACHA20_IVLEN)) {
+    if (p.ivlen != NULL && !OSSL_PARAM_set_size_t(p.ivlen, CHACHA20_IVLEN)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, CHACHA20_KEYLEN)) {
+
+    if (p.keylen != NULL && !OSSL_PARAM_set_size_t(p.keylen, CHACHA20_KEYLEN)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }

+    if (p.upd_iv != NULL) {
+        CHACHA_U32TOU8(ivbuf, ctx->counter[0]);
+        CHACHA_U32TOU8(ivbuf + 4, ctx->counter[1]);
+        CHACHA_U32TOU8(ivbuf + 8, ctx->counter[2]);
+        CHACHA_U32TOU8(ivbuf + 12, ctx->counter[3]);
+        if (!OSSL_PARAM_set_octet_string(p.upd_iv, ivbuf, CHACHA20_IVLEN)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+            return 0;
+        }
+    }
     return 1;
 }

-static const OSSL_PARAM chacha20_known_gettable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_IVLEN, NULL),
-    OSSL_PARAM_END
-};
 const OSSL_PARAM *chacha20_gettable_ctx_params(ossl_unused void *cctx,
     ossl_unused void *provctx)
 {
-    return chacha20_known_gettable_ctx_params;
+    return chacha20_get_ctx_params_list;
 }

 static int chacha20_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p;
+    PROV_CHACHA20_CTX *ctx = (PROV_CHACHA20_CTX *)vctx;
+    struct chacha20_set_ctx_params_st p;
     size_t len;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !chacha20_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &len)) {
+    if (p.keylen != NULL) {
+        if (!OSSL_PARAM_get_size_t(p.keylen, &len)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -140,9 +156,9 @@ static int chacha20_set_ctx_params(void *vctx, const OSSL_PARAM params[])
             return 0;
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_IVLEN);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &len)) {
+
+    if (p.ivlen != NULL) {
+        if (!OSSL_PARAM_get_size_t(p.ivlen, &len)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -154,15 +170,10 @@ static int chacha20_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     return 1;
 }

-static const OSSL_PARAM chacha20_known_settable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_IVLEN, NULL),
-    OSSL_PARAM_END
-};
 const OSSL_PARAM *chacha20_settable_ctx_params(ossl_unused void *cctx,
     ossl_unused void *provctx)
 {
-    return chacha20_known_settable_ctx_params;
+    return chacha20_set_ctx_params_list;
 }

 int ossl_chacha20_einit(void *vctx, const unsigned char *key, size_t keylen,
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20.h
index ed531d7933b..4b92c149e5f 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CHACHA20_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CHACHA20_H
+
 #include "include/crypto/chacha.h"
 #include "prov/ciphercommon.h"

@@ -32,3 +35,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_chacha20(size_t keybits);
 OSSL_FUNC_cipher_encrypt_init_fn ossl_chacha20_einit;
 OSSL_FUNC_cipher_decrypt_init_fn ossl_chacha20_dinit;
 void ossl_chacha20_initctx(PROV_CHACHA20_CTX *ctx);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CHACHA20_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20.inc.in
new file mode 100644
index 00000000000..aa64e6a44f3
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20.inc.in
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('chacha20_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',     'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',      'ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_UPDATED_IV', 'upd_iv', 'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('chacha20_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',  'ivlen',  'size_t'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_hw.c
index 18a4578b491..644b4e540a4 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -55,12 +55,8 @@ static int chacha20_cipher(PROV_CIPHER_CTX *bctx, unsigned char *out,
         if (inl == 0)
             return 1;

-        if (n == CHACHA_BLK_SIZE) {
+        if (n == CHACHA_BLK_SIZE)
             ctx->partial_len = 0;
-            ctx->counter[0]++;
-            if (ctx->counter[0] == 0)
-                ctx->counter[1]++;
-        }
     }

     rem = (unsigned int)(inl % CHACHA_BLK_SIZE);
@@ -103,6 +99,11 @@ static int chacha20_cipher(PROV_CIPHER_CTX *bctx, unsigned char *out,
         memset(ctx->buf, 0, sizeof(ctx->buf));
         ChaCha20_ctr32(ctx->buf, ctx->buf, CHACHA_BLK_SIZE,
             ctx->key.d, ctx->counter);
+
+        /* propagate counter overflow */
+        if (++ctx->counter[0] == 0)
+            ctx->counter[1]++;
+
         for (n = 0; n < rem; n++)
             out[n] = in[n] ^ ctx->buf[n];
         ctx->partial_len = rem;
@@ -118,5 +119,5 @@ static const PROV_CIPHER_HW_CHACHA20 chacha20_hw = {

 const PROV_CIPHER_HW *ossl_prov_cipher_hw_chacha20(size_t keybits)
 {
-    return (PROV_CIPHER_HW *)&chacha20_hw;
+    return (const PROV_CIPHER_HW *)&chacha20_hw;
 }
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305.c
index 673e18702cf..45032d86ad7 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305.c
@@ -9,10 +9,12 @@

 /* Dispatch functions for chacha20_poly1305 cipher */

+#include <string.h>
 #include <openssl/proverr.h>
 #include "cipher_chacha20_poly1305.h"
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
+#include "providers/implementations/ciphers/cipher_chacha20_poly1305.inc"

 #define CHACHA20_POLY1305_KEYLEN CHACHA_KEY_SIZE
 #define CHACHA20_POLY1305_BLKLEN 1
@@ -30,7 +32,6 @@ static OSSL_FUNC_cipher_get_params_fn chacha20_poly1305_get_params;
 static OSSL_FUNC_cipher_get_ctx_params_fn chacha20_poly1305_get_ctx_params;
 static OSSL_FUNC_cipher_set_ctx_params_fn chacha20_poly1305_set_ctx_params;
 static OSSL_FUNC_cipher_cipher_fn chacha20_poly1305_cipher;
-static OSSL_FUNC_cipher_update_fn chacha20_poly1305_update;
 static OSSL_FUNC_cipher_final_fn chacha20_poly1305_final;
 static OSSL_FUNC_cipher_gettable_ctx_params_fn chacha20_poly1305_gettable_ctx_params;
 static OSSL_FUNC_cipher_settable_ctx_params_fn chacha20_poly1305_settable_ctx_params;
@@ -67,13 +68,10 @@ static void *chacha20_poly1305_dupctx(void *provctx)
     if (ctx == NULL)
         return NULL;
     dctx = OPENSSL_memdup(ctx, sizeof(*ctx));
-    if (dctx != NULL && dctx->base.tlsmac != NULL && dctx->base.alloced) {
-        dctx->base.tlsmac = OPENSSL_memdup(dctx->base.tlsmac,
-            dctx->base.tlsmacsize);
-        if (dctx->base.tlsmac == NULL) {
-            OPENSSL_free(dctx);
-            dctx = NULL;
-        }
+    if (dctx != NULL
+        && !ossl_cipher_generic_dupctx_tlsmac(&dctx->base, &ctx->base)) {
+        OPENSSL_clear_free(dctx, sizeof(*dctx));
+        return NULL;
     }
     return dctx;
 }
@@ -99,34 +97,37 @@ static int chacha20_poly1305_get_params(OSSL_PARAM params[])
 static int chacha20_poly1305_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_CHACHA20_POLY1305_CTX *ctx = (PROV_CHACHA20_POLY1305_CTX *)vctx;
-    OSSL_PARAM *p;
+    struct chacha20_poly1305_get_ctx_params_st p;

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
-    if (p != NULL) {
-        if (!OSSL_PARAM_set_size_t(p, CHACHA20_POLY1305_IVLEN)) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
-            return 0;
-        }
+    if (ctx == NULL || !chacha20_poly1305_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.ivlen != NULL
+        && !OSSL_PARAM_set_size_t(p.ivlen, CHACHA20_POLY1305_IVLEN)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+        return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, CHACHA20_POLY1305_KEYLEN)) {
+
+    if (p.keylen != NULL
+        && !OSSL_PARAM_set_size_t(p.keylen, CHACHA20_POLY1305_KEYLEN)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD_TAGLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->tag_len)) {
+
+    if (p.taglen != NULL
+        && !OSSL_PARAM_set_size_t(p.taglen, ctx->tag_len)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->tls_aad_pad_sz)) {
+
+    if (p.pad != NULL
+        && !OSSL_PARAM_set_size_t(p.pad, ctx->tls_aad_pad_sz)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD_TAG);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+    if (p.tag != NULL) {
+        if (p.tag->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
             return 0;
         }
@@ -134,57 +135,39 @@ static int chacha20_poly1305_get_ctx_params(void *vctx, OSSL_PARAM params[])
             ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_SET);
             return 0;
         }
-        if (p->data_size == 0 || p->data_size > POLY1305_BLOCK_SIZE) {
+        if (p.tag->data_size == 0 || p.tag->data_size > POLY1305_BLOCK_SIZE) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG_LENGTH);
             return 0;
         }
-        memcpy(p->data, ctx->tag, p->data_size);
+        memcpy(p.tag->data, ctx->tag, p.tag->data_size);
     }
-
     return 1;
 }

-static const OSSL_PARAM chacha20_poly1305_known_gettable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_IVLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_AEAD_TAGLEN, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TAG, NULL, 0),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD, NULL),
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *chacha20_poly1305_gettable_ctx_params(ossl_unused void *cctx, ossl_unused void *provctx)
 {
-    return chacha20_poly1305_known_gettable_ctx_params;
+    return chacha20_poly1305_get_ctx_params_list;
 }

-static const OSSL_PARAM chacha20_poly1305_known_settable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_IVLEN, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TAG, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TLS1_AAD, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED, NULL, 0),
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *chacha20_poly1305_settable_ctx_params(
     ossl_unused void *cctx, ossl_unused void *provctx)
 {
-    return chacha20_poly1305_known_settable_ctx_params;
+    return chacha20_poly1305_set_ctx_params_list;
 }

 static int chacha20_poly1305_set_ctx_params(void *vctx,
     const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p;
     size_t len;
     PROV_CHACHA20_POLY1305_CTX *ctx = (PROV_CHACHA20_POLY1305_CTX *)vctx;
     PROV_CIPHER_HW_CHACHA20_POLY1305 *hw = (PROV_CIPHER_HW_CHACHA20_POLY1305 *)ctx->base.hw;
+    struct chacha20_poly1305_set_ctx_params_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (!chacha20_poly1305_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &len)) {
+    if (p.keylen != NULL) {
+        if (!OSSL_PARAM_get_size_t(p.keylen, &len)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -193,9 +176,9 @@ static int chacha20_poly1305_set_ctx_params(void *vctx,
             return 0;
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_IVLEN);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &len)) {
+
+    if (p.ivlen != NULL) {
+        if (!OSSL_PARAM_get_size_t(p.ivlen, &len)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -203,35 +186,34 @@ static int chacha20_poly1305_set_ctx_params(void *vctx,
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
             return 0;
         }
+        ctx->iv_state = IV_STATE_UNINITIALISED;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_TAG);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+    if (p.tag != NULL) {
+        if (p.tag->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        if (p->data_size == 0 || p->data_size > POLY1305_BLOCK_SIZE) {
+        if (p.tag->data_size == 0 || p.tag->data_size > POLY1305_BLOCK_SIZE) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG_LENGTH);
             return 0;
         }
-        if (p->data != NULL) {
+        if (p.tag->data != NULL) {
             if (ctx->base.enc) {
                 ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_NEEDED);
                 return 0;
             }
-            memcpy(ctx->tag, p->data, p->data_size);
+            memcpy(ctx->tag, p.tag->data, p.tag->data_size);
         }
-        ctx->tag_len = p->data_size;
+        ctx->tag_len = p.tag->data_size;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_TLS1_AAD);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+    if (p.aad != NULL) {
+        if (p.aad->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        len = hw->tls_init(&ctx->base, p->data, p->data_size);
+        len = hw->tls_init(&ctx->base, p.aad->data, p.aad->data_size);
         if (len == 0) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DATA);
             return 0;
@@ -239,13 +221,14 @@ static int chacha20_poly1305_set_ctx_params(void *vctx,
         ctx->tls_aad_pad_sz = len;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+    if (p.fixed != NULL) {
+        if (p.fixed->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        if (hw->tls_iv_set_fixed(&ctx->base, p->data, p->data_size) == 0) {
+        if (hw->tls_iv_set_fixed(&ctx->base, p.fixed->data,
+                p.fixed->data_size)
+            == 0) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
             return 0;
         }
@@ -263,9 +246,11 @@ static int chacha20_poly1305_einit(void *vctx, const unsigned char *key,
     ret = ossl_cipher_generic_einit(vctx, key, keylen, iv, ivlen, NULL);
     if (ret && iv != NULL) {
         PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
+        PROV_CHACHA20_POLY1305_CTX *cctx = (PROV_CHACHA20_POLY1305_CTX *)vctx;
         PROV_CIPHER_HW_CHACHA20_POLY1305 *hw = (PROV_CIPHER_HW_CHACHA20_POLY1305 *)ctx->hw;

         hw->initiv(ctx);
+        cctx->iv_state = IV_STATE_BUFFERED;
     }
     if (ret && !chacha20_poly1305_set_ctx_params(vctx, params))
         ret = 0;
@@ -282,9 +267,11 @@ static int chacha20_poly1305_dinit(void *vctx, const unsigned char *key,
     ret = ossl_cipher_generic_dinit(vctx, key, keylen, iv, ivlen, NULL);
     if (ret && iv != NULL) {
         PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
+        PROV_CHACHA20_POLY1305_CTX *cctx = (PROV_CHACHA20_POLY1305_CTX *)vctx;
         PROV_CIPHER_HW_CHACHA20_POLY1305 *hw = (PROV_CIPHER_HW_CHACHA20_POLY1305 *)ctx->hw;

         hw->initiv(ctx);
+        cctx->iv_state = IV_STATE_BUFFERED;
     }
     if (ret && !chacha20_poly1305_set_ctx_params(vctx, params))
         ret = 0;
@@ -316,13 +303,16 @@ static int chacha20_poly1305_update(void *vctx, unsigned char *out,
     size_t *outl, size_t outsize,
     const unsigned char *in, size_t inl)
 {
+    PROV_CHACHA20_POLY1305_CTX *ctx = (PROV_CHACHA20_POLY1305_CTX *)vctx;
+
+    if (ctx->iv_state == IV_STATE_FINISHED)
+        return 0;
+
     /*
-     * A zero-length update is a no-op. Only EVP_Cipher() and Final produce or
-     * check the authentication tag.
+     * a zero-length update is a nop, ALWAYS SUCCEED via early exit
+     * NB: ONLY EVP_Cipher() / final produce or check the tag
      */
     if (inl == 0) {
-        if (!ossl_prov_is_running())
-            return 0;
         *outl = 0;
         return 1;
     }
@@ -333,16 +323,25 @@ static int chacha20_poly1305_update(void *vctx, unsigned char *out,
 static int chacha20_poly1305_final(void *vctx, unsigned char *out, size_t *outl,
     size_t outsize)
 {
-    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
-    PROV_CIPHER_HW_CHACHA20_POLY1305 *hw = (PROV_CIPHER_HW_CHACHA20_POLY1305 *)ctx->hw;
+    PROV_CHACHA20_POLY1305_CTX *ctx = (PROV_CHACHA20_POLY1305_CTX *)vctx;
+    PROV_CIPHER_HW_CHACHA20_POLY1305 *hw = (PROV_CIPHER_HW_CHACHA20_POLY1305 *)ctx->base.hw;

     if (!ossl_prov_is_running())
         return 0;

-    if (hw->aead_cipher(ctx, out, outl, NULL, 0) <= 0)
+    /* The tag must be set before actually decrypting data */
+    if (!ctx->base.enc && ctx->tag_len == 0) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_SET);
+        return 0;
+    }
+
+    if (hw->aead_cipher((PROV_CIPHER_CTX *)ctx, out, outl, NULL, 0) <= 0)
         return 0;

     *outl = 0;
+
+    /* Don't reuse the IV */
+    ctx->iv_state = IV_STATE_FINISHED;
     return 1;
 }

diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305.h
index 2e82fdb9478..55e2d254259 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -9,6 +9,9 @@

 /* Dispatch functions for chacha20_poly1305 cipher */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CHACHA20_POLY1305_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CHACHA20_POLY1305_H
+
 #include "include/crypto/poly1305.h"
 #include "cipher_chacha20.h"

@@ -30,6 +33,7 @@ typedef struct {
     size_t tag_len;
     size_t tls_payload_length;
     size_t tls_aad_pad_sz;
+    unsigned int iv_state; /* set to one of IV_STATE_XXX */
 } PROV_CHACHA20_POLY1305_CTX;

 typedef struct prov_cipher_hw_chacha_aead_st {
@@ -43,3 +47,5 @@ typedef struct prov_cipher_hw_chacha_aead_st {
 } PROV_CIPHER_HW_CHACHA20_POLY1305;

 const PROV_CIPHER_HW *ossl_prov_cipher_hw_chacha20_poly1305(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CHACHA20_POLY1305_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305.inc.in
new file mode 100644
index 00000000000..2a42ca8dd92
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305.inc.in
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('chacha20_poly1305_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',            'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',             'ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAGLEN',       'taglen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAG',          'tag',    'octet_string'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD', 'pad',    'size_t'],
+                         )); -}
+
+{- produce_param_decoder('chacha20_poly1305_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',             'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',              'ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAG',           'tag',    'octet_string'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD',      'aad',    'octet_string'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED', 'fixed',  'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305_hw.c
index 1bd0d6a5fc8..cd93e338c7a 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305_hw.c
@@ -9,6 +9,7 @@

 /* chacha20_poly1305 cipher implementation */

+#include <openssl/proverr.h>
 #include "internal/endian.h"
 #include "cipher_chacha20_poly1305.h"

@@ -246,6 +247,7 @@ static int chacha20_poly1305_tls_cipher(PROV_CIPHER_CTX *bctx,
     if (bctx->enc) {
         memcpy(out, ctx->tag, POLY1305_BLOCK_SIZE);
     } else {
+        /* TODO: raise PROV_R_BAD_DECRYPT here too? TLS record path, silent for now */
         if (CRYPTO_memcmp(tohash, in, POLY1305_BLOCK_SIZE)) {
             if (len > POLY1305_BLOCK_SIZE)
                 memset(out - (len - POLY1305_BLOCK_SIZE), 0,
@@ -301,8 +303,10 @@ static int chacha20_poly1305_aead_cipher(PROV_CIPHER_CTX *bctx,

     if (in != NULL) { /* aad or text */
         if (out == NULL) { /* aad */
-            if (ctx->len.text != 0)
+            if (ctx->len.text != 0) {
+                ERR_raise(ERR_LIB_PROV, PROV_R_UPDATE_CALL_OUT_OF_ORDER);
                 goto err;
+            }
             Poly1305_Update(poly, in, inl);
             ctx->len.aad += inl;
             ctx->aad = 1;
@@ -378,6 +382,7 @@ static int chacha20_poly1305_aead_cipher(PROV_CIPHER_CTX *bctx,
             if (bctx->enc) {
                 memcpy(out, ctx->tag, POLY1305_BLOCK_SIZE);
             } else {
+                /* TODO: raise PROV_R_BAD_DECRYPT here too? TLS record path, silent for now */
                 if (CRYPTO_memcmp(temp, in, POLY1305_BLOCK_SIZE)) {
                     memset(out - plen, 0, plen);
                     goto err;
@@ -386,8 +391,10 @@ static int chacha20_poly1305_aead_cipher(PROV_CIPHER_CTX *bctx,
                 inl -= POLY1305_BLOCK_SIZE;
             }
         } else if (!bctx->enc) {
-            if (CRYPTO_memcmp(temp, ctx->tag, ctx->tag_len))
+            if (CRYPTO_memcmp(temp, ctx->tag, ctx->tag_len) != 0) {
+                ERR_raise(ERR_LIB_PROV, PROV_R_BAD_DECRYPT);
                 goto err;
+            }
         }
     }
 finish:
@@ -408,5 +415,5 @@ static const PROV_CIPHER_HW_CHACHA20_POLY1305 chacha20poly1305_hw = {

 const PROV_CIPHER_HW *ossl_prov_cipher_hw_chacha20_poly1305(size_t keybits)
 {
-    return (PROV_CIPHER_HW *)&chacha20poly1305_hw;
+    return (const PROV_CIPHER_HW *)&chacha20poly1305_hw;
 }
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_cts.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_cts.c
index 54c6d49d9f5..e3578c9162d 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_cts.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_cts.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,7 +11,7 @@
  * Helper functions for 128 bit CBC CTS ciphers (Currently AES and Camellia).
  *
  * The function dispatch tables are embedded into cipher_aes.c
- * and cipher_camellia.c using cipher_aes_cts.inc and cipher_camellia_cts.inc
+ * and cipher_camellia.c
  */

 /*
@@ -47,10 +47,25 @@
  */

 #include <openssl/core_names.h>
+#include <openssl/proverr.h>
 #include "prov/ciphercommon.h"
 #include "internal/nelem.h"
 #include "cipher_cts.h"

+struct cipher_cts_get_ctx_param_list_st {
+    struct ossl_cipher_get_ctx_param_list_st common;
+    OSSL_PARAM *mode;
+};
+
+struct cipher_cts_set_ctx_param_list_st {
+    OSSL_PARAM *mode;
+};
+
+#define cipher_cts_get_ctx_params_st cipher_cts_get_ctx_param_list_st
+#define cipher_cts_set_ctx_params_st cipher_cts_set_ctx_param_list_st
+
+#include "providers/implementations/ciphers/cipher_cts.inc"
+
 /* The value assigned to 0 is the default */
 #define CTS_CS1 0
 #define CTS_CS2 1
@@ -96,6 +111,63 @@ int ossl_cipher_cbc_cts_mode_name2id(const char *name)
     return -1;
 }

+int ossl_cipher_cbc_cts_get_ctx_params(void *vctx, OSSL_PARAM params[])
+{
+    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
+    struct cipher_cts_get_ctx_param_list_st p;
+
+    if (ctx == NULL || !cipher_cts_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (!ossl_cipher_common_get_ctx_params(ctx, &p.common))
+        return 0;
+
+    if (p.mode != NULL) {
+        const char *name = ossl_cipher_cbc_cts_mode_id2name(ctx->cts_mode);
+
+        if (name == NULL || !OSSL_PARAM_set_utf8_string(p.mode, name)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+            return 0;
+        }
+    }
+    return 1;
+}
+
+const OSSL_PARAM *ossl_cipher_cbc_cts_gettable_ctx_params(
+    ossl_unused void *cctx, ossl_unused void *provctx)
+{
+    return cipher_cts_get_ctx_params_list;
+}
+
+int ossl_cipher_cbc_cts_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+{
+    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
+    struct cipher_cts_set_ctx_param_list_st p;
+
+    if (ctx == NULL || !cipher_cts_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.mode != NULL) {
+        int id;
+
+        if (p.mode->data_type != OSSL_PARAM_UTF8_STRING
+            || p.mode->data == NULL
+            || (id = ossl_cipher_cbc_cts_mode_name2id(p.mode->data)) < 0) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+            return 0;
+        }
+        ctx->cts_mode = (unsigned int)id;
+    }
+
+    return 1;
+}
+
+const OSSL_PARAM *ossl_cipher_cbc_cts_settable_ctx_params(
+    ossl_unused void *cctx, ossl_unused void *provctx)
+{
+    return cipher_cts_set_ctx_params_list;
+}
+
 static size_t cts128_cs1_encrypt(PROV_CIPHER_CTX *ctx, const unsigned char *in,
     unsigned char *out, size_t len)
 {
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_cts.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_cts.h
index b3a677b6aa5..43e94e415a0 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_cts.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_cts.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CTS_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CTS_H
+
 #include "crypto/evp.h"

 /* NOTE: The underlying block cipher is CBC so we reuse most of the code */
@@ -35,18 +38,24 @@
         { OSSL_FUNC_CIPHER_GETTABLE_PARAMS,                                      \
             (void (*)(void))ossl_cipher_generic_gettable_params },               \
         { OSSL_FUNC_CIPHER_GET_CTX_PARAMS,                                       \
-            (void (*)(void))alg##_cbc_cts_get_ctx_params },                      \
+            (void (*)(void))ossl_cipher_cbc_cts_get_ctx_params },                \
         { OSSL_FUNC_CIPHER_SET_CTX_PARAMS,                                       \
-            (void (*)(void))alg##_cbc_cts_set_ctx_params },                      \
+            (void (*)(void))ossl_cipher_cbc_cts_set_ctx_params },                \
         { OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS,                                  \
-            (void (*)(void))alg##_cbc_cts_gettable_ctx_params },                 \
+            (void (*)(void))ossl_cipher_cbc_cts_gettable_ctx_params },           \
         { OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS,                                  \
-            (void (*)(void))alg##_cbc_cts_settable_ctx_params },                 \
+            (void (*)(void))ossl_cipher_cbc_cts_settable_ctx_params },           \
         OSSL_DISPATCH_END                                                        \
     };

 OSSL_FUNC_cipher_update_fn ossl_cipher_cbc_cts_block_update;
 OSSL_FUNC_cipher_final_fn ossl_cipher_cbc_cts_block_final;
+OSSL_FUNC_cipher_get_ctx_params_fn ossl_cipher_cbc_cts_get_ctx_params;
+OSSL_FUNC_cipher_set_ctx_params_fn ossl_cipher_cbc_cts_set_ctx_params;
+OSSL_FUNC_cipher_gettable_ctx_params_fn ossl_cipher_cbc_cts_gettable_ctx_params;
+OSSL_FUNC_cipher_settable_ctx_params_fn ossl_cipher_cbc_cts_settable_ctx_params;

 const char *ossl_cipher_cbc_cts_mode_id2name(unsigned int id);
 int ossl_cipher_cbc_cts_mode_name2id(const char *name);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CTS_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_cts.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_cts.inc.in
new file mode 100644
index 00000000000..46503308a4a
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_cts.inc.in
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('cipher_cts_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',     'common.keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',      'common.ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_IV',         'common.iv',     'octet_string'],
+                          ['OSSL_CIPHER_PARAM_UPDATED_IV', 'common.updiv',  'octet_string'],
+                          ['OSSL_CIPHER_PARAM_CTS_MODE',   'mode',          'utf8_string'],
+                          ['OSSL_CIPHER_PARAM_FIPS_APPROVED_INDICATOR', 'fips indicator', 'int'],
+                         )); -}
+
+{- produce_param_decoder('cipher_cts_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_CTS_MODE', 'mode', 'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_des.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_des.c
index c9073939697..60396db2cbd 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_des.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_des.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,6 +20,15 @@
 #include "prov/implementations.h"
 #include "prov/providercommon.h"

+struct des_get_ctx_param_list_st {
+    struct ossl_cipher_get_ctx_param_list_st common;
+    OSSL_PARAM *rand;
+};
+
+#define des_get_ctx_params_st des_get_ctx_param_list_st
+
+#include "providers/implementations/ciphers/cipher_des.inc"
+
 #define DES_FLAGS PROV_CIPHER_FLAG_RAND_KEY

 static OSSL_FUNC_cipher_freectx_fn des_freectx;
@@ -117,7 +126,6 @@ static int des_dinit(void *vctx, const unsigned char *key, size_t keylen,

 static int des_generatekey(PROV_CIPHER_CTX *ctx, void *ptr)
 {
-
     DES_cblock *deskey = ptr;
     size_t kl = ctx->keylen;

@@ -127,20 +135,24 @@ static int des_generatekey(PROV_CIPHER_CTX *ctx, void *ptr)
     return 1;
 }

-CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_START(des)
-OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_RANDOM_KEY, NULL, 0),
-    CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_END(des)
+static const OSSL_PARAM *des_gettable_ctx_params(ossl_unused void *cctx,
+    ossl_unused void *provctx)
+{
+    return des_get_ctx_params_list;
+}

-        static int des_get_ctx_params(void *vctx, OSSL_PARAM params[])
+static int des_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
-    OSSL_PARAM *p;
+    struct des_get_ctx_param_list_st p;
+
+    if (ctx == NULL || !des_get_ctx_params_decoder(params, &p))
+        return 0;

-    if (!ossl_cipher_generic_get_ctx_params(vctx, params))
+    if (!ossl_cipher_common_get_ctx_params(ctx, &p.common))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_RANDOM_KEY);
-    if (p != NULL && !des_generatekey(ctx, p->data)) {
+    if (p.rand != NULL && !des_generatekey(ctx, p.rand->data)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GENERATE_KEY);
         return 0;
     }
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_des.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_des.h
index 9fd72f00688..6be5a91ea60 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_des.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_des.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,8 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_DES_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_DES_H
+
 #include <openssl/des.h>
 #include "crypto/des_platform.h"
+#include "prov/ciphercommon.h"

 #define TDES_FLAGS 0

@@ -31,3 +35,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_des_ofb64(void);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_des_cfb64(void);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_des_cfb1(void);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_des_cfb8(void);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_DES_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_des.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_des.inc.in
new file mode 100644
index 00000000000..5accd2a49d6
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_des.inc.in
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('des_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',     'common.keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',      'common.ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_PADDING',    'common.pad',    'uint'],
+                          ['OSSL_CIPHER_PARAM_NUM',        'common.num',    'uint'],
+                          ['OSSL_CIPHER_PARAM_IV',         'common.iv',     'octet_string'],
+                          ['OSSL_CIPHER_PARAM_UPDATED_IV', 'common.updiv',  'octet_string'],
+                          ['OSSL_CIPHER_PARAM_RANDOM_KEY', 'rand',          'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_des_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_des_hw.c
index 724cda6920b..854acb0c0a2 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_des_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_des_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -187,8 +187,8 @@ static int cipher_hw_des_cfb8_cipher(PROV_CIPHER_CTX *ctx, unsigned char *out,
     }

 PROV_CIPHER_HW_des_mode(ecb)
-    PROV_CIPHER_HW_des_mode(cbc)
-        PROV_CIPHER_HW_des_mode(ofb64)
-            PROV_CIPHER_HW_des_mode(cfb64)
-                PROV_CIPHER_HW_des_mode(cfb1)
-                    PROV_CIPHER_HW_des_mode(cfb8)
+PROV_CIPHER_HW_des_mode(cbc)
+PROV_CIPHER_HW_des_mode(ofb64)
+PROV_CIPHER_HW_des_mode(cfb64)
+PROV_CIPHER_HW_des_mode(cfb1)
+PROV_CIPHER_HW_des_mode(cfb8)
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_idea.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_idea.h
index 44f9571ff37..11727973a56 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_idea.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_idea.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_IDEA_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_IDEA_H
+
 #include <openssl/idea.h>
 #include "prov/ciphercommon.h"

@@ -22,3 +25,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_idea_cbc(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_idea_ecb(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_idea_ofb64(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_idea_cfb64(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_IDEA_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_null.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_null.c
index 227d79c02fe..0d38a014653 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_null.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_null.c
@@ -14,6 +14,7 @@
 #include "prov/implementations.h"
 #include "prov/ciphercommon.h"
 #include "prov/providercommon.h"
+#include "providers/implementations/ciphers/cipher_null.inc"

 typedef struct prov_cipher_null_ctx_st {
     int enc;
@@ -105,69 +106,60 @@ static int null_get_params(OSSL_PARAM params[])
     return ossl_cipher_generic_get_params(params, 0, 0, 0, 8, 0);
 }

-static const OSSL_PARAM null_known_gettable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_IVLEN, NULL),
-    { OSSL_CIPHER_PARAM_TLS_MAC, OSSL_PARAM_OCTET_PTR, NULL, 0, OSSL_PARAM_UNMODIFIED },
-    OSSL_PARAM_END
-};
-
 static OSSL_FUNC_cipher_gettable_ctx_params_fn null_gettable_ctx_params;
 static const OSSL_PARAM *null_gettable_ctx_params(ossl_unused void *cctx,
     ossl_unused void *provctx)
 {
-    return null_known_gettable_ctx_params;
+    return null_get_ctx_params_list;
 }

 static OSSL_FUNC_cipher_get_ctx_params_fn null_get_ctx_params;
 static int null_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_CIPHER_NULL_CTX *ctx = (PROV_CIPHER_NULL_CTX *)vctx;
-    OSSL_PARAM *p;
+    struct null_get_ctx_params_st p;
+
+    if (ctx == NULL || !null_get_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, 0)) {
+    if (p.ivlen != NULL && !OSSL_PARAM_set_size_t(p.ivlen, 0)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, 0)) {
+
+    if (p.keylen != NULL && !OSSL_PARAM_set_size_t(p.keylen, 0)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS_MAC);
-    if (p != NULL
-        && !OSSL_PARAM_set_octet_ptr(p, ctx->tlsmac, ctx->tlsmacsize)) {
+
+    if (p.mac != NULL
+        && !OSSL_PARAM_set_octet_ptr(p.mac, ctx->tlsmac, ctx->tlsmacsize)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
     return 1;
 }

-static const OSSL_PARAM null_known_settable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_TLS_MAC_SIZE, NULL),
-    OSSL_PARAM_END
-};
-
 static OSSL_FUNC_cipher_settable_ctx_params_fn null_settable_ctx_params;
 static const OSSL_PARAM *null_settable_ctx_params(ossl_unused void *cctx,
     ossl_unused void *provctx)
 {
-    return null_known_settable_ctx_params;
+    return null_set_ctx_params_list;
 }

 static OSSL_FUNC_cipher_set_ctx_params_fn null_set_ctx_params;
 static int null_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_CIPHER_NULL_CTX *ctx = (PROV_CIPHER_NULL_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct null_set_ctx_params_st p;

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_MAC_SIZE);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &ctx->tlsmacsize)) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
-            return 0;
-        }
+    if (ctx == NULL || !null_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.macsize != NULL
+        && !OSSL_PARAM_get_size_t(p.macsize, &ctx->tlsmacsize)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+        return 0;
     }

     return 1;
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_null.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_null.inc.in
new file mode 100644
index 00000000000..73ee633c6be
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_null.inc.in
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('null_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',  'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',   'ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_TLS_MAC', 'mac',    'octet_ptr'],
+                         )); -}
+
+{- produce_param_decoder('null_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_TLS_MAC_SIZE', 'macsize', 'size_t'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc2.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc2.c
index e79674868c4..93b55fb3be8 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc2.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc2.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,6 +20,24 @@
 #include "prov/implementations.h"
 #include "prov/providercommon.h"

+struct rc2_get_ctx_param_list_st {
+    struct ossl_cipher_get_ctx_param_list_st common;
+    OSSL_PARAM *bits;
+    OSSL_PARAM *algid;
+    OSSL_PARAM *oldid;
+};
+
+struct rc2_set_ctx_param_list_st {
+    struct ossl_cipher_set_ctx_param_list_st common;
+    OSSL_PARAM *bits;
+    OSSL_PARAM *algid;
+};
+
+#define rc2_get_ctx_params_st rc2_get_ctx_param_list_st
+#define rc2_set_ctx_params_st rc2_set_ctx_param_list_st
+
+#include "providers/implementations/ciphers/cipher_rc2.inc"
+
 #define RC2_40_MAGIC 0xa0
 #define RC2_64_MAGIC 0x78
 #define RC2_128_MAGIC 0x3a
@@ -106,17 +124,20 @@ static int rc2_dinit(void *ctx, const unsigned char *key, size_t keylen,
 static int rc2_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_RC2_CTX *ctx = (PROV_RC2_CTX *)vctx;
+    struct rc2_get_ctx_param_list_st prms;
     OSSL_PARAM *p, *p1, *p2;

-    if (!ossl_cipher_generic_get_ctx_params(vctx, params))
+    if (ctx == NULL || !rc2_get_ctx_params_decoder(params, &prms))
+        return 0;
+    if (!ossl_cipher_common_get_ctx_params(&ctx->base, &prms.common))
         return 0;
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_RC2_KEYBITS);
+    p = prms.bits;
     if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->key_bits)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p1 = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS);
-    p2 = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS_OLD);
+    p1 = prms.algid;
+    p2 = prms.oldid;
     if (p1 != NULL || p2 != NULL) {
         long num;
         int i;
@@ -137,9 +158,9 @@ static int rc2_get_ctx_params(void *vctx, OSSL_PARAM params[])
         }

         /* Is this the original IV or the running IV? */
-        num = rc2_keybits_to_magic(ctx->key_bits);
-        if (!ASN1_TYPE_set_int_octetstring(type, num,
-                ctx->base.iv, ctx->base.ivlen)) {
+        num = rc2_keybits_to_magic((int)ctx->key_bits);
+        if (!ASN1_TYPE_set_int_octetstring(type, num, ctx->base.iv,
+                (int)ctx->base.ivlen)) {
             ASN1_TYPE_free(type);
             ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB);
             return 0;
@@ -174,21 +195,24 @@ static int rc2_get_ctx_params(void *vctx, OSSL_PARAM params[])
 static int rc2_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_RC2_CTX *ctx = (PROV_RC2_CTX *)vctx;
+    struct rc2_set_ctx_param_list_st prms;
     const OSSL_PARAM *p;

     if (ossl_param_is_empty(params))
         return 1;

-    if (!ossl_cipher_var_keylen_set_ctx_params(vctx, params))
+    if (ctx == NULL || !rc2_set_ctx_params_decoder(params, &prms))
         return 0;
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_RC2_KEYBITS);
+    if (!ossl_cipher_common_set_ctx_params(&ctx->base, &prms.common))
+        return 0;
+    p = prms.bits;
     if (p != NULL) {
         if (!OSSL_PARAM_get_size_t(p, &ctx->key_bits)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS);
+    p = prms.algid;
     if (p != NULL) {
         ASN1_TYPE *type = NULL;
         long num = 0;
@@ -198,9 +222,9 @@ static int rc2_set_ctx_params(void *vctx, const OSSL_PARAM params[])

         if (p->data_type != OSSL_PARAM_OCTET_STRING
             || ctx->base.ivlen > sizeof(iv)
-            || (type = d2i_ASN1_TYPE(NULL, &d, p->data_size)) == NULL
+            || (type = d2i_ASN1_TYPE(NULL, &d, (long)p->data_size)) == NULL
             || ((size_t)ASN1_TYPE_get_int_octetstring(type, &num, iv,
-                    ctx->base.ivlen)
+                    (int)ctx->base.ivlen)
                 != ctx->base.ivlen)
             || !ossl_cipher_generic_initiv(&ctx->base, iv, ctx->base.ivlen)
             || (ctx->key_bits = rc2_magic_to_keybits(num)) == 0) {
@@ -220,16 +244,17 @@ static int rc2_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     return 1;
 }

-CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_START(rc2)
-OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_RC2_KEYBITS, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS, NULL, 0),
-    CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_END(rc2)
+static const OSSL_PARAM *rc2_gettable_ctx_params(ossl_unused void *cctx,
+    ossl_unused void *provctx)
+{
+    return rc2_get_ctx_params_list;
+}

-        CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_START(rc2)
-            OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_RC2_KEYBITS, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS, NULL, 0),
-    CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_END(rc2)
+static const OSSL_PARAM *rc2_settable_ctx_params(ossl_unused void *cctx,
+    ossl_unused void *provctx)
+{
+    return rc2_set_ctx_params_list;
+}

 #define IMPLEMENT_cipher(alg, UCALG, lcmode, UCMODE, flags, kbits, blkbits,              \
     ivbits, typ)                                                                         \
@@ -280,8 +305,8 @@ OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_RC2_KEYBITS, NULL),
         OSSL_DISPATCH_END                                                                \
     };

-    /* ossl_rc2128ecb_functions */
-    IMPLEMENT_cipher(rc2, RC2, ecb, ECB, RC2_FLAGS, 128, 64, 0, block)
+/* ossl_rc2128ecb_functions */
+IMPLEMENT_cipher(rc2, RC2, ecb, ECB, RC2_FLAGS, 128, 64, 0, block)
 /* ossl_rc2128cbc_functions */
 IMPLEMENT_cipher(rc2, RC2, cbc, CBC, RC2_FLAGS, 128, 64, 64, block)
 /* ossl_rc240cbc_functions */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc2.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc2.h
index bfb1d45495d..1c32089c1b8 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc2.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc2.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC2_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC2_H
+
 #include <openssl/rc2.h>
 #include "prov/ciphercommon.h"

@@ -26,3 +29,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc2_cbc(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc2_ecb(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc2_ofb64(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc2_cfb64(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC2_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc2.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc2.inc.in
new file mode 100644
index 00000000000..98d54bf8940
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc2.inc.in
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('rc2_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',                 'common.keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',                  'common.ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_PADDING',                'common.pad',    'uint'],
+                          ['OSSL_CIPHER_PARAM_NUM',                    'common.num',    'uint'],
+                          ['OSSL_CIPHER_PARAM_IV',                     'common.iv',     'octet_string'],
+                          ['OSSL_CIPHER_PARAM_UPDATED_IV',             'common.updiv',  'octet_string'],
+                          ['OSSL_CIPHER_PARAM_RC2_KEYBITS',            'bits',          'size_t'],
+                          ['OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS',    'algid',         'octet_string'],
+                          ['OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS_OLD', 'oldid',        'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('rc2_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_PADDING',             'common.pad',        'uint'],
+                          ['OSSL_CIPHER_PARAM_NUM',                 'common.num',        'uint'],
+                          ['OSSL_CIPHER_PARAM_KEYLEN',              'common.keylen',     'size_t'],
+                          ['OSSL_CIPHER_PARAM_RC2_KEYBITS',         'bits',              'size_t'],
+                          ['OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS', 'algid',             'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4.h
index 8bb6f226523..2842f36153a 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC4_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC4_H
+
 #include <openssl/rc4.h>
 #include "prov/ciphercommon.h"

@@ -19,3 +22,5 @@ typedef struct prov_rc4_ctx_st {
 } PROV_RC4_CTX;

 const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc4(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC4_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5.c
index ecb777d3051..5683a63f9db 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,6 +19,7 @@
 #include "cipher_rc4_hmac_md5.h"
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
+#include "providers/implementations/ciphers/cipher_rc4_hmac_md5.inc"

 #define RC4_HMAC_MD5_FLAGS (PROV_CIPHER_FLAG_VARIABLE_LENGTH \
     | PROV_CIPHER_FLAG_AEAD)
@@ -28,7 +29,7 @@
 #define RC4_HMAC_MD5_IV_BITS 0
 #define RC4_HMAC_MD5_MODE 0

-#define GET_HW(ctx) ((PROV_CIPHER_HW_RC4_HMAC_MD5 *)ctx->base.hw)
+#define GET_HW(ctx) ((const PROV_CIPHER_HW_RC4_HMAC_MD5 *)ctx->base.hw)

 static OSSL_FUNC_cipher_encrypt_init_fn rc4_hmac_md5_einit;
 static OSSL_FUNC_cipher_decrypt_init_fn rc4_hmac_md5_dinit;
@@ -75,10 +76,18 @@ static void rc4_hmac_md5_freectx(void *vctx)
 static void *rc4_hmac_md5_dupctx(void *vctx)
 {
     PROV_RC4_HMAC_MD5_CTX *ctx = vctx;
+    PROV_RC4_HMAC_MD5_CTX *dctx;

     if (ctx == NULL)
         return NULL;
-    return OPENSSL_memdup(ctx, sizeof(*ctx));
+
+    dctx = OPENSSL_memdup(ctx, sizeof(*ctx));
+    if (dctx != NULL
+        && !ossl_cipher_generic_dupctx_tlsmac(&dctx->base, &ctx->base)) {
+        OPENSSL_clear_free(dctx, sizeof(*dctx));
+        return NULL;
+    }
+    return dctx;
 }

 static int rc4_hmac_md5_einit(void *ctx, const unsigned char *key,
@@ -99,66 +108,54 @@ static int rc4_hmac_md5_dinit(void *ctx, const unsigned char *key,
     return rc4_hmac_md5_set_ctx_params(ctx, params);
 }

-static const OSSL_PARAM rc4_hmac_md5_known_gettable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_IVLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD, NULL),
-    OSSL_PARAM_END
-};
-const OSSL_PARAM *rc4_hmac_md5_gettable_ctx_params(ossl_unused void *cctx,
+static const OSSL_PARAM *rc4_hmac_md5_gettable_ctx_params(ossl_unused void *cctx,
     ossl_unused void *provctx)
 {
-    return rc4_hmac_md5_known_gettable_ctx_params;
+    return rc4_hmac_md5_get_ctx_params_list;
 }

 static int rc4_hmac_md5_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_RC4_HMAC_MD5_CTX *ctx = (PROV_RC4_HMAC_MD5_CTX *)vctx;
-    OSSL_PARAM *p;
+    struct rc4_hmac_md5_get_ctx_params_st p;

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->base.keylen)) {
+    if (ctx == NULL || !rc4_hmac_md5_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.keylen != NULL && !OSSL_PARAM_set_size_t(p.keylen, ctx->base.keylen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->base.ivlen)) {
+    if (p.ivlen != NULL && !OSSL_PARAM_set_size_t(p.ivlen, ctx->base.ivlen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->tls_aad_pad_sz)) {
+
+    if (p.pad != NULL && !OSSL_PARAM_set_size_t(p.pad, ctx->tls_aad_pad_sz)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
     return 1;
 }

-static const OSSL_PARAM rc4_hmac_md5_known_settable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_IVLEN, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TLS1_AAD, NULL, 0),
-    OSSL_PARAM_END
-};
-const OSSL_PARAM *rc4_hmac_md5_settable_ctx_params(ossl_unused void *cctx,
+static const OSSL_PARAM *rc4_hmac_md5_settable_ctx_params(ossl_unused void *cctx,
     ossl_unused void *provctx)
 {
-    return rc4_hmac_md5_known_settable_ctx_params;
+    return rc4_hmac_md5_set_ctx_params_list;
 }

 static int rc4_hmac_md5_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_RC4_HMAC_MD5_CTX *ctx = (PROV_RC4_HMAC_MD5_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct rc4_hmac_md5_set_ctx_params_st p;
     size_t sz;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !rc4_hmac_md5_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &sz)) {
+    if (p.keylen != NULL) {
+        if (!OSSL_PARAM_get_size_t(p.keylen, &sz)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -168,9 +165,8 @@ static int rc4_hmac_md5_set_ctx_params(void *vctx, const OSSL_PARAM params[])
         }
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_IVLEN);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &sz)) {
+    if (p.ivlen != NULL) {
+        if (!OSSL_PARAM_get_size_t(p.ivlen, &sz)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -180,33 +176,32 @@ static int rc4_hmac_md5_set_ctx_params(void *vctx, const OSSL_PARAM params[])
         }
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_TLS1_AAD);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+    if (p.aad != NULL) {
+        if (p.aad->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        sz = GET_HW(ctx)->tls_init(&ctx->base, p->data, p->data_size);
+        sz = GET_HW(ctx)->tls_init(&ctx->base, p.aad->data, p.aad->data_size);
         if (sz == 0) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DATA);
             return 0;
         }
         ctx->tls_aad_pad_sz = sz;
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_MAC_KEY);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+
+    if (p.mackey != NULL) {
+        if (p.mackey->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        GET_HW(ctx)->init_mackey(&ctx->base, p->data, p->data_size);
+        GET_HW(ctx)->init_mackey(&ctx->base, p.mackey->data,
+            p.mackey->data_size);
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_VERSION);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_uint(p, &ctx->base.tlsversion)) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
-            return 0;
-        }
+
+    if (p.tlsver != NULL
+        && !OSSL_PARAM_get_uint(p.tlsver, &ctx->base.tlsversion)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+        return 0;
     }

     return 1;
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5.h
index 87fa8e060db..871a35cd73c 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC4_HMAC_MD5_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC4_HMAC_MD5_H
+
 #include <openssl/rc4.h>
 #include <openssl/md5.h>
 #include "prov/ciphercommon.h"
@@ -34,3 +37,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc4_hmac_md5(size_t keybits);

 void rc4_md5_enc(RC4_KEY *key, const void *in0, void *out,
     MD5_CTX *ctx, const void *inp, size_t blocks);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC4_HMAC_MD5_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5.inc.in
new file mode 100644
index 00000000000..0eef707ffe1
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5.inc.in
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('rc4_hmac_md5_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',            'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',             'ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD', 'pad',    'size_t'],
+                         )); -}
+
+{- produce_param_decoder('rc4_hmac_md5_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',        'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',         'ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD', 'aad',    'octet_string'],
+                          ['OSSL_CIPHER_PARAM_AEAD_MAC_KEY',  'mackey', 'octet_string'],
+                          ['OSSL_CIPHER_PARAM_TLS_VERSION',   'tlsver', 'uint'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5_hw.c
index 9bdb2066792..e25782ed8b8 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -37,7 +37,7 @@ static int cipher_hw_rc4_hmac_md5_initkey(PROV_CIPHER_CTX *bctx,
 {
     PROV_RC4_HMAC_MD5_CTX *ctx = (PROV_RC4_HMAC_MD5_CTX *)bctx;

-    RC4_set_key(&ctx->ks.ks, keylen, key);
+    RC4_set_key(&ctx->ks.ks, (int)keylen, key);
     MD5_Init(&ctx->head); /* handy when benchmarking */
     ctx->tail = ctx->head;
     ctx->md = ctx->head;
@@ -82,8 +82,8 @@ static int cipher_hw_rc4_hmac_md5_cipher(PROV_CIPHER_CTX *bctx,
             blocks *= MD5_CBLOCK;
             rc4_off += blocks;
             md5_off += blocks;
-            ctx->md.Nh += blocks >> 29;
-            ctx->md.Nl += blocks <<= 3;
+            ctx->md.Nh += (unsigned int)(blocks >> 29);
+            ctx->md.Nl += (unsigned int)(blocks <<= 3);
             if (ctx->md.Nl < (unsigned int)blocks)
                 ctx->md.Nh++;
         } else {
@@ -132,7 +132,7 @@ static int cipher_hw_rc4_hmac_md5_cipher(PROV_CIPHER_CTX *bctx,
             if (l < ctx->md.Nl)
                 ctx->md.Nh++;
             ctx->md.Nl = l;
-            ctx->md.Nh += blocks >> 29;
+            ctx->md.Nh += (unsigned int)(blocks >> 29);
         } else {
             md5_off = 0;
             rc4_off = 0;
@@ -227,5 +227,5 @@ static const PROV_CIPHER_HW_RC4_HMAC_MD5 rc4_hmac_md5_hw = {

 const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc4_hmac_md5(size_t keybits)
 {
-    return (PROV_CIPHER_HW *)&rc4_hmac_md5_hw;
+    return (const PROV_CIPHER_HW *)&rc4_hmac_md5_hw;
 }
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hw.c
index 9ab18037a27..2adbee963c6 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc4_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,7 +20,7 @@ static int cipher_hw_rc4_initkey(PROV_CIPHER_CTX *ctx,
 {
     PROV_RC4_CTX *rctx = (PROV_RC4_CTX *)ctx;

-    RC4_set_key(&rctx->ks.ks, keylen, key);
+    RC4_set_key(&rctx->ks.ks, (int)keylen, key);
     return 1;
 }

diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5.c
index 4bfb40de4ef..b25c2e6c467 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,6 +20,21 @@
 #include "prov/implementations.h"
 #include "prov/providercommon.h"

+struct rc5_get_ctx_param_list_st {
+    struct ossl_cipher_get_ctx_param_list_st common;
+    OSSL_PARAM *rounds;
+};
+
+struct rc5_set_ctx_param_list_st {
+    struct ossl_cipher_set_ctx_param_list_st common;
+    OSSL_PARAM *rounds;
+};
+
+#define rc5_get_ctx_params_st rc5_get_ctx_param_list_st
+#define rc5_set_ctx_params_st rc5_set_ctx_param_list_st
+
+#include "providers/implementations/ciphers/cipher_rc5.inc"
+
 #define RC5_FLAGS PROV_CIPHER_FLAG_VARIABLE_LENGTH

 static OSSL_FUNC_cipher_encrypt_init_fn rc5_einit;
@@ -75,19 +90,18 @@ static int rc5_dinit(void *ctx, const unsigned char *key, size_t keylen,
 static int rc5_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_RC5_CTX *ctx = (PROV_RC5_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct rc5_set_ctx_param_list_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !rc5_set_ctx_params_decoder(params, &p))
+        return 0;

-    if (!ossl_cipher_var_keylen_set_ctx_params(vctx, params))
+    if (!ossl_cipher_common_set_ctx_params(&ctx->base, &p.common))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_ROUNDS);
-    if (p != NULL) {
+    if (p.rounds != NULL) {
         unsigned int rounds;

-        if (!OSSL_PARAM_get_uint(p, &rounds)) {
+        if (!OSSL_PARAM_get_uint(p.rounds, &rounds)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -102,24 +116,30 @@ static int rc5_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     return 1;
 }

-CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_START(rc5)
-OSSL_PARAM_uint(OSSL_CIPHER_PARAM_ROUNDS, NULL),
-    CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_END(rc5)
+const OSSL_PARAM *rc5_gettable_ctx_params(ossl_unused void *cctx,
+    ossl_unused void *provctx)
+{
+    return rc5_get_ctx_params_list;
+}

-        CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_START(rc5)
-            OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_uint(OSSL_CIPHER_PARAM_ROUNDS, NULL),
-    CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_END(rc5)
+const OSSL_PARAM *rc5_settable_ctx_params(ossl_unused void *cctx,
+    ossl_unused void *provctx)
+{
+    return rc5_set_ctx_params_list;
+}

-        static int rc5_get_ctx_params(void *vctx, OSSL_PARAM params[])
+static int rc5_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_RC5_CTX *ctx = (PROV_RC5_CTX *)vctx;
-    OSSL_PARAM *p;
+    struct rc5_get_ctx_param_list_st p;

-    if (!ossl_cipher_generic_get_ctx_params(vctx, params))
+    if (ctx == NULL || !rc5_get_ctx_params_decoder(params, &p))
         return 0;
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_ROUNDS);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->rounds)) {
+
+    if (!ossl_cipher_common_get_ctx_params(&ctx->base, &p.common))
+        return 0;
+
+    if (p.rounds != NULL && !OSSL_PARAM_set_uint(p.rounds, ctx->rounds)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5.h
index 0662937f68e..4141475f111 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,10 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC5_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC5_H
+
+#if !defined(OPENSSL_NO_RC5)
 #include <openssl/rc5.h>
 #include "prov/ciphercommon.h"

@@ -23,3 +27,6 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_cbc(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_ecb(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_ofb64(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_cfb64(size_t keybits);
+
+#endif /* defined(OPENSSL_NO_RC5) */
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC5_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5.inc.in
new file mode 100644
index 00000000000..5f96c2b7fc4
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5.inc.in
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('rc5_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',     'common.keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',      'common.ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_PADDING',    'common.pad',    'uint'],
+                          ['OSSL_CIPHER_PARAM_NUM',        'common.num',    'uint'],
+                          ['OSSL_CIPHER_PARAM_IV',         'common.iv',     'octet_string'],
+                          ['OSSL_CIPHER_PARAM_UPDATED_IV', 'common.updiv',  'octet_string'],
+                          ['OSSL_CIPHER_PARAM_ROUNDS',     'rounds',        'uint'],
+                         )); -}
+
+{- produce_param_decoder('rc5_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_PADDING',      'common.pad',        'uint'],
+                          ['OSSL_CIPHER_PARAM_NUM',          'common.num',        'uint'],
+                          ['OSSL_CIPHER_PARAM_KEYLEN',       'common.keylen',     'size_t'],
+                          ['OSSL_CIPHER_PARAM_ROUNDS',       'rounds',            'uint'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5_hw.c
index a7884c5eee3..a18a7137568 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_rc5_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,7 +20,7 @@ static int cipher_hw_rc5_initkey(PROV_CIPHER_CTX *ctx,
 {
     PROV_RC5_CTX *rctx = (PROV_RC5_CTX *)ctx;

-    return RC5_32_set_key(&rctx->ks.ks, keylen, key, rctx->rounds);
+    return RC5_32_set_key(&rctx->ks.ks, (int)keylen, key, rctx->rounds);
 }

 #define PROV_CIPHER_HW_rc5_mode(mode, UCMODE)                            \
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_seed.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_seed.h
index 750ab8deac8..656b96284c5 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_seed.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_seed.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SEED_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SEED_H
+
 #include <openssl/seed.h>
 #include "prov/ciphercommon.h"

@@ -22,3 +25,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_seed_cbc(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_seed_ecb(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_seed_ofb128(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_seed_cfb128(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SEED_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4.h
index b061022411b..19f16249c33 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_H
+
 #include "prov/ciphercommon.h"
 #include "crypto/sm4.h"
 #include "crypto/sm4_platform.h"
@@ -24,3 +27,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_ecb(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_ctr(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_ofb128(size_t keybits);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_cfb128(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_ccm.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_ccm.h
index 61d44661325..8fa57ff488e 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_ccm.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_ccm.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_CCM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_CCM_H
+
 #include "crypto/sm4.h"
 #include "prov/ciphercommon.h"
 #include "prov/ciphercommon_ccm.h"
@@ -21,3 +24,5 @@ typedef struct prov_sm4_ccm_ctx_st {
 } PROV_SM4_CCM_CTX;

 const PROV_CCM_HW *ossl_prov_sm4_hw_ccm(size_t keylen);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_CCM_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_ccm_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_ccm_hw.c
index b9e41260230..9a2ef2527ab 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_ccm_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_ccm_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -16,7 +16,8 @@

 #define SM4_HW_CCM_SET_KEY_FN(fn_set_enc_key, fn_blk, fn_ccm_enc, fn_ccm_dec) \
     fn_set_enc_key(key, &actx->ks.ks);                                        \
-    CRYPTO_ccm128_init(&ctx->ccm_ctx, ctx->m, ctx->l, &actx->ks.ks,           \
+    CRYPTO_ccm128_init(&ctx->ccm_ctx, (unsigned int)ctx->m,                   \
+        (unsigned int)ctx->l, &actx->ks.ks,                                   \
         (block128_f)fn_blk);                                                  \
     ctx->str = ctx->enc ? (ccm128_f)fn_ccm_enc : (ccm128_f)fn_ccm_dec;        \
     ctx->key_set = 1;
@@ -61,6 +62,8 @@ static const PROV_CCM_HW ccm_sm4 = {

 #if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
 #include "cipher_sm4_ccm_hw_rv64i.inc"
+#elif defined(OPENSSL_CPUID_OBJ) && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
+#include "cipher_sm4_ccm_hw_x86_64.inc"
 #else
 const PROV_CCM_HW *ossl_prov_sm4_hw_ccm(size_t keybits)
 {
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_ccm_hw_x86_64.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_ccm_hw_x86_64.inc
new file mode 100644
index 00000000000..6e4e6a3665d
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_ccm_hw_x86_64.inc
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*-
+ * x86_64 support for SM4 CCM.
+ * This file is included by cipher_sm4_ccm_hw.c
+ */
+
+static int hw_x86_64_sm4_ccm_initkey(PROV_CCM_CTX *ctx,
+                                     const unsigned char *key,
+                                     size_t keylen)
+{
+    PROV_SM4_CCM_CTX *actx = (PROV_SM4_CCM_CTX *)ctx;
+
+    SM4_HW_CCM_SET_KEY_FN(hw_x86_64_sm4_set_key,
+                          hw_x86_64_sm4_encrypt, NULL, NULL);
+    return 1;
+}
+
+static const PROV_CCM_HW hw_x86_64_sm4_ccm = {
+    hw_x86_64_sm4_ccm_initkey,
+    ossl_ccm_generic_setiv,
+    ossl_ccm_generic_setaad,
+    ossl_ccm_generic_auth_encrypt,
+    ossl_ccm_generic_auth_decrypt,
+    ossl_ccm_generic_gettag
+};
+
+const PROV_CCM_HW *ossl_prov_sm4_hw_ccm(size_t keybits)
+{
+    if (HWSM4_CAPABLE_X86_64)
+        return &hw_x86_64_sm4_ccm;
+    else
+        return &ccm_sm4;
+}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_gcm.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_gcm.h
index 6bc9a4d34b6..669c4ad825d 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_gcm.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_gcm.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_GCM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_GCM_H
+
 #include "crypto/sm4.h"
 #include "prov/ciphercommon.h"
 #include "prov/ciphercommon_gcm.h"
@@ -20,3 +23,5 @@ typedef struct prov_sm4_gcm_ctx_st {
 } PROV_SM4_GCM_CTX;

 const PROV_GCM_HW *ossl_prov_sm4_hw_gcm(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_GCM_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_gcm_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_gcm_hw.c
index 2d1157d3b11..76aaec80aab 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_gcm_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_gcm_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -91,6 +91,8 @@ static const PROV_GCM_HW sm4_gcm = {

 #if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
 #include "cipher_sm4_gcm_hw_rv64i.inc"
+#elif defined(OPENSSL_CPUID_OBJ) && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
+#include "cipher_sm4_gcm_hw_x86_64.inc"
 #else
 const PROV_GCM_HW *ossl_prov_sm4_hw_gcm(size_t keybits)
 {
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_gcm_hw_x86_64.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_gcm_hw_x86_64.inc
new file mode 100644
index 00000000000..2339cb2f5bb
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_gcm_hw_x86_64.inc
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*-
+ * x86_64 support for SM4 GCM.
+ * This file is included by cipher_sm4_gcm_hw.c
+ */
+
+static int hw_x86_64_sm4_gcm_initkey(PROV_GCM_CTX *ctx,
+                                     const unsigned char *key,
+                                     size_t keylen)
+{
+    PROV_SM4_GCM_CTX *actx = (PROV_SM4_GCM_CTX *)ctx;
+    SM4_KEY *ks = &actx->ks.ks;
+
+    SM4_GCM_HW_SET_KEY_CTR_FN(ks, hw_x86_64_sm4_set_key,
+                              hw_x86_64_sm4_encrypt, NULL);
+    return 1;
+}
+
+static const PROV_GCM_HW hw_x86_64_sm4_gcm = {
+    hw_x86_64_sm4_gcm_initkey,
+    ossl_gcm_setiv,
+    ossl_gcm_aad_update,
+    hw_gcm_cipher_update,
+    ossl_gcm_cipher_final,
+    ossl_gcm_one_shot
+};
+
+const PROV_GCM_HW *ossl_prov_sm4_hw_gcm(size_t keybits)
+{
+    if (HWSM4_CAPABLE_X86_64)
+        return &hw_x86_64_sm4_gcm;
+    else
+        return &sm4_gcm;
+}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_hw.c
index df70eded48c..fdffd3ce301 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -136,6 +136,8 @@ IMPLEMENT_CIPHER_HW_COPYCTX(cipher_hw_sm4_copyctx, PROV_SM4_CTX)

 #if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
 #include "cipher_sm4_hw_rv64i.inc"
+#elif defined(OPENSSL_CPUID_OBJ) && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
+#include "cipher_sm4_hw_x86_64.inc"
 #else
 /* The generic case */
 #define PROV_CIPHER_HW_declare(mode)
@@ -143,7 +145,7 @@ IMPLEMENT_CIPHER_HW_COPYCTX(cipher_hw_sm4_copyctx, PROV_SM4_CTX)
 #endif

 PROV_CIPHER_HW_sm4_mode(cbc)
-    PROV_CIPHER_HW_sm4_mode(ecb)
-        PROV_CIPHER_HW_sm4_mode(ofb128)
-            PROV_CIPHER_HW_sm4_mode(cfb128)
-                PROV_CIPHER_HW_sm4_mode(ctr)
+PROV_CIPHER_HW_sm4_mode(ecb)
+PROV_CIPHER_HW_sm4_mode(ofb128)
+PROV_CIPHER_HW_sm4_mode(cfb128)
+PROV_CIPHER_HW_sm4_mode(ctr)
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_hw_rv64i.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_hw_rv64i.inc
index 763d9d09dd9..683b2b25a1f 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_hw_rv64i.inc
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_hw_rv64i.inc
@@ -26,6 +26,7 @@ static int cipher_hw_rv64i_zvksed_sm4_initkey(PROV_CIPHER_CTX *ctx,
     SM4_KEY *ks = &sctx->ks.ks;

     ctx->ks = ks;
+
     if (ctx->enc
             || (ctx->mode != EVP_CIPH_ECB_MODE
                 && ctx->mode != EVP_CIPH_CBC_MODE)) {
@@ -38,6 +39,14 @@ static int cipher_hw_rv64i_zvksed_sm4_initkey(PROV_CIPHER_CTX *ctx,
         ctx->stream.cbc = NULL;
     }

+    if (ctx->mode == EVP_CIPH_CBC_MODE) {
+        if (ctx->enc) {
+            ctx->stream.cbc = (cbc128_f) rv64i_zvksed_sm4_cbc_encrypt;
+        } else {
+            ctx->stream.cbc = (cbc128_f) rv64i_zvksed_sm4_cbc_decrypt;
+        }
+    }
+
     return 1;
 }

diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_hw_x86_64.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_hw_x86_64.inc
new file mode 100644
index 00000000000..01b7d112684
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_hw_x86_64.inc
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*-
+ * x86_64 SM4 support for modes ecb, cbc, ofb, cfb, ctr.
+ * This file is included by cipher_sm4_hw.c
+ */
+
+#define cipher_hw_x86_64_sm4_cbc    ossl_cipher_hw_generic_cbc
+#define cipher_hw_x86_64_sm4_ecb    ossl_cipher_hw_generic_ecb
+#define cipher_hw_x86_64_sm4_ofb128 ossl_cipher_hw_generic_ofb128
+#define cipher_hw_x86_64_sm4_cfb128 ossl_cipher_hw_generic_cfb128
+#define cipher_hw_x86_64_sm4_ctr    ossl_cipher_hw_generic_ctr
+
+static int cipher_hw_x86_64_sm4_initkey(PROV_CIPHER_CTX *ctx,
+                                        const unsigned char *key,
+                                        size_t keylen)
+{
+    PROV_SM4_CTX *sctx = (PROV_SM4_CTX *)ctx;
+    SM4_KEY *ks = &sctx->ks.ks;
+
+    ctx->ks = ks;
+    hw_x86_64_sm4_set_key(key, ks);
+    if (ctx->enc
+            || (ctx->mode != EVP_CIPH_ECB_MODE
+                && ctx->mode != EVP_CIPH_CBC_MODE)) {
+        ctx->block = (block128_f) hw_x86_64_sm4_encrypt;
+        ctx->stream.cbc = NULL;
+    } else {
+        ctx->block = (block128_f) hw_x86_64_sm4_decrypt;
+        ctx->stream.cbc = NULL;
+    }
+
+    return 1;
+}
+
+#define PROV_CIPHER_HW_declare(mode)                                                  \
+    static const PROV_CIPHER_HW hw_x86_64_sm4_##mode = {                              \
+                                                        cipher_hw_x86_64_sm4_initkey, \
+                                                        cipher_hw_x86_64_sm4_##mode,  \
+                                                        cipher_hw_sm4_copyctx         \
+    };
+
+#define PROV_CIPHER_HW_select(mode)                                      \
+    if (HWSM4_CAPABLE_X86_64)                                            \
+        return &hw_x86_64_sm4_##mode;
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts.c
index 69878df7e48..be5942b919c 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts.c
@@ -1,4 +1,3 @@
-
 /*
  * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
  *
@@ -14,6 +13,7 @@
 #include "cipher_sm4_xts.h"
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
+#include "providers/implementations/ciphers/cipher_sm4_xts.inc"

 #define SM4_XTS_FLAGS PROV_CIPHER_FLAG_CUSTOM_IV
 #define SM4_XTS_IV_BITS 128
@@ -189,24 +189,19 @@ static int sm4_xts_stream_final(void *vctx, unsigned char *out, size_t *outl,
     return 1;
 }

-static const OSSL_PARAM sm4_xts_known_settable_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_CIPHER_PARAM_XTS_STANDARD, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *sm4_xts_settable_ctx_params(ossl_unused void *cctx,
     ossl_unused void *provctx)
 {
-    return sm4_xts_known_settable_ctx_params;
+    return sm4_xts_set_ctx_params_list;
 }

 static int sm4_xts_set_ctx_params(void *vxctx, const OSSL_PARAM params[])
 {
     PROV_SM4_XTS_CTX *xctx = (PROV_SM4_XTS_CTX *)vxctx;
-    const OSSL_PARAM *p;
+    struct sm4_xts_set_ctx_params_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (xctx == NULL || !sm4_xts_set_ctx_params_decoder(params, &p))
+        return 0;

     /*-
      * Sets the XTS standard to use with SM4-XTS algorithm.
@@ -215,15 +210,13 @@ static int sm4_xts_set_ctx_params(void *vxctx, const OSSL_PARAM params[])
      * "GB" means the GB/T 17964-2021 standard
      * "IEEE" means the IEEE Std 1619-2007 standard
      */
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_XTS_STANDARD);
-
-    if (p != NULL) {
+    if (p.std != NULL) {
         const char *xts_standard = NULL;

-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
+        if (p.std->data_type != OSSL_PARAM_UTF8_STRING)
             return 0;

-        if (!OSSL_PARAM_get_utf8_string_ptr(p, &xts_standard)) {
+        if (!OSSL_PARAM_get_utf8_string_ptr(p.std, &xts_standard)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts.h
index 57dcdb6ccf3..5ab1b4d314c 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_XTS_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_XTS_H
+
 #include <crypto/sm4.h>
 #include "prov/ciphercommon.h"
 #include "crypto/sm4_platform.h"
@@ -44,3 +47,5 @@ typedef struct prov_sm4_xts_ctx_st {
 } PROV_SM4_XTS_CTX;

 const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_xts(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_XTS_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts.inc.in
new file mode 100644
index 00000000000..b9759ddf812
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts.inc.in
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('sm4_xts_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_XTS_STANDARD', 'std', 'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts_hw.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts_hw.c
index 891b3bdc6b0..ca7e9c6aac8 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts_hw.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts_hw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -91,6 +91,8 @@ static const PROV_CIPHER_HW sm4_generic_xts = {

 #if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
 #include "cipher_sm4_xts_hw_rv64i.inc"
+#elif defined(OPENSSL_CPUID_OBJ) && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
+#include "cipher_sm4_xts_hw_x86_64.inc"
 #else
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_xts(size_t keybits)
 {
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts_hw_x86_64.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts_hw_x86_64.inc
new file mode 100644
index 00000000000..8428106fae9
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_sm4_xts_hw_x86_64.inc
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*-
+ * x86_64 support for SM4 XTS.
+ * This file is included by cipher_sm4_xts_hw.c
+ */
+
+static int hw_x86_64_sm4_xts_initkey(PROV_CIPHER_CTX *ctx,
+                                     const unsigned char *key,
+                                     size_t keylen)
+{
+    PROV_SM4_XTS_CTX *xctx = (PROV_SM4_XTS_CTX *)ctx;
+    OSSL_xts_stream_fn stream_fn = NULL;
+    OSSL_xts_stream_fn stream_gb_fn = NULL;
+
+    XTS_SET_KEY_FN(hw_x86_64_sm4_set_key,
+                   hw_x86_64_sm4_set_key,
+                   hw_x86_64_sm4_encrypt,
+                   hw_x86_64_sm4_decrypt,
+                   stream_fn, stream_gb_fn);
+    return 1;
+}
+
+static const PROV_CIPHER_HW hw_x86_64_sm4_xts = {
+    hw_x86_64_sm4_xts_initkey,
+    NULL,
+    cipher_hw_sm4_xts_copyctx
+};
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_xts(size_t keybits)
+{
+    if (HWSM4_CAPABLE_X86_64)
+        return &hw_x86_64_sm4_xts;
+    else
+        return &sm4_generic_xts;
+}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes.h
index 7aa45326889..7f04b86a231 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,8 +7,13 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_TDES_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_TDES_H
+
 #include <openssl/des.h>
+#include <openssl/evp.h>
 #include <openssl/core_dispatch.h>
+#include "prov/ciphercommon.h"
 #include "prov/securitycheck.h"
 #include "crypto/des_platform.h"

@@ -60,7 +65,7 @@ typedef struct prov_tdes_ctx_st {
         { OSSL_FUNC_CIPHER_GET_PARAMS,                                             \
             (void (*)(void))tdes_##type##_##lcmode##_get_params },                 \
         { OSSL_FUNC_CIPHER_GETTABLE_PARAMS,                                        \
-            (void (*)(void))ossl_cipher_generic_gettable_params },                 \
+            (void (*)(void))ossl_tdes_gettable_params },                           \
         { OSSL_FUNC_CIPHER_GET_CTX_PARAMS,                                         \
             (void (*)(void))ossl_tdes_get_ctx_params },                            \
         { OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS,                                    \
@@ -82,6 +87,7 @@ OSSL_FUNC_cipher_freectx_fn ossl_tdes_freectx;
 OSSL_FUNC_cipher_encrypt_init_fn ossl_tdes_einit;
 OSSL_FUNC_cipher_decrypt_init_fn ossl_tdes_dinit;
 OSSL_FUNC_cipher_get_ctx_params_fn ossl_tdes_get_ctx_params;
+OSSL_FUNC_cipher_gettable_params_fn ossl_tdes_gettable_params;
 OSSL_FUNC_cipher_gettable_ctx_params_fn ossl_tdes_gettable_ctx_params;
 OSSL_FUNC_cipher_set_ctx_params_fn ossl_tdes_set_ctx_params;
 OSSL_FUNC_cipher_settable_ctx_params_fn ossl_tdes_settable_ctx_params;
@@ -108,3 +114,5 @@ int ossl_cipher_hw_tdes_ecb(PROV_CIPHER_CTX *ctx, unsigned char *out,

 const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede3_cbc(void);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede3_ecb(void);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_TDES_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes.inc.in
new file mode 100644
index 00000000000..a05efdd112c
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes.inc.in
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('tdes_get_params',
+                         (['OSSL_CIPHER_PARAM_MODE',             'common.mode',   'uint'],
+                          ['OSSL_CIPHER_PARAM_KEYLEN',           'common.keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',            'common.ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_BLOCK_SIZE',       'common.bsize',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_CUSTOM_IV',        'common.custiv', 'int'],
+                          ['OSSL_CIPHER_PARAM_HAS_RAND_KEY',     'common.rand',   'int'],
+                          ['OSSL_CIPHER_PARAM_DECRYPT_ONLY',     'decrypt',       'int'],
+                         )); -}
+
+{- produce_param_decoder('tdes_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',                 'common.keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',                  'common.ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_PADDING',                'common.pad',    'uint'],
+                          ['OSSL_CIPHER_PARAM_NUM',                    'common.num',    'uint'],
+                          ['OSSL_CIPHER_PARAM_IV',                     'common.iv',     'octet_string'],
+                          ['OSSL_CIPHER_PARAM_UPDATED_IV',             'common.updiv',  'octet_string'],
+                          ['OSSL_CIPHER_PARAM_TLS_MAC',                'common.tlsmac', 'octet_ptr'],
+                          ['OSSL_CIPHER_PARAM_RANDOM_KEY',             'rand',          'octet_string'],
+                          ['OSSL_CIPHER_PARAM_FIPS_APPROVED_INDICATOR', 'ind',          'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('tdes_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_PADDING',            'common.pad',        'uint'],
+                          ['OSSL_CIPHER_PARAM_NUM',                'common.num',        'uint'],
+                          ['OSSL_CIPHER_PARAM_USE_BITS',           'common.bits',       'uint'],
+                          ['OSSL_CIPHER_PARAM_TLS_VERSION',        'common.tlsvers',    'uint'],
+                          ['OSSL_CIPHER_PARAM_TLS_MAC_SIZE',       'common.tlsmacsize', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_FIPS_ENCRYPT_CHECK', 'ind',                'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes_common.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes_common.c
index 80c38d9d325..765ed5b8e7a 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes_common.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes_common.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,13 +20,38 @@
 #include "prov/implementations.h"
 #include "prov/providercommon.h"

+struct tdes_get_param_list_st {
+    struct ossl_cipher_get_param_list_st common;
+    OSSL_PARAM *decrypt;
+};
+
+struct tdes_get_ctx_param_list_st {
+    struct ossl_cipher_get_ctx_param_list_st common;
+    OSSL_PARAM *rand;
+#ifdef FIPS_MODULE
+    OSSL_PARAM *ind;
+#endif
+};
+
+struct tdes_set_ctx_param_list_st {
+    struct ossl_cipher_set_ctx_param_list_st common;
+#ifdef FIPS_MODULE
+    OSSL_PARAM *ind;
+#endif
+};
+
+#define tdes_get_params_st tdes_get_param_list_st
+#define tdes_get_ctx_params_st tdes_get_ctx_param_list_st
+#define tdes_set_ctx_params_st tdes_set_ctx_param_list_st
+
+#include "providers/implementations/ciphers/cipher_tdes.inc"
+
 void *ossl_tdes_newctx(void *provctx, int mode, size_t kbits, size_t blkbits,
     size_t ivbits, uint64_t flags, const PROV_CIPHER_HW *hw)
 {
     PROV_TDES_CTX *tctx;

-    if (!ossl_prov_is_running())
-        return NULL;
+    CIPHER_PROV_CHECK(provctx, DES_EDE3_ECB);

     tctx = OPENSSL_zalloc(sizeof(*tctx));
     if (tctx != NULL) {
@@ -66,7 +91,10 @@ void ossl_tdes_freectx(void *vctx)
 static int tdes_encrypt_check_approved(PROV_TDES_CTX *ctx, int enc)
 {
     /* Triple-DES encryption is not approved in FIPS 140-3 */
-    if (enc && !OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE0, ctx->base.libctx, "Triple-DES", "Encryption", ossl_fips_config_tdes_encrypt_disallowed))
+    if (enc
+        && !OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE0,
+            ctx->base.libctx, "Triple-DES", "Encryption",
+            FIPS_CONFIG_TDES_ENCRYPT_DISABLED))
         return 0;
     return 1;
 }
@@ -128,12 +156,7 @@ int ossl_tdes_dinit(void *vctx, const unsigned char *key, size_t keylen,
     return tdes_init(vctx, key, keylen, iv, ivlen, params, 0);
 }

-CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_START(ossl_tdes)
-OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_RANDOM_KEY, NULL, 0),
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_END(ossl_tdes)
-
-            static int tdes_generatekey(PROV_CIPHER_CTX *ctx, void *ptr)
+static int tdes_generatekey(PROV_CIPHER_CTX *ctx, void *ptr)
 {
     DES_cblock *deskey = ptr;
     size_t kl = ctx->keylen;
@@ -149,37 +172,54 @@ OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_RANDOM_KEY, NULL, 0),
     return 1;
 }

+const OSSL_PARAM *ossl_tdes_gettable_ctx_params(ossl_unused void *cctx,
+    ossl_unused void *provctx)
+{
+    return tdes_get_ctx_params_list;
+}
+
 int ossl_tdes_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
-    OSSL_PARAM *p;
+    struct tdes_get_ctx_param_list_st p;
+
+    if (ctx == NULL || !tdes_get_ctx_params_decoder(params, &p))
+        return 0;

-    if (!ossl_cipher_generic_get_ctx_params(vctx, params))
+    if (!ossl_cipher_common_get_ctx_params(ctx, &p.common))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_RANDOM_KEY);
-    if (p != NULL && !tdes_generatekey(ctx, p->data)) {
+    if (p.rand != NULL && !tdes_generatekey(ctx, p.rand->data)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GENERATE_KEY);
         return 0;
     }
-    if (!OSSL_FIPS_IND_GET_CTX_PARAM((PROV_TDES_CTX *)vctx, params))
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM((PROV_TDES_CTX *)vctx, p.ind))
         return 0;
     return 1;
 }

-CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_START(ossl_tdes)
-OSSL_PARAM_uint(OSSL_CIPHER_PARAM_PADDING, NULL),
-    OSSL_PARAM_uint(OSSL_CIPHER_PARAM_NUM, NULL),
-    OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_CIPHER_PARAM_FIPS_ENCRYPT_CHECK)
-        CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_END(ossl_tdes)
+const OSSL_PARAM *ossl_tdes_settable_ctx_params(ossl_unused void *cctx,
+    ossl_unused void *provctx)
+{
+    return tdes_set_ctx_params_list;
+}

-            int ossl_tdes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+int ossl_tdes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM((PROV_TDES_CTX *)vctx,
-            OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_CIPHER_PARAM_FIPS_ENCRYPT_CHECK))
+    PROV_TDES_CTX *ctx = (PROV_TDES_CTX *)vctx;
+    struct tdes_set_ctx_param_list_st p;
+
+    if (ctx == NULL || !tdes_set_ctx_params_decoder(params, &p))
         return 0;
-    return ossl_cipher_generic_set_ctx_params(vctx, params);
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, p.ind))
+        return 0;
+
+    return ossl_cipher_common_set_ctx_params(&ctx->base, &p.common);
+}
+
+const OSSL_PARAM *ossl_tdes_gettable_params(ossl_unused void *provctx)
+{
+    return tdes_get_params_list;
 }

 int ossl_tdes_get_params(OSSL_PARAM params[], unsigned int md, uint64_t flags,
@@ -190,14 +230,16 @@ int ossl_tdes_get_params(OSSL_PARAM params[], unsigned int md, uint64_t flags,
 #else
     const int decrypt_only = 0;
 #endif
-    OSSL_PARAM *p;
+    struct tdes_get_param_list_st p;
+
+    if (!tdes_get_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_DECRYPT_ONLY);
-    if (p != NULL && !OSSL_PARAM_set_int(p, decrypt_only)) {
+    if (p.decrypt != NULL && !OSSL_PARAM_set_int(p.decrypt, decrypt_only)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }

-    return ossl_cipher_generic_get_params(params, md, flags,
-        kbits, blkbits, ivbits);
+    return ossl_cipher_common_get_params(&p.common, md, flags, kbits, blkbits,
+        ivbits);
 }
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes_default.h b/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes_default.h
index dc8458b5daf..66e549fd789 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes_default.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes_default.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_TDES_DEFAULT_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_TDES_DEFAULT_H
+
 #include "prov/ciphercommon.h"
 #include "cipher_tdes.h"

@@ -23,3 +26,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede2_cfb(void);
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_desx_cbc(void);

 const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_wrap_cbc(void);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_TDES_DEFAULT_H) */
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes_wrap.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes_wrap.c
index 8fc053d0459..09f9776a7d0 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes_wrap.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_tdes_wrap.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -40,7 +40,7 @@ static int des_ede3_unwrap(PROV_CIPHER_CTX *ctx, unsigned char *out,
     if (inl < 24)
         return -1;
     if (out == NULL)
-        return inl - 16;
+        return (int)(inl - 16);

     memcpy(ctx->iv, wrap_iv, 8);
     /* Decrypt first block which will end up as icv */
@@ -66,7 +66,7 @@ static int des_ede3_unwrap(PROV_CIPHER_CTX *ctx, unsigned char *out,
     ctx->hw->cipher(ctx, icv, icv, 8);
     if (ossl_sha1(out, inl - 16, sha1tmp) /* Work out hash of first portion */
         && CRYPTO_memcmp(sha1tmp, icv, 8) == 0)
-        rv = inl - 16;
+        rv = (int)(inl - 16);
     OPENSSL_cleanse(icv, 8);
     OPENSSL_cleanse(sha1tmp, SHA_DIGEST_LENGTH);
     OPENSSL_cleanse(iv, 8);
@@ -85,8 +85,10 @@ static int des_ede3_wrap(PROV_CIPHER_CTX *ctx, unsigned char *out,
     size_t icvlen = TDES_IVLEN;
     size_t len = inl + ivlen + icvlen;

+    if (len > INT_MAX)
+        return 0;
     if (out == NULL)
-        return len;
+        return (int)len;

     /* Copy input to output buffer + 8 so we have space for IV */
     memmove(out + ivlen, in, inl);
@@ -104,7 +106,7 @@ static int des_ede3_wrap(PROV_CIPHER_CTX *ctx, unsigned char *out,
     BUF_reverse(out, NULL, len);
     memcpy(ctx->iv, wrap_iv, ivlen);
     ctx->hw->cipher(ctx, out, out, len);
-    return len;
+    return (int)len;
 }

 static int tdes_wrap_cipher_internal(PROV_CIPHER_CTX *ctx, unsigned char *out,
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon.c b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon.c
index 7f53cf6cdf9..889f7cb4174 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon.c
@@ -12,171 +12,132 @@
  */

 /* For SSL3_VERSION */
+#include <string.h>
 #include <openssl/prov_ssl.h>
 #include <openssl/proverr.h>
 #include "ciphercommon_local.h"
 #include "prov/provider_ctx.h"
 #include "prov/providercommon.h"
 #include "internal/skey.h"
+#include "internal/e_os.h"
 #include "crypto/types.h"
-#include "fips/fipsindicator.h"
+
+#define ossl_cipher_generic_get_params_st ossl_cipher_get_param_list_st
+#define cipher_generic_get_ctx_params_st ossl_cipher_get_ctx_param_list_st
+#define cipher_generic_set_ctx_params_st ossl_cipher_set_ctx_param_list_st
+#define cipher_var_keylen_set_ctx_params_st ossl_cipher_set_ctx_param_list_st
+
+#include "providers/implementations/ciphers/ciphercommon.inc"

 /*-
  * Generic cipher functions for OSSL_PARAM gettables and settables
  */
-static const OSSL_PARAM cipher_known_gettable_params[] = {
-    OSSL_PARAM_uint(OSSL_CIPHER_PARAM_MODE, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_IVLEN, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_BLOCK_SIZE, NULL),
-    OSSL_PARAM_int(OSSL_CIPHER_PARAM_AEAD, NULL),
-    OSSL_PARAM_int(OSSL_CIPHER_PARAM_CUSTOM_IV, NULL),
-    OSSL_PARAM_int(OSSL_CIPHER_PARAM_CTS, NULL),
-    OSSL_PARAM_int(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK, NULL),
-    OSSL_PARAM_int(OSSL_CIPHER_PARAM_HAS_RAND_KEY, NULL),
-    OSSL_PARAM_END
-};
+
 const OSSL_PARAM *ossl_cipher_generic_gettable_params(ossl_unused void *provctx)
 {
-    return cipher_known_gettable_params;
+    return ossl_cipher_generic_get_params_list;
 }

 int ossl_cipher_generic_get_params(OSSL_PARAM params[], unsigned int md,
     uint64_t flags,
     size_t kbits, size_t blkbits, size_t ivbits)
 {
-    OSSL_PARAM *p;
+    struct ossl_cipher_get_param_list_st p;
+
+    if (!ossl_cipher_generic_get_params_decoder(params, &p))
+        return 0;
+
+    return ossl_cipher_common_get_params(&p, md, flags, kbits, blkbits,
+        ivbits);
+}

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_MODE);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, md)) {
+int ossl_cipher_common_get_params(const struct ossl_cipher_get_param_list_st *p,
+    unsigned int md, uint64_t flags, size_t kbits, size_t blkbits,
+    size_t ivbits)
+{
+    if (p->mode != NULL && !OSSL_PARAM_set_uint(p->mode, md)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+        return 0;
+    }
+    if (p->aead != NULL
+        && !OSSL_PARAM_set_int(p->aead, (flags & PROV_CIPHER_FLAG_AEAD) != 0)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD);
-    if (p != NULL
-        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_AEAD) != 0)) {
+    if (p->custiv != NULL
+        && !OSSL_PARAM_set_int(p->custiv,
+            (flags & PROV_CIPHER_FLAG_CUSTOM_IV) != 0)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_CUSTOM_IV);
-    if (p != NULL
-        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_CUSTOM_IV) != 0)) {
+    if (p->cts != NULL
+        && !OSSL_PARAM_set_int(p->cts, (flags & PROV_CIPHER_FLAG_CTS) != 0)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_CTS);
-    if (p != NULL
-        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_CTS) != 0)) {
+    if (p->mb != NULL
+        && !OSSL_PARAM_set_int(p->mb,
+            (flags & PROV_CIPHER_FLAG_TLS1_MULTIBLOCK) != 0)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK);
-    if (p != NULL
-        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_TLS1_MULTIBLOCK) != 0)) {
+    if (p->rand != NULL
+        && !OSSL_PARAM_set_int(p->rand,
+            (flags & PROV_CIPHER_FLAG_RAND_KEY) != 0)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_HAS_RAND_KEY);
-    if (p != NULL
-        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_RAND_KEY) != 0)) {
+    if (p->etm != NULL
+        && !OSSL_PARAM_set_int(p->etm,
+            (flags & EVP_CIPH_FLAG_ENC_THEN_MAC) != 0)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, kbits / 8)) {
+    if (p->keylen != NULL
+        && !OSSL_PARAM_set_size_t(p->keylen, kbits / 8)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_BLOCK_SIZE);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, blkbits / 8)) {
+    if (p->bsize != NULL
+        && !OSSL_PARAM_set_size_t(p->bsize, blkbits / 8)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ivbits / 8)) {
+    if (p->ivlen != NULL
+        && !OSSL_PARAM_set_size_t(p->ivlen, ivbits / 8)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
     return 1;
 }

-CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_START(ossl_cipher_generic) { OSSL_CIPHER_PARAM_TLS_MAC, OSSL_PARAM_OCTET_PTR, NULL, 0, OSSL_PARAM_UNMODIFIED },
-    CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_END(ossl_cipher_generic)
-
-        CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_START(ossl_cipher_generic)
-            OSSL_PARAM_uint(OSSL_CIPHER_PARAM_USE_BITS, NULL),
-    OSSL_PARAM_uint(OSSL_CIPHER_PARAM_TLS_VERSION, NULL),
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_TLS_MAC_SIZE, NULL),
-    CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_END(ossl_cipher_generic)
-
-    /*
-     * Variable key length cipher functions for OSSL_PARAM settables
-     */
-    int ossl_cipher_var_keylen_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+const OSSL_PARAM *ossl_cipher_generic_gettable_ctx_params(ossl_unused void *cctx, ossl_unused void *provctx)
 {
-    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
-    const OSSL_PARAM *p;
-
-    if (ossl_param_is_empty(params))
-        return 1;
-
-    if (!ossl_cipher_generic_set_ctx_params(vctx, params))
-        return 0;
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL) {
-        size_t keylen;
+    return cipher_generic_get_ctx_params_list;
+}

-        if (!OSSL_PARAM_get_size_t(p, &keylen)) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
-            return 0;
-        }
-        if (ctx->keylen != keylen) {
-            ctx->keylen = keylen;
-            ctx->key_set = 0;
-        }
-    }
-    return 1;
+const OSSL_PARAM *ossl_cipher_generic_settable_ctx_params(ossl_unused void *cctx, ossl_unused void *provctx)
+{
+    return cipher_generic_set_ctx_params_list;
 }

-CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_START(ossl_cipher_var_keylen)
-OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-    CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_END(ossl_cipher_var_keylen)
+/*
+ * Variable key length cipher functions for OSSL_PARAM settables
+ */

-    /*-
-     * AEAD cipher functions for OSSL_PARAM gettables and settables
-     */
-    static const OSSL_PARAM cipher_aead_known_gettable_ctx_params[]
-    = {
-          OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),
-          OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_IVLEN, NULL),
-          OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_AEAD_TAGLEN, NULL),
-          OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_IV, NULL, 0),
-          OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_UPDATED_IV, NULL, 0),
-          OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TAG, NULL, 0),
-          OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD, NULL),
-          OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN, NULL, 0),
-          OSSL_PARAM_uint(OSSL_CIPHER_PARAM_AEAD_IV_GENERATED, NULL),
-          OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-              OSSL_PARAM_END
-      };
-const OSSL_PARAM *ossl_cipher_aead_gettable_ctx_params(
-    ossl_unused void *cctx, ossl_unused void *provctx)
+const OSSL_PARAM *ossl_cipher_var_keylen_settable_ctx_params(ossl_unused void *cctx, ossl_unused void *provctx)
 {
-    return cipher_aead_known_gettable_ctx_params;
+    return cipher_var_keylen_set_ctx_params_list;
 }

-static const OSSL_PARAM cipher_aead_known_settable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_AEAD_IVLEN, NULL),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TAG, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TLS1_AAD, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV, NULL, 0),
-    OSSL_PARAM_END
-};
-const OSSL_PARAM *ossl_cipher_aead_settable_ctx_params(
-    ossl_unused void *cctx, ossl_unused void *provctx)
+int ossl_cipher_var_keylen_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    return cipher_aead_known_settable_ctx_params;
+    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
+    struct ossl_cipher_set_ctx_param_list_st p;
+
+    if (ctx == NULL || !cipher_var_keylen_set_ctx_params_decoder(params, &p))
+        return 0;
+    return ossl_cipher_common_set_ctx_params(ctx, &p);
 }

 void ossl_cipher_generic_reset_ctx(PROV_CIPHER_CTX *ctx)
@@ -188,6 +149,25 @@ void ossl_cipher_generic_reset_ctx(PROV_CIPHER_CTX *ctx)
     }
 }

+/*
+ * Deep-copy the tlsmac buffer after a shallow dupctx copy.
+ * Must be called after OPENSSL_memdup or *dctx = *sctx to avoid
+ * double-free when both contexts are freed.
+ * Returns 1 on success, 0 on allocation failure.
+ */
+int ossl_cipher_generic_dupctx_tlsmac(PROV_CIPHER_CTX *dst,
+    const PROV_CIPHER_CTX *src)
+{
+    if (src->tlsmac != NULL && src->alloced) {
+        dst->tlsmac = OPENSSL_memdup(src->tlsmac, src->tlsmacsize);
+        if (dst->tlsmac == NULL) {
+            dst->alloced = 0;
+            return 0;
+        }
+    }
+    return 1;
+}
+
 static int cipher_generic_init_internal(PROV_CIPHER_CTX *ctx,
     const unsigned char *key, size_t keylen,
     const unsigned char *iv, size_t ivlen,
@@ -316,15 +296,9 @@ int ossl_cipher_generic_block_update(void *vctx, unsigned char *out,
                 return 0;
             }
             padval = (unsigned char)(padnum - 1);
-            if (ctx->tlsversion == SSL3_VERSION) {
-                if (padnum > 1)
-                    memset(out + inl, 0, padnum - 1);
-                *(out + inl + padnum - 1) = padval;
-            } else {
-                /* we need to add 'padnum' padding bytes of value padval */
-                for (loop = inl; loop < inl + padnum; loop++)
-                    out[loop] = padval;
-            }
+            /* we need to add 'padnum' padding bytes of value padval */
+            for (loop = inl; loop < inl + padnum; loop++)
+                out[loop] = padval;
             inl += padnum;
         }

@@ -595,101 +569,98 @@ int ossl_cipher_generic_cipher(void *vctx, unsigned char *out, size_t *outl,
     return 1;
 }

-int ossl_cipher_generic_get_ctx_params(void *vctx, OSSL_PARAM params[])
+int ossl_cipher_common_get_ctx_params(PROV_CIPHER_CTX *ctx, const struct ossl_cipher_get_ctx_param_list_st *p)
 {
-    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
-    OSSL_PARAM *p;
-
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->ivlen)) {
+    if (p->ivlen != NULL && !OSSL_PARAM_set_size_t(p->ivlen, ctx->ivlen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_PADDING);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->pad)) {
+
+    if (p->pad != NULL && !OSSL_PARAM_set_uint(p->pad, ctx->pad)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IV);
-    if (p != NULL
-        && !OSSL_PARAM_set_octet_ptr(p, &ctx->oiv, ctx->ivlen)
-        && !OSSL_PARAM_set_octet_string(p, &ctx->oiv, ctx->ivlen)) {
+
+    if (p->iv != NULL
+        && !OSSL_PARAM_set_octet_string_or_ptr(p->iv, ctx->oiv, ctx->ivlen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_UPDATED_IV);
-    if (p != NULL
-        && !OSSL_PARAM_set_octet_ptr(p, &ctx->iv, ctx->ivlen)
-        && !OSSL_PARAM_set_octet_string(p, &ctx->iv, ctx->ivlen)) {
+
+    if (p->updiv != NULL
+        && !OSSL_PARAM_set_octet_string_or_ptr(p->updiv, ctx->iv, ctx->ivlen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_NUM);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->num)) {
+
+    if (p->num != NULL && !OSSL_PARAM_set_uint(p->num, ctx->num)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->keylen)) {
+
+    if (p->keylen != NULL && !OSSL_PARAM_set_size_t(p->keylen, ctx->keylen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS_MAC);
-    if (p != NULL
-        && !OSSL_PARAM_set_octet_ptr(p, ctx->tlsmac, ctx->tlsmacsize)) {
+
+    if (p->tlsmac != NULL
+        && !OSSL_PARAM_set_octet_ptr(p->tlsmac, ctx->tlsmac, ctx->tlsmacsize)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    return OSSL_FIPS_IND_GET_CTX_PARAM_APPROVED(ctx, params);
+    return 1;
 }

-int ossl_cipher_generic_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+int ossl_cipher_generic_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct ossl_cipher_get_ctx_param_list_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !cipher_generic_get_ctx_params_decoder(params, &p))
+        return 0;
+    return ossl_cipher_common_get_ctx_params(ctx, &p);
+}

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_PADDING);
-    if (p != NULL) {
+int ossl_cipher_common_set_ctx_params(PROV_CIPHER_CTX *ctx, const struct ossl_cipher_set_ctx_param_list_st *p)
+{
+    if (p->pad != NULL) {
         unsigned int pad;

-        if (!OSSL_PARAM_get_uint(p, &pad)) {
+        if (!OSSL_PARAM_get_uint(p->pad, &pad)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
         ctx->pad = pad ? 1 : 0;
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_USE_BITS);
-    if (p != NULL) {
+
+    if (p->bits != NULL) {
         unsigned int bits;

-        if (!OSSL_PARAM_get_uint(p, &bits)) {
+        if (!OSSL_PARAM_get_uint(p->bits, &bits)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
         ctx->use_bits = bits ? 1 : 0;
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_VERSION);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_uint(p, &ctx->tlsversion)) {
+
+    if (p->tlsvers != NULL) {
+        if (!OSSL_PARAM_get_uint(p->tlsvers, &ctx->tlsversion)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_MAC_SIZE);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &ctx->tlsmacsize)) {
+
+    if (p->tlsmacsize != NULL) {
+        if (!OSSL_PARAM_get_size_t(p->tlsmacsize, &ctx->tlsmacsize)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_NUM);
-    if (p != NULL) {
+
+    if (p->num != NULL) {
         unsigned int num;

-        if (!OSSL_PARAM_get_uint(p, &num)) {
+        if (!OSSL_PARAM_get_uint(p->num, &num)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -699,9 +670,35 @@ int ossl_cipher_generic_set_ctx_params(void *vctx, const OSSL_PARAM params[])
         }
         ctx->num = num;
     }
+
+    if (p->keylen != NULL) {
+        size_t keylen;
+
+        if (!OSSL_PARAM_get_size_t(p->keylen, &keylen)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
+        }
+        if (ctx->keylen != keylen) {
+            ctx->keylen = keylen;
+            ctx->key_set = 0;
+        }
+    }
     return 1;
 }

+int ossl_cipher_generic_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+{
+    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
+    struct ossl_cipher_set_ctx_param_list_st p;
+
+    if (ossl_param_is_empty(params))
+        return 1;
+
+    if (ctx == NULL || !cipher_generic_set_ctx_params_decoder(params, &p))
+        return 0;
+    return ossl_cipher_common_set_ctx_params(ctx, &p);
+}
+
 int ossl_cipher_generic_initiv(PROV_CIPHER_CTX *ctx, const unsigned char *iv,
     size_t ivlen)
 {
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon.inc.in
new file mode 100644
index 00000000000..1c4ce5a44ac
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon.inc.in
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ossl_cipher_generic_get_params',
+                         (['OSSL_CIPHER_PARAM_MODE',             'mode',   'uint'],
+                          ['OSSL_CIPHER_PARAM_KEYLEN',           'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',            'ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_BLOCK_SIZE',       'bsize',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD',             'aead',   'int' ],
+                          ['OSSL_CIPHER_PARAM_CUSTOM_IV',        'custiv', 'int' ],
+                          ['OSSL_CIPHER_PARAM_CTS',              'cts',    'int' ],
+                          ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK',  'mb',     'int' ],
+                          ['OSSL_CIPHER_PARAM_HAS_RAND_KEY',     'rand',   'int' ],
+                          ['OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC', 'etm',    'int' ],
+                         )); -}
+
+{- produce_param_decoder('cipher_generic_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',     'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',      'ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_PADDING',    'pad',    'uint'],
+                          ['OSSL_CIPHER_PARAM_NUM',        'num',    'uint' ],
+                          ['OSSL_CIPHER_PARAM_IV',         'iv',     'octet_string' ],
+                          ['OSSL_CIPHER_PARAM_UPDATED_IV', 'updiv',  'octet_string' ],
+                          ['OSSL_CIPHER_PARAM_TLS_MAC',    'tlsmac', 'octet_ptr' ],
+                          ['OSSL_CIPHER_PARAM_FIPS_APPROVED_INDICATOR',
+                           'fips indicator', 'int'],
+                         )); -}
+
+{- produce_param_decoder('cipher_generic_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_PADDING',      'pad',         'uint'],
+                          ['OSSL_CIPHER_PARAM_NUM',          'num',         'uint'],
+                          ['OSSL_CIPHER_PARAM_USE_BITS',     'bits',        'uint'],
+                          ['OSSL_CIPHER_PARAM_TLS_VERSION',  'tlsvers',     'uint'],
+                          ['OSSL_CIPHER_PARAM_TLS_MAC_SIZE', 'tlsmacsize',  'size_t'],
+                         )); -}
+
+{- produce_param_decoder('cipher_var_keylen_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_PADDING',      'pad',         'uint'],
+                          ['OSSL_CIPHER_PARAM_NUM',          'num',         'uint'],
+                          ['OSSL_CIPHER_PARAM_USE_BITS',     'bits',        'uint'],
+                          ['OSSL_CIPHER_PARAM_TLS_VERSION',  'tlsvers',     'uint'],
+                          ['OSSL_CIPHER_PARAM_TLS_MAC_SIZE', 'tlsmacsize',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_KEYLEN',       'keylen',      'size_t'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_block.c b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_block.c
index 634bae4c1c1..9c44c332f08 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_block.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_block.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -123,7 +123,7 @@ int ossl_cipher_unpadblock(unsigned char *buf, size_t *buflen, size_t blocksize)
  * time.
  *
  * libctx: Our library context
- * tlsversion: The TLS version in use, e.g. SSL3_VERSION, TLS1_VERSION, etc
+ * tlsversion: The TLS version in use, e.g. TLS1_VERSION, etc
  * buf: The decrypted TLS record data
  * buflen: The length of the decrypted TLS record data. Updated with the new
  *         length after the padding is removed
@@ -147,11 +147,6 @@ int ossl_cipher_tlsunpadblock(OSSL_LIB_CTX *libctx, unsigned int tlsversion,
     int ret;

     switch (tlsversion) {
-    case SSL3_VERSION:
-        return ssl3_cbc_remove_padding_and_mac(buflen, *buflen, buf, mac,
-            alloced, blocksize, macsize,
-            libctx);
-
     case TLS1_2_VERSION:
     case DTLS1_2_VERSION:
     case TLS1_1_VERSION:
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_ccm.c b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_ccm.c
index 8f5839afd20..70e16aee0a8 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_ccm.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_ccm.c
@@ -13,7 +13,8 @@
 #include "prov/ciphercommon.h"
 #include "prov/ciphercommon_ccm.h"
 #include "prov/providercommon.h"
-#include "fips/fipsindicator.h"
+
+#include "providers/implementations/ciphers/ciphercommon_ccm.inc"

 static int ccm_cipher_internal(PROV_CCM_CTX *ctx, unsigned char *out,
     size_t *padlen, const unsigned char *in,
@@ -47,7 +48,7 @@ static int ccm_tls_init(PROV_CCM_CTX *ctx, unsigned char *aad, size_t alen)
     ctx->buf[alen - 1] = (unsigned char)(len & 0xff);

     /* Extra padding: tag appended to record. */
-    return ctx->m;
+    return (int)ctx->m;
 }

 static int ccm_tls_iv_set_fixed(PROV_CCM_CTX *ctx, unsigned char *fixed,
@@ -66,42 +67,44 @@ static size_t ccm_get_ivlen(PROV_CCM_CTX *ctx)
     return 15 - ctx->l;
 }

+const OSSL_PARAM *ossl_ccm_settable_ctx_params(
+    ossl_unused void *cctx, ossl_unused void *provctx)
+{
+    return ossl_cipher_ccm_set_ctx_params_list;
+}
+
 int ossl_ccm_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_CCM_CTX *ctx = (PROV_CCM_CTX *)vctx;
-    const OSSL_PARAM *p;
-    size_t sz;
+    size_t sz, ivlen;
+    struct ossl_cipher_ccm_set_ctx_params_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !ossl_cipher_ccm_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_TAG);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+    if (p.tag != NULL) {
+        if (p.tag->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        if ((p->data_size & 1) || (p->data_size < 4) || p->data_size > 16) {
+        if ((p.tag->data_size & 1) || (p.tag->data_size < 4) || p.tag->data_size > 16) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG_LENGTH);
             return 0;
         }

-        if (p->data != NULL) {
+        if (p.tag->data != NULL) {
             if (ctx->enc) {
                 ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_NEEDED);
                 return 0;
             }
-            memcpy(ctx->buf, p->data, p->data_size);
+            memcpy(ctx->buf, p.tag->data, p.tag->data_size);
             ctx->tag_set = 1;
         }
-        ctx->m = p->data_size;
+        ctx->m = p.tag->data_size;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_IVLEN);
-    if (p != NULL) {
-        size_t ivlen;
-
-        if (!OSSL_PARAM_get_size_t(p, &sz)) {
+    if (p.ivlen != NULL) {
+        if (!OSSL_PARAM_get_size_t(p.ivlen, &sz)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
@@ -116,13 +119,12 @@ int ossl_ccm_set_ctx_params(void *vctx, const OSSL_PARAM params[])
         }
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_TLS1_AAD);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+    if (p.aad != NULL) {
+        if (p.aad->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        sz = ccm_tls_init(ctx, p->data, p->data_size);
+        sz = ccm_tls_init(ctx, p.aad->data, p.aad->data_size);
         if (sz == 0) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DATA);
             return 0;
@@ -130,97 +132,92 @@ int ossl_ccm_set_ctx_params(void *vctx, const OSSL_PARAM params[])
         ctx->tls_aad_pad_sz = sz;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+    if (p.fixed != NULL) {
+        if (p.fixed->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
             return 0;
         }
-        if (ccm_tls_iv_set_fixed(ctx, p->data, p->data_size) == 0) {
+        if (ccm_tls_iv_set_fixed(ctx, p.fixed->data, p.fixed->data_size) == 0) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
             return 0;
         }
     }
-
     return 1;
 }

+const OSSL_PARAM *ossl_ccm_gettable_ctx_params(
+    ossl_unused void *cctx, ossl_unused void *provctx)
+{
+    return ossl_cipher_ccm_get_ctx_params_list;
+}
+
 int ossl_ccm_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_CCM_CTX *ctx = (PROV_CCM_CTX *)vctx;
-    OSSL_PARAM *p;
+    struct ossl_cipher_ccm_get_ctx_params_st p;

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ccm_get_ivlen(ctx))) {
+    if (ctx == NULL || !ossl_cipher_ccm_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.ivlen != NULL && !OSSL_PARAM_set_size_t(p.ivlen, ccm_get_ivlen(ctx))) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD_TAGLEN);
-    if (p != NULL) {
-        size_t m = ctx->m;
-
-        if (!OSSL_PARAM_set_size_t(p, m)) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
-            return 0;
-        }
+    if (p.taglen != NULL && !OSSL_PARAM_set_size_t(p.taglen, ctx->m)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+        return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IV);
-    if (p != NULL) {
-        if (ccm_get_ivlen(ctx) > p->data_size) {
+    if (p.iv != NULL) {
+        if (ccm_get_ivlen(ctx) > p.iv->data_size) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
             return 0;
         }
-        if (!OSSL_PARAM_set_octet_string(p, ctx->iv, p->data_size)
-            && !OSSL_PARAM_set_octet_ptr(p, &ctx->iv, p->data_size)) {
+        if (!OSSL_PARAM_set_octet_string_or_ptr(p.iv, ctx->iv, p.iv->data_size)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
             return 0;
         }
     }

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_UPDATED_IV);
-    if (p != NULL) {
-        if (ccm_get_ivlen(ctx) > p->data_size) {
+    if (p.updiv != NULL) {
+        if (ccm_get_ivlen(ctx) > p.updiv->data_size) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
             return 0;
         }
-        if (!OSSL_PARAM_set_octet_string(p, ctx->iv, p->data_size)
-            && !OSSL_PARAM_set_octet_ptr(p, &ctx->iv, p->data_size)) {
+        if (!OSSL_PARAM_set_octet_string_or_ptr(p.updiv, ctx->iv, p.updiv->data_size)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
             return 0;
         }
     }

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->keylen)) {
+    if (p.keylen != NULL && !OSSL_PARAM_set_size_t(p.keylen, ctx->keylen)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->tls_aad_pad_sz)) {
+    if (p.pad != NULL && !OSSL_PARAM_set_size_t(p.pad, ctx->tls_aad_pad_sz)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD_TAG);
-    if (p != NULL) {
+    if (p.tag != NULL) {
         if (!ctx->enc || !ctx->tag_set) {
             ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_SET);
             return 0;
         }
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+        if (p.tag->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
             return 0;
         }
-        if (!ctx->hw->gettag(ctx, p->data, p->data_size))
+        if (!ctx->hw->gettag(ctx, p.tag->data, p.tag->data_size))
             return 0;
         ctx->tag_set = 0;
         ctx->iv_set = 0;
         ctx->len_set = 0;
     }
-    return OSSL_FIPS_IND_GET_CTX_PARAM_APPROVED(ctx, params);
+
+    return 1;
 }

 static int ccm_init(void *vctx, const unsigned char *key, size_t keylen,
@@ -433,8 +430,10 @@ static int ccm_cipher_internal(PROV_CCM_CTX *ctx, unsigned char *out,
             ctx->tag_set = 1;
         } else {
             /* The tag must be set before actually decrypting data */
-            if (!ctx->tag_set)
+            if (!ctx->tag_set) {
+                ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_SET);
                 goto err;
+            }

             if (!hw->auth_decrypt(ctx, in, out, len, ctx->buf, ctx->m))
                 goto err;
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_ccm.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_ccm.inc.in
new file mode 100644
index 00000000000..7b1f2d7865b
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_ccm.inc.in
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ossl_cipher_ccm_set_ctx_params',
+                         (['OSSL_CIPHER_PARAM_AEAD_IVLEN',           'ivlen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAG',             'tag',   'octet_string'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD',        'aad',   'octet_string'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED',   'fixed', 'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('ossl_cipher_ccm_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',               'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',                'ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAGLEN',          'taglen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IV',                   'iv',     'octet_string'],
+                          ['OSSL_CIPHER_PARAM_UPDATED_IV',           'updiv',  'octet_string'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAG',             'tag',    'octet_string'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD',    'pad',    'size_t'],
+                          ['OSSL_CIPHER_PARAM_FIPS_APPROVED_INDICATOR',
+                           'fips indicator', 'int'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_gcm.c b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_gcm.c
index 3bc45c2f962..a0068066d45 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_gcm.c
+++ b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_gcm.c
@@ -15,9 +15,10 @@
 #include "prov/ciphercommon_gcm.h"
 #include "prov/providercommon.h"
 #include "prov/provider_ctx.h"
-#include "internal/param_names.h"
 #include "fips/fipsindicator.h"

+#include "providers/implementations/ciphers/ciphercommon_gcm.inc"
+
 static int gcm_tls_init(PROV_GCM_CTX *dat, unsigned char *aad, size_t aad_len);
 static int gcm_tls_iv_set_fixed(PROV_GCM_CTX *ctx, unsigned char *iv,
     size_t len);
@@ -26,6 +27,7 @@ static int gcm_tls_cipher(PROV_GCM_CTX *ctx, unsigned char *out, size_t *padlen,
 static int gcm_cipher_internal(PROV_GCM_CTX *ctx, unsigned char *out,
     size_t *padlen, const unsigned char *in,
     size_t len);
+static int on_preupdate_generate_iv(PROV_GCM_CTX *ctx);

 #ifdef FIPS_MODULE
 static int gcm_fips_taglen_approved(size_t taglen)
@@ -71,6 +73,7 @@ static int gcm_init(void *vctx, const unsigned char *key, size_t keylen,
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
             return 0;
         }
+        ctx->iv_gen_rand = 0;
         ctx->ivlen = ivlen;
         memcpy(ctx->iv, iv, ivlen);
         ctx->iv_state = IV_STATE_BUFFERED;
@@ -150,193 +153,199 @@ static int setivinv(PROV_GCM_CTX *ctx, unsigned char *in, size_t inl)
     return 1;
 }

+const OSSL_PARAM *ossl_gcm_gettable_ctx_params(
+    ossl_unused void *cctx, ossl_unused void *provctx)
+{
+    return ossl_cipher_gcm_get_ctx_params_list;
+}
+
 int ossl_gcm_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_GCM_CTX *ctx = (PROV_GCM_CTX *)vctx;
-    OSSL_PARAM *p;
     size_t sz;
-    int type;
+    struct ossl_cipher_gcm_get_ctx_params_st p;

-    for (p = params; p->key != NULL; p++) {
-        type = ossl_param_find_pidx(p->key);
-        switch (type) {
-        default:
-            break;
+    if (ctx == NULL || !ossl_cipher_gcm_get_ctx_params_decoder(params, &p))
+        return 0;

-        case PIDX_CIPHER_PARAM_IVLEN:
-            if (!OSSL_PARAM_set_size_t(p, ctx->ivlen)) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
-                return 0;
-            }
-            break;
+    if (p.ivlen != NULL && !OSSL_PARAM_set_size_t(p.ivlen, ctx->ivlen)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+        return 0;
+    }

-        case PIDX_CIPHER_PARAM_KEYLEN:
-            if (!OSSL_PARAM_set_size_t(p, ctx->keylen)) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
-                return 0;
-            }
-            break;
+    if (p.keylen != NULL && !OSSL_PARAM_set_size_t(p.keylen, ctx->keylen)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+        return 0;
+    }

-        case PIDX_CIPHER_PARAM_AEAD_TAGLEN: {
-            size_t taglen = (ctx->taglen != UNINITIALISED_SIZET) ? ctx->taglen : GCM_TAG_MAX_SIZE;
+    if (p.taglen != NULL) {
+        size_t taglen = (ctx->taglen != UNINITIALISED_SIZET) ? ctx->taglen : GCM_TAG_MAX_SIZE;

-            if (!OSSL_PARAM_set_size_t(p, taglen)) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
-                return 0;
-            }
-        } break;
+        if (!OSSL_PARAM_set_size_t(p.taglen, taglen)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+            return 0;
+        }
+    }

-        case PIDX_CIPHER_PARAM_IV:
-            if (ctx->iv_state == IV_STATE_UNINITIALISED)
-                return 0;
-            if (ctx->ivlen > p->data_size) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
-                return 0;
-            }
-            if (!OSSL_PARAM_set_octet_string(p, ctx->iv, ctx->ivlen)
-                && !OSSL_PARAM_set_octet_ptr(p, &ctx->iv, ctx->ivlen)) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
-                return 0;
-            }
-            break;
+    /*
+     * Note p.updiv and p.iv are aliases that get the same information,
+     * so any code changes should be duplicated below.
+     */
+    if (p.iv != NULL) {
+        if (!on_preupdate_generate_iv(ctx))
+            return 0;
+        if (p.iv->data != NULL && ctx->ivlen > p.iv->data_size) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
+            return 0;
+        }
+        if (!OSSL_PARAM_set_octet_string_or_ptr(p.iv, ctx->iv, ctx->ivlen)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+            return 0;
+        }
+    }
+    if (p.updiv != NULL) {
+        if (!on_preupdate_generate_iv(ctx))
+            return 0;
+        if (p.updiv->data != NULL && ctx->ivlen > p.updiv->data_size) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
+            return 0;
+        }
+        if (!OSSL_PARAM_set_octet_string_or_ptr(p.updiv, ctx->iv, ctx->ivlen)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+            return 0;
+        }
+    }

-        case PIDX_CIPHER_PARAM_UPDATED_IV:
-            if (ctx->iv_state == IV_STATE_UNINITIALISED)
-                return 0;
-            if (ctx->ivlen > p->data_size) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
-                return 0;
-            }
-            if (!OSSL_PARAM_set_octet_string(p, ctx->iv, ctx->ivlen)
-                && !OSSL_PARAM_set_octet_ptr(p, &ctx->iv, ctx->ivlen)) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
-                return 0;
-            }
-            break;
+    if (p.pad != NULL && !OSSL_PARAM_set_size_t(p.pad, ctx->tls_aad_pad_sz)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+        return 0;
+    }

-        case PIDX_CIPHER_PARAM_AEAD_TLS1_AAD_PAD:
-            if (!OSSL_PARAM_set_size_t(p, ctx->tls_aad_pad_sz)) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
-                return 0;
-            }
-            break;
-
-        case PIDX_CIPHER_PARAM_AEAD_TAG:
-            sz = p->data_size;
-            if (sz == 0
-                || sz > EVP_GCM_TLS_TAG_LEN
-                || !ctx->enc
-                || ctx->taglen == UNINITIALISED_SIZET) {
+    if (p.tag != NULL) {
+        if (!ctx->enc || ctx->taglen == UNINITIALISED_SIZET) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_SET);
+            return 0;
+        }
+        if (p.tag->data == NULL) {
+            /* size query: report the tag length, as for the iv above */
+            sz = ctx->taglen;
+        } else {
+            sz = p.tag->data_size;
+            if (sz > EVP_GCM_TLS_TAG_LEN || sz == 0) {
                 ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG);
                 return 0;
             }
-            if (!OSSL_PARAM_set_octet_string(p, ctx->buf, sz)) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
-                return 0;
-            }
-            break;
+        }

-        case PIDX_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN:
-            if (p->data == NULL
-                || p->data_type != OSSL_PARAM_OCTET_STRING
-                || !getivgen(ctx, p->data, p->data_size))
-                return 0;
-            break;
-        case PIDX_CIPHER_PARAM_AEAD_IV_GENERATED:
-            if (!OSSL_PARAM_set_uint(p, ctx->iv_gen_rand))
-                return 0;
+        if (!OSSL_PARAM_set_octet_string(p.tag, ctx->buf, sz)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
+            return 0;
         }
     }
-#ifdef FIPS_MODULE
-    /* Externally supplied IVs are permitted but not approved for encryption. */
-    return ossl_FIPS_IND_get_ctx_param_conditional(NULL, params,
-        (!ctx->enc || ctx->iv_gen_rand)
-            && gcm_fips_taglen_approved(ctx->taglen));
-#else
+
+    if (p.ivgen != NULL)
+        if (p.ivgen->data == NULL
+            || p.ivgen->data_type != OSSL_PARAM_OCTET_STRING
+            || !getivgen(ctx, p.ivgen->data, p.ivgen->data_size))
+            return 0;
+
+    if (p.gen != NULL && !OSSL_PARAM_set_uint(p.gen, ctx->iv_gen_rand))
+        return 0;
+
+    /*
+     * Externally supplied IVs are permitted but not approved for encryption.
+     * Approved tag lengths are 4, 8, and 12 through 16 bytes.
+     * For encryption, requesting only a prefix of the generated tag does not
+     * change the tag length used by the operation.
+     */
+    if (!OSSL_FIPS_IND_GET_PARAM_CONDITIONAL(p.ind,
+            (!ctx->enc || ctx->iv_gen_rand)
+                && gcm_fips_taglen_approved(ctx->taglen)))
+        return 0;
+
     return 1;
-#endif
+}
+
+const OSSL_PARAM *ossl_gcm_settable_ctx_params(
+    ossl_unused void *cctx, ossl_unused void *provctx)
+{
+    return ossl_cipher_gcm_set_ctx_params_list;
 }

 int ossl_gcm_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_GCM_CTX *ctx = (PROV_GCM_CTX *)vctx;
-    const OSSL_PARAM *p;
     size_t sz;
     void *vp;
-    int type;
-
-    if (ossl_param_is_empty(params))
-        return 1;
-
-    for (p = params; p->key != NULL; p++) {
-        type = ossl_param_find_pidx(p->key);
-        switch (type) {
-        default:
-            break;
+    struct ossl_cipher_gcm_set_ctx_params_st p;

-        case PIDX_CIPHER_PARAM_AEAD_TAG:
-            vp = ctx->buf;
-            if (!OSSL_PARAM_get_octet_string(p, &vp, EVP_GCM_TLS_TAG_LEN, &sz)) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
-                return 0;
-            }
-            if (sz == 0 || ctx->enc) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG);
-                return 0;
-            }
-            ctx->taglen = sz;
-            break;
+    if (ctx == NULL || !ossl_cipher_gcm_set_ctx_params_decoder(params, &p))
+        return 0;

-        case PIDX_CIPHER_PARAM_AEAD_IVLEN:
-            if (!OSSL_PARAM_get_size_t(p, &sz)) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
-                return 0;
-            }
-            if (sz == 0 || sz > sizeof(ctx->iv)) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
-                return 0;
-            }
-            if (ctx->ivlen != sz) {
-                /* If the iv was already set or autogenerated, it is invalid. */
-                if (ctx->iv_state != IV_STATE_UNINITIALISED)
-                    ctx->iv_state = IV_STATE_FINISHED;
-                ctx->ivlen = sz;
-            }
-            break;
+    if (p.tag != NULL) {
+        vp = ctx->buf;
+        if (!OSSL_PARAM_get_octet_string(p.tag, &vp, EVP_GCM_TLS_TAG_LEN, &sz)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
+        }
+        if (ctx->enc) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_NEEDED);
+            return 0;
+        }
+        if (sz == 0) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG);
+            return 0;
+        }
+        ctx->taglen = sz;
+    }

-        case PIDX_CIPHER_PARAM_AEAD_TLS1_AAD:
-            if (p->data_type != OSSL_PARAM_OCTET_STRING) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
-                return 0;
-            }
-            sz = gcm_tls_init(ctx, p->data, p->data_size);
-            if (sz == 0) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_AAD);
-                return 0;
-            }
-            ctx->tls_aad_pad_sz = sz;
-            break;
+    if (p.ivlen != NULL) {
+        if (!OSSL_PARAM_get_size_t(p.ivlen, &sz)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
+        }
+        if (sz == 0 || sz > sizeof(ctx->iv)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
+            return 0;
+        }
+        if (ctx->ivlen != sz) {
+            /* If the iv was already set or autogenerated, it is invalid. */
+            if (ctx->iv_state != IV_STATE_UNINITIALISED)
+                ctx->iv_state = IV_STATE_FINISHED;
+            ctx->ivlen = sz;
+        }
+    }

-        case PIDX_CIPHER_PARAM_AEAD_TLS1_IV_FIXED:
-            if (p->data_type != OSSL_PARAM_OCTET_STRING) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
-                return 0;
-            }
-            if (gcm_tls_iv_set_fixed(ctx, p->data, p->data_size) == 0) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
-                return 0;
-            }
-            break;
+    if (p.aad != NULL) {
+        if (p.aad->data_type != OSSL_PARAM_OCTET_STRING) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
+        }
+        sz = gcm_tls_init(ctx, p.aad->data, p.aad->data_size);
+        if (sz == 0) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_AAD);
+            return 0;
+        }
+        ctx->tls_aad_pad_sz = sz;
+    }

-        case PIDX_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV:
-            if (p->data == NULL
-                || p->data_type != OSSL_PARAM_OCTET_STRING
-                || !setivinv(ctx, p->data, p->data_size))
-                return 0;
-            break;
+    if (p.fixed != NULL) {
+        if (p.fixed->data_type != OSSL_PARAM_OCTET_STRING) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
+        }
+        if (gcm_tls_iv_set_fixed(ctx, p.fixed->data, p.fixed->data_size) == 0) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
         }
     }

+    if (p.inviv != NULL)
+        if (p.inviv->data == NULL
+            || p.inviv->data_type != OSSL_PARAM_OCTET_STRING
+            || !setivinv(ctx, p.inviv->data, p.inviv->data_size))
+            return 0;
+
     return 1;
 }

@@ -410,7 +419,7 @@ int ossl_gcm_cipher(void *vctx,
  */
 static int gcm_iv_generate(PROV_GCM_CTX *ctx, int offset)
 {
-    int sz = ctx->ivlen - offset;
+    int sz = (int)(ctx->ivlen - offset);

     /* Must be at least 96 bits */
     if (sz <= 0 || ctx->ivlen < GCM_IV_DEFAULT_SIZE)
@@ -424,6 +433,21 @@ static int gcm_iv_generate(PROV_GCM_CTX *ctx, int offset)
     return 1;
 }

+/*
+ * If we try to grab the iv before the update - it wont be generated yet,
+ * so we generate it here for this case.
+ */
+static int on_preupdate_generate_iv(PROV_GCM_CTX *ctx)
+{
+    if (ctx->iv_state == IV_STATE_UNINITIALISED) {
+        if (ctx->tls_aad_len != UNINITIALISED_SIZET)
+            return 0;
+        if (!ctx->enc || !gcm_iv_generate(ctx, 0))
+            return 0;
+    }
+    return 1;
+}
+
 static int gcm_cipher_internal(PROV_GCM_CTX *ctx, unsigned char *out,
     size_t *padlen, const unsigned char *in,
     size_t len)
@@ -467,10 +491,15 @@ static int gcm_cipher_internal(PROV_GCM_CTX *ctx, unsigned char *out,
         }
     } else {
         /* The tag must be set before actually decrypting data */
-        if (!ctx->enc && ctx->taglen == UNINITIALISED_SIZET)
+        if (!ctx->enc && ctx->taglen == UNINITIALISED_SIZET) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_TAG_NOT_SET);
             goto err;
-        if (!hw->cipherfinal(ctx, ctx->buf))
+        }
+        if (hw->cipherfinal(ctx, ctx->buf) == 0) {
+            if (ctx->enc == 0)
+                ERR_raise(ERR_LIB_PROV, PROV_R_BAD_DECRYPT);
             goto err;
+        }
         ctx->iv_state = IV_STATE_FINISHED; /* Don't reuse the IV */
         goto finish;
     }
@@ -525,8 +554,9 @@ static int gcm_tls_iv_set_fixed(PROV_GCM_CTX *ctx, unsigned char *iv,
         return 1;
     }
     /* Fixed field must be at least 4 bytes and invocation field at least 8 */
-    if ((len < EVP_GCM_TLS_FIXED_IV_LEN)
-        || (ctx->ivlen - (int)len) < EVP_GCM_TLS_EXPLICIT_IV_LEN)
+    if (len < EVP_GCM_TLS_FIXED_IV_LEN
+        || len > ctx->ivlen
+        || (ctx->ivlen - len) < EVP_GCM_TLS_EXPLICIT_IV_LEN)
         return 0;
     if (len > 0)
         memcpy(ctx->iv, iv, len);
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_gcm.inc.in b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_gcm.inc.in
new file mode 100644
index 00000000000..765fd920668
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_gcm.inc.in
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ossl_cipher_gcm_get_ctx_params',
+                         (['OSSL_CIPHER_PARAM_KEYLEN',               'keylen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IVLEN',                'ivlen',  'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAGLEN',          'taglen', 'size_t'],
+                          ['OSSL_CIPHER_PARAM_IV',                   'iv',     'octet_string'],
+                          ['OSSL_CIPHER_PARAM_UPDATED_IV',           'updiv',  'octet_string'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TAG',             'tag',    'octet_string'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD',    'pad',    'size_t'],
+                          ['OSSL_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN', 'ivgen',  'octet_string'],
+                          ['OSSL_CIPHER_PARAM_AEAD_IV_GENERATED',    'gen',    'uint'],
+                          ['OSSL_CIPHER_PARAM_FIPS_APPROVED_INDICATOR',
+                           'ind', 'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder
+        ('ossl_cipher_gcm_set_ctx_params',
+         (['OSSL_CIPHER_PARAM_AEAD_IVLEN',           'ivlen', 'size_t'],
+          ['OSSL_CIPHER_PARAM_AEAD_TAG',             'tag',   'octet_string'],
+          ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD',        'aad',   'octet_string'],
+          ['OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED',   'fixed', 'octet_string'],
+          ['OSSL_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV', 'inviv', 'octet_string'],
+         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_local.h b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_local.h
index f142722f28b..ff84d65681e 100644
--- a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_local.h
+++ b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHERCOMMON_LOCAL_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHERCOMMON_LOCAL_H
+
 #include "prov/ciphercommon.h"

 void ossl_cipher_padblock(unsigned char *buf, size_t *buflen, size_t blocksize);
@@ -14,3 +17,5 @@ int ossl_cipher_unpadblock(unsigned char *buf, size_t *buflen, size_t blocksize)
 int ossl_cipher_tlsunpadblock(OSSL_LIB_CTX *libctx, unsigned int tlsversion,
     unsigned char *buf, size_t *buflen, size_t blocksize,
     unsigned char **mac, int *alloced, size_t macsize, int aead);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHERCOMMON_LOCAL_H) */
diff --git a/deps/openssl/openssl/providers/implementations/digests/blake2_impl.h b/deps/openssl/openssl/providers/implementations/digests/blake2_impl.h
index dd10beae405..c8ff2efe050 100644
--- a/deps/openssl/openssl/providers/implementations/digests/blake2_impl.h
+++ b/deps/openssl/openssl/providers/implementations/digests/blake2_impl.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,7 +14,13 @@
  * can be found at https://blake2.net.
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_DIGESTS_BLAKE2_IMPL_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_DIGESTS_BLAKE2_IMPL_H
+
 #include <string.h>
+
+#include <openssl/e_os2.h>
+
 #include "internal/endian.h"

 static ossl_inline uint32_t load32(const uint8_t *src)
@@ -116,3 +122,5 @@ static ossl_inline uint64_t rotr64(const uint64_t w, const unsigned int c)
 {
     return (w >> c) | (w << (64 - c));
 }
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_DIGESTS_BLAKE2_IMPL_H) */
diff --git a/deps/openssl/openssl/providers/implementations/digests/blake2_prov.c b/deps/openssl/openssl/providers/implementations/digests/blake2_prov.c
index 5176807199f..977ed0a98eb 100644
--- a/deps/openssl/openssl/providers/implementations/digests/blake2_prov.c
+++ b/deps/openssl/openssl/providers/implementations/digests/blake2_prov.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,47 +7,45 @@
  * https://www.openssl.org/source/license.html
  */

+#include <string.h>
 #include <openssl/crypto.h>
 #include <openssl/core_names.h>
 #include <openssl/proverr.h>
 #include <openssl/err.h>
+#include "internal/cryptlib.h"
 #include "prov/blake2.h"
 #include "prov/digestcommon.h"
 #include "prov/implementations.h"
+#include "providers/implementations/digests/blake2_prov.inc"
+
+static OSSL_FUNC_digest_gettable_ctx_params_fn blake_gettable_ctx_params;
+static OSSL_FUNC_digest_settable_ctx_params_fn blake_settable_ctx_params;
+
+static const OSSL_PARAM *blake_gettable_ctx_params(ossl_unused void *ctx,
+    ossl_unused void *pctx)
+{
+    return blake_get_ctx_params_list;
+}
+
+static const OSSL_PARAM *blake_settable_ctx_params(ossl_unused void *ctx,
+    ossl_unused void *pctx)
+{
+    return blake_set_ctx_params_list;
+}

 #define IMPLEMENT_BLAKE_functions(variant, VARIANT, variantsize)                                                  \
-    static const OSSL_PARAM known_blake##variant##_ctx_params[] = {                                               \
-        { OSSL_DIGEST_PARAM_SIZE, OSSL_PARAM_UNSIGNED_INTEGER, NULL, 0, 0 },                                      \
-        OSSL_PARAM_END                                                                                            \
-    };                                                                                                            \
-                                                                                                                  \
-    const OSSL_PARAM *ossl_blake##variant##_gettable_ctx_params(ossl_unused void *ctx,                            \
-        ossl_unused void *pctx)                                                                                   \
-    {                                                                                                             \
-        return known_blake##variant##_ctx_params;                                                                 \
-    }                                                                                                             \
-                                                                                                                  \
-    const OSSL_PARAM *ossl_blake##variant##_settable_ctx_params(ossl_unused void *ctx,                            \
-        ossl_unused void *pctx)                                                                                   \
-    {                                                                                                             \
-        return known_blake##variant##_ctx_params;                                                                 \
-    }                                                                                                             \
-                                                                                                                  \
     int ossl_blake##variant##_get_ctx_params(void *vctx, OSSL_PARAM params[])                                     \
     {                                                                                                             \
         struct blake##variant##_md_data_st *mdctx = vctx;                                                         \
-        OSSL_PARAM *p;                                                                                            \
+        struct blake_get_ctx_params_st p;                                                                         \
                                                                                                                   \
         BLAKE##VARIANT##_CTX *ctx = &mdctx->ctx;                                                                  \
                                                                                                                   \
-        if (ctx == NULL)                                                                                          \
+        if (ctx == NULL || !blake_get_ctx_params_decoder(params, &p))                                             \
             return 0;                                                                                             \
-        if (ossl_param_is_empty(params))                                                                          \
-            return 1;                                                                                             \
                                                                                                                   \
-        p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_SIZE);                                                    \
-        if (p != NULL                                                                                             \
-            && !OSSL_PARAM_set_uint(p, (unsigned int)mdctx->params.digest_length)) {                              \
+        if (p.size != NULL                                                                                        \
+            && !OSSL_PARAM_set_uint(p.size, (unsigned int)mdctx->params.digest_length)) {                         \
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);                                              \
             return 0;                                                                                             \
         }                                                                                                         \
@@ -57,20 +55,17 @@
                                                                                                                   \
     int ossl_blake##variant##_set_ctx_params(void *vctx, const OSSL_PARAM params[])                               \
     {                                                                                                             \
-        size_t size;                                                                                              \
+        unsigned int size;                                                                                        \
         struct blake##variant##_md_data_st *mdctx = vctx;                                                         \
-        const OSSL_PARAM *p;                                                                                      \
+        struct blake_set_ctx_params_st p;                                                                         \
                                                                                                                   \
         BLAKE##VARIANT##_CTX *ctx = &mdctx->ctx;                                                                  \
                                                                                                                   \
-        if (ctx == NULL)                                                                                          \
+        if (ctx == NULL || !blake_set_ctx_params_decoder(params, &p))                                             \
             return 0;                                                                                             \
-        if (ossl_param_is_empty(params))                                                                          \
-            return 1;                                                                                             \
                                                                                                                   \
-        p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_SIZE);                                              \
-        if (p != NULL) {                                                                                          \
-            if (!OSSL_PARAM_get_size_t(p, &size)) {                                                               \
+        if (p.size != NULL) {                                                                                     \
+            if (!OSSL_PARAM_get_uint(p.size, &size)) {                                                            \
                 ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);                                          \
                 return 0;                                                                                         \
             }                                                                                                     \
@@ -184,9 +179,9 @@
             (void (*)(void))ossl_digest_default_gettable_params },                                                \
         { OSSL_FUNC_DIGEST_INIT, (void (*)(void))blake##variantsize##_internal_init },                            \
         { OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS,                                                                   \
-            (void (*)(void))ossl_blake##variant##_gettable_ctx_params },                                          \
+            (void (*)(void))blake_gettable_ctx_params },                                                          \
         { OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS,                                                                   \
-            (void (*)(void))ossl_blake##variant##_settable_ctx_params },                                          \
+            (void (*)(void))blake_settable_ctx_params },                                                          \
         { OSSL_FUNC_DIGEST_GET_CTX_PARAMS,                                                                        \
             (void (*)(void))ossl_blake##variant##_get_ctx_params },                                               \
         { OSSL_FUNC_DIGEST_SET_CTX_PARAMS,                                                                        \
diff --git a/deps/openssl/openssl/providers/implementations/digests/blake2_prov.inc.in b/deps/openssl/openssl/providers/implementations/digests/blake2_prov.inc.in
new file mode 100644
index 00000000000..ed223e0980f
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/digests/blake2_prov.inc.in
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('blake_get_ctx_params',
+                         (['OSSL_DIGEST_PARAM_SIZE',     'size',   'uint'],
+                         )); -}
+
+{- produce_param_decoder('blake_set_ctx_params',
+                         (['OSSL_DIGEST_PARAM_SIZE',     'size',   'uint'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/digests/blake2b_prov.c b/deps/openssl/openssl/providers/implementations/digests/blake2b_prov.c
index 8b14372e134..6437919ff5c 100644
--- a/deps/openssl/openssl/providers/implementations/digests/blake2b_prov.c
+++ b/deps/openssl/openssl/providers/implementations/digests/blake2b_prov.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -306,7 +306,7 @@ int ossl_blake2b_final(unsigned char *md, BLAKE2B_CTX *c)
 {
     uint8_t outbuffer[BLAKE2B_OUTBYTES] = { 0 };
     uint8_t *target = outbuffer;
-    int iter = (c->outlen + 7) / 8;
+    int iter = (int)((c->outlen + 7) / 8);
     int i;

     /* Avoid writing to the temporary buffer if possible */
diff --git a/deps/openssl/openssl/providers/implementations/digests/blake2s_prov.c b/deps/openssl/openssl/providers/implementations/digests/blake2s_prov.c
index 9190c3eb2ab..4c7c78795f9 100644
--- a/deps/openssl/openssl/providers/implementations/digests/blake2s_prov.c
+++ b/deps/openssl/openssl/providers/implementations/digests/blake2s_prov.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -150,7 +150,7 @@ static void blake2s_compress(BLAKE2S_CTX *S,
     uint32_t m[16];
     uint32_t v[16];
     size_t i;
-    size_t increment;
+    uint32_t increment;

     /*
      * There are two distinct usage vectors for this function:
@@ -171,7 +171,7 @@ static void blake2s_compress(BLAKE2S_CTX *S,
      * including even zero), which is why following assignment doesn't
      * have to reside inside the main loop below.
      */
-    increment = len < BLAKE2S_BLOCKBYTES ? len : BLAKE2S_BLOCKBYTES;
+    increment = len < BLAKE2S_BLOCKBYTES ? (uint32_t)len : BLAKE2S_BLOCKBYTES;

     for (i = 0; i < 8; ++i) {
         v[i] = S->h[i];
@@ -297,7 +297,7 @@ int ossl_blake2s_final(unsigned char *md, BLAKE2S_CTX *c)
 {
     uint8_t outbuffer[BLAKE2S_OUTBYTES] = { 0 };
     uint8_t *target = outbuffer;
-    int iter = (c->outlen + 3) / 4;
+    int iter = (int)((c->outlen + 3) / 4);
     int i;

     /* Avoid writing to the temporary buffer if possible */
diff --git a/deps/openssl/openssl/providers/implementations/digests/build.info b/deps/openssl/openssl/providers/implementations/digests/build.info
index 5e6d06d341f..b2b776c57fc 100644
--- a/deps/openssl/openssl/providers/implementations/digests/build.info
+++ b/deps/openssl/openssl/providers/implementations/digests/build.info
@@ -14,6 +14,7 @@ $BLAKE2_GOAL=../../libdefault.a
 $SM3_GOAL=../../libdefault.a
 $MD5_GOAL=../../libdefault.a
 $NULL_GOAL=../../libdefault.a
+$ML_DSA_MU_GOAL=../../libdefault.a ../../libfips.a

 $MD2_GOAL=../../liblegacy.a
 $MD4_GOAL=../../liblegacy.a
@@ -25,11 +26,12 @@ ELSE
   $RIPEMD_GOAL=../../libdefault.a
 ENDIF

-# This source contains FIPS-provider-specific parameter handling.
+# This source contains a parameter decoder conditioned on FIPS_MODULE and
+# must be built separately for each provider.
 SOURCE[$DIGEST_COMMON_GOAL]=digestcommon.c

 SOURCE[$SHA2_GOAL]=sha2_prov.c
-SOURCE[$SHA3_GOAL]=sha3_prov.c
+SOURCE[$SHA3_GOAL]=sha3_prov.c cshake_prov.c

 SOURCE[$NULL_GOAL]=null_prov.c

@@ -64,3 +66,7 @@ ENDIF
 IF[{- !$disabled{rmd160} -}]
   SOURCE[$RIPEMD_GOAL]=ripemd_prov.c
 ENDIF
+
+IF[{- !$disabled{'ml-dsa'} -}]
+  SOURCE[$ML_DSA_MU_GOAL]=ml_dsa_mu_prov.c
+ENDIF
diff --git a/deps/openssl/openssl/providers/implementations/digests/cshake_prov.c b/deps/openssl/openssl/providers/implementations/digests/cshake_prov.c
new file mode 100644
index 00000000000..7dd9c589406
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/digests/cshake_prov.c
@@ -0,0 +1,504 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* including crypto/sha.h requires this for SHA256_CTX */
+#include "internal/deprecated.h"
+/*
+ * NOTE: By default CSHAKE sets secure xof lengths (OSSL_DIGEST_PARAM_XOFLEN)
+ * that are used by EVP_DigestFinal_ex(). This differs from SHAKE where the
+ * xof length MUST be set (since the initial implementation shipped with BAD
+ * defaults - and the only safe way to fix it was to make the user set the value)
+ */
+#include <string.h>
+#include <openssl/evp.h>
+#include <openssl/err.h>
+#include <openssl/proverr.h>
+#include <openssl/core_names.h>
+#include "crypto/sha.h"
+#include "prov/provider_ctx.h"
+#include "prov/digestcommon.h"
+#include "prov/implementations.h"
+#include "internal/common.h"
+#include "internal/sha3.h"
+#include "providers/implementations/digests/cshake_prov.inc"
+
+/*
+ * Length encoding will be a 1 byte size + length in bits (3 bytes max)
+ * This gives a range of 0..0XFFFFFF bits = 2097151 bytes).
+ */
+#define CSHAKE_MAX_ENCODED_HEADER_LEN (1 + 3)
+
+/*
+ * Restrict the maximum length of the custom strings N & S.
+ * This must not exceed 64 bits = 8k bytes.
+ */
+#define CSHAKE_MAX_STRING 512
+
+/* Maximum size of both the encoded strings (N and S) */
+#define CSHAKE_MAX_ENCODED_STRING (CSHAKE_MAX_STRING + CSHAKE_MAX_ENCODED_HEADER_LEN)
+#define CSHAKE_FLAGS (PROV_DIGEST_FLAG_XOF | PROV_DIGEST_FLAG_ALGID_ABSENT)
+
+typedef struct cshake_ctx_st {
+    OSSL_LIB_CTX *libctx;
+    char *propq;
+    EVP_MD_CTX *mdctx;
+    EVP_MD *md;
+    const uint8_t *func; /* encoded N */
+    uint8_t custom[CSHAKE_MAX_ENCODED_STRING]; /* encoded S */
+    size_t funclen;
+    size_t customlen;
+    size_t bitlen;
+    size_t xoflen;
+    int inited;
+} CSHAKE_CTX;
+
+static OSSL_FUNC_digest_freectx_fn cshake_freectx;
+static OSSL_FUNC_digest_dupctx_fn cshake_dupctx;
+static OSSL_FUNC_digest_init_fn cshake_init;
+static OSSL_FUNC_digest_update_fn cshake_update;
+static OSSL_FUNC_digest_final_fn cshake_final;
+static OSSL_FUNC_digest_squeeze_fn cshake_squeeze;
+static OSSL_FUNC_digest_set_ctx_params_fn cshake_set_ctx_params;
+static OSSL_FUNC_digest_settable_ctx_params_fn cshake_settable_ctx_params;
+static OSSL_FUNC_digest_get_ctx_params_fn cshake_get_ctx_params;
+static OSSL_FUNC_digest_gettable_ctx_params_fn cshake_gettable_ctx_params;
+
+typedef struct name_encode_map_st {
+    const char *name;
+    const uint8_t *encoding;
+    size_t encodinglen;
+} NAME_ENCODE_MAP;
+
+/* Fixed value of encode_string("") */
+static const unsigned char empty_encoded_string[] = {
+    0x01, 0x00
+};
+
+/* Fixed value of encode_string("KMAC") */
+static const unsigned char kmac_encoded_string[] = {
+    0x01, 0x20, 0x4B, 0x4D, 0x41, 0x43
+};
+
+/* Fixed value of encode_string("TupleHash") */
+static const unsigned char tuplehash_encoded_string[] = {
+    0x01, 0x48, 0x54, 0x75, 0x70, 0x6C, 0x65, 0x48, 0x61, 0x73, 0x68
+};
+
+/* Fixed value of encode_string("ParallelHash") */
+static const unsigned char parallelhash_encoded_string[] = {
+    0x01, 0x60, 0x50, 0x61, 0x72, 0x61, 0x6C, 0x6C, 0x65, 0x6C, 0x48, 0x61, 0x73, 0x68
+};
+
+static int cshake_set_func_encode_string(const char *in,
+    const uint8_t **out, size_t *outlen)
+{
+    /*
+     * A list of valid function names to encoded string mappings
+     * See NIST SP800-185 Section 3.4
+     */
+    static NAME_ENCODE_MAP functionNameMap[] = {
+        { "", empty_encoded_string, sizeof(empty_encoded_string) },
+        { "KMAC", kmac_encoded_string, sizeof(kmac_encoded_string) },
+        { "TupleHash", tuplehash_encoded_string, sizeof(tuplehash_encoded_string) },
+        { "ParallelHash", parallelhash_encoded_string, sizeof(parallelhash_encoded_string) },
+        { NULL, NULL, 0 }
+    };
+
+    *out = NULL;
+    *outlen = 0;
+    /*
+     * Don't encode an empty string here - this is done manually later only when
+     * one of the strings is not empty. If both are empty then we don't want it
+     * to encode at all.
+     */
+    if (in == NULL || in[0] == 0)
+        return 1;
+    for (int i = 1; functionNameMap[i].name != NULL; ++i) {
+        if (functionNameMap[i].name[0] == in[0]) {
+            if (OPENSSL_strcasecmp(functionNameMap[i].name, in) == 0) {
+                *out = functionNameMap[i].encoding;
+                *outlen = functionNameMap[i].encodinglen;
+                return 1;
+            }
+            return 0; /* Name does not match a known name */
+        }
+    }
+    return 0; /* Name not found */
+}
+
+static int cshake_set_encode_string(const char *in,
+    uint8_t *out, size_t outmax, size_t *outlen)
+{
+    size_t inlen;
+
+    if (*outlen != 0)
+        OPENSSL_cleanse(out, outmax);
+    *outlen = 0;
+    if (in == NULL)
+        return 1;
+
+    inlen = strlen(in);
+    /*
+     * Don't encode an empty string here - this is done manually later only when
+     * one of the strings is not empty. If both are empty then we don't want it
+     * to encode at all.
+     */
+    if (inlen == 0)
+        return 1;
+    if (inlen >= CSHAKE_MAX_STRING)
+        return 0;
+    return ossl_sp800_185_encode_string(out, outmax, outlen,
+        (const unsigned char *)in, inlen);
+}
+
+/*
+ * Set the xof length, note that if the digest has not been fetched yet then
+ * it is just set into a variable and deferred to later.
+ */
+static int cshake_set_xoflen(CSHAKE_CTX *ctx, size_t xoflen)
+{
+    OSSL_PARAM params[2];
+
+    params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_XOFLEN, &xoflen);
+    params[1] = OSSL_PARAM_construct_end();
+
+    ctx->xoflen = xoflen;
+    if (ctx->md != NULL)
+        return EVP_MD_CTX_set_params(ctx->mdctx, params);
+    return 1;
+}
+
+/*
+ * Fetch a digest for SHAKE or KECCAK, set its xof len and init it
+ * into an mdctx.
+ */
+static int cshake_set_shake_mode(CSHAKE_CTX *ctx, int shake)
+{
+    OSSL_PARAM params[2];
+    const char *name;
+
+    if (shake)
+        name = (ctx->bitlen == 128 ? "SHAKE128" : "SHAKE256");
+    else
+        name = (ctx->bitlen == 128 ? "CSHAKE-KECCAK-128" : "CSHAKE-KECCAK-256");
+
+    if (ctx->md == NULL || !EVP_MD_is_a(ctx->md, name)) {
+        ctx->md = EVP_MD_fetch(ctx->libctx, name, ctx->propq);
+        if (ctx->md == NULL)
+            return 0;
+    }
+    params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_XOFLEN,
+        &ctx->xoflen);
+    params[1] = OSSL_PARAM_construct_end();
+    return EVP_DigestInit_ex2(ctx->mdctx, ctx->md, params);
+}
+
+static void *cshake_newctx(void *provctx, size_t bitlen)
+{
+    CSHAKE_CTX *ctx;
+
+    if (ossl_unlikely(!ossl_prov_is_running()))
+        return NULL;
+    ctx = OPENSSL_zalloc(sizeof(*ctx));
+    if (ctx != NULL) {
+        ctx->mdctx = EVP_MD_CTX_create();
+        if (ctx->mdctx == NULL) {
+            OPENSSL_free(ctx);
+            return NULL;
+        }
+        ctx->bitlen = bitlen;
+        ctx->libctx = PROV_LIBCTX_OF(provctx);
+    }
+    return ctx;
+}
+
+static void cshake_freectx(void *vctx)
+{
+    CSHAKE_CTX *ctx = (CSHAKE_CTX *)vctx;
+
+    OPENSSL_free(ctx->propq);
+    EVP_MD_free(ctx->md);
+    EVP_MD_CTX_destroy(ctx->mdctx);
+    OPENSSL_clear_free(ctx, sizeof(*ctx));
+}
+
+static void *cshake_dupctx(void *ctx)
+{
+    CSHAKE_CTX *src = (CSHAKE_CTX *)ctx;
+    CSHAKE_CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret))
+                                             : NULL;
+
+    if (ret != NULL) {
+        *ret = *src;
+        ret->md = NULL;
+        ret->mdctx = NULL;
+        ret->propq = NULL;
+
+        if (src->md != NULL && !EVP_MD_up_ref(src->md))
+            goto err;
+        ret->md = src->md;
+
+        if (src->mdctx != NULL) {
+            ret->mdctx = EVP_MD_CTX_new();
+            if (ret->mdctx == NULL
+                || !EVP_MD_CTX_copy_ex(ret->mdctx, src->mdctx))
+                goto err;
+        }
+        if (src->propq != NULL) {
+            ret->propq = OPENSSL_strdup(src->propq);
+            if (ret->propq == NULL)
+                goto err;
+        }
+    }
+    return ret;
+err:
+    cshake_freectx(ret);
+    return NULL;
+}
+
+static int cshake_init(void *vctx, const OSSL_PARAM params[])
+{
+    CSHAKE_CTX *ctx = (CSHAKE_CTX *)vctx;
+
+    if (ossl_unlikely(!ossl_prov_is_running()))
+        return 0;
+    ctx->inited = 0;
+    ctx->xoflen = (ctx->bitlen == 128) ? 32 : 64; /* Set default values here */
+    cshake_set_func_encode_string(NULL, &ctx->func, &ctx->funclen);
+    cshake_set_encode_string(NULL, ctx->custom, sizeof(ctx->custom), &ctx->customlen);
+    return cshake_set_ctx_params(vctx, params);
+}
+
+static const OSSL_PARAM *cshake_settable_ctx_params(ossl_unused void *ctx,
+    ossl_unused void *provctx)
+{
+    return cshake_set_ctx_params_list;
+}
+
+static int set_property_query(CSHAKE_CTX *ctx, const char *propq)
+{
+    OPENSSL_free(ctx->propq);
+    ctx->propq = NULL;
+    if (propq != NULL) {
+        ctx->propq = OPENSSL_strdup(propq);
+        if (ctx->propq == NULL)
+            return 0;
+    }
+    return 1;
+}
+
+static int cshake_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+{
+    CSHAKE_CTX *ctx = (CSHAKE_CTX *)vctx;
+    struct cshake_set_ctx_params_st p;
+
+    if (ctx == NULL || !cshake_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.xoflen != NULL) {
+        size_t xoflen;
+
+        if (!OSSL_PARAM_get_size_t(p.xoflen, &xoflen)
+            || !cshake_set_xoflen(ctx, xoflen)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
+        }
+    }
+    if (p.func != NULL) {
+        if (p.func->data_type != OSSL_PARAM_UTF8_STRING)
+            return 0;
+        if (!cshake_set_func_encode_string(p.func->data, &ctx->func, &ctx->funclen)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_FUNCTION_NAME);
+            return 0;
+        }
+    }
+    if (p.custom != NULL) {
+        if (p.custom->data_type != OSSL_PARAM_UTF8_STRING)
+            return 0;
+        if (!cshake_set_encode_string(p.custom->data, ctx->custom, sizeof(ctx->custom), &ctx->customlen))
+            return 0;
+    }
+    if (p.propq != NULL) {
+        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING
+            || !set_property_query(ctx, p.propq->data))
+            return 0;
+    }
+    return 1;
+}
+
+/*
+ * bytepad(encode_string(N) || encode_string(S), w)
+ * See SP800-185 Section 2.3.3 Padding.
+ *
+ * Rather than build an array and do a single keccak operation, we use the
+ * internal keccak buffer to simplify the process.
+ * Note that if the strings are large enough to fill the buffer, it will handle
+ * this internally by absorbing full blocks. The zero padding is also simple
+ * as we just fill the buffer with zeros to make it a multiple of the blocksize.
+ */
+static int cshake_absorb_bytepad_strings(CSHAKE_CTX *ctx)
+{
+    const uint8_t zeros[SHA3_BLOCKSIZE(128)] = { 0 };
+    uint8_t bytepad_header[2] = { 0x01, 0x00 };
+    const uint8_t *n = ctx->func, *s = ctx->custom;
+    size_t nlen = ctx->funclen, slen = ctx->customlen;
+    size_t zlen;
+    size_t w = SHA3_BLOCKSIZE(ctx->bitlen); /* w = 168 or 136 */
+
+    bytepad_header[1] = (uint8_t)w;
+
+    /* Empty strings are still encoded */
+    if (nlen == 0) {
+        n = empty_encoded_string;
+        nlen = sizeof(empty_encoded_string);
+    }
+    if (slen == 0) {
+        s = empty_encoded_string;
+        slen = sizeof(empty_encoded_string);
+    }
+    /* Calculate the number of padding zeros to fill up the block */
+    zlen = ((sizeof(bytepad_header) + nlen + slen) % w);
+    if (zlen != 0)
+        zlen = w - zlen;
+
+    /* left encoded(w) || encodestring(n) || encodestring(s) || zero_padding */
+    return EVP_DigestUpdate(ctx->mdctx, bytepad_header, sizeof(bytepad_header))
+        && EVP_DigestUpdate(ctx->mdctx, n, nlen)
+        && EVP_DigestUpdate(ctx->mdctx, s, slen)
+        && EVP_DigestUpdate(ctx->mdctx, zeros, zlen);
+}
+
+/*
+ * The setup of the EVP_MD gets deferred until after the set_ctx_params
+ * which means that we need to defer to the functions that may be called
+ * afterwards (i.e. The update(), final() or squeeze()).
+ *
+ */
+static int check_init(CSHAKE_CTX *ctx)
+{
+    /*
+     * We have to defer choosing the mode EVP_MD object (SHAKE or KECCAK)
+     * until the first call to either update(), final() or squeeze()
+     * since the strings can be set at any time before this point.
+     */
+    if (ctx->inited == 0) {
+        if (ctx->funclen != 0 || ctx->customlen != 0) {
+            if (!cshake_set_shake_mode(ctx, 0)
+                || !cshake_absorb_bytepad_strings(ctx))
+                return 0;
+        } else {
+            /* Use SHAKE if N and S are both empty strings */
+            if (!cshake_set_shake_mode(ctx, 1))
+                return 0;
+        }
+        ctx->inited = 1;
+    }
+    return 1;
+}
+
+static int cshake_update(void *vctx, const unsigned char *in, size_t inlen)
+{
+    CSHAKE_CTX *ctx = (CSHAKE_CTX *)vctx;
+
+    return check_init(ctx)
+        && EVP_DigestUpdate(ctx->mdctx, in, inlen);
+}
+
+static int cshake_final(void *vctx, uint8_t *out, size_t *outl, size_t outsz)
+{
+    CSHAKE_CTX *ctx = (CSHAKE_CTX *)vctx;
+    unsigned int der = (unsigned int)(*outl);
+    int ret = 1;
+
+    if (ossl_unlikely(!ossl_prov_is_running()))
+        return 0;
+
+    if (outsz > 0)
+        ret = check_init(ctx) && EVP_DigestFinal_ex(ctx->mdctx, out, &der);
+    *outl = der;
+    return ret;
+}
+
+static int cshake_squeeze(void *vctx, uint8_t *out, size_t *outl, size_t outsz)
+{
+    CSHAKE_CTX *ctx = (CSHAKE_CTX *)vctx;
+    int ret = 1;
+
+    if (ossl_unlikely(!ossl_prov_is_running()))
+        return 0;
+
+    if (outsz > 0)
+        ret = check_init(ctx) && EVP_DigestSqueeze(ctx->mdctx, out, outsz);
+    if (ret && outl != NULL)
+        *outl = outsz;
+    return ret;
+}
+
+static const OSSL_PARAM *cshake_gettable_ctx_params(ossl_unused void *ctx,
+    ossl_unused void *provctx)
+{
+    return cshake_get_ctx_params_list;
+}
+
+static int cshake_get_ctx_params(void *vctx, OSSL_PARAM params[])
+{
+    CSHAKE_CTX *ctx = (CSHAKE_CTX *)vctx;
+    struct cshake_get_ctx_params_st p;
+
+    if (ctx == NULL || !cshake_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    /* Size is an alias of xoflen */
+    if (p.xoflen != NULL || p.size != NULL) {
+        size_t xoflen = ctx->xoflen;
+
+        if (ctx->md != NULL)
+            xoflen = EVP_MD_CTX_get_size_ex(ctx->mdctx);
+
+        if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, xoflen)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
+        }
+        if (p.xoflen != NULL && !OSSL_PARAM_set_size_t(p.xoflen, xoflen)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
+        }
+    }
+    return 1;
+}
+
+#define IMPLEMENT_CSHAKE_functions(bitlen)                                          \
+    static OSSL_FUNC_digest_newctx_fn cshake_##bitlen##_newctx;                     \
+    static void *cshake_##bitlen##_newctx(void *provctx)                            \
+    {                                                                               \
+        return cshake_newctx(provctx, bitlen);                                      \
+    }                                                                               \
+    PROV_FUNC_DIGEST_GET_PARAM(cshake_##bitlen, SHA3_BLOCKSIZE(bitlen),             \
+        CSHAKE_KECCAK_MDSIZE(bitlen), CSHAKE_FLAGS)                                 \
+    const OSSL_DISPATCH ossl_cshake_##bitlen##_functions[] = {                      \
+        { OSSL_FUNC_DIGEST_NEWCTX, (void (*)(void))cshake_##bitlen##_newctx },      \
+        { OSSL_FUNC_DIGEST_INIT, (void (*)(void))cshake_init },                     \
+        { OSSL_FUNC_DIGEST_UPDATE, (void (*)(void))cshake_update },                 \
+        { OSSL_FUNC_DIGEST_FINAL, (void (*)(void))cshake_final },                   \
+        { OSSL_FUNC_DIGEST_SQUEEZE, (void (*)(void))cshake_squeeze },               \
+        { OSSL_FUNC_DIGEST_FREECTX, (void (*)(void))cshake_freectx },               \
+        { OSSL_FUNC_DIGEST_DUPCTX, (void (*)(void))cshake_dupctx },                 \
+        { OSSL_FUNC_DIGEST_SET_CTX_PARAMS, (void (*)(void))cshake_set_ctx_params }, \
+        { OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS,                                     \
+            (void (*)(void))cshake_settable_ctx_params },                           \
+        { OSSL_FUNC_DIGEST_GET_CTX_PARAMS, (void (*)(void))cshake_get_ctx_params }, \
+        { OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS,                                     \
+            (void (*)(void))cshake_gettable_ctx_params },                           \
+        PROV_DISPATCH_FUNC_DIGEST_GET_PARAMS(cshake_##bitlen),                      \
+        PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_END
+
+/* ossl_cshake_128_functions */
+IMPLEMENT_CSHAKE_functions(128)
+    /* ossl_cshake_256_functions */
+    IMPLEMENT_CSHAKE_functions(256)
diff --git a/deps/openssl/openssl/providers/implementations/digests/cshake_prov.inc.in b/deps/openssl/openssl/providers/implementations/digests/cshake_prov.inc.in
new file mode 100644
index 00000000000..1bb0ed8d983
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/digests/cshake_prov.inc.in
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('cshake_set_ctx_params',
+                         (['OSSL_DIGEST_PARAM_XOFLEN',   'xoflen',   'size_t'],
+                          ['OSSL_DIGEST_PARAM_SIZE',     'xoflen',   'size_t'],
+                          ['OSSL_DIGEST_PARAM_FUNCTION_NAME', 'func',   'utf8_string'],
+                          ['OSSL_DIGEST_PARAM_CUSTOMIZATION', 'custom', 'utf8_string'],
+                          ['OSSL_DIGEST_PARAM_PROPERTIES', 'propq',  'utf8_string'],
+                         )); -}
+
+{- produce_param_decoder('cshake_get_ctx_params',
+                         (['OSSL_DIGEST_PARAM_XOFLEN',   'xoflen',   'size_t'],
+                          ['OSSL_DIGEST_PARAM_SIZE',     'size',     'size_t'],
+                          ['OSSL_DIGEST_PARAM_FIPS_APPROVED_INDICATOR', 'fips indicator', 'int'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/digests/digestcommon.c b/deps/openssl/openssl/providers/implementations/digests/digestcommon.c
index 299834e8c70..f7361e1693a 100644
--- a/deps/openssl/openssl/providers/implementations/digests/digestcommon.c
+++ b/deps/openssl/openssl/providers/implementations/digests/digestcommon.c
@@ -7,64 +7,58 @@
  * https://www.openssl.org/source/license.html
  */

+#include <string.h>
 #include <openssl/err.h>
 #include <openssl/proverr.h>
 #include "prov/digestcommon.h"
-#include "fips/fipsindicator.h"
+#include "internal/common.h"
+
+#include "providers/implementations/digests/digestcommon.inc"

 int ossl_digest_default_get_params(OSSL_PARAM params[], size_t blksz,
     size_t paramsz, unsigned long flags)
 {
-    OSSL_PARAM *p = NULL;
+    struct digest_default_get_params_st p;
+
+    if (!digest_default_get_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_BLOCK_SIZE);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, blksz)) {
+    if (p.bsize != NULL && !OSSL_PARAM_set_size_t(p.bsize, blksz)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_SIZE);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, paramsz)) {
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, paramsz)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_XOF);
-    if (p != NULL
-        && !OSSL_PARAM_set_int(p, (flags & PROV_DIGEST_FLAG_XOF) != 0)) {
+    if (p.xof != NULL
+        && !OSSL_PARAM_set_int(p.xof, (flags & PROV_DIGEST_FLAG_XOF) != 0)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
-    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_ALGID_ABSENT);
-    if (p != NULL
-        && !OSSL_PARAM_set_int(p, (flags & PROV_DIGEST_FLAG_ALGID_ABSENT) != 0)) {
+    if (p.aldid != NULL
+        && !OSSL_PARAM_set_int(p.aldid, (flags & PROV_DIGEST_FLAG_ALGID_ABSENT) != 0)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
         return 0;
     }
     return 1;
 }

-static const OSSL_PARAM digest_default_known_gettable_params[] = {
-    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_BLOCK_SIZE, NULL),
-    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL),
-    OSSL_PARAM_int(OSSL_DIGEST_PARAM_XOF, NULL),
-    OSSL_PARAM_int(OSSL_DIGEST_PARAM_ALGID_ABSENT, NULL),
-    OSSL_PARAM_END
-};
-const OSSL_PARAM *ossl_digest_default_gettable_params(void *provctx)
+const OSSL_PARAM *ossl_digest_default_gettable_ctx_params(ossl_unused void *ctx,
+    ossl_unused void *provctx)
 {
-    return digest_default_known_gettable_params;
+    return digest_default_get_ctx_params_list;
 }

-const OSSL_PARAM *ossl_digest_default_gettable_ctx_params(ossl_unused void *ctx,
-    ossl_unused void *provctx)
+int ossl_digest_default_get_ctx_params(ossl_unused void *ctx,
+    OSSL_PARAM params[])
 {
-#ifdef FIPS_MODULE
-    return ossl_FIPS_IND_gettable_ctx_params(ctx, provctx);
-#else
-    return NULL;
-#endif
+    struct digest_default_get_ctx_params_st p;
+
+    return digest_default_get_ctx_params_decoder(params, &p);
 }

-int ossl_digest_default_get_ctx_params(void *ctx, OSSL_PARAM params[])
+const OSSL_PARAM *ossl_digest_default_gettable_params(void *provctx)
 {
-    return OSSL_FIPS_IND_GET_CTX_PARAM_APPROVED(ctx, params);
+    return digest_default_get_params_list;
 }
diff --git a/deps/openssl/openssl/providers/implementations/digests/digestcommon.inc.in b/deps/openssl/openssl/providers/implementations/digests/digestcommon.inc.in
new file mode 100644
index 00000000000..0b9aac64be0
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/digests/digestcommon.inc.in
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('digest_default_get_params',
+                         (['OSSL_DIGEST_PARAM_BLOCK_SIZE',   'bsize',    'size_t'],
+                          ['OSSL_DIGEST_PARAM_SIZE',         'size',     'size_t'],
+                          ['OSSL_DIGEST_PARAM_XOF',          'xof',      'int'],
+                          ['OSSL_DIGEST_PARAM_ALGID_ABSENT', 'aldid',    'int'],
+                         )); -}
+
+{- produce_param_decoder('digest_default_get_ctx_params',
+                         (['OSSL_DIGEST_PARAM_FIPS_APPROVED_INDICATOR', 'fips indicator', 'int'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/digests/md5_sha1_prov.c b/deps/openssl/openssl/providers/implementations/digests/md5_sha1_prov.c
index ebf64f39b35..2acb99aca8c 100644
--- a/deps/openssl/openssl/providers/implementations/digests/md5_sha1_prov.c
+++ b/deps/openssl/openssl/providers/implementations/digests/md5_sha1_prov.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -50,7 +50,7 @@ static int md5_sha1_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_SSL3_MS);
     if (p != NULL && p->data_type == OSSL_PARAM_OCTET_STRING)
         return ossl_md5_sha1_ctrl(ctx, EVP_CTRL_SSL3_MASTER_SECRET,
-            p->data_size, p->data);
+            (int)p->data_size, p->data);
     return 1;
 }

diff --git a/deps/openssl/openssl/providers/implementations/digests/mdc2_prov.c b/deps/openssl/openssl/providers/implementations/digests/mdc2_prov.c
index 0a004c4f8b5..bfbc213a383 100644
--- a/deps/openssl/openssl/providers/implementations/digests/mdc2_prov.c
+++ b/deps/openssl/openssl/providers/implementations/digests/mdc2_prov.c
@@ -13,41 +13,36 @@
  */
 #include "internal/deprecated.h"

+#include <string.h>
 #include <openssl/crypto.h>
 #include <openssl/params.h>
 #include <openssl/mdc2.h>
 #include <openssl/core_names.h>
 #include <openssl/err.h>
 #include <openssl/proverr.h>
+#include <internal/common.h>
 #include "prov/digestcommon.h"
 #include "prov/implementations.h"
+#include "providers/implementations/digests/mdc2_prov.inc"

 static OSSL_FUNC_digest_set_ctx_params_fn mdc2_set_ctx_params;
 static OSSL_FUNC_digest_settable_ctx_params_fn mdc2_settable_ctx_params;

-static const OSSL_PARAM known_mdc2_settable_ctx_params[] = {
-    OSSL_PARAM_uint(OSSL_DIGEST_PARAM_PAD_TYPE, NULL),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *mdc2_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    return known_mdc2_settable_ctx_params;
+    return mdc2_set_ctx_params_list;
 }

 static int mdc2_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p;
+    struct mdc2_set_ctx_params_st p;
     MDC2_CTX *ctx = (MDC2_CTX *)vctx;

-    if (ctx == NULL)
+    if (ctx == NULL || !mdc2_set_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_PAD_TYPE);
-    if (p != NULL && !OSSL_PARAM_get_uint(p, &ctx->pad_type)) {
+    if (p.pad != NULL && !OSSL_PARAM_get_uint(p.pad, &ctx->pad_type)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
         return 0;
     }
diff --git a/deps/openssl/openssl/providers/implementations/digests/mdc2_prov.inc.in b/deps/openssl/openssl/providers/implementations/digests/mdc2_prov.inc.in
new file mode 100644
index 00000000000..740544b3e7f
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/digests/mdc2_prov.inc.in
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('mdc2_set_ctx_params',
+                         (['OSSL_DIGEST_PARAM_PAD_TYPE', 'pad', 'uint'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/digests/ml_dsa_mu_prov.c b/deps/openssl/openssl/providers/implementations/digests/ml_dsa_mu_prov.c
new file mode 100644
index 00000000000..50712c0ed49
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/digests/ml_dsa_mu_prov.c
@@ -0,0 +1,345 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * mu is the value:
+ *  mu = SHAKE256(tr || M', 64)
+ *
+ * where tr is the hash of the public key
+ * And M' is one of the following:
+ *   (1) Pure: M' = 00 || ctx_len || ctx || in (where in = message)
+ *   (2) PreHash: M' = 01 || ctx_len || ctx || OID || in (where in = hashed(msg))
+ */
+
+#include "internal/deprecated.h" /* including crypto/sha.h requires this */
+
+#include <string.h>
+#include <openssl/evp.h>
+#include <openssl/err.h>
+#include <openssl/proverr.h>
+#include <openssl/core_names.h>
+#include "crypto/ml_dsa.h"
+#include "prov/provider_ctx.h"
+#include "prov/digestcommon.h"
+#include "prov/der_pq_dsa.h"
+#include "prov/implementations.h"
+#include "internal/common.h"
+#include "internal/sha3.h"
+#include "providers/implementations/digests/ml_dsa_mu_prov.inc"
+
+#define SHAKE256_SIZE 64
+#define SHAKE_FLAGS (PROV_DIGEST_FLAG_ALGID_ABSENT)
+#define ML_DSA_MAX_CONTEXT_STRING_LEN 255
+
+typedef struct mu_ctx_st {
+    OSSL_LIB_CTX *libctx;
+    char *propq;
+    EVP_MD_CTX *mdctx;
+    EVP_MD *md;
+    uint8_t context[ML_DSA_MAX_CONTEXT_STRING_LEN];
+    size_t context_len;
+    uint8_t tr[SHAKE256_SIZE]; /* Pre-cached public key Hash */
+    size_t keylen;
+    const uint8_t *oid;
+    size_t oid_len;
+    size_t digest_len;
+    size_t remaining;
+} MU_CTX;
+
+static OSSL_FUNC_digest_newctx_fn mu_newctx;
+static OSSL_FUNC_digest_freectx_fn mu_freectx;
+static OSSL_FUNC_digest_get_params_fn mu_get_params;
+static OSSL_FUNC_digest_dupctx_fn mu_dupctx;
+static OSSL_FUNC_digest_init_fn mu_init;
+static OSSL_FUNC_digest_update_fn mu_update;
+static OSSL_FUNC_digest_final_fn mu_final;
+static OSSL_FUNC_digest_set_ctx_params_fn mu_set_ctx_params;
+static OSSL_FUNC_digest_settable_ctx_params_fn mu_settable_ctx_params;
+static OSSL_FUNC_digest_get_ctx_params_fn mu_get_ctx_params;
+static OSSL_FUNC_digest_gettable_ctx_params_fn mu_gettable_ctx_params;
+
+static void *mu_newctx(void *provctx)
+{
+    MU_CTX *ctx;
+
+    if (ossl_unlikely(!ossl_prov_is_running()))
+        return NULL;
+    ctx = OPENSSL_zalloc(sizeof(*ctx));
+    if (ctx != NULL)
+        ctx->libctx = PROV_LIBCTX_OF(provctx);
+    return ctx;
+}
+
+static void mu_freectx(void *vctx)
+{
+    MU_CTX *ctx = (MU_CTX *)vctx;
+
+    OPENSSL_free(ctx->propq);
+    EVP_MD_free(ctx->md);
+    EVP_MD_CTX_free(ctx->mdctx);
+    OPENSSL_clear_free(ctx, sizeof(*ctx));
+}
+
+static void *mu_dupctx(void *ctx)
+{
+    MU_CTX *src = (MU_CTX *)ctx;
+    MU_CTX *dst = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*dst)) : NULL;
+
+    if (dst == NULL)
+        return NULL;
+    *dst = *src;
+    dst->mdctx = NULL;
+    dst->propq = NULL;
+    dst->md = NULL;
+    if (src->md != NULL) {
+        if (!EVP_MD_up_ref(src->md))
+            goto err;
+        dst->md = src->md;
+    }
+    if (src->mdctx != NULL) {
+        dst->mdctx = EVP_MD_CTX_new();
+        if (dst->mdctx == NULL
+            || !EVP_MD_CTX_copy_ex(dst->mdctx, src->mdctx))
+            goto err;
+    }
+    if (src->propq != NULL) {
+        dst->propq = OPENSSL_strdup(src->propq);
+        if (dst->propq == NULL)
+            goto err;
+    }
+    return dst;
+err:
+    mu_freectx(dst);
+    return NULL;
+}
+
+static int mu_init(void *vctx, const OSSL_PARAM params[])
+{
+    MU_CTX *ctx = (MU_CTX *)vctx;
+
+    if (ossl_unlikely(!ossl_prov_is_running()))
+        return 0;
+
+    if (ctx->mdctx != NULL && !EVP_MD_CTX_reset(ctx->mdctx))
+        return 0;
+    ctx->remaining = ctx->digest_len;
+    return mu_set_ctx_params(vctx, params);
+}
+
+static int mu_get_params(OSSL_PARAM params[])
+{
+    return ossl_digest_default_get_params(params, SHA3_BLOCKSIZE(256),
+        SHAKE256_SIZE, SHAKE_FLAGS);
+}
+
+static const OSSL_PARAM *mu_settable_ctx_params(ossl_unused void *ctx,
+    ossl_unused void *provctx)
+{
+    return ml_dsa_mu_set_ctx_params_list;
+}
+
+static int set_property_query(MU_CTX *ctx, const char *propq)
+{
+    OPENSSL_free(ctx->propq);
+    ctx->propq = NULL;
+    if (propq != NULL) {
+        ctx->propq = OPENSSL_strdup(propq);
+        if (ctx->propq == NULL)
+            return 0;
+    }
+    return 1;
+}
+
+static EVP_MD *shake_digest(MU_CTX *ctx)
+{
+    if (ctx->md == NULL)
+        ctx->md = EVP_MD_fetch(ctx->libctx, "SHAKE256", ctx->propq);
+    return ctx->md;
+}
+
+static int digest_public_key(MU_CTX *ctx, const uint8_t *pub, size_t publen)
+{
+    int ret;
+    EVP_MD *md;
+    EVP_MD_CTX *mdctx;
+
+    if (publen != ML_DSA_44_PUB_LEN
+        && publen != ML_DSA_65_PUB_LEN
+        && publen != ML_DSA_87_PUB_LEN) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
+        return 0;
+    }
+
+    md = shake_digest(ctx);
+    if (md == NULL)
+        return 0;
+    mdctx = EVP_MD_CTX_new();
+    if (mdctx == NULL)
+        return 0;
+    ret = EVP_DigestInit_ex(mdctx, md, NULL)
+        && EVP_DigestUpdate(mdctx, pub, publen)
+        && EVP_DigestFinalXOF(mdctx, ctx->tr, sizeof(ctx->tr));
+    EVP_MD_CTX_free(mdctx);
+
+    return ret;
+}
+
+static int mu_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+{
+    MU_CTX *ctx = (MU_CTX *)vctx;
+    struct ml_dsa_mu_set_ctx_params_st p;
+
+    if (ctx == NULL || !ml_dsa_mu_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.ctx != NULL) {
+        void *vp = ctx->context;
+
+        if (!OSSL_PARAM_get_octet_string(p.ctx, &vp, sizeof(ctx->context),
+                &(ctx->context_len))) {
+            ctx->context_len = 0;
+            return 0;
+        }
+    }
+    if (p.propq != NULL) {
+        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING
+            || !set_property_query(ctx, p.propq->data))
+            return 0;
+    }
+    if (p.pubkey != NULL) {
+        if (p.pubkey->data_type != OSSL_PARAM_OCTET_STRING)
+            return 0;
+        if (!digest_public_key(ctx, p.pubkey->data, p.pubkey->data_size))
+            return 0;
+        ctx->keylen = p.pubkey->data_size;
+    }
+    if (p.digestname != NULL) {
+        int ret;
+
+        if (p.digestname->data_type != OSSL_PARAM_UTF8_STRING)
+            return 0;
+        ret = ossl_der_oid_pq_dsa_prehash_digest(p.digestname->data,
+            &ctx->oid, &ctx->oid_len, &ctx->digest_len);
+        if (ret)
+            ctx->remaining = ctx->digest_len;
+        else
+            ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
+                "%s is not supported", p.digestname->data);
+        return ret;
+    }
+    return 1;
+}
+
+static const OSSL_PARAM *mu_gettable_ctx_params(ossl_unused void *ctx,
+    ossl_unused void *provctx)
+{
+    return ml_dsa_mu_get_ctx_params_list;
+}
+
+static int mu_get_ctx_params(void *vctx, OSSL_PARAM params[])
+{
+    MU_CTX *ctx = (MU_CTX *)vctx;
+    struct ml_dsa_mu_get_ctx_params_st p;
+
+    if (ctx == NULL || !ml_dsa_mu_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    /* Size is an alias of xoflen */
+    if (p.xoflen != NULL || p.size != NULL) {
+        size_t xoflen = SHAKE256_SIZE;
+
+        if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, xoflen)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
+        }
+        if (p.xoflen != NULL && !OSSL_PARAM_set_size_t(p.xoflen, xoflen)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
+        }
+    }
+    return 1;
+}
+
+static int check_init(MU_CTX *ctx)
+{
+    if (ctx->mdctx == NULL) {
+        EVP_MD *md = shake_digest(ctx);
+
+        if (md == NULL)
+            return 0;
+        if (ctx->keylen == 0) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_KEY);
+            return 0;
+        }
+        ctx->mdctx = ossl_ml_dsa_mu_init_int(md, ctx->tr, sizeof(ctx->tr), 1,
+            ctx->oid_len != 0, ctx->context, ctx->context_len);
+        if (ctx->mdctx == NULL)
+            return 0;
+        if (!ossl_ml_dsa_mu_update(ctx->mdctx, ctx->oid, ctx->oid_len))
+            return 0;
+    }
+    return 1;
+}
+
+static int mu_update(void *vctx, const unsigned char *in, size_t inlen)
+{
+    MU_CTX *ctx = (MU_CTX *)vctx;
+    int ret;
+
+    if (ctx->oid_len > 0) {
+        /* For the HASH-ML-DSA case we expect the input to be the size of the digest */
+        if (inlen > ctx->remaining) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DATA);
+            return 0;
+        }
+        ctx->remaining -= inlen;
+    }
+    ret = check_init(ctx)
+        && ossl_ml_dsa_mu_update(ctx->mdctx, in, inlen);
+    return ret;
+}
+
+static int mu_final(void *vctx, uint8_t *out, size_t *outl, size_t outsz)
+{
+    MU_CTX *ctx = (MU_CTX *)vctx;
+    size_t len = SHAKE256_SIZE;
+
+    if (ossl_unlikely(!ossl_prov_is_running()))
+        return 0;
+    if (out == NULL) {
+        if (outl == NULL)
+            return 0;
+    } else if (outsz > 0) {
+        if (outsz < len)
+            return 0;
+
+        if (ctx->remaining != 0 || !check_init(ctx))
+            return 0;
+        if (!ossl_ml_dsa_mu_finalize(ctx->mdctx, out, len))
+            return 0;
+    }
+    *outl = len;
+    return 1;
+}
+
+const OSSL_DISPATCH ossl_ml_dsa_mu_functions[] = {
+    { OSSL_FUNC_DIGEST_NEWCTX, (void (*)(void))mu_newctx },
+    { OSSL_FUNC_DIGEST_INIT, (void (*)(void))mu_init },
+    { OSSL_FUNC_DIGEST_UPDATE, (void (*)(void))mu_update },
+    { OSSL_FUNC_DIGEST_FINAL, (void (*)(void))mu_final },
+    { OSSL_FUNC_DIGEST_FREECTX, (void (*)(void))mu_freectx },
+    { OSSL_FUNC_DIGEST_DUPCTX, (void (*)(void))mu_dupctx },
+    { OSSL_FUNC_DIGEST_SET_CTX_PARAMS, (void (*)(void))mu_set_ctx_params },
+    { OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS,
+        (void (*)(void))mu_settable_ctx_params },
+    { OSSL_FUNC_DIGEST_GET_CTX_PARAMS, (void (*)(void))mu_get_ctx_params },
+    { OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS,
+        (void (*)(void))mu_gettable_ctx_params },
+    PROV_DISPATCH_FUNC_DIGEST_GET_PARAMS(mu),
+    PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_END
diff --git a/deps/openssl/openssl/providers/implementations/digests/ml_dsa_mu_prov.inc.in b/deps/openssl/openssl/providers/implementations/digests/ml_dsa_mu_prov.inc.in
new file mode 100644
index 00000000000..d86a40b5367
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/digests/ml_dsa_mu_prov.inc.in
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ml_dsa_mu_get_ctx_params',
+    (['OSSL_DIGEST_PARAM_SIZE', 'size', 'uint'],
+    ['OSSL_DIGEST_PARAM_XOFLEN', 'xoflen', 'size_t'],
+    ['OSSL_DIGEST_PARAM_FIPS_APPROVED_INDICATOR', 'fips indicator', 'int'],
+    )); -}
+
+{- produce_param_decoder('ml_dsa_mu_set_ctx_params',
+    (['OSSL_DIGEST_PARAM_MU_CONTEXT_STRING', 'ctx', 'octet_string'],
+    ['OSSL_DIGEST_PARAM_MU_PROPERTIES', 'propq', 'utf8_string'],
+    ['OSSL_DIGEST_PARAM_MU_PUB_KEY', 'pubkey', 'octet_string'],
+    ['OSSL_DIGEST_PARAM_MU_DIGEST', 'digestname', 'utf8_string']
+    )); -}
diff --git a/deps/openssl/openssl/providers/implementations/digests/sha2_prov.c b/deps/openssl/openssl/providers/implementations/digests/sha2_prov.c
index 31b1bbd4af3..fe232e9f10e 100644
--- a/deps/openssl/openssl/providers/implementations/digests/sha2_prov.c
+++ b/deps/openssl/openssl/providers/implementations/digests/sha2_prov.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,86 +13,322 @@
  */
 #include "internal/deprecated.h"

+#include <openssl/byteorder.h>
 #include <openssl/crypto.h>
 #include <openssl/core_dispatch.h>
 #include <openssl/evp.h>
+#include <openssl/err.h>
 #include <openssl/sha.h>
 #include <openssl/params.h>
+#include <openssl/proverr.h>
 #include <openssl/core_names.h>
 #include "prov/digestcommon.h"
 #include "prov/implementations.h"
 #include "crypto/sha.h"
+#include "internal/common.h"
+#include "providers/implementations/digests/sha2_prov.inc"

 #define SHA2_FLAGS PROV_DIGEST_FLAG_ALGID_ABSENT

-static OSSL_FUNC_digest_set_ctx_params_fn sha1_set_ctx_params;
-static OSSL_FUNC_digest_settable_ctx_params_fn sha1_settable_ctx_params;
+extern int SHA1_Update_thunk(void *ctx, const unsigned char *data, size_t sz);
+extern int SHA256_Update_thunk(void *ctx, const unsigned char *data, size_t sz);
+extern int SHA512_Update_thunk(void *ctx, const unsigned char *data, size_t sz);
+
+/* Special set_params method for SSL3 */
+static int sha1_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+{
+    struct sha1_set_ctx_params_st p;
+    SHA_CTX *ctx = (SHA_CTX *)vctx;
+
+    if (ossl_unlikely(ctx == NULL || !sha1_set_ctx_params_decoder(params, &p)))
+        return 0;
+
+    if (p.ssl3_ms != NULL)
+        return ossl_sha1_ctrl(ctx, EVP_CTRL_SSL3_MASTER_SECRET,
+            (int)p.ssl3_ms->data_size, p.ssl3_ms->data);
+
+    return 1;
+}

-static const OSSL_PARAM known_sha1_settable_ctx_params[] = {
-    { OSSL_DIGEST_PARAM_SSL3_MS, OSSL_PARAM_OCTET_STRING, NULL, 0, 0 },
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *sha1_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    return known_sha1_settable_ctx_params;
+    return sha1_set_ctx_params_list;
 }

-/* Special set_params method for SSL3 */
-static int sha1_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+static const unsigned char sha256magic[] = "SHA256v1";
+#define SHA256MAGIC_LEN (sizeof(sha256magic) - 1)
+#define SHA256_SERIALIZATION_LEN                      \
+    (                                                 \
+        SHA256MAGIC_LEN /* magic */                   \
+        + sizeof(uint32_t) /* c->md_len */            \
+        + sizeof(uint32_t) /* c->num */               \
+        + sizeof(uint32_t) * 8 /* c->h */             \
+        + sizeof(uint32_t) * 2 /* c->Nl + c->Nh */    \
+        + sizeof(uint32_t) * SHA_LBLOCK /* c->data */ \
+    )
+
+static int SHA256_Serialize(SHA256_CTX *c, unsigned char *out,
+    size_t *outlen)
 {
-    const OSSL_PARAM *p;
-    SHA_CTX *ctx = (SHA_CTX *)vctx;
+    unsigned char *p;
+    unsigned long i;
+
+    if (out == NULL) {
+        if (outlen == NULL)
+            return 0;
+
+        *outlen = SHA256_SERIALIZATION_LEN;
+        return 1;
+    }
+
+    if (outlen != NULL && *outlen < SHA256_SERIALIZATION_LEN)
+        return 0;
+
+    p = out;
+
+    /* Magic code */
+    memcpy(p, sha256magic, SHA256MAGIC_LEN);
+    p += SHA256MAGIC_LEN;
+
+    /* md_len */
+    p = OPENSSL_store_u32_le(p, c->md_len);
+
+    /* num */
+    p = OPENSSL_store_u32_le(p, c->num);
+
+    /* h */
+    for (i = 0; i < sizeof(c->h) / sizeof(SHA_LONG); i++)
+        p = OPENSSL_store_u32_le(p, c->h[i]);
+
+    /* Nl, Nh */
+    p = OPENSSL_store_u32_le(p, c->Nl);
+    p = OPENSSL_store_u32_le(p, c->Nh);
+
+    /* data */
+    for (i = 0; i < SHA_LBLOCK; i++)
+        p = OPENSSL_store_u32_le(p, c->data[i]);
+
+    if (outlen != NULL)
+        *outlen = SHA256_SERIALIZATION_LEN;
+
+    return 1;
+}
+
+/*
+ * This function only performs basic input sanity checks and is not
+ * built to handle malicious input data. Only trusted input should be
+ * fed to this function
+ */
+static int SHA256_Deserialize(SHA256_CTX *c, const unsigned char *in,
+    size_t inlen)
+{
+    const unsigned char *p;
+    uint32_t val;
+    unsigned long i;
+
+    if (c == NULL || in == NULL || inlen != SHA256_SERIALIZATION_LEN)
+        return 0;
+
+    /* Magic code check */
+    if (memcmp(in, sha256magic, SHA256MAGIC_LEN) != 0)
+        return 0;
+
+    p = in + SHA256MAGIC_LEN;
+
+    /* md_len check */
+    p = OPENSSL_load_u32_le(&val, p);
+    if ((unsigned int)val != c->md_len) {
+        return 0;
+    }

-    if (ctx == NULL)
+    /* num check */
+    p = OPENSSL_load_u32_le(&val, p);
+    if (val >= sizeof(c->data))
         return 0;
-    if (ossl_param_is_empty(params))
+    c->num = (unsigned int)val;
+
+    /* h */
+    for (i = 0; i < (sizeof(c->h) / sizeof(SHA_LONG)); i++) {
+        p = OPENSSL_load_u32_le(&val, p);
+        c->h[i] = (SHA_LONG)val;
+    }
+
+    /* Nl, Nh */
+    p = OPENSSL_load_u32_le(&val, p);
+    c->Nl = (SHA_LONG)val;
+    p = OPENSSL_load_u32_le(&val, p);
+    c->Nh = (SHA_LONG)val;
+
+    /* data */
+    for (i = 0; i < SHA_LBLOCK; i++) {
+        p = OPENSSL_load_u32_le(&val, p);
+        c->data[i] = (SHA_LONG)val;
+    }
+
+    return 1;
+}
+
+static const unsigned char sha512magic[] = "SHA512v1";
+#define SHA512MAGIC_LEN (sizeof(sha512magic) - 1)
+#define SHA512_SERIALIZATION_LEN                   \
+    (                                              \
+        SHA512MAGIC_LEN /* magic */                \
+        + sizeof(uint32_t) /* c->md_len */         \
+        + sizeof(uint32_t) /* c->num */            \
+        + sizeof(uint64_t) * 8 /* c->h */          \
+        + sizeof(uint64_t) * 2 /* c->Nl + c->Nh */ \
+        + SHA512_CBLOCK /* c->u.d/c->u.p */        \
+    )
+
+static int SHA512_Serialize(SHA512_CTX *c, unsigned char *out,
+    size_t *outlen)
+{
+    unsigned char *p;
+    unsigned long i;
+
+    if (out == NULL) {
+        if (outlen == NULL)
+            return 0;
+
+        *outlen = SHA512_SERIALIZATION_LEN;
         return 1;
+    }
+
+    if (outlen != NULL && *outlen < SHA512_SERIALIZATION_LEN)
+        return 0;
+
+    p = out;
+
+    /* Magic code */
+    memcpy(p, sha512magic, SHA512MAGIC_LEN);
+    p += SHA512MAGIC_LEN;
+
+    /* md_len */
+    p = OPENSSL_store_u32_le(p, c->md_len);
+
+    /* num */
+    p = OPENSSL_store_u32_le(p, c->num);
+
+    /* h */
+    for (i = 0; i < sizeof(c->h) / sizeof(SHA_LONG64); i++)
+        p = OPENSSL_store_u64_le(p, c->h[i]);
+
+    /* Nl, Nh */
+    p = OPENSSL_store_u64_le(p, c->Nl);
+    p = OPENSSL_store_u64_le(p, c->Nh);
+
+    /* data */
+    memcpy(p, c->u.p, SHA512_CBLOCK);
+    p += SHA512_CBLOCK;
+
+    if (outlen != NULL)
+        *outlen = SHA512_SERIALIZATION_LEN;
+
+    return 1;
+}
+
+/*
+ * This function only performs basic input sanity checks and is not
+ * built to handle malicious input data. Only trusted input should be
+ * fed to this function
+ */
+static int SHA512_Deserialize(SHA512_CTX *c, const unsigned char *in,
+    size_t inlen)
+{
+    const unsigned char *p;
+    uint32_t val32;
+    uint64_t val;
+    unsigned long i;
+
+    if (c == NULL || in == NULL || inlen != SHA512_SERIALIZATION_LEN)
+        return 0;
+
+    /* Magic code */
+    if (memcmp(in, sha512magic, SHA512MAGIC_LEN) != 0)
+        return 0;
+
+    p = in + SHA512MAGIC_LEN;
+
+    /* md_len check */
+    p = OPENSSL_load_u32_le(&val32, p);
+    if ((unsigned int)val32 != c->md_len)
+        return 0;
+
+    /* num check */
+    p = OPENSSL_load_u32_le(&val32, p);
+    if (val32 >= sizeof(c->u.d))
+        return 0;
+    c->num = (unsigned int)val32;
+
+    /* h */
+    for (i = 0; i < (sizeof(c->h) / sizeof(SHA_LONG64)); i++) {
+        p = OPENSSL_load_u64_le(&val, p);
+        c->h[i] = (SHA_LONG64)val;
+    }
+
+    /* Nl, Nh */
+    p = OPENSSL_load_u64_le(&val, p);
+    c->Nl = (SHA_LONG64)val;
+    p = OPENSSL_load_u64_le(&val, p);
+    c->Nh = (SHA_LONG64)val;
+
+    /* data */
+    memcpy(c->u.p, p, SHA512_CBLOCK);
+    p += SHA512_CBLOCK;

-    p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_SSL3_MS);
-    if (p != NULL && p->data_type == OSSL_PARAM_OCTET_STRING)
-        return ossl_sha1_ctrl(ctx, EVP_CTRL_SSL3_MASTER_SECRET,
-            p->data_size, p->data);
     return 1;
 }

 /* ossl_sha1_functions */
 IMPLEMENT_digest_functions_with_settable_ctx(
     sha1, SHA_CTX, SHA_CBLOCK, SHA_DIGEST_LENGTH, SHA2_FLAGS,
-    SHA1_Init, SHA1_Update, SHA1_Final,
+    SHA1_Init, SHA1_Update_thunk, SHA1_Final,
     sha1_settable_ctx_params, sha1_set_ctx_params)

 /* ossl_sha224_functions */
-IMPLEMENT_digest_functions(sha224, SHA256_CTX,
-    SHA256_CBLOCK, SHA224_DIGEST_LENGTH, SHA2_FLAGS,
-    SHA224_Init, SHA224_Update, SHA224_Final)
+IMPLEMENT_digest_functions_with_serialize(sha224, SHA256_CTX,
+    SHA256_CBLOCK, SHA224_DIGEST_LENGTH,
+    SHA2_FLAGS, SHA224_Init,
+    SHA256_Update_thunk, SHA224_Final,
+    SHA256_Serialize, SHA256_Deserialize)

 /* ossl_sha256_functions */
-IMPLEMENT_digest_functions(sha256, SHA256_CTX,
-    SHA256_CBLOCK, SHA256_DIGEST_LENGTH, SHA2_FLAGS,
-    SHA256_Init, SHA256_Update, SHA256_Final)
-#ifndef FIPS_MODULE
-/* ossl_sha256_192_functions */
-IMPLEMENT_digest_functions(sha256_192, SHA256_CTX,
-    SHA256_CBLOCK, SHA256_192_DIGEST_LENGTH, SHA2_FLAGS,
-    ossl_sha256_192_init, SHA256_Update, SHA256_Final)
-#endif
+IMPLEMENT_digest_functions_with_serialize(sha256, SHA256_CTX,
+    SHA256_CBLOCK, SHA256_DIGEST_LENGTH,
+    SHA2_FLAGS, SHA256_Init,
+    SHA256_Update_thunk, SHA256_Final,
+    SHA256_Serialize, SHA256_Deserialize)
+/* ossl_sha256_192_internal_functions */
+IMPLEMENT_digest_functions_with_serialize(sha256_192_internal, SHA256_CTX,
+    SHA256_CBLOCK, SHA256_192_DIGEST_LENGTH,
+    SHA2_FLAGS, ossl_sha256_192_init,
+    SHA256_Update_thunk, SHA256_Final,
+    SHA256_Serialize, SHA256_Deserialize)
 /* ossl_sha384_functions */
-IMPLEMENT_digest_functions(sha384, SHA512_CTX,
-    SHA512_CBLOCK, SHA384_DIGEST_LENGTH, SHA2_FLAGS,
-    SHA384_Init, SHA384_Update, SHA384_Final)
+IMPLEMENT_digest_functions_with_serialize(sha384, SHA512_CTX,
+    SHA512_CBLOCK, SHA384_DIGEST_LENGTH,
+    SHA2_FLAGS, SHA384_Init,
+    SHA512_Update_thunk, SHA384_Final,
+    SHA512_Serialize, SHA512_Deserialize)

 /* ossl_sha512_functions */
-IMPLEMENT_digest_functions(sha512, SHA512_CTX,
-    SHA512_CBLOCK, SHA512_DIGEST_LENGTH, SHA2_FLAGS,
-    SHA512_Init, SHA512_Update, SHA512_Final)
+IMPLEMENT_digest_functions_with_serialize(sha512, SHA512_CTX,
+    SHA512_CBLOCK, SHA512_DIGEST_LENGTH,
+    SHA2_FLAGS, SHA512_Init,
+    SHA512_Update_thunk, SHA512_Final,
+    SHA512_Serialize, SHA512_Deserialize)

 /* ossl_sha512_224_functions */
-IMPLEMENT_digest_functions(sha512_224, SHA512_CTX,
-    SHA512_CBLOCK, SHA224_DIGEST_LENGTH, SHA2_FLAGS,
-    sha512_224_init, SHA512_Update, SHA512_Final)
+IMPLEMENT_digest_functions_with_serialize(sha512_224, SHA512_CTX,
+    SHA512_CBLOCK, SHA224_DIGEST_LENGTH,
+    SHA2_FLAGS, sha512_224_init,
+    SHA512_Update_thunk, SHA512_Final,
+    SHA512_Serialize, SHA512_Deserialize)

 /* ossl_sha512_256_functions */
-IMPLEMENT_digest_functions(sha512_256, SHA512_CTX,
-    SHA512_CBLOCK, SHA256_DIGEST_LENGTH, SHA2_FLAGS,
-    sha512_256_init, SHA512_Update, SHA512_Final)
+IMPLEMENT_digest_functions_with_serialize(sha512_256, SHA512_CTX,
+    SHA512_CBLOCK, SHA256_DIGEST_LENGTH,
+    SHA2_FLAGS, sha512_256_init,
+    SHA512_Update_thunk, SHA512_Final,
+    SHA512_Serialize, SHA512_Deserialize)
diff --git a/deps/openssl/openssl/providers/implementations/digests/sha2_prov.inc.in b/deps/openssl/openssl/providers/implementations/digests/sha2_prov.inc.in
new file mode 100644
index 00000000000..33b2931a25d
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/digests/sha2_prov.inc.in
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{-
+produce_param_decoder('sha1_set_ctx_params',
+                      ([ 'OSSL_DIGEST_PARAM_SSL3_MS', 'ssl3_ms', 'octet_string' ],
+                      ));
+-}
diff --git a/deps/openssl/openssl/providers/implementations/digests/sha3_prov.c b/deps/openssl/openssl/providers/implementations/digests/sha3_prov.c
index 037a0af38e6..7895a117280 100644
--- a/deps/openssl/openssl/providers/implementations/digests/sha3_prov.c
+++ b/deps/openssl/openssl/providers/implementations/digests/sha3_prov.c
@@ -8,21 +8,62 @@
  */

 #include <string.h>
+#include <openssl/byteorder.h>
 #include <openssl/core_names.h>
 #include <openssl/crypto.h>
 #include <openssl/evp.h>
 #include <openssl/params.h>
 #include <openssl/err.h>
 #include <openssl/proverr.h>
+#include "internal/cryptlib.h"
 #include "internal/numbers.h"
 #include "internal/sha3.h"
 #include "prov/digestcommon.h"
 #include "prov/implementations.h"
-#include "fips/fipsindicator.h"
+#include "internal/common.h"
+#include "providers/implementations/digests/sha3_prov.inc"

 #define SHA3_FLAGS PROV_DIGEST_FLAG_ALGID_ABSENT
 #define SHAKE_FLAGS (PROV_DIGEST_FLAG_XOF | PROV_DIGEST_FLAG_ALGID_ABSENT)
-#define KMAC_FLAGS PROV_DIGEST_FLAG_XOF
+#define CSHAKE_KECCAK_FLAGS PROV_DIGEST_FLAG_XOF
+
+/*
+ * FIPS 202 Section 5.1 Specifies a padding mode that is added to the last
+ * block that consists of a 1 bit followed by padding zero bits and a trailing
+ * 1 bit (where the bits are in LSB order)
+ *
+ * For a given input message special algorithm context bits are appended:
+ * i.e.
+ *   KECCAK[c] = (No tag is used)
+ *   SHA3   = 01
+ *   SHAKE  = 1111
+ *   CSHAKE_KECCAK = 00 (See NIST SP800-185 3.3 : i.e. it has 2 trailing zero bits)
+ * Note that KMAC and TupleHash use CSHAKE_KECCAK.
+ * The OpenSSL implementation only allows input messages that are in bytes,
+ * so the above concatenated bits will start on a byte boundary.
+ * Following these bits will be a 1 bit then the padding zeros which gives
+ *
+ *   KECCAK[c] = 1000
+ *   SHA3   = 0110
+ *   SHAKE  = 11111000
+ *   CSHAKE_KECCAK = 0010 (See NIST SP800-185 3.3 : i.e. KMAC uses cSHAKE with a fixed string)
+ *
+ *   Which gives the following padding values as bytes.
+ */
+#define KECCAK_PADDING 0x01
+#define SHA3_PADDING 0x06
+#define SHAKE_PADDING 0x1f
+#define CSHAKE_KECCAK_PADDING 0x04
+
+#if defined(OPENSSL_CPUID_OBJ) && defined(__s390__) && defined(KECCAK1600_ASM)
+/*
+ * IBM S390X support
+ */
+#include "arch/s390x_arch.h"
+#define S390_SHA3 1
+#define S390_SHA3_CAPABLE(name) \
+    ((OPENSSL_s390xcap_P.kimd[0] & S390X_CAPBIT(S390X_##name)) && (OPENSSL_s390xcap_P.klmd[0] & S390X_CAPBIT(S390X_##name)))
+#endif

 /*
  * Forward declaration of any unique methods implemented here. This is not strictly
@@ -37,28 +78,27 @@ static OSSL_FUNC_digest_freectx_fn keccak_freectx;
 static OSSL_FUNC_digest_copyctx_fn keccak_copyctx;
 static OSSL_FUNC_digest_dupctx_fn keccak_dupctx;
 static OSSL_FUNC_digest_squeeze_fn shake_squeeze;
+
 static OSSL_FUNC_digest_get_ctx_params_fn shake_get_ctx_params;
 static OSSL_FUNC_digest_gettable_ctx_params_fn shake_gettable_ctx_params;
 static OSSL_FUNC_digest_set_ctx_params_fn shake_set_ctx_params;
 static OSSL_FUNC_digest_settable_ctx_params_fn shake_settable_ctx_params;
-static sha3_absorb_fn generic_sha3_absorb;
-static sha3_final_fn generic_sha3_final;
-static sha3_squeeze_fn generic_sha3_squeeze;

-#if defined(OPENSSL_CPUID_OBJ) && defined(__s390__) && defined(KECCAK1600_ASM)
-/*
- * IBM S390X support
- */
-#include "s390x_arch.h"
-#define S390_SHA3 1
-#define S390_SHA3_CAPABLE(name) \
-    ((OPENSSL_s390xcap_P.kimd[0] & S390X_CAPBIT(S390X_##name)) && (OPENSSL_s390xcap_P.klmd[0] & S390X_CAPBIT(S390X_##name)))
+static PROV_SHA3_METHOD sha3_generic_md = {
+    ossl_sha3_absorb_default,
+    ossl_sha3_final_default,
+    NULL
+};

-#endif
+static PROV_SHA3_METHOD shake_generic_md = {
+    ossl_sha3_absorb_default,
+    ossl_sha3_final_default,
+    ossl_shake_squeeze_default
+};

 static int keccak_init(void *vctx, ossl_unused const OSSL_PARAM params[])
 {
-    if (!ossl_prov_is_running())
+    if (ossl_unlikely(!ossl_prov_is_running()))
         return 0;
     /* The newctx() handles most of the ctx fixed setup. */
     ossl_sha3_reset((KECCAK1600_CTX *)vctx);
@@ -73,39 +113,7 @@ static int keccak_init_params(void *vctx, const OSSL_PARAM params[])

 static int keccak_update(void *vctx, const unsigned char *inp, size_t len)
 {
-    KECCAK1600_CTX *ctx = vctx;
-    const size_t bsz = ctx->block_size;
-    size_t num, rem;
-
-    if (len == 0)
-        return 1;
-
-    /* Is there anything in the buffer already ? */
-    if ((num = ctx->bufsz) != 0) {
-        /* Calculate how much space is left in the buffer */
-        rem = bsz - num;
-        /* If the new input does not fill the buffer then just add it */
-        if (len < rem) {
-            memcpy(ctx->buf + num, inp, len);
-            ctx->bufsz += len;
-            return 1;
-        }
-        /* otherwise fill up the buffer and absorb the buffer */
-        memcpy(ctx->buf + num, inp, rem);
-        /* Update the input pointer */
-        inp += rem;
-        len -= rem;
-        ctx->meth.absorb(ctx, ctx->buf, bsz);
-        ctx->bufsz = 0;
-    }
-    /* Absorb the input - rem = leftover part of the input < blocksize) */
-    rem = ctx->meth.absorb(ctx, inp, len);
-    /* Copy the leftover bit of the input into the buffer */
-    if (rem) {
-        memcpy(ctx->buf, inp + len - rem, rem);
-        ctx->bufsz = rem;
-    }
-    return 1;
+    return ossl_sha3_absorb((KECCAK1600_CTX *)vctx, inp, len);
 }

 static int keccak_final(void *vctx, unsigned char *out, size_t *outl,
@@ -114,15 +122,13 @@ static int keccak_final(void *vctx, unsigned char *out, size_t *outl,
     int ret = 1;
     KECCAK1600_CTX *ctx = vctx;

-    if (!ossl_prov_is_running())
+    if (ossl_unlikely(!ossl_prov_is_running()))
         return 0;
-    if (ctx->md_size == SIZE_MAX) {
+    if (ossl_unlikely(ctx->md_size == SIZE_MAX)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DIGEST_LENGTH);
         return 0;
     }
-    if (outlen > 0)
-        ret = ctx->meth.final(ctx, out, ctx->md_size);
-
+    ret = ossl_sha3_final(ctx, out, ctx->md_size);
     *outl = ctx->md_size;
     return ret;
 }
@@ -138,47 +144,12 @@ static int shake_squeeze(void *vctx, unsigned char *out, size_t *outl,
     if (ctx->meth.squeeze == NULL)
         return 0;
     if (outlen > 0)
-        ret = ctx->meth.squeeze(ctx, out, outlen);
-
-    *outl = outlen;
+        ret = ossl_sha3_squeeze(ctx, out, outlen);
+    if (outl != NULL)
+        *outl = outlen;
     return ret;
 }

-/*-
- * Generic software version of the absorb() and final().
- */
-static size_t generic_sha3_absorb(void *vctx, const void *inp, size_t len)
-{
-    KECCAK1600_CTX *ctx = vctx;
-
-    if (!(ctx->xof_state == XOF_STATE_INIT || ctx->xof_state == XOF_STATE_ABSORB))
-        return 0;
-    ctx->xof_state = XOF_STATE_ABSORB;
-    return SHA3_absorb(ctx->A, inp, len, ctx->block_size);
-}
-
-static int generic_sha3_final(void *vctx, unsigned char *out, size_t outlen)
-{
-    return ossl_sha3_final((KECCAK1600_CTX *)vctx, out, outlen);
-}
-
-static int generic_sha3_squeeze(void *vctx, unsigned char *out, size_t outlen)
-{
-    return ossl_sha3_squeeze((KECCAK1600_CTX *)vctx, out, outlen);
-}
-
-static PROV_SHA3_METHOD sha3_generic_md = {
-    generic_sha3_absorb,
-    generic_sha3_final,
-    NULL
-};
-
-static PROV_SHA3_METHOD shake_generic_md = {
-    generic_sha3_absorb,
-    generic_sha3_final,
-    generic_sha3_squeeze
-};
-
 #if defined(S390_SHA3)

 static sha3_absorb_fn s390x_sha3_absorb;
@@ -188,79 +159,56 @@ static sha3_final_fn s390x_shake_final;
 /*-
  * The platform specific parts of the absorb() and final() for S390X.
  */
-static size_t s390x_sha3_absorb(void *vctx, const void *inp, size_t len)
+static size_t s390x_sha3_absorb(KECCAK1600_CTX *ctx, const unsigned char *inp, size_t len)
 {
-    KECCAK1600_CTX *ctx = vctx;
     size_t rem = len % ctx->block_size;
     unsigned int fc;

-    if (!(ctx->xof_state == XOF_STATE_INIT || ctx->xof_state == XOF_STATE_ABSORB))
-        return 0;
     if (len - rem > 0) {
         fc = ctx->pad;
         fc |= ctx->xof_state == XOF_STATE_INIT ? S390X_KIMD_NIP : 0;
-        ctx->xof_state = XOF_STATE_ABSORB;
         s390x_kimd(inp, len - rem, fc, ctx->A);
     }
     return rem;
 }

-static int s390x_sha3_final(void *vctx, unsigned char *out, size_t outlen)
+static int s390x_sha3_final(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
 {
-    KECCAK1600_CTX *ctx = vctx;
     unsigned int fc;

-    if (!ossl_prov_is_running())
-        return 0;
-    if (!(ctx->xof_state == XOF_STATE_INIT || ctx->xof_state == XOF_STATE_ABSORB))
-        return 0;
     fc = ctx->pad | S390X_KLMD_DUFOP;
     fc |= ctx->xof_state == XOF_STATE_INIT ? S390X_KLMD_NIP : 0;
-    ctx->xof_state = XOF_STATE_FINAL;
     s390x_klmd(ctx->buf, ctx->bufsz, NULL, 0, fc, ctx->A);
     memcpy(out, ctx->A, outlen);
     return 1;
 }

-static int s390x_shake_final(void *vctx, unsigned char *out, size_t outlen)
+static int s390x_shake_final(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
 {
-    KECCAK1600_CTX *ctx = vctx;
     unsigned int fc;

-    if (!ossl_prov_is_running())
-        return 0;
-    if (!(ctx->xof_state == XOF_STATE_INIT || ctx->xof_state == XOF_STATE_ABSORB))
-        return 0;
     fc = ctx->pad | S390X_KLMD_DUFOP;
     fc |= ctx->xof_state == XOF_STATE_INIT ? S390X_KLMD_NIP : 0;
-    ctx->xof_state = XOF_STATE_FINAL;
     s390x_klmd(ctx->buf, ctx->bufsz, out, outlen, fc, ctx->A);
     return 1;
 }

-static int s390x_shake_squeeze(void *vctx, unsigned char *out, size_t outlen)
+static int s390x_shake_squeeze(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
 {
-    KECCAK1600_CTX *ctx = vctx;
     unsigned int fc;
     size_t len;

-    if (!ossl_prov_is_running())
-        return 0;
-    if (ctx->xof_state == XOF_STATE_FINAL)
-        return 0;
     /*
      * On the first squeeze call, finish the absorb process (incl. padding).
      */
     if (ctx->xof_state != XOF_STATE_SQUEEZE) {
         fc = ctx->pad;
         fc |= ctx->xof_state == XOF_STATE_INIT ? S390X_KLMD_NIP : 0;
-        ctx->xof_state = XOF_STATE_SQUEEZE;
         s390x_klmd(ctx->buf, ctx->bufsz, out, outlen, fc, ctx->A);
         ctx->bufsz = outlen % ctx->block_size;
         /* reuse ctx->bufsz to count bytes squeezed from current sponge */
         return 1;
     }
-    ctx->xof_state = XOF_STATE_SQUEEZE;
     if (ctx->bufsz != 0) {
         len = ctx->block_size - ctx->bufsz;
         if (outlen < len)
@@ -280,22 +228,16 @@ static int s390x_shake_squeeze(void *vctx, unsigned char *out, size_t outlen)
     return 1;
 }

-static int s390x_keccakc_final(void *vctx, unsigned char *out, size_t outlen,
+static int s390x_keccakc_final(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen,
     int padding)
 {
-    KECCAK1600_CTX *ctx = vctx;
     size_t bsz = ctx->block_size;
     size_t num = ctx->bufsz;
     size_t needed = outlen;
     unsigned int fc;

-    if (!ossl_prov_is_running())
-        return 0;
-    if (!(ctx->xof_state == XOF_STATE_INIT || ctx->xof_state == XOF_STATE_ABSORB))
-        return 0;
     fc = ctx->pad;
     fc |= ctx->xof_state == XOF_STATE_INIT ? S390X_KIMD_NIP : 0;
-    ctx->xof_state = XOF_STATE_FINAL;
     if (outlen == 0)
         return 1;
     memset(ctx->buf + num, 0, bsz - num);
@@ -312,27 +254,22 @@ static int s390x_keccakc_final(void *vctx, unsigned char *out, size_t outlen,
     return 1;
 }

-static int s390x_keccak_final(void *vctx, unsigned char *out, size_t outlen)
+static int s390x_keccak_final(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
 {
-    return s390x_keccakc_final(vctx, out, outlen, 0x01);
+    return s390x_keccakc_final(ctx, out, outlen, 0x01);
 }

-static int s390x_kmac_final(void *vctx, unsigned char *out, size_t outlen)
+static int s390x_cshake_keccak_final(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
 {
-    return s390x_keccakc_final(vctx, out, outlen, 0x04);
+    return s390x_keccakc_final(ctx, out, outlen, 0x04);
 }

-static int s390x_keccakc_squeeze(void *vctx, unsigned char *out, size_t outlen,
+static int s390x_keccakc_squeeze(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen,
     int padding)
 {
-    KECCAK1600_CTX *ctx = vctx;
     size_t len;
     unsigned int fc;

-    if (!ossl_prov_is_running())
-        return 0;
-    if (ctx->xof_state == XOF_STATE_FINAL)
-        return 0;
     /*
      * On the first squeeze call, finish the absorb process
      * by adding the trailing padding and then doing
@@ -360,7 +297,6 @@ static int s390x_keccakc_squeeze(void *vctx, unsigned char *out, size_t outlen,
         if (ctx->bufsz == ctx->block_size)
             ctx->bufsz = 0;
     }
-    ctx->xof_state = XOF_STATE_SQUEEZE;
     if (outlen == 0)
         return 1;
     s390x_klmd(NULL, 0, out, outlen, ctx->pad | S390X_KLMD_PS, ctx->A);
@@ -369,14 +305,14 @@ static int s390x_keccakc_squeeze(void *vctx, unsigned char *out, size_t outlen,
     return 1;
 }

-static int s390x_keccak_squeeze(void *vctx, unsigned char *out, size_t outlen)
+static int s390x_keccak_squeeze(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
 {
-    return s390x_keccakc_squeeze(vctx, out, outlen, 0x01);
+    return s390x_keccakc_squeeze(ctx, out, outlen, KECCAK_PADDING);
 }

-static int s390x_kmac_squeeze(void *vctx, unsigned char *out, size_t outlen)
+static int s390x_cshake_keccak_squeeze(KECCAK1600_CTX *ctx, unsigned char *out, size_t outlen)
 {
-    return s390x_keccakc_squeeze(vctx, out, outlen, 0x04);
+    return s390x_keccakc_squeeze(ctx, out, outlen, CSHAKE_KECCAK_PADDING);
 }

 static PROV_SHA3_METHOD sha3_s390x_md = {
@@ -397,10 +333,10 @@ static PROV_SHA3_METHOD shake_s390x_md = {
     s390x_shake_squeeze,
 };

-static PROV_SHA3_METHOD kmac_s390x_md = {
+static PROV_SHA3_METHOD cshake_keccak_s390x_md = {
     s390x_sha3_absorb,
-    s390x_kmac_final,
-    s390x_kmac_squeeze,
+    s390x_cshake_keccak_final,
+    s390x_cshake_keccak_squeeze,
 };

 #define SHAKE_SET_MD(uname, typ)      \
@@ -418,15 +354,15 @@ static PROV_SHA3_METHOD kmac_s390x_md = {
     } else {                         \
         ctx->meth = sha3_generic_md; \
     }
-#define KMAC_SET_MD(bitlen)                  \
+#define CSHAKE_KECCAK_SET_MD(bitlen)         \
     if (S390_SHA3_CAPABLE(SHAKE_##bitlen)) { \
         ctx->pad = S390X_SHAKE_##bitlen;     \
-        ctx->meth = kmac_s390x_md;           \
+        ctx->meth = cshake_keccak_s390x_md;  \
     } else {                                 \
-        ctx->meth = sha3_generic_md;         \
+        ctx->meth = shake_generic_md;        \
     }
 #elif defined(__aarch64__) && defined(KECCAK1600_ASM)
-#include "arm_arch.h"
+#include "arch/arm_arch.h"

 static sha3_absorb_fn armsha3_sha3_absorb;

@@ -435,21 +371,20 @@ size_t SHA3_absorb_cext(uint64_t A[5][5], const unsigned char *inp, size_t len,
 /*-
  * Hardware-assisted ARMv8.2 SHA3 extension version of the absorb()
  */
-static size_t armsha3_sha3_absorb(void *vctx, const void *inp, size_t len)
+static size_t armsha3_sha3_absorb(KECCAK1600_CTX *ctx, const unsigned char *inp, size_t len)
 {
-    KECCAK1600_CTX *ctx = vctx;
-
     return SHA3_absorb_cext(ctx->A, inp, len, ctx->block_size);
 }

 static PROV_SHA3_METHOD sha3_ARMSHA3_md = {
     armsha3_sha3_absorb,
-    generic_sha3_final
+    ossl_sha3_final_default,
+    NULL
 };
 static PROV_SHA3_METHOD shake_ARMSHA3_md = {
     armsha3_sha3_absorb,
-    generic_sha3_final,
-    generic_sha3_squeeze
+    ossl_sha3_final_default,
+    ossl_shake_squeeze_default
 };
 #define SHAKE_SET_MD(uname, typ)                              \
     if (OPENSSL_armcap_P & ARMV8_HAVE_SHA3_AND_WORTH_USING) { \
@@ -464,71 +399,87 @@ static PROV_SHA3_METHOD shake_ARMSHA3_md = {
     } else {                                                  \
         ctx->meth = sha3_generic_md;                          \
     }
-#define KMAC_SET_MD(bitlen)                                   \
+#define CSHAKE_KECCAK_SET_MD(bitlen)                          \
     if (OPENSSL_armcap_P & ARMV8_HAVE_SHA3_AND_WORTH_USING) { \
-        ctx->meth = sha3_ARMSHA3_md;                          \
+        ctx->meth = shake_ARMSHA3_md;                         \
     } else {                                                  \
-        ctx->meth = sha3_generic_md;                          \
+        ctx->meth = shake_generic_md;                         \
     }
 #else
 #define SHA3_SET_MD(uname, typ) ctx->meth = sha3_generic_md;
-#define KMAC_SET_MD(bitlen) ctx->meth = sha3_generic_md;
+#define CSHAKE_KECCAK_SET_MD(bitlen) ctx->meth = shake_generic_md;
 #define SHAKE_SET_MD(uname, typ) ctx->meth = shake_generic_md;
 #endif /* S390_SHA3 */

-#define SHA3_newctx(typ, uname, name, bitlen, pad)                                  \
-    static OSSL_FUNC_digest_newctx_fn name##_newctx;                                \
-    static void *name##_newctx(void *provctx)                                       \
-    {                                                                               \
-        KECCAK1600_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) \
-                                                     : NULL;                        \
-                                                                                    \
-        if (ctx == NULL)                                                            \
-            return NULL;                                                            \
-        ossl_sha3_init(ctx, pad, bitlen);                                           \
-        SHA3_SET_MD(uname, typ)                                                     \
-        return ctx;                                                                 \
+#define SHA3_newctx(typ, uname, name, bitlen, pad)        \
+    static OSSL_FUNC_digest_newctx_fn name##_newctx;      \
+    static void *name##_newctx(void *provctx)             \
+    {                                                     \
+        KECCAK1600_CTX *ctx;                              \
+                                                          \
+        DIGEST_PROV_CHECK(provctx, SHA3_256);             \
+        if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL) \
+            return NULL;                                  \
+        ossl_sha3_init(ctx, pad, bitlen);                 \
+        SHA3_SET_MD(uname, typ)                           \
+        return ctx;                                       \
+    }
+
+#define SHAKE_newctx(typ, uname, name, bitlen, mdlen, pad) \
+    static OSSL_FUNC_digest_newctx_fn name##_newctx;       \
+    static void *name##_newctx(void *provctx)              \
+    {                                                      \
+        KECCAK1600_CTX *ctx;                               \
+                                                           \
+        DIGEST_PROV_CHECK(provctx, SHA3_256);              \
+        if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL)  \
+            return NULL;                                   \
+        ossl_keccak_init(ctx, pad, bitlen, mdlen);         \
+        if (mdlen == 0)                                    \
+            ctx->md_size = SIZE_MAX;                       \
+        SHAKE_SET_MD(uname, typ)                           \
+        return ctx;                                        \
     }

-#define SHAKE_newctx(typ, uname, name, bitlen, mdlen, pad)                          \
-    static OSSL_FUNC_digest_newctx_fn name##_newctx;                                \
-    static void *name##_newctx(void *provctx)                                       \
-    {                                                                               \
-        KECCAK1600_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) \
-                                                     : NULL;                        \
-                                                                                    \
-        if (ctx == NULL)                                                            \
-            return NULL;                                                            \
-        ossl_keccak_init(ctx, pad, bitlen, mdlen);                                  \
-        if (mdlen == 0)                                                             \
-            ctx->md_size = SIZE_MAX;                                                \
-        SHAKE_SET_MD(uname, typ)                                                    \
-        return ctx;                                                                 \
+#define CSHAKE_KECCAK_newctx(uname, bitlen, pad)          \
+    static OSSL_FUNC_digest_newctx_fn uname##_newctx;     \
+    static void *uname##_newctx(void *provctx)            \
+    {                                                     \
+        KECCAK1600_CTX *ctx;                              \
+                                                          \
+        DIGEST_PROV_CHECK(provctx, SHA3_256);             \
+        if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL) \
+            return NULL;                                  \
+        ossl_keccak_init(ctx, pad, bitlen, 2 * bitlen);   \
+        CSHAKE_KECCAK_SET_MD(bitlen)                      \
+        return ctx;                                       \
     }

-#define KMAC_newctx(uname, bitlen, pad)                                             \
-    static OSSL_FUNC_digest_newctx_fn uname##_newctx;                               \
-    static void *uname##_newctx(void *provctx)                                      \
-    {                                                                               \
-        KECCAK1600_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) \
-                                                     : NULL;                        \
-                                                                                    \
-        if (ctx == NULL)                                                            \
-            return NULL;                                                            \
-        ossl_keccak_init(ctx, pad, bitlen, 2 * bitlen);                             \
-        KMAC_SET_MD(bitlen)                                                         \
-        return ctx;                                                                 \
+#define KMAC_newctx(uname, bitlen, pad)                   \
+    static OSSL_FUNC_digest_newctx_fn uname##_newctx;     \
+    static void *uname##_newctx(void *provctx)            \
+    {                                                     \
+        KECCAK1600_CTX *ctx;                              \
+                                                          \
+        DIGEST_PROV_CHECK(provctx, SHA3_256);             \
+        if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL) \
+            return NULL;                                  \
+        ossl_keccak_init(ctx, pad, bitlen, 2 * bitlen);   \
+        KMAC_SET_MD(bitlen)                               \
+        return ctx;                                       \
     }

-#define PROV_FUNC_SHA3_DIGEST_COMMON(name, bitlen, blksize, dgstsize, flags) \
-    PROV_FUNC_DIGEST_GET_PARAM(name, blksize, dgstsize, flags)               \
-    const OSSL_DISPATCH ossl_##name##_functions[] = {                        \
-        { OSSL_FUNC_DIGEST_NEWCTX, (void (*)(void))name##_newctx },          \
-        { OSSL_FUNC_DIGEST_UPDATE, (void (*)(void))keccak_update },          \
-        { OSSL_FUNC_DIGEST_FINAL, (void (*)(void))keccak_final },            \
-        { OSSL_FUNC_DIGEST_FREECTX, (void (*)(void))keccak_freectx },        \
-        { OSSL_FUNC_DIGEST_DUPCTX, (void (*)(void))keccak_dupctx },          \
-        { OSSL_FUNC_DIGEST_COPYCTX, (void (*)(void))keccak_copyctx },        \
+#define PROV_FUNC_SHA3_DIGEST_COMMON(name, bitlen, blksize, dgstsize, flags)  \
+    PROV_FUNC_DIGEST_GET_PARAM(name, blksize, dgstsize, flags)                \
+    const OSSL_DISPATCH ossl_##name##_functions[] = {                         \
+        { OSSL_FUNC_DIGEST_NEWCTX, (void (*)(void))name##_newctx },           \
+        { OSSL_FUNC_DIGEST_UPDATE, (void (*)(void))keccak_update },           \
+        { OSSL_FUNC_DIGEST_FINAL, (void (*)(void))keccak_final },             \
+        { OSSL_FUNC_DIGEST_FREECTX, (void (*)(void))keccak_freectx },         \
+        { OSSL_FUNC_DIGEST_DUPCTX, (void (*)(void))keccak_dupctx },           \
+        { OSSL_FUNC_DIGEST_COPYCTX, (void (*)(void))keccak_copyctx },         \
+        { OSSL_FUNC_DIGEST_SERIALIZE, (void (*)(void))name##_serialize },     \
+        { OSSL_FUNC_DIGEST_DESERIALIZE, (void (*)(void))name##_deserialize }, \
         PROV_DISPATCH_FUNC_DIGEST_GET_PARAMS(name)

 #ifdef FIPS_MODULE
@@ -582,99 +533,219 @@ static void *keccak_dupctx(void *ctx)
     return ret;
 }

+static const unsigned char keccakmagic[] = "KECCAKv1";
+#define KECCAKMAGIC_LEN (sizeof(keccakmagic) - 1)
+#define KECCAK_SERIALIZATION_LEN                                                     \
+    (                                                                                \
+        KECCAKMAGIC_LEN /* magic string */                                           \
+        + sizeof(uint64_t) /* impl-ID */                                             \
+        + sizeof(uint64_t) /* c->md_size */                                          \
+        + (sizeof(uint64_t) * 4) /* c->block_size, c->bufsz, c->pad, c->xof_state */ \
+        + (sizeof(uint64_t) * 5 * 5) /* c->A */                                      \
+        + (KECCAK1600_WIDTH / 8 - 32) /* c->buf */                                   \
+    )
+
+static int KECCAK_Serialize(KECCAK1600_CTX *c, int impl_id,
+    unsigned char *output, size_t *outlen)
+{
+    unsigned char *p;
+    int i, j;
+
+    if (output == NULL) {
+        if (outlen == NULL)
+            return 0;
+
+        *outlen = KECCAK_SERIALIZATION_LEN;
+        return 1;
+    }
+
+    if (outlen != NULL && *outlen < KECCAK_SERIALIZATION_LEN)
+        return 0;
+
+    p = output;
+
+    /* Magic code */
+    memcpy(p, keccakmagic, KECCAKMAGIC_LEN);
+    p += KECCAKMAGIC_LEN;
+
+    /* Additional check data */
+    p = OPENSSL_store_u64_le(p, impl_id);
+    p = OPENSSL_store_u64_le(p, c->md_size);
+
+    p = OPENSSL_store_u64_le(p, c->block_size);
+    p = OPENSSL_store_u64_le(p, c->bufsz);
+    p = OPENSSL_store_u64_le(p, c->pad);
+    p = OPENSSL_store_u64_le(p, c->xof_state);
+
+    /* A matrix */
+    for (i = 0; i < 5; i++) {
+        for (j = 0; j < 5; j++)
+            p = OPENSSL_store_u64_le(p, c->A[i][j]);
+    }
+
+    if (outlen != NULL)
+        *outlen = KECCAK_SERIALIZATION_LEN;
+
+    /* buf */
+    memcpy(p, c->buf, sizeof(c->buf));
+
+    return 1;
+}
+
+/*
+ * This function only performs basic input sanity checks and is not
+ * built to handle malicious input data. Only trusted input should be
+ * fed to this function
+ */
+static int KECCAK_Deserialize(KECCAK1600_CTX *c, int impl_id,
+    const unsigned char *input, size_t len)
+{
+    const unsigned char *p;
+    uint64_t val;
+    int i, j;
+
+    if (c == NULL || input == NULL || len != KECCAK_SERIALIZATION_LEN)
+        return 0;
+
+    /* Magic code */
+    if (memcmp(input, keccakmagic, KECCAKMAGIC_LEN) != 0)
+        return 0;
+
+    p = input + KECCAKMAGIC_LEN;
+
+    /* Check for matching Impl ID */
+    p = OPENSSL_load_u64_le(&val, p);
+    if (val != (uint64_t)impl_id)
+        return 0;
+
+    /* Check for matching md_size */
+    p = OPENSSL_load_u64_le(&val, p);
+    if (val != (uint64_t)c->md_size)
+        return 0;
+
+    /* check that block_size is congruent with the initialized value */
+    p = OPENSSL_load_u64_le(&val, p);
+    if (val != c->block_size)
+        return 0;
+    /* check that bufsz does not exceed block_size */
+    p = OPENSSL_load_u64_le(&val, p);
+    if (val > c->block_size)
+        return 0;
+    c->bufsz = (size_t)val;
+    p = OPENSSL_load_u64_le(&val, p);
+    if (val != c->pad)
+        return 0;
+    p = OPENSSL_load_u64_le(&val, p);
+    c->xof_state = (int)val;
+
+    /* A matrix */
+    for (i = 0; i < 5; i++) {
+        for (j = 0; j < 5; j++) {
+            p = OPENSSL_load_u64_le(&val, p);
+            c->A[i][j] = val;
+        }
+    }
+
+    /* buf */
+    memcpy(c->buf, p, sizeof(c->buf));
+
+    return 1;
+}
+
+#define IMPLEMENT_SERIALIZE_FNS(name, id)                              \
+    static int name##_serialize(void *vctx, unsigned char *out,        \
+        size_t *outlen)                                                \
+    {                                                                  \
+        return KECCAK_Serialize(vctx, id, out, outlen);                \
+    }                                                                  \
+    static int name##_deserialize(void *vctx, const unsigned char *in, \
+        size_t inlen)                                                  \
+    {                                                                  \
+        return KECCAK_Deserialize(vctx, id, in, inlen);                \
+    }
+
 static const OSSL_PARAM *shake_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_shake_gettable_ctx_params[] = {
-        { OSSL_DIGEST_PARAM_XOFLEN, OSSL_PARAM_UNSIGNED_INTEGER, NULL, 0, 0 },
-        { OSSL_DIGEST_PARAM_SIZE, OSSL_PARAM_UNSIGNED_INTEGER, NULL, 0, 0 },
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_shake_gettable_ctx_params;
+    return shake_get_ctx_params_list;
 }

 static int shake_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    struct shake_get_ctx_params_st p;
     KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)vctx;

-    if (ctx == NULL)
+    if (ctx == NULL || !shake_get_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_XOFLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->md_size)) {
+    if (p.xoflen != NULL && !OSSL_PARAM_set_size_t(p.xoflen, ctx->md_size)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
         return 0;
     }
-    /* Size is an alias of xoflen */
-    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_SIZE);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->md_size)) {
+    /* Size is an alias of xoflen but separate them for compatibility */
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, ctx->md_size)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
         return 0;
     }
-    return OSSL_FIPS_IND_GET_CTX_PARAM_APPROVED(ctx, params);
+    return 1;
 }

 static const OSSL_PARAM *shake_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_shake_settable_ctx_params[] = {
-        { OSSL_DIGEST_PARAM_XOFLEN, OSSL_PARAM_UNSIGNED_INTEGER, NULL, 0, 0 },
-        { OSSL_DIGEST_PARAM_SIZE, OSSL_PARAM_UNSIGNED_INTEGER, NULL, 0, 0 },
-        OSSL_PARAM_END
-    };
-
-    return known_shake_settable_ctx_params;
+    return shake_set_ctx_params_list;
 }

 static int shake_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p;
+    struct shake_set_ctx_params_st p;
     KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)vctx;

-    if (ctx == NULL)
+    if (ossl_unlikely(ctx == NULL || !shake_set_ctx_params_decoder(params, &p)))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;
-
-    p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_XOFLEN);
-    if (p == NULL)
-        p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_SIZE);

-    if (p != NULL && !OSSL_PARAM_get_size_t(p, &ctx->md_size)) {
+    if (ossl_unlikely(p.xoflen != NULL
+            && !OSSL_PARAM_get_size_t(p.xoflen, &ctx->md_size))) {
         ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
         return 0;
     }
     return 1;
 }

-#define IMPLEMENT_SHA3_functions(bitlen)                            \
-    SHA3_newctx(sha3, SHA3_##bitlen, sha3_##bitlen, bitlen, '\x06') \
-        PROV_FUNC_SHA3_DIGEST(sha3_##bitlen, bitlen,                \
-            SHA3_BLOCKSIZE(bitlen), SHA3_MDSIZE(bitlen),            \
-            SHA3_FLAGS)
-
-#define IMPLEMENT_KECCAK_functions(bitlen)                                \
-    SHA3_newctx(keccak, KECCAK_##bitlen, keccak_##bitlen, bitlen, '\x01') \
-        PROV_FUNC_SHA3_DIGEST(keccak_##bitlen, bitlen,                    \
-            SHA3_BLOCKSIZE(bitlen), SHA3_MDSIZE(bitlen),                  \
-            SHA3_FLAGS)
-
-#define IMPLEMENT_SHAKE_functions(bitlen)                       \
-    SHAKE_newctx(shake, SHAKE_##bitlen, shake_##bitlen, bitlen, \
-        0 /* no default md length */, '\x1f')                   \
-        PROV_FUNC_SHAKE_DIGEST(shake_##bitlen, bitlen,          \
-            SHA3_BLOCKSIZE(bitlen), 0,                          \
-            SHAKE_FLAGS)
-
-#define IMPLEMENT_KMAC_functions(bitlen)                     \
-    KMAC_newctx(keccak_kmac_##bitlen, bitlen, '\x04')        \
-        PROV_FUNC_SHAKE_DIGEST(keccak_kmac_##bitlen, bitlen, \
-            SHA3_BLOCKSIZE(bitlen), KMAC_MDSIZE(bitlen),     \
-            KMAC_FLAGS)
+#define KECCAK_SER_ID 0x010000
+#define SHAKE_SER_ID 0x020000
+#define SHA3_SER_ID 0x040000
+#define CSHAKE_KECCAK_SER_ID 0x080000
+
+#define IMPLEMENT_SHA3_functions(bitlen)                                           \
+    SHA3_newctx(sha3, SHA3_##bitlen, sha3_##bitlen, bitlen, (uint8_t)SHA3_PADDING) \
+        IMPLEMENT_SERIALIZE_FNS(sha3_##bitlen, SHA3_SER_ID + bitlen)               \
+            PROV_FUNC_SHA3_DIGEST(sha3_##bitlen, bitlen,                           \
+                SHA3_BLOCKSIZE(bitlen), SHA3_MDSIZE(bitlen),                       \
+                SHA3_FLAGS)
+
+#define IMPLEMENT_KECCAK_functions(bitlen)                                                 \
+    SHA3_newctx(keccak, KECCAK_##bitlen, keccak_##bitlen, bitlen, (uint8_t)KECCAK_PADDING) \
+        IMPLEMENT_SERIALIZE_FNS(keccak_##bitlen, KECCAK_SER_ID + bitlen)                   \
+            PROV_FUNC_SHA3_DIGEST(keccak_##bitlen, bitlen,                                 \
+                SHA3_BLOCKSIZE(bitlen), SHA3_MDSIZE(bitlen),                               \
+                SHA3_FLAGS)
+
+#define IMPLEMENT_SHAKE_functions(bitlen)                              \
+    SHAKE_newctx(shake, SHAKE_##bitlen, shake_##bitlen, bitlen,        \
+        0 /* no default md length */, (uint8_t)SHAKE_PADDING)          \
+        IMPLEMENT_SERIALIZE_FNS(shake_##bitlen, SHAKE_SER_ID + bitlen) \
+            PROV_FUNC_SHAKE_DIGEST(shake_##bitlen, bitlen,             \
+                SHA3_BLOCKSIZE(bitlen), 0,                             \
+                SHAKE_FLAGS)
+
+#define IMPLEMENT_CSHAKE_KECCAK_functions(bitlen)                                        \
+    CSHAKE_KECCAK_newctx(cshake_keccak_##bitlen, bitlen, (uint8_t)CSHAKE_KECCAK_PADDING) \
+        IMPLEMENT_SERIALIZE_FNS(cshake_keccak_##bitlen, CSHAKE_KECCAK_SER_ID + bitlen)   \
+            PROV_FUNC_SHAKE_DIGEST(cshake_keccak_##bitlen, bitlen,                       \
+                SHA3_BLOCKSIZE(bitlen),                                                  \
+                CSHAKE_KECCAK_MDSIZE(bitlen),                                            \
+                CSHAKE_KECCAK_FLAGS)

 /* ossl_sha3_224_functions */
 IMPLEMENT_SHA3_functions(224)
@@ -696,7 +767,7 @@ IMPLEMENT_KECCAK_functions(512)
 IMPLEMENT_SHAKE_functions(128)
 /* ossl_shake_256_functions */
 IMPLEMENT_SHAKE_functions(256)
-/* ossl_keccak_kmac_128_functions */
-IMPLEMENT_KMAC_functions(128)
-/* ossl_keccak_kmac_256_functions */
-IMPLEMENT_KMAC_functions(256)
+/* ossl_cshake_keccak_128_functions */
+IMPLEMENT_CSHAKE_KECCAK_functions(128)
+    /* ossl_cshake_keccak_256_functions */
+    IMPLEMENT_CSHAKE_KECCAK_functions(256)
diff --git a/deps/openssl/openssl/providers/implementations/digests/sha3_prov.inc.in b/deps/openssl/openssl/providers/implementations/digests/sha3_prov.inc.in
new file mode 100644
index 00000000000..b09ec090d4a
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/digests/sha3_prov.inc.in
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('shake_get_ctx_params',
+                         (['OSSL_DIGEST_PARAM_XOFLEN',   'xoflen',   'size_t'],
+                          ['OSSL_DIGEST_PARAM_SIZE',     'size',     'size_t'],
+                          ['OSSL_DIGEST_PARAM_FIPS_APPROVED_INDICATOR', 'fips indicator', 'int'],
+                         )); -}
+
+{- produce_param_decoder('shake_set_ctx_params',
+                         (['OSSL_DIGEST_PARAM_XOFLEN',   'xoflen',   'size_t'],
+                          ['OSSL_DIGEST_PARAM_SIZE',     'xoflen',   'size_t'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/build.info b/deps/openssl/openssl/providers/implementations/encode_decode/build.info
index a1529fdf125..2347ef865f3 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/build.info
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/build.info
@@ -19,6 +19,10 @@ IF[{- !$disabled{ec} -}]
 ENDIF
 DEPEND[encode_key2any.o]=../../common/include/prov/der_rsa.h

+IF[{- !$disabled{lms} -}]
+  SOURCE[$DECODER_GOAL]=decode_lmsxdr2key.c lms_codecs.c
+ENDIF
+
 IF[{- !$disabled{'ml-dsa'} -}]
   SOURCE[$DECODER_GOAL]=ml_dsa_codecs.c
 ENDIF
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/decode_der2key.c b/deps/openssl/openssl/providers/implementations/encode_decode/decode_der2key.c
index 91313df64c7..6ed99e68fa5 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/decode_der2key.c
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/decode_der2key.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -40,10 +40,12 @@
 #include "openssl/obj_mac.h"
 #include "prov/bio.h"
 #include "prov/implementations.h"
-#include "endecoder_local.h"
+#include "prov/endecoder_local.h"
 #include "internal/nelem.h"
-#include "ml_dsa_codecs.h"
-#include "ml_kem_codecs.h"
+#include "prov/ml_dsa_codecs.h"
+#include "prov/ml_kem_codecs.h"
+#include "prov/lms_codecs.h"
+#include "providers/implementations/encode_decode/decode_der2key.inc"

 #ifndef OPENSSL_NO_SLH_DSA
 typedef struct {
@@ -171,21 +173,21 @@ der2key_newctx(void *provctx, const struct keytype_desc_st *desc)

 static const OSSL_PARAM *der2key_settable_ctx_params(ossl_unused void *provctx)
 {
-    static const OSSL_PARAM settables[] = {
-        OSSL_PARAM_utf8_string(OSSL_DECODER_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return settables;
+    return der2key_set_ctx_params_list;
 }

 static int der2key_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     struct der2key_ctx_st *ctx = vctx;
-    const OSSL_PARAM *p;
-    char *str = ctx->propq;
+    struct der2key_set_ctx_params_st p;
+    char *str;
+
+    if (ctx == NULL || !der2key_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_DECODER_PARAM_PROPERTIES);
-    if (p != NULL && !OSSL_PARAM_get_utf8_string(p, &str, sizeof(ctx->propq)))
+    str = ctx->propq;
+    if (p.propq != NULL
+        && !OSSL_PARAM_get_utf8_string(p.propq, &str, sizeof(ctx->propq)))
         return 0;

     return 1;
@@ -402,11 +404,16 @@ static int der2key_export_object(void *vctx,
 /* ---------------------------------------------------------------------- */

 #ifndef OPENSSL_NO_DH
+static void dh_free_key(void *key)
+{
+    DH_free(key);
+}
+
 #define dh_evp_type EVP_PKEY_DH
 #define dh_d2i_private_key NULL
 #define dh_d2i_public_key NULL
 #define dh_d2i_key_params (d2i_of_void *)d2i_DHparams
-#define dh_free (free_key_fn *)DH_free
+#define dh_free dh_free_key
 #define dh_check NULL

 static void *dh_d2i_PKCS8(const unsigned char **der, long der_len,
@@ -429,7 +436,7 @@ static void dh_adjust(void *key, struct der2key_ctx_st *ctx)
 #define dhx_d2i_public_key NULL
 #define dhx_d2i_key_params (d2i_of_void *)d2i_DHxparams
 #define dhx_d2i_PKCS8 dh_d2i_PKCS8
-#define dhx_free (free_key_fn *)DH_free
+#define dhx_free dh_free_key
 #define dhx_check NULL
 #define dhx_adjust dh_adjust
 #endif
@@ -437,11 +444,16 @@ static void dh_adjust(void *key, struct der2key_ctx_st *ctx)
 /* ---------------------------------------------------------------------- */

 #ifndef OPENSSL_NO_DSA
+static void dsa_free_key(void *key)
+{
+    DSA_free(key);
+}
+
 #define dsa_evp_type EVP_PKEY_DSA
 #define dsa_d2i_private_key (d2i_of_void *)d2i_DSAPrivateKey
 #define dsa_d2i_public_key (d2i_of_void *)d2i_DSAPublicKey
 #define dsa_d2i_key_params (d2i_of_void *)d2i_DSAparams
-#define dsa_free (free_key_fn *)DSA_free
+#define dsa_free dsa_free_key
 #define dsa_check NULL

 static void *dsa_d2i_PKCS8(const unsigned char **der, long der_len,
@@ -462,11 +474,16 @@ static void dsa_adjust(void *key, struct der2key_ctx_st *ctx)
 /* ---------------------------------------------------------------------- */

 #ifndef OPENSSL_NO_EC
+static void ec_free_key(void *key)
+{
+    EC_KEY_free(key);
+}
+
 #define ec_evp_type EVP_PKEY_EC
 #define ec_d2i_private_key (d2i_of_void *)d2i_ECPrivateKey
 #define ec_d2i_public_key NULL
 #define ec_d2i_key_params (d2i_of_void *)d2i_ECParameters
-#define ec_free (free_key_fn *)EC_KEY_free
+#define ec_free ec_free_key

 static void *ec_d2i_PKCS8(const unsigned char **der, long der_len,
     struct der2key_ctx_st *ctx)
@@ -520,12 +537,17 @@ static void ecx_key_adjust(void *key, struct der2key_ctx_st *ctx)
     ossl_ecx_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
 }

+static void ecx_free_key(void *key)
+{
+    ossl_ecx_key_free(key);
+}
+
 #define ed25519_evp_type EVP_PKEY_ED25519
 #define ed25519_d2i_private_key NULL
 #define ed25519_d2i_public_key NULL
 #define ed25519_d2i_key_params NULL
 #define ed25519_d2i_PKCS8 ecx_d2i_PKCS8
-#define ed25519_free (free_key_fn *)ossl_ecx_key_free
+#define ed25519_free ecx_free_key
 #define ed25519_check NULL
 #define ed25519_adjust ecx_key_adjust

@@ -534,7 +556,7 @@ static void ecx_key_adjust(void *key, struct der2key_ctx_st *ctx)
 #define ed448_d2i_public_key NULL
 #define ed448_d2i_key_params NULL
 #define ed448_d2i_PKCS8 ecx_d2i_PKCS8
-#define ed448_free (free_key_fn *)ossl_ecx_key_free
+#define ed448_free ecx_free_key
 #define ed448_check NULL
 #define ed448_adjust ecx_key_adjust

@@ -543,7 +565,7 @@ static void ecx_key_adjust(void *key, struct der2key_ctx_st *ctx)
 #define x25519_d2i_public_key NULL
 #define x25519_d2i_key_params NULL
 #define x25519_d2i_PKCS8 ecx_d2i_PKCS8
-#define x25519_free (free_key_fn *)ossl_ecx_key_free
+#define x25519_free ecx_free_key
 #define x25519_check NULL
 #define x25519_adjust ecx_key_adjust

@@ -552,7 +574,7 @@ static void ecx_key_adjust(void *key, struct der2key_ctx_st *ctx)
 #define x448_d2i_public_key NULL
 #define x448_d2i_key_params NULL
 #define x448_d2i_PKCS8 ecx_d2i_PKCS8
-#define x448_free (free_key_fn *)ossl_ecx_key_free
+#define x448_free ecx_free_key
 #define x448_check NULL
 #define x448_adjust ecx_key_adjust
 #endif /* OPENSSL_NO_ECX */
@@ -563,7 +585,7 @@ static void ecx_key_adjust(void *key, struct der2key_ctx_st *ctx)
 #define sm2_d2i_public_key NULL
 #define sm2_d2i_key_params (d2i_of_void *)d2i_ECParameters
 #define sm2_d2i_PUBKEY ec_d2i_PUBKEY
-#define sm2_free (free_key_fn *)EC_KEY_free
+#define sm2_free ec_free_key
 #define sm2_check ec_check
 #define sm2_adjust ec_adjust

@@ -605,13 +627,18 @@ ml_kem_d2i_PUBKEY(const uint8_t **der, long der_len,
     return key;
 }

+static void ml_kem_free_key(void *key)
+{
+    ossl_ml_kem_key_free(key);
+}
+
 #define ml_kem_512_evp_type EVP_PKEY_ML_KEM_512
 #define ml_kem_512_d2i_private_key NULL
 #define ml_kem_512_d2i_public_key NULL
 #define ml_kem_512_d2i_key_params NULL
 #define ml_kem_512_d2i_PUBKEY ml_kem_d2i_PUBKEY
 #define ml_kem_512_d2i_PKCS8 ml_kem_d2i_PKCS8
-#define ml_kem_512_free (free_key_fn *)ossl_ml_kem_key_free
+#define ml_kem_512_free ml_kem_free_key
 #define ml_kem_512_check NULL
 #define ml_kem_512_adjust NULL

@@ -621,7 +648,7 @@ ml_kem_d2i_PUBKEY(const uint8_t **der, long der_len,
 #define ml_kem_768_d2i_key_params NULL
 #define ml_kem_768_d2i_PUBKEY ml_kem_d2i_PUBKEY
 #define ml_kem_768_d2i_PKCS8 ml_kem_d2i_PKCS8
-#define ml_kem_768_free (free_key_fn *)ossl_ml_kem_key_free
+#define ml_kem_768_free ml_kem_free_key
 #define ml_kem_768_check NULL
 #define ml_kem_768_adjust NULL

@@ -631,13 +658,18 @@ ml_kem_d2i_PUBKEY(const uint8_t **der, long der_len,
 #define ml_kem_1024_d2i_PUBKEY ml_kem_d2i_PUBKEY
 #define ml_kem_1024_d2i_PKCS8 ml_kem_d2i_PKCS8
 #define ml_kem_1024_d2i_key_params NULL
-#define ml_kem_1024_free (free_key_fn *)ossl_ml_kem_key_free
+#define ml_kem_1024_free ml_kem_free_key
 #define ml_kem_1024_check NULL
 #define ml_kem_1024_adjust NULL

 #endif

 #ifndef OPENSSL_NO_SLH_DSA
+static void slh_dsa_free_key(void *key)
+{
+    ossl_slh_dsa_key_free(key);
+}
+
 static void *
 slh_dsa_d2i_PKCS8(const uint8_t **der, long der_len, struct der2key_ctx_st *ctx)
 {
@@ -766,7 +798,7 @@ err:
 #define slh_dsa_sha2_128s_d2i_key_params NULL
 #define slh_dsa_sha2_128s_d2i_PKCS8 slh_dsa_d2i_PKCS8
 #define slh_dsa_sha2_128s_d2i_PUBKEY slh_dsa_d2i_PUBKEY
-#define slh_dsa_sha2_128s_free (free_key_fn *)ossl_slh_dsa_key_free
+#define slh_dsa_sha2_128s_free slh_dsa_free_key
 #define slh_dsa_sha2_128s_check NULL
 #define slh_dsa_sha2_128s_adjust NULL

@@ -776,7 +808,7 @@ err:
 #define slh_dsa_sha2_128f_d2i_key_params NULL
 #define slh_dsa_sha2_128f_d2i_PKCS8 slh_dsa_d2i_PKCS8
 #define slh_dsa_sha2_128f_d2i_PUBKEY slh_dsa_d2i_PUBKEY
-#define slh_dsa_sha2_128f_free (free_key_fn *)ossl_slh_dsa_key_free
+#define slh_dsa_sha2_128f_free slh_dsa_free_key
 #define slh_dsa_sha2_128f_check NULL
 #define slh_dsa_sha2_128f_adjust NULL

@@ -786,7 +818,7 @@ err:
 #define slh_dsa_sha2_192s_d2i_key_params NULL
 #define slh_dsa_sha2_192s_d2i_PKCS8 slh_dsa_d2i_PKCS8
 #define slh_dsa_sha2_192s_d2i_PUBKEY slh_dsa_d2i_PUBKEY
-#define slh_dsa_sha2_192s_free (free_key_fn *)ossl_slh_dsa_key_free
+#define slh_dsa_sha2_192s_free slh_dsa_free_key
 #define slh_dsa_sha2_192s_check NULL
 #define slh_dsa_sha2_192s_adjust NULL

@@ -796,7 +828,7 @@ err:
 #define slh_dsa_sha2_192f_d2i_key_params NULL
 #define slh_dsa_sha2_192f_d2i_PKCS8 slh_dsa_d2i_PKCS8
 #define slh_dsa_sha2_192f_d2i_PUBKEY slh_dsa_d2i_PUBKEY
-#define slh_dsa_sha2_192f_free (free_key_fn *)ossl_slh_dsa_key_free
+#define slh_dsa_sha2_192f_free slh_dsa_free_key
 #define slh_dsa_sha2_192f_check NULL
 #define slh_dsa_sha2_192f_adjust NULL

@@ -806,7 +838,7 @@ err:
 #define slh_dsa_sha2_256s_d2i_key_params NULL
 #define slh_dsa_sha2_256s_d2i_PKCS8 slh_dsa_d2i_PKCS8
 #define slh_dsa_sha2_256s_d2i_PUBKEY slh_dsa_d2i_PUBKEY
-#define slh_dsa_sha2_256s_free (free_key_fn *)ossl_slh_dsa_key_free
+#define slh_dsa_sha2_256s_free slh_dsa_free_key
 #define slh_dsa_sha2_256s_check NULL
 #define slh_dsa_sha2_256s_adjust NULL

@@ -816,7 +848,7 @@ err:
 #define slh_dsa_sha2_256f_d2i_key_params NULL
 #define slh_dsa_sha2_256f_d2i_PKCS8 slh_dsa_d2i_PKCS8
 #define slh_dsa_sha2_256f_d2i_PUBKEY slh_dsa_d2i_PUBKEY
-#define slh_dsa_sha2_256f_free (free_key_fn *)ossl_slh_dsa_key_free
+#define slh_dsa_sha2_256f_free slh_dsa_free_key
 #define slh_dsa_sha2_256f_check NULL
 #define slh_dsa_sha2_256f_adjust NULL

@@ -826,7 +858,7 @@ err:
 #define slh_dsa_shake_128s_d2i_key_params NULL
 #define slh_dsa_shake_128s_d2i_PKCS8 slh_dsa_d2i_PKCS8
 #define slh_dsa_shake_128s_d2i_PUBKEY slh_dsa_d2i_PUBKEY
-#define slh_dsa_shake_128s_free (free_key_fn *)ossl_slh_dsa_key_free
+#define slh_dsa_shake_128s_free slh_dsa_free_key
 #define slh_dsa_shake_128s_check NULL
 #define slh_dsa_shake_128s_adjust NULL

@@ -836,7 +868,7 @@ err:
 #define slh_dsa_shake_128f_d2i_key_params NULL
 #define slh_dsa_shake_128f_d2i_PKCS8 slh_dsa_d2i_PKCS8
 #define slh_dsa_shake_128f_d2i_PUBKEY slh_dsa_d2i_PUBKEY
-#define slh_dsa_shake_128f_free (free_key_fn *)ossl_slh_dsa_key_free
+#define slh_dsa_shake_128f_free slh_dsa_free_key
 #define slh_dsa_shake_128f_check NULL
 #define slh_dsa_shake_128f_adjust NULL

@@ -846,7 +878,7 @@ err:
 #define slh_dsa_shake_192s_d2i_key_params NULL
 #define slh_dsa_shake_192s_d2i_PKCS8 slh_dsa_d2i_PKCS8
 #define slh_dsa_shake_192s_d2i_PUBKEY slh_dsa_d2i_PUBKEY
-#define slh_dsa_shake_192s_free (free_key_fn *)ossl_slh_dsa_key_free
+#define slh_dsa_shake_192s_free slh_dsa_free_key
 #define slh_dsa_shake_192s_check NULL
 #define slh_dsa_shake_192s_adjust NULL

@@ -856,7 +888,7 @@ err:
 #define slh_dsa_shake_192f_d2i_key_params NULL
 #define slh_dsa_shake_192f_d2i_PKCS8 slh_dsa_d2i_PKCS8
 #define slh_dsa_shake_192f_d2i_PUBKEY slh_dsa_d2i_PUBKEY
-#define slh_dsa_shake_192f_free (free_key_fn *)ossl_slh_dsa_key_free
+#define slh_dsa_shake_192f_free slh_dsa_free_key
 #define slh_dsa_shake_192f_check NULL
 #define slh_dsa_shake_192f_adjust NULL

@@ -866,7 +898,7 @@ err:
 #define slh_dsa_shake_256s_d2i_key_params NULL
 #define slh_dsa_shake_256s_d2i_PKCS8 slh_dsa_d2i_PKCS8
 #define slh_dsa_shake_256s_d2i_PUBKEY slh_dsa_d2i_PUBKEY
-#define slh_dsa_shake_256s_free (free_key_fn *)ossl_slh_dsa_key_free
+#define slh_dsa_shake_256s_free slh_dsa_free_key
 #define slh_dsa_shake_256s_check NULL
 #define slh_dsa_shake_256s_adjust NULL

@@ -876,18 +908,23 @@ err:
 #define slh_dsa_shake_256f_d2i_key_params NULL
 #define slh_dsa_shake_256f_d2i_PKCS8 slh_dsa_d2i_PKCS8
 #define slh_dsa_shake_256f_d2i_PUBKEY slh_dsa_d2i_PUBKEY
-#define slh_dsa_shake_256f_free (free_key_fn *)ossl_slh_dsa_key_free
+#define slh_dsa_shake_256f_free slh_dsa_free_key
 #define slh_dsa_shake_256f_check NULL
 #define slh_dsa_shake_256f_adjust NULL
 #endif /* OPENSSL_NO_SLH_DSA */

 /* ---------------------------------------------------------------------- */

+static void rsa_free_key(void *key)
+{
+    RSA_free(key);
+}
+
 #define rsa_evp_type EVP_PKEY_RSA
 #define rsa_d2i_private_key (d2i_of_void *)d2i_RSAPrivateKey
 #define rsa_d2i_public_key (d2i_of_void *)d2i_RSAPublicKey
 #define rsa_d2i_key_params NULL
-#define rsa_free (free_key_fn *)RSA_free
+#define rsa_free rsa_free_key

 static void *rsa_d2i_PKCS8(const unsigned char **der, long der_len,
     struct der2key_ctx_st *ctx)
@@ -935,13 +972,18 @@ static void rsa_adjust(void *key, struct der2key_ctx_st *ctx)
 #define rsapss_d2i_key_params NULL
 #define rsapss_d2i_PKCS8 rsa_d2i_PKCS8
 #define rsapss_d2i_PUBKEY rsa_d2i_PUBKEY
-#define rsapss_free (free_key_fn *)RSA_free
+#define rsapss_free rsa_free_key
 #define rsapss_check rsa_check
 #define rsapss_adjust rsa_adjust

 /* ---------------------------------------------------------------------- */

 #ifndef OPENSSL_NO_ML_DSA
+static void ml_dsa_free_key(void *key)
+{
+    ossl_ml_dsa_key_free(key);
+}
+
 static void *
 ml_dsa_d2i_PKCS8(const uint8_t **der, long der_len, struct der2key_ctx_st *ctx)
 {
@@ -972,7 +1014,7 @@ static ossl_inline void *ml_dsa_d2i_PUBKEY(const uint8_t **der, long der_len,
 #define ml_dsa_44_d2i_key_params NULL
 #define ml_dsa_44_d2i_PUBKEY ml_dsa_d2i_PUBKEY
 #define ml_dsa_44_d2i_PKCS8 ml_dsa_d2i_PKCS8
-#define ml_dsa_44_free (free_key_fn *)ossl_ml_dsa_key_free
+#define ml_dsa_44_free ml_dsa_free_key
 #define ml_dsa_44_check NULL
 #define ml_dsa_44_adjust NULL

@@ -982,7 +1024,7 @@ static ossl_inline void *ml_dsa_d2i_PUBKEY(const uint8_t **der, long der_len,
 #define ml_dsa_65_d2i_key_params NULL
 #define ml_dsa_65_d2i_PUBKEY ml_dsa_d2i_PUBKEY
 #define ml_dsa_65_d2i_PKCS8 ml_dsa_d2i_PKCS8
-#define ml_dsa_65_free (free_key_fn *)ossl_ml_dsa_key_free
+#define ml_dsa_65_free ml_dsa_free_key
 #define ml_dsa_65_check NULL
 #define ml_dsa_65_adjust NULL

@@ -992,7 +1034,7 @@ static ossl_inline void *ml_dsa_d2i_PUBKEY(const uint8_t **der, long der_len,
 #define ml_dsa_87_d2i_PUBKEY ml_dsa_d2i_PUBKEY
 #define ml_dsa_87_d2i_PKCS8 ml_dsa_d2i_PKCS8
 #define ml_dsa_87_d2i_key_params NULL
-#define ml_dsa_87_free (free_key_fn *)ossl_ml_dsa_key_free
+#define ml_dsa_87_free ml_dsa_free_key
 #define ml_dsa_87_check NULL
 #define ml_dsa_87_adjust NULL

@@ -1000,6 +1042,30 @@ static ossl_inline void *ml_dsa_d2i_PUBKEY(const uint8_t **der, long der_len,

 /* ---------------------------------------------------------------------- */

+#ifndef OPENSSL_NO_LMS
+static void lms_free_key(void *key)
+{
+    ossl_lms_key_free(key);
+}
+
+#define lms_evp_type EVP_PKEY_HSS_LMS
+#define lms_free lms_free_key
+#define lms_check NULL
+#define lms_adjust NULL
+
+static ossl_inline void *lms_d2i_PUBKEY(const uint8_t **der, long der_len,
+    struct der2key_ctx_st *ctx)
+{
+    LMS_KEY *key;
+
+    key = ossl_lms_d2i_PUBKEY(*der, der_len, ctx->provctx);
+    if (key != NULL)
+        *der += der_len;
+    return key;
+}
+#endif
+/* ---------------------------------------------------------------------- */
+
 /*
  * The DO_ macros help define the selection mask and the method functions
  * for each kind of object we want to decode.
@@ -1302,3 +1368,7 @@ MAKE_DECODER("ML-DSA-65", ml_dsa_65, ml_dsa_65, SubjectPublicKeyInfo);
 MAKE_DECODER("ML-DSA-87", ml_dsa_87, ml_dsa_87, PrivateKeyInfo);
 MAKE_DECODER("ML-DSA-87", ml_dsa_87, ml_dsa_87, SubjectPublicKeyInfo);
 #endif
+
+#ifndef OPENSSL_NO_LMS
+MAKE_DECODER("LMS", lms, lms, SubjectPublicKeyInfo);
+#endif
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/decode_der2key.inc.in b/deps/openssl/openssl/providers/implementations/encode_decode/decode_der2key.inc.in
new file mode 100644
index 00000000000..96b195564db
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/decode_der2key.inc.in
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('der2key_set_ctx_params',
+                         (['OSSL_DECODER_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/decode_epki2pki.c b/deps/openssl/openssl/providers/implementations/encode_decode/decode_epki2pki.c
index 2f472597978..46a62295a2a 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/decode_epki2pki.c
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/decode_epki2pki.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,12 +17,16 @@
 #include <openssl/pkcs12.h>
 #include <openssl/x509.h>
 #include <openssl/proverr.h>
+#include "internal/cryptlib.h"
 #include "internal/asn1.h"
 #include "internal/sizes.h"
 #include "prov/bio.h"
 #include "prov/decoders.h"
 #include "prov/implementations.h"
-#include "endecoder_local.h"
+#include "prov/endecoder_local.h"
+#include "providers/implementations/encode_decode/decode_epki2pki.inc"
+
+#include <crypto/asn1.h>

 static OSSL_FUNC_decoder_newctx_fn epki2pki_newctx;
 static OSSL_FUNC_decoder_freectx_fn epki2pki_freectx;
@@ -56,21 +60,21 @@ static void epki2pki_freectx(void *vctx)

 static const OSSL_PARAM *epki2pki_settable_ctx_params(ossl_unused void *provctx)
 {
-    static const OSSL_PARAM settables[] = {
-        OSSL_PARAM_utf8_string(OSSL_DECODER_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return settables;
+    return epki2pki_set_ctx_params_list;
 }

 static int epki2pki_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     struct epki2pki_ctx_st *ctx = vctx;
-    const OSSL_PARAM *p;
-    char *str = ctx->propq;
+    struct epki2pki_set_ctx_params_st p;
+    char *str;
+
+    if (ctx == NULL || !epki2pki_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_DECODER_PARAM_PROPERTIES);
-    if (p != NULL && !OSSL_PARAM_get_utf8_string(p, &str, sizeof(ctx->propq)))
+    str = ctx->propq;
+    if (p.propq != NULL
+        && !OSSL_PARAM_get_utf8_string(p.propq, &str, sizeof(ctx->propq)))
         return 0;

     return 1;
@@ -140,7 +144,7 @@ int ossl_epki2pki_der_decode(unsigned char *der, long der_len, int selection,
             int new_der_len = 0;

             X509_SIG_get0(p8, &alg, &oct);
-            if (!PKCS12_pbe_crypt_ex(alg, pbuf, plen,
+            if (!PKCS12_pbe_crypt_ex(alg, pbuf, (int)plen,
                     oct->data, oct->length,
                     &new_der, &new_der_len, 0,
                     libctx, propq)) {
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/decode_epki2pki.inc.in b/deps/openssl/openssl/providers/implementations/encode_decode/decode_epki2pki.inc.in
new file mode 100644
index 00000000000..064c6163a6a
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/decode_epki2pki.inc.in
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('epki2pki_set_ctx_params',
+                         (['OSSL_DECODER_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/decode_lmsxdr2key.c b/deps/openssl/openssl/providers/implementations/encode_decode/decode_lmsxdr2key.c
new file mode 100644
index 00000000000..7aa198bed85
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/decode_lmsxdr2key.c
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/core_object.h>
+#include <openssl/core_names.h>
+#include <openssl/crypto.h>
+#include <openssl/err.h>
+#include <openssl/params.h>
+#include "prov/endecoder_local.h"
+#include "crypto/lms.h"
+#include "prov/bio.h"
+#include "prov/implementations.h"
+
+static OSSL_FUNC_decoder_newctx_fn lmsxdr2key_newctx;
+static OSSL_FUNC_decoder_freectx_fn lmsxdr2key_freectx;
+static OSSL_FUNC_decoder_decode_fn lmsxdr2key_decode;
+static OSSL_FUNC_decoder_export_object_fn lmsxdr2key_export_object;
+
+/* Context used for xdr to key decoding. */
+struct lmsxdr2key_ctx_st {
+    PROV_CTX *provctx;
+    int selection; /* The selection that is passed to lmsxdr2key_decode() */
+};
+
+static void *lmsxdr2key_newctx(void *provctx)
+{
+    struct lmsxdr2key_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
+
+    if (ctx != NULL)
+        ctx->provctx = provctx;
+    return ctx;
+}
+
+static void lmsxdr2key_freectx(void *vctx)
+{
+    struct lmsxdr2key_ctx_st *ctx = vctx;
+
+    OPENSSL_free(ctx);
+}
+
+static int lmsxdr2key_does_selection(void *provctx, int selection)
+{
+    if (selection == 0)
+        return 1;
+
+    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
+        return 1;
+
+    return 0;
+}
+
+static int lmsxdr2key_decode(void *vctx, OSSL_CORE_BIO *cin, int selection,
+    OSSL_CALLBACK *data_cb, void *data_cbarg,
+    OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg)
+{
+    struct lmsxdr2key_ctx_st *ctx = vctx;
+    LMS_KEY *key = NULL;
+    unsigned char buf[LMS_MAX_PUBKEY];
+    size_t length;
+    int ok = 0, inlen, readlen;
+    BIO *in;
+
+    in = ossl_bio_new_from_core_bio(ctx->provctx, cin);
+    if (in == NULL)
+        return 0;
+
+    ctx->selection = selection;
+
+    /* Read the header to determine the size */
+    ERR_set_mark();
+    readlen = BIO_read(in, buf, 4);
+    ERR_pop_to_mark();
+    if (readlen != 4)
+        goto next;
+
+    length = ossl_lms_pubkey_length(buf, 4);
+    if (length <= 4)
+        goto next;
+    inlen = (int)length - 4;
+
+    ERR_set_mark();
+    readlen = BIO_read(in, buf + 4, inlen);
+    ERR_pop_to_mark();
+    if (readlen != inlen)
+        goto next;
+
+    if (selection == 0 || (selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
+        key = ossl_lms_key_new(PROV_LIBCTX_OF(ctx->provctx));
+        if (key == NULL || !ossl_lms_pubkey_decode(buf, length, key)) {
+            ossl_lms_key_free(key);
+            key = NULL;
+        }
+    }
+next:
+    /*
+     * Indicated that we successfully decoded something, or not at all.
+     * Ending up "empty handed" is not an error.
+     */
+    ok = 1;
+
+    /*
+     * We free resources here so it's not held up during the callback, because
+     * we know the process is recursive and the allocated chunks of memory
+     * add up.
+     */
+    BIO_free(in);
+    in = NULL;
+
+    if (key != NULL) {
+        OSSL_PARAM params[4];
+        int object_type = OSSL_OBJECT_PKEY;
+
+        params[0] = OSSL_PARAM_construct_int(OSSL_OBJECT_PARAM_TYPE, &object_type);
+        params[1] = OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
+            (char *)"lms", 0);
+        /* The address of the key becomes the octet string */
+        params[2] = OSSL_PARAM_construct_octet_string(OSSL_OBJECT_PARAM_REFERENCE,
+            &key, sizeof(key));
+        params[3] = OSSL_PARAM_construct_end();
+
+        ok = data_cb(params, data_cbarg);
+    }
+
+    BIO_free(in);
+    ossl_lms_key_free(key);
+    return ok;
+}
+
+static int lmsxdr2key_export_object(void *vctx,
+    const void *reference, size_t reference_sz,
+    OSSL_CALLBACK *export_cb,
+    void *export_cbarg)
+{
+    struct lmsxdr2key_ctx_st *ctx = vctx;
+    OSSL_FUNC_keymgmt_export_fn *export = ossl_prov_get_keymgmt_export(ossl_lms_keymgmt_functions);
+    void *keydata;
+
+    if (reference_sz == sizeof(keydata) && export != NULL) {
+        int selection = ctx->selection;
+
+        if (selection == 0)
+            selection = OSSL_KEYMGMT_SELECT_PUBLIC_KEY;
+        /* The contents of the reference is the address to our object */
+        keydata = *(void **)reference;
+
+        return export(keydata, selection, export_cb, export_cbarg);
+    }
+    return 0;
+}
+
+const OSSL_DISPATCH ossl_xdr_to_lms_decoder_functions[] = {
+    { OSSL_FUNC_DECODER_NEWCTX, (void (*)(void))lmsxdr2key_newctx },
+    { OSSL_FUNC_DECODER_FREECTX, (void (*)(void))lmsxdr2key_freectx },
+    { OSSL_FUNC_DECODER_DOES_SELECTION,
+        (void (*)(void))lmsxdr2key_does_selection },
+    { OSSL_FUNC_DECODER_DECODE, (void (*)(void))lmsxdr2key_decode },
+    { OSSL_FUNC_DECODER_EXPORT_OBJECT,
+        (void (*)(void))lmsxdr2key_export_object },
+    OSSL_DISPATCH_END
+};
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/decode_msblob2key.c b/deps/openssl/openssl/providers/implementations/encode_decode/decode_msblob2key.c
index 87e532acc40..3e91ec87adf 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/decode_msblob2key.c
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/decode_msblob2key.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -28,7 +28,7 @@
 #include "crypto/rsa.h"
 #include "prov/bio.h"
 #include "prov/implementations.h"
-#include "endecoder_local.h"
+#include "prov/endecoder_local.h"

 struct msblob2key_ctx_st; /* Forward declaration */
 typedef void *b2i_of_void_fn(const unsigned char **in, unsigned int bitlen,
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/decode_pem2der.c b/deps/openssl/openssl/providers/implementations/encode_decode/decode_pem2der.c
index 7a8e35004d4..6d82cc333a9 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/decode_pem2der.c
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/decode_pem2der.c
@@ -23,12 +23,14 @@
 #include <openssl/params.h>
 #include <openssl/pem.h>
 #include <openssl/proverr.h>
+#include "internal/cryptlib.h"
 #include "internal/nelem.h"
 #include "internal/sizes.h"
 #include "prov/bio.h"
 #include "prov/decoders.h"
 #include "prov/implementations.h"
-#include "endecoder_local.h"
+#include "prov/endecoder_local.h"
+#include "providers/implementations/encode_decode/decode_pem2der.inc"

 static int read_pem(PROV_CTX *provctx, OSSL_CORE_BIO *cin,
     char **pem_name, char **pem_header,
@@ -76,30 +78,26 @@ static void pem2der_freectx(void *vctx)

 static const OSSL_PARAM *pem2der_settable_ctx_params(ossl_unused void *provctx)
 {
-    static const OSSL_PARAM settables[] = {
-        OSSL_PARAM_utf8_string(OSSL_DECODER_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_OBJECT_PARAM_DATA_STRUCTURE, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return settables;
+    return pem2der_set_ctx_params_list;
 }

 static int pem2der_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     struct pem2der_ctx_st *ctx = vctx;
-    const OSSL_PARAM *p;
+    struct pem2der_set_ctx_params_st p;
     char *str;

-    p = OSSL_PARAM_locate_const(params, OSSL_DECODER_PARAM_PROPERTIES);
+    if (ctx == NULL || !pem2der_set_ctx_params_decoder(params, &p))
+        return 0;
+
     str = ctx->propq;
-    if (p != NULL
-        && !OSSL_PARAM_get_utf8_string(p, &str, sizeof(ctx->propq)))
+    if (p.propq != NULL
+        && !OSSL_PARAM_get_utf8_string(p.propq, &str, sizeof(ctx->propq)))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_STRUCTURE);
     str = ctx->data_structure;
-    if (p != NULL
-        && !OSSL_PARAM_get_utf8_string(p, &str, sizeof(ctx->data_structure)))
+    if (p.ds != NULL
+        && !OSSL_PARAM_get_utf8_string(p.ds, &str, sizeof(ctx->data_structure)))
         return 0;

     return 1;
@@ -131,7 +129,7 @@ static int pem2der_decode(void *vctx, OSSL_CORE_BIO *cin, int selection,
      * PEM names we recognise.  Other PEM names should be recognised by
      * other decoder implementations.
      */
-    static struct pem_name_map_st {
+    static const struct pem_name_map_st {
         const char *pem_name;
         int object_type;
         const char *data_type;
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/decode_pem2der.inc.in b/deps/openssl/openssl/providers/implementations/encode_decode/decode_pem2der.inc.in
new file mode 100644
index 00000000000..20d7e008333
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/decode_pem2der.inc.in
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('pem2der_set_ctx_params',
+                         (['OSSL_DECODER_PARAM_PROPERTIES',    'propq', 'utf8_string'],
+                          ['OSSL_OBJECT_PARAM_DATA_STRUCTURE', 'ds',    'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/decode_pvk2key.c b/deps/openssl/openssl/providers/implementations/encode_decode/decode_pvk2key.c
index 9e8c4f1f4c9..b17565e52f3 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/decode_pvk2key.c
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/decode_pvk2key.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -21,15 +21,18 @@
 #include <openssl/crypto.h>
 #include <openssl/params.h>
 #include <openssl/err.h>
+#include <openssl/proverr.h>
 #include <openssl/pem.h> /* For public PVK functions */
 #include <openssl/x509.h>
+#include "internal/cryptlib.h"
 #include "internal/passphrase.h"
 #include "internal/sizes.h"
 #include "crypto/pem.h" /* For internal PVK and "blob" headers */
 #include "crypto/rsa.h"
 #include "prov/bio.h"
 #include "prov/implementations.h"
-#include "endecoder_local.h"
+#include "prov/endecoder_local.h"
+#include "providers/implementations/encode_decode/decode_pvk2key.inc"

 struct pvk2key_ctx_st; /* Forward declaration */
 typedef int check_key_fn(void *, struct pvk2key_ctx_st *ctx);
@@ -85,21 +88,21 @@ static void pvk2key_freectx(void *vctx)

 static const OSSL_PARAM *pvk2key_settable_ctx_params(ossl_unused void *provctx)
 {
-    static const OSSL_PARAM settables[] = {
-        OSSL_PARAM_utf8_string(OSSL_DECODER_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_END,
-    };
-    return settables;
+    return pvk2key_set_ctx_params_list;
 }

 static int pvk2key_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     struct pvk2key_ctx_st *ctx = vctx;
-    const OSSL_PARAM *p;
-    char *str = ctx->propq;
+    struct pvk2key_set_ctx_params_st p;
+    char *str;

-    p = OSSL_PARAM_locate_const(params, OSSL_DECODER_PARAM_PROPERTIES);
-    if (p != NULL && !OSSL_PARAM_get_utf8_string(p, &str, sizeof(ctx->propq)))
+    if (ctx == NULL || !pvk2key_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    str = ctx->propq;
+    if (p.propq != NULL
+        && !OSSL_PARAM_get_utf8_string(p.propq, &str, sizeof(ctx->propq)))
         return 0;

     return 1;
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/decode_pvk2key.inc.in b/deps/openssl/openssl/providers/implementations/encode_decode/decode_pvk2key.inc.in
new file mode 100644
index 00000000000..b53c6439727
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/decode_pvk2key.inc.in
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('pvk2key_set_ctx_params',
+                         (['OSSL_DECODER_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/decode_spki2typespki.c b/deps/openssl/openssl/providers/implementations/encode_decode/decode_spki2typespki.c
index 5bb39fc2f75..6fd680c23f6 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/decode_spki2typespki.c
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/decode_spki2typespki.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -12,14 +12,17 @@
 #include <openssl/core_names.h>
 #include <openssl/core_object.h>
 #include <openssl/params.h>
+#include <openssl/proverr.h>
 #include <openssl/x509.h>
+#include "internal/cryptlib.h"
 #include "internal/sizes.h"
 #include "crypto/x509.h"
 #include "crypto/ec.h"
 #include "prov/bio.h"
 #include "prov/decoders.h"
 #include "prov/implementations.h"
-#include "endecoder_local.h"
+#include "prov/endecoder_local.h"
+#include "providers/implementations/encode_decode/decode_spki2typespki.inc"

 static OSSL_FUNC_decoder_newctx_fn spki2typespki_newctx;
 static OSSL_FUNC_decoder_freectx_fn spki2typespki_freectx;
@@ -54,21 +57,21 @@ static void spki2typespki_freectx(void *vctx)

 static const OSSL_PARAM *spki2typespki_settable_ctx_params(ossl_unused void *provctx)
 {
-    static const OSSL_PARAM settables[] = {
-        OSSL_PARAM_utf8_string(OSSL_DECODER_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return settables;
+    return spki2typespki_set_ctx_params_list;
 }

 static int spki2typespki_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     struct spki2typespki_ctx_st *ctx = vctx;
-    const OSSL_PARAM *p;
-    char *str = ctx->propq;
+    struct spki2typespki_set_ctx_params_st p;
+    char *str;

-    p = OSSL_PARAM_locate_const(params, OSSL_DECODER_PARAM_PROPERTIES);
-    if (p != NULL && !OSSL_PARAM_get_utf8_string(p, &str, sizeof(ctx->propq)))
+    if (ctx == NULL || !spki2typespki_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    str = ctx->propq;
+    if (p.propq != NULL
+        && !OSSL_PARAM_get_utf8_string(p.propq, &str, sizeof(ctx->propq)))
         return 0;

     return 1;
@@ -119,14 +122,29 @@ int ossl_spki2typespki_der_decode(unsigned char *der, long len, int selection,
         goto end;
     X509_ALGOR_get0(&oid, NULL, NULL, algor);

+    /*
+     * Resolve the SPKI AlgorithmIdentifier OID to the key type name expected
+     * by the downstream provider decoder.  Most OIDs map one-to-one to a key
+     * type via OBJ_obj2txt(), but a few need special handling:
+     *
+     *   - SM2 abuses id-ecPublicKey, so the EC parameters must be inspected
+     *     to tell EC and SM2 apart.
+     *   - TPM 1.2 Endorsement Key certificates use NID_rsaesOaep with a
+     *     plain RSAPublicKey body per TCG Credential Profiles V1.2 section
+     *     3.2.7; the OAEP AlgorithmIdentifier parameters are not interpreted
+     *     here.  Keep this in sync with x509_pubkey_decode() and
+     *     x509_pubkey_ex_d2i_ex() in crypto/x509/x_pubkey.c.
+     */
+    dataname[0] = '\0';
 #ifndef OPENSSL_NO_EC
-    /* SM2 abuses the EC oid, so this could actually be SM2 */
     if (OBJ_obj2nid(oid) == NID_X9_62_id_ecPublicKey
         && ossl_x509_algor_is_sm2(algor))
-        strcpy(dataname, "SM2");
-    else
+        OPENSSL_strlcpy(dataname, "SM2", sizeof(dataname));
 #endif
-        if (OBJ_obj2txt(dataname, sizeof(dataname), oid, 0) <= 0)
+    if (dataname[0] == '\0' && OBJ_obj2nid(oid) == NID_rsaesOaep)
+        OPENSSL_strlcpy(dataname, "RSA", sizeof(dataname));
+    if (dataname[0] == '\0'
+        && OBJ_obj2txt(dataname, sizeof(dataname), oid, 0) <= 0)
         goto end;

     ossl_X509_PUBKEY_INTERNAL_free(xpub);
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/decode_spki2typespki.inc.in b/deps/openssl/openssl/providers/implementations/encode_decode/decode_spki2typespki.inc.in
new file mode 100644
index 00000000000..69f7124675e
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/decode_spki2typespki.inc.in
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('spki2typespki_set_ctx_params',
+                         (['OSSL_DECODER_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2any.c b/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2any.c
index 307b8a96731..1d12bf1e9e7 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2any.c
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2any.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -38,9 +38,13 @@
 #include "prov/bio.h"
 #include "prov/provider_ctx.h"
 #include "prov/der_rsa.h"
-#include "endecoder_local.h"
-#include "ml_dsa_codecs.h"
-#include "ml_kem_codecs.h"
+#include "prov/endecoder_local.h"
+#include "prov/ml_dsa_codecs.h"
+#include "prov/ml_kem_codecs.h"
+#include "prov/lms_codecs.h"
+#include "providers/implementations/encode_decode/encode_key2any.inc"
+
+#include <crypto/asn1.h>

 #if defined(OPENSSL_NO_DH) && defined(OPENSSL_NO_DSA) && defined(OPENSSL_NO_EC)
 #define OPENSSL_NO_KEYPARAMS
@@ -58,6 +62,9 @@ typedef struct key2any_ctx_st {
     EVP_CIPHER *cipher;

     struct ossl_passphrase_data_st pwdata;
+
+    /* Just-in-time ML-KEM and ML-DSA output format override */
+    char *output_formats;
 } KEY2ANY_CTX;

 typedef int check_key_type_fn(const void *key, int nid);
@@ -123,7 +130,8 @@ static X509_SIG *p8info_to_encp8(PKCS8_PRIV_KEY_INFO *p8info,
         return NULL;
     }
     /* First argument == -1 means "standard" */
-    p8 = PKCS8_encrypt_ex(-1, ctx->cipher, kstr, klen, NULL, 0, 0, p8info, libctx, NULL);
+    p8 = PKCS8_encrypt_ex(-1, ctx->cipher, kstr, (int)klen, NULL, 0, 0, p8info,
+        libctx, NULL);
     OPENSSL_cleanse(kstr, klen);
     return p8;
 }
@@ -794,7 +802,7 @@ k2d_NOCTX(ec_param, i2d_ECParameters)
         return 0;

     *pder = keyblob;
-    return ecxkey->keylen;
+    return (int)ecxkey->keylen;
 }

 static int ecx_pki_priv_to_der(const void *vecxkey, unsigned char **pder,
@@ -810,7 +818,7 @@ static int ecx_pki_priv_to_der(const void *vecxkey, unsigned char **pder,
     }

     oct.data = ecxkey->privkey;
-    oct.length = ecxkey->keylen;
+    oct.length = (int)ecxkey->keylen;
     oct.flags = 0;

     keybloblen = i2d_ASN1_OCTET_STRING(&oct, pder);
@@ -855,7 +863,8 @@ static int ml_dsa_pki_priv_to_der(const void *vkey, unsigned char **pder,
 {
     KEY2ANY_CTX *ctx = vctx;

-    return ossl_ml_dsa_i2d_prvkey(vkey, pder, ctx->provctx);
+    return ossl_ml_dsa_i2d_prvkey(vkey, pder,
+        ctx->provctx, ctx->output_formats);
 }

 #define ml_dsa_epki_priv_to_der ml_dsa_pki_priv_to_der
@@ -885,7 +894,8 @@ static int ml_kem_pki_priv_to_der(const void *vkey, unsigned char **pder,
 {
     KEY2ANY_CTX *ctx = vctx;

-    return ossl_ml_kem_i2d_prvkey(vkey, pder, ctx->provctx);
+    return ossl_ml_kem_i2d_prvkey(vkey, pder,
+        ctx->provctx, ctx->output_formats);
 }

 #define ml_kem_epki_priv_to_der ml_kem_pki_priv_to_der
@@ -1034,7 +1044,7 @@ static int slh_dsa_spki_pub_to_der(const void *vkey, unsigned char **pder,
         return 0;

     *pder = key_blob;
-    return key_len;
+    return (int)key_len;
 }

 static int slh_dsa_pki_priv_to_der(const void *vkey, unsigned char **pder,
@@ -1053,7 +1063,7 @@ static int slh_dsa_pki_priv_to_der(const void *vkey, unsigned char **pder,
         && ((*pder = OPENSSL_memdup(ossl_slh_dsa_key_get_priv(key), len)) == NULL))
         return 0;

-    return len;
+    return (int)len;
 }
 #define slh_dsa_epki_priv_to_der slh_dsa_pki_priv_to_der

@@ -1098,6 +1108,19 @@ static int slh_dsa_pki_priv_to_der(const void *vkey, unsigned char **pder,
 #define slh_dsa_shake_256f_pem_type "SLH-DSA-SHAKE-256f"
 #endif /* OPENSSL_NO_SLH_DSA */

+#ifndef OPENSSL_NO_LMS
+static int lms_spki_pub_to_der(const void *vkey, unsigned char **pder,
+    ossl_unused void *ctx)
+{
+    return ossl_lms_i2d_pubkey(vkey, pder);
+}
+
+#define prepare_lms_params NULL
+#define lms_check_key_type NULL
+#define lms_evp_type EVP_PKEY_HSS_LMS
+#define lms_pem_type "LMS"
+#endif /* OPENSSL_NO_LMS */
+
 /* ---------------------------------------------------------------------- */

 static OSSL_FUNC_decoder_newctx_fn key2any_newctx;
@@ -1121,37 +1144,34 @@ static void key2any_freectx(void *vctx)

     ossl_pw_clear_passphrase_data(&ctx->pwdata);
     EVP_CIPHER_free(ctx->cipher);
+    OPENSSL_free(ctx->output_formats);
     OPENSSL_free(ctx);
 }

 static const OSSL_PARAM *key2any_settable_ctx_params(ossl_unused void *provctx)
 {
-    static const OSSL_PARAM settables[] = {
-        OSSL_PARAM_utf8_string(OSSL_ENCODER_PARAM_CIPHER, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_ENCODER_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_END,
-    };
-
-    return settables;
+    return key2any_set_ctx_params_list;
 }

 static int key2any_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     KEY2ANY_CTX *ctx = vctx;
-    OSSL_LIB_CTX *libctx = ossl_prov_ctx_get0_libctx(ctx->provctx);
-    const OSSL_PARAM *cipherp = OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_CIPHER);
-    const OSSL_PARAM *propsp = OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_PROPERTIES);
-    const OSSL_PARAM *save_paramsp = OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_SAVE_PARAMETERS);
+    struct key2any_set_ctx_params_st p;

-    if (cipherp != NULL) {
+    if (ctx == NULL || !key2any_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.cipher != NULL) {
         const char *ciphername = NULL;
         const char *props = NULL;
+        OSSL_LIB_CTX *libctx;

-        if (!OSSL_PARAM_get_utf8_string_ptr(cipherp, &ciphername))
+        if (!OSSL_PARAM_get_utf8_string_ptr(p.cipher, &ciphername))
             return 0;
-        if (propsp != NULL && !OSSL_PARAM_get_utf8_string_ptr(propsp, &props))
+        if (p.propq != NULL && !OSSL_PARAM_get_utf8_string_ptr(p.propq, &props))
             return 0;

+        libctx = ossl_prov_ctx_get0_libctx(ctx->provctx);
         EVP_CIPHER_free(ctx->cipher);
         ctx->cipher = NULL;
         ctx->cipher_intent = ciphername != NULL;
@@ -1160,10 +1180,23 @@ static int key2any_set_ctx_params(void *vctx, const OSSL_PARAM params[])
             return 0;
     }

-    if (save_paramsp != NULL) {
-        if (!OSSL_PARAM_get_int(save_paramsp, &ctx->save_parameters))
+    if (p.svprm != NULL && !OSSL_PARAM_get_int(p.svprm, &ctx->save_parameters))
+        return 0;
+
+    if (p.output_formats != NULL) {
+        char *val = NULL;
+
+        if (!OSSL_PARAM_get_utf8_string(p.output_formats, &val, 0))
             return 0;
+        OPENSSL_free(ctx->output_formats);
+        if (*val != '\0') {
+            ctx->output_formats = val;
+        } else {
+            OPENSSL_free(val);
+            ctx->output_formats = NULL;
+        }
     }
+
     return 1;
 }

@@ -1749,3 +1782,8 @@ MAKE_ENCODER(ml_dsa_87, ml_dsa, PrivateKeyInfo, pem);
 MAKE_ENCODER(ml_dsa_87, ml_dsa, SubjectPublicKeyInfo, der);
 MAKE_ENCODER(ml_dsa_87, ml_dsa, SubjectPublicKeyInfo, pem);
 #endif /* OPENSSL_NO_ML_DSA */
+
+#ifndef OPENSSL_NO_LMS
+MAKE_ENCODER(lms, lms, SubjectPublicKeyInfo, der);
+MAKE_ENCODER(lms, lms, SubjectPublicKeyInfo, pem);
+#endif
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2any.inc.in b/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2any.inc.in
new file mode 100644
index 00000000000..fe59f3072ec
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2any.inc.in
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('key2any_set_ctx_params',
+                         (['OSSL_ENCODER_PARAM_CIPHER',          'cipher',         'utf8_string'],
+                          ['OSSL_ENCODER_PARAM_PROPERTIES',      'propq',          'utf8_string'],
+                          ['OSSL_ENCODER_PARAM_SAVE_PARAMETERS', 'svprm',          'int'],
+                          ['OSSL_PKEY_PARAM_OUTPUT_FORMATS',     'output_formats', 'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2blob.c b/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2blob.c
index 437bf022d62..d19a0901387 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2blob.c
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2blob.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -24,7 +24,7 @@
 #include "prov/implementations.h"
 #include "prov/bio.h"
 #include "prov/provider_ctx.h"
-#include "endecoder_local.h"
+#include "prov/endecoder_local.h"

 static int write_blob(void *provctx, OSSL_CORE_BIO *cout,
     void *data, int len)
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2ms.c b/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2ms.c
index 2c9bff42bbb..a5301822de2 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2ms.c
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2ms.c
@@ -18,14 +18,17 @@
 #include <openssl/core_names.h>
 #include <openssl/params.h>
 #include <openssl/err.h>
+#include <openssl/proverr.h>
 #include <openssl/pem.h> /* Functions for writing MSBLOB and PVK */
 #include <openssl/dsa.h>
+#include "internal/cryptlib.h"
 #include "internal/passphrase.h"
 #include "crypto/rsa.h"
 #include "prov/implementations.h"
 #include "prov/bio.h"
 #include "prov/provider_ctx.h"
-#include "endecoder_local.h"
+#include "prov/endecoder_local.h"
+#include "providers/implementations/encode_decode/encode_key2ms.inc"

 struct key2ms_ctx_st {
     PROV_CTX *provctx;
@@ -91,21 +94,18 @@ static void key2ms_freectx(void *vctx)

 static const OSSL_PARAM *key2pvk_settable_ctx_params(ossl_unused void *provctx)
 {
-    static const OSSL_PARAM settables[] = {
-        OSSL_PARAM_int(OSSL_ENCODER_PARAM_ENCRYPT_LEVEL, NULL),
-        OSSL_PARAM_END,
-    };
-
-    return settables;
+    return key2pvk_set_ctx_params_list;
 }

 static int key2pvk_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     struct key2ms_ctx_st *ctx = vctx;
-    const OSSL_PARAM *p;
+    struct key2pvk_set_ctx_params_st p;
+
+    if (ctx == NULL || !key2pvk_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_ENCRYPT_LEVEL);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &ctx->pvk_encr_level))
+    if (p.enclvl != NULL && !OSSL_PARAM_get_int(p.enclvl, &ctx->pvk_encr_level))
         return 0;
     return 1;
 }
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2ms.inc.in b/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2ms.inc.in
new file mode 100644
index 00000000000..f926fa9bee7
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2ms.inc.in
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('key2pvk_set_ctx_params',
+                         (['OSSL_ENCODER_PARAM_ENCRYPT_LEVEL', 'enclvl', 'int'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2text.c b/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2text.c
index 5c120d469d2..965113426b2 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2text.c
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/encode_key2text.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -30,9 +30,10 @@
 #include "prov/bio.h"
 #include "prov/implementations.h"
 #include "internal/encoder.h"
-#include "endecoder_local.h"
-#include "ml_dsa_codecs.h"
-#include "ml_kem_codecs.h"
+#include "prov/endecoder_local.h"
+#include "prov/ml_dsa_codecs.h"
+#include "prov/ml_kem_codecs.h"
+#include "prov/lms_codecs.h"

 DEFINE_SPECIAL_STACK_OF_CONST(BIGNUM_const, BIGNUM)

@@ -362,8 +363,9 @@ static int ec_to_text(BIO *out, const void *key, int selection)
     }

     if (type_label != NULL
-        && BIO_printf(out, "%s: (%d bit)\n", type_label,
-               EC_GROUP_order_bits(group))
+        && BIO_printf(out, "%s: (%d bit field, %d bit security level)\n",
+               type_label, EC_GROUP_get_degree(group),
+               EC_GROUP_security_bits(group))
             <= 0)
         goto err;
     if (priv != NULL
@@ -442,7 +444,7 @@ static int ecx_to_text(BIO *out, const void *key, int selection)
 #ifndef OPENSSL_NO_ML_KEM
 static int ml_kem_to_text(BIO *out, const void *vkey, int selection)
 {
-    return ossl_ml_kem_key_to_text(out, (ML_KEM_KEY *)vkey, selection);
+    return ossl_ml_kem_key_to_text(out, (const ML_KEM_KEY *)vkey, selection);
 }
 #endif

@@ -451,7 +453,7 @@ static int ml_kem_to_text(BIO *out, const void *vkey, int selection)
 #ifndef OPENSSL_NO_SLH_DSA
 static int slh_dsa_to_text(BIO *out, const void *key, int selection)
 {
-    return ossl_slh_dsa_key_to_text(out, (SLH_DSA_KEY *)key, selection);
+    return ossl_slh_dsa_key_to_text(out, (const SLH_DSA_KEY *)key, selection);
 }
 #endif /* OPENSSL_NO_SLH_DSA */

@@ -617,9 +619,17 @@ err:
 #ifndef OPENSSL_NO_ML_DSA
 static int ml_dsa_to_text(BIO *out, const void *key, int selection)
 {
-    return ossl_ml_dsa_key_to_text(out, (ML_DSA_KEY *)key, selection);
+    return ossl_ml_dsa_key_to_text(out, (const ML_DSA_KEY *)key, selection);
 }
 #endif /* OPENSSL_NO_ML_DSA */
+
+#ifndef OPENSSL_NO_LMS
+static int lms_to_text(BIO *out, const void *key, int selection)
+{
+    return ossl_lms_key_to_text(out, (LMS_KEY *)key, selection);
+}
+#endif /* OPENSSL_NO_LMS */
+
 /* ---------------------------------------------------------------------- */

 static void *key2text_newctx(void *provctx)
@@ -742,3 +752,7 @@ MAKE_TEXT_ENCODER(slh_dsa_shake_192f, slh_dsa);
 MAKE_TEXT_ENCODER(slh_dsa_shake_256s, slh_dsa);
 MAKE_TEXT_ENCODER(slh_dsa_shake_256f, slh_dsa);
 #endif
+
+#ifndef OPENSSL_NO_LMS
+MAKE_TEXT_ENCODER(lms, lms);
+#endif
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/endecoder_common.c b/deps/openssl/openssl/providers/implementations/encode_decode/endecoder_common.c
index 2e5b39242a7..fd498ad1d96 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/endecoder_common.c
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/endecoder_common.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -11,7 +11,7 @@
 #include <openssl/buffer.h>
 #include "internal/asn1.h"
 #include "prov/bio.h"
-#include "endecoder_local.h"
+#include "prov/endecoder_local.h"

 OSSL_FUNC_keymgmt_new_fn *
 ossl_prov_get_keymgmt_new(const OSSL_DISPATCH *fns)
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/lms_codecs.c b/deps/openssl/openssl/providers/implementations/encode_decode/lms_codecs.c
new file mode 100644
index 00000000000..f07fa49294a
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/lms_codecs.c
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <string.h>
+#include <openssl/byteorder.h>
+#include <openssl/err.h>
+#include <openssl/proverr.h>
+#include <openssl/x509.h>
+#include <openssl/core_names.h>
+#include "internal/encoder.h"
+#include "internal/nelem.h"
+#include "internal/packet.h"
+#include "prov/lms_codecs.h"
+
+/*-
+ * The DER ASN.1 encoding of LMS public keys prepends 20 bytes
+ * to the encoded public key:
+ *
+ * - 2 byte outer sequence tag and length
+ * -  2 byte algorithm sequence tag and length
+ * -    2 byte algorithm OID tag and length
+ * -      11 byte algorithm OID (from NIST CSOR OID arc)
+ * -  2 byte bit string tag and length
+ * -    1 bitstring lead byte
+ *
+ * A HSS key with a single tree also represents LMS public key.
+ * This has 4 extra bytes after the above data with the value 0x00, 0x00, 0x00, 0x01
+ *
+ * The LMS public key consists of
+ *  4 byte LMS type
+ *  4 byte OTS type
+ *  16 byte Id
+ *  n bytes of K where n = 32 or 24.
+ *  i.e. 24 + n bytes
+ */
+
+#define LMS_SPKI_OVERHEAD 20
+#define HSS_HEADER 4
+#define HSS_LMS_SPKI_OVERHEAD (LMS_SPKI_OVERHEAD + HSS_HEADER)
+#define HSS_LMS_HEADER(n) {                                           \
+    0x30, 0x2E + n, 0x30, 0x0d,                                       \
+    0x06, 0x0b,                                                       \
+    0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x11, \
+    0x03, 0x1D + n,                                                   \
+    0x00,                                                             \
+    0x00, 0x00, 0x00, 0x01                                            \
+}
+
+typedef struct {
+    const uint8_t header[HSS_LMS_SPKI_OVERHEAD];
+} LMS_SPKI_FMT;
+
+static const LMS_SPKI_FMT hss_lms_32_spkifmt = {
+    HSS_LMS_HEADER(32)
+};
+static const LMS_SPKI_FMT hss_lms_24_spkifmt = {
+    HSS_LMS_HEADER(24)
+};
+
+typedef struct {
+    const LMS_SPKI_FMT *spkifmt;
+} LMS_CODEC;
+
+static const LMS_CODEC codecs[2] = {
+    { &hss_lms_32_spkifmt },
+    { &hss_lms_24_spkifmt }
+};
+
+static const LMS_SPKI_FMT *find_spkifmt(const uint8_t *pk, int pk_len)
+{
+    size_t i;
+
+    if (pk_len <= HSS_LMS_SPKI_OVERHEAD)
+        return NULL;
+
+    for (i = 0; i < OSSL_NELEM(codecs); ++i) {
+        if (memcmp(pk, codecs[i].spkifmt->header, HSS_LMS_SPKI_OVERHEAD) == 0)
+            return codecs[i].spkifmt;
+    }
+    return NULL;
+}
+
+LMS_KEY *
+ossl_lms_d2i_PUBKEY(const uint8_t *pk, int pk_len, PROV_CTX *provctx)
+{
+    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
+    LMS_KEY *ret;
+    const LMS_SPKI_FMT *spkifmt;
+
+    spkifmt = find_spkifmt(pk, pk_len);
+    if (spkifmt == NULL)
+        return NULL;
+
+    if ((ret = ossl_lms_key_new(libctx)) == NULL)
+        return NULL;
+
+    pk += sizeof(spkifmt->header);
+    pk_len -= sizeof(spkifmt->header);
+
+    if (!ossl_lms_pubkey_decode(pk, (size_t)pk_len, ret)) {
+        ERR_raise_data(ERR_LIB_PROV, PROV_R_BAD_ENCODING,
+            "error parsing LMS public key from input SPKI");
+        ossl_lms_key_free(ret);
+        return NULL;
+    }
+
+    return ret;
+}
+
+int ossl_lms_i2d_pubkey(const LMS_KEY *key, unsigned char **out)
+{
+    if (key->pub.encoded == NULL || key->pub.encodedlen == 0) {
+        ERR_raise_data(ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY,
+            "no LMS public key data available");
+        return 0;
+    }
+    if (out != NULL) {
+        WPACKET pkt;
+        size_t sz = HSS_HEADER + key->pub.encodedlen;
+        uint8_t *buf = OPENSSL_malloc(sz);
+        int ret;
+
+        if (buf == NULL)
+            return 0;
+        ret = WPACKET_init_static_len(&pkt, buf, sz, 0)
+            /* Output HSS format which has a 4 byte value (L = 1) */
+            && WPACKET_memcpy(&pkt, hss_lms_32_spkifmt.header + sizeof(hss_lms_32_spkifmt.header) - HSS_HEADER, HSS_HEADER)
+            /* Output the LMS encoded public key */
+            && WPACKET_memcpy(&pkt, key->pub.encoded, key->pub.encodedlen);
+        WPACKET_cleanup(&pkt);
+        if (ret == 0) {
+            OPENSSL_free(buf);
+            return 0;
+        }
+        *out = buf;
+    }
+    return (int)key->pub.encodedlen + HSS_HEADER;
+}
+
+static const char *get_digest(const char *name)
+{
+    if (strcmp(name, "SHAKE-256") == 0)
+        return "SHAKE";
+    return strcmp(name, "SHA256-192") == 0 ? "SHA256" : name;
+}
+
+int ossl_lms_key_to_text(BIO *out, const LMS_KEY *key, int selection)
+{
+    const LMS_PARAMS *lms_params;
+    const LM_OTS_PARAMS *ots_params;
+
+    if (out == NULL || key == NULL) {
+        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+    lms_params = key->lms_params;
+    ots_params = key->ots_params;
+
+    if (key->pub.encoded == NULL || key->pub.encodedlen == 0) {
+        /* Regardless of the |selection|, there must be a public key */
+        ERR_raise_data(ERR_LIB_PROV, PROV_R_MISSING_KEY,
+            "no LMS key material available");
+        return 0;
+    }
+    if (BIO_printf(out, "lms-type: %s-N%d-H%d (0x%x)\n",
+            get_digest(lms_params->digestname),
+            (int)lms_params->n, (int)lms_params->h, (int)lms_params->lms_type)
+        <= 0)
+        return 0;
+    if (BIO_printf(out, "lm-ots-type: %s-N%d-W%d (0x%x)\n",
+            get_digest(ots_params->digestname),
+            (int)ots_params->n, (int)ots_params->w, (int)ots_params->lm_ots_type)
+        <= 0)
+        return 0;
+    if (!ossl_bio_print_labeled_buf(out, "Id:", key->Id, 16))
+        return 0;
+    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
+        /* Private keys are not supported */
+    } else if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
+        if (BIO_printf(out, "LMS Public-Key:\n") <= 0)
+            return 0;
+    }
+    if (!ossl_bio_print_labeled_buf(out, "pub:", key->pub.encoded, key->pub.encodedlen))
+        return 0;
+    if (!ossl_bio_print_labeled_buf(out, "K:", key->pub.K, lms_params->n))
+        return 0;
+    return 1;
+}
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/ml_common_codecs.c b/deps/openssl/openssl/providers/implementations/encode_decode/ml_common_codecs.c
index 0ce80b67ecd..db8f5d03991 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/ml_common_codecs.c
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/ml_common_codecs.c
@@ -11,7 +11,7 @@
 #include <openssl/crypto.h>
 #include <openssl/err.h>
 #include <openssl/proverr.h>
-#include "ml_common_codecs.h"
+#include "prov/ml_common_codecs.h"

 static int pref_cmp(const void *va, const void *vb)
 {
@@ -42,7 +42,7 @@ ossl_ml_common_pkcs8_fmt_order(const char *algorithm_name,
     const char *sep = "\t ,";

     /* Reserve an extra terminal slot with fmt == NULL */
-    if ((ret = OPENSSL_zalloc((NUM_PKCS8_FORMATS + 1) * sizeof(*ret))) == NULL)
+    if ((ret = OPENSSL_calloc(NUM_PKCS8_FORMATS + 1, sizeof(*ret))) == NULL)
         return NULL;

     /* Entries that match a format will get a non-zero preference. */
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/ml_dsa_codecs.c b/deps/openssl/openssl/providers/implementations/encode_decode/ml_dsa_codecs.c
index 8f4f7acfb6f..ad1bfc9b1ca 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/ml_dsa_codecs.c
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/ml_dsa_codecs.c
@@ -15,7 +15,7 @@
 #include <openssl/core_names.h>
 #include "internal/encoder.h"
 #include "prov/ml_dsa.h"
-#include "ml_dsa_codecs.h"
+#include "prov/ml_dsa_codecs.h"

 /*-
  * Tables describing supported ASN.1 input/output formats.
@@ -286,14 +286,13 @@ int ossl_ml_dsa_i2d_pubkey(const ML_DSA_KEY *key, unsigned char **out)

 /* Allocate and encode PKCS#8 private key payload. */
 int ossl_ml_dsa_i2d_prvkey(const ML_DSA_KEY *key, uint8_t **out,
-    PROV_CTX *provctx)
+    PROV_CTX *provctx, const char *formats)
 {
     const ML_DSA_PARAMS *params = ossl_ml_dsa_key_params(key);
     const ML_COMMON_CODEC *codec;
     ML_COMMON_PKCS8_FMT_PREF *fmt_slots, *slot;
     const ML_COMMON_PKCS8_FMT *p8fmt;
     uint8_t *buf = NULL, *pos;
-    const char *formats;
     int len = ML_DSA_SEED_BYTES;
     int ret = 0;
     const uint8_t *seed = ossl_ml_dsa_key_get_seed(key);
@@ -310,8 +309,13 @@ int ossl_ml_dsa_i2d_prvkey(const ML_DSA_KEY *key, uint8_t **out,
         return 0;
     }

-    formats = ossl_prov_ctx_get_param(
-        provctx, OSSL_PKEY_PARAM_ML_DSA_OUTPUT_FORMATS, NULL);
+    if (formats == NULL) {
+        if ((ossl_ml_dsa_key_get_prov_flags(key) & ML_DSA_KEY_RETAIN_SEED) == 0)
+            seed = NULL;
+        formats = ossl_prov_ctx_get_param(provctx,
+            OSSL_PKEY_PARAM_ML_DSA_OUTPUT_FORMATS,
+            NULL);
+    }
     fmt_slots = ossl_ml_common_pkcs8_fmt_order(params->alg, codec->p8fmt,
         "output", formats);
     if (fmt_slots == NULL)
@@ -331,7 +335,7 @@ int ossl_ml_dsa_i2d_prvkey(const ML_DSA_KEY *key, uint8_t **out,
             params->alg);
         goto end;
     }
-    len = p8fmt->p8_bytes;
+    len = (int)p8fmt->p8_bytes;

     if (out == NULL) {
         ret = len;
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/ml_kem_codecs.c b/deps/openssl/openssl/providers/implementations/encode_decode/ml_kem_codecs.c
index 482775433b6..8eab4959afa 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/ml_kem_codecs.c
+++ b/deps/openssl/openssl/providers/implementations/encode_decode/ml_kem_codecs.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,7 +14,7 @@
 #include <openssl/core_names.h>
 #include "internal/encoder.h"
 #include "prov/ml_kem.h"
-#include "ml_kem_codecs.h"
+#include "prov/ml_kem_codecs.h"

 /* Tables describing supported ASN.1 input/output formats. */

@@ -23,39 +23,18 @@
  * Public key bytes:   800 (0x0320)
  * Private key bytes: 1632 (0x0660)
  */
+/* clang-format off */
 static const ML_COMMON_SPKI_FMT ml_kem_512_spkifmt = {
-    {
-        0x30,
-        0x82,
-        0x03,
-        0x32,
-        0x30,
-        0x0b,
-        0x06,
-        0x09,
-        0x60,
-        0x86,
-        0x48,
-        0x01,
-        0x65,
-        0x03,
-        0x04,
-        0x04,
-        0x01,
-        0x03,
-        0x82,
-        0x03,
-        0x21,
-        0x00,
-    }
+    { 0x30, 0x82, 0x03, 0x32, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48,
+      0x01, 0x65, 0x03, 0x04, 0x04, 0x01, 0x03, 0x82, 0x03, 0x21, 0x00 }
 };
 static const ML_COMMON_PKCS8_FMT ml_kem_512_p8fmt[NUM_PKCS8_FORMATS] = {
-    { "seed-priv", 0x06aa, 0, 0x308206a6, 0x0440, 6, 0x40, 0x04820660, 0x4a, 0x0660, 0, 0 },
-    { "priv-only", 0x0664, 0, 0x04820660, 0, 0, 0, 0, 0x04, 0x0660, 0, 0 },
-    { "oqskeypair", 0x0984, 0, 0x04820980, 0, 0, 0, 0, 0x04, 0x0660, 0x0664, 0x0320 },
-    { "seed-only", 0x0042, 2, 0x8040, 0, 2, 0x40, 0, 0, 0, 0, 0 },
-    { "bare-priv", 0x0660, 4, 0, 0, 0, 0, 0, 0, 0x0660, 0, 0 },
-    { "bare-seed", 0x0040, 4, 0, 0, 0, 0x40, 0, 0, 0, 0, 0 },
+    { "seed-priv",  0x06aa, 0, 0x308206a6, 0x0440, 6, 0x40, 0x04820660, 0x4a, 0x0660, 0,      0      },
+    { "priv-only",  0x0664, 0, 0x04820660, 0,      0, 0,    0,          0x04, 0x0660, 0,      0      },
+    { "oqskeypair", 0x0984, 0, 0x04820980, 0,      0, 0,    0,          0x04, 0x0660, 0x0664, 0x0320 },
+    { "seed-only",  0x0042, 2, 0x8040,     0,      2, 0x40, 0,          0,    0,      0,      0      },
+    { "bare-priv",  0x0660, 4, 0,          0,      0, 0,    0,          0,    0x0660, 0,      0      },
+    { "bare-seed",  0x0040, 4, 0,          0,      0, 0x40, 0,          0,    0,      0,      0      },
 };

 /*-
@@ -64,103 +43,16 @@ static const ML_COMMON_PKCS8_FMT ml_kem_512_p8fmt[NUM_PKCS8_FORMATS] = {
  * Private key bytes: 2400 (0x0960)
  */
 static const ML_COMMON_SPKI_FMT ml_kem_768_spkifmt = {
-    {
-        0x30,
-        0x82,
-        0x04,
-        0xb2,
-        0x30,
-        0x0b,
-        0x06,
-        0x09,
-        0x60,
-        0x86,
-        0x48,
-        0x01,
-        0x65,
-        0x03,
-        0x04,
-        0x04,
-        0x02,
-        0x03,
-        0x82,
-        0x04,
-        0xa1,
-        0x00,
-    }
+    { 0x30, 0x82, 0x04, 0xb2, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48,
+      0x01, 0x65, 0x03, 0x04, 0x04, 0x02, 0x03, 0x82, 0x04, 0xa1, 0x00 }
 };
 static const ML_COMMON_PKCS8_FMT ml_kem_768_p8fmt[NUM_PKCS8_FORMATS] = {
-    {
-        "seed-priv",
-        0x09aa,
-        0,
-        0x308209a6,
-        0x0440,
-        6,
-        0x40,
-        0x04820960,
-        0x4a,
-        0x0960,
-        0,
-        0,
-    },
-    {
-        "priv-only",
-        0x0964,
-        0,
-        0x04820960,
-        0,
-        0,
-        0,
-        0,
-        0x04,
-        0x0960,
-        0,
-        0,
-    },
-    { "oqskeypair", 0x0e04, 0, 0x04820e00, 0, 0, 0, 0, 0x04, 0x0960, 0x0964, 0x04a0 },
-    {
-        "seed-only",
-        0x0042,
-        2,
-        0x8040,
-        0,
-        2,
-        0x40,
-        0,
-        0,
-        0,
-        0,
-        0,
-    },
-    {
-        "bare-priv",
-        0x0960,
-        4,
-        0,
-        0,
-        0,
-        0,
-        0,
-        0,
-        0x0960,
-        0,
-        0,
-    },
-    {
-        "bare-seed",
-        0x0040,
-        4,
-        0,
-        0,
-        0,
-        0x40,
-        0,
-        0,
-        0,
-        0,
-        0,
-    },
+    { "seed-priv",  0x09aa, 0, 0x308209a6, 0x0440, 6, 0x40, 0x04820960, 0x4a, 0x0960, 0,      0      },
+    { "priv-only",  0x0964, 0, 0x04820960, 0,      0, 0,    0,          0x04, 0x0960, 0,      0      },
+    { "oqskeypair", 0x0e04, 0, 0x04820e00, 0,      0, 0,    0,          0x04, 0x0960, 0x0964, 0x04a0 },
+    { "seed-only",  0x0042, 2, 0x8040,     0,      2, 0x40, 0,          0,    0,      0,      0      },
+    { "bare-priv",  0x0960, 4, 0,          0,      0, 0,    0,          0,    0x0960, 0,      0      },
+    { "bare-seed",  0x0040, 4, 0,          0,      0, 0x40, 0,          0,    0,      0,      0      },
 };

 /*-
@@ -169,39 +61,18 @@ static const ML_COMMON_PKCS8_FMT ml_kem_768_p8fmt[NUM_PKCS8_FORMATS] = {
  * Public key bytes:  1568 (0x0620)
  */
 static const ML_COMMON_SPKI_FMT ml_kem_1024_spkifmt = {
-    {
-        0x30,
-        0x82,
-        0x06,
-        0x32,
-        0x30,
-        0x0b,
-        0x06,
-        0x09,
-        0x60,
-        0x86,
-        0x48,
-        0x01,
-        0x65,
-        0x03,
-        0x04,
-        0x04,
-        0x03,
-        0x03,
-        0x82,
-        0x06,
-        0x21,
-        0x00,
-    }
+    { 0x30, 0x82, 0x06, 0x32, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48,
+      0x01, 0x65, 0x03, 0x04, 0x04, 0x03, 0x03, 0x82, 0x06, 0x21, 0x00 }
 };
 static const ML_COMMON_PKCS8_FMT ml_kem_1024_p8fmt[NUM_PKCS8_FORMATS] = {
-    { "seed-priv", 0x0caa, 0, 0x30820ca6, 0x0440, 6, 0x40, 0x04820c60, 0x4a, 0x0c60, 0, 0 },
-    { "priv-only", 0x0c64, 0, 0x04820c60, 0, 0, 0, 0, 0x04, 0x0c60, 0, 0 },
-    { "oqskeypair", 0x1284, 0, 0x04821280, 0, 0, 0, 0, 0x04, 0x0c60, 0x0c64, 0x0620 },
-    { "seed-only", 0x0042, 2, 0x8040, 0, 2, 0x40, 0, 0, 0, 0, 0 },
-    { "bare-priv", 0x0c60, 4, 0, 0, 0, 0, 0, 0, 0x0c60, 0, 0 },
-    { "bare-seed", 0x0040, 4, 0, 0, 0, 0x40, 0, 0, 0, 0, 0 },
+    { "seed-priv",  0x0caa, 0, 0x30820ca6, 0x0440, 6, 0x40, 0x04820c60, 0x4a, 0x0c60, 0,      0      },
+    { "priv-only",  0x0c64, 0, 0x04820c60, 0,      0, 0,    0,          0x04, 0x0c60, 0,      0      },
+    { "oqskeypair", 0x1284, 0, 0x04821280, 0,      0, 0,    0,          0x04, 0x0c60, 0x0c64, 0x0620 },
+    { "seed-only",  0x0042, 2, 0x8040,     0,      2, 0x40, 0,          0,    0,      0,      0      },
+    { "bare-priv",  0x0c60, 4, 0,          0,      0, 0,    0,          0,    0x0c60, 0,      0      },
+    { "bare-seed",  0x0040, 4, 0,          0,      0, 0x40, 0,          0,    0,      0,      0      },
 };
+/* clang-format on */

 /* Indices of slots in the `codecs` table below */
 #define ML_KEM_512_CODEC 0
@@ -214,7 +85,7 @@ static const ML_COMMON_PKCS8_FMT ml_kem_1024_p8fmt[NUM_PKCS8_FORMATS] = {
 static const ML_COMMON_CODEC codecs[3] = {
     { &ml_kem_512_spkifmt, ml_kem_512_p8fmt },
     { &ml_kem_768_spkifmt, ml_kem_768_p8fmt },
-    { &ml_kem_1024_spkifmt, ml_kem_1024_p8fmt }
+    { &ml_kem_1024_spkifmt, ml_kem_1024_p8fmt },
 };

 /* Retrieve the parameters of one of the ML-KEM variants */
@@ -385,7 +256,7 @@ ossl_ml_kem_d2i_PKCS8(const uint8_t *prvenc, int prvlen,
         }
     }
     if (p8fmt->priv_length > 0) {
-        if ((key->encoded_dk = OPENSSL_malloc(p8fmt->priv_length)) == NULL) {
+        if ((key->encoded_dk = OPENSSL_secure_malloc(p8fmt->priv_length)) == NULL) {
             ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY,
                 "error parsing %s private key",
                 v->algorithm_name);
@@ -417,8 +288,7 @@ int ossl_ml_kem_i2d_pubkey(const ML_KEM_KEY *key, unsigned char **out)
     }
     publen = key->vinfo->pubkey_bytes;

-    if (out != NULL
-        && (*out = OPENSSL_malloc(publen)) == NULL)
+    if ((*out = OPENSSL_malloc(publen)) == NULL)
         return 0;
     if (!ossl_ml_kem_encode_public_key(*out, publen, key)) {
         ERR_raise_data(ERR_LIB_OSSL_ENCODER, ERR_R_INTERNAL_ERROR,
@@ -433,15 +303,15 @@ int ossl_ml_kem_i2d_pubkey(const ML_KEM_KEY *key, unsigned char **out)

 /* Allocate and encode PKCS#8 private key payload. */
 int ossl_ml_kem_i2d_prvkey(const ML_KEM_KEY *key, uint8_t **out,
-    PROV_CTX *provctx)
+    PROV_CTX *provctx, const char *formats)
 {
     const ML_KEM_VINFO *v = key->vinfo;
     const ML_COMMON_CODEC *codec;
     ML_COMMON_PKCS8_FMT_PREF *fmt_slots, *slot;
     const ML_COMMON_PKCS8_FMT *p8fmt;
     uint8_t *buf = NULL, *pos;
-    const char *formats;
     int len = ML_KEM_SEED_BYTES;
+    int have_seed = ossl_ml_kem_have_seed(key);
     int ret = 0;

     /* Not ours to handle */
@@ -455,8 +325,13 @@ int ossl_ml_kem_i2d_prvkey(const ML_KEM_KEY *key, uint8_t **out,
         return 0;
     }

-    formats = ossl_prov_ctx_get_param(
-        provctx, OSSL_PKEY_PARAM_ML_KEM_OUTPUT_FORMATS, NULL);
+    if (formats == NULL) {
+        if ((key->prov_flags & ML_KEM_KEY_RETAIN_SEED) == 0)
+            have_seed = 0;
+        formats = ossl_prov_ctx_get_param(provctx,
+            OSSL_PKEY_PARAM_ML_KEM_OUTPUT_FORMATS,
+            NULL);
+    }
     fmt_slots = ossl_ml_common_pkcs8_fmt_order(v->algorithm_name, codec->p8fmt,
         "output", formats);
     if (fmt_slots == NULL)
@@ -464,7 +339,7 @@ int ossl_ml_kem_i2d_prvkey(const ML_KEM_KEY *key, uint8_t **out,

     /* If we don't have a seed, skip seedful entries */
     for (slot = fmt_slots; (p8fmt = slot->fmt) != NULL; ++slot)
-        if (ossl_ml_kem_have_seed(key) || p8fmt->seed_length == 0)
+        if (have_seed || p8fmt->seed_length == 0)
             break;
     /* No matching table entries, give up */
     if (p8fmt == NULL
@@ -476,7 +351,7 @@ int ossl_ml_kem_i2d_prvkey(const ML_KEM_KEY *key, uint8_t **out,
             v->algorithm_name);
         goto end;
     }
-    len = p8fmt->p8_bytes;
+    len = (int)p8fmt->p8_bytes;

     if (out == NULL) {
         ret = len;
diff --git a/deps/openssl/openssl/providers/implementations/exchange/dh_exch.c b/deps/openssl/openssl/providers/implementations/exchange/dh_exch.c
index 243ffc6bdcf..b7c21526590 100644
--- a/deps/openssl/openssl/providers/implementations/exchange/dh_exch.c
+++ b/deps/openssl/openssl/providers/implementations/exchange/dh_exch.c
@@ -21,11 +21,14 @@
 #include <openssl/err.h>
 #include <openssl/proverr.h>
 #include <openssl/params.h>
+#include "internal/cryptlib.h"
+#include "internal/fips.h"
 #include "prov/providercommon.h"
 #include "prov/implementations.h"
 #include "prov/provider_ctx.h"
 #include "prov/securitycheck.h"
 #include "crypto/dh.h"
+#include "providers/implementations/exchange/dh_exch.inc"

 static OSSL_FUNC_keyexch_newctx_fn dh_newctx;
 static OSSL_FUNC_keyexch_init_fn dh_init;
@@ -86,6 +89,12 @@ static void *dh_newctx(void *provctx)
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_KA_DH))
+        return NULL;
+#endif
+
     pdhctx = OPENSSL_zalloc(sizeof(PROV_DH_CTX));
     if (pdhctx == NULL)
         return NULL;
@@ -103,7 +112,7 @@ static int dh_check_key(PROV_DH_CTX *ctx)
     if (!key_approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE0,
                 ctx->libctx, "DH Init", "DH Key",
-                ossl_fips_config_securitycheck_enabled)) {
+                FIPS_CONFIG_SECURITY_CHECKS)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
             return 0;
         }
@@ -343,27 +352,22 @@ err:
 static int dh_set_ctx_params(void *vpdhctx, const OSSL_PARAM params[])
 {
     PROV_DH_CTX *pdhctx = (PROV_DH_CTX *)vpdhctx;
-    const OSSL_PARAM *p;
+    struct dh_set_ctx_params_st p;
     unsigned int pad;
     char name[80] = { '\0' }; /* should be big enough */
     char *str = NULL;

-    if (pdhctx == NULL)
+    if (pdhctx == NULL || !dh_set_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(pdhctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_EXCHANGE_PARAM_FIPS_KEY_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(pdhctx, OSSL_FIPS_IND_SETTABLE0, p.ind_k))
         return 0;
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(pdhctx, OSSL_FIPS_IND_SETTABLE1, params,
-            OSSL_EXCHANGE_PARAM_FIPS_DIGEST_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(pdhctx, OSSL_FIPS_IND_SETTABLE1, p.ind_d))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_KDF_TYPE);
-    if (p != NULL) {
+    if (p.kdf != NULL) {
         str = name;
-        if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(name)))
+        if (!OSSL_PARAM_get_utf8_string(p.kdf, &str, sizeof(name)))
             return 0;

         if (name[0] == '\0')
@@ -373,20 +377,17 @@ static int dh_set_ctx_params(void *vpdhctx, const OSSL_PARAM params[])
         else
             return 0;
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_KDF_DIGEST);
-    if (p != NULL) {
+
+    if (p.digest != NULL) {
         char mdprops[80] = { '\0' }; /* should be big enough */

         str = name;
-        if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(name)))
+        if (!OSSL_PARAM_get_utf8_string(p.digest, &str, sizeof(name)))
             return 0;

         str = mdprops;
-        p = OSSL_PARAM_locate_const(params,
-            OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS);
-
-        if (p != NULL) {
-            if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(mdprops)))
+        if (p.propq != NULL) {
+            if (!OSSL_PARAM_get_utf8_string(p.propq, &str, sizeof(mdprops)))
                 return 0;
         }

@@ -408,17 +409,15 @@ static int dh_set_ctx_params(void *vpdhctx, const OSSL_PARAM params[])
 #endif
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_KDF_OUTLEN);
-    if (p != NULL) {
+    if (p.len != NULL) {
         size_t outlen;

-        if (!OSSL_PARAM_get_size_t(p, &outlen))
+        if (!OSSL_PARAM_get_size_t(p.len, &outlen))
             return 0;
         pdhctx->kdf_outlen = outlen;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_KDF_UKM);
-    if (p != NULL) {
+    if (p.ukm != NULL) {
         void *tmp_ukm = NULL;
         size_t tmp_ukmlen;

@@ -426,29 +425,27 @@ static int dh_set_ctx_params(void *vpdhctx, const OSSL_PARAM params[])
         pdhctx->kdf_ukm = NULL;
         pdhctx->kdf_ukmlen = 0;
         /* ukm is an optional field so it can be NULL */
-        if (p->data != NULL && p->data_size != 0) {
-            if (!OSSL_PARAM_get_octet_string(p, &tmp_ukm, 0, &tmp_ukmlen))
+        if (p.ukm->data != NULL && p.ukm->data_size != 0) {
+            if (!OSSL_PARAM_get_octet_string(p.ukm, &tmp_ukm, 0, &tmp_ukmlen))
                 return 0;
             pdhctx->kdf_ukm = tmp_ukm;
             pdhctx->kdf_ukmlen = tmp_ukmlen;
         }
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_PAD);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_uint(p, &pad))
+    if (p.pad != NULL) {
+        if (!OSSL_PARAM_get_uint(p.pad, &pad))
             return 0;
         pdhctx->pad = pad ? 1 : 0;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_CEK_ALG);
-    if (p != NULL) {
+    if (p.cekalg != NULL) {
         str = name;

         OPENSSL_free(pdhctx->kdf_cekalg);
         pdhctx->kdf_cekalg = NULL;
-        if (p->data != NULL && p->data_size != 0) {
-            if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(name)))
+        if (p.cekalg->data != NULL && p.cekalg->data_size != 0) {
+            if (!OSSL_PARAM_get_utf8_string(p.cekalg, &str, sizeof(name)))
                 return 0;
             pdhctx->kdf_cekalg = OPENSSL_strdup(name);
             if (pdhctx->kdf_cekalg == NULL)
@@ -458,52 +455,27 @@ static int dh_set_ctx_params(void *vpdhctx, const OSSL_PARAM params[])
     return 1;
 }

-static const OSSL_PARAM known_settable_ctx_params[] = {
-    OSSL_PARAM_int(OSSL_EXCHANGE_PARAM_PAD, NULL),
-    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_TYPE, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_DIGEST, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS, NULL, 0),
-    OSSL_PARAM_size_t(OSSL_EXCHANGE_PARAM_KDF_OUTLEN, NULL),
-    OSSL_PARAM_octet_string(OSSL_EXCHANGE_PARAM_KDF_UKM, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_CEK_ALG, NULL, 0),
-    OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_EXCHANGE_PARAM_FIPS_KEY_CHECK)
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_EXCHANGE_PARAM_FIPS_DIGEST_CHECK)
-            OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *dh_settable_ctx_params(ossl_unused void *vpdhctx,
     ossl_unused void *provctx)
 {
-    return known_settable_ctx_params;
+    return dh_set_ctx_params_list;
 }

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_TYPE, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_DIGEST, NULL, 0),
-    OSSL_PARAM_size_t(OSSL_EXCHANGE_PARAM_KDF_OUTLEN, NULL),
-    OSSL_PARAM_DEFN(OSSL_EXCHANGE_PARAM_KDF_UKM, OSSL_PARAM_OCTET_PTR,
-        NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_CEK_ALG, NULL, 0),
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *dh_gettable_ctx_params(ossl_unused void *vpdhctx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return dh_get_ctx_params_list;
 }

 static int dh_get_ctx_params(void *vpdhctx, OSSL_PARAM params[])
 {
     PROV_DH_CTX *pdhctx = (PROV_DH_CTX *)vpdhctx;
-    OSSL_PARAM *p;
+    struct dh_get_ctx_params_st p;

-    if (pdhctx == NULL)
+    if (pdhctx == NULL || !dh_get_ctx_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_EXCHANGE_PARAM_KDF_TYPE);
-    if (p != NULL) {
+    if (p.kdf != NULL) {
         const char *kdf_type = NULL;

         switch (pdhctx->kdf_type) {
@@ -517,30 +489,27 @@ static int dh_get_ctx_params(void *vpdhctx, OSSL_PARAM params[])
             return 0;
         }

-        if (!OSSL_PARAM_set_utf8_string(p, kdf_type))
+        if (!OSSL_PARAM_set_utf8_string(p.kdf, kdf_type))
             return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_EXCHANGE_PARAM_KDF_DIGEST);
-    if (p != NULL
-        && !OSSL_PARAM_set_utf8_string(p, pdhctx->kdf_md == NULL ? "" : EVP_MD_get0_name(pdhctx->kdf_md))) {
+    if (p.digest != NULL
+        && !OSSL_PARAM_set_utf8_string(p.digest, pdhctx->kdf_md == NULL ? "" : EVP_MD_get0_name(pdhctx->kdf_md))) {
         return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_EXCHANGE_PARAM_KDF_OUTLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, pdhctx->kdf_outlen))
+    if (p.len != NULL && !OSSL_PARAM_set_size_t(p.len, pdhctx->kdf_outlen))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_EXCHANGE_PARAM_KDF_UKM);
-    if (p != NULL
-        && !OSSL_PARAM_set_octet_ptr(p, pdhctx->kdf_ukm, pdhctx->kdf_ukmlen))
+    if (p.ukm != NULL
+        && !OSSL_PARAM_set_octet_ptr(p.ukm, pdhctx->kdf_ukm, pdhctx->kdf_ukmlen))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_CEK_ALG);
-    if (p != NULL
-        && !OSSL_PARAM_set_utf8_string(p, pdhctx->kdf_cekalg == NULL ? "" : pdhctx->kdf_cekalg))
+    if (p.cekalg != NULL
+        && !OSSL_PARAM_set_utf8_string(p.cekalg, pdhctx->kdf_cekalg == NULL ? "" : pdhctx->kdf_cekalg))
         return 0;
-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(pdhctx, params))
+
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(pdhctx, p.ind))
         return 0;
     return 1;
 }
diff --git a/deps/openssl/openssl/providers/implementations/exchange/dh_exch.inc.in b/deps/openssl/openssl/providers/implementations/exchange/dh_exch.inc.in
new file mode 100644
index 00000000000..9a031d1273d
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/exchange/dh_exch.inc.in
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('dh_set_ctx_params',
+                         (['OSSL_EXCHANGE_PARAM_PAD',               'pad',    'int'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_TYPE',          'kdf',    'utf8_string'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_DIGEST',        'digest', 'utf8_string'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS',  'propq',  'utf8_string'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_OUTLEN',        'len',    'size_t'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_UKM',           'ukm',    'octet_string'],
+                          ['OSSL_KDF_PARAM_CEK_ALG',                'cekalg', 'utf8_string'],
+                          ['OSSL_EXCHANGE_PARAM_FIPS_KEY_CHECK',    'ind_k',  'int', 'fips'],
+                          ['OSSL_EXCHANGE_PARAM_FIPS_DIGEST_CHECK', 'ind_d',  'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('dh_get_ctx_params',
+                         (['OSSL_EXCHANGE_PARAM_KDF_TYPE',           'kdf',    'utf8_string'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_DIGEST',         'digest', 'utf8_string'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_OUTLEN',         'len',    'size_t'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_UKM',            'ukm',    'octet_ptr'],
+                          ['OSSL_KDF_PARAM_CEK_ALG',                 'cekalg', 'utf8_string'],
+                          ['OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR', 'ind',    'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/exchange/ecdh_exch.c b/deps/openssl/openssl/providers/implementations/exchange/ecdh_exch.c
index 43f3515878c..03558076245 100644
--- a/deps/openssl/openssl/providers/implementations/exchange/ecdh_exch.c
+++ b/deps/openssl/openssl/providers/implementations/exchange/ecdh_exch.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -22,16 +22,20 @@
 #include <openssl/params.h>
 #include <openssl/err.h>
 #include <openssl/proverr.h>
+#include "internal/cryptlib.h"
+#include "internal/fips.h"
 #include "prov/provider_ctx.h"
 #include "prov/providercommon.h"
 #include "prov/implementations.h"
 #include "prov/securitycheck.h"
 #include "crypto/ec.h" /* ossl_ecdh_kdf_X9_63() */
+#include "providers/implementations/exchange/ecdh_exch.inc"

 static OSSL_FUNC_keyexch_newctx_fn ecdh_newctx;
 static OSSL_FUNC_keyexch_init_fn ecdh_init;
 static OSSL_FUNC_keyexch_set_peer_fn ecdh_set_peer;
 static OSSL_FUNC_keyexch_derive_fn ecdh_derive;
+static OSSL_FUNC_keyexch_derive_skey_fn ecdh_derive_skey;
 static OSSL_FUNC_keyexch_freectx_fn ecdh_freectx;
 static OSSL_FUNC_keyexch_dupctx_fn ecdh_dupctx;
 static OSSL_FUNC_keyexch_set_ctx_params_fn ecdh_set_ctx_params;
@@ -87,6 +91,12 @@ static void *ecdh_newctx(void *provctx)
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_KA_ECDH))
+        return NULL;
+#endif
+
     pectx = OPENSSL_zalloc(sizeof(*pectx));
     if (pectx == NULL)
         return NULL;
@@ -242,28 +252,22 @@ static int ecdh_set_ctx_params(void *vpecdhctx, const OSSL_PARAM params[])
     char name[80] = { '\0' }; /* should be big enough */
     char *str = NULL;
     PROV_ECDH_CTX *pectx = (PROV_ECDH_CTX *)vpecdhctx;
-    const OSSL_PARAM *p;
+    struct ecdh_set_ctx_params_st p;

-    if (pectx == NULL)
+    if (pectx == NULL || !ecdh_set_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(pectx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_EXCHANGE_PARAM_FIPS_KEY_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(pectx, OSSL_FIPS_IND_SETTABLE0, p.ind_k))
         return 0;
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(pectx, OSSL_FIPS_IND_SETTABLE1, params,
-            OSSL_EXCHANGE_PARAM_FIPS_DIGEST_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(pectx, OSSL_FIPS_IND_SETTABLE1, p.ind_d))
         return 0;
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(pectx, OSSL_FIPS_IND_SETTABLE2, params,
-            OSSL_EXCHANGE_PARAM_FIPS_ECDH_COFACTOR_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(pectx, OSSL_FIPS_IND_SETTABLE2, p.ind_cofac))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE);
-    if (p != NULL) {
+    if (p.mode != NULL) {
         int mode;

-        if (!OSSL_PARAM_get_int(p, &mode))
+        if (!OSSL_PARAM_get_int(p.mode, &mode))
             return 0;

         if (mode < -1 || mode > 1)
@@ -272,10 +276,9 @@ static int ecdh_set_ctx_params(void *vpecdhctx, const OSSL_PARAM params[])
         pectx->cofactor_mode = mode;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_KDF_TYPE);
-    if (p != NULL) {
+    if (p.kdf != NULL) {
         str = name;
-        if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(name)))
+        if (!OSSL_PARAM_get_utf8_string(p.kdf, &str, sizeof(name)))
             return 0;

         if (name[0] == '\0')
@@ -286,20 +289,16 @@ static int ecdh_set_ctx_params(void *vpecdhctx, const OSSL_PARAM params[])
             return 0;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_KDF_DIGEST);
-    if (p != NULL) {
+    if (p.digest != NULL) {
         char mdprops[80] = { '\0' }; /* should be big enough */

         str = name;
-        if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(name)))
+        if (!OSSL_PARAM_get_utf8_string(p.digest, &str, sizeof(name)))
             return 0;

         str = mdprops;
-        p = OSSL_PARAM_locate_const(params,
-            OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS);
-
-        if (p != NULL) {
-            if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(mdprops)))
+        if (p.propq != NULL) {
+            if (!OSSL_PARAM_get_utf8_string(p.propq, &str, sizeof(mdprops)))
                 return 0;
         }

@@ -323,21 +322,19 @@ static int ecdh_set_ctx_params(void *vpecdhctx, const OSSL_PARAM params[])
 #endif
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_KDF_OUTLEN);
-    if (p != NULL) {
+    if (p.len != NULL) {
         size_t outlen;

-        if (!OSSL_PARAM_get_size_t(p, &outlen))
+        if (!OSSL_PARAM_get_size_t(p.len, &outlen))
             return 0;
         pectx->kdf_outlen = outlen;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_KDF_UKM);
-    if (p != NULL) {
+    if (p.ukm != NULL) {
         void *tmp_ukm = NULL;
         size_t tmp_ukmlen;

-        if (!OSSL_PARAM_get_octet_string(p, &tmp_ukm, 0, &tmp_ukmlen))
+        if (!OSSL_PARAM_get_octet_string(p.ukm, &tmp_ukm, 0, &tmp_ukmlen))
             return 0;
         OPENSSL_free(pectx->kdf_ukm);
         pectx->kdf_ukm = tmp_ukm;
@@ -347,35 +344,21 @@ static int ecdh_set_ctx_params(void *vpecdhctx, const OSSL_PARAM params[])
     return 1;
 }

-static const OSSL_PARAM known_settable_ctx_params[] = {
-    OSSL_PARAM_int(OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE, NULL),
-    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_TYPE, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_DIGEST, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS, NULL, 0),
-    OSSL_PARAM_size_t(OSSL_EXCHANGE_PARAM_KDF_OUTLEN, NULL),
-    OSSL_PARAM_octet_string(OSSL_EXCHANGE_PARAM_KDF_UKM, NULL, 0),
-    OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_EXCHANGE_PARAM_FIPS_KEY_CHECK)
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_EXCHANGE_PARAM_FIPS_DIGEST_CHECK)
-            OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_EXCHANGE_PARAM_FIPS_ECDH_COFACTOR_CHECK)
-                OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *ecdh_settable_ctx_params(ossl_unused void *vpecdhctx,
     ossl_unused void *provctx)
 {
-    return known_settable_ctx_params;
+    return ecdh_set_ctx_params_list;
 }

 static int ecdh_get_ctx_params(void *vpecdhctx, OSSL_PARAM params[])
 {
     PROV_ECDH_CTX *pectx = (PROV_ECDH_CTX *)vpecdhctx;
-    OSSL_PARAM *p;
+    struct ecdh_get_ctx_params_st p;

-    if (pectx == NULL)
+    if (pectx == NULL || !ecdh_get_ctx_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE);
-    if (p != NULL) {
+    if (p.mode != NULL) {
         int mode = pectx->cofactor_mode;

         if (mode == -1) {
@@ -383,12 +366,11 @@ static int ecdh_get_ctx_params(void *vpecdhctx, OSSL_PARAM params[])
             mode = EC_KEY_get_flags(pectx->k) & EC_FLAG_COFACTOR_ECDH ? 1 : 0;
         }

-        if (!OSSL_PARAM_set_int(p, mode))
+        if (!OSSL_PARAM_set_int(p.mode, mode))
             return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_EXCHANGE_PARAM_KDF_TYPE);
-    if (p != NULL) {
+    if (p.kdf != NULL) {
         const char *kdf_type = NULL;

         switch (pectx->kdf_type) {
@@ -402,43 +384,30 @@ static int ecdh_get_ctx_params(void *vpecdhctx, OSSL_PARAM params[])
             return 0;
         }

-        if (!OSSL_PARAM_set_utf8_string(p, kdf_type))
+        if (!OSSL_PARAM_set_utf8_string(p.kdf, kdf_type))
             return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_EXCHANGE_PARAM_KDF_DIGEST);
-    if (p != NULL
-        && !OSSL_PARAM_set_utf8_string(p, pectx->kdf_md == NULL ? "" : EVP_MD_get0_name(pectx->kdf_md))) {
+    if (p.digest != NULL
+        && !OSSL_PARAM_set_utf8_string(p.digest, pectx->kdf_md == NULL ? "" : EVP_MD_get0_name(pectx->kdf_md))) {
         return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_EXCHANGE_PARAM_KDF_OUTLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, pectx->kdf_outlen))
+    if (p.len != NULL && !OSSL_PARAM_set_size_t(p.len, pectx->kdf_outlen))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_EXCHANGE_PARAM_KDF_UKM);
-    if (p != NULL && !OSSL_PARAM_set_octet_ptr(p, pectx->kdf_ukm, pectx->kdf_ukmlen))
+    if (p.ukm != NULL && !OSSL_PARAM_set_octet_ptr(p.ukm, pectx->kdf_ukm, pectx->kdf_ukmlen))
         return 0;
-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(pectx, params))
+
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(pectx, p.ind))
         return 0;
     return 1;
 }

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_int(OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE, NULL),
-    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_TYPE, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_DIGEST, NULL, 0),
-    OSSL_PARAM_size_t(OSSL_EXCHANGE_PARAM_KDF_OUTLEN, NULL),
-    OSSL_PARAM_DEFN(OSSL_EXCHANGE_PARAM_KDF_UKM, OSSL_PARAM_OCTET_PTR,
-        NULL, 0),
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *ecdh_gettable_ctx_params(ossl_unused void *vpecdhctx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return ecdh_get_ctx_params_list;
 }

 static ossl_inline
@@ -538,7 +507,7 @@ static ossl_inline int ecdh_plain_derive(void *vpecdhctx, unsigned char *secret,
     if (has_cofactor && !cofactor_approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(pecdhctx, OSSL_FIPS_IND_SETTABLE2,
                 pecdhctx->libctx, "ECDH", "Cofactor",
-                ossl_fips_config_ecdh_cofactor_check)) {
+                FIPS_CONFIG_ECDH_COFACTOR_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_COFACTOR_REQUIRED);
             goto end;
         }
@@ -617,10 +586,45 @@ static int ecdh_derive(void *vpecdhctx, unsigned char *secret,
     return 0;
 }

+static void *ecdh_derive_skey(void *vpecdhctx, const char *key_type ossl_unused,
+    void *provctx, OSSL_FUNC_skeymgmt_import_fn *import,
+    size_t outlen, const OSSL_PARAM params_in[] ossl_unused)
+{
+    unsigned char *secret = NULL;
+    size_t secretlen = 0;
+    void *ret = NULL;
+    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+
+    if (import == NULL || outlen == 0)
+        return NULL;
+
+    if (ecdh_derive(vpecdhctx, secret, &secretlen, outlen) == 0)
+        return NULL;
+
+    if ((secret = OPENSSL_malloc(secretlen)) == NULL)
+        return NULL;
+
+    if (ecdh_derive(vpecdhctx, secret, &secretlen, outlen) == 0
+        || secretlen != outlen) {
+        OPENSSL_clear_free(secret, secretlen);
+        return NULL;
+    }
+
+    params[0] = OSSL_PARAM_construct_octet_string(OSSL_SKEY_PARAM_RAW_BYTES,
+        (void *)secret, outlen);
+
+    /* This is mandatory, no need to check for its presence */
+    ret = import(provctx, OSSL_SKEYMGMT_SELECT_SECRET_KEY, params);
+    OPENSSL_clear_free(secret, secretlen);
+
+    return ret;
+}
+
 const OSSL_DISPATCH ossl_ecdh_keyexch_functions[] = {
     { OSSL_FUNC_KEYEXCH_NEWCTX, (void (*)(void))ecdh_newctx },
     { OSSL_FUNC_KEYEXCH_INIT, (void (*)(void))ecdh_init },
     { OSSL_FUNC_KEYEXCH_DERIVE, (void (*)(void))ecdh_derive },
+    { OSSL_FUNC_KEYEXCH_DERIVE_SKEY, (void (*)(void))ecdh_derive_skey },
     { OSSL_FUNC_KEYEXCH_SET_PEER, (void (*)(void))ecdh_set_peer },
     { OSSL_FUNC_KEYEXCH_FREECTX, (void (*)(void))ecdh_freectx },
     { OSSL_FUNC_KEYEXCH_DUPCTX, (void (*)(void))ecdh_dupctx },
diff --git a/deps/openssl/openssl/providers/implementations/exchange/ecdh_exch.inc.in b/deps/openssl/openssl/providers/implementations/exchange/ecdh_exch.inc.in
new file mode 100644
index 00000000000..9778bf6e9c9
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/exchange/ecdh_exch.inc.in
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ecdh_set_ctx_params',
+                         (['OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE',    'mode',      'int'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_TYPE',                 'kdf',       'utf8_string'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_DIGEST',               'digest',    'utf8_string'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS',         'propq',     'utf8_string'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_OUTLEN',               'len',       'size_t'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_UKM',                  'ukm',       'octet_string'],
+                          ['OSSL_EXCHANGE_PARAM_FIPS_KEY_CHECK',           'ind_k',     'int', 'fips'],
+                          ['OSSL_EXCHANGE_PARAM_FIPS_DIGEST_CHECK',        'ind_d',     'int', 'fips'],
+                          ['OSSL_EXCHANGE_PARAM_FIPS_ECDH_COFACTOR_CHECK', 'ind_cofac', 'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('ecdh_get_ctx_params',
+                         (['OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE', 'mode',   'int'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_TYPE',              'kdf',    'utf8_string'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_DIGEST',            'digest', 'utf8_string'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_OUTLEN',            'len',    'size_t'],
+                          ['OSSL_EXCHANGE_PARAM_KDF_UKM',               'ukm',    'octet_ptr'],
+                          ['OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR',    'ind',    'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/exchange/ecx_exch.c b/deps/openssl/openssl/providers/implementations/exchange/ecx_exch.c
index c4f07619a07..c97786a9dc6 100644
--- a/deps/openssl/openssl/providers/implementations/exchange/ecx_exch.c
+++ b/deps/openssl/openssl/providers/implementations/exchange/ecx_exch.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,6 +19,10 @@
 #include "prov/providercommon.h"
 #include "prov/securitycheck.h"

+#ifdef FIPS_MODULE
+#include "providers/implementations/exchange/ecx_exch.inc"
+#endif
+
 static OSSL_FUNC_keyexch_newctx_fn x25519_newctx;
 static OSSL_FUNC_keyexch_newctx_fn x448_newctx;
 static OSSL_FUNC_keyexch_init_fn x25519_init;
@@ -177,24 +181,32 @@ static void *ecx_dupctx(void *vecxctx)
     return dstctx;
 }

+#ifdef FIPS_MODULE
+
+#endif
+
 static const OSSL_PARAM *ecx_gettable_ctx_params(ossl_unused void *vctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+#ifdef FIPS_MODULE
+    return ecx_get_ctx_params_list;
+#else
+    static OSSL_PARAM params[] = { OSSL_PARAM_END };
+
+    return params;
+#endif
 }

 static int ecx_get_ctx_params(ossl_unused void *vctx, OSSL_PARAM params[])
 {
 #ifdef FIPS_MODULE
     int approved = 0;
-    OSSL_PARAM *p = OSSL_PARAM_locate(params,
-        OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR);
+    struct ecx_get_ctx_params_st p;
+
+    if (vctx == NULL || !ecx_get_ctx_params_decoder(params, &p))
+        return 0;

-    if (p != NULL && !OSSL_PARAM_set_int(p, approved))
+    if (p.ind != NULL && !OSSL_PARAM_set_int(p.ind, approved))
         return 0;
 #endif
     return 1;
diff --git a/deps/openssl/openssl/providers/implementations/exchange/ecx_exch.inc.in b/deps/openssl/openssl/providers/implementations/exchange/ecx_exch.inc.in
new file mode 100644
index 00000000000..0b6787b010b
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/exchange/ecx_exch.inc.in
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ecx_get_ctx_params',
+                         (['OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/blake2.h b/deps/openssl/openssl/providers/implementations/include/prov/blake2.h
index 0a9cdba1383..c5fdcbb29d9 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/blake2.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/blake2.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -101,8 +101,6 @@ int ossl_blake2b_final(unsigned char *md, BLAKE2B_CTX *c);

 OSSL_FUNC_digest_get_ctx_params_fn ossl_blake2b_get_ctx_params;
 OSSL_FUNC_digest_set_ctx_params_fn ossl_blake2b_set_ctx_params;
-OSSL_FUNC_digest_gettable_ctx_params_fn ossl_blake2b_gettable_ctx_params;
-OSSL_FUNC_digest_settable_ctx_params_fn ossl_blake2b_settable_ctx_params;

 /*
  * These setters are internal and do not check the validity of their parameters.
@@ -132,7 +130,5 @@ void ossl_blake2s_param_set_salt(BLAKE2S_PARAM *P, const uint8_t *salt,

 OSSL_FUNC_digest_get_ctx_params_fn ossl_blake2s_get_ctx_params;
 OSSL_FUNC_digest_set_ctx_params_fn ossl_blake2s_set_ctx_params;
-OSSL_FUNC_digest_gettable_ctx_params_fn ossl_blake2s_gettable_ctx_params;
-OSSL_FUNC_digest_settable_ctx_params_fn ossl_blake2s_settable_ctx_params;

 #endif /* OSSL_PROV_BLAKE2_H */
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/blake2_params.inc.in b/deps/openssl/openssl/providers/implementations/include/prov/blake2_params.inc.in
new file mode 100644
index 00000000000..37d9f158bae
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/include/prov/blake2_params.inc.in
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+#include <string.h>
+#include "internal/common.h"
+
+{- produce_param_decoder('blake2_get_ctx',
+                         (['OSSL_MAC_PARAM_SIZE',                    'size',   'size_t'],
+                          ['OSSL_MAC_PARAM_BLOCK_SIZE',              'bsize',  'size_t'],
+                         )); -}
+
+{- produce_param_decoder('blake2_mac_set_ctx',
+                         (['OSSL_MAC_PARAM_SIZE',    'size', 'size_t'],
+                          ['OSSL_MAC_PARAM_KEY',     'key',  'octet_string'],
+                          ['OSSL_MAC_PARAM_CUSTOM',  'cust', 'octet_string'],
+                          ['OSSL_MAC_PARAM_SALT',    'salt', 'octet_string'],
+                         )); -}
+
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon.h b/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon.h
index 578529ee4af..25f40432b04 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon.h
@@ -18,13 +18,6 @@
 #include "internal/cryptlib.h"
 #include "crypto/modes.h"

-#ifdef FIPS_MODULE
-#define CIPHER_FIPS_IND_GETTABLE_CTX_PARAM() \
-    OSSL_PARAM_int(OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR, NULL),
-#else
-#define CIPHER_FIPS_IND_GETTABLE_CTX_PARAM()
-#endif
-
 #define MAXCHUNK ((size_t)1 << 30)
 #define MAXBITCHUNK ((size_t)1 << (sizeof(size_t) * 8 - 4))

@@ -113,6 +106,8 @@ struct prov_cipher_hw_st {
 };

 void ossl_cipher_generic_reset_ctx(PROV_CIPHER_CTX *ctx);
+int ossl_cipher_generic_dupctx_tlsmac(PROV_CIPHER_CTX *dst,
+    const PROV_CIPHER_CTX *src);
 OSSL_FUNC_cipher_encrypt_init_fn ossl_cipher_generic_einit;
 OSSL_FUNC_cipher_decrypt_init_fn ossl_cipher_generic_dinit;
 OSSL_FUNC_cipher_update_fn ossl_cipher_generic_block_update;
@@ -198,26 +193,42 @@ void ossl_cipher_generic_initkey(void *vctx, size_t kbits, size_t blkbits,
         OSSL_DISPATCH_END                                                                       \
     };

-#define IMPLEMENT_generic_cipher_genfn(alg, UCALG, lcmode, UCMODE, flags,               \
-    kbits, blkbits, ivbits, typ)                                                        \
-    static OSSL_FUNC_cipher_get_params_fn alg##_##kbits##_##lcmode##_get_params;        \
-    static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])               \
-    {                                                                                   \
-        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
-            flags, kbits, blkbits, ivbits);                                             \
-    }                                                                                   \
-    static OSSL_FUNC_cipher_newctx_fn alg##_##kbits##_##lcmode##_newctx;                \
-    static void *alg##_##kbits##_##lcmode##_newctx(void *provctx)                       \
-    {                                                                                   \
-        PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) \
-                                                         : NULL;                        \
-        if (ctx != NULL) {                                                              \
-            ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits,                    \
-                EVP_CIPH_##UCMODE##_MODE, flags,                                        \
-                ossl_prov_cipher_hw_##alg##_##lcmode(kbits),                            \
-                provctx);                                                               \
-        }                                                                               \
-        return ctx;                                                                     \
+#if defined(FIPS_MODULE)
+#include "internal/fips.h"
+#include "prov/provider_ctx.h"
+#define CIPHER_PROV_CHECK(provctx, name)                  \
+    if (!ossl_prov_is_running())                          \
+        return NULL;                                      \
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx), \
+            ST_ID_CIPHER_##name))                         \
+    return NULL
+#else
+#define CIPHER_PROV_CHECK(_provtcx, _name) \
+    if (!ossl_prov_is_running())           \
+    return NULL
+#endif /* FIPS_MODULE && CIPHER_IS_FIPS */
+
+#define IMPLEMENT_generic_cipher_genfn(alg, UCALG, lcmode, UCMODE, flags,        \
+    kbits, blkbits, ivbits, typ)                                                 \
+    static OSSL_FUNC_cipher_get_params_fn alg##_##kbits##_##lcmode##_get_params; \
+    static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])        \
+    {                                                                            \
+        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
+            flags, kbits, blkbits, ivbits);                                      \
+    }                                                                            \
+    static OSSL_FUNC_cipher_newctx_fn alg##_##kbits##_##lcmode##_newctx;         \
+    static void *alg##_##kbits##_##lcmode##_newctx(void *provctx)                \
+    {                                                                            \
+        PROV_##UCALG##_CTX *ctx;                                                 \
+        CIPHER_PROV_CHECK(provctx, alg);                                         \
+        ctx = OPENSSL_zalloc(sizeof(*ctx));                                      \
+        if (ctx != NULL) {                                                       \
+            ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits,             \
+                EVP_CIPH_##UCMODE##_MODE, flags,                                 \
+                ossl_prov_cipher_hw_##alg##_##lcmode(kbits),                     \
+                provctx);                                                        \
+        }                                                                        \
+        return ctx;                                                              \
     }

 #define IMPLEMENT_generic_cipher(alg, UCALG, lcmode, UCMODE, flags, kbits,   \
@@ -337,39 +348,48 @@ PROV_CIPHER_HW_FN ossl_cipher_hw_chunked_ofb128;
         dst->ks = &dctx->ks.ks;                                        \
     }

-#define CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_START(name)                  \
-    static const OSSL_PARAM name##_known_gettable_ctx_params[] = {      \
-        OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL),              \
-        OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_IVLEN, NULL),               \
-        OSSL_PARAM_uint(OSSL_CIPHER_PARAM_PADDING, NULL),               \
-        OSSL_PARAM_uint(OSSL_CIPHER_PARAM_NUM, NULL),                   \
-        OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_IV, NULL, 0),         \
-        OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_UPDATED_IV, NULL, 0), \
-        CIPHER_FIPS_IND_GETTABLE_CTX_PARAM()
-
-#define CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_END(name)                     \
-    OSSL_PARAM_END                                                       \
-    }                                                                    \
-    ;                                                                    \
-    const OSSL_PARAM *name##_gettable_ctx_params(ossl_unused void *cctx, \
-        ossl_unused void *provctx)                                       \
-    {                                                                    \
-        return name##_known_gettable_ctx_params;                         \
-    }
+struct ossl_cipher_get_param_list_st {
+    OSSL_PARAM *mode;
+    OSSL_PARAM *keylen;
+    OSSL_PARAM *ivlen;
+    OSSL_PARAM *bsize;
+    OSSL_PARAM *aead;
+    OSSL_PARAM *custiv;
+    OSSL_PARAM *cts;
+    OSSL_PARAM *mb;
+    OSSL_PARAM *rand;
+    OSSL_PARAM *etm;
+};

-#define CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_START(name)             \
-    static const OSSL_PARAM name##_known_settable_ctx_params[] = { \
-        OSSL_PARAM_uint(OSSL_CIPHER_PARAM_PADDING, NULL),          \
-        OSSL_PARAM_uint(OSSL_CIPHER_PARAM_NUM, NULL),
-#define CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_END(name)                     \
-    OSSL_PARAM_END                                                       \
-    }                                                                    \
-    ;                                                                    \
-    const OSSL_PARAM *name##_settable_ctx_params(ossl_unused void *cctx, \
-        ossl_unused void *provctx)                                       \
-    {                                                                    \
-        return name##_known_settable_ctx_params;                         \
-    }
+struct ossl_cipher_get_ctx_param_list_st {
+#ifdef FIPS_MODULE
+    OSSL_PARAM *ind; /* FIPS indicator */
+#endif
+    OSSL_PARAM *keylen; /* all ciphers */
+    OSSL_PARAM *ivlen; /* all ciphers */
+    OSSL_PARAM *pad; /* all ciphers */
+    OSSL_PARAM *num; /* all ciphers */
+    OSSL_PARAM *iv; /* all ciphers */
+    OSSL_PARAM *updiv; /* all ciphers */
+    OSSL_PARAM *tlsmac; /* generic cipher */
+};
+
+struct ossl_cipher_set_ctx_param_list_st {
+    OSSL_PARAM *pad; /* all ciphers */
+    OSSL_PARAM *num; /* all ciphers */
+    OSSL_PARAM *bits; /* generic cipher */
+    OSSL_PARAM *tlsvers; /* generic cipher */
+    OSSL_PARAM *tlsmacsize; /* generic cipher */
+    OSSL_PARAM *keylen; /* variable key length ciphers */
+};
+
+int ossl_cipher_common_get_params(const struct ossl_cipher_get_param_list_st *p,
+    unsigned int md, uint64_t flags, size_t kbits, size_t blkbits,
+    size_t ivbits);
+int ossl_cipher_common_get_ctx_params(PROV_CIPHER_CTX *ctx,
+    const struct ossl_cipher_get_ctx_param_list_st *p);
+int ossl_cipher_common_set_ctx_params(PROV_CIPHER_CTX *ctx,
+    const struct ossl_cipher_set_ctx_param_list_st *p);

 int ossl_cipher_generic_initiv(PROV_CIPHER_CTX *ctx, const unsigned char *iv,
     size_t ivlen);
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_aead.h b/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_aead.h
index f9ff3affdf8..1c631ed72bd 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_aead.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_aead.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -49,9 +49,9 @@
         { OSSL_FUNC_CIPHER_GETTABLE_PARAMS,                                     \
             (void (*)(void))ossl_cipher_generic_gettable_params },              \
         { OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS,                                 \
-            (void (*)(void))ossl_cipher_aead_gettable_ctx_params },             \
+            (void (*)(void))ossl_##lc##_gettable_ctx_params },                  \
         { OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS,                                 \
-            (void (*)(void))ossl_cipher_aead_settable_ctx_params },             \
+            (void (*)(void))ossl_##lc##_settable_ctx_params },                  \
         OSSL_DISPATCH_END                                                       \
     }

diff --git a/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_ccm.h b/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_ccm.h
index fefe7ed3156..43baf74b8e5 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_ccm.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_ccm.h
@@ -11,6 +11,10 @@
 #define OSSL_PROV_CIPHERCOMMON_CCM_H
 #pragma once

+#include <stddef.h>
+#include <stdint.h>
+
+#include "prov/ciphercommon.h"
 #include "ciphercommon_aead.h"

 typedef struct prov_ccm_hw_st PROV_CCM_HW;
@@ -76,6 +80,9 @@ OSSL_FUNC_cipher_set_ctx_params_fn ossl_ccm_set_ctx_params;
 OSSL_FUNC_cipher_update_fn ossl_ccm_stream_update;
 OSSL_FUNC_cipher_final_fn ossl_ccm_stream_final;
 OSSL_FUNC_cipher_cipher_fn ossl_ccm_cipher;
+OSSL_FUNC_cipher_gettable_ctx_params_fn ossl_ccm_gettable_ctx_params;
+OSSL_FUNC_cipher_settable_ctx_params_fn ossl_ccm_settable_ctx_params;
+
 void ossl_ccm_initctx(PROV_CCM_CTX *ctx, size_t keybits, const PROV_CCM_HW *hw);

 int ossl_ccm_generic_setiv(PROV_CCM_CTX *ctx, const unsigned char *nonce,
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_gcm.h b/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_gcm.h
index 7c57e3cb795..9668be41d41 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_gcm.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_gcm.h
@@ -12,7 +12,11 @@
 #define OSSL_PROV_CIPHERCOMMON_GCM_H
 #pragma once

+#include <stddef.h>
+#include <stdint.h>
+
 #include <openssl/aes.h>
+#include "prov/ciphercommon.h"
 #include "ciphercommon_aead.h"

 typedef struct prov_gcm_hw_st PROV_GCM_HW;
@@ -103,6 +107,9 @@ OSSL_FUNC_cipher_set_ctx_params_fn ossl_gcm_set_ctx_params;
 OSSL_FUNC_cipher_cipher_fn ossl_gcm_cipher;
 OSSL_FUNC_cipher_update_fn ossl_gcm_stream_update;
 OSSL_FUNC_cipher_final_fn ossl_gcm_stream_final;
+OSSL_FUNC_cipher_gettable_ctx_params_fn ossl_gcm_gettable_ctx_params;
+OSSL_FUNC_cipher_settable_ctx_params_fn ossl_gcm_settable_ctx_params;
+
 void ossl_gcm_initctx(void *provctx, PROV_GCM_CTX *ctx, size_t keybits,
     const PROV_GCM_HW *hw);

@@ -116,10 +123,4 @@ int ossl_gcm_one_shot(PROV_GCM_CTX *ctx, unsigned char *aad, size_t aad_len,
 int ossl_gcm_cipher_update(PROV_GCM_CTX *ctx, const unsigned char *in,
     size_t len, unsigned char *out);

-#define GCM_HW_SET_KEY_CTR_FN(ks, fn_set_enc_key, fn_block, fn_ctr) \
-    fn_set_enc_key(key, keylen * 8, ks);                            \
-    CRYPTO_gcm128_init(&ctx->gcm, ks, (block128_f)fn_block);        \
-    ctx->ctr = (ctr128_f)fn_ctr;                                    \
-    ctx->key_set = 1;
-
 #endif
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/decoders.h b/deps/openssl/openssl/providers/implementations/include/prov/decoders.h
index e38f15b3c2b..420b189a010 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/decoders.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/decoders.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_DECODERS_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_DECODERS_H
+
 #include <openssl/core.h>

 int ossl_epki2pki_der_decode(unsigned char *der, long der_len, int selection,
@@ -18,3 +21,5 @@ int ossl_spki2typespki_der_decode(unsigned char *der, long len, int selection,
     OSSL_CALLBACK *data_cb, void *data_cbarg,
     OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg,
     OSSL_LIB_CTX *libctx, const char *propq);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_DECODERS_H) */
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/digestcommon.h b/deps/openssl/openssl/providers/implementations/include/prov/digestcommon.h
index 48b0fd4d239..1e6ebcef86f 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/digestcommon.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/digestcommon.h
@@ -64,6 +64,21 @@ extern "C" {
         return 0;                                                                 \
     }

+#if defined(FIPS_MODULE)
+#include "internal/fips.h"
+#include "prov/provider_ctx.h"
+#define DIGEST_PROV_CHECK(provctx, name)                  \
+    if (!ossl_prov_is_running())                          \
+        return NULL;                                      \
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx), \
+            ST_ID_DIGEST_##name))                         \
+    return NULL
+#else
+#define DIGEST_PROV_CHECK(_provctx, _name) \
+    if (!ossl_prov_is_running())           \
+    return NULL
+#endif /* FIPS_MODULE && DIGEST_IS_FIPS */
+
 #define PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_START(                               \
     name, CTX, blksize, dgstsize, flags, upd, fin)                               \
     static OSSL_FUNC_digest_newctx_fn name##_newctx;                             \
@@ -71,8 +86,8 @@ extern "C" {
     static OSSL_FUNC_digest_dupctx_fn name##_dupctx;                             \
     static void *name##_newctx(void *prov_ctx)                                   \
     {                                                                            \
-        CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL; \
-        return ctx;                                                              \
+        DIGEST_PROV_CHECK(prov_ctx, name);                                       \
+        return OPENSSL_zalloc(sizeof(CTX));                                      \
     }                                                                            \
     static void name##_freectx(void *vctx)                                       \
     {                                                                            \
@@ -142,6 +157,21 @@ extern "C" {
         { OSSL_FUNC_DIGEST_SET_CTX_PARAMS, (void (*)(void))set_ctx_params },           \
         PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_END

+#define IMPLEMENT_digest_functions_with_serialize(                                 \
+    name, CTX, blksize, dgstsize, flags, init, upd, fin,                           \
+    serialize, deserialize)                                                        \
+    static OSSL_FUNC_digest_init_fn name##_internal_init;                          \
+    static int name##_internal_init(void *ctx, const OSSL_PARAM params[])          \
+    {                                                                              \
+        return ossl_prov_is_running() && init(ctx);                                \
+    }                                                                              \
+    PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_START(name, CTX, blksize, dgstsize, flags, \
+        upd, fin),                                                                 \
+        { OSSL_FUNC_DIGEST_INIT, (void (*)(void))name##_internal_init },           \
+        { OSSL_FUNC_DIGEST_SERIALIZE, (void (*)(void))serialize },                 \
+        { OSSL_FUNC_DIGEST_DESERIALIZE, (void (*)(void))deserialize },             \
+        PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_END
+
 const OSSL_PARAM *ossl_digest_default_gettable_params(void *provctx);
 int ossl_digest_default_get_params(OSSL_PARAM params[], size_t blksz,
     size_t paramsz, unsigned long flags);
diff --git a/deps/openssl/openssl/providers/implementations/rands/drbg_local.h b/deps/openssl/openssl/providers/implementations/include/prov/drbg.h
similarity index 86%
rename from deps/openssl/openssl/providers/implementations/rands/drbg_local.h
rename to deps/openssl/openssl/providers/implementations/include/prov/drbg.h
index ee31c584c5f..5a4adfb43af 100644
--- a/deps/openssl/openssl/providers/implementations/rands/drbg_local.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/drbg.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -23,10 +23,6 @@
 /* How many times to read the TSC as a randomness source. */
 #define TSC_READ_COUNT 4

-/* Maximum reseed intervals */
-#define MAX_RESEED_INTERVAL (1 << 24)
-#define MAX_RESEED_TIME_INTERVAL (1 << 20) /* approx. 12 days */
-
 /* Default reseed intervals */
 #define RESEED_INTERVAL (1 << 8)
 #define TIME_INTERVAL (60 * 60) /* 1 hour */
@@ -46,13 +42,6 @@

 typedef struct prov_drbg_st PROV_DRBG;

-/* DRBG status values */
-typedef enum drbg_status_e {
-    DRBG_UNINITIALISED,
-    DRBG_READY,
-    DRBG_ERROR
-} DRBG_STATUS;
-
 /*
  * The state of all types of DRBGs.
  */
@@ -149,7 +138,11 @@ struct prov_drbg_st {
     unsigned int parent_reseed_counter;

     size_t seedlen;
-    DRBG_STATUS state;
+    /*
+     * state is one of: EVP_RAND_STATE_UNINITIALISED, EVP_RAND_STATE_ERROR,
+     * EVP_RAND_STATE_READY.
+     */
+    int state;

     /* DRBG specific data */
     void *data;
@@ -212,14 +205,46 @@ OSSL_FUNC_rand_lock_fn ossl_drbg_lock;
 OSSL_FUNC_rand_unlock_fn ossl_drbg_unlock;

 /* Common parameters for all of our DRBGs */
-int ossl_drbg_get_ctx_params(PROV_DRBG *drbg, OSSL_PARAM params[]);
-int ossl_drbg_get_ctx_params_no_lock(PROV_DRBG *drbg, OSSL_PARAM params[],
+struct drbg_get_ctx_params_st {
+    OSSL_PARAM *state;
+    OSSL_PARAM *str;
+    OSSL_PARAM *maxreq;
+    OSSL_PARAM *minentlen;
+    OSSL_PARAM *maxentlen;
+    OSSL_PARAM *minnonlen;
+    OSSL_PARAM *maxnonlen;
+    OSSL_PARAM *maxperlen;
+    OSSL_PARAM *maxadlen;
+    OSSL_PARAM *reseed_cnt;
+    OSSL_PARAM *reseed_time;
+    OSSL_PARAM *reseed_req;
+    OSSL_PARAM *reseed_int;
+    OSSL_PARAM *ind;
+    OSSL_PARAM *cipher; /* CTR DRBG */
+    OSSL_PARAM *df; /* CTR DRBG */
+    OSSL_PARAM *digest; /* HASH & HMAC DRBG */
+};
+
+int ossl_drbg_get_ctx_params(PROV_DRBG *drbg,
+    const struct drbg_get_ctx_params_st *p);
+int ossl_drbg_get_ctx_params_no_lock(PROV_DRBG *drbg,
+    const struct drbg_get_ctx_params_st *p,
+    const OSSL_PARAM params[],
     int *complete);
-int ossl_drbg_set_ctx_params(PROV_DRBG *drbg, const OSSL_PARAM params[]);

-#define OSSL_PARAM_DRBG_SETTABLE_CTX_COMMON                 \
-    OSSL_PARAM_uint(OSSL_DRBG_PARAM_RESEED_REQUESTS, NULL), \
-        OSSL_PARAM_uint64(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL, NULL)
+struct drbg_set_ctx_params_st {
+    OSSL_PARAM *propq;
+    OSSL_PARAM *cipher; /* CTR DRBG */
+    OSSL_PARAM *df; /* CTR DRBG */
+    OSSL_PARAM *digest; /* HASH and HMAC DRBG */
+    OSSL_PARAM *ind_d; /* HASH and HMAC DRBG */
+    OSSL_PARAM *prov;
+    OSSL_PARAM *reseed_req;
+    OSSL_PARAM *reseed_time;
+};
+
+int ossl_drbg_set_ctx_params(PROV_DRBG *drbg,
+    const struct drbg_set_ctx_params_st *p);

 #define OSSL_PARAM_DRBG_GETTABLE_CTX_COMMON                      \
     OSSL_PARAM_int(OSSL_RAND_PARAM_STATE, NULL),                 \
diff --git a/deps/openssl/openssl/providers/implementations/kem/eckem.h b/deps/openssl/openssl/providers/implementations/include/prov/eckem.h
similarity index 56%
rename from deps/openssl/openssl/providers/implementations/kem/eckem.h
rename to deps/openssl/openssl/providers/implementations/include/prov/eckem.h
index 1575adca8a4..8911027f731 100644
--- a/deps/openssl/openssl/providers/implementations/kem/eckem.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/eckem.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,7 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ECKEM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ECKEM_H
+
 #define KEM_MODE_UNDEFINED 0
 #define KEM_MODE_DHKEM 1

 int ossl_eckem_modename2id(const char *name);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ECKEM_H) */
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/ecx.h b/deps/openssl/openssl/providers/implementations/include/prov/ecx.h
index 145f322c050..b573852cc88 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/ecx.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/ecx.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,14 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ECX_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ECX_H
+
+#include <stddef.h>
+
+#include <openssl/bn.h>
+#include <openssl/ec.h>
+
 #include "crypto/types.h"

 #ifndef OPENSSL_NO_EC
@@ -29,3 +37,5 @@ int ossl_ecx_dhkem_derive_private(ECX_KEY *ecx, unsigned char *privout,
 int ossl_ec_dhkem_derive_private(EC_KEY *ec, BIGNUM *privout,
     const unsigned char *ikm, size_t ikmlen);
 #endif
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ECX_H) */
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/endecoder_local.h b/deps/openssl/openssl/providers/implementations/include/prov/endecoder_local.h
similarity index 79%
rename from deps/openssl/openssl/providers/implementations/encode_decode/endecoder_local.h
rename to deps/openssl/openssl/providers/implementations/include/prov/endecoder_local.h
index 2576812be2d..6343a4b20f3 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/endecoder_local.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/endecoder_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ENDECODER_LOCAL_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ENDECODER_LOCAL_H
+
 #include <openssl/core.h>
 #include <openssl/core_dispatch.h>
 #include <openssl/types.h>
@@ -26,3 +29,5 @@ void *ossl_prov_import_key(const OSSL_DISPATCH *fns, void *provctx,
 void ossl_prov_free_key(const OSSL_DISPATCH *fns, void *key);
 int ossl_read_der(PROV_CTX *provctx, OSSL_CORE_BIO *cin, unsigned char **data,
     long *len);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ENDECODER_LOCAL_H) */
diff --git a/deps/openssl/openssl/include/crypto/httperr.h b/deps/openssl/openssl/providers/implementations/include/prov/file_store_local.h
similarity index 51%
rename from deps/openssl/openssl/include/crypto/httperr.h
rename to deps/openssl/openssl/providers/implementations/include/prov/file_store_local.h
index 94d812295cd..2196d4d2c69 100644
--- a/deps/openssl/openssl/include/crypto/httperr.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/file_store_local.h
@@ -1,5 +1,4 @@
 /*
- * Generated by util/mkerr.pl DO NOT EDIT
  * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -8,23 +7,11 @@
  * https://www.openssl.org/source/license.html
  */

-#ifndef OSSL_CRYPTO_HTTPERR_H
-#define OSSL_CRYPTO_HTTPERR_H
-#pragma once
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_FILE_STORE_LOCAL_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_FILE_STORE_LOCAL_H

-#include <openssl/opensslconf.h>
-#include <openssl/symhacks.h>
+#include <openssl/types.h>

-#ifdef __cplusplus
-extern "C" {
-#endif
+extern const OSSL_ALGORITHM ossl_any_to_obj_algorithm[];

-#ifndef OPENSSL_NO_HTTP
-
-int ossl_err_load_HTTP_strings(void);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_FILE_STORE_LOCAL_H) */
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/implementations.h b/deps/openssl/openssl/providers/implementations/include/prov/implementations.h
index 058ec9d499d..2b0782bd0b4 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/implementations.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/implementations.h
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_IMPLEMENTATIONS_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_IMPLEMENTATIONS_H
+
 #include <openssl/core.h>
 #include <openssl/types.h>

@@ -14,7 +17,7 @@
 extern const OSSL_DISPATCH ossl_sha1_functions[];
 extern const OSSL_DISPATCH ossl_sha224_functions[];
 extern const OSSL_DISPATCH ossl_sha256_functions[];
-extern const OSSL_DISPATCH ossl_sha256_192_functions[];
+extern const OSSL_DISPATCH ossl_sha256_192_internal_functions[];
 extern const OSSL_DISPATCH ossl_sha384_functions[];
 extern const OSSL_DISPATCH ossl_sha512_functions[];
 extern const OSSL_DISPATCH ossl_sha512_224_functions[];
@@ -27,10 +30,12 @@ extern const OSSL_DISPATCH ossl_keccak_224_functions[];
 extern const OSSL_DISPATCH ossl_keccak_256_functions[];
 extern const OSSL_DISPATCH ossl_keccak_384_functions[];
 extern const OSSL_DISPATCH ossl_keccak_512_functions[];
-extern const OSSL_DISPATCH ossl_keccak_kmac_128_functions[];
-extern const OSSL_DISPATCH ossl_keccak_kmac_256_functions[];
 extern const OSSL_DISPATCH ossl_shake_128_functions[];
 extern const OSSL_DISPATCH ossl_shake_256_functions[];
+extern const OSSL_DISPATCH ossl_cshake_keccak_128_functions[];
+extern const OSSL_DISPATCH ossl_cshake_keccak_256_functions[];
+extern const OSSL_DISPATCH ossl_cshake_128_functions[];
+extern const OSSL_DISPATCH ossl_cshake_256_functions[];
 extern const OSSL_DISPATCH ossl_blake2s256_functions[];
 extern const OSSL_DISPATCH ossl_blake2b512_functions[];
 extern const OSSL_DISPATCH ossl_md5_functions[];
@@ -42,6 +47,7 @@ extern const OSSL_DISPATCH ossl_mdc2_functions[];
 extern const OSSL_DISPATCH ossl_wp_functions[];
 extern const OSSL_DISPATCH ossl_ripemd160_functions[];
 extern const OSSL_DISPATCH ossl_nullmd_functions[];
+extern const OSSL_DISPATCH ossl_ml_dsa_mu_functions[];

 /* Ciphers */
 extern const OSSL_DISPATCH ossl_null_functions[];
@@ -98,6 +104,15 @@ extern const OSSL_DISPATCH ossl_aes256cbc_hmac_sha1_functions[];
 extern const OSSL_DISPATCH ossl_aes128cbc_hmac_sha1_functions[];
 extern const OSSL_DISPATCH ossl_aes256cbc_hmac_sha256_functions[];
 extern const OSSL_DISPATCH ossl_aes128cbc_hmac_sha256_functions[];
+extern const OSSL_DISPATCH ossl_aes128cbc_hmac_sha1_etm_functions[];
+extern const OSSL_DISPATCH ossl_aes192cbc_hmac_sha1_etm_functions[];
+extern const OSSL_DISPATCH ossl_aes256cbc_hmac_sha1_etm_functions[];
+extern const OSSL_DISPATCH ossl_aes128cbc_hmac_sha256_etm_functions[];
+extern const OSSL_DISPATCH ossl_aes192cbc_hmac_sha256_etm_functions[];
+extern const OSSL_DISPATCH ossl_aes256cbc_hmac_sha256_etm_functions[];
+extern const OSSL_DISPATCH ossl_aes128cbc_hmac_sha512_etm_functions[];
+extern const OSSL_DISPATCH ossl_aes192cbc_hmac_sha512_etm_functions[];
+extern const OSSL_DISPATCH ossl_aes256cbc_hmac_sha512_etm_functions[];

 #ifndef OPENSSL_NO_ARIA
 extern const OSSL_DISPATCH ossl_aria256gcm_functions[];
@@ -279,7 +294,13 @@ extern const OSSL_DISPATCH ossl_kdf_scrypt_functions[];
 #endif
 extern const OSSL_DISPATCH ossl_kdf_tls1_prf_functions[];
 extern const OSSL_DISPATCH ossl_kdf_hkdf_functions[];
+extern const OSSL_DISPATCH ossl_kdf_hkdf_sha256_functions[];
+extern const OSSL_DISPATCH ossl_kdf_hkdf_sha384_functions[];
+extern const OSSL_DISPATCH ossl_kdf_hkdf_sha512_functions[];
+extern const OSSL_DISPATCH ossl_kdf_ikev2kdf_functions[];
 extern const OSSL_DISPATCH ossl_kdf_tls1_3_kdf_functions[];
+extern const OSSL_DISPATCH ossl_kdf_snmpkdf_functions[];
+extern const OSSL_DISPATCH ossl_kdf_srtpkdf_functions[];
 extern const OSSL_DISPATCH ossl_kdf_sshkdf_functions[];
 extern const OSSL_DISPATCH ossl_kdf_sskdf_functions[];
 extern const OSSL_DISPATCH ossl_kdf_x963_kdf_functions[];
@@ -322,7 +343,11 @@ extern const OSSL_DISPATCH ossl_ed448_keymgmt_functions[];
 #endif
 #ifndef OPENSSL_NO_SM2
 extern const OSSL_DISPATCH ossl_sm2_keymgmt_functions[];
+extern const OSSL_DISPATCH ossl_curve_sm2_keymgmt_functions[];
+#endif
 #endif
+#ifndef OPENSSL_NO_LMS
+extern const OSSL_DISPATCH ossl_lms_keymgmt_functions[];
 #endif
 extern const OSSL_DISPATCH ossl_ml_dsa_44_keymgmt_functions[];
 extern const OSSL_DISPATCH ossl_ml_dsa_65_keymgmt_functions[];
@@ -338,6 +363,9 @@ extern const OSSL_DISPATCH ossl_mlx_x448_kem_kmgmt_functions[];
 #endif
 extern const OSSL_DISPATCH ossl_mlx_p256_kem_kmgmt_functions[];
 extern const OSSL_DISPATCH ossl_mlx_p384_kem_kmgmt_functions[];
+#ifndef OPENSSL_NO_SM2
+extern const OSSL_DISPATCH ossl_mlx_curve_sm2_kem_kmgmt_functions[];
+#endif
 #endif
 #endif
 #ifndef OPENSSL_NO_SLH_DSA
@@ -366,6 +394,9 @@ extern const OSSL_DISPATCH ossl_x448_keyexch_functions[];
 #endif
 extern const OSSL_DISPATCH ossl_kdf_tls1_prf_keyexch_functions[];
 extern const OSSL_DISPATCH ossl_kdf_hkdf_keyexch_functions[];
+extern const OSSL_DISPATCH ossl_kdf_hkdf_sha256_keyexch_functions[];
+extern const OSSL_DISPATCH ossl_kdf_hkdf_sha384_keyexch_functions[];
+extern const OSSL_DISPATCH ossl_kdf_hkdf_sha512_keyexch_functions[];
 extern const OSSL_DISPATCH ossl_kdf_scrypt_keyexch_functions[];

 /* Signature */
@@ -420,6 +451,7 @@ extern const OSSL_DISPATCH ossl_mac_legacy_siphash_signature_functions[];
 extern const OSSL_DISPATCH ossl_mac_legacy_poly1305_signature_functions[];
 extern const OSSL_DISPATCH ossl_mac_legacy_cmac_signature_functions[];
 extern const OSSL_DISPATCH ossl_sm2_signature_functions[];
+extern const OSSL_DISPATCH ossl_lms_signature_functions[];
 extern const OSSL_DISPATCH ossl_ml_dsa_44_signature_functions[];
 extern const OSSL_DISPATCH ossl_ml_dsa_65_signature_functions[];
 extern const OSSL_DISPATCH ossl_ml_dsa_87_signature_functions[];
@@ -722,6 +754,10 @@ extern const OSSL_DISPATCH ossl_slh_dsa_shake_192f_to_text_encoder_functions[];
 extern const OSSL_DISPATCH ossl_slh_dsa_shake_256s_to_text_encoder_functions[];
 extern const OSSL_DISPATCH ossl_slh_dsa_shake_256f_to_text_encoder_functions[];

+extern const OSSL_DISPATCH ossl_lms_to_SubjectPublicKeyInfo_der_encoder_functions[];
+extern const OSSL_DISPATCH ossl_lms_to_SubjectPublicKeyInfo_pem_encoder_functions[];
+extern const OSSL_DISPATCH ossl_lms_to_text_encoder_functions[];
+
 /* Decoders */
 extern const OSSL_DISPATCH ossl_PrivateKeyInfo_der_to_dh_decoder_functions[];
 extern const OSSL_DISPATCH ossl_SubjectPublicKeyInfo_der_to_dh_decoder_functions[];
@@ -837,6 +873,9 @@ extern const OSSL_DISPATCH ossl_pem_to_der_decoder_functions[];
 extern const OSSL_DISPATCH ossl_file_store_functions[];
 extern const OSSL_DISPATCH ossl_winstore_store_functions[];

+extern const OSSL_DISPATCH ossl_xdr_to_lms_decoder_functions[];
+extern const OSSL_DISPATCH ossl_SubjectPublicKeyInfo_der_to_lms_decoder_functions[];
+
 extern const OSSL_DISPATCH ossl_PrivateKeyInfo_der_to_ml_dsa_44_decoder_functions[];
 extern const OSSL_DISPATCH ossl_SubjectPublicKeyInfo_der_to_ml_dsa_44_decoder_functions[];

@@ -848,3 +887,5 @@ extern const OSSL_DISPATCH ossl_SubjectPublicKeyInfo_der_to_ml_dsa_87_decoder_fu

 extern const OSSL_DISPATCH ossl_generic_skeymgmt_functions[];
 extern const OSSL_DISPATCH ossl_aes_skeymgmt_functions[];
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_IMPLEMENTATIONS_H) */
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/kdfexchange.h b/deps/openssl/openssl/providers/implementations/include/prov/kdfexchange.h
index cf08f785ee0..4ccf74871ef 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/kdfexchange.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/kdfexchange.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_KDFEXCHANGE_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_KDFEXCHANGE_H
+
 #include <stdlib.h>
 #include <openssl/crypto.h>
 #include "internal/refcount.h"
@@ -21,3 +24,5 @@ typedef struct kdf_data_st KDF_DATA;
 KDF_DATA *ossl_kdf_data_new(void *provctx);
 void ossl_kdf_data_free(KDF_DATA *kdfdata);
 int ossl_kdf_data_up_ref(KDF_DATA *kdfdata);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_KDFEXCHANGE_H) */
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/lms_codecs.h b/deps/openssl/openssl/providers/implementations/include/prov/lms_codecs.h
new file mode 100644
index 00000000000..6dfe9dff711
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/include/prov/lms_codecs.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef PROV_LMS_CODECS_H
+#define PROV_LMS_CODECS_H
+#pragma once
+
+#ifndef OPENSSL_NO_LMS
+#include <openssl/e_os2.h>
+#include "crypto/lms.h"
+#include "prov/ciphercommon.h"
+#include "prov/provider_ctx.h"
+
+__owur LMS_KEY *
+ossl_lms_d2i_PUBKEY(const uint8_t *pubenc, int publen, PROV_CTX *provctx);
+__owur int ossl_lms_i2d_pubkey(const LMS_KEY *key, unsigned char **out);
+__owur int ossl_lms_key_to_text(BIO *out, const LMS_KEY *key, int selection);
+
+#endif /* OPENSSL_NO_LMS */
+#endif /* PROV_LMS_CODECS_H */
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/macsignature.h b/deps/openssl/openssl/providers/implementations/include/prov/macsignature.h
index e13ff362ce0..843a67b4b11 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/macsignature.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/macsignature.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_MACSIGNATURE_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_MACSIGNATURE_H
+
 #include <stdlib.h>
 #include <openssl/crypto.h>
 #include "internal/refcount.h"
@@ -27,3 +30,5 @@ typedef struct mac_key_st MAC_KEY;
 MAC_KEY *ossl_mac_key_new(OSSL_LIB_CTX *libctx, int cmac);
 void ossl_mac_key_free(MAC_KEY *mackey);
 int ossl_mac_key_up_ref(MAC_KEY *mackey);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_MACSIGNATURE_H) */
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/ml_common_codecs.h b/deps/openssl/openssl/providers/implementations/include/prov/ml_common_codecs.h
similarity index 100%
rename from deps/openssl/openssl/providers/implementations/encode_decode/ml_common_codecs.h
rename to deps/openssl/openssl/providers/implementations/include/prov/ml_common_codecs.h
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/ml_dsa.h b/deps/openssl/openssl/providers/implementations/include/prov/ml_dsa.h
index fca8a306253..b26fc15cc8b 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/ml_dsa.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/ml_dsa.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,8 +7,13 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ML_DSA_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ML_DSA_H
+
 #include "crypto/ml_dsa.h"
 #include "prov/provider_ctx.h"

 ML_DSA_KEY *
 ossl_prov_ml_dsa_new(PROV_CTX *provctx, const char *propq, int evp_type);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ML_DSA_H) */
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/ml_dsa_codecs.h b/deps/openssl/openssl/providers/implementations/include/prov/ml_dsa_codecs.h
similarity index 93%
rename from deps/openssl/openssl/providers/implementations/encode_decode/ml_dsa_codecs.h
rename to deps/openssl/openssl/providers/implementations/include/prov/ml_dsa_codecs.h
index ededb2b0dcb..49c34420adc 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/ml_dsa_codecs.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/ml_dsa_codecs.h
@@ -15,7 +15,7 @@
 #include <openssl/e_os2.h>
 #include "crypto/ml_dsa.h"
 #include "prov/provider_ctx.h"
-#include "ml_common_codecs.h"
+#include "prov/ml_common_codecs.h"

 __owur ML_DSA_KEY *ossl_ml_dsa_d2i_PUBKEY(const uint8_t *pubenc, int publen,
     int evp_type, PROV_CTX *provctx,
@@ -26,7 +26,7 @@ __owur ML_DSA_KEY *ossl_ml_dsa_d2i_PKCS8(const uint8_t *prvenc, int prvlen,
 __owur int ossl_ml_dsa_key_to_text(BIO *out, const ML_DSA_KEY *key, int selection);
 __owur int ossl_ml_dsa_i2d_pubkey(const ML_DSA_KEY *key, unsigned char **out);
 __owur int ossl_ml_dsa_i2d_prvkey(const ML_DSA_KEY *key, unsigned char **out,
-    PROV_CTX *provctx);
+    PROV_CTX *provctx, const char *formats);

 #endif /* OPENSSL_NO_ML_DSA */
 #endif /* PROV_ML_DSA_CODECS_H */
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/ml_kem.h b/deps/openssl/openssl/providers/implementations/include/prov/ml_kem.h
index b82ef1baa03..3d291ac7a76 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/ml_kem.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/ml_kem.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,8 +7,13 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ML_KEM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ML_KEM_H
+
 #include "crypto/ml_kem.h"
 #include "prov/provider_ctx.h"

 ML_KEM_KEY *
 ossl_prov_ml_kem_new(PROV_CTX *provctx, const char *propq, int evp_type);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ML_KEM_H) */
diff --git a/deps/openssl/openssl/providers/implementations/encode_decode/ml_kem_codecs.h b/deps/openssl/openssl/providers/implementations/include/prov/ml_kem_codecs.h
similarity index 93%
rename from deps/openssl/openssl/providers/implementations/encode_decode/ml_kem_codecs.h
rename to deps/openssl/openssl/providers/implementations/include/prov/ml_kem_codecs.h
index b9add59bb12..463e1f08887 100644
--- a/deps/openssl/openssl/providers/implementations/encode_decode/ml_kem_codecs.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/ml_kem_codecs.h
@@ -15,7 +15,7 @@
 #include <openssl/e_os2.h>
 #include "crypto/ml_kem.h"
 #include "prov/provider_ctx.h"
-#include "ml_common_codecs.h"
+#include "prov/ml_common_codecs.h"

 __owur ML_KEM_KEY *ossl_ml_kem_d2i_PUBKEY(const uint8_t *pubenc, int publen,
     int evp_type, PROV_CTX *provctx,
@@ -26,7 +26,7 @@ __owur ML_KEM_KEY *ossl_ml_kem_d2i_PKCS8(const uint8_t *prvenc, int prvlen,
 __owur int ossl_ml_kem_key_to_text(BIO *out, const ML_KEM_KEY *key, int selection);
 __owur int ossl_ml_kem_i2d_pubkey(const ML_KEM_KEY *key, unsigned char **out);
 __owur int ossl_ml_kem_i2d_prvkey(const ML_KEM_KEY *key, unsigned char **out,
-    PROV_CTX *provctx);
+    PROV_CTX *provctx, const char *formats);

 #endif /* OPENSSL_NO_ML_KEM */
 #endif /* PROV_ML_KEM_CODECS_H */
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/names.h b/deps/openssl/openssl/providers/implementations/include/prov/names.h
index 3b747ec92c0..09146dd01ed 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/names.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/names.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -40,6 +40,9 @@
  * Symmetric ciphers
  * -----------------
  */
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_NAMES_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_NAMES_H
+
 #define PROV_NAMES_AES "AES:2.16.840.1.101.3.4.1"
 #define PROV_DESCS_AES "OpenSSL AES opaque secret key"
 #define PROV_NAMES_GENERIC "GENERIC-SECRET"
@@ -211,6 +214,15 @@
 #define PROV_NAMES_DES_CFB "DES-CFB:1.3.14.3.2.9"
 #define PROV_NAMES_DES_CFB1 "DES-CFB1"
 #define PROV_NAMES_DES_CFB8 "DES-CFB8"
+#define PROV_NAMES_AES_128_CBC_HMAC_SHA1_ETM "AES-128-CBC-HMAC-SHA1-ETM"
+#define PROV_NAMES_AES_192_CBC_HMAC_SHA1_ETM "AES-192-CBC-HMAC-SHA1-ETM"
+#define PROV_NAMES_AES_256_CBC_HMAC_SHA1_ETM "AES-256-CBC-HMAC-SHA1-ETM"
+#define PROV_NAMES_AES_128_CBC_HMAC_SHA256_ETM "AES-128-CBC-HMAC-SHA256-ETM"
+#define PROV_NAMES_AES_192_CBC_HMAC_SHA256_ETM "AES-192-CBC-HMAC-SHA256-ETM"
+#define PROV_NAMES_AES_256_CBC_HMAC_SHA256_ETM "AES-256-CBC-HMAC-SHA256-ETM"
+#define PROV_NAMES_AES_128_CBC_HMAC_SHA512_ETM "AES-128-CBC-HMAC-SHA512-ETM"
+#define PROV_NAMES_AES_192_CBC_HMAC_SHA512_ETM "AES-192-CBC-HMAC-SHA512-ETM"
+#define PROV_NAMES_AES_256_CBC_HMAC_SHA512_ETM "AES-256-CBC-HMAC-SHA512-ETM"

 /*-
  * Digests
@@ -239,12 +251,14 @@
 #define PROV_NAMES_SHAKE_128 "SHAKE-128:SHAKE128:2.16.840.1.101.3.4.2.11"
 #define PROV_NAMES_SHAKE_256 "SHAKE-256:SHAKE256:2.16.840.1.101.3.4.2.12"

-/*
- * KECCAK-KMAC-128 and KECCAK-KMAC-256 as hashes are mostly useful for
- * KMAC128 and KMAC256.
- */
-#define PROV_NAMES_KECCAK_KMAC_128 "KECCAK-KMAC-128:KECCAK-KMAC128"
-#define PROV_NAMES_KECCAK_KMAC_256 "KECCAK-KMAC-256:KECCAK-KMAC256"
+#define PROV_NAMES_CSHAKE_128 "CSHAKE-128:CSHAKE128"
+#define PROV_NAMES_CSHAKE_256 "CSHAKE-256:CSHAKE256"
+
+/* Internal algorithms used by CSHAKE variants */
+#define PROV_NAMES_CSHAKE_KECCAK_128 "CSHAKE-KECCAK-128:KECCAK-KMAC-128:KECCAK-KMAC128"
+#define PROV_NAMES_CSHAKE_KECCAK_256 "CSHAKE-KECCAK-256:KECCAK-KMAC-256:KECCAK-KMAC256"
+#define PROV_NAMES_KECCAK_KMAC_128 PROV_NAMES_CSHAKE_KECCAK_128
+#define PROV_NAMES_KECCAK_KMAC_256 PROV_NAMES_CSHAKE_KECCAK_256
 /*
  * https://blake2.net/ doesn't specify size variants, but mentions that
  * Bouncy Castle uses the names BLAKE2b-160, BLAKE2b-256, BLAKE2b-384, and
@@ -262,6 +276,12 @@
 #define PROV_NAMES_MDC2 "MDC2:2.5.8.3.101"
 #define PROV_NAMES_WHIRLPOOL "WHIRLPOOL:1.0.10118.3.0.55"
 #define PROV_NAMES_RIPEMD_160 "RIPEMD-160:RIPEMD160:RIPEMD:RMD160:1.3.36.3.2.1"
+/*
+ * Name taken from
+ * https://csrc.nist.gov/csrc/media/Projects/post-quantum-cryptography/documents/faq/fips204-sec6-03192025.pdf
+ * See ExternalMu-ML-DSA.Prehash
+ */
+#define PROV_NAMES_ML_DSA_MU "ML-DSA-MU"

 /*-
  * KDFs / PRFs
@@ -269,11 +289,20 @@
  */
 #define PROV_NAMES_HKDF "HKDF"
 #define PROV_DESCS_HKDF_SIGN "OpenSSL HKDF via EVP_PKEY implementation"
+#define PROV_NAMES_HKDF_SHA256 "HKDF-SHA256:id-alg-hkdf-with-sha256:1.2.840.113549.1.9.16.3.28"
+#define PROV_DESCS_HKDF_SHA256_SIGN "OpenSSL HKDF-SHA256 via EVP_PKEY implementation"
+#define PROV_NAMES_HKDF_SHA384 "HKDF-SHA384:id-alg-hkdf-with-sha384:1.2.840.113549.1.9.16.3.29"
+#define PROV_DESCS_HKDF_SHA384_SIGN "OpenSSL HKDF-SHA384 via EVP_PKEY implementation"
+#define PROV_NAMES_HKDF_SHA512 "HKDF-SHA512:id-alg-hkdf-with-sha512:1.2.840.113549.1.9.16.3.30"
+#define PROV_DESCS_HKDF_SHA512_SIGN "OpenSSL HKDF-SHA512 via EVP_PKEY implementation"
+#define PROV_NAMES_IKEV2KDF "IKEV2KDF"
 #define PROV_NAMES_TLS1_3_KDF "TLS13-KDF"
 #define PROV_NAMES_SSKDF "SSKDF"
 #define PROV_NAMES_PBKDF1 "PBKDF1"
 #define PROV_NAMES_PBKDF2 "PBKDF2:1.2.840.113549.1.5.12"
 #define PROV_NAMES_PVKKDF "PVKKDF"
+#define PROV_NAMES_SNMPKDF "SNMPKDF"
+#define PROV_NAMES_SRTPKDF "SRTPKDF"
 #define PROV_NAMES_SSHKDF "SSHKDF"
 #define PROV_NAMES_X963KDF "X963KDF:X942KDF-CONCAT"
 #define PROV_NAMES_X942KDF_ASN1 "X942KDF-ASN1:X942KDF"
@@ -385,10 +414,14 @@
 #define PROV_NAMES_RSA_SHA3_384 "RSA-SHA3-384:id-rsassa-pkcs1-v1_5-with-sha3-384:2.16.840.1.101.3.4.3.15"
 #define PROV_NAMES_RSA_SHA3_512 "RSA-SHA3-512:id-rsassa-pkcs1-v1_5-with-sha3-512:2.16.840.1.101.3.4.3.16"
 #define PROV_DESCS_RSA "OpenSSL RSA implementation"
-#define PROV_NAMES_RSA_PSS "RSA-PSS:RSASSA-PSS:1.2.840.113549.1.1.10"
+#define PROV_NAMES_RSA_PSS "RSA-PSS:RSASSA-PSS:rsassaPss:1.2.840.113549.1.1.10"
 #define PROV_DESCS_RSA_PSS "OpenSSL RSA-PSS implementation"
 #define PROV_NAMES_SM2 "SM2:1.2.156.10197.1.301"
 #define PROV_DESCS_SM2 "OpenSSL SM2 implementation"
+#define PROV_NAMES_curveSM2 "curveSM2"
+#define PROV_DESCS_curveSM2 "OpenSSL curveSM2 implementation"
+#define PROV_NAMES_LMS "LMS:id-alg-hss-lms-hashsig:1.2.840.113549.1.9.16.3.17"
+#define PROV_DESCS_LMS "OpenSSL LMS implementation"
 #define PROV_NAMES_ML_DSA_44 "ML-DSA-44:MLDSA44:2.16.840.1.101.3.4.3.17:id-ml-dsa-44"
 #define PROV_DESCS_ML_DSA_44 "OpenSSL ML-DSA-44 implementation"
 #define PROV_NAMES_ML_DSA_65 "ML-DSA-65:MLDSA65:2.16.840.1.101.3.4.3.18:id-ml-dsa-65"
@@ -409,6 +442,8 @@
 #define PROV_DESCS_SecP256r1MLKEM768 "P-256+ML-KEM-768 TLS hybrid implementation"
 #define PROV_NAMES_SecP384r1MLKEM1024 "SecP384r1MLKEM1024"
 #define PROV_DESCS_SecP384r1MLKEM1024 "P-384+ML-KEM-1024 TLS hybrid implementation"
+#define PROV_NAMES_curveSM2MLKEM768 "curveSM2MLKEM768"
+#define PROV_DESCS_curveSM2MLKEM768 "curveSM2+ML-KEM-768 TLS hybrid implementation"
 #define PROV_NAMES_SLH_DSA_SHA2_128S "SLH-DSA-SHA2-128s:id-slh-dsa-sha2-128s:2.16.840.1.101.3.4.3.20"
 #define PROV_NAMES_SLH_DSA_SHA2_128F "SLH-DSA-SHA2-128f:id-slh-dsa-sha2-128f:2.16.840.1.101.3.4.3.21"
 #define PROV_NAMES_SLH_DSA_SHA2_192S "SLH-DSA-SHA2-192s:id-slh-dsa-sha2-192s:2.16.840.1.101.3.4.3.22"
@@ -433,3 +468,5 @@
 #define PROV_DESCS_SLH_DSA_SHAKE_192F "OpenSSL SLH-DSA-SHAKE-192f implementation"
 #define PROV_DESCS_SLH_DSA_SHAKE_256S "OpenSSL SLH-DSA-SHAKE-256s implementation"
 #define PROV_DESCS_SLH_DSA_SHAKE_256F "OpenSSL SLH-DSA-SHAKE-256f implementation"
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_NAMES_H) */
diff --git a/deps/openssl/openssl/providers/implementations/include/prov/seeding.h b/deps/openssl/openssl/providers/implementations/include/prov/seeding.h
index a6d720dfe42..47989f08146 100644
--- a/deps/openssl/openssl/providers/implementations/include/prov/seeding.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/seeding.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_SEEDING_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_SEEDING_H
+
 #include "prov/provider_ctx.h"
 #include "crypto/rand_pool.h"

@@ -28,3 +31,5 @@ size_t ossl_prov_get_nonce(PROV_CTX *prov_ctx, unsigned char **pout,
     const void *salt, size_t salt_len);
 void ossl_prov_cleanup_nonce(PROV_CTX *prov_ctx, unsigned char *buf,
     size_t len);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_SEEDING_H) */
diff --git a/deps/openssl/openssl/providers/implementations/skeymgmt/skeymgmt_lcl.h b/deps/openssl/openssl/providers/implementations/include/prov/skeymgmt_lcl.h
similarity index 61%
rename from deps/openssl/openssl/providers/implementations/skeymgmt/skeymgmt_lcl.h
rename to deps/openssl/openssl/providers/implementations/include/prov/skeymgmt_lcl.h
index c75776cce42..946136294bc 100644
--- a/deps/openssl/openssl/providers/implementations/skeymgmt/skeymgmt_lcl.h
+++ b/deps/openssl/openssl/providers/implementations/include/prov/skeymgmt_lcl.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,5 +15,9 @@
 OSSL_FUNC_skeymgmt_import_fn generic_import;
 OSSL_FUNC_skeymgmt_export_fn generic_export;
 OSSL_FUNC_skeymgmt_free_fn generic_free;
+OSSL_FUNC_skeymgmt_imp_settable_params_fn generic_imp_settable_params;
+OSSL_FUNC_skeymgmt_get_key_id_fn generic_get_key_id;
+OSSL_FUNC_skeymgmt_get_local_keyid_fn generic_get_local_keyid;
+OSSL_FUNC_skeymgmt_get_algorithm_id_fn generic_get_algorithm_id;

 #endif
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/argon2.c b/deps/openssl/openssl/providers/implementations/kdfs/argon2.c
index c36bbc62006..b988aa212f9 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/argon2.c
+++ b/deps/openssl/openssl/providers/implementations/kdfs/argon2.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -43,6 +43,8 @@

 #ifndef OPENSSL_NO_ARGON2

+#include "providers/implementations/kdfs/argon2.inc"
+
 #define ARGON2_MIN_LANES 1u
 #define ARGON2_MAX_LANES 0xFFFFFFu
 #define ARGON2_MIN_THREADS 1u
@@ -219,6 +221,8 @@ static const OSSL_PARAM *kdf_argon2_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *p_ctx);
 static const OSSL_PARAM *kdf_argon2_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *p_ctx);
+static int argon2_set_ctx_params(KDF_ARGON2 *ctx, const OSSL_PARAM params[],
+    OSSL_PARAM **size_param_ptr);

 static ossl_inline uint64_t load64(const uint8_t *src);
 static ossl_inline void store32(uint8_t *dst, uint32_t w);
@@ -559,8 +563,8 @@ static int fill_mem_blocks_mt(KDF_ARGON2 *ctx)
     void **t;
     ARGON2_THREAD_DATA *t_data;

-    t = OPENSSL_zalloc(sizeof(void *) * ctx->lanes);
-    t_data = OPENSSL_zalloc(ctx->lanes * sizeof(ARGON2_THREAD_DATA));
+    t = OPENSSL_calloc(ctx->lanes, sizeof(void *));
+    t_data = OPENSSL_calloc(ctx->lanes, sizeof(ARGON2_THREAD_DATA));

     if (t == NULL || t_data == NULL)
         goto fail;
@@ -728,9 +732,9 @@ static int initialize(KDF_ARGON2 *ctx)
         return 0;

     if (ctx->type != ARGON2_D)
-        ctx->memory = OPENSSL_secure_zalloc(ctx->memory_blocks * sizeof(BLOCK));
+        ctx->memory = OPENSSL_secure_calloc(ctx->memory_blocks, sizeof(BLOCK));
     else
-        ctx->memory = OPENSSL_zalloc(ctx->memory_blocks * sizeof(BLOCK));
+        ctx->memory = OPENSSL_calloc(ctx->memory_blocks, sizeof(BLOCK));

     if (ctx->memory == NULL) {
         ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_MEMORY_SIZE,
@@ -1012,10 +1016,12 @@ static int kdf_argon2_derive(void *vctx, unsigned char *out, size_t outlen,
 {
     KDF_ARGON2 *ctx;
     uint32_t memory_blocks, segment_length;
+    OSSL_PARAM *size_param;

     ctx = (KDF_ARGON2 *)vctx;

-    if (!ossl_prov_is_running() || !kdf_argon2_set_ctx_params(vctx, params))
+    if (!ossl_prov_is_running()
+        || !argon2_set_ctx_params(vctx, params, &size_param))
         return 0;

     if (ctx->mac == NULL)
@@ -1040,7 +1046,8 @@ static int kdf_argon2_derive(void *vctx, unsigned char *out, size_t outlen,
     }

     if (outlen != ctx->outlen) {
-        if (OSSL_PARAM_locate((OSSL_PARAM *)params, "size") != NULL) {
+        /* User set a size that was too short so raise an error */
+        if (size_param != NULL) {
             ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
             return 0;
         }
@@ -1384,118 +1391,108 @@ static int set_property_query(KDF_ARGON2 *ctx, const char *propq)
     return 1;
 }

-static int kdf_argon2_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+static int argon2_set_ctx_params(KDF_ARGON2 *ctx, const OSSL_PARAM params[],
+    OSSL_PARAM **size_param_ptr)
 {
-    const OSSL_PARAM *p;
-    KDF_ARGON2 *ctx;
+    struct argon2_set_ctx_params_st p;
     uint32_t u32_value;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !argon2_set_ctx_params_decoder(params, &p))
+        return 0;

-    ctx = (KDF_ARGON2 *)vctx;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_PASSWORD)) != NULL)
-        if (!kdf_argon2_ctx_set_pwd(ctx, p))
-            return 0;
+    if (p.pw != NULL && !kdf_argon2_ctx_set_pwd(ctx, p.pw))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SALT)) != NULL)
-        if (!kdf_argon2_ctx_set_salt(ctx, p))
-            return 0;
+    if (p.salt != NULL && !kdf_argon2_ctx_set_salt(ctx, p.salt))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SECRET)) != NULL)
-        if (!kdf_argon2_ctx_set_secret(ctx, p))
-            return 0;
+    if (p.secret != NULL && !kdf_argon2_ctx_set_secret(ctx, p.secret))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_ARGON2_AD)) != NULL)
-        if (!kdf_argon2_ctx_set_ad(ctx, p))
-            return 0;
+    if (p.ad != NULL && !kdf_argon2_ctx_set_ad(ctx, p.ad))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SIZE)) != NULL) {
-        if (!OSSL_PARAM_get_uint32(p, &u32_value))
+    if ((*size_param_ptr = p.size) != NULL) {
+        if (!OSSL_PARAM_get_uint32(p.size, &u32_value))
             return 0;
         if (!kdf_argon2_ctx_set_out_length(ctx, u32_value))
             return 0;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_ITER)) != NULL) {
-        if (!OSSL_PARAM_get_uint32(p, &u32_value))
+    if (p.iter != NULL) {
+        if (!OSSL_PARAM_get_uint32(p.iter, &u32_value))
             return 0;
         if (!kdf_argon2_ctx_set_t_cost(ctx, u32_value))
             return 0;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_THREADS)) != NULL) {
-        if (!OSSL_PARAM_get_uint32(p, &u32_value))
+    if (p.thrds != NULL) {
+        if (!OSSL_PARAM_get_uint32(p.thrds, &u32_value))
             return 0;
         if (!kdf_argon2_ctx_set_threads(ctx, u32_value))
             return 0;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_ARGON2_LANES)) != NULL) {
-        if (!OSSL_PARAM_get_uint32(p, &u32_value))
+    if (p.lanes != NULL) {
+        if (!OSSL_PARAM_get_uint32(p.lanes, &u32_value))
             return 0;
         if (!kdf_argon2_ctx_set_lanes(ctx, u32_value))
             return 0;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_ARGON2_MEMCOST)) != NULL) {
-        if (!OSSL_PARAM_get_uint32(p, &u32_value))
+    if (p.mem != NULL) {
+        if (!OSSL_PARAM_get_uint32(p.mem, &u32_value))
             return 0;
         if (!kdf_argon2_ctx_set_m_cost(ctx, u32_value))
             return 0;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_EARLY_CLEAN)) != NULL) {
-        if (!OSSL_PARAM_get_uint32(p, &u32_value))
+    if (p.eclean != NULL) {
+        if (!OSSL_PARAM_get_uint32(p.eclean, &u32_value))
             return 0;
         kdf_argon2_ctx_set_flag_early_clean(ctx, u32_value);
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_ARGON2_VERSION)) != NULL) {
-        if (!OSSL_PARAM_get_uint32(p, &u32_value))
+    if (p.vers != NULL) {
+        if (!OSSL_PARAM_get_uint32(p.vers, &u32_value))
             return 0;
         if (!kdf_argon2_ctx_set_version(ctx, u32_value))
             return 0;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_PROPERTIES)) != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING
-            || !set_property_query(ctx, p->data))
+    if (p.propq != NULL) {
+        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING
+            || !set_property_query(ctx, p.propq->data))
             return 0;
     }

     return 1;
 }

+static int kdf_argon2_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+{
+    KDF_ARGON2 *ctx = (KDF_ARGON2 *)vctx;
+    OSSL_PARAM *size_param;
+
+    return argon2_set_ctx_params(ctx, params, &size_param);
+}
+
 static const OSSL_PARAM *kdf_argon2_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_PASSWORD, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SALT, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SECRET, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_ARGON2_AD, NULL, 0),
-        OSSL_PARAM_uint32(OSSL_KDF_PARAM_SIZE, NULL),
-        OSSL_PARAM_uint32(OSSL_KDF_PARAM_ITER, NULL),
-        OSSL_PARAM_uint32(OSSL_KDF_PARAM_THREADS, NULL),
-        OSSL_PARAM_uint32(OSSL_KDF_PARAM_ARGON2_LANES, NULL),
-        OSSL_PARAM_uint32(OSSL_KDF_PARAM_ARGON2_MEMCOST, NULL),
-        OSSL_PARAM_uint32(OSSL_KDF_PARAM_EARLY_CLEAN, NULL),
-        OSSL_PARAM_uint32(OSSL_KDF_PARAM_ARGON2_VERSION, NULL),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_END
-    };
-
-    return known_settable_ctx_params;
+    return argon2_set_ctx_params_list;
 }

 static int kdf_argon2_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    struct argon2_get_ctx_params_st p;
+    KDF_ARGON2 *ctx = (KDF_ARGON2 *)vctx;
+
+    if (ctx == NULL || !argon2_get_ctx_params_decoder(params, &p))
+        return 0;

-    (void)vctx;
-    if ((p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_SIZE)) != NULL)
-        return OSSL_PARAM_set_size_t(p, SIZE_MAX);
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, SIZE_MAX))
+        return 0;

     return -2;
 }
@@ -1503,12 +1500,7 @@ static int kdf_argon2_get_ctx_params(void *vctx, OSSL_PARAM params[])
 static const OSSL_PARAM *kdf_argon2_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL),
-        OSSL_PARAM_END
-    };
-
-    return known_gettable_ctx_params;
+    return argon2_get_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_kdf_argon2i_functions[] = {
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/argon2.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/argon2.inc.in
new file mode 100644
index 00000000000..d1fbe2b8bc1
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/argon2.inc.in
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('argon2_set_ctx_params',
+                         (['OSSL_KDF_PARAM_PASSWORD',       'pw',     'octet_string'],
+                          ['OSSL_KDF_PARAM_SALT',           'salt',   'octet_string'],
+                          ['OSSL_KDF_PARAM_SECRET',         'secret', 'octet_string'],
+                          ['OSSL_KDF_PARAM_ARGON2_AD',      'ad',     'octet_string'],
+                          ['OSSL_KDF_PARAM_SIZE',           'size',   'uint32'],
+                          ['OSSL_KDF_PARAM_ITER',           'iter',   'uint32'],
+                          ['OSSL_KDF_PARAM_THREADS',        'thrds',  'uint32'],
+                          ['OSSL_KDF_PARAM_ARGON2_LANES',   'lanes',  'uint32'],
+                          ['OSSL_KDF_PARAM_ARGON2_MEMCOST', 'mem',    'uint32'],
+                          ['OSSL_KDF_PARAM_EARLY_CLEAN',    'eclean', 'uint32'],
+                          ['OSSL_KDF_PARAM_ARGON2_VERSION', 'vers',   'uint32'],
+                          ['OSSL_KDF_PARAM_PROPERTIES',     'propq',  'utf8_string'],
+                         )); -}
+
+{- produce_param_decoder('argon2_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',                    'size', 'size_t'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/build.info b/deps/openssl/openssl/providers/implementations/kdfs/build.info
index 417d173e127..1a890cd45d3 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/build.info
+++ b/deps/openssl/openssl/providers/implementations/kdfs/build.info
@@ -3,6 +3,7 @@

 $TLS1_PRF_GOAL=../../libdefault.a ../../libfips.a
 $HKDF_GOAL=../../libdefault.a ../../libfips.a
+$IKEV2_GOAL=../../libdefault.a ../../libfips.a
 $KBKDF_GOAL=../../libdefault.a ../../libfips.a
 $KRB5KDF_GOAL=../../libdefault.a
 $PBKDF1_GOAL=../../liblegacy.a
@@ -11,36 +12,65 @@ $PVKKDF_GOAL=../../liblegacy.a
 $PKCS12KDF_GOAL=../../libdefault.a
 $SSKDF_GOAL=../../libdefault.a ../../libfips.a
 $SCRYPT_GOAL=../../libdefault.a
+$SNMPKDF_GOAL=../../libdefault.a ../../libfips.a
+$SRTPKDF_GOAL=../../libdefault.a ../../libfips.a
 $SSHKDF_GOAL=../../libdefault.a ../../libfips.a
 $X942KDF_GOAL=../../libdefault.a ../../libfips.a
-$HMAC_DRBG_KDF_GOAL=../../libdefault.a
+$HMAC_DRBG_KDF_GOAL=../../libdefault.a ../../libfips.a
 $ARGON2_GOAL=../../libdefault.a

 SOURCE[$TLS1_PRF_GOAL]=tls1_prf.c

 SOURCE[$HKDF_GOAL]=hkdf.c

-SOURCE[$KBKDF_GOAL]=kbkdf.c
+IF[{- !$disabled{ikev2kdf} -}]
+  SOURCE[$IKEV2_GOAL]=ikev2kdf.c
+ENDIF
+IF[{- !$disabled{kbkdf} -}]
+  SOURCE[$KBKDF_GOAL]=kbkdf.c
+ENDIF

-SOURCE[$KRB5KDF_GOAL]=krb5kdf.c
+IF[{- !$disabled{krb5kdf} -}]
+  SOURCE[$KRB5KDF_GOAL]=krb5kdf.c
+ENDIF

 SOURCE[$PBKDF1_GOAL]=pbkdf1.c

 SOURCE[$PBKDF2_GOAL]=pbkdf2.c
-# Extra code to satisfy the FIPS and non-FIPS separation.
-# When the PBKDF2 moves to legacy, this can be removed.
-SOURCE[$PBKDF2_GOAL]=pbkdf2_fips.c

-SOURCE[$PVKKDF_GOAL]=pvkkdf.c
+IF[{- !$disabled{pvkkdf} -}]
+  SOURCE[$PVKKDF_GOAL]=pvkkdf.c
+ENDIF

 SOURCE[$PKCS12KDF_GOAL]=pkcs12kdf.c

-SOURCE[$SSKDF_GOAL]=sskdf.c
+IF[{- !$disabled{sskdf} || !$disabled{x963kdf} -}]
+  SOURCE[$SSKDF_GOAL]=sskdf.c
+ENDIF

-SOURCE[$SCRYPT_GOAL]=scrypt.c
-SOURCE[$SSHKDF_GOAL]=sshkdf.c
-SOURCE[$X942KDF_GOAL]=x942kdf.c
-DEPEND[x942kdf.o]=../../common/include/prov/der_wrap.h
+IF[{- !$disabled{scrypt} -}]
+  SOURCE[$SCRYPT_GOAL]=scrypt.c
+ENDIF
+
+IF[{- !$disabled{snmpkdf} -}]
+  SOURCE[$SNMPKDF_GOAL]=snmpkdf.c
+ENDIF
+
+IF[{- !$disabled{srtpkdf} -}]
+  SOURCE[$SRTPKDF_GOAL]=srtpkdf.c
+ENDIF
+
+IF[{- !$disabled{sshkdf} -}]
+  SOURCE[$SSHKDF_GOAL]=sshkdf.c
+ENDIF
+
+IF[{- !$disabled{x942kdf} -}]
+  SOURCE[$X942KDF_GOAL]=x942kdf.c
+  DEPEND[x942kdf.o]=../../common/include/prov/der_wrap.h
+ENDIF
+
+IF[{- !$disabled{hmac-drbg-kdf} -}]
+  SOURCE[$HMAC_DRBG_KDF_GOAL]=hmacdrbg_kdf.c
+ENDIF

-SOURCE[$HMAC_DRBG_KDF_GOAL]=hmacdrbg_kdf.c
 SOURCE[$ARGON2_GOAL]=argon2.c
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/hkdf.c b/deps/openssl/openssl/providers/implementations/kdfs/hkdf.c
index b3c4cbf5279..c1a68f08ed6 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/hkdf.c
+++ b/deps/openssl/openssl/providers/implementations/kdfs/hkdf.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -31,10 +31,13 @@
 #include "prov/provider_util.h"
 #include "prov/securitycheck.h"
 #include "internal/e_os.h"
+#include "internal/fips.h"
 #include "internal/params.h"
+#include "internal/sizes.h"

 #define HKDF_MAXBUF 2048
 #define HKDF_MAXINFO (32 * 1024)
+#define HKDF_MAX_INFOS 5

 static OSSL_FUNC_kdf_newctx_fn kdf_hkdf_new;
 static OSSL_FUNC_kdf_dupctx_fn kdf_hkdf_dup;
@@ -43,13 +46,19 @@ static OSSL_FUNC_kdf_reset_fn kdf_hkdf_reset;
 static OSSL_FUNC_kdf_derive_fn kdf_hkdf_derive;
 static OSSL_FUNC_kdf_settable_ctx_params_fn kdf_hkdf_settable_ctx_params;
 static OSSL_FUNC_kdf_set_ctx_params_fn kdf_hkdf_set_ctx_params;
-static OSSL_FUNC_kdf_gettable_ctx_params_fn kdf_hkdf_gettable_ctx_params;
-static OSSL_FUNC_kdf_get_ctx_params_fn kdf_hkdf_get_ctx_params;
+static OSSL_FUNC_kdf_gettable_ctx_params_fn hkdf_gettable_ctx_params;
+static OSSL_FUNC_kdf_get_ctx_params_fn hkdf_common_get_ctx_params;
 static OSSL_FUNC_kdf_derive_fn kdf_tls1_3_derive;
 static OSSL_FUNC_kdf_settable_ctx_params_fn kdf_tls1_3_settable_ctx_params;
 static OSSL_FUNC_kdf_set_ctx_params_fn kdf_tls1_3_set_ctx_params;
-static OSSL_FUNC_kdf_gettable_ctx_params_fn kdf_tls1_3_gettable_ctx_params;
-static OSSL_FUNC_kdf_get_ctx_params_fn kdf_tls1_3_get_ctx_params;
+static OSSL_FUNC_kdf_newctx_fn kdf_hkdf_sha256_new;
+static OSSL_FUNC_kdf_newctx_fn kdf_hkdf_sha384_new;
+static OSSL_FUNC_kdf_newctx_fn kdf_hkdf_sha512_new;
+static OSSL_FUNC_kdf_settable_ctx_params_fn kdf_hkdf_fixed_digest_settable_ctx_params;
+static OSSL_FUNC_kdf_set_ctx_params_fn kdf_hkdf_fixed_digest_set_ctx_params;
+
+static void *kdf_hkdf_fixed_digest_new(void *provctx, const char *digest);
+static void kdf_hkdf_reset_ex(void *vctx, int on_free);

 static int HKDF(OSSL_LIB_CTX *libctx, const EVP_MD *evp_md,
     const unsigned char *salt, size_t salt_len,
@@ -65,20 +74,6 @@ static int HKDF_Expand(const EVP_MD *evp_md,
     const unsigned char *info, size_t info_len,
     unsigned char *okm, size_t okm_len);

-/* Settable context parameters that are common across HKDF and the TLS KDF */
-#define HKDF_COMMON_SETTABLES                                       \
-    OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_MODE, NULL, 0),           \
-        OSSL_PARAM_int(OSSL_KDF_PARAM_MODE, NULL),                  \
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0), \
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_DIGEST, NULL, 0),     \
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_KEY, NULL, 0),       \
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SALT, NULL, 0)
-
-/* Gettable context parameters that are common across HKDF and the TLS KDF */
-#define HKDF_COMMON_GETTABLES                     \
-    OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL), \
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_INFO, NULL, 0)
-
 typedef struct {
     void *provctx;
     int mode;
@@ -95,6 +90,7 @@ typedef struct {
     size_t data_len;
     unsigned char *info;
     size_t info_len;
+    int fixed_digest;
     OSSL_FIPS_IND_DECLARE
 } KDF_HKDF;

@@ -105,6 +101,12 @@ static void *kdf_hkdf_new(void *provctx)
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_KDF_HKDF))
+        return NULL;
+#endif
+
     if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) != NULL) {
         ctx->provctx = provctx;
         OSSL_FIPS_IND_INIT(ctx)
@@ -117,17 +119,28 @@ static void kdf_hkdf_free(void *vctx)
     KDF_HKDF *ctx = (KDF_HKDF *)vctx;

     if (ctx != NULL) {
-        kdf_hkdf_reset(ctx);
+        kdf_hkdf_reset_ex(vctx, 1);
         OPENSSL_free(ctx);
     }
 }

 static void kdf_hkdf_reset(void *vctx)
+{
+    kdf_hkdf_reset_ex(vctx, 0);
+}
+
+static void kdf_hkdf_reset_ex(void *vctx, int on_free)
 {
     KDF_HKDF *ctx = (KDF_HKDF *)vctx;
     void *provctx = ctx->provctx;
-
-    ossl_prov_digest_reset(&ctx->digest);
+    int preserve_digest = on_free ? 0 : ctx->fixed_digest;
+    PROV_DIGEST save_prov_digest = { 0 };
+
+    /* For fixed digests just save and restore the PROV_DIGEST object */
+    if (preserve_digest)
+        save_prov_digest = ctx->digest;
+    else
+        ossl_prov_digest_reset(&ctx->digest);
 #ifdef OPENSSL_PEDANTIC_ZEROIZATION
     OPENSSL_clear_free(ctx->salt, ctx->salt_len);
 #else
@@ -140,6 +153,10 @@ static void kdf_hkdf_reset(void *vctx)
     OPENSSL_clear_free(ctx->info, ctx->info_len);
     memset(ctx, 0, sizeof(*ctx));
     ctx->provctx = provctx;
+    if (preserve_digest) {
+        ctx->fixed_digest = preserve_digest;
+        ctx->digest = save_prov_digest;
+    }
 }

 static void *kdf_hkdf_dup(void *vctx)
@@ -164,6 +181,7 @@ static void *kdf_hkdf_dup(void *vctx)
             || !ossl_prov_digest_copy(&dest->digest, &src->digest))
             goto err;
         dest->mode = src->mode;
+        dest->fixed_digest = src->fixed_digest;
         OSSL_FIPS_IND_COPY(dest, src)
     }
     return dest;
@@ -201,7 +219,7 @@ static int fips_hkdf_key_check_passed(KDF_HKDF *ctx)
     if (!key_approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE0,
                 libctx, "HKDF", "Key size",
-                ossl_fips_config_hkdf_key_check)) {
+                FIPS_CONFIG_HKDF_KEY_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
             return 0;
         }
@@ -250,19 +268,38 @@ static int kdf_hkdf_derive(void *vctx, unsigned char *key, size_t keylen,
     }
 }

-static int hkdf_common_set_ctx_params(KDF_HKDF *ctx, const OSSL_PARAM params[])
+struct hkdf_all_set_ctx_params_st {
+    OSSL_PARAM *mode;
+    OSSL_PARAM *propq;
+    OSSL_PARAM *digest;
+    OSSL_PARAM *key;
+    OSSL_PARAM *salt;
+#ifdef FIPS_MODULE
+    OSSL_PARAM *ind_k;
+    OSSL_PARAM *ind_d;
+#endif
+    OSSL_PARAM *prefix;
+    OSSL_PARAM *label;
+    OSSL_PARAM *data;
+    OSSL_PARAM *info[HKDF_MAX_INFOS];
+    int num_info;
+};
+
+#define hkdf_set_ctx_params_st hkdf_all_set_ctx_params_st
+#define hkdf_fixed_digest_set_ctx_params_st hkdf_all_set_ctx_params_st
+#define kdf_tls1_3_set_ctx_params_st hkdf_all_set_ctx_params_st
+
+#include "providers/implementations/kdfs/hkdf.inc"
+
+static int hkdf_common_set_ctx_params(KDF_HKDF *ctx, struct hkdf_all_set_ctx_params_st *p)
 {
     OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
-    const OSSL_PARAM *p;
     int n;

-    if (ossl_param_is_empty(params))
-        return 1;
-
-    if (OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST) != NULL) {
+    if (p->digest != NULL) {
         const EVP_MD *md = NULL;

-        if (!ossl_prov_digest_load_from_params(&ctx->digest, params, libctx))
+        if (!ossl_prov_digest_load(&ctx->digest, p->digest, p->propq, libctx))
             return 0;

         md = ossl_prov_digest_md(&ctx->digest);
@@ -272,19 +309,19 @@ static int hkdf_common_set_ctx_params(KDF_HKDF *ctx, const OSSL_PARAM params[])
         }
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_MODE)) != NULL) {
-        if (p->data_type == OSSL_PARAM_UTF8_STRING) {
-            if (OPENSSL_strcasecmp(p->data, "EXTRACT_AND_EXPAND") == 0) {
+    if (p->mode != NULL) {
+        if (p->mode->data_type == OSSL_PARAM_UTF8_STRING) {
+            if (OPENSSL_strcasecmp(p->mode->data, "EXTRACT_AND_EXPAND") == 0) {
                 ctx->mode = EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND;
-            } else if (OPENSSL_strcasecmp(p->data, "EXTRACT_ONLY") == 0) {
+            } else if (OPENSSL_strcasecmp(p->mode->data, "EXTRACT_ONLY") == 0) {
                 ctx->mode = EVP_KDF_HKDF_MODE_EXTRACT_ONLY;
-            } else if (OPENSSL_strcasecmp(p->data, "EXPAND_ONLY") == 0) {
+            } else if (OPENSSL_strcasecmp(p->mode->data, "EXPAND_ONLY") == 0) {
                 ctx->mode = EVP_KDF_HKDF_MODE_EXPAND_ONLY;
             } else {
                 ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_MODE);
                 return 0;
             }
-        } else if (OSSL_PARAM_get_int(p, &n)) {
+        } else if (OSSL_PARAM_get_int(p->mode, &n)) {
             if (n != EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND
                 && n != EVP_KDF_HKDF_MODE_EXTRACT_ONLY
                 && n != EVP_KDF_HKDF_MODE_EXPAND_ONLY) {
@@ -298,47 +335,47 @@ static int hkdf_common_set_ctx_params(KDF_HKDF *ctx, const OSSL_PARAM params[])
         }
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_KEY)) != NULL) {
+    if (p->key != NULL) {
         OPENSSL_clear_free(ctx->key, ctx->key_len);
         ctx->key = NULL;
-        if (!OSSL_PARAM_get_octet_string(p, (void **)&ctx->key, 0,
+        if (!OSSL_PARAM_get_octet_string(p->key, (void **)&ctx->key, 0,
                 &ctx->key_len))
             return 0;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SALT)) != NULL) {
+    if (p->salt != NULL) {
         OPENSSL_free(ctx->salt);
         ctx->salt = NULL;
-        if (!OSSL_PARAM_get_octet_string(p, (void **)&ctx->salt, 0,
+        if (!OSSL_PARAM_get_octet_string(p->salt, (void **)&ctx->salt, 0,
                 &ctx->salt_len))
             return 0;
     }

+    /* Only relevant for HKDF not to the TLS 1.3 KDF */
+    if (ossl_param_get1_concat_octet_string(p->num_info, p->info,
+            &ctx->info, &ctx->info_len)
+        == 0)
+        return 0;
+
     return 1;
 }

 static int kdf_hkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
+    struct hkdf_all_set_ctx_params_st p;
     KDF_HKDF *ctx = vctx;

-    if (ossl_param_is_empty(params))
-        return 1;
-
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_KDF_PARAM_FIPS_KEY_CHECK))
+    if (ctx == NULL || !hkdf_set_ctx_params_decoder(params, &p))
         return 0;

-    if (!hkdf_common_set_ctx_params(ctx, params))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, p.ind_k))
         return 0;

-    if (ossl_param_get1_concat_octet_string(params, OSSL_KDF_PARAM_INFO,
-            &ctx->info, &ctx->info_len,
-            HKDF_MAXINFO)
-        == 0)
+    if (!hkdf_common_set_ctx_params(ctx, &p))
         return 0;

 #ifdef FIPS_MODULE
-    if (OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_KEY) != NULL)
+    if (p.key != NULL)
         if (!fips_hkdf_key_check_passed(ctx))
             return 0;
 #endif
@@ -349,68 +386,86 @@ static int kdf_hkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *kdf_hkdf_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        HKDF_COMMON_SETTABLES,
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_INFO, NULL, 0),
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_KDF_PARAM_FIPS_KEY_CHECK)
-            OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return hkdf_set_ctx_params_list;
+}
+
+static const OSSL_PARAM *hkdf_gettable_ctx_params(ossl_unused void *ctx,
+    ossl_unused void *provctx)
+{
+    return hkdf_get_ctx_params_list;
 }

-static int hkdf_common_get_ctx_params(KDF_HKDF *ctx, OSSL_PARAM params[])
+static int hkdf_common_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    KDF_HKDF *ctx = (KDF_HKDF *)vctx;
+    struct hkdf_get_ctx_params_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !hkdf_get_ctx_params_decoder(params, &p))
+        return 0;

-    if ((p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_SIZE)) != NULL) {
+    if (p.size != NULL) {
         size_t sz = kdf_hkdf_size(ctx);

         if (sz == 0)
             return 0;
-        if (!OSSL_PARAM_set_size_t(p, sz))
+        if (!OSSL_PARAM_set_size_t(p.size, sz))
             return 0;
     }

-    if ((p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_INFO)) != NULL) {
-        if (ctx->info == NULL || ctx->info_len == 0)
-            p->return_size = 0;
-        else if (!OSSL_PARAM_set_octet_string(p, ctx->info, ctx->info_len))
+    if (p.digest != NULL) {
+        const EVP_MD *md = ossl_prov_digest_md(&ctx->digest);
+
+        if (md == NULL)
+            return 0;
+        else if (!OSSL_PARAM_set_utf8_string(p.digest, EVP_MD_get0_name(md)))
             return 0;
     }

-    return 1;
-}
-
-static int kdf_hkdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
-{
-    KDF_HKDF *ctx = (KDF_HKDF *)vctx;
+    /* OSSL_KDF_PARAM_MODE has multiple parameter types, so look for all instances */
+    if (p.mode != NULL) {
+        if (p.mode->data_type == OSSL_PARAM_UTF8_STRING) {
+            switch (ctx->mode) {
+            case EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND:
+                if (!OSSL_PARAM_set_utf8_string(p.mode, "EXTRACT_AND_EXPAND"))
+                    return 0;
+                break;
+            case EVP_KDF_HKDF_MODE_EXTRACT_ONLY:
+                if (!OSSL_PARAM_set_utf8_string(p.mode, "EXTRACT_ONLY"))
+                    return 0;
+                break;
+            case EVP_KDF_HKDF_MODE_EXPAND_ONLY:
+                if (!OSSL_PARAM_set_utf8_string(p.mode, "EXPAND_ONLY"))
+                    return 0;
+                break;
+            default:
+                return 0;
+            }
+        } else {
+            if (!OSSL_PARAM_set_int(p.mode, ctx->mode))
+                return 0;
+        }
+    }

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (p.salt != NULL) {
+        if (ctx->salt == NULL || ctx->salt_len == 0)
+            p.salt->return_size = 0;
+        else if (!OSSL_PARAM_set_octet_string(p.salt, ctx->salt, ctx->salt_len))
+            return 0;
+    }

-    if (!hkdf_common_get_ctx_params(ctx, params))
-        return 0;
+    if (p.info != NULL) {
+        if (ctx->info == NULL || ctx->info_len == 0)
+            p.info->return_size = 0;
+        else if (!OSSL_PARAM_set_octet_string(p.info, ctx->info, ctx->info_len))
+            return 0;
+    }

-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(ctx, params))
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(ctx, p.ind))
         return 0;

     return 1;
 }

-static const OSSL_PARAM *kdf_hkdf_gettable_ctx_params(ossl_unused void *ctx,
-    ossl_unused void *provctx)
-{
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        HKDF_COMMON_GETTABLES,
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
-}
-
 const OSSL_DISPATCH ossl_kdf_hkdf_functions[] = {
     { OSSL_FUNC_KDF_NEWCTX, (void (*)(void))kdf_hkdf_new },
     { OSSL_FUNC_KDF_DUPCTX, (void (*)(void))kdf_hkdf_dup },
@@ -421,11 +476,90 @@ const OSSL_DISPATCH ossl_kdf_hkdf_functions[] = {
         (void (*)(void))kdf_hkdf_settable_ctx_params },
     { OSSL_FUNC_KDF_SET_CTX_PARAMS, (void (*)(void))kdf_hkdf_set_ctx_params },
     { OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS,
-        (void (*)(void))kdf_hkdf_gettable_ctx_params },
-    { OSSL_FUNC_KDF_GET_CTX_PARAMS, (void (*)(void))kdf_hkdf_get_ctx_params },
+        (void (*)(void))hkdf_gettable_ctx_params },
+    { OSSL_FUNC_KDF_GET_CTX_PARAMS, (void (*)(void))hkdf_common_get_ctx_params },
     OSSL_DISPATCH_END
 };

+static void *kdf_hkdf_fixed_digest_new(void *provctx, const char *digest)
+{
+    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
+    KDF_HKDF *ctx;
+    OSSL_PARAM param;
+
+    ctx = kdf_hkdf_new(provctx);
+    if (ctx == NULL)
+        return NULL;
+
+    param = OSSL_PARAM_construct_utf8_string(OSSL_ALG_PARAM_DIGEST,
+        (char *)digest, 0);
+    if (!ossl_prov_digest_load(&ctx->digest, &param, NULL, libctx)) {
+        kdf_hkdf_free(ctx);
+        return NULL;
+    }
+
+    /* Now the digest can no longer be changed */
+    ctx->fixed_digest = 1;
+
+    return ctx;
+}
+
+static int kdf_hkdf_fixed_digest_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+{
+    struct hkdf_all_set_ctx_params_st p;
+    KDF_HKDF *ctx = vctx;
+
+    if (ctx == NULL || !hkdf_fixed_digest_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, p.ind_k))
+        return 0;
+
+    if (!hkdf_common_set_ctx_params(ctx, &p))
+        return 0;
+
+#ifdef FIPS_MODULE
+    if (p.key != NULL)
+        if (!fips_hkdf_key_check_passed(ctx))
+            return 0;
+#endif
+
+    return 1;
+}
+
+static const OSSL_PARAM *kdf_hkdf_fixed_digest_settable_ctx_params(ossl_unused void *ctx, ossl_unused void *provctx)
+{
+    return hkdf_fixed_digest_set_ctx_params_list;
+}
+
+#define KDF_HKDF_FIXED_DIGEST_NEW(hashname, hashstring)        \
+    static void *kdf_hkdf_##hashname##_new(void *provctx)      \
+    {                                                          \
+        return kdf_hkdf_fixed_digest_new(provctx, hashstring); \
+    }
+
+KDF_HKDF_FIXED_DIGEST_NEW(sha256, "SHA256")
+KDF_HKDF_FIXED_DIGEST_NEW(sha384, "SHA384")
+KDF_HKDF_FIXED_DIGEST_NEW(sha512, "SHA512")
+
+#define MAKE_KDF_HKDF_FIXED_DIGEST_FUNCTIONS(hashname)                                                    \
+    const OSSL_DISPATCH ossl_kdf_hkdf_##hashname##_functions[] = {                                        \
+        { OSSL_FUNC_KDF_NEWCTX, (void (*)(void))kdf_hkdf_##hashname##_new },                              \
+        { OSSL_FUNC_KDF_DUPCTX, (void (*)(void))kdf_hkdf_dup },                                           \
+        { OSSL_FUNC_KDF_FREECTX, (void (*)(void))kdf_hkdf_free },                                         \
+        { OSSL_FUNC_KDF_RESET, (void (*)(void))kdf_hkdf_reset },                                          \
+        { OSSL_FUNC_KDF_DERIVE, (void (*)(void))kdf_hkdf_derive },                                        \
+        { OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS, (void (*)(void))kdf_hkdf_fixed_digest_settable_ctx_params }, \
+        { OSSL_FUNC_KDF_SET_CTX_PARAMS, (void (*)(void))kdf_hkdf_fixed_digest_set_ctx_params },           \
+        { OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS, (void (*)(void))hkdf_gettable_ctx_params },                  \
+        { OSSL_FUNC_KDF_GET_CTX_PARAMS, (void (*)(void))hkdf_common_get_ctx_params },                     \
+        OSSL_DISPATCH_END                                                                                 \
+    };
+
+MAKE_KDF_HKDF_FIXED_DIGEST_FUNCTIONS(sha256)
+MAKE_KDF_HKDF_FIXED_DIGEST_FUNCTIONS(sha384)
+MAKE_KDF_HKDF_FIXED_DIGEST_FUNCTIONS(sha512)
+
 /*
  * Refer to "HMAC-based Extract-and-Expand Key Derivation Function (HKDF)"
  * Section 2 (https://tools.ietf.org/html/rfc5869#section-2) and
@@ -587,7 +721,7 @@ static int HKDF_Expand(const EVP_MD *evp_md,
     if ((hmac = HMAC_CTX_new()) == NULL)
         return 0;

-    if (!HMAC_Init_ex(hmac, prk, prk_len, evp_md, NULL))
+    if (!HMAC_Init_ex(hmac, prk, (int)prk_len, evp_md, NULL))
         goto err;

     for (i = 1; i <= n; i++) {
@@ -750,7 +884,7 @@ static int fips_tls1_3_digest_check_passed(KDF_HKDF *ctx, const EVP_MD *md)
     if (digest_unapproved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE0,
                 libctx, "TLS13 KDF", "Digest",
-                ossl_fips_config_tls13_kdf_digest_check)) {
+                FIPS_CONFIG_TLS13_KDF_DIGEST_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED);
             return 0;
         }
@@ -786,7 +920,7 @@ static int fips_tls1_3_key_check_passed(KDF_HKDF *ctx)
     if (!key_approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE1,
                 libctx, "TLS13 KDF", "Key size",
-                ossl_fips_config_tls13_kdf_key_check)) {
+                FIPS_CONFIG_TLS13_KDF_KEY_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
             return 0;
         }
@@ -834,20 +968,18 @@ static int kdf_tls1_3_derive(void *vctx, unsigned char *key, size_t keylen,

 static int kdf_tls1_3_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p;
+    struct hkdf_all_set_ctx_params_st p;
     KDF_HKDF *ctx = vctx;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !kdf_tls1_3_set_ctx_params_decoder(params, &p))
+        return 0;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_KDF_PARAM_FIPS_DIGEST_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, p.ind_d))
         return 0;
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE1, params,
-            OSSL_KDF_PARAM_FIPS_KEY_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE1, p.ind_k))
         return 0;

-    if (!hkdf_common_set_ctx_params(ctx, params))
+    if (!hkdf_common_set_ctx_params(ctx, &p))
         return 0;

     if (ctx->mode == EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND) {
@@ -855,38 +987,39 @@ static int kdf_tls1_3_set_ctx_params(void *vctx, const OSSL_PARAM params[])
         return 0;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_PREFIX)) != NULL) {
+    if (p.prefix != NULL) {
         OPENSSL_free(ctx->prefix);
         ctx->prefix = NULL;
-        if (!OSSL_PARAM_get_octet_string(p, (void **)&ctx->prefix, 0,
+        if (!OSSL_PARAM_get_octet_string(p.prefix, (void **)&ctx->prefix, 0,
                 &ctx->prefix_len))
             return 0;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_LABEL)) != NULL) {
+    if (p.label != NULL) {
         OPENSSL_free(ctx->label);
         ctx->label = NULL;
-        if (!OSSL_PARAM_get_octet_string(p, (void **)&ctx->label, 0,
+        if (!OSSL_PARAM_get_octet_string(p.label, (void **)&ctx->label, 0,
                 &ctx->label_len))
             return 0;
     }

-    OPENSSL_clear_free(ctx->data, ctx->data_len);
-    ctx->data = NULL;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_DATA)) != NULL
-        && !OSSL_PARAM_get_octet_string(p, (void **)&ctx->data, 0,
-            &ctx->data_len))
-        return 0;
+    if (p.data != NULL) {
+        OPENSSL_clear_free(ctx->data, ctx->data_len);
+        ctx->data = NULL;
+        if (!OSSL_PARAM_get_octet_string(p.data, (void **)&ctx->data, 0,
+                &ctx->data_len))
+            return 0;
+    }

 #ifdef FIPS_MODULE
-    if (OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST) != NULL) {
+    if (p.digest != NULL) {
         const EVP_MD *md = ossl_prov_digest_md(&ctx->digest);

         if (!fips_tls1_3_digest_check_passed(ctx, md))
             return 0;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_KEY)) != NULL)
+    if (p.key != NULL)
         if (!fips_tls1_3_key_check_passed(ctx))
             return 0;
 #endif
@@ -897,43 +1030,7 @@ static int kdf_tls1_3_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *kdf_tls1_3_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        HKDF_COMMON_SETTABLES,
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_PREFIX, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_LABEL, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_DATA, NULL, 0),
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_KDF_PARAM_FIPS_DIGEST_CHECK)
-            OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_KDF_PARAM_FIPS_KEY_CHECK)
-                OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
-}
-
-static int kdf_tls1_3_get_ctx_params(void *vctx, OSSL_PARAM params[])
-{
-    KDF_HKDF *ctx = (KDF_HKDF *)vctx;
-
-    if (ossl_param_is_empty(params))
-        return 1;
-
-    if (!hkdf_common_get_ctx_params(ctx, params))
-        return 0;
-
-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(ctx, params))
-        return 0;
-
-    return 1;
-}
-
-static const OSSL_PARAM *kdf_tls1_3_gettable_ctx_params(ossl_unused void *ctx,
-    ossl_unused void *provctx)
-{
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        HKDF_COMMON_GETTABLES,
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return kdf_tls1_3_set_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_kdf_tls1_3_kdf_functions[] = {
@@ -946,7 +1043,7 @@ const OSSL_DISPATCH ossl_kdf_tls1_3_kdf_functions[] = {
         (void (*)(void))kdf_tls1_3_settable_ctx_params },
     { OSSL_FUNC_KDF_SET_CTX_PARAMS, (void (*)(void))kdf_tls1_3_set_ctx_params },
     { OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS,
-        (void (*)(void))kdf_tls1_3_gettable_ctx_params },
-    { OSSL_FUNC_KDF_GET_CTX_PARAMS, (void (*)(void))kdf_tls1_3_get_ctx_params },
+        (void (*)(void))hkdf_gettable_ctx_params },
+    { OSSL_FUNC_KDF_GET_CTX_PARAMS, (void (*)(void))hkdf_common_get_ctx_params },
     OSSL_DISPATCH_END
 };
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/hkdf.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/hkdf.inc.in
new file mode 100644
index 00000000000..7fd4f901309
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/hkdf.inc.in
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- our @HKDF_COMMON_SET_CTX_PARAMS = (
+       ['OSSL_KDF_PARAM_MODE',       'mode',   'utf8_string'],
+       ['OSSL_KDF_PARAM_MODE',       'mode',   'int'],
+       ['OSSL_KDF_PARAM_KEY',        'key',    'octet_string'],
+       ['OSSL_KDF_PARAM_SALT',       'salt',   'octet_string'],
+   );
+   our @HKDF_DIGEST_SET_CTX_PARAMS = (
+       ['OSSL_KDF_PARAM_PROPERTIES', 'propq',  'utf8_string'],
+       ['OSSL_KDF_PARAM_DIGEST',     'digest', 'utf8_string'],
+   );
+   our @HKDF_INFO_SET_CTX_PARAMS = (
+       ['OSSL_KDF_PARAM_INFO',       'info',   'octet_string', HKDF_MAX_INFOS],
+   );
+
+   produce_param_decoder('hkdf_set_ctx_params',
+                         (@HKDF_COMMON_SET_CTX_PARAMS,
+                          @HKDF_DIGEST_SET_CTX_PARAMS,
+                          @HKDF_INFO_SET_CTX_PARAMS,
+                          ['OSSL_KDF_PARAM_FIPS_KEY_CHECK', 'ind_k',  'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('hkdf_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',                    'size',   'size_t'],
+                          ['OSSL_KDF_PARAM_DIGEST',                  'digest', 'utf8_string'],
+                          ['OSSL_KDF_PARAM_MODE',                    'mode',   'utf8_string'],
+                          ['OSSL_KDF_PARAM_MODE',                    'mode',   'int'],
+                          ['OSSL_KDF_PARAM_SALT',                    'salt',   'octet_string'],
+                          ['OSSL_KDF_PARAM_INFO',                    'info',   'octet_string'],
+                          ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind',    'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('hkdf_fixed_digest_set_ctx_params',
+                         (@HKDF_COMMON_SET_CTX_PARAMS,
+                          @HKDF_INFO_SET_CTX_PARAMS,
+                          ['OSSL_KDF_PARAM_FIPS_KEY_CHECK', 'ind_k',  'int', 'fips'],
+                          ['OSSL_KDF_PARAM_DIGEST',         'invalid param'],
+                         )); -}
+
+{- produce_param_decoder('kdf_tls1_3_set_ctx_params',
+                         (@HKDF_COMMON_SET_CTX_PARAMS,
+                          @HKDF_DIGEST_SET_CTX_PARAMS,
+                          ['OSSL_KDF_PARAM_FIPS_KEY_CHECK',    'ind_k',  'int', 'fips'],
+                          ['OSSL_KDF_PARAM_FIPS_DIGEST_CHECK', 'ind_d',  'int', 'fips'],
+                          ['OSSL_KDF_PARAM_PREFIX',            'prefix', 'octet_string'],
+                          ['OSSL_KDF_PARAM_LABEL',             'label',  'octet_string'],
+                          ['OSSL_KDF_PARAM_DATA',              'data',   'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/hmacdrbg_kdf.c b/deps/openssl/openssl/providers/implementations/kdfs/hmacdrbg_kdf.c
index 77c2de3270d..e411b4ebb7b 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/hmacdrbg_kdf.c
+++ b/deps/openssl/openssl/providers/implementations/kdfs/hmacdrbg_kdf.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,10 +14,13 @@
 #include <openssl/kdf.h>
 #include <openssl/proverr.h>
 #include <openssl/core_names.h>
+#include "internal/common.h"
+#include "internal/fips.h"
 #include "prov/providercommon.h"
 #include "prov/implementations.h"
 #include "prov/hmac_drbg.h"
 #include "prov/provider_ctx.h"
+#include "providers/implementations/kdfs/hmacdrbg_kdf.inc"

 static OSSL_FUNC_kdf_newctx_fn hmac_drbg_kdf_new;
 static OSSL_FUNC_kdf_dupctx_fn hmac_drbg_kdf_dup;
@@ -41,6 +44,12 @@ static void *hmac_drbg_kdf_new(void *provctx)
 {
     KDF_HMAC_DRBG *ctx;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_DRBG_HMAC))
+        return NULL;
+#endif
+
     if (!ossl_prov_is_running())
         return NULL;

@@ -143,21 +152,23 @@ static int hmac_drbg_kdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
     PROV_DRBG_HMAC *drbg = &hmac->base;
     const char *name;
     const EVP_MD *md;
-    OSSL_PARAM *p;
+    struct hmac_drbg_kdf_get_ctx_params_st p;
+
+    if (hmac == NULL || !hmac_drbg_kdf_get_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_MAC);
-    if (p != NULL) {
+    if (p.mac != NULL) {
         if (drbg->ctx == NULL)
             return 0;
         name = EVP_MAC_get0_name(EVP_MAC_CTX_get0_mac(drbg->ctx));
-        if (!OSSL_PARAM_set_utf8_string(p, name))
+        if (!OSSL_PARAM_set_utf8_string(p.mac, name))
             return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_DIGEST);
-    if (p != NULL) {
+    if (p.digest != NULL) {
         md = ossl_prov_digest_md(&drbg->digest);
-        if (md == NULL || !OSSL_PARAM_set_utf8_string(p, EVP_MD_get0_name(md)))
+        if (md == NULL
+            || !OSSL_PARAM_set_utf8_string(p.digest, EVP_MD_get0_name(md)))
             return 0;
     }
     return 1;
@@ -166,32 +177,29 @@ static int hmac_drbg_kdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
 static const OSSL_PARAM *hmac_drbg_kdf_gettable_ctx_params(
     ossl_unused void *vctx, ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_MAC, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_DIGEST, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return hmac_drbg_kdf_get_ctx_params_list;
 }

 static int hmac_drbg_kdf_set_ctx_params(void *vctx,
     const OSSL_PARAM params[])
 {
     KDF_HMAC_DRBG *hmac = (KDF_HMAC_DRBG *)vctx;
-    PROV_DRBG_HMAC *drbg = &hmac->base;
-    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(hmac->provctx);
+    PROV_DRBG_HMAC *drbg;
+    OSSL_LIB_CTX *libctx;
     const EVP_MD *md;
-    const OSSL_PARAM *p;
+    struct hmac_drbg_kdf_set_ctx_params_st p;
     void *ptr = NULL;
     size_t size = 0;
     int md_size;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (hmac == NULL || !hmac_drbg_kdf_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    drbg = &hmac->base;
+    libctx = PROV_LIBCTX_OF(hmac->provctx);

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_HMACDRBG_ENTROPY);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_octet_string(p, &ptr, 0, &size))
+    if (p.ent != NULL) {
+        if (!OSSL_PARAM_get_octet_string(p.ent, &ptr, 0, &size))
             return 0;
         OPENSSL_free(hmac->entropy);
         hmac->entropy = ptr;
@@ -200,9 +208,8 @@ static int hmac_drbg_kdf_set_ctx_params(void *vctx,
         ptr = NULL;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_HMACDRBG_NONCE);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_octet_string(p, &ptr, 0, &size))
+    if (p.nonce != NULL) {
+        if (!OSSL_PARAM_get_octet_string(p.nonce, &ptr, 0, &size))
             return 0;
         OPENSSL_free(hmac->nonce);
         hmac->nonce = ptr;
@@ -210,9 +217,8 @@ static int hmac_drbg_kdf_set_ctx_params(void *vctx,
         hmac->init = 0;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST);
-    if (p != NULL) {
-        if (!ossl_prov_digest_load_from_params(&drbg->digest, params, libctx))
+    if (p.digest != NULL) {
+        if (!ossl_prov_digest_load(&drbg->digest, p.digest, p.propq, libctx))
             return 0;

         /* Confirm digest is allowed. Allow all digests that are not XOF */
@@ -227,8 +233,9 @@ static int hmac_drbg_kdf_set_ctx_params(void *vctx,
                 return 0;
             drbg->blocklen = (size_t)md_size;
         }
-        return ossl_prov_macctx_load_from_params(&drbg->ctx, params,
-            "HMAC", NULL, NULL, libctx);
+        if (!ossl_prov_macctx_load(&drbg->ctx, NULL, NULL, p.digest, p.propq,
+                "HMAC", NULL, NULL, libctx))
+            return 0;
     }
     return 1;
 }
@@ -236,14 +243,7 @@ static int hmac_drbg_kdf_set_ctx_params(void *vctx,
 static const OSSL_PARAM *hmac_drbg_kdf_settable_ctx_params(
     ossl_unused void *vctx, ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_HMACDRBG_ENTROPY, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_HMACDRBG_NONCE, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_DIGEST, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return hmac_drbg_kdf_set_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_kdf_hmac_drbg_functions[] = {
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/hmacdrbg_kdf.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/hmacdrbg_kdf.inc.in
new file mode 100644
index 00000000000..19ed1ae3b6e
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/hmacdrbg_kdf.inc.in
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('hmac_drbg_kdf_get_ctx_params',
+                         (['OSSL_KDF_PARAM_MAC',    'mac',    'utf8_string'],
+                          ['OSSL_KDF_PARAM_DIGEST', 'digest', 'utf8_string'],
+                         )); -}
+
+{- produce_param_decoder('hmac_drbg_kdf_set_ctx_params',
+                         (['OSSL_KDF_PARAM_PROPERTIES',       'propq',  'utf8_string'],
+                          ['OSSL_KDF_PARAM_DIGEST',           'digest', 'utf8_string'],
+                          ['OSSL_KDF_PARAM_HMACDRBG_ENTROPY', 'ent',    'octet_string'],
+                          ['OSSL_KDF_PARAM_HMACDRBG_NONCE',   'nonce',  'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/ikev2kdf.c b/deps/openssl/openssl/providers/implementations/kdfs/ikev2kdf.c
new file mode 100644
index 00000000000..cd960a84194
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/ikev2kdf.c
@@ -0,0 +1,755 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/evp.h>
+#include <openssl/kdf.h>
+#include <openssl/core_names.h>
+#include <openssl/proverr.h>
+#include "internal/cryptlib.h"
+#include "internal/fips.h"
+#include "prov/provider_ctx.h"
+#include "prov/providercommon.h"
+#include "prov/implementations.h"
+#include "prov/provider_util.h"
+#include "providers/implementations/kdfs/ikev2kdf.inc"
+
+/* The shared secret length: 28 ~ 1024 bytes */
+#define IKEV2KDF_MIN_SECRET_LENGTH 28
+#define IKEV2KDF_MAX_GROUP19_MODLEN 32 /* ECDH p256 */
+#define IKEV2KDF_MAX_GROUP20_MODLEN 48 /* ECDH p384 */
+#define IKEV2KDF_MAX_GROUP21_MODLEN 66 /* ECDH p521 */
+#define IKEV2KDF_MAX_GROUP2_MODLEN 128 /* DH group 2, no longer secure */
+#define IKEV2KDF_MAX_GROUP14_MODLEN 256
+#define IKEV2KDF_MAX_GROUP15_MODLEN 384
+#define IKEV2KDF_MAX_GROUP16_MODLEN 512
+#define IKEV2KDF_MAX_GROUP17_MODLEN 768
+#define IKEV2KDF_MAX_GROUP18_MODLEN 1024
+#define IKEV2KDF_MIN_NONCE_LENGTH 8
+#define IKEV2KDF_MAX_NONCE_LENGTH 256
+#define IKEV2KDF_MAX_DKM_LENGTH 2048
+
+static OSSL_FUNC_kdf_newctx_fn kdf_ikev2kdf_new;
+static OSSL_FUNC_kdf_dupctx_fn kdf_ikev2kdf_dup;
+static OSSL_FUNC_kdf_freectx_fn kdf_ikev2kdf_free;
+static OSSL_FUNC_kdf_reset_fn kdf_ikev2kdf_reset;
+static OSSL_FUNC_kdf_derive_fn kdf_ikev2kdf_derive;
+static OSSL_FUNC_kdf_settable_ctx_params_fn kdf_ikev2kdf_settable_ctx_params;
+static OSSL_FUNC_kdf_set_ctx_params_fn kdf_ikev2kdf_set_ctx_params;
+static OSSL_FUNC_kdf_gettable_ctx_params_fn kdf_ikev2kdf_gettable_ctx_params;
+static OSSL_FUNC_kdf_get_ctx_params_fn kdf_ikev2kdf_get_ctx_params;
+
+static int IKEV2_GEN(OSSL_LIB_CTX *libctx, unsigned char *seedkey, const size_t keylen,
+    char *md_name, const unsigned char *ni, const size_t ni_len,
+    const unsigned char *nr, const size_t nr_len,
+    const unsigned char *shared_secret, const size_t shared_secret_len);
+static int IKEV2_REKEY(OSSL_LIB_CTX *libctx, unsigned char *seedkey, const size_t keylen,
+    char *md_name, const unsigned char *ni, const size_t ni_len,
+    const unsigned char *nr, const size_t nr_len,
+    const unsigned char *shared_secret, const size_t shared_secret_len,
+    const unsigned char *sk_d, const size_t skd_len);
+static int IKEV2_DKM(OSSL_LIB_CTX *libctx, unsigned char *dkm, const size_t len_out,
+    const EVP_MD *evp_md, const unsigned char *seedkey, const size_t seedkey_len,
+    const unsigned char *ni, const size_t ni_len,
+    const unsigned char *nr, const size_t nr_len,
+    const unsigned char *spii, const size_t spii_len,
+    const unsigned char *spir, const size_t spir_len,
+    const unsigned char *shared_secret, const size_t shared_secret_len);
+
+typedef struct {
+    OSSL_LIB_CTX *libctx;
+    PROV_DIGEST digest;
+    uint8_t *secret;
+    size_t secret_len;
+    uint8_t *seedkey;
+    size_t seedkey_len;
+    uint8_t *ni;
+    size_t ni_len;
+    uint8_t *nr;
+    size_t nr_len;
+    uint8_t *spii;
+    size_t spii_len;
+    uint8_t *spir;
+    size_t spir_len;
+    uint8_t *sk_d;
+    size_t sk_d_len;
+    int mode;
+} KDF_IKEV2KDF;
+
+static void *kdf_ikev2kdf_new(void *provctx)
+{
+    KDF_IKEV2KDF *ctx;
+
+    if (!ossl_prov_is_running())
+        return NULL;
+
+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_KDF_IKEV2KDF_GEN))
+        return NULL;
+#endif
+
+    if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) != NULL)
+        ctx->libctx = PROV_LIBCTX_OF(provctx);
+    return ctx;
+}
+
+static void *kdf_ikev2kdf_dup(void *vctx)
+{
+    KDF_IKEV2KDF *src = (KDF_IKEV2KDF *)vctx;
+    KDF_IKEV2KDF *dest = NULL;
+
+    dest = OPENSSL_zalloc(sizeof(*src));
+    if (dest != NULL) {
+        dest->libctx = src->libctx;
+        if ((src->secret != NULL)
+            && (!ossl_prov_memdup(src->secret, src->secret_len,
+                &dest->secret, &dest->secret_len)))
+            goto err;
+
+        if ((src->seedkey != NULL)
+            && (!ossl_prov_memdup(src->seedkey, src->seedkey_len,
+                &dest->seedkey, &dest->seedkey_len)))
+            goto err;
+
+        if ((src->ni != NULL)
+            && (!ossl_prov_memdup(src->ni, src->ni_len, &dest->ni, &dest->ni_len)))
+            goto err;
+
+        if ((src->nr != NULL)
+            && (!ossl_prov_memdup(src->nr, src->nr_len, &dest->nr, &dest->nr_len)))
+            goto err;
+        if ((src->spii != NULL)
+            && (!ossl_prov_memdup(src->spii, src->spii_len, &dest->spii, &dest->spii_len)))
+            goto err;
+        if ((src->spir != NULL)
+            && (!ossl_prov_memdup(src->spir, src->spir_len, &dest->spir, &dest->spir_len)))
+            goto err;
+
+        if ((src->sk_d != NULL)
+            && (!ossl_prov_memdup(src->sk_d, src->sk_d_len,
+                &dest->sk_d, &dest->sk_d_len)))
+            goto err;
+
+        if (!ossl_prov_digest_copy(&dest->digest, &src->digest))
+            goto err;
+        dest->mode = src->mode;
+    }
+    return dest;
+
+err:
+    kdf_ikev2kdf_free(dest);
+    return NULL;
+}
+static void kdf_ikev2kdf_free(void *vctx)
+{
+    KDF_IKEV2KDF *ctx = (KDF_IKEV2KDF *)vctx;
+
+    if (ctx != NULL) {
+        kdf_ikev2kdf_reset(ctx);
+        OPENSSL_free(ctx);
+    }
+}
+
+static void kdf_ikev2kdf_reset(void *vctx)
+{
+    KDF_IKEV2KDF *ctx = (KDF_IKEV2KDF *)vctx;
+    OSSL_LIB_CTX *libctx = ctx->libctx;
+
+    ossl_prov_digest_reset(&ctx->digest);
+    OPENSSL_clear_free(ctx->secret, ctx->secret_len);
+    OPENSSL_clear_free(ctx->seedkey, ctx->seedkey_len);
+    OPENSSL_clear_free(ctx->sk_d, ctx->sk_d_len);
+    OPENSSL_clear_free(ctx->ni, ctx->ni_len);
+    OPENSSL_clear_free(ctx->nr, ctx->nr_len);
+    OPENSSL_clear_free(ctx->spii, ctx->spii_len);
+    OPENSSL_clear_free(ctx->spir, ctx->spir_len);
+    memset(ctx, 0, sizeof(*ctx));
+    ctx->libctx = libctx;
+}
+
+static int ikev2kdf_set_membuf(unsigned char **dst, size_t *dst_len,
+    const OSSL_PARAM *p)
+{
+    OPENSSL_clear_free(*dst, *dst_len);
+    *dst = NULL;
+    *dst_len = 0;
+    return OSSL_PARAM_get_octet_string(p, (void **)dst, 0, dst_len);
+}
+
+static int ikev2_common_check_ctx_params(KDF_IKEV2KDF *ctx)
+{
+    if (ctx->ni == NULL) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_NONCE);
+        return 0;
+    }
+
+    if (ctx->nr == NULL) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_NONCE);
+        return 0;
+    }
+    return 1;
+}
+
+/*
+ * RFC 7296: section 2.14
+ * g^ir is represented as a string of octets in big endian order padded
+ * with zeros if necessary to make it the length of the modulus.
+ * The secret length is in range of 28 ~ 1024 bytes, and the padding length
+ * is determined by the secret length:
+ * ecdh group 19 32 bytes
+ * ecdh group 20 48 bytes
+ * ecdh group 21 66 bytes
+ * dh group 2 128 bytes (no longer secure, but still supported for interoperability)
+ * dh group 14 256 bytes
+ * dh group 15 384 bytes
+ * dh group 16 512 bytes
+ * dh group 17 768 bytes
+ * dh group 18 1024 bytes
+ * secret is required for GEN, REKEY and DKM(Child_DH).
+ */
+static int ikev2_check_secret_and_pad(KDF_IKEV2KDF *ctx)
+{
+    size_t pad_len = 0;
+    uint8_t *new_secret = NULL;
+
+    if (ctx->secret_len == 0)
+        return 1;
+    if ((ctx->secret_len < IKEV2KDF_MIN_SECRET_LENGTH)
+        || (ctx->secret_len > IKEV2KDF_MAX_GROUP18_MODLEN)) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_SECRET_LENGTH);
+        return 0;
+    }
+    if ((ctx->secret_len == IKEV2KDF_MAX_GROUP19_MODLEN)
+        || (ctx->secret_len == IKEV2KDF_MAX_GROUP20_MODLEN)
+        || (ctx->secret_len == IKEV2KDF_MAX_GROUP21_MODLEN)
+        || (ctx->secret_len == IKEV2KDF_MAX_GROUP2_MODLEN)
+        || (ctx->secret_len == IKEV2KDF_MAX_GROUP14_MODLEN)
+        || (ctx->secret_len == IKEV2KDF_MAX_GROUP15_MODLEN)
+        || (ctx->secret_len == IKEV2KDF_MAX_GROUP16_MODLEN)
+        || (ctx->secret_len == IKEV2KDF_MAX_GROUP17_MODLEN)
+        || (ctx->secret_len == IKEV2KDF_MAX_GROUP18_MODLEN))
+        /* no padding needed if secret_len is already valid */
+        return 1;
+
+    if (ctx->secret_len < IKEV2KDF_MAX_GROUP19_MODLEN)
+        pad_len = IKEV2KDF_MAX_GROUP19_MODLEN - ctx->secret_len;
+    else if ((ctx->secret_len > IKEV2KDF_MAX_GROUP19_MODLEN)
+        && (ctx->secret_len < IKEV2KDF_MAX_GROUP20_MODLEN))
+        pad_len = IKEV2KDF_MAX_GROUP20_MODLEN - ctx->secret_len;
+    else if ((ctx->secret_len > IKEV2KDF_MAX_GROUP20_MODLEN)
+        && (ctx->secret_len < IKEV2KDF_MAX_GROUP21_MODLEN))
+        pad_len = IKEV2KDF_MAX_GROUP21_MODLEN - ctx->secret_len;
+    else if ((ctx->secret_len > IKEV2KDF_MAX_GROUP21_MODLEN)
+        && (ctx->secret_len < IKEV2KDF_MAX_GROUP2_MODLEN))
+        pad_len = IKEV2KDF_MAX_GROUP2_MODLEN - ctx->secret_len;
+    else if ((ctx->secret_len > IKEV2KDF_MAX_GROUP2_MODLEN)
+        && (ctx->secret_len < IKEV2KDF_MAX_GROUP14_MODLEN))
+        pad_len = IKEV2KDF_MAX_GROUP14_MODLEN - ctx->secret_len;
+    else if ((ctx->secret_len > IKEV2KDF_MAX_GROUP14_MODLEN)
+        && (ctx->secret_len < IKEV2KDF_MAX_GROUP15_MODLEN))
+        pad_len = IKEV2KDF_MAX_GROUP15_MODLEN - ctx->secret_len;
+    else if ((ctx->secret_len > IKEV2KDF_MAX_GROUP15_MODLEN)
+        && (ctx->secret_len < IKEV2KDF_MAX_GROUP16_MODLEN))
+        pad_len = IKEV2KDF_MAX_GROUP16_MODLEN - ctx->secret_len;
+    else if ((ctx->secret_len > IKEV2KDF_MAX_GROUP16_MODLEN)
+        && (ctx->secret_len < IKEV2KDF_MAX_GROUP17_MODLEN))
+        pad_len = IKEV2KDF_MAX_GROUP17_MODLEN - ctx->secret_len;
+    else if (ctx->secret_len > IKEV2KDF_MAX_GROUP17_MODLEN)
+        pad_len = IKEV2KDF_MAX_GROUP18_MODLEN - ctx->secret_len;
+
+    new_secret = OPENSSL_zalloc(ctx->secret_len + pad_len);
+    if (new_secret == NULL) {
+        ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
+        return 0;
+    }
+    memcpy(new_secret + pad_len, ctx->secret, ctx->secret_len);
+    OPENSSL_clear_free(ctx->secret, ctx->secret_len);
+    ctx->secret = new_secret;
+    ctx->secret_len += pad_len;
+    return 1;
+}
+
+static int kdf_ikev2kdf_derive(void *vctx, unsigned char *key, size_t keylen,
+    const OSSL_PARAM params[])
+{
+    KDF_IKEV2KDF *ctx = (KDF_IKEV2KDF *)vctx;
+    const EVP_MD *md;
+    size_t md_size;
+    int value = 0;
+
+    if (!ossl_prov_is_running() || !kdf_ikev2kdf_set_ctx_params(ctx, params))
+        return 0;
+
+    md = ossl_prov_digest_md(&ctx->digest);
+    if (md == NULL) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_MESSAGE_DIGEST);
+        return 0;
+    }
+    value = EVP_MD_size(md);
+    if (value <= 0)
+        return 0;
+    md_size = (size_t)value;
+
+    if (!ikev2_common_check_ctx_params(ctx))
+        return 0;
+
+    switch (ctx->mode) {
+    case EVP_KDF_IKEV2_MODE_GEN:
+        if ((ctx->secret == NULL) || (ctx->secret_len == 0)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_SECRET);
+            return 0;
+        }
+        if (keylen != md_size) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
+            return 0;
+        }
+        if (!ikev2_check_secret_and_pad(ctx))
+            return 0;
+        return (IKEV2_GEN(ctx->libctx, key, keylen, (char *)EVP_MD_name(md),
+            ctx->ni, ctx->ni_len, ctx->nr, ctx->nr_len,
+            ctx->secret, ctx->secret_len));
+
+    case EVP_KDF_IKEV2_MODE_DKM:
+        /*
+         * if spi_init != NULL and spi_resp != NULL and shared_secret = NULL
+         *    and seedkey != NULL
+         *    calculate DKM
+         * else if spi_init == NULL and spi_resp == NULL and shared_secret != NULL
+         *    and sk_d != NULL
+         *    calculate DKM(Child_DH)
+         * else if spi_init == NULL and spi_resp == NULL and shared_secret == NULL
+         *    and sk_d != NULL
+         *    calculate DKM(Child_SA)
+         * endif
+         */
+        if ((ctx->spii != NULL) && (ctx->spii_len != 0)
+            && (ctx->spir != NULL) && (ctx->spir_len != 0)
+            && (ctx->secret == NULL) && (ctx->secret_len == 0)) {
+            if ((ctx->seedkey == NULL) || (ctx->seedkey_len == 0)) {
+                ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_KEY);
+                return 0;
+            }
+            if (ctx->seedkey_len != md_size) {
+                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
+                return 0;
+            }
+            if ((keylen < md_size) || (keylen > IKEV2KDF_MAX_DKM_LENGTH)) {
+                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
+                return 0;
+            }
+            /* calculate DKM */
+            return (IKEV2_DKM(ctx->libctx, key, keylen, md, ctx->seedkey, ctx->seedkey_len,
+                ctx->ni, ctx->ni_len, ctx->nr, ctx->nr_len,
+                ctx->spii, ctx->spii_len, ctx->spir, ctx->spir_len,
+                NULL, 0));
+        } else if ((ctx->spii == NULL) && (ctx->spir == NULL)
+            && (ctx->spii_len == 0) && (ctx->spir_len == 0)) {
+            if ((ctx->sk_d == NULL) || (ctx->sk_d_len == 0)) {
+                ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_DKM);
+                return 0;
+            }
+            if ((keylen < md_size) || (keylen > IKEV2KDF_MAX_DKM_LENGTH)) {
+                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
+                return 0;
+            }
+            /* If Child_DH is intended, require secret_len > 0 */
+            if ((ctx->secret != NULL && ctx->secret_len == 0)
+                || (ctx->secret == NULL && ctx->secret_len != 0)) {
+                ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_SECRET);
+                return 0;
+            }
+            if (!ikev2_check_secret_and_pad(ctx))
+                return 0;
+            /* calculate DKM(Child_SA) or DKM(Child_DH) */
+            return (IKEV2_DKM(ctx->libctx, key, keylen, md, ctx->sk_d, ctx->sk_d_len,
+                ctx->ni, ctx->ni_len, ctx->nr, ctx->nr_len,
+                NULL, 0, NULL, 0,
+                ctx->secret, ctx->secret_len));
+        } else {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_PARAMETERS_FOR_DKM);
+            return 0;
+        }
+    case EVP_KDF_IKEV2_MODE_REKEY:
+        if ((ctx->secret == NULL) || (ctx->secret_len == 0)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_SECRET);
+            return 0;
+        }
+        if ((ctx->sk_d == NULL) || (ctx->sk_d_len == 0)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_DKM);
+            return 0;
+        }
+        if (ctx->sk_d_len != md_size) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
+            return 0;
+        }
+        if (keylen != md_size) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
+            return 0;
+        }
+        if (!ikev2_check_secret_and_pad(ctx))
+            return 0;
+        return (IKEV2_REKEY(ctx->libctx, key, keylen, (char *)EVP_MD_name(md),
+            ctx->ni, ctx->ni_len, ctx->nr, ctx->nr_len,
+            ctx->secret, ctx->secret_len, ctx->sk_d, ctx->sk_d_len));
+    default:
+        /* This error is already checked in set_ctx_params */
+        ;
+    }
+    return 0;
+}
+
+static int kdf_ikev2kdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+{
+    struct ikev2_set_ctx_params_st p;
+    KDF_IKEV2KDF *ctx = vctx;
+    const EVP_MD *md;
+
+    if (params == NULL)
+        return 1;
+
+    if (ctx == NULL || !ikev2_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.digest != NULL) {
+        if (!ossl_prov_digest_load(&ctx->digest, p.digest, p.propq, ctx->libctx))
+            return 0;
+        md = ossl_prov_digest_md(&ctx->digest);
+        if (md == NULL) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_MESSAGE_DIGEST);
+            return 0;
+        }
+
+        if (!EVP_MD_is_a(md, SN_sha1)
+            && !EVP_MD_is_a(md, SN_sha224)
+            && !EVP_MD_is_a(md, SN_sha256)
+            && !EVP_MD_is_a(md, SN_sha384)
+            && !EVP_MD_is_a(md, SN_sha512))
+            return 0;
+    }
+    if (p.ni != NULL) {
+        if (!ikev2kdf_set_membuf(&ctx->ni, &ctx->ni_len, p.ni))
+            return 0;
+        if ((ctx->ni_len < IKEV2KDF_MIN_NONCE_LENGTH)
+            || (ctx->ni_len > IKEV2KDF_MAX_NONCE_LENGTH)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_NONCE_LENGTH);
+            return 0;
+        }
+    }
+    if (p.nr != NULL) {
+        if (!ikev2kdf_set_membuf(&ctx->nr, &ctx->nr_len, p.nr))
+            return 0;
+        if ((ctx->nr_len < IKEV2KDF_MIN_NONCE_LENGTH)
+            || (ctx->nr_len > IKEV2KDF_MAX_NONCE_LENGTH)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_NONCE_LENGTH);
+            return 0;
+        }
+    }
+    if (p.spii != NULL)
+        if (!ikev2kdf_set_membuf(&ctx->spii, &ctx->spii_len, p.spii))
+            return 0;
+    if (p.spir != NULL)
+        if (!ikev2kdf_set_membuf(&ctx->spir, &ctx->spir_len, p.spir))
+            return 0;
+    if (p.secret != NULL)
+        if (!ikev2kdf_set_membuf(&ctx->secret, &ctx->secret_len, p.secret))
+            return 0;
+    if (p.seedkey != NULL)
+        if (!ikev2kdf_set_membuf(&ctx->seedkey, &ctx->seedkey_len, p.seedkey))
+            return 0;
+    if (p.sk_d != NULL)
+        if (!ikev2kdf_set_membuf(&ctx->sk_d, &ctx->sk_d_len, p.sk_d))
+            return 0;
+    if (p.mode != NULL) {
+        if (!OSSL_PARAM_get_int(p.mode, &ctx->mode))
+            return 0;
+        if ((ctx->mode != EVP_KDF_IKEV2_MODE_GEN)
+            && (ctx->mode != EVP_KDF_IKEV2_MODE_DKM)
+            && (ctx->mode != EVP_KDF_IKEV2_MODE_REKEY)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_MODE);
+            return 0;
+        }
+    }
+    return 1;
+}
+
+static const OSSL_PARAM *kdf_ikev2kdf_settable_ctx_params(ossl_unused void *ctx,
+    ossl_unused void *p_ctx)
+{
+    return ikev2_set_ctx_params_list;
+}
+
+static int kdf_ikev2kdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
+{
+    struct ikev2_get_ctx_params_st p;
+    KDF_IKEV2KDF *ctx = vctx;
+
+    if (ctx == NULL || !ikev2_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.size != NULL) {
+        int sz = 0;
+        const EVP_MD *md = NULL;
+
+        md = ossl_prov_digest_md(&ctx->digest);
+        if (md == NULL) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_MESSAGE_DIGEST);
+            return 0;
+        }
+        sz = EVP_MD_size(md);
+        if (sz <= 0)
+            return 0;
+        if (!OSSL_PARAM_set_size_t(p.size, (size_t)sz))
+            return 0;
+    }
+    return 1;
+}
+
+static const OSSL_PARAM *kdf_ikev2kdf_gettable_ctx_params(ossl_unused void *ctx,
+    ossl_unused void *p_ctx)
+{
+    return ikev2_get_ctx_params_list;
+}
+
+const OSSL_DISPATCH ossl_kdf_ikev2kdf_functions[] = {
+    { OSSL_FUNC_KDF_NEWCTX, (void (*)(void))kdf_ikev2kdf_new },
+    { OSSL_FUNC_KDF_DUPCTX, (void (*)(void))kdf_ikev2kdf_dup },
+    { OSSL_FUNC_KDF_FREECTX, (void (*)(void))kdf_ikev2kdf_free },
+    { OSSL_FUNC_KDF_RESET, (void (*)(void))kdf_ikev2kdf_reset },
+    { OSSL_FUNC_KDF_DERIVE, (void (*)(void))kdf_ikev2kdf_derive },
+    { OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS,
+        (void (*)(void))kdf_ikev2kdf_settable_ctx_params },
+    { OSSL_FUNC_KDF_SET_CTX_PARAMS, (void (*)(void))kdf_ikev2kdf_set_ctx_params },
+    { OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS,
+        (void (*)(void))kdf_ikev2kdf_gettable_ctx_params },
+    { OSSL_FUNC_KDF_GET_CTX_PARAMS, (void (*)(void))kdf_ikev2kdf_get_ctx_params },
+    { 0, NULL }
+};
+
+/*
+ * IKEV2_GEN - KDF in compliance with SP800-135 for IKEv2,
+ *             generate the seedkey.
+ *
+ * algorithm: HMAC(ni || nr, shared_secret)
+ *
+ * Inputs:
+ *   libctx - provider LIB context
+ *   seedkey - pointer to output for seedkey
+ *   keylen - length of seedkey(in bytes)
+ *   md_name - name of the SHA digest
+ *   ni - pointer to initiator nonce input
+ *   ni_len - initiator nonce length(in bytes)
+ *   nr - pointer to responder nonce input
+ *   nr_len - nonce length(in bytes)
+ *   shared_secret - pointer to secret input
+ *   shared_secret_len - secret length(in bytes)
+ * Outputs:
+ *   return - 1 pass, 0 fail
+ *   seedkey - output seedkey when passing.
+ */
+static int IKEV2_GEN(OSSL_LIB_CTX *libctx, unsigned char *seedkey, const size_t keylen,
+    char *md_name, const unsigned char *ni, const size_t ni_len,
+    const unsigned char *nr, const size_t nr_len,
+    const unsigned char *shared_secret, const size_t shared_secret_len)
+{
+    EVP_MAC_CTX *ctx = NULL;
+    EVP_MAC *mac = NULL;
+    size_t outl = 0;
+    int ret = 0;
+    unsigned char *nonce = NULL;
+    OSSL_PARAM params[] = {
+        OSSL_PARAM_construct_utf8_string("digest", md_name, 0),
+        OSSL_PARAM_construct_end()
+    };
+
+    nonce = OPENSSL_malloc(ni_len + nr_len);
+    if (nonce == NULL)
+        return ret;
+    memcpy(nonce, ni, ni_len);
+    memcpy(nonce + ni_len, nr, nr_len);
+
+    mac = EVP_MAC_fetch(libctx, (char *)"HMAC", NULL);
+    if ((mac == NULL)
+        || ((ctx = EVP_MAC_CTX_new(mac)) == NULL)
+        || (!EVP_MAC_init(ctx, nonce, ni_len + nr_len, params))
+        || (!EVP_MAC_update(ctx, shared_secret, shared_secret_len))
+        || (!EVP_MAC_final(ctx, seedkey, &outl, keylen))
+        || (outl != keylen))
+        goto err;
+
+    ret = 1;
+err:
+    OPENSSL_clear_free(nonce, ni_len + nr_len);
+    EVP_MAC_CTX_free(ctx);
+    EVP_MAC_free(mac);
+    return ret;
+}
+
+/*
+ * IKEV2_REKEY - KDF in compliance with SP800-135 for IKEv2,
+ *               re-generate the seedkey.
+ *
+ * algorithm:  HMAC(sk_d, new secret || Ni || Nr )
+ *
+ * Inputs:
+ *   libctx - provider LIB context
+ *   seedkey - pointer to output for seedkey
+ *   keylen - length of seedkey(in bytes)
+ *   md_name - name of the SHA digest
+ *   ni - pointer to initiator nonce input
+ *   ni_len - initiator nonce length(in bytes)
+ *   nr - pointer to responder nonce input
+ *   nr_len - responder nonce length(in bytes)
+ *   shared_secret - (new) pointer to secret input
+ *   shared_secret_len - (new)secret length(in bytes)
+ *   sk_d - pointer to sk_d portion of DKM
+ *   skd_len - length of sk_d (in bytes)
+ * Outputs:
+ *   return = 1 pass, 0 fail
+ *   seedkey - output seedkey when passing.
+ */
+static int IKEV2_REKEY(OSSL_LIB_CTX *libctx, unsigned char *seedkey, const size_t keylen,
+    char *md_name, const unsigned char *ni, const size_t ni_len,
+    const unsigned char *nr, const size_t nr_len,
+    const unsigned char *shared_secret, const size_t shared_secret_len,
+    const unsigned char *sk_d, const size_t sk_d_len)
+{
+    EVP_MAC_CTX *ctx = NULL;
+    EVP_MAC *mac = NULL;
+    size_t outl = 0;
+    int ret = 0;
+    OSSL_PARAM params[] = {
+        OSSL_PARAM_construct_utf8_string("digest", md_name, 0),
+        OSSL_PARAM_construct_end()
+    };
+
+    mac = EVP_MAC_fetch(libctx, "HMAC", NULL);
+    if ((mac == NULL)
+        || ((ctx = EVP_MAC_CTX_new(mac)) == NULL)
+        || (!EVP_MAC_init(ctx, sk_d, sk_d_len, params))
+        || (!EVP_MAC_update(ctx, shared_secret, shared_secret_len))
+        || (!EVP_MAC_update(ctx, ni, ni_len))
+        || (!EVP_MAC_update(ctx, nr, nr_len))
+        || (!EVP_MAC_final(ctx, seedkey, &outl, keylen))
+        || (outl != keylen))
+        goto err;
+
+    ret = 1;
+
+err:
+    EVP_MAC_CTX_free(ctx);
+    EVP_MAC_free(mac);
+    return ret;
+}
+
+/*
+ * IKEV2_DKM - KDF in compliance with SP800-135 for IKEv2,
+ *             generate the Derived Keying Material(DKM),
+ *             DKM(Child SA) and DKM(Child SA DH).
+ * algorithm:
+ *   if spii != NULL and spir != NULL and shared_secret == NULL
+ *     and seedkey != NULL
+ *     calculate DKM:
+ *       HMAC(seedkey, ni || nr || spii || spir)
+ *   else if spii == NULL and spir == NULL and shared_secret == NULL
+ *     calculate DKM(Child_SA):
+ *       HMAC(sk_d, ni || nr)
+ *   else if spii == NULL and spir == NULL and shared_secret != NULL
+ *     calculate DKM(Child_DH):
+ *       HMAC(sk_d, ni || nr || new_shared_secret)
+ *   endif
+ *
+ * Inputs:
+ *   libctx - provider LIB context
+ *   dkm - pointer to output dkm
+ *   len_out - output length(in bytes)
+ *   evp_md - pointer to SHA digest
+ *   seekkey - pointer to seedkey (seekkey for DKM, sk_d for Child_SA/DH)
+ *   seedkey_len - length of seedkey(in bytes)
+ *   ni - pointer to initiator nonce
+ *   ni_len - initiator nonce length(in bytes)
+ *   nr - pointer to responder nonce
+ *   nr_len - responder nonce length(in bytes)
+ *   shared_secret - pointer to secret input
+ *   shared_secret_len - secret length(in bytes)
+ * Outputs:
+ *   return - 1 pass, 0 fail
+ *   dkm - output dkm when passing.
+ */
+static int IKEV2_DKM(OSSL_LIB_CTX *libctx, unsigned char *dkm, const size_t len_out,
+    const EVP_MD *evp_md,
+    const unsigned char *seedkey, const size_t seedkey_len,
+    const unsigned char *ni, const size_t ni_len,
+    const unsigned char *nr, const size_t nr_len,
+    const unsigned char *spii, const size_t spii_len,
+    const unsigned char *spir, const size_t spir_len,
+    const unsigned char *shared_secret, const size_t shared_secret_len)
+{
+    EVP_MAC_CTX *ctx = NULL;
+    EVP_MAC *mac = NULL;
+    size_t outl = 0, hmac_len = 0, ii;
+    unsigned char *hmac = NULL;
+    int ret = 0;
+    size_t md_size = 0;
+    int value = 0;
+    unsigned char counter = 1;
+    OSSL_PARAM params[] = {
+        OSSL_PARAM_construct_utf8_string("digest", (char *)EVP_MD_name(evp_md), 0),
+        OSSL_PARAM_construct_end()
+    };
+
+    value = EVP_MD_size(evp_md);
+    if (value <= 0)
+        return 0;
+    md_size = (size_t)value;
+    /* len_out may not fit the last hmac, round up */
+    hmac_len = ((len_out + md_size - 1) / md_size) * md_size;
+    hmac = OPENSSL_malloc(hmac_len);
+    if (hmac == NULL)
+        return 0;
+
+    mac = EVP_MAC_fetch(libctx, "HMAC", NULL);
+    if ((mac == NULL)
+        || ((ctx = EVP_MAC_CTX_new(mac)) == NULL))
+        goto err;
+
+    /*
+     * len_out <= IKEV2_MAX_DKM_LEN
+     * loop count will fit in 1 byte value
+     */
+    for (ii = 0; ii < len_out; ii += md_size) {
+        if (!EVP_MAC_init(ctx, seedkey, seedkey_len, params))
+            goto err;
+        if (ii != 0)
+            if (!EVP_MAC_update(ctx, &hmac[ii - md_size], md_size))
+                goto err;
+        if (shared_secret != NULL)
+            if (!EVP_MAC_update(ctx, shared_secret, shared_secret_len))
+                goto err;
+        if (!EVP_MAC_update(ctx, ni, ni_len)
+            || !EVP_MAC_update(ctx, nr, nr_len))
+            goto err;
+        if (spii != NULL)
+            if (!EVP_MAC_update(ctx, spii, spii_len)
+                || !EVP_MAC_update(ctx, spir, spir_len))
+                goto err;
+        if (!EVP_MAC_update(ctx, &counter, 1))
+            goto err;
+        if (!EVP_MAC_final(ctx, &hmac[ii], &outl, md_size))
+            goto err;
+        counter++;
+    }
+
+    memcpy(dkm, hmac, len_out);
+    ret = 1;
+err:
+    OPENSSL_clear_free(hmac, hmac_len);
+    EVP_MAC_CTX_free(ctx);
+    EVP_MAC_free(mac);
+    return ret;
+}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/ikev2kdf.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/ikev2kdf.inc.in
new file mode 100644
index 00000000000..5c53362a766
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/ikev2kdf.inc.in
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ikev2_set_ctx_params',
+                         (['OSSL_KDF_PARAM_PROPERTIES',          'propq',    'utf8_string'],
+                          ['OSSL_KDF_PARAM_DIGEST',              'digest',   'utf8_string'],
+                          ['OSSL_KDF_PARAM_IKEV2KDF_NI',         'ni',       'octet_string'],
+                          ['OSSL_KDF_PARAM_IKEV2KDF_NR',         'nr',       'octet_string'],
+                          ['OSSL_KDF_PARAM_IKEV2KDF_SPII',       'spii',     'octet_string'],
+                          ['OSSL_KDF_PARAM_IKEV2KDF_SPIR',       'spir',     'octet_string'],
+                          ['OSSL_KDF_PARAM_SEED',                'seedkey',  'octet_string'],
+                          ['OSSL_KDF_PARAM_KEY',                 'sk_d',     'octet_string'],
+                          ['OSSL_KDF_PARAM_SECRET',              'secret',   'octet_string'],
+                          ['OSSL_KDF_PARAM_MODE',                'mode',     'int32'],
+                         )); -}
+
+{- produce_param_decoder('ikev2_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',          'size', 'size_t'],
+                          ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'fips indicator', 'int'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/kbkdf.c b/deps/openssl/openssl/providers/implementations/kdfs/kbkdf.c
index 65b2344a96a..100d010966f 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/kbkdf.c
+++ b/deps/openssl/openssl/providers/implementations/kdfs/kbkdf.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2019 Red Hat, Inc.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -45,10 +45,15 @@
 #include "prov/providercommon.h"
 #include "prov/securitycheck.h"
 #include "internal/e_os.h"
+#include "internal/fips.h"
 #include "internal/params.h"

 #define ossl_min(a, b) ((a) < (b)) ? (a) : (b)

+#define KBKDF_MAX_INFOS 5
+
+#include "providers/implementations/kdfs/kbkdf.inc"
+
 typedef enum {
     COUNTER = 0,
     FEEDBACK
@@ -118,6 +123,12 @@ static void *kbkdf_new(void *provctx)
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_KDF_KBKDF))
+        return NULL;
+#endif
+
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx == NULL)
         return NULL;
@@ -194,7 +205,7 @@ static int fips_kbkdf_key_check_passed(KBKDF *ctx)
     if (!key_approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE0,
                 libctx, "KBKDF", "Key size",
-                ossl_fips_config_kbkdf_key_check)) {
+                FIPS_CONFIG_KBKDF_KEY_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
             return 0;
         }
@@ -347,7 +358,7 @@ static int kbkdf_derive(void *vctx, unsigned char *key, size_t keylen,
     }

     if (ctx->use_l != 0)
-        l = be32(keylen * 8);
+        l = be32((uint32_t)(keylen * 8));

     k_i = OPENSSL_zalloc(h);
     if (k_i == NULL)
@@ -366,19 +377,22 @@ done:
 static int kbkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     KBKDF *ctx = (KBKDF *)vctx;
-    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
-    const OSSL_PARAM *p;
+    OSSL_LIB_CTX *libctx;
+    struct kbkdf_set_ctx_params_st p;
+    const char *s;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !kbkdf_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    libctx = PROV_LIBCTX_OF(ctx->provctx);

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_KDF_PARAM_FIPS_KEY_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, p.ind_k))
         return 0;

-    if (!ossl_prov_macctx_load_from_params(&ctx->ctx_init, params, NULL,
-            NULL, NULL, libctx))
+    if (!ossl_prov_macctx_load(&ctx->ctx_init, p.mac, p.cipher,
+            p.digest, p.propq, NULL, NULL, NULL, libctx))
         return 0;
+
     if (ctx->ctx_init != NULL) {
         ctx->is_kmac = 0;
         if (EVP_MAC_is_a(EVP_MAC_CTX_get0_mac(ctx->ctx_init),
@@ -395,63 +409,57 @@ static int kbkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
         }
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_MODE);
-    if (p != NULL
-        && OPENSSL_strncasecmp("counter", p->data, p->data_size) == 0) {
-        ctx->mode = COUNTER;
-    } else if (p != NULL
-        && OPENSSL_strncasecmp("feedback", p->data, p->data_size) == 0) {
-        ctx->mode = FEEDBACK;
-    } else if (p != NULL) {
-        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_MODE);
-        return 0;
+    if (p.mode != NULL) {
+        if (!OSSL_PARAM_get_utf8_string_ptr(p.mode, &s))
+            return 0;
+        if (OPENSSL_strncasecmp("counter", s, p.mode->data_size) == 0) {
+            ctx->mode = COUNTER;
+        } else if (OPENSSL_strncasecmp("feedback", s, p.mode->data_size) == 0) {
+            ctx->mode = FEEDBACK;
+        } else {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_MODE);
+            return 0;
+        }
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_KEY);
-    if (p != NULL) {
-        if (ossl_param_get1_octet_string(p, OSSL_KDF_PARAM_KEY,
-                &ctx->ki, &ctx->ki_len)
-            == 0)
-            return 0;
+    if (ossl_param_get1_octet_string_from_param(p.key, &ctx->ki,
+            &ctx->ki_len)
+        == 0)
+        return 0;
 #ifdef FIPS_MODULE
-        if (!fips_kbkdf_key_check_passed(ctx))
-            return 0;
+    if (p.key != NULL && !fips_kbkdf_key_check_passed(ctx))
+        return 0;
 #endif
-    }

-    if (ossl_param_get1_octet_string(params, OSSL_KDF_PARAM_SALT,
-            &ctx->label, &ctx->label_len)
+    if (ossl_param_get1_octet_string_from_param(p.salt, &ctx->label,
+            &ctx->label_len)
         == 0)
         return 0;

-    if (ossl_param_get1_concat_octet_string(params, OSSL_KDF_PARAM_INFO,
-            &ctx->context, &ctx->context_len,
-            0)
+    if (ossl_param_get1_concat_octet_string(p.num_info, p.info, &ctx->context,
+            &ctx->context_len)
         == 0)
         return 0;

-    if (ossl_param_get1_octet_string(params, OSSL_KDF_PARAM_SEED,
-            &ctx->iv, &ctx->iv_len)
+    if (ossl_param_get1_octet_string_from_param(p.seed, &ctx->iv,
+            &ctx->iv_len)
         == 0)
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_KBKDF_USE_L);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &ctx->use_l))
+    if (p.use_l != NULL && !OSSL_PARAM_get_int(p.use_l, &ctx->use_l))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_KBKDF_R);
-    if (p != NULL) {
+    if (p.r != NULL) {
         int new_r = 0;

-        if (!OSSL_PARAM_get_int(p, &new_r))
+        if (!OSSL_PARAM_get_int(p.r, &new_r))
             return 0;
         if (new_r != 8 && new_r != 16 && new_r != 24 && new_r != 32)
             return 0;
         ctx->r = new_r;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_KBKDF_USE_SEPARATOR);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &ctx->use_separator))
+    if (p.sep != NULL && !OSSL_PARAM_get_int(p.sep, &ctx->use_separator))
         return 0;

     /* Set up digest context, if we can. */
@@ -466,38 +474,22 @@ static int kbkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *kbkdf_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_INFO, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SALT, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_KEY, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SEED, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_DIGEST, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_CIPHER, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_MAC, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_MODE, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_int(OSSL_KDF_PARAM_KBKDF_USE_L, NULL),
-        OSSL_PARAM_int(OSSL_KDF_PARAM_KBKDF_USE_SEPARATOR, NULL),
-        OSSL_PARAM_int(OSSL_KDF_PARAM_KBKDF_R, NULL),
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_KDF_PARAM_FIPS_KEY_CHECK)
-            OSSL_PARAM_END,
-    };
-    return known_settable_ctx_params;
+    return kbkdf_set_ctx_params_list;
 }

 static int kbkdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
-#ifdef FIPS_MODULE
+    struct kbkdf_get_ctx_params_st p;
     KBKDF *ctx = (KBKDF *)vctx;
-#endif
-    OSSL_PARAM *p;
+
+    if (ctx == NULL || !kbkdf_get_ctx_params_decoder(params, &p))
+        return 0;

     /* KBKDF can produce results as large as you like. */
-    p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_SIZE);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, SIZE_MAX))
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, SIZE_MAX))
         return 0;

-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(ctx, params))
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(ctx, p.ind))
         return 0;
     return 1;
 }
@@ -505,12 +497,7 @@ static int kbkdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
 static const OSSL_PARAM *kbkdf_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL),
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return kbkdf_get_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_kdf_kbkdf_functions[] = {
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/kbkdf.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/kbkdf.inc.in
new file mode 100644
index 00000000000..0aabcfefeaf
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/kbkdf.inc.in
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('kbkdf_set_ctx_params',
+                         (['OSSL_KDF_PARAM_INFO',                'info',   'octet_string', KBKDF_MAX_INFOS],
+                          ['OSSL_KDF_PARAM_SALT',                'salt',   'octet_string'],
+                          ['OSSL_KDF_PARAM_KEY',                 'key',    'octet_string'],
+                          ['OSSL_KDF_PARAM_SEED',                'seed',   'octet_string'],
+                          ['OSSL_KDF_PARAM_DIGEST',              'digest', 'utf8_string'],
+                          ['OSSL_KDF_PARAM_CIPHER',              'cipher', 'utf8_string'],
+                          ['OSSL_KDF_PARAM_MAC',                 'mac',    'utf8_string'],
+                          ['OSSL_KDF_PARAM_MODE',                'mode',   'utf8_string'],
+                          ['OSSL_KDF_PARAM_PROPERTIES',          'propq',  'utf8_string'],
+                          ['OSSL_KDF_PARAM_KBKDF_USE_L',         'use_l',  'int'],
+                          ['OSSL_KDF_PARAM_KBKDF_USE_SEPARATOR', 'sep',    'int'],
+                          ['OSSL_KDF_PARAM_KBKDF_R',             'r',      'int'],
+                          ['OSSL_KDF_PARAM_FIPS_KEY_CHECK',      'ind_k',  'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('kbkdf_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',                    'size', 'size_t'],
+                          ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind',  'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/krb5kdf.c b/deps/openssl/openssl/providers/implementations/kdfs/krb5kdf.c
index 936640aaec7..f0f8c7b65c7 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/krb5kdf.c
+++ b/deps/openssl/openssl/providers/implementations/kdfs/krb5kdf.c
@@ -30,6 +30,7 @@
 #include "prov/provider_ctx.h"
 #include "prov/provider_util.h"
 #include "prov/providercommon.h"
+#include "providers/implementations/kdfs/krb5kdf.inc"

 /* KRB5 KDF defined in RFC 3961, Section 5.1 */

@@ -43,7 +44,7 @@ static OSSL_FUNC_kdf_set_ctx_params_fn krb5kdf_set_ctx_params;
 static OSSL_FUNC_kdf_gettable_ctx_params_fn krb5kdf_gettable_ctx_params;
 static OSSL_FUNC_kdf_get_ctx_params_fn krb5kdf_get_ctx_params;

-static int KRB5KDF(const EVP_CIPHER *cipher, ENGINE *engine,
+static int KRB5KDF(const EVP_CIPHER *cipher,
     const unsigned char *key, size_t key_len,
     const unsigned char *constant, size_t constant_len,
     unsigned char *okey, size_t okey_len);
@@ -127,7 +128,6 @@ static int krb5kdf_derive(void *vctx, unsigned char *key, size_t keylen,
 {
     KRB5KDF_CTX *ctx = (KRB5KDF_CTX *)vctx;
     const EVP_CIPHER *cipher;
-    ENGINE *engine;

     if (!ossl_prov_is_running() || !krb5kdf_set_ctx_params(ctx, params))
         return 0;
@@ -145,32 +145,32 @@ static int krb5kdf_derive(void *vctx, unsigned char *key, size_t keylen,
         ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_CONSTANT);
         return 0;
     }
-    engine = ossl_prov_cipher_engine(&ctx->cipher);
-    return KRB5KDF(cipher, engine, ctx->key, ctx->key_len,
+
+    return KRB5KDF(cipher, ctx->key, ctx->key_len,
         ctx->constant, ctx->constant_len,
         key, keylen);
 }

 static int krb5kdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p;
+    struct krb5kdf_set_ctx_params_st p;
     KRB5KDF_CTX *ctx = vctx;
-    OSSL_LIB_CTX *provctx = PROV_LIBCTX_OF(ctx->provctx);
+    OSSL_LIB_CTX *provctx;
+
+    if (ctx == NULL || !krb5kdf_set_ctx_params_decoder(params, &p))
+        return 0;

-    if (ossl_param_is_empty(params))
-        return 1;
+    provctx = PROV_LIBCTX_OF(ctx->provctx);

-    if (!ossl_prov_cipher_load_from_params(&ctx->cipher, params, provctx))
+    if (!ossl_prov_cipher_load(&ctx->cipher, p.cipher, p.propq, provctx))
         return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_KEY)) != NULL)
-        if (!krb5kdf_set_membuf(&ctx->key, &ctx->key_len, p))
-            return 0;
+    if (p.key != NULL && !krb5kdf_set_membuf(&ctx->key, &ctx->key_len, p.key))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_CONSTANT))
-        != NULL)
-        if (!krb5kdf_set_membuf(&ctx->constant, &ctx->constant_len, p))
-            return 0;
+    if (p.cnst != NULL
+        && !krb5kdf_set_membuf(&ctx->constant, &ctx->constant_len, p.cnst))
+        return 0;

     return 1;
 }
@@ -178,42 +178,36 @@ static int krb5kdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *krb5kdf_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_CIPHER, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_KEY, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_CONSTANT, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return krb5kdf_set_ctx_params_list;
 }

 static int krb5kdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
+    struct krb5kdf_get_ctx_params_st p;
     KRB5KDF_CTX *ctx = (KRB5KDF_CTX *)vctx;
-    const EVP_CIPHER *cipher;
-    size_t len;
-    OSSL_PARAM *p;

-    cipher = ossl_prov_cipher_cipher(&ctx->cipher);
-    if (cipher)
-        len = EVP_CIPHER_get_key_length(cipher);
-    else
-        len = EVP_MAX_KEY_LENGTH;
-
-    if ((p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_SIZE)) != NULL)
-        return OSSL_PARAM_set_size_t(p, len);
-    return -2;
+    if (ctx == NULL || !krb5kdf_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.size != NULL) {
+        const EVP_CIPHER *cipher = ossl_prov_cipher_cipher(&ctx->cipher);
+        size_t len;
+
+        if (cipher != NULL)
+            len = EVP_CIPHER_get_key_length(cipher);
+        else
+            len = EVP_MAX_KEY_LENGTH;
+
+        if (!OSSL_PARAM_set_size_t(p.size, len))
+            return 0;
+    }
+    return 1;
 }

 static const OSSL_PARAM *krb5kdf_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL),
-        OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return krb5kdf_get_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_kdf_krb5kdf_functions[] = {
@@ -283,7 +277,7 @@ static int fixup_des3_key(unsigned char *key)
  * finally add carry if any
  */
 static void n_fold(unsigned char *block, unsigned int blocksize,
-    const unsigned char *constant, size_t constant_len)
+    const unsigned char *constant, unsigned int constant_len)
 {
     unsigned int tmp, gcd, remainder, lcm, carry;
     int b, l;
@@ -343,19 +337,18 @@ static void n_fold(unsigned char *block, unsigned int blocksize,
     }
 }

-static int cipher_init(EVP_CIPHER_CTX *ctx,
-    const EVP_CIPHER *cipher, ENGINE *engine,
+static int cipher_init(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
     const unsigned char *key, size_t key_len)
 {
     int klen, ret;

-    ret = EVP_EncryptInit_ex(ctx, cipher, engine, NULL, NULL);
+    ret = EVP_EncryptInit_ex(ctx, cipher, NULL, NULL, NULL);
     if (!ret)
         goto out;
     /* set the key len for the odd variable key len cipher */
     klen = EVP_CIPHER_CTX_get_key_length(ctx);
     if (key_len != (size_t)klen) {
-        ret = EVP_CIPHER_CTX_set_key_length(ctx, key_len);
+        ret = EVP_CIPHER_CTX_set_key_length(ctx, (int)key_len);
         if (ret <= 0) {
             ret = 0;
             goto out;
@@ -375,7 +368,7 @@ out:
     return ret;
 }

-static int KRB5KDF(const EVP_CIPHER *cipher, ENGINE *engine,
+static int KRB5KDF(const EVP_CIPHER *cipher,
     const unsigned char *key, size_t key_len,
     const unsigned char *constant, size_t constant_len,
     unsigned char *okey, size_t okey_len)
@@ -410,7 +403,7 @@ static int KRB5KDF(const EVP_CIPHER *cipher, ENGINE *engine,
     if (ctx == NULL)
         return 0;

-    ret = cipher_init(ctx, cipher, engine, key, key_len);
+    ret = cipher_init(ctx, cipher, key, key_len);
     if (!ret)
         goto out;

@@ -429,7 +422,7 @@ static int KRB5KDF(const EVP_CIPHER *cipher, ENGINE *engine,
         goto out;
     }

-    n_fold(block, blocksize, constant, constant_len);
+    n_fold(block, (unsigned int)blocksize, constant, (unsigned int)constant_len);
     plainblock = block;
     cipherblock = block + EVP_MAX_BLOCK_LENGTH;

@@ -437,7 +430,7 @@ static int KRB5KDF(const EVP_CIPHER *cipher, ENGINE *engine,
         int olen;

         ret = EVP_EncryptUpdate(ctx, cipherblock, &olen,
-            plainblock, blocksize);
+            plainblock, (int)blocksize);
         if (!ret)
             goto out;
         cipherlen = olen;
@@ -460,7 +453,7 @@ static int KRB5KDF(const EVP_CIPHER *cipher, ENGINE *engine,
             ret = EVP_CIPHER_CTX_reset(ctx);
             if (!ret)
                 goto out;
-            ret = cipher_init(ctx, cipher, engine, key, key_len);
+            ret = cipher_init(ctx, cipher, key, key_len);
             if (!ret)
                 goto out;

diff --git a/deps/openssl/openssl/providers/implementations/kdfs/krb5kdf.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/krb5kdf.inc.in
new file mode 100644
index 00000000000..c404d52125d
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/krb5kdf.inc.in
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('krb5kdf_set_ctx_params',
+                         (['OSSL_KDF_PARAM_PROPERTIES',  'propq',    'utf8_string'],
+                          ['OSSL_KDF_PARAM_CIPHER',      'cipher',   'utf8_string'],
+                          ['OSSL_KDF_PARAM_KEY',         'key',      'octet_string'],
+                          ['OSSL_KDF_PARAM_CONSTANT',    'cnst',     'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('krb5kdf_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',                    'size', 'size_t'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/pbkdf1.c b/deps/openssl/openssl/providers/implementations/kdfs/pbkdf1.c
index 8328b1c6fa2..3eefbc8215d 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/pbkdf1.c
+++ b/deps/openssl/openssl/providers/implementations/kdfs/pbkdf1.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,13 +15,17 @@
 #include <openssl/kdf.h>
 #include <openssl/core_names.h>
 #include <openssl/proverr.h>
+#include "internal/common.h"
 #include "internal/cryptlib.h"
 #include "internal/numbers.h"
+#include "internal/skey.h"
 #include "crypto/evp.h"
+#include "crypto/types.h"
 #include "prov/provider_ctx.h"
 #include "prov/providercommon.h"
 #include "prov/implementations.h"
 #include "prov/provider_util.h"
+#include "providers/implementations/kdfs/pbkdf1.inc"

 static OSSL_FUNC_kdf_newctx_fn kdf_pbkdf1_new;
 static OSSL_FUNC_kdf_dupctx_fn kdf_pbkdf1_dup;
@@ -32,6 +36,8 @@ static OSSL_FUNC_kdf_settable_ctx_params_fn kdf_pbkdf1_settable_ctx_params;
 static OSSL_FUNC_kdf_set_ctx_params_fn kdf_pbkdf1_set_ctx_params;
 static OSSL_FUNC_kdf_gettable_ctx_params_fn kdf_pbkdf1_gettable_ctx_params;
 static OSSL_FUNC_kdf_get_ctx_params_fn kdf_pbkdf1_get_ctx_params;
+static OSSL_FUNC_kdf_set_skey_fn kdf_pbkdf1_set_skey;
+static OSSL_FUNC_kdf_derive_skey_fn kdf_pbkdf1_derive_skey;

 typedef struct {
     void *provctx;
@@ -174,6 +180,27 @@ static int kdf_pbkdf1_set_membuf(unsigned char **buffer, size_t *buflen,
     return 1;
 }

+static int kdf_pbkdf1_set_membuf_skey(unsigned char **buffer, size_t *buflen,
+    const PROV_SKEY *pskey)
+{
+    OPENSSL_clear_free(*buffer, *buflen);
+    *buffer = NULL;
+    *buflen = 0;
+
+    if (pskey->length == 0) {
+        if ((*buffer = OPENSSL_malloc(1)) == NULL)
+            return 0;
+    } else if (pskey->data != NULL) {
+        *buffer = OPENSSL_malloc(pskey->length);
+        if (*buffer == NULL)
+            return 0;
+
+        memcpy(*buffer, pskey->data, pskey->length);
+        *buflen = pskey->length;
+    }
+    return 1;
+}
+
 static int kdf_pbkdf1_derive(void *vctx, unsigned char *key, size_t keylen,
     const OSSL_PARAM params[])
 {
@@ -200,58 +227,97 @@ static int kdf_pbkdf1_derive(void *vctx, unsigned char *key, size_t keylen,

 static int kdf_pbkdf1_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p;
+    struct pbkdf1_set_ctx_params_st p;
     KDF_PBKDF1 *ctx = vctx;
-    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
+    OSSL_LIB_CTX *libctx;

-    if (!ossl_prov_digest_load_from_params(&ctx->digest, params, libctx))
+    if (ctx == NULL || !pbkdf1_set_ctx_params_decoder(params, &p))
         return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_PASSWORD)) != NULL)
-        if (!kdf_pbkdf1_set_membuf(&ctx->pass, &ctx->pass_len, p))
-            return 0;
+    libctx = PROV_LIBCTX_OF(ctx->provctx);

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SALT)) != NULL)
-        if (!kdf_pbkdf1_set_membuf(&ctx->salt, &ctx->salt_len, p))
-            return 0;
+    if (!ossl_prov_digest_load(&ctx->digest, p.digest, p.propq, libctx))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_ITER)) != NULL)
-        if (!OSSL_PARAM_get_uint64(p, &ctx->iter))
-            return 0;
+    if (p.pw != NULL && !kdf_pbkdf1_set_membuf(&ctx->pass, &ctx->pass_len, p.pw))
+        return 0;
+
+    if (p.salt != NULL && !kdf_pbkdf1_set_membuf(&ctx->salt, &ctx->salt_len, p.salt))
+        return 0;
+
+    if (p.iter != NULL && !OSSL_PARAM_get_uint64(p.iter, &ctx->iter))
+        return 0;
     return 1;
 }

 static const OSSL_PARAM *kdf_pbkdf1_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_DIGEST, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_PASSWORD, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SALT, NULL, 0),
-        OSSL_PARAM_uint64(OSSL_KDF_PARAM_ITER, NULL),
-        OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return pbkdf1_set_ctx_params_list;
 }

 static int kdf_pbkdf1_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    struct pbkdf1_get_ctx_params_st p;
+    KDF_PBKDF1 *ctx = vctx;
+
+    if (ctx == NULL || !pbkdf1_get_ctx_params_decoder(params, &p))
+        return 0;

-    if ((p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_SIZE)) != NULL)
-        return OSSL_PARAM_set_size_t(p, SIZE_MAX);
-    return -2;
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, SIZE_MAX))
+        return 0;
+    return 1;
 }

 static const OSSL_PARAM *kdf_pbkdf1_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL),
-        OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return pbkdf1_get_ctx_params_list;
+}
+
+static int kdf_pbkdf1_set_skey(void *vctx, void *skeydata, const char *paramname)
+{
+    KDF_PBKDF1 *ctx = (KDF_PBKDF1 *)vctx;
+    PROV_SKEY *pskey = (PROV_SKEY *)skeydata;
+
+    if (paramname == NULL || skeydata == NULL)
+        return 0;
+
+    if (strcmp(paramname, OSSL_KDF_PARAM_PASSWORD) == 0)
+        return kdf_pbkdf1_set_membuf_skey(&ctx->pass, &ctx->pass_len, pskey);
+
+    if (strcmp(paramname, OSSL_KDF_PARAM_SALT) == 0)
+        return kdf_pbkdf1_set_membuf_skey(&ctx->salt, &ctx->salt_len, pskey);
+
+    return 0;
+}
+
+static void *kdf_pbkdf1_derive_skey(void *vctx, const char *key_type ossl_unused, void *provctx,
+    OSSL_FUNC_skeymgmt_import_fn *import,
+    size_t keylen, const OSSL_PARAM params[])
+{
+    unsigned char *key = NULL;
+    void *ret = NULL;
+    OSSL_PARAM import_params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+
+    if (import == NULL || keylen == 0)
+        return NULL;
+
+    if ((key = OPENSSL_zalloc(keylen)) == NULL)
+        return NULL;
+
+    if (kdf_pbkdf1_derive(vctx, key, keylen, params) == 0) {
+        OPENSSL_free(key);
+        return NULL;
+    }
+
+    import_params[0] = OSSL_PARAM_construct_octet_string(OSSL_SKEY_PARAM_RAW_BYTES,
+        (void *)key, keylen);
+
+    ret = import(provctx, OSSL_SKEYMGMT_SELECT_SECRET_KEY, import_params);
+    OPENSSL_free(key);
+
+    return ret;
 }

 const OSSL_DISPATCH ossl_kdf_pbkdf1_functions[] = {
@@ -266,5 +332,7 @@ const OSSL_DISPATCH ossl_kdf_pbkdf1_functions[] = {
     { OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS,
         (void (*)(void))kdf_pbkdf1_gettable_ctx_params },
     { OSSL_FUNC_KDF_GET_CTX_PARAMS, (void (*)(void))kdf_pbkdf1_get_ctx_params },
+    { OSSL_FUNC_KDF_SET_SKEY, (void (*)(void))kdf_pbkdf1_set_skey },
+    { OSSL_FUNC_KDF_DERIVE_SKEY, (void (*)(void))kdf_pbkdf1_derive_skey },
     OSSL_DISPATCH_END
 };
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/pbkdf1.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/pbkdf1.inc.in
new file mode 100644
index 00000000000..5cbab68ceee
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/pbkdf1.inc.in
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('pbkdf1_set_ctx_params',
+                         (['OSSL_KDF_PARAM_PROPERTIES',  'propq',    'utf8_string'],
+                          ['OSSL_KDF_PARAM_DIGEST',      'digest',   'utf8_string'],
+                          ['OSSL_KDF_PARAM_PASSWORD',    'pw',       'octet_string'],
+                          ['OSSL_KDF_PARAM_SALT',        'salt',     'octet_string'],
+                          ['OSSL_KDF_PARAM_ITER',        'iter',     'uint64'],
+                         )); -}
+
+{- produce_param_decoder('pbkdf1_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',                    'size', 'size_t'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/pbkdf2.c b/deps/openssl/openssl/providers/implementations/kdfs/pbkdf2.c
index 581c8f87994..e1f67cecbc6 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/pbkdf2.c
+++ b/deps/openssl/openssl/providers/implementations/kdfs/pbkdf2.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -22,6 +22,7 @@
 #include <openssl/core_names.h>
 #include <openssl/proverr.h>
 #include "internal/cryptlib.h"
+#include "internal/fips.h"
 #include "internal/numbers.h"
 #include "crypto/evp.h"
 #include "prov/provider_ctx.h"
@@ -29,13 +30,38 @@
 #include "prov/implementations.h"
 #include "prov/provider_util.h"
 #include "prov/securitycheck.h"
-#include "pbkdf2.h"
+#include "providers/implementations/kdfs/pbkdf2.inc"

 /* Constants specified in SP800-132 */
 #define KDF_PBKDF2_MIN_KEY_LEN_BITS 112
 #define KDF_PBKDF2_MAX_KEY_LEN_DIGEST_RATIO 0xFFFFFFFF
 #define KDF_PBKDF2_MIN_ITERATIONS 1000
 #define KDF_PBKDF2_MIN_SALT_LEN (128 / 8)
+/*
+ * The Implementation Guidance for FIPS 140-3 says in section D.N
+ * "Password-Based Key Derivation for Storage Applications" that "the vendor
+ * shall document in the module's Security Policy the length of
+ * a password/passphrase used in key derivation and establish an upper bound
+ * for the probability of having this parameter guessed at random. This
+ * probability shall take into account not only the length of the
+ * password/passphrase, but also the difficulty of guessing it. The decision on
+ * the minimum length of a password used for key derivation is the vendor's,
+ * but the vendor shall at a minimum informally justify the decision."
+ *
+ * ACVP may assume 8, most FIPS modules choose 8, BC-FJA chose 14.
+ *
+ * Allow setting this for default provider too, in case consistency is
+ * desired for FIPS and Default providers. Because password being
+ * accepted on one system, but not the other, is very confusing.
+ */
+#ifndef KDF_PBKDF2_MIN_PASSWORD_LEN
+#ifdef FIPS_MODULE
+#define KDF_PBKDF2_MIN_PASSWORD_LEN (8)
+#define KDF_PBKDF2_FIPS_SELF_TEST_ITERATIONS 2
+#else
+#define KDF_PBKDF2_MIN_PASSWORD_LEN (1)
+#endif
+#endif

 static OSSL_FUNC_kdf_newctx_fn kdf_pbkdf2_new;
 static OSSL_FUNC_kdf_dupctx_fn kdf_pbkdf2_dup;
@@ -73,6 +99,12 @@ static void *kdf_pbkdf2_new_no_init(void *provctx)
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_KDF_PBKDF2))
+        return NULL;
+#endif
+
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx == NULL)
         return NULL;
@@ -149,16 +181,20 @@ err:

 static void kdf_pbkdf2_init(KDF_PBKDF2 *ctx)
 {
-    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+    OSSL_PARAM param;
     OSSL_LIB_CTX *provctx = PROV_LIBCTX_OF(ctx->provctx);

-    params[0] = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST,
+    param = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST,
         SN_sha1, 0);
-    if (!ossl_prov_digest_load_from_params(&ctx->digest, params, provctx))
+    if (!ossl_prov_digest_load(&ctx->digest, &param, NULL, provctx))
         /* This is an error, but there is no way to indicate such directly */
         ossl_prov_digest_reset(&ctx->digest);
     ctx->iter = PKCS5_DEFAULT_ITER;
-    ctx->lower_bound_checks = ossl_kdf_pbkdf2_default_checks;
+#ifdef FIPS_MODULE
+    ctx->lower_bound_checks = 1;
+#else
+    ctx->lower_bound_checks = 0;
+#endif
 }

 static int pbkdf2_set_membuf(unsigned char **buffer, size_t *buflen,
@@ -179,9 +215,17 @@ static int pbkdf2_set_membuf(unsigned char **buffer, size_t *buflen,
 }

 static int pbkdf2_lower_bound_check_passed(int saltlen, uint64_t iter,
-    size_t keylen, int *error,
-    const char **desc)
+    size_t keylen, size_t passlen,
+    int *error, const char **desc)
 {
+    uint64_t min_iter = KDF_PBKDF2_MIN_ITERATIONS;
+
+    if (passlen < KDF_PBKDF2_MIN_PASSWORD_LEN) {
+        *error = PROV_R_PASSWORD_STRENGTH_TOO_WEAK;
+        if (desc != NULL)
+            *desc = "Weak password";
+        return 0;
+    }
     if ((keylen * 8) < KDF_PBKDF2_MIN_KEY_LEN_BITS) {
         *error = PROV_R_KEY_SIZE_TOO_SMALL;
         if (desc != NULL)
@@ -194,7 +238,13 @@ static int pbkdf2_lower_bound_check_passed(int saltlen, uint64_t iter,
             *desc = "Salt size";
         return 0;
     }
-    if (iter < KDF_PBKDF2_MIN_ITERATIONS) {
+#ifdef FIPS_MODULE
+    /* Modify this check during self-test. See FIPS 140-3 IG 10.3.A.8 */
+    if (ossl_self_test_in_progress(ST_ID_KDF_PBKDF2)) {
+        min_iter = KDF_PBKDF2_FIPS_SELF_TEST_ITERATIONS;
+    }
+#endif
+    if (iter < min_iter) {
         *error = PROV_R_INVALID_ITERATION_COUNT;
         if (desc != NULL)
             *desc = "Iteration count";
@@ -205,18 +255,20 @@ static int pbkdf2_lower_bound_check_passed(int saltlen, uint64_t iter,
 }

 #ifdef FIPS_MODULE
-static int fips_lower_bound_check_passed(KDF_PBKDF2 *ctx, size_t keylen)
+static int fips_lower_bound_check_passed(KDF_PBKDF2 *ctx, int saltlen,
+    uint64_t iter, size_t keylen,
+    size_t passlen)
 {
     OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
     int error = 0;
     const char *desc = NULL;
-    int approved = pbkdf2_lower_bound_check_passed(ctx->salt_len, ctx->iter,
-        keylen, &error, &desc);
+    int approved = pbkdf2_lower_bound_check_passed(saltlen, iter, keylen,
+        passlen, &error, &desc);

     if (!approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE0, libctx,
                 "PBKDF2", desc,
-                ossl_fips_config_pbkdf2_lower_bound_check)) {
+                FIPS_CONFIG_PBKDF2_LOWER_BOUND_CHECK)) {
             ERR_raise(ERR_LIB_PROV, error);
             return 0;
         }
@@ -225,6 +277,32 @@ static int fips_lower_bound_check_passed(KDF_PBKDF2 *ctx, size_t keylen)
 }
 #endif

+static int lower_bound_check_passed(KDF_PBKDF2 *ctx, int saltlen, uint64_t iter,
+    size_t keylen, size_t passlen,
+    int lower_bound_checks)
+{
+#ifdef FIPS_MODULE
+    if (!fips_lower_bound_check_passed(ctx, saltlen, iter, keylen, passlen))
+        return 0;
+#else
+    if (lower_bound_checks) {
+        int error = 0;
+        int passed = pbkdf2_lower_bound_check_passed(saltlen, iter, keylen,
+            passlen, &error, NULL);
+
+        if (!passed) {
+            ERR_raise(ERR_LIB_PROV, error);
+            return 0;
+        }
+    } else if (iter < 1) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_ITERATION_COUNT);
+        return 0;
+    }
+#endif
+
+    return 1;
+}
+
 static int kdf_pbkdf2_derive(void *vctx, unsigned char *key, size_t keylen,
     const OSSL_PARAM params[])
 {
@@ -246,24 +324,26 @@ static int kdf_pbkdf2_derive(void *vctx, unsigned char *key, size_t keylen,

     md = ossl_prov_digest_md(&ctx->digest);
     return pbkdf2_derive(ctx, (char *)ctx->pass, ctx->pass_len,
-        ctx->salt, ctx->salt_len, ctx->iter,
+        ctx->salt, (int)ctx->salt_len, ctx->iter,
         md, key, keylen, ctx->lower_bound_checks);
 }

 static int kdf_pbkdf2_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p;
+    struct pbkdf2_set_ctx_params_st p;
     KDF_PBKDF2 *ctx = vctx;
-    OSSL_LIB_CTX *provctx = PROV_LIBCTX_OF(ctx->provctx);
+    OSSL_LIB_CTX *provctx;
     int pkcs5;
-    uint64_t iter, min_iter;
+    uint64_t iter;
     const EVP_MD *md;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !pbkdf2_set_ctx_params_decoder(params, &p))
+        return 0;

-    if (OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST) != NULL) {
-        if (!ossl_prov_digest_load_from_params(&ctx->digest, params, provctx))
+    provctx = PROV_LIBCTX_OF(ctx->provctx);
+
+    if (p.digest != NULL) {
+        if (!ossl_prov_digest_load(&ctx->digest, p.digest, p.propq, provctx))
             return 0;
         md = ossl_prov_digest_md(&ctx->digest);
         if (EVP_MD_xof(md)) {
@@ -272,8 +352,8 @@ static int kdf_pbkdf2_set_ctx_params(void *vctx, const OSSL_PARAM params[])
         }
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_PKCS5)) != NULL) {
-        if (!OSSL_PARAM_get_int(p, &pkcs5))
+    if (p.pkcs5 != NULL) {
+        if (!OSSL_PARAM_get_int(p.pkcs5, &pkcs5))
             return 0;
         ctx->lower_bound_checks = pkcs5 == 0;
 #ifdef FIPS_MODULE
@@ -283,28 +363,32 @@ static int kdf_pbkdf2_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 #endif
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_PASSWORD)) != NULL)
-        if (!pbkdf2_set_membuf(&ctx->pass, &ctx->pass_len, p))
-            return 0;
-
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SALT)) != NULL) {
+    if (p.pw != NULL) {
         if (ctx->lower_bound_checks != 0
-            && p->data_size < KDF_PBKDF2_MIN_SALT_LEN) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_SALT_LENGTH);
+            && p.pw->data_size < KDF_PBKDF2_MIN_PASSWORD_LEN) {
+            ERR_raise_data(ERR_LIB_PROV, PROV_R_PASSWORD_STRENGTH_TOO_WEAK,
+                "password length %zu should be at least %d",
+                p.pw->data_size, KDF_PBKDF2_MIN_PASSWORD_LEN);
             return 0;
         }
-        if (!pbkdf2_set_membuf(&ctx->salt, &ctx->salt_len, p))
+        if (!pbkdf2_set_membuf(&ctx->pass, &ctx->pass_len, p.pw))
             return 0;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_ITER)) != NULL) {
-        if (!OSSL_PARAM_get_uint64(p, &iter))
+    if (p.salt != NULL) {
+        if (!lower_bound_check_passed(ctx, (int)p.salt->data_size, UINT64_MAX, SIZE_MAX,
+                SIZE_MAX, ctx->lower_bound_checks))
             return 0;
-        min_iter = ctx->lower_bound_checks != 0 ? KDF_PBKDF2_MIN_ITERATIONS : 1;
-        if (iter < min_iter) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_ITERATION_COUNT);
+        if (!pbkdf2_set_membuf(&ctx->salt, &ctx->salt_len, p.salt))
+            return 0;
+    }
+
+    if (p.iter != NULL) {
+        if (!OSSL_PARAM_get_uint64(p.iter, &iter))
+            return 0;
+        if (!lower_bound_check_passed(ctx, INT_MAX, iter, SIZE_MAX,
+                SIZE_MAX, ctx->lower_bound_checks))
             return 0;
-        }
         ctx->iter = iter;
     }
     return 1;
@@ -313,27 +397,21 @@ static int kdf_pbkdf2_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *kdf_pbkdf2_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_DIGEST, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_PASSWORD, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SALT, NULL, 0),
-        OSSL_PARAM_uint64(OSSL_KDF_PARAM_ITER, NULL),
-        OSSL_PARAM_int(OSSL_KDF_PARAM_PKCS5, NULL),
-        OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return pbkdf2_set_ctx_params_list;
 }

 static int kdf_pbkdf2_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    KDF_PBKDF2 *ctx = vctx;
+    struct pbkdf2_get_ctx_params_st p;

-    if ((p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_SIZE)) != NULL)
-        if (!OSSL_PARAM_set_size_t(p, SIZE_MAX))
-            return 0;
+    if (ctx == NULL || !pbkdf2_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, SIZE_MAX))
+        return 0;

-    if (!OSSL_FIPS_IND_GET_CTX_PARAM((KDF_PBKDF2 *)vctx, params))
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(ctx, p.ind))
         return 0;
     return 1;
 }
@@ -341,12 +419,7 @@ static int kdf_pbkdf2_get_ctx_params(void *vctx, OSSL_PARAM params[])
 static const OSSL_PARAM *kdf_pbkdf2_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL),
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return pbkdf2_get_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_kdf_pbkdf2_functions[] = {
@@ -399,28 +472,15 @@ static int pbkdf2_derive(KDF_PBKDF2 *ctx, const char *pass, size_t passlen,
         return 0;
     }

-#ifdef FIPS_MODULE
-    if (!fips_lower_bound_check_passed(ctx, keylen))
+    if (!lower_bound_check_passed(ctx, saltlen, iter, keylen, passlen, lower_bound_checks))
         return 0;
-#else
-    if (lower_bound_checks) {
-        int error = 0;
-        int passed = pbkdf2_lower_bound_check_passed(saltlen, iter, keylen,
-            &error, NULL);
-
-        if (!passed) {
-            ERR_raise(ERR_LIB_PROV, error);
-            return 0;
-        }
-    }
-#endif

     hctx_tpl = HMAC_CTX_new();
     if (hctx_tpl == NULL)
         return 0;
     p = key;
-    tkeylen = keylen;
-    if (!HMAC_Init_ex(hctx_tpl, pass, passlen, digest, NULL))
+    tkeylen = (int)keylen;
+    if (!HMAC_Init_ex(hctx_tpl, pass, (int)passlen, digest, NULL))
         goto err;
     hctx = HMAC_CTX_new();
     if (hctx == NULL)
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/pbkdf2.h b/deps/openssl/openssl/providers/implementations/kdfs/pbkdf2.h
deleted file mode 100644
index 7759c03136d..00000000000
--- a/deps/openssl/openssl/providers/implementations/kdfs/pbkdf2.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * Available in pbkdfe_fips.c, and compiled with different values depending
- * on we're in the FIPS module or not.
- */
-extern const int ossl_kdf_pbkdf2_default_checks;
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/pbkdf2.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/pbkdf2.inc.in
new file mode 100644
index 00000000000..3bf8139ff53
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/pbkdf2.inc.in
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('pbkdf2_set_ctx_params',
+                         (['OSSL_KDF_PARAM_PROPERTIES',  'propq',    'utf8_string'],
+                          ['OSSL_KDF_PARAM_DIGEST',      'digest',   'utf8_string'],
+                          ['OSSL_KDF_PARAM_PASSWORD',    'pw',       'octet_string'],
+                          ['OSSL_KDF_PARAM_SALT',        'salt',     'octet_string'],
+                          ['OSSL_KDF_PARAM_ITER',        'iter',     'uint64'],
+                          ['OSSL_KDF_PARAM_PKCS5',       'pkcs5',    'int'],
+                         )); -}
+
+{- produce_param_decoder('pbkdf2_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',                    'size', 'size_t'],
+                          ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind',  'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/pbkdf2_fips.c b/deps/openssl/openssl/providers/implementations/kdfs/pbkdf2_fips.c
deleted file mode 100644
index e43ef16455f..00000000000
--- a/deps/openssl/openssl/providers/implementations/kdfs/pbkdf2_fips.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include "pbkdf2.h"
-
-/*
- * For backwards compatibility reasons,
- * Extra checks are done by default in fips mode only.
- */
-#ifdef FIPS_MODULE
-const int ossl_kdf_pbkdf2_default_checks = 1;
-#else
-const int ossl_kdf_pbkdf2_default_checks = 0;
-#endif /* FIPS_MODULE */
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/pkcs12kdf.c b/deps/openssl/openssl/providers/implementations/kdfs/pkcs12kdf.c
index 397cd50ec6a..b7e60c7b683 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/pkcs12kdf.c
+++ b/deps/openssl/openssl/providers/implementations/kdfs/pkcs12kdf.c
@@ -15,6 +15,7 @@
 #include <openssl/kdf.h>
 #include <openssl/core_names.h>
 #include <openssl/proverr.h>
+#include "internal/common.h"
 #include "internal/cryptlib.h"
 #include "internal/numbers.h"
 #include "crypto/evp.h"
@@ -22,6 +23,7 @@
 #include "prov/providercommon.h"
 #include "prov/implementations.h"
 #include "prov/provider_util.h"
+#include "providers/implementations/kdfs/pkcs12kdf.inc"

 static OSSL_FUNC_kdf_newctx_fn kdf_pkcs12_new;
 static OSSL_FUNC_kdf_dupctx_fn kdf_pkcs12_dup;
@@ -241,38 +243,37 @@ static int kdf_pkcs12_derive(void *vctx, unsigned char *key, size_t keylen,

 static int kdf_pkcs12_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p;
+    struct pkcs12_set_ctx_params_st p;
     KDF_PKCS12 *ctx = vctx;
-    OSSL_LIB_CTX *provctx = PROV_LIBCTX_OF(ctx->provctx);
+    OSSL_LIB_CTX *provctx;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !pkcs12_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    provctx = PROV_LIBCTX_OF(ctx->provctx);

-    if (!ossl_prov_digest_load_from_params(&ctx->digest, params, provctx))
+    if (!ossl_prov_digest_load(&ctx->digest, p.digest, p.propq, provctx))
         return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_PASSWORD)) != NULL)
-        if (!pkcs12kdf_set_membuf(&ctx->pass, &ctx->pass_len, p))
-            return 0;
+    if (p.pw != NULL && !pkcs12kdf_set_membuf(&ctx->pass, &ctx->pass_len, p.pw))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SALT)) != NULL)
-        if (!pkcs12kdf_set_membuf(&ctx->salt, &ctx->salt_len, p))
-            return 0;
+    if (p.salt != NULL
+        && !pkcs12kdf_set_membuf(&ctx->salt, &ctx->salt_len, p.salt))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_PKCS12_ID)) != NULL)
-        if (!OSSL_PARAM_get_int(p, &ctx->id))
-            return 0;
+    if (p.p12id != NULL && !OSSL_PARAM_get_int(p.p12id, &ctx->id))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_ITER)) != NULL)
-        if (!OSSL_PARAM_get_uint64(p, &ctx->iter))
-            return 0;
+    if (p.iter != NULL && !OSSL_PARAM_get_uint64(p.iter, &ctx->iter))
+        return 0;
 #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
     /*
      * If we're running the fuzzer, limit iteration count to
      * 100 so we don't time out running the derivation for
      * a really long time
      */
-    if (getenv("OPENSSL_RUNNING_UNIT_TESTS") == NULL && p != NULL && ctx->iter > 100)
+    if (getenv("OPENSSL_RUNNING_UNIT_TESTS") == NULL && p.iter != NULL && ctx->iter > 100)
         ctx->iter = 100;
 #endif
     return 1;
@@ -281,35 +282,26 @@ static int kdf_pkcs12_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *kdf_pkcs12_settable_ctx_params(
     ossl_unused void *ctx, ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_DIGEST, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_PASSWORD, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SALT, NULL, 0),
-        OSSL_PARAM_uint64(OSSL_KDF_PARAM_ITER, NULL),
-        OSSL_PARAM_int(OSSL_KDF_PARAM_PKCS12_ID, NULL),
-        OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return pkcs12_set_ctx_params_list;
 }

 static int kdf_pkcs12_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    struct pkcs12_get_ctx_params_st p;
+    KDF_PKCS12 *ctx = vctx;

-    if ((p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_SIZE)) != NULL)
-        return OSSL_PARAM_set_size_t(p, SIZE_MAX);
-    return -2;
+    if (ctx == NULL || !pkcs12_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, SIZE_MAX))
+        return 0;
+    return 1;
 }

 static const OSSL_PARAM *kdf_pkcs12_gettable_ctx_params(
     ossl_unused void *ctx, ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL),
-        OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return pkcs12_get_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_kdf_pkcs12_functions[] = {
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/pkcs12kdf.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/pkcs12kdf.inc.in
new file mode 100644
index 00000000000..7dce2c2eff2
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/pkcs12kdf.inc.in
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('pkcs12_set_ctx_params',
+                         (['OSSL_KDF_PARAM_PROPERTIES',  'propq',    'utf8_string'],
+                          ['OSSL_KDF_PARAM_DIGEST',      'digest',   'utf8_string'],
+                          ['OSSL_KDF_PARAM_PASSWORD',    'pw',       'octet_string'],
+                          ['OSSL_KDF_PARAM_SALT',        'salt',     'octet_string'],
+                          ['OSSL_KDF_PARAM_ITER',        'iter',     'uint64'],
+                          ['OSSL_KDF_PARAM_PKCS12_ID',   'p12id',    'int'],
+                         )); -}
+
+{- produce_param_decoder('pkcs12_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',                    'size', 'size_t'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/pvkkdf.c b/deps/openssl/openssl/providers/implementations/kdfs/pvkkdf.c
index bc7f489fa2d..f47d806d7b3 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/pvkkdf.c
+++ b/deps/openssl/openssl/providers/implementations/kdfs/pvkkdf.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,15 +7,18 @@
  * https://www.openssl.org/source/license.html
  */

+#include <string.h>
 #include <openssl/evp.h>
 #include <openssl/core_names.h>
 #include <openssl/proverr.h>
 #include <openssl/err.h>
+#include "internal/common.h"
 #include "internal/numbers.h" /* SIZE_MAX */
 #include "prov/provider_ctx.h"
 #include "prov/providercommon.h"
 #include "prov/implementations.h"
 #include "prov/provider_util.h"
+#include "providers/implementations/kdfs/pvkkdf.inc"

 static OSSL_FUNC_kdf_newctx_fn kdf_pvk_new;
 static OSSL_FUNC_kdf_dupctx_fn kdf_pvk_dup;
@@ -103,12 +106,12 @@ static void kdf_pvk_reset(void *vctx)

 static void kdf_pvk_init(KDF_PVK *ctx)
 {
-    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+    OSSL_PARAM param;
     OSSL_LIB_CTX *provctx = PROV_LIBCTX_OF(ctx->provctx);

-    params[0] = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST,
+    param = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST,
         SN_sha1, 0);
-    if (!ossl_prov_digest_load_from_params(&ctx->digest, params, provctx))
+    if (!ossl_prov_digest_load(&ctx->digest, &param, NULL, provctx))
         /* This is an error, but there is no way to indicate such directly */
         ossl_prov_digest_reset(&ctx->digest);
 }
@@ -178,24 +181,23 @@ static int kdf_pvk_derive(void *vctx, unsigned char *key, size_t keylen,

 static int kdf_pvk_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p;
+    struct pvk_set_ctx_params_st p;
     KDF_PVK *ctx = vctx;
-    OSSL_LIB_CTX *provctx = PROV_LIBCTX_OF(ctx->provctx);
+    OSSL_LIB_CTX *provctx;
+
+    if (ctx == NULL || !pvk_set_ctx_params_decoder(params, &p))
+        return 0;

-    if (ossl_param_is_empty(params))
-        return 1;
+    provctx = PROV_LIBCTX_OF(ctx->provctx);

-    if (!ossl_prov_digest_load_from_params(&ctx->digest, params, provctx))
+    if (!ossl_prov_digest_load(&ctx->digest, p.digest, p.propq, provctx))
         return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_PASSWORD)) != NULL)
-        if (!pvk_set_membuf(&ctx->pass, &ctx->pass_len, p))
-            return 0;
+    if (p.pass != NULL && !pvk_set_membuf(&ctx->pass, &ctx->pass_len, p.pass))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SALT)) != NULL) {
-        if (!pvk_set_membuf(&ctx->salt, &ctx->salt_len, p))
-            return 0;
-    }
+    if (p.salt != NULL && !pvk_set_membuf(&ctx->salt, &ctx->salt_len, p.salt))
+        return 0;

     return 1;
 }
@@ -203,33 +205,26 @@ static int kdf_pvk_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *kdf_pvk_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_DIGEST, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_PASSWORD, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SALT, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return pvk_set_ctx_params_list;
 }

 static int kdf_pvk_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    struct pvk_get_ctx_params_st p;
+    KDF_PVK *ctx = vctx;
+
+    if (ctx == NULL || !pvk_get_ctx_params_decoder(params, &p))
+        return 0;

-    if ((p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_SIZE)) != NULL)
-        return OSSL_PARAM_set_size_t(p, SIZE_MAX);
-    return -2;
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, SIZE_MAX))
+        return 0;
+    return 1;
 }

 static const OSSL_PARAM *kdf_pvk_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL),
-        OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return pvk_get_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_kdf_pvk_functions[] = {
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/pvkkdf.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/pvkkdf.inc.in
new file mode 100644
index 00000000000..998497e5bd7
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/pvkkdf.inc.in
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('pvk_set_ctx_params',
+                         (['OSSL_KDF_PARAM_PROPERTIES',  'propq',    'utf8_string'],
+                          ['OSSL_KDF_PARAM_DIGEST',      'digest',   'utf8_string'],
+                          ['OSSL_KDF_PARAM_PASSWORD',    'pass',     'octet_string'],
+                          ['OSSL_KDF_PARAM_SALT',        'salt',     'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('pvk_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',    'size', 'size_t'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/scrypt.c b/deps/openssl/openssl/providers/implementations/kdfs/scrypt.c
index 37a2c6f1d38..ce24f72cbe1 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/scrypt.c
+++ b/deps/openssl/openssl/providers/implementations/kdfs/scrypt.c
@@ -16,6 +16,7 @@
 #include <openssl/core_names.h>
 #include <openssl/proverr.h>
 #include "crypto/evp.h"
+#include "internal/common.h"
 #include "internal/numbers.h"
 #include "prov/implementations.h"
 #include "prov/provider_ctx.h"
@@ -24,6 +25,8 @@

 #ifndef OPENSSL_NO_SCRYPT

+#include "providers/implementations/kdfs/scrypt.inc"
+
 static OSSL_FUNC_kdf_newctx_fn kdf_scrypt_new;
 static OSSL_FUNC_kdf_dupctx_fn kdf_scrypt_dup;
 static OSSL_FUNC_kdf_freectx_fn kdf_scrypt_free;
@@ -216,55 +219,48 @@ static int is_power_of_two(uint64_t value)

 static int kdf_scrypt_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p;
+    struct scrypt_set_ctx_params_st p;
     KDF_SCRYPT *ctx = vctx;
     uint64_t u64_value;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !scrypt_set_ctx_params_decoder(params, &p))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_PASSWORD)) != NULL)
-        if (!scrypt_set_membuf(&ctx->pass, &ctx->pass_len, p))
-            return 0;
+    if (p.pw != NULL && !scrypt_set_membuf(&ctx->pass, &ctx->pass_len, p.pw))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SALT)) != NULL)
-        if (!scrypt_set_membuf(&ctx->salt, &ctx->salt_len, p))
-            return 0;
+    if (p.salt != NULL && !scrypt_set_membuf(&ctx->salt, &ctx->salt_len, p.salt))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SCRYPT_N))
-        != NULL) {
-        if (!OSSL_PARAM_get_uint64(p, &u64_value)
+    if (p.n != NULL) {
+        if (!OSSL_PARAM_get_uint64(p.n, &u64_value)
             || u64_value <= 1
             || !is_power_of_two(u64_value))
             return 0;
         ctx->N = u64_value;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SCRYPT_R))
-        != NULL) {
-        if (!OSSL_PARAM_get_uint64(p, &u64_value) || u64_value < 1)
+    if (p.r != NULL) {
+        if (!OSSL_PARAM_get_uint64(p.r, &u64_value) || u64_value < 1)
             return 0;
         ctx->r = u64_value;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SCRYPT_P))
-        != NULL) {
-        if (!OSSL_PARAM_get_uint64(p, &u64_value) || u64_value < 1)
+    if (p.p != NULL) {
+        if (!OSSL_PARAM_get_uint64(p.p, &u64_value) || u64_value < 1)
             return 0;
         ctx->p = u64_value;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SCRYPT_MAXMEM))
-        != NULL) {
-        if (!OSSL_PARAM_get_uint64(p, &u64_value) || u64_value < 1)
+    if (p.maxmem != NULL) {
+        if (!OSSL_PARAM_get_uint64(p.maxmem, &u64_value) || u64_value < 1)
             return 0;
         ctx->maxmem_bytes = u64_value;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_PROPERTIES);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING
-            || !set_property_query(ctx, p->data)
+    if (p.propq != NULL) {
+        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING
+            || !set_property_query(ctx, p.propq->data)
             || !set_digest(ctx))
             return 0;
     }
@@ -274,36 +270,26 @@ static int kdf_scrypt_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *kdf_scrypt_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_PASSWORD, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SALT, NULL, 0),
-        OSSL_PARAM_uint64(OSSL_KDF_PARAM_SCRYPT_N, NULL),
-        OSSL_PARAM_uint32(OSSL_KDF_PARAM_SCRYPT_R, NULL),
-        OSSL_PARAM_uint32(OSSL_KDF_PARAM_SCRYPT_P, NULL),
-        OSSL_PARAM_uint64(OSSL_KDF_PARAM_SCRYPT_MAXMEM, NULL),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return scrypt_set_ctx_params_list;
 }

 static int kdf_scrypt_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    struct scrypt_get_ctx_params_st p;
+    KDF_SCRYPT *ctx = vctx;
+
+    if (ctx == NULL || !scrypt_get_ctx_params_decoder(params, &p))
+        return 0;

-    if ((p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_SIZE)) != NULL)
-        return OSSL_PARAM_set_size_t(p, SIZE_MAX);
-    return -2;
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, SIZE_MAX))
+        return 0;
+    return 1;
 }

 static const OSSL_PARAM *kdf_scrypt_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL),
-        OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return scrypt_get_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_kdf_scrypt_functions[] = {
@@ -527,16 +513,16 @@ static int scrypt_alg(const char *pass, size_t passlen,
     X = (uint32_t *)(B + Blen);
     T = X + 32 * r;
     V = T + 32 * r;
-    if (ossl_pkcs5_pbkdf2_hmac_ex(pass, passlen, salt, saltlen, 1, sha256,
-            (int)Blen, B, libctx, propq)
+    if (ossl_pkcs5_pbkdf2_hmac_ex(pass, (int)passlen, salt, (int)saltlen, 1,
+            sha256, (int)Blen, B, libctx, propq)
         == 0)
         goto err;

     for (i = 0; i < p; i++)
         scryptROMix(B + 128 * r * i, r, N, X, T, V);

-    if (ossl_pkcs5_pbkdf2_hmac_ex(pass, passlen, B, (int)Blen, 1, sha256,
-            keylen, key, libctx, propq)
+    if (ossl_pkcs5_pbkdf2_hmac_ex(pass, (int)passlen, B, (int)Blen, 1, sha256,
+            (int)keylen, key, libctx, propq)
         == 0)
         goto err;
     rv = 1;
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/scrypt.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/scrypt.inc.in
new file mode 100644
index 00000000000..d798d8c045b
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/scrypt.inc.in
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('scrypt_set_ctx_params',
+                         (['OSSL_KDF_PARAM_PASSWORD',      'pw',     'octet_string'],
+                          ['OSSL_KDF_PARAM_SALT',          'salt',   'octet_string'],
+                          ['OSSL_KDF_PARAM_SCRYPT_N',      'n',      'uint64'],
+                          ['OSSL_KDF_PARAM_SCRYPT_R',      'r',      'uint32'],
+                          ['OSSL_KDF_PARAM_SCRYPT_P',      'p',      'uint32'],
+                          ['OSSL_KDF_PARAM_SCRYPT_MAXMEM', 'maxmem', 'uint64'],
+                          ['OSSL_KDF_PARAM_PROPERTIES',    'propq',  'utf8_string'],
+                         )); -}
+
+{- produce_param_decoder('scrypt_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',                    'size', 'size_t'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/snmpkdf.c b/deps/openssl/openssl/providers/implementations/kdfs/snmpkdf.c
new file mode 100644
index 00000000000..e857abc1e8e
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/snmpkdf.c
@@ -0,0 +1,337 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/evp.h>
+#include <openssl/kdf.h>
+#include <openssl/sha.h>
+#include <openssl/core_names.h>
+#include <openssl/proverr.h>
+#include "internal/cryptlib.h"
+#include "internal/fips.h"
+#include "prov/provider_ctx.h"
+#include "prov/providercommon.h"
+#include "prov/implementations.h"
+#include "prov/provider_util.h"
+#include "providers/implementations/kdfs/snmpkdf.inc"
+
+#define KDF_SNMP_PASSWORD_HASH_AMOUNT (1024 * 1024)
+#define KDF_SNMP_MIN_PASSWORD_LEN 8
+
+/* See RFC 3414, Appendix A.2.2 */
+/* See NIST SP800-135 Section 6.8 */
+static OSSL_FUNC_kdf_newctx_fn kdf_snmpkdf_new;
+static OSSL_FUNC_kdf_dupctx_fn kdf_snmpkdf_dup;
+static OSSL_FUNC_kdf_freectx_fn kdf_snmpkdf_free;
+static OSSL_FUNC_kdf_reset_fn kdf_snmpkdf_reset;
+static OSSL_FUNC_kdf_derive_fn kdf_snmpkdf_derive;
+static OSSL_FUNC_kdf_settable_ctx_params_fn kdf_snmpkdf_settable_ctx_params;
+static OSSL_FUNC_kdf_set_ctx_params_fn kdf_snmpkdf_set_ctx_params;
+static OSSL_FUNC_kdf_gettable_ctx_params_fn kdf_snmpkdf_gettable_ctx_params;
+static OSSL_FUNC_kdf_get_ctx_params_fn kdf_snmpkdf_get_ctx_params;
+
+static int SNMPKDF(const EVP_MD *evp_md,
+    const unsigned char *eid, size_t eid_len,
+    unsigned char *password, size_t password_len,
+    unsigned char *key, size_t keylen);
+
+typedef struct {
+    /* Warning: Any changes to this structure may require you to update kdf_snmpkdf_dup */
+    void *provctx;
+    PROV_DIGEST digest;
+    unsigned char *eid;
+    size_t eid_len;
+    unsigned char *password;
+    size_t password_len;
+} KDF_SNMPKDF;
+
+static void *kdf_snmpkdf_new(void *provctx)
+{
+    KDF_SNMPKDF *ctx;
+
+    if (!ossl_prov_is_running())
+        return NULL;
+
+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_KDF_SNMPKDF))
+        return NULL;
+#endif
+
+    if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) != NULL)
+        ctx->provctx = provctx;
+    return ctx;
+}
+
+static void *kdf_snmpkdf_dup(void *vctx)
+{
+    const KDF_SNMPKDF *src = (const KDF_SNMPKDF *)vctx;
+    KDF_SNMPKDF *dest;
+
+    dest = kdf_snmpkdf_new(src->provctx);
+    if (dest != NULL) {
+        if (!ossl_prov_memdup(src->eid, src->eid_len,
+                &dest->eid, &dest->eid_len)
+            || !ossl_prov_memdup(src->password, src->password_len,
+                &dest->password, &dest->password_len)
+            || !ossl_prov_digest_copy(&dest->digest, &src->digest))
+            goto err;
+    }
+    return dest;
+
+err:
+    kdf_snmpkdf_free(dest);
+    return NULL;
+}
+
+static void kdf_snmpkdf_free(void *vctx)
+{
+    KDF_SNMPKDF *ctx = (KDF_SNMPKDF *)vctx;
+
+    if (ctx != NULL) {
+        kdf_snmpkdf_reset(ctx);
+        OPENSSL_free(ctx);
+    }
+}
+
+static void kdf_snmpkdf_reset(void *vctx)
+{
+    KDF_SNMPKDF *ctx = (KDF_SNMPKDF *)vctx;
+    void *provctx = ctx->provctx;
+
+    ossl_prov_digest_reset(&ctx->digest);
+    OPENSSL_clear_free(ctx->eid, ctx->eid_len);
+    OPENSSL_clear_free(ctx->password, ctx->password_len);
+    memset(ctx, 0, sizeof(*ctx));
+    ctx->provctx = provctx;
+}
+
+static int snmpkdf_set_membuf(unsigned char **dst, size_t *dst_len,
+    const OSSL_PARAM *p)
+{
+    OPENSSL_clear_free(*dst, *dst_len);
+    *dst = NULL;
+    *dst_len = 0;
+    return OSSL_PARAM_get_octet_string(p, (void **)dst, 0, dst_len);
+}
+
+static int kdf_snmpkdf_derive(void *vctx, unsigned char *key, size_t keylen,
+    const OSSL_PARAM params[])
+{
+    KDF_SNMPKDF *ctx = (KDF_SNMPKDF *)vctx;
+    const EVP_MD *md;
+
+    if (!ossl_prov_is_running() || !kdf_snmpkdf_set_ctx_params(ctx, params))
+        return 0;
+
+    md = ossl_prov_digest_md(&ctx->digest);
+    if (md == NULL) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_MESSAGE_DIGEST);
+        return 0;
+    }
+    if (ctx->eid == NULL) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_EID);
+        return 0;
+    }
+    if (ctx->password == NULL) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_PASS);
+        return 0;
+    }
+
+    return SNMPKDF(md, ctx->eid, ctx->eid_len,
+        ctx->password, ctx->password_len,
+        key, keylen);
+}
+
+static int kdf_snmpkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+{
+    struct snmp_set_ctx_params_st p;
+    KDF_SNMPKDF *ctx = vctx;
+    OSSL_LIB_CTX *libctx;
+#ifdef FIPS_MODULE
+    const EVP_MD *md = NULL;
+#endif
+
+    if (params == NULL)
+        return 1;
+
+    if (ctx == NULL || !snmp_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    libctx = PROV_LIBCTX_OF(ctx->provctx);
+    if (p.digest != NULL) {
+        if (!ossl_prov_digest_load(&ctx->digest, p.digest, p.propq, libctx))
+            return 0;
+#ifdef FIPS_MODULE
+        md = ossl_prov_digest_md(&ctx->digest);
+        if (!EVP_MD_is_a(md, SN_sha1)
+            && !EVP_MD_is_a(md, SN_sha224)
+            && !EVP_MD_is_a(md, SN_sha256)
+            && !EVP_MD_is_a(md, SN_sha384)
+            && !EVP_MD_is_a(md, SN_sha512))
+            return 0;
+#endif
+    }
+
+    if (p.pw != NULL) {
+        if (!snmpkdf_set_membuf(&ctx->password, &ctx->password_len, p.pw))
+            return 0;
+        if ((ctx->password_len > KDF_SNMP_PASSWORD_HASH_AMOUNT) || (ctx->password_len < KDF_SNMP_MIN_PASSWORD_LEN))
+            return 0;
+    }
+
+    if (p.eid != NULL && !snmpkdf_set_membuf(&ctx->eid, &ctx->eid_len, p.eid))
+        return 0;
+
+    return 1;
+}
+
+static const OSSL_PARAM *kdf_snmpkdf_settable_ctx_params(ossl_unused void *ctx,
+    ossl_unused void *p_ctx)
+{
+    return snmp_set_ctx_params_list;
+}
+
+static size_t kdf_snmpkdf_size(KDF_SNMPKDF *ctx)
+{
+    int len;
+    const EVP_MD *md = NULL;
+
+    md = ossl_prov_digest_md(&ctx->digest);
+    if (md == NULL) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_MESSAGE_DIGEST);
+        return 0;
+    }
+    len = EVP_MD_get_size(md);
+    return (len <= 0) ? 0 : (size_t)len;
+}
+
+static int kdf_snmpkdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
+{
+    struct snmp_get_ctx_params_st p;
+    KDF_SNMPKDF *ctx = vctx;
+
+    if (ctx == NULL || !snmp_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.size != NULL) {
+        size_t sz = kdf_snmpkdf_size(ctx);
+
+        if (sz == 0)
+            return 0;
+        if (!OSSL_PARAM_set_size_t(p.size, sz))
+            return 0;
+    }
+    return 1;
+}
+
+static const OSSL_PARAM *kdf_snmpkdf_gettable_ctx_params(ossl_unused void *ctx,
+    ossl_unused void *p_ctx)
+{
+    return snmp_get_ctx_params_list;
+}
+
+const OSSL_DISPATCH ossl_kdf_snmpkdf_functions[] = {
+    { OSSL_FUNC_KDF_NEWCTX, (void (*)(void))kdf_snmpkdf_new },
+    { OSSL_FUNC_KDF_DUPCTX, (void (*)(void))kdf_snmpkdf_dup },
+    { OSSL_FUNC_KDF_FREECTX, (void (*)(void))kdf_snmpkdf_free },
+    { OSSL_FUNC_KDF_RESET, (void (*)(void))kdf_snmpkdf_reset },
+    { OSSL_FUNC_KDF_DERIVE, (void (*)(void))kdf_snmpkdf_derive },
+    { OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS,
+        (void (*)(void))kdf_snmpkdf_settable_ctx_params },
+    { OSSL_FUNC_KDF_SET_CTX_PARAMS, (void (*)(void))kdf_snmpkdf_set_ctx_params },
+    { OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS,
+        (void (*)(void))kdf_snmpkdf_gettable_ctx_params },
+    { OSSL_FUNC_KDF_GET_CTX_PARAMS, (void (*)(void))kdf_snmpkdf_get_ctx_params },
+    { 0, NULL }
+};
+
+/*
+ * SNMPKDF - In compliance with SP800-135 and RFC7860, calculate
+ *           a master key using the engine ID and password.
+ *
+ * Denote engineLength and passwordlen to be the lengths (in bytes) of an
+ * snmpEngineID and a password, respectively.
+ *
+ * Let N = (1024*1024)/passwordlen
+ *
+ * Expanded_password = the leftmost 1048576 bytes of the string of N
+ * repetitions of the password.
+ *
+ * Derived_password = SHA-1 (Expanded_password). The Derived_password
+ * is the output of hashing the Expanded_password by SHA-1.
+ *
+ * Let Shared_key to be the key that the user shares with the authoritative
+ * SNMP engine with ID snmpEngineID. The Shared_key is generated as follows:
+ *
+ * Shared_key = SHA-1(Derived_password || snmpEngineID || Derived_password).
+ *
+ * Input:
+ *     e_id -         engine ID(eid)
+ *     e_len -        engineID length
+ *     password -     password
+ *     password_len - password length
+ *     okey -         pointer to key output, FIPS testing limited to SHA-1.
+ *     keylen -       key length
+ * Output:
+ *     okey   - filled with derived key
+ *     return - 1 on pass, 0 fail
+ */
+static int SNMPKDF(const EVP_MD *evp_md,
+    const unsigned char *e_id, size_t e_len,
+    unsigned char *password, size_t password_len,
+    unsigned char *okey, size_t keylen)
+{
+    EVP_MD_CTX *md = NULL;
+    unsigned char digest[EVP_MAX_MD_SIZE];
+    size_t mdsize = 0, len = 0;
+    unsigned int md_len = 0;
+    int ret = 0;
+    int value = 0;
+
+    /* Limited to SHA-1 and SHA-2 hashes presently */
+    if (okey == NULL || keylen == 0)
+        return 0;
+
+    md = EVP_MD_CTX_new();
+    if (md == NULL) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_MESSAGE_DIGEST);
+        goto err;
+    }
+
+    value = EVP_MD_get_size(evp_md);
+    if (value <= 0 || (size_t)value > keylen)
+        goto err;
+    mdsize = (size_t)value;
+
+    if (!EVP_DigestInit_ex(md, evp_md, NULL))
+        goto err;
+
+    for (len = 0; len < KDF_SNMP_PASSWORD_HASH_AMOUNT - password_len; len += password_len) {
+        if (!EVP_DigestUpdate(md, password, password_len))
+            goto err;
+    }
+
+    if (!EVP_DigestUpdate(md, password, KDF_SNMP_PASSWORD_HASH_AMOUNT - len)
+        || !EVP_DigestFinal_ex(md, digest, &md_len)
+        || !EVP_DigestInit_ex(md, evp_md, NULL)
+        || !EVP_DigestUpdate(md, digest, mdsize)
+        || !EVP_DigestUpdate(md, e_id, e_len)
+        || !EVP_DigestUpdate(md, digest, mdsize)
+        || !EVP_DigestFinal_ex(md, digest, &md_len))
+        goto err;
+
+    memcpy(okey, digest, (keylen < md_len) ? keylen : md_len);
+
+    ret = 1;
+
+err:
+    EVP_MD_CTX_free(md);
+    OPENSSL_cleanse(digest, EVP_MAX_MD_SIZE);
+    return ret;
+}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/snmpkdf.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/snmpkdf.inc.in
new file mode 100644
index 00000000000..05fa2aaa20b
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/snmpkdf.inc.in
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('snmp_set_ctx_params',
+                         (['OSSL_KDF_PARAM_PROPERTIES',    'propq',  'utf8_string'],
+                          ['OSSL_KDF_PARAM_DIGEST',        'digest', 'utf8_string'],
+                          ['OSSL_KDF_PARAM_SNMPKDF_EID',   'eid',    'octet_string'],
+                          ['OSSL_KDF_PARAM_PASSWORD',      'pw',     'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('snmp_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',          'size', 'size_t'],
+                          ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'fips indicator', 'int'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/srtpkdf.c b/deps/openssl/openssl/providers/implementations/kdfs/srtpkdf.c
new file mode 100644
index 00000000000..e55a4042577
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/srtpkdf.c
@@ -0,0 +1,494 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <stdbool.h>
+#include <openssl/evp.h>
+#include <openssl/kdf.h>
+#include <openssl/bn.h>
+#include <openssl/core_names.h>
+#include <openssl/proverr.h>
+#include "internal/cryptlib.h"
+#include "internal/fips.h"
+#include "prov/provider_ctx.h"
+#include "prov/providercommon.h"
+#include "prov/implementations.h"
+#include "prov/provider_util.h"
+#include "providers/implementations/kdfs/srtpkdf.inc"
+
+#define KDF_SRTP_AUTH_KEY_LEN 20
+#define KDF_SRTP_SALT_KEY_LEN 14
+#define KDF_SRTCP_AUTH_KEY_LEN KDF_SRTP_AUTH_KEY_LEN
+#define KDF_SRTCP_SALT_KEY_LEN KDF_SRTP_SALT_KEY_LEN
+#define KDF_SRTP_SALT_LEN 14
+#define KDF_SRTP_KDR_LEN 6
+#define KDF_SRTP_IDX_LEN 6
+#define KDF_SRTCP_IDX_LEN 4
+#define KDF_SRTP_IV_LEN 16
+#define KDF_SRTP_MAX_KDR 24
+#define KDF_SRTP_MAX_LABEL 7
+#define KDF_SRTP_MAX_SALT_LEN (KDF_SRTP_SALT_LEN + 2)
+
+/* See RFC 3711, Section 4.3.3 */
+static OSSL_FUNC_kdf_newctx_fn kdf_srtpkdf_new;
+static OSSL_FUNC_kdf_dupctx_fn kdf_srtpkdf_dup;
+static OSSL_FUNC_kdf_freectx_fn kdf_srtpkdf_free;
+static OSSL_FUNC_kdf_reset_fn kdf_srtpkdf_reset;
+static OSSL_FUNC_kdf_derive_fn kdf_srtpkdf_derive;
+static OSSL_FUNC_kdf_settable_ctx_params_fn kdf_srtpkdf_settable_ctx_params;
+static OSSL_FUNC_kdf_set_ctx_params_fn kdf_srtpkdf_set_ctx_params;
+static OSSL_FUNC_kdf_gettable_ctx_params_fn kdf_srtpkdf_gettable_ctx_params;
+static OSSL_FUNC_kdf_get_ctx_params_fn kdf_srtpkdf_get_ctx_params;
+
+static int SRTPKDF(OSSL_LIB_CTX *provctx, const EVP_CIPHER *cipher,
+    const uint8_t *mkey, const uint8_t *msalt,
+    const uint8_t *index, size_t index_len,
+    const uint32_t kdr, const uint32_t kdr_n,
+    const uint32_t label, uint8_t *obuffer, const size_t keylen);
+
+typedef struct {
+    /* Warning: Any changes to this structure may require you to update kdf_srtpkdf_dup */
+    void *provctx;
+    PROV_CIPHER cipher;
+    unsigned char *key;
+    size_t key_len;
+    unsigned char *salt;
+    size_t salt_len;
+    unsigned char *index;
+    size_t index_len;
+    uint32_t kdr;
+    uint32_t kdr_n; /* 2 ** kdr_n = kdr */
+    uint32_t label;
+} KDF_SRTPKDF;
+
+static void *kdf_srtpkdf_new(void *provctx)
+{
+    KDF_SRTPKDF *ctx;
+
+    if (!ossl_prov_is_running())
+        return NULL;
+
+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_KDF_SRTPKDF))
+        return NULL;
+#endif
+
+    if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) != NULL)
+        ctx->provctx = provctx;
+    return ctx;
+}
+
+static void *kdf_srtpkdf_dup(void *vsrc)
+{
+    const KDF_SRTPKDF *src = (const KDF_SRTPKDF *)vsrc;
+    KDF_SRTPKDF *dest;
+
+    dest = kdf_srtpkdf_new(src->provctx);
+    if (dest != NULL) {
+        if (!ossl_prov_memdup(src->key, src->key_len,
+                &dest->key, &dest->key_len)
+            || !ossl_prov_memdup(src->salt, src->salt_len,
+                &dest->salt, &dest->salt_len)
+            || !ossl_prov_memdup(src->index, src->index_len,
+                &dest->index, &dest->index_len)
+            || !ossl_prov_cipher_copy(&dest->cipher, &src->cipher))
+            goto err;
+        dest->kdr = src->kdr;
+        dest->kdr_n = src->kdr_n;
+        dest->label = src->label;
+    }
+    return dest;
+
+err:
+    kdf_srtpkdf_free(dest);
+    return NULL;
+}
+
+static void kdf_srtpkdf_free(void *vctx)
+{
+    KDF_SRTPKDF *ctx = (KDF_SRTPKDF *)vctx;
+
+    if (ctx != NULL) {
+        kdf_srtpkdf_reset(ctx);
+        OPENSSL_free(ctx);
+    }
+}
+
+static void kdf_srtpkdf_reset(void *vctx)
+{
+    KDF_SRTPKDF *ctx = (KDF_SRTPKDF *)vctx;
+    void *provctx = ctx->provctx;
+
+    ossl_prov_cipher_reset(&ctx->cipher);
+    OPENSSL_clear_free(ctx->key, ctx->key_len);
+    OPENSSL_clear_free(ctx->index, ctx->index_len);
+    OPENSSL_clear_free(ctx->salt, ctx->salt_len);
+    memset(ctx, 0, sizeof(*ctx));
+    ctx->provctx = provctx;
+}
+
+static int srtpkdf_set_membuf(unsigned char **dst, size_t *dst_len,
+    const OSSL_PARAM *p)
+{
+    OPENSSL_clear_free(*dst, *dst_len);
+    *dst = NULL;
+    *dst_len = 0;
+    return OSSL_PARAM_get_octet_string(p, (void **)dst, 0, dst_len);
+}
+
+static int is_power_of_two(uint32_t x, uint32_t *n)
+{
+    /* Check if we've been given an exact power of two */
+    if (x == 0 || (x & (x - 1)) != 0) {
+        *n = 0;
+        return 0;
+    }
+    /* Count the number of trailing bits in the passed value */
+#ifdef __GNUC__
+    *n = __builtin_ctz(x);
+#else
+    {
+        uint32_t count = 0;
+        while ((x & 1) == 0) {
+            count++;
+            x >>= 1;
+        }
+        *n = count;
+    }
+#endif
+    return 1;
+}
+
+static int kdf_srtpkdf_check_key(KDF_SRTPKDF *ctx)
+{
+    const EVP_CIPHER *cipher = ossl_prov_cipher_cipher(&ctx->cipher);
+
+    if (cipher != NULL) {
+        if (ctx->key == NULL) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_KEY);
+            return 0;
+        }
+        if (ctx->key_len != (size_t)EVP_CIPHER_get_key_length(cipher)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
+            return 0;
+        }
+    }
+    return 1;
+}
+
+static int kdf_srtpkdf_derive(void *vctx, unsigned char *key, size_t keylen,
+    const OSSL_PARAM params[])
+{
+    KDF_SRTPKDF *ctx = (KDF_SRTPKDF *)vctx;
+    const EVP_CIPHER *cipher;
+    OSSL_LIB_CTX *libctx;
+
+    if (!ossl_prov_is_running() || !kdf_srtpkdf_set_ctx_params(ctx, params))
+        return 0;
+
+    libctx = PROV_LIBCTX_OF(ctx->provctx);
+
+    cipher = ossl_prov_cipher_cipher(&ctx->cipher);
+    if (cipher == NULL) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_CIPHER);
+        return 0;
+    }
+    if (!kdf_srtpkdf_check_key(ctx))
+        return 0;
+    if (ctx->salt == NULL) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_SALT);
+        return 0;
+    }
+    return SRTPKDF(libctx, cipher, ctx->key, ctx->salt,
+        ctx->index, ctx->index_len, ctx->kdr, ctx->kdr_n, ctx->label,
+        key, keylen);
+}
+
+static int kdf_srtpkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+{
+    struct srtp_set_ctx_params_st p;
+    KDF_SRTPKDF *ctx = vctx;
+    OSSL_LIB_CTX *libctx;
+
+    if (params == NULL)
+        return 1;
+
+    if (ctx == NULL || !srtp_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    libctx = PROV_LIBCTX_OF(ctx->provctx);
+
+    if (p.cipher != NULL) {
+        const EVP_CIPHER *cipher = NULL;
+
+        if (!ossl_prov_cipher_load(&ctx->cipher, p.cipher, p.propq, libctx))
+            return 0;
+        cipher = ossl_prov_cipher_cipher(&ctx->cipher);
+        if (cipher == NULL)
+            return 0;
+        if (!EVP_CIPHER_is_a(cipher, "AES-128-CTR")
+            && !EVP_CIPHER_is_a(cipher, "AES-192-CTR")
+            && !EVP_CIPHER_is_a(cipher, "AES-256-CTR")) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_CIPHER);
+            return 0;
+        }
+    }
+    if (p.key != NULL) {
+        if (!srtpkdf_set_membuf(&ctx->key, &ctx->key_len, p.key))
+            return 0;
+        if (!kdf_srtpkdf_check_key(ctx))
+            return 0;
+    }
+    if (p.salt != NULL) {
+        if (!srtpkdf_set_membuf(&ctx->salt, &ctx->salt_len, p.salt))
+            return 0;
+        if (ctx->salt_len < KDF_SRTP_SALT_LEN) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_SALT_LENGTH);
+            return 0;
+        }
+    }
+    if (p.kdr != NULL) {
+        if (!OSSL_PARAM_get_uint32(p.kdr, &ctx->kdr))
+            return 0;
+        if (ctx->kdr > 0) {
+            uint32_t n = 0;
+
+            if (!is_power_of_two(ctx->kdr, &n)
+                || n > KDF_SRTP_MAX_KDR) {
+                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KDR);
+                return 0;
+            }
+            ctx->kdr_n = n;
+        }
+    }
+
+    if (p.label != NULL) {
+        if (!OSSL_PARAM_get_uint32(p.label, &ctx->label))
+            return 0;
+        if (ctx->label > KDF_SRTP_MAX_LABEL) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_LABEL);
+            return 0;
+        }
+    }
+    if (p.index != NULL) {
+        if (!srtpkdf_set_membuf(&ctx->index, &ctx->index_len, p.index))
+            return 0;
+        /*
+         * Defer checking the index until the derive() since it is dependant
+         * on values of kdr and label.
+         */
+    }
+
+    return 1;
+}
+
+static const OSSL_PARAM *kdf_srtpkdf_settable_ctx_params(ossl_unused void *ctx,
+    ossl_unused void *p_ctx)
+{
+    return srtp_set_ctx_params_list;
+}
+
+static int kdf_srtpkdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
+{
+    struct srtp_get_ctx_params_st p;
+    KDF_SRTPKDF *ctx = vctx;
+
+    if (ctx == NULL || !srtp_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.size != NULL) {
+        const EVP_CIPHER *cipher = ossl_prov_cipher_cipher(&ctx->cipher);
+        size_t sz;
+
+        if (cipher == NULL)
+            return 0;
+        sz = EVP_CIPHER_key_length(cipher);
+
+        if (!OSSL_PARAM_set_size_t(p.size, sz))
+            return 0;
+    }
+    return 1;
+}
+
+static const OSSL_PARAM *kdf_srtpkdf_gettable_ctx_params(ossl_unused void *ctx,
+    ossl_unused void *p_ctx)
+{
+    return srtp_get_ctx_params_list;
+}
+
+const OSSL_DISPATCH ossl_kdf_srtpkdf_functions[] = {
+    { OSSL_FUNC_KDF_NEWCTX, (void (*)(void))kdf_srtpkdf_new },
+    { OSSL_FUNC_KDF_DUPCTX, (void (*)(void))kdf_srtpkdf_dup },
+    { OSSL_FUNC_KDF_FREECTX, (void (*)(void))kdf_srtpkdf_free },
+    { OSSL_FUNC_KDF_RESET, (void (*)(void))kdf_srtpkdf_reset },
+    { OSSL_FUNC_KDF_DERIVE, (void (*)(void))kdf_srtpkdf_derive },
+    { OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS,
+        (void (*)(void))kdf_srtpkdf_settable_ctx_params },
+    { OSSL_FUNC_KDF_SET_CTX_PARAMS,
+        (void (*)(void))kdf_srtpkdf_set_ctx_params },
+    { OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS,
+        (void (*)(void))kdf_srtpkdf_gettable_ctx_params },
+    { OSSL_FUNC_KDF_GET_CTX_PARAMS,
+        (void (*)(void))kdf_srtpkdf_get_ctx_params },
+    { 0, NULL }
+};
+
+static bool is_srtp(uint32_t label)
+{
+    static const bool strp_table[] = {
+        true, /* 0 */
+        true, /* 1 */
+        true, /* 2 */
+        false, /* 3 */
+        false, /* 4 */
+        false, /* 5 */
+        true, /* 6 */
+        true, /* 7 */
+    };
+    return strp_table[label];
+}
+
+/*
+ * SRTPKDF - In compliance with SP800-135 and RFC3711, calculate
+ *           various keys defined by label using a master key,
+ *           master salt, kdr(if non-zero) and index.
+ *
+ * Denote the cryptographic key (encryption key, cipher salt or
+ * authentication key(HMAC key), etc) to be derived as K. The
+ * length of K is denoted by L. Below is a description of the KDF.
+ *
+ * master_salt: a random non-salt value.
+ * kdr: the key derivation rate. kdr is a number from the set
+ *   factor of 2.
+ * index: a 48-bit value in RTP or a 32-bit value in RTCP.
+ *   See Sections 3.2.1 and 4.3.2 of RFC 3711 for details.
+ * A function, DIV, is defined as followed:
+ *   a and x are non-negative integers.
+ *   a DIV x =  a | x (a DIV x) is represented as a bit string whose
+ *   length (in bits) is the same as a.
+ * label: an 8-bit value represented by two hexadecimal numbers from
+ *   the set of {0x00,0x01, 0x02, 0x03, 0x04, 0x05}.
+ *   https://www.ietf.org/archive/id/draft-ietf-avtcore-srtp-encrypted-header-ext-01.html
+ *   The values 06 and 07 are used.
+ * key_id = label || (index DIV kdr)
+ *
+ * Input:
+ *   cipher - AES cipher
+ *   mkey - pointer to master key
+ *   msalt - pointer to master salt
+ *   index - pointer to index
+ *   idxlen - size of the index buffer
+ *   kdr - key derivation rate
+ *   kdr_n - power of kdr (2**kdr_n = kdr)
+ *   label - 8-bit label
+ *   keylen - size of obuffer
+ * Output:
+ *   obuffer - filled with derived key
+ *   return - 1 on pass, 0 fail
+ */
+int SRTPKDF(OSSL_LIB_CTX *provctx, const EVP_CIPHER *cipher,
+    const uint8_t *mkey, const uint8_t *msalt,
+    const uint8_t *index, size_t idxlen,
+    const uint32_t kdr, const uint32_t kdr_n,
+    const uint32_t label, uint8_t *obuffer, const size_t keylen)
+{
+    EVP_CIPHER_CTX *ctx = NULL;
+    int outl, i, index_len = 0, o_len = 0, salt_len = 0;
+    uint8_t buf[EVP_MAX_KEY_LENGTH];
+    uint8_t iv[KDF_SRTP_IV_LEN];
+    uint8_t local_salt[KDF_SRTP_MAX_SALT_LEN];
+    uint8_t master_salt[KDF_SRTP_MAX_SALT_LEN];
+    BIGNUM *bn_index = NULL, *bn_salt = NULL;
+    int ret, iv_len = KDF_SRTP_IV_LEN, rv = 0;
+
+    if (obuffer == NULL || keylen > INT_MAX)
+        return rv;
+    /* get label-specific lengths */
+    switch (label) {
+    case 0:
+    case 3:
+    case 6:
+        o_len = EVP_CIPHER_key_length(cipher);
+        break;
+    case 1:
+        o_len = KDF_SRTP_AUTH_KEY_LEN;
+        break;
+    case 4:
+        o_len = KDF_SRTCP_AUTH_KEY_LEN;
+        break;
+    case 2:
+    case 7:
+        o_len = KDF_SRTP_SALT_KEY_LEN;
+        break;
+    case 5:
+        o_len = KDF_SRTCP_SALT_KEY_LEN;
+        break;
+    default:
+        return rv;
+    }
+    if (o_len > (int)keylen)
+        return rv;
+
+    /* set up a couple of work areas for the final logic on the salt */
+    salt_len = KDF_SRTP_SALT_LEN;
+    memset(iv, 0, KDF_SRTP_IV_LEN);
+    memset(master_salt, 0, sizeof(master_salt));
+    memcpy(master_salt, msalt, salt_len);
+
+    /* gather some bignums for some math */
+    bn_index = BN_new();
+    bn_salt = BN_new();
+    if ((bn_index == NULL) || (bn_salt == NULL)) {
+        BN_free(bn_index);
+        BN_free(bn_salt);
+        return rv;
+    }
+
+    index_len = is_srtp(label) ? KDF_SRTP_IDX_LEN : KDF_SRTCP_IDX_LEN;
+    /* if index is NULL or kdr=0, then index and kdr are not in play */
+    if (index != NULL && idxlen > 0 && kdr > 0) {
+        if ((int)idxlen < index_len) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_INDEX_LENGTH);
+            goto err;
+        }
+        if (!BN_bin2bn(index, index_len, bn_index))
+            goto err;
+
+        ret = BN_rshift(bn_salt, bn_index, kdr_n);
+        if (!ret)
+            goto err;
+        iv_len = BN_bn2bin(bn_salt, iv);
+        for (i = 1; i <= iv_len; i++)
+            master_salt[salt_len - i] ^= iv[iv_len - i];
+    }
+
+    /* take the munged up salt from above and add the label */
+    memset(local_salt, 0, KDF_SRTP_MAX_SALT_LEN);
+    memcpy(local_salt, master_salt, salt_len);
+    local_salt[((KDF_SRTP_SALT_LEN - 1) - index_len)] ^= label;
+
+    /* perform the AES encryption on the master key and derived salt */
+    memset(buf, 0, o_len);
+    if (!(ctx = EVP_CIPHER_CTX_new())
+        || (EVP_EncryptInit_ex(ctx, cipher, NULL, mkey, local_salt) <= 0)
+        || (EVP_CIPHER_CTX_set_padding(ctx, 0) <= 0)
+        || (EVP_EncryptUpdate(ctx, (unsigned char *)obuffer, &outl, buf, o_len) <= 0)
+        || (EVP_EncryptFinal_ex(ctx, (unsigned char *)obuffer, &outl) <= 0))
+        goto err;
+
+    rv = 1;
+err:
+    EVP_CIPHER_CTX_free(ctx);
+    OPENSSL_cleanse(iv, KDF_SRTP_IV_LEN);
+    OPENSSL_cleanse(local_salt, KDF_SRTP_MAX_SALT_LEN);
+    OPENSSL_cleanse(master_salt, KDF_SRTP_IV_LEN);
+    BN_clear_free(bn_index);
+    BN_clear_free(bn_salt);
+    return rv;
+}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/srtpkdf.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/srtpkdf.inc.in
new file mode 100644
index 00000000000..b909cfd989f
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/srtpkdf.inc.in
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('srtp_set_ctx_params',
+                         (['OSSL_KDF_PARAM_PROPERTIES',    'propq',  'utf8_string'],
+                          ['OSSL_KDF_PARAM_CIPHER',        'cipher', 'utf8_string'],
+                          ['OSSL_KDF_PARAM_KEY',           'key',    'octet_string'],
+                          ['OSSL_KDF_PARAM_SALT',          'salt',   'octet_string'],
+                          ['OSSL_KDF_PARAM_SRTPKDF_INDEX', 'index',  'octet_string'],
+                          ['OSSL_KDF_PARAM_SRTPKDF_KDR',   'kdr',    'uint32'],
+                          ['OSSL_KDF_PARAM_LABEL',         'label',  'uint32'],
+                         )); -}
+
+{- produce_param_decoder('srtp_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',          'size', 'size_t'],
+                          ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'fips indicator', 'int'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/sshkdf.c b/deps/openssl/openssl/providers/implementations/kdfs/sshkdf.c
index af39ba9a4f5..ee2f75a7c2a 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/sshkdf.c
+++ b/deps/openssl/openssl/providers/implementations/kdfs/sshkdf.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,6 +15,7 @@
 #include <openssl/core_names.h>
 #include <openssl/proverr.h>
 #include "internal/cryptlib.h"
+#include "internal/fips.h"
 #include "internal/numbers.h"
 #include "crypto/evp.h"
 #include "prov/provider_ctx.h"
@@ -22,6 +23,7 @@
 #include "prov/implementations.h"
 #include "prov/provider_util.h"
 #include "prov/securitycheck.h"
+#include "providers/implementations/kdfs/sshkdf.inc"

 /* See RFC 4253, Section 7.2 */
 static OSSL_FUNC_kdf_newctx_fn kdf_sshkdf_new;
@@ -60,6 +62,16 @@ static void *kdf_sshkdf_new(void *provctx)
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    /*
+     * Normally we'd want a call to ossl_deferred_self_test() here, but
+     * according to FIPS 140-3 10.3.A Note18: SSH KDF is not required, since
+     * it is sufficient to self-test the underlying SHA hash functions.
+     * The underlying hash functions are implicitly tested when the hash is
+     * instantiated, so we do not need to have an explicit test here.
+     */
+#endif
+
     if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) != NULL) {
         ctx->provctx = provctx;
         OSSL_FIPS_IND_INIT(ctx)
@@ -144,7 +156,7 @@ static int fips_digest_check_passed(KDF_SSHKDF *ctx, const EVP_MD *md)
     if (digest_unapproved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE0,
                 libctx, "SSHKDF", "Digest",
-                ossl_fips_config_sshkdf_digest_check)) {
+                FIPS_CONFIG_SSHKDF_DIGEST_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED);
             return 0;
         }
@@ -160,7 +172,7 @@ static int fips_key_check_passed(KDF_SSHKDF *ctx)
     if (!key_approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE1,
                 libctx, "SSHKDF", "Key size",
-                ossl_fips_config_sshkdf_key_check)) {
+                FIPS_CONFIG_SSHKDF_KEY_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
             return 0;
         }
@@ -208,24 +220,24 @@ static int kdf_sshkdf_derive(void *vctx, unsigned char *key, size_t keylen,

 static int kdf_sshkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p;
+    struct sshkdf_set_ctx_params_st p;
     KDF_SSHKDF *ctx = vctx;
-    OSSL_LIB_CTX *provctx = PROV_LIBCTX_OF(ctx->provctx);
+    OSSL_LIB_CTX *provctx;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !sshkdf_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    provctx = PROV_LIBCTX_OF(ctx->provctx);

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_KDF_PARAM_FIPS_DIGEST_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, p.ind_d))
         return 0;
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE1, params,
-            OSSL_KDF_PARAM_FIPS_KEY_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE1, p.ind_k))
         return 0;

-    if (OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST) != NULL) {
+    if (p.digest != NULL) {
         const EVP_MD *md = NULL;

-        if (!ossl_prov_digest_load_from_params(&ctx->digest, params, provctx))
+        if (!ossl_prov_digest_load(&ctx->digest, p.digest, p.propq, provctx))
             return 0;

         md = ossl_prov_digest_md(&ctx->digest);
@@ -240,8 +252,8 @@ static int kdf_sshkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 #endif
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_KEY)) != NULL) {
-        if (!sshkdf_set_membuf(&ctx->key, &ctx->key_len, p))
+    if (p.key != NULL) {
+        if (!sshkdf_set_membuf(&ctx->key, &ctx->key_len, p.key))
             return 0;

 #ifdef FIPS_MODULE
@@ -250,24 +262,21 @@ static int kdf_sshkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 #endif
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SSHKDF_XCGHASH))
-        != NULL)
-        if (!sshkdf_set_membuf(&ctx->xcghash, &ctx->xcghash_len, p))
-            return 0;
+    if (p.xcg != NULL
+        && !sshkdf_set_membuf(&ctx->xcghash, &ctx->xcghash_len, p.xcg))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SSHKDF_SESSION_ID))
-        != NULL)
-        if (!sshkdf_set_membuf(&ctx->session_id, &ctx->session_id_len, p))
-            return 0;
+    if (p.sid != NULL
+        && !sshkdf_set_membuf(&ctx->session_id, &ctx->session_id_len, p.sid))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SSHKDF_TYPE))
-        != NULL) {
+    if (p.type != NULL) {
         const char *kdftype;

-        if (!OSSL_PARAM_get_utf8_string_ptr(p, &kdftype))
+        if (!OSSL_PARAM_get_utf8_string_ptr(p.type, &kdftype))
             return 0;
         /* Expect one character (byte in this case) */
-        if (kdftype == NULL || p->data_size != 1)
+        if (kdftype == NULL || p.type->data_size != 1)
             return 0;
         if (kdftype[0] < 65 || kdftype[0] > 70) {
             ERR_raise(ERR_LIB_PROV, PROV_R_VALUE_ERROR);
@@ -281,29 +290,21 @@ static int kdf_sshkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *kdf_sshkdf_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_DIGEST, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_KEY, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SSHKDF_XCGHASH, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SSHKDF_SESSION_ID, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_SSHKDF_TYPE, NULL, 0),
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_KDF_PARAM_FIPS_DIGEST_CHECK)
-            OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_KDF_PARAM_FIPS_KEY_CHECK)
-                OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return sshkdf_set_ctx_params_list;
 }

 static int kdf_sshkdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    KDF_SSHKDF *ctx = (KDF_SSHKDF *)vctx;
+    struct sshkdf_get_ctx_params_st p;

-    if ((p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_SIZE)) != NULL) {
-        if (!OSSL_PARAM_set_size_t(p, SIZE_MAX))
-            return 0;
-    }
-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(((KDF_SSHKDF *)vctx), params))
+    if (ctx == NULL || !sshkdf_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, SIZE_MAX))
+        return 0;
+
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(ctx, p.ind))
         return 0;
     return 1;
 }
@@ -311,12 +312,7 @@ static int kdf_sshkdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
 static const OSSL_PARAM *kdf_sshkdf_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL),
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return sshkdf_get_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_kdf_sshkdf_functions[] = {
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/sshkdf.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/sshkdf.inc.in
new file mode 100644
index 00000000000..743edf4f5d0
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/sshkdf.inc.in
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('sshkdf_set_ctx_params',
+                         (['OSSL_KDF_PARAM_PROPERTIES',        'propq',   'utf8_string'],
+                          ['OSSL_KDF_PARAM_DIGEST',            'digest',  'utf8_string'],
+                          ['OSSL_KDF_PARAM_KEY',               'key',     'octet_string'],
+                          ['OSSL_KDF_PARAM_SSHKDF_XCGHASH',    'xcg',     'octet_string'],
+                          ['OSSL_KDF_PARAM_SSHKDF_SESSION_ID', 'sid',     'octet_string'],
+                          ['OSSL_KDF_PARAM_SSHKDF_TYPE',       'type',    'utf8_string'],
+                          ['OSSL_KDF_PARAM_FIPS_DIGEST_CHECK', 'ind_d',   'int', 'fips'],
+                          ['OSSL_KDF_PARAM_FIPS_KEY_CHECK',    'ind_k',   'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('sshkdf_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',                    'size', 'size_t'],
+                          ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind',  'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/sskdf.c b/deps/openssl/openssl/providers/implementations/kdfs/sskdf.c
index f5a046d6659..572ef4134fc 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/sskdf.c
+++ b/deps/openssl/openssl/providers/implementations/kdfs/sskdf.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2019, Oracle and/or its affiliates.  All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -44,6 +44,7 @@
 #include <openssl/params.h>
 #include <openssl/proverr.h>
 #include "internal/cryptlib.h"
+#include "internal/fips.h"
 #include "internal/numbers.h"
 #include "crypto/evp.h"
 #include "prov/provider_ctx.h"
@@ -53,6 +54,9 @@
 #include "prov/securitycheck.h"
 #include "internal/params.h"

+#define SSKDF_MAX_INLEN (1 << 30)
+#define SSKDF_MAX_INFOS 5
+
 typedef struct {
     void *provctx;
     EVP_MAC_CTX *macctx; /* H(x) = HMAC_hash OR H(x) = KMAC */
@@ -68,43 +72,55 @@ typedef struct {
     OSSL_FIPS_IND_DECLARE
 } KDF_SSKDF;

-#define SSKDF_MAX_INLEN (1 << 30)
-#define SSKDF_KMAC128_DEFAULT_SALT_SIZE (168 - 4)
-#define SSKDF_KMAC256_DEFAULT_SALT_SIZE (136 - 4)
-
-/* KMAC uses a Customisation string of 'KDF' */
-static const unsigned char kmac_custom_str[] = { 0x4B, 0x44, 0x46 };
+struct sskdf_all_set_ctx_params_st {
+    OSSL_PARAM *secret;
+    OSSL_PARAM *propq;
+    OSSL_PARAM *digest;
+    OSSL_PARAM *mac;
+    OSSL_PARAM *salt;
+    OSSL_PARAM *size;
+#ifdef FIPS_MODULE
+    OSSL_PARAM *ind_k;
+    OSSL_PARAM *ind_d;
+#endif
+    OSSL_PARAM *info[SSKDF_MAX_INFOS];
+    int num_info;
+};

+static OSSL_FUNC_kdf_newctx_fn sskdf_common_new;
+#ifndef OPENSSL_NO_SSKDF
 static OSSL_FUNC_kdf_newctx_fn sskdf_new;
+#endif
+#ifndef OPENSSL_NO_X963KDF
+static OSSL_FUNC_kdf_newctx_fn x963_new;
+#endif
 static OSSL_FUNC_kdf_dupctx_fn sskdf_dup;
 static OSSL_FUNC_kdf_freectx_fn sskdf_free;
 static OSSL_FUNC_kdf_reset_fn sskdf_reset;
+
+#ifndef OPENSSL_NO_SSKDF
+#define SSKDF_KMAC128_DEFAULT_SALT_SIZE (168 - 4)
+#define SSKDF_KMAC256_DEFAULT_SALT_SIZE (136 - 4)
+/* KMAC uses a Customisation string of 'KDF' */
+static const unsigned char kmac_custom_str[] = { 0x4B, 0x44, 0x46 };
+
 static OSSL_FUNC_kdf_derive_fn sskdf_derive;
 static OSSL_FUNC_kdf_settable_ctx_params_fn sskdf_settable_ctx_params;
 static OSSL_FUNC_kdf_set_ctx_params_fn sskdf_set_ctx_params;
 static OSSL_FUNC_kdf_gettable_ctx_params_fn sskdf_gettable_ctx_params;
 static OSSL_FUNC_kdf_get_ctx_params_fn sskdf_get_ctx_params;
+#define sskdf_set_ctx_params_st sskdf_all_set_ctx_params_st
+#include "providers/implementations/kdfs/sskdf.inc"
+#endif
+#ifndef OPENSSL_NO_X963KDF
 static OSSL_FUNC_kdf_derive_fn x963kdf_derive;
 static OSSL_FUNC_kdf_settable_ctx_params_fn x963kdf_settable_ctx_params;
 static OSSL_FUNC_kdf_set_ctx_params_fn x963kdf_set_ctx_params;
 static OSSL_FUNC_kdf_gettable_ctx_params_fn x963kdf_gettable_ctx_params;
 static OSSL_FUNC_kdf_get_ctx_params_fn x963kdf_get_ctx_params;
-
-/* Settable context parameters that are common across SSKDF and X963 KDF */
-#define SSKDF_COMMON_SETTABLES                                      \
-    OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SECRET, NULL, 0),        \
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_KEY, NULL, 0),       \
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_INFO, NULL, 0),      \
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0), \
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_DIGEST, NULL, 0),     \
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_MAC, NULL, 0),        \
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SALT, NULL, 0),      \
-        OSSL_PARAM_size_t(OSSL_KDF_PARAM_MAC_SIZE, NULL)
-
-/* Gettable context parameters that are common across SSKDF and X963 KDF */
-#define SSKDF_COMMON_GETTABLES \
-    OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL)
-
+#define x963kdf_set_ctx_params_st sskdf_all_set_ctx_params_st
+#include "providers/implementations/kdfs/x963kdf.inc"
+#endif
 /*
  * Refer to https://csrc.nist.gov/publications/detail/sp/800-56c/rev-1/final
  * Section 4. One-Step Key Derivation using H(x) = hash(x)
@@ -179,6 +195,7 @@ end:
     return ret;
 }

+#ifndef OPENSSL_NO_SSKDF
 static int kmac_init(EVP_MAC_CTX *ctx, const unsigned char *custom,
     size_t custom_len, size_t kmac_out_len,
     size_t derived_key_len, unsigned char **out)
@@ -305,8 +322,9 @@ end:
     EVP_MAC_CTX_free(ctx);
     return ret;
 }
+#endif /* OPENSSL_NO_SSKDF */

-static void *sskdf_new(void *provctx)
+static void *sskdf_common_new(void *provctx)
 {
     KDF_SSKDF *ctx;

@@ -320,6 +338,32 @@ static void *sskdf_new(void *provctx)
     return ctx;
 }

+#ifndef OPENSSL_NO_SSKDF
+static void *sskdf_new(void *provctx)
+{
+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_KDF_SSKDF))
+        return NULL;
+#endif
+
+    return sskdf_common_new(provctx);
+}
+#endif
+
+#ifndef OPENSSL_NO_X963KDF
+static void *x963_new(void *provctx)
+{
+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_KDF_X963KDF))
+        return NULL;
+#endif
+
+    return sskdf_common_new(provctx);
+}
+#endif
+
 static void sskdf_reset(void *vctx)
 {
     KDF_SSKDF *ctx = (KDF_SSKDF *)vctx;
@@ -349,7 +393,7 @@ static void *sskdf_dup(void *vctx)
     const KDF_SSKDF *src = (const KDF_SSKDF *)vctx;
     KDF_SSKDF *dest;

-    dest = sskdf_new(src->provctx);
+    dest = sskdf_common_new(src->provctx);
     if (dest != NULL) {
         if (src->macctx != NULL) {
             dest->macctx = EVP_MAC_CTX_dup(src->macctx);
@@ -392,6 +436,7 @@ static size_t sskdf_size(KDF_SSKDF *ctx)
     return (len <= 0) ? 0 : (size_t)len;
 }

+#ifndef OPENSSL_NO_SSKDF
 #ifdef FIPS_MODULE
 static int fips_sskdf_key_check_passed(KDF_SSKDF *ctx)
 {
@@ -401,14 +446,14 @@ static int fips_sskdf_key_check_passed(KDF_SSKDF *ctx)
     if (!key_approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE0,
                 libctx, "SSKDF", "Key size",
-                ossl_fips_config_sskdf_key_check)) {
+                FIPS_CONFIG_SSKDF_KEY_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
             return 0;
         }
     }
     return 1;
 }
-#endif
+#endif /* FIPS_MODULE */

 static int sskdf_derive(void *vctx, unsigned char *key, size_t keylen,
     const OSSL_PARAM params[])
@@ -477,7 +522,9 @@ static int sskdf_derive(void *vctx, unsigned char *key, size_t keylen,
             ctx->info, ctx->info_len, 0, key, keylen);
     }
 }
+#endif

+#ifndef OPENSSL_NO_X963KDF
 #ifdef FIPS_MODULE
 static int fips_x963kdf_digest_check_passed(KDF_SSKDF *ctx, const EVP_MD *md)
 {
@@ -494,7 +541,7 @@ static int fips_x963kdf_digest_check_passed(KDF_SSKDF *ctx, const EVP_MD *md)
     if (digest_unapproved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE0,
                 libctx, "X963KDF", "Digest",
-                ossl_fips_config_x963kdf_digest_check)) {
+                FIPS_CONFIG_X963KDF_DIGEST_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED);
             return 0;
         }
@@ -510,14 +557,14 @@ static int fips_x963kdf_key_check_passed(KDF_SSKDF *ctx)
     if (!key_approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE1,
                 libctx, "X963KDF", "Key size",
-                ossl_fips_config_x963kdf_key_check)) {
+                FIPS_CONFIG_X963KDF_KEY_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
             return 0;
         }
     }
     return 1;
 }
-#endif
+#endif /* FIPS_MODULE */

 static int x963kdf_derive(void *vctx, unsigned char *key, size_t keylen,
     const OSSL_PARAM params[])
@@ -548,32 +595,18 @@ static int x963kdf_derive(void *vctx, unsigned char *key, size_t keylen,
     return SSKDF_hash_kdm(md, ctx->secret, ctx->secret_len,
         ctx->info, ctx->info_len, 1, key, keylen);
 }
+#endif /* OPENSSL_NO_X963KDF */

-static int sskdf_common_set_ctx_params(KDF_SSKDF *ctx, const OSSL_PARAM params[])
+static int sskdf_common_set_ctx_params(KDF_SSKDF *ctx, struct sskdf_all_set_ctx_params_st *p,
+    const OSSL_PARAM *params, OSSL_LIB_CTX *libctx)
 {
-    const OSSL_PARAM *p;
-    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
+
     const EVP_MD *md = NULL;
     size_t sz;
     int r;

-    if (ossl_param_is_empty(params))
-        return 1;
-
-    if (!ossl_prov_macctx_load_from_params(&ctx->macctx, params,
-            NULL, NULL, NULL, libctx))
-        return 0;
-    if (ctx->macctx != NULL) {
-        if (EVP_MAC_is_a(EVP_MAC_CTX_get0_mac(ctx->macctx),
-                OSSL_MAC_NAME_KMAC128)
-            || EVP_MAC_is_a(EVP_MAC_CTX_get0_mac(ctx->macctx),
-                OSSL_MAC_NAME_KMAC256)) {
-            ctx->is_kmac = 1;
-        }
-    }
-
-    if (OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST) != NULL) {
-        if (!ossl_prov_digest_load_from_params(&ctx->digest, params, libctx))
+    if (p->digest != NULL) {
+        if (!ossl_prov_digest_load(&ctx->digest, p->digest, p->propq, libctx))
             return 0;

         md = ossl_prov_digest_md(&ctx->digest);
@@ -583,49 +616,59 @@ static int sskdf_common_set_ctx_params(KDF_SSKDF *ctx, const OSSL_PARAM params[]
         }
     }

-    r = ossl_param_get1_octet_string(params, OSSL_KDF_PARAM_SECRET,
-        &ctx->secret, &ctx->secret_len);
-    if (r == -1)
-        r = ossl_param_get1_octet_string(params, OSSL_KDF_PARAM_KEY,
-            &ctx->secret, &ctx->secret_len);
+    r = ossl_param_get1_octet_string_from_param(p->secret, &ctx->secret,
+        &ctx->secret_len);
     if (r == 0)
         return 0;

-    if (ossl_param_get1_concat_octet_string(params, OSSL_KDF_PARAM_INFO,
-            &ctx->info, &ctx->info_len, 0)
+    if (ossl_param_get1_concat_octet_string(p->num_info, p->info, &ctx->info,
+            &ctx->info_len)
         == 0)
         return 0;

-    if (ossl_param_get1_octet_string(params, OSSL_KDF_PARAM_SALT,
-            &ctx->salt, &ctx->salt_len)
-        == 0)
-        return 0;
-
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_MAC_SIZE))
-        != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &sz) || sz == 0)
+    if (p->size != NULL) {
+        if (!OSSL_PARAM_get_size_t(p->size, &sz) || sz == 0)
             return 0;
         ctx->out_len = sz;
     }
     return 1;
 }

+#ifndef OPENSSL_NO_SSKDF
 static int sskdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     KDF_SSKDF *ctx = (KDF_SSKDF *)vctx;
+    OSSL_LIB_CTX *libctx;
+    struct sskdf_all_set_ctx_params_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !sskdf_set_ctx_params_decoder(params, &p))
+        return 0;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_KDF_PARAM_FIPS_KEY_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, p.ind_k))
         return 0;

-    if (!sskdf_common_set_ctx_params(ctx, params))
+    libctx = PROV_LIBCTX_OF(ctx->provctx);
+    if (!ossl_prov_macctx_load(&ctx->macctx,
+            p.mac, NULL, p.digest, p.propq,
+            NULL, NULL, NULL, libctx))
+        return 0;
+    if (ctx->macctx != NULL) {
+        if (EVP_MAC_is_a(EVP_MAC_CTX_get0_mac(ctx->macctx),
+                OSSL_MAC_NAME_KMAC128)
+            || EVP_MAC_is_a(EVP_MAC_CTX_get0_mac(ctx->macctx),
+                OSSL_MAC_NAME_KMAC256)) {
+            ctx->is_kmac = 1;
+        }
+    }
+    if (ossl_param_get1_octet_string_from_param(p.salt, &ctx->salt,
+            &ctx->salt_len)
+        == 0)
+        return 0;
+    if (!sskdf_common_set_ctx_params(ctx, &p, params, libctx))
         return 0;

 #ifdef FIPS_MODULE
-    if ((OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_KEY) != NULL) || (OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SECRET) != NULL))
+    if (p.secret != NULL)
         if (!fips_sskdf_key_check_passed(ctx))
             return 0;
 #endif
@@ -636,82 +679,61 @@ static int sskdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *sskdf_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        SSKDF_COMMON_SETTABLES,
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_KDF_PARAM_FIPS_KEY_CHECK)
-            OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
-}
-
-static int sskdf_common_get_ctx_params(KDF_SSKDF *ctx, OSSL_PARAM params[])
-{
-    OSSL_PARAM *p;
-
-    if (ossl_param_is_empty(params))
-        return 1;
-
-    if ((p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_SIZE)) != NULL) {
-        if (!OSSL_PARAM_set_size_t(p, sskdf_size(ctx)))
-            return 0;
-    }
-
-    return 1;
+    return sskdf_set_ctx_params_list;
 }

 static int sskdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     KDF_SSKDF *ctx = (KDF_SSKDF *)vctx;
+    struct sskdf_get_ctx_params_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
-
-    if (!sskdf_common_get_ctx_params(ctx, params))
+    if (ctx == NULL || !sskdf_get_ctx_params_decoder(params, &p))
         return 0;

-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(ctx, params))
+    if (p.size != NULL) {
+        if (!OSSL_PARAM_set_size_t(p.size, sskdf_size(ctx)))
+            return 0;
+    }
+
+    if (!OSSL_FIPS_IND_GET_CTX_PARAM(ctx, p.ind))
         return 0;

     return 1;
 }

-static const OSSL_PARAM *sskdf_gettable_ctx_params(ossl_unused void *ctx,
-    ossl_unused void *provctx)
+static const OSSL_PARAM *sskdf_gettable_ctx_params(ossl_unused void *ctx, ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        SSKDF_COMMON_GETTABLES,
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return sskdf_get_ctx_params_list;
 }

+#endif /* OPENSSL_NO_SSKDF */
+
+#ifndef OPENSSL_NO_X963KDF
 static int x963kdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     KDF_SSKDF *ctx = (KDF_SSKDF *)vctx;
+    struct sskdf_all_set_ctx_params_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !x963kdf_set_ctx_params_decoder(params, &p))
+        return 0;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_KDF_PARAM_FIPS_DIGEST_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, p.ind_d))
         return 0;
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE1, params,
-            OSSL_KDF_PARAM_FIPS_KEY_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE1, p.ind_k))
         return 0;

-    if (!sskdf_common_set_ctx_params(ctx, params))
+    if (!sskdf_common_set_ctx_params(ctx, &p, params, PROV_LIBCTX_OF(ctx->provctx)))
         return 0;

 #ifdef FIPS_MODULE
-    if (OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST) != NULL) {
+    if (p.digest != NULL) {
         const EVP_MD *md = ossl_prov_digest_md(&ctx->digest);

         if (!fips_x963kdf_digest_check_passed(ctx, md))
             return 0;
     }

-    if ((OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_KEY) != NULL) || (OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SECRET) != NULL))
+    if (p.secret != NULL)
         if (!fips_x963kdf_key_check_passed(ctx))
             return 0;
 #endif
@@ -722,39 +744,36 @@ static int x963kdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *x963kdf_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        SSKDF_COMMON_SETTABLES,
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_KDF_PARAM_FIPS_DIGEST_CHECK)
-            OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_KDF_PARAM_FIPS_KEY_CHECK)
-                OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return x963kdf_set_ctx_params_list;
 }

 static int x963kdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     KDF_SSKDF *ctx = (KDF_SSKDF *)vctx;
+    struct x963kdf_get_ctx_params_st p;

-    if (!sskdf_common_get_ctx_params(ctx, params))
+    if (ctx == NULL || !x963kdf_get_ctx_params_decoder(params, &p))
         return 0;

-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(ctx, params))
+    if (p.size != NULL) {
+        if (!OSSL_PARAM_set_size_t(p.size, sskdf_size(ctx)))
+            return 0;
+    }
+
+    if (!OSSL_FIPS_IND_GET_CTX_PARAM(ctx, p.ind))
         return 0;

     return 1;
 }

-static const OSSL_PARAM *x963kdf_gettable_ctx_params(ossl_unused void *ctx,
-    ossl_unused void *provctx)
+static const OSSL_PARAM *x963kdf_gettable_ctx_params(ossl_unused void *ctx, ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        SSKDF_COMMON_GETTABLES,
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return x963kdf_get_ctx_params_list;
 }

+#endif /* OPENSSL_NO_X963KDF */
+
+#ifndef OPENSSL_NO_SSKDF
 const OSSL_DISPATCH ossl_kdf_sskdf_functions[] = {
     { OSSL_FUNC_KDF_NEWCTX, (void (*)(void))sskdf_new },
     { OSSL_FUNC_KDF_DUPCTX, (void (*)(void))sskdf_dup },
@@ -769,9 +788,11 @@ const OSSL_DISPATCH ossl_kdf_sskdf_functions[] = {
     { OSSL_FUNC_KDF_GET_CTX_PARAMS, (void (*)(void))sskdf_get_ctx_params },
     OSSL_DISPATCH_END
 };
+#endif

+#ifndef OPENSSL_NO_X963KDF
 const OSSL_DISPATCH ossl_kdf_x963_kdf_functions[] = {
-    { OSSL_FUNC_KDF_NEWCTX, (void (*)(void))sskdf_new },
+    { OSSL_FUNC_KDF_NEWCTX, (void (*)(void))x963_new },
     { OSSL_FUNC_KDF_DUPCTX, (void (*)(void))sskdf_dup },
     { OSSL_FUNC_KDF_FREECTX, (void (*)(void))sskdf_free },
     { OSSL_FUNC_KDF_RESET, (void (*)(void))sskdf_reset },
@@ -784,3 +805,4 @@ const OSSL_DISPATCH ossl_kdf_x963_kdf_functions[] = {
     { OSSL_FUNC_KDF_GET_CTX_PARAMS, (void (*)(void))x963kdf_get_ctx_params },
     OSSL_DISPATCH_END
 };
+#endif
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/sskdf.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/sskdf.inc.in
new file mode 100644
index 00000000000..fdf451acc05
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/sskdf.inc.in
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('sskdf_set_ctx_params',
+                         (['OSSL_KDF_PARAM_SECRET',         'secret', 'octet_string'],
+                          ['OSSL_KDF_PARAM_KEY',            'secret', 'octet_string'],
+                          ['OSSL_KDF_PARAM_INFO',           'info',   'octet_string', SSKDF_MAX_INFOS],
+                          ['OSSL_KDF_PARAM_PROPERTIES',     'propq',  'utf8_string'],
+                          ['OSSL_KDF_PARAM_DIGEST',         'digest', 'utf8_string'],
+                          ['OSSL_KDF_PARAM_MAC',            'mac',    'utf8_string'],
+                          ['OSSL_KDF_PARAM_SALT',           'salt',   'octet_string'],
+                          ['OSSL_KDF_PARAM_MAC_SIZE',       'size',   'size_t'],
+                          ['OSSL_KDF_PARAM_FIPS_KEY_CHECK', 'ind_k',  'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('sskdf_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',                    'size',   'size_t'],
+                          ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind',    'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/tls1_prf.c b/deps/openssl/openssl/providers/implementations/kdfs/tls1_prf.c
index 2716f716c98..07fcdd058ed 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/tls1_prf.c
+++ b/deps/openssl/openssl/providers/implementations/kdfs/tls1_prf.c
@@ -69,6 +69,8 @@
 #include "prov/provider_util.h"
 #include "prov/securitycheck.h"
 #include "internal/e_os.h"
+#include "internal/fips.h"
+#include "internal/params.h"
 #include "internal/safe_math.h"

 OSSL_SAFE_MATH_UNSIGNED(size_t, size_t)
@@ -91,6 +93,10 @@ static int tls1_prf_alg(EVP_MAC_CTX *mdctx, EVP_MAC_CTX *sha1ctx,
 #define TLS_MD_MASTER_SECRET_CONST "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74"
 #define TLS_MD_MASTER_SECRET_CONST_SIZE 13

+#define TLSPRF_MAX_SEEDS 6
+
+#include "providers/implementations/kdfs/tls1_prf.inc"
+
 /* TLS KDF kdf context structure */
 typedef struct {
     void *provctx;
@@ -117,6 +123,12 @@ static void *kdf_tls1_prf_new(void *provctx)
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_KDF_TLS12_PRF))
+        return NULL;
+#endif
+
     if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) != NULL) {
         ctx->provctx = provctx;
         OSSL_FIPS_IND_INIT(ctx)
@@ -195,7 +207,7 @@ static int fips_ems_check_passed(TLS1_PRF *ctx)
     if (!ems_approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE0,
                 libctx, "TLS_PRF", "EMS",
-                ossl_fips_config_tls1_prf_ems_check)) {
+                FIPS_CONFIG_TLS1_PRF_EMS_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_EMS_NOT_ENABLED);
             return 0;
         }
@@ -220,7 +232,7 @@ static int fips_digest_check_passed(TLS1_PRF *ctx, const EVP_MD *md)
     if (digest_unapproved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE1,
                 libctx, "TLS_PRF", "Digest",
-                ossl_fips_config_tls1_prf_digest_check)) {
+                FIPS_CONFIG_TLS1_PRF_DIGEST_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED);
             return 0;
         }
@@ -236,7 +248,7 @@ static int fips_key_check_passed(TLS1_PRF *ctx)
     if (!key_approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE2,
                 libctx, "TLS_PRF", "Key size",
-                ossl_fips_config_tls1_prf_key_check)) {
+                FIPS_CONFIG_TLS1_PRF_KEY_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
             return 0;
         }
@@ -283,46 +295,52 @@ static int kdf_tls1_prf_derive(void *vctx, unsigned char *key, size_t keylen,

 static int kdf_tls1_prf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p;
+    struct tls1prf_set_ctx_params_st p;
     TLS1_PRF *ctx = vctx;
-    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
+    OSSL_LIB_CTX *libctx;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !tls1prf_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    libctx = PROV_LIBCTX_OF(ctx->provctx);

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_KDF_PARAM_FIPS_EMS_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, p.ind_e))
         return 0;
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE1, params,
-            OSSL_KDF_PARAM_FIPS_DIGEST_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE1, p.ind_d))
         return 0;
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE2, params,
-            OSSL_KDF_PARAM_FIPS_KEY_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE2, p.ind_k))
         return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_DIGEST)) != NULL) {
+    if (p.digest != NULL) {
         PROV_DIGEST digest;
         const EVP_MD *md = NULL;
+        const char *dgst;
+
+        if (!OSSL_PARAM_get_utf8_string_ptr(p.digest, &dgst))
+            return 0;

-        if (OPENSSL_strcasecmp(p->data, SN_md5_sha1) == 0) {
-            if (!ossl_prov_macctx_load_from_params(&ctx->P_hash, params,
-                    OSSL_MAC_NAME_HMAC,
-                    NULL, SN_md5, libctx)
-                || !ossl_prov_macctx_load_from_params(&ctx->P_sha1, params,
-                    OSSL_MAC_NAME_HMAC,
-                    NULL, SN_sha1, libctx))
+        if (OPENSSL_strcasecmp(dgst, OSSL_DIGEST_NAME_MD5_SHA1) == 0) {
+            if (!ossl_prov_macctx_load(&ctx->P_hash, NULL, NULL, NULL,
+                    p.propq,
+                    OSSL_MAC_NAME_HMAC, NULL,
+                    OSSL_DIGEST_NAME_MD5, libctx))
+                return 0;
+            if (!ossl_prov_macctx_load(&ctx->P_sha1, NULL, NULL, NULL,
+                    p.propq,
+                    OSSL_MAC_NAME_HMAC, NULL,
+                    OSSL_DIGEST_NAME_SHA1, libctx))
                 return 0;
         } else {
             EVP_MAC_CTX_free(ctx->P_sha1);
             ctx->P_sha1 = NULL;
-            if (!ossl_prov_macctx_load_from_params(&ctx->P_hash, params,
-                    OSSL_MAC_NAME_HMAC,
-                    NULL, NULL, libctx))
+            if (!ossl_prov_macctx_load(&ctx->P_hash, NULL, NULL, p.digest,
+                    p.propq,
+                    OSSL_MAC_NAME_HMAC, NULL, NULL, libctx))
                 return 0;
         }

         memset(&digest, 0, sizeof(digest));
-        if (!ossl_prov_digest_load_from_params(&digest, params, libctx))
+        if (!ossl_prov_digest_load(&digest, p.digest, p.propq, libctx))
             return 0;

         md = ossl_prov_digest_md(&digest);
@@ -342,10 +360,11 @@ static int kdf_tls1_prf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
         ossl_prov_digest_reset(&digest);
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SECRET)) != NULL) {
+    if (p.secret != NULL) {
         OPENSSL_clear_free(ctx->sec, ctx->seclen);
         ctx->sec = NULL;
-        if (!OSSL_PARAM_get_octet_string(p, (void **)&ctx->sec, 0, &ctx->seclen))
+        if (!OSSL_PARAM_get_octet_string(p.secret, (void **)&ctx->sec, 0,
+                &ctx->seclen))
             return 0;

 #ifdef FIPS_MODULE
@@ -353,63 +372,71 @@ static int kdf_tls1_prf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
             return 0;
 #endif
     }
-    /* The seed fields concatenate, so process them all */
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SEED)) != NULL) {
-        for (; p != NULL; p = OSSL_PARAM_locate_const(p + 1,
-                              OSSL_KDF_PARAM_SEED)) {
-            if (p->data_size != 0 && p->data != NULL) {
-                const void *val = NULL;
-                size_t sz = 0;
-                unsigned char *seed;
-                size_t seedlen;
+
+    /*
+     * The seed fields concatenate across set calls, so process them all
+     * but only reallocate once.
+     */
+    if (p.num_seed > 0) {
+        const void *vals[TLSPRF_MAX_SEEDS];
+        size_t sizes[TLSPRF_MAX_SEEDS];
+        size_t seedlen = ctx->seedlen;
+        int i, n = 0;
+
+        for (i = 0; i < p.num_seed; i++) {
+            sizes[i] = 0;
+            vals[i] = NULL;
+            if (p.seed[i]->data_size != 0 && p.seed[i]->data != NULL) {
                 int err = 0;

-                if (!OSSL_PARAM_get_octet_string_ptr(p, &val, &sz))
+                if (!OSSL_PARAM_get_octet_string_ptr(p.seed[i],
+                        vals + n, sizes + n))
                     return 0;

-                seedlen = safe_add_size_t(ctx->seedlen, sz, &err);
+                seedlen = safe_add_size_t(seedlen, sizes[n], &err);
                 if (err)
                     return 0;
+                n++;
+            }
+        }

-                seed = OPENSSL_clear_realloc(ctx->seed, ctx->seedlen, seedlen);
-                if (!seed)
-                    return 0;
+        if (seedlen != ctx->seedlen) {
+            unsigned char *seed = OPENSSL_clear_realloc(ctx->seed,
+                ctx->seedlen, seedlen);

-                ctx->seed = seed;
-                if (ossl_assert(sz != 0))
-                    memcpy(ctx->seed + ctx->seedlen, val, sz);
-                ctx->seedlen = seedlen;
+            if (seed == NULL)
+                return 0;
+            ctx->seed = seed;
+
+            /* No errors are possible, so copy them across */
+            for (i = 0; i < n; i++) {
+                memcpy(ctx->seed + ctx->seedlen, vals[i], sizes[i]);
+                ctx->seedlen += sizes[i];
             }
         }
     }
+
     return 1;
 }

 static const OSSL_PARAM *kdf_tls1_prf_settable_ctx_params(
     ossl_unused void *ctx, ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_DIGEST, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SECRET, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SEED, NULL, 0),
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_KDF_PARAM_FIPS_EMS_CHECK)
-            OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_KDF_PARAM_FIPS_DIGEST_CHECK)
-                OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_KDF_PARAM_FIPS_KEY_CHECK)
-                    OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return tls1prf_set_ctx_params_list;
 }

 static int kdf_tls1_prf_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    struct tls1prf_get_ctx_params_st p;
+    TLS1_PRF *ctx = (TLS1_PRF *)vctx;

-    if ((p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_SIZE)) != NULL) {
-        if (!OSSL_PARAM_set_size_t(p, SIZE_MAX))
-            return 0;
-    }
-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(((TLS1_PRF *)vctx), params))
+    if (ctx == NULL || !tls1prf_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, SIZE_MAX))
+        return 0;
+
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(ctx, p.ind))
         return 0;
     return 1;
 }
@@ -417,12 +444,7 @@ static int kdf_tls1_prf_get_ctx_params(void *vctx, OSSL_PARAM params[])
 static const OSSL_PARAM *kdf_tls1_prf_gettable_ctx_params(
     ossl_unused void *ctx, ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL),
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return tls1prf_get_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_kdf_tls1_prf_functions[] = {
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/tls1_prf.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/tls1_prf.inc.in
new file mode 100644
index 00000000000..03583fcd050
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/tls1_prf.inc.in
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('tls1prf_set_ctx_params',
+                         (['OSSL_KDF_PARAM_PROPERTIES',        'propq',  'utf8_string'],
+                          ['OSSL_KDF_PARAM_DIGEST',            'digest', 'utf8_string'],
+                          ['OSSL_KDF_PARAM_SECRET',            'secret', 'octet_string'],
+                          ['OSSL_KDF_PARAM_SEED',              'seed',   'octet_string', TLSPRF_MAX_SEEDS],
+                          ['OSSL_KDF_PARAM_FIPS_EMS_CHECK',    'ind_e',  'int', 'fips'],
+                          ['OSSL_KDF_PARAM_FIPS_DIGEST_CHECK', 'ind_d',  'int', 'fips'],
+                          ['OSSL_KDF_PARAM_FIPS_KEY_CHECK',    'ind_k',  'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('tls1prf_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',                    'size', 'size_t'],
+                          ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind',  'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/x942kdf.c b/deps/openssl/openssl/providers/implementations/kdfs/x942kdf.c
index e6bdbbcb165..10466c132da 100644
--- a/deps/openssl/openssl/providers/implementations/kdfs/x942kdf.c
+++ b/deps/openssl/openssl/providers/implementations/kdfs/x942kdf.c
@@ -15,8 +15,10 @@
 #include <openssl/evp.h>
 #include <openssl/params.h>
 #include <openssl/proverr.h>
+#include "internal/common.h"
 #include "internal/packet.h"
 #include "internal/der.h"
+#include "internal/fips.h"
 #include "internal/nelem.h"
 #include "prov/provider_ctx.h"
 #include "prov/providercommon.h"
@@ -24,6 +26,7 @@
 #include "prov/provider_util.h"
 #include "prov/securitycheck.h"
 #include "prov/der_wrap.h"
+#include "providers/implementations/kdfs/x942kdf.inc"

 #define X942KDF_MAX_INLEN (1 << 30)

@@ -216,7 +219,7 @@ x942_encode_otherinfo(size_t keylen,
     /* keylenbits must fit into 4 bytes */
     if (keylen > 0xFFFFFF)
         return 0;
-    keylen_bits = 8 * keylen;
+    keylen_bits = (uint32_t)(8 * keylen);

     /* Calculate the size of the buffer */
     if (!der_encode_sharedinfo(&pkt, NULL, 0, cek_oid, cek_oid_len,
@@ -339,6 +342,12 @@ static void *x942kdf_new(void *provctx)
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_KDF_X942KDF))
+        return NULL;
+#endif
+
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx == NULL)
         return NULL;
@@ -445,7 +454,7 @@ static int fips_x942kdf_key_check_passed(KDF_X942 *ctx)
     if (!key_approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE0,
                 libctx, "X942KDF", "Key size",
-                ossl_fips_config_x942kdf_key_check)) {
+                FIPS_CONFIG_X942KDF_KEY_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
             return 0;
         }
@@ -528,22 +537,23 @@ static int x942kdf_derive(void *vctx, unsigned char *key, size_t keylen,

 static int x942kdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p, *pq;
+    struct sshkdf_set_ctx_params_st p;
     KDF_X942 *ctx = vctx;
-    OSSL_LIB_CTX *provctx = PROV_LIBCTX_OF(ctx->provctx);
-    const char *propq = NULL;
+    OSSL_LIB_CTX *provctx;
+    const char *cekalg, *propq = NULL;
     const EVP_MD *md;
     size_t id;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !sshkdf_set_ctx_params_decoder(params, &p))
+        return 0;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_KDF_PARAM_FIPS_KEY_CHECK))
+    provctx = PROV_LIBCTX_OF(ctx->provctx);
+
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, p.ind_k))
         return 0;

-    if (OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST) != NULL) {
-        if (!ossl_prov_digest_load_from_params(&ctx->digest, params, provctx))
+    if (p.digest != NULL) {
+        if (!ossl_prov_digest_load(&ctx->digest, p.digest, p.propq, provctx))
             return 0;
         md = ossl_prov_digest_md(&ctx->digest);
         if (EVP_MD_xof(md)) {
@@ -552,11 +562,8 @@ static int x942kdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
         }
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_SECRET);
-    if (p == NULL)
-        p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_KEY);
-    if (p != NULL) {
-        if (!x942kdf_set_buffer(&ctx->secret, &ctx->secret_len, p))
+    if (p.secret != NULL) {
+        if (!x942kdf_set_buffer(&ctx->secret, &ctx->secret_len, p.secret))
             return 0;
 #ifdef FIPS_MODULE
         if (!fips_x942kdf_key_check_passed(ctx))
@@ -564,51 +571,37 @@ static int x942kdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 #endif
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_X942_ACVPINFO);
-    if (p != NULL
-        && !x942kdf_set_buffer(&ctx->acvpinfo, &ctx->acvpinfo_len, p))
+    if (p.acvp != NULL
+        && !x942kdf_set_buffer(&ctx->acvpinfo, &ctx->acvpinfo_len, p.acvp))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_X942_PARTYUINFO);
-    if (p == NULL)
-        p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_UKM);
-    if (p != NULL
-        && !x942kdf_set_buffer(&ctx->partyuinfo, &ctx->partyuinfo_len, p))
+    if (p.uinfo != NULL
+        && !x942kdf_set_buffer(&ctx->partyuinfo, &ctx->partyuinfo_len, p.uinfo))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_X942_PARTYVINFO);
-    if (p != NULL
-        && !x942kdf_set_buffer(&ctx->partyvinfo, &ctx->partyvinfo_len, p))
+    if (p.vinfo != NULL
+        && !x942kdf_set_buffer(&ctx->partyvinfo, &ctx->partyvinfo_len, p.vinfo))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_X942_USE_KEYBITS);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &ctx->use_keybits))
+    if (p.kbits != NULL && !OSSL_PARAM_get_int(p.kbits, &ctx->use_keybits))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_X942_SUPP_PUBINFO);
-    if (p != NULL) {
-        if (!x942kdf_set_buffer(&ctx->supp_pubinfo, &ctx->supp_pubinfo_len, p))
+    if (p.pub != NULL) {
+        if (!x942kdf_set_buffer(&ctx->supp_pubinfo, &ctx->supp_pubinfo_len, p.pub))
             return 0;
         ctx->use_keybits = 0;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_X942_SUPP_PRIVINFO);
-    if (p != NULL
-        && !x942kdf_set_buffer(&ctx->supp_privinfo, &ctx->supp_privinfo_len, p))
+    if (p.priv != NULL
+        && !x942kdf_set_buffer(&ctx->supp_privinfo, &ctx->supp_privinfo_len, p.priv))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_CEK_ALG);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
+    if (p.cekalg != NULL) {
+        if (!OSSL_PARAM_get_utf8_string_ptr(p.cekalg, &cekalg))
             return 0;
-        pq = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_PROPERTIES);
-        /*
-         * We already grab the properties during ossl_prov_digest_load_from_params()
-         * so there is no need to check the validity again..
-         */
-        if (pq != NULL)
-            propq = p->data;
-        if (find_alg_id(provctx, p->data, propq, &id) == 0)
+        if (p.propq != NULL && !OSSL_PARAM_get_utf8_string_ptr(p.propq, &propq))
+            return 0;
+        if (find_alg_id(provctx, cekalg, propq, &id) == 0)
             return 0;
         ctx->cek_oid = kek_algs[id].oid;
         ctx->cek_oid_len = kek_algs[id].oid_len;
@@ -620,35 +613,21 @@ static int x942kdf_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *x942kdf_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_DIGEST, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_SECRET, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_KEY, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_UKM, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_X942_ACVPINFO, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_X942_PARTYUINFO, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_X942_PARTYVINFO, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_X942_SUPP_PUBINFO, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_KDF_PARAM_X942_SUPP_PRIVINFO, NULL, 0),
-        OSSL_PARAM_int(OSSL_KDF_PARAM_X942_USE_KEYBITS, NULL),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_CEK_ALG, NULL, 0),
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_KDF_PARAM_FIPS_KEY_CHECK)
-            OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return sshkdf_set_ctx_params_list;
 }

 static int x942kdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     KDF_X942 *ctx = (KDF_X942 *)vctx;
-    OSSL_PARAM *p;
+    struct sshkdf_get_ctx_params_st p;
+
+    if (ctx == NULL || !sshkdf_get_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_SIZE);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, x942kdf_size(ctx)))
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, x942kdf_size(ctx)))
         return 0;

-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(ctx, params))
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(ctx, p.ind))
         return 0;
     return 1;
 }
@@ -656,12 +635,7 @@ static int x942kdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
 static const OSSL_PARAM *x942kdf_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL),
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return sshkdf_get_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_kdf_x942_kdf_functions[] = {
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/x942kdf.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/x942kdf.inc.in
new file mode 100644
index 00000000000..57c4a549c53
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/x942kdf.inc.in
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('sshkdf_set_ctx_params',
+                         (['OSSL_KDF_PARAM_PROPERTIES',          'propq',    'utf8_string'],
+                          ['OSSL_KDF_PARAM_DIGEST',              'digest',   'utf8_string'],
+                          ['OSSL_KDF_PARAM_SECRET',              'secret',   'octet_string'],
+                          ['OSSL_KDF_PARAM_KEY',                 'secret',   'octet_string'],
+                          ['OSSL_KDF_PARAM_UKM',                 'uinfo',    'octet_string'],
+                          ['OSSL_KDF_PARAM_X942_ACVPINFO',       'acvp',     'octet_string'],
+                          ['OSSL_KDF_PARAM_X942_PARTYUINFO',     'uinfo',    'octet_string'],
+                          ['OSSL_KDF_PARAM_X942_PARTYVINFO',     'vinfo',    'octet_string'],
+                          ['OSSL_KDF_PARAM_X942_SUPP_PUBINFO',   'pub',      'octet_string'],
+                          ['OSSL_KDF_PARAM_X942_SUPP_PRIVINFO',  'priv',     'octet_string'],
+                          ['OSSL_KDF_PARAM_X942_USE_KEYBITS',    'kbits',    'int'],
+                          ['OSSL_KDF_PARAM_CEK_ALG',             'cekalg',   'utf8_string'],
+                          ['OSSL_KDF_PARAM_FIPS_KEY_CHECK',      'ind_k',    'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('sshkdf_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',                    'size', 'size_t'],
+                          ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind',  'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kdfs/x963kdf.inc.in b/deps/openssl/openssl/providers/implementations/kdfs/x963kdf.inc.in
new file mode 100644
index 00000000000..e50efb2bd8e
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kdfs/x963kdf.inc.in
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('x963kdf_get_ctx_params',
+                         (['OSSL_KDF_PARAM_SIZE',                    'size',   'size_t'],
+                          ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind',    'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('x963kdf_set_ctx_params',
+                         (['OSSL_KDF_PARAM_SECRET',            'secret', 'octet_string'],
+                          ['OSSL_KDF_PARAM_KEY',               'secret', 'octet_string'],
+                          ['OSSL_KDF_PARAM_INFO',              'info',   'octet_string', SSKDF_MAX_INFOS],
+                          ['OSSL_KDF_PARAM_PROPERTIES',        'propq',  'utf8_string'],
+                          ['OSSL_KDF_PARAM_DIGEST',            'digest', 'utf8_string'],
+                          ['OSSL_KDF_PARAM_FIPS_DIGEST_CHECK', 'ind_d',  'int', 'fips'],
+                          ['OSSL_KDF_PARAM_FIPS_KEY_CHECK',    'ind_k',  'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kem/ec_kem.c b/deps/openssl/openssl/providers/implementations/kem/ec_kem.c
index 3573474cc9a..167ae1893f9 100644
--- a/deps/openssl/openssl/providers/implementations/kem/ec_kem.c
+++ b/deps/openssl/openssl/providers/implementations/kem/ec_kem.c
@@ -25,6 +25,7 @@
 #include <openssl/proverr.h>
 #include <openssl/kdf.h>
 #include <openssl/rand.h>
+#include "internal/cryptlib.h"
 #include "prov/provider_ctx.h"
 #include "prov/implementations.h"
 #include "prov/securitycheck.h"
@@ -34,7 +35,8 @@
 #include "internal/hpke_util.h"
 #include "crypto/ec.h"
 #include "prov/ecx.h"
-#include "eckem.h"
+#include "prov/eckem.h"
+#include "providers/implementations/kem/ec_kem.inc"

 typedef struct {
     EC_KEY *recipient_key;
@@ -287,19 +289,18 @@ static int eckem_auth_decapsulate_init(void *vctx, void *vecx, void *vauthpub,
 static int eckem_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_EC_CTX *ctx = (PROV_EC_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct eckem_set_ctx_params_st p;
     int mode;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !eckem_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_KEM_PARAM_IKME);
-    if (p != NULL) {
+    if (p.ikme != NULL) {
         void *tmp = NULL;
         size_t tmplen = 0;

-        if (p->data != NULL && p->data_size != 0) {
-            if (!OSSL_PARAM_get_octet_string(p, &tmp, 0, &tmplen))
+        if (p.ikme->data != NULL && p.ikme->data_size != 0) {
+            if (!OSSL_PARAM_get_octet_string(p.ikme, &tmp, 0, &tmplen))
                 return 0;
         }
         OPENSSL_clear_free(ctx->ikm, ctx->ikmlen);
@@ -308,11 +309,10 @@ static int eckem_set_ctx_params(void *vctx, const OSSL_PARAM params[])
         ctx->ikmlen = tmplen;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_KEM_PARAM_OPERATION);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
+    if (p.op != NULL) {
+        if (p.op->data_type != OSSL_PARAM_UTF8_STRING)
             return 0;
-        mode = ossl_eckem_modename2id(p->data);
+        mode = ossl_eckem_modename2id(p.op->data);
         if (mode == KEM_MODE_UNDEFINED)
             return 0;
         ctx->mode = mode;
@@ -320,16 +320,10 @@ static int eckem_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     return 1;
 }

-static const OSSL_PARAM known_settable_eckem_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_KEM_PARAM_OPERATION, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_KEM_PARAM_IKME, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *eckem_settable_ctx_params(ossl_unused void *vctx,
     ossl_unused void *provctx)
 {
-    return known_settable_eckem_ctx_params;
+    return eckem_set_ctx_params_list;
 }

 /*
@@ -430,7 +424,7 @@ int ossl_ec_dhkem_derive_private(EC_KEY *ec, BIGNUM *priv,
                 &counter, 1))
             goto err;
         privbuf[0] &= info->bitmask;
-        if (BN_bin2bn(privbuf, info->Nsk, priv) == NULL)
+        if (BN_bin2bn(privbuf, (int)info->Nsk, priv) == NULL)
             goto err;
         if (counter == 0xFF) {
             ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GENERATE_KEY);
@@ -577,7 +571,8 @@ static int derive_secret(PROV_EC_CTX *ctx, unsigned char *secret,
     size_t encodedprivlen = info->Nsk;
     int auth = ctx->sender_authkey != NULL;

-    if (!generate_ecdhkm(privkey1, peerkey1, dhkm, sizeof(dhkm), encodedprivlen))
+    if (!generate_ecdhkm(privkey1, peerkey1, dhkm, sizeof(dhkm),
+            (unsigned int)encodedprivlen))
         goto err;
     dhkmlen = encodedprivlen;
     kemctxlen = 2 * encodedpublen;
@@ -595,7 +590,7 @@ static int derive_secret(PROV_EC_CTX *ctx, unsigned char *secret,
         }
         if (!generate_ecdhkm(privkey2, peerkey2,
                 dhkm + dhkmlen, sizeof(dhkm) - dhkmlen,
-                encodedprivlen))
+                (unsigned int)encodedprivlen))
             goto err;
         dhkmlen += encodedprivlen;
         kemctxlen += encodedpublen;
diff --git a/deps/openssl/openssl/providers/implementations/kem/ec_kem.inc.in b/deps/openssl/openssl/providers/implementations/kem/ec_kem.inc.in
new file mode 100644
index 00000000000..ae6cd7a63f6
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kem/ec_kem.inc.in
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('eckem_set_ctx_params',
+                         (['OSSL_KEM_PARAM_OPERATION',   'op',   'utf8_string'],
+                          ['OSSL_KEM_PARAM_IKME',        'ikme', 'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kem/ecx_kem.c b/deps/openssl/openssl/providers/implementations/kem/ecx_kem.c
index cb134a2ab99..e058426f2a9 100644
--- a/deps/openssl/openssl/providers/implementations/kem/ecx_kem.c
+++ b/deps/openssl/openssl/providers/implementations/kem/ecx_kem.c
@@ -26,6 +26,7 @@
 #include <openssl/sha.h>
 #include <openssl/rand.h>
 #include <openssl/proverr.h>
+#include "internal/cryptlib.h"
 #include "prov/provider_ctx.h"
 #include "prov/implementations.h"
 #include "prov/securitycheck.h"
@@ -34,7 +35,8 @@
 #include "crypto/ecx.h"
 #include <openssl/hpke.h>
 #include "internal/hpke_util.h"
-#include "eckem.h"
+#include "prov/eckem.h"
+#include "providers/implementations/kem/ecx_kem.inc"

 #define MAX_ECX_KEYLEN X448_KEYLEN

@@ -130,16 +132,15 @@ static ECX_KEY *ecxkey_pubfromdata(PROV_ECX_CTX *ctx,
     const unsigned char *pubbuf, size_t pubbuflen)
 {
     ECX_KEY *ecx = NULL;
-    OSSL_PARAM params[2], *p = params;
+    OSSL_PARAM pub;

-    *p++ = OSSL_PARAM_construct_octet_string(OSSL_PKEY_PARAM_PUB_KEY,
+    pub = OSSL_PARAM_construct_octet_string(OSSL_PKEY_PARAM_PUB_KEY,
         (char *)pubbuf, pubbuflen);
-    *p = OSSL_PARAM_construct_end();

     ecx = ossl_ecx_key_new(ctx->libctx, ctx->recipient_key->type, 1, ctx->propq);
     if (ecx == NULL)
         return NULL;
-    if (ossl_ecx_key_fromdata(ecx, params, 0) <= 0) {
+    if (ossl_ecx_key_fromdata(ecx, &pub, NULL, 0) <= 0) {
         ossl_ecx_key_free(ecx);
         ecx = NULL;
     }
@@ -244,32 +245,29 @@ static int ecxkem_auth_decapsulate_init(void *vctx, void *vecx, void *vauthpub,
 static int ecxkem_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_ECX_CTX *ctx = (PROV_ECX_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct ecxkem_set_ctx_params_st p;
     int mode;

-    if (ctx == NULL)
+    if (ctx == NULL || !ecxkem_set_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    p = OSSL_PARAM_locate_const(params, OSSL_KEM_PARAM_IKME);
-    if (p != NULL) {
+    if (p.ikme != NULL) {
         void *tmp = NULL;
         size_t tmplen = 0;

-        if (p->data != NULL && p->data_size != 0) {
-            if (!OSSL_PARAM_get_octet_string(p, &tmp, 0, &tmplen))
+        if (p.ikme->data != NULL && p.ikme->data_size != 0) {
+            if (!OSSL_PARAM_get_octet_string(p.ikme, &tmp, 0, &tmplen))
                 return 0;
         }
         OPENSSL_clear_free(ctx->ikm, ctx->ikmlen);
         ctx->ikm = tmp;
         ctx->ikmlen = tmplen;
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_KEM_PARAM_OPERATION);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
+
+    if (p.op != NULL) {
+        if (p.op->data_type != OSSL_PARAM_UTF8_STRING)
             return 0;
-        mode = ossl_eckem_modename2id(p->data);
+        mode = ossl_eckem_modename2id(p.op->data);
         if (mode == KEM_MODE_UNDEFINED)
             return 0;
         ctx->mode = mode;
@@ -277,16 +275,10 @@ static int ecxkem_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     return 1;
 }

-static const OSSL_PARAM known_settable_ecxkem_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_KEM_PARAM_OPERATION, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_KEM_PARAM_IKME, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *ecxkem_settable_ctx_params(ossl_unused void *vctx,
     ossl_unused void *provctx)
 {
-    return known_settable_ecxkem_ctx_params;
+    return ecxkem_set_ctx_params_list;
 }

 /*
@@ -485,7 +477,8 @@ static int derive_secret(PROV_ECX_CTX *ctx, unsigned char *secret,
     int auth = ctx->sender_authkey != NULL;
     size_t encodedkeylen = info->Npk;

-    if (!generate_ecxdhkm(privkey1, peerkey1, dhkm, sizeof(dhkm), encodedkeylen))
+    if (!generate_ecxdhkm(privkey1, peerkey1, dhkm, sizeof(dhkm),
+            (unsigned int)encodedkeylen))
         goto err;
     dhkmlen = encodedkeylen;

@@ -493,7 +486,7 @@ static int derive_secret(PROV_ECX_CTX *ctx, unsigned char *secret,
     if (auth) {
         if (!generate_ecxdhkm(privkey2, peerkey2,
                 dhkm + dhkmlen, sizeof(dhkm) - dhkmlen,
-                encodedkeylen))
+                (unsigned int)encodedkeylen))
             goto err;
         /* Get the public key of the auth sender in encoded form */
         sender_authpub = ecx_pubkey(ctx->sender_authkey);
diff --git a/deps/openssl/openssl/providers/implementations/kem/ecx_kem.inc.in b/deps/openssl/openssl/providers/implementations/kem/ecx_kem.inc.in
new file mode 100644
index 00000000000..5cd2dda5044
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kem/ecx_kem.inc.in
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ecxkem_set_ctx_params',
+                         (['OSSL_KEM_PARAM_OPERATION',   'op',   'utf8_string'],
+                          ['OSSL_KEM_PARAM_IKME',        'ikme', 'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kem/kem_util.c b/deps/openssl/openssl/providers/implementations/kem/kem_util.c
index 1fd52e1c2d5..0e2dd26dbad 100644
--- a/deps/openssl/openssl/providers/implementations/kem/kem_util.c
+++ b/deps/openssl/openssl/providers/implementations/kem/kem_util.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -10,7 +10,7 @@
 #include <string.h> /* for memcpy() */
 #include <openssl/core_names.h>
 #include <openssl/crypto.h>
-#include "eckem.h"
+#include "prov/eckem.h"

 typedef struct {
     unsigned int id;
diff --git a/deps/openssl/openssl/providers/implementations/kem/ml_kem_kem.c b/deps/openssl/openssl/providers/implementations/kem/ml_kem_kem.c
index 5cc3fcacf02..2d38e8c805d 100644
--- a/deps/openssl/openssl/providers/implementations/kem/ml_kem_kem.c
+++ b/deps/openssl/openssl/providers/implementations/kem/ml_kem_kem.c
@@ -16,10 +16,13 @@
 #include <openssl/err.h>
 #include <openssl/proverr.h>
 #include "crypto/ml_kem.h"
+#include "internal/cryptlib.h"
+#include "internal/fips.h"
 #include "prov/provider_ctx.h"
 #include "prov/implementations.h"
 #include "prov/securitycheck.h"
 #include "prov/providercommon.h"
+#include "providers/implementations/kem/ml_kem_kem.inc"

 static OSSL_FUNC_kem_newctx_fn ml_kem_newctx;
 static OSSL_FUNC_kem_freectx_fn ml_kem_freectx;
@@ -29,6 +32,10 @@ static OSSL_FUNC_kem_decapsulate_init_fn ml_kem_decapsulate_init;
 static OSSL_FUNC_kem_decapsulate_fn ml_kem_decapsulate;
 static OSSL_FUNC_kem_set_ctx_params_fn ml_kem_set_ctx_params;
 static OSSL_FUNC_kem_settable_ctx_params_fn ml_kem_settable_ctx_params;
+#ifdef FIPS_MODULE
+static OSSL_FUNC_kem_get_ctx_params_fn ml_kem_get_ctx_params;
+static OSSL_FUNC_kem_gettable_ctx_params_fn ml_kem_gettable_ctx_params;
+#endif

 typedef struct {
     ML_KEM_KEY *key;
@@ -45,6 +52,12 @@ static void *ml_kem_newctx(void *provctx)
     if ((ctx = OPENSSL_malloc(sizeof(*ctx))) == NULL)
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_KEM_ML_KEM))
+        return NULL;
+#endif
+
     ctx->key = NULL;
     ctx->entropy = NULL;
     ctx->op = 0;
@@ -61,6 +74,27 @@ static void ml_kem_freectx(void *vctx)
     OPENSSL_free(ctx);
 }

+#ifdef FIPS_MODULE
+static const OSSL_PARAM *ml_kem_gettable_ctx_params(ossl_unused void *vctx,
+    ossl_unused void *provctx)
+{
+    return ml_kem_get_ctx_params_list;
+}
+
+static int ml_kem_get_ctx_params(void *vctx, OSSL_PARAM params[])
+{
+    PROV_ML_KEM_CTX *ctx = vctx;
+    struct ml_kem_get_ctx_params_st p;
+
+    if (ctx == NULL || !ml_kem_get_ctx_params_decoder(params, &p))
+        return 0;
+    if (!OSSL_FIPS_IND_GET_PARAM_CONDITIONAL(p.ind,
+            !ctx->test_entropy_used))
+        return 0;
+    return 1;
+}
+#endif
+
 static int ml_kem_init(void *vctx, int op, void *key,
     const OSSL_PARAM params[])
 {
@@ -71,21 +105,13 @@ static int ml_kem_init(void *vctx, int op, void *key,
     ctx->key = key;
     ctx->op = op;
     ctx->test_entropy_used = 0;
+    if (ctx->entropy != NULL) {
+        OPENSSL_cleanse(ctx->entropy, ML_KEM_RANDOM_BYTES);
+        ctx->entropy = NULL;
+    }
     return ml_kem_set_ctx_params(vctx, params);
 }

-#ifdef FIPS_MODULE
-static int ml_kem_get_ctx_params(void *vctx, OSSL_PARAM params[])
-{
-    PROV_ML_KEM_CTX *ctx = vctx;
-
-    if (ctx == NULL)
-        return 0;
-    return ossl_FIPS_IND_get_ctx_param_conditional(NULL, params,
-        !ctx->test_entropy_used);
-}
-#endif
-
 static int ml_kem_encapsulate_init(void *vctx, void *vkey,
     const OSSL_PARAM params[])
 {
@@ -113,27 +139,17 @@ static int ml_kem_decapsulate_init(void *vctx, void *vkey,
 static int ml_kem_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_ML_KEM_CTX *ctx = vctx;
-    const OSSL_PARAM *p;
+    struct ml_kem_set_ctx_params_st p;

-    if (ctx == NULL)
+    if (ctx == NULL || !ml_kem_set_ctx_params_decoder(params, &p))
         return 0;

-    if (ctx->op == EVP_PKEY_OP_DECAPSULATE && ctx->entropy != NULL) {
-        /* Decapsulation is deterministic */
-        OPENSSL_cleanse(ctx->entropy, ML_KEM_RANDOM_BYTES);
-        ctx->entropy = NULL;
-    }
-
-    if (ossl_param_is_empty(params))
-        return 1;
-
     /* Encapsulation ephemeral input key material "ikmE" */
-    if (ctx->op == EVP_PKEY_OP_ENCAPSULATE
-        && (p = OSSL_PARAM_locate_const(params, OSSL_KEM_PARAM_IKME)) != NULL) {
+    if (ctx->op == EVP_PKEY_OP_ENCAPSULATE && p.ikme != NULL) {
         size_t len = ML_KEM_RANDOM_BYTES;

         ctx->entropy = ctx->entropy_buf;
-        if (OSSL_PARAM_get_octet_string(p, (void **)&ctx->entropy,
+        if (OSSL_PARAM_get_octet_string(p.ikme, (void **)&ctx->entropy,
                 len, &len)
             && len == ML_KEM_RANDOM_BYTES) {
             ctx->test_entropy_used = 1;
@@ -153,12 +169,7 @@ static int ml_kem_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *ml_kem_settable_ctx_params(ossl_unused void *vctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM params[] = {
-        OSSL_PARAM_octet_string(OSSL_KEM_PARAM_IKME, NULL, 0),
-        OSSL_PARAM_END
-    };
-
-    return params;
+    return ml_kem_set_ctx_params_list;
 }

 static int ml_kem_encapsulate(void *vctx, unsigned char *ctext, size_t *clen,
@@ -283,10 +294,8 @@ const OSSL_DISPATCH ossl_ml_kem_asym_kem_functions[] = {
     { OSSL_FUNC_KEM_SET_CTX_PARAMS, (OSSL_FUNC)ml_kem_set_ctx_params },
     { OSSL_FUNC_KEM_SETTABLE_CTX_PARAMS, (OSSL_FUNC)ml_kem_settable_ctx_params },
 #ifdef FIPS_MODULE
-    { OSSL_FUNC_KEM_GET_CTX_PARAMS,
-        (OSSL_FUNC)ml_kem_get_ctx_params },
-    { OSSL_FUNC_KEM_GETTABLE_CTX_PARAMS,
-        (OSSL_FUNC)ossl_FIPS_IND_gettable_ctx_params },
+    { OSSL_FUNC_KEM_GET_CTX_PARAMS, (OSSL_FUNC)ml_kem_get_ctx_params },
+    { OSSL_FUNC_KEM_GETTABLE_CTX_PARAMS, (OSSL_FUNC)ml_kem_gettable_ctx_params },
 #endif
     OSSL_DISPATCH_END
 };
diff --git a/deps/openssl/openssl/providers/implementations/kem/ml_kem_kem.inc.in b/deps/openssl/openssl/providers/implementations/kem/ml_kem_kem.inc.in
new file mode 100644
index 00000000000..3a9c2778e56
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kem/ml_kem_kem.inc.in
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ml_kem_set_ctx_params',
+                         (['OSSL_KEM_PARAM_IKME', 'ikme', 'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('ml_kem_get_ctx_params',
+                         (['OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kem/mlx_kem.c b/deps/openssl/openssl/providers/implementations/kem/mlx_kem.c
index fd4b400f172..61b061c46fe 100644
--- a/deps/openssl/openssl/providers/implementations/kem/mlx_kem.c
+++ b/deps/openssl/openssl/providers/implementations/kem/mlx_kem.c
@@ -17,10 +17,11 @@
 #include <openssl/proverr.h>
 #include <openssl/rand.h>
 #include "prov/implementations.h"
+#include "prov/names.h"
 #include "prov/mlx_kem.h"
 #include "prov/provider_ctx.h"
 #include "prov/providercommon.h"
-#include "fips/fipsindicator.h"
+#include "providers/implementations/kem/mlx_kem.inc"

 static OSSL_FUNC_kem_newctx_fn mlx_kem_newctx;
 static OSSL_FUNC_kem_freectx_fn mlx_kem_freectx;
@@ -30,6 +31,10 @@ static OSSL_FUNC_kem_decapsulate_init_fn mlx_kem_decapsulate_init;
 static OSSL_FUNC_kem_decapsulate_fn mlx_kem_decapsulate;
 static OSSL_FUNC_kem_set_ctx_params_fn mlx_kem_set_ctx_params;
 static OSSL_FUNC_kem_settable_ctx_params_fn mlx_kem_settable_ctx_params;
+#ifdef FIPS_MODULE
+static OSSL_FUNC_kem_get_ctx_params_fn mlx_kem_get_ctx_params;
+static OSSL_FUNC_kem_gettable_ctx_params_fn mlx_kem_gettable_ctx_params;
+#endif

 typedef struct {
     OSSL_LIB_CTX *libctx;
@@ -106,18 +111,26 @@ mlx_kem_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 }

 #ifdef FIPS_MODULE
+static const OSSL_PARAM *mlx_kem_gettable_ctx_params(ossl_unused void *vctx,
+    ossl_unused void *provctx)
+{
+    return mlx_kem_get_ctx_params_list;
+}
+
 static int mlx_kem_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_MLX_KEM_CTX *ctx = vctx;
-    OSSL_PARAM *p;
+    struct mlx_kem_get_ctx_params_st p;
     int approved;

-    if (ctx == NULL || ctx->key == NULL || ctx->key->xinfo == NULL)
+    if (ctx == NULL || !mlx_kem_get_ctx_params_decoder(params, &p))
         return 0;
-    p = OSSL_PARAM_locate(params, OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR);
-    if (p != NULL) {
+
+    if (p.ind != NULL) {
+        if (ctx->key == NULL || ctx->key->xinfo == NULL)
+            return 0;
         approved = strcmp(ctx->key->xinfo->algorithm_name, SN_X448) != 0;
-        if (!OSSL_PARAM_set_int(p, approved))
+        if (!OSSL_PARAM_set_int(p.ind, approved))
             return 0;
     }
     return 1;
@@ -370,7 +383,7 @@ const OSSL_DISPATCH ossl_mlx_kem_asym_kem_functions[] = {
 #ifdef FIPS_MODULE
     { OSSL_FUNC_KEM_GET_CTX_PARAMS, (OSSL_FUNC)mlx_kem_get_ctx_params },
     { OSSL_FUNC_KEM_GETTABLE_CTX_PARAMS,
-        (OSSL_FUNC)ossl_FIPS_IND_gettable_ctx_params },
+        (OSSL_FUNC)mlx_kem_gettable_ctx_params },
 #endif
     OSSL_DISPATCH_END
 };
diff --git a/deps/openssl/openssl/providers/implementations/kem/mlx_kem.inc.in b/deps/openssl/openssl/providers/implementations/kem/mlx_kem.inc.in
new file mode 100644
index 00000000000..b6da9cb8206
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kem/mlx_kem.inc.in
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('mlx_kem_get_ctx_params',
+                         (['OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR',
+                           'ind', 'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kem/rsa_kem.c b/deps/openssl/openssl/providers/implementations/kem/rsa_kem.c
index 47f0c80c944..675409ba33d 100644
--- a/deps/openssl/openssl/providers/implementations/kem/rsa_kem.c
+++ b/deps/openssl/openssl/providers/implementations/kem/rsa_kem.c
@@ -22,10 +22,13 @@
 #include <openssl/err.h>
 #include <openssl/proverr.h>
 #include "crypto/rsa.h"
+#include "internal/cryptlib.h"
+#include "internal/fips.h"
 #include "prov/provider_ctx.h"
 #include "prov/providercommon.h"
 #include "prov/implementations.h"
 #include "prov/securitycheck.h"
+#include "providers/implementations/kem/rsa_kem.inc"

 static OSSL_FUNC_kem_newctx_fn rsakem_newctx;
 static OSSL_FUNC_kem_encapsulate_init_fn rsakem_encapsulate_init;
@@ -88,6 +91,12 @@ static void *rsakem_newctx(void *provctx)
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_ASYM_CIPHER_RSA_ENC))
+        return NULL;
+#endif
+
     prsactx = OPENSSL_zalloc(sizeof(PROV_RSA_CTX));
     if (prsactx == NULL)
         return NULL;
@@ -188,45 +197,39 @@ static int rsakem_decapsulate_init(void *vprsactx, void *vrsa,
 static int rsakem_get_ctx_params(void *vprsactx, OSSL_PARAM *params)
 {
     PROV_RSA_CTX *ctx = (PROV_RSA_CTX *)vprsactx;
+    struct rsakem_get_ctx_params_st p;

-    if (ctx == NULL)
+    if (ctx == NULL || !rsakem_get_ctx_params_decoder(params, &p))
         return 0;

-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(ctx, params))
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(ctx, p.ind))
         return 0;
     return 1;
 }

-static const OSSL_PARAM known_gettable_rsakem_ctx_params[] = {
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *rsakem_gettable_ctx_params(ossl_unused void *vprsactx,
     ossl_unused void *provctx)
 {
-    return known_gettable_rsakem_ctx_params;
+    return rsakem_get_ctx_params_list;
 }

 static int rsakem_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
 {
     PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
-    const OSSL_PARAM *p;
+    struct rsakem_set_ctx_params_st p;
     int op;

-    if (prsactx == NULL)
+    if (prsactx == NULL || !rsakem_set_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_KEM_PARAM_FIPS_KEY_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE0,
+            p.ind_k))
         return 0;
-    p = OSSL_PARAM_locate_const(params, OSSL_KEM_PARAM_OPERATION);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
+
+    if (p.op != NULL) {
+        if (p.op->data_type != OSSL_PARAM_UTF8_STRING)
             return 0;
-        op = rsakem_opname2id(p->data);
+        op = rsakem_opname2id(p.op->data);
         if (op < 0)
             return 0;
         prsactx->op = op;
@@ -234,16 +237,10 @@ static int rsakem_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
     return 1;
 }

-static const OSSL_PARAM known_settable_rsakem_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_KEM_PARAM_OPERATION, NULL, 0),
-    OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_KEM_PARAM_FIPS_KEY_CHECK)
-        OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *rsakem_settable_ctx_params(ossl_unused void *vprsactx,
     ossl_unused void *provctx)
 {
-    return known_settable_rsakem_ctx_params;
+    return rsakem_set_ctx_params_list;
 }

 /*
@@ -325,7 +322,7 @@ static int rsasve_generate(PROV_RSA_CTX *prsactx,
      * Step (2): Generate a random byte string z of nlen bytes where
      *            1 < z < n - 1
      */
-    if (!rsasve_gen_rand_bytes(prsactx->rsa, secret, nlen))
+    if (!rsasve_gen_rand_bytes(prsactx->rsa, secret, (int)nlen))
         return 0;

     /* Step(3): out = RSAEP((n,e), z) */
@@ -347,7 +344,8 @@ static int rsasve_generate(PROV_RSA_CTX *prsactx,
 /**
  * rsasve_recover - Recovers a secret value from ciphertext using an RSA
  * private key.  Once, recovered, the secret value is considered to be a
- * shared secret.  Algorithm is performed as per NIST SP 800-56B Rev 2
+ * shared secret.  Algorithm is performed as per
+ * NIST SP 800-56B Rev 2
  * 7.2.1.3 RSASVE Recovery Operation (RSASVE.RECOVER).
  *
  * This function performs RSA decryption using the private key from the
@@ -441,7 +439,7 @@ static int rsasve_recover(PROV_RSA_CTX *prsactx,
 #endif

     /* Step (3): out = RSADP((n,d), in) */
-    ret = RSA_private_decrypt(inlen, in, out, prsactx->rsa, RSA_NO_PADDING);
+    ret = RSA_private_decrypt((int)inlen, in, out, prsactx->rsa, RSA_NO_PADDING);
     if (ret > 0 && outlen != NULL)
         *outlen = ret;
     return ret > 0;
diff --git a/deps/openssl/openssl/providers/implementations/kem/rsa_kem.inc.in b/deps/openssl/openssl/providers/implementations/kem/rsa_kem.inc.in
new file mode 100644
index 00000000000..0588758ae50
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/kem/rsa_kem.inc.in
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('rsakem_get_ctx_params',
+                         (['OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('rsakem_set_ctx_params',
+                         (['OSSL_KEM_PARAM_OPERATION',       'op',    'utf8_string'],
+                          ['OSSL_KEM_PARAM_FIPS_KEY_CHECK',  'ind_k', 'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/kem/template_kem.c b/deps/openssl/openssl/providers/implementations/kem/template_kem.c
index 509a31e1294..06ecf7c5d7d 100644
--- a/deps/openssl/openssl/providers/implementations/kem/template_kem.c
+++ b/deps/openssl/openssl/providers/implementations/kem/template_kem.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -166,7 +166,7 @@ static int template_decapsulate(void *vctx, unsigned char *out, size_t *outlen,

     if (out == NULL) {
         if (outlen != NULL)
-            debug_print("decaps outlen set to %zu \n", *outlen);
+            debug_print("decaps outlen set to %zu\n", *outlen);
         return 1;
     }

diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/build.info b/deps/openssl/openssl/providers/implementations/keymgmt/build.info
index 908a32f3555..347904c7e75 100644
--- a/deps/openssl/openssl/providers/implementations/keymgmt/build.info
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/build.info
@@ -8,6 +8,7 @@ $ECX_GOAL=../../libdefault.a ../../libfips.a
 $KDF_GOAL=../../libdefault.a ../../libfips.a
 $MAC_GOAL=../../libdefault.a ../../libfips.a
 $RSA_GOAL=../../libdefault.a ../../libfips.a
+$LMS_GOAL=../../libdefault.a ../../libfips.a
 $TEMPLATE_GOAL=../../libtemplate.a
 $ML_DSA_GOAL=../../libdefault.a ../../libfips.a
 $ML_KEM_GOAL=../../libdefault.a ../../libfips.a
@@ -46,6 +47,7 @@ IF[{- !$disabled{'ml-kem'} -}]
     SOURCE[$TLS_ML_KEM_HYBRID_GOAL]=mlx_kmgmt.c
   ENDIF
   SOURCE[$ML_KEM_GOAL]=ml_kem_kmgmt.c
+  DEPEND[ml_kem_kmgmt.o]=../../common/include/prov/der_hkdf.h ../../common/include/prov/der_wrap.h
 ENDIF

 SOURCE[$RSA_GOAL]=rsa_kmgmt.c
@@ -54,6 +56,10 @@ SOURCE[$KDF_GOAL]=kdf_legacy_kmgmt.c

 SOURCE[$MAC_GOAL]=mac_legacy_kmgmt.c

+IF[{- !$disabled{lms} -}]
+  SOURCE[$LMS_GOAL]=lms_kmgmt.c
+ENDIF
+
 SOURCE[$TEMPLATE_GOAL]=template_kmgmt.c

 IF[{- !$disabled{'ml-dsa'} -}]
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/dh_kmgmt.c b/deps/openssl/openssl/providers/implementations/keymgmt/dh_kmgmt.c
index 54c31e2e864..94338a2a30b 100644
--- a/deps/openssl/openssl/providers/implementations/keymgmt/dh_kmgmt.c
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/dh_kmgmt.c
@@ -20,15 +20,20 @@
 #include <openssl/bn.h>
 #include <openssl/err.h>
 #include <openssl/self_test.h>
+#include <openssl/proverr.h>
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
 #include "prov/provider_ctx.h"
 #include "crypto/dh.h"
 #include "internal/fips.h"
 #include "internal/sizes.h"
-#include "fips/fipsindicator.h"
+#include "internal/cryptlib.h"
+#include "providers/implementations/keymgmt/keymgmtcommon.inc"

 static OSSL_FUNC_keymgmt_new_fn dh_newdata;
+static OSSL_FUNC_keymgmt_new_ex_fn dh_newdata_ex;
+static OSSL_FUNC_keymgmt_new_fn dhx_newdata;
+static OSSL_FUNC_keymgmt_new_ex_fn dhx_newdata_ex;
 static OSSL_FUNC_keymgmt_free_fn dh_freedata;
 static OSSL_FUNC_keymgmt_gen_init_fn dh_gen_init;
 static OSSL_FUNC_keymgmt_gen_init_fn dhx_gen_init;
@@ -99,32 +104,91 @@ static int dh_gen_type_name2id_w_default(const char *name, int type)
     return ossl_dh_gen_type_name2id(name, type);
 }

-static void *dh_newdata(void *provctx)
+/*
+ * If the application actually created a legacy DH object and assigned it to
+ * the EVP_PKEY, then we get hold of that object here. We return 0 if we hit
+ * a fatal error or 1 otherwise. We may return 1 but with *dh set to NULL.
+ */
+static int get_legacy_dh_object(OSSL_LIB_CTX *libctx, DH **dh, const OSSL_PARAM params[])
+{
+#ifndef FIPS_MODULE
+    const OSSL_PARAM *p;
+
+    if (params == NULL)
+        return 1;
+    p = OSSL_PARAM_locate_const(params, "legacy-object");
+    if (p == NULL)
+        return 1;
+    /*
+     * This only works because we are in the default provider. We are not
+     * normally allowed to pass complex objects across the provider boundary
+     * like this.
+     */
+    if (OSSL_PARAM_get_octet_ptr(p, (const void **)dh, NULL) && *dh != NULL) {
+        if (ossl_lib_ctx_get_concrete(ossl_dh_get0_libctx(*dh)) != ossl_lib_ctx_get_concrete(libctx)) {
+            *dh = NULL;
+            return 1;
+        }
+        if (!DH_up_ref(*dh))
+            return 0;
+    }
+#endif
+
+    return 1;
+}
+
+static void *dh_newdata_ex(void *provctx, const OSSL_PARAM params[])
 {
     DH *dh = NULL;

-    if (ossl_prov_is_running()) {
+    if (!ossl_prov_is_running())
+        return NULL;
+
+    if (!get_legacy_dh_object(PROV_LIBCTX_OF(provctx), &dh, params))
+        return NULL;
+
+    if (dh == NULL) {
         dh = ossl_dh_new_ex(PROV_LIBCTX_OF(provctx));
         if (dh != NULL) {
             DH_clear_flags(dh, DH_FLAG_TYPE_MASK);
             DH_set_flags(dh, DH_FLAG_TYPE_DH);
         }
     }
+
     return dh;
 }

-static void *dhx_newdata(void *provctx)
+static void *dh_newdata(void *provctx)
+{
+    return dh_newdata_ex(provctx, NULL);
+}
+
+static void *dhx_newdata_ex(void *provctx, const OSSL_PARAM params[])
 {
     DH *dh = NULL;

-    dh = ossl_dh_new_ex(PROV_LIBCTX_OF(provctx));
-    if (dh != NULL) {
-        DH_clear_flags(dh, DH_FLAG_TYPE_MASK);
-        DH_set_flags(dh, DH_FLAG_TYPE_DHX);
+    if (!ossl_prov_is_running())
+        return NULL;
+
+    if (!get_legacy_dh_object(PROV_LIBCTX_OF(provctx), &dh, params))
+        return NULL;
+
+    if (dh == NULL) {
+        dh = ossl_dh_new_ex(PROV_LIBCTX_OF(provctx));
+        if (dh != NULL) {
+            DH_clear_flags(dh, DH_FLAG_TYPE_MASK);
+            DH_set_flags(dh, DH_FLAG_TYPE_DHX);
+        }
     }
+
     return dh;
 }

+static void *dhx_newdata(void *provctx)
+{
+    return dhx_newdata_ex(provctx, NULL);
+}
+
 static void dh_freedata(void *keydata)
 {
     DH_free(keydata);
@@ -233,12 +297,12 @@ static int dh_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
         return 0;

     if ((selection & OSSL_KEYMGMT_SELECT_ALL_PARAMETERS) != 0)
-        ok = ok && ossl_dh_params_todata(dh, tmpl, NULL);
+        ok = ok && ossl_dh_params_todata(dh, tmpl, NULL, NULL);

     if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
         int include_private = selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY ? 1 : 0;

-        ok = ok && ossl_dh_key_todata(dh, tmpl, NULL, include_private);
+        ok = ok && ossl_dh_key_todata(dh, tmpl, NULL, NULL, include_private);
     }

     if (!ok || (params = OSSL_PARAM_BLD_to_param(tmpl)) == NULL) {
@@ -247,7 +311,7 @@ static int dh_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
     }

     ok = param_cb(params, cbarg);
-    OSSL_PARAM_free(params);
+    OSSL_PARAM_clear_free(params);
 err:
     OSSL_PARAM_BLD_free(tmpl);
     return ok;
@@ -255,6 +319,7 @@ err:

 /* IMEXPORT = IMPORT + EXPORT */

+/* These must be kept in sync with the dh_get_params ones below */
 #define DH_IMEXPORTABLE_PARAMETERS                                  \
     OSSL_PARAM_BN(OSSL_PKEY_PARAM_FFC_P, NULL, 0),                  \
         OSSL_PARAM_BN(OSSL_PKEY_PARAM_FFC_Q, NULL, 0),              \
@@ -313,68 +378,97 @@ static const OSSL_PARAM *dh_export_types(int selection)
     return dh_imexport_types(selection);
 }

-static ossl_inline int dh_get_params(void *key, OSSL_PARAM params[])
+struct dh_params_st {
+    FFC_OSSL_PARAMS ffp;
+    OSSL_PARAM *bits;
+    OSSL_PARAM *secbits;
+    OSSL_PARAM *maxsize;
+    OSSL_PARAM *seccat;
+    OSSL_PARAM *privkey;
+    OSSL_PARAM *privlen;
+    OSSL_PARAM *pubkey;
+    OSSL_PARAM *encpubkey;
+};
+
+#define dh_get_params_st dh_params_st
+
+struct dh_gen_set_params_st {
+    OSSL_PARAM *type;
+    OSSL_PARAM *group_name;
+    OSSL_PARAM *privlen;
+    OSSL_PARAM *pbits;
+    OSSL_PARAM *qbits; /* DHX only */
+    OSSL_PARAM *digest; /* DHX only */
+    OSSL_PARAM *propq; /* DHX only */
+    OSSL_PARAM *g_index; /* DHX only */
+    OSSL_PARAM *seed; /* DHX only */
+    OSSL_PARAM *p_counter; /* DHX only */
+    OSSL_PARAM *h; /* DHX only */
+    OSSL_PARAM *generator; /* DH only */
+};
+
+#define dhx_gen_set_params_st dh_gen_set_params_st
+
+#define dh_gen_set_params_st dh_gen_set_params_st
+
+#include "providers/implementations/keymgmt/dh_kmgmt.inc"
+
+static int dh_get_params(void *key, OSSL_PARAM params[])
 {
     DH *dh = key;
-    OSSL_PARAM *p;
+    struct dh_params_st p;
+
+    if (key == NULL || !dh_get_params_decoder(params, &p))
+        return 0;

-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
-        && !OSSL_PARAM_set_int(p, DH_bits(dh)))
+    if (p.bits != NULL && !OSSL_PARAM_set_int(p.bits, DH_bits(dh)))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
-        && !OSSL_PARAM_set_int(p, DH_security_bits(dh)))
+
+    if (p.secbits != NULL && !OSSL_PARAM_set_int(p.secbits, DH_security_bits(dh)))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
-        && !OSSL_PARAM_set_int(p, DH_size(dh)))
+
+    if (p.maxsize != NULL && !OSSL_PARAM_set_int(p.maxsize, DH_size(dh)))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING)
+
+    if (p.encpubkey != NULL) {
+        if (p.encpubkey->data_type != OSSL_PARAM_OCTET_STRING)
             return 0;
-        p->return_size = ossl_dh_key2buf(dh, (unsigned char **)&p->data,
-            p->data_size, 0);
-        if (p->return_size == 0)
+        p.encpubkey->return_size = ossl_dh_key2buf(dh, (unsigned char **)&p.encpubkey->data,
+            p.encpubkey->data_size, 0);
+        if (p.encpubkey->return_size == 0)
             return 0;
     }

-    return ossl_dh_params_todata(dh, NULL, params)
-        && ossl_dh_key_todata(dh, NULL, params, 1);
-}
+    if (p.seccat != NULL)
+        if (!OSSL_PARAM_set_int(p.seccat, 0))
+            return 0;

-static const OSSL_PARAM dh_params[] = {
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
-    DH_IMEXPORTABLE_PARAMETERS,
-    DH_IMEXPORTABLE_PUBLIC_KEY,
-    DH_IMEXPORTABLE_PRIVATE_KEY,
-    OSSL_PARAM_END
-};
+    return ossl_dh_params_todata(dh, NULL, p.privlen, &p.ffp)
+        && ossl_dh_key_todata(dh, NULL, p.pubkey, p.privkey, 1);
+}

 static const OSSL_PARAM *dh_gettable_params(void *provctx)
 {
-    return dh_params;
+    return dh_get_params_list;
 }

-static const OSSL_PARAM dh_known_settable_params[] = {
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *dh_settable_params(void *provctx)
 {
-    return dh_known_settable_params;
+    return dh_set_params_list;
 }

 static int dh_set_params(void *key, const OSSL_PARAM params[])
 {
     DH *dh = key;
-    const OSSL_PARAM *p;
+    struct dh_set_params_st p;
+
+    if (key == NULL || !dh_set_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY);
-    if (p != NULL
-        && (p->data_type != OSSL_PARAM_OCTET_STRING
-            || !ossl_dh_buf2key(dh, p->data, p->data_size)))
+    if (p.encpubkey != NULL
+        && (p.encpubkey->data_type != OSSL_PARAM_OCTET_STRING
+            || !ossl_dh_buf2key(dh, p.encpubkey->data,
+                p.encpubkey->data_size)))
         return 0;

     return 1;
@@ -523,44 +617,37 @@ static int dh_set_gen_seed(struct dh_gen_ctx *gctx, unsigned char *seed,
     return 1;
 }

-static int dh_gen_common_set_params(void *genctx, const OSSL_PARAM params[])
+static int dh_gen_common_set_params(struct dh_gen_ctx *gctx,
+    const struct dhx_gen_set_params_st *p)
 {
-    struct dh_gen_ctx *gctx = genctx;
-    const OSSL_PARAM *p;
     int gen_type = -1;

-    if (gctx == NULL)
-        return 0;
-    if (ossl_param_is_empty(params))
-        return 1;
-
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_TYPE);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING
-            || ((gen_type = dh_gen_type_name2id_w_default(p->data, gctx->dh_type)) == -1)) {
+    if (p->type != NULL) {
+        if (p->type->data_type != OSSL_PARAM_UTF8_STRING
+            || ((gen_type = dh_gen_type_name2id_w_default(p->type->data, gctx->dh_type)) == -1)) {
             ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
             return 0;
         }
         if (gen_type != -1)
             gctx->gen_type = gen_type;
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_GROUP_NAME);
-    if (p != NULL) {
+
+    if (p->group_name != NULL) {
         const DH_NAMED_GROUP *group = NULL;

-        if (p->data_type != OSSL_PARAM_UTF8_STRING
-            || p->data == NULL
-            || (group = ossl_ffc_name_to_dh_named_group(p->data)) == NULL
+        if (p->group_name->data_type != OSSL_PARAM_UTF8_STRING
+            || p->group_name->data == NULL
+            || (group = ossl_ffc_name_to_dh_named_group(p->group_name->data)) == NULL
             || ((gctx->group_nid = ossl_ffc_named_group_get_uid(group)) == NID_undef)) {
             ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
             return 0;
         }
     }
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_PBITS)) != NULL
-        && !OSSL_PARAM_get_size_t(p, &gctx->pbits))
+
+    if (p->pbits != NULL && !OSSL_PARAM_get_size_t(p->pbits, &gctx->pbits))
         return 0;
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_DH_PRIV_LEN);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &gctx->priv_len))
+
+    if (p->privlen != NULL && !OSSL_PARAM_get_int(p->privlen, &gctx->priv_len))
         return 0;
     return 1;
 }
@@ -568,116 +655,79 @@ static int dh_gen_common_set_params(void *genctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *dh_gen_settable_params(ossl_unused void *genctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM dh_gen_settable[] = {
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_FFC_TYPE, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME, NULL, 0),
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_DH_PRIV_LEN, NULL),
-        OSSL_PARAM_size_t(OSSL_PKEY_PARAM_FFC_PBITS, NULL),
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_DH_GENERATOR, NULL),
-        OSSL_PARAM_END
-    };
-    return dh_gen_settable;
+    return dh_gen_set_params_list;
 }

 static const OSSL_PARAM *dhx_gen_settable_params(ossl_unused void *genctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM dhx_gen_settable[] = {
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_FFC_TYPE, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME, NULL, 0),
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_DH_PRIV_LEN, NULL),
-        OSSL_PARAM_size_t(OSSL_PKEY_PARAM_FFC_PBITS, NULL),
-        OSSL_PARAM_size_t(OSSL_PKEY_PARAM_FFC_QBITS, NULL),
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_FFC_DIGEST, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_FFC_DIGEST_PROPS, NULL, 0),
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_FFC_GINDEX, NULL),
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_FFC_SEED, NULL, 0),
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_FFC_PCOUNTER, NULL),
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_FFC_H, NULL),
-        OSSL_PARAM_END
-    };
-    return dhx_gen_settable;
+    return dhx_gen_set_params_list;
 }

 static int dhx_gen_set_params(void *genctx, const OSSL_PARAM params[])
 {
     struct dh_gen_ctx *gctx = genctx;
-    const OSSL_PARAM *p;
+    struct dhx_gen_set_params_st p;
+
+    if (gctx == NULL || !dhx_gen_set_params_decoder(params, &p))
+        return 0;

-    if (!dh_gen_common_set_params(genctx, params))
+    if (!dh_gen_common_set_params(gctx, &p))
         return 0;

     /* Parameters related to fips186-4 and fips186-2 */
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_GINDEX);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &gctx->gindex))
+    if (p.g_index != NULL && !OSSL_PARAM_get_int(p.g_index, &gctx->gindex))
         return 0;
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_PCOUNTER);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &gctx->pcounter))
+
+    if (p.p_counter != NULL && !OSSL_PARAM_get_int(p.p_counter, &gctx->pcounter))
         return 0;
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_H);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &gctx->hindex))
+
+    if (p.h != NULL && !OSSL_PARAM_get_int(p.h, &gctx->hindex))
         return 0;
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_SEED);
-    if (p != NULL
-        && (p->data_type != OSSL_PARAM_OCTET_STRING
-            || !dh_set_gen_seed(gctx, p->data, p->data_size)))
+
+    if (p.seed != NULL
+        && (p.seed->data_type != OSSL_PARAM_OCTET_STRING
+            || !dh_set_gen_seed(gctx, p.seed->data, p.seed->data_size)))
         return 0;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_QBITS)) != NULL
-        && !OSSL_PARAM_get_size_t(p, &gctx->qbits))
+
+    if (p.qbits != NULL && !OSSL_PARAM_get_size_t(p.qbits, &gctx->qbits))
         return 0;
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_DIGEST);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
+
+    if (p.digest != NULL) {
+        if (p.digest->data_type != OSSL_PARAM_UTF8_STRING)
             return 0;
         OPENSSL_free(gctx->mdname);
-        gctx->mdname = OPENSSL_strdup(p->data);
+        gctx->mdname = OPENSSL_strdup(p.digest->data);
         if (gctx->mdname == NULL)
             return 0;
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_DIGEST_PROPS);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
+
+    if (p.propq != NULL) {
+        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING)
             return 0;
         OPENSSL_free(gctx->mdprops);
-        gctx->mdprops = OPENSSL_strdup(p->data);
+        gctx->mdprops = OPENSSL_strdup(p.propq->data);
         if (gctx->mdprops == NULL)
             return 0;
     }

-    /* Parameters that are not allowed for DHX */
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_DH_GENERATOR);
-    if (p != NULL) {
-        ERR_raise(ERR_LIB_PROV, ERR_R_UNSUPPORTED);
-        return 0;
-    }
     return 1;
 }

 static int dh_gen_set_params(void *genctx, const OSSL_PARAM params[])
 {
     struct dh_gen_ctx *gctx = genctx;
-    const OSSL_PARAM *p;
+    struct dhx_gen_set_params_st p;

-    if (!dh_gen_common_set_params(genctx, params))
+    if (gctx == NULL || !dh_gen_set_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_DH_GENERATOR);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &gctx->generator))
+    if (!dh_gen_common_set_params(gctx, &p))
         return 0;

-    /* Parameters that are not allowed for DH */
-    if (OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_GINDEX) != NULL
-        || OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_PCOUNTER) != NULL
-        || OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_H) != NULL
-        || OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_SEED) != NULL
-        || OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_QBITS) != NULL
-        || OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_DIGEST) != NULL
-        || OSSL_PARAM_locate_const(params,
-               OSSL_PKEY_PARAM_FFC_DIGEST_PROPS)
-            != NULL) {
-        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
+    if (p.generator != NULL && !OSSL_PARAM_get_int(p.generator, &gctx->generator))
         return 0;
-    }
+
     return 1;
 }

@@ -729,7 +779,7 @@ static void *dh_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg)
         && gctx->ffc_params == NULL) {
         /* Select a named group if there is not one already */
         if (gctx->group_nid == NID_undef)
-            gctx->group_nid = ossl_dh_get_named_group_uid_from_size(gctx->pbits);
+            gctx->group_nid = ossl_dh_get_named_group_uid_from_size((int)gctx->pbits);
         if (gctx->group_nid == NID_undef)
             return NULL;
         dh = ossl_dh_new_by_nid_ex(gctx->libctx, gctx->group_nid);
@@ -771,12 +821,12 @@ static void *dh_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg)
              * group based on pbits.
              */
             if (gctx->gen_type == DH_PARAMGEN_TYPE_GENERATOR)
-                ret = DH_generate_parameters_ex(dh, gctx->pbits,
+                ret = DH_generate_parameters_ex(dh, (int)gctx->pbits,
                     gctx->generator, gencb);
             else
                 ret = ossl_dh_generate_ffc_parameters(dh, gctx->gen_type,
-                    gctx->pbits, gctx->qbits,
-                    gencb);
+                    (int)gctx->pbits,
+                    (int)gctx->qbits, gencb);
             if (ret <= 0)
                 goto end;
         }
@@ -848,6 +898,7 @@ static void *dh_dup(const void *keydata_from, int selection)

 const OSSL_DISPATCH ossl_dh_keymgmt_functions[] = {
     { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))dh_newdata },
+    { OSSL_FUNC_KEYMGMT_NEW_EX, (void (*)(void))dh_newdata_ex },
     { OSSL_FUNC_KEYMGMT_GEN_INIT, (void (*)(void))dh_gen_init },
     { OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE, (void (*)(void))dh_gen_set_template },
     { OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS, (void (*)(void))dh_gen_set_params },
@@ -869,9 +920,7 @@ const OSSL_DISPATCH ossl_dh_keymgmt_functions[] = {
     { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))dh_export },
     { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))dh_export_types },
     { OSSL_FUNC_KEYMGMT_DUP, (void (*)(void))dh_dup },
-    OSSL_FIPS_IND_APPROVED_DISPATCH(OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS,
-        OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS)
-        OSSL_DISPATCH_END
+    OSSL_KEYMGMT_FIPS_APPROVED_GEN_DISPATCH_END
 };

 /* For any DH key, we use the "DH" algorithms regardless of sub-type. */
@@ -882,6 +931,7 @@ static const char *dhx_query_operation_name(int operation_id)

 const OSSL_DISPATCH ossl_dhx_keymgmt_functions[] = {
     { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))dhx_newdata },
+    { OSSL_FUNC_KEYMGMT_NEW_EX, (void (*)(void))dhx_newdata_ex },
     { OSSL_FUNC_KEYMGMT_GEN_INIT, (void (*)(void))dhx_gen_init },
     { OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE, (void (*)(void))dh_gen_set_template },
     { OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS, (void (*)(void))dhx_gen_set_params },
@@ -905,7 +955,5 @@ const OSSL_DISPATCH ossl_dhx_keymgmt_functions[] = {
     { OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME,
         (void (*)(void))dhx_query_operation_name },
     { OSSL_FUNC_KEYMGMT_DUP, (void (*)(void))dh_dup },
-    OSSL_FIPS_IND_APPROVED_DISPATCH(OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS,
-        OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS)
-        OSSL_DISPATCH_END
+    OSSL_KEYMGMT_FIPS_APPROVED_GEN_DISPATCH_END
 };
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/dh_kmgmt.inc.in b/deps/openssl/openssl/providers/implementations/keymgmt/dh_kmgmt.inc.in
new file mode 100644
index 00000000000..c9e4c9f2ec8
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/dh_kmgmt.inc.in
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('dh_get_params',
+                         (['OSSL_PKEY_PARAM_BITS',               'bits',           'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_BITS',      'secbits',        'int'],
+                          ['OSSL_PKEY_PARAM_MAX_SIZE',           'maxsize',        'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_CATEGORY',  'seccat',         'int'],
+                          ['OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY', 'encpubkey',      'octet_string'],
+                          ['OSSL_PKEY_PARAM_FFC_P',              'ffp.p',          'BN'],
+                          ['OSSL_PKEY_PARAM_FFC_Q',              'ffp.q',          'BN'],
+                          ['OSSL_PKEY_PARAM_FFC_G',              'ffp.g',          'BN'],
+                          ['OSSL_PKEY_PARAM_FFC_COFACTOR',       'ffp.cofactor',   'BN'],
+                          ['OSSL_PKEY_PARAM_FFC_GINDEX',         'ffp.g_index',    'int'],
+                          ['OSSL_PKEY_PARAM_FFC_PCOUNTER',       'ffp.p_counter',  'int'],
+                          ['OSSL_PKEY_PARAM_FFC_H',              'ffp.h',          'int'],
+                          ['OSSL_PKEY_PARAM_DH_PRIV_LEN',        'privlen',        'int'],
+                          ['OSSL_PKEY_PARAM_FFC_SEED',           'ffp.seed',       'octet_string'],
+                          ['OSSL_PKEY_PARAM_GROUP_NAME',         'ffp.group_name', 'utf8_string'],
+                          ['OSSL_PKEY_PARAM_PUB_KEY',            'pubkey',         'BN'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY',           'privkey',        'BN'],
+                         )); -}
+
+{- produce_param_decoder('dh_set_params',
+                         (['OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY', 'encpubkey', 'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('dhx_gen_set_params',
+                         (['OSSL_PKEY_PARAM_FFC_TYPE',          'type',       'utf8_string'],
+                          ['OSSL_PKEY_PARAM_GROUP_NAME',        'group_name', 'utf8_string'],
+                          ['OSSL_PKEY_PARAM_DH_PRIV_LEN',       'privlen',    'int'],
+                          ['OSSL_PKEY_PARAM_FFC_PBITS',         'pbits',      'size_t'],
+                          ['OSSL_PKEY_PARAM_FFC_QBITS',         'qbits',      'size_t'],
+                          ['OSSL_PKEY_PARAM_FFC_DIGEST',        'digest',     'utf8_string'],
+                          ['OSSL_PKEY_PARAM_FFC_DIGEST_PROPS',  'propq',      'utf8_string'],
+                          ['OSSL_PKEY_PARAM_FFC_GINDEX',        'g_index',    'int'],
+                          ['OSSL_PKEY_PARAM_FFC_SEED',          'seed',       'octet_string'],
+                          ['OSSL_PKEY_PARAM_FFC_PCOUNTER',      'p_counter',  'int'],
+                          ['OSSL_PKEY_PARAM_FFC_H',             'h',          'int'],
+                          ['OSSL_PKEY_PARAM_DH_GENERATOR',      'invalid param'],
+                         )); -}
+
+{- produce_param_decoder('dh_gen_set_params',
+                         (['OSSL_PKEY_PARAM_FFC_TYPE',          'type',       'utf8_string'],
+                          ['OSSL_PKEY_PARAM_GROUP_NAME',        'group_name', 'utf8_string'],
+                          ['OSSL_PKEY_PARAM_DH_PRIV_LEN',       'privlen',    'int'],
+                          ['OSSL_PKEY_PARAM_FFC_PBITS',         'pbits',      'size_t'],
+                          ['OSSL_PKEY_PARAM_DH_GENERATOR',      'generator',  'int'],
+                          ['OSSL_PKEY_PARAM_FFC_GINDEX',        'invalid param'],
+                          ['OSSL_PKEY_PARAM_FFC_PCOUNTER',      'invalid param'],
+                          ['OSSL_PKEY_PARAM_FFC_H',             'invalid param'],
+                          ['OSSL_PKEY_PARAM_FFC_SEED',          'invalid param'],
+                          ['OSSL_PKEY_PARAM_FFC_QBITS',         'invalid param'],
+                          ['OSSL_PKEY_PARAM_FFC_DIGEST',        'invalid param'],
+                          ['OSSL_PKEY_PARAM_FFC_DIGEST_PROPS',  'invalid param'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/dsa_kmgmt.c b/deps/openssl/openssl/providers/implementations/keymgmt/dsa_kmgmt.c
index c54e4143f93..3540706b542 100644
--- a/deps/openssl/openssl/providers/implementations/keymgmt/dsa_kmgmt.c
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/dsa_kmgmt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,6 +17,7 @@
 #include <openssl/core_names.h>
 #include <openssl/bn.h>
 #include <openssl/err.h>
+#include <openssl/proverr.h>
 #include "prov/securitycheck.h"
 #include "prov/providercommon.h"
 #include "prov/implementations.h"
@@ -27,6 +28,7 @@
 #include "internal/param_build_set.h"

 static OSSL_FUNC_keymgmt_new_fn dsa_newdata;
+static OSSL_FUNC_keymgmt_new_ex_fn dsa_newdata_ex;
 static OSSL_FUNC_keymgmt_free_fn dsa_freedata;
 static OSSL_FUNC_keymgmt_gen_init_fn dsa_gen_init;
 static OSSL_FUNC_keymgmt_gen_set_template_fn dsa_gen_set_template;
@@ -98,8 +100,8 @@ static int dsa_gen_type_name2id(const char *name)
     return -1;
 }

-static int dsa_key_todata(DSA *dsa, OSSL_PARAM_BLD *bld, OSSL_PARAM params[],
-    int include_private)
+static int dsa_key_todata(DSA *dsa, OSSL_PARAM_BLD *bld, OSSL_PARAM *pubkey,
+    OSSL_PARAM *privkey, int include_private)
 {
     const BIGNUM *priv = NULL, *pub = NULL;

@@ -109,20 +111,51 @@ static int dsa_key_todata(DSA *dsa, OSSL_PARAM_BLD *bld, OSSL_PARAM params[],
     DSA_get0_key(dsa, &pub, &priv);
     if (include_private
         && priv != NULL
-        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PRIV_KEY, priv))
+        && !ossl_param_build_set_bn(bld, privkey, OSSL_PKEY_PARAM_PRIV_KEY, priv))
         return 0;
     if (pub != NULL
-        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PUB_KEY, pub))
+        && !ossl_param_build_set_bn(bld, pubkey, OSSL_PKEY_PARAM_PUB_KEY, pub))
         return 0;

     return 1;
 }

-static void *dsa_newdata(void *provctx)
+static void *dsa_newdata_ex(void *provctx, const OSSL_PARAM params[])
 {
+    DSA *dsa = NULL;
+    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
+
     if (!ossl_prov_is_running())
         return NULL;
-    return ossl_dsa_new(PROV_LIBCTX_OF(provctx));
+
+#ifndef FIPS_MODULE
+    const OSSL_PARAM *p = NULL;
+
+    if (params != NULL)
+        p = OSSL_PARAM_locate_const(params, "legacy-object");
+
+    /*
+     * This only works because we are in the default provider. We are not
+     * normally allowed to pass complex objects across the provider boundary
+     * like this.
+     */
+    if (p != NULL && OSSL_PARAM_get_octet_ptr(p, (const void **)&dsa, NULL) && dsa != NULL) {
+        if (ossl_lib_ctx_get_concrete(ossl_dsa_get0_libctx(dsa)) != ossl_lib_ctx_get_concrete(libctx))
+            dsa = NULL;
+        else if (!DSA_up_ref(dsa))
+            return NULL;
+    }
+#endif
+
+    if (dsa == NULL)
+        dsa = ossl_dsa_new(libctx);
+
+    return dsa;
+}
+
+static void *dsa_newdata(void *provctx)
+{
+    return dsa_newdata_ex(provctx, NULL);
 }

 static void dsa_freedata(void *keydata)
@@ -237,7 +270,7 @@ static int dsa_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
     if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
         int include_private = selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY ? 1 : 0;

-        ok = ok && dsa_key_todata(dsa, tmpl, NULL, include_private);
+        ok = ok && dsa_key_todata(dsa, tmpl, NULL, NULL, include_private);
     }

     if (!ok || (params = OSSL_PARAM_BLD_to_param(tmpl)) == NULL) {
@@ -246,7 +279,7 @@ static int dsa_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
     }

     ok = param_cb(params, cbarg);
-    OSSL_PARAM_free(params);
+    OSSL_PARAM_clear_free(params);
 err:
     OSSL_PARAM_BLD_free(tmpl);
     return ok;
@@ -310,41 +343,51 @@ static const OSSL_PARAM *dsa_export_types(int selection)
     return dsa_imexport_types(selection);
 }

+struct dsa_params_st {
+    FFC_OSSL_PARAMS ffp;
+    OSSL_PARAM *bits;
+    OSSL_PARAM *secbits;
+    OSSL_PARAM *maxsize;
+    OSSL_PARAM *seccat;
+    OSSL_PARAM *digest;
+    OSSL_PARAM *privkey;
+    OSSL_PARAM *pubkey;
+};
+
+#define dsa_get_params_st dsa_params_st
+
+#include "providers/implementations/keymgmt/dsa_kmgmt.inc"
+
 static ossl_inline int dsa_get_params(void *key, OSSL_PARAM params[])
 {
     DSA *dsa = key;
-    OSSL_PARAM *p;
+    struct dsa_params_st p;

-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
-        && !OSSL_PARAM_set_int(p, DSA_bits(dsa)))
+    if (key == NULL || !dsa_get_params_decoder(params, &p))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
-        && !OSSL_PARAM_set_int(p, DSA_security_bits(dsa)))
+
+    if (p.bits != NULL && !OSSL_PARAM_set_int(p.bits, DSA_bits(dsa)))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
-        && !OSSL_PARAM_set_int(p, DSA_size(dsa)))
+
+    if (p.secbits != NULL && !OSSL_PARAM_set_int(p.secbits, DSA_security_bits(dsa)))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
-        && !OSSL_PARAM_set_utf8_string(p, DSA_DEFAULT_MD))
+
+    if (p.maxsize != NULL && !OSSL_PARAM_set_int(p.maxsize, DSA_size(dsa)))
         return 0;
-    return ossl_ffc_params_todata(ossl_dsa_get0_params(dsa), NULL, params)
-        && dsa_key_todata(dsa, NULL, params, 1);
-}

-static const OSSL_PARAM dsa_params[] = {
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_DEFAULT_DIGEST, NULL, 0),
-    DSA_IMEXPORTABLE_PARAMETERS,
-    DSA_IMEXPORTABLE_PUBLIC_KEY,
-    DSA_IMEXPORTABLE_PRIVATE_KEY,
-    OSSL_PARAM_END
-};
+    if (p.digest != NULL && !OSSL_PARAM_set_utf8_string(p.digest, DSA_DEFAULT_MD))
+        return 0;
+
+    if (p.seccat != NULL && !OSSL_PARAM_set_int(p.seccat, 0))
+        return 0;
+
+    return ossl_ffc_params_todata(ossl_dsa_get0_params(dsa), NULL, &p.ffp)
+        && dsa_key_todata(dsa, NULL, p.pubkey, p.privkey, 1);
+}

 static const OSSL_PARAM *dsa_gettable_params(void *provctx)
 {
-    return dsa_params;
+    return dsa_get_params_list;
 }

 static int dsa_validate_domparams(const DSA *dsa, int checktype)
@@ -463,22 +506,19 @@ static int dsa_set_gen_seed(struct dsa_gen_ctx *gctx, unsigned char *seed,
 static int dsa_gen_set_params(void *genctx, const OSSL_PARAM params[])
 {
     struct dsa_gen_ctx *gctx = genctx;
-    const OSSL_PARAM *p;
+    struct dsa_gen_set_params_st p;
     int gen_type = -1;

-    if (gctx == NULL)
+    if (gctx == NULL || !dsa_gen_set_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(gctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_PKEY_PARAM_FIPS_SIGN_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(gctx, OSSL_FIPS_IND_SETTABLE0,
+            p.ind_sign))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_TYPE);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING
-            || ((gen_type = dsa_gen_type_name2id(p->data)) == -1)) {
+    if (p.type != NULL) {
+        if (p.type->data_type != OSSL_PARAM_UTF8_STRING
+            || ((gen_type = dsa_gen_type_name2id(p.type->data)) == -1)) {
             ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
             return 0;
         }
@@ -491,44 +531,41 @@ static int dsa_gen_set_params(void *genctx, const OSSL_PARAM params[])
         if (gen_type != -1)
             gctx->gen_type = gen_type;
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_GINDEX);
-    if (p != NULL
-        && !OSSL_PARAM_get_int(p, &gctx->gindex))
+
+    if (p.g_index != NULL && !OSSL_PARAM_get_int(p.g_index, &gctx->gindex))
         return 0;
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_PCOUNTER);
-    if (p != NULL
-        && !OSSL_PARAM_get_int(p, &gctx->pcounter))
+
+    if (p.p_counter != NULL && !OSSL_PARAM_get_int(p.p_counter, &gctx->pcounter))
         return 0;
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_H);
-    if (p != NULL
-        && !OSSL_PARAM_get_int(p, &gctx->hindex))
+
+    if (p.h != NULL && !OSSL_PARAM_get_int(p.h, &gctx->hindex))
         return 0;
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_SEED);
-    if (p != NULL
-        && (p->data_type != OSSL_PARAM_OCTET_STRING
-            || !dsa_set_gen_seed(gctx, p->data, p->data_size)))
+
+    if (p.seed != NULL
+        && (p.seed->data_type != OSSL_PARAM_OCTET_STRING
+            || !dsa_set_gen_seed(gctx, p.seed->data, p.seed->data_size)))
         return 0;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_PBITS)) != NULL
-        && !OSSL_PARAM_get_size_t(p, &gctx->pbits))
+
+    if (p.pbits != NULL && !OSSL_PARAM_get_size_t(p.pbits, &gctx->pbits))
         return 0;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_QBITS)) != NULL
-        && !OSSL_PARAM_get_size_t(p, &gctx->qbits))
+
+    if (p.qbits != NULL && !OSSL_PARAM_get_size_t(p.qbits, &gctx->qbits))
         return 0;
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_DIGEST);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
+
+    if (p.digest != NULL) {
+        if (p.digest->data_type != OSSL_PARAM_UTF8_STRING)
             return 0;
         OPENSSL_free(gctx->mdname);
-        gctx->mdname = OPENSSL_strdup(p->data);
+        gctx->mdname = OPENSSL_strdup(p.digest->data);
         if (gctx->mdname == NULL)
             return 0;
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_DIGEST_PROPS);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
+
+    if (p.propq != NULL) {
+        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING)
             return 0;
         OPENSSL_free(gctx->mdprops);
-        gctx->mdprops = OPENSSL_strdup(p->data);
+        gctx->mdprops = OPENSSL_strdup(p.propq->data);
         if (gctx->mdprops == NULL)
             return 0;
     }
@@ -538,31 +575,18 @@ static int dsa_gen_set_params(void *genctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *dsa_gen_settable_params(ossl_unused void *genctx,
     ossl_unused void *provctx)
 {
-    static OSSL_PARAM settable[] = {
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_FFC_TYPE, NULL, 0),
-        OSSL_PARAM_size_t(OSSL_PKEY_PARAM_FFC_PBITS, NULL),
-        OSSL_PARAM_size_t(OSSL_PKEY_PARAM_FFC_QBITS, NULL),
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_FFC_DIGEST, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_FFC_DIGEST_PROPS, NULL, 0),
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_FFC_GINDEX, NULL),
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_FFC_SEED, NULL, 0),
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_FFC_PCOUNTER, NULL),
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_FFC_H, NULL),
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_PKEY_PARAM_FIPS_SIGN_CHECK)
-            OSSL_PARAM_END
-    };
-    return settable;
+    return dsa_gen_set_params_list;
 }

 static int dsa_gen_get_params(void *genctx, OSSL_PARAM *params)
 {
     struct dsa_gen_ctx *gctx = genctx;
+    struct dsa_gen_get_params_st p;

-    if (gctx == NULL)
+    if (gctx == NULL || !dsa_gen_get_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;
-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(gctx, params))
+
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(gctx, p.ind))
         return 0;
     return 1;
 }
@@ -570,12 +594,7 @@ static int dsa_gen_get_params(void *genctx, OSSL_PARAM *params)
 static const OSSL_PARAM *dsa_gen_gettable_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM dsa_gen_gettable_params_table[] = {
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-
-    return dsa_gen_gettable_params_table;
+    return dsa_gen_get_params_list;
 }

 static int dsa_gencb(int p, int n, BN_GENCB *cb)
@@ -607,7 +626,7 @@ static void *dsa_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg)
      */
     if (!OSSL_FIPS_IND_ON_UNAPPROVED(gctx, OSSL_FIPS_IND_SETTABLE0,
             gctx->libctx, "DSA", "Keygen",
-            ossl_fips_config_dsa_sign_disallowed))
+            FIPS_CONFIG_DSA_SIGN_DISABLED))
         return 0;
 #endif

@@ -659,8 +678,8 @@ static void *dsa_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg)
     if ((gctx->selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) {

         if (ossl_dsa_generate_ffc_parameters(dsa, gctx->gen_type,
-                gctx->pbits, gctx->qbits,
-                gencb)
+                (int)gctx->pbits,
+                (int)gctx->qbits, gencb)
             <= 0)
             goto end;
     }
@@ -720,6 +739,7 @@ static void *dsa_dup(const void *keydata_from, int selection)

 const OSSL_DISPATCH ossl_dsa_keymgmt_functions[] = {
     { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))dsa_newdata },
+    { OSSL_FUNC_KEYMGMT_NEW_EX, (void (*)(void))dsa_newdata_ex },
     { OSSL_FUNC_KEYMGMT_GEN_INIT, (void (*)(void))dsa_gen_init },
     { OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE, (void (*)(void))dsa_gen_set_template },
     { OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS, (void (*)(void))dsa_gen_set_params },
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/dsa_kmgmt.inc.in b/deps/openssl/openssl/providers/implementations/keymgmt/dsa_kmgmt.inc.in
new file mode 100644
index 00000000000..ed0d8a0809e
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/dsa_kmgmt.inc.in
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('dsa_get_params',
+                         (['OSSL_PKEY_PARAM_BITS',               'bits',           'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_BITS',      'secbits',        'int'],
+                          ['OSSL_PKEY_PARAM_MAX_SIZE',           'maxsize',        'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_CATEGORY',  'seccat',         'int'],
+                          ['OSSL_PKEY_PARAM_DEFAULT_DIGEST',     'digest',         'utf8_string'],
+                          ['OSSL_PKEY_PARAM_FFC_P',              'ffp.p',          'BN'],
+                          ['OSSL_PKEY_PARAM_FFC_Q',              'ffp.q',          'BN'],
+                          ['OSSL_PKEY_PARAM_FFC_G',              'ffp.g',          'BN'],
+                          ['OSSL_PKEY_PARAM_FFC_COFACTOR',       'ffp.cofactor',   'BN'],
+                          ['OSSL_PKEY_PARAM_FFC_GINDEX',         'ffp.g_index',    'int'],
+                          ['OSSL_PKEY_PARAM_FFC_PCOUNTER',       'ffp.p_counter',  'int'],
+                          ['OSSL_PKEY_PARAM_FFC_H',              'ffp.h',          'int'],
+                          ['OSSL_PKEY_PARAM_FFC_SEED',           'ffp.seed',       'octet_string'],
+                          ['OSSL_PKEY_PARAM_PUB_KEY',            'pubkey',         'BN'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY',           'privkey',        'BN'],
+                         )); -}
+
+{- produce_param_decoder('dsa_gen_set_params',
+                         (['OSSL_PKEY_PARAM_FFC_TYPE',         'type',      'utf8_string'],
+                          ['OSSL_PKEY_PARAM_FFC_PBITS',        'pbits',     'size_t'],
+                          ['OSSL_PKEY_PARAM_FFC_QBITS',        'qbits',     'size_t'],
+                          ['OSSL_PKEY_PARAM_FFC_DIGEST',       'digest',    'utf8_string'],
+                          ['OSSL_PKEY_PARAM_FFC_DIGEST_PROPS', 'propq',     'utf8_string'],
+                          ['OSSL_PKEY_PARAM_FFC_GINDEX',       'g_index',   'int'],
+                          ['OSSL_PKEY_PARAM_FFC_SEED',         'seed',      'octet_string'],
+                          ['OSSL_PKEY_PARAM_FFC_PCOUNTER',     'p_counter', 'int'],
+                          ['OSSL_PKEY_PARAM_FFC_H',            'h',         'int'],
+                          ['OSSL_PKEY_PARAM_FIPS_SIGN_CHECK',  'ind_sign',  'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('dsa_gen_get_params',
+                         (['OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/ec_kmgmt.c b/deps/openssl/openssl/providers/implementations/keymgmt/ec_kmgmt.c
index 1d740307f6a..391cc6b3c6e 100644
--- a/deps/openssl/openssl/providers/implementations/keymgmt/ec_kmgmt.c
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/ec_kmgmt.c
@@ -23,6 +23,7 @@
 #include <openssl/self_test.h>
 #include "crypto/bn.h"
 #include "crypto/ec.h"
+#include "crypto/ec_params.h"
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
 #include "prov/provider_ctx.h"
@@ -37,6 +38,7 @@
 #endif

 static OSSL_FUNC_keymgmt_new_fn ec_newdata;
+static OSSL_FUNC_keymgmt_new_ex_fn ec_newdata_ex;
 static OSSL_FUNC_keymgmt_gen_init_fn ec_gen_init;
 static OSSL_FUNC_keymgmt_gen_set_template_fn ec_gen_set_template;
 static OSSL_FUNC_keymgmt_gen_set_params_fn ec_gen_set_params;
@@ -64,12 +66,18 @@ static OSSL_FUNC_keymgmt_dup_fn ec_dup;
 #ifndef OPENSSL_NO_SM2
 static OSSL_FUNC_keymgmt_new_fn sm2_newdata;
 static OSSL_FUNC_keymgmt_gen_init_fn sm2_gen_init;
+static OSSL_FUNC_keymgmt_gen_set_params_fn sm2_gen_set_params;
+static OSSL_FUNC_keymgmt_gen_settable_params_fn sm2_gen_settable_params;
 static OSSL_FUNC_keymgmt_gen_fn sm2_gen;
 static OSSL_FUNC_keymgmt_get_params_fn sm2_get_params;
 static OSSL_FUNC_keymgmt_gettable_params_fn sm2_gettable_params;
 static OSSL_FUNC_keymgmt_settable_params_fn sm2_settable_params;
+static OSSL_FUNC_keymgmt_set_params_fn sm2_set_params;
 static OSSL_FUNC_keymgmt_import_fn sm2_import;
+static OSSL_FUNC_keymgmt_import_types_fn sm2_import_types;
+static OSSL_FUNC_keymgmt_export_types_fn sm2_export_types;
 static OSSL_FUNC_keymgmt_query_operation_name_fn sm2_query_operation_name;
+static OSSL_FUNC_keymgmt_query_operation_name_fn curve_sm2_query_operation_name;
 static OSSL_FUNC_keymgmt_validate_fn sm2_validate;
 #endif
 #endif
@@ -90,8 +98,7 @@ static const char *ec_query_operation_name(int operation_id)
     return NULL;
 }

-#ifndef FIPS_MODULE
-#ifndef OPENSSL_NO_SM2
+#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_SM2)
 static const char *sm2_query_operation_name(int operation_id)
 {
     switch (operation_id) {
@@ -100,7 +107,14 @@ static const char *sm2_query_operation_name(int operation_id)
     }
     return NULL;
 }
-#endif
+static const char *curve_sm2_query_operation_name(int operation_id)
+{
+    switch (operation_id) {
+    case OSSL_OP_KEYEXCH:
+        return "ECDH";
+    }
+    return NULL;
+}
 #endif

 /*
@@ -111,7 +125,7 @@ static const char *sm2_query_operation_name(int operation_id)
  * parameters are exported separately.
  */
 static ossl_inline int key_to_params(const EC_KEY *eckey, OSSL_PARAM_BLD *tmpl,
-    OSSL_PARAM params[], int include_private,
+    const EC_PARAMS *params, int include_private,
     unsigned char **pub_key)
 {
     BIGNUM *x = NULL, *y = NULL;
@@ -140,10 +154,10 @@ static ossl_inline int key_to_params(const EC_KEY *eckey, OSSL_PARAM_BLD *tmpl,
             goto err;

         /* If we are doing a get then check first before decoding the point */
-        if (tmpl == NULL) {
-            p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_PUB_KEY);
-            px = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_EC_PUB_X);
-            py = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_EC_PUB_Y);
+        if (tmpl == NULL && params != NULL) {
+            p = params->pub;
+            px = params->pub_x;
+            py = params->pub_y;
         }

         if (p != NULL || tmpl != NULL) {
@@ -226,7 +240,8 @@ static ossl_inline int key_to_params(const EC_KEY *eckey, OSSL_PARAM_BLD *tmpl,
             goto err;
         sz = (ecbits + 7) / 8;

-        if (!ossl_param_build_set_bn_pad(tmpl, params,
+        if (!ossl_param_build_set_bn_pad(tmpl,
+                params == NULL ? NULL : params->priv,
                 OSSL_PKEY_PARAM_PRIV_KEY,
                 priv_key, sz))
             goto err;
@@ -238,47 +253,76 @@ err:
 }

 static ossl_inline int otherparams_to_params(const EC_KEY *ec, OSSL_PARAM_BLD *tmpl,
-    OSSL_PARAM params[])
+    const EC_PARAMS *params)
 {
     int ecdh_cofactor_mode = 0, group_check = 0;
     const char *name = NULL;
-    point_conversion_form_t format;

     if (ec == NULL)
         return 0;

-    format = EC_KEY_get_conv_form(ec);
-    name = ossl_ec_pt_format_id2name((int)format);
-    if (name != NULL
-        && !ossl_param_build_set_utf8_string(tmpl, params,
-            OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT,
-            name))
-        return 0;
-
     group_check = EC_KEY_get_flags(ec) & EC_FLAG_CHECK_NAMED_GROUP_MASK;
     name = ossl_ec_check_group_type_id2name(group_check);
     if (name != NULL
-        && !ossl_param_build_set_utf8_string(tmpl, params,
+        && !ossl_param_build_set_utf8_string(tmpl,
+            params == NULL ? NULL : params->group_check,
             OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE,
             name))
         return 0;

     if ((EC_KEY_get_enc_flags(ec) & EC_PKEY_NO_PUBKEY) != 0
-        && !ossl_param_build_set_int(tmpl, params,
+        && !ossl_param_build_set_int(tmpl,
+            params == NULL ? NULL : params->include_public,
             OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, 0))
         return 0;

     ecdh_cofactor_mode = (EC_KEY_get_flags(ec) & EC_FLAG_COFACTOR_ECDH) ? 1 : 0;
-    return ossl_param_build_set_int(tmpl, params,
+    return ossl_param_build_set_int(tmpl,
+        params == NULL ? NULL : params->use_cofactor,
         OSSL_PKEY_PARAM_USE_COFACTOR_ECDH,
         ecdh_cofactor_mode);
 }

-static void *ec_newdata(void *provctx)
+static void *ec_newdata_ex(void *provctx, const OSSL_PARAM params[])
 {
+    EC_KEY *eckey = NULL;
+    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
+
     if (!ossl_prov_is_running())
         return NULL;
-    return EC_KEY_new_ex(PROV_LIBCTX_OF(provctx), NULL);
+
+#ifndef FIPS_MODULE
+    const OSSL_PARAM *p = NULL;
+
+    if (params != NULL)
+        p = OSSL_PARAM_locate_const(params, "legacy-object");
+
+    /*
+     * This only works because we are in the default provider. We are not
+     * normally allowed to pass complex objects across the provider boundary
+     * like this.
+     */
+    if (p != NULL && OSSL_PARAM_get_octet_ptr(p, (const void **)&eckey, NULL) && eckey != NULL) {
+#ifdef OPENSSL_NO_EC_EXPLICIT_CURVES
+        if (EC_GROUP_check_named_curve(EC_KEY_get0_group(eckey), 0, NULL) == NID_undef)
+            return NULL;
+#endif
+        if (ossl_lib_ctx_get_concrete(ossl_ec_key_get_libctx(eckey)) != ossl_lib_ctx_get_concrete(libctx))
+            eckey = NULL;
+        else if (!EC_KEY_up_ref(eckey))
+            return NULL;
+    }
+#endif
+
+    if (eckey == NULL)
+        eckey = EC_KEY_new_ex(libctx, NULL);
+
+    return eckey;
+}
+
+static void *ec_newdata(void *provctx)
+{
+    return ec_newdata_ex(provctx, NULL);
 }

 #ifndef FIPS_MODULE
@@ -382,10 +426,47 @@ static int common_check_sm2(const EC_KEY *ec, int sm2_wanted)
     return 1;
 }

+typedef int (*ec_import_decoder_fn)(const OSSL_PARAM *, EC_PARAMS *);
+
+static const ec_import_decoder_fn ec_import_decoders[] = {
+    NULL,
+    ec_imexport_types_1_decoder,
+    ec_imexport_types_2_decoder,
+    ec_imexport_types_3_decoder,
+    ec_imexport_types_4_decoder,
+    ec_imexport_types_5_decoder,
+    ec_imexport_types_6_decoder,
+    ec_imexport_types_7_decoder,
+    ec_imexport_types_8_decoder,
+    ec_imexport_types_9_decoder,
+    ec_imexport_types_10_decoder,
+    ec_imexport_types_11_decoder,
+    ec_imexport_types_12_decoder,
+    ec_imexport_types_13_decoder,
+    ec_imexport_types_14_decoder,
+    ec_imexport_types_15_decoder,
+};
+
+static int ec_imexport_type_select(int selection)
+{
+    int type_select = 0;
+
+    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
+        type_select += 1;
+    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
+        type_select += 2;
+    if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
+        type_select += 4;
+    if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0)
+        type_select += 8;
+    return type_select;
+}
+
 static int common_import(void *keydata, int selection, const OSSL_PARAM params[],
-    int sm2_wanted)
+    const ec_import_decoder_fn decoders[], int sm2_wanted)
 {
     EC_KEY *ec = keydata;
+    EC_PARAMS p;
     int ok = 1;

     if (!ossl_prov_is_running() || ec == NULL)
@@ -407,7 +488,10 @@ static int common_import(void *keydata, int selection, const OSSL_PARAM params[]
     if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) == 0)
         return 0;

-    ok = ok && ossl_ec_group_fromdata(ec, params);
+    if (!decoders[ec_imexport_type_select(selection)](params, &p))
+        return 0;
+
+    ok = ok && ossl_ec_group_fromdata_parsed(ec, &p);

     if (!common_check_sm2(ec, sm2_wanted))
         return 0;
@@ -415,24 +499,24 @@ static int common_import(void *keydata, int selection, const OSSL_PARAM params[]
     if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
         int include_private = selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY ? 1 : 0;

-        ok = ok && ossl_ec_key_fromdata(ec, params, include_private);
+        ok = ok && ossl_ec_key_fromdata_parsed(ec, &p, include_private);
     }
     if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0)
-        ok = ok && ossl_ec_key_otherparams_fromdata(ec, params);
+        ok = ok && ossl_ec_key_otherparams_fromdata_parsed(ec, &p);

     return ok;
 }

 static int ec_import(void *keydata, int selection, const OSSL_PARAM params[])
 {
-    return common_import(keydata, selection, params, 0);
+    return common_import(keydata, selection, params, ec_import_decoders, 0);
 }

 #ifndef FIPS_MODULE
 #ifndef OPENSSL_NO_SM2
 static int sm2_import(void *keydata, int selection, const OSSL_PARAM params[])
 {
-    return common_import(keydata, selection, params, 1);
+    return common_import(keydata, selection, params, ec_import_decoders, 1);
 }
 #endif
 #endif
@@ -469,19 +553,21 @@ static int ec_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
         && (selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) == 0)
         return 0;

-    tmpl = OSSL_PARAM_BLD_new();
-    if (tmpl == NULL)
+    if ((bnctx = BN_CTX_new_ex(ossl_ec_key_get_libctx(ec))) == NULL)
         return 0;
+    BN_CTX_start(bnctx);

-    if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) {
-        bnctx = BN_CTX_new_ex(ossl_ec_key_get_libctx(ec));
-        if (bnctx == NULL) {
-            ok = 0;
-            goto end;
-        }
-        BN_CTX_start(bnctx);
-        ok = ok && ossl_ec_group_todata(EC_KEY_get0_group(ec), tmpl, NULL, ossl_ec_key_get_libctx(ec), ossl_ec_key_get0_propq(ec), bnctx, &genbuf);
+    if ((tmpl = OSSL_PARAM_BLD_new()) == NULL) {
+        ok = 0;
+        goto end;
     }
+    /*
+     * OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT is added based on the group's
+     * asn1_form by the call below.
+     */
+    ok = ossl_ec_group_todata(EC_KEY_get0_group(ec), tmpl, NULL,
+        ossl_ec_key_get_libctx(ec), ossl_ec_key_get0_propq(ec),
+        bnctx, &genbuf);

     if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
         int include_private = selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY ? 1 : 0;
@@ -497,7 +583,7 @@ static int ec_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
     }

     ok = param_cb(params, cbarg);
-    OSSL_PARAM_free(params);
+    OSSL_PARAM_clear_free(params);
 end:
     OSSL_PARAM_BLD_free(tmpl);
     OPENSSL_free(pub_key);
@@ -508,64 +594,48 @@ end:
 }

 /* IMEXPORT = IMPORT + EXPORT */
+static const OSSL_PARAM *const ec_types[] = {
+    NULL,
+    ec_imexport_types_1_list,
+    ec_imexport_types_2_list,
+    ec_imexport_types_3_list,
+    ec_imexport_types_4_list,
+    ec_imexport_types_5_list,
+    ec_imexport_types_6_list,
+    ec_imexport_types_7_list,
+    ec_imexport_types_8_list,
+    ec_imexport_types_9_list,
+    ec_imexport_types_10_list,
+    ec_imexport_types_11_list,
+    ec_imexport_types_12_list,
+    ec_imexport_types_13_list,
+    ec_imexport_types_14_list,
+    ec_imexport_types_15_list,
+};

-#define EC_IMEXPORTABLE_DOM_PARAMETERS                                               \
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME, NULL, 0),                     \
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_ENCODING, NULL, 0),                \
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT, NULL, 0), \
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_FIELD_TYPE, NULL, 0),              \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_P, NULL, 0),                                \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_A, NULL, 0),                                \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_B, NULL, 0),                                \
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_EC_GENERATOR, NULL, 0),              \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_ORDER, NULL, 0),                            \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_COFACTOR, NULL, 0),                         \
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_EC_SEED, NULL, 0),                   \
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS, NULL)
-
-#define EC_IMEXPORTABLE_PUBLIC_KEY \
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PUB_KEY, NULL, 0)
-#define EC_IMEXPORTABLE_PRIVATE_KEY \
-    OSSL_PARAM_BN(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0)
-#define EC_IMEXPORTABLE_OTHER_PARAMETERS                     \
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_USE_COFACTOR_ECDH, NULL), \
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, NULL)
-
-/*
- * Include all the possible combinations of OSSL_PARAM arrays for
- * ec_imexport_types().
- *
- * They are in a separate file as it is ~100 lines of unreadable and
- * uninteresting machine generated stuff.
- */
-#include "ec_kmgmt_imexport.inc"
-
-static ossl_inline const OSSL_PARAM *ec_imexport_types(int selection)
+static const OSSL_PARAM *ec_import_types(int selection)
 {
-    int type_select = 0;
+    return ec_types[ec_imexport_type_select(selection)];
+}

-    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
-        type_select += 1;
-    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
-        type_select += 2;
-    if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
-        type_select += 4;
-    if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0)
-        type_select += 8;
-    return ec_types[type_select];
+static const OSSL_PARAM *ec_export_types(int selection)
+{
+    return ec_types[ec_imexport_type_select(selection)];
 }

-static const OSSL_PARAM *ec_import_types(int selection)
+#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_SM2)
+static const OSSL_PARAM *sm2_import_types(int selection)
 {
-    return ec_imexport_types(selection);
+    return ec_types[ec_imexport_type_select(selection)];
 }

-static const OSSL_PARAM *ec_export_types(int selection)
+static const OSSL_PARAM *sm2_export_types(int selection)
 {
-    return ec_imexport_types(selection);
+    return ec_types[ec_imexport_type_select(selection)];
 }
+#endif

-static int ec_get_ecm_params(const EC_GROUP *group, OSSL_PARAM params[])
+static int ec_get_ecm_params(const EC_GROUP *group, const EC_PARAMS *params)
 {
 #ifdef OPENSSL_NO_EC2M
     return 1;
@@ -588,25 +658,26 @@ static int ec_get_ecm_params(const EC_GROUP *group, OSSL_PARAM params[])
         goto err;

     m = EC_GROUP_get_degree(group);
-    if (!ossl_param_build_set_int(NULL, params, OSSL_PKEY_PARAM_EC_CHAR2_M, m)
-        || !ossl_param_build_set_utf8_string(NULL, params,
+    if (!ossl_param_build_set_int(NULL, params->char2_m,
+            OSSL_PKEY_PARAM_EC_CHAR2_M, m)
+        || !ossl_param_build_set_utf8_string(NULL, params->char2_type,
             OSSL_PKEY_PARAM_EC_CHAR2_TYPE,
             basis_name))
         goto err;

     if (basis_nid == NID_X9_62_tpBasis) {
         if (!EC_GROUP_get_trinomial_basis(group, &k1)
-            || !ossl_param_build_set_int(NULL, params,
+            || !ossl_param_build_set_int(NULL, params->char2_tp,
                 OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS,
                 (int)k1))
             goto err;
     } else {
         if (!EC_GROUP_get_pentanomial_basis(group, &k1, &k2, &k3)
-            || !ossl_param_build_set_int(NULL, params,
+            || !ossl_param_build_set_int(NULL, params->char2_k1,
                 OSSL_PKEY_PARAM_EC_CHAR2_PP_K1, (int)k1)
-            || !ossl_param_build_set_int(NULL, params,
+            || !ossl_param_build_set_int(NULL, params->char2_k2,
                 OSSL_PKEY_PARAM_EC_CHAR2_PP_K2, (int)k2)
-            || !ossl_param_build_set_int(NULL, params,
+            || !ossl_param_build_set_int(NULL, params->char2_k3,
                 OSSL_PKEY_PARAM_EC_CHAR2_PP_K3, (int)k3))
             goto err;
     }
@@ -620,8 +691,8 @@ static int common_get_params(void *key, OSSL_PARAM params[], int sm2)
 {
     int ret = 0;
     EC_KEY *eck = key;
+    EC_PARAMS p;
     const EC_GROUP *ecg = NULL;
-    OSSL_PARAM *p;
     unsigned char *pub_key = NULL, *genbuf = NULL;
     OSSL_LIB_CTX *libctx;
     const char *propq;
@@ -632,6 +703,9 @@ static int common_get_params(void *key, OSSL_PARAM params[], int sm2)
         ERR_raise(ERR_LIB_PROV, PROV_R_NO_PARAMETERS_SET);
         return 0;
     }
+    if (!(sm2 ? sm2_get_params_decoder(params, &p)
+              : ec_get_params_decoder(params, &p)))
+        return 0;

     libctx = ossl_ec_key_get_libctx(eck);
     propq = ossl_ec_key_get0_propq(eck);
@@ -641,103 +715,69 @@ static int common_get_params(void *key, OSSL_PARAM params[], int sm2)
         return 0;
     BN_CTX_start(bnctx);

-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
-        && !OSSL_PARAM_set_int(p, ECDSA_size(eck)))
+    if (p.maxsize != NULL && !OSSL_PARAM_set_int(p.maxsize, ECDSA_size(eck)))
         goto err;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
-        && !OSSL_PARAM_set_int(p, EC_GROUP_order_bits(ecg)))
+    if (p.bits != NULL && !OSSL_PARAM_set_int(p.bits, EC_GROUP_order_bits(ecg)))
         goto err;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL) {
-        int ecbits, sec_bits;
-
-        ecbits = EC_GROUP_order_bits(ecg);
-
-        /*
-         * The following estimates are based on the values published
-         * in Table 2 of "NIST Special Publication 800-57 Part 1 Revision 4"
-         * at http://dx.doi.org/10.6028/NIST.SP.800-57pt1r4 .
-         *
-         * Note that the above reference explicitly categorizes algorithms in a
-         * discrete set of values {80, 112, 128, 192, 256}, and that it is
-         * relevant only for NIST approved Elliptic Curves, while OpenSSL
-         * applies the same logic also to other curves.
-         *
-         * Classifications produced by other standardazing bodies might differ,
-         * so the results provided for "bits of security" by this provider are
-         * to be considered merely indicative, and it is the users'
-         * responsibility to compare these values against the normative
-         * references that may be relevant for their intent and purposes.
-         */
-        if (ecbits >= 512)
-            sec_bits = 256;
-        else if (ecbits >= 384)
-            sec_bits = 192;
-        else if (ecbits >= 256)
-            sec_bits = 128;
-        else if (ecbits >= 224)
-            sec_bits = 112;
-        else if (ecbits >= 160)
-            sec_bits = 80;
-        else
-            sec_bits = ecbits / 2;
-
-        if (!OSSL_PARAM_set_int(p, sec_bits))
+    if (p.field_degree != NULL
+        && !OSSL_PARAM_set_int(p.field_degree, EC_GROUP_get_degree(ecg)))
+        goto err;
+    if (p.secbits != NULL
+        && !OSSL_PARAM_set_int(p.secbits, EC_GROUP_security_bits(ecg)))
+        goto err;
+    if (p.seccat != NULL)
+        if (!OSSL_PARAM_set_int(p.seccat, 0))
             goto err;
-    }

-    if ((p = OSSL_PARAM_locate(params,
-             OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS))
-        != NULL) {
+    if (p.decoded != NULL) {
         int explicitparams = EC_KEY_decoded_from_explicit_params(eck);

-        if (explicitparams < 0
-            || !OSSL_PARAM_set_int(p, explicitparams))
+        if (explicitparams < 0 || !OSSL_PARAM_set_int(p.decoded, explicitparams))
             goto err;
     }

     if (!sm2) {
-        if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
-            && !OSSL_PARAM_set_utf8_string(p, EC_DEFAULT_MD))
+        if (p.default_digest != NULL
+            && !OSSL_PARAM_set_utf8_string(p.default_digest, EC_DEFAULT_MD))
             goto err;
     } else {
-        if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
-            && !OSSL_PARAM_set_utf8_string(p, SM2_DEFAULT_MD))
+        if (p.default_digest != NULL
+            && !OSSL_PARAM_set_utf8_string(p.default_digest, SM2_DEFAULT_MD))
             goto err;
     }

     /* SM2 doesn't support this PARAM */
-    if (!sm2) {
-        p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_USE_COFACTOR_ECDH);
-        if (p != NULL) {
-            int ecdh_cofactor_mode = 0;
+    if (!sm2 && p.use_cofactor != NULL) {
+        int ecdh_cofactor_mode = 0;

-            ecdh_cofactor_mode = (EC_KEY_get_flags(eck) & EC_FLAG_COFACTOR_ECDH) ? 1 : 0;
+        ecdh_cofactor_mode = (EC_KEY_get_flags(eck) & EC_FLAG_COFACTOR_ECDH) ? 1 : 0;

-            if (!OSSL_PARAM_set_int(p, ecdh_cofactor_mode))
-                goto err;
-        }
+        if (!OSSL_PARAM_set_int(p.use_cofactor, ecdh_cofactor_mode))
+            goto err;
     }
-    if ((p = OSSL_PARAM_locate(params,
-             OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY))
-        != NULL) {
+    if (p.encoded_pub != NULL) {
         const EC_POINT *ecp = EC_KEY_get0_public_key(key);

         if (ecp == NULL) {
             ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY);
             goto err;
         }
-        p->return_size = EC_POINT_point2oct(ecg, ecp,
+        p.encoded_pub->return_size = EC_POINT_point2oct(ecg, ecp,
             POINT_CONVERSION_UNCOMPRESSED,
-            p->data, p->data_size, bnctx);
-        if (p->return_size == 0)
+            p.encoded_pub->data, p.encoded_pub->data_size, bnctx);
+        if (p.encoded_pub->return_size == 0)
             goto err;
     }

-    ret = ec_get_ecm_params(ecg, params)
-        && ossl_ec_group_todata(ecg, NULL, params, libctx, propq, bnctx,
+    /*
+     * OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT is added based on the group's
+     * asn1_form by ossl_ec_group_todata() below.
+     */
+    ret = ec_get_ecm_params(ecg, &p)
+        && ossl_ec_group_todata_parsed(ecg, NULL, &p, libctx, propq, bnctx,
             &genbuf)
-        && key_to_params(eck, NULL, params, 1, &pub_key)
-        && otherparams_to_params(eck, NULL, params);
+        && key_to_params(eck, NULL, &p, 1, &pub_key)
+        && otherparams_to_params(eck, NULL, &p);
 err:
     OPENSSL_free(genbuf);
     OPENSSL_free(pub_key);
@@ -751,84 +791,55 @@ static int ec_get_params(void *key, OSSL_PARAM params[])
     return common_get_params(key, params, 0);
 }

-#ifndef OPENSSL_NO_EC2M
-#define EC2M_GETTABLE_DOM_PARAMS                                        \
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_CHAR2_M, NULL),                   \
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_CHAR2_TYPE, NULL, 0), \
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS, NULL),        \
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_CHAR2_PP_K1, NULL),           \
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_CHAR2_PP_K2, NULL),           \
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_CHAR2_PP_K3, NULL),
-#else
-#define EC2M_GETTABLE_DOM_PARAMS
-#endif
-
-static const OSSL_PARAM ec_known_gettable_params[] = {
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_DEFAULT_DIGEST, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS, NULL),
-    EC_IMEXPORTABLE_DOM_PARAMETERS,
-    EC2M_GETTABLE_DOM_PARAMS
-        EC_IMEXPORTABLE_PUBLIC_KEY,
-    OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_PUB_X, NULL, 0),
-    OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_PUB_Y, NULL, 0),
-    EC_IMEXPORTABLE_PRIVATE_KEY,
-    EC_IMEXPORTABLE_OTHER_PARAMETERS,
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *ec_gettable_params(void *provctx)
 {
-    return ec_known_gettable_params;
+    return ec_get_params_list;
 }

-static const OSSL_PARAM ec_known_settable_params[] = {
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_USE_COFACTOR_ECDH, NULL),
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_ENCODING, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_EC_SEED, NULL, 0),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, NULL),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *ec_settable_params(void *provctx)
 {
-    return ec_known_settable_params;
+    return ec_set_params_list;
 }

-static int ec_set_params(void *key, const OSSL_PARAM params[])
+static int common_set_params(void *key, const EC_PARAMS *params)
 {
     EC_KEY *eck = key;
-    const OSSL_PARAM *p;

     if (key == NULL)
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    if (!ossl_ec_group_set_params((EC_GROUP *)EC_KEY_get0_group(key), params))
+    if (!ossl_ec_group_set_params_parsed(
+            (EC_GROUP *)EC_KEY_get0_group(key), params))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY);
-    if (p != NULL) {
+    if (params->encoded_pub != NULL) {
         BN_CTX *ctx = BN_CTX_new_ex(ossl_ec_key_get_libctx(key));
         int ret = 1;

         if (ctx == NULL
-            || p->data_type != OSSL_PARAM_OCTET_STRING
-            || !EC_KEY_oct2key(key, p->data, p->data_size, ctx))
+            || params->encoded_pub->data_type != OSSL_PARAM_OCTET_STRING
+            || !EC_KEY_oct2key(key, params->encoded_pub->data,
+                params->encoded_pub->data_size, ctx))
             ret = 0;
         BN_CTX_free(ctx);
         if (!ret)
             return 0;
     }

-    return ossl_ec_key_otherparams_fromdata(eck, params);
+    return ossl_ec_key_otherparams_fromdata_parsed(eck, params);
+}
+
+static int ec_set_params(void *key, const OSSL_PARAM params[])
+{
+    EC_PARAMS p;
+
+    if (key == NULL)
+        return 0;
+    if (ossl_param_is_empty(params))
+        return 1;
+    if (!ec_set_params_decoder(params, &p))
+        return 0;
+    return common_set_params(key, &p);
 }

 #ifndef FIPS_MODULE
@@ -838,34 +849,27 @@ static int sm2_get_params(void *key, OSSL_PARAM params[])
     return common_get_params(key, params, 1);
 }

-static const OSSL_PARAM sm2_known_gettable_params[] = {
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_DEFAULT_DIGEST, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS, NULL),
-    EC_IMEXPORTABLE_DOM_PARAMETERS,
-    EC_IMEXPORTABLE_PUBLIC_KEY,
-    OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_PUB_X, NULL, 0),
-    OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_PUB_Y, NULL, 0),
-    EC_IMEXPORTABLE_PRIVATE_KEY,
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *sm2_gettable_params(ossl_unused void *provctx)
 {
-    return sm2_known_gettable_params;
+    return sm2_get_params_list;
 }

-static const OSSL_PARAM sm2_known_settable_params[] = {
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *sm2_settable_params(ossl_unused void *provctx)
 {
-    return sm2_known_settable_params;
+    return sm2_set_params_list;
+}
+
+static int sm2_set_params(void *key, const OSSL_PARAM params[])
+{
+    EC_PARAMS p;
+
+    if (key == NULL)
+        return 0;
+    if (ossl_param_is_empty(params))
+        return 1;
+    if (!sm2_set_params_decoder(params, &p))
+        return 0;
+    return common_set_params(key, &p);
 }

 static int sm2_validate(const void *keydata, int selection, int checktype)
@@ -993,15 +997,18 @@ static void *ec_gen_init(void *provctx, int selection,
 static void *sm2_gen_init(void *provctx, int selection,
     const OSSL_PARAM params[])
 {
-    struct ec_gen_ctx *gctx = ec_gen_init(provctx, selection, params);
+    struct ec_gen_ctx *gctx = ec_gen_init(provctx, selection, NULL);

     if (gctx != NULL) {
+        if (!sm2_gen_set_params(gctx, params))
+            goto err;
         if (gctx->group_name != NULL)
             return gctx;
         if ((gctx->group_name = OPENSSL_strdup("sm2")) != NULL)
             return gctx;
-        ec_gen_cleanup(gctx);
     }
+err:
+    ec_gen_cleanup(gctx);
     return NULL;
 }
 #endif
@@ -1035,79 +1042,96 @@ static int ec_gen_set_template(void *genctx, void *templ)
     return ec_gen_set_group(gctx, ec_group);
 }

-#define COPY_INT_PARAM(params, key, val)           \
-    p = OSSL_PARAM_locate_const(params, key);      \
-    if (p != NULL && !OSSL_PARAM_get_int(p, &val)) \
+#define COPY_INT_PARAM(param, val)                           \
+    if ((param) != NULL && !OSSL_PARAM_get_int(param, &val)) \
         goto err;

-#define COPY_UTF8_PARAM(params, key, val)           \
-    p = OSSL_PARAM_locate_const(params, key);       \
-    if (p != NULL) {                                \
-        if (p->data_type != OSSL_PARAM_UTF8_STRING) \
-            goto err;                               \
-        OPENSSL_free(val);                          \
-        val = OPENSSL_strdup(p->data);              \
-        if (val == NULL)                            \
-            goto err;                               \
+#define COPY_UTF8_PARAM(param, val)                       \
+    if ((param) != NULL) {                                \
+        if ((param)->data_type != OSSL_PARAM_UTF8_STRING) \
+            goto err;                                     \
+        OPENSSL_free(val);                                \
+        val = OPENSSL_strdup((param)->data);              \
+        if (val == NULL)                                  \
+            goto err;                                     \
     }

-#define COPY_OCTET_PARAM(params, key, val, len)      \
-    p = OSSL_PARAM_locate_const(params, key);        \
-    if (p != NULL) {                                 \
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) \
-            goto err;                                \
-        OPENSSL_free(val);                           \
-        len = p->data_size;                          \
-        val = OPENSSL_memdup(p->data, p->data_size); \
-        if (val == NULL)                             \
-            goto err;                                \
+#define COPY_OCTET_PARAM(param, val, len)                        \
+    if ((param) != NULL) {                                       \
+        if ((param)->data_type != OSSL_PARAM_OCTET_STRING)       \
+            goto err;                                            \
+        OPENSSL_free(val);                                       \
+        len = (param)->data_size;                                \
+        val = OPENSSL_memdup((param)->data, (param)->data_size); \
+        if (val == NULL)                                         \
+            goto err;                                            \
     }

-#define COPY_BN_PARAM(params, key, bn)                \
-    p = OSSL_PARAM_locate_const(params, key);         \
-    if (p != NULL) {                                  \
-        if (bn == NULL)                               \
-            bn = BN_new();                            \
-        if (bn == NULL || !OSSL_PARAM_get_BN(p, &bn)) \
-            goto err;                                 \
+#define COPY_BN_PARAM(param, bn)                          \
+    if ((param) != NULL) {                                \
+        if (bn == NULL)                                   \
+            bn = BN_new();                                \
+        if (bn == NULL || !OSSL_PARAM_get_BN(param, &bn)) \
+            goto err;                                     \
     }

-static int ec_gen_set_params(void *genctx, const OSSL_PARAM params[])
+static int ec_gen_set_params_parsed(struct ec_gen_ctx *gctx,
+    const EC_PARAMS *p)
 {
     int ret = 0;
-    struct ec_gen_ctx *gctx = genctx;
-    const OSSL_PARAM *p;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(gctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_PKEY_PARAM_FIPS_KEY_CHECK))
+    if (gctx == NULL || p == NULL)
+        goto err;
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(gctx, OSSL_FIPS_IND_SETTABLE0,
+            p->fips_key_check))
         goto err;

-    COPY_INT_PARAM(params, OSSL_PKEY_PARAM_USE_COFACTOR_ECDH, gctx->ecdh_mode);
+    COPY_INT_PARAM(p->use_cofactor, gctx->ecdh_mode);

-    COPY_UTF8_PARAM(params, OSSL_PKEY_PARAM_GROUP_NAME, gctx->group_name);
-    COPY_UTF8_PARAM(params, OSSL_PKEY_PARAM_EC_FIELD_TYPE, gctx->field_type);
-    COPY_UTF8_PARAM(params, OSSL_PKEY_PARAM_EC_ENCODING, gctx->encoding);
-    COPY_UTF8_PARAM(params, OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT, gctx->pt_format);
-    COPY_UTF8_PARAM(params, OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE, gctx->group_check);
+    COPY_UTF8_PARAM(p->group_name, gctx->group_name);
+    COPY_UTF8_PARAM(p->field_type, gctx->field_type);
+    COPY_UTF8_PARAM(p->encoding, gctx->encoding);
+    COPY_UTF8_PARAM(p->pt_format, gctx->pt_format);
+    COPY_UTF8_PARAM(p->group_check, gctx->group_check);

-    COPY_BN_PARAM(params, OSSL_PKEY_PARAM_EC_P, gctx->p);
-    COPY_BN_PARAM(params, OSSL_PKEY_PARAM_EC_A, gctx->a);
-    COPY_BN_PARAM(params, OSSL_PKEY_PARAM_EC_B, gctx->b);
-    COPY_BN_PARAM(params, OSSL_PKEY_PARAM_EC_ORDER, gctx->order);
-    COPY_BN_PARAM(params, OSSL_PKEY_PARAM_EC_COFACTOR, gctx->cofactor);
+    COPY_BN_PARAM(p->p, gctx->p);
+    COPY_BN_PARAM(p->a, gctx->a);
+    COPY_BN_PARAM(p->b, gctx->b);
+    COPY_BN_PARAM(p->order, gctx->order);
+    COPY_BN_PARAM(p->cofactor, gctx->cofactor);

-    COPY_OCTET_PARAM(params, OSSL_PKEY_PARAM_EC_SEED, gctx->seed, gctx->seed_len);
-    COPY_OCTET_PARAM(params, OSSL_PKEY_PARAM_EC_GENERATOR, gctx->gen,
-        gctx->gen_len);
+    COPY_OCTET_PARAM(p->seed, gctx->seed, gctx->seed_len);
+    COPY_OCTET_PARAM(p->generator, gctx->gen, gctx->gen_len);

-    COPY_OCTET_PARAM(params, OSSL_PKEY_PARAM_DHKEM_IKM, gctx->dhkem_ikm,
-        gctx->dhkem_ikmlen);
+    COPY_OCTET_PARAM(p->dhkem_ikm, gctx->dhkem_ikm, gctx->dhkem_ikmlen);

     ret = 1;
 err:
     return ret;
 }

+static int ec_gen_set_params(void *genctx, const OSSL_PARAM params[])
+{
+    EC_PARAMS p;
+
+    if (!ec_gen_set_params_decoder(params, &p))
+        return 0;
+    return ec_gen_set_params_parsed(genctx, &p);
+}
+
+#ifndef FIPS_MODULE
+#ifndef OPENSSL_NO_SM2
+static int sm2_gen_set_params(void *genctx, const OSSL_PARAM params[])
+{
+    EC_PARAMS p;
+
+    if (!sm2_gen_set_params_decoder(params, &p))
+        return 0;
+    return ec_gen_set_params_parsed(genctx, &p);
+}
+#endif
+#endif
+
 static int ec_gen_set_group_from_params(struct ec_gen_ctx *gctx)
 {
     int ret = 0;
@@ -1188,44 +1212,34 @@ err:
 static const OSSL_PARAM *ec_gen_settable_params(ossl_unused void *genctx,
     ossl_unused void *provctx)
 {
-    static OSSL_PARAM settable[] = {
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME, NULL, 0),
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_USE_COFACTOR_ECDH, NULL),
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_ENCODING, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_FIELD_TYPE, NULL, 0),
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_P, NULL, 0),
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_A, NULL, 0),
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_B, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_EC_GENERATOR, NULL, 0),
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_ORDER, NULL, 0),
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_COFACTOR, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_EC_SEED, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_DHKEM_IKM, NULL, 0),
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_PKEY_PARAM_FIPS_KEY_CHECK)
-            OSSL_PARAM_END
-    };
-    return settable;
+    return ec_gen_set_params_list;
+}
+
+#ifndef FIPS_MODULE
+#ifndef OPENSSL_NO_SM2
+static const OSSL_PARAM *sm2_gen_settable_params(ossl_unused void *genctx,
+    ossl_unused void *provctx)
+{
+    return sm2_gen_set_params_list;
 }
+#endif
+#endif

 static const OSSL_PARAM *ec_gen_gettable_params(ossl_unused void *genctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_ec_gen_gettable_ctx_params[] = {
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_ec_gen_gettable_ctx_params;
+    return ec_gen_get_params_list;
 }

 static int ec_gen_get_params(void *genctx, OSSL_PARAM *params)
 {
     struct ec_gen_ctx *gctx = genctx;
+    EC_PARAMS p;

-    if (gctx == NULL)
+    if (gctx == NULL || !ec_gen_get_params_decoder(params, &p))
         return 0;

-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(gctx, params))
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(gctx, p.fips_indicator))
         return 0;

     return 1;
@@ -1285,6 +1299,18 @@ static void *ec_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg)

     /* Whether you want it or not, you get a keypair, not just one half */
     if ((gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
+        /*
+         * A generated key's public point has been serialised
+         * in uncompressed form for many releases, regardless
+         * of anything requested on the ctx or inherited from
+         * the template -- callers who consume the SPKI, EC
+         * PKCS#8 or other encodings rely on that.  With group
+         * and key form now consolidated on a single field on
+         * the group, force it to uncompressed here rather
+         * than start emitting compressed public points where
+         * no caller was expecting them.
+         */
+        EC_KEY_set_conv_form(ec, POINT_CONVERSION_UNCOMPRESSED);
 #ifndef FIPS_MODULE
         if (gctx->dhkem_ikm != NULL && gctx->dhkem_ikmlen != 0)
             ret = ret && ossl_ec_generate_key_dhkem(ec, gctx->dhkem_ikm, gctx->dhkem_ikmlen);
@@ -1299,7 +1325,7 @@ static void *ec_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg)
     if (gctx->group_check != NULL)
         ret = ret && ossl_ec_set_check_group_type_from_name(ec, gctx->group_check);

-    if (ret)
+    if (ret > 0)
         return ec;
 err:
     /* Something went wrong, throw the key away */
@@ -1346,8 +1372,21 @@ static void *sm2_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg)
     ret = ec_gen_assign_group(ec, gctx->gen_group);

     /* Whether you want it or not, you get a keypair, not just one half */
-    if ((gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0)
+    if ((gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
+        /*
+         * A generated key's public point has been serialised
+         * in uncompressed form for many releases, regardless
+         * of anything requested on the ctx or inherited from
+         * the template -- callers who consume the SPKI, EC
+         * PKCS#8 or other encodings rely on that.  With group
+         * and key form now consolidated on a single field on
+         * the group, force it to uncompressed here rather
+         * than start emitting compressed public points where
+         * no caller was expecting them.
+         */
+        EC_KEY_set_conv_form(ec, POINT_CONVERSION_UNCOMPRESSED);
         ret = ret && EC_KEY_generate_key(ec);
+    }

     if (ret)
         return ec;
@@ -1424,6 +1463,7 @@ static void *ec_dup(const void *keydata_from, int selection)

 const OSSL_DISPATCH ossl_ec_keymgmt_functions[] = {
     { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))ec_newdata },
+    { OSSL_FUNC_KEYMGMT_NEW_EX, (void (*)(void))ec_newdata_ex },
     { OSSL_FUNC_KEYMGMT_GEN_INIT, (void (*)(void))ec_gen_init },
     { OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE,
         (void (*)(void))ec_gen_set_template },
@@ -1456,33 +1496,36 @@ const OSSL_DISPATCH ossl_ec_keymgmt_functions[] = {

 #ifndef FIPS_MODULE
 #ifndef OPENSSL_NO_SM2
-const OSSL_DISPATCH ossl_sm2_keymgmt_functions[] = {
-    { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))sm2_newdata },
-    { OSSL_FUNC_KEYMGMT_GEN_INIT, (void (*)(void))sm2_gen_init },
-    { OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE,
-        (void (*)(void))ec_gen_set_template },
-    { OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS, (void (*)(void))ec_gen_set_params },
-    { OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS,
-        (void (*)(void))ec_gen_settable_params },
-    { OSSL_FUNC_KEYMGMT_GEN, (void (*)(void))sm2_gen },
-    { OSSL_FUNC_KEYMGMT_GEN_CLEANUP, (void (*)(void))ec_gen_cleanup },
-    { OSSL_FUNC_KEYMGMT_LOAD, (void (*)(void))sm2_load },
-    { OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))ec_freedata },
-    { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*)(void))sm2_get_params },
-    { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*)(void))sm2_gettable_params },
-    { OSSL_FUNC_KEYMGMT_SET_PARAMS, (void (*)(void))ec_set_params },
-    { OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS, (void (*)(void))sm2_settable_params },
-    { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))ec_has },
-    { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))ec_match },
-    { OSSL_FUNC_KEYMGMT_VALIDATE, (void (*)(void))sm2_validate },
-    { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))sm2_import },
-    { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))ec_import_types },
-    { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))ec_export },
-    { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))ec_export_types },
-    { OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME,
-        (void (*)(void))sm2_query_operation_name },
-    { OSSL_FUNC_KEYMGMT_DUP, (void (*)(void))ec_dup },
-    OSSL_DISPATCH_END
-};
+#define SM2_FUNCS(variant)                                                          \
+    const OSSL_DISPATCH ossl_##variant##_keymgmt_functions[] = {                    \
+        { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))sm2_newdata },                     \
+        { OSSL_FUNC_KEYMGMT_GEN_INIT, (void (*)(void))sm2_gen_init },               \
+        { OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE,                                       \
+            (void (*)(void))ec_gen_set_template },                                  \
+        { OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS, (void (*)(void))sm2_gen_set_params },   \
+        { OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS,                                    \
+            (void (*)(void))sm2_gen_settable_params },                              \
+        { OSSL_FUNC_KEYMGMT_GEN, (void (*)(void))sm2_gen },                         \
+        { OSSL_FUNC_KEYMGMT_GEN_CLEANUP, (void (*)(void))ec_gen_cleanup },          \
+        { OSSL_FUNC_KEYMGMT_LOAD, (void (*)(void))sm2_load },                       \
+        { OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))ec_freedata },                    \
+        { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*)(void))sm2_get_params },           \
+        { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*)(void))sm2_gettable_params }, \
+        { OSSL_FUNC_KEYMGMT_SET_PARAMS, (void (*)(void))sm2_set_params },           \
+        { OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS, (void (*)(void))sm2_settable_params }, \
+        { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))ec_has },                          \
+        { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))ec_match },                      \
+        { OSSL_FUNC_KEYMGMT_VALIDATE, (void (*)(void))sm2_validate },               \
+        { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))sm2_import },                   \
+        { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))sm2_import_types },       \
+        { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))ec_export },                    \
+        { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))sm2_export_types },       \
+        { OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME,                                   \
+            (void (*)(void))variant##_query_operation_name },                       \
+        { OSSL_FUNC_KEYMGMT_DUP, (void (*)(void))ec_dup },                          \
+        OSSL_DISPATCH_END                                                           \
+    }
+SM2_FUNCS(sm2);
+SM2_FUNCS(curve_sm2);
 #endif
 #endif
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/ec_kmgmt_imexport.inc b/deps/openssl/openssl/providers/implementations/keymgmt/ec_kmgmt_imexport.inc
deleted file mode 100644
index b142e0df0c4..00000000000
--- a/deps/openssl/openssl/providers/implementations/keymgmt/ec_kmgmt_imexport.inc
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
-*/
-
-/*
- * This file is meant to be included from ec_kmgmt.c
- */
-
-static const OSSL_PARAM ec_private_key_types[] = {
-    EC_IMEXPORTABLE_PRIVATE_KEY,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM ec_public_key_types[] = {
-    EC_IMEXPORTABLE_PUBLIC_KEY,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM ec_key_types[] = {
-    EC_IMEXPORTABLE_PRIVATE_KEY,
-    EC_IMEXPORTABLE_PUBLIC_KEY,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM ec_dom_parameters_types[] = {
-    EC_IMEXPORTABLE_DOM_PARAMETERS,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM ec_5_types[] = {
-    EC_IMEXPORTABLE_PRIVATE_KEY,
-    EC_IMEXPORTABLE_DOM_PARAMETERS,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM ec_6_types[] = {
-    EC_IMEXPORTABLE_PUBLIC_KEY,
-    EC_IMEXPORTABLE_DOM_PARAMETERS,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM ec_key_domp_types[] = {
-    EC_IMEXPORTABLE_PRIVATE_KEY,
-    EC_IMEXPORTABLE_PUBLIC_KEY,
-    EC_IMEXPORTABLE_DOM_PARAMETERS,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM ec_other_parameters_types[] = {
-    EC_IMEXPORTABLE_OTHER_PARAMETERS,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM ec_9_types[] = {
-    EC_IMEXPORTABLE_PRIVATE_KEY,
-    EC_IMEXPORTABLE_OTHER_PARAMETERS,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM ec_10_types[] = {
-    EC_IMEXPORTABLE_PUBLIC_KEY,
-    EC_IMEXPORTABLE_OTHER_PARAMETERS,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM ec_11_types[] = {
-    EC_IMEXPORTABLE_PRIVATE_KEY,
-    EC_IMEXPORTABLE_PUBLIC_KEY,
-    EC_IMEXPORTABLE_OTHER_PARAMETERS,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM ec_all_parameters_types[] = {
-    EC_IMEXPORTABLE_DOM_PARAMETERS,
-    EC_IMEXPORTABLE_OTHER_PARAMETERS,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM ec_13_types[] = {
-    EC_IMEXPORTABLE_PRIVATE_KEY,
-    EC_IMEXPORTABLE_DOM_PARAMETERS,
-    EC_IMEXPORTABLE_OTHER_PARAMETERS,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM ec_14_types[] = {
-    EC_IMEXPORTABLE_PUBLIC_KEY,
-    EC_IMEXPORTABLE_DOM_PARAMETERS,
-    EC_IMEXPORTABLE_OTHER_PARAMETERS,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM ec_all_types[] = {
-    EC_IMEXPORTABLE_PRIVATE_KEY,
-    EC_IMEXPORTABLE_PUBLIC_KEY,
-    EC_IMEXPORTABLE_DOM_PARAMETERS,
-    EC_IMEXPORTABLE_OTHER_PARAMETERS,
-    OSSL_PARAM_END
-};
-
-static const OSSL_PARAM *ec_types[] = {
-    NULL,
-    ec_private_key_types,
-    ec_public_key_types,
-    ec_key_types,
-    ec_dom_parameters_types,
-    ec_5_types,
-    ec_6_types,
-    ec_key_domp_types,
-    ec_other_parameters_types,
-    ec_9_types,
-    ec_10_types,
-    ec_11_types,
-    ec_all_parameters_types,
-    ec_13_types,
-    ec_14_types,
-    ec_all_types
-};
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/ecx_kmgmt.c b/deps/openssl/openssl/providers/implementations/keymgmt/ecx_kmgmt.c
index 001777c616d..a12b02e41a1 100644
--- a/deps/openssl/openssl/providers/implementations/keymgmt/ecx_kmgmt.c
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/ecx_kmgmt.c
@@ -26,9 +26,9 @@
 #include "prov/provider_ctx.h"
 #include "prov/ecx.h"
 #include "prov/securitycheck.h"
-#include "fips/fipsindicator.h"
+#include "providers/implementations/keymgmt/keymgmtcommon.inc"
 #ifdef S390X_EC_ASM
-#include "s390x_arch.h"
+#include "arch/s390x_arch.h"
 #include <openssl/sha.h> /* For SHA512_DIGEST_LENGTH */
 #endif

@@ -108,12 +108,14 @@ static ossl_inline int ecx_key_type_is_ed(ECX_KEY_TYPE type)
 static int ecx_gen_get_params(void *genctx, OSSL_PARAM params[])
 {
     struct ecx_gen_ctx *gctx = genctx;
-    OSSL_PARAM *p;
+    struct keymgmt_fips_gen_get_params_st p;

-    if (gctx == NULL)
+    if (gctx == NULL || !keymgmt_fips_gen_get_params_decoder(params, &p))
+        return 0;
+    if (p.ind != NULL
+        && !OSSL_PARAM_set_int(p.ind, ecx_key_type_is_ed(gctx->type)))
         return 0;
-    p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR);
-    return p == NULL || OSSL_PARAM_set_int(p, ecx_key_type_is_ed(gctx->type));
+    return 1;
 }
 #endif

@@ -218,38 +220,58 @@ static int ecx_match(const void *keydata1, const void *keydata2, int selection)
     return ok;
 }

+struct ecx_ed_common_get_params_st {
+    OSSL_PARAM *bits;
+    OSSL_PARAM *secbits;
+    OSSL_PARAM *size;
+    OSSL_PARAM *seccat;
+    OSSL_PARAM *pub;
+    OSSL_PARAM *priv;
+    OSSL_PARAM *encpub; /* ECX only */
+    OSSL_PARAM *ind; /* ECX only */
+    OSSL_PARAM *digest; /* Ed only */
+};
+
+#define ecx_get_params_st ecx_ed_common_get_params_st
+#define ed_get_params_st ecx_ed_common_get_params_st
+
+#include "providers/implementations/keymgmt/ecx_kmgmt.inc"
+
 static int ecx_import(void *keydata, int selection, const OSSL_PARAM params[])
 {
     ECX_KEY *key = keydata;
     int ok = 1;
     int include_private;
+    struct ecx_imexport_types_st p;

-    if (!ossl_prov_is_running() || key == NULL)
+    if (!ossl_prov_is_running()
+        || key == NULL
+        || !ecx_imexport_types_decoder(params, &p))
         return 0;

     if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
         return 0;

     include_private = selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY ? 1 : 0;
-    ok = ok && ossl_ecx_key_fromdata(key, params, include_private);
+    ok = ok && ossl_ecx_key_fromdata(key, p.pub, p.priv, include_private);

     return ok;
 }

 static int key_to_params(ECX_KEY *key, OSSL_PARAM_BLD *tmpl,
-    OSSL_PARAM params[], int include_private)
+    OSSL_PARAM *pub, OSSL_PARAM *priv, int include_private)
 {
     if (key == NULL)
         return 0;

-    if (!ossl_param_build_set_octet_string(tmpl, params,
+    if (!ossl_param_build_set_octet_string(tmpl, pub,
             OSSL_PKEY_PARAM_PUB_KEY,
             key->pubkey, key->keylen))
         return 0;

     if (include_private
         && key->privkey != NULL
-        && !ossl_param_build_set_octet_string(tmpl, params,
+        && !ossl_param_build_set_octet_string(tmpl, priv,
             OSSL_PKEY_PARAM_PRIV_KEY,
             key->privkey, key->keylen))
         return 0;
@@ -278,7 +300,7 @@ static int ecx_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
     if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
         int include_private = ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0);

-        if (!key_to_params(key, tmpl, NULL, include_private))
+        if (!key_to_params(key, tmpl, NULL, NULL, include_private))
             goto err;
     }

@@ -287,72 +309,74 @@ static int ecx_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
         goto err;

     ret = param_cb(params, cbarg);
-    OSSL_PARAM_free(params);
+    OSSL_PARAM_clear_free(params);
 err:
     OSSL_PARAM_BLD_free(tmpl);
     return ret;
 }

-#define ECX_KEY_TYPES()                                        \
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PUB_KEY, NULL, 0), \
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0)
-
-static const OSSL_PARAM ecx_key_types[] = {
-    ECX_KEY_TYPES(),
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *ecx_imexport_types(int selection)
 {
     if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0)
-        return ecx_key_types;
+        return ecx_imexport_types_list;
     return NULL;
 }

+/* This getter is shared by ED25519, ED448, X25519 and X448 */
+static int ecx_ed_common_get_params(void *key,
+    const struct ecx_ed_common_get_params_st *p,
+    int bits, int secbits, int size)
+{
+    ECX_KEY *ecx = key;
+
+    if (p->bits != NULL && !OSSL_PARAM_set_int(p->bits, bits))
+        return 0;
+    if (p->secbits != NULL && !OSSL_PARAM_set_int(p->secbits, secbits))
+        return 0;
+    if (p->size != NULL && !OSSL_PARAM_set_int(p->size, size))
+        return 0;
+    if (p->seccat != NULL && !OSSL_PARAM_set_int(p->seccat, 0))
+        return 0;
+    return key_to_params(ecx, NULL, p->pub, p->priv, 1);
+}
+
+/* X25519/X448 getter */
 static int ecx_get_params(void *key, OSSL_PARAM params[], int bits, int secbits,
     int size)
 {
     ECX_KEY *ecx = key;
-    OSSL_PARAM *p;
+    struct ecx_ed_common_get_params_st p;

-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
-        && !OSSL_PARAM_set_int(p, bits))
+    if (key == NULL || !ecx_get_params_decoder(params, &p))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
-        && !OSSL_PARAM_set_int(p, secbits))
-        return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
-        && !OSSL_PARAM_set_int(p, size))
+
+    if (p.encpub != NULL
+        && !OSSL_PARAM_set_octet_string(p.encpub, ecx->pubkey, ecx->keylen))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL
-        && (ecx->type == ECX_KEY_TYPE_X25519
-            || ecx->type == ECX_KEY_TYPE_X448)) {
-        if (!OSSL_PARAM_set_octet_string(p, ecx->pubkey, ecx->keylen))
-            return 0;
-    }
 #ifdef FIPS_MODULE
     {
-        /* X25519 and X448 are not approved */
+        /* Currently X25519 and X448 are not approved */
         int approved = 0;

-        p = OSSL_PARAM_locate(params, OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR);
-        if (p != NULL && !OSSL_PARAM_set_int(p, approved))
+        if (p.ind != NULL && !OSSL_PARAM_set_int(p.ind, approved))
             return 0;
     }
 #endif

-    return key_to_params(ecx, NULL, params, 1);
+    return ecx_ed_common_get_params(key, &p, bits, secbits, size);
 }

-static int ed_get_params(void *key, OSSL_PARAM params[])
+/* ED25519/ED448 getter */
+static int ed_get_params(void *key, OSSL_PARAM params[], int bits, int secbits,
+    int size)
 {
-    OSSL_PARAM *p;
+    struct ecx_ed_common_get_params_st p;

-    if ((p = OSSL_PARAM_locate(params,
-             OSSL_PKEY_PARAM_MANDATORY_DIGEST))
-            != NULL
-        && !OSSL_PARAM_set_utf8_string(p, ""))
+    if (key == NULL || !ed_get_params_decoder(params, &p))
         return 0;
-    return 1;
+    if (p.digest != NULL && !OSSL_PARAM_set_utf8_string(p.digest, ""))
+        return 0;
+    return ecx_ed_common_get_params(key, &p, bits, secbits, size);
 }

 static int x25519_get_params(void *key, OSSL_PARAM params[])
@@ -369,55 +393,33 @@ static int x448_get_params(void *key, OSSL_PARAM params[])

 static int ed25519_get_params(void *key, OSSL_PARAM params[])
 {
-    return ecx_get_params(key, params, ED25519_BITS, ED25519_SECURITY_BITS,
-               ED25519_SIGSIZE)
-        && ed_get_params(key, params);
+    return ed_get_params(key, params, ED25519_BITS, ED25519_SECURITY_BITS,
+        ED25519_SIGSIZE);
 }
-
 static int ed448_get_params(void *key, OSSL_PARAM params[])
 {
-    return ecx_get_params(key, params, ED448_BITS, ED448_SECURITY_BITS,
-               ED448_SIGSIZE)
-        && ed_get_params(key, params);
+    return ed_get_params(key, params, ED448_BITS, ED448_SECURITY_BITS,
+        ED448_SIGSIZE);
 }

-static const OSSL_PARAM ecx_gettable_params[] = {
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
-    ECX_KEY_TYPES(),
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
-
-static const OSSL_PARAM ed_gettable_params[] = {
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_MANDATORY_DIGEST, NULL, 0),
-    ECX_KEY_TYPES(),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *x25519_gettable_params(void *provctx)
 {
-    return ecx_gettable_params;
+    return ecx_get_params_list;
 }

 static const OSSL_PARAM *x448_gettable_params(void *provctx)
 {
-    return ecx_gettable_params;
+    return ecx_get_params_list;
 }

 static const OSSL_PARAM *ed25519_gettable_params(void *provctx)
 {
-    return ed_gettable_params;
+    return ed_get_params_list;
 }

 static const OSSL_PARAM *ed448_gettable_params(void *provctx)
 {
-    return ed_gettable_params;
+    return ed_get_params_list;
 }

 static int set_property_query(ECX_KEY *ecxkey, const char *propq)
@@ -435,27 +437,26 @@ static int set_property_query(ECX_KEY *ecxkey, const char *propq)
 static int ecx_set_params(void *key, const OSSL_PARAM params[])
 {
     ECX_KEY *ecxkey = key;
-    const OSSL_PARAM *p;
+    struct ecx_set_params_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (key == NULL || !ecx_set_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY);
-    if (p != NULL) {
+    if (p.pub != NULL) {
         void *buf = ecxkey->pubkey;

-        if (p->data_size != ecxkey->keylen
-            || !OSSL_PARAM_get_octet_string(p, &buf, sizeof(ecxkey->pubkey),
+        if (p.pub->data_size != ecxkey->keylen
+            || !OSSL_PARAM_get_octet_string(p.pub, &buf, sizeof(ecxkey->pubkey),
                 NULL))
             return 0;
         OPENSSL_clear_free(ecxkey->privkey, ecxkey->keylen);
         ecxkey->privkey = NULL;
         ecxkey->haspubkey = 1;
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PROPERTIES);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING
-            || !set_property_query(ecxkey, p->data))
+
+    if (p.propq != NULL) {
+        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING
+            || !set_property_query(ecxkey, p.propq->data))
             return 0;
     }

@@ -482,24 +483,18 @@ static int ed448_set_params(void *key, const OSSL_PARAM params[])
     return 1;
 }

-static const OSSL_PARAM ecx_settable_params[] = {
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_PROPERTIES, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM ed_settable_params[] = {
     OSSL_PARAM_END
 };

 static const OSSL_PARAM *x25519_settable_params(void *provctx)
 {
-    return ecx_settable_params;
+    return ecx_set_params_list;
 }

 static const OSSL_PARAM *x448_settable_params(void *provctx)
 {
-    return ecx_settable_params;
+    return ecx_set_params_list;
 }

 static const OSSL_PARAM *ed25519_settable_params(void *provctx)
@@ -571,13 +566,12 @@ static void *ed448_gen_init(void *provctx, int selection,
 static int ecx_gen_set_params(void *genctx, const OSSL_PARAM params[])
 {
     struct ecx_gen_ctx *gctx = genctx;
-    const OSSL_PARAM *p;
+    struct ecx_gen_set_params_st p;

-    if (gctx == NULL)
+    if (gctx == NULL || !ecx_gen_set_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_GROUP_NAME);
-    if (p != NULL) {
+    if (p.group != NULL) {
         const char *groupname = NULL;

         /*
@@ -596,28 +590,28 @@ static int ecx_gen_set_params(void *genctx, const OSSL_PARAM params[])
             /* We only support this for key exchange at the moment */
             break;
         }
-        if (p->data_type != OSSL_PARAM_UTF8_STRING
+        if (p.group->data_type != OSSL_PARAM_UTF8_STRING
             || groupname == NULL
-            || OPENSSL_strcasecmp(p->data, groupname) != 0) {
+            || OPENSSL_strcasecmp(p.group->data, groupname) != 0) {
             ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
             return 0;
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_PROPERTIES);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
+
+    if (p.kdfpropq != NULL) {
+        if (p.kdfpropq->data_type != OSSL_PARAM_UTF8_STRING)
             return 0;
         OPENSSL_free(gctx->propq);
-        gctx->propq = OPENSSL_strdup(p->data);
+        gctx->propq = OPENSSL_strdup(p.kdfpropq->data);
         if (gctx->propq == NULL)
             return 0;
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_DHKEM_IKM);
-    if (p != NULL) {
-        if (p->data_size != 0 && p->data != NULL) {
+
+    if (p.ikm != NULL) {
+        if (p.ikm->data_size != 0 && p.ikm->data != NULL) {
             OPENSSL_free(gctx->dhkem_ikm);
             gctx->dhkem_ikm = NULL;
-            if (!OSSL_PARAM_get_octet_string(p, (void **)&gctx->dhkem_ikm, 0,
+            if (!OSSL_PARAM_get_octet_string(p.ikm, (void **)&gctx->dhkem_ikm, 0,
                     &gctx->dhkem_ikmlen))
                 return 0;
         }
@@ -629,13 +623,7 @@ static int ecx_gen_set_params(void *genctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *ecx_gen_settable_params(ossl_unused void *genctx,
     ossl_unused void *provctx)
 {
-    static OSSL_PARAM settable[] = {
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_DHKEM_IKM, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return settable;
+    return ecx_gen_set_params_list;
 }

 #ifdef FIPS_MODULE
@@ -1048,9 +1036,7 @@ static void ecx_free_key(void *keydata)
         { OSSL_FUNC_KEYMGMT_GEN_CLEANUP, (void (*)(void))ecx_gen_cleanup },           \
         { OSSL_FUNC_KEYMGMT_LOAD, (void (*)(void))ecx_load },                         \
         { OSSL_FUNC_KEYMGMT_DUP, (void (*)(void))ecx_dup },                           \
-        OSSL_FIPS_IND_DISPATCH(OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS,                      \
-            OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS, ecx_gen_get_params)                \
-            OSSL_DISPATCH_END                                                         \
+        OSSL_KEYMGMT_FIPS_GEN_DISPATCH_END(ecx_gen_get_params)                        \
     };

 MAKE_KEYMGMT_FUNCTIONS(x25519)
@@ -1059,7 +1045,7 @@ MAKE_KEYMGMT_FUNCTIONS(ed25519)
 MAKE_KEYMGMT_FUNCTIONS(ed448)

 #ifdef S390X_EC_ASM
-#include "s390x_arch.h"
+#include "arch/s390x_arch.h"

 static void *s390x_ecx_keygen25519(struct ecx_gen_ctx *gctx)
 {
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/ecx_kmgmt.inc.in b/deps/openssl/openssl/providers/implementations/keymgmt/ecx_kmgmt.inc.in
new file mode 100644
index 00000000000..ac275442ed3
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/ecx_kmgmt.inc.in
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ecx_imexport_types',
+                         (['OSSL_PKEY_PARAM_PUB_KEY',  'pub',  'octet_string'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY', 'priv', 'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('ecx_get_params',
+                         (['OSSL_PKEY_PARAM_BITS',                    'bits',    'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_BITS',           'secbits', 'int'],
+                          ['OSSL_PKEY_PARAM_MAX_SIZE',                'size',    'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_CATEGORY',       'seccat',  'int'],
+                          ['OSSL_PKEY_PARAM_PUB_KEY',                 'pub',     'octet_string'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY',                'priv',    'octet_string'],
+                          ['OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY',      'encpub',  'octet_string'],
+                          ['OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR', 'ind',     'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('ed_get_params',
+                         (['OSSL_PKEY_PARAM_BITS',              'bits',    'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_BITS',     'secbits', 'int'],
+                          ['OSSL_PKEY_PARAM_MAX_SIZE',          'size',    'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_CATEGORY', 'seccat',  'int'],
+                          ['OSSL_PKEY_PARAM_PUB_KEY',           'pub',     'octet_string'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY',          'priv',    'octet_string'],
+                          ['OSSL_PKEY_PARAM_MANDATORY_DIGEST',  'digest',  'utf8_string'],
+                         )); -}
+
+{- produce_param_decoder('ecx_set_params',
+                         (['OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY',  'pub',   'octet_string'],
+                          ['OSSL_PKEY_PARAM_PROPERTIES',          'propq', 'utf8_string'],
+                         )); -}
+
+{- produce_param_decoder('ecx_gen_set_params',
+                         (['OSSL_PKEY_PARAM_GROUP_NAME', 'group',    'utf8_string'],
+                          ['OSSL_KDF_PARAM_PROPERTIES',  'kdfpropq', 'utf8_string'],
+                          ['OSSL_PKEY_PARAM_DHKEM_IKM',  'ikm',      'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/kdf_legacy_kmgmt.c b/deps/openssl/openssl/providers/implementations/keymgmt/kdf_legacy_kmgmt.c
index deb49600066..1027bb17875 100644
--- a/deps/openssl/openssl/providers/implementations/keymgmt/kdf_legacy_kmgmt.c
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/kdf_legacy_kmgmt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -75,8 +75,7 @@ int ossl_kdf_data_up_ref(KDF_DATA *kdfdata)
     if (!ossl_prov_is_running())
         return 0;

-    CRYPTO_UP_REF(&kdfdata->refcnt, &ref);
-    return 1;
+    return CRYPTO_UP_REF(&kdfdata->refcnt, &ref);
 }

 static void *kdf_newdata(void *provctx)
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/keymgmtcommon.inc.in b/deps/openssl/openssl/providers/implementations/keymgmt/keymgmtcommon.inc.in
new file mode 100644
index 00000000000..2c1c9dec77f
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/keymgmtcommon.inc.in
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('keymgmt_gen_get_params',
+                         (['OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR',
+                           'fips indicator', 'int'],
+                         )); -}
+
+{- produce_param_decoder('keymgmt_fips_gen_get_params',
+                         (['OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR',
+                           'ind', 'int', 'hidden'],
+                         )); -}
+
+#ifdef FIPS_MODULE
+static const OSSL_PARAM *keymgmt_gen_gettable_params(
+    ossl_unused void *genctx, ossl_unused void *provctx)
+{
+    return keymgmt_gen_get_params_list;
+}
+
+static ossl_unused int keymgmt_gen_get_params(ossl_unused void *genctx,
+    OSSL_PARAM params[])
+{
+    struct keymgmt_gen_get_params_st p;
+
+    return keymgmt_gen_get_params_decoder(params, &p);
+}
+
+# define OSSL_KEYMGMT_FIPS_GEN_DISPATCH_END(get_params)                   \
+    { OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS, (void (*)(void))get_params },     \
+    { OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS,                             \
+      (void (*)(void))keymgmt_gen_gettable_params },                     \
+    OSSL_DISPATCH_END
+# define OSSL_KEYMGMT_FIPS_APPROVED_GEN_DISPATCH_END                     \
+    OSSL_KEYMGMT_FIPS_GEN_DISPATCH_END(keymgmt_gen_get_params)
+#else
+# define OSSL_KEYMGMT_FIPS_GEN_DISPATCH_END(get_params) OSSL_DISPATCH_END
+# define OSSL_KEYMGMT_FIPS_APPROVED_GEN_DISPATCH_END OSSL_DISPATCH_END
+#endif
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/lms_kmgmt.c b/deps/openssl/openssl/providers/implementations/keymgmt/lms_kmgmt.c
new file mode 100644
index 00000000000..f8297e11467
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/lms_kmgmt.c
@@ -0,0 +1,213 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/core_dispatch.h>
+#include <openssl/core_names.h>
+#include <openssl/param_build.h>
+#include <openssl/proverr.h>
+#include "crypto/lms.h"
+#include "internal/param_build_set.h"
+#include "prov/implementations.h"
+#include "prov/providercommon.h"
+#include "prov/provider_ctx.h"
+#include "providers/implementations/keymgmt/lms_kmgmt.inc"
+
+static OSSL_FUNC_keymgmt_new_fn lms_new_key;
+static OSSL_FUNC_keymgmt_free_fn lms_free_key;
+static OSSL_FUNC_keymgmt_has_fn lms_has;
+static OSSL_FUNC_keymgmt_match_fn lms_match;
+static OSSL_FUNC_keymgmt_validate_fn lms_validate;
+static OSSL_FUNC_keymgmt_import_fn lms_import;
+static OSSL_FUNC_keymgmt_export_fn lms_export;
+static OSSL_FUNC_keymgmt_import_types_fn lms_imexport_types;
+static OSSL_FUNC_keymgmt_export_types_fn lms_imexport_types;
+static OSSL_FUNC_keymgmt_load_fn lms_load;
+static OSSL_FUNC_keymgmt_gettable_params_fn lms_gettable_params;
+static OSSL_FUNC_keymgmt_get_params_fn lms_get_params;
+
+#define LMS_POSSIBLE_SELECTIONS (OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
+
+static void *lms_new_key(void *provctx)
+{
+    if (!ossl_prov_is_running())
+        return 0;
+    return ossl_lms_key_new(PROV_LIBCTX_OF(provctx));
+}
+
+static void lms_free_key(void *keydata)
+{
+    ossl_lms_key_free((LMS_KEY *)keydata);
+}
+
+static int lms_has(const void *keydata, int selection)
+{
+    const LMS_KEY *key = keydata;
+
+    if (!ossl_prov_is_running() || key == NULL)
+        return 0;
+    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
+        return 1; /* the selection is not missing */
+
+    return ossl_lms_key_has(key, selection);
+}
+
+static int lms_match(const void *keydata1, const void *keydata2, int selection)
+{
+    const LMS_KEY *key1 = keydata1;
+    const LMS_KEY *key2 = keydata2;
+
+    if (!ossl_prov_is_running())
+        return 0;
+    return ossl_lms_key_equal(key1, key2, selection);
+}
+
+static int lms_import(void *keydata, int selection, const OSSL_PARAM params[])
+{
+    LMS_KEY *key = keydata;
+    struct lms_import_st p;
+
+    if (!ossl_prov_is_running()
+        || key == NULL
+        || !lms_import_decoder(params, &p))
+        return 0;
+
+    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) == 0)
+        return 0;
+
+    return ossl_lms_pubkey_from_params(p.pub, key);
+}
+
+static const OSSL_PARAM *lms_imexport_types(int selection)
+{
+    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
+        return lms_import_list;
+    return NULL;
+}
+
+static int lms_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
+    void *cbarg)
+{
+    LMS_KEY *lmskey = keydata;
+    OSSL_PARAM_BLD *tmpl;
+    OSSL_PARAM *params = NULL;
+    int ret = 0;
+
+    if (!ossl_prov_is_running() || lmskey == NULL)
+        return 0;
+
+    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) == 0)
+        return 0;
+
+    tmpl = OSSL_PARAM_BLD_new();
+    if (tmpl == NULL)
+        return 0;
+
+    if (!ossl_param_build_set_octet_string(tmpl, params,
+            OSSL_PKEY_PARAM_PUB_KEY,
+            lmskey->pub.encoded,
+            lmskey->pub.encodedlen))
+        goto err;
+
+    params = OSSL_PARAM_BLD_to_param(tmpl);
+    if (params == NULL)
+        goto err;
+
+    ret = param_cb(params, cbarg);
+    OSSL_PARAM_clear_free(params);
+err:
+    OSSL_PARAM_BLD_free(tmpl);
+    return ret;
+}
+
+static int lms_validate(const void *keydata, int selection, int checktype)
+{
+    const LMS_KEY *lmskey = keydata;
+
+    if (!ossl_prov_is_running())
+        return 0;
+
+    if ((selection & LMS_POSSIBLE_SELECTIONS) == 0)
+        return 1; /* nothing to validate */
+
+    return ossl_lms_key_valid(lmskey, selection);
+}
+
+static void *lms_load(const void *reference, size_t reference_sz)
+{
+    LMS_KEY *key = NULL;
+
+    if (ossl_prov_is_running() && reference_sz == sizeof(key)) {
+        /* The contents of the reference is the address to our object */
+        key = *(LMS_KEY **)reference;
+        /* We grabbed, so we detach it */
+        *(LMS_KEY **)reference = NULL;
+        return key;
+    }
+    return NULL;
+}
+
+static const OSSL_PARAM *lms_gettable_params(void *provctx)
+{
+    return lms_get_params_list;
+}
+
+static int lms_get_params(void *keydata, OSSL_PARAM params[])
+{
+    LMS_KEY *key = keydata;
+    const uint8_t *d;
+    size_t len;
+    struct lms_get_params_st p;
+
+    if (key == NULL || !lms_get_params_decoder(params, &p))
+        return 0;
+
+    if (p.bits != NULL
+        && !OSSL_PARAM_set_size_t(p.bits, 8 * ossl_lms_key_get_pub_len(key)))
+        return 0;
+
+    if (p.secbits != NULL
+        && !OSSL_PARAM_set_size_t(p.secbits, ossl_lms_key_get_collision_strength_bits(key)))
+        return 0;
+
+    if (p.maxsize != NULL
+        && !OSSL_PARAM_set_size_t(p.maxsize, ossl_lms_key_get_sig_len(key)))
+        return 0;
+
+    if (p.pubkey != NULL) {
+        d = ossl_lms_key_get_pub(key);
+        if (d != NULL) {
+            len = ossl_lms_key_get_pub_len(key);
+            if (!OSSL_PARAM_set_octet_string(p.pubkey, d, len))
+                return 0;
+        }
+    }
+    /*
+     * This allows apps to use an empty digest, so that the old API
+     * for digest signing can be used.
+     */
+    if (p.dgstp != NULL && !OSSL_PARAM_set_utf8_string(p.dgstp, ""))
+        return 0;
+    return 1;
+}
+
+const OSSL_DISPATCH ossl_lms_keymgmt_functions[] = {
+    { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))lms_new_key },
+    { OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))lms_free_key },
+    { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))lms_has },
+    { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))lms_match },
+    { OSSL_FUNC_KEYMGMT_VALIDATE, (void (*)(void))lms_validate },
+    { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))lms_import },
+    { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))lms_imexport_types },
+    { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))lms_export },
+    { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))lms_imexport_types },
+    { OSSL_FUNC_KEYMGMT_LOAD, (void (*)(void))lms_load },
+    { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*)(void))lms_get_params },
+    { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*)(void))lms_gettable_params },
+    OSSL_DISPATCH_END
+};
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/lms_kmgmt.inc.in b/deps/openssl/openssl/providers/implementations/keymgmt/lms_kmgmt.inc.in
new file mode 100644
index 00000000000..3be81ad30c6
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/lms_kmgmt.inc.in
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('lms_import',
+                         (['OSSL_PKEY_PARAM_PUB_KEY',           'pub',     'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('lms_get_params',
+                         (['OSSL_PKEY_PARAM_BITS',              'bits',    'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_BITS',     'secbits', 'int'],
+                          ['OSSL_PKEY_PARAM_MAX_SIZE',          'maxsize', 'int'],
+                          ['OSSL_PKEY_PARAM_MANDATORY_DIGEST',  'dgstp',   'utf8_string'],
+                          ['OSSL_PKEY_PARAM_PUB_KEY',           'pubkey',  'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/mac_legacy_kmgmt.c b/deps/openssl/openssl/providers/implementations/keymgmt/mac_legacy_kmgmt.c
index 19a648fd9cd..9f17841768b 100644
--- a/deps/openssl/openssl/providers/implementations/keymgmt/mac_legacy_kmgmt.c
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/mac_legacy_kmgmt.c
@@ -7,9 +7,6 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
 #include <string.h>
 #include <openssl/core_dispatch.h>
 #include <openssl/core_names.h>
@@ -18,15 +15,12 @@
 #include <openssl/evp.h>
 #include <openssl/proverr.h>
 #include <openssl/param_build.h>
-#ifndef FIPS_MODULE
-#include <openssl/engine.h>
-#endif
 #include "internal/param_build_set.h"
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
 #include "prov/provider_ctx.h"
 #include "prov/macsignature.h"
-#include "fips/fipsindicator.h"
+#include "providers/implementations/keymgmt/keymgmtcommon.inc"

 static OSSL_FUNC_keymgmt_new_fn mac_new;
 static OSSL_FUNC_keymgmt_free_fn mac_free;
@@ -47,7 +41,9 @@ static OSSL_FUNC_keymgmt_export_fn mac_export;
 static OSSL_FUNC_keymgmt_export_types_fn mac_imexport_types;

 static OSSL_FUNC_keymgmt_new_fn mac_new_cmac;
+static OSSL_FUNC_keymgmt_get_params_fn cmac_get_params;
 static OSSL_FUNC_keymgmt_gettable_params_fn cmac_gettable_params;
+static OSSL_FUNC_keymgmt_import_fn cmac_import;
 static OSSL_FUNC_keymgmt_import_types_fn cmac_imexport_types;
 static OSSL_FUNC_keymgmt_export_types_fn cmac_imexport_types;
 static OSSL_FUNC_keymgmt_gen_init_fn cmac_gen_init;
@@ -115,8 +111,7 @@ int ossl_mac_key_up_ref(MAC_KEY *mackey)
     if (!ossl_prov_is_running())
         return 0;

-    CRYPTO_UP_REF(&mackey->refcnt, &ref);
-    return 1;
+    return CRYPTO_UP_REF(&mackey->refcnt, &ref);
 }

 static void *mac_new(void *provctx)
@@ -178,38 +173,53 @@ static int mac_match(const void *keydata1, const void *keydata2, int selection)
     return ok;
 }

-static int mac_key_fromdata(MAC_KEY *key, const OSSL_PARAM params[])
-{
-    const OSSL_PARAM *p;
+/* Common structure to handle the MAC parameters for various calls */
+struct mac_common_params_st {
+    OSSL_PARAM *key;
+    OSSL_PARAM *cipher; /* CMAC */
+    OSSL_PARAM *propq;
+};
+
+#define mac_import_st mac_common_params_st
+#define cmac_import_st mac_common_params_st
+#define mac_get_params_st mac_common_params_st
+#define cmac_get_params_st mac_common_params_st
+#define mac_set_params_st mac_common_params_st
+#define mac_gen_set_params_st mac_common_params_st
+#define cmac_gen_set_params_st mac_common_params_st

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+#include "providers/implementations/keymgmt/mac_legacy_kmgmt.inc"
+
+static int mac_key_fromdata(MAC_KEY *key, const struct mac_common_params_st *p)
+{
+    if (p->key != NULL) {
+        if (p->key->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
             return 0;
         }
         OPENSSL_secure_clear_free(key->priv_key, key->priv_key_len);
         /* allocate at least one byte to distinguish empty key from no key set */
-        key->priv_key = OPENSSL_secure_malloc(p->data_size > 0 ? p->data_size : 1);
+        key->priv_key = OPENSSL_secure_malloc(p->key->data_size > 0
+                ? p->key->data_size
+                : 1);
         if (key->priv_key == NULL)
             return 0;
-        memcpy(key->priv_key, p->data, p->data_size);
-        key->priv_key_len = p->data_size;
+        memcpy(key->priv_key, p->key->data, p->key->data_size);
+        key->priv_key_len = p->key->data_size;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PROPERTIES);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING) {
+    if (p->propq != NULL) {
+        if (p->propq->data_type != OSSL_PARAM_UTF8_STRING) {
             ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
             return 0;
         }
         OPENSSL_free(key->properties);
-        key->properties = OPENSSL_strdup(p->data);
+        key->properties = OPENSSL_strdup(p->propq->data);
         if (key->properties == NULL)
             return 0;
     }

-    if (key->cmac && !ossl_prov_cipher_load_from_params(&key->cipher, params, key->libctx)) {
+    if (key->cmac && !ossl_prov_cipher_load(&key->cipher, p->cipher, p->propq, key->libctx)) {
         ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
         return 0;
     }
@@ -223,42 +233,65 @@ static int mac_key_fromdata(MAC_KEY *key, const OSSL_PARAM params[])
 static int mac_import(void *keydata, int selection, const OSSL_PARAM params[])
 {
     MAC_KEY *key = keydata;
+    struct mac_common_params_st p;

-    if (!ossl_prov_is_running() || key == NULL)
+    if (key == NULL
+        || (selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) == 0
+        || !ossl_prov_is_running()
+        || !mac_import_decoder(params, &p))
         return 0;

-    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) == 0)
+    return mac_key_fromdata(key, &p);
+}
+
+static const OSSL_PARAM *mac_imexport_types(int selection)
+{
+    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
+        return mac_import_list;
+    return NULL;
+}
+
+static int cmac_import(void *keydata, int selection, const OSSL_PARAM params[])
+{
+    MAC_KEY *key = keydata;
+    struct mac_common_params_st p;
+
+    if (key == NULL
+        || (selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) == 0
+        || !ossl_prov_is_running()
+        || !cmac_import_decoder(params, &p))
         return 0;

-    return mac_key_fromdata(key, params);
+    return mac_key_fromdata(key, &p);
+}
+
+static const OSSL_PARAM *cmac_imexport_types(int selection)
+{
+    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
+        return cmac_import_list;
+    return NULL;
 }

 static int key_to_params(MAC_KEY *key, OSSL_PARAM_BLD *tmpl,
-    OSSL_PARAM params[])
+    struct mac_common_params_st *p)
 {
-    if (key == NULL)
-        return 0;
+    struct mac_common_params_st empty;
+
+    if (p == NULL)
+        memset(p = &empty, 0, sizeof(empty));

     if (key->priv_key != NULL
-        && !ossl_param_build_set_octet_string(tmpl, params,
+        && !ossl_param_build_set_octet_string(tmpl, p->key,
             OSSL_PKEY_PARAM_PRIV_KEY,
             key->priv_key, key->priv_key_len))
         return 0;

     if (key->cipher.cipher != NULL
-        && !ossl_param_build_set_utf8_string(tmpl, params,
+        && !ossl_param_build_set_utf8_string(tmpl, p->cipher,
             OSSL_PKEY_PARAM_CIPHER,
             EVP_CIPHER_get0_name(key->cipher.cipher)))
         return 0;

-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    if (key->cipher.engine != NULL
-        && !ossl_param_build_set_utf8_string(tmpl, params,
-            OSSL_PKEY_PARAM_ENGINE,
-            ENGINE_get_id(key->cipher.engine)))
-        return 0;
-#endif
-
     return 1;
 }

@@ -280,8 +313,7 @@ static int mac_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
     if (tmpl == NULL)
         return 0;

-    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0
-        && !key_to_params(key, tmpl, NULL))
+    if (!key_to_params(key, tmpl, NULL))
         goto err;

     params = OSSL_PARAM_BLD_to_param(tmpl);
@@ -289,85 +321,61 @@ static int mac_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
         goto err;

     ret = param_cb(params, cbarg);
-    OSSL_PARAM_free(params);
+    OSSL_PARAM_clear_free(params);
 err:
     OSSL_PARAM_BLD_free(tmpl);
     return ret;
 }

-static const OSSL_PARAM mac_key_types[] = {
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_PROPERTIES, NULL, 0),
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM *mac_imexport_types(int selection)
+static int mac_get_params(void *keydata, OSSL_PARAM params[])
 {
-    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
-        return mac_key_types;
-    return NULL;
-}
+    struct mac_common_params_st p;
+    MAC_KEY *key = keydata;

-static const OSSL_PARAM cmac_key_types[] = {
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_CIPHER, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_ENGINE, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_PROPERTIES, NULL, 0),
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM *cmac_imexport_types(int selection)
-{
-    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
-        return cmac_key_types;
-    return NULL;
+    if (key == NULL || !mac_get_params_decoder(params, &p))
+        return 0;
+
+    return key_to_params(key, NULL, &p);
 }

-static int mac_get_params(void *key, OSSL_PARAM params[])
+static const OSSL_PARAM *mac_gettable_params(void *provctx)
 {
-    return key_to_params(key, NULL, params);
+    return mac_get_params_list;
 }

-static const OSSL_PARAM *mac_gettable_params(void *provctx)
+static int cmac_get_params(void *keydata, OSSL_PARAM params[])
 {
-    static const OSSL_PARAM gettable_params[] = {
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return gettable_params;
+    struct mac_common_params_st p;
+    MAC_KEY *key = keydata;
+
+    if (key == NULL || !cmac_get_params_decoder(params, &p))
+        return 0;
+
+    return key_to_params(key, NULL, &p);
 }

 static const OSSL_PARAM *cmac_gettable_params(void *provctx)
 {
-    static const OSSL_PARAM gettable_params[] = {
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_CIPHER, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_ENGINE, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return gettable_params;
+    return cmac_get_params_list;
 }

 static int mac_set_params(void *keydata, const OSSL_PARAM params[])
 {
     MAC_KEY *key = keydata;
-    const OSSL_PARAM *p;
+    struct mac_common_params_st p;

-    if (key == NULL)
+    if (key == NULL || !mac_set_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY);
-    if (p != NULL)
-        return mac_key_fromdata(key, params);
+    if (p.key != NULL)
+        return mac_key_fromdata(key, &p);

     return 1;
 }

 static const OSSL_PARAM *mac_settable_params(void *provctx)
 {
-    static const OSSL_PARAM settable_params[] = {
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return settable_params;
+    return mac_set_params_list;
 }

 static void *mac_gen_init_common(void *provctx, int selection)
@@ -409,38 +417,47 @@ static void *cmac_gen_init(void *provctx, int selection,
     return gctx;
 }

-static int mac_gen_set_params(void *genctx, const OSSL_PARAM params[])
+static int mac_gen_set_params_common(struct mac_gen_ctx *gctx,
+    const struct mac_common_params_st *p)
 {
-    struct mac_gen_ctx *gctx = genctx;
-    const OSSL_PARAM *p;
-
-    if (gctx == NULL)
-        return 0;
-
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING) {
+    if (p->key != NULL) {
+        if (p->key->data_type != OSSL_PARAM_OCTET_STRING) {
             ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
             return 0;
         }
-        gctx->priv_key = OPENSSL_secure_malloc(p->data_size);
+        gctx->priv_key = OPENSSL_secure_malloc(p->key->data_size);
         if (gctx->priv_key == NULL)
             return 0;
-        memcpy(gctx->priv_key, p->data, p->data_size);
-        gctx->priv_key_len = p->data_size;
+        memcpy(gctx->priv_key, p->key->data, p->key->data_size);
+        gctx->priv_key_len = p->key->data_size;
     }

     return 1;
 }

+static int mac_gen_set_params(void *genctx, const OSSL_PARAM params[])
+{
+    struct mac_gen_ctx *gctx = genctx;
+    struct mac_common_params_st p;
+
+    if (gctx == NULL || !mac_gen_set_params_decoder(params, &p))
+        return 0;
+
+    return mac_gen_set_params_common(gctx, &p);
+}
+
 static int cmac_gen_set_params(void *genctx, const OSSL_PARAM params[])
 {
     struct mac_gen_ctx *gctx = genctx;
+    struct mac_common_params_st p;

-    if (!mac_gen_set_params(genctx, params))
+    if (gctx == NULL || !cmac_gen_set_params_decoder(params, &p))
         return 0;

-    if (!ossl_prov_cipher_load_from_params(&gctx->cipher, params,
+    if (!mac_gen_set_params_common(gctx, &p))
+        return 0;
+
+    if (!ossl_prov_cipher_load(&gctx->cipher, p.cipher, p.propq,
             gctx->libctx)) {
         ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
         return 0;
@@ -452,22 +469,13 @@ static int cmac_gen_set_params(void *genctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *mac_gen_settable_params(ossl_unused void *genctx,
     ossl_unused void *provctx)
 {
-    static OSSL_PARAM settable[] = {
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return settable;
+    return mac_gen_set_params_list;
 }

 static const OSSL_PARAM *cmac_gen_settable_params(ossl_unused void *genctx,
     ossl_unused void *provctx)
 {
-    static OSSL_PARAM settable[] = {
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_CIPHER, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return settable;
+    return cmac_gen_set_params_list;
 }

 static void *mac_gen(void *genctx, OSSL_CALLBACK *cb, void *cbarg)
@@ -544,21 +552,19 @@ const OSSL_DISPATCH ossl_mac_legacy_keymgmt_functions[] = {
         (void (*)(void))mac_gen_settable_params },
     { OSSL_FUNC_KEYMGMT_GEN, (void (*)(void))mac_gen },
     { OSSL_FUNC_KEYMGMT_GEN_CLEANUP, (void (*)(void))mac_gen_cleanup },
-    OSSL_FIPS_IND_APPROVED_DISPATCH(OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS,
-        OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS)
-        OSSL_DISPATCH_END
+    OSSL_KEYMGMT_FIPS_APPROVED_GEN_DISPATCH_END
 };

 const OSSL_DISPATCH ossl_cmac_legacy_keymgmt_functions[] = {
     { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))mac_new_cmac },
     { OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))mac_free },
-    { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*)(void))mac_get_params },
+    { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*)(void))cmac_get_params },
     { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*)(void))cmac_gettable_params },
     { OSSL_FUNC_KEYMGMT_SET_PARAMS, (void (*)(void))mac_set_params },
     { OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS, (void (*)(void))mac_settable_params },
     { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))mac_has },
     { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))mac_match },
-    { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))mac_import },
+    { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))cmac_import },
     { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))cmac_imexport_types },
     { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))mac_export },
     { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))cmac_imexport_types },
@@ -568,7 +574,5 @@ const OSSL_DISPATCH ossl_cmac_legacy_keymgmt_functions[] = {
         (void (*)(void))cmac_gen_settable_params },
     { OSSL_FUNC_KEYMGMT_GEN, (void (*)(void))mac_gen },
     { OSSL_FUNC_KEYMGMT_GEN_CLEANUP, (void (*)(void))mac_gen_cleanup },
-    OSSL_FIPS_IND_APPROVED_DISPATCH(OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS,
-        OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS)
-        OSSL_DISPATCH_END
+    OSSL_KEYMGMT_FIPS_APPROVED_GEN_DISPATCH_END
 };
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/mac_legacy_kmgmt.inc.in b/deps/openssl/openssl/providers/implementations/keymgmt/mac_legacy_kmgmt.inc.in
new file mode 100644
index 00000000000..be5ca7e4af5
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/mac_legacy_kmgmt.inc.in
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('mac_import',
+                         (['OSSL_PKEY_PARAM_PRIV_KEY',   'key',   'octet_string'],
+                          ['OSSL_PKEY_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+                         )); -}
+
+{- produce_param_decoder('cmac_import',
+                         (['OSSL_PKEY_PARAM_PRIV_KEY',   'key',    'octet_string'],
+                          ['OSSL_PKEY_PARAM_CIPHER',     'cipher', 'utf8_string'],
+                          ['OSSL_PKEY_PARAM_PROPERTIES', 'propq',  'utf8_string'],
+                         )); -}
+
+{- produce_param_decoder('mac_get_params',
+                         (['OSSL_PKEY_PARAM_PRIV_KEY', 'key', 'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('cmac_get_params',
+                         (['OSSL_PKEY_PARAM_PRIV_KEY', 'key',    'octet_string'],
+                          ['OSSL_PKEY_PARAM_CIPHER',   'cipher', 'utf8_string'],
+                        )); -}
+
+{- produce_param_decoder('mac_set_params',
+                         (['OSSL_PKEY_PARAM_PRIV_KEY', 'key', 'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('mac_gen_set_params',
+                         (['OSSL_PKEY_PARAM_PRIV_KEY', 'key', 'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('cmac_gen_set_params',
+                         (['OSSL_PKEY_PARAM_PRIV_KEY',   'key',    'octet_string'],
+                          ['OSSL_PKEY_PARAM_CIPHER',     'cipher', 'utf8_string'],
+                          ['OSSL_PKEY_PARAM_PROPERTIES', 'propq',  'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/ml_dsa_kmgmt.c b/deps/openssl/openssl/providers/implementations/keymgmt/ml_dsa_kmgmt.c
index 283b789cb66..65793eb8e05 100644
--- a/deps/openssl/openssl/providers/implementations/keymgmt/ml_dsa_kmgmt.c
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/ml_dsa_kmgmt.c
@@ -20,17 +20,20 @@
 #include "prov/providercommon.h"
 #include "prov/provider_ctx.h"
 #include "prov/ml_dsa.h"
-#include "fips/fipsindicator.h"
+#include "providers/implementations/keymgmt/keymgmtcommon.inc"
+
+#define ml_dsa_export_params
+#define ml_dsa_export_params_decoder
+#include "providers/implementations/keymgmt/ml_dsa_kmgmt.inc"

 static OSSL_FUNC_keymgmt_free_fn ml_dsa_free_key;
 static OSSL_FUNC_keymgmt_has_fn ml_dsa_has;
 static OSSL_FUNC_keymgmt_match_fn ml_dsa_match;
 static OSSL_FUNC_keymgmt_import_fn ml_dsa_import;
 static OSSL_FUNC_keymgmt_export_fn ml_dsa_export;
-static OSSL_FUNC_keymgmt_import_types_fn ml_dsa_imexport_types;
-static OSSL_FUNC_keymgmt_export_types_fn ml_dsa_imexport_types;
+static OSSL_FUNC_keymgmt_import_types_fn ml_dsa_import_types;
+static OSSL_FUNC_keymgmt_export_types_fn ml_dsa_export_types;
 static OSSL_FUNC_keymgmt_dup_fn ml_dsa_dup_key;
-static OSSL_FUNC_keymgmt_get_params_fn ml_dsa_get_params;
 static OSSL_FUNC_keymgmt_gettable_params_fn ml_dsa_gettable_params;
 static OSSL_FUNC_keymgmt_validate_fn ml_dsa_validate;
 static OSSL_FUNC_keymgmt_gen_init_fn ml_dsa_gen_init;
@@ -62,7 +65,8 @@ static int ml_dsa_pairwise_test(const ML_DSA_KEY *key)
     int ret = 0;

     if (!ml_dsa_has(key, OSSL_KEYMGMT_SELECT_KEYPAIR)
-        || ossl_fips_self_testing())
+        || ossl_fips_self_testing()
+        || ossl_self_test_in_progress(ST_ID_ASYM_KEYGEN_ML_DSA))
         return 1;

     /*
@@ -109,6 +113,12 @@ ML_DSA_KEY *ossl_prov_ml_dsa_new(PROV_CTX *ctx, const char *propq, int evp_type)
     if (!ossl_prov_is_running())
         return 0;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(ctx),
+            ST_ID_ASYM_KEYGEN_ML_DSA))
+        return NULL;
+#endif
+
     key = ossl_ml_dsa_key_new(PROV_LIBCTX_OF(ctx), propq, evp_type);
     /*
      * When decoding, if the key ends up "loaded" into the same provider, these
@@ -136,6 +146,23 @@ ML_DSA_KEY *ossl_prov_ml_dsa_new(PROV_CTX *ctx, const char *propq, int evp_type)
     return key;
 }

+static ML_DSA_KEY *ossl_prov_ml_dsa_new_ex(PROV_CTX *ctx, const OSSL_PARAM params[], int evp_type)
+{
+    struct ml_dsa_new_key_ex_params_st p;
+    const char *propq = NULL;
+
+    if (!ml_dsa_new_key_ex_params_decoder(params, &p))
+        return 0;
+
+    if (p.propq != NULL) {
+        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING)
+            return 0;
+        propq = p.propq->data;
+    }
+
+    return ossl_prov_ml_dsa_new(ctx, propq, evp_type);
+}
+
 static void ml_dsa_free_key(void *keydata)
 {
     ossl_ml_dsa_key_free((ML_DSA_KEY *)keydata);
@@ -196,39 +223,44 @@ static int ml_dsa_validate(const void *key_data, int selection, int check_type)
 static int ml_dsa_key_fromdata(ML_DSA_KEY *key, const OSSL_PARAM params[],
     int include_private)
 {
-    const OSSL_PARAM *p = NULL;
     const ML_DSA_PARAMS *key_params = ossl_ml_dsa_key_params(key);
     const uint8_t *pk = NULL, *sk = NULL, *seed = NULL;
     size_t pk_len = 0, sk_len = 0, seed_len = 0;
+    struct ml_dsa_import_params_st p;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PUB_KEY);
-    if (p != NULL
-        && !OSSL_PARAM_get_octet_string_ptr(p, (const void **)&pk, &pk_len))
-        return 0;
-    if (pk != NULL && pk_len != key_params->pk_len) {
-        ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH,
-            "Invalid %s public key length", key_params->alg);
+    if (!ml_dsa_import_params_decoder(params, &p))
         return 0;
+
+    if (p.pubkey != NULL) {
+        if (!OSSL_PARAM_get_octet_string_ptr(p.pubkey, (const void **)&pk, &pk_len))
+            return 0;
+        if (pk_len != 0 && pk_len != key_params->pk_len) {
+            ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH,
+                "Invalid %s public key length", key_params->alg);
+            return 0;
+        }
     }

-    /* Private key is optional */
-    if (include_private) {
-        p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_ML_DSA_SEED);
-        if (p != NULL
-            && !OSSL_PARAM_get_octet_string_ptr(p, (const void **)&seed,
+    /* Private key seed is optional */
+    if (p.seed != NULL && include_private) {
+        if (!OSSL_PARAM_get_octet_string_ptr(p.seed, (const void **)&seed,
                 &seed_len))
             return 0;
-        if (seed != NULL && seed_len != ML_DSA_SEED_BYTES) {
+        if (seed_len != 0 && seed_len != ML_DSA_SEED_BYTES) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_SEED_LENGTH);
             return 0;
         }
-        p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY);
-        if (p != NULL
-            && !OSSL_PARAM_get_octet_string_ptr(p, (const void **)&sk, &sk_len))
+    }
+
+    /* Private key is optional */
+    if (p.privkey != NULL && include_private) {
+        if (!OSSL_PARAM_get_octet_string_ptr(p.privkey, (const void **)&sk,
+                &sk_len))
             return 0;
-        if (sk != NULL && sk_len != key_params->sk_len) {
+        if (sk_len != 0 && sk_len != key_params->sk_len) {
             ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH,
-                "Invalid %s private key length", key_params->alg);
+                "Invalid %s private key length",
+                key_params->alg);
             return 0;
         }
     }
@@ -239,6 +271,12 @@ static int ml_dsa_key_fromdata(ML_DSA_KEY *key, const OSSL_PARAM params[],
         return 0;
     }

+    if (p.propq != NULL) {
+        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING)
+            return 0;
+        if (!ossl_ml_dsa_key_fetch_digests(key, p.propq->data))
+            return 0;
+    }
     if (seed_len != 0
         && (sk_len == 0
             || (ossl_ml_dsa_key_get_prov_flags(key) & ML_DSA_KEY_PREFER_SEED))) {
@@ -274,8 +312,18 @@ static int ml_dsa_import(void *keydata, int selection, const OSSL_PARAM params[]
     int include_priv;
     int res;

+    /*
+     * Once a key is fully initialised (has at least a public component),
+     * further mutation is no longer safe and disallowed.
+     */
     if (!ossl_prov_is_running() || key == NULL)
         return 0;
+    if (ossl_ml_dsa_key_has(key, OSSL_KEYMGMT_SELECT_PUBLIC_KEY)) {
+        /* Invalid attempt to mutate a key. */
+        ERR_raise_data(ERR_LIB_PROV, PROV_R_KEY_IMMUTABLE_ONCE_SET,
+            "Keys are immutable once key material has been loaded or generated");
+        return 0;
+    }

     if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
         return 0;
@@ -292,77 +340,81 @@ static int ml_dsa_import(void *keydata, int selection, const OSSL_PARAM params[]
     return res;
 }

-#define ML_DSA_IMEXPORTABLE_PARAMETERS                             \
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ML_DSA_SEED, NULL, 0), \
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PUB_KEY, NULL, 0), \
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0)
+static const OSSL_PARAM *ml_dsa_import_types(int selection)
+{
+    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
+        return NULL;
+    return ml_dsa_import_params_list;
+}

-static const OSSL_PARAM ml_dsa_key_types[] = {
-    ML_DSA_IMEXPORTABLE_PARAMETERS,
-    OSSL_PARAM_END
-};
-static const OSSL_PARAM *ml_dsa_imexport_types(int selection)
+static const OSSL_PARAM *ml_dsa_export_types(int selection)
 {
     if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
         return NULL;
-    return ml_dsa_key_types;
+    return ml_dsa_export_params_list;
 }

-static const OSSL_PARAM ml_dsa_params[] = {
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_MANDATORY_DIGEST, NULL, 0),
-    ML_DSA_IMEXPORTABLE_PARAMETERS,
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *ml_dsa_gettable_params(void *provctx)
 {
-    return ml_dsa_params;
+    return ml_dsa_get_params_list;
 }

 static int ml_dsa_get_params(void *keydata, OSSL_PARAM params[])
 {
     ML_DSA_KEY *key = keydata;
-    OSSL_PARAM *p;
-    const uint8_t *pub, *priv, *seed;
+    const uint8_t *d;
+    size_t len;
+    struct ml_dsa_get_params_st p;

-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
-        && !OSSL_PARAM_set_int(p, 8 * ossl_ml_dsa_key_get_pub_len(key)))
-        return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
-        && !OSSL_PARAM_set_int(p, ossl_ml_dsa_key_get_collision_strength_bits(key)))
-        return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
-        && !OSSL_PARAM_set_int(p, ossl_ml_dsa_key_get_sig_len(key)))
+    if (key == NULL || !ml_dsa_get_params_decoder(params, &p))
         return 0;

-    pub = ossl_ml_dsa_key_get_pub(key);
-    priv = ossl_ml_dsa_key_get_priv(key);
-    seed = ossl_ml_dsa_key_get_seed(key);
+    if (p.bits != NULL
+        && !OSSL_PARAM_set_size_t(p.bits, 8 * ossl_ml_dsa_key_get_pub_len(key)))
+        return 0;

-    if (seed != NULL
-        && (p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ML_DSA_SEED)) != NULL
-        && !OSSL_PARAM_set_octet_string(p, seed, ML_DSA_SEED_BYTES))
+    if (p.secbits != NULL
+        && !OSSL_PARAM_set_size_t(p.secbits, ossl_ml_dsa_key_get_collision_strength_bits(key)))
         return 0;
-    if (priv != NULL
-        && (p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_PRIV_KEY)) != NULL
-        && !OSSL_PARAM_set_octet_string(p, priv,
-            ossl_ml_dsa_key_get_priv_len(key)))
+
+    if (p.maxsize != NULL
+        && !OSSL_PARAM_set_size_t(p.maxsize, ossl_ml_dsa_key_get_sig_len(key)))
         return 0;
-    if (pub != NULL
-        && (p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_PUB_KEY)) != NULL
-        && !OSSL_PARAM_set_octet_string(p, pub,
-            ossl_ml_dsa_key_get_pub_len(key)))
+
+    if (p.seccat != NULL
+        && !OSSL_PARAM_set_int(p.seccat, ossl_ml_dsa_key_get_security_category(key)))
         return 0;
+
+    if (p.seed != NULL) {
+        d = ossl_ml_dsa_key_get_seed(key);
+        if (d != NULL && !OSSL_PARAM_set_octet_string(p.seed, d, ML_DSA_SEED_BYTES))
+            return 0;
+    }
+
+    if (p.privkey != NULL) {
+        d = ossl_ml_dsa_key_get_priv(key);
+        if (d != NULL) {
+            len = ossl_ml_dsa_key_get_priv_len(key);
+            if (!OSSL_PARAM_set_octet_string(p.privkey, d, len))
+                return 0;
+        }
+    }
+
+    if (p.pubkey != NULL) {
+        d = ossl_ml_dsa_key_get_pub(key);
+        if (d != NULL) {
+            len = ossl_ml_dsa_key_get_pub_len(key);
+            if (!OSSL_PARAM_set_octet_string(p.pubkey, d, len))
+                return 0;
+        }
+    }
+
     /*
      * This allows apps to use an empty digest, so that the old API
      * for digest signing can be used.
      */
-    p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MANDATORY_DIGEST);
-    if (p != NULL && !OSSL_PARAM_set_utf8_string(p, ""))
+    if (p.dgstp != NULL && !OSSL_PARAM_set_utf8_string(p.dgstp, ""))
         return 0;
-
     return 1;
 }

@@ -495,27 +547,25 @@ err:
 static int ml_dsa_gen_set_params(void *genctx, const OSSL_PARAM params[])
 {
     struct ml_dsa_gen_ctx *gctx = genctx;
-    const OSSL_PARAM *p;
+    struct ml_dsa_gen_set_params_st p;

-    if (gctx == NULL)
+    if (gctx == NULL || !ml_dsa_gen_set_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_ML_DSA_SEED);
-    if (p != NULL) {
+    if (p.seed != NULL) {
         void *vp = gctx->entropy;
         size_t len = sizeof(gctx->entropy);

-        if (!OSSL_PARAM_get_octet_string(p, &vp, len, &(gctx->entropy_len))) {
+        if (!OSSL_PARAM_get_octet_string(p.seed, &vp, len, &(gctx->entropy_len))) {
             gctx->entropy_len = 0;
             return 0;
         }
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PROPERTIES);
-    if (p != NULL) {
+    if (p.propq != NULL) {
         OPENSSL_free(gctx->propq);
         gctx->propq = NULL;
-        if (!OSSL_PARAM_get_utf8_string(p, &gctx->propq, 0))
+        if (!OSSL_PARAM_get_utf8_string(p.propq, &gctx->propq, 0))
             return 0;
     }
     return 1;
@@ -524,12 +574,7 @@ static int ml_dsa_gen_set_params(void *genctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *ml_dsa_gen_settable_params(ossl_unused void *genctx,
     ossl_unused void *provctx)
 {
-    static OSSL_PARAM settable[] = {
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ML_DSA_SEED, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return settable;
+    return ml_dsa_gen_set_params_list;
 }

 static void ml_dsa_gen_cleanup(void *genctx)
@@ -558,19 +603,24 @@ static void ml_dsa_gen_cleanup(void *genctx)
     {                                                                                         \
         return ossl_prov_ml_dsa_new(provctx, NULL, EVP_PKEY_ML_DSA_##alg);                    \
     }                                                                                         \
+    static void *ml_dsa_##alg##_new_key_ex(void *provctx, const OSSL_PARAM params[])          \
+    {                                                                                         \
+        return ossl_prov_ml_dsa_new_ex(provctx, params, EVP_PKEY_ML_DSA_##alg);               \
+    }                                                                                         \
     static void *ml_dsa_##alg##_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg)         \
     {                                                                                         \
         return ml_dsa_gen(genctx, EVP_PKEY_ML_DSA_##alg);                                     \
     }                                                                                         \
     const OSSL_DISPATCH ossl_ml_dsa_##alg##_keymgmt_functions[] = {                           \
         { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))ml_dsa_##alg##_new_key },                    \
+        { OSSL_FUNC_KEYMGMT_NEW_EX, (void (*)(void))ml_dsa_##alg##_new_key_ex },              \
         { OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))ml_dsa_free_key },                          \
         { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))ml_dsa_has },                                \
         { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))ml_dsa_match },                            \
         { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))ml_dsa_import },                          \
-        { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))ml_dsa_imexport_types },            \
+        { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))ml_dsa_import_types },              \
         { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))ml_dsa_export },                          \
-        { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))ml_dsa_imexport_types },            \
+        { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))ml_dsa_export_types },              \
         DISPATCH_LOAD_FN { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*)(void))ml_dsa_get_params }, \
         { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*)(void))ml_dsa_gettable_params },        \
         { OSSL_FUNC_KEYMGMT_VALIDATE, (void (*)(void))ml_dsa_validate },                      \
@@ -582,9 +632,7 @@ static void ml_dsa_gen_cleanup(void *genctx)
         { OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS,                                              \
             (void (*)(void))ml_dsa_gen_settable_params },                                     \
         { OSSL_FUNC_KEYMGMT_DUP, (void (*)(void))ml_dsa_dup_key },                            \
-        OSSL_FIPS_IND_APPROVED_DISPATCH(OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS,                     \
-            OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS)                                            \
-            OSSL_DISPATCH_END                                                                 \
+        OSSL_KEYMGMT_FIPS_APPROVED_GEN_DISPATCH_END                                           \
     }

 MAKE_KEYMGMT_FUNCTIONS(44);
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/ml_dsa_kmgmt.inc.in b/deps/openssl/openssl/providers/implementations/keymgmt/ml_dsa_kmgmt.inc.in
new file mode 100644
index 00000000000..b26909c88ce
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/ml_dsa_kmgmt.inc.in
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ml_dsa_import_params',
+                         (['OSSL_PKEY_PARAM_ML_DSA_SEED', 'seed',    'octet_string'],
+                          ['OSSL_PKEY_PARAM_PUB_KEY',     'pubkey',  'octet_string'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY',    'privkey', 'octet_string'],
+                          ['OSSL_PKEY_PARAM_PROPERTIES',  'propq', 'utf8_string'],
+                         )); -}
+
+{- produce_param_decoder('ml_dsa_export_params',
+                         (['OSSL_PKEY_PARAM_ML_DSA_SEED', 'seed',    'octet_string'],
+                          ['OSSL_PKEY_PARAM_PUB_KEY',     'pubkey',  'octet_string'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY',    'privkey', 'octet_string']
+                         )); -}
+
+{- produce_param_decoder('ml_dsa_get_params',
+                         (['OSSL_PKEY_PARAM_BITS',              'bits',    'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_BITS',     'secbits', 'int'],
+                          ['OSSL_PKEY_PARAM_MAX_SIZE',          'maxsize', 'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_CATEGORY', 'seccat',  'int'],
+                          ['OSSL_PKEY_PARAM_MANDATORY_DIGEST',  'dgstp',   'utf8_string'],
+                          ['OSSL_PKEY_PARAM_ML_DSA_SEED',       'seed',    'octet_string'],
+                          ['OSSL_PKEY_PARAM_PUB_KEY',           'pubkey',  'octet_string'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY',          'privkey', 'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('ml_dsa_gen_set_params',
+                         (['OSSL_PKEY_PARAM_ML_DSA_SEED', 'seed',  'octet_string'],
+                          ['OSSL_PKEY_PARAM_PROPERTIES',  'propq', 'utf8_string'],
+                         )); -}
+
+{- produce_param_decoder('ml_dsa_new_key_ex_params',
+                         (['OSSL_PKEY_PARAM_PROPERTIES',  'propq', 'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/ml_kem_kmgmt.c b/deps/openssl/openssl/providers/implementations/keymgmt/ml_kem_kmgmt.c
index 5029f1faee0..fac7e0a81f9 100644
--- a/deps/openssl/openssl/providers/implementations/keymgmt/ml_kem_kmgmt.c
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/ml_kem_kmgmt.c
@@ -16,15 +16,22 @@
 #include <openssl/rand.h>
 #include <openssl/self_test.h>
 #include <openssl/param_build.h>
+#include <openssl/cms.h>
 #include "crypto/ml_kem.h"
 #include "internal/fips.h"
 #include "internal/param_build_set.h"
+#include "internal/sizes.h"
+#include "prov/der_hkdf.h"
+#include "prov/der_wrap.h"
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
 #include "prov/provider_ctx.h"
 #include "prov/securitycheck.h"
 #include "prov/ml_kem.h"
-#include "fips/fipsindicator.h"
+#include "providers/implementations/keymgmt/keymgmtcommon.inc"
+#define ml_kem_export_params_st
+#define ml_kem_export_params_decoder
+#include "providers/implementations/keymgmt/ml_kem_kmgmt.inc"

 static OSSL_FUNC_keymgmt_new_fn ml_kem_512_new;
 static OSSL_FUNC_keymgmt_new_fn ml_kem_768_new;
@@ -49,8 +56,8 @@ static OSSL_FUNC_keymgmt_match_fn ml_kem_match;
 static OSSL_FUNC_keymgmt_validate_fn ml_kem_validate;
 static OSSL_FUNC_keymgmt_import_fn ml_kem_import;
 static OSSL_FUNC_keymgmt_export_fn ml_kem_export;
-static OSSL_FUNC_keymgmt_import_types_fn ml_kem_imexport_types;
-static OSSL_FUNC_keymgmt_export_types_fn ml_kem_imexport_types;
+static OSSL_FUNC_keymgmt_import_types_fn ml_kem_import_types;
+static OSSL_FUNC_keymgmt_export_types_fn ml_kem_export_types;
 static OSSL_FUNC_keymgmt_dup_fn ml_kem_dup;

 static const int minimal_selection = OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS
@@ -87,7 +94,9 @@ static int ml_kem_pairwise_test(const ML_KEM_KEY *key, int key_flags)
         return 1;
 #ifdef FIPS_MODULE
     /* During self test, it is a waste to do this test */
-    if (ossl_fips_self_testing())
+    if (ossl_fips_self_testing()
+        || ossl_self_test_in_progress(ST_ID_ASYM_KEYGEN_ML_KEM)
+        || ossl_self_test_in_progress(ST_ID_KEM_ML_KEM))
         return 1;

     /*
@@ -157,6 +166,13 @@ ML_KEM_KEY *ossl_prov_ml_kem_new(PROV_CTX *ctx, const char *propq, int evp_type)

     if (!ossl_prov_is_running())
         return NULL;
+
+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(ctx),
+            ST_ID_ASYM_KEYGEN_ML_KEM))
+        return NULL;
+#endif
+
     /*
      * When decoding, if the key ends up "loaded" into the same provider, these
      * are the correct config settings, otherwise, new values will be assigned
@@ -237,7 +253,7 @@ static int ml_kem_export(void *vkey, int selection, OSSL_CALLBACK *param_cb,
 {
     ML_KEM_KEY *key = vkey;
     OSSL_PARAM_BLD *tmpl = NULL;
-    OSSL_PARAM *params = NULL, *p;
+    OSSL_PARAM *params = NULL;
     const ML_KEM_VINFO *v;
     uint8_t *pubenc = NULL, *prvenc = NULL, *seedenc = NULL;
     size_t prvlen = 0, seedlen = 0;
@@ -316,13 +332,7 @@ static int ml_kem_export(void *vkey, int selection, OSSL_CALLBACK *param_cb,
         goto err;

     ret = param_cb(params, cbarg);
-    /*
-     * OSSL_PARAM_free() only wipes the secure-heap data block,
-     * so wipe the key material copies held in the params first.
-     */
-    for (p = params; p->key != NULL; p++)
-        OPENSSL_cleanse(p->data, p->data_size);
-    OSSL_PARAM_free(params);
+    OSSL_PARAM_clear_free(params);

 err:
     OSSL_PARAM_BLD_free(tmpl);
@@ -332,17 +342,17 @@ err:
     return ret;
 }

-static const OSSL_PARAM *ml_kem_imexport_types(int selection)
+static const OSSL_PARAM *ml_kem_import_types(int selection)
 {
-    static const OSSL_PARAM key_types[] = {
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ML_KEM_SEED, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PUB_KEY, NULL, 0),
-        OSSL_PARAM_END
-    };
+    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0)
+        return ml_kem_import_params_list;
+    return NULL;
+}

+static const OSSL_PARAM *ml_kem_export_types(int selection)
+{
     if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0)
-        return key_types;
+        return ml_kem_export_params_list;
     return NULL;
 }

@@ -383,17 +393,15 @@ static int check_prvenc(const uint8_t *prvenc, ML_KEM_KEY *key)
     return 0;
 }

-static int ml_kem_key_fromdata(ML_KEM_KEY *key,
-    const OSSL_PARAM params[],
+static int ml_kem_key_fromdata(ML_KEM_KEY *key, const OSSL_PARAM params[],
     int include_private)
 {
-    const OSSL_PARAM *p = NULL;
     const void *pubenc = NULL, *prvenc = NULL, *seedenc = NULL;
     size_t publen = 0, prvlen = 0, seedlen = 0, puboff;
     const ML_KEM_VINFO *v;
+    struct ml_kem_import_params_st p;

-    /* Invalid attempt to mutate a key, what is the right error to report? */
-    if (key == NULL || ossl_ml_kem_have_pubkey(key))
+    if (!ml_kem_import_params_decoder(params, &p))
         return 0;
     v = ossl_ml_kem_key_vinfo(key);

@@ -401,23 +409,22 @@ static int ml_kem_key_fromdata(ML_KEM_KEY *key,
      * When a private key is provided, without a seed, any public key also
      * provided will be ignored (apart from length), just as with the seed.
      */
-    if (include_private) {
+    if (p.seed != NULL && include_private) {
         /*
          * When a seed is provided, the private and public keys may be ignored,
          * after validating just their lengths.  Comparing encodings or hashes
          * when applicable is possible, but not currently implemented.
          */
-        p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_ML_KEM_SEED);
-        if (p != NULL
-            && OSSL_PARAM_get_octet_string_ptr(p, &seedenc, &seedlen) != 1)
+        if (OSSL_PARAM_get_octet_string_ptr(p.seed, &seedenc, &seedlen) != 1)
             return 0;
         if (seedlen != 0 && seedlen != ML_KEM_SEED_BYTES) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_SEED_LENGTH);
             return 0;
         }
-        p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY);
-        if (p != NULL
-            && OSSL_PARAM_get_octet_string_ptr(p, &prvenc, &prvlen) != 1)
+    }
+
+    if (p.privkey != NULL && include_private) {
+        if (OSSL_PARAM_get_octet_string_ptr(p.privkey, &prvenc, &prvlen) != 1)
             return 0;
         if (prvlen != 0 && prvlen != v->prvkey_bytes) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
@@ -426,13 +433,13 @@ static int ml_kem_key_fromdata(ML_KEM_KEY *key,
     }

     /* Used only when no seed or private key is provided. */
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PUB_KEY);
-    if (p != NULL
-        && OSSL_PARAM_get_octet_string_ptr(p, &pubenc, &publen) != 1)
-        return 0;
-    if (publen != 0 && publen != v->pubkey_bytes) {
-        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
-        return 0;
+    if (p.pubkey != NULL) {
+        if (OSSL_PARAM_get_octet_string_ptr(p.pubkey, &pubenc, &publen) != 1)
+            return 0;
+        if (publen != 0 && publen != v->pubkey_bytes) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
+            return 0;
+        }
     }

     /* The caller MUST specify at least one of seed, private or public keys. */
@@ -452,6 +459,12 @@ static int ml_kem_key_fromdata(ML_KEM_KEY *key,
             return 0;
         }
     }
+    if (p.propq != NULL) {
+        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING)
+            return 0;
+        if (!ossl_ml_kem_key_fetch_digest(key, p.propq->data))
+            return 0;
+    }

     if (seedlen != 0
         && (prvlen == 0 || (key->prov_flags & ML_KEM_KEY_PREFER_SEED))) {
@@ -473,11 +486,16 @@ static int ml_kem_import(void *vkey, int selection, const OSSL_PARAM params[])
     int include_private;
     int res;

-    if (!ossl_prov_is_running() || key == NULL)
+    if (!ossl_prov_is_running()
+        || (selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0
+        || key == NULL)
         return 0;
-
-    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
+    if (ossl_ml_kem_have_pubkey(key)) {
+        /* Invalid attempt to mutate a key. */
+        ERR_raise_data(ERR_LIB_PROV, PROV_R_KEY_IMMUTABLE_ONCE_SET,
+            "Keys are immutable once key material has been loaded or generated");
         return 0;
+    }

     include_private = selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY ? 1 : 0;
     res = ml_kem_key_fromdata(key, params, include_private);
@@ -491,22 +509,7 @@ static int ml_kem_import(void *vkey, int selection, const OSSL_PARAM params[])

 static const OSSL_PARAM *ml_kem_gettable_params(void *provctx)
 {
-    static const OSSL_PARAM arr[] = {
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
-        /* Exported for import */
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ML_KEM_SEED, NULL, 0),
-        /* Exported to EVP_PKEY_get_raw_private_key() */
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0),
-        /* Exported to EVP_PKEY_get_raw_public_key() */
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PUB_KEY, NULL, 0),
-        /* Needed by EVP_PKEY_get1_encoded_public_key() */
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
-        OSSL_PARAM_END
-    };
-
-    return arr;
+    return ml_kem_get_params_list;
 }

 #ifndef FIPS_MODULE
@@ -545,126 +548,138 @@ static void *ml_kem_load(const void *reference, size_t reference_sz)
             if (!ml_kem_pairwise_test(key, key->prov_flags))
                 goto err;
         }
-        OPENSSL_clear_free(encoded_dk, key->vinfo->prvkey_bytes);
+        OPENSSL_secure_clear_free(encoded_dk, key->vinfo->prvkey_bytes);
         OPENSSL_cleanse((void *)seed, sizeof(seed));
         return key;
     }

 err:
     if (key != NULL && key->vinfo != NULL)
-        OPENSSL_clear_free(encoded_dk, key->vinfo->prvkey_bytes);
+        OPENSSL_secure_clear_free(encoded_dk, key->vinfo->prvkey_bytes);
     OPENSSL_cleanse((void *)seed, sizeof(seed));
     ossl_ml_kem_key_free(key);
     return NULL;
 }
 #endif

+static int ml_kem_get_key_param(const ML_KEM_KEY *key, OSSL_PARAM *p,
+    size_t bytes,
+    int (*get_f)(uint8_t *out, size_t len,
+        const ML_KEM_KEY *key))
+{
+    if (p->data_type != OSSL_PARAM_OCTET_STRING)
+        return 0;
+    p->return_size = bytes;
+    if (p->data != NULL)
+        if (p->data_size < p->return_size
+            || !(*get_f)(p->data, p->return_size, key))
+            return 0;
+    return 1;
+}
+
 /*
  * It is assumed the key is guaranteed non-NULL here, and is from this provider
  */
 static int ml_kem_get_params(void *vkey, OSSL_PARAM params[])
 {
     ML_KEM_KEY *key = vkey;
-    const ML_KEM_VINFO *v = ossl_ml_kem_key_vinfo(key);
-    OSSL_PARAM *p;
-    const char *pubparams[] = {
-        OSSL_PKEY_PARAM_PUB_KEY,
-        OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY
-    };
-    int i;
-
-    p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS);
-    if (p != NULL)
-        if (!OSSL_PARAM_set_int(p, v->bits))
-            return 0;
+    const ML_KEM_VINFO *v;
+    struct ml_kem_get_params_st p;

-    p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS);
-    if (p != NULL)
-        if (!OSSL_PARAM_set_int(p, v->secbits))
-            return 0;
+    if (key == NULL || !ml_kem_get_params_decoder(params, &p))
+        return 0;
+
+    v = ossl_ml_kem_key_vinfo(key);
+
+    if (p.bits != NULL && !OSSL_PARAM_set_size_t(p.bits, v->bits))
+        return 0;

-    p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE);
-    if (p != NULL)
-        if (!OSSL_PARAM_set_int(p, v->ctext_bytes))
+    if (p.secbits != NULL && !OSSL_PARAM_set_size_t(p.secbits, v->secbits))
+        return 0;
+
+    if (p.maxsize != NULL && !OSSL_PARAM_set_size_t(p.maxsize, v->ctext_bytes))
+        return 0;
+
+    if (p.seccat != NULL && !OSSL_PARAM_set_int(p.seccat, v->security_category))
+        return 0;
+
+    if (p.pubkey != NULL && ossl_ml_kem_have_pubkey(key)) {
+        /* Exported to EVP_PKEY_get_raw_public_key() */
+        if (!ml_kem_get_key_param(key, p.pubkey, v->pubkey_bytes,
+                &ossl_ml_kem_encode_public_key))
             return 0;
+    }

-    if (ossl_ml_kem_have_pubkey(key)) {
-        uint8_t *pubenc = NULL;
-
-        for (i = 0; i < 2; ++i) {
-            p = OSSL_PARAM_locate(params, pubparams[i]);
-            if (p == NULL)
-                continue;
-            if (p->data_type != OSSL_PARAM_OCTET_STRING)
-                return 0;
-            p->return_size = v->pubkey_bytes;
-            if (p->data == NULL)
-                continue;
-            if (p->data_size < p->return_size)
-                return 0;
-            if (pubenc != NULL) {
-                memcpy(p->data, pubenc, p->return_size);
-                continue;
-            }
-            if (!ossl_ml_kem_encode_public_key(p->data, p->return_size, key))
-                return 0;
-            pubenc = p->data;
-        }
+    if (p.encpubkey != NULL && ossl_ml_kem_have_pubkey(key)) {
+        /* Needed by EVP_PKEY_get1_encoded_public_key() */
+        if (!ml_kem_get_key_param(key, p.encpubkey, v->pubkey_bytes,
+                &ossl_ml_kem_encode_public_key))
+            return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_PRIV_KEY);
-    if (p != NULL && ossl_ml_kem_have_prvkey(key)) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING)
+    if (p.privkey != NULL && ossl_ml_kem_have_prvkey(key)) {
+        /* Exported to EVP_PKEY_get_raw_private_key() */
+        if (!ml_kem_get_key_param(key, p.privkey, v->prvkey_bytes,
+                &ossl_ml_kem_encode_private_key))
             return 0;
-        p->return_size = v->prvkey_bytes;
-        if (p->data != NULL) {
-            if (p->data_size < p->return_size)
-                return 0;
-            if (!ossl_ml_kem_encode_private_key(p->data, p->return_size, key))
-                return 0;
-        }
     }

-    p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ML_KEM_SEED);
-    if (p != NULL && ossl_ml_kem_have_seed(key)) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING)
+    if (p.seed != NULL && ossl_ml_kem_have_seed(key)) {
+        /* Exported for import */
+        if (!ml_kem_get_key_param(key, p.seed, ML_KEM_SEED_BYTES,
+                &ossl_ml_kem_encode_seed))
             return 0;
-        p->return_size = ML_KEM_SEED_BYTES;
-        if (p->data != NULL) {
-            if (p->data_size < p->return_size)
-                return 0;
-            if (!ossl_ml_kem_encode_seed(p->data, p->return_size, key))
-                return 0;
+    }
+
+#ifndef OPENSSL_NO_CMS
+    if (p.ri_type != NULL && !OSSL_PARAM_set_int(p.ri_type, CMS_RECIPINFO_KEM))
+        return 0;
+
+    if (p.kemri_kdf_alg != NULL) {
+        uint8_t aid_buf[OSSL_MAX_ALGORITHM_ID_SIZE];
+        int ret;
+        size_t aid_len = 0;
+        WPACKET pkt;
+        uint8_t *aid = NULL;
+
+        ret = WPACKET_init_der(&pkt, aid_buf, sizeof(aid_buf));
+        ret &= ossl_DER_w_begin_sequence(&pkt, -1)
+            && ossl_DER_w_precompiled(&pkt, -1, ossl_der_oid_id_alg_hkdf_with_sha256,
+                sizeof(ossl_der_oid_id_alg_hkdf_with_sha256))
+            && ossl_DER_w_end_sequence(&pkt, -1);
+        if (ret && WPACKET_finish(&pkt)) {
+            WPACKET_get_total_written(&pkt, &aid_len);
+            aid = WPACKET_get_curr(&pkt);
         }
+        WPACKET_cleanup(&pkt);
+        if (!ret)
+            return 0;
+        if (aid != NULL && aid_len != 0 && !OSSL_PARAM_set_octet_string(p.kemri_kdf_alg, aid, aid_len))
+            return 0;
     }
+#endif

     return 1;
 }

 static const OSSL_PARAM *ml_kem_settable_params(void *provctx)
 {
-    static const OSSL_PARAM arr[] = {
-        /* Used in TLS via EVP_PKEY_set1_encoded_public_key(). */
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
-        OSSL_PARAM_END
-    };
-
-    return arr;
+    return ml_kem_set_params_list;
 }

 static int ml_kem_set_params(void *vkey, const OSSL_PARAM params[])
 {
     ML_KEM_KEY *key = vkey;
-    const OSSL_PARAM *p;
     const void *pubenc = NULL;
     size_t publen = 0;
+    struct ml_kem_set_params_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (key == NULL || !ml_kem_set_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY);
-    if (p != NULL
-        && (OSSL_PARAM_get_octet_string_ptr(p, &pubenc, &publen) != 1
+    /* Used in TLS via EVP_PKEY_set1_encoded_public_key(). */
+    if (p.pub != NULL
+        && (OSSL_PARAM_get_octet_string_ptr(p.pub, &pubenc, &publen) != 1
             || publen != key->vinfo->pubkey_bytes)) {
         ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY);
         return 0;
@@ -675,9 +690,8 @@ static int ml_kem_set_params(void *vkey, const OSSL_PARAM params[])

     /* Key mutation is reportedly generally not allowed */
     if (ossl_ml_kem_have_pubkey(key)) {
-        ERR_raise_data(ERR_LIB_PROV,
-            PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE,
-            "ML-KEM keys cannot be mutated");
+        ERR_raise_data(ERR_LIB_PROV, PROV_R_KEY_IMMUTABLE_ONCE_SET,
+            "Keys are immutable once key material has been loaded or generated");
         return 0;
     }

@@ -687,28 +701,24 @@ static int ml_kem_set_params(void *vkey, const OSSL_PARAM params[])
 static int ml_kem_gen_set_params(void *vgctx, const OSSL_PARAM params[])
 {
     PROV_ML_KEM_GEN_CTX *gctx = vgctx;
-    const OSSL_PARAM *p;
+    struct ml_kem_gen_set_params_st p;

-    if (gctx == NULL)
+    if (gctx == NULL || !ml_kem_gen_set_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PROPERTIES);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
+    if (p.propq != NULL) {
+        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING)
             return 0;
         OPENSSL_free(gctx->propq);
-        if ((gctx->propq = OPENSSL_strdup(p->data)) == NULL)
+        if ((gctx->propq = OPENSSL_strdup(p.propq->data)) == NULL)
             return 0;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_ML_KEM_SEED);
-    if (p != NULL) {
+    if (p.seed != NULL) {
         size_t len = ML_KEM_SEED_BYTES;

         gctx->seed = gctx->seedbuf;
-        if (OSSL_PARAM_get_octet_string(p, (void **)&gctx->seed, len, &len)
+        if (OSSL_PARAM_get_octet_string(p.seed, (void **)&gctx->seed, len, &len)
             && len == ML_KEM_SEED_BYTES)
             return 1;

@@ -749,11 +759,7 @@ static void *ml_kem_gen_init(void *provctx, int selection,
 static const OSSL_PARAM *ml_kem_gen_settable_params(ossl_unused void *vgctx,
     ossl_unused void *provctx)
 {
-    static OSSL_PARAM settable[] = {
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ML_KEM_SEED, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return settable;
+    return ml_kem_gen_set_params_list;
 }

 static void *ml_kem_gen(void *vgctx, OSSL_CALLBACK *osslcb, void *cbarg)
@@ -836,6 +842,8 @@ static void ml_kem_free_key(void *keydata)
 #endif

 #define DECLARE_VARIANT(bits)                                                             \
+    static OSSL_FUNC_keymgmt_new_fn ml_kem_##bits##_new;                                  \
+    static OSSL_FUNC_keymgmt_gen_init_fn ml_kem_##bits##_gen_init;                        \
     static void *ml_kem_##bits##_new(void *provctx)                                       \
     {                                                                                     \
         return ossl_prov_ml_kem_new(provctx, NULL, EVP_PKEY_ML_KEM_##bits);               \
@@ -863,12 +871,10 @@ static void ml_kem_free_key(void *keydata)
         { OSSL_FUNC_KEYMGMT_GEN_CLEANUP, (OSSL_FUNC)ml_kem_gen_cleanup },                 \
         DISPATCH_LOAD_FN { OSSL_FUNC_KEYMGMT_DUP, (OSSL_FUNC)ml_kem_dup },                \
         { OSSL_FUNC_KEYMGMT_IMPORT, (OSSL_FUNC)ml_kem_import },                           \
-        { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (OSSL_FUNC)ml_kem_imexport_types },             \
+        { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (OSSL_FUNC)ml_kem_import_types },               \
         { OSSL_FUNC_KEYMGMT_EXPORT, (OSSL_FUNC)ml_kem_export },                           \
-        { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (OSSL_FUNC)ml_kem_imexport_types },             \
-        OSSL_FIPS_IND_APPROVED_DISPATCH(OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS,                 \
-            OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS)                                        \
-            OSSL_DISPATCH_END                                                             \
+        { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (OSSL_FUNC)ml_kem_export_types },               \
+        OSSL_KEYMGMT_FIPS_APPROVED_GEN_DISPATCH_END                                       \
     }
 DECLARE_VARIANT(512);
 DECLARE_VARIANT(768);
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/ml_kem_kmgmt.inc.in b/deps/openssl/openssl/providers/implementations/keymgmt/ml_kem_kmgmt.inc.in
new file mode 100644
index 00000000000..fa749ebe166
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/ml_kem_kmgmt.inc.in
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ml_kem_import_params',
+                         (['OSSL_PKEY_PARAM_ML_KEM_SEED', 'seed',    'octet_string'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY',    'privkey', 'octet_string'],
+                          ['OSSL_PKEY_PARAM_PUB_KEY',     'pubkey',  'octet_string'],
+                          ['OSSL_PKEY_PARAM_PROPERTIES',  'propq', 'utf8_string']
+                         )); -}
+{- produce_param_decoder('ml_kem_export_params',
+                         (['OSSL_PKEY_PARAM_ML_KEM_SEED', 'seed',    'octet_string'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY',    'privkey', 'octet_string'],
+                          ['OSSL_PKEY_PARAM_PUB_KEY',     'pubkey',  'octet_string']
+                         )); -}
+
+{- produce_param_decoder('ml_kem_get_params',
+                         (['OSSL_PKEY_PARAM_BITS',               'bits',      'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_BITS',      'secbits',   'int'],
+                          ['OSSL_PKEY_PARAM_MAX_SIZE',           'maxsize',   'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_CATEGORY',  'seccat',    'int'],
+                          ['OSSL_PKEY_PARAM_ML_KEM_SEED',        'seed',      'octet_string'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY',           'privkey',   'octet_string'],
+                          ['OSSL_PKEY_PARAM_PUB_KEY',            'pubkey',    'octet_string'],
+                          ['OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY', 'encpubkey', 'octet_string'],
+                          ['OSSL_PKEY_PARAM_CMS_RI_TYPE',        'ri_type',   'int'],
+                          ['OSSL_PKEY_PARAM_CMS_KEMRI_KDF_ALGORITHM', 'kemri_kdf_alg', 'octet_string'],
+                          )); -}
+
+{- produce_param_decoder('ml_kem_set_params',
+                         (['OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY', 'pub', 'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('ml_kem_gen_set_params',
+                         (['OSSL_PKEY_PARAM_ML_KEM_SEED', 'seed',  'octet_string'],
+                          ['OSSL_PKEY_PARAM_PROPERTIES',  'propq', 'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/mlx_kmgmt.c b/deps/openssl/openssl/providers/implementations/keymgmt/mlx_kmgmt.c
index a36caff871c..b50f1d8575c 100644
--- a/deps/openssl/openssl/providers/implementations/keymgmt/mlx_kmgmt.c
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/mlx_kmgmt.c
@@ -19,11 +19,13 @@
 #include "internal/nelem.h"
 #include "internal/param_build_set.h"
 #include "prov/implementations.h"
+#include "prov/names.h"
 #include "prov/mlx_kem.h"
+#include "providers/implementations/keymgmt/keymgmtcommon.inc"
 #include "prov/provider_ctx.h"
 #include "prov/providercommon.h"
 #include "prov/securitycheck.h"
-#include "fips/fipsindicator.h"
+#include "providers/implementations/keymgmt/mlx_kmgmt.inc"

 static OSSL_FUNC_keymgmt_gen_fn mlx_kem_gen;
 static OSSL_FUNC_keymgmt_gen_cleanup_fn mlx_kem_gen_cleanup;
@@ -51,6 +53,14 @@ static const ECDH_VINFO hybrid_vtable[] = {
 #if !defined(OPENSSL_NO_ECX)
     { "X25519", NULL, 32, 32, 32, 0, EVP_PKEY_ML_KEM_768 },
     { "X448", NULL, 56, 56, 56, 0, EVP_PKEY_ML_KEM_1024 },
+#else
+    { NULL, NULL, 0, 0, 0, 0, NID_undef },
+    { NULL, NULL, 0, 0, 0, 0, NID_undef },
+#endif
+#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_SM2)
+    { "curveSM2", "SM2", 65, 32, 32, 1, EVP_PKEY_ML_KEM_768 },
+#else
+    { NULL, NULL, 0, 0, 0, 0, NID_undef },
 #endif
 };

@@ -161,21 +171,21 @@ typedef struct export_cb_arg_st {
 static int export_sub_cb(const OSSL_PARAM *params, void *varg)
 {
     EXPORT_CB_ARG *sub_arg = varg;
-    const OSSL_PARAM *p = NULL;
+    struct ml_kem_import_export_st p;
     size_t len;

+    if (!ml_kem_import_export_decoder(params, &p))
+        return 0;
+
     /*
      * The caller will decide whether anything essential is missing, but, if
      * some key material was returned, it should have the right (parameter)
      * data type and length.
      */
-    if (ossl_param_is_empty(params))
-        return 1;
-    if (sub_arg->pubenc != NULL
-        && (p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PUB_KEY)) != NULL) {
+    if (sub_arg->pubenc != NULL && p.pubkey != NULL) {
         void *pub = sub_arg->pubenc + sub_arg->puboff;

-        if (OSSL_PARAM_get_octet_string(p, &pub, sub_arg->publen, &len) != 1)
+        if (OSSL_PARAM_get_octet_string(p.pubkey, &pub, sub_arg->publen, &len) != 1)
             return 0;
         if (len != sub_arg->publen) {
             ERR_raise_data(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR,
@@ -186,11 +196,10 @@ static int export_sub_cb(const OSSL_PARAM *params, void *varg)
         }
         ++sub_arg->pubcount;
     }
-    if (sub_arg->prvenc != NULL
-        && (p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY)) != NULL) {
+    if (sub_arg->prvenc != NULL && p.privkey != NULL) {
         void *prv = sub_arg->prvenc + sub_arg->prvoff;

-        if (OSSL_PARAM_get_octet_string(p, &prv, sub_arg->prvlen, &len) != 1)
+        if (OSSL_PARAM_get_octet_string(p.privkey, &prv, sub_arg->prvlen, &len) != 1)
             return 0;
         if (len != sub_arg->prvlen) {
             ERR_raise_data(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR,
@@ -246,7 +255,7 @@ static int mlx_kem_export(void *vkey, int selection, OSSL_CALLBACK *param_cb,
 {
     MLX_KEY *key = vkey;
     OSSL_PARAM_BLD *tmpl = NULL;
-    OSSL_PARAM *params = NULL, *p;
+    OSSL_PARAM *params = NULL;
     size_t publen;
     size_t prvlen;
     int ret = 0;
@@ -308,13 +317,7 @@ static int mlx_kem_export(void *vkey, int selection, OSSL_CALLBACK *param_cb,
         goto err;

     ret = param_cb(params, cbarg);
-    /*
-     * OSSL_PARAM_free() only wipes the secure-heap data block,
-     * so wipe the key material copies held in the params first.
-     */
-    for (p = params; p->key != NULL; p++)
-        OPENSSL_cleanse(p->data, p->data_size);
-    OSSL_PARAM_free(params);
+    OSSL_PARAM_clear_free(params);

 err:
     OSSL_PARAM_BLD_free(tmpl);
@@ -325,14 +328,8 @@ err:

 static const OSSL_PARAM *mlx_kem_imexport_types(int selection)
 {
-    static const OSSL_PARAM key_types[] = {
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PUB_KEY, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0),
-        OSSL_PARAM_END
-    };
-
     if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0)
-        return key_types;
+        return ml_kem_import_export_list;
     return NULL;
 }

@@ -392,13 +389,17 @@ load_keys(MLX_KEY *key,
             /* Ignore public keys when private provided */
             if (!load_slot(key->libctx, key->propq, OSSL_PKEY_PARAM_PRIV_KEY,
                     minimal_selection, key, slot, prvenc,
-                    key->minfo->prvkey_bytes, key->xinfo->prvkey_bytes))
+                    (int)key->minfo->prvkey_bytes,
+                    (int)key->xinfo->prvkey_bytes))
                 goto err;
         } else if (publen) {
             /* Absent private key data, import public keys */
             if (!load_slot(key->libctx, key->propq, OSSL_PKEY_PARAM_PUB_KEY,
-                    minimal_selection, key, slot, pubenc,
-                    key->minfo->pubkey_bytes, key->xinfo->pubkey_bytes))
+                    OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS
+                        | OSSL_KEYMGMT_SELECT_PUBLIC_KEY,
+                    key, slot, pubenc,
+                    (int)key->minfo->pubkey_bytes,
+                    (int)key->xinfo->pubkey_bytes))
                 goto err;
         }
     }
@@ -417,7 +418,7 @@ static int mlx_kem_key_fromdata(MLX_KEY *key,
     const OSSL_PARAM params[],
     int include_private)
 {
-    const OSSL_PARAM *param_prv_key = NULL, *param_pub_key;
+    struct ml_kem_import_export_st p;
     const void *pubenc = NULL, *prvenc = NULL;
     size_t pubkey_bytes, prvkey_bytes;
     size_t publen = 0, prvlen = 0;
@@ -428,14 +429,15 @@ static int mlx_kem_key_fromdata(MLX_KEY *key,
     pubkey_bytes = key->minfo->pubkey_bytes + key->xinfo->pubkey_bytes;
     prvkey_bytes = key->minfo->prvkey_bytes + key->xinfo->prvkey_bytes;

+    if (!ml_kem_import_export_decoder(params, &p))
+        return 0;
+
     /* What does the caller want to set? */
-    param_pub_key = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PUB_KEY);
-    if (param_pub_key != NULL && OSSL_PARAM_get_octet_string_ptr(param_pub_key, &pubenc, &publen) != 1)
+    if (p.pubkey != NULL && OSSL_PARAM_get_octet_string_ptr(p.pubkey, &pubenc, &publen) != 1)
         return 0;
-    if (include_private)
-        param_prv_key = OSSL_PARAM_locate_const(params,
-            OSSL_PKEY_PARAM_PRIV_KEY);
-    if (param_prv_key != NULL && OSSL_PARAM_get_octet_string_ptr(param_prv_key, &prvenc, &prvlen) != 1)
+    if (include_private
+        && p.privkey != NULL
+        && OSSL_PARAM_get_octet_string_ptr(p.privkey, &prvenc, &prvlen) != 1)
         return 0;

     /* The caller MUST specify at least one of the public or private keys. */
@@ -478,16 +480,7 @@ static int mlx_kem_import(void *vkey, int selection, const OSSL_PARAM params[])

 static const OSSL_PARAM *mlx_kem_gettable_params(void *provctx)
 {
-    static const OSSL_PARAM arr[] = {
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0),
-        OSSL_PARAM_END
-    };
-
-    return arr;
+    return mlx_get_params_list;
 }

 /*
@@ -496,36 +489,41 @@ static const OSSL_PARAM *mlx_kem_gettable_params(void *provctx)
 static int mlx_kem_get_params(void *vkey, OSSL_PARAM params[])
 {
     MLX_KEY *key = vkey;
-    OSSL_PARAM *p, *pub, *prv = NULL;
+    OSSL_PARAM *pub, *prv = NULL;
     EXPORT_CB_ARG sub_arg;
     int selection;
-    size_t publen = key->minfo->pubkey_bytes + key->xinfo->pubkey_bytes;
-    size_t prvlen = key->minfo->prvkey_bytes + key->xinfo->prvkey_bytes;
+    struct mlx_get_params_st p;
+
+    if (key == NULL || !mlx_get_params_decoder(params, &p))
+        return 0;

     /* The reported "bit" count is those of the ML-KEM key */
-    p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS);
-    if (p != NULL)
-        if (!OSSL_PARAM_set_int(p, key->minfo->bits))
+    if (p.bits != NULL)
+        if (!OSSL_PARAM_set_int(p.bits, key->minfo->bits))
             return 0;

     /* The reported security bits are those of the ML-KEM key */
-    p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS);
-    if (p != NULL)
-        if (!OSSL_PARAM_set_int(p, key->minfo->secbits))
+    if (p.secbits != NULL)
+        if (!OSSL_PARAM_set_int(p.secbits, key->minfo->secbits))
+            return 0;
+
+    /* The reported security category are those of the ML-KEM key */
+    if (p.seccat != NULL)
+        if (!OSSL_PARAM_set_int(p.seccat, key->minfo->security_category))
             return 0;

     /* The ciphertext sizes are additive */
-    p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE);
-    if (p != NULL)
-        if (!OSSL_PARAM_set_int(p, key->minfo->ctext_bytes + key->xinfo->pubkey_bytes))
+    if (p.maxsize != NULL)
+        if (!OSSL_PARAM_set_size_t(p.maxsize, key->minfo->ctext_bytes + key->xinfo->pubkey_bytes))
             return 0;

     if (!mlx_kem_have_pubkey(key))
         return 1;

     memset(&sub_arg, 0, sizeof(sub_arg));
-    pub = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY);
-    if (pub != NULL) {
+    if ((pub = p.pub) != NULL) {
+        size_t publen = key->minfo->pubkey_bytes + key->xinfo->pubkey_bytes;
+
         if (pub->data_type != OSSL_PARAM_OCTET_STRING)
             return 0;
         pub->return_size = publen;
@@ -542,8 +540,9 @@ static int mlx_kem_get_params(void *vkey, OSSL_PARAM params[])
         }
     }
     if (mlx_kem_have_prvkey(key)) {
-        prv = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_PRIV_KEY);
-        if (prv != NULL) {
+        if ((prv = p.priv) != NULL) {
+            size_t prvlen = key->minfo->prvkey_bytes + key->xinfo->prvkey_bytes;
+
             if (prv->data_type != OSSL_PARAM_OCTET_STRING)
                 return 0;
             prv->return_size = prvlen;
@@ -587,27 +586,27 @@ static int mlx_kem_get_params(void *vkey, OSSL_PARAM params[])

 static const OSSL_PARAM *mlx_kem_settable_params(void *provctx)
 {
-    static const OSSL_PARAM arr[] = {
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
-        OSSL_PARAM_END
-    };
-
-    return arr;
+    return mlx_set_params_list;
 }

 static int mlx_kem_set_params(void *vkey, const OSSL_PARAM params[])
 {
     MLX_KEY *key = vkey;
-    const OSSL_PARAM *p;
+    struct mlx_set_params_st p;
     const void *pubenc = NULL;
     size_t publen = 0;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (key == NULL || !mlx_set_params_decoder(params, &p))
+        return 0;

-    /* Only one settable parameter is supported */
-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY);
-    if (p == NULL)
+    if (p.propq != NULL) {
+        OPENSSL_free(key->propq);
+        key->propq = NULL;
+        if (!OSSL_PARAM_get_utf8_string(p.propq, &key->propq, 0))
+            return 0;
+    }
+
+    if (p.pub == NULL)
         return 1;

     /* Key mutation is reportedly generally not allowed */
@@ -618,17 +617,9 @@ static int mlx_kem_set_params(void *vkey, const OSSL_PARAM params[])
         return 0;
     }
     /* An unlikely failure mode is the parameter having some unexpected type */
-    if (!OSSL_PARAM_get_octet_string_ptr(p, &pubenc, &publen))
+    if (!OSSL_PARAM_get_octet_string_ptr(p.pub, &pubenc, &publen))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PROPERTIES);
-    if (p != NULL) {
-        OPENSSL_free(key->propq);
-        key->propq = NULL;
-        if (!OSSL_PARAM_get_utf8_string(p, &key->propq, 0))
-            return 0;
-    }
-
     if (publen != key->minfo->pubkey_bytes + key->xinfo->pubkey_bytes) {
         ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY);
         return 0;
@@ -640,19 +631,16 @@ static int mlx_kem_set_params(void *vkey, const OSSL_PARAM params[])
 static int mlx_kem_gen_set_params(void *vgctx, const OSSL_PARAM params[])
 {
     PROV_ML_KEM_GEN_CTX *gctx = vgctx;
-    const OSSL_PARAM *p;
+    struct mlx_gen_set_params_st p;

-    if (gctx == NULL)
+    if (gctx == NULL || !mlx_gen_set_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PROPERTIES);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
+    if (p.propq != NULL) {
+        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING)
             return 0;
         OPENSSL_free(gctx->propq);
-        if ((gctx->propq = OPENSSL_strdup(p->data)) == NULL)
+        if ((gctx->propq = OPENSSL_strdup(p.propq->data)) == NULL)
             return 0;
     }
     return 1;
@@ -685,31 +673,22 @@ static void *mlx_kem_gen_init(int evp_type, OSSL_LIB_CTX *libctx,
 static const OSSL_PARAM *mlx_kem_gen_settable_params(ossl_unused void *vgctx,
     ossl_unused void *provctx)
 {
-    static OSSL_PARAM settable[] = {
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_END
-    };
-
-    return settable;
+    return mlx_gen_set_params_list;
 }

 #ifdef FIPS_MODULE
 static int mlx_kem_gen_get_params(void *vgctx, OSSL_PARAM params[])
 {
     PROV_ML_KEM_GEN_CTX *gctx = vgctx;
-    OSSL_PARAM *p;
+    struct keymgmt_fips_gen_get_params_st p;
     int approved;

-    if (gctx == NULL || gctx->evp_type >= OSSL_NELEM(hybrid_vtable))
+    if (gctx == NULL || gctx->evp_type >= OSSL_NELEM(hybrid_vtable)
+        || !keymgmt_fips_gen_get_params_decoder(params, &p))
+        return 0;
+    approved = strcmp(hybrid_vtable[gctx->evp_type].algorithm_name, SN_X448) != 0;
+    if (p.ind != NULL && !OSSL_PARAM_set_int(p.ind, approved))
         return 0;
-    p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR);
-    if (p != NULL) {
-        approved = strcmp(hybrid_vtable[gctx->evp_type].algorithm_name,
-                       SN_X448)
-            != 0;
-        if (!OSSL_PARAM_set_int(p, approved))
-            return 0;
-    }
     return 1;
 }
 #endif
@@ -842,9 +821,7 @@ static void *mlx_kem_dup(const void *vkey, int selection)
         { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (OSSL_FUNC)mlx_kem_imexport_types },             \
         { OSSL_FUNC_KEYMGMT_EXPORT, (OSSL_FUNC)mlx_kem_export },                           \
         { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (OSSL_FUNC)mlx_kem_imexport_types },             \
-        OSSL_FIPS_IND_DISPATCH(OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS,                           \
-            OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS, mlx_kem_gen_get_params)                 \
-            OSSL_DISPATCH_END                                                              \
+        OSSL_KEYMGMT_FIPS_GEN_DISPATCH_END(mlx_kem_gen_get_params)                         \
     }
 /* See |hybrid_vtable| above */
 DECLARE_DISPATCH(p256, 0);
@@ -853,3 +830,6 @@ DECLARE_DISPATCH(p384, 1);
 DECLARE_DISPATCH(x25519, 2);
 DECLARE_DISPATCH(x448, 3);
 #endif
+#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_SM2)
+DECLARE_DISPATCH(curve_sm2, 4);
+#endif
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/mlx_kmgmt.inc.in b/deps/openssl/openssl/providers/implementations/keymgmt/mlx_kmgmt.inc.in
new file mode 100644
index 00000000000..e810441458f
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/mlx_kmgmt.inc.in
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ml_kem_import_export',
+                         (['OSSL_PKEY_PARAM_PRIV_KEY', 'privkey', 'octet_string'],
+                          ['OSSL_PKEY_PARAM_PUB_KEY',  'pubkey',  'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('mlx_get_params',
+                         (['OSSL_PKEY_PARAM_BITS',               'bits',     'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_BITS',      'secbits',  'int'],
+                          ['OSSL_PKEY_PARAM_MAX_SIZE',           'maxsize',  'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_CATEGORY',  'seccat',   'int'],
+                          ['OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY', 'pub',      'octet_string'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY',           'priv',     'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('mlx_set_params',
+                         (['OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY', 'pub',   'octet_string'],
+                          ['OSSL_PKEY_PARAM_PROPERTIES',         'propq', 'utf8_string'],
+                         )); -}
+
+{- produce_param_decoder('mlx_gen_set_params',
+                         (['OSSL_PKEY_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/rsa_kmgmt.c b/deps/openssl/openssl/providers/implementations/keymgmt/rsa_kmgmt.c
index d9f70149f44..1c58a1456bf 100644
--- a/deps/openssl/openssl/providers/implementations/keymgmt/rsa_kmgmt.c
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/rsa_kmgmt.c
@@ -24,13 +24,17 @@
 #include "prov/providercommon.h"
 #include "prov/provider_ctx.h"
 #include "crypto/rsa.h"
+#include "crypto/rsa_params.h"
 #include "crypto/cryptlib.h"
 #include "internal/fips.h"
 #include "internal/param_build_set.h"
 #include "fips/fipsindicator.h"
+#include "providers/implementations/keymgmt/keymgmtcommon.inc"

 static OSSL_FUNC_keymgmt_new_fn rsa_newdata;
+static OSSL_FUNC_keymgmt_new_ex_fn rsa_newdata_ex;
 static OSSL_FUNC_keymgmt_new_fn rsapss_newdata;
+static OSSL_FUNC_keymgmt_new_ex_fn rsapss_newdata_ex;
 static OSSL_FUNC_keymgmt_gen_init_fn rsa_gen_init;
 static OSSL_FUNC_keymgmt_gen_init_fn rsapss_gen_init;
 static OSSL_FUNC_keymgmt_gen_set_params_fn rsa_gen_set_params;
@@ -45,14 +49,18 @@ static OSSL_FUNC_keymgmt_load_fn rsa_load;
 static OSSL_FUNC_keymgmt_load_fn rsapss_load;
 static OSSL_FUNC_keymgmt_free_fn rsa_freedata;
 static OSSL_FUNC_keymgmt_get_params_fn rsa_get_params;
+static OSSL_FUNC_keymgmt_get_params_fn rsapss_get_params;
 static OSSL_FUNC_keymgmt_gettable_params_fn rsa_gettable_params;
+static OSSL_FUNC_keymgmt_gettable_params_fn rsapss_gettable_params;
 static OSSL_FUNC_keymgmt_has_fn rsa_has;
 static OSSL_FUNC_keymgmt_match_fn rsa_match;
 static OSSL_FUNC_keymgmt_validate_fn rsa_validate;
 static OSSL_FUNC_keymgmt_import_fn rsa_import;
 static OSSL_FUNC_keymgmt_import_types_fn rsa_import_types;
+static OSSL_FUNC_keymgmt_import_types_fn rsapss_import_types;
 static OSSL_FUNC_keymgmt_export_fn rsa_export;
 static OSSL_FUNC_keymgmt_export_types_fn rsa_export_types;
+static OSSL_FUNC_keymgmt_export_types_fn rsapss_export_types;
 static OSSL_FUNC_keymgmt_query_operation_name_fn rsa_query_operation_name;
 static OSSL_FUNC_keymgmt_dup_fn rsa_dup;

@@ -64,11 +72,11 @@ DEFINE_STACK_OF(BIGNUM)
 DEFINE_SPECIAL_STACK_OF_CONST(BIGNUM_const, BIGNUM)

 static int pss_params_fromdata(RSA_PSS_PARAMS_30 *pss_params, int *defaults_set,
-    const OSSL_PARAM params[], int rsa_type,
+    const RSA_PARAMS *p, int rsa_type,
     OSSL_LIB_CTX *libctx)
 {
-    if (!ossl_rsa_pss_params_30_fromdata(pss_params, defaults_set,
-            params, libctx))
+    if (!ossl_rsa_pss_params_30_fromdata_parsed(pss_params, defaults_set,
+            p, libctx))
         return 0;

     /* If not a PSS type RSA, sending us PSS parameters is wrong */
@@ -79,38 +87,93 @@ static int pss_params_fromdata(RSA_PSS_PARAMS_30 *pss_params, int *defaults_set,
     return 1;
 }

-static void *rsa_newdata(void *provctx)
+/*
+ * If the application actually created a legacy RSA object and assigned it to
+ * the EVP_PKEY, then we get hold of that object here. We return 0 if we hit
+ * a fatal error or 1 otherwise. We may return 1 but with *rsa set to NULL.
+ */
+static int get_legacy_rsa_object(OSSL_LIB_CTX *libctx, RSA **rsa, const OSSL_PARAM params[])
+{
+#ifndef FIPS_MODULE
+    const OSSL_PARAM *p;
+
+    if (params == NULL)
+        return 1;
+    p = OSSL_PARAM_locate_const(params, "legacy-object");
+    if (p == NULL)
+        return 1;
+    /*
+     * This only works because we are in the default provider. We are not
+     * normally allowed to pass complex objects across the provider boundary
+     * like this.
+     */
+    if (OSSL_PARAM_get_octet_ptr(p, (const void **)rsa, NULL) && *rsa != NULL) {
+        if (ossl_lib_ctx_get_concrete(ossl_rsa_get0_libctx(*rsa)) != ossl_lib_ctx_get_concrete(libctx)) {
+            *rsa = NULL;
+            return 1;
+        }
+        if (!RSA_up_ref(*rsa))
+            return 0;
+    }
+#endif
+
+    return 1;
+}
+
+static void *rsa_newdata_ex(void *provctx, const OSSL_PARAM params[])
 {
     OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
-    RSA *rsa;
+    RSA *rsa = NULL;

     if (!ossl_prov_is_running())
         return NULL;

-    rsa = ossl_rsa_new_with_ctx(libctx);
-    if (rsa != NULL) {
-        RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK);
-        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSA);
+    if (!get_legacy_rsa_object(libctx, &rsa, params))
+        return NULL;
+
+    if (rsa == NULL) {
+        rsa = ossl_rsa_new_with_ctx(libctx);
+        if (rsa != NULL) {
+            RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK);
+            RSA_set_flags(rsa, RSA_FLAG_TYPE_RSA);
+        }
     }
+
     return rsa;
 }

-static void *rsapss_newdata(void *provctx)
+static void *rsa_newdata(void *provctx)
+{
+    return rsa_newdata_ex(provctx, NULL);
+}
+
+static void *rsapss_newdata_ex(void *provctx, const OSSL_PARAM params[])
 {
     OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
-    RSA *rsa;
+    RSA *rsa = NULL;

     if (!ossl_prov_is_running())
         return NULL;

-    rsa = ossl_rsa_new_with_ctx(libctx);
-    if (rsa != NULL) {
-        RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK);
-        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSASSAPSS);
+    if (!get_legacy_rsa_object(libctx, &rsa, params))
+        return NULL;
+
+    if (rsa == NULL) {
+        rsa = ossl_rsa_new_with_ctx(libctx);
+        if (rsa != NULL) {
+            RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK);
+            RSA_set_flags(rsa, RSA_FLAG_TYPE_RSASSAPSS);
+        }
     }
+
     return rsa;
 }

+static void *rsapss_newdata(void *provctx)
+{
+    return rsapss_newdata_ex(provctx, NULL);
+}
+
 static void rsa_freedata(void *keydata)
 {
     RSA_free(keydata);
@@ -174,9 +237,79 @@ static int rsa_match(const void *keydata1, const void *keydata2, int selection)
     return ok;
 }

+enum {
+    RSA_IMEXPORT_TYPE_NONE = 0,
+    RSA_IMEXPORT_TYPE_OTHER = 1,
+    RSA_IMEXPORT_TYPE_KEY = 2,
+    RSA_IMEXPORT_TYPE_ALL = RSA_IMEXPORT_TYPE_OTHER | RSA_IMEXPORT_TYPE_KEY,
+    RSA_IMEXPORT_TYPE_COUNT
+};
+
+typedef int (*rsa_import_types_decoder_fn)(const OSSL_PARAM *, RSA_PARAMS *);
+
+struct rsa_imexport_types_st {
+    const OSSL_PARAM *import_types;
+    rsa_import_types_decoder_fn import_decoder;
+    const OSSL_PARAM *export_types;
+};
+
+static const struct rsa_imexport_types_st
+    rsa_imexport_types[RSA_IMEXPORT_TYPE_COUNT]
+    = {
+          [RSA_IMEXPORT_TYPE_OTHER] = {
+              rsa_other_import_types_list,
+              rsa_other_import_types_decoder,
+              rsa_other_export_types_list,
+          },
+          [RSA_IMEXPORT_TYPE_KEY] = {
+              rsa_key_import_types_list,
+              rsa_key_import_types_decoder,
+              rsa_key_export_types_list,
+          },
+          [RSA_IMEXPORT_TYPE_ALL] = {
+              rsa_all_import_types_list,
+              rsa_all_import_types_decoder,
+              rsa_all_export_types_list,
+          },
+      };
+
+static const struct rsa_imexport_types_st
+    rsapss_imexport_types[RSA_IMEXPORT_TYPE_COUNT]
+    = {
+          [RSA_IMEXPORT_TYPE_OTHER] = {
+              rsapss_other_import_types_list,
+              rsapss_other_import_types_decoder,
+              rsapss_other_export_types_list,
+          },
+          [RSA_IMEXPORT_TYPE_KEY] = {
+              rsapss_key_import_types_list,
+              rsapss_key_import_types_decoder,
+              rsapss_key_export_types_list,
+          },
+          [RSA_IMEXPORT_TYPE_ALL] = {
+              rsapss_all_import_types_list,
+              rsapss_all_import_types_decoder,
+              rsapss_all_export_types_list,
+          },
+      };
+
+static int rsa_imexport_type_select(int selection)
+{
+    int type_select = RSA_IMEXPORT_TYPE_NONE;
+
+    if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0)
+        type_select |= RSA_IMEXPORT_TYPE_OTHER;
+    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0)
+        type_select |= RSA_IMEXPORT_TYPE_KEY;
+    return type_select;
+}
+
 static int rsa_import(void *keydata, int selection, const OSSL_PARAM params[])
 {
     RSA *rsa = keydata;
+    RSA_PARAMS p;
+    const struct rsa_imexport_types_st *types;
+    int type_select;
     int rsa_type;
     int ok = 1;
     int pss_defaults_set = 0;
@@ -184,17 +317,21 @@ static int rsa_import(void *keydata, int selection, const OSSL_PARAM params[])
     if (!ossl_prov_is_running() || rsa == NULL)
         return 0;

-    if ((selection & RSA_POSSIBLE_SELECTIONS) == 0)
-        return 0;
-
+    type_select = rsa_imexport_type_select(selection);
     rsa_type = RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK);
+    types = rsa_type == RSA_FLAG_TYPE_RSASSAPSS
+        ? rsapss_imexport_types
+        : rsa_imexport_types;
+    if (type_select == RSA_IMEXPORT_TYPE_NONE
+        || !types[type_select].import_decoder(params, &p))
+        return 0;

     if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0)
-        ok = ok && pss_params_fromdata(ossl_rsa_get0_pss_params_30(rsa), &pss_defaults_set, params, rsa_type, ossl_rsa_get0_libctx(rsa));
+        ok = ok && pss_params_fromdata(ossl_rsa_get0_pss_params_30(rsa), &pss_defaults_set, &p, rsa_type, ossl_rsa_get0_libctx(rsa));
     if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
         int include_private = selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY ? 1 : 0;

-        ok = ok && ossl_rsa_fromdata(rsa, params, include_private);
+        ok = ok && ossl_rsa_fromdata_parsed(rsa, &p, include_private);
     }

     return ok;
@@ -207,12 +344,14 @@ static int rsa_export(void *keydata, int selection,
     const RSA_PSS_PARAMS_30 *pss_params = ossl_rsa_get0_pss_params_30(rsa);
     OSSL_PARAM_BLD *tmpl;
     OSSL_PARAM *params = NULL;
+    int type_select;
     int ok = 1;

     if (!ossl_prov_is_running() || rsa == NULL)
         return 0;

-    if ((selection & RSA_POSSIBLE_SELECTIONS) == 0)
+    type_select = rsa_imexport_type_select(selection);
+    if (type_select == RSA_IMEXPORT_TYPE_NONE)
         return 0;

     tmpl = OSSL_PARAM_BLD_new();
@@ -233,124 +372,70 @@ static int rsa_export(void *keydata, int selection,
     }

     ok = param_callback(params, cbarg);
-    OSSL_PARAM_free(params);
+    OSSL_PARAM_clear_free(params);
 err:
     OSSL_PARAM_BLD_free(tmpl);
     return ok;
 }

-#ifdef FIPS_MODULE
-/* In fips mode there are no multi-primes. */
-#define RSA_KEY_MP_TYPES()                                     \
-    OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_FACTOR1, NULL, 0),       \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_FACTOR2, NULL, 0),   \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_EXPONENT1, NULL, 0), \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_EXPONENT2, NULL, 0), \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_COEFFICIENT1, NULL, 0),
-#else
-/*
- * We allow up to 10 prime factors (starting with p, q).
- * NOTE: there is only 9 OSSL_PKEY_PARAM_RSA_COEFFICIENT
- */
-#define RSA_KEY_MP_TYPES()                                        \
-    OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_FACTOR1, NULL, 0),          \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_FACTOR2, NULL, 0),      \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_FACTOR3, NULL, 0),      \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_FACTOR4, NULL, 0),      \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_FACTOR5, NULL, 0),      \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_FACTOR6, NULL, 0),      \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_FACTOR7, NULL, 0),      \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_FACTOR8, NULL, 0),      \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_FACTOR9, NULL, 0),      \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_FACTOR10, NULL, 0),     \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_EXPONENT1, NULL, 0),    \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_EXPONENT2, NULL, 0),    \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_EXPONENT3, NULL, 0),    \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_EXPONENT4, NULL, 0),    \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_EXPONENT5, NULL, 0),    \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_EXPONENT6, NULL, 0),    \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_EXPONENT7, NULL, 0),    \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_EXPONENT8, NULL, 0),    \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_EXPONENT9, NULL, 0),    \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_EXPONENT10, NULL, 0),   \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_COEFFICIENT1, NULL, 0), \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_COEFFICIENT2, NULL, 0), \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_COEFFICIENT3, NULL, 0), \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_COEFFICIENT4, NULL, 0), \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_COEFFICIENT5, NULL, 0), \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_COEFFICIENT6, NULL, 0), \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_COEFFICIENT7, NULL, 0), \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_COEFFICIENT8, NULL, 0), \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_COEFFICIENT9, NULL, 0),
-#endif
-
-#define RSA_KEY_TYPES()                                \
-    OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_N, NULL, 0),     \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_E, NULL, 0), \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_D, NULL, 0), \
-        RSA_KEY_MP_TYPES()
-
-/*
- * This provider can export everything in an RSA key, so we use the exact
- * same type description for export as for import.  Other providers might
- * choose to import full keys, but only export the public parts, and will
- * therefore have the importkey_types and importkey_types functions return
- * different arrays.
- */
-static const OSSL_PARAM rsa_key_types[] = {
-    RSA_KEY_TYPES()
-        OSSL_PARAM_END
-};
-/*
- * We lied about the amount of factors, exponents and coefficients, the
- * export and import functions can really deal with an infinite amount
- * of these numbers.  However, RSA keys with too many primes are futile,
- * so we at least pretend to have some limits.
- */
-
-static const OSSL_PARAM *rsa_imexport_types(int selection)
+static const OSSL_PARAM *rsa_import_types(int selection)
 {
-    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0)
-        return rsa_key_types;
-    return NULL;
+    return rsa_imexport_types[rsa_imexport_type_select(selection)].import_types;
 }

-static const OSSL_PARAM *rsa_import_types(int selection)
+static const OSSL_PARAM *rsapss_import_types(int selection)
 {
-    return rsa_imexport_types(selection);
+    return rsapss_imexport_types[rsa_imexport_type_select(selection)]
+        .import_types;
 }

 static const OSSL_PARAM *rsa_export_types(int selection)
 {
-    return rsa_imexport_types(selection);
+    return rsa_imexport_types[rsa_imexport_type_select(selection)].export_types;
 }

-static int rsa_get_params(void *key, OSSL_PARAM params[])
+static const OSSL_PARAM *rsapss_export_types(int selection)
+{
+    return rsapss_imexport_types[rsa_imexport_type_select(selection)]
+        .export_types;
+}
+
+typedef int (*rsa_get_params_decoder_fn)(const OSSL_PARAM *, RSA_PARAMS *);
+
+static int common_get_params(void *key, OSSL_PARAM params[],
+    rsa_get_params_decoder_fn decoder)
 {
     RSA *rsa = key;
-    const RSA_PSS_PARAMS_30 *pss_params = ossl_rsa_get0_pss_params_30(rsa);
-    int rsa_type = RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK);
-    OSSL_PARAM *p;
-    int empty = RSA_get0_n(rsa) == NULL;
+    RSA_PARAMS p;
+    const RSA_PSS_PARAMS_30 *pss_params;
+    int rsa_type, empty;

-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
-        && (empty || !OSSL_PARAM_set_int(p, RSA_bits(rsa))))
+    if (rsa == NULL || !decoder(params, &p))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
-        && (empty || !OSSL_PARAM_set_int(p, RSA_security_bits(rsa))))
+    pss_params = ossl_rsa_get0_pss_params_30(rsa);
+    rsa_type = RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK);
+    empty = RSA_get0_n(rsa) == NULL;
+
+    if (p.bits != NULL && (empty || !OSSL_PARAM_set_int(p.bits, RSA_bits(rsa))))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
-        && (empty || !OSSL_PARAM_set_int(p, RSA_size(rsa))))
+    if (p.secbits != NULL
+        && (empty || !OSSL_PARAM_set_int(p.secbits, RSA_security_bits(rsa))))
         return 0;
+    if (p.maxsize != NULL
+        && (empty || !OSSL_PARAM_set_int(p.maxsize, RSA_size(rsa))))
+        return 0;
+    if (p.seccat != NULL)
+        if (!OSSL_PARAM_set_int(p.seccat, 0))
+            return 0;

     /*
      * For restricted RSA-PSS keys, we ignore the default digest request.
      * With RSA-OAEP keys, this may need to be amended.
      */
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
+    if (p.default_digest != NULL
         && (rsa_type != RSA_FLAG_TYPE_RSASSAPSS
             || ossl_rsa_pss_params_30_is_unrestricted(pss_params))) {
-        if (!OSSL_PARAM_set_utf8_string(p, RSA_DEFAULT_MD))
+        if (!OSSL_PARAM_set_utf8_string(p.default_digest, RSA_DEFAULT_MD))
             return 0;
     }

@@ -358,33 +443,38 @@ static int rsa_get_params(void *key, OSSL_PARAM params[])
      * For non-RSA-PSS keys, we ignore the mandatory digest request.
      * With RSA-OAEP keys, this may need to be amended.
      */
-    if ((p = OSSL_PARAM_locate(params,
-             OSSL_PKEY_PARAM_MANDATORY_DIGEST))
-            != NULL
+    if (p.mandatory_digest != NULL
         && rsa_type == RSA_FLAG_TYPE_RSASSAPSS
         && !ossl_rsa_pss_params_30_is_unrestricted(pss_params)) {
         const char *mdname = ossl_rsa_oaeppss_nid2name(ossl_rsa_pss_params_30_hashalg(pss_params));

-        if (mdname == NULL || !OSSL_PARAM_set_utf8_string(p, mdname))
+        if (mdname == NULL
+            || !OSSL_PARAM_set_utf8_string(p.mandatory_digest, mdname))
             return 0;
     }
     return (rsa_type != RSA_FLAG_TYPE_RSASSAPSS
-               || ossl_rsa_pss_params_30_todata(pss_params, NULL, params))
-        && ossl_rsa_todata(rsa, NULL, params, 1);
+               || ossl_rsa_pss_params_30_todata_parsed(pss_params, NULL, &p))
+        && ossl_rsa_todata_parsed(rsa, NULL, &p, 1);
 }

-static const OSSL_PARAM rsa_params[] = {
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_DEFAULT_DIGEST, NULL, 0),
-    RSA_KEY_TYPES()
-        OSSL_PARAM_END
-};
+static int rsa_get_params(void *key, OSSL_PARAM params[])
+{
+    return common_get_params(key, params, rsa_get_params_decoder);
+}
+
+static int rsapss_get_params(void *key, OSSL_PARAM params[])
+{
+    return common_get_params(key, params, rsapss_get_params_decoder);
+}

 static const OSSL_PARAM *rsa_gettable_params(void *provctx)
 {
-    return rsa_params;
+    return rsa_get_params_list;
+}
+
+static const OSSL_PARAM *rsapss_gettable_params(void *provctx)
+{
+    return rsapss_get_params_list;
 }

 static int rsa_validate(const void *keydata, int selection, int checktype)
@@ -433,6 +523,7 @@ struct rsa_gen_ctx {
     /* ACVP test parameters */
     OSSL_PARAM *acvp_test_params;
 #endif
+    uint32_t a, b;
 };

 static int rsa_gencb(int p, int n, BN_GENCB *cb)
@@ -501,89 +592,94 @@ static void *rsapss_gen_init(void *provctx, int selection,
 static int rsa_gen_set_params(void *genctx, const OSSL_PARAM params[])
 {
     struct rsa_gen_ctx *gctx = genctx;
-    const OSSL_PARAM *p;
+    RSA_PARAMS p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (gctx == NULL)
+        return 0;
+    switch (gctx->rsa_type) {
+    case RSA_FLAG_TYPE_RSA:
+        if (!rsa_gen_set_params_decoder(params, &p))
+            return 0;
+        break;
+    case RSA_FLAG_TYPE_RSASSAPSS:
+        if (!rsapss_gen_set_params_decoder(params, &p))
+            return 0;
+        break;
+    default:
+        return 0;
+    }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_BITS)) != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &gctx->nbits))
+    if (p.bits != NULL) {
+        if (!OSSL_PARAM_get_size_t(p.bits, &gctx->nbits))
             return 0;
         if (gctx->nbits < RSA_MIN_MODULUS_BITS) {
             ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SIZE_TOO_SMALL);
             return 0;
         }
     }
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_PRIMES)) != NULL
-        && !OSSL_PARAM_get_size_t(p, &gctx->primes))
+    if (p.primes != NULL && !OSSL_PARAM_get_size_t(p.primes, &gctx->primes))
         return 0;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_RSA_E)) != NULL
-        && !OSSL_PARAM_get_BN(p, &gctx->pub_exp))
+    if (p.e != NULL && !OSSL_PARAM_get_BN(p.e, &gctx->pub_exp))
         return 0;
+    if (p.a != NULL) {
+        if (!OSSL_PARAM_get_uint32(p.a, &gctx->a))
+            return 0;
+        /* a is an optional value that should be one of (0, 1, 3, 5, 7) */
+        if (gctx->a != 0 && (gctx->a > 7 || (gctx->a & 1) == 0)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DATA);
+            return 0;
+        }
+    }
+    if (p.b != NULL) {
+        if (!OSSL_PARAM_get_uint32(p.b, &gctx->b))
+            return 0;
+        /* b is an optional value that should be one of (0, 1, 3, 5, 7) */
+        if (gctx->b != 0 && (gctx->b > 7 || (gctx->b & 1) == 0)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DATA);
+            return 0;
+        }
+    }
+
     /* Only attempt to get PSS parameters when generating an RSA-PSS key */
     if (gctx->rsa_type == RSA_FLAG_TYPE_RSASSAPSS
-        && !pss_params_fromdata(&gctx->pss_params, &gctx->pss_defaults_set, params,
+        && !pss_params_fromdata(&gctx->pss_params, &gctx->pss_defaults_set, &p,
             gctx->rsa_type, gctx->libctx))
         return 0;
 #if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
     /* Any ACVP test related parameters are copied into a params[] */
-    if (!ossl_rsa_acvp_test_gen_params_new(&gctx->acvp_test_params, params))
+    if (!ossl_rsa_acvp_test_gen_params_new_parsed(&gctx->acvp_test_params, &p))
         return 0;
 #endif
     return 1;
 }

-#define rsa_gen_basic                                        \
-    OSSL_PARAM_size_t(OSSL_PKEY_PARAM_RSA_BITS, NULL),       \
-        OSSL_PARAM_size_t(OSSL_PKEY_PARAM_RSA_PRIMES, NULL), \
-        OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_E, NULL, 0)
-
-/*
- * The following must be kept in sync with ossl_rsa_pss_params_30_fromdata()
- * in crypto/rsa/rsa_backend.c
- */
-#define rsa_gen_pss                                                        \
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_RSA_DIGEST, NULL, 0),           \
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_RSA_DIGEST_PROPS, NULL, 0), \
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_RSA_MASKGENFUNC, NULL, 0),  \
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_RSA_MGF1_DIGEST, NULL, 0),  \
-        OSSL_PARAM_int(OSSL_PKEY_PARAM_RSA_PSS_SALTLEN, NULL)
-
 static const OSSL_PARAM *rsa_gen_settable_params(ossl_unused void *genctx,
     ossl_unused void *provctx)
 {
-    static OSSL_PARAM settable[] = {
-        rsa_gen_basic,
-        OSSL_PARAM_END
-    };
-
-    return settable;
+    return rsa_gen_set_params_list;
 }

 static const OSSL_PARAM *rsapss_gen_settable_params(ossl_unused void *genctx,
     ossl_unused void *provctx)
 {
-    static OSSL_PARAM settable[] = {
-        rsa_gen_basic,
-        rsa_gen_pss,
-        OSSL_PARAM_END
-    };
-
-    return settable;
+    return rsapss_gen_set_params_list;
 }

 #ifdef FIPS_MODULE
 static int rsa_gen_get_params(void *genctx, OSSL_PARAM params[])
 {
     struct rsa_gen_ctx *gctx = genctx;
+    struct keymgmt_fips_gen_get_params_st p;
     int approved = 1;

-    if (gctx == NULL)
+    if (gctx == NULL || !keymgmt_fips_gen_get_params_decoder(params, &p))
         return 0;
 #ifndef OPENSSL_NO_ACVP_TESTS
     approved = gctx->acvp_test_params == NULL;
 #endif
-    return ossl_FIPS_IND_get_ctx_param_conditional(NULL, params, approved);
+    if (!OSSL_FIPS_IND_GET_PARAM_CONDITIONAL(p.ind, approved))
+        return 0;
+    return 1;
 }
 #endif

@@ -629,9 +725,10 @@ static void *rsa_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg)
     }
 #endif

-    if (!RSA_generate_multi_prime_key(rsa_tmp,
+    if (!ossl_rsa_generate_multi_prime_key(rsa_tmp,
             (int)gctx->nbits, (int)gctx->primes,
-            gctx->pub_exp, gencb))
+            gctx->pub_exp, gencb,
+            gctx->a, gctx->b))
         goto err;

     if (!ossl_rsa_pss_params_30_copy(ossl_rsa_get0_pss_params_30(rsa_tmp),
@@ -709,6 +806,7 @@ static const char *rsa_query_operation_name(int operation_id)

 const OSSL_DISPATCH ossl_rsa_keymgmt_functions[] = {
     { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))rsa_newdata },
+    { OSSL_FUNC_KEYMGMT_NEW_EX, (void (*)(void))rsa_newdata_ex },
     { OSSL_FUNC_KEYMGMT_GEN_INIT, (void (*)(void))rsa_gen_init },
     { OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS,
         (void (*)(void))rsa_gen_set_params },
@@ -728,13 +826,12 @@ const OSSL_DISPATCH ossl_rsa_keymgmt_functions[] = {
     { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))rsa_export },
     { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))rsa_export_types },
     { OSSL_FUNC_KEYMGMT_DUP, (void (*)(void))rsa_dup },
-    OSSL_FIPS_IND_DISPATCH(OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS,
-        OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS, rsa_gen_get_params)
-        OSSL_DISPATCH_END
+    OSSL_KEYMGMT_FIPS_GEN_DISPATCH_END(rsa_gen_get_params)
 };

 const OSSL_DISPATCH ossl_rsapss_keymgmt_functions[] = {
     { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))rsapss_newdata },
+    { OSSL_FUNC_KEYMGMT_NEW_EX, (void (*)(void))rsapss_newdata_ex },
     { OSSL_FUNC_KEYMGMT_GEN_INIT, (void (*)(void))rsapss_gen_init },
     { OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS, (void (*)(void))rsa_gen_set_params },
     { OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS,
@@ -743,19 +840,18 @@ const OSSL_DISPATCH ossl_rsapss_keymgmt_functions[] = {
     { OSSL_FUNC_KEYMGMT_GEN_CLEANUP, (void (*)(void))rsa_gen_cleanup },
     { OSSL_FUNC_KEYMGMT_LOAD, (void (*)(void))rsapss_load },
     { OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))rsa_freedata },
-    { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*)(void))rsa_get_params },
-    { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*)(void))rsa_gettable_params },
+    { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*)(void))rsapss_get_params },
+    { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS,
+        (void (*)(void))rsapss_gettable_params },
     { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))rsa_has },
     { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))rsa_match },
     { OSSL_FUNC_KEYMGMT_VALIDATE, (void (*)(void))rsa_validate },
     { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))rsa_import },
-    { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))rsa_import_types },
+    { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))rsapss_import_types },
     { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))rsa_export },
-    { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))rsa_export_types },
+    { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))rsapss_export_types },
     { OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME,
         (void (*)(void))rsa_query_operation_name },
     { OSSL_FUNC_KEYMGMT_DUP, (void (*)(void))rsa_dup },
-    OSSL_FIPS_IND_DISPATCH(OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS,
-        OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS, rsa_gen_get_params)
-        OSSL_DISPATCH_END
+    OSSL_KEYMGMT_FIPS_GEN_DISPATCH_END(rsa_gen_get_params)
 };
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/slh_dsa_kmgmt.c b/deps/openssl/openssl/providers/implementations/keymgmt/slh_dsa_kmgmt.c
index f35be004987..e1473fe962b 100644
--- a/deps/openssl/openssl/providers/implementations/keymgmt/slh_dsa_kmgmt.c
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/slh_dsa_kmgmt.c
@@ -10,6 +10,7 @@
 #include <openssl/core_dispatch.h>
 #include <openssl/core_names.h>
 #include <openssl/param_build.h>
+#include <openssl/proverr.h>
 #include <openssl/self_test.h>
 #include <openssl/proverr.h>
 #include "crypto/slh_dsa.h"
@@ -18,7 +19,8 @@
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
 #include "prov/provider_ctx.h"
-#include "fips/fipsindicator.h"
+#include "providers/implementations/keymgmt/keymgmtcommon.inc"
+#include "providers/implementations/keymgmt/slh_dsa_kmgmt.inc"

 #ifdef FIPS_MODULE
 static int slh_dsa_fips140_pairwise_test(const SLH_DSA_KEY *key,
@@ -44,6 +46,18 @@ static OSSL_FUNC_keymgmt_dup_fn slh_dsa_dup_key;

 #define SLH_DSA_POSSIBLE_SELECTIONS (OSSL_KEYMGMT_SELECT_KEYPAIR)

+static int slh_dsa_self_check(OSSL_LIB_CTX *libctx)
+{
+    if (!ossl_prov_is_running())
+        return 0;
+
+#ifdef FIPS_MODULE
+    return ossl_deferred_self_test(libctx, ST_ID_ASYM_KEYGEN_SLH_DSA);
+#else
+    return 1;
+#endif
+}
+
 struct slh_dsa_gen_ctx {
     SLH_DSA_HASH_CTX *ctx;
     OSSL_LIB_CTX *libctx;
@@ -54,7 +68,7 @@ struct slh_dsa_gen_ctx {

 static void *slh_dsa_new_key(void *provctx, const char *alg)
 {
-    if (!ossl_prov_is_running())
+    if (!slh_dsa_self_check(PROV_LIBCTX_OF(provctx)))
         return 0;

     return ossl_slh_dsa_key_new(PROV_LIBCTX_OF(provctx), NULL, alg);
@@ -112,43 +126,30 @@ static int slh_dsa_import(void *keydata, int selection, const OSSL_PARAM params[
 {
     SLH_DSA_KEY *key = keydata;
     int include_priv;
+    struct slh_dsa_import_st p;

-    if (!ossl_prov_is_running() || key == NULL)
+    if (!ossl_prov_is_running()
+        || key == NULL
+        || !slh_dsa_import_decoder(params, &p))
         return 0;

     if ((selection & SLH_DSA_POSSIBLE_SELECTIONS) == 0)
         return 0;

     include_priv = ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0);
-    return ossl_slh_dsa_key_fromdata(key, params, include_priv);
+    return ossl_slh_dsa_key_fromdata(key, p.pub, p.priv, include_priv);
 }

-#define SLH_DSA_IMEXPORTABLE_PARAMETERS                        \
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PUB_KEY, NULL, 0), \
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0)
-
-static const OSSL_PARAM slh_dsa_key_types[] = {
-    SLH_DSA_IMEXPORTABLE_PARAMETERS,
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *slh_dsa_imexport_types(int selection)
 {
     if ((selection & SLH_DSA_POSSIBLE_SELECTIONS) == 0)
         return NULL;
-    return slh_dsa_key_types;
+    return slh_dsa_import_list;
 }

-static const OSSL_PARAM slh_dsa_params[] = {
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
-    OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_MANDATORY_DIGEST, NULL, 0),
-    SLH_DSA_IMEXPORTABLE_PARAMETERS,
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *slh_dsa_gettable_params(void *provctx)
 {
-    return slh_dsa_params;
+    return slh_dsa_get_params_list;
 }

 static int key_to_params(SLH_DSA_KEY *key, OSSL_PARAM_BLD *tmpl,
@@ -179,33 +180,37 @@ static int key_to_params(SLH_DSA_KEY *key, OSSL_PARAM_BLD *tmpl,
 static int slh_dsa_get_params(void *keydata, OSSL_PARAM params[])
 {
     SLH_DSA_KEY *key = keydata;
-    OSSL_PARAM *p;
+    struct slh_dsa_get_params_st p;
     const uint8_t *pub, *priv;

-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
-        && !OSSL_PARAM_set_int(p, 8 * ossl_slh_dsa_key_get_pub_len(key)))
+    if (key == NULL || !slh_dsa_get_params_decoder(params, &p))
+        return 0;
+
+    if (p.bits != NULL
+        && !OSSL_PARAM_set_size_t(p.bits, 8 * ossl_slh_dsa_key_get_pub_len(key)))
+        return 0;
+    if (p.secbits != NULL
+        && !OSSL_PARAM_set_size_t(p.secbits, 8 * ossl_slh_dsa_key_get_n(key)))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
-        && !OSSL_PARAM_set_int(p, 8 * ossl_slh_dsa_key_get_n(key)))
+    if (p.maxsize != NULL
+        && !OSSL_PARAM_set_size_t(p.maxsize, ossl_slh_dsa_key_get_sig_len(key)))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
-        && !OSSL_PARAM_set_int(p, ossl_slh_dsa_key_get_sig_len(key)))
+    if (p.seccat != NULL
+        && !OSSL_PARAM_set_int(p.seccat, ossl_slh_dsa_key_get_security_category(key)))
         return 0;

     priv = ossl_slh_dsa_key_get_priv(key);
     if (priv != NULL) {
-        p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_PRIV_KEY);
         /* Note: ossl_slh_dsa_key_get_priv_len() includes the public key */
-        if (p != NULL
-            && !OSSL_PARAM_set_octet_string(p, priv,
+        if (p.priv != NULL
+            && !OSSL_PARAM_set_octet_string(p.priv, priv,
                 ossl_slh_dsa_key_get_priv_len(key)))
             return 0;
     }
     pub = ossl_slh_dsa_key_get_pub(key);
     if (pub != NULL) {
-        p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_PUB_KEY);
-        if (p != NULL
-            && !OSSL_PARAM_set_octet_string(p, pub,
+        if (p.pub != NULL
+            && !OSSL_PARAM_set_octet_string(p.pub, pub,
                 ossl_slh_dsa_key_get_pub_len(key)))
             return 0;
     }
@@ -213,8 +218,7 @@ static int slh_dsa_get_params(void *keydata, OSSL_PARAM params[])
      * This allows apps to use an empty digest, so that the old API
      * for digest signing can be used.
      */
-    p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MANDATORY_DIGEST);
-    if (p != NULL && !OSSL_PARAM_set_utf8_string(p, ""))
+    if (p.mandgst != NULL && !OSSL_PARAM_set_utf8_string(p.mandgst, ""))
         return 0;
     return 1;
 }
@@ -224,7 +228,7 @@ static int slh_dsa_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
 {
     SLH_DSA_KEY *key = keydata;
     OSSL_PARAM_BLD *tmpl;
-    OSSL_PARAM *params = NULL, *p;
+    OSSL_PARAM *params = NULL;
     int ret = 0;

     if (!ossl_prov_is_running() || key == NULL)
@@ -245,13 +249,7 @@ static int slh_dsa_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
         goto err;

     ret = param_cb(params, cbarg);
-    /*
-     * OSSL_PARAM_free() only wipes the secure-heap data block,
-     * so wipe the key material copies held in the params first.
-     */
-    for (p = params; p->key != NULL; p++)
-        OPENSSL_cleanse(p->data, p->data_size);
-    OSSL_PARAM_free(params);
+    OSSL_PARAM_clear_free(params);
 err:
     OSSL_PARAM_BLD_free(tmpl);
     return ret;
@@ -264,6 +262,7 @@ static void *slh_dsa_load(const void *reference, size_t reference_sz)
     if (ossl_prov_is_running() && reference_sz == sizeof(key)) {
         /* The contents of the reference is the address to our object */
         key = *(SLH_DSA_KEY **)reference;
+
         /* We grabbed, so we detach it */
         *(SLH_DSA_KEY **)reference = NULL;
         return key;
@@ -310,7 +309,8 @@ static int slh_dsa_fips140_pairwise_test(const SLH_DSA_KEY *key,
     int alloc_ctx = 0;

     /* During self test, it is a waste to do this test */
-    if (ossl_fips_self_testing())
+    if (ossl_fips_self_testing()
+        || ossl_self_test_in_progress(ST_ID_ASYM_KEYGEN_SLH_DSA))
         return 1;

     if (ctx == NULL) {
@@ -361,7 +361,7 @@ static void *slh_dsa_gen(void *genctx, const char *alg)
     SLH_DSA_KEY *key = NULL;
     SLH_DSA_HASH_CTX *ctx = NULL;

-    if (!ossl_prov_is_running())
+    if (!slh_dsa_self_check(gctx->libctx))
         return NULL;
     key = ossl_slh_dsa_key_new(gctx->libctx, gctx->propq, alg);
     if (key == NULL)
@@ -387,28 +387,26 @@ err:
 static int slh_dsa_gen_set_params(void *genctx, const OSSL_PARAM params[])
 {
     struct slh_dsa_gen_ctx *gctx = genctx;
-    const OSSL_PARAM *p;
+    struct slh_dsa_gen_set_params_st p;

-    if (gctx == NULL)
+    if (gctx == NULL || !slh_dsa_gen_set_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_SLH_DSA_SEED);
-    if (p != NULL) {
+    if (p.seed != NULL) {
         void *vp = gctx->entropy;
         size_t len = sizeof(gctx->entropy);

-        if (!OSSL_PARAM_get_octet_string(p, &vp, len, &(gctx->entropy_len))) {
+        if (!OSSL_PARAM_get_octet_string(p.seed, &vp, len, &(gctx->entropy_len))) {
             gctx->entropy_len = 0;
             return 0;
         }
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PROPERTIES);
-    if (p != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
+    if (p.propq != NULL) {
+        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING)
             return 0;
         OPENSSL_free(gctx->propq);
-        gctx->propq = OPENSSL_strdup(p->data);
+        gctx->propq = OPENSSL_strdup(p.propq->data);
         if (gctx->propq == NULL)
             return 0;
     }
@@ -418,12 +416,7 @@ static int slh_dsa_gen_set_params(void *genctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *slh_dsa_gen_settable_params(ossl_unused void *genctx,
     ossl_unused void *provctx)
 {
-    static OSSL_PARAM settable[] = {
-        OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_SLH_DSA_SEED, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return settable;
+    return slh_dsa_gen_set_params_list;
 }

 static void slh_dsa_gen_cleanup(void *genctx)
@@ -470,9 +463,7 @@ static void slh_dsa_gen_cleanup(void *genctx)
             (void (*)(void))slh_dsa_gen_set_params },                                   \
         { OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS,                                        \
             (void (*)(void))slh_dsa_gen_settable_params },                              \
-        OSSL_FIPS_IND_APPROVED_DISPATCH(OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS,               \
-            OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS)                                      \
-            OSSL_DISPATCH_END                                                           \
+        OSSL_KEYMGMT_FIPS_APPROVED_GEN_DISPATCH_END                                     \
     }

 MAKE_KEYMGMT_FUNCTIONS("SLH-DSA-SHA2-128s", sha2_128s);
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/slh_dsa_kmgmt.inc.in b/deps/openssl/openssl/providers/implementations/keymgmt/slh_dsa_kmgmt.inc.in
new file mode 100644
index 00000000000..5529aa55af2
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/slh_dsa_kmgmt.inc.in
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('slh_dsa_import',
+                         (['OSSL_PKEY_PARAM_PUB_KEY',           'pub',     'octet_string'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY',          'priv',    'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('slh_dsa_get_params',
+                         (['OSSL_PKEY_PARAM_BITS',              'bits',    'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_BITS',     'secbits', 'int'],
+                          ['OSSL_PKEY_PARAM_MAX_SIZE',          'maxsize', 'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_CATEGORY', 'seccat',  'int'],
+                          ['OSSL_PKEY_PARAM_MANDATORY_DIGEST',  'mandgst', 'utf8_string'],
+                          ['OSSL_PKEY_PARAM_PUB_KEY',           'pub',     'octet_string'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY',          'priv',    'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('slh_dsa_gen_set_params',
+                         (['OSSL_PKEY_PARAM_PROPERTIES',   'propq', 'utf8_string'],
+                          ['OSSL_PKEY_PARAM_SLH_DSA_SEED', 'seed',  'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/template_kmgmt.c b/deps/openssl/openssl/providers/implementations/keymgmt/template_kmgmt.c
index b8e6c56114a..0fad2796951 100644
--- a/deps/openssl/openssl/providers/implementations/keymgmt/template_kmgmt.c
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/template_kmgmt.c
@@ -22,6 +22,8 @@
 #include "prov/provider_ctx.h"
 #include "prov/securitycheck.h"

+#include "providers/implementations/keymgmt/template_kmgmt.inc"
+
 extern const OSSL_DISPATCH ossl_template_keymgmt_functions[];

 #define BUFSIZE 1000
@@ -38,8 +40,6 @@ static void debug_print(char *fmt, ...)
     va_start(argptr, fmt);
     vsnprintf(out, BUFSIZE, fmt, argptr);
     va_end(argptr);
-    if (getenv("TEMPLATEKM"))
-        fprintf(stderr, "TEMPLATE_KM: %s", out);
 }
 #endif

@@ -184,27 +184,21 @@ static int ossl_template_key_fromdata(void *key,
     const OSSL_PARAM params[],
     int include_private)
 {
-    const OSSL_PARAM *param_priv_key = NULL, *param_pub_key;
+    struct template_key_types_st p;

-    if (key == NULL)
-        return 0;
-    if (ossl_param_is_empty(params))
+    if (key == NULL || !template_key_types_decoder(params, &p))
         return 0;

     /* validate integrity of key (algorithm type specific) */

-    param_pub_key = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PUB_KEY);
-    if (include_private)
-        param_priv_key = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY);
-
-    if (param_pub_key == NULL && param_priv_key == NULL)
+    if (p.pub_key == NULL && p.priv_key == NULL)
         return 0;

-    if (param_priv_key != NULL) {
+    if (include_private && p.priv_key != NULL) {
         /* retrieve private key and check integrity */
     }

-    if (param_pub_key != NULL) {
+    if (p.pub_key != NULL) {
         /* retrieve public key and check integrity */
     }

@@ -230,76 +224,54 @@ static int template_import(void *key, int selection, const OSSL_PARAM params[])
     return ok;
 }

-#define TEMPLATE_KEY_TYPES()                                   \
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PUB_KEY, NULL, 0), \
-        OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0)
-
-static const OSSL_PARAM template_key_types[] = {
-    TEMPLATE_KEY_TYPES(),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *template_imexport_types(int selection)
 {
-    debug_print("getting imexport types\n");
     if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0)
-        return template_key_types;
+        return template_key_types_list;
     return NULL;
 }

 static int template_get_params(void *key, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    struct template_get_params_st p;

     debug_print("get params %p\n", key);

-    if (ossl_param_is_empty(params))
+    if (key == NULL || !template_get_params_decoder(params, &p))
         return 0;

     /* return sensible values for at least these parameters */

-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
-        && !OSSL_PARAM_set_int(p, 0))
+    if (p.bits != NULL && !OSSL_PARAM_set_int(p.bits, 0))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
-        && !OSSL_PARAM_set_int(p, 0))
+    if (p.secbits != NULL && !OSSL_PARAM_set_int(p.secbits, 0))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
-        && !OSSL_PARAM_set_int(p, 0))
+    if (p.size != NULL && !OSSL_PARAM_set_int(p.size, 0))
+        return 0;
+    if (p.seccat != NULL && !OSSL_PARAM_set_int(p.seccat, 0))
+        return 0;
+    if (p.encpub != NULL && !OSSL_PARAM_set_octet_string(p.encpub, NULL, 0))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL) {
-        if (!OSSL_PARAM_set_octet_string(p, NULL, 0))
-            return 0;
-    }

     debug_print("get params OK\n");
     return 1;
 }

-static const OSSL_PARAM template_gettable_params_arr[] = {
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
-    OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *template_gettable_params(void *provctx)
 {
     debug_print("gettable params called\n");
-    return template_gettable_params_arr;
+    return template_get_params_list;
 }

 static int template_set_params(void *key, const OSSL_PARAM params[])
 {
-    const OSSL_PARAM *p;
+    struct template_set_params_st p;

     debug_print("set params called for %p\n", key);
-    if (ossl_param_is_empty(params))
-        return 1; /* OK not to set anything */
+    if (key == NULL || !template_set_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY);
-    if (p != NULL) {
+    if (p.pub != NULL) {
         /* load public key structure */
     }

@@ -307,22 +279,18 @@ static int template_set_params(void *key, const OSSL_PARAM params[])
     return 1;
 }

-static const OSSL_PARAM template_settable_params_arr[] = {
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *template_settable_params(void *provctx)
 {
     debug_print("settable params called\n");
-    return template_settable_params_arr;
+    return template_set_params_list;
 }

 static int template_gen_set_params(void *genctx, const OSSL_PARAM params[])
 {
     struct template_gen_ctx *gctx = genctx;
+    struct template_gen_set_params_st p;

-    if (gctx == NULL)
+    if (gctx == NULL || !template_gen_set_params_decoder(params, &p))
         return 0;

     debug_print("empty gen_set params called for %p\n", gctx);
@@ -356,10 +324,7 @@ static void *template_gen_init(void *provctx, int selection,
 static const OSSL_PARAM *template_gen_settable_params(ossl_unused void *genctx,
     ossl_unused void *provctx)
 {
-    static OSSL_PARAM settable[] = {
-        OSSL_PARAM_END
-    };
-    return settable;
+    return template_gen_set_params_list;
 }

 static void *template_gen(void *vctx, OSSL_CALLBACK *osslcb, void *cbarg)
diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/template_kmgmt.inc.in b/deps/openssl/openssl/providers/implementations/keymgmt/template_kmgmt.inc.in
new file mode 100644
index 00000000000..0dfcee8b857
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/keymgmt/template_kmgmt.inc.in
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('template_key_types',
+                         (['OSSL_PKEY_PARAM_PUB_KEY',  'pub_key',  'octet_string'],
+                          ['OSSL_PKEY_PARAM_PRIV_KEY', 'priv_key', 'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('template_get_params',
+                         (['OSSL_PKEY_PARAM_BITS',               'bits',    'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_BITS',      'secbits', 'int'],
+                          ['OSSL_PKEY_PARAM_MAX_SIZE',           'size',    'int'],
+                          ['OSSL_PKEY_PARAM_SECURITY_CATEGORY',  'seccat',  'int'],
+                          ['OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY', 'encpub',  'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('template_set_params',
+                         (['OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY', 'pub', 'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('template_gen_set_params',
+                         (['OSSL_PKEY_PARAM_GROUP_NAME', 'name', 'utf8_string'],
+                        )); -}
diff --git a/deps/openssl/openssl/providers/implementations/macs/blake2_mac_impl.c b/deps/openssl/openssl/providers/implementations/macs/blake2_mac_impl.c
index a1ba00aa647..bc8615ee721 100644
--- a/deps/openssl/openssl/providers/implementations/macs/blake2_mac_impl.c
+++ b/deps/openssl/openssl/providers/implementations/macs/blake2_mac_impl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,6 +17,8 @@
 #include "prov/implementations.h"
 #include "prov/providercommon.h"

+#include "prov/blake2_params.inc"
+
 /*
  * Forward declaration of everything implemented here.  This is not strictly
  * necessary for the compiler, but provides an assurance that the signatures
@@ -144,43 +146,35 @@ static int blake2_mac_final(void *vmacctx,
     return BLAKE2_FINAL(out, &macctx->ctx);
 }

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
-    OSSL_PARAM_size_t(OSSL_MAC_PARAM_BLOCK_SIZE, NULL),
-    OSSL_PARAM_END
-};
+/* See blake2.h for parameter definition */
 static const OSSL_PARAM *blake2_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return blake2_get_ctx_list;
 }

 static int blake2_get_ctx_params(void *vmacctx, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    struct blake2_mac_data_st *macctx = vmacctx;
+    struct blake2_get_ctx_st p;

-    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL
-        && !OSSL_PARAM_set_size_t(p, blake2_mac_size(vmacctx)))
+    if (macctx == NULL || !blake2_get_ctx_decoder(params, &p))
         return 0;

-    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_BLOCK_SIZE)) != NULL
-        && !OSSL_PARAM_set_size_t(p, BLAKE2_BLOCKBYTES))
+    if (p.size != NULL
+        && !OSSL_PARAM_set_size_t(p.size, blake2_mac_size(macctx)))
+        return 0;
+
+    if (p.bsize != NULL && !OSSL_PARAM_set_size_t(p.bsize, BLAKE2_BLOCKBYTES))
         return 0;

     return 1;
 }

-static const OSSL_PARAM known_settable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
-    OSSL_PARAM_octet_string(OSSL_MAC_PARAM_KEY, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_MAC_PARAM_CUSTOM, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_MAC_PARAM_SALT, NULL, 0),
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *blake2_mac_settable_ctx_params(
     ossl_unused void *ctx, ossl_unused void *p_ctx)
 {
-    return known_settable_ctx_params;
+    return blake2_mac_set_ctx_list;
 }

 /*
@@ -189,15 +183,15 @@ static const OSSL_PARAM *blake2_mac_settable_ctx_params(
 static int blake2_mac_set_ctx_params(void *vmacctx, const OSSL_PARAM params[])
 {
     struct blake2_mac_data_st *macctx = vmacctx;
-    const OSSL_PARAM *p;
+    struct blake2_mac_set_ctx_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (macctx == NULL || !blake2_mac_set_ctx_decoder(params, &p))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_SIZE)) != NULL) {
+    if (p.size != NULL) {
         size_t size;

-        if (!OSSL_PARAM_get_size_t(p, &size)
+        if (!OSSL_PARAM_get_size_t(p.size, &size)
             || size < 1
             || size > BLAKE2_OUTBYTES) {
             ERR_raise(ERR_LIB_PROV, PROV_R_NOT_XOF_OR_INVALID_LENGTH);
@@ -206,33 +200,38 @@ static int blake2_mac_set_ctx_params(void *vmacctx, const OSSL_PARAM params[])
         BLAKE2_PARAM_SET_DIGEST_LENGTH(&macctx->params, (uint8_t)size);
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_KEY)) != NULL
-        && !blake2_setkey(macctx, p->data, p->data_size))
-        return 0;
+    if (p.key != NULL)
+        if (p.key->data_type != OSSL_PARAM_OCTET_STRING
+            || !blake2_setkey(macctx, p.key->data, p.key->data_size))
+            return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_CUSTOM))
-        != NULL) {
+    if (p.cust != NULL) {
+        if (p.cust->data_type != OSSL_PARAM_OCTET_STRING)
+            return 0;
         /*
          * The OSSL_PARAM API doesn't provide direct pointer use, so we
          * must handle the OSSL_PARAM structure ourselves here
          */
-        if (p->data_size > BLAKE2_PERSONALBYTES) {
+        if (p.cust->data_size > BLAKE2_PERSONALBYTES) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_CUSTOM_LENGTH);
             return 0;
         }
-        BLAKE2_PARAM_SET_PERSONAL(&macctx->params, p->data, p->data_size);
+        BLAKE2_PARAM_SET_PERSONAL(&macctx->params, p.cust->data,
+            p.cust->data_size);
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_SALT)) != NULL) {
+    if (p.salt != NULL) {
+        if (p.salt->data_type != OSSL_PARAM_OCTET_STRING)
+            return 0;
         /*
          * The OSSL_PARAM API doesn't provide direct pointer use, so we
          * must handle the OSSL_PARAM structure ourselves here as well
          */
-        if (p->data_size > BLAKE2_SALTBYTES) {
+        if (p.salt->data_size > BLAKE2_SALTBYTES) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_SALT_LENGTH);
             return 0;
         }
-        BLAKE2_PARAM_SET_SALT(&macctx->params, p->data, p->data_size);
+        BLAKE2_PARAM_SET_SALT(&macctx->params, p.salt->data, p.salt->data_size);
     }
     return 1;
 }
diff --git a/deps/openssl/openssl/providers/implementations/macs/cmac_prov.c b/deps/openssl/openssl/providers/implementations/macs/cmac_prov.c
index 14542c6716f..a4a0674d56e 100644
--- a/deps/openssl/openssl/providers/implementations/macs/cmac_prov.c
+++ b/deps/openssl/openssl/providers/implementations/macs/cmac_prov.c
@@ -21,12 +21,14 @@
 #include <openssl/err.h>
 #include <openssl/proverr.h>

+#include "internal/cryptlib.h"
 #include "prov/securitycheck.h"
 #include "prov/implementations.h"
 #include "prov/provider_ctx.h"
 #include "prov/provider_util.h"
 #include "prov/providercommon.h"
 #include "crypto/cmac.h"
+#include "providers/implementations/macs/cmac_prov.inc"

 /*
  * Forward declaration of everything implemented here.  This is not strictly
@@ -137,7 +139,7 @@ static int tdes_check_param(struct cmac_data_st *macctx, OSSL_PARAM *p,
     if (EVP_CIPHER_is_a(cipher, "DES-EDE3-CBC")) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(macctx, OSSL_FIPS_IND_SETTABLE0,
                 libctx, "CMAC", "Triple-DES",
-                ossl_fips_config_tdes_encrypt_disallowed))
+                FIPS_CONFIG_TDES_ENCRYPT_DISABLED))
             return 0;
         OSSL_FIPS_IND_GET_PARAM(macctx, p, state, OSSL_FIPS_IND_SETTABLE0,
             OSSL_CIPHER_PARAM_FIPS_ENCRYPT_CHECK)
@@ -161,8 +163,7 @@ static int cmac_setkey(struct cmac_data_st *macctx,
         p = prms;
 #endif
     rv = ossl_cmac_init(macctx->ctx, key, keylen,
-        ossl_prov_cipher_cipher(&macctx->cipher),
-        ossl_prov_cipher_engine(&macctx->cipher), p);
+        ossl_prov_cipher_cipher(&macctx->cipher), p);
     ossl_prov_cipher_reset(&macctx->cipher);
     return rv;
 }
@@ -199,46 +200,36 @@ static int cmac_final(void *vmacctx, unsigned char *out, size_t *outl,
     return CMAC_Final(macctx->ctx, out, outl);
 }

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
-    OSSL_PARAM_size_t(OSSL_MAC_PARAM_BLOCK_SIZE, NULL),
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
 static const OSSL_PARAM *cmac_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return cmac_get_ctx_params_list;
 }

 static int cmac_get_ctx_params(void *vmacctx, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    struct cmac_data_st *macctx = vmacctx;
+    struct cmac_get_ctx_params_st p;
+
+    if (macctx == NULL || !cmac_get_ctx_params_decoder(params, &p))
+        return 0;

-    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL
-        && !OSSL_PARAM_set_size_t(p, cmac_size(vmacctx)))
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, cmac_size(vmacctx)))
         return 0;

-    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_BLOCK_SIZE)) != NULL
-        && !OSSL_PARAM_set_size_t(p, cmac_size(vmacctx)))
+    if (p.bsize != NULL && !OSSL_PARAM_set_size_t(p.bsize, cmac_size(vmacctx)))
         return 0;

-    if (!OSSL_FIPS_IND_GET_CTX_PARAM((struct cmac_data_st *)vmacctx, params))
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(macctx, p.ind))
         return 0;
+
     return 1;
 }

-static const OSSL_PARAM known_settable_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_CIPHER, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_PROPERTIES, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_MAC_PARAM_KEY, NULL, 0),
-    OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_CIPHER_PARAM_FIPS_ENCRYPT_CHECK)
-        OSSL_PARAM_END
-};
 static const OSSL_PARAM *cmac_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    return known_settable_ctx_params;
+    return cmac_set_ctx_params_list;
 }

 /*
@@ -247,19 +238,19 @@ static const OSSL_PARAM *cmac_settable_ctx_params(ossl_unused void *ctx,
 static int cmac_set_ctx_params(void *vmacctx, const OSSL_PARAM params[])
 {
     struct cmac_data_st *macctx = vmacctx;
-    OSSL_LIB_CTX *ctx = PROV_LIBCTX_OF(macctx->provctx);
-    const OSSL_PARAM *p;
+    OSSL_LIB_CTX *ctx;
+    struct cmac_set_ctx_params_st p;
+
+    if (macctx == NULL || !cmac_set_ctx_params_decoder(params, &p))
+        return 0;

-    if (ossl_param_is_empty(params))
-        return 1;
+    ctx = PROV_LIBCTX_OF(macctx->provctx);

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(macctx,
-            OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_CIPHER_PARAM_FIPS_ENCRYPT_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(macctx, OSSL_FIPS_IND_SETTABLE0, p.ind_ec))
         return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_CIPHER)) != NULL) {
-        if (!ossl_prov_cipher_load_from_params(&macctx->cipher, params, ctx))
+    if (p.cipher != NULL) {
+        if (!ossl_prov_cipher_load(&macctx->cipher, p.cipher, p.propq, ctx))
             return 0;

         if (EVP_CIPHER_get_mode(ossl_prov_cipher_cipher(&macctx->cipher))
@@ -275,17 +266,17 @@ static int cmac_set_ctx_params(void *vmacctx, const OSSL_PARAM params[])
                 && !EVP_CIPHER_is_a(cipher, "AES-192-CBC")
                 && !EVP_CIPHER_is_a(cipher, "AES-128-CBC")
                 && !EVP_CIPHER_is_a(cipher, "DES-EDE3-CBC")) {
-                ERR_raise(ERR_LIB_PROV, PROV_R_NOT_SUPPORTED);
+                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_CIPHER);
                 return 0;
             }
         }
 #endif
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_KEY)) != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING)
+    if (p.key != NULL) {
+        if (p.key->data_type != OSSL_PARAM_OCTET_STRING)
             return 0;
-        return cmac_setkey(macctx, p->data, p->data_size);
+        return cmac_setkey(macctx, p.key->data, p.key->data_size);
     }
     return 1;
 }
diff --git a/deps/openssl/openssl/providers/implementations/macs/cmac_prov.inc.in b/deps/openssl/openssl/providers/implementations/macs/cmac_prov.inc.in
new file mode 100644
index 00000000000..e82beaa1aa2
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/macs/cmac_prov.inc.in
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('cmac_get_ctx_params',
+                         (['OSSL_MAC_PARAM_SIZE',                    'size',   'size_t'],
+                          ['OSSL_MAC_PARAM_BLOCK_SIZE',              'bsize',  'size_t'],
+                          ['OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR', 'ind',    'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('cmac_set_ctx_params',
+                         (['OSSL_MAC_PARAM_CIPHER',                'cipher', 'utf8_string'],
+                          ['OSSL_MAC_PARAM_PROPERTIES',            'propq',  'utf8_string'],
+                          ['OSSL_MAC_PARAM_KEY',                   'key',    'octet_string'],
+                          ['OSSL_CIPHER_PARAM_FIPS_ENCRYPT_CHECK', 'ind_ec', 'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/macs/gmac_prov.c b/deps/openssl/openssl/providers/implementations/macs/gmac_prov.c
index 926d5274130..59a4980951b 100644
--- a/deps/openssl/openssl/providers/implementations/macs/gmac_prov.c
+++ b/deps/openssl/openssl/providers/implementations/macs/gmac_prov.c
@@ -8,6 +8,7 @@
  */

 #include <stdlib.h>
+#include <string.h>
 #include <openssl/core_dispatch.h>
 #include <openssl/core_names.h>
 #include <openssl/params.h>
@@ -15,11 +16,12 @@
 #include <openssl/err.h>
 #include <openssl/proverr.h>

+#include "internal/cryptlib.h"
 #include "prov/implementations.h"
 #include "prov/provider_ctx.h"
 #include "prov/provider_util.h"
 #include "prov/providercommon.h"
-#include "fips/fipsindicator.h"
+#include "providers/implementations/macs/gmac_prov.inc"

 /*
  * Forward declaration of everything implemented here.  This is not strictly
@@ -31,6 +33,10 @@ static OSSL_FUNC_mac_dupctx_fn gmac_dup;
 static OSSL_FUNC_mac_freectx_fn gmac_free;
 static OSSL_FUNC_mac_gettable_params_fn gmac_gettable_params;
 static OSSL_FUNC_mac_get_params_fn gmac_get_params;
+#ifdef FIPS_MODULE
+static OSSL_FUNC_mac_gettable_ctx_params_fn gmac_gettable_ctx_params;
+static OSSL_FUNC_mac_get_ctx_params_fn gmac_get_ctx_params;
+#endif
 static OSSL_FUNC_mac_settable_ctx_params_fn gmac_settable_ctx_params;
 static OSSL_FUNC_mac_set_ctx_params_fn gmac_set_ctx_params;
 static OSSL_FUNC_mac_init_fn gmac_init;
@@ -140,7 +146,7 @@ static int gmac_update(void *vmacctx, const unsigned char *data,
         data += INT_MAX;
         datalen -= INT_MAX;
     }
-    return EVP_EncryptUpdate(ctx, NULL, &outlen, data, datalen);
+    return EVP_EncryptUpdate(ctx, NULL, &outlen, data, (int)datalen);
 }

 static int gmac_final(void *vmacctx, unsigned char *out, size_t *outl,
@@ -156,7 +162,7 @@ static int gmac_final(void *vmacctx, unsigned char *out, size_t *outl,
     if (!EVP_EncryptFinal_ex(macctx->ctx, out, &hlen))
         return 0;

-    hlen = gmac_size();
+    hlen = (int)gmac_size();
     params[0] = OSSL_PARAM_construct_octet_string(OSSL_CIPHER_PARAM_AEAD_TAG,
         out, (size_t)hlen);
     if (!EVP_CIPHER_CTX_get_params(macctx->ctx, params))
@@ -166,60 +172,47 @@ static int gmac_final(void *vmacctx, unsigned char *out, size_t *outl,
     return 1;
 }

-static const OSSL_PARAM known_gettable_params[] = {
-    OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *gmac_gettable_params(void *provctx)
 {
-    return known_gettable_params;
+    return gmac_get_params_list;
 }

 static int gmac_get_params(OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    struct gmac_get_params_st p;
+
+    if (!gmac_get_params_decoder(params, &p))
+        return 0;

-    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL)
-        return OSSL_PARAM_set_size_t(p, gmac_size());
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, gmac_size()))
+        return 0;

     return 1;
 }

 #ifdef FIPS_MODULE
-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *gmac_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return gmac_get_ctx_params_list;
 }

-static int gmac_get_ctx_params(void *ctx, OSSL_PARAM params[])
+static int gmac_get_ctx_params(ossl_unused void *ctx, OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    struct gmac_get_ctx_params_st p;

-    p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, gmac_size()))
+    if (!gmac_get_ctx_params_decoder(params, &p))
         return 0;
-    return ossl_FIPS_IND_get_ctx_param_approved(ctx, params);
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, gmac_size()))
+        return 0;
+    return 1;
 }
 #endif

-static const OSSL_PARAM known_settable_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_CIPHER, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_PROPERTIES, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_MAC_PARAM_KEY, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_MAC_PARAM_IV, NULL, 0),
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *gmac_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    return known_settable_ctx_params;
+    return gmac_set_ctx_params_list;
 }

 /*
@@ -228,17 +221,19 @@ static const OSSL_PARAM *gmac_settable_ctx_params(ossl_unused void *ctx,
 static int gmac_set_ctx_params(void *vmacctx, const OSSL_PARAM params[])
 {
     struct gmac_data_st *macctx = vmacctx;
-    EVP_CIPHER_CTX *ctx = macctx->ctx;
-    OSSL_LIB_CTX *provctx = PROV_LIBCTX_OF(macctx->provctx);
-    const OSSL_PARAM *p;
+    EVP_CIPHER_CTX *ctx;
+    OSSL_LIB_CTX *provctx;
+    struct gmac_set_ctx_params_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
-    if (ctx == NULL)
+    if (macctx == NULL || !gmac_set_ctx_params_decoder(params, &p))
+        return 0;
+
+    if ((ctx = macctx->ctx) == NULL)
         return 0;
+    provctx = PROV_LIBCTX_OF(macctx->provctx);

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_CIPHER)) != NULL) {
-        if (!ossl_prov_cipher_load_from_params(&macctx->cipher, params, provctx))
+    if (p.cipher != NULL) {
+        if (!ossl_prov_cipher_load(&macctx->cipher, p.cipher, p.propq, provctx))
             return 0;
         if (EVP_CIPHER_get_mode(ossl_prov_cipher_cipher(&macctx->cipher))
             != EVP_CIPH_GCM_MODE) {
@@ -246,24 +241,23 @@ static int gmac_set_ctx_params(void *vmacctx, const OSSL_PARAM params[])
             return 0;
         }
         if (!EVP_EncryptInit_ex(ctx, ossl_prov_cipher_cipher(&macctx->cipher),
-                ossl_prov_cipher_engine(&macctx->cipher), NULL,
-                NULL))
+                NULL, NULL, NULL))
             return 0;
     }

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_KEY)) != NULL)
-        if (p->data_type != OSSL_PARAM_OCTET_STRING
-            || !gmac_setkey(macctx, p->data, p->data_size))
+    if (p.key != NULL)
+        if (p.key->data_type != OSSL_PARAM_OCTET_STRING
+            || !gmac_setkey(macctx, p.key->data, p.key->data_size))
             return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_IV)) != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING)
+    if (p.iv != NULL) {
+        if (p.iv->data_type != OSSL_PARAM_OCTET_STRING)
             return 0;

         if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN,
-                p->data_size, NULL)
+                (int)p.iv->data_size, NULL)
                 <= 0
-            || !EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, p->data))
+            || !EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, p.iv->data))
             return 0;
     }
     return 1;
diff --git a/deps/openssl/openssl/providers/implementations/macs/gmac_prov.inc.in b/deps/openssl/openssl/providers/implementations/macs/gmac_prov.inc.in
new file mode 100644
index 00000000000..27c3cc62ab0
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/macs/gmac_prov.inc.in
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('gmac_get_params',
+                         (['OSSL_MAC_PARAM_SIZE',    'size', 'size_t'],
+                        )); -}
+
+{- produce_param_decoder('gmac_get_ctx_params',
+                         (['OSSL_MAC_PARAM_SIZE',                    'size', 'size_t'],
+                          ['OSSL_MAC_PARAM_FIPS_APPROVED_INDICATOR', 'fips indicator', 'int'],
+                        )); -}
+
+{- produce_param_decoder('gmac_set_ctx_params',
+                         (['OSSL_MAC_PARAM_CIPHER',     'cipher', 'utf8_string'],
+                          ['OSSL_MAC_PARAM_PROPERTIES', 'propq',  'utf8_string'],
+                          ['OSSL_MAC_PARAM_KEY',        'key',    'octet_string'],
+                          ['OSSL_MAC_PARAM_IV',         'iv',     'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/macs/hmac_prov.c b/deps/openssl/openssl/providers/implementations/macs/hmac_prov.c
index 9872519f3d6..dfb378b68bd 100644
--- a/deps/openssl/openssl/providers/implementations/macs/hmac_prov.c
+++ b/deps/openssl/openssl/providers/implementations/macs/hmac_prov.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -24,12 +24,14 @@
 #include <openssl/err.h>

 #include "internal/ssl3_cbc.h"
+#include "internal/cryptlib.h"

 #include "prov/implementations.h"
 #include "prov/provider_ctx.h"
 #include "prov/provider_util.h"
 #include "prov/providercommon.h"
 #include "prov/securitycheck.h"
+#include "providers/implementations/macs/hmac_prov.inc"

 /*
  * Forward declaration of everything implemented here.  This is not strictly
@@ -169,7 +171,7 @@ static int hmac_setkey(struct hmac_data_st *macctx,
         if (!approved) {
             if (!OSSL_FIPS_IND_ON_UNAPPROVED(macctx, OSSL_FIPS_IND_SETTABLE0,
                     libctx, "HMAC", "keysize",
-                    ossl_fips_config_hmac_key_check)) {
+                    FIPS_CONFIG_HMAC_KEY_CHECK)) {
                 ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
                 return 0;
             }
@@ -191,8 +193,7 @@ static int hmac_setkey(struct hmac_data_st *macctx,
     digest = ossl_prov_digest_md(&macctx->digest);
     /* HMAC_Init_ex doesn't tolerate all zero params, so we must be careful */
     if (key != NULL || (macctx->tls_data_size == 0 && digest != NULL))
-        return HMAC_Init_ex(macctx->ctx, key, keylen, digest,
-            ossl_prov_digest_engine(&macctx->digest));
+        return HMAC_Init_ex(macctx->ctx, key, (int)keylen, digest, NULL);
     return 1;
 }

@@ -238,8 +239,7 @@ static int hmac_update(void *vmacctx, const unsigned char *data,
             datalen,
             macctx->tls_data_size,
             macctx->key,
-            macctx->keylen,
-            0);
+            macctx->keylen);
     }

     return HMAC_Update(macctx->ctx, data, datalen);
@@ -267,59 +267,43 @@ static int hmac_final(void *vmacctx, unsigned char *out, size_t *outl,
     return 1;
 }

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
-    OSSL_PARAM_size_t(OSSL_MAC_PARAM_BLOCK_SIZE, NULL),
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
 static const OSSL_PARAM *hmac_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return hmac_get_ctx_params_list;
 }

 static int hmac_get_ctx_params(void *vmacctx, OSSL_PARAM params[])
 {
     struct hmac_data_st *macctx = vmacctx;
-    OSSL_PARAM *p;
+    struct hmac_get_ctx_params_st p;
+
+    if (macctx == NULL || !hmac_get_ctx_params_decoder(params, &p))
+        return 0;

-    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL
-        && !OSSL_PARAM_set_size_t(p, hmac_size(macctx)))
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, hmac_size(macctx)))
         return 0;

-    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_BLOCK_SIZE)) != NULL
-        && !OSSL_PARAM_set_int(p, hmac_block_size(macctx)))
+    if (p.bsize != NULL && !OSSL_PARAM_set_int(p.bsize, hmac_block_size(macctx)))
         return 0;

 #ifdef FIPS_MODULE
-    p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_FIPS_APPROVED_INDICATOR);
-    if (p != NULL) {
+    if (p.ind != NULL) {
         int approved = 0;

         if (!macctx->internal)
             approved = OSSL_FIPS_IND_GET(macctx)->approved;
-        if (!OSSL_PARAM_set_int(p, approved))
+        if (!OSSL_PARAM_set_int(p.ind, approved))
             return 0;
     }
 #endif
     return 1;
 }

-static const OSSL_PARAM known_settable_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_DIGEST, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_PROPERTIES, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_MAC_PARAM_KEY, NULL, 0),
-    OSSL_PARAM_int(OSSL_MAC_PARAM_DIGEST_NOINIT, NULL),
-    OSSL_PARAM_int(OSSL_MAC_PARAM_DIGEST_ONESHOT, NULL),
-    OSSL_PARAM_size_t(OSSL_MAC_PARAM_TLS_DATA_SIZE, NULL),
-    OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_MAC_PARAM_FIPS_KEY_CHECK)
-        OSSL_PARAM_END
-};
 static const OSSL_PARAM *hmac_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    return known_settable_ctx_params;
+    return hmac_set_ctx_params_list;
 }

 /*
@@ -328,33 +312,32 @@ static const OSSL_PARAM *hmac_settable_ctx_params(ossl_unused void *ctx,
 static int hmac_set_ctx_params(void *vmacctx, const OSSL_PARAM params[])
 {
     struct hmac_data_st *macctx = vmacctx;
-    OSSL_LIB_CTX *ctx = PROV_LIBCTX_OF(macctx->provctx);
-    const OSSL_PARAM *p;
+    OSSL_LIB_CTX *ctx;
+    struct hmac_set_ctx_params_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (macctx == NULL || !hmac_set_ctx_params_decoder(params, &p))
+        return 0;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(macctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_MAC_PARAM_FIPS_KEY_CHECK))
+    ctx = PROV_LIBCTX_OF(macctx->provctx);
+
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(macctx, OSSL_FIPS_IND_SETTABLE0, p.ind_k))
         return 0;

-    if (!ossl_prov_digest_load_from_params(&macctx->digest, params, ctx))
+    if (p.digest != NULL
+        && !ossl_prov_digest_load(&macctx->digest, p.digest, p.propq, ctx))
         return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_KEY)) != NULL) {
-        if (p->data_type != OSSL_PARAM_OCTET_STRING)
+    if (p.key != NULL) {
+        if (p.key->data_type != OSSL_PARAM_OCTET_STRING)
             return 0;

-        if (!hmac_setkey(macctx, p->data, p->data_size))
+        if (!hmac_setkey(macctx, p.key->data, p.key->data_size))
             return 0;
     }

-    if ((p = OSSL_PARAM_locate_const(params,
-             OSSL_MAC_PARAM_TLS_DATA_SIZE))
-        != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &macctx->tls_data_size))
-            return 0;
-    }
+    if (p.tlssize != NULL && !OSSL_PARAM_get_size_t(p.tlssize, &macctx->tls_data_size))
+        return 0;
+
     return 1;
 }

diff --git a/deps/openssl/openssl/providers/implementations/macs/hmac_prov.inc.in b/deps/openssl/openssl/providers/implementations/macs/hmac_prov.inc.in
new file mode 100644
index 00000000000..4e4f15f81dd
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/macs/hmac_prov.inc.in
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('hmac_get_ctx_params',
+                         (['OSSL_MAC_PARAM_SIZE',                    'size',   'size_t'],
+                          ['OSSL_MAC_PARAM_BLOCK_SIZE',              'bsize',  'size_t'],
+                          ['OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR', 'ind',    'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('hmac_set_ctx_params',
+                         (['OSSL_MAC_PARAM_DIGEST',         'digest',  'utf8_string'],
+                          ['OSSL_MAC_PARAM_PROPERTIES',     'propq',   'utf8_string'],
+                          ['OSSL_MAC_PARAM_KEY',            'key',     'octet_string'],
+                          ['OSSL_MAC_PARAM_TLS_DATA_SIZE',  'tlssize', 'size_t'],
+                          ['OSSL_MAC_PARAM_FIPS_KEY_CHECK', 'ind_k',   'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/macs/kmac_prov.c b/deps/openssl/openssl/providers/implementations/macs/kmac_prov.c
index f91af2c1e40..97e23261a0a 100644
--- a/deps/openssl/openssl/providers/implementations/macs/kmac_prov.c
+++ b/deps/openssl/openssl/providers/implementations/macs/kmac_prov.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -61,6 +61,8 @@
 #include "prov/provider_util.h"
 #include "prov/providercommon.h"
 #include "internal/cryptlib.h" /* ossl_assert */
+#include "providers/implementations/macs/kmac_prov.inc"
+#include "crypto/sha.h"

 /*
  * Forward declaration of everything implemented here.  This is not strictly
@@ -138,18 +140,8 @@ struct kmac_data_st {
     OSSL_FIPS_IND_DECLARE
 };

-static int encode_string(unsigned char *out, size_t out_max_len, size_t *out_len,
-    const unsigned char *in, size_t in_len);
-static int right_encode(unsigned char *out, size_t out_max_len, size_t *out_len,
-    size_t bits);
-static int bytepad(unsigned char *out, size_t *out_len,
-    const unsigned char *in1, size_t in1_len,
-    const unsigned char *in2, size_t in2_len,
-    size_t w);
 static int kmac_bytepad_encode_key(unsigned char *out, size_t out_max_len,
-    size_t *out_len,
-    const unsigned char *in, size_t in_len,
-    size_t w);
+    size_t *out_len, const unsigned char *in, size_t in_len, size_t w);

 static void kmac_free(void *vmacctx)
 {
@@ -186,26 +178,31 @@ static struct kmac_data_st *kmac_new(void *provctx)
     return kctx;
 }

+#define kmac_new_list
+
 static void *kmac_fetch_new(void *provctx, const OSSL_PARAM *params)
 {
     struct kmac_data_st *kctx = kmac_new(provctx);
+    struct kmac_new_st p;
     int md_size;

     if (kctx == NULL)
         return 0;
-    if (!ossl_prov_digest_load_from_params(&kctx->digest, params,
-            PROV_LIBCTX_OF(provctx))) {
-        kmac_free(kctx);
-        return 0;
-    }
+    if (!kmac_new_decoder(params, &p))
+        goto err;
+    if (!ossl_prov_digest_load(&kctx->digest, p.digest, p.propq,
+            PROV_LIBCTX_OF(provctx)))
+        goto err;

     md_size = EVP_MD_get_size(ossl_prov_digest_md(&kctx->digest));
-    if (md_size <= 0) {
-        kmac_free(kctx);
-        return 0;
-    }
+    if (md_size <= 0)
+        goto err;
     kctx->out_len = (size_t)md_size;
     return kctx;
+
+err:
+    kmac_free(kctx);
+    return NULL;
 }

 static void *kmac128_new(void *provctx)
@@ -281,7 +278,7 @@ static int kmac_setkey(struct kmac_data_st *kctx, const unsigned char *key,
             if (!OSSL_FIPS_IND_ON_UNAPPROVED(kctx, OSSL_FIPS_IND_SETTABLE1,
                     PROV_LIBCTX_OF(kctx->provctx),
                     "KMAC", "Key size",
-                    ossl_fips_config_kmac_key_check)) {
+                    FIPS_CONFIG_KMAC_KEY_CHECK)) {
                 ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
                 return 0;
             }
@@ -343,7 +340,7 @@ static int kmac_init(void *vmacctx, const unsigned char *key,
         (void)kmac_set_ctx_params(kctx, cparams);
     }

-    if (!bytepad(NULL, &out_len, kmac_string, sizeof(kmac_string),
+    if (!ossl_sp800_185_bytepad(NULL, 0, &out_len, kmac_string, sizeof(kmac_string),
             kctx->custom, kctx->custom_len, block_len)) {
         ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
         return 0;
@@ -351,7 +348,7 @@ static int kmac_init(void *vmacctx, const unsigned char *key,
     out = OPENSSL_malloc(out_len);
     if (out == NULL)
         return 0;
-    res = bytepad(out, NULL, kmac_string, sizeof(kmac_string),
+    res = ossl_sp800_185_bytepad(out, out_len, NULL, kmac_string, sizeof(kmac_string),
               kctx->custom, kctx->custom_len, block_len)
         && EVP_DigestUpdate(ctx, out, out_len)
         && EVP_DigestUpdate(ctx, kctx->key, kctx->key_len);
@@ -382,60 +379,47 @@ static int kmac_final(void *vmacctx, unsigned char *out, size_t *outl,
     /* KMAC XOF mode sets the encoded length to 0 */
     lbits = (kctx->xof_mode ? 0 : (kctx->out_len * 8));

-    ok = right_encode(encoded_outlen, sizeof(encoded_outlen), &len, lbits)
+    ok = ossl_sp800_185_right_encode(encoded_outlen, sizeof(encoded_outlen), &len, lbits)
         && EVP_DigestUpdate(ctx, encoded_outlen, len)
         && EVP_DigestFinalXOF(ctx, out, kctx->out_len);
     *outl = kctx->out_len;
     return ok;
 }

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
-    OSSL_PARAM_size_t(OSSL_MAC_PARAM_BLOCK_SIZE, NULL),
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
 static const OSSL_PARAM *kmac_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return kmac_get_ctx_params_list;
 }

 static int kmac_get_ctx_params(void *vmacctx, OSSL_PARAM params[])
 {
     struct kmac_data_st *kctx = vmacctx;
-    OSSL_PARAM *p;
+    struct kmac_get_ctx_params_st p;
     int sz;

-    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL
-        && !OSSL_PARAM_set_size_t(p, kctx->out_len))
+    if (kctx == NULL || !kmac_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, kctx->out_len))
         return 0;

-    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_BLOCK_SIZE)) != NULL) {
+    if (p.bsize != NULL) {
         sz = EVP_MD_block_size(ossl_prov_digest_md(&kctx->digest));
-        if (!OSSL_PARAM_set_int(p, sz))
+        if (!OSSL_PARAM_set_int(p.bsize, sz))
             return 0;
     }

-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(kctx, params))
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(kctx, p.ind))
         return 0;

     return 1;
 }

-static const OSSL_PARAM known_settable_ctx_params[] = {
-    OSSL_PARAM_int(OSSL_MAC_PARAM_XOF, NULL),
-    OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
-    OSSL_PARAM_octet_string(OSSL_MAC_PARAM_KEY, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_MAC_PARAM_CUSTOM, NULL, 0),
-    OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_MAC_PARAM_FIPS_NO_SHORT_MAC)
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_MAC_PARAM_FIPS_KEY_CHECK)
-            OSSL_PARAM_END
-};
 static const OSSL_PARAM *kmac_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    return known_settable_ctx_params;
+    return kmac_set_ctx_params_list;
 }

 /*
@@ -450,25 +434,24 @@ static const OSSL_PARAM *kmac_settable_ctx_params(ossl_unused void *ctx,
 static int kmac_set_ctx_params(void *vmacctx, const OSSL_PARAM *params)
 {
     struct kmac_data_st *kctx = vmacctx;
-    const OSSL_PARAM *p;
+    struct kmac_set_ctx_params_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (kctx == NULL || !kmac_set_ctx_params_decoder(params, &p))
+        return 0;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(kctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_MAC_PARAM_FIPS_NO_SHORT_MAC))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(kctx, OSSL_FIPS_IND_SETTABLE0,
+            p.ind_sht))
         return 0;
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(kctx, OSSL_FIPS_IND_SETTABLE1, params,
-            OSSL_MAC_PARAM_FIPS_KEY_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(kctx, OSSL_FIPS_IND_SETTABLE1, p.ind_k))
         return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_XOF)) != NULL
-        && !OSSL_PARAM_get_int(p, &kctx->xof_mode))
+    if (p.xof != NULL && !OSSL_PARAM_get_int(p.xof, &kctx->xof_mode))
         return 0;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_SIZE)) != NULL) {
+
+    if (p.size != NULL) {
         size_t sz = 0;

-        if (!OSSL_PARAM_get_size_t(p, &sz))
+        if (!OSSL_PARAM_get_size_t(p.size, &sz))
             return 0;
         if (sz > KMAC_MAX_OUTPUT_LEN) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_OUTPUT_LENGTH);
@@ -480,7 +463,7 @@ static int kmac_set_ctx_params(void *vmacctx, const OSSL_PARAM *params)
             if (!OSSL_FIPS_IND_ON_UNAPPROVED(kctx, OSSL_FIPS_IND_SETTABLE0,
                     PROV_LIBCTX_OF(kctx->provctx),
                     "KMAC", "length",
-                    ossl_fips_config_no_short_mac)) {
+                    FIPS_CONFIG_NO_SHORT_MAC)) {
                 ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_OUTPUT_LENGTH);
                 return 0;
             }
@@ -488,172 +471,40 @@ static int kmac_set_ctx_params(void *vmacctx, const OSSL_PARAM *params)
 #endif
         kctx->out_len = sz;
     }
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_KEY)) != NULL
-        && !kmac_setkey(kctx, p->data, p->data_size))
-        return 0;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_CUSTOM))
-        != NULL) {
-        if (p->data_size > KMAC_MAX_CUSTOM) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_CUSTOM_LENGTH);
-            return 0;
-        }
-        if (!encode_string(kctx->custom, sizeof(kctx->custom), &kctx->custom_len,
-                p->data, p->data_size))
-            return 0;
-    }
-    return 1;
-}

-/* Encoding/Padding Methods. */
-
-/* Returns the number of bytes required to store 'bits' into a byte array */
-static unsigned int get_encode_size(size_t bits)
-{
-    unsigned int cnt = 0, sz = sizeof(size_t);
-
-    while (bits && (cnt < sz)) {
-        ++cnt;
-        bits >>= 8;
-    }
-    /* If bits is zero 1 byte is required */
-    if (cnt == 0)
-        cnt = 1;
-    return cnt;
-}
-
-/*
- * Convert an integer into bytes . The number of bytes is appended
- * to the end of the buffer. Returns an array of bytes 'out' of size
- * *out_len.
- *
- * e.g if bits = 32, out[2] = { 0x20, 0x01 }
- */
-static int right_encode(unsigned char *out, size_t out_max_len, size_t *out_len,
-    size_t bits)
-{
-    unsigned int len = get_encode_size(bits);
-    int i;
-
-    if (len >= out_max_len) {
-        ERR_raise(ERR_LIB_PROV, PROV_R_LENGTH_TOO_LARGE);
-        return 0;
-    }
-
-    /* MSB's are at the start of the bytes array */
-    for (i = len - 1; i >= 0; --i) {
-        out[i] = (unsigned char)(bits & 0xFF);
-        bits >>= 8;
-    }
-    /* Tack the length onto the end */
-    out[len] = (unsigned char)len;
-
-    /* The Returned length includes the tacked on byte */
-    *out_len = len + 1;
-    return 1;
-}
-
-/*
- * Encodes a string with a left encoded length added. Note that the
- * in_len is converted to bits (*8).
- *
- * e.g- in="KMAC" gives out[6] = { 0x01, 0x20, 0x4B, 0x4D, 0x41, 0x43 }
- *                                 len   bits    K     M     A     C
- */
-static int encode_string(unsigned char *out, size_t out_max_len, size_t *out_len,
-    const unsigned char *in, size_t in_len)
-{
-    if (in == NULL) {
-        *out_len = 0;
-    } else {
-        size_t i, bits, len, sz;
-
-        bits = 8 * in_len;
-        len = get_encode_size(bits);
-        sz = 1 + len + in_len;
-
-        if (sz > out_max_len) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_LENGTH_TOO_LARGE);
+    if (p.key != NULL)
+        if (p.key->data_type != OSSL_PARAM_OCTET_STRING
+            || !kmac_setkey(kctx, p.key->data, p.key->data_size))
             return 0;
-        }

-        out[0] = (unsigned char)len;
-        for (i = len; i > 0; --i) {
-            out[i] = (bits & 0xFF);
-            bits >>= 8;
-        }
-        memcpy(out + len + 1, in, in_len);
-        *out_len = sz;
-    }
-    return 1;
-}
-
-/*
- * Returns a zero padded encoding of the inputs in1 and an optional
- * in2 (can be NULL). The padded output must be a multiple of the blocksize 'w'.
- * The value of w is in bytes (< 256).
- *
- * The returned output is:
- *    zero_padded(multiple of w, (left_encode(w) || in1 [|| in2])
- */
-static int bytepad(unsigned char *out, size_t *out_len,
-    const unsigned char *in1, size_t in1_len,
-    const unsigned char *in2, size_t in2_len, size_t w)
-{
-    int len;
-    unsigned char *p = out;
-    int sz = w;
-
-    if (out == NULL) {
-        if (out_len == NULL) {
-            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
+    if (p.custom != NULL) {
+        if (p.custom->data_type != OSSL_PARAM_OCTET_STRING)
+            return 0;
+        if (p.custom->data_size > KMAC_MAX_CUSTOM) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_CUSTOM_LENGTH);
             return 0;
         }
-        sz = 2 + in1_len + (in2 != NULL ? in2_len : 0);
-        *out_len = (sz + w - 1) / w * w;
-        return 1;
+        if (!ossl_sp800_185_encode_string(kctx->custom,
+                sizeof(kctx->custom), &kctx->custom_len,
+                p.custom->data, p.custom->data_size))
+            return 0;
     }

-    if (!ossl_assert(w <= 255))
-        return 0;
-
-    /* Left encoded w */
-    *p++ = 1;
-    *p++ = (unsigned char)w;
-    /* || in1 */
-    memcpy(p, in1, in1_len);
-    p += in1_len;
-    /* [ || in2 ] */
-    if (in2 != NULL && in2_len > 0) {
-        memcpy(p, in2, in2_len);
-        p += in2_len;
-    }
-    /* Figure out the pad size (divisible by w) */
-    len = p - out;
-    sz = (len + w - 1) / w * w;
-    /* zero pad the end of the buffer */
-    if (sz != len)
-        memset(p, 0, sz - len);
-    if (out_len != NULL)
-        *out_len = sz;
     return 1;
 }

 /* Returns out = bytepad(encode_string(in), w) */
 static int kmac_bytepad_encode_key(unsigned char *out, size_t out_max_len,
-    size_t *out_len,
-    const unsigned char *in, size_t in_len,
-    size_t w)
+    size_t *out_len, const unsigned char *in, size_t in_len, size_t w)
 {
     unsigned char tmp[KMAC_MAX_KEY + KMAC_MAX_ENCODED_HEADER_LEN];
     size_t tmp_len;

-    if (!encode_string(tmp, sizeof(tmp), &tmp_len, in, in_len))
-        return 0;
-    if (!bytepad(NULL, out_len, tmp, tmp_len, NULL, 0, w))
+    if (!ossl_sp800_185_encode_string(tmp, sizeof(tmp), &tmp_len, in, in_len))
         return 0;
-    if (!ossl_assert(*out_len <= out_max_len))
+    if (!ossl_sp800_185_bytepad(NULL, out_max_len, out_len, tmp, tmp_len, NULL, 0, w))
         return 0;
-    return bytepad(out, NULL, tmp, tmp_len, NULL, 0, w);
+    return ossl_sp800_185_bytepad(out, out_max_len, NULL, tmp, tmp_len, NULL, 0, w);
 }

 #define IMPLEMENT_KMAC_TABLE(size, funcname, newname)                          \
diff --git a/deps/openssl/openssl/providers/implementations/macs/kmac_prov.inc.in b/deps/openssl/openssl/providers/implementations/macs/kmac_prov.inc.in
new file mode 100644
index 00000000000..56ccd75c8b7
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/macs/kmac_prov.inc.in
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('kmac_new',
+                         (['OSSL_MAC_PARAM_DIGEST',     'digest', 'utf8_string'],
+                          ['OSSL_MAC_PARAM_PROPERTIES', 'propq',  'utf8_string'],
+                         )); -}
+
+{- produce_param_decoder('kmac_get_ctx_params',
+                         (['OSSL_MAC_PARAM_SIZE',                    'size',   'size_t'],
+                          ['OSSL_MAC_PARAM_BLOCK_SIZE',              'bsize',  'size_t'],
+                          ['OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR', 'ind',    'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('kmac_set_ctx_params',
+                         (['OSSL_MAC_PARAM_XOF',               'xof',     'int'],
+                          ['OSSL_MAC_PARAM_SIZE',              'size',    'size_t'],
+                          ['OSSL_MAC_PARAM_KEY',               'key',     'octet_string'],
+                          ['OSSL_MAC_PARAM_CUSTOM',            'custom',  'octet_string'],
+                          ['OSSL_MAC_PARAM_FIPS_KEY_CHECK',    'ind_k',   'int', 'fips'],
+                          ['OSSL_MAC_PARAM_FIPS_NO_SHORT_MAC', 'ind_sht', 'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/macs/poly1305_prov.c b/deps/openssl/openssl/providers/implementations/macs/poly1305_prov.c
index 69d4444a58d..325fb0bdfb7 100644
--- a/deps/openssl/openssl/providers/implementations/macs/poly1305_prov.c
+++ b/deps/openssl/openssl/providers/implementations/macs/poly1305_prov.c
@@ -7,6 +7,8 @@
  * https://www.openssl.org/source/license.html
  */

+#include <string.h>
+
 #include <openssl/core_dispatch.h>
 #include <openssl/core_names.h>
 #include <openssl/params.h>
@@ -14,10 +16,12 @@
 #include <openssl/err.h>
 #include <openssl/proverr.h>

+#include "internal/cryptlib.h"
 #include "crypto/poly1305.h"

 #include "prov/implementations.h"
 #include "prov/providercommon.h"
+#include "providers/implementations/macs/poly1305_prov.inc"

 /*
  * Forward declaration of everything implemented here.  This is not strictly
@@ -141,43 +145,42 @@ static int poly1305_final(void *vmacctx, unsigned char *out, size_t *outl,
     return 1;
 }

-static const OSSL_PARAM known_gettable_params[] = {
-    OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *poly1305_gettable_params(void *provctx)
 {
-    return known_gettable_params;
+    return poly1305_get_params_list;
 }

 static int poly1305_get_params(OSSL_PARAM params[])
 {
-    OSSL_PARAM *p;
+    struct poly1305_get_params_st p;

-    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL)
-        return OSSL_PARAM_set_size_t(p, poly1305_size());
+    if (!poly1305_get_params_decoder(params, &p))
+        return 0;
+
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, poly1305_size()))
+        return 0;

     return 1;
 }

-static const OSSL_PARAM known_settable_ctx_params[] = {
-    OSSL_PARAM_octet_string(OSSL_MAC_PARAM_KEY, NULL, 0),
-    OSSL_PARAM_END
-};
 static const OSSL_PARAM *poly1305_settable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    return known_settable_ctx_params;
+    return poly1305_set_ctx_params_list;
 }

 static int poly1305_set_ctx_params(void *vmacctx, const OSSL_PARAM *params)
 {
     struct poly1305_data_st *ctx = vmacctx;
-    const OSSL_PARAM *p;
+    struct poly1305_set_ctx_params_st p;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_KEY)) != NULL
-        && !poly1305_setkey(ctx, p->data, p->data_size))
+    if (ctx == NULL || !poly1305_set_ctx_params_decoder(params, &p))
         return 0;
+
+    if (p.key != NULL)
+        if (p.key->data_type != OSSL_PARAM_OCTET_STRING
+            || !poly1305_setkey(ctx, p.key->data, p.key->data_size))
+            return 0;
     return 1;
 }

diff --git a/deps/openssl/openssl/providers/implementations/macs/poly1305_prov.inc.in b/deps/openssl/openssl/providers/implementations/macs/poly1305_prov.inc.in
new file mode 100644
index 00000000000..95c990a2883
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/macs/poly1305_prov.inc.in
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('poly1305_get_params',
+                         (['OSSL_MAC_PARAM_SIZE',        'size', 'size_t'],
+                         )); -}
+
+{- produce_param_decoder('poly1305_set_ctx_params',
+                         (['OSSL_MAC_PARAM_KEY',     'key',  'octet_string'],
+                        )); -}
diff --git a/deps/openssl/openssl/providers/implementations/macs/siphash_prov.c b/deps/openssl/openssl/providers/implementations/macs/siphash_prov.c
index f20b633995a..5c356f2a1f0 100644
--- a/deps/openssl/openssl/providers/implementations/macs/siphash_prov.c
+++ b/deps/openssl/openssl/providers/implementations/macs/siphash_prov.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,10 +15,12 @@
 #include <openssl/err.h>
 #include <openssl/proverr.h>

+#include "internal/cryptlib.h"
 #include "crypto/siphash.h"

 #include "prov/implementations.h"
 #include "prov/providercommon.h"
+#include "providers/implementations/macs/siphash_prov.inc"

 /*
  * Forward declaration of everything implemented here.  This is not strictly
@@ -151,29 +153,22 @@ static int siphash_final(void *vmacctx, unsigned char *out, size_t *outl,
 static const OSSL_PARAM *siphash_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
-        OSSL_PARAM_uint(OSSL_MAC_PARAM_C_ROUNDS, NULL),
-        OSSL_PARAM_uint(OSSL_MAC_PARAM_D_ROUNDS, NULL),
-        OSSL_PARAM_END
-    };
-
-    return known_gettable_ctx_params;
+    return siphash_get_ctx_params_list;
 }

 static int siphash_get_ctx_params(void *vmacctx, OSSL_PARAM params[])
 {
     struct siphash_data_st *ctx = vmacctx;
-    OSSL_PARAM *p;
+    struct siphash_get_ctx_params_st p;

-    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL
-        && !OSSL_PARAM_set_size_t(p, siphash_size(vmacctx)))
+    if (ctx == NULL || !siphash_get_ctx_params_decoder(params, &p))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_C_ROUNDS)) != NULL
-        && !OSSL_PARAM_set_uint(p, crounds(ctx)))
+
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, siphash_size(vmacctx)))
+        return 0;
+    if (p.c != NULL && !OSSL_PARAM_set_uint(p.c, crounds(ctx)))
         return 0;
-    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_D_ROUNDS)) != NULL
-        && !OSSL_PARAM_set_uint(p, drounds(ctx)))
+    if (p.d != NULL && !OSSL_PARAM_set_uint(p.d, drounds(ctx)))
         return 0;
     return 1;
 }
@@ -181,41 +176,31 @@ static int siphash_get_ctx_params(void *vmacctx, OSSL_PARAM params[])
 static const OSSL_PARAM *siphash_settable_ctx_params(ossl_unused void *ctx,
     void *provctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
-        OSSL_PARAM_octet_string(OSSL_MAC_PARAM_KEY, NULL, 0),
-        OSSL_PARAM_uint(OSSL_MAC_PARAM_C_ROUNDS, NULL),
-        OSSL_PARAM_uint(OSSL_MAC_PARAM_D_ROUNDS, NULL),
-        OSSL_PARAM_END
-    };
-
-    return known_settable_ctx_params;
+    return siphash_set_params_list;
 }

 static int siphash_set_params(void *vmacctx, const OSSL_PARAM *params)
 {
     struct siphash_data_st *ctx = vmacctx;
-    const OSSL_PARAM *p = NULL;
+    struct siphash_set_params_st p;
     size_t size;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !siphash_set_params_decoder(params, &p))
+        return 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_SIZE)) != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &size)
+    if (p.size != NULL) {
+        if (!OSSL_PARAM_get_size_t(p.size, &size)
             || !SipHash_set_hash_size(&ctx->siphash, size)
             || !SipHash_set_hash_size(&ctx->sipcopy, size))
             return 0;
     }
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_C_ROUNDS)) != NULL
-        && !OSSL_PARAM_get_uint(p, &ctx->crounds))
+    if (p.c != NULL && !OSSL_PARAM_get_uint(p.c, &ctx->crounds))
         return 0;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_D_ROUNDS)) != NULL
-        && !OSSL_PARAM_get_uint(p, &ctx->drounds))
+    if (p.d != NULL && !OSSL_PARAM_get_uint(p.d, &ctx->drounds))
         return 0;
-    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_KEY)) != NULL)
-        if (p->data_type != OSSL_PARAM_OCTET_STRING
-            || !siphash_setkey(ctx, p->data, p->data_size))
+    if (p.key != NULL)
+        if (p.key->data_type != OSSL_PARAM_OCTET_STRING
+            || !siphash_setkey(ctx, p.key->data, p.key->data_size))
             return 0;
     return 1;
 }
diff --git a/deps/openssl/openssl/providers/implementations/macs/siphash_prov.inc.in b/deps/openssl/openssl/providers/implementations/macs/siphash_prov.inc.in
new file mode 100644
index 00000000000..31869d16763
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/macs/siphash_prov.inc.in
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('siphash_get_ctx_params',
+                         (['OSSL_MAC_PARAM_SIZE',        'size', 'size_t'],
+                          ['OSSL_MAC_PARAM_C_ROUNDS',    'c',    'uint'],
+                          ['OSSL_MAC_PARAM_D_ROUNDS',    'd',    'uint'],
+                         )); -}
+
+{- produce_param_decoder('siphash_set_params',
+                         (['OSSL_MAC_PARAM_SIZE',        'size', 'size_t'],
+                          ['OSSL_MAC_PARAM_KEY',         'key',  'octet_string'],
+                          ['OSSL_MAC_PARAM_C_ROUNDS',    'c',    'uint'],
+                          ['OSSL_MAC_PARAM_D_ROUNDS',    'd',    'uint'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/rands/drbg.c b/deps/openssl/openssl/providers/implementations/rands/drbg.c
index f9d90d5d438..000b4a2f699 100644
--- a/deps/openssl/openssl/providers/implementations/rands/drbg.c
+++ b/deps/openssl/openssl/providers/implementations/rands/drbg.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,7 +14,7 @@
 #include <openssl/evp.h>
 #include "crypto/rand.h"
 #include <openssl/proverr.h>
-#include "drbg_local.h"
+#include "prov/drbg.h"
 #include "internal/thread_once.h"
 #include "crypto/cryptlib.h"
 #include "prov/seeding.h"
@@ -352,7 +352,8 @@ int ossl_prov_drbg_instantiate(PROV_DRBG *drbg, unsigned int strength,
 {
     unsigned char *nonce = NULL, *entropy = NULL;
     size_t noncelen = 0, entropylen = 0;
-    size_t min_entropy, min_entropylen, max_entropylen;
+    unsigned int min_entropy;
+    size_t min_entropylen, max_entropylen;

     if (strength > drbg->strength) {
         ERR_raise(ERR_LIB_PROV, PROV_R_INSUFFICIENT_DRBG_STRENGTH);
@@ -625,10 +626,17 @@ int ossl_prov_drbg_generate(PROV_DRBG *drbg, unsigned char *out, size_t outlen,
     int fork_id;
     int reseed_required = 0;
     int ret = 0;
+    time_t reseed_time_interval = drbg->reseed_time_interval;
+    time_t now = 0;

     if (!ossl_prov_is_running())
         return 0;

+    fork_id = openssl_get_fork_id();
+
+    if (reseed_time_interval > 0)
+        now = time(NULL);
+
     if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
         return 0;

@@ -659,8 +667,6 @@ int ossl_prov_drbg_generate(PROV_DRBG *drbg, unsigned char *out, size_t outlen,
         goto err;
     }

-    fork_id = openssl_get_fork_id();
-
     if (drbg->fork_id != fork_id) {
         drbg->fork_id = fork_id;
         reseed_required = 1;
@@ -670,10 +676,9 @@ int ossl_prov_drbg_generate(PROV_DRBG *drbg, unsigned char *out, size_t outlen,
         if (drbg->generate_counter >= drbg->reseed_interval)
             reseed_required = 1;
     }
-    if (drbg->reseed_time_interval > 0) {
-        time_t now = time(NULL);
+    if (reseed_time_interval > 0) {
         if (now < drbg->reseed_time
-            || now - drbg->reseed_time >= drbg->reseed_time_interval)
+            || now - drbg->reseed_time >= reseed_time_interval)
             reseed_required = 1;
     }
     if (drbg->parent != NULL
@@ -874,55 +879,54 @@ void ossl_rand_drbg_free(PROV_DRBG *drbg)
  * Helper function called by internal DRBG implementations. Assumes that at
  * least a read lock has been taken on drbg->lock
  */
-int ossl_drbg_get_ctx_params(PROV_DRBG *drbg, OSSL_PARAM params[])
+int ossl_drbg_get_ctx_params(PROV_DRBG *drbg,
+    const struct drbg_get_ctx_params_st *p)
 {
-    OSSL_PARAM *p;
-
-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
-    if (p != NULL && !OSSL_PARAM_set_int(p, drbg->state))
+    if (p->state != NULL && !OSSL_PARAM_set_int(p->state, drbg->state))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
-    if (p != NULL && !OSSL_PARAM_set_int(p, drbg->strength))
+    if (p->str != NULL && !OSSL_PARAM_set_int(p->str, drbg->strength))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MIN_ENTROPYLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->min_entropylen))
+    if (p->minentlen != NULL
+        && !OSSL_PARAM_set_size_t(p->minentlen, drbg->min_entropylen))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_ENTROPYLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_entropylen))
+    if (p->maxentlen != NULL
+        && !OSSL_PARAM_set_size_t(p->maxentlen, drbg->max_entropylen))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MIN_NONCELEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->min_noncelen))
+    if (p->minnonlen != NULL
+        && !OSSL_PARAM_set_size_t(p->minnonlen, drbg->min_noncelen))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_NONCELEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_noncelen))
+    if (p->maxnonlen != NULL
+        && !OSSL_PARAM_set_size_t(p->maxnonlen, drbg->max_noncelen))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_PERSLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_perslen))
+    if (p->maxperlen != NULL
+        && !OSSL_PARAM_set_size_t(p->maxperlen, drbg->max_perslen))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_ADINLEN);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_adinlen))
+    if (p->maxadlen != NULL
+        && !OSSL_PARAM_set_size_t(p->maxadlen, drbg->max_adinlen))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_REQUESTS);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, drbg->reseed_interval))
+    if (p->reseed_req != NULL
+        && !OSSL_PARAM_set_uint(p->reseed_req, drbg->reseed_interval))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_TIME);
-    if (p != NULL && !OSSL_PARAM_set_time_t(p, drbg->reseed_time))
+    if (p->reseed_time != NULL
+        && !OSSL_PARAM_set_time_t(p->reseed_time, drbg->reseed_time))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL);
-    if (p != NULL && !OSSL_PARAM_set_time_t(p, drbg->reseed_time_interval))
+    if (p->reseed_int != NULL
+        && !OSSL_PARAM_set_time_t(p->reseed_int, drbg->reseed_time_interval))
         return 0;
-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(drbg, params))
+
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(drbg, p->ind))
         return 0;
+
     return 1;
 }

@@ -930,16 +934,15 @@ int ossl_drbg_get_ctx_params(PROV_DRBG *drbg, OSSL_PARAM params[])
  * Helper function to get certain params that require no lock to obtain. Sets
  * *complete to 1 if all the params were processed, or 0 otherwise
  */
-int ossl_drbg_get_ctx_params_no_lock(PROV_DRBG *drbg, OSSL_PARAM params[],
-    int *complete)
+int ossl_drbg_get_ctx_params_no_lock(PROV_DRBG *drbg,
+    const struct drbg_get_ctx_params_st *p,
+    const OSSL_PARAM params[], int *complete)
 {
     size_t cnt = 0;
-    OSSL_PARAM *p;

     /* This value never changes once set */
-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
-    if (p != NULL) {
-        if (!OSSL_PARAM_set_size_t(p, drbg->max_request))
+    if (p->maxreq != NULL) {
+        if (!OSSL_PARAM_set_size_t(p->maxreq, drbg->max_request))
             return 0;
         cnt++;
     }
@@ -948,9 +951,8 @@ int ossl_drbg_get_ctx_params_no_lock(PROV_DRBG *drbg, OSSL_PARAM params[],
      * Can be changed by multiple threads, but we tolerate inaccuracies in this
      * value.
      */
-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_COUNTER);
-    if (p != NULL) {
-        if (!OSSL_PARAM_set_uint(p, tsan_load(&drbg->reseed_counter)))
+    if (p->reseed_cnt != NULL) {
+        if (!OSSL_PARAM_set_uint(p->reseed_cnt, tsan_load(&drbg->reseed_counter)))
             return 0;
         cnt++;
     }
@@ -963,19 +965,15 @@ int ossl_drbg_get_ctx_params_no_lock(PROV_DRBG *drbg, OSSL_PARAM params[],
     return 1;
 }

-int ossl_drbg_set_ctx_params(PROV_DRBG *drbg, const OSSL_PARAM params[])
+int ossl_drbg_set_ctx_params(PROV_DRBG *drbg,
+    const struct drbg_set_ctx_params_st *p)
 {
-    const OSSL_PARAM *p;
-
-    if (ossl_param_is_empty(params))
-        return 1;
-
-    p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_RESEED_REQUESTS);
-    if (p != NULL && !OSSL_PARAM_get_uint(p, &drbg->reseed_interval))
+    if (p->reseed_req != NULL
+        && !OSSL_PARAM_get_uint(p->reseed_req, &drbg->reseed_interval))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL);
-    if (p != NULL && !OSSL_PARAM_get_time_t(p, &drbg->reseed_time_interval))
+    if (p->reseed_time != NULL
+        && !OSSL_PARAM_get_time_t(p->reseed_time, &drbg->reseed_time_interval))
         return 0;

     return 1;
@@ -1012,7 +1010,7 @@ int ossl_drbg_verify_digest(PROV_DRBG *drbg, OSSL_LIB_CTX *libctx,
     if (!approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(drbg, OSSL_FIPS_IND_SETTABLE0,
                 libctx, "DRBG", "Digest",
-                ossl_fips_config_restricted_drbg_digests)) {
+                FIPS_CONFIG_DRBG_TRUNC_DIGEST)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED);
             return 0;
         }
diff --git a/deps/openssl/openssl/providers/implementations/rands/drbg_ctr.c b/deps/openssl/openssl/providers/implementations/rands/drbg_ctr.c
index 57da1cfdf33..77a0a6a8aa1 100644
--- a/deps/openssl/openssl/providers/implementations/rands/drbg_ctr.c
+++ b/deps/openssl/openssl/providers/implementations/rands/drbg_ctr.c
@@ -19,11 +19,17 @@
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
 #include "prov/provider_ctx.h"
-#include "drbg_local.h"
+#include "prov/drbg.h"
 #include "crypto/evp.h"
 #include "crypto/evp/evp_local.h"
 #include "internal/provider.h"
 #include "internal/common.h"
+#include "internal/fips.h"
+
+#define drbg_ctr_get_ctx_params_st drbg_get_ctx_params_st
+#define drbg_ctr_set_ctx_params_st drbg_set_ctx_params_st
+
+#include "providers/implementations/rands/drbg_ctr.inc"

 static OSSL_FUNC_rand_newctx_fn drbg_ctr_new_wrapper;
 static OSSL_FUNC_rand_freectx_fn drbg_ctr_free;
@@ -37,7 +43,8 @@ static OSSL_FUNC_rand_gettable_ctx_params_fn drbg_ctr_gettable_ctx_params;
 static OSSL_FUNC_rand_get_ctx_params_fn drbg_ctr_get_ctx_params;
 static OSSL_FUNC_rand_verify_zeroization_fn drbg_ctr_verify_zeroization;

-static int drbg_ctr_set_ctx_params_locked(void *vctx, const OSSL_PARAM params[]);
+static int drbg_ctr_set_ctx_params_locked(PROV_DRBG *drbg,
+    const struct drbg_set_ctx_params_st *p);

 /*
  * The state of a DRBG AES-CTR.
@@ -64,12 +71,12 @@ typedef struct rand_drbg_ctr_st {
 static void inc_128(PROV_DRBG_CTR *ctr)
 {
     unsigned char *p = &ctr->V[0];
-    u32 n = 16, c = 1;
+    uint32_t n = 16, c = 1;

     do {
         --n;
         c += p[n];
-        p[n] = (u8)c;
+        p[n] = (uint8_t)c;
         c >>= 8;
     } while (n);
 }
@@ -337,13 +344,17 @@ static int drbg_ctr_instantiate_wrapper(void *vdrbg, unsigned int strength,
     const OSSL_PARAM params[])
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
+    struct drbg_set_ctx_params_st p;
     int ret = 0;

+    if (drbg == NULL || !drbg_ctr_set_ctx_params_decoder(params, &p))
+        return 0;
+
     if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
         return 0;

     if (!ossl_prov_is_running()
-        || !drbg_ctr_set_ctx_params_locked(drbg, params))
+        || !drbg_ctr_set_ctx_params_locked(drbg, &p))
         goto err;
     ret = ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance,
         pstr, pstr_len);
@@ -380,12 +391,12 @@ static int drbg_ctr_reseed_wrapper(void *vdrbg, int prediction_resistance,

 static void ctr96_inc(unsigned char *counter)
 {
-    u32 n = 12, c = 1;
+    uint32_t n = 12, c = 1;

     do {
         --n;
         c += counter[n];
-        counter[n] = (u8)c;
+        counter[n] = (uint8_t)c;
         c >>= 8;
     } while (n);
 }
@@ -436,7 +447,7 @@ static int drbg_ctr_generate(PROV_DRBG *drbg,
          * requests in 2^30 byte chunks, which is the greatest multiple
          * of AES block size lower than or equal to 2^31-1.
          */
-        buflen = outlen > (1U << 30) ? (1U << 30) : outlen;
+        buflen = outlen > (1U << 30) ? (1 << 30) : (int)outlen;
         blocks = (buflen + 15) / 16;

         ctr32 = GETU32(ctr->V + 12) + blocks;
@@ -585,7 +596,7 @@ static int drbg_ctr_init(PROV_DRBG *drbg)
         goto err;
     }

-    drbg->strength = keylen * 8;
+    drbg->strength = (unsigned int)(keylen * 8);
     drbg->seedlen = keylen + 16;

 #ifdef FIPS_MODULE
@@ -648,6 +659,12 @@ static int drbg_ctr_new(PROV_DRBG *drbg)
 static void *drbg_ctr_new_wrapper(void *provctx, void *parent,
     const OSSL_DISPATCH *parent_dispatch)
 {
+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_DRBG_CTR))
+        return NULL;
+#endif
+
     return ossl_rand_drbg_new(provctx, parent, parent_dispatch,
         &drbg_ctr_new, &drbg_ctr_free,
         &drbg_ctr_instantiate, &drbg_ctr_uninstantiate,
@@ -674,32 +691,35 @@ static void drbg_ctr_free(void *vdrbg)
 static int drbg_ctr_get_ctx_params(void *vdrbg, OSSL_PARAM params[])
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
-    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
-    OSSL_PARAM *p;
+    PROV_DRBG_CTR *ctr;
+    struct drbg_ctr_get_ctx_params_st p;
     int ret = 0, complete = 0;

-    if (!ossl_drbg_get_ctx_params_no_lock(drbg, params, &complete))
+    if (drbg == NULL || !drbg_ctr_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (!ossl_drbg_get_ctx_params_no_lock(drbg, &p, params, &complete))
         return 0;

     if (complete)
         return 1;

+    ctr = (PROV_DRBG_CTR *)drbg->data;
+
     if (drbg->lock != NULL && !CRYPTO_THREAD_read_lock(drbg->lock))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_USE_DF);
-    if (p != NULL && !OSSL_PARAM_set_int(p, ctr->use_df))
+    if (p.df != NULL && !OSSL_PARAM_set_int(p.df, ctr->use_df))
         goto err;

-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_CIPHER);
-    if (p != NULL) {
+    if (p.cipher != NULL) {
         if (ctr->cipher_ctr == NULL
-            || !OSSL_PARAM_set_utf8_string(p,
+            || !OSSL_PARAM_set_utf8_string(p.cipher,
                 EVP_CIPHER_get0_name(ctr->cipher_ctr)))
             goto err;
     }

-    ret = ossl_drbg_get_ctx_params(drbg, params);
+    ret = ossl_drbg_get_ctx_params(drbg, &p);
 err:
     if (drbg->lock != NULL)
         CRYPTO_THREAD_unlock(drbg->lock);
@@ -710,64 +730,48 @@ err:
 static const OSSL_PARAM *drbg_ctr_gettable_ctx_params(ossl_unused void *vctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_CIPHER, NULL, 0),
-        OSSL_PARAM_int(OSSL_DRBG_PARAM_USE_DF, NULL),
-        OSSL_PARAM_DRBG_GETTABLE_CTX_COMMON,
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return drbg_ctr_get_ctx_params_list;
 }

-static int drbg_ctr_set_ctx_params_locked(void *vctx, const OSSL_PARAM params[])
+static int drbg_ctr_set_ctx_params_locked(PROV_DRBG *ctx,
+    const struct drbg_set_ctx_params_st *p)
 {
-    PROV_DRBG *ctx = (PROV_DRBG *)vctx;
     PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)ctx->data;
     OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
-    const OSSL_PARAM *p;
     char *ecb;
     const char *propquery = NULL;
     int i, cipher_init = 0;

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_USE_DF)) != NULL
-        && OSSL_PARAM_get_int(p, &i)) {
+    if (p->df != NULL && OSSL_PARAM_get_int(p->df, &i)) {
         /* FIPS errors out in the drbg_ctr_init() call later */
         ctr->use_df = i != 0;
         cipher_init = 1;
     }

-    if ((p = OSSL_PARAM_locate_const(params,
-             OSSL_DRBG_PARAM_PROPERTIES))
-        != NULL) {
-        if (p->data_type != OSSL_PARAM_UTF8_STRING)
-            return 0;
-    }
-
 #ifndef FIPS_MODULE
     propquery = "provider=default";
-    if (p != NULL
-        && p->data_type == OSSL_PARAM_UTF8_STRING)
-        propquery = (const char *)p->data;
+    if (p->propq != NULL
+        && p->propq->data_type == OSSL_PARAM_UTF8_STRING)
+        propquery = (const char *)p->propq->data;
 #endif

-    if ((p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_CIPHER)) != NULL) {
-        const char *base = (const char *)p->data;
+    if (p->cipher != NULL) {
+        const char *base = (const char *)p->cipher->data;
         size_t ctr_str_len = sizeof("CTR") - 1;
         size_t ecb_str_len = sizeof("ECB") - 1;

-        if (p->data_type != OSSL_PARAM_UTF8_STRING
-            || p->data_size < ctr_str_len) {
+        if (p->cipher->data_type != OSSL_PARAM_UTF8_STRING
+            || p->cipher->data_size < ctr_str_len) {
             return 0;
         }
-        if (OPENSSL_strcasecmp("CTR", base + p->data_size - ctr_str_len) != 0) {
+        if (OPENSSL_strcasecmp("CTR", base + p->cipher->data_size - ctr_str_len) != 0) {
             ERR_raise(ERR_LIB_PROV, PROV_R_REQUIRE_CTR_MODE_CIPHER);
             return 0;
         }
-        if ((ecb = OPENSSL_strndup(base, p->data_size)) == NULL) {
+        if ((ecb = OPENSSL_strndup(base, p->cipher->data_size)) == NULL) {
             return 0;
         }
-        strcpy(ecb + p->data_size - ecb_str_len, "ECB");
+        strcpy(ecb + p->cipher->data_size - ecb_str_len, "ECB");
         EVP_CIPHER_free(ctr->cipher_ecb);
         EVP_CIPHER_free(ctr->cipher_ctr);
         ctr->cipher_ctr = NULL;
@@ -789,18 +793,22 @@ static int drbg_ctr_set_ctx_params_locked(void *vctx, const OSSL_PARAM params[])
     if (cipher_init && !drbg_ctr_init(ctx))
         return 0;

-    return ossl_drbg_set_ctx_params(ctx, params);
+    return ossl_drbg_set_ctx_params(ctx, p);
 }

 static int drbg_ctr_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vctx;
+    struct drbg_set_ctx_params_st p;
     int ret;

+    if (drbg == NULL || !drbg_ctr_set_ctx_params_decoder(params, &p))
+        return 0;
+
     if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
         return 0;

-    ret = drbg_ctr_set_ctx_params_locked(vctx, params);
+    ret = drbg_ctr_set_ctx_params_locked(drbg, &p);

     if (drbg->lock != NULL)
         CRYPTO_THREAD_unlock(drbg->lock);
@@ -811,14 +819,7 @@ static int drbg_ctr_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *drbg_ctr_settable_ctx_params(ossl_unused void *vctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_CIPHER, NULL, 0),
-        OSSL_PARAM_int(OSSL_DRBG_PARAM_USE_DF, NULL),
-        OSSL_PARAM_DRBG_SETTABLE_CTX_COMMON,
-        OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return drbg_ctr_set_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_drbg_ctr_functions[] = {
diff --git a/deps/openssl/openssl/providers/implementations/rands/drbg_ctr.inc.in b/deps/openssl/openssl/providers/implementations/rands/drbg_ctr.inc.in
new file mode 100644
index 00000000000..b3191fa1d78
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/rands/drbg_ctr.inc.in
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('drbg_ctr_get_ctx_params',
+                         (['OSSL_DRBG_PARAM_CIPHER',                 'cipher',      'utf8_string'],
+                          ['OSSL_DRBG_PARAM_USE_DF',                 'df',          'int'],
+                          ['OSSL_RAND_PARAM_STATE',                  'state',       'int'],
+                          ['OSSL_RAND_PARAM_STRENGTH',               'str',         'uint'],
+                          ['OSSL_RAND_PARAM_MAX_REQUEST',            'maxreq',      'size_t'],
+                          ['OSSL_DRBG_PARAM_MIN_ENTROPYLEN',         'minentlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MAX_ENTROPYLEN',         'maxentlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MIN_NONCELEN',           'minnonlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MAX_NONCELEN',           'maxnonlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MAX_PERSLEN',            'maxperlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MAX_ADINLEN',            'maxadlen',    'size_t'],
+                          ['OSSL_DRBG_PARAM_RESEED_COUNTER',         'reseed_cnt',  'uint'],
+                          ['OSSL_DRBG_PARAM_RESEED_TIME',            'reseed_time', 'time_t'],
+                          ['OSSL_DRBG_PARAM_RESEED_REQUESTS',        'reseed_req',  'uint'],
+                          ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL',   'reseed_int',  'uint64'],
+                          ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind',         'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('drbg_ctr_set_ctx_params',
+                         (['OSSL_DRBG_PARAM_PROPERTIES',           'propq',       'utf8_string'],
+                          ['OSSL_DRBG_PARAM_CIPHER',               'cipher',      'utf8_string'],
+                          ['OSSL_DRBG_PARAM_USE_DF',               'df',          'int', '!fips'],
+                          ['OSSL_PROV_PARAM_CORE_PROV_NAME',       'prov',        'utf8_string'],
+                          ['OSSL_DRBG_PARAM_RESEED_REQUESTS',      'reseed_req',  'uint'],
+                          ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_time', 'uint64'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/rands/drbg_hash.c b/deps/openssl/openssl/providers/implementations/rands/drbg_hash.c
index 504af87d5e1..4188c293819 100644
--- a/deps/openssl/openssl/providers/implementations/rands/drbg_hash.c
+++ b/deps/openssl/openssl/providers/implementations/rands/drbg_hash.c
@@ -16,16 +16,23 @@
 #include <openssl/rand.h>
 #include <openssl/core_dispatch.h>
 #include <openssl/proverr.h>
+#include "internal/cryptlib.h"
 #include "internal/thread_once.h"
 #include "prov/providercommon.h"
 #include "prov/provider_ctx.h"
 #include "prov/provider_util.h"
 #include "prov/implementations.h"
-#include "drbg_local.h"
+#include "prov/drbg.h"
 #include "crypto/evp.h"
 #include "crypto/evp/evp_local.h"
+#include "internal/fips.h"
 #include "internal/provider.h"

+#define drbg_hash_get_ctx_params_st drbg_get_ctx_params_st
+#define drbg_hash_set_ctx_params_st drbg_set_ctx_params_st
+
+#include "providers/implementations/rands/drbg_hash.inc"
+
 static OSSL_FUNC_rand_newctx_fn drbg_hash_new_wrapper;
 static OSSL_FUNC_rand_freectx_fn drbg_hash_free;
 static OSSL_FUNC_rand_instantiate_fn drbg_hash_instantiate_wrapper;
@@ -38,7 +45,8 @@ static OSSL_FUNC_rand_gettable_ctx_params_fn drbg_hash_gettable_ctx_params;
 static OSSL_FUNC_rand_get_ctx_params_fn drbg_hash_get_ctx_params;
 static OSSL_FUNC_rand_verify_zeroization_fn drbg_hash_verify_zeroization;

-static int drbg_hash_set_ctx_params_locked(void *vctx, const OSSL_PARAM params[]);
+static int drbg_hash_set_ctx_params_locked(PROV_DRBG *drbg,
+    const struct drbg_set_ctx_params_st *p);

 /* 888 bits from SP800-90Ar1 10.1 table 2 */
 #define HASH_PRNG_MAX_SEEDLEN (888 / 8)
@@ -275,13 +283,17 @@ static int drbg_hash_instantiate_wrapper(void *vdrbg, unsigned int strength,
     const OSSL_PARAM params[])
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
+    struct drbg_set_ctx_params_st p;
     int ret = 0;

+    if (drbg == NULL || !drbg_hash_set_ctx_params_decoder(params, &p))
+        return 0;
+
     if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
         return 0;

     if (!ossl_prov_is_running()
-        || !drbg_hash_set_ctx_params_locked(drbg, params))
+        || !drbg_hash_set_ctx_params_locked(drbg, &p))
         goto err;
     ret = ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance,
         pstr, pstr_len);
@@ -443,6 +455,12 @@ static int drbg_hash_new(PROV_DRBG *ctx)
 static void *drbg_hash_new_wrapper(void *provctx, void *parent,
     const OSSL_DISPATCH *parent_dispatch)
 {
+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_DRBG_HASH))
+        return NULL;
+#endif
+
     return ossl_rand_drbg_new(provctx, parent, parent_dispatch,
         &drbg_hash_new, &drbg_hash_free,
         &drbg_hash_instantiate, &drbg_hash_uninstantiate,
@@ -465,28 +483,33 @@ static void drbg_hash_free(void *vdrbg)
 static int drbg_hash_get_ctx_params(void *vdrbg, OSSL_PARAM params[])
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
-    PROV_DRBG_HASH *hash = (PROV_DRBG_HASH *)drbg->data;
+    PROV_DRBG_HASH *hash;
     const EVP_MD *md;
-    OSSL_PARAM *p;
+    struct drbg_get_ctx_params_st p;
     int ret = 0, complete = 0;

-    if (!ossl_drbg_get_ctx_params_no_lock(drbg, params, &complete))
+    if (drbg == NULL || !drbg_hash_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (!ossl_drbg_get_ctx_params_no_lock(drbg, &p, params, &complete))
         return 0;

     if (complete)
         return 1;

+    hash = (PROV_DRBG_HASH *)drbg->data;
+
     if (drbg->lock != NULL && !CRYPTO_THREAD_read_lock(drbg->lock))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_DIGEST);
-    if (p != NULL) {
+    if (p.digest != NULL) {
         md = ossl_prov_digest_md(&hash->digest);
-        if (md == NULL || !OSSL_PARAM_set_utf8_string(p, EVP_MD_get0_name(md)))
+        if (md == NULL
+            || !OSSL_PARAM_set_utf8_string(p.digest, EVP_MD_get0_name(md)))
             goto err;
     }

-    ret = ossl_drbg_get_ctx_params(drbg, params);
+    ret = ossl_drbg_get_ctx_params(drbg, &p);
 err:
     if (drbg->lock != NULL)
         CRYPTO_THREAD_unlock(drbg->lock);
@@ -497,21 +520,14 @@ err:
 static const OSSL_PARAM *drbg_hash_gettable_ctx_params(ossl_unused void *vctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_DIGEST, NULL, 0),
-        OSSL_PARAM_DRBG_GETTABLE_CTX_COMMON,
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return drbg_hash_get_ctx_params_list;
 }

-static int drbg_fetch_digest_from_prov(const OSSL_PARAM params[],
+static int drbg_fetch_digest_from_prov(const struct drbg_set_ctx_params_st *p,
     OSSL_LIB_CTX *libctx,
     EVP_MD **digest,
     const char *propq)
 {
-    const OSSL_PARAM *p;
     EVP_MD *md = NULL;
     int ret = 0;
     const char *propquery = NULL;
@@ -526,16 +542,15 @@ static int drbg_fetch_digest_from_prov(const OSSL_PARAM params[],
     if (digest == NULL)
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST);
-    if (p == NULL) {
+    if (p->digest == NULL) {
         ret = 1;
         goto done;
     }

-    if (p->data_type != OSSL_PARAM_UTF8_STRING)
+    if (p->digest->data_type != OSSL_PARAM_UTF8_STRING)
         goto done;

-    md = EVP_MD_fetch(libctx, p->data, propquery);
+    md = EVP_MD_fetch(libctx, p->digest->data, propquery);
     if (md) {
         EVP_MD_free(*digest);
         *digest = md;
@@ -545,34 +560,24 @@ done:
     return ret;
 }

-static int drbg_hash_set_ctx_params_locked(void *vctx, const OSSL_PARAM params[])
+static int drbg_hash_set_ctx_params_locked(PROV_DRBG *ctx, const struct drbg_set_ctx_params_st *p)
 {
-    PROV_DRBG *ctx = (PROV_DRBG *)vctx;
     PROV_DRBG_HASH *hash = (PROV_DRBG_HASH *)ctx->data;
     OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
     EVP_MD *prov_md = NULL;
     const EVP_MD *md;
     int md_size;
-    const OSSL_PARAM *p;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_DRBG_PARAM_FIPS_DIGEST_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, p->ind_d))
         return 0;

     /* try to fetch digest from provider */
-    p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_PROPERTIES);
     (void)ERR_set_mark();
-    if (!drbg_fetch_digest_from_prov(params, libctx, &prov_md,
-            (p != NULL && p->data_type == OSSL_PARAM_UTF8_STRING) ? p->data : NULL)) {
+    if (!drbg_fetch_digest_from_prov(p, libctx, &prov_md,
+            (p->propq != NULL && p->propq->data_type == OSSL_PARAM_UTF8_STRING) ? p->propq->data : NULL)) {
         (void)ERR_pop_to_mark();
-        /*
-         * Its possible for drbg_fetch_digest_from_prov to return 0 after having set prov_md
-         * so we need to ensure we free it here
-         */
-        EVP_MD_free(prov_md);
-
         /* fall back to full implementation search */
-        if (!ossl_prov_digest_load_from_params(&hash->digest, params, libctx))
+        if (!ossl_prov_digest_load(&hash->digest, p->digest, p->propq, libctx))
             return 0;
     } else {
         (void)ERR_clear_last_mark();
@@ -591,7 +596,7 @@ static int drbg_hash_set_ctx_params_locked(void *vctx, const OSSL_PARAM params[]
             return 0;
         hash->blocklen = md_size;
         /* See SP800-57 Part1 Rev4 5.6.1 Table 3 */
-        ctx->strength = 64 * (hash->blocklen >> 3);
+        ctx->strength = (unsigned int)(64 * (hash->blocklen >> 3));
         if (ctx->strength > 256)
             ctx->strength = 256;
         if (hash->blocklen > MAX_BLOCKLEN_USING_SMALL_SEEDLEN)
@@ -603,18 +608,22 @@ static int drbg_hash_set_ctx_params_locked(void *vctx, const OSSL_PARAM params[]
         ctx->min_noncelen = ctx->min_entropylen / 2;
     }

-    return ossl_drbg_set_ctx_params(ctx, params);
+    return ossl_drbg_set_ctx_params(ctx, p);
 }

 static int drbg_hash_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vctx;
+    struct drbg_set_ctx_params_st p;
     int ret;

+    if (drbg == NULL || !drbg_hash_set_ctx_params_decoder(params, &p))
+        return 0;
+
     if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
         return 0;

-    ret = drbg_hash_set_ctx_params_locked(vctx, params);
+    ret = drbg_hash_set_ctx_params_locked(drbg, &p);

     if (drbg->lock != NULL)
         CRYPTO_THREAD_unlock(drbg->lock);
@@ -625,14 +634,7 @@ static int drbg_hash_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *drbg_hash_settable_ctx_params(ossl_unused void *vctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_DIGEST, NULL, 0),
-        OSSL_PARAM_DRBG_SETTABLE_CTX_COMMON,
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_DRBG_PARAM_FIPS_DIGEST_CHECK)
-            OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return drbg_hash_set_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_drbg_hash_functions[] = {
diff --git a/deps/openssl/openssl/providers/implementations/rands/drbg_hash.inc.in b/deps/openssl/openssl/providers/implementations/rands/drbg_hash.inc.in
new file mode 100644
index 00000000000..695071a152c
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/rands/drbg_hash.inc.in
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('drbg_hash_get_ctx_params',
+                         (['OSSL_DRBG_PARAM_DIGEST',                 'digest',      'utf8_string'],
+                          ['OSSL_RAND_PARAM_STATE',                  'state',       'int'],
+                          ['OSSL_RAND_PARAM_STRENGTH',               'str',         'uint'],
+                          ['OSSL_RAND_PARAM_MAX_REQUEST',            'maxreq',      'size_t'],
+                          ['OSSL_DRBG_PARAM_MIN_ENTROPYLEN',         'minentlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MAX_ENTROPYLEN',         'maxentlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MIN_NONCELEN',           'minnonlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MAX_NONCELEN',           'maxnonlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MAX_PERSLEN',            'maxperlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MAX_ADINLEN',            'maxadlen',    'size_t'],
+                          ['OSSL_DRBG_PARAM_RESEED_COUNTER',         'reseed_cnt',  'uint'],
+                          ['OSSL_DRBG_PARAM_RESEED_TIME',            'reseed_time', 'time_t'],
+                          ['OSSL_DRBG_PARAM_RESEED_REQUESTS',        'reseed_req',  'uint'],
+                          ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL',   'reseed_int',  'uint64'],
+                          ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind',         'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('drbg_hash_set_ctx_params',
+                         (['OSSL_DRBG_PARAM_PROPERTIES',           'propq',       'utf8_string'],
+                          ['OSSL_DRBG_PARAM_DIGEST',               'digest',      'utf8_string'],
+                          ['OSSL_PROV_PARAM_CORE_PROV_NAME',       'prov',        'utf8_string'],
+                          ['OSSL_DRBG_PARAM_RESEED_REQUESTS',      'reseed_req',  'uint'],
+                          ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_time', 'uint64'],
+                          ['OSSL_KDF_PARAM_FIPS_DIGEST_CHECK',     'ind_d',       'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/rands/drbg_hmac.c b/deps/openssl/openssl/providers/implementations/rands/drbg_hmac.c
index 87050764fe4..c576eecdef4 100644
--- a/deps/openssl/openssl/providers/implementations/rands/drbg_hmac.c
+++ b/deps/openssl/openssl/providers/implementations/rands/drbg_hmac.c
@@ -13,16 +13,23 @@
 #include <openssl/err.h>
 #include <openssl/rand.h>
 #include <openssl/proverr.h>
+#include "internal/cryptlib.h"
 #include "internal/thread_once.h"
 #include "prov/providercommon.h"
 #include "prov/implementations.h"
 #include "prov/provider_ctx.h"
 #include "prov/hmac_drbg.h"
-#include "drbg_local.h"
+#include "prov/drbg.h"
 #include "crypto/evp.h"
 #include "crypto/evp/evp_local.h"
+#include "internal/fips.h"
 #include "internal/provider.h"

+#define drbg_hmac_get_ctx_params_st drbg_get_ctx_params_st
+#define drbg_hmac_set_ctx_params_st drbg_set_ctx_params_st
+
+#include "providers/implementations/rands/drbg_hmac.inc"
+
 static OSSL_FUNC_rand_newctx_fn drbg_hmac_new_wrapper;
 static OSSL_FUNC_rand_freectx_fn drbg_hmac_free;
 static OSSL_FUNC_rand_instantiate_fn drbg_hmac_instantiate_wrapper;
@@ -35,7 +42,8 @@ static OSSL_FUNC_rand_gettable_ctx_params_fn drbg_hmac_gettable_ctx_params;
 static OSSL_FUNC_rand_get_ctx_params_fn drbg_hmac_get_ctx_params;
 static OSSL_FUNC_rand_verify_zeroization_fn drbg_hmac_verify_zeroization;

-static int drbg_hmac_set_ctx_params_locked(void *vctx, const OSSL_PARAM params[]);
+static int drbg_hmac_set_ctx_params_locked(PROV_DRBG *drbg,
+    const struct drbg_set_ctx_params_st *p);

 /*
  * Called twice by SP800-90Ar1 10.1.2.2 HMAC_DRBG_Update_Process.
@@ -148,13 +156,17 @@ static int drbg_hmac_instantiate_wrapper(void *vdrbg, unsigned int strength,
     const OSSL_PARAM params[])
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
+    struct drbg_set_ctx_params_st p;
     int ret = 0;

+    if (drbg == NULL || !drbg_hmac_set_ctx_params_decoder(params, &p))
+        return 0;
+
     if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
         return 0;

     if (!ossl_prov_is_running()
-        || !drbg_hmac_set_ctx_params_locked(drbg, params))
+        || !drbg_hmac_set_ctx_params_locked(drbg, &p))
         goto err;
     ret = ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance,
         pstr, pstr_len);
@@ -335,6 +347,12 @@ static int drbg_hmac_new(PROV_DRBG *drbg)
 static void *drbg_hmac_new_wrapper(void *provctx, void *parent,
     const OSSL_DISPATCH *parent_dispatch)
 {
+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_DRBG_HMAC))
+        return NULL;
+#endif
+
     return ossl_rand_drbg_new(provctx, parent, parent_dispatch,
         &drbg_hmac_new, &drbg_hmac_free,
         &drbg_hmac_instantiate, &drbg_hmac_uninstantiate,
@@ -357,38 +375,33 @@ static void drbg_hmac_free(void *vdrbg)
 static int drbg_hmac_get_ctx_params(void *vdrbg, OSSL_PARAM params[])
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
-    PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)drbg->data;
-    const char *name;
+    PROV_DRBG_HMAC *hmac;
     const EVP_MD *md;
-    OSSL_PARAM *p;
+    struct drbg_get_ctx_params_st p;
     int ret = 0, complete = 0;

-    if (!ossl_drbg_get_ctx_params_no_lock(drbg, params, &complete))
+    if (drbg == NULL || !drbg_hmac_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (!ossl_drbg_get_ctx_params_no_lock(drbg, &p, params, &complete))
         return 0;

     if (complete)
         return 1;

+    hmac = (PROV_DRBG_HMAC *)drbg->data;
+
     if (drbg->lock != NULL && !CRYPTO_THREAD_read_lock(drbg->lock))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAC);
-    if (p != NULL) {
-        if (hmac->ctx == NULL)
-            goto err;
-        name = EVP_MAC_get0_name(EVP_MAC_CTX_get0_mac(hmac->ctx));
-        if (!OSSL_PARAM_set_utf8_string(p, name))
-            goto err;
-    }
-
-    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_DIGEST);
-    if (p != NULL) {
+    if (p.digest != NULL) {
         md = ossl_prov_digest_md(&hmac->digest);
-        if (md == NULL || !OSSL_PARAM_set_utf8_string(p, EVP_MD_get0_name(md)))
+        if (md == NULL
+            || !OSSL_PARAM_set_utf8_string(p.digest, EVP_MD_get0_name(md)))
             goto err;
     }

-    ret = ossl_drbg_get_ctx_params(drbg, params);
+    ret = ossl_drbg_get_ctx_params(drbg, &p);
 err:
     if (drbg->lock != NULL)
         CRYPTO_THREAD_unlock(drbg->lock);
@@ -399,27 +412,15 @@ err:
 static const OSSL_PARAM *drbg_hmac_gettable_ctx_params(ossl_unused void *vctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_MAC, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_DIGEST, NULL, 0),
-        OSSL_PARAM_DRBG_GETTABLE_CTX_COMMON,
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return drbg_hmac_get_ctx_params_list;
 }

-static int drbg_fetch_algs_from_prov(const OSSL_PARAM params[],
+static int drbg_fetch_algs_from_prov(const struct drbg_set_ctx_params_st *p,
     OSSL_LIB_CTX *libctx,
     EVP_MAC_CTX **macctx,
     EVP_MD **digest, const char *propq)
 {
-    const OSSL_PARAM *p;
-    const char *digest_name = NULL;
-    const char *hmac_name = NULL;
     EVP_MD *md = NULL;
-    EVP_MAC *mac = NULL;
-    OSSL_PARAM mac_params[3], *mp = mac_params;
     int ret = 0;
     const char *propquery = NULL;

@@ -433,92 +434,53 @@ static int drbg_fetch_algs_from_prov(const OSSL_PARAM params[],
     if (macctx == NULL || digest == NULL)
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST);
-    if (p) {
-        if (!OSSL_PARAM_get_utf8_string_ptr(p, &digest_name)) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_VALUE_ERROR);
+    if (p->digest != NULL) {
+        if (p->digest->data_type != OSSL_PARAM_UTF8_STRING)
             goto done;
-        }
-        md = EVP_MD_fetch(libctx, p->data, propquery);
+        md = EVP_MD_fetch(libctx, p->digest->data, propquery);
         if (md) {
             EVP_MD_free(*digest);
             *digest = md;
         } else {
-            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DIGEST);
             goto done;
         }
-    } else {
-        /* we need a digest */
-        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DIGEST);
-        goto done;
-    }
-    p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_MAC);
-    if (p == NULL) {
-        hmac_name = "HMAC";
-    } else {
-        if (!OSSL_PARAM_get_utf8_string_ptr(p, &hmac_name)) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_VALUE_ERROR);
+        if (!ossl_prov_macctx_load(macctx, NULL, NULL, p->digest,
+                p->propq, "HMAC", NULL, NULL, libctx))
             goto done;
-        }
     }

-    EVP_MAC_CTX_free(*macctx);
-    *macctx = NULL;
-
-    mac = EVP_MAC_fetch(libctx, hmac_name, propquery);
-    if (mac) {
-        *macctx = EVP_MAC_CTX_new(mac);
-        /* The context holds on to the MAC */
-        EVP_MAC_free(mac);
-        *mp++ = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST, (char *)digest_name, 0);
-        if (propquery)
-            *mp++ = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_PROPERTIES, (char *)propquery, 0);
-        *mp = OSSL_PARAM_construct_end();
-        if (!EVP_MAC_CTX_set_params(*macctx, mac_params)) {
-            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_MAC);
-            EVP_MAC_CTX_free(*macctx);
-            *macctx = NULL;
-            goto done;
-        }
-        ret = 1;
-    }
+    ret = 1;

 done:
     return ret;
 }

-static int drbg_hmac_set_ctx_params_locked(void *vctx, const OSSL_PARAM params[])
+static int drbg_hmac_set_ctx_params_locked(PROV_DRBG *ctx, const struct drbg_set_ctx_params_st *p)
 {
-    PROV_DRBG *ctx = (PROV_DRBG *)vctx;
     PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)ctx->data;
     OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
     EVP_MD *prov_md = NULL;
     const EVP_MD *md;
     int md_size;
-    const OSSL_PARAM *p;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_DRBG_PARAM_FIPS_DIGEST_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, p->ind_d))
         return 0;

     /* try to fetch mac and digest from provider */
-    p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_PROPERTIES);
     (void)ERR_set_mark();
-    if (!drbg_fetch_algs_from_prov(params, libctx, &hmac->ctx, &prov_md,
-            (p != NULL && p->data_type == OSSL_PARAM_UTF8_STRING) ? p->data : NULL)) {
+    if (!drbg_fetch_algs_from_prov(p, libctx, &hmac->ctx, &prov_md,
+            (p->propq != NULL && p->propq->data_type == OSSL_PARAM_UTF8_STRING) ? p->propq->data : NULL)) {
         (void)ERR_pop_to_mark();
-        /*
-         * Its possible for drbg_fetch_algs_from_prov to return 0 and set prov_md here
-         * so we need to free prov_md to be leak free
-         */
-        EVP_MD_free(prov_md);
-        /* fall back to full implementation search */
-        if (!ossl_prov_digest_load_from_params(&hmac->digest, params, libctx))
-            return 0;
+        if (p->digest != NULL) {
+            /* fall back to full implementation search */
+            if (!ossl_prov_digest_load(&hmac->digest, p->digest, p->propq,
+                    libctx))
+                return 0;

-        if (!ossl_prov_macctx_load_from_params(&hmac->ctx, params,
-                NULL, NULL, NULL, libctx))
-            return 0;
+            if (!ossl_prov_macctx_load(&hmac->ctx, NULL, NULL, p->digest,
+                    p->propq, "HMAC", NULL, NULL, libctx))
+                return 0;
+        }
     } else {
         (void)ERR_clear_last_mark();
         if (prov_md)
@@ -544,18 +506,22 @@ static int drbg_hmac_set_ctx_params_locked(void *vctx, const OSSL_PARAM params[]
         ctx->min_noncelen = ctx->min_entropylen / 2;
     }

-    return ossl_drbg_set_ctx_params(ctx, params);
+    return ossl_drbg_set_ctx_params(ctx, p);
 }

 static int drbg_hmac_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vctx;
+    struct drbg_set_ctx_params_st p;
     int ret;

+    if (drbg == NULL || !drbg_hmac_set_ctx_params_decoder(params, &p))
+        return 0;
+
     if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
         return 0;

-    ret = drbg_hmac_set_ctx_params_locked(vctx, params);
+    ret = drbg_hmac_set_ctx_params_locked(drbg, &p);

     if (drbg->lock != NULL)
         CRYPTO_THREAD_unlock(drbg->lock);
@@ -566,15 +532,7 @@ static int drbg_hmac_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *drbg_hmac_settable_ctx_params(ossl_unused void *vctx,
     ossl_unused void *p_ctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_DIGEST, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_MAC, NULL, 0),
-        OSSL_PARAM_DRBG_SETTABLE_CTX_COMMON,
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_DRBG_PARAM_FIPS_DIGEST_CHECK)
-            OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return drbg_hmac_set_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_drbg_ossl_hmac_functions[] = {
diff --git a/deps/openssl/openssl/providers/implementations/rands/drbg_hmac.inc.in b/deps/openssl/openssl/providers/implementations/rands/drbg_hmac.inc.in
new file mode 100644
index 00000000000..360fb6808ad
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/rands/drbg_hmac.inc.in
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('drbg_hmac_get_ctx_params',
+                         (['OSSL_DRBG_PARAM_DIGEST',                 'digest',      'utf8_string'],
+                          ['OSSL_RAND_PARAM_STATE',                  'state',       'int'],
+                          ['OSSL_RAND_PARAM_STRENGTH',               'str',         'uint'],
+                          ['OSSL_RAND_PARAM_MAX_REQUEST',            'maxreq',      'size_t'],
+                          ['OSSL_DRBG_PARAM_MIN_ENTROPYLEN',         'minentlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MAX_ENTROPYLEN',         'maxentlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MIN_NONCELEN',           'minnonlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MAX_NONCELEN',           'maxnonlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MAX_PERSLEN',            'maxperlen',   'size_t'],
+                          ['OSSL_DRBG_PARAM_MAX_ADINLEN',            'maxadlen',    'size_t'],
+                          ['OSSL_DRBG_PARAM_RESEED_COUNTER',         'reseed_cnt',  'uint'],
+                          ['OSSL_DRBG_PARAM_RESEED_TIME',            'reseed_time', 'time_t'],
+                          ['OSSL_DRBG_PARAM_RESEED_REQUESTS',        'reseed_req',  'uint'],
+                          ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL',   'reseed_int',  'uint64'],
+                          ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind',         'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('drbg_hmac_set_ctx_params',
+                         (['OSSL_DRBG_PARAM_PROPERTIES',           'propq',       'utf8_string'],
+                          ['OSSL_DRBG_PARAM_DIGEST',               'digest',      'utf8_string'],
+                          ['OSSL_PROV_PARAM_CORE_PROV_NAME',       'prov',        'utf8_string'],
+                          ['OSSL_DRBG_PARAM_RESEED_REQUESTS',      'reseed_req',  'uint'],
+                          ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_time', 'uint64'],
+                          ['OSSL_KDF_PARAM_FIPS_DIGEST_CHECK',     'ind_d',       'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/rands/fips_crng_test.c b/deps/openssl/openssl/providers/implementations/rands/fips_crng_test.c
index f61a93a14b1..4b45d0828f1 100644
--- a/deps/openssl/openssl/providers/implementations/rands/fips_crng_test.c
+++ b/deps/openssl/openssl/providers/implementations/rands/fips_crng_test.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,11 +20,13 @@
 #include "prov/providercommon.h"
 #include "prov/provider_ctx.h"
 #include "prov/implementations.h"
+#include "internal/common.h"
 #include "internal/cryptlib.h"
 #include "crypto/rand_pool.h"
-#include "drbg_local.h"
+#include "prov/drbg.h"
 #include "prov/seeding.h"
 #include "crypto/context.h"
+#include "providers/implementations/rands/fips_crng_test.inc"

 static OSSL_FUNC_rand_newctx_fn crng_test_new;
 static OSSL_FUNC_rand_freectx_fn crng_test_free;
@@ -109,7 +111,7 @@ static int RCT_test(CRNG_TEST *crngt, uint8_t next)
     /*
      * Critical values for this test are computed using:
      *
-     *      C = 1 + \left\lceil\frac{-log_2 \alpha}H\right\rceil
+     *      C = 1 + \left\lceil\frac{ -log_2 \alpha}H\right\rceil
      *
      * where alpha = 2^-20 and H is the expected entropy per sample.
      */
@@ -119,8 +121,14 @@ static int RCT_test(CRNG_TEST *crngt, uint8_t next)
     };

     if (ossl_likely(crngt->rct.b != 0)
-        && ossl_unlikely(next == crngt->rct.a))
-        return ossl_likely(++crngt->rct.b < rct_c[ENTROPY_H]);
+        && ossl_unlikely(next == crngt->rct.a)) {
+        if (ossl_likely(++crngt->rct.b < rct_c[ENTROPY_H]))
+            return 1;
+        ERR_raise_data(ERR_LIB_PROV,
+            PROV_R_ENTROPY_SOURCE_FAILED_RCT_CONTINUOUS_TEST,
+            "byte repeats %u times", crngt->rct.b);
+        return 0;
+    }
     crngt->rct.a = next;
     crngt->rct.b = 1;
     return 1;
@@ -145,6 +153,10 @@ static int APT_test(CRNG_TEST *crngt, uint8_t next)
     if (ossl_likely(crngt->apt.b != 0)) {
         if (ossl_unlikely(crngt->apt.a == next)
             && ossl_unlikely(++crngt->apt.b >= apt_c[ENTROPY_H])) {
+            ERR_raise_data(ERR_LIB_PROV,
+                PROV_R_ENTROPY_SOURCE_FAILED_APT_CONTINUOUS_TEST,
+                "byte appears %u times by position %u",
+                crngt->apt.b, crngt->apt.i);
             crngt->apt.b = 0;
             return 0;
         }
@@ -165,8 +177,6 @@ static int crng_test(CRNG_TEST *crngt, const unsigned char *buf, size_t n)
     for (i = 0; i < n; i++)
         if (!RCT_test(crngt, buf[i]) || !APT_test(crngt, buf[i])) {
             crngt->state = EVP_RAND_STATE_ERROR;
-            ERR_raise(ERR_LIB_PROV,
-                PROV_R_ENTROPY_SOURCE_FAILED_CONTINUOUS_TESTS);
             return 0;
         }
     return 1;
@@ -288,7 +298,7 @@ static size_t crng_test_get_seed(void *vcrngt, unsigned char **pout,
 {
     CRNG_TEST *crngt = (CRNG_TEST *)vcrngt;
     size_t n;
-    int r = 0;
+    size_t r = 0;

     /* Without a parent, we rely on the up calls */
     if (crngt->parent == NULL
@@ -364,26 +374,28 @@ static void crng_test_unlock(ossl_unused void *vcrngt)
 static int crng_test_get_ctx_params(void *vcrngt, OSSL_PARAM params[])
 {
     CRNG_TEST *crngt = (CRNG_TEST *)vcrngt;
-    OSSL_PARAM *p;
+    struct crng_test_get_ctx_params_st p;
+
+    if (crngt == NULL)
+        return 0;

     if (crngt->parent != NULL && crngt->parent_get_ctx_params != NULL)
         return crngt->parent_get_ctx_params(crngt->parent, params);

     /* No parent means we are using call backs for entropy */
-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
-    if (p != NULL && !OSSL_PARAM_set_int(p, crngt->state))
+    if (!crng_test_get_ctx_params_decoder(params, &p))
+        return 0;
+
+    if (p.state != NULL && !OSSL_PARAM_set_int(p.state, crngt->state))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
-    if (p != NULL && !OSSL_PARAM_set_int(p, 1024))
+    if (p.str != NULL && !OSSL_PARAM_set_uint(p.str, 1024))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, 128))
+    if (p.maxreq != NULL && !OSSL_PARAM_set_size_t(p.maxreq, 128))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR);
-    if (p != NULL && !OSSL_PARAM_set_int(p, 0))
+    if (p.ind != NULL && !OSSL_PARAM_set_int(p.ind, 0))
         return 0;
     return 1;
 }
@@ -392,17 +404,10 @@ static const OSSL_PARAM *crng_test_gettable_ctx_params(void *vcrngt,
     void *provctx)
 {
     CRNG_TEST *crngt = (CRNG_TEST *)vcrngt;
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_int(OSSL_RAND_PARAM_STATE, NULL),
-        OSSL_PARAM_uint(OSSL_RAND_PARAM_STRENGTH, NULL),
-        OSSL_PARAM_size_t(OSSL_RAND_PARAM_MAX_REQUEST, NULL),
-        OSSL_PARAM_int(OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR, NULL),
-        OSSL_PARAM_END
-    };

     if (crngt->parent != NULL && crngt->parent_gettable_ctx_params != NULL)
         return crngt->parent_gettable_ctx_params(crngt->parent, provctx);
-    return known_gettable_ctx_params;
+    return crng_test_get_ctx_params_list;
 }

 const OSSL_DISPATCH ossl_crng_test_functions[] = {
diff --git a/deps/openssl/openssl/providers/implementations/rands/fips_crng_test.inc.in b/deps/openssl/openssl/providers/implementations/rands/fips_crng_test.inc.in
new file mode 100644
index 00000000000..4a6ec557199
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/rands/fips_crng_test.inc.in
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('crng_test_get_ctx_params',
+                         (['OSSL_RAND_PARAM_STATE',                   'state',  'int'],
+                          ['OSSL_RAND_PARAM_STRENGTH',                'str',    'uint'],
+                          ['OSSL_RAND_PARAM_MAX_REQUEST',             'maxreq', 'size_t'],
+                          ['OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR', 'ind',    'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/rands/seed_src.c b/deps/openssl/openssl/providers/implementations/rands/seed_src.c
index cf903960e15..9c7f76af866 100644
--- a/deps/openssl/openssl/providers/implementations/rands/seed_src.c
+++ b/deps/openssl/openssl/providers/implementations/rands/seed_src.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -17,10 +17,12 @@
 #include <openssl/err.h>
 #include <openssl/randerr.h>
 #include <openssl/proverr.h>
+#include "internal/common.h"
 #include "prov/implementations.h"
 #include "prov/provider_ctx.h"
 #include "crypto/rand.h"
 #include "crypto/rand_pool.h"
+#include "providers/implementations/rands/seed_src.inc"

 static OSSL_FUNC_rand_newctx_fn seed_src_new;
 static OSSL_FUNC_rand_freectx_fn seed_src_free;
@@ -144,18 +146,18 @@ static int seed_src_reseed(void *vseed,
 static int seed_src_get_ctx_params(void *vseed, OSSL_PARAM params[])
 {
     PROV_SEED_SRC *s = (PROV_SEED_SRC *)vseed;
-    OSSL_PARAM *p;
+    struct seed_src_get_ctx_params_st p;

-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
-    if (p != NULL && !OSSL_PARAM_set_int(p, s->state))
+    if (s == NULL || !seed_src_get_ctx_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
-    if (p != NULL && !OSSL_PARAM_set_int(p, 1024))
+    if (p.state != NULL && !OSSL_PARAM_set_int(p.state, s->state))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, 128))
+    if (p.str != NULL && !OSSL_PARAM_set_uint(p.str, 1024))
+        return 0;
+
+    if (p.maxreq != NULL && !OSSL_PARAM_set_size_t(p.maxreq, 128))
         return 0;
     return 1;
 }
@@ -163,13 +165,7 @@ static int seed_src_get_ctx_params(void *vseed, OSSL_PARAM params[])
 static const OSSL_PARAM *seed_src_gettable_ctx_params(ossl_unused void *vseed,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_int(OSSL_RAND_PARAM_STATE, NULL),
-        OSSL_PARAM_uint(OSSL_RAND_PARAM_STRENGTH, NULL),
-        OSSL_PARAM_size_t(OSSL_RAND_PARAM_MAX_REQUEST, NULL),
-        OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return seed_src_get_ctx_params_list;
 }

 static int seed_src_verify_zeroization(ossl_unused void *vseed)
diff --git a/deps/openssl/openssl/providers/implementations/rands/seed_src.inc.in b/deps/openssl/openssl/providers/implementations/rands/seed_src.inc.in
new file mode 100644
index 00000000000..7eb708b1e2a
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/rands/seed_src.inc.in
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('seed_src_get_ctx_params',
+                         (['OSSL_RAND_PARAM_STATE',                   'state',  'int'],
+                          ['OSSL_RAND_PARAM_STRENGTH',                'str',    'uint'],
+                          ['OSSL_RAND_PARAM_MAX_REQUEST',             'maxreq', 'size_t'],
+                        )); -}
diff --git a/deps/openssl/openssl/providers/implementations/rands/seed_src_jitter.c b/deps/openssl/openssl/providers/implementations/rands/seed_src_jitter.c
index 8df7fb5423f..e73b1990a6f 100644
--- a/deps/openssl/openssl/providers/implementations/rands/seed_src_jitter.c
+++ b/deps/openssl/openssl/providers/implementations/rands/seed_src_jitter.c
@@ -18,15 +18,16 @@
 #include <openssl/randerr.h>
 #include <openssl/proverr.h>
 #include <openssl/self_test.h>
+#include "internal/common.h"
 #include "prov/implementations.h"
 #include "prov/provider_ctx.h"
 #include "prov/providercommon.h"
-#include "fips/fipsindicator.h"
 #include "crypto/rand.h"
 #include "crypto/rand_pool.h"

 #ifndef OPENSSL_NO_JITTER
 #include <jitterentropy.h>
+#include "providers/implementations/rands/seed_src_jitter.inc"

 #define JITTER_MAX_NUM_TRIES 3

@@ -231,33 +232,26 @@ static int jitter_reseed(void *vseed,
 static int jitter_get_ctx_params(void *vseed, OSSL_PARAM params[])
 {
     PROV_JITTER *s = (PROV_JITTER *)vseed;
-    OSSL_PARAM *p;
+    struct jitter_get_ctx_params_st p;

-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
-    if (p != NULL && !OSSL_PARAM_set_int(p, s->state))
+    if (s == NULL || !jitter_get_ctx_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
-    if (p != NULL && !OSSL_PARAM_set_int(p, 1024))
+    if (p.state != NULL && !OSSL_PARAM_set_int(p.state, s->state))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, 128))
+    if (p.str != NULL && !OSSL_PARAM_set_uint(p.str, 1024))
         return 0;
-    return OSSL_FIPS_IND_GET_CTX_PARAM_APPROVED(s, params);
+
+    if (p.maxreq != NULL && !OSSL_PARAM_set_size_t(p.maxreq, 128))
+        return 0;
+    return 1;
 }

 static const OSSL_PARAM *jitter_gettable_ctx_params(ossl_unused void *vseed,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_int(OSSL_RAND_PARAM_STATE, NULL),
-        OSSL_PARAM_uint(OSSL_RAND_PARAM_STRENGTH, NULL),
-        OSSL_PARAM_size_t(OSSL_RAND_PARAM_MAX_REQUEST, NULL),
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return jitter_get_ctx_params_list;
 }

 static int jitter_verify_zeroization(ossl_unused void *vseed)
@@ -297,24 +291,6 @@ static size_t jitter_get_seed(void *vseed, unsigned char **pout,
     return ret;
 }

-#ifndef OPENSSL_NO_FIPS_JITTER
-size_t ossl_rand_jitter_get_seed(unsigned char **pout, int entropy, size_t min_len, size_t max_len)
-{
-    size_t ret = 0;
-    OSSL_PARAM params[1] = { OSSL_PARAM_END };
-    PROV_JITTER *s = jitter_new(NULL, NULL, NULL);
-
-    if (s == NULL)
-        return ret;
-    if (!jitter_instantiate(s, 0, 0, NULL, 0, params))
-        goto end;
-    ret = jitter_get_seed(s, pout, entropy, min_len, max_len, 0, NULL, 0);
-end:
-    jitter_free(s);
-    return ret;
-}
-#endif
-
 static void jitter_clear_seed(ossl_unused void *vdrbg,
     unsigned char *out, size_t outlen)
 {
diff --git a/deps/openssl/openssl/providers/implementations/rands/seed_src_jitter.inc.in b/deps/openssl/openssl/providers/implementations/rands/seed_src_jitter.inc.in
new file mode 100644
index 00000000000..66396a05e38
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/rands/seed_src_jitter.inc.in
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('jitter_get_ctx_params',
+                         (['OSSL_RAND_PARAM_STATE',                   'state',  'int'],
+                          ['OSSL_RAND_PARAM_STRENGTH',                'str',    'uint'],
+                          ['OSSL_RAND_PARAM_MAX_REQUEST',             'maxreq', 'size_t'],
+                          ['OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR',
+                           'fips indicator', 'int'],
+                        )); -}
diff --git a/deps/openssl/openssl/providers/implementations/rands/seeding/rand_cpu_arm64.c b/deps/openssl/openssl/providers/implementations/rands/seeding/rand_cpu_arm64.c
index 76bbedf1190..a3c2bf8ffa9 100644
--- a/deps/openssl/openssl/providers/implementations/rands/seeding/rand_cpu_arm64.c
+++ b/deps/openssl/openssl/providers/implementations/rands/seeding/rand_cpu_arm64.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,7 +13,7 @@
 #include "prov/seeding.h"

 #ifdef OPENSSL_RAND_SEED_RDCPU
-#include "crypto/arm_arch.h"
+#include "arch/arm_arch.h"

 size_t OPENSSL_rndrrs_bytes(unsigned char *buf, size_t len);

diff --git a/deps/openssl/openssl/providers/implementations/rands/seeding/rand_unix.c b/deps/openssl/openssl/providers/implementations/rands/seeding/rand_unix.c
index 0b8a9ec341d..95c4ff8a93f 100644
--- a/deps/openssl/openssl/providers/implementations/rands/seeding/rand_unix.c
+++ b/deps/openssl/openssl/providers/implementations/rands/seeding/rand_unix.c
@@ -210,7 +210,9 @@ void ossl_rand_pool_keep_random_devices_open(int keep)
 #define OPENSSL_RAND_SEED_DEVRANDOM
 #endif

-#if (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(KERN_ARND)
+#if ((defined(__FreeBSD__) && __FreeBSD_version < 1200061)     \
+    || (defined(__NetBSD__) && __NetBSD_Version < 1000000000)) \
+    && defined(KERN_ARND)
 /*
  * sysctl_random(): Use sysctl() to read a random number from the kernel
  * Returns the number of bytes returned in buf on success, -1 on failure.
@@ -352,7 +354,7 @@ static ssize_t syscall_random(void *buf, size_t buflen)
      * internally. So we need to check errno for ENOSYS
      */
 #if !defined(__DragonFly__) && !defined(__NetBSD__) && !defined(__FreeBSD__)
-#if defined(__GNUC__) && __GNUC__ >= 2 && defined(__ELF__) && !defined(__hpux)
+#if defined(__GNUC__) && defined(__ELF__) && !defined(__hpux)
     extern int getentropy(void *buffer, size_t length) __attribute__((weak));

     if (getentropy != NULL) {
@@ -420,11 +422,6 @@ static int keep_random_devices_open = 1;
     && defined(OPENSSL_RAND_SEED_GETRANDOM)
 static void *shm_addr;

-static void cleanup_shm(void)
-{
-    shmdt(shm_addr);
-}
-
 /*
  * Ensure that the system randomness source has been adequately seeded.
  * This is done by having the first start of libcrypto, wait until the device
@@ -454,9 +451,19 @@ static int wait_random_seeded(void)
              * this alternative but essentially identical source moot.
              */
             if (uname(&un) == 0) {
-                kernel[0] = atoi(un.release);
+                int val;
+                char *end;
+
+                kernel[0] = (ossl_strtoint(un.release, &end, 10, &val)
+                                && (*end == '.' || *end == '\0'))
+                    ? val
+                    : 0;
                 p = strchr(un.release, '.');
-                kernel[1] = p == NULL ? 0 : atoi(p + 1);
+                kernel[1] = (p != NULL
+                                && ossl_strtoint(p + 1, &end, 10, &val)
+                                && (*end == '.' || *end == '\0'))
+                    ? val
+                    : 0;
                 if (kernel[0] > kernel_version[0]
                     || (kernel[0] == kernel_version[0]
                         && kernel[1] >= kernel_version[1])) {
@@ -491,8 +498,8 @@ static int wait_random_seeded(void)
              * If this call fails, it isn't a big problem.
              */
             shm_addr = shmat(shm_id, NULL, SHM_RDONLY);
-            if (shm_addr != (void *)-1)
-                OPENSSL_atexit(&cleanup_shm);
+            if (shm_addr == (void *)-1)
+                shm_addr = NULL;
         }
     }
     return seeded;
@@ -581,6 +588,14 @@ void ossl_rand_pool_cleanup(void)

     for (i = 0; i < OSSL_NELEM(random_devices); i++)
         close_random_device(i);
+
+#if defined(__linux) && defined(DEVRANDOM_WAIT) \
+    && defined(OPENSSL_RAND_SEED_GETRANDOM)
+    if (shm_addr != NULL) {
+        shmdt(shm_addr);
+        shm_addr = NULL;
+    }
+#endif
 }

 void ossl_rand_pool_keep_random_devices_open(int keep)
diff --git a/deps/openssl/openssl/providers/implementations/rands/seeding/rand_win.c b/deps/openssl/openssl/providers/implementations/rands/seeding/rand_win.c
index 323a579ac45..663246c56c9 100644
--- a/deps/openssl/openssl/providers/implementations/rands/seeding/rand_win.c
+++ b/deps/openssl/openssl/providers/implementations/rands/seeding/rand_win.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,7 @@
  * https://www.openssl.org/source/license.html
  */

+#include "internal/e_os.h" /* For windows.h */
 #include "internal/cryptlib.h"
 #include <openssl/rand.h>
 #include "crypto/rand_pool.h"
@@ -19,10 +20,10 @@
 #error "Unsupported seeding method configured; must be os"
 #endif

-#include <windows.h>
 /* On Windows Vista or higher use BCrypt instead of the legacy CryptoAPI */
-#if defined(_MSC_VER) && _MSC_VER > 1500 /* 1500 = Visual Studio 2008 */ \
-    && defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0600
+#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0600 \
+    && ((defined(_MSC_VER) && _MSC_VER > 1500)      \
+        || (defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR >= 2))
 #define USE_BCRYPTGENRANDOM
 #endif

@@ -70,7 +71,7 @@ size_t ossl_pool_acquire_entropy(RAND_POOL *pool)
     buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
     if (buffer != NULL) {
         size_t bytes = 0;
-        if (BCryptGenRandom(NULL, buffer, bytes_needed,
+        if (BCryptGenRandom(NULL, buffer, (ULONG)bytes_needed,
                 BCRYPT_USE_SYSTEM_PREFERRED_RNG)
             == STATUS_SUCCESS)
             bytes = bytes_needed;
@@ -89,8 +90,8 @@ size_t ossl_pool_acquire_entropy(RAND_POOL *pool)
         if (CryptAcquireContextW(&hProvider, NULL, NULL, PROV_RSA_FULL,
                 CRYPT_VERIFYCONTEXT | CRYPT_SILENT)
             != 0) {
-            if (CryptGenRandom(hProvider, bytes_needed, buffer) != 0)
-                bytes = bytes_needed;
+            if (CryptGenRandom(hProvider, (DWORD)bytes_needed, buffer) != 0)
+                bytes = (DWORD)bytes_needed;

             CryptReleaseContext(hProvider, 0);
         }
@@ -110,8 +111,8 @@ size_t ossl_pool_acquire_entropy(RAND_POOL *pool)
                 INTEL_DEF_PROV, PROV_INTEL_SEC,
                 CRYPT_VERIFYCONTEXT | CRYPT_SILENT)
             != 0) {
-            if (CryptGenRandom(hProvider, bytes_needed, buffer) != 0)
-                bytes = bytes_needed;
+            if (CryptGenRandom(hProvider, (DWORD)bytes_needed, buffer) != 0)
+                bytes = (DWORD)bytes_needed;

             CryptReleaseContext(hProvider, 0);
         }
diff --git a/deps/openssl/openssl/providers/implementations/rands/test_rng.c b/deps/openssl/openssl/providers/implementations/rands/test_rng.c
index 88e5fb982ae..7c03238b67d 100644
--- a/deps/openssl/openssl/providers/implementations/rands/test_rng.c
+++ b/deps/openssl/openssl/providers/implementations/rands/test_rng.c
@@ -16,11 +16,14 @@
 #include <openssl/evp.h>
 #include <openssl/err.h>
 #include <openssl/proverr.h>
+#include <openssl/randerr.h>
+#include "internal/common.h"
 #include "prov/securitycheck.h"
 #include "prov/providercommon.h"
 #include "prov/provider_ctx.h"
 #include "prov/provider_util.h"
 #include "prov/implementations.h"
+#include "providers/implementations/rands/test_rng.inc"

 static OSSL_FUNC_rand_newctx_fn test_rng_new;
 static OSSL_FUNC_rand_freectx_fn test_rng_free;
@@ -167,8 +170,9 @@ static size_t test_rng_nonce(void *vtest, unsigned char *out,
         return 0;

     if (t->generate) {
-        for (i = 0; i < min_noncelen; i++)
-            out[i] = gen_byte(t);
+        if (out != NULL)
+            for (i = 0; i < min_noncelen; i++)
+                out[i] = gen_byte(t);
         return min_noncelen;
     }

@@ -183,63 +187,52 @@ static size_t test_rng_nonce(void *vtest, unsigned char *out,
 static int test_rng_get_ctx_params(void *vtest, OSSL_PARAM params[])
 {
     PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
-    OSSL_PARAM *p;
+    struct test_rng_get_ctx_params_st p;
+
+    if (t == NULL || !test_rng_get_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
-    if (p != NULL && !OSSL_PARAM_set_int(p, t->state))
+    if (p.state != NULL && !OSSL_PARAM_set_int(p.state, t->state))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
-    if (p != NULL && !OSSL_PARAM_set_int(p, t->strength))
+    if (p.str != NULL && !OSSL_PARAM_set_uint(p.str, t->strength))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, t->max_request))
+    if (p.maxreq != NULL && !OSSL_PARAM_set_size_t(p.maxreq, t->max_request))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_GENERATE);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, t->generate))
+    if (p.gen != NULL && !OSSL_PARAM_set_uint(p.gen, t->generate))
         return 0;

 #ifdef FIPS_MODULE
-    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR);
-    if (p != NULL && !OSSL_PARAM_set_int(p, 0))
+    if (p.ind != NULL && !OSSL_PARAM_set_int(p.ind, 0))
         return 0;
 #endif /* FIPS_MODULE */
+
     return 1;
 }

 static const OSSL_PARAM *test_rng_gettable_ctx_params(ossl_unused void *vtest,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_gettable_ctx_params[] = {
-        OSSL_PARAM_int(OSSL_RAND_PARAM_STATE, NULL),
-        OSSL_PARAM_uint(OSSL_RAND_PARAM_STRENGTH, NULL),
-        OSSL_PARAM_size_t(OSSL_RAND_PARAM_MAX_REQUEST, NULL),
-        OSSL_PARAM_uint(OSSL_RAND_PARAM_GENERATE, NULL),
-        OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-            OSSL_PARAM_END
-    };
-    return known_gettable_ctx_params;
+    return test_rng_get_ctx_params_list;
 }

 static int test_rng_set_ctx_params(void *vtest, const OSSL_PARAM params[])
 {
     PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
-    const OSSL_PARAM *p;
+    struct test_rng_set_ctx_params_st p;
     void *ptr = NULL;
     size_t size = 0;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (t == NULL || !test_rng_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_RAND_PARAM_STRENGTH);
-    if (p != NULL && !OSSL_PARAM_get_uint(p, &t->strength))
+    if (p.str != NULL && !OSSL_PARAM_get_uint(p.str, &t->strength))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_RAND_PARAM_TEST_ENTROPY);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_octet_string(p, &ptr, 0, &size))
+    if (p.ent != NULL) {
+        if (!OSSL_PARAM_get_octet_string(p.ent, &ptr, 0, &size))
             return 0;
         OPENSSL_free(t->entropy);
         t->entropy = ptr;
@@ -248,21 +241,18 @@ static int test_rng_set_ctx_params(void *vtest, const OSSL_PARAM params[])
         ptr = NULL;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_RAND_PARAM_TEST_NONCE);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_octet_string(p, &ptr, 0, &size))
+    if (p.nonce != NULL) {
+        if (!OSSL_PARAM_get_octet_string(p.nonce, &ptr, 0, &size))
             return 0;
         OPENSSL_free(t->nonce);
         t->nonce = ptr;
         t->nonce_len = size;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_RAND_PARAM_MAX_REQUEST);
-    if (p != NULL && !OSSL_PARAM_get_size_t(p, &t->max_request))
+    if (p.maxreq != NULL && !OSSL_PARAM_get_size_t(p.maxreq, &t->max_request))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_RAND_PARAM_GENERATE);
-    if (p != NULL && !OSSL_PARAM_get_uint(p, &t->generate))
+    if (p.gen != NULL && !OSSL_PARAM_get_uint(p.gen, &t->generate))
         return 0;
     return 1;
 }
@@ -270,15 +260,7 @@ static int test_rng_set_ctx_params(void *vtest, const OSSL_PARAM params[])
 static const OSSL_PARAM *test_rng_settable_ctx_params(ossl_unused void *vtest,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_octet_string(OSSL_RAND_PARAM_TEST_ENTROPY, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_RAND_PARAM_TEST_NONCE, NULL, 0),
-        OSSL_PARAM_uint(OSSL_RAND_PARAM_STRENGTH, NULL),
-        OSSL_PARAM_size_t(OSSL_RAND_PARAM_MAX_REQUEST, NULL),
-        OSSL_PARAM_uint(OSSL_RAND_PARAM_GENERATE, NULL),
-        OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return test_rng_set_ctx_params_list;
 }

 static int test_rng_verify_zeroization(ossl_unused void *vtest)
diff --git a/deps/openssl/openssl/providers/implementations/rands/test_rng.inc.in b/deps/openssl/openssl/providers/implementations/rands/test_rng.inc.in
new file mode 100644
index 00000000000..180a323db87
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/rands/test_rng.inc.in
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('test_rng_get_ctx_params',
+                         (['OSSL_RAND_PARAM_STATE',                   'state',  'int'],
+                          ['OSSL_RAND_PARAM_STRENGTH',                'str',    'uint'],
+                          ['OSSL_RAND_PARAM_MAX_REQUEST',             'maxreq', 'size_t'],
+                          ['OSSL_RAND_PARAM_GENERATE',                'gen',    'uint'],
+                          ['OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR', 'ind',    'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('test_rng_set_ctx_params',
+                         (['OSSL_RAND_PARAM_TEST_ENTROPY',   'ent',    'octet_string'],
+                          ['OSSL_RAND_PARAM_TEST_NONCE',     'nonce',  'octet_string'],
+                          ['OSSL_RAND_PARAM_STRENGTH',       'str',    'uint'],
+                          ['OSSL_RAND_PARAM_MAX_REQUEST',    'maxreq', 'size_t'],
+                          ['OSSL_RAND_PARAM_GENERATE',       'gen',    'uint'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/signature/build.info b/deps/openssl/openssl/providers/implementations/signature/build.info
index 0fd39841f34..579045f2c58 100644
--- a/deps/openssl/openssl/providers/implementations/signature/build.info
+++ b/deps/openssl/openssl/providers/implementations/signature/build.info
@@ -6,6 +6,7 @@ $EC_GOAL=../../libdefault.a ../../libfips.a
 $MAC_GOAL=../../libdefault.a ../../libfips.a
 $RSA_GOAL=../../libdefault.a ../../libfips.a
 $SM2_GOAL=../../libdefault.a
+$LMS_GOAL=../../libdefault.a ../../libfips.a
 $ML_DSA_GOAL=../../libdefault.a ../../libfips.a
 $SLH_DSA_GOAL=../../libdefault.a ../../libfips.a

@@ -36,6 +37,10 @@ DEPEND[sm2_sig.o]=../../common/include/prov/der_sm2.h

 SOURCE[$MAC_GOAL]=mac_legacy_sig.c

+IF[{- !$disabled{lms} -}]
+  SOURCE[$LMS_GOAL]=lms_signature.c
+ENDIF
+
 IF[{- !$disabled{'ml-dsa'} -}]
   SOURCE[$ML_DSA_GOAL]=ml_dsa_sig.c
 ENDIF
diff --git a/deps/openssl/openssl/providers/implementations/signature/dsa_sig.c b/deps/openssl/openssl/providers/implementations/signature/dsa_sig.c
index 48237d7eb9e..c68980af763 100644
--- a/deps/openssl/openssl/providers/implementations/signature/dsa_sig.c
+++ b/deps/openssl/openssl/providers/implementations/signature/dsa_sig.c
@@ -23,6 +23,7 @@
 #include <openssl/params.h>
 #include <openssl/evp.h>
 #include <openssl/proverr.h>
+#include "internal/fips.h"
 #include "internal/nelem.h"
 #include "internal/sizes.h"
 #include "internal/cryptlib.h"
@@ -132,6 +133,12 @@ static void *dsa_newctx(void *provctx, const char *propq)
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_SIG_DSA_SHA256))
+        return NULL;
+#endif
+
     pdsactx = OPENSSL_zalloc(sizeof(PROV_DSA_CTX));
     if (pdsactx == NULL)
         return NULL;
@@ -195,7 +202,7 @@ static int dsa_setup_md(PROV_DSA_CTX *ctx,
                     OSSL_FIPS_IND_SETTABLE1,
                     ctx->libctx,
                     md_nid, sha1_allowed, 0, desc,
-                    ossl_fips_config_signature_digest_check))
+                    FIPS_CONFIG_SIGNATURE_DIGEST_CHECK))
                 goto err;
         }
 #endif
@@ -253,7 +260,7 @@ static int dsa_sign_check_approved(PROV_DSA_CTX *ctx, int signing,
     if (signing
         && !OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE2,
             ctx->libctx, desc, "DSA",
-            ossl_fips_config_dsa_sign_disallowed))
+            FIPS_CONFIG_DSA_SIGN_DISABLED))
         return 0;
     return 1;
 }
@@ -265,7 +272,7 @@ static int dsa_check_key(PROV_DSA_CTX *ctx, int sign, const char *desc)
     if (!approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE0,
                 ctx->libctx, desc, "DSA Key",
-                ossl_fips_config_signature_digest_check)) {
+                FIPS_CONFIG_SIGNATURE_DIGEST_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
             return 0;
         }
@@ -357,7 +364,7 @@ static int dsa_sign_directly(void *vpdsactx,
     if (mdsize != 0 && tbslen != mdsize)
         return 0;

-    ret = ossl_dsa_sign_int(0, tbs, tbslen, sig, &sltmp, pdsactx->dsa,
+    ret = ossl_dsa_sign_int(0, tbs, (int)tbslen, sig, &sltmp, pdsactx->dsa,
         pdsactx->nonce_type, pdsactx->mdname,
         pdsactx->libctx, pdsactx->propq);
     if (ret <= 0)
@@ -447,7 +454,7 @@ static int dsa_verify_directly(void *vpdsactx,
     if (!ossl_prov_is_running() || (mdsize != 0 && tbslen != mdsize))
         return 0;

-    return DSA_verify(0, tbs, tbslen, sig, siglen, pdsactx->dsa);
+    return DSA_verify(0, tbs, (int)tbslen, sig, (int)siglen, pdsactx->dsa);
 }

 static int dsa_verify_set_sig(void *vpdsactx,
@@ -667,46 +674,53 @@ err:
     return NULL;
 }

+struct dsa_all_set_ctx_params_st {
+    OSSL_PARAM *digest; /* dsa_set_ctx_params */
+    OSSL_PARAM *propq; /* dsa_set_ctx_params */
+#ifdef FIPS_MODULE
+    OSSL_PARAM *ind_d;
+    OSSL_PARAM *ind_k;
+    OSSL_PARAM *ind_sign;
+#endif
+    OSSL_PARAM *nonce;
+    OSSL_PARAM *sig; /* dsa_sigalg_set_ctx_params */
+};
+
+#define dsa_set_ctx_params_st dsa_all_set_ctx_params_st
+#define dsa_sigalg_set_ctx_params_st dsa_all_set_ctx_params_st
+
+#include "providers/implementations/signature/dsa_sig.inc"
+
 static int dsa_get_ctx_params(void *vpdsactx, OSSL_PARAM *params)
 {
     PROV_DSA_CTX *pdsactx = (PROV_DSA_CTX *)vpdsactx;
-    OSSL_PARAM *p;
+    struct dsa_get_ctx_params_st p;

-    if (pdsactx == NULL)
+    if (pdsactx == NULL || !dsa_get_ctx_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_ALGORITHM_ID);
-    if (p != NULL
-        && !OSSL_PARAM_set_octet_string(p,
+    if (p.algid != NULL
+        && !OSSL_PARAM_set_octet_string(p.algid,
             pdsactx->aid_len == 0 ? NULL : pdsactx->aid_buf,
             pdsactx->aid_len))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_DIGEST);
-    if (p != NULL && !OSSL_PARAM_set_utf8_string(p, pdsactx->mdname))
+    if (p.digest != NULL && !OSSL_PARAM_set_utf8_string(p.digest, pdsactx->mdname))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_NONCE_TYPE);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, pdsactx->nonce_type))
+    if (p.nonce != NULL && !OSSL_PARAM_set_uint(p.nonce, pdsactx->nonce_type))
         return 0;
-    if (!OSSL_FIPS_IND_GET_CTX_PARAM(pdsactx, params))
+
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(pdsactx, p.ind))
         return 0;

     return 1;
 }

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0),
-    OSSL_PARAM_uint(OSSL_SIGNATURE_PARAM_NONCE_TYPE, NULL),
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *dsa_gettable_ctx_params(ossl_unused void *ctx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return dsa_get_ctx_params_list;
 }

 /**
@@ -714,60 +728,45 @@ static const OSSL_PARAM *dsa_gettable_ctx_params(ossl_unused void *ctx,
  * The caller is responsible for checking |vpdsactx| is not NULL and |params|
  * is not empty.
  */
-static int dsa_common_set_ctx_params(void *vpdsactx, const OSSL_PARAM params[])
+static int dsa_common_set_ctx_params(PROV_DSA_CTX *pdsactx,
+    const struct dsa_all_set_ctx_params_st *p)
 {
-    PROV_DSA_CTX *pdsactx = (PROV_DSA_CTX *)vpdsactx;
-    const OSSL_PARAM *p;
-
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(pdsactx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(pdsactx, OSSL_FIPS_IND_SETTABLE0,
+            p->ind_k))
         return 0;
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(pdsactx, OSSL_FIPS_IND_SETTABLE1, params,
-            OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(pdsactx, OSSL_FIPS_IND_SETTABLE1,
+            p->ind_d))
         return 0;
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(pdsactx, OSSL_FIPS_IND_SETTABLE2, params,
-            OSSL_SIGNATURE_PARAM_FIPS_SIGN_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(pdsactx, OSSL_FIPS_IND_SETTABLE2,
+            p->ind_sign))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_NONCE_TYPE);
-    if (p != NULL
-        && !OSSL_PARAM_get_uint(p, &pdsactx->nonce_type))
+    if (p->nonce != NULL
+        && !OSSL_PARAM_get_uint(p->nonce, &pdsactx->nonce_type))
         return 0;
     return 1;
 }

-#define DSA_COMMON_SETTABLE_CTX_PARAMS                                                 \
-    OSSL_PARAM_uint(OSSL_SIGNATURE_PARAM_NONCE_TYPE, NULL),                            \
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK)          \
-            OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK)   \
-                OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_SIGNATURE_PARAM_FIPS_SIGN_CHECK) \
-                    OSSL_PARAM_END
-
 static int dsa_set_ctx_params(void *vpdsactx, const OSSL_PARAM params[])
 {
     PROV_DSA_CTX *pdsactx = (PROV_DSA_CTX *)vpdsactx;
-    const OSSL_PARAM *p;
+    struct dsa_all_set_ctx_params_st p;
     int ret;

-    if (pdsactx == NULL)
+    if (pdsactx == NULL || !dsa_set_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    if ((ret = dsa_common_set_ctx_params(pdsactx, params)) <= 0)
+    if ((ret = dsa_common_set_ctx_params(pdsactx, &p)) <= 0)
         return ret;

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DIGEST);
-    if (p != NULL) {
+    if (p.digest != NULL) {
         char mdname[OSSL_MAX_NAME_SIZE] = "", *pmdname = mdname;
         char mdprops[OSSL_MAX_PROPQUERY_SIZE] = "", *pmdprops = mdprops;
-        const OSSL_PARAM *propsp = OSSL_PARAM_locate_const(params,
-            OSSL_SIGNATURE_PARAM_PROPERTIES);

-        if (!OSSL_PARAM_get_utf8_string(p, &pmdname, sizeof(mdname)))
+        if (!OSSL_PARAM_get_utf8_string(p.digest, &pmdname, sizeof(mdname)))
             return 0;
-        if (propsp != NULL
-            && !OSSL_PARAM_get_utf8_string(propsp, &pmdprops, sizeof(mdprops)))
+        if (p.propq != NULL
+            && !OSSL_PARAM_get_utf8_string(p.propq, &pmdprops, sizeof(mdprops)))
             return 0;
         if (!dsa_setup_md(pdsactx, mdname, mdprops, "DSA Set Ctx"))
             return 0;
@@ -775,12 +774,6 @@ static int dsa_set_ctx_params(void *vpdsactx, const OSSL_PARAM params[])
     return 1;
 }

-static const OSSL_PARAM settable_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_PROPERTIES, NULL, 0),
-    DSA_COMMON_SETTABLE_CTX_PARAMS
-};
-
 static const OSSL_PARAM settable_ctx_params_no_digest[] = {
     OSSL_PARAM_END
 };
@@ -792,7 +785,7 @@ static const OSSL_PARAM *dsa_settable_ctx_params(void *vpdsactx,

     if (pdsactx != NULL && !pdsactx->flag_allow_md)
         return settable_ctx_params_no_digest;
-    return settable_ctx_params;
+    return dsa_set_ctx_params_list;
 }

 static int dsa_get_ctx_md_params(void *vpdsactx, OSSL_PARAM *params)
@@ -932,42 +925,34 @@ static const char **dsa_sigalg_query_key_types(void)
     return keytypes;
 }

-static const OSSL_PARAM settable_sigalg_ctx_params[] = {
-    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_SIGNATURE, NULL, 0),
-    DSA_COMMON_SETTABLE_CTX_PARAMS
-};
-
 static const OSSL_PARAM *dsa_sigalg_settable_ctx_params(void *vpdsactx,
     ossl_unused void *provctx)
 {
     PROV_DSA_CTX *pdsactx = (PROV_DSA_CTX *)vpdsactx;

     if (pdsactx != NULL && pdsactx->operation == EVP_PKEY_OP_VERIFYMSG)
-        return settable_sigalg_ctx_params;
+        return dsa_sigalg_set_ctx_params_list;
     return NULL;
 }

 static int dsa_sigalg_set_ctx_params(void *vpdsactx, const OSSL_PARAM params[])
 {
     PROV_DSA_CTX *pdsactx = (PROV_DSA_CTX *)vpdsactx;
-    const OSSL_PARAM *p;
+    struct dsa_all_set_ctx_params_st p;
     int ret;

-    if (pdsactx == NULL)
+    if (pdsactx == NULL || !dsa_sigalg_set_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    if ((ret = dsa_common_set_ctx_params(pdsactx, params)) <= 0)
+    if ((ret = dsa_common_set_ctx_params(pdsactx, &p)) <= 0)
         return ret;

     if (pdsactx->operation == EVP_PKEY_OP_VERIFYMSG) {
-        p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_SIGNATURE);
-        if (p != NULL) {
+        if (p.sig != NULL) {
             OPENSSL_free(pdsactx->sig);
             pdsactx->sig = NULL;
             pdsactx->siglen = 0;
-            if (!OSSL_PARAM_get_octet_string(p, (void **)&pdsactx->sig,
+            if (!OSSL_PARAM_get_octet_string(p.sig, (void **)&pdsactx->sig,
                     0, &pdsactx->siglen))
                 return 0;
             /* The signature must not be empty */
@@ -993,11 +978,11 @@ static int dsa_sigalg_set_ctx_params(void *vpdsactx, const OSSL_PARAM params[])
     dsa_##md##_sign_init(void *vpdsactx, void *vdsa,                  \
         const OSSL_PARAM params[])                                    \
     {                                                                 \
-        static const char desc[] = "DSA-" #MD " Sign Init";           \
+        static const char desc[] = "DSA-" MD " Sign Init";            \
                                                                       \
         return dsa_sigalg_signverify_init(vpdsactx, vdsa,             \
             dsa_sigalg_set_ctx_params,                                \
-            params, #MD,                                              \
+            params, MD,                                               \
             EVP_PKEY_OP_SIGN,                                         \
             desc);                                                    \
     }                                                                 \
@@ -1006,11 +991,11 @@ static int dsa_sigalg_set_ctx_params(void *vpdsactx, const OSSL_PARAM params[])
     dsa_##md##_sign_message_init(void *vpdsactx, void *vdsa,          \
         const OSSL_PARAM params[])                                    \
     {                                                                 \
-        static const char desc[] = "DSA-" #MD " Sign Message Init";   \
+        static const char desc[] = "DSA-" MD " Sign Message Init";    \
                                                                       \
         return dsa_sigalg_signverify_init(vpdsactx, vdsa,             \
             dsa_sigalg_set_ctx_params,                                \
-            params, #MD,                                              \
+            params, MD,                                               \
             EVP_PKEY_OP_SIGNMSG,                                      \
             desc);                                                    \
     }                                                                 \
@@ -1019,11 +1004,11 @@ static int dsa_sigalg_set_ctx_params(void *vpdsactx, const OSSL_PARAM params[])
     dsa_##md##_verify_init(void *vpdsactx, void *vdsa,                \
         const OSSL_PARAM params[])                                    \
     {                                                                 \
-        static const char desc[] = "DSA-" #MD " Verify Init";         \
+        static const char desc[] = "DSA-" MD " Verify Init";          \
                                                                       \
         return dsa_sigalg_signverify_init(vpdsactx, vdsa,             \
             dsa_sigalg_set_ctx_params,                                \
-            params, #MD,                                              \
+            params, MD,                                               \
             EVP_PKEY_OP_VERIFY,                                       \
             desc);                                                    \
     }                                                                 \
@@ -1032,11 +1017,11 @@ static int dsa_sigalg_set_ctx_params(void *vpdsactx, const OSSL_PARAM params[])
     dsa_##md##_verify_message_init(void *vpdsactx, void *vdsa,        \
         const OSSL_PARAM params[])                                    \
     {                                                                 \
-        static const char desc[] = "DSA-" #MD " Verify Message Init"; \
+        static const char desc[] = "DSA-" MD " Verify Message Init";  \
                                                                       \
         return dsa_sigalg_signverify_init(vpdsactx, vdsa,             \
             dsa_sigalg_set_ctx_params,                                \
-            params, #MD,                                              \
+            params, MD,                                               \
             EVP_PKEY_OP_VERIFYMSG,                                    \
             desc);                                                    \
     }                                                                 \
@@ -1077,14 +1062,12 @@ static int dsa_sigalg_set_ctx_params(void *vpdsactx, const OSSL_PARAM params[])
         OSSL_DISPATCH_END                                             \
     }

-/* clang-format off */
-IMPL_DSA_SIGALG(sha1, SHA1);
-IMPL_DSA_SIGALG(sha224, SHA2-224);
-IMPL_DSA_SIGALG(sha256, SHA2-256);
-IMPL_DSA_SIGALG(sha384, SHA2-384);
-IMPL_DSA_SIGALG(sha512, SHA2-512);
-IMPL_DSA_SIGALG(sha3_224, SHA3-224);
-IMPL_DSA_SIGALG(sha3_256, SHA3-256);
-IMPL_DSA_SIGALG(sha3_384, SHA3-384);
-IMPL_DSA_SIGALG(sha3_512, SHA3-512);
-/* clang-format on */
+IMPL_DSA_SIGALG(sha1, "SHA1");
+IMPL_DSA_SIGALG(sha224, "SHA2-224");
+IMPL_DSA_SIGALG(sha256, "SHA2-256");
+IMPL_DSA_SIGALG(sha384, "SHA2-384");
+IMPL_DSA_SIGALG(sha512, "SHA2-512");
+IMPL_DSA_SIGALG(sha3_224, "SHA3-224");
+IMPL_DSA_SIGALG(sha3_256, "SHA3-256");
+IMPL_DSA_SIGALG(sha3_384, "SHA3-384");
+IMPL_DSA_SIGALG(sha3_512, "SHA3-512");
diff --git a/deps/openssl/openssl/providers/implementations/signature/dsa_sig.inc.in b/deps/openssl/openssl/providers/implementations/signature/dsa_sig.inc.in
new file mode 100644
index 00000000000..af329e9415b
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/signature/dsa_sig.inc.in
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('dsa_get_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID',            'algid',  'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_DIGEST',                  'digest', 'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_NONCE_TYPE',              'nonce',  'uint'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR', 'ind',    'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('dsa_set_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_DIGEST',            'digest',   'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_PROPERTIES',        'propq',    'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_NONCE_TYPE',        'nonce',    'uint'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK',    'ind_k',    'int', 'fips'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d',    'int', 'fips'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_SIGN_CHECK',   'ind_sign', 'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('dsa_sigalg_set_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_SIGNATURE',         'sig',      'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_NONCE_TYPE',        'nonce',    'uint'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK',    'ind_k',    'int', 'fips'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d',    'int', 'fips'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_SIGN_CHECK',   'ind_sign', 'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/signature/ecdsa_sig.c b/deps/openssl/openssl/providers/implementations/signature/ecdsa_sig.c
index 3cbceed8a24..d937749d225 100644
--- a/deps/openssl/openssl/providers/implementations/signature/ecdsa_sig.c
+++ b/deps/openssl/openssl/providers/implementations/signature/ecdsa_sig.c
@@ -32,6 +32,27 @@
 #include "prov/securitycheck.h"
 #include "prov/der_ec.h"
 #include "crypto/ec.h"
+#include "internal/fips.h"
+
+struct ecdsa_all_set_ctx_params_st {
+    OSSL_PARAM *digest; /* ecdsa_set_ctx_params */
+    OSSL_PARAM *propq; /* ecdsa_set_ctx_params */
+    OSSL_PARAM *size; /* ecdsa_set_ctx_params */
+#ifdef FIPS_MODULE
+    OSSL_PARAM *ind_d;
+    OSSL_PARAM *ind_k;
+#endif
+#if !defined(OPENSSL_NO_ACVP_TESTS)
+    OSSL_PARAM *kat;
+#endif
+    OSSL_PARAM *nonce;
+    OSSL_PARAM *sig; /* ecdsa_sigalg_set_ctx_params */
+};
+
+#define ecdsa_set_ctx_params_st ecdsa_all_set_ctx_params_st
+#define ecdsa_sigalg_set_ctx_params_st ecdsa_all_set_ctx_params_st
+
+#include "providers/implementations/signature/ecdsa_sig.inc"

 static OSSL_FUNC_signature_newctx_fn ecdsa_newctx;
 static OSSL_FUNC_signature_sign_init_fn ecdsa_sign_init;
@@ -146,6 +167,12 @@ static void *ecdsa_newctx(void *provctx, const char *propq)
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_SIG_ECDSA_SHA256))
+        return NULL;
+#endif
+
     ctx = OPENSSL_zalloc(sizeof(PROV_ECDSA_CTX));
     if (ctx == NULL)
         return NULL;
@@ -221,7 +248,7 @@ static int ecdsa_setup_md(PROV_ECDSA_CTX *ctx,
                 OSSL_FIPS_IND_SETTABLE1,
                 ctx->libctx,
                 md_nid, sha1_allowed, 0, desc,
-                ossl_fips_config_signature_digest_check))
+                FIPS_CONFIG_SIGNATURE_DIGEST_CHECK))
             goto err;
     }
 #endif
@@ -353,13 +380,13 @@ static int ecdsa_sign_directly(void *vctx,

         if (ctx->mdname[0] != '\0')
             mdname = ctx->mdname;
-        ret = ossl_ecdsa_deterministic_sign(tbs, tbslen, sig, &sltmp,
+        ret = ossl_ecdsa_deterministic_sign(tbs, (int)tbslen, sig, &sltmp,
             ctx->ec, ctx->nonce_type,
             mdname,
             ctx->libctx, ctx->propq);
     } else {
-        ret = ECDSA_sign_ex(0, tbs, tbslen, sig, &sltmp, ctx->kinv, ctx->r,
-            ctx->ec);
+        ret = ECDSA_sign_ex(0, tbs, (int)tbslen, sig, &sltmp,
+            ctx->kinv, ctx->r, ctx->ec);
     }
     if (ret <= 0)
         return 0;
@@ -445,7 +472,7 @@ static int ecdsa_verify_directly(void *vctx,
     if (!ossl_prov_is_running() || (ctx->mdsize != 0 && tbslen != ctx->mdsize))
         return 0;

-    return ECDSA_verify(0, tbs, tbslen, sig, siglen, ctx->ec);
+    return ECDSA_verify(0, tbs, (int)tbslen, sig, (int)siglen, ctx->ec);
 }

 static int ecdsa_verify_set_sig(void *vctx,
@@ -671,55 +698,42 @@ err:
 static int ecdsa_get_ctx_params(void *vctx, OSSL_PARAM *params)
 {
     PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
-    OSSL_PARAM *p;
+    struct ecdsa_get_ctx_params_st p;

-    if (ctx == NULL)
+    if (ctx == NULL || !ecdsa_get_ctx_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_ALGORITHM_ID);
-    if (p != NULL && !OSSL_PARAM_set_octet_string(p, ctx->aid_len == 0 ? NULL : ctx->aid_buf, ctx->aid_len))
+    if (p.algid != NULL
+        && !OSSL_PARAM_set_octet_string(p.algid,
+            ctx->aid_len == 0 ? NULL : ctx->aid_buf,
+            ctx->aid_len))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_DIGEST_SIZE);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->mdsize))
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, ctx->mdsize))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_DIGEST);
-    if (p != NULL && !OSSL_PARAM_set_utf8_string(p, ctx->md == NULL ? ctx->mdname : EVP_MD_get0_name(ctx->md)))
+    if (p.digest != NULL
+        && !OSSL_PARAM_set_utf8_string(p.digest, ctx->md == NULL ? ctx->mdname : EVP_MD_get0_name(ctx->md)))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_NONCE_TYPE);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->nonce_type))
+    if (p.nonce != NULL && !OSSL_PARAM_set_uint(p.nonce, ctx->nonce_type))
         return 0;

 #ifdef FIPS_MODULE
-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->verify_message))
+    if (p.verify != NULL && !OSSL_PARAM_set_uint(p.verify, ctx->verify_message))
         return 0;
 #endif

-    if (!OSSL_FIPS_IND_GET_CTX_PARAM_CONDITIONAL(ctx, params,
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM_CONDITIONAL(ctx, p.ind,
             ctx->verify_message))
         return 0;
     return 1;
 }

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0),
-    OSSL_PARAM_size_t(OSSL_SIGNATURE_PARAM_DIGEST_SIZE, NULL),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0),
-    OSSL_PARAM_uint(OSSL_SIGNATURE_PARAM_NONCE_TYPE, NULL),
-#ifdef FIPS_MODULE
-    OSSL_PARAM_uint(OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE, NULL),
-#endif
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *ecdsa_gettable_ctx_params(ossl_unused void *vctx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return ecdsa_get_ctx_params_list;
 }

 /**
@@ -727,72 +741,54 @@ static const OSSL_PARAM *ecdsa_gettable_ctx_params(ossl_unused void *vctx,
  * ecdsa_sigalg_set_ctx_params. The caller is responsible for checking |vctx| is
  * not NULL and |params| is not empty.
  */
-static int ecdsa_common_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+static int ecdsa_common_set_ctx_params(PROV_ECDSA_CTX *ctx,
+    const struct ecdsa_all_set_ctx_params_st *p)
 {
-    PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
-    const OSSL_PARAM *p;
-
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0,
+            p->ind_k))
         return 0;
-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE1, params,
-            OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE1,
+            p->ind_d))
         return 0;

 #if !defined(OPENSSL_NO_ACVP_TESTS)
-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_KAT);
-    if (p != NULL && !OSSL_PARAM_get_uint(p, &ctx->kattest))
+    if (p->kat != NULL && !OSSL_PARAM_get_uint(p->kat, &ctx->kattest))
         return 0;
 #endif

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_NONCE_TYPE);
-    if (p != NULL
-        && !OSSL_PARAM_get_uint(p, &ctx->nonce_type))
+    if (p->nonce != NULL && !OSSL_PARAM_get_uint(p->nonce, &ctx->nonce_type))
         return 0;
     return 1;
 }

-#define ECDSA_COMMON_SETTABLE_CTX_PARAMS                                             \
-    OSSL_PARAM_uint(OSSL_SIGNATURE_PARAM_KAT, NULL),                                 \
-        OSSL_PARAM_uint(OSSL_SIGNATURE_PARAM_NONCE_TYPE, NULL),                      \
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK)        \
-            OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK) \
-                OSSL_PARAM_END
-
 static int ecdsa_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct ecdsa_all_set_ctx_params_st p;
     size_t mdsize = 0;
     int ret;

-    if (ctx == NULL)
+    if (ctx == NULL || !ecdsa_set_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    if ((ret = ecdsa_common_set_ctx_params(ctx, params)) <= 0)
+    if ((ret = ecdsa_common_set_ctx_params(ctx, &p)) <= 0)
         return ret;

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DIGEST);
-    if (p != NULL) {
+    if (p.digest != NULL) {
         char mdname[OSSL_MAX_NAME_SIZE] = "", *pmdname = mdname;
         char mdprops[OSSL_MAX_PROPQUERY_SIZE] = "", *pmdprops = mdprops;
-        const OSSL_PARAM *propsp = OSSL_PARAM_locate_const(params,
-            OSSL_SIGNATURE_PARAM_PROPERTIES);

-        if (!OSSL_PARAM_get_utf8_string(p, &pmdname, sizeof(mdname)))
+        if (!OSSL_PARAM_get_utf8_string(p.digest, &pmdname, sizeof(mdname)))
             return 0;
-        if (propsp != NULL
-            && !OSSL_PARAM_get_utf8_string(propsp, &pmdprops, sizeof(mdprops)))
+        if (p.propq != NULL
+            && !OSSL_PARAM_get_utf8_string(p.propq, &pmdprops, sizeof(mdprops)))
             return 0;
         if (!ecdsa_setup_md(ctx, mdname, mdprops, "ECDSA Set Ctx"))
             return 0;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DIGEST_SIZE);
-    if (p != NULL) {
-        if (!OSSL_PARAM_get_size_t(p, &mdsize)
+    if (p.size != NULL) {
+        if (!OSSL_PARAM_get_size_t(p.size, &mdsize)
             || (!ctx->flag_allow_md && mdsize != ctx->mdsize))
             return 0;
         ctx->mdsize = mdsize;
@@ -800,17 +796,10 @@ static int ecdsa_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     return 1;
 }

-static const OSSL_PARAM settable_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0),
-    OSSL_PARAM_size_t(OSSL_SIGNATURE_PARAM_DIGEST_SIZE, NULL),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_PROPERTIES, NULL, 0),
-    ECDSA_COMMON_SETTABLE_CTX_PARAMS
-};
-
 static const OSSL_PARAM *ecdsa_settable_ctx_params(void *vctx,
     ossl_unused void *provctx)
 {
-    return settable_ctx_params;
+    return ecdsa_set_ctx_params_list;
 }

 static int ecdsa_get_ctx_md_params(void *vctx, OSSL_PARAM *params)
@@ -950,42 +939,34 @@ static const char **ecdsa_sigalg_query_key_types(void)
     return keytypes;
 }

-static const OSSL_PARAM settable_sigalg_ctx_params[] = {
-    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_SIGNATURE, NULL, 0),
-    ECDSA_COMMON_SETTABLE_CTX_PARAMS
-};
-
 static const OSSL_PARAM *ecdsa_sigalg_settable_ctx_params(void *vctx,
     ossl_unused void *provctx)
 {
     PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;

     if (ctx != NULL && ctx->operation == EVP_PKEY_OP_VERIFYMSG)
-        return settable_sigalg_ctx_params;
+        return ecdsa_sigalg_set_ctx_params_list;
     return NULL;
 }

 static int ecdsa_sigalg_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct ecdsa_all_set_ctx_params_st p;
     int ret;

-    if (ctx == NULL)
+    if (ctx == NULL || !ecdsa_sigalg_set_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    if ((ret = ecdsa_common_set_ctx_params(ctx, params)) <= 0)
+    if ((ret = ecdsa_common_set_ctx_params(ctx, &p)) <= 0)
         return ret;

     if (ctx->operation == EVP_PKEY_OP_VERIFYMSG) {
-        p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_SIGNATURE);
-        if (p != NULL) {
+        if (p.sig != NULL) {
             OPENSSL_free(ctx->sig);
             ctx->sig = NULL;
             ctx->siglen = 0;
-            if (!OSSL_PARAM_get_octet_string(p, (void **)&ctx->sig,
+            if (!OSSL_PARAM_get_octet_string(p.sig, (void **)&ctx->sig,
                     0, &ctx->siglen))
                 return 0;
             /* The signature must not be empty */
@@ -1011,11 +992,11 @@ static int ecdsa_sigalg_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     ecdsa_##md##_sign_init(void *vctx, void *vec,                       \
         const OSSL_PARAM params[])                                      \
     {                                                                   \
-        static const char desc[] = "ECDSA-" #MD " Sign Init";           \
+        static const char desc[] = "ECDSA-" MD " Sign Init";            \
                                                                         \
         return ecdsa_sigalg_signverify_init(vctx, vec,                  \
             ecdsa_sigalg_set_ctx_params,                                \
-            params, #MD,                                                \
+            params, MD,                                                 \
             EVP_PKEY_OP_SIGN,                                           \
             desc);                                                      \
     }                                                                   \
@@ -1024,11 +1005,11 @@ static int ecdsa_sigalg_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     ecdsa_##md##_sign_message_init(void *vctx, void *vec,               \
         const OSSL_PARAM params[])                                      \
     {                                                                   \
-        static const char desc[] = "ECDSA-" #MD " Sign Message Init";   \
+        static const char desc[] = "ECDSA-" MD " Sign Message Init";    \
                                                                         \
         return ecdsa_sigalg_signverify_init(vctx, vec,                  \
             ecdsa_sigalg_set_ctx_params,                                \
-            params, #MD,                                                \
+            params, MD,                                                 \
             EVP_PKEY_OP_SIGNMSG,                                        \
             desc);                                                      \
     }                                                                   \
@@ -1037,11 +1018,11 @@ static int ecdsa_sigalg_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     ecdsa_##md##_verify_init(void *vctx, void *vec,                     \
         const OSSL_PARAM params[])                                      \
     {                                                                   \
-        static const char desc[] = "ECDSA-" #MD " Verify Init";         \
+        static const char desc[] = "ECDSA-" MD " Verify Init";          \
                                                                         \
         return ecdsa_sigalg_signverify_init(vctx, vec,                  \
             ecdsa_sigalg_set_ctx_params,                                \
-            params, #MD,                                                \
+            params, MD,                                                 \
             EVP_PKEY_OP_VERIFY,                                         \
             desc);                                                      \
     }                                                                   \
@@ -1050,11 +1031,11 @@ static int ecdsa_sigalg_set_ctx_params(void *vctx, const OSSL_PARAM params[])
     ecdsa_##md##_verify_message_init(void *vctx, void *vec,             \
         const OSSL_PARAM params[])                                      \
     {                                                                   \
-        static const char desc[] = "ECDSA-" #MD " Verify Message Init"; \
+        static const char desc[] = "ECDSA-" MD " Verify Message Init";  \
                                                                         \
         return ecdsa_sigalg_signverify_init(vctx, vec,                  \
             ecdsa_sigalg_set_ctx_params,                                \
-            params, #MD,                                                \
+            params, MD,                                                 \
             EVP_PKEY_OP_VERIFYMSG,                                      \
             desc);                                                      \
     }                                                                   \
@@ -1095,14 +1076,12 @@ static int ecdsa_sigalg_set_ctx_params(void *vctx, const OSSL_PARAM params[])
         OSSL_DISPATCH_END                                               \
     }

-/* clang-format off */
-IMPL_ECDSA_SIGALG(sha1, SHA1);
-IMPL_ECDSA_SIGALG(sha224, SHA2-224);
-IMPL_ECDSA_SIGALG(sha256, SHA2-256);
-IMPL_ECDSA_SIGALG(sha384, SHA2-384);
-IMPL_ECDSA_SIGALG(sha512, SHA2-512);
-IMPL_ECDSA_SIGALG(sha3_224, SHA3-224);
-IMPL_ECDSA_SIGALG(sha3_256, SHA3-256);
-IMPL_ECDSA_SIGALG(sha3_384, SHA3-384);
-IMPL_ECDSA_SIGALG(sha3_512, SHA3-512);
-/* clang-format on */
+IMPL_ECDSA_SIGALG(sha1, "SHA1");
+IMPL_ECDSA_SIGALG(sha224, "SHA2-224");
+IMPL_ECDSA_SIGALG(sha256, "SHA2-256");
+IMPL_ECDSA_SIGALG(sha384, "SHA2-384");
+IMPL_ECDSA_SIGALG(sha512, "SHA2-512");
+IMPL_ECDSA_SIGALG(sha3_224, "SHA3-224");
+IMPL_ECDSA_SIGALG(sha3_256, "SHA3-256");
+IMPL_ECDSA_SIGALG(sha3_384, "SHA3-384");
+IMPL_ECDSA_SIGALG(sha3_512, "SHA3-512");
diff --git a/deps/openssl/openssl/providers/implementations/signature/ecdsa_sig.inc.in b/deps/openssl/openssl/providers/implementations/signature/ecdsa_sig.inc.in
new file mode 100644
index 00000000000..4907b8db48d
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/signature/ecdsa_sig.inc.in
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ecdsa_get_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID',            'algid',  'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_DIGEST_SIZE',             'size',   'size_t'],
+                          ['OSSL_SIGNATURE_PARAM_DIGEST',                  'digest', 'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_NONCE_TYPE',              'nonce',  'uint'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE',     'verify', 'uint', 'fips'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR', 'ind',    'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('ecdsa_set_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_DIGEST',            'digest',   'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_PROPERTIES',        'propq',    'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_DIGEST_SIZE',       'size',     'size_t'],
+                          ['OSSL_SIGNATURE_PARAM_KAT',               'kat',      'uint',
+                           "#if !defined(OPENSSL_NO_ACVP_TESTS)"],
+                          ['OSSL_SIGNATURE_PARAM_NONCE_TYPE',        'nonce',    'uint'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK',    'ind_k',    'int', 'fips'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d',    'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('ecdsa_sigalg_set_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_SIGNATURE',         'sig',   'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_KAT',               'kat',   'uint',
+                           "#if !defined(OPENSSL_NO_ACVP_TESTS)"],
+                          ['OSSL_SIGNATURE_PARAM_NONCE_TYPE',        'nonce', 'uint'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK',    'ind_k', 'int', 'fips'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/signature/eddsa_sig.c b/deps/openssl/openssl/providers/implementations/signature/eddsa_sig.c
index 6b99a04ed89..74e9fc11ee4 100644
--- a/deps/openssl/openssl/providers/implementations/signature/eddsa_sig.c
+++ b/deps/openssl/openssl/providers/implementations/signature/eddsa_sig.c
@@ -14,6 +14,7 @@
 #include <openssl/params.h>
 #include <openssl/evp.h>
 #include <openssl/proverr.h>
+#include "internal/common.h"
 #include "internal/nelem.h"
 #include "internal/sizes.h"
 #include "prov/providercommon.h"
@@ -22,10 +23,14 @@
 #include "prov/provider_ctx.h"
 #include "prov/der_ecx.h"
 #include "crypto/ecx.h"
-#include "fips/fipsindicator.h"
+#include "internal/fips.h"
+
+#define eddsa_set_variant_ctx_params_st eddsa_set_ctx_params_st
+
+#include "providers/implementations/signature/eddsa_sig.inc"

 #ifdef S390X_EC_ASM
-#include "s390x_arch.h"
+#include "arch/s390x_arch.h"

 #define S390X_CAN_SIGN(edtype)                                                    \
     ((OPENSSL_s390xcap_P.pcc[1] & S390X_CAPBIT(S390X_SCALAR_MULTIPLY_##edtype))   \
@@ -63,7 +68,8 @@ enum ID_EdDSA_INSTANCE {
 #define EDDSA_MAX_CONTEXT_STRING_LEN 255
 #define EDDSA_PREHASH_OUTPUT_LEN 64

-static OSSL_FUNC_signature_newctx_fn eddsa_newctx;
+static OSSL_FUNC_signature_newctx_fn ed25519_newctx;
+static OSSL_FUNC_signature_newctx_fn ed448_newctx;
 static OSSL_FUNC_signature_sign_message_init_fn ed25519_signverify_message_init;
 static OSSL_FUNC_signature_sign_message_init_fn ed25519ph_signverify_message_init;
 static OSSL_FUNC_signature_sign_message_init_fn ed25519ctx_signverify_message_init;
@@ -87,6 +93,7 @@ static OSSL_FUNC_signature_get_ctx_params_fn eddsa_get_ctx_params;
 static OSSL_FUNC_signature_gettable_ctx_params_fn eddsa_gettable_ctx_params;
 static OSSL_FUNC_signature_set_ctx_params_fn eddsa_set_ctx_params;
 static OSSL_FUNC_signature_settable_ctx_params_fn eddsa_settable_ctx_params;
+static OSSL_FUNC_signature_set_ctx_params_fn eddsa_set_variant_ctx_params;
 static OSSL_FUNC_signature_settable_ctx_params_fn eddsa_settable_variant_ctx_params;

 /* there are five EdDSA instances:
@@ -162,13 +169,10 @@ typedef struct {

 } PROV_EDDSA_CTX;

-static void *eddsa_newctx(void *provctx, const char *propq_unused)
+static void *eddsa_newctx(void *provctx)
 {
     PROV_EDDSA_CTX *peddsactx;

-    if (!ossl_prov_is_running())
-        return NULL;
-
     peddsactx = OPENSSL_zalloc(sizeof(PROV_EDDSA_CTX));
     if (peddsactx == NULL)
         return NULL;
@@ -178,6 +182,34 @@ static void *eddsa_newctx(void *provctx, const char *propq_unused)
     return peddsactx;
 }

+static void *ed448_newctx(void *provctx, const char *propq_unused)
+{
+    if (!ossl_prov_is_running())
+        return NULL;
+
+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_SIG_ED448))
+        return NULL;
+#endif
+
+    return eddsa_newctx(provctx);
+}
+
+static void *ed25519_newctx(void *provctx, const char *propq_unused)
+{
+    if (!ossl_prov_is_running())
+        return NULL;
+
+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_SIG_ED25519))
+        return NULL;
+#endif
+
+    return eddsa_newctx(provctx);
+}
+
 static int eddsa_setup_instance(void *vpeddsactx, int instance_id,
     unsigned int instance_id_preset,
     unsigned int prehash_by_caller)
@@ -519,7 +551,7 @@ static int ed448_sign(void *vpeddsactx,
     /*
      * s390x_ed448_digestsign() does not yet support context-strings or
      * pre-hashing. Fall back to non-accelerated sign if a context-string or
-     * pre-hasing is provided.
+     * pre-hashing is provided.
      */
     if (S390X_CAN_SIGN(ED448)
         && peddsactx->context_string_len == 0
@@ -641,7 +673,7 @@ static int ed448_verify(void *vpeddsactx,
     /*
      * s390x_ed448_digestverify() does not yet support context-strings or
      * pre-hashing. Fall back to non-accelerated verify if a context-string or
-     * pre-hasing is provided.
+     * pre-hashing is provided.
      */
     if (S390X_CAN_SIGN(ED448)
         && peddsactx->context_string_len == 0
@@ -795,59 +827,42 @@ static const char **ed448_sigalg_query_key_types(void)
 static int eddsa_get_ctx_params(void *vpeddsactx, OSSL_PARAM *params)
 {
     PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx;
-    OSSL_PARAM *p;
+    struct eddsa_get_ctx_params_st p;

-    if (peddsactx == NULL)
+    if (peddsactx == NULL || !eddsa_get_ctx_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_ALGORITHM_ID);
-    if (p != NULL
-        && !OSSL_PARAM_set_octet_string(p,
+    if (p.id != NULL
+        && !OSSL_PARAM_set_octet_string(p.id,
             peddsactx->aid_len == 0 ? NULL : peddsactx->aid_buf,
             peddsactx->aid_len))
         return 0;

-    return OSSL_FIPS_IND_GET_CTX_PARAM_APPROVED(peddsactx, params);
+    return 1;
 }

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_INSTANCE, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_CONTEXT_STRING, NULL, 0),
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *eddsa_gettable_ctx_params(ossl_unused void *vpeddsactx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return eddsa_get_ctx_params_list;
 }

-static int eddsa_set_ctx_params(void *vpeddsactx, const OSSL_PARAM params[])
+static int eddsa_set_ctx_params_internal(PROV_EDDSA_CTX *peddsactx, const struct eddsa_set_ctx_params_st *p)
 {
-    PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx;
-    const OSSL_PARAM *p;
-
-    if (peddsactx == NULL)
-        return 0;
-    if (ossl_param_is_empty(params))
-        return 1;
-
-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_INSTANCE);
-    if (p != NULL) {
+    if (p->inst != NULL) {
         char instance_name[OSSL_MAX_NAME_SIZE] = "";
         char *pinstance_name = instance_name;

         if (peddsactx->instance_id_preset_flag) {
-            /* When the instance is preset, the caller must no try to set it */
+            /* When the instance is preset, the caller must not try to set it */
             ERR_raise_data(ERR_LIB_PROV, PROV_R_NO_INSTANCE_ALLOWED,
                 "the EdDSA instance is preset, you may not try to specify it",
                 NULL);
             return 0;
         }

-        if (!OSSL_PARAM_get_utf8_string(p, &pinstance_name, sizeof(instance_name)))
+        if (!OSSL_PARAM_get_utf8_string(p->inst, &pinstance_name,
+                sizeof(instance_name)))
             return 0;

         /*
@@ -883,11 +898,12 @@ static int eddsa_set_ctx_params(void *vpeddsactx, const OSSL_PARAM params[])
         }
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_CONTEXT_STRING);
-    if (p != NULL) {
+    if (p->ctx != NULL) {
         void *vp_context_string = peddsactx->context_string;

-        if (!OSSL_PARAM_get_octet_string(p, &vp_context_string, sizeof(peddsactx->context_string), &(peddsactx->context_string_len))) {
+        if (!OSSL_PARAM_get_octet_string(p->ctx, &vp_context_string,
+                sizeof(peddsactx->context_string),
+                &(peddsactx->context_string_len))) {
             peddsactx->context_string_len = 0;
             return 0;
         }
@@ -896,28 +912,38 @@ static int eddsa_set_ctx_params(void *vpeddsactx, const OSSL_PARAM params[])
     return 1;
 }

-static const OSSL_PARAM settable_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_INSTANCE, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_CONTEXT_STRING, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *eddsa_settable_ctx_params(ossl_unused void *vpeddsactx,
     ossl_unused void *provctx)
 {
-    return settable_ctx_params;
+    return eddsa_set_ctx_params_list;
 }

-static const OSSL_PARAM settable_variant_ctx_params[] = {
-    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_CONTEXT_STRING, NULL, 0),
-    OSSL_PARAM_END
-};
+static int eddsa_set_ctx_params(void *vpeddsactx, const OSSL_PARAM params[])
+{
+    PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx;
+    struct eddsa_set_ctx_params_st p;
+
+    if (peddsactx == NULL || !eddsa_set_ctx_params_decoder(params, &p))
+        return 0;
+    return eddsa_set_ctx_params_internal(peddsactx, &p);
+}

 static const OSSL_PARAM *
 eddsa_settable_variant_ctx_params(ossl_unused void *vpeddsactx,
     ossl_unused void *provctx)
 {
-    return settable_variant_ctx_params;
+    return eddsa_set_variant_ctx_params_list;
+}
+
+static int eddsa_set_variant_ctx_params(void *vpeddsactx,
+    const OSSL_PARAM params[])
+{
+    PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx;
+    struct eddsa_set_ctx_params_st p;
+
+    if (peddsactx == NULL || !eddsa_set_variant_ctx_params_decoder(params, &p))
+        return 0;
+    return eddsa_set_ctx_params_internal(peddsactx, &p);
 }

 /*
@@ -983,7 +1009,7 @@ eddsa_settable_variant_ctx_params(ossl_unused void *vpeddsactx,
         { OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS,               \
             (void (*)(void))eddsa_gettable_ctx_params },         \
         { OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS,                    \
-            (void (*)(void))eddsa_set_ctx_params },              \
+            (void (*)(void))eddsa_set_variant_ctx_params },      \
         { OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS,               \
             (void (*)(void))eddsa_settable_variant_ctx_params }, \
         OSSL_DISPATCH_END
@@ -1030,7 +1056,7 @@ eddsa_settable_variant_ctx_params(ossl_unused void *vpeddsactx,
 /* vn = variant name, bn = base name */
 #define IMPL_EDDSA_DISPATCH(vn, bn)                                     \
     const OSSL_DISPATCH ossl_##vn##_signature_functions[] = {           \
-        { OSSL_FUNC_SIGNATURE_NEWCTX, (void (*)(void))eddsa_newctx },   \
+        { OSSL_FUNC_SIGNATURE_NEWCTX, (void (*)(void))bn##_newctx },    \
         { OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_INIT,                        \
             (void (*)(void))vn##_signverify_message_init },             \
         { OSSL_FUNC_SIGNATURE_SIGN,                                     \
diff --git a/deps/openssl/openssl/providers/implementations/signature/eddsa_sig.inc.in b/deps/openssl/openssl/providers/implementations/signature/eddsa_sig.inc.in
new file mode 100644
index 00000000000..1577f669a4b
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/signature/eddsa_sig.inc.in
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('eddsa_get_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'id', 'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR', 'fips indicator', 'int'],
+                         )); -}
+
+{- produce_param_decoder('eddsa_set_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_INSTANCE',       'inst', 'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_CONTEXT_STRING', 'ctx',  'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('eddsa_set_variant_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_CONTEXT_STRING', 'ctx',  'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/signature/lms_signature.c b/deps/openssl/openssl/providers/implementations/signature/lms_signature.c
new file mode 100644
index 00000000000..f76382b02a8
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/signature/lms_signature.c
@@ -0,0 +1,193 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/core.h>
+#include <openssl/core_dispatch.h>
+#include <openssl/core_names.h>
+#include <openssl/proverr.h>
+#include <openssl/params.h>
+#include <openssl/evp.h>
+#include <openssl/err.h>
+#include "prov/providercommon.h"
+#include "prov/provider_ctx.h"
+#include "prov/implementations.h"
+#include "crypto/lms_sig.h"
+#include "internal/fips.h"
+#include "providers/implementations/signature/lms_signature.inc"
+
+static OSSL_FUNC_signature_newctx_fn lms_newctx;
+static OSSL_FUNC_signature_freectx_fn lms_freectx;
+static OSSL_FUNC_signature_verify_message_init_fn lms_verify_msg_init;
+static OSSL_FUNC_signature_verify_fn lms_verify;
+static OSSL_FUNC_signature_digest_verify_init_fn lms_digest_verify_init;
+static OSSL_FUNC_signature_digest_verify_fn lms_digest_verify;
+#ifdef FIPS_MODULE
+static OSSL_FUNC_signature_get_ctx_params_fn lms_get_ctx_params;
+static OSSL_FUNC_signature_gettable_ctx_params_fn lms_gettable_ctx_params;
+#endif
+
+typedef struct {
+    OSSL_LIB_CTX *libctx;
+    char *propq;
+    LMS_KEY *key;
+    EVP_MD *md;
+} PROV_LMS_CTX;
+
+static void *lms_newctx(void *provctx, const char *propq)
+{
+    PROV_LMS_CTX *ctx;
+
+    if (!ossl_prov_is_running())
+        return NULL;
+
+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_SIG_LMS))
+        return NULL;
+#endif
+
+    ctx = OPENSSL_zalloc(sizeof(PROV_LMS_CTX));
+    if (ctx == NULL)
+        return NULL;
+
+    if (propq != NULL && (ctx->propq = OPENSSL_strdup(propq)) == NULL)
+        goto err;
+    ctx->libctx = PROV_LIBCTX_OF(provctx);
+    return ctx;
+err:
+    OPENSSL_free(ctx);
+    return NULL;
+}
+
+static void lms_freectx(void *vctx)
+{
+    PROV_LMS_CTX *ctx = (PROV_LMS_CTX *)vctx;
+
+    if (ctx == NULL)
+        return;
+    OPENSSL_free(ctx->propq);
+    EVP_MD_free(ctx->md);
+    OPENSSL_free(ctx);
+}
+
+static int setdigest(PROV_LMS_CTX *ctx, const char *digestname)
+{
+    /*
+     * Assume that only one digest can be used by LMS.
+     * Set the digest to the one contained in the public key.
+     * If the optional digestname passed in by the user is different
+     * then return an error.
+     */
+    LMS_KEY *key = ctx->key;
+    const char *pub_digestname = key->ots_params->digestname;
+
+    if (ctx->md != NULL) {
+        if (EVP_MD_is_a(ctx->md, pub_digestname))
+            goto end;
+        EVP_MD_free(ctx->md);
+    }
+    ctx->md = EVP_MD_fetch(ctx->libctx, pub_digestname, ctx->propq);
+    if (ctx->md == NULL)
+        return 0;
+end:
+    return digestname == NULL || EVP_MD_is_a(ctx->md, digestname);
+}
+
+static int lms_verify_msg_init(void *vctx, void *vkey, const OSSL_PARAM params[])
+{
+    PROV_LMS_CTX *ctx = (PROV_LMS_CTX *)vctx;
+    LMS_KEY *key = (LMS_KEY *)vkey;
+
+    if (!ossl_prov_is_running() || ctx == NULL)
+        return 0;
+
+    if (key == NULL && ctx->key == NULL) {
+        ERR_raise(ERR_LIB_PROV, PROV_R_NO_KEY_SET);
+        return 0;
+    }
+    if (key != NULL)
+        ctx->key = key;
+    return setdigest(ctx, NULL);
+}
+
+static int lms_verify(void *vctx, const unsigned char *sigbuf, size_t sigbuf_len,
+    const unsigned char *msg, size_t msglen)
+{
+    int ret = 0;
+    PROV_LMS_CTX *ctx = (PROV_LMS_CTX *)vctx;
+    LMS_KEY *pub = ctx->key;
+    LMS_SIG *sig = NULL;
+
+    /* A root public key is required to perform a verify operation */
+    if (pub == NULL)
+        return 0;
+
+    /* Decode the LMS signature data into a LMS_SIG object */
+    if (!ossl_lms_sig_decode(&sig, pub, sigbuf, sigbuf_len))
+        return 0;
+
+    ret = ossl_lms_sig_verify(sig, pub, ctx->md, msg, msglen);
+    ossl_lms_sig_free(sig);
+    return ret;
+}
+
+static int lms_digest_verify_init(void *vctx, const char *mdname, void *vkey,
+    const OSSL_PARAM params[])
+{
+    PROV_LMS_CTX *ctx = (PROV_LMS_CTX *)vctx;
+
+    if (mdname != NULL && mdname[0] != '\0') {
+        ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST,
+            "Explicit digest not supported for LMS operations");
+        return 0;
+    }
+    if (vkey == NULL && ctx->key != NULL)
+        return 1; /* lms_set_ctx_params(ctx, params); */
+
+    return lms_verify_msg_init(vctx, vkey, params);
+}
+
+static int lms_digest_verify(void *vctx, const uint8_t *sig, size_t siglen,
+    const uint8_t *tbs, size_t tbslen)
+{
+    return lms_verify(vctx, sig, siglen, tbs, tbslen);
+}
+
+#ifdef FIPS_MODULE
+static const OSSL_PARAM *lms_gettable_ctx_params(ossl_unused void *vctx,
+    ossl_unused void *provctx)
+{
+    return lms_get_ctx_params_list;
+}
+
+static int lms_get_ctx_params(ossl_unused void *vctx, OSSL_PARAM params[])
+{
+    struct lms_get_ctx_params_st p;
+
+    return lms_get_ctx_params_decoder(params, &p);
+}
+#endif
+
+const OSSL_DISPATCH ossl_lms_signature_functions[] = {
+    { OSSL_FUNC_SIGNATURE_NEWCTX, (void (*)(void))lms_newctx },
+    { OSSL_FUNC_SIGNATURE_FREECTX, (void (*)(void))lms_freectx },
+    { OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_INIT,
+        (void (*)(void))lms_verify_msg_init },
+    { OSSL_FUNC_SIGNATURE_VERIFY, (void (*)(void))lms_verify },
+    { OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT,
+        (void (*)(void))lms_digest_verify_init },
+    { OSSL_FUNC_SIGNATURE_DIGEST_VERIFY,
+        (void (*)(void))lms_digest_verify },
+#ifdef FIPS_MODULE
+    { OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS, (void (*)(void))lms_get_ctx_params },
+    { OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS,
+        (void (*)(void))lms_gettable_ctx_params },
+#endif
+    OSSL_DISPATCH_END
+};
diff --git a/deps/openssl/openssl/providers/implementations/signature/lms_signature.inc.in b/deps/openssl/openssl/providers/implementations/signature/lms_signature.inc.in
new file mode 100644
index 00000000000..8386c23be25
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/signature/lms_signature.inc.in
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('lms_get_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR',
+                           'fips indicator', 'int'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/signature/mac_legacy_sig.c b/deps/openssl/openssl/providers/implementations/signature/mac_legacy_sig.c
index 8c5746113c6..a5a5da52d4e 100644
--- a/deps/openssl/openssl/providers/implementations/signature/mac_legacy_sig.c
+++ b/deps/openssl/openssl/providers/implementations/signature/mac_legacy_sig.c
@@ -7,9 +7,6 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine deprecated APIs */
-#define OPENSSL_SUPPRESS_DEPRECATED
-
 #include <stdbool.h>
 #include <openssl/crypto.h>
 #include <openssl/evp.h>
@@ -18,9 +15,6 @@
 #include <openssl/params.h>
 #include <openssl/err.h>
 #include <openssl/proverr.h>
-#ifndef FIPS_MODULE
-#include <openssl/engine.h>
-#endif
 #include "prov/implementations.h"
 #include "prov/provider_ctx.h"
 #include "prov/macsignature.h"
@@ -29,6 +23,12 @@
 #include "internal/fips.h"
 #include "internal/common.h"

+#ifndef FIPS_MODULE
+#define mac_legacy_get_ctx_params_decoder
+#define mac_legacy_set_ctx_params_decoder
+#endif
+#include "providers/implementations/signature/mac_legacy_sig.inc"
+
 static OSSL_FUNC_signature_newctx_fn mac_hmac_newctx;
 static OSSL_FUNC_signature_newctx_fn mac_siphash_newctx;
 static OSSL_FUNC_signature_newctx_fn mac_poly1305_newctx;
@@ -110,15 +110,14 @@ MAC_NEWCTX(cmac, "CMAC")
  * The fips indicator check is done at this level because HMAC will be created
  * as an 'internal' sub-algorithm which will not perform the tests in hmac_prov.c
  */
-static int hmac_check_key(PROV_MAC_CTX *macctx, const unsigned char *key,
-    size_t keylen)
+static int hmac_check_key(PROV_MAC_CTX *macctx, const unsigned char *key, size_t keylen)
 {
     int approved = ossl_mac_check_key_size(keylen);

     if (!approved) {
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(macctx, OSSL_FIPS_IND_SETTABLE0,
                 macctx->libctx, "HMAC", "keysize",
-                ossl_fips_config_hmac_key_check)) {
+                FIPS_CONFIG_HMAC_KEY_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
             return 0;
         }
@@ -131,7 +130,7 @@ static int mac_digest_sign_init(void *vpmacctx, const char *mdname, void *vkey,
     const OSSL_PARAM params[])
 {
     PROV_MAC_CTX *pmacctx = (PROV_MAC_CTX *)vpmacctx;
-    const char *ciphername = NULL, *engine = NULL;
+    const char *ciphername = NULL;

     if (!ossl_prov_is_running()
         || pmacctx == NULL)
@@ -150,28 +149,21 @@ static int mac_digest_sign_init(void *vpmacctx, const char *mdname, void *vkey,
     }

     if (pmacctx->key->cipher.cipher != NULL)
-        ciphername = (char *)EVP_CIPHER_get0_name(pmacctx->key->cipher.cipher);
-#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
-    if (pmacctx->key->cipher.engine != NULL)
-        engine = (char *)ENGINE_get_id(pmacctx->key->cipher.engine);
-#endif
+        ciphername = EVP_CIPHER_get0_name(pmacctx->key->cipher.cipher);

-    if (!ossl_prov_set_macctx(pmacctx->macctx, NULL,
-            (char *)ciphername,
-            (char *)mdname,
-            (char *)engine,
-            pmacctx->key->properties,
-            NULL, 0))
+    if (!ossl_prov_set_macctx(pmacctx->macctx,
+            ciphername,
+            mdname,
+            pmacctx->key->properties, params))
         return 0;

 #ifdef FIPS_MODULE
     if (pmacctx->hmac_keysize_check
-        && !hmac_check_key(pmacctx, pmacctx->key->priv_key,
-            pmacctx->key->priv_key_len))
+        && !hmac_check_key(pmacctx, pmacctx->key->priv_key, pmacctx->key->priv_key_len))
         return 0;
 #endif
     if (!EVP_MAC_init(pmacctx->macctx, pmacctx->key->priv_key,
-            pmacctx->key->priv_key_len, params))
+            pmacctx->key->priv_key_len, NULL))
         return 0;

     return 1;
@@ -251,15 +243,16 @@ static int mac_set_ctx_params(void *vpmacctx, const OSSL_PARAM params[])

 #ifdef FIPS_MODULE
     if (ctx->hmac_keysize_check) {
-        const OSSL_PARAM *p;
+        struct mac_legacy_set_ctx_params_st p;

-        if (!OSSL_FIPS_IND_SET_CTX_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0,
-                params, OSSL_MAC_PARAM_FIPS_KEY_CHECK))
+        if (!mac_legacy_set_ctx_params_decoder(params, &p))
             return 0;
-        if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_KEY)) != NULL) {
-            if (p->data_type != OSSL_PARAM_OCTET_STRING)
+        if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(ctx, OSSL_FIPS_IND_SETTABLE0, p.ind_k))
+            return 0;
+        if (p.key != NULL) {
+            if (p.key->data_type != OSSL_PARAM_OCTET_STRING)
                 return 0;
-            if (!hmac_check_key(ctx, p->data, p->data_size))
+            if (!hmac_check_key(ctx, p.key->data, p.key->data_size))
                 return 0;
         }
     }
@@ -284,47 +277,42 @@ static const OSSL_PARAM *mac_settable_ctx_params(ossl_unused void *ctx,
     return params;
 }

-static const OSSL_PARAM mac_known_gettable_ctx_params[] = {
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *mac_gettable_ctx_params(ossl_unused void *vctx,
     ossl_unused void *provctx)
 {
-    return mac_known_gettable_ctx_params;
+    return mac_legacy_get_ctx_params_list;
 }

 static int mac_get_ctx_params(void *vctx, OSSL_PARAM params[])
 {
     PROV_MAC_CTX *ctx = vctx;
-#ifdef FIPS_MODULE
-    OSSL_PARAM *p;
-#endif

     if (ctx == NULL)
         return 0;

 #ifdef FIPS_MODULE
-    p = OSSL_PARAM_locate(params, OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR);
-    if (p != NULL) {
+    struct mac_legacy_get_ctx_params_st p;
+
+    if (!mac_legacy_get_ctx_params_decoder(params, &p))
+        return 0;
+    if (p.ind != NULL) {
         int approved = OSSL_FIPS_IND_GET(ctx)->approved;

         /* Internal HMAC delegates its indicator checks to this wrapper. */
         if (!ctx->hmac_keysize_check) {
             int mac_approved = 0;
-            OSSL_PARAM mac_params[2];
-
-            mac_params[0] = OSSL_PARAM_construct_int(
-                OSSL_MAC_PARAM_FIPS_APPROVED_INDICATOR, &mac_approved);
-            mac_params[1] = OSSL_PARAM_construct_end();
+            OSSL_PARAM mac_params[] = {
+                OSSL_PARAM_int(OSSL_MAC_PARAM_FIPS_APPROVED_INDICATOR,
+                    &mac_approved),
+                OSSL_PARAM_END
+            };

             if (!EVP_MAC_CTX_get_params(ctx->macctx, mac_params)
                 || !OSSL_PARAM_modified(mac_params))
                 return 0;
             approved &= mac_approved;
         }
-        if (!OSSL_PARAM_set_int(p, approved))
+        if (!OSSL_PARAM_set_int(p.ind, approved))
             return 0;
     }
 #endif
diff --git a/deps/openssl/openssl/providers/implementations/signature/mac_legacy_sig.inc.in b/deps/openssl/openssl/providers/implementations/signature/mac_legacy_sig.inc.in
new file mode 100644
index 00000000000..36f98b23db2
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/signature/mac_legacy_sig.inc.in
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('mac_legacy_get_ctx_params',
+                         (['OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR', 'ind',    'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('mac_legacy_set_ctx_params',
+                         (['OSSL_MAC_PARAM_KEY', 'key', 'octet_string'],
+                          ['OSSL_MAC_PARAM_FIPS_KEY_CHECK', 'ind_k',   'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/signature/ml_dsa_sig.c b/deps/openssl/openssl/providers/implementations/signature/ml_dsa_sig.c
index 6033f149cb3..bcad5e53961 100644
--- a/deps/openssl/openssl/providers/implementations/signature/ml_dsa_sig.c
+++ b/deps/openssl/openssl/providers/implementations/signature/ml_dsa_sig.c
@@ -20,16 +20,27 @@
 #include "prov/provider_ctx.h"
 #include "prov/der_ml_dsa.h"
 #include "crypto/ml_dsa.h"
+#include "internal/common.h"
 #include "internal/packet.h"
 #include "internal/sizes.h"
+#include "internal/fips.h"
 #include "fips/fipsindicator.h"

+#define ml_dsa_set_ctx_params_st ml_dsa_verifymsg_set_ctx_params_st
+#define ml_dsa_set_ctx_params_decoder ml_dsa_verifymsg_set_ctx_params_decoder
+
+#include "providers/implementations/signature/ml_dsa_sig.inc"
+
 #define ML_DSA_MESSAGE_ENCODE_RAW 0
 #define ML_DSA_MESSAGE_ENCODE_PURE 1

 static OSSL_FUNC_signature_sign_message_init_fn ml_dsa_sign_msg_init;
+static OSSL_FUNC_signature_sign_message_update_fn ml_dsa_signverify_msg_update;
+static OSSL_FUNC_signature_sign_message_final_fn ml_dsa_sign_msg_final;
 static OSSL_FUNC_signature_sign_fn ml_dsa_sign;
 static OSSL_FUNC_signature_verify_message_init_fn ml_dsa_verify_msg_init;
+static OSSL_FUNC_signature_verify_message_update_fn ml_dsa_signverify_msg_update;
+static OSSL_FUNC_signature_verify_message_final_fn ml_dsa_verify_msg_final;
 static OSSL_FUNC_signature_verify_fn ml_dsa_verify;
 static OSSL_FUNC_signature_digest_sign_init_fn ml_dsa_digest_signverify_init;
 static OSSL_FUNC_signature_digest_sign_fn ml_dsa_digest_sign;
@@ -55,13 +66,20 @@ typedef struct {
     uint8_t aid_buf[OSSL_MAX_ALGORITHM_ID_SIZE];
     size_t aid_len;
     int mu; /* Flag indicating we should begin from \mu, not the message */
+
+    int operation;
+    EVP_MD_CTX *md_ctx; /* Ctx for msg_init/update/final interface */
+    unsigned char *sig; /* Signature, for verification */
+    size_t siglen;
 } PROV_ML_DSA_CTX;

 static void ml_dsa_freectx(void *vctx)
 {
     PROV_ML_DSA_CTX *ctx = (PROV_ML_DSA_CTX *)vctx;

+    EVP_MD_CTX_free(ctx->md_ctx);
     OPENSSL_cleanse(ctx->test_entropy, ctx->test_entropy_len);
+    OPENSSL_free(ctx->sig);
     OPENSSL_free(ctx);
 }

@@ -72,6 +90,12 @@ static void *ml_dsa_newctx(void *provctx, int evp_type, const char *propq)
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_SIG_ML_DSA_65))
+        return NULL;
+#endif
+
     ctx = OPENSSL_zalloc(sizeof(PROV_ML_DSA_CTX));
     if (ctx == NULL)
         return NULL;
@@ -85,6 +109,7 @@ static void *ml_dsa_newctx(void *provctx, int evp_type, const char *propq)
 static void *ml_dsa_dupctx(void *vctx)
 {
     PROV_ML_DSA_CTX *srcctx = (PROV_ML_DSA_CTX *)vctx;
+    PROV_ML_DSA_CTX *dstctx;

     if (!ossl_prov_is_running())
         return NULL;
@@ -93,7 +118,32 @@ static void *ml_dsa_dupctx(void *vctx)
      * Note that the ML_DSA_KEY is ref counted via EVP_PKEY so we can just copy
      * the key here.
      */
-    return OPENSSL_memdup(srcctx, sizeof(*srcctx));
+    dstctx = OPENSSL_memdup(srcctx, sizeof(*srcctx));
+
+    if (dstctx == NULL)
+        return NULL;
+
+    if (srcctx->sig != NULL) {
+        dstctx->sig = OPENSSL_memdup(srcctx->sig, srcctx->siglen);
+        if (dstctx->sig == NULL) {
+            /*
+             * Can't call ml_dsa_freectx() here, as it would free
+             * md_ctx which has not been duplicated yet.
+             */
+            OPENSSL_free(dstctx);
+            return NULL;
+        }
+    }
+
+    if (srcctx->md_ctx != NULL) {
+        dstctx->md_ctx = EVP_MD_CTX_dup(srcctx->md_ctx);
+        if (dstctx->md_ctx == NULL) {
+            ml_dsa_freectx(dstctx);
+            return NULL;
+        }
+    }
+
+    return dstctx;
 }

 static int set_alg_id_buffer(PROV_ML_DSA_CTX *ctx)
@@ -145,6 +195,7 @@ static int ml_dsa_signverify_msg_init(void *vctx, void *vkey,

     set_alg_id_buffer(ctx);
     ctx->mu = 0;
+    ctx->operation = operation;

     return ml_dsa_set_ctx_params(ctx, params);
 }
@@ -152,7 +203,7 @@ static int ml_dsa_signverify_msg_init(void *vctx, void *vkey,
 static int ml_dsa_sign_msg_init(void *vctx, void *vkey, const OSSL_PARAM params[])
 {
     return ml_dsa_signverify_msg_init(vctx, vkey, params,
-        EVP_PKEY_OP_SIGN, "ML_DSA Sign Init");
+        EVP_PKEY_OP_SIGNMSG, "ML_DSA Sign Init");
 }

 static int ml_dsa_digest_signverify_init(void *vctx, const char *mdname,
@@ -175,6 +226,75 @@ static int ml_dsa_digest_signverify_init(void *vctx, const char *mdname,
         EVP_PKEY_OP_SIGN, "ML_DSA Sign Init");
 }

+static int ml_dsa_signverify_msg_update(void *vctx,
+    const unsigned char *data,
+    size_t datalen)
+{
+    PROV_ML_DSA_CTX *ctx = (PROV_ML_DSA_CTX *)vctx;
+
+    if (ctx == NULL)
+        return 0;
+
+    if (!ossl_prov_is_running())
+        return 0;
+
+    if (ctx->mu)
+        return 0;
+
+    if (ctx->md_ctx == NULL) {
+        ctx->md_ctx = ossl_ml_dsa_mu_init(ctx->key, ctx->msg_encode,
+            ctx->context_string,
+            ctx->context_string_len);
+        if (ctx->md_ctx == NULL)
+            return 0;
+    }
+
+    return ossl_ml_dsa_mu_update(ctx->md_ctx, data, datalen);
+}
+
+static int ml_dsa_sign_msg_final(void *vctx, unsigned char *sig,
+    size_t *siglen, size_t sigsize)
+{
+    PROV_ML_DSA_CTX *ctx = (PROV_ML_DSA_CTX *)vctx;
+    uint8_t rand_tmp[ML_DSA_ENTROPY_LEN], *rnd = NULL;
+    uint8_t mu[ML_DSA_MU_BYTES];
+    int ret = 0;
+
+    if (ctx == NULL)
+        return 0;
+
+    if (!ossl_prov_is_running())
+        return 0;
+
+    if (ctx->md_ctx == NULL)
+        return 0;
+
+    if (sig != NULL) {
+        if (ctx->test_entropy_len != 0) {
+            rnd = ctx->test_entropy;
+        } else {
+            rnd = rand_tmp;
+
+            if (ctx->deterministic == 1)
+                memset(rnd, 0, sizeof(rand_tmp));
+            else if (RAND_priv_bytes_ex(ctx->libctx, rnd, sizeof(rand_tmp), 0) <= 0)
+                return 0;
+        }
+
+        if (!ossl_ml_dsa_mu_finalize(ctx->md_ctx, mu, sizeof(mu))) {
+            OPENSSL_cleanse(mu, sizeof(mu));
+            return 0;
+        }
+    }
+
+    ret = ossl_ml_dsa_sign(ctx->key, 1, mu, sizeof(mu), NULL, 0, rnd,
+        sizeof(rand_tmp), 0, sig, siglen, sigsize);
+    if (rnd != ctx->test_entropy)
+        OPENSSL_cleanse(rand_tmp, sizeof(rand_tmp));
+    OPENSSL_cleanse(mu, sizeof(mu));
+    return ret;
+}
+
 static int ml_dsa_sign(void *vctx, uint8_t *sig, size_t *siglen, size_t sigsize,
     const uint8_t *msg, size_t msg_len)
 {
@@ -214,10 +334,30 @@ static int ml_dsa_digest_sign(void *vctx, uint8_t *sig, size_t *siglen, size_t s

 static int ml_dsa_verify_msg_init(void *vctx, void *vkey, const OSSL_PARAM params[])
 {
-    return ml_dsa_signverify_msg_init(vctx, vkey, params, EVP_PKEY_OP_VERIFY,
+    return ml_dsa_signverify_msg_init(vctx, vkey, params, EVP_PKEY_OP_VERIFYMSG,
         "ML_DSA Verify Init");
 }

+static int ml_dsa_verify_msg_final(void *vctx)
+{
+    PROV_ML_DSA_CTX *ctx = (PROV_ML_DSA_CTX *)vctx;
+    uint8_t mu[ML_DSA_MU_BYTES];
+    int ret = 0;
+
+    if (!ossl_prov_is_running())
+        return 0;
+
+    if (ctx->md_ctx == NULL)
+        return 0;
+
+    if (ossl_ml_dsa_mu_finalize(ctx->md_ctx, mu, sizeof(mu)))
+        ret = ossl_ml_dsa_verify(ctx->key, 1, mu, sizeof(mu), NULL, 0, 0,
+            ctx->sig, ctx->siglen);
+
+    OPENSSL_cleanse(mu, sizeof(mu));
+    return ret;
+}
+
 static int ml_dsa_verify(void *vctx, const uint8_t *sig, size_t siglen,
     const uint8_t *msg, size_t msg_len)
 {
@@ -236,32 +376,34 @@ static int ml_dsa_digest_verify(void *vctx,
     return ml_dsa_verify(vctx, sig, siglen, tbs, tbslen);
 }

+/*
+ * Only need the param list for the signing case.  The decoder and structure
+ * are shared between the sign and verify cases.
+ */
+
 static int ml_dsa_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_ML_DSA_CTX *pctx = (PROV_ML_DSA_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct ml_dsa_verifymsg_set_ctx_params_st p;

-    if (pctx == NULL)
+    if (pctx == NULL || !ml_dsa_verifymsg_set_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_CONTEXT_STRING);
-    if (p != NULL) {
+    if (p.ctx != NULL) {
         void *vp = pctx->context_string;

-        if (!OSSL_PARAM_get_octet_string(p, &vp, sizeof(pctx->context_string),
+        if (!OSSL_PARAM_get_octet_string(p.ctx, &vp, sizeof(pctx->context_string),
                 &(pctx->context_string_len))) {
             pctx->context_string_len = 0;
             return 0;
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_TEST_ENTROPY);
-    if (p != NULL) {
+
+    if (p.ent != NULL) {
         void *vp = pctx->test_entropy;

         pctx->test_entropy_len = 0;
-        if (!OSSL_PARAM_get_octet_string(p, &vp, sizeof(pctx->test_entropy),
+        if (!OSSL_PARAM_get_octet_string(p.ent, &vp, sizeof(pctx->test_entropy),
                 &(pctx->test_entropy_len)))
             return 0;
         if (pctx->test_entropy_len != sizeof(pctx->test_entropy)) {
@@ -270,70 +412,65 @@ static int ml_dsa_set_ctx_params(void *vctx, const OSSL_PARAM params[])
             return 0;
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DETERMINISTIC);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &pctx->deterministic))
+
+    if (p.det != NULL && !OSSL_PARAM_get_int(p.det, &pctx->deterministic))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &pctx->msg_encode))
+    if (p.msgenc != NULL && !OSSL_PARAM_get_int(p.msgenc, &pctx->msg_encode))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_MU);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &pctx->mu))
+    if (p.mu != NULL && !OSSL_PARAM_get_int(p.mu, &pctx->mu))
         return 0;

+    if (p.sig != NULL && pctx->operation == EVP_PKEY_OP_VERIFYMSG) {
+        OPENSSL_free(pctx->sig);
+        pctx->sig = NULL;
+        pctx->siglen = 0;
+        if (!OSSL_PARAM_get_octet_string(p.sig, (void **)&pctx->sig,
+                0, &pctx->siglen))
+            return 0;
+    }
+
     return 1;
 }

 static const OSSL_PARAM *ml_dsa_settable_ctx_params(void *vctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM settable_ctx_params[] = {
-        OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_CONTEXT_STRING, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_TEST_ENTROPY, NULL, 0),
-        OSSL_PARAM_int(OSSL_SIGNATURE_PARAM_DETERMINISTIC, 0),
-        OSSL_PARAM_int(OSSL_SIGNATURE_PARAM_MU, 0),
-        OSSL_PARAM_int(OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING, 0),
-        OSSL_PARAM_END
-    };
-
-    return settable_ctx_params;
-}
+    PROV_ML_DSA_CTX *pctx = (PROV_ML_DSA_CTX *)vctx;

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0),
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
+    if (pctx != NULL && pctx->operation == EVP_PKEY_OP_VERIFYMSG)
+        return ml_dsa_verifymsg_set_ctx_params_list;
+    else
+        return ml_dsa_set_ctx_params_list;
+}

 static const OSSL_PARAM *ml_dsa_gettable_ctx_params(ossl_unused void *vctx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return ml_dsa_get_ctx_params_list;
 }

 static int ml_dsa_get_ctx_params(void *vctx, OSSL_PARAM *params)
 {
     PROV_ML_DSA_CTX *ctx = (PROV_ML_DSA_CTX *)vctx;
-    OSSL_PARAM *p;
+    struct ml_dsa_get_ctx_params_st p;

-    if (ctx == NULL)
+    if (ctx == NULL || !ml_dsa_get_ctx_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_ALGORITHM_ID);
-    if (p != NULL
-        && !OSSL_PARAM_set_octet_string(p,
+    if (p.id != NULL
+        && !OSSL_PARAM_set_octet_string(p.id,
             ctx->aid_len == 0 ? NULL : ctx->aid_buf,
             ctx->aid_len))
         return 0;

-#ifdef FIPS_MODULE
-    return ossl_FIPS_IND_get_ctx_param_conditional(NULL, params,
-        ctx->test_entropy_len == 0
-            && ctx->msg_encode == ML_DSA_MESSAGE_ENCODE_PURE);
-#else
+    if (!OSSL_FIPS_IND_GET_PARAM_CONDITIONAL(p.ind,
+            ctx->test_entropy_len == 0
+                && ctx->msg_encode == ML_DSA_MESSAGE_ENCODE_PURE))
+        return 0;
+
     return 1;
-#endif
 }

 #define MAKE_SIGNATURE_FUNCTIONS(alg)                                          \
@@ -346,9 +483,17 @@ static int ml_dsa_get_ctx_params(void *vctx, OSSL_PARAM *params)
         { OSSL_FUNC_SIGNATURE_NEWCTX, (void (*)(void))ml_dsa_##alg##_newctx }, \
         { OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_INIT,                               \
             (void (*)(void))ml_dsa_sign_msg_init },                            \
+        { OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_UPDATE,                             \
+            (void (*)(void))ml_dsa_signverify_msg_update },                    \
+        { OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_FINAL,                              \
+            (void (*)(void))ml_dsa_sign_msg_final },                           \
         { OSSL_FUNC_SIGNATURE_SIGN, (void (*)(void))ml_dsa_sign },             \
         { OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_INIT,                             \
             (void (*)(void))ml_dsa_verify_msg_init },                          \
+        { OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_UPDATE,                           \
+            (void (*)(void))ml_dsa_signverify_msg_update },                    \
+        { OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_FINAL,                            \
+            (void (*)(void))ml_dsa_verify_msg_final },                         \
         { OSSL_FUNC_SIGNATURE_VERIFY, (void (*)(void))ml_dsa_verify },         \
         { OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT,                                \
             (void (*)(void))ml_dsa_digest_signverify_init },                   \
diff --git a/deps/openssl/openssl/providers/implementations/signature/ml_dsa_sig.inc.in b/deps/openssl/openssl/providers/implementations/signature/ml_dsa_sig.inc.in
new file mode 100644
index 00000000000..8ed0873e991
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/signature/ml_dsa_sig.inc.in
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ml_dsa_set_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_CONTEXT_STRING',   'ctx',    'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_TEST_ENTROPY',     'ent',    'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_DETERMINISTIC',    'det',    'int'],
+                          ['OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING', 'msgenc', 'int'],
+                          ['OSSL_SIGNATURE_PARAM_MU',               'mu',     'int'],
+                         )); -}
+
+{- produce_param_decoder('ml_dsa_verifymsg_set_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_CONTEXT_STRING',   'ctx',    'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_TEST_ENTROPY',     'ent',    'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_DETERMINISTIC',    'det',    'int'],
+                          ['OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING', 'msgenc', 'int'],
+                          ['OSSL_SIGNATURE_PARAM_MU',               'mu',     'int'],
+                          ['OSSL_SIGNATURE_PARAM_SIGNATURE',        'sig',    'octet_string'],
+                         )); -}
+
+{- produce_param_decoder('ml_dsa_get_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'id', 'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/signature/rsa_sig.c b/deps/openssl/openssl/providers/implementations/signature/rsa_sig.c
index e29a0656574..ffcaf49fd56 100644
--- a/deps/openssl/openssl/providers/implementations/signature/rsa_sig.c
+++ b/deps/openssl/openssl/providers/implementations/signature/rsa_sig.c
@@ -13,6 +13,7 @@
  */
 #include "internal/deprecated.h"

+#include <stdio.h>
 #include <string.h>
 #include <openssl/crypto.h>
 #include <openssl/core_dispatch.h>
@@ -32,6 +33,11 @@
 #include "prov/provider_ctx.h"
 #include "prov/der_rsa.h"
 #include "prov/securitycheck.h"
+#include "internal/fips.h"
+
+#define rsa_set_ctx_params_no_digest_st rsa_set_ctx_params_st
+
+#include "providers/implementations/signature/rsa_sig.inc"

 #define RSA_DEFAULT_DIGEST_NAME OSSL_DIGEST_NAME_SHA1

@@ -160,7 +166,7 @@ typedef struct {
 /* True if PSS parameters are restricted */
 #define rsa_pss_restricted(prsactx) (prsactx->min_saltlen != -1)

-static size_t rsa_get_md_size(const PROV_RSA_CTX *prsactx)
+static int rsa_get_md_size(const PROV_RSA_CTX *prsactx)
 {
     int md_size;

@@ -232,6 +238,12 @@ static void *rsa_newctx(void *provctx, const char *propq)
     if (!ossl_prov_is_running())
         return NULL;

+#ifdef FIPS_MODULE
+    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
+            ST_ID_SIG_RSA_SHA256))
+        return NULL;
+#endif
+
     if ((prsactx = OPENSSL_zalloc(sizeof(PROV_RSA_CTX))) == NULL
         || (propq != NULL
             && (propq_copy = OPENSSL_strdup(propq)) == NULL)) {
@@ -413,7 +425,7 @@ static int rsa_setup_md(PROV_RSA_CTX *ctx, const char *mdname,
                     OSSL_FIPS_IND_SETTABLE1,
                     ctx->libctx,
                     md_nid, sha1_allowed, 1, desc,
-                    ossl_fips_config_signature_digest_check))
+                    FIPS_CONFIG_SIGNATURE_DIGEST_CHECK))
                 goto err;
         }
 #endif
@@ -645,7 +657,7 @@ static int rsa_pss_saltlen_check_passed(PROV_RSA_CTX *ctx, const char *algoname,
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE3,
                 ctx->libctx,
                 algoname, "PSS Salt Length",
-                ossl_fips_config_rsa_pss_saltlen_check)) {
+                FIPS_CONFIG_RSA_PSS_SALTLEN_CHECK)) {
             ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_SALT_LENGTH);
             return 0;
         }
@@ -710,8 +722,8 @@ static int rsa_sign_directly(PROV_RSA_CTX *prsactx,
                     "only PKCS#1 padding supported with MDC2");
                 return 0;
             }
-            ret = RSA_sign_ASN1_OCTET_STRING(0, tbs, tbslen, sig, &sltmp,
-                prsactx->rsa);
+            ret = RSA_sign_ASN1_OCTET_STRING(0, tbs, (unsigned int)tbslen, sig,
+                &sltmp, prsactx->rsa);

             if (ret <= 0) {
                 ERR_raise(ERR_LIB_PROV, ERR_R_RSA_LIB);
@@ -735,15 +747,15 @@ static int rsa_sign_directly(PROV_RSA_CTX *prsactx,
             }
             memcpy(prsactx->tbuf, tbs, tbslen);
             prsactx->tbuf[tbslen] = RSA_X931_hash_id(prsactx->mdnid);
-            ret = RSA_private_encrypt(tbslen + 1, prsactx->tbuf,
+            ret = RSA_private_encrypt((int)(tbslen + 1), prsactx->tbuf,
                 sig, prsactx->rsa, RSA_X931_PADDING);
             clean_tbuf(prsactx);
             break;
         case RSA_PKCS1_PADDING: {
             unsigned int sltmp;

-            ret = RSA_sign(prsactx->mdnid, tbs, tbslen, sig, &sltmp,
-                prsactx->rsa);
+            ret = RSA_sign(prsactx->mdnid, tbs, (unsigned int)tbslen,
+                sig, &sltmp, prsactx->rsa);
             if (ret <= 0) {
                 ERR_raise(ERR_LIB_PROV, ERR_R_RSA_LIB);
                 return 0;
@@ -807,7 +819,7 @@ static int rsa_sign_directly(PROV_RSA_CTX *prsactx,
             return 0;
         }
     } else {
-        ret = RSA_private_encrypt(tbslen, tbs, sig, prsactx->rsa,
+        ret = RSA_private_encrypt((int)tbslen, tbs, sig, prsactx->rsa,
             prsactx->pad_mode);
     }

@@ -946,7 +958,7 @@ static int rsa_verify_recover(void *vprsactx,
         case RSA_X931_PADDING:
             if (!setup_tbuf(prsactx))
                 return 0;
-            ret = RSA_public_decrypt(siglen, sig, prsactx->tbuf, prsactx->rsa,
+            ret = RSA_public_decrypt((int)siglen, sig, prsactx->tbuf, prsactx->rsa,
                 RSA_X931_PADDING);
             if (ret <= 0) {
                 ERR_raise(ERR_LIB_PROV, ERR_R_RSA_LIB);
@@ -996,7 +1008,7 @@ static int rsa_verify_recover(void *vprsactx,
                 ERR_raise(ERR_LIB_PROV, ERR_R_RSA_LIB);
                 return 0;
             }
-            ret = sltmp;
+            ret = (int)sltmp;
         } break;

         default:
@@ -1055,8 +1067,8 @@ static int rsa_verify_directly(PROV_RSA_CTX *prsactx,
     if (prsactx->md != NULL) {
         switch (prsactx->pad_mode) {
         case RSA_PKCS1_PADDING:
-            if (!RSA_verify(prsactx->mdnid, tbs, tbslen, sig, siglen,
-                    prsactx->rsa)) {
+            if (!RSA_verify(prsactx->mdnid, tbs, (unsigned int)tbslen,
+                    sig, (unsigned int)siglen, prsactx->rsa)) {
                 ERR_raise(ERR_LIB_PROV, ERR_R_RSA_LIB);
                 return 0;
             }
@@ -1088,7 +1100,7 @@ static int rsa_verify_directly(PROV_RSA_CTX *prsactx,

             if (!setup_tbuf(prsactx))
                 return 0;
-            ret = RSA_public_decrypt(siglen, sig, prsactx->tbuf,
+            ret = RSA_public_decrypt((int)siglen, sig, prsactx->tbuf,
                 prsactx->rsa, RSA_NO_PADDING);
             if (ret <= 0) {
                 ERR_raise(ERR_LIB_PROV, ERR_R_RSA_LIB);
@@ -1119,7 +1131,7 @@ static int rsa_verify_directly(PROV_RSA_CTX *prsactx,

         if (!setup_tbuf(prsactx))
             return 0;
-        ret = RSA_public_decrypt(siglen, sig, prsactx->tbuf, prsactx->rsa,
+        ret = RSA_public_decrypt((int)siglen, sig, prsactx->tbuf, prsactx->rsa,
             prsactx->pad_mode);
         if (ret <= 0) {
             ERR_raise(ERR_LIB_PROV, ERR_R_RSA_LIB);
@@ -1410,13 +1422,12 @@ err:
 static int rsa_get_ctx_params(void *vprsactx, OSSL_PARAM *params)
 {
     PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
-    OSSL_PARAM *p;
+    struct rsa_get_ctx_params_st p;

-    if (prsactx == NULL)
+    if (prsactx == NULL || !rsa_get_ctx_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_ALGORITHM_ID);
-    if (p != NULL) {
+    if (p.algid != NULL) {
         /* The Algorithm Identifier of the combined signature algorithm */
         unsigned char aid_buf[128];
         unsigned char *aid;
@@ -1424,18 +1435,15 @@ static int rsa_get_ctx_params(void *vprsactx, OSSL_PARAM *params)

         aid = rsa_generate_signature_aid(prsactx, aid_buf,
             sizeof(aid_buf), &aid_len);
-        if (aid == NULL || !OSSL_PARAM_set_octet_string(p, aid, aid_len))
+        if (aid == NULL || !OSSL_PARAM_set_octet_string(p.algid, aid, aid_len))
             return 0;
     }

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_PAD_MODE);
-    if (p != NULL)
-        switch (p->data_type) {
-        case OSSL_PARAM_INTEGER:
-            if (!OSSL_PARAM_set_int(p, prsactx->pad_mode))
+    if (p.pad != NULL) {
+        if (p.pad->data_type != OSSL_PARAM_UTF8_STRING) {
+            if (!OSSL_PARAM_set_int(p.pad, prsactx->pad_mode))
                 return 0;
-            break;
-        case OSSL_PARAM_UTF8_STRING: {
+        } else {
             int i;
             const char *word = NULL;

@@ -1447,30 +1455,25 @@ static int rsa_get_ctx_params(void *vprsactx, OSSL_PARAM *params)
             }

             if (word != NULL) {
-                if (!OSSL_PARAM_set_utf8_string(p, word))
+                if (!OSSL_PARAM_set_utf8_string(p.pad, word))
                     return 0;
             } else {
                 ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
             }
-        } break;
-        default:
-            return 0;
         }
+    }

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_DIGEST);
-    if (p != NULL && !OSSL_PARAM_set_utf8_string(p, prsactx->mdname))
+    if (p.digest != NULL && !OSSL_PARAM_set_utf8_string(p.digest, prsactx->mdname))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_MGF1_DIGEST);
-    if (p != NULL && !OSSL_PARAM_set_utf8_string(p, prsactx->mgf1_mdname))
+    if (p.mgf1 != NULL && !OSSL_PARAM_set_utf8_string(p.mgf1, prsactx->mgf1_mdname))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_PSS_SALTLEN);
-    if (p != NULL) {
-        if (p->data_type == OSSL_PARAM_INTEGER) {
-            if (!OSSL_PARAM_set_int(p, prsactx->saltlen))
+    if (p.slen != NULL) {
+        if (p.slen->data_type != OSSL_PARAM_UTF8_STRING) {
+            if (!OSSL_PARAM_set_int(p.slen, prsactx->saltlen))
                 return 0;
-        } else if (p->data_type == OSSL_PARAM_UTF8_STRING) {
+        } else {
             const char *value = NULL;

             switch (prsactx->saltlen) {
@@ -1487,50 +1490,36 @@ static int rsa_get_ctx_params(void *vprsactx, OSSL_PARAM *params)
                 value = OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO_DIGEST_MAX;
                 break;
             default: {
-                int len = BIO_snprintf(p->data, p->data_size, "%d",
+                int len = snprintf(p.slen->data, p.slen->data_size, "%d",
                     prsactx->saltlen);

-                if (len <= 0)
+                if (len <= 0 || (size_t)len >= p.slen->data_size)
                     return 0;
-                p->return_size = len;
+                p.slen->return_size = len;
                 break;
             }
             }
             if (value != NULL
-                && !OSSL_PARAM_set_utf8_string(p, value))
+                && !OSSL_PARAM_set_utf8_string(p.slen, value))
                 return 0;
         }
     }

 #ifdef FIPS_MODULE
-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE);
-    if (p != NULL && !OSSL_PARAM_set_uint(p, prsactx->verify_message))
+    if (p.verify != NULL && !OSSL_PARAM_set_uint(p.verify, prsactx->verify_message))
         return 0;
 #endif

-    if (!OSSL_FIPS_IND_GET_CTX_PARAM_CONDITIONAL(prsactx, params,
+    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM_CONDITIONAL(prsactx, p.ind,
             prsactx->verify_message))
         return 0;
     return 1;
 }

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_PAD_MODE, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_MGF1_DIGEST, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_PSS_SALTLEN, NULL, 0),
-#ifdef FIPS_MODULE
-    OSSL_PARAM_uint(OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE, NULL),
-#endif
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *rsa_gettable_ctx_params(ossl_unused void *vprsactx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return rsa_get_ctx_params_list;
 }

 #ifdef FIPS_MODULE
@@ -1542,7 +1531,7 @@ static int rsa_x931_padding_allowed(PROV_RSA_CTX *ctx)
         if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE2,
                 ctx->libctx,
                 "RSA Sign set ctx", "X931 Padding",
-                ossl_fips_config_rsa_sign_x931_disallowed)) {
+                FIPS_CONFIG_RSA_SIGN_X931_PAD_DISABLED)) {
             ERR_raise(ERR_LIB_PROV,
                 PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE);
             return 0;
@@ -1555,9 +1544,10 @@ static int rsa_x931_padding_allowed(PROV_RSA_CTX *ctx)
 static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
 {
     PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
-    const OSSL_PARAM *p;
+    struct rsa_set_ctx_params_st p;
     int pad_mode;
     int saltlen;
+    int count = 0;
     char mdname[OSSL_MAX_NAME_SIZE] = "", *pmdname = NULL;
     char mdprops[OSSL_MAX_PROPQUERY_SIZE] = "", *pmdprops = NULL;
     char mgf1mdname[OSSL_MAX_NAME_SIZE] = "", *pmgf1mdname = NULL;
@@ -1565,69 +1555,71 @@ static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])

     if (prsactx == NULL)
         return 0;
+    /* The processing code below doesn't handle no parameters properly */
     if (ossl_param_is_empty(params))
         return 1;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE0, params,
-            OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK))
+    if (prsactx->flag_allow_md) {
+        if (!rsa_set_ctx_params_decoder(params, &p, &count))
+            return 0;
+    } else {
+        if (!rsa_set_ctx_params_no_digest_decoder(params, &p, &count))
+            return 0;
+    }
+    if (count == 0)
+        return 1;
+
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE0,
+            p.ind_k))
         return 0;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE1, params,
-            OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE1,
+            p.ind_d))
         return 0;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE2, params,
-            OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE2,
+            p.ind_xpad))
         return 0;

-    if (!OSSL_FIPS_IND_SET_CTX_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE3, params,
-            OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK))
+    if (!OSSL_FIPS_IND_SET_CTX_FROM_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE3,
+            p.ind_slen))
         return 0;

     pad_mode = prsactx->pad_mode;
     saltlen = prsactx->saltlen;

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DIGEST);
-    if (p != NULL) {
-        const OSSL_PARAM *propsp = OSSL_PARAM_locate_const(params,
-            OSSL_SIGNATURE_PARAM_PROPERTIES);
-
+    if (p.digest != NULL) {
         pmdname = mdname;
-        if (!OSSL_PARAM_get_utf8_string(p, &pmdname, sizeof(mdname)))
+        if (!OSSL_PARAM_get_utf8_string(p.digest, &pmdname, sizeof(mdname)))
             return 0;

-        if (propsp != NULL) {
+        if (p.propq != NULL) {
             pmdprops = mdprops;
-            if (!OSSL_PARAM_get_utf8_string(propsp,
+            if (!OSSL_PARAM_get_utf8_string(p.propq,
                     &pmdprops, sizeof(mdprops)))
                 return 0;
         }
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_PAD_MODE);
-    if (p != NULL) {
+    if (p.pad != NULL) {
         const char *err_extra_text = NULL;

-        switch (p->data_type) {
-        case OSSL_PARAM_INTEGER: /* Support for legacy pad mode number */
-            if (!OSSL_PARAM_get_int(p, &pad_mode))
+        if (p.pad->data_type != OSSL_PARAM_UTF8_STRING) {
+            /* Support for legacy pad mode number */
+            if (!OSSL_PARAM_get_int(p.pad, &pad_mode))
                 return 0;
-            break;
-        case OSSL_PARAM_UTF8_STRING: {
+        } else {
             int i;

-            if (p->data == NULL)
+            if (p.pad->data == NULL)
                 return 0;

             for (i = 0; padding_item[i].id != 0; i++) {
-                if (strcmp(p->data, padding_item[i].ptr) == 0) {
+                if (strcmp(p.pad->data, padding_item[i].ptr) == 0) {
                     pad_mode = padding_item[i].id;
                     break;
                 }
             }
-        } break;
-        default:
-            return 0;
         }

         switch (pad_mode) {
@@ -1684,8 +1676,7 @@ static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
         }
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_PSS_SALTLEN);
-    if (p != NULL) {
+    if (p.slen != NULL) {
         if (pad_mode != RSA_PKCS1_PSS_PADDING) {
             ERR_raise_data(ERR_LIB_PROV, PROV_R_NOT_SUPPORTED,
                 "PSS saltlen can only be specified if "
@@ -1693,25 +1684,24 @@ static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
             return 0;
         }

-        switch (p->data_type) {
-        case OSSL_PARAM_INTEGER: /* Support for legacy pad mode number */
-            if (!OSSL_PARAM_get_int(p, &saltlen))
+        if (p.slen->data_type != OSSL_PARAM_UTF8_STRING) {
+            /* Support for legacy pad mode number */
+            if (!OSSL_PARAM_get_int(p.slen, &saltlen))
                 return 0;
-            break;
-        case OSSL_PARAM_UTF8_STRING:
-            if (strcmp(p->data, OSSL_PKEY_RSA_PSS_SALT_LEN_DIGEST) == 0)
+        } else {
+            if (strcmp(p.slen->data, OSSL_PKEY_RSA_PSS_SALT_LEN_DIGEST) == 0)
                 saltlen = RSA_PSS_SALTLEN_DIGEST;
-            else if (strcmp(p->data, OSSL_PKEY_RSA_PSS_SALT_LEN_MAX) == 0)
+            else if (strcmp(p.slen->data, OSSL_PKEY_RSA_PSS_SALT_LEN_MAX) == 0)
                 saltlen = RSA_PSS_SALTLEN_MAX;
-            else if (strcmp(p->data, OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO) == 0)
+            else if (strcmp(p.slen->data, OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO) == 0)
                 saltlen = RSA_PSS_SALTLEN_AUTO;
-            else if (strcmp(p->data, OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO_DIGEST_MAX) == 0)
+            else if (strcmp(p.slen->data, OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO_DIGEST_MAX) == 0)
                 saltlen = RSA_PSS_SALTLEN_AUTO_DIGEST_MAX;
-            else
-                saltlen = atoi(p->data);
-            break;
-        default:
-            return 0;
+            else if (!ossl_strtoint(p.slen->data, NULL, 10, &saltlen)) {
+                ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_SALT_LENGTH,
+                    "invalid RSA-PSS saltlen value");
+                return 0;
+            }
         }

         /*
@@ -1760,18 +1750,14 @@ static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
         }
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_MGF1_DIGEST);
-    if (p != NULL) {
-        const OSSL_PARAM *propsp = OSSL_PARAM_locate_const(params,
-            OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES);
-
+    if (p.mgf1 != NULL) {
         pmgf1mdname = mgf1mdname;
-        if (!OSSL_PARAM_get_utf8_string(p, &pmgf1mdname, sizeof(mgf1mdname)))
+        if (!OSSL_PARAM_get_utf8_string(p.mgf1, &pmgf1mdname, sizeof(mgf1mdname)))
             return 0;

-        if (propsp != NULL) {
+        if (p.mgf1pq != NULL) {
             pmgf1mdprops = mgf1mdprops;
-            if (!OSSL_PARAM_get_utf8_string(propsp,
+            if (!OSSL_PARAM_get_utf8_string(p.mgf1pq,
                     &pmgf1mdprops, sizeof(mgf1mdprops)))
                 return 0;
         }
@@ -1803,40 +1789,14 @@ static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
     return 1;
 }

-static const OSSL_PARAM settable_ctx_params[] = {
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_PROPERTIES, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_PAD_MODE, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_MGF1_DIGEST, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_PSS_SALTLEN, NULL, 0),
-    OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK)
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK)
-            OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK)
-                OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK)
-                    OSSL_PARAM_END
-};
-
-static const OSSL_PARAM settable_ctx_params_no_digest[] = {
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_PAD_MODE, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_MGF1_DIGEST, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES, NULL, 0),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_PSS_SALTLEN, NULL, 0),
-    OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK)
-        OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK)
-            OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK)
-                OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK)
-                    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *rsa_settable_ctx_params(void *vprsactx,
     ossl_unused void *provctx)
 {
     PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;

     if (prsactx != NULL && !prsactx->flag_allow_md)
-        return settable_ctx_params_no_digest;
-    return settable_ctx_params;
+        return rsa_set_ctx_params_no_digest_list;
+    return rsa_set_ctx_params_list;
 }

 static int rsa_get_ctx_md_params(void *vprsactx, OSSL_PARAM *params)
@@ -1989,38 +1949,30 @@ static const char **rsa_sigalg_query_key_types(void)
     return keytypes;
 }

-static const OSSL_PARAM settable_sigalg_ctx_params[] = {
-    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_SIGNATURE, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *rsa_sigalg_settable_ctx_params(void *vprsactx,
     ossl_unused void *provctx)
 {
     PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;

     if (prsactx != NULL && prsactx->operation == EVP_PKEY_OP_VERIFYMSG)
-        return settable_sigalg_ctx_params;
+        return rsa_sigalg_set_ctx_params_list;
     return NULL;
 }

 static int rsa_sigalg_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
 {
     PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
-    const OSSL_PARAM *p;
+    struct rsa_sigalg_set_ctx_params_st p;

-    if (prsactx == NULL)
+    if (prsactx == NULL || !rsa_sigalg_set_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

     if (prsactx->operation == EVP_PKEY_OP_VERIFYMSG) {
-        p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_SIGNATURE);
-        if (p != NULL) {
+        if (p.sig != NULL) {
             OPENSSL_free(prsactx->sig);
             prsactx->sig = NULL;
             prsactx->siglen = 0;
-            if (!OSSL_PARAM_get_octet_string(p, (void **)&prsactx->sig,
+            if (!OSSL_PARAM_get_octet_string(p.sig, (void **)&prsactx->sig,
                     0, &prsactx->siglen))
                 return 0;
         }
@@ -2044,7 +1996,7 @@ static int rsa_sigalg_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
                                                                       \
         return rsa_sigalg_signverify_init(vprsactx, vrsa,             \
             rsa_sigalg_set_ctx_params,                                \
-            params, #MD,                                              \
+            params, MD,                                               \
             EVP_PKEY_OP_SIGN,                                         \
             RSA_PKCS1_PADDING,                                        \
             desc);                                                    \
@@ -2058,7 +2010,7 @@ static int rsa_sigalg_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
                                                                       \
         return rsa_sigalg_signverify_init(vprsactx, vrsa,             \
             rsa_sigalg_set_ctx_params,                                \
-            params, #MD,                                              \
+            params, MD,                                               \
             EVP_PKEY_OP_SIGNMSG,                                      \
             RSA_PKCS1_PADDING,                                        \
             desc);                                                    \
@@ -2072,7 +2024,7 @@ static int rsa_sigalg_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
                                                                       \
         return rsa_sigalg_signverify_init(vprsactx, vrsa,             \
             rsa_sigalg_set_ctx_params,                                \
-            params, #MD,                                              \
+            params, MD,                                               \
             EVP_PKEY_OP_VERIFY,                                       \
             RSA_PKCS1_PADDING,                                        \
             desc);                                                    \
@@ -2086,7 +2038,7 @@ static int rsa_sigalg_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
                                                                       \
         return rsa_sigalg_signverify_init(vprsactx, vrsa,             \
             rsa_sigalg_set_ctx_params,                                \
-            params, #MD,                                              \
+            params, MD,                                               \
             EVP_PKEY_OP_VERIFYRECOVER,                                \
             RSA_PKCS1_PADDING,                                        \
             desc);                                                    \
@@ -2100,7 +2052,7 @@ static int rsa_sigalg_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
                                                                       \
         return rsa_sigalg_signverify_init(vprsactx, vrsa,             \
             rsa_sigalg_set_ctx_params,                                \
-            params, #MD,                                              \
+            params, MD,                                               \
             EVP_PKEY_OP_VERIFYMSG,                                    \
             RSA_PKCS1_PADDING,                                        \
             desc);                                                    \
@@ -2146,22 +2098,20 @@ static int rsa_sigalg_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
         OSSL_DISPATCH_END                                             \
     }

-/* clang-format off */
 #if !defined(OPENSSL_NO_RMD160) && !defined(FIPS_MODULE)
-IMPL_RSA_SIGALG(ripemd160, RIPEMD160);
+IMPL_RSA_SIGALG(ripemd160, "RIPEMD160");
 #endif
-IMPL_RSA_SIGALG(sha1, SHA1);
-IMPL_RSA_SIGALG(sha224, SHA2-224);
-IMPL_RSA_SIGALG(sha256, SHA2-256);
-IMPL_RSA_SIGALG(sha384, SHA2-384);
-IMPL_RSA_SIGALG(sha512, SHA2-512);
-IMPL_RSA_SIGALG(sha512_224, SHA2-512/224);
-IMPL_RSA_SIGALG(sha512_256, SHA2-512/256);
-IMPL_RSA_SIGALG(sha3_224, SHA3-224);
-IMPL_RSA_SIGALG(sha3_256, SHA3-256);
-IMPL_RSA_SIGALG(sha3_384, SHA3-384);
-IMPL_RSA_SIGALG(sha3_512, SHA3-512);
+IMPL_RSA_SIGALG(sha1, "SHA1");
+IMPL_RSA_SIGALG(sha224, "SHA2-224");
+IMPL_RSA_SIGALG(sha256, "SHA2-256");
+IMPL_RSA_SIGALG(sha384, "SHA2-384");
+IMPL_RSA_SIGALG(sha512, "SHA2-512");
+IMPL_RSA_SIGALG(sha512_224, "SHA2-512/224");
+IMPL_RSA_SIGALG(sha512_256, "SHA2-512/256");
+IMPL_RSA_SIGALG(sha3_224, "SHA3-224");
+IMPL_RSA_SIGALG(sha3_256, "SHA3-256");
+IMPL_RSA_SIGALG(sha3_384, "SHA3-384");
+IMPL_RSA_SIGALG(sha3_512, "SHA3-512");
 #if !defined(OPENSSL_NO_SM3) && !defined(FIPS_MODULE)
-IMPL_RSA_SIGALG(sm3, SM3);
+IMPL_RSA_SIGALG(sm3, "SM3");
 #endif
-/* clang-format on */
diff --git a/deps/openssl/openssl/providers/implementations/signature/rsa_sig.inc.in b/deps/openssl/openssl/providers/implementations/signature/rsa_sig.inc.in
new file mode 100644
index 00000000000..0a6eca38904
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/signature/rsa_sig.inc.in
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder produce_param_decoder_with_count);
+-}
+
+{- produce_param_decoder('rsa_get_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID',            'algid',  'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_PAD_MODE',                'pad',    'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_PAD_MODE',                'pad',    'int'],
+                          ['OSSL_SIGNATURE_PARAM_DIGEST',                  'digest', 'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_MGF1_DIGEST',             'mgf1',   'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN',             'slen',   'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN',             'slen',   'int'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE',     'verify', 'uint', 'fips'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR', 'ind',    'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder_with_count('rsa_set_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_DIGEST',                     'digest',   'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_PROPERTIES',                 'propq',    'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_PAD_MODE',                   'pad',      'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_PAD_MODE',                   'pad',      'int'],
+                          ['OSSL_SIGNATURE_PARAM_MGF1_DIGEST',                'mgf1',     'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES',            'mgf1pq',   'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN',                'slen',     'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN',                'slen',     'int'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK',             'ind_k',    'int', 'fips'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK',          'ind_d',    'int', 'fips'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK', 'ind_slen', 'int', 'fips'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK',   'ind_xpad', 'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder_with_count('rsa_set_ctx_params_no_digest',
+                         (['OSSL_SIGNATURE_PARAM_PAD_MODE',                   'pad',      'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_PAD_MODE',                   'pad',      'int'],
+                          ['OSSL_SIGNATURE_PARAM_MGF1_DIGEST',                'mgf1',     'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES',            'mgf1pq',   'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN',                'slen',     'utf8_string'],
+                          ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN',                'slen',     'int'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK',             'ind_k',    'int', 'fips'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK',          'ind_d',    'int', 'fips'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK', 'ind_slen', 'int', 'fips'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK',   'ind_xpad', 'int', 'fips'],
+                         )); -}
+
+{- produce_param_decoder('rsa_sigalg_set_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_SIGNATURE', 'sig', 'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/signature/slh_dsa_sig.c b/deps/openssl/openssl/providers/implementations/signature/slh_dsa_sig.c
index 13f6f149d9e..7884e808f87 100644
--- a/deps/openssl/openssl/providers/implementations/signature/slh_dsa_sig.c
+++ b/deps/openssl/openssl/providers/implementations/signature/slh_dsa_sig.c
@@ -11,13 +11,17 @@
 #include <openssl/err.h>
 #include <openssl/rand.h>
 #include <openssl/proverr.h>
+#include <openssl/self_test.h>
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
 #include "prov/provider_ctx.h"
 #include "prov/der_slh_dsa.h"
 #include "crypto/slh_dsa.h"
+#include "internal/cryptlib.h"
 #include "internal/sizes.h"
+#include "internal/fips.h"
 #include "fips/fipsindicator.h"
+#include "providers/implementations/signature/slh_dsa_sig.inc"

 #define SLH_DSA_MAX_ADD_RANDOM_LEN 32

@@ -36,6 +40,21 @@ static OSSL_FUNC_signature_dupctx_fn slh_dsa_dupctx;
 static OSSL_FUNC_signature_set_ctx_params_fn slh_dsa_set_ctx_params;
 static OSSL_FUNC_signature_settable_ctx_params_fn slh_dsa_settable_ctx_params;

+static int slh_dsa_self_check(OSSL_LIB_CTX *libctx, const char *alg)
+{
+    if (!ossl_prov_is_running())
+        return 0;
+
+#ifdef FIPS_MODULE
+    if (strstr(alg, "SLH-DSA-SHAKE"))
+        return ossl_deferred_self_test(libctx, ST_ID_SIG_SLH_DSA_SHAKE_128F);
+    else
+        return ossl_deferred_self_test(libctx, ST_ID_SIG_SLH_DSA_SHA2_128F);
+#else
+    return 1;
+#endif
+}
+
 /*
  * NOTE: Any changes to this structure may require updating slh_dsa_dupctx().
  */
@@ -70,7 +89,7 @@ static void *slh_dsa_newctx(void *provctx, const char *alg, const char *propq)
 {
     PROV_SLH_DSA_CTX *ctx;

-    if (!ossl_prov_is_running())
+    if (!slh_dsa_self_check(PROV_LIBCTX_OF(provctx), alg))
         return NULL;

     ctx = OPENSSL_zalloc(sizeof(PROV_SLH_DSA_CTX));
@@ -261,40 +280,37 @@ static int slh_dsa_digest_verify(void *vctx, const uint8_t *sig, size_t siglen,
 static int slh_dsa_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     PROV_SLH_DSA_CTX *pctx = (PROV_SLH_DSA_CTX *)vctx;
-    const OSSL_PARAM *p;
+    struct slh_dsa_set_ctx_params_st p;

-    if (pctx == NULL)
+    if (pctx == NULL || !slh_dsa_set_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_CONTEXT_STRING);
-    if (p != NULL) {
+    if (p.context != NULL) {
         void *vp = pctx->context_string;

-        if (!OSSL_PARAM_get_octet_string(p, &vp, sizeof(pctx->context_string),
+        if (!OSSL_PARAM_get_octet_string(p.context, &vp,
+                sizeof(pctx->context_string),
                 &(pctx->context_string_len))) {
             pctx->context_string_len = 0;
             return 0;
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_TEST_ENTROPY);
-    if (p != NULL) {
+
+    if (p.entropy != NULL) {
         void *vp = pctx->add_random;
         size_t n = ossl_slh_dsa_key_get_n(pctx->key);

-        if (!OSSL_PARAM_get_octet_string(p, &vp, n, &(pctx->add_random_len))
+        if (!OSSL_PARAM_get_octet_string(p.entropy, &vp, n, &(pctx->add_random_len))
             || pctx->add_random_len != n) {
             pctx->add_random_len = 0;
             return 0;
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DETERMINISTIC);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &pctx->deterministic))
+
+    if (p.det != NULL && !OSSL_PARAM_get_int(p.det, &pctx->deterministic))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &pctx->msg_encode))
+    if (p.msgenc != NULL && !OSSL_PARAM_get_int(p.msgenc, &pctx->msg_encode))
         return 0;
     return 1;
 }
@@ -302,50 +318,34 @@ static int slh_dsa_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 static const OSSL_PARAM *slh_dsa_settable_ctx_params(void *vctx,
     ossl_unused void *provctx)
 {
-    static const OSSL_PARAM settable_ctx_params[] = {
-        OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_CONTEXT_STRING, NULL, 0),
-        OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_TEST_ENTROPY, NULL, 0),
-        OSSL_PARAM_int(OSSL_SIGNATURE_PARAM_DETERMINISTIC, 0),
-        OSSL_PARAM_int(OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING, 0),
-        OSSL_PARAM_END
-    };
-
-    return settable_ctx_params;
+    return slh_dsa_set_ctx_params_list;
 }

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0),
-    OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
-        OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *slh_dsa_gettable_ctx_params(ossl_unused void *vctx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return slh_dsa_get_ctx_params_list;
 }

 static int slh_dsa_get_ctx_params(void *vctx, OSSL_PARAM *params)
 {
     PROV_SLH_DSA_CTX *ctx = (PROV_SLH_DSA_CTX *)vctx;
-    OSSL_PARAM *p;
+    struct slh_dsa_get_ctx_params_st p;

-    if (ctx == NULL)
+    if (ctx == NULL || !slh_dsa_get_ctx_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_ALGORITHM_ID);
-    if (p != NULL
-        && !OSSL_PARAM_set_octet_string(p,
+    if (p.algid != NULL
+        && !OSSL_PARAM_set_octet_string(p.algid,
             ctx->aid_len == 0 ? NULL : ctx->aid_buf,
             ctx->aid_len))
         return 0;

-#ifdef FIPS_MODULE
-    return ossl_FIPS_IND_get_ctx_param_conditional(NULL, params,
-        ctx->add_random_len == 0);
-#else
+    if (!OSSL_FIPS_IND_GET_PARAM_CONDITIONAL(p.ind,
+            ctx->add_random_len == 0))
+        return 0;
+
     return 1;
-#endif
 }

 #define MAKE_SIGNATURE_FUNCTIONS(alg, fn)                                               \
diff --git a/deps/openssl/openssl/providers/implementations/signature/slh_dsa_sig.inc.in b/deps/openssl/openssl/providers/implementations/signature/slh_dsa_sig.inc.in
new file mode 100644
index 00000000000..d8c58214196
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/signature/slh_dsa_sig.inc.in
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('slh_dsa_set_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_CONTEXT_STRING',   'context', 'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_TEST_ENTROPY',     'entropy', 'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_DETERMINISTIC',    'det',     'int'],
+                          ['OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING', 'msgenc',  'int'],
+                         )); -}
+
+{- produce_param_decoder('slh_dsa_get_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'algid', 'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/signature/sm2_sig.c b/deps/openssl/openssl/providers/implementations/signature/sm2_sig.c
index 4322e49f592..20ff558605e 100644
--- a/deps/openssl/openssl/providers/implementations/signature/sm2_sig.c
+++ b/deps/openssl/openssl/providers/implementations/signature/sm2_sig.c
@@ -21,6 +21,7 @@
 #include <openssl/params.h>
 #include <openssl/evp.h>
 #include <openssl/err.h>
+#include <openssl/prov_ssl.h>
 #include <openssl/proverr.h>
 #include "internal/nelem.h"
 #include "internal/sizes.h"
@@ -32,6 +33,7 @@
 #include "crypto/ec.h"
 #include "crypto/sm2.h"
 #include "prov/der_sm2.h"
+#include "providers/implementations/signature/sm2_sig.inc"

 static OSSL_FUNC_signature_newctx_fn sm2sig_newctx;
 static OSSL_FUNC_signature_sign_init_fn sm2sig_signature_init;
@@ -178,7 +180,7 @@ static int sm2sig_sign(void *vpsm2ctx, unsigned char *sig, size_t *siglen,
     if (ctx->mdsize != 0 && tbslen != ctx->mdsize)
         return 0;

-    ret = ossl_sm2_internal_sign(tbs, tbslen, sig, &sltmp, ctx->ec);
+    ret = ossl_sm2_internal_sign(tbs, (int)tbslen, sig, &sltmp, ctx->ec);
     if (ret <= 0)
         return 0;

@@ -194,7 +196,7 @@ static int sm2sig_verify(void *vpsm2ctx, const unsigned char *sig, size_t siglen
     if (ctx->mdsize != 0 && tbslen != ctx->mdsize)
         return 0;

-    return ossl_sm2_internal_verify(tbs, tbslen, sig, siglen, ctx->ec);
+    return ossl_sm2_internal_verify(tbs, (int)tbslen, sig, (int)siglen, ctx->ec);
 }

 static void free_md(PROV_SM2_CTX *ctx)
@@ -402,55 +404,59 @@ err:
 static int sm2sig_get_ctx_params(void *vpsm2ctx, OSSL_PARAM *params)
 {
     PROV_SM2_CTX *psm2ctx = (PROV_SM2_CTX *)vpsm2ctx;
-    OSSL_PARAM *p;
+    struct sm2sig_get_ctx_params_st p;

-    if (psm2ctx == NULL)
+    if (psm2ctx == NULL || !sm2sig_get_ctx_params_decoder(params, &p))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_ALGORITHM_ID);
-    if (p != NULL
-        && !OSSL_PARAM_set_octet_string(p,
+    if (p.algid != NULL
+        && !OSSL_PARAM_set_octet_string(p.algid,
             psm2ctx->aid_len == 0 ? NULL : psm2ctx->aid_buf,
             psm2ctx->aid_len))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_DIGEST_SIZE);
-    if (p != NULL && !OSSL_PARAM_set_size_t(p, psm2ctx->mdsize))
+    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, psm2ctx->mdsize))
         return 0;

-    p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_DIGEST);
-    if (p != NULL && !OSSL_PARAM_set_utf8_string(p, psm2ctx->md == NULL ? psm2ctx->mdname : EVP_MD_get0_name(psm2ctx->md)))
+    if (p.digest != NULL
+        && !OSSL_PARAM_set_utf8_string(p.digest, psm2ctx->md == NULL ? psm2ctx->mdname : EVP_MD_get0_name(psm2ctx->md)))
         return 0;

     return 1;
 }

-static const OSSL_PARAM known_gettable_ctx_params[] = {
-    OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0),
-    OSSL_PARAM_size_t(OSSL_SIGNATURE_PARAM_DIGEST_SIZE, NULL),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *sm2sig_gettable_ctx_params(ossl_unused void *vpsm2ctx,
     ossl_unused void *provctx)
 {
-    return known_gettable_ctx_params;
+    return sm2sig_get_ctx_params_list;
 }

 static int sm2sig_set_ctx_params(void *vpsm2ctx, const OSSL_PARAM params[])
 {
+    /*
+     * (https://datatracker.ietf.org/doc/html/rfc8998#section-3.2.1)
+     *
+     * The SM2 signature algorithm requests an identifier value when generating
+     * or verifying a signature. In all uses except when a client of a server
+     * needs to verify a peer's SM2 certificate in the Certificate message, an
+     * implementation of this document MUST use the following ASCII string
+     * value as the SM2 identifier when doing a TLS 1.3 key exchange:
+     *
+     * TLSv1.3+GM+Cipher+Suite
+     */
+    static const uint8_t sm2_tls_id[] = {
+        0x54, 0x4c, 0x53, 0x76, 0x31, 0x2e, 0x33, 0x2b,
+        0x47, 0x4d, 0x2b, 0x43, 0x69, 0x70, 0x68, 0x65,
+        0x72, 0x2b, 0x53, 0x75, 0x69, 0x74, 0x65
+    };
     PROV_SM2_CTX *psm2ctx = (PROV_SM2_CTX *)vpsm2ctx;
-    const OSSL_PARAM *p;
+    struct sm2sig_set_ctx_params_st p;
     size_t mdsize;

-    if (psm2ctx == NULL)
+    if (psm2ctx == NULL || !sm2sig_set_ctx_params_decoder(params, &p))
         return 0;
-    if (ossl_param_is_empty(params))
-        return 1;

-    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_DIST_ID);
-    if (p != NULL) {
+    if (p.distid != NULL) {
         void *tmp_id = NULL;
         size_t tmp_idlen = 0;

@@ -460,12 +466,23 @@ static int sm2sig_set_ctx_params(void *vpsm2ctx, const OSSL_PARAM params[])
         if (!psm2ctx->flag_compute_z_digest)
             return 0;

-        if (p->data_size != 0
-            && !OSSL_PARAM_get_octet_string(p, &tmp_id, 0, &tmp_idlen))
+        if ((p.distid->data != NULL)
+            && !OSSL_PARAM_get_octet_string(p.distid, &tmp_id, 0, &tmp_idlen))
             return 0;
         OPENSSL_free(psm2ctx->id);
         psm2ctx->id = tmp_id;
         psm2ctx->id_len = tmp_idlen;
+    } else if (p.tlsver != NULL) {
+        unsigned int ver = 0;
+
+        if (!psm2ctx->flag_compute_z_digest
+            || !OSSL_PARAM_get_uint(p.tlsver, &ver))
+            return 0;
+        if (ver == TLS1_3_VERSION) {
+            OPENSSL_free(psm2ctx->id);
+            psm2ctx->id_len = sizeof(sm2_tls_id);
+            psm2ctx->id = OPENSSL_memdup(sm2_tls_id, psm2ctx->id_len);
+        }
     }

     /*
@@ -474,15 +491,13 @@ static int sm2sig_set_ctx_params(void *vpsm2ctx, const OSSL_PARAM params[])
      * If there is ever any different digest algorithm allowed with SM2
      * this needs to be adjusted accordingly.
      */
-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DIGEST_SIZE);
-    if (p != NULL && (!OSSL_PARAM_get_size_t(p, &mdsize) || mdsize != psm2ctx->mdsize))
+    if (p.size != NULL && (!OSSL_PARAM_get_size_t(p.size, &mdsize) || mdsize != psm2ctx->mdsize))
         return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DIGEST);
-    if (p != NULL) {
+    if (p.digest != NULL) {
         char *mdname = NULL;

-        if (!OSSL_PARAM_get_utf8_string(p, &mdname, 0))
+        if (!OSSL_PARAM_get_utf8_string(p.digest, &mdname, 0))
             return 0;
         if (!sm2sig_set_mdname(psm2ctx, mdname)) {
             OPENSSL_free(mdname);
@@ -494,17 +509,10 @@ static int sm2sig_set_ctx_params(void *vpsm2ctx, const OSSL_PARAM params[])
     return 1;
 }

-static const OSSL_PARAM known_settable_ctx_params[] = {
-    OSSL_PARAM_size_t(OSSL_SIGNATURE_PARAM_DIGEST_SIZE, NULL),
-    OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0),
-    OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_DIST_ID, NULL, 0),
-    OSSL_PARAM_END
-};
-
 static const OSSL_PARAM *sm2sig_settable_ctx_params(ossl_unused void *vpsm2ctx,
     ossl_unused void *provctx)
 {
-    return known_settable_ctx_params;
+    return sm2sig_set_ctx_params_list;
 }

 static int sm2sig_get_ctx_md_params(void *vpsm2ctx, OSSL_PARAM *params)
diff --git a/deps/openssl/openssl/providers/implementations/signature/sm2_sig.inc.in b/deps/openssl/openssl/providers/implementations/signature/sm2_sig.inc.in
new file mode 100644
index 00000000000..6c213301aba
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/signature/sm2_sig.inc.in
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('sm2sig_get_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'algid',  'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_DIGEST_SIZE',  'size',   'size_t'],
+                          ['OSSL_SIGNATURE_PARAM_DIGEST',       'digest', 'utf8_string'],
+                         )); -}
+
+{- produce_param_decoder('sm2sig_set_ctx_params',
+                         (['OSSL_SIGNATURE_PARAM_DIGEST_SIZE', 'size',   'size_t'],
+                          ['OSSL_SIGNATURE_PARAM_DIGEST',      'digest', 'utf8_string'],
+                          ['OSSL_PKEY_PARAM_DIST_ID',          'distid', 'octet_string'],
+                          ['OSSL_SIGNATURE_PARAM_TLS_VERSION', 'tlsver', 'uint'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/skeymgmt/aes_skmgmt.c b/deps/openssl/openssl/providers/implementations/skeymgmt/aes_skmgmt.c
index 02370b7fb71..cc26e657e5f 100644
--- a/deps/openssl/openssl/providers/implementations/skeymgmt/aes_skmgmt.c
+++ b/deps/openssl/openssl/providers/implementations/skeymgmt/aes_skmgmt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -9,7 +9,7 @@

 #include <openssl/core_dispatch.h>
 #include "crypto/types.h"
-#include "skeymgmt_lcl.h"
+#include "prov/skeymgmt_lcl.h"
 #include "internal/skey.h"
 #include "prov/implementations.h"

@@ -48,5 +48,12 @@ const OSSL_DISPATCH ossl_aes_skeymgmt_functions[] = {
     { OSSL_FUNC_SKEYMGMT_FREE, (void (*)(void))generic_free },
     { OSSL_FUNC_SKEYMGMT_IMPORT, (void (*)(void))aes_import },
     { OSSL_FUNC_SKEYMGMT_EXPORT, (void (*)(void))aes_export },
+    { OSSL_FUNC_SKEYMGMT_IMP_SETTABLE_PARAMS,
+        (void (*)(void))generic_imp_settable_params },
+    { OSSL_FUNC_SKEYMGMT_GET_KEY_ID, (void (*)(void))generic_get_key_id },
+    { OSSL_FUNC_SKEYMGMT_GET_LOCAL_KEYID,
+        (void (*)(void))generic_get_local_keyid },
+    { OSSL_FUNC_SKEYMGMT_GET_ALGORITHM_ID,
+        (void (*)(void))generic_get_algorithm_id },
     OSSL_DISPATCH_END
 };
diff --git a/deps/openssl/openssl/providers/implementations/skeymgmt/build.info b/deps/openssl/openssl/providers/implementations/skeymgmt/build.info
index 8bccdd72f6c..4143b572b10 100644
--- a/deps/openssl/openssl/providers/implementations/skeymgmt/build.info
+++ b/deps/openssl/openssl/providers/implementations/skeymgmt/build.info
@@ -2,7 +2,11 @@
 # switch each to the Legacy provider when needed.

 $AES_GOAL=../../libdefault.a ../../libfips.a
-$GENERIC_GOAL=../../libdefault.a ../../libfips.a
+IF[{- !$disabled{module} -}]
+  $GENERIC_GOAL=../../libdefault.a ../../libfips.a ../../liblegacy.a
+ELSE
+  $GENERIC_GOAL=../../libdefault.a ../../libfips.a
+ENDIF

 SOURCE[$AES_GOAL]=aes_skmgmt.c
 SOURCE[$GENERIC_GOAL]=generic.c
diff --git a/deps/openssl/openssl/providers/implementations/skeymgmt/generic.c b/deps/openssl/openssl/providers/implementations/skeymgmt/generic.c
index 5b8c557f833..a4f443f3071 100644
--- a/deps/openssl/openssl/providers/implementations/skeymgmt/generic.c
+++ b/deps/openssl/openssl/providers/implementations/skeymgmt/generic.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,14 +7,19 @@
  * https://www.openssl.org/source/license.html
  */

+#include <string.h>
 #include <openssl/core_dispatch.h>
 #include <openssl/core_names.h>
+#include <openssl/proverr.h>
 #include "crypto/types.h"
+#include "internal/cryptlib.h"
 #include "internal/skey.h"
 #include "prov/provider_ctx.h"
 #include "prov/providercommon.h"
 #include "prov/implementations.h"
-#include "skeymgmt_lcl.h"
+#include "prov/skeymgmt_lcl.h"
+
+#include "providers/implementations/skeymgmt/generic.inc"

 void generic_free(void *keydata)
 {
@@ -23,25 +28,77 @@ void generic_free(void *keydata)
     if (generic == NULL)
         return;

-    OPENSSL_free(generic->data);
+    OPENSSL_clear_free(generic->data, generic->length);
+    OPENSSL_free(generic->alias);
+    OPENSSL_free(generic->local_keyid);
+    OPENSSL_free(generic->algorithm_oid);
+    OPENSSL_free(generic->algorithm_params);
     OPENSSL_free(generic);
 }

-void *generic_import(void *provctx, int selection, const OSSL_PARAM params[])
+static int generic_import_metadata(PROV_SKEY *skey,
+    const struct generic_skey_import_st *p)
+{
+    if (p->alias != NULL
+        && p->alias->data_type == OSSL_PARAM_UTF8_STRING
+        && skey->alias == NULL) {
+        skey->alias = OPENSSL_strndup(p->alias->data, p->alias->data_size);
+        if (skey->alias == NULL)
+            return 0;
+        if (strlen(skey->alias) != p->alias->data_size) {
+            ERR_raise(ERR_R_PROV_LIB, PROV_R_INVALID_DATA);
+            return 0;
+        }
+    }
+
+    if (p->local_keyid != NULL
+        && p->local_keyid->data_type == OSSL_PARAM_OCTET_STRING
+        && skey->local_keyid == NULL) {
+        skey->local_keyid = OPENSSL_memdup(p->local_keyid->data,
+            p->local_keyid->data_size);
+        if (skey->local_keyid == NULL)
+            return 0;
+        skey->local_keyid_len = p->local_keyid->data_size;
+    }
+
+    if (p->algorithm_oid != NULL
+        && p->algorithm_oid->data_type == OSSL_PARAM_OCTET_STRING
+        && skey->algorithm_oid == NULL) {
+        skey->algorithm_oid = OPENSSL_memdup(p->algorithm_oid->data,
+            p->algorithm_oid->data_size);
+        if (skey->algorithm_oid == NULL)
+            return 0;
+        skey->algorithm_oid_len = p->algorithm_oid->data_size;
+    }
+
+    if (p->algorithm_params != NULL
+        && p->algorithm_params->data_type == OSSL_PARAM_OCTET_STRING
+        && skey->algorithm_params == NULL) {
+        skey->algorithm_params = OPENSSL_memdup(p->algorithm_params->data,
+            p->algorithm_params->data_size);
+        if (skey->algorithm_params == NULL)
+            return 0;
+        skey->algorithm_params_len = p->algorithm_params->data_size;
+    }
+
+    return 1;
+}
+
+void *generic_import(void *provctx, int selection ossl_unused, const OSSL_PARAM params[])
 {
     OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
-    const OSSL_PARAM *raw_bytes;
+    struct generic_skey_import_st p;
     PROV_SKEY *generic = NULL;
     int ok = 0;

     if (!ossl_prov_is_running())
         return NULL;

-    if ((selection & OSSL_SKEYMGMT_SELECT_SECRET_KEY) == 0)
+    if (!generic_skey_import_decoder(params, &p))
         return NULL;

-    raw_bytes = OSSL_PARAM_locate_const(params, OSSL_SKEY_PARAM_RAW_BYTES);
-    if (raw_bytes == NULL)
+    if (p.raw_bytes == NULL
+        || p.raw_bytes->data_type != OSSL_PARAM_OCTET_STRING)
         return NULL;

     generic = OPENSSL_zalloc(sizeof(PROV_SKEY));
@@ -52,9 +109,15 @@ void *generic_import(void *provctx, int selection, const OSSL_PARAM params[])

     generic->type = SKEY_TYPE_GENERIC;

-    if ((generic->data = OPENSSL_memdup(raw_bytes->data, raw_bytes->data_size)) == NULL)
+    if ((generic->data = OPENSSL_memdup(p.raw_bytes->data,
+             p.raw_bytes->data_size))
+        == NULL)
         goto end;
-    generic->length = raw_bytes->data_size;
+    generic->length = p.raw_bytes->data_size;
+
+    if (!generic_import_metadata(generic, &p))
+        goto end;
+
     ok = 1;

 end:
@@ -65,29 +128,116 @@ end:
     return generic;
 }

+const OSSL_PARAM *generic_imp_settable_params(void *provctx)
+{
+    return generic_skey_import_list;
+}
+
 int generic_export(void *keydata, int selection,
     OSSL_CALLBACK *param_callback, void *cbarg)
 {
     PROV_SKEY *gen = keydata;
-    OSSL_PARAM params[2];
+    OSSL_PARAM params[6];
+    int idx = 0;

-    if (!ossl_prov_is_running() || gen == NULL)
+    if (!ossl_prov_is_running() || gen == NULL || selection == 0)
         return 0;

     /* If we use generic SKEYMGMT as a "base class", we shouldn't check the type */
-    if ((selection & OSSL_SKEYMGMT_SELECT_SECRET_KEY) == 0)
-        return 0;
+    if ((selection & OSSL_SKEYMGMT_SELECT_SECRET_KEY) != 0)
+        params[idx++] = OSSL_PARAM_construct_octet_string(OSSL_SKEY_PARAM_RAW_BYTES,
+            gen->data, gen->length);
+
+    if ((selection & OSSL_SKEYMGMT_SELECT_PARAMETERS) != 0) {
+        if (gen->alias != NULL)
+            params[idx++] = OSSL_PARAM_construct_utf8_string(
+                OSSL_SKEY_PARAM_ALIAS, gen->alias, 0);
+
+        if (gen->local_keyid != NULL)
+            params[idx++] = OSSL_PARAM_construct_octet_string(
+                OSSL_SKEY_PARAM_LOCAL_KEYID,
+                gen->local_keyid, gen->local_keyid_len);
+
+        if (gen->algorithm_oid != NULL)
+            params[idx++] = OSSL_PARAM_construct_octet_string(
+                OSSL_SKEY_PARAM_ALGORITHM_OID,
+                gen->algorithm_oid, gen->algorithm_oid_len);
+
+        if (gen->algorithm_params != NULL)
+            params[idx++] = OSSL_PARAM_construct_octet_string(
+                OSSL_SKEY_PARAM_ALGORITHM_PARAMS,
+                gen->algorithm_params, gen->algorithm_params_len);
+    }

-    params[0] = OSSL_PARAM_construct_octet_string(OSSL_SKEY_PARAM_RAW_BYTES,
-        gen->data, gen->length);
-    params[1] = OSSL_PARAM_construct_end();
+    params[idx] = OSSL_PARAM_construct_end();

     return param_callback(params, cbarg);
 }

+const char *generic_get_key_id(void *keydata)
+{
+    PROV_SKEY *gen = keydata;
+
+    if (gen == NULL)
+        return NULL;
+
+    return gen->alias;
+}
+
+int generic_get_local_keyid(void *keydata,
+    const unsigned char **id, size_t *len)
+{
+    PROV_SKEY *gen = keydata;
+
+    if (gen == NULL)
+        return 0;
+    if (id == NULL || len == NULL)
+        return 0;
+
+    *id = gen->local_keyid;
+    *len = gen->local_keyid_len;
+    return 1;
+}
+
+int generic_get_algorithm_id(void *keydata,
+    const unsigned char **oid, size_t *oid_len,
+    const unsigned char **params, size_t *params_len)
+{
+    PROV_SKEY *gen = keydata;
+    int ret_oid = 0, ret_params = 0;
+
+    if (gen == NULL)
+        return 0;
+
+    if (oid != NULL && oid_len != NULL)
+        ret_oid = 1;
+    if (params != NULL && params_len != NULL)
+        ret_params = 1;
+
+    if (ret_oid == 0 && ret_params == 0)
+        return 0;
+
+    if (ret_oid == 1) {
+        *oid = gen->algorithm_oid;
+        *oid_len = gen->algorithm_oid_len;
+    }
+    if (ret_params == 1) {
+        *params = gen->algorithm_params;
+        *params_len = gen->algorithm_params_len;
+    }
+    return 1;
+}
+
 const OSSL_DISPATCH ossl_generic_skeymgmt_functions[] = {
     { OSSL_FUNC_SKEYMGMT_FREE, (void (*)(void))generic_free },
     { OSSL_FUNC_SKEYMGMT_IMPORT, (void (*)(void))generic_import },
     { OSSL_FUNC_SKEYMGMT_EXPORT, (void (*)(void))generic_export },
+    { OSSL_FUNC_SKEYMGMT_IMP_SETTABLE_PARAMS,
+        (void (*)(void))generic_imp_settable_params },
+    { OSSL_FUNC_SKEYMGMT_GET_KEY_ID, (void (*)(void))generic_get_key_id },
+    { OSSL_FUNC_SKEYMGMT_GET_LOCAL_KEYID,
+        (void (*)(void))generic_get_local_keyid },
+    { OSSL_FUNC_SKEYMGMT_GET_ALGORITHM_ID,
+        (void (*)(void))generic_get_algorithm_id },
     OSSL_DISPATCH_END
 };
diff --git a/deps/openssl/openssl/providers/implementations/skeymgmt/generic.inc.in b/deps/openssl/openssl/providers/implementations/skeymgmt/generic.inc.in
new file mode 100644
index 00000000000..440f373dafd
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/skeymgmt/generic.inc.in
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('generic_skey_import',
+                         (['OSSL_SKEY_PARAM_RAW_BYTES',       'raw_bytes',        'octet_string'],
+                          ['OSSL_SKEY_PARAM_ALIAS',           'alias',            'utf8_string'],
+                          ['OSSL_SKEY_PARAM_LOCAL_KEYID',     'local_keyid',      'octet_string'],
+                          ['OSSL_SKEY_PARAM_ALGORITHM_OID',   'algorithm_oid',    'octet_string'],
+                          ['OSSL_SKEY_PARAM_ALGORITHM_PARAMS','algorithm_params', 'octet_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/storemgmt/file_store.c b/deps/openssl/openssl/providers/implementations/storemgmt/file_store.c
index e251f0ad2cc..3dc028d1045 100644
--- a/deps/openssl/openssl/providers/implementations/storemgmt/file_store.c
+++ b/deps/openssl/openssl/providers/implementations/storemgmt/file_store.c
@@ -9,34 +9,29 @@

 /* This file has quite some overlap with engines/e_loader_attic.c */

+#include <stdio.h>
 #include <string.h>
-#include <sys/stat.h>
+#include "internal/e_os.h" /* for stat() */
+#include <sys/stat.h> /* for struct stat */
 #include <ctype.h> /* isdigit */
 #include <assert.h>

-#include <openssl/core_dispatch.h>
 #include <openssl/core_names.h>
 #include <openssl/core_object.h>
-#include <openssl/bio.h>
-#include <openssl/err.h>
 #include <openssl/params.h>
-#include <openssl/decoder.h>
 #include <openssl/proverr.h>
 #include <openssl/store.h> /* The OSSL_STORE_INFO type numbers */
 #include "internal/cryptlib.h"
 #include "internal/o_dir.h"
 #include "crypto/decoder.h"
-#include "crypto/ctype.h" /* ossl_isdigit() */
 #include "prov/implementations.h"
 #include "prov/bio.h"
 #include "prov/providercommon.h"
-#include "file_store_local.h"
+#include "prov/file_store_local.h"

-DEFINE_STACK_OF(OSSL_STORE_INFO)
+#include "providers/implementations/storemgmt/file_store.inc"

-#ifdef _WIN32
-#define stat _stat
-#endif
+DEFINE_STACK_OF(OSSL_STORE_INFO)

 #ifndef S_ISDIR
 #define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR)
@@ -140,6 +135,94 @@ static struct file_ctx_st *new_file_ctx(int type, const char *uri,
 static OSSL_DECODER_CONSTRUCT file_load_construct;
 static OSSL_DECODER_CLEANUP file_load_cleanup;

+#ifdef _WIN32
+#define OSSL_is_drive_letter(c) (((c) >= 'A' && (c) <= 'Z') || ((c) >= 'a' && (c) <= 'z'))
+#define OSSL_is_abs_drive_prefix(p) (OSSL_is_drive_letter((p)[0]) && (p)[1] == ':' && (p)[2] == '/')
+#endif
+
+/*
+ * uri_file_stat() handles URIs that may be interpreted as a reference to a local file.
+ * It attempts to derive from the given |uri| a file pathname that points to an
+ * existing file. To this end it takes the full |uri| as a filename (which may be
+ * an absolute or relative name, such as file.pem) or takes a postfix of |uri|,
+ * such as path-to-file if |uri| is of the form file:path-to-file
+ * or /path-to-file if |uri| is of the form file://localhost/path-to-file.
+ * The returned pathname is a pointer inside |uri|, or NULL on error.
+ * On success it populates the file stat buffer pointed at by |st|
+ * (unless |st| is NULL) and returns the derived pathname, otherwise NULL.
+ */
+static const char *uri_file_stat(const char *uri, struct stat *st)
+{
+    const char *path = uri, *q;
+    struct stat local_st;
+
+    ERR_set_mark();
+
+    if (st == NULL)
+        st = &local_st;
+
+    /*
+     * First, unless the URI starts with "file://",
+     * try and see if the full URI can be taken as a local file path name.
+     */
+    if (!HAS_CASE_PREFIX(uri, "file://")) {
+        if (stat(path, st) == 0) {
+            ERR_pop_to_mark();
+            return uri;
+        }
+        ERR_raise_data(ERR_LIB_SYS, errno, "calling stat(%s)", path);
+    }
+
+    /* Do a second attempt only if the URI appears to start with the "file" scheme. */
+    if (!CHECK_AND_SKIP_CASE_PREFIX(path, "file:")) {
+        ERR_clear_last_mark();
+        return NULL;
+    }
+
+    /*
+     * Extract the alternative path to check.
+     * There's a special case if the URI also contains an authority,
+     * then the full URI shouldn't be used as a path anywhere.
+     */
+    q = path;
+    if (CHECK_AND_SKIP_CASE_PREFIX(q, "//")) {
+        if (CHECK_AND_SKIP_CASE_PREFIX(q, "localhost/")
+            || CHECK_AND_SKIP_CASE_PREFIX(q, "/")) {
+            /*
+             * In these cases, we step back one char to ensure that the
+             * first slash is preserved, making the path always absolute
+             */
+            path = q - 1;
+#ifdef _WIN32
+        } else if (OSSL_is_abs_drive_prefix(q)) {
+            /* Support also "file://" URIs starting with a Windows drive letter not preceded by an extra '/' */
+            path = q;
+#endif
+        } else {
+            const char *p = strchr(q, '/');
+            size_t len = p == NULL ? strlen(q) : (size_t)(p - q);
+
+            ERR_raise_data(ERR_LIB_OSSL_STORE, OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED,
+                "%.*s", len, q);
+            ERR_clear_last_mark();
+            return NULL;
+        }
+    }
+#ifdef _WIN32
+    /* Windows "file://" URIs with a drive letter are usually required to have an extra '/' before the drive letter, e.g., "file:///C:/path" */
+    if (path[0] == '/' && OSSL_is_abs_drive_prefix(path + 1))
+        path++; /* Skip past the slash, making the path a normal Windows path */
+#endif
+
+    if (stat(path, st) == 0) {
+        ERR_pop_to_mark();
+        return path;
+    }
+    ERR_raise_data(ERR_LIB_SYS, errno, "calling stat(%s)", path);
+    ERR_clear_last_mark();
+    return NULL;
+}
+
 /*-
  *  Opening / attaching streams and directories
  *  -------------------------------------------
@@ -197,85 +280,11 @@ static void *file_open(void *provctx, const char *uri)
 {
     struct file_ctx_st *ctx = NULL;
     struct stat st;
-    struct {
-        const char *path;
-        unsigned int check_absolute : 1;
-    } path_data[2];
-    size_t path_data_n = 0, i;
-    const char *path, *p = uri, *q;
+    const char *path = uri_file_stat(uri, &st);
     BIO *bio;

-    ERR_set_mark();
-
-    /*
-     * First step, just take the URI as is.
-     */
-    path_data[path_data_n].check_absolute = 0;
-    path_data[path_data_n++].path = uri;
-
-    /*
-     * Second step, if the URI appears to start with the "file" scheme,
-     * extract the path and make that the second path to check.
-     * There's a special case if the URI also contains an authority, then
-     * the full URI shouldn't be used as a path anywhere.
-     */
-    if (CHECK_AND_SKIP_CASE_PREFIX(p, "file:")) {
-        q = p;
-        if (CHECK_AND_SKIP_CASE_PREFIX(q, "//")) {
-            path_data_n--; /* Invalidate using the full URI */
-            if (CHECK_AND_SKIP_CASE_PREFIX(q, "localhost/")
-                || CHECK_AND_SKIP_CASE_PREFIX(q, "/")) {
-                p = q - 1;
-            } else {
-                ERR_clear_last_mark();
-                ERR_raise(ERR_LIB_PROV, PROV_R_URI_AUTHORITY_UNSUPPORTED);
-                return NULL;
-            }
-        }
-
-        path_data[path_data_n].check_absolute = 1;
-#ifdef _WIN32
-        /* Windows "file:" URIs with a drive letter start with a '/' */
-        if (p[0] == '/' && p[2] == ':' && p[3] == '/') {
-            char c = tolower((unsigned char)p[1]);
-
-            if (c >= 'a' && c <= 'z') {
-                p++;
-                /* We know it's absolute, so no need to check */
-                path_data[path_data_n].check_absolute = 0;
-            }
-        }
-#endif
-        path_data[path_data_n++].path = p;
-    }
-
-    for (i = 0, path = NULL; path == NULL && i < path_data_n; i++) {
-        /*
-         * If the scheme "file" was an explicit part of the URI, the path must
-         * be absolute.  So says RFC 8089
-         */
-        if (path_data[i].check_absolute && path_data[i].path[0] != '/') {
-            ERR_clear_last_mark();
-            ERR_raise_data(ERR_LIB_PROV, PROV_R_PATH_MUST_BE_ABSOLUTE,
-                "Given path=%s", path_data[i].path);
-            return NULL;
-        }
-
-        if (stat(path_data[i].path, &st) < 0) {
-            ERR_raise_data(ERR_LIB_SYS, errno,
-                "calling stat(%s)",
-                path_data[i].path);
-        } else {
-            path = path_data[i].path;
-        }
-    }
-    if (path == NULL) {
-        ERR_clear_last_mark();
+    if (path == NULL)
         return NULL;
-    }
-
-    /* Successfully found a working path, clear possible collected errors */
-    ERR_pop_to_mark();

     if (S_ISDIR(st.st_mode))
         ctx = file_open_dir(path, uri, provctx);
@@ -307,66 +316,62 @@ void *file_attach(void *provctx, OSSL_CORE_BIO *cin)

 static const OSSL_PARAM *file_settable_ctx_params(void *provctx)
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_utf8_string(OSSL_STORE_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_int(OSSL_STORE_PARAM_EXPECT, NULL),
-        OSSL_PARAM_octet_string(OSSL_STORE_PARAM_SUBJECT, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_STORE_PARAM_INPUT_TYPE, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return file_set_ctx_params_list;
 }

 static int file_set_ctx_params(void *loaderctx, const OSSL_PARAM params[])
 {
     struct file_ctx_st *ctx = loaderctx;
-    const OSSL_PARAM *p;
+    struct file_set_ctx_params_st p;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !file_set_ctx_params_decoder(params, &p))
+        return 0;

     if (ctx->type != IS_DIR) {
         /* these parameters are ignored for directories */
-        p = OSSL_PARAM_locate_const(params, OSSL_STORE_PARAM_PROPERTIES);
-        if (p != NULL) {
+        if (p.propq != NULL) {
             OPENSSL_free(ctx->_.file.propq);
             ctx->_.file.propq = NULL;
-            if (!OSSL_PARAM_get_utf8_string(p, &ctx->_.file.propq, 0))
+            if (!OSSL_PARAM_get_utf8_string(p.propq, &ctx->_.file.propq, 0))
                 return 0;
         }
-        p = OSSL_PARAM_locate_const(params, OSSL_STORE_PARAM_INPUT_TYPE);
-        if (p != NULL) {
+        if (p.type != NULL) {
             OPENSSL_free(ctx->_.file.input_type);
             ctx->_.file.input_type = NULL;
-            if (!OSSL_PARAM_get_utf8_string(p, &ctx->_.file.input_type, 0))
+            if (!OSSL_PARAM_get_utf8_string(p.type, &ctx->_.file.input_type, 0))
                 return 0;
         }
     }
-    p = OSSL_PARAM_locate_const(params, OSSL_STORE_PARAM_EXPECT);
-    if (p != NULL && !OSSL_PARAM_get_int(p, &ctx->expected_type))
+
+    if (p.expect != NULL && !OSSL_PARAM_get_int(p.expect, &ctx->expected_type))
         return 0;
-    p = OSSL_PARAM_locate_const(params, OSSL_STORE_PARAM_SUBJECT);
-    if (p != NULL) {
+
+    if (p.sub != NULL) {
         const unsigned char *der = NULL;
         size_t der_len = 0;
         X509_NAME *x509_name;
         unsigned long hash;
-        int ok;
+        int ok = 0;

-        if (ctx->type != IS_DIR) {
-            ERR_raise(ERR_LIB_PROV,
-                PROV_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES);
+        if (!OSSL_PARAM_get_octet_string_ptr(p.sub, (const void **)&der, &der_len)
+            || der_len > LONG_MAX
+            || (x509_name = d2i_X509_NAME(NULL, &der, (long)der_len)) == NULL)
             return 0;
+        if (ctx->type != IS_DIR) {
+            char *str = X509_NAME_oneline(x509_name, NULL, 0);
+
+            ERR_raise_data(ERR_LIB_PROV, PROV_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES,
+                "uri=%s:subject=%s", ctx->uri, str);
+            OPENSSL_free(str);
+            goto end;
         }

-        if (!OSSL_PARAM_get_octet_string_ptr(p, (const void **)&der, &der_len)
-            || (x509_name = d2i_X509_NAME(NULL, &der, der_len)) == NULL)
-            return 0;
         hash = X509_NAME_hash_ex(x509_name,
             ossl_prov_ctx_get0_libctx(ctx->provctx), NULL,
             &ok);
-        BIO_snprintf(ctx->_.dir.search_name, sizeof(ctx->_.dir.search_name),
+        snprintf(ctx->_.dir.search_name, sizeof(ctx->_.dir.search_name),
             "%08lx", hash);
+    end:
         X509_NAME_free(x509_name);
         if (ok == 0)
             return 0;
@@ -482,6 +487,8 @@ static int file_setup_decoders(struct file_ctx_st *ctx)
                 goto err;
             }
             break;
+        case OSSL_STORE_INFO_SKEY: /* No input structure */
+            break;
         default:
             break;
         }
@@ -499,7 +506,7 @@ static int file_setup_decoders(struct file_ctx_st *ctx)
              * The decoder doesn't need any identification or to be
              * attached to any provider, since it's only used locally.
              */
-            to_obj = ossl_decoder_from_algorithm(0, to_algo, NULL);
+            to_obj = ossl_decoder_from_algorithm(0, to_algo, NULL, 0);
             if (to_obj != NULL)
                 to_obj_inst = ossl_decoder_instance_new_forprov(to_obj, ctx->provctx,
                     input_structure);
@@ -520,6 +527,16 @@ static int file_setup_decoders(struct file_ctx_st *ctx)
                 continue;
             }

+            /*
+             * As any sequence of bytes can be a secret key, we allow
+             * reading raw key from a file only when it is explicitly requested.
+             */
+            if ((ctx->expected_type != OSSL_STORE_INFO_SKEY)
+                && OPENSSL_strcasecmp(input_type, "raw") == 0) {
+                ossl_decoder_instance_free(to_obj_inst);
+                continue;
+            }
+
             if (!ossl_decoder_ctx_add_decoder_inst(ctx->_.file.decoderctx,
                     to_obj_inst)) {
                 ossl_decoder_instance_free(to_obj_inst);
@@ -600,7 +617,7 @@ static char *file_name_to_uri(struct file_ctx_st *ctx, const char *name)
     assert(name != NULL);
     {
         const char *pathsep = ossl_ends_with_dirsep(ctx->uri) ? "" : "/";
-        long calculated_length = strlen(ctx->uri) + strlen(pathsep)
+        size_t calculated_length = strlen(ctx->uri) + strlen(pathsep)
             + strlen(name) + 1 /* \0 */;

         data = OPENSSL_zalloc(calculated_length);
diff --git a/deps/openssl/openssl/providers/implementations/storemgmt/file_store.inc.in b/deps/openssl/openssl/providers/implementations/storemgmt/file_store.inc.in
new file mode 100644
index 00000000000..a108df48e22
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/storemgmt/file_store.inc.in
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('file_set_ctx_params',
+                         (['OSSL_STORE_PARAM_PROPERTIES', 'propq',  'utf8_string'],
+                          ['OSSL_STORE_PARAM_EXPECT',     'expect', 'int'],
+                          ['OSSL_STORE_PARAM_SUBJECT',    'sub',    'octet_string'],
+                          ['OSSL_STORE_PARAM_INPUT_TYPE', 'type',   'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/storemgmt/file_store_any2obj.c b/deps/openssl/openssl/providers/implementations/storemgmt/file_store_any2obj.c
index 03560ab4902..0eaae47af3b 100644
--- a/deps/openssl/openssl/providers/implementations/storemgmt/file_store_any2obj.c
+++ b/deps/openssl/openssl/providers/implementations/storemgmt/file_store_any2obj.c
@@ -30,12 +30,15 @@
 #include <openssl/buffer.h>
 #include <openssl/err.h>
 #include <openssl/asn1err.h>
+#include <openssl/proverr.h>
+#include "internal/cryptlib.h"
 #include <openssl/params.h>
 #include "internal/asn1.h"
 #include "internal/sizes.h"
 #include "crypto/pem.h" /* For internal PVK and "blob" headers */
 #include "prov/bio.h"
-#include "file_store_local.h"
+#include "prov/file_store_local.h"
+#include "providers/implementations/storemgmt/file_store_any2obj.inc"

 /*
  * newctx and freectx are not strictly necessary.  However, the method creator,
@@ -68,13 +71,16 @@ static void any2obj_freectx(void *ctx)
 static int any2obj_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     struct any2obj_ctx_st *ctx = vctx;
-    const OSSL_PARAM *p;
+    struct any2obj_set_ctx_params_st p;
     char *str;

-    p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_STRUCTURE);
+    if (ctx == NULL || !any2obj_set_ctx_params_decoder(params, &p))
+        return 0;
+
     str = ctx->data_structure;
-    if (p != NULL
-        && !OSSL_PARAM_get_utf8_string(p, &str, sizeof(ctx->data_structure)))
+    if (p.datastruct != NULL
+        && !OSSL_PARAM_get_utf8_string(p.datastruct, &str,
+            sizeof(ctx->data_structure)))
         return 0;

     return 1;
@@ -82,11 +88,7 @@ static int any2obj_set_ctx_params(void *vctx, const OSSL_PARAM params[])

 static const OSSL_PARAM *any2obj_settable_ctx_params(ossl_unused void *provctx)
 {
-    static const OSSL_PARAM settables[] = {
-        OSSL_PARAM_utf8_string(OSSL_OBJECT_PARAM_DATA_STRUCTURE, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return settables;
+    return any2obj_set_ctx_params_list;
 }

 static int any2obj_decode_final(void *vctx, int objtype, const char *input_type,
@@ -176,7 +178,7 @@ static int msblob2obj_decode(void *vctx, OSSL_CORE_BIO *cin, int selection,
     }

     ERR_set_mark();
-    ok = BIO_read(in, &mem->data[0], mem_want) == (int)mem_want;
+    ok = BIO_read(in, &mem->data[0], (int)mem_want) == (int)mem_want;
     mem_len += mem_want;
     ERR_pop_to_mark();
     if (!ok)
@@ -201,7 +203,7 @@ static int msblob2obj_decode(void *vctx, OSSL_CORE_BIO *cin, int selection,
     }

     ERR_set_mark();
-    ok = BIO_read(in, &mem->data[mem_len], mem_want) == (int)mem_want;
+    ok = BIO_read(in, &mem->data[mem_len], (int)mem_want) == (int)mem_want;
     mem_len += mem_want;
     ERR_pop_to_mark();

@@ -248,7 +250,7 @@ static int pvk2obj_decode(void *vctx, OSSL_CORE_BIO *cin, int selection,
     }

     ERR_set_mark();
-    ok = BIO_read(in, &mem->data[0], mem_want) == (int)mem_want;
+    ok = BIO_read(in, &mem->data[0], (int)mem_want) == (int)mem_want;
     mem_len += mem_want;
     ERR_pop_to_mark();
     if (!ok)
@@ -269,7 +271,7 @@ static int pvk2obj_decode(void *vctx, OSSL_CORE_BIO *cin, int selection,
     }

     ERR_set_mark();
-    ok = BIO_read(in, &mem->data[mem_len], mem_want) == (int)mem_want;
+    ok = BIO_read(in, &mem->data[mem_len], (int)mem_want) == (int)mem_want;
     mem_len += mem_want;
     ERR_pop_to_mark();

@@ -304,14 +306,67 @@ err:
         OSSL_DISPATCH_END                                                    \
     }

+#define MAX_RAW_KEY_SIZE 2048
+
+static OSSL_FUNC_decoder_decode_fn raw2obj_decode;
+static int raw2obj_decode(void *vctx, OSSL_CORE_BIO *cin, int selection,
+    OSSL_CALLBACK *data_cb, void *data_cbarg,
+    OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg)
+{
+    struct any2obj_ctx_st *ctx = vctx;
+    BIO *in = ossl_bio_new_from_core_bio(ctx->provctx, cin);
+    BUF_MEM *mem = NULL;
+    size_t len = 0, max_len = MAX_RAW_KEY_SIZE;
+    int ok = 0;
+
+    if (in == NULL)
+        goto err;
+
+    if ((mem = BUF_MEM_new()) == NULL
+        || BUF_MEM_grow(mem, max_len) == 0) {
+        ERR_raise(ERR_LIB_PEM, ERR_R_BUF_LIB);
+        goto err;
+    }
+
+    ok = BIO_read_ex(in, &mem->data[0], max_len, &len);
+    if (ok == 0) {
+        ERR_raise(ERR_LIB_BIO, ERR_R_BIO_LIB);
+        goto err;
+    }
+
+    if (len == 0) {
+        ERR_raise(ERR_LIB_PEM, ERR_R_UNSUPPORTED);
+        goto err;
+    }
+
+    BIO_free(in);
+    in = NULL;
+
+    if (BUF_MEM_grow(mem, len) != len) {
+        ERR_raise(ERR_LIB_PEM, ERR_R_BUF_LIB);
+        goto err;
+    }
+
+    /* any2obj_decode_final() frees |mem| for us */
+    return any2obj_decode_final(ctx, OSSL_OBJECT_SKEY, "raw", "SKEY",
+        mem, data_cb, data_cbarg);
+
+err:
+    BIO_free(in);
+    BUF_MEM_free(mem);
+    return 0;
+}
+
 MAKE_DECODER(der, OSSL_OBJECT_UNKNOWN);
 MAKE_DECODER(msblob, OSSL_OBJECT_PKEY);
 MAKE_DECODER(pvk, OSSL_OBJECT_PKEY);
+MAKE_DECODER(raw, OSSL_OBJECT_SKEY);

 const OSSL_ALGORITHM ossl_any_to_obj_algorithm[] = {
     { "obj", "input=DER", der_to_obj_decoder_functions },
     { "obj", "input=MSBLOB", msblob_to_obj_decoder_functions },
     { "obj", "input=PVK", pvk_to_obj_decoder_functions },
+    { "obj", "input=RAW", raw_to_obj_decoder_functions },
     {
         NULL,
     }
diff --git a/deps/openssl/openssl/providers/implementations/storemgmt/file_store_any2obj.inc.in b/deps/openssl/openssl/providers/implementations/storemgmt/file_store_any2obj.inc.in
new file mode 100644
index 00000000000..9e3f6f61dfd
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/storemgmt/file_store_any2obj.inc.in
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('any2obj_set_ctx_params',
+                         (['OSSL_OBJECT_PARAM_DATA_STRUCTURE', 'datastruct', 'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/implementations/storemgmt/file_store_local.h b/deps/openssl/openssl/providers/implementations/storemgmt/file_store_local.h
deleted file mode 100644
index b7b84864994..00000000000
--- a/deps/openssl/openssl/providers/implementations/storemgmt/file_store_local.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-extern const OSSL_ALGORITHM ossl_any_to_obj_algorithm[];
diff --git a/deps/openssl/openssl/providers/implementations/storemgmt/winstore_store.c b/deps/openssl/openssl/providers/implementations/storemgmt/winstore_store.c
index 1d6d1c57374..f525469cc6f 100644
--- a/deps/openssl/openssl/providers/implementations/storemgmt/winstore_store.c
+++ b/deps/openssl/openssl/providers/implementations/storemgmt/winstore_store.c
@@ -6,6 +6,7 @@
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
+
 #include <openssl/store.h>
 #include <openssl/core_dispatch.h>
 #include <openssl/core_names.h>
@@ -23,11 +24,12 @@
 #include "prov/implementations.h"
 #include "prov/providercommon.h"
 #include "prov/bio.h"
-#include "file_store_local.h"
+#include "prov/file_store_local.h"
 #ifdef __CYGWIN__
 #include <windows.h>
 #endif
 #include <wincrypt.h>
+#include "providers/implementations/storemgmt/winstore_store.inc"

 enum {
     STATE_IDLE,
@@ -65,7 +67,7 @@ static void winstore_win_advance(struct winstore_ctx_st *ctx)
     if (ctx->state == STATE_EOF)
         return;

-    name.cbData = ctx->subject_len;
+    name.cbData = (DWORD)ctx->subject_len;
     name.pbData = ctx->subject;

     ctx->win_ctx = (name.cbData == 0 ? NULL : CertFindCertificateInStore(ctx->win_store, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 0, CERT_FIND_SUBJECT_NAME, &name, ctx->win_ctx));
@@ -102,38 +104,31 @@ static void *winstore_attach(void *provctx, OSSL_CORE_BIO *cin)

 static const OSSL_PARAM *winstore_settable_ctx_params(void *loaderctx, const OSSL_PARAM params[])
 {
-    static const OSSL_PARAM known_settable_ctx_params[] = {
-        OSSL_PARAM_octet_string(OSSL_STORE_PARAM_SUBJECT, NULL, 0),
-        OSSL_PARAM_utf8_string(OSSL_STORE_PARAM_PROPERTIES, NULL, 0),
-        OSSL_PARAM_END
-    };
-    return known_settable_ctx_params;
+    return winstore_set_ctx_params_list;
 }

 static int winstore_set_ctx_params(void *loaderctx, const OSSL_PARAM params[])
 {
     struct winstore_ctx_st *ctx = loaderctx;
-    const OSSL_PARAM *p;
+    struct winstore_set_ctx_params_st p;
     int do_reset = 0;

-    if (ossl_param_is_empty(params))
-        return 1;
+    if (ctx == NULL || !winstore_set_ctx_params_decoder(params, &p))
+        return 0;

-    p = OSSL_PARAM_locate_const(params, OSSL_STORE_PARAM_PROPERTIES);
-    if (p != NULL) {
+    if (p.propq != NULL) {
         do_reset = 1;
         OPENSSL_free(ctx->propq);
         ctx->propq = NULL;
-        if (!OSSL_PARAM_get_utf8_string(p, &ctx->propq, 0))
+        if (!OSSL_PARAM_get_utf8_string(p.propq, &ctx->propq, 0))
             return 0;
     }

-    p = OSSL_PARAM_locate_const(params, OSSL_STORE_PARAM_SUBJECT);
-    if (p != NULL) {
+    if (p.sub != NULL) {
         const unsigned char *der = NULL;
         size_t der_len = 0;

-        if (!OSSL_PARAM_get_octet_string_ptr(p, (const void **)&der, &der_len))
+        if (!OSSL_PARAM_get_octet_string_ptr(p.sub, (const void **)&der, &der_len))
             return 0;

         do_reset = 1;
@@ -214,7 +209,7 @@ static int setup_decoder(struct winstore_ctx_st *ctx)
          * The decoder doesn't need any identification or to be
          * attached to any provider, since it's only used locally.
          */
-        to_obj = ossl_decoder_from_algorithm(0, to_algo, NULL);
+        to_obj = ossl_decoder_from_algorithm(0, to_algo, NULL, 0);
         if (to_obj != NULL)
             to_obj_inst = ossl_decoder_instance_new_forprov(to_obj, ctx->provctx,
                 input_structure);
diff --git a/deps/openssl/openssl/providers/implementations/storemgmt/winstore_store.inc.in b/deps/openssl/openssl/providers/implementations/storemgmt/winstore_store.inc.in
new file mode 100644
index 00000000000..f8c7c46869b
--- /dev/null
+++ b/deps/openssl/openssl/providers/implementations/storemgmt/winstore_store.inc.in
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('winstore_set_ctx_params',
+                         (['OSSL_STORE_PARAM_SUBJECT',    'sub',   'octet_string'],
+                          ['OSSL_STORE_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+                         )); -}
diff --git a/deps/openssl/openssl/providers/legacyprov.c b/deps/openssl/openssl/providers/legacyprov.c
index eb782a12604..e5faff9bcbd 100644
--- a/deps/openssl/openssl/providers/legacyprov.c
+++ b/deps/openssl/openssl/providers/legacyprov.c
@@ -163,7 +163,14 @@ static const OSSL_ALGORITHM legacy_ciphers[] = {

 static const OSSL_ALGORITHM legacy_kdfs[] = {
     ALG(PROV_NAMES_PBKDF1, ossl_kdf_pbkdf1_functions),
+#ifndef OPENSSL_NO_PVKKDF
     ALG(PROV_NAMES_PVKKDF, ossl_kdf_pvk_functions),
+#endif
+    { NULL, NULL, NULL }
+};
+
+static const OSSL_ALGORITHM legacy_skeymgmt[] = {
+    ALG(PROV_NAMES_GENERIC, ossl_generic_skeymgmt_functions),
     { NULL, NULL, NULL }
 };

@@ -178,6 +185,8 @@ static const OSSL_ALGORITHM *legacy_query(void *provctx, int operation_id,
         return legacy_ciphers;
     case OSSL_OP_KDF:
         return legacy_kdfs;
+    case OSSL_OP_SKEYMGMT:
+        return legacy_skeymgmt;
     }
     return NULL;
 }
diff --git a/deps/openssl/openssl/ssl/bio_ssl.c b/deps/openssl/openssl/ssl/bio_ssl.c
index 1123899c922..ebd9c58365a 100644
--- a/deps/openssl/openssl/ssl/bio_ssl.c
+++ b/deps/openssl/openssl/ssl/bio_ssl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -106,6 +106,7 @@ static int ssl_read(BIO *b, char *buf, size_t size, size_t *readbytes)
     ssl = sb->ssl;

     BIO_clear_retry_flags(b);
+    BIO_clear_flags(b, BIO_FLAGS_IN_EOF);

     ret = ssl_read_internal(ssl, buf, size, readbytes);

@@ -150,9 +151,11 @@ static int ssl_read(BIO *b, char *buf, size_t size, size_t *readbytes)
         BIO_set_retry_special(b);
         retry_reason = BIO_RR_CONNECT;
         break;
+    case SSL_ERROR_ZERO_RETURN:
+        BIO_set_flags(b, BIO_FLAGS_IN_EOF);
+        break;
     case SSL_ERROR_SYSCALL:
     case SSL_ERROR_SSL:
-    case SSL_ERROR_ZERO_RETURN:
     default:
         break;
     }
@@ -226,7 +229,7 @@ static int ssl_write(BIO *b, const char *buf, size_t size, size_t *written)

 static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
 {
-    SSL **sslp, *ssl;
+    SSL **sslp, *ssl, *dupssl;
     BIO_SSL *bs, *dbs;
     BIO *dbio, *bio;
     long ret = 1;
@@ -296,7 +299,6 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
         }
         BIO_set_shutdown(b, num);
         ssl = (SSL *)ptr;
-        bs->ssl = ssl;
         bio = SSL_get_rbio(ssl);
         if (bio != NULL) {
             if (!BIO_up_ref(bio)) {
@@ -308,6 +310,7 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
             BIO_set_next(b, bio);
         }
         BIO_set_init(b, 1);
+        bs->ssl = ssl;
         break;
     case BIO_C_GET_SSL:
         if (ptr != NULL) {
@@ -382,14 +385,19 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
     case BIO_CTRL_DUP:
         dbio = (BIO *)ptr;
         dbs = BIO_get_data(dbio);
+        dupssl = SSL_dup(ssl);
+        if (dupssl == NULL) {
+            ret = 0;
+            break;
+        }
         SSL_free(dbs->ssl);
-        dbs->ssl = SSL_dup(ssl);
+        dbs->ssl = dupssl;
         dbs->num_renegotiates = bs->num_renegotiates;
         dbs->renegotiate_count = bs->renegotiate_count;
         dbs->byte_count = bs->byte_count;
         dbs->renegotiate_timeout = bs->renegotiate_timeout;
         dbs->last_time = bs->last_time;
-        ret = (dbs->ssl != NULL);
+        ret = 1;
         break;
     case BIO_C_GET_FD:
         ret = BIO_ctrl(SSL_get_rbio(ssl), cmd, num, ptr);
@@ -405,6 +413,11 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
         if (!SSL_get_wpoll_descriptor(ssl, (BIO_POLL_DESCRIPTOR *)ptr))
             ret = 0;
         break;
+    case BIO_CTRL_EOF:
+        ret = BIO_test_flags(b, BIO_FLAGS_IN_EOF)
+            ? 1
+            : BIO_ctrl(SSL_get_rbio(ssl), cmd, num, ptr);
+        break;
     default:
         ret = BIO_ctrl(SSL_get_rbio(ssl), cmd, num, ptr);
         break;
@@ -433,10 +446,12 @@ static long ssl_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)

 static int ssl_puts(BIO *bp, const char *str)
 {
-    int n, ret;
+    int ret;
+    size_t n = strlen(str);

-    n = strlen(str);
-    ret = BIO_write(bp, str, n);
+    if (n > INT_MAX)
+        return -1;
+    ret = BIO_write(bp, str, (int)n);
     return ret;
 }

diff --git a/deps/openssl/openssl/ssl/build.info b/deps/openssl/openssl/ssl/build.info
index 515d5db5d40..e45db959cc9 100644
--- a/deps/openssl/openssl/ssl/build.info
+++ b/deps/openssl/openssl/ssl/build.info
@@ -2,13 +2,17 @@ SUBDIRS=record rio quic

 LIBS=../libssl

+IF[{- !$disabled{ech} -}]
+  SUBDIRS=ech
+ENDIF
+
 SOURCE[../libssl]=\
         pqueue.c \
-        statem/statem_srvr.c statem/statem_clnt.c  s3_lib.c  s3_enc.c \
+        statem/statem_srvr.c statem/statem_clnt.c s3_lib.c s3_enc.c \
         statem/statem_lib.c statem/extensions.c statem/extensions_srvr.c \
         statem/extensions_clnt.c statem/extensions_cust.c s3_msg.c \
         methods.c t1_lib.c  t1_enc.c tls13_enc.c \
-        d1_lib.c d1_msg.c \
+        d1_lib.c d1_msg.c d1_transcript.c \
         statem/statem_dtls.c d1_srtp.c \
         ssl_lib.c ssl_cert.c ssl_sess.c \
         ssl_ciph.c ssl_stat.c ssl_rsa.c \
@@ -28,12 +32,33 @@ IF[{- !$disabled{'deprecated-3.0'} -}]
   SOURCE[../libssl]=ssl_rsa_legacy.c
 ENDIF

+IF[{- !$disabled{dtls} || !$disabled{quic} -}]
+  # Datagram demux is shared between DTLS listener and QUIC
+  SOURCE[../libssl]=dgram_demux.c
+ENDIF
+
+IF[{- !$disabled{dtls} -}]
+  # DTLS listener support: connection lookup and RX handling
+  SOURCE[../libssl]=dtls_conn_lookup.c dtls_record_rx.c
+  # hashfunc.c is needed by dtls_conn_lookup.c for address hashing
+  SHARED_SOURCE[../libssl]=../crypto/hashtable/hashfunc.c
+ENDIF
+
 IF[{- !$disabled{quic} -}]
   SOURCE[../libssl]=priority_queue.c
   SHARED_SOURCE[../libssl] = ../crypto/hashtable/hashfunc.c
+ENDIF
+
+# siphash.c is needed by dtls_conn_lookup.c (DTLS) and quic_lcidm.c (QUIC)
+# for hash-flooding resistant connection lookup
+IF[{- !$disabled{dtls} || !$disabled{quic} -}]
   IF[{- $disabled{siphash} -}]
     SOURCE[../libssl]=../crypto/siphash/siphash.c
   ELSE
     SHARED_SOURCE[../libssl]=../crypto/siphash/siphash.c
   ENDIF
 ENDIF
+
+IF[{- $target{needs_c99_snprintf_compat} -}]
+  SOURCE[../libssl]=../crypto/msvc2013_snprintf.c
+ENDIF
diff --git a/deps/openssl/openssl/ssl/d1_lib.c b/deps/openssl/openssl/ssl/d1_lib.c
index 6dc4bae3c84..d670f85679b 100644
--- a/deps/openssl/openssl/ssl/d1_lib.c
+++ b/deps/openssl/openssl/ssl/d1_lib.c
@@ -12,15 +12,22 @@
 #include <stdio.h>
 #include <openssl/objects.h>
 #include <openssl/rand.h>
+#include <openssl/evp.h>
+#include <openssl/core_names.h>
 #include "ssl_local.h"
 #include "internal/time.h"
 #include "internal/ssl_unwrap.h"
+#include "internal/hashfunc.h"
+#include "internal/dtls_record_rx.h"
+#include "internal/dgram_demux.h"
+#include "internal/dgram_conn_lookup.h"
+#include "internal/rio_notifier.h"

 static int dtls1_handshake_write(SSL_CONNECTION *s);
-static size_t dtls1_link_min_mtu(void);
-
-/* XDTLS:  figure out the right values */
-static const size_t g_probable_mtu[] = { 1500, 512, 256 };
+static const size_t dtls1_link_min_mtu = 256;
+#ifndef OPENSSL_NO_DTLS
+static OSSL_TIME dtls_listener_get_time_direct(DTLS_LISTENER *dl);
+#endif

 const SSL3_ENC_METHOD DTLSv1_enc_data = {
     tls1_setup_key_block,
@@ -53,6 +60,21 @@ const SSL3_ENC_METHOD DTLSv1_2_enc_data = {
     dtls1_handshake_write
 };

+const SSL3_ENC_METHOD DTLSv1_3_enc_data = {
+    tls13_setup_key_block,
+    tls13_generate_master_secret,
+    tls13_change_cipher_state,
+    tls13_final_finish_mac,
+    TLS_MD_CLIENT_FINISH_CONST, TLS_MD_CLIENT_FINISH_CONST_SIZE,
+    TLS_MD_SERVER_FINISH_CONST, TLS_MD_SERVER_FINISH_CONST_SIZE,
+    tls13_alert_code,
+    tls13_export_keying_material,
+    SSL_ENC_FLAG_DTLS | SSL_ENC_FLAG_SIGALGS | SSL_ENC_FLAG_SHA256_PRF,
+    dtls1_set_handshake_header,
+    dtls1_close_construct_packet,
+    dtls1_handshake_write
+};
+
 OSSL_TIME dtls1_default_timeout(void)
 {
     /*
@@ -81,23 +103,7 @@ int dtls1_new(SSL *ssl)
         return 0;
     }

-    d1->buffered_messages = pqueue_new();
-    d1->sent_messages = pqueue_new();
-
-    if (s->server) {
-        d1->cookie_len = sizeof(s->d1->cookie);
-    }
-
-    d1->link_mtu = 0;
-    d1->mtu = 0;
-
-    if (d1->buffered_messages == NULL || d1->sent_messages == NULL) {
-        pqueue_free(d1->buffered_messages);
-        pqueue_free(d1->sent_messages);
-        OPENSSL_free(d1);
-        ssl3_free(ssl);
-        return 0;
-    }
+    d1->hello_verify_request = SSL_HVR_NONE;

     s->d1 = d1;

@@ -110,73 +116,232 @@ int dtls1_new(SSL *ssl)
 static void dtls1_clear_queues(SSL_CONNECTION *s)
 {
     dtls1_clear_received_buffer(s);
-    dtls1_clear_sent_buffer(s);
+    dtls1_clear_sent_buffer(s, 0);
+    ossl_list_record_number_elem_free(&s->d1->ack_rec_num);
 }

 void dtls1_clear_received_buffer(SSL_CONNECTION *s)
 {
     pitem *item = NULL;
     hm_fragment *frag = NULL;
+    pqueue *rcvd_messages = &s->d1->rcvd_messages;

-    while ((item = pqueue_pop(s->d1->buffered_messages)) != NULL) {
+    while ((item = pqueue_pop(rcvd_messages)) != NULL) {
         frag = (hm_fragment *)item->data;
         dtls1_hm_fragment_free(frag);
         pitem_free(item);
     }
+    s->d1->has_change_cipher_spec = 0;
+}
+
+/*
+ * Called once the DTLS 1.3 hellos are done. Our handshake read keys are only
+ * installed when the peer's first epoch 2 record arrives (dtls1_read_bytes()),
+ * so until then nothing but a plaintext alert may be read. Anything already
+ * reassembled or buffered arrived unprotected, so discard it.
+ */
+void dtls13_hellos_done(SSL_CONNECTION *s)
+{
+    s->dtls13_process_hello = 1;
+    dtls1_clear_received_buffer(s);
+    if (s->rlayer.rrlmethod->set_plain_alerts != NULL)
+        s->rlayer.rrlmethod->set_plain_alerts(s->rlayer.rrl, 1);
+}
+
+void ossl_list_record_number_elem_free(OSSL_LIST(record_number) *p_list)
+{
+    DTLS1_RECORD_NUMBER *p_elem;
+    DTLS1_RECORD_NUMBER *p_elem_next = NULL;
+
+    if (p_list != NULL)
+        p_elem_next = ossl_list_record_number_head(p_list);
+
+    while ((p_elem = p_elem_next) != NULL) {
+        p_elem_next = ossl_list_record_number_next(p_elem_next);
+        ossl_list_record_number_remove(p_list, p_elem);
+        OPENSSL_free(p_elem);
+    }
+}
+
+DTLS1_RECORD_NUMBER *dtls1_record_number_new(uint64_t epoch, uint64_t seqnum,
+    size_t frag_off, size_t frag_len)
+{
+    DTLS1_RECORD_NUMBER *recnum = OPENSSL_zalloc(sizeof(*recnum));
+
+    if (recnum != NULL) {
+        recnum->epoch = epoch;
+        recnum->seqnum = seqnum;
+        recnum->frag_off = frag_off;
+        recnum->frag_len = frag_len;
+    }
+
+    return recnum;
 }

-void dtls1_clear_sent_buffer(SSL_CONNECTION *s)
+void dtls1_acknowledge_sent_buffer(SSL_CONNECTION *s, uint64_t before_epoch)
 {
     pitem *item = NULL;
-    hm_fragment *frag = NULL;
+    piterator iter = pqueue_iterator(&s->d1->sent_messages);

-    while ((item = pqueue_pop(s->d1->sent_messages)) != NULL) {
-        frag = (hm_fragment *)item->data;
+    while ((item = pqueue_next(&iter)) != NULL) {
+        dtls_sent_msg *sent_msg = (dtls_sent_msg *)item->data;
+        DTLS1_RECORD_NUMBER *recnum;
+        DTLS1_RECORD_NUMBER *recnum_next = ossl_list_record_number_head(&sent_msg->rec_nums);
+
+        while ((recnum = recnum_next) != NULL) {
+            recnum_next = ossl_list_record_number_next(recnum_next);
+
+            if (recnum->epoch < before_epoch) {
+                ossl_list_record_number_remove(&sent_msg->rec_nums, recnum);
+                OPENSSL_free(recnum);
+            }
+        }
+    }
+}
+
+void dtls1_clear_sent_buffer(SSL_CONNECTION *s, int keep_unacked_msgs)
+{
+    pitem *item = NULL;
+    pqueue *remaining_sent_messages = pqueue_new();
+    pqueue *sent_messages = &s->d1->sent_messages;
+
+    while ((item = pqueue_pop(sent_messages)) != NULL) {
+        dtls_sent_msg *sent_msg = (dtls_sent_msg *)item->data;
+        unsigned char msg_type = sent_msg->msg_info.msg_type;
+        unsigned char record_type = sent_msg->msg_info.record_type;
+
+        if (SSL_CONNECTION_IS_DTLS13(s)
+            && !ossl_list_record_number_is_empty(&sent_msg->rec_nums)
+            && keep_unacked_msgs) {
+            pqueue_insert(remaining_sent_messages, item);
+            continue;
+        }

-        if (frag->msg_header.is_ccs
-            && frag->msg_header.saved_retransmit_state.wrlmethod != NULL
-            && s->rlayer.wrl != frag->msg_header.saved_retransmit_state.wrl) {
+        if (((!SSL_CONNECTION_IS_DTLS13(s) && record_type == SSL3_RT_CHANGE_CIPHER_SPEC)
+                || (SSL_CONNECTION_IS_DTLS13(s)
+                    && (msg_type == SSL3_MT_FINISHED
+                        || msg_type == SSL3_MT_SERVER_HELLO
+                        || msg_type == SSL3_MT_KEY_UPDATE)))
+            && sent_msg->saved_retransmit_state.wrlmethod != NULL
+            && s->rlayer.wrl != sent_msg->saved_retransmit_state.wrl) {
             /*
              * If we're freeing the CCS then we're done with the old wrl and it
              * can bee freed
              */
-            frag->msg_header.saved_retransmit_state.wrlmethod->free(frag->msg_header.saved_retransmit_state.wrl);
+            sent_msg->saved_retransmit_state.wrlmethod->free(sent_msg->saved_retransmit_state.wrl);
         }

-        dtls1_hm_fragment_free(frag);
+        dtls1_sent_msg_free(sent_msg);
         pitem_free(item);
     }
+
+    if (SSL_CONNECTION_IS_DTLS13(s))
+        while ((item = pqueue_pop(remaining_sent_messages)) != NULL)
+            pqueue_insert(&s->d1->sent_messages, item);
+
+    pqueue_free(remaining_sent_messages);
+}
+
+/*
+ * Before RECORD_LAYER_clear() frees s->rlayer.wrl, null out any
+ * saved_retransmit_state.wrl pointers in the sent_messages queue that
+ * reference it.  This transfers ownership of that free exclusively to
+ * RECORD_LAYER_clear and prevents dtls1_clear_sent_buffer from freeing
+ * the same pointer a second time.  Entries with a different (older) wrl
+ * pointer are left untouched and will be freed correctly later.
+ */
+void dtls1_clear_current_wrl_from_sent_buffer(SSL_CONNECTION *s)
+{
+    pitem *item;
+    piterator iter = pqueue_iterator(&s->d1->sent_messages);
+
+    while ((item = pqueue_next(&iter)) != NULL) {
+        dtls_sent_msg *sent_msg = (dtls_sent_msg *)item->data;
+
+        if (sent_msg->saved_retransmit_state.wrl == s->rlayer.wrl) {
+            sent_msg->saved_retransmit_state.wrl = NULL;
+            sent_msg->saved_retransmit_state.wrlmethod = NULL;
+        }
+    }
+}
+
+int dtls_any_sent_messages_are_missing_acknowledge(SSL_CONNECTION *s)
+{
+    pitem *item;
+    piterator iter = pqueue_iterator(&s->d1->sent_messages);
+
+    while ((item = pqueue_next(&iter)) != NULL) {
+        dtls_sent_msg *msg = (dtls_sent_msg *)item->data;
+
+        if (!ossl_list_record_number_is_empty(&msg->rec_nums))
+            return 1;
+    }
+
+    return 0;
 }

 void dtls1_free(SSL *ssl)
 {
-    SSL_CONNECTION *s = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
+    SSL_CONNECTION *s;
+
+#ifndef OPENSSL_NO_DTLS
+    if (IS_DTLS_LISTENER(ssl)) {
+        ossl_dtls_listener_free(ssl);
+        return;
+    }
+#endif
+
+    s = SSL_CONNECTION_FROM_SSL_ONLY(ssl);

     if (s == NULL)
         return;

-    if (s->d1 != NULL) {
+#ifndef OPENSSL_NO_DTLS
+    /*
+     * If this connection was created by a listener, unregister it from the
+     * listener's established_conns lookup table to prevent use-after-free.
+     * The listener routes incoming packets to connections via this table,
+     * so we must remove ourselves before freeing.
+     */
+    if (s->d1 != NULL && s->d1->listener != NULL)
+        ossl_dtls_listener_unregister_established_conn(s->d1->listener,
+            &s->d1->peer_addr);
+#endif
+
+    if (s->d1 != NULL)
         dtls1_clear_queues(s);
-        pqueue_free(s->d1->buffered_messages);
-        pqueue_free(s->d1->sent_messages);
+
+#ifndef OPENSSL_NO_DTLS
+    if (s->d1 != NULL) {
+        DTLS_RX *rx = s->d1->rx;
+
+        if (s->listener_rx == rx)
+            s->listener_rx = NULL;
+        ossl_dtls_rx_free(rx);
+
+        if (s->d1->listener != NULL)
+            SSL_free(s->d1->listener);
     }
+#endif

     DTLS_RECORD_LAYER_free(&s->rlayer);
-
     ssl3_free(ssl);
-
     OPENSSL_free(s->d1);
     s->d1 = NULL;
 }

 int dtls1_clear(SSL *ssl)
 {
-    pqueue *buffered_messages;
-    pqueue *sent_messages;
     size_t mtu;
     size_t link_mtu;
+    SSL_CONNECTION *s;

-    SSL_CONNECTION *s = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
+#ifndef OPENSSL_NO_DTLS
+    if (IS_DTLS_LISTENER(ssl))
+        return 1;
+#endif
+
+    s = SSL_CONNECTION_FROM_SSL_ONLY(ssl);

     if (s == NULL)
         return 0;
@@ -185,9 +350,16 @@ int dtls1_clear(SSL *ssl)

     if (s->d1) {
         DTLS_timer_cb timer_cb = s->d1->timer_cb;
+#ifndef OPENSSL_NO_SOCK
+        BIO_ADDR peer_addr = s->d1->peer_addr;
+#endif
+#ifndef OPENSSL_NO_DTLS
+        DTLS_RX *rx = s->d1->rx;
+        SSL *listener = s->d1->listener;
+        OSSL_TIME created_at = s->d1->created_at;
+        unsigned int req_blocking_mode = s->d1->req_blocking_mode;
+#endif

-        buffered_messages = s->d1->buffered_messages;
-        sent_messages = s->d1->sent_messages;
         mtu = s->d1->mtu;
         link_mtu = s->d1->link_mtu;

@@ -198,17 +370,31 @@ int dtls1_clear(SSL *ssl)
         /* Restore the timer callback from previous state */
         s->d1->timer_cb = timer_cb;

-        if (s->server) {
-            s->d1->cookie_len = sizeof(s->d1->cookie);
-        }
+#ifndef OPENSSL_NO_SOCK
+        /*
+         * Restore peer address, DTLS_RX, listener, and created_at for
+         * listener-created connections. These are set via
+         * SSL_set1_initial_peer_addr(), ossl_dtls_rx_new(), and
+         * dtls_listener_create_conn_ssl() before the handshake starts,
+         * and must be preserved across SSL_clear().
+         */
+        s->d1->peer_addr = peer_addr;
+#endif
+#ifndef OPENSSL_NO_DTLS
+        s->d1->rx = rx;
+        s->d1->listener = listener;
+        /*
+         * The blocking mode is a property of the connection as the application
+         * configured it, not of the handshake, so it survives a clear.
+         */
+        s->d1->req_blocking_mode = req_blocking_mode;
+        s->d1->created_at = created_at;
+#endif

         if (SSL_get_options(ssl) & SSL_OP_NO_QUERY_MTU) {
             s->d1->mtu = mtu;
             s->d1->link_mtu = link_mtu;
         }
-
-        s->d1->buffered_messages = buffered_messages;
-        s->d1->sent_messages = sent_messages;
     }

     if (!ssl3_clear(ssl))
@@ -230,7 +416,12 @@ long dtls1_ctrl(SSL *ssl, int cmd, long larg, void *parg)
 {
     int ret = 0;
     OSSL_TIME t;
-    SSL_CONNECTION *s = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
+    SSL_CONNECTION *s;
+
+    if (IS_DTLS_LISTENER(ssl))
+        return 0;
+
+    s = SSL_CONNECTION_FROM_SSL_ONLY(ssl);

     if (s == NULL)
         return 0;
@@ -246,18 +437,18 @@ long dtls1_ctrl(SSL *ssl, int cmd, long larg, void *parg)
         ret = dtls1_handle_timeout(s);
         break;
     case DTLS_CTRL_SET_LINK_MTU:
-        if (larg < (long)dtls1_link_min_mtu())
+        if (larg < (long)dtls1_link_min_mtu)
             return 0;
         s->d1->link_mtu = larg;
         return 1;
     case DTLS_CTRL_GET_LINK_MIN_MTU:
-        return (long)dtls1_link_min_mtu();
+        return (long)dtls1_link_min_mtu;
     case SSL_CTRL_SET_MTU:
         /*
          *  We may not have a BIO set yet so can't call dtls1_min_mtu()
-         *  We'll have to make do with dtls1_link_min_mtu() and max overhead
+         *  We'll have to make do with dtls1_link_min_mtu and max overhead
          */
-        if (larg < (long)dtls1_link_min_mtu() - DTLS1_MAX_MTU_OVERHEAD)
+        if (larg < (long)dtls1_link_min_mtu - DTLS1_MAX_MTU_OVERHEAD)
             return 0;
         s->d1->mtu = larg;
         return larg;
@@ -282,7 +473,7 @@ void dtls1_start_timer(SSL_CONNECTION *s)

 #ifndef OPENSSL_NO_SCTP
     /* Disable timer for SCTP */
-    if (BIO_dgram_is_sctp(SSL_get_wbio(ssl))) {
+    if (SSL_get_wbio(ssl) != NULL && BIO_dgram_is_sctp(SSL_get_wbio(ssl))) {
         s->d1->next_timeout = ossl_time_zero();
         return;
     }
@@ -360,7 +551,7 @@ void dtls1_stop_timer(SSL_CONNECTION *s)
     s->d1->timeout_duration_us = 1000000;
     dtls1_bio_set_next_timeout(s->rbio, s->d1);
     /* Clear retransmission buffer */
-    dtls1_clear_sent_buffer(s);
+    dtls1_clear_sent_buffer(s, 0);
 }

 int dtls1_check_timeout_num(SSL_CONNECTION *s)
@@ -401,7 +592,14 @@ int dtls1_handle_timeout(SSL_CONNECTION *s)
         dtls1_double_timeout(s);

     if (dtls1_check_timeout_num(s) < 0) {
-        /* SSLfatal() already called */
+        /*
+         * SSLfatal() already called, so the connection is finished. Stop the
+         * timer rather than returning with next_timeout left in the past:
+         * nothing will re-arm or clear it from here, so DTLSv1_get_timeout()
+         * would report "due now" for ever and spin any caller which waits on
+         * it.
+         */
+        dtls1_stop_timer(s);
         return -1;
     }

@@ -424,7 +622,7 @@ int dtls1_handle_timeout(SSL_CONNECTION *s)
         return 0;

     /* Calls SSLfatal() if required */
-    return dtls1_retransmit_buffered_messages(s);
+    return dtls1_retransmit_sent_messages(s);
 }

 #define LISTEN_SUCCESS 2
@@ -439,6 +637,7 @@ int DTLSv1_listen(SSL *ssl, BIO_ADDR *client)
     const unsigned char *data;
     unsigned char *buf = NULL, *wbuf;
     size_t fragoff, fraglen, msglen;
+    uint64_t record_sequence = 0;
     unsigned int rectype, versmajor, versminor, msgseq, msgtype, clientvers, cookielen;
     BIO *rbio, *wbio;
     BIO_ADDR *tmpclient = NULL;
@@ -479,6 +678,40 @@ int DTLSv1_listen(SSL *ssl, BIO_ADDR *client)
         return -1;
     }

+    /*
+     * DTLSv1_listen() only supports the legacy HelloVerifyRequest mechanism
+     * which is not used in DTLS 1.3. For DTLS 1.3, use the SSL_new_listener()
+     * API instead which supports HelloRetryRequest with cookies.
+     *
+     * If the SSL object is configured for DTLS 1.3 only (both min and max
+     * are set to DTLS 1.3), we must fail since there's no room to downgrade.
+     * Otherwise, if max allows DTLS 1.3, we clamp it down to DTLS 1.2 so
+     * that the handshake will use HelloVerifyRequest.
+     */
+    if (SSL_CONNECTION_IS_DTLS(s)) {
+        int min_version = s->min_proto_version;
+        int max_version = s->max_proto_version;
+
+        /*
+         * Check if configured for DTLS 1.3 only - this is not supported.
+         * min_proto_version of 0 means "use default" which includes older versions,
+         * so only fail if min is explicitly set to DTLS 1.3.
+         */
+        if (min_version == DTLS1_3_VERSION
+            && (max_version == 0 || max_version == DTLS1_3_VERSION)) {
+            ERR_raise(ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION);
+            return -1;
+        }
+
+        /* max_proto_version of 0 means "use default" which could include 1.3 */
+        if (max_version == 0 || DTLS_VERSION_GE(max_version, DTLS1_3_VERSION)) {
+            if (!SSL_set_max_proto_version(ssl, DTLS1_2_VERSION)) {
+                ERR_raise(ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION);
+                return -1;
+            }
+        }
+    }
+
     buf = OPENSSL_malloc(DTLS1_RT_HEADER_LENGTH + SSL3_RT_MAX_PLAIN_LENGTH);
     if (buf == NULL)
         return -1;
@@ -565,6 +798,12 @@ int DTLSv1_listen(SSL *ssl, BIO_ADDR *client)
             ERR_raise(ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE);
             goto end;
         }
+        record_sequence = ((uint64_t)seq[2]) << 40;
+        record_sequence |= ((uint64_t)seq[3]) << 32;
+        record_sequence |= ((uint64_t)seq[4]) << 24;
+        record_sequence |= ((uint64_t)seq[5]) << 16;
+        record_sequence |= ((uint64_t)seq[6]) << 8;
+        record_sequence |= ((uint64_t)seq[7]);

         /* Get a pointer to the raw message for the later callback */
         data = PACKET_data(&msgpkt);
@@ -759,10 +998,17 @@ int DTLSv1_listen(SSL *ssl, BIO_ADDR *client)
                 &wbuf[DTLS1_RT_HEADER_LENGTH + DTLS1_HM_HEADER_LENGTH - 3],
                 3);

-            if (s->msg_callback)
-                s->msg_callback(1, version, SSL3_RT_HEADER, wbuf,
-                    DTLS1_RT_HEADER_LENGTH, ssl,
-                    s->msg_callback_arg);
+            if (s->msg_callback) {
+                /* Report the outgoing DTLS record header */
+                s->msg_callback(1, (int)version, SSL3_RT_HEADER,
+                    wbuf, DTLS1_RT_HEADER_LENGTH,
+                    ssl, s->msg_callback_arg);
+                /* Report the HelloVerifyRequest handshake message */
+                s->msg_callback(1, (int)version, SSL3_RT_HANDSHAKE,
+                    wbuf + DTLS1_RT_HEADER_LENGTH,
+                    wreclen - DTLS1_RT_HEADER_LENGTH,
+                    ssl, s->msg_callback_arg);
+            }

             if ((tmpclient = BIO_ADDR_new()) == NULL) {
                 ERR_raise(ERR_LIB_SSL, ERR_R_BIO_LIB);
@@ -780,7 +1026,7 @@ int DTLSv1_listen(SSL *ssl, BIO_ADDR *client)
             BIO_ADDR_free(tmpclient);
             tmpclient = NULL;

-            if (BIO_write(wbio, wbuf, wreclen) < (int)wreclen) {
+            if (BIO_write(wbio, wbuf, (int)wreclen) < (int)wreclen) {
                 if (BIO_should_retry(wbio)) {
                     /*
                      * Non-blocking IO...but we're stateless, so we're just
@@ -812,7 +1058,13 @@ int DTLSv1_listen(SSL *ssl, BIO_ADDR *client)
     s->d1->handshake_read_seq = 1;
     s->d1->handshake_write_seq = 1;
     s->d1->next_handshake_write_seq = 1;
-    s->rlayer.wrlmethod->increment_sequence_ctr(s->rlayer.wrl);
+    if (s->rlayer.wrlmethod->set_sequence == NULL
+        || !s->rlayer.wrlmethod->set_sequence(s->rlayer.wrl,
+            record_sequence)) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        ret = -1;
+        goto end;
+    }

     /*
      * We are doing cookie exchange, so make sure we set that option in the
@@ -843,12 +1095,11 @@ int DTLSv1_listen(SSL *ssl, BIO_ADDR *client)
      * Reset the record layer - but this time we can use the record we just
      * buffered in s->rlayer.rrlnext
      */
-    if (!ssl_set_new_record_layer(s,
-            DTLS_ANY_VERSION,
+    if (!ssl_set_new_record_layer(s, DTLS_ANY_VERSION,
             OSSL_RECORD_DIRECTION_READ,
             OSSL_RECORD_PROTECTION_LEVEL_NONE, NULL, 0,
-            NULL, 0, NULL, 0, NULL, 0, NULL, 0,
-            NID_undef, NULL, NULL, NULL)) {
+            NULL, NULL, 0, NULL, 0, NULL, 0, NULL, NULL,
+            0, NID_undef, NULL, NULL, NULL)) {
         /* SSLfatal already called */
         ret = -1;
         goto end;
@@ -926,21 +1177,16 @@ int dtls1_query_mtu(SSL_CONNECTION *s)
     return 1;
 }

-static size_t dtls1_link_min_mtu(void)
-{
-    return (g_probable_mtu[(sizeof(g_probable_mtu) / sizeof(g_probable_mtu[0])) - 1]);
-}
-
 size_t dtls1_min_mtu(SSL_CONNECTION *s)
 {
     SSL *ssl = SSL_CONNECTION_GET_SSL(s);

-    return dtls1_link_min_mtu() - BIO_dgram_get_mtu_overhead(SSL_get_wbio(ssl));
+    return dtls1_link_min_mtu - BIO_dgram_get_mtu_overhead(SSL_get_wbio(ssl));
 }

 size_t DTLS_get_data_mtu(const SSL *ssl)
 {
-    size_t mac_overhead, int_overhead, blocksize, ext_overhead;
+    size_t mac_overhead, int_overhead, blocksize, ext_overhead, rechdrlen = 0;
     const SSL_CIPHER *ciph = SSL_get_current_cipher(ssl);
     size_t mtu;
     const SSL_CONNECTION *s = SSL_CONNECTION_FROM_CONST_SSL_ONLY(ssl);
@@ -953,8 +1199,8 @@ size_t DTLS_get_data_mtu(const SSL *ssl)
     if (ciph == NULL)
         return 0;

-    if (!ssl_cipher_get_overhead(ciph, &mac_overhead, &int_overhead,
-            &blocksize, &ext_overhead))
+    if (!ssl_cipher_get_overhead(ciph, SSL_version(ssl), &mac_overhead,
+            &int_overhead, &blocksize, &ext_overhead))
         return 0;

     if (SSL_READ_ETM(s))
@@ -962,10 +1208,36 @@ size_t DTLS_get_data_mtu(const SSL *ssl)
     else
         int_overhead += mac_overhead;

+    if (SSL_version(ssl) == DTLS1_3_VERSION) {
+        switch (SSL_get_state(ssl)) {
+        case TLS_ST_BEFORE:
+        case DTLS_ST_CR_HELLO_VERIFY_REQUEST:
+        case TLS_ST_CR_SRVR_HELLO:
+        case TLS_ST_CW_CLNT_HELLO:
+        case TLS_ST_CW_COMP_CERT:
+        case TLS_ST_CW_KEY_EXCH:
+        case TLS_ST_SW_HELLO_REQ:
+        case TLS_ST_SR_CLNT_HELLO:
+        case DTLS_ST_SW_HELLO_VERIFY_REQUEST:
+        case TLS_ST_SW_SRVR_HELLO:
+        case TLS_ST_CR_HELLO_REQ:
+            rechdrlen = DTLS1_RT_HEADER_LENGTH;
+            break;
+        default:
+            rechdrlen = DTLS13_UNI_HDR_FIXED_LENGTH;
+            break;
+        }
+
+        /* Added record type at the end of the data */
+        int_overhead++;
+    } else {
+        rechdrlen = DTLS1_RT_HEADER_LENGTH;
+    }
+
     /* Subtract external overhead (e.g. IV/nonce, separate MAC) */
-    if (ext_overhead + DTLS1_RT_HEADER_LENGTH >= mtu)
+    if (ext_overhead + rechdrlen >= mtu)
         return 0;
-    mtu -= ext_overhead + DTLS1_RT_HEADER_LENGTH;
+    mtu -= ext_overhead + rechdrlen;

     /* Round encrypted payload down to cipher block size (for CBC etc.)
      * No check for overflow since 'mtu % blocksize' cannot exceed mtu. */
@@ -989,3 +1261,2307 @@ void DTLS_set_timer_cb(SSL *ssl, DTLS_timer_cb cb)

     s->d1->timer_cb = cb;
 }
+
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+/*
+ * dtls_listener_connection_free - free an SSL connection owned by the listener.
+ *
+ * This function is used to free SSL connections that are in the listener's
+ * pending_conns or incoming_connections queues. These connections are owned
+ * by the listener, NOT by the application.
+ *
+ * Connections in pending_conns and incoming_connections do NOT hold a reference
+ * to the listener, even though sc->d1->listener points to it. This is intentional:
+ * if these connections held a reference to the listener, the listener's reference
+ * count would never reach zero, and ossl_dtls_listener_free() would never be
+ * called to clean up the pending/incoming connections - creating a circular
+ * dependency.
+ *
+ * Only when a connection is returned to the application via SSL_accept_connection()
+ * does it take a reference on the listener. At that point, ownership transfers
+ * to the application, and the normal SSL_free() path is used.
+ *
+ * The assert on ssl->references == 1 ensures that nobody else has taken a
+ * reference to this connection while it was in the listener's queues. If
+ * this assert fires, something has gone wrong with ownership tracking.
+ */
+static void dtls_listener_connection_free(SSL *ssl)
+{
+    SSL_CONNECTION *sc;
+
+    if (ssl == NULL)
+        return;
+
+    sc = SSL_CONNECTION_FROM_SSL(ssl);
+
+    if (sc != NULL && sc->d1 != NULL) {
+        /*
+         * Clear listener reference to prevent dtls1_free() from calling
+         * SSL_free() on the listener. The connection does not own the listener
+         * and SSL_free must not free the listener
+         */
+        sc->d1->listener = NULL;
+    }
+    SSL_free(ssl);
+}
+
+/*
+ * dtls_listener_create_conn_ssl - create an SSL object for a new connection.
+ *
+ * Creates and initializes an SSL object for handling a new incoming
+ * connection. Sets up the DTLS_RX for URXE-based packet injection, with
+ * the write BIO connected to the listener's network BIO.
+ *
+ * Returns: new SSL object on success, NULL on failure
+ */
+static SSL *dtls_listener_create_conn_ssl(DTLS_LISTENER *dl,
+    const BIO_ADDR *peer)
+{
+    SSL *ssl = NULL;
+    SSL_CONNECTION *sc = NULL;
+    BIO *wbio = NULL;
+
+    ssl = SSL_new(dl->ssl.ctx);
+    if (ssl == NULL)
+        goto err;
+
+    sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
+    if (sc == NULL || sc->d1 == NULL)
+        goto err;
+
+    SSL_set_accept_state(ssl);
+
+    /*
+     * Create DTLS_RX for this connection. The demux is owned by the listener
+     * and will outlive this connection. DTLS_RX manages the URXE queue for
+     * incoming packets.
+     */
+    sc->d1->rx = ossl_dtls_rx_new(dl->demux);
+    if (sc->d1->rx == NULL)
+        goto err;
+    sc->listener_rx = sc->d1->rx;
+
+    /*
+     * Update the read record layer to use the URXE queue if it already exists.
+     * This is needed because the record layer may have been created before
+     * sc->d1->rx was set, similar to how SSL_set1_initial_peer_addr() updates
+     * the peer address on existing record layers.
+     */
+    if (sc->rlayer.rrlmethod != NULL && sc->rlayer.rrl != NULL
+        && sc->rlayer.rrlmethod->set_use_urxe != NULL)
+        sc->rlayer.rrlmethod->set_use_urxe(sc->rlayer.rrl, 1);
+
+    /*
+     * Store reference to parent listener. This allows the connection to
+     * trigger the listener's demux pump when reading data.
+     */
+    sc->d1->listener = &dl->ssl;
+
+    /*
+     * Record when this connection was created. This is used to detect and
+     * clean up stale pending connections that haven't completed their
+     * handshake within the timeout period.
+     */
+    sc->d1->created_at = dtls_listener_get_time_direct(dl);
+
+    /*
+     * For writes, use the shared network wbio. The peer address is NOT set
+     * on the BIO itself (which would affect all connections sharing this BIO).
+     * Instead, the peer address will be passed to the record layer during
+     * SSL_do_handshake(), and the record layer will use BIO_sendmmsg() with
+     * the peer address for each write.
+     */
+    wbio = dl->net_wbio;
+
+    if (wbio == NULL) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_BIO_NOT_SET);
+        goto err;
+    }
+
+    if (!BIO_up_ref(wbio))
+        goto err;
+
+    SSL_set0_rbio(ssl, NULL);
+    SSL_set0_wbio(ssl, wbio);
+    wbio = NULL; /* ownership transferred */
+
+    /*
+     * Store the peer address in the SSL connection. This will be passed to
+     * the record layer when it is created during SSL_do_handshake().
+     */
+    if (!SSL_set1_initial_peer_addr(ssl, peer))
+        goto err;
+
+    /*
+     * Enable cookie exchange if required by listener flags.
+     * This tells the state machine to perform HVR (DTLS 1.2) or
+     * HRR with cookie (DTLS 1.3) validation.
+     */
+    if (dl->require_hvr_cookie || dl->require_hrr_cookie)
+        SSL_set_options(ssl, SSL_OP_COOKIE_EXCHANGE);
+
+    return ssl;
+
+err:
+    dtls_listener_connection_free(ssl);
+    return NULL;
+}
+
+/*
+ * dtls_listener_signal_notifier - wake threads blocked on this listener.
+ *
+ * Readiness may be produced by the thread which pumps the demux while a
+ * different thread is blocked in poll() on the network socket. That socket
+ * will not necessarily become readable again from the blocked thread's point
+ * of view, so the notifier is used to wake it.
+ *
+ * The caller must hold dl->mutex.
+ */
+static void dtls_listener_signal_notifier(DTLS_LISTENER *dl)
+{
+    if (dl->have_notifier && dl->cur_blocking_waiters > 0
+        && !dl->signalled_notifier) {
+        ossl_rio_notifier_signal(&dl->notifier);
+        dl->signalled_notifier = 1;
+    }
+}
+
+/*
+ * dtls_listener_packet_handler - callback for handling incoming datagrams.
+ *
+ * This callback is invoked by the demux for each received datagram. It routes
+ * the URXE to the appropriate connection based on peer address, creating a
+ * new pending connection if necessary.
+ *
+ * The URXE ownership is transferred to the connection's DTLS_RX queue.
+ * If routing fails, the URXE is released back to the demux.
+ */
+static void dtls_listener_packet_handler(DGRAM_URXE *urxe, void *arg)
+{
+    DTLS_LISTENER *dl = arg;
+    SSL *conn_ssl = NULL;
+    SSL_CONNECTION *sc = NULL;
+    int pending = 0;
+
+    ossl_crypto_mutex_lock(dl->mutex);
+
+    /* Check established connections first */
+    if (dl->established_conns != NULL)
+        conn_ssl = ossl_dgram_conn_lookup_find(dl->established_conns, urxe);
+
+    /* Check pending connections */
+    if (conn_ssl == NULL) {
+        conn_ssl = ossl_dgram_conn_lookup_find(dl->pending_conns, urxe);
+        pending = 1;
+    }
+
+    /* Create new pending connection if needed */
+    if (conn_ssl == NULL) {
+        /*
+         * Reject before allocating anything if we have reached the pending
+         * connection limit. The LHASH item count is O(1), and this check does
+         * not need a conn_ssl, so performing it first avoids creating and then
+         * immediately freeing a connection when we are at capacity.
+         */
+        if (ossl_dgram_conn_lookup_num_items(dl->pending_conns)
+                + (size_t)sk_SSL_num(dl->incoming_connections)
+            >= dl->max_pending_conns)
+            goto release;
+
+        conn_ssl = dtls_listener_create_conn_ssl(dl, &urxe->peer);
+        if (conn_ssl == NULL)
+            goto release;
+
+        /*
+         * Register the connection in pending_conns before running the
+         * application callback. This is to avoid a race condition where
+         * another thread grabs the lock and tries to register a connection
+         * for this address.
+         */
+        if (!ossl_dgram_conn_lookup_register(dl->pending_conns, urxe, conn_ssl)) {
+            dtls_listener_connection_free(conn_ssl);
+            goto release;
+        }
+
+        /*
+         * Give the application a chance to decorate or veto the new
+         * pending connection via SSL_CTX_set_new_pending_conn_cb().
+         *
+         * A return value of 0 from the callback means "discard this
+         * connection". On a non-zero return there is nothing more to do here:
+         * we already registered the connection above.
+         */
+        if (dl->ssl.ctx->new_pending_conn_cb != NULL) {
+            int keep;
+
+            sc = SSL_CONNECTION_FROM_SSL_ONLY(conn_ssl);
+            if (sc == NULL || sc->d1 == NULL) {
+                ossl_dgram_conn_lookup_unregister(dl->pending_conns, &urxe->peer);
+                dtls_listener_connection_free(conn_ssl);
+                goto release;
+            }
+
+            /*
+             * Mark the connection being_driven while the mutex is dropped for
+             * the callback. This keeps the tick loop away from this connection.
+             */
+            sc->listener_being_driven = 1;
+            ossl_crypto_mutex_unlock(dl->mutex);
+            keep = dl->ssl.ctx->new_pending_conn_cb(dl->ssl.ctx, conn_ssl,
+                dl->ssl.ctx->new_pending_conn_arg);
+            ossl_crypto_mutex_lock(dl->mutex);
+
+            if (!keep) {
+                /*
+                 * The pending callback doesn't want this connection, so
+                 * unregister and free it. While the mutex was dropped a
+                 * concurrent handler may have found this same connection and
+                 * injected datagrams into its RX queue; freeing releases them
+                 * back to the demux via ossl_dtls_rx_free(), so nothing leaks.
+                 * being_driven kept the tick away, so the connection still
+                 * holds only its single reference and the free is safe.
+                 */
+                ossl_dgram_conn_lookup_unregister(dl->pending_conns, &urxe->peer);
+                dtls_listener_connection_free(conn_ssl);
+                goto release;
+            }
+
+            sc->listener_being_driven = 0;
+        }
+    }
+
+    sc = SSL_CONNECTION_FROM_SSL_ONLY(conn_ssl);
+    if (sc == NULL || sc->listener_rx == NULL)
+        goto release;
+
+    /* Inject packet into connection's URXE queue */
+    ossl_dtls_rx_inject_urxe(sc->listener_rx, urxe);
+
+    /*
+     * A connection being driven is rechecked by its driver in phase 3 of
+     * dtls_listener_drive_pass(). Anything else needs another pass.
+     */
+    if (pending && !sc->listener_being_driven)
+        dl->pending_input = 1;
+
+    /* Signal notifier if needed */
+    dtls_listener_signal_notifier(dl);
+
+    ossl_crypto_mutex_unlock(dl->mutex);
+    return;
+
+release:
+    ossl_crypto_mutex_unlock(dl->mutex);
+    ossl_dgram_demux_release_urxe(dl->demux, urxe);
+}
+
+/*
+ * DTLS Listener Internal Cookie Callbacks
+ *
+ * These callbacks are used internally by the DTLS listener to generate and
+ * verify cookies for address validation. They use HMAC-SHA256 with the
+ * SSL_CTX's cookie_hmac_key to create cookies that bind to the client's
+ * address.
+ *
+ * Cookie format:
+ *   - 8 bytes: timestamp (seconds since epoch)
+ *   - 32 bytes: HMAC-SHA256(timestamp || peer_address)
+ *
+ * Total cookie size: 40 bytes
+ */
+#define DTLS_LISTENER_COOKIE_TIMESTAMP_LEN 8
+#define DTLS_LISTENER_COOKIE_HMAC_LEN 32
+#define DTLS_LISTENER_COOKIE_LEN (DTLS_LISTENER_COOKIE_TIMESTAMP_LEN + DTLS_LISTENER_COOKIE_HMAC_LEN)
+
+/* Maximum age of a cookie in seconds (default: 60 seconds) */
+#define DTLS_LISTENER_COOKIE_MAX_AGE 60
+
+/*
+ * dtls_listener_get_time - get current time from the listener
+ *
+ * Returns the current time using the listener's time callback if set,
+ * otherwise uses ossl_time_now().
+ *
+ * If ssl is not associated with a listener, returns ossl_time_now().
+ */
+static OSSL_TIME dtls_listener_get_time(SSL *ssl)
+{
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
+    DTLS_LISTENER *dl;
+
+    if (sc == NULL || sc->d1 == NULL || sc->d1->listener == NULL)
+        return ossl_time_now();
+
+    dl = (DTLS_LISTENER *)sc->d1->listener;
+
+    if (dl->now_cb == NULL)
+        return ossl_time_now();
+
+    return dl->now_cb(dl->now_cb_arg);
+}
+
+/*
+ * dtls_listener_get_time_direct - get current time directly from listener
+ *
+ * Same as dtls_listener_get_time but takes the listener directly.
+ * Used during connection creation before listener reference is fully set up.
+ */
+static OSSL_TIME dtls_listener_get_time_direct(DTLS_LISTENER *dl)
+{
+    if (dl == NULL)
+        return ossl_time_now();
+
+    if (dl->now_cb == NULL)
+        return ossl_time_now();
+
+    return dl->now_cb(dl->now_cb_arg);
+}
+
+/*
+ * dtls_listener_cookie_hmac - compute HMAC for cookie validation
+ *
+ * Computes HMAC-SHA256(timestamp || port || raw_address) using the
+ * context's cookie_hmac_key.
+ *
+ * Returns 1 on success, 0 on failure.
+ */
+int dtls_listener_cookie_hmac(SSL *ssl, uint64_t timestamp,
+    unsigned char *hmac_out)
+{
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
+    SSL_CTX *ctx;
+    EVP_MAC_CTX *mctx = NULL;
+    OSSL_PARAM params[2];
+    /* 8 (timestamp) + 2 (port) + max address size */
+    unsigned char data[DTLS_LISTENER_COOKIE_TIMESTAMP_LEN + sizeof(uint16_t) + sizeof(BIO_ADDR)];
+    unsigned char addr_buf[sizeof(BIO_ADDR)];
+    size_t data_len = 0;
+    size_t addr_len = 0;
+    size_t hmac_len = DTLS_LISTENER_COOKIE_HMAC_LEN;
+    uint16_t port;
+    WPACKET pkt;
+    int ret = 0;
+
+    if (sc == NULL || sc->d1 == NULL)
+        return 0;
+
+    ctx = SSL_CONNECTION_GET_CTX(sc);
+    if (ctx == NULL)
+        return 0;
+
+    /* Get port and raw address */
+    port = BIO_ADDR_rawport(&sc->d1->peer_addr);
+
+    if (!BIO_ADDR_rawaddress(&sc->d1->peer_addr, addr_buf, &addr_len))
+        return 0;
+
+    /* Build data to HMAC: timestamp || port || raw_address */
+    if (!WPACKET_init_static_len(&pkt, data, sizeof(data), 0)
+        || !WPACKET_put_bytes_u64(&pkt, timestamp)
+        || !WPACKET_put_bytes_u16(&pkt, port)
+        || !WPACKET_memcpy(&pkt, addr_buf, addr_len)
+        || !WPACKET_get_total_written(&pkt, &data_len)
+        || !WPACKET_finish(&pkt)) {
+        WPACKET_cleanup(&pkt);
+        return 0;
+    }
+
+    mctx = EVP_MAC_CTX_new(ctx->hmac);
+    if (mctx == NULL)
+        goto err;
+
+    params[0] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST,
+        "SHA2-256", 0);
+    params[1] = OSSL_PARAM_construct_end();
+
+    if (!EVP_MAC_init(mctx, ctx->ext.cookie_hmac_key,
+            sizeof(ctx->ext.cookie_hmac_key), params))
+        goto err;
+
+    if (!EVP_MAC_update(mctx, data, data_len))
+        goto err;
+
+    if (!EVP_MAC_final(mctx, hmac_out, &hmac_len, hmac_len))
+        goto err;
+
+    ret = 1;
+
+err:
+    EVP_MAC_CTX_free(mctx);
+    return ret;
+}
+
+/*
+ * ossl_dtls_listener_gen_cookie_cb - internal HVR cookie generate callback
+ *
+ * Generates a cookie for HelloVerifyRequest (DTLS 1.2).
+ * Cookie format: timestamp (8 bytes) || HMAC (32 bytes)
+ */
+int ossl_dtls_listener_gen_cookie_cb(SSL *ssl, unsigned char *cookie,
+    unsigned int *cookie_len)
+{
+    uint64_t now = ossl_time2seconds(dtls_listener_get_time(ssl));
+
+    /* Write timestamp */
+    cookie[0] = (unsigned char)(now >> 56);
+    cookie[1] = (unsigned char)(now >> 48);
+    cookie[2] = (unsigned char)(now >> 40);
+    cookie[3] = (unsigned char)(now >> 32);
+    cookie[4] = (unsigned char)(now >> 24);
+    cookie[5] = (unsigned char)(now >> 16);
+    cookie[6] = (unsigned char)(now >> 8);
+    cookie[7] = (unsigned char)(now);
+
+    /* Compute and append HMAC */
+    if (!dtls_listener_cookie_hmac(ssl, now, cookie + DTLS_LISTENER_COOKIE_TIMESTAMP_LEN))
+        return 0;
+
+    *cookie_len = DTLS_LISTENER_COOKIE_LEN;
+    return 1;
+}
+
+/*
+ * ossl_dtls_listener_verify_cookie_cb - internal HVR cookie verify callback
+ *
+ * Verifies a cookie from ClientHello (DTLS 1.2).
+ * Checks that:
+ *   1. Cookie length is correct
+ *   2. Timestamp is not too old
+ *   3. HMAC matches
+ */
+int ossl_dtls_listener_verify_cookie_cb(SSL *ssl, const unsigned char *cookie,
+    unsigned int cookie_len)
+{
+    uint64_t cookie_time, now;
+    unsigned char expected_hmac[DTLS_LISTENER_COOKIE_HMAC_LEN];
+
+    if (cookie_len != DTLS_LISTENER_COOKIE_LEN)
+        return 0;
+
+    /* Extract timestamp from cookie */
+    cookie_time = ((uint64_t)cookie[0] << 56)
+        | ((uint64_t)cookie[1] << 48)
+        | ((uint64_t)cookie[2] << 40)
+        | ((uint64_t)cookie[3] << 32)
+        | ((uint64_t)cookie[4] << 24)
+        | ((uint64_t)cookie[5] << 16)
+        | ((uint64_t)cookie[6] << 8)
+        | ((uint64_t)cookie[7]);
+
+    /* Check timestamp is not too old */
+    now = ossl_time2seconds(dtls_listener_get_time(ssl));
+    if (now > cookie_time && (now - cookie_time) > DTLS_LISTENER_COOKIE_MAX_AGE)
+        return 0;
+
+    /* Compute expected HMAC and compare */
+    if (!dtls_listener_cookie_hmac(ssl, cookie_time, expected_hmac))
+        return 0;
+
+    if (CRYPTO_memcmp(cookie + DTLS_LISTENER_COOKIE_TIMESTAMP_LEN,
+            expected_hmac, DTLS_LISTENER_COOKIE_HMAC_LEN)
+        != 0)
+        return 0;
+
+    return 1;
+}
+
+/*
+ * ossl_dtls_listener_gen_stateless_cookie_cb - internal HRR cookie generate callback
+ *
+ * Generates a cookie for HelloRetryRequest (DTLS 1.3).
+ * Uses the same format as the HVR cookie.
+ */
+int ossl_dtls_listener_gen_stateless_cookie_cb(SSL *ssl, unsigned char *cookie,
+    size_t *cookie_len)
+{
+    uint64_t now = ossl_time2seconds(dtls_listener_get_time(ssl));
+
+    /* Write timestamp */
+    cookie[0] = (unsigned char)(now >> 56);
+    cookie[1] = (unsigned char)(now >> 48);
+    cookie[2] = (unsigned char)(now >> 40);
+    cookie[3] = (unsigned char)(now >> 32);
+    cookie[4] = (unsigned char)(now >> 24);
+    cookie[5] = (unsigned char)(now >> 16);
+    cookie[6] = (unsigned char)(now >> 8);
+    cookie[7] = (unsigned char)(now);
+
+    /* Compute and append HMAC */
+    if (!dtls_listener_cookie_hmac(ssl, now, cookie + DTLS_LISTENER_COOKIE_TIMESTAMP_LEN))
+        return 0;
+
+    *cookie_len = DTLS_LISTENER_COOKIE_LEN;
+    return 1;
+}
+
+/*
+ * ossl_dtls_listener_verify_stateless_cookie_cb - internal HRR cookie verify callback
+ *
+ * Verifies a cookie from ClientHello (DTLS 1.3).
+ * Uses the same verification logic as the HVR cookie.
+ */
+int ossl_dtls_listener_verify_stateless_cookie_cb(SSL *ssl,
+    const unsigned char *cookie,
+    size_t cookie_len)
+{
+    uint64_t cookie_time, now;
+    unsigned char expected_hmac[DTLS_LISTENER_COOKIE_HMAC_LEN];
+
+    if (cookie_len != DTLS_LISTENER_COOKIE_LEN)
+        return 0;
+
+    /* Extract timestamp from cookie */
+    cookie_time = ((uint64_t)cookie[0] << 56)
+        | ((uint64_t)cookie[1] << 48)
+        | ((uint64_t)cookie[2] << 40)
+        | ((uint64_t)cookie[3] << 32)
+        | ((uint64_t)cookie[4] << 24)
+        | ((uint64_t)cookie[5] << 16)
+        | ((uint64_t)cookie[6] << 8)
+        | ((uint64_t)cookie[7]);
+
+    /* Check timestamp is not too old */
+    now = ossl_time2seconds(dtls_listener_get_time(ssl));
+    if (now > cookie_time && (now - cookie_time) > DTLS_LISTENER_COOKIE_MAX_AGE)
+        return 0;
+
+    /* Compute expected HMAC and compare */
+    if (!dtls_listener_cookie_hmac(ssl, cookie_time, expected_hmac))
+        return 0;
+
+    if (CRYPTO_memcmp(cookie + DTLS_LISTENER_COOKIE_TIMESTAMP_LEN,
+            expected_hmac, DTLS_LISTENER_COOKIE_HMAC_LEN)
+        != 0)
+        return 0;
+
+    return 1;
+}
+
+SSL *ossl_dtls_new_listener(SSL_CTX *ctx, uint64_t flags)
+{
+    DTLS_LISTENER *dl = NULL;
+    int ssl_init_done = 0;
+
+    if (ctx == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return NULL;
+    }
+
+    if ((dl = OPENSSL_zalloc(sizeof(*dl))) == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
+        goto err;
+    }
+
+    /*
+     * Use ossl_ssl_init to initialize the SSL object header consistently
+     * with other SSL object types.
+     */
+    if (!ossl_ssl_init(&dl->ssl, ctx, ctx->method, SSL_TYPE_DTLS_LISTENER)) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
+        goto err;
+    }
+    ssl_init_done = 1;
+
+    dl->mutex = ossl_crypto_mutex_new();
+#ifdef OPENSSL_THREADS
+    if (dl->mutex == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
+        goto err;
+    }
+#endif
+
+    /* Create demux with internal locking for thread safety. */
+    dl->demux = ossl_dgram_demux_new(NULL, 1, NULL, NULL);
+    if (dl->demux == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
+        goto err;
+    }
+
+    ossl_dgram_demux_set_max_free_urxe(dl->demux, DEMUX_MAX_FREE_URXE);
+
+    /* Set up the packet handler callback for routing datagrams to connections */
+    ossl_dgram_demux_set_default_handler(dl->demux, dtls_listener_packet_handler, dl);
+
+    dl->incoming_connections = sk_SSL_new_null();
+    if (dl->incoming_connections == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
+        goto err;
+    }
+
+    dl->pending_conns = ossl_dgram_conn_lookup_new_addr();
+    if (dl->pending_conns == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
+        goto err;
+    }
+
+    dl->established_conns = ossl_dgram_conn_lookup_new_addr();
+    if (dl->established_conns == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
+        goto err;
+    }
+
+    dl->net_rbio = NULL;
+    dl->net_wbio = NULL;
+    tsan_store(&dl->listening, 0);
+    dl->fatal = 0;
+
+    /* Default timeout for pending connections: 30 seconds */
+    dl->pending_timeout = ossl_seconds2time(30);
+
+    /* Default maximum pending connections */
+    dl->max_pending_conns = DTLS_LISTENER_DEFAULT_MAX_PENDING_CONNS;
+
+    /*
+     * The listener owns its receive-buffer size independent of any
+     * network BIO's send-path MTU.
+     */
+    dl->max_dgram_size = DTLS_LISTENER_DEFAULT_MAX_DGRAM_SIZE;
+    ossl_dgram_demux_set_mtu(dl->demux, (unsigned int)dl->max_dgram_size);
+
+    /*
+     * Address validation is performed by default: HelloVerifyRequest for
+     * DTLS 1.0/1.2 and a HelloRetryRequest cookie for DTLS 1.3.  It can be
+     * requested explicitly with SSL_LISTENER_FLAG_ADDRESS_VALIDATION, or
+     * disabled with SSL_LISTENER_FLAG_NO_VALIDATE.  If both are specified we
+     * fail safe and validate: SSL_LISTENER_FLAG_ADDRESS_VALIDATION wins.
+     */
+    if ((flags & SSL_LISTENER_FLAG_NO_VALIDATE) == 0
+        || (flags & SSL_LISTENER_FLAG_ADDRESS_VALIDATION) != 0) {
+        dl->require_hvr_cookie = 1;
+        dl->require_hrr_cookie = 1;
+    }
+
+    dl->have_notifier = 0;
+    dl->signalled_notifier = 0;
+    dl->cur_blocking_waiters = 0;
+
+    if ((flags & SSL_LISTENER_FLAG_SINGLE_THREAD) == 0) {
+        if (!ossl_rio_notifier_init(&dl->notifier))
+            goto err;
+
+        dl->notifier_cv = ossl_crypto_condvar_new();
+        if (dl->notifier_cv == NULL) {
+            ossl_rio_notifier_cleanup(&dl->notifier);
+            goto err;
+        }
+
+        dl->have_notifier = 1;
+    }
+
+    return &dl->ssl;
+
+err:
+    if (dl == NULL)
+        return NULL;
+
+    /*
+     * If ossl_ssl_init succeeded, SSL_free handles all cleanup
+     * including incoming_connections, notifier_cv, and OPENSSL_free(dl)
+     * itself via ossl_dtls_listener_free. Otherwise ossl_ssl_init
+     * did not run or partially failed, so we must free the raw
+     * allocation directly.
+     */
+    if (ssl_init_done)
+        SSL_free(&dl->ssl);
+    else
+        OPENSSL_free(dl);
+    return NULL;
+}
+
+/*
+ * Callback to free SSL objects in pending_conns hash table.
+ * The pending_conns hash table owns the SSL objects it contains,
+ * so we must free them before freeing the hash table itself.
+ */
+static void dtls_free_pending_ssl_cb(SSL *ssl, const BIO_ADDR *peer, void *arg)
+{
+    dtls_listener_connection_free(ssl);
+}
+
+void ossl_dtls_listener_free(SSL *s)
+{
+    DTLS_LISTENER *dl;
+
+    if (!IS_DTLS_LISTENER(s))
+        return;
+
+    dl = (DTLS_LISTENER *)s;
+
+    /* Free any pending incoming connections */
+    if (dl->incoming_connections != NULL) {
+        while (sk_SSL_num(dl->incoming_connections) > 0) {
+            SSL *conn = sk_SSL_pop(dl->incoming_connections);
+
+            dtls_listener_connection_free(conn);
+        }
+        sk_SSL_free(dl->incoming_connections);
+        dl->incoming_connections = NULL;
+    }
+
+    /*
+     * Free all pending connections in the hash table.
+     */
+    if (dl->pending_conns != NULL) {
+        ossl_dgram_conn_lookup_foreach(dl->pending_conns, dtls_free_pending_ssl_cb, NULL);
+        ossl_dgram_conn_lookup_free(dl->pending_conns);
+        dl->pending_conns = NULL;
+    }
+
+    /* Free all established connections in the hash table (no SSL ownership) */
+    if (dl->established_conns != NULL) {
+        ossl_dgram_conn_lookup_free(dl->established_conns);
+        dl->established_conns = NULL;
+    }
+
+    ossl_crypto_mutex_free(&dl->mutex);
+
+    /* Free the demux after all connections that reference it are freed */
+    if (dl->demux != NULL)
+        ossl_dgram_demux_free(dl->demux);
+
+    BIO_free_all(dl->net_wbio);
+    BIO_free_all(dl->net_rbio);
+
+    if (dl->have_notifier) {
+        ossl_crypto_condvar_free(&dl->notifier_cv);
+        ossl_rio_notifier_cleanup(&dl->notifier);
+    }
+}
+
+SSL *ossl_dtls_get0_listener(const SSL *ssl)
+{
+    if (!IS_DTLS_LISTENER(ssl))
+        return NULL;
+
+    return (SSL *)ssl;
+}
+
+/*
+ * ossl_dtls_listen - start a DTLS listener accepting incoming connections.
+ */
+int ossl_dtls_listen(SSL *ssl)
+{
+    DTLS_LISTENER *dl;
+
+    if (!IS_DTLS_LISTENER(ssl)) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+
+    dl = (DTLS_LISTENER *)ssl;
+
+    /* Already listening is not an error. */
+    if (tsan_load(&dl->listening))
+        return 1;
+
+    tsan_store(&dl->listening, 1);
+    return 1;
+}
+
+/*
+ * dtls_listener_conn_ready - check if connection is ready for accept queue.
+ *
+ * Determines whether the SSL object has completed cookie validation (if required)
+ * or has received a valid ClientHello (if no validation) and is ready to be
+ * moved to the incoming_connections queue.
+ *
+ * The connection is returned to the application BEFORE the handshake completes,
+ * allowing the application to finish the handshake itself. This provides more
+ * control over the handshake process.
+ *
+ * For HRR (DTLS 1.3 with validation): Ready when sc->ext.cookieok is set
+ * For HVR (DTLS 1.2 with validation): Ready when sc->d1->cookie_verified is set
+ * For no validation: Ready after receiving the first ClientHello
+ *
+ * Returns: 1 if ready, 0 if still in progress
+ */
+static int dtls_listener_conn_ready(SSL *ssl, DTLS_LISTENER *dl)
+{
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
+
+    if (sc == NULL)
+        return 0;
+
+    /*
+     * No validation required (SSL_LISTENER_FLAG_NO_VALIDATE):
+     * Ready immediately after receiving the first ClientHello.
+     * The connection exists in pending_conns, so it's ready.
+     */
+    if (!dl->require_hrr_cookie && !dl->require_hvr_cookie)
+        return 1;
+
+    /*
+     * For DTLS 1.3 with HRR requirement:
+     * Ready when the cookie has been validated (second ClientHello received
+     * with valid cookie after HRR was sent). The cookieok flag is set during
+     * ClientHello processing when the HRR cookie is successfully verified.
+     */
+    if (dl->require_hrr_cookie && sc->ext.cookieok)
+        return 1;
+
+    /*
+     * For DTLS 1.2 (and earlier) with HVR requirement:
+     * Ready when the cookie has been validated (second ClientHello received
+     * with valid cookie after HVR was sent). The cookie_verified flag is set
+     * during ClientHello processing when the HVR cookie is successfully verified.
+     */
+    if (dl->require_hvr_cookie && sc->d1 != NULL && sc->d1->cookie_verified)
+        return 1;
+
+    /* Not ready yet - still waiting for cookie validation */
+    return 0;
+}
+
+/*
+ * dtls_listener_conn_needs_retry - check if connection is waiting for more data.
+ *
+ * Determines whether the SSL object has sent an HRR/HVR and is waiting
+ * for the client's response.
+ *
+ * Returns: 1 if waiting for retry, 0 otherwise
+ */
+static int dtls_listener_conn_needs_retry(SSL *ssl)
+{
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
+
+    if (sc == NULL)
+        return 0;
+
+    /*
+     * For DTLS 1.3: HRR has been sent, waiting for second ClientHello
+     */
+    if (sc->hello_retry_request == SSL_HRR_PENDING
+        && !ossl_statem_in_error(sc))
+        return 1;
+
+    /*
+     * For DTLS 1.2: Check if we're in a state that indicates HVR was sent.
+     * The state machine will be waiting for the next ClientHello.
+     */
+    if (sc->statem.hand_state == DTLS_ST_SW_HELLO_VERIFY_REQUEST
+        && !ossl_statem_in_error(sc))
+        return 1;
+
+    return 0;
+}
+
+/*
+ * Context for drive_pending iteration.
+ */
+typedef struct {
+    DTLS_LISTENER *dl;
+    int ready_count; /* Connections ready to move to established */
+    int error_count; /* Connections with fatal errors */
+    STACK_OF(SSL) *to_drive; /* Connections to drive (collected in phase 1) */
+    STACK_OF(SSL) *ready_conns; /* Connections to move */
+    STACK_OF(SSL) *failed_conns; /* Connections to remove */
+} DRIVE_PENDING_CTX;
+
+/*
+ * Callback for collecting pending connections to drive.
+ * Called with dl->mutex held. Marks connections as being_driven and up-refs them.
+ * Also checks for timed-out connections and marks them as failed.
+ */
+static void collect_pending_cb(SSL *ssl, const BIO_ADDR *peer, void *arg)
+{
+    DRIVE_PENDING_CTX *ctx = arg;
+    DTLS_LISTENER *dl = ctx->dl;
+    SSL_CONNECTION *sc;
+
+    sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
+    if (sc == NULL)
+        return;
+
+    /*
+     * Skip if already being driven by another thread.
+     */
+    if (sc->listener_being_driven)
+        return;
+
+    if (sc->listener_rx == NULL || sc->d1 == NULL)
+        return;
+
+    /*
+     * Check if this pending connection has exceeded the timeout.
+     * Stale connections that haven't completed their handshake are removed
+     * to prevent resource exhaustion from incomplete handshakes.
+     */
+    if (!ossl_time_is_infinite(dl->pending_timeout)) {
+        OSSL_TIME now = dtls_listener_get_time_direct(dl);
+        OSSL_TIME age = ossl_time_subtract(now, sc->d1->created_at);
+
+        if (ossl_time_compare(age, dl->pending_timeout) > 0) {
+            /*
+             * Connection has timed out - mark for removal
+             *
+             * Set being_driven so that a concurrent ossl_dtls_tick() running
+             * phase 1 hits the being_driven check above and skips this
+             * connection, instead of collecting it and freeing it a second
+             * time (double-free).
+             *
+             * No up-ref is needed: phase 1 runs under dl->mutex, so collection
+             * is serialized, and being_driven keeps any other tick away until
+             * our phase 3 frees this connection. The single pending-queue
+             * reference is released by dtls_listener_connection_free() in the
+             * failed_conns loop.
+             *
+             * We intentionally do not handle a failed push specially: if the
+             * push fails (allocation failure) the connection stays registered
+             * in pending_conns and is simply retried on the next tick.
+             */
+            if (ctx->failed_conns != NULL && sk_SSL_push(ctx->failed_conns, ssl) > 0) {
+                sc->listener_being_driven = 1;
+                ctx->error_count++;
+            }
+            return;
+        }
+    }
+
+    if (sc->listener_idle && !dtls1_is_timer_expired(sc)) {
+        int empty;
+
+        ossl_crypto_mutex_lock(sc->listener_rx->mutex);
+        empty = ossl_list_urxe_is_empty(&sc->listener_rx->urxe_pending);
+        ossl_crypto_mutex_unlock(sc->listener_rx->mutex);
+        if (empty)
+            return;
+    }
+
+    /*
+     * Up-ref and add to list first, then mark as being driven.
+     * The up-ref ensures the connection stays valid while we drive it
+     * without holding the mutex.
+     */
+    if (!SSL_up_ref(ssl))
+        return;
+
+    if (sk_SSL_push(ctx->to_drive, ssl) <= 0) {
+        SSL_free(ssl); /* Release the ref we just took */
+        return;
+    }
+
+    sc->listener_being_driven = 1;
+}
+
+/*
+ * Drive a single connection's handshake.
+ * Called WITHOUT holding dl->mutex so demux_pump can be called safely.
+ */
+static void drive_single_connection(SSL *ssl, DTLS_LISTENER *dl,
+    DRIVE_PENDING_CTX *ctx)
+{
+    SSL_CONNECTION *sc;
+    int ret, ssl_err;
+
+    sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
+    if (sc == NULL)
+        return;
+
+    /*
+     * Drive the state machine with SSL_accept().
+     *
+     * We MUST set TLS1_FLAGS_STATELESS to prevent the state machine from
+     * calling SSL_clear() when entering the handshake.
+     *
+     * Without the flag, the state machine in state_machine() calls SSL_clear()
+     * when SSL_in_before() is true, which wipes out our restored state.
+     */
+    if (dl->require_hrr_cookie || dl->require_hvr_cookie)
+        sc->s3.flags |= TLS1_FLAGS_STATELESS;
+
+    /*
+     * We are inside the listener's own tick, so this must not block: nothing
+     * else can make progress while it does, including whatever it would be
+     * waiting for.
+     */
+    sc->listener_force_nonblocking = 1;
+    ret = SSL_accept(ssl);
+    sc->listener_force_nonblocking = 0;
+    ssl_err = SSL_get_error(ssl, ret);
+    sc->listener_idle = ssl_err == SSL_ERROR_WANT_READ;
+
+    /*
+     * Always clear the stateless flag after SSL_accept() completes.
+     */
+    if (dl->require_hrr_cookie || dl->require_hvr_cookie)
+        sc->s3.flags &= ~TLS1_FLAGS_STATELESS;
+
+    /* Check if connection is ready to move to established */
+    if (dtls_listener_conn_ready(ssl, dl)) {
+        if (ctx->ready_conns != NULL && sk_SSL_push(ctx->ready_conns, ssl) > 0)
+            ctx->ready_count++;
+        return;
+    }
+
+    /* Check if connection needs retry (HRR/HVR sent) */
+    if (dtls_listener_conn_needs_retry(ssl))
+        return;
+
+    if (ssl_err == SSL_ERROR_WANT_READ || ssl_err == SSL_ERROR_WANT_WRITE) {
+        /* Handshake in progress, needs more data - keep pending */
+        return;
+    }
+
+    /* Fatal error on this connection - mark for removal */
+    if (ssl_err == SSL_ERROR_SYSCALL || ssl_err == SSL_ERROR_SSL) {
+        if (ctx->failed_conns != NULL && sk_SSL_push(ctx->failed_conns, ssl) > 0)
+            ctx->error_count++;
+    }
+}
+
+/*
+ * dtls_listener_drive_pass - drive handshakes for all pending connections.
+ *
+ * Uses a three-phase approach to minimize lock contention:
+ *   Phase 1: LOCK - collect connections to drive, mark as being_driven, up-ref
+ *   Phase 2: UNLOCK - drive each connection (can safely call demux_pump)
+ *   Phase 3: LOCK - update data structures, clear being_driven, release refs
+ *
+ * This approach allows SSL_accept() to call demux_pump() without deadlock,
+ * since the mutex is not held during phase 2.
+ *
+ * *again is set if a pending connection may have input left undriven.
+ *
+ * Returns:
+ *   1   At least one connection was moved to incoming_connections
+ *   0   No connections completed (all still pending or failed)
+ *  -1   Fatal error
+ */
+static int dtls_listener_drive_pass(DTLS_LISTENER *dl, int last_pass,
+    int *again)
+{
+    DRIVE_PENDING_CTX ctx;
+    SSL *ssl;
+    SSL_CONNECTION *sc;
+    int i, result = 0;
+
+    memset(&ctx, 0, sizeof(ctx));
+    ctx.dl = dl;
+    ctx.to_drive = sk_SSL_new_null();
+    ctx.ready_conns = sk_SSL_new_null();
+    ctx.failed_conns = sk_SSL_new_null();
+
+    if (ctx.to_drive == NULL || ctx.ready_conns == NULL
+        || ctx.failed_conns == NULL) {
+        sk_SSL_free(ctx.to_drive);
+        sk_SSL_free(ctx.ready_conns);
+        sk_SSL_free(ctx.failed_conns);
+        return -1;
+    }
+
+    /*
+     * Phase 1: Collect connections to drive.
+     * Hold mutex while iterating pending_conns, mark connections as being_driven,
+     * and up-ref them so they stay valid after we release the mutex.
+     */
+    ossl_crypto_mutex_lock(dl->mutex);
+    dl->pending_input = 0;
+    ossl_dgram_conn_lookup_foreach(dl->pending_conns, collect_pending_cb, &ctx);
+    ossl_crypto_mutex_unlock(dl->mutex);
+
+    /*
+     * Phase 2: Drive connections WITHOUT holding mutex.
+     * This allows SSL_accept() to call demux_pump() which may invoke
+     * packet_handler(), which needs to acquire the mutex.
+     */
+    for (i = 0; i < sk_SSL_num(ctx.to_drive); i++) {
+        ssl = sk_SSL_value(ctx.to_drive, i);
+        drive_single_connection(ssl, dl, &ctx);
+    }
+
+    /*
+     * Phase 3: Update data structures.
+     * Re-acquire mutex to move ready connections to established,
+     * remove failed connections, clear being_driven flags, and release refs.
+     */
+    ossl_crypto_mutex_lock(dl->mutex);
+
+    /*
+     * Since we have the mutex, clear the driven flag and release the
+     * up-ref for each connection.
+     */
+    for (i = 0; i < sk_SSL_num(ctx.to_drive); i++) {
+        ssl = sk_SSL_value(ctx.to_drive, i);
+        sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
+
+        if (sc != NULL) {
+            sc->listener_being_driven = 0;
+            if (sc->listener_idle && sc->listener_rx != NULL) {
+                ossl_crypto_mutex_lock(sc->listener_rx->mutex);
+                if (!ossl_list_urxe_is_empty(&sc->listener_rx->urxe_pending))
+                    dl->pending_input = 1;
+                ossl_crypto_mutex_unlock(sc->listener_rx->mutex);
+            }
+        }
+
+        SSL_free(ssl); /* Release reference from phase 1 */
+    }
+
+    /* Move ready connections to established and incoming queue */
+    for (i = 0; i < sk_SSL_num(ctx.ready_conns); i++) {
+        ssl = sk_SSL_value(ctx.ready_conns, i);
+        sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
+
+        if (sc == NULL || sc->d1 == NULL)
+            continue;
+
+        /* Get peer address from the connection */
+        if (BIO_ADDR_family(&sc->d1->peer_addr) != AF_UNSPEC) {
+
+            /* Remove from pending */
+            ossl_dgram_conn_lookup_unregister(dl->pending_conns, &sc->d1->peer_addr);
+
+            /* Add to established connections (inline, we already hold mutex) */
+            if (dl->established_conns == NULL || !ossl_dgram_conn_lookup_register_addr(dl->established_conns, &sc->d1->peer_addr, ssl)) {
+                dtls_listener_connection_free(ssl);
+                continue;
+            }
+
+            /* Add to incoming queue */
+            if (sk_SSL_push(dl->incoming_connections, ssl) > 0) {
+                result = 1;
+            } else {
+                /* Failed to add to queue, unregister and free */
+                ossl_dgram_conn_lookup_unregister(dl->established_conns,
+                    &sc->d1->peer_addr);
+                dtls_listener_connection_free(ssl);
+            }
+        }
+    }
+
+    /*
+     * A connection became acceptable. Any thread blocked waiting for one is
+     * polling the network socket, which will not necessarily become readable
+     * again on its behalf, so wake it explicitly.
+     */
+    if (result)
+        dtls_listener_signal_notifier(dl);
+
+    /* Remove failed connections (after releasing refs so ref count is 1) */
+    for (i = 0; i < sk_SSL_num(ctx.failed_conns); i++) {
+        ssl = sk_SSL_value(ctx.failed_conns, i);
+        sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
+
+        if (sc != NULL && sc->d1 != NULL)
+            ossl_dgram_conn_lookup_unregister(dl->pending_conns, &sc->d1->peer_addr);
+
+        dtls_listener_connection_free(ssl);
+    }
+
+    *again = dl->pending_input;
+    /* Out of passes: make sure a blocked waiter ticks again. */
+    if (*again && last_pass)
+        dtls_listener_signal_notifier(dl);
+
+    ossl_crypto_mutex_unlock(dl->mutex);
+
+    sk_SSL_free(ctx.to_drive);
+    sk_SSL_free(ctx.ready_conns);
+    sk_SSL_free(ctx.failed_conns);
+
+    return result;
+}
+
+/*
+ * Driving a connection pumps the demux, which can queue input for a pending
+ * connection that the pass did not collect or has already driven. Pass again
+ * while that happens, up to a bound.
+ */
+static int dtls_listener_drive_pending(DTLS_LISTENER *dl)
+{
+    int pass, ret, again = 0, result = 0;
+
+    for (pass = 0; pass < DTLS_LISTENER_MAX_DRIVE_PASSES; pass++) {
+        ret = dtls_listener_drive_pass(dl,
+            pass == DTLS_LISTENER_MAX_DRIVE_PASSES - 1, &again);
+        if (ret < 0)
+            return -1;
+        if (ret > 0)
+            result = 1;
+        if (!again)
+            break;
+    }
+    return result;
+}
+
+/*
+ * ossl_dtls_tick - drive one iteration of the DTLS listener I/O loop.
+ *
+ * Uses the demux pump/callback architecture for efficient packet handling:
+ *   1. Call ossl_dgram_demux_pump() to read datagrams from the network
+ *   2. The demux invokes dtls_listener_packet_handler() for each datagram
+ *   3. The handler routes URXEs to connections (established or pending)
+ *   4. Drive handshakes for pending connections
+ *   5. Move completed connections to established_conns and incoming queue
+ *
+ * Return values:
+ *   1   A verified connection was pushed onto dl->incoming_connections.
+ *   0   Exchange incomplete (HRR/HVR sent, or no data yet); call again.
+ *  -1   Fatal error; dl->fatal is set.
+ */
+int ossl_dtls_tick(DTLS_LISTENER *dl)
+{
+    int pump_ret;
+
+    if (dl == NULL || dl->net_rbio == NULL)
+        return 0;
+
+    /*
+     * Get datagrams from the network and route them to connections.
+     */
+    pump_ret = ossl_dgram_demux_pump(dl->demux);
+
+    if (pump_ret == DGRAM_DEMUX_PUMP_RES_PERMANENT_FAIL) {
+        /* Fatal BIO or allocation error */
+        ossl_crypto_mutex_lock(dl->mutex);
+        dl->fatal = 1;
+        ossl_crypto_mutex_unlock(dl->mutex);
+        return -1;
+    }
+
+    /*
+     * Drive Handshakes for pending connections.
+     * call even if pump_ret indicates no data or temporary failure,
+     * to allow handshakes to progress even when no new data is arriving
+     */
+    return dtls_listener_drive_pending(dl);
+}
+
+/*
+ * Does a pending connection have input which the last tick left undriven?
+ * A waiter must then tick again rather than sleep. Not on a fatal listener:
+ * its ticks fail before driving, so pending_input may never be cleared.
+ */
+int ossl_dtls_listener_has_pending_input(SSL *s)
+{
+    DTLS_LISTENER *dl;
+    int ret;
+
+    if (!IS_DTLS_LISTENER(s))
+        return 0;
+
+    dl = (DTLS_LISTENER *)s;
+    ossl_crypto_mutex_lock(dl->mutex);
+    ret = dl->pending_input && !dl->fatal;
+    ossl_crypto_mutex_unlock(dl->mutex);
+    return ret;
+}
+
+SSL *ossl_dtls_accept_connection(SSL *ssl, uint64_t flags)
+{
+    DTLS_LISTENER *dl;
+    SSL *conn = NULL;
+    SSL_CONNECTION *sc = NULL;
+    int no_block = ((flags & SSL_ACCEPT_CONNECTION_NO_BLOCK) != 0);
+
+    if (!IS_DTLS_LISTENER(ssl)) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return NULL;
+    }
+
+    dl = (DTLS_LISTENER *)ssl;
+
+    if (!ossl_dtls_listen(ssl))
+        return NULL;
+
+    /* If a previous tick produced a fatal BIO error, do not try again. */
+    ossl_crypto_mutex_lock(dl->mutex);
+    if (dl->fatal) {
+        ossl_crypto_mutex_unlock(dl->mutex);
+        return NULL;
+    }
+
+    /* Fast path: return any already-queued connection immediately. */
+    conn = sk_SSL_shift(dl->incoming_connections);
+    ossl_crypto_mutex_unlock(dl->mutex);
+    if (conn != NULL)
+        goto end;
+
+    /*
+     * Wait only if the caller has not asked us not to and the listener is in
+     * blocking mode. Note that the check for a network BIO below is deliberately
+     * left ahead of this, so that asking to wait on a listener which has none
+     * remains an error rather than silently returning nothing.
+     */
+    if (!no_block && !ossl_dtls_blocking(ssl) && dl->net_rbio != NULL)
+        no_block = 1;
+
+    if (no_block) {
+        /*
+         * Non-blocking: run one tick to drain any pending datagram, then
+         * return whatever is in the queue
+         */
+        if (dl->net_rbio != NULL) {
+            if (ossl_dtls_tick(dl) < 0) {
+                ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+                return NULL;
+            }
+        }
+        ossl_crypto_mutex_lock(dl->mutex);
+        conn = sk_SSL_shift(dl->incoming_connections);
+        ossl_crypto_mutex_unlock(dl->mutex);
+        goto end;
+    }
+
+    /* Blocking path: we need a BIO to make any progress. */
+    if (dl->net_rbio == NULL) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_BIO_NOT_SET);
+        return NULL;
+    }
+
+    /*
+     * Blocking path: tick to make whatever progress is possible now, and if
+     * that did not produce a connection, wait for readiness before ticking
+     * again.
+     *
+     * The wait is what stops this from being a busy loop. The network BIO is
+     * non-blocking, so a tick which finds no datagram returns immediately;
+     * without waiting in between, this loop would spin.
+     */
+    for (;;) {
+        if (ossl_dtls_tick(dl) < 0) {
+            /* fatal BIO error */
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            break;
+        }
+
+        ossl_crypto_mutex_lock(dl->mutex);
+        conn = sk_SSL_shift(dl->incoming_connections);
+        ossl_crypto_mutex_unlock(dl->mutex);
+        if (conn != NULL)
+            break;
+
+        /*
+         * Nothing yet, so wait for the listener to become ready before ticking
+         * again. What that amounts to is decided by the poll translation for a
+         * listener: the network socket becoming readable, or another thread
+         * signalling the notifier because it produced readiness on our behalf.
+         */
+        if (!ossl_dtls_block_until_ready(ssl, SSL_POLL_EVENT_IC,
+                ossl_time_infinite(), /*bound_by_event_timeout=*/1))
+            break;
+    }
+
+end:
+    if (conn != NULL) {
+        sc = SSL_CONNECTION_FROM_SSL(conn);
+        /*
+         * Take a reference on the listener now that ownership of the connection
+         * is transferring to the application. While in incoming_connections,
+         * the connection did not hold a reference to avoid circular dependencies.
+         * Now that the application owns the connection, it must hold a reference
+         * to ensure the listener stays alive - the connection needs the listener
+         * for packet routing
+         */
+        if (sc == NULL || sc->d1 == NULL || sc->d1->listener == NULL
+            || !SSL_up_ref(sc->d1->listener)) {
+            /*
+             * Ownership did not transfer to the application. A connection taken
+             * from incoming_connections is still registered in established_conns;
+             */
+            if (sc != NULL && sc->d1 != NULL)
+                ossl_dtls_listener_unregister_established_conn(ssl, &sc->d1->peer_addr);
+            dtls_listener_connection_free(conn);
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            return NULL;
+        }
+    }
+    return conn;
+}
+
+/*
+ * ossl_dtls_listener_set0_net_rbio - set the network read BIO for a listener.
+ *
+ * Thread safety: The caller must ensure that this function is not called
+ * concurrently with any other operations on the listener or its connections.
+ * This includes SSL_accept_connection(), SSL_poll(), SSL_tick(), and any
+ * I/O operations on connections created from this listener.
+ *
+ * The BIO must not be changed while other threads are actively using the
+ * listener. Typically, the BIO should be set once before calling SSL_listen()
+ * and not modified afterward.
+ */
+void ossl_dtls_listener_set0_net_rbio(SSL *s, BIO *bio)
+{
+    DTLS_LISTENER *dl;
+    BIO *old_rbio;
+
+    if (!IS_DTLS_LISTENER(s))
+        return;
+
+    dl = (DTLS_LISTENER *)s;
+
+    /*
+     * The listener demultiplexes one socket to many connections, so it can
+     * never afford to block inside a read: a read for one connection would
+     * stall every other, and the demux lock is held across it. Blocking
+     * behaviour is provided by waiting for readiness instead, so configure the
+     * BIO for non-blocking operation on the application's behalf, as QUIC does.
+     */
+    if (bio != NULL)
+        BIO_set_nbio(bio, 1); /* best effort autoconfig */
+
+    ossl_crypto_mutex_lock(dl->mutex);
+
+    /*
+     * The demux receive-buffer size is the listener's configured maximum
+     * datagram size, independent of the network BIO's path MTU. Size the demux
+     * to that value for whatever BIO is attached.
+     */
+    ossl_dgram_demux_set_bio(dl->demux, bio);
+    ossl_dgram_demux_set_mtu(dl->demux, (unsigned int)dl->max_dgram_size);
+
+    old_rbio = dl->net_rbio;
+
+    /* No change - nothing to do */
+    if (old_rbio == bio) {
+        ossl_crypto_mutex_unlock(dl->mutex);
+        return;
+    }
+
+    dl->net_rbio = bio;
+
+    ossl_crypto_mutex_unlock(dl->mutex);
+
+    /* Free the old BIO now that we've taken ownership of the new one */
+    BIO_free_all(old_rbio);
+}
+
+/*
+ * update_conn_wbio - callback to update the wbio on a single connection.
+ *
+ * Used by ossl_dtls_listener_set0_net_wbio() to propagate wbio changes
+ * to all pending and established connections
+ */
+static void update_conn_wbio(SSL *ssl, const BIO_ADDR *peer, void *arg)
+{
+    BIO *new_wbio = arg;
+
+    if (SSL_get_wbio(ssl) == new_wbio)
+        return;
+
+    if (new_wbio != NULL && !BIO_up_ref(new_wbio))
+        return;
+
+    SSL_set0_wbio(ssl, new_wbio);
+}
+
+/*
+ * ossl_dtls_listener_set0_net_wbio - set the network write BIO for a listener.
+ *
+ * Thread safety: The caller must ensure that this function is not called
+ * concurrently with any other operations on the listener or its connections.
+ * This includes SSL_accept_connection(), SSL_poll(), SSL_tick(), and any
+ * I/O operations on connections created from this listener.
+ *
+ * The BIO must not be changed while other threads are actively using the
+ * listener. Typically, the BIO should be set once before calling SSL_listen()
+ * and not modified afterward.
+ */
+void ossl_dtls_listener_set0_net_wbio(SSL *s, BIO *bio)
+{
+    DTLS_LISTENER *dl;
+    BIO *old_wbio;
+
+    if (!IS_DTLS_LISTENER(s))
+        return;
+
+    dl = (DTLS_LISTENER *)s;
+
+    /* See ossl_dtls_listener_set0_net_rbio() as to why. */
+    if (bio != NULL)
+        BIO_set_nbio(bio, 1); /* best effort autoconfig */
+
+    old_wbio = dl->net_wbio;
+
+    /* No change - nothing to do */
+    if (old_wbio == bio) {
+        return;
+    }
+
+    /* Update wbio in all pending connections */
+    if (dl->pending_conns != NULL)
+        ossl_dgram_conn_lookup_foreach(dl->pending_conns, update_conn_wbio, bio);
+
+    /* Update wbio in all established connections */
+    if (dl->established_conns != NULL)
+        ossl_dgram_conn_lookup_foreach(dl->established_conns, update_conn_wbio, bio);
+
+    dl->net_wbio = bio;
+
+    /* Free the old BIO now that we've taken ownership of the new one */
+    BIO_free_all(old_wbio);
+}
+
+/*
+ * ossl_dtls_listener_get_net_rbio - get the network read BIO for a listener.
+ *
+ * Thread safety: The caller must ensure that the BIO is not being changed
+ * concurrently via SSL_set0_rbio(). The returned BIO pointer is only valid
+ * as long as no other thread modifies it.
+ */
+BIO *ossl_dtls_listener_get_net_rbio(const SSL *s)
+{
+    const DTLS_LISTENER *dl;
+
+    if (!IS_DTLS_LISTENER(s))
+        return NULL;
+
+    dl = (const DTLS_LISTENER *)s;
+
+    return dl->net_rbio;
+}
+
+/*
+ * ossl_dtls_listener_get_net_wbio - get the network write BIO for a listener.
+ *
+ * Thread safety: The caller must ensure that the BIO is not being changed
+ * concurrently via SSL_set0_wbio(). The returned BIO pointer is only valid
+ * as long as no other thread modifies it.
+ */
+BIO *ossl_dtls_listener_get_net_wbio(const SSL *s)
+{
+    const DTLS_LISTENER *dl;
+
+    if (!IS_DTLS_LISTENER(s))
+        return NULL;
+
+    dl = (const DTLS_LISTENER *)s;
+
+    return dl->net_wbio;
+}
+
+/*
+ * Established connections API - these handle their own locking.
+ *
+ * The established_conns lookup table is accessed from multiple threads:
+ * - Listener thread: looking up and registering connections
+ * - Connection thread: unregistering via SSL_free -> dtls1_free
+ */
+
+/*
+ * ossl_dtls_listener_find_established_conn - find an established connection.
+ *
+ * Looks up a connection in the established_conns table by peer address.
+ * Returns the SSL connection if found, NULL otherwise.
+ */
+SSL *ossl_dtls_listener_find_established_conn(DTLS_LISTENER *dl,
+    const DGRAM_URXE *urxe)
+{
+    SSL *result = NULL;
+
+    if (dl == NULL || urxe == NULL)
+        return NULL;
+
+    ossl_crypto_mutex_lock(dl->mutex);
+
+    if (dl->established_conns != NULL)
+        result = ossl_dgram_conn_lookup_find(dl->established_conns, urxe);
+
+    ossl_crypto_mutex_unlock(dl->mutex);
+    return result;
+}
+
+/*
+ * ossl_dtls_listener_unregister_established_conn - unregister an established
+ * connection from the listener.
+ *
+ * Called when a DTLS connection created by this listener is being freed.
+ */
+void ossl_dtls_listener_unregister_established_conn(SSL *s, const BIO_ADDR *peer_addr)
+{
+    DTLS_LISTENER *dl;
+
+    if (!IS_DTLS_LISTENER(s))
+        return;
+
+    if (peer_addr == NULL || BIO_ADDR_family(peer_addr) == AF_UNSPEC)
+        return;
+
+    dl = (DTLS_LISTENER *)s;
+
+    ossl_crypto_mutex_lock(dl->mutex);
+
+    if (dl->established_conns != NULL)
+        ossl_dgram_conn_lookup_unregister(dl->established_conns, peer_addr);
+
+    ossl_crypto_mutex_unlock(dl->mutex);
+}
+
+/*
+ * ossl_dtls_listener_clear_established_conns - clear and recreate the
+ * established_conns table.
+ */
+void ossl_dtls_listener_clear_established_conns(DTLS_LISTENER *dl)
+{
+    if (dl == NULL)
+        return;
+
+    ossl_crypto_mutex_lock(dl->mutex);
+
+    if (dl->established_conns != NULL)
+        ossl_dgram_conn_lookup_free(dl->established_conns);
+    dl->established_conns = ossl_dgram_conn_lookup_new_addr();
+
+    ossl_crypto_mutex_unlock(dl->mutex);
+}
+
+size_t ossl_dtls_get_accept_connection_queue_len(SSL *ssl)
+{
+    DTLS_LISTENER *dl;
+    size_t len;
+
+    if (!IS_DTLS_LISTENER(ssl))
+        return 0;
+
+    dl = (DTLS_LISTENER *)ssl;
+
+    ossl_crypto_mutex_lock(dl->mutex);
+    len = (size_t)sk_SSL_num(dl->incoming_connections);
+    ossl_crypto_mutex_unlock(dl->mutex);
+
+    return len;
+}
+
+/*
+ * Set an override time callback for the DTLS listener.
+ * This is primarily for testing purposes to allow time injection.
+ * If now_cb is NULL, the listener will use ossl_time_now().
+ */
+int ossl_dtls_listener_set_override_now_cb(SSL *s,
+    OSSL_TIME (*now_cb)(void *arg),
+    void *now_cb_arg)
+{
+    DTLS_LISTENER *dl;
+
+    if (!IS_DTLS_LISTENER(s))
+        return 0;
+
+    dl = (DTLS_LISTENER *)s;
+    dl->now_cb = now_cb;
+    dl->now_cb_arg = now_cb_arg;
+
+    return 1;
+}
+
+/*
+ * ossl_dtls_get_value_uint - read a tunable value from a DTLS listener.
+ *
+ * DTLS-side implementation backing SSL_get_value_uint(3) when the target
+ * SSL object is a DTLS listener created by SSL_new_listener().
+ *
+ * Supported (id) values:
+ *   SSL_VALUE_DTLS_LISTENER_MAX_PENDING_CONNS
+ *       Admission budget: the total connections the listener owns,
+ *       counting both the pending (handshake-in-progress) table and the
+ *       accept queue (validated connections awaiting
+ *       SSL_accept_connection). Accepted connections are not counted.
+ *   SSL_VALUE_DTLS_LISTENER_PENDING_TIMEOUT
+ *       Current reap timeout for pending connections, in milliseconds.
+ *       UINT64_MAX means "infinite / disabled". Accept-queue entries do
+ *       not expire.
+ *   SSL_VALUE_DTLS_LISTENER_MAX_DGRAM_SIZE
+ *       Maximum size in bytes of a datagram the listener will receive.
+ *
+ * Only SSL_VALUE_CLASS_GENERIC is accepted for class_; other
+ * classes are rejected with a return of 0
+ *
+ * Parameters:
+ *   s      - listener SSL. Must satisfy IS_DTLS_LISTENER(s).
+ *   class_ - value class; must be SSL_VALUE_CLASS_GENERIC.
+ *   id     - one of the SSL_VALUE_DTLS_LISTENER_* ids listed above.
+ *   value  - out-parameter receiving the current value. Must be non-NULL.
+ *
+ * Returns:
+ *   1 on success (*value populated).
+ *   0 on failure (unsupported id, wrong class, NULL value, or not a
+ *     DTLS listener).
+ */
+int ossl_dtls_get_value_uint(SSL *s, uint32_t class_, uint32_t id, uint64_t *value)
+{
+    DTLS_LISTENER *dl;
+    int ret = 1;
+
+    if (!IS_DTLS_LISTENER(s)) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_LISTENER_USE_ONLY);
+        return 0;
+    }
+    if (class_ != SSL_VALUE_CLASS_GENERIC) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_UNSUPPORTED_CONFIG_VALUE_CLASS);
+        return 0;
+    }
+    if (value == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+
+    dl = (DTLS_LISTENER *)s;
+
+    ossl_crypto_mutex_lock(dl->mutex);
+
+    switch (id) {
+    case SSL_VALUE_DTLS_LISTENER_MAX_PENDING_CONNS:
+        *value = (uint64_t)dl->max_pending_conns;
+        break;
+    case SSL_VALUE_DTLS_LISTENER_PENDING_TIMEOUT:
+        if (ossl_time_is_infinite(dl->pending_timeout))
+            *value = UINT64_MAX;
+        else
+            *value = ossl_time2ms(dl->pending_timeout);
+        break;
+    case SSL_VALUE_DTLS_LISTENER_MAX_DGRAM_SIZE:
+        *value = (uint64_t)dl->max_dgram_size;
+        break;
+    default:
+        ERR_raise(ERR_LIB_SSL, SSL_R_UNSUPPORTED_CONFIG_VALUE);
+        ret = 0;
+        break;
+    }
+
+    ossl_crypto_mutex_unlock(dl->mutex);
+    return ret;
+}
+
+/*
+ * ossl_dtls_set_value_uint - write a tunable value on a DTLS listener.
+ *
+ * DTLS-side implementation backing SSL_set_value_uint(3) when the target
+ * SSL object is a DTLS listener created by SSL_new_listener().
+ *
+ * Supported (id) values -- see ossl_dtls_get_value_uint() above.
+ *
+ * Per-id policy:
+ *   SSL_VALUE_DTLS_LISTENER_MAX_PENDING_CONNS
+ *       value == 0 is rejected (a zero cap would reject every incoming
+ *       connection). Values larger than SIZE_MAX are clamped to SIZE_MAX
+ *       to avoid silent truncation on 32-bit builds. Lowering the value
+ *       below the current number of listener-owned connections does not
+ *       evict any of them; it only affects later admission.
+ *   SSL_VALUE_DTLS_LISTENER_PENDING_TIMEOUT
+ *       Interpreted as milliseconds. value == 0 is rejected. UINT64_MAX is
+ *       treated as "infinite / disabled".
+ *   SSL_VALUE_DTLS_LISTENER_MAX_DGRAM_SIZE
+ *       Clamped to the maximum UDP payload (DTLS_LISTENER_MAX_DGRAM_SIZE);
+ *       values below the demux minimum receive size are rejected.
+ *
+ * Only SSL_VALUE_CLASS_GENERIC is accepted for class_.
+ *
+ * Parameters:
+ *   s      - listener SSL. Must satisfy IS_DTLS_LISTENER(s).
+ *   class_ - value class; must be SSL_VALUE_CLASS_GENERIC.
+ *   id     - one of the SSL_VALUE_DTLS_LISTENER_* ids.
+ *   value  - new value to store, in the units documented per id.
+ *
+ * Returns:
+ *   1 on success.
+ *   0 on failure (unsupported id, wrong class, not a DTLS listener,
+ *     or policy rejection such as 0 on the cap).
+ */
+int ossl_dtls_set_value_uint(SSL *s, uint32_t class_, uint32_t id, uint64_t value)
+{
+    DTLS_LISTENER *dl;
+    int ret = 1;
+
+    if (!IS_DTLS_LISTENER(s)) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_LISTENER_USE_ONLY);
+        return 0;
+    }
+    if (class_ != SSL_VALUE_CLASS_GENERIC) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_UNSUPPORTED_CONFIG_VALUE_CLASS);
+        return 0;
+    }
+
+    dl = (DTLS_LISTENER *)s;
+
+    ossl_crypto_mutex_lock(dl->mutex);
+
+    switch (id) {
+    case SSL_VALUE_DTLS_LISTENER_MAX_PENDING_CONNS:
+        if (value == 0) {
+            /* A zero cap would reject every connection (num_items >= 0). */
+            ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+            ret = 0;
+            break;
+        }
+        /* Clamp to SIZE_MAX to prevent silent truncation on 32-bit. */
+        dl->max_pending_conns = (value > SIZE_MAX) ? SIZE_MAX : (size_t)value;
+        break;
+    case SSL_VALUE_DTLS_LISTENER_PENDING_TIMEOUT:
+        if (value == 0) {
+            /*
+             * A zero timeout will remove all pending connections on the next
+             * tick, before the handshake could complete.
+             */
+            ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+            ret = 0;
+            break;
+        }
+        /*
+         * ossl_ms2time() scales by OSSL_TIME_MS (10^6 ns/ms), so any value
+         * above UINT64_MAX / OSSL_TIME_MS would overflow the product and
+         * silently wrap to a tiny timeout. Treat those (which includes the
+         * UINT64_MAX "infinite" sentinel) as an infinite timeout.
+         */
+        if (value > UINT64_MAX / OSSL_TIME_MS)
+            dl->pending_timeout = ossl_time_infinite();
+        else
+            dl->pending_timeout = ossl_ms2time(value);
+        break;
+    case SSL_VALUE_DTLS_LISTENER_MAX_DGRAM_SIZE:
+        /* Nothing larger than the maximum UDP payload can ever arrive. */
+        if (value > DTLS_LISTENER_MAX_DGRAM_SIZE)
+            value = DTLS_LISTENER_MAX_DGRAM_SIZE;
+        /* set_mtu returns 0 (rejecting) for values below the demux minimum. */
+        if (!ossl_dgram_demux_set_mtu(dl->demux, (unsigned int)value)) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+            ret = 0;
+        } else {
+            dl->max_dgram_size = (size_t)value;
+        }
+        break;
+    default:
+        ERR_raise(ERR_LIB_SSL, SSL_R_UNSUPPORTED_CONFIG_VALUE);
+        ret = 0;
+        break;
+    }
+
+    ossl_crypto_mutex_unlock(dl->mutex);
+    return ret;
+}
+
+/*
+ * Resolve the requested blocking mode of a DTLS listener, or of a connection
+ * created from one, following the inheritance chain.
+ *
+ * A connection set to INHERIT follows its listener; a listener set to INHERIT
+ * is blocking, there being nothing further to inherit from. Blocking is
+ * therefore the default unless the application asks otherwise.
+ *
+ * Returns 1 if blocking is wanted, which says nothing about whether it can be
+ * provided - see ossl_dtls_can_support_blocking().
+ */
+static int ossl_dtls_desires_blocking(const SSL *s)
+{
+    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL_ONLY(s);
+    const DTLS_LISTENER *dl = NULL;
+
+    if (sc != NULL && sc->d1 != NULL) {
+        /* The listener is driving this connection; it must not block. */
+        if (sc->listener_force_nonblocking)
+            return 0;
+
+        if (sc->d1->req_blocking_mode != DTLS_BLOCKING_MODE_INHERIT)
+            return sc->d1->req_blocking_mode == DTLS_BLOCKING_MODE_BLOCKING;
+
+        dl = (const DTLS_LISTENER *)sc->d1->listener;
+    } else if (IS_DTLS_LISTENER(s)) {
+        dl = (const DTLS_LISTENER *)s;
+    }
+
+    if (dl == NULL)
+        return 0;
+
+    return dl->req_blocking_mode != DTLS_BLOCKING_MODE_NONBLOCKING;
+}
+
+/*
+ * Report whether blocking mode can be provided for a DTLS listener or a
+ * connection created from one.
+ *
+ * Blocking is emulated by waiting for readiness of the listener's network
+ * socket, so it requires a BIO which can supply a poll descriptor to wait on.
+ * A memory BIO cannot, and such a listener is therefore non-blocking whatever
+ * was requested, as is the case for QUIC.
+ */
+static int ossl_dtls_can_support_blocking(const SSL *s)
+{
+    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL_ONLY(s);
+    const SSL *listener = NULL;
+    BIO_POLL_DESCRIPTOR desc;
+    BIO *rbio;
+
+    if (sc != NULL && sc->d1 != NULL)
+        listener = sc->d1->listener;
+    else if (IS_DTLS_LISTENER(s))
+        listener = s;
+
+    if (listener == NULL)
+        return 0;
+
+    rbio = SSL_get_rbio(listener);
+    if (rbio == NULL)
+        return 0;
+
+    return BIO_get_rpoll_descriptor(rbio, &desc) != 0
+        && desc.type == BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD;
+}
+
+/*
+ * Report whether a call on this object should block, which is the case when
+ * blocking is both wanted and possible.
+ */
+int ossl_dtls_blocking(const SSL *s)
+{
+    return ossl_dtls_desires_blocking(s) && ossl_dtls_can_support_blocking(s);
+}
+
+int ossl_dtls_set_blocking_mode(SSL *s, int blocking)
+{
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
+    unsigned int mode = (blocking != 0)
+        ? DTLS_BLOCKING_MODE_BLOCKING
+        : DTLS_BLOCKING_MODE_NONBLOCKING;
+
+    /*
+     * Only a listener, or a connection created from one, has a blocking mode.
+     * Any other DTLS object takes its behaviour from its own BIO in the
+     * traditional way, so there is nothing here to configure.
+     */
+    if (!IS_DTLS_LISTENER(s)
+        && (sc == NULL || sc->d1 == NULL || sc->d1->listener == NULL)) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+
+    /*
+     * Refuse to claim blocking we cannot deliver, as QUIC does. Checked before
+     * anything is written, so that a call which fails leaves the mode alone
+     * rather than reporting failure having already changed it.
+     */
+    if (blocking && !ossl_dtls_can_support_blocking(s)) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_UNSUPPORTED);
+        return 0;
+    }
+
+    if (IS_DTLS_LISTENER(s))
+        ((DTLS_LISTENER *)s)->req_blocking_mode = mode;
+    else
+        sc->d1->req_blocking_mode = mode;
+
+    return 1;
+}
+
+int ossl_dtls_get_blocking_mode(const SSL *s)
+{
+    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL_ONLY(s);
+
+    if (!IS_DTLS_LISTENER(s)
+        && (sc == NULL || sc->d1 == NULL || sc->d1->listener == NULL))
+        return -1;
+
+    return ossl_dtls_blocking(s);
+}
+
+/*
+ * Wait until a datagram has been demultiplexed to this connection's receive
+ * queue, for a connection which is in blocking mode.
+ *
+ * This is what makes a blocking read on a listener based connection block. Such
+ * a connection has no BIO of its own to block in: it reads from a queue which
+ * the listener fills, so the wait has to happen here instead.
+ *
+ * A wakeup does not mean the datagram was ours - the listener's socket is
+ * shared, and another connection may be the one with data - so this loops until
+ * something actually lands in our queue. Events are handled after each wait
+ * because nothing else will do it while we are in here, and the retransmission
+ * timer needs servicing if it is what woke us.
+ *
+ * A datagram which is already waiting costs nothing: the wait pumps the
+ * listener's demux while translating the poll, and returns without sleeping if
+ * anything has been queued for us by then.
+ *
+ * Returns 1 if a datagram is now queued for this connection, or 0 if the wait
+ * could not be performed or the listener has failed.
+ */
+int ossl_dtls_conn_wait_for_datagram(SSL *s)
+{
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
+    DTLS_LISTENER *dl;
+    int empty;
+
+    if (sc == NULL || sc->d1 == NULL || sc->d1->rx == NULL
+        || sc->d1->listener == NULL)
+        return 0;
+
+    dl = (DTLS_LISTENER *)sc->d1->listener;
+
+    for (;;) {
+        ossl_crypto_mutex_lock(dl->mutex);
+        if (dl->fatal) {
+            ossl_crypto_mutex_unlock(dl->mutex);
+            return 0;
+        }
+        ossl_crypto_mutex_unlock(dl->mutex);
+
+        /*
+         * An infinite deadline here is bounded by the connection's own event
+         * timeout, which the poll translation folds in, so this still wakes in
+         * time to retransmit.
+         */
+        if (!ossl_dtls_block_until_ready(s, SSL_POLL_EVENT_R,
+                ossl_time_infinite(), /*bound_by_event_timeout=*/1))
+            return 0;
+
+        if (!SSL_handle_events(s))
+            return 0;
+
+        ossl_dgram_demux_pump(sc->d1->rx->demux);
+
+        ossl_crypto_mutex_lock(sc->d1->rx->mutex);
+        empty = ossl_list_urxe_is_empty(&sc->d1->rx->urxe_pending);
+        ossl_crypto_mutex_unlock(sc->d1->rx->mutex);
+
+        if (!empty)
+            return 1;
+    }
+}
+
+/*
+ * Wait until the listener's socket can accept another datagram, for a
+ * connection which is in blocking mode.
+ *
+ * The socket is shared with every other connection and is always
+ * non-blocking, so a send which cannot be completed has nowhere to wait. For
+ * DTLS the record layer would otherwise discard the datagram - a reasonable
+ * default for an unreliable transport, but not what an application which asked
+ * for blocking writes expects.
+ *
+ * Only one wait is performed. The caller retries the send, and comes back here
+ * if it still cannot proceed, so a wakeup which turns out not to leave room in
+ * the socket buffer costs an extra attempt rather than a lost datagram.
+ *
+ * The retransmission timer deliberately does not shorten this wait, unlike the
+ * one for a datagram above. There the wakeup is useful, because the wait can
+ * service the timer itself; here it cannot. Servicing it would mean
+ * retransmitting a flight from inside tls_retry_write_records(), which is
+ * part-way through sending one and holds write buffer state that a
+ * re-entrant do_dtls1_write() would clobber. Waking for a timer nothing then
+ * services would be worse than not waking: the timeout stays expired, and an
+ * expired timeout reads as a zero deadline, so every later wait would return
+ * at once and the caller's retry loop would spin without sleeping. Waiting for
+ * the socket alone is also what the send actually needs. Retransmission is not
+ * the right response to a flight which has not finished going out, and once it
+ * has, the state machine handles the timer as usual.
+ *
+ * Returns 1 if the send should be retried, or 0 if the wait could not be
+ * performed or the listener has failed.
+ */
+int ossl_dtls_conn_wait_for_write(SSL *s)
+{
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
+    DTLS_LISTENER *dl;
+    int fatal;
+
+    if (sc == NULL || sc->d1 == NULL || sc->d1->listener == NULL)
+        return 0;
+
+    dl = (DTLS_LISTENER *)sc->d1->listener;
+
+    ossl_crypto_mutex_lock(dl->mutex);
+    fatal = dl->fatal;
+    ossl_crypto_mutex_unlock(dl->mutex);
+    if (fatal)
+        return 0;
+
+    return ossl_dtls_block_until_ready(s, SSL_POLL_EVENT_W,
+        ossl_time_infinite(), /*bound_by_event_timeout=*/0);
+}
+
+void ossl_dtls_listener_enter_blocking_section(SSL *s)
+{
+    DTLS_LISTENER *dl;
+
+    if (!IS_DTLS_LISTENER(s))
+        return;
+
+    dl = (DTLS_LISTENER *)s;
+
+    if (dl->have_notifier) {
+        ossl_crypto_mutex_lock(dl->mutex);
+        dl->cur_blocking_waiters++;
+        ossl_crypto_mutex_unlock(dl->mutex);
+    }
+}
+
+int ossl_dtls_listener_deregister_blocking_section(SSL *s, uint64_t *generation)
+{
+    DTLS_LISTENER *dl;
+    int need_wait = 0;
+
+    if (!IS_DTLS_LISTENER(s))
+        return 0;
+
+    dl = (DTLS_LISTENER *)s;
+
+    if (dl->have_notifier) {
+        ossl_crypto_mutex_lock(dl->mutex);
+
+        assert(dl->cur_blocking_waiters > 0);
+        --dl->cur_blocking_waiters;
+
+        if (dl->signalled_notifier) {
+            if (dl->cur_blocking_waiters == 0) {
+                ossl_rio_notifier_unsignal(&dl->notifier);
+                dl->signalled_notifier = 0;
+                ++dl->notify_generation;
+
+                /*
+                 * Release the other threads which have woken up
+                 */
+                ossl_crypto_condvar_broadcast(dl->notifier_cv);
+            } else {
+                *generation = dl->notify_generation;
+                need_wait = 1;
+            }
+        }
+
+        ossl_crypto_mutex_unlock(dl->mutex);
+    }
+
+    return need_wait;
+}
+
+void ossl_dtls_listener_wait_for_notifier_clear(SSL *s, uint64_t generation)
+{
+    DTLS_LISTENER *dl;
+
+    if (!IS_DTLS_LISTENER(s))
+        return;
+
+    dl = (DTLS_LISTENER *)s;
+    if (dl->have_notifier) {
+        ossl_crypto_mutex_lock(dl->mutex);
+        while (dl->signalled_notifier && dl->notify_generation == generation)
+            ossl_crypto_condvar_wait(dl->notifier_cv, dl->mutex);
+        ossl_crypto_mutex_unlock(dl->mutex);
+    }
+}
+
+/* Combined leave for single-listener tests; poll cleanup uses both phases. */
+void ossl_dtls_listener_leave_blocking_section(SSL *s)
+{
+    uint64_t generation;
+
+    if (ossl_dtls_listener_deregister_blocking_section(s, &generation))
+        ossl_dtls_listener_wait_for_notifier_clear(s, generation);
+}
+
+int ossl_dtls_listener_poll_events(SSL *s, uint64_t events, int do_tick,
+    uint64_t *revents)
+{
+    DTLS_LISTENER *dl;
+    uint64_t result = 0;
+
+    if (!ossl_assert(IS_DTLS_LISTENER(s)))
+        return 0;
+
+    dl = (DTLS_LISTENER *)s;
+
+    if (do_tick)
+        ossl_dtls_tick(dl);
+
+    if ((events & SSL_POLL_EVENT_IC) != 0) {
+        if (SSL_get_accept_connection_queue_len(s) > 0)
+            result |= SSL_POLL_EVENT_IC;
+    }
+
+    if ((events & SSL_POLL_EVENT_R) != 0) {
+        BIO *rbio = SSL_get_rbio(s);
+        if (rbio != NULL && BIO_pending(rbio) > 0)
+            result |= SSL_POLL_EVENT_R;
+    }
+
+    *revents = result;
+    return 1;
+}
+
+int ossl_dtls_conn_poll_events(SSL *s, uint64_t events, int do_tick,
+    uint64_t *revents)
+{
+    SSL_CONNECTION *sc;
+    uint64_t result = 0;
+    BIO_POLL_DESCRIPTOR desc;
+    int has_pending;
+
+    sc = SSL_CONNECTION_FROM_SSL(s);
+    if (sc == NULL || sc->d1 == NULL)
+        return 0;
+
+    /*
+     * For DTLS connections that came from a listener, data arrives via
+     * URXEs injected by the listener's demux. When do_tick is set and
+     * we have a listener reference, pump the demux to get new data.
+     */
+    if (do_tick && sc->d1->listener != NULL) {
+        DTLS_LISTENER *dl = (DTLS_LISTENER *)sc->d1->listener;
+        ossl_dtls_tick(dl);
+    }
+
+    /*
+     * Handle events for the connection itself, which for DTLS means servicing
+     * the retransmission timer. The caller may have blocked until that timer
+     * expired, so if nothing retransmits here then nothing will, and the
+     * deadline would be recomputed as "now" on every subsequent wait.
+     *
+     * A failure here leaves the connection in a fatal error state, which the
+     * SSL_POLL_EVENT_EC check below reports.
+     */
+    if (do_tick)
+        SSL_handle_events(s);
+
+    if ((events & SSL_POLL_EVENT_R) != 0) {
+        /*
+         * Application data buffered during a handshake cannot be read until
+         * the handshake finishes. Until then, reporting it would make
+         * SSL_poll() return immediately while SSL_read() keeps failing with
+         * SSL_ERROR_WANT_READ, so wait for the datagrams that complete the
+         * handshake instead.
+         */
+        if (RECORD_LAYER_processed_read_pending(&sc->rlayer)
+            || RECORD_LAYER_read_pending(&sc->rlayer)
+            || (SSL_is_init_finished(s)
+                && DTLS_RECORD_LAYER_buffered_app_data_pending(&sc->rlayer))) {
+            result |= SSL_POLL_EVENT_R;
+        } else if (sc->d1->rx != NULL) {
+            /* Listener-based connection: check URXE queue */
+            ossl_crypto_mutex_lock(sc->d1->rx->mutex);
+            has_pending = !ossl_list_urxe_is_empty(&sc->d1->rx->urxe_pending);
+            ossl_crypto_mutex_unlock(sc->d1->rx->mutex);
+            if (has_pending)
+                result |= SSL_POLL_EVENT_R;
+        } else {
+            /*
+             * Standalone DTLS SSL object (not from a listener).
+             * Check the underlying socket for readability.
+             */
+            BIO *rbio = SSL_get_rbio(s);
+
+            if (rbio != NULL) {
+                if (BIO_get_rpoll_descriptor(rbio, &desc)
+                    && desc.type == BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD
+                    && desc.value.fd >= 0) {
+                    if (BIO_socket_ready(desc.value.fd, 1) > 0)
+                        result |= SSL_POLL_EVENT_R;
+                } else {
+                    /* Checking non-socket BIO */
+                    if (BIO_pending(rbio) > 0)
+                        result |= SSL_POLL_EVENT_R;
+                }
+            }
+        }
+    }
+
+    if ((events & SSL_POLL_EVENT_W) != 0) {
+        result |= SSL_POLL_EVENT_W;
+    }
+
+    if ((events & (SSL_POLL_EVENT_EC | SSL_POLL_EVENT_F)) != 0) {
+        if (SSL_get_error(s, 0) == SSL_ERROR_SSL || SSL_get_shutdown(s) != 0)
+            result |= SSL_POLL_EVENT_EC;
+    }
+
+    *revents = result;
+    return 1;
+}
+
+#endif /* !OPENSSL_NO_DTLS && !OPENSSL_NO_SOCK */
diff --git a/deps/openssl/openssl/ssl/d1_msg.c b/deps/openssl/openssl/ssl/d1_msg.c
index 50676a1cda3..5d49e3cd1b9 100644
--- a/deps/openssl/openssl/ssl/d1_msg.c
+++ b/deps/openssl/openssl/ssl/d1_msg.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,6 +19,13 @@ int dtls1_write_app_data_bytes(SSL *s, uint8_t type, const void *buf_,
     if (sc == NULL)
         return -1;

+    /*
+     * If we are supposed to be sending a KeyUpdate or NewSessionTicket then go
+     * into init - in which case we should finish doing that first.
+     */
+    if (sc->key_update != SSL_KEY_UPDATE_NONE || sc->ext.extra_tickets_expected > 0)
+        ossl_statem_set_in_init(sc, 1);
+
     if (SSL_in_init(s) && !ossl_statem_get_in_handshake(sc)) {
         i = sc->handshake_func(s);
         if (i < 0)
diff --git a/deps/openssl/openssl/ssl/d1_transcript.c b/deps/openssl/openssl/ssl/d1_transcript.c
new file mode 100644
index 00000000000..f14bddd267c
--- /dev/null
+++ b/deps/openssl/openssl/ssl/d1_transcript.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "ssl_local.h"
+
+/*
+ * RFC 9147 §5.2: strip msg_seq, fragment_offset, and fragment_length from
+ * each DTLS handshake message header before feeding into the transcript hash.
+ * Used by both ssl3_finish_mac and tls13_change_cipher_state.
+ */
+int dtls13_transcript_hash_update(EVP_MD_CTX *mdctx,
+    const unsigned char *buf, size_t len)
+{
+    while (len > 0) {
+        PACKET hmhdr;
+        unsigned long hmbodylen;
+        unsigned int msgtype;
+        size_t hmhdrlen;
+
+        if (!ossl_assert(len >= SSL3_HM_HEADER_LENGTH)
+            || !PACKET_buf_init(&hmhdr, buf, SSL3_HM_HEADER_LENGTH)
+            || !PACKET_get_1(&hmhdr, &msgtype)
+            || !PACKET_get_net_3(&hmhdr, &hmbodylen))
+            return 0;
+
+        hmhdrlen = (msgtype == SSL3_MT_MESSAGE_HASH)
+            ? SSL3_HM_HEADER_LENGTH
+            : DTLS1_HM_HEADER_LENGTH;
+
+        if (!ossl_assert(hmhdrlen + hmbodylen <= len)
+            || !EVP_DigestUpdate(mdctx, buf, SSL3_HM_HEADER_LENGTH)
+            || !EVP_DigestUpdate(mdctx, buf + hmhdrlen, hmbodylen))
+            return 0;
+
+        buf += hmhdrlen + hmbodylen;
+        len -= hmhdrlen + hmbodylen;
+    }
+    return 1;
+}
diff --git a/deps/openssl/openssl/ssl/dgram_demux.c b/deps/openssl/openssl/ssl/dgram_demux.c
new file mode 100644
index 00000000000..7404b6299d2
--- /dev/null
+++ b/deps/openssl/openssl/ssl/dgram_demux.c
@@ -0,0 +1,583 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "internal/e_os.h"
+#include "internal/dgram_demux.h"
+#include "internal/thread_arch.h"
+#include "internal/common.h"
+#include <openssl/err.h>
+#include <string.h>
+
+#if !defined(OPENSSL_NO_QUIC) || !defined(OPENSSL_NO_DTLS)
+
+/* URXE_DEMUX_STATE_* are defined in dgram_demux.h */
+
+#define DEMUX_DEFAULT_MTU 1500
+#define DEMUX_MIN_INITIAL_DGRAM_LEN 1200
+
+struct dgram_demux_st {
+    /* The underlying transport BIO with datagram semantics. */
+    BIO *net_bio;
+
+    /*
+     * Our current understanding of the upper bound on an incoming datagram size
+     * in bytes.
+     */
+    size_t mtu;
+
+    /* The datagram_id to use for the next datagram we receive. */
+    uint64_t next_datagram_id;
+
+    /* Time retrieval callback. */
+    OSSL_TIME (*now)(void *arg);
+    void *now_arg;
+
+    /* The default packet handler, if any. */
+    ossl_dgram_demux_cb_fn *default_cb;
+    void *default_cb_arg;
+
+    /*
+     * List of URXEs which are not currently in use (i.e., not filled with
+     * unconsumed data). These are moved to the pending list as they are filled.
+     */
+    DGRAM_URXE_LIST urx_free;
+
+    /*
+     * List of URXEs which are filled with received encrypted data. These are
+     * removed from this list as we invoke the callbacks for each of them. They
+     * are then not on any list managed by us; we forget about them until our
+     * user calls ossl_dgram_demux_release_urxe to return the URXE to us, at
+     * which point we add it to the free list.
+     */
+    DGRAM_URXE_LIST urx_pending;
+
+    /* Whether to use local address support. */
+    char use_local_addr;
+
+    /* Whether internal locking is required */
+    char require_mutex;
+
+    /* Maximum URXEs cached on urx_free; 0 means unbounded. */
+    size_t max_free_urxe;
+
+    /*
+     * Mutex protecting the URXE lists (urx_free and urx_pending).
+     */
+    CRYPTO_MUTEX *mutex;
+};
+
+/* List management helpers */
+void ossl_dgram_urxe_remove(DGRAM_URXE_LIST *l, DGRAM_URXE *e)
+{
+    ossl_list_urxe_remove(l, e);
+}
+
+void ossl_dgram_urxe_insert_head(DGRAM_URXE_LIST *l, DGRAM_URXE *e)
+{
+    ossl_list_urxe_insert_head(l, e);
+}
+
+void ossl_dgram_urxe_insert_tail(DGRAM_URXE_LIST *l, DGRAM_URXE *e)
+{
+    ossl_list_urxe_insert_tail(l, e);
+}
+
+DGRAM_DEMUX *ossl_dgram_demux_new(BIO *net_bio,
+    int threadsafe,
+    OSSL_TIME (*now)(void *arg),
+    void *now_arg)
+{
+    DGRAM_DEMUX *demux;
+
+    demux = OPENSSL_zalloc(sizeof(DGRAM_DEMUX));
+    if (demux == NULL)
+        return NULL;
+
+    if (threadsafe) {
+        demux->require_mutex = 1;
+        demux->mutex = ossl_crypto_mutex_new();
+#ifdef OPENSSL_THREADS
+        if (demux->mutex == NULL) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
+            OPENSSL_free(demux);
+            return NULL;
+        }
+#endif
+    }
+
+    /* We update this if possible when we get a BIO. */
+    demux->mtu = DEMUX_DEFAULT_MTU;
+    demux->now = now;
+    demux->now_arg = now_arg;
+
+    ossl_dgram_demux_set_bio(demux, net_bio);
+
+    return demux;
+}
+
+static void dgram_demux_free_urxl(DGRAM_URXE_LIST *l)
+{
+    DGRAM_URXE *e, *enext;
+
+    for (e = ossl_list_urxe_head(l); e != NULL; e = enext) {
+        enext = ossl_list_urxe_next(e);
+        ossl_list_urxe_remove(l, e);
+        OPENSSL_free(e);
+    }
+}
+
+void ossl_dgram_demux_free(DGRAM_DEMUX *demux)
+{
+    if (demux == NULL)
+        return;
+
+    /* Free all URXEs we are holding. */
+    dgram_demux_free_urxl(&demux->urx_free);
+    dgram_demux_free_urxl(&demux->urx_pending);
+
+    if (demux->require_mutex)
+        ossl_crypto_mutex_free(&demux->mutex);
+
+    OPENSSL_free(demux);
+}
+
+void ossl_dgram_demux_set_bio(DGRAM_DEMUX *demux, BIO *net_bio)
+{
+    unsigned int mtu;
+
+    demux->net_bio = net_bio;
+
+    if (net_bio != NULL) {
+        /*
+         * Try to determine our MTU if possible. The BIO is not required to
+         * support this, in which case we remain at the last known MTU, or our
+         * initial default.
+         */
+        mtu = BIO_dgram_get_mtu(net_bio);
+        if (mtu >= DEMUX_MIN_INITIAL_DGRAM_LEN)
+            ossl_dgram_demux_set_mtu(demux, mtu);
+
+        if (BIO_dgram_get_local_addr_cap(net_bio)
+            && BIO_dgram_set_local_addr_enable(net_bio, 1))
+            demux->use_local_addr = 1;
+    }
+}
+
+int ossl_dgram_demux_set_mtu(DGRAM_DEMUX *demux, unsigned int mtu)
+{
+    if (mtu < DEMUX_MIN_INITIAL_DGRAM_LEN)
+        return 0;
+
+    /*
+     * mtu is read under demux->mutex by the receive path
+     * so take the lock here.
+     */
+    if (demux->require_mutex)
+        ossl_crypto_mutex_lock(demux->mutex);
+    demux->mtu = mtu;
+    if (demux->require_mutex)
+        ossl_crypto_mutex_unlock(demux->mutex);
+    return 1;
+}
+
+void ossl_dgram_demux_set_max_free_urxe(DGRAM_DEMUX *demux, size_t max_free)
+{
+    if (demux->require_mutex)
+        ossl_crypto_mutex_lock(demux->mutex);
+    demux->max_free_urxe = max_free;
+    if (demux->require_mutex)
+        ossl_crypto_mutex_unlock(demux->mutex);
+}
+
+size_t ossl_dgram_demux_get_free_list_len(DGRAM_DEMUX *demux)
+{
+    size_t n;
+
+    if (demux->require_mutex)
+        ossl_crypto_mutex_lock(demux->mutex);
+    n = ossl_list_urxe_num(&demux->urx_free);
+    if (demux->require_mutex)
+        ossl_crypto_mutex_unlock(demux->mutex);
+    return n;
+}
+
+void ossl_dgram_demux_set_default_handler(DGRAM_DEMUX *demux,
+    ossl_dgram_demux_cb_fn *cb,
+    void *cb_arg)
+{
+    demux->default_cb = cb;
+    demux->default_cb_arg = cb_arg;
+}
+
+static DGRAM_URXE *dgram_demux_alloc_urxe(size_t alloc_len)
+{
+    DGRAM_URXE *e;
+
+    if (alloc_len >= SIZE_MAX - sizeof(DGRAM_URXE))
+        return NULL;
+
+    e = OPENSSL_zalloc(sizeof(DGRAM_URXE) + alloc_len);
+    if (e == NULL)
+        return NULL;
+
+    ossl_list_urxe_init_elem(e);
+    e->alloc_len = alloc_len;
+    e->data_len = 0;
+    return e;
+}
+
+static DGRAM_URXE *dgram_demux_resize_urxe(DGRAM_DEMUX *demux, DGRAM_URXE *e,
+    size_t new_alloc_len)
+{
+    DGRAM_URXE *e2, *prev;
+
+    if (!ossl_assert(e->demux_state == URXE_DEMUX_STATE_FREE))
+        /* Never attempt to resize a URXE which is not on the free list. */
+        return NULL;
+
+    prev = ossl_list_urxe_prev(e);
+    ossl_list_urxe_remove(&demux->urx_free, e);
+
+    if (new_alloc_len >= SIZE_MAX - sizeof(DGRAM_URXE))
+        goto rollback;
+
+    e2 = OPENSSL_realloc(e, sizeof(DGRAM_URXE) + new_alloc_len);
+
+    /* Failed to resize, abort. */
+    if (e2 == NULL)
+        goto rollback;
+
+    if (prev == NULL)
+        ossl_list_urxe_insert_head(&demux->urx_free, e2);
+    else
+        ossl_list_urxe_insert_after(&demux->urx_free, prev, e2);
+
+    e2->alloc_len = new_alloc_len;
+    return e2;
+
+rollback:
+    /* Reinsert e back into the list on failures */
+    if (prev == NULL)
+        ossl_list_urxe_insert_head(&demux->urx_free, e);
+    else
+        ossl_list_urxe_insert_after(&demux->urx_free, prev, e);
+
+    return NULL;
+}
+
+static DGRAM_URXE *dgram_demux_reserve_urxe(DGRAM_DEMUX *demux, DGRAM_URXE *e,
+    size_t alloc_len)
+{
+    return e->alloc_len < alloc_len
+        ? dgram_demux_resize_urxe(demux, e, alloc_len)
+        : e;
+}
+
+static int dgram_demux_ensure_free_urxe(DGRAM_DEMUX *demux, size_t min_num_free)
+{
+    DGRAM_URXE *e;
+
+    /* Caller must hold the lock */
+    while (ossl_list_urxe_num(&demux->urx_free) < min_num_free) {
+        e = dgram_demux_alloc_urxe(demux->mtu);
+        if (e == NULL)
+            return 0;
+
+        ossl_list_urxe_insert_tail(&demux->urx_free, e);
+        e->demux_state = URXE_DEMUX_STATE_FREE;
+    }
+
+    return 1;
+}
+
+/*
+ * Receive datagrams from network, placing them into URXEs.
+ *
+ * Returns DGRAM_DEMUX_PUMP_RES_* value.
+ *
+ * Precondition: at least one URXE is free
+ * Precondition: there are no pending URXEs
+ * Precondition: Caller holds the demux lock
+ */
+static int dgram_demux_recv(DGRAM_DEMUX *demux)
+{
+    BIO_MSG msg[DEMUX_MAX_MSGS_PER_CALL];
+    size_t rd, i;
+    DGRAM_URXE *urxe = ossl_list_urxe_head(&demux->urx_free), *unext;
+    OSSL_TIME now;
+
+    /* This should never be called when we have any pending URXE. */
+    assert(ossl_list_urxe_head(&demux->urx_pending) == NULL);
+    assert(urxe->demux_state == URXE_DEMUX_STATE_FREE);
+
+    if (demux->net_bio == NULL)
+        /*
+         * If no BIO is plugged in, treat this as no datagram being available.
+         */
+        return DGRAM_DEMUX_PUMP_RES_TRANSIENT_FAIL;
+
+    /*
+     * Opportunistically receive as many messages as possible in a single
+     * syscall, determined by how many free URXEs are available.
+     */
+    for (i = 0; i < (ossl_ssize_t)OSSL_NELEM(msg);
+        ++i, urxe = ossl_list_urxe_next(urxe)) {
+        if (urxe == NULL) {
+            /* We need at least one URXE to receive into. */
+            if (!ossl_assert(i > 0))
+                return DGRAM_DEMUX_PUMP_RES_PERMANENT_FAIL;
+
+            break;
+        }
+
+        /* Ensure the URXE is big enough. */
+        urxe = dgram_demux_reserve_urxe(demux, urxe, demux->mtu);
+        if (urxe == NULL)
+            /* Allocation error, fail. */
+            return DGRAM_DEMUX_PUMP_RES_PERMANENT_FAIL;
+
+        /* Ensure we zero any fields added to BIO_MSG at a later date. */
+        memset(&msg[i], 0, sizeof(BIO_MSG));
+        msg[i].data = ossl_dgram_urxe_data(urxe);
+        msg[i].data_len = urxe->alloc_len;
+        msg[i].peer = &urxe->peer;
+        BIO_ADDR_clear(&urxe->peer);
+        if (demux->use_local_addr)
+            msg[i].local = &urxe->local;
+        else
+            BIO_ADDR_clear(&urxe->local);
+    }
+
+    ERR_set_mark();
+    if (!BIO_recvmmsg(demux->net_bio, msg, sizeof(BIO_MSG), i, 0, &rd)) {
+        if (BIO_err_is_non_fatal(ERR_peek_last_error())) {
+            /* Transient error, clear the error and stop. */
+            ERR_pop_to_mark();
+            return DGRAM_DEMUX_PUMP_RES_TRANSIENT_FAIL;
+        } else {
+            /* Non-transient error, do not clear the error. */
+            ERR_clear_last_mark();
+            return DGRAM_DEMUX_PUMP_RES_PERMANENT_FAIL;
+        }
+    }
+
+    ERR_clear_last_mark();
+    now = demux->now != NULL ? demux->now(demux->now_arg) : ossl_time_zero();
+
+    urxe = ossl_list_urxe_head(&demux->urx_free);
+    for (i = 0; i < rd; ++i, urxe = unext) {
+        unext = ossl_list_urxe_next(urxe);
+        /* Set URXE with actual length of received datagram. */
+        urxe->data_len = msg[i].data_len;
+        /* Time we received datagram. */
+        urxe->time = now;
+        urxe->datagram_id = demux->next_datagram_id++;
+        /* Move from free list to pending list. */
+        ossl_list_urxe_remove(&demux->urx_free, urxe);
+        ossl_list_urxe_insert_tail(&demux->urx_pending, urxe);
+        urxe->demux_state = URXE_DEMUX_STATE_PENDING;
+    }
+
+    return DGRAM_DEMUX_PUMP_RES_OK;
+}
+
+/*
+ * Process a single pending URXE.
+ * Returning 1 on success, 0 on failure.
+ *
+ * Precondition: Caller holds the demux lock
+ * Note: Lock is released before callback and reacquired after.
+ */
+static int dgram_demux_process_pending_urxe(DGRAM_DEMUX *demux, DGRAM_URXE *e)
+{
+    /* The next URXE we process should be at the head of the pending list. */
+    if (!ossl_assert(e == ossl_list_urxe_head(&demux->urx_pending)))
+        return 0;
+
+    assert(e->demux_state == URXE_DEMUX_STATE_PENDING);
+
+    ossl_list_urxe_remove(&demux->urx_pending, e);
+    if (demux->default_cb != NULL) {
+        /*
+         * Pass to handler for routing. The URXE now belongs to the callback.
+         * Release lock before callback to avoid deadlock if callback calls
+         * release_urxe or reinject_urxe.
+         */
+        e->demux_state = URXE_DEMUX_STATE_ISSUED;
+        if (demux->require_mutex)
+            ossl_crypto_mutex_unlock(demux->mutex);
+        demux->default_cb(e, demux->default_cb_arg);
+        if (demux->require_mutex)
+            ossl_crypto_mutex_lock(demux->mutex);
+    } else {
+        /* No handler, discard. */
+        ossl_list_urxe_insert_tail(&demux->urx_free, e);
+        e->demux_state = URXE_DEMUX_STATE_FREE;
+    }
+
+    return 1; /* keep processing pending URXEs */
+}
+
+/*
+ * Process pending URXEs to generate callbacks.
+ * Precondition: Caller holds the demux lock
+ */
+static int dgram_demux_process_pending_urxl(DGRAM_DEMUX *demux)
+{
+    DGRAM_URXE *e;
+    int ret;
+
+    while ((e = ossl_list_urxe_head(&demux->urx_pending)) != NULL)
+        if ((ret = dgram_demux_process_pending_urxe(demux, e)) <= 0)
+            return ret;
+
+    return 1;
+}
+
+/*
+ * Drain the pending URXE list, processing any pending URXEs by making their
+ * callbacks. If no URXEs are pending, a network read is attempted first.
+ */
+int ossl_dgram_demux_pump(DGRAM_DEMUX *demux)
+{
+    int ret;
+
+    if (demux->require_mutex)
+        ossl_crypto_mutex_lock(demux->mutex);
+
+    if (ossl_list_urxe_head(&demux->urx_pending) == NULL) {
+        if (!dgram_demux_ensure_free_urxe(demux, DEMUX_MAX_MSGS_PER_CALL)) {
+            ret = DGRAM_DEMUX_PUMP_RES_PERMANENT_FAIL;
+            goto end;
+        }
+
+        ret = dgram_demux_recv(demux);
+        if (ret != DGRAM_DEMUX_PUMP_RES_OK)
+            goto end;
+
+        /*
+         * If dgram_demux_recv returned successfully, we should always have
+         * something.
+         */
+        assert(ossl_list_urxe_head(&demux->urx_pending) != NULL);
+    }
+
+    if (dgram_demux_process_pending_urxl(demux) <= 0) {
+        ret = DGRAM_DEMUX_PUMP_RES_PERMANENT_FAIL;
+        goto end;
+    }
+
+    ret = DGRAM_DEMUX_PUMP_RES_OK;
+
+end:
+    if (demux->require_mutex)
+        ossl_crypto_mutex_unlock(demux->mutex);
+    return ret;
+}
+
+/* Artificially inject a packet into the demuxer for testing purposes. */
+int ossl_dgram_demux_inject(DGRAM_DEMUX *demux,
+    const unsigned char *buf,
+    size_t buf_len,
+    const BIO_ADDR *peer,
+    const BIO_ADDR *local)
+{
+    int ret = 0;
+    DGRAM_URXE *urxe;
+
+    if (demux->require_mutex)
+        ossl_crypto_mutex_lock(demux->mutex);
+
+    if (!dgram_demux_ensure_free_urxe(demux, 1))
+        goto end;
+
+    urxe = ossl_list_urxe_head(&demux->urx_free);
+
+    assert(urxe->demux_state == URXE_DEMUX_STATE_FREE);
+
+    urxe = dgram_demux_reserve_urxe(demux, urxe, buf_len);
+    if (urxe == NULL)
+        goto end;
+
+    memcpy(ossl_dgram_urxe_data(urxe), buf, buf_len);
+    urxe->data_len = buf_len;
+
+    if (peer != NULL)
+        BIO_ADDR_copy(&urxe->peer, peer);
+    else
+        BIO_ADDR_clear(&urxe->peer);
+
+    if (local != NULL)
+        BIO_ADDR_copy(&urxe->local, local);
+    else
+        BIO_ADDR_clear(&urxe->local);
+
+    urxe->time
+        = demux->now != NULL ? demux->now(demux->now_arg) : ossl_time_zero();
+
+    /* Move from free list to pending list. */
+    ossl_list_urxe_remove(&demux->urx_free, urxe);
+    urxe->datagram_id = demux->next_datagram_id++;
+    ossl_list_urxe_insert_tail(&demux->urx_pending, urxe);
+    urxe->demux_state = URXE_DEMUX_STATE_PENDING;
+
+    ret = dgram_demux_process_pending_urxl(demux) > 0;
+
+end:
+    if (demux->require_mutex)
+        ossl_crypto_mutex_unlock(demux->mutex);
+    return ret;
+}
+
+/*
+ * Called by our user to return a URXE to the free list. If the free list
+ * is already at its limit the URXE is freed instead of being cached;
+ * callers must not reference a URXE after releasing it, so freeing here
+ * is safe even inside the routing callback.
+ */
+void ossl_dgram_demux_release_urxe(DGRAM_DEMUX *demux, DGRAM_URXE *e)
+{
+    int cache;
+
+    assert(ossl_list_urxe_prev(e) == NULL && ossl_list_urxe_next(e) == NULL);
+    assert(e->demux_state == URXE_DEMUX_STATE_ISSUED);
+
+    if (demux->require_mutex)
+        ossl_crypto_mutex_lock(demux->mutex);
+    cache = demux->max_free_urxe == 0
+        || ossl_list_urxe_num(&demux->urx_free) < demux->max_free_urxe;
+    if (cache) {
+        ossl_list_urxe_insert_tail(&demux->urx_free, e);
+        e->demux_state = URXE_DEMUX_STATE_FREE;
+    }
+    if (demux->require_mutex)
+        ossl_crypto_mutex_unlock(demux->mutex);
+    if (!cache)
+        OPENSSL_free(e);
+}
+
+void ossl_dgram_demux_reinject_urxe(DGRAM_DEMUX *demux, DGRAM_URXE *e)
+{
+    assert(ossl_list_urxe_prev(e) == NULL && ossl_list_urxe_next(e) == NULL);
+    assert(e->demux_state == URXE_DEMUX_STATE_ISSUED);
+
+    if (demux->require_mutex)
+        ossl_crypto_mutex_lock(demux->mutex);
+    ossl_list_urxe_insert_head(&demux->urx_pending, e);
+    e->demux_state = URXE_DEMUX_STATE_PENDING;
+    if (demux->require_mutex)
+        ossl_crypto_mutex_unlock(demux->mutex);
+}
+
+int ossl_dgram_demux_has_pending(const DGRAM_DEMUX *demux)
+{
+    return ossl_list_urxe_head(&demux->urx_pending) != NULL;
+}
+
+#endif /* !OPENSSL_NO_QUIC || !OPENSSL_NO_DTLS */
diff --git a/deps/openssl/openssl/ssl/dtls_conn_lookup.c b/deps/openssl/openssl/ssl/dtls_conn_lookup.c
new file mode 100644
index 00000000000..fea8c7d277b
--- /dev/null
+++ b/deps/openssl/openssl/ssl/dtls_conn_lookup.c
@@ -0,0 +1,530 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/crypto.h>
+#include <openssl/bio.h>
+#include <openssl/ssl.h>
+#include <openssl/rand.h>
+#include "internal/common.h"
+#include "internal/dgram_conn_lookup.h"
+#include "crypto/siphash.h"
+
+#ifndef OPENSSL_NO_DTLS
+
+/*
+ * Internal entry structure for address-based connection lookup.
+ * Stores a connection keyed by peer address.
+ */
+typedef struct dgram_conn_entry_st {
+    BIO_ADDR peer; /* Peer address (key) */
+    SSL *ssl; /* The SSL connection object */
+    uint8_t *hashkey; /* Pre-built hash key (family + port + addr) */
+    size_t hashkey_len; /* Length of the hash key */
+    uint64_t *siphash_key; /* Pointer to shared SipHash key (hash-flooding defense) */
+} DGRAM_CONN_ENTRY;
+
+DEFINE_LHASH_OF_EX(DGRAM_CONN_ENTRY);
+
+/*
+ * Wrapper structure for address-based lookup implementation data.
+ * Contains the hash table and SipHash key for hash-flooding defense.
+ */
+typedef struct addr_lookup_data_st {
+    LHASH_OF(DGRAM_CONN_ENTRY) *htable;
+    uint64_t hash_key[2]; /* 128-bit SipHash key */
+} ADDR_LOOKUP_DATA;
+
+/* BIO_ADDR contains the raw address for every supported address family. */
+#define ADDR_HASHKEY_MAX_LEN (sizeof(int) + sizeof(uint16_t) + sizeof(BIO_ADDR))
+
+/*
+ * Build a hash key from a BIO_ADDR in caller-provided storage.
+ * The key format is: family (int) + port (uint16_t) + raw address bytes.
+ *
+ * Returns 1 on success, 0 on failure.
+ */
+static int build_hashkey_into(const BIO_ADDR *peer, uint8_t *hashkey,
+    size_t capacity, size_t *out_len)
+{
+    size_t addr_len = 0;
+    size_t header_len = sizeof(int) + sizeof(uint16_t);
+    int family = BIO_ADDR_family(peer);
+    uint16_t port;
+
+    /* For AF_UNSPEC (no peer address), use a minimal key */
+    if (family == AF_UNSPEC) {
+        if (capacity < sizeof(family))
+            return 0;
+        memcpy(hashkey, &family, sizeof(family));
+        *out_len = sizeof(family);
+        return 1;
+    }
+
+    if (!BIO_ADDR_rawaddress(peer, NULL, &addr_len)
+        || capacity < header_len || addr_len > capacity - header_len)
+        return 0;
+
+    port = BIO_ADDR_rawport(peer);
+    memcpy(hashkey, &family, sizeof(family));
+    memcpy(hashkey + sizeof(family), &port, sizeof(port));
+    if (!BIO_ADDR_rawaddress(peer, hashkey + header_len, NULL))
+        return 0;
+
+    *out_len = header_len + addr_len;
+    return 1;
+}
+
+/* Return an allocated hash key for callers which need owned storage. */
+static uint8_t *build_hashkey(const BIO_ADDR *peer, size_t *out_len)
+{
+    uint8_t hashkey[ADDR_HASHKEY_MAX_LEN];
+
+    if (!build_hashkey_into(peer, hashkey, sizeof(hashkey), out_len))
+        return NULL;
+    return OPENSSL_memdup(hashkey, *out_len);
+}
+
+/*
+ * Hash function for DGRAM_CONN_ENTRY.
+ * Uses SipHash with a per-instance random key to defend against
+ * hash-flooding CPU DoS attacks
+ */
+static unsigned long conn_entry_hash(const DGRAM_CONN_ENTRY *e)
+{
+    SIPHASH siphash = { 0 };
+    unsigned long hashval = 0;
+
+    if (e->hashkey == NULL || e->hashkey_len == 0 || e->siphash_key == NULL)
+        return 0;
+
+    if (!SipHash_set_hash_size(&siphash, sizeof(unsigned long)))
+        return 0;
+    if (!SipHash_Init(&siphash, (const unsigned char *)e->siphash_key, 0, 0))
+        return 0;
+    SipHash_Update(&siphash, e->hashkey, e->hashkey_len);
+    if (!SipHash_Final(&siphash, (unsigned char *)&hashval, sizeof(unsigned long)))
+        return 0;
+
+    return hashval;
+}
+
+/*
+ * Compare function for DGRAM_CONN_ENTRY - compares pre-built hashkeys.
+ * Returns 0 if equal, non-zero otherwise.
+ */
+static int conn_entry_cmp(const DGRAM_CONN_ENTRY *a, const DGRAM_CONN_ENTRY *b)
+{
+    if (a->hashkey_len != b->hashkey_len)
+        return 1;
+    if (a->hashkey == NULL || b->hashkey == NULL)
+        return (a->hashkey == b->hashkey) ? 0 : 1;
+    return memcmp(a->hashkey, b->hashkey, a->hashkey_len);
+}
+
+/*
+ * Free a connection entry (but not the connection itself).
+ */
+static void conn_entry_free(DGRAM_CONN_ENTRY *e)
+{
+    if (e == NULL)
+        return;
+    OPENSSL_free(e->hashkey);
+    OPENSSL_free(e);
+}
+
+/*
+ * Callback for lh_DGRAM_CONN_ENTRY_doall to free all entries.
+ */
+static void conn_entry_free_cb(DGRAM_CONN_ENTRY *e)
+{
+    conn_entry_free(e);
+}
+
+/*
+ * Lookup a connection by peer address from URXE.
+ */
+static SSL *addr_lookup(DGRAM_CONN_LOOKUP *lookup, const DGRAM_URXE *e)
+{
+    ADDR_LOOKUP_DATA *data;
+    DGRAM_CONN_ENTRY key;
+    DGRAM_CONN_ENTRY *result;
+
+    if (lookup == NULL || lookup->impl_data == NULL || e == NULL)
+        return NULL;
+
+    data = (ADDR_LOOKUP_DATA *)lookup->impl_data;
+
+    memset(&key, 0, sizeof(key));
+    BIO_ADDR_copy(&key.peer, &e->peer);
+
+    /* Build hashkey for the lookup key */
+    key.hashkey = build_hashkey(&e->peer, &key.hashkey_len);
+    if (key.hashkey == NULL)
+        return NULL;
+
+    /* Set SipHash key pointer for hash function */
+    key.siphash_key = data->hash_key;
+
+    result = lh_DGRAM_CONN_ENTRY_retrieve(data->htable, &key);
+
+    OPENSSL_free(key.hashkey);
+
+    if (result == NULL)
+        return NULL;
+
+    return result->ssl;
+}
+
+/*
+ * Register a connection with peer address from URXE.
+ */
+static int addr_register_conn(DGRAM_CONN_LOOKUP *lookup, const DGRAM_URXE *e,
+    SSL *ssl)
+{
+    ADDR_LOOKUP_DATA *data;
+    DGRAM_CONN_ENTRY *entry, *old;
+
+    if (lookup == NULL || lookup->impl_data == NULL || e == NULL || ssl == NULL)
+        return 0;
+
+    data = (ADDR_LOOKUP_DATA *)lookup->impl_data;
+
+    entry = OPENSSL_zalloc(sizeof(*entry));
+    if (entry == NULL)
+        return 0;
+
+    BIO_ADDR_copy(&entry->peer, &e->peer);
+    entry->ssl = ssl;
+    entry->hashkey = build_hashkey(&e->peer, &entry->hashkey_len);
+    if (entry->hashkey == NULL) {
+        OPENSSL_free(entry);
+        return 0;
+    }
+
+    /* Set SipHash key pointer for hash function */
+    entry->siphash_key = data->hash_key;
+
+    old = lh_DGRAM_CONN_ENTRY_insert(data->htable, entry);
+
+    /* Check if insert failed due to allocation error */
+    if (lh_DGRAM_CONN_ENTRY_error(data->htable)) {
+        conn_entry_free(entry);
+        /* Don't free old since it is still in the hash table since insert failed */
+        return 0;
+    }
+
+    /*
+     * A non-NULL return from lh_DGRAM_CONN_ENTRY_insert means an entry with the
+     * same key (peer address) was already present and has just been replaced.
+     * This must not happen: callers always look up an address and only register
+     * when no entry exists, all while holding the listener mutex, so the same peer
+     * is never registered twice. We therefore expect old == NULL here.
+     *
+     * We deliberately do NOT free old->ssl: this lookup table is an
+     * ownership-agnostic index and does not own the SSL objects it stores.
+     * The owning layer (the DTLS listener) is responsible for the lifecycle of
+     * those SSL objects. Freeing one here would be a use-after-free for the
+     * non-owning established_conns table.
+     */
+    if (!ossl_assert(old == NULL))
+        conn_entry_free(old);
+
+    return 1;
+}
+
+/*
+ * Register a connection by peer address from BIO_ADDR directly.
+ * This is used when we don't have a URXE available.
+ */
+static int addr_register_conn_addr(DGRAM_CONN_LOOKUP *lookup, const BIO_ADDR *peer,
+    SSL *ssl)
+{
+    ADDR_LOOKUP_DATA *data;
+    DGRAM_CONN_ENTRY *entry, *old;
+
+    if (lookup == NULL || lookup->impl_data == NULL || peer == NULL || ssl == NULL)
+        return 0;
+
+    data = (ADDR_LOOKUP_DATA *)lookup->impl_data;
+
+    entry = OPENSSL_zalloc(sizeof(*entry));
+    if (entry == NULL)
+        return 0;
+
+    BIO_ADDR_copy(&entry->peer, peer);
+    entry->ssl = ssl;
+    entry->hashkey = build_hashkey(peer, &entry->hashkey_len);
+    if (entry->hashkey == NULL) {
+        OPENSSL_free(entry);
+        return 0;
+    }
+
+    /* Set SipHash key pointer for hash function */
+    entry->siphash_key = data->hash_key;
+
+    old = lh_DGRAM_CONN_ENTRY_insert(data->htable, entry);
+
+    /* Check if insert failed due to allocation error */
+    if (lh_DGRAM_CONN_ENTRY_error(data->htable)) {
+        conn_entry_free(entry);
+        /* Don't free old since it is still in the hash table since insert failed */
+        return 0;
+    }
+
+    /*
+     * A non-NULL return from lh_DGRAM_CONN_ENTRY_insert means an entry with the
+     * same key(peer address) was already present and has just been replaced. This
+     * must not happen: callers always look up an address and only register when no
+     * entry exists, all while holding the listener mutex, so the same peer is
+     * never registered twice. We therefore expect old == NULL here.
+     *
+     * We deliberately do NOT free old->ssl: this lookup table is an
+     * ownership-agnostic index and does not own the SSL objects it stores.
+     * The owning layer (the DTLS listener) is responsible for the lifecycle of
+     * those SSL objects. Freeing one here would be a use-after-free for the
+     * non-owning established_conns table.
+     */
+    if (!ossl_assert(old == NULL))
+        conn_entry_free(old);
+
+    return 1;
+}
+
+/*
+ * Unregister a connection by peer address.
+ */
+static int addr_unregister_conn(DGRAM_CONN_LOOKUP *lookup, const BIO_ADDR *peer)
+{
+    ADDR_LOOKUP_DATA *data;
+    DGRAM_CONN_ENTRY lookup_key;
+    DGRAM_CONN_ENTRY *removed;
+    uint8_t hashkey[ADDR_HASHKEY_MAX_LEN];
+
+    if (lookup == NULL || lookup->impl_data == NULL || peer == NULL)
+        return 0;
+
+    data = (ADDR_LOOKUP_DATA *)lookup->impl_data;
+
+    memset(&lookup_key, 0, sizeof(lookup_key));
+    BIO_ADDR_copy(&lookup_key.peer, peer);
+
+    /* Cleanup must not depend on allocating a temporary lookup key. */
+    if (!build_hashkey_into(peer, hashkey, sizeof(hashkey),
+            &lookup_key.hashkey_len))
+        return 0;
+    lookup_key.hashkey = hashkey;
+
+    /* Set SipHash key pointer for hash function */
+    lookup_key.siphash_key = data->hash_key;
+
+    removed = lh_DGRAM_CONN_ENTRY_delete(data->htable, &lookup_key);
+
+    if (removed != NULL) {
+        conn_entry_free(removed);
+        return 1;
+    }
+
+    return 0;
+}
+
+/*
+ * Free the lookup structure and all entries.
+ */
+static void addr_free(DGRAM_CONN_LOOKUP *lookup)
+{
+    ADDR_LOOKUP_DATA *data;
+
+    if (lookup == NULL)
+        return;
+
+    if (lookup->impl_data != NULL) {
+        data = (ADDR_LOOKUP_DATA *)lookup->impl_data;
+        if (data->htable != NULL) {
+            lh_DGRAM_CONN_ENTRY_doall(data->htable, conn_entry_free_cb);
+            lh_DGRAM_CONN_ENTRY_free(data->htable);
+        }
+        OPENSSL_free(data);
+    }
+
+    OPENSSL_free(lookup);
+}
+
+/*
+ * Context structure for iteration callback.
+ */
+typedef struct {
+    ossl_dgram_conn_lookup_iter_fn user_cb;
+    void *user_arg;
+} ADDR_FOREACH_CTX;
+
+/*
+ * Internal callback for lh_doall_arg that invokes the user's callback.
+ */
+static void addr_foreach_cb(DGRAM_CONN_ENTRY *e, void *arg)
+{
+    ADDR_FOREACH_CTX *ctx = arg;
+
+    if (ctx->user_cb != NULL)
+        ctx->user_cb(e->ssl, &e->peer, ctx->user_arg);
+}
+
+IMPLEMENT_LHASH_DOALL_ARG(DGRAM_CONN_ENTRY, void);
+
+/*
+ * Iterate over all connections, calling the callback for each.
+ */
+static void addr_foreach(DGRAM_CONN_LOOKUP *lookup,
+    ossl_dgram_conn_lookup_iter_fn cb, void *arg)
+{
+    ADDR_LOOKUP_DATA *data;
+    ADDR_FOREACH_CTX ctx;
+
+    if (lookup == NULL || lookup->impl_data == NULL || cb == NULL)
+        return;
+
+    data = (ADDR_LOOKUP_DATA *)lookup->impl_data;
+    ctx.user_cb = cb;
+    ctx.user_arg = arg;
+
+    lh_DGRAM_CONN_ENTRY_doall_void(data->htable, addr_foreach_cb, &ctx);
+}
+
+static size_t addr_num_items(const DGRAM_CONN_LOOKUP *lookup)
+{
+    ADDR_LOOKUP_DATA *data;
+
+    if (lookup == NULL || lookup->impl_data == NULL)
+        return 0;
+
+    data = (ADDR_LOOKUP_DATA *)lookup->impl_data;
+    return lh_DGRAM_CONN_ENTRY_num_items(data->htable);
+}
+
+static const DGRAM_CONN_LOOKUP_METHODS addr_methods = {
+    addr_lookup,
+    addr_register_conn,
+    addr_register_conn_addr,
+    addr_unregister_conn,
+    addr_foreach,
+    addr_free,
+    addr_num_items
+};
+
+/*
+ * Create a new address-based connection lookup for DTLS.
+ */
+DGRAM_CONN_LOOKUP *ossl_dgram_conn_lookup_new_addr(void)
+{
+    DGRAM_CONN_LOOKUP *lookup;
+    ADDR_LOOKUP_DATA *data;
+
+    lookup = OPENSSL_zalloc(sizeof(*lookup));
+    if (lookup == NULL)
+        return NULL;
+
+    data = OPENSSL_zalloc(sizeof(*data));
+    if (data == NULL) {
+        OPENSSL_free(lookup);
+        return NULL;
+    }
+
+    /* Generate random SipHash key for hash-flooding defense */
+    if (RAND_priv_bytes((unsigned char *)data->hash_key,
+            sizeof(data->hash_key))
+        <= 0) {
+        OPENSSL_free(data);
+        OPENSSL_free(lookup);
+        return NULL;
+    }
+
+    data->htable = lh_DGRAM_CONN_ENTRY_new(conn_entry_hash, conn_entry_cmp);
+    if (data->htable == NULL) {
+        OPENSSL_free(data);
+        OPENSSL_free(lookup);
+        return NULL;
+    }
+
+    lookup->methods = &addr_methods;
+    lookup->impl_data = data;
+
+    return lookup;
+}
+
+/*
+ * Public API wrappers - call through methods table.
+ */
+SSL *ossl_dgram_conn_lookup_find(DGRAM_CONN_LOOKUP *lookup, const DGRAM_URXE *e)
+{
+    if (lookup == NULL || lookup->methods == NULL
+        || lookup->methods->lookup == NULL)
+        return NULL;
+    return lookup->methods->lookup(lookup, e);
+}
+
+int ossl_dgram_conn_lookup_register(DGRAM_CONN_LOOKUP *lookup,
+    const DGRAM_URXE *e, SSL *ssl)
+{
+    if (lookup == NULL || lookup->methods == NULL
+        || lookup->methods->register_conn == NULL)
+        return 0;
+    return lookup->methods->register_conn(lookup, e, ssl);
+}
+
+int ossl_dgram_conn_lookup_register_addr(DGRAM_CONN_LOOKUP *lookup,
+    const BIO_ADDR *peer, SSL *ssl)
+{
+    if (lookup == NULL || lookup->methods == NULL
+        || lookup->methods->register_conn_addr == NULL)
+        return 0;
+    return lookup->methods->register_conn_addr(lookup, peer, ssl);
+}
+
+int ossl_dgram_conn_lookup_unregister(DGRAM_CONN_LOOKUP *lookup,
+    const BIO_ADDR *peer)
+{
+    if (lookup == NULL || lookup->methods == NULL
+        || lookup->methods->unregister_conn == NULL)
+        return 0;
+    return lookup->methods->unregister_conn(lookup, peer);
+}
+
+void ossl_dgram_conn_lookup_foreach(DGRAM_CONN_LOOKUP *lookup,
+    ossl_dgram_conn_lookup_iter_fn cb, void *arg)
+{
+    if (lookup == NULL || lookup->methods == NULL
+        || lookup->methods->foreach == NULL)
+        return;
+    lookup->methods->foreach(lookup, cb, arg);
+}
+
+void ossl_dgram_conn_lookup_free(DGRAM_CONN_LOOKUP *lookup)
+{
+    if (lookup == NULL || lookup->methods == NULL
+        || lookup->methods->free == NULL)
+        return;
+    lookup->methods->free(lookup);
+}
+
+/*
+ * Return the number of entries currently registered.
+ *
+ * The lookup is not internally synchronised: like the other lookup
+ * operations, the caller must hold the lock that serialises access to it.
+ * Reading the count without that lock held races with concurrent
+ * register/unregister.
+ */
+size_t ossl_dgram_conn_lookup_num_items(const DGRAM_CONN_LOOKUP *lookup)
+{
+    if (lookup == NULL || lookup->methods == NULL
+        || lookup->methods->num_items == NULL)
+        return 0;
+    return lookup->methods->num_items(lookup);
+}
+
+#endif /* OPENSSL_NO_DTLS */
diff --git a/deps/openssl/openssl/ssl/dtls_record_rx.c b/deps/openssl/openssl/ssl/dtls_record_rx.c
new file mode 100644
index 00000000000..a1bf4c18d4f
--- /dev/null
+++ b/deps/openssl/openssl/ssl/dtls_record_rx.c
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "ssl_local.h"
+
+#ifndef OPENSSL_NO_DTLS
+
+/*
+ * Creates a new DTLS_RX structure. The demuxer is
+ * provided and owned by the DTLS listener.
+ */
+DTLS_RX *ossl_dtls_rx_new(DGRAM_DEMUX *demux)
+{
+    DTLS_RX *rx = OPENSSL_malloc(sizeof(*rx));
+    if (rx == NULL)
+        return NULL;
+
+    rx->demux = demux;
+    ossl_list_urxe_init(&rx->urxe_pending);
+    rx->mutex = ossl_crypto_mutex_new();
+
+#ifdef OPENSSL_THREADS
+    if (rx->mutex == NULL) {
+        OPENSSL_free(rx);
+        return NULL;
+    }
+#endif
+
+    return rx;
+}
+
+/*
+ * Frees a DTLS_RX struct. The demuxer is not freed, as it is
+ * owned by the DTLS listener. The list is walked and freed.
+ */
+void ossl_dtls_rx_free(DTLS_RX *rx)
+{
+    DGRAM_URXE *urxe, *urxe_next;
+
+    if (rx == NULL)
+        return;
+
+    for (urxe = ossl_list_urxe_head(&rx->urxe_pending); urxe != NULL;
+        urxe = urxe_next) {
+        urxe_next = ossl_list_urxe_next(urxe);
+        ossl_list_urxe_remove(&rx->urxe_pending, urxe);
+        ossl_dgram_demux_release_urxe(rx->demux, urxe);
+    }
+
+    /*
+     * The demuxer is not freed, as it is owned by the DTLS listener.
+     */
+    rx->demux = NULL;
+
+    ossl_crypto_mutex_free(&rx->mutex);
+    OPENSSL_free(rx);
+}
+
+/*
+ * Injects a received URXE into the DTLS_RX struct.
+ *
+ * On overflow the oldest queued datagram is evicted: a flight can span
+ * several datagrams, so keeping the newest biases the queue toward the
+ * flight the peer just sent. The evicted URXE is released only after
+ * rx->mutex is dropped, as release takes demux->mutex, which must not
+ * nest under rx->mutex.
+ */
+void ossl_dtls_rx_inject_urxe(DTLS_RX *rx, DGRAM_URXE *e)
+{
+    DGRAM_URXE *oldest = NULL;
+
+    ossl_crypto_mutex_lock(rx->mutex);
+    if (ossl_list_urxe_num(&rx->urxe_pending) >= OSSL_DTLS_RX_DEFAULT_MAX_QUEUED)
+        oldest = ossl_list_urxe_head(&rx->urxe_pending);
+    if (oldest != NULL)
+        ossl_list_urxe_remove(&rx->urxe_pending, oldest);
+    ossl_list_urxe_insert_tail(&rx->urxe_pending, e);
+    ossl_crypto_mutex_unlock(rx->mutex);
+
+    if (oldest != NULL)
+        ossl_dtls_rx_release_urxe(rx, oldest);
+}
+
+/*
+ * Release the URXE from the DTLS_RX struct.
+ */
+void ossl_dtls_rx_release_urxe(DTLS_RX *rx, DGRAM_URXE *e)
+{
+    ossl_dgram_demux_release_urxe(rx->demux, e);
+}
+
+/*
+ * Reads a datagram from the DTLS_RX struct.
+ */
+DGRAM_URXE *ossl_dtls_read_datagram(DTLS_RX *rx)
+{
+    DGRAM_URXE *e;
+
+    ossl_crypto_mutex_lock(rx->mutex);
+
+    if (ossl_list_urxe_is_empty(&rx->urxe_pending)) {
+        ossl_crypto_mutex_unlock(rx->mutex);
+        return NULL;
+    }
+
+    e = ossl_list_urxe_head(&rx->urxe_pending);
+    ossl_list_urxe_remove(&rx->urxe_pending, e);
+    e->demux_state = URXE_DEMUX_STATE_ISSUED;
+
+    ossl_crypto_mutex_unlock(rx->mutex);
+    return e;
+}
+
+#endif /* OPENSSL_NO_DTLS */
diff --git a/deps/openssl/openssl/ssl/ech/build.info b/deps/openssl/openssl/ssl/ech/build.info
new file mode 100644
index 00000000000..7f60fb957c5
--- /dev/null
+++ b/deps/openssl/openssl/ssl/ech/build.info
@@ -0,0 +1,3 @@
+$LIBSSL=../../libssl
+
+SOURCE[$LIBSSL]=ech_ssl_apis.c ech_store.c ech_internal.c ech_helper.c
diff --git a/deps/openssl/openssl/ssl/ech/ech_helper.c b/deps/openssl/openssl/ssl/ech/ech_helper.c
new file mode 100644
index 00000000000..e8bbe0a0e9a
--- /dev/null
+++ b/deps/openssl/openssl/ssl/ech/ech_helper.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/ssl.h>
+#include <openssl/ech.h>
+#include "../ssl_local.h"
+#include "ech_local.h"
+#include "internal/ech_helpers.h"
+
+/* used in ECH crypto derivations (odd format for EBCDIC goodness) */
+/* "tls ech" */
+static const char OSSL_ECH_CONTEXT_STRING[] = "\x74\x6c\x73\x20\x65\x63\x68";
+
+/*
+ * Construct HPKE "info" input as per spec
+ * encoding is the ECHconfig being used
+ * encoding_length is the length of ECHconfig being used
+ * info is a caller-allocated buffer for results
+ * info_len is the buffer size on input, used-length on output
+ * return 1 for success, zero otherwise
+ */
+int ossl_ech_make_enc_info(const unsigned char *encoding,
+    size_t encoding_length,
+    unsigned char *info, size_t *info_len)
+{
+    WPACKET ipkt = { 0 };
+
+    if (encoding == NULL || info == NULL || info_len == NULL)
+        return 0;
+    if (!WPACKET_init_static_len(&ipkt, info, *info_len, 0)
+        || !WPACKET_memcpy(&ipkt, OSSL_ECH_CONTEXT_STRING,
+            sizeof(OSSL_ECH_CONTEXT_STRING) - 1)
+        /*
+         * the zero valued octet is required by the spec, section 7.1 so
+         * a tiny bit better to add it explicitly rather than depend on
+         * the context string being NUL terminated
+         */
+        || !WPACKET_put_bytes_u8(&ipkt, 0)
+        || !WPACKET_memcpy(&ipkt, encoding, encoding_length)
+        || !WPACKET_get_total_written(&ipkt, info_len)) {
+        WPACKET_cleanup(&ipkt);
+        return 0;
+    }
+    WPACKET_cleanup(&ipkt);
+    return 1;
+}
+
+/*
+ * Given a CH find the offsets of the session id, extensions and ECH
+ * ch is the encoded client hello
+ * ch_len is the length of ch
+ * sessid_off returns offset of session_id length
+ * exts_off points to offset of extensions
+ * exts_len returns length of extensions
+ * ech_off returns offset of ECH
+ * echtype returns the ext type of the ECH
+ * ech_len returns the length of the ECH
+ * sni_off returns offset of (outer) SNI
+ * sni_len returns the length of the SNI
+ * inner 1 if the ECH is marked as an inner, 0 for outer
+ * return 1 for success, other otherwise
+ *
+ * Offsets are set to zero if relevant thing not found.
+ * Offsets are returned to the type or length field in question.
+ *
+ * Note: input here is untrusted!
+ */
+int ossl_ech_helper_get_ch_offsets(const unsigned char *ch, size_t ch_len,
+    size_t *sessid_off, size_t *exts_off,
+    size_t *exts_len,
+    size_t *ech_off, uint16_t *echtype,
+    size_t *ech_len, size_t *sni_off,
+    size_t *sni_len, int *inner)
+{
+    unsigned int elen = 0, etype = 0, pi_tmp = 0;
+    const unsigned char *pp_tmp = NULL, *chstart = NULL, *estart = NULL;
+    PACKET pkt;
+    int done = 0;
+
+    if (ch == NULL || ch_len == 0 || sessid_off == NULL || exts_off == NULL
+        || ech_off == NULL || echtype == NULL || ech_len == NULL
+        || sni_off == NULL || inner == NULL || exts_len == NULL)
+        return 0;
+    *sessid_off = *exts_off = *ech_off = *sni_off = *sni_len = *ech_len = 0;
+    *exts_len = 0;
+    *inner = OSSL_ECH_UNKNOWN_CH_TYPE;
+    *echtype = 0xffff;
+    if (!PACKET_buf_init(&pkt, ch, ch_len))
+        return 0;
+    chstart = PACKET_data(&pkt);
+    if (!PACKET_get_net_2(&pkt, &pi_tmp))
+        return 0;
+    /* if we're not TLSv1.2+ then we can bail, but it's not an error */
+    if (pi_tmp != TLS1_2_VERSION)
+        return 1;
+    /* chew up the packet to extensions */
+    if (!PACKET_get_bytes(&pkt, &pp_tmp, SSL3_RANDOM_SIZE)
+        || (*sessid_off = PACKET_data(&pkt) - chstart) == 0
+        || !PACKET_get_1(&pkt, &pi_tmp) /* sessid len */
+        || !PACKET_get_bytes(&pkt, &pp_tmp, pi_tmp) /* sessid */
+        || !PACKET_get_net_2(&pkt, &pi_tmp) /* ciphersuite len */
+        || !PACKET_get_bytes(&pkt, &pp_tmp, pi_tmp) /* suites */
+        || !PACKET_get_1(&pkt, &pi_tmp) /* compression meths */
+        || !PACKET_get_bytes(&pkt, &pp_tmp, pi_tmp) /* comp meths */
+        || (*exts_off = PACKET_data(&pkt) - chstart) == 0
+        || !PACKET_get_net_2(&pkt, &pi_tmp) /* len(extensions) */
+        || (*exts_len = (size_t)pi_tmp) == 0)
+        /*
+         * unexpectedly, we return 1 here, as doing otherwise will
+         * break some non-ECH test code that truncates CH messages
+         * The same is true below when looking through extensions.
+         * That's ok though, we'll only set those offsets we've
+         * found.
+         */
+        return 1;
+    /* no extensions is theoretically ok, if uninteresting */
+    if (*exts_len == 0)
+        return 1;
+    /* find what we want from extensions */
+    estart = PACKET_data(&pkt);
+    while (PACKET_remaining(&pkt) > 0
+        && (size_t)(PACKET_data(&pkt) - estart) < *exts_len
+        && done < 2) {
+        if (!PACKET_get_net_2(&pkt, &etype)
+            || !PACKET_get_net_2(&pkt, &elen))
+            return 1; /* see note above */
+        if (etype == TLSEXT_TYPE_ech) {
+            if (elen == 0)
+                return 0;
+            *ech_off = PACKET_data(&pkt) - chstart - 4;
+            *echtype = etype;
+            *ech_len = elen;
+            done++;
+        }
+        if (etype == TLSEXT_TYPE_server_name) {
+            *sni_off = PACKET_data(&pkt) - chstart - 4;
+            *sni_len = elen;
+            done++;
+        }
+        if (!PACKET_get_bytes(&pkt, &pp_tmp, elen))
+            return 1; /* see note above */
+        if (etype == TLSEXT_TYPE_ech)
+            *inner = pp_tmp[0];
+    }
+    return 1;
+}
diff --git a/deps/openssl/openssl/ssl/ech/ech_internal.c b/deps/openssl/openssl/ssl/ech/ech_internal.c
new file mode 100644
index 00000000000..1ae52f3bd0b
--- /dev/null
+++ b/deps/openssl/openssl/ssl/ech/ech_internal.c
@@ -0,0 +1,2257 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/ssl.h>
+#include <openssl/ech.h>
+#include <openssl/rand.h>
+#include <openssl/kdf.h>
+#include "internal/ech_helpers.h"
+#include "internal/ssl_unwrap.h"
+#include "../ssl_local.h"
+#include "../statem/statem_local.h"
+#include "ech_local.h"
+
+#ifndef OPENSSL_NO_ECH
+
+/*
+ * Strings used in ECH crypto derivations (odd format for EBCDIC goodness)
+ */
+/* "ech accept confirmation" */
+static const char OSSL_ECH_ACCEPT_CONFIRM_STRING[] = "\x65\x63\x68\x20\x61\x63\x63\x65\x70\x74\x20\x63\x6f\x6e\x66\x69\x72\x6d\x61\x74\x69\x6f\x6e";
+/* "hrr ech accept confirmation" */
+static const char OSSL_ECH_HRR_CONFIRM_STRING[] = "\x68\x72\x72\x20\x65\x63\x68\x20\x61\x63\x63\x65\x70\x74\x20\x63\x6f\x6e\x66\x69\x72\x6d\x61\x74\x69\x6f\x6e";
+
+/* ECH internal API functions */
+
+#ifdef OSSL_ECH_SUPERVERBOSE
+/* ascii-hex print a buffer nicely for debug/interop purposes */
+void ossl_ech_pbuf(const char *msg, const unsigned char *buf, const size_t blen)
+{
+    OSSL_TRACE_BEGIN(TLS)
+    {
+        if (msg == NULL) {
+            BIO_printf(trc_out, "msg is NULL\n");
+        } else if (buf == NULL || blen == 0) {
+            BIO_printf(trc_out, "%s: buf is %p\n", msg, (void *)buf);
+            BIO_printf(trc_out, "%s: blen is %zu\n", msg, blen);
+        } else {
+            BIO_printf(trc_out, "%s (%zu)\n", msg, blen);
+            BIO_dump_indent(trc_out, buf, (int)blen, 4);
+        }
+    }
+    OSSL_TRACE_END(TLS);
+    return;
+}
+
+/* trace out transcript */
+static void ossl_ech_ptranscript(SSL_CONNECTION *s, const char *msg)
+{
+    size_t hdatalen = 0;
+    unsigned char *hdata = NULL;
+    unsigned char ddata[EVP_MAX_MD_SIZE];
+    size_t ddatalen;
+
+    if (s == NULL)
+        return;
+    hdatalen = BIO_get_mem_data(s->s3.handshake_buffer, &hdata);
+    ossl_ech_pbuf(msg, hdata, hdatalen);
+    if (s->s3.handshake_dgst != NULL) {
+        if (ssl_handshake_hash(s, ddata, sizeof(ddata), &ddatalen) == 0) {
+            OSSL_TRACE(TLS, "ssl_handshake_hash failed\n");
+            ossl_ech_pbuf(msg, ddata, ddatalen);
+        }
+    }
+    OSSL_TRACE(TLS, "new transbuf:\n");
+    ossl_ech_pbuf(msg, s->ext.ech.transbuf, s->ext.ech.transbuf_len);
+    return;
+}
+#endif
+
+static OSSL_ECHSTORE_ENTRY *ossl_echstore_entry_dup(const OSSL_ECHSTORE_ENTRY *orig)
+{
+    OSSL_ECHSTORE_ENTRY *ret = NULL;
+
+    if (orig == NULL)
+        return NULL;
+    ret = OPENSSL_zalloc(sizeof(*ret));
+    if (ret == NULL)
+        return NULL;
+    ret->version = orig->version;
+    if (orig->public_name != NULL) {
+        ret->public_name = OPENSSL_strdup(orig->public_name);
+        if (ret->public_name == NULL)
+            goto err;
+    }
+    ret->pub_len = orig->pub_len;
+    if (orig->pub != NULL) {
+        ret->pub = OPENSSL_memdup(orig->pub, orig->pub_len);
+        if (ret->pub == NULL)
+            goto err;
+    }
+    ret->nsuites = orig->nsuites;
+    ret->suites = OPENSSL_memdup(orig->suites, sizeof(OSSL_HPKE_SUITE) * ret->nsuites);
+    if (ret->suites == NULL)
+        goto err;
+    ret->max_name_length = orig->max_name_length;
+    ret->config_id = orig->config_id;
+    if (orig->exts != NULL) {
+        ret->exts = sk_OSSL_ECHEXT_deep_copy(orig->exts, ossl_echext_dup,
+            ossl_echext_free);
+        if (ret->exts == NULL)
+            goto err;
+    }
+    ret->loadtime = orig->loadtime;
+    if (orig->keyshare != NULL) {
+        if (!EVP_PKEY_up_ref(orig->keyshare))
+            goto err;
+        ret->keyshare = orig->keyshare;
+    }
+    ret->for_retry = orig->for_retry;
+    if (orig->encoded != NULL) {
+        ret->encoded_len = orig->encoded_len;
+        ret->encoded = OPENSSL_memdup(orig->encoded, ret->encoded_len);
+        if (ret->encoded == NULL)
+            goto err;
+    }
+    return ret;
+err:
+    ossl_echstore_entry_free(ret);
+    return NULL;
+}
+
+/* duplicate an OSSL_ECHSTORE as needed */
+OSSL_ECHSTORE *ossl_echstore_dup(const OSSL_ECHSTORE *old)
+{
+    OSSL_ECHSTORE *cp = NULL;
+
+    if (old == NULL)
+        return NULL;
+    cp = OPENSSL_zalloc(sizeof(*cp));
+    if (cp == NULL)
+        return NULL;
+    cp->libctx = old->libctx;
+    if (old->propq != NULL) {
+        cp->propq = OPENSSL_strdup(old->propq);
+        if (cp->propq == NULL)
+            goto err;
+    }
+    if (old->entries != NULL) {
+        cp->entries = sk_OSSL_ECHSTORE_ENTRY_deep_copy(old->entries,
+            ossl_echstore_entry_dup,
+            ossl_echstore_entry_free);
+        if (cp->entries == NULL)
+            goto err;
+    }
+    return cp;
+err:
+    OSSL_ECHSTORE_free(cp);
+    return NULL;
+}
+
+void ossl_ech_ctx_clear(OSSL_ECH_CTX *ce)
+{
+    if (ce == NULL)
+        return;
+    OSSL_ECHSTORE_free(ce->es);
+    OPENSSL_free(ce->alpn_outer);
+    return;
+}
+
+static void ech_free_stashed_key_shares(OSSL_ECH_CONN *ec)
+{
+    size_t i;
+
+    if (ec == NULL)
+        return;
+    for (i = 0; i != ec->num_ks_pkey; i++) {
+        EVP_PKEY_free(ec->ks_pkey[i]);
+        ec->ks_pkey[i] = NULL;
+    }
+    ec->num_ks_pkey = 0;
+    return;
+}
+
+void ossl_ech_conn_clear(OSSL_ECH_CONN *ec)
+{
+    if (ec == NULL)
+        return;
+    OSSL_ECHSTORE_free(ec->es);
+    OPENSSL_free(ec->outer_hostname);
+    OPENSSL_free(ec->alpn_outer);
+    OPENSSL_free(ec->former_inner);
+    OPENSSL_free(ec->transbuf);
+    OPENSSL_free(ec->innerch);
+    OPENSSL_free(ec->grease_suite);
+    OPENSSL_free(ec->sent);
+    OPENSSL_free(ec->returned);
+    OPENSSL_free(ec->pub);
+    OSSL_HPKE_CTX_free(ec->hpke_ctx);
+    OPENSSL_free(ec->encoded_inner);
+    ech_free_stashed_key_shares(ec);
+    return;
+}
+
+/* called from ssl/ssl_lib.c: ossl_ssl_connection_new_int */
+int ossl_ech_conn_init(SSL_CONNECTION *s, SSL_CTX *ctx,
+    const SSL_METHOD *method)
+{
+    memset(&s->ext.ech, 0, sizeof(s->ext.ech));
+    if (ctx->ext.ech.es != NULL
+        && (s->ext.ech.es = ossl_echstore_dup(ctx->ext.ech.es)) == NULL)
+        goto err;
+    s->ext.ech.cb = ctx->ext.ech.cb;
+    if (ctx->ext.ech.alpn_outer != NULL) {
+        s->ext.ech.alpn_outer = OPENSSL_memdup(ctx->ext.ech.alpn_outer,
+            ctx->ext.ech.alpn_outer_len);
+        if (s->ext.ech.alpn_outer == NULL)
+            goto err;
+        s->ext.ech.alpn_outer_len = ctx->ext.ech.alpn_outer_len;
+    }
+    /* initialise type/cid to unknown */
+    s->ext.ech.attempted_type = OSSL_ECH_type_unknown;
+    s->ext.ech.attempted_cid = OSSL_ECH_config_id_unset;
+    if (s->ext.ech.es != NULL)
+        s->ext.ech.attempted = 1;
+    if ((ctx->options & SSL_OP_ECH_GREASE) != 0)
+        s->options |= SSL_OP_ECH_GREASE;
+    return 1;
+err:
+    OSSL_ECHSTORE_free(s->ext.ech.es);
+    s->ext.ech.es = NULL;
+    OPENSSL_free(s->ext.ech.alpn_outer);
+    s->ext.ech.alpn_outer = NULL;
+    s->ext.ech.alpn_outer_len = 0;
+    return 0;
+}
+
+/*
+ * Assemble the set of ECHConfig values to return as retry-configs.
+ * The caller (stoc ECH extension handler) needs to OPENSSL_free the rcfgs
+ * The rcfgs itself is missing the outer length to make it an ECHConfigList
+ * so the caller adds that using WPACKET functions
+ */
+int ossl_ech_get_retry_configs(SSL_CONNECTION *s, unsigned char **rcfgs,
+    size_t *rcfgslen)
+{
+    OSSL_ECHSTORE *es = NULL;
+    OSSL_ECHSTORE_ENTRY *ee = NULL;
+    int i, num = 0;
+    size_t retslen = 0;
+    unsigned char *tmp = NULL, *rets = NULL;
+
+    if (s == NULL || rcfgs == NULL || rcfgslen == NULL)
+        return 0;
+    es = s->ext.ech.es;
+    if (es != NULL && es->entries != NULL)
+        num = sk_OSSL_ECHSTORE_ENTRY_num(es->entries);
+    for (i = 0; i != num; i++) {
+        ee = sk_OSSL_ECHSTORE_ENTRY_value(es->entries, i);
+        if (ee != NULL && ee->for_retry == OSSL_ECH_FOR_RETRY) {
+            if (ee->encoded_len > SIZE_MAX - retslen)
+                goto err;
+            tmp = (unsigned char *)OPENSSL_realloc(rets,
+                retslen + ee->encoded_len);
+            if (tmp == NULL)
+                goto err;
+            rets = tmp;
+            memcpy(rets + retslen, ee->encoded, ee->encoded_len);
+            retslen += ee->encoded_len;
+        }
+    }
+    *rcfgs = rets;
+    *rcfgslen = retslen;
+    return 1;
+err:
+    OPENSSL_free(rets);
+    *rcfgs = NULL;
+    *rcfgslen = 0;
+    return 0;
+}
+
+/* GREASEy constants */
+#define OSSL_ECH_MAX_GREASE_PUB 0x100 /* buffer size for 'enc' values */
+#define OSSL_ECH_MAX_GREASE_CT 0x200 /* max GREASEy ciphertext we'll emit */
+
+/*
+ * Send a random value that looks like a real ECH.
+ *
+ * We do GREASEing as follows:
+ *   - always HKDF-SHA256
+ *   - always AES-128-GCM
+ *   - random config ID, even for requests to same server in same session
+ *   - random enc
+ *   - random looking payload, randomly 144, 176, 208, 240 bytes, no correlation with server
+ */
+int ossl_ech_send_grease(SSL_CONNECTION *s, WPACKET *pkt)
+{
+    OSSL_HPKE_SUITE hpke_suite_in = OSSL_HPKE_SUITE_DEFAULT;
+    OSSL_HPKE_SUITE *hpke_suite_in_p = NULL;
+    OSSL_HPKE_SUITE hpke_suite = OSSL_HPKE_SUITE_DEFAULT;
+    size_t pp_at_start = 0, pp_at_end = 0;
+    size_t senderpub_len = OSSL_ECH_MAX_GREASE_PUB;
+    size_t cipher_len = 0, cipher_len_jitter = 0;
+    unsigned char cid, senderpub[OSSL_ECH_MAX_GREASE_PUB];
+    unsigned char cipher[OSSL_ECH_MAX_GREASE_CT];
+    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+
+    if (!WPACKET_get_total_written(pkt, &pp_at_start)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    /* randomly select cipher_len to be one of 144, 176, 208, 244 */
+    if (RAND_bytes_ex(sctx->libctx, &cid, 1, 0) <= 0) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    cipher_len_jitter = cid % 4;
+    cipher_len = 144;
+    cipher_len += 32 * cipher_len_jitter;
+    /* generate a random (1 octet) client id */
+    if (RAND_bytes_ex(sctx->libctx, &cid, 1, 0) <= 0) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    s->ext.ech.attempted_cid = cid;
+    hpke_suite_in_p = &hpke_suite;
+    if (s->ext.ech.grease_suite != NULL) {
+        if (OSSL_HPKE_str2suite(s->ext.ech.grease_suite, &hpke_suite_in) != 1) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+        hpke_suite_in_p = &hpke_suite_in;
+    }
+    if (OSSL_HPKE_get_grease_value(hpke_suite_in_p, &hpke_suite,
+            senderpub, &senderpub_len,
+            cipher, cipher_len,
+            sctx->libctx, sctx->propq)
+        != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    if (!WPACKET_put_bytes_u16(pkt, s->ext.ech.attempted_type)
+        || !WPACKET_start_sub_packet_u16(pkt)
+        || !WPACKET_put_bytes_u8(pkt, OSSL_ECH_OUTER_CH_TYPE)
+        || !WPACKET_put_bytes_u16(pkt, hpke_suite.kdf_id)
+        || !WPACKET_put_bytes_u16(pkt, hpke_suite.aead_id)
+        || !WPACKET_put_bytes_u8(pkt, cid)
+        || !WPACKET_sub_memcpy_u16(pkt, senderpub, senderpub_len)
+        || !WPACKET_sub_memcpy_u16(pkt, cipher, cipher_len)
+        || !WPACKET_close(pkt)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    /* record the ECH sent so we can re-tx same if we hit an HRR */
+    OPENSSL_free(s->ext.ech.sent);
+    if (!WPACKET_get_total_written(pkt, &pp_at_end)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    s->ext.ech.sent_len = pp_at_end - pp_at_start;
+    s->ext.ech.sent = OPENSSL_malloc(s->ext.ech.sent_len);
+    if (s->ext.ech.sent == NULL) {
+        s->ext.ech.sent_len = 0;
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    memcpy(s->ext.ech.sent, WPACKET_get_curr(pkt) - s->ext.ech.sent_len,
+        s->ext.ech.sent_len);
+    s->ext.ech.grease = OSSL_ECH_IS_GREASE;
+    OSSL_TRACE_BEGIN(TLS)
+    {
+        BIO_printf(trc_out, "ECH - sending GREASE\n");
+    }
+    OSSL_TRACE_END(TLS);
+    return 1;
+}
+
+/*
+ * Search the ECH store for one that's a match. If no outer_name was set via
+ * API then we just take the 1st match where we locally support the HPKE suite.
+ * If OTOH, an outer_name was provided via API then we prefer the first that
+ * matches that. Name comparison is via case-insensitive exact matches.
+ */
+int ossl_ech_pick_matching_cfg(SSL_CONNECTION *s, OSSL_ECHSTORE_ENTRY **ee,
+    OSSL_HPKE_SUITE *suite)
+{
+    int namematch = 0, nameoverride = 0, suitematch = 0, num, cind = 0;
+    unsigned int csuite = 0, tsuite = 0;
+    size_t hnlen = 0;
+    OSSL_ECHSTORE_ENTRY *lee = NULL, *tee = NULL;
+    OSSL_ECHSTORE *es = NULL;
+    char *hn = NULL;
+
+    if (s == NULL || s->ext.ech.es == NULL || ee == NULL || suite == NULL)
+        return 0;
+    *ee = NULL;
+    es = s->ext.ech.es;
+    if (es->entries == NULL)
+        return 0;
+    num = sk_OSSL_ECHSTORE_ENTRY_num(es->entries);
+    /* allow API-set pref to override */
+    hn = s->ext.ech.outer_hostname;
+    hnlen = (hn == NULL ? 0 : (unsigned int)strlen(hn));
+    if (hnlen != 0)
+        nameoverride = 1;
+    if (s->ext.ech.no_outer == 1) {
+        hn = NULL;
+        hnlen = 0;
+        nameoverride = 1;
+    }
+    for (cind = 0; cind < num && (suitematch == 0 || namematch == 0); cind++) {
+        lee = sk_OSSL_ECHSTORE_ENTRY_value(es->entries, cind);
+        if (lee == NULL || lee->version != OSSL_ECH_RFC9849_VERSION)
+            continue;
+        if (nameoverride == 1 && hnlen == 0) {
+            namematch = 1;
+        } else {
+            namematch = 0;
+            if (hnlen == 0
+                || (lee->public_name != NULL
+                    && strlen(lee->public_name) == hnlen
+                    && OPENSSL_strncasecmp(hn, (char *)lee->public_name,
+                           hnlen)
+                        == 0))
+                namematch = 1;
+        }
+        suitematch = 0;
+        for (csuite = 0; csuite != lee->nsuites && suitematch == 0; csuite++) {
+            if (OSSL_HPKE_suite_check(lee->suites[csuite]) == 1) {
+                if (tee == NULL) { /* remember 1st suite match for override */
+                    tee = lee;
+                    tsuite = csuite;
+                }
+                suitematch = 1;
+                if (namematch == 1) { /* pick this one if both "fit" */
+                    *suite = lee->suites[csuite];
+                    *ee = lee;
+                    break;
+                }
+            }
+        }
+    }
+    if (tee != NULL && nameoverride == 1
+        && (namematch == 0 || suitematch == 0)) {
+        *suite = tee->suites[tsuite];
+        *ee = tee;
+    } else if (namematch == 0 || suitematch == 0) {
+        /* no joy */
+        return 0;
+    }
+    if (*ee == NULL || (*ee)->pub_len == 0 || (*ee)->pub == NULL)
+        return 0;
+    return 1;
+}
+
+/* Make up the ClientHelloInner and EncodedClientHelloInner buffers */
+int ossl_ech_encode_inner(SSL_CONNECTION *s, unsigned char **encoded,
+    size_t *encoded_len)
+{
+    int rv = 0;
+    size_t nraws = 0, ind = 0, innerlen = 0;
+    WPACKET inner = { 0 }; /* "fake" pkt for inner */
+    BUF_MEM *inner_mem = NULL;
+    RAW_EXTENSION *raws = NULL;
+
+    /* basic checks */
+    if (s == NULL)
+        return 0;
+    if (s->ext.ech.es == NULL || s->clienthello == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    if ((inner_mem = BUF_MEM_new()) == NULL
+        || !WPACKET_init(&inner, inner_mem)
+        /* We don't add the type and 3-octet header as usually done */
+        /* Add ver/rnd/sess-id/suites to buffer */
+        || !WPACKET_put_bytes_u16(&inner, s->client_version)
+        || !WPACKET_memcpy(&inner, s->ext.ech.client_random, SSL3_RANDOM_SIZE)
+        /* Session ID is forced to zero in the encoded inner */
+        || !WPACKET_sub_memcpy_u8(&inner, NULL, 0)
+        /* Ciphers supported */
+        || !WPACKET_start_sub_packet_u16(&inner)
+        || !ssl_cipher_list_to_bytes(s, SSL_get_ciphers(&s->ssl), &inner)
+        || !WPACKET_close(&inner)
+        /* COMPRESSION */
+        || !WPACKET_start_sub_packet_u8(&inner)
+        /* Add the NULL compression method */
+        || !WPACKET_put_bytes_u8(&inner, 0)
+        || !WPACKET_close(&inner)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /* Now handle extensions */
+    if (!WPACKET_start_sub_packet_u16(&inner)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /* Grab a pointer to the already constructed extensions */
+    raws = s->clienthello->pre_proc_exts;
+    nraws = s->clienthello->pre_proc_exts_len;
+    if (raws == NULL || nraws < TLSEXT_IDX_num_builtins) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /*  We put ECH-compressed stuff first (if any), because we can */
+    if (s->ext.ech.n_outer_only > 0) {
+        if (!WPACKET_put_bytes_u16(&inner, TLSEXT_TYPE_outer_extensions)
+            || !WPACKET_start_sub_packet_u16(&inner)
+            /* redundant encoding of more-or-less the same thing */
+            || !WPACKET_start_sub_packet_u8(&inner)) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        /* add the types for each of the compressed extensions now */
+        for (ind = 0; ind != s->ext.ech.n_outer_only; ind++) {
+            if (!WPACKET_put_bytes_u16(&inner, s->ext.ech.outer_only[ind])) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+        }
+        /* close the 2 sub-packets with the compressed types */
+        if (!WPACKET_close(&inner) || !WPACKET_close(&inner)) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+    }
+    /* now copy the rest, as "proper" exts, into encoded inner */
+    for (ind = 0; ind < TLSEXT_IDX_num_builtins; ind++) {
+        if (raws[ind].present == 0 || ossl_ech_2bcompressed((int)ind) == 1)
+            continue;
+        if (!WPACKET_put_bytes_u16(&inner, raws[ind].type)
+            || !WPACKET_sub_memcpy_u16(&inner, PACKET_data(&raws[ind].data),
+                PACKET_remaining(&raws[ind].data))) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+    }
+    if (!WPACKET_close(&inner) /* close the encoded inner packet */
+        || !WPACKET_get_length(&inner, &innerlen)) { /* len for inner CH */
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    *encoded = (unsigned char *)inner_mem->data;
+    inner_mem->data = NULL; /* keep BUF_MEM_free happy */
+    *encoded_len = innerlen;
+    /* and clean up */
+    rv = 1;
+err:
+    WPACKET_cleanup(&inner);
+    BUF_MEM_free(inner_mem);
+    return rv;
+}
+
+/*
+ * Find ECH acceptance signal in a SH
+ * hrr is 1 if this is for an HRR, otherwise for SH
+ * acbuf is (a preallocated) 8 octet buffer
+ * shbuf is a pointer to the SH buffer
+ * shlen is the length of the SH buf
+ * return: 1 for success, 0 otherwise
+ */
+int ossl_ech_find_confirm(SSL_CONNECTION *s, int hrr,
+    unsigned char acbuf[OSSL_ECH_SIGNAL_LEN])
+{
+    unsigned char *acp = NULL;
+
+    if (hrr == 0) {
+        acp = s->s3.server_random + SSL3_RANDOM_SIZE - OSSL_ECH_SIGNAL_LEN;
+    } else { /* was set in extension handler */
+        if (s->ext.ech.hrrsignal_p == NULL)
+            return 0;
+        acp = s->ext.ech.hrrsignal;
+    }
+    memcpy(acbuf, acp, OSSL_ECH_SIGNAL_LEN);
+    return 1;
+}
+
+/*
+ * reset the handshake buffer for transcript after ECH is good
+ * buf is the data to put into the transcript (inner CH if no HRR)
+ * blen is the length of buf
+ * return 1 for success
+ */
+int ossl_ech_reset_hs_buffer(SSL_CONNECTION *s, const unsigned char *buf,
+    size_t blen)
+{
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("RESET transcript to", buf, blen);
+#endif
+    if (s->s3.handshake_buffer != NULL) {
+        if (BIO_reset(s->s3.handshake_buffer) < 0)
+            return 0;
+    } else {
+        s->s3.handshake_buffer = BIO_new(BIO_s_mem());
+        if (s->s3.handshake_buffer == NULL)
+            return 0;
+        (void)BIO_set_close(s->s3.handshake_buffer, BIO_CLOSE);
+    }
+    EVP_MD_CTX_free(s->s3.handshake_dgst);
+    s->s3.handshake_dgst = NULL;
+    /* providing nothing at all is a real use (mid-HRR) */
+    if (buf != NULL && blen > 0)
+        BIO_write(s->s3.handshake_buffer, (void *)buf, (int)blen);
+    return 1;
+}
+
+/*
+ * To control the number of zeros added after an EncodedClientHello - we pad
+ * to a target number of octets or, if there are naturally more, to a number
+ * divisible by the defined increment (we also do the spec-recommended SNI
+ * padding thing first)
+ */
+#define OSSL_ECH_PADDING_TARGET 128 /* ECH cleartext padded to at least this */
+#define OSSL_ECH_PADDING_INCREMENT 32 /* ECH padded to a multiple of this */
+
+/*
+ * figure out how much padding for cleartext (on client)
+ * ee is the chosen ECHConfig
+ * return overall length to use including padding or zero on error
+ *
+ * "Recommended" inner SNI padding scheme as per spec (section 6.1.3)
+ * Might remove the mnl stuff later - overall message padding seems
+ * better really, BUT... we might want to keep this if others (e.g.
+ * browsers) do it so as to not stand out compared to them.
+ *
+ * The "+ 9" constant below is from the specification and is the
+ * expansion comparing a string length to an encoded SNI extension.
+ * Same is true of the 31/32 formula below.
+ *
+ * Note that the AEAD tag will be added later, so if we e.g. have
+ * a padded cleartext of 128 octets, the ciphertext will be 144
+ * octets.
+ */
+size_t ossl_ech_calc_padding(SSL_CONNECTION *s, OSSL_ECHSTORE_ENTRY *ee,
+    size_t encoded_len)
+{
+    size_t length_of_padding = 0, length_with_snipadding = 0;
+    size_t innersnipadding = 0, length_with_padding = 0;
+    size_t mnl = 0, isnilen = 0;
+
+    if (s == NULL || ee == NULL)
+        return 0;
+    mnl = ee->max_name_length;
+    if (mnl != 0) {
+        /* do weirder padding if SNI present in inner */
+        if (s->ext.hostname != NULL) {
+            isnilen = strlen(s->ext.hostname) + 9;
+            innersnipadding = (mnl > isnilen) ? (int)(mnl - isnilen) : 0;
+        } else {
+            innersnipadding = (int)mnl + 9;
+        }
+    }
+    /* padding is after the inner client hello has been encoded */
+    length_with_snipadding = innersnipadding + (int)encoded_len;
+    length_of_padding = 31 - ((length_with_snipadding - 1) % 32);
+    length_with_padding = (int)encoded_len + length_of_padding
+        + innersnipadding;
+    /*
+     * Finally - make sure final result is longer than padding target
+     * and a multiple of our padding increment.
+     * This is a local addition - we might want to take it out if it makes
+     * us stick out; or if we take out the above more (uselessly:-)
+     * complicated scheme above, we may only need this in the end.
+     */
+    if ((length_with_padding % OSSL_ECH_PADDING_INCREMENT) != 0)
+        length_with_padding += OSSL_ECH_PADDING_INCREMENT
+            - (length_with_padding % OSSL_ECH_PADDING_INCREMENT);
+    while (length_with_padding < OSSL_ECH_PADDING_TARGET)
+        length_with_padding += OSSL_ECH_PADDING_INCREMENT;
+    OSSL_TRACE_BEGIN(TLS)
+    {
+        BIO_printf(trc_out, "EAAE: padding: mnl: %zu, lws: %zu "
+                            "lop: %zu, clear_len (len with padding): %zu, orig: %zu\n",
+            mnl, length_with_snipadding, length_of_padding,
+            length_with_padding, encoded_len);
+    }
+    OSSL_TRACE_END(TLS);
+    return length_with_padding;
+}
+
+/*
+ * Calculate AAD and do ECH encryption
+ * pkt is the packet to send
+ * return 1 for success, other otherwise
+ *
+ * 1. Make up the AAD: the encoded outer, with ECH ciphertext octets zero'd
+ * 2. Do the encryption
+ * 3. Put the ECH back into the encoding
+ * 4. Encode the outer (again!)
+ */
+int ossl_ech_aad_and_encrypt(SSL_CONNECTION *s, WPACKET *pkt)
+{
+    int rv = 0;
+    size_t cipherlen = 0, aad_len = 0, mypub_len = 0, clear_len = 0;
+    size_t encoded_inner_len = 0;
+    unsigned char *clear = NULL, *aad = NULL, *mypub = NULL;
+    unsigned char *encoded_inner = NULL, *cipher_loc = NULL;
+
+    if (s == NULL)
+        return 0;
+    if (s->ext.ech.es == NULL || s->ext.ech.es->entries == NULL
+        || pkt == NULL || s->ssl.ctx == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /* values calculated in tls_construct_ctos_ech */
+    encoded_inner = s->ext.ech.encoded_inner;
+    encoded_inner_len = s->ext.ech.encoded_inner_len;
+    clear_len = s->ext.ech.clearlen;
+    cipherlen = s->ext.ech.cipherlen;
+    if (!WPACKET_get_total_written(pkt, &aad_len) || aad_len < 4) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    aad_len -= 4; /* ECH/HPKE aad starts after type + 3-octet len */
+    aad = WPACKET_get_curr(pkt) - aad_len;
+    /* where we'll replace zeros with ciphertext */
+    cipher_loc = aad + s->ext.ech.cipher_offset;
+    /*
+     * close the extensions of the CH - we skipped doing this
+     * earlier when encoding extensions, to allow for adding the
+     * ECH here (when doing ECH) - see tls_construct_extensions()
+     * towards the end
+     */
+    if (!WPACKET_close(pkt)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("EAAE: aad", aad, aad_len);
+#endif
+    clear = OPENSSL_zalloc(clear_len); /* zeros incl. padding */
+    if (clear == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    memcpy(clear, encoded_inner, encoded_inner_len);
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("EAAE: padded clear", clear, clear_len);
+#endif
+    /* we're done with this now */
+    OPENSSL_free(s->ext.ech.encoded_inner);
+    s->ext.ech.encoded_inner = NULL;
+    rv = OSSL_HPKE_seal(s->ext.ech.hpke_ctx, cipher_loc,
+        &cipherlen, aad, aad_len, clear, clear_len);
+    OPENSSL_free(clear);
+    if (rv != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("EAAE: cipher", cipher_loc, cipherlen);
+    ossl_ech_pbuf("EAAE: hpke mypub", mypub, mypub_len);
+    /* re-use aad_len for tracing */
+    WPACKET_get_total_written(pkt, &aad_len);
+    ossl_ech_pbuf("EAAE pkt aftr", WPACKET_get_curr(pkt) - aad_len, aad_len);
+#endif
+    return 1;
+err:
+    return 0;
+}
+
+/*
+ * print info about the ECH-status of an SSL connection
+ * out is the BIO to use (e.g. stdout/whatever)
+ * selector OSSL_ECH_SELECT_ALL or just one of the SSL_ECH values
+ */
+void ossl_ech_status_print(BIO *out, SSL_CONNECTION *s, int selector)
+{
+    int num = 0, i, has_priv, for_retry;
+    size_t j;
+    time_t secs = 0;
+    char *pn = NULL, *ec = NULL;
+    OSSL_ECHSTORE *es = NULL;
+
+#ifdef OSSL_ECH_SUPERVERBOSE
+    BIO_printf(out, "ech_status_print\n");
+    BIO_printf(out, "s=%p\n", (void *)s);
+#endif
+    BIO_printf(out, "ech_attempted=%d\n", s->ext.ech.attempted);
+    BIO_printf(out, "ech_attempted_type=0x%4x\n",
+        s->ext.ech.attempted_type);
+    if (s->ext.ech.attempted_cid == OSSL_ECH_config_id_unset)
+        BIO_printf(out, "ech_atttempted_cid is unset\n");
+    else
+        BIO_printf(out, "ech_atttempted_cid=0x%02x\n",
+            s->ext.ech.attempted_cid);
+    BIO_printf(out, "ech_done=%d\n", s->ext.ech.done);
+    BIO_printf(out, "ech_grease=%d\n", s->ext.ech.grease);
+#ifdef OSSL_ECH_SUPERVERBOSE
+    BIO_printf(out, "HRR=%d\n", s->hello_retry_request);
+#endif
+    BIO_printf(out, "ech_backend=%d\n", s->ext.ech.backend);
+    BIO_printf(out, "ech_success=%d\n", s->ext.ech.success);
+    es = s->ext.ech.es;
+    if (es == NULL || es->entries == NULL) {
+        BIO_printf(out, "ECH cfg=NONE\n");
+    } else {
+        num = sk_OSSL_ECHSTORE_ENTRY_num(es->entries);
+        BIO_printf(out, "%d ECHConfig values loaded\n", num);
+        for (i = 0; i != num; i++) {
+            if (selector != OSSL_ECHSTORE_ALL && selector != i)
+                continue;
+            BIO_printf(out, "cfg(%d): ", i);
+            if (OSSL_ECHSTORE_get1_info(es, i, &secs, &pn, &ec,
+                    &has_priv, &for_retry)
+                != 1) {
+                OPENSSL_free(pn); /* just in case */
+                OPENSSL_free(ec);
+                continue;
+            }
+            BIO_printf(out, "ECH entry: %d public_name: %s age: %lld%s\n",
+                i, pn, (long long)secs, has_priv ? " (has private key)" : "");
+            BIO_printf(out, "\t%s\n", ec);
+            OPENSSL_free(pn);
+            OPENSSL_free(ec);
+        }
+    }
+    if (s->ext.ech.returned) {
+        BIO_printf(out, "ret=");
+        for (j = 0; j != s->ext.ech.returned_len; j++) {
+            if (j != 0 && j % 16 == 0)
+                BIO_printf(out, "\n    ");
+            BIO_printf(out, "%02x:", (unsigned)(s->ext.ech.returned[j]));
+        }
+        BIO_printf(out, "\n");
+    }
+    return;
+}
+
+/*
+ * Swap the inner and outer after ECH success on the client
+ * return 0 for error, 1 for success
+ */
+int ossl_ech_swaperoo(SSL_CONNECTION *s)
+{
+    unsigned char *curr_buf = NULL;
+    size_t curr_buflen = 0;
+
+    if (s == NULL)
+        return 0;
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_ptranscript(s, "ech_swaperoo, b4");
+#endif
+    /* un-stash inner key share(s) */
+    if (ossl_ech_unstash_keyshares(s) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    /*
+     * When not doing HRR... fix up the transcript to reflect the inner CH.
+     * If there's a client hello at the start of the buffer, then that's
+     * the outer CH and we want to replace that with the inner. We need to
+     * be careful that there could be early data or a server hello following
+     * and we can't lose that.
+     *
+     * For HRR... HRR processing code has already done the necessary.
+     */
+    if (s->hello_retry_request == SSL_HRR_NONE) {
+        BIO *handbuf = s->s3.handshake_buffer;
+        PACKET pkt, subpkt;
+        unsigned int mt;
+
+        s->s3.handshake_buffer = NULL;
+        if (ssl3_init_finished_mac(s) == 0) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            BIO_free(handbuf);
+            return 0;
+        }
+        if (ssl3_finish_mac(s, s->ext.ech.innerch, s->ext.ech.innerch_len) == 0) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            BIO_free(handbuf);
+            return 0;
+        }
+        curr_buflen = BIO_get_mem_data(handbuf, &curr_buf);
+        if (PACKET_buf_init(&pkt, curr_buf, curr_buflen)
+            && PACKET_get_1(&pkt, &mt)
+            && mt == SSL3_MT_CLIENT_HELLO
+            && PACKET_remaining(&pkt) >= 3) {
+            if (!PACKET_get_length_prefixed_3(&pkt, &subpkt)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                BIO_free(handbuf);
+                return 0;
+            }
+            if (PACKET_remaining(&pkt) > 0) {
+                if (ssl3_finish_mac(s, PACKET_data(&pkt), PACKET_remaining(&pkt)) == 0) {
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                    BIO_free(handbuf);
+                    return 0;
+                }
+            }
+            BIO_free(handbuf);
+        }
+    }
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_ptranscript(s, "ech_swaperoo, after");
+#endif
+    /* Declare victory! */
+    s->ext.ech.attempted = 1;
+    s->ext.ech.success = 1;
+    s->ext.ech.done = 1;
+    s->ext.ech.grease = OSSL_ECH_NOT_GREASE;
+    /* time to call an ECH callback, if there's one */
+    if (s->ext.ech.es != NULL && s->ext.ech.done == 1
+        && s->hello_retry_request != SSL_HRR_PENDING
+        && s->ext.ech.cb != NULL) {
+        char pstr[OSSL_ECH_PBUF_SIZE + 1] = { 0 };
+        BIO *biom = BIO_new(BIO_s_mem());
+        unsigned int cbrv = 0;
+
+        if (biom == NULL) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+        ossl_ech_status_print(biom, s, OSSL_ECHSTORE_ALL);
+        BIO_read(biom, pstr, OSSL_ECH_PBUF_SIZE);
+        cbrv = s->ext.ech.cb(&s->ssl, pstr);
+        BIO_free(biom);
+        if (cbrv != 1) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+    }
+    return 1;
+}
+
+/*
+ * do the HKDF for ECH acceptance checking
+ * md is the h/s hash
+ * for_hrr is 1 if we're doing a HRR
+ * hashval/hashlen is the transcript hash
+ * hoval is the output, with the ECH acceptance signal
+ * return 1 for good, 0 for error
+ */
+static int ech_hkdf_extract_wrap(SSL_CONNECTION *s, EVP_MD *md, int for_hrr,
+    unsigned char *hashval, size_t hashlen,
+    unsigned char hoval[OSSL_ECH_SIGNAL_LEN])
+{
+    int rv = 0;
+    unsigned char notsecret[EVP_MAX_MD_SIZE], zeros[EVP_MAX_MD_SIZE];
+    size_t retlen = 0, labellen = 0;
+    EVP_PKEY_CTX *pctx = NULL;
+    const char *label = NULL;
+    unsigned char *p = NULL;
+    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+
+    if (for_hrr == 1) {
+        label = OSSL_ECH_HRR_CONFIRM_STRING;
+        labellen = sizeof(OSSL_ECH_HRR_CONFIRM_STRING) - 1;
+    } else {
+        label = OSSL_ECH_ACCEPT_CONFIRM_STRING;
+        labellen = sizeof(OSSL_ECH_ACCEPT_CONFIRM_STRING) - 1;
+    }
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("cc: label", (unsigned char *)label, labellen);
+#endif
+    memset(zeros, 0, EVP_MAX_MD_SIZE);
+    /* We don't seem to have an hkdf-extract that's exposed by libcrypto */
+    pctx = EVP_PKEY_CTX_new_from_name(sctx->libctx, "HKDF", sctx->propq);
+    if (pctx == NULL
+        || EVP_PKEY_derive_init(pctx) != 1
+        || EVP_PKEY_CTX_hkdf_mode(pctx,
+               EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY)
+            != 1
+        || EVP_PKEY_CTX_set_hkdf_md(pctx, md) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /* pick correct client_random */
+    if (s->server)
+        p = s->s3.client_random;
+    else
+        p = s->ext.ech.client_random;
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("cc: client_random", p, SSL3_RANDOM_SIZE);
+#endif
+    if (EVP_PKEY_CTX_set1_hkdf_key(pctx, p, SSL3_RANDOM_SIZE) != 1
+        || EVP_PKEY_CTX_set1_hkdf_salt(pctx, zeros, (int)hashlen) != 1
+        || EVP_PKEY_derive(pctx, NULL, &retlen) != 1
+        || hashlen != retlen
+        || EVP_PKEY_derive(pctx, notsecret, &retlen) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("cc: notsecret", notsecret, hashlen);
+#endif
+    if (hashlen < OSSL_ECH_SIGNAL_LEN
+        || !tls13_hkdf_expand(s, md, notsecret,
+            (const unsigned char *)label, labellen,
+            hashval, hashlen, hoval,
+            OSSL_ECH_SIGNAL_LEN, 1)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    rv = 1;
+err:
+    EVP_PKEY_CTX_free(pctx);
+    return rv;
+}
+
+/*
+ * ECH accept_confirmation calculation
+ * for_hrr is 1 if this is for an HRR, otherwise for SH
+ * acbuf is an 8 octet buffer for the confirmation value
+ * shlen is the server hello length
+ * return: 1 for success, 0 otherwise
+ *
+ * This is a magic value in the ServerHello.random lower 8 octets
+ * that is used to signal that the inner worked.
+ *
+ * As per spec:
+ *
+ * accept_confirmation = HKDF-Expand-Label(
+ *         HKDF-Extract(0, ClientHelloInner.random),
+ *         "ech accept confirmation",
+ *         transcript_ech_conf,
+ *         8)
+ *
+ * transcript_ech_conf = ClientHelloInner..ServerHello
+ *         with last 8 octets of ServerHello.random==0x00
+ *
+ * and with differences due to HRR
+ */
+int ossl_ech_calc_confirm(SSL_CONNECTION *s, int for_hrr,
+    unsigned char acbuf[OSSL_ECH_SIGNAL_LEN],
+    const size_t shlen)
+{
+    int rv = 0;
+    EVP_MD_CTX *ctx = NULL;
+    EVP_MD *md = NULL;
+    unsigned char *tbuf = NULL, *conf_loc = NULL;
+    unsigned char *fixedshbuf = NULL;
+    size_t fixedshbuf_len = 0, tlen = 0, chend = 0;
+    /* shoffset is: 4 + 2 + 32 - 8 */
+    size_t shoffset = SSL3_HM_HEADER_LENGTH + sizeof(uint16_t)
+        + SSL3_RANDOM_SIZE - OSSL_ECH_SIGNAL_LEN;
+    unsigned int hashlen = 0;
+    unsigned char hashval[EVP_MAX_MD_SIZE];
+    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+
+    if ((md = (EVP_MD *)ssl_handshake_md(s)) == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_ECH_REQUIRED);
+        goto end;
+    }
+    if (ossl_ech_intbuf_fetch(s, &tbuf, &tlen) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_ECH_REQUIRED);
+        goto end;
+    }
+    chend = tlen - shlen - 4;
+    fixedshbuf_len = shlen + 4;
+    if (s->server) {
+        chend = tlen - shlen;
+        fixedshbuf_len = shlen;
+    }
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("cx: tbuf b4-b4", tbuf, tlen);
+#endif
+    /* put zeros in correct place */
+    if (for_hrr == 0) { /* zap magic octets at fixed place for SH */
+        conf_loc = tbuf + chend + shoffset;
+    } else {
+        if (s->server == 0 && s->ext.ech.hrrsignal_p == NULL) {
+            /* No ECH found so we'll exit, but set random output */
+            if (RAND_bytes_ex(sctx->libctx, acbuf, OSSL_ECH_SIGNAL_LEN, 0)
+                <= 0) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_ECH_REQUIRED);
+                goto end;
+            }
+            rv = 1;
+            goto end;
+        }
+        conf_loc = tbuf + tlen - OSSL_ECH_SIGNAL_LEN;
+    }
+    memset(conf_loc, 0, OSSL_ECH_SIGNAL_LEN);
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("cx: tbuf after", tbuf, tlen);
+#endif
+    if ((ctx = EVP_MD_CTX_new()) == NULL
+        || EVP_DigestInit_ex(ctx, md, NULL) <= 0
+        || EVP_DigestUpdate(ctx, tbuf, tlen) <= 0
+        || EVP_DigestFinal_ex(ctx, hashval, &hashlen) <= 0) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto end;
+    }
+    EVP_MD_CTX_free(ctx);
+    ctx = NULL;
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("cx: hashval", hashval, hashlen);
+#endif
+    /* calculate and set the final output */
+    if (ech_hkdf_extract_wrap(s, md, for_hrr, hashval, hashlen, acbuf) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto end;
+    }
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("cx: result", acbuf, OSSL_ECH_SIGNAL_LEN);
+#endif
+    /* put confirm value back into transcript */
+    if (s->server == 0 && for_hrr == 1) { /* put back the one we got */
+        memcpy(conf_loc, s->ext.ech.hrrsignal, OSSL_ECH_SIGNAL_LEN);
+    } else {
+        memcpy(conf_loc, acbuf, OSSL_ECH_SIGNAL_LEN);
+    }
+    /* on a server, we need to reset the hs buffer now */
+    if (s->server && s->hello_retry_request == SSL_HRR_NONE)
+        ossl_ech_reset_hs_buffer(s, s->ext.ech.innerch, s->ext.ech.innerch_len);
+    if (s->server && s->hello_retry_request == SSL_HRR_COMPLETE)
+        ossl_ech_reset_hs_buffer(s, tbuf, tlen - fixedshbuf_len);
+    rv = 1;
+end:
+    OPENSSL_free(fixedshbuf);
+    EVP_MD_CTX_free(ctx);
+    return rv;
+}
+
+/*!
+ * Given a CH find the offsets of the session id, extensions and ECH
+ * pkt is the CH
+ * sessid_off points to offset of session_id length
+ * exts_off points to offset of extensions
+ * ech_off points to offset of ECH
+ * echtype points to the ext type of the ECH
+ * inner 1 if the ECH is marked as an inner, 0 for outer
+ * sni_off points to offset of (outer) SNI
+ * return 1 for success, other otherwise
+ *
+ * Offsets are set to zero if relevant thing not found.
+ * Offsets are returned to the type or length field in question.
+ *
+ * Note: input here is untrusted!
+ */
+int ossl_ech_get_ch_offsets(SSL_CONNECTION *s, PACKET *pkt, size_t *sessid_off,
+    size_t *exts_off, size_t *ech_off, uint16_t *echtype,
+    int *inner, size_t *sni_off)
+{
+    const unsigned char *ch = NULL;
+    size_t ch_len = 0, exts_len = 0, sni_len = 0, ech_len = 0;
+
+    if (s == NULL)
+        return 0;
+    if (pkt == NULL || sessid_off == NULL || exts_off == NULL
+        || ech_off == NULL || echtype == NULL || inner == NULL
+        || sni_off == NULL) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+        return 0;
+    }
+    /* check if we've already done the work */
+    if (s->ext.ech.ch_offsets_done == 1) {
+        *sessid_off = s->ext.ech.sessid_off;
+        *exts_off = s->ext.ech.exts_off;
+        *ech_off = s->ext.ech.ech_off;
+        *echtype = s->ext.ech.echtype;
+        *inner = s->ext.ech.inner;
+        *sni_off = s->ext.ech.sni_off;
+        return 1;
+    }
+    *sessid_off = 0;
+    *exts_off = 0;
+    *ech_off = 0;
+    *echtype = OSSL_ECH_type_unknown;
+    *sni_off = 0;
+    /* do the work */
+    ch_len = PACKET_remaining(pkt);
+    if (PACKET_peek_bytes(pkt, &ch, ch_len) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_EXTENSION);
+        return 0;
+    }
+    if (ossl_ech_helper_get_ch_offsets(ch, ch_len, sessid_off, exts_off,
+            &exts_len, ech_off, echtype, &ech_len,
+            sni_off, &sni_len, inner)
+        != 1) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+        return 0;
+    }
+#ifdef OSSL_ECH_SUPERVERBOSE
+    OSSL_TRACE_BEGIN(TLS)
+    {
+        BIO_printf(trc_out, "orig CH/ECH type: %4x\n", *echtype);
+    }
+    OSSL_TRACE_END(TLS);
+    ossl_ech_pbuf("orig CH", (unsigned char *)ch, ch_len);
+    ossl_ech_pbuf("orig CH exts", (unsigned char *)ch + *exts_off, exts_len);
+    ossl_ech_pbuf("orig CH/ECH", (unsigned char *)ch + *ech_off, ech_len);
+    ossl_ech_pbuf("orig CH SNI", (unsigned char *)ch + *sni_off, sni_len);
+#endif
+    s->ext.ech.sessid_off = *sessid_off;
+    s->ext.ech.exts_off = *exts_off;
+    s->ext.ech.ech_off = *ech_off;
+    s->ext.ech.echtype = *echtype;
+    s->ext.ech.inner = *inner;
+    s->ext.ech.sni_off = *sni_off;
+    s->ext.ech.ch_offsets_done = 1;
+    return 1;
+}
+
+static void ossl_ech_encch_free(OSSL_ECH_ENCCH *tbf)
+{
+    if (tbf == NULL)
+        return;
+    OPENSSL_free(tbf->enc);
+    OPENSSL_free(tbf->payload);
+    return;
+}
+
+/*
+ * decode outer sni value so we can trace it
+ * osni_str is the string-form of the SNI
+ * opd is the outer CH buffer
+ * opl is the length of the above
+ * snioffset is where we find the outer SNI
+ *
+ * The caller doesn't have to free the osni_str.
+ */
+static int ech_get_outer_sni(SSL_CONNECTION *s, char **osni_str,
+    const unsigned char *opd, size_t opl,
+    size_t snioffset)
+{
+    PACKET wrap, osni;
+    unsigned int type, osnilen;
+
+    if (snioffset >= opl
+        || !PACKET_buf_init(&wrap, opd + snioffset, opl - snioffset)
+        || !PACKET_get_net_2(&wrap, &type)
+        || type != 0
+        || !PACKET_get_net_2(&wrap, &osnilen)
+        || !PACKET_get_sub_packet(&wrap, &osni, osnilen)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        return 0;
+    }
+    if (tls_parse_ctos_server_name(s, &osni, 0, NULL, 0) != 1)
+        /* SSLfatal called already */
+        return 0;
+    OPENSSL_free(s->ext.ech.outer_hostname);
+    *osni_str = s->ext.ech.outer_hostname = s->ext.hostname;
+    /* clean up what the ECH-unaware parse func above left behind */
+    s->ext.hostname = NULL;
+    s->servername_done = 0;
+    return 1;
+}
+
+/*
+ * decode EncryptedClientHello extension value
+ * pkt contains the ECH value as a PACKET
+ * retext is the returned decoded structure
+ * payload_offset is the offset to the ciphertext
+ * return 1 for good, 0 for bad
+ *
+ * SSLfatal called from inside, as needed
+ */
+static int ech_decode_inbound_ech(SSL_CONNECTION *s, PACKET *pkt,
+    OSSL_ECH_ENCCH **retext,
+    size_t *payload_offset)
+{
+    unsigned int innerorouter = 0xff;
+    unsigned int pval_tmp; /* tmp placeholder of value from packet */
+    OSSL_ECH_ENCCH *extval = NULL;
+    const unsigned char *startofech = NULL;
+
+    /*
+     * Decode the inbound ECH value.
+     *  enum { outer(0), inner(1) } ECHClientHelloType;
+     *  struct {
+     *     ECHClientHelloType type;
+     *     select (ECHClientHello.type) {
+     *         case outer:
+     *             HpkeSymmetricCipherSuite cipher_suite;
+     *             uint8 config_id;
+     *             opaque enc<0..2^16-1>;
+     *             opaque payload<1..2^16-1>;
+     *         case inner:
+     *             Empty;
+     *     };
+     *  } ECHClientHello;
+     */
+    startofech = PACKET_data(pkt);
+    extval = OPENSSL_zalloc(sizeof(OSSL_ECH_ENCCH));
+    if (extval == NULL)
+        goto err;
+    if (!PACKET_get_1(pkt, &innerorouter)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    if (innerorouter != OSSL_ECH_OUTER_CH_TYPE) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    if (!PACKET_get_net_2(pkt, &pval_tmp)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    extval->kdf_id = pval_tmp & 0xffff;
+    if (!PACKET_get_net_2(pkt, &pval_tmp)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    extval->aead_id = pval_tmp & 0xffff;
+    /* config id */
+    if (!PACKET_copy_bytes(pkt, &extval->config_id, 1)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("EARLY config id", &extval->config_id, 1);
+#endif
+    s->ext.ech.attempted_cid = extval->config_id;
+    /* enc - the client's public share */
+    if (!PACKET_get_net_2(pkt, &pval_tmp)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    if (pval_tmp > OSSL_ECH_MAX_GREASE_PUB) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    if (pval_tmp > PACKET_remaining(pkt)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    if (pval_tmp == 0 && s->hello_retry_request != SSL_HRR_PENDING) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+        goto err;
+    } else if (pval_tmp > 0 && s->hello_retry_request == SSL_HRR_PENDING) {
+        unsigned char *tmpenc = NULL;
+
+        /*
+         * if doing HRR, client should only send this when GREASEing
+         * and it should be the same value as 1st time, so we'll check
+         * that
+         */
+        if (s->ext.ech.success == 1) {
+            /* first decrypt worked, so enc should be empty */
+            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+            goto err;
+        }
+        if (s->ext.ech.pub == NULL || s->ext.ech.pub_len == 0) {
+            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+            goto err;
+        }
+        if (pval_tmp != s->ext.ech.pub_len) {
+            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+            goto err;
+        }
+        tmpenc = OPENSSL_malloc(pval_tmp);
+        if (tmpenc == NULL)
+            goto err;
+        if (!PACKET_copy_bytes(pkt, tmpenc, pval_tmp)) {
+            OPENSSL_free(tmpenc);
+            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+            goto err;
+        }
+        if (memcmp(tmpenc, s->ext.ech.pub, pval_tmp) != 0) {
+            OPENSSL_free(tmpenc);
+            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+            goto err;
+        }
+        OPENSSL_free(tmpenc);
+    } else if (pval_tmp == 0 && s->hello_retry_request == SSL_HRR_PENDING) {
+        if (s->ext.ech.pub == NULL || s->ext.ech.pub_len == 0) {
+            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+            goto err;
+        }
+        extval->enc_len = s->ext.ech.pub_len;
+        extval->enc = OPENSSL_malloc(extval->enc_len);
+        if (extval->enc == NULL)
+            goto err;
+        memcpy(extval->enc, s->ext.ech.pub, extval->enc_len);
+    } else {
+        extval->enc_len = pval_tmp;
+        extval->enc = OPENSSL_malloc(pval_tmp);
+        if (extval->enc == NULL)
+            goto err;
+        if (!PACKET_copy_bytes(pkt, extval->enc, pval_tmp)) {
+            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+            goto err;
+        }
+        /* squirrel away that value in case of future HRR */
+        OPENSSL_free(s->ext.ech.pub);
+        s->ext.ech.pub_len = extval->enc_len;
+        s->ext.ech.pub = OPENSSL_malloc(extval->enc_len);
+        if (s->ext.ech.pub == NULL)
+            goto err;
+        memcpy(s->ext.ech.pub, extval->enc, extval->enc_len);
+    }
+    /* payload - the encrypted CH */
+    *payload_offset = PACKET_data(pkt) - startofech;
+    if (!PACKET_get_net_2(pkt, &pval_tmp)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    if (pval_tmp > OSSL_ECH_MAX_PAYLOAD_LEN) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    if (pval_tmp == 0 || pval_tmp > PACKET_remaining(pkt)) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    extval->payload_len = pval_tmp;
+    extval->payload = OPENSSL_malloc(pval_tmp);
+    if (extval->payload == NULL)
+        goto err;
+    if (!PACKET_copy_bytes(pkt, extval->payload, pval_tmp)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    *retext = extval;
+    return 1;
+err:
+    if (extval != NULL) {
+        ossl_ech_encch_free(extval);
+        OPENSSL_free(extval);
+        extval = NULL;
+    }
+    return 0;
+}
+
+/*
+ * find outers if any, and do initial checks
+ * pkt is the encoded inner
+ * outers is the array of outer ext types
+ * n_outers is the number of outers found
+ * return 1 for good, 0 for error
+ *
+ * recall we're dealing with recovered ECH plaintext here so
+ * the content must be a TLSv1.3 ECH encoded inner
+ */
+static int ech_find_outers(SSL_CONNECTION *s, PACKET *pkt,
+    uint16_t *outers, size_t *n_outers)
+{
+    const unsigned char *pp_tmp;
+    unsigned int pi_tmp, extlens, etype, elen, olen;
+    int outers_found = 0;
+    size_t i;
+    PACKET op;
+
+    PACKET_null_init(&op);
+    /* chew up the packet to extensions */
+    if (!PACKET_get_net_2(pkt, &pi_tmp)
+        || pi_tmp != TLS1_2_VERSION
+        || !PACKET_get_bytes(pkt, &pp_tmp, SSL3_RANDOM_SIZE)
+        || !PACKET_get_1(pkt, &pi_tmp)
+        || pi_tmp != 0x00 /* zero'd session id */
+        || !PACKET_get_net_2(pkt, &pi_tmp) /* ciphersuite len */
+        || !PACKET_get_bytes(pkt, &pp_tmp, pi_tmp) /* suites */
+        || !PACKET_get_1(pkt, &pi_tmp) /* compression meths */
+        || pi_tmp != 0x01 /* 1 octet of comressions */
+        || !PACKET_get_1(pkt, &pi_tmp) /* compression meths */
+        || pi_tmp != 0x00 /* 1 octet of no comressions */
+        || !PACKET_get_net_2(pkt, &extlens) /* len(extensions) */
+        || extlens == 0) { /* no extensions! */
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    while (PACKET_remaining(pkt) > 0 && outers_found == 0) {
+        if (!PACKET_get_net_2(pkt, &etype)) {
+            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+            goto err;
+        }
+        if (etype == TLSEXT_TYPE_outer_extensions) {
+            outers_found = 1;
+            if (!PACKET_get_length_prefixed_2(pkt, &op)) {
+                SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+                goto err;
+            }
+        } else { /* skip over */
+            if (!PACKET_get_net_2(pkt, &elen)
+                || !PACKET_get_bytes(pkt, &pp_tmp, elen)) {
+                SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+                goto err;
+            }
+        }
+    }
+
+    if (outers_found == 0) { /* which is fine! */
+        *n_outers = 0;
+        return 1;
+    }
+    /*
+     * outers has a silly internal length as well and that better
+     * be one less than the extension length and an even number
+     * and we only support a certain max of outers
+     */
+    if (!PACKET_get_1(&op, &olen)
+        || olen % 2 == 1
+        || olen / 2 > OSSL_ECH_OUTERS_MAX) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    *n_outers = olen / 2;
+    for (i = 0; i != *n_outers; i++) {
+        /* check for ones that are not allowed */
+        if (!PACKET_get_net_2(&op, &pi_tmp)
+            || pi_tmp == TLSEXT_TYPE_outer_extensions
+            || pi_tmp == TLSEXT_TYPE_ech) {
+            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+            goto err;
+        }
+        outers[i] = (uint16_t)pi_tmp;
+    }
+    return 1;
+err:
+    return 0;
+}
+
+/*
+ * copy one extension from outer to inner
+ * di is the reconstituted inner CH
+ * type2copy is the outer type to copy
+ * exts is the outer extensions packet (changing as we go)
+ * return 1 for good 0 for error
+ */
+static int ech_copy_ext(SSL_CONNECTION *s, WPACKET *di, uint16_t type2copy,
+    PACKET *exts)
+{
+    unsigned int etype, elen;
+    const unsigned char *eval;
+
+    /* Skip until we find the thing to copy */
+    while (PACKET_remaining(exts) > 0) {
+        if (!PACKET_get_net_2(exts, &etype)
+            || !PACKET_get_net_2(exts, &elen)
+            || !PACKET_get_bytes(exts, &eval, elen)) {
+            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+            goto err;
+        }
+        if (etype == type2copy) {
+            if (!WPACKET_put_bytes_u16(di, etype)
+                || !WPACKET_put_bytes_u16(di, elen)
+                || !WPACKET_memcpy(di, eval, elen)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_EXTENSION);
+                goto err;
+            }
+            return 1;
+        }
+    }
+    /* we didn't find such an extension - that's an error */
+    SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+err:
+    return 0;
+}
+
+/*
+ * reconstitute the inner CH from encoded inner and outers
+ * di is the reconstituted inner CH
+ * ei is the encoded inner
+ * ob is the outer CH as a buffer
+ * ob_len is the size of the above
+ * outers is the array of outer ext types
+ * n_outers is the number of outers found
+ * return 1 for good, 0 for error
+ */
+static int ech_reconstitute_inner(SSL_CONNECTION *s, WPACKET *di, PACKET *ei,
+    const unsigned char *ob, size_t ob_len,
+    uint16_t *outers, size_t n_outers)
+{
+    const unsigned char *pp_tmp, *eval, *outer_exts;
+    unsigned int pi_tmp, etype, elen, outer_extslen;
+    PACKET outer, session_id;
+    size_t i;
+    int outers_done = 0;
+
+    if (PACKET_buf_init(&outer, ob, ob_len) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /* read/write from encoded inner to decoded inner with help from outer */
+    if (/* version */
+        !PACKET_get_net_2(&outer, &pi_tmp)
+        || !PACKET_get_net_2(ei, &pi_tmp)
+        || !WPACKET_put_bytes_u16(di, pi_tmp)
+        || pi_tmp != TLS1_2_VERSION
+
+        /* client random */
+        || !PACKET_get_bytes(&outer, &pp_tmp, SSL3_RANDOM_SIZE)
+        || !PACKET_get_bytes(ei, &pp_tmp, SSL3_RANDOM_SIZE)
+        || !WPACKET_memcpy(di, pp_tmp, SSL3_RANDOM_SIZE)
+
+        /* session ID */
+        || !PACKET_get_1(ei, &pi_tmp)
+        || !PACKET_get_length_prefixed_1(&outer, &session_id)
+        || !WPACKET_start_sub_packet_u8(di)
+        || (PACKET_remaining(&session_id) != 0
+            && !WPACKET_memcpy(di, PACKET_data(&session_id),
+                PACKET_remaining(&session_id)))
+        || !WPACKET_close(di)
+
+        /* ciphersuites */
+        || !PACKET_get_net_2(&outer, &pi_tmp) /* ciphersuite len */
+        || !PACKET_get_bytes(&outer, &pp_tmp, pi_tmp) /* suites */
+        || !PACKET_get_net_2(ei, &pi_tmp) /* ciphersuite len */
+        || !PACKET_get_bytes(ei, &pp_tmp, pi_tmp) /* suites */
+        || !WPACKET_put_bytes_u16(di, pi_tmp)
+        || !WPACKET_memcpy(di, pp_tmp, pi_tmp)
+
+        /* compression len & meth */
+        || !PACKET_get_net_2(ei, &pi_tmp)
+        || !PACKET_get_net_2(&outer, &pi_tmp)
+        || !WPACKET_put_bytes_u16(di, pi_tmp)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    /* handle simple, but unlikely, case first */
+    if (n_outers == 0) {
+        if (PACKET_remaining(ei) == 0)
+            return 1; /* no exts is theoretically possible */
+        if (!PACKET_get_net_2(ei, &pi_tmp) /* len(extensions) */
+            || !PACKET_get_bytes(ei, &pp_tmp, pi_tmp)
+            || !WPACKET_put_bytes_u16(di, pi_tmp)
+            || !WPACKET_memcpy(di, pp_tmp, pi_tmp)) {
+            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+            goto err;
+        }
+        WPACKET_close(di);
+        return 1;
+    }
+    /*
+     * general case, copy one by one from inner, 'till we hit
+     * the outers extension, then copy one by one from outer
+     */
+    if (!PACKET_get_net_2(ei, &pi_tmp) /* len(extensions) */
+        || !PACKET_get_net_2(&outer, &outer_extslen)
+        || !PACKET_get_bytes(&outer, &outer_exts, outer_extslen)
+        || !WPACKET_start_sub_packet_u16(di)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    while (PACKET_remaining(ei) > 0) {
+        if (!PACKET_get_net_2(ei, &etype)
+            || !PACKET_get_net_2(ei, &elen)
+            || !PACKET_get_bytes(ei, &eval, elen)) {
+            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+            goto err;
+        }
+        if (etype == TLSEXT_TYPE_outer_extensions) {
+            PACKET exts;
+
+            if (outers_done++) { /* just do this once */
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+            if (PACKET_buf_init(&exts, outer_exts, outer_extslen) != 1) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+            for (i = 0; i != n_outers; i++) {
+                if (ech_copy_ext(s, di, outers[i], &exts) != 1)
+                    /* SSLfatal called already */
+                    goto err;
+            }
+        } else {
+            if (!WPACKET_put_bytes_u16(di, etype)
+                || !WPACKET_put_bytes_u16(di, elen)
+                || !WPACKET_memcpy(di, eval, elen)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_EXTENSION);
+                goto err;
+            }
+        }
+    }
+    WPACKET_close(di);
+    return 1;
+err:
+    WPACKET_cleanup(di);
+    return 0;
+}
+
+/*
+ * After successful ECH decrypt, we decode, decompress etc.
+ * ob is the outer CH as a buffer
+ * ob_len is the size of the above
+ * return 1 for success, error otherwise
+ *
+ * We need the outer CH as a buffer (ob, below) so we can
+ * ECH-decompress.
+ * The plaintext we start from is in encoded_innerch
+ * and our final decoded, decompressed buffer will end up
+ * in innerch (which'll then be further processed).
+ * That further processing includes all existing decoding
+ * checks so we should be fine wrt fuzzing without having
+ * to make all checks here (e.g. we can assume that the
+ * protocol version, NULL compression etc are correct here -
+ * if not, those'll be caught later).
+ * Note: there are a lot of literal values here, but it's
+ * not clear that changing those to #define'd symbols will
+ * help much - a change to the length of a type or from a
+ * 2 octet length to longer would seem unlikely.
+ */
+static int ech_decode_inner(SSL_CONNECTION *s, const unsigned char *ob,
+    size_t ob_len, unsigned char *encoded_inner,
+    size_t encoded_inner_len)
+{
+    int rv = 0;
+    PACKET ei; /* encoded inner */
+    BUF_MEM *di_mem = NULL;
+    uint16_t outers[OSSL_ECH_OUTERS_MAX]; /* compressed extension types */
+    size_t n_outers = 0;
+    WPACKET di = { 0 }; /* "fake" pkt for inner */
+
+    if (encoded_inner == NULL || ob == NULL || ob_len == 0) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    if ((di_mem = BUF_MEM_new()) == NULL
+        || !BUF_MEM_grow(di_mem, SSL3_RT_MAX_PLAIN_LENGTH)
+        || !WPACKET_init(&di, di_mem)
+        || !WPACKET_put_bytes_u8(&di, SSL3_MT_CLIENT_HELLO)
+        || !WPACKET_start_sub_packet_u24(&di)
+        || !PACKET_buf_init(&ei, encoded_inner, encoded_inner_len)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+#ifdef OSSL_ECH_SUPERVERBOSE
+    memset(outers, -1, sizeof(outers)); /* fill with known values for debug */
+#endif
+
+    /* 1. check for outers and make initial checks of those */
+    if (ech_find_outers(s, &ei, outers, &n_outers) != 1)
+        goto err; /* SSLfatal called already */
+
+    /* 2. reconstitute inner CH */
+    /* reset ei */
+    if (PACKET_buf_init(&ei, encoded_inner, encoded_inner_len) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    if (ech_reconstitute_inner(s, &di, &ei, ob, ob_len, outers, n_outers) != 1)
+        goto err; /* SSLfatal called already */
+    /* 3. store final inner CH in connection */
+    WPACKET_close(&di);
+    if (!WPACKET_get_length(&di, &s->ext.ech.innerch_len)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    OPENSSL_free(s->ext.ech.innerch);
+    s->ext.ech.innerch = (unsigned char *)di_mem->data;
+    di_mem->data = NULL;
+    rv = 1;
+err:
+    WPACKET_cleanup(&di);
+    BUF_MEM_free(di_mem);
+    return rv;
+}
+
+/*
+ * wrapper for hpke_dec just to save code repetition
+ * ee is the selected ECH_STORE entry
+ * the_ech is the value sent by the client
+ * aad_len is the length of the AAD to use
+ * aad is the AAD to use
+ * forhrr is 0 if not hrr, 1 if this is for 2nd CH
+ * innerlen points to the size of the recovered plaintext
+ * return pointer to plaintext or NULL (if error)
+ *
+ * The plaintext returned is allocated here and must
+ * be freed by the caller later.
+ */
+static unsigned char *hpke_decrypt_encch(SSL_CONNECTION *s,
+    OSSL_ECHSTORE_ENTRY *ee,
+    OSSL_ECH_ENCCH *the_ech,
+    size_t aad_len, unsigned char *aad,
+    int forhrr, size_t *innerlen)
+{
+    size_t cipherlen = 0, zind = 0;
+    unsigned char *cipher = NULL;
+    size_t senderpublen = 0;
+    unsigned char *senderpub = NULL;
+    size_t clearlen = 0;
+    unsigned char *clear = NULL;
+    int hpke_mode = OSSL_HPKE_MODE_BASE;
+    OSSL_HPKE_SUITE hpke_suite = OSSL_HPKE_SUITE_DEFAULT;
+    unsigned char info[OSSL_ECH_MAX_INFO_LEN];
+    size_t info_len = OSSL_ECH_MAX_INFO_LEN;
+    int rv = 0;
+    OSSL_HPKE_CTX *hctx = NULL;
+    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+#ifdef OSSL_ECH_SUPERVERBOSE
+    size_t publen = 0;
+    unsigned char *pub = NULL;
+#endif
+
+    if (ee == NULL || ee->nsuites == 0)
+        return NULL;
+    cipherlen = the_ech->payload_len;
+    cipher = the_ech->payload;
+    senderpublen = the_ech->enc_len;
+    senderpub = the_ech->enc;
+    hpke_suite.aead_id = the_ech->aead_id;
+    hpke_suite.kdf_id = the_ech->kdf_id;
+    clearlen = cipherlen; /* small overestimate */
+    clear = OPENSSL_malloc(clearlen);
+    if (clear == NULL)
+        return NULL;
+    /* The kem_id will be the same for all suites in the entry */
+    hpke_suite.kem_id = ee->suites[0].kem_id;
+#ifdef OSSL_ECH_SUPERVERBOSE
+    publen = ee->pub_len;
+    pub = ee->pub;
+    ossl_ech_pbuf("aad", aad, aad_len);
+    ossl_ech_pbuf("my local pub", pub, publen);
+    ossl_ech_pbuf("senderpub", senderpub, senderpublen);
+    ossl_ech_pbuf("cipher", cipher, cipherlen);
+#endif
+    if (ossl_ech_make_enc_info(ee->encoded, ee->encoded_len,
+            info, &info_len)
+        != 1) {
+        OPENSSL_free(clear);
+        return NULL;
+    }
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("info", info, info_len);
+#endif
+    OSSL_TRACE_BEGIN(TLS)
+    {
+        BIO_printf(trc_out,
+            "hpke_dec suite: kem: %04x, kdf: %04x, aead: %04x\n",
+            hpke_suite.kem_id, hpke_suite.kdf_id, hpke_suite.aead_id);
+    }
+    OSSL_TRACE_END(TLS);
+    /*
+     * We may generate externally visible OpenSSL errors
+     * if decryption fails (which is normal) but we'll
+     * ignore those as we might be dealing with a GREASEd
+     * ECH. To do that we need to now ignore some errors
+     * so we use ERR_set_mark() then later ERR_pop_to_mark().
+     */
+    ERR_set_mark();
+    /* Use OSSL_HPKE_* APIs */
+    hctx = OSSL_HPKE_CTX_new(hpke_mode, hpke_suite, OSSL_HPKE_ROLE_RECEIVER,
+        sctx->libctx, sctx->propq);
+    if (hctx == NULL)
+        goto clearerrs;
+    rv = OSSL_HPKE_decap(hctx, senderpub, senderpublen, ee->keyshare,
+        info, info_len);
+    if (rv != 1)
+        goto clearerrs;
+    if (forhrr == 1) {
+        rv = OSSL_HPKE_CTX_set_seq(hctx, 1);
+        if (rv != 1) {
+            /* don't clear this error - GREASE can't cause it */
+            ERR_clear_last_mark();
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            goto end;
+        }
+    }
+    rv = OSSL_HPKE_open(hctx, clear, &clearlen, aad, aad_len,
+        cipher, cipherlen);
+clearerrs:
+    /* close off our error handling */
+    ERR_pop_to_mark();
+end:
+    OSSL_HPKE_CTX_free(hctx);
+    if (rv != 1) {
+        OSSL_TRACE(TLS, "HPKE decryption failed somehow\n");
+        OPENSSL_free(clear);
+        return NULL;
+    }
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("padded clear", clear, clearlen);
+#endif
+    /* we need to remove possible (actually, v. likely) padding */
+    *innerlen = clearlen;
+    if (ee->version == OSSL_ECH_RFC9849_VERSION) {
+        /* RFC 9849 pads after the encoded CH with zeros */
+        size_t extsoffset = 0;
+        size_t extslen = 0;
+        size_t ch_len = 0;
+        size_t startofsessid = 0;
+        size_t echoffset = 0; /* offset of start of ECH within CH */
+        uint16_t echtype = OSSL_ECH_type_unknown; /* type of ECH seen */
+        size_t outersnioffset = 0; /* offset to SNI in outer */
+        int innerflag = OSSL_ECH_UNKNOWN_CH_TYPE;
+        PACKET innerchpkt;
+
+        if (PACKET_buf_init(&innerchpkt, clear, clearlen) != 1) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_EXTENSION);
+            goto paderr;
+        }
+        /* reset the offsets, as we move from outer to inner CH */
+        s->ext.ech.ch_offsets_done = 0;
+        rv = ossl_ech_get_ch_offsets(s, &innerchpkt, &startofsessid,
+            &extsoffset, &echoffset, &echtype,
+            &innerflag, &outersnioffset);
+        if (rv != 1) {
+            /* SSLfatal called already */
+            goto paderr;
+        }
+        /* odd form of check below just for emphasis */
+        if ((extsoffset + 2) > clearlen) {
+            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+            goto paderr;
+        }
+        extslen = (unsigned char)(clear[extsoffset]) * 256
+            + (unsigned char)(clear[extsoffset + 1]);
+        ch_len = extsoffset + 2 + extslen;
+        /* the check below protects us from bogus data */
+        if (ch_len > clearlen) {
+            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+            goto paderr;
+        }
+        /* The RFC calls for that padding to be all zeros */
+
+        if (*innerlen < ch_len) {
+            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+            goto paderr;
+        }
+        for (zind = ch_len; zind != *innerlen; zind++) {
+            if (clear[zind] != 0x00) {
+                SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+                goto paderr;
+            }
+        }
+        *innerlen = ch_len;
+#ifdef OSSL_ECH_SUPERVERBOSE
+        ossl_ech_pbuf("unpadded clear", clear, *innerlen);
+#endif
+        return clear;
+    } else {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+    }
+paderr:
+    OPENSSL_free(clear);
+    return NULL;
+}
+
+/*
+ * If an ECH is present, attempt decryption
+ * outerpkt is the packet with the outer CH
+ * newpkt is the packet with the decrypted inner CH
+ * return 1 for success, other otherwise
+ *
+ * If decryption succeeds, the caller can swap the inner and outer
+ * CHs so that all further processing will only take into account
+ * the inner CH.
+ *
+ * The fact that decryption worked is signalled to the caller
+ * via s->ext.ech.success
+ *
+ * This function is called early, (hence the name:-), before
+ * the outer CH decoding has really started, so we need to be
+ * careful peeking into the packet
+ *
+ * The plan:
+ * 1. check if there's an ECH
+ * 2. trial-decrypt or check if config matches one loaded
+ * 3. if decrypt fails tee-up GREASE
+ * 4. if decrypt worked, decode and de-compress cleartext to
+ *    make up real inner CH for later processing
+ */
+int ossl_ech_early_decrypt(SSL_CONNECTION *s, PACKET *outerpkt, PACKET *newpkt)
+{
+    int num = 0, cfgind = -1, foundcfg = 0, forhrr = 0, innerflag = -1;
+    OSSL_ECH_ENCCH *extval = NULL;
+    PACKET echpkt;
+    const unsigned char *startofech = NULL, *opd = NULL;
+    size_t echlen = 0, clearlen = 0, aad_len = 0;
+    unsigned char *clear = NULL, *aad = NULL;
+    /* offsets of things within CH */
+    size_t startofsessid = 0, startofexts = 0, echoffset = 0, opl = 0;
+    size_t outersnioffset = 0, startofciphertext = 0, lenofciphertext = 0;
+    uint16_t echtype = OSSL_ECH_type_unknown; /* type of ECH seen */
+    char *osni_str = NULL;
+    OSSL_ECHSTORE *es = NULL;
+    OSSL_ECHSTORE_ENTRY *ee = NULL;
+
+    if (s == NULL)
+        return 0;
+    if (outerpkt == NULL || newpkt == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_EXTENSION);
+        return 0;
+    }
+    /* find offsets - on success, outputs are safe to use */
+    if (ossl_ech_get_ch_offsets(s, outerpkt, &startofsessid, &startofexts,
+            &echoffset, &echtype, &innerflag,
+            &outersnioffset)
+        != 1) {
+        /* SSLfatal called already */
+        return 0;
+    }
+    if (echoffset == 0 || echtype != TLSEXT_TYPE_ech)
+        return 1; /* ECH not present or wrong version */
+    if (innerflag == 1) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+        return 0;
+    }
+    s->ext.ech.attempted = 1; /* Remember that we got an ECH */
+    s->ext.ech.attempted_type = echtype;
+    if (s->hello_retry_request == SSL_HRR_PENDING)
+        forhrr = 1; /* set forhrr if that's correct */
+    opl = PACKET_remaining(outerpkt);
+    opd = PACKET_data(outerpkt);
+    s->tmp_session_id_len = opd[startofsessid]; /* grab the session id */
+    if (s->tmp_session_id_len > SSL_MAX_SSL_SESSION_ID_LENGTH
+        || startofsessid + 1 + s->tmp_session_id_len > opl) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    memcpy(s->tmp_session_id, &opd[startofsessid + 1], s->tmp_session_id_len);
+    if (outersnioffset > 0) { /* Grab the outer SNI for tracing */
+        if (ech_get_outer_sni(s, &osni_str, opd, opl, outersnioffset) != 1)
+            /* SSLfatal called already */
+            goto err;
+        if (osni_str == NULL) {
+            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+            goto err;
+        }
+        OSSL_TRACE1(TLS, "EARLY: outer SNI of %s\n", osni_str);
+    } else {
+        OSSL_TRACE(TLS, "EARLY: no sign of an outer SNI\n");
+    }
+    if (echoffset > opl - 4) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    startofech = &opd[echoffset + 4];
+    echlen = opd[echoffset + 2] * 256 + opd[echoffset + 3];
+    if (echlen > opl - echoffset - 4) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    if (PACKET_buf_init(&echpkt, startofech, echlen) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    if (ech_decode_inbound_ech(s, &echpkt, &extval, &startofciphertext) != 1)
+        goto err; /* SSLfatal already called if needed */
+    /*
+     * startofciphertext is within the ECH value and after the length of the
+     * ciphertext, so we need to bump it by the offset of ECH within the CH
+     * plus the ECH type (2 octets) and length (also 2 octets) and that
+     * ciphertext length (another 2 octets) for a total of 6 octets
+     */
+    startofciphertext += echoffset + 6;
+    lenofciphertext = extval->payload_len;
+    aad_len = opl;
+    if (aad_len < startofciphertext + lenofciphertext) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    aad = OPENSSL_memdup(opd, aad_len);
+    if (aad == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    memset(aad + startofciphertext, 0, lenofciphertext);
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("EARLY aad", aad, aad_len);
+#endif
+    s->ext.ech.grease = OSSL_ECH_GREASE_UNKNOWN;
+    if (s->ext.ech.es == NULL) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    es = s->ext.ech.es;
+    num = (es == NULL || es->entries == NULL ? 0
+                                             : sk_OSSL_ECHSTORE_ENTRY_num(es->entries));
+    for (cfgind = 0; cfgind != num && foundcfg == 0; cfgind++) {
+        ee = sk_OSSL_ECHSTORE_ENTRY_value(es->entries, cfgind);
+        OSSL_TRACE_BEGIN(TLS)
+        {
+            BIO_printf(trc_out,
+                "EARLY: rx'd config id (%x) ==? %d-th configured (%x)\n",
+                extval->config_id, cfgind, ee->config_id);
+        }
+        OSSL_TRACE_END(TLS);
+        if (extval->config_id == ee->config_id) {
+            unsigned int suite_id;
+
+            /* check aead and kdf match a loaded suite for the config_id */
+            for (suite_id = 0; suite_id != ee->nsuites && foundcfg == 0; suite_id++) {
+                if (ee->suites[suite_id].kdf_id == extval->kdf_id
+                    && ee->suites[suite_id].aead_id == extval->aead_id) {
+                    foundcfg = 1;
+                }
+            }
+        }
+    }
+    if (foundcfg == 1) {
+        clear = hpke_decrypt_encch(s, ee, extval, aad_len, aad,
+            forhrr, &clearlen);
+        if (clear == NULL)
+            s->ext.ech.grease = OSSL_ECH_IS_GREASE;
+    }
+    /* if still needed, trial decryptions */
+    if (clear == NULL && (s->options & SSL_OP_ECH_TRIALDECRYPT)) {
+        foundcfg = 0; /* reset as we're trying again */
+        for (cfgind = 0; cfgind != num; cfgind++) {
+            ee = sk_OSSL_ECHSTORE_ENTRY_value(es->entries, cfgind);
+            clear = hpke_decrypt_encch(s, ee, extval,
+                aad_len, aad, forhrr, &clearlen);
+            if (clear != NULL) {
+                foundcfg = 1;
+                s->ext.ech.grease = OSSL_ECH_NOT_GREASE;
+                break;
+            }
+        }
+    }
+    OPENSSL_free(aad);
+    aad = NULL;
+    s->ext.ech.done = 1; /* decrypting worked or not, but we're done now */
+    s->ext.ech.grease = OSSL_ECH_IS_GREASE; /* if decrypt fails tee-up GREASE */
+    s->ext.ech.success = 0;
+    if (clear != NULL) {
+        s->ext.ech.grease = OSSL_ECH_NOT_GREASE;
+        s->ext.ech.success = 1;
+    }
+    OSSL_TRACE_BEGIN(TLS)
+    {
+        BIO_printf(trc_out, "EARLY: success: %d, assume_grease: %d, "
+                            "foundcfg: %d, cfgind: %d, clearlen: %zd, clear %p\n",
+            s->ext.ech.success, s->ext.ech.grease, foundcfg,
+            cfgind, clearlen, (void *)clear);
+    }
+    OSSL_TRACE_END(TLS);
+#ifdef OSSL_ECH_SUPERVERBOSE
+    if (foundcfg == 1 && clear != NULL) { /* Bit more logging */
+        ossl_ech_pbuf("local config_id", &ee->config_id, 1);
+        ossl_ech_pbuf("remote config_id", &extval->config_id, 1);
+        ossl_ech_pbuf("clear", clear, clearlen);
+    }
+#endif
+    ossl_ech_encch_free(extval);
+    OPENSSL_free(extval);
+    extval = NULL;
+    if (s->ext.ech.grease == OSSL_ECH_IS_GREASE) {
+        OPENSSL_free(clear);
+        return 1;
+    }
+    /* 4. if decrypt worked, de-compress cleartext to make up real inner CH */
+    if (ech_decode_inner(s, opd, opl, clear, clearlen) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    OPENSSL_free(clear);
+    clear = NULL;
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("Inner CH (decoded)", s->ext.ech.innerch,
+        s->ext.ech.innerch_len);
+#endif
+    if (PACKET_buf_init(newpkt, s->ext.ech.innerch,
+            s->ext.ech.innerch_len)
+        != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /* tls_process_client_hello doesn't want the message header, so skip it */
+    if (!PACKET_forward(newpkt, SSL3_HM_HEADER_LENGTH)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    if (ossl_ech_intbuf_add(s, s->ext.ech.innerch,
+            s->ext.ech.innerch_len, 0)
+        != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    return 1;
+err:
+    OPENSSL_free(aad);
+    if (extval != NULL) {
+        ossl_ech_encch_free(extval);
+        OPENSSL_free(extval);
+    }
+    OPENSSL_free(clear);
+    return 0;
+}
+
+int ossl_ech_intbuf_add(SSL_CONNECTION *s, const unsigned char *buf,
+    size_t blen, int hash_existing)
+{
+    EVP_MD_CTX *ctx = NULL;
+    EVP_MD *md = NULL;
+    unsigned int rv = 0, hashlen = 0;
+    unsigned char hashval[EVP_MAX_MD_SIZE], *t1;
+    size_t tlen;
+    WPACKET tpkt = { 0 };
+    BUF_MEM *tpkt_mem = NULL;
+
+    if (s == NULL || buf == NULL || blen == 0)
+        goto err;
+    if (hash_existing == 1) {
+        /* hash existing buffer, needed during HRR */
+        if (s->ext.ech.transbuf == NULL
+            || (md = (EVP_MD *)ssl_handshake_md(s)) == NULL
+            || (ctx = EVP_MD_CTX_new()) == NULL
+            || EVP_DigestInit_ex(ctx, md, NULL) <= 0
+            || EVP_DigestUpdate(ctx, s->ext.ech.transbuf,
+                   s->ext.ech.transbuf_len)
+                <= 0
+            || EVP_DigestFinal_ex(ctx, hashval, &hashlen) <= 0
+            || (tpkt_mem = BUF_MEM_new()) == NULL
+            || !WPACKET_init(&tpkt, tpkt_mem)
+            || !WPACKET_put_bytes_u8(&tpkt, SSL3_MT_MESSAGE_HASH)
+            || !WPACKET_put_bytes_u24(&tpkt, hashlen)
+            || !WPACKET_memcpy(&tpkt, hashval, hashlen)
+            || !WPACKET_get_length(&tpkt, &tlen)
+            || (t1 = OPENSSL_realloc(s->ext.ech.transbuf, tlen + blen)) == NULL)
+            goto err;
+        s->ext.ech.transbuf = t1;
+        memcpy(s->ext.ech.transbuf, tpkt_mem->data, tlen);
+        memcpy(s->ext.ech.transbuf + tlen, buf, blen);
+        s->ext.ech.transbuf_len = tlen + blen;
+    } else {
+        /* just add new octets */
+        if ((t1 = OPENSSL_realloc(s->ext.ech.transbuf,
+                 s->ext.ech.transbuf_len + blen))
+            == NULL)
+            goto err;
+        s->ext.ech.transbuf = t1;
+        memcpy(s->ext.ech.transbuf + s->ext.ech.transbuf_len, buf, blen);
+        s->ext.ech.transbuf_len += blen;
+    }
+    rv = 1;
+err:
+    BUF_MEM_free(tpkt_mem);
+    WPACKET_cleanup(&tpkt);
+    EVP_MD_CTX_free(ctx);
+    return rv;
+}
+
+int ossl_ech_intbuf_fetch(SSL_CONNECTION *s, unsigned char **buf, size_t *blen)
+{
+    if (s == NULL || buf == NULL || blen == NULL || s->ext.ech.transbuf == NULL)
+        return 0;
+    *buf = s->ext.ech.transbuf;
+    *blen = s->ext.ech.transbuf_len;
+    return 1;
+}
+
+int ossl_ech_stash_keyshares(SSL_CONNECTION *s)
+{
+    size_t i;
+
+    ech_free_stashed_key_shares(&s->ext.ech);
+    for (i = 0; i != s->s3.tmp.num_ks_pkey; i++) {
+        s->ext.ech.ks_pkey[i] = s->s3.tmp.ks_pkey[i];
+        if (EVP_PKEY_up_ref(s->ext.ech.ks_pkey[i]) != 1)
+            return 0;
+        s->ext.ech.ks_group_id[i] = s->s3.tmp.ks_group_id[i];
+    }
+    s->ext.ech.num_ks_pkey = s->s3.tmp.num_ks_pkey;
+    return 1;
+}
+
+int ossl_ech_unstash_keyshares(SSL_CONNECTION *s)
+{
+    size_t i;
+
+    for (i = 0; i != s->s3.tmp.num_ks_pkey; i++) {
+        EVP_PKEY_free(s->s3.tmp.ks_pkey[i]);
+        s->s3.tmp.ks_pkey[i] = NULL;
+    }
+    for (i = 0; i != s->ext.ech.num_ks_pkey; i++) {
+        s->s3.tmp.ks_pkey[i] = s->ext.ech.ks_pkey[i];
+        if (EVP_PKEY_up_ref(s->s3.tmp.ks_pkey[i]) != 1)
+            return 0;
+        s->s3.tmp.ks_group_id[i] = s->ext.ech.ks_group_id[i];
+    }
+    s->s3.tmp.num_ks_pkey = s->ext.ech.num_ks_pkey;
+    ech_free_stashed_key_shares(&s->ext.ech);
+    return 1;
+}
+#endif
diff --git a/deps/openssl/openssl/ssl/ech/ech_local.h b/deps/openssl/openssl/ssl/ech/ech_local.h
new file mode 100644
index 00000000000..270c98f6cbb
--- /dev/null
+++ b/deps/openssl/openssl/ssl/ech/ech_local.h
@@ -0,0 +1,385 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * Internal data structures and prototypes for handling
+ * Encrypted ClientHello (ECH)
+ */
+#ifndef OPENSSL_NO_ECH
+
+#ifndef HEADER_ECH_LOCAL_H
+#define HEADER_ECH_LOCAL_H
+
+#include <openssl/ssl.h>
+#include <openssl/ech.h>
+#include <openssl/hpke.h>
+
+#include <internal/packet.h>
+#include <internal/ssl.h>
+#include <internal/statem.h>
+
+/*
+ * Define this to get loads more lines of tracing which is
+ * very useful for interop.
+ * This needs tracing enabled at build time, e.g.:
+ *          $ ./config enable-ssl-trace enable-trace
+ * This added tracing will finally (mostly) disappear once the ECH RFC
+ * has issued, but is very useful for interop testing so some of it might
+ * be retained.
+ */
+#define OSSL_ECH_SUPERVERBOSE
+
+/* values for s->ext.ech.grease */
+#define OSSL_ECH_GREASE_UNKNOWN -1 /* when we're not yet sure */
+#define OSSL_ECH_NOT_GREASE 0 /* when decryption worked */
+#define OSSL_ECH_IS_GREASE 1 /* when decryption failed or GREASE wanted */
+
+/* value for uninitialised ECH version */
+#define OSSL_ECH_type_unknown 0xffff
+/* value for not yet set ECH config_id */
+#define OSSL_ECH_config_id_unset -1
+
+#define OSSL_ECH_OUTER_CH_TYPE 0 /* outer ECHClientHello enum */
+#define OSSL_ECH_INNER_CH_TYPE 1 /* inner ECHClientHello enum */
+#define OSSL_ECH_UNKNOWN_CH_TYPE -1 /* we don't know yet */
+
+#define OSSL_ECH_CIPHER_LEN 4 /* ECHCipher length (2 for kdf, 2 for aead) */
+
+#define OSSL_ECH_SIGNAL_LEN 8 /* length of ECH acceptance signal */
+
+/* size of string buffer returned via ECH callback */
+#define OSSL_ECH_PBUF_SIZE 8 * 1024
+
+#ifndef CLIENT_VERSION_LEN
+/*
+ * This is the legacy version length, i.e. len(0x0303). The same
+ * label is used in e.g. test/sslapitest.c and elsewhere but not
+ * defined in a header file I could find.
+ */
+#define CLIENT_VERSION_LEN 2
+#endif
+
+/*
+ * Reminder of what goes in DNS for ECH RFC XXXX
+ *
+ *     opaque HpkePublicKey<1..2^16-1>;
+ *     uint16 HpkeKemId;  // Defined in I-D.irtf-cfrg-hpke
+ *     uint16 HpkeKdfId;  // Defined in I-D.irtf-cfrg-hpke
+ *     uint16 HpkeAeadId; // Defined in I-D.irtf-cfrg-hpke
+ *     struct {
+ *         HpkeKdfId kdf_id;
+ *         HpkeAeadId aead_id;
+ *     } HpkeSymmetricCipherSuite;
+ *     struct {
+ *         uint8 config_id;
+ *         HpkeKemId kem_id;
+ *         HpkePublicKey public_key;
+ *         HpkeSymmetricCipherSuite cipher_suites<4..2^16-4>;
+ *     } HpkeKeyConfig;
+ *     struct {
+ *         HpkeKeyConfig key_config;
+ *         uint8 maximum_name_length;
+ *         opaque public_name<1..255>;
+ *         Extension extensions<0..2^16-1>;
+ *     } ECHConfigContents;
+ *     struct {
+ *         uint16 version;
+ *         uint16 length;
+ *         select (ECHConfig.version) {
+ *           case 0xfe0d: ECHConfigContents contents;
+ *         }
+ *     } ECHConfig;
+ *     ECHConfig ECHConfigList<1..2^16-1>;
+ */
+
+typedef struct ossl_echext_st {
+    uint16_t type;
+    uint16_t len;
+    unsigned char *val;
+} OSSL_ECHEXT;
+
+DEFINE_STACK_OF(OSSL_ECHEXT)
+
+typedef struct ossl_echstore_entry_st {
+    uint16_t version; /* 0xfe0d for RFC XXXX */
+    char *public_name;
+    size_t pub_len;
+    unsigned char *pub;
+    unsigned int nsuites;
+    OSSL_HPKE_SUITE *suites;
+    uint8_t max_name_length;
+    uint8_t config_id;
+    STACK_OF(OSSL_ECHEXT) *exts;
+    time_t loadtime; /* time public and private key were loaded from file */
+    EVP_PKEY *keyshare; /* long(ish) term ECH private keyshare on a server */
+    int for_retry; /* whether to use this ECHConfigList in a retry */
+    size_t encoded_len; /* length of overall encoded content */
+    unsigned char *encoded; /* overall encoded content */
+} OSSL_ECHSTORE_ENTRY;
+
+/*
+ * What we send in the ech CH extension:
+ *     enum { outer(0), inner(1) } ECHClientHelloType;
+ *     struct {
+ *        ECHClientHelloType type;
+ *        select (ECHClientHello.type) {
+ *            case outer:
+ *                HpkeSymmetricCipherSuite cipher_suite;
+ *                uint8 config_id;
+ *                opaque enc<0..2^16-1>;
+ *                opaque payload<1..2^16-1>;
+ *            case inner:
+ *                Empty;
+ *        };
+ *     } ECHClientHello;
+ *
+ */
+typedef struct ech_encch_st {
+    uint16_t kdf_id; /* ciphersuite  */
+    uint16_t aead_id; /* ciphersuite  */
+    uint8_t config_id; /* (maybe) identifies DNS RR value used */
+    size_t enc_len; /* public share */
+    unsigned char *enc; /* public share for sender */
+    size_t payload_len; /* ciphertext  */
+    unsigned char *payload; /* ciphertext  */
+} OSSL_ECH_ENCCH;
+
+DEFINE_STACK_OF(OSSL_ECHSTORE_ENTRY)
+
+struct ossl_echstore_st {
+    STACK_OF(OSSL_ECHSTORE_ENTRY) *entries;
+    OSSL_LIB_CTX *libctx;
+    char *propq;
+};
+
+/* ECH details associated with an SSL_CTX */
+typedef struct ossl_ech_ctx_st {
+    /*
+     * We could make es ref-counted, but that seems like a premature
+     * optimisation, given we don't currently expect many applications
+     * to have many SSL_CTX/SSL structures using many ECH configurations.
+     * Could fairly easily be done if experience warrants.
+     */
+    OSSL_ECHSTORE *es; /* ECHConfigList details */
+    unsigned char *alpn_outer;
+    size_t alpn_outer_len;
+    SSL_ech_cb_func cb; /* callback function for when ECH "done" */
+} OSSL_ECH_CTX;
+
+/* ECH details associated with an SSL_CONNECTION */
+typedef struct ossl_ech_conn_st {
+    /*
+     * We could make es ref-counted, but that seems like a premature
+     * optimisation, given we don't currently expect many applications
+     * to have many SSL_CTX/SSL structures using many ECH configurations.
+     * Could fairly easily be done if experience warrants.
+     */
+    OSSL_ECHSTORE *es; /* ECHConfigList details */
+    int no_outer; /* set to 1 if we should send no outer SNI at all */
+    char *outer_hostname;
+    unsigned char *alpn_outer;
+    size_t alpn_outer_len;
+    SSL_ech_cb_func cb; /* callback function for when ECH "done" */
+    /*
+     * If ECH fails, then we switch to verifying the cert for the
+     * outer_hostname, meanwhile we still want to be able to trace
+     * the value we tried as the inner SNI for debug purposes
+     */
+    char *former_inner;
+    /* inner CH transcript buffer */
+    unsigned char *transbuf;
+    size_t transbuf_len;
+    /* inner ClientHello before ECH compression */
+    unsigned char *innerch;
+    size_t innerch_len;
+    /* encoded inner CH */
+    unsigned char *encoded_inner;
+    size_t encoded_inner_len;
+    /* lengths calculated early, used when encrypting at end of processing */
+    size_t clearlen;
+    size_t cipherlen;
+    /* location to put ciphertext, initially filled with zeros */
+    size_t cipher_offset;
+    /*
+     * Extensions are "outer-only" if the value is only sent in the
+     * outer CH and only the type is sent in the inner CH.
+     * We use this array to keep track of the extension types that
+     * have values only in the outer CH
+     * Currently, this is basically controlled at compile time, but
+     * in a way that could be varied, or, in future, put under
+     * run-time control, so having this isn't so much an overhead.
+     */
+    uint16_t outer_only[OSSL_ECH_OUTERS_MAX];
+    size_t n_outer_only; /* the number of outer_only extensions so far */
+    /*
+     * We store/access the index of the extension handler in
+     * s->ext.ech.ext_ind, as we'd otherwise not know it here.
+     * Be nice were there a better way to handle that.
+     * Index of the current extension's entry in ext_defs - this is
+     * to avoid the need to change a couple of extension APIs.
+     */
+    int ext_ind;
+    /* ECH status vars */
+    int ch_depth; /* set during CH creation, 0: doing outer, 1: doing inner */
+    int attempted; /* 1 if ECH was or is being attempted, 0 otherwise */
+    int done; /* 1 if we've finished ECH calculations, 0 otherwise */
+    uint16_t attempted_type; /* ECH version used */
+    int attempted_cid; /* ECH config id sent/rx'd */
+    int backend; /* 1 if we're a server backend in split-mode, 0 otherwise */
+    /* When using a PSK stash the tick_identity from inner, for outer */
+    int tick_identity;
+    /*
+     * success is 1 if ECH succeeded, 0 otherwise, on the server this
+     * is known early, on the client we need to wait for the ECH confirm
+     * calculation based on the SH (or 2nd SH in case of HRR)
+     */
+    int success;
+    /*
+     * we set this when we've gotten to the end of the handshake and
+     * the only thing that went wrong was ECH - in that case we're
+     * ok to provide the retry-configs to the client, otherwise better
+     * not.
+     */
+    int retry_configs_ok;
+    int inner_ech_seen_ok; /* set if we see inner ECH as expected */
+    int grease; /* 1 if we're GREASEing, 0 otherwise */
+    char *grease_suite; /* HPKE suite string for GREASEing */
+    unsigned char *sent; /* GREASEy ECH value sent, in case needed for re-tx */
+    size_t sent_len;
+    unsigned char *returned; /* binary ECHConfigList retry-configs value */
+    size_t returned_len;
+    unsigned char *pub; /* client ephemeral public kept by server in case HRR */
+    size_t pub_len;
+    OSSL_HPKE_CTX *hpke_ctx; /* HPKE context, needed for HRR */
+    /*
+     * Offsets of various things we need to know about in an inbound
+     * ClientHello (CH) plus the type of ECH and whether that CH is an inner or
+     * outer CH. We find these once for the outer CH, by roughly parsing the CH
+     * so store them for later re-use. We need to re-do this parsing when we
+     * get the 2nd CH in the case of HRR, and when we move to processing the
+     * inner CH after successful ECH decyption, so we have a flag to say if
+     * we've done the work or not.
+     */
+    int ch_offsets_done;
+    size_t sessid_off; /* offset of session_id length */
+    size_t exts_off; /* to offset of extensions */
+    size_t ech_off; /* offset of ECH */
+    size_t sni_off; /* offset of (outer) SNI */
+    int echtype; /* ext type of the ECH */
+    int inner; /* 1 if the ECH is marked as an inner, 0 for outer */
+    /*
+     * A pointer to, and copy of, the hrrsignal from an HRR message.
+     * We need both, as we zero-out the octets when re-calculating and
+     * may need to put back what the server included so the transcript
+     * is correct when ECH acceptance failed.
+     */
+    unsigned char *hrrsignal_p;
+    unsigned char hrrsignal[OSSL_ECH_SIGNAL_LEN];
+    /*
+     * Fields that differ on client between inner and outer that we need to
+     * keep and swap over IFF ECH has succeeded. Same names chosen as are
+     * used in SSL_CONNECTION
+     */
+    EVP_PKEY *ks_pkey[OPENSSL_CLIENT_MAX_KEY_SHARES];
+    /* The IDs of the keyshare keys */
+    uint16_t ks_group_id[OPENSSL_CLIENT_MAX_KEY_SHARES];
+    size_t num_ks_pkey; /* how many keyshares are there */
+    unsigned char client_random[SSL3_RANDOM_SIZE]; /* CH random */
+} OSSL_ECH_CONN;
+
+/* Return values from ossl_ech_same_ext */
+#define OSSL_ECH_SAME_EXT_ERR 0 /* bummer something wrong */
+#define OSSL_ECH_SAME_EXT_DONE 1 /* proceed with same value in inner/outer */
+#define OSSL_ECH_SAME_EXT_CONTINUE 2 /* generate a new value for outer CH */
+
+/*
+ * During extension construction (in extensions_clnt.c, and surprisingly also in
+ * extensions.c), we need to handle inner/outer CH cloning - ossl_ech_same_ext
+ * will (depending on compile time handling options) copy the value from
+ * CH.inner to CH.outer or else processing will continue, for a 2nd call,
+ * likely generating a fresh value for the outer CH. The fresh value could well
+ * be the same as in the inner.
+ *
+ * This macro should be called in each _ctos_ function that doesn't explicitly
+ * have special ECH handling. There are some _ctos_ functions that are called
+ * from a server, but we don't want to do anything in such cases. We also
+ * screen out cases where the context is not handling the ClientHello.
+ *
+ * Note that the placement of this macro needs a bit of thought - it has to go
+ * after declarations (to keep the ansi-c compile happy) and also after any
+ * checks that result in the extension not being sent but before any relevant
+ * state changes that would affect a possible 2nd call to the constructor.
+ * Luckily, that's usually not too hard, but it's not mechanical.
+ */
+#define ECH_SAME_EXT(s, context, pkt)                         \
+    if (context == SSL_EXT_CLIENT_HELLO && !s->server         \
+        && s->ext.ech.es != NULL && s->ext.ech.grease == 0) { \
+        int ech_iosame_rv = ossl_ech_same_ext(s, pkt);        \
+                                                              \
+        if (ech_iosame_rv == OSSL_ECH_SAME_EXT_ERR)           \
+            return EXT_RETURN_FAIL;                           \
+        if (ech_iosame_rv == OSSL_ECH_SAME_EXT_DONE)          \
+            return EXT_RETURN_SENT;                           \
+        /* otherwise continue as normal */                    \
+    }
+
+/* Internal ECH APIs */
+
+OSSL_ECHSTORE *ossl_echstore_dup(const OSSL_ECHSTORE *old);
+void ossl_echstore_entry_free(OSSL_ECHSTORE_ENTRY *ee);
+void ossl_ech_ctx_clear(OSSL_ECH_CTX *ce);
+int ossl_ech_conn_init(SSL_CONNECTION *s, SSL_CTX *ctx,
+    const SSL_METHOD *method);
+void ossl_ech_conn_clear(OSSL_ECH_CONN *ec);
+void ossl_echext_free(OSSL_ECHEXT *e);
+OSSL_ECHEXT *ossl_echext_dup(const OSSL_ECHEXT *src);
+#ifdef OSSL_ECH_SUPERVERBOSE
+void ossl_ech_pbuf(const char *msg,
+    const unsigned char *buf, const size_t blen);
+#endif
+int ossl_ech_get_retry_configs(SSL_CONNECTION *s, unsigned char **rcfgs,
+    size_t *rcfgslen);
+int ossl_ech_send_grease(SSL_CONNECTION *s, WPACKET *pkt);
+int ossl_ech_pick_matching_cfg(SSL_CONNECTION *s, OSSL_ECHSTORE_ENTRY **ee,
+    OSSL_HPKE_SUITE *suite);
+int ossl_ech_encode_inner(SSL_CONNECTION *s, unsigned char **encoded,
+    size_t *encoded_len);
+int ossl_ech_find_confirm(SSL_CONNECTION *s, int hrr,
+    unsigned char acbuf[OSSL_ECH_SIGNAL_LEN]);
+int ossl_ech_reset_hs_buffer(SSL_CONNECTION *s, const unsigned char *buf,
+    size_t blen);
+int ossl_ech_aad_and_encrypt(SSL_CONNECTION *s, WPACKET *pkt);
+int ossl_ech_swaperoo(SSL_CONNECTION *s);
+int ossl_ech_calc_confirm(SSL_CONNECTION *s, int for_hrr,
+    unsigned char acbuf[OSSL_ECH_SIGNAL_LEN],
+    const size_t shlen);
+
+/* these are internal but located in ssl/statem/extensions.c */
+int ossl_ech_same_ext(SSL_CONNECTION *s, WPACKET *pkt);
+int ossl_ech_same_key_share(void);
+int ossl_ech_2bcompressed(size_t ind);
+int ossl_ech_copy_inner2outer(SSL_CONNECTION *s, uint16_t ext_type, int ind,
+    WPACKET *pkt);
+
+int ossl_ech_get_ch_offsets(SSL_CONNECTION *s, PACKET *pkt, size_t *sessid,
+    size_t *exts, size_t *echoffset, uint16_t *echtype,
+    int *inner, size_t *snioffset);
+int ossl_ech_early_decrypt(SSL_CONNECTION *s, PACKET *outerpkt, PACKET *newpkt);
+void ossl_ech_status_print(BIO *out, SSL_CONNECTION *s, int selector);
+
+int ossl_ech_intbuf_add(SSL_CONNECTION *s, const unsigned char *buf,
+    size_t blen, int hash_existing);
+int ossl_ech_intbuf_fetch(SSL_CONNECTION *s, unsigned char **buf, size_t *blen);
+size_t ossl_ech_calc_padding(SSL_CONNECTION *s, OSSL_ECHSTORE_ENTRY *ee,
+    size_t encoded_len);
+int ossl_ech_stash_keyshares(SSL_CONNECTION *s);
+int ossl_ech_unstash_keyshares(SSL_CONNECTION *s);
+
+#endif
+#endif
diff --git a/deps/openssl/openssl/ssl/ech/ech_ssl_apis.c b/deps/openssl/openssl/ssl/ech/ech_ssl_apis.c
new file mode 100644
index 00000000000..09440df8585
--- /dev/null
+++ b/deps/openssl/openssl/ssl/ech/ech_ssl_apis.c
@@ -0,0 +1,438 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/ssl.h>
+#include <openssl/ech.h>
+#include "internal/ssl_unwrap.h"
+#include "../ssl_local.h"
+
+int SSL_CTX_set1_echstore(SSL_CTX *ctx, OSSL_ECHSTORE *es)
+{
+    if (ctx == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+    OSSL_ECHSTORE_free(ctx->ext.ech.es);
+    ctx->ext.ech.es = NULL;
+    if (es == NULL)
+        return 1;
+    if ((ctx->ext.ech.es = ossl_echstore_dup(es)) == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    return 1;
+}
+
+int SSL_set1_echstore(SSL *ssl, OSSL_ECHSTORE *es)
+{
+    SSL_CONNECTION *s;
+
+    s = SSL_CONNECTION_FROM_SSL(ssl);
+    if (s == NULL)
+        return 0;
+    OSSL_ECHSTORE_free(s->ext.ech.es);
+    s->ext.ech.es = NULL;
+    if (es == NULL)
+        return 1;
+    if ((s->ext.ech.es = ossl_echstore_dup(es)) == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    /*
+     * Here, and below, if the application calls an API that implies it
+     * wants to try ECH, then we set attempted to 1
+     */
+    s->ext.ech.attempted = 1;
+    return 1;
+}
+
+OSSL_ECHSTORE *SSL_CTX_get1_echstore(const SSL_CTX *ctx)
+{
+    OSSL_ECHSTORE *dup = NULL;
+
+    if (ctx == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return NULL;
+    }
+    if (ctx->ext.ech.es == NULL)
+        return NULL;
+    if ((dup = ossl_echstore_dup(ctx->ext.ech.es)) == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        return NULL;
+    }
+    return dup;
+}
+
+OSSL_ECHSTORE *SSL_get1_echstore(const SSL *ssl)
+{
+    SSL_CONNECTION *s;
+    OSSL_ECHSTORE *dup = NULL;
+
+    s = SSL_CONNECTION_FROM_SSL(ssl);
+    if (s == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return NULL;
+    }
+    if (s->ext.ech.es == NULL)
+        return NULL;
+    if ((dup = ossl_echstore_dup(s->ext.ech.es)) == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        return NULL;
+    }
+    return dup;
+}
+
+int SSL_ech_set1_server_names(SSL *ssl, const char *inner_name,
+    const char *outer_name, int no_outer)
+{
+    SSL_CONNECTION *s;
+
+    s = SSL_CONNECTION_FROM_SSL(ssl);
+    if (s == NULL)
+        return 0;
+    OPENSSL_free(s->ext.hostname);
+    s->ext.hostname = NULL;
+    if (inner_name != NULL) {
+        s->ext.hostname = OPENSSL_strdup(inner_name);
+        if (s->ext.hostname == NULL)
+            return 0;
+    }
+    OPENSSL_free(s->ext.ech.outer_hostname);
+    s->ext.ech.outer_hostname = NULL;
+    if (no_outer == 0 && outer_name != NULL && strlen(outer_name) > 0) {
+        s->ext.ech.outer_hostname = OPENSSL_strdup(outer_name);
+        if (s->ext.ech.outer_hostname == NULL)
+            return 0;
+    }
+    s->ext.ech.no_outer = no_outer;
+    s->ext.ech.attempted = 1;
+    return 1;
+}
+
+int SSL_ech_set1_outer_server_name(SSL *ssl, const char *outer_name,
+    int no_outer)
+{
+    SSL_CONNECTION *s;
+
+    s = SSL_CONNECTION_FROM_SSL(ssl);
+    if (s == NULL)
+        return 0;
+    OPENSSL_free(s->ext.ech.outer_hostname);
+    s->ext.ech.outer_hostname = NULL;
+    if (no_outer == 0 && outer_name != NULL && strlen(outer_name) > 0) {
+        s->ext.ech.outer_hostname = OPENSSL_strdup(outer_name);
+        if (s->ext.ech.outer_hostname == NULL)
+            return 0;
+    }
+    s->ext.ech.no_outer = no_outer;
+    s->ext.ech.attempted = 1;
+    return 1;
+}
+
+/*
+ * Note that this function returns 1 for success and 0 for error. This
+ * contrasts with SSL_set1_alpn_protos() which (unusually for OpenSSL)
+ * returns 0 for success and 1 on error.
+ */
+int SSL_ech_set1_outer_alpn_protos(SSL *ssl, const unsigned char *protos,
+    const size_t protos_len)
+{
+    SSL_CONNECTION *s;
+
+    s = SSL_CONNECTION_FROM_SSL(ssl);
+    if (s == NULL)
+        return 0;
+    OPENSSL_free(s->ext.ech.alpn_outer);
+    s->ext.ech.alpn_outer = NULL;
+    if (protos == NULL)
+        return 1;
+    if (protos_len == 0) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+    s->ext.ech.alpn_outer = OPENSSL_memdup(protos, protos_len);
+    if (s->ext.ech.alpn_outer == NULL)
+        return 0;
+    s->ext.ech.alpn_outer_len = protos_len;
+    s->ext.ech.attempted = 1;
+    return 1;
+}
+
+int SSL_ech_get1_status(SSL *ssl, char **inner_sni, char **outer_sni)
+{
+    char *sinner = NULL;
+    char *souter = NULL;
+    SSL_CONNECTION *s = SSL_CONNECTION_FROM_SSL(ssl);
+
+    if (s == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return SSL_ECH_STATUS_FAILED;
+    }
+    if (outer_sni == NULL || inner_sni == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        return SSL_ECH_STATUS_FAILED;
+    }
+    *outer_sni = NULL;
+    *inner_sni = NULL;
+    if (s->ext.ech.grease == OSSL_ECH_IS_GREASE) {
+        if (s->ext.ech.returned != NULL)
+            return SSL_ECH_STATUS_GREASE_ECH;
+        return SSL_ECH_STATUS_GREASE;
+    }
+    if ((s->options & SSL_OP_ECH_GREASE) != 0 && s->ext.ech.attempted != 1)
+        return SSL_ECH_STATUS_GREASE;
+    if (s->ext.ech.backend == 1) {
+        if (s->ext.hostname != NULL
+            && (*inner_sni = OPENSSL_strdup(s->ext.hostname)) == NULL) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            return SSL_ECH_STATUS_FAILED;
+        }
+        return SSL_ECH_STATUS_BACKEND;
+    }
+    if (s->ext.ech.es == NULL)
+        return SSL_ECH_STATUS_NOT_CONFIGURED;
+    /* Set output vars - note we may be pointing to NULL which is fine */
+    if (s->server == 0) {
+        sinner = s->ext.hostname;
+        if (s->ext.ech.attempted == 1 && s->ext.ech.success == 0)
+            sinner = s->ext.ech.former_inner;
+        if (s->ext.ech.no_outer == 0)
+            souter = s->ext.ech.outer_hostname;
+        else
+            souter = NULL;
+    } else {
+        if (s->ext.ech.es != NULL && s->ext.ech.success == 1) {
+            sinner = s->ext.hostname;
+            souter = s->ext.ech.outer_hostname;
+        }
+    }
+    if (s->ext.ech.es != NULL && s->ext.ech.attempted == 1
+        && s->ext.ech.attempted_type == TLSEXT_TYPE_ech
+        && s->ext.ech.grease != OSSL_ECH_IS_GREASE) {
+        long vr = X509_V_OK;
+
+        /*
+         * The SUCCESS vs BAD_NAME distinction reflects whether the peer's
+         * certificate verified against the (inner) SNI -- a client-side verdict.
+         * On the server SSL_get_verify_result() is the client certificate's
+         * result, unrelated to ECH, so it is not consulted here.
+         */
+        if (s->server == 0)
+            vr = SSL_get_verify_result(ssl);
+        if (sinner != NULL
+            && (*inner_sni = OPENSSL_strdup(sinner)) == NULL) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            return SSL_ECH_STATUS_FAILED;
+        }
+        if (souter != NULL
+            && (*outer_sni = OPENSSL_strdup(souter)) == NULL) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            return SSL_ECH_STATUS_FAILED;
+        }
+        if (s->ext.ech.success == 1) {
+            if (vr == X509_V_OK)
+                return SSL_ECH_STATUS_SUCCESS;
+            else
+                return SSL_ECH_STATUS_BAD_NAME;
+        } else {
+            if (vr == X509_V_OK && s->ext.ech.returned != NULL)
+                return SSL_ECH_STATUS_FAILED_ECH;
+            else if (vr != X509_V_OK && s->ext.ech.returned != NULL)
+                return SSL_ECH_STATUS_FAILED_ECH_BAD_NAME;
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            return SSL_ECH_STATUS_FAILED;
+        }
+    }
+    return SSL_ECH_STATUS_NOT_TRIED;
+}
+
+int SSL_ech_set1_grease_suite(SSL *ssl, const char *suite)
+{
+    SSL_CONNECTION *s;
+    OSSL_HPKE_SUITE hpke_suite_in = OSSL_HPKE_SUITE_DEFAULT;
+
+    s = SSL_CONNECTION_FROM_SSL(ssl);
+    if (s == NULL)
+        return 0;
+    /* check suite makes sense */
+    if (OSSL_HPKE_str2suite(suite, &hpke_suite_in) != 1) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+    OPENSSL_free(s->ext.ech.grease_suite);
+    s->ext.ech.grease_suite = NULL;
+    if (suite == NULL)
+        return 1;
+    s->ext.ech.grease_suite = OPENSSL_strdup(suite);
+    if (s->ext.ech.grease_suite == NULL)
+        return 0;
+    s->ext.ech.grease = OSSL_ECH_IS_GREASE;
+    return 1;
+}
+
+int SSL_ech_set_grease_type(SSL *ssl, uint16_t type)
+{
+    SSL_CONNECTION *s;
+
+    s = SSL_CONNECTION_FROM_SSL(ssl);
+    if (s == NULL)
+        return 0;
+    s->ext.ech.attempted_type = type;
+    s->ext.ech.grease = OSSL_ECH_IS_GREASE;
+    return 1;
+}
+
+void SSL_ech_set_callback(SSL *ssl, SSL_ech_cb_func f)
+{
+    SSL_CONNECTION *s;
+
+    s = SSL_CONNECTION_FROM_SSL(ssl);
+    if (s == NULL)
+        return;
+    s->ext.ech.cb = f;
+    return;
+}
+
+int SSL_ech_get1_retry_config(SSL *ssl, unsigned char **ec, size_t *eclen)
+{
+    SSL_CONNECTION *s;
+    OSSL_ECHSTORE *ve = NULL;
+    BIO *in = NULL;
+    int rv = 0;
+    OSSL_LIB_CTX *libctx = NULL;
+    const char *propq = NULL;
+
+    s = SSL_CONNECTION_FROM_SSL(ssl);
+    if (s == NULL || ec == NULL || eclen == NULL
+        || s->ext.ech.returned_len > INT_MAX) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        goto err;
+    }
+    if (s->ext.ech.returned == NULL) {
+        *ec = NULL;
+        *eclen = 0;
+        return 1;
+    }
+    /*
+     * before returning retry-configs check we're in a good
+     * state - either the session has worked, or else it
+     * failed but ECH was the only failure (we only set the
+     * retry_configs_ok flag when all else worked and we're
+     * about to send the ECH required alert)
+     */
+    if (SSL_is_init_finished(ssl) != 1 && s->ext.ech.retry_configs_ok != 1) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_OSSL_STORE_LIB);
+        goto err;
+    }
+    /*
+     * To not hand rubbish to application, we'll decode the value we have
+     * so only syntactically good things are passed up. We won't insist
+     * though that every entry in the retry_config list seems good - it
+     * could be that e.g. one is a newer version than we support now,
+     * and letting the application see that might cause someone to do an
+     * upgrade.
+     */
+    if (s->ext.ech.es != NULL) {
+        libctx = s->ext.ech.es->libctx;
+        propq = s->ext.ech.es->propq;
+    }
+    if ((in = BIO_new(BIO_s_mem())) == NULL
+        || BIO_write(in, s->ext.ech.returned, (int)s->ext.ech.returned_len) <= 0
+        || (ve = OSSL_ECHSTORE_new(libctx, propq)) == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    if (OSSL_ECHSTORE_read_echconfiglist(ve, in) != 1) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /* all good, copy and return */
+    *ec = OPENSSL_memdup(s->ext.ech.returned, s->ext.ech.returned_len);
+    if (*ec == NULL)
+        goto err;
+    *eclen = s->ext.ech.returned_len;
+    rv = 1;
+err:
+    OSSL_ECHSTORE_free(ve);
+    BIO_free_all(in);
+    return rv;
+}
+
+/*
+ * Note that this function returns 1 for success and 0 for error. This
+ * contrasts with SSL_CTX_set1_alpn_protos() which (unusually for OpenSSL)
+ * returns 0 for success and 1 on error.
+ */
+int SSL_CTX_ech_set1_outer_alpn_protos(SSL_CTX *ctx,
+    const unsigned char *protos,
+    const size_t protos_len)
+{
+    if (ctx == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+    OPENSSL_free(ctx->ext.ech.alpn_outer);
+    ctx->ext.ech.alpn_outer = NULL;
+    if (protos == NULL)
+        return 1;
+    if (protos_len == 0) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+    ctx->ext.ech.alpn_outer = OPENSSL_memdup(protos, protos_len);
+    if (ctx->ext.ech.alpn_outer == NULL)
+        return 0;
+    ctx->ext.ech.alpn_outer_len = protos_len;
+    return 1;
+}
+
+void SSL_CTX_ech_set_callback(SSL_CTX *ctx, SSL_ech_cb_func f)
+{
+    if (ctx == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return;
+    }
+    ctx->ext.ech.cb = f;
+    return;
+}
+
+int SSL_set1_ech_config_list(SSL *ssl, const uint8_t *ecl, size_t ecl_len)
+{
+    int rv = 0;
+    SSL_CONNECTION *s;
+    OSSL_ECHSTORE *es = NULL;
+    BIO *es_in = NULL;
+
+    s = SSL_CONNECTION_FROM_SSL(ssl);
+    if (s == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        goto err;
+    }
+    if (ecl == NULL) {
+        OSSL_ECHSTORE_free(s->ext.ech.es);
+        s->ext.ech.es = NULL;
+        return 1;
+    }
+    if (ecl_len == 0 || ecl_len > INT_MAX) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        goto err;
+    }
+    if ((es_in = BIO_new_mem_buf(ecl, (int)ecl_len)) == NULL
+        || (es = OSSL_ECHSTORE_new(NULL, NULL)) == NULL
+        || OSSL_ECHSTORE_read_echconfiglist(es, es_in) != 1
+        || SSL_set1_echstore(ssl, es) != 1) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    rv = 1;
+err:
+    OSSL_ECHSTORE_free(es);
+    BIO_free_all(es_in);
+    return rv;
+}
diff --git a/deps/openssl/openssl/ssl/ech/ech_store.c b/deps/openssl/openssl/ssl/ech/ech_store.c
new file mode 100644
index 00000000000..07a04d77f69
--- /dev/null
+++ b/deps/openssl/openssl/ssl/ech/ech_store.c
@@ -0,0 +1,1193 @@
+/*
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/ssl.h>
+#include <openssl/ech.h>
+#include "../ssl_local.h"
+#include "ech_local.h"
+#include <openssl/rand.h>
+#include <openssl/evp.h>
+#include <openssl/core_names.h>
+
+/* a size for some crypto vars */
+#define OSSL_ECH_CRYPTO_VAR_SIZE 2048
+
+/*
+ * Used for ech_bio2buf, when reading from a BIO we allocate in chunks sized
+ * as per below, with a max number of chunks as indicated, we don't expect to
+ * go beyond one chunk in almost all cases
+ */
+#define OSSL_ECH_BUFCHUNK 512
+#define OSSL_ECH_MAXITER 32
+
+/*
+ * ECHConfigList input to OSSL_ECHSTORE_read_echconfiglist()
+ * can be either binary encoded ECHConfigList or a base64
+ * encoded ECHConfigList.
+ */
+#define OSSL_ECH_FMT_BIN 1 /* binary ECHConfigList */
+#define OSSL_ECH_FMT_B64TXT 2 /* base64 ECHConfigList */
+
+/*
+ * Telltales we use when guessing which form of encoded input we've
+ * been given for an RR value or ECHConfig.
+ * We give these the EBCDIC treatment as well - why not? :-)
+ */
+static const char B64_alphabet[] = "\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52"
+                                   "\x53\x54\x55\x56\x57\x58\x59\x5a\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a"
+                                   "\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x30\x31"
+                                   "\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d\x3b";
+
+#ifndef TLSEXT_MINLEN_host_name
+/* The shortest DNS name we allow, e.g. "a.bc" */
+#define TLSEXT_MINLEN_host_name 4
+#endif
+
+/*
+ * local functions - public APIs are at the end
+ */
+
+void ossl_echext_free(OSSL_ECHEXT *e)
+{
+    if (e == NULL)
+        return;
+    OPENSSL_free(e->val);
+    OPENSSL_free(e);
+    return;
+}
+
+OSSL_ECHEXT *ossl_echext_dup(const OSSL_ECHEXT *src)
+{
+    OSSL_ECHEXT *ext = OPENSSL_zalloc(sizeof(*src));
+
+    if (ext == NULL)
+        return NULL;
+    *ext = *src;
+    ext->val = NULL;
+    if (ext->len != 0) {
+        ext->val = OPENSSL_memdup(src->val, src->len);
+        if (ext->val == NULL) {
+            ossl_echext_free(ext);
+            return NULL;
+        }
+    }
+    return ext;
+}
+
+void ossl_echstore_entry_free(OSSL_ECHSTORE_ENTRY *ee)
+{
+    if (ee == NULL)
+        return;
+    OPENSSL_free(ee->public_name);
+    OPENSSL_free(ee->pub);
+    EVP_PKEY_free(ee->keyshare);
+    OPENSSL_free(ee->encoded);
+    OPENSSL_free(ee->suites);
+    sk_OSSL_ECHEXT_pop_free(ee->exts, ossl_echext_free);
+    OPENSSL_free(ee);
+    return;
+}
+
+/*
+ * @brief Read a buffer from an input 'till eof
+ * @param in is the BIO input
+ * @param buf is where to put the buffer, allocated inside here
+ * @param len is the length of that buffer
+ *
+ * This is intended for small inputs, either files or buffers and
+ * not other kinds of BIO.
+ */
+static int ech_bio2buf(BIO *in, unsigned char **buf, size_t *len)
+{
+    unsigned char *lptr = NULL, *lbuf = NULL, *tmp = NULL;
+    size_t sofar = 0, readbytes = 0;
+    int done = 0, brv, iter = 0;
+
+    if (buf == NULL || len == NULL)
+        return 0;
+    sofar = OSSL_ECH_BUFCHUNK;
+    lbuf = OPENSSL_zalloc(sofar);
+    if (lbuf == NULL)
+        return 0;
+    lptr = lbuf;
+    while (!BIO_eof(in) && !done && iter++ < OSSL_ECH_MAXITER) {
+        brv = BIO_read_ex(in, lptr, OSSL_ECH_BUFCHUNK, &readbytes);
+        if (brv != 1)
+            goto err;
+        if (BIO_eof(in) || readbytes < OSSL_ECH_BUFCHUNK) {
+            done = 1;
+            break;
+        }
+        sofar += OSSL_ECH_BUFCHUNK;
+        tmp = OPENSSL_realloc(lbuf, sofar);
+        if (tmp == NULL)
+            goto err;
+        lbuf = tmp;
+        lptr = lbuf + sofar - OSSL_ECH_BUFCHUNK;
+    }
+    if (BIO_eof(in) && done == 1) {
+        *len = sofar + readbytes - OSSL_ECH_BUFCHUNK;
+        *buf = lbuf;
+        return 1;
+    }
+err:
+    OPENSSL_free(lbuf);
+    return 0;
+}
+
+/*
+ * @brief Figure out ECHConfig encoding
+ * @param val is a buffer with the encoding
+ * @param len is the length of that buffer
+ * @param fmt is the detected format
+ * @return 1 for success, 0 for error
+ */
+static int ech_check_format(const unsigned char *val, size_t len, int *fmt)
+{
+    size_t span = 0;
+    char *copy_with_NUL = NULL;
+
+    if (fmt == NULL || len <= 4 || val == NULL)
+        return 0;
+    /* binary encoding starts with two octet length and ECH version */
+    if (len == 2 + ((size_t)(val[0]) * 256 + (size_t)(val[1]))
+        && val[2] == ((OSSL_ECH_RFC9849_VERSION / 256) & 0xff)
+        && val[3] == ((OSSL_ECH_RFC9849_VERSION % 256) & 0xff)) {
+        *fmt = OSSL_ECH_FMT_BIN;
+        return 1;
+    }
+    /* ensure we always end with a NUL so strspn is safe */
+    copy_with_NUL = OPENSSL_malloc(len + 1);
+    if (copy_with_NUL == NULL)
+        return 0;
+    memcpy(copy_with_NUL, val, len);
+    copy_with_NUL[len] = '\0';
+    span = strspn(copy_with_NUL, B64_alphabet);
+    OPENSSL_free(copy_with_NUL);
+    if (len <= span) {
+        *fmt = OSSL_ECH_FMT_B64TXT;
+        return 1;
+    }
+    return 0;
+}
+
+/*
+ * @brief helper to decode ECHConfig extensions
+ * @param ee is the OSSL_ECHSTORE entry for these
+ * @param exts is the binary form extensions
+ * @return 1 for good, 0 for error
+ */
+static int ech_decode_echconfig_exts(OSSL_ECHSTORE_ENTRY *ee, PACKET *exts)
+{
+    unsigned int exttype = 0;
+    size_t extlen = 0;
+    unsigned char *extval = NULL;
+    OSSL_ECHEXT *oe = NULL;
+    PACKET ext;
+
+    /*
+     * reminder: exts is a two-octet length prefixed list of:
+     * - two octet extension type
+     * - two octet extension length (can be zero)
+     * - length octets
+     * we've consumed the overall length before getting here
+     */
+    while (PACKET_remaining(exts) > 0) {
+        exttype = 0, extlen = 0;
+        extval = NULL;
+        oe = NULL;
+        if (!PACKET_get_net_2(exts, &exttype) || !PACKET_get_length_prefixed_2(exts, &ext)) {
+            ERR_raise(ERR_LIB_SSL, SSL_R_BAD_ECHCONFIG_EXTENSION);
+            goto err;
+        }
+        if (PACKET_remaining(&ext) >= OSSL_ECH_MAX_ECHCONFIGEXT_LEN) {
+            ERR_raise(ERR_LIB_SSL, SSL_R_BAD_ECHCONFIG_EXTENSION);
+            goto err;
+        }
+        if (!PACKET_memdup(&ext, &extval, &extlen)) {
+            ERR_raise(ERR_LIB_SSL, SSL_R_BAD_ECHCONFIG_EXTENSION);
+            goto err;
+        }
+        oe = OPENSSL_malloc(sizeof(*oe));
+        if (oe == NULL)
+            goto err;
+        oe->type = (uint16_t)exttype;
+        oe->val = extval;
+        extval = NULL; /* avoid double free */
+        oe->len = (uint16_t)extlen;
+        if (ee->exts == NULL)
+            ee->exts = sk_OSSL_ECHEXT_new_null();
+        if (ee->exts == NULL) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        if (!sk_OSSL_ECHEXT_push(ee->exts, oe)) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+    }
+    return 1;
+err:
+    sk_OSSL_ECHEXT_pop_free(ee->exts, ossl_echext_free);
+    ee->exts = NULL;
+    ossl_echext_free(oe);
+    OPENSSL_free(extval);
+    return 0;
+}
+
+/*
+ * @brief Check entry to see if looks good or bad
+ * @param ee is the ECHConfig to check
+ * @return 1 for all good, 0 otherwise
+ */
+static int ech_final_config_checks(OSSL_ECHSTORE_ENTRY *ee)
+{
+    OSSL_HPKE_SUITE hpke_suite;
+    int ind, num, rv = 0, goodsuitefound = 0;
+    X509_VERIFY_PARAM *vpm = X509_VERIFY_PARAM_new();
+    char *lastlabel = NULL;
+    size_t lllen;
+
+    if (vpm == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /* check local support for some suite */
+    for (ind = 0; ind != (int)ee->nsuites; ind++) {
+        /*
+         * suite_check says yes to the pseudo-aead for export, but we don't
+         * want to see it here coming from outside in an encoding
+         */
+        hpke_suite = ee->suites[ind];
+        if (OSSL_HPKE_suite_check(hpke_suite) == 1
+            && hpke_suite.aead_id != OSSL_HPKE_AEAD_ID_EXPORTONLY) {
+            goodsuitefound = 1;
+            break;
+        }
+    }
+    if (goodsuitefound == 0) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        goto err;
+    }
+    /* check no mandatory exts (with high bit set in type) */
+    num = (ee->exts == NULL ? 0 : sk_OSSL_ECHEXT_num(ee->exts));
+    for (ind = 0; ind != num; ind++) {
+        OSSL_ECHEXT *oe = sk_OSSL_ECHEXT_value(ee->exts, (int)ind);
+
+        if (oe->type & 0x8000) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+            goto err;
+        }
+    }
+    /* check public_name rules, as per spec section 6.1.7 */
+    if (ee->public_name == NULL
+        || ee->public_name[0] == '\0'
+        || ee->public_name[0] == '.'
+        || ee->public_name[strlen(ee->public_name) - 1] == '.'
+        || strlen(ee->public_name) > 255)
+        goto err;
+    /*
+     * Use X509_VERIFY_PARAM_add1_host to avoid coding same checks twice.
+     * This checks max 63 octets per label, overall length and some other
+     * DNS label checks.
+     */
+    if (X509_VERIFY_PARAM_add1_host(vpm, ee->public_name, 0) == 0)
+        goto err;
+    /*
+     * but we still have to check the last label restrictions, which
+     * are intended to avoid confusion with IP address literals in
+     * encodings browsers support, as per WHATWG (convincing, eh:-)
+     */
+    lastlabel = strrchr(ee->public_name, '.');
+    if (lastlabel == NULL) /* if there are no dots */
+        lastlabel = ee->public_name;
+    lllen = strlen(lastlabel);
+    if (lllen < 2)
+        goto err;
+    if (lastlabel[0] == '.') {
+        lastlabel++;
+        lllen--;
+    }
+    if (strspn(lastlabel, "0123456789") == lllen)
+        goto err;
+    if (lastlabel[0] == '0' && lllen > 2
+        && (lastlabel[1] == 'x' || lastlabel[1] == 'X')
+        && strspn(lastlabel + 2, "0123456789abcdefABCDEF") == (lllen - 2))
+        goto err;
+    rv = 1;
+err:
+    X509_VERIFY_PARAM_free(vpm);
+    return rv;
+}
+
+/**
+ * @brief decode one ECHConfig from a packet into an entry
+ * @param rent ptr to an entry allocated within (on success)
+ * @param pkt is the encoding
+ * @param priv is an optional private key (NULL if absent)
+ * @param for_retry says whether to include in a retry_config (if priv present)
+ * @return 1 for success, 0 for error
+ */
+static int ech_decode_one_entry(OSSL_ECHSTORE_ENTRY **rent, PACKET *pkt,
+    EVP_PKEY *priv, int for_retry)
+{
+    size_t ech_content_length = 0;
+    unsigned int tmpi;
+    const unsigned char *tmpecp = NULL;
+    size_t tmpeclen = 0, test_publen = 0;
+    PACKET ver_pkt, pub_pkt, cipher_suites, public_name_pkt, exts;
+    uint16_t thiskemid;
+    size_t suiteoctets = 0;
+    unsigned int ci = 0;
+    unsigned char cipher[OSSL_ECH_CIPHER_LEN], max_name_len;
+    unsigned char test_pub[OSSL_ECH_CRYPTO_VAR_SIZE];
+    OSSL_ECHSTORE_ENTRY *ee = NULL;
+
+    if (rent == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    if (pkt == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    ee = OPENSSL_zalloc(sizeof(*ee));
+    if (ee == NULL)
+        goto err;
+    /* note start of encoding so we can make a copy later */
+    tmpeclen = PACKET_remaining(pkt);
+    if (PACKET_peek_bytes(pkt, &tmpecp, tmpeclen) != 1
+        || !PACKET_get_net_2(pkt, &tmpi)) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_ECH_DECODE_ERROR);
+        goto err;
+    }
+    ee->version = (uint16_t)tmpi;
+
+    /* grab versioned packet data */
+    if (!PACKET_get_length_prefixed_2(pkt, &ver_pkt)) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_ECH_DECODE_ERROR);
+        goto err;
+    }
+    ech_content_length = (unsigned int)PACKET_remaining(&ver_pkt);
+    switch (ee->version) {
+    case OSSL_ECH_RFC9849_VERSION:
+        break;
+    default:
+        /* skip over in case we get something we can handle later */
+        if (!PACKET_forward(&ver_pkt, ech_content_length)) {
+            ERR_raise(ERR_LIB_SSL, SSL_R_ECH_DECODE_ERROR);
+            goto err;
+        }
+        /* nothing to return but not a fail */
+        ossl_echstore_entry_free(ee);
+        *rent = NULL;
+        return 1;
+    }
+    if (!PACKET_copy_bytes(&ver_pkt, &ee->config_id, 1)
+        || !PACKET_get_net_2(&ver_pkt, &tmpi)
+        || !PACKET_get_length_prefixed_2(&ver_pkt, &pub_pkt)
+        || !PACKET_memdup(&pub_pkt, &ee->pub, &ee->pub_len)
+        || !PACKET_get_length_prefixed_2(&ver_pkt, &cipher_suites)
+        || (suiteoctets = PACKET_remaining(&cipher_suites)) <= 0
+        || (suiteoctets % 2) == 1
+        || suiteoctets / OSSL_ECH_CIPHER_LEN > UINT_MAX) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_ECH_DECODE_ERROR);
+        goto err;
+    }
+    thiskemid = (uint16_t)tmpi;
+    ee->nsuites = (unsigned int)(suiteoctets / OSSL_ECH_CIPHER_LEN);
+    ee->suites = OPENSSL_malloc_array(ee->nsuites, sizeof(*ee->suites));
+    if (ee->suites == NULL)
+        goto err;
+    while (PACKET_copy_bytes(&cipher_suites, cipher,
+        OSSL_ECH_CIPHER_LEN)) {
+        ee->suites[ci].kem_id = thiskemid;
+        ee->suites[ci].kdf_id = cipher[0] << 8 | cipher[1];
+        ee->suites[ci].aead_id = cipher[2] << 8 | cipher[3];
+        if (ci++ >= ee->nsuites) {
+            ERR_raise(ERR_LIB_SSL, SSL_R_ECH_DECODE_ERROR);
+            goto err;
+        }
+    }
+    if (PACKET_remaining(&cipher_suites) > 0
+        || !PACKET_copy_bytes(&ver_pkt, &max_name_len, 1)) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_ECH_DECODE_ERROR);
+        goto err;
+    }
+    ee->max_name_length = max_name_len;
+    if (!PACKET_get_length_prefixed_1(&ver_pkt, &public_name_pkt)) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_ECH_DECODE_ERROR);
+        goto err;
+    }
+    if (PACKET_contains_zero_byte(&public_name_pkt)
+        || PACKET_remaining(&public_name_pkt) < TLSEXT_MINLEN_host_name
+        || !PACKET_strndup(&public_name_pkt, &ee->public_name)) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_ECH_DECODE_ERROR);
+        goto err;
+    }
+    /*
+     * We don't really handle ECHConfig extensions as of now,
+     * (none are well-defined), so we're only skipping over
+     * whatever we find here. If/when adding real extensions
+     * then it may be necessary to also check that the set of
+     * extensions loaded contain no duplicate types.
+     */
+    if (!PACKET_get_length_prefixed_2(&ver_pkt, &exts)) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_ECH_DECODE_ERROR);
+        goto err;
+    }
+    if (PACKET_remaining(&exts) > 0
+        && ech_decode_echconfig_exts(ee, &exts) != 1) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_ECH_DECODE_ERROR);
+        goto err;
+    }
+    /* set length of encoding of this ECHConfig */
+    ee->encoded_len = PACKET_data(&ver_pkt) - tmpecp;
+    /* copy encoded as it might get free'd if a reduce happens */
+    ee->encoded = OPENSSL_memdup(tmpecp, ee->encoded_len);
+    if (ee->encoded == NULL)
+        goto err;
+    if (priv != NULL) {
+        if (EVP_PKEY_get_octet_string_param(priv,
+                OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY,
+                test_pub, OSSL_ECH_CRYPTO_VAR_SIZE,
+                &test_publen)
+            != 1) {
+            ERR_raise(ERR_LIB_SSL, SSL_R_ECH_DECODE_ERROR);
+            goto err;
+        }
+        if (test_publen == ee->pub_len
+            && !memcmp(test_pub, ee->pub, ee->pub_len)) {
+            EVP_PKEY_up_ref(priv); /* associate the private key */
+            ee->keyshare = priv;
+            ee->for_retry = for_retry;
+        }
+    }
+    ee->loadtime = time(0);
+    *rent = ee;
+    return 1;
+err:
+    ossl_echstore_entry_free(ee);
+    *rent = NULL;
+    return 0;
+}
+
+/*
+ * @brief decode and flatten a binary encoded ECHConfigList
+ * @param es an OSSL_ECHSTORE
+ * @param priv is an optional private key (NULL if absent)
+ * @param for_retry says whether to include in a retry_config (if priv present)
+ * @param binbuf binary encoded ECHConfigList (we hope)
+ * @param binlen length of binbuf
+ * @return 1 for success, 0 for error
+ *
+ * We may only get one ECHConfig per list, but there can be more.  We want each
+ * element of the output to contain exactly one ECHConfig so that a client
+ * could sensibly down select to the one they prefer later, and so that we have
+ * the specific encoded value of that ECHConfig for inclusion in the HPKE info
+ * parameter when finally encrypting or decrypting an inner ClientHello.
+ *
+ * If a private value is provided then that'll only be associated with the
+ * relevant public value, if >1 public value was present in the ECHConfigList.
+ */
+static int ech_decode_and_flatten(OSSL_ECHSTORE *es, EVP_PKEY *priv, int for_retry,
+    unsigned char *binbuf, size_t binblen)
+{
+    int rv = 0;
+    size_t remaining = 0;
+    PACKET opkt, pkt;
+    OSSL_ECHSTORE_ENTRY *ee = NULL;
+
+    if (binbuf == NULL || binblen == 0 || binblen < OSSL_ECH_MIN_ECHCONFIG_LEN
+        || binblen >= OSSL_ECH_MAX_ECHCONFIG_LEN) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        goto err;
+    }
+    if (PACKET_buf_init(&opkt, binbuf, binblen) != 1
+        || !PACKET_get_length_prefixed_2(&opkt, &pkt)) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    remaining = PACKET_remaining(&pkt);
+    while (remaining > 0) {
+        if (ech_decode_one_entry(&ee, &pkt, priv, for_retry) != 1) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        remaining = PACKET_remaining(&pkt);
+        /* if unsupported version we can skip over */
+        if (ee == NULL)
+            continue;
+        /* do final checks on suites, exts, and fail if issues */
+        if (ech_final_config_checks(ee) != 1)
+            goto err;
+        /* push entry into store */
+        if (es->entries == NULL)
+            es->entries = sk_OSSL_ECHSTORE_ENTRY_new_null();
+        if (es->entries == NULL) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        if (!sk_OSSL_ECHSTORE_ENTRY_push(es->entries, ee)) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        ee = NULL;
+    }
+    rv = 1;
+err:
+    ossl_echstore_entry_free(ee);
+    return rv;
+}
+
+/*
+ * @brief check a private matches some public
+ * @param es is the ECH store
+ * @param priv is the private value
+ * @return 1 if we have a match, zero otherwise
+ */
+static int check_priv_matches(OSSL_ECHSTORE *es, EVP_PKEY *priv)
+{
+    int num, ent, gotone = 0;
+    OSSL_ECHSTORE_ENTRY *ee = NULL;
+
+    num = (es->entries == NULL ? 0 : sk_OSSL_ECHSTORE_ENTRY_num(es->entries));
+    for (ent = 0; ent != num; ent++) {
+        ee = sk_OSSL_ECHSTORE_ENTRY_value(es->entries, ent);
+        if (ee == NULL) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+            return 0;
+        }
+        if (EVP_PKEY_eq(ee->keyshare, priv)) {
+            gotone = 1;
+            break;
+        }
+    }
+    return gotone;
+}
+
+/*
+ * @brief decode input ECHConfigList and associate optional private info
+ * @param es is the OSSL_ECHSTORE
+ * @param in is the BIO from which we'll get the ECHConfigList
+ * @param priv is an optional private key
+ * @param for_retry 1 if the public related to priv ought be in retry_config
+ */
+static int ech_read_priv_echconfiglist(OSSL_ECHSTORE *es, BIO *in,
+    EVP_PKEY *priv, int for_retry)
+{
+    int rv = 0, detfmt, tdeclen = 0;
+    size_t encodedlen = 0, binlen = 0;
+    unsigned char *encodedval = NULL, *binbuf = NULL;
+    BIO *btmp = NULL, *btmp1 = NULL;
+
+    if (es == NULL || in == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+    if (ech_bio2buf(in, &encodedval, &encodedlen) != 1) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    if (encodedlen >= OSSL_ECH_MAX_ECHCONFIG_LEN) { /* sanity check */
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    if (ech_check_format(encodedval, encodedlen, &detfmt) != 1) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        goto err;
+    }
+    if (detfmt == OSSL_ECH_FMT_BIN) { /* copy buffer if binary format */
+        binbuf = OPENSSL_memdup(encodedval, encodedlen);
+        if (binbuf == NULL)
+            goto err;
+        binlen = encodedlen;
+    }
+    if (detfmt == OSSL_ECH_FMT_B64TXT) {
+        btmp = BIO_new_mem_buf(encodedval, (int)encodedlen);
+        if (btmp == NULL) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        btmp1 = BIO_new(BIO_f_base64());
+        if (btmp1 == NULL) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        BIO_set_flags(btmp1, BIO_FLAGS_BASE64_NO_NL);
+        btmp = BIO_push(btmp1, btmp);
+        /* overestimate but good enough */
+        binbuf = OPENSSL_malloc(encodedlen);
+        if (binbuf == NULL)
+            goto err;
+        tdeclen = BIO_read(btmp, binbuf, (int)encodedlen);
+        if (tdeclen <= 0) { /* need int for -1 return in failure case */
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        binlen = tdeclen;
+    }
+    if (ech_decode_and_flatten(es, priv, for_retry, binbuf, binlen) != 1) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    if (priv != NULL && check_priv_matches(es, priv) == 0)
+        goto err;
+    rv = 1;
+err:
+    BIO_free_all(btmp);
+    OPENSSL_free(binbuf);
+    OPENSSL_free(encodedval);
+    return rv;
+}
+
+/*
+ * API calls built around OSSL_ECHSSTORE
+ */
+
+OSSL_ECHSTORE *OSSL_ECHSTORE_new(OSSL_LIB_CTX *libctx, const char *propq)
+{
+    OSSL_ECHSTORE *es = NULL;
+
+    es = OPENSSL_zalloc(sizeof(*es));
+    if (es == NULL)
+        return 0;
+    es->libctx = libctx;
+    if (propq != NULL) {
+        es->propq = OPENSSL_strdup(propq);
+        if (es->propq == NULL) {
+            OPENSSL_free(es);
+            return 0;
+        }
+    }
+
+    return es;
+}
+
+void OSSL_ECHSTORE_free(OSSL_ECHSTORE *es)
+{
+    if (es == NULL)
+        return;
+    sk_OSSL_ECHSTORE_ENTRY_pop_free(es->entries, ossl_echstore_entry_free);
+    OPENSSL_free(es->propq);
+    OPENSSL_free(es);
+    return;
+}
+
+int OSSL_ECHSTORE_new_config(OSSL_ECHSTORE *es,
+    uint16_t echversion, uint8_t max_name_length,
+    const char *public_name, OSSL_HPKE_SUITE suite)
+{
+    size_t pnlen = 0, publen = OSSL_ECH_CRYPTO_VAR_SIZE;
+    unsigned char pub[OSSL_ECH_CRYPTO_VAR_SIZE];
+    int rv = 0;
+    unsigned char *bp = NULL;
+    size_t bblen = 0;
+    EVP_PKEY *privp = NULL;
+    uint8_t config_id = 0;
+    WPACKET epkt;
+    BUF_MEM *epkt_mem = NULL;
+    OSSL_ECHSTORE_ENTRY *ee = NULL;
+
+    /* basic checks */
+    if (es == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+    pnlen = (public_name == NULL ? 0 : strlen(public_name));
+    if (pnlen == 0 || pnlen > OSSL_ECH_MAX_PUBLICNAME) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+    /* this used have more versions and will again in future */
+    switch (echversion) {
+    case OSSL_ECH_RFC9849_VERSION:
+        break;
+    default:
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+    /*
+     *   Reminder, for draft-13 we want this:
+     *
+     *   opaque HpkePublicKey<1..2^16-1>;
+     *   uint16 HpkeKemId;  // Defined in I-D.irtf-cfrg-hpke
+     *   uint16 HpkeKdfId;  // Defined in I-D.irtf-cfrg-hpke
+     *   uint16 HpkeAeadId; // Defined in I-D.irtf-cfrg-hpke
+     *   struct {
+     *       HpkeKdfId kdf_id;
+     *       HpkeAeadId aead_id;
+     *   } HpkeSymmetricCipherSuite;
+     *   struct {
+     *       uint8 config_id;
+     *       HpkeKemId kem_id;
+     *       HpkePublicKey public_key;
+     *       HpkeSymmetricCipherSuite cipher_suites<4..2^16-4>;
+     *   } HpkeKeyConfig;
+     *   struct {
+     *       HpkeKeyConfig key_config;
+     *       uint8 maximum_name_length;
+     *       opaque public_name<1..255>;
+     *       Extension extensions<0..2^16-1>;
+     *   } ECHConfigContents;
+     *   struct {
+     *       uint16 version;
+     *       uint16 length;
+     *       select (ECHConfig.version) {
+     *         case 0xfe0d: ECHConfigContents contents;
+     *       }
+     *   } ECHConfig;
+     *   ECHConfig ECHConfigList<1..2^16-1>;
+     */
+    if ((epkt_mem = BUF_MEM_new()) == NULL
+        || !BUF_MEM_grow(epkt_mem, OSSL_ECH_MAX_ECHCONFIG_LEN)
+        || !WPACKET_init(&epkt, epkt_mem)) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err_no_epkt;
+    }
+    /* random config_id */
+    if (RAND_bytes_ex(es->libctx, (unsigned char *)&config_id, 1, 0) <= 0) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /* key pair */
+    if (OSSL_HPKE_keygen(suite, pub, &publen, &privp, NULL, 0,
+            es->libctx, es->propq)
+        != 1) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /* config id, KEM, public, KDF, AEAD, max name len, public_name, exts */
+    if ((bp = WPACKET_get_curr(&epkt)) == NULL
+        || !WPACKET_start_sub_packet_u16(&epkt)
+        || !WPACKET_put_bytes_u16(&epkt, echversion)
+        || !WPACKET_start_sub_packet_u16(&epkt)
+        || !WPACKET_put_bytes_u8(&epkt, config_id)
+        || !WPACKET_put_bytes_u16(&epkt, suite.kem_id)
+        || !WPACKET_start_sub_packet_u16(&epkt)
+        || !WPACKET_memcpy(&epkt, pub, publen)
+        || !WPACKET_close(&epkt)
+        || !WPACKET_start_sub_packet_u16(&epkt)
+        || !WPACKET_put_bytes_u16(&epkt, suite.kdf_id)
+        || !WPACKET_put_bytes_u16(&epkt, suite.aead_id)
+        || !WPACKET_close(&epkt)
+        || !WPACKET_put_bytes_u8(&epkt, max_name_length)
+        || !WPACKET_start_sub_packet_u8(&epkt)
+        || !WPACKET_memcpy(&epkt, public_name, pnlen)
+        || !WPACKET_close(&epkt)
+        || !WPACKET_start_sub_packet_u16(&epkt)
+        || !WPACKET_memcpy(&epkt, NULL, 0) /* no extensions */
+        || !WPACKET_close(&epkt)
+        || !WPACKET_close(&epkt)
+        || !WPACKET_close(&epkt)) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /* bp, bblen has encoding */
+    if (!WPACKET_get_total_written(&epkt, &bblen)) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    if ((ee = OPENSSL_zalloc(sizeof(*ee))) == NULL)
+        goto err;
+    ee->suites = OPENSSL_malloc(sizeof(*ee->suites));
+    if (ee->suites == NULL)
+        goto err;
+    ee->version = echversion;
+    ee->pub_len = publen;
+    ee->pub = OPENSSL_memdup(pub, publen);
+    if (ee->pub == NULL)
+        goto err;
+    ee->nsuites = 1;
+    ee->suites[0] = suite;
+    ee->public_name = OPENSSL_strdup(public_name);
+    if (ee->public_name == NULL)
+        goto err;
+    ee->max_name_length = max_name_length;
+    ee->config_id = config_id;
+    ee->keyshare = privp;
+    privp = NULL; /* don't free twice */
+    /* "steal" the encoding from the memory */
+    ee->encoded = (unsigned char *)epkt_mem->data;
+    ee->encoded_len = bblen;
+    epkt_mem->data = NULL;
+    epkt_mem->length = 0;
+    ee->loadtime = time(0);
+    if (ech_final_config_checks(ee) != 1) /* check our work */
+        goto err;
+    /* push entry into store */
+    if (es->entries == NULL)
+        es->entries = sk_OSSL_ECHSTORE_ENTRY_new_null();
+    if (es->entries == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    if (!sk_OSSL_ECHSTORE_ENTRY_push(es->entries, ee)) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    WPACKET_finish(&epkt);
+    BUF_MEM_free(epkt_mem);
+    return 1;
+
+err:
+    ossl_echstore_entry_free(ee);
+    EVP_PKEY_free(privp);
+    WPACKET_cleanup(&epkt);
+err_no_epkt:
+    BUF_MEM_free(epkt_mem);
+    return rv;
+}
+
+int OSSL_ECHSTORE_write_pem(OSSL_ECHSTORE *es, int index, BIO *out)
+{
+    OSSL_ECHSTORE_ENTRY *ee = NULL;
+    int rv = 0, num = 0, chosen = 0, doall = 0;
+    WPACKET epkt; /* used if we want to merge ECHConfigs for output */
+    BUF_MEM *epkt_mem = NULL;
+    size_t allencoded_len;
+
+    if (es == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+    num = (es->entries == NULL ? 0 : sk_OSSL_ECHSTORE_ENTRY_num(es->entries));
+    if (num <= 0) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+    if (index >= num) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+    if (index == OSSL_ECHSTORE_ALL)
+        doall = 1;
+    else if (index == OSSL_ECHSTORE_LAST)
+        chosen = num - 1;
+    else
+        chosen = index;
+    memset(&epkt, 0, sizeof(epkt));
+    if (doall == 0) {
+        ee = sk_OSSL_ECHSTORE_ENTRY_value(es->entries, chosen);
+        if (ee == NULL || ee->encoded == NULL) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+            return 0;
+        }
+        /* private key first */
+        if (ee->keyshare != NULL
+            && !PEM_write_bio_PrivateKey(out, ee->keyshare, NULL, NULL, 0,
+                NULL, NULL)) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        if (PEM_write_bio(out, PEM_STRING_ECHCONFIG, NULL,
+                ee->encoded, (long)ee->encoded_len)
+            <= 0) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+    } else {
+        /* catenate the encodings into one */
+        if ((epkt_mem = BUF_MEM_new()) == NULL
+            || !BUF_MEM_grow(epkt_mem, OSSL_ECH_MAX_ECHCONFIG_LEN)
+            || !WPACKET_init(&epkt, epkt_mem)
+            || !WPACKET_start_sub_packet_u16(&epkt)) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        for (chosen = 0; chosen != num; chosen++) {
+            ee = sk_OSSL_ECHSTORE_ENTRY_value(es->entries, chosen);
+            if (ee == NULL || ee->encoded == NULL) {
+                ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+                return 0;
+            }
+            if (!WPACKET_memcpy(&epkt, ee->encoded, ee->encoded_len)) {
+                ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+        }
+        if (!WPACKET_close(&epkt)) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        if (!WPACKET_get_total_written(&epkt, &allencoded_len)) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        if (PEM_write_bio(out, PEM_STRING_ECHCONFIG, NULL,
+                (unsigned char *)epkt_mem->data,
+                (long)allencoded_len)
+            <= 0) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+    }
+    rv = 1;
+err:
+    WPACKET_cleanup(&epkt);
+    BUF_MEM_free(epkt_mem);
+    return rv;
+}
+
+int OSSL_ECHSTORE_read_echconfiglist(OSSL_ECHSTORE *es, BIO *in)
+{
+    return ech_read_priv_echconfiglist(es, in, NULL, 0);
+}
+
+int OSSL_ECHSTORE_get1_info(OSSL_ECHSTORE *es, int index, time_t *loaded_secs,
+    char **public_name, char **echconfig,
+    int *has_private, int *for_retry)
+{
+    OSSL_ECHSTORE_ENTRY *ee = NULL;
+    unsigned int j = 0;
+    int num = 0;
+    BIO *out = NULL;
+    time_t now = time(0);
+    size_t ehlen;
+    unsigned char *ignore = NULL;
+
+    if (es == NULL || loaded_secs == NULL || public_name == NULL
+        || echconfig == NULL || has_private == NULL || for_retry == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+    num = (es->entries == NULL ? 0 : sk_OSSL_ECHSTORE_ENTRY_num(es->entries));
+    if (num == 0 || index < 0 || index >= num) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+    ee = sk_OSSL_ECHSTORE_ENTRY_value(es->entries, index);
+    if (ee == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+    *loaded_secs = now - ee->loadtime;
+    *public_name = NULL;
+    *echconfig = NULL;
+    if (ee->public_name != NULL) {
+        *public_name = OPENSSL_strdup(ee->public_name);
+        if (*public_name == NULL)
+            goto err;
+    }
+    *has_private = (ee->keyshare == NULL ? 0 : 1);
+    *for_retry = ee->for_retry;
+    /* Now "print" the ECHConfigList */
+    out = BIO_new(BIO_s_mem());
+    if (out == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    if (ee->version != OSSL_ECH_RFC9849_VERSION) {
+        /* just note we don't support that one today */
+        BIO_printf(out, "[Unsupported version (%04x)]", ee->version);
+    } else {
+        /* version, config_id, public_name, and kem */
+        BIO_printf(out, "[%04x,%02x,%s,[", ee->version, ee->config_id,
+            ee->public_name != NULL ? (char *)ee->public_name : "NULL");
+        /* ciphersuites */
+        for (j = 0; j != ee->nsuites; j++) {
+            BIO_printf(out, "%04x,%04x,%04x", ee->suites[j].kem_id,
+                ee->suites[j].kdf_id, ee->suites[j].aead_id);
+            if (j < (ee->nsuites - 1))
+                BIO_printf(out, ",");
+        }
+        BIO_printf(out, "],");
+        /* public key */
+        for (j = 0; j != ee->pub_len; j++)
+            BIO_printf(out, "%02x", ee->pub[j]);
+        /* max name length and (only) number of extensions */
+        BIO_printf(out, ",%02x,%02x]", ee->max_name_length,
+            ee->exts == NULL ? 0 : sk_OSSL_ECHEXT_num(ee->exts));
+    }
+    ehlen = BIO_get_mem_data(out, &ignore);
+    if (ehlen > INT_MAX)
+        goto err;
+    *echconfig = OPENSSL_malloc(ehlen + 1);
+    if (*echconfig == NULL)
+        goto err;
+    if (BIO_read(out, *echconfig, (int)ehlen) <= 0) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    (*echconfig)[ehlen] = '\0';
+    BIO_free(out);
+    return 1;
+err:
+    BIO_free(out);
+    OPENSSL_free(*public_name);
+    *public_name = NULL;
+    OPENSSL_free(*echconfig);
+    *echconfig = NULL;
+    return 0;
+}
+
+int OSSL_ECHSTORE_downselect(OSSL_ECHSTORE *es, int index)
+{
+    OSSL_ECHSTORE_ENTRY *ee = NULL;
+    int i, num = 0, chosen = OSSL_ECHSTORE_ALL;
+
+    if (es == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+    num = (es->entries == NULL ? 0 : sk_OSSL_ECHSTORE_ENTRY_num(es->entries));
+    if (num == 0) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+    if (index <= OSSL_ECHSTORE_ALL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+    if (index == OSSL_ECHSTORE_LAST) {
+        chosen = num - 1;
+    } else if (index >= num) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    } else {
+        chosen = index;
+    }
+    for (i = num - 1; i >= 0; i--) {
+        if (i == chosen)
+            continue;
+        ee = sk_OSSL_ECHSTORE_ENTRY_value(es->entries, i);
+        ossl_echstore_entry_free(ee);
+        sk_OSSL_ECHSTORE_ENTRY_delete(es->entries, i);
+    }
+    return 1;
+}
+
+int OSSL_ECHSTORE_set1_key_and_read_pem(OSSL_ECHSTORE *es, EVP_PKEY *priv,
+    BIO *in, int for_retry)
+{
+    unsigned char *b64 = NULL;
+    long b64len = 0;
+    BIO *b64bio = NULL;
+    int rv = 0;
+    char *pname = NULL, *pheader = NULL;
+
+    /* we allow for a NULL private key */
+    if (es == NULL || in == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+    if (PEM_read_bio(in, &pname, &pheader, &b64, &b64len) != 1) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    if (pname == NULL || strcmp(pname, PEM_STRING_ECHCONFIG) != 0) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    b64bio = BIO_new(BIO_s_mem());
+    if (b64bio == NULL
+        || BIO_write(b64bio, b64, b64len) <= 0
+        || ech_read_priv_echconfiglist(es, b64bio, priv, for_retry) != 1) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    rv = 1;
+err:
+    OPENSSL_free(pname);
+    OPENSSL_free(pheader);
+    BIO_free_all(b64bio);
+    OPENSSL_free(b64);
+    return rv;
+}
+
+int OSSL_ECHSTORE_read_pem(OSSL_ECHSTORE *es, BIO *in, int for_retry)
+{
+    EVP_PKEY *priv = NULL;
+    int rv = 0;
+    BIO *fbio = BIO_new(BIO_f_buffer());
+
+    if (fbio == NULL || es == NULL || in == NULL) {
+        BIO_free_all(fbio);
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+    /*
+     * Read private key then handoff to set1_key_and_read_pem.
+     * We allow for no private key as an option, to handle that
+     * the BIO_f_buffer allows us to seek back to the start.
+     */
+    BIO_push(fbio, in);
+    if (!PEM_read_bio_PrivateKey_ex(fbio, &priv, NULL, NULL, es->libctx, es->propq)
+        && BIO_seek(fbio, 0) < 0) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    rv = OSSL_ECHSTORE_set1_key_and_read_pem(es, priv, fbio, for_retry);
+err:
+    EVP_PKEY_free(priv);
+    BIO_pop(fbio);
+    BIO_free_all(fbio);
+    return rv;
+}
+
+int OSSL_ECHSTORE_num_entries(const OSSL_ECHSTORE *es, int *numentries)
+{
+    if (es == NULL || numentries == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+    *numentries = (es->entries == NULL ? 0 : sk_OSSL_ECHSTORE_ENTRY_num(es->entries));
+    return 1;
+}
+
+int OSSL_ECHSTORE_num_keys(OSSL_ECHSTORE *es, int *numkeys)
+{
+    int i, num = 0, count = 0;
+    OSSL_ECHSTORE_ENTRY *ee = NULL;
+
+    if (es == NULL || numkeys == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+    num = (es->entries == NULL ? 0 : sk_OSSL_ECHSTORE_ENTRY_num(es->entries));
+    for (i = 0; i != num; i++) {
+        ee = sk_OSSL_ECHSTORE_ENTRY_value(es->entries, i);
+        if (ee == NULL) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+        count += (ee->keyshare != NULL);
+    }
+    *numkeys = count;
+    return 1;
+}
+
+int OSSL_ECHSTORE_flush_keys(OSSL_ECHSTORE *es, time_t age)
+{
+    OSSL_ECHSTORE_ENTRY *ee = NULL;
+    int i, num = 0;
+    time_t now = time(0);
+
+    if (es == NULL) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
+        return 0;
+    }
+    num = (es->entries == NULL ? 0 : sk_OSSL_ECHSTORE_ENTRY_num(es->entries));
+    if (num == 0) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+    for (i = num - 1; i >= 0; i--) {
+        ee = sk_OSSL_ECHSTORE_ENTRY_value(es->entries, i);
+        if (ee == NULL) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+            return 0;
+        }
+        if (ee->keyshare != NULL && ee->loadtime + age <= now) {
+            ossl_echstore_entry_free(ee);
+            sk_OSSL_ECHSTORE_ENTRY_delete(es->entries, i);
+        }
+    }
+    return 1;
+}
diff --git a/deps/openssl/openssl/ssl/methods.c b/deps/openssl/openssl/ssl/methods.c
index 07098839058..22f0f6cab2f 100644
--- a/deps/openssl/openssl/ssl/methods.c
+++ b/deps/openssl/openssl/ssl/methods.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -13,7 +13,7 @@
 #include "ssl_local.h"

 /*-
- * TLS/SSLv3 methods
+ * TLS methods
  */

 IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0,
@@ -41,11 +41,8 @@ IMPLEMENT_tls_meth_func(TLS1_VERSION, SSL_METHOD_NO_SUITEB, SSL_OP_NO_TLSv1,
     tlsv1_method,
     ossl_statem_accept, ossl_statem_connect, TLSv1_enc_data)
 #endif
-#ifndef OPENSSL_NO_SSL3_METHOD
-IMPLEMENT_ssl3_meth_func(sslv3_method, ossl_statem_accept, ossl_statem_connect)
-#endif
 /*-
- * TLS/SSLv3 server methods
+ * TLS server methods
  */
 IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0,
     TLS_server_method,
@@ -73,12 +70,8 @@ IMPLEMENT_tls_meth_func(TLS1_VERSION, SSL_METHOD_NO_SUITEB, SSL_OP_NO_TLSv1,
     ossl_statem_accept,
     ssl_undefined_function, TLSv1_enc_data)
 #endif
-#ifndef OPENSSL_NO_SSL3_METHOD
-IMPLEMENT_ssl3_meth_func(sslv3_server_method,
-    ossl_statem_accept, ssl_undefined_function)
-#endif
 /*-
- * TLS/SSLv3 client methods
+ * TLS client methods
  */
 IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0,
     TLS_client_method,
@@ -106,10 +99,6 @@ IMPLEMENT_tls_meth_func(TLS1_VERSION, SSL_METHOD_NO_SUITEB, SSL_OP_NO_TLSv1,
     ssl_undefined_function,
     ossl_statem_connect, TLSv1_enc_data)
 #endif
-#ifndef OPENSSL_NO_SSL3_METHOD
-IMPLEMENT_ssl3_meth_func(sslv3_client_method,
-    ssl_undefined_function, ossl_statem_connect)
-#endif
 /*-
  * DTLS methods
  */
@@ -125,6 +114,10 @@ IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, 0, SSL_OP_NO_DTLSv1_2,
     ossl_statem_accept,
     ossl_statem_connect, DTLSv1_2_enc_data)
 #endif
+IMPLEMENT_dtls1_meth_func(DTLS1_3_VERSION, 0, SSL_OP_NO_DTLSv1_3,
+    dtlsv1_3_method,
+    ossl_statem_accept,
+    ossl_statem_connect, DTLSv1_3_enc_data)
 IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, 0, 0,
     DTLS_method,
     ossl_statem_accept,
@@ -145,6 +138,10 @@ IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, 0, SSL_OP_NO_DTLSv1_2,
     ossl_statem_accept,
     ssl_undefined_function, DTLSv1_2_enc_data)
 #endif
+IMPLEMENT_dtls1_meth_func(DTLS1_3_VERSION, 0, SSL_OP_NO_DTLSv1_3,
+    dtlsv1_3_server_method,
+    ossl_statem_accept,
+    ssl_undefined_function, DTLSv1_3_enc_data)
 IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, 0, 0,
     DTLS_server_method,
     ossl_statem_accept,
@@ -169,111 +166,11 @@ IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, 0, SSL_OP_NO_DTLSv1_2,
     ssl_undefined_function,
     ossl_statem_connect, DTLSv1_2_enc_data)
 #endif
+IMPLEMENT_dtls1_meth_func(DTLS1_3_VERSION, 0, SSL_OP_NO_DTLSv1_3,
+    dtlsv1_3_client_method,
+    ssl_undefined_function,
+    ossl_statem_connect, DTLSv1_3_enc_data)
 IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, 0, 0,
     DTLS_client_method,
     ssl_undefined_function,
     ossl_statem_connect, DTLSv1_2_enc_data)
-#ifndef OPENSSL_NO_DEPRECATED_1_1_0
-#ifndef OPENSSL_NO_TLS1_2_METHOD
-const SSL_METHOD *TLSv1_2_method(void)
-{
-    return tlsv1_2_method();
-}
-
-const SSL_METHOD *TLSv1_2_server_method(void)
-{
-    return tlsv1_2_server_method();
-}
-
-const SSL_METHOD *TLSv1_2_client_method(void)
-{
-    return tlsv1_2_client_method();
-}
-#endif
-
-#ifndef OPENSSL_NO_TLS1_1_METHOD
-const SSL_METHOD *TLSv1_1_method(void)
-{
-    return tlsv1_1_method();
-}
-
-const SSL_METHOD *TLSv1_1_server_method(void)
-{
-    return tlsv1_1_server_method();
-}
-
-const SSL_METHOD *TLSv1_1_client_method(void)
-{
-    return tlsv1_1_client_method();
-}
-#endif
-
-#ifndef OPENSSL_NO_TLS1_METHOD
-const SSL_METHOD *TLSv1_method(void)
-{
-    return tlsv1_method();
-}
-
-const SSL_METHOD *TLSv1_server_method(void)
-{
-    return tlsv1_server_method();
-}
-
-const SSL_METHOD *TLSv1_client_method(void)
-{
-    return tlsv1_client_method();
-}
-#endif
-
-#ifndef OPENSSL_NO_SSL3_METHOD
-const SSL_METHOD *SSLv3_method(void)
-{
-    return sslv3_method();
-}
-
-const SSL_METHOD *SSLv3_server_method(void)
-{
-    return sslv3_server_method();
-}
-
-const SSL_METHOD *SSLv3_client_method(void)
-{
-    return sslv3_client_method();
-}
-#endif
-
-#ifndef OPENSSL_NO_DTLS1_2_METHOD
-const SSL_METHOD *DTLSv1_2_method(void)
-{
-    return dtlsv1_2_method();
-}
-
-const SSL_METHOD *DTLSv1_2_server_method(void)
-{
-    return dtlsv1_2_server_method();
-}
-
-const SSL_METHOD *DTLSv1_2_client_method(void)
-{
-    return dtlsv1_2_client_method();
-}
-#endif
-
-#ifndef OPENSSL_NO_DTLS1_METHOD
-const SSL_METHOD *DTLSv1_method(void)
-{
-    return dtlsv1_method();
-}
-
-const SSL_METHOD *DTLSv1_server_method(void)
-{
-    return dtlsv1_server_method();
-}
-
-const SSL_METHOD *DTLSv1_client_method(void)
-{
-    return dtlsv1_client_method();
-}
-#endif
-
-#endif
diff --git a/deps/openssl/openssl/ssl/pqueue.c b/deps/openssl/openssl/ssl/pqueue.c
index 87918e5e2bc..e413d8c5aee 100644
--- a/deps/openssl/openssl/ssl/pqueue.c
+++ b/deps/openssl/openssl/ssl/pqueue.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -10,11 +10,6 @@
 #include "ssl_local.h"
 #include <openssl/bn.h>

-struct pqueue_st {
-    pitem *items;
-    int count;
-};
-
 pitem *pitem_new(unsigned char *prio64be, void *data)
 {
     pitem *item = OPENSSL_malloc(sizeof(*item));
@@ -25,6 +20,23 @@ pitem *pitem_new(unsigned char *prio64be, void *data)
     memcpy(item->priority, prio64be, sizeof(item->priority));
     item->data = data;
     item->next = NULL;
+
+    return item;
+}
+
+pitem *pitem_new_u64(uint64_t prio, void *data)
+{
+    pitem *item = OPENSSL_malloc(sizeof(*item));
+    unsigned char *p_item_prio;
+
+    if (item == NULL)
+        return NULL;
+
+    p_item_prio = item->priority;
+    l2n8(prio, p_item_prio);
+    item->data = data;
+    item->next = NULL;
+
     return item;
 }

@@ -50,6 +62,7 @@ pitem *pqueue_insert(pqueue *pq, pitem *item)
     pitem *curr, *next;

     if (pq->items == NULL) {
+        item->next = NULL;
         pq->items = item;
         return item;
     }
@@ -121,6 +134,15 @@ pitem *pqueue_find(pqueue *pq, unsigned char *prio64be)
     return found;
 }

+pitem *pqueue_find_u64(pqueue *pq, uint64_t prio)
+{
+    unsigned char prio64be[8], *p_prio64be = prio64be;
+
+    l2n8(prio, p_prio64be);
+
+    return pqueue_find(pq, prio64be);
+}
+
 pitem *pqueue_iterator(pqueue *pq)
 {
     return pqueue_peek(pq);
diff --git a/deps/openssl/openssl/ssl/priority_queue.c b/deps/openssl/openssl/ssl/priority_queue.c
index 6f1de51b89d..70fbd7a4c72 100644
--- a/deps/openssl/openssl/ssl/priority_queue.c
+++ b/deps/openssl/openssl/ssl/priority_queue.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -308,12 +308,12 @@ int ossl_pqueue_reserve(OSSL_PQUEUE *pq, size_t n)
         return 0;
     }

-    h = OPENSSL_realloc(pq->heap, new_max * sizeof(*pq->heap));
+    h = OPENSSL_realloc_array(pq->heap, new_max, sizeof(*pq->heap));
     if (h == NULL)
         return 0;
     pq->heap = h;

-    e = OPENSSL_realloc(pq->elements, new_max * sizeof(*pq->elements));
+    e = OPENSSL_realloc_array(pq->elements, new_max, sizeof(*pq->elements));
     if (e == NULL)
         return 0;
     pq->elements = e;
@@ -337,8 +337,8 @@ OSSL_PQUEUE *ossl_pqueue_new(int (*compare)(const void *, const void *))
     pq->hmax = min_nodes;
     pq->htop = 0;
     pq->freelist = 0;
-    pq->heap = OPENSSL_malloc(sizeof(*pq->heap) * min_nodes);
-    pq->elements = OPENSSL_malloc(sizeof(*pq->elements) * min_nodes);
+    pq->heap = OPENSSL_malloc_array(min_nodes, sizeof(*pq->heap));
+    pq->elements = OPENSSL_malloc_array(min_nodes, sizeof(*pq->elements));
     if (pq->heap == NULL || pq->elements == NULL) {
         ossl_pqueue_free(pq);
         return NULL;
diff --git a/deps/openssl/openssl/ssl/quic/json_enc.c b/deps/openssl/openssl/ssl/quic/json_enc.c
index 9e14e821f1c..fcae70a739e 100644
--- a/deps/openssl/openssl/ssl/quic/json_enc.c
+++ b/deps/openssl/openssl/ssl/quic/json_enc.c
@@ -11,6 +11,7 @@
 #include "internal/nelem.h"
 #include "internal/numbers.h"
 #include <string.h>
+#include <stdbool.h>

 /*
  * wbuf
@@ -521,12 +522,12 @@ void ossl_json_null(OSSL_JSON_ENC *json)
     json_post_item(json);
 }

-void ossl_json_bool(OSSL_JSON_ENC *json, int v)
+void ossl_json_bool(OSSL_JSON_ENC *json, bool v)
 {
     if (!json_pre_item(json))
         return;

-    json_write_str(json, v > 0 ? "true" : "false");
+    json_write_str(json, v ? "true" : "false");
     json_post_item(json);
 }

diff --git a/deps/openssl/openssl/ssl/quic/qlog.c b/deps/openssl/openssl/ssl/quic/qlog.c
index 41025159ced..6b5a9b4af3c 100644
--- a/deps/openssl/openssl/ssl/quic/qlog.c
+++ b/deps/openssl/openssl/ssl/quic/qlog.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,8 @@
  * https://www.openssl.org/source/license.html
  */

+#include <stdbool.h>
+#include <stdio.h>
 #include "internal/qlog.h"
 #include "internal/json_enc.h"
 #include "internal/common.h"
@@ -130,12 +132,21 @@ QLOG *ossl_qlog_new_from_env(const QLOG_TRACE_INFO *info)
     if (qlogdir_sep != '\0')
         filename[l++] = qlogdir_sep;

-    for (i = 0; i < info->odcid.id_len; ++i)
-        l += BIO_snprintf(filename + l, strl - l, "%02x", info->odcid.id[i]);
+    for (i = 0; i < info->odcid.id_len; ++i) {
+        int n = snprintf(filename + l, strl - l, "%02x", info->odcid.id[i]);

-    l += BIO_snprintf(filename + l, strl - l, "_%s.sqlog",
+        if (n < 0 || (size_t)n >= strl - l)
+            goto err;
+        l += n;
+    }
+
+    int n = snprintf(filename + l, strl - l, "_%s.sqlog",
         info->is_server ? "server" : "client");

+    if (n < 0 || (size_t)n >= strl - l)
+        goto err;
+    l += n;
+
     qlog = ossl_qlog_new(info);
     if (qlog == NULL)
         goto err;
@@ -339,7 +350,7 @@ static void qlog_event_seq_header(QLOG *qlog)
                 if (qlog->info.override_impl_name != NULL) {
                     p = qlog->info.override_impl_name;
                 } else {
-                    BIO_snprintf(buf, sizeof(buf), "OpenSSL/%s (%s)",
+                    snprintf(buf, sizeof(buf), "OpenSSL/%s (%s)",
                         OpenSSL_version(OPENSSL_FULL_VERSION_STRING),
                         OpenSSL_version(OPENSSL_PLATFORM) + 10);
                 }
@@ -493,7 +504,7 @@ void ossl_qlog_i64(QLOG *qlog, const char *name, int64_t value)
     ossl_json_i64(&qlog->json, value);
 }

-void ossl_qlog_bool(QLOG *qlog, const char *name, int value)
+void ossl_qlog_bool(QLOG *qlog, const char *name, bool value)
 {
     if (name != NULL)
         ossl_json_key(&qlog->json, name);
@@ -641,13 +652,14 @@ static void filter_apply(size_t *enabled, int add,
     const char *cat, size_t cat_l,
     const char *event, size_t event_l)
 {
-    /* Find events which match the given filters. */
-#define QLOG_EVENT(e_cat, e_name)                      \
-    if (filter_match_event(cat, cat_l, event, event_l, \
-            #e_cat, #e_name))                          \
-        bit_set(enabled, QLOG_EVENT_TYPE_##e_cat##_##e_name, add);
-#include "internal/qlog_events.h"
+    /* clang-format off */
+	/* Find events which match the given filters. */
+#define QLOG_EVENT(e_cat, e_name)                                            \
+	if (filter_match_event(cat, cat_l, event, event_l, #e_cat, #e_name)) \
+		bit_set(enabled, QLOG_EVENT_TYPE_##e_cat##_##e_name, add);
+#include "internal/qlog_events.inc"
 #undef QLOG_EVENT
+    /* clang-format on */
 }

 static int lex_fail(struct lexer *lex, const char *msg)
diff --git a/deps/openssl/openssl/ssl/quic/qlog_event_helpers.c b/deps/openssl/openssl/ssl/quic/qlog_event_helpers.c
index 83eebe82ad4..bbe6d5f4520 100644
--- a/deps/openssl/openssl/ssl/quic/qlog_event_helpers.c
+++ b/deps/openssl/openssl/ssl/quic/qlog_event_helpers.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,8 @@
  * https://www.openssl.org/source/license.html
  */

+#include <stdio.h>
+
 #include "internal/qlog_event_helpers.h"
 #include "internal/common.h"
 #include "internal/packet.h"
@@ -130,7 +132,7 @@ void ossl_qlog_event_connectivity_connection_closed(QLOG *qlog,

         if (tcause->error_code >= OSSL_QUIC_ERR_CRYPTO_ERR_BEGIN
             && tcause->error_code <= OSSL_QUIC_ERR_CRYPTO_ERR_END) {
-            BIO_snprintf(ce, sizeof(ce), "crypto_error_0x%03llx",
+            snprintf(ce, sizeof(ce), "crypto_error_0x%03llx",
                 (unsigned long long)tcause->error_code);
             m = ce;
         }
diff --git a/deps/openssl/openssl/ssl/quic/quic_cfq.c b/deps/openssl/openssl/ssl/quic/quic_cfq.c
index 1782828c17d..889b093deaa 100644
--- a/deps/openssl/openssl/ssl/quic/quic_cfq.c
+++ b/deps/openssl/openssl/ssl/quic/quic_cfq.c
@@ -27,42 +27,42 @@ struct quic_cfq_item_ex_st {

 uint64_t ossl_quic_cfq_item_get_frame_type(const QUIC_CFQ_ITEM *item)
 {
-    QUIC_CFQ_ITEM_EX *ex = (QUIC_CFQ_ITEM_EX *)item;
+    const QUIC_CFQ_ITEM_EX *ex = (const QUIC_CFQ_ITEM_EX *)item;

     return ex->frame_type;
 }

 const unsigned char *ossl_quic_cfq_item_get_encoded(const QUIC_CFQ_ITEM *item)
 {
-    QUIC_CFQ_ITEM_EX *ex = (QUIC_CFQ_ITEM_EX *)item;
+    const QUIC_CFQ_ITEM_EX *ex = (const QUIC_CFQ_ITEM_EX *)item;

     return ex->encoded;
 }

 size_t ossl_quic_cfq_item_get_encoded_len(const QUIC_CFQ_ITEM *item)
 {
-    QUIC_CFQ_ITEM_EX *ex = (QUIC_CFQ_ITEM_EX *)item;
+    const QUIC_CFQ_ITEM_EX *ex = (const QUIC_CFQ_ITEM_EX *)item;

     return ex->encoded_len;
 }

 int ossl_quic_cfq_item_get_state(const QUIC_CFQ_ITEM *item)
 {
-    QUIC_CFQ_ITEM_EX *ex = (QUIC_CFQ_ITEM_EX *)item;
+    const QUIC_CFQ_ITEM_EX *ex = (const QUIC_CFQ_ITEM_EX *)item;

     return ex->state;
 }

 uint32_t ossl_quic_cfq_item_get_pn_space(const QUIC_CFQ_ITEM *item)
 {
-    QUIC_CFQ_ITEM_EX *ex = (QUIC_CFQ_ITEM_EX *)item;
+    const QUIC_CFQ_ITEM_EX *ex = (const QUIC_CFQ_ITEM_EX *)item;

     return ex->pn_space;
 }

 int ossl_quic_cfq_item_is_unreliable(const QUIC_CFQ_ITEM *item)
 {
-    QUIC_CFQ_ITEM_EX *ex = (QUIC_CFQ_ITEM_EX *)item;
+    const QUIC_CFQ_ITEM_EX *ex = (const QUIC_CFQ_ITEM_EX *)item;

     return (ex->flags & QUIC_CFQ_ITEM_FLAG_UNRELIABLE) != 0;
 }
diff --git a/deps/openssl/openssl/ssl/quic/quic_channel.c b/deps/openssl/openssl/ssl/quic/quic_channel.c
index 2427db85e92..dc62238211d 100644
--- a/deps/openssl/openssl/ssl/quic/quic_channel.c
+++ b/deps/openssl/openssl/ssl/quic/quic_channel.c
@@ -35,14 +35,6 @@
  */
 #define MAX_NAT_INTERVAL (ossl_ms2time(25000))

-/*
- * Our maximum ACK delay on the TX side. This is up to us to choose. Note that
- * this could differ from QUIC_DEFAULT_MAX_DELAY in future as that is a protocol
- * value which determines the value of the maximum ACK delay if the
- * max_ack_delay transport parameter is not set.
- */
-#define DEFAULT_MAX_ACK_DELAY QUIC_DEFAULT_MAX_ACK_DELAY
-
 DEFINE_LIST_OF_IMPL(ch, QUIC_CHANNEL);

 static void ch_save_err_state(QUIC_CHANNEL *ch);
@@ -151,14 +143,10 @@ static QLOG *ch_get_qlog_cb(void *arg)
  * QUIC Channel Initialization and Teardown
  * ========================================
  */
-#define DEFAULT_INIT_CONN_RXFC_WND (768 * 1024)
 #define DEFAULT_CONN_RXFC_MAX_WND_MUL 20

-#define DEFAULT_INIT_STREAM_RXFC_WND (512 * 1024)
 #define DEFAULT_STREAM_RXFC_MAX_WND_MUL 12

-#define DEFAULT_INIT_CONN_MAX_STREAMS 100
-
 static int ch_init(QUIC_CHANNEL *ch)
 {
     OSSL_QUIC_TX_PACKETISER_ARGS txp_args = { 0 };
@@ -186,7 +174,7 @@ static int ch_init(QUIC_CHANNEL *ch)
     qtx_args.get_qlog_cb = ch_get_qlog_cb;
     qtx_args.get_qlog_cb_arg = ch;
     qtx_args.mdpl = QUIC_MIN_INITIAL_DGRAM_LEN;
-    ch->rx_max_udp_payload_size = qtx_args.mdpl;
+    ch->rx_max_udp_payload_size = QUIC_DEFAULT_MAX_UDP_PAYLOAD_SIZE;

     ch->ping_deadline = ossl_time_infinite();

@@ -205,20 +193,6 @@ static int ch_init(QUIC_CHANNEL *ch)
     if (!ossl_quic_txfc_init(&ch->conn_txfc, NULL))
         goto err;

-    /*
-     * Note: The TP we transmit governs what the peer can transmit and thus
-     * applies to the RXFC.
-     */
-    ch->tx_init_max_stream_data_bidi_local = DEFAULT_INIT_STREAM_RXFC_WND;
-    ch->tx_init_max_stream_data_bidi_remote = DEFAULT_INIT_STREAM_RXFC_WND;
-    ch->tx_init_max_stream_data_uni = DEFAULT_INIT_STREAM_RXFC_WND;
-
-    if (!ossl_quic_rxfc_init(&ch->conn_rxfc, NULL,
-            DEFAULT_INIT_CONN_RXFC_WND,
-            DEFAULT_CONN_RXFC_MAX_WND_MUL * DEFAULT_INIT_CONN_RXFC_WND,
-            get_time, ch))
-        goto err;
-
     for (pn_space = QUIC_PN_SPACE_INITIAL; pn_space < QUIC_PN_SPACE_NUM; ++pn_space)
         if (!ossl_quic_rxfc_init_standalone(&ch->crypto_rxfc[pn_space],
                 INIT_CRYPTO_RECV_BUF_LEN,
@@ -226,12 +200,12 @@ static int ch_init(QUIC_CHANNEL *ch)
             goto err;

     if (!ossl_quic_rxfc_init_standalone(&ch->max_streams_bidi_rxfc,
-            DEFAULT_INIT_CONN_MAX_STREAMS,
+            ch->tx_init_max_streams_bidi,
             get_time, ch))
         goto err;

     if (!ossl_quic_rxfc_init_standalone(&ch->max_streams_uni_rxfc,
-            DEFAULT_INIT_CONN_MAX_STREAMS,
+            ch->tx_init_max_streams_uni,
             get_time, ch))
         goto err;

@@ -252,7 +226,7 @@ static int ch_init(QUIC_CHANNEL *ch)
     if (!ossl_quic_stream_map_init(&ch->qsm, get_stream_limit, ch,
             &ch->max_streams_bidi_rxfc,
             &ch->max_streams_uni_rxfc,
-            ch->is_server))
+            ch))
         goto err;

     ch->have_qsm = 1;
@@ -261,9 +235,11 @@ static int ch_init(QUIC_CHANNEL *ch)
         && !ossl_quic_lcidm_generate_initial(ch->lcidm, ch, &ch->init_scid))
         goto err;

+    ch->rx_ack_delay_exp = QUIC_DEFAULT_ACK_DELAY_EXP;
+
     txp_args.cur_scid = ch->init_scid;
     txp_args.cur_dcid = ch->init_dcid;
-    txp_args.ack_delay_exponent = 3;
+    txp_args.ack_delay_exponent = ch->tx_ack_delay_exp;
     txp_args.qtx = ch->qtx;
     txp_args.txpim = ch->txpim;
     txp_args.cfq = ch->cfq;
@@ -369,16 +345,12 @@ static int ch_init(QUIC_CHANNEL *ch)
     if ((ch->qtls = ossl_quic_tls_new(&tls_args)) == NULL)
         goto err;

-    ch->tx_max_ack_delay = DEFAULT_MAX_ACK_DELAY;
     ch->rx_max_ack_delay = QUIC_DEFAULT_MAX_ACK_DELAY;
-    ch->rx_ack_delay_exp = QUIC_DEFAULT_ACK_DELAY_EXP;
     ch->rx_active_conn_id_limit = QUIC_MIN_ACTIVE_CONN_ID_LIMIT;
     ch->tx_enc_level = QUIC_ENC_LEVEL_INITIAL;
     ch->rx_enc_level = QUIC_ENC_LEVEL_INITIAL;
     ch->txku_threshold_override = UINT64_MAX;

-    ch->max_idle_timeout_local_req = QUIC_DEFAULT_IDLE_TIMEOUT;
-    ch->max_idle_timeout_remote_req = 0;
     ch->max_idle_timeout = ch->max_idle_timeout_local_req;

     ossl_ackm_set_tx_max_ack_delay(ch->ackm, ossl_ms2time(ch->tx_max_ack_delay));
@@ -394,6 +366,11 @@ err:
     return 0;
 }

+/*
+ * ch_cleanup() is idempotent: every owned pointer is NULL'd after its free,
+ * and every "have_*" flag is reset after its destructor runs. Calling this
+ * twice on the same channel is safe.
+ */
 static void ch_cleanup(QUIC_CHANNEL *ch)
 {
     uint32_t pn_space;
@@ -411,21 +388,34 @@ static void ch_cleanup(QUIC_CHANNEL *ch)
         ossl_quic_srtm_cull(ch->srtm, ch);

     ossl_quic_tx_packetiser_free(ch->txp);
+    ch->txp = NULL;
     ossl_quic_txpim_free(ch->txpim);
+    ch->txpim = NULL;
     ossl_quic_cfq_free(ch->cfq);
+    ch->cfq = NULL;
     ossl_qtx_free(ch->qtx);
-    if (ch->cc_data != NULL)
+    ch->qtx = NULL;
+    if (ch->cc_data != NULL) {
         ch->cc_method->free(ch->cc_data);
-    if (ch->have_statm)
+        ch->cc_data = NULL;
+    }
+    if (ch->have_statm) {
         ossl_statm_destroy(&ch->statm);
+        ch->have_statm = 0;
+    }
     ossl_ackm_free(ch->ackm);
+    ch->ackm = NULL;

-    if (ch->have_qsm)
+    if (ch->have_qsm) {
         ossl_quic_stream_map_cleanup(&ch->qsm);
+        ch->have_qsm = 0;
+    }

     for (pn_space = QUIC_PN_SPACE_INITIAL; pn_space < QUIC_PN_SPACE_NUM; ++pn_space) {
         ossl_quic_sstream_free(ch->crypto_send[pn_space]);
+        ch->crypto_send[pn_space] = NULL;
         ossl_quic_rstream_free(ch->crypto_recv[pn_space]);
+        ch->crypto_recv[pn_space] = NULL;
     }

     ossl_quic_rstream_qparm_destroy(ch->rsqp);
@@ -435,12 +425,19 @@ static void ch_cleanup(QUIC_CHANNEL *ch)
     ch->qrx_pkt = NULL;

     ossl_quic_tls_free(ch->qtls);
+    ch->qtls = NULL;
     ossl_qrx_free(ch->qrx);
+    ch->qrx = NULL;
     OPENSSL_free(ch->local_transport_params);
+    ch->local_transport_params = NULL;
     OPENSSL_free((char *)ch->terminate_cause.reason);
+    ch->terminate_cause.reason = NULL;
     OSSL_ERR_STATE_free(ch->err_state);
+    ch->err_state = NULL;
     OPENSSL_free(ch->ack_range_scratch);
+    ch->ack_range_scratch = NULL;
     OPENSSL_free(ch->pending_new_token);
+    ch->pending_new_token = NULL;

     if (ch->on_port_list) {
         ossl_list_ch_remove(&ch->port->channel_list, ch);
@@ -452,7 +449,9 @@ static void ch_cleanup(QUIC_CHANNEL *ch)
         ossl_qlog_flush(ch->qlog); /* best effort */

     OPENSSL_free(ch->qlog_title);
+    ch->qlog_title = NULL;
     ossl_qlog_free(ch->qlog);
+    ch->qlog = NULL;
 #endif
 }

@@ -474,7 +473,7 @@ void ossl_quic_channel_bind_qrx(QUIC_CHANNEL *tserver_ch, OSSL_QRX *qrx)

 QUIC_CHANNEL *ossl_quic_channel_alloc(const QUIC_CHANNEL_ARGS *args)
 {
-    QUIC_CHANNEL *ch = NULL;
+    QUIC_CHANNEL *ch;

     if ((ch = OPENSSL_zalloc(sizeof(*ch))) == NULL)
         return NULL;
@@ -490,14 +489,39 @@ QUIC_CHANNEL *ossl_quic_channel_alloc(const QUIC_CHANNEL_ARGS *args)
     ch->use_qlog = args->use_qlog;

     if (ch->use_qlog && args->qlog_title != NULL) {
-        if ((ch->qlog_title = OPENSSL_strdup(args->qlog_title)) == NULL) {
-            OPENSSL_free(ch);
-            return NULL;
-        }
+        if ((ch->qlog_title = OPENSSL_strdup(args->qlog_title)) == NULL)
+            goto err;
     }
 #endif

+    ch->max_idle_timeout_local_req = args->max_idle_timeout;
+    ch->tx_max_udp_payload_size = args->max_udp_payload_size;
+    ch->tx_init_max_data = args->init_max_data;
+    ch->tx_init_max_stream_data_bidi_local = args->init_max_stream_data_bidi_local;
+    ch->tx_init_max_stream_data_bidi_remote = args->init_max_stream_data_bidi_remote;
+    ch->tx_init_max_stream_data_uni = args->init_max_stream_data_uni;
+    ch->tx_init_max_streams_bidi = args->init_max_streams_bidi;
+    ch->tx_init_max_streams_uni = args->init_max_streams_uni;
+    ch->tx_ack_delay_exp = args->ack_delay_exponent;
+    ch->tx_max_ack_delay = args->max_ack_delay;
+    ch->tx_disable_active_migration = args->disable_active_migration;
+    ch->tx_active_conn_id_limit = args->active_conn_id_limit;
+
+    if (!ossl_quic_rxfc_init(&ch->conn_rxfc, NULL,
+            ch->tx_init_max_data,
+            DEFAULT_CONN_RXFC_MAX_WND_MUL * ch->tx_init_max_data,
+            get_time, ch)) {
+        goto err;
+    }
+
     return ch;
+
+err:
+#ifndef OPENSSL_NO_QLOG
+    OPENSSL_free(ch->qlog_title);
+#endif
+    OPENSSL_free(ch);
+    return NULL;
 }

 void ossl_quic_channel_free(QUIC_CHANNEL *ch)
@@ -570,6 +594,21 @@ SSL *ossl_quic_channel_get0_tls(QUIC_CHANNEL *ch)
     return ch->tls;
 }

+int ossl_quic_channel_set0_tls(QUIC_CHANNEL *ch, SSL *ssl)
+{
+    /*
+     * Rebind the handshake layer first, so that a failure leaves the channel
+     * entirely unmodified rather than with a TLS connection the handshake
+     * layer does not know about.
+     */
+    if (!ossl_assert(ch != NULL && ssl != NULL && ch->tls == NULL)
+        || !ossl_quic_tls_set0_ssl(ch->qtls, ssl))
+        return 0;
+
+    ch->tls = ssl;
+    return 1;
+}
+
 static void free_buf_mem(unsigned char *buf, size_t buf_len, void *arg)
 {
     BUF_MEM_free((BUF_MEM *)arg);
@@ -662,6 +701,43 @@ int ossl_quic_channel_is_term_any(const QUIC_CHANNEL *ch)
         || ossl_quic_channel_is_terminated(ch);
 }

+int ossl_quic_channel_is_server(const QUIC_CHANNEL *ch)
+{
+    return ch->is_server;
+}
+
+void ossl_quic_channel_notify_flush_done(QUIC_CHANNEL *ch)
+{
+    ch_record_state_transition(ch, ch->terminate_cause.remote ? QUIC_CHANNEL_STATE_TERMINATING_DRAINING : QUIC_CHANNEL_STATE_TERMINATING_CLOSING);
+    /*
+     * RFC 9000 s. 10.2 Immediate Close
+     *  These states SHOULD persist for at least three times
+     *  the current PTO interval as defined in [QUIC-RECOVERY].
+     */
+    ch->terminate_deadline
+        = ossl_time_add(get_time(ch),
+            ossl_time_multiply(ossl_ackm_get_pto_duration(ch->ackm), 3));
+    if (!ch->terminate_cause.remote) {
+        OSSL_QUIC_FRAME_CONN_CLOSE f = { 0 };
+
+        /* best effort */
+        f.error_code = ch->terminate_cause.error_code;
+        f.frame_type = ch->terminate_cause.frame_type;
+        f.is_app = ch->terminate_cause.app;
+        f.reason = (char *)ch->terminate_cause.reason;
+        f.reason_len = ch->terminate_cause.reason_len;
+        ossl_quic_tx_packetiser_schedule_conn_close(ch->txp, &f);
+        /*
+         * RFC 9000 s. 10.2.2 Draining Connection State:
+         *  An endpoint that receives a CONNECTION_CLOSE frame MAY
+         *  send a single packet containing a CONNECTION_CLOSE
+         *  frame before entering the draining state, using a
+         *  NO_ERROR code if appropriate
+         */
+        ch->conn_close_queued = 1;
+    }
+}
+
 const QUIC_TERMINATE_CAUSE *
 ossl_quic_channel_get_terminate_cause(const QUIC_CHANNEL *ch)
 {
@@ -1339,11 +1415,15 @@ static int ch_on_transport_params(const unsigned char *params,
     int got_disable_active_migration = 0;
     QUIC_CONN_ID cid;
     const char *reason = "bad transport parameter";
-    ossl_unused uint64_t rx_max_idle_timeout = 0;
     ossl_unused const void *stateless_reset_token_p = NULL;
     QUIC_PREFERRED_ADDR pfa;
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ch->tls);

+    if (sc == NULL) {
+        ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR, 0,
+            "could not get ssl connection");
+        return 0;
+    }
     /*
      * When HRR happens the client sends the transport params in the new client
      * hello again. Reset the transport params here and load them again.
@@ -1460,6 +1540,8 @@ static int ch_on_transport_params(const unsigned char *params,
                 goto malformed;
             }

+            ch->rx_init_max_data = v;
+
             ossl_quic_txfc_bump_cwm(&ch->conn_txfc, v);
             got_initial_max_data = 1;
             break;
@@ -1578,6 +1660,7 @@ static int ch_on_transport_params(const unsigned char *params,

             assert(ch->max_local_streams_bidi == 0);
             ch->max_local_streams_bidi = v;
+            ch->rx_init_max_streams_bidi = v;
             got_initial_max_streams_bidi = 1;
             break;

@@ -1596,6 +1679,7 @@ static int ch_on_transport_params(const unsigned char *params,

             assert(ch->max_local_streams_uni == 0);
             ch->max_local_streams_uni = v;
+            ch->rx_init_max_streams_uni = v;
             got_initial_max_streams_uni = 1;
             break;

@@ -1618,7 +1702,6 @@ static int ch_on_transport_params(const unsigned char *params,

             ch_update_idle(ch);
             got_max_idle_timeout = 1;
-            rx_max_idle_timeout = v;
             break;

         case QUIC_TPARAM_MAX_UDP_PAYLOAD_SIZE:
@@ -1629,7 +1712,8 @@ static int ch_on_transport_params(const unsigned char *params,
             }

             if (!ossl_quic_wire_decode_transport_param_int(&pkt, &id, &v)
-                || v < QUIC_MIN_INITIAL_DGRAM_LEN) {
+                || v < QUIC_MIN_INITIAL_DGRAM_LEN
+                || v > QUIC_MAX_MAX_UDP_PAYLOAD_SIZE) {
                 reason = TP_REASON_MALFORMED("MAX_UDP_PAYLOAD_SIZE");
                 goto malformed;
             }
@@ -1737,6 +1821,7 @@ static int ch_on_transport_params(const unsigned char *params,
                 goto malformed;
             }

+            ch->rx_disable_active_migration = 1;
             got_disable_active_migration = 1;
             break;

@@ -1805,10 +1890,10 @@ static int ch_on_transport_params(const unsigned char *params,
             ch->rx_init_max_stream_data_uni);
     if (got_initial_max_streams_bidi)
         QLOG_U64("initial_max_streams_bidi",
-            ch->max_local_streams_bidi);
+            ch->rx_init_max_streams_bidi);
     if (got_initial_max_streams_uni)
         QLOG_U64("initial_max_streams_uni",
-            ch->max_local_streams_uni);
+            ch->rx_init_max_streams_uni);
     if (got_ack_delay_exp)
         QLOG_U64("ack_delay_exponent", ch->rx_ack_delay_exp);
     if (got_max_ack_delay)
@@ -1816,7 +1901,7 @@ static int ch_on_transport_params(const unsigned char *params,
     if (got_max_udp_payload_size)
         QLOG_U64("max_udp_payload_size", ch->rx_max_udp_payload_size);
     if (got_max_idle_timeout)
-        QLOG_U64("max_idle_timeout", rx_max_idle_timeout);
+        QLOG_U64("max_idle_timeout", ch->max_idle_timeout_remote_req);
     if (got_active_conn_id_limit)
         QLOG_U64("active_connection_id_limit", ch->rx_active_conn_id_limit);
     if (got_stateless_reset_token)
@@ -1833,11 +1918,12 @@ static int ch_on_transport_params(const unsigned char *params,
         QLOG_CID("connection_id", &pfa.cid);
         QLOG_END()
     }
-    QLOG_BOOL("disable_active_migration", got_disable_active_migration);
+    QLOG_BOOL("disable_active_migration", ch->rx_disable_active_migration);
     QLOG_EVENT_END()
 #endif

-    if (got_initial_max_data || got_initial_max_stream_data_bidi_remote
+    if (got_initial_max_data
+        || got_initial_max_stream_data_bidi_remote || got_initial_max_stream_data_uni
         || got_initial_max_streams_bidi || got_initial_max_streams_uni)
         /*
          * If FC credit was bumped, we may now be able to send. Update all
@@ -1899,9 +1985,7 @@ static int ch_generate_transport_params(QUIC_CHANNEL *ch)

     wpkt_valid = 1;

-    if (ossl_quic_wire_encode_transport_param_bytes(&wpkt, QUIC_TPARAM_DISABLE_ACTIVE_MIGRATION,
-            NULL, 0)
-        == NULL)
+    if (ch->tx_disable_active_migration != 0 && ossl_quic_wire_encode_transport_param_bytes(&wpkt, QUIC_TPARAM_DISABLE_ACTIVE_MIGRATION, NULL, 0) == NULL)
         goto err;

     if (ch->is_server) {
@@ -1928,11 +2012,16 @@ static int ch_generate_transport_params(QUIC_CHANNEL *ch)
         goto err;

     if (!ossl_quic_wire_encode_transport_param_int(&wpkt, QUIC_TPARAM_MAX_UDP_PAYLOAD_SIZE,
-            QUIC_MIN_INITIAL_DGRAM_LEN))
+            ch->tx_max_udp_payload_size))
         goto err;

     if (!ossl_quic_wire_encode_transport_param_int(&wpkt, QUIC_TPARAM_ACTIVE_CONN_ID_LIMIT,
-            QUIC_MIN_ACTIVE_CONN_ID_LIMIT))
+            ch->tx_active_conn_id_limit))
+        goto err;
+
+    if (ch->tx_ack_delay_exp != QUIC_DEFAULT_ACK_DELAY_EXP
+        && !ossl_quic_wire_encode_transport_param_int(&wpkt, QUIC_TPARAM_ACK_DELAY_EXP,
+            ch->tx_ack_delay_exp))
         goto err;

     if (ch->tx_max_ack_delay != QUIC_DEFAULT_MAX_ACK_DELAY
@@ -1983,17 +2072,20 @@ static int ch_generate_transport_params(QUIC_CHANNEL *ch)
 #ifndef OPENSSL_NO_QLOG
     QLOG_EVENT_BEGIN(ch_get_qlog(ch), transport, parameters_set)
     QLOG_STR("owner", "local");
-    QLOG_BOOL("disable_active_migration", 1);
+    QLOG_BOOL("disable_active_migration", ch->tx_disable_active_migration);
     if (ch->is_server) {
         QLOG_CID("original_destination_connection_id", &ch->init_dcid);
         QLOG_CID("initial_source_connection_id", &ch->cur_local_cid);
     } else {
         QLOG_STR("initial_source_connection_id", "");
     }
-    QLOG_U64("max_idle_timeout", ch->max_idle_timeout);
-    QLOG_U64("max_udp_payload_size", QUIC_MIN_INITIAL_DGRAM_LEN);
-    QLOG_U64("active_connection_id_limit", QUIC_MIN_ACTIVE_CONN_ID_LIMIT);
-    QLOG_U64("max_ack_delay", ch->tx_max_ack_delay);
+    QLOG_U64("max_idle_timeout", ch->max_idle_timeout_local_req);
+    QLOG_U64("max_udp_payload_size", ch->tx_max_udp_payload_size);
+    QLOG_U64("active_connection_id_limit", ch->tx_active_conn_id_limit);
+    if (ch->tx_ack_delay_exp != QUIC_DEFAULT_ACK_DELAY_EXP)
+        QLOG_U64("ack_delay_exponent", ch->tx_ack_delay_exp);
+    if (ch->tx_max_ack_delay != QUIC_DEFAULT_MAX_ACK_DELAY)
+        QLOG_U64("max_ack_delay", ch->tx_max_ack_delay);
     QLOG_U64("initial_max_data", ossl_quic_rxfc_get_cwm(&ch->conn_rxfc));
     QLOG_U64("initial_max_stream_data_bidi_local",
         ch->tx_init_max_stream_data_bidi_local);
@@ -3114,14 +3206,17 @@ int ossl_quic_channel_on_handshake_confirmed(QUIC_CHANNEL *ch)
 static void copy_tcause(QUIC_TERMINATE_CAUSE *dst,
     const QUIC_TERMINATE_CAUSE *src)
 {
+    /*
+     * do not override reason once it got set.
+     */
+    if (dst->reason != NULL)
+        return;
+
     dst->error_code = src->error_code;
     dst->frame_type = src->frame_type;
     dst->app = src->app;
     dst->remote = src->remote;

-    dst->reason = NULL;
-    dst->reason_len = 0;
-
     if (src->reason != NULL && src->reason_len > 0) {
         size_t l = src->reason_len;
         char *r;
@@ -3133,15 +3228,28 @@ static void copy_tcause(QUIC_TERMINATE_CAUSE *dst,
          * If this fails, dst->reason becomes NULL and we simply do not use a
          * reason. This ensures termination is infallible.
          */
-        dst->reason = r = OPENSSL_memdup(src->reason, l + 1);
+        dst->reason = r = OPENSSL_malloc(l + 1);
         if (r == NULL)
             return;

+        memcpy(r, src->reason, l);
         r[l] = '\0';
         dst->reason_len = l;
     }
 }

+void ossl_quic_channel_set_tcause(QUIC_CHANNEL *ch, uint64_t app_error_code,
+    const char *app_reason)
+{
+    QUIC_TERMINATE_CAUSE tcause = { 0 };
+
+    tcause.app = 1;
+    tcause.error_code = app_error_code;
+    tcause.reason = app_reason;
+    tcause.reason_len = app_reason != NULL ? strlen(app_reason) : 0;
+    copy_tcause(&ch->terminate_cause, &tcause);
+}
+
 static void ch_start_terminating(QUIC_CHANNEL *ch,
     const QUIC_TERMINATE_CAUSE *tcause,
     int force_immediate)
@@ -3163,36 +3271,7 @@ static void ch_start_terminating(QUIC_CHANNEL *ch,
         ossl_qlog_event_connectivity_connection_closed(ch_get_qlog(ch), tcause);

         if (!force_immediate) {
-            ch_record_state_transition(ch, tcause->remote ? QUIC_CHANNEL_STATE_TERMINATING_DRAINING : QUIC_CHANNEL_STATE_TERMINATING_CLOSING);
-            /*
-             * RFC 9000 s. 10.2 Immediate Close
-             *  These states SHOULD persist for at least three times
-             *  the current PTO interval as defined in [QUIC-RECOVERY].
-             */
-            ch->terminate_deadline
-                = ossl_time_add(get_time(ch),
-                    ossl_time_multiply(ossl_ackm_get_pto_duration(ch->ackm),
-                        3));
-
-            if (!tcause->remote) {
-                OSSL_QUIC_FRAME_CONN_CLOSE f = { 0 };
-
-                /* best effort */
-                f.error_code = ch->terminate_cause.error_code;
-                f.frame_type = ch->terminate_cause.frame_type;
-                f.is_app = ch->terminate_cause.app;
-                f.reason = (char *)ch->terminate_cause.reason;
-                f.reason_len = ch->terminate_cause.reason_len;
-                ossl_quic_tx_packetiser_schedule_conn_close(ch->txp, &f);
-                /*
-                 * RFC 9000 s. 10.2.2 Draining Connection State:
-                 *  An endpoint that receives a CONNECTION_CLOSE frame MAY
-                 *  send a single packet containing a CONNECTION_CLOSE
-                 *  frame before entering the draining state, using a
-                 *  NO_ERROR code if appropriate
-                 */
-                ch->conn_close_queued = 1;
-            }
+            ossl_quic_channel_notify_flush_done(ch);
         } else {
             ch_on_terminating_timeout(ch);
         }
@@ -3265,7 +3344,8 @@ static int ch_enqueue_retire_conn_id(QUIC_CHANNEL *ch, uint64_t seq_num)
     WPACKET wpkt;
     size_t l;

-    ossl_quic_srtm_remove(ch->srtm, ch, seq_num);
+    if (!ossl_quic_srtm_remove(ch->srtm, ch, seq_num, NULL))
+        goto err;

     cfq_data_rtcid = OPENSSL_malloc(sizeof(CFQ_DATA_RETIRE_CID_T));
     if (cfq_data_rtcid == NULL)
@@ -3664,7 +3744,7 @@ static int ch_on_new_conn_common(QUIC_CHANNEL *ch, const BIO_ADDR *peer,
     const QUIC_CONN_ID *peer_odcid)
 {
     /* Note our newly learnt peer address and CIDs. */
-    if (!BIO_ADDR_copy(&ch->cur_peer_addr, peer))
+    if (!ossl_quic_channel_set_peer_addr(ch, peer))
         return 0;

     ch->init_dcid = *peer_dcid;
@@ -3756,10 +3836,11 @@ int ossl_quic_bind_channel(QUIC_CHANNEL *ch, const BIO_ADDR *peer,
     if (!ossl_assert(ch->state == QUIC_CHANNEL_STATE_IDLE && ch->is_server))
         return 0;

-    ch->cur_local_cid = *peer_dcid;
     if (!ossl_quic_lcidm_bind_channel(ch->lcidm, ch, peer_dcid))
         return 0;

+    ch->cur_local_cid = *peer_dcid;
+
     /*
      * peer_odcid <=> is initial dst conn id chosen by peer in its
      * first initial packet we received without token.
@@ -4091,10 +4172,15 @@ int ossl_quic_channel_have_generated_transport_params(const QUIC_CHANNEL *ch)
     return ch->got_local_transport_params;
 }

-void ossl_quic_channel_set_max_idle_timeout_request(QUIC_CHANNEL *ch, uint64_t ms)
+int ossl_quic_channel_set_max_idle_timeout_request(QUIC_CHANNEL *ch, uint64_t ms)
 {
+    if (ossl_quic_channel_have_generated_transport_params(ch))
+        return 0;
+
     ch->max_idle_timeout_local_req = ms;
+    return 1;
 }
+
 uint64_t ossl_quic_channel_get_max_idle_timeout_request(const QUIC_CHANNEL *ch)
 {
     return ch->max_idle_timeout_local_req;
@@ -4110,6 +4196,211 @@ uint64_t ossl_quic_channel_get_max_idle_timeout_actual(const QUIC_CHANNEL *ch)
     return ch->max_idle_timeout;
 }

+int ossl_quic_channel_set_max_udp_payload_size_request(QUIC_CHANNEL *ch, uint64_t size)
+{
+    if (ossl_quic_channel_have_generated_transport_params(ch))
+        return 0;
+
+    ch->tx_max_udp_payload_size = size;
+    return 1;
+}
+
+uint64_t ossl_quic_channel_get_max_udp_payload_size_request(const QUIC_CHANNEL *ch)
+{
+    return ch->tx_max_udp_payload_size;
+}
+
+uint64_t ossl_quic_channel_get_max_udp_payload_size_peer_request(const QUIC_CHANNEL *ch)
+{
+    return ch->rx_max_udp_payload_size;
+}
+
+int ossl_quic_channel_set_max_data_request(QUIC_CHANNEL *ch, uint64_t max_data)
+{
+    if (ossl_quic_channel_have_generated_transport_params(ch))
+        return 0;
+
+    if (max_data > UINT64_MAX / DEFAULT_CONN_RXFC_MAX_WND_MUL)
+        return 0;
+
+    if (!ossl_quic_rxfc_init(&ch->conn_rxfc, NULL,
+            max_data, DEFAULT_CONN_RXFC_MAX_WND_MUL * max_data,
+            get_time, ch))
+        return 0;
+
+    ch->tx_init_max_data = max_data;
+
+    return 1;
+}
+
+uint64_t ossl_quic_channel_get_max_data_request(const QUIC_CHANNEL *ch)
+{
+    return ch->tx_init_max_data;
+}
+
+uint64_t ossl_quic_channel_get_max_data_peer_request(const QUIC_CHANNEL *ch)
+{
+    return ch->rx_init_max_data;
+}
+
+int ossl_quic_channel_set_max_stream_data_request(QUIC_CHANNEL *ch, uint64_t max_data, int is_uni, int is_remote)
+{
+    if (ossl_quic_channel_have_generated_transport_params(ch))
+        return 0;
+
+    /* no need to update fc here since no stream is created yet */
+    if (is_uni) {
+        ch->tx_init_max_stream_data_uni = max_data;
+    } else {
+        if (is_remote)
+            ch->tx_init_max_stream_data_bidi_remote = max_data;
+        else
+            ch->tx_init_max_stream_data_bidi_local = max_data;
+    }
+
+    return 1;
+}
+
+uint64_t ossl_quic_channel_get_max_stream_data_request(const QUIC_CHANNEL *ch, int is_uni, int is_remote)
+{
+    if (is_uni)
+        return ch->tx_init_max_stream_data_uni;
+    else
+        return is_remote ? ch->tx_init_max_stream_data_bidi_remote : ch->tx_init_max_stream_data_bidi_local;
+}
+
+uint64_t ossl_quic_channel_get_max_stream_data_peer_request(const QUIC_CHANNEL *ch, int is_uni, int is_remote)
+{
+    if (is_uni)
+        return ch->rx_init_max_stream_data_uni;
+    else
+        return is_remote ? ch->rx_init_max_stream_data_bidi_remote : ch->rx_init_max_stream_data_bidi_local;
+}
+
+int ossl_quic_channel_set_max_streams_request(QUIC_CHANNEL *ch, uint64_t max_streams, int is_uni)
+{
+    if (ossl_quic_channel_have_generated_transport_params(ch))
+        return 0;
+
+    if (is_uni) {
+        if (!ossl_quic_rxfc_init_standalone(&ch->max_streams_uni_rxfc,
+                max_streams, get_time, ch))
+            return 0;
+
+        ch->tx_init_max_streams_uni = max_streams;
+    } else {
+        if (!ossl_quic_rxfc_init_standalone(&ch->max_streams_bidi_rxfc,
+                max_streams, get_time, ch))
+            return 0;
+
+        ch->tx_init_max_streams_bidi = max_streams;
+    }
+
+    return 1;
+}
+
+uint64_t ossl_quic_channel_get_max_streams_request(const QUIC_CHANNEL *ch, int is_uni)
+{
+    return is_uni ? ch->tx_init_max_streams_uni : ch->tx_init_max_streams_bidi;
+}
+
+uint64_t ossl_quic_channel_get_max_streams_peer_request(const QUIC_CHANNEL *ch, int is_uni)
+{
+    return is_uni ? ch->rx_init_max_streams_uni : ch->rx_init_max_streams_bidi;
+}
+
+int ossl_quic_channel_set_ack_delay_exponent_request(QUIC_CHANNEL *ch, uint64_t exp)
+{
+    if (ossl_quic_channel_have_generated_transport_params(ch))
+        return 0;
+
+    /*
+     * ossl_quic_tx_packetiser_args_st::ack_delay_exponent is uint32_t,
+     * but quic_channel_st::tx_ack_delay_exp is unsigned char, checking
+     * against the smaller type.
+     */
+    if (exp > UCHAR_MAX)
+        return 0;
+
+    if (!ossl_quic_tx_packetiser_set_ack_delay_exponent(ch->txp, (uint32_t)exp))
+        return 0;
+
+    ch->tx_ack_delay_exp = (unsigned char)exp;
+
+    return 1;
+}
+
+uint64_t ossl_quic_channel_get_ack_delay_exponent_request(const QUIC_CHANNEL *ch)
+{
+    return ch->tx_ack_delay_exp;
+}
+
+uint64_t ossl_quic_channel_get_ack_delay_exponent_peer_request(const QUIC_CHANNEL *ch)
+{
+    return ch->rx_ack_delay_exp;
+}
+
+int ossl_quic_channel_set_max_ack_delay_request(QUIC_CHANNEL *ch, uint64_t ms)
+{
+    if (ossl_quic_channel_have_generated_transport_params(ch))
+        return 0;
+
+    ch->tx_max_ack_delay = ms;
+    ossl_ackm_set_tx_max_ack_delay(ch->ackm, ossl_ms2time(ch->tx_max_ack_delay));
+    return 1;
+}
+
+uint64_t ossl_quic_channel_get_max_ack_delay_request(const QUIC_CHANNEL *ch)
+{
+    return ch->tx_max_ack_delay;
+}
+
+uint64_t ossl_quic_channel_get_max_ack_delay_peer_request(const QUIC_CHANNEL *ch)
+{
+    return ch->rx_max_ack_delay;
+}
+
+int ossl_quic_channel_set_disable_active_migration_request(QUIC_CHANNEL *ch, uint64_t disable)
+{
+    if (ossl_quic_channel_have_generated_transport_params(ch))
+        return 0;
+
+    if (disable > UCHAR_MAX)
+        return 0;
+
+    ch->tx_disable_active_migration = (unsigned char)disable;
+    return 1;
+}
+
+uint64_t ossl_quic_channel_get_disable_active_migration_request(const QUIC_CHANNEL *ch)
+{
+    return ch->tx_disable_active_migration;
+}
+
+uint64_t ossl_quic_channel_get_disable_active_migration_peer_request(const QUIC_CHANNEL *ch)
+{
+    return ch->rx_disable_active_migration;
+}
+
+int ossl_quic_channel_set_active_conn_id_limit_request(QUIC_CHANNEL *ch, uint64_t limit)
+{
+    if (ossl_quic_channel_have_generated_transport_params(ch))
+        return 0;
+
+    ch->tx_active_conn_id_limit = limit;
+    return 1;
+}
+
+uint64_t ossl_quic_channel_get_active_conn_id_limit_request(const QUIC_CHANNEL *ch)
+{
+    return ch->tx_active_conn_id_limit;
+}
+
+uint64_t ossl_quic_channel_get_active_conn_id_limit_peer_request(const QUIC_CHANNEL *ch)
+{
+    return ch->rx_active_conn_id_limit;
+}
+
 uint64_t ossl_quic_channel_get_path_challenge_count(const QUIC_CHANNEL *ch)
 {
     return ch->path_challenge_rx;
diff --git a/deps/openssl/openssl/ssl/quic/quic_channel_local.h b/deps/openssl/openssl/ssl/quic/quic_channel_local.h
index 385dbfb2c40..2d55f95f2c1 100644
--- a/deps/openssl/openssl/ssl/quic/quic_channel_local.h
+++ b/deps/openssl/openssl/ssl/quic/quic_channel_local.h
@@ -1,3 +1,12 @@
+/*
+ * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
 #ifndef OSSL_QUIC_CHANNEL_LOCAL_H
 #define OSSL_QUIC_CHANNEL_LOCAL_H

@@ -170,17 +179,27 @@ struct quic_channel_st {
     uint64_t cur_retire_prior_to;

     /* Transport parameter values we send to our peer. */
+    uint64_t tx_init_max_data;
     uint64_t tx_init_max_stream_data_bidi_local;
     uint64_t tx_init_max_stream_data_bidi_remote;
     uint64_t tx_init_max_stream_data_uni;
+    uint64_t tx_init_max_streams_bidi;
+    uint64_t tx_init_max_streams_uni;
     uint64_t tx_max_ack_delay; /* ms */
+    unsigned char tx_ack_delay_exp;
+    unsigned char tx_disable_active_migration;
+    uint64_t tx_active_conn_id_limit;

-    /* Transport parameter values received from server. */
+    /* Transport parameter values received from peer. */
+    uint64_t rx_init_max_data;
     uint64_t rx_init_max_stream_data_bidi_local;
     uint64_t rx_init_max_stream_data_bidi_remote;
     uint64_t rx_init_max_stream_data_uni;
+    uint64_t rx_init_max_streams_bidi;
+    uint64_t rx_init_max_streams_uni;
     uint64_t rx_max_ack_delay; /* ms */
     unsigned char rx_ack_delay_exp;
+    unsigned char rx_disable_active_migration;

     /* Diagnostic counters for testing purposes only. May roll over. */
     uint16_t diag_num_rx_ack; /* Number of ACK frames received */
@@ -210,6 +229,11 @@ struct quic_channel_st {
      * negotiated by transport parameters.
      */
     uint64_t rx_max_udp_payload_size;
+    /*
+     * Maximum payload size in bytes for datagrams received from our peer, as
+     * negotiated by transport parameters.
+     */
+    uint64_t tx_max_udp_payload_size;
     /* Maximum active CID limit, as negotiated by transport parameters. */
     uint64_t rx_active_conn_id_limit;

diff --git a/deps/openssl/openssl/ssl/quic/quic_demux.c b/deps/openssl/openssl/ssl/quic/quic_demux.c
index 8fb4adb8c1d..6a7abe762e4 100644
--- a/deps/openssl/openssl/ssl/quic/quic_demux.c
+++ b/deps/openssl/openssl/ssl/quic/quic_demux.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -9,21 +9,26 @@

 #include "internal/quic_demux.h"
 #include "internal/quic_wire_pkt.h"
+#include "internal/dgram_demux.h"
 #include "internal/common.h"
 #include <openssl/lhash.h>
 #include <openssl/err.h>

-#define URXE_DEMUX_STATE_FREE 0 /* on urx_free list */
-#define URXE_DEMUX_STATE_PENDING 1 /* on urx_pending list */
-#define URXE_DEMUX_STATE_ISSUED 2 /* on neither list */
-
-#define DEMUX_MAX_MSGS_PER_CALL 32
-
-#define DEMUX_DEFAULT_MTU 1500
-
+/*
+ * QUIC Demuxer Implementation
+ * ===========================
+ *
+ * The QUIC demuxer wraps the generic DGRAM_DEMUX to add QUIC-specific
+ * functionality:
+ *   - Extraction of DCID from the first packet in each datagram
+ *   - QUIC-specific callback signature that includes the DCID
+ *
+ * QUIC_URXE is a typedef to DGRAM_URXE, so all URXE management is delegated
+ * to the underlying DGRAM_DEMUX.
+ */
 struct quic_demux_st {
-    /* The underlying transport BIO with datagram semantics. */
-    BIO *net_bio;
+    /* The underlying generic datagram demuxer. */
+    DGRAM_DEMUX *dgram_demux;

     /*
      * QUIC short packets do not contain the length of the connection ID field,
@@ -32,41 +37,38 @@ struct quic_demux_st {
      */
     size_t short_conn_id_len;

-    /*
-     * Our current understanding of the upper bound on an incoming datagram size
-     * in bytes.
-     */
-    size_t mtu;
-
-    /* The datagram_id to use for the next datagram we receive. */
-    uint64_t next_datagram_id;
-
-    /* Time retrieval callback. */
-    OSSL_TIME (*now)(void *arg);
-    void *now_arg;
-
-    /* The default packet handler, if any. */
+    /* The QUIC-specific packet handler callback (includes DCID). */
     ossl_quic_demux_cb_fn *default_cb;
     void *default_cb_arg;
+};

-    /*
-     * List of URXEs which are not currently in use (i.e., not filled with
-     * unconsumed data). These are moved to the pending list as they are filled.
-     */
-    QUIC_URXE_LIST urx_free;
+/*
+ * Internal callback that wraps the QUIC callback. This is called by
+ * DGRAM_DEMUX for each received datagram. We extract the DCID and forward
+ * to the QUIC-specific callback.
+ */
+static void quic_demux_dgram_cb(DGRAM_URXE *e, void *arg)
+{
+    QUIC_DEMUX *demux = arg;

-    /*
-     * List of URXEs which are filled with received encrypted data. These are
-     * removed from this list as we invoke the callbacks for each of them. They
-     * are then not on any list managed by us; we forget about them until our
-     * user calls ossl_quic_demux_release_urxe to return the URXE to us, at
-     * which point we add it to the free list.
-     */
-    QUIC_URXE_LIST urx_pending;
+    if (demux->default_cb != NULL) {
+        QUIC_CONN_ID dst_conn_id;
+        int dst_conn_id_ok;

-    /* Whether to use local address support. */
-    char use_local_addr;
-};
+        /* Extract DCID from the first packet in the datagram. */
+        dst_conn_id_ok = ossl_quic_wire_get_pkt_hdr_dst_conn_id(
+            ossl_quic_urxe_data(e),
+            e->data_len,
+            demux->short_conn_id_len,
+            &dst_conn_id);
+
+        demux->default_cb(e, demux->default_cb_arg,
+            dst_conn_id_ok ? &dst_conn_id : NULL);
+    } else {
+        /* No handler set, release the URXE back to the demuxer. */
+        ossl_dgram_demux_release_urxe(demux->dgram_demux, e);
+    }
+}

 QUIC_DEMUX *ossl_quic_demux_new(BIO *net_bio,
     size_t short_conn_id_len,
@@ -79,30 +81,24 @@ QUIC_DEMUX *ossl_quic_demux_new(BIO *net_bio,
     if (demux == NULL)
         return NULL;

-    demux->net_bio = net_bio;
     demux->short_conn_id_len = short_conn_id_len;
-    /* We update this if possible when we get a BIO. */
-    demux->mtu = DEMUX_DEFAULT_MTU;
-    demux->now = now;
-    demux->now_arg = now_arg;
-
-    if (net_bio != NULL
-        && BIO_dgram_get_local_addr_cap(net_bio)
-        && BIO_dgram_set_local_addr_enable(net_bio, 1))
-        demux->use_local_addr = 1;

-    return demux;
-}
+    /* Create the underlying generic demuxer (no internal locking for QUIC). */
+    demux->dgram_demux = ossl_dgram_demux_new(net_bio, 0, now, now_arg);
+    if (demux->dgram_demux == NULL) {
+        OPENSSL_free(demux);
+        return NULL;
+    }

-static void demux_free_urxl(QUIC_URXE_LIST *l)
-{
-    QUIC_URXE *e, *enext;
+    /*
+     * Set our internal wrapper callback on the DGRAM_DEMUX. This will be
+     * called for every received datagram, and we'll extract the DCID and
+     * forward to the QUIC-specific callback.
+     */
+    ossl_dgram_demux_set_default_handler(demux->dgram_demux,
+        quic_demux_dgram_cb, demux);

-    for (e = ossl_list_urxe_head(l); e != NULL; e = enext) {
-        enext = ossl_list_urxe_next(e);
-        ossl_list_urxe_remove(l, e);
-        OPENSSL_free(e);
-    }
+    return demux;
 }

 void ossl_quic_demux_free(QUIC_DEMUX *demux)
@@ -110,38 +106,18 @@ void ossl_quic_demux_free(QUIC_DEMUX *demux)
     if (demux == NULL)
         return;

-    /* Free all URXEs we are holding. */
-    demux_free_urxl(&demux->urx_free);
-    demux_free_urxl(&demux->urx_pending);
-
+    ossl_dgram_demux_free(demux->dgram_demux);
     OPENSSL_free(demux);
 }

 void ossl_quic_demux_set_bio(QUIC_DEMUX *demux, BIO *net_bio)
 {
-    unsigned int mtu;
-
-    demux->net_bio = net_bio;
-
-    if (net_bio != NULL) {
-        /*
-         * Try to determine our MTU if possible. The BIO is not required to
-         * support this, in which case we remain at the last known MTU, or our
-         * initial default.
-         */
-        mtu = BIO_dgram_get_mtu(net_bio);
-        if (mtu >= QUIC_MIN_INITIAL_DGRAM_LEN)
-            ossl_quic_demux_set_mtu(demux, mtu); /* best effort */
-    }
+    ossl_dgram_demux_set_bio(demux->dgram_demux, net_bio);
 }

 int ossl_quic_demux_set_mtu(QUIC_DEMUX *demux, unsigned int mtu)
 {
-    if (mtu < QUIC_MIN_INITIAL_DGRAM_LEN)
-        return 0;
-
-    demux->mtu = mtu;
-    return 1;
+    return ossl_dgram_demux_set_mtu(demux->dgram_demux, mtu);
 }

 void ossl_quic_demux_set_default_handler(QUIC_DEMUX *demux,
@@ -152,257 +128,25 @@ void ossl_quic_demux_set_default_handler(QUIC_DEMUX *demux,
     demux->default_cb_arg = cb_arg;
 }

-static QUIC_URXE *demux_alloc_urxe(size_t alloc_len)
-{
-    QUIC_URXE *e;
-
-    if (alloc_len >= SIZE_MAX - sizeof(QUIC_URXE))
-        return NULL;
-
-    e = OPENSSL_malloc(sizeof(QUIC_URXE) + alloc_len);
-    if (e == NULL)
-        return NULL;
-
-    ossl_list_urxe_init_elem(e);
-    e->alloc_len = alloc_len;
-    e->data_len = 0;
-    return e;
-}
-
-static QUIC_URXE *demux_resize_urxe(QUIC_DEMUX *demux, QUIC_URXE *e,
-    size_t new_alloc_len)
-{
-    QUIC_URXE *e2, *prev;
-
-    if (!ossl_assert(e->demux_state == URXE_DEMUX_STATE_FREE))
-        /* Never attempt to resize a URXE which is not on the free list. */
-        return NULL;
-
-    prev = ossl_list_urxe_prev(e);
-    ossl_list_urxe_remove(&demux->urx_free, e);
-
-    if (new_alloc_len >= SIZE_MAX - sizeof(QUIC_URXE))
-        return NULL;
-
-    e2 = OPENSSL_realloc(e, sizeof(QUIC_URXE) + new_alloc_len);
-    if (e2 == NULL) {
-        /* Failed to resize, abort. */
-        if (prev == NULL)
-            ossl_list_urxe_insert_head(&demux->urx_free, e);
-        else
-            ossl_list_urxe_insert_after(&demux->urx_free, prev, e);
-
-        return NULL;
-    }
-
-    if (prev == NULL)
-        ossl_list_urxe_insert_head(&demux->urx_free, e2);
-    else
-        ossl_list_urxe_insert_after(&demux->urx_free, prev, e2);
-
-    e2->alloc_len = new_alloc_len;
-    return e2;
-}
-
-static QUIC_URXE *demux_reserve_urxe(QUIC_DEMUX *demux, QUIC_URXE *e,
-    size_t alloc_len)
-{
-    return e->alloc_len < alloc_len ? demux_resize_urxe(demux, e, alloc_len) : e;
-}
-
-static int demux_ensure_free_urxe(QUIC_DEMUX *demux, size_t min_num_free)
-{
-    QUIC_URXE *e;
-
-    while (ossl_list_urxe_num(&demux->urx_free) < min_num_free) {
-        e = demux_alloc_urxe(demux->mtu);
-        if (e == NULL)
-            return 0;
-
-        ossl_list_urxe_insert_tail(&demux->urx_free, e);
-        e->demux_state = URXE_DEMUX_STATE_FREE;
-    }
-
-    return 1;
-}
-
-/*
- * Receive datagrams from network, placing them into URXEs.
- *
- * Returns 1 on success or 0 on failure.
- *
- * Precondition: at least one URXE is free
- * Precondition: there are no pending URXEs
- */
-static int demux_recv(QUIC_DEMUX *demux)
-{
-    BIO_MSG msg[DEMUX_MAX_MSGS_PER_CALL];
-    size_t rd, i;
-    QUIC_URXE *urxe = ossl_list_urxe_head(&demux->urx_free), *unext;
-    OSSL_TIME now;
-
-    /* This should never be called when we have any pending URXE. */
-    assert(ossl_list_urxe_head(&demux->urx_pending) == NULL);
-    assert(urxe->demux_state == URXE_DEMUX_STATE_FREE);
-
-    if (demux->net_bio == NULL)
-        /*
-         * If no BIO is plugged in, treat this as no datagram being available.
-         */
-        return QUIC_DEMUX_PUMP_RES_TRANSIENT_FAIL;
-
-    /*
-     * Opportunistically receive as many messages as possible in a single
-     * syscall, determined by how many free URXEs are available.
-     */
-    for (i = 0; i < (ossl_ssize_t)OSSL_NELEM(msg);
-        ++i, urxe = ossl_list_urxe_next(urxe)) {
-        if (urxe == NULL) {
-            /* We need at least one URXE to receive into. */
-            if (!ossl_assert(i > 0))
-                return QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL;
-
-            break;
-        }
-
-        /* Ensure the URXE is big enough. */
-        urxe = demux_reserve_urxe(demux, urxe, demux->mtu);
-        if (urxe == NULL)
-            /* Allocation error, fail. */
-            return QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL;
-
-        /* Ensure we zero any fields added to BIO_MSG at a later date. */
-        memset(&msg[i], 0, sizeof(BIO_MSG));
-        msg[i].data = ossl_quic_urxe_data(urxe);
-        msg[i].data_len = urxe->alloc_len;
-        msg[i].peer = &urxe->peer;
-        BIO_ADDR_clear(&urxe->peer);
-        if (demux->use_local_addr)
-            msg[i].local = &urxe->local;
-        else
-            BIO_ADDR_clear(&urxe->local);
-    }
-
-    ERR_set_mark();
-    if (!BIO_recvmmsg(demux->net_bio, msg, sizeof(BIO_MSG), i, 0, &rd)) {
-        if (BIO_err_is_non_fatal(ERR_peek_last_error())) {
-            /* Transient error, clear the error and stop. */
-            ERR_pop_to_mark();
-            return QUIC_DEMUX_PUMP_RES_TRANSIENT_FAIL;
-        } else {
-            /* Non-transient error, do not clear the error. */
-            ERR_clear_last_mark();
-            return QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL;
-        }
-    }
-
-    ERR_clear_last_mark();
-    now = demux->now != NULL ? demux->now(demux->now_arg) : ossl_time_zero();
-
-    urxe = ossl_list_urxe_head(&demux->urx_free);
-    for (i = 0; i < rd; ++i, urxe = unext) {
-        unext = ossl_list_urxe_next(urxe);
-        /* Set URXE with actual length of received datagram. */
-        urxe->data_len = msg[i].data_len;
-        /* Time we received datagram. */
-        urxe->time = now;
-        urxe->datagram_id = demux->next_datagram_id++;
-        /* Move from free list to pending list. */
-        ossl_list_urxe_remove(&demux->urx_free, urxe);
-        ossl_list_urxe_insert_tail(&demux->urx_pending, urxe);
-        urxe->demux_state = URXE_DEMUX_STATE_PENDING;
-    }
-
-    return QUIC_DEMUX_PUMP_RES_OK;
-}
-
-/* Extract destination connection ID from the first packet in a datagram. */
-static int demux_identify_conn_id(QUIC_DEMUX *demux,
-    QUIC_URXE *e,
-    QUIC_CONN_ID *dst_conn_id)
-{
-    return ossl_quic_wire_get_pkt_hdr_dst_conn_id(ossl_quic_urxe_data(e),
-        e->data_len,
-        demux->short_conn_id_len,
-        dst_conn_id);
-}
-
-/*
- * Process a single pending URXE.
- * Returning 1 on success, 0 on failure.
- */
-static int demux_process_pending_urxe(QUIC_DEMUX *demux, QUIC_URXE *e)
-{
-    QUIC_CONN_ID dst_conn_id;
-    int dst_conn_id_ok = 0;
-
-    /* The next URXE we process should be at the head of the pending list. */
-    if (!ossl_assert(e == ossl_list_urxe_head(&demux->urx_pending)))
-        return 0;
-
-    assert(e->demux_state == URXE_DEMUX_STATE_PENDING);
-
-    /* Determine the DCID of the first packet in the datagram. */
-    dst_conn_id_ok = demux_identify_conn_id(demux, e, &dst_conn_id);
-
-    ossl_list_urxe_remove(&demux->urx_pending, e);
-    if (demux->default_cb != NULL) {
-        /*
-         * Pass to default handler for routing. The URXE now belongs to the
-         * callback.
-         */
-        e->demux_state = URXE_DEMUX_STATE_ISSUED;
-        demux->default_cb(e, demux->default_cb_arg,
-            dst_conn_id_ok ? &dst_conn_id : NULL);
-    } else {
-        /* Discard. */
-        ossl_list_urxe_insert_tail(&demux->urx_free, e);
-        e->demux_state = URXE_DEMUX_STATE_FREE;
-    }
-
-    return 1; /* keep processing pending URXEs */
-}
-
-/* Process pending URXEs to generate callbacks. */
-static int demux_process_pending_urxl(QUIC_DEMUX *demux)
-{
-    QUIC_URXE *e;
-    int ret;
-
-    while ((e = ossl_list_urxe_head(&demux->urx_pending)) != NULL)
-        if ((ret = demux_process_pending_urxe(demux, e)) <= 0)
-            return ret;
-
-    return 1;
-}
-
-/*
- * Drain the pending URXE list, processing any pending URXEs by making their
- * callbacks. If no URXEs are pending, a network read is attempted first.
- */
 int ossl_quic_demux_pump(QUIC_DEMUX *demux)
 {
     int ret;

-    if (ossl_list_urxe_head(&demux->urx_pending) == NULL) {
-        ret = demux_ensure_free_urxe(demux, DEMUX_MAX_MSGS_PER_CALL);
-        if (ret != 1)
-            return QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL;
+    ret = ossl_dgram_demux_pump(demux->dgram_demux);

-        ret = demux_recv(demux);
-        if (ret != QUIC_DEMUX_PUMP_RES_OK)
-            return ret;
-
-        /*
-         * If demux_recv returned successfully, we should always have something.
-         */
-        assert(ossl_list_urxe_head(&demux->urx_pending) != NULL);
-    }
-
-    if ((ret = demux_process_pending_urxl(demux)) <= 0)
+    /*
+     * Map DGRAM_DEMUX_PUMP_RES_* to QUIC_DEMUX_PUMP_RES_*. The values are
+     * identical, but this provides documentation and future-proofing.
+     */
+    switch (ret) {
+    case DGRAM_DEMUX_PUMP_RES_OK:
+        return QUIC_DEMUX_PUMP_RES_OK;
+    case DGRAM_DEMUX_PUMP_RES_TRANSIENT_FAIL:
+        return QUIC_DEMUX_PUMP_RES_TRANSIENT_FAIL;
+    case DGRAM_DEMUX_PUMP_RES_PERMANENT_FAIL:
+    default:
         return QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL;
-
-    return QUIC_DEMUX_PUMP_RES_OK;
+    }
 }

 /* Artificially inject a packet into the demuxer for testing purposes. */
@@ -412,66 +156,22 @@ int ossl_quic_demux_inject(QUIC_DEMUX *demux,
     const BIO_ADDR *peer,
     const BIO_ADDR *local)
 {
-    int ret;
-    QUIC_URXE *urxe;
-
-    ret = demux_ensure_free_urxe(demux, 1);
-    if (ret != 1)
-        return 0;
-
-    urxe = ossl_list_urxe_head(&demux->urx_free);
-
-    assert(urxe->demux_state == URXE_DEMUX_STATE_FREE);
-
-    urxe = demux_reserve_urxe(demux, urxe, buf_len);
-    if (urxe == NULL)
-        return 0;
-
-    memcpy(ossl_quic_urxe_data(urxe), buf, buf_len);
-    urxe->data_len = buf_len;
-
-    if (peer != NULL)
-        urxe->peer = *peer;
-    else
-        BIO_ADDR_clear(&urxe->peer);
-
-    if (local != NULL)
-        urxe->local = *local;
-    else
-        BIO_ADDR_clear(&urxe->local);
-
-    urxe->time
-        = demux->now != NULL ? demux->now(demux->now_arg) : ossl_time_zero();
-
-    /* Move from free list to pending list. */
-    ossl_list_urxe_remove(&demux->urx_free, urxe);
-    urxe->datagram_id = demux->next_datagram_id++;
-    ossl_list_urxe_insert_tail(&demux->urx_pending, urxe);
-    urxe->demux_state = URXE_DEMUX_STATE_PENDING;
-
-    return demux_process_pending_urxl(demux) > 0;
+    return ossl_dgram_demux_inject(demux->dgram_demux, buf, buf_len,
+        peer, local);
 }

 /* Called by our user to return a URXE to the free list. */
-void ossl_quic_demux_release_urxe(QUIC_DEMUX *demux,
-    QUIC_URXE *e)
+void ossl_quic_demux_release_urxe(QUIC_DEMUX *demux, QUIC_URXE *e)
 {
-    assert(ossl_list_urxe_prev(e) == NULL && ossl_list_urxe_next(e) == NULL);
-    assert(e->demux_state == URXE_DEMUX_STATE_ISSUED);
-    ossl_list_urxe_insert_tail(&demux->urx_free, e);
-    e->demux_state = URXE_DEMUX_STATE_FREE;
+    ossl_dgram_demux_release_urxe(demux->dgram_demux, e);
 }

-void ossl_quic_demux_reinject_urxe(QUIC_DEMUX *demux,
-    QUIC_URXE *e)
+void ossl_quic_demux_reinject_urxe(QUIC_DEMUX *demux, QUIC_URXE *e)
 {
-    assert(ossl_list_urxe_prev(e) == NULL && ossl_list_urxe_next(e) == NULL);
-    assert(e->demux_state == URXE_DEMUX_STATE_ISSUED);
-    ossl_list_urxe_insert_head(&demux->urx_pending, e);
-    e->demux_state = URXE_DEMUX_STATE_PENDING;
+    ossl_dgram_demux_reinject_urxe(demux->dgram_demux, e);
 }

 int ossl_quic_demux_has_pending(const QUIC_DEMUX *demux)
 {
-    return ossl_list_urxe_head(&demux->urx_pending) != NULL;
+    return ossl_dgram_demux_has_pending(demux->dgram_demux);
 }
diff --git a/deps/openssl/openssl/ssl/quic/quic_impl.c b/deps/openssl/openssl/ssl/quic/quic_impl.c
index 13bb007fa49..a858a8c04a5 100644
--- a/deps/openssl/openssl/ssl/quic/quic_impl.c
+++ b/deps/openssl/openssl/ssl/quic/quic_impl.c
@@ -307,8 +307,10 @@ static int expect_quic_as(const SSL *s, QCTX *ctx, uint32_t flags)
     case SSL_TYPE_QUIC_CONNECTION:
         qc = (QUIC_CONNECTION *)s;
         ctx->obj = &qc->obj;
-        ctx->qd = qc->domain;
-        ctx->ql = qc->listener; /* never changes, so can be read without lock */
+        ctx->qd = qc->domain != NULL
+            ? qc->domain
+            : (qc->listener != NULL ? qc->listener->domain : NULL);
+        ctx->ql = qc->listener;
         ctx->qc = qc;

         if ((flags & QCTX_AUTO_S) != 0) {
@@ -357,7 +359,11 @@ static int expect_quic_as(const SSL *s, QCTX *ctx, uint32_t flags)

         xso = (QUIC_XSO *)s;
         ctx->obj = &xso->obj;
-        ctx->qd = xso->conn->domain;
+        ctx->qd = xso->conn->domain != NULL
+            ? xso->conn->domain
+            : (xso->conn->listener != NULL
+                      ? xso->conn->listener->domain
+                      : NULL);
         ctx->ql = xso->conn->listener;
         ctx->qc = xso->conn;
         ctx->xso = xso;
@@ -410,6 +416,11 @@ static int expect_quic_cs(const SSL *s, QCTX *ctx)
     return expect_quic_as(s, ctx, QCTX_C | QCTX_S);
 }

+static int expect_quic_c(const SSL *s, QCTX *ctx)
+{
+    return expect_quic_as(s, ctx, QCTX_C);
+}
+
 static int expect_quic_cl(const SSL *s, QCTX *ctx)
 {
     return expect_quic_as(s, ctx, QCTX_C | QCTX_L);
@@ -1509,6 +1520,36 @@ static int quic_shutdown_peer_wait(void *arg)
     return ossl_quic_channel_is_term_any(qc->ch);
 }

+/*
+ * This function deals with local shutdown.
+ * Function must consider those scenarios:
+ *    - blocking mode (1)
+ *    - non-blocking mode (2)
+ *    - non-blocking mode with assistance from SSL_poll() (3)
+ * (1) The function completes shutdown then returns back to caller.
+ * To complete shutdown we must do:
+ *    - flush all streams, unless we got SSL_SHUTDOWN_FLAG_NO_STREAM_FLUSH,
+ *      which means the connection is closed without waiting for streams
+ *      to deliver data written by application.
+ *    - let remote peer know local application is going to close connection,
+ *      unless we got SSL_SHUTDOWN_FLAG_WAIT_PEER in which case we await
+ *      until remote peer closes the connection
+ *    - wait for peer to confirm connection close
+ *
+ * (2) The function does not block waiting for streams to be flushed
+ * nor for peer to close connection (when running with SSL_SHUTDOWN_FLAG_WAIT_PEER)
+ * Application is supposed to call SSL_shutdown() repeatedly as long as
+ * function returns 0 which indicates the operation is still in progress.
+ *
+ * (3) In this case application uses SSL_poll() to wait for completion
+ * of each step of shutdown process. Application calls SSL_shutdown()
+ * to start with connection shutdown. The function does not block.
+ * Application then uses SSL_poll() on connection object to monitor
+ * progress of shutdown. The SSL_poll() indicates progress by signaling
+ * SSL_POLL_EVENT_EC event. Application must check connection object
+ * for error. If no error is indicated, then application must call
+ * SSL_shutdown() to move to the next stop in shutdown process.
+ */
 QUIC_TAKES_LOCK
 int ossl_quic_conn_shutdown(SSL *s, uint64_t flags,
     const SSL_SHUTDOWN_EX_ARGS *args,
@@ -1535,6 +1576,19 @@ int ossl_quic_conn_shutdown(SSL *s, uint64_t flags,
         return 1;
     }

+    if (!wait_peer) {
+        /*
+         * Set shutdown reason now when local application wants to do
+         * active close (does not waant to wait for peer to close th
+         * connection). The reason will be sent to peer with connection
+         * close notification as soon as streams will be flushed.
+         */
+        if (args != NULL) {
+            ossl_quic_channel_set_tcause(ctx.qc->ch, args->quic_error_code,
+                args->quic_reason);
+        }
+    }
+
     /* Phase 1: Stream Flushing */
     if (!wait_peer && stream_flush) {
         qc_shutdown_flush_init(ctx.qc);
@@ -2101,6 +2155,23 @@ struct quic_wait_for_stream_args {
     uint64_t expect_id;
 };

+QUIC_NEEDS_LOCK
+static QUIC_STREAM *quic_get_incoming_default_stream(QUIC_CONNECTION *qc,
+    uint64_t expect_id)
+{
+    QUIC_STREAM_MAP *qsm = ossl_quic_channel_get_qsm(qc->ch);
+    QUIC_STREAM *qs;
+
+    qs = ossl_quic_stream_map_get_by_id(qsm,
+        expect_id | QUIC_STREAM_DIR_BIDI);
+    if (qs == NULL)
+        qs = ossl_quic_stream_map_get_by_id(qsm,
+            expect_id | QUIC_STREAM_DIR_UNI);
+
+    /* Auto-rejected streams remain in the map until garbage collection. */
+    return qs != NULL && qs->accept_node.next != NULL ? qs : NULL;
+}
+
 QUIC_NEEDS_LOCK
 static int quic_wait_for_stream(void *arg)
 {
@@ -2112,11 +2183,7 @@ static int quic_wait_for_stream(void *arg)
         return -1;
     }

-    args->qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(args->qc->ch),
-        args->expect_id | QUIC_STREAM_DIR_BIDI);
-    if (args->qs == NULL)
-        args->qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(args->qc->ch),
-            args->expect_id | QUIC_STREAM_DIR_UNI);
+    args->qs = quic_get_incoming_default_stream(args->qc, args->expect_id);

     if (args->qs != NULL)
         return 1; /* stream now exists */
@@ -2153,17 +2220,12 @@ static int qc_wait_for_default_xso_for_read(QCTX *ctx, int peek)
         ? QUIC_STREAM_INITIATOR_CLIENT
         : QUIC_STREAM_INITIATOR_SERVER;

-    qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(qc->ch),
-        expect_id | QUIC_STREAM_DIR_BIDI);
-    if (qs == NULL)
-        qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(qc->ch),
-            expect_id | QUIC_STREAM_DIR_UNI);
+    qs = quic_get_incoming_default_stream(qc, expect_id);

     if (qs == NULL) {
         qctx_maybe_autotick(ctx);

-        qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(qc->ch),
-            expect_id);
+        qs = quic_get_incoming_default_stream(qc, expect_id);
     }

     if (qs == NULL) {
@@ -3174,8 +3236,10 @@ static size_t ossl_quic_pending_int(const SSL *s, int check_channel)
     }

     if (check_channel)
+        /* We care about boolean result here only */
         avail = ossl_quic_stream_recv_pending(ctx.xso->stream,
                     /*include_fin=*/1)
+                > 0
             || ossl_quic_channel_has_pending(ctx.qc->ch)
             || ossl_quic_channel_is_term_any(ctx.qc->ch);
     else
@@ -3440,83 +3504,6 @@ int ossl_quic_set_default_stream_mode(SSL *s, uint32_t mode)
     return 1;
 }

-/*
- * SSL_detach_stream
- * -----------------
- */
-QUIC_TAKES_LOCK
-SSL *ossl_quic_detach_stream(SSL *s)
-{
-    QCTX ctx;
-    QUIC_XSO *xso = NULL;
-
-    if (!expect_quic_conn_only(s, &ctx))
-        return NULL;
-
-    qctx_lock(&ctx);
-
-    /* Calling this function inhibits default XSO autocreation. */
-    /* QC ref to any default XSO is transferred to us and to caller. */
-    qc_set_default_xso_keep_ref(ctx.qc, NULL, /*touch=*/1, &xso);
-
-    qctx_unlock(&ctx);
-
-    return xso != NULL ? &xso->obj.ssl : NULL;
-}
-
-/*
- * SSL_attach_stream
- * -----------------
- */
-QUIC_TAKES_LOCK
-int ossl_quic_attach_stream(SSL *conn, SSL *stream)
-{
-    QCTX ctx;
-    QUIC_XSO *xso;
-    int nref;
-
-    if (!expect_quic_conn_only(conn, &ctx))
-        return 0;
-
-    if (stream == NULL || stream->type != SSL_TYPE_QUIC_XSO)
-        return QUIC_RAISE_NON_NORMAL_ERROR(&ctx, ERR_R_PASSED_NULL_PARAMETER,
-            "stream to attach must be a valid QUIC stream");
-
-    xso = (QUIC_XSO *)stream;
-
-    qctx_lock(&ctx);
-
-    if (ctx.qc->default_xso != NULL) {
-        qctx_unlock(&ctx);
-        return QUIC_RAISE_NON_NORMAL_ERROR(&ctx, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED,
-            "connection already has a default stream");
-    }
-
-    /*
-     * It is a caller error for the XSO being attached as a default XSO to have
-     * more than one ref.
-     */
-    if (!CRYPTO_GET_REF(&xso->obj.ssl.references, &nref)) {
-        qctx_unlock(&ctx);
-        return QUIC_RAISE_NON_NORMAL_ERROR(&ctx, ERR_R_INTERNAL_ERROR,
-            "ref");
-    }
-
-    if (nref != 1) {
-        qctx_unlock(&ctx);
-        return QUIC_RAISE_NON_NORMAL_ERROR(&ctx, ERR_R_PASSED_INVALID_ARGUMENT,
-            "stream being attached must have "
-            "only 1 reference");
-    }
-
-    /* Caller's reference to the XSO is transferred to us. */
-    /* Calling this function inhibits default XSO autocreation. */
-    qc_set_default_xso(ctx.qc, xso, /*touch=*/1);
-
-    qctx_unlock(&ctx);
-    return 1;
-}
-
 /*
  * SSL_set_incoming_stream_policy
  * ------------------------------
@@ -3594,7 +3581,9 @@ static int qc_getset_idle_timeout(QCTX *ctx, uint32_t class_,

     switch (class_) {
     case SSL_VALUE_CLASS_FEATURE_REQUEST:
-        value_out = ossl_quic_channel_get_max_idle_timeout_request(ctx->qc->ch);
+        value_out = ctx->is_listener
+            ? ossl_quic_port_get_max_idle_timeout(ctx->ql->port)
+            : ossl_quic_channel_get_max_idle_timeout_request(ctx->qc->ch);

         if (p_value_in != NULL) {
             value_in = *p_value_in;
@@ -3604,13 +3593,15 @@ static int qc_getset_idle_timeout(QCTX *ctx, uint32_t class_,
                 goto err;
             }

-            if (ossl_quic_channel_have_generated_transport_params(ctx->qc->ch)) {
-                QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_FEATURE_NOT_RENEGOTIABLE,
-                    NULL);
-                goto err;
+            if (ctx->is_listener) {
+                ossl_quic_port_set_max_idle_timeout(ctx->ql->port, value_in);
+            } else {
+                if (!ossl_quic_channel_set_max_idle_timeout_request(ctx->qc->ch, value_in)) {
+                    QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_FEATURE_NOT_RENEGOTIABLE,
+                        NULL);
+                    goto err;
+                }
             }
-
-            ossl_quic_channel_set_max_idle_timeout_request(ctx->qc->ch, value_in);
         }
         break;

@@ -3622,6 +3613,12 @@ static int qc_getset_idle_timeout(QCTX *ctx, uint32_t class_,
             goto err;
         }

+        if (ctx->is_listener) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_OP,
+                NULL);
+            goto err;
+        }
+
         if (!ossl_quic_channel_is_handshake_complete(ctx->qc->ch)) {
             QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_FEATURE_NEGOTIATION_NOT_COMPLETE,
                 NULL);
@@ -3648,6 +3645,366 @@ err:
     return ret;
 }

+QUIC_TAKES_LOCK
+static int qc_getset_max_udp_payload_size(QCTX *ctx, uint32_t class_,
+    uint64_t *p_value_out, uint64_t *p_value_in)
+{
+    int ret = 0;
+    uint64_t value_out = 0, value_in;
+
+    qctx_lock(ctx);
+
+    switch (class_) {
+    case SSL_VALUE_CLASS_FEATURE_REQUEST:
+        value_out = ctx->is_listener
+            ? ossl_quic_port_get_max_udp_payload_size(ctx->ql->port)
+            : ossl_quic_channel_get_max_udp_payload_size_request(ctx->qc->ch);
+
+        if (p_value_in != NULL) {
+            value_in = *p_value_in;
+            if (value_in > QUIC_DEFAULT_MAX_UDP_PAYLOAD_SIZE || value_in < QUIC_MIN_INITIAL_DGRAM_LEN) {
+                QUIC_RAISE_NON_NORMAL_ERROR(ctx, ERR_R_PASSED_INVALID_ARGUMENT,
+                    NULL);
+                goto err;
+            }
+
+            if (ctx->is_listener) {
+                ossl_quic_port_set_max_udp_payload_size(ctx->ql->port, value_in);
+            } else {
+                if (!ossl_quic_channel_set_max_udp_payload_size_request(ctx->qc->ch, value_in)) {
+                    QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_FEATURE_NOT_RENEGOTIABLE,
+                        NULL);
+                    goto err;
+                }
+            }
+        }
+        break;
+
+    case SSL_VALUE_CLASS_FEATURE_PEER_REQUEST:
+        if (p_value_in != NULL) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_OP,
+                NULL);
+            goto err;
+        }
+
+        if (ctx->is_listener) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_OP,
+                NULL);
+            goto err;
+        }
+
+        if (!ossl_quic_channel_is_handshake_complete(ctx->qc->ch)) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_FEATURE_NEGOTIATION_NOT_COMPLETE,
+                NULL);
+            goto err;
+        }
+
+        value_out = ossl_quic_channel_get_max_udp_payload_size_peer_request(ctx->qc->ch);
+        break;
+
+    default:
+        QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_CLASS,
+            NULL);
+        goto err;
+    }
+
+    ret = 1;
+err:
+    qctx_unlock(ctx);
+    if (ret && p_value_out != NULL)
+        *p_value_out = value_out;
+
+    return ret;
+}
+
+QUIC_TAKES_LOCK
+static int qc_getset_max_data(QCTX *ctx, uint32_t class_,
+    uint64_t *p_value_out, uint64_t *p_value_in)
+{
+    int ret = 0;
+    uint64_t value_out = 0, value_in;
+
+    qctx_lock(ctx);
+
+    switch (class_) {
+    case SSL_VALUE_CLASS_FEATURE_REQUEST:
+        value_out = ctx->is_listener
+            ? ossl_quic_port_get_init_max_data(ctx->ql->port)
+            : ossl_quic_channel_get_max_data_request(ctx->qc->ch);
+
+        if (p_value_in != NULL) {
+            value_in = *p_value_in;
+            if (value_in > OSSL_QUIC_VLINT_MAX) {
+                QUIC_RAISE_NON_NORMAL_ERROR(ctx, ERR_R_PASSED_INVALID_ARGUMENT,
+                    NULL);
+                goto err;
+            }
+
+            if (ctx->is_listener) {
+                ossl_quic_port_set_init_max_data(ctx->ql->port, value_in);
+            } else {
+                if (!ossl_quic_channel_set_max_data_request(ctx->qc->ch, value_in)) {
+                    QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_FEATURE_NOT_RENEGOTIABLE,
+                        NULL);
+                    goto err;
+                }
+            }
+        }
+        break;
+
+    case SSL_VALUE_CLASS_FEATURE_PEER_REQUEST:
+        if (p_value_in != NULL) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_OP,
+                NULL);
+            goto err;
+        }
+
+        if (ctx->is_listener) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_OP,
+                NULL);
+            goto err;
+        }
+
+        if (!ossl_quic_channel_is_handshake_complete(ctx->qc->ch)) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_FEATURE_NEGOTIATION_NOT_COMPLETE,
+                NULL);
+            goto err;
+        }
+
+        value_out = ossl_quic_channel_get_max_data_peer_request(ctx->qc->ch);
+        break;
+
+    default:
+        QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_CLASS,
+            NULL);
+        goto err;
+    }
+
+    ret = 1;
+err:
+    qctx_unlock(ctx);
+    if (ret && p_value_out != NULL)
+        *p_value_out = value_out;
+
+    return ret;
+}
+
+QUIC_TAKES_LOCK
+static int qc_getset_max_stream_data(QCTX *ctx, uint32_t class_,
+    uint64_t *p_value_out, int is_uni, int is_remote, uint64_t *p_value_in)
+{
+    int ret = 0;
+    uint64_t value_out = 0, value_in;
+
+    qctx_lock(ctx);
+
+    switch (class_) {
+    case SSL_VALUE_CLASS_FEATURE_REQUEST:
+        value_out = ctx->is_listener
+            ? ossl_quic_port_get_init_max_stream_data(ctx->ql->port, is_uni, is_remote)
+            : ossl_quic_channel_get_max_stream_data_request(ctx->qc->ch, is_uni, is_remote);
+
+        if (p_value_in != NULL) {
+            value_in = *p_value_in;
+            if (value_in > OSSL_QUIC_VLINT_MAX) {
+                QUIC_RAISE_NON_NORMAL_ERROR(ctx, ERR_R_PASSED_INVALID_ARGUMENT,
+                    NULL);
+                goto err;
+            }
+
+            if (ctx->is_listener) {
+                ossl_quic_port_set_init_max_stream_data(ctx->ql->port, value_in, is_uni, is_remote);
+            } else {
+                if (!ossl_quic_channel_set_max_stream_data_request(ctx->qc->ch, value_in, is_uni, is_remote)) {
+                    QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_FEATURE_NOT_RENEGOTIABLE,
+                        NULL);
+                    goto err;
+                }
+            }
+        }
+        break;
+
+    case SSL_VALUE_CLASS_FEATURE_PEER_REQUEST:
+        if (p_value_in != NULL) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_OP,
+                NULL);
+            goto err;
+        }
+
+        if (ctx->is_listener) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_OP,
+                NULL);
+            goto err;
+        }
+
+        if (!ossl_quic_channel_is_handshake_complete(ctx->qc->ch)) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_FEATURE_NEGOTIATION_NOT_COMPLETE,
+                NULL);
+            goto err;
+        }
+
+        value_out = ossl_quic_channel_get_max_stream_data_peer_request(ctx->qc->ch, is_uni, is_remote);
+        break;
+
+    default:
+        QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_CLASS,
+            NULL);
+        goto err;
+    }
+
+    ret = 1;
+err:
+    qctx_unlock(ctx);
+    if (ret && p_value_out != NULL)
+        *p_value_out = value_out;
+
+    return ret;
+}
+
+QUIC_TAKES_LOCK
+static int qc_getset_ack_delay_exponent(QCTX *ctx, uint32_t class_,
+    uint64_t *p_value_out, uint64_t *p_value_in)
+{
+    int ret = 0;
+    uint64_t value_out = 0, value_in;
+
+    qctx_lock(ctx);
+
+    switch (class_) {
+    case SSL_VALUE_CLASS_FEATURE_REQUEST:
+        value_out = ctx->is_listener
+            ? ossl_quic_port_get_ack_delay_exponent(ctx->ql->port)
+            : ossl_quic_channel_get_ack_delay_exponent_request(ctx->qc->ch);
+
+        if (p_value_in != NULL) {
+            value_in = *p_value_in;
+            if (value_in > QUIC_MAX_ACK_DELAY_EXP) {
+                QUIC_RAISE_NON_NORMAL_ERROR(ctx, ERR_R_PASSED_INVALID_ARGUMENT,
+                    NULL);
+                goto err;
+            }
+
+            if (ctx->is_listener) {
+                ossl_quic_port_set_ack_delay_exponent(ctx->ql->port, value_in);
+            } else {
+                if (!ossl_quic_channel_set_ack_delay_exponent_request(ctx->qc->ch, value_in)) {
+                    QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_FEATURE_NOT_RENEGOTIABLE,
+                        NULL);
+                    goto err;
+                }
+            }
+        }
+        break;
+
+    case SSL_VALUE_CLASS_FEATURE_PEER_REQUEST:
+        if (p_value_in != NULL) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_OP,
+                NULL);
+            goto err;
+        }
+
+        if (ctx->is_listener) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_OP,
+                NULL);
+            goto err;
+        }
+
+        if (!ossl_quic_channel_is_handshake_complete(ctx->qc->ch)) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_FEATURE_NEGOTIATION_NOT_COMPLETE,
+                NULL);
+            goto err;
+        }
+
+        value_out = ossl_quic_channel_get_ack_delay_exponent_peer_request(ctx->qc->ch);
+        break;
+
+    default:
+        QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_CLASS,
+            NULL);
+        goto err;
+    }
+
+    ret = 1;
+err:
+    qctx_unlock(ctx);
+    if (ret && p_value_out != NULL)
+        *p_value_out = value_out;
+
+    return ret;
+}
+
+QUIC_TAKES_LOCK
+static int qc_getset_max_ack_delay(QCTX *ctx, uint32_t class_,
+    uint64_t *p_value_out, uint64_t *p_value_in)
+{
+    int ret = 0;
+    uint64_t value_out = 0, value_in;
+
+    qctx_lock(ctx);
+
+    switch (class_) {
+    case SSL_VALUE_CLASS_FEATURE_REQUEST:
+        value_out = ctx->is_listener
+            ? ossl_quic_port_get_max_ack_delay(ctx->ql->port)
+            : ossl_quic_channel_get_max_ack_delay_request(ctx->qc->ch);
+
+        if (p_value_in != NULL) {
+            value_in = *p_value_in;
+            if (value_in > QUIC_MAX_MAX_ACK_DELAY) {
+                QUIC_RAISE_NON_NORMAL_ERROR(ctx, ERR_R_PASSED_INVALID_ARGUMENT,
+                    NULL);
+                goto err;
+            }
+
+            if (ctx->is_listener) {
+                ossl_quic_port_set_max_ack_delay(ctx->ql->port, value_in);
+            } else {
+                if (!ossl_quic_channel_set_max_ack_delay_request(ctx->qc->ch, value_in)) {
+                    QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_FEATURE_NOT_RENEGOTIABLE,
+                        NULL);
+                    goto err;
+                }
+            }
+        }
+        break;
+
+    case SSL_VALUE_CLASS_FEATURE_PEER_REQUEST:
+        if (p_value_in != NULL) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_OP,
+                NULL);
+            goto err;
+        }
+
+        if (ctx->is_listener) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_OP,
+                NULL);
+            goto err;
+        }
+
+        if (!ossl_quic_channel_is_handshake_complete(ctx->qc->ch)) {
+            QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_FEATURE_NEGOTIATION_NOT_COMPLETE,
+                NULL);
+            goto err;
+        }
+
+        value_out = ossl_quic_channel_get_max_ack_delay_peer_request(ctx->qc->ch);
+        break;
+
+    default:
+        QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_UNSUPPORTED_CONFIG_VALUE_CLASS,
+            NULL);
+        goto err;
+    }
+
+    ret = 1;
+err:
+    qctx_unlock(ctx);
+    if (ret && p_value_out != NULL)
+        *p_value_out = value_out;
+
+    return ret;
+}
+
 QUIC_TAKES_LOCK
 static int qc_getset_max_pending_channels(QCTX *ctx, uint32_t class_,
     uint64_t *p_value_out, uint64_t *p_value_in)
@@ -3810,6 +4167,13 @@ static int expect_quic_for_value(SSL *s, QCTX *ctx, uint32_t id)
     case SSL_VALUE_STREAM_WRITE_BUF_USED:
     case SSL_VALUE_STREAM_WRITE_BUF_AVAIL:
         return expect_quic_cs(s, ctx);
+    case SSL_VALUE_QUIC_IDLE_TIMEOUT:
+    case SSL_VALUE_QUIC_UDP_PAYLOAD_SIZE_MAX:
+    case SSL_VALUE_QUIC_WINDOWCON:
+    case SSL_VALUE_QUIC_WINDOWBSTR:
+    case SSL_VALUE_QUIC_WINDOWUSTR:
+    case SSL_VALUE_QUIC_ACK_DELAY_EXPONENT:
+    case SSL_VALUE_QUIC_ACK_DELAY_MAX:
     case SSL_VALUE_QUIC_MAX_PENDING_CONNS:
         return expect_quic_cl(s, ctx);
     default:
@@ -3833,6 +4197,18 @@ int ossl_quic_get_value_uint(SSL *s, uint32_t class_, uint32_t id,
     switch (id) {
     case SSL_VALUE_QUIC_IDLE_TIMEOUT:
         return qc_getset_idle_timeout(&ctx, class_, value, NULL);
+    case SSL_VALUE_QUIC_UDP_PAYLOAD_SIZE_MAX:
+        return qc_getset_max_udp_payload_size(&ctx, class_, value, NULL);
+    case SSL_VALUE_QUIC_WINDOWCON:
+        return qc_getset_max_data(&ctx, class_, value, NULL);
+    case SSL_VALUE_QUIC_WINDOWBSTR:
+        return qc_getset_max_stream_data(&ctx, class_, value, /*uni=*/0, /*remote=*/0, NULL);
+    case SSL_VALUE_QUIC_WINDOWUSTR:
+        return qc_getset_max_stream_data(&ctx, class_, value, /*uni=*/1, /*remote=*/1, NULL);
+    case SSL_VALUE_QUIC_ACK_DELAY_EXPONENT:
+        return qc_getset_ack_delay_exponent(&ctx, class_, value, NULL);
+    case SSL_VALUE_QUIC_ACK_DELAY_MAX:
+        return qc_getset_max_ack_delay(&ctx, class_, value, NULL);
     case SSL_VALUE_QUIC_MAX_PENDING_CONNS:
         return qc_getset_max_pending_channels(&ctx, class_, value, NULL);

@@ -3876,11 +4252,23 @@ int ossl_quic_set_value_uint(SSL *s, uint32_t class_, uint32_t id,
         return 0;

     switch (id) {
-    case SSL_VALUE_QUIC_IDLE_TIMEOUT:
-        return qc_getset_idle_timeout(&ctx, class_, NULL, &value);
-
     case SSL_VALUE_EVENT_HANDLING_MODE:
         return qc_getset_event_handling(&ctx, class_, NULL, &value);
+
+    case SSL_VALUE_QUIC_IDLE_TIMEOUT:
+        return qc_getset_idle_timeout(&ctx, class_, NULL, &value);
+    case SSL_VALUE_QUIC_UDP_PAYLOAD_SIZE_MAX:
+        return qc_getset_max_udp_payload_size(&ctx, class_, NULL, &value);
+    case SSL_VALUE_QUIC_WINDOWCON:
+        return qc_getset_max_data(&ctx, class_, NULL, &value);
+    case SSL_VALUE_QUIC_WINDOWBSTR:
+        return qc_getset_max_stream_data(&ctx, class_, NULL, /*uni=*/0, /*remote=*/0, &value);
+    case SSL_VALUE_QUIC_WINDOWUSTR:
+        return qc_getset_max_stream_data(&ctx, class_, NULL, /*uni=*/1, /*remote=*/1, &value);
+    case SSL_VALUE_QUIC_ACK_DELAY_EXPONENT:
+        return qc_getset_ack_delay_exponent(&ctx, class_, NULL, &value);
+    case SSL_VALUE_QUIC_ACK_DELAY_MAX:
+        return qc_getset_max_ack_delay(&ctx, class_, NULL, &value);
     case SSL_VALUE_QUIC_MAX_PENDING_CONNS:
         return qc_getset_max_pending_channels(&ctx, class_, NULL, &value);

@@ -3945,7 +4333,15 @@ SSL *ossl_quic_accept_stream(SSL *s, uint64_t flags)

     qsm = ossl_quic_channel_get_qsm(ctx.qc->ch);

-    qs = ossl_quic_stream_map_peek_accept_queue(qsm);
+    if ((flags & SSL_ACCEPT_STREAM_UNI) && !(flags & SSL_ACCEPT_STREAM_BIDI)) {
+        qs = ossl_quic_stream_map_find_in_accept_queue(qsm, 1);
+    } else if ((flags & SSL_ACCEPT_STREAM_BIDI)
+        && !(flags & SSL_ACCEPT_STREAM_UNI)) {
+        qs = ossl_quic_stream_map_find_in_accept_queue(qsm, 0);
+    } else {
+        qs = ossl_quic_stream_map_peek_accept_queue(qsm);
+    }
+
     if (qs == NULL) {
         if (qctx_blocking(&ctx)
             && (flags & SSL_ACCEPT_STREAM_NO_BLOCK) == 0) {
@@ -4311,9 +4707,8 @@ int ossl_quic_get_key_update_type(const SSL *s)
  *
  * @return Pointer to the SSL object on success, or NULL on failure.
  */
-static SSL *alloc_port_user_ssl(QUIC_CHANNEL *ch, void *arg)
+static SSL *alloc_port_user_ssl(QUIC_CHANNEL *ch, QUIC_LISTENER *ql)
 {
-    QUIC_LISTENER *ql = arg;
     QUIC_CONNECTION *qc = create_qc_from_incoming_conn(ql, ch);

     return (qc == NULL) ? NULL : &qc->obj.ssl;
@@ -4363,7 +4758,7 @@ SSL *ossl_quic_new_listener(SSL_CTX *ctx, uint64_t flags)
     port_args.channel_ctx = ctx;
     port_args.is_multi_conn = 1;
     port_args.get_conn_user_ssl = alloc_port_user_ssl;
-    port_args.user_ssl_arg = ql;
+    port_args.ql = ql;
     if ((flags & SSL_LISTENER_FLAG_NO_VALIDATE) == 0)
         port_args.do_addr_validation = 1;
     ql->port = ossl_quic_engine_create_port(ql->engine, &port_args);
@@ -4420,7 +4815,7 @@ SSL *ossl_quic_new_listener_from(SSL *ssl, uint64_t flags)
     port_args.channel_ctx = ssl->ctx;
     port_args.is_multi_conn = 1;
     port_args.get_conn_user_ssl = alloc_port_user_ssl;
-    port_args.user_ssl_arg = ql;
+    port_args.ql = ql;
     if ((flags & SSL_LISTENER_FLAG_NO_VALIDATE) == 0)
         port_args.do_addr_validation = 1;
     ql->port = ossl_quic_engine_create_port(ctx.qd->engine, &port_args);
@@ -4557,7 +4952,7 @@ SSL *ossl_quic_new_from_listener(SSL *ssl, uint64_t flags)
     ossl_quic_channel_set_msg_callback_arg(qc->ch, ql->obj.ssl.ctx->msg_callback_arg);

     /*
-     * We deliberately pass NULL for engine and port, because we don't want to
+     * We deliberately pass NULL for engine and port, because we don't want
      * to turn QCSO we create here into an event leader, nor port leader.
      * Both those roles are occupied already by listener (`ssl`) we use
      * to create a new QCSO here.
@@ -4625,6 +5020,170 @@ int ossl_quic_listen(SSL *ssl)
     return ret;
 }

+QUIC_TAKES_LOCK
+int ossl_quic_peeloff_conn(SSL *listener, SSL *new_conn)
+{
+    QCTX lctx;
+    QCTX cctx;
+    QUIC_CHANNEL *new_ch, *old_ch, *popped_ch;
+    QUIC_PORT *old_port;
+    QUIC_ENGINE *old_engine;
+#if defined(OPENSSL_THREADS)
+    CRYPTO_MUTEX *old_mutex = NULL;
+#endif
+    QUIC_CONNECTION *qc = NULL;
+    QUIC_LISTENER *ql = NULL;
+    SSL *tls = NULL;
+    SSL_CONNECTION *tls_conn = NULL;
+    int ret = 0;
+
+    if (!expect_quic_listener(listener, &lctx))
+        return -1;
+
+    if (!expect_quic_c(new_conn, &cctx))
+        return -1;
+
+#if !defined(OPENSSL_NO_QUIC_THREAD_ASSIST)
+    if (cctx.qc->is_thread_assisted) {
+        QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_PASSED_INVALID_ARGUMENT,
+            "SSL_listen_ex requires new_conn without thread assistance");
+        return -1;
+    }
+#endif
+
+    /* The standalone transport is replaced, so new_conn must be unused. */
+    if (cctx.qc->started || cctx.qc->shutting_down
+        || cctx.qc->num_xso != 0
+        || cctx.qc->default_xso_created
+        || cctx.qc->listener != NULL
+        || ossl_quic_port_get_net_rbio(cctx.qc->port) != NULL
+        || ossl_quic_port_get_net_wbio(cctx.qc->port) != NULL
+        || ossl_quic_channel_is_active(cctx.qc->ch)
+        || ossl_quic_channel_is_term_any(cctx.qc->ch)
+        || !cctx.obj->is_event_leader || !cctx.obj->is_port_leader
+        || cctx.obj->parent_obj != NULL) {
+        QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_PASSED_INVALID_ARGUMENT,
+            "SSL_listen_ex requires a fresh connection created by SSL_new()");
+        return -1;
+    }
+
+    qctx_lock_for_io(&lctx);
+
+    if (!ossl_quic_port_test_and_set_peeloff(lctx.ql->port, PEELOFF_LISTEN)) {
+        QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED,
+            "This listener is using SSL_accept_connection");
+        ret = -1;
+        goto out;
+    }
+
+    /* Do all fallible setup before consuming the queued channel. */
+    new_ch = ossl_quic_port_peek_incoming(lctx.ql->port);
+    if (new_ch == NULL)
+        goto out;
+
+    qc = cctx.qc;
+    ql = lctx.ql;
+
+    tls = ossl_ssl_connection_new_int(
+        ossl_quic_port_get_channel_ctx(ql->port), new_conn, TLS_method());
+    if (tls == NULL) {
+        /* An internal failure is not "no connection available" */
+        ret = -1;
+        goto out;
+    }
+
+    tls_conn = SSL_CONNECTION_FROM_SSL(tls);
+    if (tls_conn == NULL) {
+        QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_INTERNAL_ERROR, NULL);
+        SSL_free(tls);
+        ret = -1;
+        goto out;
+    }
+
+    tls_conn->s3.flags |= TLS1_FLAGS_QUIC | TLS1_FLAGS_QUIC_INTERNAL;
+    tls_conn->options &= OSSL_QUIC_PERMITTED_OPTIONS_CONN;
+    tls_conn->pha_enabled = 0;
+
+    /* The connection keeps its listener alive. */
+    if (!SSL_up_ref(&ql->obj.ssl)) {
+        QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_INTERNAL_ERROR, NULL);
+        SSL_free(tls);
+        ret = -1;
+        goto out;
+    }
+
+    /* Bind TLS before adopting the deferred incoming channel. */
+    if (!ossl_quic_channel_set0_tls(new_ch, tls)) {
+        QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_INTERNAL_ERROR, NULL);
+        SSL_free(tls);
+        SSL_free(&ql->obj.ssl);
+        ret = -1;
+        goto out;
+    }
+
+    ossl_quic_channel_set_msg_callback(new_ch,
+        ql->obj.ssl.ctx->msg_callback, new_conn);
+    ossl_quic_channel_set_msg_callback_arg(new_ch,
+        ql->obj.ssl.ctx->msg_callback_arg);
+
+    /* The listener lock guarantees that the queue head has not changed. */
+    popped_ch = ossl_quic_port_pop_incoming(ql->port);
+    assert(popped_ch == new_ch);
+    (void)popped_ch;
+
+    old_ch = qc->ch;
+    old_port = qc->port;
+    old_engine = qc->engine;
+#if defined(OPENSSL_THREADS)
+    old_mutex = qc->mutex;
+#endif
+
+    /* Ensure that SSL_free() drops the listener reference. */
+    qc->listener = ql;
+    qc->engine = ql->engine;
+    qc->port = ql->port;
+    /* The connection is handed to the caller, as in SSL_accept_connection() */
+    qc->pending = 0;
+    /* Demote the standalone object into the listener's hierarchy. */
+    ossl_quic_obj_reparent(&qc->obj, &ql->obj);
+
+    /* Release the resources the connection owned as a standalone object. */
+    ossl_quic_channel_free(old_ch);
+    quic_unref_port_bios(old_port);
+    ossl_quic_port_free(old_port);
+    ossl_quic_engine_free(old_engine);
+#if defined(OPENSSL_THREADS)
+    /* The standalone mutex was borrowed by all three resources above. */
+    qc->mutex = ql->mutex;
+    ossl_crypto_mutex_free(&old_mutex);
+#endif
+
+    qc->ch = new_ch;
+    SSL_free(qc->tls);
+    qc->tls = tls;
+    ossl_quic_channel_get_peer_addr(new_ch,
+        &qc->init_peer_addr); /* best effort */
+    qc->started = 1;
+    qc->as_server = 1;
+    qc->as_server_state = 1;
+    /* Reinitialise configuration to the accepted-connection defaults. */
+    qc->default_stream_mode = SSL_DEFAULT_STREAM_MODE_AUTO_BIDI;
+    qc->default_ssl_mode = ql->obj.ssl.ctx->mode;
+    qc->default_ssl_options
+        = ql->obj.ssl.ctx->options & OSSL_QUIC_PERMITTED_OPTIONS;
+    qc->incoming_stream_policy = SSL_INCOMING_STREAM_POLICY_AUTO;
+    qc->incoming_stream_aec = 0;
+    qc->last_error = SSL_ERROR_NONE;
+    ossl_quic_obj_set_blocking_mode(&qc->obj, QUIC_BLOCKING_MODE_INHERIT);
+    qc->obj.event_handling_mode = SSL_VALUE_EVENT_HANDLING_MODE_INHERIT;
+    qc_update_reject_policy(qc);
+    ret = 1;
+
+out:
+    qctx_unlock(&lctx);
+    return ret;
+}
+
 /*
  * SSL_accept_connection
  * ---------------------
@@ -4662,6 +5221,12 @@ SSL *ossl_quic_accept_connection(SSL *ssl, uint64_t flags)
     if (!ql_listen(ctx.ql))
         goto out;

+    if (!ossl_quic_port_test_and_set_peeloff(ctx.ql->port, PEELOFF_ACCEPT)) {
+        QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED,
+            "This listener is using SSL_listen_ex");
+        goto out;
+    }
+
     /* Wait for an incoming connection if needed. */
     new_ch = ossl_quic_port_pop_incoming(ctx.ql->port);
     if (new_ch == NULL && ossl_quic_port_is_running(ctx.ql->port)) {
@@ -4751,7 +5316,6 @@ static QUIC_CONNECTION *create_qc_from_incoming_conn(QUIC_LISTENER *ql, QUIC_CHA
         goto err;
     }

-    ossl_quic_channel_get_peer_addr(ch, &qc->init_peer_addr); /* best effort */
     qc->pending = 1;
     qc->engine = ql->engine;
     qc->port = ql->port;
@@ -4759,7 +5323,6 @@ static QUIC_CONNECTION *create_qc_from_incoming_conn(QUIC_LISTENER *ql, QUIC_CHA
 #if defined(OPENSSL_THREADS)
     qc->mutex = ql->mutex;
 #endif
-    qc->tls = ossl_quic_channel_get0_tls(ch);
     qc->started = 1;
     qc->as_server = 1;
     qc->as_server_state = 1;
@@ -4768,6 +5331,27 @@ static QUIC_CONNECTION *create_qc_from_incoming_conn(QUIC_LISTENER *ql, QUIC_CHA
     qc->incoming_stream_policy = SSL_INCOMING_STREAM_POLICY_AUTO;
     qc->last_error = SSL_ERROR_NONE;
     qc_update_reject_policy(qc);
+
+    /*
+     * Detach the channel from the freshly-built qc before handing it back.
+     *
+     * qc->ch was set to @p ch above so the in-function initialisers
+     * (e.g. qc_update_reject_policy()) can reach the channel during setup.
+     * Once setup is done we clear it again because, at this point, the qc
+     * does NOT yet own the channel: @p ch is still owned by the caller of
+     * port_new_handshake_layer(), which only commits ownership (by setting
+     * qc->ch = ch on the success path) after the rest of channel
+     * construction has succeeded.
+     *
+     * Leaving qc->ch set here would mean any error path that does
+     * SSL_free(user_ssl) before the commit point cascades into
+     * qc_cleanup() -> ossl_quic_channel_free(qc->ch) and frees a channel
+     * the caller is still using -- the use-after-free / double-free class
+     * of bug we hit before. Resetting to NULL makes SSL_free(user_ssl)
+     * safe at any point until the caller explicitly hands ch over.
+     */
+    qc->ch = NULL;
+
     return qc;

 err:
@@ -4981,9 +5565,8 @@ int ossl_quic_get_peer_token(SSL_CTX *ctx, BIO_ADDR *peer,

     ossl_crypto_mutex_lock(c->mutex);
     tok = lh_QUIC_TOKEN_retrieve(c->cache, key);
-    if (tok != NULL) {
+    if (tok != NULL && CRYPTO_UP_REF(&tok->references, &ret)) {
         *token = tok;
-        CRYPTO_UP_REF(&tok->references, &ret);
         rc = 1;
     }

@@ -5021,12 +5604,28 @@ size_t ossl_quic_get_accept_connection_queue_len(SSL *ssl)

     qctx_lock(&ctx);

-    ret = ossl_quic_port_get_num_incoming_channels(ctx.ql->port);
+    ret = (int)ossl_quic_port_get_num_incoming_channels(ctx.ql->port);

     qctx_unlock(&ctx);
     return ret;
 }

+QUIC_TAKES_LOCK
+int ossl_quic_get_peer_addr(SSL *ssl, BIO_ADDR *peer_addr)
+{
+    QCTX ctx;
+    int ret;
+
+    if (!expect_quic_cs(ssl, &ctx))
+        return 0;
+
+    qctx_lock(&ctx);
+    ret = ossl_quic_channel_get_peer_addr(ctx.qc->ch, peer_addr);
+    qctx_unlock(&ctx);
+
+    return ret;
+}
+
 /*
  * QUIC Front-End I/O API: Domains
  * ===============================
@@ -5120,7 +5719,6 @@ long ossl_quic_callback_ctrl(SSL *s, int cmd, void (*fp)(void))
             &ctx.qc->obj.ssl);
         /* This callback also needs to be set on the internal SSL object */
         return ssl3_callback_ctrl(ctx.qc->tls, cmd, fp);
-        ;

     default:
         /* Probably a TLS related ctrl. Defer to our internal SSL object */
@@ -5271,7 +5869,8 @@ QUIC_NEEDS_LOCK
 static int test_poll_event_is(QUIC_CONNECTION *qc, int is_uni)
 {
     return ossl_quic_stream_map_get_accept_queue_len(ossl_quic_channel_get_qsm(qc->ch),
-        is_uni);
+               is_uni)
+        > 0;
 }

 /* Do we have the OS (outgoing: stream) condition? */
@@ -5420,7 +6019,8 @@ void ossl_quic_enter_blocking_section(SSL *ssl, QUIC_REACTOR_WAIT_CTX *wctx)
 }

 QUIC_TAKES_LOCK
-void ossl_quic_leave_blocking_section(SSL *ssl, QUIC_REACTOR_WAIT_CTX *wctx)
+void ossl_quic_deregister_blocking_section(SSL *ssl,
+    QUIC_REACTOR_WAIT_CTX *wctx)
 {
     QCTX ctx;
     QUIC_REACTOR *rtor;
@@ -5430,7 +6030,7 @@ void ossl_quic_leave_blocking_section(SSL *ssl, QUIC_REACTOR_WAIT_CTX *wctx)

     qctx_lock(&ctx);
     rtor = ossl_quic_obj_get0_reactor(ctx.obj);
-    ossl_quic_reactor_wait_ctx_leave(wctx, rtor);
+    ossl_quic_reactor_wait_ctx_deregister(wctx, rtor);
     qctx_unlock(&ctx);
 }

diff --git a/deps/openssl/openssl/ssl/quic/quic_method.c b/deps/openssl/openssl/ssl/quic/quic_method.c
index 55d7824e336..a14d4d676f6 100644
--- a/deps/openssl/openssl/ssl/quic/quic_method.c
+++ b/deps/openssl/openssl/ssl/quic/quic_method.c
@@ -11,6 +11,16 @@
 #include <openssl/objects.h>
 #include "quic_local.h"

+/*
+ * NOTE: An endpoint method can be used to create a quic connection
+ * for use as a client or server, based on a subsequent call to
+ * SSL_set_[accept|connect]_state
+ */
+IMPLEMENT_quic_meth_func(OSSL_QUIC_ANY_VERSION,
+    OSSL_QUIC_method,
+    ssl_undefined_function,
+    ossl_quic_connect, ssl3_undef_enc_method)
+
 IMPLEMENT_quic_meth_func(OSSL_QUIC_ANY_VERSION,
     OSSL_QUIC_client_method,
     ssl_undefined_function,
diff --git a/deps/openssl/openssl/ssl/quic/quic_obj.c b/deps/openssl/openssl/ssl/quic/quic_obj.c
index 0c0a3faa2ee..2aba3fb4bde 100644
--- a/deps/openssl/openssl/ssl/quic/quic_obj.c
+++ b/deps/openssl/openssl/ssl/quic/quic_obj.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -20,11 +20,13 @@ int ossl_quic_obj_init(QUIC_OBJ *obj,
     QUIC_ENGINE *engine,
     QUIC_PORT *port)
 {
+    QUIC_OBJ *parent = (QUIC_OBJ *)parent_obj;
     int is_event_leader = (engine != NULL);
     int is_port_leader = (port != NULL);

     if (!ossl_assert(obj != NULL && !obj->init_done && SSL_TYPE_IS_QUIC(type)
-            && (parent_obj == NULL || IS_QUIC(parent_obj))))
+            && (parent_obj == NULL
+                || (IS_QUIC(parent_obj) && parent->init_done))))
         return 0;

     /* Event leader is always the root object. */
@@ -34,8 +36,9 @@ int ossl_quic_obj_init(QUIC_OBJ *obj,
     if (!ossl_ssl_init(&obj->ssl, ctx, ctx->method, type))
         goto err;

-    obj->domain_flags = ctx->domain_flags;
-    obj->parent_obj = (QUIC_OBJ *)parent_obj;
+    obj->domain_flags
+        = parent != NULL ? parent->domain_flags : ctx->domain_flags;
+    obj->parent_obj = parent;
     obj->is_event_leader = is_event_leader;
     obj->is_port_leader = is_port_leader;
     obj->engine = engine;
@@ -53,6 +56,21 @@ err:
     return 0;
 }

+void ossl_quic_obj_reparent(QUIC_OBJ *obj, QUIC_OBJ *parent)
+{
+    if (!ossl_assert(obj != NULL && obj->init_done
+            && parent != NULL && parent->init_done
+            && obj->is_event_leader && obj->is_port_leader
+            && obj->parent_obj == NULL))
+        return;
+
+    obj->parent_obj = parent;
+    obj->is_event_leader = 0;
+    obj->is_port_leader = 0;
+    obj->domain_flags = parent->domain_flags;
+    (void)obj_update_cache(obj);
+}
+
 static int obj_update_cache(QUIC_OBJ *obj)
 {
     QUIC_OBJ *p;
diff --git a/deps/openssl/openssl/ssl/quic/quic_obj_local.h b/deps/openssl/openssl/ssl/quic/quic_obj_local.h
index d454ade330b..0d7627c2419 100644
--- a/deps/openssl/openssl/ssl/quic/quic_obj_local.h
+++ b/deps/openssl/openssl/ssl/quic/quic_obj_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -100,7 +100,7 @@ struct quic_obj_st {
      */
     QUIC_PORT *port;

-    /* SSL_DOMAIN_FLAG values taken from SSL_CTX at construction time. */
+    /* Effective SSL_DOMAIN_FLAG values inherited from the object hierarchy. */
     uint64_t domain_flags;

     unsigned int init_done : 1;
@@ -155,6 +155,9 @@ int ossl_quic_obj_init(QUIC_OBJ *obj,
     QUIC_ENGINE *engine,
     QUIC_PORT *port);

+/* Reparent a standalone leader; the caller must release its old resources. */
+void ossl_quic_obj_reparent(QUIC_OBJ *obj, QUIC_OBJ *parent);
+
 /*
  * Returns a pointer to the handshake layer object which should be accessible on
  * obj for purposes of handshake API autoforwarding, if any.
diff --git a/deps/openssl/openssl/ssl/quic/quic_port.c b/deps/openssl/openssl/ssl/quic/quic_port.c
index 77e28c63fb0..ad170196652 100644
--- a/deps/openssl/openssl/ssl/quic/quic_port.c
+++ b/deps/openssl/openssl/ssl/quic/quic_port.c
@@ -93,6 +93,14 @@ typedef struct validation_token {
  */
 #define ENCRYPTED_TOKEN_MAX_LEN (MARSHALLED_TOKEN_MAX_LEN + 16 + 12)

+/* Arbitrary choice of default idle timeout (not an RFC value). */
+#define DEFAULT_IDLE_TIMEOUT 30000
+
+#define DEFAULT_INIT_CONN_RXFC_WND (768 * 1024)
+#define DEFAULT_INIT_STREAM_RXFC_WND (512 * 1024)
+
+#define DEFAULT_INIT_CONN_MAX_STREAMS 100
+
 #define DEFAULT_MAX_PENDING_CONNS 256

 DEFINE_LIST_OF_IMPL(ch, QUIC_CHANNEL);
@@ -111,7 +119,7 @@ QUIC_PORT *ossl_quic_port_new(const QUIC_PORT_ARGS *args)
     port->is_multi_conn = args->is_multi_conn;
     port->validate_addr = args->do_addr_validation;
     port->get_conn_user_ssl = args->get_conn_user_ssl;
-    port->user_ssl_arg = args->user_ssl_arg;
+    port->ql = args->ql;
     port->max_pending_channels = DEFAULT_MAX_PENDING_CONNS;

     if (!port_init(port)) {
@@ -134,7 +142,7 @@ void ossl_quic_port_free(QUIC_PORT *port)
 static int port_init(QUIC_PORT *port)
 {
     size_t rx_short_dcid_len = (port->is_multi_conn ? INIT_DCID_LEN : 0);
-    int key_len;
+    int key_len = -1;
     EVP_CIPHER *cipher = NULL;
     unsigned char *token_key = NULL;
     int ret = 0;
@@ -167,6 +175,33 @@ static int port_init(QUIC_PORT *port)

     port->rx_short_dcid_len = (unsigned char)rx_short_dcid_len;
     port->tx_init_dcid_len = INIT_DCID_LEN;
+
+    port->max_idle_timeout = DEFAULT_IDLE_TIMEOUT;
+
+    /*
+     * We tell the peer we can handle at most this many bytes in a datagram payload.
+     * However, currently the QUIC_DEMUX in the QRX uses the BIO's MTU as upper bound
+     * on an incoming datagram size.
+     */
+    port->max_udp_payload_size = QUIC_MIN_INITIAL_DGRAM_LEN;
+    port->init_max_data = DEFAULT_INIT_CONN_RXFC_WND;
+    port->init_max_stream_data_bidi_local = DEFAULT_INIT_STREAM_RXFC_WND;
+    port->init_max_stream_data_bidi_remote = DEFAULT_INIT_STREAM_RXFC_WND;
+    port->init_max_stream_data_uni = DEFAULT_INIT_STREAM_RXFC_WND;
+    port->init_max_streams_bidi = DEFAULT_INIT_CONN_MAX_STREAMS;
+    port->init_max_streams_uni = DEFAULT_INIT_CONN_MAX_STREAMS;
+    port->ack_delay_exponent = QUIC_DEFAULT_ACK_DELAY_EXP;
+
+    /*
+     * Our maximum ACK delay on the TX side. This is up to us to choose. Note that
+     * this could differ from QUIC_DEFAULT_MAX_DELAY in future as that is a protocol
+     * value which determines the value of the maximum ACK delay if the
+     * max_ack_delay transport parameter is not set.
+     */
+    port->max_ack_delay = QUIC_DEFAULT_MAX_ACK_DELAY;
+    port->disable_active_migration = 1;
+    port->active_conn_id_limit = QUIC_MIN_ACTIVE_CONN_ID_LIMIT;
+
     port->state = QUIC_PORT_STATE_RUNNING;

     ossl_list_port_insert_tail(&port->engine->port_list, port);
@@ -181,14 +216,17 @@ static int port_init(QUIC_PORT *port)
         || !EVP_EncryptInit_ex(port->token_ctx, cipher, NULL, NULL, NULL)
         || (key_len = EVP_CIPHER_CTX_get_key_length(port->token_ctx)) <= 0
         || (token_key = OPENSSL_malloc(key_len)) == NULL
-        || !RAND_bytes_ex(port->engine->libctx, token_key, key_len, 0)
+        || !RAND_priv_bytes_ex(port->engine->libctx, token_key, key_len, 0)
         || !EVP_EncryptInit_ex(port->token_ctx, NULL, NULL, token_key, NULL))
         goto err;

     ret = 1;
 err:
     EVP_CIPHER_free(cipher);
-    OPENSSL_free(token_key);
+    if (key_len >= 1)
+        OPENSSL_clear_free(token_key, key_len);
+    else
+        OPENSSL_free(token_key);
     if (!ret)
         port_cleanup(port);
     return ret;
@@ -457,7 +495,41 @@ SSL_CTX *ossl_quic_port_get_channel_ctx(QUIC_PORT *port)
  * ============================
  */

-static SSL *port_new_handshake_layer(QUIC_PORT *port, QUIC_CHANNEL *ch)
+/**
+ * @brief Create the inner TLS handshake layer for a QUIC channel.
+ *
+ * After a successful return:
+ *   - @c *user_sslp holds the user_ssl. The caller is expected to also
+ *     stash the returned @c tls in @c ch->tls so the channel can find its
+ *     inner TLS.
+ *   - @c qc->tls and @c qc->ch are both set, so a single
+ *     @c SSL_free(user_ssl) cascades through @c ossl_quic_free() ->
+ *     @c qc_cleanup() to free the inner TLS and the channel together.
+ *
+ * Failure semantics (returns @c NULL)
+ * -----------------------------------
+ *   - If the callback never returned a user_ssl (callback missing or it
+ *     returned @c NULL), nothing was allocated; @c *user_sslp is left
+ *     untouched and stays whatever the caller initialised it to.
+ *   - Otherwise, this function frees what it allocated and resets
+ *     @c *user_sslp to @c NULL before returning. The caller retains ownership
+ *     of @c ch on failure.
+ *
+ * @param port       Port supplying the channel @c SSL_CTX and the
+ *                   @c get_conn_user_ssl callback.
+ * @param ch         Channel that the new handshake layer is being attached
+ *                   to. Borrowed; on success the channel is shared with
+ *                   user_ssl via @c qc->ch.
+ * @param user_sslp  In/out parameter. On success, set to the user_ssl
+ *                   so the caller can later free the whole graph with
+ *                   @c SSL_free(*user_sslp). On failure, set to @c NULL
+ *                   if the function actually obtained and freed a
+ *                   user_ssl; otherwise left untouched.
+ *
+ * @return The inner TLS @c SSL_CONNECTION (also stored as @c qc->tls)
+ *         on success, or @c NULL on failure.
+ */
+static SSL *port_new_handshake_layer(QUIC_PORT *port, QUIC_CHANNEL *ch, SSL **user_sslp)
 {
     SSL *tls = NULL;
     SSL_CONNECTION *tls_conn = NULL;
@@ -471,34 +543,30 @@ static SSL *port_new_handshake_layer(QUIC_PORT *port, QUIC_CHANNEL *ch)
      */
     if (!ossl_assert(port->get_conn_user_ssl != NULL))
         return NULL;
-    user_ssl = port->get_conn_user_ssl(ch, port->user_ssl_arg);
+    user_ssl = port->get_conn_user_ssl(ch, port->ql);
     if (user_ssl == NULL)
         return NULL;
     qc = (QUIC_CONNECTION *)user_ssl;
-    ql = (QUIC_LISTENER *)port->user_ssl_arg;
+    ql = port->ql;

     /*
      * We expect the user_ssl to be newly created so it must not have an
      * existing qc->tls
      */
-    if (!ossl_assert(qc->tls == NULL)) {
-        SSL_free(user_ssl);
-        return NULL;
-    }
+    if (!ossl_assert(qc->tls == NULL))
+        goto err;

     tls = ossl_ssl_connection_new_int(port->channel_ctx, user_ssl, TLS_method());
-    qc->tls = tls;
-    if (tls == NULL || (tls_conn = SSL_CONNECTION_FROM_SSL(tls)) == NULL) {
-        SSL_free(user_ssl);
-        return NULL;
-    }
+    if (tls == NULL || (tls_conn = SSL_CONNECTION_FROM_SSL(tls)) == NULL)
+        goto err;

     if (ql != NULL && ql->obj.ssl.ctx->new_pending_conn_cb != NULL)
         if (!ql->obj.ssl.ctx->new_pending_conn_cb(ql->obj.ssl.ctx, user_ssl,
-                ql->obj.ssl.ctx->new_pending_conn_arg)) {
-            SSL_free(user_ssl);
-            return NULL;
-        }
+                ql->obj.ssl.ctx->new_pending_conn_arg))
+            goto err;
+    qc->tls = tls;
+    qc->ch = ch;
+    *user_sslp = user_ssl;

     /* Override the user_ssl of the inner connection. */
     tls_conn->s3.flags |= TLS1_FLAGS_QUIC | TLS1_FLAGS_QUIC_INTERNAL;
@@ -506,7 +574,15 @@ static SSL *port_new_handshake_layer(QUIC_PORT *port, QUIC_CHANNEL *ch)
     /* Restrict options derived from the SSL_CTX. */
     tls_conn->options &= OSSL_QUIC_PERMITTED_OPTIONS_CONN;
     tls_conn->pha_enabled = 0;
-    return tls;
+
+    return qc->tls;
+
+err:
+    SSL_free(tls);
+    SSL_free(user_ssl);
+    *user_sslp = NULL;
+
+    return NULL;
 }

 static QUIC_CHANNEL *port_make_channel(QUIC_PORT *port, SSL *tls, OSSL_QRX *qrx,
@@ -514,6 +590,10 @@ static QUIC_CHANNEL *port_make_channel(QUIC_PORT *port, SSL *tls, OSSL_QRX *qrx,
 {
     QUIC_CHANNEL_ARGS args = { 0 };
     QUIC_CHANNEL *ch;
+    SSL *user_ssl = NULL;
+#ifndef OPENSSL_NO_QLOG
+    SSL_CTX *qlog_ctx;
+#endif

     args.port = port;
     args.is_server = is_server;
@@ -522,8 +602,21 @@ static QUIC_CHANNEL *port_make_channel(QUIC_PORT *port, SSL *tls, OSSL_QRX *qrx,
     args.qrx = qrx;
     args.is_tserver_ch = is_tserver;

+    args.max_idle_timeout = port->max_idle_timeout;
+    args.max_udp_payload_size = port->max_udp_payload_size;
+    args.init_max_data = port->init_max_data;
+    args.init_max_stream_data_bidi_local = port->init_max_stream_data_bidi_local;
+    args.init_max_stream_data_bidi_remote = port->init_max_stream_data_bidi_remote;
+    args.init_max_stream_data_uni = port->init_max_stream_data_uni;
+    args.init_max_streams_bidi = port->init_max_streams_bidi;
+    args.init_max_streams_uni = port->init_max_streams_uni;
+    args.ack_delay_exponent = port->ack_delay_exponent;
+    args.max_ack_delay = port->max_ack_delay;
+    args.disable_active_migration = port->disable_active_migration;
+    args.active_conn_id_limit = port->active_conn_id_limit;
+
     /*
-     * Creating a a new channel is made a bit tricky here as there is a
+     * Creating a new channel is made a bit tricky here as there is a
      * bit of a circular dependency.  Initializing a channel requires that
      * the ch->tls and optionally the qlog_title be configured prior to
      * initialization, but we need the channel at least partially configured
@@ -539,40 +632,56 @@ static QUIC_CHANNEL *port_make_channel(QUIC_PORT *port, SSL *tls, OSSL_QRX *qrx,
         return NULL;
     }

-    /*
-     * Fixup the channel tls connection here before we init the channel
-     */
-    ch->tls = (tls != NULL) ? tls : port_new_handshake_layer(port, ch);
-
-    if (ch->tls == NULL) {
-        OPENSSL_free(ch);
-        return NULL;
+    if (tls != NULL) {
+        ch->tls = tls;
+    } else {
+        if (ossl_quic_port_test_and_set_peeloff(port, PEELOFF_ACCEPT)) {
+            /*
+             * We're using the normal SSL_accept_connection_path
+             */
+            tls = port_new_handshake_layer(port, ch, &user_ssl);
+            if (tls == NULL)
+                goto err;
+            ch->tls = tls;
+        } else {
+            /*
+             * We're deferring user ssl creation until SSL_listen_ex is called
+             */
+            ch->tls = NULL;
+        }
     }
-
 #ifndef OPENSSL_NO_QLOG
     /*
-     * If we're using qlog, make sure the tls get further configured properly
+     * A deferred SSL_listen_ex() channel does not have its TLS object yet, but
+     * it still uses the port's channel context. Configure its qlog title before
+     * the first packet can cause the qlog object to be instantiated.
      */
     ch->use_qlog = 1;
-    if (ch->tls != NULL && ch->tls->ctx->qlog_title != NULL) {
+    qlog_ctx = ch->tls != NULL ? ch->tls->ctx : port->channel_ctx;
+    if (qlog_ctx != NULL && qlog_ctx->qlog_title != NULL) {
         OPENSSL_free(ch->qlog_title);
-        if ((ch->qlog_title = OPENSSL_strdup(ch->tls->ctx->qlog_title)) == NULL) {
-            ossl_quic_channel_free(ch);
-            return NULL;
-        }
+        if ((ch->qlog_title = OPENSSL_strdup(qlog_ctx->qlog_title)) == NULL)
+            goto err;
     }
 #endif

     /*
      * And finally init the channel struct
      */
-    if (!ossl_quic_channel_init(ch)) {
-        OPENSSL_free(ch);
-        return NULL;
-    }
+    if (!ossl_quic_channel_init(ch))
+        goto err;

     ossl_qtx_set_bio(ch->qtx, port->net_wbio);
     return ch;
+
+err:
+    if (user_ssl != NULL)
+        ((QUIC_CONNECTION *)user_ssl)->ch = NULL;
+
+    ossl_quic_channel_free(ch);
+    SSL_free(user_ssl);
+
+    return NULL;
 }

 QUIC_CHANNEL *ossl_quic_port_create_outgoing(QUIC_PORT *port, SSL *tls)
@@ -610,9 +719,14 @@ QUIC_CHANNEL *ossl_quic_port_pop_incoming(QUIC_PORT *port)
     return ch;
 }

+QUIC_CHANNEL *ossl_quic_port_peek_incoming(QUIC_PORT *port)
+{
+    return ossl_list_incoming_ch_head(&port->incoming_channel_list);
+}
+
 int ossl_quic_port_have_incoming(QUIC_PORT *port)
 {
-    return ossl_list_incoming_ch_head(&port->incoming_channel_list) != NULL;
+    return ossl_quic_port_peek_incoming(port) != NULL;
 }

 void ossl_quic_port_drop_incoming(QUIC_PORT *port)
@@ -628,6 +742,12 @@ void ossl_quic_port_drop_incoming(QUIC_PORT *port)
             break;

         tls = ossl_quic_channel_get0_tls(ch);
+        if (tls == NULL) {
+            /* Unpeeled SSL_listen_ex() channels have no user SSL. */
+            ossl_quic_channel_free(ch);
+            continue;
+        }
+
         /*
          * The user ssl may or may not have been created via the
          * get_conn_user_ssl callback in the QUIC stack.  The
@@ -655,6 +775,27 @@ void ossl_quic_port_set_allow_incoming(QUIC_PORT *port, int allow_incoming)
     port->allow_incoming = allow_incoming;
 }

+int ossl_quic_port_test_and_set_peeloff(QUIC_PORT *port, int using_peeloff)
+{
+
+    /*
+     * Peeloff state must be one of PEELOFF_LISTEN or PEELOFF_ACCEPT
+     */
+    if (using_peeloff != PEELOFF_LISTEN && using_peeloff != PEELOFF_ACCEPT)
+        return 0;
+
+    /*
+     * We can only set the peeloff state if its not already been set
+     * or if we're setting it to the already set value
+     * i.e. this is a trapdoor, once we set using_peeloff to LISTEN or ACCEPT
+     * Then the only thing we can set that port too in the future is the same value.
+     */
+    if (port->peeloff_mode != using_peeloff && port->peeloff_mode != PEELOFF_UNSET)
+        return 0;
+    port->peeloff_mode = using_peeloff;
+    return 1;
+}
+
 /*
  * QUIC Port: Ticker-Mutator
  * =========================
@@ -747,6 +888,9 @@ static void port_bind_channel(QUIC_PORT *port, const BIO_ADDR *peer,
     if (port->tserver_ch != NULL) {
         ch = port->tserver_ch;
         port->tserver_ch = NULL;
+        if (peer != NULL && BIO_ADDR_family(peer) != AF_UNSPEC)
+            ossl_quic_channel_set_peer_addr(ch, peer);
+
         ossl_quic_channel_bind_qrx(ch, qrx);
         ossl_qrx_set_msg_callback(ch->qrx, ch->msg_callback,
             ch->msg_callback_ssl);
@@ -836,7 +980,7 @@ static int port_try_handle_stateless_reset(QUIC_PORT *port, const QUIC_URXE *e)

     for (i = 0;; ++i) {
         if (!ossl_quic_srtm_lookup(port->srtm,
-                (QUIC_STATELESS_RESET_TOKEN *)(data + e->data_len
+                (const QUIC_STATELESS_RESET_TOKEN *)(data + e->data_len
                     - sizeof(QUIC_STATELESS_RESET_TOKEN)),
                 i, &opaque, NULL))
             break;
@@ -909,7 +1053,7 @@ static int marshal_validation_token(QUIC_VALIDATION_TOKEN *token,
     }

     if (!WPACKET_init(&wpkt, buf_mem)
-        || !WPACKET_memset(&wpkt, token->is_retry, 1)
+        || !WPACKET_put_bytes_u8(&wpkt, token->is_retry)
         || !WPACKET_memcpy(&wpkt, &token->timestamp,
             sizeof(token->timestamp))
         || (token->is_retry
@@ -955,10 +1099,10 @@ static int encrypt_validation_token(const QUIC_PORT *port,
     size_t *ct_len)
 {
     int iv_len, len, ret = 0;
-    size_t tag_len;
+    int tag_len;
     unsigned char *iv = ciphertext, *data, *tag;

-    if ((tag_len = EVP_CIPHER_CTX_get_tag_length(port->token_ctx)) == 0
+    if ((tag_len = EVP_CIPHER_CTX_get_tag_length(port->token_ctx)) <= 0
         || (iv_len = EVP_CIPHER_CTX_get_iv_length(port->token_ctx)) <= 0)
         goto err;

@@ -973,7 +1117,7 @@ static int encrypt_validation_token(const QUIC_PORT *port,

     if (!RAND_bytes_ex(port->engine->libctx, ciphertext, iv_len, 0)
         || !EVP_EncryptInit_ex(port->token_ctx, NULL, NULL, NULL, iv)
-        || !EVP_EncryptUpdate(port->token_ctx, data, &len, plaintext, pt_len)
+        || !EVP_EncryptUpdate(port->token_ctx, data, &len, plaintext, (int)pt_len)
         || !EVP_EncryptFinal_ex(port->token_ctx, data + pt_len, &len)
         || !EVP_CIPHER_CTX_ctrl(port->token_ctx, EVP_CTRL_GCM_GET_TAG, tag_len, tag))
         goto err;
@@ -1005,15 +1149,15 @@ static int decrypt_validation_token(const QUIC_PORT *port,
     size_t *pt_len)
 {
     int iv_len, len = 0, ret = 0;
-    size_t tag_len;
+    int tag_len;
     const unsigned char *iv = ciphertext, *data, *tag;

-    if ((tag_len = EVP_CIPHER_CTX_get_tag_length(port->token_ctx)) == 0
+    if ((tag_len = EVP_CIPHER_CTX_get_tag_length(port->token_ctx)) <= 0
         || (iv_len = EVP_CIPHER_CTX_get_iv_length(port->token_ctx)) <= 0)
         goto err;

     /* Prevent decryption of a buffer that is not within reasonable bounds */
-    if (ct_len < (iv_len + tag_len) || ct_len > ENCRYPTED_TOKEN_MAX_LEN)
+    if (ct_len < (size_t)iv_len + tag_len || ct_len > ENCRYPTED_TOKEN_MAX_LEN)
         goto err;

     *pt_len = ct_len - iv_len - tag_len;
@@ -1027,7 +1171,7 @@ static int decrypt_validation_token(const QUIC_PORT *port,

     if (!EVP_DecryptInit_ex(port->token_ctx, NULL, NULL, NULL, iv)
         || !EVP_DecryptUpdate(port->token_ctx, plaintext, &len, data,
-            ct_len - iv_len - tag_len)
+            (int)(ct_len - iv_len - tag_len))
         || !EVP_CIPHER_CTX_ctrl(port->token_ctx, EVP_CTRL_GCM_SET_TAG, tag_len,
             (void *)tag)
         || !EVP_DecryptFinal_ex(port->token_ctx, plaintext + len, &len))
@@ -1331,6 +1475,10 @@ err:
  *              token is valid.
  * @param scid  Pointer to the connection ID structure to store the SCID if the
  *              token is valid.
+ * @param gen_new_token Set to 1 if a NEW_TOKEN frame should be sent on the
+ *              new connection.
+ * @param is_retry Set to 1 if the token decrypted and parsed as a token we
+ *              minted for a RETRY packet, even if it then failed validation.
  *
  * @return      1 if the token is valid and ODCID/SCID are successfully set.
  *              0 otherwise.
@@ -1344,7 +1492,8 @@ err:
  *   configurable in the future.
  */
 static int port_validate_token(QUIC_PKT_HDR *hdr, QUIC_PORT *port,
-    BIO_ADDR *peer, QUIC_CONN_ID *odcid, uint8_t *gen_new_token)
+    BIO_ADDR *peer, QUIC_CONN_ID *odcid, uint8_t *gen_new_token,
+    uint8_t *is_retry)
 {
     int ret = 0;
     QUIC_VALIDATION_TOKEN token = { 0 };
@@ -1354,6 +1503,7 @@ static int port_validate_token(QUIC_PKT_HDR *hdr, QUIC_PORT *port,
     OSSL_TIME now = ossl_time_now();

     *gen_new_token = 0;
+    *is_retry = 0;

     if (!decrypt_validation_token(port, hdr->token, hdr->token_len, NULL,
             &dec_token_len)
@@ -1363,6 +1513,8 @@ static int port_validate_token(QUIC_PKT_HDR *hdr, QUIC_PORT *port,
         || !parse_validation_token(&token, dec_token, dec_token_len))
         goto err;

+    *is_retry = token.is_retry;
+
     /*
      * Validate token timestamp. Current time should not be before the token
      * timestamp.
@@ -1497,6 +1649,7 @@ static void port_default_packet_handler(QUIC_URXE *e, void *arg,
     QUIC_CHANNEL *ch = NULL, *new_ch = NULL;
     QUIC_CONN_ID odcid;
     uint8_t gen_new_token = 0;
+    uint8_t is_retry_token = 0;
     OSSL_QRX *qrx = NULL, *qrx_ref;
     OSSL_QRX *qrx_src = NULL;
     OSSL_QRX_ARGS qrx_args = { 0 };
@@ -1656,7 +1809,7 @@ static void port_default_packet_handler(QUIC_URXE *e, void *arg,
      */
     if (hdr.token != NULL
         && port_validate_token(&hdr, port, &e->peer,
-               &odcid, &gen_new_token)
+               &odcid, &gen_new_token, &is_retry_token)
             == 0) {
         /*
          * RFC 9000 s 8.1.3
@@ -1670,6 +1823,18 @@ static void port_default_packet_handler(QUIC_URXE *e, void *arg,
          * the request is valid
          */
         if (port->validate_addr == 1) {
+            /*
+             * RFC 9000 s 8.1.2
+             * If we minted this token for a Retry packet, the client has
+             * already processed a Retry and will not accept another one
+             * (RFC 9000 s 17.2.5.2), so sending one would only leave the
+             * client waiting for its idle timeout. The RFC prefers closing
+             * with INVALID_TOKEN, but also allows discarding the packet,
+             * which is what we do here.
+             */
+            if (is_retry_token)
+                goto undesirable;
+
             /*
              * Again: we should consider saving initial encryption level
              * secrets to token here to save some CPU cycles.
@@ -1789,6 +1954,110 @@ void ossl_quic_port_restore_err_state(const QUIC_PORT *port)
     OSSL_ERR_STATE_restore(port->err_state);
 }

+void ossl_quic_port_set_max_idle_timeout(QUIC_PORT *port, uint64_t ms)
+{
+    port->max_idle_timeout = ms;
+}
+
+uint64_t ossl_quic_port_get_max_idle_timeout(const QUIC_PORT *port)
+{
+    return port->max_idle_timeout;
+}
+
+void ossl_quic_port_set_max_udp_payload_size(QUIC_PORT *port, uint64_t size)
+{
+    port->max_udp_payload_size = size;
+}
+
+uint64_t ossl_quic_port_get_max_udp_payload_size(const QUIC_PORT *port)
+{
+    return port->max_udp_payload_size;
+}
+
+void ossl_quic_port_set_init_max_data(QUIC_PORT *port, uint64_t max_data)
+{
+    port->init_max_data = max_data;
+}
+
+uint64_t ossl_quic_port_get_init_max_data(const QUIC_PORT *port)
+{
+    return port->init_max_data;
+}
+
+void ossl_quic_port_set_init_max_stream_data(QUIC_PORT *port, uint64_t max_data, int is_uni, int is_remote)
+{
+    if (is_uni) {
+        port->init_max_stream_data_uni = max_data;
+    } else {
+        if (is_remote)
+            port->init_max_stream_data_bidi_remote = max_data;
+        else
+            port->init_max_stream_data_bidi_local = max_data;
+    }
+}
+
+uint64_t ossl_quic_port_get_init_max_stream_data(const QUIC_PORT *port, int is_uni, int is_remote)
+{
+    if (is_uni)
+        return port->init_max_stream_data_uni;
+    else
+        return is_remote ? port->init_max_stream_data_bidi_remote : port->init_max_stream_data_bidi_local;
+}
+
+void ossl_quic_port_set_init_max_streams(QUIC_PORT *port, uint64_t max_streams, int is_uni)
+{
+    if (is_uni) {
+        port->init_max_streams_uni = max_streams;
+    } else {
+        port->init_max_streams_bidi = max_streams;
+    }
+}
+
+uint64_t ossl_quic_port_get_init_max_streams(const QUIC_PORT *port, int is_uni)
+{
+    return is_uni ? port->init_max_streams_uni : port->init_max_streams_bidi;
+}
+
+void ossl_quic_port_set_ack_delay_exponent(QUIC_PORT *port, uint64_t exp)
+{
+    port->ack_delay_exponent = (unsigned char)exp;
+}
+
+uint64_t ossl_quic_port_get_ack_delay_exponent(const QUIC_PORT *port)
+{
+    return port->ack_delay_exponent;
+}
+
+void ossl_quic_port_set_max_ack_delay(QUIC_PORT *port, uint64_t ms)
+{
+    port->max_ack_delay = ms;
+}
+
+uint64_t ossl_quic_port_get_max_ack_delay(const QUIC_PORT *port)
+{
+    return port->max_ack_delay;
+}
+
+void ossl_quic_port_set_disable_active_migration(QUIC_PORT *port, uint64_t disable)
+{
+    port->disable_active_migration = (unsigned char)disable;
+}
+
+uint64_t ossl_quic_port_get_disable_active_migration(const QUIC_PORT *port)
+{
+    return port->disable_active_migration;
+}
+
+void ossl_quic_port_set_active_conn_id_limit(QUIC_PORT *port, uint64_t limit)
+{
+    port->active_conn_id_limit = limit;
+}
+
+uint64_t ossl_quic_port_get_active_conn_id_limit(const QUIC_PORT *port)
+{
+    return port->active_conn_id_limit;
+}
+
 uint64_t ossl_quic_port_get_max_pending_channels(const QUIC_PORT *port)
 {
     return port->max_pending_channels;
diff --git a/deps/openssl/openssl/ssl/quic/quic_port_local.h b/deps/openssl/openssl/ssl/quic/quic_port_local.h
index 0cfc75da0ba..8f7ccf53189 100644
--- a/deps/openssl/openssl/ssl/quic/quic_port_local.h
+++ b/deps/openssl/openssl/ssl/quic/quic_port_local.h
@@ -51,8 +51,8 @@ struct quic_port_st {
      */
     OSSL_LIST_MEMBER(port, QUIC_PORT);

-    SSL *(*get_conn_user_ssl)(QUIC_CHANNEL *ch, void *arg);
-    void *user_ssl_arg;
+    SSL *(*get_conn_user_ssl)(QUIC_CHANNEL *ch, QUIC_LISTENER *ql);
+    QUIC_LISTENER *ql;

     /* Used to create handshake layer objects inside newly created channels. */
     SSL_CTX *channel_ctx;
@@ -116,8 +116,25 @@ struct quic_port_st {
     /* Has the BIO been changed since we last updated reactor pollability? */
     unsigned int bio_changed : 1;

+    /* Are we using SSL_listen_ex to peeloff connections */
+    int peeloff_mode;
+
     /* AES-256 GCM context for token encryption */
     EVP_CIPHER_CTX *token_ctx;
+
+    /* Transport parameter values for the port. */
+    uint64_t max_idle_timeout;
+    uint64_t max_udp_payload_size;
+    uint64_t init_max_data;
+    uint64_t init_max_stream_data_bidi_local;
+    uint64_t init_max_stream_data_bidi_remote;
+    uint64_t init_max_stream_data_uni;
+    uint64_t init_max_streams_bidi;
+    uint64_t init_max_streams_uni;
+    uint64_t max_ack_delay;
+    uint64_t active_conn_id_limit;
+    unsigned char ack_delay_exponent;
+    unsigned char disable_active_migration;
     uint64_t max_pending_channels;
 };

diff --git a/deps/openssl/openssl/ssl/quic/quic_rcidm.c b/deps/openssl/openssl/ssl/quic/quic_rcidm.c
index 9fd125f8024..d4ee12549c1 100644
--- a/deps/openssl/openssl/ssl/quic/quic_rcidm.c
+++ b/deps/openssl/openssl/ssl/quic/quic_rcidm.c
@@ -270,8 +270,11 @@ static void rcidm_check_rcid(QUIC_RCIDM *rcidm, RCID *rcid)
     assert(rcid->state != RCID_STATE_RETIRING || rcidm->num_retiring > 0);
 }

-static int rcid_cmp(const RCID *a, const RCID *b)
+static int rcid_cmp(const void *av, const void *bv)
 {
+    const RCID *a = av;
+    const RCID *b = bv;
+
     if (a->seq_num < b->seq_num)
         return -1;
     if (a->seq_num > b->seq_num)
diff --git a/deps/openssl/openssl/ssl/quic/quic_reactor.c b/deps/openssl/openssl/ssl/quic/quic_reactor.c
index c30bc3c595a..b570821aa39 100644
--- a/deps/openssl/openssl/ssl/quic/quic_reactor.c
+++ b/deps/openssl/openssl/ssl/quic/quic_reactor.c
@@ -44,6 +44,7 @@ int ossl_quic_reactor_init(QUIC_REACTOR *rtor,
     rtor->mutex = mutex;

     rtor->cur_blocking_waiters = 0;
+    rtor->notify_generation = 0;

     if ((flags & QUIC_REACTOR_FLAG_USE_NOTIFIER) != 0) {
         if (!ossl_rio_notifier_init(&rtor->notifier))
@@ -608,25 +609,56 @@ void ossl_quic_reactor_enter_blocking_section(QUIC_REACTOR *rtor)
     ++rtor->cur_blocking_waiters;
 }

-void ossl_quic_reactor_leave_blocking_section(QUIC_REACTOR *rtor)
+int ossl_quic_reactor_deregister_blocking_section(QUIC_REACTOR *rtor,
+    uint64_t *gen)
 {
     assert(rtor->cur_blocking_waiters > 0);
     --rtor->cur_blocking_waiters;

-    if (rtor->have_notifier && rtor->signalled_notifier) {
-        if (rtor->cur_blocking_waiters == 0) {
-            ossl_rio_notifier_unsignal(&rtor->notifier);
-            rtor->signalled_notifier = 0;
+    /* The last waiter drains the notifier and advances its signal generation. */
+    if (rtor->have_notifier && rtor->signalled_notifier
+        && rtor->cur_blocking_waiters == 0) {
+        ossl_rio_notifier_unsignal(&rtor->notifier);
+        rtor->signalled_notifier = 0;
+        ++rtor->notify_generation;
+        ossl_crypto_condvar_broadcast(rtor->notifier_cv);
+    }

-            /*
-             * Release the other threads which have woken up (and possibly
-             * rtor_notify_other_threads as well).
-             */
-            ossl_crypto_condvar_broadcast(rtor->notifier_cv);
-        } else {
-            /* We are not the last waiter out - so wait for that one. */
-            while (rtor->signalled_notifier)
-                ossl_crypto_condvar_wait(rtor->notifier_cv, rtor->mutex);
-        }
+    /* Remaining waiters require phase 2 for the current signal generation. */
+    if (rtor->have_notifier && rtor->signalled_notifier) {
+        *gen = rtor->notify_generation;
+        return 1;
     }
+
+    return 0;
+}
+
+/*
+ * Wait only for the signal cycle observed during deregistration.
+ * Precondition: reactor mutex held.
+ */
+static void rtor_wait_for_notifier_clear_locked(QUIC_REACTOR *rtor,
+    uint64_t gen)
+{
+    if (rtor->have_notifier)
+        while (rtor->signalled_notifier
+            && rtor->notify_generation == gen)
+            ossl_crypto_condvar_wait(rtor->notifier_cv, rtor->mutex);
+}
+
+void ossl_quic_reactor_wait_for_notifier_clear(QUIC_REACTOR *rtor,
+    uint64_t gen)
+{
+    ossl_crypto_mutex_lock(rtor->mutex);
+    rtor_wait_for_notifier_clear_locked(rtor, gen);
+    ossl_crypto_mutex_unlock(rtor->mutex);
+}
+
+void ossl_quic_reactor_leave_blocking_section(QUIC_REACTOR *rtor)
+{
+    uint64_t gen;
+
+    /* Caller holds the reactor mutex across both phases. */
+    if (ossl_quic_reactor_deregister_blocking_section(rtor, &gen))
+        rtor_wait_for_notifier_clear_locked(rtor, gen);
 }
diff --git a/deps/openssl/openssl/ssl/quic/quic_reactor_wait_ctx.c b/deps/openssl/openssl/ssl/quic/quic_reactor_wait_ctx.c
index f84a7b82f66..53cdda15413 100644
--- a/deps/openssl/openssl/ssl/quic/quic_reactor_wait_ctx.c
+++ b/deps/openssl/openssl/ssl/quic/quic_reactor_wait_ctx.c
@@ -15,6 +15,9 @@ struct quic_reactor_wait_slot_st {
     OSSL_LIST_MEMBER(quic_reactor_wait_slot, QUIC_REACTOR_WAIT_SLOT);
     QUIC_REACTOR *rtor; /* primary key */
     size_t blocking_count; /* datum */
+    /* Generation captured at the 1->0 deregistration, for the phase-2 wait. */
+    uint64_t notify_generation;
+    unsigned int need_notify_wait : 1; /* set when phase 2 must wait */
 };

 DEFINE_LIST_OF_IMPL(quic_reactor_wait_slot, QUIC_REACTOR_WAIT_SLOT);
@@ -30,14 +33,22 @@ static void slot_activate(QUIC_REACTOR_WAIT_SLOT *slot)
         ossl_quic_reactor_enter_blocking_section(slot->rtor);
 }

-static void slot_deactivate(QUIC_REACTOR_WAIT_SLOT *slot)
+/*
+ * Phase-1 deregistration: on the 1->0 transition, deregister from the reactor
+ * without blocking and capture whether phase 2 must wait (and the generation).
+ * Caller must hold the reactor mutex.
+ */
+static void slot_deactivate_deregister(QUIC_REACTOR_WAIT_SLOT *slot)
 {
     assert(slot->blocking_count > 0);

     if (--slot->blocking_count > 0)
         return;

-    ossl_quic_reactor_leave_blocking_section(slot->rtor);
+    slot->need_notify_wait
+        = ossl_quic_reactor_deregister_blocking_section(slot->rtor,
+              &slot->notify_generation)
+        != 0;
 }

 int ossl_quic_reactor_wait_ctx_enter(QUIC_REACTOR_WAIT_CTX *ctx,
@@ -61,7 +72,7 @@ int ossl_quic_reactor_wait_ctx_enter(QUIC_REACTOR_WAIT_CTX *ctx,
     return 1;
 }

-void ossl_quic_reactor_wait_ctx_leave(QUIC_REACTOR_WAIT_CTX *ctx,
+void ossl_quic_reactor_wait_ctx_deregister(QUIC_REACTOR_WAIT_CTX *ctx,
     QUIC_REACTOR *rtor)
 {
     QUIC_REACTOR_WAIT_SLOT *slot;
@@ -71,7 +82,30 @@ void ossl_quic_reactor_wait_ctx_leave(QUIC_REACTOR_WAIT_CTX *ctx,
             break;

     assert(slot != NULL);
-    slot_deactivate(slot);
+    slot_deactivate_deregister(slot);
+}
+
+/*
+ * Phase 2: wait for every notifier phase 1 left signalled to clear. Because
+ * phase 1 has already decremented every slot's refcount to zero, the calling
+ * thread holds no waiter registration here and cannot be part of a
+ * cross-reactor deadlock. Each reactor's mutex is acquired internally.
+ */
+void ossl_quic_reactor_wait_ctx_drain(QUIC_REACTOR_WAIT_CTX *ctx)
+{
+    QUIC_REACTOR_WAIT_SLOT *slot;
+
+    OSSL_LIST_FOREACH (slot, quic_reactor_wait_slot, &ctx->slots) {
+        /* Invariant: phase 1 must have deregistered every slot by now. */
+        assert(slot->blocking_count == 0);
+
+        if (!slot->need_notify_wait)
+            continue;
+
+        ossl_quic_reactor_wait_for_notifier_clear(slot->rtor,
+            slot->notify_generation);
+        slot->need_notify_wait = 0;
+    }
 }

 void ossl_quic_reactor_wait_ctx_cleanup(QUIC_REACTOR_WAIT_CTX *ctx)
@@ -80,6 +114,7 @@ void ossl_quic_reactor_wait_ctx_cleanup(QUIC_REACTOR_WAIT_CTX *ctx)

     OSSL_LIST_FOREACH_DELSAFE (slot, nslot, quic_reactor_wait_slot, &ctx->slots) {
         assert(slot->blocking_count == 0);
+        assert(!slot->need_notify_wait);
         OPENSSL_free(slot);
     }
 }
diff --git a/deps/openssl/openssl/ssl/quic/quic_record_rx.c b/deps/openssl/openssl/ssl/quic/quic_record_rx.c
index 1f0b9b5c58e..e69d19207e1 100644
--- a/deps/openssl/openssl/ssl/quic/quic_record_rx.c
+++ b/deps/openssl/openssl/ssl/quic/quic_record_rx.c
@@ -929,11 +929,11 @@ static int qrx_decrypt_pkt_body(OSSL_QRX *qrx, unsigned char *dst,
         return 0;

     /* Feed AAD data. */
-    if (EVP_CipherUpdate(cctx, NULL, &l, aad, aad_len) != 1)
+    if (EVP_CipherUpdate(cctx, NULL, &l, aad, (int)aad_len) != 1)
         return 0;

     /* Feed encrypted packet body. */
-    if (EVP_CipherUpdate(cctx, dst, &l, src, src_len - el->tag_len) != 1)
+    if (EVP_CipherUpdate(cctx, dst, &l, src, (int)(src_len - el->tag_len)) != 1)
         return 0;

 #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
diff --git a/deps/openssl/openssl/ssl/quic/quic_record_tx.c b/deps/openssl/openssl/ssl/quic/quic_record_tx.c
index 93d1203c37d..f5bd5b2f83c 100644
--- a/deps/openssl/openssl/ssl/quic/quic_record_tx.c
+++ b/deps/openssl/openssl/ssl/quic/quic_record_tx.c
@@ -15,6 +15,8 @@
 #include "internal/list.h"
 #include "../ssl_local.h"

+#define QTX_DEFAULT_MTU 1500
+
 /*
  * TXE
  * ===
@@ -68,6 +70,12 @@ struct ossl_qtx_st {
     /* TX maximum datagram payload length. */
     size_t mdpl;

+    /*
+     * Our current understanding of the upper bound on an outgoing datagram size
+     * in bytes.
+     */
+    size_t mtu;
+
     /*
      * List of TXEs which are not currently in use. These are moved to the
      * pending list (possibly via tx_cons first) as they are filled.
@@ -125,6 +133,8 @@ OSSL_QTX *ossl_qtx_new(const OSSL_QTX_ARGS *args)
     qtx->propq = args->propq;
     qtx->bio = args->bio;
     qtx->mdpl = args->mdpl;
+    /* We update this if possible when we get a BIO. */
+    qtx->mtu = QTX_DEFAULT_MTU;
     qtx->get_qlog_cb = args->get_qlog_cb;
     qtx->get_qlog_cb_arg = args->get_qlog_cb_arg;

@@ -232,77 +242,49 @@ static TXE *qtx_alloc_txe(size_t alloc_len)
 }

 /*
- * Ensures there is at least one TXE in the free list, allocating a new entry
- * if necessary. The returned TXE is in the free list; it is not popped.
- *
- * alloc_len is a hint which may be used to determine the TXE size if allocation
- * is necessary. Returns NULL on allocation failure.
- */
-static TXE *qtx_ensure_free_txe(OSSL_QTX *qtx, size_t alloc_len)
-{
-    TXE *txe;
-
-    txe = ossl_list_txe_head(&qtx->free);
-    if (txe != NULL)
-        return txe;
-
-    txe = qtx_alloc_txe(alloc_len);
-    if (txe == NULL)
-        return NULL;
-
-    ossl_list_txe_insert_tail(&qtx->free, txe);
-    return txe;
-}
-
-/*
- * Resize the data buffer attached to an TXE to be n bytes in size. The address
- * of the TXE might change; the new address is returned, or NULL on failure, in
- * which case the original TXE remains valid.
+ * Ensure that qtx->cons has a TXE attached with allocated size of at least
+ * min_size.  Returns pointer to the TXE on success or NULL on failure.
  */
-static TXE *qtx_resize_txe(OSSL_QTX *qtx, TXE *txe, size_t n)
+static TXE *qtx_get_cons_txe(OSSL_QTX *qtx, size_t min_size)
 {
-    TXE *txe2;
-
-    /* Should never happen. */
-    if (txe == NULL)
-        return NULL;
-
-    if (n >= SIZE_MAX - sizeof(TXE))
+    if (min_size >= SIZE_MAX - sizeof(TXE))
         return NULL;

     /*
-     * to resize txe, the caller must detach it from the list first,
-     * fail if txe is still attached.
+     * If there is no coalescing in progress, try to get a TXE
+     * from the free list (and remove it from there), or allocate a new one.
      */
-    if (!ossl_assert(ossl_list_txe_prev(txe) == NULL
-            && ossl_list_txe_next(txe) == NULL))
-        return NULL;
+    if (qtx->cons == NULL) {
+        TXE *txe = ossl_list_txe_head(&qtx->free);

-    /*
-     * NOTE: We do not clear old memory, although it does contain decrypted
-     * data.
-     */
-    txe2 = OPENSSL_realloc(txe, sizeof(TXE) + n);
-    if (txe2 == NULL)
-        return NULL;
+        if (txe != NULL) {
+            ossl_list_txe_remove(&qtx->free, txe);
+        } else {
+            if ((txe = qtx_alloc_txe(min_size)) == NULL)
+                return NULL;
+        }

-    if (qtx->cons == txe)
-        qtx->cons = txe2;
+        txe->data_len = 0;
+        qtx->cons = txe;
+        qtx->cons_count = 0;
+    }

-    txe2->alloc_len = n;
-    return txe2;
-}
+    /* Resize TXE if it's too small. */
+    if (qtx->cons->alloc_len < min_size) {
+        /*
+         * NOTE: We do not clear old memory, although it does contain decrypted
+         * data.
+         */
+        TXE *realloc_txe = OPENSSL_realloc(qtx->cons, sizeof(TXE) + min_size);

-/*
- * Ensure the data buffer attached to an TXE is at least n bytes in size.
- * Returns NULL on failure.
- */
-static TXE *qtx_reserve_txe(OSSL_QTX *qtx, TXE *txe, size_t n)
-{
-    if (txe->alloc_len >= n)
-        return txe;
+        if (realloc_txe == NULL)
+            return NULL;
+
+        realloc_txe->alloc_len = min_size;
+        qtx->cons = realloc_txe;
+    }

-    return qtx_resize_txe(qtx, txe, n);
+    return qtx->cons;
 }

 /* Move a TXE from pending to free. */
@@ -534,7 +516,7 @@ static int qtx_encrypt_into_txe(OSSL_QTX *qtx, struct iovec_cur *cur, TXE *txe,
     }

     /* Feed AAD data. */
-    if (EVP_CipherUpdate(cctx, NULL, &l, hdr, hdr_len) != 1) {
+    if (EVP_CipherUpdate(cctx, NULL, &l, hdr, (int)hdr_len) != 1) {
         ERR_raise(ERR_LIB_SSL, ERR_R_EVP_LIB);
         return 0;
     }
@@ -549,7 +531,7 @@ static int qtx_encrypt_into_txe(OSSL_QTX *qtx, struct iovec_cur *cur, TXE *txe,
             break;

         if (EVP_CipherUpdate(cctx, txe_data(txe) + txe->data_len,
-                &l, src, src_len)
+                &l, src, (int)src_len)
             != 1) {
             ERR_raise(ERR_LIB_SSL, ERR_R_EVP_LIB);
             return 0;
@@ -720,24 +702,6 @@ err:
     return ret;
 }

-static TXE *qtx_ensure_cons(OSSL_QTX *qtx)
-{
-    TXE *txe = qtx->cons;
-
-    if (txe != NULL)
-        return txe;
-
-    txe = qtx_ensure_free_txe(qtx, qtx->mdpl);
-    if (txe == NULL)
-        return NULL;
-
-    ossl_list_txe_remove(&qtx->free, txe);
-    qtx->cons = txe;
-    qtx->cons_count = 0;
-    txe->data_len = 0;
-    return txe;
-}
-
 static QLOG *qtx_get_qlog(OSSL_QTX *qtx)
 {
     if (qtx->get_qlog_cb == NULL)
@@ -830,22 +794,14 @@ int ossl_qtx_write_pkt(OSSL_QTX *qtx, const OSSL_QTX_PKT *pkt)
          *	- detached.
          *
          * if txe is detached (not member of free/tx list), then it is kept
-         * in qtx->cons. The qtx_ensure_cons() here either returns the txe
-         * from free list or existing ->cons txe. The txe we obtain here
-         * is detached.
-         */
-        txe = qtx_ensure_cons(qtx);
-        if (txe == NULL)
-            return 0; /* allocation failure */
-
-        /*
-         * Ensure TXE has at least MDPL bytes allocated. This should only be
-         * possible if the MDPL has increased.
+         * in qtx->cons. The qtx_get_cons_txe() here makes sure that qtx->cons
+         * points at a (new or existing) detached txe and has at least MDPL
+         * bytes allocated.
          */
-        txe = qtx_reserve_txe(qtx, txe, qtx->mdpl);
+        txe = qtx_get_cons_txe(qtx, qtx->mdpl);
         if (txe == NULL) {
             /*
-             * realloc of txe failed. however it is still kept in ->cons,
+             * If realloc of txe has failed. it is still kept in ->cons,
              * no memory leak.
              * The question is what we should do here to handle error,
              * is doing `return 0` enough? or shall we discard ->cons and
@@ -1038,15 +994,40 @@ int ossl_qtx_pop_net(OSSL_QTX *qtx, BIO_MSG *msg)

 void ossl_qtx_set_bio(OSSL_QTX *qtx, BIO *bio)
 {
+    unsigned int mtu;
+
     qtx->bio = bio;
+
+    if (bio != NULL) {
+        /*
+         * Try to determine our MTU if possible. The BIO is not required to
+         * support this, in which case we remain at the last known MTU, or our
+         * initial default.
+         */
+        mtu = BIO_dgram_get_mtu(bio);
+        if (mtu >= QUIC_MIN_INITIAL_DGRAM_LEN)
+            ossl_qtx_set_mtu(qtx, mtu); /* best effort */
+    }
+}
+
+int ossl_qtx_set_mtu(OSSL_QTX *qtx, unsigned int mtu)
+{
+    if (mtu < QUIC_MIN_INITIAL_DGRAM_LEN)
+        return 0;
+
+    qtx->mtu = mtu;
+    return 1;
 }

 int ossl_qtx_set_mdpl(OSSL_QTX *qtx, size_t mdpl)
 {
+    size_t mtu_limit;
+
     if (mdpl < QUIC_MIN_INITIAL_DGRAM_LEN)
         return 0;

-    qtx->mdpl = mdpl;
+    mtu_limit = qtx->mtu - BIO_dgram_get_mtu_overhead(qtx->bio);
+    qtx->mdpl = mdpl > mtu_limit ? mtu_limit : mdpl;
     return 1;
 }

diff --git a/deps/openssl/openssl/ssl/quic/quic_rstream.c b/deps/openssl/openssl/ssl/quic/quic_rstream.c
index 0fdceb65009..2606f983b1b 100644
--- a/deps/openssl/openssl/ssl/quic/quic_rstream.c
+++ b/deps/openssl/openssl/ssl/quic/quic_rstream.c
@@ -20,13 +20,12 @@ struct quic_rstream_st {
     UINT_RANGE head_range;
 };

-/* ARGSUSED */
-#define STDERR NULL
-static void print_foo(void *f, ...)
-{
-}
-
-#define DEBUG_PRINT print_foo
+#if !defined(NDEBUG) && defined(WITH_RSTREAM_DEBUG)
+#include <stdio.h>
+#define DEBUG_PRINT(...) fprintf(__VA_ARGS__)
+#else
+#define DEBUG_PRINT(...) (void)(0)
+#endif

 QUIC_RSTREAM *ossl_quic_rstream_new(QUIC_RXFC *rxfc,
     OSSL_STATM *statm, QUIC_RSTREAM_QPARM *rsqp)
@@ -80,11 +79,11 @@ static int read_internal(QUIC_RSTREAM *qrs, unsigned char *buf, size_t size,
     size_t readbytes_ = 0;
     int fin_ = 0, ret = 1;

-    DEBUG_PRINT(STDERR, "%s want: %zu\n", OPENSSL_FUNC, size);
+    DEBUG_PRINT(stderr, "%s want: %zu\n", OPENSSL_FUNC, size);
     while (ossl_sframe_set_peek(&qrs->fs, &iter, &range, &data, &fin_)) {
         size_t l = (size_t)(range.end - range.start);

-        DEBUG_PRINT(STDERR, "\t[ %llu, %llu ]\n", range.start, range.end);
+        DEBUG_PRINT(stderr, "\t[ %llu, %llu ]\n", range.start, range.end);
         if (l > size) {
             l = size;
             fin_ = 0;
@@ -105,11 +104,11 @@ static int read_internal(QUIC_RSTREAM *qrs, unsigned char *buf, size_t size,
         ret = ossl_sframe_set_move_offset(&qrs->fs, offset);

     if (ret) {
-        DEBUG_PRINT(STDERR, "%s got: %zu\n", OPENSSL_FUNC, readbytes_);
+        DEBUG_PRINT(stderr, "%s got: %zu\n", OPENSSL_FUNC, readbytes_);
         *readbytes = readbytes_;
         *fin = fin_;
     } else {
-        DEBUG_PRINT(STDERR, "%s got: nothing\n", OPENSSL_FUNC);
+        DEBUG_PRINT(stderr, "%s got: nothing\n", OPENSSL_FUNC);
     }

     return ret;
@@ -182,7 +181,7 @@ int ossl_quic_rstream_get_record(QUIC_RSTREAM *qrs,
         return 1;
     }

-    DEBUG_PRINT(STDERR, "%s head: [ %llu, %llu ]\n", OPENSSL_FUNC,
+    DEBUG_PRINT(stderr, "%s head: [ %llu, %llu ]\n", OPENSSL_FUNC,
         qrs->head_range.start, qrs->head_range.end);
     /* if final empty frame, we drop it immediately */
     if (qrs->head_range.end == qrs->head_range.start) {
diff --git a/deps/openssl/openssl/ssl/quic/quic_srtm.c b/deps/openssl/openssl/ssl/quic/quic_srtm.c
index 19f6d7d60ac..e17433a6aa0 100644
--- a/deps/openssl/openssl/ssl/quic/quic_srtm.c
+++ b/deps/openssl/openssl/ssl/quic/quic_srtm.c
@@ -382,16 +382,24 @@ static int srtm_remove_from_rev(QUIC_SRTM *srtm, SRTM_ITEM *item)
     return 1;
 }

-int ossl_quic_srtm_remove(QUIC_SRTM *srtm, void *opaque, uint64_t seq_num)
+int ossl_quic_srtm_remove(QUIC_SRTM *srtm, void *opaque, uint64_t seq_num,
+    uint8_t *match)
 {
     SRTM_ITEM *item, *prev = NULL;
+    uint8_t match_sink;
+
+    if (match == NULL)
+        match = &match_sink;
+    *match = 0;

     if (srtm->alloc_failed)
         return 0;

     if ((item = srtm_find(srtm, opaque, seq_num, NULL, &prev)) == NULL)
         /* No match */
-        return 0;
+        return 1;
+
+    *match = 1;

     /* Remove from forward mapping. */
     if (prev == NULL) {
diff --git a/deps/openssl/openssl/ssl/quic/quic_stream_map.c b/deps/openssl/openssl/ssl/quic/quic_stream_map.c
index 761b577d261..2d58d08a807 100644
--- a/deps/openssl/openssl/ssl/quic/quic_stream_map.c
+++ b/deps/openssl/openssl/ssl/quic/quic_stream_map.c
@@ -9,6 +9,7 @@

 #include "internal/quic_stream_map.h"
 #include "internal/nelem.h"
+#include "internal/quic_channel.h"

 /*
  * QUIC Stream Map
@@ -90,9 +91,11 @@ int ossl_quic_stream_map_init(QUIC_STREAM_MAP *qsm,
     void *get_stream_limit_cb_arg,
     QUIC_RXFC *max_streams_bidi_rxfc,
     QUIC_RXFC *max_streams_uni_rxfc,
-    int is_server)
+    QUIC_CHANNEL *ch)
 {
     qsm->map = lh_QUIC_STREAM_new(hash_stream, cmp_stream);
+    if (qsm->map == NULL)
+        return 0;
     qsm->active_list.prev = qsm->active_list.next = &qsm->active_list;
     qsm->accept_list.prev = qsm->accept_list.next = &qsm->accept_list;
     qsm->ready_for_gc_list.prev = qsm->ready_for_gc_list.next
@@ -109,7 +112,7 @@ int ossl_quic_stream_map_init(QUIC_STREAM_MAP *qsm,
     qsm->get_stream_limit_cb_arg = get_stream_limit_cb_arg;
     qsm->max_streams_bidi_rxfc = max_streams_bidi_rxfc;
     qsm->max_streams_uni_rxfc = max_streams_uni_rxfc;
-    qsm->is_server = is_server;
+    qsm->ch = ch;
     return 1;
 }

@@ -122,6 +125,8 @@ static void release_each(QUIC_STREAM *stream, void *arg)

 void ossl_quic_stream_map_cleanup(QUIC_STREAM_MAP *qsm)
 {
+    if (qsm->map == NULL)
+        return;
     lh_QUIC_STREAM_set_down_load(qsm->map, 0);
     ossl_quic_stream_map_visit(qsm, release_each, qsm);

@@ -155,7 +160,7 @@ QUIC_STREAM *ossl_quic_stream_map_alloc(QUIC_STREAM_MAP *qsm,

     s->id = stream_id;
     s->type = type;
-    s->as_server = qsm->is_server;
+    s->as_server = ossl_quic_channel_is_server(qsm->ch);
     s->send_state = (ossl_quic_stream_is_local_init(s)
                         || ossl_quic_stream_is_bidi(s))
         ? QUIC_SSTREAM_STATE_READY
@@ -331,7 +336,7 @@ void ossl_quic_stream_map_update_state(QUIC_STREAM_MAP *qsm, QUIC_STREAM *s)
 {
     int should_be_active, allowed_by_stream_limit = 1;

-    if (ossl_quic_stream_is_server_init(s) == qsm->is_server) {
+    if (ossl_quic_stream_is_server_init(s) == ossl_quic_channel_is_server(qsm->ch)) {
         int is_uni = !ossl_quic_stream_is_bidi(s);
         uint64_t stream_ordinal = s->id >> 2;

@@ -427,6 +432,14 @@ static void shutdown_flush_done(QUIC_STREAM_MAP *qsm, QUIC_STREAM *qs)
     assert(qsm->num_shutdown_flush > 0);
     qs->shutdown_flush = 0;
     --qsm->num_shutdown_flush;
+
+    /*
+     * when num_shutdown_flush becomes zero we need to poke
+     * SSL_poll() it's time to poke to SSL_shutdown() to proceed
+     * with shutdown process as all streams are gone (flushed).
+     */
+    if (qsm->num_shutdown_flush == 0)
+        ossl_quic_channel_notify_flush_done(qsm->ch);
 }

 int ossl_quic_stream_map_notify_totally_acked(QUIC_STREAM_MAP *qsm,
@@ -743,6 +756,24 @@ QUIC_STREAM *ossl_quic_stream_map_peek_accept_queue(QUIC_STREAM_MAP *qsm)
     return accept_head(&qsm->accept_list);
 }

+QUIC_STREAM *ossl_quic_stream_map_find_in_accept_queue(QUIC_STREAM_MAP *qsm,
+    int is_uni)
+{
+    QUIC_STREAM *qs;
+
+    if (ossl_quic_stream_map_get_accept_queue_len(qsm, is_uni) == 0)
+        return NULL;
+
+    qs = ossl_quic_stream_map_peek_accept_queue(qsm);
+    while (qs != NULL) {
+        if ((is_uni && !ossl_quic_stream_is_bidi(qs))
+            || (!is_uni && ossl_quic_stream_is_bidi(qs)))
+            break;
+        qs = accept_next(&qsm->accept_list, qs);
+    }
+    return qs;
+}
+
 void ossl_quic_stream_map_push_accept_queue(QUIC_STREAM_MAP *qsm,
     QUIC_STREAM *s)
 {
diff --git a/deps/openssl/openssl/ssl/quic/quic_strm_reas.c b/deps/openssl/openssl/ssl/quic/quic_strm_reas.c
index e54fefe433f..8c404df231c 100644
--- a/deps/openssl/openssl/ssl/quic/quic_strm_reas.c
+++ b/deps/openssl/openssl/ssl/quic/quic_strm_reas.c
@@ -14,13 +14,12 @@
 #include "internal/list.h"
 #include "internal/quic_channel.h"

-#define STDERR NULL
-/* ARGSUSED */
-static void print_foo(void *f, ...)
-{
-}
-
-#define DEBUG_PRINT print_foo
+#if !defined(NDEBUG) && defined(WITH_STRM_REAS_DEBUG)
+#include <stdio.h>
+#define DEBUG_PRINT(...) fprintf(__VA_ARGS__)
+#else
+#define DEBUG_PRINT(...) (void)(0)
+#endif

 #define DIRECT_STORAGE_SZ (2 * sizeof(void *))

@@ -250,19 +249,19 @@ static struct stream_chunk_t *new_schunk(SFRAME_SET *fs, OSSL_QRX_PKT *pkt,
         rsqp_add_overhead(fs->rsqp, overhead);
         sc->sc_data = data;
         sc->sc_range = *r;
-        DEBUG_PRINT(STDERR,
+        DEBUG_PRINT(stderr,
             "%s sc: %p sc overhead: %llu pkt_buf_overhead_sz: %llu -> %zu\n",
             OPENSSL_FUNC, (void *)sc, SCHUNK_OVERHEAD(pkt, sc),
             fs->rsqp->rsqp_pkt_overhead_sz - SCHUNK_OVERHEAD(pkt, sc),
             fs->rsqp->rsqp_pkt_overhead_sz);
     } else {
         if (rsize <= DIRECT_STORAGE_SZ) {
-            DEBUG_PRINT(STDERR, "%s ST_TYPE_DIRECT sc: %p %llu\n", OPENSSL_FUNC,
+            DEBUG_PRINT(stderr, "%s ST_TYPE_DIRECT sc: %p %llu\n", OPENSSL_FUNC,
                 (void *)sc, rsize);
             sc->sc_st = ST_TYPE_DIRECT;
             sc->sc_data_w = sc->sc_dstorage;
         } else {
-            DEBUG_PRINT(STDERR, "%s ST_TYPE_HEAP sc: %p %llu\n", OPENSSL_FUNC,
+            DEBUG_PRINT(stderr, "%s ST_TYPE_HEAP sc: %p %llu\n", OPENSSL_FUNC,
                 (void *)sc, rsize);
             sc->sc_st = ST_TYPE_HEAP;
             sc->sc_buf = OPENSSL_malloc(UINT64_TO_SIZE_T(rsize));
@@ -296,7 +295,7 @@ static void destroy_schunk(SFRAME_SET *fs, struct stream_chunk_t *sc)
     switch (sc->sc_st) {
     case ST_TYPE_PKT:
         assert(fs->rsqp->rsqp_pkt_overhead_sz >= SCHUNK_OVERHEAD(sc->sc_pkt, sc));
-        DEBUG_PRINT(STDERR,
+        DEBUG_PRINT(stderr,
             "%s sc: %p sc overhead: %llu pkt_buf_overhead_sz: %zu -> %llu\n",
             OPENSSL_FUNC, (void *)sc, SCHUNK_OVERHEAD(sc->sc_pkt, sc),
             fs->rsqp->rsqp_pkt_overhead_sz,
@@ -418,14 +417,14 @@ static int try_dstorage(SFRAME_SET *fs, OSSL_QRX_PKT *pkt,
         if (head_sc->sc_st != ST_TYPE_DIRECT)
             return 0;

-        DEBUG_PRINT(STDERR, "%s @in %p [ %llu, %llu ]\n",
+        DEBUG_PRINT(stderr, "%s @in %p [ %llu, %llu ]\n",
             OPENSSL_FUNC, *data, r->start, r->end);
         rsize = r->end - r->start;
         if (rsize <= DIRECT_STORAGE_SZ) {
             /*
              * update existing chunk
              */
-            DEBUG_PRINT(STDERR,
+            DEBUG_PRINT(stderr,
                 "%s overwrite dstorage %p [ %llu, %llu ] -> [ %llu, %llu ] "
                 "sr: %p [ %llu, %llu ]\n",
                 OPENSSL_FUNC, (void *)head_sc,
@@ -446,12 +445,12 @@ static int try_dstorage(SFRAME_SET *fs, OSSL_QRX_PKT *pkt,
              */
             new_sc = new_schunk(fs, pkt, r, *data);
             if (new_sc == NULL) {
-                DEBUG_PRINT(STDERR, "%s new_chunk() alloc failed\n",
+                DEBUG_PRINT(stderr, "%s new_chunk() alloc failed\n",
                     OPENSSL_FUNC);
                 return -1;
             }

-            DEBUG_PRINT(STDERR,
+            DEBUG_PRINT(stderr,
                 "%s replace chunk %p [ %llu, %llu ] -> %p [ %llu, %llu ]\n",
                 OPENSSL_FUNC,
                 (void *)head_sc, head_sc->sc_range.start, head_sc->sc_range.end,
@@ -460,7 +459,7 @@ static int try_dstorage(SFRAME_SET *fs, OSSL_QRX_PKT *pkt,
             ossl_list_sc_insert_head(&sr->sr_chunks, new_sc);
             destroy_schunk(fs, head_sc);
         }
-        DEBUG_PRINT(STDERR, "\trange: %p [ %llu, %llu ] -> [ %llu, %llu ]\n",
+        DEBUG_PRINT(stderr, "\trange: %p [ %llu, %llu ] -> [ %llu, %llu ]\n",
             (void *)sr, sr->sr_range.start, sr->sr_range.end, r->start, r->end);
         sr->sr_range.start = r->start;
         sr->sr_range.end = r->end;
@@ -480,7 +479,7 @@ static int try_dstorage(SFRAME_SET *fs, OSSL_QRX_PKT *pkt,
         if (dsize == 0)
             return 0;

-        DEBUG_PRINT(STDERR, "%s append: @in %p [ %llu, %llu ] dsize: %llu "
+        DEBUG_PRINT(stderr, "%s append: @in %p [ %llu, %llu ] dsize: %llu "
                             "tail_sc: %p [ %llu, %llu] sr: %p [ %llu, %llu ]\n",
             OPENSSL_FUNC, *data, r->start, r->end, dsize,
             (void *)tail_sc, tail_sc->sc_range.start, tail_sc->sc_range.end,
@@ -506,17 +505,17 @@ static int try_dstorage(SFRAME_SET *fs, OSSL_QRX_PKT *pkt,
         rsize = (rsize < dsize) ? rsize : dsize;
         offset = SCHUNK_SIZE(tail_sc);
         memcpy(&tail_sc->sc_data_w[offset], *data, UINT64_TO_SIZE_T(rsize));
-        DEBUG_PRINT(STDERR, "%s append tail_sc: %p [ %llu, %llu ] -> ",
+        DEBUG_PRINT(stderr, "%s append tail_sc: %p [ %llu, %llu ] -> ",
             OPENSSL_FUNC, (void *)tail_sc,
             tail_sc->sc_range.start, tail_sc->sc_range.end);
         tail_sc->sc_range.end += rsize;
-        DEBUG_PRINT(STDERR, "[ %llu, %llu ]\n",
+        DEBUG_PRINT(stderr, "[ %llu, %llu ]\n",
             tail_sc->sc_range.start, tail_sc->sc_range.end);
         assert(SCHUNK_SIZE(tail_sc) <= DIRECT_STORAGE_SZ);
-        DEBUG_PRINT(STDERR, "\trange: %p [ %llu, %llu ] -> ",
+        DEBUG_PRINT(stderr, "\trange: %p [ %llu, %llu ] -> ",
             (void *)sr, sr->sr_range.start, sr->sr_range.end);
         sr->sr_range.end = tail_sc->sc_range.end;
-        DEBUG_PRINT(STDERR, "[ %llu, %llu ]\n",
+        DEBUG_PRINT(stderr, "[ %llu, %llu ]\n",
             sr->sr_range.start, sr->sr_range.end);

         if (fs->cleanse)
@@ -536,7 +535,7 @@ static int try_dstorage(SFRAME_SET *fs, OSSL_QRX_PKT *pkt,
         if (dsize == 0)
             return 0;

-        DEBUG_PRINT(STDERR, "%s prepend: @in %p [ %llu, %llu ] dsize: %llu "
+        DEBUG_PRINT(stderr, "%s prepend: @in %p [ %llu, %llu ] dsize: %llu "
                             "sr: %p [ %llu, %llu ]\n",
             OPENSSL_FUNC, *data, r->start, r->end, dsize,
             (void *)sr, sr->sr_range.start, sr->sr_range.end);
@@ -562,17 +561,17 @@ static int try_dstorage(SFRAME_SET *fs, OSSL_QRX_PKT *pkt,
         assert(offset < r->end - r->start);
         data_buf = *data;
         memcpy(head_sc->sc_data_w, &data_buf[offset], UINT64_TO_SIZE_T(rsize));
-        DEBUG_PRINT(STDERR, "%s prepend head_sc: %p [ %llu, %llu ] -> ",
+        DEBUG_PRINT(stderr, "%s prepend head_sc: %p [ %llu, %llu ] -> ",
             OPENSSL_FUNC, (void *)head_sc,
             head_sc->sc_range.start, head_sc->sc_range.end);
         head_sc->sc_range.start -= rsize;
-        DEBUG_PRINT(STDERR, "[ %llu, %llu ]\n",
+        DEBUG_PRINT(stderr, "[ %llu, %llu ]\n",
             head_sc->sc_range.start, head_sc->sc_range.end);
         assert(SCHUNK_SIZE(head_sc) <= DIRECT_STORAGE_SZ);
-        DEBUG_PRINT(STDERR, "\trange: %p [ %llu, %llu ] -> ",
+        DEBUG_PRINT(stderr, "\trange: %p [ %llu, %llu ] -> ",
             (void *)sr, sr->sr_range.start, sr->sr_range.end);
         sr->sr_range.start = head_sc->sc_range.start;
-        DEBUG_PRINT(STDERR, "[ %llu, %llu ]\n",
+        DEBUG_PRINT(stderr, "[ %llu, %llu ]\n",
             sr->sr_range.start, sr->sr_range.end);
         assert(r->end - r->start >= rsize);

@@ -590,7 +589,7 @@ static int try_dstorage(SFRAME_SET *fs, OSSL_QRX_PKT *pkt,
      * returns 1 if all data were consumed
      */
     assert(r->end >= r->start);
-    DEBUG_PRINT(STDERR, "%s @out %p [ %llu, %llu ]\n",
+    DEBUG_PRINT(stderr, "%s @out %p [ %llu, %llu ]\n",
         OPENSSL_FUNC, *data, r->start, r->end);

     return ((r->end - r->start) == 0) ? 1 : 0;
@@ -619,7 +618,7 @@ static const unsigned char *trim_partial_overlap(SFRAME_SET *fs,
             if (fs->cleanse)
                 OPENSSL_cleanse(deconst(data), UINT64_TO_SIZE_T(unused_sz));

-            DEBUG_PRINT(STDERR, "%s right overlap %p [ %llu, %llu ]:\n\t"
+            DEBUG_PRINT(stderr, "%s right overlap %p [ %llu, %llu ]:\n\t"
                                 "r: [ %llu, %llu ] -> [ %llu, %llu ]\n",
                 OPENSSL_FUNC,
                 (void *)sr, sr->sr_range.start, sr->sr_range.end,
@@ -636,7 +635,7 @@ static const unsigned char *trim_partial_overlap(SFRAME_SET *fs,
                                     + (sr->sr_range.start - r->start)),
                     UINT64_TO_SIZE_T(unused_sz));

-            DEBUG_PRINT(STDERR, "%s left overlap %p [ %llu, %llu]:\n\t"
+            DEBUG_PRINT(stderr, "%s left overlap %p [ %llu, %llu]:\n\t"
                                 "r: [ %llu, %llu ] -> [ %llu, %llu ]\n",
                 OPENSSL_FUNC,
                 (void *)sr, sr->sr_range.start, sr->sr_range.end,
@@ -655,7 +654,7 @@ static const unsigned char *trim_partial_overlap(SFRAME_SET *fs,
 static void prepend_chunk(SFRAME_SET *fs, struct stream_range_t *sr,
     struct stream_chunk_t *sc)
 {
-    DEBUG_PRINT(STDERR, "%s %p [ %llu, %llu ] add to head %p [ %llu, %llu ] "
+    DEBUG_PRINT(stderr, "%s %p [ %llu, %llu ] add to head %p [ %llu, %llu ] "
                         "-> [ %llu, %llu ]\n",
         OPENSSL_FUNC,
         (void *)sc, sc->sc_range.start, sc->sc_range.end,
@@ -682,7 +681,7 @@ static void prepend_chunk(SFRAME_SET *fs, struct stream_range_t *sr,
 static void append_chunk(SFRAME_SET *fs, struct stream_range_t *sr,
     struct stream_chunk_t *sc)
 {
-    DEBUG_PRINT(STDERR, "%s %p [ %llu, %llu ] add to tail %p [ %llu, %llu ] "
+    DEBUG_PRINT(stderr, "%s %p [ %llu, %llu ] add to tail %p [ %llu, %llu ] "
                         "-> [ %llu, %llu ]\n",
         OPENSSL_FUNC,
         (void *)sc, sc->sc_range.start, sc->sc_range.end,
@@ -716,7 +715,7 @@ static void replace_chunks_in_range(SFRAME_SET *fs, struct stream_range_t *sr,

     ossl_list_sc_insert_head(&sr->sr_chunks, sc);
     fs->stream_chunks++;
-    DEBUG_PRINT(STDERR, "%s range: %p [ %llu, %llu ] -> [ %llu, %llu ]\n",
+    DEBUG_PRINT(stderr, "%s range: %p [ %llu, %llu ] -> [ %llu, %llu ]\n",
         OPENSSL_FUNC, (void *)sr, sr->sr_range.start, sr->sr_range.end,
         sc->sc_range.start, sc->sc_range.end);
     sr->sr_range.start = sc->sc_range.start;
@@ -776,7 +775,7 @@ static int chop_range(SFRAME_SET *fs, struct stream_range_t *sr,

     if (sc->sc_st == ST_TYPE_PKT) {
         rsqp_add_overhead(fs->rsqp, unused_sz);
-        DEBUG_PRINT(STDERR, "%s sc: %p unused_sz: %zu %zu -> %zu\n",
+        DEBUG_PRINT(stderr, "%s sc: %p unused_sz: %zu %zu -> %zu\n",
             OPENSSL_FUNC, (void *)sc, unused_sz,
             fs->rsqp->rsqp_pkt_overhead_sz - unused_sz,
             fs->rsqp->rsqp_pkt_overhead_sz);
@@ -805,7 +804,7 @@ static struct stream_range_t *merge_ranges(SFRAME_SET *fs,
     assert(super_sr->sr_range.start <= sub_sr->sr_range.start
         && super_sr->sr_range.end >= sub_sr->sr_range.end);

-    DEBUG_PRINT(STDERR, "%s super: %p [ %llu, %llu ], sub: %p [ %llu, %llu]\n",
+    DEBUG_PRINT(stderr, "%s super: %p [ %llu, %llu ], sub: %p [ %llu, %llu]\n",
         OPENSSL_FUNC, (void *)super_sr, super_sr->sr_range.start,
         super_sr->sr_range.end, (void *)sub_sr, sub_sr->sr_range.start,
         sub_sr->sr_range.end);
@@ -835,7 +834,7 @@ static struct stream_range_t *append_range(SFRAME_SET *fs,
      */
     assert(left_sr->sr_range.end >= right_sr->sr_range.start);

-    DEBUG_PRINT(STDERR, "%s %p [ %llu, %llu ] + %p [ %llu, %llu ] = %p "
+    DEBUG_PRINT(stderr, "%s %p [ %llu, %llu ] + %p [ %llu, %llu ] = %p "
                         "[ %llu, %llu ]\n",
         OPENSSL_FUNC, (void *)left_sr, left_sr->sr_range.start,
         left_sr->sr_range.end, (void *)right_sr, right_sr->sr_range.start,
@@ -917,7 +916,7 @@ int ossl_sframe_set_insert(SFRAME_SET *fs, UINT_RANGE *r, OSSL_QRX_PKT *pkt,
         /*
          * retransmitted range got consumed already.
          */
-        DEBUG_PRINT(STDERR, "%s [ %llu, %llu ] <= %llu\n", OPENSSL_FUNC,
+        DEBUG_PRINT(stderr, "%s [ %llu, %llu ] <= %llu\n", OPENSSL_FUNC,
             r->start, r->end, fs->offset);
         if (fs->cleanse && data != NULL)
             OPENSSL_cleanse(deconst(data), UINT64_TO_SIZE_T(r->end - r->start));
@@ -926,12 +925,10 @@ int ossl_sframe_set_insert(SFRAME_SET *fs, UINT_RANGE *r, OSSL_QRX_PKT *pkt,

     if (r->start < fs->offset) {
         /*
-         * Make sure retransmitted chunk does not reintroduce
-         * bytes which were consumed already.
          * Make sure retransmitted chunk does not reintroduce
          * bytes which were consumed already.
          */
-        DEBUG_PRINT(STDERR, "%s [ %llu, %llu ] -> [ %llu, %llu ]\n", OPENSSL_FUNC,
+        DEBUG_PRINT(stderr, "%s [ %llu, %llu ] -> [ %llu, %llu ]\n", OPENSSL_FUNC,
             r->start, r->end, fs->offset, r->end);
         if (fs->cleanse)
             OPENSSL_cleanse(deconst(data),
@@ -959,7 +956,7 @@ int ossl_sframe_set_insert(SFRAME_SET *fs, UINT_RANGE *r, OSSL_QRX_PKT *pkt,
         sr = create_range(fs, sc);
         if (sr == NULL)
             goto err;
-        DEBUG_PRINT(STDERR, "%s chunk: %p [ %llu, %llu ] new range: %p\n",
+        DEBUG_PRINT(stderr, "%s chunk: %p [ %llu, %llu ] new range: %p\n",
             OPENSSL_FUNC, (void *)sc, sc->sc_range.start, sc->sc_range.end,
             (void *)sr);
         sc = NULL;
@@ -970,7 +967,7 @@ int ossl_sframe_set_insert(SFRAME_SET *fs, UINT_RANGE *r, OSSL_QRX_PKT *pkt,
          * retransmission, the whole chunk is found in existing range already
          */
         if (r->start >= sr->sr_range.start && r->end <= sr->sr_range.end) {
-            DEBUG_PRINT(STDERR,
+            DEBUG_PRINT(stderr,
                 "%s [ %llu, %llu ] found in %p [ %llu, %llu ]\n", OPENSSL_FUNC,
                 r->start, r->end, (void *)sr, sr->sr_range.start,
                 sr->sr_range.end);
@@ -1007,7 +1004,7 @@ int ossl_sframe_set_insert(SFRAME_SET *fs, UINT_RANGE *r, OSSL_QRX_PKT *pkt,
             sr = NULL;
             goto err;
         }
-        DEBUG_PRINT(STDERR, "%s %p [ %llu, %llu ] -> %p [ %llu, %llu ]\n",
+        DEBUG_PRINT(stderr, "%s %p [ %llu, %llu ] -> %p [ %llu, %llu ]\n",
             OPENSSL_FUNC, (void *)sc, sc->sc_range.start, sc->sc_range.end,
             (void *)sr, sr->sr_range.start, sr->sr_range.end);

@@ -1059,7 +1056,7 @@ int ossl_sframe_set_insert(SFRAME_SET *fs, UINT_RANGE *r, OSSL_QRX_PKT *pkt,

         while (adjacent_sr != NULL) {
             OSSL_RBT_REMOVE(srange, &fs->ranges, adjacent_sr);
-            DEBUG_PRINT(STDERR, "%s %p [ %llu, %llu ] >< %p [ %llu, %llu ]\n",
+            DEBUG_PRINT(stderr, "%s %p [ %llu, %llu ] >< %p [ %llu, %llu ]\n",
                 OPENSSL_FUNC, (void *)sr, sr->sr_range.start, sr->sr_range.end,
                 (void *)adjacent_sr, adjacent_sr->sr_range.start,
                 adjacent_sr->sr_range.end);
@@ -1152,7 +1149,7 @@ int ossl_sframe_set_peek(SFRAME_SET *fs, void **iterator,
          * no chunks are ready to be consumed, if there is a gap.
          */
         if (sc != NULL && sc->sc_range.start > start) {
-            DEBUG_PRINT(STDERR, "%s sc: %p sr: %p sc->start %llu, fs->offset: %llu\n",
+            DEBUG_PRINT(stderr, "%s sc: %p sr: %p sc->start %llu, fs->offset: %llu\n",
                 OPENSSL_FUNC, (void *)sc, (void *)sr, sc->sc_range.start, start);
             sc = NULL;
         }
@@ -1174,7 +1171,7 @@ int ossl_sframe_set_peek(SFRAME_SET *fs, void **iterator,
         assert(sc == NULL || sc->sc_range.start < sc->sc_range.end);
     } else {
         /* iterator got invalidated by move/flatten operation on range */
-        DEBUG_PRINT(STDERR, "%s iterator got invalidated\n", OPENSSL_FUNC);
+        DEBUG_PRINT(stderr, "%s iterator got invalidated\n", OPENSSL_FUNC);
         return 0;
     }

@@ -1195,7 +1192,7 @@ int ossl_sframe_set_peek(SFRAME_SET *fs, void **iterator,
         else
             *fin = 0;

-        DEBUG_PRINT(STDERR, "%s no more chunks\n", OPENSSL_FUNC);
+        DEBUG_PRINT(stderr, "%s no more chunks\n", OPENSSL_FUNC);

         return 0;
     }
@@ -1208,7 +1205,7 @@ int ossl_sframe_set_peek(SFRAME_SET *fs, void **iterator,
     *fin = fs->fin && sc->sc_range.end == fs->fin_off;

     if (sr->sr_it_sc != NULL)
-        DEBUG_PRINT(STDERR, "%s %p [ %llu, %llu ] %p [ %llu, %llu ]\n",
+        DEBUG_PRINT(stderr, "%s %p [ %llu, %llu ] %p [ %llu, %llu ]\n",
             OPENSSL_FUNC, (void *)sr->sr_it_sc,
             sr->sr_it_sc->sc_range.start, sr->sr_it_sc->sc_range.end,
             (void *)sc, sc->sc_range.start, sc->sc_range.end);
@@ -1220,7 +1217,7 @@ int ossl_sframe_set_peek(SFRAME_SET *fs, void **iterator,
      * peek operation indicates error if there are no data to read
      * in range.
      */
-    DEBUG_PRINT(STDERR,
+    DEBUG_PRINT(stderr,
         "%s peek range: [ %llu, %llu ] range: %p [ %llu, %llu ]\n", OPENSSL_FUNC,
         range->start, range->end, (void *)sr, sr->sr_range.start,
         sr->sr_range.end);
@@ -1275,7 +1272,7 @@ int ossl_sframe_set_move_offset(SFRAME_SET *fs, uint64_t new_offset)
         }
     }

-    DEBUG_PRINT(STDERR, "%s offset: %llu -> %llu range: %p [ %llu, %llu ] -> ",
+    DEBUG_PRINT(stderr, "%s offset: %llu -> %llu range: %p [ %llu, %llu ] -> ",
         OPENSSL_FUNC, fs->offset - new_offset, new_offset,
         (void *)sr, sr->sr_range.start, sr->sr_range.end);

@@ -1287,18 +1284,18 @@ int ossl_sframe_set_move_offset(SFRAME_SET *fs, uint64_t new_offset)
         OSSL_RBT_REMOVE(srange, &fs->ranges, sr);
         destroy_srange(fs, sr);
         fs->stream_ranges--;
-        DEBUG_PRINT(STDERR, "[ NULL ]\n");
+        DEBUG_PRINT(stderr, "[ NULL ]\n");
     } else {
         unused_sz = UINT64_TO_SIZE_T(new_offset - sc->sc_range.start);
         sc_data_trim_left(sc, unused_sz, fs->cleanse);
         sc->sc_range.start = new_offset;
         sr->sr_range.start = new_offset;
-        DEBUG_PRINT(STDERR, "[ %lli, %llu ]\n",
+        DEBUG_PRINT(stderr, "[ %lli, %llu ]\n",
             sr->sr_range.start, sr->sr_range.end);

         if (sc->sc_st == ST_TYPE_PKT) {
             rsqp_add_overhead(fs->rsqp, unused_sz);
-            DEBUG_PRINT(STDERR, "%s sc: %p unused_sz: %zu %zu -> %zu\n",
+            DEBUG_PRINT(stderr, "%s sc: %p unused_sz: %zu %zu -> %zu\n",
                 OPENSSL_FUNC, (void *)sc, unused_sz,
                 fs->rsqp->rsqp_pkt_overhead_sz - unused_sz,
                 fs->rsqp->rsqp_pkt_overhead_sz);
diff --git a/deps/openssl/openssl/ssl/quic/quic_tls.c b/deps/openssl/openssl/ssl/quic/quic_tls.c
index 587685d0b23..4d57ecbf810 100644
--- a/deps/openssl/openssl/ssl/quic/quic_tls.c
+++ b/deps/openssl/openssl/ssl/quic/quic_tls.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -97,15 +97,18 @@ static int quic_free(OSSL_RECORD_LAYER *r);

 static int
 quic_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers,
-    int role, int direction, int level, uint16_t epoch,
+    int role, int direction, int level, uint64_t epoch,
     unsigned char *secret, size_t secretlen,
-    unsigned char *key, size_t keylen, unsigned char *iv,
-    size_t ivlen, unsigned char *mackey, size_t mackeylen,
+    unsigned char *snkey, unsigned char *key, size_t keylen,
+    unsigned char *iv, size_t ivlen,
+    unsigned char *mackey, size_t mackeylen,
+    const EVP_CIPHER *snciph,
     const EVP_CIPHER *ciph, size_t taglen,
     int mactype,
     const EVP_MD *md, COMP_METHOD *comp,
     const EVP_MD *kdfdigest, BIO *prev, BIO *transport,
-    BIO *next, BIO_ADDR *local, BIO_ADDR *peer,
+    BIO *next,
+    int use_urxe,
     const OSSL_PARAM *settings, const OSSL_PARAM *options,
     const OSSL_DISPATCH *fns, void *cbarg, void *rlarg,
     OSSL_RECORD_LAYER **retrl)
@@ -363,8 +366,8 @@ static int quic_retry_write_records(OSSL_RECORD_LAYER *rl)

 static int quic_read_record(OSSL_RECORD_LAYER *rl, void **rechandle,
     int *rversion, uint8_t *type, const unsigned char **data,
-    size_t *datalen, uint16_t *epoch,
-    unsigned char *seq_num)
+    size_t *datalen, uint64_t *epoch,
+    uint64_t *seq_num)
 {
     if (rl->recread != 0 || rl->recunreleased != 0)
         return OSSL_RECORD_RETURN_FATAL;
@@ -581,6 +584,8 @@ static const OSSL_RECORD_METHOD quic_tls_record_method = {
     quic_release_record,
     quic_get_alert_code,
     quic_set1_bio,
+    NULL, /* set1_peer: Not used for QUIC */
+    NULL, /* set_use_urxe: Not used for QUIC */
     quic_set_protocol_version,
     quic_set_plain_alerts,
     quic_set_first_handshake,
@@ -592,6 +597,11 @@ static const OSSL_RECORD_METHOD quic_tls_record_method = {
     quic_set_max_frag_len,
     quic_get_max_record_overhead, /* Never called */
     quic_increment_sequence_ctr, /* Never called */
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
     quic_alloc_buffers,
     quic_free_buffers
 };
@@ -654,6 +664,16 @@ QUIC_TLS *ossl_quic_tls_new(const QUIC_TLS_ARGS *args)
     return qtls;
 }

+int ossl_quic_tls_set0_ssl(QUIC_TLS *qtls, SSL *ssl)
+{
+    if (!ossl_assert(qtls != NULL && ssl != NULL
+            && qtls->args.s == NULL && !qtls->configured))
+        return 0;
+
+    qtls->args.s = ssl;
+    return 1;
+}
+
 void ossl_quic_tls_free(QUIC_TLS *qtls)
 {
     if (qtls == NULL)
@@ -757,6 +777,10 @@ int ossl_quic_tls_tick(QUIC_TLS *qtls)
     if (qtls->inerror)
         return 0;

+    /* SSL_listen_ex() attaches the SSL after the channel is queued. */
+    if (qtls->args.s == NULL)
+        return 1;
+
     /*
      * SSL_get_error does not truly know what the cause of an SSL_read failure
      * is and to some extent guesses based on contextual information. In
diff --git a/deps/openssl/openssl/ssl/quic/quic_tserver.c b/deps/openssl/openssl/ssl/quic/quic_tserver.c
index f3cf1cbd6ac..006bf5fdeb3 100644
--- a/deps/openssl/openssl/ssl/quic/quic_tserver.c
+++ b/deps/openssl/openssl/ssl/quic/quic_tserver.c
@@ -66,7 +66,8 @@ static int alpn_select_cb(SSL *ssl, const unsigned char **out,
         alpnlen = srv->args.alpnlen;
     }

-    if (SSL_select_next_proto((unsigned char **)out, outlen, alpn, alpnlen,
+    if (SSL_select_next_proto((unsigned char **)out, outlen, alpn,
+            (unsigned int)alpnlen,
             in, inlen)
         != OPENSSL_NPN_NEGOTIATED)
         return SSL_TLSEXT_ERR_ALERT_FATAL;
diff --git a/deps/openssl/openssl/ssl/quic/quic_txp.c b/deps/openssl/openssl/ssl/quic/quic_txp.c
index 24314f6b34b..9058c92a4fe 100644
--- a/deps/openssl/openssl/ssl/quic/quic_txp.c
+++ b/deps/openssl/openssl/ssl/quic/quic_txp.c
@@ -708,6 +708,18 @@ int ossl_quic_tx_packetiser_set_peer(OSSL_QUIC_TX_PACKETISER *txp,
     return BIO_ADDR_copy(&txp->args.peer, peer);
 }

+int ossl_quic_tx_packetiser_set_ack_delay_exponent(OSSL_QUIC_TX_PACKETISER *txp,
+    uint32_t exp)
+{
+    if (exp > QUIC_MAX_ACK_DELAY_EXP) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
+        return 0;
+    }
+
+    txp->args.ack_delay_exponent = exp;
+    return 1;
+}
+
 void ossl_quic_tx_packetiser_set_ack_tx_cb(OSSL_QUIC_TX_PACKETISER *txp,
     void (*cb)(const OSSL_QUIC_FRAME_ACK *ack,
         uint32_t pn_space,
@@ -1317,7 +1329,7 @@ static int txp_determine_geometry(OSSL_QUIC_TX_PACKETISER *txp,
     /* Assemble packet header. */
     phdr->type = ossl_quic_enc_level_to_pkt_type(enc_level);
     phdr->spin_bit = 0;
-    phdr->pn_len = txp_determine_pn_len(txp);
+    phdr->pn_len = (unsigned int)txp_determine_pn_len(txp);
     phdr->partial = 0;
     phdr->fixed = 1;
     phdr->reserved = 0;
@@ -1465,7 +1477,7 @@ static int txp_should_try_staging(OSSL_QUIC_TX_PACKETISER *txp,
      * This is not a major concern for clients, since if a client has a 1-RTT EL
      * provisioned the server is guaranteed to also have a 1-RTT EL provisioned.
      *
-     * TODO(QUIC FUTURE): Revisit this when when have reached a decision on how
+     * TODO(QUIC FUTURE): Revisit this when we have reached a decision on how
      * best to implement this
      */
     if (*conn_close_enc_level > enc_level
@@ -3170,7 +3182,7 @@ static int txp_el_ensure_iovec(struct txp_el *el, size_t num)

     num = el->alloc_iovec != 0 ? el->alloc_iovec * 2 : 8;

-    iovec = OPENSSL_realloc(el->iovec, sizeof(OSSL_QTX_IOVEC) * num);
+    iovec = OPENSSL_realloc_array(el->iovec, num, sizeof(OSSL_QTX_IOVEC));
     if (iovec == NULL)
         return 0;

diff --git a/deps/openssl/openssl/ssl/quic/quic_types.c b/deps/openssl/openssl/ssl/quic/quic_types.c
index 2c06e191e92..8d76f15f2c8 100644
--- a/deps/openssl/openssl/ssl/quic/quic_types.c
+++ b/deps/openssl/openssl/ssl/quic/quic_types.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,7 +19,7 @@ int ossl_quic_gen_rand_conn_id(OSSL_LIB_CTX *libctx, size_t len,

     cid->id_len = (unsigned char)len;

-    if (RAND_bytes_ex(libctx, cid->id, len, len * 8) != 1) {
+    if (RAND_bytes_ex(libctx, cid->id, len, 0) != 1) {
         ERR_raise(ERR_LIB_SSL, ERR_R_RAND_LIB);
         cid->id_len = 0;
         return 0;
diff --git a/deps/openssl/openssl/ssl/quic/quic_wire.c b/deps/openssl/openssl/ssl/quic/quic_wire.c
index 66be80e7812..b9a15765194 100644
--- a/deps/openssl/openssl/ssl/quic/quic_wire.c
+++ b/deps/openssl/openssl/ssl/quic/quic_wire.c
@@ -939,12 +939,14 @@ int ossl_quic_wire_decode_transport_param_int(PACKET *pkt,
     uint64_t *value)
 {
     PACKET sub;
+    const unsigned char *body;
+    size_t len = 0;

-    sub.curr = ossl_quic_wire_decode_transport_param_bytes(pkt,
-        id, &sub.remaining);
-    if (sub.curr == NULL)
+    body = ossl_quic_wire_decode_transport_param_bytes(pkt, id, &len);
+    if (body == NULL)
+        return 0;
+    if (!PACKET_buf_init(&sub, body, len))
         return 0;
-
     if (!PACKET_get_quic_vlint(&sub, value))
         return 0;

diff --git a/deps/openssl/openssl/ssl/quic/quic_wire_pkt.c b/deps/openssl/openssl/ssl/quic/quic_wire_pkt.c
index d0efc2d0680..3244d3b1a1d 100644
--- a/deps/openssl/openssl/ssl/quic/quic_wire_pkt.c
+++ b/deps/openssl/openssl/ssl/quic/quic_wire_pkt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -615,7 +615,7 @@ int ossl_quic_wire_encode_pkt_hdr(WPACKET *pkt,
     return 1;
 }

-int ossl_quic_wire_get_encoded_pkt_hdr_len(size_t short_conn_id_len,
+size_t ossl_quic_wire_get_encoded_pkt_hdr_len(size_t short_conn_id_len,
     const QUIC_PKT_HDR *hdr)
 {
     size_t len = 0, enclen;
@@ -870,7 +870,7 @@ int ossl_quic_calculate_retry_integrity_tag(OSSL_LIB_CTX *libctx,
     EVP_CIPHER_CTX *cctx = NULL;
     int ok = 0, l = 0, l2 = 0, wpkt_valid = 0;
     WPACKET wpkt;
-    /* Worst case length of the Retry Psuedo-Packet header is 68 bytes. */
+    /* Worst case length of the Retry Pseudo-Packet header is 68 bytes. */
     unsigned char buf[128];
     QUIC_PKT_HDR hdr2;
     size_t hdr_enc_len = 0;
@@ -892,7 +892,7 @@ int ossl_quic_calculate_retry_integrity_tag(OSSL_LIB_CTX *libctx,
     hdr2 = *hdr;
     hdr2.len = 0;

-    /* Assemble retry psuedo-packet. */
+    /* Assemble retry pseudo-packet. */
     if (!WPACKET_init_static_len(&wpkt, buf, sizeof(buf), 0)) {
         ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
         goto err;
@@ -937,14 +937,14 @@ int ossl_quic_calculate_retry_integrity_tag(OSSL_LIB_CTX *libctx,
     }

     /* Feed packet header as AAD data. */
-    if (EVP_CipherUpdate(cctx, NULL, &l, buf, hdr_enc_len) != 1) {
+    if (EVP_CipherUpdate(cctx, NULL, &l, buf, (int)hdr_enc_len) != 1) {
         ERR_raise(ERR_LIB_SSL, ERR_R_EVP_LIB);
         goto err;
     }

     /* Feed packet body as AAD data. */
     if (EVP_CipherUpdate(cctx, NULL, &l, hdr->data,
-            hdr->len - QUIC_RETRY_INTEGRITY_TAG_LEN)
+            (int)(hdr->len - QUIC_RETRY_INTEGRITY_TAG_LEN))
         != 1) {
         ERR_raise(ERR_LIB_SSL, ERR_R_EVP_LIB);
         goto err;
diff --git a/deps/openssl/openssl/ssl/record/methods/build.info b/deps/openssl/openssl/ssl/record/methods/build.info
index 8b1af5dd5d5..4893ce9212a 100644
--- a/deps/openssl/openssl/ssl/record/methods/build.info
+++ b/deps/openssl/openssl/ssl/record/methods/build.info
@@ -4,7 +4,7 @@ IF[{- !$disabled{ktls} -}]
 ENDIF

 SOURCE[../../../libssl]=\
-        tls_common.c ssl3_meth.c tls1_meth.c tls13_meth.c tlsany_meth.c \
+        tls_common.c tls1_meth.c tls13_meth.c tlsany_meth.c \
         dtls_meth.c tls_multib.c $KTLSSRC

 # For shared builds we need to include the sources needed in providers
diff --git a/deps/openssl/openssl/ssl/record/methods/dtls_meth.c b/deps/openssl/openssl/ssl/record/methods/dtls_meth.c
index c282efc5ca0..1000cc465f7 100644
--- a/deps/openssl/openssl/ssl/record/methods/dtls_meth.c
+++ b/deps/openssl/openssl/ssl/record/methods/dtls_meth.c
@@ -11,41 +11,42 @@
 #include "../../ssl_local.h"
 #include "../record_local.h"
 #include "recmethod_local.h"
+#include "internal/safe_math.h"

-/* mod 128 saturating subtract of two 64-bit values in big-endian order */
-static int satsub64be(const unsigned char *v1, const unsigned char *v2)
+OSSL_SAFE_MATH_UNSIGNED(uint64_t, uint64_t)
+
+static int dtls_increment_sequence_ctr(OSSL_RECORD_LAYER *rl);
+
+/* mod 128 saturating subtract of two 64-bit values */
+static int satsub64(uint64_t l1, uint64_t l2)
 {
-    int64_t ret;
-    uint64_t l1, l2;
-
-    n2l8(v1, l1);
-    n2l8(v2, l2);
-
-    ret = l1 - l2;
-
-    /* We do not permit wrap-around */
-    if (l1 > l2 && ret < 0)
-        return 128;
-    else if (l2 > l1 && ret > 0)
-        return -128;
-
-    if (ret > 128)
-        return 128;
-    else if (ret < -128)
-        return -128;
-    else
-        return (int)ret;
+    uint64_t max, min;
+    int sign;
+
+    if (l1 > l2) {
+        max = l1;
+        min = l2;
+        sign = 1;
+    } else {
+        max = l2;
+        min = l1;
+        sign = -1;
+    }
+
+    if (max - min > 128)
+        return sign * 128;
+
+    return sign * ((int)(max - min));
 }

 static int dtls_record_replay_check(OSSL_RECORD_LAYER *rl, DTLS_BITMAP *bitmap)
 {
     int cmp;
     unsigned int shift;
-    const unsigned char *seq = rl->sequence;

-    cmp = satsub64be(seq, bitmap->max_seq_num);
+    cmp = satsub64(rl->sequence, bitmap->max_seq_num);
     if (cmp > 0) {
-        ossl_tls_rl_record_set_seq_num(&rl->rrec[0], seq);
+        rl->rrec[0].seq_num = rl->sequence;
         return 1; /* this record in new */
     }
     shift = -cmp;
@@ -54,25 +55,23 @@ static int dtls_record_replay_check(OSSL_RECORD_LAYER *rl, DTLS_BITMAP *bitmap)
     else if (bitmap->map & ((uint64_t)1 << shift))
         return 0; /* record previously received */

-    ossl_tls_rl_record_set_seq_num(&rl->rrec[0], seq);
+    rl->rrec[0].seq_num = rl->sequence;
     return 1;
 }

-static void dtls_record_bitmap_update(OSSL_RECORD_LAYER *rl,
-    DTLS_BITMAP *bitmap)
+static void dtls_record_bitmap_update(OSSL_RECORD_LAYER *rl, DTLS_BITMAP *bitmap)
 {
     int cmp;
     unsigned int shift;
-    const unsigned char *seq = rl->sequence;

-    cmp = satsub64be(seq, bitmap->max_seq_num);
+    cmp = satsub64(rl->sequence, bitmap->max_seq_num);
     if (cmp > 0) {
         shift = cmp;
         if (shift < sizeof(bitmap->map) * 8)
             bitmap->map <<= shift, bitmap->map |= 1UL;
         else
             bitmap->map = 1UL;
-        memcpy(bitmap->max_seq_num, seq, SEQ_NUM_SIZE);
+        bitmap->max_seq_num = rl->sequence;
     } else {
         shift = -cmp;
         if (shift < sizeof(bitmap->map) * 8)
@@ -86,15 +85,24 @@ static DTLS_BITMAP *dtls_get_bitmap(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rr,
     *is_next_epoch = 0;

     /* In current epoch, accept HM, CCS, DATA, & ALERT */
-    if (rr->epoch == rl->epoch)
+    if (rr->epoch == rl->epoch) {
         return &rl->bitmap;
-
-    /*
-     * Check if the message is from the next epoch
-     */
-    else if (rr->epoch == rl->epoch + 1) {
+        /*
+         * DTLS 1.3 uses encrypted sequence numbers. Therefore we
+         * cannot check future bitmaps since the sequence number
+         * is encrypted. The dtls_record_bitmap_update is only called
+         * once the record layer with the correct epoch has
+         * processed the record.
+         * We are concerned during the DTLS 1.3 handshake if a record
+         * from a future handshake epoch is received.
+         */
+    } else if ((rl->version == DTLS1_3_VERSION || rl->version == DTLS_ANY_VERSION) && rl->epoch == 0 && rr->epoch == 2) {
+        *is_next_epoch = 1;
+        /*
+         * Check if the message is from the next epoch
+         */
+    } else if (rr->epoch == rl->epoch + 1) {
         *is_next_epoch = 1;
-        return &rl->next_bitmap;
     }

     return NULL;
@@ -105,6 +113,24 @@ static void dtls_set_in_init(OSSL_RECORD_LAYER *rl, int in_init)
     rl->in_init = in_init;
 }

+size_t dtls_get_rec_header_size(uint8_t hdr_first_byte)
+{
+    size_t size = 0;
+
+    if (DTLS13_UNI_HDR_FIX_BITS_IS_SET(hdr_first_byte)
+        && ossl_assert(!DTLS13_UNI_HDR_CID_BIT_IS_SET(hdr_first_byte))) {
+        /* DTLSv1.3 unified record header */
+        size = 1;
+        size += DTLS13_UNI_HDR_SEQ_BIT_IS_SET(hdr_first_byte) ? 2 : 1;
+        size += DTLS13_UNI_HDR_LEN_BIT_IS_SET(hdr_first_byte) ? 2 : 0;
+    } else {
+        /* DTLSv1.0, DTLSv1.2 or unencrypted DTLSv1.3 record header */
+        size = DTLS1_RT_HEADER_LENGTH;
+    }
+
+    return size;
+}
+
 static int dtls_process_record(OSSL_RECORD_LAYER *rl, DTLS_BITMAP *bitmap)
 {
     int i;
@@ -112,6 +138,7 @@ static int dtls_process_record(OSSL_RECORD_LAYER *rl, DTLS_BITMAP *bitmap)
     TLS_RL_RECORD *rr;
     int imac_size;
     size_t mac_size = 0;
+    size_t rechdrsize = dtls_get_rec_header_size(rl->packet[0]);
     unsigned char md[EVP_MAX_MD_SIZE];
     SSL_MAC_BUF macbuf = { NULL, 0 };
     int ret = 0;
@@ -119,10 +146,10 @@ static int dtls_process_record(OSSL_RECORD_LAYER *rl, DTLS_BITMAP *bitmap)
     rr = &rl->rrec[0];

     /*
-     * At this point, rl->packet_length == DTLS1_RT_HEADER_LENGTH + rr->length,
+     * At this point, rl->packet_length == rechdrsize + rr->length,
      * and we have that many bytes in rl->packet
      */
-    rr->input = &(rl->packet[DTLS1_RT_HEADER_LENGTH]);
+    rr->input = rl->packet + rechdrsize;

     /*
      * ok, we can now read from 'rl->packet' data into 'rr'. rr->input
@@ -210,7 +237,7 @@ static int dtls_process_record(OSSL_RECORD_LAYER *rl, DTLS_BITMAP *bitmap)
     OSSL_TRACE_BEGIN(TLS)
     {
         BIO_printf(trc_out, "dec %zd\n", rr->length);
-        BIO_dump_indent(trc_out, rr->data, rr->length, 4);
+        BIO_dump_indent(trc_out, rr->data, (int)rr->length, 4);
     }
     OSSL_TRACE_END(TLS);

@@ -281,7 +308,7 @@ end:
 }

 static int dtls_rlayer_buffer_record(OSSL_RECORD_LAYER *rl, struct pqueue_st *queue,
-    unsigned char *priority)
+    uint64_t priority)
 {
     DTLS_RLAYER_RECORD_DATA *rdata;
     pitem *item;
@@ -291,7 +318,7 @@ static int dtls_rlayer_buffer_record(OSSL_RECORD_LAYER *rl, struct pqueue_st *qu
         return 0;

     rdata = OPENSSL_malloc(sizeof(*rdata));
-    item = pitem_new(priority, rdata);
+    item = pitem_new_u64(priority, rdata);
     if (rdata == NULL || item == NULL) {
         OPENSSL_free(rdata);
         pitem_free(item);
@@ -326,6 +353,133 @@ static int dtls_rlayer_buffer_record(OSSL_RECORD_LAYER *rl, struct pqueue_st *qu
     return 1;
 }

+/* rfc9147 section 4.2.3 */
+int dtls_crypt_sequence_number(EVP_CIPHER_CTX *ctx, unsigned char *seq, size_t seqlen,
+    unsigned char *rec_data)
+{
+    unsigned char mask[16];
+    int outlen, inlen;
+    unsigned char *in, *iv;
+    size_t i;
+    unsigned char zeros[16] = { 0 };
+
+    inlen = (int)(sizeof(mask));
+
+    in = rec_data;
+    iv = NULL;
+    memset(mask, 0, sizeof(mask));
+
+    /*
+     * When the AEAD is based on ChaCha20, the first 4 bytes of the ciphertext
+     * are treated as the block counter and the next 12 bytes as the nonce.
+     * These are passed together as the IV (counter || nonce) to reinitialise
+     * the cipher, and a zero block is encrypted to produce the mask.
+     */
+    if (EVP_CIPHER_CTX_get_nid(ctx) == NID_chacha20) {
+        iv = rec_data;
+        in = zeros;
+        inlen = sizeof(zeros);
+    }
+
+    if (!ossl_assert(inlen >= 0)
+        || (size_t)inlen > sizeof(mask)
+        || !EVP_CIPHER_CTX_set_padding(ctx, 0)
+        || EVP_CipherInit_ex2(ctx, NULL, NULL, iv, 1, NULL) <= 0
+        || EVP_CipherUpdate(ctx, mask, &outlen, in, inlen) <= 0
+        || outlen != inlen
+        || EVP_CipherFinal_ex(ctx, mask + outlen, &outlen) <= 0
+        || outlen != 0)
+        return 0;
+
+    if (!ossl_assert(seqlen <= sizeof(mask)))
+        return 0;
+
+    for (i = 0; i < seqlen; i++)
+        seq[i] ^= mask[i];
+
+    OPENSSL_cleanse(mask, sizeof(mask));
+
+    return 1;
+}
+
+/*
+ * Reconstruct the full sequence number as recommended by rfc9147 section
+ * 4.2.2. Select the candidate closest to the replay window's right edge plus
+ * one, ignore candidates outside the uint64_t range, and break ties forward.
+ * An empty replay window is represented by max_seq_num == 0.
+ */
+uint64_t dtls13_reconstruct_seq_num(uint64_t max_seq_num, uint64_t truncated,
+    size_t seqlen)
+{
+    uint64_t mask, period, expected, candidate, alt, best, best_dist, dist;
+
+    mask = DTLS13_UNI_HDR_SEQ_MASK(seqlen);
+    period = mask + 1;
+
+    /* At the end of the range only candidates in the last block can be valid. */
+    if (max_seq_num == UINT64_MAX)
+        return (UINT64_MAX & ~mask) | truncated;
+
+    expected = max_seq_num + 1;
+
+    /* The candidate in the same period-sized block as |expected| */
+    candidate = (expected & ~mask) | truncated;
+    best = candidate;
+    best_dist = candidate > expected ? candidate - expected
+                                     : expected - candidate;
+
+    /* The candidate one period behind, if it does not underflow */
+    if (candidate >= period) {
+        alt = candidate - period;
+        dist = alt > expected ? alt - expected : expected - alt;
+        /* Strictly closer only: a tie goes to the forward candidate */
+        if (dist < best_dist) {
+            best = alt;
+            best_dist = dist;
+        }
+    }
+
+    /* The candidate one period ahead, if it does not overflow */
+    if (candidate <= UINT64_MAX - period) {
+        alt = candidate + period;
+        dist = alt > expected ? alt - expected : expected - alt;
+        /* Ties go forward */
+        if (dist <= best_dist) {
+            best = alt;
+            best_dist = dist;
+        }
+    }
+
+    return best;
+}
+
+/*
+ * Epoch 2 is always the fixed DTLS 1.3 handshake epoch: no compliant peer
+ * ever sends application data there (unlike epoch 1's early data). A record
+ * that only authenticates because of that epoch's retained keys must never
+ * be delivered as application data -- retained *application* epochs (3+,
+ * from KeyUpdate recovery) are unaffected, since they can legitimately
+ * carry reordered application traffic.
+ */
+int dtls_prev_epoch_allows_type(const OSSL_RECORD_LAYER *crypto_rl, int type)
+{
+    return !(crypto_rl->epoch == 2 && type == SSL3_RT_APPLICATION_DATA);
+}
+
+/*
+ * In DTLS 1.3 only the hellos are sent unprotected. Once they are done the
+ * read layer still stays in epoch 0 until the peer's first epoch 2 record
+ * turns up. libssl marks that point by allowing plaintext alerts, and from
+ * then on an alert is the only thing that may still arrive unprotected.
+ */
+static int dtls13_plaintext_allows_type(const OSSL_RECORD_LAYER *rl, int type)
+{
+    return rl->version != DTLS1_3_VERSION
+        || rl->epoch != 0
+        || !rl->allow_plain_alerts
+        || type == SSL3_RT_ALERT;
+}
+
 /*-
  * Call this to get a new input record.
  * It will return <= 0 if more data is needed, normally due to an error
@@ -337,13 +491,17 @@ static int dtls_rlayer_buffer_record(OSSL_RECORD_LAYER *rl, struct pqueue_st *qu
  */
 int dtls_get_more_records(OSSL_RECORD_LAYER *rl)
 {
-    int ssl_major, ssl_minor;
     int rret;
-    size_t more, n;
+    size_t more, nread = 0;
     TLS_RL_RECORD *rr;
-    unsigned char *p = NULL;
     DTLS_BITMAP *bitmap;
     unsigned int is_next_epoch;
+    unsigned char recseqnum[6];
+    size_t recseqnumlen = 0;
+    size_t rechdrlen = 0;
+    size_t recseqnumoffs = 0;
+    int buffered_record = 0;
+    OSSL_RECORD_LAYER *crypto_rl;

     rl->num_recs = 0;
     rl->curr_rec = 0;
@@ -359,12 +517,29 @@ int dtls_get_more_records(OSSL_RECORD_LAYER *rl)
     }

 again:
+    crypto_rl = rl;
+    memset(recseqnum, 0, sizeof(recseqnum));
+
     /* get something from the wire */

     /* check if we have the header */
-    if ((rl->rstate != SSL_ST_READ_BODY) || (rl->packet_length < DTLS1_RT_HEADER_LENGTH)) {
+    if (rl->rstate != SSL_ST_READ_BODY
+        || rl->packet_length < DTLS1_RT_HEADER_LENGTH) {
+        PACKET dtlsrecord;
+        unsigned int record_type, record_version, epoch, length;
+        uint64_t epoch64;
+
+        /*
+         * If we have buffered records and the original BIO READ has all been processed
+         * let's leave and allow the Record Layer to update.
+         */
+        if (rl->version == DTLS1_3_VERSION
+            && buffered_record == 1 && rl->rbuf.left == 0) {
+            return OSSL_RECORD_RETURN_RETRY;
+        }
+
         rret = rl->funcs->read_n(rl, DTLS1_RT_HEADER_LENGTH,
-            TLS_BUFFER_get_len(&rl->rbuf), 0, 1, &n);
+            TLS_BUFFER_get_len(&rl->rbuf), 0, 1, &nread);
         /* read timeout is handled by dtls1_read_bytes */
         if (rret < OSSL_RECORD_RETURN_SUCCESS) {
             /* RLAYERfatal() already called if appropriate */
@@ -379,31 +554,137 @@ again:

         rl->rstate = SSL_ST_READ_BODY;

-        p = rl->packet;
+        if (!PACKET_buf_init(&dtlsrecord, rl->packet, rl->packet_length)
+            || !PACKET_get_1(&dtlsrecord, &record_type)) {
+            rl->packet_length = 0;
+            goto again;
+        }

         /* Pull apart the header into the DTLS1_RECORD */
-        rr->type = *(p++);
-        ssl_major = *(p++);
-        ssl_minor = *(p++);
-        rr->rec_version = (ssl_major << 8) | ssl_minor;
+        rr->type = (int)record_type;
+
+        /*-
+         * rfc9147:
+         * Implementations can demultiplex DTLS 1.3 records by examining the first
+         * byte as follows:
+         *   * If the first byte is alert(21), handshake(22), or ack(proposed, 26),
+         *     the record MUST be interpreted as a DTLSPlaintext record.
+         *   * If the first byte is any other value, then receivers MUST check to
+         *     see if the leading bits of the first byte are 001. If so, the implementation
+         *     MUST process the record as DTLSCiphertext; the true content type
+         *     will be inside the protected portion.
+         *   * Otherwise, the record MUST be rejected as if it had failed deprotection,
+         *     as described in Section 4.5.2.
+         */
+        if (rl->version == DTLS1_3_VERSION
+            && rr->type != SSL3_RT_ALERT
+            && rr->type != SSL3_RT_HANDSHAKE
+            && rr->type != SSL3_RT_ACK
+            && !DTLS13_UNI_HDR_FIX_BITS_IS_SET(rr->type)) {
+            /* Silently discard */
+            rr->length = 0;
+            rl->packet_length = 0;
+            goto again;
+        }

-        /* sequence number is 64 bits, with top 2 bytes = epoch */
-        n2s(p, rr->epoch);
+        if (DTLS13_UNI_HDR_FIX_BITS_IS_SET(rr->type)) {
+            /*
+             * rfc9147:
+             * receivers MUST check to if the leading bits of the first byte are 001.
+             * If so, the implementation MUST process the record as DTLSCiphertext;
+             */
+            int cbitisset = DTLS13_UNI_HDR_CID_BIT_IS_SET(rr->type);
+            int sbitisset = DTLS13_UNI_HDR_SEQ_BIT_IS_SET(rr->type);
+            int lbitisset = DTLS13_UNI_HDR_LEN_BIT_IS_SET(rr->type);
+            uint16_t eebits = rr->type & DTLS13_UNI_HDR_EPOCH_BITS_MASK;
+
+            record_version = DTLS1_2_VERSION;
+            epoch64 = rl->epoch;
+            recseqnumlen = sbitisset ? 2 : 1;
+            recseqnumoffs = sizeof(recseqnum) - recseqnumlen;
+
+            if (/* OpenSSL does not support connection IDs: silently discard */
+                cbitisset
+                /*
+                 * Naive approach? We expect sequence number to be filled already
+                 * and then override the last bytes of the sequence number.
+                 */
+                || !PACKET_copy_bytes(&dtlsrecord, recseqnum + recseqnumoffs, recseqnumlen)
+                /*
+                 * rfc9147:
+                 * The length field MAY be omitted by clearing the L bit, which means
+                 * that the record consumes the entire rest of the datagram in the
+                 * lower level transport
+                 */
+                || (lbitisset ? !PACKET_get_net_2(&dtlsrecord, &length)
+                              : (length = (unsigned int)TLS_BUFFER_get_len(&rl->rbuf)) > 0)) {
+                rr->length = 0;
+                rl->packet_length = 0;
+                goto again;
+            }

-        memcpy(&(rl->sequence[2]), p, 6);
-        p += 6;
+            /*
+             * RFC 9147 Section 4.2.2 Says that after the handshake phase (epoch 3+)
+             * if the epoch bits do not match the current epoch we should use the
+             * last epoch value. That would result in dropping the packet.
+             */
+            if ((epoch64 & DTLS13_UNI_HDR_EPOCH_BITS_MASK) != eebits) {
+                /*
+                 * Since we do not transition out of epoch 0 or early data until after
+                 * we receive the next record if we are in epoch 0 or Early Data (epoch 1)
+                 * and get an epoch 2 record we must update the epoch
+                 */
+                if (eebits == 2 && (epoch64 == 1 || epoch64 == 0)) {
+                    epoch64 = 2;
+                } else if (rl->prev_epoch_rl != NULL
+                    && (rl->prev_epoch_rl->epoch
+                           & DTLS13_UNI_HDR_EPOCH_BITS_MASK)
+                        == eebits) {
+                    /*
+                     * This may be a retransmission at the epoch we have just
+                     * moved on from, sent because the ACK we gave it was
+                     * lost. Authenticate it with that epoch's own retained
+                     * keys and replay window instead of dropping it.
+                     */
+                    epoch64 = rl->prev_epoch_rl->epoch;
+                    crypto_rl = rl->prev_epoch_rl;
+                } else {
+                    rr->length = 0;
+                    rl->packet_length = 0;
+                    goto again;
+                }
+            }
+        } else {
+            if (!PACKET_get_net_2(&dtlsrecord, &record_version)
+                || !PACKET_get_net_2(&dtlsrecord, &epoch)
+                || !PACKET_copy_bytes(&dtlsrecord, recseqnum, 6)
+                || !PACKET_get_net_2(&dtlsrecord, &length)) {
+                rr->length = 0;
+                rl->packet_length = 0;
+                goto again;
+            }
+            epoch64 = epoch;
+            recseqnumoffs = 0;
+            recseqnumlen = 6;
+        }

-        n2s(p, rr->length);
+        rechdrlen = PACKET_data(&dtlsrecord) - rl->packet;
+        rr->rec_version = (int)record_version;
+        rr->epoch = epoch64;
+        rr->length = length;

         if (rl->msg_callback != NULL)
-            rl->msg_callback(0, rr->rec_version, SSL3_RT_HEADER, rl->packet, DTLS1_RT_HEADER_LENGTH,
-                rl->cbarg);
+            rl->msg_callback(0, rr->rec_version, SSL3_RT_HEADER, rl->packet,
+                rechdrlen, rl->cbarg);

         /*
          * Lets check the version. We tolerate alerts that don't have the exact
          * version number (e.g. because of protocol version errors)
          */
-        if (!rl->is_first_record && rr->type != SSL3_RT_ALERT) {
+        if (!rl->is_first_record && rr->type != SSL3_RT_ALERT
+            /* DTLSv1.3 records sets the legacy version field to DTLSv1.2 */
+            && !(rr->rec_version == DTLS1_2_VERSION
+                && rl->version == DTLS1_3_VERSION)) {
             if (rr->rec_version != rl->version) {
                 /* unexpected version, silently discard */
                 rr->length = 0;
@@ -412,7 +693,7 @@ again:
             }
         }

-        if (ssl_major != (rl->version == DTLS_ANY_VERSION ? DTLS1_VERSION_MAJOR : rl->version >> 8)) {
+        if (rr->rec_version >> 8 != (rl->version == DTLS_ANY_VERSION ? DTLS1_VERSION_MAJOR : rl->version >> 8)) {
             /* wrong version, silently discard record */
             rr->length = 0;
             rl->packet_length = 0;
@@ -444,10 +725,10 @@ again:

     if (rr->length > rl->packet_length - DTLS1_RT_HEADER_LENGTH) {
         /* now rl->packet_length == DTLS1_RT_HEADER_LENGTH */
-        more = rr->length;
-        rret = rl->funcs->read_n(rl, more, more, 1, 1, &n);
+        more = rr->length - (nread - rechdrlen);
+        rret = rl->funcs->read_n(rl, more, more, 1, 1, &nread);
         /* this packet contained a partial record, dump it */
-        if (rret < OSSL_RECORD_RETURN_SUCCESS || n != more) {
+        if (rret < OSSL_RECORD_RETURN_SUCCESS || nread != more) {
             if (rl->alert != SSL_AD_NO_ALERT) {
                 /* read_n() called RLAYERfatal() */
                 return OSSL_RECORD_RETURN_FATAL;
@@ -465,30 +746,77 @@ again:
     /* set state for later operations */
     rl->rstate = SSL_ST_READ_HEADER;

-    /* match epochs.  NULL means the packet is dropped on the floor */
-    bitmap = dtls_get_bitmap(rl, rr, &is_next_epoch);
-    if (bitmap == NULL) {
+    /*
+     * RFC 9147 permits DTLSPlaintext only in epoch 0. Silently discard it
+     * after reading the fragment so later records remain framed.
+     */
+    if (rl->version == DTLS1_3_VERSION
+        && rl->epoch != 0
+        && !DTLS13_UNI_HDR_FIX_BITS_IS_SET(rr->type)) {
         rr->length = 0;
-        rl->packet_length = 0; /* dump this record */
-        goto again; /* get another record */
+        rl->packet_length = 0;
+        goto again;
     }
-#ifndef OPENSSL_NO_SCTP
-    /* Only do replay check if no SCTP bio */
-    if (!BIO_dgram_is_sctp(rl->bio)) {
-#endif
-        /* Check whether this is a repeat, or aged record. */
-        if (!dtls_record_replay_check(rl, bitmap)) {
-            rr->length = 0;
-            rl->packet_length = 0; /* dump this record */
-            goto again; /* get another record */
+
+    /*
+     * rfc9147:
+     * This procedure requires the ciphertext length to be at least 16 bytes.
+     * Receivers MUST reject shorter records as if they had failed deprotection
+     */
+    if (DTLS13_UNI_HDR_FIX_BITS_IS_SET(rr->type)
+        && rl->version == DTLS1_3_VERSION
+        && !(rl->in_init && rl->epoch == 0)
+        && ((rl->packet_length < rechdrlen + DTLS13_CIPHERTEXT_MINSIZE)
+            || (crypto_rl->sn_enc_ctx == NULL && crypto_rl->mac_ctx == NULL)
+            || (crypto_rl->sn_enc_ctx != NULL
+                && !dtls_crypt_sequence_number(crypto_rl->sn_enc_ctx,
+                    recseqnum + recseqnumoffs,
+                    recseqnumlen,
+                    rl->packet + rechdrlen)))) {
+        /* sequence number encryption failed dump record */
+        rr->length = 0;
+        rl->packet_length = 0;
+        goto again;
+    }
+
+    if (rl->version == DTLS1_3_VERSION && rr->epoch == crypto_rl->epoch
+        && DTLS13_UNI_HDR_FIX_BITS_IS_SET(rr->type)) {
+        /* Reconstruct current-epoch unified records using its replay window. */
+        uint64_t truncated = 0;
+        size_t i;
+
+        /* A unified header carries 8 or 16 bits of the sequence number */
+        if (!ossl_assert(recseqnumlen == 1 || recseqnumlen == 2)) {
+            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return OSSL_RECORD_RETURN_FATAL;
         }
-#ifndef OPENSSL_NO_SCTP
+
+        for (i = 0; i < recseqnumlen; i++)
+            truncated = (truncated << 8) | recseqnum[recseqnumoffs + i];
+
+        crypto_rl->sequence = dtls13_reconstruct_seq_num(crypto_rl->bitmap.max_seq_num,
+            truncated, recseqnumlen);
+    } else {
+        /*
+         * DTLSPlaintext carries 48 bits. A buffered next-epoch unified record
+         * is re-parsed after that epoch's record layer is installed, so this
+         * provisional value is unused.
+         */
+        rl->sequence = ((uint64_t)recseqnum[0]) << 40;
+        rl->sequence |= ((uint64_t)recseqnum[1]) << 32;
+        rl->sequence |= ((uint64_t)recseqnum[2]) << 24;
+        rl->sequence |= ((uint64_t)recseqnum[3]) << 16;
+        rl->sequence |= ((uint64_t)recseqnum[4]) << 8;
+        rl->sequence |= ((uint64_t)recseqnum[5]) << 0;
     }
-#endif

-    /* just read a 0 length packet */
-    if (rr->length == 0)
-        goto again;
+    /* match epochs.  NULL means the packet is dropped on the floor */
+    bitmap = dtls_get_bitmap(crypto_rl, rr, &is_next_epoch);
+    if (bitmap == NULL && !is_next_epoch) {
+        rr->length = 0;
+        rl->packet_length = 0; /* dump this record */
+        goto again; /* get another record */
+    }

     /*
      * If this record is from the next epoch (either HM or ALERT), and a
@@ -496,22 +824,91 @@ again:
      * processed at this time.
      */
     if (is_next_epoch) {
-        if (rl->in_init) {
-            if (dtls_rlayer_buffer_record(rl, rl->unprocessed_rcds,
-                    rr->seq_num)
+        /*
+         * DTLS 1.3 has two scenarios when to buffer the record
+         * from the next epoch
+         * 1) during handshake when rl->in_init is set and
+         *    we got an epoch 0 record and the record layer
+         *    is at epoch 2
+         * 2) during early data when rl-epoch is 1 and we
+         *    got an epoch 2 record
+         */
+        if ((rl->in_init && rl->version != DTLS1_3_VERSION)
+            || (rl->in_init && rl->epoch == 0 && rr->epoch == 2)
+            || (rl->version == DTLS1_3_VERSION
+                && ((rl->in_init && rl->epoch == 0 && rr->epoch == 2)
+                    || (rl->epoch == 1 && rr->epoch == 2)))) {
+
+            uint64_t unprocessed_record_priority = rr->seq_num;
+
+            /*
+             * DTLS1.3 uses encrypted sequence numbers so we want to set the
+             * priority base off of epoch.
+             */
+            if (rl->version == DTLS1_3_VERSION || (rr->epoch == 2 && rl->epoch == 0)) {
+                if (rr->epoch == 1)
+                    unprocessed_record_priority = rl->dtls13_epoch_1_seq++;
+                else if (rr->epoch == 2)
+                    unprocessed_record_priority = rl->dtls13_epoch_2_seq++;
+            }
+            if (dtls_rlayer_buffer_record(rl, &rl->unprocessed_rcds,
+                    unprocessed_record_priority)
                 < 0) {
                 /* RLAYERfatal() already called */
                 return OSSL_RECORD_RETURN_FATAL;
             }
+            buffered_record = 1;
         }
         rr->length = 0;
         rl->packet_length = 0;
         goto again;
     }

-    if (!dtls_process_record(rl, bitmap)) {
-        if (rl->alert != SSL_AD_NO_ALERT) {
+    /*
+     * Reject forbidden epoch 0 records before they can update the replay
+     * bitmap. Next epoch records have already been buffered above, so their
+     * unified headers aren't interpreted as plaintext content types here.
+     */
+    if (!dtls13_plaintext_allows_type(rl, rr->type)) {
+        rr->length = 0;
+        rl->packet_length = 0;
+        goto again;
+    }
+
+    /*
+     * dtls_record_replay_check() and dtls_process_record() read and write
+     * whichever OSSL_RECORD_LAYER they are passed, not rr. When crypto_rl is
+     * the retained previous epoch, seed its record slot from rr so they
+     * have this record's data to work with; a no-op when crypto_rl == rl.
+     */
+    if (crypto_rl != rl) {
+        crypto_rl->packet = rl->packet;
+        crypto_rl->packet_length = rl->packet_length;
+        crypto_rl->rrec[0] = *rr;
+    }
+
+#ifndef OPENSSL_NO_SCTP
+    /* Only do replay check if no SCTP bio (also check for NULL bio) */
+    if (rl->bio == NULL || !BIO_dgram_is_sctp(rl->bio)) {
+#endif
+        /* Check whether this is a repeat, or aged record. */
+        if (!dtls_record_replay_check(crypto_rl, bitmap)) {
+            rr->length = 0;
+            rl->packet_length = 0; /* dump this record */
+            goto again; /* get another record */
+        }
+#ifndef OPENSSL_NO_SCTP
+    }
+#endif
+
+    /* just read a 0 length packet */
+    if (rr->length == 0)
+        goto again;
+
+    if (!dtls_process_record(crypto_rl, bitmap)) {
+        if (crypto_rl->alert != SSL_AD_NO_ALERT) {
             /* dtls_process_record() called RLAYERfatal */
+            rl->alert = crypto_rl->alert;
             return OSSL_RECORD_RETURN_FATAL;
         }
         rr->length = 0;
@@ -519,11 +916,22 @@ again:
         goto again; /* get another record */
     }

+    if (crypto_rl != rl) {
+        *rr = crypto_rl->rrec[0];
+        rl->packet_length = 0;
+    }
+
     if (rl->funcs->post_process_record && !rl->funcs->post_process_record(rl, rr)) {
         /* RLAYERfatal already called */
         return OSSL_RECORD_RETURN_FATAL;
     }

+    /* rr->type is only decoded after post_process_record() above. */
+    if (crypto_rl != rl && !dtls_prev_epoch_allows_type(crypto_rl, rr->type)) {
+        rr->length = 0;
+        goto again;
+    }
+
     if (rr->length == 0) {
         /* No payload data in this record. Dump it */
         rl->packet_length = 0;
@@ -534,53 +942,92 @@ again:
     return OSSL_RECORD_RETURN_SUCCESS;
 }

-static int dtls_free(OSSL_RECORD_LAYER *rl)
+/*
+ * Push any unread buffered bytes and any records already buffered in
+ * unprocessed_rcds (see is_next_epoch in dtls_get_more_records()) forward
+ * into rl->next, so a pending handshake epoch transition still completes.
+ * Must run when rl stops being the active read layer, not deferred until
+ * it is eventually freed -- see dtls_free() and dtls_set_prev_epoch_rl().
+ */
+static int dtls_forward_pending_records(OSSL_RECORD_LAYER *rl)
 {
-    TLS_BUFFER *rbuf;
+    TLS_BUFFER *rbuf = &rl->rbuf;
     size_t left, written;
     pitem *item;
     DTLS_RLAYER_RECORD_DATA *rdata;
     int ret = 1;

-    rbuf = &rl->rbuf;
-
     left = rbuf->left;
     if (left > 0) {
-        /*
-         * This record layer is closing but we still have data left in our
-         * buffer. It must be destined for the next epoch - so push it there.
-         */
         ret = BIO_write_ex(rl->next, rbuf->buf + rbuf->offset, left, &written);
         rbuf->left = 0;
     }

-    if (rl->unprocessed_rcds != NULL) {
-        while ((item = pqueue_pop(rl->unprocessed_rcds)) != NULL) {
-            rdata = (DTLS_RLAYER_RECORD_DATA *)item->data;
-            /* Push to the next record layer */
-            ret &= BIO_write_ex(rl->next, rdata->packet, rdata->packet_length,
-                &written);
-            OPENSSL_free(rdata->packet);
-            OPENSSL_free(item->data);
-            pitem_free(item);
-        }
-        pqueue_free(rl->unprocessed_rcds);
+    while ((item = pqueue_pop(&rl->unprocessed_rcds)) != NULL) {
+        rdata = (DTLS_RLAYER_RECORD_DATA *)item->data;
+
+        ret &= BIO_write_ex(rl->next, rdata->packet, rdata->packet_length,
+            &written);
+        OPENSSL_free(rdata->packet);
+        OPENSSL_free(item->data);
+        pitem_free(item);
+    }
+
+    return ret;
+}
+
+static int dtls_free(OSSL_RECORD_LAYER *rl)
+{
+    int ret = dtls_forward_pending_records(rl);
+
+    if (rl->prev_epoch_rl != NULL) {
+        ret &= dtls_free(rl->prev_epoch_rl);
+        rl->prev_epoch_rl = NULL;
     }

     return tls_free(rl) && ret;
 }

+/*
+ * Take ownership of the previous record layer, just superseded by the
+ * record layer, instead of the caller freeing it.
+ */
+static int dtls_set_prev_epoch_rl(OSSL_RECORD_LAYER *rl, OSSL_RECORD_LAYER *prev)
+{
+    int ret = dtls_forward_pending_records(prev);
+
+    if (prev->prev_epoch_rl != NULL) {
+        ret &= dtls_free(prev->prev_epoch_rl);
+        prev->prev_epoch_rl = NULL;
+    }
+
+    /*
+     * prev's own read buffer is never used again: authenticating a
+     * retransmission at this epoch reuses the active layer's packet buffer
+     * (see the crypto_rl handling in dtls_get_more_records()). Release it
+     * now instead of leaving it allocated until the whole layer chain is
+     * torn down or the caller happens to call SSL_free_buffers().
+     */
+    ret &= tls_release_read_buffer(prev);
+
+    rl->prev_epoch_rl = prev;
+    return ret;
+}
+
 static int
 dtls_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers,
-    int role, int direction, int level, uint16_t epoch,
+    int role, int direction, int level, uint64_t epoch,
     unsigned char *secret, size_t secretlen,
-    unsigned char *key, size_t keylen, unsigned char *iv,
-    size_t ivlen, unsigned char *mackey, size_t mackeylen,
+    unsigned char *snkey, unsigned char *key, size_t keylen,
+    unsigned char *iv, size_t ivlen,
+    unsigned char *mackey, size_t mackeylen,
+    const EVP_CIPHER *snciph,
     const EVP_CIPHER *ciph, size_t taglen,
     int mactype,
     const EVP_MD *md, COMP_METHOD *comp,
     const EVP_MD *kdfdigest, BIO *prev, BIO *transport,
-    BIO *next, BIO_ADDR *local, BIO_ADDR *peer,
+    BIO *next,
+    int use_urxe,
     const OSSL_PARAM *settings, const OSSL_PARAM *options,
     const OSSL_DISPATCH *fns, void *cbarg, void *rlarg,
     OSSL_RECORD_LAYER **retrl)
@@ -595,23 +1042,20 @@ dtls_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers,
     if (ret != OSSL_RECORD_RETURN_SUCCESS)
         return ret;

-    (*retrl)->unprocessed_rcds = pqueue_new();
-
-    if ((*retrl)->unprocessed_rcds == NULL) {
-        dtls_free(*retrl);
-        *retrl = NULL;
-        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
-        return OSSL_RECORD_RETURN_FATAL;
-    }
-
     (*retrl)->isdtls = 1;
     (*retrl)->epoch = epoch;
     (*retrl)->in_init = 1;
+    (*retrl)->dtls13_epoch_1_seq = 0;
+    (*retrl)->dtls13_epoch_2_seq = 100;
+    (*retrl)->use_urxe = use_urxe;

     switch (vers) {
     case DTLS_ANY_VERSION:
         (*retrl)->funcs = &dtls_any_funcs;
         break;
+    case DTLS1_3_VERSION:
+        (*retrl)->funcs = &dtls_1_3_funcs;
+        break;
     case DTLS1_2_VERSION:
     case DTLS1_VERSION:
     case DTLS1_BAD_VER:
@@ -624,9 +1068,10 @@ dtls_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers,
         goto err;
     }

-    ret = (*retrl)->funcs->set_crypto_state(*retrl, level, key, keylen, iv,
-        ivlen, mackey, mackeylen, ciph,
-        taglen, mactype, md, comp);
+    ret = (*retrl)->funcs->set_crypto_state(*retrl, level, snkey, key, keylen,
+        iv, ivlen, mackey, mackeylen,
+        snciph, ciph, taglen, mactype, md,
+        comp);

 err:
     if (ret != OSSL_RECORD_RETURN_SUCCESS) {
@@ -643,25 +1088,52 @@ int dtls_prepare_record_header(OSSL_RECORD_LAYER *rl,
     unsigned char **recdata)
 {
     size_t maxcomplen;
+    int unifiedheader = rl->version == DTLS1_3_VERSION && rl->epoch > 0;

+    templ->sequence_number = rl->sequence;
+    templ->epoch = rl->epoch;
     *recdata = NULL;
-
     maxcomplen = templ->buflen;
+
     if (rl->compctx != NULL)
         maxcomplen += SSL3_RT_MAX_COMPRESSED_OVERHEAD;

-    if (!WPACKET_put_bytes_u8(thispkt, rectype)
-        || !WPACKET_put_bytes_u16(thispkt, templ->version)
-        || !WPACKET_put_bytes_u16(thispkt, rl->epoch)
-        || !WPACKET_memcpy(thispkt, &(rl->sequence[2]), 6)
-        || !WPACKET_start_sub_packet_u16(thispkt)
-        || (rl->eivlen > 0
-            && !WPACKET_allocate_bytes(thispkt, rl->eivlen, NULL))
-        || (maxcomplen > 0
-            && !WPACKET_reserve_bytes(thispkt, maxcomplen,
-                recdata))) {
-        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-        return 0;
+    if (unifiedheader) {
+        uint8_t fixedbits = 0x20;
+        uint8_t cbit = 0;
+        uint8_t sbit = DTLS13_UNI_HDR_SEQ_BIT;
+        uint8_t lbit = DTLS13_UNI_HDR_LEN_BIT;
+        uint8_t ebits = rl->epoch & DTLS13_UNI_HDR_EPOCH_BITS_MASK;
+        uint8_t unifiedhdrbits = fixedbits | cbit | sbit | lbit | ebits;
+        uint64_t seqnum;
+
+        /* Truncate only the wire encoding, not the AEAD nonce counter. */
+        seqnum = rl->sequence & DTLS13_UNI_HDR_SEQ_MASK(sbit ? 2 : 1);
+
+        if (!WPACKET_put_bytes_u8(thispkt, unifiedhdrbits)
+            || (sbit ? !WPACKET_put_bytes_u16(thispkt, seqnum)
+                     : !WPACKET_put_bytes_u8(thispkt, seqnum))
+            || !WPACKET_start_sub_packet_u16(thispkt)
+            || (rl->eivlen > 0
+                && !WPACKET_allocate_bytes(thispkt, rl->eivlen, NULL))
+            || (maxcomplen > 0
+                && !WPACKET_reserve_bytes(thispkt, maxcomplen, recdata))) {
+            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+    } else {
+        if (!WPACKET_put_bytes_u8(thispkt, rectype)
+            || !WPACKET_put_bytes_u16(thispkt, templ->version)
+            || !WPACKET_put_bytes_u16(thispkt, templ->epoch)
+            || !WPACKET_put_bytes_u48(thispkt, templ->sequence_number)
+            || !WPACKET_start_sub_packet_u16(thispkt)
+            || (rl->eivlen > 0
+                && !WPACKET_allocate_bytes(thispkt, rl->eivlen, NULL))
+            || (maxcomplen > 0
+                && !WPACKET_reserve_bytes(thispkt, maxcomplen, recdata))) {
+            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
     }

     return 1;
@@ -679,16 +1151,35 @@ int dtls_post_encryption_processing(OSSL_RECORD_LAYER *rl,
         return 0;
     }

-    return tls_increment_sequence_ctr(rl);
+    return dtls_increment_sequence_ctr(rl);
+}
+
+static int dtls_increment_sequence_ctr(OSSL_RECORD_LAYER *rl)
+{
+    if (rl->version == DTLS1_3_VERSION)
+        return tls_increment_sequence_ctr(rl);
+
+    if (rl->sequence >= 0xffffffffffffULL) {
+        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, SSL_R_SEQUENCE_CTR_WRAPPED);
+        return 0;
+    }
+
+    rl->sequence++;
+    return 1;
 }

 static size_t dtls_get_max_record_overhead(OSSL_RECORD_LAYER *rl)
 {
-    size_t blocksize = 0;
+    size_t blocksize = 0, contenttypelen = 0;
+    size_t rchdrlen = tls_get_record_header_len(rl);

     if (rl->enc_ctx != NULL && (EVP_CIPHER_CTX_get_mode(rl->enc_ctx) == EVP_CIPH_CBC_MODE))
         blocksize = EVP_CIPHER_CTX_get_block_size(rl->enc_ctx);

+    /* DTLSv1.3 adds an extra content type byte after payload data */
+    if (rl->version == DTLS1_3_VERSION)
+        contenttypelen = 1;
+
     /*
      * If we have a cipher in place then the tag is mandatory. If the cipher is
      * CBC mode then an explicit IV is also mandatory. If we know the digest,
@@ -710,7 +1201,36 @@ static size_t dtls_get_max_record_overhead(OSSL_RECORD_LAYER *rl)
      * MTU size - so isn't very helpful. We just ignore potential expansion
      * due to compression.
      */
-    return DTLS1_RT_HEADER_LENGTH + rl->eivlen + blocksize + rl->taglen;
+    return rchdrlen + rl->eivlen + blocksize + rl->taglen + contenttypelen;
+}
+
+static int dtls_get_sequence_number(OSSL_RECORD_LAYER *rl, uint64_t *sequence)
+{
+    *sequence = rl->sequence;
+    return 1;
+}
+
+static int dtls_set_sequence_number(OSSL_RECORD_LAYER *rl, uint64_t sequence)
+{
+    rl->sequence = sequence;
+    return 1;
+}
+
+static int dtls_get_epoch(OSSL_RECORD_LAYER *rl, uint64_t *epoch)
+{
+    *epoch = rl->epoch;
+    return 1;
+}
+
+static int dtls_set_curr_mtu(OSSL_RECORD_LAYER *rl, size_t mtu)
+{
+    rl->curr_mtu = mtu;
+    return 1;
+}
+
+static size_t dtls_unprocessed_records(OSSL_RECORD_LAYER *rl)
+{
+    return pqueue_size(&rl->unprocessed_rcds);
 }

 const OSSL_RECORD_METHOD ossl_dtls_record_method = {
@@ -726,8 +1246,14 @@ const OSSL_RECORD_METHOD ossl_dtls_record_method = {
     tls_release_record,
     tls_get_alert_code,
     tls_set1_bio,
-    tls_set_protocol_version,
+#ifndef OPENSSL_NO_SOCK
+    tls_set1_peer,
+#else
     NULL,
+#endif
+    tls_set_use_urxe,
+    tls_set_protocol_version,
+    tls_set_plain_alerts,
     tls_set_first_handshake,
     tls_set_max_pipelines,
     dtls_set_in_init,
@@ -736,7 +1262,13 @@ const OSSL_RECORD_METHOD ossl_dtls_record_method = {
     tls_get_compression,
     tls_set_max_frag_len,
     dtls_get_max_record_overhead,
-    tls_increment_sequence_ctr,
+    dtls_increment_sequence_ctr,
+    dtls_get_sequence_number,
+    dtls_set_sequence_number,
+    dtls_get_epoch,
+    dtls_set_curr_mtu,
+    dtls_unprocessed_records,
     tls_alloc_buffers,
-    tls_free_buffers
+    tls_free_buffers,
+    dtls_set_prev_epoch_rl
 };
diff --git a/deps/openssl/openssl/ssl/record/methods/ktls_meth.c b/deps/openssl/openssl/ssl/record/methods/ktls_meth.c
index e4fbba577ca..8e39c17c34c 100644
--- a/deps/openssl/openssl/ssl/record/methods/ktls_meth.c
+++ b/deps/openssl/openssl/ssl/record/methods/ktls_meth.c
@@ -284,9 +284,11 @@ static int ktls_configure_crypto(OSSL_LIB_CTX *libctx, int version, const EVP_CI
 #endif /* OPENSSL_SYS_LINUX */

 static int ktls_set_crypto_state(OSSL_RECORD_LAYER *rl, int level,
+    unsigned char *snkey,
     unsigned char *key, size_t keylen,
     unsigned char *iv, size_t ivlen,
     unsigned char *mackey, size_t mackeylen,
+    const EVP_CIPHER *snciph,
     const EVP_CIPHER *ciph,
     size_t taglen,
     int mactype,
@@ -294,6 +296,9 @@ static int ktls_set_crypto_state(OSSL_RECORD_LAYER *rl, int level,
     COMP_METHOD *comp)
 {
     ktls_crypto_info_t crypto_info;
+    unsigned char recseq[SEQ_NUM_SIZE], *p_recseq = recseq;
+
+    l2n8(rl->sequence, p_recseq);

     /*
      * Check if we are suitable for KTLS. If not suitable we return
@@ -322,7 +327,7 @@ static int ktls_set_crypto_state(OSSL_RECORD_LAYER *rl, int level,
             return OSSL_RECORD_RETURN_NON_FATAL_ERR;
     }

-    if (!ktls_configure_crypto(rl->libctx, rl->version, ciph, md, rl->sequence,
+    if (!ktls_configure_crypto(rl->libctx, rl->version, ciph, md, recseq,
             &crypto_info,
             rl->direction == OSSL_RECORD_DIRECTION_WRITE,
             iv, ivlen, key, keylen, mackey, mackeylen))
@@ -397,15 +402,18 @@ static int ktls_post_process_record(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec)

 static int
 ktls_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers,
-    int role, int direction, int level, uint16_t epoch,
+    int role, int direction, int level, uint64_t epoch,
     unsigned char *secret, size_t secretlen,
-    unsigned char *key, size_t keylen, unsigned char *iv,
-    size_t ivlen, unsigned char *mackey, size_t mackeylen,
+    unsigned char *snkey, unsigned char *key, size_t keylen,
+    unsigned char *iv, size_t ivlen,
+    unsigned char *mackey, size_t mackeylen,
+    const EVP_CIPHER *snciph,
     const EVP_CIPHER *ciph, size_t taglen,
     int mactype,
     const EVP_MD *md, COMP_METHOD *comp,
     const EVP_MD *kdfdigest, BIO *prev, BIO *transport,
-    BIO *next, BIO_ADDR *local, BIO_ADDR *peer,
+    BIO *next,
+    int use_urxe,
     const OSSL_PARAM *settings, const OSSL_PARAM *options,
     const OSSL_DISPATCH *fns, void *cbarg, void *rlarg,
     OSSL_RECORD_LAYER **retrl)
@@ -422,9 +430,10 @@ ktls_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers,

     (*retrl)->funcs = &ossl_ktls_funcs;

-    ret = (*retrl)->funcs->set_crypto_state(*retrl, level, key, keylen, iv,
-        ivlen, mackey, mackeylen, ciph,
-        taglen, mactype, md, comp);
+    ret = (*retrl)->funcs->set_crypto_state(*retrl, level, snkey, key, keylen,
+        iv, ivlen, mackey, mackeylen,
+        snciph, ciph, taglen, mactype, md,
+        comp);

     if (ret != OSSL_RECORD_RETURN_SUCCESS) {
         tls_free(*retrl);
@@ -586,6 +595,8 @@ const OSSL_RECORD_METHOD ossl_ktls_record_method = {
     tls_release_record,
     tls_get_alert_code,
     tls_set1_bio,
+    NULL, /* set1_peer: Not used for KTLS */
+    NULL, /* set_use_urxe: Not used for KTLS */
     tls_set_protocol_version,
     tls_set_plain_alerts,
     tls_set_first_handshake,
@@ -597,6 +608,12 @@ const OSSL_RECORD_METHOD ossl_ktls_record_method = {
     tls_set_max_frag_len,
     NULL,
     tls_increment_sequence_ctr,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
     ktls_alloc_buffers,
-    tls_free_buffers
+    tls_free_buffers,
+    NULL /* set_prev_epoch_rl: DTLS only */
 };
diff --git a/deps/openssl/openssl/ssl/record/methods/recmethod_local.h b/deps/openssl/openssl/ssl/record/methods/recmethod_local.h
index 5e3fdd1d058..6efb4424e17 100644
--- a/deps/openssl/openssl/ssl/record/methods/recmethod_local.h
+++ b/deps/openssl/openssl/ssl/record/methods/recmethod_local.h
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_SSL_RECORD_METHODS_RECMETHOD_LOCAL_H)
+#define OSSL_SSL_RECORD_METHODS_RECMETHOD_LOCAL_H
+
 #include <openssl/bio.h>
 #include <openssl/ssl.h>
 #include <openssl/err.h>
@@ -16,8 +19,8 @@
 typedef struct dtls_bitmap_st {
     /* Track 64 packets */
     uint64_t map;
-    /* Max record number seen so far, 64-bit value in big-endian encoding */
-    unsigned char max_seq_num[SEQ_NUM_SIZE];
+    /* Max record number seen so far */
+    uint64_t max_seq_num;
 } DTLS_BITMAP;

 typedef struct ssl_mac_buf_st {
@@ -72,10 +75,10 @@ typedef struct tls_rl_record_st {
     unsigned char *comp;
     /* epoch number, needed by DTLS1 */
     /* r */
-    uint16_t epoch;
+    uint64_t epoch;
     /* sequence number, needed by DTLS1 */
     /* r */
-    unsigned char seq_num[SEQ_NUM_SIZE];
+    uint64_t seq_num;
 } TLS_RL_RECORD;

 /* Macros/functions provided by the TLS_RL_RECORD component */
@@ -97,9 +100,11 @@ struct record_functions_st {
      * alternative record layer.
      */
     int (*set_crypto_state)(OSSL_RECORD_LAYER *rl, int level,
+        unsigned char *snkey,
         unsigned char *key, size_t keylen,
         unsigned char *iv, size_t ivlen,
         unsigned char *mackey, size_t mackeylen,
+        const EVP_CIPHER *snciph,
         const EVP_CIPHER *ciph,
         size_t taglen,
         int mactype,
@@ -217,7 +222,7 @@ struct ossl_record_layer_st {
     int level;
     const EVP_MD *md;
     /* DTLS only */
-    uint16_t epoch;
+    uint64_t epoch;

     /*
      * A BIO containing any data read in the previous epoch that was destined
@@ -269,7 +274,7 @@ struct ossl_record_layer_st {
     size_t packet_length;

     /* Sequence number for the next record */
-    unsigned char sequence[SEQ_NUM_SIZE];
+    uint64_t sequence;

     /* Alert code to be used if an error occurs */
     int alert;
@@ -284,13 +289,14 @@ struct ossl_record_layer_st {

     /*
      * Do we need to send a prefix empty record before application data as a
-     * countermeasure against known-IV weakness (necessary for SSLv3 and
-     * TLSv1.0)
+     * countermeasure against known-IV weakness (necessary for TLSv1.0)
      */
     int need_empty_fragments;

     /* cryptographic state */
     EVP_CIPHER_CTX *enc_ctx;
+    /* cryptographic state for DTLS 1.3 encrypted sequence numbers */
+    EVP_CIPHER_CTX *sn_enc_ctx;

     /* TLSv1.3 MAC ctx, only used with integrity-only cipher */
     EVP_MAC_CTX *mac_ctx;
@@ -323,9 +329,6 @@ struct ossl_record_layer_st {
     size_t block_padding;
     size_t hs_padding;

-    /* Only used by SSLv3 */
-    unsigned char mac_secret[EVP_MAX_MD_SIZE];
-
     /* TLSv1.0/TLSv1.1/TLSv1.2 */
     int use_etm;

@@ -345,24 +348,61 @@ struct ossl_record_layer_st {
     size_t taglen;

     /* DTLS received handshake records awaiting the next epoch */
-    struct pqueue_st *unprocessed_rcds;
+    pqueue unprocessed_rcds;

     /* records being received in the current epoch */
     DTLS_BITMAP bitmap;
-    /* renegotiation starts a new set of sequence numbers */
-    DTLS_BITMAP next_bitmap;
+
+    /*
+     * DTLS 1.3 read layers only. The immediately preceding read epoch's
+     * record layer, retained (instead of freed) across an epoch bump so a
+     * retransmission of the message that caused the bump can still be
+     * authenticated with its own now-superseded keys and bitmap, if the
+     * ACK we sent for it was lost.
+     */
+    OSSL_RECORD_LAYER *prev_epoch_rl;
+
+    /* DTLS curr mtu size */
+    size_t curr_mtu;
+
+#ifndef OPENSSL_NO_SOCK
+    /*
+     * DTLS peer address for writes. When set (family != AF_UNSPEC), the
+     * record layer will use BIO_sendmmsg() with this address instead of
+     * BIO_write(). This is used by listener-created connections that share
+     * the listener's network BIO.
+     */
+    BIO_ADDR peer;
+#endif
+
+    /*
+     * Use URXE queue for reading instead of BIO. Only set for listener-created
+     * DTLS connections where s->d1->rx exists.
+     */
+    unsigned int use_urxe : 1;

     /*
      * Whether we are currently in a handshake or not. Only maintained for DTLS
      */
     int in_init;

+    /*
+     * DTLSv1.3 uses encrypted sequence numbers in epoch 1 and beyond.
+     * For records that are buffered we need to put a priority on the
+     * buffered records.
+     */
+    int dtls13_epoch_1_seq;
+    int dtls13_epoch_2_seq;
+
     /* Callbacks */
     void *cbarg;
     OSSL_FUNC_rlayer_skip_early_data_fn *skip_early_data;
     OSSL_FUNC_rlayer_msg_callback_fn *msg_callback;
     OSSL_FUNC_rlayer_security_fn *security;
     OSSL_FUNC_rlayer_padding_fn *padding;
+    OSSL_FUNC_rlayer_get_urxe_packet_fn *get_urxe_packet;
+    OSSL_FUNC_rlayer_release_urxe_packet_fn *release_urxe_packet;
+    OSSL_FUNC_rlayer_block_for_write_fn *block_for_write;

     size_t max_pipelines;

@@ -376,11 +416,11 @@ typedef struct dtls_rlayer_record_data_st {
     TLS_RL_RECORD rrec;
 } DTLS_RLAYER_RECORD_DATA;

-extern const struct record_functions_st ssl_3_0_funcs;
 extern const struct record_functions_st tls_1_funcs;
 extern const struct record_functions_st tls_1_3_funcs;
 extern const struct record_functions_st tls_any_funcs;
 extern const struct record_functions_st dtls_1_funcs;
+extern const struct record_functions_st dtls_1_3_funcs;
 extern const struct record_functions_st dtls_any_funcs;

 void ossl_rlayer_fatal(OSSL_RECORD_LAYER *rl, int al, int reason,
@@ -398,9 +438,6 @@ void ossl_rlayer_fatal(OSSL_RECORD_LAYER *rl, int al, int reason,
     || (rl)->version == DTLS1_VERSION                               \
     || (rl)->version == DTLS1_2_VERSION)

-void ossl_tls_rl_record_set_seq_num(TLS_RL_RECORD *r,
-    const unsigned char *seq_num);
-
 int ossl_set_tls_provider_parameters(OSSL_RECORD_LAYER *rl,
     EVP_CIPHER_CTX *ctx,
     const EVP_CIPHER *ciph,
@@ -413,7 +450,35 @@ int tls_free_buffers(OSSL_RECORD_LAYER *rl);
 int tls_default_read_n(OSSL_RECORD_LAYER *rl, size_t n, size_t max, int extend,
     int clearold, size_t *readbytes);
 int tls_get_more_records(OSSL_RECORD_LAYER *rl);
+
+/* Returns true if the unified header fixed bits are set (rfc9147 section 4) */
+#define DTLS13_UNI_HDR_FIX_BITS_IS_SET(byte) \
+    (((byte) & DTLS13_UNI_HDR_FIX_BITS_MASK) == DTLS13_UNI_HDR_FIX_BITS)
+
+/* Returns true if the unified header connection id bit is set (rfc9147 section 4) */
+#define DTLS13_UNI_HDR_CID_BIT_IS_SET(byte) \
+    (((byte) & DTLS13_UNI_HDR_CID_BIT) == DTLS13_UNI_HDR_CID_BIT)
+
+/* Returns true if the unified header sequence number bit is set (rfc9147 section 4) */
+#define DTLS13_UNI_HDR_SEQ_BIT_IS_SET(byte) \
+    (((byte) & DTLS13_UNI_HDR_SEQ_BIT) == DTLS13_UNI_HDR_SEQ_BIT)
+
+/* Returns true if the unified header length bit is set (rfc9147 section 4) */
+#define DTLS13_UNI_HDR_LEN_BIT_IS_SET(byte) \
+    (((byte) & DTLS13_UNI_HDR_LEN_BIT) == DTLS13_UNI_HDR_LEN_BIT)
+
+/* Low-order sequence number bits carried by a DTLS 1.3 unified header. */
+#define DTLS13_UNI_HDR_SEQ_MASK(len) \
+    ((((uint64_t)1) << ((len) * 8)) - 1)
+
+uint64_t dtls13_reconstruct_seq_num(uint64_t max_seq_num, uint64_t truncated,
+    size_t seqlen);
+
+size_t dtls_get_rec_header_size(uint8_t hdr_first_byte);
+int dtls_crypt_sequence_number(EVP_CIPHER_CTX *ctx, unsigned char *seq, size_t seqlen,
+    unsigned char *rec_data);
 int dtls_get_more_records(OSSL_RECORD_LAYER *rl);
+int dtls_prev_epoch_allows_type(const OSSL_RECORD_LAYER *crypto_rl, int type);

 int dtls_prepare_record_header(OSSL_RECORD_LAYER *rl,
     WPACKET *thispkt,
@@ -428,6 +493,7 @@ int dtls_post_encryption_processing(OSSL_RECORD_LAYER *rl,

 int tls_default_set_protocol_version(OSSL_RECORD_LAYER *rl, int version);
 int tls_default_validate_record_header(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *re);
+size_t tls_get_record_header_len(OSSL_RECORD_LAYER *rl);
 int tls_do_compress(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *wr);
 int tls_do_uncompress(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec);
 int tls_default_post_process_record(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec);
@@ -452,11 +518,14 @@ int tls_write_records(OSSL_RECORD_LAYER *rl, OSSL_RECORD_TEMPLATE *templates,
 int tls_retry_write_records(OSSL_RECORD_LAYER *rl);
 int tls_get_alert_code(OSSL_RECORD_LAYER *rl);
 int tls_set1_bio(OSSL_RECORD_LAYER *rl, BIO *bio);
+#ifndef OPENSSL_NO_SOCK
+int tls_set1_peer(OSSL_RECORD_LAYER *rl, const BIO_ADDR *peer);
+#endif
+void tls_set_use_urxe(OSSL_RECORD_LAYER *rl, int use_urxe);
 int tls_read_record(OSSL_RECORD_LAYER *rl, void **rechandle, int *rversion,
     uint8_t *type, const unsigned char **data, size_t *datalen,
-    uint16_t *epoch, unsigned char *seq_num);
+    uint64_t *epoch, uint64_t *seq_num);
 int tls_release_record(OSSL_RECORD_LAYER *rl, void *rechandle, size_t length);
-int tls_default_set_protocol_version(OSSL_RECORD_LAYER *rl, int version);
 int tls_set_protocol_version(OSSL_RECORD_LAYER *rl, int version);
 void tls_set_plain_alerts(OSSL_RECORD_LAYER *rl, int allow);
 void tls_set_first_handshake(OSSL_RECORD_LAYER *rl, int first);
@@ -467,6 +536,7 @@ int tls_set_options(OSSL_RECORD_LAYER *rl, const OSSL_PARAM *options);
 const COMP_METHOD *tls_get_compression(OSSL_RECORD_LAYER *rl);
 void tls_set_max_frag_len(OSSL_RECORD_LAYER *rl, size_t max_frag_len);
 int tls_setup_read_buffer(OSSL_RECORD_LAYER *rl);
+int tls_release_read_buffer(OSSL_RECORD_LAYER *rl);
 int tls_setup_write_buffer(OSSL_RECORD_LAYER *rl, size_t numwpipes,
     size_t firstlen, size_t nextlen);

@@ -480,6 +550,8 @@ size_t tls_get_max_records_default(OSSL_RECORD_LAYER *rl, uint8_t type,
 size_t tls_get_max_records_multiblock(OSSL_RECORD_LAYER *rl, uint8_t type,
     size_t len, size_t maxfrag,
     size_t *preffrag);
+size_t tls_get_record_body_alignment_offset(OSSL_RECORD_LAYER *rl,
+    const unsigned char *rec);
 int tls_allocate_write_buffers_default(OSSL_RECORD_LAYER *rl,
     OSSL_RECORD_TEMPLATE *templates,
     size_t numtempl, size_t *prefix);
@@ -533,3 +605,5 @@ int tls_write_records_default(OSSL_RECORD_LAYER *rl,
 #define TLS_BUFFER_is_app_buffer(b) ((b)->app_buffer)

 void ossl_tls_buffer_release(TLS_BUFFER *b);
+
+#endif /* !defined(OSSL_SSL_RECORD_METHODS_RECMETHOD_LOCAL_H) */
diff --git a/deps/openssl/openssl/ssl/record/methods/ssl3_cbc.c b/deps/openssl/openssl/ssl/record/methods/ssl3_cbc.c
index 48be4885bbb..3f7ecfdbb58 100644
--- a/deps/openssl/openssl/ssl/record/methods/ssl3_cbc.c
+++ b/deps/openssl/openssl/ssl/record/methods/ssl3_cbc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2012-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -105,8 +105,7 @@ static void tls1_sha512_final_raw(void *ctx, unsigned char *md_out)
 #define LARGEST_DIGEST_CTX SHA512_CTX

 /*-
- * ssl3_cbc_digest_record computes the MAC of a decrypted, padded SSLv3/TLS
- * record.
+ * ssl3_cbc_digest_record computes the MAC of a decrypted, padded TLS record.
  *
  *   ctx: the EVP_MD_CTX from which we take the hash function.
  *     ssl3_cbc_record_digest_supported must return true for this EVP_MD_CTX.
@@ -118,7 +117,6 @@ static void tls1_sha512_final_raw(void *ctx, unsigned char *md_out)
  *              has been removed.
  *   data_plus_mac_plus_padding_size: the public length of the whole
  *     record, including MAC and padding.
- *   is_sslv3: non-zero if we are to use SSLv3. Otherwise, TLS.
  *
  * On entry: we know that data is data_plus_mac_plus_padding_size in length
  * Returns 1 on success or 0 on error
@@ -131,7 +129,7 @@ int ssl3_cbc_digest_record(const EVP_MD *md,
     size_t data_size,
     size_t data_plus_mac_plus_padding_size,
     const unsigned char *mac_secret,
-    size_t mac_secret_length, char is_sslv3)
+    size_t mac_secret_length)
 {
     union {
         OSSL_UNION_ALIGN;
@@ -140,9 +138,8 @@ int ssl3_cbc_digest_record(const EVP_MD *md,
     void (*md_final_raw)(void *ctx, unsigned char *md_out);
     void (*md_transform)(void *ctx, const unsigned char *block);
     size_t md_size, md_block_size = 64;
-    size_t sslv3_pad_length = 40, header_length, variance_blocks,
-           len, max_mac_bytes, num_blocks,
-           num_starting_blocks, k, mac_end_offset, c, index_a, index_b;
+    size_t header_length, variance_blocks, len, max_mac_bytes, num_blocks,
+        num_starting_blocks, k, mac_end_offset, c, index_a, index_b;
     size_t bits; /* at most 18 bits */
     unsigned char length_bytes[MAX_HASH_BIT_COUNT_BYTES];
     /* hmac_pad is the masked HMAC key. */
@@ -176,7 +173,6 @@ int ssl3_cbc_digest_record(const EVP_MD *md,
         md_final_raw = tls1_md5_final_raw;
         md_transform = (void (*)(void *ctx, const unsigned char *block))MD5_Transform;
         md_size = 16;
-        sslv3_pad_length = 48;
         length_is_big_endian = 0;
 #endif
     } else if (EVP_MD_is_a(md, "SHA1")) {
@@ -229,22 +225,11 @@ int ssl3_cbc_digest_record(const EVP_MD *md,
         return 0;

     header_length = 13;
-    if (is_sslv3) {
-        header_length = mac_secret_length
-            + sslv3_pad_length
-            + 8 /* sequence number */
-            + 1 /* record type */
-            + 2; /* record length */
-    }

     /*
      * variance_blocks is the number of blocks of the hash that we have to
      * calculate in constant time because they could be altered by the
-     * padding value. In SSLv3, the padding must be minimal so the end of
-     * the plaintext varies by, at most, 15+20 = 35 bytes. (We conservatively
-     * assume that the MAC size varies from 0..20 bytes.) In case the 9 bytes
-     * of hash termination (0x80 + 64-bit length) don't fit in the final
-     * block, we say that the final two blocks can vary based on the padding.
+     * padding value.
      * TLSv1 has MACs up to 48 bytes long (SHA-384) and the padding is not
      * required to be minimal. Therefore we say that the final |variance_blocks|
      * blocks can
@@ -252,14 +237,11 @@ int ssl3_cbc_digest_record(const EVP_MD *md,
      * short and there obviously cannot be this many blocks then
      * variance_blocks can be reduced.
      */
-    variance_blocks = is_sslv3 ? 2
-                               : (((255 + 1 + md_size + md_block_size - 1)
-                                      / md_block_size)
-                                     + 1);
+    variance_blocks = ((255 + 1 + md_size + md_block_size - 1) / md_block_size) + 1;
+
     /*
      * From now on we're dealing with the MAC, which conceptually has 13
-     * bytes of `header' before the start of the data (TLS) or 71/75 bytes
-     * (SSLv3)
+     * bytes of `header' before the start of the data (TLS)
      */
     len = data_plus_mac_plus_padding_size + header_length;
     /*
@@ -302,37 +284,30 @@ int ssl3_cbc_digest_record(const EVP_MD *md,
      * in bits.
      */
     index_b = (mac_end_offset + md_length_size) / md_block_size;
+
+    if (num_blocks > variance_blocks) {
+        num_starting_blocks = num_blocks - variance_blocks;
+        k = md_block_size * num_starting_blocks;
+    }
+
     /*
      * bits is the hash-length in bits. It includes the additional hash block
      * for the masked HMAC key, or whole of |header| in the case of SSLv3.
      */
+    bits = 8 * mac_end_offset;

     /*
-     * For SSLv3, if we're going to have any starting blocks then we need at
-     * least two because the header is larger than a single block.
+     * Compute the initial HMAC block.
      */
-    if (num_blocks > variance_blocks + (is_sslv3 ? 1 : 0)) {
-        num_starting_blocks = num_blocks - variance_blocks;
-        k = md_block_size * num_starting_blocks;
-    }
-
-    bits = 8 * mac_end_offset;
-    if (!is_sslv3) {
-        /*
-         * Compute the initial HMAC block. For SSLv3, the padding and secret
-         * bytes are included in |header| because they take more than a
-         * single block.
-         */
-        bits += 8 * md_block_size;
-        memset(hmac_pad, 0, md_block_size);
-        if (!ossl_assert(mac_secret_length <= sizeof(hmac_pad)))
-            return 0;
-        memcpy(hmac_pad, mac_secret, mac_secret_length);
-        for (i = 0; i < md_block_size; i++)
-            hmac_pad[i] ^= 0x36;
+    bits += 8 * md_block_size;
+    memset(hmac_pad, 0, md_block_size);
+    if (!ossl_assert(mac_secret_length <= sizeof(hmac_pad)))
+        return 0;
+    memcpy(hmac_pad, mac_secret, mac_secret_length);
+    for (i = 0; i < md_block_size; i++)
+        hmac_pad[i] ^= 0x36;

-        md_transform(md_state.c, hmac_pad);
-    }
+    md_transform(md_state.c, hmac_pad);

     if (length_is_big_endian) {
         memset(length_bytes, 0, md_length_size - 4);
@@ -349,37 +324,12 @@ int ssl3_cbc_digest_record(const EVP_MD *md,
     }

     if (k > 0) {
-        if (is_sslv3) {
-            size_t overhang;
-
-            /*
-             * The SSLv3 header is larger than a single block. overhang is
-             * the number of bytes beyond a single block that the header
-             * consumes: either 7 bytes (SHA1) or 11 bytes (MD5). There are no
-             * ciphersuites in SSLv3 that are not SHA1 or MD5 based and
-             * therefore we can be confident that the header_length will be
-             * greater than |md_block_size|. However we add a sanity check just
-             * in case
-             */
-            if (header_length <= md_block_size) {
-                /* Should never happen */
-                return 0;
-            }
-            overhang = header_length - md_block_size;
-            md_transform(md_state.c, header);
-            memcpy(first_block, header + md_block_size, overhang);
-            memcpy(first_block + overhang, data, md_block_size - overhang);
-            md_transform(md_state.c, first_block);
-            for (i = 1; i < k / md_block_size - 1; i++)
-                md_transform(md_state.c, data + md_block_size * i - overhang);
-        } else {
-            /* k is a multiple of md_block_size. */
-            memcpy(first_block, header, 13);
-            memcpy(first_block + 13, data, md_block_size - 13);
-            md_transform(md_state.c, first_block);
-            for (i = 1; i < k / md_block_size; i++)
-                md_transform(md_state.c, data + md_block_size * i - 13);
-        }
+        /* k is a multiple of md_block_size. */
+        memcpy(first_block, header, 13);
+        memcpy(first_block + 13, data, md_block_size - 13);
+        md_transform(md_state.c, first_block);
+        for (i = 1; i < k / md_block_size; i++)
+            md_transform(md_state.c, data + md_block_size * i - 13);
     }

     memset(mac_out, 0, sizeof(mac_out));
@@ -447,25 +397,17 @@ int ssl3_cbc_digest_record(const EVP_MD *md,
     if (md_ctx == NULL)
         goto err;

-    if (EVP_DigestInit_ex(md_ctx, md, NULL /* engine */) <= 0)
+    if (EVP_DigestInit_ex(md_ctx, md, NULL) <= 0)
+        goto err;
+
+    /* Complete the HMAC in the standard manner. */
+    for (i = 0; i < md_block_size; i++)
+        hmac_pad[i] ^= 0x6a;
+
+    if (EVP_DigestUpdate(md_ctx, hmac_pad, md_block_size) <= 0
+        || EVP_DigestUpdate(md_ctx, mac_out, md_size) <= 0)
         goto err;
-    if (is_sslv3) {
-        /* We repurpose |hmac_pad| to contain the SSLv3 pad2 block. */
-        memset(hmac_pad, 0x5c, sslv3_pad_length);
-
-        if (EVP_DigestUpdate(md_ctx, mac_secret, mac_secret_length) <= 0
-            || EVP_DigestUpdate(md_ctx, hmac_pad, sslv3_pad_length) <= 0
-            || EVP_DigestUpdate(md_ctx, mac_out, md_size) <= 0)
-            goto err;
-    } else {
-        /* Complete the HMAC in the standard manner. */
-        for (i = 0; i < md_block_size; i++)
-            hmac_pad[i] ^= 0x6a;

-        if (EVP_DigestUpdate(md_ctx, hmac_pad, md_block_size) <= 0
-            || EVP_DigestUpdate(md_ctx, mac_out, md_size) <= 0)
-            goto err;
-    }
     ret = EVP_DigestFinal(md_ctx, md_out, &md_out_size_u);
     if (ret && md_out_size)
         *md_out_size = md_out_size_u;
diff --git a/deps/openssl/openssl/ssl/record/methods/ssl3_meth.c b/deps/openssl/openssl/ssl/record/methods/ssl3_meth.c
deleted file mode 100644
index 3f28346027e..00000000000
--- a/deps/openssl/openssl/ssl/record/methods/ssl3_meth.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/evp.h>
-#include <openssl/core_names.h>
-#include "internal/ssl3_cbc.h"
-#include "../../ssl_local.h"
-#include "../record_local.h"
-#include "recmethod_local.h"
-
-static int ssl3_set_crypto_state(OSSL_RECORD_LAYER *rl, int level,
-    unsigned char *key, size_t keylen,
-    unsigned char *iv, size_t ivlen,
-    unsigned char *mackey, size_t mackeylen,
-    const EVP_CIPHER *ciph,
-    size_t taglen,
-    int mactype,
-    const EVP_MD *md,
-    COMP_METHOD *comp)
-{
-    EVP_CIPHER_CTX *ciph_ctx;
-    int enc = (rl->direction == OSSL_RECORD_DIRECTION_WRITE) ? 1 : 0;
-
-    if (md == NULL) {
-        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
-        return OSSL_RECORD_RETURN_FATAL;
-    }
-
-    if ((rl->enc_ctx = EVP_CIPHER_CTX_new()) == NULL) {
-        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
-        return OSSL_RECORD_RETURN_FATAL;
-    }
-    ciph_ctx = rl->enc_ctx;
-
-    rl->md_ctx = EVP_MD_CTX_new();
-    if (rl->md_ctx == NULL) {
-        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
-        return OSSL_RECORD_RETURN_FATAL;
-    }
-
-    if ((md != NULL && EVP_DigestInit_ex(rl->md_ctx, md, NULL) <= 0)) {
-        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
-        return OSSL_RECORD_RETURN_FATAL;
-    }
-
-#ifndef OPENSSL_NO_COMP
-    if (comp != NULL) {
-        rl->compctx = COMP_CTX_new(comp);
-        if (rl->compctx == NULL) {
-            ERR_raise(ERR_LIB_SSL, SSL_R_COMPRESSION_LIBRARY_ERROR);
-            return OSSL_RECORD_RETURN_FATAL;
-        }
-    }
-#endif
-
-    if (!EVP_CipherInit_ex(ciph_ctx, ciph, NULL, key, iv, enc)) {
-        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
-        return OSSL_RECORD_RETURN_FATAL;
-    }
-
-    /*
-     * The cipher we actually ended up using in the EVP_CIPHER_CTX may be
-     * different to that in ciph if we have an ENGINE in use
-     */
-    if (EVP_CIPHER_get0_provider(EVP_CIPHER_CTX_get0_cipher(ciph_ctx)) != NULL
-        && !ossl_set_tls_provider_parameters(rl, ciph_ctx, ciph, md)) {
-        /* ERR_raise already called */
-        return OSSL_RECORD_RETURN_FATAL;
-    }
-
-    if (mackeylen > sizeof(rl->mac_secret)) {
-        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
-        return OSSL_RECORD_RETURN_FATAL;
-    }
-    memcpy(rl->mac_secret, mackey, mackeylen);
-
-    return OSSL_RECORD_RETURN_SUCCESS;
-}
-
-/*
- * ssl3_cipher encrypts/decrypts |n_recs| records in |inrecs|. Calls RLAYERfatal
- * on internal error, but not otherwise. It is the responsibility of the caller
- * to report a bad_record_mac
- *
- * Returns:
- *    0: if the record is publicly invalid, or an internal error
- *    1: Success or Mac-then-encrypt decryption failed (MAC will be randomised)
- */
-static int ssl3_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *inrecs,
-    size_t n_recs, int sending, SSL_MAC_BUF *mac,
-    size_t macsize)
-{
-    TLS_RL_RECORD *rec;
-    EVP_CIPHER_CTX *ds;
-    size_t l, i;
-    size_t bs;
-    const EVP_CIPHER *enc;
-    int provided;
-
-    rec = inrecs;
-    /*
-     * We shouldn't ever be called with more than one record in the SSLv3 case
-     */
-    if (n_recs != 1)
-        return 0;
-
-    ds = rl->enc_ctx;
-    if (ds == NULL || (enc = EVP_CIPHER_CTX_get0_cipher(ds)) == NULL)
-        return 0;
-
-    provided = (EVP_CIPHER_get0_provider(enc) != NULL);
-
-    l = rec->length;
-    bs = EVP_CIPHER_CTX_get_block_size(ds);
-
-    if (bs == 0)
-        return 0;
-
-    /* COMPRESS */
-
-    if ((bs != 1) && sending && !provided) {
-        /*
-         * We only do this for legacy ciphers. Provided ciphers add the
-         * padding on the provider side.
-         */
-        i = bs - (l % bs);
-
-        /* we need to add 'i-1' padding bytes */
-        l += i;
-        /*
-         * the last of these zero bytes will be overwritten with the
-         * padding length.
-         */
-        memset(&rec->input[rec->length], 0, i);
-        rec->length += i;
-        rec->input[l - 1] = (unsigned char)(i - 1);
-    }
-
-    if (!sending) {
-        if (l == 0 || l % bs != 0) {
-            /* Publicly invalid */
-            return 0;
-        }
-        /* otherwise, rec->length >= bs */
-    }
-
-    if (provided) {
-        int outlen;
-
-        if (!EVP_CipherUpdate(ds, rec->data, &outlen, rec->input,
-                (unsigned int)l))
-            return 0;
-        rec->length = outlen;
-
-        if (!sending && mac != NULL) {
-            /* Now get a pointer to the MAC */
-            OSSL_PARAM params[2], *p = params;
-
-            /* Get the MAC */
-            mac->alloced = 0;
-
-            *p++ = OSSL_PARAM_construct_octet_ptr(OSSL_CIPHER_PARAM_TLS_MAC,
-                (void **)&mac->mac,
-                macsize);
-            *p = OSSL_PARAM_construct_end();
-
-            if (!EVP_CIPHER_CTX_get_params(ds, params)) {
-                /* Shouldn't normally happen */
-                RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-                return 0;
-            }
-        }
-    } else {
-        if (EVP_Cipher(ds, rec->data, rec->input, (unsigned int)l) < 1) {
-            /* Shouldn't happen */
-            RLAYERfatal(rl, SSL_AD_BAD_RECORD_MAC, ERR_R_INTERNAL_ERROR);
-            return 0;
-        }
-
-        if (!sending)
-            return ssl3_cbc_remove_padding_and_mac(&rec->length,
-                rec->orig_len,
-                rec->data,
-                (mac != NULL) ? &mac->mac : NULL,
-                (mac != NULL) ? &mac->alloced : NULL,
-                bs,
-                macsize,
-                rl->libctx);
-    }
-
-    return 1;
-}
-
-static const unsigned char ssl3_pad_1[48] = {
-    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36
-};
-
-static const unsigned char ssl3_pad_2[48] = {
-    0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
-    0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
-    0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
-    0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
-    0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
-    0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c
-};
-
-static int ssl3_mac(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec, unsigned char *md,
-    int sending)
-{
-    unsigned char *mac_sec, *seq = rl->sequence;
-    const EVP_MD_CTX *hash;
-    unsigned char *p, rec_char;
-    size_t md_size;
-    size_t npad;
-    int t;
-
-    mac_sec = &(rl->mac_secret[0]);
-    hash = rl->md_ctx;
-
-    t = EVP_MD_CTX_get_size(hash);
-    if (t <= 0)
-        return 0;
-    md_size = t;
-    npad = (48 / md_size) * md_size;
-
-    if (!sending
-        && EVP_CIPHER_CTX_get_mode(rl->enc_ctx) == EVP_CIPH_CBC_MODE
-        && ssl3_cbc_record_digest_supported(hash)) {
-#ifdef OPENSSL_NO_DEPRECATED_3_0
-        return 0;
-#else
-        /*
-         * This is a CBC-encrypted record. We must avoid leaking any
-         * timing-side channel information about how many blocks of data we
-         * are hashing because that gives an attacker a timing-oracle.
-         */
-
-        /*-
-         * npad is, at most, 48 bytes and that's with MD5:
-         *   16 + 48 + 8 (sequence bytes) + 1 + 2 = 75.
-         *
-         * With SHA-1 (the largest hash speced for SSLv3) the hash size
-         * goes up 4, but npad goes down by 8, resulting in a smaller
-         * total size.
-         */
-        unsigned char header[75];
-        size_t j = 0;
-        memcpy(header + j, mac_sec, md_size);
-        j += md_size;
-        memcpy(header + j, ssl3_pad_1, npad);
-        j += npad;
-        memcpy(header + j, seq, 8);
-        j += 8;
-        header[j++] = rec->type;
-        header[j++] = (unsigned char)(rec->length >> 8);
-        header[j++] = (unsigned char)(rec->length & 0xff);
-
-        /* Final param == is SSLv3 */
-        if (ssl3_cbc_digest_record(EVP_MD_CTX_get0_md(hash),
-                md, &md_size,
-                header, rec->input,
-                rec->length, rec->orig_len,
-                mac_sec, md_size, 1)
-            <= 0)
-            return 0;
-#endif
-    } else {
-        unsigned int md_size_u;
-        /* Chop the digest off the end :-) */
-        EVP_MD_CTX *md_ctx = EVP_MD_CTX_new();
-
-        if (md_ctx == NULL)
-            return 0;
-
-        rec_char = rec->type;
-        p = md;
-        s2n(rec->length, p);
-        if (EVP_MD_CTX_copy_ex(md_ctx, hash) <= 0
-            || EVP_DigestUpdate(md_ctx, mac_sec, md_size) <= 0
-            || EVP_DigestUpdate(md_ctx, ssl3_pad_1, npad) <= 0
-            || EVP_DigestUpdate(md_ctx, seq, 8) <= 0
-            || EVP_DigestUpdate(md_ctx, &rec_char, 1) <= 0
-            || EVP_DigestUpdate(md_ctx, md, 2) <= 0
-            || EVP_DigestUpdate(md_ctx, rec->input, rec->length) <= 0
-            || EVP_DigestFinal_ex(md_ctx, md, NULL) <= 0
-            || EVP_MD_CTX_copy_ex(md_ctx, hash) <= 0
-            || EVP_DigestUpdate(md_ctx, mac_sec, md_size) <= 0
-            || EVP_DigestUpdate(md_ctx, ssl3_pad_2, npad) <= 0
-            || EVP_DigestUpdate(md_ctx, md, md_size) <= 0
-            || EVP_DigestFinal_ex(md_ctx, md, &md_size_u) <= 0) {
-            EVP_MD_CTX_free(md_ctx);
-            return 0;
-        }
-
-        EVP_MD_CTX_free(md_ctx);
-    }
-
-    if (!tls_increment_sequence_ctr(rl))
-        return 0;
-
-    return 1;
-}
-
-const struct record_functions_st ssl_3_0_funcs = {
-    ssl3_set_crypto_state,
-    ssl3_cipher,
-    ssl3_mac,
-    tls_default_set_protocol_version,
-    tls_default_read_n,
-    tls_get_more_records,
-    tls_default_validate_record_header,
-    tls_default_post_process_record,
-    tls_get_max_records_default,
-    tls_write_records_default,
-    /* These 2 functions are defined in tls1_meth.c */
-    tls1_allocate_write_buffers,
-    tls1_initialise_write_packets,
-    NULL,
-    tls_prepare_record_header_default,
-    NULL,
-    tls_prepare_for_encryption_default,
-    tls_post_encryption_processing_default,
-    NULL
-};
diff --git a/deps/openssl/openssl/ssl/record/methods/tls13_meth.c b/deps/openssl/openssl/ssl/record/methods/tls13_meth.c
index f35e0a5b4a3..8fea9f7292b 100644
--- a/deps/openssl/openssl/ssl/record/methods/tls13_meth.c
+++ b/deps/openssl/openssl/ssl/record/methods/tls13_meth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,9 +14,11 @@
 #include "recmethod_local.h"

 static int tls13_set_crypto_state(OSSL_RECORD_LAYER *rl, int level,
+    unsigned char *snkey,
     unsigned char *key, size_t keylen,
     unsigned char *iv, size_t ivlen,
     unsigned char *mackey, size_t mackeylen,
+    const EVP_CIPHER *snciph,
     const EVP_CIPHER *ciph,
     size_t taglen,
     int mactype,
@@ -69,17 +71,37 @@ static int tls13_set_crypto_state(OSSL_RECORD_LAYER *rl, int level,
     mode = EVP_CIPHER_get_mode(ciph);

     if (EVP_CipherInit_ex(ciph_ctx, ciph, NULL, NULL, NULL, enc) <= 0
-        || EVP_CIPHER_CTX_ctrl(ciph_ctx, EVP_CTRL_AEAD_SET_IVLEN, ivlen,
+        || EVP_CIPHER_CTX_ctrl(ciph_ctx, EVP_CTRL_AEAD_SET_IVLEN, (int)ivlen,
                NULL)
             <= 0
         || (mode == EVP_CIPH_CCM_MODE
-            && EVP_CIPHER_CTX_ctrl(ciph_ctx, EVP_CTRL_AEAD_SET_TAG, taglen,
+            && EVP_CIPHER_CTX_ctrl(ciph_ctx, EVP_CTRL_AEAD_SET_TAG, (int)taglen,
                    NULL)
                 <= 0)
         || EVP_CipherInit_ex(ciph_ctx, NULL, NULL, key, NULL, enc) <= 0) {
         ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
         return OSSL_RECORD_RETURN_FATAL;
     }
+
+    if (rl->isdtls && snciph != NULL) {
+        EVP_CIPHER_CTX *sn_ciph_ctx;
+
+        sn_ciph_ctx = rl->sn_enc_ctx = EVP_CIPHER_CTX_new();
+
+        if (sn_ciph_ctx == NULL) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            return OSSL_RECORD_RETURN_FATAL;
+        }
+
+        if (EVP_CIPHER_CTX_set_padding(sn_ciph_ctx, 0)
+            || EVP_CipherInit_ex(sn_ciph_ctx, snciph, NULL,
+                   snkey, NULL, 1)
+                <= 0) {
+            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+            return OSSL_RECORD_RETURN_FATAL;
+        }
+    }
+
 end:
     return OSSL_RECORD_RETURN_SUCCESS;
 }
@@ -91,10 +113,12 @@ static int tls13_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *recs,
     EVP_CIPHER_CTX *enc_ctx;
     unsigned char recheader[SSL3_RT_HEADER_LENGTH];
     unsigned char tag[EVP_MAX_MD_SIZE];
-    size_t nonce_len, offset, loop, hdrlen, taglen;
+    size_t nonce_len, offset, loop, hdrlen, taglen, exphdrlen;
+    int isdtls, sbit = 0, addlen;
     unsigned char *staticiv;
     unsigned char *nonce;
-    unsigned char *seq = rl->sequence;
+    unsigned char seq[SEQ_NUM_SIZE], *p_seq = seq;
+    uint64_t seqnum = 0;
     int lenu, lenf;
     TLS_RL_RECORD *rec = &recs[0];
     WPACKET wpkt;
@@ -111,6 +135,8 @@ static int tls13_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *recs,
     enc_ctx = rl->enc_ctx; /* enc_ctx is ignored when rl->mac_ctx != NULL */
     staticiv = rl->iv;
     nonce = rl->nonce;
+    isdtls = rl->isdtls;
+    l2n8(rl->sequence, p_seq);

     if (enc_ctx == NULL && rl->mac_ctx == NULL) {
         RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
@@ -118,17 +144,21 @@ static int tls13_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *recs,
     }

     /*
-     * If we're sending an alert and ctx != NULL then we must be forcing
-     * plaintext alerts. If we're reading and ctx != NULL then we allow
-     * plaintext alerts at certain points in the handshake. If we've got this
-     * far then we have already validated that a plaintext alert is ok here.
+     * Plaintext alerts are allowed only when explicitly enabled. DTLS needs
+     * this check here because it does not run the TLS header validator.
      */
     if (rec->type == SSL3_RT_ALERT) {
+        if (!rl->allow_plain_alerts)
+            return 0;
         memmove(rec->data, rec->input, rec->length);
         rec->input = rec->data;
         return 1;
     }

+    /* Keyed DTLS 1.3 layers accept only unified headers. */
+    if (isdtls && !DTLS13_UNI_HDR_FIX_BITS_IS_SET(rec->type))
+        return 0;
+
     /* For integrity-only ciphers, nonce_len is same as MAC size */
     if (rl->mac_ctx != NULL) {
         nonce_len = EVP_MAC_CTX_get_mac_size(rl->mac_ctx);
@@ -164,18 +194,57 @@ static int tls13_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *recs,
     for (loop = 0; loop < SEQ_NUM_SIZE; loop++)
         nonce[offset + loop] = staticiv[offset + loop] ^ seq[loop];

-    if (!tls_increment_sequence_ctr(rl)) {
+    if (!isdtls && !tls_increment_sequence_ctr(rl)) {
         /* RLAYERfatal already called */
         return 0;
     }

-    /* Set up the AAD */
+    /*-
+     * Set up the additional data as described in rfc8446 section 5.2:
+     *   "and the additional data input is the record header.
+     *   I.e.,
+     *      additional_data = TLSCiphertext.opaque_type ||
+     *                        TLSCiphertext.legacy_record_version ||
+     *                        TLSCiphertext.length"
+     * and in rfc1947 section 4:
+     *   "The entire header value shown in Figure 4 (but prior to record number
+     *   encryption; see Section 4.2.3) is used as the additional data value for
+     *   the AEAD function. For instance, if the minimal variant is used, the
+     *   Associated Data (AD) is 2 octets long."
+     *
+     *   For DTLS: at this point rec->type is just the first byte of the variable
+     *   header. So it is not an actual record type. The record type is set in
+     *   tls13_post_process_record() for incoming records.
+     */
+    if (isdtls) {
+        exphdrlen = dtls_get_rec_header_size(rec->type);
+        sbit = DTLS13_UNI_HDR_SEQ_BIT_IS_SET(rec->type);
+        addlen = DTLS13_UNI_HDR_LEN_BIT_IS_SET(rec->type);
+        /* Match the truncated value encoded in the unified header. */
+        seqnum = rl->sequence & DTLS13_UNI_HDR_SEQ_MASK(sbit ? 2 : 1);
+    } else {
+        exphdrlen = SSL3_RT_HEADER_LENGTH;
+        addlen = 1;
+    }
+
+    /*
+     * Reject unsupported CID before WPACKET setup so cleanup cannot touch
+     * an uninitialised packet.
+     */
+    if (isdtls && !ossl_assert(!DTLS13_UNI_HDR_CID_BIT_IS_SET(rec->type))) {
+        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+
     if (!WPACKET_init_static_len(&wpkt, recheader, sizeof(recheader), 0)
         || !WPACKET_put_bytes_u8(&wpkt, rec->type)
-        || !WPACKET_put_bytes_u16(&wpkt, rec->rec_version)
-        || !WPACKET_put_bytes_u16(&wpkt, rec->length + rl->taglen)
+        || (isdtls
+            && (sbit ? !WPACKET_put_bytes_u16(&wpkt, seqnum)
+                     : !WPACKET_put_bytes_u8(&wpkt, seqnum)))
+        || (!isdtls && !WPACKET_put_bytes_u16(&wpkt, rec->rec_version))
+        || (addlen && !WPACKET_put_bytes_u16(&wpkt, rec->length + rl->taglen))
         || !WPACKET_get_total_written(&wpkt, &hdrlen)
-        || hdrlen != SSL3_RT_HEADER_LENGTH
+        || hdrlen != exphdrlen
         || !WPACKET_finish(&wpkt)) {
         RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         WPACKET_cleanup(&wpkt);
@@ -187,7 +256,7 @@ static int tls13_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *recs,

         if ((mac_ctx = EVP_MAC_CTX_dup(rl->mac_ctx)) == NULL
             || !EVP_MAC_update(mac_ctx, nonce, nonce_len)
-            || !EVP_MAC_update(mac_ctx, recheader, sizeof(recheader))
+            || !EVP_MAC_update(mac_ctx, recheader, hdrlen)
             || !EVP_MAC_update(mac_ctx, rec->input, rec->length)
             || !EVP_MAC_final(mac_ctx, tag, &taglen, rl->taglen)) {
             RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
@@ -216,7 +285,7 @@ static int tls13_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *recs,
     mode = EVP_CIPHER_get_mode(cipher);

     if (EVP_CipherInit_ex(enc_ctx, NULL, NULL, NULL, nonce, sending) <= 0
-        || (!sending && EVP_CIPHER_CTX_ctrl(enc_ctx, EVP_CTRL_AEAD_SET_TAG, rl->taglen, rec->data + rec->length) <= 0)) {
+        || (!sending && EVP_CIPHER_CTX_ctrl(enc_ctx, EVP_CTRL_AEAD_SET_TAG, (int)rl->taglen, rec->data + rec->length) <= 0)) {
         RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return 0;
     }
@@ -226,22 +295,16 @@ static int tls13_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *recs,
      * any AAD.
      */
     if ((mode == EVP_CIPH_CCM_MODE
-            && EVP_CipherUpdate(enc_ctx, NULL, &lenu, NULL,
-                   (unsigned int)rec->length)
-                <= 0)
-        || EVP_CipherUpdate(enc_ctx, NULL, &lenu, recheader,
-               sizeof(recheader))
-            <= 0
-        || EVP_CipherUpdate(enc_ctx, rec->data, &lenu, rec->input,
-               (unsigned int)rec->length)
-            <= 0
+            && EVP_CipherUpdate(enc_ctx, NULL, &lenu, NULL, (int)rec->length) <= 0)
+        || EVP_CipherUpdate(enc_ctx, NULL, &lenu, recheader, (int)hdrlen) <= 0
+        || EVP_CipherUpdate(enc_ctx, rec->data, &lenu, rec->input, (int)rec->length) <= 0
         || EVP_CipherFinal_ex(enc_ctx, rec->data + lenu, &lenf) <= 0
-        || (size_t)(lenu + lenf) != rec->length) {
+        || (size_t)lenu + lenf != rec->length) {
         return 0;
     }
     if (sending) {
         /* Add the tag */
-        if (EVP_CIPHER_CTX_ctrl(enc_ctx, EVP_CTRL_AEAD_GET_TAG, rl->taglen,
+        if (EVP_CIPHER_CTX_ctrl(enc_ctx, EVP_CTRL_AEAD_GET_TAG, (int)rl->taglen,
                 rec->data + rec->length)
             <= 0) {
             RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
@@ -284,7 +347,9 @@ static int tls13_post_process_record(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec)
         size_t end;

         if (rec->length == 0
-            || rec->type != SSL3_RT_APPLICATION_DATA) {
+            || (rl->isdtls
+                    ? !DTLS13_UNI_HDR_FIX_BITS_IS_SET(rec->type)
+                    : rec->type != SSL3_RT_APPLICATION_DATA)) {
             RLAYERfatal(rl, SSL_AD_UNEXPECTED_MESSAGE,
                 SSL_R_BAD_RECORD_TYPE);
             return 0;
@@ -322,6 +387,15 @@ static uint8_t tls13_get_record_type(OSSL_RECORD_LAYER *rl,
      * when encrypting in TLSv1.3. The "inner" record type encodes the "real"
      * record type from the template.
      */
+    if (rl->isdtls) {
+        const unsigned char fixed = DTLS13_UNI_HDR_FIX_BITS;
+        const unsigned char sbit = DTLS13_UNI_HDR_SEQ_BIT;
+        const unsigned char lbit = DTLS13_UNI_HDR_LEN_BIT;
+        const unsigned char epochbits = DTLS13_UNI_HDR_EPOCH_BITS_MASK & rl->epoch;
+
+        return fixed | sbit | lbit | epochbits;
+    }
+
     return SSL3_RT_APPLICATION_DATA;
 }

@@ -331,6 +405,10 @@ static int tls13_add_record_padding(OSSL_RECORD_LAYER *rl,
     TLS_RL_RECORD *thiswr)
 {
     size_t rlen;
+    size_t max_frag_len = rl->max_frag_len;
+    int isdtls = rl->isdtls;
+    size_t mac_size = 0;
+    size_t taglen = rl->taglen;

     /* Nothing to be done in the case of a plaintext alert */
     if (rl->allow_plain_alerts && thistempl->type != SSL3_RT_ALERT)
@@ -342,11 +420,14 @@ static int tls13_add_record_padding(OSSL_RECORD_LAYER *rl,
     }
     TLS_RL_RECORD_add_length(thiswr, 1);

+    if (rl->isdtls && rl->curr_mtu != 0 && rl->curr_mtu < max_frag_len)
+        max_frag_len = rl->curr_mtu;
+
     /* Add TLS1.3 padding */
     rlen = TLS_RL_RECORD_get_length(thiswr);
-    if (rlen < rl->max_frag_len) {
+    if (rlen < max_frag_len) {
         size_t padding = 0;
-        size_t max_padding = rl->max_frag_len - rlen;
+        size_t max_padding = max_frag_len - rlen;

         /*
          * We might want to change the "else if" below so that
@@ -394,6 +475,19 @@ static int tls13_add_record_padding(OSSL_RECORD_LAYER *rl,
                     padding = bp - remainder;
             }
         }
+
+        /*
+         * DTLS1.3 RFC 9147 Section 4.2.3 says records should be padded
+         * if the ciphertext is less than 16 bytes.
+         */
+        if (isdtls) {
+            if (rl->mac_ctx != NULL)
+                mac_size = EVP_MAC_CTX_get_mac_size(rl->mac_ctx);
+
+            if (padding + rlen + taglen + mac_size < DTLS13_CIPHERTEXT_MINSIZE)
+                padding += DTLS13_CIPHERTEXT_MINSIZE - (padding + rlen + taglen + mac_size);
+        }
+
         if (padding > 0) {
             /* do not allow the record to exceed max plaintext length */
             if (padding > max_padding)
@@ -430,3 +524,28 @@ const struct record_functions_st tls_1_3_funcs = {
     tls_post_encryption_processing_default,
     NULL
 };
+
+const struct record_functions_st dtls_1_3_funcs = {
+    tls13_set_crypto_state,
+    tls13_cipher,
+    NULL,
+    tls_default_set_protocol_version,
+    tls_default_read_n,
+    dtls_get_more_records,
+    /*
+     * Keep this NULL: the TLS validator raises fatal errors, while DTLS must
+     * silently discard invalid records (RFC 9147 section 4.5.2).
+     */
+    NULL,
+    tls13_post_process_record,
+    NULL,
+    tls_write_records_default,
+    tls_allocate_write_buffers_default,
+    tls_initialise_write_packets_default,
+    tls13_get_record_type,
+    dtls_prepare_record_header,
+    tls13_add_record_padding,
+    tls_prepare_for_encryption_default,
+    dtls_post_encryption_processing,
+    NULL
+};
diff --git a/deps/openssl/openssl/ssl/record/methods/tls1_meth.c b/deps/openssl/openssl/ssl/record/methods/tls1_meth.c
index 10f4d241133..6c98e73783c 100644
--- a/deps/openssl/openssl/ssl/record/methods/tls1_meth.c
+++ b/deps/openssl/openssl/ssl/record/methods/tls1_meth.c
@@ -17,9 +17,11 @@
 #include "recmethod_local.h"

 static int tls1_set_crypto_state(OSSL_RECORD_LAYER *rl, int level,
+    unsigned char *snkey,
     unsigned char *key, size_t keylen,
     unsigned char *iv, size_t ivlen,
     unsigned char *mackey, size_t mackeylen,
+    const EVP_CIPHER *snciph,
     const EVP_CIPHER *ciph,
     size_t taglen,
     int mactype,
@@ -28,6 +30,7 @@ static int tls1_set_crypto_state(OSSL_RECORD_LAYER *rl, int level,
 {
     EVP_CIPHER_CTX *ciph_ctx;
     EVP_PKEY *mac_key;
+    OSSL_PARAM params[2], *p = params;
     int enc = (rl->direction == OSSL_RECORD_DIRECTION_WRITE) ? 1 : 0;

     if (level != OSSL_RECORD_PROTECTION_LEVEL_APPLICATION)
@@ -73,10 +76,21 @@ static int tls1_set_crypto_state(OSSL_RECORD_LAYER *rl, int level,
             mac_key = EVP_PKEY_new_mac_key(mactype, NULL, mackey,
                 (int)mackeylen);
         }
+
+        /*
+         * We want the underlying mac to use our passed property query when allocating
+         * its internal digest as well
+         */
+        if (rl->propq != NULL)
+            *p++ = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_PROPERTIES,
+                (char *)rl->propq, 0);
+
+        *p = OSSL_PARAM_construct_end();
+
         if (mac_key == NULL
             || EVP_DigestSignInit_ex(rl->md_ctx, NULL, EVP_MD_get0_name(md),
                    rl->libctx, rl->propq, mac_key,
-                   NULL)
+                   params)
                 <= 0) {
             EVP_PKEY_free(mac_key);
             ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
@@ -124,10 +138,6 @@ static int tls1_set_crypto_state(OSSL_RECORD_LAYER *rl, int level,
         return OSSL_RECORD_RETURN_FATAL;
     }

-    /*
-     * The cipher we actually ended up using in the EVP_CIPHER_CTX may be
-     * different to that in ciph if we have an ENGINE in use
-     */
     if (EVP_CIPHER_get0_provider(EVP_CIPHER_CTX_get0_cipher(ciph_ctx)) != NULL
         && !ossl_set_tls_provider_parameters(rl, ciph_ctx, ciph, md)) {
         /* ERR_raise already called */
@@ -159,6 +169,31 @@ static int tls1_set_crypto_state(OSSL_RECORD_LAYER *rl, int level,
     return OSSL_RECORD_RETURN_SUCCESS;
 }

+static int setup_record_header(const OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec,
+    unsigned char *buf, size_t buflen)
+{
+    WPACKET hdr;
+    size_t hdrsize;
+
+    if (buflen < EVP_AEAD_TLS1_AAD_LEN)
+        return 0;
+    if (!WPACKET_init_static_len(&hdr, buf, EVP_AEAD_TLS1_AAD_LEN, 0)
+        || (rl->isdtls && !WPACKET_put_bytes_u16(&hdr, rl->epoch))
+        || (rl->isdtls ? !WPACKET_put_bytes_u48(&hdr, rl->sequence)
+                       : !WPACKET_put_bytes_u64(&hdr, rl->sequence))
+        || !WPACKET_put_bytes_u8(&hdr, rec->type)
+        || !WPACKET_put_bytes_u16(&hdr, rl->version)
+        || !WPACKET_put_bytes_u16(&hdr, rec->length)
+        || !WPACKET_finish(&hdr)
+        || !WPACKET_get_total_written(&hdr, &hdrsize)
+        || hdrsize != EVP_AEAD_TLS1_AAD_LEN) {
+        WPACKET_cleanup(&hdr);
+        return 0;
+    }
+
+    return 1;
+}
+
 #define MAX_PADDING 256
 /*-
  * tls1_cipher encrypts/decrypts |n_recs| in |recs|. Calls RLAYERfatal on
@@ -178,10 +213,10 @@ static int tls1_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *recs,
     size_t reclen[SSL_MAX_PIPELINES];
     unsigned char buf[SSL_MAX_PIPELINES][EVP_AEAD_TLS1_AAD_LEN];
     unsigned char *data[SSL_MAX_PIPELINES];
-    int pad = 0, tmpr, provided;
-    size_t bs, ctr, padnum, loop;
-    unsigned char padval;
+    int pad = 0;
+    size_t bs, ctr;
     const EVP_CIPHER *enc;
+    int outlen;

     if (n_recs == 0) {
         RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
@@ -232,8 +267,6 @@ static int tls1_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *recs,
         return 0;
     }

-    provided = (EVP_CIPHER_get0_provider(enc) != NULL);
-
     bs = EVP_CIPHER_get_block_size(EVP_CIPHER_CTX_get0_cipher(ds));

     if (bs == 0) {
@@ -259,37 +292,25 @@ static int tls1_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *recs,
         if ((EVP_CIPHER_get_flags(EVP_CIPHER_CTX_get0_cipher(ds))
                 & EVP_CIPH_FLAG_AEAD_CIPHER)
             != 0) {
-            unsigned char *seq;
-
             /*
              * Publicly invalid: the record is shorter than the mandatory
-             * AEAD overhead. Leave alert handling to the caller so TLS
-             * reports bad_record_mac and DTLS silently discards the record.
+             * AEAD overhead (explicit IV plus authentication tag). Leave
+             * alert handling to the caller so TLS reports bad_record_mac
+             * and DTLS silently discards the record.
              */
             if (!sending && reclen[ctr] < rl->eivlen + rl->taglen)
                 return 0;

-            seq = rl->sequence;
-
-            if (rl->isdtls) {
-                unsigned char dtlsseq[8], *p = dtlsseq;
+            if (!setup_record_header(rl, &recs[ctr], buf[ctr], sizeof(buf[ctr]))) {
+                RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return 0;
+            }

-                s2n(rl->epoch, p);
-                memcpy(p, &seq[2], 6);
-                memcpy(buf[ctr], dtlsseq, 8);
-            } else {
-                memcpy(buf[ctr], seq, 8);
-                if (!tls_increment_sequence_ctr(rl)) {
-                    /* RLAYERfatal already called */
-                    return 0;
-                }
+            if (!rl->isdtls && !tls_increment_sequence_ctr(rl)) {
+                /* RLAYERfatal already called */
+                return 0;
             }

-            buf[ctr][8] = recs[ctr].type;
-            buf[ctr][9] = (unsigned char)(rl->version >> 8);
-            buf[ctr][10] = (unsigned char)(rl->version);
-            buf[ctr][11] = (unsigned char)(recs[ctr].length >> 8);
-            buf[ctr][12] = (unsigned char)(recs[ctr].length & 0xff);
             pad = EVP_CIPHER_CTX_ctrl(ds, EVP_CTRL_AEAD_TLS1_AAD,
                 EVP_AEAD_TLS1_AAD_LEN, buf[ctr]);
             if (pad <= 0) {
@@ -301,25 +322,6 @@ static int tls1_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *recs,
                 reclen[ctr] += pad;
                 recs[ctr].length += pad;
             }
-        } else if ((bs != 1) && sending && !provided) {
-            /*
-             * We only do this for legacy ciphers. Provided ciphers add the
-             * padding on the provider side.
-             */
-            padnum = bs - (reclen[ctr] % bs);
-
-            /* Add weird padding of up to 256 bytes */
-
-            if (padnum > MAX_PADDING) {
-                RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-                return 0;
-            }
-            /* we need to add 'padnum' padding bytes of value padval */
-            padval = (unsigned char)(padnum - 1);
-            for (loop = reclen[ctr]; loop < reclen[ctr] + padnum; loop++)
-                recs[ctr].input[loop] = padval;
-            reclen[ctr] += padnum;
-            recs[ctr].length += padnum;
         }

         if (!sending) {
@@ -357,6 +359,9 @@ static int tls1_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *recs,

     if (!rl->isdtls && rl->tlstree) {
         int decrement_seq = 0;
+        unsigned char recseq[SEQ_NUM_SIZE], *p_recseq = recseq;
+
+        l2n8(rl->sequence, p_recseq);

         /*
          * When sending, seq is incremented after MAC calculation.
@@ -366,136 +371,79 @@ static int tls1_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *recs,
         if (sending && !rl->use_etm)
             decrement_seq = 1;

-        if (EVP_CIPHER_CTX_ctrl(ds, EVP_CTRL_TLSTREE, decrement_seq,
-                rl->sequence)
-            <= 0) {
-
+        if (EVP_CIPHER_CTX_ctrl(ds, EVP_CTRL_TLSTREE, decrement_seq, recseq) <= 0) {
             RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             return 0;
         }
     }

-    if (provided) {
-        int outlen;
-
-        /* Provided cipher - we do not support pipelining on this path */
-        if (n_recs > 1) {
-            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            return 0;
-        }
-
-        if (!EVP_CipherUpdate(ds, recs[0].data, &outlen, recs[0].input,
-                (unsigned int)reclen[0]))
-            return 0;
-        recs[0].length = outlen;
-
-        /*
-         * The length returned from EVP_CipherUpdate above is the actual
-         * payload length. We need to adjust the data/input ptr to skip over
-         * any explicit IV
-         */
-        if (!sending) {
-            if (EVP_CIPHER_get_mode(enc) == EVP_CIPH_GCM_MODE) {
-                recs[0].data += EVP_GCM_TLS_EXPLICIT_IV_LEN;
-                recs[0].input += EVP_GCM_TLS_EXPLICIT_IV_LEN;
-            } else if (EVP_CIPHER_get_mode(enc) == EVP_CIPH_CCM_MODE) {
-                recs[0].data += EVP_CCM_TLS_EXPLICIT_IV_LEN;
-                recs[0].input += EVP_CCM_TLS_EXPLICIT_IV_LEN;
-            } else if (bs != 1 && RLAYER_USE_EXPLICIT_IV(rl)) {
-                recs[0].data += bs;
-                recs[0].input += bs;
-                recs[0].orig_len -= bs;
-            }
-
-            /* Now get a pointer to the MAC (if applicable) */
-            if (macs != NULL) {
-                OSSL_PARAM params[2], *p = params;
-
-                /* Get the MAC */
-                macs[0].alloced = 0;
+    /* Provided cipher - we do not support pipelining on this path */
+    if (n_recs > 1) {
+        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }

-                *p++ = OSSL_PARAM_construct_octet_ptr(OSSL_CIPHER_PARAM_TLS_MAC,
-                    (void **)&macs[0].mac,
-                    macsize);
-                *p = OSSL_PARAM_construct_end();
+    if (!EVP_CipherUpdate(ds, recs[0].data, &outlen, recs[0].input,
+            (int)reclen[0]))
+        return 0;
+    recs[0].length = outlen;

-                if (!EVP_CIPHER_CTX_get_params(ds, params)) {
-                    /* Shouldn't normally happen */
-                    RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR,
-                        ERR_R_INTERNAL_ERROR);
-                    return 0;
-                }
-            }
+    /*
+     * The length returned from EVP_CipherUpdate above is the actual
+     * payload length. We need to adjust the data/input ptr to skip over
+     * any explicit IV
+     */
+    if (!sending) {
+        if (EVP_CIPHER_get_mode(enc) == EVP_CIPH_GCM_MODE) {
+            recs[0].data += EVP_GCM_TLS_EXPLICIT_IV_LEN;
+            recs[0].input += EVP_GCM_TLS_EXPLICIT_IV_LEN;
+        } else if (EVP_CIPHER_get_mode(enc) == EVP_CIPH_CCM_MODE) {
+            recs[0].data += EVP_CCM_TLS_EXPLICIT_IV_LEN;
+            recs[0].input += EVP_CCM_TLS_EXPLICIT_IV_LEN;
+        } else if (bs != 1 && RLAYER_USE_EXPLICIT_IV(rl)) {
+            recs[0].data += bs;
+            recs[0].input += bs;
+            recs[0].orig_len -= bs;
         }
-    } else {
-        /* Legacy cipher */

-        tmpr = EVP_Cipher(ds, recs[0].data, recs[0].input,
-            (unsigned int)reclen[0]);
-        if ((EVP_CIPHER_get_flags(EVP_CIPHER_CTX_get0_cipher(ds))
-                & EVP_CIPH_FLAG_CUSTOM_CIPHER)
-                    != 0
-                ? (tmpr < 0)
-                : (tmpr == 0)) {
-            /* AEAD can fail to verify MAC */
-            return 0;
-        }
+        /* Now get a pointer to the MAC (if applicable) */
+        if (macs != NULL) {
+            OSSL_PARAM params[2], *p = params;

-        if (!sending) {
-            for (ctr = 0; ctr < n_recs; ctr++) {
-                /* Adjust the record to remove the explicit IV/MAC/Tag */
-                if (EVP_CIPHER_get_mode(enc) == EVP_CIPH_GCM_MODE) {
-                    recs[ctr].data += EVP_GCM_TLS_EXPLICIT_IV_LEN;
-                    recs[ctr].input += EVP_GCM_TLS_EXPLICIT_IV_LEN;
-                    recs[ctr].length -= EVP_GCM_TLS_EXPLICIT_IV_LEN;
-                } else if (EVP_CIPHER_get_mode(enc) == EVP_CIPH_CCM_MODE) {
-                    recs[ctr].data += EVP_CCM_TLS_EXPLICIT_IV_LEN;
-                    recs[ctr].input += EVP_CCM_TLS_EXPLICIT_IV_LEN;
-                    recs[ctr].length -= EVP_CCM_TLS_EXPLICIT_IV_LEN;
-                } else if (bs != 1 && RLAYER_USE_EXPLICIT_IV(rl)) {
-                    if (recs[ctr].length < bs)
-                        return 0;
-                    recs[ctr].data += bs;
-                    recs[ctr].input += bs;
-                    recs[ctr].length -= bs;
-                    recs[ctr].orig_len -= bs;
-                }
+            /* Get the MAC */
+            macs[0].alloced = 0;

-                /*
-                 * If using Mac-then-encrypt, then this will succeed but
-                 * with a random MAC if padding is invalid
-                 */
-                if (!tls1_cbc_remove_padding_and_mac(&recs[ctr].length,
-                        recs[ctr].orig_len,
-                        recs[ctr].data,
-                        (macs != NULL) ? &macs[ctr].mac : NULL,
-                        (macs != NULL) ? &macs[ctr].alloced
-                                       : NULL,
-                        bs,
-                        pad ? (size_t)pad : macsize,
-                        (EVP_CIPHER_get_flags(enc)
-                            & EVP_CIPH_FLAG_AEAD_CIPHER)
-                            != 0,
-                        rl->libctx))
-                    return 0;
+            *p++ = OSSL_PARAM_construct_octet_ptr(OSSL_CIPHER_PARAM_TLS_MAC,
+                (void **)&macs[0].mac,
+                macsize);
+            *p = OSSL_PARAM_construct_end();
+
+            if (!EVP_CIPHER_CTX_get_params(ds, params)) {
+                /* Shouldn't normally happen */
+                RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR,
+                    ERR_R_INTERNAL_ERROR);
+                return 0;
             }
         }
     }
+
     return 1;
 }

 static int tls1_mac(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec, unsigned char *md,
     int sending)
 {
-    unsigned char *seq = rl->sequence;
+    unsigned char seq[SEQ_NUM_SIZE], *p_seq = seq;
     EVP_MD_CTX *hash;
     size_t md_size;
     EVP_MD_CTX *hmac = NULL, *mac_ctx;
+    EVP_PKEY_CTX *pkctx;
     unsigned char header[13];
     int t;
     int ret = 0;

     hash = rl->md_ctx;
+    l2n8(rl->sequence, p_seq);

     t = EVP_MD_CTX_get_size(hash);
     if (!ossl_assert(t >= 0))
@@ -517,22 +465,8 @@ static int tls1_mac(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec, unsigned char *md
         && EVP_MD_CTX_ctrl(mac_ctx, EVP_MD_CTRL_TLSTREE, 0, seq) <= 0)
         goto end;

-    if (rl->isdtls) {
-        unsigned char dtlsseq[8], *p = dtlsseq;
-
-        s2n(rl->epoch, p);
-        memcpy(p, &seq[2], 6);
-
-        memcpy(header, dtlsseq, 8);
-    } else {
-        memcpy(header, seq, 8);
-    }
-
-    header[8] = rec->type;
-    header[9] = (unsigned char)(rl->version >> 8);
-    header[10] = (unsigned char)(rl->version);
-    header[11] = (unsigned char)(rec->length >> 8);
-    header[12] = (unsigned char)(rec->length & 0xff);
+    if (!setup_record_header(rl, rec, header, sizeof(header)))
+        goto end;

     if (!sending && !rl->use_etm
         && EVP_CIPHER_CTX_get_mode(rl->enc_ctx) == EVP_CIPH_CBC_MODE
@@ -543,8 +477,13 @@ static int tls1_mac(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec, unsigned char *md
             &rec->orig_len);
         *p++ = OSSL_PARAM_construct_end();

-        if (!EVP_PKEY_CTX_set_params(EVP_MD_CTX_get_pkey_ctx(mac_ctx),
-                tls_hmac_params))
+        pkctx = EVP_MD_CTX_get_pkey_ctx(mac_ctx);
+        if (pkctx == NULL) {
+            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            goto end;
+        }
+
+        if (!EVP_PKEY_CTX_set_params(pkctx, tls_hmac_params))
             goto end;
     }

@@ -558,7 +497,7 @@ static int tls1_mac(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec, unsigned char *md
         BIO_printf(trc_out, "seq:\n");
         BIO_dump_indent(trc_out, seq, 8, 4);
         BIO_printf(trc_out, "rec:\n");
-        BIO_dump_indent(trc_out, rec->data, rec->length, 4);
+        BIO_dump_indent(trc_out, rec->data, (int)rec->length, 4);
     }
     OSSL_TRACE_END(TLS);

@@ -570,7 +509,7 @@ static int tls1_mac(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec, unsigned char *md
     OSSL_TRACE_BEGIN(TLS)
     {
         BIO_printf(trc_out, "md:\n");
-        BIO_dump_indent(trc_out, md, md_size, 4);
+        BIO_dump_indent(trc_out, md, (int)md_size, 4);
     }
     OSSL_TRACE_END(TLS);
     ret = 1;
@@ -601,7 +540,6 @@ end:
 #endif /* OPENSSL_NO_COMP */
 #endif

-/* This function is also used by the SSLv3 implementation */
 int tls1_allocate_write_buffers(OSSL_RECORD_LAYER *rl,
     OSSL_RECORD_TEMPLATE *templates,
     size_t numtempl, size_t *prefix)
@@ -623,7 +561,6 @@ int tls1_allocate_write_buffers(OSSL_RECORD_LAYER *rl,
     return 1;
 }

-/* This function is also used by the SSLv3 implementation */
 int tls1_initialise_write_packets(OSSL_RECORD_LAYER *rl,
     OSSL_RECORD_TEMPLATE *templates,
     size_t numtempl,
@@ -651,12 +588,7 @@ int tls1_initialise_write_packets(OSSL_RECORD_LAYER *rl,
         prefixtempl->type = SSL3_RT_APPLICATION_DATA;

         wb = &bufs[0];
-
-#if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD != 0
-        align = (size_t)TLS_BUFFER_get_buf(wb) + SSL3_RT_HEADER_LENGTH;
-        align = SSL3_ALIGN_PAYLOAD - 1
-            - ((align - 1) % SSL3_ALIGN_PAYLOAD);
-#endif
+        align = tls_get_record_body_alignment_offset(rl, TLS_BUFFER_get_buf(wb));
         TLS_BUFFER_set_offset(wb, align);

         if (!WPACKET_init_static_len(&pkt[0], TLS_BUFFER_get_buf(wb),
diff --git a/deps/openssl/openssl/ssl/record/methods/tls_common.c b/deps/openssl/openssl/ssl/record/methods/tls_common.c
index e00ad084cbd..5541b49feb2 100644
--- a/deps/openssl/openssl/ssl/record/methods/tls_common.c
+++ b/deps/openssl/openssl/ssl/record/methods/tls_common.c
@@ -17,6 +17,7 @@
 #include "internal/e_os.h"
 #include "internal/packet.h"
 #include "internal/ssl3_cbc.h"
+#include "internal/dtls_record_rx.h"
 #include "../../ssl_local.h"
 #include "../record_local.h"
 #include "recmethod_local.h"
@@ -39,12 +40,6 @@ static void TLS_RL_RECORD_release(TLS_RL_RECORD *r, size_t num_recs)
     }
 }

-void ossl_tls_rl_record_set_seq_num(TLS_RL_RECORD *r,
-    const unsigned char *seq_num)
-{
-    memcpy(r->seq_num, seq_num, SEQ_NUM_SIZE);
-}
-
 void ossl_rlayer_fatal(OSSL_RECORD_LAYER *rl, int al, int reason,
     const char *fmt, ...)
 {
@@ -148,15 +143,13 @@ int tls_setup_write_buffer(OSSL_RECORD_LAYER *rl, size_t numwpipes,
     size_t currpipe;
     size_t defltlen = 0;
     size_t contenttypelen = 0;
+    const int version1_3 = rl->isdtls ? DTLS1_3_VERSION : TLS1_3_VERSION;

     if (firstlen == 0 || (numwpipes > 1 && nextlen == 0)) {
-        if (rl->isdtls)
-            headerlen = DTLS1_RT_HEADER_LENGTH + 1;
-        else
-            headerlen = SSL3_RT_HEADER_LENGTH;
+        headerlen = tls_get_record_header_len(rl);

-        /* TLSv1.3 adds an extra content type byte after payload data */
-        if (rl->version == TLS1_3_VERSION)
+        /* (D)TLSv1.3 adds an extra content type byte after payload data */
+        if (rl->version == version1_3)
             contenttypelen = 1;

 #if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD != 0
@@ -234,10 +227,7 @@ int tls_setup_read_buffer(OSSL_RECORD_LAYER *rl)

     b = &rl->rbuf;

-    if (rl->isdtls)
-        headerlen = DTLS1_RT_HEADER_LENGTH;
-    else
-        headerlen = SSL3_RT_HEADER_LENGTH;
+    headerlen = tls_get_record_header_len(rl);

 #if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD != 0
     maxalign = SSL3_ALIGN_PAYLOAD - 1;
@@ -274,15 +264,18 @@ int tls_setup_read_buffer(OSSL_RECORD_LAYER *rl)
     return 1;
 }

-static int tls_release_read_buffer(OSSL_RECORD_LAYER *rl)
+int tls_release_read_buffer(OSSL_RECORD_LAYER *rl)
 {
     TLS_BUFFER *b;

     b = &rl->rbuf;
+    if (b->buf == NULL)
+        return 1;
     if ((rl->options & SSL_OP_CLEANSE_PLAINTEXT) != 0)
         OPENSSL_cleanse(b->buf, b->len);
     OPENSSL_free(b->buf);
     b->buf = NULL;
+    b->len = 0;
     rl->packet = NULL;
     rl->packet_length = 0;
     return 1;
@@ -402,8 +395,44 @@ int tls_default_read_n(OSSL_RECORD_LAYER *rl, size_t n, size_t max, int extend,
          */

         clear_sys_error();
-        if (bio != NULL) {
-            ret = BIO_read(bio, pkt + len + left, max - left);
+
+        /*
+         * For listener-based connections, read from the packet queue instead
+         * of the BIO. These connections are identified by having peer set and
+         * a get_packet callback.
+         *
+         * However, we must first check rl->prev for buffered records from
+         * a previous epoch's record layer.
+         */
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+        if (rl->isdtls && rl->use_urxe
+            && rl->prev == NULL && rl->get_urxe_packet != NULL) {
+            unsigned char *pkt_data = NULL;
+            size_t pkt_len = 0;
+            void *pkt_handle = NULL;
+
+            if (rl->get_urxe_packet(rl->cbarg, &pkt_data, &pkt_len, &pkt_handle)) {
+                size_t urxe_data_read = pkt_len;
+
+                if (urxe_data_read > max - left)
+                    urxe_data_read = max - left;
+
+                /* TODO: DTLS1.3 QUIC avoids the copy can we avoid the copy here */
+                memcpy(pkt + len + left, pkt_data, urxe_data_read);
+                bioread = urxe_data_read;
+                ret = OSSL_RECORD_RETURN_SUCCESS;
+
+                /* Release packet back via callback */
+                if (rl->release_urxe_packet != NULL)
+                    rl->release_urxe_packet(rl->cbarg, pkt_handle);
+            } else {
+                /* No packets available */
+                ret = OSSL_RECORD_RETURN_RETRY;
+            }
+        } else
+#endif
+            if (bio != NULL) {
+            ret = BIO_read(bio, pkt + len + left, (int)(max - left));
             if (ret > 0) {
                 bioread = ret;
                 ret = OSSL_RECORD_RETURN_SUCCESS;
@@ -526,8 +555,6 @@ static int rlayer_early_data_count_ok(OSSL_RECORD_LAYER *rl, size_t length,
  */
 #define MAX_EMPTY_RECORDS 32

-#define SSL2_RT_HEADER_LENGTH 2
-
 /*-
  * Call this to buffer new input records in rl->rrec.
  * It will return a OSSL_RECORD_RETURN_* value.
@@ -553,7 +580,7 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl)
     size_t mac_size = 0;
     int imac_size;
     size_t num_recs = 0, max_recs, j;
-    PACKET pkt, sslv2pkt;
+    PACKET pkt;
     SSL_MAC_BUF *macbufs = NULL;
     int ret = OSSL_RECORD_RETURN_FATAL;

@@ -576,7 +603,6 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl)

         /* check if we have the header */
         if ((rl->rstate != SSL_ST_READ_BODY) || (rl->packet_length < SSL3_RT_HEADER_LENGTH)) {
-            size_t sslv2len;
             unsigned int type;

             rret = rl->funcs->read_n(rl, SSL3_RT_HEADER_LENGTH,
@@ -593,84 +619,31 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl)
                 RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
                 return OSSL_RECORD_RETURN_FATAL;
             }
-            sslv2pkt = pkt;
-            if (!PACKET_get_net_2_len(&sslv2pkt, &sslv2len)
-                || !PACKET_get_1(&sslv2pkt, &type)) {
+
+            /* Pull apart the header into the TLS_RL_RECORD */
+            if (!PACKET_get_1(&pkt, &type)
+                || !PACKET_get_net_2(&pkt, &version)
+                || !PACKET_get_net_2_len(&pkt, &thisrr->length)) {
+                if (rl->msg_callback != NULL)
+                    rl->msg_callback(0, 0, SSL3_RT_HEADER, p, SSL3_RT_HEADER_LENGTH, rl->cbarg);
                 RLAYERfatal(rl, SSL_AD_DECODE_ERROR, ERR_R_INTERNAL_ERROR);
                 return OSSL_RECORD_RETURN_FATAL;
             }
-            /*
-             * The first record received by the server may be a V2ClientHello.
-             */
-            if (rl->role == OSSL_RECORD_ROLE_SERVER
-                && rl->is_first_record
-                && (sslv2len & 0x8000) != 0
-                && (type == SSL2_MT_CLIENT_HELLO)) {
-                /*
-                 *  SSLv2 style record
-                 *
-                 * |num_recs| here will actually always be 0 because
-                 * |num_recs > 0| only ever occurs when we are processing
-                 * multiple app data records - which we know isn't the case here
-                 * because it is an SSLv2ClientHello. We keep it using
-                 * |num_recs| for the sake of consistency
-                 */
-                thisrr->type = SSL3_RT_HANDSHAKE;
-                thisrr->rec_version = SSL2_VERSION;
-
-                thisrr->length = sslv2len & 0x7fff;
-
-                if (!rl->funcs->validate_record_header(rl, thisrr)) {
-                    /* RLAYERfatal already called */
-                    return OSSL_RECORD_RETURN_FATAL;
-                }
-
-                if (thisrr->length > TLS_BUFFER_get_len(rbuf)
-                        - SSL2_RT_HEADER_LENGTH) {
-                    RLAYERfatal(rl, SSL_AD_RECORD_OVERFLOW,
-                        SSL_R_PACKET_LENGTH_TOO_LONG);
-                    return OSSL_RECORD_RETURN_FATAL;
-                }
-            } else {
-                /* SSLv3+ style record */
-
-                /* Pull apart the header into the TLS_RL_RECORD */
-                if (!PACKET_get_1(&pkt, &type)
-                    || !PACKET_get_net_2(&pkt, &version)
-                    || !PACKET_get_net_2_len(&pkt, &thisrr->length)) {
-                    if (rl->msg_callback != NULL)
-                        rl->msg_callback(0, 0, SSL3_RT_HEADER, p, 5, rl->cbarg);
-                    RLAYERfatal(rl, SSL_AD_DECODE_ERROR, ERR_R_INTERNAL_ERROR);
-                    return OSSL_RECORD_RETURN_FATAL;
-                }
-                thisrr->type = type;
-                thisrr->rec_version = version;
+            thisrr->type = type;
+            thisrr->rec_version = version;

-                /*
-                 * When we call validate_record_header() only records actually
-                 * received in SSLv2 format should have the record version set
-                 * to SSL2_VERSION. This way validate_record_header() can know
-                 * what format the record was in based on the version.
-                 */
-                if (thisrr->rec_version == SSL2_VERSION) {
-                    RLAYERfatal(rl, SSL_AD_PROTOCOL_VERSION,
-                        SSL_R_WRONG_VERSION_NUMBER);
-                    return OSSL_RECORD_RETURN_FATAL;
-                }
+            if (rl->msg_callback != NULL)
+                rl->msg_callback(0, version, SSL3_RT_HEADER, p, SSL3_RT_HEADER_LENGTH, rl->cbarg);

-                if (rl->msg_callback != NULL)
-                    rl->msg_callback(0, version, SSL3_RT_HEADER, p, 5, rl->cbarg);
-
-                if (!rl->funcs->validate_record_header(rl, thisrr)) {
-                    /* RLAYERfatal already called */
-                    return OSSL_RECORD_RETURN_FATAL;
-                }
+            if (!rl->funcs->validate_record_header(rl, thisrr)) {
+                /* RLAYERfatal already called */
+                return OSSL_RECORD_RETURN_FATAL;
+            }

-                if (thisrr->length > TLS_BUFFER_get_len(rbuf) - SSL3_RT_HEADER_LENGTH) {
-                    RLAYERfatal(rl, SSL_AD_RECORD_OVERFLOW,
-                        SSL_R_PACKET_LENGTH_TOO_LONG);
-                    return OSSL_RECORD_RETURN_FATAL;
-                }
+            if (thisrr->length > TLS_BUFFER_get_len(rbuf) - SSL3_RT_HEADER_LENGTH) {
+                RLAYERfatal(rl, SSL_AD_RECORD_OVERFLOW,
+                    SSL_R_PACKET_LENGTH_TOO_LONG);
+                return OSSL_RECORD_RETURN_FATAL;
             }

             /* now rl->rstate == SSL_ST_READ_BODY */
@@ -680,12 +653,7 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl)
          * rl->rstate == SSL_ST_READ_BODY, get and decode the data. Calculate
          * how much more data we need to read for the rest of the record
          */
-        if (thisrr->rec_version == SSL2_VERSION) {
-            more = thisrr->length + SSL2_RT_HEADER_LENGTH
-                - SSL3_RT_HEADER_LENGTH;
-        } else {
-            more = thisrr->length;
-        }
+        more = thisrr->length;

         if (more > 0) {
             /* now rl->packet_length == SSL3_RT_HEADER_LENGTH */
@@ -700,13 +668,9 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl)

         /*
          * At this point, rl->packet_length == SSL3_RT_HEADER_LENGTH
-         * + thisrr->length, or rl->packet_length == SSL2_RT_HEADER_LENGTH
          * + thisrr->length and we have that many bytes in rl->packet
          */
-        if (thisrr->rec_version == SSL2_VERSION)
-            thisrr->input = &(rl->packet[SSL2_RT_HEADER_LENGTH]);
-        else
-            thisrr->input = &(rl->packet[SSL3_RT_HEADER_LENGTH]);
+        thisrr->input = &(rl->packet[SSL3_RT_HEADER_LENGTH]);

         /*
          * ok, we can now read from 'rl->packet' data into 'thisrr'.
@@ -816,7 +780,7 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl)
     }

     if (mac_size > 0) {
-        macbufs = OPENSSL_zalloc(sizeof(*macbufs) * num_recs);
+        macbufs = OPENSSL_calloc(num_recs, sizeof(*macbufs));
         if (macbufs == NULL) {
             RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_CRYPTO_LIB);
             return OSSL_RECORD_RETURN_FATAL;
@@ -865,7 +829,7 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl)
             rl->curr_rec = 0;
             rl->num_released = 0;
             /* Reset the read sequence */
-            memset(rl->sequence, 0, sizeof(rl->sequence));
+            rl->sequence = 0;
             ret = 1;
             goto end;
         }
@@ -878,8 +842,8 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl)
     }
     OSSL_TRACE_BEGIN(TLS)
     {
-        BIO_printf(trc_out, "dec %lu\n", (unsigned long)rr[0].length);
-        BIO_dump_indent(trc_out, rr[0].data, rr[0].length, 4);
+        BIO_printf(trc_out, "dec %zu\n", rr[0].length);
+        BIO_dump_indent(trc_out, rr[0].data, (int)rr[0].length, 4);
     }
     OSSL_TRACE_END(TLS);

@@ -1093,7 +1057,8 @@ int tls13_common_post_process_record(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec)
 {
     if (rec->type != SSL3_RT_APPLICATION_DATA
         && rec->type != SSL3_RT_ALERT
-        && rec->type != SSL3_RT_HANDSHAKE) {
+        && rec->type != SSL3_RT_HANDSHAKE
+        && (!rl->isdtls || rec->type != SSL3_RT_ACK)) {
         RLAYERfatal(rl, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_BAD_RECORD_TYPE);
         return 0;
     }
@@ -1120,7 +1085,7 @@ int tls13_common_post_process_record(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec)

 int tls_read_record(OSSL_RECORD_LAYER *rl, void **rechandle, int *rversion,
     uint8_t *type, const unsigned char **data, size_t *datalen,
-    uint16_t *epoch, unsigned char *seq_num)
+    uint64_t *epoch, uint64_t *seq_num)
 {
     TLS_RL_RECORD *rec;

@@ -1157,7 +1122,7 @@ int tls_read_record(OSSL_RECORD_LAYER *rl, void **rechandle, int *rversion,
     *datalen = rec->length;
     if (rl->isdtls) {
         *epoch = rec->epoch;
-        memcpy(seq_num, rec->seq_num, sizeof(rec->seq_num));
+        *seq_num = rec->seq_num;
     }

     return OSSL_RECORD_RETURN_SUCCESS;
@@ -1278,6 +1243,8 @@ int tls_int_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers,
      */
     rl->max_frag_len = SSL3_RT_MAX_PLAIN_LENGTH;

+    rl->curr_mtu = 0;
+
     /* Loop through all the settings since they must all be understood */
     if (settings != NULL) {
         for (p = settings; p->key != NULL; p++) {
@@ -1363,6 +1330,16 @@ int tls_int_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers,
                 break;
             case OSSL_FUNC_RLAYER_PADDING:
                 rl->padding = OSSL_FUNC_rlayer_padding(fns);
+                break;
+            case OSSL_FUNC_RLAYER_GET_URXE_PACKET:
+                rl->get_urxe_packet = OSSL_FUNC_rlayer_get_urxe_packet(fns);
+                break;
+            case OSSL_FUNC_RLAYER_RELEASE_URXE_PACKET:
+                rl->release_urxe_packet = OSSL_FUNC_rlayer_release_urxe_packet(fns);
+                break;
+            case OSSL_FUNC_RLAYER_BLOCK_FOR_WRITE:
+                rl->block_for_write = OSSL_FUNC_rlayer_block_for_write(fns);
+                break;
             default:
                 /* Just ignore anything we don't understand */
                 break;
@@ -1395,15 +1372,18 @@ err:

 static int
 tls_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers,
-    int role, int direction, int level, uint16_t epoch,
+    int role, int direction, int level, uint64_t epoch,
     unsigned char *secret, size_t secretlen,
-    unsigned char *key, size_t keylen, unsigned char *iv,
-    size_t ivlen, unsigned char *mackey, size_t mackeylen,
+    unsigned char *snkey, unsigned char *key, size_t keylen,
+    unsigned char *iv, size_t ivlen,
+    unsigned char *mackey, size_t mackeylen,
+    const EVP_CIPHER *snciph,
     const EVP_CIPHER *ciph, size_t taglen,
     int mactype,
     const EVP_MD *md, COMP_METHOD *comp,
     const EVP_MD *kdfdigest, BIO *prev, BIO *transport,
-    BIO *next, BIO_ADDR *local, BIO_ADDR *peer,
+    BIO *next,
+    int use_urxe,
     const OSSL_PARAM *settings, const OSSL_PARAM *options,
     const OSSL_DISPATCH *fns, void *cbarg, void *rlarg,
     OSSL_RECORD_LAYER **retrl)
@@ -1430,9 +1410,6 @@ tls_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers,
     case TLS1_VERSION:
         (*retrl)->funcs = &tls_1_funcs;
         break;
-    case SSL3_VERSION:
-        (*retrl)->funcs = &ssl_3_0_funcs;
-        break;
     default:
         /* Should not happen */
         ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
@@ -1440,9 +1417,10 @@ tls_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers,
         goto err;
     }

-    ret = (*retrl)->funcs->set_crypto_state(*retrl, level, key, keylen, iv,
-        ivlen, mackey, mackeylen, ciph,
-        taglen, mactype, md, comp);
+    ret = (*retrl)->funcs->set_crypto_state(*retrl, level, snkey, key, keylen,
+        iv, ivlen, mackey, mackeylen,
+        snciph, ciph, taglen, mactype, md,
+        comp);

 err:
     if (ret != OSSL_RECORD_RETURN_SUCCESS) {
@@ -1462,6 +1440,7 @@ static void tls_int_free(OSSL_RECORD_LAYER *rl)
     tls_release_write_buffer(rl);

     EVP_CIPHER_CTX_free(rl->enc_ctx);
+    EVP_CIPHER_CTX_free(rl->sn_enc_ctx);
     EVP_MAC_CTX_free(rl->mac_ctx);
     EVP_MD_CTX_free(rl->md_ctx);
 #ifndef OPENSSL_NO_COMP
@@ -1469,8 +1448,6 @@ static void tls_int_free(OSSL_RECORD_LAYER *rl)
 #endif
     OPENSSL_free(rl->iv);
     OPENSSL_free(rl->nonce);
-    if (rl->version == SSL3_VERSION)
-        OPENSSL_cleanse(rl->mac_secret, sizeof(rl->mac_secret));

     TLS_RL_RECORD_release(rl->rrec, SSL_MAX_PIPELINES);

@@ -1569,6 +1546,21 @@ int tls_allocate_write_buffers_default(OSSL_RECORD_LAYER *rl,
     return 1;
 }

+size_t tls_get_record_body_alignment_offset(OSSL_RECORD_LAYER *rl,
+    const unsigned char *rec)
+{
+    size_t alignoffset = 0;
+    size_t headersize = tls_get_record_header_len(rl);
+
+#if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD != 0
+    alignoffset = (size_t)rec;
+    alignoffset += headersize;
+    alignoffset = SSL3_ALIGN_PAYLOAD - 1 - ((alignoffset - 1) % SSL3_ALIGN_PAYLOAD);
+#endif
+
+    return alignoffset;
+}
+
 int tls_initialise_write_packets_default(OSSL_RECORD_LAYER *rl,
     OSSL_RECORD_TEMPLATE *templates,
     size_t numtempl,
@@ -1586,13 +1578,7 @@ int tls_initialise_write_packets_default(OSSL_RECORD_LAYER *rl,
         wb = &bufs[j];

         wb->type = templates[j].type;
-
-#if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD != 0
-        align = (size_t)TLS_BUFFER_get_buf(wb);
-        align += rl->isdtls ? DTLS1_RT_HEADER_LENGTH : SSL3_RT_HEADER_LENGTH;
-        align = SSL3_ALIGN_PAYLOAD - 1
-            - ((align - 1) % SSL3_ALIGN_PAYLOAD);
-#endif
+        align = tls_get_record_body_alignment_offset(rl, TLS_BUFFER_get_buf(wb));
         TLS_BUFFER_set_offset(wb, align);

         if (!WPACKET_init_static_len(thispkt, TLS_BUFFER_get_buf(wb),
@@ -1695,8 +1681,9 @@ int tls_post_encryption_processing_default(OSSL_RECORD_LAYER *rl,
     TLS_RL_RECORD *thiswr)
 {
     size_t origlen, len;
-    size_t headerlen = rl->isdtls ? DTLS1_RT_HEADER_LENGTH
-                                  : SSL3_RT_HEADER_LENGTH;
+    unsigned char *recordstart;
+    size_t rechdrlen;
+    size_t written;

     /* Allocate bytes for the encryption overhead */
     if (!WPACKET_get_length(thispkt, &origlen)
@@ -1726,19 +1713,39 @@ int tls_post_encryption_processing_default(OSSL_RECORD_LAYER *rl,
     }

     if (!WPACKET_get_length(thispkt, &len)
-        || !WPACKET_close(thispkt)) {
+        || !WPACKET_close(thispkt)
+        || !WPACKET_get_total_written(thispkt, &written)) {
         RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return 0;
     }

+    recordstart = WPACKET_get_curr(thispkt) - written;
+    recordstart += tls_get_record_body_alignment_offset(rl, recordstart);
+
+    if (rl->isdtls)
+        rechdrlen = dtls_get_rec_header_size(*recordstart);
+    else
+        rechdrlen = SSL3_RT_HEADER_LENGTH;
+
+    if (rl->isdtls && DTLS13_UNI_HDR_FIX_BITS_IS_SET(*recordstart)) {
+        size_t seqnumlen = DTLS13_UNI_HDR_SEQ_BIT_IS_SET(*recordstart) ? 2 : 1;
+
+        if (!ossl_assert(DTLS13_UNI_HDR_SEQ_OFF + seqnumlen <= rechdrlen)
+            || (rl->sn_enc_ctx != NULL
+                && !dtls_crypt_sequence_number(rl->sn_enc_ctx, recordstart + DTLS13_UNI_HDR_SEQ_OFF,
+                    seqnumlen, recordstart + rechdrlen))) {
+            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+    }
+
     if (rl->msg_callback != NULL) {
-        unsigned char *recordstart;
+        const int version1_3 = rl->isdtls ? DTLS1_3_VERSION : TLS1_3_VERSION;

-        recordstart = WPACKET_get_curr(thispkt) - len - headerlen;
         rl->msg_callback(1, thiswr->rec_version, SSL3_RT_HEADER, recordstart,
-            headerlen, rl->cbarg);
+            rechdrlen, rl->cbarg);

-        if (rl->version == TLS1_3_VERSION && rl->enc_ctx != NULL) {
+        if (rl->version == version1_3 && rl->enc_ctx != NULL) {
             unsigned char ctype = thistempl->type;

             rl->msg_callback(1, thiswr->rec_version, SSL3_RT_INNER_CONTENT_TYPE,
@@ -1751,7 +1758,7 @@ int tls_post_encryption_processing_default(OSSL_RECORD_LAYER *rl,
         return 0;
     }

-    TLS_RL_RECORD_add_length(thiswr, headerlen);
+    TLS_RL_RECORD_add_length(thiswr, rechdrlen);

     return 1;
 }
@@ -1935,32 +1942,94 @@ int tls_retry_write_records(OSSL_RECORD_LAYER *rl)
                 if (ret != OSSL_RECORD_RETURN_SUCCESS)
                     return ret;
             }
-            i = BIO_write(rl->bio, (char *)&(TLS_BUFFER_get_buf(thiswb)[TLS_BUFFER_get_offset(thiswb)]),
-                (unsigned int)left);
-            if (i >= 0) {
-                tmpwrit = i;
-                if (i == 0 && left != 0) {
-                    if (BIO_should_retry(rl->bio)) {
-                        ret = OSSL_RECORD_RETURN_RETRY;
-                    } else {
+
+#ifndef OPENSSL_NO_SOCK
+            /*
+             * For DTLS connections created via a listener we need to
+             * call BIO_sendmmsg() to send the datagrams to the correct
+             * peer address.
+             */
+            if (rl->isdtls && BIO_ADDR_family(&rl->peer) != AF_UNSPEC) {
+                BIO_MSG msg;
+                size_t processed = 0;
+
+                memset(&msg, 0, sizeof(msg));
+                msg.data = (char *)&(TLS_BUFFER_get_buf(thiswb)[TLS_BUFFER_get_offset(thiswb)]);
+                msg.data_len = left;
+                msg.peer = &rl->peer;
+
+                ERR_set_mark();
+                if (BIO_sendmmsg(rl->bio, &msg, sizeof(msg), 1, 0, &processed)
+                    && processed == 1) {
+                    ERR_clear_last_mark();
+                    tmpwrit = msg.data_len;
+                    ret = OSSL_RECORD_RETURN_SUCCESS;
+                    i = (int)tmpwrit;
+                } else {
+                    unsigned long err = ERR_peek_last_error();
+                    /*
+                     * For BIO_sendmmsg, we use BIO_err_is_non_fatal() instead
+                     * of BIO_should_retry() to check for transient errors.
+                     */
+                    if (BIO_err_is_non_fatal(err)) {
+                        ERR_pop_to_mark();
+
                         /*
-                         * Treat this as a fatal I/O condition. Do not queue an
-                         * SSL reason: a zero return with no retry flag may come
-                         * from a custom BIO and does not imply an SSL library
-                         * or protocol error.
+                         * A connection in blocking mode waits for the socket to
+                         * become writable and sends again, rather than reporting
+                         * a retry. Nothing has been consumed, so the next time
+                         * round the loop repeats this same send.
+                         *
+                         * Only listener based connections install this callback.
+                         * Anything else either has a socket of its own to block
+                         * in or is genuinely non-blocking, and keeps the
+                         * behaviour below.
                          */
+                        if (rl->block_for_write != NULL
+                            && rl->block_for_write(rl->cbarg))
+                            continue;
+
+                        ret = OSSL_RECORD_RETURN_RETRY;
+                        i = 0;
+                        tmpwrit = 0;
+                    } else {
+                        ERR_clear_last_mark();
+                        ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
+                            "tls_retry_write_records BIO_sendmmsg failure");
                         ret = OSSL_RECORD_RETURN_FATAL;
+                        i = -1;
                     }
-                } else {
-                    ret = OSSL_RECORD_RETURN_SUCCESS;
                 }
-            } else {
-                if (BIO_should_retry(rl->bio)) {
-                    ret = OSSL_RECORD_RETURN_RETRY;
+            } else
+#endif
+            {
+                i = BIO_write(rl->bio, (char *)&(TLS_BUFFER_get_buf(thiswb)[TLS_BUFFER_get_offset(thiswb)]),
+                    (unsigned int)left);
+                if (i >= 0) {
+                    tmpwrit = i;
+                    if (i == 0 && left != 0) {
+                        if (BIO_should_retry(rl->bio)) {
+                            ret = OSSL_RECORD_RETURN_RETRY;
+                        } else {
+                            /*
+                             * Treat this as a fatal I/O condition. Do not queue an
+                             * SSL reason: a zero return with no retry flag may come
+                             * from a custom BIO and does not imply an SSL library
+                             * or protocol error.
+                             */
+                            ret = OSSL_RECORD_RETURN_FATAL;
+                        }
+                    } else {
+                        ret = OSSL_RECORD_RETURN_SUCCESS;
+                    }
                 } else {
-                    ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
-                        "tls_retry_write_records failure");
-                    ret = OSSL_RECORD_RETURN_FATAL;
+                    if (BIO_should_retry(rl->bio)) {
+                        ret = OSSL_RECORD_RETURN_RETRY;
+                    } else {
+                        ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
+                            "tls_retry_write_records failure");
+                        ret = OSSL_RECORD_RETURN_FATAL;
+                    }
                 }
             }
         } else {
@@ -2041,6 +2110,43 @@ int tls_set1_bio(OSSL_RECORD_LAYER *rl, BIO *bio)
     return 1;
 }

+#ifndef OPENSSL_NO_SOCK
+int tls_set1_peer(OSSL_RECORD_LAYER *rl, const BIO_ADDR *peer)
+{
+    if (!rl->isdtls) {
+        /* Non-DTLS record layers don't use peer address - no-op */
+        return 1;
+    }
+
+    if (peer != NULL)
+        return BIO_ADDR_copy(&rl->peer, peer);
+
+    BIO_ADDR_clear(&rl->peer);
+    return 1;
+}
+#endif
+
+void tls_set_use_urxe(OSSL_RECORD_LAYER *rl, int use_urxe)
+{
+    rl->use_urxe = use_urxe;
+}
+
+size_t tls_get_record_header_len(OSSL_RECORD_LAYER *rl)
+{
+    size_t headerlen;
+
+    if (rl->isdtls) {
+        if (rl->version == DTLS1_3_VERSION && rl->epoch > 0)
+            headerlen = DTLS13_UNI_HDR_FIXED_LENGTH;
+        else
+            headerlen = DTLS1_RT_HEADER_LENGTH;
+    } else {
+        headerlen = SSL3_RT_HEADER_LENGTH;
+    }
+
+    return headerlen;
+}
+
 /* Shared by most methods except tlsany_meth */
 int tls_default_set_protocol_version(OSSL_RECORD_LAYER *rl, int version)
 {
@@ -2107,7 +2213,7 @@ const COMP_METHOD *tls_get_compression(OSSL_RECORD_LAYER *rl)

 void tls_set_max_frag_len(OSSL_RECORD_LAYER *rl, size_t max_frag_len)
 {
-    rl->max_frag_len = max_frag_len;
+    rl->max_frag_len = (unsigned int)max_frag_len;
     /*
      * We don't need to adjust buffer sizes. Write buffer sizes are
      * automatically checked anyway. We should only be changing the read buffer
@@ -2119,15 +2225,8 @@ void tls_set_max_frag_len(OSSL_RECORD_LAYER *rl, size_t max_frag_len)

 int tls_increment_sequence_ctr(OSSL_RECORD_LAYER *rl)
 {
-    int i;
-
     /* Increment the sequence counter */
-    for (i = SEQ_NUM_SIZE; i > 0; i--) {
-        ++(rl->sequence[i - 1]);
-        if (rl->sequence[i - 1] != 0)
-            break;
-    }
-    if (i == 0) {
+    if (++rl->sequence == 0) {
         /* Sequence has wrapped */
         RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, SSL_R_SEQUENCE_CTR_WRAPPED);
         return 0;
@@ -2211,6 +2310,8 @@ const OSSL_RECORD_METHOD ossl_tls_record_method = {
     tls_release_record,
     tls_get_alert_code,
     tls_set1_bio,
+    NULL, /* set1_peer: Not used for TLS */
+    NULL, /* set_use_urxe: Not used for TLS */
     tls_set_protocol_version,
     tls_set_plain_alerts,
     tls_set_first_handshake,
@@ -2222,6 +2323,12 @@ const OSSL_RECORD_METHOD ossl_tls_record_method = {
     tls_set_max_frag_len,
     NULL,
     tls_increment_sequence_ctr,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
     tls_alloc_buffers,
-    tls_free_buffers
+    tls_free_buffers,
+    NULL /* set_prev_epoch_rl: DTLS only */
 };
diff --git a/deps/openssl/openssl/ssl/record/methods/tls_multib.c b/deps/openssl/openssl/ssl/record/methods/tls_multib.c
index e0a6dc6a579..b311bc0b91b 100644
--- a/deps/openssl/openssl/ssl/record/methods/tls_multib.c
+++ b/deps/openssl/openssl/ssl/record/methods/tls_multib.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -66,9 +66,10 @@ static int tls_write_records_multiblock_int(OSSL_RECORD_LAYER *rl,
 {
 #if !defined(OPENSSL_NO_MULTIBLOCK) && EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK
     size_t i;
-    size_t totlen;
+    size_t totlen, aad_written;
     TLS_BUFFER *wb;
     unsigned char aad[13];
+    WPACKET aad_pkt;
     EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM mb_param;
     size_t packlen;
     int packleni;
@@ -116,13 +117,20 @@ static int tls_write_records_multiblock_int(OSSL_RECORD_LAYER *rl,
     }
     wb = &rl->wbuf[0];

-    mb_param.interleave = numtempl;
-    memcpy(aad, rl->sequence, 8);
-    aad[8] = templates[0].type;
-    aad[9] = (unsigned char)(templates[0].version >> 8);
-    aad[10] = (unsigned char)(templates[0].version);
-    aad[11] = 0;
-    aad[12] = 0;
+    if (!WPACKET_init_static_len(&aad_pkt, aad, sizeof(aad), 0)
+        || !WPACKET_put_bytes_u64(&aad_pkt, rl->sequence)
+        || !WPACKET_put_bytes_u8(&aad_pkt, templates[0].type)
+        || !WPACKET_put_bytes_u16(&aad_pkt, templates[0].version)
+        || !WPACKET_put_bytes_u16(&aad_pkt, 0)
+        || !WPACKET_get_total_written(&aad_pkt, &aad_written)
+        || aad_written != sizeof(aad)
+        || !WPACKET_finish(&aad_pkt)) {
+        WPACKET_cleanup(&aad_pkt);
+        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return -1;
+    }
+
+    mb_param.interleave = (unsigned int)numtempl;
     mb_param.out = NULL;
     mb_param.inp = aad;
     mb_param.len = totlen;
@@ -148,13 +156,13 @@ static int tls_write_records_multiblock_int(OSSL_RECORD_LAYER *rl,
         return -1;
     }

-    rl->sequence[7] += mb_param.interleave;
-    if (rl->sequence[7] < mb_param.interleave) {
-        int j = 6;
-        while (j >= 0 && (++rl->sequence[j--]) == 0)
-            ;
+    if (rl->sequence > UINT64_MAX - mb_param.interleave) {
+        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return -1;
     }

+    rl->sequence += mb_param.interleave;
+
     wb->offset = 0;
     wb->left = packlen;

diff --git a/deps/openssl/openssl/ssl/record/methods/tls_pad.c b/deps/openssl/openssl/ssl/record/methods/tls_pad.c
index 8e92ae95109..5b2c888315f 100644
--- a/deps/openssl/openssl/ssl/record/methods/tls_pad.c
+++ b/deps/openssl/openssl/ssl/record/methods/tls_pad.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -33,51 +33,6 @@ static int ssl3_cbc_copy_mac(size_t *reclen,
     size_t good,
     OSSL_LIB_CTX *libctx);

-/*-
- * ssl3_cbc_remove_padding removes padding from the decrypted, SSLv3, CBC
- * record in |recdata| by updating |reclen| in constant time. It also extracts
- * the MAC from the underlying record and places a pointer to it in |mac|. The
- * MAC data can either be newly allocated memory, or a pointer inside the
- * |recdata| buffer. If allocated then |*alloced| is set to 1, otherwise it is
- * set to 0.
- *
- * origreclen: the original record length before any changes were made
- * block_size: the block size of the cipher used to encrypt the record.
- * mac_size: the size of the MAC to be extracted
- * aead: 1 if an AEAD cipher is in use, or 0 otherwise
- * returns:
- *   0: if the record is publicly invalid.
- *   1: if the record is publicly valid. If the padding removal fails then the
- *      MAC returned is random.
- */
-int ssl3_cbc_remove_padding_and_mac(size_t *reclen,
-    size_t origreclen,
-    unsigned char *recdata,
-    unsigned char **mac,
-    int *alloced,
-    size_t block_size, size_t mac_size,
-    OSSL_LIB_CTX *libctx)
-{
-    size_t padding_length;
-    size_t good;
-    const size_t overhead = 1 /* padding length byte */ + mac_size;
-
-    /*
-     * These lengths are all public so we can test them in non-constant time.
-     */
-    if (overhead > *reclen)
-        return 0;
-
-    padding_length = recdata[*reclen - 1];
-    good = constant_time_ge_s(*reclen, padding_length + overhead);
-    /* SSLv3 requires that the padding is minimal. */
-    good &= constant_time_ge_s(block_size, padding_length + 1);
-    *reclen -= good & (padding_length + 1);
-
-    return ssl3_cbc_copy_mac(reclen, origreclen, recdata, mac, alloced,
-        block_size, mac_size, good, libctx);
-}
-
 /*-
  * tls1_cbc_remove_padding_and_mac removes padding from the decrypted, TLS, CBC
  * record in |recdata| by updating |reclen| in constant time. It also extracts
@@ -280,7 +235,8 @@ static int ssl3_cbc_copy_mac(size_t *reclen,
          */
         aux1 = rotated_mac[rotate_offset & ~32];
         aux2 = rotated_mac[rotate_offset | 32];
-        mask = constant_time_eq_8(rotate_offset & ~32, rotate_offset);
+        mask = constant_time_eq_8((unsigned int)(rotate_offset & ~32),
+            (unsigned int)rotate_offset);
         aux3 = constant_time_select_8(mask, aux1, aux2);
         rotate_offset++;

@@ -296,7 +252,7 @@ static int ssl3_cbc_copy_mac(size_t *reclen,
     rotate_offset &= constant_time_lt_s(rotate_offset, mac_size);
     for (i = 0; i < mac_size; i++) {
         for (j = 0; j < mac_size; j++)
-            out[j] |= rotated_mac[i] & constant_time_eq_8_s(j, rotate_offset);
+            out[j] |= rotated_mac[i] & constant_time_eq_8_s((unsigned int)j, (unsigned int)rotate_offset);
         rotate_offset++;
         rotate_offset &= constant_time_lt_s(rotate_offset, mac_size);

diff --git a/deps/openssl/openssl/ssl/record/methods/tlsany_meth.c b/deps/openssl/openssl/ssl/record/methods/tlsany_meth.c
index 99617254397..f6b362eb5e6 100644
--- a/deps/openssl/openssl/ssl/record/methods/tlsany_meth.c
+++ b/deps/openssl/openssl/ssl/record/methods/tlsany_meth.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,9 +15,11 @@
 #define MIN_SSL2_RECORD_LEN 9

 static int tls_any_set_crypto_state(OSSL_RECORD_LAYER *rl, int level,
+    unsigned char *snkey,
     unsigned char *key, size_t keylen,
     unsigned char *iv, size_t ivlen,
     unsigned char *mackey, size_t mackeylen,
+    const EVP_CIPHER *snciph,
     const EVP_CIPHER *ciph,
     size_t taglen,
     int mactype,
@@ -43,75 +45,66 @@ static int tls_any_cipher(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *recs,

 static int tls_validate_record_header(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec)
 {
-    if (rec->rec_version == SSL2_VERSION) {
-        /* SSLv2 format ClientHello */
-        if (!ossl_assert(rl->version == TLS_ANY_VERSION)) {
-            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            return 0;
-        }
-        if (rec->length < MIN_SSL2_RECORD_LEN) {
-            RLAYERfatal(rl, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_TOO_SHORT);
-            return 0;
-        }
-    } else {
-        if (rl->version == TLS_ANY_VERSION) {
-            if ((rec->rec_version >> 8) != SSL3_VERSION_MAJOR) {
-                if (rl->is_first_record) {
-                    unsigned char *p;
-
-                    /*
-                     * Go back to start of packet, look at the five bytes that
-                     * we have.
-                     */
-                    p = rl->packet;
-                    if (HAS_PREFIX((char *)p, "GET ") || HAS_PREFIX((char *)p, "POST ") || HAS_PREFIX((char *)p, "HEAD ") || HAS_PREFIX((char *)p, "PATCH") || HAS_PREFIX((char *)p, "OPTIO") || HAS_PREFIX((char *)p, "DELET") || HAS_PREFIX((char *)p, "TRACE") || HAS_PREFIX((char *)p, "PUT ")) {
-                        RLAYERfatal(rl, SSL_AD_NO_ALERT, SSL_R_HTTP_REQUEST);
-                        return 0;
-                    } else if (HAS_PREFIX((char *)p, "CONNE")) {
-                        RLAYERfatal(rl, SSL_AD_NO_ALERT,
-                            SSL_R_HTTPS_PROXY_REQUEST);
-                        return 0;
-                    }
-
-                    /* Doesn't look like TLS - don't send an alert */
-                    RLAYERfatal(rl, SSL_AD_NO_ALERT,
-                        SSL_R_WRONG_VERSION_NUMBER);
-                    return 0;
-                } else {
-                    RLAYERfatal(rl, SSL_AD_PROTOCOL_VERSION,
-                        SSL_R_WRONG_VERSION_NUMBER);
+    const int version1_3 = rl->isdtls ? DTLS1_3_VERSION : TLS1_3_VERSION;
+
+    if (rl->version == TLS_ANY_VERSION) {
+        if ((rec->rec_version >> 8) != SSL3_VERSION_MAJOR) {
+            if (rl->is_first_record) {
+                unsigned char *p;
+
+                /*
+                 * Go back to start of packet, look at the five bytes that
+                 * we have.
+                 */
+                p = rl->packet;
+                if (HAS_PREFIX((char *)p, "GET ") || HAS_PREFIX((char *)p, "POST ") || HAS_PREFIX((char *)p, "HEAD ") || HAS_PREFIX((char *)p, "PATCH") || HAS_PREFIX((char *)p, "OPTIO") || HAS_PREFIX((char *)p, "DELET") || HAS_PREFIX((char *)p, "TRACE") || HAS_PREFIX((char *)p, "PUT ")) {
+                    RLAYERfatal(rl, SSL_AD_NO_ALERT, SSL_R_HTTP_REQUEST);
                     return 0;
-                }
-            }
-        } else if (rl->version == TLS1_3_VERSION) {
-            /*
-             * In this case we know we are going to negotiate TLSv1.3, but we've
-             * had an HRR, so we haven't actually done so yet. In TLSv1.3 we
-             * must ignore the legacy record version in plaintext records.
-             */
-        } else if (rec->rec_version != rl->version) {
-            if ((rl->version & 0xFF00) == (rec->rec_version & 0xFF00)) {
-                if (rec->type == SSL3_RT_ALERT) {
-                    /*
-                     * The record is using an incorrect version number,
-                     * but what we've got appears to be an alert. We
-                     * haven't read the body yet to check whether its a
-                     * fatal or not - but chances are it is. We probably
-                     * shouldn't send a fatal alert back. We'll just
-                     * end.
-                     */
+                } else if (HAS_PREFIX((char *)p, "CONNE")) {
                     RLAYERfatal(rl, SSL_AD_NO_ALERT,
-                        SSL_R_WRONG_VERSION_NUMBER);
+                        SSL_R_HTTPS_PROXY_REQUEST);
                     return 0;
                 }
-                /* Send back error using their minor version number */
-                rl->version = (unsigned short)rec->rec_version;
+
+                /* Doesn't look like TLS - don't send an alert */
+                RLAYERfatal(rl, SSL_AD_NO_ALERT,
+                    SSL_R_WRONG_VERSION_NUMBER);
+                return 0;
+            } else {
+                RLAYERfatal(rl, SSL_AD_PROTOCOL_VERSION,
+                    SSL_R_WRONG_VERSION_NUMBER);
+                return 0;
             }
-            RLAYERfatal(rl, SSL_AD_PROTOCOL_VERSION,
-                SSL_R_WRONG_VERSION_NUMBER);
-            return 0;
         }
+    } else if (rl->version == version1_3) {
+        /*
+         * In this case we know we are going to negotiate TLSv1.3, but we've
+         * had an HRR, so we haven't actually done so yet. In TLSv1.3 we
+         * must ignore the legacy record version in plaintext records.
+         */
+    } else if (rec->rec_version != rl->version) {
+        if ((rl->version & 0xFF00) == (rec->rec_version & 0xFF00)) {
+            if (rec->type == SSL3_RT_ALERT) {
+                /*
+                 * The record is using an incorrect version number,
+                 * but what we've got appears to be an alert. We
+                 * haven't read the body yet to check whether its a
+                 * fatal or not - but chances are it is. We probably
+                 * shouldn't send a fatal alert back. We'll just
+                 * end.
+                 */
+                RLAYERfatal(rl, SSL_AD_NO_ALERT,
+                    SSL_R_WRONG_VERSION_NUMBER);
+                return 0;
+            }
+            /* Send back error using their minor version number */
+            rl->version = (unsigned short)rec->rec_version;
+        }
+        RLAYERfatal(rl, SSL_AD_PROTOCOL_VERSION,
+            SSL_R_WRONG_VERSION_NUMBER);
+        return 0;
     }
+
     if (rec->length > SSL3_RT_MAX_PLAIN_LENGTH) {
         /*
          * We use SSL_R_DATA_LENGTH_TOO_LONG instead of
diff --git a/deps/openssl/openssl/ssl/record/rec_layer_d1.c b/deps/openssl/openssl/ssl/record/rec_layer_d1.c
index a6ddbbffe46..c99269c702e 100644
--- a/deps/openssl/openssl/ssl/record/rec_layer_d1.c
+++ b/deps/openssl/openssl/ssl/record/rec_layer_d1.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -72,6 +72,25 @@ void DTLS_RECORD_LAYER_clear(RECORD_LAYER *rl)
     d->buffered_app_data = buffered_app_data;
 }

+/*
+ * Checks for application data set aside while a handshake was in progress.
+ * dtls1_read_bytes() only returns it once the handshake has finished.
+ */
+int DTLS_RECORD_LAYER_buffered_app_data_pending(const RECORD_LAYER *rl)
+{
+    TLS_RECORD *rdata;
+    pitem *item, *iter;
+
+    iter = pqueue_iterator(rl->d->buffered_app_data);
+    while ((item = pqueue_next(&iter)) != NULL) {
+        rdata = item->data;
+        if (rdata->length > 0)
+            return 1;
+    }
+
+    return 0;
+}
+
 static int dtls_buffer_record(SSL_CONNECTION *s, TLS_RECORD *rec)
 {
     TLS_RECORD *rdata;
@@ -87,7 +106,7 @@ static int dtls_buffer_record(SSL_CONNECTION *s, TLS_RECORD *rec)
         return -1;

     rdata = OPENSSL_malloc(sizeof(*rdata));
-    item = pitem_new(rec->seq_num, rdata);
+    item = pitem_new_u64(rec->seq_num, rdata);
     if (rdata == NULL || item == NULL) {
         OPENSSL_free(rdata);
         pitem_free(item);
@@ -118,7 +137,7 @@ static int dtls_buffer_record(SSL_CONNECTION *s, TLS_RECORD *rec)

 #ifndef OPENSSL_NO_SCTP
     /* Store bio_dgram_sctp_rcvinfo struct */
-    if (BIO_dgram_is_sctp(s->rbio) && (ossl_statem_get_state(s) == TLS_ST_SR_FINISHED || ossl_statem_get_state(s) == TLS_ST_CR_FINISHED)) {
+    if (s->rbio != NULL && BIO_dgram_is_sctp(s->rbio) && (ossl_statem_get_state(s) == TLS_ST_SR_FINISHED || ossl_statem_get_state(s) == TLS_ST_CR_FINISHED)) {
         BIO_ctrl(s->rbio, BIO_CTRL_DGRAM_SCTP_GET_RCVINFO,
             sizeof(rdata->recordinfo), &rdata->recordinfo);
     }
@@ -154,7 +173,7 @@ static void dtls_unbuffer_record(SSL_CONNECTION *s)

 #ifndef OPENSSL_NO_SCTP
         /* Restore bio_dgram_sctp_rcvinfo struct */
-        if (BIO_dgram_is_sctp(s->rbio)) {
+        if (s->rbio != NULL && BIO_dgram_is_sctp(s->rbio)) {
             BIO_ctrl(s->rbio, BIO_CTRL_DGRAM_SCTP_SET_RCVINFO,
                 sizeof(rdata->recordinfo), &rdata->recordinfo);
         }
@@ -203,10 +222,15 @@ int dtls1_read_bytes(SSL *s, uint8_t type, uint8_t *recvd_type,
     TLS_RECORD *rr;
     void (*cb)(const SSL *ssl, int type2, int val) = NULL;
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
+    int is_dtls13;
+    int in_early_data;
+    int current_state;

     if (sc == NULL)
         return -1;

+    is_dtls13 = SSL_CONNECTION_IS_DTLS13(sc);
+
     if ((type && (type != SSL3_RT_APPLICATION_DATA) && (type != SSL3_RT_HANDSHAKE)) || (peek && (type != SSL3_RT_APPLICATION_DATA))) {
         SSLfatal(sc, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return -1;
@@ -224,6 +248,7 @@ int dtls1_read_bytes(SSL *s, uint8_t type, uint8_t *recvd_type,

 start:
     sc->rwstate = SSL_NOTHING;
+    in_early_data = (sc->early_data_state == SSL_EARLY_DATA_READING);

     /*
      * We are not handshaking and have no data yet, so process data buffered
@@ -251,17 +276,78 @@ start:
                     &rr->rechandle,
                     &rr->version, &rr->type,
                     &rr->data, &rr->length,
-                    &rr->epoch, rr->seq_num));
+                    &rr->epoch, &rr->seq_num));
+
+            /*
+             * DTLS1.3 will move the Server and Client's Read Record
+             * during the handshake once it has received a record
+             * in the new Epoch.
+             *
+             * We cannot move to the next epoch (1 or 2) until we
+             * have read the client/server hello.
+             */
+            if (ret <= 0 && is_dtls13
+                && sc->rlayer.rrlmethod->unprocessed_records(sc->rlayer.rrl) > 0
+                && ((SSL_in_init(s) && sc->dtls13_process_hello) || in_early_data)) {
+                int which = SSL3_CC_HANDSHAKE;
+
+                if (sc->server)
+                    which |= SSL3_CHANGE_CIPHER_SERVER_READ;
+                else
+                    which |= SSL3_CHANGE_CIPHER_CLIENT_READ;
+                /*
+                 * Change the Read Record Layer to next read epoch
+                 */
+                if (!s->method->ssl3_enc->change_cipher_state(sc,
+                        which)) {
+                    SSLfatal(sc, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                    return -1;
+                }
+                /* This must only ever happen once per handshake */
+                sc->dtls13_process_hello = 0;
+
+                /*
+                 * Read the Buffered epoch
+                 */
+                ret = HANDLE_RLAYER_READ_RETURN(sc,
+                    sc->rlayer.rrlmethod->read_record(sc->rlayer.rrl,
+                        &rr->rechandle,
+                        &rr->version, &rr->type,
+                        &rr->data, &rr->length,
+                        &rr->epoch, &rr->seq_num));
+            }
+
             if (ret <= 0) {
                 ret = dtls1_read_failed(sc, ret);
                 /*
                  * Anything other than a timeout is an error. SSLfatal() already
                  * called if appropriate.
                  */
-                if (ret <= 0)
-                    return ret;
-                else
+                if (ret > 0)
                     goto start;
+
+                /*
+                 * Once the record layer holds buffered records from a later
+                 * epoch it asks for a retry without reading the BIO again (see
+                 * dtls_get_more_records()), so nothing has set the BIO's retry
+                 * flags. Without them SSL_get_error() reports
+                 * SSL_ERROR_SYSCALL for what is an ordinary wait for more
+                 * data.
+                 *
+                 * A connection accepted by a DTLS listener has no read BIO of
+                 * its own (see dtls_listener_create_conn_ssl());
+                 * SSL_get_error() already reports SSL_ERROR_WANT_READ for
+                 * SSL_READING on such a connection without needing one.
+                 */
+                if (sc->rwstate == SSL_READING) {
+                    BIO *rbio = SSL_get_rbio(s);
+
+                    if (rbio != NULL && !BIO_should_retry(rbio)) {
+                        BIO_clear_retry_flags(rbio);
+                        BIO_set_retry_read(rbio);
+                    }
+                }
+                return ret;
             }
             rr->off = 0;
             sc->rlayer.num_recs++;
@@ -278,14 +364,33 @@ start:
         sc->rlayer.alert_count = 0;

     /* we now have a packet which can be read and processed */
-
-    if (sc->s3.change_cipher_spec /* set when we receive ChangeCipherSpec,
-                                   * reset by ssl3_get_finished */
-        && (rr->type != SSL3_RT_HANDSHAKE)) {
+    current_state = SSL_get_state(s);
+    if ((sc->s3.change_cipher_spec /* set when we receive ChangeCipherSpec,
+                                    * reset by ssl3_get_finished */
+            && (rr->type != SSL3_RT_HANDSHAKE))
+        || (is_dtls13 && rr->epoch >= 3 /* For DTLS 1.3 we can receive
+                                         * Application Data before we
+                                         * receive an expecting ACK
+                                         * message */
+            && (current_state == TLS_ST_CW_FINISHED
+                || current_state == TLS_ST_CW_KEY_UPDATE
+                || current_state == TLS_ST_SW_KEY_UPDATE
+                || current_state == TLS_ST_SW_SESSION_TICKET
+                || (current_state == TLS_ST_OK && SSL_in_init(s)))
+            && rr->type == SSL3_RT_APPLICATION_DATA)) {
         /*
-         * We now have application data between CCS and Finished. Most likely
-         * the packets were reordered on their way, so buffer the application
-         * data for later processing rather than dropping the connection.
+         * For DTLS 1.3 we received Application Data while we are
+         * waiting for an Acknowledgement record. Buffer this data so
+         * it can be processed once we have received the Acknowledgement.
+         * When DTLS 1.3 receives application data and it is already
+         * in TLS_ST_OK and is processing a handshake message like
+         * NewSessionTicket or KeyUpdate the application data is
+         * buffered.
+         *
+         * For non-DTLS 1.3 we now have application data between CCS and
+         * Finished. Most likely the packets were reordered on their way,
+         * so buffer the application data for later processing rather than
+         * dropping the connection.
          */
         if (dtls_buffer_record(sc, rr) < 0) {
             /* SSLfatal() already called */
@@ -293,6 +398,10 @@ start:
         }
         if (!ssl_release_record(sc, rr, 0))
             return -1;
+
+        if (is_dtls13 && current_state == TLS_ST_OK && SSL_in_init(s)) {
+            return -1;
+        }
         goto start;
     }

@@ -307,13 +416,21 @@ start:
         return 0;
     }

+    if ((rr->type == SSL3_RT_HANDSHAKE || rr->type == SSL3_RT_ACK)
+        && SSL_CONNECTION_IS_DTLS13(sc)) {
+        sc->s3.tmp.record_epoch = rr->epoch;
+        sc->s3.tmp.record_seq_num = rr->seq_num;
+    }
+
     if (type == rr->type
-        || (rr->type == SSL3_RT_CHANGE_CIPHER_SPEC
-            && type == SSL3_RT_HANDSHAKE && recvd_type != NULL)) {
+        || (type == SSL3_RT_HANDSHAKE
+            && ((!is_dtls13 && recvd_type != NULL && rr->type == SSL3_RT_CHANGE_CIPHER_SPEC)
+                || (is_dtls13 && rr->type == SSL3_RT_ACK)))) {
         /*
          * SSL3_RT_APPLICATION_DATA or
          * SSL3_RT_HANDSHAKE or
-         * SSL3_RT_CHANGE_CIPHER_SPEC
+         * SSL3_RT_CHANGE_CIPHER_SPEC or
+         * SSL3_RT_ACK
          */
         /*
          * make sure that we are not getting application data when we are
@@ -359,7 +476,7 @@ start:
          * app data. If there was an alert and there is no message to read
          * anymore, finally set shutdown.
          */
-        if (BIO_dgram_is_sctp(SSL_get_rbio(s)) && sc->d1->shutdown_received
+        if (SSL_get_rbio(s) != NULL && BIO_dgram_is_sctp(SSL_get_rbio(s)) && sc->d1->shutdown_received
             && BIO_dgram_sctp_msg_waiting(SSL_get_rbio(s)) <= 0) {
             sc->shutdown |= SSL_RECEIVED_SHUTDOWN;
             return 0;
@@ -401,7 +518,8 @@ start:
             cb(s, SSL_CB_READ_ALERT, j);
         }

-        if (alert_level == SSL3_AL_WARNING) {
+        if ((!is_dtls13 && alert_level == SSL3_AL_WARNING)
+            || (is_dtls13 && alert_descr == SSL_AD_USER_CANCELLED)) {
             sc->s3.warn_alert = alert_descr;
             if (!ssl_release_record(sc, rr, 0))
                 return -1;
@@ -412,37 +530,33 @@ start:
                     SSL_R_TOO_MANY_WARN_ALERTS);
                 return -1;
             }
+        }

-            if (alert_descr == SSL_AD_CLOSE_NOTIFY) {
+        /*
+         * Apart from close_notify the only other warning alert in DTLSv1.3
+         * is user_cancelled - which we just ignore.
+         */
+        if (is_dtls13 && alert_descr == SSL_AD_USER_CANCELLED) {
+            goto start;
+        } else if (alert_descr == SSL_AD_CLOSE_NOTIFY
+            && (is_dtls13 || alert_level == SSL3_AL_WARNING)) {
 #ifndef OPENSSL_NO_SCTP
-                /*
-                 * With SCTP and streams the socket may deliver app data
-                 * after a close_notify alert. We have to check this first so
-                 * that nothing gets discarded.
-                 */
-                if (BIO_dgram_is_sctp(SSL_get_rbio(s)) && BIO_dgram_sctp_msg_waiting(SSL_get_rbio(s)) > 0) {
-                    sc->d1->shutdown_received = 1;
-                    sc->rwstate = SSL_READING;
-                    BIO_clear_retry_flags(SSL_get_rbio(s));
-                    BIO_set_retry_read(SSL_get_rbio(s));
-                    return -1;
-                }
-#endif
-                sc->shutdown |= SSL_RECEIVED_SHUTDOWN;
-                return 0;
-            } else if (alert_descr == SSL_AD_NO_RENEGOTIATION) {
-                /*
-                 * This is a warning but we receive it if we requested
-                 * renegotiation and the peer denied it. Terminate with a fatal
-                 * alert because if the application tried to renegotiate it
-                 * presumably had a good reason and expects it to succeed. In
-                 * the future we might have a renegotiation where we don't care
-                 * if the peer refused it where we carry on.
-                 */
-                SSLfatal(sc, SSL_AD_HANDSHAKE_FAILURE, SSL_R_NO_RENEGOTIATION);
+            /*
+             * With SCTP and streams the socket may deliver app data
+             * after a close_notify alert. We have to check this first so
+             * that nothing gets discarded.
+             */
+            if (SSL_get_rbio(s) != NULL && BIO_dgram_is_sctp(SSL_get_rbio(s)) && BIO_dgram_sctp_msg_waiting(SSL_get_rbio(s)) > 0) {
+                sc->d1->shutdown_received = 1;
+                sc->rwstate = SSL_READING;
+                BIO_clear_retry_flags(SSL_get_rbio(s));
+                BIO_set_retry_read(SSL_get_rbio(s));
                 return -1;
             }
-        } else if (alert_level == SSL3_AL_FATAL) {
+#endif
+            sc->shutdown |= SSL_RECEIVED_SHUTDOWN;
+            return 0;
+        } else if (alert_level == SSL3_AL_FATAL || is_dtls13) {
             sc->rwstate = SSL_NOTHING;
             sc->s3.fatal_alert = alert_descr;
             SSLfatal_data(sc, SSL_AD_NO_ALERT,
@@ -453,12 +567,24 @@ start:
                 return -1;
             SSL_CTX_remove_session(sc->session_ctx, sc->session);
             return 0;
-        } else {
-            SSLfatal(sc, SSL_AD_ILLEGAL_PARAMETER, SSL_R_UNKNOWN_ALERT_TYPE);
+        } else if (alert_descr == SSL_AD_NO_RENEGOTIATION) {
+            /*
+             * This is a warning but we receive it if we requested
+             * renegotiation and the peer denied it. Terminate with a fatal
+             * alert because if the application tried to renegotiate it
+             * presumably had a good reason and expects it to succeed. In
+             * the future we might have a renegotiation where we don't care
+             * if the peer refused it where we carry on.
+             */
+            SSLfatal(sc, SSL_AD_HANDSHAKE_FAILURE, SSL_R_NO_RENEGOTIATION);
             return -1;
+        } else if (alert_level == SSL3_AL_WARNING) {
+            /* We ignore any other warning alert in (D)TLSv1.2 and below */
+            goto start;
         }

-        goto start;
+        SSLfatal(sc, SSL_AD_ILLEGAL_PARAMETER, SSL_R_UNKNOWN_ALERT_TYPE);
+        return -1;
     }

     if (sc->shutdown & SSL_SENT_SHUTDOWN) { /* but we have not received a
@@ -482,33 +608,57 @@ start:
     /*
      * Unexpected handshake message (Client Hello, or protocol violation)
      */
-    if (rr->type == SSL3_RT_HANDSHAKE && !ossl_statem_get_in_handshake(sc)) {
-        struct hm_header_st msg_hdr;
+    if (!ossl_statem_get_in_handshake(sc) && rr->type == SSL3_RT_HANDSHAKE && !in_early_data) {
+        unsigned char msg_type;

         /*
          * This may just be a stale retransmit. Also sanity check that we have
-         * at least enough record bytes for a message header
+         * at least enough record bytes for a message header.
+         *
+         * For DTLS 1.3, a record at exactly the previous read epoch is not
+         * necessarily stale: it authenticated (see dtls_get_more_records()'s
+         * retained prev_epoch_rl handling), but that alone doesn't prove it's
+         * a retransmission. Let it through to the normal handshake-message
+         * path below instead of discarding it here -- the sequence and epoch
+         * checks there (dtls_record_from_retained_epoch(),
+         * dtls_prev_epoch_allows_type()) are what actually decide whether it
+         * can be acknowledged. This retained-epoch exception is for handshake
+         * records only (rr->type == SSL3_RT_HANDSHAKE above); an ACK record
+         * still has to be tied to the epoch that authenticated it before it
+         * can touch d1->sent_messages, which dtls_process_ack() enforces
+         * separately.
          */
-        if (rr->epoch != sc->rlayer.d->r_epoch
+        if ((rr->epoch != dtls1_get_epoch(sc, SSL3_CC_READ)
+                && !(SSL_CONNECTION_IS_DTLS13(sc)
+                    && dtls1_get_epoch(sc, SSL3_CC_READ) > 0
+                    && rr->epoch == dtls1_get_epoch(sc, SSL3_CC_READ) - 1))
             || rr->length < DTLS1_HM_HEADER_LENGTH) {
             if (!ssl_release_record(sc, rr, 0))
                 return -1;
             goto start;
         }

-        dtls1_get_message_header(rr->data, &msg_hdr);
+        msg_type = *rr->data;

         /*
          * If we are server, we may have a repeated FINISHED of the client
          * here, then retransmit our CCS and FINISHED.
+         *
+         * DTLS 1.3 has proper ACK records, so this DTLS 1.2-only fallback
+         * (which infers loss from a bare repeated Finished and reacts by
+         * blindly retransmitting our own flight) is skipped for it. A
+         * repeated DTLS 1.3 Finished instead falls through to the normal
+         * handshake-message path below, which ACKs a message it has
+         * already fully processed without reprocessing it (see the
+         * record_epoch check in statem_dtls.c).
          */
-        if (msg_hdr.type == SSL3_MT_FINISHED) {
+        if (!SSL_CONNECTION_IS_DTLS13(sc) && msg_type == SSL3_MT_FINISHED) {
             if (dtls1_check_timeout_num(sc) < 0) {
                 /* SSLfatal) already called */
                 return -1;
             }

-            if (dtls1_retransmit_buffered_messages(sc) <= 0) {
+            if (dtls1_retransmit_sent_messages(sc) <= 0) {
                 /* Fail if we encountered a fatal error */
                 if (ossl_statem_in_error(sc))
                     return -1;
@@ -522,24 +672,32 @@ start:

                     sc->rwstate = SSL_READING;
                     bio = SSL_get_rbio(s);
-                    BIO_clear_retry_flags(bio);
-                    BIO_set_retry_read(bio);
+                    /*
+                     * A connection accepted by a DTLS listener has no read
+                     * BIO of its own (see dtls_listener_create_conn_ssl());
+                     * SSL_get_error() already reports SSL_ERROR_WANT_READ
+                     * for SSL_READING on such a connection without needing
+                     * one.
+                     */
+                    if (bio != NULL) {
+                        BIO_clear_retry_flags(bio);
+                        BIO_set_retry_read(bio);
+                    }
                     return -1;
                 }
             }
             goto start;
         }
+    }
+
+    if (!ossl_statem_get_in_handshake(sc)
+        && (rr->type == SSL3_RT_HANDSHAKE || rr->type == SSL3_RT_ACK)) {

         /*
          * To get here we must be trying to read app data but found handshake
-         * data. But if we're trying to read app data, and we're not in init
-         * (which is tested for at the top of this function) then init must be
-         * finished
+         * data. This can be because we are in early data and receive the rest
+         * of the handshake.
          */
-        if (!ossl_assert(SSL_is_init_finished(s))) {
-            SSLfatal(sc, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            return -1;
-        }

         /* We found handshake data, so we're going back into init */
         ossl_statem_set_in_init(sc, 1);
@@ -548,9 +706,18 @@ start:
         /* SSLfatal() called if appropriate */
         if (i < 0)
             return i;
+
         if (i == 0)
             return -1;

+        /*
+         * If we were actually trying to read early data and we found a
+         * handshake message, then we don't want to continue to try and read
+         * the application data any more. It won't be "early" now.
+         */
+        if (in_early_data)
+            return -1;
+
         if (!(sc->mode & SSL_MODE_AUTO_RETRY)) {
             if (!sc->rlayer.rrlmethod->unprocessed_read_pending(sc->rlayer.rrl)) {
                 /* no read-ahead left? */
@@ -563,8 +730,16 @@ start:
                  */
                 sc->rwstate = SSL_READING;
                 bio = SSL_get_rbio(s);
-                BIO_clear_retry_flags(bio);
-                BIO_set_retry_read(bio);
+                /*
+                 * A connection accepted by a DTLS listener has no read BIO
+                 * of its own (see dtls_listener_create_conn_ssl());
+                 * SSL_get_error() already reports SSL_ERROR_WANT_READ for
+                 * SSL_READING on such a connection without needing one.
+                 */
+                if (bio != NULL) {
+                    BIO_clear_retry_flags(bio);
+                    BIO_set_retry_read(bio);
+                }
                 return -1;
             }
         }
@@ -585,6 +760,34 @@ start:
          */
         SSLfatal(sc, SSL_AD_UNEXPECTED_MESSAGE, ERR_R_INTERNAL_ERROR);
         return -1;
+
+    case SSL3_RT_ACK:
+        switch (sc->negotiated_version) {
+        case DTLS1_3_VERSION:
+            /* ACK should have been handled if DTLSv1.3 has been negotiated. */
+            SSLfatal(sc, SSL_AD_UNEXPECTED_MESSAGE, ERR_R_INTERNAL_ERROR);
+            return -1;
+
+        case DTLS_ANY_VERSION:
+            /*
+             * This must be an ACK from a DTLSv1.3 server for a partial
+             * ClientHello. We always send the full message again if the
+             * ClientHello is not responded to with a ServerHello before the
+             * timer runs out. Drop the record.
+             */
+            if (!ssl_release_record(sc, rr, 0))
+                return -1;
+            goto start;
+
+        default:
+            /*
+             * If we receive an ACK record when we have negotiated a lower version
+             * than DTLSv1.3 then we respond with an unexpected record fatal alert.
+             */
+            SSLfatal(sc, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_RECORD);
+            return -1;
+        }
+
     case SSL3_RT_APPLICATION_DATA:
         /*
          * At this point, we were expecting handshake data, but have
@@ -596,6 +799,12 @@ start:
         if (sc->s3.in_read_app_data && (sc->s3.total_renegotiations != 0) && ossl_statem_app_data_allowed(sc)) {
             sc->s3.in_read_app_data = 2;
             return -1;
+        } else if (sc->version == DTLS1_3_VERSION) {
+            /*
+             * Let's let DTLS ACK and retransmits fix this problem.
+             */
+            ssl_release_record(sc, rr, 0);
+            return -1;
         } else {
             SSLfatal(sc, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_RECORD);
             return -1;
@@ -631,15 +840,17 @@ int do_dtls1_write(SSL_CONNECTION *sc, uint8_t type, const unsigned char *buf,
     int ret;

     /* If we have an alert to send, lets send it */
-    if (sc->s3.alert_dispatch > 0) {
+    if (sc->s3.alert_dispatch != SSL_ALERT_DISPATCH_NONE) {
         i = s->method->ssl_dispatch_alert(s);
         if (i <= 0)
             return i;
         /* if it went, fall through and send more stuff */
     }

-    if (len == 0)
-        return 0;
+    if (len == 0) {
+        *written = 0;
+        return 1;
+    }

     if (len > ssl_get_max_send_fragment(sc)) {
         SSLfatal(sc, SSL_AD_INTERNAL_ERROR, SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE);
@@ -647,12 +858,14 @@ int do_dtls1_write(SSL_CONNECTION *sc, uint8_t type, const unsigned char *buf,
     }

     tmpl.type = type;
+    if (sc->version == DTLS1_3_VERSION)
+        tmpl.version = DTLS1_2_VERSION;
     /*
      * Special case: for hello verify request, client version 1.0 and we
      * haven't decided which version to use yet send back using version 1.0
      * header: otherwise some clients will ignore it.
      */
-    if (s->method->version == DTLS_ANY_VERSION
+    else if (s->method->version == DTLS_ANY_VERSION
         && sc->max_proto_version != DTLS1_BAD_VER)
         tmpl.version = DTLS1_VERSION;
     else
@@ -664,34 +877,78 @@ int do_dtls1_write(SSL_CONNECTION *sc, uint8_t type, const unsigned char *buf,
         sc->rlayer.wrlmethod->write_records(sc->rlayer.wrl, &tmpl, 1));

     if (ret > 0)
-        *written = (int)len;
+        *written = len;
+
+    /*
+     * Add record number to the buffered sent message
+     */
+    if (type == SSL3_RT_HANDSHAKE && ret > 0 && SSL_CONNECTION_IS_DTLS13(sc)) {
+        pitem *item;
+        unsigned char prio[8];
+        dtls_sent_msg *sent_msg;
+        DTLS1_RECORD_NUMBER *rec_num;
+
+        dtls1_get_queue_priority(prio, sc->d1->w_msg.msg_seq, 0);
+        item = pqueue_find(&sc->d1->sent_messages, prio);
+
+        if (item == NULL)
+            return ret;
+
+        sent_msg = (dtls_sent_msg *)item->data;
+        rec_num = dtls1_record_number_new(tmpl.epoch, tmpl.sequence_number,
+            sc->d1->w_frag_off, sc->d1->w_frag_len);
+
+        if (rec_num == NULL)
+            return -1;
+
+        ossl_list_record_number_insert_tail(&sent_msg->rec_nums, rec_num);
+    }

     return ret;
 }

-void dtls1_increment_epoch(SSL_CONNECTION *s, int rw)
+int dtls1_increment_epoch(SSL_CONNECTION *s, int rw)
 {
     if (rw & SSL3_CC_READ) {
-        s->rlayer.d->r_epoch++;
+        if (!SSL_CONNECTION_IS_DTLS13(s) && s->rlayer.d->r_conn_epoch == UINT16_MAX)
+            return 0;
+
+        s->rlayer.d->r_conn_epoch++;

         /*
          * We must not use any buffered messages received from the previous
          * epoch
          */
         dtls1_clear_received_buffer(s);
+
+        if (s->rlayer.d->r_conn_epoch == 0)
+            /* We've wrapped around, so clear the buffer just in case */
+            return 0;
     } else {
-        s->rlayer.d->w_epoch++;
+        if (!SSL_CONNECTION_IS_DTLS13(s) && s->rlayer.d->w_conn_epoch == DTLS1_MAX_EPOCH)
+            return 0;
+
+        /*
+         * RFC 9147 Section 8: sending implementations MUST NOT allow the
+         * epoch to exceed 2^48-1.
+         */
+        if (SSL_CONNECTION_IS_DTLS13(s) && s->rlayer.d->w_conn_epoch == DTLS1_3_MAX_EPOCH)
+            return 0;
+
+        s->rlayer.d->w_conn_epoch++;
     }
+
+    return 1;
 }

-uint16_t dtls1_get_epoch(SSL_CONNECTION *s, int rw)
+uint64_t dtls1_get_epoch(SSL_CONNECTION *s, int rw)
 {
-    uint16_t epoch;
+    uint64_t epoch;

     if (rw & SSL3_CC_READ)
-        epoch = s->rlayer.d->r_epoch;
+        epoch = s->rlayer.d->r_conn_epoch;
     else
-        epoch = s->rlayer.d->w_epoch;
+        epoch = s->rlayer.d->w_conn_epoch;

     return epoch;
 }
diff --git a/deps/openssl/openssl/ssl/record/rec_layer_s3.c b/deps/openssl/openssl/ssl/record/rec_layer_s3.c
index 3ab50facc93..ef7b469b658 100644
--- a/deps/openssl/openssl/ssl/record/rec_layer_s3.c
+++ b/deps/openssl/openssl/ssl/record/rec_layer_s3.c
@@ -56,10 +56,10 @@ int RECORD_LAYER_clear(RECORD_LAYER *rl)
         rl->rrlmethod->free(rl->rrl); /* Ignore return value */
     if (rl->wrlmethod != NULL)
         rl->wrlmethod->free(rl->wrl); /* Ignore return value */
-    BIO_free(rl->rrlnext);
+
     rl->rrlmethod = NULL;
     rl->wrlmethod = NULL;
-    rl->rrlnext = NULL;
+
     rl->rrl = NULL;
     rl->wrl = NULL;

@@ -82,8 +82,8 @@ int RECORD_LAYER_reset(RECORD_LAYER *rl)
             : TLS_ANY_VERSION,
         OSSL_RECORD_DIRECTION_READ,
         OSSL_RECORD_PROTECTION_LEVEL_NONE, NULL, 0,
-        NULL, 0, NULL, 0, NULL, 0, NULL, 0,
-        NID_undef, NULL, NULL, NULL);
+        NULL, NULL, 0, NULL, 0, NULL, 0, NULL, NULL,
+        0, NID_undef, NULL, NULL, NULL);

     ret &= ssl_set_new_record_layer(rl->s,
         SSL_CONNECTION_IS_DTLS(rl->s)
@@ -91,8 +91,8 @@ int RECORD_LAYER_reset(RECORD_LAYER *rl)
             : TLS_ANY_VERSION,
         OSSL_RECORD_DIRECTION_WRITE,
         OSSL_RECORD_PROTECTION_LEVEL_NONE, NULL, 0,
-        NULL, 0, NULL, 0, NULL, 0, NULL, 0,
-        NID_undef, NULL, NULL, NULL);
+        NULL, NULL, 0, NULL, 0, NULL, 0, NULL, NULL,
+        0, NID_undef, NULL, NULL, NULL);

     /* SSLfatal already called in the event of failure */
     return ret;
@@ -126,14 +126,8 @@ static uint32_t ossl_get_max_early_data(SSL_CONNECTION *s)
      * session/psksession. Otherwise we go with the lowest out of the max early
      * data set in the session and the configured max_early_data.
      */
-    if (!s->server && sess->ext.max_early_data == 0) {
-        if (!ossl_assert(s->psksession != NULL
-                && s->psksession->ext.max_early_data > 0)) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            return 0;
-        }
-        sess = s->psksession;
-    }
+    if (!s->server && s->ext.early_data_session != NULL)
+        sess = s->ext.early_data_session;

     if (!s->server)
         max_early_data = sess->ext.max_early_data;
@@ -168,7 +162,7 @@ static int ossl_early_data_count_ok(SSL_CONNECTION *s, size_t length,
             SSL_R_TOO_MUCH_EARLY_DATA);
         return 0;
     }
-    s->early_data_count += length;
+    s->early_data_count += (uint32_t)length;

     return 1;
 }
@@ -366,7 +360,7 @@ int ssl3_write_bytes(SSL *ssl, uint8_t type, const void *buf_, size_t len,
     }

     /* If we have an alert to send, lets send it */
-    if (s->s3.alert_dispatch > 0) {
+    if (s->s3.alert_dispatch != SSL_ALERT_DISPATCH_NONE) {
         i = ssl->method->ssl_dispatch_alert(ssl);
         if (i <= 0) {
             /* SSLfatal() already called if appropriate */
@@ -529,13 +523,18 @@ int ossl_tls_handle_rlayer_return(SSL_CONNECTION *s, int writing, int ret,
                 ERR_new();
                 ERR_set_debug(file, line, 0);
                 ossl_statem_fatal(s, al, SSL_R_RECORD_LAYER_FAILURE, NULL);
+            } else {
+                /*
+                 * Some failure but there is no alert code. We don't log an
+                 * error for this. The record layer should have logged an error
+                 * already or, if not, its due to some sys call error which will be
+                 * reported via SSL_ERROR_SYSCALL and errno. We do still set the
+                 * state machine into an error state via ossl_statem_send_fatal().
+                 * This doesn't actually send an alert because we are using
+                 * SSL_AD_NO_ALERT.
+                 */
+                ossl_statem_send_fatal(s, SSL_AD_NO_ALERT);
             }
-            /*
-             * else some failure but there is no alert code. We don't log an
-             * error for this. The record layer should have logged an error
-             * already or, if not, its due to some sys call error which will be
-             * reported via SSL_ERROR_SYSCALL and errno.
-             */
         }
         /*
          * The record layer distinguishes the cases of EOF, non-fatal
@@ -829,20 +828,6 @@ start:
      * were actually expecting a CCS).
      */

-    /*
-     * Lets just double check that we've not got an SSLv2 record
-     */
-    if (rr->version == SSL2_VERSION) {
-        /*
-         * Should never happen. ssl3_get_record() should only give us an SSLv2
-         * record back if this is the first packet and we are looking for an
-         * initial ClientHello. Therefore |type| should always be equal to
-         * |rr->type|. If not then something has gone horribly wrong
-         */
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-        return -1;
-    }
-
     if (ssl->method->version == TLS_ANY_VERSION
         && (s->server || rr->type != SSL3_RT_ALERT)) {
         /*
@@ -851,7 +836,14 @@ start:
          * with. We shouldn't be receiving anything other than a ClientHello
          * if we are a server.
          */
-        s->version = rr->version;
+        int min_version, max_version;
+
+        if (ssl_get_min_max_version(s, &min_version, &max_version, NULL) != 0) {
+            SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, ERR_R_INTERNAL_ERROR);
+            return -1;
+        }
+
+        s->version = min_version;
         SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
         return -1;
     }
@@ -1122,17 +1114,6 @@ start:
     }
 }

-/*
- * Returns true if the current rrec was sent in SSLv2 backwards compatible
- * format and false otherwise.
- */
-int RECORD_LAYER_is_sslv2_record(RECORD_LAYER *rl)
-{
-    if (SSL_CONNECTION_IS_DTLS(rl->s))
-        return 0;
-    return rl->tlsrecs[0].version == SSL2_VERSION;
-}
-
 static OSSL_FUNC_rlayer_msg_callback_fn rlayer_msg_callback_wrapper;
 static void rlayer_msg_callback_wrapper(int write_p, int version,
     int content_type, const void *buf,
@@ -1165,11 +1146,91 @@ static size_t rlayer_padding_wrapper(void *cbarg, int type, size_t len)
         s->rlayer.record_padding_arg);
 }

+/*
+ * Callbacks for URXE listener-based connections to read packets from their
+ * receive queue.
+ */
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+static OSSL_FUNC_rlayer_get_urxe_packet_fn rlayer_dtls_get_urxe_packet;
+static int rlayer_dtls_get_urxe_packet(void *cbarg, unsigned char **data,
+    size_t *len, void **packet_handle)
+{
+    SSL_CONNECTION *s = cbarg;
+    DGRAM_URXE *urxe;
+
+    if (s == NULL || s->d1 == NULL || s->d1->rx == NULL)
+        return 0;
+
+    urxe = ossl_dtls_read_datagram(s->d1->rx);
+
+    /*
+     * If no datagrams available and we have a parent listener, try to pump
+     * the demux to get more data from the network.
+     *
+     * This is safe because dtls_listener_drive_pending() releases the mutex
+     * before calling SSL_accept() on connections, so the packet handler
+     * callback can acquire the mutex when needed.
+     */
+    if (urxe == NULL && s->d1->listener != NULL) {
+        ossl_dgram_demux_pump(s->d1->rx->demux);
+        urxe = ossl_dtls_read_datagram(s->d1->rx);
+    }
+
+    /*
+     * Still nothing. In blocking mode this is where the caller waits: the
+     * connection has no BIO of its own to block in, so returning here would
+     * report SSL_ERROR_WANT_READ instead of blocking. Waiting inside this
+     * callback keeps that out of the record layer and the state machine, which
+     * see only a read which took a while, exactly as a blocking BIO would give
+     * them.
+     */
+    if (urxe == NULL && s->d1->listener != NULL
+        && ossl_dtls_blocking(SSL_CONNECTION_GET_SSL(s))
+        && ossl_dtls_conn_wait_for_datagram(SSL_CONNECTION_GET_SSL(s)))
+        urxe = ossl_dtls_read_datagram(s->d1->rx);
+
+    if (urxe == NULL)
+        return 0;
+
+    *data = ossl_dgram_urxe_data(urxe);
+    *len = urxe->data_len;
+    *packet_handle = urxe;
+    return 1;
+}
+
+static OSSL_FUNC_rlayer_release_urxe_packet_fn rlayer_dtls_release_urxe_packet;
+static void rlayer_dtls_release_urxe_packet(void *cbarg, void *packet_handle)
+{
+    SSL_CONNECTION *s = cbarg;
+    DGRAM_URXE *urxe = packet_handle;
+
+    if (s != NULL && s->d1 != NULL && s->d1->rx != NULL && urxe != NULL)
+        ossl_dtls_rx_release_urxe(s->d1->rx, urxe);
+}
+
+static OSSL_FUNC_rlayer_block_for_write_fn rlayer_dtls_block_for_write;
+static int rlayer_dtls_block_for_write(void *cbarg)
+{
+    SSL_CONNECTION *s = cbarg;
+
+    if (s == NULL || s->d1 == NULL || s->d1->listener == NULL
+        || !ossl_dtls_blocking(SSL_CONNECTION_GET_SSL(s)))
+        return 0;
+
+    return ossl_dtls_conn_wait_for_write(SSL_CONNECTION_GET_SSL(s));
+}
+#endif
+
 static const OSSL_DISPATCH rlayer_dispatch[] = {
     { OSSL_FUNC_RLAYER_SKIP_EARLY_DATA, (void (*)(void))ossl_statem_skip_early_data },
     { OSSL_FUNC_RLAYER_MSG_CALLBACK, (void (*)(void))rlayer_msg_callback_wrapper },
     { OSSL_FUNC_RLAYER_SECURITY, (void (*)(void))rlayer_security_wrapper },
     { OSSL_FUNC_RLAYER_PADDING, (void (*)(void))rlayer_padding_wrapper },
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    { OSSL_FUNC_RLAYER_GET_URXE_PACKET, (void (*)(void))rlayer_dtls_get_urxe_packet },
+    { OSSL_FUNC_RLAYER_RELEASE_URXE_PACKET, (void (*)(void))rlayer_dtls_release_urxe_packet },
+    { OSSL_FUNC_RLAYER_BLOCK_FOR_WRITE, (void (*)(void))rlayer_dtls_block_for_write },
+#endif
     OSSL_DISPATCH_END
 };

@@ -1243,9 +1304,11 @@ static int ssl_post_record_layer_select(SSL_CONNECTION *s, int direction)
 int ssl_set_new_record_layer(SSL_CONNECTION *s, int version,
     int direction, int level,
     unsigned char *secret, size_t secretlen,
+    unsigned char *snkey,
     unsigned char *key, size_t keylen,
     unsigned char *iv, size_t ivlen,
     unsigned char *mackey, size_t mackeylen,
+    const EVP_CIPHER *snciph,
     const EVP_CIPHER *ciph, size_t taglen,
     int mactype, const EVP_MD *md,
     const SSL_COMP *comp, const EVP_MD *kdfdigest)
@@ -1264,6 +1327,34 @@ int ssl_set_new_record_layer(SSL_CONNECTION *s, int version,
     int use_early_data = 0;
     uint32_t max_early_data;
     COMP_METHOD *compm = (comp == NULL) ? NULL : comp->method;
+    uint64_t epoch_zero;
+    uint64_t seq;
+    int use_urxe = 0;
+
+    if (direction == OSSL_RECORD_DIRECTION_READ) {
+        if (SSL_CONNECTION_IS_DTLS(s)) {
+            if (s->rlayer.curr_rec < s->rlayer.num_recs) {
+                /*
+                 * We are trying to move to the next epoch, but we've still got
+                 * trailing record data to process. This should not happen in
+                 * normal circumstances. The CCS must have arrived early, but
+                 * this remaining record data is unexpected.
+                 */
+                SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
+                return 0;
+            }
+        } else {
+            if (!ossl_assert(s->rlayer.curr_rec == s->rlayer.num_recs)) {
+                /*
+                 * How can this happen? We're trying to change to the next
+                 * record layer - but that should only happen on a record
+                 * boundary. We should never be able to get here.
+                 */
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return 0;
+            }
+        }
+    }

     meth = ssl_select_next_record_layer(s, direction, level);

@@ -1366,11 +1457,30 @@ int ssl_set_new_record_layer(SSL_CONNECTION *s, int version,

     *set = OSSL_PARAM_construct_end();

+    /*
+     * For DTLS save off the sequence number for epoch 0 when we are setting up
+     * a new write record layer. This is needed for handling in case of HRR
+     * and we create a new write record layer for epoch 0.
+     */
+    if (direction == OSSL_RECORD_DIRECTION_WRITE
+        && SSL_CONNECTION_IS_DTLS(s)
+        && s->rlayer.wrl != NULL
+        && meth->get_epoch(s->rlayer.wrl, &epoch_zero) == 1
+        && epoch_zero == 0) {
+        if (meth->get_sequence(s->rlayer.wrl,
+                &seq)
+            != 1) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+        s->rlayer.wlayer_epoch_zero_sequence = seq;
+    }
+
     for (;;) {
         int rlret;
         BIO *prev = NULL;
         BIO *next = NULL;
-        unsigned int epoch = 0;
+        uint64_t epoch = 0;
         OSSL_DISPATCH rlayer_dispatch_tmp[OSSL_NELEM(rlayer_dispatch)];
         size_t i, j;

@@ -1418,12 +1528,25 @@ int ssl_set_new_record_layer(SSL_CONNECTION *s, int version,
             rlayer_dispatch_tmp[j++] = rlayer_dispatch[i];
         }

+#ifndef OPENSSL_NO_DTLS
+        if (SSL_CONNECTION_IS_DTLS(s) && s->d1 != NULL) {
+
+            /*
+             * For DTLS listener-created connections, use the URXE queue for
+             * reading. This is determined by the existence of s->d1->rx.
+             */
+            if (direction == OSSL_RECORD_DIRECTION_READ && s->d1->rx != NULL)
+                use_urxe = 1;
+        }
+#endif
+
         rlret = meth->new_record_layer(sctx->libctx, sctx->propq, version,
             s->server, direction, level, epoch,
-            secret, secretlen, key, keylen, iv,
-            ivlen, mackey, mackeylen, ciph, taglen,
-            mactype, md, compm, kdfdigest, prev,
-            thisbio, next, NULL, NULL, settings,
+            secret, secretlen, snkey, key, keylen,
+            iv,
+            ivlen, mackey, mackeylen, snciph, ciph,
+            taglen, mactype, md, compm, kdfdigest,
+            prev, thisbio, next, use_urxe, settings,
             options, rlayer_dispatch_tmp, s,
             s->rlayer.rlarg, &newrl);
         BIO_free(prev);
@@ -1461,16 +1584,64 @@ int ssl_set_new_record_layer(SSL_CONNECTION *s, int version,
      * case the record layer is still referenced by those buffered messages for
      * potential retransmit. Only when those buffered messages get freed do we
      * free the record layer object (see dtls1_hm_fragment_free)
+     *
+     * For a DTLS 1.3 read layer, hand the old one to the new one for
+     * retention instead of freeing it: a retransmission of the message that
+     * caused this epoch bump may still arrive at the old epoch if the ACK we
+     * sent for it was lost, and it needs the old epoch's keys and replay
+     * window to be authenticated (see dtls_get_more_records()).
      */
-    if (!SSL_CONNECTION_IS_DTLS(s)
+    if (SSL_CONNECTION_IS_DTLS13(s)
+        && direction == OSSL_RECORD_DIRECTION_READ
+        && *thismethod != NULL
+        && meth->set_prev_epoch_rl != NULL) {
+        if (!meth->set_prev_epoch_rl(newrl, *thisrl)) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+    } else if (!SSL_CONNECTION_IS_DTLS(s)
         || direction == OSSL_RECORD_DIRECTION_READ
-        || pqueue_peek(s->d1->sent_messages) == NULL) {
+        || pqueue_peek(&s->d1->sent_messages) == NULL) {
         if (*thismethod != NULL && !(*thismethod)->free(*thisrl)) {
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             return 0;
         }
     }

+    /*
+     * For DTLS if we created a new write record layer
+     * for epoch zero we need to set the sequence number.
+     * This is needed for handling HRR case.
+     */
+    if (direction == OSSL_RECORD_DIRECTION_WRITE
+        && SSL_CONNECTION_IS_DTLS(s)
+        && meth->get_epoch(newrl, &epoch_zero) == 1
+        && epoch_zero == 0) {
+
+        if (meth->set_sequence(newrl,
+                s->rlayer.wlayer_epoch_zero_sequence)
+            != 1) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+    }
+
+    /*
+     * For DTLS listener-created connections the peer address must be applied
+     * to every record layer as it is created (including the encrypted layers
+     * built during the handshake). SSL_set1_initial_peer_addr() only updates
+     * the record layers that exist when it is called, so writes on a later
+     * layer would otherwise fall back to BIO_write() on the shared listener
+     * BIO instead of BIO_sendmmsg() to the peer.
+     */
+#ifndef OPENSSL_NO_SOCK
+    if (SSL_CONNECTION_IS_DTLS(s)
+        && s->d1 != NULL
+        && meth->set1_peer != NULL
+        && BIO_ADDR_family(&s->d1->peer_addr) != AF_UNSPEC)
+        meth->set1_peer(newrl, &s->d1->peer_addr);
+#endif
+
     *thisrl = newrl;
     *thismethod = meth;

@@ -1479,11 +1650,14 @@ int ssl_set_new_record_layer(SSL_CONNECTION *s, int version,

 int ssl_set_record_protocol_version(SSL_CONNECTION *s, int vers)
 {
-    if (!ossl_assert(s->rlayer.rrlmethod != NULL)
-        || !ossl_assert(s->rlayer.wrlmethod != NULL))
+    if ((s->negotiated_version != PROTO_VERSION_UNSET && s->negotiated_version != vers)
+        || !ossl_assert(s->rlayer.rrlmethod != NULL)
+        || !ossl_assert(s->rlayer.wrlmethod != NULL)
+        || !s->rlayer.rrlmethod->set_protocol_version(s->rlayer.rrl, vers)
+        || !s->rlayer.wrlmethod->set_protocol_version(s->rlayer.wrl, vers))
         return 0;
-    s->rlayer.rrlmethod->set_protocol_version(s->rlayer.rrl, s->version);
-    s->rlayer.wrlmethod->set_protocol_version(s->rlayer.wrl, s->version);
+
+    s->negotiated_version = vers;

     return 1;
 }
diff --git a/deps/openssl/openssl/ssl/record/record.h b/deps/openssl/openssl/ssl/record/record.h
index 8e7b8838452..c622c1f0b40 100644
--- a/deps/openssl/openssl/ssl/record/record.h
+++ b/deps/openssl/openssl/ssl/record/record.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,8 +7,13 @@
  * https://www.openssl.org/source/license.html
  */

+#if !defined(OSSL_SSL_RECORD_RECORD_H)
+#define OSSL_SSL_RECORD_RECORD_H
+
 #include <openssl/core_dispatch.h>
+
 #include "internal/recordmethod.h"
+#include "internal/statem.h"

 /*****************************************************************************
  *                                                                           *
@@ -34,23 +39,31 @@ typedef struct tls_record_st {
     size_t length;
     /* Offset into the data buffer where to start reading */
     size_t off;
-    /* epoch number. DTLS only */
-    uint16_t epoch;
+    /* Serialized DTLS epoch */
+    uint64_t epoch;
     /* sequence number. DTLS only */
-    unsigned char seq_num[SEQ_NUM_SIZE];
+    uint64_t seq_num;
 #ifndef OPENSSL_NO_SCTP
     struct bio_dgram_sctp_rcvinfo recordinfo;
 #endif
 } TLS_RECORD;

+/*
+ * RFC 9147 Section 8: sending implementations MUST NOT allow the epoch to
+ * exceed 2^48-1. This margin (rather than the 2^64-1 wire/representation
+ * ceiling of Section 6.1) is what actually bounds w_conn_epoch for DTLS 1.3.
+ */
+#define DTLS1_3_MAX_EPOCH ((uint64_t)0xFFFFFFFFFFFFULL)
+#define DTLS1_MAX_EPOCH UINT16_MAX
+
 typedef struct dtls_record_layer_st {
     /*
-     * The current data and handshake epoch.  This is initially
+     * The current data and handshake epoch. This is initially
      * undefined, and starts at zero once the initial handshake is
      * completed
      */
-    uint16_t r_epoch;
-    uint16_t w_epoch;
+    uint64_t r_conn_epoch;
+    uint64_t w_conn_epoch;

     /*
      * Buffered application records. Only for records between CCS and
@@ -122,6 +135,8 @@ typedef struct record_layer_st {
     /* Record layer data to be processed */
     TLS_RECORD tlsrecs[SSL_MAX_PIPELINES];

+    /* DTLS epoch zero write sequence number */
+    uint64_t wlayer_epoch_zero_sequence;
 } RECORD_LAYER;

 /*****************************************************************************
@@ -140,7 +155,6 @@ int RECORD_LAYER_reset(RECORD_LAYER *rl);
 int RECORD_LAYER_read_pending(const RECORD_LAYER *rl);
 int RECORD_LAYER_processed_read_pending(const RECORD_LAYER *rl);
 int RECORD_LAYER_write_pending(const RECORD_LAYER *rl);
-int RECORD_LAYER_is_sslv2_record(RECORD_LAYER *rl);
 __owur size_t ssl3_pending(const SSL *s);
 __owur int ssl3_write_bytes(SSL *s, uint8_t type, const void *buf, size_t len,
     size_t *written);
@@ -151,6 +165,7 @@ __owur int ssl3_read_bytes(SSL *s, uint8_t type, uint8_t *recvd_type,
 int DTLS_RECORD_LAYER_new(RECORD_LAYER *rl);
 void DTLS_RECORD_LAYER_free(RECORD_LAYER *rl);
 void DTLS_RECORD_LAYER_clear(RECORD_LAYER *rl);
+int DTLS_RECORD_LAYER_buffered_app_data_pending(const RECORD_LAYER *rl);
 __owur int dtls1_read_bytes(SSL *s, uint8_t type, uint8_t *recvd_type,
     unsigned char *buf, size_t len, int peek,
     size_t *readbytes);
@@ -158,8 +173,9 @@ __owur int dtls1_write_bytes(SSL_CONNECTION *s, uint8_t type, const void *buf,
     size_t len, size_t *written);
 int do_dtls1_write(SSL_CONNECTION *s, uint8_t type, const unsigned char *buf,
     size_t len, size_t *written);
-void dtls1_increment_epoch(SSL_CONNECTION *s, int rw);
-uint16_t dtls1_get_epoch(SSL_CONNECTION *s, int rw);
+int dtls1_increment_epoch(SSL_CONNECTION *s, int rw);
+uint64_t dtls1_get_epoch(SSL_CONNECTION *s, int rw);
+uint64_t dtls1_get_record_sequence_number(SSL_CONNECTION *s);
 int ssl_release_record(SSL_CONNECTION *s, TLS_RECORD *rr, size_t length);

 #define HANDLE_RLAYER_READ_RETURN(s, ret) \
@@ -174,9 +190,11 @@ int ossl_tls_handle_rlayer_return(SSL_CONNECTION *s, int writing, int ret,
 int ssl_set_new_record_layer(SSL_CONNECTION *s, int version,
     int direction, int level,
     unsigned char *secret, size_t secretlen,
+    unsigned char *snkey,
     unsigned char *key, size_t keylen,
     unsigned char *iv, size_t ivlen,
     unsigned char *mackey, size_t mackeylen,
+    const EVP_CIPHER *snciph,
     const EVP_CIPHER *ciph, size_t taglen,
     int mactype, const EVP_MD *md,
     const SSL_COMP *comp, const EVP_MD *kdfdigest);
@@ -190,3 +208,28 @@ OSSL_CORE_MAKE_FUNC(void, rlayer_msg_callback, (int write_p, int version, int co
 OSSL_CORE_MAKE_FUNC(int, rlayer_security, (void *cbarg, int op, int bits, int nid, void *other))
 #define OSSL_FUNC_RLAYER_PADDING 4
 OSSL_CORE_MAKE_FUNC(size_t, rlayer_padding, (void *cbarg, int type, size_t len))
+
+/*
+ * Callback for listener-based connections to read data from their receive
+ * queue. Used by DTLS listener connections (and future TLS listener).
+ * Returns 1 on success with data/len set, 0 if no data available.
+ * The caller must call the release callback when done with the data.
+ */
+#define OSSL_FUNC_RLAYER_GET_URXE_PACKET 5
+OSSL_CORE_MAKE_FUNC(int, rlayer_get_urxe_packet, (void *cbarg, unsigned char **data, size_t *len, void **packet_handle))
+#define OSSL_FUNC_RLAYER_RELEASE_URXE_PACKET 6
+OSSL_CORE_MAKE_FUNC(void, rlayer_release_urxe_packet, (void *cbarg, void *packet_handle))
+
+/*
+ * Callback for listener-based connections to wait until their shared socket can
+ * accept a datagram, for a connection which is in blocking mode. Such a
+ * connection cannot block in the socket itself, because the socket is shared
+ * with every other connection and is always non-blocking.
+ *
+ * Returns 1 if the send should be attempted again, or 0 to report the write as
+ * needing a retry in the usual way.
+ */
+#define OSSL_FUNC_RLAYER_BLOCK_FOR_WRITE 7
+OSSL_CORE_MAKE_FUNC(int, rlayer_block_for_write, (void *cbarg))
+
+#endif /* !defined(OSSL_SSL_RECORD_RECORD_H) */
diff --git a/deps/openssl/openssl/ssl/record/record_local.h b/deps/openssl/openssl/ssl/record/record_local.h
index bd7608db53c..d6ed50b6447 100644
--- a/deps/openssl/openssl/ssl/record/record_local.h
+++ b/deps/openssl/openssl/ssl/record/record_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,4 +14,9 @@
  *                                                                           *
  *****************************************************************************/

+#if !defined(OSSL_SSL_RECORD_RECORD_LOCAL_H)
+#define OSSL_SSL_RECORD_RECORD_LOCAL_H
+
 #define MAX_WARN_ALERT_COUNT 5
+
+#endif /* !defined(OSSL_SSL_RECORD_RECORD_LOCAL_H) */
diff --git a/deps/openssl/openssl/ssl/rio/build.info b/deps/openssl/openssl/ssl/rio/build.info
index 8e8ebaba468..b042a878810 100644
--- a/deps/openssl/openssl/ssl/rio/build.info
+++ b/deps/openssl/openssl/ssl/rio/build.info
@@ -1,6 +1,9 @@
 $LIBSSL=../../libssl

 SOURCE[$LIBSSL]=poll_immediate.c
-IF[{- !$disabled{quic} -}]
-  SOURCE[$LIBSSL]=rio_notifier.c poll_builder.c
+IF[{- !$disabled{quic} || !$disabled{dtls} -}]
+  SOURCE[$LIBSSL]=rio_notifier.c
+ENDIF
+IF[{- !$disabled{quic} || !$disabled{dtls} -}]
+  SOURCE[$LIBSSL]=poll_builder.c
 ENDIF
diff --git a/deps/openssl/openssl/ssl/rio/poll_builder.c b/deps/openssl/openssl/ssl/rio/poll_builder.c
index f808e9b01e7..509c79918fc 100644
--- a/deps/openssl/openssl/ssl/rio/poll_builder.c
+++ b/deps/openssl/openssl/ssl/rio/poll_builder.c
@@ -137,10 +137,40 @@ int ossl_rio_poll_builder_add_fd(RIO_POLL_BUILDER *rpb, int fd,
 #endif
 }

+/* Returns 1 if no file descriptors have been added to the poll builder. */
+static int rio_poll_builder_is_empty(const RIO_POLL_BUILDER *rpb)
+{
+#if RIO_POLL_METHOD == RIO_POLL_METHOD_SELECT
+    return rpb->hwm_fd < 0;
+#elif RIO_POLL_METHOD == RIO_POLL_METHOD_POLL
+    return rpb->pfd_num == 0;
+#else
+    return 1;
+#endif
+}
+
 int ossl_rio_poll_builder_poll(RIO_POLL_BUILDER *rpb, OSSL_TIME deadline)
 {
     int rc;

+    /*
+     * Waiting with no file descriptors is legitimate: a DTLS connection whose
+     * BIO cannot provide a poll descriptor has no readiness to wait for, but
+     * still has a retransmission deadline to wake for. Handle that here rather
+     * than leaving it to the OS, because poll() treats an empty descriptor set
+     * as a plain sleep whereas Windows' select() rejects it outright.
+     *
+     * With no descriptors and no deadline nothing could ever wake us, so that
+     * is a caller error rather than an indefinite sleep.
+     */
+    if (rio_poll_builder_is_empty(rpb)) {
+        if (ossl_time_is_infinite(deadline))
+            return 0;
+
+        OSSL_sleep(ossl_time2ms(ossl_time_subtract(deadline, ossl_time_now())));
+        return 1;
+    }
+
 #if RIO_POLL_METHOD == RIO_POLL_METHOD_SELECT
     do {
         struct timeval timeout, *p_timeout = &timeout;
diff --git a/deps/openssl/openssl/ssl/rio/poll_immediate.c b/deps/openssl/openssl/ssl/rio/poll_immediate.c
index 95410df0d8f..7b50fe5a916 100644
--- a/deps/openssl/openssl/ssl/rio/poll_immediate.c
+++ b/deps/openssl/openssl/ssl/rio/poll_immediate.c
@@ -10,11 +10,32 @@
 #include "internal/common.h"
 #include "internal/quic_ssl.h"
 #include "internal/quic_reactor_wait_ctx.h"
+#include "internal/ssl_unwrap.h"
 #include <openssl/ssl.h>
 #include <openssl/err.h>
 #include "../ssl_local.h"
 #include "poll_builder.h"

+#ifndef OPENSSL_NO_DTLS
+typedef struct dtls_poll_wait_slot_st {
+    struct dtls_poll_wait_slot_st *next;
+    SSL *listener;
+    uint64_t generation;
+    int need_wait;
+} DTLS_POLL_WAIT_SLOT;
+#endif
+
+#if !defined(OPENSSL_NO_QUIC) || !defined(OPENSSL_NO_DTLS)
+typedef struct poll_wait_ctx_st {
+#ifndef OPENSSL_NO_QUIC
+    QUIC_REACTOR_WAIT_CTX quic;
+#endif
+#ifndef OPENSSL_NO_DTLS
+    DTLS_POLL_WAIT_SLOT *dtls;
+#endif
+} POLL_WAIT_CTX;
+#endif
+
 #if defined(_AIX)
 /*
  * Some versions of AIX define macros for events and revents for use when
@@ -142,15 +163,16 @@ static int poll_translate_ssl_quic(SSL *ssl,
          * it is possible the object became ready after our initial
          * poll_readout() call (before we determined that nothing was ready and
          * we needed to block). We now need to do another readout, in which case
-         * blocking is to be aborted.
+         * blocking is to be aborted. do_tick is 0 because ticking here would
+         * block on the notifier condvar while still registered.
          */
         if (!ossl_quic_conn_poll_events(ssl, events, /*do_tick = */ 0, &revents)) {
-            ossl_quic_leave_blocking_section(ssl, wctx);
+            ossl_quic_deregister_blocking_section(ssl, wctx);
             return 0;
         }

         if (revents != 0) {
-            ossl_quic_leave_blocking_section(ssl, wctx);
+            ossl_quic_deregister_blocking_section(ssl, wctx);
             *abort_blocking = 1;
             return 1;
         }
@@ -159,22 +181,269 @@ static int poll_translate_ssl_quic(SSL *ssl,
     return 1;
 }

-static void postpoll_translation_cleanup_ssl_quic(SSL *ssl,
+static void postpoll_translation_deregister_ssl_quic(SSL *ssl,
     QUIC_REACTOR_WAIT_CTX *wctx)
 {
     if (ossl_quic_get_notifier_fd(ssl) != -1)
-        ossl_quic_leave_blocking_section(ssl, wctx);
+        ossl_quic_deregister_blocking_section(ssl, wctx);
 }
+#endif /* OPENSSL_NO_QUIC */

-static void postpoll_translation_cleanup(SSL_POLL_ITEM *items,
-    size_t num_items,
-    size_t stride,
-    QUIC_REACTOR_WAIT_CTX *wctx)
+#ifndef OPENSSL_NO_DTLS
+/* Record each listener before registering, including on partial setup exits. */
+static int poll_register_dtls_listener(POLL_WAIT_CTX *wctx, SSL *listener)
 {
+    DTLS_POLL_WAIT_SLOT *slot;
+
+    for (slot = wctx->dtls; slot != NULL; slot = slot->next)
+        if (slot->listener == listener)
+            return 1;
+
+    if ((slot = OPENSSL_zalloc(sizeof(*slot))) == NULL)
+        return 0;
+
+    slot->listener = listener;
+    slot->next = wctx->dtls;
+    wctx->dtls = slot;
+    ossl_dtls_listener_enter_blocking_section(listener);
+    return 1;
+}
+
+static int poll_translate_ssl_dtls_listener(SSL *ssl,
+    POLL_WAIT_CTX *wctx,
+    RIO_POLL_BUILDER *rpb,
+    uint64_t events,
+    int *abort_blocking)
+{
+    BIO *rbio;
+    BIO_POLL_DESCRIPTOR desc;
+    DTLS_LISTENER *dl = (DTLS_LISTENER *)ssl;
+    uint64_t revents = 0;
+    int nfd;
+
+    rbio = SSL_get_rbio(ssl);
+    if (rbio == NULL)
+        return 0;
+
+    if (!BIO_get_rpoll_descriptor(rbio, &desc)
+        || desc.type != BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD) {
+        ERR_raise_data(ERR_LIB_SSL, SSL_R_POLL_REQUEST_NOT_SUPPORTED,
+            "DTLS listener requires a socket BIO for blocking poll");
+        return 0;
+    }
+
+    /*
+     * Input already taken off the socket for a pending connection is not
+     * signalled by the socket. Tick again instead of sleeping.
+     */
+    if (ossl_dtls_listener_has_pending_input(ssl)) {
+        *abort_blocking = 1;
+        return 1;
+    }
+
+    /*
+     * Watch the socket for readability whatever was asked for. Every event a
+     * listener reports is ultimately driven by a datagram arriving, both an
+     * incoming connection and data pending on the listener itself, so there is
+     * no event for which this is the wrong thing to wait on. events is
+     * therefore only consulted for the readiness re-check below.
+     */
+    if (!ossl_rio_poll_builder_add_fd(rpb, desc.value.fd, /*r=*/1, /*w=*/0))
+        return 0;
+
+    /*
+     * Add the notifier FD for the DTLS listener (if multi-threaded mode is
+     * enabled). Another thread may queue an incoming connection for us, or
+     * demux data to one of our connections, without the underlying network
+     * socket ever becoming readable from our perspective.
+     */
+    if (dl->have_notifier) {
+        nfd = ossl_rio_notifier_as_fd(&dl->notifier);
+        if (nfd != -1) {
+            if (!ossl_rio_poll_builder_add_fd(rpb, nfd, /*r=*/1, /*w=*/0))
+                return 0;
+
+            /* Tell the listener we need to receive notifications. */
+            if (!poll_register_dtls_listener(wctx, ssl))
+                return 0;
+
+            /*
+             * Only after the above call returns is it guaranteed that any
+             * readiness events will cause the notifier to become readable.
+             * Therefore it is possible the listener became ready after the
+             * readout which decided we needed to block. Re-check now.
+             */
+            if (!ossl_dtls_listener_poll_events(ssl, events, /*do_tick=*/0,
+                    &revents))
+                return 0;
+
+            if (revents != 0 || ossl_dtls_listener_has_pending_input(ssl)) {
+                *abort_blocking = 1;
+                return 1;
+            }
+        }
+    }
+
+    return 1;
+}
+
+static int poll_translate_ssl_dtls_conn(SSL *ssl,
+    POLL_WAIT_CTX *wctx,
+    RIO_POLL_BUILDER *rpb,
+    uint64_t events,
+    int *abort_blocking)
+{
+    BIO *rbio, *wbio;
+    BIO_POLL_DESCRIPTOR rdesc, wdesc;
+    int rfd = -1, wfd = -1, nfd = -1;
+    SSL_CONNECTION *sc;
+    DTLS_LISTENER *dl = NULL;
+    int has_pending;
+
+    sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
+
+    if (sc != NULL && sc->d1 != NULL && sc->d1->listener != NULL)
+        dl = (DTLS_LISTENER *)sc->d1->listener;
+
+    if ((events & SSL_POLL_EVENT_R) != 0) {
+        rbio = SSL_get_rbio(ssl);
+
+        if (rbio == NULL && dl != NULL) {
+            /*
+             * Listener-based DTLS connection. First, pump the listener's
+             * demux to ensure any pending datagrams on the socket are
+             * routed to their respective connection URXE queues.
+             */
+            ossl_dtls_tick(dl);
+
+            /*
+             * Now check the URXE buffer. If data has been demuxed into
+             * this connection's receive queue, abort blocking immediately -
+             * there is no need to wait on the socket FD. Likewise if the
+             * tick left input undriven on a pending connection: the socket
+             * will not signal it, so tick again instead of sleeping.
+             */
+            if (ossl_dtls_listener_has_pending_input(sc->d1->listener)) {
+                *abort_blocking = 1;
+                return 1;
+            }
+            if (sc->d1->rx != NULL) {
+                ossl_crypto_mutex_lock(sc->d1->rx->mutex);
+                has_pending = !ossl_list_urxe_is_empty(&sc->d1->rx->urxe_pending);
+                ossl_crypto_mutex_unlock(sc->d1->rx->mutex);
+                if (has_pending) {
+                    *abort_blocking = 1;
+                    return 1;
+                }
+            }
+
+            /*
+             * Add the notifier FD for the DTLS listener (if multi-threaded
+             * mode is enabled). This ensures we get woken up if another thread
+             * demuxes data to this connection's URXE queue without the
+             * underlying network socket ever becoming readable from our
+             * perspective.
+             */
+            if (dl->have_notifier) {
+                nfd = ossl_rio_notifier_as_fd(&dl->notifier);
+                if (nfd != -1) {
+                    if (!ossl_rio_poll_builder_add_fd(rpb, nfd, /*r=*/1, /*w=*/0))
+                        return 0;
+
+                    /* Tell listener we need to receive notifications. */
+                    if (!poll_register_dtls_listener(wctx, sc->d1->listener))
+                        return 0;
+
+                    /*
+                     * Only after the above call returns is it guaranteed that
+                     * any readiness events will cause the notifier to become
+                     * readable. Therefore, it is possible data was demuxed to
+                     * our URXE queue, or input left on a pending connection,
+                     * after our initial check above but before we entered
+                     * the blocking section. Re-check now.
+                     */
+                    has_pending = ossl_dtls_listener_has_pending_input(sc->d1->listener);
+                    if (!has_pending && sc->d1->rx != NULL) {
+                        ossl_crypto_mutex_lock(sc->d1->rx->mutex);
+                        has_pending = !ossl_list_urxe_is_empty(&sc->d1->rx->urxe_pending);
+                        ossl_crypto_mutex_unlock(sc->d1->rx->mutex);
+                    }
+                    if (has_pending) {
+                        *abort_blocking = 1;
+                        return 1;
+                    }
+                }
+            }
+
+            /*
+             * URXE buffer is empty. Fall back to the listener's rbio so the
+             * OS-level poll() wakes us up when the shared socket becomes
+             * readable and new datagrams may arrive.
+             */
+            rbio = SSL_get_rbio(sc->d1->listener);
+        }
+
+        if (rbio != NULL) {
+            if (BIO_get_rpoll_descriptor(rbio, &rdesc)
+                && rdesc.type == BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD)
+                rfd = rdesc.value.fd;
+        }
+    }
+
+    if ((events & SSL_POLL_EVENT_W) != 0) {
+        wbio = SSL_get_wbio(ssl);
+        if (wbio != NULL) {
+            if (BIO_get_wpoll_descriptor(wbio, &wdesc)
+                && wdesc.type == BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD)
+                wfd = wdesc.value.fd;
+        }
+    }
+
+    /* If same FD for read and write, combine them */
+    if (rfd != -1 && wfd == rfd) {
+        if (!ossl_rio_poll_builder_add_fd(rpb, rfd, /*r=*/1, /*w=*/1))
+            return 0;
+    } else {
+        if (rfd != -1)
+            if (!ossl_rio_poll_builder_add_fd(rpb, rfd, /*r=*/1, /*w=*/0))
+                return 0;
+        if (wfd != -1)
+            if (!ossl_rio_poll_builder_add_fd(rpb, wfd, /*r=*/0, /*w=*/1))
+                return 0;
+    }
+
+    return 1;
+}
+
+#endif /* OPENSSL_NO_DTLS */
+
+#if !defined(OPENSSL_NO_QUIC) || !defined(OPENSSL_NO_DTLS)
+static void postpoll_translation_cleanup(ossl_unused SSL_POLL_ITEM *items,
+    ossl_unused size_t num_items,
+    ossl_unused size_t stride,
+    POLL_WAIT_CTX *wctx)
+{
+#ifndef OPENSSL_NO_DTLS
+    DTLS_POLL_WAIT_SLOT *slot, *next;
+#endif
+#ifndef OPENSSL_NO_QUIC
     SSL_POLL_ITEM *item;
     SSL *ssl;
     size_t i;
+#endif

+    /*
+     * Phase 1 releases every DTLS and QUIC registration without waiting for
+     * any notifier. Otherwise cleanup could wait for a registration this
+     * call still owns, including one for the other protocol.
+     */
+#ifndef OPENSSL_NO_DTLS
+    for (slot = wctx->dtls; slot != NULL; slot = slot->next)
+        slot->need_wait = ossl_dtls_listener_deregister_blocking_section(
+            slot->listener, &slot->generation);
+#endif
+
+#ifndef OPENSSL_NO_QUIC
     for (i = 0; i < num_items; ++i) {
         item = &ITEM_N(items, stride, i);

@@ -185,13 +454,12 @@ static void postpoll_translation_cleanup(SSL_POLL_ITEM *items,
                 break;

             switch (ssl->type) {
-#ifndef OPENSSL_NO_QUIC
             case SSL_TYPE_QUIC_LISTENER:
             case SSL_TYPE_QUIC_CONNECTION:
             case SSL_TYPE_QUIC_XSO:
-                postpoll_translation_cleanup_ssl_quic(ssl, wctx);
+                postpoll_translation_deregister_ssl_quic(ssl, &wctx->quic);
                 break;
-#endif
+
             default:
                 break;
             }
@@ -200,15 +468,37 @@ static void postpoll_translation_cleanup(SSL_POLL_ITEM *items,
             break;
         }
     }
+#endif
+
+    /*
+     * Phase 2 waits for the recorded notification cycles to finish before
+     * the retry loop can re-register. No registrations owned by this call
+     * remain when these waits begin.
+     */
+#ifndef OPENSSL_NO_QUIC
+    ossl_quic_reactor_wait_ctx_drain(&wctx->quic);
+#endif
+
+#ifndef OPENSSL_NO_DTLS
+    for (slot = wctx->dtls; slot != NULL; slot = next) {
+        next = slot->next;
+        if (slot->need_wait)
+            ossl_dtls_listener_wait_for_notifier_clear(slot->listener,
+                slot->generation);
+        OPENSSL_free(slot);
+    }
+    wctx->dtls = NULL;
+#endif
 }

 static int poll_translate(SSL_POLL_ITEM *items,
     size_t num_items,
     size_t stride,
-    QUIC_REACTOR_WAIT_CTX *wctx,
+    POLL_WAIT_CTX *wctx,
     RIO_POLL_BUILDER *rpb,
     OSSL_TIME *p_earliest_wakeup_deadline,
     int *abort_blocking,
+    int bound_by_event_timeout,
     size_t *p_result_count)
 {
     int ok = 1;
@@ -216,16 +506,20 @@ static int poll_translate(SSL_POLL_ITEM *items,
     size_t result_count = 0;
     SSL *ssl;
     OSSL_TIME earliest_wakeup_deadline = ossl_time_infinite();
+#if !defined(OPENSSL_NO_QUIC) || !defined(OPENSSL_NO_DTLS)
     struct timeval timeout;
     int is_infinite = 0;
+#endif
     size_t i;

     for (i = 0; i < num_items; ++i) {
         item = &ITEM_N(items, stride, i);

+#ifndef OPENSSL_NO_QUIC
         if (ossl_quic_poll_translate_test_step_cb != NULL)
             ossl_quic_poll_translate_test_step_cb(i,
                 ossl_quic_poll_translate_test_step_cb_arg);
+#endif

         switch (item->desc.type) {
         case BIO_POLL_DESCRIPTOR_TYPE_SSL:
@@ -239,7 +533,7 @@ static int poll_translate(SSL_POLL_ITEM *items,
             case SSL_TYPE_QUIC_LISTENER:
             case SSL_TYPE_QUIC_CONNECTION:
             case SSL_TYPE_QUIC_XSO:
-                if (!poll_translate_ssl_quic(ssl, wctx, rpb, item->events,
+                if (!poll_translate_ssl_quic(ssl, &wctx->quic, rpb, item->events,
                         abort_blocking))
                     FAIL_ITEM(i);

@@ -258,6 +552,53 @@ static int poll_translate(SSL_POLL_ITEM *items,
                 break;
 #endif

+#ifndef OPENSSL_NO_DTLS
+            case SSL_TYPE_DTLS_LISTENER:
+                if (!poll_translate_ssl_dtls_listener(ssl, wctx, rpb, item->events,
+                        abort_blocking))
+                    FAIL_ITEM(i);
+
+                if (*abort_blocking)
+                    goto out;
+
+                break;
+            case SSL_TYPE_SSL_CONNECTION:
+                if (SSL_is_dtls(ssl)) {
+                    if (!poll_translate_ssl_dtls_conn(ssl, wctx, rpb, item->events,
+                            abort_blocking))
+                        FAIL_ITEM(i);
+
+                    if (*abort_blocking)
+                        goto out;
+
+                    /*
+                     * Bound the wait by the DTLS retransmission timer,
+                     * otherwise a poll with no timeout sleeps straight through
+                     * the point at which we should be retransmitting.
+                     *
+                     * Unless the caller has told us not to. A waiter which
+                     * cannot service the timer must not be woken by it: it
+                     * would find the timeout still expired on the next wait,
+                     * which reads as a zero deadline, and spin.
+                     */
+                    if (bound_by_event_timeout) {
+                        if (!SSL_get_event_timeout(ssl, &timeout, &is_infinite))
+                            FAIL_ITEM(i++); /* need to clean up this item too */
+
+                        if (!is_infinite)
+                            earliest_wakeup_deadline
+                                = ossl_time_min(earliest_wakeup_deadline,
+                                    ossl_time_add(ossl_time_now(),
+                                        ossl_time_from_timeval(timeout)));
+                    }
+
+                } else {
+                    ERR_raise_data(ERR_LIB_SSL, SSL_R_POLL_REQUEST_NOT_SUPPORTED,
+                        "SSL_poll currently only supports DTLS listeners for DTLS connections");
+                }
+                break;
+#endif
+
             default:
                 ERR_raise_data(ERR_LIB_SSL, SSL_R_POLL_REQUEST_NOT_SUPPORTED,
                     "SSL_poll currently only supports QUIC SSL "
@@ -283,9 +624,13 @@ static int poll_translate(SSL_POLL_ITEM *items,

 out:
     /*
-     * On abort_blocking, the item which triggered the abort has already
-     * balanced its own enter/leave of the blocking section (see
-     * poll_translate_ssl_quic()); only items 0..i-1 still need cleanup here.
+     * poll_translate_ssl_quic() either leaves the triggering item unregistered
+     * or deregisters it before returning. SSL_get_event_timeout() failures
+     * increment i so the registered triggering item is included in the cleanup
+     * prefix. Phase 2 drains every reactor recorded in wctx, including one
+     * already deregistered by the triggering item.
+     * DTLS registrations are tracked independently of the item prefix, so even
+     * a partially translated triggering item is included in both phases.
      */
     if (!ok || *abort_blocking)
         postpoll_translation_cleanup(items, i, stride, wctx);
@@ -299,11 +644,12 @@ static int poll_block(SSL_POLL_ITEM *items,
     size_t num_items,
     size_t stride,
     OSSL_TIME user_deadline,
+    int bound_by_event_timeout,
     size_t *p_result_count)
 {
     int ok = 0, abort_blocking = 0;
     RIO_POLL_BUILDER rpb;
-    QUIC_REACTOR_WAIT_CTX wctx;
+    POLL_WAIT_CTX wctx;
     OSSL_TIME earliest_wakeup_deadline;

     /*
@@ -327,12 +673,18 @@ static int poll_block(SSL_POLL_ITEM *items,
      *   TODO(QUIC POLLING): In the future we will do reverse translation here
      *   also to facilitate a more efficient readout.
      */
-    ossl_quic_reactor_wait_ctx_init(&wctx);
+#ifndef OPENSSL_NO_QUIC
+    ossl_quic_reactor_wait_ctx_init(&wctx.quic);
+#endif
+#ifndef OPENSSL_NO_DTLS
+    wctx.dtls = NULL;
+#endif
     ossl_rio_poll_builder_init(&rpb);

     if (!poll_translate(items, num_items, stride, &wctx, &rpb,
             &earliest_wakeup_deadline,
             &abort_blocking,
+            bound_by_event_timeout,
             p_result_count))
         goto out;

@@ -355,9 +707,50 @@ static int poll_block(SSL_POLL_ITEM *items,

 out:
     ossl_rio_poll_builder_cleanup(&rpb);
-    ossl_quic_reactor_wait_ctx_cleanup(&wctx);
+#ifndef OPENSSL_NO_QUIC
+    ossl_quic_reactor_wait_ctx_cleanup(&wctx.quic);
+#endif
     return ok;
 }
+
+#ifndef OPENSSL_NO_DTLS
+/*
+ * Wait until the given DTLS listener or listener-based connection may have
+ * become ready for one of the given events, or until the deadline expires.
+ *
+ * This is the wait that libssl itself performs when a DTLS object is used in
+ * blocking mode. It is the same wait SSL_poll() performs, and reuses it, so a
+ * blocking call is woken by the same means an application polling the object
+ * would be: readiness of the listener's socket, or the listener's notifier if
+ * another thread produces readiness without the socket becoming readable here.
+ *
+ * No readout is performed. A spurious wakeup is always possible - the socket
+ * becoming readable says nothing about which connection the datagram is for -
+ * so the caller must re-test its own condition and wait again if needed.
+ *
+ * bound_by_event_timeout says whether the connection's own event timeout, which
+ * for DTLS is the retransmission timer, should shorten the wait. Pass 1 unless
+ * the caller is unable to service that timer when it fires: waking for a
+ * timeout nothing then handles leaves it expired, and an expired timeout reads
+ * as a zero deadline, so every later wait returns at once.
+ *
+ * Returns 1 if the wait completed and 0 on error.
+ */
+int ossl_dtls_block_until_ready(SSL *ssl, uint64_t events, OSSL_TIME deadline,
+    int bound_by_event_timeout)
+{
+    SSL_POLL_ITEM item;
+    size_t result_count = 0;
+
+    item.desc.type = BIO_POLL_DESCRIPTOR_TYPE_SSL;
+    item.desc.value.ssl = ssl;
+    item.events = events;
+    item.revents = 0;
+
+    return poll_block(&item, 1, sizeof(item), deadline, bound_by_event_timeout,
+        &result_count);
+}
+#endif /* OPENSSL_NO_DTLS */
 #endif

 static int poll_readout(SSL_POLL_ITEM *items,
@@ -370,14 +763,14 @@ static int poll_readout(SSL_POLL_ITEM *items,
     size_t i, result_count = 0;
     SSL_POLL_ITEM *item;
     SSL *ssl;
-#ifndef OPENSSL_NO_QUIC
+#if !defined(OPENSSL_NO_QUIC) || !defined(OPENSSL_NO_DTLS)
     uint64_t events;
 #endif
     uint64_t revents;

     for (i = 0; i < num_items; ++i) {
         item = &ITEM_N(items, stride, i);
-#ifndef OPENSSL_NO_QUIC
+#if !defined(OPENSSL_NO_QUIC) || !defined(OPENSSL_NO_DTLS)
         events = item->events;
 #endif
         revents = 0;
@@ -404,10 +797,35 @@ static int poll_readout(SSL_POLL_ITEM *items,
                 break;
 #endif

+#ifndef OPENSSL_NO_DTLS
+            case SSL_TYPE_DTLS_LISTENER:
+                if (!ossl_dtls_listener_poll_events(ssl, events, do_tick, &revents))
+                    /* above call raises ERR */
+                    FAIL_ITEM(i);
+
+                if (revents != 0)
+                    ++result_count;
+                break;
+            case SSL_TYPE_SSL_CONNECTION:
+                if (SSL_is_dtls(ssl)) {
+                    if (!ossl_dtls_conn_poll_events(ssl, events, do_tick, &revents))
+                        /* above call raises ERR */
+                        FAIL_ITEM(i);
+
+                    if (revents != 0)
+                        ++result_count;
+                } else {
+                    /* TLS Connections not supported */
+                    ERR_raise_data(ERR_LIB_SSL, SSL_R_POLL_REQUEST_NOT_SUPPORTED,
+                        "SSL_poll currently only supports QUIC and DTLS SSL objects");
+                    FAIL_ITEM(i);
+                }
+                break;
+#endif
+
             default:
                 ERR_raise_data(ERR_LIB_SSL, SSL_R_POLL_REQUEST_NOT_SUPPORTED,
-                    "SSL_poll currently only supports QUIC SSL "
-                    "objects");
+                    "SSL_poll currently only supports QUIC and DTLS SSL objects");
                 FAIL_ITEM(i);
             }
             break;
@@ -485,8 +903,9 @@ int SSL_poll(SSL_POLL_ITEM *items,
          * point onwards.
          */
         do_tick = 1;
-#ifndef OPENSSL_NO_QUIC
-        if (!poll_block(items, num_items, stride, deadline, &result_count)) {
+#if !defined(OPENSSL_NO_QUIC) || !defined(OPENSSL_NO_DTLS)
+        if (!poll_block(items, num_items, stride, deadline,
+                /*bound_by_event_timeout=*/1, &result_count)) {
             ok = 0;
             goto out;
         }
diff --git a/deps/openssl/openssl/ssl/rio/rio_notifier.c b/deps/openssl/openssl/ssl/rio/rio_notifier.c
index abc1755dae0..6a57e61c9fc 100644
--- a/deps/openssl/openssl/ssl/rio/rio_notifier.c
+++ b/deps/openssl/openssl/ssl/rio/rio_notifier.c
@@ -12,6 +12,7 @@
 #include <openssl/err.h>
 #include "internal/rio_notifier.h"

+#if !defined(OPENSSL_SYS_WINDOWS) || RIO_NOTIFIER_METHOD == RIO_NOTIFIER_METHOD_SOCKETPAIR
 /*
  * Sets a socket as close-on-exec, except that this is a no-op if we are certain
  * we do not need to do this or the OS does not support the concept.
@@ -24,6 +25,7 @@ static int set_cloexec(int fd)
     return 1;
 #endif
 }
+#endif

 #if defined(OPENSSL_SYS_WINDOWS)

@@ -39,6 +41,7 @@ static int do_wsa_startup(void)

     if (WSAStartup(versionreq, &wsadata) != 0)
         return 0;
+
     return 1;
 }

@@ -336,6 +339,9 @@ void ossl_rio_notifier_cleanup(RIO_NOTIFIER *nfy)
     BIO_closesocket(nfy->wfd);
     BIO_closesocket(nfy->rfd);
     nfy->rfd = nfy->wfd = -1;
+#if defined(OPENSSL_SYS_WINDOWS)
+    wsa_done();
+#endif
 }

 int ossl_rio_notifier_signal(RIO_NOTIFIER *nfy)
diff --git a/deps/openssl/openssl/ssl/s3_enc.c b/deps/openssl/openssl/ssl/s3_enc.c
index 307f6dc9418..ca0dc8e6f52 100644
--- a/deps/openssl/openssl/ssl/s3_enc.c
+++ b/deps/openssl/openssl/ssl/s3_enc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2005 Nokia. All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -11,205 +11,10 @@
 #include <stdio.h>
 #include "ssl_local.h"
 #include <openssl/evp.h>
-#include <openssl/md5.h>
 #include <openssl/core_names.h>
 #include "internal/cryptlib.h"
 #include "internal/ssl_unwrap.h"

-static int ssl3_generate_key_block(SSL_CONNECTION *s, unsigned char *km, int num)
-{
-    const EVP_MD *md5 = NULL, *sha1 = NULL;
-    EVP_MD_CTX *m5;
-    EVP_MD_CTX *s1;
-    unsigned char buf[16], smd[SHA_DIGEST_LENGTH];
-    unsigned char c = 'A';
-    unsigned int i, k;
-    int ret = 0;
-    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
-
-#ifdef CHARSET_EBCDIC
-    c = os_toascii[c]; /* 'A' in ASCII */
-#endif
-    k = 0;
-    md5 = ssl_evp_md_fetch(sctx->libctx, NID_md5, sctx->propq);
-    sha1 = ssl_evp_md_fetch(sctx->libctx, NID_sha1, sctx->propq);
-    m5 = EVP_MD_CTX_new();
-    s1 = EVP_MD_CTX_new();
-    if (md5 == NULL || sha1 == NULL || m5 == NULL || s1 == NULL) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
-        goto err;
-    }
-    for (i = 0; (int)i < num; i += MD5_DIGEST_LENGTH) {
-        k++;
-        if (k > sizeof(buf)) {
-            /* bug: 'buf' is too small for this ciphersuite */
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            goto err;
-        }
-
-        memset(buf, c, k);
-        c++;
-        if (!EVP_DigestInit_ex(s1, sha1, NULL)
-            || !EVP_DigestUpdate(s1, buf, k)
-            || !EVP_DigestUpdate(s1, s->session->master_key,
-                s->session->master_key_length)
-            || !EVP_DigestUpdate(s1, s->s3.server_random, SSL3_RANDOM_SIZE)
-            || !EVP_DigestUpdate(s1, s->s3.client_random, SSL3_RANDOM_SIZE)
-            || !EVP_DigestFinal_ex(s1, smd, NULL)
-            || !EVP_DigestInit_ex(m5, md5, NULL)
-            || !EVP_DigestUpdate(m5, s->session->master_key,
-                s->session->master_key_length)
-            || !EVP_DigestUpdate(m5, smd, SHA_DIGEST_LENGTH)) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            goto err;
-        }
-        if ((int)(i + MD5_DIGEST_LENGTH) > num) {
-            if (!EVP_DigestFinal_ex(m5, smd, NULL)) {
-                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-                goto err;
-            }
-            memcpy(km, smd, (num - i));
-        } else {
-            if (!EVP_DigestFinal_ex(m5, km, NULL)) {
-                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-                goto err;
-            }
-        }
-
-        km += MD5_DIGEST_LENGTH;
-    }
-    OPENSSL_cleanse(smd, sizeof(smd));
-    ret = 1;
-err:
-    EVP_MD_CTX_free(m5);
-    EVP_MD_CTX_free(s1);
-    ssl_evp_md_free(md5);
-    ssl_evp_md_free(sha1);
-    return ret;
-}
-
-int ssl3_change_cipher_state(SSL_CONNECTION *s, int which)
-{
-    unsigned char *p, *mac_secret;
-    size_t md_len;
-    unsigned char *key, *iv;
-    const EVP_CIPHER *ciph;
-    const SSL_COMP *comp = NULL;
-    const EVP_MD *md;
-    int mdi;
-    size_t n, iv_len, key_len;
-    int direction = (which & SSL3_CC_READ) != 0 ? OSSL_RECORD_DIRECTION_READ
-                                                : OSSL_RECORD_DIRECTION_WRITE;
-
-    ciph = s->s3.tmp.new_sym_enc;
-    md = s->s3.tmp.new_hash;
-    /* m == NULL will lead to a crash later */
-    if (!ossl_assert(md != NULL)) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-        goto err;
-    }
-#ifndef OPENSSL_NO_COMP
-    comp = s->s3.tmp.new_compression;
-#endif
-
-    p = s->s3.tmp.key_block;
-    mdi = EVP_MD_get_size(md);
-    if (mdi <= 0) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-        goto err;
-    }
-    md_len = (size_t)mdi;
-    key_len = EVP_CIPHER_get_key_length(ciph);
-    iv_len = EVP_CIPHER_get_iv_length(ciph);
-
-    if ((which == SSL3_CHANGE_CIPHER_CLIENT_WRITE) || (which == SSL3_CHANGE_CIPHER_SERVER_READ)) {
-        mac_secret = &(p[0]);
-        n = md_len + md_len;
-        key = &(p[n]);
-        n += key_len + key_len;
-        iv = &(p[n]);
-        n += iv_len + iv_len;
-    } else {
-        n = md_len;
-        mac_secret = &(p[n]);
-        n += md_len + key_len;
-        key = &(p[n]);
-        n += key_len + iv_len;
-        iv = &(p[n]);
-        n += iv_len;
-    }
-
-    if (n > s->s3.tmp.key_block_length) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-        goto err;
-    }
-
-    if (!ssl_set_new_record_layer(s, SSL3_VERSION,
-            direction,
-            OSSL_RECORD_PROTECTION_LEVEL_APPLICATION,
-            NULL, 0, key, key_len, iv, iv_len, mac_secret,
-            md_len, ciph, 0, NID_undef, md, comp, NULL)) {
-        /* SSLfatal already called */
-        goto err;
-    }
-
-    return 1;
-err:
-    return 0;
-}
-
-int ssl3_setup_key_block(SSL_CONNECTION *s)
-{
-    unsigned char *p;
-    const EVP_CIPHER *c;
-    const EVP_MD *hash;
-    int num;
-    int ret = 0;
-    SSL_COMP *comp;
-
-    if (s->s3.tmp.key_block_length != 0)
-        return 1;
-
-    if (!ssl_cipher_get_evp(SSL_CONNECTION_GET_CTX(s), s->session, &c, &hash,
-            NULL, NULL, &comp, 0)) {
-        /* Error is already recorded */
-        SSLfatal_alert(s, SSL_AD_INTERNAL_ERROR);
-        return 0;
-    }
-
-    ssl_evp_cipher_free(s->s3.tmp.new_sym_enc);
-    s->s3.tmp.new_sym_enc = c;
-    ssl_evp_md_free(s->s3.tmp.new_hash);
-    s->s3.tmp.new_hash = hash;
-#ifdef OPENSSL_NO_COMP
-    s->s3.tmp.new_compression = NULL;
-#else
-    s->s3.tmp.new_compression = comp;
-#endif
-
-    num = EVP_MD_get_size(hash);
-    if (num <= 0)
-        return 0;
-
-    num = EVP_CIPHER_get_key_length(c) + num + EVP_CIPHER_get_iv_length(c);
-    num *= 2;
-
-    ssl3_cleanup_key_block(s);
-
-    if ((p = OPENSSL_malloc(num)) == NULL) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_CRYPTO_LIB);
-        return 0;
-    }
-
-    s->s3.tmp.key_block_length = num;
-    s->s3.tmp.key_block = p;
-
-    /* Calls SSLfatal() as required */
-    ret = ssl3_generate_key_block(s, p, num);
-
-    return ret;
-}
-
 void ssl3_cleanup_key_block(SSL_CONNECTION *s)
 {
     OPENSSL_clear_free(s->s3.tmp.key_block, s->s3.tmp.key_block_length);
@@ -260,10 +65,29 @@ int ssl3_finish_mac(SSL_CONNECTION *s, const unsigned char *buf, size_t len)
             return 0;
         }
     } else {
-        ret = EVP_DigestUpdate(s->s3.handshake_dgst, buf, len);
-        if (!ret) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            return 0;
+        /*
+         * rfc9147:
+         * In DTLS 1.3, the message transcript is computed over the
+         * original TLS 1.3-style Handshake messages without the
+         * message_seq, fragment_offset, and fragment_length values. Note
+         * that this is a change from DTLS 1.2 where those values were
+         * included in the transcript.
+         *
+         * So this means that we record the full handshake messages in
+         * s->s3.handshake_buffer while s->s3.handshake_dgst is not in use and then
+         * we calculate the digest when initiating s->s3.handshake_dgst at which
+         * point we know what the protocol version is.
+         */
+        if (s->negotiated_version == DTLS1_3_VERSION) {
+            if (!dtls13_transcript_hash_update(s->s3.handshake_dgst, buf, len)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return 0;
+            }
+        } else {
+            if (!EVP_DigestUpdate(s->s3.handshake_dgst, buf, len)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return 0;
+            }
         }
     }
     return 1;
@@ -294,11 +118,14 @@ int ssl3_digest_cached_records(SSL_CONNECTION *s, int keep)
                 SSL_R_NO_SUITABLE_DIGEST_ALGORITHM);
             return 0;
         }
-        if (!EVP_DigestInit_ex(s->s3.handshake_dgst, md, NULL)
-            || !EVP_DigestUpdate(s->s3.handshake_dgst, hdata, hdatalen)) {
+        if (!EVP_DigestInit_ex(s->s3.handshake_dgst, md, NULL)) {
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             return 0;
         }
+        if (!ssl3_finish_mac(s, hdata, hdatalen)) {
+            /* SSLfatal() already called */
+            return 0;
+        }
     }
     if (keep == 0) {
         BIO_free(s->s3.handshake_buffer);
@@ -307,199 +134,3 @@ int ssl3_digest_cached_records(SSL_CONNECTION *s, int keep)

     return 1;
 }
-
-void ssl3_digest_master_key_set_params(const SSL_SESSION *session,
-    OSSL_PARAM params[])
-{
-    int n = 0;
-    params[n++] = OSSL_PARAM_construct_octet_string(OSSL_DIGEST_PARAM_SSL3_MS,
-        (void *)session->master_key,
-        session->master_key_length);
-    params[n++] = OSSL_PARAM_construct_end();
-}
-
-size_t ssl3_final_finish_mac(SSL_CONNECTION *s, const char *sender, size_t len,
-    unsigned char *p)
-{
-    int ret;
-    EVP_MD_CTX *ctx = NULL;
-
-    if (!ssl3_digest_cached_records(s, 0)) {
-        /* SSLfatal() already called */
-        return 0;
-    }
-
-    if (EVP_MD_CTX_get_type(s->s3.handshake_dgst) != NID_md5_sha1) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_REQUIRED_DIGEST);
-        return 0;
-    }
-
-    ctx = EVP_MD_CTX_new();
-    if (ctx == NULL) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
-        return 0;
-    }
-    if (!EVP_MD_CTX_copy_ex(ctx, s->s3.handshake_dgst)) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-        ret = 0;
-        goto err;
-    }
-
-    ret = EVP_MD_CTX_get_size(ctx);
-    if (ret < 0) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-        ret = 0;
-        goto err;
-    }
-
-    if (sender != NULL) {
-        OSSL_PARAM digest_cmd_params[3];
-
-        ssl3_digest_master_key_set_params(s->session, digest_cmd_params);
-
-        if (EVP_DigestUpdate(ctx, sender, len) <= 0
-            || EVP_MD_CTX_set_params(ctx, digest_cmd_params) <= 0
-            || EVP_DigestFinal_ex(ctx, p, NULL) <= 0) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            ret = 0;
-        }
-    }
-
-err:
-    EVP_MD_CTX_free(ctx);
-
-    return ret;
-}
-
-int ssl3_generate_master_secret(SSL_CONNECTION *s, unsigned char *out,
-    unsigned char *p,
-    size_t len, size_t *secret_size)
-{
-    static const unsigned char *const salt[3] = {
-#ifndef CHARSET_EBCDIC
-        (const unsigned char *)"A",
-        (const unsigned char *)"BB",
-        (const unsigned char *)"CCC",
-#else
-        (const unsigned char *)"\x41",
-        (const unsigned char *)"\x42\x42",
-        (const unsigned char *)"\x43\x43\x43",
-#endif
-    };
-    unsigned char buf[EVP_MAX_MD_SIZE];
-    EVP_MD_CTX *ctx = EVP_MD_CTX_new();
-    int i, ret = 1;
-    unsigned int n;
-    size_t ret_secret_size = 0;
-
-    if (ctx == NULL) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
-        return 0;
-    }
-    for (i = 0; i < 3; i++) {
-        if (EVP_DigestInit_ex(ctx, SSL_CONNECTION_GET_CTX(s)->sha1, NULL) <= 0
-            || EVP_DigestUpdate(ctx, salt[i],
-                   strlen((const char *)salt[i]))
-                <= 0
-            || EVP_DigestUpdate(ctx, p, len) <= 0
-            || EVP_DigestUpdate(ctx, &(s->s3.client_random[0]),
-                   SSL3_RANDOM_SIZE)
-                <= 0
-            || EVP_DigestUpdate(ctx, &(s->s3.server_random[0]),
-                   SSL3_RANDOM_SIZE)
-                <= 0
-            || EVP_DigestFinal_ex(ctx, buf, &n) <= 0
-            || EVP_DigestInit_ex(ctx, SSL_CONNECTION_GET_CTX(s)->md5, NULL) <= 0
-            || EVP_DigestUpdate(ctx, p, len) <= 0
-            || EVP_DigestUpdate(ctx, buf, n) <= 0
-            || EVP_DigestFinal_ex(ctx, out, &n) <= 0) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            ret = 0;
-            break;
-        }
-        out += n;
-        ret_secret_size += n;
-    }
-    EVP_MD_CTX_free(ctx);
-
-    OPENSSL_cleanse(buf, sizeof(buf));
-    if (ret)
-        *secret_size = ret_secret_size;
-    return ret;
-}
-
-int ssl3_alert_code(int code)
-{
-    switch (code) {
-    case SSL_AD_CLOSE_NOTIFY:
-        return SSL3_AD_CLOSE_NOTIFY;
-    case SSL_AD_UNEXPECTED_MESSAGE:
-        return SSL3_AD_UNEXPECTED_MESSAGE;
-    case SSL_AD_BAD_RECORD_MAC:
-        return SSL3_AD_BAD_RECORD_MAC;
-    case SSL_AD_DECRYPTION_FAILED:
-        return SSL3_AD_BAD_RECORD_MAC;
-    case SSL_AD_RECORD_OVERFLOW:
-        return SSL3_AD_BAD_RECORD_MAC;
-    case SSL_AD_DECOMPRESSION_FAILURE:
-        return SSL3_AD_DECOMPRESSION_FAILURE;
-    case SSL_AD_HANDSHAKE_FAILURE:
-        return SSL3_AD_HANDSHAKE_FAILURE;
-    case SSL_AD_NO_CERTIFICATE:
-        return SSL3_AD_NO_CERTIFICATE;
-    case SSL_AD_BAD_CERTIFICATE:
-        return SSL3_AD_BAD_CERTIFICATE;
-    case SSL_AD_UNSUPPORTED_CERTIFICATE:
-        return SSL3_AD_UNSUPPORTED_CERTIFICATE;
-    case SSL_AD_CERTIFICATE_REVOKED:
-        return SSL3_AD_CERTIFICATE_REVOKED;
-    case SSL_AD_CERTIFICATE_EXPIRED:
-        return SSL3_AD_CERTIFICATE_EXPIRED;
-    case SSL_AD_CERTIFICATE_UNKNOWN:
-        return SSL3_AD_CERTIFICATE_UNKNOWN;
-    case SSL_AD_ILLEGAL_PARAMETER:
-        return SSL3_AD_ILLEGAL_PARAMETER;
-    case SSL_AD_UNKNOWN_CA:
-        return SSL3_AD_BAD_CERTIFICATE;
-    case SSL_AD_ACCESS_DENIED:
-        return SSL3_AD_HANDSHAKE_FAILURE;
-    case SSL_AD_DECODE_ERROR:
-        return SSL3_AD_HANDSHAKE_FAILURE;
-    case SSL_AD_DECRYPT_ERROR:
-        return SSL3_AD_HANDSHAKE_FAILURE;
-    case SSL_AD_EXPORT_RESTRICTION:
-        return SSL3_AD_HANDSHAKE_FAILURE;
-    case SSL_AD_PROTOCOL_VERSION:
-        return SSL3_AD_HANDSHAKE_FAILURE;
-    case SSL_AD_INSUFFICIENT_SECURITY:
-        return SSL3_AD_HANDSHAKE_FAILURE;
-    case SSL_AD_INTERNAL_ERROR:
-        return SSL3_AD_HANDSHAKE_FAILURE;
-    case SSL_AD_USER_CANCELLED:
-        return SSL3_AD_HANDSHAKE_FAILURE;
-    case SSL_AD_NO_RENEGOTIATION:
-        return -1; /* Don't send it :-) */
-    case SSL_AD_UNSUPPORTED_EXTENSION:
-        return SSL3_AD_HANDSHAKE_FAILURE;
-    case SSL_AD_CERTIFICATE_UNOBTAINABLE:
-        return SSL3_AD_HANDSHAKE_FAILURE;
-    case SSL_AD_UNRECOGNIZED_NAME:
-        return SSL3_AD_HANDSHAKE_FAILURE;
-    case SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE:
-        return SSL3_AD_HANDSHAKE_FAILURE;
-    case SSL_AD_BAD_CERTIFICATE_HASH_VALUE:
-        return SSL3_AD_HANDSHAKE_FAILURE;
-    case SSL_AD_UNKNOWN_PSK_IDENTITY:
-        return TLS1_AD_UNKNOWN_PSK_IDENTITY;
-    case SSL_AD_INAPPROPRIATE_FALLBACK:
-        return TLS1_AD_INAPPROPRIATE_FALLBACK;
-    case SSL_AD_NO_APPLICATION_PROTOCOL:
-        return TLS1_AD_NO_APPLICATION_PROTOCOL;
-    case SSL_AD_CERTIFICATE_REQUIRED:
-        return SSL_AD_HANDSHAKE_FAILURE;
-    case TLS13_AD_MISSING_EXTENSION:
-        return SSL_AD_HANDSHAKE_FAILURE;
-    default:
-        return -1;
-    }
-}
diff --git a/deps/openssl/openssl/ssl/s3_lib.c b/deps/openssl/openssl/ssl/s3_lib.c
index 079a308f6ff..d1d02c8f88a 100644
--- a/deps/openssl/openssl/ssl/s3_lib.c
+++ b/deps/openssl/openssl/ssl/s3_lib.c
@@ -22,12 +22,13 @@
 #include <openssl/core_names.h>
 #include "internal/cryptlib.h"
 #include "internal/ssl_unwrap.h"
+#include <openssl/ocsp.h>

 #define TLS13_NUM_CIPHERS OSSL_NELEM(tls13_ciphers)
 #define SSL3_NUM_CIPHERS OSSL_NELEM(ssl3_ciphers)
 #define SSL3_NUM_SCSVS OSSL_NELEM(ssl3_scsvs)

-/* TLSv1.3 downgrade protection sentinel values */
+/* TLSv1.3 downgrade protection sentinel values (rfc8446 4.1.3.) */
 const unsigned char tls11downgrade[] = {
     0x44, 0x4f, 0x57, 0x4e, 0x47, 0x52, 0x44, 0x00
 };
@@ -48,8 +49,8 @@ static SSL_CIPHER tls13_ciphers[] = {
         SSL_AEAD,
         TLS1_3_VERSION,
         TLS1_3_VERSION,
-        0,
-        0,
+        DTLS1_3_VERSION,
+        DTLS1_3_VERSION,
         SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA256 | SSL_QUIC,
         128,
@@ -66,8 +67,8 @@ static SSL_CIPHER tls13_ciphers[] = {
         SSL_AEAD,
         TLS1_3_VERSION,
         TLS1_3_VERSION,
-        0,
-        0,
+        DTLS1_3_VERSION,
+        DTLS1_3_VERSION,
         SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | SSL_QUIC,
         256,
@@ -84,8 +85,8 @@ static SSL_CIPHER tls13_ciphers[] = {
         SSL_AEAD,
         TLS1_3_VERSION,
         TLS1_3_VERSION,
-        0,
-        0,
+        DTLS1_3_VERSION,
+        DTLS1_3_VERSION,
         SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA256 | SSL_QUIC,
         256,
@@ -102,8 +103,8 @@ static SSL_CIPHER tls13_ciphers[] = {
         SSL_AEAD,
         TLS1_3_VERSION,
         TLS1_3_VERSION,
-        0,
-        0,
+        DTLS1_3_VERSION,
+        DTLS1_3_VERSION,
         SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA256,
         128,
@@ -120,6 +121,11 @@ static SSL_CIPHER tls13_ciphers[] = {
         SSL_AEAD,
         TLS1_3_VERSION,
         TLS1_3_VERSION,
+        /*
+         * RFC 9147 (DTLS 1.3): "TLS_AES_128_CCM_8_SHA256 MUST NOT be used in
+         * DTLS without additional safeguards against forgery." We implement
+         * no such safeguards, so this cipher is not available under DTLS.
+         */
         0,
         0,
         SSL_NOT_DEFAULT | SSL_MEDIUM,
@@ -139,8 +145,8 @@ static SSL_CIPHER tls13_ciphers[] = {
         SSL_SHA256,
         TLS1_3_VERSION,
         TLS1_3_VERSION,
-        0,
-        0,
+        DTLS1_3_VERSION,
+        DTLS1_3_VERSION,
         SSL_NOT_DEFAULT | SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_SHA256,
         0,
@@ -157,14 +163,50 @@ static SSL_CIPHER tls13_ciphers[] = {
         SSL_SHA384,
         TLS1_3_VERSION,
         TLS1_3_VERSION,
-        0,
-        0,
+        DTLS1_3_VERSION,
+        DTLS1_3_VERSION,
         SSL_NOT_DEFAULT | SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_SHA384,
         0,
         384,
     },
 #endif
+    {
+        1,
+        TLS1_3_RFC_SM4_GCM_SM3,
+        TLS1_3_RFC_SM4_GCM_SM3,
+        TLS1_3_CK_SM4_GCM_SM3,
+        SSL_kANY,
+        SSL_aANY,
+        SSL_SM4GCM,
+        SSL_AEAD,
+        TLS1_3_VERSION,
+        TLS1_3_VERSION,
+        0,
+        0,
+        SSL_NOT_DEFAULT | SSL_HIGH,
+        SSL_HANDSHAKE_MAC_SM3,
+        128,
+        128,
+    },
+    {
+        1,
+        TLS1_3_RFC_SM4_CCM_SM3,
+        TLS1_3_RFC_SM4_CCM_SM3,
+        TLS1_3_CK_SM4_CCM_SM3,
+        SSL_kANY,
+        SSL_aANY,
+        SSL_SM4CCM,
+        SSL_AEAD,
+        TLS1_3_VERSION,
+        TLS1_3_VERSION,
+        0,
+        0,
+        SSL_NOT_DEFAULT | SSL_HIGH,
+        SSL_HANDSHAKE_MAC_SM3,
+        128,
+        128,
+    },
 };

 /*
@@ -210,7 +252,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         0,
         0,
@@ -303,7 +345,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -321,7 +363,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
+        SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -339,7 +381,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -357,7 +399,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
+        SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -375,7 +417,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -393,7 +435,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
+        SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -411,7 +453,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -429,7 +471,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
+        SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -448,7 +490,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         0,
         0,
@@ -467,7 +509,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -485,7 +527,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -503,7 +545,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
+        SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -521,7 +563,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -539,7 +581,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
+        SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -557,7 +599,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -575,7 +617,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
+        SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -593,7 +635,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
+        SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -611,7 +653,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
         128,
         128,
@@ -629,7 +671,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -647,7 +689,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
         128,
         128,
@@ -665,7 +707,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -683,7 +725,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
+        SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
         128,
         128,
@@ -701,7 +743,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
+        SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -719,7 +761,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
+        SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
         128,
         128,
@@ -737,7 +779,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
+        SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -1116,7 +1158,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         0,
         0,
@@ -1155,7 +1197,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -1173,7 +1215,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -1192,7 +1234,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         0,
         0,
@@ -1231,7 +1273,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -1249,7 +1291,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -1268,7 +1310,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         0,
         0,
@@ -1307,7 +1349,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
+        SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -1325,7 +1367,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
+        SSL_NOT_DEFAULT | SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -1343,7 +1385,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
         128,
         128,
@@ -1361,7 +1403,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -1379,7 +1421,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
         128,
         128,
@@ -1397,7 +1439,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -1415,7 +1457,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
         128,
         128,
@@ -1433,7 +1475,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -1451,7 +1493,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
         128,
         128,
@@ -1469,7 +1511,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -1488,7 +1530,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         0,
         0,
@@ -1506,7 +1548,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         0,
         0,
@@ -1524,7 +1566,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         0,
         0,
@@ -1563,7 +1605,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -1581,7 +1623,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -1619,7 +1661,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -1637,7 +1679,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -1675,7 +1717,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -1693,7 +1735,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -1711,7 +1753,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
         128,
         128,
@@ -1729,7 +1771,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -1747,7 +1789,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
         128,
         128,
@@ -1765,7 +1807,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -1783,7 +1825,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
         128,
         128,
@@ -1801,7 +1843,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_2_VERSION,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -1819,7 +1861,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -1837,7 +1879,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -1856,7 +1898,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         0,
         0,
@@ -1874,7 +1916,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         0,
         0,
@@ -1893,7 +1935,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -1911,7 +1953,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -1930,7 +1972,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         0,
         0,
@@ -1948,7 +1990,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         0,
         0,
@@ -1967,7 +2009,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -1985,7 +2027,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -2004,7 +2046,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         0,
         0,
@@ -2022,7 +2064,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         0,
         0,
@@ -2061,7 +2103,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -2079,7 +2121,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         256,
         256,
@@ -2097,7 +2139,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         128,
         128,
@@ -2115,7 +2157,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_HIGH | SSL_FIPS,
+        SSL_HIGH,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         256,
         256,
@@ -2134,7 +2176,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         0,
         0,
@@ -2152,7 +2194,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
         0,
         0,
@@ -2170,7 +2212,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
         TLS1_2_VERSION,
         DTLS1_BAD_VER,
         DTLS1_2_VERSION,
-        SSL_STRONG_NONE | SSL_FIPS,
+        SSL_STRONG_NONE,
         SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
         0,
         0,
@@ -3734,44 +3776,6 @@ void ssl_sort_cipher_list(void)
     qsort(ssl3_scsvs, SSL3_NUM_SCSVS, sizeof(ssl3_scsvs[0]), cipher_compare);
 }

-static int sslcon_undefined_function_1(SSL_CONNECTION *sc, unsigned char *r,
-    size_t s, const char *t, size_t u,
-    const unsigned char *v, size_t w, int x)
-{
-    (void)r;
-    (void)s;
-    (void)t;
-    (void)u;
-    (void)v;
-    (void)w;
-    (void)x;
-    return ssl_undefined_function(SSL_CONNECTION_GET_SSL(sc));
-}
-
-const SSL3_ENC_METHOD SSLv3_enc_data = {
-    ssl3_setup_key_block,
-    ssl3_generate_master_secret,
-    ssl3_change_cipher_state,
-    ssl3_final_finish_mac,
-    SSL3_MD_CLIENT_FINISHED_CONST, 4,
-    SSL3_MD_SERVER_FINISHED_CONST, 4,
-    ssl3_alert_code,
-    sslcon_undefined_function_1,
-    0,
-    ssl3_set_handshake_header,
-    tls_close_construct_packet,
-    ssl3_handshake_write
-};
-
-OSSL_TIME ssl3_default_timeout(void)
-{
-    /*
-     * 2 hours, the 24 hours mentioned in the SSLv3 spec is way too long for
-     * http, the cache would over fill
-     */
-    return ossl_seconds2time(60 * 60 * 2);
-}
-
 int ssl3_num_ciphers(void)
 {
     return SSL3_NUM_CIPHERS;
@@ -3851,6 +3855,7 @@ void ssl3_free(SSL *s)
     }

     ssl_evp_cipher_free(sc->s3.tmp.new_sym_enc);
+    ssl_evp_cipher_free(sc->s3.tmp.new_sym_enc_sn);
     ssl_evp_md_free(sc->s3.tmp.new_hash);

     OPENSSL_free(sc->s3.tmp.ctype);
@@ -3860,6 +3865,8 @@ void ssl3_free(SSL *s)
     OPENSSL_free(sc->s3.tmp.peer_sigalgs);
     OPENSSL_free(sc->s3.tmp.peer_cert_sigalgs);
     OPENSSL_free(sc->s3.tmp.valid_flags);
+    OSSL_STACK_OF_X509_free(sc->s3.tmp.pending_peer_chain);
+    EVP_PKEY_free(sc->s3.tmp.pending_peer_rpk);
     ssl3_free_digest_list(sc);
     OPENSSL_free(sc->s3.alpn_selected);
     OPENSSL_free(sc->s3.alpn_proposed);
@@ -3892,6 +3899,8 @@ int ssl3_clear(SSL *s)
     OPENSSL_free(sc->s3.tmp.peer_sigalgs);
     OPENSSL_free(sc->s3.tmp.peer_cert_sigalgs);
     OPENSSL_free(sc->s3.tmp.valid_flags);
+    OSSL_STACK_OF_X509_free(sc->s3.tmp.pending_peer_chain);
+    EVP_PKEY_free(sc->s3.tmp.pending_peer_rpk);

     EVP_PKEY_free(sc->s3.peer_tmp);

@@ -3926,7 +3935,7 @@ int ssl3_clear(SSL *s)
     if (!ssl_free_wbio_buffer(sc))
         return 0;

-    sc->version = SSL3_VERSION;
+    sc->version = TLS1_VERSION;

 #if !defined(OPENSSL_NO_NEXTPROTONEG)
     OPENSSL_free(sc->ext.npn);
@@ -3955,6 +3964,10 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
 {
     int ret = 0;
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
+#ifndef OPENSSL_NO_OCSP
+    unsigned char *p = NULL;
+    OCSP_RESPONSE *resp = NULL;
+#endif

     if (sc == NULL)
         return ret;
@@ -4022,8 +4035,7 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
          * from the server, but we currently allow it to be used on servers
          * as well, which is a programming error.  Currently we just clear
          * the field in SSL_do_handshake() for server SSLs, but when we can
-         * make ABI-breaking changes, we may want to make use of this API
-         * an error on server SSLs.
+         * make ABI-breaking changes, we may want to return an error in this case.
          */
         if (larg == TLSEXT_NAMETYPE_host_name) {
             size_t len;
@@ -4036,7 +4048,7 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
                 break;
             len = strlen((char *)parg);
             if (len == 0 || len > TLSEXT_MAXLEN_host_name) {
-                ERR_raise(ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME);
+                ERR_raise(ERR_LIB_SSL, SSL_R_TLS_EXT_INVALID_SERVERNAME);
                 return 0;
             }
             if ((sc->ext.hostname = OPENSSL_strdup((char *)parg)) == NULL) {
@@ -4044,7 +4056,7 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
                 return 0;
             }
         } else {
-            ERR_raise(ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE);
+            ERR_raise(ERR_LIB_SSL, SSL_R_TLS_EXT_INVALID_SERVERNAME_TYPE);
             return 0;
         }
         break;
@@ -4083,16 +4095,81 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
         break;

     case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP:
-        *(unsigned char **)parg = sc->ext.ocsp.resp;
-        if (sc->ext.ocsp.resp_len == 0
-            || sc->ext.ocsp.resp_len > LONG_MAX)
-            return -1;
-        return (long)sc->ext.ocsp.resp_len;
+        *(unsigned char **)parg = NULL;
+        ret = -1;
+
+#ifndef OPENSSL_NO_OCSP
+        resp = sk_OCSP_RESPONSE_value(sc->ext.ocsp.resp_ex, 0);
+
+        if (resp != NULL) {
+            int resp_len = i2d_OCSP_RESPONSE(resp, &p);
+
+            if (resp_len > 0) {
+                OPENSSL_free(sc->ext.ocsp.resp);
+                *(unsigned char **)parg = sc->ext.ocsp.resp = p;
+                sc->ext.ocsp.resp_len = (size_t)resp_len;
+                ret = resp_len;
+            }
+        }
+#endif
+        break;

     case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP:
+        ret = 1;
+#ifndef OPENSSL_NO_OCSP
+        /*
+         * In case of success keep the single value so we do not need to
+         * free it immediately.
+         * However in the handshake code we only use the extended values.
+         */
         OPENSSL_free(sc->ext.ocsp.resp);
-        sc->ext.ocsp.resp = parg;
-        sc->ext.ocsp.resp_len = larg;
+        sc->ext.ocsp.resp = NULL;
+        sc->ext.ocsp.resp_len = 0;
+
+        sk_OCSP_RESPONSE_pop_free(sc->ext.ocsp.resp_ex, OCSP_RESPONSE_free);
+        sc->ext.ocsp.resp_ex = NULL;
+
+        if (parg != NULL) {
+            sc->ext.ocsp.resp_ex = sk_OCSP_RESPONSE_new_reserve(NULL, 1);
+            if (sc->ext.ocsp.resp_ex == NULL)
+                return 0;
+
+            p = parg;
+            resp = d2i_OCSP_RESPONSE(NULL, (const unsigned char **)&p, larg);
+            if (resp != NULL)
+                sk_OCSP_RESPONSE_push(sc->ext.ocsp.resp_ex, resp);
+
+            sc->ext.ocsp.resp = parg;
+            sc->ext.ocsp.resp_len = larg;
+        }
+#endif
+        break;
+
+    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP_EX:
+#ifndef OPENSSL_NO_OCSP
+        *(STACK_OF(OCSP_RESPONSE) **)parg = sc->ext.ocsp.resp_ex;
+        ret = sk_OCSP_RESPONSE_num(sc->ext.ocsp.resp_ex);
+#else
+        *(unsigned char **)parg = NULL;
+        ret = -1;
+#endif
+        break;
+
+    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP_EX:
+#ifndef OPENSSL_NO_OCSP
+        /*
+         * cleanup single values, which might be set somewhere else
+         * we only use the extended values
+         */
+        if (sc->ext.ocsp.resp != NULL) {
+            OPENSSL_free(sc->ext.ocsp.resp);
+            sc->ext.ocsp.resp = NULL;
+            sc->ext.ocsp.resp_len = 0;
+        }
+
+        sk_OCSP_RESPONSE_pop_free(sc->ext.ocsp.resp_ex, OCSP_RESPONSE_free);
+        sc->ext.ocsp.resp_ex = (STACK_OF(OCSP_RESPONSE) *)parg;
+#endif
         ret = 1;
         break;

@@ -4182,7 +4259,7 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
             parg);

     case SSL_CTRL_GET_SHARED_GROUP: {
-        uint16_t id = tls1_shared_group(sc, larg);
+        uint16_t id = tls1_shared_group(sc, larg, TLS1_GROUPS_ALL_GROUPS);

         if (larg != -1)
             return tls1_group_id2nid(id, 1);
@@ -4191,7 +4268,7 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
     case SSL_CTRL_GET_NEGOTIATED_GROUP: {
         unsigned int id;

-        if (SSL_CONNECTION_IS_TLS13(sc) && sc->s3.did_kex)
+        if (SSL_CONNECTION_IS_VERSION13(sc) && sc->s3.did_kex)
             id = sc->s3.group_id;
         else
             id = (sc->session != NULL) ? sc->session->kex_group : NID_undef;
@@ -4216,7 +4293,7 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
             return 0;
         if (pctype)
             *pctype = sc->s3.tmp.ctype;
-        return sc->s3.tmp.ctype_len;
+        return (long)sc->s3.tmp.ctype_len;
     }

     case SSL_CTRL_SET_CLIENT_CERT_TYPES:
@@ -4657,18 +4734,32 @@ const SSL_CIPHER *ssl3_get_cipher_by_id(uint32_t id)
     return OBJ_bsearch_ssl_cipher_id(&c, ssl3_scsvs, SSL3_NUM_SCSVS);
 }

+const SSL_CIPHER *ssl3_get_tls13_cipher_by_std_name(const char *stdname)
+{
+    SSL_CIPHER *end = &tls13_ciphers[TLS13_NUM_CIPHERS];
+
+    /* this is not efficient, necessary to optimize this? */
+    for (SSL_CIPHER *c = tls13_ciphers; c < end; ++c) {
+        if (c->stdname == NULL)
+            continue;
+        if (OPENSSL_strcasecmp(stdname, c->stdname) == 0)
+            return c;
+    }
+    return NULL;
+}
+
 const SSL_CIPHER *ssl3_get_cipher_by_std_name(const char *stdname)
 {
     SSL_CIPHER *tbl;
-    SSL_CIPHER *alltabs[] = { tls13_ciphers, ssl3_ciphers, ssl3_scsvs };
-    size_t i, j, tblsize[] = { TLS13_NUM_CIPHERS, SSL3_NUM_CIPHERS, SSL3_NUM_SCSVS };
+    SSL_CIPHER *alltabs[] = { ssl3_ciphers, ssl3_scsvs };
+    size_t i, j, tblsize[] = { SSL3_NUM_CIPHERS, SSL3_NUM_SCSVS };

     /* this is not efficient, necessary to optimize this? */
     for (j = 0; j < OSSL_NELEM(alltabs); j++) {
         for (i = 0, tbl = alltabs[j]; i < tblsize[j]; i++, tbl++) {
             if (tbl->stdname == NULL)
                 continue;
-            if (strcmp(stdname, tbl->stdname) == 0) {
+            if (OPENSSL_strcasecmp(stdname, tbl->stdname) == 0) {
                 return tbl;
             }
         }
@@ -4748,7 +4839,7 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL_CONNECTION *s, STACK_OF(SSL_CIPHER) *cl
     if (tls1_suiteb(s)) {
         prio = srvr;
         allow = clnt;
-    } else if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE) {
+    } else if (s->options & SSL_OP_SERVER_PREFERENCE) {
         prio = srvr;
         allow = clnt;

@@ -4795,7 +4886,7 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL_CONNECTION *s, STACK_OF(SSL_CIPHER) *cl
         allow = srvr;
     }

-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
 #ifndef OPENSSL_NO_PSK
         size_t j;

@@ -4807,7 +4898,7 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL_CONNECTION *s, STACK_OF(SSL_CIPHER) *cl
          * that.
          */
         if (s->psk_server_callback != NULL) {
-            for (j = 0; j < s->ssl_pkey_num && !ssl_has_cert(s, j); j++)
+            for (j = 0; j < s->ssl_pkey_num && !ssl_has_cert(s, (int)j); j++)
                 ;
             if (j == s->ssl_pkey_num) {
                 /* There are no certificates */
@@ -4828,7 +4919,8 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL_CONNECTION *s, STACK_OF(SSL_CIPHER) *cl
         maxversion = SSL_CONNECTION_IS_DTLS(s) ? c->max_dtls : c->max_tls;

         /* Skip ciphers not supported by the protocol version */
-        if (ssl_version_cmp(s, s->version, minversion) < 0
+        if (minversion <= 0 || maxversion <= 0
+            || ssl_version_cmp(s, s->version, minversion) < 0
             || ssl_version_cmp(s, s->version, maxversion) > 0)
             continue;

@@ -4836,7 +4928,7 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL_CONNECTION *s, STACK_OF(SSL_CIPHER) *cl
          * Since TLS 1.3 ciphersuites can be used with any auth or
          * key exchange scheme skip tests.
          */
-        if (!SSL_CONNECTION_IS_TLS13(s)) {
+        if (!SSL_CONNECTION_IS_VERSION13(s)) {
             mask_k = s->s3.tmp.mask_k;
             mask_a = s->s3.tmp.mask_a;
 #ifndef OPENSSL_NO_SRP
@@ -4860,11 +4952,18 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL_CONNECTION *s, STACK_OF(SSL_CIPHER) *cl
                 "%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n",
                 ok, alg_k, alg_a, mask_k, mask_a, (void *)c, c->name);

+            /*
+             * if we are considering a DHE cipher suite that uses an ephemeral
+             * FFDHE key check it
+             */
+            if (alg_k & (SSL_kDHE | SSL_kDHEPSK))
+                ok = ok && tls1_check_ffdhe_tmp_key(s, c->id);
+
             /*
              * if we are considering an ECC cipher suite that uses an ephemeral
              * EC key check it
              */
-            if (alg_k & SSL_kECDHE)
+            if (alg_k & (SSL_kECDHE | SSL_kECDHEPSK))
                 ok = ok && tls1_check_ec_tmp_key(s, c->id);

             if (!ok)
@@ -4910,7 +5009,10 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL_CONNECTION *s, STACK_OF(SSL_CIPHER) *cl

 int ssl3_get_req_cert_type(SSL_CONNECTION *s, WPACKET *pkt)
 {
-    uint32_t alg_k, alg_a = 0;
+#ifndef OPENSSL_NO_GOST
+    uint32_t alg_k;
+#endif
+    uint32_t alg_a = 0;

     /* If we have custom certificate types set, use them */
     if (s->cert->ctype)
@@ -4918,9 +5020,9 @@ int ssl3_get_req_cert_type(SSL_CONNECTION *s, WPACKET *pkt)
     /* Get mask of algorithms disabled by signature list */
     ssl_set_sig_mask(&alg_a, s, SSL_SECOP_SIGALG_MASK);

+#ifndef OPENSSL_NO_GOST
     alg_k = s->s3.tmp.new_cipher->algorithm_mkey;

-#ifndef OPENSSL_NO_GOST
     if (s->version >= TLS1_VERSION && (alg_k & SSL_kGOST))
         if (!WPACKET_put_bytes_u8(pkt, TLS_CT_GOST01_SIGN)
             || !WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_IANA_SIGN)
@@ -4935,13 +5037,6 @@ int ssl3_get_req_cert_type(SSL_CONNECTION *s, WPACKET *pkt)
             return 0;
 #endif

-    if ((s->version == SSL3_VERSION) && (alg_k & SSL_kDHE)) {
-        if (!WPACKET_put_bytes_u8(pkt, SSL3_CT_RSA_EPHEMERAL_DH))
-            return 0;
-        if (!(alg_a & SSL_aDSS)
-            && !WPACKET_put_bytes_u8(pkt, SSL3_CT_DSS_EPHEMERAL_DH))
-            return 0;
-    }
     if (!(alg_a & SSL_aRSA) && !WPACKET_put_bytes_u8(pkt, SSL3_CT_RSA_SIGN))
         return 0;
     if (!(alg_a & SSL_aDSS) && !WPACKET_put_bytes_u8(pkt, SSL3_CT_DSS_SIGN))
@@ -4999,9 +5094,9 @@ int ssl3_shutdown(SSL *s)
          * our shutdown alert has been sent now, and if it still needs to be
          * written, s->s3.alert_dispatch will be > 0
          */
-        if (sc->s3.alert_dispatch > 0)
+        if (sc->s3.alert_dispatch != SSL_ALERT_DISPATCH_NONE)
             return -1; /* return WANT_WRITE */
-    } else if (sc->s3.alert_dispatch > 0) {
+    } else if (sc->s3.alert_dispatch != SSL_ALERT_DISPATCH_NONE) {
         /* resend it if not sent */
         ret = s->method->ssl_dispatch_alert(s);
         if (ret == -1) {
@@ -5380,7 +5475,7 @@ int ssl_gensecret(SSL_CONNECTION *s, unsigned char *pms, size_t pmslen)
     int rv = 0;

     /* SSLfatal() called as appropriate in the below functions */
-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         /*
          * If we are resuming then we already generated the early secret
          * when we created the ClientHello, so don't recreate it.
@@ -5423,7 +5518,7 @@ int ssl_derive(SSL_CONNECTION *s, EVP_PKEY *privkey, EVP_PKEY *pubkey, int gense
         goto err;
     }

-    if (SSL_CONNECTION_IS_TLS13(s) && EVP_PKEY_is_a(privkey, "DH"))
+    if (SSL_CONNECTION_IS_VERSION13(s) && EVP_PKEY_is_a(privkey, "DH"))
         EVP_PKEY_CTX_set_dh_pad(pctx, 1);

     pms = OPENSSL_malloc(pmslen);
@@ -5578,10 +5673,12 @@ const char *SSL_get0_group_name(SSL *s)
     if (sc == NULL)
         return NULL;

-    if (SSL_CONNECTION_IS_TLS13(sc) && sc->s3.did_kex)
+    if (SSL_CONNECTION_IS_VERSION13(sc) && sc->s3.did_kex)
         id = sc->s3.group_id;
-    else
+    else if (sc->session != NULL)
         id = sc->session->kex_group;
+    else
+        return NULL;

     return tls1_group_id2name(s->ctx, id);
 }
diff --git a/deps/openssl/openssl/ssl/s3_msg.c b/deps/openssl/openssl/ssl/s3_msg.c
index ffe53bfe181..c1cb8e8bb0c 100644
--- a/deps/openssl/openssl/ssl/s3_msg.c
+++ b/deps/openssl/openssl/ssl/s3_msg.c
@@ -51,9 +51,6 @@ int ssl3_send_alert(SSL_CONNECTION *s, int level, int desc)
         desc = tls13_alert_code(desc);
     else
         desc = ssl->method->ssl3_enc->alert_value(desc);
-    if (s->version == SSL3_VERSION && desc == SSL_AD_PROTOCOL_VERSION)
-        desc = SSL_AD_HANDSHAKE_FAILURE; /* SSL 3.0 does not have
-                                          * protocol_version alerts */
     if (desc < 0)
         return -1;
     if (s->shutdown & SSL_SENT_SHUTDOWN && desc != SSL_AD_CLOSE_NOTIFY)
diff --git a/deps/openssl/openssl/ssl/ssl_asn1.c b/deps/openssl/openssl/ssl/ssl_asn1.c
index 13ab6490b9a..12cd62d7732 100644
--- a/deps/openssl/openssl/ssl/ssl_asn1.c
+++ b/deps/openssl/openssl/ssl/ssl_asn1.c
@@ -15,6 +15,8 @@
 #include <openssl/encoder.h>
 #include <openssl/x509.h>

+#include <crypto/asn1.h>
+
 typedef struct {
     uint32_t version;
     int32_t ssl_version;
diff --git a/deps/openssl/openssl/ssl/ssl_cert.c b/deps/openssl/openssl/ssl/ssl_cert.c
index 43d1191c6e2..49831e812a2 100644
--- a/deps/openssl/openssl/ssl/ssl_cert.c
+++ b/deps/openssl/openssl/ssl/ssl_cert.c
@@ -73,7 +73,7 @@ CERT *ssl_cert_new(size_t ssl_pkey_num)
         return NULL;

     ret->ssl_pkey_num = ssl_pkey_num;
-    ret->pkeys = OPENSSL_zalloc(ret->ssl_pkey_num * sizeof(CERT_PKEY));
+    ret->pkeys = OPENSSL_calloc(ret->ssl_pkey_num, sizeof(CERT_PKEY));
     if (ret->pkeys == NULL) {
         OPENSSL_free(ret);
         return NULL;
@@ -104,7 +104,7 @@ CERT *ssl_cert_dup(CERT *cert)
         return NULL;

     ret->ssl_pkey_num = cert->ssl_pkey_num;
-    ret->pkeys = OPENSSL_zalloc(ret->ssl_pkey_num * sizeof(CERT_PKEY));
+    ret->pkeys = OPENSSL_calloc(ret->ssl_pkey_num, sizeof(CERT_PKEY));
     if (ret->pkeys == NULL) {
         OPENSSL_free(ret);
         return NULL;
@@ -169,8 +169,8 @@ CERT *ssl_cert_dup(CERT *cert)

     /* Configured sigalgs copied across */
     if (cert->conf_sigalgs) {
-        ret->conf_sigalgs = OPENSSL_malloc(cert->conf_sigalgslen
-            * sizeof(*cert->conf_sigalgs));
+        ret->conf_sigalgs = OPENSSL_malloc_array(cert->conf_sigalgslen,
+            sizeof(*cert->conf_sigalgs));
         if (ret->conf_sigalgs == NULL)
             goto err;
         memcpy(ret->conf_sigalgs, cert->conf_sigalgs,
@@ -180,8 +180,8 @@ CERT *ssl_cert_dup(CERT *cert)
         ret->conf_sigalgs = NULL;

     if (cert->client_sigalgs) {
-        ret->client_sigalgs = OPENSSL_malloc(cert->client_sigalgslen
-            * sizeof(*cert->client_sigalgs));
+        ret->client_sigalgs = OPENSSL_malloc_array(cert->client_sigalgslen,
+            sizeof(*cert->client_sigalgs));
         if (ret->client_sigalgs == NULL)
             goto err;
         memcpy(ret->client_sigalgs, cert->client_sigalgs,
@@ -432,6 +432,10 @@ static int ssl_verify_internal(SSL_CONNECTION *s, STACK_OF(X509) *sk, EVP_PKEY *
     X509_STORE_CTX *ctx = NULL;
     X509_VERIFY_PARAM *param;
     SSL_CTX *sctx;
+#ifndef OPENSSL_NO_OCSP
+    SSL *ssl;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;
+#endif

     /* Something must be passed in */
     if ((sk == NULL || sk_X509_num(sk) == 0) && rpk == NULL)
@@ -485,6 +489,24 @@ static int ssl_verify_internal(SSL_CONNECTION *s, STACK_OF(X509) *sk, EVP_PKEY *
     if (DANETLS_ENABLED(&s->dane))
         X509_STORE_CTX_set0_dane(ctx, &s->dane);

+    /*
+     * Set OCSP Responses for verification:
+     * This function is called in the SERVER_CERTIFICATE message, in TLS 1.2
+     * the OCSP responses are sent in the CERT_STATUS message after that.
+     * Therefore the verification code currently only works in TLS 1.3.
+     */
+#ifndef OPENSSL_NO_OCSP
+    ssl = SSL_CONNECTION_GET_SSL(s);
+
+    if (ssl_version_cmp(s, SSL_version(ssl), version1_3) >= 0) {
+        /* ignore status_request_v2 if TLS version < 1.3 */
+        int status = SSL_get_tlsext_status_type(ssl);
+
+        if (status == TLSEXT_STATUSTYPE_ocsp)
+            X509_STORE_CTX_set_ocsp_resp(ctx, s->ext.ocsp.resp_ex);
+    }
+#endif
+
     /*
      * We need to inherit the verify parameters. These can be determined by
      * the context: if its a server it will verify SSL client certificates or
@@ -718,8 +740,8 @@ static int xname_cmp(const X509_NAME *a, const X509_NAME *b)
     /* X509_NAME_cmp() itself casts away constness in this way, so
      * assume it's safe:
      */
-    alen = i2d_X509_NAME((X509_NAME *)a, &abuf);
-    blen = i2d_X509_NAME((X509_NAME *)b, &bbuf);
+    alen = i2d_X509_NAME(a, &abuf);
+    blen = i2d_X509_NAME(b, &bbuf);

     if (alen < 0 || blen < 0)
         ret = -2;
@@ -742,7 +764,7 @@ static int xname_sk_cmp(const X509_NAME *const *a, const X509_NAME *const *b)
 static unsigned long xname_hash(const X509_NAME *a)
 {
     /* This returns 0 also if SHA1 is not available */
-    return X509_NAME_hash_ex((X509_NAME *)a, NULL, NULL, NULL);
+    return X509_NAME_hash_ex(a, NULL, NULL, NULL);
 }

 STACK_OF(X509_NAME) *SSL_load_client_CA_file_ex(const char *file,
@@ -751,6 +773,7 @@ STACK_OF(X509_NAME) *SSL_load_client_CA_file_ex(const char *file,
 {
     BIO *in = BIO_new(BIO_s_file());
     X509 *x = NULL;
+    const X509_NAME *cxn = NULL;
     X509_NAME *xn = NULL;
     STACK_OF(X509_NAME) *ret = NULL;
     LHASH_OF(X509_NAME) *name_hash = lh_X509_NAME_new(xname_hash, xname_cmp);
@@ -789,10 +812,10 @@ STACK_OF(X509_NAME) *SSL_load_client_CA_file_ex(const char *file,
                 goto err;
             }
         }
-        if ((xn = X509_get_subject_name(x)) == NULL)
+        if ((cxn = X509_get_subject_name(x)) == NULL)
             goto err;
         /* check for duplicates */
-        xn = X509_NAME_dup(xn);
+        xn = X509_NAME_dup(cxn);
         if (xn == NULL)
             goto err;
         if (lh_X509_NAME_retrieve(name_hash, xn) != NULL) {
@@ -833,6 +856,7 @@ static int add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
 {
     BIO *in;
     X509 *x = NULL;
+    const X509_NAME *cxn = NULL;
     X509_NAME *xn = NULL;
     int ret = 1;

@@ -849,9 +873,9 @@ static int add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
     for (;;) {
         if (PEM_read_bio_X509(in, &x, NULL, NULL) == NULL)
             break;
-        if ((xn = X509_get_subject_name(x)) == NULL)
+        if ((cxn = X509_get_subject_name(x)) == NULL)
             goto err;
-        xn = X509_NAME_dup(xn);
+        xn = X509_NAME_dup(cxn);
         if (xn == NULL)
             goto err;
         if (lh_X509_NAME_retrieve(name_hash, xn) != NULL) {
@@ -957,22 +981,20 @@ int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
         if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0)
             continue;
 #endif
-        if (strlen(dir) + strlen(filename) + 2 > sizeof(buf)) {
-            ERR_raise(ERR_LIB_SSL, SSL_R_PATH_TOO_LONG);
-            goto err;
-        }
 #ifdef OPENSSL_SYS_VMS
-        r = BIO_snprintf(buf, sizeof(buf), "%s%s", dir, filename);
+        r = snprintf(buf, sizeof(buf), "%s%s", dir, filename);
 #else
-        r = BIO_snprintf(buf, sizeof(buf), "%s/%s", dir, filename);
+        r = snprintf(buf, sizeof(buf), "%s/%s", dir, filename);
 #endif
+        if (r < 0 || (size_t)r >= sizeof(buf)) {
+            ERR_raise(ERR_LIB_SSL, SSL_R_PATH_TOO_LONG);
+            goto err;
+        }
 #ifndef OPENSSL_NO_POSIX_IO
         /* Skip subdirectories */
         if (!stat(buf, &st) && S_ISDIR(st.st_mode))
             continue;
 #endif
-        if (r <= 0 || r >= (int)sizeof(buf))
-            goto err;
         if (!add_file_cert_subjects_to_stack(stack, buf, name_hash))
             goto err;
     }
@@ -1000,6 +1022,7 @@ static int add_uris_recursive(STACK_OF(X509_NAME) *stack,
     int ok = 1;
     OSSL_STORE_CTX *ctx = NULL;
     X509 *x = NULL;
+    const X509_NAME *cxn = NULL;
     X509_NAME *xn = NULL;
     OSSL_STORE_INFO *info = NULL;

@@ -1023,8 +1046,8 @@ static int add_uris_recursive(STACK_OF(X509_NAME) *stack,
                     depth - 1);
         } else if (infotype == OSSL_STORE_INFO_CERT) {
             if ((x = OSSL_STORE_INFO_get0_CERT(info)) == NULL
-                || (xn = X509_get_subject_name(x)) == NULL
-                || (xn = X509_NAME_dup(xn)) == NULL)
+                || (cxn = X509_get_subject_name(x)) == NULL
+                || (xn = X509_NAME_dup(cxn)) == NULL)
                 goto err;
             if (sk_X509_NAME_find(stack, xn) >= 0) {
                 /* Duplicate. */
@@ -1222,8 +1245,10 @@ static int ssl_security_default_callback(const SSL *s, const SSL_CTX *ctx,
     int op, int bits, int nid, void *other,
     void *ex)
 {
-    int level, minbits, pfs_mask;
+    int level, minbits, pfs_mask, minversion;
     const SSL_CONNECTION *sc;
+    const int version1_3 = SSL_is_dtls(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;
+    const int version1_2 = SSL_is_dtls(s) ? DTLS1_2_VERSION : TLS1_2_VERSION;

     minbits = ssl_get_security_level_bits(s, ctx, &level);

@@ -1253,24 +1278,21 @@ static int ssl_security_default_callback(const SSL *s, const SSL_CTX *ctx,
         /* SHA1 HMAC is 160 bits of security */
         if (minbits > 160 && c->algorithm_mac & SSL_SHA1)
             return 0;
+
         /* Level 3: forward secure ciphersuites only */
         pfs_mask = SSL_kDHE | SSL_kECDHE | SSL_kDHEPSK | SSL_kECDHEPSK;
-        if (level >= 3 && c->min_tls != TLS1_3_VERSION && !(c->algorithm_mkey & pfs_mask))
+        minversion = SSL_is_dtls(s) ? c->min_dtls : c->min_tls;
+
+        if (level >= 3 && minversion != version1_3 && !(c->algorithm_mkey & pfs_mask))
             return 0;
         break;
     }
     case SSL_SECOP_VERSION:
         if ((sc = SSL_CONNECTION_FROM_CONST_SSL(s)) == NULL)
             return 0;
-        if (!SSL_CONNECTION_IS_DTLS(sc)) {
-            /* SSLv3, TLS v1.0 and TLS v1.1 only allowed at level 0 */
-            if (nid <= TLS1_1_VERSION && level > 0)
-                return 0;
-        } else {
-            /* DTLS v1.0 only allowed at level 0 */
-            if (DTLS_VERSION_LT(nid, DTLS1_2_VERSION) && level > 0)
-                return 0;
-        }
+        /* SSLv3, TLS v1.0 and TLS v1.1 and DTLS v1.0 only allowed at level 0 */
+        if (ssl_version_cmp(sc, nid, version1_2) < 0 && level > 0)
+            return 0;
         break;

     case SSL_SECOP_COMPRESSION:
diff --git a/deps/openssl/openssl/ssl/ssl_cert_comp.c b/deps/openssl/openssl/ssl/ssl_cert_comp.c
index a59b79811b8..9ff30948423 100644
--- a/deps/openssl/openssl/ssl/ssl_cert_comp.c
+++ b/deps/openssl/openssl/ssl/ssl_cert_comp.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -111,12 +111,13 @@ __owur static OSSL_COMP_CERT *OSSL_COMP_CERT_from_uncompressed_data(unsigned cha
     }

     if ((max_length = ossl_calculate_comp_expansion(alg, len)) == 0
+        || max_length > INT_MAX
         || method == NULL
         || (comp_ctx = COMP_CTX_new(method)) == NULL
         || (comp_data = OPENSSL_zalloc(max_length)) == NULL)
         goto err;

-    comp_length = COMP_compress_block(comp_ctx, comp_data, max_length, data, len);
+    comp_length = COMP_compress_block(comp_ctx, comp_data, (int)max_length, data, (int)len);
     if (comp_length <= 0)
         goto err;

@@ -150,7 +151,7 @@ int OSSL_COMP_CERT_up_ref(OSSL_COMP_CERT *cc)
 {
     int i;

-    if (CRYPTO_UP_REF(&cc->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&cc->references, &i))
         return 0;

     REF_PRINT_COUNT("OSSL_COMP_CERT", i, cc);
diff --git a/deps/openssl/openssl/ssl/ssl_cert_table.h b/deps/openssl/openssl/ssl/ssl_cert_table.h
index f7fc9844c97..9f5b2a31e07 100644
--- a/deps/openssl/openssl/ssl/ssl_cert_table.h
+++ b/deps/openssl/openssl/ssl/ssl_cert_table.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -10,6 +10,13 @@
 /*
  * Certificate table information. NB: table entries must match SSL_PKEY indices
  */
+#if !defined(OSSL_SSL_SSL_CERT_TABLE_H)
+#define OSSL_SSL_SSL_CERT_TABLE_H
+
+#include <openssl/evp.h>
+
+#include "ssl_local.h"
+
 static const SSL_CERT_LOOKUP ssl_cert_info[] = {
     { EVP_PKEY_RSA, SSL_aRSA }, /* SSL_PKEY_RSA */
     { EVP_PKEY_RSA_PSS, SSL_aRSA }, /* SSL_PKEY_RSA_PSS_SIGN */
@@ -21,3 +28,5 @@ static const SSL_CERT_LOOKUP ssl_cert_info[] = {
     { EVP_PKEY_ED25519, SSL_aECDSA }, /* SSL_PKEY_ED25519 */
     { EVP_PKEY_ED448, SSL_aECDSA } /* SSL_PKEY_ED448 */
 };
+
+#endif /* !defined(OSSL_SSL_SSL_CERT_TABLE_H) */
diff --git a/deps/openssl/openssl/ssl/ssl_ciph.c b/deps/openssl/openssl/ssl/ssl_ciph.c
index fd2c4b08333..ce144974832 100644
--- a/deps/openssl/openssl/ssl/ssl_ciph.c
+++ b/deps/openssl/openssl/ssl/ssl_ciph.c
@@ -9,11 +9,15 @@
  * https://www.openssl.org/source/license.html
  */

+/*
+ * Because of *asn1_*
+ */
+#define OPENSSL_SUPPRESS_DEPRECATED
+
 #include <stdio.h>
 #include <ctype.h>
 #include <openssl/objects.h>
 #include <openssl/comp.h>
-#include <openssl/engine.h>
 #include <openssl/crypto.h>
 #include <openssl/conf.h>
 #include <openssl/trace.h>
@@ -55,8 +59,10 @@ static const ssl_cipher_table ssl_cipher_table_cipher[SSL_ENC_NUM_IDX] = {
     { SSL_CHACHA20POLY1305, NID_chacha20_poly1305 }, /* SSL_ENC_CHACHA_IDX 19 */
     { SSL_ARIA128GCM, NID_aria_128_gcm }, /* SSL_ENC_ARIA128GCM_IDX 20 */
     { SSL_ARIA256GCM, NID_aria_256_gcm }, /* SSL_ENC_ARIA256GCM_IDX 21 */
-    { SSL_MAGMA, NID_magma_ctr_acpkm }, /* SSL_ENC_MAGMA_IDX */
-    { SSL_KUZNYECHIK, NID_kuznyechik_ctr_acpkm }, /* SSL_ENC_KUZNYECHIK_IDX */
+    { SSL_MAGMA, NID_magma_ctr_acpkm }, /* SSL_ENC_MAGMA_IDX 22 */
+    { SSL_KUZNYECHIK, NID_kuznyechik_ctr_acpkm }, /* SSL_ENC_KUZNYECHIK_IDX 23 */
+    { SSL_SM4GCM, NID_sm4_gcm }, /* SSL_ENC_SM4GCM_IDX 24 */
+    { SSL_SM4CCM, NID_sm4_ccm }, /* SSL_ENC_SM4CCM_IDX 25 */
 };

 /* NB: make sure indices in this table matches values above */
@@ -73,8 +79,9 @@ static const ssl_cipher_table ssl_cipher_table_mac[SSL_MD_NUM_IDX] = {
     { 0, NID_md5_sha1 }, /* SSL_MD_MD5_SHA1_IDX 9 */
     { 0, NID_sha224 }, /* SSL_MD_SHA224_IDX 10 */
     { 0, NID_sha512 }, /* SSL_MD_SHA512_IDX 11 */
-    { SSL_MAGMAOMAC, NID_magma_mac }, /* sSL_MD_MAGMAOMAC_IDX */
-    { SSL_KUZNYECHIKOMAC, NID_kuznyechik_mac } /* SSL_MD_KUZNYECHIKOMAC_IDX */
+    { SSL_MAGMAOMAC, NID_magma_mac }, /* sSL_MD_MAGMAOMAC_IDX 12 */
+    { SSL_KUZNYECHIKOMAC, NID_kuznyechik_mac }, /* SSL_MD_KUZNYECHIKOMAC_IDX 13 */
+    { 0, NID_sm3 }, /* SSL_MD_SM3_IDX 14 */
 };

 /* *INDENT-OFF* */
@@ -120,11 +127,6 @@ static int ssl_cipher_info_find(const ssl_cipher_table *table,
 #define ssl_cipher_info_lookup(table, x) \
     ssl_cipher_info_find(table, OSSL_NELEM(table), x)

-/*
- * PKEY_TYPE for GOST89MAC is known in advance, but, because implementation
- * is engine-provided, we'll fill it only if corresponding EVP_PKEY_METHOD is
- * found
- */
 static const int default_mac_pkey_id[SSL_MD_NUM_IDX] = {
     /* MD5, SHA, GOST94, MAC89 */
     EVP_PKEY_HMAC, EVP_PKEY_HMAC, EVP_PKEY_HMAC, NID_undef,
@@ -255,7 +257,6 @@ static const SSL_CIPHER cipher_aliases[] = {
     { 0, SSL_TXT_GOST12, NULL, 0, 0, 0, 0, SSL_GOST12_256 },

     /* protocol version aliases */
-    { 0, SSL_TXT_SSLV3, NULL, 0, 0, 0, 0, 0, SSL3_VERSION },
     { 0, SSL_TXT_TLSV1, NULL, 0, 0, 0, 0, 0, TLS1_VERSION },
     { 0, "TLSv1.0", NULL, 0, 0, 0, 0, 0, TLS1_VERSION },
     { 0, SSL_TXT_TLSV1_2, NULL, 0, 0, 0, 0, 0, TLS1_2_VERSION },
@@ -264,53 +265,15 @@ static const SSL_CIPHER cipher_aliases[] = {
     { 0, SSL_TXT_LOW, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, SSL_LOW },
     { 0, SSL_TXT_MEDIUM, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, SSL_MEDIUM },
     { 0, SSL_TXT_HIGH, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, SSL_HIGH },
-    /* FIPS 140-2 approved ciphersuite */
-    { 0, SSL_TXT_FIPS, NULL, 0, 0, 0, ~SSL_eNULL, 0, 0, 0, 0, 0, SSL_FIPS },

     /* "EDH-" aliases to "DHE-" labels (for backward compatibility) */
     { 0, SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA, NULL, 0,
-        SSL_kDHE, SSL_aDSS, SSL_3DES, SSL_SHA1, 0, 0, 0, 0, SSL_HIGH | SSL_FIPS },
+        SSL_kDHE, SSL_aDSS, SSL_3DES, SSL_SHA1, 0, 0, 0, 0, SSL_HIGH },
     { 0, SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA, NULL, 0,
-        SSL_kDHE, SSL_aRSA, SSL_3DES, SSL_SHA1, 0, 0, 0, 0, SSL_HIGH | SSL_FIPS },
+        SSL_kDHE, SSL_aRSA, SSL_3DES, SSL_SHA1, 0, 0, 0, 0, SSL_HIGH },

 };

-/*
- * Search for public key algorithm with given name and return its pkey_id if
- * it is available. Otherwise return 0
- */
-#ifdef OPENSSL_NO_ENGINE
-
-static int get_optional_pkey_id(const char *pkey_name)
-{
-    const EVP_PKEY_ASN1_METHOD *ameth;
-    int pkey_id = 0;
-    ameth = EVP_PKEY_asn1_find_str(NULL, pkey_name, -1);
-    if (ameth && EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, ameth) > 0)
-        return pkey_id;
-    return 0;
-}
-
-#else
-
-static int get_optional_pkey_id(const char *pkey_name)
-{
-    const EVP_PKEY_ASN1_METHOD *ameth;
-    ENGINE *tmpeng = NULL;
-    int pkey_id = 0;
-    ameth = EVP_PKEY_asn1_find_str(&tmpeng, pkey_name, -1);
-    if (ameth) {
-        if (EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL,
-                ameth)
-            <= 0)
-            pkey_id = 0;
-    }
-    tls_engine_finish(tmpeng);
-    return pkey_id;
-}
-
-#endif
-
 int ssl_load_ciphers(SSL_CTX *ctx)
 {
     size_t i;
@@ -321,8 +284,9 @@ int ssl_load_ciphers(SSL_CTX *ctx)
     ctx->disabled_enc_mask = 0;
     for (i = 0, t = ssl_cipher_table_cipher; i < SSL_ENC_NUM_IDX; i++, t++) {
         if (t->nid != NID_undef) {
-            const EVP_CIPHER *cipher
-                = ssl_evp_cipher_fetch(ctx->libctx, t->nid, ctx->propq);
+            const EVP_CIPHER *cipher = ssl_evp_cipher_fetch(ctx->libctx,
+                OBJ_nid2sn(t->nid),
+                ctx->propq);

             ctx->ssl_cipher_methods[i] = cipher;
             if (cipher == NULL)
@@ -331,8 +295,15 @@ int ssl_load_ciphers(SSL_CTX *ctx)
     }
     ctx->disabled_mac_mask = 0;
     for (i = 0, t = ssl_cipher_table_mac; i < SSL_MD_NUM_IDX; i++, t++) {
-        const EVP_MD *md
-            = ssl_evp_md_fetch(ctx->libctx, t->nid, ctx->propq);
+        /*
+         * We ignore any errors from the fetch below. It is expected to fail
+         * if these algorithms are not available.
+         */
+        ERR_set_mark();
+        const EVP_MD *md = EVP_MD_fetch(ctx->libctx,
+            OBJ_nid2sn(t->nid),
+            ctx->propq);
+        ERR_pop_to_mark();

         ctx->ssl_digest_methods[i] = md;
         if (md == NULL) {
@@ -391,36 +362,33 @@ int ssl_load_ciphers(SSL_CTX *ctx)
     memcpy(ctx->ssl_mac_pkey_id, default_mac_pkey_id,
         sizeof(ctx->ssl_mac_pkey_id));

-    ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC_IDX] = get_optional_pkey_id(SN_id_Gost28147_89_MAC);
+    ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC_IDX] = 0;
     if (ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC_IDX])
         ctx->ssl_mac_secret_size[SSL_MD_GOST89MAC_IDX] = 32;
     else
         ctx->disabled_mac_mask |= SSL_GOST89MAC;

-    ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC12_IDX] = get_optional_pkey_id(SN_gost_mac_12);
+    ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC12_IDX] = 0;
     if (ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC12_IDX])
         ctx->ssl_mac_secret_size[SSL_MD_GOST89MAC12_IDX] = 32;
     else
         ctx->disabled_mac_mask |= SSL_GOST89MAC12;

-    ctx->ssl_mac_pkey_id[SSL_MD_MAGMAOMAC_IDX] = get_optional_pkey_id(SN_magma_mac);
+    ctx->ssl_mac_pkey_id[SSL_MD_MAGMAOMAC_IDX] = 0;
     if (ctx->ssl_mac_pkey_id[SSL_MD_MAGMAOMAC_IDX])
         ctx->ssl_mac_secret_size[SSL_MD_MAGMAOMAC_IDX] = 32;
     else
         ctx->disabled_mac_mask |= SSL_MAGMAOMAC;

-    ctx->ssl_mac_pkey_id[SSL_MD_KUZNYECHIKOMAC_IDX] = get_optional_pkey_id(SN_kuznyechik_mac);
+    ctx->ssl_mac_pkey_id[SSL_MD_KUZNYECHIKOMAC_IDX] = 0;
     if (ctx->ssl_mac_pkey_id[SSL_MD_KUZNYECHIKOMAC_IDX])
         ctx->ssl_mac_secret_size[SSL_MD_KUZNYECHIKOMAC_IDX] = 32;
     else
         ctx->disabled_mac_mask |= SSL_KUZNYECHIKOMAC;

-    if (!get_optional_pkey_id(SN_id_GostR3410_2001))
-        ctx->disabled_auth_mask |= SSL_aGOST01 | SSL_aGOST12;
-    if (!get_optional_pkey_id(SN_id_GostR3410_2012_256))
-        ctx->disabled_auth_mask |= SSL_aGOST12;
-    if (!get_optional_pkey_id(SN_id_GostR3410_2012_512))
-        ctx->disabled_auth_mask |= SSL_aGOST12;
+    ctx->disabled_auth_mask |= SSL_aGOST01 | SSL_aGOST12;
+    ctx->disabled_auth_mask |= SSL_aGOST12;
+    ctx->disabled_auth_mask |= SSL_aGOST12;
     /*
      * Disable GOST key exchange if no GOST signature algs are available *
      */
@@ -444,9 +412,8 @@ int ssl_cipher_get_evp_cipher(SSL_CTX *ctx, const SSL_CIPHER *sslc,
     } else {
         if (i == SSL_ENC_NULL_IDX) {
             /*
-             * We assume we don't care about this coming from an ENGINE so
-             * just do a normal EVP_CIPHER_fetch instead of
-             * ssl_evp_cipher_fetch()
+             * This does not need any special handling. Use EVP_CIPHER_fetch()
+             * directly.
              */
             *enc = EVP_CIPHER_fetch(ctx->libctx, "NULL", ctx->propq);
             if (*enc == NULL)
@@ -490,8 +457,47 @@ int ssl_cipher_get_evp_md_mac(SSL_CTX *ctx, const SSL_CIPHER *sslc,
     return 1;
 }

+int ssl_cipher_get_evp_cipher_sn(SSL_CTX *ctx, const SSL_CIPHER *sslc,
+    const EVP_CIPHER **enc)
+{
+    int i = ssl_cipher_info_lookup(ssl_cipher_table_cipher, sslc->algorithm_enc);
+
+    if (i == -1) {
+        *enc = NULL;
+    } else {
+        if (i == SSL_ENC_NULL_IDX) {
+            /*
+             * We assume we don't care about this coming from an ENGINE so
+             * just do a normal EVP_CIPHER_fetch instead of
+             * ssl_evp_cipher_fetch()
+             */
+            *enc = EVP_CIPHER_fetch(ctx->libctx, "NULL", ctx->propq);
+        } else {
+            int ecbnid = NID_undef;
+
+            *enc = NULL;
+
+            if ((sslc->algorithm_enc & SSL_AES128_ANY) != 0)
+                ecbnid = NID_aes_128_ecb;
+            else if ((sslc->algorithm_enc & SSL_AES256_ANY) != 0)
+                ecbnid = NID_aes_256_ecb;
+            else if (ossl_assert((sslc->algorithm_enc & SSL_CHACHA20) != 0))
+                ecbnid = NID_chacha20;
+
+            if (ecbnid != NID_undef)
+                *enc = ssl_evp_cipher_fetch(ctx->libctx, OBJ_nid2sn(ecbnid), ctx->propq);
+        }
+
+        if (*enc == NULL)
+            return 0;
+    }
+    return 1;
+}
+
 int ssl_cipher_get_evp(SSL_CTX *ctx, const SSL_SESSION *s,
-    const EVP_CIPHER **enc, const EVP_MD **md,
+    const EVP_CIPHER **snenc,
+    const EVP_CIPHER **enc,
+    const EVP_MD **md,
     int *mac_pkey_type, size_t *mac_secret_size,
     SSL_COMP **comp, int use_etm)
 {
@@ -521,12 +527,18 @@ int ssl_cipher_get_evp(SSL_CTX *ctx, const SSL_SESSION *s,
     if ((enc == NULL) || (md == NULL))
         return 0;

-    if (!ssl_cipher_get_evp_cipher(ctx, c, enc))
+    if (!ssl_cipher_get_evp_cipher(ctx, c, enc)
+        || (snenc != NULL
+            && !ssl_cipher_get_evp_cipher_sn(ctx, c, snenc)))
         return 0;

     if (!ssl_cipher_get_evp_md_mac(ctx, c, md, mac_pkey_type,
             mac_secret_size)) {
         ssl_evp_cipher_free(*enc);
+
+        if (snenc != NULL)
+            ssl_evp_cipher_free(*snenc);
+
         return 0;
     }

@@ -544,27 +556,28 @@ int ssl_cipher_get_evp(SSL_CTX *ctx, const SSL_SESSION *s,

         if (c->algorithm_enc == SSL_RC4
             && c->algorithm_mac == SSL_MD5)
-            evp = ssl_evp_cipher_fetch(ctx->libctx, NID_rc4_hmac_md5,
+            evp = ssl_evp_cipher_fetch(ctx->libctx,
+                "RC4-HMAC-MD5",
                 ctx->propq);
         else if (c->algorithm_enc == SSL_AES128
             && c->algorithm_mac == SSL_SHA1)
             evp = ssl_evp_cipher_fetch(ctx->libctx,
-                NID_aes_128_cbc_hmac_sha1,
+                "AES-128-CBC-HMAC-SHA1",
                 ctx->propq);
         else if (c->algorithm_enc == SSL_AES256
             && c->algorithm_mac == SSL_SHA1)
             evp = ssl_evp_cipher_fetch(ctx->libctx,
-                NID_aes_256_cbc_hmac_sha1,
+                "AES-256-CBC-HMAC-SHA1",
                 ctx->propq);
         else if (c->algorithm_enc == SSL_AES128
             && c->algorithm_mac == SSL_SHA256)
             evp = ssl_evp_cipher_fetch(ctx->libctx,
-                NID_aes_128_cbc_hmac_sha256,
+                "AES-128-CBC-HMAC-SHA256",
                 ctx->propq);
         else if (c->algorithm_enc == SSL_AES256
             && c->algorithm_mac == SSL_SHA256)
             evp = ssl_evp_cipher_fetch(ctx->libctx,
-                NID_aes_256_cbc_hmac_sha256,
+                "AES-256-CBC-HMAC-SHA256",
                 ctx->propq);

         if (evp != NULL) {
@@ -650,7 +663,7 @@ static void ssl_cipher_collect_ciphers(const SSL_METHOD *ssl_method,

     /*
      * We have num_of_ciphers descriptions compiled in, depending on the
-     * method selected (SSLv3, TLSv1 etc).
+     * method selected (TLSv1, etc.).
      * These will later be sorted in a linked list with at most num
      * entries.
      */
@@ -926,7 +939,7 @@ static int ssl_cipher_strength_sort(CIPHER_ORDER **head_p,
         curr = curr->next;
     }

-    number_uses = OPENSSL_zalloc(sizeof(int) * (max_strength_bits + 1));
+    number_uses = OPENSSL_calloc(max_strength_bits + 1, sizeof(int));
     if (number_uses == NULL)
         return 0;

@@ -1046,17 +1059,17 @@ static int ssl_cipher_process_rulestr(const char *rule_str,
              * has the correct length. We can save a strlen() call:
              * just checking for the '\0' at the right place is
              * sufficient, we have to strncmp() anyway. (We cannot
-             * use strcmp(), because buf is not '\0' terminated.)
+             * use strcasecmp(), because buf is not '\0' terminated.)
              */
             j = found = 0;
             cipher_id = 0;
             while (ca_list[j]) {
-                if (strncmp(buf, ca_list[j]->name, buflen) == 0
+                if (OPENSSL_strncasecmp(buf, ca_list[j]->name, buflen) == 0
                     && (ca_list[j]->name[buflen] == '\0')) {
                     found = 1;
                     break;
                 } else if (ca_list[j]->stdname != NULL
-                    && strncmp(buf, ca_list[j]->stdname, buflen) == 0
+                    && OPENSSL_strncasecmp(buf, ca_list[j]->stdname, buflen) == 0
                     && ca_list[j]->stdname[buflen] == '\0') {
                     found = 1;
                     break;
@@ -1171,9 +1184,10 @@ static int ssl_cipher_process_rulestr(const char *rule_str,
          */
         if (rule == CIPHER_SPECIAL) { /* special command */
             ok = 0;
-            if ((buflen == 8) && HAS_PREFIX(buf, "STRENGTH")) {
+            if ((buflen == 8) && HAS_CASE_PREFIX(buf, "STRENGTH")) {
                 ok = ssl_cipher_strength_sort(head_p, tail_p);
-            } else if (buflen == 10 && CHECK_AND_SKIP_PREFIX(buf, "SECLEVEL=")) {
+            } else if (buflen == 10
+                && CHECK_AND_SKIP_CASE_PREFIX(buf, "SECLEVEL=")) {
                 int level = *buf - '0';
                 if (level < 0 || level > 5) {
                     ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_COMMAND);
@@ -1214,14 +1228,14 @@ static int check_suiteb_cipher_list(const SSL_METHOD *meth, CERT *c,
     const char **prule_str)
 {
     unsigned int suiteb_flags = 0, suiteb_comb2 = 0;
-    if (HAS_PREFIX(*prule_str, "SUITEB128ONLY")) {
+    if (HAS_CASE_PREFIX(*prule_str, "SUITEB128ONLY")) {
         suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS_ONLY;
-    } else if (HAS_PREFIX(*prule_str, "SUITEB128C2")) {
+    } else if (HAS_CASE_PREFIX(*prule_str, "SUITEB128C2")) {
         suiteb_comb2 = 1;
         suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS;
-    } else if (HAS_PREFIX(*prule_str, "SUITEB128")) {
+    } else if (HAS_CASE_PREFIX(*prule_str, "SUITEB128")) {
         suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS;
-    } else if (HAS_PREFIX(*prule_str, "SUITEB192")) {
+    } else if (HAS_CASE_PREFIX(*prule_str, "SUITEB192")) {
         suiteb_flags = SSL_CERT_FLAG_SUITEB_192_LOS;
     }

@@ -1276,11 +1290,16 @@ static int ciphersuite_cb(const char *elem, int len, void *arg)
     memcpy(name, elem, len);
     name[len] = '\0';

-    cipher = ssl3_get_cipher_by_std_name(name);
+    cipher = ssl3_get_tls13_cipher_by_std_name(name);
     if (cipher == NULL)
         /* Ciphersuite not found but return 1 to parse rest of the list */
         return 1;

+    /* Suppress duplicates */
+    for (int i = 0; i < sk_SSL_CIPHER_num(ciphersuites); ++i)
+        if (sk_SSL_CIPHER_value(ciphersuites, i)->id == cipher->id)
+            return 1;
+
     if (!sk_SSL_CIPHER_push(ciphersuites, cipher)) {
         ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
         return 0;
@@ -1340,15 +1359,23 @@ static int update_cipher_list(SSL_CTX *ctx,
         return 0;

     /*
-     * Delete any existing TLSv1.3 ciphersuites. These are always first in the
+     * Delete any existing (D)TLSv1.3 ciphersuites. These are always first in the
      * list.
      */
-    while (sk_SSL_CIPHER_num(tmp_cipher_list) > 0
-        && sk_SSL_CIPHER_value(tmp_cipher_list, 0)->min_tls
-            == TLS1_3_VERSION)
+
+    while (sk_SSL_CIPHER_num(tmp_cipher_list) > 0) {
+        const SSL_CIPHER *cipher = sk_SSL_CIPHER_value(tmp_cipher_list, 0);
+        const int version1_3 = SSL_CTX_IS_DTLS(ctx) ? DTLS1_3_VERSION
+                                                    : TLS1_3_VERSION;
+        const int minversion = SSL_CTX_IS_DTLS(ctx) ? cipher->min_dtls
+                                                    : cipher->min_tls;
+
+        if (minversion != version1_3)
+            break;
         (void)sk_SSL_CIPHER_delete(tmp_cipher_list, 0);
+    }

-    /* Insert the new TLSv1.3 ciphersuites */
+    /* Insert the new (D)TLSv1.3 ciphersuites */
     for (i = sk_SSL_CIPHER_num(tls13_ciphersuites) - 1; i >= 0; i--) {
         const SSL_CIPHER *sslc = sk_SSL_CIPHER_value(tls13_ciphersuites, i);

@@ -1450,7 +1477,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(SSL_CTX *ctx,
     num_of_ciphers = ssl_method->num_ciphers();

     if (num_of_ciphers > 0) {
-        co_list = OPENSSL_malloc(sizeof(*co_list) * num_of_ciphers);
+        co_list = OPENSSL_malloc_array(num_of_ciphers, sizeof(*co_list));
         if (co_list == NULL)
             return NULL; /* Failure */
     }
@@ -1561,7 +1588,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(SSL_CTX *ctx,
      */
     num_of_group_aliases = OSSL_NELEM(cipher_aliases);
     num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1;
-    ca_list = OPENSSL_malloc(sizeof(*ca_list) * num_of_alias_max);
+    ca_list = OPENSSL_malloc_array(num_of_alias_max, sizeof(*ca_list));
     if (ca_list == NULL) {
         OPENSSL_free(co_list);
         return NULL; /* Failure */
@@ -1576,7 +1603,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(SSL_CTX *ctx,
      */
     ok = 1;
     rule_p = rule_str;
-    if (HAS_PREFIX(rule_str, "DEFAULT")) {
+    if (HAS_CASE_PREFIX(rule_str, "DEFAULT")) {
         ok = ssl_cipher_process_rulestr(OSSL_default_cipher_list(),
             &head, &tail, ca_list, c);
         rule_p += 7;
@@ -1824,6 +1851,12 @@ char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len)
     case SSL_CHACHA20POLY1305:
         enc = "CHACHA20/POLY1305(256)";
         break;
+    case SSL_SM4GCM:
+        enc = "SM4GCM";
+        break;
+    case SSL_SM4CCM:
+        enc = "SM4CCM";
+        break;
     default:
         enc = "unknown";
         break;
@@ -1861,7 +1894,7 @@ char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len)
         break;
     }

-    BIO_snprintf(buf, len, format, cipher->name, ver, kx, au, enc, mac);
+    snprintf(buf, len, format, cipher->name, ver, kx, au, enc, mac);

     return buf;
 }
@@ -1903,7 +1936,8 @@ const char *OPENSSL_cipher_name(const char *stdname)

     if (stdname == NULL)
         return "(NONE)";
-    c = ssl3_get_cipher_by_std_name(stdname);
+    if ((c = ssl3_get_tls13_cipher_by_std_name(stdname)) == NULL)
+        c = ssl3_get_cipher_by_std_name(stdname);
     return SSL_CIPHER_get_name(c);
 }

@@ -2148,20 +2182,29 @@ int SSL_CIPHER_is_aead(const SSL_CIPHER *c)
     return (c->algorithm_mac & SSL_AEAD) ? 1 : 0;
 }

-int ssl_cipher_get_overhead(const SSL_CIPHER *c, size_t *mac_overhead,
-    size_t *int_overhead, size_t *blocksize,
-    size_t *ext_overhead)
+int ssl_cipher_get_overhead(const SSL_CIPHER *c, int version,
+    size_t *mac_overhead, size_t *int_overhead,
+    size_t *blocksize, size_t *ext_overhead)
 {
     int mac = 0, in = 0, blk = 0, out = 0;

     /* Some hard-coded numbers for the CCM/Poly1305 MAC overhead
      * because there are no handy #defines for those. */
     if (c->algorithm_enc & (SSL_AESGCM | SSL_ARIAGCM)) {
-        out = EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN;
+        out = EVP_GCM_TLS_TAG_LEN;
+        /* DTLS 1.3 uses an implicit nonce, so no explicit IV on the wire. */
+        if (version != DTLS1_3_VERSION)
+            out += EVP_GCM_TLS_EXPLICIT_IV_LEN;
     } else if (c->algorithm_enc & (SSL_AES128CCM | SSL_AES256CCM)) {
-        out = EVP_CCM_TLS_EXPLICIT_IV_LEN + 16;
+        out = 16;
+        /* DTLS 1.3 uses an implicit nonce, so no explicit IV on the wire. */
+        if (version != DTLS1_3_VERSION)
+            out += EVP_CCM_TLS_EXPLICIT_IV_LEN;
     } else if (c->algorithm_enc & (SSL_AES128CCM8 | SSL_AES256CCM8)) {
-        out = EVP_CCM_TLS_EXPLICIT_IV_LEN + 8;
+        out = 8;
+        /* DTLS 1.3 uses an implicit nonce, so no explicit IV on the wire. */
+        if (version != DTLS1_3_VERSION)
+            out += EVP_CCM_TLS_EXPLICIT_IV_LEN;
     } else if (c->algorithm_enc & SSL_CHACHA20POLY1305) {
         out = 16;
     } else if (c->algorithm_mac & SSL_AEAD) {
@@ -2240,3 +2283,117 @@ const char *OSSL_default_ciphersuites(void)
            "TLS_CHACHA20_POLY1305_SHA256:"
            "TLS_AES_128_GCM_SHA256";
 }
+
+int ssl_cipher_list_to_bytes(SSL_CONNECTION *s, STACK_OF(SSL_CIPHER) *sk,
+    WPACKET *pkt)
+{
+    int i;
+    size_t totlen = 0, len, maxlen, maxverok = 0;
+    int empty_reneg_info_scsv = !s->renegotiate
+        && !SSL_CONNECTION_IS_DTLS(s)
+        && ssl_security(s, SSL_SECOP_VERSION, 0, TLS1_VERSION, NULL)
+        && s->min_proto_version <= TLS1_VERSION;
+    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
+
+    /* Set disabled masks for this session */
+    if (!ssl_set_client_disabled(s)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_PROTOCOLS_AVAILABLE);
+        return 0;
+    }
+
+    if (sk == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+
+#ifdef OPENSSL_MAX_TLS1_2_CIPHER_LENGTH
+#if OPENSSL_MAX_TLS1_2_CIPHER_LENGTH < 6
+#error Max cipher length too short
+#endif
+    /*
+     * Some servers hang if client hello > 256 bytes as hack workaround
+     * chop number of supported ciphers to keep it well below this if we
+     * use TLS v1.2
+     */
+    if (TLS1_get_version(ssl) >= TLS1_2_VERSION)
+        maxlen = OPENSSL_MAX_TLS1_2_CIPHER_LENGTH & ~1;
+    else
+#endif
+        /* Maximum length that can be stored in 2 bytes. Length must be even */
+        maxlen = 0xfffe;
+
+    if (empty_reneg_info_scsv)
+        maxlen -= 2;
+    if (s->mode & SSL_MODE_SEND_FALLBACK_SCSV)
+        maxlen -= 2;
+
+    /* RFC 8701: prepend a GREASE cipher suite value */
+    if ((s->options & SSL_OP_GREASE) && !s->server) {
+        uint16_t grease_cs = ossl_grease_value(s, OSSL_GREASE_CIPHER);
+
+        if (!WPACKET_put_bytes_u16(pkt, grease_cs)) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+        totlen += 2;
+    }
+
+    for (i = 0; i < sk_SSL_CIPHER_num(sk) && totlen < maxlen; i++) {
+        const SSL_CIPHER *c;
+
+        c = sk_SSL_CIPHER_value(sk, i);
+        /* Skip disabled ciphers */
+        if (ssl_cipher_disabled(s, c, SSL_SECOP_CIPHER_SUPPORTED))
+            continue;
+
+        if (!ssl->method->put_cipher_by_char(c, pkt, &len)) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+
+        /* Sanity check that the maximum version we offer has ciphers enabled */
+        if (!maxverok) {
+            int minproto = SSL_CONNECTION_IS_DTLS(s) ? c->min_dtls : c->min_tls;
+            int maxproto = SSL_CONNECTION_IS_DTLS(s) ? c->max_dtls : c->max_tls;
+
+            if (ssl_version_cmp(s, maxproto, s->s3.tmp.max_ver) >= 0
+                && ssl_version_cmp(s, minproto, s->s3.tmp.max_ver) <= 0)
+                maxverok = 1;
+        }
+
+        totlen += len;
+    }
+
+    if (totlen == 0 || !maxverok) {
+        const char *maxvertext = !maxverok
+            ? "No ciphers enabled for max supported SSL/TLS version"
+            : NULL;
+
+        SSLfatal_data(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_CIPHERS_AVAILABLE,
+            maxvertext);
+        return 0;
+    }
+
+    if (totlen != 0) {
+        if (empty_reneg_info_scsv) {
+            static const SSL_CIPHER scsv = {
+                0, NULL, NULL, SSL3_CK_SCSV, 0, 0, 0, 0, 0, 0, 0, 0, 0
+            };
+            if (!ssl->method->put_cipher_by_char(&scsv, pkt, &len)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return 0;
+            }
+        }
+        if (s->mode & SSL_MODE_SEND_FALLBACK_SCSV) {
+            static const SSL_CIPHER scsv = {
+                0, NULL, NULL, SSL3_CK_FALLBACK_SCSV, 0, 0, 0, 0, 0, 0, 0, 0, 0
+            };
+            if (!ssl->method->put_cipher_by_char(&scsv, pkt, &len)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return 0;
+            }
+        }
+    }
+
+    return 1;
+}
diff --git a/deps/openssl/openssl/ssl/ssl_conf.c b/deps/openssl/openssl/ssl/ssl_conf.c
index 0d935938809..a7ba0fd11bc 100644
--- a/deps/openssl/openssl/ssl/ssl_conf.c
+++ b/deps/openssl/openssl/ssl/ssl_conf.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2012-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -9,6 +9,7 @@

 #include "internal/e_os.h"

+#include <limits.h>
 #include <stdio.h>
 #include "ssl_local.h"
 #include <openssl/conf.h>
@@ -288,7 +289,8 @@ static int cmd_Protocol(SSL_CONF_CTX *cctx, const char *value)
         SSL_FLAG_TBL_INV("TLSv1.2", SSL_OP_NO_TLSv1_2),
         SSL_FLAG_TBL_INV("TLSv1.3", SSL_OP_NO_TLSv1_3),
         SSL_FLAG_TBL_INV("DTLSv1", SSL_OP_NO_DTLSv1),
-        SSL_FLAG_TBL_INV("DTLSv1.2", SSL_OP_NO_DTLSv1_2)
+        SSL_FLAG_TBL_INV("DTLSv1.2", SSL_OP_NO_DTLSv1_2),
+        SSL_FLAG_TBL_INV("DTLSv1.3", SSL_OP_NO_DTLSv1_3)
     };
     cctx->tbl = ssl_protocol_list;
     cctx->ntbl = OSSL_NELEM(ssl_protocol_list);
@@ -321,7 +323,8 @@ static int protocol_from_string(const char *value)
         { "TLSv1.2", TLS1_2_VERSION },
         { "TLSv1.3", TLS1_3_VERSION },
         { "DTLSv1", DTLS1_VERSION },
-        { "DTLSv1.2", DTLS1_2_VERSION }
+        { "DTLSv1.2", DTLS1_2_VERSION },
+        { "DTLSv1.3", DTLS1_3_VERSION }
     };
     size_t i;
     size_t n = OSSL_NELEM(versions);
@@ -380,7 +383,7 @@ static int cmd_Options(SSL_CONF_CTX *cctx, const char *value)
             SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS),
         SSL_FLAG_TBL("Bugs", SSL_OP_ALL),
         SSL_FLAG_TBL_INV("Compression", SSL_OP_NO_COMPRESSION),
-        SSL_FLAG_TBL_SRV("ServerPreference", SSL_OP_CIPHER_SERVER_PREFERENCE),
+        SSL_FLAG_TBL_SRV("ServerPreference", SSL_OP_SERVER_PREFERENCE),
         SSL_FLAG_TBL_SRV("NoResumptionOnRenegotiation",
             SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION),
         SSL_FLAG_TBL_SRV("DHSingle", SSL_OP_SINGLE_DH_USE),
@@ -406,6 +409,7 @@ static int cmd_Options(SSL_CONF_CTX *cctx, const char *value)
         SSL_FLAG_TBL_INV("RxCertificateCompression", SSL_OP_NO_RX_CERTIFICATE_COMPRESSION),
         SSL_FLAG_TBL("KTLSTxZerocopySendfile", SSL_OP_ENABLE_KTLS_TX_ZEROCOPY_SENDFILE),
         SSL_FLAG_TBL("IgnoreUnexpectedEOF", SSL_OP_IGNORE_UNEXPECTED_EOF),
+        SSL_FLAG_TBL("LegacyECPointFormats", SSL_OP_LEGACY_EC_POINT_FORMATS),
     };
     if (value == NULL)
         return -3;
@@ -722,9 +726,11 @@ out:
 static int cmd_NumTickets(SSL_CONF_CTX *cctx, const char *value)
 {
     int rv = 0;
-    int num_tickets = atoi(value);
+    unsigned long ul;
+
+    if (OPENSSL_strtoul(value, NULL, 10, &ul) && ul <= INT_MAX) {
+        int num_tickets = (int)ul;

-    if (num_tickets >= 0) {
         if (cctx->ctx)
             rv = SSL_CTX_set_num_tickets(cctx->ctx, num_tickets);
         if (cctx->ssl)
@@ -785,6 +791,7 @@ static const ssl_conf_cmd_tbl ssl_conf_cmds[] = {
     SSL_CONF_CMD_SWITCH("no_anti_replay", SSL_CONF_FLAG_SERVER),
     SSL_CONF_CMD_SWITCH("no_etm", 0),
     SSL_CONF_CMD_SWITCH("no_ems", 0),
+    SSL_CONF_CMD_SWITCH("legacy_ec_point_formats", 0),
     SSL_CONF_CMD_STRING(SignatureAlgorithms, "sigalgs", 0),
     SSL_CONF_CMD_STRING(ClientSignatureAlgorithms, "client_sigalgs", 0),
     SSL_CONF_CMD_STRING(Curves, "curves", 0),
@@ -854,7 +861,7 @@ static const ssl_switch_tbl ssl_cmd_switches[] = {
     { SSL_OP_NO_RX_CERTIFICATE_COMPRESSION, SSL_TFLAG_INV }, /* rx_cert_comp */
     { SSL_OP_SINGLE_ECDH_USE, 0 }, /* ecdh_single */
     { SSL_OP_NO_TICKET, 0 }, /* no_ticket */
-    { SSL_OP_CIPHER_SERVER_PREFERENCE, 0 }, /* serverpref */
+    { SSL_OP_SERVER_PREFERENCE, 0 }, /* serverpref */
     /* legacy_renegotiation */
     { SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION, 0 },
     /* Allow client renegotiation */
@@ -884,6 +891,8 @@ static const ssl_switch_tbl ssl_cmd_switches[] = {
     { SSL_OP_NO_ENCRYPT_THEN_MAC, 0 },
     /* no Extended master secret */
     { SSL_OP_NO_EXTENDED_MASTER_SECRET, 0 },
+    /* enable legacy EC point formats */
+    { SSL_OP_LEGACY_EC_POINT_FORMATS, 0 }
 };

 static int ssl_conf_cmd_skip_prefix(SSL_CONF_CTX *cctx, const char **pcmd)
@@ -1119,6 +1128,14 @@ void SSL_CONF_CTX_free(SSL_CONF_CTX *cctx)

 unsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags)
 {
+    if ((cctx->flags & SSL_CONF_FLAG_CMDLINE)
+        && (flags & SSL_CONF_FLAG_FILE))
+        flags &= ~SSL_CONF_FLAG_FILE;
+
+    if ((cctx->flags & SSL_CONF_FLAG_FILE)
+        && (flags & SSL_CONF_FLAG_CMDLINE))
+        flags &= ~SSL_CONF_FLAG_CMDLINE;
+
     cctx->flags |= flags;
     return cctx->flags;
 }
diff --git a/deps/openssl/openssl/ssl/ssl_init.c b/deps/openssl/openssl/ssl/ssl_init.c
index 1e92658b7a4..5b31b0a2df6 100644
--- a/deps/openssl/openssl/ssl/ssl_init.c
+++ b/deps/openssl/openssl/ssl/ssl_init.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,12 +15,10 @@
 #include <openssl/trace.h>
 #include "ssl_local.h"
 #include "internal/thread_once.h"
-#include "internal/rio_notifier.h" /* for ossl_wsa_cleanup() */

 static int stopped;

 static CRYPTO_ONCE ssl_base = CRYPTO_ONCE_STATIC_INIT;
-static int ssl_base_inited = 0;
 DEFINE_RUN_ONCE_STATIC(ossl_init_ssl_base)
 {
 #ifndef OPENSSL_NO_COMP
@@ -34,7 +32,6 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_ssl_base)
 #endif
     ssl_sort_cipher_list();
     OSSL_TRACE(INIT, "ossl_init_ssl_base: SSL_add_ssl_module()\n");
-    ssl_base_inited = 1;
     return 1;
 }

diff --git a/deps/openssl/openssl/ssl/ssl_lib.c b/deps/openssl/openssl/ssl/ssl_lib.c
index b1b36c80a82..d7510c73f29 100644
--- a/deps/openssl/openssl/ssl/ssl_lib.c
+++ b/deps/openssl/openssl/ssl/ssl_lib.c
@@ -13,13 +13,14 @@
 #include "internal/e_winsock.h"
 #include "ssl_local.h"

+#include <openssl/err.h>
 #include <openssl/objects.h>
 #include <openssl/x509v3.h>
 #include <openssl/rand.h>
 #include <openssl/ocsp.h>
 #include <openssl/dh.h>
-#include <openssl/engine.h>
 #include <openssl/async.h>
+#include <openssl/kdf.h>
 #include <openssl/ct.h>
 #include <openssl/trace.h>
 #include <openssl/core_names.h>
@@ -120,8 +121,8 @@ static int dane_ctx_enable(struct dane_ctx_st *dctx)
     if (dctx->mdevp != NULL)
         return 1;

-    mdevp = OPENSSL_zalloc(n * sizeof(*mdevp));
-    mdord = OPENSSL_zalloc(n * sizeof(*mdord));
+    mdevp = OPENSSL_calloc(n, sizeof(*mdevp));
+    mdord = OPENSSL_calloc(n, sizeof(*mdord));

     if (mdord == NULL || mdevp == NULL) {
         OPENSSL_free(mdord);
@@ -228,12 +229,12 @@ static int dane_mtype_set(struct dane_ctx_st *dctx,
         uint8_t *mdord;
         int n = ((int)mtype) + 1;

-        mdevp = OPENSSL_realloc(dctx->mdevp, n * sizeof(*mdevp));
+        mdevp = OPENSSL_realloc_array(dctx->mdevp, n, sizeof(*mdevp));
         if (mdevp == NULL)
             return -1;
         dctx->mdevp = mdevp;

-        mdord = OPENSSL_realloc(dctx->mdord, n * sizeof(*mdord));
+        mdord = OPENSSL_realloc_array(dctx->mdord, n, sizeof(*mdord));
         if (mdord == NULL)
             return -1;
         dctx->mdord = mdord;
@@ -470,7 +471,11 @@ static int ssl_check_allowed_versions(int min_version, int max_version)
             /* Ignore DTLS1_BAD_VER */
             min_version = DTLS1_VERSION;
         if (max_version == 0)
+            max_version = DTLS1_3_VERSION;
+#ifdef OPENSSL_NO_DTLS1_3
+        if (max_version == DTLS1_3_VERSION)
             max_version = DTLS1_2_VERSION;
+#endif
 #ifdef OPENSSL_NO_DTLS1_2
         if (max_version == DTLS1_2_VERSION)
             max_version = DTLS1_VERSION;
@@ -488,13 +493,17 @@ static int ssl_check_allowed_versions(int min_version, int max_version)
 #ifdef OPENSSL_NO_DTLS1_2
             || (DTLS_VERSION_GE(min_version, DTLS1_2_VERSION)
                 && DTLS_VERSION_GE(DTLS1_2_VERSION, max_version))
+#endif
+#ifdef OPENSSL_NO_DTLS1_3
+            || (DTLS_VERSION_GE(min_version, DTLS1_3_VERSION)
+                && DTLS_VERSION_GE(DTLS1_3_VERSION, max_version))
 #endif
         )
             return 0;
     } else {
         /* Regular TLS version checks. */
         if (min_version == 0)
-            min_version = SSL3_VERSION;
+            min_version = TLS1_VERSION;
         if (max_version == 0)
             max_version = TLS1_3_VERSION;
 #ifdef OPENSSL_NO_TLS1_3
@@ -509,14 +518,6 @@ static int ssl_check_allowed_versions(int min_version, int max_version)
         if (max_version == TLS1_1_VERSION)
             max_version = TLS1_VERSION;
 #endif
-#ifdef OPENSSL_NO_TLS1
-        if (max_version == TLS1_VERSION)
-            max_version = SSL3_VERSION;
-#endif
-#ifdef OPENSSL_NO_SSL3
-        if (min_version == SSL3_VERSION)
-            min_version = TLS1_VERSION;
-#endif
 #ifdef OPENSSL_NO_TLS1
         if (min_version == TLS1_VERSION)
             min_version = TLS1_1_VERSION;
@@ -531,9 +532,6 @@ static int ssl_check_allowed_versions(int min_version, int max_version)
 #endif
         /* Done massaging versions; do the check. */
         if (0
-#ifdef OPENSSL_NO_SSL3
-            || (min_version <= SSL3_VERSION && SSL3_VERSION <= max_version)
-#endif
 #ifdef OPENSSL_NO_TLS1
             || (min_version <= TLS1_VERSION && TLS1_VERSION <= max_version)
 #endif
@@ -591,11 +589,17 @@ int ossl_ssl_connection_reset(SSL *s)
     sc->psksession_id = NULL;
     sc->psksession_id_len = 0;
     sc->hello_retry_request = SSL_HRR_NONE;
+    sc->dtls13_process_hello = 0;
     sc->sent_tickets = 0;

     sc->error = 0;
     sc->hit = 0;
     sc->shutdown = 0;
+    sc->ext.early_data_suppressed = 0;
+    SSL_SESSION_free(sc->ext.early_data_session);
+    sc->ext.early_data_session = NULL;
+    sc->ext.tick_age_checked = 0;
+    sc->ext.tick_age_ms = 0;

     if (sc->renegotiate) {
         ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
@@ -640,10 +644,72 @@ int ossl_ssl_connection_reset(SSL *s)
      * back.
      */
     if (s->method != s->defltmeth) {
+        /*
+         * For DTLS listener-created connections, we need to preserve the
+         * peer_addr, rx (DTLS_RX), listener, and created_at across method changes.
+         * These are set during connection creation and must survive SSL_clear().
+         * The ssl_deinit/ssl_init sequence would otherwise free the old d1
+         * structure and allocate a new one, losing these values.
+         */
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+        BIO_ADDR saved_peer_addr = { 0 };
+        DTLS_RX *saved_rx = NULL;
+        SSL *saved_listener = NULL;
+        OSSL_TIME saved_created_at = ossl_time_zero();
+        unsigned int saved_req_blocking_mode = DTLS_BLOCKING_MODE_INHERIT;
+        int is_dtls_listener_conn = 0;
+
+        if (SSL_CONNECTION_IS_DTLS(sc) && sc->d1 != NULL
+            && sc->d1->listener != NULL) {
+            is_dtls_listener_conn = 1;
+            saved_peer_addr = sc->d1->peer_addr;
+            saved_rx = sc->d1->rx;
+            saved_listener = sc->d1->listener;
+            saved_created_at = sc->d1->created_at;
+            saved_req_blocking_mode = sc->d1->req_blocking_mode;
+            /*
+             * Prevent dtls1_free from freeing rx and releasing the listener
+             * reference - we'll restore them after ssl_init.
+             */
+            sc->d1->rx = NULL;
+            sc->d1->listener = NULL;
+        }
+#endif
+
         s->method->ssl_deinit(s);
         s->method = s->defltmeth;
-        if (!s->method->ssl_init(s))
+        if (!s->method->ssl_init(s)) {
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+            if (is_dtls_listener_conn) {
+                DTLS_LISTENER *dl = (DTLS_LISTENER *)saved_listener;
+
+                /* The detached connection cannot unregister itself on free. */
+                ossl_dtls_listener_unregister_established_conn(saved_listener,
+                    &saved_peer_addr);
+                ossl_crypto_mutex_lock(dl->mutex);
+                sc->listener_rx = NULL;
+                ossl_crypto_mutex_unlock(dl->mutex);
+                ossl_dtls_rx_free(saved_rx);
+                SSL_free(saved_listener);
+            }
+#endif
             return 0;
+        }
+
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+        /* Restore DTLS listener connection state */
+        if (is_dtls_listener_conn && sc->d1 != NULL) {
+            sc->d1->peer_addr = saved_peer_addr;
+            sc->d1->rx = saved_rx;
+            sc->d1->listener = saved_listener;
+            sc->d1->created_at = saved_created_at;
+            /*
+             * The blocking mode is how the application configured this
+             * connection, not handshake state, so it survives a clear.
+             */
+            sc->d1->req_blocking_mode = saved_req_blocking_mode;
+        }
+#endif
     } else {
         if (!s->method->ssl_clear(s))
             return 0;
@@ -823,20 +889,12 @@ SSL *ossl_ssl_connection_new_int(SSL_CTX *ctx, SSL *user_ssl,
     s->ext.ocsp.exts = NULL;
     s->ext.ocsp.resp = NULL;
     s->ext.ocsp.resp_len = 0;
+    s->ext.ocsp.resp_ex = NULL;

     if (!SSL_CTX_up_ref(ctx))
         goto err;

     s->session_ctx = ctx;
-    if (ctx->ext.ecpointformats != NULL) {
-        s->ext.ecpointformats = OPENSSL_memdup(ctx->ext.ecpointformats,
-            ctx->ext.ecpointformats_len);
-        if (s->ext.ecpointformats == NULL) {
-            s->ext.ecpointformats_len = 0;
-            goto err;
-        }
-        s->ext.ecpointformats_len = ctx->ext.ecpointformats_len;
-    }
     if (ctx->ext.supportedgroups != NULL) {
         size_t add = 0;

@@ -954,7 +1012,13 @@ SSL *ossl_ssl_connection_new_int(SSL_CTX *ctx, SSL *user_ssl,
         goto sslerr;
 #endif

+#ifndef OPENSSL_NO_ECH
+    if (!ossl_ech_conn_init(s, ctx, method))
+        goto sslerr;
+#endif
+
     s->ssl_pkey_num = SSL_PKEY_NUM + ctx->sigalg_list_len;
+    s->dtls13_process_hello = 0;
     return ssl;
 cerr:
     ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
@@ -978,11 +1042,20 @@ int SSL_is_dtls(const SSL *s)
 {
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);

+    if (s == NULL)
+        return 0;
+
 #ifndef OPENSSL_NO_QUIC
     if (s->type == SSL_TYPE_QUIC_CONNECTION || s->type == SSL_TYPE_QUIC_XSO)
         return 0;
 #endif

+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    /* DTLS listener is always DTLS */
+    if (IS_DTLS_LISTENER(s))
+        return 1;
+#endif
+
     if (sc == NULL)
         return 0;

@@ -1014,11 +1087,18 @@ int SSL_CTX_is_quic(const SSL_CTX *c)
     return IS_QUIC_CTX(c);
 }

+int SSL_CTX_is_server(const SSL_CTX *c)
+{
+    if (c == NULL || c->method == NULL)
+        return 0;
+    return (c->method->ssl_accept == ssl_undefined_function) ? 0 : 1;
+}
+
 int SSL_up_ref(SSL *s)
 {
     int i;

-    if (CRYPTO_UP_REF(&s->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&s->references, &i))
         return 0;

     REF_PRINT_COUNT("SSL", i, s);
@@ -1134,6 +1214,47 @@ int SSL_set_trust(SSL *s, int trust)
     return X509_VERIFY_PARAM_set_trust(sc->param, trust);
 }

+int SSL_set1_dnsname(SSL *s, const char *host)
+{
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
+
+    if (sc == NULL)
+        return 0;
+
+    return X509_VERIFY_PARAM_set1_host(sc->param, host, 0);
+}
+
+int SSL_add1_dnsname(SSL *s, const char *host)
+{
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
+
+    if (sc == NULL)
+        return 0;
+
+    return X509_VERIFY_PARAM_add1_host(sc->param, host, strlen(host));
+}
+
+int SSL_set1_ipaddr(SSL *s, const char *ipaddr)
+{
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
+
+    if (sc == NULL)
+        return 0;
+
+    return X509_VERIFY_PARAM_set1_ip_asc(sc->param, ipaddr);
+}
+
+int SSL_add1_ipaddr(SSL *s, const char *ipaddr)
+{
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
+
+    if (sc == NULL)
+        return 0;
+
+    return X509_VERIFY_PARAM_add1_ip_asc(sc->param, ipaddr);
+}
+
+#if !defined(OPENSSL_NO_DEPRECATED_4_0)
 int SSL_set1_host(SSL *s, const char *host)
 {
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
@@ -1184,6 +1305,7 @@ int SSL_add1_host(SSL *s, const char *host)

     return X509_VERIFY_PARAM_add1_host(sc->param, host, 0);
 }
+#endif /* !defined(OPENSSL_NO_DEPRECATED_4_0) */

 void SSL_set_hostflags(SSL *s, unsigned int flags)
 {
@@ -1446,8 +1568,18 @@ void ossl_ssl_connection_free(SSL *ssl)
     SSL_CONNECTION *s;

     s = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
-    if (s == NULL)
+    if (s == NULL) {
+        /*
+         * This is not an SSL_CONNECTION (e.g., DTLS listener).
+         * Still need to call ssl_deinit which handles type-specific cleanup.
+         */
+        if (ssl != NULL && ssl->method != NULL)
+            ssl->method->ssl_deinit(ssl);
         return;
+    }
+
+    if (s->d1 != NULL && s->rlayer.wrl != NULL)
+        dtls1_clear_current_wrl_from_sent_buffer(s);

     /*
      * Ignore return values. This could result in user callbacks being called
@@ -1474,6 +1606,7 @@ void ossl_ssl_connection_free(SSL *ssl)
         SSL_SESSION_free(s->session);
     }
     SSL_SESSION_free(s->psksession);
+    SSL_SESSION_free(s->ext.early_data_session);
     OPENSSL_free(s->psksession_id);

     ssl_cert_free(s->cert);
@@ -1482,21 +1615,26 @@ void ossl_ssl_connection_free(SSL *ssl)

     OPENSSL_free(s->ext.hostname);
     SSL_CTX_free(s->session_ctx);
-    OPENSSL_free(s->ext.ecpointformats);
     OPENSSL_free(s->ext.peer_ecpointformats);
     OPENSSL_free(s->ext.supportedgroups);
     OPENSSL_free(s->ext.keyshares);
     OPENSSL_free(s->ext.tuples);
     OPENSSL_free(s->ext.peer_supportedgroups);
     sk_X509_EXTENSION_pop_free(s->ext.ocsp.exts, X509_EXTENSION_free);
+
 #ifndef OPENSSL_NO_OCSP
+    OPENSSL_free(s->ext.ocsp.resp);
+    s->ext.ocsp.resp = NULL;
+    s->ext.ocsp.resp_len = 0;
+
     sk_OCSP_RESPID_pop_free(s->ext.ocsp.ids, OCSP_RESPID_free);
+    sk_OCSP_RESPONSE_pop_free(s->ext.ocsp.resp_ex, OCSP_RESPONSE_free);
+    s->ext.ocsp.resp_ex = NULL;
 #endif
 #ifndef OPENSSL_NO_CT
     SCT_LIST_free(s->scts);
     OPENSSL_free(s->ext.scts);
 #endif
-    OPENSSL_free(s->ext.ocsp.resp);
     OPENSSL_free(s->ext.alpn);
     OPENSSL_free(s->ext.tls13_cookie);
     if (s->clienthello != NULL)
@@ -1537,6 +1675,9 @@ void ossl_ssl_connection_free(SSL *ssl)
     BIO_free_all(s->rbio);
     s->rbio = NULL;
     OPENSSL_free(s->s3.tmp.valid_flags);
+#ifndef OPENSSL_NO_ECH
+    ossl_ech_conn_clear(&s->ext.ech);
+#endif
 }

 void SSL_set0_rbio(SSL *s, BIO *rbio)
@@ -1550,6 +1691,13 @@ void SSL_set0_rbio(SSL *s, BIO *rbio)
     }
 #endif

+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    if (IS_DTLS_LISTENER(s)) {
+        ossl_dtls_listener_set0_net_rbio(s, rbio);
+        return;
+    }
+#endif
+
     if (sc == NULL)
         return;

@@ -1569,6 +1717,13 @@ void SSL_set0_wbio(SSL *s, BIO *wbio)
     }
 #endif

+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    if (IS_DTLS_LISTENER(s)) {
+        ossl_dtls_listener_set0_net_wbio(s, wbio);
+        return;
+    }
+#endif
+
     if (sc == NULL)
         return;

@@ -1639,6 +1794,11 @@ BIO *SSL_get_rbio(const SSL *s)
         return ossl_quic_conn_get_net_rbio(s);
 #endif

+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    if (IS_DTLS_LISTENER(s))
+        return ossl_dtls_listener_get_net_rbio(s);
+#endif
+
     if (sc == NULL)
         return NULL;

@@ -1654,6 +1814,11 @@ BIO *SSL_get_wbio(const SSL *s)
         return ossl_quic_conn_get_net_wbio(s);
 #endif

+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    if (IS_DTLS_LISTENER(s))
+        return ossl_dtls_listener_get_net_wbio(s);
+#endif
+
     if (sc == NULL)
         return NULL;

@@ -1953,17 +2118,9 @@ int SSL_has_pending(const SSL *s)
     sc = SSL_CONNECTION_FROM_CONST_SSL(s);

     /* Check buffered app data if any first */
-    if (SSL_CONNECTION_IS_DTLS(sc)) {
-        TLS_RECORD *rdata;
-        pitem *item, *iter;
-
-        iter = pqueue_iterator(sc->rlayer.d->buffered_app_data);
-        while ((item = pqueue_next(&iter)) != NULL) {
-            rdata = item->data;
-            if (rdata->length > 0)
-                return 1;
-        }
-    }
+    if (SSL_CONNECTION_IS_DTLS(sc)
+        && DTLS_RECORD_LAYER_buffered_app_data_pending(&sc->rlayer))
+        return 1;

     if (RECORD_LAYER_processed_read_pending(&sc->rlayer))
         return 1;
@@ -2044,7 +2201,9 @@ int SSL_copy_session_id(SSL *t, const SSL *f)
             return 0;
     }

-    CRYPTO_UP_REF(&fsc->cert->references, &i);
+    if (!CRYPTO_UP_REF(&fsc->cert->references, &i))
+        return 0;
+
     ssl_cert_free(tsc->cert);
     tsc->cert = fsc->cert;
     if (!SSL_set_session_id_context(t, fsc->sid_ctx, (int)fsc->sid_ctx_length)) {
@@ -2178,13 +2337,60 @@ int SSL_get_async_status(SSL *s, int *status)
     return 1;
 }

+/*
+ * Reset the statem error_state to ERROR_STATE_NOERROR to avoid the
+ * error sticking.
+ * Designed to be called at the beginning of any function that
+ * is expected to be followed by a call to SSL_get_error().
+ * It returns 0 if the state machine is in the MSG_FLOW_ERROR state,
+ * in this case the calling function can and should return immediately.
+ */
+static int ssl_reset_error_state(SSL_CONNECTION *sc)
+{
+    if (sc == NULL)
+        return 1;
+
+    if (sc->statem.state == MSG_FLOW_ERROR) {
+        sc->statem.error_state = ERROR_STATE_SSL;
+        return 0;
+    }
+
+    sc->statem.error_state = ERROR_STATE_NOERROR;
+    return 1;
+}
+
+/*
+ * Check if the connection failed into the MSG_FLOW_ERROR state during
+ * the operation, if so, check the error stack and set the error_state
+ * correspondently.
+ * Designed to be called at the end of any function that
+ * is expected to be followed by a call to SSL_get_error().
+ */
+static void ssl_update_error_state(SSL_CONNECTION *sc)
+{
+    unsigned long l;
+
+    if (sc == NULL)
+        return;
+
+    if (sc->statem.state == MSG_FLOW_ERROR
+        && sc->statem.error_state == ERROR_STATE_NOERROR) {
+        l = ERR_peek_error();
+        if (l == 0 || ERR_GET_LIB(l) == ERR_LIB_SYS)
+            sc->statem.error_state = ERROR_STATE_SYSCALL;
+        else
+            sc->statem.error_state = ERROR_STATE_SSL;
+    }
+}
+
 int SSL_accept(SSL *s)
 {
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);

 #ifndef OPENSSL_NO_QUIC
-    if (IS_QUIC(s))
+    if (IS_QUIC(s)) {
         return s->method->ssl_accept(s);
+    }
 #endif

     if (sc == NULL)
@@ -2203,8 +2409,9 @@ int SSL_connect(SSL *s)
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);

 #ifndef OPENSSL_NO_QUIC
-    if (IS_QUIC(s))
+    if (IS_QUIC(s)) {
         return s->method->ssl_connect(s);
+    }
 #endif

     if (sc == NULL)
@@ -2258,6 +2465,7 @@ static int ssl_start_async_job(SSL *s, struct ssl_async_args *args,
     case ASYNC_ERR:
         sc->rwstate = SSL_NOTHING;
         ERR_raise(ERR_LIB_SSL, SSL_R_FAILED_TO_INIT_ASYNC);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     case ASYNC_PAUSE:
         sc->rwstate = SSL_ASYNC_PAUSED;
@@ -2271,6 +2479,7 @@ static int ssl_start_async_job(SSL *s, struct ssl_async_args *args,
     default:
         sc->rwstate = SSL_NOTHING;
         ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
+        sc->statem.error_state = ERROR_STATE_SSL;
         /* Shouldn't happen */
         return -1;
     }
@@ -2304,6 +2513,7 @@ static int ssl_io_intern(void *vargs)

 int ssl_read_internal(SSL *s, void *buf, size_t num, size_t *readbytes)
 {
+    int ret;
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);

 #ifndef OPENSSL_NO_QUIC
@@ -2314,8 +2524,12 @@ int ssl_read_internal(SSL *s, void *buf, size_t num, size_t *readbytes)
     if (sc == NULL)
         return -1;

+    if (ssl_reset_error_state(sc) == 0)
+        return -1;
+
     if (sc->handshake_func == NULL) {
         ERR_raise(ERR_LIB_SSL, SSL_R_UNINITIALIZED);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     }

@@ -2327,6 +2541,7 @@ int ssl_read_internal(SSL *s, void *buf, size_t num, size_t *readbytes)
     if (sc->early_data_state == SSL_EARLY_DATA_CONNECT_RETRY
         || sc->early_data_state == SSL_EARLY_DATA_ACCEPT_RETRY) {
         ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return 0;
     }
     /*
@@ -2338,7 +2553,6 @@ int ssl_read_internal(SSL *s, void *buf, size_t num, size_t *readbytes)

     if ((sc->mode & SSL_MODE_ASYNC) && ASYNC_get_current_job() == NULL) {
         struct ssl_async_args args;
-        int ret;

         args.s = s;
         args.buf = buf;
@@ -2348,9 +2562,12 @@ int ssl_read_internal(SSL *s, void *buf, size_t num, size_t *readbytes)

         ret = ssl_start_async_job(s, &args, ssl_io_intern);
         *readbytes = sc->asyncrw;
+        ssl_update_error_state(sc);
         return ret;
     } else {
-        return s->method->ssl_read(s, buf, num, readbytes);
+        ret = s->method->ssl_read(s, buf, num, readbytes);
+        ssl_update_error_state(sc);
+        return ret;
     }
 }

@@ -2358,9 +2575,12 @@ int SSL_read(SSL *s, void *buf, int num)
 {
     int ret;
     size_t readbytes;
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);

     if (num < 0) {
         ERR_raise(ERR_LIB_SSL, SSL_R_BAD_LENGTH);
+        if (sc != NULL)
+            sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     }

@@ -2378,10 +2598,12 @@ int SSL_read(SSL *s, void *buf, int num)

 int SSL_read_ex(SSL *s, void *buf, size_t num, size_t *readbytes)
 {
-    int ret = ssl_read_internal(s, buf, num, readbytes);
+    int ret;

+    ret = ssl_read_internal(s, buf, num, readbytes);
     if (ret < 0)
         ret = 0;
+
     return ret;
 }

@@ -2391,15 +2613,25 @@ int SSL_read_early_data(SSL *s, void *buf, size_t num, size_t *readbytes)
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);

     /* TODO(QUIC 0RTT): 0-RTT support */
-    if (sc == NULL || !sc->server) {
+    if (sc == NULL) {
         ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
         return SSL_READ_EARLY_DATA_ERROR;
     }

+    if (ssl_reset_error_state(sc) == 0)
+        return 0;
+
+    if (!sc->server) {
+        ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        sc->statem.error_state = ERROR_STATE_SSL;
+        return SSL_READ_EARLY_DATA_ERROR;
+    }
+
     switch (sc->early_data_state) {
     case SSL_EARLY_DATA_NONE:
         if (!SSL_in_before(s)) {
             ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+            sc->statem.error_state = ERROR_STATE_SSL;
             return SSL_READ_EARLY_DATA_ERROR;
         }
         /* fall through */
@@ -2436,6 +2668,7 @@ int SSL_read_early_data(SSL *s, void *buf, size_t num, size_t *readbytes)

     default:
         ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return SSL_READ_EARLY_DATA_ERROR;
     }
 }
@@ -2453,6 +2686,7 @@ int SSL_get_early_data_status(const SSL *s)

 static int ssl_peek_internal(SSL *s, void *buf, size_t num, size_t *readbytes)
 {
+    int ret;
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);

 #ifndef OPENSSL_NO_QUIC
@@ -2463,8 +2697,12 @@ static int ssl_peek_internal(SSL *s, void *buf, size_t num, size_t *readbytes)
     if (sc == NULL)
         return 0;

+    if (ssl_reset_error_state(sc) == 0)
+        return -1;
+
     if (sc->handshake_func == NULL) {
         ERR_raise(ERR_LIB_SSL, SSL_R_UNINITIALIZED);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     }

@@ -2473,7 +2711,6 @@ static int ssl_peek_internal(SSL *s, void *buf, size_t num, size_t *readbytes)
     }
     if ((sc->mode & SSL_MODE_ASYNC) && ASYNC_get_current_job() == NULL) {
         struct ssl_async_args args;
-        int ret;

         args.s = s;
         args.buf = buf;
@@ -2483,9 +2720,12 @@ static int ssl_peek_internal(SSL *s, void *buf, size_t num, size_t *readbytes)

         ret = ssl_start_async_job(s, &args, ssl_io_intern);
         *readbytes = sc->asyncrw;
+        ssl_update_error_state(sc);
         return ret;
     } else {
-        return s->method->ssl_peek(s, buf, num, readbytes);
+        ret = s->method->ssl_peek(s, buf, num, readbytes);
+        ssl_update_error_state(sc);
+        return ret;
     }
 }

@@ -2493,9 +2733,12 @@ int SSL_peek(SSL *s, void *buf, int num)
 {
     int ret;
     size_t readbytes;
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);

     if (num < 0) {
         ERR_raise(ERR_LIB_SSL, SSL_R_BAD_LENGTH);
+        if (sc != NULL)
+            sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     }

@@ -2513,16 +2756,19 @@ int SSL_peek(SSL *s, void *buf, int num)

 int SSL_peek_ex(SSL *s, void *buf, size_t num, size_t *readbytes)
 {
-    int ret = ssl_peek_internal(s, buf, num, readbytes);
+    int ret;

+    ret = ssl_peek_internal(s, buf, num, readbytes);
     if (ret < 0)
         ret = 0;
+
     return ret;
 }

 int ssl_write_internal(SSL *s, const void *buf, size_t num,
     uint64_t flags, size_t *written)
 {
+    int ret;
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);

 #ifndef OPENSSL_NO_QUIC
@@ -2533,19 +2779,25 @@ int ssl_write_internal(SSL *s, const void *buf, size_t num,
     if (sc == NULL)
         return 0;

+    if (ssl_reset_error_state(sc) == 0)
+        return -1;
+
     if (sc->handshake_func == NULL) {
         ERR_raise(ERR_LIB_SSL, SSL_R_UNINITIALIZED);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     }

     if (sc->shutdown & SSL_SENT_SHUTDOWN) {
         sc->rwstate = SSL_NOTHING;
         ERR_raise(ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     }

     if (flags != 0) {
         ERR_raise(ERR_LIB_SSL, SSL_R_UNSUPPORTED_WRITE_FLAG);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     }

@@ -2553,6 +2805,7 @@ int ssl_write_internal(SSL *s, const void *buf, size_t num,
         || sc->early_data_state == SSL_EARLY_DATA_ACCEPT_RETRY
         || sc->early_data_state == SSL_EARLY_DATA_READ_RETRY) {
         ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return 0;
     }
     /* If we are a client and haven't sent the Finished we better do that */
@@ -2560,7 +2813,6 @@ int ssl_write_internal(SSL *s, const void *buf, size_t num,
         return -1;

     if ((sc->mode & SSL_MODE_ASYNC) && ASYNC_get_current_job() == NULL) {
-        int ret;
         struct ssl_async_args args;

         args.s = s;
@@ -2571,39 +2823,52 @@ int ssl_write_internal(SSL *s, const void *buf, size_t num,

         ret = ssl_start_async_job(s, &args, ssl_io_intern);
         *written = sc->asyncrw;
+        ssl_update_error_state(sc);
         return ret;
     } else {
-        return s->method->ssl_write(s, buf, num, written);
+        ret = s->method->ssl_write(s, buf, num, written);
+        ssl_update_error_state(sc);
+        return ret;
     }
 }

 ossl_ssize_t SSL_sendfile(SSL *s, int fd, off_t offset, size_t size, int flags)
 {
-    ossl_ssize_t ret;
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
+#ifndef OPENSSL_NO_KTLS
+    ossl_ssize_t sbytes;
+#endif
+    int ret;

     if (sc == NULL)
         return 0;

+    if (ssl_reset_error_state(sc) == 0)
+        return -1;
+
     if (sc->handshake_func == NULL) {
         ERR_raise(ERR_LIB_SSL, SSL_R_UNINITIALIZED);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     }

     if (sc->shutdown & SSL_SENT_SHUTDOWN) {
         sc->rwstate = SSL_NOTHING;
         ERR_raise(ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     }

     if (!BIO_get_ktls_send(sc->wbio)) {
         ERR_raise(ERR_LIB_SSL, SSL_R_UNINITIALIZED);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     }

     /* If we have an alert to send, lets send it */
-    if (sc->s3.alert_dispatch > 0) {
+    if (sc->s3.alert_dispatch != SSL_ALERT_DISPATCH_NONE) {
         ret = (ossl_ssize_t)s->method->ssl_dispatch_alert(s);
+        ssl_update_error_state(sc);
         if (ret <= 0) {
             /* SSLfatal() already called if appropriate */
             return ret;
@@ -2626,21 +2891,25 @@ ossl_ssize_t SSL_sendfile(SSL *s, int fd, off_t offset, size_t size, int flags)
 #ifdef OPENSSL_NO_KTLS
     ERR_raise_data(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR,
         "can't call ktls_sendfile(), ktls disabled");
+    sc->statem.error_state = ERROR_STATE_SSL;
     return -1;
 #else
-    ret = ktls_sendfile(SSL_get_wfd(s), fd, offset, size, flags);
+    ret = ktls_sendfile(SSL_get_wfd(s), fd, offset, size, &sbytes, flags);
+    ssl_update_error_state(sc);
+    BIO_clear_retry_flags(sc->wbio);
     if (ret < 0) {
-#if defined(EAGAIN) && defined(EINTR) && defined(EBUSY)
-        if ((get_last_sys_error() == EAGAIN) || (get_last_sys_error() == EINTR) || (get_last_sys_error() == EBUSY))
+        if (BIO_sock_should_retry(ret)) {
             BIO_set_retry_write(sc->wbio);
-        else
-#endif
+            return (sbytes > 0 ? sbytes : ret);
+        } else {
             ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
                 "ktls_sendfile failure");
+            sc->statem.error_state = ERROR_STATE_SYSCALL;
+        }
         return ret;
     }
     sc->rwstate = SSL_NOTHING;
-    return ret;
+    return sbytes;
 #endif
 }

@@ -2648,9 +2917,12 @@ int SSL_write(SSL *s, const void *buf, int num)
 {
     int ret;
     size_t written;
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);

     if (num < 0) {
         ERR_raise(ERR_LIB_SSL, SSL_R_BAD_LENGTH);
+        if (sc != NULL)
+            sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     }

@@ -2674,10 +2946,12 @@ int SSL_write_ex(SSL *s, const void *buf, size_t num, size_t *written)
 int SSL_write_ex2(SSL *s, const void *buf, size_t num, uint64_t flags,
     size_t *written)
 {
-    int ret = ssl_write_internal(s, buf, num, flags, written);
+    int ret;

+    ret = ssl_write_internal(s, buf, num, flags, written);
     if (ret < 0)
         ret = 0;
+
     return ret;
 }

@@ -2692,13 +2966,43 @@ int SSL_write_early_data(SSL *s, const void *buf, size_t num, size_t *written)
     if (sc == NULL)
         return 0;

+    if (ssl_reset_error_state(sc) == 0)
+        return 0;
+
     switch (sc->early_data_state) {
     case SSL_EARLY_DATA_NONE:
+        /*
+         * tls_construct_ctos_early_data() decided not to advertise the
+         * early_data extension.
+         *
+         * Succeed and report num bytes as written so the handshake can
+         * continue without 0-RTT; early data rejection can be detected via
+         * SSL_get_early_data_status().
+         */
+        if (!sc->server && sc->ext.early_data_suppressed && !SSL_in_before(s)) {
+            /*
+             * 0-RTT was suppressed. Complete the handshake behind the scenes
+             * and report success so the application's early data write loop
+             * finishes. Run the internal SSL_connect() in the CONNECTING state,
+             * as the non-suppressed path does, so ossl_statem_check_finish_init()
+             * does not mistake it for the application leaving the early data
+             * write sequence.
+             */
+            sc->early_data_state = SSL_EARLY_DATA_CONNECTING;
+            ret = SSL_connect(s);
+            sc->early_data_state = SSL_EARLY_DATA_NONE;
+            if (ret <= 0)
+                return 0;
+            *written = num;
+            return 1;
+        }
+
         if (sc->server
             || !SSL_in_before(s)
             || ((sc->session == NULL || sc->session->ext.max_early_data == 0)
                 && (sc->psk_use_session_cb == NULL))) {
             ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+            sc->statem.error_state = ERROR_STATE_SSL;
             return 0;
         }
         /* fall through */
@@ -2707,10 +3011,25 @@ int SSL_write_early_data(SSL *s, const void *buf, size_t num, size_t *written)
         sc->early_data_state = SSL_EARLY_DATA_CONNECTING;
         ret = SSL_connect(s);
         if (ret <= 0) {
-            /* NBIO or error */
-            sc->early_data_state = SSL_EARLY_DATA_CONNECT_RETRY;
+            /*
+             * NBIO or error. Normally we stamp the state back to
+             * SSL_EARLY_DATA_CONNECT_RETRY so the next SSL_write_early_data()
+             * call resumes here. However tls_construct_ctos_early_data() may
+             * have reset early_data_state to SSL_EARLY_DATA_NONE because it
+             * decided not to send the early_data extension.
+             *
+             * In that case leave the state alone so the handshake can complete
+             * normally without 0-RTT.
+             */
+            if (!sc->ext.early_data_suppressed)
+                sc->early_data_state = SSL_EARLY_DATA_CONNECT_RETRY;
             return 0;
         }
+        if (sc->early_data_state == SSL_EARLY_DATA_NONE
+            && sc->ext.early_data_suppressed) {
+            *written = num;
+            return 1;
+        }
         /* fall through */

     case SSL_EARLY_DATA_WRITE_RETRY:
@@ -2753,6 +3072,7 @@ int SSL_write_early_data(SSL *s, const void *buf, size_t num, size_t *written)

     default:
         ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return 0;
     }
 }
@@ -2766,6 +3086,10 @@ int SSL_shutdown(SSL *s)
      * (see ssl3_shutdown).
      */
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
+    int ret;
+
+    if (ssl_reset_error_state(sc) == 0)
+        return -1;

 #ifndef OPENSSL_NO_QUIC
     if (IS_QUIC(s))
@@ -2777,6 +3101,7 @@ int SSL_shutdown(SSL *s)

     if (sc->handshake_func == NULL) {
         ERR_raise(ERR_LIB_SSL, SSL_R_UNINITIALIZED);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     }

@@ -2789,14 +3114,18 @@ int SSL_shutdown(SSL *s)
             args.type = OTHERFUNC;
             args.f.func_other = s->method->ssl_shutdown;

-            return ssl_start_async_job(s, &args, ssl_io_intern);
+            ret = ssl_start_async_job(s, &args, ssl_io_intern);
         } else {
-            return s->method->ssl_shutdown(s);
+            ret = s->method->ssl_shutdown(s);
         }
     } else {
         ERR_raise(ERR_LIB_SSL, SSL_R_SHUTDOWN_WHILE_IN_INIT);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     }
+
+    ssl_update_error_state(sc);
+    return ret;
 }

 int SSL_key_update(SSL *s, int updatetype)
@@ -2811,7 +3140,7 @@ int SSL_key_update(SSL *s, int updatetype)
     if (sc == NULL)
         return 0;

-    if (!SSL_CONNECTION_IS_TLS13(sc)) {
+    if (!SSL_CONNECTION_IS_VERSION13(sc)) {
         ERR_raise(ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION);
         return 0;
     }
@@ -2858,7 +3187,7 @@ int SSL_get_key_update_type(const SSL *s)
  */
 static int can_renegotiate(const SSL_CONNECTION *sc)
 {
-    if (SSL_CONNECTION_IS_TLS13(sc)) {
+    if (SSL_CONNECTION_IS_VERSION13(sc)) {
         ERR_raise(ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION);
         return 0;
     }
@@ -2925,7 +3254,7 @@ int SSL_new_session_ticket(SSL *s)
     /* If we are in init because we're sending tickets, okay to send more. */
     if ((SSL_in_init(s) && sc->ext.extra_tickets_expected == 0)
         || SSL_IS_FIRST_HANDSHAKE(sc) || !sc->server
-        || !SSL_CONNECTION_IS_TLS13(sc))
+        || !SSL_CONNECTION_IS_VERSION13(sc))
         return 0;
     sc->ext.extra_tickets_expected++;
     if (!RECORD_LAYER_write_pending(&sc->rlayer) && !SSL_in_init(s))
@@ -3282,7 +3611,7 @@ STACK_OF(SSL_CIPHER) *SSL_get1_supported_ciphers(SSL *s)
         return NULL;
     for (i = 0; i < sk_SSL_CIPHER_num(ciphers); i++) {
         const SSL_CIPHER *c = sk_SSL_CIPHER_value(ciphers, i);
-        if (!ssl_cipher_disabled(sc, c, SSL_SECOP_CIPHER_SUPPORTED, 0)) {
+        if (!ssl_cipher_disabled(sc, c, SSL_SECOP_CIPHER_SUPPORTED)) {
             if (!sk)
                 sk = sk_SSL_CIPHER_new_null();
             if (!sk)
@@ -3340,16 +3669,21 @@ STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx)
  * Distinguish between ciphers controlled by set_ciphersuite() and
  * set_cipher_list() when counting.
  */
-static int cipher_list_tls12_num(STACK_OF(SSL_CIPHER) *sk)
+static int cipher_list_tls12_num(STACK_OF(SSL_CIPHER) *sk, int isdtls)
 {
     int i, num = 0;
     const SSL_CIPHER *c;
+    const int version1_3 = isdtls ? DTLS1_3_VERSION : TLS1_3_VERSION;

     if (sk == NULL)
         return 0;
     for (i = 0; i < sk_SSL_CIPHER_num(sk); ++i) {
+        int minversion;
+
         c = sk_SSL_CIPHER_value(sk, i);
-        if (c->min_tls >= TLS1_3_VERSION)
+        minversion = isdtls ? c->min_dtls : c->min_tls;
+
+        if (PROTOCOL_VERSION_CMP(isdtls, minversion, version1_3) >= 0)
             continue;
         num++;
     }
@@ -3373,7 +3707,8 @@ int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str)
      */
     if (sk == NULL)
         return 0;
-    if (ctx->method->num_ciphers() > 0 && cipher_list_tls12_num(sk) == 0) {
+    if (ctx->method->num_ciphers() > 0
+        && cipher_list_tls12_num(sk, SSL_CTX_IS_DTLS(ctx)) == 0) {
         ERR_raise(ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH);
         return 0;
     }
@@ -3397,7 +3732,8 @@ int SSL_set_cipher_list(SSL *s, const char *str)
     /* see comment in SSL_CTX_set_cipher_list */
     if (sk == NULL)
         return 0;
-    if (ctx->method->num_ciphers() > 0 && cipher_list_tls12_num(sk) == 0) {
+    if (ctx->method->num_ciphers() > 0
+        && cipher_list_tls12_num(sk, SSL_CONNECTION_IS_DTLS(sc)) == 0) {
         ERR_raise(ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH);
         return 0;
     }
@@ -3462,7 +3798,7 @@ char *SSL_get_shared_ciphers(const SSL *s, char *buf, int size)
  *
  * Note that only the host_name type is defined (RFC 3546).
  */
-const char *SSL_get_servername(const SSL *s, const int type)
+const char *SSL_get_servername(const SSL *s, int type)
 {
     const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);
     int server;
@@ -3482,21 +3818,21 @@ const char *SSL_get_servername(const SSL *s, const int type)
     if (server) {
         /**
          * Server side
-         * In TLSv1.3 on the server SNI is not associated with the session
-         * but in TLSv1.2 or below it is.
+         * In (D)TLSv1.3 on the server SNI is not associated with the session
+         * but in (D)TLSv1.2 or below it is.
          *
          * Before the handshake:
          *  - return NULL
          *
-         * During/after the handshake (TLSv1.2 or below resumption occurred):
+         * During/after the handshake ((D)TLSv1.2 or below resumption occurred):
          * - If a servername was accepted by the server in the original
          *   handshake then it will return that servername, or NULL otherwise.
          *
-         * During/after the handshake (TLSv1.2 or below resumption did not occur):
+         * During/after the handshake ((D)TLSv1.2 or below resumption did not occur):
          * - The function will return the servername requested by the client in
          *   this handshake or NULL if none was requested.
          */
-        if (sc->hit && !SSL_CONNECTION_IS_TLS13(sc))
+        if (sc->hit && !SSL_CONNECTION_IS_VERSION13(sc))
             return sc->session->ext.hostname;
     } else {
         /**
@@ -3505,29 +3841,32 @@ const char *SSL_get_servername(const SSL *s, const int type)
          * Before the handshake:
          *  - If a servername has been set via a call to
          *    SSL_set_tlsext_host_name() then it will return that servername
-         *  - If one has not been set, but a TLSv1.2 resumption is being
+         *  - If one has not been set, but a (D)TLSv1.2 resumption is being
          *    attempted and the session from the original handshake had a
          *    servername accepted by the server then it will return that
          *    servername
          *  - Otherwise it returns NULL
          *
-         * During/after the handshake (TLSv1.2 or below resumption occurred):
+         * During/after the handshake ((D)TLSv1.2 or below resumption occurred):
          * - If the session from the original handshake had a servername accepted
          *   by the server then it will return that servername.
          * - Otherwise it returns the servername set via
          *   SSL_set_tlsext_host_name() (or NULL if it was not called).
          *
-         * During/after the handshake (TLSv1.2 or below resumption did not occur):
+         * During/after the handshake ((D)TLSv1.2 or below resumption did not occur):
          * - It will return the servername set via SSL_set_tlsext_host_name()
          *   (or NULL if it was not called).
          */
         if (SSL_in_before(s)) {
+            const int version1_3 = SSL_CONNECTION_IS_DTLS(sc) ? DTLS1_3_VERSION
+                                                              : TLS1_3_VERSION;
+
             if (sc->ext.hostname == NULL
                 && sc->session != NULL
-                && sc->session->ssl_version != TLS1_3_VERSION)
+                && sc->session->ssl_version != version1_3)
                 return sc->session->ext.hostname;
         } else {
-            if (!SSL_CONNECTION_IS_TLS13(sc) && sc->hit
+            if (!SSL_CONNECTION_IS_VERSION13(sc) && sc->hit
                 && sc->session->ext.hostname != NULL)
                 return sc->session->ext.hostname;
         }
@@ -3769,6 +4108,47 @@ int SSL_set_alpn_protos(SSL *ssl, const unsigned char *protos,
     return 0;
 }

+/*
+ * SSL_CTX_set_get0_protos gets the ALPN protocol list on |ctx| to |protos|.
+ */
+void SSL_CTX_get0_alpn_protos(SSL_CTX *ctx, const unsigned char **protos,
+    unsigned int *protos_len)
+{
+    unsigned char *p = NULL;
+    unsigned int len = 0;
+
+    if (ctx != NULL) {
+        p = ctx->ext.alpn;
+        len = (unsigned int)ctx->ext.alpn_len;
+    }
+
+    if (protos != NULL)
+        *protos = p;
+    if (protos_len != NULL)
+        *protos_len = len;
+}
+
+/*
+ * SSL_get0_alpn_protos gets the ALPN protocol list on |ssl| to |protos|.
+ */
+void SSL_get0_alpn_protos(SSL *ssl, const unsigned char **protos,
+    unsigned int *protos_len)
+{
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl);
+    unsigned char *p = NULL;
+    unsigned int len = 0;
+
+    if (sc != NULL) {
+        p = sc->ext.alpn;
+        len = (unsigned int)sc->ext.alpn_len;
+    }
+
+    if (protos != NULL)
+        *protos = p;
+    if (protos_len != NULL)
+        *protos_len = len;
+}
+
 /*
  * SSL_CTX_set_alpn_select_cb sets a callback function on |ctx| that is
  * called during ClientHello processing in order to select an ALPN protocol
@@ -3832,12 +4212,15 @@ int SSL_export_keying_material_early(SSL *s, unsigned char *out, size_t olen,
     const unsigned char *context,
     size_t contextlen)
 {
+    int version1_3;
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);

     if (sc == NULL)
         return -1;

-    if (sc->version != TLS1_3_VERSION)
+    version1_3 = SSL_CONNECTION_IS_DTLS(sc) ? DTLS1_3_VERSION : TLS1_3_VERSION;
+
+    if (sc->version != version1_3)
         return 0;

     return tls13_export_keying_material_early(sc, out, olen, label, llen,
@@ -4035,6 +4418,17 @@ SSL_CTX *SSL_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq,
             goto err;
     }

+    if ((ret->hmac = EVP_MAC_fetch(libctx, "HMAC", propq)) == NULL)
+        goto err;
+    if ((ret->sha256 = EVP_MD_fetch(libctx, "SHA2-256", propq)) == NULL)
+        goto err;
+    if ((ret->tktenc = EVP_CIPHER_fetch(libctx, "AES-256-CBC", propq)) == NULL)
+        goto err;
+#if defined(OPENSSL_HAVE_TLS1PRF)
+    if ((ret->tls1prf = EVP_KDF_fetch(libctx, OSSL_KDF_NAME_TLS1_PRF, propq)) == NULL)
+        goto err;
+#endif
+
     ret->method = meth;
     ret->min_proto_version = 0;
     ret->max_proto_version = 0;
@@ -4112,13 +4506,6 @@ SSL_CTX *SSL_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq,
         goto err;
     }

-    /*
-     * If these aren't available from the provider we'll get NULL returns.
-     * That's fine but will cause errors later if SSLv3 is negotiated
-     */
-    ret->md5 = ssl_evp_md_fetch(libctx, NID_md5, propq);
-    ret->sha1 = ssl_evp_md_fetch(libctx, NID_sha1, propq);
-
     if ((ret->ca_names = sk_X509_NAME_new_null()) == NULL) {
         ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
         goto err;
@@ -4169,24 +4556,6 @@ SSL_CTX *SSL_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq,
         goto err;
     }
 #endif
-#ifndef OPENSSL_NO_ENGINE
-#ifdef OPENSSL_SSL_CLIENT_ENGINE_AUTO
-#define eng_strx(x) #x
-#define eng_str(x) eng_strx(x)
-    /* Use specific client engine automatically... ignore errors */
-    {
-        ENGINE *eng;
-        eng = ENGINE_by_id(eng_str(OPENSSL_SSL_CLIENT_ENGINE_AUTO));
-        if (!eng) {
-            ERR_clear_error();
-            ENGINE_load_builtin_engines();
-            eng = ENGINE_by_id(eng_str(OPENSSL_SSL_CLIENT_ENGINE_AUTO));
-        }
-        if (!eng || !SSL_CTX_set_client_cert_engine(ret, eng))
-            ERR_clear_error();
-    }
-#endif
-#endif

 #ifndef OPENSSL_NO_COMP_ALG
     /*
@@ -4332,7 +4701,7 @@ int SSL_CTX_up_ref(SSL_CTX *ctx)
 {
     int i;

-    if (CRYPTO_UP_REF(&ctx->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&ctx->references, &i))
         return 0;

     REF_PRINT_COUNT("SSL_CTX", i, ctx);
@@ -4378,6 +4747,13 @@ void SSL_CTX_free(SSL_CTX *a)
     if (a->sessions != NULL)
         SSL_CTX_flush_sessions_ex(a, 0);

+    EVP_MAC_free(a->hmac);
+    EVP_MD_free(a->sha256);
+    EVP_CIPHER_free(a->tktenc);
+#ifdef OPENSSL_HAVE_TLS1PRF
+    EVP_KDF_free(a->tls1prf);
+#endif
+
     CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data);
     lh_SSL_SESSION_free(a->sessions);
     X509_STORE_free(a->cert_store);
@@ -4398,19 +4774,12 @@ void SSL_CTX_free(SSL_CTX *a)
 #ifndef OPENSSL_NO_SRP
     ssl_ctx_srp_ctx_free_intern(a);
 #endif
-#ifndef OPENSSL_NO_ENGINE
-    tls_engine_finish(a->client_cert_engine);
-#endif

-    OPENSSL_free(a->ext.ecpointformats);
     OPENSSL_free(a->ext.supportedgroups);
     OPENSSL_free(a->ext.keyshares);
     OPENSSL_free(a->ext.tuples);
     OPENSSL_free(a->ext.alpn);
-    OPENSSL_secure_free(a->ext.secure);
-
-    ssl_evp_md_free(a->md5);
-    ssl_evp_md_free(a->sha1);
+    OPENSSL_secure_clear_free(a->ext.secure, sizeof(*a->ext.secure));

     for (j = 0; j < SSL_ENC_NUM_IDX; j++)
         ssl_evp_cipher_free(a->ssl_cipher_methods[j]);
@@ -4457,6 +4826,10 @@ void SSL_CTX_free(SSL_CTX *a)
     ossl_quic_free_token_store(a->tokencache);
 #endif

+#ifndef OPENSSL_NO_ECH
+    ossl_ech_ctx_clear(&a->ext.ech);
+#endif
+
     OPENSSL_free(a);
 }

@@ -4568,7 +4941,10 @@ void ssl_set_masks(SSL_CONNECTION *s)

     dh_tmp = (c->dh_tmp != NULL
         || c->dh_tmp_cb != NULL
-        || c->dh_tmp_auto);
+        || c->dh_tmp_auto
+        || tls1_shared_group(s, TLS1_GROUPS_RETURN_TMP_ID,
+               TLS1_GROUPS_FFDHE_GROUPS)
+            != 0);

     rsa_enc = pvalid[SSL_PKEY_RSA] & CERT_PKEY_VALID;
     rsa_sign = pvalid[SSL_PKEY_RSA] & CERT_PKEY_VALID;
@@ -4603,10 +4979,13 @@ void ssl_set_masks(SSL_CONNECTION *s)

     /*
      * If we only have an RSA-PSS certificate allow RSA authentication
-     * if TLS 1.2 and peer supports it.
+     * if TLS 1.2 or DTLS 1.2 and peer supports it.
      */

-    if (rsa_enc || rsa_sign || (ssl_has_cert(s, SSL_PKEY_RSA_PSS_SIGN) && pvalid[SSL_PKEY_RSA_PSS_SIGN] & CERT_PKEY_EXPLICIT_SIGN && TLS1_get_version(&s->ssl) == TLS1_2_VERSION))
+    if (rsa_enc || rsa_sign
+        || (ssl_has_cert(s, SSL_PKEY_RSA_PSS_SIGN)
+            && pvalid[SSL_PKEY_RSA_PSS_SIGN] & CERT_PKEY_EXPLICIT_SIGN
+            && (SSL_version(&s->ssl) == XTLS(&s->ssl, 1, 2))))
         mask_a |= SSL_aRSA;

     if (dsa_sign) {
@@ -4625,7 +5004,7 @@ void ssl_set_masks(SSL_CONNECTION *s)
     }
     if (pvalid[SSL_PKEY_ECC] & CERT_PKEY_RPK)
         mask_a |= SSL_aECDSA;
-    if (TLS1_get_version(&s->ssl) == TLS1_2_VERSION) {
+    if (SSL_version(&s->ssl) == XTLS(&s->ssl, 1, 2)) {
         if (pvalid[SSL_PKEY_RSA_PSS_SIGN] & CERT_PKEY_RPK)
             mask_a |= SSL_aRSA;
         if (pvalid[SSL_PKEY_ED25519] & CERT_PKEY_RPK
@@ -4646,16 +5025,16 @@ void ssl_set_masks(SSL_CONNECTION *s)
         if (ecdsa_ok)
             mask_a |= SSL_aECDSA;
     }
-    /* Allow Ed25519 for TLS 1.2 if peer supports it */
+    /* Allow Ed25519 for TLS 1.2 and DTLS 1.2 if peer supports it */
     if (!(mask_a & SSL_aECDSA) && ssl_has_cert(s, SSL_PKEY_ED25519)
         && pvalid[SSL_PKEY_ED25519] & CERT_PKEY_EXPLICIT_SIGN
-        && TLS1_get_version(&s->ssl) == TLS1_2_VERSION)
+        && (SSL_version(&s->ssl) == XTLS(&s->ssl, 1, 2)))
         mask_a |= SSL_aECDSA;

-    /* Allow Ed448 for TLS 1.2 if peer supports it */
+    /* Allow Ed448 for TLS 1.2 and DTLS 1.2 if peer supports it */
     if (!(mask_a & SSL_aECDSA) && ssl_has_cert(s, SSL_PKEY_ED448)
         && pvalid[SSL_PKEY_ED448] & CERT_PKEY_EXPLICIT_SIGN
-        && TLS1_get_version(&s->ssl) == TLS1_2_VERSION)
+        && (SSL_version(&s->ssl) == XTLS(&s->ssl, 1, 2)))
         mask_a |= SSL_aECDSA;

     mask_k |= SSL_kECDHE;
@@ -4729,7 +5108,7 @@ void ssl_update_cache(SSL_CONNECTION *s, int mode)

     i = s->session_ctx->session_cache_mode;
     if ((i & mode) != 0
-        && (!s->hit || SSL_CONNECTION_IS_TLS13(s))) {
+        && (!s->hit || SSL_CONNECTION_IS_VERSION13(s))) {
         /*
          * Add the session to the internal cache. In server side TLSv1.3 we
          * normally don't do this because by default it's a full stateless ticket
@@ -4742,7 +5121,7 @@ void ssl_update_cache(SSL_CONNECTION *s, int mode)
          * - SSL_OP_NO_TICKET is set in which case it is a stateful ticket
          */
         if ((i & SSL_SESS_CACHE_NO_INTERNAL_STORE) == 0
-            && (!SSL_CONNECTION_IS_TLS13(s)
+            && (!SSL_CONNECTION_IS_VERSION13(s)
                 || !s->server
                 || (s->max_early_data > 0
                     && (s->options & SSL_OP_NO_ANTI_REPLAY) == 0)
@@ -4824,7 +5203,6 @@ int SSL_get_error(const SSL *s, int i)
 int ossl_ssl_get_error(const SSL *s, int i, int check_err)
 {
     int reason;
-    unsigned long l;
     BIO *bio;
     const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);

@@ -4842,15 +5220,11 @@ int ossl_ssl_get_error(const SSL *s, int i, int check_err)
     if (sc == NULL)
         return SSL_ERROR_SSL;

-    /*
-     * Make things return SSL_ERROR_SYSCALL when doing SSL_do_handshake etc,
-     * where we do encode the error
-     */
-    if (check_err && (l = ERR_peek_error()) != 0) {
-        if (ERR_GET_LIB(l) == ERR_LIB_SYS)
-            return SSL_ERROR_SYSCALL;
-        else
+    if (check_err != 0) {
+        if (sc->statem.error_state == ERROR_STATE_SSL)
             return SSL_ERROR_SSL;
+        if (sc->statem.error_state == ERROR_STATE_SYSCALL)
+            return SSL_ERROR_SYSCALL;
     }

 #ifndef OPENSSL_NO_QUIC
@@ -4859,6 +5233,19 @@ int ossl_ssl_get_error(const SSL *s, int i, int check_err)
     {
         if (SSL_want_read(s)) {
             bio = SSL_get_rbio(s);
+            /*
+             * rbio can be NULL for DTLS listener-created connections that
+             * read from DTLS_RX queue instead of a BIO.
+             */
+            if (bio == NULL) {
+#ifndef OPENSSL_NO_DTLS
+                if (sc != NULL && SSL_CONNECTION_IS_DTLS(sc)
+                    && sc->d1 != NULL && sc->d1->listener != NULL)
+                    return SSL_ERROR_WANT_READ;
+#endif
+                /* Unexpected NULL BIO */
+                return SSL_ERROR_SYSCALL;
+            }
             if (BIO_should_read(bio))
                 return SSL_ERROR_WANT_READ;
             else if (BIO_should_write(bio))
@@ -4889,6 +5276,19 @@ int ossl_ssl_get_error(const SSL *s, int i, int check_err)
              * present
              */
             bio = sc->wbio;
+            /*
+             * wbio can be NULL for DTLS listener-created connections that
+             * use the listener's shared BIO via BIO_sendmmsg().
+             */
+            if (bio == NULL) {
+#ifndef OPENSSL_NO_DTLS
+                if (sc != NULL && SSL_CONNECTION_IS_DTLS(sc)
+                    && sc->d1 != NULL && sc->d1->listener != NULL)
+                    return SSL_ERROR_WANT_WRITE;
+#endif
+                /* Unexpected NULL BIO */
+                return SSL_ERROR_SYSCALL;
+            }
             if (BIO_should_write(bio))
                 return SSL_ERROR_WANT_WRITE;
             else if (BIO_should_read(bio))
@@ -4950,13 +5350,21 @@ int SSL_do_handshake(SSL *s)
     if (sc == NULL)
         return -1;

+    if (ssl_reset_error_state(sc) == 0)
+        return -1;
+
+    sc->statem.error_state = ERROR_STATE_NOERROR;
+
     if (sc->handshake_func == NULL) {
         ERR_raise(ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET);
+        sc->statem.error_state = ERROR_STATE_SSL;
         return -1;
     }

-    if (!ossl_statem_check_finish_init(sc, -1))
+    if (!ossl_statem_check_finish_init(sc, -1)) {
+        ssl_update_error_state(sc);
         return -1;
+    }

     s->method->ssl_renegotiate_check(s, 0);

@@ -4973,6 +5381,7 @@ int SSL_do_handshake(SSL *s)
         }
     }

+    ssl_update_error_state(sc);
     return ret;
 }

@@ -5018,6 +5427,10 @@ void SSL_set_connect_state(SSL *s)

 int ssl_undefined_function(SSL *s)
 {
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
+
+    if (sc != NULL)
+        sc->statem.error_state = ERROR_STATE_SSL;
     ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
     return 0;
 }
@@ -5055,6 +5468,9 @@ const char *ssl_protocol_to_string(int version)
     case DTLS1_2_VERSION:
         return "DTLSv1.2";

+    case DTLS1_3_VERSION:
+        return "DTLSv1.3";
+
     default:
         return "unknown";
     }
@@ -5134,7 +5550,8 @@ SSL *SSL_dup(SSL *s)

     /* If we're not quiescent, just up_ref! */
     if (!SSL_in_init(s) || !SSL_in_before(s)) {
-        CRYPTO_UP_REF(&s->references, &i);
+        if (!CRYPTO_UP_REF(&s->references, &i))
+            return NULL;
         return s;
     }

@@ -5530,8 +5947,8 @@ SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx)
         /* Should never happen: ssl_cert_new() enforces this */
         if (!ossl_assert(new_cert->ssl_pkey_num >= SSL_PKEY_NUM))
             goto err;
-        new_valid_flags = OPENSSL_zalloc(new_cert->ssl_pkey_num
-            * sizeof(*new_valid_flags));
+        new_valid_flags = OPENSSL_calloc(new_cert->ssl_pkey_num,
+            sizeof(*new_valid_flags));
         if (new_valid_flags == NULL)
             goto err;
         memcpy(new_valid_flags, sc->s3.tmp.valid_flags,
@@ -6453,39 +6870,56 @@ static int ct_extract_ocsp_response_scts(SSL_CONNECTION *s)
 {
 #ifndef OPENSSL_NO_OCSP
     int scts_extracted = 0;
-    const unsigned char *p;
     OCSP_BASICRESP *br = NULL;
     OCSP_RESPONSE *rsp = NULL;
     STACK_OF(SCT) *scts = NULL;
-    int i;
+    int ret;
+    int i, j;

-    if (s->ext.ocsp.resp == NULL || s->ext.ocsp.resp_len == 0)
+    if (s->ext.ocsp.resp_ex == NULL)
         goto err;

-    p = s->ext.ocsp.resp;
-    rsp = d2i_OCSP_RESPONSE(NULL, &p, (int)s->ext.ocsp.resp_len);
-    if (rsp == NULL)
-        goto err;
+    for (j = 0; j < sk_OCSP_RESPONSE_num(s->ext.ocsp.resp_ex); j++) {
+        rsp = sk_OCSP_RESPONSE_value(s->ext.ocsp.resp_ex, j);
+        if (rsp == NULL)
+            goto err;

-    br = OCSP_response_get1_basic(rsp);
-    if (br == NULL)
-        goto err;
+        br = OCSP_response_get1_basic(rsp);
+        if (br == NULL)
+            goto err;

-    for (i = 0; i < OCSP_resp_count(br); ++i) {
-        OCSP_SINGLERESP *single = OCSP_resp_get0(br, i);
+        for (i = 0; i < OCSP_resp_count(br); ++i) {
+            OCSP_SINGLERESP *single = OCSP_resp_get0(br, i);

-        if (single == NULL)
-            continue;
+            if (single == NULL)
+                continue;

-        scts = OCSP_SINGLERESP_get1_ext_d2i(single, NID_ct_cert_scts, NULL, NULL);
-        scts_extracted = ct_move_scts(&s->scts, scts, SCT_SOURCE_OCSP_STAPLED_RESPONSE);
-        if (scts_extracted < 0)
-            goto err;
+            scts = OCSP_SINGLERESP_get1_ext_d2i(single,
+                NID_ct_cert_scts, NULL, NULL);
+            if (scts == NULL) {
+                scts_extracted = -1;
+                goto err;
+            }
+
+            ret = ct_move_scts(&s->scts, scts,
+                SCT_SOURCE_OCSP_STAPLED_RESPONSE);
+
+            SCT_LIST_free(scts);
+
+            if (ret < 0) {
+                scts_extracted = -1;
+                goto err;
+            }
+
+            scts_extracted += ret;
+        }
+
+        OCSP_BASICRESP_free(br);
+        /* to assure that is not freed twice */
+        br = NULL;
     }
 err:
-    SCT_LIST_free(scts);
     OCSP_BASICRESP_free(br);
-    OCSP_RESPONSE_free(rsp);
     return scts_extracted;
 #else
     /* Behave as if no OCSP response exists */
@@ -6785,17 +7219,12 @@ void SSL_CTX_set_new_pending_conn_cb(SSL_CTX *c, SSL_new_pending_conn_cb_fn cb,
     c->new_pending_conn_arg = arg;
 }

+#ifndef OPENSSL_NO_DEPRECATED_4_0
 int SSL_client_hello_isv2(SSL *s)
 {
-    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
-
-    if (sc == NULL)
-        return 0;
-
-    if (sc->clienthello == NULL)
-        return 0;
-    return sc->clienthello->isv2;
+    return 0;
 }
+#endif

 unsigned int SSL_client_hello_get0_legacy_version(SSL *s)
 {
@@ -6887,7 +7316,7 @@ int SSL_client_hello_get1_extensions_present(SSL *s, int **out, size_t *outlen)
         *outlen = 0;
         return 1;
     }
-    if ((present = OPENSSL_malloc(sizeof(*present) * num)) == NULL)
+    if ((present = OPENSSL_malloc_array(num, sizeof(*present))) == NULL)
         return 0;
     for (i = 0; i < sc->clienthello->pre_proc_exts_len; i++) {
         ext = sc->clienthello->pre_proc_exts + i;
@@ -7092,28 +7521,45 @@ int ssl_log_secret(SSL_CONNECTION *sc,
     const uint8_t *secret,
     size_t secret_len)
 {
+    const uint8_t *client_random = sc->s3.client_random;
+
+    /*
+     * If the client attempted ECH, secrets are logged against the inner
+     * ClientHello random. CLIENT_EARLY_LABEL and EARLY_EXPORTER_SECRET_LABEL
+     * are special-cased because they are logged before the server's
+     * acceptance of ECH is known, but are always derived from the inner
+     * ClientHello (see tls13_change_cipher_state()), so they use the inner
+     * random regardless of ech.success. On rejection the early secrets
+     * therefore carry the inner random while later ones carry the outer:
+     * each line is tagged with the random of the ClientHello its secret
+     * was derived from, and since a rejecting server never derives the
+     * early secrets, both peers still log identical material for every label
+     * they both log.
+     */
+#ifndef OPENSSL_NO_ECH
+    if (!sc->server && sc->ext.ech.attempted == 1
+        && (sc->ext.ech.success == 1
+            || strcmp(label, CLIENT_EARLY_LABEL) == 0
+            || strcmp(label, EARLY_EXPORTER_SECRET_LABEL) == 0))
+        client_random = sc->ext.ech.client_random;
+#endif
+
     return nss_keylog_int(label,
         sc,
-        sc->s3.client_random,
+        client_random,
         SSL3_RANDOM_SIZE,
         secret,
         secret_len);
 }

-#define SSLV2_CIPHER_LEN 3
-
-int ssl_cache_cipherlist(SSL_CONNECTION *s, PACKET *cipher_suites, int sslv2format)
+int ssl_cache_cipherlist(SSL_CONNECTION *s, PACKET *cipher_suites)
 {
-    int n;
-
-    n = sslv2format ? SSLV2_CIPHER_LEN : TLS_CIPHER_LEN;
-
     if (PACKET_remaining(cipher_suites) == 0) {
         SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_NO_CIPHERS_SPECIFIED);
         return 0;
     }

-    if (PACKET_remaining(cipher_suites) % n != 0) {
+    if (PACKET_remaining(cipher_suites) % TLS_CIPHER_LEN != 0) {
         SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST);
         return 0;
     }
@@ -7122,45 +7568,8 @@ int ssl_cache_cipherlist(SSL_CONNECTION *s, PACKET *cipher_suites, int sslv2form
     s->s3.tmp.ciphers_raw = NULL;
     s->s3.tmp.ciphers_rawlen = 0;

-    if (sslv2format) {
-        size_t numciphers = PACKET_remaining(cipher_suites) / n;
-        PACKET sslv2ciphers = *cipher_suites;
-        unsigned int leadbyte;
-        unsigned char *raw;
-
-        /*
-         * We store the raw ciphers list in SSLv3+ format so we need to do some
-         * preprocessing to convert the list first. If there are any SSLv2 only
-         * ciphersuites with a non-zero leading byte then we are going to
-         * slightly over allocate because we won't store those. But that isn't a
-         * problem.
-         */
-        raw = OPENSSL_malloc(numciphers * TLS_CIPHER_LEN);
-        s->s3.tmp.ciphers_raw = raw;
-        if (raw == NULL) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_CRYPTO_LIB);
-            return 0;
-        }
-        for (s->s3.tmp.ciphers_rawlen = 0;
-            PACKET_remaining(&sslv2ciphers) > 0;
-            raw += TLS_CIPHER_LEN) {
-            if (!PACKET_get_1(&sslv2ciphers, &leadbyte)
-                || (leadbyte == 0
-                    && !PACKET_copy_bytes(&sslv2ciphers, raw,
-                        TLS_CIPHER_LEN))
-                || (leadbyte != 0
-                    && !PACKET_forward(&sslv2ciphers, TLS_CIPHER_LEN))) {
-                SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_PACKET);
-                OPENSSL_free(s->s3.tmp.ciphers_raw);
-                s->s3.tmp.ciphers_raw = NULL;
-                s->s3.tmp.ciphers_rawlen = 0;
-                return 0;
-            }
-            if (leadbyte == 0)
-                s->s3.tmp.ciphers_rawlen += TLS_CIPHER_LEN;
-        }
-    } else if (!PACKET_memdup(cipher_suites, &s->s3.tmp.ciphers_raw,
-                   &s->s3.tmp.ciphers_rawlen)) {
+    if (!PACKET_memdup(cipher_suites, &s->s3.tmp.ciphers_raw,
+            &s->s3.tmp.ciphers_rawlen)) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return 0;
     }
@@ -7174,27 +7583,24 @@ int SSL_bytes_to_cipher_list(SSL *s, const unsigned char *bytes, size_t len,
     PACKET pkt;
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);

-    if (sc == NULL)
+    if (sc == NULL || isv2format)
         return 0;

     if (!PACKET_buf_init(&pkt, bytes, len))
         return 0;
-    return ossl_bytes_to_cipher_list(sc, &pkt, sk, scsvs, isv2format, 0);
+    return ossl_bytes_to_cipher_list(sc, &pkt, sk, scsvs, 0);
 }

 int ossl_bytes_to_cipher_list(SSL_CONNECTION *s, PACKET *cipher_suites,
     STACK_OF(SSL_CIPHER) **skp,
     STACK_OF(SSL_CIPHER) **scsvs_out,
-    int sslv2format, int fatal)
+    int fatal)
 {
     const SSL_CIPHER *c;
     STACK_OF(SSL_CIPHER) *sk = NULL;
     STACK_OF(SSL_CIPHER) *scsvs = NULL;
-    int n;
-    /* 3 = SSLV2_CIPHER_LEN > TLS_CIPHER_LEN = 2. */
-    unsigned char cipher[SSLV2_CIPHER_LEN];
-
-    n = sslv2format ? SSLV2_CIPHER_LEN : TLS_CIPHER_LEN;
+    int n = TLS_CIPHER_LEN;
+    unsigned char cipher[TLS_CIPHER_LEN];

     if (PACKET_remaining(cipher_suites) == 0) {
         if (fatal)
@@ -7224,16 +7630,7 @@ int ossl_bytes_to_cipher_list(SSL_CONNECTION *s, PACKET *cipher_suites,
     }

     while (PACKET_copy_bytes(cipher_suites, cipher, n)) {
-        /*
-         * SSLv3 ciphers wrapped in an SSLv2-compatible ClientHello have the
-         * first byte set to zero, while true SSLv2 ciphers have a non-zero
-         * first byte. We don't support any true SSLv2 ciphers, so skip them.
-         */
-        if (sslv2format && cipher[0] != '\0')
-            continue;
-
-        /* For SSLv2-compat, ignore leading 0-byte. */
-        c = ssl_get_cipher_by_char(s, sslv2format ? &cipher[1] : cipher, 1);
+        c = ssl_get_cipher_by_char(s, cipher, 1);
         if (c != NULL) {
             if ((c->valid && !sk_SSL_CIPHER_push(sk, c)) || (!c->valid && !sk_SSL_CIPHER_push(scsvs, c))) {
                 if (fatal)
@@ -7342,7 +7739,7 @@ __owur unsigned int ssl_get_max_send_fragment(const SSL_CONNECTION *sc)
         return GET_MAX_FRAGMENT_LENGTH(sc->session);

     /* return current SSL connection setting */
-    return sc->max_send_fragment;
+    return (unsigned int)sc->max_send_fragment;
 }

 __owur unsigned int ssl_get_split_send_fragment(const SSL_CONNECTION *sc)
@@ -7354,10 +7751,10 @@ __owur unsigned int ssl_get_split_send_fragment(const SSL_CONNECTION *sc)

     /* else limit |split_send_fragment| to current |max_send_fragment| */
     if (sc->split_send_fragment > sc->max_send_fragment)
-        return sc->max_send_fragment;
+        return (unsigned int)sc->max_send_fragment;

     /* return current SSL connection setting */
-    return sc->split_send_fragment;
+    return (unsigned int)sc->split_send_fragment;
 }

 int SSL_stateless(SSL *s)
@@ -7416,7 +7813,7 @@ int SSL_verify_client_post_handshake(SSL *ssl)
     if (sc == NULL)
         return 0;

-    if (!SSL_CONNECTION_IS_TLS13(sc)) {
+    if (!SSL_CONNECTION_IS_VERSION13(sc)) {
         ERR_raise(ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION);
         return 0;
     }
@@ -7494,21 +7891,13 @@ void SSL_set_allow_early_data_cb(SSL *s,
 }

 const EVP_CIPHER *ssl_evp_cipher_fetch(OSSL_LIB_CTX *libctx,
-    int nid,
+    const char *name,
     const char *properties)
 {
     const EVP_CIPHER *ciph;

-    ciph = tls_get_cipher_from_engine(nid);
-    if (ciph != NULL)
-        return ciph;
-
-    /*
-     * If there is no engine cipher then we do an explicit fetch. This may fail
-     * and that could be ok
-     */
     ERR_set_mark();
-    ciph = EVP_CIPHER_fetch(libctx, OBJ_nid2sn(nid), properties);
+    ciph = EVP_CIPHER_fetch(libctx, name, properties);
     if (ciph != NULL) {
         OSSL_PARAM params[2];
         int decrypt_only = 0;
@@ -7554,23 +7943,6 @@ void ssl_evp_cipher_free(const EVP_CIPHER *cipher)
     }
 }

-const EVP_MD *ssl_evp_md_fetch(OSSL_LIB_CTX *libctx,
-    int nid,
-    const char *properties)
-{
-    const EVP_MD *md;
-
-    md = tls_get_digest_from_engine(nid);
-    if (md != NULL)
-        return md;
-
-    /* Otherwise we do an explicit fetch */
-    ERR_set_mark();
-    md = EVP_MD_fetch(libctx, OBJ_nid2sn(nid), properties);
-    ERR_pop_to_mark();
-    return md;
-}
-
 int ssl_evp_md_up_ref(const EVP_MD *md)
 {
     /* Don't up-ref an implicit EVP_MD */
@@ -7731,37 +8103,70 @@ int SSL_net_write_desired(SSL *s)
 int SSL_set_blocking_mode(SSL *s, int blocking)
 {
 #ifndef OPENSSL_NO_QUIC
-    if (!IS_QUIC(s))
-        return 0;
+    if (IS_QUIC(s))
+        return ossl_quic_conn_set_blocking_mode(s, blocking);
+#endif

-    return ossl_quic_conn_set_blocking_mode(s, blocking);
-#else
-    return 0;
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    if (IS_DTLS(s))
+        return ossl_dtls_set_blocking_mode(s, blocking);
 #endif
+
+    return 0;
 }

 int SSL_get_blocking_mode(SSL *s)
 {
 #ifndef OPENSSL_NO_QUIC
-    if (!IS_QUIC(s))
-        return -1;
+    if (IS_QUIC(s))
+        return ossl_quic_conn_get_blocking_mode(s);
+#endif

-    return ossl_quic_conn_get_blocking_mode(s);
-#else
-    return -1;
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    if (IS_DTLS(s))
+        return ossl_dtls_get_blocking_mode(s);
 #endif
+
+    return -1;
 }

 int SSL_set1_initial_peer_addr(SSL *s, const BIO_ADDR *peer_addr)
 {
 #ifndef OPENSSL_NO_QUIC
-    if (!IS_QUIC(s))
-        return 0;
+    if (IS_QUIC(s))
+        return ossl_quic_conn_set_initial_peer_addr(s, peer_addr);
+#endif

-    return ossl_quic_conn_set_initial_peer_addr(s, peer_addr);
-#else
-    return 0;
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    /* Handle DTLS connections */
+    if (IS_DTLS(s)) {
+        SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
+
+        if (sc == NULL || sc->d1 == NULL)
+            return 0;
+
+        if (peer_addr != NULL) {
+            if (!BIO_ADDR_copy(&sc->d1->peer_addr, peer_addr))
+                return 0;
+        } else {
+            BIO_ADDR_clear(&sc->d1->peer_addr);
+        }
+
+        /*
+         * Update the record layers' peer address if they exist.
+         * This is needed for listener-created connections where the record
+         * layer is created before the peer address is set.
+         */
+        if (sc->rlayer.wrlmethod != NULL && sc->rlayer.wrl != NULL)
+            sc->rlayer.wrlmethod->set1_peer(sc->rlayer.wrl, peer_addr);
+        if (sc->rlayer.rrlmethod != NULL && sc->rlayer.rrl != NULL)
+            sc->rlayer.rrlmethod->set1_peer(sc->rlayer.rrl, peer_addr);
+
+        return 1;
+    }
 #endif
+
+    return 0;
 }

 int SSL_shutdown_ex(SSL *ssl, uint64_t flags,
@@ -7822,13 +8227,16 @@ int SSL_is_connection(SSL *s)
 SSL *SSL_get0_listener(SSL *s)
 {
 #ifndef OPENSSL_NO_QUIC
-    if (!IS_QUIC(s))
-        return NULL;
+    if (IS_QUIC(s))
+        return ossl_quic_get0_listener(s);
+#endif

-    return ossl_quic_get0_listener(s);
-#else
-    return NULL;
+#ifndef OPENSSL_NO_DTLS
+    if (IS_DTLS(s))
+        return ossl_dtls_get0_listener(s);
 #endif
+
+    return NULL;
 }

 SSL *SSL_get0_domain(SSL *s)
@@ -8020,6 +8428,11 @@ int SSL_get_value_uint(SSL *s, uint32_t class_, uint32_t id,
         return ossl_quic_get_value_uint(s, class_, id, value);
 #endif

+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    if (IS_DTLS_LISTENER(s))
+        return ossl_dtls_get_value_uint(s, class_, id, value);
+#endif
+
     ERR_raise(ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL);
     return 0;
 }
@@ -8032,20 +8445,32 @@ int SSL_set_value_uint(SSL *s, uint32_t class_, uint32_t id,
         return ossl_quic_set_value_uint(s, class_, id, value);
 #endif

+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    if (IS_DTLS_LISTENER(s))
+        return ossl_dtls_set_value_uint(s, class_, id, value);
+#endif
+
     ERR_raise(ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL);
     return 0;
 }

 SSL *SSL_new_listener(SSL_CTX *ctx, uint64_t flags)
 {
-#ifndef OPENSSL_NO_QUIC
-    if (!IS_QUIC_CTX(ctx))
+    if (ctx == NULL) {
+        ERR_raise(ERR_LIB_SSL, SSL_R_NULL_SSL_CTX);
         return NULL;
+    }

-    return ossl_quic_new_listener(ctx, flags);
-#else
-    return NULL;
+#ifndef OPENSSL_NO_QUIC
+    if (IS_QUIC_CTX(ctx))
+        return ossl_quic_new_listener(ctx, flags);
 #endif
+
+#ifndef OPENSSL_NO_DTLS
+    if (SSL_CTX_IS_DTLS(ctx))
+        return ossl_dtls_new_listener(ctx, flags);
+#endif
+    return NULL;
 }

 SSL *SSL_new_listener_from(SSL *ssl, uint64_t flags)
@@ -8053,7 +8478,6 @@ SSL *SSL_new_listener_from(SSL *ssl, uint64_t flags)
 #ifndef OPENSSL_NO_QUIC
     if (!IS_QUIC(ssl))
         return NULL;
-
     return ossl_quic_new_listener_from(ssl, flags);
 #else
     return NULL;
@@ -8065,7 +8489,6 @@ SSL *SSL_new_from_listener(SSL *ssl, uint64_t flags)
 #ifndef OPENSSL_NO_QUIC
     if (!IS_QUIC(ssl))
         return NULL;
-
     return ossl_quic_new_from_listener(ssl, flags);
 #else
     return NULL;
@@ -8075,37 +8498,79 @@ SSL *SSL_new_from_listener(SSL *ssl, uint64_t flags)
 SSL *SSL_accept_connection(SSL *ssl, uint64_t flags)
 {
 #ifndef OPENSSL_NO_QUIC
-    if (!IS_QUIC(ssl))
-        return NULL;
+    if (IS_QUIC(ssl))
+        return ossl_quic_accept_connection(ssl, flags);
+#endif

-    return ossl_quic_accept_connection(ssl, flags);
-#else
-    return NULL;
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    if (IS_DTLS(ssl))
+        return ossl_dtls_accept_connection(ssl, flags);
 #endif
+
+    return NULL;
 }

 size_t SSL_get_accept_connection_queue_len(SSL *ssl)
 {
 #ifndef OPENSSL_NO_QUIC
-    if (!IS_QUIC(ssl))
-        return 0;
+    if (IS_QUIC(ssl))
+        return ossl_quic_get_accept_connection_queue_len(ssl);
+#endif
+
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    if (IS_DTLS(ssl))
+        return ossl_dtls_get_accept_connection_queue_len(ssl);
+#endif
+
+    return 0;
+}
+
+int SSL_get_peer_addr(SSL *ssl, BIO_ADDR *peer_addr)
+{
+#ifndef OPENSSL_NO_QUIC
+    if (IS_QUIC(ssl))
+        return ossl_quic_get_peer_addr(ssl, peer_addr);
+#endif
+
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl);
+
+    if (sc != NULL && sc->d1 != NULL
+        && BIO_ADDR_family(&sc->d1->peer_addr) != AF_UNSPEC) {
+        if (!BIO_ADDR_copy(peer_addr, &sc->d1->peer_addr))
+            return 0;
+        return 1;
+    }
+#endif

-    return ossl_quic_get_accept_connection_queue_len(ssl);
-#else
     return 0;
+}
+
+int SSL_listen_ex(SSL *listener, SSL *new_conn)
+{
+#ifndef OPENSSL_NO_QUIC
+    if (IS_QUIC(listener) && IS_QUIC(new_conn))
+        return ossl_quic_peeloff_conn(listener, new_conn);
+    else
 #endif
+        ERR_raise_data(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT,
+            "SSL_listen_ex only operates on QUIC SSL objects");
+    return -1;
 }

 int SSL_listen(SSL *ssl)
 {
 #ifndef OPENSSL_NO_QUIC
-    if (!IS_QUIC(ssl))
-        return 0;
+    if (IS_QUIC(ssl))
+        return ossl_quic_listen(ssl);
+#endif

-    return ossl_quic_listen(ssl);
-#else
-    return 0;
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+    if (IS_DTLS(ssl))
+        return ossl_dtls_listen(ssl);
 #endif
+
+    return 0;
 }

 SSL *SSL_new_domain(SSL_CTX *ctx, uint64_t flags)
@@ -8222,7 +8687,7 @@ int SSL_add_expected_rpk(SSL *s, EVP_PKEY *rpk)

 EVP_PKEY *SSL_get0_peer_rpk(const SSL *s)
 {
-    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
+    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);

     if (sc == NULL || sc->session == NULL)
         return NULL;
@@ -8231,7 +8696,7 @@ EVP_PKEY *SSL_get0_peer_rpk(const SSL *s)

 int SSL_get_negotiated_client_cert_type(const SSL *s)
 {
-    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
+    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);

     if (sc == NULL)
         return 0;
@@ -8241,7 +8706,7 @@ int SSL_get_negotiated_client_cert_type(const SSL *s)

 int SSL_get_negotiated_server_cert_type(const SSL *s)
 {
-    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
+    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);

     if (sc == NULL)
         return 0;
@@ -8378,3 +8843,37 @@ int SSL_CTX_get0_server_cert_type(const SSL_CTX *ctx, unsigned char **t, size_t
     *len = ctx->server_cert_type_len;
     return 1;
 }
+
+/*
+ * RFC 8701 GREASE - returns a GREASE value (0x?A?A pattern) for the given
+ * index.  Seeds are generated lazily on first use and remain stable for the
+ * lifetime of the connection so that HelloRetryRequest replays get identical
+ * values.
+ */
+uint16_t ossl_grease_value(SSL_CONNECTION *s, int index)
+{
+    uint16_t ret;
+
+    if (index < 0 || index > OSSL_GREASE_LAST_INDEX)
+        return 0x0A0A;
+
+    if (!s->ext.grease_seeded) {
+        if (RAND_bytes_ex(SSL_CONNECTION_GET_CTX(s)->libctx,
+                s->ext.grease_seed,
+                sizeof(s->ext.grease_seed), 0)
+            <= 0)
+            memset(s->ext.grease_seed, 0x42, sizeof(s->ext.grease_seed));
+        s->ext.grease_seeded = 1;
+    }
+
+    /* Map seed byte to 0x?A?A pattern */
+    ret = (s->ext.grease_seed[index] & 0xf0) | 0x0a;
+    ret |= ret << 8;
+
+    /* Ensure EXT2 differs from EXT1 */
+    if (index == OSSL_GREASE_EXT2
+        && ret == ossl_grease_value(s, OSSL_GREASE_EXT1))
+        ret ^= 0x1010;
+
+    return ret;
+}
diff --git a/deps/openssl/openssl/ssl/ssl_local.h b/deps/openssl/openssl/ssl/ssl_local.h
index d974ac6ecfe..aecae880c33 100644
--- a/deps/openssl/openssl/ssl/ssl_local.h
+++ b/deps/openssl/openssl/ssl/ssl_local.h
@@ -12,6 +12,7 @@
 #ifndef OSSL_SSL_LOCAL_H
 #define OSSL_SSL_LOCAL_H

+#include <stdbool.h>
 #include <stdlib.h>
 #include <time.h>
 #include <errno.h>
@@ -31,9 +32,11 @@
 #include "internal/packet.h"
 #include "internal/dane.h"
 #include "internal/refcount.h"
+#include "internal/tlssigalgs.h"
 #include "internal/tsan_assist.h"
 #include "internal/bio.h"
 #include "internal/ktls.h"
+#include "internal/list.h"
 #include "internal/time.h"
 #include "internal/ssl.h"
 #include "internal/cryptlib.h"
@@ -41,6 +44,28 @@
 #include "record/record.h"
 #include "internal/quic_predef.h"
 #include "internal/quic_tls.h"
+#include "internal/thread_arch.h"
+#include "internal/bio_addr.h"
+#include "internal/dtls_record_rx.h"
+#include "internal/dgram_conn_lookup.h"
+#include "internal/rio_notifier.h"
+#ifndef OPENSSL_NO_ECH
+#include "ech/ech_local.h"
+#endif
+
+/*
+ * Forward declarations for DTLS listener types. These are defined in the
+ * headers above when DTLS is enabled, but we need forward declarations
+ * for the pointer types used in structures when DTLS is disabled.
+ * DGRAM_DEMUX requires either QUIC or DTLS to be enabled.
+ */
+#if defined(OPENSSL_NO_QUIC) && defined(OPENSSL_NO_DTLS)
+typedef struct dgram_demux_st DGRAM_DEMUX;
+#endif
+#ifdef OPENSSL_NO_DTLS
+typedef struct dtls_rx_st DTLS_RX;
+typedef struct dgram_conn_lookup_st DGRAM_CONN_LOOKUP;
+#endif

 #ifdef OPENSSL_BUILD_SHLIBSSL
 #undef OPENSSL_EXTERN
@@ -48,7 +73,7 @@
 #endif

 #define TLS_MAX_VERSION_INTERNAL TLS1_3_VERSION
-#define DTLS_MAX_VERSION_INTERNAL DTLS1_2_VERSION
+#define DTLS_MAX_VERSION_INTERNAL DTLS1_3_VERSION

 /*
  * DTLS version numbers are strange because they're inverted. Except for
@@ -59,6 +84,49 @@
 #define DTLS_VERSION_GE(v1, v2) (dtls_ver_ordinal(v1) <= dtls_ver_ordinal(v2))
 #define DTLS_VERSION_LT(v1, v2) (dtls_ver_ordinal(v1) > dtls_ver_ordinal(v2))
 #define DTLS_VERSION_LE(v1, v2) (dtls_ver_ordinal(v1) >= dtls_ver_ordinal(v2))
+/* TLS/DTLS version for the given SSL object: XTLS(ssl, 1, 2) == TLS 1.2 or DTLS 1.2 */
+#define XTLS(ssl, m, n) (SSL_is_dtls(ssl) ? (((0xFF - m) << 8) | (0xFF - n)) : (((0x02 + m) << 8) | (0x01 + n)))
+
+/*
+ * SSL/TLS version comparison
+ *
+ * Returns
+ *      0 if versiona is equal to versionb or if either are 0 or less
+ *      1 if versiona is greater than versionb
+ *     -1 if versiona is less than versionb
+ */
+#define TLS_VERSION_CMP(versiona, versionb)                        \
+    ((!ossl_assert((versiona) > 0) || !ossl_assert((versionb) > 0) \
+         || (versiona) == (versionb))                              \
+            ? 0                                                    \
+            : ((versiona) < (versionb) ? -1 : 1))
+/*
+ * DTLS version comparison
+ *
+ * Returns
+ *      0 if versiona is equal to versionb or if either are 0 or less
+ *      1 if versiona is greater than versionb
+ *     -1 if versiona is less than versionb
+ */
+#define DTLS_VERSION_CMP(versiona, versionb)                       \
+    ((!ossl_assert((versiona) > 0) || !ossl_assert((versionb) > 0) \
+         || (versiona) == (versionb))                              \
+            ? 0                                                    \
+            : (DTLS_VERSION_LT((versiona),                         \
+                   (versionb))                                     \
+                      ? -1                                         \
+                      : 1))
+/*
+ * SSL/TLS/DTLS version comparison
+ *
+ * Returns
+ *      0 if versiona is equal to versionb or if either are 0 or less
+ *      1 if versiona is greater than versionb
+ *     -1 if versiona is less than versionb
+ */
+#define PROTOCOL_VERSION_CMP(isdtls, versiona, versionb) \
+    ((isdtls) ? DTLS_VERSION_CMP(versiona, versionb)     \
+              : TLS_VERSION_CMP(versiona, versionb))

 #define SSL_AD_NO_ALERT -1

@@ -151,10 +219,16 @@
 #define SSL_ARIA256GCM 0x00200000U
 #define SSL_MAGMA 0x00400000U
 #define SSL_KUZNYECHIK 0x00800000U
+#define SSL_SM4GCM 0x01000000U
+#define SSL_SM4CCM 0x02000000U

 #define SSL_AESGCM (SSL_AES128GCM | SSL_AES256GCM)
 #define SSL_AESCCM (SSL_AES128CCM | SSL_AES256CCM | SSL_AES128CCM8 | SSL_AES256CCM8)
 #define SSL_AES (SSL_AES128 | SSL_AES256 | SSL_AESGCM | SSL_AESCCM)
+#define SSL_AES128_ANY (SSL_AES128 | SSL_AES128CCM | SSL_AES128CCM8 \
+    | SSL_AES128GCM)
+#define SSL_AES256_ANY (SSL_AES256 | SSL_AES256CCM | SSL_AES256CCM8 \
+    | SSL_AES256GCM)
 #define SSL_CAMELLIA (SSL_CAMELLIA128 | SSL_CAMELLIA256)
 #define SSL_CHACHA20 (SSL_CHACHA20POLY1305)
 #define SSL_ARIAGCM (SSL_ARIA128GCM | SSL_ARIA256GCM)
@@ -198,7 +272,8 @@
 #define SSL_MD_SHA512_IDX 11
 #define SSL_MD_MAGMAOMAC_IDX 12
 #define SSL_MD_KUZNYECHIKOMAC_IDX 13
-#define SSL_MAX_DIGEST 14
+#define SSL_MD_SM3_IDX 14
+#define SSL_MAX_DIGEST 15

 #define SSL_MD_NUM_IDX SSL_MAX_DIGEST

@@ -212,6 +287,7 @@
 #define SSL_HANDSHAKE_MAC_GOST94 SSL_MD_GOST94_IDX
 #define SSL_HANDSHAKE_MAC_GOST12_256 SSL_MD_GOST12_256_IDX
 #define SSL_HANDSHAKE_MAC_GOST12_512 SSL_MD_GOST12_512_IDX
+#define SSL_HANDSHAKE_MAC_SM3 SSL_MD_SM3_IDX
 #define SSL_HANDSHAKE_MAC_DEFAULT SSL_HANDSHAKE_MAC_MD5_SHA1

 /* Bits 8-15 bits are PRF */
@@ -245,7 +321,7 @@
 #define SSL_LOW 0x00000002U
 #define SSL_MEDIUM 0x00000004U
 #define SSL_HIGH 0x00000008U
-#define SSL_FIPS 0x00000010U
+/* #define SSL_FIPS 0x00000010U obsolete FIPS canister remnant */
 #define SSL_NOT_DEFAULT 0x00000020U

 /* we have used 0000003f - 26 bits left to go */
@@ -257,17 +333,31 @@
 #define SSL_CONNECTION_IS_DTLS(s) \
     (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)

+/* Check if an SSL structure is using DTLS */
+#define SSL_CONNECTION_MIDDLEBOX_IS_ENABLED(s)          \
+    ((s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0 \
+        && !SSL_CONNECTION_IS_DTLS(s))
+
+/* Check if we are using DTLSv1.3 */
+#define SSL_CONNECTION_IS_DTLS13(s) (SSL_CONNECTION_IS_DTLS(s)                      \
+    && DTLS_VERSION_GE(SSL_CONNECTION_GET_SSL(s)->method->version, DTLS1_3_VERSION) \
+    && SSL_CONNECTION_GET_SSL(s)->method->version != DTLS_ANY_VERSION)
+
 /* Check if an SSL_CTX structure is using DTLS */
 #define SSL_CTX_IS_DTLS(ctx) \
-    (ctx->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
+    ((ctx->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS) != 0)

 /* Check if we are using TLSv1.3 */
 #define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
     && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
     && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)

+/* Check if we are using (D)TLSv1.3 */
+#define SSL_CONNECTION_IS_VERSION13(s) \
+    (SSL_CONNECTION_IS_DTLS13(s) || SSL_CONNECTION_IS_TLS13(s))
+
 #define SSL_CONNECTION_TREAT_AS_TLS13(s)                         \
-    (SSL_CONNECTION_IS_TLS13(s)                                  \
+    (SSL_CONNECTION_IS_VERSION13(s)                              \
         || (s)->early_data_state == SSL_EARLY_DATA_CONNECTING    \
         || (s)->early_data_state == SSL_EARLY_DATA_CONNECT_RETRY \
         || (s)->early_data_state == SSL_EARLY_DATA_WRITING       \
@@ -283,12 +373,6 @@
  */
 #define SSL_USE_SIGALGS(s) \
     (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_SIGALGS)
-/*
- * Allow TLS 1.2 ciphersuites: applies to DTLS 1.2 as well as TLS 1.2: may
- * apply to others in future.
- */
-#define SSL_USE_TLS1_2_CIPHERS(s) \
-    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_TLS1_2_CIPHERS)

 #define IS_MAX_FRAGMENT_LENGTH_EXT_VALID(value) \
     (((value) >= TLSEXT_max_fragment_length_512) && ((value) <= TLSEXT_max_fragment_length_4096))
@@ -304,7 +388,7 @@
 #define SSL_IS_QUIC_INT_HANDSHAKE(s) (((s)->s3.flags & TLS1_FLAGS_QUIC_INTERNAL) != 0)

 /* no end of early data */
-#define SSL_NO_EOED(s) SSL_IS_QUIC_HANDSHAKE(s)
+#define SSL_NO_EOED(s) (SSL_IS_QUIC_HANDSHAKE(s) || SSL_CONNECTION_IS_DTLS13(s))

 /* alert_dispatch values */

@@ -351,7 +435,9 @@
 #define SSL_ENC_ARIA256GCM_IDX 21
 #define SSL_ENC_MAGMA_IDX 22
 #define SSL_ENC_KUZNYECHIK_IDX 23
-#define SSL_ENC_NUM_IDX 24
+#define SSL_ENC_SM4GCM_IDX 24
+#define SSL_ENC_SM4CCM_IDX 25
+#define SSL_ENC_NUM_IDX 26

 /*-
  * SSL_kRSA <- RSA_ENC
@@ -375,7 +461,7 @@ typedef enum {
     SSL_PHA_REQUESTED /* request received by client, or sent by server */
 } SSL_PHA_STATE;

-/* CipherSuite length. SSLv3 and all TLS versions. */
+/* CipherSuite value length. */
 #define TLS_CIPHER_LEN 2
 /* used to hold info on the particular ciphers used */
 struct ssl_cipher_st {
@@ -435,7 +521,7 @@ struct ssl_method_st {
     int (*num_ciphers)(void);
     const SSL_CIPHER *(*get_cipher)(unsigned ncipher);
     OSSL_TIME (*get_timeout)(void);
-    const struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */
+    const struct ssl3_enc_method *ssl3_enc; /* Extra TLS stuff */
     int (*ssl_version)(void);
     long (*ssl_callback_ctrl)(SSL *s, int cb_id, void (*fp)(void));
     long (*ssl_ctx_callback_ctrl)(SSL_CTX *s, int cb_id, void (*fp)(void));
@@ -505,6 +591,21 @@ struct ssl_session_st {
      * to disable session caching and tickets.
      */
     int not_resumable;
+    /*
+     * Set when this session's master key was resolved from an external PSK
+     * identity (psk_find_session_cb(), or the legacy psk_server_callback())
+     * rather than from a resumption ticket or session-cache lookup.
+     * ssl_get_prev_session() uses this to exempt such sessions from sid_ctx
+     * checks that only make sense for a real cache lookup.
+     *
+     * Deliberately not part of the SSL_SESSION ASN.1 encoding: it must not
+     * survive a real ticket round-trip (a session reconstructed by
+     * d2i_SSL_SESSION() from a genuine, previously-issued ticket is by
+     * definition not an external-PSK match, and should get the ordinary
+     * sid_ctx treatment). ssl_session_dup() resets it to 0 on every copy,
+     * mirroring not_resumable just above, for the same reason.
+     */
+    int psk_external;
     /* Peer raw public key, if available */
     EVP_PKEY *peer_rpk;
     /* This is the cert and type for the other end. */
@@ -639,7 +740,6 @@ typedef struct raw_extension_st {
 } RAW_EXTENSION;

 typedef struct {
-    unsigned int isv2;
     unsigned int legacy_version;
     unsigned char random[SSL3_RANDOM_SIZE];
     size_t session_id_len;
@@ -686,12 +786,24 @@ typedef enum tlsext_index_en {
     TLSEXT_IDX_compress_certificate,
     TLSEXT_IDX_early_data,
     TLSEXT_IDX_certificate_authorities,
-    TLSEXT_IDX_padding,
+    TLSEXT_IDX_ech,
+    TLSEXT_IDX_outer_extensions,
+    TLSEXT_IDX_grease1,
+    TLSEXT_IDX_grease2,
     TLSEXT_IDX_psk,
     /* Dummy index - must always be the last entry */
     TLSEXT_IDX_num_builtins
 } TLSEXT_INDEX;

+/* RFC 8701 GREASE seed indices */
+#define OSSL_GREASE_CIPHER 0
+#define OSSL_GREASE_GROUP 1
+#define OSSL_GREASE_EXT1 2
+#define OSSL_GREASE_EXT2 3
+#define OSSL_GREASE_VERSION 4
+#define OSSL_GREASE_SIGALG 5
+#define OSSL_GREASE_LAST_INDEX 5
+
 DEFINE_LHASH_OF_EX(SSL_SESSION);
 /* Needed in ssl_cert.c */
 DEFINE_LHASH_OF_EX(X509_NAME);
@@ -718,8 +830,8 @@ typedef struct ssl_hmac_st {
 #endif
 } SSL_HMAC;

-SSL_HMAC *ssl_hmac_new(const SSL_CTX *ctx);
-void ssl_hmac_free(SSL_HMAC *ctx);
+SSL_HMAC *ssl_hmac_construct(const SSL_CTX *ctx, SSL_HMAC *hctx);
+void ssl_hmac_destruct(SSL_HMAC *ctx);
 #ifndef OPENSSL_NO_DEPRECATED_3_0
 HMAC_CTX *ssl_hmac_get0_HMAC_CTX(SSL_HMAC *ctx);
 #endif
@@ -775,19 +887,12 @@ typedef struct {
     uint32_t amask; /* authmask corresponding to key type */
 } SSL_CERT_LOOKUP;

-/* flags values */
-#define TLS_GROUP_TYPE 0x0000000FU /* Mask for group type */
-#define TLS_GROUP_CURVE_PRIME 0x00000001U
-#define TLS_GROUP_CURVE_CHAR2 0x00000002U
-#define TLS_GROUP_CURVE_CUSTOM 0x00000004U
-#define TLS_GROUP_FFDHE 0x00000008U
-#define TLS_GROUP_ONLY_FOR_TLS1_3 0x00000010U
-
-#define TLS_GROUP_FFDHE_FOR_TLS1_3 (TLS_GROUP_FFDHE | TLS_GROUP_ONLY_FOR_TLS1_3)
-
-/* We limit the number of key shares sent */
-#ifndef OPENSSL_CLIENT_MAX_KEY_SHARES
-#define OPENSSL_CLIENT_MAX_KEY_SHARES 4
+#if !defined(OPENSSL_NO_TLS1)      \
+    || !defined(OPENSSL_NO_TLS1_1) \
+    || !defined(OPENSSL_NO_TLS1_2) \
+    || !defined(OPENSSL_NO_DTLS1)  \
+    || !defined(OPENSSL_NO_DTLS1_2)
+#define OPENSSL_HAVE_TLS1PRF
 #endif

 struct ssl_ctx_st {
@@ -801,6 +906,12 @@ struct ssl_ctx_st {
     STACK_OF(SSL_CIPHER) *tls13_ciphersuites;
     struct x509_store_st /* X509_STORE */ *cert_store;
     LHASH_OF(SSL_SESSION) *sessions;
+    EVP_MAC *hmac;
+    EVP_MD *sha256;
+    EVP_CIPHER *tktenc;
+#ifdef OPENSSL_HAVE_TLS1PRF
+    EVP_KDF *tls1prf;
+#endif
     /*
      * Most session-ids that will be cached, default is
      * SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited.
@@ -894,11 +1005,8 @@ struct ssl_ctx_st {

     CRYPTO_EX_DATA ex_data;

-    const EVP_MD *md5; /* For SSLv3/TLSv1 'ssl3-md5' */
-    const EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3-sha1' */
-
     STACK_OF(X509) *extra_certs;
-    STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */
+    STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, TLSv1 */

     /* Default values used when no per-SSL value is defined follow */

@@ -973,13 +1081,6 @@ struct ssl_ctx_st {
     /* The default read buffer length to use (0 means not set) */
     size_t default_read_buf_len;

-#ifndef OPENSSL_NO_ENGINE
-    /*
-     * Engine to pass requests for client certs to
-     */
-    ENGINE *client_cert_engine;
-#endif
-
     /* ClientHello callback.  Mostly for extensions, but not entirely. */
     SSL_client_hello_cb_fn client_hello_cb;
     void *client_hello_cb_arg;
@@ -1016,10 +1117,6 @@ struct ssl_ctx_st {
         /* RFC 4366 Maximum Fragment Length Negotiation */
         uint8_t max_fragment_len_mode;

-        /* EC extension values inherited by SSL structure */
-        size_t ecpointformats_len;
-        unsigned char *ecpointformats;
-
         size_t supportedgroups_len;
         uint16_t *supportedgroups;

@@ -1076,6 +1173,9 @@ struct ssl_ctx_st {
 #endif

         unsigned char cookie_hmac_key[SHA256_DIGEST_LENGTH];
+#ifndef OPENSSL_NO_ECH
+        OSSL_ECH_CTX ech;
+#endif
     } ext;

 #ifndef OPENSSL_NO_PSK
@@ -1225,8 +1325,11 @@ typedef struct cert_pkey_st CERT_PKEY;
 #define SSL_TYPE_QUIC_XSO 0x81
 #define SSL_TYPE_QUIC_LISTENER 0x82
 #define SSL_TYPE_QUIC_DOMAIN 0x83
+#define SSL_TYPE_DTLS_LISTENER 0x01

 #define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
+#define IS_DTLS_LISTENER(ssl) \
+    ((ssl) != NULL && (ssl)->type == SSL_TYPE_DTLS_LISTENER)

 struct ssl_st {
     int type;
@@ -1250,10 +1353,17 @@ struct ssl_connection_st {
     SSL *user_ssl;

     /*
-     * protocol version (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION,
-     * DTLS1_VERSION)
+     * protocol version (one of TLS1_VERSION, TLS1_1_VERSION, TLS1_2_VERSION,
+     * TLS1_3_VERSION, DTLS1_VERSION, DTLS1_2_VERSION, DTLS1_3_VERSION)
      */
     int version;
+
+    /*
+     * The negotiated version for the connection. Initially PROTO_VERSION_UNSET.
+     * Set by ssl_set_negotiated_protocol_version().
+     */
+    int negotiated_version;
+
     /*
      * There are 2 BIO's even though they are normally both the same.  This
      * is so data can be read and written to different handlers
@@ -1346,13 +1456,15 @@ struct ssl_connection_st {
         int in_read_app_data;

         struct {
-            /* actually only need to be 16+20 for SSLv3 and 12 for TLS */
+            /* actually only need to be 12 for TLS */
             unsigned char finish_md[EVP_MAX_MD_SIZE * 2];
             size_t finish_md_len;
             unsigned char peer_finish_md[EVP_MAX_MD_SIZE * 2];
             size_t peer_finish_md_len;
             size_t message_size;
             int message_type;
+            uint64_t record_epoch;
+            uint64_t record_seq_num;
             /* used to hold the new cipher we are going to use */
             const SSL_CIPHER *new_cipher;
             EVP_PKEY *pkey; /* holds short lived key exchange key */
@@ -1370,6 +1482,7 @@ struct ssl_connection_st {
             size_t key_block_length;
             unsigned char *key_block;
             const EVP_CIPHER *new_sym_enc;
+            const EVP_CIPHER *new_sym_enc_sn;
             const EVP_MD *new_hash;
             int new_mac_pkey_type;
             size_t new_mac_secret_size;
@@ -1394,6 +1507,9 @@ struct ssl_connection_st {
             const struct sigalg_lookup_st *sigalg;
             /* Pointer to certificate we use */
             CERT_PKEY *cert;
+            /* Client identity awaiting verification */
+            STACK_OF(X509) *pending_peer_chain;
+            EVP_PKEY *pending_peer_rpk;
             /*
              * signature algorithms peer reports: e.g. supported signature
              * algorithms extension for server or as part of a certificate
@@ -1483,6 +1599,30 @@ struct ssl_connection_st {
     } s3;

     struct dtls1_state_st *d1; /* DTLSv1 variables */
+#ifndef OPENSSL_NO_DTLS
+    /* Stable alias for d1->rx while SSL_clear() resets or replaces d1. */
+    DTLS_RX *listener_rx;
+    /*
+     * Set when this connection is being driven by dtls_listener_drive_pending().
+     * Used to prevent multiple threads from driving the same connection
+     * concurrently and to allow the demux pump to be called without holding
+     * the listener mutex.
+     */
+    unsigned int listener_being_driven;
+    /*
+     * Set while the listener itself is driving this connection's handshake, to
+     * stop it blocking. The listener drives pending connections from inside its
+     * own tick, so a connection which blocked there would stop the listener
+     * making any further progress, including the progress being waited for.
+     */
+    unsigned int listener_force_nonblocking;
+    /*
+     * Set when the listener's last drive of this pending connection left it
+     * waiting for its peer, so it need not be driven again until a datagram
+     * is queued for it or its retransmission timer expires.
+     */
+    unsigned int listener_idle;
+#endif
     /* callback that allows applications to peek at protocol messages */
     void (*msg_callback)(int write_p, int version, int content_type,
         const void *buf, size_t len, SSL *ssl, void *arg);
@@ -1597,7 +1737,7 @@ struct ssl_connection_st {
     int first_packet;
     /*
      * What was passed in ClientHello.legacy_version. Used for RSA pre-master
-     * secret and SSLv3/TLS (<=1.2) rollback check
+     * secret and (D)TLS (<=1.2) rollback check
      */
     int client_version;
     /*
@@ -1628,8 +1768,6 @@ struct ssl_connection_st {
         unsigned char *scts;
         /* Length of raw extension data, if seen */
         uint16_t scts_len;
-        /* Expect OCSP CertificateStatus message */
-        int status_expected;

         struct {
             /* OCSP status request only */
@@ -1638,17 +1776,19 @@ struct ssl_connection_st {
             /* OCSP response received or to be sent */
             unsigned char *resp;
             size_t resp_len;
+            STACK_OF(OCSP_RESPONSE) *resp_ex;
         } ocsp;

-        /* RFC4507 session ticket expected to be received or sent */
-        int ticket_expected;
         /* TLS 1.3 tickets requested by the application. */
         int extra_tickets_expected;

-        /* our list */
-        size_t ecpointformats_len;
-        unsigned char *ecpointformats;
-        /* peer's list */
+        /*
+         * Peer's advertised ec_point_formats list (TLS 1.2 and below),
+         * retained as received so SSL_get0_ec_point_formats() can return
+         * it verbatim.  Point format no longer influences cert selection
+         * or acceptance; the parse hook validates RFC 4492/8422 section
+         * 5.1.2 ("uncompressed" must be present) inline.
+         */
         size_t peer_ecpointformats_len;
         unsigned char *peer_ecpointformats;

@@ -1693,19 +1833,12 @@ struct ssl_connection_st {
         /* The available PSK key exchange modes */
         int psk_kex_mode;

-        /* Set to one if we have negotiated ETM */
-        int use_etm;
-
         /* Are we expecting to receive early data? */
         int early_data;
-        /* Is the session suitable for early data? */
-        int early_data_ok;

         /* May be sent by a server in HRR. Must be echoed back in ClientHello */
         unsigned char *tls13_cookie;
         size_t tls13_cookie_len;
-        /* Have we received a cookie from the client? */
-        int cookieok;

         /*
          * Maximum Fragment Length as per RFC 4366.
@@ -1725,15 +1858,69 @@ struct ssl_connection_st {
          */
         int tick_identity;

+        /*
+         * Cached result of the resumption ticket age/lifetime check for the
+         * ClientHello under construction. Time-dependent, double-checked
+         * within the same flight (see tls13_check_tick_lifetime_hint()).
+         */
+        uint32_t tick_age_ms;
+
+        /*
+         * The first-offered PSK, the one that keys any 0-RTT, recorded while
+         * the ClientHello is built -- the resumption session when we offer it,
+         * else the external psksession; NULL when no 0-RTT is offered. Held
+         * (up-ref'd) so it stays valid across the post-ServerHello swap, and
+         * read by the binder, the early-key derivation, the early exporter and
+         * the byte-budget lookup. Freed at handshake reset and connection free.
+         */
+        SSL_SESSION *early_data_session;
+
         /* This is the list of algorithms the peer supports that we also support */
         int compress_certificate_from_peer[TLSEXT_comp_cert_limit];
-        /* indicate that we sent the extension, so we'll accept it */
-        int compress_certificate_sent;

         uint8_t client_cert_type;
         uint8_t client_cert_type_ctos;
         uint8_t server_cert_type;
         uint8_t server_cert_type_ctos;
+
+#ifndef OPENSSL_NO_ECH
+        OSSL_ECH_CONN ech;
+#endif
+
+        /* RFC 8701 GREASE */
+        uint8_t grease_seed[OSSL_GREASE_LAST_INDEX + 1];
+
+        /* "bool" fields go last, for slightly better packing */
+        bool grease_seeded;
+
+        /* Expect OCSP CertificateStatus message */
+        bool status_expected;
+
+        /* RFC4507 session ticket expected to be received or sent */
+        bool ticket_expected;
+
+        /* Set to one if we have negotiated ETM */
+        bool use_etm;
+
+        /* Is the session perhaps suitable for early data? */
+        bool early_data_ok;
+
+        /* Was the session found unsuitable for early data? */
+        bool early_data_suppressed;
+
+        /*
+         * Cached result of the resumption ticket age/lifetime check for the
+         * ClientHello under construction. Time-dependent, double-checked
+         * within the same flight (see tls13_check_tick_lifetime_hint()).
+         */
+        bool tick_age_checked;
+        bool tick_age_ok;
+
+        /* Have we received a cookie from the client? */
+        bool cookieok;
+
+        /* indicate that we sent the extension, so we'll accept it */
+        bool compress_certificate_sent;
     } ext;

     /*
@@ -1860,6 +2047,9 @@ struct ssl_connection_st {
     size_t client_cert_type_len;
     unsigned char *server_cert_type;
     size_t server_cert_type_len;
+
+    /* DTLS 1.3 needs to know when we have processed the Client/Server Hello */
+    int dtls13_process_hello;
 };

 /*
@@ -1896,6 +2086,12 @@ typedef struct sigalg_lookup_st {
     int maxdtls;
 } SIGALG_LOOKUP;

+typedef enum downgrade_en {
+    DOWNGRADE_NONE,
+    DOWNGRADE_TO_1_2,
+    DOWNGRADE_TO_1_1
+} DOWNGRADE;
+
 /* DTLS structures */

 #ifndef OPENSSL_NO_SCTP
@@ -1916,8 +2112,6 @@ struct hm_header_st {
     unsigned short seq;
     size_t frag_off;
     size_t frag_len;
-    unsigned int is_ccs;
-    struct dtls1_retransmit_state saved_retransmit_state;
 };

 typedef struct hm_fragment_st {
@@ -1929,6 +2123,11 @@ typedef struct hm_fragment_st {
 typedef struct pqueue_st pqueue;
 typedef struct pitem_st pitem;

+struct pqueue_st {
+    pitem *items;
+    int count;
+};
+
 struct pitem_st {
     unsigned char priority[8]; /* 64-bit value in big-endian encoding */
     void *data;
@@ -1938,6 +2137,7 @@ struct pitem_st {
 typedef struct pitem_st *piterator;

 pitem *pitem_new(unsigned char *prio64be, void *data);
+pitem *pitem_new_u64(uint64_t prio, void *data);
 void pitem_free(pitem *item);
 pqueue *pqueue_new(void);
 void pqueue_free(pqueue *pq);
@@ -1945,10 +2145,87 @@ pitem *pqueue_insert(pqueue *pq, pitem *item);
 pitem *pqueue_peek(pqueue *pq);
 pitem *pqueue_pop(pqueue *pq);
 pitem *pqueue_find(pqueue *pq, unsigned char *prio64be);
+pitem *pqueue_find_u64(pqueue *pq, uint64_t prio);
 pitem *pqueue_iterator(pqueue *pq);
 pitem *pqueue_next(piterator *iter);
 size_t pqueue_size(pqueue *pq);

+typedef struct dtls_msg_info_st {
+    unsigned char record_type;
+    unsigned char msg_type;
+    size_t msg_body_len;
+    unsigned short msg_seq;
+} dtls_msg_info;
+
+/* RFC 9147, section 4: a 64-bit epoch and a 64-bit sequence number. */
+#define DTLS13_RECORD_NUMBER_LEN 16
+/* RFC 9147, section 7: the ACK vector's two-byte length prefix. */
+#define DTLS13_ACK_HEADER_LEN 2
+/* A nonempty ACK contains the prefix and at least one record number. */
+#define DTLS13_ACK_MIN_NONEMPTY_LEN \
+    (DTLS13_ACK_HEADER_LEN + DTLS13_RECORD_NUMBER_LEN)
+
+/* rfc9147, section 4 */
+typedef struct dtls1_record_number_st DTLS1_RECORD_NUMBER;
+
+struct dtls1_record_number_st {
+    uint64_t epoch;
+    uint64_t seqnum;
+    /*
+     * Byte range within the message this record number's transmission
+     * covered. Only meaningful for entries on a dtls_sent_msg's rec_nums;
+     * unused (left 0) for entries on the incoming ack_rec_num list.
+     */
+    size_t frag_off;
+    size_t frag_len;
+    OSSL_LIST_MEMBER(record_number, DTLS1_RECORD_NUMBER);
+};
+
+DEFINE_LIST_OF(record_number, DTLS1_RECORD_NUMBER);
+
+DTLS1_RECORD_NUMBER *dtls1_record_number_new(uint64_t epoch, uint64_t seqnum,
+    size_t frag_off, size_t frag_len);
+
+void ossl_list_record_number_elem_free(OSSL_LIST(record_number) *p_list);
+
+typedef struct dtls_sent_msg_st {
+    dtls_msg_info msg_info;
+    OSSL_LIST(record_number)
+    rec_nums;
+    unsigned char *msg_buf;
+    /*
+     * Bitmask of msg_info.msg_body_len bytes, one bit per byte, tracking
+     * which byte ranges of the message have been acknowledged so far --
+     * across every transmission round, not just the most recent one. A
+     * trailing allocation off the end of this struct (see
+     * dtls1_sent_msg_new()), mirroring how hm_fragment tracks receive-side
+     * reassembly. NULL when msg_info.msg_body_len == 0 (nothing to cover).
+     */
+    unsigned char *covered;
+    struct dtls1_retransmit_state saved_retransmit_state;
+} dtls_sent_msg;
+
+int dtls_any_sent_messages_are_missing_acknowledge(SSL_CONNECTION *s);
+
+static ossl_inline int dtls_msg_needs_ack(int sentbyserver, unsigned char msgtype)
+{
+    switch (msgtype) {
+    case SSL3_MT_NEWSESSION_TICKET:
+    case SSL3_MT_KEY_UPDATE:
+        return 1;
+
+    case SSL3_MT_CERTIFICATE:
+    case SSL3_MT_COMPRESSED_CERTIFICATE:
+    case SSL3_MT_CERTIFICATE_VERIFY:
+    case SSL3_MT_FINISHED:
+        if (!sentbyserver)
+            return 1;
+        /* fall-through */
+    default:
+        return 0;
+    }
+}
+
 typedef struct dtls1_state_st {
     unsigned char cookie[DTLS1_COOKIE_LENGTH];
     size_t cookie_len;
@@ -1957,14 +2234,26 @@ typedef struct dtls1_state_st {
     unsigned short handshake_write_seq;
     unsigned short next_handshake_write_seq;
     unsigned short handshake_read_seq;
-    /* Buffered handshake messages */
-    pqueue *buffered_messages;
+    /* Buffered received handshake messages */
+    pqueue rcvd_messages;
     /* Buffered (sent) handshake records */
-    pqueue *sent_messages;
+    pqueue sent_messages;
+    /* Flag to indicate current HelloVerifyRequest status */
+    enum { SSL_HVR_NONE = 0,
+        SSL_HVR_RECEIVED,
+        SSL_HVR_SENT } hello_verify_request;
+    DOWNGRADE downgrade_after_hvr; /* Only used by a stateful server */
     size_t link_mtu; /* max on-the-wire DTLS packet size */
     size_t mtu; /* max DTLS packet size */
-    struct hm_header_st w_msg_hdr;
-    struct hm_header_st r_msg_hdr;
+    dtls_msg_info w_msg;
+    /*
+     * Byte range of the handshake fragment currently being written by
+     * dtls1_do_write(), read back by do_dtls1_write() (rec_layer_d1.c) when
+     * recording this write's record number on the buffered sent message.
+     */
+    size_t w_frag_off;
+    size_t w_frag_len;
+    unsigned short r_msg_seq;
     /* Number of alerts received so far */
     unsigned int timeout_num_alerts;
     /*
@@ -1975,14 +2264,225 @@ typedef struct dtls1_state_st {
     unsigned int timeout_duration_us;

     unsigned int retransmitting;
+    unsigned int has_change_cipher_spec;
 #ifndef OPENSSL_NO_SCTP
     int shutdown_received;
 #endif

+    /* Sequence numbers that are to be acknowledged */
+    OSSL_LIST(record_number)
+    ack_rec_num;
+
     DTLS_timer_cb timer_cb;

+#ifndef OPENSSL_NO_SOCK
+    /*
+     * Peer address for listener-created connections. When set, the record
+     * layer will use BIO_sendmmsg() with this address for writes instead
+     * of BIO_write(). This allows multiple connections to share the
+     * listener's network BIO.
+     */
+    BIO_ADDR peer_addr;
+#endif
+
+#ifndef OPENSSL_NO_DTLS
+    /*
+     * DTLS_RX structure is used by the DTLS Listener and
+     * contains the DGRAM_DEMUX and DGRAM_URXE_LIST of
+     * pending packets.
+     */
+    DTLS_RX *rx;
+
+    /*
+     * Reference to the parent listener for connections created via
+     * SSL_accept_connection(). This allows the connection to trigger
+     * the listener's demux pump when reading data.
+     */
+    SSL *listener;
+
+    /*
+     * Timestamp when this connection was created (for listener-created
+     * connections). Used to detect and clean up stale pending connections
+     * that haven't completed their handshake within the timeout period.
+     */
+    OSSL_TIME created_at;
+
+    /*
+     * Blocking mode requested for this connection, as a DTLS_BLOCKING_MODE.
+     * Defaults to inheriting from the listener it came from.
+     */
+    unsigned int req_blocking_mode : 2;
+#endif
+
 } DTLS1_STATE;

+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+/*
+ * Blocking mode of a DTLS listener or of a connection created from one.
+ *
+ * A connection set to INHERIT follows its listener, and a listener set to
+ * INHERIT means blocking, so blocking is the default throughout unless an
+ * application asks otherwise. This mirrors QUIC_BLOCKING_MODE.
+ */
+enum {
+    DTLS_BLOCKING_MODE_INHERIT,
+    DTLS_BLOCKING_MODE_NONBLOCKING,
+    DTLS_BLOCKING_MODE_BLOCKING
+};
+
+/*
+ * Define stack of SSL for DTLS listener incoming connections.
+ */
+DEFINE_STACK_OF(SSL)
+
+/*
+ * Default maximum number of pending connections for DTLS listeners.
+ */
+#define DTLS_LISTENER_DEFAULT_MAX_PENDING_CONNS 256
+
+/* Most drive passes over the pending connections in one listener tick */
+#define DTLS_LISTENER_MAX_DRIVE_PASSES 4
+
+/*
+ * Default maximum size in bytes of a datagram a DTLS listener will receive.
+ * A DTLS 1.3 ClientHello carrying large (e.g. post-quantum) key shares can
+ * exceed the 1500-byte Ethernet MTU; default a little above it so that such a
+ * ClientHello, when sent unfragmented, is received whole rather than truncated.
+ * Applied to the listener's demuxer.
+ */
+#define DTLS_LISTENER_DEFAULT_MAX_DGRAM_SIZE 2000
+
+/*
+ * Upper bound for the DTLS listener receive datagram size: nothing larger than
+ * the maximum UDP payload can ever arrive. It may be raised up to this ceiling
+ * via SSL_set_value_uint(SSL_VALUE_DTLS_LISTENER_MAX_DGRAM_SIZE).
+ */
+#define DTLS_LISTENER_MAX_DGRAM_SIZE 65535
+
+/*
+ * DTLS listener SSL object type. This implements the API personality
+ * layer for DTLS listener objects, providing server-side connection
+ * demultiplexing for DTLS 1.3.
+ */
+typedef struct dtls_listener_st {
+    /* SSL object common header. */
+    struct ssl_st ssl;
+
+    /*
+     * Mutex protecting listener-owned data structures accessed across threads:
+     * - pending_conns: pending connection lookup table
+     * - established_conns: established connection lookup table
+     * - incoming_connections: queue of completed connections awaiting accept
+     *
+     * Accessed from:
+     * - Listener thread: packet handling, driving handshakes
+     * - Connection thread: unregistering via SSL_free -> dtls1_free
+     */
+    CRYPTO_MUTEX *mutex;
+
+    /* Datagram demultiplexer for incoming connections. */
+    DGRAM_DEMUX *demux;
+
+    /* The network BIOs for sending and receiving datagrams. */
+    BIO *net_rbio;
+    BIO *net_wbio;
+
+    /* Queue of incoming connections awaiting accept. */
+    STACK_OF(SSL) *incoming_connections;
+
+    /*
+     * Use DGRAM_CONN_LOOKUP to find pending connections.
+     */
+    DGRAM_CONN_LOOKUP *pending_conns;
+
+    /*
+     * Use DGRAM_CONN_LOOKUP to keep track of established connections.
+     */
+    DGRAM_CONN_LOOKUP *established_conns;
+
+    /* Have we started listening yet? */
+    TSAN_QUALIFIER int listening;
+
+    /*
+     * Set by ossl_dtls_tick() when the network BIO returns a hard error.
+     * Once set, ossl_dtls_accept_connection() returns NULL immediately.
+     */
+    int fatal;
+
+    /* Require HelloVerifyRequest + cookie for DTLS 1.0/1.2 */
+    unsigned int require_hvr_cookie : 1;
+
+    /* Require HelloRetryRequest + cookie for DTLS 1.3 */
+    unsigned int require_hrr_cookie : 1;
+
+    /* Using the notifier architecture */
+    unsigned int have_notifier : 1;
+
+    /* Notifier has been signalled */
+    int signalled_notifier;
+
+    /* Advanced when the last waiter clears the notifier. */
+    uint64_t notify_generation;
+
+    /*
+     * A pending connection may have queued input that no drive pass in
+     * progress will see. Protected by mutex.
+     */
+    unsigned int pending_input;
+
+    /*
+     * Time callback for customizable time source (primarily for testing).
+     * If NULL, ossl_time_now() is used.
+     */
+    OSSL_TIME (*now_cb)(void *arg);
+    void *now_cb_arg;
+
+    /*
+     * Timeout for pending connections. Connections that haven't completed
+     * their handshake within this duration are considered stale and removed.
+     * Default: 30 seconds. Set to ossl_time_infinite() to disable.
+     */
+    OSSL_TIME pending_timeout;
+
+    /*
+     * Maximum number of listener-owned connections allowed, counting both
+     * the pending table and the accept queue.
+     * When this limit is reached, new connection attempts are rejected.
+     *
+     * Default: DTLS_LISTENER_DEFAULT_MAX_PENDING_CONNS
+     * This limit cannot be disabled.
+     */
+    size_t max_pending_conns;
+
+    /*
+     * Largest datagram the listener will receive, chosen by the application.
+     *
+     * Default: DTLS_LISTENER_DEFAULT_MAX_DGRAM_SIZE
+     */
+    size_t max_dgram_size;
+
+    CRYPTO_CONDVAR *notifier_cv;
+
+    /*
+     * Notifier for signaling events related to this listener.
+     */
+    RIO_NOTIFIER notifier;
+
+    /*
+     * Count of outstanding blocking registrations.
+     */
+    size_t cur_blocking_waiters;
+
+    /*
+     * Blocking mode requested for this listener, as a DTLS_BLOCKING_MODE.
+     * INHERIT here means blocking, there being nothing further to inherit
+     * from.
+     */
+    unsigned int req_blocking_mode : 2;
+} DTLS_LISTENER;
+
+#endif /* !OPENSSL_NO_DTLS && !OPENSSL_NO_SOCK */
+
 /*
  * From ECC-TLS draft, used in encoding the curve type in ECParameters
  */
@@ -2144,8 +2644,7 @@ typedef struct cert_st {
 } CERT;

 /*
- * This is for the SSLv3/TLSv1.0 differences in crypto/hash stuff It is a bit
- * of a mess of functions, but hell, think of it as an opaque structure :-)
+ * This is for the TLSv1.0 differences in crypto/hash stuff.
  */
 typedef struct ssl3_enc_method {
     int (*setup_key_block)(SSL_CONNECTION *);
@@ -2193,97 +2692,12 @@ typedef struct ssl3_enc_method {
  */
 #define SSL_ENC_FLAG_TLS1_2_CIPHERS 0x10

-typedef enum downgrade_en {
-    DOWNGRADE_NONE,
-    DOWNGRADE_TO_1_2,
-    DOWNGRADE_TO_1_1
-} DOWNGRADE;
-
 /*
  * Dummy status type for the status_type extension. Indicates no status type
  * set
  */
 #define TLSEXT_STATUSTYPE_nothing -1

-/* Sigalgs values */
-#define TLSEXT_SIGALG_ecdsa_secp256r1_sha256 0x0403
-#define TLSEXT_SIGALG_ecdsa_secp384r1_sha384 0x0503
-#define TLSEXT_SIGALG_ecdsa_secp521r1_sha512 0x0603
-#define TLSEXT_SIGALG_ecdsa_sha224 0x0303
-#define TLSEXT_SIGALG_ecdsa_sha1 0x0203
-#define TLSEXT_SIGALG_rsa_pss_rsae_sha256 0x0804
-#define TLSEXT_SIGALG_rsa_pss_rsae_sha384 0x0805
-#define TLSEXT_SIGALG_rsa_pss_rsae_sha512 0x0806
-#define TLSEXT_SIGALG_rsa_pss_pss_sha256 0x0809
-#define TLSEXT_SIGALG_rsa_pss_pss_sha384 0x080a
-#define TLSEXT_SIGALG_rsa_pss_pss_sha512 0x080b
-#define TLSEXT_SIGALG_rsa_pkcs1_sha256 0x0401
-#define TLSEXT_SIGALG_rsa_pkcs1_sha384 0x0501
-#define TLSEXT_SIGALG_rsa_pkcs1_sha512 0x0601
-#define TLSEXT_SIGALG_rsa_pkcs1_sha224 0x0301
-#define TLSEXT_SIGALG_rsa_pkcs1_sha1 0x0201
-#define TLSEXT_SIGALG_dsa_sha256 0x0402
-#define TLSEXT_SIGALG_dsa_sha384 0x0502
-#define TLSEXT_SIGALG_dsa_sha512 0x0602
-#define TLSEXT_SIGALG_dsa_sha224 0x0302
-#define TLSEXT_SIGALG_dsa_sha1 0x0202
-#define TLSEXT_SIGALG_gostr34102012_256_intrinsic 0x0840
-#define TLSEXT_SIGALG_gostr34102012_512_intrinsic 0x0841
-#define TLSEXT_SIGALG_gostr34102012_256_gostr34112012_256 0xeeee
-#define TLSEXT_SIGALG_gostr34102012_512_gostr34112012_512 0xefef
-#define TLSEXT_SIGALG_gostr34102001_gostr3411 0xeded
-
-#define TLSEXT_SIGALG_ed25519 0x0807
-#define TLSEXT_SIGALG_ed448 0x0808
-#define TLSEXT_SIGALG_ecdsa_brainpoolP256r1_sha256 0x081a
-#define TLSEXT_SIGALG_ecdsa_brainpoolP384r1_sha384 0x081b
-#define TLSEXT_SIGALG_ecdsa_brainpoolP512r1_sha512 0x081c
-#define TLSEXT_SIGALG_mldsa44 0x0904
-#define TLSEXT_SIGALG_mldsa65 0x0905
-#define TLSEXT_SIGALG_mldsa87 0x0906
-
-/* Sigalgs names */
-#define TLSEXT_SIGALG_ecdsa_secp256r1_sha256_name "ecdsa_secp256r1_sha256"
-#define TLSEXT_SIGALG_ecdsa_secp384r1_sha384_name "ecdsa_secp384r1_sha384"
-#define TLSEXT_SIGALG_ecdsa_secp521r1_sha512_name "ecdsa_secp521r1_sha512"
-#define TLSEXT_SIGALG_ecdsa_sha224_name "ecdsa_sha224"
-#define TLSEXT_SIGALG_ecdsa_sha1_name "ecdsa_sha1"
-#define TLSEXT_SIGALG_rsa_pss_rsae_sha256_name "rsa_pss_rsae_sha256"
-#define TLSEXT_SIGALG_rsa_pss_rsae_sha384_name "rsa_pss_rsae_sha384"
-#define TLSEXT_SIGALG_rsa_pss_rsae_sha512_name "rsa_pss_rsae_sha512"
-#define TLSEXT_SIGALG_rsa_pss_pss_sha256_name "rsa_pss_pss_sha256"
-#define TLSEXT_SIGALG_rsa_pss_pss_sha384_name "rsa_pss_pss_sha384"
-#define TLSEXT_SIGALG_rsa_pss_pss_sha512_name "rsa_pss_pss_sha512"
-#define TLSEXT_SIGALG_rsa_pkcs1_sha256_name "rsa_pkcs1_sha256"
-#define TLSEXT_SIGALG_rsa_pkcs1_sha384_name "rsa_pkcs1_sha384"
-#define TLSEXT_SIGALG_rsa_pkcs1_sha512_name "rsa_pkcs1_sha512"
-#define TLSEXT_SIGALG_rsa_pkcs1_sha224_name "rsa_pkcs1_sha224"
-#define TLSEXT_SIGALG_rsa_pkcs1_sha1_name "rsa_pkcs1_sha1"
-#define TLSEXT_SIGALG_dsa_sha256_name "dsa_sha256"
-#define TLSEXT_SIGALG_dsa_sha384_name "dsa_sha384"
-#define TLSEXT_SIGALG_dsa_sha512_name "dsa_sha512"
-#define TLSEXT_SIGALG_dsa_sha224_name "dsa_sha224"
-#define TLSEXT_SIGALG_dsa_sha1_name "dsa_sha1"
-#define TLSEXT_SIGALG_gostr34102012_256_intrinsic_name "gostr34102012_256"
-#define TLSEXT_SIGALG_gostr34102012_512_intrinsic_name "gostr34102012_512"
-#define TLSEXT_SIGALG_gostr34102012_256_intrinsic_alias "gost2012_256"
-#define TLSEXT_SIGALG_gostr34102012_512_intrinsic_alias "gost2012_512"
-#define TLSEXT_SIGALG_gostr34102012_256_gostr34112012_256_name "gost2012_256"
-#define TLSEXT_SIGALG_gostr34102012_512_gostr34112012_512_name "gost2012_512"
-#define TLSEXT_SIGALG_gostr34102001_gostr3411_name "gost2001_gost94"
-
-#define TLSEXT_SIGALG_ed25519_name "ed25519"
-#define TLSEXT_SIGALG_ed448_name "ed448"
-#define TLSEXT_SIGALG_ecdsa_brainpoolP256r1_sha256_name "ecdsa_brainpoolP256r1tls13_sha256"
-#define TLSEXT_SIGALG_ecdsa_brainpoolP384r1_sha384_name "ecdsa_brainpoolP384r1tls13_sha384"
-#define TLSEXT_SIGALG_ecdsa_brainpoolP512r1_sha512_name "ecdsa_brainpoolP512r1tls13_sha512"
-#define TLSEXT_SIGALG_ecdsa_brainpoolP256r1_sha256_alias "ecdsa_brainpoolP256r1_sha256"
-#define TLSEXT_SIGALG_ecdsa_brainpoolP384r1_sha384_alias "ecdsa_brainpoolP384r1_sha384"
-#define TLSEXT_SIGALG_ecdsa_brainpoolP512r1_sha512_alias "ecdsa_brainpoolP512r1_sha512"
-#define TLSEXT_SIGALG_mldsa44_name "mldsa44"
-#define TLSEXT_SIGALG_mldsa65_name "mldsa65"
-#define TLSEXT_SIGALG_mldsa87_name "mldsa87"
-
 /* Known PSK key exchange modes */
 #define TLSEXT_KEX_MODE_KE 0x00
 #define TLSEXT_KEX_MODE_KE_DHE 0x01
@@ -2303,9 +2717,6 @@ extern const unsigned char tls12downgrade[8];

 extern const SSL3_ENC_METHOD ssl3_undef_enc_method;

-__owur const SSL_METHOD *sslv3_method(void);
-__owur const SSL_METHOD *sslv3_server_method(void);
-__owur const SSL_METHOD *sslv3_client_method(void);
 __owur const SSL_METHOD *tlsv1_method(void);
 __owur const SSL_METHOD *tlsv1_server_method(void);
 __owur const SSL_METHOD *tlsv1_client_method(void);
@@ -2325,14 +2736,17 @@ __owur const SSL_METHOD *dtls_bad_ver_client_method(void);
 __owur const SSL_METHOD *dtlsv1_2_method(void);
 __owur const SSL_METHOD *dtlsv1_2_server_method(void);
 __owur const SSL_METHOD *dtlsv1_2_client_method(void);
+__owur const SSL_METHOD *dtlsv1_3_method(void);
+__owur const SSL_METHOD *dtlsv1_3_server_method(void);
+__owur const SSL_METHOD *dtlsv1_3_client_method(void);

 extern const SSL3_ENC_METHOD TLSv1_enc_data;
 extern const SSL3_ENC_METHOD TLSv1_1_enc_data;
 extern const SSL3_ENC_METHOD TLSv1_2_enc_data;
 extern const SSL3_ENC_METHOD TLSv1_3_enc_data;
-extern const SSL3_ENC_METHOD SSLv3_enc_data;
 extern const SSL3_ENC_METHOD DTLSv1_enc_data;
 extern const SSL3_ENC_METHOD DTLSv1_2_enc_data;
+extern const SSL3_ENC_METHOD DTLSv1_3_enc_data;

 /*
  * Flags for SSL methods
@@ -2381,46 +2795,6 @@ extern const SSL3_ENC_METHOD DTLSv1_2_enc_data;
         return &func_name##_data;                                          \
     }

-#define IMPLEMENT_ssl3_meth_func(func_name, s_accept, s_connect) \
-    const SSL_METHOD *func_name(void)                            \
-    {                                                            \
-        static const SSL_METHOD func_name##_data = {             \
-            SSL3_VERSION,                                        \
-            SSL_METHOD_NO_FIPS | SSL_METHOD_NO_SUITEB,           \
-            SSL_OP_NO_SSLv3,                                     \
-            ossl_ssl_connection_new,                             \
-            ossl_ssl_connection_free,                            \
-            ossl_ssl_connection_reset,                           \
-            ssl3_new,                                            \
-            ssl3_clear,                                          \
-            ssl3_free,                                           \
-            s_accept,                                            \
-            s_connect,                                           \
-            ssl3_read,                                           \
-            ssl3_peek,                                           \
-            ssl3_write,                                          \
-            ssl3_shutdown,                                       \
-            ssl3_renegotiate,                                    \
-            ssl3_renegotiate_check,                              \
-            ssl3_read_bytes,                                     \
-            ssl3_write_bytes,                                    \
-            ssl3_dispatch_alert,                                 \
-            ssl3_ctrl,                                           \
-            ssl3_ctx_ctrl,                                       \
-            ssl3_get_cipher_by_char,                             \
-            ssl3_put_cipher_by_char,                             \
-            ssl3_pending,                                        \
-            ssl3_num_ciphers,                                    \
-            ssl3_get_cipher,                                     \
-            ssl3_default_timeout,                                \
-            &SSLv3_enc_data,                                     \
-            ssl_undefined_void_function,                         \
-            ssl3_callback_ctrl,                                  \
-            ssl3_ctx_callback_ctrl,                              \
-        };                                                       \
-        return &func_name##_data;                                \
-    }
-
 #define IMPLEMENT_dtls1_meth_func(version, flags, mask, func_name, s_accept, \
     s_connect, enc_data)                                                     \
     const SSL_METHOD *func_name(void)                                        \
@@ -2546,6 +2920,8 @@ __owur SSL_SESSION *lookup_sess_in_cache(SSL_CONNECTION *s,
     size_t sess_id_len);
 __owur int ssl_get_prev_session(SSL_CONNECTION *s, CLIENTHELLO_MSG *hello);
 __owur SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket);
+void ossl_session_set0_peer(SSL_SESSION *sess, STACK_OF(X509) *peer_chain,
+    EVP_PKEY *peer_rpk, long verify_result);
 __owur int ssl_cipher_id_cmp(const SSL_CIPHER *a, const SSL_CIPHER *b);
 DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(SSL_CIPHER, SSL_CIPHER, ssl_cipher_id);
 __owur int ssl_cipher_ptr_id_cmp(const SSL_CIPHER *const *ap,
@@ -2556,25 +2932,28 @@ __owur STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(SSL_CTX *ctx,
     STACK_OF(SSL_CIPHER) **cipher_list_by_id,
     const char *rule_str,
     CERT *c);
-__owur int ssl_cache_cipherlist(SSL_CONNECTION *s, PACKET *cipher_suites,
-    int sslv2format);
+__owur int ssl_cache_cipherlist(SSL_CONNECTION *s, PACKET *cipher_suites);
 __owur int ossl_bytes_to_cipher_list(SSL_CONNECTION *s, PACKET *cipher_suites,
     STACK_OF(SSL_CIPHER) **skp,
-    STACK_OF(SSL_CIPHER) **scsvs, int sslv2format,
+    STACK_OF(SSL_CIPHER) **scsvs,
     int fatal);
 void ssl_update_cache(SSL_CONNECTION *s, int mode);
 __owur int ssl_cipher_get_evp_cipher(SSL_CTX *ctx, const SSL_CIPHER *sslc,
     const EVP_CIPHER **enc);
+__owur int ssl_cipher_get_evp_cipher_sn(SSL_CTX *ctx, const SSL_CIPHER *sslc,
+    const EVP_CIPHER **enc);
 __owur int ssl_cipher_get_evp_md_mac(SSL_CTX *ctx, const SSL_CIPHER *sslc,
     const EVP_MD **md,
     int *mac_pkey_type, size_t *mac_secret_size);
-__owur int ssl_cipher_get_evp(SSL_CTX *ctxc, const SSL_SESSION *s,
-    const EVP_CIPHER **enc, const EVP_MD **md,
+__owur int ssl_cipher_get_evp(SSL_CTX *ctx, const SSL_SESSION *s,
+    const EVP_CIPHER **snenc,
+    const EVP_CIPHER **enc,
+    const EVP_MD **md,
     int *mac_pkey_type, size_t *mac_secret_size,
     SSL_COMP **comp, int use_etm);
-__owur int ssl_cipher_get_overhead(const SSL_CIPHER *c, size_t *mac_overhead,
-    size_t *int_overhead, size_t *blocksize,
-    size_t *ext_overhead);
+__owur int ssl_cipher_get_overhead(const SSL_CIPHER *c, int version,
+    size_t *mac_overhead, size_t *int_overhead,
+    size_t *blocksize, size_t *ext_overhead);
 __owur int ssl_cert_is_disabled(SSL_CTX *ctx, size_t idx);
 __owur const SSL_CIPHER *ssl_get_cipher_by_char(SSL_CONNECTION *ssl,
     const unsigned char *ptr,
@@ -2618,6 +2997,13 @@ __owur STACK_OF(SSL_CIPHER) *ssl_get_ciphers_by_id(SSL_CONNECTION *sc);
 __owur int ssl_x509err2alert(int type);
 void ssl_sort_cipher_list(void);
 int ssl_load_ciphers(SSL_CTX *ctx);
+int ssl_cipher_list_to_bytes(SSL_CONNECTION *s, STACK_OF(SSL_CIPHER) *sk,
+    WPACKET *pkt);
+uint16_t ossl_grease_value(SSL_CONNECTION *s, int index);
+static ossl_inline int ossl_is_grease_value(uint16_t val)
+{
+    return (val & 0x0f0f) == 0x0a0a && (val >> 8) == (val & 0xff);
+}
 __owur int ssl_setup_sigalgs(SSL_CTX *ctx);
 int ssl_load_groups(SSL_CTX *ctx);
 int ssl_load_sigalgs(SSL_CTX *ctx);
@@ -2646,28 +3032,20 @@ __owur unsigned int ssl_get_split_send_fragment(const SSL_CONNECTION *sc);

 __owur const SSL_CIPHER *ssl3_get_cipher_by_id(uint32_t id);
 __owur const SSL_CIPHER *ssl3_get_cipher_by_std_name(const char *stdname);
+__owur const SSL_CIPHER *ssl3_get_tls13_cipher_by_std_name(const char *stdname);
 __owur const SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p);
 __owur int ssl3_put_cipher_by_char(const SSL_CIPHER *c, WPACKET *pkt,
     size_t *len);
 int ssl3_init_finished_mac(SSL_CONNECTION *s);
-__owur int ssl3_setup_key_block(SSL_CONNECTION *s);
-__owur int ssl3_change_cipher_state(SSL_CONNECTION *s, int which);
 void ssl3_cleanup_key_block(SSL_CONNECTION *s);
 __owur int ssl3_do_write(SSL_CONNECTION *s, uint8_t type);
 int ssl3_send_alert(SSL_CONNECTION *s, int level, int desc);
-__owur int ssl3_generate_master_secret(SSL_CONNECTION *s, unsigned char *out,
-    unsigned char *p, size_t len,
-    size_t *secret_size);
 __owur int ssl3_get_req_cert_type(SSL_CONNECTION *s, WPACKET *pkt);
 __owur int ssl3_num_ciphers(void);
 __owur const SSL_CIPHER *ssl3_get_cipher(unsigned int u);
 int ssl3_renegotiate(SSL *ssl);
 int ssl3_renegotiate_check(SSL *ssl, int initok);
-void ssl3_digest_master_key_set_params(const SSL_SESSION *session,
-    OSSL_PARAM params[]);
 __owur int ssl3_dispatch_alert(SSL *s);
-__owur size_t ssl3_final_finish_mac(SSL_CONNECTION *s, const char *sender,
-    size_t slen, unsigned char *p);
 __owur int ssl3_finish_mac(SSL_CONNECTION *s, const unsigned char *buf,
     size_t len);
 void ssl3_free_digest_list(SSL_CONNECTION *s);
@@ -2690,7 +3068,6 @@ __owur long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp)(void));
 __owur long ssl3_ctx_callback_ctrl(SSL_CTX *s, int cmd, void (*fp)(void));

 __owur int ssl3_do_change_cipher_spec(SSL_CONNECTION *s);
-__owur OSSL_TIME ssl3_default_timeout(void);

 __owur int ssl3_set_handshake_header(SSL_CONNECTION *s, WPACKET *pkt,
     int htype);
@@ -2717,25 +3094,23 @@ __owur int ssl_get_min_max_version(const SSL_CONNECTION *s, int *min_version,
     int *max_version, int *real_max);

 __owur OSSL_TIME tls1_default_timeout(void);
-__owur int dtls1_do_write(SSL_CONNECTION *s, uint8_t type);
-void dtls1_set_message_header(SSL_CONNECTION *s,
-    unsigned char mt,
-    size_t len,
-    size_t frag_off, size_t frag_len);
+__owur int dtls1_do_write(SSL_CONNECTION *s, uint8_t recordtype);

 int dtls1_write_app_data_bytes(SSL *s, uint8_t type, const void *buf_,
     size_t len, size_t *written);
+int dtls13_transcript_hash_update(EVP_MD_CTX *mdctx,
+    const unsigned char *buf, size_t len);

 __owur int dtls1_read_failed(SSL_CONNECTION *s, int code);
-__owur int dtls1_buffer_message(SSL_CONNECTION *s, int ccs);
-__owur int dtls1_retransmit_message(SSL_CONNECTION *s, unsigned short seq,
-    int *found);
-__owur int dtls1_get_queue_priority(unsigned short seq, int is_ccs);
-int dtls1_retransmit_buffered_messages(SSL_CONNECTION *s);
+__owur int dtls1_buffer_sent_message(SSL_CONNECTION *s, int record_type);
+__owur int dtls1_retransmit_message(SSL_CONNECTION *s, dtls_sent_msg *sent_msg);
+void dtls1_get_queue_priority(unsigned char *prio64be, unsigned short seq,
+    int record_type);
+int dtls1_retransmit_sent_messages(SSL_CONNECTION *s);
 void dtls1_clear_received_buffer(SSL_CONNECTION *s);
-void dtls1_clear_sent_buffer(SSL_CONNECTION *s);
-void dtls1_get_message_header(const unsigned char *data,
-    struct hm_header_st *msg_hdr);
+void dtls13_hellos_done(SSL_CONNECTION *s);
+void dtls1_clear_sent_buffer(SSL_CONNECTION *s, int keep_unacked_msgs);
+void dtls1_acknowledge_sent_buffer(SSL_CONNECTION *s, uint64_t before_epoch);
 __owur OSSL_TIME dtls1_default_timeout(void);
 __owur int dtls1_get_timeout(const SSL_CONNECTION *s, OSSL_TIME *timeleft);
 __owur int dtls1_check_timeout_num(SSL_CONNECTION *s);
@@ -2743,12 +3118,74 @@ __owur int dtls1_handle_timeout(SSL_CONNECTION *s);
 void dtls1_start_timer(SSL_CONNECTION *s);
 void dtls1_stop_timer(SSL_CONNECTION *s);
 __owur int dtls1_is_timer_expired(SSL_CONNECTION *s);
+void dtls1_clear_current_wrl_from_sent_buffer(SSL_CONNECTION *s);
 __owur int dtls_raw_hello_verify_request(WPACKET *pkt, unsigned char *cookie,
     size_t cookie_len);
 __owur size_t dtls1_min_mtu(SSL_CONNECTION *s);
 void dtls1_hm_fragment_free(hm_fragment *frag);
+void dtls1_sent_msg_free(dtls_sent_msg *msg);
 __owur int dtls1_query_mtu(SSL_CONNECTION *s);

+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_SOCK)
+SSL *ossl_dtls_new_listener(SSL_CTX *ctx, uint64_t flags);
+void ossl_dtls_listener_free(SSL *ssl);
+SSL *ossl_dtls_get0_listener(const SSL *ssl);
+int ossl_dtls_listen(SSL *ssl);
+SSL *ossl_dtls_accept_connection(SSL *ssl, uint64_t flags);
+void ossl_dtls_listener_set0_net_rbio(SSL *s, BIO *bio);
+void ossl_dtls_listener_set0_net_wbio(SSL *s, BIO *bio);
+BIO *ossl_dtls_listener_get_net_rbio(const SSL *s);
+BIO *ossl_dtls_listener_get_net_wbio(const SSL *s);
+
+/* Established connections API - these handle their own locking */
+SSL *ossl_dtls_listener_find_established_conn(DTLS_LISTENER *dl,
+    const DGRAM_URXE *urxe);
+void ossl_dtls_listener_unregister_established_conn(SSL *s,
+    const BIO_ADDR *peer_addr);
+void ossl_dtls_listener_clear_established_conns(DTLS_LISTENER *dl);
+
+size_t ossl_dtls_get_accept_connection_queue_len(SSL *ssl);
+int ossl_dtls_listener_set_override_now_cb(SSL *s,
+    OSSL_TIME (*now_cb)(void *arg),
+    void *now_cb_arg);
+
+int ossl_dtls_get_value_uint(SSL *s, uint32_t class_, uint32_t id, uint64_t *value);
+int ossl_dtls_set_value_uint(SSL *s, uint32_t class_, uint32_t id, uint64_t value);
+
+/* DTLS poll event functions - used by SSL_poll() */
+int ossl_dtls_listener_poll_events(SSL *s, uint64_t events, int do_tick,
+    uint64_t *revents);
+int ossl_dtls_conn_poll_events(SSL *s, uint64_t events, int do_tick,
+    uint64_t *revents);
+void ossl_dtls_listener_enter_blocking_section(SSL *s);
+void ossl_dtls_listener_leave_blocking_section(SSL *s);
+/* Deregister without waiting, then wait only for the recorded signal cycle. */
+int ossl_dtls_listener_deregister_blocking_section(SSL *s, uint64_t *generation);
+void ossl_dtls_listener_wait_for_notifier_clear(SSL *s, uint64_t generation);
+int ossl_dtls_block_until_ready(SSL *ssl, uint64_t events, OSSL_TIME deadline,
+    int bound_by_event_timeout);
+int ossl_dtls_blocking(const SSL *s);
+int ossl_dtls_set_blocking_mode(SSL *s, int blocking);
+int ossl_dtls_get_blocking_mode(const SSL *s);
+int ossl_dtls_conn_wait_for_datagram(SSL *s);
+int ossl_dtls_conn_wait_for_write(SSL *s);
+int ossl_dtls_tick(DTLS_LISTENER *dl);
+int ossl_dtls_listener_has_pending_input(SSL *s);
+
+/* DTLS Listener internal cookie callbacks */
+int ossl_dtls_listener_gen_cookie_cb(SSL *ssl, unsigned char *cookie,
+    unsigned int *cookie_len);
+int ossl_dtls_listener_verify_cookie_cb(SSL *ssl, const unsigned char *cookie,
+    unsigned int cookie_len);
+int ossl_dtls_listener_gen_stateless_cookie_cb(SSL *ssl, unsigned char *cookie,
+    size_t *cookie_len);
+int ossl_dtls_listener_verify_stateless_cookie_cb(SSL *ssl,
+    const unsigned char *cookie,
+    size_t cookie_len);
+int dtls_listener_cookie_hmac(SSL *ssl, uint64_t timestamp,
+    unsigned char *hmac_out);
+#endif /* !OPENSSL_NO_DTLS && !OPENSSL_NO_SOCK */
+
 __owur int tls1_new(SSL *s);
 void tls1_free(SSL *s);
 int tls1_clear(SSL *s);
@@ -2828,12 +3265,17 @@ __owur int tls13_export_keying_material_early(SSL_CONNECTION *s,
     size_t contextlen);
 __owur int tls1_alert_code(int code);
 __owur int tls13_alert_code(int code);
-__owur int ssl3_alert_code(int code);

 __owur int ssl_check_srvr_ecc_cert_and_alg(X509 *x, SSL_CONNECTION *s);

 SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n);

+#define TLS1_GROUPS_RETURN_NUMBER -1
+#define TLS1_GROUPS_RETURN_TMP_ID -2
+#define TLS1_GROUPS_FFDHE_GROUPS 0
+#define TLS1_GROUPS_NON_FFDHE_GROUPS 1
+#define TLS1_GROUPS_ALL_GROUPS 2
+
 __owur const TLS_GROUP_INFO *tls1_group_id_lookup(SSL_CTX *ctx, uint16_t curve_id);
 __owur const char *tls1_group_id2name(SSL_CTX *ctx, uint16_t group_id);
 __owur int tls1_group_id2nid(uint16_t group_id, int include_unknown);
@@ -2845,7 +3287,7 @@ __owur int tls1_get0_implemented_groups(int min_proto_version,
     TLS_GROUP_INFO *grps,
     size_t num, long all,
     STACK_OF(OPENSSL_CSTRING) *out);
-__owur uint16_t tls1_shared_group(SSL_CONNECTION *s, int nmatch);
+__owur uint16_t tls1_shared_group(SSL_CONNECTION *s, int nmatch, int groups);
 __owur int tls1_set_groups(uint16_t **grpext, size_t *grpextlen,
     uint16_t **ksext, size_t *ksextlen,
     size_t **tplext, size_t *tplextlen,
@@ -2857,10 +3299,11 @@ __owur int tls1_set_groups_list(SSL_CTX *ctx,
     const char *str);
 __owur EVP_PKEY *ssl_generate_pkey_group(SSL_CONNECTION *s, uint16_t id);
 __owur int tls_valid_group(SSL_CONNECTION *s, uint16_t group_id, int minversion,
-    int maxversion, int isec, int *okfortls13);
+    int maxversion, int *okfortls13, const TLS_GROUP_INFO **giptr);
 __owur EVP_PKEY *ssl_generate_param_group(SSL_CONNECTION *s, uint16_t id);
 void tls1_get_formatlist(SSL_CONNECTION *s, const unsigned char **pformats,
     size_t *num_formats);
+__owur int tls1_check_ffdhe_tmp_key(SSL_CONNECTION *s, unsigned long id);
 __owur int tls1_check_ec_tmp_key(SSL_CONNECTION *s, unsigned long id);

 __owur int tls_group_allowed(SSL_CONNECTION *s, uint16_t curve, int op);
@@ -2910,7 +3353,7 @@ int tls_choose_sigalg(SSL_CONNECTION *s, int fatalerrs);
 __owur long ssl_get_algorithm2(SSL_CONNECTION *s);
 __owur int tls12_copy_sigalgs(SSL_CONNECTION *s, WPACKET *pkt,
     const uint16_t *psig, size_t psiglen);
-__owur int tls1_save_u16(PACKET *pkt, uint16_t **pdest, size_t *pdestlen);
+__owur int tls1_save_u16(PACKET *pkt, uint16_t **pdest, size_t *pdestlen, size_t maxnum);
 __owur int tls1_save_sigalgs(SSL_CONNECTION *s, PACKET *pkt, int cert);
 __owur int tls1_process_sigalgs(SSL_CONNECTION *s);
 __owur int tls1_set_peer_legacy_sigalg(SSL_CONNECTION *s, const EVP_PKEY *pkey);
@@ -2922,7 +3365,7 @@ __owur int tls_check_sigalg_curve(const SSL_CONNECTION *s, int curve);
 __owur int tls12_check_peer_sigalg(SSL_CONNECTION *s, uint16_t, EVP_PKEY *pkey);
 __owur int ssl_set_client_disabled(SSL_CONNECTION *s);
 __owur int ssl_cipher_disabled(const SSL_CONNECTION *s, const SSL_CIPHER *c,
-    int op, int echde);
+    int op);

 __owur int ssl_handshake_hash(SSL_CONNECTION *s,
     unsigned char *out, size_t outlen,
@@ -2974,6 +3417,8 @@ __owur int srp_verify_server_param(SSL_CONNECTION *s);

 __owur int send_certificate_request(SSL_CONNECTION *s);

+OCSP_RESPONSE *ossl_get_ocsp_response(SSL_CONNECTION *s, int chainidx);
+
 /* statem/extensions_cust.c */

 custom_ext_method *custom_ext_find(const custom_ext_methods *exts,
@@ -3009,23 +3454,15 @@ void custom_exts_free(custom_ext_methods *exts);
 int ssl_ctx_system_config(SSL_CTX *ctx);

 const EVP_CIPHER *ssl_evp_cipher_fetch(OSSL_LIB_CTX *libctx,
-    int nid,
+    const char *name,
     const char *properties);
 int ssl_evp_cipher_up_ref(const EVP_CIPHER *cipher);
 void ssl_evp_cipher_free(const EVP_CIPHER *cipher);
-const EVP_MD *ssl_evp_md_fetch(OSSL_LIB_CTX *libctx,
-    int nid,
-    const char *properties);
 int ssl_evp_md_up_ref(const EVP_MD *md);
 void ssl_evp_md_free(const EVP_MD *md);

-void tls_engine_finish(ENGINE *e);
-const EVP_CIPHER *tls_get_cipher_from_engine(int nid);
-const EVP_MD *tls_get_digest_from_engine(int nid);
-int tls_engine_load_ssl_client_cert(SSL_CONNECTION *s, X509 **px509,
-    EVP_PKEY **ppkey);
-int ssl_hmac_old_new(SSL_HMAC *ret);
-void ssl_hmac_old_free(SSL_HMAC *ctx);
+SSL_HMAC *ssl_hmac_old_construct(SSL_HMAC *ret);
+void ssl_hmac_old_destruct(SSL_HMAC *ctx);
 int ssl_hmac_old_init(SSL_HMAC *ctx, void *key, size_t len, char *md);
 int ssl_hmac_old_update(SSL_HMAC *ctx, const unsigned char *data, size_t len);
 int ssl_hmac_old_final(SSL_HMAC *ctx, unsigned char *md, size_t *len);
@@ -3098,11 +3535,11 @@ long ossl_ctrl_internal(SSL *s, int cmd, long larg, void *parg, int no_quic);
  * allowed but ignored under QUIC.
  */
 #define OSSL_TLS1_2_OPTIONS \
-    (SSL_OP_CRYPTOPRO_TLSEXT_BUG | SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS | SSL_OP_ALLOW_CLIENT_RENEGOTIATION | SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION | SSL_OP_NO_COMPRESSION | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2 | SSL_OP_NO_DTLSv1 | SSL_OP_NO_DTLSv1_2 | SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION | SSL_OP_CISCO_ANYCONNECT | SSL_OP_NO_RENEGOTIATION | SSL_OP_NO_EXTENDED_MASTER_SECRET | SSL_OP_NO_ENCRYPT_THEN_MAC | SSL_OP_COOKIE_EXCHANGE | SSL_OP_LEGACY_SERVER_CONNECT | SSL_OP_IGNORE_UNEXPECTED_EOF)
+    (SSL_OP_CRYPTOPRO_TLSEXT_BUG | SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS | SSL_OP_ALLOW_CLIENT_RENEGOTIATION | SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION | SSL_OP_NO_COMPRESSION | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2 | SSL_OP_NO_DTLSv1 | SSL_OP_NO_DTLSv1_2 | SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION | SSL_OP_CISCO_ANYCONNECT | SSL_OP_NO_RENEGOTIATION | SSL_OP_NO_EXTENDED_MASTER_SECRET | SSL_OP_NO_ENCRYPT_THEN_MAC | SSL_OP_COOKIE_EXCHANGE | SSL_OP_LEGACY_SERVER_CONNECT | SSL_OP_IGNORE_UNEXPECTED_EOF)

 /* Total mask of connection-level options permitted or ignored under QUIC. */
 #define OSSL_QUIC_PERMITTED_OPTIONS_CONN \
-    (OSSL_LEGACY_SSL_OPTIONS | OSSL_TLS1_2_OPTIONS | SSL_OP_CIPHER_SERVER_PREFERENCE | SSL_OP_DISABLE_TLSEXT_CA_NAMES | SSL_OP_NO_TX_CERTIFICATE_COMPRESSION | SSL_OP_NO_RX_CERTIFICATE_COMPRESSION | SSL_OP_PRIORITIZE_CHACHA | SSL_OP_NO_QUERY_MTU | SSL_OP_NO_TICKET | SSL_OP_NO_ANTI_REPLAY)
+    (OSSL_LEGACY_SSL_OPTIONS | OSSL_TLS1_2_OPTIONS | SSL_OP_SERVER_PREFERENCE | SSL_OP_DISABLE_TLSEXT_CA_NAMES | SSL_OP_NO_TX_CERTIFICATE_COMPRESSION | SSL_OP_NO_RX_CERTIFICATE_COMPRESSION | SSL_OP_PRIORITIZE_CHACHA | SSL_OP_NO_QUERY_MTU | SSL_OP_NO_TICKET | SSL_OP_NO_ANTI_REPLAY)

 /* Total mask of stream-level options permitted or ignored under QUIC. */
 #define OSSL_QUIC_PERMITTED_OPTIONS_STREAM \
diff --git a/deps/openssl/openssl/ssl/ssl_mcnf.c b/deps/openssl/openssl/ssl/ssl_mcnf.c
index 14e1f9f5d7b..cf073bfb40c 100644
--- a/deps/openssl/openssl/ssl/ssl_mcnf.c
+++ b/deps/openssl/openssl/ssl/ssl_mcnf.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -10,8 +10,10 @@
 #include <stdio.h>
 #include <openssl/conf.h>
 #include <openssl/ssl.h>
+#include <openssl/trace.h>
 #include "ssl_local.h"
 #include "internal/sslconf.h"
+#include "internal/cryptlib.h"

 /* SSL library configuration module. */

@@ -20,6 +22,17 @@ void SSL_add_ssl_module(void)
     /* Do nothing. This will be added automatically by libcrypto */
 }

+static CONF_IMODULE *ssl_do_lookup_module(OSSL_LIB_CTX *libctx)
+{
+    CONF_IMODULE *m = OSSL_LIB_CTX_get_data(libctx, OSSL_LIB_CTX_SSL_CONF_IMODULE);
+
+    if (m != NULL)
+        return m;
+
+    libctx = OSSL_LIB_CTX_get0_global_default();
+    return OSSL_LIB_CTX_get_data(libctx, OSSL_LIB_CTX_SSL_CONF_IMODULE);
+}
+
 static int ssl_do_config(SSL *s, SSL_CTX *ctx, const char *name, int system)
 {
     SSL_CONF_CTX *cctx = NULL;
@@ -29,32 +42,45 @@ static int ssl_do_config(SSL *s, SSL_CTX *ctx, const char *name, int system)
     unsigned int conf_diagnostics = 0;
     const SSL_METHOD *meth;
     const SSL_CONF_CMD *cmds;
-    OSSL_LIB_CTX *prev_libctx = NULL;
-    OSSL_LIB_CTX *libctx = NULL;
+    OSSL_LIB_CTX *libctx = NULL, *prev_libctx = NULL;
+    CONF_IMODULE *imod = NULL;
+
+    ERR_set_mark();

     if (s == NULL && ctx == NULL) {
         ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
         goto err;
     }
-
     if (name == NULL && system)
         name = "system_default";
-    if (!conf_ssl_name_find(name, &idx)) {
+
+    if (name == NULL) {
+        ERR_raise_data(ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME,
+            "name not specified (name == NULL)");
+        goto err;
+    }
+
+    libctx = s != NULL ? s->ctx->libctx : ctx->libctx;
+    imod = ssl_do_lookup_module(libctx);
+    if (!conf_ssl_name_find(imod, name, &idx)) {
         if (!system)
             ERR_raise_data(ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME,
                 "name=%s", name);
         goto err;
     }
-    cmds = conf_ssl_get(idx, &name, &cmd_count);
+
+    cmds = conf_ssl_get(imod, idx, &name, &cmd_count);
+    flags = SSL_CONF_FLAG_FILE;
+    if (!system)
+        flags |= SSL_CONF_FLAG_CERTIFICATE | SSL_CONF_FLAG_REQUIRE_PRIVATE;
+
     cctx = SSL_CONF_CTX_new();
     if (cctx == NULL) {
         /* this is a fatal error, always report */
         system = 0;
         goto err;
     }
-    flags = SSL_CONF_FLAG_FILE;
-    if (!system)
-        flags |= SSL_CONF_FLAG_CERTIFICATE | SSL_CONF_FLAG_REQUIRE_PRIVATE;
+
     if (s != NULL) {
         meth = s->method;
         SSL_CONF_CTX_set_ssl(cctx, s);
@@ -64,6 +90,7 @@ static int ssl_do_config(SSL *s, SSL_CTX *ctx, const char *name, int system)
         SSL_CONF_CTX_set_ssl_ctx(cctx, ctx);
         libctx = ctx->libctx;
     }
+
     conf_diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
     if (conf_diagnostics)
         flags |= SSL_CONF_FLAG_SHOW_ERRORS;
@@ -88,7 +115,20 @@ static int ssl_do_config(SSL *s, SSL_CTX *ctx, const char *name, int system)
 err:
     OSSL_LIB_CTX_set0_default(prev_libctx);
     SSL_CONF_CTX_free(cctx);
-    return err == 0 || (system && !conf_diagnostics);
+    if (err == 0) {
+        ERR_pop_to_mark();
+        return 1;
+    }
+    if (system && !conf_diagnostics) {
+        /*
+         * Discard errors so that SSL_CTX_new does not return
+         * success with stale errors on the error stack.
+         */
+        ERR_pop_to_mark();
+        return 1;
+    }
+    ERR_clear_last_mark();
+    return 0;
 }

 int SSL_config(SSL *s, const char *name)
diff --git a/deps/openssl/openssl/ssl/ssl_rsa.c b/deps/openssl/openssl/ssl/ssl_rsa.c
index 42958d9d0c2..52f19b00423 100644
--- a/deps/openssl/openssl/ssl/ssl_rsa.c
+++ b/deps/openssl/openssl/ssl/ssl_rsa.c
@@ -908,7 +908,7 @@ int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file)
                 break;
         }
         /* Check that PEM name starts with "BEGIN SERVERINFO FOR " */
-        name_len = strlen(name);
+        name_len = (unsigned int)strlen(name);
         if (name_len < sizeof(NAME_PREFIX1) - 1) {
             ERR_raise(ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT);
             goto end;
diff --git a/deps/openssl/openssl/ssl/ssl_sess.c b/deps/openssl/openssl/ssl/ssl_sess.c
index 04cbfa5cfa9..7a74b5bbefd 100644
--- a/deps/openssl/openssl/ssl/ssl_sess.c
+++ b/deps/openssl/openssl/ssl/ssl_sess.c
@@ -14,7 +14,6 @@
 #endif
 #include <stdio.h>
 #include <openssl/rand.h>
-#include <openssl/engine.h>
 #include "internal/refcount.h"
 #include "internal/cryptlib.h"
 #include "internal/ssl_unwrap.h"
@@ -23,7 +22,7 @@

 static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *s);
 static void SSL_SESSION_list_add(SSL_CTX *ctx, SSL_SESSION *s);
-static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck);
+static SSL_SESSION *remove_session_locked(SSL_CTX *ctx, SSL_SESSION *c);

 DEFINE_STACK_OF(SSL_SESSION)

@@ -62,7 +61,7 @@ void ssl_session_calculate_timeout(SSL_SESSION *ss)
 SSL_SESSION *SSL_get_session(const SSL *ssl)
 /* aka SSL_get0_session; gets 0 objects, just returns a copy of the pointer */
 {
-    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl);
+    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(ssl);

     if (sc == NULL)
         return NULL;
@@ -280,8 +279,16 @@ SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket)
 {
     SSL_SESSION *sess = ssl_session_dup_intern(src, ticket);

-    if (sess != NULL)
+    if (sess != NULL) {
         sess->not_resumable = 0;
+        /*
+         * A duplicated session can land in the stateful session cache, and is
+         * not necessarily a live session just built for an external PSK.  The
+         * caller must explicitly set this field non-zero after duplication as
+         * needed.
+         */
+        sess->psk_external = 0;
+    }

     return sess;
 }
@@ -307,7 +314,7 @@ unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s)
 }

 /*
- * SSLv3/TLSv1 has 32 bytes (256 bits) of session ID space. As such, filling
+ * TLSv1 has 32 bytes (256 bits) of session ID space. As such, filling
  * the ID with random junk repeatedly until we have no conflict is going to
  * complete in one iteration pretty much "most" of the time (btw:
  * understatement). So, if it takes us 10 iterations and we still can't avoid
@@ -352,7 +359,6 @@ int ssl_generate_session_id(SSL_CONNECTION *s, SSL_SESSION *ss)
     SSL *ssl = SSL_CONNECTION_GET_SSL(s);

     switch (s->version) {
-    case SSL3_VERSION:
     case TLS1_VERSION:
     case TLS1_1_VERSION:
     case TLS1_2_VERSION:
@@ -360,6 +366,7 @@ int ssl_generate_session_id(SSL_CONNECTION *s, SSL_SESSION *ss)
     case DTLS1_BAD_VER:
     case DTLS1_VERSION:
     case DTLS1_2_VERSION:
+    case DTLS1_3_VERSION:
         ss->session_id_length = SSL3_SSL_SESSION_ID_LENGTH;
         break;
     default:
@@ -388,8 +395,10 @@ int ssl_generate_session_id(SSL_CONNECTION *s, SSL_SESSION *ss)
     }

     /* Choose which callback will set the session ID */
-    if (!CRYPTO_THREAD_read_lock(SSL_CONNECTION_GET_SSL(s)->lock))
+    if (!CRYPTO_THREAD_read_lock(SSL_CONNECTION_GET_SSL(s)->lock)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return 0;
+    }
     if (!CRYPTO_THREAD_read_lock(s->session_ctx->lock)) {
         CRYPTO_THREAD_unlock(ssl->lock);
         SSLfatal(s, SSL_AD_INTERNAL_ERROR,
@@ -454,7 +463,7 @@ int ssl_get_new_session(SSL_CONNECTION *s, int session)
     s->session = NULL;

     if (session) {
-        if (SSL_CONNECTION_IS_TLS13(s)) {
+        if (SSL_CONNECTION_IS_VERSION13(s)) {
             /*
              * We generate the session id while constructing the
              * NewSessionTicket in TLSv1.3.
@@ -525,7 +534,7 @@ SSL_SESSION *lookup_sess_in_cache(SSL_CONNECTION *s,
         int copy = 1;

         ret = s->session_ctx->get_session_cb(SSL_CONNECTION_GET_USER_SSL(s),
-            sess_id, sess_id_len, &copy);
+            sess_id, (int)sess_id_len, &copy);

         if (ret != NULL) {
             if (ret->not_resumable) {
@@ -591,7 +600,7 @@ int ssl_get_prev_session(SSL_CONNECTION *s, CLIENTHELLO_MSG *hello)
     int try_session_cache = 0;
     SSL_TICKET_STATUS r;

-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         SSL_SESSION_free(s->session);
         s->session = NULL;
         /*
@@ -650,7 +659,13 @@ int ssl_get_prev_session(SSL_CONNECTION *s, CLIENTHELLO_MSG *hello)
         goto err; /* treat like cache miss */
     }

-    if ((s->verify_mode & SSL_VERIFY_PEER) && s->sid_ctx_length == 0) {
+    /*
+     * sid_ctx exists to keep multiple services that happen to share one
+     * session cache from resuming each other's sessions.  This check is not
+     * relevant to external PSK sessions that are not restored from a cache.
+     */
+    if (!ret->psk_external
+        && (s->verify_mode & SSL_VERIFY_PEER) && s->sid_ctx_length == 0) {
         /*
          * We can't be sure if this session is being used out of context,
          * which is especially important for SSL_VERIFY_PEER. The application
@@ -689,12 +704,38 @@ int ssl_get_prev_session(SSL_CONNECTION *s, CLIENTHELLO_MSG *hello)
         goto err;
     }

-    if (!SSL_CONNECTION_IS_TLS13(s)) {
-        /* We already did this for TLS1.3 */
+    if (!SSL_CONNECTION_IS_VERSION13(s)) {
+        /* We already did this for (D)TLS1.3 */
         SSL_SESSION_free(s->session);
         s->session = ret;
     }

+    /*
+     * Explicit comparison between the session ID the client offered in
+     * ClientHello and the session ID embedded in the SSL_SESSION returned by
+     * the external cache. If they do not match, the cached session is released
+     * and ssl_get_prev_session() returns as a cache miss, forcing a full
+     * handshake. The check is placed in ssl_get_prev_session() rather than a
+     * later callback because this is the earliest point where both values are
+     * available simultaneously, before any ServerHello is composed.
+     * Catching the mismatch here ensures the server never sends a ServerHello
+     * that claims resumption of a session ID it cannot legitimately echo.
+     *
+     * A mismatch unambiguously indicates one of:
+     *   - a corrupt cache entry
+     *   - an external cache implementation that returned the wrong session
+     *   - an active tampering attempt
+     *
+     * Refusing resumption and falling back to a full handshake is the correct
+     * response.
+     */
+    if (!SSL_CONNECTION_IS_VERSION13(s) && hello->session_id_len > 0
+        && (s->session->session_id_length != hello->session_id_len
+            || memcmp(s->session->session_id, hello->session_id,
+                   hello->session_id_len)
+                != 0)) {
+        return 0;
+    }
     ssl_tsan_counter(s->session_ctx, &s->session_ctx->stats.sess_hit);
     s->verify_result = s->session->verify_result;
     return 1;
@@ -702,8 +743,8 @@ int ssl_get_prev_session(SSL_CONNECTION *s, CLIENTHELLO_MSG *hello)
 err:
     if (ret != NULL) {
         SSL_SESSION_free(ret);
-        /* In TLSv1.3 s->session was already set to ret, so we NULL it out */
-        if (SSL_CONNECTION_IS_TLS13(s))
+        /* In (D)TLSv1.3 s->session was already set to ret, so we NULL it out */
+        if (SSL_CONNECTION_IS_VERSION13(s))
             s->session = NULL;

         if (!try_session_cache) {
@@ -774,6 +815,14 @@ int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c)
         ssl_session_calculate_timeout(c);
     }

+    /*
+     * evicted_head is a singly-linked list (via the next pointer, which
+     * SSL_SESSION_list_remove zeroes out) of sessions evicted from the cache
+     * that need their remove_session_cb called and their reference dropped
+     * once the lock is released.
+     */
+    SSL_SESSION *evicted_head = NULL;
+
     if (s == NULL) {
         /*
          * new cache entry -- remove old ones if cache has become too large
@@ -784,10 +833,13 @@ int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c)

         if (SSL_CTX_sess_get_cache_size(ctx) > 0) {
             while (SSL_CTX_sess_number(ctx) >= SSL_CTX_sess_get_cache_size(ctx)) {
-                if (!remove_session_lock(ctx, ctx->session_cache_tail, 0))
+                SSL_SESSION *r = remove_session_locked(ctx, ctx->session_cache_tail);
+
+                if (r == NULL)
                     break;
-                else
-                    ssl_tsan_counter(ctx, &ctx->stats.sess_cache_full);
+                ssl_tsan_counter(ctx, &ctx->stats.sess_cache_full);
+                r->next = evicted_head;
+                evicted_head = r;
             }
         }

@@ -804,41 +856,59 @@ int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c)
         ret = 0;
     }
     CRYPTO_THREAD_unlock(ctx->lock);
+
+    while (evicted_head != NULL) {
+        SSL_SESSION *next = evicted_head->next;
+
+        evicted_head->next = NULL;
+        if (ctx->remove_session_cb != NULL)
+            ctx->remove_session_cb(ctx, evicted_head);
+        SSL_SESSION_free(evicted_head);
+        evicted_head = next;
+    }
+
     return ret;
 }

 int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
 {
-    return remove_session_lock(ctx, c, 1);
+    SSL_SESSION *r;
+
+    if (c == NULL || c->session_id_length == 0)
+        return 0;
+    if (!CRYPTO_THREAD_write_lock(ctx->lock))
+        return 0;
+    r = remove_session_locked(ctx, c);
+    CRYPTO_THREAD_unlock(ctx->lock);
+
+    /*
+     * The callback is invoked even when the session is not in the internal
+     * cache so that external caches can be notified.
+     */
+    if (ctx->remove_session_cb != NULL)
+        ctx->remove_session_cb(ctx, c);
+    SSL_SESSION_free(r);
+    return r != NULL;
 }

-static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
+/*
+ * Removes c from the session cache. Caller must hold ctx->lock.
+ * Returns the removed session (caller must invoke remove_session_cb and
+ * SSL_SESSION_free), or NULL if not found.
+ */
+static SSL_SESSION *remove_session_locked(SSL_CTX *ctx, SSL_SESSION *c)
 {
-    SSL_SESSION *r;
-    int ret = 0;
+    SSL_SESSION *r = NULL;

-    if ((c != NULL) && (c->session_id_length != 0)) {
-        if (lck) {
-            if (!CRYPTO_THREAD_write_lock(ctx->lock))
-                return 0;
-        }
-        if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) != NULL) {
-            ret = 1;
+    if (c != NULL && c->session_id_length != 0) {
+        r = lh_SSL_SESSION_retrieve(ctx->sessions, c);
+        if (r != NULL) {
             r = lh_SSL_SESSION_delete(ctx->sessions, r);
             SSL_SESSION_list_remove(ctx, r);
         }
         c->not_resumable = 1;
-
-        if (lck)
-            CRYPTO_THREAD_unlock(ctx->lock);
-
-        if (ctx->remove_session_cb != NULL)
-            ctx->remove_session_cb(ctx, c);
-
-        if (ret)
-            SSL_SESSION_free(r);
     }
-    return ret;
+    return r;
 }

 void SSL_SESSION_free(SSL_SESSION *ss)
@@ -879,7 +949,7 @@ int SSL_SESSION_up_ref(SSL_SESSION *ss)
 {
     int i;

-    if (CRYPTO_UP_REF(&ss->references, &i) <= 0)
+    if (!CRYPTO_UP_REF(&ss->references, &i))
         return 0;

     REF_PRINT_COUNT("SSL_SESSION", i, ss);
@@ -1097,6 +1167,23 @@ X509 *SSL_SESSION_get0_peer(SSL_SESSION *s)
     return s->peer;
 }

+/*
+ * Replace the client identity in an unshared session, taking ownership of the
+ * supplied chain or RPK. The server keeps the leaf separately from its issuers.
+ */
+void ossl_session_set0_peer(SSL_SESSION *sess, STACK_OF(X509) *peer_chain,
+    EVP_PKEY *peer_rpk, long verify_result)
+{
+    X509_free(sess->peer);
+    OSSL_STACK_OF_X509_free(sess->peer_chain);
+    EVP_PKEY_free(sess->peer_rpk);
+
+    sess->peer = peer_chain == NULL ? NULL : sk_X509_shift(peer_chain);
+    sess->peer_chain = peer_chain;
+    sess->peer_rpk = peer_rpk;
+    sess->verify_result = verify_result;
+}
+
 EVP_PKEY *SSL_SESSION_get0_peer_rpk(SSL_SESSION *s)
 {
     return s->peer_rpk;
@@ -1174,30 +1261,24 @@ int SSL_set_session_ticket_ext_cb(SSL *s, tls_session_ticket_ext_cb_fn cb,
 int SSL_set_session_ticket_ext(SSL *s, void *ext_data, int ext_len)
 {
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
-
-    if (sc == NULL)
+    if (sc == NULL || ext_len < 0 || ext_len > 0xffff)
         return 0;
-
-    if (sc->version >= TLS1_VERSION) {
-        OPENSSL_free(sc->ext.session_ticket);
-        sc->ext.session_ticket = NULL;
+    OPENSSL_free(sc->ext.session_ticket);
+    if (ext_data != NULL) {
         sc->ext.session_ticket = OPENSSL_malloc(sizeof(TLS_SESSION_TICKET_EXT) + ext_len);
         if (sc->ext.session_ticket == NULL)
             return 0;
-
-        if (ext_data != NULL) {
-            sc->ext.session_ticket->length = ext_len;
-            sc->ext.session_ticket->data = sc->ext.session_ticket + 1;
-            memcpy(sc->ext.session_ticket->data, ext_data, ext_len);
-        } else {
-            sc->ext.session_ticket->length = 0;
-            sc->ext.session_ticket->data = NULL;
-        }
-
-        return 1;
+        sc->ext.session_ticket->length = ext_len;
+        sc->ext.session_ticket->data = sc->ext.session_ticket + 1;
+        memcpy(sc->ext.session_ticket->data, ext_data, ext_len);
+    } else {
+        sc->ext.session_ticket = OPENSSL_malloc(sizeof(TLS_SESSION_TICKET_EXT));
+        if (sc->ext.session_ticket == NULL)
+            return 0;
+        sc->ext.session_ticket->data = NULL;
+        sc->ext.session_ticket->length = 0;
     }
-
-    return 0;
+    return 1;
 }

 #ifndef OPENSSL_NO_DEPRECATED_3_4
@@ -1224,9 +1305,10 @@ void SSL_CTX_flush_sessions_ex(SSL_CTX *s, time_t t)
     /*
      * Iterate over the list from the back (oldest), and stop
      * when a session can no longer be removed.
-     * Add the session to a temporary list to be freed outside
-     * the SSL_CTX lock.
-     * But still do the remove_session_cb() within the lock.
+     * Collect removed sessions on a stack to be processed outside the lock,
+     * so that remove_session_cb is never invoked while holding ctx->lock.
+     * If the stack failed to create, or a push fails, free the session
+     * immediately (without invoking the callback).
      */
     while (s->session_cache_tail != NULL) {
         current = s->session_cache_tail;
@@ -1234,15 +1316,6 @@ void SSL_CTX_flush_sessions_ex(SSL_CTX *s, time_t t)
             lh_SSL_SESSION_delete(s->sessions, current);
             SSL_SESSION_list_remove(s, current);
             current->not_resumable = 1;
-            if (s->remove_session_cb != NULL)
-                s->remove_session_cb(s, current);
-            /*
-             * Throw the session on a stack, it's entirely plausible
-             * that while freeing outside the critical section, the
-             * session could be re-added, so avoid using the next/prev
-             * pointers. If the stack failed to create, or the session
-             * couldn't be put on the stack, just free it here
-             */
             if (sk == NULL || !sk_SSL_SESSION_push(sk, current))
                 SSL_SESSION_free(current);
         } else {
@@ -1253,7 +1326,13 @@ void SSL_CTX_flush_sessions_ex(SSL_CTX *s, time_t t)
     lh_SSL_SESSION_set_down_load(s->sessions, i);
     CRYPTO_THREAD_unlock(s->lock);

-    sk_SSL_SESSION_pop_free(sk, SSL_SESSION_free);
+    while (sk_SSL_SESSION_num(sk) > 0) {
+        current = sk_SSL_SESSION_pop(sk);
+        if (s->remove_session_cb != NULL)
+            s->remove_session_cb(s, current);
+        SSL_SESSION_free(current);
+    }
+    sk_SSL_SESSION_free(sk);
 }

 int ssl_clear_bad_session(SSL_CONNECTION *s)
diff --git a/deps/openssl/openssl/ssl/ssl_stat.c b/deps/openssl/openssl/ssl/ssl_stat.c
index d6ba000c65d..a909c546f47 100644
--- a/deps/openssl/openssl/ssl/ssl_stat.c
+++ b/deps/openssl/openssl/ssl/ssl_stat.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2005 Nokia. All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -124,6 +124,14 @@ const char *SSL_state_string_long(const SSL *s)
         return "TLSv1.3 write end of early data";
     case TLS_ST_SR_END_OF_EARLY_DATA:
         return "TLSv1.3 read end of early data";
+    case TLS_ST_CR_ACK:
+        return "DTLSv1.3 read client ack";
+    case TLS_ST_CW_ACK:
+        return "DTLSv1.3 write client ack";
+    case TLS_ST_SR_ACK:
+        return "DTLSv1.3 read server ack";
+    case TLS_ST_SW_ACK:
+        return "DTLSv1.3 write server ack";
     default:
         return "unknown state";
     }
@@ -241,6 +249,14 @@ const char *SSL_state_string(const SSL *s)
         return "TWEOED";
     case TLS_ST_SR_END_OF_EARLY_DATA:
         return "TWEOED";
+    case TLS_ST_CR_ACK:
+        return "TRCACK";
+    case TLS_ST_CW_ACK:
+        return "TWCACK";
+    case TLS_ST_SR_ACK:
+        return "TRSACK";
+    case TLS_ST_SW_ACK:
+        return "TWSACK";
     default:
         return "UNKWN";
     }
@@ -333,6 +349,10 @@ const char *SSL_alert_desc_string(int value)
         return "BH";
     case TLS1_AD_UNKNOWN_PSK_IDENTITY:
         return "UP";
+#ifndef OPENSSL_NO_ECH
+    case TLS1_AD_ECH_REQUIRED:
+        return "RR";
+#endif
     default:
         return "UK";
     }
@@ -403,6 +423,10 @@ const char *SSL_alert_desc_string_long(int value)
         return "unknown PSK identity";
     case TLS1_AD_NO_APPLICATION_PROTOCOL:
         return "no application protocol";
+#ifndef OPENSSL_NO_ECH
+    case TLS1_AD_ECH_REQUIRED:
+        return "ECH required";
+#endif
     default:
         return "unknown";
     }
diff --git a/deps/openssl/openssl/ssl/ssl_txt.c b/deps/openssl/openssl/ssl/ssl_txt.c
index aeb03bfeb2b..530e339a9f7 100644
--- a/deps/openssl/openssl/ssl/ssl_txt.c
+++ b/deps/openssl/openssl/ssl/ssl_txt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2005 Nokia. All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -35,11 +35,12 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
 {
     size_t i;
     const char *s;
-    int istls13;
+    int isversion13;

     if (x == NULL)
         goto err;
-    istls13 = (x->ssl_version == TLS1_3_VERSION);
+    isversion13 = (x->ssl_version == TLS1_3_VERSION)
+        || (x->ssl_version == DTLS1_3_VERSION);
     if (BIO_puts(bp, "SSL-Session:\n") <= 0)
         goto err;
     s = ssl_protocol_to_string(x->ssl_version);
@@ -77,7 +78,7 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
         if (BIO_printf(bp, "%02X", x->sid_ctx[i]) <= 0)
             goto err;
     }
-    if (istls13) {
+    if (isversion13) {
         if (BIO_puts(bp, "\n    Resumption PSK: ") <= 0)
             goto err;
     } else if (BIO_puts(bp, "\n    Master-Key: ") <= 0)
@@ -104,7 +105,7 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
 #endif
     if (x->ext.tick_lifetime_hint) {
         if (BIO_printf(bp,
-                "\n    TLS session ticket lifetime hint: %ld (seconds)",
+                "\n    TLS session ticket lifetime hint: %lu (seconds)",
                 x->ext.tick_lifetime_hint)
             <= 0)
             goto err;
@@ -120,10 +121,10 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
     if (x->compress_meth != 0) {
         SSL_COMP *comp = NULL;

-        if (!ssl_cipher_get_evp(NULL, x, NULL, NULL, NULL, NULL, &comp, 0))
+        if (!ssl_cipher_get_evp(NULL, x, NULL, NULL, NULL, NULL, NULL, &comp, 0))
             goto err;
         if (comp == NULL) {
-            if (BIO_printf(bp, "\n    Compression: %d", x->compress_meth) <= 0)
+            if (BIO_printf(bp, "\n    Compression: %u", x->compress_meth) <= 0)
                 goto err;
         } else {
             if (BIO_printf(bp, "\n    Compression: %d (%s)", comp->id,
@@ -160,7 +161,7 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
         <= 0)
         goto err;

-    if (istls13) {
+    if (isversion13) {
         if (BIO_printf(bp, "    Max Early Data: %u\n",
                 (unsigned int)x->ext.max_early_data)
             <= 0)
diff --git a/deps/openssl/openssl/ssl/ssl_utst.c b/deps/openssl/openssl/ssl/ssl_utst.c
index 91be7398cae..c562090126d 100644
--- a/deps/openssl/openssl/ssl/ssl_utst.c
+++ b/deps/openssl/openssl/ssl/ssl_utst.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2014-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,6 +7,9 @@
  * https://www.openssl.org/source/license.html
  */

+/* SSL_test_functions() is deprecated but still needs to be implemented */
+#include "internal/deprecated.h"
+
 #include "ssl_local.h"

 #ifndef OPENSSL_NO_UNIT_TEST
diff --git a/deps/openssl/openssl/ssl/statem/extensions.c b/deps/openssl/openssl/ssl/statem/extensions.c
index 13846bc1159..126c68d2041 100644
--- a/deps/openssl/openssl/ssl/statem/extensions.c
+++ b/deps/openssl/openssl/ssl/statem/extensions.c
@@ -18,12 +18,47 @@
 #include "internal/ssl_unwrap.h"
 #include "../ssl_local.h"
 #include "statem_local.h"
+#include <openssl/ocsp.h>
+#include <openssl/core_names.h>
+
+/*
+ * values for ext_defs ech_handling field
+ * exceptionally, we don't conditionally compile that field to avoid a pile of
+ * ifndefs all over the ext_defs values
+ */
+#define OSSL_ECH_HANDLING_CALL_BOTH 1 /* call constructor both times */
+#define OSSL_ECH_HANDLING_COMPRESS 2 /* compress outer value into inner */
+#define OSSL_ECH_HANDLING_DUPLICATE 3 /* same value in inner and outer */
+/*
+ * DUPLICATE isn't really useful other than to show we can,
+ * and for debugging/tests/coverage so may disappear. Changes mostly
+ * won't affect the outer CH size, due to padding, but might for some
+ * larger extensions.
+ *
+ * Note there is a co-dependency with test/recipes/75-test_quicapi.t:
+ * If you change an |ech_handling| value, that may well affect the order
+ * of extensions in a ClientHello, which is reflected in the test data
+ * in test/recipes/75-test_quicapi_data/\*.txt files. To fix, you need
+ * to look in test-runs/test_quicapi for the "new" files and then edit
+ * (replacing actual octets with "?" in relevant places), and copy the
+ * result back over to test/recipes/75-test_quicapi_data/. The reason
+ * this happens is the ECH COMPRESS'd extensions need to be contiguous
+ * in the ClientHello, so changes to/from COMPRESS affect extension
+ * order, in inner and outer CH. There doesn't seem to be an easy,
+ * generic, way to reconcile these compile-time changes with having
+ * fixed value test files. Likely the best option is to decide on the
+ * disposition of ECH COMPRESS or not and consider that an at least
+ * medium-term thing. (But still allow other builds to vary at
+ * compile time if they need something different.)
+ */
+#ifndef OPENSSL_NO_ECH
+static int init_ech(SSL_CONNECTION *s, unsigned int context);
+static int final_ech(SSL_CONNECTION *s, unsigned int context, int sent);
+#endif /* OPENSSL_NO_ECH */

 static int final_renegotiate(SSL_CONNECTION *s, unsigned int context, int sent);
 static int init_server_name(SSL_CONNECTION *s, unsigned int context);
 static int final_server_name(SSL_CONNECTION *s, unsigned int context, int sent);
-static int final_ec_pt_formats(SSL_CONNECTION *s, unsigned int context,
-    int sent);
 static int init_session_ticket(SSL_CONNECTION *s, unsigned int context);
 #ifndef OPENSSL_NO_OCSP
 static int init_status_request(SSL_CONNECTION *s, unsigned int context);
@@ -74,6 +109,9 @@ static EXT_RETURN tls_construct_compress_certificate(SSL_CONNECTION *sc, WPACKET
 static int tls_parse_compress_certificate(SSL_CONNECTION *sc, PACKET *pkt,
     unsigned int context,
     X509 *x, size_t chainidx);
+static int tls_parse_ec_pt_formats(SSL_CONNECTION *s, PACKET *pkt,
+    unsigned int context,
+    X509 *x, size_t chainidx);

 /* Structure to define a built-in extension */
 typedef struct extensions_definition_st {
@@ -84,6 +122,11 @@ typedef struct extensions_definition_st {
      * protocol versions
      */
     unsigned int context;
+    /*
+     * exceptionally, we don't conditionally compile this field to avoid a
+     * pile of ifndefs all over the ext_defs values
+     */
+    int ech_handling; /* how to handle ECH for this extension type */
     /*
      * Initialise extension before parsing. Always called for relevant contexts
      * even if extension not present
@@ -138,17 +181,20 @@ typedef struct extensions_definition_st {
  * NOTE: WebSphere Application Server 7+ cannot handle empty extensions at
  * the end, keep these extensions before signature_algorithm.
  */
-#define INVALID_EXTENSION { TLSEXT_TYPE_invalid, 0, NULL, NULL, NULL, NULL, NULL, NULL }
+#define INVALID_EXTENSION { TLSEXT_TYPE_invalid, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL }
+
 static const EXTENSION_DEFINITION ext_defs[] = {
     { TLSEXT_TYPE_renegotiate,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO
-            | SSL_EXT_SSL3_ALLOWED | SSL_EXT_TLS1_2_AND_BELOW_ONLY,
+            | SSL_EXT_TLS1_2_AND_BELOW_ONLY,
+        OSSL_ECH_HANDLING_COMPRESS,
         NULL, tls_parse_ctos_renegotiate, tls_parse_stoc_renegotiate,
         tls_construct_stoc_renegotiate, tls_construct_ctos_renegotiate,
         final_renegotiate },
     { TLSEXT_TYPE_server_name,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO
             | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS,
+        OSSL_ECH_HANDLING_CALL_BOTH,
         init_server_name,
         tls_parse_ctos_server_name, tls_parse_stoc_server_name,
         tls_construct_stoc_server_name, tls_construct_ctos_server_name,
@@ -156,12 +202,14 @@ static const EXTENSION_DEFINITION ext_defs[] = {
     { TLSEXT_TYPE_max_fragment_length,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO
             | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS,
+        OSSL_ECH_HANDLING_COMPRESS,
         NULL, tls_parse_ctos_maxfragmentlen, tls_parse_stoc_maxfragmentlen,
         tls_construct_stoc_maxfragmentlen, tls_construct_ctos_maxfragmentlen,
         final_maxfragmentlen },
 #ifndef OPENSSL_NO_SRP
     { TLSEXT_TYPE_srp,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_AND_BELOW_ONLY,
+        OSSL_ECH_HANDLING_COMPRESS,
         init_srp, tls_parse_ctos_srp, NULL, NULL, tls_construct_ctos_srp, NULL },
 #else
     INVALID_EXTENSION,
@@ -169,9 +217,10 @@ static const EXTENSION_DEFINITION ext_defs[] = {
     { TLSEXT_TYPE_ec_point_formats,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO
             | SSL_EXT_TLS1_2_AND_BELOW_ONLY,
-        init_ec_point_formats, tls_parse_ctos_ec_pt_formats, tls_parse_stoc_ec_pt_formats,
+        OSSL_ECH_HANDLING_COMPRESS,
+        init_ec_point_formats, tls_parse_ec_pt_formats, tls_parse_ec_pt_formats,
         tls_construct_stoc_ec_pt_formats, tls_construct_ctos_ec_pt_formats,
-        final_ec_pt_formats },
+        NULL },
     { /*
        * "supported_groups" is spread across several specifications.
        * It was originally specified as "elliptic_curves" in RFC 4492,
@@ -180,7 +229,7 @@ static const EXTENSION_DEFINITION ext_defs[] = {
        * to indicate to the client the complete list of groups supported
        * by the server, with the server instead just indicating the
        * selected group for this connection in the ServerKeyExchange
-       * message.  TLS 1.3 adds a scheme for the server to indicate
+       * message. (D)TLS 1.3 adds a scheme for the server to indicate
        * to the client its list of supported groups in the
        * EncryptedExtensions message, but none of the relevant
        * specifications permit sending supported_groups in the ServerHello.
@@ -190,7 +239,7 @@ static const EXTENSION_DEFINITION ext_defs[] = {
        * ServerHello anyway.  Up to and including the 1.1.0 release,
        * we did not check for the presence of nonpermitted extensions,
        * so to avoid a regression, we must permit this extension in the
-       * TLS 1.2 ServerHello as well.
+       * (D)TLS 1.2 ServerHello as well.
        *
        * Note that there is no tls_parse_stoc_supported_groups function,
        * so we do not perform any additional parsing, validation, or
@@ -200,12 +249,14 @@ static const EXTENSION_DEFINITION ext_defs[] = {
         TLSEXT_TYPE_supported_groups,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS
             | SSL_EXT_TLS1_2_SERVER_HELLO,
+        OSSL_ECH_HANDLING_COMPRESS,
         NULL, tls_parse_ctos_supported_groups, NULL,
         tls_construct_stoc_supported_groups,
         tls_construct_ctos_supported_groups, NULL },
     { TLSEXT_TYPE_session_ticket,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO
             | SSL_EXT_TLS1_2_AND_BELOW_ONLY,
+        OSSL_ECH_HANDLING_COMPRESS,
         init_session_ticket, tls_parse_ctos_session_ticket,
         tls_parse_stoc_session_ticket, tls_construct_stoc_session_ticket,
         tls_construct_ctos_session_ticket, NULL },
@@ -213,6 +264,7 @@ static const EXTENSION_DEFINITION ext_defs[] = {
     { TLSEXT_TYPE_status_request,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO
             | SSL_EXT_TLS1_3_CERTIFICATE | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST,
+        OSSL_ECH_HANDLING_COMPRESS,
         init_status_request, tls_parse_ctos_status_request,
         tls_parse_stoc_status_request, tls_construct_stoc_status_request,
         tls_construct_ctos_status_request, NULL },
@@ -223,6 +275,7 @@ static const EXTENSION_DEFINITION ext_defs[] = {
     { TLSEXT_TYPE_next_proto_neg,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO
             | SSL_EXT_TLS1_2_AND_BELOW_ONLY,
+        OSSL_ECH_HANDLING_COMPRESS,
         init_npn, tls_parse_ctos_npn, tls_parse_stoc_npn,
         tls_construct_stoc_next_proto_neg, tls_construct_ctos_npn, NULL },
 #else
@@ -235,12 +288,14 @@ static const EXTENSION_DEFINITION ext_defs[] = {
         TLSEXT_TYPE_application_layer_protocol_negotiation,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO
             | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS,
+        OSSL_ECH_HANDLING_CALL_BOTH,
         init_alpn, tls_parse_ctos_alpn, tls_parse_stoc_alpn,
         tls_construct_stoc_alpn, tls_construct_ctos_alpn, final_alpn },
 #ifndef OPENSSL_NO_SRTP
     { TLSEXT_TYPE_use_srtp,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO
             | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS | SSL_EXT_DTLS_ONLY,
+        OSSL_ECH_HANDLING_COMPRESS,
         init_srtp, tls_parse_ctos_use_srtp, tls_parse_stoc_use_srtp,
         tls_construct_stoc_use_srtp, tls_construct_ctos_use_srtp, NULL },
 #else
@@ -249,12 +304,22 @@ static const EXTENSION_DEFINITION ext_defs[] = {
     { TLSEXT_TYPE_encrypt_then_mac,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO
             | SSL_EXT_TLS1_2_AND_BELOW_ONLY,
+        /*
+         * If you want to demonstrate/exercise duplicate, then
+         * this does that and has no effect on sizes, but it
+         * will break the quicapi test (see above). Probably
+         * best done in local tests and not committed to any
+         * upstream.
+         * OSSL_ECH_HANDLING_DUPLICATE,
+         */
+        OSSL_ECH_HANDLING_COMPRESS,
         init_etm, tls_parse_ctos_etm, tls_parse_stoc_etm,
         tls_construct_stoc_etm, tls_construct_ctos_etm, NULL },
 #ifndef OPENSSL_NO_CT
     { TLSEXT_TYPE_signed_certificate_timestamp,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO
             | SSL_EXT_TLS1_3_CERTIFICATE | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST,
+        OSSL_ECH_HANDLING_COMPRESS,
         NULL,
         /*
          * No server side support for this, but can be provided by a custom
@@ -268,10 +333,12 @@ static const EXTENSION_DEFINITION ext_defs[] = {
     { TLSEXT_TYPE_extended_master_secret,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO
             | SSL_EXT_TLS1_2_AND_BELOW_ONLY,
+        OSSL_ECH_HANDLING_COMPRESS,
         init_ems, tls_parse_ctos_ems, tls_parse_stoc_ems,
         tls_construct_stoc_ems, tls_construct_ctos_ems, final_ems },
     { TLSEXT_TYPE_signature_algorithms_cert,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST,
+        OSSL_ECH_HANDLING_COMPRESS,
         init_sig_algs_cert, tls_parse_ctos_sig_algs_cert,
         tls_parse_ctos_sig_algs_cert,
         /* We do not generate signature_algorithms_cert at present. */
@@ -279,6 +346,7 @@ static const EXTENSION_DEFINITION ext_defs[] = {
     {
         TLSEXT_TYPE_post_handshake_auth,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_ONLY,
+        OSSL_ECH_HANDLING_COMPRESS,
         init_post_handshake_auth,
         tls_parse_ctos_post_handshake_auth,
         NULL,
@@ -289,6 +357,7 @@ static const EXTENSION_DEFINITION ext_defs[] = {
     { TLSEXT_TYPE_client_cert_type,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS
             | SSL_EXT_TLS1_2_SERVER_HELLO,
+        OSSL_ECH_HANDLING_CALL_BOTH,
         init_client_cert_type,
         tls_parse_ctos_client_cert_type, tls_parse_stoc_client_cert_type,
         tls_construct_stoc_client_cert_type, tls_construct_ctos_client_cert_type,
@@ -296,26 +365,29 @@ static const EXTENSION_DEFINITION ext_defs[] = {
     { TLSEXT_TYPE_server_cert_type,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS
             | SSL_EXT_TLS1_2_SERVER_HELLO,
+        OSSL_ECH_HANDLING_CALL_BOTH,
         init_server_cert_type,
         tls_parse_ctos_server_cert_type, tls_parse_stoc_server_cert_type,
         tls_construct_stoc_server_cert_type, tls_construct_ctos_server_cert_type,
         NULL },
     { TLSEXT_TYPE_signature_algorithms,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST,
+        OSSL_ECH_HANDLING_COMPRESS,
         init_sig_algs, tls_parse_ctos_sig_algs,
         tls_parse_ctos_sig_algs, tls_construct_ctos_sig_algs,
         tls_construct_ctos_sig_algs, final_sig_algs },
     { TLSEXT_TYPE_supported_versions,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO
-            | SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST | SSL_EXT_TLS_IMPLEMENTATION_ONLY,
+            | SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST,
+        OSSL_ECH_HANDLING_COMPRESS,
         NULL,
         /* Processed inline as part of version selection */
         NULL, tls_parse_stoc_supported_versions,
         tls_construct_stoc_supported_versions,
         tls_construct_ctos_supported_versions, final_supported_versions },
     { TLSEXT_TYPE_psk_kex_modes,
-        SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS_IMPLEMENTATION_ONLY
-            | SSL_EXT_TLS1_3_ONLY,
+        SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_ONLY,
+        OSSL_ECH_HANDLING_COMPRESS,
         init_psk_kex_modes, tls_parse_ctos_psk_kex_modes, NULL, NULL,
         tls_construct_ctos_psk_kex_modes, NULL },
     { /*
@@ -324,15 +396,17 @@ static const EXTENSION_DEFINITION ext_defs[] = {
        */
         TLSEXT_TYPE_key_share,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO
-            | SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST | SSL_EXT_TLS_IMPLEMENTATION_ONLY
+            | SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST
             | SSL_EXT_TLS1_3_ONLY,
+        OSSL_ECH_HANDLING_COMPRESS,
         NULL, tls_parse_ctos_key_share, tls_parse_stoc_key_share,
         tls_construct_stoc_key_share, tls_construct_ctos_key_share,
         final_key_share },
     { /* Must be after key_share */
         TLSEXT_TYPE_cookie,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST
-            | SSL_EXT_TLS_IMPLEMENTATION_ONLY | SSL_EXT_TLS1_3_ONLY,
+            | SSL_EXT_TLS1_3_ONLY,
+        OSSL_ECH_HANDLING_COMPRESS,
         NULL, tls_parse_ctos_cookie, tls_parse_stoc_cookie,
         tls_construct_stoc_cookie, tls_construct_ctos_cookie, NULL },
     { /*
@@ -343,10 +417,12 @@ static const EXTENSION_DEFINITION ext_defs[] = {
         TLSEXT_TYPE_cryptopro_bug,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO
             | SSL_EXT_TLS1_2_AND_BELOW_ONLY,
+        OSSL_ECH_HANDLING_COMPRESS,
         NULL, NULL, NULL, tls_construct_stoc_cryptopro_bug, NULL, NULL },
     { TLSEXT_TYPE_compress_certificate,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST
-            | SSL_EXT_TLS_IMPLEMENTATION_ONLY | SSL_EXT_TLS1_3_ONLY,
+            | SSL_EXT_TLS1_3_ONLY,
+        OSSL_ECH_HANDLING_COMPRESS,
         tls_init_compress_certificate,
         tls_parse_compress_certificate, tls_parse_compress_certificate,
         tls_construct_compress_certificate, tls_construct_compress_certificate,
@@ -354,6 +430,7 @@ static const EXTENSION_DEFINITION ext_defs[] = {
     { TLSEXT_TYPE_early_data,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS
             | SSL_EXT_TLS1_3_NEW_SESSION_TICKET | SSL_EXT_TLS1_3_ONLY,
+        OSSL_ECH_HANDLING_CALL_BOTH,
         NULL, tls_parse_ctos_early_data, tls_parse_stoc_early_data,
         tls_construct_stoc_early_data, tls_construct_ctos_early_data,
         final_early_data },
@@ -361,6 +438,7 @@ static const EXTENSION_DEFINITION ext_defs[] = {
         TLSEXT_TYPE_certificate_authorities,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST
             | SSL_EXT_TLS1_3_ONLY,
+        OSSL_ECH_HANDLING_COMPRESS,
         init_certificate_authorities,
         tls_parse_certificate_authorities,
         tls_parse_certificate_authorities,
@@ -368,20 +446,177 @@ static const EXTENSION_DEFINITION ext_defs[] = {
         tls_construct_certificate_authorities,
         NULL,
     },
-    { /* Must be immediately before pre_shared_key */
-        TLSEXT_TYPE_padding,
+#ifndef OPENSSL_NO_ECH
+    { TLSEXT_TYPE_ech,
+        SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_ONLY | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS | SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST,
+        OSSL_ECH_HANDLING_CALL_BOTH,
+        init_ech,
+        tls_parse_ctos_ech, tls_parse_stoc_ech,
+        tls_construct_stoc_ech, tls_construct_ctos_ech,
+        final_ech },
+    { TLSEXT_TYPE_outer_extensions,
+        SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_ONLY,
+        OSSL_ECH_HANDLING_CALL_BOTH,
+        NULL,
+        NULL, NULL,
+        NULL, NULL,
+        NULL },
+#else /* OPENSSL_NO_ECH */
+    INVALID_EXTENSION,
+    INVALID_EXTENSION,
+#endif /* END_OPENSSL_NO_ECH */
+    { /* RFC 8701 GREASE extension 1 - type is dynamic */
+        TLSEXT_TYPE_grease1,
+        SSL_EXT_CLIENT_HELLO,
+        0,
+        NULL,
+        NULL, NULL, NULL, tls_construct_ctos_grease1, NULL },
+    { /* RFC 8701 GREASE extension 2 - type is dynamic */
+        TLSEXT_TYPE_grease2,
         SSL_EXT_CLIENT_HELLO,
+        0,
         NULL,
-        /* We send this, but don't read it */
-        NULL, NULL, NULL, tls_construct_ctos_padding, NULL },
-    { /* Required by the TLSv1.3 spec to always be the last extension */
+        NULL, NULL, NULL, tls_construct_ctos_grease2, NULL },
+    { /* Required by the (D)TLSv1.3 spec to always be the last extension */
         TLSEXT_TYPE_psk,
         SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO
-            | SSL_EXT_TLS_IMPLEMENTATION_ONLY | SSL_EXT_TLS1_3_ONLY,
+            | SSL_EXT_TLS1_3_ONLY,
+        OSSL_ECH_HANDLING_CALL_BOTH,
         NULL, tls_parse_ctos_psk, tls_parse_stoc_psk, tls_construct_stoc_psk,
         tls_construct_ctos_psk, final_psk }
 };

+#ifndef OPENSSL_NO_ECH
+/*
+ * Copy an inner extension value to outer.
+ * inner CH must have been pre-decoded into s->clienthello->pre_proc_exts
+ * already.
+ */
+int ossl_ech_copy_inner2outer(SSL_CONNECTION *s, uint16_t ext_type,
+    int ind, WPACKET *pkt)
+{
+    RAW_EXTENSION *myext = NULL, *raws = NULL;
+
+    if (s == NULL || s->clienthello == NULL)
+        return OSSL_ECH_SAME_EXT_ERR;
+    raws = s->clienthello->pre_proc_exts;
+    if (raws == NULL)
+        return OSSL_ECH_SAME_EXT_ERR;
+    myext = &raws[ind];
+    OSSL_TRACE_BEGIN(TLS)
+    {
+        BIO_printf(trc_out, "inner2outer: Copying ext type %d to outer\n",
+            ext_type);
+    }
+    OSSL_TRACE_END(TLS);
+
+    /*
+     * copy inner value to outer
+     */
+    if (PACKET_data(&myext->data) != NULL
+        && PACKET_remaining(&myext->data) > 0) {
+        if (!WPACKET_put_bytes_u16(pkt, ext_type)
+            || !WPACKET_sub_memcpy_u16(pkt, PACKET_data(&myext->data),
+                PACKET_remaining(&myext->data)))
+            return OSSL_ECH_SAME_EXT_ERR;
+    } else {
+        /* empty extension */
+        if (!WPACKET_put_bytes_u16(pkt, ext_type)
+            || !WPACKET_put_bytes_u16(pkt, 0))
+            return OSSL_ECH_SAME_EXT_ERR;
+    }
+    return 1;
+}
+
+/*
+ * DUPEMALL is useful for testing - this turns off compression and
+ * causes two calls to each extension constructor, which'd be the same
+ * as making all entries in ext_tab use the CALL_BOTH value
+ */
+#undef DUPEMALL
+
+/*
+ * Check if we're using the same/different key shares
+ * return 1 if same key share in inner and outer, 0 otherwise
+ */
+int ossl_ech_same_key_share(void)
+{
+#ifdef DUPEMALL
+    return 0;
+#endif
+    return ext_defs[TLSEXT_IDX_key_share].ech_handling
+        != OSSL_ECH_HANDLING_CALL_BOTH;
+}
+
+/*
+ * say if extension at index |ind| in ext_defs is to be ECH compressed
+ * return 1 if this one is to be compressed, 0 if not, -1 for error
+ */
+int ossl_ech_2bcompressed(size_t ind)
+{
+    const size_t nexts = OSSL_NELEM(ext_defs);
+
+#ifdef DUPEMALL
+    return 0;
+#endif
+    if (ind >= nexts)
+        return -1;
+    return ext_defs[ind].ech_handling == OSSL_ECH_HANDLING_COMPRESS;
+}
+
+/* as needed, repeat extension from inner in outer handling compression */
+int ossl_ech_same_ext(SSL_CONNECTION *s, WPACKET *pkt)
+{
+    unsigned int type = 0;
+    int tind = 0, nexts = OSSL_NELEM(ext_defs);
+
+#ifdef DUPEMALL
+    return OSSL_ECH_SAME_EXT_CONTINUE;
+#endif
+    if (s == NULL || s->ext.ech.es == NULL)
+        return OSSL_ECH_SAME_EXT_CONTINUE; /* nothing to do */
+    /*
+     * We store/access the index of the extension handler in
+     * s->ext.ech.ext_ind, as we'd otherwise not know it here.
+     * Be nice were there a better way to handle that.
+     */
+    tind = s->ext.ech.ext_ind;
+    /* If this index'd extension won't be compressed, we're done */
+    if (tind < 0 || tind >= nexts)
+        return OSSL_ECH_SAME_EXT_ERR;
+    type = ext_defs[tind].type;
+    if (s->ext.ech.ch_depth == 1) {
+        /* inner CH - just note compression as configured */
+        if (ext_defs[tind].ech_handling != OSSL_ECH_HANDLING_COMPRESS)
+            return OSSL_ECH_SAME_EXT_CONTINUE;
+        /* mark this one to be "compressed" */
+        if (s->ext.ech.n_outer_only >= OSSL_ECH_OUTERS_MAX)
+            return OSSL_ECH_SAME_EXT_ERR;
+        s->ext.ech.outer_only[s->ext.ech.n_outer_only] = type;
+        s->ext.ech.n_outer_only++;
+        OSSL_TRACE_BEGIN(TLS)
+        {
+            BIO_printf(trc_out, "ech_same_ext: Marking (type %u, ind %d "
+                                "tot-comp %d) for compression\n",
+                type, tind,
+                (int)s->ext.ech.n_outer_only);
+        }
+        OSSL_TRACE_END(TLS);
+        return OSSL_ECH_SAME_EXT_CONTINUE;
+    } else {
+        /* Copy value from inner to outer, or indicate a new value needed */
+        if (s->clienthello == NULL || pkt == NULL)
+            return OSSL_ECH_SAME_EXT_ERR;
+        if (ext_defs[tind].ech_handling == OSSL_ECH_HANDLING_CALL_BOTH)
+            return OSSL_ECH_SAME_EXT_CONTINUE;
+        else
+            return ossl_ech_copy_inner2outer(s, type, tind, pkt);
+    }
+    /* just in case - shouldn't happen */
+    return OSSL_ECH_SAME_EXT_ERR;
+}
+#endif
+
 /* Returns a TLSEXT_TYPE for the given index */
 unsigned int ossl_get_extension_type(size_t idx)
 {
@@ -480,9 +715,16 @@ static int verify_extension(SSL_CONNECTION *s, unsigned int context,
         ENDPOINT role = ENDPOINT_BOTH;
         custom_ext_method *meth = NULL;

-        if ((context & SSL_EXT_CLIENT_HELLO) != 0)
+        if ((context & SSL_EXT_CLIENT_HELLO) != 0) {
+#ifndef OPENSSL_NO_ECH
+            if (s->ext.ech.attempted == 1 && s->ext.ech.ch_depth == 1)
+                role = ENDPOINT_CLIENT;
+            else
+                role = ENDPOINT_SERVER;
+#else
             role = ENDPOINT_SERVER;
-        else if ((context & SSL_EXT_TLS1_2_SERVER_HELLO) != 0)
+#endif
+        } else if ((context & SSL_EXT_TLS1_2_SERVER_HELLO) != 0)
             role = ENDPOINT_CLIENT;

         meth = custom_ext_find(meths, role, type, &offset);
@@ -499,6 +741,111 @@ static int verify_extension(SSL_CONNECTION *s, unsigned int context,
     return 1;
 }

+/*
+ * Parse an ec_point_formats extension off the wire (one function for
+ * both sides).  The peer's list is retained verbatim for
+ * SSL_get0_ec_point_formats() and for the RFC 4492/8422 section 5.1.2
+ * 'uncompressed must be present' check.
+ *
+ * The check is gated on the negotiated ciphersuite -- a TLS 1.3
+ * handshake or a non-ECC TLS 1.2 ciphersuite makes the extension moot
+ * and any missing 'uncompressed' codepoint is ignored.  On the client
+ * the chosen ciphersuite is already locked in by the time we parse
+ * ServerHello, so the check happens inline here.  On the server it's
+ * deferred to tls_construct_stoc_ec_pt_formats(), the first point at
+ * which s->s3.tmp.new_cipher is set for TLS 1.2.
+ */
+static int tls_parse_ec_pt_formats(SSL_CONNECTION *s, PACKET *pkt,
+    unsigned int context, X509 *x, size_t chainidx)
+{
+    PACKET list;
+
+    if (!PACKET_as_length_prefixed_1(pkt, &list)
+        || PACKET_remaining(&list) == 0) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        return 0;
+    }
+    if (!s->hit
+        && !PACKET_memdup(&list, &s->ext.peer_ecpointformats,
+            &s->ext.peer_ecpointformats_len)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+
+    if (!s->server) {
+        unsigned long alg_k = s->s3.tmp.new_cipher->algorithm_mkey;
+        unsigned long alg_a = s->s3.tmp.new_cipher->algorithm_auth;
+
+        if (((alg_k & SSL_kECDHE) || (alg_a & SSL_aECDSA))
+            && memchr(PACKET_data(&list),
+                   TLSEXT_ECPOINTFORMAT_uncompressed,
+                   PACKET_remaining(&list))
+                == NULL) {
+            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
+                SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST);
+            return 0;
+        }
+    }
+
+    return 1;
+}
+
+/*
+ * Verify that all extensions in |packet| are known built-in or custom
+ * extension types. This is used for TLS 1.3 server extension responses where
+ * unknown extensions are not ignored.
+ */
+int tls_validate_no_unknown_extensions(SSL_CONNECTION *s, PACKET *packet,
+    unsigned int context)
+{
+    PACKET extensions = *packet;
+    custom_ext_methods *exts = &s->cert->custext;
+    ENDPOINT role = ENDPOINT_BOTH;
+
+    if ((context & SSL_EXT_CLIENT_HELLO) != 0) {
+#ifndef OPENSSL_NO_ECH
+        if (s->ext.ech.attempted == 1 && s->ext.ech.ch_depth == 1)
+            role = ENDPOINT_CLIENT;
+        else
+            role = ENDPOINT_SERVER;
+#else
+        role = ENDPOINT_SERVER;
+#endif
+    } else if ((context & SSL_EXT_TLS1_2_SERVER_HELLO) != 0) {
+        role = ENDPOINT_CLIENT;
+    }
+
+    while (PACKET_remaining(&extensions) > 0) {
+        unsigned int type;
+        size_t i;
+        PACKET extension;
+        const EXTENSION_DEFINITION *thisext;
+
+        if (!PACKET_get_net_2(&extensions, &type)
+            || !PACKET_get_length_prefixed_2(&extensions, &extension)) {
+            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+            return 0;
+        }
+
+        for (i = 0, thisext = ext_defs; i < OSSL_NELEM(ext_defs);
+            i++, thisext++) {
+            if (type == thisext->type)
+                break;
+        }
+        if (i < OSSL_NELEM(ext_defs))
+            continue;
+
+        if (exts != NULL && custom_ext_find(exts, role, type, NULL) != NULL)
+            continue;
+
+        SSLfatal(s, SSL_AD_UNSUPPORTED_EXTENSION,
+            SSL_R_UNSOLICITED_EXTENSION);
+        return 0;
+    }
+
+    return 1;
+}
+
 /*
  * Check whether the context defined for an extension |extctx| means whether
  * the extension is relevant for the current context |thisctx| or not. Returns
@@ -507,33 +854,31 @@ static int verify_extension(SSL_CONNECTION *s, unsigned int context,
 int extension_is_relevant(SSL_CONNECTION *s, unsigned int extctx,
     unsigned int thisctx)
 {
-    int is_tls13;
+    int is_version13;

     /*
      * For HRR we haven't selected the version yet but we know it will be
-     * TLSv1.3
+     * (D)TLSv1.3
      */
     if ((thisctx & SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST) != 0)
-        is_tls13 = 1;
+        is_version13 = 1;
     else
-        is_tls13 = SSL_CONNECTION_IS_TLS13(s);
+        is_version13 = SSL_CONNECTION_IS_VERSION13(s);

     if ((SSL_CONNECTION_IS_DTLS(s)
             && (extctx & SSL_EXT_TLS_IMPLEMENTATION_ONLY) != 0)
-        || (s->version == SSL3_VERSION
-            && (extctx & SSL_EXT_SSL3_ALLOWED) == 0)
         /*
-         * Note that SSL_IS_TLS13() means "TLS 1.3 has been negotiated",
+         * Note that is_version13 means "(D)TLS 1.3 has been negotiated",
          * which is never true when generating the ClientHello.
          * However, version negotiation *has* occurred by the time the
          * ClientHello extensions are being parsed.
-         * Be careful to allow TLS 1.3-only extensions when generating
+         * Be careful to allow (D)TLS 1.3-only extensions when generating
          * the ClientHello.
          */
-        || (is_tls13 && (extctx & SSL_EXT_TLS1_2_AND_BELOW_ONLY) != 0)
-        || (!is_tls13 && (extctx & SSL_EXT_TLS1_3_ONLY) != 0
+        || (is_version13 && (extctx & SSL_EXT_TLS1_2_AND_BELOW_ONLY) != 0)
+        || (!is_version13 && (extctx & SSL_EXT_TLS1_3_ONLY) != 0
             && (thisctx & SSL_EXT_CLIENT_HELLO) == 0)
-        || (s->server && !is_tls13 && (extctx & SSL_EXT_TLS1_3_ONLY) != 0)
+        || (s->server && !is_version13 && (extctx & SSL_EXT_TLS1_3_ONLY) != 0)
         || (s->hit && (extctx & SSL_EXT_IGNORE_ON_RESUMPTION) != 0))
         return 0;
     return 1;
@@ -572,11 +917,16 @@ int tls_collect_extensions(SSL_CONNECTION *s, PACKET *packet,
      * Initialise server side custom extensions. Client side is done during
      * construction of extensions for the ClientHello.
      */
+#ifndef OPENSSL_NO_ECH
+    if ((context & SSL_EXT_CLIENT_HELLO) != 0 && s->ext.ech.attempted == 0)
+        custom_ext_init(&s->cert->custext);
+#else
     if ((context & SSL_EXT_CLIENT_HELLO) != 0)
         custom_ext_init(&s->cert->custext);
+#endif

     num_exts = OSSL_NELEM(ext_defs) + (exts != NULL ? exts->meths_count : 0);
-    raw_extensions = OPENSSL_zalloc(num_exts * sizeof(*raw_extensions));
+    raw_extensions = OPENSSL_calloc(num_exts, sizeof(*raw_extensions));
     if (raw_extensions == NULL) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_CRYPTO_LIB);
         return 0;
@@ -605,12 +955,11 @@ int tls_collect_extensions(SSL_CONNECTION *s, PACKET *packet,
             SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
             goto err;
         }
-
         /* The server must tolerate the unknown extension and complete. */
         if (thisex == NULL)
             continue;

-        idx = thisex - raw_extensions;
+        idx = (unsigned int)(thisex - raw_extensions);
         /*-
          * Check that we requested this extension (if appropriate). Requests can
          * be sent in the ClientHello and CertificateRequest. Unsolicited
@@ -777,6 +1126,8 @@ int tls_parse_all_extensions(SSL_CONNECTION *s, int context,
 int should_add_extension(SSL_CONNECTION *s, unsigned int extctx,
     unsigned int thisctx, int max_version)
 {
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;
+
     /* Skip if not relevant for our context */
     if ((extctx & thisctx) == 0)
         return 0;
@@ -785,7 +1136,7 @@ int should_add_extension(SSL_CONNECTION *s, unsigned int extctx,
     if (!extension_is_relevant(s, extctx, thisctx)
         || ((extctx & SSL_EXT_TLS1_3_ONLY) != 0
             && (thisctx & SSL_EXT_CLIENT_HELLO) != 0
-            && (SSL_CONNECTION_IS_DTLS(s) || max_version < TLS1_3_VERSION)))
+            && ssl_version_cmp(s, max_version, version1_3) < 0))
         return 0;

     return 1;
@@ -807,12 +1158,15 @@ int tls_construct_extensions(SSL_CONNECTION *s, WPACKET *pkt,
     int min_version, max_version = 0, reason;
     const EXTENSION_DEFINITION *thisexd;
     int for_comp = (context & SSL_EXT_TLS1_3_CERTIFICATE_COMPRESSION) != 0;
+#ifndef OPENSSL_NO_ECH
+    int pass;
+#endif

     if (!WPACKET_start_sub_packet_u16(pkt)
         /*
          * If extensions are of zero length then we don't even add the
          * extensions length bytes to a ClientHello/ServerHello
-         * (for non-TLSv1.3).
+         * (for non-(D)TLSv1.3).
          */
         || ((context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO)) != 0
             && !WPACKET_set_flags(pkt,
@@ -832,47 +1186,90 @@ int tls_construct_extensions(SSL_CONNECTION *s, WPACKET *pkt,
     }

     /* Add custom extensions first */
-    if ((context & SSL_EXT_CLIENT_HELLO) != 0) {
+#ifndef OPENSSL_NO_ECH
+    if ((context & SSL_EXT_CLIENT_HELLO) != 0 && s->ext.ech.attempted == 0)
         /* On the server side with initialise during ClientHello parsing */
         custom_ext_init(&s->cert->custext);
-    }
+#else
+    if ((context & SSL_EXT_CLIENT_HELLO) != 0)
+        /* On the server side with initialise during ClientHello parsing */
+        custom_ext_init(&s->cert->custext);
+#endif
     if (!custom_ext_add(s, context, pkt, x, chainidx, max_version)) {
         /* SSLfatal() already called */
         return 0;
     }

-    for (i = 0, thisexd = ext_defs; i < OSSL_NELEM(ext_defs); i++, thisexd++) {
-        EXT_RETURN (*construct)(SSL_CONNECTION *s, WPACKET *pkt,
-            unsigned int context,
-            X509 *x, size_t chainidx);
-        EXT_RETURN ret;
+#ifndef OPENSSL_NO_ECH
+    /*
+     * Two passes if doing real ECH - we first construct the
+     * to-be-ECH-compressed extensions, and then go around again
+     * constructing those that aren't to be ECH-compressed. We
+     * need to ensure this ordering so that all the ECH-compressed
+     * extensions are contiguous in the encoding. The actual
+     * compression happens later in ech_encode_inner().
+     */
+    for (pass = 0; pass <= 1; pass++)
+#endif
+
+        for (i = 0, thisexd = ext_defs; i < OSSL_NELEM(ext_defs);
+            i++, thisexd++) {
+            EXT_RETURN (*construct)(SSL_CONNECTION *s, WPACKET *pkt,
+                unsigned int context,
+                X509 *x, size_t chainidx);
+            EXT_RETURN ret;
+
+#ifndef OPENSSL_NO_ECH
+            /* do compressed in pass 0, non-compressed in pass 1 */
+            if (ossl_ech_2bcompressed((int)i) == pass)
+                continue;
+            /* stash index - needed for COMPRESS ECH handling */
+            s->ext.ech.ext_ind = (int)i;
+#endif
+            /* Skip if not relevant for our context */
+            if (!should_add_extension(s, thisexd->context, context, max_version))
+                continue;

-        /* Skip if not relevant for our context */
-        if (!should_add_extension(s, thisexd->context, context, max_version))
-            continue;
+            construct = s->server ? thisexd->construct_stoc
+                                  : thisexd->construct_ctos;

-        construct = s->server ? thisexd->construct_stoc
-                              : thisexd->construct_ctos;
+            if (construct == NULL)
+                continue;

-        if (construct == NULL)
-            continue;
+            ret = construct(s, pkt, context, x, chainidx);
+            if (ret == EXT_RETURN_FAIL) {
+                /* SSLfatal() already called */
+                return 0;
+            }
+            if (ret == EXT_RETURN_SENT
+                && (context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST | SSL_EXT_TLS1_3_NEW_SESSION_TICKET)) != 0)
+                s->ext.extflags[i] |= SSL_EXT_FLAG_SENT;
+        }

-        ret = construct(s, pkt, context, x, chainidx);
-        if (ret == EXT_RETURN_FAIL) {
-            /* SSLfatal() already called */
+#ifndef OPENSSL_NO_ECH
+    /*
+     * don't close yet if client in the middle of doing ECH, we'll
+     * eventually close this in ech_aad_and_encrypt() after we add
+     * the real ECH extension value
+     */
+    if (s->server
+        || context != SSL_EXT_CLIENT_HELLO
+        || s->ext.ech.attempted == 0
+        || s->ext.ech.ch_depth == 1
+        || s->ext.ech.grease == OSSL_ECH_IS_GREASE) {
+        if (!WPACKET_close(pkt)) {
+            if (!for_comp)
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             return 0;
         }
-        if (ret == EXT_RETURN_SENT
-            && (context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST | SSL_EXT_TLS1_3_NEW_SESSION_TICKET)) != 0)
-            s->ext.extflags[i] |= SSL_EXT_FLAG_SENT;
     }
-
+#else
     if (!WPACKET_close(pkt)) {
         if (!for_comp)
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return 0;
     }
-
+#endif
     return 1;
 }

@@ -934,6 +1331,36 @@ static int init_server_name(SSL_CONNECTION *s, unsigned int context)
     return 1;
 }

+#ifndef OPENSSL_NO_ECH
+/*
+ * Just note that ech is not yet done
+ * return 1 for good, 0 otherwise
+ */
+static int init_ech(SSL_CONNECTION *s, unsigned int context)
+{
+    const int nexts = OSSL_NELEM(ext_defs);
+
+    /* we don't need this assert everywhere - anywhere is fine */
+    if (!ossl_assert(TLSEXT_IDX_num_builtins == nexts)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    if ((context & SSL_EXT_CLIENT_HELLO) != 0)
+        s->ext.ech.done = 0;
+    return 1;
+}
+
+static int final_ech(SSL_CONNECTION *s, unsigned int context, int sent)
+{
+    if (s->server && s->ext.ech.success == 1
+        && s->ext.ech.inner_ech_seen_ok != 1) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_ECH_REQUIRED);
+        return 0;
+    }
+    return 1;
+}
+#endif /* OPENSSL_NO_ECH */
+
 static int final_server_name(SSL_CONNECTION *s, unsigned int context, int sent)
 {
     int ret = SSL_TLSEXT_ERR_NOACK;
@@ -1020,8 +1447,8 @@ static int final_server_name(SSL_CONNECTION *s, unsigned int context, int sent)
         return 0;

     case SSL_TLSEXT_ERR_ALERT_WARNING:
-        /* TLSv1.3 doesn't have warning alerts so we suppress this */
-        if (!SSL_CONNECTION_IS_TLS13(s))
+        /* (D)TLSv1.3 doesn't have warning alerts so we suppress this */
+        if (!SSL_CONNECTION_IS_VERSION13(s))
             ssl3_send_alert(s, SSL3_AL_WARNING, altmp);
         s->servername_done = 0;
         return 1;
@@ -1035,45 +1462,6 @@ static int final_server_name(SSL_CONNECTION *s, unsigned int context, int sent)
     }
 }

-static int final_ec_pt_formats(SSL_CONNECTION *s, unsigned int context,
-    int sent)
-{
-    unsigned long alg_k, alg_a;
-
-    if (s->server)
-        return 1;
-
-    alg_k = s->s3.tmp.new_cipher->algorithm_mkey;
-    alg_a = s->s3.tmp.new_cipher->algorithm_auth;
-
-    /*
-     * If we are client and using an elliptic curve cryptography cipher
-     * suite, then if server returns an EC point formats lists extension it
-     * must contain uncompressed.
-     */
-    if (s->ext.ecpointformats != NULL
-        && s->ext.ecpointformats_len > 0
-        && s->ext.peer_ecpointformats != NULL
-        && s->ext.peer_ecpointformats_len > 0
-        && ((alg_k & SSL_kECDHE) || (alg_a & SSL_aECDSA))) {
-        /* we are using an ECC cipher */
-        size_t i;
-        unsigned char *list = s->ext.peer_ecpointformats;
-
-        for (i = 0; i < s->ext.peer_ecpointformats_len; i++) {
-            if (*list++ == TLSEXT_ECPOINTFORMAT_uncompressed)
-                break;
-        }
-        if (i == s->ext.peer_ecpointformats_len) {
-            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
-                SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST);
-            return 0;
-        }
-    }
-
-    return 1;
-}
-
 static int init_session_ticket(SSL_CONNECTION *s, unsigned int context)
 {
     if (!s->server)
@@ -1095,6 +1483,9 @@ static int init_status_request(SSL_CONNECTION *s, unsigned int context)
         OPENSSL_free(s->ext.ocsp.resp);
         s->ext.ocsp.resp = NULL;
         s->ext.ocsp.resp_len = 0;
+
+        sk_OCSP_RESPONSE_pop_free(s->ext.ocsp.resp_ex, OCSP_RESPONSE_free);
+        s->ext.ocsp.resp_ex = NULL;
     }

     return 1;
@@ -1128,15 +1519,15 @@ static int final_alpn(SSL_CONNECTION *s, unsigned int context, int sent)
     if (!s->server && !sent && s->session->ext.alpn_selected != NULL)
         s->ext.early_data_ok = 0;

-    if (!s->server || !SSL_CONNECTION_IS_TLS13(s))
+    if (!s->server || !SSL_CONNECTION_IS_VERSION13(s))
         return 1;

     /*
      * Call alpn_select callback if needed.  Has to be done after SNI and
-     * cipher negotiation (HTTP/2 restricts permitted ciphers). In TLSv1.3
+     * cipher negotiation (HTTP/2 restricts permitted ciphers). In (D)TLSv1.3
      * we also have to do this before we decide whether to accept early_data.
-     * In TLSv1.3 we've already negotiated our cipher so we do this call now.
-     * For < TLSv1.3 we defer it until after cipher negotiation.
+     * In (D)TLSv1.3 we've already negotiated our cipher so we do this call now.
+     * For < (D)TLSv1.3 we defer it until after cipher negotiation.
      *
      * On failure SSLfatal() already called.
      */
@@ -1287,7 +1678,7 @@ static int init_srtp(SSL_CONNECTION *s, unsigned int context)

 static int final_sig_algs(SSL_CONNECTION *s, unsigned int context, int sent)
 {
-    if (!sent && SSL_CONNECTION_IS_TLS13(s) && !s->hit) {
+    if (!sent && SSL_CONNECTION_IS_VERSION13(s) && !s->hit) {
         SSLfatal(s, TLS13_AD_MISSING_EXTENSION,
             SSL_R_MISSING_SIGALGS_EXTENSION);
         return 0;
@@ -1308,10 +1699,20 @@ static int final_supported_versions(SSL_CONNECTION *s, unsigned int context,
     return 1;
 }

+/* Is a HelloRetryRequest cookie required before the handshake can proceed? */
+int tls_hrr_cookie_required(const SSL_CONNECTION *s)
+{
+    if ((s->s3.flags & TLS1_FLAGS_STATELESS) != 0)
+        return 1;
+
+    return SSL_CONNECTION_IS_DTLS(s)
+        && (s->options & SSL_OP_COOKIE_EXCHANGE) != 0;
+}
+
 static int final_key_share(SSL_CONNECTION *s, unsigned int context, int sent)
 {
-#if !defined(OPENSSL_NO_TLS1_3)
-    if (!SSL_CONNECTION_IS_TLS13(s))
+#if !(defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_DTLS1_3))
+    if (!SSL_CONNECTION_IS_VERSION13(s))
         return 1;

     /* Nothing to do for key_share in an HRR */
@@ -1348,7 +1749,7 @@ static int final_key_share(SSL_CONNECTION *s, unsigned int context, int sent)
      *         we have a suitable key_share
      *     THEN
      *         IF
-     *             we are stateless AND we have no cookie
+     *             a cookie is required AND we have no cookie
      *         THEN
      *             send a HelloRetryRequest
      *     ELSE
@@ -1370,22 +1771,17 @@ static int final_key_share(SSL_CONNECTION *s, unsigned int context, int sent)
      *         THEN
      *             fail
      *         ELSE IF
-     *             we are stateless AND we have no cookie
+     *             a cookie is required AND we have no cookie
      *         THEN
      *             send a HelloRetryRequest
      */
     if (s->server) {
         if (s->s3.peer_tmp != NULL) {
             /* We have a suitable key_share */
-            if ((s->s3.flags & TLS1_FLAGS_STATELESS) != 0
-                && !s->ext.cookieok) {
-                if (!ossl_assert(s->hello_retry_request == SSL_HRR_NONE)) {
-                    /*
-                     * If we are stateless then we wouldn't know about any
-                     * previously sent HRR - so how can this be anything other
-                     * than 0?
-                     */
-                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            if (tls_hrr_cookie_required(s) && !s->ext.cookieok) {
+                if (s->hello_retry_request != SSL_HRR_NONE) {
+                    /* We already sent an HRR and still have no valid cookie */
+                    SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_COOKIE_MISMATCH);
                     return 0;
                 }
                 s->hello_retry_request = SSL_HRR_PENDING;
@@ -1413,15 +1809,10 @@ static int final_key_share(SSL_CONNECTION *s, unsigned int context, int sent)
                 return 0;
             }

-            if ((s->s3.flags & TLS1_FLAGS_STATELESS) != 0
-                && !s->ext.cookieok) {
-                if (!ossl_assert(s->hello_retry_request == SSL_HRR_NONE)) {
-                    /*
-                     * If we are stateless then we wouldn't know about any
-                     * previously sent HRR - so how can this be anything other
-                     * than 0?
-                     */
-                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            if (tls_hrr_cookie_required(s) && !s->ext.cookieok) {
+                if (s->hello_retry_request != SSL_HRR_NONE) {
+                    /* We already sent an HRR and still have no valid cookie */
+                    SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_COOKIE_MISMATCH);
                     return 0;
                 }
                 s->hello_retry_request = SSL_HRR_PENDING;
@@ -1446,7 +1837,7 @@ static int final_key_share(SSL_CONNECTION *s, unsigned int context, int sent)
             return 0;
         }
     }
-#endif /* !defined(OPENSSL_NO_TLS1_3) */
+#endif /* !defined(OPENSSL_NO_TLS1_3) && !defined(OPENSSL_NO_DTLS1_3) */
     return 1;
 }

@@ -1471,12 +1862,13 @@ int tls_psk_do_binder(SSL_CONNECTION *s, const EVP_MD *md,
     static const unsigned char resumption_label[] = "\x72\x65\x73\x20\x62\x69\x6E\x64\x65\x72";
     /* ASCII: "ext binder", in hex for EBCDIC compatibility */
     static const unsigned char external_label[] = "\x65\x78\x74\x20\x62\x69\x6E\x64\x65\x72";
-    const unsigned char *label;
-    size_t bindersize, labelsize, hashsize;
+    const unsigned char *label, *msgbodystart;
+    size_t bindersize, labelsize, hashsize, msgbodylen;
     int hashsizei = EVP_MD_get_size(md);
     int ret = -1;
     int usepskfored = 0;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };

     /* Ensure cast to size_t is safe */
     if (!ossl_assert(hashsizei > 0)) {
@@ -1487,8 +1879,7 @@ int tls_psk_do_binder(SSL_CONNECTION *s, const EVP_MD *md,

     if (external
         && s->early_data_state == SSL_EARLY_DATA_CONNECTING
-        && s->session->ext.max_early_data == 0
-        && sess->ext.max_early_data > 0)
+        && sess == s->ext.early_data_session)
         usepskfored = 1;

     if (external) {
@@ -1556,40 +1947,109 @@ int tls_psk_do_binder(SSL_CONNECTION *s, const EVP_MD *md,
     if (s->hello_retry_request == SSL_HRR_PENDING) {
         size_t hdatalen;
         long hdatalen_l;
-        void *hdata;
+        unsigned char *hdata;

-        hdatalen = hdatalen_l = BIO_get_mem_data(s->s3.handshake_buffer, &hdata);
-        if (hdatalen_l <= 0) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_HANDSHAKE_LENGTH);
-            goto err;
+#ifndef OPENSSL_NO_ECH
+        /* handle the hashing as per ECH needs (on client) */
+        if (s->ext.ech.attempted == 1 && s->ext.ech.ch_depth == 1) {
+            if (ossl_ech_intbuf_fetch(s, (unsigned char **)&hdata, &hdatalen) != 1) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+        } else {
+#endif
+            hdatalen = hdatalen_l = BIO_get_mem_data(s->s3.handshake_buffer, &hdata);
+            if (hdatalen_l <= 0) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_HANDSHAKE_LENGTH);
+                goto err;
+            }
+#ifndef OPENSSL_NO_ECH
         }
+#endif

-        /*
-         * For servers the handshake buffer data will include the second
-         * ClientHello - which we don't want - so we need to take that bit off.
-         */
-        if (s->server) {
+        if (s->negotiated_version == DTLS1_3_VERSION) {
             PACKET hashprefix, msg;
+            unsigned long dtlsbodylen;
+            unsigned int dtls_offset = DTLS1_HM_HEADER_LENGTH - SSL3_HM_HEADER_LENGTH;

-            /* Find how many bytes are left after the first two messages */
+            /*
+             * RFC 9147 states that for DTLS 1.3 all transcripts should be
+             * calculated without the message_seq, fragment_offset and
+             * fragment_length values. See Section 5.2
+             *
+             * Since the data is coming from handshake_buffer it hasn't
+             * been processed in ssl3_finish_mac where these values are
+             * removed. Therefore for both the server and client we will
+             * need to not supply them to the Digest Update
+             */
             if (!PACKET_buf_init(&hashprefix, hdata, hdatalen)
                 || !PACKET_forward(&hashprefix, 1)
                 || !PACKET_get_length_prefixed_3(&hashprefix, &msg)
                 || !PACKET_forward(&hashprefix, 1)
-                || !PACKET_get_length_prefixed_3(&hashprefix, &msg)) {
+                || !PACKET_get_net_3(&hashprefix, &dtlsbodylen)) {
                 SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
                 goto err;
             }
+
             hdatalen -= PACKET_remaining(&hashprefix);
-        }

-        if (EVP_DigestUpdate(mctx, hdata, hdatalen) <= 0) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            goto err;
+            if (EVP_DigestUpdate(mctx, hdata, hdatalen) <= 0) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+
+            /*
+             * Now skip the four bytes for the part of the DTLS header to not
+             * include in the transcript.
+             */
+            if (EVP_DigestUpdate(mctx, hdata + hdatalen + dtls_offset, dtlsbodylen) <= 0) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+        } else {
+            /*
+             * For servers the handshake buffer data will include the second
+             * ClientHello - which we don't want - so we need to take that bit off.
+             */
+            if (s->server) {
+                PACKET hashprefix, msg;
+
+                /* Find how many bytes are left after the first two messages */
+                if (!PACKET_buf_init(&hashprefix, hdata, hdatalen)
+                    || !PACKET_forward(&hashprefix, 1)
+                    || !PACKET_get_length_prefixed_3(&hashprefix, &msg)
+                    || !PACKET_forward(&hashprefix, 1)
+                    || !PACKET_get_length_prefixed_3(&hashprefix, &msg)) {
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                    goto err;
+                }
+                hdatalen -= PACKET_remaining(&hashprefix);
+            }
+
+            if (EVP_DigestUpdate(mctx, hdata, hdatalen) <= 0) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
         }
     }

-    if (EVP_DigestUpdate(mctx, msgstart, binderoffset) <= 0
+    if (SSL_CONNECTION_IS_DTLS(s)) {
+        msgbodystart = msgstart + DTLS1_HM_HEADER_LENGTH;
+        msgbodylen = binderoffset - DTLS1_HM_HEADER_LENGTH;
+    } else {
+        msgbodystart = msgstart + SSL3_HM_HEADER_LENGTH;
+        msgbodylen = binderoffset - SSL3_HM_HEADER_LENGTH;
+    }
+
+    /*
+     * RFC9147 (DTLSv1.3)
+     * The transcript consists of complete TLS Handshake messages
+     * (reassembled as necessary). Note that this requires removing the
+     * message_seq, fragment_offset, and fragment_length fields to create
+     * the Handshake structure.
+     */
+    if (EVP_DigestUpdate(mctx, msgstart, SSL3_HM_HEADER_LENGTH) <= 0
+        || EVP_DigestUpdate(mctx, msgbodystart, msgbodylen) <= 0
         || EVP_DigestFinal_ex(mctx, hash, NULL) <= 0) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         goto err;
@@ -1606,9 +2066,12 @@ int tls_psk_do_binder(SSL_CONNECTION *s, const EVP_MD *md,
     if (!sign)
         binderout = tmpbinder;

+    if (sctx->propq != NULL)
+        params[0] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_PROPERTIES,
+            (char *)sctx->propq, 0);
     bindersize = hashsize;
     if (EVP_DigestSignInit_ex(mctx, NULL, EVP_MD_get0_name(md), sctx->libctx,
-            sctx->propq, mackey, NULL)
+            sctx->propq, mackey, params)
             <= 0
         || EVP_DigestSignUpdate(mctx, hash, hashsize) <= 0
         || EVP_DigestSignFinal(mctx, binderout, &bindersize) <= 0
@@ -1631,7 +2094,6 @@ err:
     OPENSSL_cleanse(finishedkey, sizeof(finishedkey));
     EVP_PKEY_free(mackey);
     EVP_MD_CTX_free(mctx);
-
     return ret;
 }

@@ -1758,6 +2220,9 @@ static EXT_RETURN tls_construct_compress_certificate(SSL_CONNECTION *sc, WPACKET

     if (sc->cert_comp_prefs[0] == TLSEXT_comp_cert_none)
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(sc, context, pkt);
+#endif

     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_compress_certificate)
         || !WPACKET_start_sub_packet_u16(pkt)
diff --git a/deps/openssl/openssl/ssl/statem/extensions_clnt.c b/deps/openssl/openssl/ssl/statem/extensions_clnt.c
index 305ca4ab46c..a1c7d7709bc 100644
--- a/deps/openssl/openssl/ssl/statem/extensions_clnt.c
+++ b/deps/openssl/openssl/ssl/statem/extensions_clnt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -8,26 +8,37 @@
  */

 #include <openssl/ocsp.h>
+#include <openssl/rand.h>
 #include "../ssl_local.h"
 #include "internal/cryptlib.h"
 #include "internal/ssl_unwrap.h"
+#include "internal/tlsgroups.h"
 #include "statem_local.h"
+#ifndef OPENSSL_NO_ECH
+#include "internal/ech_helpers.h"
+#endif
+
+/* Used in the negotiate_dhe function */
+typedef enum {
+    ffdhe_check,
+    ecdhe_check,
+    ptfmt_check
+} dhe_check_t;

 EXT_RETURN tls_construct_ctos_renegotiate(SSL_CONNECTION *s, WPACKET *pkt,
     unsigned int context, X509 *x,
     size_t chainidx)
 {
     if (!s->renegotiate) {
-        /* If not renegotiating, send an empty RI extension to indicate support */
+        const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION
+                                                         : TLS1_3_VERSION;

-#if DTLS_MAX_VERSION_INTERNAL != DTLS1_2_VERSION
-#error Internal DTLS version error
-#endif
-
-        if (!SSL_CONNECTION_IS_DTLS(s)
-            && (s->min_proto_version >= TLS1_3_VERSION
-                || (ssl_security(s, SSL_SECOP_VERSION, 0, TLS1_VERSION, NULL)
-                    && s->min_proto_version <= TLS1_VERSION))) {
+        /* If not renegotiating, send an empty RI extension to indicate support */
+        if ((s->min_proto_version != 0
+                && ssl_version_cmp(s, s->min_proto_version, version1_3) >= 0)
+            || (!SSL_CONNECTION_IS_DTLS(s)
+                && ssl_security(s, SSL_SECOP_VERSION, 0, TLS1_VERSION, NULL)
+                && s->min_proto_version <= TLS1_VERSION)) {
             /*
              * For TLS <= 1.0 SCSV is used instead, and for TLS 1.3 this
              * extension isn't used at all.
@@ -35,6 +46,10 @@ EXT_RETURN tls_construct_ctos_renegotiate(SSL_CONNECTION *s, WPACKET *pkt,
             return EXT_RETURN_NOT_SENT;
         }

+#ifndef OPENSSL_NO_ECH
+        ECH_SAME_EXT(s, context, pkt)
+#endif
+
         if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate)
             || !WPACKET_start_sub_packet_u16(pkt)
             || !WPACKET_put_bytes_u8(pkt, 0)
@@ -46,6 +61,10 @@ EXT_RETURN tls_construct_ctos_renegotiate(SSL_CONNECTION *s, WPACKET *pkt,
         return EXT_RETURN_SENT;
     }

+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif
+
     /* Add a complete RI extension if renegotiating */
     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate)
         || !WPACKET_start_sub_packet_u16(pkt)
@@ -63,9 +82,31 @@ EXT_RETURN tls_construct_ctos_server_name(SSL_CONNECTION *s, WPACKET *pkt,
     unsigned int context, X509 *x,
     size_t chainidx)
 {
-    if (s->ext.hostname == NULL)
-        return EXT_RETURN_NOT_SENT;
+    char *chosen = s->ext.hostname;
+#ifndef OPENSSL_NO_ECH
+    OSSL_HPKE_SUITE suite;
+    OSSL_ECHSTORE_ENTRY *ee = NULL;

+    if (s->ext.ech.es != NULL) {
+        if (ossl_ech_pick_matching_cfg(s, &ee, &suite) != 1) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return EXT_RETURN_NOT_SENT;
+        }
+        /* Don't send outer SNI if external API says so */
+        if (s->ext.ech.ch_depth == 0 && s->ext.ech.no_outer == 1)
+            return EXT_RETURN_NOT_SENT;
+        if (s->ext.ech.ch_depth == 1) /* inner */
+            chosen = s->ext.hostname;
+        if (s->ext.ech.ch_depth == 0) { /* outer */
+            if (s->ext.ech.outer_hostname != NULL) /* prefer API */
+                chosen = s->ext.ech.outer_hostname;
+            else /* use name from ECHConfig */
+                chosen = ee->public_name;
+        }
+    }
+#endif
+    if (chosen == NULL)
+        return EXT_RETURN_NOT_SENT;
     /* Add TLS extension servername to the Client Hello message */
     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_server_name)
         /* Sub-packet for server_name extension */
@@ -73,14 +114,12 @@ EXT_RETURN tls_construct_ctos_server_name(SSL_CONNECTION *s, WPACKET *pkt,
         /* Sub-packet for servername list (always 1 hostname)*/
         || !WPACKET_start_sub_packet_u16(pkt)
         || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name)
-        || !WPACKET_sub_memcpy_u16(pkt, s->ext.hostname,
-            strlen(s->ext.hostname))
+        || !WPACKET_sub_memcpy_u16(pkt, chosen, strlen(chosen))
         || !WPACKET_close(pkt)
         || !WPACKET_close(pkt)) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return EXT_RETURN_FAIL;
     }
-
     return EXT_RETURN_SENT;
 }

@@ -91,6 +130,9 @@ EXT_RETURN tls_construct_ctos_maxfragmentlen(SSL_CONNECTION *s, WPACKET *pkt,
 {
     if (s->ext.max_fragment_len_mode == TLSEXT_max_fragment_length_DISABLED)
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif

     /* Add Max Fragment Length extension if client enabled it. */
     /*-
@@ -117,6 +159,9 @@ EXT_RETURN tls_construct_ctos_srp(SSL_CONNECTION *s, WPACKET *pkt,
     /* Add SRP username if there is one */
     if (s->srp_ctx.login == NULL)
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif

     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_srp)
         /* Sub-packet for SRP extension */
@@ -136,47 +181,82 @@ EXT_RETURN tls_construct_ctos_srp(SSL_CONNECTION *s, WPACKET *pkt,
 }
 #endif

-static int use_ecc(SSL_CONNECTION *s, int min_version, int max_version)
+/*
+ * With (D)TLS < 1.3 the only negotiated supported key exchange groups are
+ * FFDHE (RFC7919) and ECDHE/ECX (RFC8422 + legacy).  With (D)TLS 1.3, we add
+ * KEMs, and the supported groups are no longer cipher-dependent.
+ *
+ * This function serves two purposes:
+ *
+ * - To determine whether to send the supported point formats extension.
+ *   This is no longer applicable with (D)TLS >= 1.3.
+ * - To determine whether to send the supported groups extension.
+ *
+ * In the former case, we only care about whether both ECC ciphers and EC/ECX
+ * supported groups are configured, and the (D)TLS min version is at most 1.2.
+ *
+ * In the latter case, we also admit DHE ciphers with FFDHE groups, or any TLS
+ * 1.3 cipher, since the extension is effectively mandatory for (D)TLS 1.3,
+ * with the sole exception of psk-ke resumption, provided the client is sure
+ * that the server will not want elect a full handshake. The check type then
+ * indicates whether ECDHE or FFDHE negotiation should be performed.
+ *
+ * It returns 1 if negotiation is supported, 0 if it's not and -1 on error.
+ */
+static int negotiate_dhe(SSL_CONNECTION *s, dhe_check_t check_type,
+    int min_version, int max_version)
 {
     int i, end, ret = 0;
-    unsigned long alg_k, alg_a;
     STACK_OF(SSL_CIPHER) *cipher_stack = NULL;
     const uint16_t *pgroups = NULL;
     size_t num_groups, j;
     SSL *ssl = SSL_CONNECTION_GET_SSL(s);
+    int dtls = SSL_CONNECTION_IS_DTLS(s);

-    /* See if we support any ECC ciphersuites */
-    if (s->version == SSL3_VERSION)
-        return 0;
-
+    /* See if we support any EC or FFDHE ciphersuites */
     cipher_stack = SSL_get1_supported_ciphers(ssl);
+    if (cipher_stack == NULL)
+        return -1;
     end = sk_SSL_CIPHER_num(cipher_stack);
     for (i = 0; i < end; i++) {
         const SSL_CIPHER *c = sk_SSL_CIPHER_value(cipher_stack, i);
-
-        alg_k = c->algorithm_mkey;
-        alg_a = c->algorithm_auth;
-        if ((alg_k & (SSL_kECDHE | SSL_kECDHEPSK))
-            || (alg_a & SSL_aECDSA)
-            || c->min_tls >= TLS1_3_VERSION) {
+        unsigned long alg_k = c->algorithm_mkey;
+        unsigned long alg_a = c->algorithm_auth;
+
+        int is_ffdhe_ciphersuite = (alg_k & (SSL_kDHE | SSL_kDHEPSK));
+        int is_ec_ciphersuite = ((alg_k & (SSL_kECDHE | SSL_kECDHEPSK))
+            || (alg_a & SSL_aECDSA));
+        int is_tls13 = (dtls ? DTLS_VERSION_GT(c->min_dtls, DTLS1_2_VERSION)
+                             : (c->min_tls > TLS1_2_VERSION));
+
+        if ((check_type == ffdhe_check && (is_ffdhe_ciphersuite || is_tls13))
+            || (check_type == ecdhe_check && (is_ec_ciphersuite || is_tls13))
+            || (check_type == ptfmt_check && is_ec_ciphersuite)) {
             ret = 1;
             break;
         }
     }
     sk_SSL_CIPHER_free(cipher_stack);
-    if (!ret)
+    if (ret == 0)
         return 0;

-    /* Check we have at least one EC supported group */
+    /* Check we have at least one EC or FFDHE supported group */
     tls1_get_supported_groups(s, &pgroups, &num_groups);
     for (j = 0; j < num_groups; j++) {
         uint16_t ctmp = pgroups[j];
+        const TLS_GROUP_INFO *ginfo = NULL;

-        if (tls_valid_group(s, ctmp, min_version, max_version, 1, NULL)
+        if (!tls_valid_group(s, ctmp, min_version, max_version, NULL, &ginfo))
+            continue;
+
+        if (check_type == ffdhe_check && is_ffdhe_group(ginfo->group_id)
             && tls_group_allowed(s, ctmp, SSL_SECOP_CURVE_SUPPORTED))
             return 1;
-    }

+        if (check_type != ffdhe_check && is_ecdhe_group(ginfo->group_id)
+            && tls_group_allowed(s, ctmp, SSL_SECOP_CURVE_SUPPORTED))
+            return 1;
+    }
     return 0;
 }

@@ -186,19 +266,29 @@ EXT_RETURN tls_construct_ctos_ec_pt_formats(SSL_CONNECTION *s, WPACKET *pkt,
 {
     const unsigned char *pformats;
     size_t num_formats;
-    int reason, min_version, max_version;
+    int reason, min_version, max_version, dhe_result;

     reason = ssl_get_min_max_version(s, &min_version, &max_version, NULL);
     if (reason != 0) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, reason);
         return EXT_RETURN_FAIL;
     }
-    if (!use_ecc(s, min_version, max_version))
+    dhe_result = negotiate_dhe(s, ptfmt_check, min_version, max_version);
+    if (dhe_result == 0)
         return EXT_RETURN_NOT_SENT;
+    if (dhe_result < 0) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return EXT_RETURN_FAIL;
+    }

-    /* Add TLS extension ECPointFormats to the ClientHello message */
     tls1_get_formatlist(s, &pformats, &num_formats);
+    if (num_formats == 0)
+        return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif

+    /* Add TLS extension ECPointFormats to the ClientHello message */
     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_ec_point_formats)
         /* Sub-packet for formats extension */
         || !WPACKET_start_sub_packet_u16(pkt)
@@ -218,6 +308,9 @@ EXT_RETURN tls_construct_ctos_supported_groups(SSL_CONNECTION *s, WPACKET *pkt,
     const uint16_t *pgroups = NULL;
     size_t num_groups = 0, i, tls13added = 0, added = 0;
     int min_version, max_version, reason;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;
+    int dtls = SSL_CONNECTION_IS_DTLS(s);
+    int use_ecdhe, use_ffdhe;

     reason = ssl_get_min_max_version(s, &min_version, &max_version, NULL);
     if (reason != 0) {
@@ -226,12 +319,21 @@ EXT_RETURN tls_construct_ctos_supported_groups(SSL_CONNECTION *s, WPACKET *pkt,
     }

     /*
-     * We only support EC groups in TLSv1.2 or below, and in DTLS. Therefore
-     * if we don't have EC support then we don't send this extension.
+     * If we don't support suitable groups, don't send the extension
      */
-    if (!use_ecc(s, min_version, max_version)
-        && (SSL_CONNECTION_IS_DTLS(s) || max_version < TLS1_3_VERSION))
+    use_ecdhe = negotiate_dhe(s, ecdhe_check, min_version, max_version);
+    use_ffdhe = negotiate_dhe(s, ffdhe_check, min_version, max_version);
+    if (use_ecdhe < 0 || use_ffdhe < 0) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return EXT_RETURN_FAIL;
+    }
+    if (use_ecdhe == 0 && use_ffdhe == 0
+        && (dtls ? DTLS_VERSION_LE(max_version, DTLS1_2_VERSION)
+                 : (max_version <= TLS1_2_VERSION)))
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif

     /*
      * Add TLS extension supported_groups to the ClientHello message
@@ -246,21 +348,35 @@ EXT_RETURN tls_construct_ctos_supported_groups(SSL_CONNECTION *s, WPACKET *pkt,
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return EXT_RETURN_FAIL;
     }
+    /* RFC 8701: prepend a GREASE group value */
+    if ((s->options & SSL_OP_GREASE) && !s->server) {
+        if (!WPACKET_put_bytes_u16(pkt,
+                ossl_grease_value(s, OSSL_GREASE_GROUP))) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return EXT_RETURN_FAIL;
+        }
+    }
     /* Copy group ID if supported */
     for (i = 0; i < num_groups; i++) {
+        const TLS_GROUP_INFO *ginfo = NULL;
         uint16_t ctmp = pgroups[i];
         int okfortls13;

-        if (tls_valid_group(s, ctmp, min_version, max_version, 0, &okfortls13)
-            && tls_group_allowed(s, ctmp, SSL_SECOP_CURVE_SUPPORTED)) {
-            if (!WPACKET_put_bytes_u16(pkt, ctmp)) {
-                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-                return EXT_RETURN_FAIL;
-            }
-            if (okfortls13 && max_version == TLS1_3_VERSION)
-                tls13added++;
-            added++;
+        if (!tls_valid_group(s, ctmp, min_version, max_version, &okfortls13,
+                &ginfo)
+            || (!use_ecdhe && is_ecdhe_group(ginfo->group_id))
+            || (!use_ffdhe && is_ffdhe_group(ginfo->group_id))
+            /* Note: SSL_SECOP_CURVE_SUPPORTED covers all key exchange groups */
+            || !tls_group_allowed(s, ctmp, SSL_SECOP_CURVE_SUPPORTED))
+            continue;
+
+        if (!WPACKET_put_bytes_u16(pkt, ctmp)) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return EXT_RETURN_FAIL;
         }
+        if (okfortls13 && max_version == version1_3)
+            tls13added++;
+        added++;
     }
     if (!WPACKET_close(pkt) || !WPACKET_close(pkt)) {
         if (added == 0)
@@ -271,7 +387,7 @@ EXT_RETURN tls_construct_ctos_supported_groups(SSL_CONNECTION *s, WPACKET *pkt,
         return EXT_RETURN_FAIL;
     }

-    if (tls13added == 0 && max_version == TLS1_3_VERSION) {
+    if (tls13added == 0 && max_version == version1_3) {
         SSLfatal_data(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_SUITABLE_GROUPS,
             "No groups enabled for max supported SSL/TLS version");
         return EXT_RETURN_FAIL;
@@ -285,13 +401,17 @@ EXT_RETURN tls_construct_ctos_session_ticket(SSL_CONNECTION *s, WPACKET *pkt,
     size_t chainidx)
 {
     size_t ticklen;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;

     if (!tls_use_ticket(s))
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif

     if (!s->new_session && s->session != NULL
         && s->session->ext.tick != NULL
-        && s->session->ssl_version != TLS1_3_VERSION) {
+        && s->session->ssl_version != version1_3) {
         ticklen = s->session->ext.ticklen;
     } else if (s->session && s->ext.session_ticket != NULL
         && s->ext.session_ticket->data != NULL) {
@@ -344,14 +464,29 @@ EXT_RETURN tls_construct_ctos_sig_algs(SSL_CONNECTION *s, WPACKET *pkt,
             return EXT_RETURN_NOT_SENT;
     }

+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif
+
     salglen = tls12_get_psigalgs(s, 1, &salg);
     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_signature_algorithms)
         /* Sub-packet for sig-algs extension */
         || !WPACKET_start_sub_packet_u16(pkt)
         /* Sub-packet for the actual list */
         || !WPACKET_start_sub_packet_u16(pkt)
-        || !tls12_copy_sigalgs(s, pkt, salg, salglen)
-        || !WPACKET_close(pkt)
+        || !tls12_copy_sigalgs(s, pkt, salg, salglen)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return EXT_RETURN_FAIL;
+    }
+    /* RFC 8701: append a GREASE signature algorithm value */
+    if ((s->options & SSL_OP_GREASE) && !s->server) {
+        if (!WPACKET_put_bytes_u16(pkt,
+                ossl_grease_value(s, OSSL_GREASE_SIGALG))) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return EXT_RETURN_FAIL;
+        }
+    }
+    if (!WPACKET_close(pkt)
         || !WPACKET_close(pkt)) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return EXT_RETURN_FAIL;
@@ -373,6 +508,9 @@ EXT_RETURN tls_construct_ctos_status_request(SSL_CONNECTION *s, WPACKET *pkt,

     if (s->ext.status_type != TLSEXT_STATUSTYPE_ocsp)
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif

     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_status_request)
         /* Sub-packet for status request extension */
@@ -433,6 +571,9 @@ EXT_RETURN tls_construct_ctos_npn(SSL_CONNECTION *s, WPACKET *pkt,
     if (SSL_CONNECTION_GET_CTX(s)->ext.npn_select_cb == NULL
         || !SSL_IS_FIRST_HANDSHAKE(s))
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif

     /*
      * The client advertises an empty extension to indicate its support
@@ -452,22 +593,46 @@ EXT_RETURN tls_construct_ctos_alpn(SSL_CONNECTION *s, WPACKET *pkt,
     unsigned int context,
     X509 *x, size_t chainidx)
 {
-    s->s3.alpn_sent = 0;
+    unsigned char *aval = s->ext.alpn;
+    size_t alen = s->ext.alpn_len;

-    if (s->ext.alpn == NULL || !SSL_IS_FIRST_HANDSHAKE(s))
+    s->s3.alpn_sent = 0;
+    if (!SSL_IS_FIRST_HANDSHAKE(s))
+        return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    /*
+     * If we have different alpn and alpn_outer values, then we set
+     * the appropriate one for inner and outer.
+     * If no alpn is set (for inner or outer), we don't send any.
+     * If only an inner is set then we send the same in both.
+     * Logic above is on the basis that alpn's aren't that sensitive,
+     * usually, so special action is needed to do better.
+     * We also don't support a way to send alpn only in the inner.
+     * If you don't want the inner value in the outer, you have to
+     * pick what to send in the outer and send that.
+     */
+    if (s->ext.ech.ch_depth == 1 && s->ext.alpn == NULL) /* inner */
+        return EXT_RETURN_NOT_SENT;
+    if (s->ext.ech.ch_depth == 0 && s->ext.alpn == NULL
+        && s->ext.ech.alpn_outer == NULL) /* outer */
+        return EXT_RETURN_NOT_SENT;
+    if (s->ext.ech.ch_depth == 0 && s->ext.ech.alpn_outer != NULL) {
+        aval = s->ext.ech.alpn_outer;
+        alen = s->ext.ech.alpn_outer_len;
+    }
+#endif
+    if (aval == NULL)
         return EXT_RETURN_NOT_SENT;
-
     if (!WPACKET_put_bytes_u16(pkt,
             TLSEXT_TYPE_application_layer_protocol_negotiation)
         /* Sub-packet ALPN extension */
         || !WPACKET_start_sub_packet_u16(pkt)
-        || !WPACKET_sub_memcpy_u16(pkt, s->ext.alpn, s->ext.alpn_len)
+        || !WPACKET_sub_memcpy_u16(pkt, aval, alen)
         || !WPACKET_close(pkt)) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return EXT_RETURN_FAIL;
     }
     s->s3.alpn_sent = 1;
-
     return EXT_RETURN_SENT;
 }

@@ -482,6 +647,9 @@ EXT_RETURN tls_construct_ctos_use_srtp(SSL_CONNECTION *s, WPACKET *pkt,

     if (clnt == NULL)
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif

     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_use_srtp)
         /* Sub-packet for SRTP extension */
@@ -519,6 +687,9 @@ EXT_RETURN tls_construct_ctos_etm(SSL_CONNECTION *s, WPACKET *pkt,
 {
     if (s->options & SSL_OP_NO_ENCRYPT_THEN_MAC)
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif

     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_encrypt_then_mac)
         || !WPACKET_put_bytes_u16(pkt, 0)) {
@@ -540,6 +711,9 @@ EXT_RETURN tls_construct_ctos_sct(SSL_CONNECTION *s, WPACKET *pkt,
     /* Not defined for client Certificates */
     if (x != NULL)
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif

     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_signed_certificate_timestamp)
         || !WPACKET_put_bytes_u16(pkt, 0)) {
@@ -557,6 +731,9 @@ EXT_RETURN tls_construct_ctos_ems(SSL_CONNECTION *s, WPACKET *pkt,
 {
     if (s->options & SSL_OP_NO_EXTENDED_MASTER_SECRET)
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif

     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_extended_master_secret)
         || !WPACKET_put_bytes_u16(pkt, 0)) {
@@ -572,6 +749,8 @@ EXT_RETURN tls_construct_ctos_supported_versions(SSL_CONNECTION *s, WPACKET *pkt
     size_t chainidx)
 {
     int currv, min_version, max_version, reason;
+    const int isdtls = SSL_CONNECTION_IS_DTLS(s);
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;

     reason = ssl_get_min_max_version(s, &min_version, &max_version, NULL);
     if (reason != 0) {
@@ -580,11 +759,13 @@ EXT_RETURN tls_construct_ctos_supported_versions(SSL_CONNECTION *s, WPACKET *pkt
     }

     /*
-     * Don't include this if we can't negotiate TLSv1.3. We can do a straight
-     * comparison here because we will never be called in DTLS.
+     * Don't include this if we can't negotiate (D)TLSv1.3.
      */
-    if (max_version < TLS1_3_VERSION)
+    if (ssl_version_cmp(s, max_version, version1_3) < 0)
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif

     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_supported_versions)
         || !WPACKET_start_sub_packet_u16(pkt)
@@ -593,7 +774,16 @@ EXT_RETURN tls_construct_ctos_supported_versions(SSL_CONNECTION *s, WPACKET *pkt
         return EXT_RETURN_FAIL;
     }

-    for (currv = max_version; currv >= min_version; currv--) {
+    /* RFC 8701: prepend a GREASE version value */
+    if ((s->options & SSL_OP_GREASE) && !s->server) {
+        if (!WPACKET_put_bytes_u16(pkt,
+                ossl_grease_value(s, OSSL_GREASE_VERSION))) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return EXT_RETURN_FAIL;
+        }
+    }
+    for (currv = max_version; ssl_version_cmp(s, currv, min_version) >= 0;
+        isdtls ? currv++ : currv--) {
         if (!WPACKET_put_bytes_u16(pkt, currv)) {
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             return EXT_RETURN_FAIL;
@@ -614,9 +804,13 @@ EXT_RETURN tls_construct_ctos_psk_kex_modes(SSL_CONNECTION *s, WPACKET *pkt,
     unsigned int context, X509 *x,
     size_t chainidx)
 {
-#ifndef OPENSSL_NO_TLS1_3
+#if !(defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_DTLS1_3))
     int nodhe = s->options & SSL_OP_ALLOW_NO_DHE_KEX;

+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif
+
     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_psk_kex_modes)
         || !WPACKET_start_sub_packet_u16(pkt)
         || !WPACKET_start_sub_packet_u8(pkt)
@@ -636,7 +830,7 @@ EXT_RETURN tls_construct_ctos_psk_kex_modes(SSL_CONNECTION *s, WPACKET *pkt,
     return EXT_RETURN_SENT;
 }

-#ifndef OPENSSL_NO_TLS1_3
+#if !(defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_DTLS1_3))
 static int add_key_share(SSL_CONNECTION *s, WPACKET *pkt, unsigned int group_id, size_t loop_num)
 {
     unsigned char *encoded_pubkey = NULL;
@@ -644,13 +838,15 @@ static int add_key_share(SSL_CONNECTION *s, WPACKET *pkt, unsigned int group_id,
     size_t encodedlen;

     if (loop_num < s->s3.tmp.num_ks_pkey) {
-        if (!ossl_assert(s->hello_retry_request == SSL_HRR_PENDING)
+        if (!ossl_assert(s->hello_retry_request == SSL_HRR_PENDING
+                || s->d1->hello_verify_request == SSL_HVR_RECEIVED)
             || !ossl_assert(s->s3.tmp.ks_pkey[loop_num] != NULL)) {
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             return 0;
         }
         /*
-         * Could happen if we got an HRR that wasn't requesting a new key_share
+         * Could happen if we got a HRR that wasn't requesting a new key_share
+         * or if we got a HelloVerifyRequest
          */
         key_share_key = s->s3.tmp.ks_pkey[loop_num];
     } else {
@@ -688,7 +884,6 @@ static int add_key_share(SSL_CONNECTION *s, WPACKET *pkt, unsigned int group_id,
         s->s3.tmp.num_ks_pkey++;

     OPENSSL_free(encoded_pubkey);
-
     return 1;
 err:
     if (key_share_key != s->s3.tmp.ks_pkey[loop_num])
@@ -702,13 +897,17 @@ EXT_RETURN tls_construct_ctos_key_share(SSL_CONNECTION *s, WPACKET *pkt,
     unsigned int context, X509 *x,
     size_t chainidx)
 {
-#ifndef OPENSSL_NO_TLS1_3
+#if !(defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_DTLS1_3))
     size_t i, num_groups = 0;
     const uint16_t *pgroups = NULL;
     uint16_t group_id = 0;
     int add_only_one = 0;
     size_t valid_keyshare = 0;

+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif
+
     /* key_share extension */
     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_key_share)
         /* Extension data sub-packet */
@@ -719,6 +918,25 @@ EXT_RETURN tls_construct_ctos_key_share(SSL_CONNECTION *s, WPACKET *pkt,
         return EXT_RETURN_FAIL;
     }

+    /*
+     * RFC 8701: prepend a GREASE key share entry (1 byte of 0x00). After an
+     * HRR requesting a new key share, RFC 9846 requires the requested entry
+     * to be the only one in the second ClientHello.
+     */
+    if ((s->options & SSL_OP_GREASE) && !s->server
+        && !(s->hello_retry_request == SSL_HRR_PENDING
+            && s->s3.group_id != 0 && s->s3.tmp.pkey == NULL)) {
+        uint16_t grease_group = ossl_grease_value(s, OSSL_GREASE_GROUP);
+
+        if (!WPACKET_put_bytes_u16(pkt, grease_group)
+            || !WPACKET_start_sub_packet_u16(pkt)
+            || !WPACKET_put_bytes_u8(pkt, 0)
+            || !WPACKET_close(pkt)) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return EXT_RETURN_FAIL;
+        }
+    }
+
     tls1_get_requested_keyshare_groups(s, &pgroups, &num_groups);
     if (num_groups == 1 && pgroups[0] == 0) { /* Indication that no * prefix was used */
         tls1_get_supported_groups(s, &pgroups, &num_groups);
@@ -747,10 +965,14 @@ EXT_RETURN tls_construct_ctos_key_share(SSL_CONNECTION *s, WPACKET *pkt,
             add_only_one = 1;

         for (i = 0; i < num_groups; i++) {
+            const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION
+                                                             : TLS1_3_VERSION;
+
             if (!tls_group_allowed(s, pgroups[i], SSL_SECOP_CURVE_SUPPORTED))
                 continue;
-            if (!tls_valid_group(s, pgroups[i], TLS1_3_VERSION, TLS1_3_VERSION,
-                    0, NULL))
+
+            if (!tls_valid_group(s, pgroups[i], version1_3, version1_3,
+                    NULL, NULL))
                 continue;

             group_id = pgroups[i];
@@ -775,6 +997,14 @@ EXT_RETURN tls_construct_ctos_key_share(SSL_CONNECTION *s, WPACKET *pkt,
         return EXT_RETURN_FAIL;
     }

+#ifndef OPENSSL_NO_ECH
+    /* stash inner key shares */
+    if (s->ext.ech.ch_depth == 1 && ossl_ech_stash_keyshares(s) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return EXT_RETURN_FAIL;
+    }
+#endif
+
     if (!WPACKET_close(pkt) || !WPACKET_close(pkt)) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return EXT_RETURN_FAIL;
@@ -794,6 +1024,9 @@ EXT_RETURN tls_construct_ctos_cookie(SSL_CONNECTION *s, WPACKET *pkt,
     /* Should only be set if we've had an HRR */
     if (s->ext.tls13_cookie_len == 0)
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif

     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_cookie)
         /* Extension data sub-packet */
@@ -814,6 +1047,96 @@ end:
     return ret;
 }

+static int tls13_check_tick_lifetime_hint(SSL_CONNECTION *s)
+{
+    OSSL_TIME t;
+    uint32_t agesec;
+    unsigned long lifetime;
+
+    if (s->ext.tick_age_checked)
+        return s->ext.tick_age_ok;
+    s->ext.tick_age_ok = 1;
+
+    /*
+     * Technically the C standard just says time() returns a time_t and says
+     * nothing about the encoding of that type. In practice most
+     * implementations follow POSIX which holds it as an integral type in
+     * seconds since epoch. We've already made the assumption that we can do
+     * this in multiple places in the code, so portability shouldn't be an
+     * issue.
+     */
+    t = ossl_time_subtract(ossl_time_now(), s->session->time);
+    agesec = (uint32_t)ossl_time2seconds(t);
+
+    /*
+     * We calculate the age in seconds but the server may work in ms. Due to
+     * rounding errors we could overestimate the age by up to 1s. It is
+     * better to underestimate it. Otherwise, if the RTT is very short, when
+     * the server calculates the age reported by the client it could be
+     * bigger than the age calculated on the server - which should never
+     * happen.
+     */
+    if (agesec > 0)
+        agesec--;
+
+    /*
+     * Calculate age in ms. We're just doing it to nearest second. Should be
+     * good enough.
+     */
+    s->ext.tick_age_ms = agesec * (uint32_t)1000;
+
+    /*
+     * RFC 9846 4.7.1: Servers MUST NOT use any value greater than 604800
+     * seconds (7 days). The value of zero indicates that the ticket should be
+     * discarded immediately. Clients MUST NOT use tickets for longer than 7
+     * days after issuance, regardless of the ticket_lifetime, and MAY delete
+     * tickets earlier based on local policy. A server MAY treat a ticket as
+     * valid for a shorter period of time than what is stated in the
+     * ticket_lifetime.
+     *
+     * The hint is capped when a NewSessionTicket is parsed, but a session
+     * restored with d2i_SSL_SESSION() carries whatever value was serialised.
+     */
+    lifetime = s->session->ext.tick_lifetime_hint;
+    if (lifetime > 604800)
+        lifetime = 604800;
+    if (lifetime == 0 || ossl_time_compare(t, ossl_seconds2time(lifetime)) > 0)
+        s->ext.tick_age_ok = 0;
+    else if (agesec != 0 && s->ext.tick_age_ms / (uint32_t)1000 != agesec)
+        s->ext.tick_age_ok = 0;
+
+    s->ext.tick_age_checked = 1;
+    return s->ext.tick_age_ok;
+}
+
+/*
+ * Mirrors the ticket-resumption gating checks in tls_construct_ctos_psk() so
+ * that early_data is only advertised when the resumption PSK will actually
+ * be sent.
+ */
+static int tls13_check_resumption_psk(SSL_CONNECTION *s, const EVP_MD *handmd)
+{
+    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+    const EVP_MD *mdres;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;
+
+    if (s->session == NULL
+        || s->session->ssl_version != version1_3
+        || s->session->ext.ticklen == 0
+        || s->session->cipher == NULL)
+        return 0;
+
+    mdres = ssl_md(sctx, s->session->cipher->algorithm2);
+    if (mdres == NULL)
+        return 0;
+    if (s->hello_retry_request == SSL_HRR_PENDING && mdres != handmd)
+        return 0;
+    if (tls13_check_tick_lifetime_hint(s) == 0)
+        return 0;
+
+    return 1;
+}
+
 EXT_RETURN tls_construct_ctos_early_data(SSL_CONNECTION *s, WPACKET *pkt,
     unsigned int context, X509 *x,
     size_t chainidx)
@@ -827,14 +1150,43 @@ EXT_RETURN tls_construct_ctos_early_data(SSL_CONNECTION *s, WPACKET *pkt,
     SSL_SESSION *edsess = NULL;
     const EVP_MD *handmd = NULL;
     SSL *ussl = SSL_CONNECTION_GET_USER_SSL(s);
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;

+    s->ext.tick_age_checked = 0;
+
+#ifndef OPENSSL_NO_ECH
+    /*
+     * If we're attempting ECH and processing the outer CH
+     * then we only need to check if the extension is to be
+     * sent or not - any other processing (with side effects)
+     * happened already for the inner CH.
+     */
+    if (s->ext.ech.es != NULL && s->ext.ech.ch_depth == 0) {
+        /*
+         * if we called this for inner and did send then
+         * the following two things should be set, if so,
+         * then send again in the outer CH.
+         */
+        if (s->ext.early_data == SSL_EARLY_DATA_REJECTED
+            && s->ext.early_data_ok == 1) {
+            if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_early_data)
+                || !WPACKET_start_sub_packet_u16(pkt)
+                || !WPACKET_close(pkt)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return EXT_RETURN_FAIL;
+            }
+            return EXT_RETURN_SENT;
+        } else {
+            return EXT_RETURN_NOT_SENT;
+        }
+    }
+#endif
     if (s->hello_retry_request == SSL_HRR_PENDING)
         handmd = ssl_handshake_md(s);

     if (s->psk_use_session_cb != NULL
         && (!s->psk_use_session_cb(ussl, handmd, &id, &idlen, &psksess)
-            || (psksess != NULL
-                && psksess->ssl_version != TLS1_3_VERSION))) {
+            || (psksess != NULL && psksess->ssl_version != version1_3))) {
         SSL_SESSION_free(psksess);
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_PSK);
         return EXT_RETURN_FAIL;
@@ -851,14 +1203,17 @@ EXT_RETURN tls_construct_ctos_early_data(SSL_CONNECTION *s, WPACKET *pkt,
             psk, sizeof(psk));

         if (psklen > PSK_MAX_PSK_LEN) {
-            SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, ERR_R_INTERNAL_ERROR);
+            OPENSSL_cleanse(psk, sizeof(psk));
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             return EXT_RETURN_FAIL;
-        } else if (psklen > 0) {
+        }
+        if (psklen > 0) {
             const unsigned char tls13_aes128gcmsha256_id[] = { 0x13, 0x01 };
             const SSL_CIPHER *cipher;

             idlen = strlen(identity);
             if (idlen > PSK_MAX_IDENTITY_LEN) {
+                OPENSSL_cleanse(psk, sizeof(psk));
                 SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
                 return EXT_RETURN_FAIL;
             }
@@ -866,22 +1221,25 @@ EXT_RETURN tls_construct_ctos_early_data(SSL_CONNECTION *s, WPACKET *pkt,

             /*
              * We found a PSK using an old style callback. We don't know
-             * the digest so we default to SHA256 as per the TLSv1.3 spec
+             * the digest so we default to SHA256 as per the (D)TLSv1.3 spec
              */
             cipher = SSL_CIPHER_find(SSL_CONNECTION_GET_SSL(s),
                 tls13_aes128gcmsha256_id);
             if (cipher == NULL) {
+                OPENSSL_cleanse(psk, sizeof(psk));
                 SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
                 return EXT_RETURN_FAIL;
             }

             psksess = SSL_SESSION_new();
+
             if (psksess == NULL
                 || !SSL_SESSION_set1_master_key(psksess, psk, psklen)
                 || !SSL_SESSION_set_cipher(psksess, cipher)
-                || !SSL_SESSION_set_protocol_version(psksess, TLS1_3_VERSION)) {
+                || !SSL_SESSION_set_protocol_version(psksess, version1_3)) {
+                SSL_SESSION_free(psksess);
+                OPENSSL_cleanse(psk, sizeof(psk));
                 SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-                OPENSSL_cleanse(psk, psklen);
                 return EXT_RETURN_FAIL;
             }
             OPENSSL_cleanse(psk, psklen);
@@ -902,14 +1260,65 @@ EXT_RETURN tls_construct_ctos_early_data(SSL_CONNECTION *s, WPACKET *pkt,
         s->psksession_id_len = idlen;
     }

+    /*
+     * Suppress early_data unless a PSK is available and will be sent.
+     *
+     * RFC 9846 4.3.10: When a PSK is used and early data is allowed for that
+     * PSK, the client can send Application Data in its first flight of
+     * messages. If the client opts to do so, it MUST supply both the
+     * "pre_shared_key" and "early_data" extensions.
+     *
+     * The PSK used to encrypt the early data MUST be the first PSK listed in
+     * the client's "pre_shared_key" extension.
+     */
+    /*
+     * Slot 0 -- the first identity we will offer -- is the only one that can
+     * key 0-RTT. It is the resumption session when we are offering it, else
+     * the external psksession. Offer early_data only when that slot-0 PSK is
+     * itself 0-RTT-capable; never key it off a PSK in a later slot.
+     */
+    edsess = tls13_check_resumption_psk(s, handmd) ? s->session : psksess;
     if (s->early_data_state != SSL_EARLY_DATA_CONNECTING
-        || (s->session->ext.max_early_data == 0
-            && (psksess == NULL || psksess->ext.max_early_data == 0))) {
+        || edsess == NULL
+        || edsess->ext.max_early_data == 0) {
         s->max_early_data = 0;
+        if (s->early_data_state == SSL_EARLY_DATA_CONNECTING) {
+            s->ext.early_data_suppressed = 1;
+            s->ext.early_data = SSL_EARLY_DATA_REJECTED;
+            /*
+             * We report REJECTED (not NOT_SENT), so
+             * SSL_export_keying_material_early() stays callable as it is for a
+             * server-rejected attempt -- but no early exporter secret was
+             * derived here. Randomise it so any such export yields a harmless
+             * per-connection orphan, not an all-zero (predictable) or stale
+             * (prior-handshake) value.
+             */
+            if (RAND_bytes_ex(SSL_CONNECTION_GET_CTX(s)->libctx,
+                    s->early_exporter_master_secret,
+                    sizeof(s->early_exporter_master_secret), 0)
+                <= 0) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return EXT_RETURN_FAIL;
+            }
+        }
+        s->early_data_state = SSL_EARLY_DATA_NONE;
         return EXT_RETURN_NOT_SENT;
     }
-    edsess = s->session->ext.max_early_data != 0 ? s->session : psksess;
     s->max_early_data = edsess->ext.max_early_data;
+    /*
+     * Freeze slot 0 (candidate_at(0)) so the binder, the early-key derivation,
+     * the early exporter, the byte-budget lookup and the post-ServerHello fixup
+     * all key off the actual first-offered PSK rather than guessing the source
+     * from s->session->ext.max_early_data. Held (up-ref'd) so it stays valid
+     * across the swap that later folds a selected psksession into s->session.
+     */
+    SSL_SESSION_free(s->ext.early_data_session);
+    s->ext.early_data_session = edsess;
+    if (!SSL_SESSION_up_ref(edsess)) {
+        s->ext.early_data_session = NULL;
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return EXT_RETURN_FAIL;
+    }

     if (edsess->ext.hostname != NULL) {
         if (s->ext.hostname == NULL
@@ -969,94 +1378,6 @@ EXT_RETURN tls_construct_ctos_early_data(SSL_CONNECTION *s, WPACKET *pkt,
     return EXT_RETURN_SENT;
 }

-#define F5_WORKAROUND_MIN_MSG_LEN 0xff
-#define F5_WORKAROUND_MAX_MSG_LEN 0x200
-
-/*
- * PSK pre binder overhead =
- *  2 bytes for TLSEXT_TYPE_psk
- *  2 bytes for extension length
- *  2 bytes for identities list length
- *  2 bytes for identity length
- *  4 bytes for obfuscated_ticket_age
- *  2 bytes for binder list length
- *  1 byte for binder length
- * The above excludes the number of bytes for the identity itself and the
- * subsequent binder bytes
- */
-#define PSK_PRE_BINDER_OVERHEAD (2 + 2 + 2 + 2 + 4 + 2 + 1)
-
-EXT_RETURN tls_construct_ctos_padding(SSL_CONNECTION *s, WPACKET *pkt,
-    unsigned int context, X509 *x,
-    size_t chainidx)
-{
-    unsigned char *padbytes;
-    size_t hlen;
-
-    if ((s->options & SSL_OP_TLSEXT_PADDING) == 0)
-        return EXT_RETURN_NOT_SENT;
-
-    /*
-     * Add padding to workaround bugs in F5 terminators. See RFC7685.
-     * This code calculates the length of all extensions added so far but
-     * excludes the PSK extension (because that MUST be written last). Therefore
-     * this extension MUST always appear second to last.
-     */
-    if (!WPACKET_get_total_written(pkt, &hlen)) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-        return EXT_RETURN_FAIL;
-    }
-
-    /*
-     * If we're going to send a PSK then that will be written out after this
-     * extension, so we need to calculate how long it is going to be.
-     */
-    if (s->session->ssl_version == TLS1_3_VERSION
-        && s->session->ext.ticklen != 0
-        && s->session->cipher != NULL) {
-        const EVP_MD *md = ssl_md(SSL_CONNECTION_GET_CTX(s),
-            s->session->cipher->algorithm2);
-
-        if (md != NULL) {
-            /*
-             * Add the fixed PSK overhead, the identity length and the binder
-             * length.
-             */
-            int md_size = EVP_MD_get_size(md);
-
-            if (md_size <= 0)
-                return EXT_RETURN_FAIL;
-            hlen += PSK_PRE_BINDER_OVERHEAD + s->session->ext.ticklen
-                + md_size;
-        }
-    }
-
-    if (hlen > F5_WORKAROUND_MIN_MSG_LEN && hlen < F5_WORKAROUND_MAX_MSG_LEN) {
-        /* Calculate the amount of padding we need to add */
-        hlen = F5_WORKAROUND_MAX_MSG_LEN - hlen;
-
-        /*
-         * Take off the size of extension header itself (2 bytes for type and
-         * 2 bytes for length bytes), but ensure that the extension is at least
-         * 1 byte long so as not to have an empty extension last (WebSphere 7.x,
-         * 8.x are intolerant of that condition)
-         */
-        if (hlen > 4)
-            hlen -= 4;
-        else
-            hlen = 1;
-
-        if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_padding)
-            || !WPACKET_sub_allocate_bytes_u16(pkt, hlen, &padbytes)) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            return EXT_RETURN_FAIL;
-        }
-        memset(padbytes, 0, hlen);
-    }
-
-    return EXT_RETURN_SENT;
-}
-
 /*
  * Construct the pre_shared_key extension
  */
@@ -1064,29 +1385,23 @@ EXT_RETURN tls_construct_ctos_psk(SSL_CONNECTION *s, WPACKET *pkt,
     unsigned int context,
     X509 *x, size_t chainidx)
 {
-#ifndef OPENSSL_NO_TLS1_3
-    uint32_t agesec, agems = 0;
+#if !(defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_DTLS1_3))
+    uint32_t agems = 0;
     size_t binderoffset, msglen;
     int reshashsize = 0, pskhashsize = 0;
     unsigned char *resbinder = NULL, *pskbinder = NULL, *msgstart = NULL;
     const EVP_MD *handmd = NULL, *mdres = NULL, *mdpsk = NULL;
     int dores = 0;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
-    OSSL_TIME t;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;

     s->ext.tick_identity = 0;

-    /*
-     * Note: At this stage of the code we only support adding a single
-     * resumption PSK. If we add support for multiple PSKs then the length
-     * calculations in the padding extension will need to be adjusted.
-     */
-
     /*
      * If this is an incompatible or new session then we have nothing to resume
      * so don't add this extension.
      */
-    if (s->session->ssl_version != TLS1_3_VERSION
+    if (s->session->ssl_version != version1_3
         || (s->session->ext.ticklen == 0 && s->psksession == NULL))
         return EXT_RETURN_NOT_SENT;

@@ -1116,45 +1431,23 @@ EXT_RETURN tls_construct_ctos_psk(SSL_CONNECTION *s, WPACKET *pkt,
             goto dopsksess;
         }

+#ifndef OPENSSL_NO_ECH
         /*
-         * Technically the C standard just says time() returns a time_t and says
-         * nothing about the encoding of that type. In practice most
-         * implementations follow POSIX which holds it as an integral type in
-         * seconds since epoch. We've already made the assumption that we can do
-         * this in multiple places in the code, so portability shouldn't be an
-         * issue.
-         */
-        t = ossl_time_subtract(ossl_time_now(), s->session->time);
-        agesec = (uint32_t)ossl_time2seconds(t);
-        /*
-         * We calculate the age in seconds but the server may work in ms. Due to
-         * rounding errors we could overestimate the age by up to 1s. It is
-         * better to underestimate it. Otherwise, if the RTT is very short, when
-         * the server calculates the age reported by the client it could be
-         * bigger than the age calculated on the server - which should never
-         * happen.
+         * When doing ECH, we get here twice (for inner then outer). The
+         * 2nd time (for outer) we can skip some checks as we know how
+         * those went last time.
          */
-        if (agesec > 0)
-            agesec--;
-
-        if (s->session->ext.tick_lifetime_hint < agesec) {
-            /* Ticket is too old. Ignore it. */
+        if (s->ext.ech.es != NULL && s->ext.ech.ch_depth == 0) {
+            s->ext.tick_identity = s->ext.ech.tick_identity;
+            dores = (s->ext.tick_identity > 0);
             goto dopsksess;
         }
+#endif

-        /*
-         * Calculate age in ms. We're just doing it to nearest second. Should be
-         * good enough.
-         */
-        agems = agesec * (uint32_t)1000;
-
-        if (agesec != 0 && agems / (uint32_t)1000 != agesec) {
-            /*
-             * Overflow. Shouldn't happen unless this is a *really* old session.
-             * If so we just ignore it.
-             */
+        if (tls13_check_tick_lifetime_hint(s) == 0)
             goto dopsksess;
-        }
+        /* tls13_check_tick_lifetime_hint() updates the tick_age_ms value. */
+        agems = s->ext.tick_age_ms;

         /*
          * Obfuscate the age. Overflow here is fine, this addition is supposed
@@ -1166,6 +1459,11 @@ EXT_RETURN tls_construct_ctos_psk(SSL_CONNECTION *s, WPACKET *pkt,
         if (reshashsize <= 0)
             goto dopsksess;
         s->ext.tick_identity++;
+#ifndef OPENSSL_NO_ECH
+        /* stash this for re-use in outer CH */
+        if (s->ext.ech.es != NULL && s->ext.ech.ch_depth == 1)
+            s->ext.ech.tick_identity = s->ext.tick_identity;
+#endif
         dores = 1;
     }

@@ -1208,6 +1506,72 @@ dopsksess:
         return EXT_RETURN_FAIL;
     }

+#ifndef OPENSSL_NO_ECH
+    /*
+     * For ECH if we're processing the outer CH and the inner CH
+     * has a PSK, then we want to send a GREASE PSK in the outer.
+     * We'll do that by just replacing the ticket value itself
+     * with random values of the same length.
+     */
+    if (s->ext.ech.es != NULL && s->ext.ech.ch_depth == 0) {
+        unsigned char *rndbuf = NULL, *rndbufp = NULL;
+        size_t totalrndsize = 0;
+
+        totalrndsize = s->session->ext.ticklen
+            + sizeof(agems)
+            + s->psksession_id_len
+            + reshashsize
+            + pskhashsize;
+        rndbuf = OPENSSL_malloc(totalrndsize);
+        if (rndbuf == NULL) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return EXT_RETURN_FAIL;
+        }
+        /* for outer CH allocate a similar sized random value */
+        if (RAND_bytes_ex(sctx->libctx, rndbuf, totalrndsize, 0) <= 0) {
+            OPENSSL_free(rndbuf);
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return EXT_RETURN_FAIL;
+        }
+        /* set agems from random buffer */
+        rndbufp = rndbuf;
+        memcpy(&agems, rndbufp, sizeof(agems));
+        rndbufp += sizeof(agems);
+        if (dores != 0) {
+            if (!WPACKET_sub_memcpy_u16(pkt, rndbufp,
+                    s->session->ext.ticklen)
+                || !WPACKET_put_bytes_u32(pkt, agems)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                OPENSSL_free(rndbuf);
+                return EXT_RETURN_FAIL;
+            }
+            rndbufp += s->session->ext.ticklen;
+        }
+        if (s->psksession != NULL) {
+            if (!WPACKET_sub_memcpy_u16(pkt, rndbufp, s->psksession_id_len)
+                || !WPACKET_put_bytes_u32(pkt, 0)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                OPENSSL_free(rndbuf);
+                return EXT_RETURN_FAIL;
+            }
+            rndbufp += s->psksession_id_len;
+        }
+        if (!WPACKET_close(pkt)
+            || !WPACKET_start_sub_packet_u16(pkt)
+            || (dores == 1
+                && !WPACKET_sub_memcpy_u8(pkt, rndbufp, reshashsize))
+            || (s->psksession != NULL
+                && !WPACKET_sub_memcpy_u8(pkt, rndbufp, pskhashsize))
+            || !WPACKET_close(pkt)
+            || !WPACKET_close(pkt)) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            OPENSSL_free(rndbuf);
+            return EXT_RETURN_FAIL;
+        }
+        OPENSSL_free(rndbuf);
+        return EXT_RETURN_SENT;
+    }
+#endif /* OPENSSL_NO_ECH */
     if (dores) {
         if (!WPACKET_sub_memcpy_u16(pkt, s->session->ext.tick,
                 s->session->ext.ticklen)
@@ -1248,10 +1612,7 @@ dopsksess:

     msgstart = WPACKET_get_curr(pkt) - msglen;

-    if (dores
-        && tls_psk_do_binder(s, mdres, msgstart, binderoffset, NULL,
-               resbinder, s->session, 1, 0)
-            != 1) {
+    if (dores && tls_psk_do_binder(s, mdres, msgstart, binderoffset, NULL, resbinder, s->session, 1, 0) != 1) {
         /* SSLfatal() already called */
         return EXT_RETURN_FAIL;
     }
@@ -1275,9 +1636,12 @@ EXT_RETURN tls_construct_ctos_post_handshake_auth(SSL_CONNECTION *s, WPACKET *pk
     ossl_unused X509 *x,
     ossl_unused size_t chainidx)
 {
-#ifndef OPENSSL_NO_TLS1_3
+#if !(defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_DTLS1_3))
     if (!s->pha_enabled)
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(s, context, pkt)
+#endif

     /* construct extension - 0 length, no contents */
     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_post_handshake_auth)
@@ -1369,7 +1733,7 @@ int tls_parse_stoc_maxfragmentlen(SSL_CONNECTION *s, PACKET *pkt,
     /* |value| should contains a valid max-fragment-length code. */
     if (!IS_MAX_FRAGMENT_LENGTH_EXT_VALID(value)) {
         SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
-            SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH);
+            SSL_R_TLS_EXT_INVALID_MAX_FRAGMENT_LENGTH);
         return 0;
     }

@@ -1381,7 +1745,7 @@ int tls_parse_stoc_maxfragmentlen(SSL_CONNECTION *s, PACKET *pkt,
      */
     if (value != s->ext.max_fragment_len_mode) {
         SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
-            SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH);
+            SSL_R_TLS_EXT_INVALID_MAX_FRAGMENT_LENGTH);
         return 0;
     }

@@ -1398,68 +1762,32 @@ int tls_parse_stoc_server_name(SSL_CONNECTION *s, PACKET *pkt,
     unsigned int context,
     X509 *x, size_t chainidx)
 {
-    if (s->ext.hostname == NULL) {
+    char *eff_sni = s->ext.hostname;
+
+#ifndef OPENSSL_NO_ECH
+    /* if we tried ECH and failed, the outer is what's expected */
+    if (s->ext.ech.es != NULL && s->ext.ech.success == 0)
+        eff_sni = s->ext.ech.outer_hostname;
+#endif
+    if (eff_sni == NULL) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return 0;
     }
-
     if (PACKET_remaining(pkt) > 0) {
         SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
         return 0;
     }
-
     if (!s->hit) {
         if (s->session->ext.hostname != NULL) {
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             return 0;
         }
-        s->session->ext.hostname = OPENSSL_strdup(s->ext.hostname);
+        s->session->ext.hostname = OPENSSL_strdup(eff_sni);
         if (s->session->ext.hostname == NULL) {
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             return 0;
         }
     }
-
-    return 1;
-}
-
-int tls_parse_stoc_ec_pt_formats(SSL_CONNECTION *s, PACKET *pkt,
-    unsigned int context,
-    X509 *x, size_t chainidx)
-{
-    size_t ecpointformats_len;
-    PACKET ecptformatlist;
-
-    if (!PACKET_as_length_prefixed_1(pkt, &ecptformatlist)) {
-        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
-        return 0;
-    }
-    if (!s->hit) {
-        ecpointformats_len = PACKET_remaining(&ecptformatlist);
-        if (ecpointformats_len == 0) {
-            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_LENGTH);
-            return 0;
-        }
-
-        s->ext.peer_ecpointformats_len = 0;
-        OPENSSL_free(s->ext.peer_ecpointformats);
-        s->ext.peer_ecpointformats = OPENSSL_malloc(ecpointformats_len);
-        if (s->ext.peer_ecpointformats == NULL) {
-            s->ext.peer_ecpointformats_len = 0;
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            return 0;
-        }
-
-        s->ext.peer_ecpointformats_len = ecpointformats_len;
-
-        if (!PACKET_copy_bytes(&ecptformatlist,
-                s->ext.peer_ecpointformats,
-                ecpointformats_len)) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            return 0;
-        }
-    }
-
     return 1;
 }

@@ -1469,7 +1797,7 @@ int tls_parse_stoc_session_ticket(SSL_CONNECTION *s, PACKET *pkt,
 {
     SSL *ssl = SSL_CONNECTION_GET_USER_SSL(s);

-    if (s->ext.session_ticket_cb != NULL && !s->ext.session_ticket_cb(ssl, PACKET_data(pkt), PACKET_remaining(pkt), s->ext.session_ticket_cb_arg)) {
+    if (s->ext.session_ticket_cb != NULL && !s->ext.session_ticket_cb(ssl, PACKET_data(pkt), (int)PACKET_remaining(pkt), s->ext.session_ticket_cb_arg)) {
         SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, SSL_R_BAD_EXTENSION);
         return 0;
     }
@@ -1500,26 +1828,20 @@ int tls_parse_stoc_status_request(SSL_CONNECTION *s, PACKET *pkt,

     /*
      * MUST only be sent if we've requested a status
-     * request message. In TLS <= 1.2 it must also be empty.
+     * request message. In (D)TLS <= 1.2 it must also be empty.
      */
     if (s->ext.status_type != TLSEXT_STATUSTYPE_ocsp) {
         SSLfatal(s, SSL_AD_UNSUPPORTED_EXTENSION, SSL_R_BAD_EXTENSION);
         return 0;
     }
-    if (!SSL_CONNECTION_IS_TLS13(s) && PACKET_remaining(pkt) > 0) {
+    if (!SSL_CONNECTION_IS_VERSION13(s) && PACKET_remaining(pkt) > 0) {
         SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
         return 0;
     }

-    if (SSL_CONNECTION_IS_TLS13(s)) {
-        /* We only know how to handle this if it's for the first Certificate in
-         * the chain. We ignore any other responses.
-         */
-        if (chainidx != 0)
-            return 1;
-
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         /* SSLfatal() already called */
-        return tls_process_cert_status_body(s, pkt);
+        return tls_process_cert_status_body(s, chainidx, pkt);
     }

     /* Set flag to expect CertificateStatus message */
@@ -1640,7 +1962,7 @@ int tls_parse_stoc_npn(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
     }
     if (sctx->ext.npn_select_cb(SSL_CONNECTION_GET_USER_SSL(s),
             &selected, &selected_len,
-            PACKET_data(pkt), PACKET_remaining(pkt),
+            PACKET_data(pkt), (unsigned int)PACKET_remaining(pkt),
             sctx->ext.npn_select_cb_arg)
             != SSL_TLSEXT_ERR_OK
         || selected_len == 0) {
@@ -1782,7 +2104,7 @@ int tls_parse_stoc_use_srtp(SSL_CONNECTION *s, PACKET *pkt,
     /* Throw an error if the server gave us an unsolicited extension */
     clnt = SSL_get_srtp_profiles(SSL_CONNECTION_GET_SSL(s));
     if (clnt == NULL) {
-        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_NO_SRTP_PROFILES);
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_NO_SRTP_PROFILES);
         return 0;
     }

@@ -1799,7 +2121,7 @@ int tls_parse_stoc_use_srtp(SSL_CONNECTION *s, PACKET *pkt,
         }
     }

-    SSLfatal(s, SSL_AD_DECODE_ERROR,
+    SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
         SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST);
     return 0;
 }
@@ -1838,6 +2160,7 @@ int tls_parse_stoc_supported_versions(SSL_CONNECTION *s, PACKET *pkt,
     X509 *x, size_t chainidx)
 {
     unsigned int version;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;

     if (!PACKET_get_net_2(pkt, &version)
         || PACKET_remaining(pkt) != 0) {
@@ -1847,9 +2170,9 @@ int tls_parse_stoc_supported_versions(SSL_CONNECTION *s, PACKET *pkt,

     /*
      * The only protocol version we support which is valid in this extension in
-     * a ServerHello is TLSv1.3 therefore we shouldn't be getting anything else.
+     * a ServerHello is (D)TLSv1.3 therefore we shouldn't be getting anything else.
      */
-    if (version != TLS1_3_VERSION) {
+    if ((int)version != version1_3) {
         SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
             SSL_R_BAD_PROTOCOL_VERSION_NUMBER);
         return 0;
@@ -1873,7 +2196,7 @@ int tls_parse_stoc_key_share(SSL_CONNECTION *s, PACKET *pkt,
     unsigned int context, X509 *x,
     size_t chainidx)
 {
-#ifndef OPENSSL_NO_TLS1_3
+#if !(defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_DTLS1_3))
     unsigned int group_id;
     PACKET encoded_pt;
     EVP_PKEY *ckey = s->s3.tmp.pkey, *skey = NULL;
@@ -1893,9 +2216,17 @@ int tls_parse_stoc_key_share(SSL_CONNECTION *s, PACKET *pkt,
         return 0;
     }

+    /* RFC 8701: reject GREASE values selected by the server */
+    if (ossl_is_grease_value(group_id)) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_KEY_SHARE);
+        return 0;
+    }
+
     if ((context & SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST) != 0) {
         const uint16_t *pgroups = NULL;
         size_t num_groups;
+        const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION
+                                                         : TLS1_3_VERSION;

         if (PACKET_remaining(pkt) != 0) {
             SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
@@ -1919,10 +2250,10 @@ int tls_parse_stoc_key_share(SSL_CONNECTION *s, PACKET *pkt,
             if (group_id == pgroups[i])
                 break;
         }
+
         if (i >= num_groups
             || !tls_group_allowed(s, group_id, SSL_SECOP_CURVE_SUPPORTED)
-            || !tls_valid_group(s, group_id, TLS1_3_VERSION, TLS1_3_VERSION,
-                0, NULL)) {
+            || !tls_valid_group(s, group_id, version1_3, version1_3, NULL, NULL)) {
             SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_KEY_SHARE);
             return 0;
         }
@@ -2012,7 +2343,7 @@ int tls_parse_stoc_key_share(SSL_CONNECTION *s, PACKET *pkt,
         if (tls13_set_encoded_pub_key(skey, PACKET_data(&encoded_pt),
                 PACKET_remaining(&encoded_pt))
             <= 0) {
-            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_ECPOINT);
+            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_KEY_SHARE);
             EVP_PKEY_free(skey);
             return 0;
         }
@@ -2045,6 +2376,7 @@ int tls_parse_stoc_cookie(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
     PACKET cookie;

     if (!PACKET_as_length_prefixed_2(pkt, &cookie)
+        || PACKET_remaining(&cookie) == 0
         || !PACKET_memdup(&cookie, &s->ext.tls13_cookie,
             &s->ext.tls13_cookie_len)) {
         SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
@@ -2113,7 +2445,8 @@ int tls_parse_stoc_psk(SSL_CONNECTION *s, PACKET *pkt,
     unsigned int context, X509 *x,
     size_t chainidx)
 {
-#ifndef OPENSSL_NO_TLS1_3
+#if !(defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_DTLS1_3))
+    SSL_SESSION *sesstmp;
     unsigned int identity;

     if (!PACKET_get_net_2(pkt, &identity) || PACKET_remaining(pkt) != 0) {
@@ -2151,10 +2484,28 @@ int tls_parse_stoc_psk(SSL_CONNECTION *s, PACKET *pkt,
      */
     if ((s->early_data_state != SSL_EARLY_DATA_WRITE_RETRY
             && s->early_data_state != SSL_EARLY_DATA_FINISHED_WRITING)
-        || s->session->ext.max_early_data > 0
-        || s->psksession->ext.max_early_data == 0)
+        || s->ext.early_data_session != s->psksession)
         memcpy(s->early_secret, s->psksession->early_secret, EVP_MAX_MD_SIZE);

+    /*
+     * The psk_use_session_cb()/psk_client_callback() may reuse
+     * the session across connections we can't mutate it directly.
+     */
+    if ((sesstmp = ssl_session_dup(s->psksession, 0)) == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    SSL_SESSION_free(s->psksession);
+    s->psksession = sesstmp;
+
+    /*
+     * s->psksession (now our private copy) was built by the callback, not via
+     * ssl_get_new_session(), so it was never stamped with our own sid_ctx. Do
+     * so now, to avoid rejection of the PSK session in tls_process_server_hello().
+     */
+    memcpy(s->psksession->sid_ctx, s->sid_ctx, s->sid_ctx_length);
+    s->psksession->sid_ctx_length = s->sid_ctx_length;
+
     SSL_SESSION_free(s->session);
     s->session = s->psksession;
     s->psksession = NULL;
@@ -2174,6 +2525,9 @@ EXT_RETURN tls_construct_ctos_client_cert_type(SSL_CONNECTION *sc, WPACKET *pkt,
     sc->ext.client_cert_type_ctos = OSSL_CERT_TYPE_CTOS_NONE;
     if (sc->client_cert_type == NULL)
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(sc, context, pkt)
+#endif

     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_client_cert_type)
         || !WPACKET_start_sub_packet_u16(pkt)
@@ -2226,6 +2580,9 @@ EXT_RETURN tls_construct_ctos_server_cert_type(SSL_CONNECTION *sc, WPACKET *pkt,
     sc->ext.server_cert_type_ctos = OSSL_CERT_TYPE_CTOS_NONE;
     if (sc->server_cert_type == NULL)
         return EXT_RETURN_NOT_SENT;
+#ifndef OPENSSL_NO_ECH
+    ECH_SAME_EXT(sc, context, pkt)
+#endif

     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_server_cert_type)
         || !WPACKET_start_sub_packet_u16(pkt)
@@ -2270,3 +2627,316 @@ int tls_parse_stoc_server_cert_type(SSL_CONNECTION *sc, PACKET *pkt,
     sc->ext.server_cert_type = type;
     return 1;
 }
+
+#ifndef OPENSSL_NO_ECH
+EXT_RETURN tls_construct_ctos_ech(SSL_CONNECTION *s, WPACKET *pkt,
+    unsigned int context, X509 *x,
+    size_t chainidx)
+{
+    int rv = 0, hpke_mode = OSSL_HPKE_MODE_BASE;
+    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+    OSSL_ECHSTORE_ENTRY *ee = NULL;
+    OSSL_HPKE_SUITE hpke_suite = OSSL_HPKE_SUITE_DEFAULT;
+    unsigned char config_id_to_use = 0x00, info[OSSL_ECH_MAX_INFO_LEN];
+    unsigned char *encoded = NULL, *mypub = NULL;
+    size_t cipherlen = 0, aad_len = 0, lenclen = 0, mypub_len = 0;
+    size_t info_len = OSSL_ECH_MAX_INFO_LEN, clear_len = 0, encoded_len = 0;
+    /* whether or not we've been asked to GREASE, one way or another */
+    int grease_opt_set = (s->ext.ech.attempted != 1
+        && ((s->ext.ech.grease == OSSL_ECH_IS_GREASE)
+            || ((s->options & SSL_OP_ECH_GREASE) != 0)));
+
+    /* if we're not doing real ECH and not GREASEing then exit */
+    if (s->ext.ech.attempted_type != TLSEXT_TYPE_ech && grease_opt_set == 0)
+        return EXT_RETURN_NOT_SENT;
+    /* send grease if not really attempting ECH */
+    if (grease_opt_set == 1) {
+        if (s->hello_retry_request == SSL_HRR_PENDING
+            && s->ext.ech.sent != NULL) {
+            /* re-tx already sent GREASEy ECH */
+            if (WPACKET_memcpy(pkt, s->ext.ech.sent,
+                    s->ext.ech.sent_len)
+                != 1) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return EXT_RETURN_FAIL;
+            }
+            return EXT_RETURN_SENT;
+        }
+        /* if nobody set a type, use the default */
+        if (s->ext.ech.attempted_type == OSSL_ECH_type_unknown)
+            s->ext.ech.attempted_type = TLSEXT_TYPE_ech;
+        if (ossl_ech_send_grease(s, pkt) != 1) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return EXT_RETURN_FAIL;
+        }
+        return EXT_RETURN_SENT;
+    }
+
+    /* For the inner CH - we simply include one of these saying "inner" */
+    if (s->ext.ech.ch_depth == 1) {
+        if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_ech)
+            || !WPACKET_start_sub_packet_u16(pkt)
+            || !WPACKET_put_bytes_u8(pkt, OSSL_ECH_INNER_CH_TYPE)
+            || !WPACKET_close(pkt)) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return EXT_RETURN_FAIL;
+        }
+        return EXT_RETURN_SENT;
+    }
+
+    /*
+     * If not GREASEing we prepare sending the outer value - after the
+     * entire thing has been constructed, putting in zeros for now where
+     * we'd otherwise include ECH ciphertext, we later encode and encrypt.
+     * We need to do it that way as we need the rest of the outer CH to
+     * be known and used as AAD input before we do encryption.
+     */
+    if (s->ext.ech.ch_depth != 0)
+        return EXT_RETURN_NOT_SENT;
+    /* Make ClientHelloInner and EncodedClientHelloInner as per spec. */
+    if (ossl_ech_encode_inner(s, &encoded, &encoded_len) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    s->ext.ech.encoded_inner = encoded;
+    s->ext.ech.encoded_inner_len = encoded_len;
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("encoded inner CH", encoded, encoded_len);
+#endif
+    rv = ossl_ech_pick_matching_cfg(s, &ee, &hpke_suite);
+    if (rv != 1 || ee == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    s->ext.ech.attempted_type = ee->version;
+    OSSL_TRACE_BEGIN(TLS)
+    {
+        BIO_printf(trc_out, "EAAE: selected: version: %4x, config %2x\n",
+            ee->version, ee->config_id);
+    }
+    OSSL_TRACE_END(TLS);
+    config_id_to_use = ee->config_id; /* if requested, use a random config_id instead */
+    if ((s->options & SSL_OP_ECH_IGNORE_CID) != 0) {
+        int max_iters = 1000, i = 0;
+
+        /* rejection sample to get a different but random config_id */
+        while (config_id_to_use == ee->config_id) {
+#ifdef OSSL_ECH_SUPERVERBOSE
+            if (i > 0) {
+                OSSL_TRACE_BEGIN(TLS)
+                {
+                    BIO_printf(trc_out, "EAAE: rejected random-config %02x\n",
+                        config_id_to_use);
+                }
+                OSSL_TRACE_END(TLS);
+            }
+#endif
+            if (RAND_bytes_ex(sctx->libctx, &config_id_to_use, 1, 0) <= 0) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return 0;
+            }
+            if (i++ >= max_iters) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return 0;
+            }
+        }
+#ifdef OSSL_ECH_SUPERVERBOSE
+        ossl_ech_pbuf("EAAE: random config_id", &config_id_to_use, 1);
+#endif
+    }
+    s->ext.ech.attempted_cid = config_id_to_use;
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("EAAE: peer pub", ee->pub, ee->pub_len);
+    ossl_ech_pbuf("EAAE: clear", encoded, encoded_len);
+    ossl_ech_pbuf("EAAE: ECHConfig", ee->encoded, ee->encoded_len);
+#endif
+    /*
+     * The AAD is the full outer client hello but with the correct number of
+     * zeros for where the ECH ciphertext octets will later be placed. So we
+     * add the ECH extension to the |pkt| but with zeros for ciphertext, that
+     * forms up the AAD, then after we've encrypted, we'll splice in the actual
+     * ciphertext.
+     * Watch out for the "4" offsets that remove the type and 3-octet length
+     * from the encoded CH as per the spec.
+     */
+    clear_len = ossl_ech_calc_padding(s, ee, encoded_len);
+    if (clear_len == 0) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    lenclen = OSSL_HPKE_get_public_encap_size(hpke_suite);
+    if (s->ext.ech.hpke_ctx == NULL) { /* 1st CH */
+        if (ossl_ech_make_enc_info(ee->encoded, ee->encoded_len,
+                info, &info_len)
+            != 1) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+#ifdef OSSL_ECH_SUPERVERBOSE
+        ossl_ech_pbuf("EAAE info", info, info_len);
+#endif
+        s->ext.ech.hpke_ctx = OSSL_HPKE_CTX_new(hpke_mode, hpke_suite,
+            OSSL_HPKE_ROLE_SENDER,
+            sctx->libctx, sctx->propq);
+        if (s->ext.ech.hpke_ctx == NULL) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        mypub = OPENSSL_malloc(lenclen);
+        if (mypub == NULL) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        mypub_len = lenclen;
+        rv = OSSL_HPKE_encap(s->ext.ech.hpke_ctx, mypub, &mypub_len,
+            ee->pub, ee->pub_len, info, info_len);
+        if (rv != 1) {
+            OPENSSL_free(mypub);
+            mypub = NULL;
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        s->ext.ech.pub = mypub;
+        s->ext.ech.pub_len = mypub_len;
+    } else { /* HRR - retrieve public */
+        mypub = s->ext.ech.pub;
+        mypub_len = s->ext.ech.pub_len;
+        if (mypub == NULL || mypub_len == 0) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+    }
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("EAAE: mypub", mypub, mypub_len);
+    WPACKET_get_total_written(pkt, &aad_len); /* use aad_len for tracing */
+    ossl_ech_pbuf("EAAE pkt b4", WPACKET_get_curr(pkt) - aad_len, aad_len);
+#endif
+    cipherlen = OSSL_HPKE_get_ciphertext_size(hpke_suite, clear_len);
+    if (cipherlen <= clear_len || cipherlen > OSSL_ECH_MAX_PAYLOAD_LEN) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }
+    s->ext.ech.clearlen = clear_len;
+    s->ext.ech.cipherlen = cipherlen;
+    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_ech)
+        || !WPACKET_start_sub_packet_u16(pkt)
+        || !WPACKET_put_bytes_u8(pkt, OSSL_ECH_OUTER_CH_TYPE)
+        || !WPACKET_put_bytes_u16(pkt, hpke_suite.kdf_id)
+        || !WPACKET_put_bytes_u16(pkt, hpke_suite.aead_id)
+        || !WPACKET_put_bytes_u8(pkt, config_id_to_use)
+        || (s->hello_retry_request == SSL_HRR_PENDING
+            && !WPACKET_put_bytes_u16(pkt, 0x00)) /* no pub */
+        || (s->hello_retry_request != SSL_HRR_PENDING
+            && !WPACKET_sub_memcpy_u16(pkt, mypub, mypub_len))
+        || !WPACKET_start_sub_packet_u16(pkt)
+        || !WPACKET_get_total_written(pkt, &s->ext.ech.cipher_offset)
+        || !WPACKET_memset(pkt, 0, cipherlen)
+        || !WPACKET_close(pkt)
+        || !WPACKET_close(pkt)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /* don't count the type + 3-octet length */
+    s->ext.ech.cipher_offset -= 4;
+    return EXT_RETURN_SENT;
+err:
+    return EXT_RETURN_FAIL;
+}
+
+/* if the server thinks we GREASE'd then we may get an ECHConfigList */
+int tls_parse_stoc_ech(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
+    X509 *x, size_t chainidx)
+{
+    size_t rlen = 0;
+    const unsigned char *rval = NULL;
+    unsigned char *srval = NULL;
+    PACKET rcfgs_pkt;
+
+    /*
+     * An HRR will have an ECH extension with the 8-octet confirmation value.
+     * Store it away for when we check it later
+     */
+    if (context == SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST) {
+        if (PACKET_remaining(pkt) != OSSL_ECH_SIGNAL_LEN) {
+            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
+            return 0;
+        }
+        s->ext.ech.hrrsignal_p = (unsigned char *)PACKET_data(pkt);
+        memcpy(s->ext.ech.hrrsignal, s->ext.ech.hrrsignal_p,
+            OSSL_ECH_SIGNAL_LEN);
+        return 1;
+    }
+    /* otherwise we expect retry-configs */
+    if (!PACKET_get_length_prefixed_2(pkt, &rcfgs_pkt)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
+        return 0;
+    }
+    rval = PACKET_data(&rcfgs_pkt);
+    rlen = (unsigned int)PACKET_remaining(&rcfgs_pkt);
+    OPENSSL_free(s->ext.ech.returned);
+    s->ext.ech.returned = NULL;
+    srval = OPENSSL_malloc(rlen + 2);
+    if (srval == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    srval[0] = (rlen >> 8) & 0xff;
+    srval[1] = rlen & 0xff;
+    memcpy(srval + 2, rval, rlen);
+    s->ext.ech.returned = srval;
+    s->ext.ech.returned_len = rlen + 2;
+    return 1;
+}
+#endif /* END_OPENSSL_NO_ECH */
+
+/*
+ * RFC 8701 GREASE extension constructors.  Each writes an empty extension
+ * whose type is a GREASE value (0x?A?A pattern).
+ */
+EXT_RETURN tls_construct_ctos_grease1(SSL_CONNECTION *s, WPACKET *pkt,
+    unsigned int context, X509 *x,
+    size_t chainidx)
+{
+    uint16_t grease_type;
+
+    if (!(s->options & SSL_OP_GREASE) || s->server)
+        return EXT_RETURN_NOT_SENT;
+
+    grease_type = ossl_grease_value(s, OSSL_GREASE_EXT1);
+
+    if (!WPACKET_put_bytes_u16(pkt, grease_type)
+        || !WPACKET_put_bytes_u16(pkt, 0)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return EXT_RETURN_FAIL;
+    }
+
+    return EXT_RETURN_SENT;
+}
+
+EXT_RETURN tls_construct_ctos_grease2(SSL_CONNECTION *s, WPACKET *pkt,
+    unsigned int context, X509 *x,
+    size_t chainidx)
+{
+    uint16_t grease_type;
+
+    if (!(s->options & SSL_OP_GREASE) || s->server)
+        return EXT_RETURN_NOT_SENT;
+
+    grease_type = ossl_grease_value(s, OSSL_GREASE_EXT2);
+
+    /*
+     * RFC 8701 recommends "varying length and contents" for GREASE
+     * extensions.  Extension 1 is empty; extension 2 carries one zero byte
+     * so that servers are tested against both empty and non-empty unknown
+     * extensions.  This mirrors the BoringSSL behaviour.
+     */
+    if (!WPACKET_put_bytes_u16(pkt, grease_type)
+        || !WPACKET_start_sub_packet_u16(pkt)
+        || !WPACKET_put_bytes_u8(pkt, 0)
+        || !WPACKET_close(pkt)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return EXT_RETURN_FAIL;
+    }
+
+    return EXT_RETURN_SENT;
+}
diff --git a/deps/openssl/openssl/ssl/statem/extensions_cust.c b/deps/openssl/openssl/ssl/statem/extensions_cust.c
index f6161e195cd..b1a369847e7 100644
--- a/deps/openssl/openssl/ssl/statem/extensions_cust.c
+++ b/deps/openssl/openssl/ssl/statem/extensions_cust.c
@@ -193,6 +193,74 @@ int custom_ext_add(SSL_CONNECTION *s, int context, WPACKET *pkt, X509 *x,
             if (!(meth->ext_flags & SSL_EXT_FLAG_RECEIVED))
                 continue;
         }
+
+#ifndef OPENSSL_NO_ECH
+        if ((context & SSL_EXT_CLIENT_HELLO) != 0
+            && s->ext.ech.attempted == 1) {
+            if (s->ext.ech.ch_depth == 1) {
+                /* mark custom CH ext for ECH compression, if doing ECH */
+                if (s->ext.ech.n_outer_only >= OSSL_ECH_OUTERS_MAX) {
+                    OSSL_TRACE_BEGIN(TLS)
+                    {
+                        BIO_printf(trc_out,
+                            "Too many outers to compress (max=%d)\n",
+                            OSSL_ECH_OUTERS_MAX);
+                    }
+                    OSSL_TRACE_END(TLS);
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_EXTENSION);
+                    return 0;
+                }
+                s->ext.ech.outer_only[s->ext.ech.n_outer_only] = meth->ext_type;
+                s->ext.ech.n_outer_only++;
+                OSSL_TRACE_BEGIN(TLS)
+                {
+                    BIO_printf(trc_out, "ECH compressing type "
+                                        "0x%04x (tot: %d)\n",
+                        (int)meth->ext_type,
+                        (int)s->ext.ech.n_outer_only);
+                }
+                OSSL_TRACE_END(TLS);
+            }
+            if (s->ext.ech.ch_depth == 0) {
+                /*
+                 * We store/access the index of the extension handler in
+                 * s->ext.ech.ext_ind, as we'd otherwise not know it here.
+                 * Be nice were there a better way to handle that.
+                 */
+                /* copy over the extension octets (if any) to outer */
+                int j, tind = -1;
+                RAW_EXTENSION *raws = NULL;
+
+                /* we gotta find the relevant index to copy over this ext */
+                if (s->clienthello == NULL
+                    || s->clienthello->pre_proc_exts == NULL) {
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_EXTENSION);
+                    return 0;
+                }
+                raws = s->clienthello->pre_proc_exts;
+                for (j = 0; j != (int)s->clienthello->pre_proc_exts_len; j++) {
+                    if (raws[j].type == meth->ext_type) {
+                        tind = j;
+                        break;
+                    }
+                }
+                if (tind == -1) {
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_EXTENSION);
+                    return 0;
+                }
+                if (ossl_ech_copy_inner2outer(s, meth->ext_type, tind,
+                        pkt)
+                    != OSSL_ECH_SAME_EXT_DONE) {
+                    /* for custom exts, we really should have found it */
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_EXTENSION);
+                    return 0;
+                }
+                /* we're done with that one now */
+                continue;
+            }
+        }
+#endif
+
         /*
          * We skip it if the callback is absent - except for a ClientHello where
          * we add an empty extension.
@@ -558,7 +626,6 @@ int SSL_extension_supported(unsigned int ext_type)
 #ifndef OPENSSL_NO_NEXTPROTONEG
     case TLSEXT_TYPE_next_proto_neg:
 #endif
-    case TLSEXT_TYPE_padding:
     case TLSEXT_TYPE_renegotiate:
     case TLSEXT_TYPE_max_fragment_length:
     case TLSEXT_TYPE_server_name:
@@ -588,6 +655,10 @@ int SSL_extension_supported(unsigned int ext_type)
     case TLSEXT_TYPE_compress_certificate:
     case TLSEXT_TYPE_client_cert_type:
     case TLSEXT_TYPE_server_cert_type:
+#ifndef OPENSSL_NO_ECH
+    case TLSEXT_TYPE_ech:
+    case TLSEXT_TYPE_outer_extensions:
+#endif
         return 1;
     default:
         return 0;
diff --git a/deps/openssl/openssl/ssl/statem/extensions_srvr.c b/deps/openssl/openssl/ssl/statem/extensions_srvr.c
index 5218547f591..8b0ed79ad27 100644
--- a/deps/openssl/openssl/ssl/statem/extensions_srvr.c
+++ b/deps/openssl/openssl/ssl/statem/extensions_srvr.c
@@ -12,9 +12,17 @@
 #include "statem_local.h"
 #include "internal/cryptlib.h"
 #include "internal/ssl_unwrap.h"
+#ifndef OPENSSL_NO_ECH
+#include <openssl/rand.h>
+#include <openssl/trace.h>
+#endif

 #define COOKIE_STATE_FORMAT_VERSION 1

+#define MAX_SUPPORTED_GROUPS 128
+#define MAX_KEY_SHARES 16
+#define MAX_PRE_SHARED_KEYS 16
+
 /*
  * 2 bytes for packet length, 2 bytes for format version, 2 bytes for
  * protocol version, 2 bytes for group id, 2 bytes for cipher id, 1 byte for
@@ -32,8 +40,8 @@
  * + 2 bytes for extension block length + 6 bytes for key_share extension
  * + 4 bytes for cookie extension header + the number of bytes in the cookie
  */
-#define MAX_HRR_SIZE (SSL3_HM_HEADER_LENGTH + 2 + SSL3_RANDOM_SIZE + 1 \
-    + SSL_MAX_SSL_SESSION_ID_LENGTH + 2 + 1 + 2 + 6 + 4                \
+#define MAX_HRR_SIZE (DTLS1_HM_HEADER_LENGTH + 2 + SSL3_RANDOM_SIZE + 1 \
+    + SSL_MAX_SSL_SESSION_ID_LENGTH + 2 + 1 + 2 + 6 + 4                 \
     + MAX_COOKIE_SIZE)

 /*
@@ -134,10 +142,10 @@ int tls_parse_ctos_server_name(SSL_CONNECTION *s, PACKET *pkt,
     }

     /*
-     * In TLSv1.2 and below the SNI is associated with the session. In TLSv1.3
+     * In (D)TLSv1.2 and below the SNI is associated with the session. In (D)TLSv1.3
      * we always use the SNI value from the handshake.
      */
-    if (!s->hit || SSL_CONNECTION_IS_TLS13(s)) {
+    if (!s->hit || SSL_CONNECTION_IS_VERSION13(s)) {
         if (PACKET_remaining(&hostname) > TLSEXT_MAXLEN_host_name) {
             SSLfatal(s, SSL_AD_UNRECOGNIZED_NAME, SSL_R_BAD_EXTENSION);
             return 0;
@@ -162,9 +170,9 @@ int tls_parse_ctos_server_name(SSL_CONNECTION *s, PACKET *pkt,
         s->servername_done = 1;
     } else {
         /*
-         * In TLSv1.2 and below we should check if the SNI is consistent between
-         * the initial handshake and the resumption. In TLSv1.3 SNI is not
-         * associated with the session.
+         * In (D)TLSv1.2 and below we should check if the SNI is consistent
+         * between the initial handshake and the resumption. In (D)TLSv1.3 SNI
+         * is not associated with the session.
          */
         s->servername_done = (s->session->ext.hostname != NULL)
             && PACKET_equal(&hostname, s->session->ext.hostname,
@@ -188,7 +196,7 @@ int tls_parse_ctos_maxfragmentlen(SSL_CONNECTION *s, PACKET *pkt,
     /* Received |value| should be a valid max-fragment-length code. */
     if (!IS_MAX_FRAGMENT_LENGTH_EXT_VALID(value)) {
         SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
-            SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH);
+            SSL_R_TLS_EXT_INVALID_MAX_FRAGMENT_LENGTH);
         return 0;
     }

@@ -237,35 +245,11 @@ int tls_parse_ctos_srp(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
 }
 #endif

-int tls_parse_ctos_ec_pt_formats(SSL_CONNECTION *s, PACKET *pkt,
-    unsigned int context,
-    X509 *x, size_t chainidx)
-{
-    PACKET ec_point_format_list;
-
-    if (!PACKET_as_length_prefixed_1(pkt, &ec_point_format_list)
-        || PACKET_remaining(&ec_point_format_list) == 0) {
-        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
-        return 0;
-    }
-
-    if (!s->hit) {
-        if (!PACKET_memdup(&ec_point_format_list,
-                &s->ext.peer_ecpointformats,
-                &s->ext.peer_ecpointformats_len)) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            return 0;
-        }
-    }
-
-    return 1;
-}
-
 int tls_parse_ctos_session_ticket(SSL_CONNECTION *s, PACKET *pkt,
     unsigned int context,
     X509 *x, size_t chainidx)
 {
-    if (s->ext.session_ticket_cb && !s->ext.session_ticket_cb(SSL_CONNECTION_GET_USER_SSL(s), PACKET_data(pkt), PACKET_remaining(pkt), s->ext.session_ticket_cb_arg)) {
+    if (s->ext.session_ticket_cb && !s->ext.session_ticket_cb(SSL_CONNECTION_GET_USER_SSL(s), PACKET_data(pkt), (int)PACKET_remaining(pkt), s->ext.session_ticket_cb_arg)) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return 0;
     }
@@ -340,6 +324,15 @@ int tls_parse_ctos_status_request(SSL_CONNECTION *s, PACKET *pkt,
     if (x != NULL)
         return 1;

+    /*
+     * We only care about this extension if the application
+     * registered a callback. Otherwise, there is nothing to
+     * tell us that a response is needed.
+     */
+    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+    if (sctx == NULL || sctx->ext.status_cb == NULL)
+        return 1;
+
     if (!PACKET_get_1(pkt, (unsigned int *)&s->ext.status_type)) {
         SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
         return 0;
@@ -569,7 +562,7 @@ int tls_parse_ctos_psk_kex_modes(SSL_CONNECTION *s, PACKET *pkt,
     unsigned int context,
     X509 *x, size_t chainidx)
 {
-#ifndef OPENSSL_NO_TLS1_3
+#if !(defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_DTLS1_3))
     PACKET psk_kex_modes;
     unsigned int mode;

@@ -612,7 +605,7 @@ int tls_parse_ctos_psk_kex_modes(SSL_CONNECTION *s, PACKET *pkt,
  * received in the ClientHello and to select the group used of the key exchange
  */

-#ifndef OPENSSL_NO_TLS1_3
+#if !(defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_DTLS1_3))
 /*
  * Accept a key share group by setting the related variables in s->s3 and
  * by generating a pubkey for this group
@@ -634,7 +627,7 @@ static int tls_accept_ksgroup(SSL_CONNECTION *s, uint16_t ksgroup, PACKET *encod
             PACKET_data(encoded_pubkey),
             PACKET_remaining(encoded_pubkey))
         <= 0) {
-        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_ECPOINT);
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_KEY_SHARE);
         return 0;
     }
     return 1;
@@ -652,26 +645,42 @@ static KS_EXTRACTION_RESULT extract_keyshares(SSL_CONNECTION *s, PACKET *key_sha
     const uint16_t *clntgroups, size_t clnt_num_groups,
     const uint16_t *srvrgroups, size_t srvr_num_groups,
     uint16_t **keyshares_arr, PACKET **encoded_pubkey_arr,
-    size_t *keyshares_cnt, size_t *keyshares_max)
+    size_t *keyshares_cnt)
 {
     PACKET encoded_pubkey;
     size_t key_share_pos = 0;
     size_t previous_key_share_pos = 0;
     unsigned int group_id = 0;
+    unsigned int i;
+
+    /*
+     * Theoretically there is no limit on the number of keyshares as long as
+     * they are less than 2^16 bytes in total. It costs us something for each
+     * keyshare to confirm the groups are valid, so we restrict this to a
+     * sensible number (MAX_KEY_SHARES == 16). Any keyshares over this limit are
+     * simply ignored.
+     */

     /* Prepare memory to hold the extracted key share groups and related pubkeys */
-    *keyshares_arr = OPENSSL_malloc(*keyshares_max * sizeof(**keyshares_arr));
+    *keyshares_arr = OPENSSL_malloc_array(MAX_KEY_SHARES,
+        sizeof(**keyshares_arr));
     if (*keyshares_arr == NULL) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         goto failure;
     }
-    *encoded_pubkey_arr = OPENSSL_malloc(*keyshares_max * sizeof(**encoded_pubkey_arr));
+    *encoded_pubkey_arr = OPENSSL_malloc_array(MAX_KEY_SHARES,
+        sizeof(**encoded_pubkey_arr));
     if (*encoded_pubkey_arr == NULL) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         goto failure;
     }

-    while (PACKET_remaining(key_share_list) > 0) {
+    /*
+     * We limit the number of key shares we are willing to process to
+     * MAX_KEY_SHARES regardless of whether we include them in keyshares_arr or
+     * not.
+     */
+    for (i = 0; PACKET_remaining(key_share_list) > 0 && i < MAX_KEY_SHARES; i++) {
         /* Get the group_id for the current share and its encoded_pubkey */
         if (!PACKET_get_net_2(key_share_list, &group_id)
             || !PACKET_get_length_prefixed_2(key_share_list, &encoded_pubkey)
@@ -693,7 +702,7 @@ static KS_EXTRACTION_RESULT extract_keyshares(SSL_CONNECTION *s, PACKET *key_sha

         /*
          * Check if this share is in supported_groups sent from client
-         * RFC 8446 also mandates that clients send keyshares in the same
+         * RFC 9846 also mandates that clients send keyshares in the same
          * order as listed in the supported groups extension, but its not
          * required that the server check that, and some clients violate this
          * so instead of failing the connection when that occurs, log a trace
@@ -705,7 +714,7 @@ static KS_EXTRACTION_RESULT extract_keyshares(SSL_CONNECTION *s, PACKET *key_sha
         }

         if (key_share_pos < previous_key_share_pos)
-            OSSL_TRACE1(TLS, "key share group id %d is out of RFC 8446 order\n", group_id);
+            OSSL_TRACE1(TLS, "key share group id %d is out of RFC 9846 order\n", group_id);

         previous_key_share_pos = key_share_pos;

@@ -729,7 +738,7 @@ static KS_EXTRACTION_RESULT extract_keyshares(SSL_CONNECTION *s, PACKET *key_sha
         if (!check_in_list(s, group_id, srvrgroups, srvr_num_groups, 1, NULL)
             || !tls_group_allowed(s, group_id, SSL_SECOP_CURVE_SUPPORTED)
             || !tls_valid_group(s, group_id, TLS1_3_VERSION, TLS1_3_VERSION,
-                0, NULL)) {
+                NULL, NULL)) {
             /* Share not suitable or not supported, check next share */
             continue;
         }
@@ -737,33 +746,6 @@ static KS_EXTRACTION_RESULT extract_keyshares(SSL_CONNECTION *s, PACKET *key_sha
         /* Memorize this key share group ID and its encoded point */
         (*keyshares_arr)[*keyshares_cnt] = group_id;
         (*encoded_pubkey_arr)[(*keyshares_cnt)++] = encoded_pubkey;
-
-        /*
-         * Memory management (remark: While limiting the client to only allow
-         * a maximum of OPENSSL_CLIENT_MAX_KEY_SHARES to be sent, the server can
-         * handle any number of key shares)
-         */
-        if (*keyshares_cnt == *keyshares_max) {
-            PACKET *tmp_pkt;
-            uint16_t *tmp = OPENSSL_realloc(*keyshares_arr,
-                (*keyshares_max + GROUPLIST_INCREMENT) * sizeof(**keyshares_arr));
-
-            if (tmp == NULL) {
-                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-                goto failure;
-            }
-
-            *keyshares_arr = tmp;
-            tmp_pkt = OPENSSL_realloc(*encoded_pubkey_arr,
-                (*keyshares_max + GROUPLIST_INCREMENT) * sizeof(**encoded_pubkey_arr));
-            if (tmp_pkt == NULL) {
-                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-                goto failure;
-            }
-
-            *encoded_pubkey_arr = tmp_pkt;
-            *keyshares_max += GROUPLIST_INCREMENT;
-        }
     }

     return EXTRACTION_SUCCESS;
@@ -782,7 +764,7 @@ failure:
  * assign to selected_group and also set the related index in the candidate group list,
  * or set selected_group to 0 if no overlap
  */
-#ifndef OPENSSL_NO_TLS1_3
+#if !defined(OPENSSL_NO_TLS1_3) || !defined(OPENSSL_NO_DTLS1_3)
 static void check_overlap(SSL_CONNECTION *s,
     const uint16_t *prio_groups, size_t prio_num_groups,
     const uint16_t *candidate_groups, size_t candidate_num_groups,
@@ -792,6 +774,7 @@ static void check_overlap(SSL_CONNECTION *s,
     uint16_t current_group;
     size_t group_idx = prio_num_groups;
     size_t new_group_idx = 0;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;

     *candidate_group_idx = 0;
     *prio_group_idx = 0;
@@ -802,8 +785,8 @@ static void check_overlap(SSL_CONNECTION *s,
                 prio_num_groups, 1, &new_group_idx)
             || !tls_group_allowed(s, candidate_groups[current_group],
                 SSL_SECOP_CURVE_SUPPORTED)
-            || !tls_valid_group(s, candidate_groups[current_group], TLS1_3_VERSION,
-                TLS1_3_VERSION, 0, NULL))
+            || !tls_valid_group(s, candidate_groups[current_group], version1_3,
+                version1_3, NULL, NULL))
             /* No overlap or group not suitable, check next group */
             continue;

@@ -814,7 +797,7 @@ static void check_overlap(SSL_CONNECTION *s,
         if (new_group_idx < group_idx) {
             group_idx = new_group_idx;
             *candidate_group_idx = current_group;
-            *prio_group_idx = group_idx;
+            *prio_group_idx = (int)group_idx;
             *selected_group = prio_groups[group_idx];
         }
     }
@@ -824,7 +807,7 @@ static void check_overlap(SSL_CONNECTION *s,
 int tls_parse_ctos_key_share(SSL_CONNECTION *s, PACKET *pkt,
     unsigned int context, X509 *x, size_t chainidx)
 {
-#ifndef OPENSSL_NO_TLS1_3
+#if !(defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_DTLS1_3))
     PACKET key_share_list;
     const uint16_t *clntgroups, *srvrgroups;
     const size_t *srvrtuples;
@@ -833,7 +816,6 @@ int tls_parse_ctos_key_share(SSL_CONNECTION *s, PACKET *pkt,
     PACKET *encoded_pubkey_arr = NULL;
     uint16_t *keyshares_arr = NULL;
     size_t keyshares_cnt = 0;
-    size_t keyshares_max = GROUPLIST_INCREMENT;
     /* We conservatively assume that we did not find a suitable group */
     uint16_t group_id_candidate = 0;
     KS_EXTRACTION_RESULT ks_extraction_result;
@@ -844,10 +826,14 @@ int tls_parse_ctos_key_share(SSL_CONNECTION *s, PACKET *pkt,
     if (s->hit && (s->ext.psk_kex_mode & TLSEXT_KEX_MODE_FLAG_KE_DHE) == 0)
         return 1;

-    /* Sanity check */
+    /*
+     * If prior Client Hello in HRR set the peer_temp clear it out to process
+     * the key share in the second client hello
+     */
     if (s->s3.peer_tmp != NULL) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-        return 0;
+        EVP_PKEY_free(s->s3.peer_tmp);
+        s->s3.peer_tmp = NULL;
+        s->s3.group_id = 0;
     }

     if (!PACKET_as_length_prefixed_2(pkt, &key_share_list)) {
@@ -888,7 +874,7 @@ int tls_parse_ctos_key_share(SSL_CONNECTION *s, PACKET *pkt,
         clntgroups, clnt_num_groups,
         srvrgroups, srvr_num_groups,
         &keyshares_arr, &encoded_pubkey_arr,
-        &keyshares_cnt, &keyshares_max);
+        &keyshares_cnt);

     if (ks_extraction_result == EXTRACTION_FAILURE) /* Fatal error during tests */
         return 0; /* Memory already freed and SSLfatal already called */
@@ -918,7 +904,7 @@ int tls_parse_ctos_key_share(SSL_CONNECTION *s, PACKET *pkt,
         int prio_group_idx = 0, candidate_group_idx = 0;

         /* Server or client preference ? */
-        if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE) {
+        if (s->options & SSL_OP_SERVER_PREFERENCE) {
             /* Server preference */
             /* Is there overlap with a key share group?  */
             check_overlap(s,
@@ -1003,7 +989,7 @@ err:
 int tls_parse_ctos_cookie(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
     X509 *x, size_t chainidx)
 {
-#ifndef OPENSSL_NO_TLS1_3
+#if !(defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_DTLS1_3))
     unsigned int format, version, key_share, group_id;
     EVP_MD_CTX *hctx;
     EVP_PKEY *pkey;
@@ -1016,10 +1002,26 @@ int tls_parse_ctos_cookie(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
     uint64_t tm, now;
     SSL *ssl = SSL_CONNECTION_GET_SSL(s);
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+    const int version1_2 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_2_VERSION : TLS1_2_VERSION;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;
+    size_t msgbody_offs = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_HM_HEADER_LENGTH
+            - SSL3_HM_HEADER_LENGTH
+                                                    : 0;
+    int verify_ret = 0;
+
+#if !defined(OPENSSL_NO_DTLS)
+    DTLS_LISTENER *dl = (s->d1 != NULL && s->d1->listener != NULL)
+        ? (DTLS_LISTENER *)s->d1->listener
+        : NULL;
+    int have_verify_cb = (sctx->verify_stateless_cookie_cb != NULL)
+        || (dl != NULL && dl->require_hrr_cookie)
+        || (SSL_CONNECTION_IS_DTLS(s) && sctx->app_verify_cookie_cb != NULL);
+#else
+    int have_verify_cb = (sctx->verify_stateless_cookie_cb != NULL);
+#endif

     /* Ignore any cookie if we're not set up to verify it */
-    if (sctx->verify_stateless_cookie_cb == NULL
-        || (s->s3.flags & TLS1_FLAGS_STATELESS) == 0)
+    if (!have_verify_cb || !tls_hrr_cookie_required(s))
         return 1;

     if (!PACKET_as_length_prefixed_2(pkt, &cookie)) {
@@ -1090,7 +1092,7 @@ int tls_parse_ctos_cookie(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
         SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
         return 0;
     }
-    if (version != TLS1_3_VERSION) {
+    if ((int)version != version1_3) {
         SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
             SSL_R_BAD_PROTOCOL_VERSION_NUMBER);
         return 0;
@@ -1134,10 +1136,27 @@ int tls_parse_ctos_cookie(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
     }

     /* Verify the app cookie */
-    if (sctx->verify_stateless_cookie_cb(SSL_CONNECTION_GET_USER_SSL(s),
+#if !defined(OPENSSL_NO_DTLS)
+    if (dl != NULL && dl->require_hrr_cookie && sctx->verify_stateless_cookie_cb == NULL) {
+        verify_ret = ossl_dtls_listener_verify_stateless_cookie_cb(
+            SSL_CONNECTION_GET_USER_SSL(s),
+            PACKET_data(&appcookie),
+            PACKET_remaining(&appcookie));
+    } else if (sctx->verify_stateless_cookie_cb == NULL
+        && SSL_CONNECTION_IS_DTLS(s) && sctx->app_verify_cookie_cb != NULL) {
+        /* Fall back to the HelloVerifyRequest cookie callbacks */
+        verify_ret = sctx->app_verify_cookie_cb(SSL_CONNECTION_GET_USER_SSL(s),
+            PACKET_data(&appcookie),
+            (unsigned int)PACKET_remaining(&appcookie));
+    } else
+#endif
+        if (sctx->verify_stateless_cookie_cb != NULL) {
+        verify_ret = sctx->verify_stateless_cookie_cb(SSL_CONNECTION_GET_USER_SSL(s),
             PACKET_data(&appcookie),
-            PACKET_remaining(&appcookie))
-        == 0) {
+            PACKET_remaining(&appcookie));
+    }
+
+    if (verify_ret == 0) {
         SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_COOKIE_MISMATCH);
         return 0;
     }
@@ -1152,8 +1171,15 @@ int tls_parse_ctos_cookie(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
         return 0;
     }
     if (!WPACKET_put_bytes_u8(&hrrpkt, SSL3_MT_SERVER_HELLO)
-        || !WPACKET_start_sub_packet_u24(&hrrpkt)
-        || !WPACKET_put_bytes_u16(&hrrpkt, TLS1_2_VERSION)
+        || !WPACKET_start_sub_packet_u24_at_offset(&hrrpkt, msgbody_offs)
+        /*
+         * We are reconstructing the HRR to be able to calculate the
+         * transcript hash.
+         * Since HRR is only allowed for (D)TLSv1.3 and transcript hash does
+         * not include the values of message_seq, fragment_offset and
+         * fragment_length, setting these values is not required.
+         */
+        || !WPACKET_put_bytes_u16(&hrrpkt, version1_2)
         || !WPACKET_memcpy(&hrrpkt, hrrrandom, SSL3_RANDOM_SIZE)
         || !WPACKET_sub_memcpy_u8(&hrrpkt, s->tmp_session_id,
             s->tmp_session_id_len)
@@ -1227,13 +1253,20 @@ int tls_parse_ctos_supported_groups(SSL_CONNECTION *s, PACKET *pkt,
         return 0;
     }

-    if (!s->hit || SSL_CONNECTION_IS_TLS13(s)) {
+    if (!s->hit || SSL_CONNECTION_IS_VERSION13(s)) {
         OPENSSL_free(s->ext.peer_supportedgroups);
         s->ext.peer_supportedgroups = NULL;
         s->ext.peer_supportedgroups_len = 0;
+        /*
+         * We only pay attention to the first 128 supported groups and ignore
+         * any beyond that limit. Theoretically this could cause problems if
+         * the client also uses one of these groups (say in a key share extension)
+         * - but why would any valid client be sending such a huge supported
+         * groups list?
+         */
         if (!tls1_save_u16(&supported_groups_list,
                 &s->ext.peer_supportedgroups,
-                &s->ext.peer_supportedgroups_len)) {
+                &s->ext.peer_supportedgroups_len, MAX_SUPPORTED_GROUPS)) {
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             return 0;
         }
@@ -1328,13 +1361,21 @@ int tls_parse_ctos_psk(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
         SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
         return 0;
     }
+    /* There must always be at least one identity in the list */
+    if (PACKET_remaining(&identities) == 0) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }

     s->ext.ticket_expected = 0;
-    for (id = 0; PACKET_remaining(&identities) != 0; id++) {
+    for (id = 0; PACKET_remaining(&identities) != 0 && id < MAX_PRE_SHARED_KEYS; id++) {
         PACKET identity;
         unsigned long ticket_agel;
         size_t idlen;

+        /* Reset for each fresh iteration. */
+        sess = NULL;
+
         if (!PACKET_get_length_prefixed_2(&identities, &identity)
             || !PACKET_get_net_4(&identities, &ticket_agel)) {
             SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
@@ -1369,15 +1410,18 @@ int tls_parse_ctos_psk(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
                 sizeof(pskdata));
             OPENSSL_free(pskid);
             if (pskdatalen > PSK_MAX_PSK_LEN) {
+                OPENSSL_cleanse(pskdata, sizeof(pskdata));
                 SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
                 return 0;
             } else if (pskdatalen > 0) {
                 const SSL_CIPHER *cipher;
                 const unsigned char tls13_aes128gcmsha256_id[] = { 0x13, 0x01 };
+                const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION
+                                                                 : TLS1_3_VERSION;

                 /*
                  * We found a PSK using an old style callback. We don't know
-                 * the digest so we default to SHA256 as per the TLSv1.3 spec
+                 * the digest so we default to SHA256 as per the (D)TLSv1.3 spec
                  */
                 cipher = SSL_CIPHER_find(SSL_CONNECTION_GET_SSL(s),
                     tls13_aes128gcmsha256_id);
@@ -1388,12 +1432,12 @@ int tls_parse_ctos_psk(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
                 }

                 sess = SSL_SESSION_new();
+
                 if (sess == NULL
                     || !SSL_SESSION_set1_master_key(sess, pskdata,
                         pskdatalen)
                     || !SSL_SESSION_set_cipher(sess, cipher)
-                    || !SSL_SESSION_set_protocol_version(sess,
-                        TLS1_3_VERSION)) {
+                    || !SSL_SESSION_set_protocol_version(sess, version1_3)) {
                     OPENSSL_cleanse(pskdata, pskdatalen);
                     SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
                     goto err;
@@ -1404,7 +1448,10 @@ int tls_parse_ctos_psk(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
 #endif /* OPENSSL_NO_PSK */

         if (sess != NULL) {
-            /* We found a PSK */
+            /*
+             * We found an external (not a resumption) PSK - duplicate the
+             * session, set the session id to our own, and mark it as external.
+             */
             SSL_SESSION *sesstmp = ssl_session_dup(sess, 0);

             if (sesstmp == NULL) {
@@ -1420,7 +1467,7 @@ int tls_parse_ctos_psk(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
              */
             memcpy(sess->sid_ctx, s->sid_ctx, s->sid_ctx_length);
             sess->sid_ctx_length = s->sid_ctx_length;
-            ext = 1;
+            sess->psk_external = ext = 1;
             if (id == 0)
                 s->ext.early_data_ok = 1;
             s->ext.ticket_expected = 1;
@@ -1464,8 +1511,8 @@ int tls_parse_ctos_psk(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
                 continue;
             }

-            age = ossl_time_subtract(ossl_ms2time(ticket_agel),
-                ossl_ms2time(sess->ext.tick_age_add));
+            /* Undo ticket age obfuscation modulo 2^32 (RFC 9846, 4.3.11.1). */
+            age = ossl_ms2time((uint32_t)(ticket_agel - sess->ext.tick_age_add));
             t = ossl_time_subtract(ossl_time_now(), sess->time);

             /*
@@ -1491,6 +1538,28 @@ int tls_parse_ctos_psk(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
                  */
                 s->ext.early_data_ok = 1;
             }
+            /* This PSK is not external, use the correct binder label, ... */
+            ext = 0;
+        }
+
+        /*
+         * The binder below, and the 0-RTT gate, both key off sess->cipher --
+         * specifically its handshake digest (algorithm2), which is only
+         * meaningful for a TLS 1.3 (or later) ciphersuite. A
+         * psk_find_session_cb() may return a session with no cipher, or a
+         * pre-TLS-1.3 one; ignore it and fall back to a full handshake rather
+         * than dereference a NULL cipher or misread algorithm2.
+         *
+         * The protocol version is deliberately not checked here:
+         * ssl_get_prev_session() vets it the moment we return and discards any
+         * mismatch, freeing the session so nothing leaks into a ticket or cache.
+         */
+        if (sess->cipher == NULL || sess->cipher->min_tls < TLS1_3_VERSION) {
+            SSL_SESSION_free(sess);
+            sess = NULL;
+            s->ext.early_data_ok = 0;
+            s->ext.ticket_expected = 1;
+            continue;
         }

         md = ssl_md(sctx, sess->cipher->algorithm2);
@@ -1513,13 +1582,36 @@ int tls_parse_ctos_psk(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
             s->ext.ticket_expected = 1;
             continue;
         }
+        /*
+         * Same-hash ciphersuite changes are allowed for TLSv1.3 PSK
+         * resumption, but RFC 9846 Section 4.3.10 requires the selected
+         * ciphersuite to match the selected PSK before accepting early data.
+         */
+        if (sess->cipher->id != s->s3.tmp.new_cipher->id)
+            s->ext.early_data_ok = 0;
         break;
     }

-    if (sess == NULL)
-        return 1;
+    if (sess == NULL) {
+        size_t j;
+
+        for (j = 0; j < s->ssl_pkey_num && !ssl_has_cert(s, (int)j); j++)
+            ;
+        if (j < s->ssl_pkey_num) {
+            /* A certificate exists. Fallback to a full handshake */
+            return 1;
+        }
+        /*
+         * decrypt_error here to keep the alert the same as if the binder
+         * failed. See RFC9846 Appendix F.6. Note we make no attempt to do this
+         * in constant time compared to verifying the binder. None of this code
+         * is constant time anyway.
+         */
+        SSLfatal(s, SSL_AD_DECRYPT_ERROR, SSL_R_BAD_EXTENSION);
+        goto err;
+    }

-    binderoffset = PACKET_data(pkt) - (const unsigned char *)s->init_buf->data;
+    binderoffset = PACKET_data(pkt) - PACKET_msg_start(pkt);
     hashsize = EVP_MD_get_size(md);
     if (hashsize <= 0)
         goto err;
@@ -1540,9 +1632,8 @@ int tls_parse_ctos_psk(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
         SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
         goto err;
     }
-    if (tls_psk_do_binder(s, md, (const unsigned char *)s->init_buf->data,
-            binderoffset, PACKET_data(&binder), NULL, sess, 0,
-            ext)
+    if (tls_psk_do_binder(s, md, PACKET_msg_start(pkt), binderoffset,
+            PACKET_data(&binder), NULL, sess, 0, ext)
         != 1) {
         /* SSLfatal() already called */
         goto err;
@@ -1609,10 +1700,10 @@ EXT_RETURN tls_construct_stoc_server_name(SSL_CONNECTION *s, WPACKET *pkt,
         return EXT_RETURN_NOT_SENT;

     /*
-     * Prior to TLSv1.3 we ignore any SNI in the current handshake if resuming.
+     * Prior to (D)TLSv1.3 we ignore any SNI in the current handshake if resuming.
      * We just use the servername from the initial handshake.
      */
-    if (s->hit && !SSL_CONNECTION_IS_TLS13(s))
+    if (s->hit && !SSL_CONNECTION_IS_VERSION13(s))
         return EXT_RETURN_NOT_SENT;

     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_server_name)
@@ -1653,14 +1744,29 @@ EXT_RETURN tls_construct_stoc_ec_pt_formats(SSL_CONNECTION *s, WPACKET *pkt,
 {
     unsigned long alg_k = s->s3.tmp.new_cipher->algorithm_mkey;
     unsigned long alg_a = s->s3.tmp.new_cipher->algorithm_auth;
-    int using_ecc = ((alg_k & SSL_kECDHE) || (alg_a & SSL_aECDSA))
-        && (s->ext.peer_ecpointformats != NULL);
+    int using_ecc = (alg_k & SSL_kECDHE) || (alg_a & SSL_aECDSA);
     const unsigned char *plist;
     size_t plistlen;

-    if (!using_ecc)
+    /*
+     * The extension is irrelevant unless we're negotiating an ECC
+     * ciphersuite at TLS 1.2 or below, and the peer sent a list.  This
+     * is the first point at which the chosen ciphersuite is known, so
+     * the RFC 4492/8422 section 5.1.2 check for the required
+     * 'uncompressed' codepoint also happens here.
+     */
+    if (!using_ecc || s->ext.peer_ecpointformats == NULL)
         return EXT_RETURN_NOT_SENT;

+    if (memchr(s->ext.peer_ecpointformats,
+            TLSEXT_ECPOINTFORMAT_uncompressed,
+            s->ext.peer_ecpointformats_len)
+        == NULL) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
+            SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST);
+        return EXT_RETURN_FAIL;
+    }
+
     tls1_get_formatlist(s, &plist, &plistlen);
     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_ec_point_formats)
         || !WPACKET_start_sub_packet_u16(pkt)
@@ -1697,7 +1803,7 @@ EXT_RETURN tls_construct_stoc_supported_groups(SSL_CONNECTION *s, WPACKET *pkt,
     for (i = 0; i < numgroups; i++) {
         uint16_t group = groups[i];

-        if (tls_valid_group(s, group, version, version, 0, NULL)
+        if (tls_valid_group(s, group, version, version, NULL, NULL)
             && tls_group_allowed(s, group, SSL_SECOP_CURVE_SUPPORTED)) {
             if (first) {
                 /*
@@ -1737,7 +1843,15 @@ EXT_RETURN tls_construct_stoc_session_ticket(SSL_CONNECTION *s, WPACKET *pkt,
     unsigned int context, X509 *x,
     size_t chainidx)
 {
-    if (!s->ext.ticket_expected || !tls_use_ticket(s)) {
+    /*
+     * Don't tell the client to expect a NewSessionTicket when any
+     * ticket we'd mint would be rejected by ssl_get_prev_session()
+     * whenever SSL_VERIFY_PEER is set with no sid_ctx configured (see
+     * the checks there).  In TLS 1.2, once promised the ticket MUST
+     * be sent.
+     */
+    if (!s->ext.ticket_expected || !tls_use_ticket(s)
+        || ((s->verify_mode & SSL_VERIFY_PEER) != 0 && s->sid_ctx_length == 0)) {
         s->ext.ticket_expected = 0;
         return EXT_RETURN_NOT_SENT;
     }
@@ -1756,6 +1870,8 @@ EXT_RETURN tls_construct_stoc_status_request(SSL_CONNECTION *s, WPACKET *pkt,
     unsigned int context, X509 *x,
     size_t chainidx)
 {
+    OCSP_RESPONSE *resp;
+
     /* We don't currently support this extension inside a CertificateRequest */
     if (context == SSL_EXT_TLS1_3_CERTIFICATE_REQUEST)
         return EXT_RETURN_NOT_SENT;
@@ -1763,7 +1879,11 @@ EXT_RETURN tls_construct_stoc_status_request(SSL_CONNECTION *s, WPACKET *pkt,
     if (!s->ext.status_expected)
         return EXT_RETURN_NOT_SENT;

-    if (SSL_CONNECTION_IS_TLS13(s) && chainidx != 0)
+    /* Try to retrieve OCSP response for the actual certificate */
+    resp = ossl_get_ocsp_response(s, (int)chainidx);
+
+    /* If no OCSP response was found the extension is not sent */
+    if (resp == NULL)
         return EXT_RETURN_NOT_SENT;

     if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_status_request)
@@ -1773,11 +1893,12 @@ EXT_RETURN tls_construct_stoc_status_request(SSL_CONNECTION *s, WPACKET *pkt,
     }

     /*
-     * In TLSv1.3 we include the certificate status itself. In <= TLSv1.2 we
+     * In (D)TLSv1.3 we include the certificate status itself. In <= (D)TLSv1.2 we
      * send back an empty extension, with the certificate status appearing as a
      * separate message
      */
-    if (SSL_CONNECTION_IS_TLS13(s) && !tls_construct_cert_status_body(s, pkt)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)
+        && !tls_construct_cert_status_body(s, resp, pkt)) {
         /* SSLfatal() already called */
         return EXT_RETURN_FAIL;
     }
@@ -1914,7 +2035,7 @@ EXT_RETURN tls_construct_stoc_supported_versions(SSL_CONNECTION *s, WPACKET *pkt
     unsigned int context, X509 *x,
     size_t chainidx)
 {
-    if (!ossl_assert(SSL_CONNECTION_IS_TLS13(s))) {
+    if (!ossl_assert(SSL_CONNECTION_IS_VERSION13(s))) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return EXT_RETURN_FAIL;
     }
@@ -1930,21 +2051,25 @@ EXT_RETURN tls_construct_stoc_supported_versions(SSL_CONNECTION *s, WPACKET *pkt
     return EXT_RETURN_SENT;
 }

+/* Does the HelloRetryRequest ask the client for a different key_share? */
+static int hrr_sends_key_share(const SSL_CONNECTION *s)
+{
+    return s->s3.peer_tmp == NULL && s->s3.group_id != 0;
+}
+
 EXT_RETURN tls_construct_stoc_key_share(SSL_CONNECTION *s, WPACKET *pkt,
     unsigned int context, X509 *x,
     size_t chainidx)
 {
-#ifndef OPENSSL_NO_TLS1_3
+#if !(defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_DTLS1_3))
     unsigned char *encoded_pubkey;
     size_t encoded_pubkey_len = 0;
     EVP_PKEY *ckey = s->s3.peer_tmp, *skey = NULL;
     const TLS_GROUP_INFO *ginf = NULL;

     if (s->hello_retry_request == SSL_HRR_PENDING) {
-        if (ckey != NULL) {
-            /* Original key_share was acceptable so don't ask for another one */
+        if (!hrr_sends_key_share(s))
             return EXT_RETURN_NOT_SENT;
-        }
         if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_key_share)
             || !WPACKET_start_sub_packet_u16(pkt)
             || !WPACKET_put_bytes_u16(pkt, s->s3.group_id)
@@ -2017,11 +2142,12 @@ EXT_RETURN tls_construct_stoc_key_share(SSL_CONNECTION *s, WPACKET *pkt,
         /*
          * This causes the crypto state to be updated based on the derived keys
          */
-        s->s3.tmp.pkey = skey;
         if (ssl_derive(s, skey, ckey, 1) == 0) {
             /* SSLfatal() already called */
+            EVP_PKEY_free(skey);
             return EXT_RETURN_FAIL;
         }
+        s->s3.tmp.pkey = skey;
     } else {
         /* KEM mode */
         unsigned char *ct = NULL;
@@ -2063,6 +2189,7 @@ EXT_RETURN tls_construct_stoc_key_share(SSL_CONNECTION *s, WPACKET *pkt,
     s->s3.did_kex = 1;
     return EXT_RETURN_SENT;
 #else
+    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
     return EXT_RETURN_FAIL;
 #endif
 }
@@ -2071,21 +2198,34 @@ EXT_RETURN tls_construct_stoc_cookie(SSL_CONNECTION *s, WPACKET *pkt,
     unsigned int context,
     X509 *x, size_t chainidx)
 {
-#ifndef OPENSSL_NO_TLS1_3
+#if !(defined(OPENSSL_NO_TLS1_3) && defined(OPENSSL_NO_DTLS1_3))
     unsigned char *hashval1, *hashval2, *appcookie1, *appcookie2, *cookie;
     unsigned char *hmac, *hmac2;
-    size_t startlen, ciphlen, totcookielen, hashlen, hmaclen, appcookielen;
+    size_t startlen, ciphlen, totcookielen, hashlen, hmaclen;
+    size_t appcookielen = 0;
     EVP_MD_CTX *hctx;
     EVP_PKEY *pkey;
     int ret = EXT_RETURN_FAIL;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
     SSL *ssl = SSL_CONNECTION_GET_SSL(s);
     SSL *ussl = SSL_CONNECTION_GET_USER_SSL(s);
+    const int version = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;
+    int gen_ret = 0;
+#if !defined(OPENSSL_NO_DTLS)
+    DTLS_LISTENER *dl = (s->d1 != NULL && s->d1->listener != NULL)
+        ? (DTLS_LISTENER *)s->d1->listener
+        : NULL;
+    int have_gen_cb = (sctx->gen_stateless_cookie_cb != NULL)
+        || (dl != NULL && dl->require_hrr_cookie)
+        || (SSL_CONNECTION_IS_DTLS(s) && sctx->app_gen_cookie_cb != NULL);
+#else
+    int have_gen_cb = (sctx->gen_stateless_cookie_cb != NULL);
+#endif

-    if ((s->s3.flags & TLS1_FLAGS_STATELESS) == 0)
+    if (!tls_hrr_cookie_required(s))
         return EXT_RETURN_NOT_SENT;

-    if (sctx->gen_stateless_cookie_cb == NULL) {
+    if (!have_gen_cb) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_COOKIE_CALLBACK_SET);
         return EXT_RETURN_FAIL;
     }
@@ -2096,12 +2236,12 @@ EXT_RETURN tls_construct_stoc_cookie(SSL_CONNECTION *s, WPACKET *pkt,
         || !WPACKET_get_total_written(pkt, &startlen)
         || !WPACKET_reserve_bytes(pkt, MAX_COOKIE_SIZE, &cookie)
         || !WPACKET_put_bytes_u16(pkt, COOKIE_STATE_FORMAT_VERSION)
-        || !WPACKET_put_bytes_u16(pkt, TLS1_3_VERSION)
+        || !WPACKET_put_bytes_u16(pkt, version)
         || !WPACKET_put_bytes_u16(pkt, s->s3.group_id)
         || !ssl->method->put_cipher_by_char(s->s3.tmp.new_cipher, pkt,
             &ciphlen)
         /* Is there a key_share extension present in this HRR? */
-        || !WPACKET_put_bytes_u8(pkt, s->s3.peer_tmp == NULL)
+        || !WPACKET_put_bytes_u8(pkt, hrr_sends_key_share(s))
         || !WPACKET_put_bytes_u64(pkt, time(NULL))
         || !WPACKET_start_sub_packet_u16(pkt)
         || !WPACKET_reserve_bytes(pkt, EVP_MAX_MD_SIZE, &hashval1)) {
@@ -2130,9 +2270,25 @@ EXT_RETURN tls_construct_stoc_cookie(SSL_CONNECTION *s, WPACKET *pkt,
     }

     /* Generate the application cookie */
-    if (sctx->gen_stateless_cookie_cb(ussl, appcookie1,
-            &appcookielen)
-        == 0) {
+#if !defined(OPENSSL_NO_DTLS)
+    if (dl != NULL && dl->require_hrr_cookie && sctx->gen_stateless_cookie_cb == NULL) {
+        gen_ret = ossl_dtls_listener_gen_stateless_cookie_cb(ussl, appcookie1,
+            &appcookielen);
+    } else if (sctx->gen_stateless_cookie_cb == NULL
+        && SSL_CONNECTION_IS_DTLS(s) && sctx->app_gen_cookie_cb != NULL) {
+        unsigned int applen = 0;
+
+        /* Fall back to the HelloVerifyRequest cookie callbacks */
+        gen_ret = sctx->app_gen_cookie_cb(ussl, appcookie1, &applen)
+            && applen <= DTLS1_COOKIE_LENGTH;
+        appcookielen = applen;
+    } else
+#endif
+        if (sctx->gen_stateless_cookie_cb != NULL) {
+        gen_ret = sctx->gen_stateless_cookie_cb(ussl, appcookie1, &appcookielen);
+    }
+
+    if (gen_ret == 0) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_COOKIE_GEN_CALLBACK_FAILURE);
         return EXT_RETURN_FAIL;
     }
@@ -2195,6 +2351,7 @@ err:
     EVP_PKEY_free(pkey);
     return ret;
 #else
+    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
     return EXT_RETURN_FAIL;
 #endif
 }
@@ -2296,7 +2453,7 @@ EXT_RETURN tls_construct_stoc_client_cert_type(SSL_CONNECTION *sc, WPACKET *pkt,

     /*
      * Note: only supposed to send this if we are going to do a cert request,
-     * but TLSv1.3 could do a PHA request if the client supports it
+     * but (D)TLSv1.3 could do a PHA request if the client supports it
      */
     if ((!send_certificate_request(sc) && sc->post_handshake_auth != SSL_PHA_EXT_RECEIVED)
         || sc->ext.client_cert_type_ctos != OSSL_CERT_TYPE_CTOS_GOOD
@@ -2437,3 +2594,169 @@ int tls_parse_ctos_server_cert_type(SSL_CONNECTION *sc, PACKET *pkt,
     SSLfatal(sc, SSL_AD_UNSUPPORTED_CERTIFICATE, SSL_R_BAD_EXTENSION);
     return 0;
 }
+
+#ifndef OPENSSL_NO_ECH
+/*
+ * ECH handling for edge cases (GREASE/inner) and errors.
+ * return 1 for good, 0 otherwise
+ *
+ * Real ECH handling (i.e. decryption) happens before, via
+ * ech_early_decrypt(), but if that failed (e.g. decryption
+ * failed, which may be down to GREASE) then we end up here,
+ * processing the ECH from the outer CH.
+ * Otherwise, we only expect to see an inner ECH with a fixed
+ * value here.
+ */
+int tls_parse_ctos_ech(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
+    X509 *x, size_t chainidx)
+{
+    unsigned int echtype = 0;
+
+    if (s->ext.ech.grease == OSSL_ECH_IS_GREASE) {
+        /* GREASE is fine */
+        return 1;
+    }
+    if (s->ext.ech.es == NULL) {
+        /* If not configured for ECH then we ignore it */
+        return 1;
+    }
+    if (s->ext.ech.attempted_type != TLSEXT_TYPE_ech) {
+        /* if/when new versions of ECH are added we'll update here */
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+        return 0;
+    }
+    /*
+     * we only allow "inner" which is one octet, valued 0x01
+     * and only if we decrypted ok or are a backend
+     */
+    if (PACKET_get_1(pkt, &echtype) != 1
+        || PACKET_remaining(pkt) != 0) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
+        return 0;
+    }
+    if (echtype != OSSL_ECH_INNER_CH_TYPE) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+        return 0;
+    }
+    s->ext.ech.inner_ech_seen_ok = 1;
+    if (s->ext.ech.success != 1 && s->ext.ech.backend != 1) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
+        return 0;
+    }
+    /* yay - we're ok with this */
+    OSSL_TRACE_BEGIN(TLS)
+    {
+        BIO_printf(trc_out, "ECH seen in inner as expected.\n");
+    }
+    OSSL_TRACE_END(TLS);
+    return 1;
+}
+
+/*
+ * Answer an ECH, as needed
+ * return 1 for good, 0 otherwise
+ *
+ * Return most-recent ECH config for retry, as needed.
+ * If doing HRR we include the confirmation value, but
+ * for now, we'll just add the zeros - the real octets
+ * will be added later via ech_calc_ech_confirm() which
+ * is called when constructing the server hello.
+ */
+EXT_RETURN tls_construct_stoc_ech(SSL_CONNECTION *s, WPACKET *pkt,
+    unsigned int context, X509 *x,
+    size_t chainidx)
+{
+    unsigned char *rcfgs = NULL;
+    size_t rcfgslen = 0;
+    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+
+    if (context == SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST
+        && (s->ext.ech.success == 1 || s->ext.ech.backend == 1)
+        && s->ext.ech.attempted_type == TLSEXT_TYPE_ech) {
+        unsigned char eightzeros[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+
+        if (!WPACKET_put_bytes_u16(pkt, s->ext.ech.attempted_type)
+            || !WPACKET_sub_memcpy_u16(pkt, eightzeros, 8)) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+        OSSL_TRACE_BEGIN(TLS)
+        {
+            BIO_printf(trc_out, "set 8 zeros for ECH accept confirm in HRR\n");
+        }
+        OSSL_TRACE_END(TLS);
+        return EXT_RETURN_SENT;
+    }
+    /* GREASE or error => random confirmation in HRR case */
+    if (context == SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST
+        && s->ext.ech.attempted_type == TLSEXT_TYPE_ech
+        && s->ext.ech.attempted == 1) {
+        unsigned char randomconf[8];
+
+        if (RAND_bytes_ex(sctx->libctx, randomconf, 8,
+                RAND_DRBG_STRENGTH)
+            <= 0) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+        if (!WPACKET_put_bytes_u16(pkt, s->ext.ech.attempted_type)
+            || !WPACKET_sub_memcpy_u16(pkt, randomconf, 8)) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return 0;
+        }
+        OSSL_TRACE_BEGIN(TLS)
+        {
+            BIO_printf(trc_out, "set random for ECH acccpt confirm in HRR\n");
+        }
+        OSSL_TRACE_END(TLS);
+        return EXT_RETURN_SENT;
+    }
+    /* in other HRR circumstances: don't set */
+    if (context == SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST)
+        return EXT_RETURN_NOT_SENT;
+    /* If in some weird state we ignore and send nothing */
+    if (s->ext.ech.grease != OSSL_ECH_IS_GREASE
+        || s->ext.ech.attempted_type != TLSEXT_TYPE_ech)
+        return EXT_RETURN_NOT_SENT;
+    /*
+     * If the client GREASEd, or we think it did, return the
+     * most-recently loaded ECHConfigList, as the value of the
+     * extension. Most-recently loaded can be anywhere in the
+     * list, depending on changing or non-changing file names.
+     */
+    if (s->ext.ech.es == NULL) {
+        OSSL_TRACE_BEGIN(TLS)
+        {
+            BIO_printf(trc_out, "ECH - not sending ECHConfigList to client "
+                                "even though they GREASE'd as I've no loaded configs\n");
+        }
+        OSSL_TRACE_END(TLS);
+        return EXT_RETURN_NOT_SENT;
+    }
+    if (ossl_ech_get_retry_configs(s, &rcfgs, &rcfgslen) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+    if (rcfgslen == 0) {
+        OSSL_TRACE_BEGIN(TLS)
+        {
+            BIO_printf(trc_out, "ECH - not sending ECHConfigList to client "
+                                "even though they GREASE'd and I have configs but "
+                                "I've no configs set to be returned\n");
+        }
+        OSSL_TRACE_END(TLS);
+        OPENSSL_free(rcfgs);
+        return EXT_RETURN_NOT_SENT;
+    }
+    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_ech)
+        || !WPACKET_start_sub_packet_u16(pkt)
+        || !WPACKET_sub_memcpy_u16(pkt, rcfgs, rcfgslen)
+        || !WPACKET_close(pkt)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        OPENSSL_free(rcfgs);
+        return 0;
+    }
+    OPENSSL_free(rcfgs);
+    return EXT_RETURN_SENT;
+}
+#endif /* END OPENSSL_NO_ECH */
diff --git a/deps/openssl/openssl/ssl/statem/statem.c b/deps/openssl/openssl/ssl/statem/statem.c
index 00631bf55e0..abea35ae802 100644
--- a/deps/openssl/openssl/ssl/statem/statem.c
+++ b/deps/openssl/openssl/ssl/statem/statem.c
@@ -131,8 +131,10 @@ void ossl_statem_clear(SSL_CONNECTION *s)
 {
     s->statem.state = MSG_FLOW_UNINITED;
     s->statem.hand_state = TLS_ST_BEFORE;
+    s->statem.error_state = ERROR_STATE_NOERROR;
     ossl_statem_set_in_init(s, 1);
     s->statem.no_cert_verify = 0;
+    s->statem.ack_for_retransmit = 0;
 }

 /*
@@ -244,6 +246,20 @@ int ossl_statem_skip_early_data(SSL_CONNECTION *s)
  */
 int ossl_statem_check_finish_init(SSL_CONNECTION *s, int sending)
 {
+    /*
+     * A client that suppressed 0-RTT keeps SSL_write_early_data() reporting
+     * success while the application streams early data. Any ordinary read,
+     * write, or handshake call waits for the handshake to complete and so ends
+     * that sequence: clear the suppressed flag, after which a further
+     * SSL_write_early_data() returns the normal error instead of masking a
+     * state-machine mistake. The internal SSL_connect() issued from
+     * SSL_write_early_data() runs in the CONNECTING state and is excluded.
+     */
+    if (!s->server
+        && s->ext.early_data_suppressed
+        && s->early_data_state == SSL_EARLY_DATA_NONE)
+        s->ext.early_data_suppressed = 0;
+
     if (sending == -1) {
         if (s->statem.hand_state == TLS_ST_PENDING_EARLY_DATA_END
             || s->statem.hand_state == TLS_ST_EARLY_DATA) {
@@ -288,6 +304,7 @@ void ossl_statem_set_hello_verify_done(SSL_CONNECTION *s)
      * sensible.
      */
     s->statem.hand_state = TLS_ST_SR_CLNT_HELLO;
+    s->statem.error_state = ERROR_STATE_NOERROR;
 }

 int ossl_statem_connect(SSL *s)
@@ -402,7 +419,7 @@ static int state_machine(SSL_CONNECTION *s, int server)

         s->server = server;
         if (cb != NULL) {
-            if (SSL_IS_FIRST_HANDSHAKE(s) || !SSL_CONNECTION_IS_TLS13(s))
+            if (SSL_IS_FIRST_HANDSHAKE(s) || !SSL_CONNECTION_IS_VERSION13(s))
                 cb(ussl, SSL_CB_HANDSHAKE_START, 1);
         }

@@ -482,6 +499,8 @@ static int state_machine(SSL_CONNECTION *s, int server)
             if (ssret == SUB_STATE_FINISHED) {
                 st->state = MSG_FLOW_WRITING;
                 init_write_state_machine(s);
+            } else if (ssret == SUB_STATE_END_HANDSHAKE) {
+                st->state = MSG_FLOW_FINISHED;
             } else {
                 /* NBIO or error */
                 goto end;
@@ -571,7 +590,7 @@ static SUB_STATE_RETURN read_state_machine(SSL_CONNECTION *s)
 {
     OSSL_STATEM *st = &s->statem;
     int ret, mt;
-    size_t len = 0;
+    size_t len = 0, headerlen;
     int (*transition)(SSL_CONNECTION *s, int mt);
     PACKET pkt;
     MSG_PROCESS_RETURN (*process_message)(SSL_CONNECTION *s, PACKET *pkt);
@@ -602,6 +621,16 @@ static SUB_STATE_RETURN read_state_machine(SSL_CONNECTION *s)
     while (1) {
         switch (st->read_state) {
         case READ_STATE_HEADER:
+            /*
+             * Restore the state after an incomplete ACK before reading again:
+             * the DTLS record layer uses it to handle application data.
+             */
+            if (SSL_CONNECTION_IS_DTLS13(s)
+                && (st->hand_state == TLS_ST_CR_ACK
+                    || st->hand_state == TLS_ST_SR_ACK)
+                && !transition(s, SSL3_MT_DUMMY))
+                return SUB_STATE_ERROR;
+
             /* Get the state the peer wants to move to */
             if (SSL_CONNECTION_IS_DTLS(s)) {
                 /*
@@ -613,6 +642,28 @@ static SUB_STATE_RETURN read_state_machine(SSL_CONNECTION *s)
             }

             if (ret == 0) {
+                /* Re-ACK a retransmission without completing our own flight. */
+                if (st->ack_for_retransmit)
+                    return SUB_STATE_FINISHED;
+
+                /*
+                 * If we're in DTLSv1.3 and in state TLS_ST_OK, then we must
+                 * have received a post-handshake message. If we subsequently
+                 * try to receive that message and get nothing back (and did not
+                 * encounter a fatal error), then that message must have been
+                 * dropped, so we need to end the handshake now, and return to
+                 * reading app data.
+                 */
+                if (SSL_CONNECTION_IS_DTLS13(s)
+                    && st->hand_state == TLS_ST_OK
+                    && s->statem.state != MSG_FLOW_ERROR) {
+                    if (!ssl_free_wbio_buffer(s)) {
+                        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                        return SUB_STATE_ERROR;
+                    }
+                    ossl_statem_set_in_init(s, 0);
+                    return SUB_STATE_END_HANDSHAKE;
+                }
                 /* Could be non-blocking IO */
                 return SUB_STATE_ERROR;
             }
@@ -656,10 +707,23 @@ static SUB_STATE_RETURN read_state_machine(SSL_CONNECTION *s)
             }

             s->first_packet = 0;
-            if (!PACKET_buf_init(&pkt, s->init_msg, len)) {
+            /*
+             * We initialise the buffer including the message header, and
+             * then skip over header ready to process the message. This
+             * ensures that calls to PACKET_msg_start() gives us the whole
+             * message
+             */
+            headerlen = (char *)s->init_msg - s->init_buf->data;
+            if (!PACKET_buf_init(&pkt, (unsigned char *)s->init_buf->data,
+                    len + headerlen)) {
                 SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
                 return SUB_STATE_ERROR;
             }
+            if (!PACKET_forward(&pkt, headerlen)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return SUB_STATE_ERROR;
+            }
+
             ret = process_message(s, &pkt);

             /* Discard the packet data */
@@ -724,17 +788,28 @@ static SUB_STATE_RETURN read_state_machine(SSL_CONNECTION *s)
  */
 static int statem_do_write(SSL_CONNECTION *s)
 {
+    int record_type;
     OSSL_STATEM *st = &s->statem;

-    if (st->hand_state == TLS_ST_CW_CHANGE
-        || st->hand_state == TLS_ST_SW_CHANGE) {
-        if (SSL_CONNECTION_IS_DTLS(s))
-            return dtls1_do_write(s, SSL3_RT_CHANGE_CIPHER_SPEC);
-        else
-            return ssl3_do_write(s, SSL3_RT_CHANGE_CIPHER_SPEC);
-    } else {
+    switch (st->hand_state) {
+    case TLS_ST_CW_CHANGE:
+    case TLS_ST_SW_CHANGE:
+        record_type = SSL3_RT_CHANGE_CIPHER_SPEC;
+
+        break;
+    case TLS_ST_CW_ACK:
+    case TLS_ST_SW_ACK:
+        record_type = SSL3_RT_ACK;
+
+        break;
+    default:
         return ssl_do_write(s);
     }
+
+    if (SSL_CONNECTION_IS_DTLS(s))
+        return dtls1_do_write(s, record_type);
+    else
+        return ssl3_do_write(s, record_type);
 }

 /*
@@ -789,6 +864,7 @@ static SUB_STATE_RETURN write_state_machine(SSL_CONNECTION *s)
         CON_FUNC_RETURN (**confunc)(SSL_CONNECTION *s,
             WPACKET *pkt),
         int *mt);
+    int (*dtls_use_timer)(SSL_CONNECTION *s);
     void (*cb)(const SSL *ssl, int type, int val) = NULL;
     CON_FUNC_RETURN (*confunc)(SSL_CONNECTION *s, WPACKET *pkt);
     int mt;
@@ -802,11 +878,13 @@ static SUB_STATE_RETURN write_state_machine(SSL_CONNECTION *s)
         pre_work = ossl_statem_server_pre_work;
         post_work = ossl_statem_server_post_work;
         get_construct_message_f = ossl_statem_server_construct_message;
+        dtls_use_timer = ossl_statem_dtls_server_use_timer;
     } else {
         transition = ossl_statem_client_write_transition;
         pre_work = ossl_statem_client_pre_work;
         post_work = ossl_statem_client_post_work;
         get_construct_message_f = ossl_statem_client_construct_message;
+        dtls_use_timer = ossl_statem_dtls_client_use_timer;
     }

     while (1) {
@@ -899,9 +977,9 @@ static SUB_STATE_RETURN write_state_machine(SSL_CONNECTION *s)
             /* Fall through */

         case WRITE_STATE_SEND:
-            if (SSL_CONNECTION_IS_DTLS(s) && st->use_timer) {
+            if (SSL_CONNECTION_IS_DTLS(s) && dtls_use_timer(s))
                 dtls1_start_timer(s);
-            }
+
             ret = statem_do_write(s);
             if (ret <= 0) {
                 return SUB_STATE_ERROR;
diff --git a/deps/openssl/openssl/ssl/statem/statem_clnt.c b/deps/openssl/openssl/ssl/statem/statem_clnt.c
index bdf99cd35fd..a9480f701ba 100644
--- a/deps/openssl/openssl/ssl/statem/statem_clnt.c
+++ b/deps/openssl/openssl/ssl/statem/statem_clnt.c
@@ -22,23 +22,21 @@
 #include <openssl/dh.h>
 #include <openssl/rsa.h>
 #include <openssl/bn.h>
-#include <openssl/engine.h>
 #include <openssl/trace.h>
 #include <openssl/core_names.h>
 #include <openssl/param_build.h>
 #include "internal/cryptlib.h"
 #include "internal/comp.h"
 #include "internal/ssl_unwrap.h"
+#include <openssl/ocsp.h>

 static MSG_PROCESS_RETURN tls_process_as_hello_retry_request(SSL_CONNECTION *s,
-    PACKET *pkt);
+    RAW_EXTENSION *extensions);
 static MSG_PROCESS_RETURN tls_process_encrypted_extensions(SSL_CONNECTION *s,
     PACKET *pkt);

 static ossl_inline int cert_req_allowed(SSL_CONNECTION *s);
 static int key_exchange_expected(SSL_CONNECTION *s);
-static int ssl_cipher_list_to_bytes(SSL_CONNECTION *s, STACK_OF(SSL_CIPHER) *sk,
-    WPACKET *pkt);

 static ossl_inline int received_server_cert(SSL_CONNECTION *sc)
 {
@@ -55,9 +53,8 @@ static ossl_inline int received_server_cert(SSL_CONNECTION *sc)
 static ossl_inline int cert_req_allowed(SSL_CONNECTION *s)
 {
     /* TLS does not like anon-DH with client cert */
-    if ((s->version > SSL3_VERSION
-            && (s->s3.tmp.new_cipher->algorithm_auth & SSL_aNULL))
-        || (s->s3.tmp.new_cipher->algorithm_auth & (SSL_aSRP | SSL_aPSK)))
+    if ((s->s3.tmp.new_cipher->algorithm_auth & SSL_aNULL) != 0
+        || (s->s3.tmp.new_cipher->algorithm_auth & (SSL_aSRP | SSL_aPSK)) != 0)
         return 0;

     return 1;
@@ -98,6 +95,12 @@ static int ossl_statem_client13_read_transition(SSL_CONNECTION *s, int mt)
 {
     OSSL_STATEM *st = &s->statem;

+    if (st->hand_state == TLS_ST_CR_ACK) {
+        st->hand_state = st->pre_ack_hand_state;
+        if (mt == SSL3_MT_DUMMY)
+            return 1;
+    }
+
     /*
      * Note: There is no case for TLS_ST_CW_CLNT_HELLO, because we haven't
      * yet negotiated TLSv1.3 at that point so that is handled by
@@ -180,7 +183,14 @@ static int ossl_statem_client13_read_transition(SSL_CONNECTION *s, int mt)
         }
         break;

+    case TLS_ST_CW_KEY_UPDATE:
+    case TLS_ST_CW_FINISHED:
     case TLS_ST_OK:
+        if (mt == DTLS13_MT_ACK) {
+            st->pre_ack_hand_state = st->hand_state;
+            st->hand_state = TLS_ST_CR_ACK;
+            return 1;
+        }
         if (mt == SSL3_MT_NEWSESSION_TICKET) {
             st->hand_state = TLS_ST_CR_SESSION_TICKET;
             return 1;
@@ -190,19 +200,8 @@ static int ossl_statem_client13_read_transition(SSL_CONNECTION *s, int mt)
             return 1;
         }
         if (mt == SSL3_MT_CERTIFICATE_REQUEST) {
-#if DTLS_MAX_VERSION_INTERNAL != DTLS1_2_VERSION
-            /* Restore digest for PHA before adding message.*/
-#error Internal DTLS version error
-#endif
-            if (!SSL_CONNECTION_IS_DTLS(s)
-                && s->post_handshake_auth == SSL_PHA_EXT_SENT) {
+            if (s->post_handshake_auth == SSL_PHA_EXT_SENT) {
                 s->post_handshake_auth = SSL_PHA_REQUESTED;
-                /*
-                 * In TLS, this is called before the message is added to the
-                 * digest. In DTLS, this is expected to be called after adding
-                 * to the digest. Either move the digest restore, or add the
-                 * message here after the swap, or do it after the clientFinished?
-                 */
                 if (!tls13_restore_handshake_digest_for_pha(s)) {
                     /* SSLfatal() already called */
                     return 0;
@@ -236,7 +235,7 @@ int ossl_statem_client_read_transition(SSL_CONNECTION *s, int mt)
      * Note that after writing the first ClientHello we don't know what version
      * we are going to negotiate yet, so we don't take this branch until later.
      */
-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         if (!ossl_statem_client13_read_transition(s, mt))
             goto err;
         return 1;
@@ -406,20 +405,6 @@ int ossl_statem_client_read_transition(SSL_CONNECTION *s, int mt)

 err:
     /* No valid transition found */
-    if (SSL_CONNECTION_IS_DTLS(s) && mt == SSL3_MT_CHANGE_CIPHER_SPEC) {
-        BIO *rbio;
-
-        /*
-         * CCS messages don't have a message sequence number so this is probably
-         * because of an out-of-order CCS. We'll just drop it.
-         */
-        s->init_num = 0;
-        s->rwstate = SSL_READING;
-        rbio = SSL_get_rbio(SSL_CONNECTION_GET_SSL(s));
-        BIO_clear_retry_flags(rbio);
-        BIO_set_retry_read(rbio);
-        return 0;
-    }
     SSLfatal(s, SSL3_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
     return 0;
 }
@@ -440,6 +425,12 @@ static WRITE_TRAN ossl_statem_client13_write_transition(SSL_CONNECTION *s)
 {
     OSSL_STATEM *st = &s->statem;

+    if (st->ack_for_retransmit && st->hand_state != TLS_ST_CW_ACK) {
+        st->deferred_ack_state = st->hand_state;
+        st->hand_state = TLS_ST_CW_ACK;
+        return WRITE_TRAN_CONTINUE;
+    }
+
     /*
      * Note: There are no cases for TLS_ST_BEFORE because we haven't negotiated
      * TLSv1.3 yet at that point. They are handled by
@@ -475,7 +466,7 @@ static WRITE_TRAN ossl_statem_client13_write_transition(SSL_CONNECTION *s)
         if (s->early_data_state == SSL_EARLY_DATA_WRITE_RETRY
             || s->early_data_state == SSL_EARLY_DATA_FINISHED_WRITING)
             st->hand_state = TLS_ST_PENDING_EARLY_DATA_END;
-        else if ((s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0
+        else if (SSL_CONNECTION_MIDDLEBOX_IS_ENABLED(s)
             && s->hello_retry_request == SSL_HRR_NONE)
             st->hand_state = TLS_ST_CW_CHANGE;
         else if (s->s3.tmp.cert_req == 0)
@@ -489,6 +480,10 @@ static WRITE_TRAN ossl_statem_client13_write_transition(SSL_CONNECTION *s)
         return WRITE_TRAN_CONTINUE;

     case TLS_ST_PENDING_EARLY_DATA_END:
+        /*
+         * RFC 9147 Section 5.6 states DTLS1.3 should omit the
+         * End of Early Data Message
+         */
         if (s->ext.early_data == SSL_EARLY_DATA_ACCEPTED && !SSL_NO_EOED(s)) {
             st->hand_state = TLS_ST_CW_END_OF_EARLY_DATA;
             return WRITE_TRAN_CONTINUE;
@@ -496,6 +491,12 @@ static WRITE_TRAN ossl_statem_client13_write_transition(SSL_CONNECTION *s)
         /* Fall through */

     case TLS_ST_CW_END_OF_EARLY_DATA:
+        if (SSL_CONNECTION_IS_DTLS13(s)) {
+            /* If we are done with early data we need to clean up Epoch 1 messages sent */
+            dtls1_clear_sent_buffer(s, 0);
+        }
+        /* Fall through */
+
     case TLS_ST_CW_CHANGE:
         if (s->s3.tmp.cert_req == 0)
             st->hand_state = TLS_ST_CW_FINISHED;
@@ -517,9 +518,36 @@ static WRITE_TRAN ossl_statem_client13_write_transition(SSL_CONNECTION *s)
         return WRITE_TRAN_CONTINUE;

     case TLS_ST_CR_KEY_UPDATE:
-    case TLS_ST_CW_KEY_UPDATE:
     case TLS_ST_CR_SESSION_TICKET:
+        if (SSL_CONNECTION_IS_DTLS13(s)) {
+            st->hand_state = TLS_ST_CW_ACK;
+            return WRITE_TRAN_CONTINUE;
+        }
+        /* Fall-through */
+    case TLS_ST_CW_KEY_UPDATE:
     case TLS_ST_CW_FINISHED:
+        if (SSL_CONNECTION_IS_DTLS13(s))
+            /* We wait for ACK */
+            return WRITE_TRAN_FINISHED;
+        else
+            st->hand_state = TLS_ST_OK;
+        return WRITE_TRAN_CONTINUE;
+
+    case TLS_ST_CR_ACK:
+        if (SSL_CONNECTION_IS_DTLS13(s)
+            && dtls_any_sent_messages_are_missing_acknowledge(s)) {
+            /* We wait for ACK */
+            return WRITE_TRAN_FINISHED;
+        }
+        st->hand_state = TLS_ST_OK;
+        return WRITE_TRAN_CONTINUE;
+
+    case TLS_ST_CW_ACK:
+        if (st->ack_for_retransmit) {
+            st->hand_state = st->deferred_ack_state;
+            st->ack_for_retransmit = 0;
+            return WRITE_TRAN_FINISHED;
+        }
         st->hand_state = TLS_ST_OK;
         return WRITE_TRAN_CONTINUE;

@@ -547,7 +575,7 @@ WRITE_TRAN ossl_statem_client_write_transition(SSL_CONNECTION *s)
      * version we are going to negotiate yet, so we don't take this branch until
      * later
      */
-    if (SSL_CONNECTION_IS_TLS13(s))
+    if (SSL_CONNECTION_IS_VERSION13(s))
         return ossl_statem_client13_write_transition(s);

     switch (st->hand_state) {
@@ -574,10 +602,10 @@ WRITE_TRAN ossl_statem_client_write_transition(SSL_CONNECTION *s)
         if (s->early_data_state == SSL_EARLY_DATA_CONNECTING
             && !SSL_IS_QUIC_HANDSHAKE(s)) {
             /*
-             * We are assuming this is a TLSv1.3 connection, although we haven't
+             * We are assuming this is a (D)TLSv1.3 connection, although we haven't
              * actually selected a version yet.
              */
-            if ((s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0)
+            if (SSL_CONNECTION_MIDDLEBOX_IS_ENABLED(s))
                 st->hand_state = TLS_ST_CW_CHANGE;
             else
                 st->hand_state = TLS_ST_EARLY_DATA;
@@ -592,11 +620,11 @@ WRITE_TRAN ossl_statem_client_write_transition(SSL_CONNECTION *s)

     case TLS_ST_CR_SRVR_HELLO:
         /*
-         * We only get here in TLSv1.3. We just received an HRR, so issue a
+         * We only get here in (D)TLSv1.3. We just received an HRR, so issue a
          * CCS unless middlebox compat mode is off, or we already issued one
          * because we did early data.
          */
-        if ((s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0
+        if (SSL_CONNECTION_MIDDLEBOX_IS_ENABLED(s)
             && s->early_data_state != SSL_EARLY_DATA_FINISHED_WRITING)
             st->hand_state = TLS_ST_CW_CHANGE;
         else
@@ -706,6 +734,48 @@ WRITE_TRAN ossl_statem_client_write_transition(SSL_CONNECTION *s)
     }
 }

+static int ossl_statem_dtls_client13_use_timer(SSL_CONNECTION *s)
+{
+    OSSL_STATEM *st = &s->statem;
+
+    switch (st->hand_state) {
+    default:
+        break;
+
+    case TLS_ST_CW_ACK:
+        /* Fall through */
+
+    case TLS_ST_OK:
+        return 0;
+    }
+
+    return 1;
+}
+
+int ossl_statem_dtls_client_use_timer(SSL_CONNECTION *s)
+{
+    OSSL_STATEM *st = &s->statem;
+
+    if (SSL_CONNECTION_IS_DTLS13(s))
+        return ossl_statem_dtls_client13_use_timer(s);
+
+    switch (st->hand_state) {
+    default:
+        break;
+
+    case TLS_ST_CW_CHANGE:
+        /*
+         * We're into the last flight so we don't retransmit these
+         * messages unless we need to.
+         */
+        if (s->hit)
+            st->use_timer = 0;
+        break;
+    }
+
+    return st->use_timer;
+}
+
 /*
  * Perform any pre work that needs to be done prior to sending a message from
  * the client to the server.
@@ -713,6 +783,7 @@ WRITE_TRAN ossl_statem_client_write_transition(SSL_CONNECTION *s)
 WORK_STATE ossl_statem_client_pre_work(SSL_CONNECTION *s, WORK_STATE wst)
 {
     OSSL_STATEM *st = &s->statem;
+    const int versionany = SSL_CONNECTION_IS_DTLS(s) ? DTLS_ANY_VERSION : TLS_ANY_VERSION;

     switch (st->hand_state) {
     default:
@@ -721,7 +792,7 @@ WORK_STATE ossl_statem_client_pre_work(SSL_CONNECTION *s, WORK_STATE wst)

     case TLS_ST_CW_CLNT_HELLO:
         s->shutdown = 0;
-        if (SSL_CONNECTION_IS_DTLS(s)) {
+        if (SSL_CONNECTION_IS_DTLS(s) && s->hello_retry_request != SSL_HRR_PENDING) {
             /* every DTLS ClientHello resets Finished MAC */
             if (!ssl3_init_finished_mac(s)) {
                 /* SSLfatal() already called */
@@ -735,12 +806,12 @@ WORK_STATE ossl_statem_client_pre_work(SSL_CONNECTION *s, WORK_STATE wst)
              * write record layer in order to write in plaintext again.
              */
             if (!ssl_set_new_record_layer(s,
-                    TLS_ANY_VERSION,
+                    versionany,
                     OSSL_RECORD_DIRECTION_WRITE,
                     OSSL_RECORD_PROTECTION_LEVEL_NONE,
-                    NULL, 0, NULL, 0, NULL, 0, NULL, 0,
-                    NULL, 0, NID_undef, NULL, NULL,
-                    NULL)) {
+                    NULL, 0, NULL, NULL, 0, NULL, 0,
+                    NULL, 0, NULL, NULL, 0, NID_undef,
+                    NULL, NULL, NULL)) {
                 /* SSLfatal already called */
                 return WORK_ERROR;
             }
@@ -749,13 +820,6 @@ WORK_STATE ossl_statem_client_pre_work(SSL_CONNECTION *s, WORK_STATE wst)

     case TLS_ST_CW_CHANGE:
         if (SSL_CONNECTION_IS_DTLS(s)) {
-            if (s->hit) {
-                /*
-                 * We're into the last flight so we don't retransmit these
-                 * messages unless we need to.
-                 */
-                st->use_timer = 0;
-            }
 #ifndef OPENSSL_NO_SCTP
             if (BIO_dgram_is_sctp(SSL_get_wbio(SSL_CONNECTION_GET_SSL(s)))) {
                 /* Calls SSLfatal() as required */
@@ -807,11 +871,11 @@ WORK_STATE ossl_statem_client_post_work(SSL_CONNECTION *s, WORK_STATE wst)
         if (s->early_data_state == SSL_EARLY_DATA_CONNECTING
             && s->max_early_data > 0) {
             /*
-             * We haven't selected TLSv1.3 yet so we don't call the change
+             * We haven't selected (D)TLSv1.3 yet so we don't call the change
              * cipher state function associated with the SSL_METHOD. Instead
              * we call tls13_change_cipher_state() directly.
              */
-            if ((s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) == 0) {
+            if (!SSL_CONNECTION_MIDDLEBOX_IS_ENABLED(s)) {
                 if (!tls13_change_cipher_state(s,
                         SSL3_CC_EARLY | SSL3_CHANGE_CIPHER_CLIENT_WRITE)) {
                     /* SSLfatal() already called */
@@ -837,13 +901,13 @@ WORK_STATE ossl_statem_client_post_work(SSL_CONNECTION *s, WORK_STATE wst)
         break;

     case TLS_ST_CW_CHANGE:
-        if (SSL_CONNECTION_IS_TLS13(s)
+        if (SSL_CONNECTION_IS_VERSION13(s)
             || s->hello_retry_request == SSL_HRR_PENDING)
             break;
         if (s->early_data_state == SSL_EARLY_DATA_CONNECTING
             && s->max_early_data > 0) {
             /*
-             * We haven't selected TLSv1.3 yet so we don't call the change
+             * We haven't selected (D)TLSv1.3 yet so we don't call the change
              * cipher state function associated with the SSL_METHOD. Instead
              * we call tls13_change_cipher_state() directly.
              */
@@ -865,7 +929,6 @@ WORK_STATE ossl_statem_client_post_work(SSL_CONNECTION *s, WORK_STATE wst)
             /* SSLfatal() already called */
             return WORK_ERROR;
         }
-
         if (!ssl->method->ssl3_enc->change_cipher_state(s,
                 SSL3_CHANGE_CIPHER_CLIENT_WRITE)) {
             /* SSLfatal() already called */
@@ -898,7 +961,7 @@ WORK_STATE ossl_statem_client_post_work(SSL_CONNECTION *s, WORK_STATE wst)
         if (statem_flush(s) != 1)
             return WORK_MORE_B;

-        if (SSL_CONNECTION_IS_TLS13(s)) {
+        if (SSL_CONNECTION_IS_VERSION13(s)) {
             if (!tls13_save_handshake_digest_for_pha(s)) {
                 /* SSLfatal() already called */
                 return WORK_ERROR;
@@ -909,6 +972,7 @@ WORK_STATE ossl_statem_client_post_work(SSL_CONNECTION *s, WORK_STATE wst)
                     /* SSLfatal() already called */
                     return WORK_ERROR;
                 }
+
                 /*
                  * For QUIC we deferred setting up these keys until now so
                  * that we can ensure write keys are always set up before read
@@ -932,6 +996,11 @@ WORK_STATE ossl_statem_client_post_work(SSL_CONNECTION *s, WORK_STATE wst)
             return WORK_ERROR;
         }
         break;
+
+    case TLS_ST_CW_ACK:
+        if (statem_flush(s) != 1)
+            return WORK_MORE_A;
+        break;
     }

     return WORK_FINISHED_CONTINUE;
@@ -1016,6 +1085,11 @@ int ossl_statem_client_construct_message(SSL_CONNECTION *s,
         *confunc = tls_construct_key_update;
         *mt = SSL3_MT_KEY_UPDATE;
         break;
+
+    case TLS_ST_CW_ACK:
+        *confunc = dtls_construct_ack;
+        *mt = DTLS13_MT_ACK;
+        break;
     }

     return 1;
@@ -1070,8 +1144,8 @@ size_t ossl_statem_client_max_message_size(SSL_CONNECTION *s)
         return CCS_MAX_LENGTH;

     case TLS_ST_CR_SESSION_TICKET:
-        return (SSL_CONNECTION_IS_TLS13(s)) ? SESSION_TICKET_MAX_LENGTH_TLS13
-                                            : SESSION_TICKET_MAX_LENGTH_TLS12;
+        return SSL_CONNECTION_IS_VERSION13(s) ? SESSION_TICKET_MAX_LENGTH_TLS13
+                                              : SESSION_TICKET_MAX_LENGTH_TLS12;

     case TLS_ST_CR_FINISHED:
         return FINISHED_MAX_LENGTH;
@@ -1081,6 +1155,9 @@ size_t ossl_statem_client_max_message_size(SSL_CONNECTION *s)

     case TLS_ST_CR_KEY_UPDATE:
         return KEY_UPDATE_MAX_LENGTH;
+
+    case TLS_ST_CR_ACK:
+        return ACK_MAX_LENGTH;
     }
 }

@@ -1144,6 +1221,9 @@ MSG_PROCESS_RETURN ossl_statem_client_process_message(SSL_CONNECTION *s,

     case TLS_ST_CR_KEY_UPDATE:
         return tls_process_key_update(s, pkt);
+
+    case TLS_ST_CR_ACK:
+        return dtls_process_ack(s, pkt);
     }
 }

@@ -1172,11 +1252,238 @@ WORK_STATE ossl_statem_client_post_process_message(SSL_CONNECTION *s,
     }
 }

-CON_FUNC_RETURN tls_construct_client_hello(SSL_CONNECTION *s, WPACKET *pkt)
+#ifndef OPENSSL_NO_ECH
+/*
+ * Wrap ClientHello construction with ECH code.
+ *
+ * As needed, we'll call the CH constructor twice, first for
+ * inner, and then for outer.
+ *
+ * `tls_construct_client_hello_aux` is the pre-ECH code
+ * and the ECH-aware tls_construct_client_hello just calls
+ * that if there's no ECH involved, but otherwise does ECH
+ * things around calls to the _aux variant.
+ *
+ * Our basic model is that, when really attempting ECH we
+ * indicate via the ch_depth field whether we're dealing
+ * with inner or outer CH (1 for inner, 0 for outer).
+ *
+ * After creating the fields for the inner CH, we encode
+ * those (so we can re-use existing code) then decode again
+ * (using the existing tls_process_client_hello previously
+ * only used on servers), again to maximise code re-use.
+ *
+ * We next re-encode inner but this time including the
+ * optimisations for inner CH "compression" (outer exts etc.)
+ * to produce our plaintext for encrypting.
+ *
+ * We then process the outer CH in more or less the
+ * usual manner.
+ *
+ * We lastly form up the AAD etc and encrypt to give us
+ * the ciphertext for inclusion in the value of the outer
+ * CH ECH extension.
+ *
+ * It may seem odd to form up the outer CH before
+ * encrypting, but we need to do it that way so we get
+ * the octets for the AAD used in encryption.
+ *
+ * Phew!
+ */
+static int tls_construct_client_hello_aux(SSL_CONNECTION *s, WPACKET *pkt);
+
+__owur CON_FUNC_RETURN tls_construct_client_hello(SSL_CONNECTION *s,
+    WPACKET *pkt)
+{
+    WPACKET inner; /* "fake" pkt for inner */
+    BUF_MEM *inner_mem = NULL;
+    PACKET rpkt; /* we'll decode back the inner ch to help make the outer */
+    SSL_SESSION *sess = NULL;
+    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+    size_t sess_id_len = 0, innerlen = 0;
+    int mt = SSL3_MT_CLIENT_HELLO, rv = 0;
+    OSSL_HPKE_SUITE suite;
+    OSSL_ECHSTORE_ENTRY *ee = NULL;
+    /* Work out what SSL/TLS/DTLS version to use */
+    int protverr = ssl_set_client_hello_version(s);
+
+    if (protverr != 0) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, protverr);
+        return 0;
+    }
+    /* If we're not really attempting ECH, just call existing code.  */
+    if (s->ext.ech.es == NULL)
+        return tls_construct_client_hello_aux(s, pkt);
+    /* note version we're attempting and that an attempt is being made */
+    if (s->ext.ech.es->entries != NULL) {
+        if (ossl_ech_pick_matching_cfg(s, &ee, &suite) != 1 || ee == NULL) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_UNSUPPORTED);
+            return 0;
+        }
+        if (ee->version != OSSL_ECH_RFC9849_VERSION) {
+            /* we only support that version for now */
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_UNSUPPORTED);
+            return 0;
+        }
+        s->ext.ech.attempted_type = TLSEXT_TYPE_ech;
+        s->ext.ech.attempted_cid = ee->config_id;
+        s->ext.ech.attempted = 1;
+        if (s->ext.ech.outer_hostname == NULL && ee->public_name != NULL) {
+            s->ext.ech.outer_hostname = OPENSSL_strdup((char *)ee->public_name);
+            if (s->ext.ech.outer_hostname == NULL) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return 0;
+            }
+        }
+    }
+    /* If doing real ECH and application requested GREASE too, over-ride that */
+    if (s->ext.ech.grease == OSSL_ECH_IS_GREASE && s->ext.ech.attempted == 1)
+        s->ext.ech.grease = OSSL_ECH_NOT_GREASE;
+    /*
+     * Session ID is handled "oddly" by not being encoded into inner CH (an
+     * optimisation) so is the same for both inner and outer.
+     */
+    sess = s->session;
+    if (sess == NULL
+        || !ssl_version_supported(s, sess->ssl_version, NULL)
+        || !SSL_SESSION_is_resumable(sess)) {
+        if (s->hello_retry_request == SSL_HRR_NONE
+            && !ssl_get_new_session(s, 0))
+            return 0; /* SSLfatal() already called */
+    }
+    if (s->new_session || s->session->ssl_version == TLS1_3_VERSION) {
+        if (s->version == TLS1_3_VERSION
+            && (s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0) {
+            sess_id_len = sizeof(s->tmp_session_id);
+            s->tmp_session_id_len = sess_id_len;
+            if (s->hello_retry_request == SSL_HRR_NONE
+                && RAND_bytes_ex(sctx->libctx, s->tmp_session_id,
+                       sess_id_len, 0)
+                    <= 0) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return 0;
+            }
+            memcpy(s->session->session_id, s->tmp_session_id, sess_id_len);
+            s->session->session_id_length = sess_id_len;
+        } else {
+            sess_id_len = 0;
+        }
+    } else {
+        assert(s->session->session_id_length <= sizeof(s->session->session_id));
+        sess_id_len = s->session->session_id_length;
+        if (s->version == TLS1_3_VERSION) {
+            s->tmp_session_id_len = sess_id_len;
+            memcpy(s->tmp_session_id, s->session->session_id, sess_id_len);
+        }
+    }
+    if (s->hello_retry_request != SSL_HRR_NONE)
+        s->ext.ech.n_outer_only = 0; /* reset count of "compressed" exts */
+    /*
+     * Set CH depth flag so that other code (e.g. extension handlers)
+     * know where we're at: 1 is "inner CH", 0 is "outer CH"
+     */
+    s->ext.ech.ch_depth = 1;
+    if ((inner_mem = BUF_MEM_new()) == NULL
+        || !WPACKET_init(&inner, inner_mem)
+        || !ssl_set_handshake_header(s, &inner, mt)
+        || tls_construct_client_hello_aux(s, &inner) != 1
+        || !WPACKET_close(&inner)
+        || !WPACKET_get_length(&inner, &innerlen)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    OPENSSL_free(s->ext.ech.innerch);
+    s->ext.ech.innerch = (unsigned char *)inner_mem->data;
+    inner_mem->data = NULL;
+    s->ext.ech.innerch_len = innerlen;
+    /* add inner to transcript */
+    if (ossl_ech_intbuf_add(s, s->ext.ech.innerch, innerlen, 0) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    WPACKET_cleanup(&inner);
+    BUF_MEM_free(inner_mem);
+    inner_mem = NULL;
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("inner CH", s->ext.ech.innerch, s->ext.ech.innerch_len);
+    ossl_ech_pbuf("inner, client_random", s->ext.ech.client_random,
+        SSL3_RANDOM_SIZE);
+    ossl_ech_pbuf("inner, session_id", s->session->session_id,
+        s->session->session_id_length);
+#endif
+    /* Decode inner so that we can make up encoded inner */
+    if (!PACKET_buf_init(&rpkt, (unsigned char *)s->ext.ech.innerch + 4,
+            s->ext.ech.innerch_len - 4)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /*
+     * Parse the full inner CH (usually done on server). This gets us
+     * individually encoded extensions so we can choose to compress
+     * and/or to re-use the same value in outer.
+     */
+    if (!tls_process_client_hello(s, &rpkt)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+
+    s->ext.ech.ch_depth = 0; /* set depth for outer CH */
+    /*
+     * If we want different key shares for inner and outer, then
+     * zap the one for the inner. The inner key_share is stashed
+     * in s.ext.ech.tmp_pkey already.
+     */
+    if (ossl_ech_same_key_share() == 0) {
+        EVP_PKEY_free(s->s3.tmp.pkey);
+        s->s3.tmp.pkey = NULL;
+    }
+    /* Make second call into CH construction for outer CH. */
+    rv = tls_construct_client_hello_aux(s, pkt);
+    if (rv != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+#ifdef OSSL_ECH_SUPERVERBOSE
+    ossl_ech_pbuf("outer, client_random", s->s3.client_random,
+        SSL3_RANDOM_SIZE);
+    ossl_ech_pbuf("outer, session_id", s->session->session_id,
+        s->session->session_id_length);
+#endif
+    /* Finally, calculate AAD and encrypt using HPKE */
+    if (ossl_ech_aad_and_encrypt(s, pkt) != 1) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+    /* Free up raw exts as needed (happens like this on real server) */
+    if (s->clienthello != NULL
+        && s->clienthello->pre_proc_exts != NULL) {
+        OPENSSL_free(s->clienthello->pre_proc_exts);
+        OPENSSL_free(s->clienthello);
+        s->clienthello = NULL;
+    }
+    return 1;
+err:
+    if (inner_mem != NULL) {
+        WPACKET_cleanup(&inner);
+        BUF_MEM_free(inner_mem);
+    }
+    if (s->clienthello != NULL) {
+        OPENSSL_free(s->clienthello->pre_proc_exts);
+        OPENSSL_free(s->clienthello);
+        s->clienthello = NULL;
+    }
+    return 0;
+}
+
+static int tls_construct_client_hello_aux(SSL_CONNECTION *s, WPACKET *pkt)
+#else
+__owur CON_FUNC_RETURN tls_construct_client_hello(SSL_CONNECTION *s, WPACKET *pkt)
+#endif
 {
     unsigned char *p;
     size_t sess_id_len;
-    int i, protverr;
+    int do_fill_random, protverr;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;
 #ifndef OPENSSL_NO_COMP
     SSL_COMP *comp;
 #endif
@@ -1191,37 +1498,47 @@ CON_FUNC_RETURN tls_construct_client_hello(SSL_CONNECTION *s, WPACKET *pkt)
         return CON_FUNC_ERROR;
     }

-    if (sess == NULL
-        || !ssl_version_supported(s, sess->ssl_version, NULL)
-        || !SSL_SESSION_is_resumable(sess)) {
-        if (s->hello_retry_request == SSL_HRR_NONE
-            && !ssl_get_new_session(s, 0)) {
-            /* SSLfatal() already called */
-            return CON_FUNC_ERROR;
+#ifndef OPENSSL_NO_ECH
+    /* if we're doing ECH, re-use session ID setup earlier */
+    if (s->ext.ech.es == NULL)
+#endif
+        if (sess == NULL
+            || !ssl_version_supported(s, sess->ssl_version, NULL)
+            || !SSL_SESSION_is_resumable(sess)) {
+            if (s->hello_retry_request == SSL_HRR_NONE
+                && !ssl_get_new_session(s, 0)) {
+                /* SSLfatal() already called */
+                return CON_FUNC_ERROR;
+            }
         }
-    }
     /* else use the pre-loaded session */

-    p = s->s3.client_random;
+#ifndef OPENSSL_NO_ECH
+    /* use different client_random fields for inner and outer */
+    if (s->ext.ech.es != NULL && s->ext.ech.ch_depth == 1)
+        p = s->ext.ech.client_random;
+    else
+#endif
+        p = s->s3.client_random;

     /*
      * for DTLS if client_random is initialized, reuse it, we are
      * required to use same upon reply to HelloVerify
      */
-    if (SSL_CONNECTION_IS_DTLS(s)) {
+    if (SSL_CONNECTION_IS_DTLS(s) && s->hello_retry_request == SSL_HRR_NONE) {
         size_t idx;
-        i = 1;
+        do_fill_random = 1;
         for (idx = 0; idx < sizeof(s->s3.client_random); idx++) {
             if (p[idx]) {
-                i = 0;
+                do_fill_random = 0;
                 break;
             }
         }
     } else {
-        i = (s->hello_retry_request == SSL_HRR_NONE);
+        do_fill_random = (s->hello_retry_request == SSL_HRR_NONE);
     }

-    if (i && ssl_fill_hello_random(s, 0, p, sizeof(s->s3.client_random), DOWNGRADE_NONE) <= 0) {
+    if (do_fill_random && ssl_fill_hello_random(s, 0, p, sizeof(s->s3.client_random), DOWNGRADE_NONE) <= 0) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return CON_FUNC_ERROR;
     }
@@ -1260,37 +1577,54 @@ CON_FUNC_RETURN tls_construct_client_hello(SSL_CONNECTION *s, WPACKET *pkt)
      * supported_versions extension for the real supported versions.
      */
     if (!WPACKET_put_bytes_u16(pkt, s->client_version)
-        || !WPACKET_memcpy(pkt, s->s3.client_random, SSL3_RANDOM_SIZE)) {
+        || !WPACKET_memcpy(pkt, p, SSL3_RANDOM_SIZE)) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return CON_FUNC_ERROR;
     }

     /* Session ID */
     session_id = s->session->session_id;
-    if (s->new_session || s->session->ssl_version == TLS1_3_VERSION) {
-        if (s->version == TLS1_3_VERSION
-            && (s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0) {
+#ifndef OPENSSL_NO_ECH
+    /* same session ID is used for inner/outer when doing ECH */
+    if (s->ext.ech.es != NULL) {
+        if (s->version != TLS1_3_VERSION) {
+            SSLfatal(s, SSL_AD_PROTOCOL_VERSION, SSL_R_UNSUPPORTED_SSL_VERSION);
+            return CON_FUNC_ERROR;
+        }
+        if ((s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0)
             sess_id_len = sizeof(s->tmp_session_id);
-            s->tmp_session_id_len = sess_id_len;
-            session_id = s->tmp_session_id;
-            if (s->hello_retry_request == SSL_HRR_NONE
-                && RAND_bytes_ex(sctx->libctx, s->tmp_session_id,
-                       sess_id_len, 0)
-                    <= 0) {
-                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-                return CON_FUNC_ERROR;
-            }
-        } else {
+        else
             sess_id_len = 0;
-        }
     } else {
-        assert(s->session->session_id_length <= sizeof(s->session->session_id));
-        sess_id_len = s->session->session_id_length;
-        if (s->version == TLS1_3_VERSION) {
-            s->tmp_session_id_len = sess_id_len;
-            memcpy(s->tmp_session_id, s->session->session_id, sess_id_len);
+#endif
+        if (s->new_session || s->session->ssl_version == version1_3) {
+            if (s->version == TLS1_3_VERSION
+                && (s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0) {
+                sess_id_len = sizeof(s->tmp_session_id);
+                s->tmp_session_id_len = sess_id_len;
+                session_id = s->tmp_session_id;
+                if (s->hello_retry_request == SSL_HRR_NONE
+                    && RAND_bytes_ex(sctx->libctx, s->tmp_session_id,
+                           sess_id_len, 0)
+                        <= 0) {
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                    return CON_FUNC_ERROR;
+                }
+            } else {
+                sess_id_len = 0;
+            }
+        } else {
+            assert(s->session->session_id_length <= sizeof(s->session->session_id));
+            sess_id_len = s->session->session_id_length;
+            if (s->version == version1_3) {
+                s->tmp_session_id_len = sess_id_len;
+                memcpy(s->tmp_session_id, s->session->session_id, sess_id_len);
+            }
         }
+#ifndef OPENSSL_NO_ECH
     }
+#endif
+
     if (!WPACKET_start_sub_packet_u8(pkt)
         || (sess_id_len != 0 && !WPACKET_memcpy(pkt, session_id, sess_id_len))
         || !WPACKET_close(pkt)) {
@@ -1332,9 +1666,10 @@ CON_FUNC_RETURN tls_construct_client_hello(SSL_CONNECTION *s, WPACKET *pkt)
 #ifndef OPENSSL_NO_COMP
     if (ssl_allow_compression(s)
         && sctx->comp_methods
-        && (SSL_CONNECTION_IS_DTLS(s)
-            || s->s3.tmp.max_ver < TLS1_3_VERSION)) {
+        && ssl_version_cmp(s, s->s3.tmp.max_ver, version1_3) < 0) {
+        int i;
         int compnum = sk_SSL_COMP_num(sctx->comp_methods);
+
         for (i = 0; i < compnum; i++) {
             comp = sk_SSL_COMP_value(sctx->comp_methods, i);
             if (!WPACKET_put_bytes_u8(pkt, comp->id)) {
@@ -1363,6 +1698,8 @@ MSG_PROCESS_RETURN dtls_process_hello_verify(SSL_CONNECTION *s, PACKET *pkt)
 {
     size_t cookie_len;
     PACKET cookiepkt;
+    int min_version;
+    SSL *ssl = SSL_CONNECTION_GET_SSL(s);

     if (!PACKET_forward(pkt, 2)
         || !PACKET_get_length_prefixed_1(pkt, &cookiepkt)) {
@@ -1382,6 +1719,25 @@ MSG_PROCESS_RETURN dtls_process_hello_verify(SSL_CONNECTION *s, PACKET *pkt)
     }
     s->d1->cookie_len = cookie_len;

+    if (ssl == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return MSG_PROCESS_ERROR;
+    }
+
+    min_version = SSL_get_min_proto_version(ssl);
+
+    /*
+     * Server responds with a HelloVerify which means we cannot negotiate a
+     * higher version than DTLSv1.2.
+     */
+    if (min_version != 0
+        && ssl_version_cmp(s, min_version, DTLS1_2_VERSION) > 0) {
+        SSLfatal(s, SSL_AD_PROTOCOL_VERSION, SSL_R_UNSUPPORTED_PROTOCOL);
+        return MSG_PROCESS_ERROR;
+    }
+
+    s->d1->hello_verify_request = SSL_HVR_RECEIVED;
+
     return MSG_PROCESS_FINISHED_READING;
 }

@@ -1403,7 +1759,7 @@ static int set_client_ciphersuite(SSL_CONNECTION *s,
      * If it is a disabled cipher we either didn't send it in client hello,
      * or it's not allowed for the selected protocol. So we return an error.
      */
-    if (ssl_cipher_disabled(s, c, SSL_SECOP_CIPHER_CHECK, 1)) {
+    if (ssl_cipher_disabled(s, c, SSL_SECOP_CIPHER_CHECK)) {
         SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_WRONG_CIPHER_RETURNED);
         return 0;
     }
@@ -1416,7 +1772,7 @@ static int set_client_ciphersuite(SSL_CONNECTION *s,
         return 0;
     }

-    if (SSL_CONNECTION_IS_TLS13(s) && s->s3.tmp.new_cipher != NULL
+    if (SSL_CONNECTION_IS_VERSION13(s) && s->s3.tmp.new_cipher != NULL
         && s->s3.tmp.new_cipher->id != c->id) {
         /* ServerHello selected a different ciphersuite to that in the HRR */
         SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_WRONG_CIPHER_RETURNED);
@@ -1431,7 +1787,7 @@ static int set_client_ciphersuite(SSL_CONNECTION *s,
     if (s->session->cipher != NULL)
         s->session->cipher_id = s->session->cipher->id;
     if (s->hit && (s->session->cipher_id != c->id)) {
-        if (SSL_CONNECTION_IS_TLS13(s)) {
+        if (SSL_CONNECTION_IS_VERSION13(s)) {
             const EVP_MD *md = ssl_md(sctx, c->algorithm2);

             if (!ossl_assert(s->session->cipher != NULL)) {
@@ -1473,11 +1829,32 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL_CONNECTION *s, PACKET *pkt)
     unsigned int sversion;
     unsigned int context;
     RAW_EXTENSION *extensions = NULL;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;
+    const unsigned int version1_2 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_2_VERSION
+                                                              : TLS1_2_VERSION;
     SSL *ssl = SSL_CONNECTION_GET_SSL(s);
     SSL *ussl = SSL_CONNECTION_GET_USER_SSL(s);
 #ifndef OPENSSL_NO_COMP
     SSL_COMP *comp;
 #endif
+#ifndef OPENSSL_NO_ECH
+    const unsigned char *shbuf = NULL;
+    size_t shlen, alen;
+    /*
+     * client and server accept signal buffers, initialise in case of
+     * e.g. memory fail when calculating, only really applies when
+     * SUPERVERBOSE is defined and we trace these.
+     */
+    unsigned char c_signal[OSSL_ECH_SIGNAL_LEN] = { 0 };
+    unsigned char s_signal[OSSL_ECH_SIGNAL_LEN] = { 0xff };
+    unsigned char *abuf = NULL;
+
+    shlen = PACKET_remaining(pkt);
+    if (PACKET_peek_bytes(pkt, &shbuf, shlen) != 1) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
+        goto err;
+    }
+#endif

     if (!PACKET_get_net_2(pkt, &sversion)) {
         SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
@@ -1485,8 +1862,7 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL_CONNECTION *s, PACKET *pkt)
     }

     /* load the server random */
-    if (s->version == TLS1_3_VERSION
-        && sversion == TLS1_2_VERSION
+    if (s->version == version1_3 && sversion == version1_2
         && PACKET_remaining(pkt) >= SSL3_RANDOM_SIZE
         && memcmp(hrrrandom, PACKET_data(pkt), SSL3_RANDOM_SIZE) == 0) {
         if (s->hello_retry_request != SSL_HRR_NONE) {
@@ -1519,7 +1895,7 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL_CONNECTION *s, PACKET *pkt)
     session_id_len = PACKET_remaining(&session_id);
     if (session_id_len > sizeof(s->session->session_id)
         || session_id_len > SSL3_SESSION_ID_SIZE) {
-        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_SSL3_SESSION_ID_TOO_LONG);
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_TLS_SESSION_ID_TOO_LONG);
         goto err;
     }

@@ -1542,7 +1918,18 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL_CONNECTION *s, PACKET *pkt)
         goto err;
     }

-    if (!hrr) {
+    if (hrr) {
+        if (!tls_collect_extensions(s, &extpkt, SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST,
+                &extensions, NULL, 1)
+            || !tls_validate_no_unknown_extensions(s, &extpkt,
+                SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST)
+            || !tls_parse_extension(s, TLSEXT_IDX_ech,
+                SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST,
+                extensions, NULL, 0)) {
+            /* SSLfatal() already called */
+            goto err;
+        }
+    } else {
         if (!tls_collect_extensions(s, &extpkt,
                 SSL_EXT_TLS1_2_SERVER_HELLO
                     | SSL_EXT_TLS1_3_SERVER_HELLO,
@@ -1550,52 +1937,167 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL_CONNECTION *s, PACKET *pkt)
             /* SSLfatal() already called */
             goto err;
         }
+    }
+
+#ifndef OPENSSL_NO_ECH
+    /*
+     * If we sent an ECH then check if that worked based on the
+     * ServerHello.random confirmation trick. If that is good
+     * then we'll swap over the inner and outer contexts and
+     * proceed with inner. There are some HRR wrinkles too
+     * though.
+     */
+    if (s->ext.ech.es != NULL
+        && s->ext.ech.done != 1 && s->ext.ech.ch_depth == 0
+        && s->ext.ech.grease == OSSL_ECH_NOT_GREASE
+        && s->ext.ech.attempted_type == TLSEXT_TYPE_ech) {
+        if (!set_client_ciphersuite(s, cipherchars)) {
+            /* SSLfatal() already called */
+            goto err;
+        }
+        /* add any SH/HRR to inner transcript if we tried ECH */
+        if (s->ext.ech.attempted == 1) {
+            unsigned char prelude[4];
+
+            prelude[0] = SSL3_MT_SERVER_HELLO;
+            prelude[1] = (shlen >> 16) & 0xff;
+            prelude[2] = (shlen >> 8) & 0xff;
+            prelude[3] = shlen & 0xff;
+            if (ossl_ech_intbuf_add(s, prelude, sizeof(prelude), hrr) != 1
+                || ossl_ech_intbuf_add(s, shbuf, shlen, 0) != 1) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+        }
+        /* check the ECH accept signal */
+        if (ossl_ech_calc_confirm(s, hrr, c_signal, shlen) != 1) {
+            /* SSLfatal() already called */
+            OSSL_TRACE(TLS, "ECH calc confirm failed\n");
+            goto err;
+        }
+        if (ossl_ech_find_confirm(s, hrr, s_signal) != 1
+            || memcmp(s_signal, c_signal, sizeof(c_signal)) != 0) {
+            OSSL_TRACE(TLS, "ECH accept check failed\n");
+#ifdef OSSL_ECH_SUPERVERBOSE
+            ossl_ech_pbuf("ECH client accept val:", c_signal, sizeof(c_signal));
+            ossl_ech_pbuf("ECH server accept val:", s_signal, sizeof(s_signal));
+#endif
+            s->ext.ech.success = 0;
+        } else { /* match, ECH worked */
+            OSSL_TRACE_BEGIN(TLS)
+            {
+                BIO_printf(trc_out, "ECH accept check ok\n");
+                BIO_printf(trc_out, "ECH set session hostname to %s\n",
+                    s->ext.hostname ? s->ext.hostname : "NULL");
+            }
+            OSSL_TRACE_END(TLS);
+            s->ext.ech.success = 1;
+        }
+        if (!hrr && s->ext.ech.success == 1) {
+            if (ossl_ech_swaperoo(s) != 1
+                || ossl_ech_intbuf_fetch(s, &abuf, &alen) != 1
+                || ossl_ech_reset_hs_buffer(s, abuf, alen) != 1) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+        } else if (hrr == 1 && s->ext.ech.success == 1) {
+            OSSL_TRACE(TLS, "ECH HRR accept ok, continuing.\n");
+            /*
+             * If we got retry_configs then we should be validating
+             * the outer CH, so we better set the hostname for the
+             * connection accordingly.
+             */
+        } else if (!hrr && s->ext.ech.success == 0
+            && s->ext.ech.hrrsignal_p != NULL) {
+            /*
+             * we previously saw a good HRR ECH acceptance but now
+             * the SH.random ECH acceptance signal is bad so that's an
+             * illegal protocol error
+             */
+            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_ECH_REQUIRED);
+            goto err;
+        } else {
+            OSSL_TRACE1(TLS, "ECH falling back to public_name: %s\n",
+                s->ext.ech.outer_hostname != NULL ? s->ext.ech.outer_hostname : "NONE");
+            s->ext.ech.former_inner = s->ext.hostname;
+            s->ext.hostname = NULL;
+            if (s->ext.ech.outer_hostname != NULL) {
+                s->ext.hostname = OPENSSL_strdup(s->ext.ech.outer_hostname);
+                if (s->ext.hostname == NULL) {
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                    goto err;
+                }
+                if (SSL_set1_dnsname(ssl, s->ext.ech.outer_hostname) != 1) {
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                    goto err;
+                }
+            }
+        }
+    }
+#endif

+    if (!hrr) {
         if (!ssl_choose_client_version(s, sversion, extensions)) {
             /* SSLfatal() already called */
             goto err;
         }
     }

-    if (SSL_CONNECTION_IS_TLS13(s) || hrr) {
+    if (SSL_CONNECTION_IS_VERSION13(s) || hrr) {
         if (compression != 0) {
             SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
                 SSL_R_INVALID_COMPRESSION_ALGORITHM);
             goto err;
         }

-        if (session_id_len != s->tmp_session_id_len
-            || memcmp(PACKET_data(&session_id), s->tmp_session_id,
-                   session_id_len)
-                != 0) {
-            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_INVALID_SESSION_ID);
-            goto err;
+        if (SSL_CONNECTION_IS_DTLS(s)) {
+            if (session_id_len != 0) {
+                SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_INVALID_SESSION_ID);
+                goto err;
+            }
+        } else {
+            if (session_id_len != s->tmp_session_id_len
+                || memcmp(PACKET_data(&session_id), s->tmp_session_id,
+                       session_id_len)
+                    != 0) {
+                SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_INVALID_SESSION_ID);
+                goto err;
+            }
         }
     }

     if (hrr) {
+        int ret;
+
         if (!set_client_ciphersuite(s, cipherchars)) {
             /* SSLfatal() already called */
             goto err;
         }

-        return tls_process_as_hello_retry_request(s, &extpkt);
+        ret = tls_process_as_hello_retry_request(s, extensions);
+        OPENSSL_free(extensions);
+
+        return ret;
     }

     /*
      * Now we have chosen the version we need to check again that the extensions
      * are appropriate for this version.
      */
-    context = SSL_CONNECTION_IS_TLS13(s) ? SSL_EXT_TLS1_3_SERVER_HELLO
-                                         : SSL_EXT_TLS1_2_SERVER_HELLO;
+    context = SSL_CONNECTION_IS_VERSION13(s) ? SSL_EXT_TLS1_3_SERVER_HELLO
+                                             : SSL_EXT_TLS1_2_SERVER_HELLO;
     if (!tls_validate_all_contexts(s, context, extensions)) {
         SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
         goto err;
     }
+    if (SSL_CONNECTION_IS_TLS13(s)
+        && !tls_validate_no_unknown_extensions(s, &extpkt, context))
+        /* SSLfatal() already called */
+        goto err;

     s->hit = 0;

-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         /*
          * In TLSv1.3 a ServerHello message signals a key change so the end of
          * the message must be on a record boundary.
@@ -1688,7 +2190,7 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL_CONNECTION *s, PACKET *pkt)
          * echo of what we originally sent in the ClientHello and should not be
          * used for resumption.
          */
-        if (!SSL_CONNECTION_IS_TLS13(s)) {
+        if (!SSL_CONNECTION_IS_VERSION13(s)) {
             s->session->session_id_length = session_id_len;
             /* session_id_len could be 0 */
             if (session_id_len > 0)
@@ -1760,7 +2262,12 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL_CONNECTION *s, PACKET *pkt)
     }

 #ifndef OPENSSL_NO_SCTP
-    if (SSL_CONNECTION_IS_DTLS(s) && s->hit) {
+    /*
+     * Before exporting the SCTP auth key we check if DTLSv1.3 has been negotiated
+     * which is not supported.
+     * Refer to draft-tuexen-tsvwg-rfc6083-bis-04 for more info.
+     */
+    if (SSL_CONNECTION_IS_DTLS(s) && !SSL_CONNECTION_IS_DTLS13(s) && s->hit) {
         unsigned char sctpauthkey[64];
         char labelbuffer[sizeof(DTLS1_SCTP_AUTH_LABEL)];
         size_t labellen;
@@ -1796,7 +2303,7 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL_CONNECTION *s, PACKET *pkt)
      * In TLSv1.3 we have some post-processing to change cipher state, otherwise
      * we're done with this message
      */
-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         if (!ssl->method->ssl3_enc->setup_key_block(s)
             || !tls13_store_handshake_traffic_hash(s)) {
             /* SSLfatal() already called */
@@ -1813,15 +2320,18 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL_CONNECTION *s, PACKET *pkt)
          */
         if (SSL_IS_QUIC_HANDSHAKE(s)
             || (s->early_data_state == SSL_EARLY_DATA_NONE
-                && (s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) == 0)) {
+                && !SSL_CONNECTION_MIDDLEBOX_IS_ENABLED(s))) {
             if (!ssl->method->ssl3_enc->change_cipher_state(s,
                     SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_CLIENT_WRITE)) {
                 /* SSLfatal() already called */
                 goto err;
             }
         }
-        if (!ssl->method->ssl3_enc->change_cipher_state(s,
-                SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_CLIENT_READ)) {
+
+        if (SSL_CONNECTION_IS_DTLS13(s)) {
+            dtls13_hellos_done(s);
+        } else if (!ssl->method->ssl3_enc->change_cipher_state(s,
+                       SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_CLIENT_READ)) {
             /* SSLfatal() already called */
             goto err;
         }
@@ -1835,38 +2345,40 @@ err:
 }

 static MSG_PROCESS_RETURN tls_process_as_hello_retry_request(SSL_CONNECTION *s,
-    PACKET *extpkt)
+    RAW_EXTENSION *extensions)
 {
-    RAW_EXTENSION *extensions = NULL;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;
+    const int versionany = SSL_CONNECTION_IS_DTLS(s) ? DTLS_ANY_VERSION : TLS_ANY_VERSION;
+    const size_t msghdrlen = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_HM_HEADER_LENGTH
+                                                       : SSL3_HM_HEADER_LENGTH;

     /*
      * If we were sending early_data then any alerts should not be sent using
      * the old wrlmethod.
      */
     if (s->early_data_state == SSL_EARLY_DATA_FINISHED_WRITING
-        && !ssl_set_new_record_layer(s,
-            TLS_ANY_VERSION,
+        && !ssl_set_new_record_layer(s, versionany,
             OSSL_RECORD_DIRECTION_WRITE,
             OSSL_RECORD_PROTECTION_LEVEL_NONE,
-            NULL, 0, NULL, 0, NULL, 0, NULL, 0,
-            NULL, 0, NID_undef, NULL, NULL, NULL)) {
+            NULL, 0, NULL, NULL, 0, NULL, 0, NULL,
+            0, NULL, NULL, 0, NID_undef, NULL,
+            NULL, NULL)) {
         /* SSLfatal already called */
         goto err;
     }
-    /* We are definitely going to be using TLSv1.3 */
-    s->rlayer.wrlmethod->set_protocol_version(s->rlayer.wrl, TLS1_3_VERSION);

-    if (!tls_collect_extensions(s, extpkt, SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST,
-            &extensions, NULL, 1)
-        || !tls_parse_all_extensions(s, SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST,
+    /* We are definitely going to be using (D)TLSv1.3 */
+    if (!s->rlayer.wrlmethod->set_protocol_version(s->rlayer.wrl, version1_3)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }
+
+    if (!tls_parse_all_extensions(s, SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST,
             extensions, NULL, 0, 1)) {
         /* SSLfatal() already called */
         goto err;
     }

-    OPENSSL_free(extensions);
-    extensions = NULL;
-
     if (s->ext.tls13_cookie_len == 0 && s->s3.tmp.pkey != NULL) {
         /*
          * We didn't receive a cookie or a new key_share so the next
@@ -1892,14 +2404,13 @@ static MSG_PROCESS_RETURN tls_process_as_hello_retry_request(SSL_CONNECTION *s,
      * for HRR messages.
      */
     if (!ssl3_finish_mac(s, (unsigned char *)s->init_buf->data,
-            s->init_num + SSL3_HM_HEADER_LENGTH)) {
+            s->init_num + msghdrlen)) {
         /* SSLfatal() already called */
         goto err;
     }

     return MSG_PROCESS_FINISHED_READING;
 err:
-    OPENSSL_free(extensions);
     return MSG_PROCESS_ERROR;
 }

@@ -1964,7 +2475,7 @@ static WORK_STATE tls_post_process_server_rpk(SSL_CONNECTION *sc,
      * skip check since TLS 1.3 ciphersuites can be used with any certificate
      * type.
      */
-    if (!SSL_CONNECTION_IS_TLS13(sc)) {
+    if (!SSL_CONNECTION_IS_VERSION13(sc)) {
         if ((clu->amask & sc->s3.tmp.new_cipher->algorithm_auth) == 0) {
             SSLfatal(sc, SSL_AD_ILLEGAL_PARAMETER, SSL_R_WRONG_RPK_TYPE);
             return WORK_ERROR;
@@ -1979,7 +2490,7 @@ static WORK_STATE tls_post_process_server_rpk(SSL_CONNECTION *sc,
     sc->session->verify_result = sc->verify_result;

     /* Save the current hash state for when we receive the CertificateVerify */
-    if (SSL_CONNECTION_IS_TLS13(sc)
+    if (SSL_CONNECTION_IS_VERSION13(sc)
         && !ssl_handshake_hash(sc, sc->cert_verify_hash,
             sizeof(sc->cert_verify_hash),
             &sc->cert_verify_hash_len)) {
@@ -2014,7 +2525,7 @@ MSG_PROCESS_RETURN tls_process_server_certificate(SSL_CONNECTION *s,
         goto err;
     }

-    if ((SSL_CONNECTION_IS_TLS13(s) && !PACKET_get_1(pkt, &context))
+    if ((SSL_CONNECTION_IS_VERSION13(s) && !PACKET_get_1(pkt, &context))
         || context != 0
         || !PACKET_get_net_3(pkt, &cert_list_len)
         || PACKET_remaining(pkt) != cert_list_len
@@ -2047,7 +2558,7 @@ MSG_PROCESS_RETURN tls_process_server_certificate(SSL_CONNECTION *s,
             goto err;
         }

-        if (SSL_CONNECTION_IS_TLS13(s)) {
+        if (SSL_CONNECTION_IS_VERSION13(s)) {
             RAW_EXTENSION *rawexts = NULL;
             PACKET extensions;

@@ -2154,7 +2665,7 @@ WORK_STATE tls_post_process_server_certificate(SSL_CONNECTION *s,
      * skip check since TLS 1.3 ciphersuites can be used with any certificate
      * type.
      */
-    if (!SSL_CONNECTION_IS_TLS13(s)) {
+    if (!SSL_CONNECTION_IS_VERSION13(s)) {
         if ((clu->amask & s->s3.tmp.new_cipher->algorithm_auth) == 0) {
             SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_WRONG_CERTIFICATE_TYPE);
             return WORK_ERROR;
@@ -2174,7 +2685,7 @@ WORK_STATE tls_post_process_server_certificate(SSL_CONNECTION *s,
     s->session->peer_rpk = NULL;

     /* Save the current hash state for when we receive the CertificateVerify */
-    if (SSL_CONNECTION_IS_TLS13(s)
+    if (SSL_CONNECTION_IS_VERSION13(s)
         && !ssl_handshake_hash(s, s->cert_verify_hash,
             sizeof(s->cert_verify_hash),
             &s->cert_verify_hash_len)) {
@@ -2604,7 +3115,7 @@ MSG_PROCESS_RETURN tls_process_certificate_request(SSL_CONNECTION *s,
     if (s->s3.tmp.valid_flags != NULL)
         memset(s->s3.tmp.valid_flags, 0, s->ssl_pkey_num * sizeof(uint32_t));
     else
-        s->s3.tmp.valid_flags = OPENSSL_zalloc(s->ssl_pkey_num * sizeof(uint32_t));
+        s->s3.tmp.valid_flags = OPENSSL_calloc(s->ssl_pkey_num, sizeof(uint32_t));

     /* Give up for good if allocation didn't work */
     if (s->s3.tmp.valid_flags == NULL) {
@@ -2612,7 +3123,7 @@ MSG_PROCESS_RETURN tls_process_certificate_request(SSL_CONNECTION *s,
         return MSG_PROCESS_ERROR;
     }

-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         PACKET reqctx, extensions;
         RAW_EXTENSION *rawexts = NULL;

@@ -2716,7 +3227,7 @@ MSG_PROCESS_RETURN tls_process_certificate_request(SSL_CONNECTION *s,
      * SSL_get1_peer_certificate() returns something sensible in
      * client_cert_cb.
      */
-    if (SSL_CONNECTION_IS_TLS13(s)
+    if (SSL_CONNECTION_IS_VERSION13(s)
         && s->post_handshake_auth != SSL_PHA_REQUESTED)
         return MSG_PROCESS_CONTINUE_READING;

@@ -2731,19 +3242,18 @@ MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL_CONNECTION *s,
     unsigned int sess_len;
     RAW_EXTENSION *exts = NULL;
     PACKET nonce;
-    EVP_MD *sha256 = NULL;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);

     PACKET_null_init(&nonce);

     if (!PACKET_get_net_4(pkt, &ticket_lifetime_hint)
-        || (SSL_CONNECTION_IS_TLS13(s)
+        || (SSL_CONNECTION_IS_VERSION13(s)
             && (!PACKET_get_net_4(pkt, &age_add)
                 || !PACKET_get_length_prefixed_1(pkt, &nonce)))
         || !PACKET_get_net_2(pkt, &ticklen)
-        || (SSL_CONNECTION_IS_TLS13(s) ? (ticklen == 0
-                                             || PACKET_remaining(pkt) < ticklen)
-                                       : PACKET_remaining(pkt) != ticklen)) {
+        || (SSL_CONNECTION_IS_VERSION13(s) ? (ticklen == 0
+                                                 || PACKET_remaining(pkt) < ticklen)
+                                           : PACKET_remaining(pkt) != ticklen)) {
         SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
         goto err;
     }
@@ -2764,7 +3274,7 @@ MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL_CONNECTION *s,
      * post-handshake and the session may have already gone into the session
      * cache.
      */
-    if (SSL_CONNECTION_IS_TLS13(s) || s->session->session_id_length > 0) {
+    if (SSL_CONNECTION_IS_VERSION13(s) || s->session->session_id_length > 0) {
         SSL_SESSION *new_sess;

         /*
@@ -2777,7 +3287,7 @@ MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL_CONNECTION *s,
         }

         if ((s->session_ctx->session_cache_mode & SSL_SESS_CACHE_CLIENT) != 0
-            && !SSL_CONNECTION_IS_TLS13(s)) {
+            && !SSL_CONNECTION_IS_VERSION13(s)) {
             /*
              * In TLSv1.2 and below the arrival of a new tickets signals that
              * any old ticket we were using is now out of date, so we remove the
@@ -2811,11 +3321,11 @@ MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL_CONNECTION *s,
     s->session->ext.tick_age_add = age_add;
     s->session->ext.ticklen = ticklen;

-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         PACKET extpkt;

         /*
-         * Fulfilling RFC8446:4.6.1 requirement: Clients MUST NOT cache
+         * Fulfilling RFC9846:4.7.1 requirement: Clients MUST NOT cache
          * tickets for longer than 7 days.
          */
         if (ticket_lifetime_hint > 604800) {
@@ -2849,30 +3359,49 @@ MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL_CONNECTION *s,
      * We choose the former approach because this fits in with assumptions
      * elsewhere in OpenSSL. The session ID is set to the SHA256 hash of the
      * ticket.
-     */
-    sha256 = EVP_MD_fetch(sctx->libctx, "SHA2-256", sctx->propq);
-    if (sha256 == NULL) {
-        /* Error is already recorded */
-        SSLfatal_alert(s, SSL_AD_INTERNAL_ERROR);
-        goto err;
-    }
-    /*
+     *
      * We use sess_len here because EVP_Digest expects an int
      * but s->session->session_id_length is a size_t
      */
     if (!EVP_Digest(s->session->ext.tick, ticklen,
             s->session->session_id, &sess_len,
-            sha256, NULL)) {
+            sctx->sha256, NULL)) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
         goto err;
     }
-    EVP_MD_free(sha256);
-    sha256 = NULL;
     s->session->session_id_length = sess_len;
     s->session->not_resumable = 0;

+    /*
+     * Refresh the session's recollection of the negotiated ALPN protocol to
+     * match this connection, rather than leaving it as whatever the session
+     * (or the session it was duplicated from, on a resumption) previously
+     * carried. Without this, a connection that resumes a session but
+     * negotiates no ALPN (or a different one) leaves the stale protocol
+     * name in place, and a later 0-RTT attempt against this ticket can
+     * incorrectly trip the "inconsistent early data alpn" check -- or, if
+     * the client happens to offer that same stale protocol again by
+     * coincidence, incorrectly appear consistent. This mirrors, on the
+     * client, the server-side fix for issue #11197 in
+     * tls_construct_new_session_ticket().
+     */
+    OPENSSL_free(s->session->ext.alpn_selected);
+    if (s->s3.alpn_selected != NULL) {
+        s->session->ext.alpn_selected = OPENSSL_memdup(s->s3.alpn_selected,
+            s->s3.alpn_selected_len);
+        if (s->session->ext.alpn_selected == NULL) {
+            s->session->ext.alpn_selected_len = 0;
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_CRYPTO_LIB);
+            goto err;
+        }
+        s->session->ext.alpn_selected_len = s->s3.alpn_selected_len;
+    } else {
+        s->session->ext.alpn_selected = NULL;
+        s->session->ext.alpn_selected_len = 0;
+    }
+
     /* This is a standalone message in TLSv1.3, so there is no more to read */
-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         const EVP_MD *md = ssl_handshake_md(s);
         int hashleni = EVP_MD_get_size(md);
         size_t hashlen;
@@ -2906,7 +3435,6 @@ MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL_CONNECTION *s,

     return MSG_PROCESS_CONTINUE_READING;
 err:
-    EVP_MD_free(sha256);
     OPENSSL_free(exts);
     return MSG_PROCESS_ERROR;
 }
@@ -2915,39 +3443,75 @@ err:
  * In TLSv1.3 this is called from the extensions code, otherwise it is used to
  * parse a separate message. Returns 1 on success or 0 on failure
  */
-int tls_process_cert_status_body(SSL_CONNECTION *s, PACKET *pkt)
+int tls_process_cert_status_body(SSL_CONNECTION *s, size_t chainidx, PACKET *pkt)
 {
-    size_t resplen;
     unsigned int type;
+#ifndef OPENSSL_NO_OCSP
+    size_t resplen;
+    unsigned char *respder;
+    OCSP_RESPONSE *resp = NULL;
+    const unsigned char *p;
+#endif

     if (!PACKET_get_1(pkt, &type)
         || type != TLSEXT_STATUSTYPE_ocsp) {
         SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_UNSUPPORTED_STATUS_TYPE);
         return 0;
     }
-    if (!PACKET_get_net_3_len(pkt, &resplen)
-        || PACKET_remaining(pkt) != resplen) {
-        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
-        return 0;
-    }
-    s->ext.ocsp.resp = OPENSSL_malloc(resplen);
-    if (s->ext.ocsp.resp == NULL) {
-        s->ext.ocsp.resp_len = 0;
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_CRYPTO_LIB);
-        return 0;
+
+#ifndef OPENSSL_NO_OCSP
+    OPENSSL_free(s->ext.ocsp.resp);
+    s->ext.ocsp.resp = NULL;
+    s->ext.ocsp.resp_len = 0;
+
+    if (s->ext.ocsp.resp_ex == NULL)
+        s->ext.ocsp.resp_ex = sk_OCSP_RESPONSE_new_null();
+
+    if (!SSL_CONNECTION_IS_VERSION13(s) && type == TLSEXT_STATUSTYPE_ocsp) {
+        sk_OCSP_RESPONSE_pop_free(s->ext.ocsp.resp_ex, OCSP_RESPONSE_free);
+        s->ext.ocsp.resp_ex = sk_OCSP_RESPONSE_new_null();
     }
-    s->ext.ocsp.resp_len = resplen;
-    if (!PACKET_copy_bytes(pkt, s->ext.ocsp.resp, resplen)) {
-        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
-        return 0;
+
+    if (PACKET_remaining(pkt) > 0) {
+        if (!PACKET_get_net_3_len(pkt, &resplen)
+            || PACKET_remaining(pkt) != resplen) {
+            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
+            return 0;
+        }
+
+        if (resplen == 0) {
+            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_PACKET);
+            return 0;
+        }
+
+        if ((respder = OPENSSL_malloc(resplen)) == NULL) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_CRYPTO_LIB);
+            return 0;
+        }
+
+        if (!PACKET_copy_bytes(pkt, respder, resplen)) {
+            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
+            OPENSSL_free(respder);
+            return 0;
+        }
+        p = respder;
+        resp = d2i_OCSP_RESPONSE(NULL, &p, (long)resplen);
+        OPENSSL_free(respder);
+        if (resp == NULL) {
+            SSLfatal(s, TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE,
+                SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE);
+            return 0;
+        }
+        sk_OCSP_RESPONSE_insert(s->ext.ocsp.resp_ex, resp, (int)chainidx);
     }

+#endif
     return 1;
 }

 MSG_PROCESS_RETURN tls_process_cert_status(SSL_CONNECTION *s, PACKET *pkt)
 {
-    if (!tls_process_cert_status_body(s, pkt)) {
+    if (!tls_process_cert_status_body(s, 0, pkt)) {
         /* SSLfatal() already called */
         return MSG_PROCESS_ERROR;
     }
@@ -3005,6 +3569,18 @@ int tls_process_initial_server_flight(SSL_CONNECTION *s)
     }
 #endif

+#ifndef OPENSSL_NO_ECH
+    /* check result of ech and return error if needed */
+    if (s->ext.ech.es != NULL
+        && s->ext.ech.attempted == 1
+        && s->ext.ech.success != 1
+        && s->ext.ech.grease != OSSL_ECH_IS_GREASE) {
+        s->ext.ech.retry_configs_ok = 1; /* note those are good */
+        SSLfatal(s, SSL_AD_ECH_REQUIRED, SSL_R_ECH_REQUIRED);
+        return 0;
+    }
+#endif /* OPENSSL_NO_ECH */
+
     return 1;
 }

@@ -3153,7 +3729,7 @@ static int tls_construct_cke_rsa(SSL_CONNECTION *s, WPACKET *pkt)
     }

     /* Fix buf for TLS and beyond */
-    if (s->version > SSL3_VERSION && !WPACKET_start_sub_packet_u16(pkt)) {
+    if (!WPACKET_start_sub_packet_u16(pkt)) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         goto err;
     }
@@ -3173,7 +3749,7 @@ static int tls_construct_cke_rsa(SSL_CONNECTION *s, WPACKET *pkt)
     pctx = NULL;

     /* Fix buf for TLS and beyond */
-    if (s->version > SSL3_VERSION && !WPACKET_close(pkt)) {
+    if (!WPACKET_close(pkt)) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         goto err;
     }
@@ -3312,6 +3888,7 @@ static int tls_construct_cke_gost(SSL_CONNECTION *s, WPACKET *pkt)
     unsigned int md_len;
     unsigned char shared_ukm[32], tmp[256];
     EVP_MD_CTX *ukm_hash = NULL;
+    EVP_MD *ukm_md = NULL;
     int dgst_nid = NID_id_GostR3411_94;
     unsigned char *pms = NULL;
     size_t pmslen = 0;
@@ -3362,8 +3939,10 @@ static int tls_construct_cke_gost(SSL_CONNECTION *s, WPACKET *pkt)
      * data
      */
     ukm_hash = EVP_MD_CTX_new();
+    ukm_md = EVP_MD_fetch(sctx->libctx, OBJ_nid2sn(dgst_nid), sctx->propq);
     if (ukm_hash == NULL
-        || EVP_DigestInit(ukm_hash, EVP_get_digestbynid(dgst_nid)) <= 0
+        || ukm_md == NULL
+        || EVP_DigestInit_ex(ukm_hash, ukm_md, NULL) <= 0
         || EVP_DigestUpdate(ukm_hash, s->s3.client_random,
                SSL3_RANDOM_SIZE)
             <= 0
@@ -3371,9 +3950,12 @@ static int tls_construct_cke_gost(SSL_CONNECTION *s, WPACKET *pkt)
                SSL3_RANDOM_SIZE)
             <= 0
         || EVP_DigestFinal_ex(ukm_hash, shared_ukm, &md_len) <= 0) {
+        EVP_MD_free(ukm_md);
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         goto err;
     }
+    EVP_MD_free(ukm_md);
+    ukm_md = NULL;
     EVP_MD_CTX_free(ukm_hash);
     ukm_hash = NULL;
     if (EVP_PKEY_CTX_ctrl(pkey_ctx, -1, EVP_PKEY_OP_ENCRYPT,
@@ -3431,8 +4013,7 @@ int ossl_gost_ukm(const SSL_CONNECTION *s, unsigned char *dgst_buf)
     EVP_MD_CTX *hash = NULL;
     unsigned int md_len;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
-    const EVP_MD *md = ssl_evp_md_fetch(sctx->libctx, NID_id_GostR3411_2012_256,
-        sctx->propq);
+    const EVP_MD *md = EVP_MD_fetch(sctx->libctx, "md_gost12_256", sctx->propq);

     if (md == NULL)
         return 0;
@@ -3510,7 +4091,7 @@ static int tls_construct_cke_gost18(SSL_CONNECTION *s, WPACKET *pkt)
         goto err;
     };

-    /* Reuse EVP_PKEY_CTRL_SET_IV, make choice in engine code */
+    /* Reuse EVP_PKEY_CTRL_SET_IV */
     if (EVP_PKEY_CTX_ctrl(pkey_ctx, -1, EVP_PKEY_OP_ENCRYPT,
             EVP_PKEY_CTRL_SET_IV, 32, rnd_dgst)
         <= 0) {
@@ -3664,7 +4245,12 @@ int tls_client_key_exchange_post_work(SSL_CONNECTION *s)
     pmslen = 0;

 #ifndef OPENSSL_NO_SCTP
-    if (SSL_CONNECTION_IS_DTLS(s)) {
+    /*
+     * Before exporting the SCTP auth key we check if DTLSv1.3 has been negotiated
+     * which is not supported.
+     * Refer to draft-tuexen-tsvwg-rfc6083-bis-04 for more info.
+     */
+    if (SSL_CONNECTION_IS_DTLS(s) && !SSL_CONNECTION_IS_DTLS13(s)) {
         unsigned char sctpauthkey[64];
         char labelbuffer[sizeof(DTLS1_SCTP_AUTH_LABEL)];
         size_t labellen;
@@ -3780,21 +4366,14 @@ WORK_STATE tls_prepare_client_certificate(SSL_CONNECTION *s, WORK_STATE wst)
         if (i && !ssl3_check_client_certificate(s))
             i = 0;
         if (i == 0) {
-            if (s->version == SSL3_VERSION) {
-                s->s3.tmp.cert_req = 0;
-                ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_NO_CERTIFICATE);
-                return WORK_FINISHED_CONTINUE;
-            } else {
-                s->s3.tmp.cert_req = 2;
-                s->ext.compress_certificate_from_peer[0] = TLSEXT_comp_cert_none;
-                if (!ssl3_digest_cached_records(s, 0)) {
-                    /* SSLfatal() already called */
-                    return WORK_ERROR;
-                }
-            }
+            s->s3.tmp.cert_req = 2;
+            s->ext.compress_certificate_from_peer[0] = TLSEXT_comp_cert_none;
+            if (!ssl3_digest_cached_records(s, 0))
+                /* SSLfatal() already called */
+                return WORK_ERROR;
         }

-        if (!SSL_CONNECTION_IS_TLS13(s)
+        if (!SSL_CONNECTION_IS_VERSION13(s)
             || (s->options & SSL_OP_NO_TX_CERTIFICATE_COMPRESSION) != 0)
             s->ext.compress_certificate_from_peer[0] = TLSEXT_comp_cert_none;

@@ -3814,7 +4393,7 @@ CON_FUNC_RETURN tls_construct_client_certificate(SSL_CONNECTION *s,
     CERT_PKEY *cpk = NULL;
     SSL *ssl = SSL_CONNECTION_GET_SSL(s);

-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         if (s->pha_context == NULL) {
             /* no context available, add 0-length context */
             if (!WPACKET_put_bytes_u8(pkt, 0)) {
@@ -3851,11 +4430,11 @@ CON_FUNC_RETURN tls_construct_client_certificate(SSL_CONNECTION *s,
      * then we deferred changing the handshake write keys to the last possible
      * moment. We need to do it now.
      */
-    if (SSL_CONNECTION_IS_TLS13(s)
+    if (SSL_CONNECTION_IS_VERSION13(s)
         && !SSL_IS_QUIC_HANDSHAKE(s)
         && SSL_IS_FIRST_HANDSHAKE(s)
         && (s->early_data_state != SSL_EARLY_DATA_NONE
-            || (s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0)
+            || SSL_CONNECTION_MIDDLEBOX_IS_ENABLED(s))
         && (!ssl->method->ssl3_enc->change_cipher_state(s,
             SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_CLIENT_WRITE))) {
         /*
@@ -3928,8 +4507,8 @@ CON_FUNC_RETURN tls_construct_client_compressed_certificate(SSL_CONNECTION *sc,
         || !WPACKET_reserve_bytes(pkt, max_length, NULL))
         goto err;

-    comp_len = COMP_compress_block(comp, WPACKET_get_curr(pkt), max_length,
-        (unsigned char *)buf->data, length);
+    comp_len = COMP_compress_block(comp, WPACKET_get_curr(pkt), (int)max_length,
+        (unsigned char *)buf->data, (int)length);
     if (comp_len <= 0)
         goto err;

@@ -3947,7 +4526,7 @@ CON_FUNC_RETURN tls_construct_client_compressed_certificate(SSL_CONNECTION *sc,
         && (sc->early_data_state != SSL_EARLY_DATA_NONE
             || (sc->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0)
         && (!ssl->method->ssl3_enc->change_cipher_state(sc,
-            SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_CLIENT_WRITE))) {
+            SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_CLIENT_WRITE | SSL3_CC_COMP_CERT))) {
         /*
          * This is a fatal error, which leaves sc->enc_write_ctx in an
          * inconsistent state and thus ssl3_send_alert may crash.
@@ -4105,121 +4684,11 @@ int ssl_do_client_cert_cb(SSL_CONNECTION *s, X509 **px509, EVP_PKEY **ppkey)
     int i = 0;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);

-#ifndef OPENSSL_NO_ENGINE
-    if (sctx->client_cert_engine) {
-        i = tls_engine_load_ssl_client_cert(s, px509, ppkey);
-        if (i != 0)
-            return i;
-    }
-#endif
     if (sctx->client_cert_cb)
         i = sctx->client_cert_cb(SSL_CONNECTION_GET_USER_SSL(s), px509, ppkey);
     return i;
 }

-int ssl_cipher_list_to_bytes(SSL_CONNECTION *s, STACK_OF(SSL_CIPHER) *sk,
-    WPACKET *pkt)
-{
-    int i;
-    size_t totlen = 0, len, maxlen, maxverok = 0;
-    int empty_reneg_info_scsv = !s->renegotiate
-        && !SSL_CONNECTION_IS_DTLS(s)
-        && ssl_security(s, SSL_SECOP_VERSION, 0, TLS1_VERSION, NULL)
-        && s->min_proto_version <= TLS1_VERSION;
-    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
-
-    /* Set disabled masks for this session */
-    if (!ssl_set_client_disabled(s)) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_PROTOCOLS_AVAILABLE);
-        return 0;
-    }
-
-    if (sk == NULL) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-        return 0;
-    }
-
-#ifdef OPENSSL_MAX_TLS1_2_CIPHER_LENGTH
-#if OPENSSL_MAX_TLS1_2_CIPHER_LENGTH < 6
-#error Max cipher length too short
-#endif
-    /*
-     * Some servers hang if client hello > 256 bytes as hack workaround
-     * chop number of supported ciphers to keep it well below this if we
-     * use TLS v1.2
-     */
-    if (TLS1_get_version(ssl) >= TLS1_2_VERSION)
-        maxlen = OPENSSL_MAX_TLS1_2_CIPHER_LENGTH & ~1;
-    else
-#endif
-        /* Maximum length that can be stored in 2 bytes. Length must be even */
-        maxlen = 0xfffe;
-
-    if (empty_reneg_info_scsv)
-        maxlen -= 2;
-    if (s->mode & SSL_MODE_SEND_FALLBACK_SCSV)
-        maxlen -= 2;
-
-    for (i = 0; i < sk_SSL_CIPHER_num(sk) && totlen < maxlen; i++) {
-        const SSL_CIPHER *c;
-
-        c = sk_SSL_CIPHER_value(sk, i);
-        /* Skip disabled ciphers */
-        if (ssl_cipher_disabled(s, c, SSL_SECOP_CIPHER_SUPPORTED, 0))
-            continue;
-
-        if (!ssl->method->put_cipher_by_char(c, pkt, &len)) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            return 0;
-        }
-
-        /* Sanity check that the maximum version we offer has ciphers enabled */
-        if (!maxverok) {
-            int minproto = SSL_CONNECTION_IS_DTLS(s) ? c->min_dtls : c->min_tls;
-            int maxproto = SSL_CONNECTION_IS_DTLS(s) ? c->max_dtls : c->max_tls;
-
-            if (ssl_version_cmp(s, maxproto, s->s3.tmp.max_ver) >= 0
-                && ssl_version_cmp(s, minproto, s->s3.tmp.max_ver) <= 0)
-                maxverok = 1;
-        }
-
-        totlen += len;
-    }
-
-    if (totlen == 0 || !maxverok) {
-        const char *maxvertext = !maxverok
-            ? "No ciphers enabled for max supported SSL/TLS version"
-            : NULL;
-
-        SSLfatal_data(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_CIPHERS_AVAILABLE,
-            maxvertext);
-        return 0;
-    }
-
-    if (totlen != 0) {
-        if (empty_reneg_info_scsv) {
-            static const SSL_CIPHER scsv = {
-                0, NULL, NULL, SSL3_CK_SCSV, 0, 0, 0, 0, 0, 0, 0, 0, 0
-            };
-            if (!ssl->method->put_cipher_by_char(&scsv, pkt, &len)) {
-                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-                return 0;
-            }
-        }
-        if (s->mode & SSL_MODE_SEND_FALLBACK_SCSV) {
-            static const SSL_CIPHER scsv = {
-                0, NULL, NULL, SSL3_CK_FALLBACK_SCSV, 0, 0, 0, 0, 0, 0, 0, 0, 0
-            };
-            if (!ssl->method->put_cipher_by_char(&scsv, pkt, &len)) {
-                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-                return 0;
-            }
-        }
-    }
-
-    return 1;
-}
-
 CON_FUNC_RETURN tls_construct_end_of_early_data(SSL_CONNECTION *s, WPACKET *pkt)
 {
     if (s->early_data_state != SSL_EARLY_DATA_WRITE_RETRY
diff --git a/deps/openssl/openssl/ssl/statem/statem_dtls.c b/deps/openssl/openssl/ssl/statem/statem_dtls.c
index 96ea03ab73c..a3023b6704f 100644
--- a/deps/openssl/openssl/ssl/statem/statem_dtls.c
+++ b/deps/openssl/openssl/ssl/statem/statem_dtls.c
@@ -55,76 +55,189 @@ static const unsigned char bitmask_end_values[] = {
     0xff, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f
 };

-static void dtls1_fix_message_header(SSL_CONNECTION *s, size_t frag_off,
-    size_t frag_len);
-static unsigned char *dtls1_write_message_header(SSL_CONNECTION *s,
-    unsigned char *p);
-static void dtls1_set_message_header_int(SSL_CONNECTION *s, unsigned char mt,
-    size_t len,
-    unsigned short seq_num,
-    size_t frag_off,
-    size_t frag_len);
 static int dtls_get_reassembled_message(SSL_CONNECTION *s, int *errtype,
     size_t *len);

-static hm_fragment *dtls1_hm_fragment_new(size_t frag_len, int reassembly)
+/*
+ * Check if CCS is expected in current state.
+ *
+ * RFC 6347 Section 4.1 states DTLS must handle message reordering since UDP
+ * does not guarantee in-order delivery. This function determines when a
+ * buffered CCS should be delivered to the state machine.
+ *
+ * Server states where CCS is expected:
+ *   - TLS_ST_SR_KEY_EXCH: After key exchange (anonymous or no_cert_verify)
+ *   - TLS_ST_SR_CERT_VRFY: After certificate verify
+ *   - TLS_ST_SW_FINISHED: Session resumption (abbreviated handshake)
+ *
+ * Client states where CCS is expected:
+ *   - TLS_ST_CR_SRVR_HELLO: Abbreviated handshake without ticket
+ *   - TLS_ST_CW_FINISHED: After sending Finished, before server CCS
+ *   - TLS_ST_CR_SESSION_TICKET: After receiving session ticket
+ */
+static int dtls_ccs_expected(SSL_CONNECTION *s)
 {
-    hm_fragment *frag = NULL;
-    unsigned char *buf = NULL;
-    unsigned char *bitmask = NULL;
+    OSSL_HANDSHAKE_STATE st = s->statem.hand_state;
+
+    if (s->server) {
+        switch (st) {
+        case TLS_ST_SR_KEY_EXCH:
+            /* Anonymous or no client cert: CCS follows KeyExchange */
+            if (s->session->peer == NULL && s->session->peer_rpk == NULL)
+                return 1;
+            /* Client cert but no verify message required */
+            return s->statem.no_cert_verify;
+        case TLS_ST_SR_CERT_VRFY:
+            return 1;
+        case TLS_ST_SW_FINISHED:
+            /* Abbreviated handshake: server sends first, then receives CCS */
+            return s->hit;
+        default:
+            return 0;
+        }
+    } else {
+        switch (st) {
+        case TLS_ST_CR_SRVR_HELLO:
+            /* Abbreviated handshake without session ticket */
+            return (s->hit && !s->ext.ticket_expected);
+        case TLS_ST_CW_FINISHED:
+            /* Full handshake: waiting for server CCS after sending Finished */
+            return !s->ext.ticket_expected;
+        case TLS_ST_CR_SESSION_TICKET:
+            return 1;
+        default:
+            return 0;
+        }
+    }
+}
+
+static dtls_sent_msg *dtls1_sent_msg_new(size_t msg_len, size_t body_len,
+    int track_coverage)
+{
+    const size_t bitmask_len = (track_coverage && body_len > 0 ? RSMBLY_BITMASK_SIZE(body_len) : 0);
+    dtls_sent_msg *msg = OPENSSL_malloc(sizeof(*msg) + msg_len + bitmask_len);

-    if ((frag = OPENSSL_zalloc(sizeof(*frag))) == NULL)
+    if (msg == NULL)
         return NULL;

-    if (frag_len) {
-        if ((buf = OPENSSL_malloc(frag_len)) == NULL) {
-            OPENSSL_free(frag);
-            return NULL;
-        }
+    memset(msg, 0, sizeof(*msg));
+
+    /* zero length msg gets msg->msg_buf == NULL */
+    if (msg_len > 0)
+        msg->msg_buf = (unsigned char *)(msg + 1);
+
+    /*
+     * body_len > 0 implies msg_len > 0 (msg_len == body_len + headerlen, and
+     * headerlen is never 0), so msg->msg_buf is already set here. Coverage
+     * tracking only means anything for DTLS 1.3, the only version that ever
+     * processes an ACK; older versions never read msg->covered, so don't pay
+     * for the allocation on their behalf.
+     */
+    if (track_coverage && body_len > 0) {
+        msg->covered = msg->msg_buf + msg_len;
+        memset(msg->covered, 0, bitmask_len);
     }

+    return msg;
+}
+
+void dtls1_sent_msg_free(dtls_sent_msg *msg)
+{
+    if (msg != NULL)
+        ossl_list_record_number_elem_free(&msg->rec_nums);
+
+    OPENSSL_free(msg);
+}
+
+static hm_fragment *dtls1_hm_fragment_new(size_t frag_len, int reassembly)
+{
+    const size_t bitmask_len = (reassembly ? RSMBLY_BITMASK_SIZE(frag_len) : 0);
+    hm_fragment *frag = OPENSSL_malloc(sizeof(*frag) + frag_len + bitmask_len);
+
+    if (frag == NULL)
+        return NULL;
+
+    memset(frag, 0, sizeof(*frag));
+
     /* zero length fragment gets zero frag->fragment */
-    frag->fragment = buf;
+    if (frag_len > 0)
+        frag->fragment = (unsigned char *)(frag + 1);

     /* Initialize reassembly bitmask if necessary */
-    if (reassembly) {
-        bitmask = OPENSSL_zalloc(RSMBLY_BITMASK_SIZE(frag_len));
-        if (bitmask == NULL) {
-            OPENSSL_free(buf);
-            OPENSSL_free(frag);
-            return NULL;
-        }
-    }
+    if (bitmask_len > 0) {
+        if (frag->fragment == NULL)
+            frag->reassembly = (unsigned char *)(frag + 1);
+        else
+            frag->reassembly = frag->fragment + frag_len;

-    frag->reassembly = bitmask;
+        memset(frag->reassembly, 0, bitmask_len);
+    }

     return frag;
 }

 void dtls1_hm_fragment_free(hm_fragment *frag)
 {
-    if (!frag)
-        return;
-
-    OPENSSL_free(frag->fragment);
-    OPENSSL_free(frag->reassembly);
     OPENSSL_free(frag);
 }

+static int dtls1_write_hm_header(unsigned char *msgheaderstart,
+    unsigned char msg_type, size_t msg_len,
+    unsigned short msg_seq, size_t fragoff,
+    size_t fraglen)
+{
+    WPACKET msgheader;
+    size_t msgheaderlen;
+
+    if (!WPACKET_init_static_len(&msgheader, msgheaderstart,
+            DTLS1_HM_HEADER_LENGTH, 0)
+        || !WPACKET_put_bytes_u8(&msgheader, msg_type)
+        || !WPACKET_put_bytes_u24(&msgheader, msg_len)
+        || !WPACKET_put_bytes_u16(&msgheader, msg_seq)
+        || !WPACKET_put_bytes_u24(&msgheader, fragoff)
+        || !WPACKET_put_bytes_u24(&msgheader, fraglen)
+        || !WPACKET_get_total_written(&msgheader, &msgheaderlen)
+        || msgheaderlen != DTLS1_HM_HEADER_LENGTH
+        || !WPACKET_finish(&msgheader)) {
+        WPACKET_cleanup(&msgheader);
+        return 0;
+    }
+
+    return 1;
+}
+
 /*
- * send s->init_buf in records of type 'type' (SSL3_RT_HANDSHAKE or
- * SSL3_RT_CHANGE_CIPHER_SPEC)
+ * send s->init_buf in records of type 'type' (SSL3_RT_HANDSHAKE,
+ * SSL3_RT_CHANGE_CIPHER_SPEC or SSL3_RT_ACK)
+ *
+ * When sending a fragmented handshake message this function will re-use
+ * s->init_buf->data but overwrite previously sent data to fill out the handshake
+ * message header for the next fragment.
+ *
+ * E.g.
+ * |-------------------------s->init_buf->data------------------------------|
+ * |-- header1 --||-- fragment1 --|
+ *                  |-- header2 --||-- fragment2 --|
+ *                                   |-- header3 --||-- fragment3 --|
+ *                                                                 .........
  */
-int dtls1_do_write(SSL_CONNECTION *s, uint8_t type)
+int dtls1_do_write(SSL_CONNECTION *s, uint8_t recordtype)
 {
     int ret;
     size_t written;
     size_t curr_mtu;
     int retry = 1;
-    size_t len, frag_off, overhead, used_len;
+    size_t len, overhead, used_len;
     SSL *ssl = SSL_CONNECTION_GET_SSL(s);
     SSL *ussl = SSL_CONNECTION_GET_USER_SSL(s);
     uint8_t saved_payload[DTLS1_HM_HEADER_LENGTH];
+    /* msg_len, msg_seq, msg_type are only used for recordtype == SSL3_RT_HANDSHAKE */
+    const size_t msg_len = s->d1->w_msg.msg_body_len;
+    const unsigned short msg_seq = s->d1->w_msg.msg_seq;
+    const unsigned char msg_type = s->d1->w_msg.msg_type;
+    const size_t min_len = recordtype == SSL3_RT_ACK
+        ? DTLS13_ACK_MIN_NONEMPTY_LEN
+        : DTLS1_HM_HEADER_LENGTH + 1;

     if (!dtls1_query_mtu(s))
         return -1;
@@ -133,50 +246,41 @@ int dtls1_do_write(SSL_CONNECTION *s, uint8_t type)
         /* should have something reasonable now */
         return -1;

-    if (s->init_off == 0 && type == SSL3_RT_HANDSHAKE) {
-        if (!ossl_assert(s->init_num == s->d1->w_msg_hdr.msg_len + DTLS1_HM_HEADER_LENGTH))
+    if (s->init_off == 0 && recordtype == SSL3_RT_HANDSHAKE) {
+        if (!ossl_assert(s->init_num == msg_len + DTLS1_HM_HEADER_LENGTH))
             return -1;
     }

     overhead = s->rlayer.wrlmethod->get_max_record_overhead(s->rlayer.wrl);

-    frag_off = 0;
     s->rwstate = SSL_NOTHING;

     /* s->init_num shouldn't ever be < 0...but just in case */
     while (s->init_num > 0) {
-        if (type == SSL3_RT_HANDSHAKE && s->init_off != 0) {
-            /* We must be writing a fragment other than the first one */
-
-            if (frag_off > 0) {
-                /* This is the first attempt at writing out this fragment */
-
-                if (s->init_off <= DTLS1_HM_HEADER_LENGTH) {
-                    /*
-                     * Each fragment that was already sent must at least have
-                     * contained the message header plus one other byte.
-                     * Therefore |init_off| must have progressed by at least
-                     * |DTLS1_HM_HEADER_LENGTH + 1| bytes. If not something went
-                     * wrong.
-                     */
-                    return -1;
-                }
+        unsigned char *msgstart;

+        if (recordtype == SSL3_RT_HANDSHAKE && s->init_off > 0) {
+            /*
+             * We must be writing a fragment other than the first one
+             * and this is the first attempt at writing out this fragment
+             */
+            if (s->init_off <= DTLS1_HM_HEADER_LENGTH) {
                 /*
-                 * Adjust |init_off| and |init_num| to allow room for a new
-                 * message header for this fragment.
-                 */
-                s->init_off -= DTLS1_HM_HEADER_LENGTH;
-                s->init_num += DTLS1_HM_HEADER_LENGTH;
-            } else {
-                /*
-                 * We must have been called again after a retry so use the
-                 * fragment offset from our last attempt. We do not need
-                 * to adjust |init_off| and |init_num| as above, because
-                 * that should already have been done before the retry.
+                 * Each fragment that was already sent must at least have
+                 * contained the message header plus one other byte.
+                 * Therefore |init_off| must have progressed by at least
+                 * |DTLS1_HM_HEADER_LENGTH + 1| bytes. If not something went
+                 * wrong.
                  */
-                frag_off = s->d1->w_msg_hdr.frag_off;
+                return -1;
             }
+
+            /*
+             * Adjust |init_off| and |init_num| to allow room for a new
+             * message header for this fragment.
+             */
+            s->init_off -= DTLS1_HM_HEADER_LENGTH;
+            s->init_num += DTLS1_HM_HEADER_LENGTH;
         }

         used_len = BIO_wpending(s->wbio) + overhead;
@@ -185,7 +289,7 @@ int dtls1_do_write(SSL_CONNECTION *s, uint8_t type)
         else
             curr_mtu = 0;

-        if (curr_mtu <= DTLS1_HM_HEADER_LENGTH) {
+        if (curr_mtu < min_len) {
             /*
              * grr.. we could get an error if MTU picked was wrong
              */
@@ -194,7 +298,7 @@ int dtls1_do_write(SSL_CONNECTION *s, uint8_t type)
                 s->rwstate = SSL_WRITING;
                 return ret;
             }
-            if (s->d1->mtu > overhead + DTLS1_HM_HEADER_LENGTH) {
+            if (s->d1->mtu >= overhead + min_len) {
                 curr_mtu = s->d1->mtu - overhead;
             } else {
                 /* Shouldn't happen */
@@ -202,10 +306,7 @@ int dtls1_do_write(SSL_CONNECTION *s, uint8_t type)
             }
         }

-        /*
-         * We just checked that s->init_num > 0 so this cast should be safe
-         */
-        if (((unsigned int)s->init_num) > curr_mtu)
+        if (s->init_num > curr_mtu)
             len = curr_mtu;
         else
             len = s->init_num;
@@ -214,37 +315,59 @@ int dtls1_do_write(SSL_CONNECTION *s, uint8_t type)
             len = ssl_get_max_send_fragment(s);

         /*
-         * XDTLS: this function is too long.  split out the CCS part
+         * For DTLS1.3 and padding lets update the max fragment size
+         * accordingly
          */
-        if (type == SSL3_RT_HANDSHAKE) {
-            if (len < DTLS1_HM_HEADER_LENGTH) {
-                /*
-                 * len is so small that we really can't do anything sensible
-                 * so fail
-                 */
+        if (SSL_CONNECTION_IS_DTLS13(s))
+            s->rlayer.wrlmethod->set_curr_mtu(s->rlayer.wrl, curr_mtu);
+
+        msgstart = (unsigned char *)&s->init_buf->data[s->init_off];
+
+        if (recordtype == SSL3_RT_ACK) {
+            /* Each record needs a complete vector of record numbers. */
+            if (!ossl_assert(len >= DTLS13_ACK_HEADER_LEN))
                 return -1;
-            }
-            dtls1_fix_message_header(s, frag_off, len - DTLS1_HM_HEADER_LENGTH);
+            len = DTLS13_ACK_HEADER_LEN
+                + ((len - DTLS13_ACK_HEADER_LEN) / DTLS13_RECORD_NUMBER_LEN)
+                    * DTLS13_RECORD_NUMBER_LEN;
+            msgstart[0] = (unsigned char)((len - DTLS13_ACK_HEADER_LEN) >> 8);
+            msgstart[1] = (unsigned char)(len - DTLS13_ACK_HEADER_LEN);
+        }
+
+        if (recordtype == SSL3_RT_HANDSHAKE) {
+            const size_t fragoff = s->init_off;
+            const size_t fraglen = len - DTLS1_HM_HEADER_LENGTH;

             /*
              * Save the data that will be overwritten by
-             * dtls1_write_messsage_header so no corruption occurs when using
+             * the following code so no corruption occurs when using
              * a msg callback.
              */
             if (s->msg_callback && s->init_off != 0)
-                memcpy(saved_payload, &s->init_buf->data[s->init_off],
-                    sizeof(saved_payload));
+                memcpy(saved_payload, msgstart, sizeof(saved_payload));
+
+            if (len < DTLS1_HM_HEADER_LENGTH
+                || !dtls1_write_hm_header(msgstart, msg_type, msg_len,
+                    msg_seq, fragoff, fraglen))
+                /*
+                 * len is so small that we really can't do anything sensible
+                 * so fail
+                 */
+                return -1;

-            dtls1_write_message_header(s,
-                (unsigned char *)&s->init_buf->data[s->init_off]);
+            /*
+             * Recorded so do_dtls1_write() (rec_layer_d1.c) can tag this
+             * fragment's record number with the byte range it covers.
+             */
+            s->d1->w_frag_off = fragoff;
+            s->d1->w_frag_len = fraglen;
         }

-        ret = dtls1_write_bytes(s, type, &s->init_buf->data[s->init_off], len,
+        ret = dtls1_write_bytes(s, recordtype, msgstart, len,
             &written);

-        if (type == SSL3_RT_HANDSHAKE && s->msg_callback && s->init_off != 0)
-            memcpy(&s->init_buf->data[s->init_off], saved_payload,
-                sizeof(saved_payload));
+        if (recordtype == SSL3_RT_HANDSHAKE && s->msg_callback && s->init_off != 0)
+            memcpy(msgstart, saved_payload, sizeof(saved_payload));

         if (ret <= 0) {
             /*
@@ -253,17 +376,13 @@ int dtls1_do_write(SSL_CONNECTION *s, uint8_t type)
              * retransmit anything.  continue as if everything is fine and
              * wait for an alert to handle the retransmit
              */
-            if (retry && BIO_ctrl(SSL_get_wbio(ssl), BIO_CTRL_DGRAM_MTU_EXCEEDED, 0, NULL) > 0) {
-                if (!(SSL_get_options(ssl) & SSL_OP_NO_QUERY_MTU)) {
-                    if (!dtls1_query_mtu(s))
-                        return -1;
-                    /* Have one more go */
-                    retry = 0;
-                } else
-                    return -1;
-            } else {
+            if (retry && BIO_ctrl(SSL_get_wbio(ssl), BIO_CTRL_DGRAM_MTU_EXCEEDED, 0, NULL) > 0
+                && !(SSL_get_options(ssl) & SSL_OP_NO_QUERY_MTU)
+                && dtls1_query_mtu(s))
+                /* Have one more go */
+                retry = 0;
+            else
                 return -1;
-            }
         } else {

             /*
@@ -283,39 +402,53 @@ int dtls1_do_write(SSL_CONNECTION *s, uint8_t type)
             assert(s->s3.tmp.new_compression != NULL
                 || BIO_wpending(s->wbio) <= (int)s->d1->mtu);

-            if (type == SSL3_RT_HANDSHAKE && !s->d1->retransmitting) {
-                /*
-                 * should not be done for 'Hello Request's, but in that case
-                 * we'll ignore the result anyway
-                 */
-                unsigned char *p = (unsigned char *)&s->init_buf->data[s->init_off];
-                const struct hm_header_st *msg_hdr = &s->d1->w_msg_hdr;
-                size_t xlen;
+            if (recordtype == SSL3_RT_HANDSHAKE && !s->d1->retransmitting
+                && s->init_off == 0) {
+                size_t xlen = s->init_num;

-                if (frag_off == 0 && s->version != DTLS1_BAD_VER) {
+                if (s->version == DTLS1_BAD_VER) {
+                    msgstart += DTLS1_HM_HEADER_LENGTH;
+                    xlen -= DTLS1_HM_HEADER_LENGTH;
+                } else {
                     /*
-                     * reconstruct message header is if it is being sent in
-                     * single fragment
+                     * Now prepare to calculate the transcript hash. For
+                     * versions prior to DTLSv1.3 this means:
+                     *
+                     * rfc6347: Hash calculations include entire handshake
+                     *   messages, including DTLS-specific fields: message_seq,
+                     *   fragment_offset, and fragment_length. However, the
+                     *   Finished MAC MUST be computed as if each handshake
+                     *   message had been sent as a single fragment.
+                     *
+                     * For DTLSv1.3 DTLS-specific fields: message_seq,
+                     * fragment_offset, and fragment_length are not used in the
+                     * calculation i.e. the MAC-calculation is the same as TLS
+                     * even though DTLS handshake messages may be fragmented.
                      */
-                    *p++ = msg_hdr->type;
-                    l2n3(msg_hdr->msg_len, p);
-                    s2n(msg_hdr->seq, p);
-                    l2n3(0, p);
-                    l2n3(msg_hdr->msg_len, p);
-                    p -= DTLS1_HM_HEADER_LENGTH;
-                    xlen = written;
-                } else {
-                    p += DTLS1_HM_HEADER_LENGTH;
-                    xlen = written - DTLS1_HM_HEADER_LENGTH;
+                    if (!dtls1_write_hm_header(msgstart, msg_type, msg_len,
+                            msg_seq, 0, msg_len))
+                        return -1;
                 }

-                if (!ssl3_finish_mac(s, p, xlen))
-                    return -1;
+                /*
+                 * should not be done for 'Hello Request's, but in that case we'll
+                 * ignore the result anyway
+                 * DTLS1.3 KeyUpdate and NewSessionTicket do not need to be added
+                 */
+                if (!SSL_CONNECTION_IS_DTLS13(s)
+                    || (s->statem.hand_state != TLS_ST_SW_SESSION_TICKET
+                        && s->statem.hand_state != TLS_ST_CW_KEY_UPDATE
+                        && s->statem.hand_state != TLS_ST_SW_KEY_UPDATE))
+                    if (!ssl3_finish_mac(s, msgstart, xlen))
+                        return -1;
             }
+            if (recordtype == SSL3_RT_ACK && s->msg_callback != NULL)
+                s->msg_callback(1, s->version, recordtype, msgstart, written,
+                    ussl, s->msg_callback_arg);

             if (written == s->init_num) {
-                if (s->msg_callback)
-                    s->msg_callback(1, s->version, type, s->init_buf->data,
+                if (s->msg_callback && recordtype != SSL3_RT_ACK)
+                    s->msg_callback(1, s->version, recordtype, s->init_buf->data,
                         s->init_off + s->init_num, ussl,
                         s->msg_callback_arg);

@@ -324,18 +457,11 @@ int dtls1_do_write(SSL_CONNECTION *s, uint8_t type)

                 return 1;
             }
+            /* Reuse the last two sent bytes for the next ACK vector length. */
+            if (recordtype == SSL3_RT_ACK)
+                written -= DTLS13_ACK_HEADER_LEN;
             s->init_off += written;
             s->init_num -= written;
-            written -= DTLS1_HM_HEADER_LENGTH;
-            frag_off += written;
-
-            /*
-             * We save the fragment offset for the next fragment so we have it
-             * available in case of an IO retry. We don't know the length of the
-             * next fragment yet so just set that to 0 for now. It will be
-             * updated again later.
-             */
-            dtls1_fix_message_header(s, frag_off, 0);
         }
     }
     return 0;
@@ -343,17 +469,16 @@ int dtls1_do_write(SSL_CONNECTION *s, uint8_t type)

 int dtls_get_message(SSL_CONNECTION *s, int *mt)
 {
-    struct hm_header_st *msg_hdr;
-    unsigned char *p;
-    size_t msg_len;
+    unsigned char *rec_data;
     size_t tmplen;
     int errtype;

-    msg_hdr = &s->d1->r_msg_hdr;
-    memset(msg_hdr, 0, sizeof(*msg_hdr));
+    s->d1->r_msg_seq = 0;

 again:
     if (!dtls_get_reassembled_message(s, &errtype, &tmplen)) {
+        if (s->statem.ack_for_retransmit)
+            return 0;
         if (errtype == DTLS1_HM_BAD_FRAGMENT
             || errtype == DTLS1_HM_FRAGMENT_RETRY) {
             /* bad fragment received */
@@ -364,30 +489,19 @@ again:

     *mt = s->s3.tmp.message_type;

-    p = (unsigned char *)s->init_buf->data;
+    rec_data = (unsigned char *)s->init_buf->data;

-    if (*mt == SSL3_MT_CHANGE_CIPHER_SPEC) {
-        if (s->msg_callback) {
-            s->msg_callback(0, s->version, SSL3_RT_CHANGE_CIPHER_SPEC,
-                p, 1, SSL_CONNECTION_GET_USER_SSL(s),
-                s->msg_callback_arg);
-        }
-        /*
-         * This isn't a real handshake message so skip the processing below.
-         */
+    /*
+     * If this isn't a real handshake message skip the processing below.
+     */
+    if (*mt == SSL3_MT_CHANGE_CIPHER_SPEC || *mt == DTLS13_MT_ACK)
         return 1;
-    }
-
-    msg_len = msg_hdr->msg_len;

     /* reconstruct message header */
-    *(p++) = msg_hdr->type;
-    l2n3(msg_len, p);
-    s2n(msg_hdr->seq, p);
-    l2n3(0, p);
-    l2n3(msg_len, p);
+    dtls1_write_hm_header(rec_data, s->s3.tmp.message_type, s->s3.tmp.message_size,
+        s->d1->r_msg_seq, 0, s->s3.tmp.message_size);

-    memset(msg_hdr, 0, sizeof(*msg_hdr));
+    s->d1->r_msg_seq = 0;

     s->d1->handshake_read_seq++;

@@ -404,12 +518,27 @@ again:
 int dtls_get_message_body(SSL_CONNECTION *s, size_t *len)
 {
     unsigned char *msg = (unsigned char *)s->init_buf->data;
-    size_t msg_len = s->init_num + DTLS1_HM_HEADER_LENGTH;
+    size_t msg_len;
+    int recordtype;
+
+    switch (s->s3.tmp.message_type) {
+    default:
+        recordtype = SSL3_RT_HANDSHAKE;
+        msg_len = s->init_num + DTLS1_HM_HEADER_LENGTH;
+
+        break;
+    case DTLS13_MT_ACK:
+        recordtype = SSL3_RT_ACK;
+        msg_len = s->init_num;
+
+        goto end;
+    case SSL3_MT_CHANGE_CIPHER_SPEC:
+        recordtype = SSL3_RT_CHANGE_CIPHER_SPEC;
+        msg_len = 1;

-    if (s->s3.tmp.message_type == SSL3_MT_CHANGE_CIPHER_SPEC) {
-        /* Nothing to be done */
         goto end;
     }
+
     /*
      * If receiving Finished, record MAC of prior handshake messages for
      * Finished verification.
@@ -419,20 +548,14 @@ int dtls_get_message_body(SSL_CONNECTION *s, size_t *len)
         return 0;
     }

-    if (s->version == DTLS1_BAD_VER) {
-        msg += DTLS1_HM_HEADER_LENGTH;
-        msg_len -= DTLS1_HM_HEADER_LENGTH;
-    }
-
-    if (!ssl3_finish_mac(s, msg, msg_len))
+    if (!tls_common_finish_mac(s))
         return 0;

+end:
     if (s->msg_callback)
-        s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE,
-            s->init_buf->data, s->init_num + DTLS1_HM_HEADER_LENGTH,
+        s->msg_callback(0, s->version, recordtype, msg, msg_len,
             SSL_CONNECTION_GET_USER_SSL(s), s->msg_callback_arg);

-end:
     *len = s->init_num;
     return 1;
 }
@@ -451,7 +574,7 @@ static size_t dtls1_max_handshake_message_len(const SSL_CONNECTION *s)
 }

 static int dtls1_preprocess_fragment(SSL_CONNECTION *s,
-    struct hm_header_st *msg_hdr)
+    const struct hm_header_st *const msg_hdr)
 {
     size_t frag_off, frag_len, msg_len;

@@ -466,30 +589,52 @@ static int dtls1_preprocess_fragment(SSL_CONNECTION *s,
         return 0;
     }

-    if (s->d1->r_msg_hdr.frag_off == 0) { /* first fragment */
-        /*
-         * msg_len is limited to 2^24, but is effectively checked against
-         * dtls_max_handshake_message_len(s) above
-         */
-        if (!BUF_MEM_grow_clean(s->init_buf, msg_len + DTLS1_HM_HEADER_LENGTH)) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_BUF_LIB);
-            return 0;
-        }
-
-        s->s3.tmp.message_size = msg_len;
-        s->d1->r_msg_hdr.msg_len = msg_len;
-        s->s3.tmp.message_type = msg_hdr->type;
-        s->d1->r_msg_hdr.type = msg_hdr->type;
-        s->d1->r_msg_hdr.seq = msg_hdr->seq;
-    } else if (msg_len != s->d1->r_msg_hdr.msg_len) {
-        /*
-         * They must be playing with us! BTW, failure to enforce upper limit
-         * would open possibility for buffer overrun.
-         */
-        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_EXCESSIVE_MESSAGE_SIZE);
+    /*
+     * msg_len is limited to 2^24, but is effectively checked against
+     * dtls_max_handshake_message_len(s) above
+     */
+    if (!BUF_MEM_grow_clean(s->init_buf, msg_len + DTLS1_HM_HEADER_LENGTH)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_BUF_LIB);
         return 0;
     }

+    s->s3.tmp.message_size = msg_len;
+    s->s3.tmp.message_type = msg_hdr->type;
+    s->d1->r_msg_seq = msg_hdr->seq;
+
+    return 1;
+}
+
+static int add_record_to_ack_list(SSL_CONNECTION *sc)
+{
+    DTLS1_RECORD_NUMBER *recnum;
+    uint64_t epoch = sc->s3.tmp.record_epoch;
+    uint64_t sequence = sc->s3.tmp.record_seq_num;
+
+    /*
+     * Retain at most one maximum-sized ACK record's worth of record numbers.
+     * Check before the duplicate scan to bound the work once the list is full.
+     * Excess records may be omitted from ACKs (RFC 9147, section 7.1).
+     */
+    if (ossl_list_record_number_num(&sc->d1->ack_rec_num)
+        >= (SSL3_RT_MAX_PLAIN_LENGTH - DTLS13_ACK_HEADER_LEN) / DTLS13_RECORD_NUMBER_LEN)
+        return 1;
+
+    for (recnum = ossl_list_record_number_head(&sc->d1->ack_rec_num);
+        recnum != NULL;
+        recnum = ossl_list_record_number_next(recnum)) {
+        /* Is the record number already in the list? */
+        if (recnum->epoch == epoch && recnum->seqnum == sequence)
+            return 1;
+    }
+
+    recnum = dtls1_record_number_new(epoch, sequence, 0, 0);
+
+    if (recnum == NULL)
+        return 0;
+
+    ossl_list_record_number_insert_tail(&sc->d1->ack_rec_num, recnum);
+
     return 1;
 }

@@ -510,8 +655,9 @@ static int dtls1_retrieve_buffered_fragment(SSL_CONNECTION *s, size_t *len)
     hm_fragment *frag;
     int ret;
     int chretran = 0;
+    pqueue *rcvd_messages = &s->d1->rcvd_messages;

-    iter = pqueue_iterator(s->d1->buffered_messages);
+    iter = pqueue_iterator(rcvd_messages);
     do {
         item = pqueue_next(&iter);
         if (item == NULL)
@@ -532,7 +678,7 @@ static int dtls1_retrieve_buffered_fragment(SSL_CONNECTION *s, size_t *len)
                  * It is safe to pop this message from the queue even though
                  * we have an active iterator
                  */
-                pqueue_pop(s->d1->buffered_messages);
+                pqueue_pop(rcvd_messages);
                 dtls1_hm_fragment_free(frag);
                 pitem_free(item);
                 item = NULL;
@@ -552,7 +698,7 @@ static int dtls1_retrieve_buffered_fragment(SSL_CONNECTION *s, size_t *len)
                          * We have fragments for both a ClientHello without
                          * cookie and one with. Ditch the one without.
                          */
-                        pqueue_pop(s->d1->buffered_messages);
+                        pqueue_pop(rcvd_messages);
                         dtls1_hm_fragment_free(frag);
                         pitem_free(item);
                         item = next;
@@ -573,7 +719,8 @@ static int dtls1_retrieve_buffered_fragment(SSL_CONNECTION *s, size_t *len)

     if (s->d1->handshake_read_seq == frag->msg_header.seq || chretran) {
         size_t frag_len = frag->msg_header.frag_len;
-        pqueue_pop(s->d1->buffered_messages);
+
+        pqueue_pop(rcvd_messages);

         /* Calls SSLfatal() as required */
         ret = dtls1_preprocess_fragment(s, &frag->msg_header);
@@ -616,12 +763,12 @@ static int dtls1_reassemble_fragment(SSL_CONNECTION *s,
     hm_fragment *frag = NULL;
     pitem *item = NULL;
     int i = -1, is_complete;
-    unsigned char seq64be[8];
     size_t frag_len = msg_hdr->frag_len;
     size_t readbytes;
     SSL *ssl = SSL_CONNECTION_GET_SSL(s);

-    if ((msg_hdr->frag_off + frag_len) > msg_hdr->msg_len || msg_hdr->msg_len > dtls1_max_handshake_message_len(s))
+    if ((msg_hdr->frag_off + frag_len) > msg_hdr->msg_len
+        || msg_hdr->msg_len > dtls1_max_handshake_message_len(s))
         goto err;

     if (frag_len == 0) {
@@ -629,10 +776,7 @@ static int dtls1_reassemble_fragment(SSL_CONNECTION *s,
     }

     /* Try to find item in queue */
-    memset(seq64be, 0, sizeof(seq64be));
-    seq64be[6] = (unsigned char)(msg_hdr->seq >> 8);
-    seq64be[7] = (unsigned char)msg_hdr->seq;
-    item = pqueue_find(s->d1->buffered_messages, seq64be);
+    item = pqueue_find_u64(&s->d1->rcvd_messages, msg_hdr->seq);

     if (item == NULL) {
         frag = dtls1_hm_fragment_new(msg_hdr->msg_len, 1);
@@ -674,8 +818,6 @@ static int dtls1_reassemble_fragment(SSL_CONNECTION *s,
         frag->fragment + msg_hdr->frag_off,
         frag_len, 0, &readbytes);
     if (i <= 0 || readbytes != frag_len)
-        i = -1;
-    if (i <= 0)
         goto err;

     RSMBLY_BITMASK_MARK(frag->reassembly, (long)msg_hdr->frag_off,
@@ -686,22 +828,18 @@ static int dtls1_reassemble_fragment(SSL_CONNECTION *s,
     RSMBLY_BITMASK_IS_COMPLETE(frag->reassembly, (long)msg_hdr->msg_len,
         is_complete);

-    if (is_complete) {
-        OPENSSL_free(frag->reassembly);
+    if (is_complete)
         frag->reassembly = NULL;
-    }

     if (item == NULL) {
-        item = pitem_new(seq64be, frag);
-        if (item == NULL) {
-            i = -1;
+        item = pitem_new_u64(msg_hdr->seq, frag);
+        if (item == NULL)
             goto err;
-        }

-        item = pqueue_insert(s->d1->buffered_messages, item);
+        item = pqueue_insert(&s->d1->rcvd_messages, item);
         /*
          * pqueue_insert fails iff a duplicate item is inserted. However,
-         * |item| cannot be a duplicate. If it were, |pqueue_find|, above,
+         * |item| cannot be a duplicate. If it were, |pqueue_find_u64|, above,
          * would have returned it and control would never have reached this
          * branch.
          */
@@ -709,6 +847,10 @@ static int dtls1_reassemble_fragment(SSL_CONNECTION *s,
             goto err;
     }

+    if (dtls_msg_needs_ack(!s->server, msg_hdr->type)
+        && !add_record_to_ack_list(s))
+        goto err;
+
     return DTLS1_HM_FRAGMENT_RETRY;

 err:
@@ -717,13 +859,26 @@ err:
     return -1;
 }

-static int dtls1_process_out_of_seq_message(SSL_CONNECTION *s,
+/*
+ * True if the message currently being processed only authenticated because
+ * the read record layer retained a previous epoch's keys for retransmission
+ * recovery -- i.e. it did not actually arrive at the currently active
+ * read epoch. Such a message must never be treated as new content: it may
+ * only, at most, trigger a replacement ACK for something already fully
+ * processed.
+ */
+int dtls_record_from_retained_epoch(SSL_CONNECTION *s)
+{
+    return SSL_CONNECTION_IS_DTLS13(s)
+        && s->s3.tmp.record_epoch != dtls1_get_epoch(s, SSL3_CC_READ);
+}
+
+int dtls1_process_out_of_seq_message(SSL_CONNECTION *s,
     const struct hm_header_st *msg_hdr)
 {
     int i = -1;
     hm_fragment *frag = NULL;
     pitem *item = NULL;
-    unsigned char seq64be[8];
     size_t frag_len = msg_hdr->frag_len;
     size_t readbytes;
     SSL *ssl = SSL_CONNECTION_GET_SSL(s);
@@ -732,10 +887,7 @@ static int dtls1_process_out_of_seq_message(SSL_CONNECTION *s,
         goto err;

     /* Try to find item in queue, to prevent duplicate entries */
-    memset(seq64be, 0, sizeof(seq64be));
-    seq64be[6] = (unsigned char)(msg_hdr->seq >> 8);
-    seq64be[7] = (unsigned char)msg_hdr->seq;
-    item = pqueue_find(s->d1->buffered_messages, seq64be);
+    item = pqueue_find_u64(&s->d1->rcvd_messages, msg_hdr->seq);

     /*
      * If we already have an entry and this one is a fragment, don't discard
@@ -746,10 +898,17 @@ static int dtls1_process_out_of_seq_message(SSL_CONNECTION *s,

     /*
      * Discard the message if sequence number was already there, is too far
-     * in the future, already in the queue or if we received a FINISHED
-     * before the SERVER_HELLO, which then must be a stale retransmit.
+     * in the future, already in the queue, if we received a FINISHED
+     * before the SERVER_HELLO (which then must be a stale retransmit), or
+     * if it only authenticated via a retained previous epoch: such a
+     * message must never be buffered for future reassembly and eventually
+     * processed as new content, no matter what sequence number it claims.
      */
-    if (msg_hdr->seq <= s->d1->handshake_read_seq || msg_hdr->seq > s->d1->handshake_read_seq + 10 || item != NULL || (s->d1->handshake_read_seq == 0 && msg_hdr->type == SSL3_MT_FINISHED)) {
+    if (msg_hdr->seq <= s->d1->handshake_read_seq
+        || msg_hdr->seq > s->d1->handshake_read_seq + 10
+        || item != NULL
+        || (s->d1->handshake_read_seq == 0 && msg_hdr->type == SSL3_MT_FINISHED)
+        || dtls_record_from_retained_epoch(s)) {
         unsigned char devnull[256];

         while (frag_len) {
@@ -760,6 +919,24 @@ static int dtls1_process_out_of_seq_message(SSL_CONNECTION *s,
                 goto err;
             frag_len -= readbytes;
         }
+        /*
+         * A lost ACK can cause an already processed message to be
+         * retransmitted in a new record. ACK it without processing it
+         * again. Epoch 2 is included alongside the post-handshake epochs
+         * (3+) so that a client's Finished, retransmitted after the server
+         * has already moved on to epoch 3, still gets ACKed instead of
+         * silently dropped (see dtls_get_more_records()'s retained
+         * prev_epoch_rl handling, which is what let this record
+         * authenticate at all).
+         */
+        if (SSL_CONNECTION_IS_DTLS13(s)
+            && s->s3.tmp.record_epoch >= 2
+            && msg_hdr->seq < s->d1->handshake_read_seq
+            && dtls_msg_needs_ack(!s->server, msg_hdr->type)) {
+            if (!add_record_to_ack_list(s))
+                goto err;
+            s->statem.ack_for_retransmit = 1;
+        }
     } else {
         if (frag_len != msg_hdr->msg_len) {
             return dtls1_reassemble_fragment(s, msg_hdr);
@@ -782,16 +959,21 @@ static int dtls1_process_out_of_seq_message(SSL_CONNECTION *s,
                 frag->fragment, frag_len, 0,
                 &readbytes);
             if (i <= 0 || readbytes != frag_len)
-                i = -1;
-            if (i <= 0)
                 goto err;
         }

-        item = pitem_new(seq64be, frag);
+        item = pitem_new_u64(msg_hdr->seq, frag);
         if (item == NULL)
             goto err;

-        item = pqueue_insert(s->d1->buffered_messages, item);
+        if (dtls_msg_needs_ack(!s->server, msg_hdr->type)
+            && !add_record_to_ack_list(s)) {
+            pitem_free(item);
+            item = NULL;
+            goto err;
+        }
+
+        item = pqueue_insert(&s->d1->rcvd_messages, item);
         /*
          * pqueue_insert fails iff a duplicate item is inserted. However,
          * |item| cannot be a duplicate. If it were, |pqueue_find|, above,
@@ -812,10 +994,53 @@ err:
     return 0;
 }

+static int dtls1_read_hm_header(unsigned char *msgheaderstart,
+    struct hm_header_st *msg_hdr)
+{
+    unsigned long msg_len, frag_off, frag_len;
+    unsigned int msg_seq, msg_type;
+    PACKET msgheader;
+
+    if (!PACKET_buf_init(&msgheader, msgheaderstart, DTLS1_HM_HEADER_LENGTH)
+        || !PACKET_get_1(&msgheader, &msg_type)
+        || !PACKET_get_net_3(&msgheader, &msg_len)
+        || !PACKET_get_net_2(&msgheader, &msg_seq)
+        || !PACKET_get_net_3(&msgheader, &frag_off)
+        || !PACKET_get_net_3(&msgheader, &frag_len)
+        || PACKET_remaining(&msgheader) != 0) {
+        return 0;
+    }
+
+    /* We just checked that values did not exceed max size so cast must be alright */
+    msg_hdr->type = (unsigned char)msg_type;
+    msg_hdr->msg_len = (size_t)msg_len;
+    msg_hdr->seq = (unsigned short)msg_seq;
+    msg_hdr->frag_off = (size_t)frag_off;
+    msg_hdr->frag_len = (size_t)frag_len;
+
+    return 1;
+}
+
+/*
+ * DTLS 1.3 reserves handshake message type 0, so a HelloRequest must reach the
+ * state machine and be rejected there whenever DTLS 1.3 is still possible.
+ *
+ * s->version is the negotiated, or maximum version: before ServerHello this is
+ * the effective maximum, and after ServerHello or during renegotiation it is the
+ * selected version.
+ */
+static int dtls_should_skip_hello_request(const SSL_CONNECTION *s)
+{
+    if (SSL_CONNECTION_IS_DTLS13(s))
+        return 0;
+
+    return s->version > 0
+        && ssl_version_cmp(s, s->version, DTLS1_3_VERSION) < 0;
+}
+
 static int dtls_get_reassembled_message(SSL_CONNECTION *s, int *errtype,
     size_t *len)
 {
-    size_t mlen, frag_off, frag_len;
     int i, ret;
     uint8_t recvd_type;
     struct hm_header_st msg_hdr;
@@ -830,15 +1055,37 @@ static int dtls_get_reassembled_message(SSL_CONNECTION *s, int *errtype,
     p = (unsigned char *)s->init_buf->data;

 redo:
+    /* Check for buffered CCS */
+    if ((s->version == DTLS1_VERSION || s->version == DTLS1_2_VERSION
+            || s->version == DTLS1_BAD_VER)
+        && s->d1->has_change_cipher_spec && dtls_ccs_expected(s)) {
+        size_t extra = (s->version == DTLS1_BAD_VER) ? 2 : 0;
+
+        s->d1->has_change_cipher_spec = 0;
+        p[0] = SSL3_MT_CCS;
+        /*
+         * The extra 2 bytes are never consumed, only checked for
+         * length -- zero-fill to avoid old init_buf content.
+         */
+        if (extra > 0)
+            memset(p + 1, 0, extra);
+        s->init_num = extra;
+        s->init_msg = p + 1;
+        s->s3.tmp.message_type = SSL3_MT_CHANGE_CIPHER_SPEC;
+        s->s3.tmp.message_size = extra;
+        *len = extra;
+        return 1;
+    }
+
     /* see if we have the required fragment already */
-    ret = dtls1_retrieve_buffered_fragment(s, &frag_len);
+    ret = dtls1_retrieve_buffered_fragment(s, &msg_hdr.frag_len);
     if (ret < 0) {
         /* SSLfatal() already called */
         return 0;
     }
     if (ret > 0) {
-        s->init_num = frag_len;
-        *len = frag_len;
+        s->init_num = msg_hdr.frag_len;
+        *len = msg_hdr.frag_len;
         return 1;
     }

@@ -857,11 +1104,59 @@ redo:
             goto f_err;
         }

-        s->init_num = readbytes - 1;
-        s->init_msg = s->init_buf->data + 1;
-        s->s3.tmp.message_type = SSL3_MT_CHANGE_CIPHER_SPEC;
-        s->s3.tmp.message_size = readbytes - 1;
-        *len = readbytes - 1;
+        /* Buffer CCS for reorder tolerance */
+        if (s->version == DTLS1_VERSION || s->version == DTLS1_2_VERSION
+            || s->version == DTLS1_BAD_VER) {
+            size_t expected = (s->version == DTLS1_BAD_VER) ? 3 : 1;
+
+            if (readbytes != expected) {
+                SSLfatal(s, SSL_AD_DECODE_ERROR,
+                    SSL_R_BAD_CHANGE_CIPHER_SPEC);
+                goto f_err;
+            }
+            s->d1->has_change_cipher_spec = 1;
+            goto redo;
+        }
+        SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE,
+            SSL_R_BAD_CHANGE_CIPHER_SPEC);
+        goto f_err;
+    }
+    if (recvd_type == SSL3_RT_ACK) {
+        /*
+         * An ACK has no handshake message header: the bytes already read
+         * are body, and an ACK never spans records (RFC 9147 section 4),
+         * so the rest of the body - if any - is whatever is left in the
+         * current record. Take it directly to avoid re-entering the
+         * timeout path while assembling the ACK.
+         */
+        if (readbytes == DTLS1_HM_HEADER_LENGTH
+            && s->rlayer.curr_rec < s->rlayer.num_recs) {
+            TLS_RECORD *rr = &s->rlayer.tlsrecs[s->rlayer.curr_rec];
+
+            /*
+             * DTLS currently processes one record at a time, so an exhausted
+             * record is excluded above. Keep these checks to avoid consuming
+             * a following record if pipelining is added.
+             */
+            if (rr->off > 0 && rr->length > 0) {
+                /*
+                 * init_buf has capacity for a full plaintext record, whose size
+                 * has already been checked by the record layer.
+                 */
+                memcpy(p + DTLS1_HM_HEADER_LENGTH, rr->data + rr->off,
+                    rr->length);
+                readbytes += rr->length;
+                if (!ssl_release_record(s, rr, rr->length)) {
+                    /* SSLfatal() already called */
+                    goto f_err;
+                }
+            }
+        }
+        s->init_num = readbytes;
+        s->init_msg = s->init_buf->data;
+        s->s3.tmp.message_type = DTLS13_MT_ACK;
+        s->s3.tmp.message_size = readbytes;
+        *len = readbytes;
         return 1;
     }

@@ -872,17 +1167,16 @@ redo:
     }

     /* parse the message fragment header */
-    dtls1_get_message_header(p, &msg_hdr);
-
-    mlen = msg_hdr.msg_len;
-    frag_off = msg_hdr.frag_off;
-    frag_len = msg_hdr.frag_len;
+    if (!dtls1_read_hm_header(p, &msg_hdr)) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_LENGTH);
+        goto f_err;
+    }

     /*
      * We must have at least frag_len bytes left in the record to be read.
      * Fragments must not span records.
      */
-    if (frag_len > s->rlayer.tlsrecs[s->rlayer.curr_rec].length) {
+    if (msg_hdr.frag_len > s->rlayer.tlsrecs[s->rlayer.curr_rec].length) {
         SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_LENGTH);
         goto f_err;
     }
@@ -892,12 +1186,18 @@ redo:
      * (or dropped)--no further processing at this time
      * While listening, we accept seq 1 (ClientHello with cookie)
      * although we're still expecting seq 0 (ClientHello)
+     *
+     * A message that only authenticated via a retained previous epoch must
+     * always be routed to dtls1_process_out_of_seq_message(), even when its
+     * claimed sequence number happens to match the next expected one: that
+     * match does not mean this content is actually new.
      */
-    if (msg_hdr.seq != s->d1->handshake_read_seq) {
+    if (msg_hdr.seq != s->d1->handshake_read_seq
+        || dtls_record_from_retained_epoch(s)) {
         if (!s->server
             || msg_hdr.seq != 0
             || s->d1->handshake_read_seq != 1
-            || p[0] != SSL3_MT_CLIENT_HELLO
+            || msg_hdr.type != SSL3_MT_CLIENT_HELLO
             || s->statem.hand_state != DTLS_ST_SW_HELLO_VERIFY_REQUEST) {
             *errtype = dtls1_process_out_of_seq_message(s, &msg_hdr);
             return 0;
@@ -910,21 +1210,21 @@ redo:
         chretran = 1;
     }

-    if (frag_len && frag_len < mlen) {
+    if (msg_hdr.frag_len > 0 && msg_hdr.frag_len < msg_hdr.msg_len) {
         *errtype = dtls1_reassemble_fragment(s, &msg_hdr);
         return 0;
     }

     if (!s->server
-        && s->d1->r_msg_hdr.frag_off == 0
         && s->statem.hand_state != TLS_ST_OK
-        && p[0] == SSL3_MT_HELLO_REQUEST) {
+        && msg_hdr.type == SSL3_MT_HELLO_REQUEST
+        && dtls_should_skip_hello_request(s)) {
         /*
          * The server may always send 'Hello Request' messages -- we are
          * doing a handshake anyway now, so ignore them if their format is
          * correct. Does not count for 'Finished' MAC.
          */
-        if (p[1] == 0 && p[2] == 0 && p[3] == 0) {
+        if (msg_hdr.msg_len == 0) {
             if (s->msg_callback)
                 s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE,
                     p, DTLS1_HM_HEADER_LENGTH, ussl,
@@ -932,8 +1232,8 @@ redo:

             s->init_num = 0;
             goto redo;
-        } else { /* Incorrectly formatted Hello request */
-
+        } else {
+            /* Incorrectly formatted Hello request */
             SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
             goto f_err;
         }
@@ -944,12 +1244,12 @@ redo:
         goto f_err;
     }

-    if (frag_len > 0) {
+    if (msg_hdr.frag_len > 0) {
         /* dtls1_preprocess_fragment() above could reallocate init_buf */
-        p = (unsigned char *)s->init_buf->data + DTLS1_HM_HEADER_LENGTH;
+        p = (unsigned char *)s->init_buf->data + DTLS1_HM_HEADER_LENGTH + msg_hdr.frag_off;

         i = ssl->method->ssl_read_bytes(ssl, SSL3_RT_HANDSHAKE, NULL,
-            &p[frag_off], frag_len, 0, &readbytes);
+            p, msg_hdr.frag_len, 0, &readbytes);

         /*
          * This shouldn't ever fail due to NBIO because we already checked
@@ -968,7 +1268,7 @@ redo:
      * XDTLS: an incorrectly formatted fragment should cause the handshake
      * to fail
      */
-    if (readbytes != frag_len) {
+    if (readbytes != msg_hdr.frag_len) {
         SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_LENGTH);
         goto f_err;
     }
@@ -984,13 +1284,19 @@ redo:
         s->d1->next_handshake_write_seq = 0;
     }

+    if (dtls_msg_needs_ack(!s->server, msg_hdr.type)
+        && !add_record_to_ack_list(s)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto f_err;
+    }
+
     /*
      * Note that s->init_num is *not* used as current offset in
      * s->init_buf->data, but as a counter summing up fragments' lengths: as
      * soon as they sum up to handshake packet length, we assume we have got
      * all the fragments.
      */
-    *len = s->init_num = frag_len;
+    *len = s->init_num = msg_hdr.frag_len;
     return 1;

 f_err:
@@ -1020,6 +1326,164 @@ CON_FUNC_RETURN dtls_construct_change_cipher_spec(SSL_CONNECTION *s,
     return CON_FUNC_SUCCESS;
 }

+CON_FUNC_RETURN dtls_construct_ack(SSL_CONNECTION *s, WPACKET *pkt)
+{
+    DTLS1_RECORD_NUMBER *recnum;
+    DTLS1_RECORD_NUMBER *recnumnext = ossl_list_record_number_head(&s->d1->ack_rec_num);
+
+    if (!WPACKET_start_sub_packet_u16(pkt)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return CON_FUNC_ERROR;
+    }
+
+    while ((recnum = recnumnext) != NULL) {
+        /*
+         * rfc9147: section 4.
+         *
+         * Record numbers are encoded as
+         *      struct {
+         *           uint64 epoch;
+         *           uint64 sequence_number;
+         *      } RecordNumber;
+         */
+
+        recnumnext = ossl_list_record_number_next(recnum);
+
+        if (!SSL_IS_FIRST_HANDSHAKE(s)
+            || recnum->epoch <= dtls1_get_epoch(s, SSL3_CC_WRITE)) {
+            /*
+             * rfc9147:
+             * During the handshake, ACK records MUST be sent with an epoch which
+             * is equal to or higher than the record which is being acknowledged.
+             * After the handshake, the sending and receiving epochs can differ.
+             */
+            if (!WPACKET_put_bytes_u64(pkt, recnum->epoch)
+                || !WPACKET_put_bytes_u64(pkt, recnum->seqnum)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return CON_FUNC_ERROR;
+            }
+
+            ossl_list_record_number_remove(&s->d1->ack_rec_num, recnum);
+            OPENSSL_free(recnum);
+        }
+    }
+
+    if (!WPACKET_close(pkt)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return CON_FUNC_ERROR;
+    }
+
+    return CON_FUNC_SUCCESS;
+}
+
+MSG_PROCESS_RETURN dtls_process_ack(SSL_CONNECTION *s, PACKET *pkt)
+{
+    PACKET record_numbers;
+
+    if (!PACKET_as_length_prefixed_2(pkt, &record_numbers)) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_LENGTH_TOO_LONG);
+        return MSG_PROCESS_ERROR;
+    }
+
+    while (PACKET_remaining(&record_numbers) > 0) {
+        /*
+         * rfc9147: section 4.
+         *
+         * Record numbers are encoded as
+         *      struct {
+         *           uint64 epoch;
+         *           uint64 sequence_number;
+         *      } RecordNumber;
+         */
+        pitem *item;
+        piterator iter;
+        uint64_t epoch;
+        uint64_t sequence_number;
+
+        if (!PACKET_get_net_8(&record_numbers, &epoch)
+            || !PACKET_get_net_8(&record_numbers, &sequence_number)) {
+            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_TOO_SHORT);
+            return MSG_PROCESS_ERROR;
+        }
+
+        /*
+         * Epoch 2 is the fixed handshake epoch and is never used again once
+         * epoch 3 (the first application epoch) is installed. An ACK that
+         * only authenticated via a retained epoch-2 layer must not be
+         * trusted to cancel retransmission of a post-handshake (epoch 3+)
+         * flight. Retained epochs 3+ are unrestricted: unlike epoch 2, which
+         * is never reissued, each of those epochs was freshly minted by an
+         * SSL_key_update() call and gets superseded by the next one, so a
+         * legitimate delayed ACK can authenticate behind a message's own
+         * recorded epoch with no protocol violation.
+         */
+        if (dtls_record_from_retained_epoch(s)
+            && s->s3.tmp.record_epoch == 2
+            && epoch > 2)
+            continue;
+
+        iter = pqueue_iterator(&s->d1->sent_messages);
+
+        while ((item = pqueue_next(&iter)) != NULL) {
+            dtls_sent_msg *msg = (dtls_sent_msg *)item->data;
+            DTLS1_RECORD_NUMBER *recnum;
+            DTLS1_RECORD_NUMBER *recnum_next = ossl_list_record_number_head(&msg->rec_nums);
+            int matched = 0;
+
+            while ((recnum = recnum_next) != NULL) {
+                recnum_next = ossl_list_record_number_next(recnum_next);
+
+                if (recnum->epoch == epoch && recnum->seqnum == sequence_number) {
+                    /*
+                     * Mark this record's byte range covered *before*
+                     * freeing it -- coverage tracks the message as a whole
+                     * across every transmission round, not just whether
+                     * this one specific record number was ever matched.
+                     *
+                     * The range check guards against a corrupt recorded
+                     * range
+                     */
+                    if (msg->covered != NULL
+                        && recnum->frag_off <= msg->msg_info.msg_body_len
+                        && recnum->frag_len
+                            <= msg->msg_info.msg_body_len - recnum->frag_off)
+                        RSMBLY_BITMASK_MARK(msg->covered, (long)recnum->frag_off,
+                            (long)(recnum->frag_off + recnum->frag_len));
+                    ossl_list_record_number_remove(&msg->rec_nums, recnum);
+                    OPENSSL_free(recnum);
+                    matched = 1;
+                }
+            }
+
+            /*
+             * RFC 9147 section 7.2 is a per-record rule, but completeness is
+             * per-message: the peer needs every byte of the message, from
+             * any combination of rounds, not just any one matching record.
+             * Once this ACK completes coverage of the whole message, fully
+             * drain rec_nums -- not just the node that matched -- so every
+             * other consumer that keys off list emptiness
+             * (dtls_any_sent_messages_are_missing_acknowledge(),
+             * dtls1_clear_sent_buffer(), ...) sees it retire, even though
+             * other rounds' record numbers may still be sitting unmatched.
+             */
+            if (matched && msg->covered != NULL) {
+                int is_complete;
+
+                RSMBLY_BITMASK_IS_COMPLETE(msg->covered,
+                    (long)msg->msg_info.msg_body_len, is_complete);
+                if (is_complete)
+                    ossl_list_record_number_elem_free(&msg->rec_nums);
+            }
+        }
+    }
+
+    /* Keep the retransmit timer running until the whole flight is ACKed. */
+    if (dtls_any_sent_messages_are_missing_acknowledge(s))
+        return MSG_PROCESS_CONTINUE_READING;
+
+    return MSG_PROCESS_FINISHED_READING;
+}
+
 #ifndef OPENSSL_NO_SCTP
 /*
  * Wait for a dry event. Should only be called at a point in the handshake
@@ -1079,14 +1543,19 @@ int dtls1_read_failed(SSL_CONNECTION *s, int code)
     }
     /* done, no need to send a retransmit */
     if (!SSL_in_init(ssl)) {
-        BIO_set_flags(SSL_get_rbio(ssl), BIO_FLAGS_READ);
+        BIO *rbio = SSL_get_rbio(ssl);
+
+        /* Connections created by a DTLS listener have no rbio */
+        if (rbio != NULL)
+            BIO_set_flags(rbio, BIO_FLAGS_READ);
         return code;
     }

     return dtls1_handle_timeout(s);
 }

-int dtls1_get_queue_priority(unsigned short seq, int is_ccs)
+void dtls1_get_queue_priority(unsigned char *prio64be, unsigned short seq,
+    int record_type)
 {
     /*
      * The index of the retransmission queue actually is the message sequence
@@ -1098,33 +1567,40 @@ int dtls1_get_queue_priority(unsigned short seq, int is_ccs)
      * Finished, it also maintains the order of the index (important for
      * priority queues) and fits in the unsigned short variable.
      */
-    return seq * 2 - is_ccs;
+    int lsb = (record_type == SSL3_RT_CHANGE_CIPHER_SPEC);
+    const uint16_t prio = seq * 2 - lsb;
+
+    memset(prio64be, 0, 8);
+    prio64be[6] = (unsigned char)(prio >> 8);
+    prio64be[7] = (unsigned char)(prio);
 }

-int dtls1_retransmit_buffered_messages(SSL_CONNECTION *s)
+int dtls1_retransmit_sent_messages(SSL_CONNECTION *s)
 {
-    pqueue *sent = s->d1->sent_messages;
-    piterator iter;
+    piterator iter = pqueue_iterator(&s->d1->sent_messages);
     pitem *item;
-    hm_fragment *frag;
-    int found = 0;
-
-    iter = pqueue_iterator(sent);

     for (item = pqueue_next(&iter); item != NULL; item = pqueue_next(&iter)) {
-        frag = (hm_fragment *)item->data;
-        if (dtls1_retransmit_message(s, (unsigned short)dtls1_get_queue_priority(frag->msg_header.seq, frag->msg_header.is_ccs), &found) <= 0)
+        dtls_sent_msg *sent_msg = (dtls_sent_msg *)item->data;
+
+        if (SSL_CONNECTION_IS_DTLS13(s)
+            && ossl_list_record_number_is_empty(&sent_msg->rec_nums))
+            /* rfc9147: Implementations must not retransmit acknowledged msgs */
+            continue;
+
+        if (dtls1_retransmit_message(s, sent_msg) <= 0)
             return -1;
     }

     return 1;
 }

-int dtls1_buffer_message(SSL_CONNECTION *s, int is_ccs)
+int dtls1_buffer_sent_message(SSL_CONNECTION *s, int record_type)
 {
     pitem *item;
-    hm_fragment *frag;
+    dtls_sent_msg *sent_msg;
     unsigned char seq64be[8];
+    size_t headerlen;

     /*
      * this function is called immediately after a message has been
@@ -1133,98 +1609,73 @@ int dtls1_buffer_message(SSL_CONNECTION *s, int is_ccs)
     if (!ossl_assert(s->init_off == 0))
         return 0;

-    frag = dtls1_hm_fragment_new(s->init_num, 0);
-    if (frag == NULL)
+    sent_msg = dtls1_sent_msg_new(s->init_num, s->d1->w_msg.msg_body_len,
+        SSL_CONNECTION_IS_DTLS13(s));
+    if (sent_msg == NULL)
         return 0;

-    memcpy(frag->fragment, s->init_buf->data, s->init_num);
+    memcpy(sent_msg->msg_buf, s->init_buf->data, s->init_num);

-    if (is_ccs) {
+    if (record_type == SSL3_RT_CHANGE_CIPHER_SPEC)
         /* For DTLS1_BAD_VER the header length is non-standard */
-        if (!ossl_assert(s->d1->w_msg_hdr.msg_len + ((s->version == DTLS1_BAD_VER) ? 3 : DTLS1_CCS_HEADER_LENGTH)
-                == (unsigned int)s->init_num)) {
-            dtls1_hm_fragment_free(frag);
-            return 0;
-        }
-    } else {
-        if (!ossl_assert(s->d1->w_msg_hdr.msg_len + DTLS1_HM_HEADER_LENGTH == (unsigned int)s->init_num)) {
-            dtls1_hm_fragment_free(frag);
-            return 0;
-        }
+        headerlen = (s->version == DTLS1_BAD_VER) ? 3 : DTLS1_CCS_HEADER_LENGTH;
+    else
+        headerlen = DTLS1_HM_HEADER_LENGTH;
+
+    if (!ossl_assert(s->d1->w_msg.msg_body_len + headerlen == s->init_num)) {
+        dtls1_sent_msg_free(sent_msg);
+        return 0;
     }

-    frag->msg_header.msg_len = s->d1->w_msg_hdr.msg_len;
-    frag->msg_header.seq = s->d1->w_msg_hdr.seq;
-    frag->msg_header.type = s->d1->w_msg_hdr.type;
-    frag->msg_header.frag_off = 0;
-    frag->msg_header.frag_len = s->d1->w_msg_hdr.msg_len;
-    frag->msg_header.is_ccs = is_ccs;
+    memcpy(&sent_msg->msg_info, &s->d1->w_msg, sizeof(s->d1->w_msg));

     /* save current state */
-    frag->msg_header.saved_retransmit_state.wrlmethod = s->rlayer.wrlmethod;
-    frag->msg_header.saved_retransmit_state.wrl = s->rlayer.wrl;
+    sent_msg->saved_retransmit_state.wrlmethod = s->rlayer.wrlmethod;
+    sent_msg->saved_retransmit_state.wrl = s->rlayer.wrl;

-    memset(seq64be, 0, sizeof(seq64be));
-    seq64be[6] = (unsigned char)(dtls1_get_queue_priority(frag->msg_header.seq,
-                                     frag->msg_header.is_ccs)
-        >> 8);
-    seq64be[7] = (unsigned char)(dtls1_get_queue_priority(frag->msg_header.seq,
-        frag->msg_header.is_ccs));
+    dtls1_get_queue_priority(seq64be, sent_msg->msg_info.msg_seq, sent_msg->msg_info.record_type);

-    item = pitem_new(seq64be, frag);
+    item = pitem_new(seq64be, sent_msg);
     if (item == NULL) {
-        dtls1_hm_fragment_free(frag);
+        dtls1_sent_msg_free(sent_msg);
         return 0;
     }

-    if (pqueue_insert(s->d1->sent_messages, item) == NULL) {
-        dtls1_hm_fragment_free(frag);
+    if (pqueue_insert(&s->d1->sent_messages, item) == NULL) {
+        dtls1_sent_msg_free(sent_msg);
         pitem_free(item);
         return 0;
     }
     return 1;
 }

-int dtls1_retransmit_message(SSL_CONNECTION *s, unsigned short seq, int *found)
+int dtls1_retransmit_message(SSL_CONNECTION *s, dtls_sent_msg *sent_msg)
 {
     int ret;
-    /* XDTLS: for now assuming that read/writes are blocking */
-    pitem *item;
-    hm_fragment *frag;
     unsigned long header_length;
-    unsigned char seq64be[8];
     struct dtls1_retransmit_state saved_state;

-    /* XDTLS:  the requested message ought to be found, otherwise error */
-    memset(seq64be, 0, sizeof(seq64be));
-    seq64be[6] = (unsigned char)(seq >> 8);
-    seq64be[7] = (unsigned char)seq;
-
-    item = pqueue_find(s->d1->sent_messages, seq64be);
-    if (item == NULL) {
-        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-        *found = 0;
-        return 0;
-    }
-
-    *found = 1;
-    frag = (hm_fragment *)item->data;
-
-    if (frag->msg_header.is_ccs)
+    if (sent_msg->msg_info.record_type == SSL3_RT_CHANGE_CIPHER_SPEC)
         header_length = DTLS1_CCS_HEADER_LENGTH;
     else
         header_length = DTLS1_HM_HEADER_LENGTH;

-    memcpy(s->init_buf->data, frag->fragment,
-        frag->msg_header.msg_len + header_length);
-    s->init_num = frag->msg_header.msg_len + header_length;
+    /*
+     * Deliberately not clearing rec_nums here: RFC 9147 section 7.2 requires
+     * treating a record as acknowledged if it appears in *any* ACK, so a
+     * late ACK matching an earlier round's record number must still be able
+     * to match something. rec_nums accumulates across every retransmission
+     * round instead; dtls_process_ack() retires entries by tracking byte
+     * range coverage, not by this list ever being reset per round.
+     */
+
+    memcpy(s->init_buf->data, sent_msg->msg_buf,
+        sent_msg->msg_info.msg_body_len + header_length);
+    s->init_num = sent_msg->msg_info.msg_body_len + header_length;
     /* Always retransmit from the start, not wherever init_off was left */
     s->init_off = 0;

-    dtls1_set_message_header_int(s, frag->msg_header.type,
-        frag->msg_header.msg_len,
-        frag->msg_header.seq, 0,
-        frag->msg_header.frag_len);
+    memcpy(&s->d1->w_msg, &sent_msg->msg_info, sizeof(sent_msg->msg_info));

     /* save current state */
     saved_state.wrlmethod = s->rlayer.wrlmethod;
@@ -1233,8 +1684,8 @@ int dtls1_retransmit_message(SSL_CONNECTION *s, unsigned short seq, int *found)
     s->d1->retransmitting = 1;

     /* restore state in which the message was originally sent */
-    s->rlayer.wrlmethod = frag->msg_header.saved_retransmit_state.wrlmethod;
-    s->rlayer.wrl = frag->msg_header.saved_retransmit_state.wrl;
+    s->rlayer.wrlmethod = sent_msg->saved_retransmit_state.wrlmethod;
+    s->rlayer.wrl = sent_msg->saved_retransmit_state.wrl;

     /*
      * The old wrl may be still pointing at an old BIO. Update it to what we're
@@ -1242,7 +1693,7 @@ int dtls1_retransmit_message(SSL_CONNECTION *s, unsigned short seq, int *found)
      */
     s->rlayer.wrlmethod->set1_bio(s->rlayer.wrl, s->wbio);

-    ret = dtls1_do_write(s, frag->msg_header.is_ccs ? SSL3_RT_CHANGE_CIPHER_SPEC : SSL3_RT_HANDSHAKE);
+    ret = dtls1_do_write(s, sent_msg->msg_info.record_type);

     /* restore current state */
     s->rlayer.wrlmethod = saved_state.wrlmethod;
@@ -1254,87 +1705,35 @@ int dtls1_retransmit_message(SSL_CONNECTION *s, unsigned short seq, int *found)
     return ret;
 }

-void dtls1_set_message_header(SSL_CONNECTION *s,
-    unsigned char mt, size_t len,
-    size_t frag_off, size_t frag_len)
-{
-    if (frag_off == 0) {
-        s->d1->handshake_write_seq = s->d1->next_handshake_write_seq;
-        s->d1->next_handshake_write_seq++;
-    }
-
-    dtls1_set_message_header_int(s, mt, len, s->d1->handshake_write_seq,
-        frag_off, frag_len);
-}
-
-/* don't actually do the writing, wait till the MTU has been retrieved */
-static void
-dtls1_set_message_header_int(SSL_CONNECTION *s, unsigned char mt,
-    size_t len, unsigned short seq_num,
-    size_t frag_off, size_t frag_len)
-{
-    struct hm_header_st *msg_hdr = &s->d1->w_msg_hdr;
-
-    msg_hdr->type = mt;
-    msg_hdr->msg_len = len;
-    msg_hdr->seq = seq_num;
-    msg_hdr->frag_off = frag_off;
-    msg_hdr->frag_len = frag_len;
-}
-
-static void
-dtls1_fix_message_header(SSL_CONNECTION *s, size_t frag_off, size_t frag_len)
-{
-    struct hm_header_st *msg_hdr = &s->d1->w_msg_hdr;
-
-    msg_hdr->frag_off = frag_off;
-    msg_hdr->frag_len = frag_len;
-}
-
-static unsigned char *dtls1_write_message_header(SSL_CONNECTION *s,
-    unsigned char *p)
-{
-    struct hm_header_st *msg_hdr = &s->d1->w_msg_hdr;
-
-    *p++ = msg_hdr->type;
-    l2n3(msg_hdr->msg_len, p);
-
-    s2n(msg_hdr->seq, p);
-    l2n3(msg_hdr->frag_off, p);
-    l2n3(msg_hdr->frag_len, p);
-
-    return p;
-}
-
-void dtls1_get_message_header(const unsigned char *data, struct hm_header_st *msg_hdr)
-{
-    memset(msg_hdr, 0, sizeof(*msg_hdr));
-    msg_hdr->type = *(data++);
-    n2l3(data, msg_hdr->msg_len);
-
-    n2s(data, msg_hdr->seq);
-    n2l3(data, msg_hdr->frag_off);
-    n2l3(data, msg_hdr->frag_len);
-}
-
 int dtls1_set_handshake_header(SSL_CONNECTION *s, WPACKET *pkt, int htype)
 {
-    unsigned char *header;
+    s->d1->handshake_write_seq = s->d1->next_handshake_write_seq;
+    s->d1->w_msg.msg_seq = s->d1->handshake_write_seq;
+    s->d1->w_msg.msg_body_len = 0;

     if (htype == SSL3_MT_CHANGE_CIPHER_SPEC) {
-        s->d1->handshake_write_seq = s->d1->next_handshake_write_seq;
-        dtls1_set_message_header_int(s, SSL3_MT_CCS, 0,
-            s->d1->handshake_write_seq, 0, 0);
+        s->d1->w_msg.record_type = SSL3_RT_CHANGE_CIPHER_SPEC;
+        s->d1->w_msg.msg_type = SSL3_MT_CCS;
+
         if (!WPACKET_put_bytes_u8(pkt, SSL3_MT_CCS))
             return 0;
+    } else if (htype == DTLS13_MT_ACK) {
+        s->d1->w_msg.record_type = SSL3_RT_ACK;
+        s->d1->w_msg.msg_type = 0;
     } else {
-        dtls1_set_message_header(s, htype, 0, 0, 0);
-        /*
-         * We allocate space at the start for the message header. This gets
-         * filled in later
-         */
-        if (!WPACKET_allocate_bytes(pkt, DTLS1_HM_HEADER_LENGTH, &header)
-            || !WPACKET_start_sub_packet(pkt))
+        size_t subpacket_offset = DTLS1_HM_HEADER_LENGTH - SSL3_HM_HEADER_LENGTH;
+
+        s->d1->next_handshake_write_seq++;
+        s->d1->w_msg.record_type = SSL3_RT_HANDSHAKE;
+        s->d1->w_msg.msg_type = htype;
+
+        /* Set the content type and 3 bytes for the message len */
+        if (!WPACKET_put_bytes_u8(pkt, htype)
+            /*
+             * We allocate space for DTLS specific fields.
+             * These gets filled later.
+             */
+            || !WPACKET_start_sub_packet_u24_at_offset(pkt, subpacket_offset))
             return 0;
     }

@@ -1345,21 +1744,21 @@ int dtls1_close_construct_packet(SSL_CONNECTION *s, WPACKET *pkt, int htype)
 {
     size_t msglen;

-    if ((htype != SSL3_MT_CHANGE_CIPHER_SPEC && !WPACKET_close(pkt))
+    if ((s->d1->w_msg.record_type == SSL3_RT_HANDSHAKE && !WPACKET_close(pkt))
         || !WPACKET_get_length(pkt, &msglen)
         || msglen > INT_MAX)
         return 0;

-    if (htype != SSL3_MT_CHANGE_CIPHER_SPEC) {
-        s->d1->w_msg_hdr.msg_len = msglen - DTLS1_HM_HEADER_LENGTH;
-        s->d1->w_msg_hdr.frag_len = msglen - DTLS1_HM_HEADER_LENGTH;
-    }
-    s->init_num = (int)msglen;
+    if (s->d1->w_msg.record_type == SSL3_RT_HANDSHAKE)
+        s->d1->w_msg.msg_body_len = msglen - DTLS1_HM_HEADER_LENGTH;
+
+    s->init_num = msglen;
     s->init_off = 0;

-    if (htype != DTLS1_MT_HELLO_VERIFY_REQUEST) {
+    if (htype != DTLS1_MT_HELLO_VERIFY_REQUEST
+        && s->d1->w_msg.record_type != SSL3_RT_ACK) {
         /* Buffer the message to handle re-xmits */
-        if (!dtls1_buffer_message(s, htype == SSL3_MT_CHANGE_CIPHER_SPEC ? 1 : 0))
+        if (!dtls1_buffer_sent_message(s, s->d1->w_msg.record_type))
             return 0;
     }

diff --git a/deps/openssl/openssl/ssl/statem/statem_lib.c b/deps/openssl/openssl/ssl/statem/statem_lib.c
index c6900870814..55ce0a48251 100644
--- a/deps/openssl/openssl/ssl/statem/statem_lib.c
+++ b/deps/openssl/openssl/ssl/statem/statem_lib.c
@@ -16,6 +16,7 @@
 #include "internal/cryptlib.h"
 #include "internal/ssl_unwrap.h"
 #include <openssl/buffer.h>
+#include <openssl/core_names.h>
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include <openssl/rsa.h>
@@ -131,7 +132,7 @@ int tls_close_construct_packet(SSL_CONNECTION *s, WPACKET *pkt, int htype)
         || !WPACKET_get_length(pkt, &msglen)
         || msglen > INT_MAX)
         return 0;
-    s->init_num = (int)msglen;
+    s->init_num = msglen;
     s->init_off = 0;

     return 1;
@@ -158,13 +159,13 @@ int tls_setup_handshake(SSL_CONNECTION *s)

     /* Sanity check that we have MD5-SHA1 if we need it */
     if (sctx->ssl_digest_methods[SSL_MD_MD5_SHA1_IDX] == NULL) {
-        int negotiated_minversion;
-        int md5sha1_needed_maxversion = SSL_CONNECTION_IS_DTLS(s)
-            ? DTLS1_VERSION
-            : TLS1_1_VERSION;
+        const int version1_2 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_2_VERSION
+                                                         : TLS1_2_VERSION;
+        const int version1_1 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_VERSION
+                                                         : TLS1_1_VERSION;

         /* We don't have MD5-SHA1 - do we need it? */
-        if (ssl_version_cmp(s, ver_max, md5sha1_needed_maxversion) <= 0) {
+        if (ssl_version_cmp(s, ver_max, version1_1) <= 0) {
             SSLfatal_data(s, SSL_AD_HANDSHAKE_FAILURE,
                 SSL_R_NO_SUITABLE_DIGEST_ALGORITHM,
                 "The max supported SSL/TLS version needs the"
@@ -177,9 +178,8 @@ int tls_setup_handshake(SSL_CONNECTION *s)
         ok = 1;

         /* Don't allow TLSv1.1 or below to be negotiated */
-        negotiated_minversion = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_2_VERSION : TLS1_2_VERSION;
-        if (ssl_version_cmp(s, ver_min, negotiated_minversion) < 0)
-            ok = SSL_set_min_proto_version(ssl, negotiated_minversion);
+        if (ssl_version_cmp(s, ver_min, version1_2) < 0)
+            ok = SSL_set_min_proto_version(ssl, version1_2);
         if (!ok) {
             /* Shouldn't happen */
             SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, ERR_R_INTERNAL_ERROR);
@@ -206,7 +206,8 @@ int tls_setup_handshake(SSL_CONNECTION *s)
                 ? c->max_dtls
                 : c->max_tls;

-            if (ssl_version_cmp(s, ver_max, cipher_minprotover) >= 0
+            if (cipher_minprotover > 0 && cipher_maxprotover > 0
+                && ssl_version_cmp(s, ver_max, cipher_minprotover) >= 0
                 && ssl_version_cmp(s, ver_max, cipher_maxprotover) <= 0) {
                 ok = 1;
                 break;
@@ -265,7 +266,7 @@ static int get_cert_verify_tbs_data(SSL_CONNECTION *s, unsigned char *tls13tbs,
     static const char clientcontext[] = "\x54\x4c\x53\x20\x31\x2e\x33\x2c\x20\x63\x6c\x69"
                                         "\x65\x6e\x74\x20\x43\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x56\x65\x72\x69\x66\x79";

-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         size_t hashlen;

         /* Set the first 64 bytes of to-be-signed data to octet 32 */
@@ -322,6 +323,7 @@ CON_FUNC_RETURN tls_construct_cert_verify(SSL_CONNECTION *s, WPACKET *pkt)
     unsigned char tls13tbs[TLS13_TBS_PREAMBLE_SIZE + EVP_MAX_MD_SIZE];
     const SIGALG_LOOKUP *lu = s->s3.tmp.sigalg;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+    OSSL_PARAM params[3], *p = params;

     if (lu == NULL || s->s3.tmp.cert == NULL) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
@@ -351,10 +353,19 @@ CON_FUNC_RETURN tls_construct_cert_verify(SSL_CONNECTION *s, WPACKET *pkt)
         goto err;
     }

+    /*
+     * To avoid problems with older RSA providers we must also pass the digest
+     * name when passing any other parameters.
+     */
+    *p++ = OSSL_PARAM_construct_int(OSSL_SIGNATURE_PARAM_TLS_VERSION, &s->version);
+    if (md != NULL)
+        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST,
+            (char *)EVP_MD_get0_name(md), 0);
+    *p = OSSL_PARAM_construct_end();
+
     if (EVP_DigestSignInit_ex(mctx, &pctx,
             md == NULL ? NULL : EVP_MD_get0_name(md),
-            sctx->libctx, sctx->propq, pkey,
-            NULL)
+            sctx->libctx, sctx->propq, pkey, params)
         <= 0) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
         goto err;
@@ -369,42 +380,20 @@ CON_FUNC_RETURN tls_construct_cert_verify(SSL_CONNECTION *s, WPACKET *pkt)
             goto err;
         }
     }
-    if (s->version == SSL3_VERSION) {
-        /*
-         * Here we use EVP_DigestSignUpdate followed by EVP_DigestSignFinal
-         * in order to add the EVP_CTRL_SSL3_MASTER_SECRET call between them.
-         */
-        if (EVP_DigestSignUpdate(mctx, hdata, hdatalen) <= 0
-            || EVP_MD_CTX_ctrl(mctx, EVP_CTRL_SSL3_MASTER_SECRET,
-                   (int)s->session->master_key_length,
-                   s->session->master_key)
-                <= 0
-            || EVP_DigestSignFinal(mctx, NULL, &siglen) <= 0) {

-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
-            goto err;
-        }
-        sig = OPENSSL_malloc(siglen);
-        if (sig == NULL
-            || EVP_DigestSignFinal(mctx, sig, &siglen) <= 0) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
-            goto err;
-        }
-    } else {
-        /*
-         * Here we *must* use EVP_DigestSign() because Ed25519/Ed448 does not
-         * support streaming via EVP_DigestSignUpdate/EVP_DigestSignFinal
-         */
-        if (EVP_DigestSign(mctx, NULL, &siglen, hdata, hdatalen) <= 0) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
-            goto err;
-        }
-        sig = OPENSSL_malloc(siglen);
-        if (sig == NULL
-            || EVP_DigestSign(mctx, sig, &siglen, hdata, hdatalen) <= 0) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
-            goto err;
-        }
+    /*
+     * Here we *must* use EVP_DigestSign() because Ed25519/Ed448 does not
+     * support streaming via EVP_DigestSignUpdate/EVP_DigestSignFinal
+     */
+    if (EVP_DigestSign(mctx, NULL, &siglen, hdata, hdatalen) <= 0) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
+        goto err;
+    }
+    sig = OPENSSL_malloc(siglen);
+    if (sig == NULL
+        || EVP_DigestSign(mctx, sig, &siglen, hdata, hdatalen) <= 0) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
+        goto err;
     }

 #ifndef OPENSSL_NO_GOST
@@ -455,6 +444,7 @@ MSG_PROCESS_RETURN tls_process_cert_verify(SSL_CONNECTION *s, PACKET *pkt)
     EVP_MD_CTX *mctx = EVP_MD_CTX_new();
     EVP_PKEY_CTX *pctx = NULL;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+    OSSL_PARAM params[3], *p = params;

     if (mctx == NULL) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
@@ -511,7 +501,7 @@ MSG_PROCESS_RETURN tls_process_cert_verify(SSL_CONNECTION *s, PACKET *pkt)
                     || EVP_PKEY_get_id(pkey) == NID_id_GostR3410_2012_256))
             || (PACKET_remaining(pkt) == 128
                 && EVP_PKEY_get_id(pkey) == NID_id_GostR3410_2012_512))) {
-        len = PACKET_remaining(pkt);
+        len = (unsigned int)PACKET_remaining(pkt);
     } else
 #endif
         if (!PACKET_get_net_2(pkt, &len)) {
@@ -536,10 +526,19 @@ MSG_PROCESS_RETURN tls_process_cert_verify(SSL_CONNECTION *s, PACKET *pkt)
     OSSL_TRACE1(TLS, "Using client verify alg %s\n",
         md == NULL ? "n/a" : EVP_MD_get0_name(md));

+    /*
+     * To avoid problems with older RSA providers we must also pass the digest
+     * name when passing any other parameters.
+     */
+    *p++ = OSSL_PARAM_construct_int(OSSL_SIGNATURE_PARAM_TLS_VERSION, &s->version);
+    if (md != NULL)
+        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST,
+            (char *)EVP_MD_get0_name(md), 0);
+    *p = OSSL_PARAM_construct_end();
+
     if (EVP_DigestVerifyInit_ex(mctx, &pctx,
             md == NULL ? NULL : EVP_MD_get0_name(md),
-            sctx->libctx, sctx->propq, pkey,
-            NULL)
+            sctx->libctx, sctx->propq, pkey, params)
         <= 0) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
         goto err;
@@ -567,41 +566,27 @@ MSG_PROCESS_RETURN tls_process_cert_verify(SSL_CONNECTION *s, PACKET *pkt)
             goto err;
         }
     }
-    if (s->version == SSL3_VERSION) {
-        if (EVP_DigestVerifyUpdate(mctx, hdata, hdatalen) <= 0
-            || EVP_MD_CTX_ctrl(mctx, EVP_CTRL_SSL3_MASTER_SECRET,
-                   (int)s->session->master_key_length,
-                   s->session->master_key)
-                <= 0) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
-            goto err;
-        }
-        if (EVP_DigestVerifyFinal(mctx, data, len) <= 0) {
-            SSLfatal(s, SSL_AD_DECRYPT_ERROR, SSL_R_BAD_SIGNATURE);
-            goto err;
-        }
-    } else {
-        j = EVP_DigestVerify(mctx, data, len, hdata, hdatalen);
+
+    j = EVP_DigestVerify(mctx, data, len, hdata, hdatalen);
 #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
-        /* Ignore bad signatures when fuzzing */
-        if (SSL_IS_QUIC_HANDSHAKE(s))
-            j = 1;
+    /* Ignore bad signatures when fuzzing */
+    if (SSL_IS_QUIC_HANDSHAKE(s))
+        j = 1;
 #endif
-        if (j <= 0) {
-            SSLfatal(s, SSL_AD_DECRYPT_ERROR, SSL_R_BAD_SIGNATURE);
-            goto err;
-        }
+    if (j <= 0) {
+        SSLfatal(s, SSL_AD_DECRYPT_ERROR, SSL_R_BAD_SIGNATURE);
+        goto err;
     }

     /*
-     * In TLSv1.3 on the client side we make sure we prepare the client
+     * In (D)TLSv1.3 on the client side we make sure we prepare the client
      * certificate after the CertVerify instead of when we get the
-     * CertificateRequest. This is because in TLSv1.3 the CertificateRequest
-     * comes *before* the Certificate message. In TLSv1.2 it comes after. We
+     * CertificateRequest. This is because in (D)TLSv1.3 the CertificateRequest
+     * comes *before* the Certificate message. In (D)TLSv1.2 it comes after. We
      * want to make sure that SSL_get1_peer_certificate() will return the actual
      * server certificate from the client_cert_cb callback.
      */
-    if (!s->server && SSL_CONNECTION_IS_TLS13(s) && s->s3.tmp.cert_req == 1)
+    if (!s->server && SSL_CONNECTION_IS_VERSION13(s) && s->s3.tmp.cert_req == 1)
         ret = MSG_PROCESS_CONTINUE_PROCESSING;
     else
         ret = MSG_PROCESS_CONTINUE_READING;
@@ -632,11 +617,11 @@ CON_FUNC_RETURN tls_construct_finished(SSL_CONNECTION *s, WPACKET *pkt)
      * moment. If we didn't already do this when we sent the client certificate
      * then we need to do it now.
      */
-    if (SSL_CONNECTION_IS_TLS13(s)
+    if (SSL_CONNECTION_IS_VERSION13(s)
         && !s->server
         && !SSL_IS_QUIC_HANDSHAKE(s)
         && (s->early_data_state != SSL_EARLY_DATA_NONE
-            || (s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0)
+            || SSL_CONNECTION_MIDDLEBOX_IS_ENABLED(s))
         && s->s3.tmp.cert_req == 0
         && (!ssl->method->ssl3_enc->change_cipher_state(s,
             SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_CLIENT_WRITE))) {
@@ -670,9 +655,9 @@ CON_FUNC_RETURN tls_construct_finished(SSL_CONNECTION *s, WPACKET *pkt)

     /*
      * Log the master secret, if logging is enabled. We don't log it for
-     * TLSv1.3: there's a different key schedule for that.
+     * (D)TLSv1.3: there's a different key schedule for that.
      */
-    if (!SSL_CONNECTION_IS_TLS13(s)
+    if (!SSL_CONNECTION_IS_VERSION13(s)
         && !ssl_log_secret(s, MASTER_SECRET_LABEL, s->session->master_key,
             s->session->master_key_length)) {
         /* SSLfatal() already called */
@@ -847,18 +832,27 @@ MSG_PROCESS_RETURN tls_process_finished(SSL_CONNECTION *s, PACKET *pkt)
     int was_first = SSL_IS_FIRST_HANDSHAKE(s);
     int ok;

+    /*
+     * A DTLS 1.3 Finished is protected with the peer's handshake keys. If we
+     * have not installed them yet we have no key to verify it with either.
+     */
+    if (SSL_CONNECTION_IS_DTLS13(s) && dtls1_get_epoch(s, SSL3_CC_READ) < 2) {
+        SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
+        return MSG_PROCESS_ERROR;
+    }
+
     /* This is a real handshake so make sure we clean it up at the end */
     if (s->server) {
         /*
          * To get this far we must have read encrypted data from the client. We
          * no longer tolerate unencrypted alerts. This is ignored if less than
-         * TLSv1.3
+         * (D)TLSv1.3
          */
         if (s->rlayer.rrlmethod->set_plain_alerts != NULL)
             s->rlayer.rrlmethod->set_plain_alerts(s->rlayer.rrl, 0);
         if (s->post_handshake_auth != SSL_PHA_REQUESTED)
             s->statem.cleanuphand = 1;
-        if (SSL_CONNECTION_IS_TLS13(s)
+        if (SSL_CONNECTION_IS_VERSION13(s)
             && !tls13_save_handshake_digest_for_pha(s)) {
             /* SSLfatal() already called */
             return MSG_PROCESS_ERROR;
@@ -869,14 +863,14 @@ MSG_PROCESS_RETURN tls_process_finished(SSL_CONNECTION *s, PACKET *pkt)
      * In TLSv1.3 a Finished message signals a key change so the end of the
      * message must be on a record boundary.
      */
-    if (SSL_CONNECTION_IS_TLS13(s)
+    if (SSL_CONNECTION_IS_VERSION13(s)
         && RECORD_LAYER_processed_read_pending(&s->rlayer)) {
         SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_NOT_ON_RECORD_BOUNDARY);
         return MSG_PROCESS_ERROR;
     }

     /* If this occurs, we have missed a message */
-    if (!SSL_CONNECTION_IS_TLS13(s) && !s->s3.change_cipher_spec) {
+    if (!SSL_CONNECTION_IS_VERSION13(s) && !s->s3.change_cipher_spec) {
         SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_GOT_A_FIN_BEFORE_A_CCS);
         return MSG_PROCESS_ERROR;
     }
@@ -924,14 +918,14 @@ MSG_PROCESS_RETURN tls_process_finished(SSL_CONNECTION *s, PACKET *pkt)
      * In TLS1.3 we also have to change cipher state and do any final processing
      * of the initial server flight (if we are a client)
      */
-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         if (s->server) {
             if (s->post_handshake_auth != SSL_PHA_REQUESTED && !ssl->method->ssl3_enc->change_cipher_state(s, SSL3_CC_APPLICATION | SSL3_CHANGE_CIPHER_SERVER_READ)) {
                 /* SSLfatal() already called */
                 return MSG_PROCESS_ERROR;
             }
         } else {
-            /* TLS 1.3 gets the secret size from the handshake md */
+            /* (D)TLS 1.3 gets the secret size from the handshake md */
             size_t dummy;
             if (!ssl->method->ssl3_enc->generate_master_secret(s,
                     s->master_secret, s->handshake_secret, 0,
@@ -1007,7 +1001,7 @@ static int ssl_add_cert_to_wpacket(SSL_CONNECTION *s, WPACKET *pkt,
         return 0;
     }

-    if ((SSL_CONNECTION_IS_TLS13(s) || for_comp)
+    if ((SSL_CONNECTION_IS_VERSION13(s) || for_comp)
         && !tls_construct_extensions(s, pkt, context, x, chain)) {
         /* SSLfatal() already called */
         return 0;
@@ -1139,9 +1133,9 @@ int tls_process_rpk(SSL_CONNECTION *sc, PACKET *pkt, EVP_PKEY **peer_rpk)

     /*-
      * ----------------------------
-     * TLS 1.3 Certificate message:
+     * (D)TLS 1.3 Certificate message:
      * ----------------------------
-     * https://datatracker.ietf.org/doc/html/rfc8446#section-4.4.2
+     * https://datatracker.ietf.org/doc/html/rfc9846#section-4.5.1
      *
      *   enum {
      *       X509(0),
@@ -1199,21 +1193,21 @@ int tls_process_rpk(SSL_CONNECTION *sc, PACKET *pkt, EVP_PKEY **peer_rpk)
      * -------------
      * Consequently:
      * -------------
-     * After the (TLS 1.3 only) context octet string (1 byte length + data) the
+     * After the ((D)TLS 1.3 only) context octet string (1 byte length + data) the
      * Certificate message has a 3-byte length that is zero in the client to
      * server message when the client has no RPK to send.  In that case, there
-     * are no (TLS 1.3 only) per-certificate extensions either, because the
+     * are no ((D)TLS 1.3 only) per-certificate extensions either, because the
      * [CertificateEntry] list is empty.
      *
      * In the server to client direction, or when the client had an RPK to send,
-     * the TLS 1.3 message just prepends the length of the RPK+extensions,
+     * the (D)TLS 1.3 message just prepends the length of the RPK+extensions,
      * while TLS <= 1.2 sends just the RPK (octet-string).
      *
      * The context must be zero-length in the server to client direction, and
      * must match the value recorded in the certificate request in the client
      * to server direction.
      */
-    if (SSL_CONNECTION_IS_TLS13(sc)) {
+    if (SSL_CONNECTION_IS_VERSION13(sc)) {
         if (!PACKET_get_length_prefixed_1(pkt, &context)) {
             SSLfatal(sc, SSL_AD_DECODE_ERROR, SSL_R_INVALID_CONTEXT);
             goto err;
@@ -1255,7 +1249,7 @@ int tls_process_rpk(SSL_CONNECTION *sc, PACKET *pkt, EVP_PKEY **peer_rpk)
     if (cert_len == 0)
         return 1;

-    if (SSL_CONNECTION_IS_TLS13(sc)) {
+    if (SSL_CONNECTION_IS_VERSION13(sc)) {
         /*
          * With TLS 1.3, a non-empty explicit-length RPK octet-string followed
          * by a possibly empty extension block.
@@ -1290,7 +1284,7 @@ int tls_process_rpk(SSL_CONNECTION *sc, PACKET *pkt, EVP_PKEY **peer_rpk)
     }

     /* Process the Extensions block */
-    if (SSL_CONNECTION_IS_TLS13(sc)) {
+    if (SSL_CONNECTION_IS_VERSION13(sc)) {
         if (PACKET_remaining(pkt) != (cert_len - 3 - spki_len)) {
             SSLfatal(sc, SSL_AD_DECODE_ERROR, SSL_R_BAD_LENGTH);
             goto err;
@@ -1328,7 +1322,7 @@ unsigned long tls_output_rpk(SSL_CONNECTION *sc, WPACKET *pkt, CERT_PKEY *cpk)
 {
     int pdata_len = 0;
     unsigned char *pdata = NULL;
-    X509_PUBKEY *xpk = NULL;
+    const X509_PUBKEY *xpk = NULL;
     unsigned long ret = 0;
     X509 *x509 = NULL;

@@ -1367,7 +1361,7 @@ unsigned long tls_output_rpk(SSL_CONNECTION *sc, WPACKET *pkt, CERT_PKEY *cpk)
      * TLSv1.2 is _just_ the raw public key
      * TLSv1.3 includes extensions, so there's a length wrapper
      */
-    if (SSL_CONNECTION_IS_TLS13(sc)) {
+    if (SSL_CONNECTION_IS_VERSION13(sc)) {
         if (!WPACKET_start_sub_packet_u24(pkt)) {
             SSLfatal(sc, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             goto err;
@@ -1379,7 +1373,7 @@ unsigned long tls_output_rpk(SSL_CONNECTION *sc, WPACKET *pkt, CERT_PKEY *cpk)
         goto err;
     }

-    if (SSL_CONNECTION_IS_TLS13(sc)) {
+    if (SSL_CONNECTION_IS_VERSION13(sc)) {
         /*
          * Only send extensions relevant to raw public keys. Until such
          * extensions are defined, this will be an empty set of extensions.
@@ -1463,7 +1457,7 @@ WORK_STATE tls_finish_handshake(SSL_CONNECTION *s, ossl_unused WORK_STATE wst,
         s->init_num = 0;
     }

-    if (SSL_CONNECTION_IS_TLS13(s) && !s->server
+    if (SSL_CONNECTION_IS_VERSION13(s) && !s->server
         && s->post_handshake_auth == SSL_PHA_REQUESTED)
         s->post_handshake_auth = SSL_PHA_EXT_SENT;

@@ -1485,14 +1479,14 @@ WORK_STATE tls_finish_handshake(SSL_CONNECTION *s, ossl_unused WORK_STATE wst,
              * In TLSv1.3 we update the cache as part of constructing the
              * NewSessionTicket
              */
-            if (!SSL_CONNECTION_IS_TLS13(s))
+            if (!SSL_CONNECTION_IS_VERSION13(s))
                 ssl_update_cache(s, SSL_SESS_CACHE_SERVER);

             /* N.B. s->ctx may not equal s->session_ctx */
             ssl_tsan_counter(sctx, &sctx->stats.sess_accept_good);
             s->handshake_func = ossl_statem_accept;
         } else {
-            if (SSL_CONNECTION_IS_TLS13(s)) {
+            if (SSL_CONNECTION_IS_VERSION13(s)) {
                 /*
                  * We encourage applications to only use TLSv1.3 tickets once,
                  * so we remove this one from the cache.
@@ -1519,9 +1513,16 @@ WORK_STATE tls_finish_handshake(SSL_CONNECTION *s, ossl_unused WORK_STATE wst,

         if (SSL_CONNECTION_IS_DTLS(s)) {
             /* done with handshaking */
-            s->d1->handshake_read_seq = 0;
-            s->d1->handshake_write_seq = 0;
-            s->d1->next_handshake_write_seq = 0;
+            /*
+             * In DTLS 1.3, we must not reset the handshake sequence numbers
+             * because post-handshake messages like NewSessionTicket need to
+             * continue the sequence numbering from where the handshake left off.
+             */
+            if (!SSL_CONNECTION_IS_DTLS13(s)) {
+                s->d1->handshake_read_seq = 0;
+                s->d1->handshake_write_seq = 0;
+                s->d1->next_handshake_write_seq = 0;
+            }
             dtls1_clear_received_buffer(s);
         }
     }
@@ -1536,7 +1537,7 @@ WORK_STATE tls_finish_handshake(SSL_CONNECTION *s, ossl_unused WORK_STATE wst,

     if (cb != NULL) {
         if (cleanuphand
-            || !SSL_CONNECTION_IS_TLS13(s)
+            || !SSL_CONNECTION_IS_VERSION13(s)
             || SSL_IS_FIRST_HANDSHAKE(s))
             cb(ssl, SSL_CB_HANDSHAKE_DONE, 1);
     }
@@ -1550,6 +1551,23 @@ WORK_STATE tls_finish_handshake(SSL_CONNECTION *s, ossl_unused WORK_STATE wst,
     return WORK_FINISHED_STOP;
 }

+/*
+ * TLS 1.3 reserves handshake message type 0, so a HelloRequest must reach the
+ * state machine and be rejected there whenever TLS 1.3 is still possible.
+ *
+ * By the time a client reads a server handshake message, s->version is either
+ * the configured maximum for an initial pre-ServerHello handshake, or the
+ * already negotiated version after ServerHello or during renegotiation. Skip
+ * only when that version is below TLS 1.3.
+ */
+static int should_skip_hello_request(const SSL_CONNECTION *s)
+{
+    if (SSL_CONNECTION_IS_TLS13(s))
+        return 0;
+
+    return s->version > 0 && s->version < TLS1_3_VERSION;
+}
+
 int tls_get_message_header(SSL_CONNECTION *s, int *mt)
 {
     /* s->init_num < SSL3_HM_HEADER_LENGTH */
@@ -1609,7 +1627,8 @@ int tls_get_message_header(SSL_CONNECTION *s, int *mt)
         skip_message = 0;
         if (!s->server)
             if (s->statem.hand_state != TLS_ST_OK
-                && p[0] == SSL3_MT_HELLO_REQUEST)
+                && p[0] == SSL3_MT_HELLO_REQUEST
+                && should_skip_hello_request(s))
                 /*
                  * The server may always send 'Hello Request' messages --
                  * we are doing a handshake anyway now, so ignore them if
@@ -1631,32 +1650,16 @@ int tls_get_message_header(SSL_CONNECTION *s, int *mt)
     *mt = *p;
     s->s3.tmp.message_type = *(p++);

-    if (RECORD_LAYER_is_sslv2_record(&s->rlayer)) {
-        /*
-         * Only happens with SSLv3+ in an SSLv2 backward compatible
-         * ClientHello
-         *
-         * Total message size is the remaining record bytes to read
-         * plus the SSL3_HM_HEADER_LENGTH bytes that we already read
-         */
-        l = s->rlayer.tlsrecs[0].length + SSL3_HM_HEADER_LENGTH;
-        s->s3.tmp.message_size = l;
-
-        s->init_msg = s->init_buf->data;
-        s->init_num = SSL3_HM_HEADER_LENGTH;
-    } else {
-        n2l3(p, l);
-        /* BUF_MEM_grow takes an 'int' parameter */
-        if (l > (INT_MAX - SSL3_HM_HEADER_LENGTH)) {
-            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
-                SSL_R_EXCESSIVE_MESSAGE_SIZE);
-            return 0;
-        }
-        s->s3.tmp.message_size = l;
-
-        s->init_msg = s->init_buf->data + SSL3_HM_HEADER_LENGTH;
-        s->init_num = 0;
+    n2l3(p, l);
+    /* BUF_MEM_grow takes an 'int' parameter */
+    if (l > (INT_MAX - SSL3_HM_HEADER_LENGTH)) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_EXCESSIVE_MESSAGE_SIZE);
+        return 0;
     }
+    s->s3.tmp.message_size = l;
+
+    s->init_msg = s->init_buf->data + SSL3_HM_HEADER_LENGTH;
+    s->init_num = 0;

     return 1;
 }
@@ -1677,6 +1680,52 @@ static int grow_init_buf(SSL_CONNECTION *s, size_t size)
     return 1;
 }

+int tls_common_finish_mac(SSL_CONNECTION *s)
+{
+    unsigned char *msg = (unsigned char *)s->init_buf->data;
+    size_t msg_len = s->init_num;
+    size_t hdr_len = 0;
+
+    if (SSL_CONNECTION_IS_DTLS(s)) {
+        if (s->version != DTLS1_BAD_VER)
+            hdr_len = DTLS1_HM_HEADER_LENGTH;
+        else
+            msg += DTLS1_HM_HEADER_LENGTH;
+    } else {
+        hdr_len = SSL3_HM_HEADER_LENGTH;
+    }
+
+    msg_len += hdr_len;
+
+    /* Feed this message into MAC computation. */
+
+    /*
+     * We defer feeding in the HRR until later. We'll do it as part of
+     * the message processing.
+     * The (D)TLSv1.3 handshake transcript stops at the ClientFinished
+     * message.
+     */
+    const size_t srvhellorandom_offs = hdr_len + 2;
+
+    /* KeyUpdate and NewSessionTicket do not need to be added */
+    if (!SSL_CONNECTION_IS_VERSION13(s)
+        || (s->s3.tmp.message_type != SSL3_MT_NEWSESSION_TICKET
+            && s->s3.tmp.message_type != SSL3_MT_KEY_UPDATE)) {
+        if (s->s3.tmp.message_type != SSL3_MT_SERVER_HELLO
+            || s->init_num < srvhellorandom_offs + SSL3_RANDOM_SIZE
+            || memcmp(hrrrandom,
+                   s->init_buf->data + srvhellorandom_offs,
+                   SSL3_RANDOM_SIZE)
+                != 0) {
+            if (!ssl3_finish_mac(s, msg, msg_len))
+                /* SSLfatal() already called */
+                return 0;
+        }
+    }
+
+    return 1;
+}
+
 int tls_get_message_body(SSL_CONNECTION *s, size_t *len)
 {
     size_t toread, readbytes;
@@ -1727,49 +1776,17 @@ int tls_get_message_body(SSL_CONNECTION *s, size_t *len)
         return 0;
     }

-    /* Feed this message into MAC computation. */
-    if (RECORD_LAYER_is_sslv2_record(&s->rlayer)) {
-        if (!ssl3_finish_mac(s, (unsigned char *)s->init_buf->data,
-                s->init_num)) {
-            /* SSLfatal() already called */
-            *len = 0;
-            return 0;
-        }
-        if (s->msg_callback)
-            s->msg_callback(0, SSL2_VERSION, 0, s->init_buf->data,
-                (size_t)s->init_num, ussl, s->msg_callback_arg);
-    } else {
-        /*
-         * We defer feeding in the HRR until later. We'll do it as part of
-         * processing the message
-         * The TLsv1.3 handshake transcript stops at the ClientFinished
-         * message.
-         */
-#define SERVER_HELLO_RANDOM_OFFSET (SSL3_HM_HEADER_LENGTH + 2)
-        /* KeyUpdate and NewSessionTicket do not need to be added */
-        if (!SSL_CONNECTION_IS_TLS13(s)
-            || (s->s3.tmp.message_type != SSL3_MT_NEWSESSION_TICKET
-                && s->s3.tmp.message_type != SSL3_MT_KEY_UPDATE)) {
-            if (s->s3.tmp.message_type != SSL3_MT_SERVER_HELLO
-                || s->init_num < SERVER_HELLO_RANDOM_OFFSET + SSL3_RANDOM_SIZE
-                || memcmp(hrrrandom,
-                       s->init_buf->data + SERVER_HELLO_RANDOM_OFFSET,
-                       SSL3_RANDOM_SIZE)
-                    != 0) {
-                if (!ssl3_finish_mac(s, (unsigned char *)s->init_buf->data,
-                        s->init_num + SSL3_HM_HEADER_LENGTH)) {
-                    /* SSLfatal() already called */
-                    *len = 0;
-                    return 0;
-                }
-            }
-        }
-        if (s->msg_callback)
-            s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->init_buf->data,
-                (size_t)s->init_num + SSL3_HM_HEADER_LENGTH, ussl,
-                s->msg_callback_arg);
+    if (!tls_common_finish_mac(s)) {
+        /* SSLfatal() already called */
+        *len = 0;
+        return 0;
     }

+    if (s->msg_callback)
+        s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->init_buf->data,
+            (size_t)s->init_num + SSL3_HM_HEADER_LENGTH, ussl,
+            s->msg_callback_arg);
+
     *len = s->init_num;
     return 1;
 }
@@ -1887,21 +1904,21 @@ static const version_info tls_version_table[] = {
     { TLS1_VERSION, tlsv1_client_method, tlsv1_server_method },
 #else
     { TLS1_VERSION, NULL, NULL },
-#endif
-#ifndef OPENSSL_NO_SSL3
-    { SSL3_VERSION, sslv3_client_method, sslv3_server_method },
-#else
-    { SSL3_VERSION, NULL, NULL },
 #endif
     { 0, NULL, NULL },
 };

-#if DTLS_MAX_VERSION_INTERNAL != DTLS1_2_VERSION
-#error Code needs update for DTLS_method() support beyond DTLS1_2_VERSION.
+#if DTLS_MAX_VERSION_INTERNAL != DTLS1_3_VERSION
+#error Code needs update for DTLS_method() support beyond DTLS1_3_VERSION.
 #endif

 /* Must be in order high to low */
 static const version_info dtls_version_table[] = {
+#ifndef OPENSSL_NO_DTLS1_3
+    { DTLS1_3_VERSION, dtlsv1_3_client_method, dtlsv1_3_server_method },
+#else
+    { DTLS1_3_VERSION, NULL, NULL },
+#endif
 #ifndef OPENSSL_NO_DTLS1_2
     { DTLS1_2_VERSION, dtlsv1_2_client_method, dtlsv1_2_server_method },
 #else
@@ -1985,14 +2002,14 @@ static int is_tls13_capable(const SSL_CONNECTION *s)
         default:
             break;
         }
-        if (!ssl_has_cert(s, i))
+        if (!ssl_has_cert(s, (int)i))
             continue;
         if (i != SSL_PKEY_ECC)
             return 1;
         /*
          * Prior to TLSv1.3 sig algs allowed any curve to be used. TLSv1.3 is
          * more restrictive so check that our sig algs are consistent with this
-         * EC cert. See section 4.2.3 of RFC8446.
+         * EC cert. See section 4.3.3 of RFC9846.
          */
         curve = ssl_get_EC_curve_nid(s->cert->pkeys[SSL_PKEY_ECC].privatekey);
         if (tls_check_sigalg_curve(s, curve))
@@ -2039,7 +2056,7 @@ int ssl_version_supported(const SSL_CONNECTION *s, int version,
             && ssl_version_cmp(s, version, vent->version) == 0
             && ssl_method_error(s, thismeth()) == 0
             && (!s->server
-                || version != TLS1_3_VERSION
+                || (version != TLS1_3_VERSION && version != DTLS1_3_VERSION)
                 || is_tls13_capable(s))) {
             if (meth != NULL)
                 *meth = thismeth();
@@ -2114,7 +2131,7 @@ int ssl_set_version_bound(int method_version, int version, int *bound)
         return 1;
     }

-    valid_tls = version >= SSL3_VERSION && version <= TLS_MAX_VERSION_INTERNAL;
+    valid_tls = version > SSL3_VERSION && version <= TLS_MAX_VERSION_INTERNAL;
     valid_dtls =
         /* We support client side pre-standardisation version of DTLS */
         (version == DTLS1_BAD_VER)
@@ -2157,23 +2174,27 @@ int ssl_set_version_bound(int method_version, int version, int *bound)

 static void check_for_downgrade(SSL_CONNECTION *s, int vers, DOWNGRADE *dgrd)
 {
-    if (vers == TLS1_2_VERSION
-        && ssl_version_supported(s, TLS1_3_VERSION, NULL)) {
+    int version12 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_2_VERSION : TLS1_2_VERSION;
+    int version13 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;
+
+    if (vers == version12 && ssl_version_supported(s, version13, NULL)) {
         *dgrd = DOWNGRADE_TO_1_2;
-    } else if (!SSL_CONNECTION_IS_DTLS(s)
-        && vers < TLS1_2_VERSION
+    } else if (ssl_version_cmp(s, vers, version12) < 0
         /*
-         * We need to ensure that a server that disables TLSv1.2
-         * (creating a hole between TLSv1.3 and TLSv1.1) can still
-         * complete handshakes with clients that support TLSv1.2 and
-         * below. Therefore we do not enable the sentinel if TLSv1.3 is
-         * enabled and TLSv1.2 is not.
+         * We need to ensure that a server that disables (D)TLSv1.2
+         * (creating a hole between (D)TLSv1.3 and (D)TLSv1.1) can still
+         * complete handshakes with clients that support (D)TLSv1.2 and
+         * below. Therefore we do not enable the sentinel if (D)TLSv1.3 is
+         * enabled and (D)TLSv1.2 is not.
          */
-        && ssl_version_supported(s, TLS1_2_VERSION, NULL)) {
+        && ssl_version_supported(s, version12, NULL)) {
         *dgrd = DOWNGRADE_TO_1_1;
     } else {
         *dgrd = DOWNGRADE_NONE;
     }
+
+    if (SSL_CONNECTION_IS_DTLS(s))
+        s->d1->downgrade_after_hvr = *dgrd;
 }

 /*
@@ -2204,15 +2225,35 @@ int ssl_choose_server_version(SSL_CONNECTION *s, CLIENTHELLO_MSG *hello,
     const version_info *table;
     int disabled = 0;
     RAW_EXTENSION *suppversions;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION
+                                                     : TLS1_3_VERSION;
+    const int version1_2 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_2_VERSION
+                                                     : TLS1_2_VERSION;
+
+    if (client_version <= 0)
+        return SSL_R_WRONG_SSL_VERSION;

     s->client_version = client_version;

     switch (server_version) {
     default:
-        if (!SSL_CONNECTION_IS_TLS13(s)) {
+        if (!SSL_CONNECTION_IS_VERSION13(s)) {
             if (ssl_version_cmp(s, client_version, s->version) < 0)
                 return SSL_R_WRONG_SSL_VERSION;
-            *dgrd = DOWNGRADE_NONE;
+
+            /*
+             * The downgrade sentinel is selected when parsing the first
+             * ClientHello. If this server has sent a HelloVerifyRequest, the
+             * sentinel is recovered while parsing the second ClientHello in
+             * order to apply it to the ServerHello random value.
+             */
+            if (SSL_CONNECTION_IS_DTLS(s)
+                && s->d1->hello_verify_request != SSL_HVR_NONE) {
+                *dgrd = s->d1->downgrade_after_hvr;
+            } else {
+                *dgrd = DOWNGRADE_NONE;
+            }
+
             /*
              * If this SSL handle is not from a version flexible method we don't
              * (and never did) check min/max FIPS or Suite B constraints.  Hope
@@ -2237,13 +2278,27 @@ int ssl_choose_server_version(SSL_CONNECTION *s, CLIENTHELLO_MSG *hello,

     suppversions = &hello->pre_proc_exts[TLSEXT_IDX_supported_versions];

+#ifndef OPENSSL_NO_ECH
+    /*
+     * Check we're dealing with a TLSv1.3 connection when ECH has
+     * succeeded, and not with a smuggled earlier version ClientHello
+     * (which could be a form of attack).
+     * This bit checks there is a supported version present, a little
+     * bit further below, we check that that version is TLSv1.3
+     */
+    if (!suppversions->present && s->ext.ech.success == 1)
+        return SSL_R_UNSUPPORTED_PROTOCOL;
+#endif
+
     /* If we did an HRR then supported versions is mandatory */
     if (!suppversions->present && s->hello_retry_request != SSL_HRR_NONE)
         return SSL_R_UNSUPPORTED_PROTOCOL;

-    if (suppversions->present && !SSL_CONNECTION_IS_DTLS(s)) {
-        unsigned int candidate_vers = 0;
-        unsigned int best_vers = 0;
+    if (suppversions->present) {
+        int candidate_vers = 0;
+        const int best_vers_init = SSL_CONNECTION_IS_DTLS(s) ? INT_MAX
+                                                             : 0;
+        int best_vers = best_vers_init;
         const SSL_METHOD *best_method = NULL;
         PACKET versionslist;

@@ -2266,9 +2321,23 @@ int ssl_choose_server_version(SSL_CONNECTION *s, CLIENTHELLO_MSG *hello,
         if (client_version <= SSL3_VERSION)
             return SSL_R_BAD_LEGACY_VERSION;

-        while (PACKET_get_net_2(&versionslist, &candidate_vers)) {
-            if (ssl_version_cmp(s, candidate_vers, best_vers) <= 0)
+        while (PACKET_get_net_2(&versionslist, (unsigned int *)&candidate_vers)) {
+            if (candidate_vers <= 0
+                || (best_vers != best_vers_init
+                    && ssl_version_cmp(s, candidate_vers, best_vers) <= 0))
+                continue;
+#ifndef OPENSSL_NO_SCTP
+            /*
+             * DTLS 1.3 is not supported over SCTP.  If the client offers
+             * DTLSv1.3 but the transport is SCTP, thus fall back to
+             * DTLSv1.2 (or lower) during server-version selection.
+             */
+            if (SSL_CONNECTION_IS_DTLS(s)
+                && candidate_vers == DTLS1_3_VERSION
+                && BIO_dgram_is_sctp(SSL_get_wbio(
+                    SSL_CONNECTION_GET_SSL(s))))
                 continue;
+#endif
             if (ssl_version_supported(s, candidate_vers, &best_method))
                 best_vers = candidate_vers;
         }
@@ -2277,13 +2346,19 @@ int ssl_choose_server_version(SSL_CONNECTION *s, CLIENTHELLO_MSG *hello,
             return SSL_R_LENGTH_MISMATCH;
         }

-        if (best_vers > 0) {
+        /* Did best_vers change from the initial value? */
+        if (best_vers != best_vers_init) {
+#ifndef OPENSSL_NO_ECH
+            /* ECH needs TLSV1.3 also */
+            if (s->ext.ech.success == 1 && best_vers != TLS1_3_VERSION)
+                return SSL_R_UNSUPPORTED_PROTOCOL;
+#endif
             if (s->hello_retry_request != SSL_HRR_NONE) {
                 /*
                  * This is after a HelloRetryRequest so we better check that we
-                 * negotiated TLSv1.3
+                 * negotiated (D)TLSv1.3
                  */
-                if (best_vers != TLS1_3_VERSION)
+                if (best_vers != version1_3)
                     return SSL_R_UNSUPPORTED_PROTOCOL;
                 return 0;
             }
@@ -2300,10 +2375,10 @@ int ssl_choose_server_version(SSL_CONNECTION *s, CLIENTHELLO_MSG *hello,

     /*
      * If the supported versions extension isn't present, then the highest
-     * version we can negotiate is TLSv1.2
+     * version we can negotiate is (D)TLSv1.2
      */
-    if (ssl_version_cmp(s, client_version, TLS1_3_VERSION) >= 0)
-        client_version = TLS1_2_VERSION;
+    if (ssl_version_cmp(s, client_version, version1_3) >= 0)
+        client_version = version1_2;

     /*
      * No supported versions extension, so we just use the version supplied in
@@ -2347,6 +2422,8 @@ int ssl_choose_client_version(SSL_CONNECTION *s, int version,
     const version_info *table;
     int ret, ver_min, ver_max, real_max, origv;
     SSL *ssl = SSL_CONNECTION_GET_SSL(s);
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION
+                                                     : TLS1_3_VERSION;

     origv = s->version;
     s->version = version;
@@ -2361,13 +2438,27 @@ int ssl_choose_client_version(SSL_CONNECTION *s, int version,
         return 0;
     }

-    if (s->hello_retry_request != SSL_HRR_NONE
-        && s->version != TLS1_3_VERSION) {
+    if (s->hello_retry_request != SSL_HRR_NONE && s->version != version1_3) {
         s->version = origv;
         SSLfatal(s, SSL_AD_PROTOCOL_VERSION, SSL_R_WRONG_SSL_VERSION);
         return 0;
     }

+#ifndef OPENSSL_NO_SCTP
+    /*
+     * DTLS 1.3 over SCTP is not supported.  If the server selected
+     * DTLSv1.3 but the transport is SCTP, treat it as a protocol
+     * version mismatch so the handshake is aborted cleanly.
+     */
+    if (SSL_CONNECTION_IS_DTLS(s)
+        && s->version == DTLS1_3_VERSION
+        && BIO_dgram_is_sctp(SSL_get_wbio(ssl))) {
+        s->version = origv;
+        SSLfatal(s, SSL_AD_PROTOCOL_VERSION, SSL_R_UNSUPPORTED_PROTOCOL);
+        return 0;
+    }
+#endif
+
     switch (ssl->method->version) {
     default:
         if (s->version != ssl->method->version) {
@@ -2412,8 +2503,7 @@ int ssl_choose_client_version(SSL_CONNECTION *s, int version,
         real_max = ver_max;

     /* Check for downgrades */
-    /* TODO(DTLSv1.3): Update this code for DTLSv1.3 */
-    if (!SSL_CONNECTION_IS_DTLS(s) && real_max > s->version) {
+    if (ssl_version_cmp(s, real_max, s->version) > 0) {
         /* Signal applies to all versions */
         if (memcmp(tls11downgrade,
                 s->s3.server_random + SSL3_RANDOM_SIZE
@@ -2425,8 +2515,8 @@ int ssl_choose_client_version(SSL_CONNECTION *s, int version,
                 SSL_R_INAPPROPRIATE_FALLBACK);
             return 0;
         }
-        /* Only when accepting TLS1.3 */
-        if (real_max == TLS1_3_VERSION
+        /* Only when accepting (D)TLS1.3 */
+        if (ssl_version_cmp(s, s->version, version1_3)
             && memcmp(tls12downgrade,
                    s->s3.server_random + SSL3_RANDOM_SIZE
                        - sizeof(tls12downgrade),
@@ -2548,6 +2638,18 @@ int ssl_get_min_max_version(const SSL_CONNECTION *s, int *min_version,
             tmp_real_max = 0;
             continue;
         }
+/*
+ * DTLS 1.3 over SCTP is not supported.  RFC 6083 and its successors only
+ * define key-material export for DTLS 1.2 and below.
+ */
+#ifndef OPENSSL_NO_SCTP
+        if (SSL_CONNECTION_IS_DTLS(s) && DTLS_VERSION_GT(vent->version, DTLS1_2_VERSION)) {
+            BIO *wbio = SSL_get_wbio(SSL_CONNECTION_GET_SSL(s));
+
+            if (wbio != NULL && BIO_dgram_is_sctp(wbio))
+                continue;
+        }
+#endif
         method = vent->cmeth();

         if (hole == 1 && tmp_real_max == 0)
@@ -2586,6 +2688,7 @@ int ssl_get_min_max_version(const SSL_CONNECTION *s, int *min_version,
 int ssl_set_client_hello_version(SSL_CONNECTION *s)
 {
     int ver_min, ver_max, ret;
+    const int version1_2 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_2_VERSION : TLS1_2_VERSION;

     /*
      * In a renegotiation we always send the same client_version that we sent
@@ -2601,21 +2704,19 @@ int ssl_set_client_hello_version(SSL_CONNECTION *s)

     s->version = ver_max;

-    if (SSL_CONNECTION_IS_DTLS(s)) {
-        if (ver_max == DTLS1_BAD_VER) {
-            /*
-             * Even though this is technically before version negotiation,
-             * because we have asked for DTLS1_BAD_VER we will never negotiate
-             * anything else, and this has impacts on the record layer for when
-             * we read the ServerHello. So we need to tell the record layer
-             * about this immediately.
-             */
-            if (!ssl_set_record_protocol_version(s, ver_max))
-                return 0;
-        }
-    } else if (ver_max > TLS1_2_VERSION) {
-        /* TLS1.3 always uses TLS1.2 in the legacy_version field */
-        ver_max = TLS1_2_VERSION;
+    if (SSL_CONNECTION_IS_DTLS(s) && ver_max == DTLS1_BAD_VER) {
+        /*
+         * Even though this is technically before version negotiation,
+         * because we have asked for DTLS1_BAD_VER we will never negotiate
+         * anything else, and this has impacts on the record layer for when
+         * we read the ServerHello. So we need to tell the record layer
+         * about this immediately.
+         */
+        if (!ssl_set_record_protocol_version(s, ver_max))
+            return 0;
+    } else if (ssl_version_cmp(s, ver_max, version1_2) > 0) {
+        /* (D)TLS1.3 always uses (D)TLS1.2 in the legacy_version field */
+        ver_max = version1_2;
     }

     s->client_version = ver_max;
@@ -2658,21 +2759,27 @@ int create_synthetic_message_hash(SSL_CONNECTION *s,
     size_t hashlen, const unsigned char *hrr,
     size_t hrrlen)
 {
-    unsigned char hashvaltmp[EVP_MAX_MD_SIZE];
-    unsigned char msghdr[SSL3_HM_HEADER_LENGTH];
+    unsigned char *hashvaltmp;
+    unsigned char synmsg[SSL3_HM_HEADER_LENGTH + EVP_MAX_MD_SIZE];
+    size_t currmsghdr_len = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_HM_HEADER_LENGTH
+                                                      : SSL3_HM_HEADER_LENGTH;

-    memset(msghdr, 0, sizeof(msghdr));
+    memset(synmsg, 0, SSL3_HM_HEADER_LENGTH);
+    hashvaltmp = synmsg + SSL3_HM_HEADER_LENGTH;

     if (hashval == NULL) {
-        hashval = hashvaltmp;
-        hashlen = 0;
         /* Get the hash of the initial ClientHello */
         if (!ssl3_digest_cached_records(s, 0)
-            || !ssl_handshake_hash(s, hashvaltmp, sizeof(hashvaltmp),
+            || !ssl_handshake_hash(s, hashvaltmp, EVP_MAX_MD_SIZE,
                 &hashlen)) {
             /* SSLfatal() already called */
             return 0;
         }
+    } else {
+        if (!ossl_assert(hashlen <= EVP_MAX_MD_SIZE))
+            return 0;
+
+        memcpy(hashvaltmp, hashval, hashlen);
     }

     /* Reinitialise the transcript hash */
@@ -2682,10 +2789,9 @@ int create_synthetic_message_hash(SSL_CONNECTION *s,
     }

     /* Inject the synthetic message_hash message */
-    msghdr[0] = SSL3_MT_MESSAGE_HASH;
-    msghdr[SSL3_HM_HEADER_LENGTH - 1] = (unsigned char)hashlen;
-    if (!ssl3_finish_mac(s, msghdr, SSL3_HM_HEADER_LENGTH)
-        || !ssl3_finish_mac(s, hashval, hashlen)) {
+    synmsg[0] = SSL3_MT_MESSAGE_HASH;
+    synmsg[SSL3_HM_HEADER_LENGTH - 1] = (unsigned char)hashlen;
+    if (!ssl3_finish_mac(s, synmsg, SSL3_HM_HEADER_LENGTH + hashlen)) {
         /* SSLfatal() already called */
         return 0;
     }
@@ -2698,8 +2804,7 @@ int create_synthetic_message_hash(SSL_CONNECTION *s,
     if (hrr != NULL
         && (!ssl3_finish_mac(s, hrr, hrrlen)
             || !ssl3_finish_mac(s, (unsigned char *)s->init_buf->data,
-                s->s3.tmp.message_size
-                    + SSL3_HM_HEADER_LENGTH))) {
+                s->s3.tmp.message_size + currmsghdr_len))) {
         /* SSLfatal() already called */
         return 0;
     }
@@ -2959,8 +3064,9 @@ MSG_PROCESS_RETURN tls13_process_compressed_certificate(SSL_CONNECTION *sc,

     if (!BUF_MEM_grow(buf, expected_length)
         || !PACKET_buf_init(tmppkt, (unsigned char *)buf->data, expected_length)
-        || COMP_expand_block(comp, (unsigned char *)buf->data, expected_length,
-               (unsigned char *)PACKET_data(pkt), comp_length)
+        || COMP_expand_block(comp, (unsigned char *)buf->data, (int)expected_length,
+               (unsigned char *)PACKET_data(pkt),
+               (int)comp_length)
             != (int)expected_length) {
         SSLfatal(sc, SSL_AD_BAD_CERTIFICATE, SSL_R_BAD_DECOMPRESSION);
         goto err;
diff --git a/deps/openssl/openssl/ssl/statem/statem_local.h b/deps/openssl/openssl/ssl/statem/statem_local.h
index e1d57eb8c64..744518d89f9 100644
--- a/deps/openssl/openssl/ssl/statem/statem_local.h
+++ b/deps/openssl/openssl/ssl/statem/statem_local.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -14,9 +14,18 @@
  *                                                                           *
  *****************************************************************************/

+#if !defined(OSSL_SSL_STATEM_STATEM_LOCAL_H)
+#define OSSL_SSL_STATEM_STATEM_LOCAL_H
+
+#include <internal/packet.h>
+#include <internal/statem.h>
+
+#include "../ssl_local.h"
+
 /* Max message length definitions */

 /* The spec allows for a longer length than this, but we limit it */
+
 #define HELLO_VERIFY_REQUEST_MAX_LENGTH 258
 #define END_OF_EARLY_DATA_MAX_LENGTH 0
 #define HELLO_RETRY_REQUEST_MAX_LENGTH 20000
@@ -27,11 +36,12 @@
 #define SERVER_HELLO_DONE_MAX_LENGTH 0
 #define KEY_UPDATE_MAX_LENGTH 1
 #define CCS_MAX_LENGTH 1
+#define ACK_MAX_LENGTH 65538

-/* Max ServerHello size permitted by RFC 8446 */
+/* Max ServerHello size permitted by RFC 9846 */
 #define SERVER_HELLO_MAX_LENGTH 65607

-/* Max CertificateVerify size permitted by RFC 8446 */
+/* Max CertificateVerify size permitted by RFC 9846 */
 #define CERTIFICATE_VERIFY_MAX_LENGTH 65539

 /* Max should actually be 36 but we are generous */
@@ -43,6 +53,9 @@
 /* Invalid extension ID for non-supported extensions */
 #define TLSEXT_TYPE_invalid 0x10000
 #define TLSEXT_TYPE_out_of_range 0x10001
+/* RFC 8701 GREASE extension placeholders (actual type is dynamic) */
+#define TLSEXT_TYPE_grease1 0x10002
+#define TLSEXT_TYPE_grease2 0x10003
 unsigned int ossl_get_extension_type(size_t idx);

 extern const unsigned char hrrrandom[];
@@ -92,6 +105,7 @@ MSG_PROCESS_RETURN ossl_statem_client_process_message(SSL_CONNECTION *s,
     PACKET *pkt);
 WORK_STATE ossl_statem_client_post_process_message(SSL_CONNECTION *s,
     WORK_STATE wst);
+int ossl_statem_dtls_client_use_timer(SSL_CONNECTION *s);

 /*
  * TLS/DTLS server state machine functions
@@ -107,12 +121,17 @@ MSG_PROCESS_RETURN ossl_statem_server_process_message(SSL_CONNECTION *s,
     PACKET *pkt);
 WORK_STATE ossl_statem_server_post_process_message(SSL_CONNECTION *s,
     WORK_STATE wst);
+int ossl_statem_dtls_server_use_timer(SSL_CONNECTION *s);

 /* Functions for getting new message data */
 __owur int tls_get_message_header(SSL_CONNECTION *s, int *mt);
 __owur int tls_get_message_body(SSL_CONNECTION *s, size_t *len);
 __owur int dtls_get_message(SSL_CONNECTION *s, int *mt);
 __owur int dtls_get_message_body(SSL_CONNECTION *s, size_t *len);
+int dtls_record_from_retained_epoch(SSL_CONNECTION *s);
+int dtls1_process_out_of_seq_message(SSL_CONNECTION *s,
+    const struct hm_header_st *msg_hdr);
+__owur int tls_common_finish_mac(SSL_CONNECTION *s);

 /* Message construction and processing functions */
 __owur int tls_process_initial_server_flight(SSL_CONNECTION *s);
@@ -123,6 +142,7 @@ __owur CON_FUNC_RETURN tls_construct_change_cipher_spec(SSL_CONNECTION *s,
     WPACKET *pkt);
 __owur CON_FUNC_RETURN dtls_construct_change_cipher_spec(SSL_CONNECTION *s,
     WPACKET *pkt);
+__owur CON_FUNC_RETURN dtls_construct_ack(SSL_CONNECTION *s, WPACKET *pkt);

 __owur CON_FUNC_RETURN tls_construct_finished(SSL_CONNECTION *s, WPACKET *pkt);
 __owur CON_FUNC_RETURN tls_construct_key_update(SSL_CONNECTION *s, WPACKET *pkt);
@@ -148,7 +168,7 @@ __owur MSG_PROCESS_RETURN tls_process_certificate_request(SSL_CONNECTION *s,
     PACKET *pkt);
 __owur MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL_CONNECTION *s,
     PACKET *pkt);
-__owur int tls_process_cert_status_body(SSL_CONNECTION *s, PACKET *pkt);
+__owur int tls_process_cert_status_body(SSL_CONNECTION *s, size_t chainidx, PACKET *pkt);
 __owur MSG_PROCESS_RETURN tls_process_cert_status(SSL_CONNECTION *s,
     PACKET *pkt);
 __owur MSG_PROCESS_RETURN tls_process_server_done(SSL_CONNECTION *s,
@@ -168,7 +188,7 @@ __owur int ssl_do_client_cert_cb(SSL_CONNECTION *s, X509 **px509,
 __owur CON_FUNC_RETURN tls_construct_client_key_exchange(SSL_CONNECTION *s,
     WPACKET *pkt);
 __owur int tls_client_key_exchange_post_work(SSL_CONNECTION *s);
-__owur int tls_construct_cert_status_body(SSL_CONNECTION *s, WPACKET *pkt);
+__owur int tls_construct_cert_status_body(SSL_CONNECTION *s, OCSP_RESPONSE *resp, WPACKET *pkt);
 __owur CON_FUNC_RETURN tls_construct_cert_status(SSL_CONNECTION *s,
     WPACKET *pkt);
 __owur MSG_PROCESS_RETURN tls_process_key_exchange(SSL_CONNECTION *s,
@@ -194,6 +214,7 @@ __owur CON_FUNC_RETURN tls_construct_next_proto(SSL_CONNECTION *s, WPACKET *pkt)
 #endif
 __owur MSG_PROCESS_RETURN tls_process_hello_req(SSL_CONNECTION *s, PACKET *pkt);
 __owur MSG_PROCESS_RETURN dtls_process_hello_verify(SSL_CONNECTION *s, PACKET *pkt);
+__owur MSG_PROCESS_RETURN dtls_process_ack(SSL_CONNECTION *s, PACKET *pkt);
 __owur CON_FUNC_RETURN tls_construct_end_of_early_data(SSL_CONNECTION *s,
     WPACKET *pkt);

@@ -220,6 +241,8 @@ __owur CON_FUNC_RETURN tls_construct_server_done(SSL_CONNECTION *s,
     WPACKET *pkt);
 __owur MSG_PROCESS_RETURN tls_process_client_certificate(SSL_CONNECTION *s,
     PACKET *pkt);
+__owur WORK_STATE tls_post_process_client_certificate(SSL_CONNECTION *s,
+    WORK_STATE wst);
 #ifndef OPENSSL_NO_COMP_ALG
 __owur MSG_PROCESS_RETURN tls_process_client_compressed_certificate(SSL_CONNECTION *sc,
     PACKET *pkt);
@@ -257,6 +280,8 @@ __owur int tls_validate_all_contexts(SSL_CONNECTION *s, unsigned int thisctx,
     RAW_EXTENSION *exts);
 __owur int extension_is_relevant(SSL_CONNECTION *s, unsigned int extctx,
     unsigned int thisctx);
+__owur int tls_validate_no_unknown_extensions(SSL_CONNECTION *s,
+    PACKET *packet, unsigned int context);
 __owur int tls_collect_extensions(SSL_CONNECTION *s, PACKET *packet,
     unsigned int context,
     RAW_EXTENSION **res, size_t *len, int init);
@@ -278,6 +303,7 @@ __owur int tls_psk_do_binder(SSL_CONNECTION *s, const EVP_MD *md,
     SSL_SESSION *sess, int sign, int external);

 /* Server Extension processing */
+__owur int tls_hrr_cookie_required(const SSL_CONNECTION *s);
 int tls_parse_ctos_renegotiate(SSL_CONNECTION *s, PACKET *pkt,
     unsigned int context,
     X509 *x, size_t chainidx);
@@ -294,9 +320,6 @@ int tls_parse_ctos_srp(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
 int tls_parse_ctos_early_data(SSL_CONNECTION *s, PACKET *pkt,
     unsigned int context,
     X509 *x, size_t chainidx);
-int tls_parse_ctos_ec_pt_formats(SSL_CONNECTION *s, PACKET *pkt,
-    unsigned int context,
-    X509 *x, size_t chainidx);
 int tls_parse_ctos_supported_groups(SSL_CONNECTION *s, PACKET *pkt,
     unsigned int context,
     X509 *x, size_t chainidxl);
@@ -478,7 +501,10 @@ EXT_RETURN tls_construct_ctos_psk_kex_modes(SSL_CONNECTION *s, WPACKET *pkt,
 EXT_RETURN tls_construct_ctos_cookie(SSL_CONNECTION *s, WPACKET *pkt,
     unsigned int context,
     X509 *x, size_t chainidx);
-EXT_RETURN tls_construct_ctos_padding(SSL_CONNECTION *s, WPACKET *pkt,
+EXT_RETURN tls_construct_ctos_grease1(SSL_CONNECTION *s, WPACKET *pkt,
+    unsigned int context, X509 *x,
+    size_t chainidx);
+EXT_RETURN tls_construct_ctos_grease2(SSL_CONNECTION *s, WPACKET *pkt,
     unsigned int context, X509 *x,
     size_t chainidx);
 EXT_RETURN tls_construct_ctos_psk(SSL_CONNECTION *s, WPACKET *pkt,
@@ -500,9 +526,6 @@ int tls_parse_stoc_early_data(SSL_CONNECTION *s, PACKET *pkt,
 int tls_parse_stoc_maxfragmentlen(SSL_CONNECTION *s, PACKET *pkt,
     unsigned int context,
     X509 *x, size_t chainidx);
-int tls_parse_stoc_ec_pt_formats(SSL_CONNECTION *s, PACKET *pkt,
-    unsigned int context,
-    X509 *x, size_t chainidx);
 int tls_parse_stoc_session_ticket(SSL_CONNECTION *s, PACKET *pkt,
     unsigned int context,
     X509 *x, size_t chainidx);
@@ -570,3 +593,17 @@ int tls_parse_ctos_server_cert_type(SSL_CONNECTION *sc, PACKET *pkt,
 int tls_parse_stoc_server_cert_type(SSL_CONNECTION *s, PACKET *pkt,
     unsigned int context,
     X509 *x, size_t chainidx);
+#ifndef OPENSSL_NO_ECH
+EXT_RETURN tls_construct_ctos_ech(SSL_CONNECTION *s, WPACKET *pkt,
+    unsigned int context, X509 *x,
+    size_t chainidx);
+int tls_parse_ctos_ech(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
+    X509 *x, size_t chainidx);
+EXT_RETURN tls_construct_stoc_ech(SSL_CONNECTION *s, WPACKET *pkt,
+    unsigned int context, X509 *x,
+    size_t chainidx);
+int tls_parse_stoc_ech(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
+    X509 *x, size_t chainidx);
+#endif
+
+#endif /* !defined(OSSL_SSL_STATEM_STATEM_LOCAL_H) */
diff --git a/deps/openssl/openssl/ssl/statem/statem_srvr.c b/deps/openssl/openssl/ssl/statem/statem_srvr.c
index 03fcc6eeac7..2dd48dfa353 100644
--- a/deps/openssl/openssl/ssl/statem/statem_srvr.c
+++ b/deps/openssl/openssl/ssl/statem/statem_srvr.c
@@ -17,6 +17,7 @@
 #include "internal/constant_time.h"
 #include "internal/cryptlib.h"
 #include "internal/ssl_unwrap.h"
+#include "internal/sizes.h"
 #include <openssl/buffer.h>
 #include <openssl/rand.h>
 #include <openssl/objects.h>
@@ -31,9 +32,14 @@
 #include <openssl/asn1t.h>
 #include <openssl/comp.h>
 #include "internal/comp.h"
+#include <openssl/ocsp.h>

 #define TICKET_NONCE_SIZE 8

+#ifndef OPENSSL_NO_ECH
+#include "../ech/ech_local.h"
+#endif
+
 typedef struct {
     ASN1_TYPE *kxBlob;
     ASN1_TYPE *opaqueBlob;
@@ -69,6 +75,12 @@ static int ossl_statem_server13_read_transition(SSL_CONNECTION *s, int mt)
 {
     OSSL_STATEM *st = &s->statem;

+    if (st->hand_state == TLS_ST_SR_ACK) {
+        st->hand_state = st->pre_ack_hand_state;
+        if (mt == SSL3_MT_DUMMY)
+            return 1;
+    }
+
     /*
      * Note: There is no case for TLS_ST_BEFORE because at that stage we have
      * not negotiated TLSv1.3 yet, so that case is handled by
@@ -85,6 +97,10 @@ static int ossl_statem_server13_read_transition(SSL_CONNECTION *s, int mt)
                 return 1;
             }
             break;
+            /*
+             * RFC 9147 Section 5.6 states DTLS1.3 should omit the
+             * End of Early Data Message
+             */
         } else if (s->ext.early_data == SSL_EARLY_DATA_ACCEPTED
             && !SSL_NO_EOED(s)) {
             if (mt == SSL3_MT_END_OF_EARLY_DATA) {
@@ -92,6 +108,11 @@ static int ossl_statem_server13_read_transition(SSL_CONNECTION *s, int mt)
                 return 1;
             }
             break;
+        } else if (SSL_CONNECTION_IS_DTLS13(s) && s->ext.early_data == SSL_EARLY_DATA_ACCEPTED) {
+            /*
+             * Let DTLS1.3 fallthrough to the Finished processing below
+             */
+            s->early_data_state = SSL_EARLY_DATA_FINISHED_READING;
         }
         /* Fall through */

@@ -119,7 +140,7 @@ static int ossl_statem_server13_read_transition(SSL_CONNECTION *s, int mt)

     case TLS_ST_SR_COMP_CERT:
     case TLS_ST_SR_CERT:
-        if (!received_client_cert(s)) {
+        if (st->no_cert_verify || !received_client_cert(s)) {
             if (mt == SSL3_MT_FINISHED) {
                 st->hand_state = TLS_ST_SR_FINISHED;
                 return 1;
@@ -139,6 +160,15 @@ static int ossl_statem_server13_read_transition(SSL_CONNECTION *s, int mt)
         }
         break;

+    case TLS_ST_SW_KEY_UPDATE:
+    case TLS_ST_SW_SESSION_TICKET:
+        if (mt == DTLS13_MT_ACK) {
+            st->pre_ack_hand_state = st->hand_state;
+            st->hand_state = TLS_ST_SR_ACK;
+            return 1;
+        }
+        break;
+
     case TLS_ST_OK:
         /*
          * Its never ok to start processing handshake messages in the middle of
@@ -165,6 +195,12 @@ static int ossl_statem_server13_read_transition(SSL_CONNECTION *s, int mt)
             st->hand_state = TLS_ST_SR_KEY_UPDATE;
             return 1;
         }
+
+        if (mt == DTLS13_MT_ACK) {
+            st->pre_ack_hand_state = st->hand_state;
+            st->hand_state = TLS_ST_SR_ACK;
+            return 1;
+        }
         break;
     }

@@ -185,7 +221,7 @@ int ossl_statem_server_read_transition(SSL_CONNECTION *s, int mt)
 {
     OSSL_STATEM *st = &s->statem;

-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         if (!ossl_statem_server13_read_transition(s, mt))
             goto err;
         return 1;
@@ -209,30 +245,10 @@ int ossl_statem_server_read_transition(SSL_CONNECTION *s, int mt)
          * If we get a CKE message after a ServerDone then either
          * 1) We didn't request a Certificate
          * OR
-         * 2) If we did request one then
-         *      a) We allow no Certificate to be returned
-         *      AND
-         *      b) We are running SSL3 (in TLS1.0+ the client must return a 0
-         *         list if we requested a certificate)
+         * 2) We did request one and we allow no Certificate to be returned
          */
         if (mt == SSL3_MT_CLIENT_KEY_EXCHANGE) {
-            if (s->s3.tmp.cert_request) {
-                if (s->version == SSL3_VERSION) {
-                    if ((s->verify_mode & SSL_VERIFY_PEER)
-                        && (s->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)) {
-                        /*
-                         * This isn't an unexpected message as such - we're just
-                         * not going to accept it because we require a client
-                         * cert.
-                         */
-                        SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE,
-                            SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE);
-                        return 0;
-                    }
-                    st->hand_state = TLS_ST_SR_KEY_EXCH;
-                    return 1;
-                }
-            } else {
+            if (!s->s3.tmp.cert_request) {
                 st->hand_state = TLS_ST_SR_KEY_EXCH;
                 return 1;
             }
@@ -323,20 +339,6 @@ int ossl_statem_server_read_transition(SSL_CONNECTION *s, int mt)

 err:
     /* No valid transition found */
-    if (SSL_CONNECTION_IS_DTLS(s) && mt == SSL3_MT_CHANGE_CIPHER_SPEC) {
-        BIO *rbio;
-
-        /*
-         * CCS messages don't have a message sequence number so this is probably
-         * because of an out-of-order CCS. We'll just drop it.
-         */
-        s->init_num = 0;
-        s->rwstate = SSL_READING;
-        rbio = SSL_get_rbio(SSL_CONNECTION_GET_SSL(s));
-        BIO_clear_retry_flags(rbio);
-        BIO_set_retry_read(rbio);
-        return 0;
-    }
     SSLfatal(s, SSL3_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
     return 0;
 }
@@ -420,7 +422,7 @@ int send_certificate_request(SSL_CONNECTION *s)
          * don't request if post-handshake-only unless doing
          * post-handshake in TLSv1.3:
          */
-        && (!SSL_CONNECTION_IS_TLS13(s)
+        && (!SSL_CONNECTION_IS_VERSION13(s)
             || !(s->verify_mode & SSL_VERIFY_POST_HANDSHAKE)
             || s->post_handshake_auth == SSL_PHA_REQUEST_PENDING)
         /*
@@ -453,6 +455,148 @@ int send_certificate_request(SSL_CONNECTION *s)
     return 0;
 }

+/*
+ * Get the OCSP response for the certificate from the chain identified
+ * chainidx.
+ * If no OCSP response could be found NULL is returned.
+ */
+OCSP_RESPONSE *ossl_get_ocsp_response(SSL_CONNECTION *s, int chainidx)
+{
+    OCSP_RESPONSE *resp = NULL;
+#ifndef OPENSSL_NO_OCSP
+    int i = 0, num = 0;
+    unsigned int len;
+    X509 *x = NULL;
+    STACK_OF(X509) *chain_certs = NULL;
+    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
+    OCSP_BASICRESP *bs = NULL;
+    OCSP_SINGLERESP *sr = NULL;
+    OCSP_CERTID *cid = NULL;
+    OCSP_CERTID *sr_cert_id = NULL;
+    ASN1_OBJECT *cert_id_md_oid;
+    char cert_id_md_txt[OSSL_MAX_NAME_SIZE];
+    EVP_MD *cert_id_md;
+    ASN1_INTEGER *respSerial;
+    ASN1_OCTET_STRING *respIssuerNameHash = NULL;
+    ASN1_OCTET_STRING *certIssuerNameHash = NULL;
+    const X509_NAME *certIssuerName;
+    unsigned char md[EVP_MAX_MD_SIZE];
+    const ASN1_INTEGER *certSerial;
+    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+
+    /*
+     * In TLSv1.3 the caller gives the index of the certificate for which the
+     * status message should be created.
+     * Prior to TLSv1.3 the chain index is 0 and the body should contain only
+     * the status of the server certificate itself.
+     */
+    SSL_get0_chain_certs(ssl, &chain_certs);
+
+    /*
+     * If the certificate chain was built, get the status message for the
+     * requested certificate specified by chainidx.
+     * SSL_get0_chain_certs provides certificate chain except the server cert.
+     *
+     * if chainidx = 0 the server certificate is requested
+     * if chainidx > 0 an intermediate certificate is requested
+     */
+    if (chainidx == 0)
+        x = SSL_get_certificate(ssl);
+    else
+        x = sk_X509_value(chain_certs, chainidx - 1);
+    if (x == NULL)
+        return NULL;
+
+    /* for a selfsigned certificate there will be no OCSP response */
+    if (X509_self_signed(x, 0))
+        return NULL;
+
+    if ((resp = sk_OCSP_RESPONSE_value(s->ext.ocsp.resp_ex, chainidx)) != NULL) {
+        /*
+         * Find the corresponding single OCSP response by comparing the current
+         * certificate's serial number, and the hash of the current certificate's
+         * issuer name, to the serial number and issuer name hash in each OCSP
+         * response received.
+         */
+        if (OCSP_response_status(resp) == OCSP_RESPONSE_STATUS_SUCCESSFUL) {
+            /*
+             * Set a mark for the error queue here to be able to ignore errors
+             * happening because of test cases.
+             */
+            ERR_set_mark();
+            bs = OCSP_response_get1_basic(resp);
+            if (bs != NULL && (sr = OCSP_resp_get0(bs, 0)) != NULL) {
+                /* use the first single response to get the algorithm used */
+                cid = (OCSP_CERTID *)OCSP_SINGLERESP_get0_id(sr);
+
+                /* determine the md algorithm which was used to create cert id */
+                OCSP_id_get0_info(&respIssuerNameHash, &cert_id_md_oid, NULL, &respSerial, cid);
+                if (cert_id_md_oid != NULL) {
+                    OBJ_obj2txt(cert_id_md_txt, sizeof(cert_id_md_txt), cert_id_md_oid, 0);
+                    cert_id_md = EVP_MD_fetch(sctx->libctx, cert_id_md_txt, sctx->propq);
+                } else {
+                    cert_id_md = EVP_MD_fetch(sctx->libctx, SN_sha1, sctx->propq);
+                }
+
+                if (cert_id_md == NULL) {
+                    OCSP_BASICRESP_free(bs);
+                    ERR_clear_last_mark();
+                    return NULL;
+                }
+
+                /* get serial number and issuer name hash of the certificate from the chain */
+                certSerial = X509_get0_serialNumber(x);
+                certIssuerName = X509_get_issuer_name(x);
+                certIssuerNameHash = ASN1_OCTET_STRING_new();
+                if (!X509_NAME_digest(certIssuerName, cert_id_md, md, &len) || !(ASN1_OCTET_STRING_set(certIssuerNameHash, md, len))) {
+                    ASN1_OCTET_STRING_free(certIssuerNameHash);
+                    OCSP_BASICRESP_free(bs);
+                    EVP_MD_free(cert_id_md);
+                    ERR_clear_last_mark();
+                    return NULL;
+                }
+
+                num = OCSP_resp_count(bs);
+                for (i = 0; i < num; i++) {
+                    sr = OCSP_resp_get0(bs, i);
+
+                    /*
+                     * get the CertID from the OCSP response to compare it with the information
+                     * from the certificate
+                     */
+                    sr_cert_id = (OCSP_CERTID *)OCSP_SINGLERESP_get0_id(sr);
+
+                    OCSP_id_get0_info(&respIssuerNameHash, NULL, NULL, &respSerial, sr_cert_id);
+
+                    if (!ASN1_INTEGER_cmp(certSerial, respSerial) && !ASN1_OCTET_STRING_cmp(certIssuerNameHash, respIssuerNameHash))
+                        break;
+                }
+
+                ASN1_OCTET_STRING_free(certIssuerNameHash);
+                OCSP_BASICRESP_free(bs);
+                EVP_MD_free(cert_id_md);
+
+                /*
+                 * if we did not find the right single response we return NULL here
+                 */
+                if (i == num)
+                    resp = NULL;
+            } else {
+                OCSP_BASICRESP_free(bs);
+            }
+
+            /*
+             * in a test case a response without a basic response is used the error set
+             * could be ignored here
+             */
+            ERR_pop_to_mark();
+        }
+    }
+#endif
+
+    return resp;
+}
+
 static int do_compressed_cert(SSL_CONNECTION *sc)
 {
     /* If we negotiated RPK, we won't attempt to compress it */
@@ -467,8 +611,15 @@ static int do_compressed_cert(SSL_CONNECTION *sc)
  */
 static WRITE_TRAN ossl_statem_server13_write_transition(SSL_CONNECTION *s)
 {
+    OSSL_HANDSHAKE_STATE next_state;
     OSSL_STATEM *st = &s->statem;

+    if (st->ack_for_retransmit && st->hand_state != TLS_ST_SW_ACK) {
+        st->deferred_ack_state = st->hand_state;
+        st->hand_state = TLS_ST_SW_ACK;
+        return WRITE_TRAN_CONTINUE;
+    }
+
     /*
      * No case for TLS_ST_BEFORE, because at that stage we have not negotiated
      * TLSv1.3 yet, so that is handled by ossl_statem_server_write_transition()
@@ -501,7 +652,7 @@ static WRITE_TRAN ossl_statem_server13_write_transition(SSL_CONNECTION *s)
         return WRITE_TRAN_CONTINUE;

     case TLS_ST_SW_SRVR_HELLO:
-        if ((s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0
+        if (SSL_CONNECTION_MIDDLEBOX_IS_ENABLED(s)
             && s->hello_retry_request != SSL_HRR_COMPLETE)
             st->hand_state = TLS_ST_SW_CHANGE;
         else if (s->hello_retry_request == SSL_HRR_PENDING)
@@ -571,18 +722,75 @@ static WRITE_TRAN ossl_statem_server13_write_transition(SSL_CONNECTION *s)
              * If we're not going to renew the ticket then we just finish the
              * handshake at this point.
              */
-            st->hand_state = TLS_ST_OK;
+            if (SSL_CONNECTION_IS_DTLS13(s)) {
+                st->deferred_ack_state = TLS_ST_OK;
+                st->hand_state = TLS_ST_SW_ACK;
+            } else {
+                st->hand_state = TLS_ST_OK;
+            }
+
             return WRITE_TRAN_CONTINUE;
         }
-        if (s->num_tickets > s->sent_tickets)
-            st->hand_state = TLS_ST_SW_SESSION_TICKET;
+        /*
+         * Do not issue TLS 1.3 session tickets if the server has explicitly
+         * disabled them via SSL_OP_NO_TICKET and also disabled the session
+         * cache with SSL_SESS_CACHE_OFF. Together, these settings clearly
+         * indicate an intent to suppress session resumption; sending
+         * NewSessionTicket messages in this case would be wasteful and
+         * misleading.
+         *
+         * From the server’s perspective, a client that does not advertise
+         * psk_key_exchange_modes in TLS 1.3, or that sends it with RFC 9149
+         * parameters such as new_session_count = 0 or resumption_count = 0, is
+         * effectively signaling no interest in session tickets or resumption.
+         *
+         * RFC 9846 section 4.3.9: Servers MUST NOT select a key exchange mode
+         * that is not listed by the client. This extension also restricts the
+         * modes for use with PSK resumption. Servers SHOULD NOT send
+         * NewSessionTicket with tickets that are not compatible with the
+         * advertised modes; however, if a server does so, the impact will just
+         * be that the client's attempts at resumption fail.
+         *
+         * Note: Although RFC 9149 allows clients to signal no interest in
+         * session tickets or resumption (e.g. new_session_count = 0 or
+         * resumption_count = 0), this implementation does not currently
+         * interpret or enforce those parameters.
+         *
+         * Also skip issuance when SSL_VERIFY_PEER is set with no sid_ctx
+         * configured: any ticket minted here would be rejected by
+         * ssl_get_prev_session() in that configuration.
+         */
+        if (s->num_tickets <= s->sent_tickets
+            || ((s->options & SSL_OP_NO_TICKET) != 0
+                && (SSL_CONNECTION_GET_CTX(s)->session_cache_mode & SSL_SESS_CACHE_SERVER)
+                    == 0)
+            || s->ext.psk_kex_mode == TLSEXT_KEX_MODE_FLAG_NONE
+            || ((s->verify_mode & SSL_VERIFY_PEER) != 0 && s->sid_ctx_length == 0))
+            next_state = TLS_ST_OK;
         else
-            st->hand_state = TLS_ST_OK;
+            next_state = TLS_ST_SW_SESSION_TICKET;
+
+        if (SSL_CONNECTION_IS_DTLS13(s)) {
+            st->deferred_ack_state = next_state;
+            st->hand_state = TLS_ST_SW_ACK;
+        } else {
+            st->hand_state = next_state;
+        }
         return WRITE_TRAN_CONTINUE;

     case TLS_ST_SR_KEY_UPDATE:
+        if (SSL_CONNECTION_IS_DTLS13(s)) {
+            st->deferred_ack_state = TLS_ST_OK;
+            st->hand_state = TLS_ST_SW_ACK;
+            return WRITE_TRAN_CONTINUE;
+        }
+        /* Fall through */
     case TLS_ST_SW_KEY_UPDATE:
-        st->hand_state = TLS_ST_OK;
+        if (SSL_CONNECTION_IS_DTLS13(s))
+            /* We wait for ACK */
+            return WRITE_TRAN_FINISHED;
+        else
+            st->hand_state = TLS_ST_OK;
         return WRITE_TRAN_CONTINUE;

     case TLS_ST_SW_SESSION_TICKET:
@@ -590,13 +798,30 @@ static WRITE_TRAN ossl_statem_server13_write_transition(SSL_CONNECTION *s)
          * Following an initial handshake we send the number of tickets we have
          * been configured for.
          */
-        if (!SSL_IS_FIRST_HANDSHAKE(s) && s->ext.extra_tickets_expected > 0) {
-            return WRITE_TRAN_CONTINUE;
-        } else if (s->hit || s->num_tickets <= s->sent_tickets) {
+        if ((SSL_IS_FIRST_HANDSHAKE(s) || s->ext.extra_tickets_expected <= 0)
+            && (s->hit || s->num_tickets <= s->sent_tickets)) {
             /* We've written enough tickets out. */
             st->hand_state = TLS_ST_OK;
         }
         return WRITE_TRAN_CONTINUE;
+
+    case TLS_ST_SR_ACK:
+        if (SSL_CONNECTION_IS_DTLS13(s)
+            && dtls_any_sent_messages_are_missing_acknowledge(s)) {
+            /* We wait for ACK */
+            return WRITE_TRAN_FINISHED;
+        }
+        st->hand_state = TLS_ST_OK;
+        return WRITE_TRAN_CONTINUE;
+
+    case TLS_ST_SW_ACK:
+        st->hand_state = st->deferred_ack_state;
+        if (st->ack_for_retransmit) {
+            st->ack_for_retransmit = 0;
+            return WRITE_TRAN_FINISHED;
+        }
+
+        return WRITE_TRAN_CONTINUE;
     }
 }

@@ -613,7 +838,7 @@ WRITE_TRAN ossl_statem_server_write_transition(SSL_CONNECTION *s)
      * to negotiate yet, so we don't take this branch until later
      */

-    if (SSL_CONNECTION_IS_TLS13(s))
+    if (SSL_CONNECTION_IS_VERSION13(s))
         return ossl_statem_server13_write_transition(s);

     switch (st->hand_state) {
@@ -645,7 +870,7 @@ WRITE_TRAN ossl_statem_server_write_transition(SSL_CONNECTION *s)
         return WRITE_TRAN_CONTINUE;

     case TLS_ST_SR_CLNT_HELLO:
-        if (SSL_CONNECTION_IS_DTLS(s) && !s->d1->cookie_verified
+        if (SSL_CONNECTION_IS_DTLS(s) && !SSL_CONNECTION_IS_DTLS13(s) && !s->d1->cookie_verified
             && (SSL_get_options(SSL_CONNECTION_GET_SSL(s)) & SSL_OP_COOKIE_EXCHANGE)) {
             st->hand_state = DTLS_ST_SW_HELLO_VERIFY_REQUEST;
         } else if (s->renegotiate == 0 && !SSL_IS_FIRST_HANDSHAKE(s)) {
@@ -739,6 +964,70 @@ WRITE_TRAN ossl_statem_server_write_transition(SSL_CONNECTION *s)
     }
 }

+static int ossl_statem_dtls_server13_use_timer(SSL_CONNECTION *s)
+{
+    OSSL_STATEM *st = &s->statem;
+
+    switch (st->hand_state) {
+    default:
+        break;
+
+    case TLS_ST_SW_ACK:
+        /* Fall through */
+
+    case TLS_ST_OK:
+        return 0;
+    }
+
+    return 1;
+}
+
+int ossl_statem_dtls_server_use_timer(SSL_CONNECTION *s)
+{
+    OSSL_STATEM *st = &s->statem;
+
+    if (SSL_CONNECTION_IS_DTLS13(s))
+        return ossl_statem_dtls_server13_use_timer(s);
+
+    switch (st->hand_state) {
+    default:
+        break;
+
+    case TLS_ST_SW_SESSION_TICKET:
+        /*
+         * We're into the last flight. We don't retransmit the last flight
+         * unless we need to, so we don't use the timer
+         */
+        st->use_timer = 0;
+        break;
+
+    case TLS_ST_SW_CHANGE:
+        /*
+         * We're into the last flight. We don't retransmit the last flight
+         * unless we need to, so we don't use the timer. This might have
+         * already been set to 0 if we sent a NewSessionTicket message,
+         * but we'll set it again here in case we didn't.
+         */
+        st->use_timer = 0;
+        break;
+
+    case DTLS_ST_SW_HELLO_VERIFY_REQUEST:
+        /* We don't buffer this message so don't use the timer */
+        st->use_timer = 0;
+        break;
+
+    case TLS_ST_SW_SRVR_HELLO:
+        /*
+         * Messages we write from now on should be buffered and
+         * retransmitted if necessary, so we need to use the timer now
+         */
+        st->use_timer = 1;
+        break;
+    }
+
+    return st->use_timer;
+}
+
 /*
  * Perform any pre work that needs to be done prior to sending a message from
  * the server to the client.
@@ -754,28 +1043,12 @@ WORK_STATE ossl_statem_server_pre_work(SSL_CONNECTION *s, WORK_STATE wst)
         break;

     case TLS_ST_SW_HELLO_REQ:
+        /* fall-through */
+    case DTLS_ST_SW_HELLO_VERIFY_REQUEST:
         s->shutdown = 0;
         if (SSL_CONNECTION_IS_DTLS(s))
-            dtls1_clear_sent_buffer(s);
-        break;
+            dtls1_clear_sent_buffer(s, 0);

-    case DTLS_ST_SW_HELLO_VERIFY_REQUEST:
-        s->shutdown = 0;
-        if (SSL_CONNECTION_IS_DTLS(s)) {
-            dtls1_clear_sent_buffer(s);
-            /* We don't buffer this message so don't use the timer */
-            st->use_timer = 0;
-        }
-        break;
-
-    case TLS_ST_SW_SRVR_HELLO:
-        if (SSL_CONNECTION_IS_DTLS(s)) {
-            /*
-             * Messages we write from now on should be buffered and
-             * retransmitted if necessary, so we need to use the timer now
-             */
-            st->use_timer = 1;
-        }
         break;

     case TLS_ST_SW_SRVR_DONE:
@@ -788,7 +1061,7 @@ WORK_STATE ossl_statem_server_pre_work(SSL_CONNECTION *s, WORK_STATE wst)
         return WORK_FINISHED_CONTINUE;

     case TLS_ST_SW_SESSION_TICKET:
-        if (SSL_CONNECTION_IS_TLS13(s) && s->sent_tickets == 0
+        if (SSL_CONNECTION_IS_VERSION13(s) && s->sent_tickets == 0
             && s->ext.extra_tickets_expected == 0) {
             /*
              * Actually this is the end of the handshake, but we're going
@@ -799,17 +1072,10 @@ WORK_STATE ossl_statem_server_pre_work(SSL_CONNECTION *s, WORK_STATE wst)
              */
             return tls_finish_handshake(s, wst, 0, 0);
         }
-        if (SSL_CONNECTION_IS_DTLS(s)) {
-            /*
-             * We're into the last flight. We don't retransmit the last flight
-             * unless we need to, so we don't use the timer
-             */
-            st->use_timer = 0;
-        }
         break;

     case TLS_ST_SW_CHANGE:
-        if (SSL_CONNECTION_IS_TLS13(s))
+        if (SSL_CONNECTION_IS_VERSION13(s))
             break;
         /* Writes to s->session are only safe for initial handshakes */
         if (s->session->cipher == NULL) {
@@ -822,15 +1088,6 @@ WORK_STATE ossl_statem_server_pre_work(SSL_CONNECTION *s, WORK_STATE wst)
             /* SSLfatal() already called */
             return WORK_ERROR;
         }
-        if (SSL_CONNECTION_IS_DTLS(s)) {
-            /*
-             * We're into the last flight. We don't retransmit the last flight
-             * unless we need to, so we don't use the timer. This might have
-             * already been set to 0 if we sent a NewSessionTicket message,
-             * but we'll set it again here in case we didn't.
-             */
-            st->use_timer = 0;
-        }
         return WORK_FINISHED_CONTINUE;

     case TLS_ST_EARLY_DATA:
@@ -842,7 +1099,7 @@ WORK_STATE ossl_statem_server_pre_work(SSL_CONNECTION *s, WORK_STATE wst)
          * In QUIC with 0-RTT we just carry on when otherwise we would stop
          * to allow the server to read early data
          */
-        if (SSL_NO_EOED(s) && s->ext.early_data == SSL_EARLY_DATA_ACCEPTED
+        if (SSL_IS_QUIC_HANDSHAKE(s) && s->ext.early_data == SSL_EARLY_DATA_ACCEPTED
             && s->early_data_state != SSL_EARLY_DATA_FINISHED_READING) {
             s->early_data_state = SSL_EARLY_DATA_FINISHED_READING;
             if (!ssl->method->ssl3_enc->change_cipher_state(s, SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_SERVER_READ)) {
@@ -922,15 +1179,20 @@ WORK_STATE ossl_statem_server_post_work(SSL_CONNECTION *s, WORK_STATE wst)
         break;

     case TLS_ST_SW_SRVR_HELLO:
-        if (SSL_CONNECTION_IS_TLS13(s)
+        if (SSL_CONNECTION_IS_VERSION13(s)
             && s->hello_retry_request == SSL_HRR_PENDING) {
-            if ((s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) == 0
+            if (!SSL_CONNECTION_MIDDLEBOX_IS_ENABLED(s)
                 && statem_flush(s) != 1)
                 return WORK_MORE_A;
             break;
         }
 #ifndef OPENSSL_NO_SCTP
-        if (SSL_CONNECTION_IS_DTLS(s) && s->hit) {
+        /*
+         * Before exporting the SCTP auth key we check if DTLSv1.3 has been negotiated
+         * which is not supported.
+         * Refer to draft-tuexen-tsvwg-rfc6083-bis-04 for more info.
+         */
+        if (SSL_CONNECTION_IS_DTLS(s) && !SSL_CONNECTION_IS_DTLS13(s) && s->hit) {
             unsigned char sctpauthkey[64];
             char labelbuffer[sizeof(DTLS1_SCTP_AUTH_LABEL)];
             size_t labellen;
@@ -960,8 +1222,8 @@ WORK_STATE ossl_statem_server_post_work(SSL_CONNECTION *s, WORK_STATE wst)
                 sizeof(sctpauthkey), sctpauthkey);
         }
 #endif
-        if (!SSL_CONNECTION_IS_TLS13(s)
-            || ((s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0
+        if (!SSL_CONNECTION_IS_VERSION13(s)
+            || (SSL_CONNECTION_MIDDLEBOX_IS_ENABLED(s)
                 && s->hello_retry_request != SSL_HRR_COMPLETE))
             break;
         /* Fall through */
@@ -973,7 +1235,7 @@ WORK_STATE ossl_statem_server_post_work(SSL_CONNECTION *s, WORK_STATE wst)
             break;
         }

-        if (SSL_CONNECTION_IS_TLS13(s)) {
+        if (SSL_CONNECTION_IS_VERSION13(s)) {
             if (!ssl->method->ssl3_enc->setup_key_block(s)
                 || !tls13_store_handshake_traffic_hash(s)
                 || !ssl->method->ssl3_enc->change_cipher_state(s,
@@ -982,7 +1244,9 @@ WORK_STATE ossl_statem_server_post_work(SSL_CONNECTION *s, WORK_STATE wst)
                 return WORK_ERROR;
             }

-            if (s->ext.early_data != SSL_EARLY_DATA_ACCEPTED
+            if (SSL_CONNECTION_IS_DTLS13(s)) {
+                dtls13_hellos_done(s);
+            } else if (s->ext.early_data != SSL_EARLY_DATA_ACCEPTED
                 && !ssl->method->ssl3_enc->change_cipher_state(s,
                     SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_SERVER_READ)) {
                 /* SSLfatal() already called */
@@ -1033,8 +1297,8 @@ WORK_STATE ossl_statem_server_post_work(SSL_CONNECTION *s, WORK_STATE wst)
                 0, NULL);
         }
 #endif
-        if (SSL_CONNECTION_IS_TLS13(s)) {
-            /* TLS 1.3 gets the secret size from the handshake md */
+        if (SSL_CONNECTION_IS_VERSION13(s)) {
+            /* (D)TLS 1.3 gets the secret size from the handshake md */
             size_t dummy;
             if (!ssl->method->ssl3_enc->generate_master_secret(s,
                     s->master_secret, s->handshake_secret, 0,
@@ -1052,7 +1316,7 @@ WORK_STATE ossl_statem_server_post_work(SSL_CONNECTION *s, WORK_STATE wst)
             if (statem_flush(s) != 1)
                 return WORK_MORE_A;
         } else {
-            if (!SSL_CONNECTION_IS_TLS13(s)
+            if (!SSL_CONNECTION_IS_VERSION13(s)
                 || (s->options & SSL_OP_NO_TX_CERTIFICATE_COMPRESSION) != 0)
                 s->ext.compress_certificate_from_peer[0] = TLSEXT_comp_cert_none;
         }
@@ -1060,7 +1324,7 @@ WORK_STATE ossl_statem_server_post_work(SSL_CONNECTION *s, WORK_STATE wst)

     case TLS_ST_SW_ENCRYPTED_EXTENSIONS:
         if (!s->hit && !send_certificate_request(s)) {
-            if (!SSL_CONNECTION_IS_TLS13(s)
+            if (!SSL_CONNECTION_IS_VERSION13(s)
                 || (s->options & SSL_OP_NO_TX_CERTIFICATE_COMPRESSION) != 0)
                 s->ext.compress_certificate_from_peer[0] = TLSEXT_comp_cert_none;
         }
@@ -1077,7 +1341,7 @@ WORK_STATE ossl_statem_server_post_work(SSL_CONNECTION *s, WORK_STATE wst)

     case TLS_ST_SW_SESSION_TICKET:
         clear_sys_error();
-        if (SSL_CONNECTION_IS_TLS13(s) && statem_flush(s) != 1) {
+        if (SSL_CONNECTION_IS_VERSION13(s) && statem_flush(s) != 1) {
             if (SSL_get_error(ssl, 0) == SSL_ERROR_SYSCALL
                 && conn_is_closed()) {
                 /*
@@ -1093,6 +1357,12 @@ WORK_STATE ossl_statem_server_post_work(SSL_CONNECTION *s, WORK_STATE wst)

             return WORK_MORE_A;
         }
+        ERR_clear_last_mark();
+        break;
+
+    case TLS_ST_SW_ACK:
+        if (statem_flush(s) != 1)
+            return WORK_MORE_A;
         break;
     }

@@ -1203,6 +1473,11 @@ int ossl_statem_server_construct_message(SSL_CONNECTION *s,
         *confunc = tls_construct_key_update;
         *mt = SSL3_MT_KEY_UPDATE;
         break;
+
+    case TLS_ST_SW_ACK:
+        *confunc = dtls_construct_ack;
+        *mt = DTLS13_MT_ACK;
+        break;
     }

     return 1;
@@ -1270,6 +1545,9 @@ size_t ossl_statem_server_max_message_size(SSL_CONNECTION *s)

     case TLS_ST_SR_KEY_UPDATE:
         return KEY_UPDATE_MAX_LENGTH;
+
+    case TLS_ST_SR_ACK:
+        return ACK_MAX_LENGTH;
     }
 }

@@ -1320,6 +1598,9 @@ MSG_PROCESS_RETURN ossl_statem_server_process_message(SSL_CONNECTION *s,

     case TLS_ST_SR_KEY_UPDATE:
         return tls_process_key_update(s, pkt);
+
+    case TLS_ST_SR_ACK:
+        return dtls_process_ack(s, pkt);
     }
 }

@@ -1341,6 +1622,12 @@ WORK_STATE ossl_statem_server_post_process_message(SSL_CONNECTION *s,
     case TLS_ST_SR_CLNT_HELLO:
         return tls_post_process_client_hello(s, wst);

+    case TLS_ST_SR_CERT:
+#ifndef OPENSSL_NO_COMP_ALG
+    case TLS_ST_SR_COMP_CERT:
+#endif
+        return tls_post_process_client_certificate(s, wst);
+
     case TLS_ST_SR_KEY_EXCH:
         return tls_post_process_client_key_exchange(s, wst);
     }
@@ -1393,14 +1680,23 @@ int dtls_raw_hello_verify_request(WPACKET *pkt, unsigned char *cookie,
 CON_FUNC_RETURN dtls_construct_hello_verify_request(SSL_CONNECTION *s,
     WPACKET *pkt)
 {
-    unsigned int cookie_leni;
+    unsigned int cookie_leni = 0;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+    SSL *ussl = SSL_CONNECTION_GET_USER_SSL(s);
+    int cb_ret = 0;

-    if (sctx->app_gen_cookie_cb == NULL
-        || sctx->app_gen_cookie_cb(SSL_CONNECTION_GET_USER_SSL(s), s->d1->cookie,
-               &cookie_leni)
-            == 0
-        || cookie_leni > DTLS1_COOKIE_LENGTH) {
+#if !defined(OPENSSL_NO_DTLS)
+    DTLS_LISTENER *dl = (DTLS_LISTENER *)s->d1->listener;
+
+    if (dl != NULL && dl->require_hvr_cookie && sctx->app_gen_cookie_cb == NULL) {
+        cb_ret = ossl_dtls_listener_gen_cookie_cb(ussl, s->d1->cookie, &cookie_leni);
+    } else
+#endif
+        if (sctx->app_gen_cookie_cb != NULL) {
+        cb_ret = sctx->app_gen_cookie_cb(ussl, s->d1->cookie, &cookie_leni);
+    }
+
+    if (cb_ret == 0 || cookie_leni > sizeof(s->d1->cookie)) {
         SSLfatal(s, SSL_AD_NO_ALERT, SSL_R_COOKIE_GEN_CALLBACK_FAILURE);
         return CON_FUNC_ERROR;
     }
@@ -1412,6 +1708,12 @@ CON_FUNC_RETURN dtls_construct_hello_verify_request(SSL_CONNECTION *s,
         return CON_FUNC_ERROR;
     }

+    /*
+     * Server must recover the downgrade sentinel in case it sends a
+     * HelloVerifyRequest.
+     */
+    s->d1->hello_verify_request = SSL_HVR_SENT;
+
     return CON_FUNC_SUCCESS;
 }

@@ -1505,12 +1807,113 @@ MSG_PROCESS_RETURN tls_process_client_hello(SSL_CONNECTION *s, PACKET *pkt)
 {
     /* |cookie| will only be initialized for DTLS. */
     PACKET session_id, compression, extensions, cookie;
-    static const unsigned char null_compression = 0;
     CLIENTHELLO_MSG *clienthello = NULL;

+#ifndef OPENSSL_NO_ECH
+    /*
+     * For a split-mode backend we want to have a way to point at the CH octets
+     * for the accept-confirmation calculation. The split-mode backend does not
+     * need any ECH secrets, but it does need to see the inner CH and be the TLS
+     * endpoint with which the ECH encrypting client sets up the TLS session.
+     * The split-mode backend however does need to do an ECH confirm calculation
+     * so we need to tee that up. The result of that calculation will be put in
+     * the ServerHello.random (or ECH extension if HRR) to signal to the client
+     * that ECH "worked."
+     */
+    if (s->server && PACKET_remaining(pkt) != 0) {
+        int rv = 0, innerflag = OSSL_ECH_UNKNOWN_CH_TYPE;
+        size_t startofsessid = 0, startofexts = 0, echoffset = 0;
+        size_t outersnioffset = 0; /* offset to SNI in outer */
+        uint16_t echtype = OSSL_ECH_type_unknown; /* type of ECH seen */
+        const unsigned char *pbuf = NULL;
+
+        /* reset needed in case of HRR */
+        s->ext.ech.ch_offsets_done = 0;
+        rv = ossl_ech_get_ch_offsets(s, pkt, &startofsessid, &startofexts,
+            &echoffset, &echtype, &innerflag,
+            &outersnioffset);
+        if (rv != 1) {
+            /* SSLfatal already called */
+            goto err;
+        }
+        if (innerflag == OSSL_ECH_INNER_CH_TYPE) {
+            WPACKET inner;
+
+            OSSL_TRACE(TLS, "Got inner ECH so setting backend\n");
+            /* For backend, include msg type & 3 octet length */
+            s->ext.ech.backend = 1;
+            s->ext.ech.attempted_type = TLSEXT_TYPE_ech;
+            OPENSSL_free(s->ext.ech.innerch);
+            s->ext.ech.innerch_len = PACKET_remaining(pkt);
+            if (PACKET_peek_bytes(pkt, &pbuf, s->ext.ech.innerch_len) != 1) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+            s->ext.ech.innerch_len += SSL3_HM_HEADER_LENGTH; /* 4 */
+            s->ext.ech.innerch = OPENSSL_malloc(s->ext.ech.innerch_len);
+            if (s->ext.ech.innerch == NULL) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+            if (!WPACKET_init_static_len(&inner, s->ext.ech.innerch,
+                    s->ext.ech.innerch_len, 0)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+            if (!WPACKET_put_bytes_u8(&inner, SSL3_MT_CLIENT_HELLO)
+                || !WPACKET_put_bytes_u24(&inner, s->ext.ech.innerch_len - SSL3_HM_HEADER_LENGTH)
+                || !WPACKET_memcpy(&inner, pbuf, s->ext.ech.innerch_len - SSL3_HM_HEADER_LENGTH)
+                || !WPACKET_finish(&inner)) {
+                WPACKET_cleanup(&inner);
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+            if (ossl_ech_intbuf_add(s, s->ext.ech.innerch,
+                    s->ext.ech.innerch_len, 0)
+                != 1) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+        } else if (s->ext.ech.es != NULL) {
+            PACKET newpkt;
+            int secondtime = s->ext.ech.success;
+
+            /*
+             * if ECH decrypt worked first time (success == 1) then fail
+             * if there's no ECH extension at all 2nd time
+             */
+            if (secondtime == 1 && echoffset == 0) {
+                SSLfatal(s, SSL_AD_MISSING_EXTENSION,
+                    SSL_R_TLSV13_ALERT_MISSING_EXTENSION);
+                goto err;
+            }
+            if (ossl_ech_early_decrypt(s, pkt, &newpkt) != 1) {
+                /* SSLfatal() already called */
+                goto err;
+            }
+            if (s->ext.ech.success == 1) {
+                /*
+                 * Replace the outer CH with the inner, as long as there's
+                 * space, which there better be! (a bug triggered a bigger
+                 * inner CH once;-)
+                 */
+                if (PACKET_remaining(&newpkt) > PACKET_remaining(pkt)) {
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                    goto err;
+                }
+                *pkt = newpkt;
+            } else if (secondtime == 1 && s->ext.ech.success == 0) {
+                /* 2nd time decrypt failed */
+                SSLfatal(s, SSL_AD_DECRYPT_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+        }
+    }
+#endif
+
     /* Check if this is actually an unexpected renegotiation ClientHello */
     if (s->renegotiate == 0 && !SSL_IS_FIRST_HANDSHAKE(s)) {
-        if (!ossl_assert(!SSL_CONNECTION_IS_TLS13(s))) {
+        if (!ossl_assert(!SSL_CONNECTION_IS_VERSION13(s))) {
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             goto err;
         }
@@ -1535,156 +1938,74 @@ MSG_PROCESS_RETURN tls_process_client_hello(SSL_CONNECTION *s, PACKET *pkt)
     /*
      * First, parse the raw ClientHello data into the CLIENTHELLO_MSG structure.
      */
-    clienthello->isv2 = RECORD_LAYER_is_sslv2_record(&s->rlayer);
     PACKET_null_init(&cookie);

-    if (clienthello->isv2) {
-        unsigned int mt;
-
-        if (!SSL_IS_FIRST_HANDSHAKE(s)
-            || s->hello_retry_request != SSL_HRR_NONE) {
-            SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
-            goto err;
-        }
-
-        /*-
-         * An SSLv3/TLSv1 backwards-compatible CLIENT-HELLO in an SSLv2
-         * header is sent directly on the wire, not wrapped as a TLS
-         * record. Our record layer just processes the message length and passes
-         * the rest right through. Its format is:
-         * Byte  Content
-         * 0-1   msg_length - decoded by the record layer
-         * 2     msg_type - s->init_msg points here
-         * 3-4   version
-         * 5-6   cipher_spec_length
-         * 7-8   session_id_length
-         * 9-10  challenge_length
-         * ...   ...
-         */
-
-        if (!PACKET_get_1(pkt, &mt)
-            || mt != SSL2_MT_CLIENT_HELLO) {
-            /*
-             * Should never happen. We should have tested this in the record
-             * layer in order to have determined that this is an SSLv2 record
-             * in the first place
-             */
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            goto err;
-        }
-    }
-
     if (!PACKET_get_net_2(pkt, &clienthello->legacy_version)) {
         SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_TOO_SHORT);
         goto err;
     }

-    /* Parse the message and load client random. */
-    if (clienthello->isv2) {
-        /*
-         * Handle an SSLv2 backwards compatible ClientHello
-         * Note, this is only for SSLv3+ using the backward compatible format.
-         * Real SSLv2 is not supported, and is rejected below.
-         */
-        unsigned int ciphersuite_len, session_id_len, challenge_len;
-        PACKET challenge;
-
-        if (!PACKET_get_net_2(pkt, &ciphersuite_len)
-            || !PACKET_get_net_2(pkt, &session_id_len)
-            || !PACKET_get_net_2(pkt, &challenge_len)) {
-            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_RECORD_LENGTH_MISMATCH);
-            goto err;
-        }
-
-        if (session_id_len > SSL_MAX_SSL_SESSION_ID_LENGTH) {
-            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_LENGTH_MISMATCH);
-            goto err;
-        }
-
-        if (!PACKET_get_sub_packet(pkt, &clienthello->ciphersuites,
-                ciphersuite_len)
-            || !PACKET_copy_bytes(pkt, clienthello->session_id, session_id_len)
-            || !PACKET_get_sub_packet(pkt, &challenge, challenge_len)
-            /* No extensions. */
-            || PACKET_remaining(pkt) != 0) {
-            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_RECORD_LENGTH_MISMATCH);
-            goto err;
-        }
-        clienthello->session_id_len = session_id_len;
+    if (!PACKET_copy_bytes(pkt, clienthello->random, SSL3_RANDOM_SIZE)
+        || !PACKET_get_length_prefixed_1(pkt, &session_id)
+        || !PACKET_copy_all(&session_id, clienthello->session_id,
+            SSL_MAX_SSL_SESSION_ID_LENGTH,
+            &clienthello->session_id_len)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
+        goto err;
+    }

-        /* Load the client random and compression list. We use SSL3_RANDOM_SIZE
-         * here rather than sizeof(clienthello->random) because that is the limit
-         * for SSLv3 and it is fixed. It won't change even if
-         * sizeof(clienthello->random) does.
-         */
-        challenge_len = challenge_len > SSL3_RANDOM_SIZE
-            ? SSL3_RANDOM_SIZE
-            : challenge_len;
-        memset(clienthello->random, 0, SSL3_RANDOM_SIZE);
-        if (!PACKET_copy_bytes(&challenge,
-                clienthello->random + SSL3_RANDOM_SIZE - challenge_len, challenge_len)
-            /* Advertise only null compression. */
-            || !PACKET_buf_init(&compression, &null_compression, 1)) {
-            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-            goto err;
-        }
+    if (SSL_CONNECTION_IS_DTLS(s)) {
+        int minversion, maxversion;

-        PACKET_null_init(&clienthello->extensions);
-    } else {
-        /* Regular ClientHello. */
-        if (!PACKET_copy_bytes(pkt, clienthello->random, SSL3_RANDOM_SIZE)
-            || !PACKET_get_length_prefixed_1(pkt, &session_id)
-            || !PACKET_copy_all(&session_id, clienthello->session_id,
-                SSL_MAX_SSL_SESSION_ID_LENGTH,
-                &clienthello->session_id_len)) {
+        if (!PACKET_get_length_prefixed_1(pkt, &cookie)) {
             SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
             goto err;
         }
+        if (!PACKET_copy_all(&cookie, clienthello->dtls_cookie,
+                sizeof(clienthello->dtls_cookie),
+                &clienthello->dtls_cookie_len)) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }

-        if (SSL_CONNECTION_IS_DTLS(s)) {
-            if (!PACKET_get_length_prefixed_1(pkt, &cookie)) {
-                SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
-                goto err;
-            }
-            if (!PACKET_copy_all(&cookie, clienthello->dtls_cookie,
-                    DTLS1_COOKIE_LENGTH,
-                    &clienthello->dtls_cookie_len)) {
-                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-                goto err;
-            }
-            /*
-             * If we require cookies and this ClientHello doesn't contain one,
-             * just return since we do not want to allocate any memory yet.
-             * So check cookie length...
-             */
-            if (SSL_get_options(SSL_CONNECTION_GET_SSL(s)) & SSL_OP_COOKIE_EXCHANGE) {
-                if (clienthello->dtls_cookie_len == 0) {
-                    OPENSSL_free(clienthello);
-                    return MSG_PROCESS_FINISHED_READING;
-                }
-            }
+        /*
+         * If the connection supports DTLSv1.3:
+         *      We continue to process ClientHello's without cookies
+         *
+         * Otherwise, if we require cookies and this ClientHello doesn't
+         * contain one:
+         *      Return since we do not want to allocate any memory yet
+         */
+        if ((SSL_get_options(SSL_CONNECTION_GET_SSL(s)) & SSL_OP_COOKIE_EXCHANGE)
+            && clienthello->dtls_cookie_len == 0
+            && ossl_assert(ssl_get_min_max_version(s, &minversion,
+                               &maxversion, NULL)
+                == 0)
+            && ssl_version_cmp(s, maxversion, DTLS1_3_VERSION) < 0) {
+            OPENSSL_free(clienthello);
+            return MSG_PROCESS_FINISHED_READING;
         }
+    }

-        if (!PACKET_get_length_prefixed_2(pkt, &clienthello->ciphersuites)) {
-            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
-            goto err;
-        }
+    if (!PACKET_get_length_prefixed_2(pkt, &clienthello->ciphersuites)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
+        goto err;
+    }
+
+    if (!PACKET_get_length_prefixed_1(pkt, &compression)) {
+        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
+        goto err;
+    }

-        if (!PACKET_get_length_prefixed_1(pkt, &compression)) {
+    /* Could be empty. */
+    if (PACKET_remaining(pkt) == 0) {
+        PACKET_null_init(&clienthello->extensions);
+    } else {
+        if (!PACKET_get_length_prefixed_2(pkt, &clienthello->extensions)
+            || PACKET_remaining(pkt) != 0) {
             SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
             goto err;
         }
-
-        /* Could be empty. */
-        if (PACKET_remaining(pkt) == 0) {
-            PACKET_null_init(&clienthello->extensions);
-        } else {
-            if (!PACKET_get_length_prefixed_2(pkt, &clienthello->extensions)
-                || PACKET_remaining(pkt) != 0) {
-                SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
-                goto err;
-            }
-        }
     }

     if (!PACKET_copy_all(&compression, clienthello->compressions,
@@ -1702,6 +2023,32 @@ MSG_PROCESS_RETURN tls_process_client_hello(SSL_CONNECTION *s, PACKET *pkt)
         /* SSLfatal already been called */
         goto err;
     }
+
+    if (SSL_CONNECTION_IS_DTLS(s)) {
+        int minversion, maxversion;
+
+        /*
+         * If the connection supports DTLSv1.3 or if the ClientHello was sent
+         * with the SupportedVersions extension:
+         *      We continue to process ClientHello's without cookies
+         *
+         * Otherwise, if we require cookies and this ClientHello doesn't
+         * contain one:
+         *      Return since we do not want to allocate any memory yet
+         */
+        if ((SSL_get_options(SSL_CONNECTION_GET_SSL(s)) & SSL_OP_COOKIE_EXCHANGE)
+            && clienthello->dtls_cookie_len == 0
+            && ossl_assert(ssl_get_min_max_version(s, &minversion,
+                               &maxversion, NULL)
+                == 0)
+            && ssl_version_cmp(s, maxversion, DTLS1_3_VERSION) < 0
+            && !clienthello->pre_proc_exts[TLSEXT_IDX_supported_versions].present) {
+            OPENSSL_free(clienthello->pre_proc_exts);
+            OPENSSL_free(clienthello);
+            return MSG_PROCESS_FINISHED_READING;
+        }
+    }
+
     s->clienthello = clienthello;

     return MSG_PROCESS_CONTINUE_PROCESSING;
@@ -1710,6 +2057,12 @@ err:
     if (clienthello != NULL)
         OPENSSL_free(clienthello->pre_proc_exts);
     OPENSSL_free(clienthello);
+#ifndef OPENSSL_NO_ECH
+    s->clienthello = NULL;
+    OPENSSL_free(s->ext.ech.innerch);
+    s->ext.ech.innerch = NULL;
+    s->ext.ech.innerch_len = 0;
+#endif

     return MSG_PROCESS_ERROR;
 }
@@ -1752,26 +2105,14 @@ static int tls_early_post_process_client_hello(SSL_CONNECTION *s)
     /* Set up the client_random */
     memcpy(s->s3.client_random, clienthello->random, SSL3_RANDOM_SIZE);

-    /* Choose the version */
-
-    if (clienthello->isv2) {
-        if (clienthello->legacy_version == SSL2_VERSION
-            || (clienthello->legacy_version & 0xff00)
-                != (SSL3_VERSION_MAJOR << 8)) {
-            /*
-             * This is real SSLv2 or something completely unknown. We don't
-             * support it.
-             */
-            SSLfatal(s, SSL_AD_PROTOCOL_VERSION, SSL_R_UNKNOWN_PROTOCOL);
-            goto err;
-        }
-        /* SSLv3/TLS */
-        s->client_version = clienthello->legacy_version;
-    }
-
     /* Choose the server SSL/TLS/DTLS version. */
     protverr = ssl_choose_server_version(s, clienthello, &dgrd);

+#ifndef OPENSSL_NO_ECH
+    if (protverr && s->ext.ech.success == 1) {
+        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, protverr);
+    }
+#endif
     if (protverr) {
         if (SSL_IS_FIRST_HANDSHAKE(s)) {
             /* like ssl3_get_record, send alert using remote version number */
@@ -1782,29 +2123,36 @@ static int tls_early_post_process_client_hello(SSL_CONNECTION *s)
     }

     /* TLSv1.3 specifies that a ClientHello must end on a record boundary */
-    if (SSL_CONNECTION_IS_TLS13(s)
+    if (SSL_CONNECTION_IS_VERSION13(s)
         && RECORD_LAYER_processed_read_pending(&s->rlayer)) {
         SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_NOT_ON_RECORD_BOUNDARY);
         goto err;
     }
-
     if (SSL_CONNECTION_IS_DTLS(s)) {
-        /* Empty cookie was already handled above by returning early. */
-        if (SSL_get_options(ssl) & SSL_OP_COOKIE_EXCHANGE) {
-            if (sctx->app_verify_cookie_cb != NULL) {
-                if (sctx->app_verify_cookie_cb(ussl, clienthello->dtls_cookie,
-                        clienthello->dtls_cookie_len)
-                    == 0) {
-                    SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE,
-                        SSL_R_COOKIE_MISMATCH);
-                    goto err;
-                    /* else cookie verification succeeded */
-                }
-                /* default verification */
-            } else if (s->d1->cookie_len != clienthello->dtls_cookie_len
-                || memcmp(clienthello->dtls_cookie, s->d1->cookie,
+        if ((SSL_get_options(ssl) & SSL_OP_COOKIE_EXCHANGE) && clienthello->dtls_cookie_len != 0) {
+            int verify_ret = 0;
+
+#if !defined(OPENSSL_NO_DTLS)
+            DTLS_LISTENER *dl = (DTLS_LISTENER *)s->d1->listener;
+
+            if (dl != NULL && dl->require_hvr_cookie && sctx->app_verify_cookie_cb == NULL) {
+                verify_ret = ossl_dtls_listener_verify_cookie_cb(ussl,
+                    clienthello->dtls_cookie,
+                    (unsigned int)clienthello->dtls_cookie_len);
+            } else
+#endif
+                if (sctx->app_verify_cookie_cb != NULL) {
+                verify_ret = sctx->app_verify_cookie_cb(ussl, clienthello->dtls_cookie,
+                    (unsigned int)clienthello->dtls_cookie_len);
+            } else if (s->d1->cookie_len == clienthello->dtls_cookie_len
+                && memcmp(clienthello->dtls_cookie, s->d1->cookie,
                        s->d1->cookie_len)
-                    != 0) {
+                    == 0) {
+                /* default verification succeeded */
+                verify_ret = 1;
+            }
+
+            if (verify_ret == 0) {
                 SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, SSL_R_COOKIE_MISMATCH);
                 goto err;
             }
@@ -1814,10 +2162,8 @@ static int tls_early_post_process_client_hello(SSL_CONNECTION *s)

     s->hit = 0;

-    if (!ssl_cache_cipherlist(s, &clienthello->ciphersuites,
-            clienthello->isv2)
-        || !ossl_bytes_to_cipher_list(s, &clienthello->ciphersuites, &ciphers,
-            &scsvs, clienthello->isv2, 1)) {
+    if (!ssl_cache_cipherlist(s, &clienthello->ciphersuites)
+        || !ossl_bytes_to_cipher_list(s, &clienthello->ciphersuites, &ciphers, &scsvs, 1)) {
         /* SSLfatal() already called */
         goto err;
     }
@@ -1851,7 +2197,7 @@ static int tls_early_post_process_client_hello(SSL_CONNECTION *s)
     }

     /* For TLSv1.3 we must select the ciphersuite *before* session resumption */
-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         const SSL_CIPHER *cipher = ssl3_choose_cipher(s, ciphers, SSL_get_ciphers(ssl));

         if (cipher == NULL) {
@@ -1895,7 +2241,7 @@ static int tls_early_post_process_client_hello(SSL_CONNECTION *s)
      * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION setting will be
      * ignored.
      */
-    if (clienthello->isv2 || (s->new_session && (s->options & SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION))) {
+    if (s->new_session && (s->options & SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION)) {
         if (!ssl_get_new_session(s, 1)) {
             /* SSLfatal() already called */
             goto err;
@@ -1917,7 +2263,7 @@ static int tls_early_post_process_client_hello(SSL_CONNECTION *s)
         }
     }

-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         memcpy(s->tmp_session_id, s->clienthello->session_id,
             s->clienthello->session_id_len);
         s->tmp_session_id_len = s->clienthello->session_id_len;
@@ -1927,7 +2273,7 @@ static int tls_early_post_process_client_hello(SSL_CONNECTION *s)
      * If it is a hit, check that the cipher is in the list. In TLSv1.3 we check
      * ciphersuite compatibility with the session as part of resumption.
      */
-    if (!SSL_CONNECTION_IS_TLS13(s) && s->hit) {
+    if (!SSL_CONNECTION_IS_VERSION13(s) && s->hit) {
         j = 0;
         id = s->session->cipher->id;

@@ -2003,12 +2349,25 @@ static int tls_early_post_process_client_hello(SSL_CONNECTION *s)
         goto err;
     }

-    if (!s->hit
+    /*
+     * Unless ECH has worked or not been configured we won't call
+     * the session_secret_cb now because we'll need to calculate the
+     * server random later to include the ECH accept value.
+     * We can't do it now as we don't yet have the SH encoding.
+     */
+    if (
+#ifndef OPENSSL_NO_ECH
+        ((s->ext.ech.es != NULL && s->ext.ech.success == 1)
+            || s->ext.ech.es == NULL)
+        &&
+#endif
+        !s->hit
         && s->version >= TLS1_VERSION
-        && !SSL_CONNECTION_IS_TLS13(s)
+        && !SSL_CONNECTION_IS_VERSION13(s)
         && !SSL_CONNECTION_IS_DTLS(s)
         && s->ext.session_secret_cb != NULL) {
         const SSL_CIPHER *pref_cipher = NULL;
+
         /*
          * s->session->master_key_length is a size_t, but this is an int for
          * backwards compat reasons
@@ -2064,7 +2423,7 @@ static int tls_early_post_process_client_hello(SSL_CONNECTION *s)
      * algorithms from the client, starting at q.
      */
     s->s3.tmp.new_compression = NULL;
-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         /*
          * We already checked above that the NULL compression method appears in
          * the list. Now we check there aren't any others (which is illegal in
@@ -2151,7 +2510,7 @@ static int tls_early_post_process_client_hello(SSL_CONNECTION *s)
      * Given s->peer_ciphers and SSL_get_ciphers, we must pick a cipher
      */

-    if (!s->hit || SSL_CONNECTION_IS_TLS13(s)) {
+    if (!s->hit || SSL_CONNECTION_IS_VERSION13(s)) {
         sk_SSL_CIPHER_free(s->peer_ciphers);
         s->peer_ciphers = ciphers;
         if (ciphers == NULL) {
@@ -2178,7 +2537,8 @@ static int tls_early_post_process_client_hello(SSL_CONNECTION *s)
 err:
     sk_SSL_CIPHER_free(ciphers);
     sk_SSL_CIPHER_free(scsvs);
-    OPENSSL_free(clienthello->pre_proc_exts);
+    if (clienthello != NULL)
+        OPENSSL_free(clienthello->pre_proc_exts);
     OPENSSL_free(s->clienthello);
     s->clienthello = NULL;

@@ -2221,8 +2581,11 @@ static int tls_handle_status_request(SSL_CONNECTION *s)
                 break;
                 /* status request response should be sent */
             case SSL_TLSEXT_ERR_OK:
-                if (s->ext.ocsp.resp)
+#ifndef OPENSSL_NO_OCSP
+                if (s->ext.ocsp.resp_ex != NULL
+                    && sk_OCSP_RESPONSE_num(s->ext.ocsp.resp_ex) > 0)
                     s->ext.status_expected = 1;
+#endif
                 break;
                 /* something bad happened */
             case SSL_TLSEXT_ERR_ALERT_FATAL:
@@ -2327,6 +2690,7 @@ WORK_STATE tls_post_process_client_hello(SSL_CONNECTION *s, WORK_STATE wst)

     if (wst == WORK_MORE_A) {
         int rv = tls_early_post_process_client_hello(s);
+
         if (rv == 0) {
             /* SSLfatal() was already called */
             goto err;
@@ -2336,7 +2700,7 @@ WORK_STATE tls_post_process_client_hello(SSL_CONNECTION *s, WORK_STATE wst)
         wst = WORK_MORE_B;
     }
     if (wst == WORK_MORE_B) {
-        if (!s->hit || SSL_CONNECTION_IS_TLS13(s)) {
+        if (!s->hit || SSL_CONNECTION_IS_VERSION13(s)) {
             /* Let cert callback update server certificates if required */
             if (!s->hit && s->cert->cert_cb != NULL) {
                 int rv = s->cert->cert_cb(ussl, s->cert->cert_cb_arg);
@@ -2353,7 +2717,7 @@ WORK_STATE tls_post_process_client_hello(SSL_CONNECTION *s, WORK_STATE wst)
             }

             /* In TLSv1.3 we selected the ciphersuite before resumption */
-            if (!SSL_CONNECTION_IS_TLS13(s)) {
+            if (!SSL_CONNECTION_IS_VERSION13(s)) {
                 cipher = ssl3_choose_cipher(s, s->peer_ciphers,
                     SSL_get_ciphers(ssl));

@@ -2384,18 +2748,6 @@ WORK_STATE tls_post_process_client_hello(SSL_CONNECTION *s, WORK_STATE wst)
             s->s3.tmp.new_cipher = s->session->cipher;
         }

-        /*-
-         * we now have the following setup.
-         * client_random
-         * cipher_list          - our preferred list of ciphers
-         * ciphers              - the client's preferred list of ciphers
-         * compression          - basically ignored right now
-         * ssl version is set   - sslv3
-         * s->session           - The ssl session has been setup.
-         * s->hit               - session reuse flag
-         * s->s3.tmp.new_cipher - the new cipher to use.
-         */
-
         /*
          * Call status_request callback if needed. Has to be done after the
          * certificate callbacks etc above.
@@ -2410,7 +2762,7 @@ WORK_STATE tls_post_process_client_hello(SSL_CONNECTION *s, WORK_STATE wst)
          * we already did this because cipher negotiation happens earlier, and
          * we must handle ALPN before we decide whether to accept early_data.
          */
-        if (!SSL_CONNECTION_IS_TLS13(s) && !tls_handle_alpn(s)) {
+        if (!SSL_CONNECTION_IS_VERSION13(s) && !tls_handle_alpn(s)) {
             /* SSLfatal() already called */
             goto err;
         }
@@ -2446,9 +2798,13 @@ CON_FUNC_RETURN tls_construct_server_hello(SSL_CONNECTION *s, WPACKET *pkt)
     int version;
     unsigned char *session_id;
     int usetls13 = SSL_CONNECTION_IS_TLS13(s)
-        || s->hello_retry_request == SSL_HRR_PENDING;
+        || (!SSL_CONNECTION_IS_DTLS(s)
+            && s->hello_retry_request == SSL_HRR_PENDING);
+    int usedtls13 = SSL_CONNECTION_IS_DTLS13(s)
+        || (SSL_CONNECTION_IS_DTLS(s)
+            && s->hello_retry_request == SSL_HRR_PENDING);

-    version = usetls13 ? TLS1_2_VERSION : s->version;
+    version = usetls13 ? TLS1_2_VERSION : (usedtls13 ? DTLS1_2_VERSION : s->version);
     if (!WPACKET_put_bytes_u16(pkt, version)
         /*
          * Random stuff. Filling of the server_random takes place in
@@ -2477,6 +2833,7 @@ CON_FUNC_RETURN tls_construct_server_hello(SSL_CONNECTION *s, WPACKET *pkt)
      *   we send back a 0-length session ID.
      * - In TLSv1.3 we echo back the session id sent to us by the client
      *   regardless
+     * - In DTLSv1.3 we must not echo the session id sent by the client
      * s->hit is non-zero in either case of session reuse,
      * so the following won't overwrite an ID that we're supposed
      * to send back.
@@ -2488,6 +2845,9 @@ CON_FUNC_RETURN tls_construct_server_hello(SSL_CONNECTION *s, WPACKET *pkt)
     if (usetls13) {
         sl = s->tmp_session_id_len;
         session_id = s->tmp_session_id;
+    } else if (usedtls13) {
+        sl = 0;
+        session_id = NULL;
     } else {
         sl = s->session->session_id_length;
         session_id = s->session->session_id;
@@ -2502,7 +2862,7 @@ CON_FUNC_RETURN tls_construct_server_hello(SSL_CONNECTION *s, WPACKET *pkt)
 #ifdef OPENSSL_NO_COMP
     compm = 0;
 #else
-    if (usetls13 || s->s3.tmp.new_compression == NULL)
+    if (usetls13 || usedtls13 || s->s3.tmp.new_compression == NULL)
         compm = 0;
     else
         compm = s->s3.tmp.new_compression->id;
@@ -2519,7 +2879,7 @@ CON_FUNC_RETURN tls_construct_server_hello(SSL_CONNECTION *s, WPACKET *pkt)
     if (!tls_construct_extensions(s, pkt,
             s->hello_retry_request == SSL_HRR_PENDING
                 ? SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST
-                : (SSL_CONNECTION_IS_TLS13(s)
+                : (SSL_CONNECTION_IS_VERSION13(s)
                           ? SSL_EXT_TLS1_3_SERVER_HELLO
                           : SSL_EXT_TLS1_2_SERVER_HELLO),
             NULL, 0)) {
@@ -2537,22 +2897,156 @@ CON_FUNC_RETURN tls_construct_server_hello(SSL_CONNECTION *s, WPACKET *pkt)
          * Re-initialise the Transcript Hash. We're going to prepopulate it with
          * a synthetic message_hash in place of ClientHello1.
          */
-        if (!create_synthetic_message_hash(s, NULL, 0, NULL, 0)) {
+#ifndef OPENSSL_NO_ECH
+        /*
+         * if we're sending 2nd SH after HRR and we did ECH
+         * then we want to inject the hash of the inner CH1
+         * and not the outer (which is the default)
+         */
+        OSSL_TRACE_BEGIN(TLS)
+        {
+            BIO_printf(trc_out, "Checking success (%d)/innerCH (%p)\n",
+                s->ext.ech.success, (void *)s->ext.ech.innerch);
+        }
+        OSSL_TRACE_END(TLS);
+        if ((s->ext.ech.backend == 1 || s->ext.ech.success == 1)
+            && s->ext.ech.innerch != NULL) {
+            /* do pre-existing HRR stuff */
+            unsigned char hashval[EVP_MAX_MD_SIZE];
+            unsigned int hashlen;
+            EVP_MD_CTX *ctx = EVP_MD_CTX_new();
+            const EVP_MD *md = NULL;
+
+            OSSL_TRACE(TLS, "Adding in digest of ClientHello\n");
+#ifdef OSSL_ECH_SUPERVERBOSE
+            ossl_ech_pbuf("innerch", s->ext.ech.innerch,
+                s->ext.ech.innerch_len);
+#endif
+            if (ctx == NULL) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return CON_FUNC_ERROR;
+            }
+            md = ssl_handshake_md(s);
+            if (md == NULL) {
+                EVP_MD_CTX_free(ctx);
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return CON_FUNC_ERROR;
+            }
+            if (EVP_DigestInit_ex(ctx, md, NULL) <= 0
+                || EVP_DigestUpdate(ctx, s->ext.ech.innerch,
+                       s->ext.ech.innerch_len)
+                    <= 0
+                || EVP_DigestFinal_ex(ctx, hashval, &hashlen) <= 0) {
+                EVP_MD_CTX_free(ctx);
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return CON_FUNC_ERROR;
+            }
+#ifdef OSSL_ECH_SUPERVERBOSE
+            ossl_ech_pbuf("digested CH", hashval, hashlen);
+#endif
+            EVP_MD_CTX_free(ctx);
+            if (ossl_ech_reset_hs_buffer(s, NULL, 0) != 1) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                return CON_FUNC_ERROR;
+            }
+            if (!create_synthetic_message_hash(s, hashval, hashlen, NULL, 0)) {
+                /* SSLfatal() already called */
+                return CON_FUNC_ERROR;
+            }
+        } else {
+            if (!create_synthetic_message_hash(s, NULL, 0, NULL, 0))
+                return CON_FUNC_ERROR; /* SSLfatal() already called */
+        }
+#else
+        if (!create_synthetic_message_hash(s, NULL, 0, NULL, 0))
             /* SSLfatal() already called */
             return CON_FUNC_ERROR;
-        }
+#endif /* OPENSSL_NO_ECH */
     } else if (!(s->verify_mode & SSL_VERIFY_PEER)
         && !ssl3_digest_cached_records(s, 0)) {
         /* SSLfatal() already called */;
         return CON_FUNC_ERROR;
     }

+#ifndef OPENSSL_NO_ECH
+    /*
+     * Calculate the ECH-accept server random to indicate that
+     * we're accepting ECH, if that's the case
+     */
+    if (s->ext.ech.attempted_type == TLSEXT_TYPE_ech
+        && (s->ext.ech.backend == 1
+            || (s->ext.ech.es != NULL && s->ext.ech.success == 1))) {
+        unsigned char acbuf[8];
+        unsigned char *shbuf = NULL;
+        size_t shlen = 0;
+        size_t shoffset = 0;
+        int hrr = 0;
+
+        if (s->hello_retry_request == SSL_HRR_PENDING)
+            hrr = 1;
+        memset(acbuf, 0, 8);
+        if (WPACKET_get_total_written(pkt, &shlen) != 1) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return CON_FUNC_ERROR;
+        }
+        shbuf = WPACKET_get_curr(pkt) - shlen;
+        /* we need to fixup SH length here */
+        shbuf[1] = ((shlen - 4)) >> 16 & 0xff;
+        shbuf[2] = ((shlen - 4)) >> 8 & 0xff;
+        shbuf[3] = (shlen - 4) & 0xff;
+        if (ossl_ech_intbuf_add(s, shbuf, shlen, hrr) != 1) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return CON_FUNC_ERROR;
+        }
+        if (ossl_ech_calc_confirm(s, hrr, acbuf, shlen) != 1) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return CON_FUNC_ERROR;
+        }
+        memcpy(s->s3.server_random + SSL3_RANDOM_SIZE - 8, acbuf, 8);
+        if (hrr == 0) {
+            /* confirm value hacked into SH.random rightmost octets */
+            shoffset = SSL3_HM_HEADER_LENGTH /* 4 */
+                + CLIENT_VERSION_LEN /* 2 */
+                + SSL3_RANDOM_SIZE /* 32 */
+                - 8;
+            memcpy(shbuf + shoffset, acbuf, 8);
+        } else {
+            /*
+             * confirm value is in extension in HRR case as the SH.random
+             * is already hacked to be a specific value in a HRR
+             */
+            memcpy(WPACKET_get_curr(pkt) - 8, acbuf, 8);
+        }
+    }
+    /* call ECH callback, if appropriate */
+    if (s->ext.ech.attempted == 1 && s->ext.ech.cb != NULL
+        && s->hello_retry_request != SSL_HRR_PENDING) {
+        char pstr[OSSL_ECH_PBUF_SIZE + 1];
+        BIO *biom = BIO_new(BIO_s_mem());
+        unsigned int cbrv = 0;
+
+        if (biom == NULL) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return CON_FUNC_ERROR;
+        }
+        memset(pstr, 0, OSSL_ECH_PBUF_SIZE + 1);
+        ossl_ech_status_print(biom, s, OSSL_ECHSTORE_ALL);
+        BIO_read(biom, pstr, OSSL_ECH_PBUF_SIZE);
+        cbrv = s->ext.ech.cb(&s->ssl, pstr);
+        BIO_free(biom);
+        if (cbrv != 1) {
+            OSSL_TRACE(TLS, "Error from tls_construct_server_hello/ech_cb\n");
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            return CON_FUNC_ERROR;
+        }
+    }
+#endif /* OPENSSL_NO_ECH */
     return CON_FUNC_SUCCESS;
 }

 CON_FUNC_RETURN tls_construct_server_done(SSL_CONNECTION *s, WPACKET *pkt)
 {
-    if (!s->s3.tmp.cert_request) {
+    if (s->s3.tmp.cert_request == 0) {
         if (!ssl3_digest_cached_records(s, 0)) {
             /* SSLfatal() already called */
             return CON_FUNC_ERROR;
@@ -2567,7 +3061,7 @@ CON_FUNC_RETURN tls_construct_server_key_exchange(SSL_CONNECTION *s,
     EVP_PKEY *pkdh = NULL;
     unsigned char *encodedPoint = NULL;
     size_t encodedlen = 0;
-    int curve_id = 0;
+    int group_id = 0;
     const SIGALG_LOOKUP *lu = s->s3.tmp.sigalg;
     int i;
     unsigned long type;
@@ -2601,49 +3095,64 @@ CON_FUNC_RETURN tls_construct_server_key_exchange(SSL_CONNECTION *s,
             CERT *cert = s->cert;
             EVP_PKEY *pkdhp = NULL;

-            if (s->cert->dh_tmp_auto) {
-                pkdh = ssl_get_auto_dh(s);
-                if (pkdh == NULL) {
+            /* Get NID of appropriate shared FFDHE group */
+            group_id = tls1_shared_group(s, TLS1_GROUPS_RETURN_TMP_ID,
+                TLS1_GROUPS_FFDHE_GROUPS);
+            if (group_id != 0) {
+                /* Cache the group used in the SSL_SESSION */
+                s->session->kex_group = group_id;
+
+                s->s3.tmp.pkey = ssl_generate_pkey_group(s, group_id);
+                if (s->s3.tmp.pkey == NULL) {
                     SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
                     goto err;
                 }
-                pkdhp = pkdh;
             } else {
-                pkdhp = cert->dh_tmp;
-            }
+
+                if (s->cert->dh_tmp_auto) {
+                    pkdh = ssl_get_auto_dh(s);
+                    if (pkdh == NULL) {
+                        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                        goto err;
+                    }
+                    pkdhp = pkdh;
+                } else {
+                    pkdhp = cert->dh_tmp;
+                }
 #if !defined(OPENSSL_NO_DEPRECATED_3_0)
-            if ((pkdhp == NULL) && (s->cert->dh_tmp_cb != NULL)) {
-                pkdh = ssl_dh_to_pkey(s->cert->dh_tmp_cb(SSL_CONNECTION_GET_USER_SSL(s),
-                    0, 1024));
-                if (pkdh == NULL) {
+                if ((pkdhp == NULL) && (s->cert->dh_tmp_cb != NULL)) {
+                    pkdh = ssl_dh_to_pkey(
+                        s->cert->dh_tmp_cb(SSL_CONNECTION_GET_USER_SSL(s), 0, 1024));
+                    if (pkdh == NULL) {
+                        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                        goto err;
+                    }
+                    pkdhp = pkdh;
+                }
+#endif
+                if (pkdhp == NULL) {
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_MISSING_TMP_DH_KEY);
+                    goto err;
+                }
+                if (!ssl_security(s, SSL_SECOP_TMP_DH,
+                        EVP_PKEY_get_security_bits(pkdhp), 0, pkdhp)) {
+                    SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, SSL_R_DH_KEY_TOO_SMALL);
+                    goto err;
+                }
+                if (s->s3.tmp.pkey != NULL) {
                     SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
                     goto err;
                 }
-                pkdhp = pkdh;
-            }
-#endif
-            if (pkdhp == NULL) {
-                SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_MISSING_TMP_DH_KEY);
-                goto err;
-            }
-            if (!ssl_security(s, SSL_SECOP_TMP_DH,
-                    EVP_PKEY_get_security_bits(pkdhp), 0, pkdhp)) {
-                SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, SSL_R_DH_KEY_TOO_SMALL);
-                goto err;
-            }
-            if (s->s3.tmp.pkey != NULL) {
-                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-                goto err;
-            }

-            s->s3.tmp.pkey = ssl_generate_pkey(s, pkdhp);
-            if (s->s3.tmp.pkey == NULL) {
-                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-                goto err;
-            }
+                s->s3.tmp.pkey = ssl_generate_pkey(s, pkdhp);
+                if (s->s3.tmp.pkey == NULL) {
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                    goto err;
+                }

-            EVP_PKEY_free(pkdh);
-            pkdh = NULL;
+                EVP_PKEY_free(pkdh);
+                pkdh = NULL;
+            }

             /* These BIGNUMs need to be freed when we're finished */
             freer = 1;
@@ -2663,17 +3172,18 @@ CON_FUNC_RETURN tls_construct_server_key_exchange(SSL_CONNECTION *s,
                 goto err;
             }

-            /* Get NID of appropriate shared curve */
-            curve_id = tls1_shared_group(s, -2);
-            if (curve_id == 0) {
+            /* Get NID of appropriate shared ECDHE curve */
+            group_id = tls1_shared_group(s, TLS1_GROUPS_RETURN_TMP_ID,
+                TLS1_GROUPS_NON_FFDHE_GROUPS);
+            if (group_id == 0) {
                 SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE,
                     SSL_R_UNSUPPORTED_ELLIPTIC_CURVE);
                 goto err;
             }
             /* Cache the group used in the SSL_SESSION */
-            s->session->kex_group = curve_id;
+            s->session->kex_group = group_id;
             /* Generate a new key for this curve */
-            s->s3.tmp.pkey = ssl_generate_pkey_group(s, curve_id);
+            s->s3.tmp.pkey = ssl_generate_pkey_group(s, group_id);
             if (s->s3.tmp.pkey == NULL) {
                 /* SSLfatal() already called */
                 goto err;
@@ -2790,8 +3300,7 @@ CON_FUNC_RETURN tls_construct_server_key_exchange(SSL_CONNECTION *s,
          * point itself
          */
         if (!WPACKET_put_bytes_u8(pkt, NAMED_CURVE_TYPE)
-            || !WPACKET_put_bytes_u8(pkt, 0)
-            || !WPACKET_put_bytes_u8(pkt, curve_id)
+            || !WPACKET_put_bytes_u16(pkt, group_id)
             || !WPACKET_sub_memcpy_u8(pkt, encodedPoint, encodedlen)) {
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             goto err;
@@ -2875,7 +3384,7 @@ err:
 CON_FUNC_RETURN tls_construct_certificate_request(SSL_CONNECTION *s,
     WPACKET *pkt)
 {
-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         /* Send random context when doing post-handshake auth */
         if (s->post_handshake_auth == SSL_PHA_REQUEST_PENDING) {
             OPENSSL_free(s->pha_context);
@@ -3022,8 +3531,8 @@ static int tls_process_cke_rsa(SSL_CONNECTION *s, PACKET *pkt)
         return 0;
     }

-    /* SSLv3 and pre-standard DTLS omit the length bytes. */
-    if (s->version == SSL3_VERSION || s->version == DTLS1_BAD_VER) {
+    /* pre-standard DTLS omits the length bytes. */
+    if (s->version == DTLS1_BAD_VER) {
         enc_premaster = *pkt;
     } else {
         if (!PACKET_get_length_prefixed_2(pkt, &enc_premaster)
@@ -3173,8 +3682,11 @@ static int tls_process_cke_ecdhe(SSL_CONNECTION *s, PACKET *pkt)
          * ClientKeyExchange message.
          */

-        /* Get encoded point length */
-        if (!PACKET_get_1(pkt, &i) || !PACKET_get_bytes(pkt, &data, i)
+        /*
+         * Get encoded point length
+         * empty key should be handled here
+         */
+        if (!PACKET_get_1(pkt, &i) || i == 0 || !PACKET_get_bytes(pkt, &data, i)
             || PACKET_remaining(pkt) != 0) {
             SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
             goto err;
@@ -3256,7 +3768,8 @@ static int tls_process_cke_gost(SSL_CONNECTION *s, PACKET *pkt)
     EVP_PKEY *client_pub_pkey = NULL, *pk = NULL;
     unsigned char premaster_secret[32];
     const unsigned char *start;
-    size_t outlen = sizeof(premaster_secret), inlen;
+    size_t outlen = sizeof(premaster_secret);
+    size_t inlen;
     unsigned long alg_a;
     GOST_KX_MESSAGE *pKX = NULL;
     const unsigned char *ptr;
@@ -3304,7 +3817,7 @@ static int tls_process_cke_gost(SSL_CONNECTION *s, PACKET *pkt)
     ptr = PACKET_data(pkt);
     /* Some implementations provide extra data in the opaqueBlob
      * We have nothing to do with this blob so we just skip it */
-    pKX = d2i_GOST_KX_MESSAGE(NULL, &ptr, PACKET_remaining(pkt));
+    pKX = d2i_GOST_KX_MESSAGE(NULL, &ptr, (long)PACKET_remaining(pkt));
     if (pKX == NULL
         || pKX->kxBlob == NULL
         || ASN1_TYPE_get(pKX->kxBlob) != V_ASN1_SEQUENCE) {
@@ -3322,8 +3835,11 @@ static int tls_process_cke_gost(SSL_CONNECTION *s, PACKET *pkt)
         goto err;
     }

-    inlen = pKX->kxBlob->value.sequence->length;
-    start = pKX->kxBlob->value.sequence->data;
+    inlen = ASN1_STRING_get_length(pKX->kxBlob->value.sequence);
+    if (inlen > INT_MAX)
+        goto err;
+
+    start = ASN1_STRING_get0_data(pKX->kxBlob->value.sequence);

     if (EVP_PKEY_decrypt(pkey_ctx, premaster_secret, &outlen, start,
             inlen)
@@ -3394,7 +3910,6 @@ static int tls_process_cke_gost18(SSL_CONNECTION *s, PACKET *pkt)
         goto err;
     }

-    /* Reuse EVP_PKEY_CTRL_SET_IV, make choice in engine code depending on size */
     if (EVP_PKEY_CTX_ctrl(pkey_ctx, -1, EVP_PKEY_OP_DECRYPT,
             EVP_PKEY_CTRL_SET_IV, 32, rnd_dgst)
         <= 0) {
@@ -3506,7 +4021,12 @@ WORK_STATE tls_post_process_client_key_exchange(SSL_CONNECTION *s,
 {
 #ifndef OPENSSL_NO_SCTP
     if (wst == WORK_MORE_A) {
-        if (SSL_CONNECTION_IS_DTLS(s)) {
+        /*
+         * Before exporting the SCTP auth key we check if DTLSv1.3 has been
+         * negotiated which is not supported.
+         * Refer to draft-tuexen-tsvwg-rfc6083-bis-04 for more info.
+         */
+        if (SSL_CONNECTION_IS_DTLS(s) && !SSL_CONNECTION_IS_DTLS13(s)) {
             unsigned char sctpauthkey[64];
             char labelbuffer[sizeof(DTLS1_SCTP_AUTH_LABEL)];
             size_t labellen;
@@ -3566,17 +4086,62 @@ WORK_STATE tls_post_process_client_key_exchange(SSL_CONNECTION *s,
     return WORK_FINISHED_CONTINUE;
 }

+static void tls_clear_pending_client_identity(SSL_CONNECTION *sc)
+{
+    OSSL_STACK_OF_X509_free(sc->s3.tmp.pending_peer_chain);
+    sc->s3.tmp.pending_peer_chain = NULL;
+    EVP_PKEY_free(sc->s3.tmp.pending_peer_rpk);
+    sc->s3.tmp.pending_peer_rpk = NULL;
+}
+
+/*
+ * Clear old verification state before verifying fresh credentials, or after
+ * accepting an empty initial Certificate response. Empty PHA responses retain
+ * the previous state. Do not clear results produced by the new verification.
+ */
+static void tls_clear_client_verification_state(SSL_CONNECTION *sc, long verify_result)
+{
+    OSSL_STACK_OF_X509_free(sc->verified_chain);
+    sc->verified_chain = NULL;
+    X509_VERIFY_PARAM_move_peername(sc->param, NULL);
+    sc->dane.mdpth = -1;
+    sc->dane.pdpth = -1;
+    X509_free(sc->dane.mcert);
+    sc->dane.mcert = NULL;
+    sc->dane.mtlsa = NULL;
+    sc->verify_result = verify_result;
+}
+
 MSG_PROCESS_RETURN tls_process_client_rpk(SSL_CONNECTION *sc, PACKET *pkt)
 {
-    MSG_PROCESS_RETURN ret = MSG_PROCESS_ERROR;
-    SSL_SESSION *new_sess = NULL;
     EVP_PKEY *peer_rpk = NULL;

     if (!tls_process_rpk(sc, pkt, &peer_rpk)) {
         /* SSLfatal already called */
-        goto err;
+        return MSG_PROCESS_ERROR;
     }

+    /* Stash the parsed RPK; verification runs in the post-process step. */
+    tls_clear_pending_client_identity(sc);
+    sc->s3.tmp.pending_peer_rpk = peer_rpk;
+    if (peer_rpk != NULL)
+        tls_clear_client_verification_state(sc, X509_V_ERR_UNSPECIFIED);
+
+    return MSG_PROCESS_CONTINUE_PROCESSING;
+}
+
+/* Verify the parked RPK; may pause via SSL_set_retry_verify(). */
+static WORK_STATE tls_post_process_client_rpk(SSL_CONNECTION *sc,
+    WORK_STATE wst)
+{
+    EVP_PKEY *peer_rpk = sc->s3.tmp.pending_peer_rpk;
+    SSL_SESSION *new_sess = NULL;
+
+    (void)wst;
+
+    if (SSL_CONNECTION_IS_VERSION13(sc))
+        sc->statem.no_cert_verify = peer_rpk == NULL;
+
     if (peer_rpk == NULL) {
         if ((sc->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)
             && (sc->verify_mode & SSL_VERIFY_PEER)) {
@@ -3585,7 +4150,16 @@ MSG_PROCESS_RETURN tls_process_client_rpk(SSL_CONNECTION *sc, PACKET *pkt)
             goto err;
         }
     } else {
-        if (ssl_verify_rpk(sc, peer_rpk) <= 0) {
+        int v_ok;
+
+        if (sc->rwstate == SSL_RETRY_VERIFY)
+            sc->rwstate = SSL_NOTHING;
+        v_ok = ssl_verify_rpk(sc, peer_rpk);
+        if (v_ok > 0 && sc->rwstate == SSL_RETRY_VERIFY) {
+            /* The verify callback asked to pause; resume here on retry. */
+            return WORK_MORE_A;
+        }
+        if (v_ok <= 0) {
             SSLfatal(sc, ssl_x509err2alert(sc->verify_result),
                 SSL_R_CERTIFICATE_VERIFY_FAILED);
             goto err;
@@ -3596,10 +4170,9 @@ MSG_PROCESS_RETURN tls_process_client_rpk(SSL_CONNECTION *sc, PACKET *pkt)
      * Sessions must be immutable once they go into the session cache. Otherwise
      * we can get multi-thread problems. Therefore we don't "update" sessions,
      * we replace them with a duplicate. Here, we need to do this every time
-     * a new RPK (or certificate) is received via post-handshake authentication,
-     * as the session may have already gone into the session cache.
+     * a PHA response is accepted, even if empty, because refreshed tickets
+     * will update the session's key and ID.
      */
-
     if (sc->post_handshake_auth == SSL_PHA_REQUESTED) {
         if ((new_sess = ssl_session_dup(sc->session, 0)) == NULL) {
             SSLfatal(sc, SSL_AD_INTERNAL_ERROR, ERR_R_MALLOC_FAILURE);
@@ -3610,23 +4183,18 @@ MSG_PROCESS_RETURN tls_process_client_rpk(SSL_CONNECTION *sc, PACKET *pkt)
         sc->session = new_sess;
     }

-    /* Ensure there is no peer/peer_chain */
-    X509_free(sc->session->peer);
-    sc->session->peer = NULL;
-    sk_X509_pop_free(sc->session->peer_chain, X509_free);
-    sc->session->peer_chain = NULL;
-    /* Save RPK */
-    EVP_PKEY_free(sc->session->peer_rpk);
-    sc->session->peer_rpk = peer_rpk;
-    peer_rpk = NULL;
-
-    sc->session->verify_result = sc->verify_result;
+    if (peer_rpk != NULL || sc->post_handshake_auth != SSL_PHA_REQUESTED) {
+        if (peer_rpk == NULL)
+            tls_clear_client_verification_state(sc, X509_V_OK);
+        ossl_session_set0_peer(sc->session, NULL, peer_rpk, sc->verify_result);
+        sc->s3.tmp.pending_peer_rpk = NULL;
+    }

     /*
      * Freeze the handshake buffer. For <TLS1.3 we do this after the CKE
      * message
      */
-    if (SSL_CONNECTION_IS_TLS13(sc)) {
+    if (SSL_CONNECTION_IS_VERSION13(sc)) {
         if (!ssl3_digest_cached_records(sc, 1)) {
             /* SSLfatal() already called */
             goto err;
@@ -3636,7 +4204,7 @@ MSG_PROCESS_RETURN tls_process_client_rpk(SSL_CONNECTION *sc, PACKET *pkt)
         if (!ssl_handshake_hash(sc, sc->cert_verify_hash,
                 sizeof(sc->cert_verify_hash),
                 &sc->cert_verify_hash_len)) {
-            /* SSLfatal() already called */;
+            /* SSLfatal() already called */
             goto err;
         }

@@ -3644,17 +4212,16 @@ MSG_PROCESS_RETURN tls_process_client_rpk(SSL_CONNECTION *sc, PACKET *pkt)
         sc->sent_tickets = 0;
     }

-    ret = MSG_PROCESS_CONTINUE_READING;
+    return WORK_FINISHED_CONTINUE;

 err:
-    EVP_PKEY_free(peer_rpk);
-    return ret;
+    tls_clear_pending_client_identity(sc);
+    return WORK_ERROR;
 }

 MSG_PROCESS_RETURN tls_process_client_certificate(SSL_CONNECTION *s,
     PACKET *pkt)
 {
-    int i;
     MSG_PROCESS_RETURN ret = MSG_PROCESS_ERROR;
     X509 *x = NULL;
     unsigned long l;
@@ -3662,7 +4229,6 @@ MSG_PROCESS_RETURN tls_process_client_certificate(SSL_CONNECTION *s,
     STACK_OF(X509) *sk = NULL;
     PACKET spkt, context;
     size_t chainidx;
-    SSL_SESSION *new_sess = NULL;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);

     /*
@@ -3686,7 +4252,7 @@ MSG_PROCESS_RETURN tls_process_client_certificate(SSL_CONNECTION *s,
         goto err;
     }

-    if (SSL_CONNECTION_IS_TLS13(s)
+    if (SSL_CONNECTION_IS_VERSION13(s)
         && (!PACKET_get_length_prefixed_1(pkt, &context)
             || (s->pha_context == NULL && PACKET_remaining(&context) != 0)
             || (s->pha_context != NULL
@@ -3725,7 +4291,7 @@ MSG_PROCESS_RETURN tls_process_client_certificate(SSL_CONNECTION *s,
             goto err;
         }

-        if (SSL_CONNECTION_IS_TLS13(s)) {
+        if (SSL_CONNECTION_IS_VERSION13(s)) {
             RAW_EXTENSION *rawexts = NULL;
             PACKET extensions;

@@ -3752,27 +4318,74 @@ MSG_PROCESS_RETURN tls_process_client_certificate(SSL_CONNECTION *s,
         x = NULL;
     }

-    if (sk_X509_num(sk) <= 0) {
-        /* TLS does not mind 0 certs returned */
-        if (s->version == SSL3_VERSION) {
-            SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE,
-                SSL_R_NO_CERTIFICATES_RETURNED);
-            goto err;
-        }
-        /* Fail for TLS only if we required a certificate */
-        else if ((s->verify_mode & SSL_VERIFY_PEER) && (s->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)) {
+    /*
+     * Stash the parsed chain so that tls_post_process_client_certificate() can
+     * run verification and may pause the handshake via SSL_set_retry_verify().
+     */
+    tls_clear_pending_client_identity(s);
+    s->s3.tmp.pending_peer_chain = sk;
+    if (sk_X509_num(sk) > 0)
+        tls_clear_client_verification_state(s, X509_V_ERR_UNSPECIFIED);
+
+    return MSG_PROCESS_CONTINUE_PROCESSING;
+
+err:
+    X509_free(x);
+    OSSL_STACK_OF_X509_free(sk);
+    return ret;
+}
+
+/*
+ * Verify the parked chain from tls_process_client_certificate() and finalize
+ * the peer cert / TLS 1.3 handshake-hash bookkeeping.
+ * Allows the verify callback to defer via SSL_set_retry_verify(), in which
+ * case we return WORK_MORE_A and the state machine re-enters this function
+ * once the application has supplied a verdict.
+ */
+WORK_STATE tls_post_process_client_certificate(SSL_CONNECTION *s,
+    WORK_STATE wst)
+{
+    STACK_OF(X509) *sk;
+    SSL_SESSION *new_sess = NULL;
+    EVP_PKEY *pkey;
+    int has_cert, i;
+
+    if (s->ext.client_cert_type == TLSEXT_cert_type_rpk)
+        return tls_post_process_client_rpk(s, wst);
+
+    sk = s->s3.tmp.pending_peer_chain;
+    (void)wst;
+
+    has_cert = sk != NULL && sk_X509_num(sk) > 0;
+    if (SSL_CONNECTION_IS_VERSION13(s))
+        s->statem.no_cert_verify = !has_cert;
+    if (!has_cert) {
+        /* Fail only if we required a certificate */
+        if ((s->verify_mode & SSL_VERIFY_PEER)
+            && (s->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)) {
             SSLfatal(s, SSL_AD_CERTIFICATE_REQUIRED,
                 SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE);
             goto err;
         }
+
         /* No client certificate so digest cached records */
         if (s->s3.handshake_buffer && !ssl3_digest_cached_records(s, 0)) {
             /* SSLfatal() already called */
             goto err;
         }
     } else {
-        EVP_PKEY *pkey;
+        if (s->rwstate == SSL_RETRY_VERIFY)
+            s->rwstate = SSL_NOTHING;
         i = ssl_verify_cert_chain(s, sk);
+        if (i > 0 && s->rwstate == SSL_RETRY_VERIFY) {
+            /*
+             * The application's verify callback asked us to pause via
+             * SSL_set_retry_verify(); SSL_do_handshake() will return
+             * SSL_ERROR_WANT_RETRY_VERIFY and the state machine resumes here
+             * once the callback is invoked again.
+             */
+            return WORK_MORE_A;
+        }
         if (i <= 0) {
             SSLfatal(s, ssl_x509err2alert(s->verify_result),
                 SSL_R_CERTIFICATE_VERIFY_FAILED);
@@ -3790,10 +4403,9 @@ MSG_PROCESS_RETURN tls_process_client_certificate(SSL_CONNECTION *s,
      * Sessions must be immutable once they go into the session cache. Otherwise
      * we can get multi-thread problems. Therefore we don't "update" sessions,
      * we replace them with a duplicate. Here, we need to do this every time
-     * a new certificate is received via post-handshake authentication, as the
-     * session may have already gone into the session cache.
+     * a PHA response is accepted, even if empty, because refreshed tickets
+     * will update the session's key and ID.
      */
-
     if (s->post_handshake_auth == SSL_PHA_REQUESTED) {
         if ((new_sess = ssl_session_dup(s->session, 0)) == 0) {
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_SSL_LIB);
@@ -3804,33 +4416,28 @@ MSG_PROCESS_RETURN tls_process_client_certificate(SSL_CONNECTION *s,
         s->session = new_sess;
     }

-    X509_free(s->session->peer);
-    s->session->peer = sk_X509_shift(sk);
-    s->session->verify_result = s->verify_result;
-
-    OSSL_STACK_OF_X509_free(s->session->peer_chain);
-    s->session->peer_chain = sk;
-    sk = NULL;
-    /* Ensure there is no RPK */
-    EVP_PKEY_free(s->session->peer_rpk);
-    s->session->peer_rpk = NULL;
+    if (!has_cert) {
+        tls_clear_pending_client_identity(s);
+        sk = NULL;
+        if (s->post_handshake_auth != SSL_PHA_REQUESTED)
+            tls_clear_client_verification_state(s, X509_V_OK);
+    }
+    if (has_cert || s->post_handshake_auth != SSL_PHA_REQUESTED) {
+        ossl_session_set0_peer(s->session, sk, NULL, s->verify_result);
+        s->s3.tmp.pending_peer_chain = NULL;
+    }

     /*
      * Freeze the handshake buffer. For <TLS1.3 we do this after the CKE
      * message
      */
-    if (SSL_CONNECTION_IS_TLS13(s) && !ssl3_digest_cached_records(s, 1)) {
+    if (SSL_CONNECTION_IS_VERSION13(s) && !ssl3_digest_cached_records(s, 1)) {
         /* SSLfatal() already called */
         goto err;
     }

-    /*
-     * Inconsistency alert: cert_chain does *not* include the peer's own
-     * certificate, while we do include it in statem_clnt.c
-     */
-
     /* Save the current hash state for when we receive the CertificateVerify */
-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         if (!ssl_handshake_hash(s, s->cert_verify_hash,
                 sizeof(s->cert_verify_hash),
                 &s->cert_verify_hash_len)) {
@@ -3842,12 +4449,11 @@ MSG_PROCESS_RETURN tls_process_client_certificate(SSL_CONNECTION *s,
         s->sent_tickets = 0;
     }

-    ret = MSG_PROCESS_CONTINUE_READING;
+    return WORK_FINISHED_CONTINUE;

 err:
-    X509_free(x);
-    OSSL_STACK_OF_X509_free(sk);
-    return ret;
+    tls_clear_pending_client_identity(s);
+    return WORK_ERROR;
 }

 #ifndef OPENSSL_NO_COMP_ALG
@@ -3878,7 +4484,7 @@ CON_FUNC_RETURN tls_construct_server_certificate(SSL_CONNECTION *s, WPACKET *pkt
      * In TLSv1.3 the certificate chain is always preceded by a 0 length context
      * for the server Certificate message
      */
-    if (SSL_CONNECTION_IS_TLS13(s) && !WPACKET_put_bytes_u8(pkt, 0)) {
+    if (SSL_CONNECTION_IS_VERSION13(s) && !WPACKET_put_bytes_u8(pkt, 0)) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return CON_FUNC_ERROR;
     }
@@ -3939,13 +4545,13 @@ static int create_ticket_prequel(SSL_CONNECTION *s, WPACKET *pkt,
     /*
      * Ticket lifetime hint:
      * In TLSv1.3 we reset the "time" field above, and always specify the
-     * timeout, limited to a 1 week period per RFC8446.
+     * timeout, limited to a 1 week period per RFC9846.
      * For TLSv1.2 this is advisory only and we leave this unspecified for
      * resumed session (for simplicity).
      */
 #define ONE_WEEK_SEC (7 * 24 * 60 * 60)

-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         if (ossl_time_compare(s->session->timeout,
                 ossl_seconds2time(ONE_WEEK_SEC))
             > 0)
@@ -3958,7 +4564,7 @@ static int create_ticket_prequel(SSL_CONNECTION *s, WPACKET *pkt,
         return 0;
     }

-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         if (!WPACKET_put_bytes_u32(pkt, age_add)
             || !WPACKET_sub_memcpy_u8(pkt, tick_nonce, TICKET_NONCE_SIZE)) {
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
@@ -3982,7 +4588,7 @@ static CON_FUNC_RETURN construct_stateless_ticket(SSL_CONNECTION *s,
 {
     unsigned char *senc = NULL;
     EVP_CIPHER_CTX *ctx = NULL;
-    SSL_HMAC *hctx = NULL;
+    SSL_HMAC hctx, *constructed_hctx = NULL;
     unsigned char *p, *encdata1, *encdata2, *macdata1, *macdata2;
     const unsigned char *const_p;
     int len, slen_full, slen, lenfinal;
@@ -4018,8 +4624,7 @@ static CON_FUNC_RETURN construct_stateless_ticket(SSL_CONNECTION *s,
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
         goto err;
     }
-    hctx = ssl_hmac_new(tctx);
-    if (hctx == NULL) {
+    if ((constructed_hctx = ssl_hmac_construct(tctx, &hctx)) == NULL) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_SSL_LIB);
         goto err;
     }
@@ -4070,13 +4675,13 @@ static CON_FUNC_RETURN construct_stateless_ticket(SSL_CONNECTION *s,

         if (tctx->ext.ticket_key_evp_cb != NULL)
             ret = tctx->ext.ticket_key_evp_cb(ssl, key_name, iv, ctx,
-                ssl_hmac_get0_EVP_MAC_CTX(hctx),
+                ssl_hmac_get0_EVP_MAC_CTX(&hctx),
                 1);
 #ifndef OPENSSL_NO_DEPRECATED_3_0
         else if (tctx->ext.ticket_key_cb != NULL)
             /* if 0 is returned, write an empty ticket */
             ret = tctx->ext.ticket_key_cb(ssl, key_name, iv, ctx,
-                ssl_hmac_get0_HMAC_CTX(hctx), 1);
+                ssl_hmac_get0_HMAC_CTX(&hctx), 1);
 #endif

         if (ret == 0) {
@@ -4085,7 +4690,7 @@ static CON_FUNC_RETURN construct_stateless_ticket(SSL_CONNECTION *s,
              * length ticket is not allowed so we abort construction of the
              * ticket
              */
-            if (SSL_CONNECTION_IS_TLS13(s)) {
+            if (SSL_CONNECTION_IS_VERSION13(s)) {
                 ok = CON_FUNC_DONT_SEND;
                 goto err;
             }
@@ -4097,7 +4702,7 @@ static CON_FUNC_RETURN construct_stateless_ticket(SSL_CONNECTION *s,
             }
             OPENSSL_free(senc);
             EVP_CIPHER_CTX_free(ctx);
-            ssl_hmac_free(hctx);
+            ssl_hmac_destruct(constructed_hctx);
             return CON_FUNC_SUCCESS;
         }
         if (ret < 0) {
@@ -4110,28 +4715,17 @@ static CON_FUNC_RETURN construct_stateless_ticket(SSL_CONNECTION *s,
             goto err;
         }
     } else {
-        EVP_CIPHER *cipher = EVP_CIPHER_fetch(sctx->libctx, "AES-256-CBC",
-            sctx->propq);
-
-        if (cipher == NULL) {
-            /* Error is already recorded */
-            SSLfatal_alert(s, SSL_AD_INTERNAL_ERROR);
-            goto err;
-        }
-
-        iv_len = EVP_CIPHER_get_iv_length(cipher);
+        iv_len = EVP_CIPHER_get_iv_length(sctx->tktenc);
         if (iv_len < 0
             || RAND_bytes_ex(sctx->libctx, iv, iv_len, 0) <= 0
-            || !EVP_EncryptInit_ex(ctx, cipher, NULL,
+            || !EVP_EncryptInit_ex(ctx, sctx->tktenc, NULL,
                 tctx->ext.secure->tick_aes_key, iv)
-            || !ssl_hmac_init(hctx, tctx->ext.secure->tick_hmac_key,
+            || !ssl_hmac_init(&hctx, tctx->ext.secure->tick_hmac_key,
                 sizeof(tctx->ext.secure->tick_hmac_key),
                 "SHA256")) {
-            EVP_CIPHER_free(cipher);
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             goto err;
         }
-        EVP_CIPHER_free(cipher);
         memcpy(key_name, tctx->ext.tick_key_name,
             sizeof(tctx->ext.tick_key_name));
     }
@@ -4157,11 +4751,11 @@ static CON_FUNC_RETURN construct_stateless_ticket(SSL_CONNECTION *s,
         || encdata1 + len != encdata2
         || len + lenfinal > slen + EVP_MAX_BLOCK_LENGTH
         || !WPACKET_get_total_written(pkt, &macendoffset)
-        || !ssl_hmac_update(hctx,
+        || !ssl_hmac_update(&hctx,
             (unsigned char *)s->init_buf->data + macoffset,
             macendoffset - macoffset)
         || !WPACKET_reserve_bytes(pkt, EVP_MAX_MD_SIZE, &macdata1)
-        || !ssl_hmac_final(hctx, macdata1, &hlen, EVP_MAX_MD_SIZE)
+        || !ssl_hmac_final(&hctx, macdata1, &hlen, EVP_MAX_MD_SIZE)
         || hlen > EVP_MAX_MD_SIZE
         || !WPACKET_allocate_bytes(pkt, hlen, &macdata2)
         || macdata1 != macdata2) {
@@ -4179,7 +4773,7 @@ static CON_FUNC_RETURN construct_stateless_ticket(SSL_CONNECTION *s,
 err:
     OPENSSL_free(senc);
     EVP_CIPHER_CTX_free(ctx);
-    ssl_hmac_free(hctx);
+    ssl_hmac_destruct(constructed_hctx);
     return ok;
 }

@@ -4228,7 +4822,7 @@ CON_FUNC_RETURN tls_construct_new_session_ticket(SSL_CONNECTION *s, WPACKET *pkt

     age_add_u.age_add = 0;

-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         size_t i, hashlen;
         uint64_t nonce;
         /* ASCII: "resumption", in hex for EBCDIC compatibility */
@@ -4302,6 +4896,18 @@ CON_FUNC_RETURN tls_construct_new_session_ticket(SSL_CONNECTION *s, WPACKET *pkt
                 goto err;
             }
             s->session->ext.alpn_selected_len = s->s3.alpn_selected_len;
+        } else {
+            /*
+             * No ALPN was negotiated on this handshake. If we resumed a
+             * session that had previously negotiated ALPN, the stale value
+             * must be cleared from the (copied) session before it is stored
+             * in the new ticket. Otherwise a subsequent 0-RTT attempt using
+             * that ticket would incorrectly assume an ALPN protocol had been
+             * negotiated. See tls_handle_alpn().
+             */
+            OPENSSL_free(s->session->ext.alpn_selected);
+            s->session->ext.alpn_selected = NULL;
+            s->session->ext.alpn_selected_len = 0;
         }
         s->session->ext.max_early_data = s->max_early_data;
     }
@@ -4315,7 +4921,7 @@ CON_FUNC_RETURN tls_construct_new_session_ticket(SSL_CONNECTION *s, WPACKET *pkt
      * SSL_OP_NO_TICKET is set - we are caching tickets anyway so there
      * is no point in using full stateless tickets.
      */
-    if (SSL_CONNECTION_IS_TLS13(s)
+    if (SSL_CONNECTION_IS_VERSION13(s)
         && ((s->options & SSL_OP_NO_TICKET) != 0
             || (s->max_early_data > 0
                 && (s->options & SSL_OP_NO_ANTI_REPLAY) == 0))) {
@@ -4340,7 +4946,7 @@ CON_FUNC_RETURN tls_construct_new_session_ticket(SSL_CONNECTION *s, WPACKET *pkt
         }
     }

-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         if (!tls_construct_extensions(s, pkt,
                 SSL_EXT_TLS1_3_NEW_SESSION_TICKET,
                 NULL, 0)) {
@@ -4360,21 +4966,40 @@ err:
  * In TLSv1.3 this is called from the extensions code, otherwise it is used to
  * create a separate message. Returns 1 on success or 0 on failure.
  */
-int tls_construct_cert_status_body(SSL_CONNECTION *s, WPACKET *pkt)
+int tls_construct_cert_status_body(SSL_CONNECTION *s, OCSP_RESPONSE *resp, WPACKET *pkt)
 {
-    if (!WPACKET_put_bytes_u8(pkt, s->ext.status_type)
-        || !WPACKET_sub_memcpy_u24(pkt, s->ext.ocsp.resp,
-            s->ext.ocsp.resp_len)) {
+    unsigned char *respder = NULL;
+    int resplen = 0;
+
+    if (!WPACKET_put_bytes_u8(pkt, s->ext.status_type)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        return 0;
+    }
+
+#ifndef OPENSSL_NO_OCSP
+    resplen = i2d_OCSP_RESPONSE(resp, &respder);
+#endif
+
+    if (!WPACKET_sub_memcpy_u24(pkt, respder, resplen)) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        OPENSSL_free(respder);
         return 0;
     }

+    OPENSSL_free(respder);
     return 1;
 }

 CON_FUNC_RETURN tls_construct_cert_status(SSL_CONNECTION *s, WPACKET *pkt)
 {
-    if (!tls_construct_cert_status_body(s, pkt)) {
+    OCSP_RESPONSE *resp;
+
+    resp = ossl_get_ocsp_response(s, 0);
+
+    if (resp == NULL)
+        return CON_FUNC_DONT_SEND;
+
+    if (!tls_construct_cert_status_body(s, resp, pkt)) {
         /* SSLfatal() already called */
         return CON_FUNC_ERROR;
     }
diff --git a/deps/openssl/openssl/ssl/t1_enc.c b/deps/openssl/openssl/ssl/t1_enc.c
index 8978e0c630e..417c58672dc 100644
--- a/deps/openssl/openssl/ssl/t1_enc.c
+++ b/deps/openssl/openssl/ssl/t1_enc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2005 Nokia. All rights reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -33,10 +33,7 @@ static int tls1_PRF(SSL_CONNECTION *s,
     unsigned char *out, size_t olen, int fatal)
 {
     const EVP_MD *md = ssl_prf_md(s);
-    EVP_KDF *kdf;
     EVP_KDF_CTX *kctx = NULL;
-    OSSL_PARAM params[8], *p = params;
-    const char *mdname;

     if (md == NULL) {
         /* Should never happen */
@@ -46,16 +43,13 @@ static int tls1_PRF(SSL_CONNECTION *s,
             ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
         return 0;
     }
-    kdf = EVP_KDF_fetch(SSL_CONNECTION_GET_CTX(s)->libctx,
-        OSSL_KDF_NAME_TLS1_PRF,
-        SSL_CONNECTION_GET_CTX(s)->propq);
-    if (kdf == NULL)
-        goto err;
-    kctx = EVP_KDF_CTX_new(kdf);
-    EVP_KDF_free(kdf);
+#ifdef OPENSSL_HAVE_TLS1PRF
+    kctx = EVP_KDF_CTX_new(SSL_CONNECTION_GET_CTX(s)->tls1prf);
     if (kctx == NULL)
         goto err;
-    mdname = EVP_MD_get0_name(md);
+
+    const char *mdname = EVP_MD_get0_name(md);
+    OSSL_PARAM params[9], *p = params;
     *p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST,
         (char *)mdname, 0);
     *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_SECRET,
@@ -71,6 +65,13 @@ static int tls1_PRF(SSL_CONNECTION *s,
         (void *)seed4, (size_t)seed4_len);
     *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_SEED,
         (void *)seed5, (size_t)seed5_len);
+    /*
+     * If we have a property query string, the kdf needs to know about it in the event
+     * the specific kdf in use allocated a digest as part of its implementation
+     */
+    if (SSL_CONNECTION_GET_CTX(s)->propq != NULL)
+        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_PROPERTIES,
+            (char *)SSL_CONNECTION_GET_CTX(s)->propq, 0);
     *p = OSSL_PARAM_construct_end();
     if (EVP_KDF_derive(kctx, out, olen, params)) {
         EVP_KDF_CTX_free(kctx);
@@ -78,6 +79,7 @@ static int tls1_PRF(SSL_CONNECTION *s,
     }

 err:
+#endif
     if (fatal)
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
     else
@@ -229,14 +231,16 @@ int tls1_change_cipher_state(SSL_CONNECTION *s, int which)
         direction = OSSL_RECORD_DIRECTION_WRITE;
     }

-    if (SSL_CONNECTION_IS_DTLS(s))
-        dtls1_increment_epoch(s, which);
+    if (SSL_CONNECTION_IS_DTLS(s) && !dtls1_increment_epoch(s, which)) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+        goto err;
+    }

     if (!ssl_set_new_record_layer(s, s->version, direction,
             OSSL_RECORD_PROTECTION_LEVEL_APPLICATION,
-            NULL, 0, key, cl, iv, (size_t)k, mac_secret,
-            mac_secret_size, c, taglen, mac_type,
-            m, comp, NULL)) {
+            NULL, 0, NULL, key, cl, iv, (size_t)k,
+            mac_secret, mac_secret_size, NULL, c, taglen,
+            mac_type, m, comp, NULL)) {
         /* SSLfatal already called */
         goto err;
     }
@@ -246,7 +250,7 @@ int tls1_change_cipher_state(SSL_CONNECTION *s, int which)
         BIO_printf(trc_out, "which = %04X, key:\n", which);
         BIO_dump_indent(trc_out, key, EVP_CIPHER_get_key_length(c), 4);
         BIO_printf(trc_out, "iv:\n");
-        BIO_dump_indent(trc_out, iv, k, 4);
+        BIO_dump_indent(trc_out, iv, (int)k, 4);
     }
     OSSL_TRACE_END(TLS);

@@ -269,8 +273,8 @@ int tls1_setup_key_block(SSL_CONNECTION *s)
     if (s->s3.tmp.key_block_length != 0)
         return 1;

-    if (!ssl_cipher_get_evp(SSL_CONNECTION_GET_CTX(s), s->session, &c, &hash,
-            &mac_type, &mac_secret_size, &comp,
+    if (!ssl_cipher_get_evp(SSL_CONNECTION_GET_CTX(s), s->session, NULL, &c,
+            &hash, &mac_type, &mac_secret_size, &comp,
             s->ext.use_etm)) {
         /* Error is already recorded */
         SSLfatal_alert(s, SSL_AD_INTERNAL_ERROR);
@@ -311,7 +315,7 @@ int tls1_setup_key_block(SSL_CONNECTION *s)
         BIO_printf(trc_out, "master key\n");
         BIO_dump_indent(trc_out,
             s->session->master_key,
-            s->session->master_key_length, 4);
+            (int)s->session->master_key_length, 4);
     }
     OSSL_TRACE_END(TLS);

@@ -323,7 +327,7 @@ int tls1_setup_key_block(SSL_CONNECTION *s)
     OSSL_TRACE_BEGIN(TLS)
     {
         BIO_printf(trc_out, "key block\n");
-        BIO_dump_indent(trc_out, p, num, 4);
+        BIO_dump_indent(trc_out, p, (int)num, 4);
     }
     OSSL_TRACE_END(TLS);

@@ -382,7 +386,7 @@ int tls1_generate_master_secret(SSL_CONNECTION *s, unsigned char *out,
         OSSL_TRACE_BEGIN(TLS)
         {
             BIO_printf(trc_out, "Handshake hashes:\n");
-            BIO_dump(trc_out, (char *)hash, hashlen);
+            BIO_dump(trc_out, (char *)hash, (int)hashlen);
         }
         OSSL_TRACE_END(TLS);
         if (!tls1_PRF(s,
@@ -414,7 +418,7 @@ int tls1_generate_master_secret(SSL_CONNECTION *s, unsigned char *out,
     OSSL_TRACE_BEGIN(TLS)
     {
         BIO_printf(trc_out, "Premaster Secret:\n");
-        BIO_dump_indent(trc_out, p, len, 4);
+        BIO_dump_indent(trc_out, p, (int)len, 4);
         BIO_printf(trc_out, "Client Random:\n");
         BIO_dump_indent(trc_out, s->s3.client_random, SSL3_RANDOM_SIZE, 4);
         BIO_printf(trc_out, "Server Random:\n");
@@ -462,7 +466,7 @@ int tls1_export_keying_material(SSL_CONNECTION *s, unsigned char *out,
     if (val == NULL)
         goto ret;
     currentvalpos = 0;
-    memcpy(val + currentvalpos, (unsigned char *)label, llen);
+    memcpy(val + currentvalpos, label, llen);
     currentvalpos += llen;
     memcpy(val + currentvalpos, s->s3.client_random, SSL3_RANDOM_SIZE);
     currentvalpos += SSL3_RANDOM_SIZE;
@@ -593,6 +597,10 @@ int tls1_alert_code(int code)
         return SSL_AD_HANDSHAKE_FAILURE;
     case TLS13_AD_MISSING_EXTENSION:
         return SSL_AD_HANDSHAKE_FAILURE;
+#ifndef OPENSSL_NO_ECH
+    case SSL_AD_ECH_REQUIRED:
+        return TLS1_AD_ECH_REQUIRED;
+#endif
     default:
         return -1;
     }
diff --git a/deps/openssl/openssl/ssl/t1_lib.c b/deps/openssl/openssl/ssl/t1_lib.c
index ef1114172a2..e9575fdfe60 100644
--- a/deps/openssl/openssl/ssl/t1_lib.c
+++ b/deps/openssl/openssl/ssl/t1_lib.c
@@ -29,6 +29,8 @@
 #include "quic/quic_local.h"
 #include <openssl/ct.h>

+#define MAX_SIGALGS 128
+
 static const SIGALG_LOOKUP *find_sig_alg(SSL_CONNECTION *s, X509 *x, EVP_PKEY *pkey);
 static int tls12_sigalg_allowed(const SSL_CONNECTION *s, int op, const SIGALG_LOOKUP *lu);

@@ -194,6 +196,10 @@ static const struct {
 };

 static const unsigned char ecformats_default[] = {
+    TLSEXT_ECPOINTFORMAT_uncompressed
+};
+
+static const unsigned char ecformats_all[] = {
     TLSEXT_ECPOINTFORMAT_uncompressed,
     TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime,
     TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2
@@ -201,8 +207,12 @@ static const unsigned char ecformats_default[] = {

 /* Group list string of the built-in pseudo group DEFAULT */
 #define DEFAULT_GROUP_NAME "DEFAULT"
-#define TLS_DEFAULT_GROUP_LIST \
-    "?*X25519MLKEM768 / ?*X25519:?secp256r1 / ?X448:?secp384r1:?secp521r1 / ?ffdhe2048:?ffdhe3072"
+#define TLS_DEFAULT_GROUP_LIST                                 \
+    "?*X25519MLKEM768:?SecP256r1MLKEM768:?curveSM2MLKEM768 / " \
+    "?*X25519:?secp256r1 / "                                   \
+    "?X448:?secp384r1:?secp521r1 / "                           \
+    "?curveSM2 / "                                             \
+    "?ffdhe2048:?ffdhe3072"

 static const uint16_t suiteb_curves[] = {
     OSSL_TLS_GROUP_ID_secp256r1,
@@ -235,13 +245,13 @@ static int add_provider_groups(const OSSL_PARAM params[], void *data)
         TLS_GROUP_INFO *tmp = NULL;

         if (ctx->group_list_max_len == 0)
-            tmp = OPENSSL_malloc(sizeof(TLS_GROUP_INFO)
-                * TLS_GROUP_LIST_MALLOC_BLOCK_SIZE);
+            tmp = OPENSSL_malloc_array(TLS_GROUP_LIST_MALLOC_BLOCK_SIZE,
+                sizeof(TLS_GROUP_INFO));
         else
-            tmp = OPENSSL_realloc(ctx->group_list,
-                (ctx->group_list_max_len
-                    + TLS_GROUP_LIST_MALLOC_BLOCK_SIZE)
-                    * sizeof(TLS_GROUP_INFO));
+            tmp = OPENSSL_realloc_array(ctx->group_list,
+                ctx->group_list_max_len
+                    + TLS_GROUP_LIST_MALLOC_BLOCK_SIZE,
+                sizeof(TLS_GROUP_INFO));
         if (tmp == NULL)
             return 0;
         ctx->group_list = tmp;
@@ -323,6 +333,15 @@ static int add_provider_groups(const OSSL_PARAM params[], void *data)
         ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
         goto err;
     }
+
+    if (ginf->group_id >= OSSL_TLS_GROUP_ID_ffdhe2048
+        && ginf->group_id <= OSSL_TLS_GROUP_ID_ffdhe8192) {
+        if (ginf->mintls > TLS1_2_VERSION)
+            ginf->mintls = TLS1_VERSION;
+        if (DTLS_VERSION_GT(ginf->mindtls, DTLS1_2_VERSION))
+            ginf->mindtls = DTLS1_VERSION;
+    }
+
     /*
      * Now check that the algorithm is actually usable for our property query
      * string. Regardless of the result we still return success because we have
@@ -394,13 +413,13 @@ static int add_provider_sigalgs(const OSSL_PARAM params[], void *data)
         TLS_SIGALG_INFO *tmp = NULL;

         if (ctx->sigalg_list_max_len == 0)
-            tmp = OPENSSL_malloc(sizeof(TLS_SIGALG_INFO)
-                * TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE);
+            tmp = OPENSSL_malloc_array(TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE,
+                sizeof(TLS_SIGALG_INFO));
         else
-            tmp = OPENSSL_realloc(ctx->sigalg_list,
-                (ctx->sigalg_list_max_len
-                    + TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE)
-                    * sizeof(TLS_SIGALG_INFO));
+            tmp = OPENSSL_realloc_array(ctx->sigalg_list,
+                ctx->sigalg_list_max_len
+                    + TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE,
+                sizeof(TLS_SIGALG_INFO));
         if (tmp == NULL)
             return 0;
         ctx->sigalg_list = tmp;
@@ -551,8 +570,6 @@ static int add_provider_sigalgs(const OSSL_PARAM params[], void *data)
         ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
         goto err;
     }
-    /* No provider sigalgs are supported in DTLS, reset after checking. */
-    sinf->mindtls = sinf->maxdtls = -1;

     /* The remaining parameters below are mandatory again */
     p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_MIN_TLS);
@@ -565,13 +582,20 @@ static int add_provider_sigalgs(const OSSL_PARAM params[], void *data)
         ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
         goto err;
     }
-    if ((sinf->maxtls != 0) && (sinf->maxtls != -1) && ((sinf->maxtls < sinf->mintls))) {
+    /*
+     * There are no discrepancies for signature algs between comparable
+     * versions of tls and dtls. Hence we check tls versions only.
+     */
+    if ((sinf->maxtls != 0) && (sinf->maxtls != -1)
+        && ((sinf->maxtls < sinf->mintls))) {
         ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
         goto err;
     }
-    if ((sinf->mintls != 0) && (sinf->mintls != -1) && ((sinf->mintls > TLS1_3_VERSION)))
+    if ((sinf->mintls != 0) && (sinf->mintls != -1)
+        && ((sinf->mintls > TLS1_3_VERSION)))
         sinf->mintls = sinf->maxtls = -1;
-    if ((sinf->maxtls != 0) && (sinf->maxtls != -1) && ((sinf->maxtls < TLS1_3_VERSION)))
+    if ((sinf->maxtls != 0) && (sinf->maxtls != -1)
+        && ((sinf->maxtls < TLS1_3_VERSION)))
         sinf->mintls = sinf->maxtls = -1;

     /* Ignore unusable sigalgs */
@@ -684,7 +708,7 @@ int ssl_load_sigalgs(SSL_CTX *ctx)
     /* now populate ctx->ssl_cert_info */
     if (ctx->sigalg_list_len > 0) {
         OPENSSL_free(ctx->ssl_cert_info);
-        ctx->ssl_cert_info = OPENSSL_zalloc(sizeof(lu) * ctx->sigalg_list_len);
+        ctx->ssl_cert_info = OPENSSL_calloc(ctx->sigalg_list_len, sizeof(lu));
         if (ctx->ssl_cert_info == NULL)
             return 0;
         for (i = 0; i < ctx->sigalg_list_len; i++) {
@@ -853,25 +877,26 @@ void tls1_get_group_tuples(SSL_CONNECTION *s, const size_t **ptuples,
 }

 int tls_valid_group(SSL_CONNECTION *s, uint16_t group_id,
-    int minversion, int maxversion,
-    int isec, int *okfortls13)
+    int minversion, int maxversion, int *okfortls13,
+    const TLS_GROUP_INFO **giptr)
 {
     const TLS_GROUP_INFO *ginfo = tls1_group_id_lookup(SSL_CONNECTION_GET_CTX(s),
         group_id);
-    int ret;
+    int ret = 0;
     int group_minversion, group_maxversion;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;

     if (okfortls13 != NULL)
         *okfortls13 = 0;

     if (ginfo == NULL)
-        return 0;
+        goto end;

     group_minversion = SSL_CONNECTION_IS_DTLS(s) ? ginfo->mindtls : ginfo->mintls;
     group_maxversion = SSL_CONNECTION_IS_DTLS(s) ? ginfo->maxdtls : ginfo->maxtls;

     if (group_minversion < 0 || group_maxversion < 0)
-        return 0;
+        goto end;
     if (group_maxversion == 0)
         ret = 1;
     else
@@ -879,16 +904,12 @@ int tls_valid_group(SSL_CONNECTION *s, uint16_t group_id,
     if (group_minversion > 0)
         ret &= (ssl_version_cmp(s, maxversion, group_minversion) >= 0);

-    if (!SSL_CONNECTION_IS_DTLS(s)) {
-        if (ret && okfortls13 != NULL && maxversion == TLS1_3_VERSION)
-            *okfortls13 = (group_maxversion == 0)
-                || (group_maxversion >= TLS1_3_VERSION);
-    }
-    ret &= !isec
-        || strcmp(ginfo->algorithm, "EC") == 0
-        || strcmp(ginfo->algorithm, "X25519") == 0
-        || strcmp(ginfo->algorithm, "X448") == 0;
-
+    if (ret && okfortls13 != NULL && maxversion == version1_3)
+        *okfortls13 = (group_maxversion == 0)
+            || (ssl_version_cmp(s, group_maxversion, maxversion) >= 0);
+end:
+    if (giptr != NULL)
+        *giptr = ginfo;
     return ret;
 }

@@ -953,13 +974,13 @@ int tls1_get0_implemented_groups(int min_proto_version, int max_proto_version,
     TLS_GROUP_IX *gix;
     uint16_t id = 0;
     int ret = 0;
-    size_t ix;
+    int ix;

-    if (grps == NULL || out == NULL)
+    if (grps == NULL || out == NULL || num > INT_MAX)
         return 0;
     if ((collect = sk_TLS_GROUP_IX_new(tls_group_ix_cmp)) == NULL)
         return 0;
-    for (ix = 0; ix < num; ++ix, ++grps) {
+    for (ix = 0; ix < (int)num; ++ix, ++grps) {
         if (grps->mintls > 0 && max_proto_version > 0
             && grps->mintls > max_proto_version)
             continue;
@@ -979,7 +1000,7 @@ int tls1_get0_implemented_groups(int min_proto_version, int max_proto_version,

     sk_TLS_GROUP_IX_sort(collect);
     num = sk_TLS_GROUP_IX_num(collect);
-    for (ix = 0; ix < num; ++ix) {
+    for (ix = 0; ix < (int)num; ++ix) {
         gix = sk_TLS_GROUP_IX_value(collect, ix);
         if (!all && gix->grp->group_id == id)
             continue;
@@ -997,11 +1018,18 @@ end:
 /*-
  * For nmatch >= 0, return the id of the |nmatch|th shared group or 0
  * if there is no match.
- * For nmatch == -1, return number of matches
- * For nmatch == -2, return the id of the group to use for
- * a tmp key, or 0 if there is no match.
+ * For nmatch == TLS1_GROUPS_RETURN_NUMBER, return number of matches
+ * For nmatch == TLS1_GROUPS_RETURN_TMP_ID, return the id of the group to use
+ * for a tmp key, or 0 if there is no match.
+ * If groups == TLS1_GROUPS_FFDHE_GROUPS, only shared groups that are FFDHE
+ * groups (i.e., between OSSL_TLS_GROUP_ID_FFDHE_START and
+ * OSSL_TLS_GROUP_ID_FFDHE_END, inclusive) will be included in the search.
+ * If groups == TLS1_GROUPS_NON_FFDHE_GROUPS, only shared groups that are not
+ * FFDHE groups will be included in the search.
+ * If groups == TLS1_GROUPS_ALL_GROUPS, all groups will be included in the
+ * search.
  */
-uint16_t tls1_shared_group(SSL_CONNECTION *s, int nmatch)
+uint16_t tls1_shared_group(SSL_CONNECTION *s, int nmatch, int groups)
 {
     const uint16_t *pref, *supp;
     size_t num_pref, num_supp, i;
@@ -1011,8 +1039,8 @@ uint16_t tls1_shared_group(SSL_CONNECTION *s, int nmatch)
     /* Can't do anything on client side */
     if (s->server == 0)
         return 0;
-    if (nmatch == -2) {
-        if (tls1_suiteb(s)) {
+    if (nmatch == TLS1_GROUPS_RETURN_TMP_ID) {
+        if (groups != TLS1_GROUPS_FFDHE_GROUPS && tls1_suiteb(s)) {
             /*
              * For Suite B ciphersuite determines curve: we already know
              * these are acceptable due to previous checks.
@@ -1033,7 +1061,7 @@ uint16_t tls1_shared_group(SSL_CONNECTION *s, int nmatch)
      * If server preference set, our groups are the preference order
      * otherwise peer decides.
      */
-    if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE) {
+    if (s->options & SSL_OP_SERVER_PREFERENCE) {
         tls1_get_supported_groups(s, &pref, &num_pref);
         tls1_get_peer_groups(s, &supp, &num_supp);
     } else {
@@ -1047,6 +1075,8 @@ uint16_t tls1_shared_group(SSL_CONNECTION *s, int nmatch)
         int minversion, maxversion;

         if (!tls1_in_list(id, supp, num_supp)
+            || (groups == TLS1_GROUPS_NON_FFDHE_GROUPS && is_ffdhe_group(id))
+            || (groups == TLS1_GROUPS_FFDHE_GROUPS && !is_ffdhe_group(id))
             || !tls_group_allowed(s, id, SSL_SECOP_CURVE_SHARED))
             continue;
         inf = tls1_group_id_lookup(ctx, id);
@@ -1070,7 +1100,7 @@ uint16_t tls1_shared_group(SSL_CONNECTION *s, int nmatch)
             return id;
         k++;
     }
-    if (nmatch == -1)
+    if (nmatch == TLS1_GROUPS_RETURN_NUMBER)
         return k;
     /* Out of range (nmatch > k). */
     return 0;
@@ -1096,11 +1126,11 @@ int tls1_set_groups(uint16_t **grpext, size_t *grpextlen,
         ERR_raise(ERR_LIB_SSL, SSL_R_BAD_LENGTH);
         return 0;
     }
-    if ((glist = OPENSSL_malloc(ngroups * sizeof(*glist))) == NULL)
+    if ((glist = OPENSSL_malloc_array(ngroups, sizeof(*glist))) == NULL)
         goto err;
-    if ((kslist = OPENSSL_malloc(1 * sizeof(*kslist))) == NULL)
+    if ((kslist = OPENSSL_malloc_array(1, sizeof(*kslist))) == NULL)
         goto err;
-    if ((tpllist = OPENSSL_malloc(1 * sizeof(*tpllist))) == NULL)
+    if ((tpllist = OPENSSL_malloc_array(1, sizeof(*tpllist))) == NULL)
         goto err;
     for (i = 0; i < ngroups; i++) {
         unsigned long idmask;
@@ -1229,6 +1259,17 @@ static const char prefixes[] = { TUPLE_DELIMITER_CHARACTER,
  * Those callback functions are (indirectly) called by CONF_parse_list with
  * different separators (nominally ':' or '/'), a variable based on gid_cb_st
  * is used to keep track of the parsing results between the various calls
+ *
+ * Bookkeeping invariants maintained throughout parsing (see gid_cb_st below):
+ *  - gid_arr[0..gidcnt) is the flat list of groups, partitioned into tuples in
+ *    order: tuple t occupies a contiguous run of tuplcnt_arr[t] entries.
+ *  - The per-tuple counts therefore sum to the group count:
+ *        sum(tuplcnt_arr[0..tplcnt]) == gidcnt
+ *    (indices 0..tplcnt-1 are closed tuples, index tplcnt is the active one).
+ *  - ksid_arr[0..ksidcnt) holds keyshare group IDs; each is one of the groups
+ *    in gid_arr and they appear in the same relative order as their groups.
+ * Every add/remove path must preserve these; an OOB read in the remove path
+ * (GitHub #31315) was a symptom of the first invariant being violated.
  */

 typedef struct {
@@ -1249,6 +1290,7 @@ typedef struct {
     size_t ksidcnt; /* Number of key shares */
     uint16_t *ksid_arr; /* The IDs of the key share groups (flat list) */
     /* Variable to keep state between execution of callback or helper functions */
+    int want_keyshare; /* If positive, pending keyshare from unrecognised group */
     int inner; /* Are we expanding a DEFAULT list */
     int first; /* First tuple of possibly nested expansion? */
 } gid_cb_st;
@@ -1342,7 +1384,7 @@ static int gid_cb(const char *elem, int len, void *arg)
                      * First, we restore any keyshare prefix in a new zero-terminated string
                      * (if not already present)
                      */
-                    restored_default_group_string = OPENSSL_malloc((1 /* max prefix length */ + strlen(default_group_strings[i].group_string) + 1 /* \0 */) * sizeof(char));
+                    restored_default_group_string = OPENSSL_malloc(1 /* max prefix length */ + strlen(default_group_strings[i].group_string) + 1 /* \0 */);
                     if (restored_default_group_string == NULL)
                         return 0;
                     if (add_keyshare
@@ -1387,8 +1429,9 @@ static int gid_cb(const char *elem, int len, void *arg)

     /* Memory management in case more groups are present compared to initial allocation */
     if (garg->gidcnt == garg->gidmax) {
-        uint16_t *tmp = OPENSSL_realloc(garg->gid_arr,
-            (garg->gidmax + GROUPLIST_INCREMENT) * sizeof(*garg->gid_arr));
+        uint16_t *tmp = OPENSSL_realloc_array(garg->gid_arr,
+            garg->gidmax + GROUPLIST_INCREMENT,
+            sizeof(*garg->gid_arr));

         if (tmp == NULL)
             return 0;
@@ -1398,8 +1441,9 @@ static int gid_cb(const char *elem, int len, void *arg)
     }
     /* Memory management for key share groups */
     if (garg->ksidcnt == garg->ksidmax) {
-        uint16_t *tmp = OPENSSL_realloc(garg->ksid_arr,
-            (garg->ksidmax + GROUPLIST_INCREMENT) * sizeof(*garg->ksid_arr));
+        uint16_t *tmp = OPENSSL_realloc_array(garg->ksid_arr,
+            garg->ksidmax + GROUPLIST_INCREMENT,
+            sizeof(*garg->ksid_arr));

         if (tmp == NULL)
             return 0;
@@ -1434,6 +1478,9 @@ static int gid_cb(const char *elem, int len, void *arg)
             }
         }
         if (gid == 0) { /* still not found */
+            /* If unknown, next known tuple element gets a keyshare */
+            if (add_keyshare && !remove_group && garg->want_keyshare == 0)
+                garg->want_keyshare = 1;
             /* Unknown group - ignore if ignore_unknown; trigger error otherwise */
             retval = ignore_unknown;
             goto done;
@@ -1453,57 +1500,115 @@ static int gid_cb(const char *elem, int len, void *arg)
      * ignore_unknown; trigger error otherwise
      */
     if (found_group == 0) {
+        /* If unknown, next known tuple element gets a keyshare */
+        if (add_keyshare && !remove_group && garg->want_keyshare == 0)
+            garg->want_keyshare = 1;
         retval = ignore_unknown;
         goto done;
     }
     /* Remove group (and keyshare) from anywhere in the list if present, ignore if not present */
     if (remove_group) {
-        /* Is the current group specified anywhere in the entire list so far? */
-        found_group = 0;
-        for (i = 0; i < garg->gidcnt; i++)
-            if (garg->gid_arr[i] == gid) {
-                found_group = 1;
+        size_t n = 0; /* tuple size */
+        size_t tpl_start_idx = 0; /* Index of 1st group in tuple of removed group */
+        size_t ks_check_idx = 0; /* Index after last known retained keyshare */
+
+        j = 0; /* tuple index */
+        k = 0; /* keyshare index */
+        n = garg->tuplcnt_arr[j];
+
+        for (i = 0; i < garg->gidcnt; ++i) {
+            if (garg->gid_arr[i] == gid)
                 break;
+            /* Skip keyshare slots associated with groups prior to that removed */
+            if (k < garg->ksidcnt && garg->gid_arr[i] == garg->ksid_arr[k]) {
+                ++k;
+                /* Skip each retained keyshare as we go */
+                ks_check_idx = i + 1;
             }
-        /* The group to remove is at position i in the list of (zero indexed) groups */
-        if (found_group) {
-            /* We remove that group from its position (which is at i)... */
-            for (j = i; j < (garg->gidcnt - 1); j++)
-                garg->gid_arr[j] = garg->gid_arr[j + 1]; /* ...shift remaining groups left ... */
-            garg->gidcnt--; /* ..and update the book keeping for the number of groups */
+            if (--n == 0) {
+                if (j < garg->tplcnt)
+                    n = garg->tuplcnt_arr[++j];
+                tpl_start_idx = i + 1;
+            }
+        }
+
+        /* Nothing to remove? */
+        if (i >= garg->gidcnt)
+            goto done;
+
+        garg->gidcnt--;
+        garg->tuplcnt_arr[j]--;
+        memmove(garg->gid_arr + i, garg->gid_arr + i + 1,
+            (garg->gidcnt - i) * sizeof(gid));
+
+        /* Handle keyshare removal */
+        if (k < garg->ksidcnt && garg->ksid_arr[k] == gid) {
+            int drop_ks;

             /*
-             * We also must update the number of groups either in a previous tuple (which we
-             * must identify and check whether it becomes empty due to the deletion) or in
-             * the current tuple, pending where the deleted group resides
+             * Simply drop the group's keyshare unless it is the last one in a
+             * still non-empty tuple.
+             *
+             * If `ks_check_idx` is larger than the tuple start index at least
+             * one keyshare belonging to the tuple is retained, so we drop this
+             * one.  Also if the tuple is the current one (isn't closed yet),
+             * floating is handled at tuple close time.
+             *
+             * Otherwise, iterate through the tuple check whether any keyshares
+             * remain *after* the index of the group we're removing.  The first
+             * of these, if any, is at index `k+1` in the keyshare list, which
+             * is the only slot we need to check.
+             *
+             * If the removal emptied the tuple (tuplcnt_arr[j] == 0 after the
+             * decrement above) there is no remaining group to float onto:
+             * gid_arr[tpl_start_idx] would now name a group belonging to the
+             * next tuple (or be past gid_arr entirely).  Drop the keyshare in
+             * that case too.
              */
-            k = 0;
-            for (j = 0; j < garg->tplcnt; j++) {
-                k += garg->tuplcnt_arr[j];
-                /* Remark: i is zero-indexed, k is one-indexed */
-                if (k > i) { /* remove from one of the previous tuples */
-                    garg->tuplcnt_arr[j]--;
-                    break; /* We took care not to have group duplicates, hence we can stop here */
+            drop_ks = ks_check_idx > tpl_start_idx || j >= garg->tplcnt
+                || garg->tuplcnt_arr[j] == 0;
+
+            if (!drop_ks) {
+                size_t end; /* End index of affected tuple */
+
+                /* Removing the first keyshare of an already completed tuple */
+                for (end = tpl_start_idx + garg->tuplcnt_arr[j]; i < end; ++i) {
+                    /* Any other keyshares for the same tuple? */
+                    if (k + 1 < garg->ksidcnt
+                        && garg->gid_arr[i] == garg->ksid_arr[k + 1])
+                        break;
                 }
+                /* Float keyshare to first group when no others found */
+                if (i >= end)
+                    garg->ksid_arr[k] = garg->gid_arr[tpl_start_idx];
+                else
+                    drop_ks = 1;
             }
-            if (k <= i) /* remove from current tuple */
-                garg->tuplcnt_arr[j]--;
-
-            /* We also remove the group from the list of keyshares (if present) */
-            found_group = 0;
-            for (i = 0; i < garg->ksidcnt; i++)
-                if (garg->ksid_arr[i] == gid) {
-                    found_group = 1;
-                    break;
-                }
-            if (found_group) {
-                /* Found, hence we remove that keyshare from its position (which is at i)... */
-                for (j = i; j < (garg->ksidcnt - 1); j++)
-                    garg->ksid_arr[j] = garg->ksid_arr[j + 1]; /* shift remaining key shares */
-                /* ... and update the book keeping */
+            if (drop_ks) {
                 garg->ksidcnt--;
+                memmove(garg->ksid_arr + k, garg->ksid_arr + k + 1,
+                    (garg->ksidcnt - k) * sizeof(gid));
             }
         }
+
+        /*
+         * Adjust closed or current tuple's group count, if a closed tuple
+         * count reaches zero excise the resulting empty tuple.  The current
+         * (not yet closed) tuple at the end of the list stays even if empty.
+         *
+         * The active tuple lives at index tplcnt, so the slots in use are
+         * tuplcnt_arr[0..tplcnt] (tplcnt + 1 entries).  Excising closed tuple
+         * j must therefore shift the closed tuples j+1..tplcnt-1 *and* the
+         * active tuple at index tplcnt down by one, i.e. (tplcnt - j) entries
+         * counted with the pre-decrement tplcnt.  Decrement tplcnt only after
+         * the move so the active-tuple slot is not left behind (which would
+         * inflate the per-tuple counts and desynchronise them from gid_arr).
+         */
+        if (garg->tuplcnt_arr[j] == 0 && j < garg->tplcnt) {
+            memmove(garg->tuplcnt_arr + j, garg->tuplcnt_arr + j + 1,
+                (garg->tplcnt - j) * sizeof(size_t));
+            garg->tplcnt--;
+        }
     } else { /* Processing addition of a single new group */

         /* Check for duplicates */
@@ -1519,8 +1624,10 @@ static int gid_cb(const char *elem, int len, void *arg)
         garg->tuplcnt_arr[garg->tplcnt]++;

         /* We want to add a key share for the current group */
-        if (add_keyshare)
+        if (add_keyshare) {
             garg->ksid_arr[garg->ksidcnt++] = gid;
+            garg->want_keyshare = -1;
+        }
     }

 done:
@@ -1534,22 +1641,18 @@ done:
  */
 static int grow_tuples(gid_cb_st *garg)
 {
-    static size_t max_tplcnt = (~(size_t)0) / sizeof(size_t);
-
     /*
-     * Ensure we have room for at least one additional tuple.
-     * (tplcnt + 1 are in active use).
+     * tplcnt + 1 is the index close_tuple() will write to after incrementing;
+     * reallocate before it would reach the end of the allocated array.
      */
-    if (garg->tplcnt + 1 == garg->tplmax) {
-        size_t newcnt = garg->tplmax + GROUPLIST_INCREMENT;
-        size_t newsz = newcnt * sizeof(size_t);
-        size_t *tmp;
+    if (garg->tplcnt + 1 >= garg->tplmax) {
+        size_t *tmp = OPENSSL_realloc_array(garg->tuplcnt_arr,
+            garg->tplmax + GROUPLIST_INCREMENT,
+            sizeof(*garg->tuplcnt_arr));

-        if (newsz > max_tplcnt
-            || (tmp = OPENSSL_realloc(garg->tuplcnt_arr, newsz)) == NULL)
+        if (tmp == NULL)
             return 0;
-
-        garg->tplmax = newcnt;
+        garg->tplmax += GROUPLIST_INCREMENT;
         garg->tuplcnt_arr = tmp;
     }
     return 1;
@@ -1566,6 +1669,18 @@ static int close_tuple(gid_cb_st *garg)
 {
     size_t gidcnt = garg->tuplcnt_arr[garg->tplcnt];

+    if (gidcnt > 0 && garg->want_keyshare > 0) {
+        uint16_t gid = garg->gid_arr[garg->gidcnt - gidcnt];
+
+        /*
+         * All groups in the tuple that were marked for keyshare prediction
+         * were unknown (unrecognised); select the first known group instead.
+         */
+        garg->ksid_arr[garg->ksidcnt++] = gid;
+    }
+    /* Reset keyshare state for the next tuple */
+    garg->want_keyshare = 0;
+
     if (gidcnt == 0)
         return 1; /* Discard empty tuple; no need to open a new slot */

@@ -1596,7 +1711,7 @@ static int tuple_cb(const char *tuple, int len, void *arg)
     garg->first = 0;

     /* Convert to \0-terminated string */
-    restored_tuple_string = OPENSSL_malloc((len + 1 /* \0 */) * sizeof(char));
+    restored_tuple_string = OPENSSL_malloc(len + 1 /* \0 */);
     if (restored_tuple_string == NULL)
         return 0;
     memcpy(restored_tuple_string, tuple, len);
@@ -1646,14 +1761,14 @@ int tls1_set_groups_list(SSL_CTX *ctx,
     gcb.ctx = ctx;

     /* Prepare initial chunks of memory for groups, tuples and keyshares groupIDs */
-    gcb.gid_arr = OPENSSL_malloc(gcb.gidmax * sizeof(*gcb.gid_arr));
+    gcb.gid_arr = OPENSSL_malloc_array(gcb.gidmax, sizeof(*gcb.gid_arr));
     if (gcb.gid_arr == NULL)
         goto end;
-    gcb.tuplcnt_arr = OPENSSL_malloc(gcb.tplmax * sizeof(*gcb.tuplcnt_arr));
+    gcb.tuplcnt_arr = OPENSSL_malloc_array(gcb.tplmax, sizeof(*gcb.tuplcnt_arr));
     if (gcb.tuplcnt_arr == NULL)
         goto end;
     gcb.tuplcnt_arr[0] = 0;
-    gcb.ksid_arr = OPENSSL_malloc(gcb.ksidmax * sizeof(*gcb.ksid_arr));
+    gcb.ksid_arr = OPENSSL_malloc_array(gcb.ksidmax, sizeof(*gcb.ksid_arr));
     if (gcb.ksid_arr == NULL)
         goto end;

@@ -1801,19 +1916,16 @@ int tls1_check_group_id(SSL_CONNECTION *s, uint16_t group_id,
 void tls1_get_formatlist(SSL_CONNECTION *s, const unsigned char **pformats,
     size_t *num_formats)
 {
-    /*
-     * If we have a custom point format list use it otherwise use default
-     */
-    if (s->ext.ecpointformats) {
-        *pformats = s->ext.ecpointformats;
-        *num_formats = s->ext.ecpointformats_len;
-    } else {
-        *pformats = ecformats_default;
+    if ((s->options & SSL_OP_LEGACY_EC_POINT_FORMATS) != 0) {
+        *pformats = ecformats_all;
         /* For Suite B we don't support char2 fields */
         if (tls1_suiteb(s))
-            *num_formats = sizeof(ecformats_default) - 1;
+            *num_formats = sizeof(ecformats_all) - 1;
         else
-            *num_formats = sizeof(ecformats_default);
+            *num_formats = sizeof(ecformats_all);
+    } else {
+        *pformats = ecformats_default;
+        *num_formats = sizeof(ecformats_default);
     }
 }

@@ -1829,7 +1941,7 @@ static uint16_t tls1_get_group_id(EVP_PKEY *pkey)

 /*
  * Check cert parameters compatible with extensions: currently just checks EC
- * certificates have compatible curves and compression.
+ * certificates have compatible curves.
  */
 static int tls1_check_cert_param(SSL_CONNECTION *s, X509 *x, int check_ee_md)
 {
@@ -1872,6 +1984,46 @@ static int tls1_check_cert_param(SSL_CONNECTION *s, X509 *x, int check_ee_md)
     return 1;
 }

+/*
+ * tls1_check_ffdhe_tmp_key - Check FFDHE temporary key compatibility
+ * @s: SSL connection
+ * @cid: Cipher ID we're considering using
+ *
+ * Checks that the kDHE cipher suite we're considering using
+ * is compatible with the client extensions.
+ *
+ * Returns 0 when the cipher can't be used or 1 when it can.
+ */
+int tls1_check_ffdhe_tmp_key(SSL_CONNECTION *s, unsigned long cid)
+{
+    const uint16_t *peer_groups;
+    size_t num_peer_groups;
+
+    /* If we have a shared FFDHE group, we can certainly use it. */
+    if (tls1_shared_group(s, 0, TLS1_GROUPS_FFDHE_GROUPS) != 0)
+        return 1;
+
+    /*
+     * Otherwise, we follow RFC 7919:
+     *     If a compatible TLS server receives a Supported Groups extension from
+     *     a client that includes any FFDHE group (i.e., any codepoint between
+     *     256 and 511, inclusive, even if unknown to the server), and if none
+     *     of the client-proposed FFDHE groups are known and acceptable to the
+     *     server, then the server MUST NOT select an FFDHE cipher suite.
+     */
+    tls1_get_peer_groups(s, &peer_groups, &num_peer_groups);
+    for (size_t i = 0; i < num_peer_groups; i++) {
+        if (is_ffdhe_group(peer_groups[i]))
+            return 0;
+    }
+
+    /*
+     * The client did not send any FFDHE groups, so we can use this ciphersuite
+     * using any group we like.
+     */
+    return 1;
+}
+
 /*
  * tls1_check_ec_tmp_key - Check EC temporary key compatibility
  * @s: SSL connection
@@ -1886,7 +2038,7 @@ int tls1_check_ec_tmp_key(SSL_CONNECTION *s, unsigned long cid)
 {
     /* If not Suite B just need a shared group */
     if (!tls1_suiteb(s))
-        return tls1_shared_group(s, 0) != 0;
+        return tls1_shared_group(s, 0, TLS1_GROUPS_NON_FFDHE_GROUPS) != 0;
     /*
      * If Suite B, AES128 MUST use P-256 and AES256 MUST use P-384, no other
      * curves permitted.
@@ -1995,19 +2147,19 @@ static const SIGALG_LOOKUP sigalg_lookup_tbl[] = {
         TLSEXT_SIGALG_ecdsa_brainpoolP256r1_sha256,
         NID_sha256, SSL_MD_SHA256_IDX, EVP_PKEY_EC, SSL_PKEY_ECC,
         NID_ecdsa_with_SHA256, NID_brainpoolP256r1, 1, 0,
-        TLS1_3_VERSION, 0, -1, -1 },
+        TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
     { TLSEXT_SIGALG_ecdsa_brainpoolP384r1_sha384_name,
         TLSEXT_SIGALG_ecdsa_brainpoolP384r1_sha384_alias,
         TLSEXT_SIGALG_ecdsa_brainpoolP384r1_sha384,
         NID_sha384, SSL_MD_SHA384_IDX, EVP_PKEY_EC, SSL_PKEY_ECC,
         NID_ecdsa_with_SHA384, NID_brainpoolP384r1, 1, 0,
-        TLS1_3_VERSION, 0, -1, -1 },
+        TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },
     { TLSEXT_SIGALG_ecdsa_brainpoolP512r1_sha512_name,
         TLSEXT_SIGALG_ecdsa_brainpoolP512r1_sha512_alias,
         TLSEXT_SIGALG_ecdsa_brainpoolP512r1_sha512,
         NID_sha512, SSL_MD_SHA512_IDX, EVP_PKEY_EC, SSL_PKEY_ECC,
         NID_ecdsa_with_SHA512, NID_brainpoolP512r1, 1, 0,
-        TLS1_3_VERSION, 0, -1, -1 },
+        TLS1_3_VERSION, 0, DTLS1_3_VERSION, 0 },

     { TLSEXT_SIGALG_rsa_pss_rsae_sha256_name,
         "PSS+SHA256", TLSEXT_SIGALG_rsa_pss_rsae_sha256,
@@ -2095,16 +2247,14 @@ static const SIGALG_LOOKUP sigalg_lookup_tbl[] = {
         TLS1_2_VERSION, TLS1_2_VERSION, DTLS1_2_VERSION, DTLS1_2_VERSION },

 #ifndef OPENSSL_NO_GOST
-    { TLSEXT_SIGALG_gostr34102012_256_intrinsic_alias, /* RFC9189 */
-        TLSEXT_SIGALG_gostr34102012_256_intrinsic_name,
-        TLSEXT_SIGALG_gostr34102012_256_intrinsic,
+    { TLSEXT_SIGALG_gostr34102012_256_intrinsic_name, /* RFC9189 */
+        NULL, TLSEXT_SIGALG_gostr34102012_256_intrinsic,
         NID_id_GostR3411_2012_256, SSL_MD_GOST12_256_IDX,
         NID_id_GostR3410_2012_256, SSL_PKEY_GOST12_256,
         NID_undef, NID_undef, 1, 0,
         TLS1_2_VERSION, TLS1_2_VERSION, DTLS1_2_VERSION, DTLS1_2_VERSION },
-    { TLSEXT_SIGALG_gostr34102012_256_intrinsic_alias, /* RFC9189 */
-        TLSEXT_SIGALG_gostr34102012_256_intrinsic_name,
-        TLSEXT_SIGALG_gostr34102012_512_intrinsic,
+    { TLSEXT_SIGALG_gostr34102012_512_intrinsic_name, /* RFC9189 */
+        NULL, TLSEXT_SIGALG_gostr34102012_512_intrinsic,
         NID_id_GostR3411_2012_512, SSL_MD_GOST12_512_IDX,
         NID_id_GostR3410_2012_512, SSL_PKEY_GOST12_512,
         NID_undef, NID_undef, 1, 0,
@@ -2162,21 +2312,18 @@ int ssl_setup_sigalgs(SSL_CTX *ctx)
     SIGALG_LOOKUP *cache = NULL;
     uint16_t *tls12_sigalgs_list = NULL;
     EVP_PKEY *tmpkey = EVP_PKEY_new();
-    int istls;
     int ret = 0;

     if (ctx == NULL)
         goto err;

-    istls = !SSL_CTX_IS_DTLS(ctx);
-
     sigalgs_len = OSSL_NELEM(sigalg_lookup_tbl) + ctx->sigalg_list_len;

-    cache = OPENSSL_zalloc(sizeof(const SIGALG_LOOKUP) * sigalgs_len);
+    cache = OPENSSL_calloc(sigalgs_len, sizeof(const SIGALG_LOOKUP));
     if (cache == NULL || tmpkey == NULL)
         goto err;

-    tls12_sigalgs_list = OPENSSL_zalloc(sizeof(uint16_t) * sigalgs_len);
+    tls12_sigalgs_list = OPENSSL_calloc(sigalgs_len, sizeof(uint16_t));
     if (tls12_sigalgs_list == NULL)
         goto err;

@@ -2224,15 +2371,15 @@ int ssl_setup_sigalgs(SSL_CTX *ctx)
         cache[cache_idx].hash = si.hash_name ? OBJ_txt2nid(si.hash_name) : NID_undef;
         cache[cache_idx].hash_idx = ssl_get_md_idx(cache[cache_idx].hash);
         cache[cache_idx].sig = OBJ_txt2nid(si.sigalg_name);
-        cache[cache_idx].sig_idx = i + SSL_PKEY_NUM;
+        cache[cache_idx].sig_idx = (int)(i + SSL_PKEY_NUM);
         cache[cache_idx].sigandhash = OBJ_txt2nid(si.sigalg_name);
         cache[cache_idx].curve = NID_undef;
         cache[cache_idx].mintls = TLS1_3_VERSION;
         cache[cache_idx].maxtls = TLS1_3_VERSION;
-        cache[cache_idx].mindtls = -1;
-        cache[cache_idx].maxdtls = -1;
+        cache[cache_idx].mindtls = DTLS1_3_VERSION;
+        cache[cache_idx].maxdtls = DTLS1_3_VERSION;
         /* Compatibility with TLS 1.3 is checked on load */
-        cache[cache_idx].available = istls;
+        cache[cache_idx].available = 1;
         cache[cache_idx].advertise = 0;
         cache_idx++;
     }
@@ -2353,23 +2500,27 @@ char *SSL_get1_builtin_sigalgs(OSSL_LIB_CTX *libctx)
     return retval;
 }

-/* Lookup TLS signature algorithm */
-static const SIGALG_LOOKUP *tls1_lookup_sigalg(const SSL_CTX *ctx,
+/* Find known TLS signature algorithm */
+static const SIGALG_LOOKUP *tls1_find_sigalg(const SSL_CTX *ctx,
     uint16_t sigalg)
 {
-    size_t i;
     const SIGALG_LOOKUP *lu = ctx->sigalg_lookup_cache;

-    for (i = 0; i < ctx->sigalg_lookup_cache_len; lu++, i++) {
-        if (lu->sigalg == sigalg) {
-            if (!lu->available)
-                return NULL;
+    for (size_t i = 0; i < ctx->sigalg_lookup_cache_len; lu++, i++)
+        if (lu->sigalg == sigalg)
             return lu;
-        }
-    }
     return NULL;
 }

+/* Look up available TLS signature algorithm */
+static const SIGALG_LOOKUP *tls1_lookup_sigalg(const SSL_CTX *ctx,
+    uint16_t sigalg)
+{
+    const SIGALG_LOOKUP *lu = tls1_find_sigalg(ctx, sigalg);
+
+    return (lu != NULL && lu->available) ? lu : NULL;
+}
+
 /* Lookup hash: return 0 if invalid or not enabled */
 int tls1_lookup_md(SSL_CTX *ctx, const SIGALG_LOOKUP *lu, const EVP_MD **pmd)
 {
@@ -2436,7 +2587,7 @@ static const SIGALG_LOOKUP *tls1_get_legacy_sigalg(const SSL_CONNECTION *s,
                 if (clu == NULL)
                     continue;
                 if (clu->amask & s->s3.tmp.new_cipher->algorithm_auth) {
-                    idx = i;
+                    idx = (int)i;
                     break;
                 }
             }
@@ -2471,7 +2622,7 @@ static const SIGALG_LOOKUP *tls1_get_legacy_sigalg(const SSL_CONNECTION *s,
                 }
             }
         } else {
-            idx = s->cert->key - s->cert->pkeys;
+            idx = (int)(s->cert->key - s->cert->pkeys);
         }
     }
     if (idx < 0 || idx >= (int)OSSL_NELEM(tls_default_sigalg))
@@ -2501,7 +2652,7 @@ int tls1_set_peer_legacy_sigalg(SSL_CONNECTION *s, const EVP_PKEY *pkey)

     if (ssl_cert_lookup_by_pkey(pkey, &idx, SSL_CONNECTION_GET_CTX(s)) == NULL)
         return 0;
-    lu = tls1_get_legacy_sigalg(s, idx);
+    lu = tls1_get_legacy_sigalg(s, (int)idx);
     if (lu == NULL)
         return 0;
     s->s3.tmp.peer_sigalg = lu;
@@ -2681,13 +2832,13 @@ int tls12_check_peer_sigalg(SSL_CONNECTION *s, uint16_t sig, EVP_PKEY *pkey)

     pkeyid = EVP_PKEY_get_id(pkey);

-    if (SSL_CONNECTION_IS_TLS13(s)) {
-        /* Disallow DSA for TLS 1.3 */
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
+        /* Disallow DSA for (D)TLS 1.3 */
         if (pkeyid == EVP_PKEY_DSA) {
             SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_WRONG_SIGNATURE_TYPE);
             return 0;
         }
-        /* Only allow PSS for TLS 1.3 */
+        /* Only allow PSS for (D)TLS 1.3 */
         if (pkeyid == EVP_PKEY_RSA)
             pkeyid = EVP_PKEY_RSA_PSS;
     }
@@ -2717,10 +2868,10 @@ int tls12_check_peer_sigalg(SSL_CONNECTION *s, uint16_t sig, EVP_PKEY *pkey)
     }

     /*
-     * Check sigalgs is known. Disallow SHA1/SHA224 with TLS 1.3. Check key type
+     * Check sigalgs is known. Disallow SHA1/SHA224 with (D)TLS 1.3. Check key type
      * is consistent with signature: RSA keys can be used for RSA-PSS
      */
-    if ((SSL_CONNECTION_IS_TLS13(s)
+    if ((SSL_CONNECTION_IS_VERSION13(s)
             && (lu->hash == NID_sha1 || lu->hash == NID_sha224))
         || (pkeyid != lu->sig
             && (lu->sig != EVP_PKEY_RSA_PSS || pkeyid != EVP_PKEY_RSA))) {
@@ -2737,9 +2888,14 @@ int tls12_check_peer_sigalg(SSL_CONNECTION *s, uint16_t sig, EVP_PKEY *pkey)
     }

     if (pkeyid == EVP_PKEY_EC) {
+        /*
+         * No point-format check on either the peer's or own cert.
+         * We accept any form we can decode, and send the cert we
+         * have.
+         */

-        /* For TLS 1.3 or Suite B check curve matches signature algorithm */
-        if (SSL_CONNECTION_IS_TLS13(s) || tls1_suiteb(s)) {
+        /* For (D)TLS 1.3 or Suite B check curve matches signature algorithm */
+        if (SSL_CONNECTION_IS_VERSION13(s) || tls1_suiteb(s)) {
             int curve = ssl_get_EC_curve_nid(pkey);

             if (lu->curve != NID_undef && curve != lu->curve) {
@@ -2747,7 +2903,7 @@ int tls12_check_peer_sigalg(SSL_CONNECTION *s, uint16_t sig, EVP_PKEY *pkey)
                 return 0;
             }
         }
-        if (!SSL_CONNECTION_IS_TLS13(s)) {
+        if (!SSL_CONNECTION_IS_VERSION13(s)) {
             /* Check curve matches extensions */
             if (!tls1_check_group_id(s, tls1_get_group_id(pkey), 1)) {
                 SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_WRONG_CURVE);
@@ -2865,12 +3021,11 @@ int ssl_set_client_disabled(SSL_CONNECTION *s)
  * @s: SSL connection that you want to use the cipher on
  * @c: cipher to check
  * @op: Security check that you want to do
- * @ecdhe: If set to 1 then TLSv1 ECDHE ciphers are also allowed in SSLv3
  *
  * Returns 1 when it's disabled, 0 when enabled.
  */
 int ssl_cipher_disabled(const SSL_CONNECTION *s, const SSL_CIPHER *c,
-    int op, int ecdhe)
+    int op)
 {
     int minversion = SSL_CONNECTION_IS_DTLS(s) ? c->min_dtls : c->min_tls;
     int maxversion = SSL_CONNECTION_IS_DTLS(s) ? c->max_dtls : c->max_tls;
@@ -2892,15 +3047,6 @@ int ssl_cipher_disabled(const SSL_CONNECTION *s, const SSL_CIPHER *c,
             return 1;
         }

-    /*
-     * For historical reasons we will allow ECHDE to be selected by a server
-     * in SSLv3 if we are a client
-     */
-    if (minversion == TLS1_VERSION
-        && ecdhe
-        && (c->algorithm_mkey & (SSL_kECDHE | SSL_kECDHEPSK)) != 0)
-        minversion = SSL3_VERSION;
-
     if (ssl_version_cmp(s, minversion, s->s3.tmp.max_ver) > 0
         || ssl_version_cmp(s, maxversion, s->s3.tmp.min_ver) < 0)
         return 1;
@@ -2928,9 +3074,11 @@ int tls1_set_server_sigalgs(SSL_CONNECTION *s)
     if (s->s3.tmp.valid_flags)
         memset(s->s3.tmp.valid_flags, 0, s->ssl_pkey_num * sizeof(uint32_t));
     else
-        s->s3.tmp.valid_flags = OPENSSL_zalloc(s->ssl_pkey_num * sizeof(uint32_t));
-    if (s->s3.tmp.valid_flags == NULL)
+        s->s3.tmp.valid_flags = OPENSSL_calloc(s->ssl_pkey_num, sizeof(uint32_t));
+    if (s->s3.tmp.valid_flags == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return 0;
+    }
     /*
      * If peer sent no signature algorithms check to see if we support
      * the default algorithm for each certificate type
@@ -2941,7 +3089,7 @@ int tls1_set_server_sigalgs(SSL_CONNECTION *s)
         size_t sent_sigslen = tls12_get_psigalgs(s, 1, &sent_sigs);

         for (i = 0; i < s->ssl_pkey_num; i++) {
-            const SIGALG_LOOKUP *lu = tls1_get_legacy_sigalg(s, i);
+            const SIGALG_LOOKUP *lu = tls1_get_legacy_sigalg(s, (int)i);
             size_t j;

             if (lu == NULL)
@@ -2988,7 +3136,7 @@ SSL_TICKET_STATUS tls_get_ticket_from_client(SSL_CONNECTION *s,
     s->ext.ticket_expected = 0;

     /*
-     * If tickets disabled or not supported by the protocol version
+     * If tickets are disabled or not supported by the protocol version
      * (e.g. TLSv1.3) behave as if no ticket present to permit stateful
      * resumption.
      */
@@ -3041,7 +3189,7 @@ SSL_TICKET_STATUS tls_decrypt_ticket(SSL_CONNECTION *s,
     SSL_TICKET_STATUS ret = SSL_TICKET_FATAL_ERR_OTHER;
     size_t mlen;
     unsigned char tick_hmac[EVP_MAX_MD_SIZE];
-    SSL_HMAC *hctx = NULL;
+    SSL_HMAC hctx, *constructed_hctx = NULL;
     EVP_CIPHER_CTX *ctx = NULL;
     SSL_CTX *tctx = s->session_ctx;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
@@ -3054,7 +3202,7 @@ SSL_TICKET_STATUS tls_decrypt_ticket(SSL_CONNECTION *s,
         ret = SSL_TICKET_EMPTY;
         goto end;
     }
-    if (!SSL_CONNECTION_IS_TLS13(s) && s->ext.session_secret_cb) {
+    if (!SSL_CONNECTION_IS_VERSION13(s) && s->ext.session_secret_cb) {
         /*
          * Indicate that the ticket couldn't be decrypted rather than
          * generating the session from ticket now, trigger
@@ -3072,8 +3220,8 @@ SSL_TICKET_STATUS tls_decrypt_ticket(SSL_CONNECTION *s,
     }

     /* Initialize session ticket encryption and HMAC contexts */
-    hctx = ssl_hmac_new(tctx);
-    if (hctx == NULL) {
+
+    if ((constructed_hctx = ssl_hmac_construct(tctx, &hctx)) == NULL) {
         ret = SSL_TICKET_FATAL_ERR_MALLOC;
         goto end;
     }
@@ -3096,14 +3244,14 @@ SSL_TICKET_STATUS tls_decrypt_ticket(SSL_CONNECTION *s,
                 nctick,
                 nctick + TLSEXT_KEYNAME_LENGTH,
                 ctx,
-                ssl_hmac_get0_EVP_MAC_CTX(hctx),
+                ssl_hmac_get0_EVP_MAC_CTX(&hctx),
                 0);
 #ifndef OPENSSL_NO_DEPRECATED_3_0
         else if (tctx->ext.ticket_key_cb != NULL)
             /* if 0 is returned, write an empty ticket */
             rv = tctx->ext.ticket_key_cb(SSL_CONNECTION_GET_USER_SSL(s), nctick,
                 nctick + TLSEXT_KEYNAME_LENGTH,
-                ctx, ssl_hmac_get0_HMAC_CTX(hctx), 0);
+                ctx, ssl_hmac_get0_HMAC_CTX(&hctx), 0);
 #endif
         if (rv < 0) {
             ret = SSL_TICKET_FATAL_ERR_OTHER;
@@ -3116,8 +3264,6 @@ SSL_TICKET_STATUS tls_decrypt_ticket(SSL_CONNECTION *s,
         if (rv == 2)
             renew_ticket = 1;
     } else {
-        EVP_CIPHER *aes256cbc = NULL;
-
         /* Check key name matches */
         if (memcmp(etick, tctx->ext.tick_key_name,
                 TLSEXT_KEYNAME_LENGTH)
@@ -3126,30 +3272,24 @@ SSL_TICKET_STATUS tls_decrypt_ticket(SSL_CONNECTION *s,
             goto end;
         }

-        aes256cbc = EVP_CIPHER_fetch(sctx->libctx, "AES-256-CBC",
-            sctx->propq);
-        if (aes256cbc == NULL
-            || ssl_hmac_init(hctx, tctx->ext.secure->tick_hmac_key,
-                   sizeof(tctx->ext.secure->tick_hmac_key),
-                   "SHA256")
+        if (ssl_hmac_init(&hctx, tctx->ext.secure->tick_hmac_key,
+                sizeof(tctx->ext.secure->tick_hmac_key), "SHA256")
                 <= 0
-            || EVP_DecryptInit_ex(ctx, aes256cbc, NULL,
+            || EVP_DecryptInit_ex(ctx, tctx->tktenc, NULL,
                    tctx->ext.secure->tick_aes_key,
                    etick + TLSEXT_KEYNAME_LENGTH)
                 <= 0) {
-            EVP_CIPHER_free(aes256cbc);
             ret = SSL_TICKET_FATAL_ERR_OTHER;
             goto end;
         }
-        EVP_CIPHER_free(aes256cbc);
-        if (SSL_CONNECTION_IS_TLS13(s))
+        if (SSL_CONNECTION_IS_VERSION13(s))
             renew_ticket = 1;
     }
     /*
      * Attempt to process session ticket, first conduct sanity and integrity
      * checks on ticket.
      */
-    mlen = ssl_hmac_size(hctx);
+    mlen = ssl_hmac_size(&hctx);
     if (mlen == 0) {
         ret = SSL_TICKET_FATAL_ERR_OTHER;
         goto end;
@@ -3168,8 +3308,8 @@ SSL_TICKET_STATUS tls_decrypt_ticket(SSL_CONNECTION *s,
     }
     eticklen -= mlen;
     /* Check HMAC of encrypted ticket */
-    if (ssl_hmac_update(hctx, etick, eticklen) <= 0
-        || ssl_hmac_final(hctx, tick_hmac, NULL, sizeof(tick_hmac)) <= 0) {
+    if (ssl_hmac_update(&hctx, etick, eticklen) <= 0
+        || ssl_hmac_final(&hctx, tick_hmac, NULL, sizeof(tick_hmac)) <= 0) {
         ret = SSL_TICKET_FATAL_ERR_OTHER;
         goto end;
     }
@@ -3197,7 +3337,7 @@ SSL_TICKET_STATUS tls_decrypt_ticket(SSL_CONNECTION *s,
     p = sdec;

     sess = d2i_SSL_SESSION_ex(NULL, &p, slen, sctx->libctx, sctx->propq);
-    slen -= p - sdec;
+    slen -= (int)(p - sdec);
     OPENSSL_free(sdec);
     if (sess) {
         /* Some additional consistency checks */
@@ -3231,7 +3371,7 @@ SSL_TICKET_STATUS tls_decrypt_ticket(SSL_CONNECTION *s,

 end:
     EVP_CIPHER_CTX_free(ctx);
-    ssl_hmac_free(hctx);
+    ssl_hmac_destruct(constructed_hctx);

     /*
      * If set, the decrypt_ticket_cb() is called unless a fatal error was
@@ -3287,7 +3427,7 @@ end:
         }
     }

-    if (s->ext.session_secret_cb == NULL || SSL_CONNECTION_IS_TLS13(s)) {
+    if (s->ext.session_secret_cb == NULL || SSL_CONNECTION_IS_VERSION13(s)) {
         switch (ret) {
         case SSL_TICKET_NO_DECRYPT:
         case SSL_TICKET_SUCCESS_RENEW:
@@ -3307,18 +3447,20 @@ static int tls12_sigalg_allowed(const SSL_CONNECTION *s, int op,
 {
     unsigned char sigalgstr[2];
     int secbits;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION
+                                                     : TLS1_3_VERSION;

     if (lu == NULL || !lu->available)
         return 0;
-    /* DSA is not allowed in TLS 1.3 */
-    if (SSL_CONNECTION_IS_TLS13(s) && lu->sig == EVP_PKEY_DSA)
+    /* DSA is not allowed in (D)TLSv1.3 */
+    if (SSL_CONNECTION_IS_VERSION13(s) && lu->sig == EVP_PKEY_DSA)
         return 0;
     /*
-     * At some point we should fully axe DSA/etc. in ClientHello as per TLS 1.3
+     * At some point we should fully axe DSA/etc. in ClientHello as per (D)TLSv1.3
      * spec
      */
-    if (!s->server && !SSL_CONNECTION_IS_DTLS(s)
-        && s->s3.tmp.min_ver >= TLS1_3_VERSION
+    if (!s->server && s->s3.tmp.min_ver != 0
+        && ssl_version_cmp(s, s->s3.tmp.min_ver, version1_3) >= 0
         && (lu->sig == EVP_PKEY_DSA || lu->hash_idx == SSL_MD_SHA1_IDX
             || lu->hash_idx == SSL_MD_MD5_IDX
             || lu->hash_idx == SSL_MD_SHA224_IDX))
@@ -3331,22 +3473,26 @@ static int tls12_sigalg_allowed(const SSL_CONNECTION *s, int op,
     if (lu->sig == NID_id_GostR3410_2012_256
         || lu->sig == NID_id_GostR3410_2012_512
         || lu->sig == NID_id_GostR3410_2001) {
-        /* We never allow GOST sig algs on the server with TLSv1.3 */
-        if (s->server && SSL_CONNECTION_IS_TLS13(s))
+        int any_version = SSL_CONNECTION_IS_DTLS(s) ? DTLS_ANY_VERSION : TLS_ANY_VERSION;
+
+        /* We never allow GOST sig algs on the server with (D)TLSv1.3 */
+        if (s->server && SSL_CONNECTION_IS_VERSION13(s))
             return 0;
         if (!s->server
-            && SSL_CONNECTION_GET_SSL(s)->method->version == TLS_ANY_VERSION
-            && s->s3.tmp.max_ver >= TLS1_3_VERSION) {
+            && SSL_CONNECTION_GET_SSL(s)->method->version == any_version
+            && s->s3.tmp.max_ver != 0
+            && ssl_version_cmp(s, s->s3.tmp.max_ver, version1_3) >= 0) {
             int i, num;
             STACK_OF(SSL_CIPHER) *sk;

             /*
-             * We're a client that could negotiate TLSv1.3. We only allow GOST
-             * sig algs if we could negotiate TLSv1.2 or below and we have GOST
+             * We're a client that could negotiate (D)TLSv1.3. We only allow GOST
+             * sig algs if we could negotiate (D)TLSv1.2 or below and we have GOST
              * ciphersuites enabled.
              */

-            if (s->s3.tmp.min_ver >= TLS1_3_VERSION)
+            if (s->s3.tmp.min_ver != 0
+                && ssl_version_cmp(s, s->s3.tmp.min_ver, version1_3) >= 0)
                 return 0;

             sk = SSL_get_ciphers(SSL_CONNECTION_GET_SSL(s));
@@ -3356,7 +3502,7 @@ static int tls12_sigalg_allowed(const SSL_CONNECTION *s, int op,

                 c = sk_SSL_CIPHER_value(sk, i);
                 /* Skip disabled ciphers */
-                if (ssl_cipher_disabled(s, c, SSL_SECOP_CIPHER_SUPPORTED, 0))
+                if (ssl_cipher_disabled(s, c, SSL_SECOP_CIPHER_SUPPORTED))
                     continue;

                 if ((c->algorithm_mkey & (SSL_kGOST | SSL_kGOST18)) != 0)
@@ -3427,7 +3573,7 @@ int tls12_copy_sigalgs(SSL_CONNECTION *s, WPACKET *pkt,
          * If TLS 1.3 must have at least one valid TLS 1.3 message
          * signing algorithm: i.e. neither RSA nor SHA1/SHA224
          */
-        if (rv == 0 && (!SSL_CONNECTION_IS_TLS13(s) || (lu->sig != EVP_PKEY_RSA && lu->hash != NID_sha1 && lu->hash != NID_sha224)))
+        if (rv == 0 && (!SSL_CONNECTION_IS_VERSION13(s) || (lu->sig != EVP_PKEY_RSA && lu->hash != NID_sha1 && lu->hash != NID_sha224)))
             rv = 1;
     }
     if (rv == 0)
@@ -3484,7 +3630,7 @@ static int tls1_set_shared_sigalgs(SSL_CONNECTION *s)
         conflen = c->conf_sigalgslen;
     } else
         conflen = tls12_get_psigalgs(s, 0, &conf);
-    if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE || is_suiteb) {
+    if (s->options & SSL_OP_SERVER_PREFERENCE || is_suiteb) {
         pref = conf;
         preflen = conflen;
         allow = s->s3.tmp.peer_sigalgs;
@@ -3497,7 +3643,7 @@ static int tls1_set_shared_sigalgs(SSL_CONNECTION *s)
     }
     nmatch = tls12_shared_sigalgs(s, NULL, pref, preflen, allow, allowlen);
     if (nmatch) {
-        if ((salgs = OPENSSL_malloc(nmatch * sizeof(*salgs))) == NULL)
+        if ((salgs = OPENSSL_malloc_array(nmatch, sizeof(*salgs))) == NULL)
             return 0;
         nmatch = tls12_shared_sigalgs(s, salgs, pref, preflen, allow, allowlen);
     } else {
@@ -3508,7 +3654,7 @@ static int tls1_set_shared_sigalgs(SSL_CONNECTION *s)
     return 1;
 }

-int tls1_save_u16(PACKET *pkt, uint16_t **pdest, size_t *pdestlen)
+int tls1_save_u16(PACKET *pkt, uint16_t **pdest, size_t *pdestlen, size_t maxnum)
 {
     unsigned int stmp;
     size_t size, i;
@@ -3522,7 +3668,14 @@ int tls1_save_u16(PACKET *pkt, uint16_t **pdest, size_t *pdestlen)

     size >>= 1;

-    if ((buf = OPENSSL_malloc(size * sizeof(*buf))) == NULL)
+    /*
+     * We ignore any entries in the list larger than the maximum number we
+     * will accept.
+     */
+    if (size > maxnum)
+        size = maxnum;
+
+    if ((buf = OPENSSL_malloc_array(size, sizeof(*buf))) == NULL)
         return 0;
     for (i = 0; i < size && PACKET_get_net_2(pkt, &stmp); i++)
         buf[i] = stmp;
@@ -3548,12 +3701,16 @@ int tls1_save_sigalgs(SSL_CONNECTION *s, PACKET *pkt, int cert)
     if (s->cert == NULL)
         return 0;

+    /*
+     * We restrict the number of signature algorithms we are willing to process
+     * to 128. Any beyond this number are simply ignored.
+     */
     if (cert)
         return tls1_save_u16(pkt, &s->s3.tmp.peer_cert_sigalgs,
-            &s->s3.tmp.peer_cert_sigalgslen);
+            &s->s3.tmp.peer_cert_sigalgslen, MAX_SIGALGS);
     else
         return tls1_save_u16(pkt, &s->s3.tmp.peer_sigalgs,
-            &s->s3.tmp.peer_sigalgslen);
+            &s->s3.tmp.peer_sigalgslen, MAX_SIGALGS);
 }

 /* Set preferred digest for each key type */
@@ -3574,7 +3731,7 @@ int tls1_process_sigalgs(SSL_CONNECTION *s)
         int idx = sigptr->sig_idx;

         /* Ignore PKCS1 based sig algs in TLSv1.3 */
-        if (SSL_CONNECTION_IS_TLS13(s) && sigptr->sig == EVP_PKEY_RSA)
+        if (SSL_CONNECTION_IS_VERSION13(s) && sigptr->sig == EVP_PKEY_RSA)
             continue;
         /* If not disabled indicate we can explicitly sign */
         if (pvalid[idx] == 0
@@ -3589,22 +3746,20 @@ int SSL_get_sigalgs(SSL *s, int idx,
     unsigned char *rsig, unsigned char *rhash)
 {
     uint16_t *psig;
-    size_t numsigalgs;
+    int numsigalgs;
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);

     if (sc == NULL)
         return 0;

-    psig = sc->s3.tmp.peer_sigalgs;
-    numsigalgs = sc->s3.tmp.peer_sigalgslen;
-
-    if (psig == NULL || numsigalgs > INT_MAX)
+    /* A TLS peer can't propose more sigalgs than would fit in an int. */
+    numsigalgs = (int)sc->s3.tmp.peer_sigalgslen;
+    if (idx >= numsigalgs || (psig = sc->s3.tmp.peer_sigalgs) == NULL)
         return 0;
+
     if (idx >= 0) {
         const SIGALG_LOOKUP *lu;

-        if (idx >= (int)numsigalgs)
-            return 0;
         psig += idx;
         if (rhash != NULL)
             *rhash = (unsigned char)((*psig >> 8) & 0xff);
@@ -3650,6 +3805,57 @@ int SSL_get_shared_sigalgs(SSL *s, int idx,
     return (int)sc->shared_sigalgslen;
 }

+int SSL_get0_sigalg(SSL *s, int idx, unsigned int *codepoint,
+    const char **name)
+{
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
+    const SIGALG_LOOKUP *lu;
+    uint16_t *psig;
+    int numsigalgs;
+
+    if (sc == NULL)
+        return 0;
+
+    /* A TLS peer can't propose more sigalgs than would fit in an int. */
+    numsigalgs = (int)sc->s3.tmp.peer_sigalgslen;
+    if (idx >= numsigalgs || (psig = sc->s3.tmp.peer_sigalgs) == NULL)
+        return 0;
+
+    if (idx >= 0) {
+        if (codepoint != NULL)
+            *codepoint = psig[idx];
+        lu = tls1_find_sigalg(SSL_CONNECTION_GET_CTX(sc), psig[idx]);
+        if (name != NULL)
+            *name = lu == NULL ? NULL : lu->name;
+    }
+    return numsigalgs;
+}
+
+int SSL_get0_shared_sigalg(SSL *s, int idx, unsigned int *codepoint,
+    const char **name)
+{
+    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
+    const SIGALG_LOOKUP *lu;
+    int numsigalgs;
+
+    if (sc == NULL)
+        return 0;
+
+    /* A TLS peer can't propose more sigalgs than would fit in an int. */
+    numsigalgs = (int)sc->shared_sigalgslen;
+    if (idx >= numsigalgs || sc->shared_sigalgs == NULL)
+        return 0;
+
+    if (idx >= 0) {
+        lu = sc->shared_sigalgs[idx];
+        if (codepoint != NULL)
+            *codepoint = lu->sigalg;
+        if (name != NULL)
+            *name = lu->name;
+    }
+    return numsigalgs;
+}
+
 /* Maximum possible number of unique entries in sigalgs array */
 #define TLS_MAX_SIGALGCNT (OSSL_NELEM(sigalg_lookup_tbl) * 2)

@@ -3812,7 +4018,7 @@ int tls1_set_raw_sigalgs(CERT *c, const uint16_t *psigs, size_t salglen,
 {
     uint16_t *sigalgs;

-    if ((sigalgs = OPENSSL_malloc(salglen * sizeof(*sigalgs))) == NULL)
+    if ((sigalgs = OPENSSL_malloc_array(salglen, sizeof(*sigalgs))) == NULL)
         return 0;
     memcpy(sigalgs, psigs, salglen * sizeof(*sigalgs));

@@ -3836,7 +4042,7 @@ int tls1_set_sigalgs(CERT *c, const int *psig_nids, size_t salglen, int client)

     if (salglen & 1)
         return 0;
-    if ((sigalgs = OPENSSL_malloc((salglen / 2) * sizeof(*sigalgs))) == NULL)
+    if ((sigalgs = OPENSSL_malloc_array(salglen / 2, sizeof(*sigalgs))) == NULL)
         return 0;
     for (i = 0, sptr = sigalgs; i < salglen; i += 2) {
         size_t j;
@@ -3881,7 +4087,7 @@ static int tls1_check_sig_alg(SSL_CONNECTION *s, X509 *x, int default_nid)
     size_t sigalgslen;

     /*-
-     * RFC 8446, section 4.2.3:
+     * RFC 9846, section 4.3.3:
      *
      * The signatures on certificates that are self-signed or certificates
      * that are trust anchors are not validated, since they begin a
@@ -3896,7 +4102,7 @@ static int tls1_check_sig_alg(SSL_CONNECTION *s, X509 *x, int default_nid)
     if (default_nid)
         return sig_nid == default_nid ? 1 : 0;

-    if (SSL_CONNECTION_IS_TLS13(s) && s->s3.tmp.peer_cert_sigalgs != NULL) {
+    if (SSL_CONNECTION_IS_VERSION13(s) && s->s3.tmp.peer_cert_sigalgs != NULL) {
         /*
          * If we're in TLSv1.3 then we only get here if we're checking the
          * chain. If the peer has specified peer_cert_sigalgs then we use them
@@ -4016,7 +4222,7 @@ int tls1_check_chain(SSL_CONNECTION *s, X509 *x, EVP_PKEY *pk,
                 SSL_CONNECTION_GET_CTX(s))
             == NULL)
             return 0;
-        idx = certidx;
+        idx = (int)certidx;
         pvalid = s->s3.tmp.valid_flags + idx;

         if (c->cert_flags & SSL_CERT_FLAGS_CHECK_TLS_STRICT)
@@ -4108,7 +4314,7 @@ int tls1_check_chain(SSL_CONNECTION *s, X509 *x, EVP_PKEY *pk,
             }
         }
         /* Check signature algorithm of each cert in chain */
-        if (SSL_CONNECTION_IS_TLS13(s)) {
+        if (SSL_CONNECTION_IS_VERSION13(s)) {
             /*
              * We only get here if the application has called SSL_check_chain(),
              * so check_flags is always set.
@@ -4599,7 +4805,7 @@ int tls_choose_sigalg(SSL_CONNECTION *s, int fatalerrs)
     s->s3.tmp.cert = NULL;
     s->s3.tmp.sigalg = NULL;

-    if (SSL_CONNECTION_IS_TLS13(s)) {
+    if (SSL_CONNECTION_IS_VERSION13(s)) {
         lu = find_sig_alg(s, NULL, NULL);
         if (lu == NULL) {
             if (!fatalerrs)
@@ -4612,7 +4818,7 @@ int tls_choose_sigalg(SSL_CONNECTION *s, int fatalerrs)
         /* If ciphersuite doesn't require a cert nothing to do */
         if (!(s->s3.tmp.new_cipher->algorithm_auth & SSL_aCERT))
             return 1;
-        if (!s->server && !ssl_has_cert(s, s->cert->key - s->cert->pkeys))
+        if (!s->server && !ssl_has_cert(s, (int)(s->cert->key - s->cert->pkeys)))
             return 1;

         if (SSL_USE_SIGALGS(s)) {
@@ -4639,7 +4845,7 @@ int tls_choose_sigalg(SSL_CONNECTION *s, int fatalerrs)
                         if ((sig_idx = tls12_get_cert_sigalg_idx(s, lu)) == -1)
                             continue;
                     } else {
-                        int cc_idx = s->cert->key - s->cert->pkeys;
+                        int cc_idx = (int)(s->cert->key - s->cert->pkeys);

                         sig_idx = lu->sig_idx;
                         if (cc_idx != sig_idx)
@@ -4739,7 +4945,7 @@ int SSL_CTX_set_tlsext_max_fragment_length(SSL_CTX *ctx, uint8_t mode)
 {
     if (mode != TLSEXT_max_fragment_length_DISABLED
         && !IS_MAX_FRAGMENT_LENGTH_EXT_VALID(mode)) {
-        ERR_raise(ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH);
+        ERR_raise(ERR_LIB_SSL, SSL_R_TLS_EXT_INVALID_MAX_FRAGMENT_LENGTH);
         return 0;
     }

@@ -4757,7 +4963,7 @@ int SSL_set_tlsext_max_fragment_length(SSL *ssl, uint8_t mode)

     if (mode != TLSEXT_max_fragment_length_DISABLED
         && !IS_MAX_FRAGMENT_LENGTH_EXT_VALID(mode)) {
-        ERR_raise(ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH);
+        ERR_raise(ERR_LIB_SSL, SSL_R_TLS_EXT_INVALID_MAX_FRAGMENT_LENGTH);
         return 0;
     }

@@ -4775,41 +4981,28 @@ uint8_t SSL_SESSION_get_max_fragment_length(const SSL_SESSION *session)
 /*
  * Helper functions for HMAC access with legacy support included.
  */
-SSL_HMAC *ssl_hmac_new(const SSL_CTX *ctx)
+SSL_HMAC *ssl_hmac_construct(const SSL_CTX *ctx, SSL_HMAC *hctx)
 {
-    SSL_HMAC *ret = OPENSSL_zalloc(sizeof(*ret));
-    EVP_MAC *mac = NULL;
-
-    if (ret == NULL)
+    if (hctx == NULL)
         return NULL;
+    hctx->ctx = NULL;
 #ifndef OPENSSL_NO_DEPRECATED_3_0
+    hctx->old_ctx = NULL;
     if (ctx->ext.ticket_key_evp_cb == NULL
-        && ctx->ext.ticket_key_cb != NULL) {
-        if (!ssl_hmac_old_new(ret))
-            goto err;
-        return ret;
-    }
+        && ctx->ext.ticket_key_cb != NULL)
+        return ssl_hmac_old_construct(hctx);
 #endif
-    mac = EVP_MAC_fetch(ctx->libctx, "HMAC", ctx->propq);
-    if (mac == NULL || (ret->ctx = EVP_MAC_CTX_new(mac)) == NULL)
-        goto err;
-    EVP_MAC_free(mac);
-    return ret;
-err:
-    EVP_MAC_CTX_free(ret->ctx);
-    EVP_MAC_free(mac);
-    OPENSSL_free(ret);
-    return NULL;
+    hctx->ctx = EVP_MAC_CTX_new(ctx->hmac);
+    return hctx->ctx != NULL ? hctx : NULL;
 }

-void ssl_hmac_free(SSL_HMAC *ctx)
+void ssl_hmac_destruct(SSL_HMAC *ctx)
 {
     if (ctx != NULL) {
         EVP_MAC_CTX_free(ctx->ctx);
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-        ssl_hmac_old_free(ctx);
+        ssl_hmac_old_destruct(ctx);
 #endif
-        OPENSSL_free(ctx);
     }
 }

diff --git a/deps/openssl/openssl/ssl/t1_trce.c b/deps/openssl/openssl/ssl/t1_trce.c
index 89df1710674..d9e6c9f1d19 100644
--- a/deps/openssl/openssl/ssl/t1_trce.c
+++ b/deps/openssl/openssl/ssl/t1_trce.c
@@ -63,13 +63,13 @@ static int do_ssl_trace_list(BIO *bio, int indent,
 /* Version number */

 static const ssl_trace_tbl ssl_version_tbl[] = {
-    { SSL3_VERSION, "SSL 3.0" },
     { TLS1_VERSION, "TLS 1.0" },
     { TLS1_1_VERSION, "TLS 1.1" },
     { TLS1_2_VERSION, "TLS 1.2" },
     { TLS1_3_VERSION, "TLS 1.3" },
     { DTLS1_VERSION, "DTLS 1.0" },
     { DTLS1_2_VERSION, "DTLS 1.2" },
+    { DTLS1_3_VERSION, "DTLS 1.3" },
     { DTLS1_BAD_VER, "DTLS 1.0 (bad)" }
 };

@@ -110,16 +110,16 @@ static const ssl_trace_tbl ssl_handshake_tbl[] = {
 /* Cipher suites */
 static const ssl_trace_tbl ssl_ciphers_tbl[] = {
     { 0x0000, "TLS_NULL_WITH_NULL_NULL" },
-    { 0x0001, "TLS_RSA_WITH_NULL_MD5" },
-    { 0x0002, "TLS_RSA_WITH_NULL_SHA" },
+    { 0x0001, SSL3_RFC_RSA_NULL_MD5 },
+    { 0x0002, SSL3_RFC_RSA_NULL_SHA },
     { 0x0003, "TLS_RSA_EXPORT_WITH_RC4_40_MD5" },
-    { 0x0004, "TLS_RSA_WITH_RC4_128_MD5" },
-    { 0x0005, "TLS_RSA_WITH_RC4_128_SHA" },
+    { 0x0004, SSL3_RFC_RSA_RC4_128_MD5 },
+    { 0x0005, SSL3_RFC_RSA_RC4_128_SHA },
     { 0x0006, "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5" },
-    { 0x0007, "TLS_RSA_WITH_IDEA_CBC_SHA" },
+    { 0x0007, SSL3_RFC_RSA_IDEA_128_SHA },
     { 0x0008, "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA" },
     { 0x0009, "TLS_RSA_WITH_DES_CBC_SHA" },
-    { 0x000A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA" },
+    { 0x000A, SSL3_RFC_RSA_DES_192_CBC3_SHA },
     { 0x000B, "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA" },
     { 0x000C, "TLS_DH_DSS_WITH_DES_CBC_SHA" },
     { 0x000D, "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA" },
@@ -128,15 +128,15 @@ static const ssl_trace_tbl ssl_ciphers_tbl[] = {
     { 0x0010, "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA" },
     { 0x0011, "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA" },
     { 0x0012, "TLS_DHE_DSS_WITH_DES_CBC_SHA" },
-    { 0x0013, "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" },
+    { 0x0013, SSL3_RFC_DHE_DSS_DES_192_CBC3_SHA },
     { 0x0014, "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA" },
     { 0x0015, "TLS_DHE_RSA_WITH_DES_CBC_SHA" },
-    { 0x0016, "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA" },
+    { 0x0016, SSL3_RFC_DHE_RSA_DES_192_CBC3_SHA },
     { 0x0017, "TLS_DH_anon_EXPORT_WITH_RC4_40_MD5" },
-    { 0x0018, "TLS_DH_anon_WITH_RC4_128_MD5" },
+    { 0x0018, SSL3_RFC_ADH_RC4_128_MD5 },
     { 0x0019, "TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA" },
     { 0x001A, "TLS_DH_anon_WITH_DES_CBC_SHA" },
-    { 0x001B, "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA" },
+    { 0x001B, SSL3_RFC_ADH_DES_192_CBC_SHA },
     { 0x001D, "SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA" },
     { 0x001E, "SSL_FORTEZZA_KEA_WITH_RC4_128_SHA" },
     { 0x001F, "TLS_KRB5_WITH_3DES_EDE_CBC_SHA" },
@@ -152,108 +152,110 @@ static const ssl_trace_tbl ssl_ciphers_tbl[] = {
     { 0x0029, "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5" },
     { 0x002A, "TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5" },
     { 0x002B, "TLS_KRB5_EXPORT_WITH_RC4_40_MD5" },
-    { 0x002C, "TLS_PSK_WITH_NULL_SHA" },
-    { 0x002D, "TLS_DHE_PSK_WITH_NULL_SHA" },
-    { 0x002E, "TLS_RSA_PSK_WITH_NULL_SHA" },
-    { 0x002F, "TLS_RSA_WITH_AES_128_CBC_SHA" },
+    { 0x002C, TLS1_RFC_PSK_WITH_NULL_SHA },
+    { 0x002D, TLS1_RFC_DHE_PSK_WITH_NULL_SHA },
+    { 0x002E, TLS1_RFC_RSA_PSK_WITH_NULL_SHA },
+    { 0x002F, TLS1_RFC_RSA_WITH_AES_128_SHA },
     { 0x0030, "TLS_DH_DSS_WITH_AES_128_CBC_SHA" },
     { 0x0031, "TLS_DH_RSA_WITH_AES_128_CBC_SHA" },
-    { 0x0032, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" },
-    { 0x0033, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" },
-    { 0x0034, "TLS_DH_anon_WITH_AES_128_CBC_SHA" },
-    { 0x0035, "TLS_RSA_WITH_AES_256_CBC_SHA" },
+    { 0x0032, TLS1_RFC_DHE_DSS_WITH_AES_128_SHA },
+    { 0x0033, TLS1_RFC_DHE_RSA_WITH_AES_128_SHA },
+    { 0x0034, TLS1_RFC_ADH_WITH_AES_128_SHA },
+    { 0x0035, TLS1_RFC_RSA_WITH_AES_256_SHA },
     { 0x0036, "TLS_DH_DSS_WITH_AES_256_CBC_SHA" },
     { 0x0037, "TLS_DH_RSA_WITH_AES_256_CBC_SHA" },
-    { 0x0038, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" },
-    { 0x0039, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" },
-    { 0x003A, "TLS_DH_anon_WITH_AES_256_CBC_SHA" },
-    { 0x003B, "TLS_RSA_WITH_NULL_SHA256" },
-    { 0x003C, "TLS_RSA_WITH_AES_128_CBC_SHA256" },
-    { 0x003D, "TLS_RSA_WITH_AES_256_CBC_SHA256" },
+    { 0x0038, TLS1_RFC_DHE_DSS_WITH_AES_256_SHA },
+    { 0x0039, TLS1_RFC_DHE_RSA_WITH_AES_256_SHA },
+    { 0x003A, TLS1_RFC_ADH_WITH_AES_256_SHA },
+    { 0x003B, TLS1_RFC_RSA_WITH_NULL_SHA256 },
+    { 0x003C, TLS1_RFC_RSA_WITH_AES_128_SHA256 },
+    { 0x003D, TLS1_RFC_RSA_WITH_AES_256_SHA256 },
     { 0x003E, "TLS_DH_DSS_WITH_AES_128_CBC_SHA256" },
     { 0x003F, "TLS_DH_RSA_WITH_AES_128_CBC_SHA256" },
-    { 0x0040, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" },
-    { 0x0041, "TLS_RSA_WITH_CAMELLIA_128_CBC_SHA" },
+    { 0x0040, TLS1_RFC_DHE_DSS_WITH_AES_128_SHA256 },
+    { 0x0041, TLS1_RFC_RSA_WITH_CAMELLIA_128_CBC_SHA },
     { 0x0042, "TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA" },
     { 0x0043, "TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA" },
-    { 0x0044, "TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA" },
-    { 0x0045, "TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA" },
-    { 0x0046, "TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA" },
-    { 0x0067, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256" },
+    { 0x0044, TLS1_RFC_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA },
+    { 0x0045, TLS1_RFC_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA },
+    { 0x0046, TLS1_RFC_ADH_WITH_CAMELLIA_128_CBC_SHA },
+    { 0x0067, TLS1_RFC_DHE_RSA_WITH_AES_128_SHA256 },
     { 0x0068, "TLS_DH_DSS_WITH_AES_256_CBC_SHA256" },
     { 0x0069, "TLS_DH_RSA_WITH_AES_256_CBC_SHA256" },
-    { 0x006A, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" },
-    { 0x006B, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256" },
-    { 0x006C, "TLS_DH_anon_WITH_AES_128_CBC_SHA256" },
-    { 0x006D, "TLS_DH_anon_WITH_AES_256_CBC_SHA256" },
+    { 0x006A, TLS1_RFC_DHE_DSS_WITH_AES_256_SHA256 },
+    { 0x006B, TLS1_RFC_DHE_RSA_WITH_AES_256_SHA256 },
+    { 0x006C, TLS1_RFC_ADH_WITH_AES_128_SHA256 },
+    { 0x006D, TLS1_RFC_ADH_WITH_AES_256_SHA256 },
     { 0x0081, "TLS_GOSTR341001_WITH_28147_CNT_IMIT" },
     { 0x0083, "TLS_GOSTR341001_WITH_NULL_GOSTR3411" },
-    { 0x0084, "TLS_RSA_WITH_CAMELLIA_256_CBC_SHA" },
+    { 0x0084, TLS1_RFC_RSA_WITH_CAMELLIA_256_CBC_SHA },
     { 0x0085, "TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA" },
     { 0x0086, "TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA" },
-    { 0x0087, "TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA" },
-    { 0x0088, "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA" },
-    { 0x0089, "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA" },
-    { 0x008A, "TLS_PSK_WITH_RC4_128_SHA" },
-    { 0x008B, "TLS_PSK_WITH_3DES_EDE_CBC_SHA" },
-    { 0x008C, "TLS_PSK_WITH_AES_128_CBC_SHA" },
-    { 0x008D, "TLS_PSK_WITH_AES_256_CBC_SHA" },
-    { 0x008E, "TLS_DHE_PSK_WITH_RC4_128_SHA" },
-    { 0x008F, "TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA" },
-    { 0x0090, "TLS_DHE_PSK_WITH_AES_128_CBC_SHA" },
-    { 0x0091, "TLS_DHE_PSK_WITH_AES_256_CBC_SHA" },
-    { 0x0092, "TLS_RSA_PSK_WITH_RC4_128_SHA" },
-    { 0x0093, "TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA" },
-    { 0x0094, "TLS_RSA_PSK_WITH_AES_128_CBC_SHA" },
-    { 0x0095, "TLS_RSA_PSK_WITH_AES_256_CBC_SHA" },
-    { 0x0096, "TLS_RSA_WITH_SEED_CBC_SHA" },
+    { 0x0087, TLS1_RFC_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA },
+    { 0x0088, TLS1_RFC_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA },
+    { 0x0089, TLS1_RFC_ADH_WITH_CAMELLIA_256_CBC_SHA },
+    { 0x008A, TLS1_RFC_PSK_WITH_RC4_128_SHA },
+    { 0x008B, TLS1_RFC_PSK_WITH_3DES_EDE_CBC_SHA },
+    { 0x008C, TLS1_RFC_PSK_WITH_AES_128_CBC_SHA },
+    { 0x008D, TLS1_RFC_PSK_WITH_AES_256_CBC_SHA },
+    { 0x008E, TLS1_RFC_DHE_PSK_WITH_RC4_128_SHA },
+    { 0x008F, TLS1_RFC_DHE_PSK_WITH_3DES_EDE_CBC_SHA },
+    { 0x0090, TLS1_RFC_DHE_PSK_WITH_AES_128_CBC_SHA },
+    { 0x0091, TLS1_RFC_DHE_PSK_WITH_AES_256_CBC_SHA },
+    { 0x0092, TLS1_RFC_RSA_PSK_WITH_RC4_128_SHA },
+    { 0x0093, TLS1_RFC_RSA_PSK_WITH_3DES_EDE_CBC_SHA },
+    { 0x0094, TLS1_RFC_RSA_PSK_WITH_AES_128_CBC_SHA },
+    { 0x0095, TLS1_RFC_RSA_PSK_WITH_AES_256_CBC_SHA },
+    { 0x0096, TLS1_RFC_RSA_WITH_SEED_SHA },
     { 0x0097, "TLS_DH_DSS_WITH_SEED_CBC_SHA" },
     { 0x0098, "TLS_DH_RSA_WITH_SEED_CBC_SHA" },
-    { 0x0099, "TLS_DHE_DSS_WITH_SEED_CBC_SHA" },
-    { 0x009A, "TLS_DHE_RSA_WITH_SEED_CBC_SHA" },
-    { 0x009B, "TLS_DH_anon_WITH_SEED_CBC_SHA" },
-    { 0x009C, "TLS_RSA_WITH_AES_128_GCM_SHA256" },
-    { 0x009D, "TLS_RSA_WITH_AES_256_GCM_SHA384" },
-    { 0x009E, "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" },
-    { 0x009F, "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" },
+    { 0x0099, TLS1_RFC_DHE_DSS_WITH_SEED_SHA },
+    { 0x009A, TLS1_RFC_DHE_RSA_WITH_SEED_SHA },
+    { 0x009B, TLS1_RFC_ADH_WITH_SEED_SHA },
+    { 0x009C, TLS1_RFC_RSA_WITH_AES_128_GCM_SHA256 },
+    { 0x009D, TLS1_RFC_RSA_WITH_AES_256_GCM_SHA384 },
+    { 0x009E, TLS1_RFC_DHE_RSA_WITH_AES_128_GCM_SHA256 },
+    { 0x009F, TLS1_RFC_DHE_RSA_WITH_AES_256_GCM_SHA384 },
     { 0x00A0, "TLS_DH_RSA_WITH_AES_128_GCM_SHA256" },
     { 0x00A1, "TLS_DH_RSA_WITH_AES_256_GCM_SHA384" },
-    { 0x00A2, "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256" },
-    { 0x00A3, "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384" },
+    { 0x00A2, TLS1_RFC_DHE_DSS_WITH_AES_128_GCM_SHA256 },
+    { 0x00A3, TLS1_RFC_DHE_DSS_WITH_AES_256_GCM_SHA384 },
     { 0x00A4, "TLS_DH_DSS_WITH_AES_128_GCM_SHA256" },
     { 0x00A5, "TLS_DH_DSS_WITH_AES_256_GCM_SHA384" },
-    { 0x00A6, "TLS_DH_anon_WITH_AES_128_GCM_SHA256" },
-    { 0x00A7, "TLS_DH_anon_WITH_AES_256_GCM_SHA384" },
-    { 0x00A8, "TLS_PSK_WITH_AES_128_GCM_SHA256" },
-    { 0x00A9, "TLS_PSK_WITH_AES_256_GCM_SHA384" },
-    { 0x00AA, "TLS_DHE_PSK_WITH_AES_128_GCM_SHA256" },
-    { 0x00AB, "TLS_DHE_PSK_WITH_AES_256_GCM_SHA384" },
-    { 0x00AC, "TLS_RSA_PSK_WITH_AES_128_GCM_SHA256" },
-    { 0x00AD, "TLS_RSA_PSK_WITH_AES_256_GCM_SHA384" },
-    { 0x00AE, "TLS_PSK_WITH_AES_128_CBC_SHA256" },
-    { 0x00AF, "TLS_PSK_WITH_AES_256_CBC_SHA384" },
-    { 0x00B0, "TLS_PSK_WITH_NULL_SHA256" },
-    { 0x00B1, "TLS_PSK_WITH_NULL_SHA384" },
-    { 0x00B2, "TLS_DHE_PSK_WITH_AES_128_CBC_SHA256" },
-    { 0x00B3, "TLS_DHE_PSK_WITH_AES_256_CBC_SHA384" },
-    { 0x00B4, "TLS_DHE_PSK_WITH_NULL_SHA256" },
-    { 0x00B5, "TLS_DHE_PSK_WITH_NULL_SHA384" },
-    { 0x00B6, "TLS_RSA_PSK_WITH_AES_128_CBC_SHA256" },
-    { 0x00B7, "TLS_RSA_PSK_WITH_AES_256_CBC_SHA384" },
-    { 0x00B8, "TLS_RSA_PSK_WITH_NULL_SHA256" },
-    { 0x00B9, "TLS_RSA_PSK_WITH_NULL_SHA384" },
-    { 0x00BA, "TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256" },
+    { 0x00A6, TLS1_RFC_ADH_WITH_AES_128_GCM_SHA256 },
+    { 0x00A7, TLS1_RFC_ADH_WITH_AES_256_GCM_SHA384 },
+    { 0x00A8, TLS1_RFC_PSK_WITH_AES_128_GCM_SHA256 },
+    { 0x00A9, TLS1_RFC_PSK_WITH_AES_256_GCM_SHA384 },
+    { 0x00AA, TLS1_RFC_DHE_PSK_WITH_AES_128_GCM_SHA256 },
+    { 0x00AB, TLS1_RFC_DHE_PSK_WITH_AES_256_GCM_SHA384 },
+    { 0x00AC, TLS1_RFC_RSA_PSK_WITH_AES_128_GCM_SHA256 },
+    { 0x00AD, TLS1_RFC_RSA_PSK_WITH_AES_256_GCM_SHA384 },
+    { 0x00AE, TLS1_RFC_PSK_WITH_AES_128_CBC_SHA256 },
+    { 0x00AF, TLS1_RFC_PSK_WITH_AES_256_CBC_SHA384 },
+    { 0x00B0, TLS1_RFC_PSK_WITH_NULL_SHA256 },
+    { 0x00B1, TLS1_RFC_PSK_WITH_NULL_SHA384 },
+    { 0x00B2, TLS1_RFC_DHE_PSK_WITH_AES_128_CBC_SHA256 },
+    { 0x00B3, TLS1_RFC_DHE_PSK_WITH_AES_256_CBC_SHA384 },
+    { 0x00B4, TLS1_RFC_DHE_PSK_WITH_NULL_SHA256 },
+    { 0x00B5, TLS1_RFC_DHE_PSK_WITH_NULL_SHA384 },
+    { 0x00B6, TLS1_RFC_RSA_PSK_WITH_AES_128_CBC_SHA256 },
+    { 0x00B7, TLS1_RFC_RSA_PSK_WITH_AES_256_CBC_SHA384 },
+    { 0x00B8, TLS1_RFC_RSA_PSK_WITH_NULL_SHA256 },
+    { 0x00B9, TLS1_RFC_RSA_PSK_WITH_NULL_SHA384 },
+    { 0x00BA, TLS1_RFC_RSA_WITH_CAMELLIA_128_CBC_SHA256 },
     { 0x00BB, "TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256" },
     { 0x00BC, "TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256" },
-    { 0x00BD, "TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256" },
-    { 0x00BE, "TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256" },
-    { 0x00BF, "TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256" },
-    { 0x00C0, "TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256" },
+    { 0x00BD, TLS1_RFC_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 },
+    { 0x00BE, TLS1_RFC_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 },
+    { 0x00BF, TLS1_RFC_ADH_WITH_CAMELLIA_128_CBC_SHA256 },
+    { 0x00C0, TLS1_RFC_RSA_WITH_CAMELLIA_256_CBC_SHA256 },
     { 0x00C1, "TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256" },
     { 0x00C2, "TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256" },
-    { 0x00C3, "TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256" },
-    { 0x00C4, "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256" },
-    { 0x00C5, "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256" },
+    { 0x00C3, TLS1_RFC_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 },
+    { 0x00C4, TLS1_RFC_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 },
+    { 0x00C5, TLS1_RFC_ADH_WITH_CAMELLIA_256_CBC_SHA256 },
+    { 0x00C6, TLS1_3_RFC_SM4_GCM_SM3 },
+    { 0x00C7, TLS1_3_RFC_SM4_CCM_SM3 },
     { 0x00FF, "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" },
     { 0x5600, "TLS_FALLBACK_SCSV" },
     { 0xC001, "TLS_ECDH_ECDSA_WITH_NULL_SHA" },
@@ -261,60 +263,60 @@ static const ssl_trace_tbl ssl_ciphers_tbl[] = {
     { 0xC003, "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA" },
     { 0xC004, "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA" },
     { 0xC005, "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA" },
-    { 0xC006, "TLS_ECDHE_ECDSA_WITH_NULL_SHA" },
-    { 0xC007, "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA" },
-    { 0xC008, "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA" },
-    { 0xC009, "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" },
-    { 0xC00A, "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" },
+    { 0xC006, TLS1_RFC_ECDHE_ECDSA_WITH_NULL_SHA },
+    { 0xC007, TLS1_RFC_ECDHE_ECDSA_WITH_RC4_128_SHA },
+    { 0xC008, TLS1_RFC_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA },
+    { 0xC009, TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CBC_SHA },
+    { 0xC00A, TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CBC_SHA },
     { 0xC00B, "TLS_ECDH_RSA_WITH_NULL_SHA" },
     { 0xC00C, "TLS_ECDH_RSA_WITH_RC4_128_SHA" },
     { 0xC00D, "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA" },
     { 0xC00E, "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA" },
     { 0xC00F, "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA" },
-    { 0xC010, "TLS_ECDHE_RSA_WITH_NULL_SHA" },
-    { 0xC011, "TLS_ECDHE_RSA_WITH_RC4_128_SHA" },
-    { 0xC012, "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA" },
-    { 0xC013, "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" },
-    { 0xC014, "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" },
-    { 0xC015, "TLS_ECDH_anon_WITH_NULL_SHA" },
-    { 0xC016, "TLS_ECDH_anon_WITH_RC4_128_SHA" },
-    { 0xC017, "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA" },
-    { 0xC018, "TLS_ECDH_anon_WITH_AES_128_CBC_SHA" },
-    { 0xC019, "TLS_ECDH_anon_WITH_AES_256_CBC_SHA" },
-    { 0xC01A, "TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA" },
-    { 0xC01B, "TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA" },
-    { 0xC01C, "TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA" },
-    { 0xC01D, "TLS_SRP_SHA_WITH_AES_128_CBC_SHA" },
-    { 0xC01E, "TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA" },
-    { 0xC01F, "TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA" },
-    { 0xC020, "TLS_SRP_SHA_WITH_AES_256_CBC_SHA" },
-    { 0xC021, "TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA" },
-    { 0xC022, "TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA" },
-    { 0xC023, "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" },
-    { 0xC024, "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" },
+    { 0xC010, TLS1_RFC_ECDHE_RSA_WITH_NULL_SHA },
+    { 0xC011, TLS1_RFC_ECDHE_RSA_WITH_RC4_128_SHA },
+    { 0xC012, TLS1_RFC_ECDHE_RSA_WITH_DES_192_CBC3_SHA },
+    { 0xC013, TLS1_RFC_ECDHE_RSA_WITH_AES_128_CBC_SHA },
+    { 0xC014, TLS1_RFC_ECDHE_RSA_WITH_AES_256_CBC_SHA },
+    { 0xC015, TLS1_RFC_ECDH_anon_WITH_NULL_SHA },
+    { 0xC016, TLS1_RFC_ECDH_anon_WITH_RC4_128_SHA },
+    { 0xC017, TLS1_RFC_ECDH_anon_WITH_DES_192_CBC3_SHA },
+    { 0xC018, TLS1_RFC_ECDH_anon_WITH_AES_128_CBC_SHA },
+    { 0xC019, TLS1_RFC_ECDH_anon_WITH_AES_256_CBC_SHA },
+    { 0xC01A, TLS1_RFC_SRP_SHA_WITH_3DES_EDE_CBC_SHA },
+    { 0xC01B, TLS1_RFC_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA },
+    { 0xC01C, TLS1_RFC_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA },
+    { 0xC01D, TLS1_RFC_SRP_SHA_WITH_AES_128_CBC_SHA },
+    { 0xC01E, TLS1_RFC_SRP_SHA_RSA_WITH_AES_128_CBC_SHA },
+    { 0xC01F, TLS1_RFC_SRP_SHA_DSS_WITH_AES_128_CBC_SHA },
+    { 0xC020, TLS1_RFC_SRP_SHA_WITH_AES_256_CBC_SHA },
+    { 0xC021, TLS1_RFC_SRP_SHA_RSA_WITH_AES_256_CBC_SHA },
+    { 0xC022, TLS1_RFC_SRP_SHA_DSS_WITH_AES_256_CBC_SHA },
+    { 0xC023, TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_SHA256 },
+    { 0xC024, TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_SHA384 },
     { 0xC025, "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256" },
     { 0xC026, "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384" },
-    { 0xC027, "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" },
-    { 0xC028, "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" },
+    { 0xC027, TLS1_RFC_ECDHE_RSA_WITH_AES_128_SHA256 },
+    { 0xC028, TLS1_RFC_ECDHE_RSA_WITH_AES_256_SHA384 },
     { 0xC029, "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256" },
     { 0xC02A, "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384" },
-    { 0xC02B, "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" },
-    { 0xC02C, "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" },
+    { 0xC02B, TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 },
+    { 0xC02C, TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 },
     { 0xC02D, "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256" },
     { 0xC02E, "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384" },
-    { 0xC02F, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" },
-    { 0xC030, "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" },
+    { 0xC02F, TLS1_RFC_ECDHE_RSA_WITH_AES_128_GCM_SHA256 },
+    { 0xC030, TLS1_RFC_ECDHE_RSA_WITH_AES_256_GCM_SHA384 },
     { 0xC031, "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256" },
     { 0xC032, "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384" },
-    { 0xC033, "TLS_ECDHE_PSK_WITH_RC4_128_SHA" },
-    { 0xC034, "TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA" },
-    { 0xC035, "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA" },
-    { 0xC036, "TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA" },
-    { 0xC037, "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256" },
-    { 0xC038, "TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384" },
-    { 0xC039, "TLS_ECDHE_PSK_WITH_NULL_SHA" },
-    { 0xC03A, "TLS_ECDHE_PSK_WITH_NULL_SHA256" },
-    { 0xC03B, "TLS_ECDHE_PSK_WITH_NULL_SHA384" },
+    { 0xC033, TLS1_RFC_ECDHE_PSK_WITH_RC4_128_SHA },
+    { 0xC034, TLS1_RFC_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA },
+    { 0xC035, TLS1_RFC_ECDHE_PSK_WITH_AES_128_CBC_SHA },
+    { 0xC036, TLS1_RFC_ECDHE_PSK_WITH_AES_256_CBC_SHA },
+    { 0xC037, TLS1_RFC_ECDHE_PSK_WITH_AES_128_CBC_SHA256 },
+    { 0xC038, TLS1_RFC_ECDHE_PSK_WITH_AES_256_CBC_SHA384 },
+    { 0xC039, TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA },
+    { 0xC03A, TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA256 },
+    { 0xC03B, TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA384 },
     { 0xC03C, "TLS_RSA_WITH_ARIA_128_CBC_SHA256" },
     { 0xC03D, "TLS_RSA_WITH_ARIA_256_CBC_SHA384" },
     { 0xC03E, "TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256" },
@@ -335,46 +337,46 @@ static const ssl_trace_tbl ssl_ciphers_tbl[] = {
     { 0xC04D, "TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384" },
     { 0xC04E, "TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256" },
     { 0xC04F, "TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384" },
-    { 0xC050, "TLS_RSA_WITH_ARIA_128_GCM_SHA256" },
-    { 0xC051, "TLS_RSA_WITH_ARIA_256_GCM_SHA384" },
-    { 0xC052, "TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256" },
-    { 0xC053, "TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384" },
-    { 0xC054, "TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256" },
-    { 0xC055, "TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384" },
-    { 0xC056, "TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256" },
-    { 0xC057, "TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384" },
-    { 0xC058, "TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256" },
-    { 0xC059, "TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384" },
-    { 0xC05A, "TLS_DH_anon_WITH_ARIA_128_GCM_SHA256" },
-    { 0xC05B, "TLS_DH_anon_WITH_ARIA_256_GCM_SHA384" },
-    { 0xC05C, "TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256" },
-    { 0xC05D, "TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384" },
-    { 0xC05E, "TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256" },
-    { 0xC05F, "TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384" },
-    { 0xC060, "TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256" },
-    { 0xC061, "TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384" },
-    { 0xC062, "TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256" },
-    { 0xC063, "TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384" },
+    { 0xC050, TLS1_RFC_RSA_WITH_ARIA_128_GCM_SHA256 },
+    { 0xC051, TLS1_RFC_RSA_WITH_ARIA_256_GCM_SHA384 },
+    { 0xC052, TLS1_RFC_DHE_RSA_WITH_ARIA_128_GCM_SHA256 },
+    { 0xC053, TLS1_RFC_DHE_RSA_WITH_ARIA_256_GCM_SHA384 },
+    { 0xC054, TLS1_RFC_DH_RSA_WITH_ARIA_128_GCM_SHA256 },
+    { 0xC055, TLS1_RFC_DH_RSA_WITH_ARIA_256_GCM_SHA384 },
+    { 0xC056, TLS1_RFC_DHE_DSS_WITH_ARIA_128_GCM_SHA256 },
+    { 0xC057, TLS1_RFC_DHE_DSS_WITH_ARIA_256_GCM_SHA384 },
+    { 0xC058, TLS1_RFC_DH_DSS_WITH_ARIA_128_GCM_SHA256 },
+    { 0xC059, TLS1_RFC_DH_DSS_WITH_ARIA_256_GCM_SHA384 },
+    { 0xC05A, TLS1_RFC_DH_anon_WITH_ARIA_128_GCM_SHA256 },
+    { 0xC05B, TLS1_RFC_DH_anon_WITH_ARIA_256_GCM_SHA384 },
+    { 0xC05C, TLS1_RFC_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 },
+    { 0xC05D, TLS1_RFC_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 },
+    { 0xC05E, TLS1_RFC_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 },
+    { 0xC05F, TLS1_RFC_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 },
+    { 0xC060, TLS1_RFC_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 },
+    { 0xC061, TLS1_RFC_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 },
+    { 0xC062, TLS1_RFC_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 },
+    { 0xC063, TLS1_RFC_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 },
     { 0xC064, "TLS_PSK_WITH_ARIA_128_CBC_SHA256" },
     { 0xC065, "TLS_PSK_WITH_ARIA_256_CBC_SHA384" },
     { 0xC066, "TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256" },
     { 0xC067, "TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384" },
     { 0xC068, "TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256" },
     { 0xC069, "TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384" },
-    { 0xC06A, "TLS_PSK_WITH_ARIA_128_GCM_SHA256" },
-    { 0xC06B, "TLS_PSK_WITH_ARIA_256_GCM_SHA384" },
-    { 0xC06C, "TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256" },
-    { 0xC06D, "TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384" },
-    { 0xC06E, "TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256" },
-    { 0xC06F, "TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384" },
+    { 0xC06A, TLS1_RFC_PSK_WITH_ARIA_128_GCM_SHA256 },
+    { 0xC06B, TLS1_RFC_PSK_WITH_ARIA_256_GCM_SHA384 },
+    { 0xC06C, TLS1_RFC_DHE_PSK_WITH_ARIA_128_GCM_SHA256 },
+    { 0xC06D, TLS1_RFC_DHE_PSK_WITH_ARIA_256_GCM_SHA384 },
+    { 0xC06E, TLS1_RFC_RSA_PSK_WITH_ARIA_128_GCM_SHA256 },
+    { 0xC06F, TLS1_RFC_RSA_PSK_WITH_ARIA_256_GCM_SHA384 },
     { 0xC070, "TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256" },
     { 0xC071, "TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384" },
-    { 0xC072, "TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256" },
-    { 0xC073, "TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384" },
+    { 0xC072, TLS1_RFC_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 },
+    { 0xC073, TLS1_RFC_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 },
     { 0xC074, "TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256" },
     { 0xC075, "TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384" },
-    { 0xC076, "TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256" },
-    { 0xC077, "TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384" },
+    { 0xC076, TLS1_RFC_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 },
+    { 0xC077, TLS1_RFC_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 },
     { 0xC078, "TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256" },
     { 0xC079, "TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384" },
     { 0xC07A, "TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256" },
@@ -403,56 +405,55 @@ static const ssl_trace_tbl ssl_ciphers_tbl[] = {
     { 0xC091, "TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384" },
     { 0xC092, "TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256" },
     { 0xC093, "TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384" },
-    { 0xC094, "TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256" },
-    { 0xC095, "TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384" },
-    { 0xC096, "TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256" },
-    { 0xC097, "TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384" },
-    { 0xC098, "TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256" },
-    { 0xC099, "TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384" },
-    { 0xC09A, "TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256" },
-    { 0xC09B, "TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384" },
-    { 0xC09C, "TLS_RSA_WITH_AES_128_CCM" },
-    { 0xC09D, "TLS_RSA_WITH_AES_256_CCM" },
-    { 0xC09E, "TLS_DHE_RSA_WITH_AES_128_CCM" },
-    { 0xC09F, "TLS_DHE_RSA_WITH_AES_256_CCM" },
-    { 0xC0A0, "TLS_RSA_WITH_AES_128_CCM_8" },
-    { 0xC0A1, "TLS_RSA_WITH_AES_256_CCM_8" },
-    { 0xC0A2, "TLS_DHE_RSA_WITH_AES_128_CCM_8" },
-    { 0xC0A3, "TLS_DHE_RSA_WITH_AES_256_CCM_8" },
-    { 0xC0A4, "TLS_PSK_WITH_AES_128_CCM" },
-    { 0xC0A5, "TLS_PSK_WITH_AES_256_CCM" },
-    { 0xC0A6, "TLS_DHE_PSK_WITH_AES_128_CCM" },
-    { 0xC0A7, "TLS_DHE_PSK_WITH_AES_256_CCM" },
-    { 0xC0A8, "TLS_PSK_WITH_AES_128_CCM_8" },
-    { 0xC0A9, "TLS_PSK_WITH_AES_256_CCM_8" },
-    { 0xC0AA, "TLS_PSK_DHE_WITH_AES_128_CCM_8" },
-    { 0xC0AB, "TLS_PSK_DHE_WITH_AES_256_CCM_8" },
-    { 0xC0AC, "TLS_ECDHE_ECDSA_WITH_AES_128_CCM" },
-    { 0xC0AD, "TLS_ECDHE_ECDSA_WITH_AES_256_CCM" },
-    { 0xC0AE, "TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8" },
-    { 0xC0AF, "TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8" },
+    { 0xC094, TLS1_RFC_PSK_WITH_CAMELLIA_128_CBC_SHA256 },
+    { 0xC095, TLS1_RFC_PSK_WITH_CAMELLIA_256_CBC_SHA384 },
+    { 0xC096, TLS1_RFC_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 },
+    { 0xC097, TLS1_RFC_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 },
+    { 0xC098, TLS1_RFC_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 },
+    { 0xC099, TLS1_RFC_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 },
+    { 0xC09A, TLS1_RFC_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 },
+    { 0xC09B, TLS1_RFC_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 },
+    { 0xC09C, TLS1_RFC_RSA_WITH_AES_128_CCM },
+    { 0xC09D, TLS1_RFC_RSA_WITH_AES_256_CCM },
+    { 0xC09E, TLS1_RFC_DHE_RSA_WITH_AES_128_CCM },
+    { 0xC09F, TLS1_RFC_DHE_RSA_WITH_AES_256_CCM },
+    { 0xC0A0, TLS1_RFC_RSA_WITH_AES_128_CCM_8 },
+    { 0xC0A1, TLS1_RFC_RSA_WITH_AES_256_CCM_8 },
+    { 0xC0A2, TLS1_RFC_DHE_RSA_WITH_AES_128_CCM_8 },
+    { 0xC0A3, TLS1_RFC_DHE_RSA_WITH_AES_256_CCM_8 },
+    { 0xC0A4, TLS1_RFC_PSK_WITH_AES_128_CCM },
+    { 0xC0A5, TLS1_RFC_PSK_WITH_AES_256_CCM },
+    { 0xC0A6, TLS1_RFC_DHE_PSK_WITH_AES_128_CCM },
+    { 0xC0A7, TLS1_RFC_DHE_PSK_WITH_AES_256_CCM },
+    { 0xC0A8, TLS1_RFC_PSK_WITH_AES_128_CCM_8 },
+    { 0xC0A9, TLS1_RFC_PSK_WITH_AES_256_CCM_8 },
+    { 0xC0AA, TLS1_RFC_DHE_PSK_WITH_AES_128_CCM_8 },
+    { 0xC0AB, TLS1_RFC_DHE_PSK_WITH_AES_256_CCM_8 },
+    { 0xC0AC, TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CCM },
+    { 0xC0AD, TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CCM },
+    { 0xC0AE, TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CCM_8 },
+    { 0xC0AF, TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CCM_8 },
     { 0xC102, "IANA-GOST2012-GOST8912-GOST8912" },
-    { 0xCCA8, "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256" },
-    { 0xCCA9, "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256" },
-    { 0xCCAA, "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256" },
-    { 0xCCAB, "TLS_PSK_WITH_CHACHA20_POLY1305_SHA256" },
-    { 0xCCAC, "TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256" },
-    { 0xCCAD, "TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256" },
-    { 0xCCAE, "TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256" },
-    { 0x1301, "TLS_AES_128_GCM_SHA256" },
-    { 0x1302, "TLS_AES_256_GCM_SHA384" },
-    { 0x1303, "TLS_CHACHA20_POLY1305_SHA256" },
-    { 0x1304, "TLS_AES_128_CCM_SHA256" },
-    { 0x1305, "TLS_AES_128_CCM_8_SHA256" },
+    { 0xCCA8, TLS1_RFC_ECDHE_RSA_WITH_CHACHA20_POLY1305 },
+    { 0xCCA9, TLS1_RFC_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 },
+    { 0xCCAA, TLS1_RFC_DHE_RSA_WITH_CHACHA20_POLY1305 },
+    { 0xCCAB, TLS1_RFC_PSK_WITH_CHACHA20_POLY1305 },
+    { 0xCCAC, TLS1_RFC_ECDHE_PSK_WITH_CHACHA20_POLY1305 },
+    { 0xCCAD, TLS1_RFC_DHE_PSK_WITH_CHACHA20_POLY1305 },
+    { 0xCCAE, TLS1_RFC_RSA_PSK_WITH_CHACHA20_POLY1305 },
+    { 0x1301, TLS1_3_RFC_AES_128_GCM_SHA256 },
+    { 0x1302, TLS1_3_RFC_AES_256_GCM_SHA384 },
+    { 0x1303, TLS1_3_RFC_CHACHA20_POLY1305_SHA256 },
+    { 0x1304, TLS1_3_RFC_AES_128_CCM_SHA256 },
+    { 0x1305, TLS1_3_RFC_AES_128_CCM_8_SHA256 },
     { 0xFEFE, "SSL_RSA_FIPS_WITH_DES_CBC_SHA" },
     { 0xFEFF, "SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA" },
     { 0xFF85, "LEGACY-GOST2012-GOST8912-GOST8912" },
     { 0xFF87, "GOST2012-NULL-GOST12" },
-    { 0xC0B4, "TLS_SHA256_SHA256" },
-    { 0xC0B5, "TLS_SHA384_SHA384" },
+    { 0xC0B4, TLS1_3_RFC_SHA256_SHA256 },
+    { 0xC0B5, TLS1_3_RFC_SHA384_SHA384 },
     { 0xC100, "GOST2012-KUZNYECHIK-KUZNYECHIKOMAC" },
     { 0xC101, "GOST2012-MAGMA-MAGMAOMAC" },
-    { 0xC102, "GOST2012-GOST8912-IANA" },
 };

 /* Compression methods */
@@ -501,6 +502,10 @@ static const ssl_trace_tbl ssl_exts_tbl[] = {
 #ifndef OPENSSL_NO_NEXTPROTONEG
     { TLSEXT_TYPE_next_proto_neg, "next_proto_neg" },
 #endif
+#ifndef OPENSSL_NO_ECH
+    { TLSEXT_TYPE_ech, "encrypted_client_hello" },
+    { TLSEXT_TYPE_outer_extensions, "outer_extension" },
+#endif
 };

 static const ssl_trace_tbl ssl_groups_tbl[] = {
@@ -544,6 +549,7 @@ static const ssl_trace_tbl ssl_groups_tbl[] = {
     { 38, "GC512A" },
     { 39, "GC512B" },
     { 40, "GC512C" },
+    { 41, "curveSM2" },
     { 256, "ffdhe2048" },
     { 257, "ffdhe3072" },
     { 258, "ffdhe4096" },
@@ -555,6 +561,7 @@ static const ssl_trace_tbl ssl_groups_tbl[] = {
     { 4587, "SecP256r1MLKEM768" },
     { 4588, "X25519MLKEM768" },
     { 4589, "SecP384r1MLKEM1024" },
+    { 4590, "curveSM2MLKEM768" },
     { 25497, "X25519Kyber768Draft00" },
     { 25498, "SecP256r1Kyber768Draft00" },
     { 0xFF01, "arbitrary_explicit_prime_curves" },
@@ -580,8 +587,6 @@ static const ssl_trace_tbl ssl_sigalg_tbl[] = {
     { TLSEXT_SIGALG_ecdsa_secp384r1_sha384, TLSEXT_SIGALG_ecdsa_secp384r1_sha384_name },
     { TLSEXT_SIGALG_ecdsa_secp521r1_sha512, TLSEXT_SIGALG_ecdsa_secp521r1_sha512_name },
     { TLSEXT_SIGALG_ecdsa_sha224, TLSEXT_SIGALG_ecdsa_sha224_name },
-    { TLSEXT_SIGALG_ed25519, TLSEXT_SIGALG_ed25519_name },
-    { TLSEXT_SIGALG_ed448, TLSEXT_SIGALG_ed448_name },
     { TLSEXT_SIGALG_ecdsa_sha1, TLSEXT_SIGALG_ecdsa_sha1_name },
     { TLSEXT_SIGALG_rsa_pss_rsae_sha256, TLSEXT_SIGALG_rsa_pss_rsae_sha256_name },
     { TLSEXT_SIGALG_rsa_pss_rsae_sha384, TLSEXT_SIGALG_rsa_pss_rsae_sha384_name },
@@ -604,17 +609,27 @@ static const ssl_trace_tbl ssl_sigalg_tbl[] = {
     { TLSEXT_SIGALG_gostr34102012_256_gostr34112012_256, TLSEXT_SIGALG_gostr34102012_256_gostr34112012_256_name },
     { TLSEXT_SIGALG_gostr34102012_512_gostr34112012_512, TLSEXT_SIGALG_gostr34102012_512_gostr34112012_512_name },
     { TLSEXT_SIGALG_gostr34102001_gostr3411, TLSEXT_SIGALG_gostr34102001_gostr3411_name },
+    { TLSEXT_SIGALG_sm2sig_sm3, TLSEXT_SIGALG_sm2sig_sm3_name },
+    { TLSEXT_SIGALG_ed25519, TLSEXT_SIGALG_ed25519_name },
+    { TLSEXT_SIGALG_ed448, TLSEXT_SIGALG_ed448_name },
     { TLSEXT_SIGALG_ecdsa_brainpoolP256r1_sha256, TLSEXT_SIGALG_ecdsa_brainpoolP256r1_sha256_name },
     { TLSEXT_SIGALG_ecdsa_brainpoolP384r1_sha384, TLSEXT_SIGALG_ecdsa_brainpoolP384r1_sha384_name },
     { TLSEXT_SIGALG_ecdsa_brainpoolP512r1_sha512, TLSEXT_SIGALG_ecdsa_brainpoolP512r1_sha512_name },
-    /*
-     * Well known groups that we happen to know about, but only come from
-     * provider capability declarations (hence no macros for the
-     * codepoints/names)
-     */
-    { 0x0904, "mldsa44" },
-    { 0x0905, "mldsa65" },
-    { 0x0906, "mldsa87" }
+    { TLSEXT_SIGALG_mldsa44, TLSEXT_SIGALG_mldsa44_name },
+    { TLSEXT_SIGALG_mldsa65, TLSEXT_SIGALG_mldsa65_name },
+    { TLSEXT_SIGALG_mldsa87, TLSEXT_SIGALG_mldsa87_name },
+    { TLSEXT_SIGALG_slhdsa_sha2_128s, TLSEXT_SIGALG_slhdsa_sha2_128s_name },
+    { TLSEXT_SIGALG_slhdsa_sha2_128f, TLSEXT_SIGALG_slhdsa_sha2_128f_name },
+    { TLSEXT_SIGALG_slhdsa_sha2_192s, TLSEXT_SIGALG_slhdsa_sha2_192s_name },
+    { TLSEXT_SIGALG_slhdsa_sha2_192f, TLSEXT_SIGALG_slhdsa_sha2_192f_name },
+    { TLSEXT_SIGALG_slhdsa_sha2_256s, TLSEXT_SIGALG_slhdsa_sha2_256s_name },
+    { TLSEXT_SIGALG_slhdsa_sha2_256f, TLSEXT_SIGALG_slhdsa_sha2_256f_name },
+    { TLSEXT_SIGALG_slhdsa_shake_128s, TLSEXT_SIGALG_slhdsa_shake_128s_name },
+    { TLSEXT_SIGALG_slhdsa_shake_128f, TLSEXT_SIGALG_slhdsa_shake_128f_name },
+    { TLSEXT_SIGALG_slhdsa_shake_192s, TLSEXT_SIGALG_slhdsa_shake_192s_name },
+    { TLSEXT_SIGALG_slhdsa_shake_192f, TLSEXT_SIGALG_slhdsa_shake_192f_name },
+    { TLSEXT_SIGALG_slhdsa_shake_256s, TLSEXT_SIGALG_slhdsa_shake_256s_name },
+    { TLSEXT_SIGALG_slhdsa_shake_256f, TLSEXT_SIGALG_slhdsa_shake_256f_name },
 };

 static const ssl_trace_tbl ssl_ctype_tbl[] = {
@@ -667,7 +682,7 @@ static void ssl_print_hex(BIO *bio, int indent, const char *name,
     size_t i;

     BIO_indent(bio, indent, 80);
-    BIO_printf(bio, "%s (len=%d): ", name, (int)msglen);
+    BIO_printf(bio, "%s (len=%zu): ", name, msglen);
     for (i = 0; i < msglen; i++)
         BIO_printf(bio, "%02X", msg[i]);
     BIO_puts(bio, "\n");
@@ -762,8 +777,8 @@ static int ssl_print_extension(BIO *bio, int indent, int server,
     uint32_t max_early_data;

     BIO_indent(bio, indent, 80);
-    BIO_printf(bio, "extension_type=%s(%d), length=%d\n",
-        ssl_trace_str(extype, ssl_exts_tbl), extype, (int)extlen);
+    BIO_printf(bio, "extension_type=%s(%d), length=%zu\n",
+        ssl_trace_str(extype, ssl_exts_tbl), extype, extlen);
     switch (extype) {
     case TLSEXT_TYPE_compress_certificate:
         if (extlen < 1)
@@ -807,7 +822,7 @@ static int ssl_print_extension(BIO *bio, int indent, int server,
             if (plen + 1 > xlen)
                 return 0;
             BIO_indent(bio, indent + 2, 80);
-            BIO_write(bio, ext, plen);
+            BIO_write(bio, ext, (int)plen);
             BIO_puts(bio, "\n");
             ext += plen;
             xlen -= plen + 1;
@@ -959,7 +974,7 @@ static int ssl_print_extension(BIO *bio, int indent, int server,
         return ssl_trace_list(bio, indent + 2, ext + 1, xlen, 1, ssl_cert_type_tbl);

     default:
-        BIO_dump_indent(bio, (const char *)ext, extlen, indent + 2);
+        BIO_dump_indent(bio, (const char *)ext, (int)extlen, indent + 2);
     }
     return 1;
 }
@@ -989,7 +1004,7 @@ static int ssl_print_extensions(BIO *bio, int indent, int server,
     }
     if (extslen > msglen)
         return 0;
-    BIO_printf(bio, "extensions, length = %d\n", (int)extslen);
+    BIO_printf(bio, "extensions, length = %zu\n", extslen);
     msglen -= extslen;
     while (extslen > 0) {
         int extype;
@@ -999,9 +1014,9 @@ static int ssl_print_extensions(BIO *bio, int indent, int server,
         extype = (msg[0] << 8) | msg[1];
         extlen = (msg[2] << 8) | msg[3];
         if (extslen < extlen + 4) {
-            BIO_printf(bio, "extensions, extype = %d, extlen = %d\n", extype,
-                (int)extlen);
-            BIO_dump_indent(bio, (const char *)msg, extslen, indent + 2);
+            BIO_printf(bio, "extensions, extype = %d, extlen = %zu\n", extype,
+                extlen);
+            BIO_dump_indent(bio, (const char *)msg, (int)extslen, indent + 2);
             return 0;
         }
         msg += 4;
@@ -1039,7 +1054,7 @@ static int ssl_print_client_hello(BIO *bio, const SSL_CONNECTION *sc, int indent
     msg += 2;
     msglen -= 2;
     BIO_indent(bio, indent, 80);
-    BIO_printf(bio, "cipher_suites (len=%d)\n", (int)len);
+    BIO_printf(bio, "cipher_suites (len=%zu)\n", len);
     if (msglen < len || len & 1)
         return 0;
     while (len > 0) {
@@ -1059,7 +1074,7 @@ static int ssl_print_client_hello(BIO *bio, const SSL_CONNECTION *sc, int indent
     if (msglen < len)
         return 0;
     BIO_indent(bio, indent, 80);
-    BIO_printf(bio, "compression_methods (len=%d)\n", (int)len);
+    BIO_printf(bio, "compression_methods (len=%zu)\n", len);
     while (len > 0) {
         BIO_indent(bio, indent + 2, 80);
         BIO_printf(bio, "%s (0x%02X)\n",
@@ -1094,7 +1109,7 @@ static int ssl_print_server_hello(BIO *bio, int indent,
         return 0;
     if (!ssl_print_random(bio, indent, &msg, &msglen))
         return 0;
-    if (vers != TLS1_3_VERSION
+    if (vers != TLS1_3_VERSION && vers != DTLS1_3_VERSION
         && !ssl_print_hexbuf(bio, indent, "session_id", 1, &msg, &msglen))
         return 0;
     if (msglen < 2)
@@ -1105,7 +1120,7 @@ static int ssl_print_server_hello(BIO *bio, int indent,
         msg[0], msg[1], ssl_trace_str(cs, ssl_ciphers_tbl));
     msg += 2;
     msglen -= 2;
-    if (vers != TLS1_3_VERSION) {
+    if (vers != TLS1_3_VERSION && vers != DTLS1_3_VERSION) {
         if (msglen < 1)
             return 0;
         BIO_indent(bio, indent, 80);
@@ -1185,14 +1200,9 @@ static int ssl_print_client_keyex(BIO *bio, int indent, const SSL_CONNECTION *sc

     case SSL_kRSA:
     case SSL_kRSAPSK:
-        if (TLS1_get_version(SSL_CONNECTION_GET_SSL(sc)) == SSL3_VERSION) {
-            ssl_print_hex(bio, indent + 2,
-                "EncryptedPreMasterSecret", msg, msglen);
-        } else {
-            if (!ssl_print_hexbuf(bio, indent + 2,
-                    "EncryptedPreMasterSecret", 2, &msg, &msglen))
-                return 0;
-        }
+        if (!ssl_print_hexbuf(bio, indent + 2,
+                "EncryptedPreMasterSecret", 2, &msg, &msglen))
+            return 0;
         break;

     case SSL_kDHE:
@@ -1304,9 +1314,9 @@ static int ssl_print_certificate(BIO *bio, const SSL_CONNECTION *sc, int indent,
         return 0;
     q = p + 3;
     BIO_indent(bio, indent, 80);
-    BIO_printf(bio, "ASN.1Cert, length=%d", (int)clen);
+    BIO_printf(bio, "ASN.1Cert, length=%zu", clen);
     x = X509_new_ex(ctx->libctx, ctx->propq);
-    if (x != NULL && d2i_X509(&x, &q, clen) == NULL) {
+    if (x != NULL && d2i_X509(&x, &q, (long)clen) == NULL) {
         X509_free(x);
         x = NULL;
     }
@@ -1332,7 +1342,6 @@ static int ssl_print_raw_public_key(BIO *bio, const SSL_CONNECTION *sc,
     int server, int indent, const unsigned char **pmsg, size_t *pmsglen)
 {
     EVP_PKEY *pkey;
-    SSL_CTX *ctx = SSL_CONNECTION_GET_CTX(sc);
     size_t clen;
     const unsigned char *msg = *pmsg;
     size_t msglen = *pmsglen;
@@ -1361,9 +1370,10 @@ static int ssl_print_raw_public_key(BIO *bio, const SSL_CONNECTION *sc,
     }

     BIO_indent(bio, indent, 80);
-    BIO_printf(bio, "raw_public_key, length=%d\n", (int)clen);
+    BIO_printf(bio, "raw_public_key, length=%zu\n", clen);

-    pkey = d2i_PUBKEY_ex(NULL, &msg, (long)clen, ctx->libctx, ctx->propq);
+    pkey = d2i_PUBKEY_ex(NULL, &msg, (long)clen,
+        sc->ssl.ctx->libctx, sc->ssl.ctx->propq);
     if (pkey == NULL)
         return 0;
     EVP_PKEY_print_public(bio, pkey, indent + 2, NULL);
@@ -1377,7 +1387,7 @@ static int ssl_print_certificates(BIO *bio, const SSL_CONNECTION *sc, int server
 {
     size_t clen;

-    if (SSL_CONNECTION_IS_TLS13(sc)
+    if (SSL_CONNECTION_IS_VERSION13(sc)
         && !ssl_print_hexbuf(bio, indent, "context", 1, &msg, &msglen))
         return 0;

@@ -1391,18 +1401,18 @@ static int ssl_print_certificates(BIO *bio, const SSL_CONNECTION *sc, int server
         || (!server && sc->ext.client_cert_type == TLSEXT_cert_type_rpk)) {
         if (!ssl_print_raw_public_key(bio, sc, server, indent, &msg, &clen))
             return 0;
-        if (SSL_CONNECTION_IS_TLS13(sc)
+        if (SSL_CONNECTION_IS_VERSION13(sc)
             && !ssl_print_extensions(bio, indent + 2, server,
                 SSL3_MT_CERTIFICATE, &msg, &clen))
             return 0;
         return 1;
     }
     BIO_indent(bio, indent, 80);
-    BIO_printf(bio, "certificate_list, length=%d\n", (int)clen);
+    BIO_printf(bio, "certificate_list, length=%zu\n", clen);
     while (clen > 0) {
         if (!ssl_print_certificate(bio, sc, indent + 2, &msg, &clen))
             return 0;
-        if (SSL_CONNECTION_IS_TLS13(sc)
+        if (SSL_CONNECTION_IS_VERSION13(sc)
             && !ssl_print_extensions(bio, indent + 2, server,
                 SSL3_MT_CERTIFICATE, &msg, &clen))
             return 0;
@@ -1438,14 +1448,14 @@ static int ssl_print_compressed_certificates(BIO *bio, const SSL_CONNECTION *sc,
     BIO_indent(bio, indent, 80);
     BIO_printf(bio, "Compression type=%s (0x%04x)\n", ssl_trace_str(alg, ssl_comp_cert_tbl), alg);
     BIO_indent(bio, indent, 80);
-    BIO_printf(bio, "Uncompressed length=%d\n", (int)uclen);
+    BIO_printf(bio, "Uncompressed length=%zu\n", uclen);
     BIO_indent(bio, indent, 80);
     if (clen > 0)
-        BIO_printf(bio, "Compressed length=%d, Ratio=%f:1\n", (int)clen, (float)uclen / (float)clen);
+        BIO_printf(bio, "Compressed length=%zu, Ratio=%f:1\n", clen, (float)uclen / (float)clen);
     else
-        BIO_printf(bio, "Compressed length=%d, Ratio=unknown\n", (int)clen);
+        BIO_printf(bio, "Compressed length=%zu, Ratio=unknown\n", clen);

-    BIO_dump_indent(bio, (const char *)msg, clen, indent);
+    BIO_dump_indent(bio, (const char *)msg, (int)clen, indent);

 #ifndef OPENSSL_NO_COMP_ALG
     if (!ossl_comp_has_alg(alg))
@@ -1470,7 +1480,9 @@ static int ssl_print_compressed_certificates(BIO *bio, const SSL_CONNECTION *sc,
     }

     if ((comp = COMP_CTX_new(method)) == NULL
-        || COMP_expand_block(comp, ucdata, uclen, (unsigned char *)msg, clen) != (int)uclen)
+        || COMP_expand_block(comp, ucdata, (int)uclen,
+               (unsigned char *)msg, (int)clen)
+            != (int)uclen)
         goto err;

     ret = ssl_print_certificates(bio, sc, server, indent, ucdata, uclen);
@@ -1487,7 +1499,7 @@ static int ssl_print_cert_request(BIO *bio, int indent, const SSL_CONNECTION *sc
     size_t xlen;
     unsigned int sigalg;

-    if (SSL_CONNECTION_IS_TLS13(sc)) {
+    if (SSL_CONNECTION_IS_VERSION13(sc)) {
         if (!ssl_print_hexbuf(bio, indent, "request_context", 1, &msg, &msglen))
             return 0;
         if (!ssl_print_extensions(bio, indent, 1,
@@ -1502,7 +1514,7 @@ static int ssl_print_cert_request(BIO *bio, int indent, const SSL_CONNECTION *sc
             return 0;
         msg++;
         BIO_indent(bio, indent, 80);
-        BIO_printf(bio, "certificate_types (len=%d)\n", (int)xlen);
+        BIO_printf(bio, "certificate_types (len=%zu)\n", xlen);
         if (!ssl_trace_list(bio, indent + 2, msg, xlen, 1, ssl_ctype_tbl))
             return 0;
         msg += xlen;
@@ -1517,7 +1529,7 @@ static int ssl_print_cert_request(BIO *bio, int indent, const SSL_CONNECTION *sc
         msg += 2;
         msglen -= xlen + 2;
         BIO_indent(bio, indent, 80);
-        BIO_printf(bio, "signature_algorithms (len=%d)\n", (int)xlen);
+        BIO_printf(bio, "signature_algorithms (len=%zu)\n", xlen);
         while (xlen > 0) {
             BIO_indent(bio, indent + 2, 80);
             sigalg = (msg[0] << 8) | msg[1];
@@ -1537,7 +1549,7 @@ static int ssl_print_cert_request(BIO *bio, int indent, const SSL_CONNECTION *sc
         return 0;
     msg += 2;
     msglen -= 2 + xlen;
-    BIO_printf(bio, "certificate_authorities (len=%d)\n", (int)xlen);
+    BIO_printf(bio, "certificate_authorities (len=%zu)\n", xlen);
     while (xlen > 0) {
         size_t dlen;
         X509_NAME *nm;
@@ -1549,9 +1561,9 @@ static int ssl_print_cert_request(BIO *bio, int indent, const SSL_CONNECTION *sc
             return 0;
         msg += 2;
         BIO_indent(bio, indent + 2, 80);
-        BIO_printf(bio, "DistinguishedName (len=%d): ", (int)dlen);
+        BIO_printf(bio, "DistinguishedName (len=%zu): ", dlen);
         p = msg;
-        nm = d2i_X509_NAME(NULL, &p, dlen);
+        nm = d2i_X509_NAME(NULL, &p, (long)dlen);
         if (!nm) {
             BIO_puts(bio, "<UNPARSABLE DN>\n");
         } else {
@@ -1562,7 +1574,7 @@ static int ssl_print_cert_request(BIO *bio, int indent, const SSL_CONNECTION *sc
         xlen -= dlen + 2;
         msg += dlen;
     }
-    if (SSL_CONNECTION_IS_TLS13(sc)) {
+    if (SSL_CONNECTION_IS_VERSION13(sc)) {
         if (!ssl_print_hexbuf(bio, indent, "request_extensions", 2,
                 &msg, &msglen))
             return 0;
@@ -1590,7 +1602,7 @@ static int ssl_print_ticket(BIO *bio, int indent, const SSL_CONNECTION *sc,
     msg += 4;
     BIO_indent(bio, indent + 2, 80);
     BIO_printf(bio, "ticket_lifetime_hint=%u\n", tick_life);
-    if (SSL_CONNECTION_IS_TLS13(sc)) {
+    if (SSL_CONNECTION_IS_VERSION13(sc)) {
         unsigned int ticket_age_add;

         if (msglen < 4)
@@ -1609,7 +1621,7 @@ static int ssl_print_ticket(BIO *bio, int indent, const SSL_CONNECTION *sc,
     }
     if (!ssl_print_hexbuf(bio, indent + 2, "ticket", 2, &msg, &msglen))
         return 0;
-    if (SSL_CONNECTION_IS_TLS13(sc)
+    if (SSL_CONNECTION_IS_VERSION13(sc)
         && !ssl_print_extensions(bio, indent + 2, 0,
             SSL3_MT_NEWSESSION_TICKET, &msg, &msglen))
         return 0;
@@ -1630,8 +1642,8 @@ static int ssl_print_handshake(BIO *bio, const SSL_CONNECTION *sc, int server,
     htype = msg[0];
     hlen = (msg[1] << 16) | (msg[2] << 8) | msg[3];
     BIO_indent(bio, indent, 80);
-    BIO_printf(bio, "%s, Length=%d\n",
-        ssl_trace_str(htype, ssl_handshake_tbl), (int)hlen);
+    BIO_printf(bio, "%s, Length=%zu\n",
+        ssl_trace_str(htype, ssl_handshake_tbl), hlen);
     msg += 4;
     msglen -= 4;
     if (SSL_CONNECTION_IS_DTLS(sc)) {
@@ -1728,7 +1740,7 @@ static int ssl_print_handshake(BIO *bio, const SSL_CONNECTION *sc, int server,
     default:
         BIO_indent(bio, indent + 2, 80);
         BIO_puts(bio, "Unsupported, hex dump follows:\n");
-        BIO_dump_indent(bio, (const char *)msg, msglen, indent + 4);
+        BIO_dump_indent(bio, (const char *)msg, (int)msglen, indent + 4);
     }
     return 1;
 }
diff --git a/deps/openssl/openssl/ssl/tls13_enc.c b/deps/openssl/openssl/ssl/tls13_enc.c
index de201d92430..4624e9ca052 100644
--- a/deps/openssl/openssl/ssl/tls13_enc.c
+++ b/deps/openssl/openssl/ssl/tls13_enc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -19,27 +19,31 @@

 #define TLS13_MAX_LABEL_LEN 249

+/* ASCII: "dtls13", in hex for EBCDIC compatibility */
+static const unsigned char label_prefix_dtls13[] = "\x64\x74\x6C\x73\x31\x33";
 /* ASCII: "tls13 ", in hex for EBCDIC compatibility */
-static const unsigned char label_prefix[] = "\x74\x6C\x73\x31\x33\x20";
+static const unsigned char label_prefix_tls13[] = "\x74\x6C\x73\x31\x33\x20";

 /*
- * Given a |secret|; a |label| of length |labellen|; and |data| of length
- * |datalen| (e.g. typically a hash of the handshake messages), derive a new
- * secret |outlen| bytes long and store it in the location pointed to be |out|.
+ * Given a |secret|; a |label_prefix| of length |label_prefix_len|; a |label|
+ * of length |labellen|; and |data| of length |datalen| (e.g. typically a hash
+ * of the handshake messages), derive a new secret |outlen| bytes long and
+ * store it in the location pointed to be |out|.
  * The |data| value may be zero length. Any errors will be treated as fatal if
  * |fatal| is set. Returns 1 on success  0 on failure.
  * If |raise_error| is set, ERR_raise is called on failure.
  */
-int tls13_hkdf_expand_ex(OSSL_LIB_CTX *libctx, const char *propq,
+static int hkdf_expand(OSSL_LIB_CTX *libctx, const char *propq,
     const EVP_MD *md,
     const unsigned char *secret,
+    const unsigned char *label_prefix, size_t label_prefix_len,
     const unsigned char *label, size_t labellen,
     const unsigned char *data, size_t datalen,
     unsigned char *out, size_t outlen, int raise_error)
 {
     EVP_KDF *kdf = EVP_KDF_fetch(libctx, OSSL_KDF_NAME_TLS1_3_KDF, propq);
     EVP_KDF_CTX *kctx;
-    OSSL_PARAM params[7], *p = params;
+    OSSL_PARAM params[8], *p = params;
     int mode = EVP_PKEY_HKDEF_MODE_EXPAND_ONLY;
     const char *mdname = EVP_MD_get0_name(md);
     int ret;
@@ -77,13 +81,17 @@ int tls13_hkdf_expand_ex(OSSL_LIB_CTX *libctx, const char *propq,
         (unsigned char *)secret, hashlen);
     *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_PREFIX,
         (unsigned char *)label_prefix,
-        sizeof(label_prefix) - 1);
+        label_prefix_len);
     *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_LABEL,
         (unsigned char *)label, labellen);
     if (data != NULL)
         *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_DATA,
             (unsigned char *)data,
             datalen);
+    if (propq != NULL)
+        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_PROPERTIES,
+            (char *)propq, 0);
+
     *p++ = OSSL_PARAM_construct_end();

     ret = EVP_KDF_derive(kctx, out, outlen, params) <= 0;
@@ -97,6 +105,20 @@ int tls13_hkdf_expand_ex(OSSL_LIB_CTX *libctx, const char *propq,
     return ret == 0;
 }

+int tls13_hkdf_expand_ex(OSSL_LIB_CTX *libctx, const char *propq,
+    const EVP_MD *md,
+    const unsigned char *secret,
+    const unsigned char *label, size_t labellen,
+    const unsigned char *data, size_t datalen,
+    unsigned char *out, size_t outlen, int raise_error)
+{
+    /* This function only supports TLSv1.3 and not DTLSv1.3 */
+    return hkdf_expand(libctx, propq, md, secret, label_prefix_tls13,
+        sizeof(label_prefix_tls13) - 1,
+        label, labellen, data, datalen, out, outlen,
+        raise_error);
+}
+
 int tls13_hkdf_expand(SSL_CONNECTION *s, const EVP_MD *md,
     const unsigned char *secret,
     const unsigned char *label, size_t labellen,
@@ -105,10 +127,15 @@ int tls13_hkdf_expand(SSL_CONNECTION *s, const EVP_MD *md,
 {
     int ret;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
-
-    ret = tls13_hkdf_expand_ex(sctx->libctx, sctx->propq, md,
-        secret, label, labellen, data, datalen,
-        out, outlen, !fatal);
+    const int isdtls = SSL_CONNECTION_IS_DTLS(s);
+    const unsigned char *label_prefix = isdtls ? label_prefix_dtls13
+                                               : label_prefix_tls13;
+    const size_t label_prefix_len = isdtls ? sizeof(label_prefix_dtls13) - 1
+                                           : sizeof(label_prefix_tls13) - 1;
+
+    ret = hkdf_expand(sctx->libctx, sctx->propq, md, secret, label_prefix,
+        label_prefix_len, label, labellen, data,
+        datalen, out, outlen, !fatal);
     if (ret == 0 && fatal)
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);

@@ -156,6 +183,21 @@ int tls13_derive_finishedkey(SSL_CONNECTION *s, const EVP_MD *md,
         sizeof(finishedlabel) - 1, NULL, 0, fin, finlen, 1);
 }

+/*
+ * Given a |secret| generate a |snkey| of length |snkeylen| bytes. Returns 1 on
+ * success  0 on failure. (rfc9147 section 4.2.3)
+ */
+static int dtls13_derive_snkey(SSL_CONNECTION *s, const EVP_MD *md,
+    const unsigned char *secret,
+    unsigned char *snkey, size_t keylen)
+{
+    /* ASCII: "sn", in hex for EBCDIC compatibility */
+    static const unsigned char sn_str[] = "\x73\x6E";
+
+    return tls13_hkdf_expand(s, md, secret, sn_str, sizeof(sn_str) - 1,
+        NULL, 0, snkey, keylen, 1);
+}
+
 /*
  * Given the previous secret |prevsecret| and a new input secret |insecret| of
  * length |insecretlen|, generate a new secret and store it in the location
@@ -178,6 +220,7 @@ int tls13_generate_secret(SSL_CONNECTION *s, const EVP_MD *md,
     /* ASCII: "derived", in hex for EBCDIC compatibility */
     static const char derived_secret_label[] = "\x64\x65\x72\x69\x76\x65\x64";
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
+    int isdtls = SSL_CONNECTION_IS_DTLS(s);

     kdf = EVP_KDF_fetch(sctx->libctx, OSSL_KDF_NAME_TLS1_3_KDF, sctx->propq);
     kctx = EVP_KDF_CTX_new(kdf);
@@ -206,9 +249,15 @@ int tls13_generate_secret(SSL_CONNECTION *s, const EVP_MD *md,
     if (prevsecret != NULL)
         *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_SALT,
             (unsigned char *)prevsecret, mdlen);
-    *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_PREFIX,
-        (unsigned char *)label_prefix,
-        sizeof(label_prefix) - 1);
+    if (isdtls)
+        *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_PREFIX,
+            (unsigned char *)label_prefix_dtls13,
+            sizeof(label_prefix_dtls13) - 1);
+    else
+        *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_PREFIX,
+            (unsigned char *)label_prefix_tls13,
+            sizeof(label_prefix_tls13) - 1);
+
     *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_LABEL,
         (unsigned char *)derived_secret_label,
         sizeof(derived_secret_label) - 1);
@@ -276,8 +325,10 @@ size_t tls13_final_finish_mac(SSL_CONNECTION *s, const char *str, size_t slen,
     OSSL_PARAM params[2], *p = params;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);

-    if (md == NULL)
+    if (md == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return 0;
+    }

     /* Safe to cast away const here since we're not "getting" any data */
     if (sctx->propq != NULL)
@@ -323,13 +374,14 @@ err:
 int tls13_setup_key_block(SSL_CONNECTION *s)
 {
     const EVP_CIPHER *c;
+    const EVP_CIPHER *snc = NULL, **p_snc = SSL_CONNECTION_IS_DTLS(s) ? &snc : NULL;
     const EVP_MD *hash;
     int mac_type = NID_undef;
     size_t mac_secret_size = 0;

     s->session->cipher = s->s3.tmp.new_cipher;
-    if (!ssl_cipher_get_evp(SSL_CONNECTION_GET_CTX(s), s->session, &c, &hash,
-            &mac_type, &mac_secret_size, NULL, 0)) {
+    if (!ssl_cipher_get_evp(SSL_CONNECTION_GET_CTX(s), s->session, p_snc, &c,
+            &hash, &mac_type, &mac_secret_size, NULL, 0)) {
         /* Error is already recorded */
         SSLfatal_alert(s, SSL_AD_INTERNAL_ERROR);
         return 0;
@@ -337,6 +389,8 @@ int tls13_setup_key_block(SSL_CONNECTION *s)

     ssl_evp_cipher_free(s->s3.tmp.new_sym_enc);
     s->s3.tmp.new_sym_enc = c;
+    ssl_evp_cipher_free(s->s3.tmp.new_sym_enc_sn);
+    s->s3.tmp.new_sym_enc_sn = snc;
     ssl_evp_md_free(s->s3.tmp.new_hash);
     s->s3.tmp.new_hash = hash;
     s->s3.tmp.new_mac_pkey_type = mac_type;
@@ -353,6 +407,7 @@ static int derive_secret_key_and_iv(SSL_CONNECTION *s, const EVP_MD *md,
     const unsigned char *hash,
     const unsigned char *label,
     size_t labellen, unsigned char *secret,
+    unsigned char *snkey,
     unsigned char *key, size_t *keylen,
     unsigned char **iv, size_t *ivlen,
     size_t *taglen)
@@ -438,7 +493,9 @@ static int derive_secret_key_and_iv(SSL_CONNECTION *s, const EVP_MD *md,
     }

     if (!tls13_derive_key(s, md, secret, key, *keylen)
-        || !tls13_derive_iv(s, md, secret, *iv, *ivlen)) {
+        || !tls13_derive_iv(s, md, secret, *iv, *ivlen)
+        || (SSL_CONNECTION_IS_DTLS(s)
+            && !dtls13_derive_snkey(s, md, secret, snkey, *keylen))) {
         /* SSLfatal() already called */
         return 0;
     }
@@ -492,6 +549,7 @@ int tls13_change_cipher_state(SSL_CONNECTION *s, int which)
     unsigned char iv_intern[EVP_MAX_IV_LENGTH];
     unsigned char *iv = iv_intern;
     unsigned char key[EVP_MAX_KEY_LENGTH];
+    unsigned char snkey[EVP_MAX_KEY_LENGTH];
     unsigned char secret[EVP_MAX_MD_SIZE];
     unsigned char hashval[EVP_MAX_MD_SIZE];
     unsigned char *hash = hashval;
@@ -503,7 +561,7 @@ int tls13_change_cipher_state(SSL_CONNECTION *s, int which)
     size_t labellen, hashlen = 0;
     int ret = 0;
     const EVP_MD *md = NULL, *mac_md = NULL;
-    const EVP_CIPHER *cipher = NULL;
+    const EVP_CIPHER *cipher = NULL, *sncipher = NULL;
     int mac_pkey_type = NID_undef;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
     size_t keylen, ivlen = EVP_MAX_IV_LENGTH, taglen;
@@ -525,26 +583,39 @@ int tls13_change_cipher_state(SSL_CONNECTION *s, int which)
             labellen = sizeof(client_early_traffic) - 1;
             log_label = CLIENT_EARLY_LABEL;

-            handlen = BIO_get_mem_data(s->s3.handshake_buffer, &hdata);
-            if (handlen <= 0) {
-                SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_HANDSHAKE_LENGTH);
-                goto err;
+#ifndef OPENSSL_NO_ECH
+            /* if ECH worked then use the innerch and not the h/s buffer here */
+            if (((which & SSL3_CC_SERVER) && s->ext.ech.success == 1)
+                || ((which & SSL3_CC_CLIENT) && s->ext.ech.attempted == 1)) {
+                if (s->ext.ech.innerch == NULL) {
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                    goto err;
+                }
+                handlen = (long)s->ext.ech.innerch_len;
+                hdata = s->ext.ech.innerch;
+            } else
+#endif
+            {
+                handlen = BIO_get_mem_data(s->s3.handshake_buffer, &hdata);
+                if (handlen <= 0) {
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR,
+                        SSL_R_BAD_HANDSHAKE_LENGTH);
+                    goto err;
+                }
             }

+            /*
+             * 0-RTT keys off the frozen slot-0 PSK (candidate_at(0)), which
+             * may be the external psksession rather than s->session.
+             */
             if (s->early_data_state == SSL_EARLY_DATA_CONNECTING
-                && s->max_early_data > 0
-                && s->session->ext.max_early_data == 0) {
-                /*
-                 * If we are attempting to send early data, and we've decided to
-                 * actually do it but max_early_data in s->session is 0 then we
-                 * must be using an external PSK.
-                 */
-                if (!ossl_assert(s->psksession != NULL
-                        && s->max_early_data == s->psksession->ext.max_early_data)) {
+                && s->ext.early_data_session != NULL) {
+                if (!ossl_assert(s->max_early_data
+                        == s->ext.early_data_session->ext.max_early_data)) {
                     SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
                     goto err;
                 }
-                sslcipher = SSL_SESSION_get0_cipher(s->psksession);
+                sslcipher = SSL_SESSION_get0_cipher(s->ext.early_data_session);
             }
             if (sslcipher == NULL) {
                 SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_PSK);
@@ -555,7 +626,9 @@ int tls13_change_cipher_state(SSL_CONNECTION *s, int which)
              * This ups the ref count on cipher so we better make sure we free
              * it again
              */
-            if (!ssl_cipher_get_evp_cipher(sctx, sslcipher, &cipher)) {
+            if (!ssl_cipher_get_evp_cipher(sctx, sslcipher, &cipher)
+                || (SSL_CONNECTION_IS_DTLS(s)
+                    && !ssl_cipher_get_evp_cipher_sn(sctx, sslcipher, &sncipher))) {
                 /* Error is already recorded */
                 SSLfatal_alert(s, SSL_AD_INTERNAL_ERROR);
                 goto err;
@@ -580,9 +653,28 @@ int tls13_change_cipher_state(SSL_CONNECTION *s, int which)
             }

             md = ssl_md(sctx, sslcipher->algorithm2);
-            if (md == NULL || !EVP_DigestInit_ex(mdctx, md, NULL)
-                || !EVP_DigestUpdate(mdctx, hdata, handlen)
-                || !EVP_DigestFinal_ex(mdctx, hashval, &hashlenui)) {
+            if (md == NULL || !EVP_DigestInit_ex(mdctx, md, NULL)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                EVP_MD_CTX_free(mdctx);
+                goto err;
+            }
+
+            if (SSL_CONNECTION_IS_DTLS(s)) {
+                if (!dtls13_transcript_hash_update(mdctx, hdata,
+                        (size_t)handlen)) {
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                    EVP_MD_CTX_free(mdctx);
+                    goto err;
+                }
+            } else {
+                if (!EVP_DigestUpdate(mdctx, hdata, handlen)) {
+                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                    EVP_MD_CTX_free(mdctx);
+                    goto err;
+                }
+            }
+
+            if (!EVP_DigestFinal_ex(mdctx, hashval, &hashlenui)) {
                 SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
                 EVP_MD_CTX_free(mdctx);
                 goto err;
@@ -666,6 +758,10 @@ int tls13_change_cipher_state(SSL_CONNECTION *s, int which)
         cipher = s->s3.tmp.new_sym_enc;
         mac_md = s->s3.tmp.new_hash;
         mac_pkey_type = s->s3.tmp.new_mac_pkey_type;
+
+        if (SSL_CONNECTION_IS_DTLS(s)) {
+            sncipher = s->s3.tmp.new_sym_enc_sn;
+        }
         if (!ssl3_digest_cached_records(s, 1)
             || !ssl_handshake_hash(s, hashval, sizeof(hashval), &hashlen)) {
             /* SSLfatal() already called */;
@@ -693,8 +789,8 @@ int tls13_change_cipher_state(SSL_CONNECTION *s, int which)
         goto err;

     if (!derive_secret_key_and_iv(s, md, cipher, mac_pkey_type, mac_md,
-            insecret, hash, label, labellen, secret, key,
-            &keylen, &iv, &ivlen, &taglen)) {
+            insecret, hash, label, labellen, secret,
+            snkey, key, &keylen, &iv, &ivlen, &taglen)) {
         /* SSLfatal() already called */
         goto err;
     }
@@ -744,10 +840,39 @@ int tls13_change_cipher_state(SSL_CONNECTION *s, int which)
                   ? OSSL_RECORD_PROTECTION_LEVEL_HANDSHAKE
                   : OSSL_RECORD_PROTECTION_LEVEL_APPLICATION);

-    if (!ssl_set_new_record_layer(s, s->version,
-            direction,
-            level, secret, hashlen, key, keylen, iv,
-            ivlen, NULL, 0, cipher, taglen,
+    if (SSL_CONNECTION_IS_DTLS(s)) {
+        /*
+         * For DTLS1.3 The Compressed Certificate should still be sent in Epoch 2
+         * not Epoch 3.
+         */
+        if (s->version != DTLS1_3_VERSION || (which & SSL3_CC_COMP_CERT) == 0) {
+            if (!dtls1_increment_epoch(s, which)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+        }
+
+        if (level == OSSL_RECORD_PROTECTION_LEVEL_HANDSHAKE && dtls1_get_epoch(s, which) == 1) {
+            /*
+             * We must manually increment epoch because
+             * client early traffic was not sent/recv
+             */
+            if (!dtls1_increment_epoch(s, which)) {
+                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+                goto err;
+            }
+        }
+
+        /* We have moved to the next flight lets clear out old messages */
+        if (direction == OSSL_RECORD_DIRECTION_READ)
+            dtls1_clear_received_buffer(s);
+
+        dtls1_clear_sent_buffer(s, 1);
+    }
+
+    if (!ssl_set_new_record_layer(s, s->version, direction, level, secret,
+            hashlen, snkey, key, keylen, iv, ivlen,
+            NULL, 0, sncipher, cipher, taglen,
             mac_pkey_type, mac_md, NULL, md)) {
         /* SSLfatal already called */
         goto err;
@@ -760,8 +885,10 @@ err:
         if ((EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) == 0)
             ssl_evp_md_free(mac_md);
         ssl_evp_cipher_free(cipher);
+        ssl_evp_cipher_free(sncipher);
     }
     OPENSSL_cleanse(key, sizeof(key));
+    OPENSSL_cleanse(snkey, sizeof(snkey));
     OPENSSL_cleanse(secret, sizeof(secret));
     if (iv != iv_intern)
         OPENSSL_free(iv);
@@ -775,6 +902,8 @@ int tls13_update_key(SSL_CONNECTION *s, int sending)
     const EVP_MD *md = ssl_handshake_md(s);
     size_t hashlen;
     unsigned char key[EVP_MAX_KEY_LENGTH];
+    unsigned char snkey[EVP_MAX_KEY_LENGTH];
+    const EVP_CIPHER *snenc = NULL;
     unsigned char *insecret;
     unsigned char secret[EVP_MAX_MD_SIZE];
     char *log_label;
@@ -782,6 +911,7 @@ int tls13_update_key(SSL_CONNECTION *s, int sending)
     int ret = 0, l;
     int direction = sending ? OSSL_RECORD_DIRECTION_WRITE
                             : OSSL_RECORD_DIRECTION_READ;
+    int which = sending ? SSL3_CC_WRITE : SSL3_CC_READ;
     unsigned char iv_intern[EVP_MAX_IV_LENGTH];
     unsigned char *iv = iv_intern;

@@ -801,20 +931,29 @@ int tls13_update_key(SSL_CONNECTION *s, int sending)
             s->s3.tmp.new_mac_pkey_type, s->s3.tmp.new_hash,
             insecret, NULL,
             application_traffic,
-            sizeof(application_traffic) - 1, secret, key,
-            &keylen, &iv, &ivlen, &taglen)) {
+            sizeof(application_traffic) - 1, secret, snkey,
+            key, &keylen, &iv, &ivlen, &taglen)) {
         /* SSLfatal() already called */
         goto err;
     }

     memcpy(insecret, secret, hashlen);

-    if (!ssl_set_new_record_layer(s, s->version,
-            direction,
+    if (SSL_CONNECTION_IS_DTLS(s)) {
+        if (!dtls1_increment_epoch(s, which)) {
+            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+            goto err;
+        }
+        snenc = s->s3.tmp.new_sym_enc_sn;
+    }
+
+    if (!ssl_set_new_record_layer(s, s->version, direction,
             OSSL_RECORD_PROTECTION_LEVEL_APPLICATION,
-            insecret, hashlen, key, keylen, iv, ivlen, NULL, 0,
-            s->s3.tmp.new_sym_enc, taglen, NID_undef, NULL,
-            NULL, md)) {
+            insecret, hashlen, snkey, key, keylen,
+            iv, ivlen, NULL, 0,
+            snenc,
+            s->s3.tmp.new_sym_enc,
+            taglen, NID_undef, NULL, NULL, md)) {
         /* SSLfatal already called */
         goto err;
     }
@@ -828,6 +967,7 @@ int tls13_update_key(SSL_CONNECTION *s, int sending)
     ret = 1;
 err:
     OPENSSL_cleanse(key, sizeof(key));
+    OPENSSL_cleanse(snkey, sizeof(snkey));
     OPENSSL_cleanse(secret, sizeof(secret));
     if (iv != iv_intern)
         OPENSSL_free(iv);
@@ -902,9 +1042,8 @@ int tls13_export_keying_material_early(SSL_CONNECTION *s,
     if (ctx == NULL || !ossl_statem_export_early_allowed(s))
         goto err;

-    if (!s->server && s->max_early_data > 0
-        && s->session->ext.max_early_data == 0)
-        sslcipher = SSL_SESSION_get0_cipher(s->psksession);
+    if (!s->server && s->ext.early_data_session != NULL)
+        sslcipher = SSL_SESSION_get0_cipher(s->ext.early_data_session);
     else
         sslcipher = SSL_SESSION_get0_cipher(s->session);

diff --git a/deps/openssl/openssl/ssl/tls_depr.c b/deps/openssl/openssl/ssl/tls_depr.c
index 72cc528ec85..277df205a29 100644
--- a/deps/openssl/openssl/ssl/tls_depr.c
+++ b/deps/openssl/openssl/ssl/tls_depr.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -7,93 +7,12 @@
  * https://www.openssl.org/source/license.html
  */

-/* We need to use some engine and HMAC deprecated APIs */
+/* We need to use some HMAC deprecated APIs */
 #define OPENSSL_SUPPRESS_DEPRECATED

-#include <openssl/engine.h>
 #include "ssl_local.h"
 #include "internal/ssl_unwrap.h"

-/*
- * Engine APIs are only used to support applications that still use ENGINEs.
- * Once ENGINE is removed completely, all of this code can also be removed.
- */
-
-#ifndef OPENSSL_NO_ENGINE
-void tls_engine_finish(ENGINE *e)
-{
-    ENGINE_finish(e);
-}
-#endif
-
-const EVP_CIPHER *tls_get_cipher_from_engine(int nid)
-{
-    const EVP_CIPHER *ret = NULL;
-#ifndef OPENSSL_NO_ENGINE
-    ENGINE *eng;
-
-    /*
-     * If there is an Engine available for this cipher we use the "implicit"
-     * form to ensure we use that engine later.
-     */
-    eng = ENGINE_get_cipher_engine(nid);
-    if (eng != NULL) {
-        ret = ENGINE_get_cipher(eng, nid);
-        ENGINE_finish(eng);
-    }
-#endif
-    return ret;
-}
-
-const EVP_MD *tls_get_digest_from_engine(int nid)
-{
-    const EVP_MD *ret = NULL;
-#ifndef OPENSSL_NO_ENGINE
-    ENGINE *eng;
-
-    /*
-     * If there is an Engine available for this digest we use the "implicit"
-     * form to ensure we use that engine later.
-     */
-    eng = ENGINE_get_digest_engine(nid);
-    if (eng != NULL) {
-        ret = ENGINE_get_digest(eng, nid);
-        ENGINE_finish(eng);
-    }
-#endif
-    return ret;
-}
-
-#ifndef OPENSSL_NO_ENGINE
-int tls_engine_load_ssl_client_cert(SSL_CONNECTION *s, X509 **px509,
-    EVP_PKEY **ppkey)
-{
-    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
-
-    return ENGINE_load_ssl_client_cert(SSL_CONNECTION_GET_CTX(s)->client_cert_engine,
-        ssl,
-        SSL_get_client_CA_list(ssl),
-        px509, ppkey, NULL, NULL, NULL);
-}
-#endif
-
-#ifndef OPENSSL_NO_ENGINE
-int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e)
-{
-    if (!ENGINE_init(e)) {
-        ERR_raise(ERR_LIB_SSL, ERR_R_ENGINE_LIB);
-        return 0;
-    }
-    if (!ENGINE_get_ssl_client_cert_function(e)) {
-        ERR_raise(ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD);
-        ENGINE_finish(e);
-        return 0;
-    }
-    ctx->client_cert_engine = e;
-    return 1;
-}
-#endif
-
 /*
  * The HMAC APIs below are only used to support the deprecated public API
  * macro SSL_CTX_set_tlsext_ticket_key_cb(). The application supplied callback
@@ -103,23 +22,20 @@ int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e)
  * be removed.
  */
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-int ssl_hmac_old_new(SSL_HMAC *ret)
+SSL_HMAC *ssl_hmac_old_construct(SSL_HMAC *ret)
 {
     ret->old_ctx = HMAC_CTX_new();
-    if (ret->old_ctx == NULL)
-        return 0;
-
-    return 1;
+    return ret->old_ctx != NULL ? ret : NULL;
 }

-void ssl_hmac_old_free(SSL_HMAC *ctx)
+void ssl_hmac_old_destruct(SSL_HMAC *ctx)
 {
     HMAC_CTX_free(ctx->old_ctx);
 }

 int ssl_hmac_old_init(SSL_HMAC *ctx, void *key, size_t len, char *md)
 {
-    return HMAC_Init_ex(ctx->old_ctx, key, len, EVP_get_digestbyname(md), NULL);
+    return HMAC_Init_ex(ctx->old_ctx, key, (int)len, EVP_get_digestbyname(md), NULL);
 }

 int ssl_hmac_old_update(SSL_HMAC *ctx, const unsigned char *data, size_t len)
diff --git a/deps/openssl/openssl/ssl/tls_srp.c b/deps/openssl/openssl/ssl/tls_srp.c
index 51f0950a16f..d493916a2d0 100644
--- a/deps/openssl/openssl/ssl/tls_srp.c
+++ b/deps/openssl/openssl/ssl/tls_srp.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2004, EdelKey Project. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -193,12 +193,15 @@ int ssl_srp_server_param_with_username_intern(SSL_CONNECTION *s, int *ad)
     OPENSSL_cleanse(b, sizeof(b));

     /* Calculate:  B = (kv + g^b) % N  */
+    s->srp_ctx.B = SRP_Calc_B_ex(s->srp_ctx.b, s->srp_ctx.N, s->srp_ctx.g,
+        s->srp_ctx.v, sctx->libctx, sctx->propq);
+    if (s->srp_ctx.B == NULL) {
+        BN_clear_free(s->srp_ctx.b);
+        s->srp_ctx.b = NULL;
+        return SSL3_AL_FATAL;
+    }

-    return ((s->srp_ctx.B = SRP_Calc_B_ex(s->srp_ctx.b, s->srp_ctx.N, s->srp_ctx.g,
-                 s->srp_ctx.v, sctx->libctx, sctx->propq))
-               != NULL)
-        ? SSL_ERROR_NONE
-        : SSL3_AL_FATAL;
+    return SSL_ERROR_NONE;
 }

 int SSL_srp_server_param_with_username(SSL *s, int *ad)
@@ -251,7 +254,7 @@ int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g,

     if (N != NULL) {
         if (sc->srp_ctx.N != NULL) {
-            if (!BN_copy(sc->srp_ctx.N, N)) {
+            if (BN_copy(sc->srp_ctx.N, N) == NULL) {
                 BN_free(sc->srp_ctx.N);
                 sc->srp_ctx.N = NULL;
             }
@@ -260,7 +263,7 @@ int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g,
     }
     if (g != NULL) {
         if (sc->srp_ctx.g != NULL) {
-            if (!BN_copy(sc->srp_ctx.g, g)) {
+            if (BN_copy(sc->srp_ctx.g, g) == NULL) {
                 BN_free(sc->srp_ctx.g);
                 sc->srp_ctx.g = NULL;
             }
@@ -269,7 +272,7 @@ int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g,
     }
     if (sa != NULL) {
         if (sc->srp_ctx.s != NULL) {
-            if (!BN_copy(sc->srp_ctx.s, sa)) {
+            if (BN_copy(sc->srp_ctx.s, sa) == NULL) {
                 BN_free(sc->srp_ctx.s);
                 sc->srp_ctx.s = NULL;
             }
@@ -278,7 +281,7 @@ int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g,
     }
     if (v != NULL) {
         if (sc->srp_ctx.v != NULL) {
-            if (!BN_copy(sc->srp_ctx.v, v)) {
+            if (BN_copy(sc->srp_ctx.v, v) == NULL) {
                 BN_free(sc->srp_ctx.v);
                 sc->srp_ctx.v = NULL;
             }
diff --git a/deps/openssl/openssl/tools/build.info b/deps/openssl/openssl/tools/build.info
deleted file mode 100644
index 059e5823457..00000000000
--- a/deps/openssl/openssl/tools/build.info
+++ /dev/null
@@ -1,7 +0,0 @@
-{- our $c_rehash_name =
-       $config{target} =~ /^(VC|vms)-/ ? "c_rehash.pl" : "c_rehash";
-   "" -}
-IF[{- !$disabled{apps} -}]
-  SCRIPTS={- $c_rehash_name -}
-  SOURCE[{- $c_rehash_name -}]=c_rehash.in
-ENDIF
diff --git a/deps/openssl/openssl/tools/c_rehash.in b/deps/openssl/openssl/tools/c_rehash.in
deleted file mode 100644
index bb68c44692b..00000000000
--- a/deps/openssl/openssl/tools/c_rehash.in
+++ /dev/null
@@ -1,252 +0,0 @@
-#!{- $config{HASHBANGPERL} -}
-{- use OpenSSL::Util; -}
-# {- join("\n# ", @autowarntext) -}
-# Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
-#
-# Licensed under the Apache License 2.0 (the "License").  You may not use
-# this file except in compliance with the License.  You can obtain a copy
-# in the file LICENSE in the source distribution or at
-# https://www.openssl.org/source/license.html
-
-# Perl c_rehash script, scan all files in a directory
-# and add symbolic links to their hash values.
-
-my $dir = {- quotify1($config{openssldir}) -};
-my $prefix = {- quotify1($config{prefix}) -};
-
-my $errorcount = 0;
-my $openssl = $ENV{OPENSSL} || "openssl";
-my $pwd;
-my $x509hash = "-subject_hash";
-my $crlhash = "-hash";
-my $verbose = 0;
-my $symlink_exists=eval {symlink("",""); 1};
-my $removelinks = 1;
-
-##  Parse flags.
-while ( $ARGV[0] =~ /^-/ ) {
-    my $flag = shift @ARGV;
-    last if ( $flag eq '--');
-    if ( $flag eq '-old') {
-        $x509hash = "-subject_hash_old";
-        $crlhash = "-hash_old";
-    } elsif ( $flag eq '-h' || $flag eq '-help' ) {
-        help();
-    } elsif ( $flag eq '-n' ) {
-        $removelinks = 0;
-    } elsif ( $flag eq '-v' ) {
-        $verbose++;
-    }
-    else {
-        print STDERR "Usage error; try -h.\n";
-        exit 1;
-    }
-}
-
-sub help {
-    print "Usage: c_rehash [-old] [-h] [-help] [-v] [dirs...]\n";
-    print "   -old use old-style digest\n";
-    print "   -h or -help print this help text\n";
-    print "   -v print files removed and linked\n";
-    exit 0;
-}
-
-eval "require Cwd";
-if (defined(&Cwd::getcwd)) {
-    $pwd=Cwd::getcwd();
-} else {
-    $pwd=`pwd`;
-    chomp($pwd);
-}
-
-# DOS/Win32 or Unix delimiter?  Prefix our installdir, then search.
-my $path_delim = ($pwd =~ /^[a-z]\:/i) ? ';' : ':';
-$ENV{PATH} = "$prefix/bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : "");
-
-if (!(-f $openssl && -x $openssl)) {
-    my $found = 0;
-    foreach (split /$path_delim/, $ENV{PATH}) {
-        if (-f "$_/$openssl" && -x "$_/$openssl") {
-            $found = 1;
-            $openssl = "$_/$openssl";
-            last;
-        }
-    }
-    if ($found == 0) {
-        print STDERR "c_rehash: rehashing skipped ('openssl' program not available)\n";
-        exit 0;
-    }
-}
-
-if (@ARGV) {
-    @dirlist = @ARGV;
-} elsif ($ENV{SSL_CERT_DIR}) {
-    @dirlist = split /$path_delim/, $ENV{SSL_CERT_DIR};
-} else {
-    $dirlist[0] = "$dir/certs";
-}
-
-if (-d $dirlist[0]) {
-    chdir $dirlist[0];
-    $openssl="$pwd/$openssl" if (!(-f $openssl && -x $openssl));
-    chdir $pwd;
-}
-
-foreach (@dirlist) {
-    if (-d $_ ) {
-        if ( -w $_) {
-            hash_dir($_);
-        } else {
-            print "Skipping $_, can't write\n";
-            $errorcount++;
-        }
-    }
-}
-exit($errorcount);
-
-sub copy_file {
-    my ($src_fname, $dst_fname) = @_;
-
-    if (open(my $in, "<", $src_fname)) {
-        if (open(my $out, ">", $dst_fname)) {
-            print $out $_ while (<$in>);
-            close $out;
-        } else {
-            warn "Cannot open $dst_fname for write, $!";
-        }
-        close $in;
-    } else {
-        warn "Cannot open $src_fname for read, $!";
-    }
-}
-
-sub hash_dir {
-    my $dir = shift;
-    my %hashlist;
-
-    print "Doing $dir\n";
-
-    if (!chdir $dir) {
-        print STDERR "WARNING: Cannot chdir to '$dir', $!\n";
-        return;
-    }
-
-    opendir(DIR, ".") || print STDERR "WARNING: Cannot opendir '.', $!\n";
-    my @flist = sort readdir(DIR);
-    closedir DIR;
-    if ( $removelinks ) {
-        # Delete any existing symbolic links
-        foreach (grep {/^[\da-f]+\.r{0,1}\d+$/} @flist) {
-            if (-l $_) {
-                print "unlink $_\n" if $verbose;
-                unlink $_ || warn "Can't unlink $_, $!\n";
-            }
-        }
-    }
-    FILE: foreach $fname (grep {/\.(pem|crt|cer|crl)$/} @flist) {
-        # Check to see if certificates and/or CRLs present.
-        my ($cert, $crl) = check_file($fname);
-        if (!$cert && !$crl) {
-            print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n";
-            next;
-        }
-        link_hash_cert($fname) if ($cert);
-        link_hash_crl($fname) if ($crl);
-    }
-
-    chdir $pwd;
-}
-
-sub check_file {
-    my ($is_cert, $is_crl) = (0,0);
-    my $fname = $_[0];
-
-    open(my $in, "<", $fname);
-    while(<$in>) {
-        if (/^-----BEGIN (.*)-----/) {
-            my $hdr = $1;
-            if ($hdr =~ /^(X509 |TRUSTED |)CERTIFICATE$/) {
-                $is_cert = 1;
-                last if ($is_crl);
-            } elsif ($hdr eq "X509 CRL") {
-                $is_crl = 1;
-                last if ($is_cert);
-            }
-        }
-    }
-    close $in;
-    return ($is_cert, $is_crl);
-}
-
-sub compute_hash {
-    my $fh;
-    if ( $^O eq "VMS" ) {
-        # VMS uses the open through shell
-        # The file names are safe there and list form is unsupported
-        if (!open($fh, "-|", join(' ', @_))) {
-            print STDERR "Cannot compute hash on '$fname'\n";
-            return;
-        }
-    } else {
-        if (!open($fh, "-|", @_)) {
-            print STDERR "Cannot compute hash on '$fname'\n";
-            return;
-        }
-        binmode($fh, ":crlf");
-    }
-    return (<$fh>, <$fh>);
-}
-
-# Link a certificate to its subject name hash value, each hash is of
-# the form <hash>.<n> where n is an integer. If the hash value already exists
-# then we need to up the value of n, unless its a duplicate in which
-# case we skip the link. We check for duplicates by comparing the
-# certificate fingerprints
-
-sub link_hash_cert {
-    link_hash($_[0], 'cert');
-}
-
-# Same as above except for a CRL. CRL links are of the form <hash>.r<n>
-
-sub link_hash_crl {
-    link_hash($_[0], 'crl');
-}
-
-sub link_hash {
-    my ($fname, $type) = @_;
-    my $is_cert = $type eq 'cert';
-
-    my ($hash, $fprint) = compute_hash($openssl,
-                                       $is_cert ? "x509" : "crl",
-                                       $is_cert ? $x509hash : $crlhash,
-                                       "-fingerprint", "-noout",
-                                       "-in", $fname);
-    chomp $hash;
-    $hash =~ s/^.*=// if !$is_cert;
-    chomp $fprint;
-    return if !$hash;
-    $fprint =~ s/^.*=//;
-    $fprint =~ tr/://d;
-    my $suffix = 0;
-    # Search for an unused hash filename
-    my $crlmark = $is_cert ? "" : "r";
-    while(exists $hashlist{"$hash.$crlmark$suffix"}) {
-        # Hash matches: if fingerprint matches its a duplicate cert
-        if ($hashlist{"$hash.$crlmark$suffix"} eq $fprint) {
-            my $what = $is_cert ? 'certificate' : 'CRL';
-            print STDERR "WARNING: Skipping duplicate $what $fname\n";
-            return;
-        }
-        $suffix++;
-    }
-    $hash .= ".$crlmark$suffix";
-    if ($symlink_exists) {
-        print "link $fname -> $hash\n" if $verbose;
-        symlink $fname, $hash || warn "Can't symlink, $!";
-    } else {
-        print "copy $fname -> $hash\n" if $verbose;
-        copy_file($fname, $hash);
-    }
-    $hashlist{$hash} = $fprint;
-}
diff --git a/deps/openssl/openssl/util/acvp-test.py b/deps/openssl/openssl/util/acvp-test.py
new file mode 100755
index 00000000000..d1e56b4a7f8
--- /dev/null
+++ b/deps/openssl/openssl/util/acvp-test.py
@@ -0,0 +1,1301 @@
+#!/usr/bin/env python3
+"""
+acvp-test.py
+
+Tests an OpenSSL binary against the NIST ACVTS demo server for a chosen algorithm.
+
+Usage:
+    python acvp-test.py --openssl /path/to/openssl --cert my.cer --key my.key \
+        --totp-seed totp.txt --algorithm ACVP-AES-CBC
+    python acvp-test.py --openssl /path/to/openssl --cert my.cer --key my.key \
+        --totp-seed totp.txt --algorithm ACVP-AES-CBC --direction encrypt --key-len 256
+    python acvp-test.py --openssl /path/to/openssl --cert my.cer --key my.key \
+        --totp-seed totp.txt --algorithm SHA2-256
+    python acvp-test.py --openssl /path/to/openssl --cert my.cer --key my.key \
+        --totp-seed totp.txt --algorithm HMAC-SHA2-256 --save-vectors
+
+Algorithms supported:
+    Symmetric : ACVP-AES-CBC, ACVP-AES-ECB, ACVP-AES-CTR
+    Digest    : SHA2-256, SHA2-384, SHA2-512, SHA3-256, SHA3-384, SHA3-512
+    MAC       : HMAC-SHA2-256, HMAC-SHA2-384, HMAC-SHA2-512
+    PQC KEM   : ML-KEM-keyGen
+    PQC Sig   : ML-DSA-keyGen, ML-DSA-sigGen, ML-DSA-sigVer
+                SLH-DSA-keyGen, SLH-DSA-sigGen, SLH-DSA-sigVer
+
+Requirements:
+    pip install requests pyotp cryptography
+
+Credentials needed (pass via command-line arguments):
+    --openssl PATH   - path to the OpenSSL binary to test
+    --cert FILE      - TLS client certificate from NIST (.cer)
+    --key FILE       - corresponding private key (.key)
+    --totp-seed FILE - file containing the Base64-encoded TOTP seed (one line)
+"""
+
+import argparse
+import base64
+import ctypes
+import glob
+import hashlib
+import json
+import os
+import platform
+import re
+import subprocess
+import sys
+import time
+
+import pyotp
+import requests
+from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
+
+DEMO_URL       = "https://demo.acvts.nist.gov/acvp/v1"
+PROD_URL       = "https://acvts.nist.gov/acvp/v1"
+BASE_URL       = DEMO_URL   # overridden to PROD_URL when --production is set
+CERT_FILE      = None       # set from --cert
+KEY_FILE       = None       # set from --key
+TOTP_SEED_FILE = None       # set from --totp-seed
+OPENSSL_BIN    = None       # set from --openssl
+
+
+# ---------------------------------------------------------------------------
+# ALGORITHM CAPABILITY BUILDERS
+# Each returns the capability dict to include in the "algorithms" list during
+# test session registration.  Signature: (directions, key_lens) -> dict
+# ---------------------------------------------------------------------------
+
+def build_aes_cbc_cap(directions, key_lens):
+    return {
+        "algorithm": "ACVP-AES-CBC",
+        "revision":  "1.0",
+        "direction": directions or ["encrypt", "decrypt"],
+        "keyLen":    key_lens   or [128, 192, 256],
+    }
+
+
+def build_aes_ecb_cap(directions, key_lens):
+    return {
+        "algorithm": "ACVP-AES-ECB",
+        "revision":  "1.0",
+        "direction": directions or ["encrypt", "decrypt"],
+        "keyLen":    key_lens   or [128, 192, 256],
+    }
+
+
+def build_sha256_cap(*_):
+    return {
+        "algorithm": "SHA2-256",
+        "revision":  "1.0",
+        "messageLength": [{"min": 0, "max": 65536, "increment": 8}],
+    }
+
+
+def build_sha384_cap(*_):
+    return {
+        "algorithm": "SHA2-384",
+        "revision":  "1.0",
+        "messageLength": [{"min": 0, "max": 65536, "increment": 8}],
+    }
+
+
+def build_sha512_cap(*_):
+    return {
+        "algorithm": "SHA2-512",
+        "revision":  "1.0",
+        "messageLength": [{"min": 0, "max": 65536, "increment": 8}],
+    }
+
+
+def build_aes_ctr_cap(directions, key_lens):
+    return {
+        "algorithm":           "ACVP-AES-CTR",
+        "revision":            "1.0",
+        "direction":           directions or ["encrypt", "decrypt"],
+        "keyLen":              key_lens   or [128, 192, 256],
+        "payloadLen":          [{"min": 8, "max": 128, "increment": 8}],
+        "incrementalCounter":  True,
+        "overflowCounter":     True,
+        "performCounterTests": False,
+    }
+
+
+def build_hmac_sha256_cap(*_):
+    return {
+        "algorithm": "HMAC-SHA2-256",
+        "revision":  "1.0",
+        "keyLen":    [{"min": 8, "max": 524288, "increment": 8}],
+        "macLen":    [{"min": 32, "max": 256,   "increment": 8}],
+    }
+
+
+def build_hmac_sha384_cap(*_):
+    return {
+        "algorithm": "HMAC-SHA2-384",
+        "revision":  "1.0",
+        "keyLen":    [{"min": 8, "max": 524288, "increment": 8}],
+        "macLen":    [{"min": 32, "max": 384,   "increment": 8}],
+    }
+
+
+def build_hmac_sha512_cap(*_):
+    return {
+        "algorithm": "HMAC-SHA2-512",
+        "revision":  "1.0",
+        "keyLen":    [{"min": 8, "max": 524288, "increment": 8}],
+        "macLen":    [{"min": 32, "max": 512,   "increment": 8}],
+    }
+
+
+def build_sha3_256_cap(*_):
+    return {
+        "algorithm": "SHA3-256",
+        "revision":  "2.0",
+        "messageLength": [{"min": 0, "max": 65536, "increment": 8}],
+    }
+
+
+def build_sha3_384_cap(*_):
+    return {
+        "algorithm": "SHA3-384",
+        "revision":  "2.0",
+        "messageLength": [{"min": 0, "max": 65536, "increment": 8}],
+    }
+
+
+def build_sha3_512_cap(*_):
+    return {
+        "algorithm": "SHA3-512",
+        "revision":  "2.0",
+        "messageLength": [{"min": 0, "max": 65536, "increment": 8}],
+    }
+
+
+# ---------------------------------------------------------------------------
+# PQC CAPABILITY BUILDERS
+# ---------------------------------------------------------------------------
+
+def build_ml_kem_keygen_cap(*_):
+    return {
+        "algorithm":     "ML-KEM",
+        "mode":          "keyGen",
+        "revision":      "FIPS203",
+        "parameterSets": ["ML-KEM-512", "ML-KEM-768", "ML-KEM-1024"],
+    }
+
+
+def build_ml_dsa_keygen_cap(*_):
+    return {
+        "algorithm":     "ML-DSA",
+        "mode":          "keyGen",
+        "revision":      "FIPS204",
+        "parameterSets": ["ML-DSA-44", "ML-DSA-65", "ML-DSA-87"],
+    }
+
+
+def build_ml_dsa_siggen_cap(*_):
+    ps  = ["ML-DSA-44", "ML-DSA-65", "ML-DSA-87"]
+    mln = [{"min": 8, "max": 65536, "increment": 8}]
+    return {
+        "algorithm":           "ML-DSA",
+        "mode":                "sigGen",
+        "revision":            "FIPS204",
+        "parameterSets":       ps,
+        "messageLength":       mln,
+        "deterministic":       [True, False],
+        "signatureInterfaces": ["1"],
+        "capabilities": [{"parameterSets": ps, "messageLength": mln, "deterministic": [True, False]}],
+    }
+
+
+def build_ml_dsa_sigver_cap(*_):
+    ps  = ["ML-DSA-44", "ML-DSA-65", "ML-DSA-87"]
+    mln = [{"min": 8, "max": 65536, "increment": 8}]
+    return {
+        "algorithm":           "ML-DSA",
+        "mode":                "sigVer",
+        "revision":            "FIPS204",
+        "parameterSets":       ps,
+        "messageLength":       mln,
+        "signatureInterfaces": ["1"],
+        "capabilities": [{"parameterSets": ps, "messageLength": mln}],
+    }
+
+
+_SLH_DSA_PARAM_SETS = [
+    "SLH-DSA-SHA2-128s",  "SLH-DSA-SHA2-128f",
+    "SLH-DSA-SHA2-192s",  "SLH-DSA-SHA2-192f",
+    "SLH-DSA-SHA2-256s",  "SLH-DSA-SHA2-256f",
+    "SLH-DSA-SHAKE-128s", "SLH-DSA-SHAKE-128f",
+    "SLH-DSA-SHAKE-192s", "SLH-DSA-SHAKE-192f",
+    "SLH-DSA-SHAKE-256s", "SLH-DSA-SHAKE-256f",
+]
+
+
+def build_slh_dsa_keygen_cap(*_):
+    return {
+        "algorithm":     "SLH-DSA",
+        "mode":          "keyGen",
+        "revision":      "FIPS205",
+        "parameterSets": _SLH_DSA_PARAM_SETS,
+    }
+
+
+def build_slh_dsa_siggen_cap(*_):
+    mln = [{"min": 8, "max": 65536, "increment": 8}]
+    return {
+        "algorithm":           "SLH-DSA",
+        "mode":                "sigGen",
+        "revision":            "FIPS205",
+        "parameterSets":       _SLH_DSA_PARAM_SETS,
+        "messageLength":       mln,
+        "deterministic":       [True, False],
+        "signatureInterfaces": ["1"],
+        "capabilities": [{"parameterSets": _SLH_DSA_PARAM_SETS, "messageLength": mln, "deterministic": [True, False]}],
+    }
+
+
+def build_slh_dsa_sigver_cap(*_):
+    mln = [{"min": 8, "max": 65536, "increment": 8}]
+    return {
+        "algorithm":           "SLH-DSA",
+        "mode":                "sigVer",
+        "revision":            "FIPS205",
+        "parameterSets":       _SLH_DSA_PARAM_SETS,
+        "messageLength":       mln,
+        "signatureInterfaces": ["1"],
+        "capabilities": [{"parameterSets": _SLH_DSA_PARAM_SETS, "messageLength": mln}],
+    }
+
+
+CAPABILITY_BUILDERS = {
+    "ACVP-AES-CBC":   build_aes_cbc_cap,
+    "ACVP-AES-CTR":   build_aes_ctr_cap,
+    "ACVP-AES-ECB":   build_aes_ecb_cap,
+    "HMAC-SHA2-256":  build_hmac_sha256_cap,
+    "HMAC-SHA2-384":  build_hmac_sha384_cap,
+    "HMAC-SHA2-512":  build_hmac_sha512_cap,
+    "SHA2-256":       build_sha256_cap,
+    "SHA2-384":       build_sha384_cap,
+    "SHA2-512":       build_sha512_cap,
+    "SHA3-256":       build_sha3_256_cap,
+    "SHA3-384":       build_sha3_384_cap,
+    "SHA3-512":       build_sha3_512_cap,
+    "ML-KEM-keyGen":  build_ml_kem_keygen_cap,
+    "ML-DSA-keyGen":  build_ml_dsa_keygen_cap,
+    "ML-DSA-sigGen":  build_ml_dsa_siggen_cap,
+    "ML-DSA-sigVer":  build_ml_dsa_sigver_cap,
+    "SLH-DSA-keyGen": build_slh_dsa_keygen_cap,
+    "SLH-DSA-sigGen": build_slh_dsa_siggen_cap,
+    "SLH-DSA-sigVer": build_slh_dsa_sigver_cap,
+}
+
+
+# ---------------------------------------------------------------------------
+# OPENSSL HELPERS
+# ---------------------------------------------------------------------------
+
+def run_openssl(args_list, stdin=None):
+    """Run openssl with the given argument list; return stdout bytes."""
+    result = subprocess.run([OPENSSL_BIN] + args_list, input=stdin, capture_output=True)
+    if result.returncode != 0:
+        raise RuntimeError(result.stderr.decode().strip())
+    return result.stdout
+
+
+# ---------------------------------------------------------------------------
+# PQC CTYPES HELPERS  (EVP C API for deterministic keygen and sign/verify)
+# ---------------------------------------------------------------------------
+
+_OSSL_LIB_PATH = None   # set from --lib-path or auto-detected in main()
+
+
+def _find_libcrypto(openssl_bin):
+    """Auto-detect libcrypto shared library for the given OpenSSL binary.
+
+    Strategy (in order):
+    1. Read the binary's dynamic link metadata to find the exact library it
+       was compiled against (otool -L on macOS; ldd on Linux).
+    2. Glob for libcrypto in lib/ and lib64/ relative to the binary.
+    3. Fall back to ctypes.util.find_library("crypto").
+    """
+    # 1. Inspect the binary's dynamic link metadata.
+    if platform.system() == "Darwin":
+        try:
+            out = subprocess.check_output(
+                ["otool", "-L", openssl_bin], stderr=subprocess.DEVNULL
+            ).decode()
+            for line in out.splitlines():
+                m = re.match(r"\s+(/\S*libcrypto\S*\.dylib)", line)
+                if m:
+                    return m.group(1)
+        except (subprocess.CalledProcessError, FileNotFoundError):
+            pass
+    else:
+        try:
+            out = subprocess.check_output(
+                ["ldd", openssl_bin], stderr=subprocess.DEVNULL
+            ).decode()
+            for line in out.splitlines():
+                m = re.search(r"libcrypto\.so\S*\s+=>\s+(\S+)", line)
+                if m and m.group(1) != "not":
+                    return m.group(1)
+        except (subprocess.CalledProcessError, FileNotFoundError):
+            pass
+
+    # 2. Glob relative to the binary location.
+    bin_dir = os.path.dirname(os.path.realpath(openssl_bin))
+    search_dirs = [
+        os.path.realpath(os.path.join(bin_dir, "..", "lib")),
+        os.path.realpath(os.path.join(bin_dir, "..", "lib64")),
+    ]
+    patterns = (["libcrypto.*.dylib", "libcrypto.dylib"] if platform.system() == "Darwin"
+                else ["libcrypto.so.*", "libcrypto.so"])
+
+    for lib_dir in search_dirs:
+        for pattern in patterns:
+            matches = sorted(glob.glob(os.path.join(lib_dir, pattern)))
+            if matches:
+                return matches[-1]
+
+    # 3. System-wide search.
+    from ctypes.util import find_library
+    found = find_library("crypto")
+    if found:
+        return found
+
+    raise RuntimeError(
+        "Could not find libcrypto. Use --lib-path to specify the path explicitly."
+    )
+
+
+_EVP_PKEY_PUBLIC_KEY = 0x86   # OSSL_KEYMGMT_SELECT_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_ALL_PARAMS
+_EVP_PKEY_KEYPAIR    = 0x87   # public + private
+
+_lib_crypto = None
+
+
+def _lib():
+    global _lib_crypto
+    if _lib_crypto is not None:
+        return _lib_crypto
+
+    lib = ctypes.CDLL(os.path.realpath(_OSSL_LIB_PATH))
+
+    # OSSL_PARAM_BLD
+    lib.OSSL_PARAM_BLD_new.restype           = ctypes.c_void_p
+    lib.OSSL_PARAM_BLD_new.argtypes          = []
+    lib.OSSL_PARAM_BLD_free.restype          = None
+    lib.OSSL_PARAM_BLD_free.argtypes         = [ctypes.c_void_p]
+    lib.OSSL_PARAM_BLD_to_param.restype      = ctypes.c_void_p
+    lib.OSSL_PARAM_BLD_to_param.argtypes     = [ctypes.c_void_p]
+    lib.OSSL_PARAM_BLD_push_octet_string.restype  = ctypes.c_int
+    lib.OSSL_PARAM_BLD_push_octet_string.argtypes = [
+        ctypes.c_void_p, ctypes.c_char_p, ctypes.c_void_p, ctypes.c_size_t,
+    ]
+    lib.OSSL_PARAM_free.restype  = None
+    lib.OSSL_PARAM_free.argtypes = [ctypes.c_void_p]
+
+    # EVP_PKEY_CTX
+    lib.EVP_PKEY_CTX_new_from_name.restype  = ctypes.c_void_p
+    lib.EVP_PKEY_CTX_new_from_name.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p]
+    lib.EVP_PKEY_CTX_free.restype           = None
+    lib.EVP_PKEY_CTX_free.argtypes          = [ctypes.c_void_p]
+    lib.EVP_PKEY_CTX_set_params.restype     = ctypes.c_int
+    lib.EVP_PKEY_CTX_set_params.argtypes    = [ctypes.c_void_p, ctypes.c_void_p]
+
+    # keygen
+    lib.EVP_PKEY_keygen_init.restype  = ctypes.c_int
+    lib.EVP_PKEY_keygen_init.argtypes = [ctypes.c_void_p]
+    lib.EVP_PKEY_generate.restype     = ctypes.c_int
+    lib.EVP_PKEY_generate.argtypes    = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)]
+
+    # fromdata
+    lib.EVP_PKEY_fromdata_init.restype  = ctypes.c_int
+    lib.EVP_PKEY_fromdata_init.argtypes = [ctypes.c_void_p]
+    lib.EVP_PKEY_fromdata.restype       = ctypes.c_int
+    lib.EVP_PKEY_fromdata.argtypes      = [
+        ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p), ctypes.c_int, ctypes.c_void_p,
+    ]
+
+    # raw key extraction
+    lib.EVP_PKEY_get_raw_public_key.restype   = ctypes.c_int
+    lib.EVP_PKEY_get_raw_public_key.argtypes  = [
+        ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_size_t),
+    ]
+    lib.EVP_PKEY_get_raw_private_key.restype  = ctypes.c_int
+    lib.EVP_PKEY_get_raw_private_key.argtypes = [
+        ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_size_t),
+    ]
+
+    # EVP_PKEY_free
+    lib.EVP_PKEY_free.restype  = None
+    lib.EVP_PKEY_free.argtypes = [ctypes.c_void_p]
+
+    # EVP_MD_CTX for sign/verify
+    lib.EVP_MD_CTX_new.restype   = ctypes.c_void_p
+    lib.EVP_MD_CTX_new.argtypes  = []
+    lib.EVP_MD_CTX_free.restype  = None
+    lib.EVP_MD_CTX_free.argtypes = [ctypes.c_void_p]
+
+    lib.EVP_DigestSignInit_ex.restype  = ctypes.c_int
+    lib.EVP_DigestSignInit_ex.argtypes = [
+        ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p),
+        ctypes.c_char_p, ctypes.c_void_p, ctypes.c_char_p,
+        ctypes.c_void_p, ctypes.c_void_p,
+    ]
+    lib.EVP_DigestSign.restype  = ctypes.c_int
+    lib.EVP_DigestSign.argtypes = [
+        ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_size_t),
+        ctypes.c_void_p, ctypes.c_size_t,
+    ]
+
+    lib.EVP_DigestVerifyInit_ex.restype  = ctypes.c_int
+    lib.EVP_DigestVerifyInit_ex.argtypes = [
+        ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p),
+        ctypes.c_char_p, ctypes.c_void_p, ctypes.c_char_p,
+        ctypes.c_void_p, ctypes.c_void_p,
+    ]
+    lib.EVP_DigestVerify.restype  = ctypes.c_int
+    lib.EVP_DigestVerify.argtypes = [
+        ctypes.c_void_p, ctypes.c_void_p, ctypes.c_size_t,
+        ctypes.c_void_p, ctypes.c_size_t,
+    ]
+
+    _lib_crypto = lib
+    return lib
+
+
+def _build_octet_params(key_name: bytes, data: bytes):
+    """Build a single-entry OSSL_PARAM array; caller must OSSL_PARAM_free.
+
+    key_name MUST be a bytes literal from the caller (OSSL_PARAM_BLD_to_param
+    stores only a pointer to the key name, not a copy, so it must outlive params).
+    """
+    lib = _lib()
+    bld = lib.OSSL_PARAM_BLD_new()
+    if not bld:
+        raise RuntimeError("OSSL_PARAM_BLD_new failed")
+    buf = (ctypes.c_ubyte * len(data))(*data)
+    ok  = lib.OSSL_PARAM_BLD_push_octet_string(bld, key_name, buf, len(data))
+    params = lib.OSSL_PARAM_BLD_to_param(bld)
+    lib.OSSL_PARAM_BLD_free(bld)
+    if not ok or not params:
+        raise RuntimeError(f"OSSL_PARAM_BLD_push_octet_string({key_name}) failed")
+    return params
+
+
+def _pqc_keygen_from_seed(algo_name: str, seed: bytes):
+    """Generate a PQC key pair from a seed; returns (raw_pub_bytes, raw_priv_bytes)."""
+    lib    = _lib()
+    params = _build_octet_params(b"seed", seed)
+    try:
+        ctx = lib.EVP_PKEY_CTX_new_from_name(None, algo_name.encode(), None)
+        if not ctx:
+            raise RuntimeError(f"EVP_PKEY_CTX_new_from_name({algo_name}) failed")
+        try:
+            if lib.EVP_PKEY_keygen_init(ctx) <= 0:
+                raise RuntimeError("EVP_PKEY_keygen_init failed")
+            if lib.EVP_PKEY_CTX_set_params(ctx, params) <= 0:
+                raise RuntimeError("EVP_PKEY_CTX_set_params(seed) failed")
+            pkey = ctypes.c_void_p(None)
+            if lib.EVP_PKEY_generate(ctx, ctypes.byref(pkey)) <= 0:
+                raise RuntimeError(f"EVP_PKEY_generate({algo_name}) failed")
+        finally:
+            lib.EVP_PKEY_CTX_free(ctx)
+    finally:
+        lib.OSSL_PARAM_free(params)
+
+    try:
+        pub_len = ctypes.c_size_t(0)
+        lib.EVP_PKEY_get_raw_public_key(pkey, None, ctypes.byref(pub_len))
+        pub_buf = (ctypes.c_ubyte * pub_len.value)()
+        if lib.EVP_PKEY_get_raw_public_key(pkey, pub_buf, ctypes.byref(pub_len)) <= 0:
+            raise RuntimeError("EVP_PKEY_get_raw_public_key failed")
+
+        priv_len = ctypes.c_size_t(0)
+        lib.EVP_PKEY_get_raw_private_key(pkey, None, ctypes.byref(priv_len))
+        priv_buf = (ctypes.c_ubyte * priv_len.value)()
+        if lib.EVP_PKEY_get_raw_private_key(pkey, priv_buf, ctypes.byref(priv_len)) <= 0:
+            raise RuntimeError("EVP_PKEY_get_raw_private_key failed")
+
+        return bytes(pub_buf), bytes(priv_buf)
+    finally:
+        lib.EVP_PKEY_free(pkey)
+
+
+def _pqc_load_pub(algo_name: str, pub_bytes: bytes):
+    """Load raw public key bytes into an EVP_PKEY (public key only); caller must free."""
+    lib    = _lib()
+    params = _build_octet_params(b"pub", pub_bytes)
+    try:
+        ctx = lib.EVP_PKEY_CTX_new_from_name(None, algo_name.encode(), None)
+        if not ctx:
+            raise RuntimeError(f"EVP_PKEY_CTX_new_from_name({algo_name}) failed")
+        try:
+            if lib.EVP_PKEY_fromdata_init(ctx) <= 0:
+                raise RuntimeError("EVP_PKEY_fromdata_init failed")
+            pkey = ctypes.c_void_p(None)
+            if lib.EVP_PKEY_fromdata(ctx, ctypes.byref(pkey), _EVP_PKEY_PUBLIC_KEY, params) <= 0:
+                raise RuntimeError(f"EVP_PKEY_fromdata(pub, {algo_name}) failed")
+        finally:
+            lib.EVP_PKEY_CTX_free(ctx)
+    finally:
+        lib.OSSL_PARAM_free(params)
+    return pkey
+
+
+def _pqc_load_priv(algo_name: str, priv_bytes: bytes):
+    """Load raw private key bytes into an EVP_PKEY (keypair); caller must free."""
+    lib    = _lib()
+    params = _build_octet_params(b"priv", priv_bytes)
+    try:
+        ctx = lib.EVP_PKEY_CTX_new_from_name(None, algo_name.encode(), None)
+        if not ctx:
+            raise RuntimeError(f"EVP_PKEY_CTX_new_from_name({algo_name}) failed")
+        try:
+            if lib.EVP_PKEY_fromdata_init(ctx) <= 0:
+                raise RuntimeError("EVP_PKEY_fromdata_init failed")
+            pkey = ctypes.c_void_p(None)
+            if lib.EVP_PKEY_fromdata(ctx, ctypes.byref(pkey), _EVP_PKEY_KEYPAIR, params) <= 0:
+                raise RuntimeError(f"EVP_PKEY_fromdata(priv, {algo_name}) failed")
+        finally:
+            lib.EVP_PKEY_CTX_free(ctx)
+    finally:
+        lib.OSSL_PARAM_free(params)
+    return pkey
+
+
+_MAX_SIG_BUF = 65536  # large enough for any PQC signature (SLH-DSA-SHA2-256f ≈ 49 856 B)
+
+# Direct OSSL_PARAM struct for setting sign params without PARAM_BLD (key name stays
+# alive as a bytes literal in the calling frame — c_char_p stores only a pointer).
+class _OSSL_PARAM(ctypes.Structure):
+    _fields_ = [
+        ("key",         ctypes.c_char_p),
+        ("data_type",   ctypes.c_uint32),
+        ("data",        ctypes.c_void_p),
+        ("data_size",   ctypes.c_size_t),
+        ("return_size", ctypes.c_size_t),
+    ]
+
+_OSSL_PARAM_INTEGER      = 1
+_OSSL_PARAM_OCTET_STRING = 5
+_OSSL_RETURN_SIZE_UNSET  = ctypes.c_size_t(-1).value
+
+
+def _pqc_sign(algo_name: str, priv_bytes: bytes, msg: bytes,
+              *, deterministic: bool = True, rnd: bytes = None) -> bytes:
+    """Sign msg with raw private key bytes; returns signature bytes.
+
+    Always sets message-encoding=0 (RAW) for ACVP signatureInterface:internal.
+    deterministic=True  → set "deterministic"=1 (rnd=0^n per FIPS 204/205).
+    deterministic=False → set "test-entropy"=rnd bytes provided by ACVP.
+    """
+    lib  = _lib()
+    pkey = _pqc_load_priv(algo_name, priv_bytes)
+    try:
+        mdctx = lib.EVP_MD_CTX_new()
+        if not mdctx:
+            raise RuntimeError("EVP_MD_CTX_new failed")
+        try:
+            pctx = ctypes.c_void_p(None)
+            if lib.EVP_DigestSignInit_ex(
+                    mdctx, ctypes.byref(pctx), None, None, None, pkey, None) <= 0:
+                raise RuntimeError(f"EVP_DigestSignInit_ex({algo_name}) failed")
+
+            enc_val = ctypes.c_int(0)   # message-encoding = 0 (RAW)
+            if deterministic:
+                det_val = ctypes.c_int(1)
+                sp = (_OSSL_PARAM * 3)()
+                sp[0].key         = b"message-encoding"
+                sp[0].data_type   = _OSSL_PARAM_INTEGER
+                sp[0].data        = ctypes.cast(ctypes.byref(enc_val), ctypes.c_void_p)
+                sp[0].data_size   = ctypes.sizeof(enc_val)
+                sp[0].return_size = _OSSL_RETURN_SIZE_UNSET
+                sp[1].key         = b"deterministic"
+                sp[1].data_type   = _OSSL_PARAM_INTEGER
+                sp[1].data        = ctypes.cast(ctypes.byref(det_val), ctypes.c_void_p)
+                sp[1].data_size   = ctypes.sizeof(det_val)
+                sp[1].return_size = _OSSL_RETURN_SIZE_UNSET
+                sp[2].key         = None
+            elif rnd is not None:
+                rnd_buf = (ctypes.c_ubyte * len(rnd))(*rnd)
+                sp = (_OSSL_PARAM * 3)()
+                sp[0].key         = b"message-encoding"
+                sp[0].data_type   = _OSSL_PARAM_INTEGER
+                sp[0].data        = ctypes.cast(ctypes.byref(enc_val), ctypes.c_void_p)
+                sp[0].data_size   = ctypes.sizeof(enc_val)
+                sp[0].return_size = _OSSL_RETURN_SIZE_UNSET
+                sp[1].key         = b"test-entropy"
+                sp[1].data_type   = _OSSL_PARAM_OCTET_STRING
+                sp[1].data        = ctypes.cast(rnd_buf, ctypes.c_void_p)
+                sp[1].data_size   = len(rnd)
+                sp[1].return_size = _OSSL_RETURN_SIZE_UNSET
+                sp[2].key         = None
+            else:
+                sp = (_OSSL_PARAM * 2)()
+                sp[0].key         = b"message-encoding"
+                sp[0].data_type   = _OSSL_PARAM_INTEGER
+                sp[0].data        = ctypes.cast(ctypes.byref(enc_val), ctypes.c_void_p)
+                sp[0].data_size   = ctypes.sizeof(enc_val)
+                sp[0].return_size = _OSSL_RETURN_SIZE_UNSET
+                sp[1].key         = None
+
+            if lib.EVP_PKEY_CTX_set_params(pctx, sp) <= 0:
+                raise RuntimeError(f"EVP_PKEY_CTX_set_params({algo_name}) failed")
+
+            sig_buf = (ctypes.c_ubyte * _MAX_SIG_BUF)()
+            sig_len = ctypes.c_size_t(_MAX_SIG_BUF)
+            msg_buf = (ctypes.c_ubyte * len(msg))(*msg)
+            if lib.EVP_DigestSign(
+                    mdctx, sig_buf, ctypes.byref(sig_len), msg_buf, len(msg)) <= 0:
+                raise RuntimeError(f"EVP_DigestSign({algo_name}) failed")
+            return bytes(sig_buf[:sig_len.value])
+        finally:
+            lib.EVP_MD_CTX_free(mdctx)
+    finally:
+        lib.EVP_PKEY_free(pkey)
+
+
+def _pqc_verify(algo_name: str, pub_bytes: bytes, msg: bytes, sig: bytes) -> bool:
+    """Verify a PQC signature; returns True if valid."""
+    lib  = _lib()
+    pkey = _pqc_load_pub(algo_name, pub_bytes)
+    try:
+        mdctx = lib.EVP_MD_CTX_new()
+        if not mdctx:
+            raise RuntimeError("EVP_MD_CTX_new failed")
+        try:
+            pctx = ctypes.c_void_p(None)
+            if lib.EVP_DigestVerifyInit_ex(
+                    mdctx, ctypes.byref(pctx), None, None, None, pkey, None) <= 0:
+                raise RuntimeError(f"EVP_DigestVerifyInit_ex({algo_name}) failed")
+            # message-encoding=0 (RAW) for ACVP signatureInterface:internal
+            enc_val = ctypes.c_int(0)
+            sp = (_OSSL_PARAM * 2)()
+            sp[0].key         = b"message-encoding"
+            sp[0].data_type   = _OSSL_PARAM_INTEGER
+            sp[0].data        = ctypes.cast(ctypes.byref(enc_val), ctypes.c_void_p)
+            sp[0].data_size   = ctypes.sizeof(enc_val)
+            sp[0].return_size = _OSSL_RETURN_SIZE_UNSET
+            sp[1].key         = None
+            if lib.EVP_PKEY_CTX_set_params(pctx, sp) <= 0:
+                raise RuntimeError(f"EVP_PKEY_CTX_set_params({algo_name}) failed")
+            sig_buf = (ctypes.c_ubyte * len(sig))(*sig)
+            msg_buf = (ctypes.c_ubyte * len(msg))(*msg)
+            ret = lib.EVP_DigestVerify(mdctx, sig_buf, len(sig), msg_buf, len(msg))
+            return ret == 1
+        finally:
+            lib.EVP_MD_CTX_free(mdctx)
+    finally:
+        lib.EVP_PKEY_free(pkey)
+
+
+def _aes_cipher_name(algorithm, key_len):
+    # "ACVP-AES-CBC" → "aes-256-cbc"
+    mode = algorithm.split("-")[-1].lower()
+    return f"aes-{key_len}-{mode}"
+
+
+def _aes_ecb_block(key_bytes: bytes, block: bytes, decrypt: bool = False) -> bytes:
+    """Encrypt or decrypt one 16-byte block with AES-ECB via the cryptography library."""
+    c = Cipher(algorithms.AES(key_bytes), modes.ECB())
+    op = c.decryptor() if decrypt else c.encryptor()
+    return op.update(block) + op.finalize()
+
+
+def _aes_ecb_mct(direction: str, key_hex: str, payload_hex: str) -> list[dict]:
+    """
+    Run AES-ECB MCT (100 outer × 1000 inner iterations, no IV).
+
+    Each inner step: output = AES_ECB_{Enc|Dec}(key, input); next_input = output.
+    Key derivation same as CBC: XOR with last n bytes of output[998] ‖ output[999].
+    """
+    key = bytes.fromhex(key_hex)
+    msg = bytes.fromhex(payload_hex)
+    n   = len(key)
+    dec = (direction == "decrypt")
+
+    results = []
+    for _ in range(100):
+        round_key = key
+        round_msg = msg
+
+        out_prev2 = out_prev = None
+        for _ in range(1000):
+            out = _aes_ecb_block(key, msg, decrypt=dec)
+            out_prev2, out_prev = out_prev, out
+            msg = out
+
+        combined = out_prev2 + out_prev
+        key = bytes(a ^ b for a, b in zip(key, combined[-n:]))
+        msg = out_prev  # output[999] seeds the next outer iteration
+
+        if direction == "encrypt":
+            results.append({"key": round_key.hex().upper(),
+                             "pt":  round_msg.hex().upper(),
+                             "ct":  out_prev.hex().upper()})
+        else:
+            results.append({"key": round_key.hex().upper(),
+                             "ct":  round_msg.hex().upper(),
+                             "pt":  out_prev.hex().upper()})
+
+    return results
+
+
+def _aes_cbc_mct(direction: str, key_hex: str, iv_hex: str, payload_hex: str) -> list[dict]:
+    """
+    Run the ACVP AES-CBC Monte Carlo Test (100 outer × 1000 inner iterations).
+
+    Using the cryptography library for the inner loop avoids 100,000 subprocess
+    calls (~17 min) while still exercising the same mathematical operations that
+    the AFT tests already validated against the target binary.
+
+    Key derivation per NIST SP 800-20 / ACVP spec:
+      128-bit: newKey = key XOR CT[999]
+      192-bit: newKey = key XOR CT[998][8:] ‖ CT[999]
+      256-bit: newKey = key XOR CT[998] ‖ CT[999]
+    """
+    key = bytes.fromhex(key_hex)
+    iv  = bytes.fromhex(iv_hex)
+    pt  = bytes.fromhex(payload_hex)
+    n   = len(key)  # 16, 24, or 32 bytes
+
+    results = []
+    for _ in range(100):
+        round_key = key
+        round_iv  = iv
+        round_pt  = pt
+
+        ct_prev2 = ct_prev = None
+        for j in range(1000):
+            if direction == "encrypt":
+                ct = _aes_ecb_block(key, bytes(a ^ b for a, b in zip(pt, iv)))
+                pt, iv = (iv if j == 0 else ct_prev), ct
+            else:
+                # CBC decrypt: output = AES_ECB_Dec(key, CT_in) XOR IV
+                ct = bytes(a ^ b for a, b in zip(_aes_ecb_block(key, pt, decrypt=True), iv))
+                iv, pt = pt, (iv if j == 0 else ct_prev)
+            ct_prev2, ct_prev = ct_prev, ct
+
+        # ct_prev = output[999], ct_prev2 = output[998]
+        combined = ct_prev2 + ct_prev
+        key = bytes(a ^ b for a, b in zip(key, combined[-n:]))
+        iv  = ct_prev   # output[999] → next IV (same rule for both directions)
+        pt  = ct_prev2  # output[998] → next msg (same rule for both directions)
+
+        if direction == "encrypt":
+            results.append({"key": round_key.hex().upper(),
+                             "iv":  round_iv.hex().upper(),
+                             "pt":  round_pt.hex().upper(),
+                             "ct":  ct_prev.hex().upper()})
+        else:
+            # round_pt holds the initial CT input for this outer iteration
+            results.append({"key": round_key.hex().upper(),
+                             "iv":  round_iv.hex().upper(),
+                             "ct":  round_pt.hex().upper(),
+                             "pt":  ct_prev.hex().upper()})
+
+    return results
+
+
+def process_aes_symmetric(group, tc):
+    """Handler for ACVP-AES-CBC and ACVP-AES-ECB (AFT and MCT)."""
+    algorithm = group.get("algorithm", "ACVP-AES-CBC")
+    direction = group.get("direction", "encrypt")
+    test_type = group.get("testType", "AFT")
+    key       = tc["key"]
+    key_len   = group.get("keyLen", len(bytes.fromhex(key)) * 8)
+    cipher    = _aes_cipher_name(algorithm, key_len)
+    iv        = tc.get("iv", tc.get("IV", ""))
+
+    if test_type == "MCT":
+        payload = tc.get("pt" if direction == "encrypt" else "ct", "")
+        if "ECB" in algorithm.upper():
+            return {"tcId": tc["tcId"], "resultsArray": _aes_ecb_mct(direction, key, payload)}
+        return {"tcId": tc["tcId"], "resultsArray": _aes_cbc_mct(direction, key, iv, payload)}
+
+    # AFT — call the target OpenSSL binary
+    base_args = ["enc", f"-{cipher}", "-nosalt", "-nopad", "-K", key]
+    if iv:
+        base_args += ["-iv", iv]
+
+    if direction == "encrypt":
+        pt_bytes = bytes.fromhex(tc.get("pt", tc.get("plainText", "")))
+        ct = run_openssl(base_args, stdin=pt_bytes).hex().upper()
+        return {"tcId": tc["tcId"], "ct": ct}
+    else:
+        ct_bytes = bytes.fromhex(tc.get("ct", tc.get("cipherText", "")))
+        pt = run_openssl(base_args + ["-d"], stdin=ct_bytes).hex().upper()
+        return {"tcId": tc["tcId"], "pt": pt}
+
+
+def process_aes_ctr(group, tc):
+    """Handler for ACVP-AES-CTR (AFT only — no MCT for CTR mode)."""
+    direction = group.get("direction", "encrypt")
+    key       = tc["key"]
+    key_len   = group.get("keyLen", len(bytes.fromhex(key)) * 8)
+    iv        = tc.get("iv", tc.get("IV", ""))
+    payload   = tc.get("pt" if direction == "encrypt" else "ct", "")
+
+    result = run_openssl(
+        ["enc", f"-aes-{key_len}-ctr", "-nosalt", "-nopad", "-K", key, "-iv", iv],
+        stdin=bytes.fromhex(payload) if payload else b"",
+    )
+    if direction == "encrypt":
+        return {"tcId": tc["tcId"], "ct": result.hex().upper()}
+    return {"tcId": tc["tcId"], "pt": result.hex().upper()}
+
+
+def _sha2_mct(algorithm: str, seed_hex: str) -> list[dict]:
+    """SHA2 MCT: 3-value sliding window, 100 outer × 1000 inner iterations."""
+    bits = algorithm.split("-")[-1]
+    h    = getattr(hashlib, f"sha{bits}")
+    seed = bytes.fromhex(seed_hex)
+    results = []
+    for _ in range(100):
+        md = [seed, seed, seed]
+        for _ in range(1000):
+            new_md = h(md[0] + md[1] + md[2]).digest()
+            md = [md[1], md[2], new_md]
+        seed = md[2]
+        results.append({"md": seed.hex().upper()})
+    return results
+
+
+def _sha3_mct(algorithm: str, seed_hex: str) -> list[dict]:
+    """SHA3 MCT: simple chain, 100 outer × 1000 inner iterations."""
+    bits = algorithm.split("-")[-1]
+    h    = getattr(hashlib, f"sha3_{bits}")
+    seed = bytes.fromhex(seed_hex)
+    results = []
+    for _ in range(100):
+        for _ in range(1000):
+            seed = h(seed).digest()
+        results.append({"md": seed.hex().upper()})
+    return results
+
+
+def process_sha2(group, tc):
+    """Handler for SHA2-256/384/512.  Only handles byte-aligned messages."""
+    algorithm = group.get("algorithm", "SHA2-256")
+    test_type = group.get("testType", "AFT")
+    bits      = algorithm.split("-")[-1]   # "256", "384", "512"
+
+    if test_type == "MCT":
+        seed_hex = tc.get("msg", "")
+        return {"tcId": tc["tcId"], "resultsArray": _sha2_mct(algorithm, seed_hex)}
+
+    msg_hex   = tc.get("msg", "")
+    msg_len   = tc.get("len", len(msg_hex) * 4)  # bit length
+    msg_bytes = bytes.fromhex(msg_hex)[:msg_len // 8] if msg_hex else b""
+    md = run_openssl(["dgst", f"-sha{bits}", "-binary"], stdin=msg_bytes).hex().upper()
+    return {"tcId": tc["tcId"], "md": md}
+
+
+def process_sha3(group, tc):
+    """Handler for SHA3-256/384/512.  Only handles byte-aligned messages."""
+    algorithm = group.get("algorithm", "SHA3-256")
+    test_type = group.get("testType", "AFT")
+    bits      = algorithm.split("-")[-1]   # "256", "384", "512"
+
+    if test_type == "MCT":
+        seed_hex = tc.get("msg", "")
+        return {"tcId": tc["tcId"], "resultsArray": _sha3_mct(algorithm, seed_hex)}
+
+    msg_hex   = tc.get("msg", "")
+    msg_len   = tc.get("len", len(msg_hex) * 4)
+    msg_bytes = bytes.fromhex(msg_hex)[:msg_len // 8] if msg_hex else b""
+    md = run_openssl(["dgst", f"-sha3-{bits}", "-binary"], stdin=msg_bytes).hex().upper()
+    return {"tcId": tc["tcId"], "md": md}
+
+
+def process_hmac_sha2(group, tc):
+    """Handler for HMAC-SHA2-256/384/512."""
+    algorithm = group.get("algorithm", "HMAC-SHA2-256")
+    bits      = algorithm.split("-")[-1]   # "256", "384", "512"
+    key_hex   = tc["key"]
+    msg_hex   = tc.get("msg", "")
+    mac_len   = group.get("macLen", int(bits)) // 8  # bits → bytes
+
+    msg_bytes = bytes.fromhex(msg_hex) if msg_hex else b""
+    full_mac  = run_openssl(
+        ["dgst", f"-sha{bits}", "-mac", "HMAC", "-macopt", f"hexkey:{key_hex}", "-binary"],
+        stdin=msg_bytes,
+    ).hex().upper()
+    return {"tcId": tc["tcId"], "mac": full_mac[: mac_len * 2]}
+
+
+# ---------------------------------------------------------------------------
+# PQC ALGORITHM HANDLERS
+# ---------------------------------------------------------------------------
+
+def process_ml_kem_keygen(group, tc):
+    param_set = group["parameterSet"]
+    seed      = bytes.fromhex(tc["d"]) + bytes.fromhex(tc["z"])
+    ek, dk    = _pqc_keygen_from_seed(param_set, seed)
+    return {"tcId": tc["tcId"], "ek": ek.hex().upper(), "dk": dk.hex().upper()}
+
+
+def process_ml_dsa_keygen(group, tc):
+    param_set = group["parameterSet"]
+    seed      = bytes.fromhex(tc["seed"])
+    pk, sk    = _pqc_keygen_from_seed(param_set, seed)
+    return {"tcId": tc["tcId"], "pk": pk.hex().upper(), "sk": sk.hex().upper()}
+
+
+def process_slh_dsa_keygen(group, tc):
+    param_set = group["parameterSet"]
+    seed      = (bytes.fromhex(tc["skSeed"])
+                 + bytes.fromhex(tc["skPrf"])
+                 + bytes.fromhex(tc["pkSeed"]))
+    pk, sk    = _pqc_keygen_from_seed(param_set, seed)
+    return {"tcId": tc["tcId"], "pk": pk.hex().upper(), "sk": sk.hex().upper()}
+
+
+def process_ml_dsa_siggen(group, tc):
+    param_set   = group["parameterSet"]
+    sk_hex      = group.get("sk") or tc.get("sk", "")
+    msg         = bytes.fromhex(tc.get("message", ""))
+    det         = group.get("deterministic", True)
+    rnd         = bytes.fromhex(tc["rnd"]) if not det and "rnd" in tc else None
+    sig         = _pqc_sign(param_set, bytes.fromhex(sk_hex), msg, deterministic=det, rnd=rnd)
+    return {"tcId": tc["tcId"], "signature": sig.hex().upper()}
+
+
+def process_ml_dsa_sigver(group, tc):
+    param_set = group["parameterSet"]
+    pk_hex    = group.get("pk") or tc.get("pk", "")
+    msg       = bytes.fromhex(tc.get("message", ""))
+    sig       = bytes.fromhex(tc.get("signature", ""))
+    passed    = _pqc_verify(param_set, bytes.fromhex(pk_hex), msg, sig)
+    return {"tcId": tc["tcId"], "testPassed": passed}
+
+
+def process_slh_dsa_siggen(group, tc):
+    param_set   = group["parameterSet"]
+    sk_hex      = group.get("sk") or tc.get("sk", "")
+    msg         = bytes.fromhex(tc.get("message", ""))
+    det         = group.get("deterministic", True)
+    if not det:
+        rnd_hex = tc.get("rnd") or tc.get("additionalRandomness") or tc.get("optRand")
+        rnd = bytes.fromhex(rnd_hex) if rnd_hex else None
+    else:
+        rnd = None
+    sig         = _pqc_sign(param_set, bytes.fromhex(sk_hex), msg, deterministic=det, rnd=rnd)
+    return {"tcId": tc["tcId"], "signature": sig.hex().upper()}
+
+
+def process_slh_dsa_sigver(group, tc):
+    param_set = group["parameterSet"]
+    pk_hex    = group.get("pk") or tc.get("pk", "")
+    msg       = bytes.fromhex(tc.get("message", ""))
+    sig       = bytes.fromhex(tc.get("signature", ""))
+    passed    = _pqc_verify(param_set, bytes.fromhex(pk_hex), msg, sig)
+    return {"tcId": tc["tcId"], "testPassed": passed}
+
+
+ALGORITHM_HANDLERS = {
+    "ACVP-AES-CBC":   process_aes_symmetric,
+    "ACVP-AES-CTR":   process_aes_ctr,
+    "ACVP-AES-ECB":   process_aes_symmetric,
+    "HMAC-SHA2-256":  process_hmac_sha2,
+    "HMAC-SHA2-384":  process_hmac_sha2,
+    "HMAC-SHA2-512":  process_hmac_sha2,
+    "SHA2-256":       process_sha2,
+    "SHA2-384":       process_sha2,
+    "SHA2-512":       process_sha2,
+    "SHA3-256":       process_sha3,
+    "SHA3-384":       process_sha3,
+    "SHA3-512":       process_sha3,
+    "ML-KEM-keyGen":  process_ml_kem_keygen,
+    "ML-DSA-keyGen":  process_ml_dsa_keygen,
+    "ML-DSA-sigGen":  process_ml_dsa_siggen,
+    "ML-DSA-sigVer":  process_ml_dsa_sigver,
+    "SLH-DSA-keyGen": process_slh_dsa_keygen,
+    "SLH-DSA-sigGen": process_slh_dsa_siggen,
+    "SLH-DSA-sigVer": process_slh_dsa_sigver,
+}
+
+
+# ---------------------------------------------------------------------------
+# ACVTS REST API
+# ---------------------------------------------------------------------------
+
+def load_totp_secret():
+    with open(TOTP_SEED_FILE) as f:
+        b64 = f.read().strip()
+    return base64.b32encode(base64.b64decode(b64)).decode()
+
+
+def get_totp(secret_b32):
+    return pyotp.TOTP(secret_b32, digits=8, digest=hashlib.sha256, interval=30).now()
+
+
+def login(session, totp_secret_b32):
+    payload = [{"acvVersion": "1.0"}, {"password": get_totp(totp_secret_b32)}]
+    r = session.post(f"{BASE_URL}/login", json=payload)
+    r.raise_for_status()
+    info            = r.json()[1]
+    token           = info["accessToken"]
+    size_constraint = info.get("sizeConstraint", -1)
+    print(f"[+] Logged in  sizeConstraint={size_constraint}")
+    return token, size_constraint
+
+
+def register(session, token, algorithm_cap, is_sample=True):
+    """Create a test session; return (ts_id, [vs_id, ...], new_token)."""
+    headers = {"Authorization": f"Bearer {token}"}
+    payload = [
+        {"acvVersion": "1.0"},
+        {
+            "isSample":   is_sample,
+            "algorithms": [algorithm_cap],  # must be a list
+        },
+    ]
+    r = session.post(f"{BASE_URL}/testSessions", json=payload, headers=headers)
+    r.raise_for_status()
+    info = r.json()[1]
+
+    # Session id lives at the end of the "url" path
+    ts_url = info.get("url", "")
+    ts_id  = ts_url.rstrip("/").split("/")[-1] if ts_url else str(info.get("id", ""))
+
+    # Server returns either vectorSetUrls (list of URL strings) or
+    # vectorSets (list of {vsId, ...} objects) depending on server version.
+    vs_urls = info.get("vectorSetUrls", [])
+    if vs_urls:
+        vs_ids = [u.rstrip("/").split("/")[-1] for u in vs_urls]
+    else:
+        vs_ids = [str(vs["vsId"]) for vs in info.get("vectorSets", [])]
+    new_token = info.get("accessToken", token)
+
+    print(f"[+] Session {ts_id} created  vectorSets={vs_ids}")
+    return ts_id, vs_ids, new_token
+
+
+def download_vector_set(session, token, ts_id, vs_id, max_retries=20):
+    headers = {"Authorization": f"Bearer {token}"}
+    url     = f"{BASE_URL}/testSessions/{ts_id}/vectorSets/{vs_id}"
+    for _ in range(max_retries):
+        r = session.get(url, headers=headers)
+        r.raise_for_status()
+        body = r.json()
+        if isinstance(body, list) and "retry" in body[1]:
+            wait = int(body[1]["retry"])
+            print(f"  [~] VS {vs_id} not ready, waiting {wait}s...")
+            time.sleep(wait)
+            continue
+        print(f"[+] Downloaded VS {vs_id}")
+        return body
+    raise RuntimeError(f"VS {vs_id} never became ready after {max_retries} retries")
+
+
+def process_vector_set(vs_data, algorithm):
+    vs_info     = vs_data[1]
+    vs_id       = vs_info["vsId"]
+    test_groups = vs_info.get("testGroups", [])
+    handler     = ALGORITHM_HANDLERS[algorithm]
+
+    result_groups = []
+    for group in test_groups:
+        tg_id = group["tgId"]
+        group.setdefault("algorithm", algorithm)
+        result_tests = []
+        for tc in group.get("tests", []):
+            try:
+                result_tests.append(handler(group, tc))
+            except Exception as exc:
+                print(f"  [!] tcId={tc['tcId']} error: {exc}", file=sys.stderr)
+                result_tests.append({"tcId": tc["tcId"]})
+        result_groups.append({"tgId": tg_id, "tests": result_tests})
+
+    return [
+        {"acvVersion": "1.0"},
+        {"vsId": vs_id, "testGroups": result_groups},
+    ]
+
+
+def upload_results(session, token, ts_id, vs_id, results, size_constraint=-1):
+    headers     = {"Authorization": f"Bearer {token}"}
+    url         = f"{BASE_URL}/testSessions/{ts_id}/vectorSets/{vs_id}/results"
+    payload_str = json.dumps(results)
+
+    if 0 < size_constraint < len(payload_str):
+        # Payload too large: request a dedicated large-submission URI first
+        r = session.post(f"{BASE_URL}/large",
+                         json=[{"acvVersion": "1.0"}, {}], headers=headers)
+        r.raise_for_status()
+        large = r.json()[1]
+        large_headers = {
+            "Authorization": f"Bearer {large['accessToken']}",
+            "Content-Type": "application/json",
+        }
+        r = session.post(f"{BASE_URL}{large['url']}", data=payload_str, headers=large_headers)
+    else:
+        r = session.post(url, json=results, headers=headers)
+
+    r.raise_for_status()
+    print(f"[+] Uploaded results for VS {vs_id}")
+
+
+def poll_results(session, token, ts_id, vs_id, max_retries=30):
+    headers = {"Authorization": f"Bearer {token}"}
+    url     = f"{BASE_URL}/testSessions/{ts_id}/vectorSets/{vs_id}/results"
+    for _ in range(max_retries):
+        r = session.get(url, headers=headers)
+        r.raise_for_status()
+        body = r.json()
+        info = body[1] if isinstance(body, list) and len(body) > 1 else body
+        if "retry" in info:
+            wait = int(info["retry"])
+            print(f"  [~] VS {vs_id} grading, waiting {wait}s...")
+            time.sleep(wait)
+            continue
+        # Grading is complete — server returns per-test results, no retry
+        print(f"  [~] VS {vs_id} grading done")
+        return body
+    raise RuntimeError(f"VS {vs_id} did not finish within {max_retries} polls")
+
+
+def certify_session(session, token, ts_id):
+    """PUT /testSessions/{id} to mark the session complete and trigger grading."""
+    headers = {"Authorization": f"Bearer {token}"}
+    r = session.put(f"{BASE_URL}/testSessions/{ts_id}",
+                    json=[{"acvVersion": "1.0"}, {}], headers=headers)
+    try:
+        r.raise_for_status()
+    except Exception:
+        print(f"[!] Certify returned {r.status_code}: {r.text[:200]}")
+        return {}
+    body = r.json()
+    info = body[1] if isinstance(body, list) and len(body) > 1 else body
+    print(f"[+] Session certified  status={info.get('status')}  passed={info.get('passed')}")
+    return info
+
+
+# ---------------------------------------------------------------------------
+# MAIN
+# ---------------------------------------------------------------------------
+
+def main():
+    algo_choices = sorted(CAPABILITY_BUILDERS)
+    parser = argparse.ArgumentParser(
+        description="Test an OpenSSL binary against the NIST ACVTS demo server.",
+        formatter_class=argparse.RawDescriptionHelpFormatter,
+        epilog=f"Supported algorithms: {', '.join(algo_choices)}",
+    )
+    parser.add_argument(
+        "--openssl", required=True, metavar="PATH",
+        help="Path to the openssl binary to test",
+    )
+    parser.add_argument(
+        "--cert", required=True, metavar="FILE",
+        help="TLS client certificate file (.cer) from NIST",
+    )
+    parser.add_argument(
+        "--key", required=True, metavar="FILE",
+        help="Private key file (.key) for the client certificate",
+    )
+    parser.add_argument(
+        "--totp-seed", required=True, metavar="FILE",
+        help="File containing the Base64-encoded TOTP seed (one line)",
+    )
+    parser.add_argument(
+        "--lib-path", metavar="PATH",
+        help="Path to libcrypto shared library (auto-detected if omitted)",
+    )
+    parser.add_argument(
+        "--algorithm", default="ACVP-AES-CBC", choices=algo_choices, metavar="ALGO",
+        help=f"Algorithm to test (default: ACVP-AES-CBC)",
+    )
+    parser.add_argument(
+        "--direction", nargs="+", choices=["encrypt", "decrypt"],
+        help="Direction(s) for symmetric algorithms (default: both)",
+    )
+    parser.add_argument(
+        "--key-len", nargs="+", type=int, metavar="BITS",
+        help="Key length(s) in bits for symmetric algorithms (default: all)",
+    )
+    parser.add_argument(
+        "--production", action="store_true",
+        help="Run as a production validation (default: sample/demo mode)",
+    )
+    parser.add_argument(
+        "--save-vectors", action="store_true",
+        help="Save downloaded vector sets to vectors_vsNNN.json",
+    )
+    args = parser.parse_args()
+
+    global BASE_URL, OPENSSL_BIN, CERT_FILE, KEY_FILE, TOTP_SEED_FILE, _OSSL_LIB_PATH
+    BASE_URL       = PROD_URL if args.production else DEMO_URL
+    OPENSSL_BIN    = args.openssl
+    CERT_FILE      = args.cert
+    KEY_FILE       = args.key
+    TOTP_SEED_FILE = args.totp_seed
+    _OSSL_LIB_PATH = args.lib_path if args.lib_path else _find_libcrypto(args.openssl)
+
+    algorithm_cap = CAPABILITY_BUILDERS[args.algorithm](args.direction, args.key_len)
+
+    print(f"[*] Algorithm : {args.algorithm}")
+    print(f"[*] Capability: {json.dumps(algorithm_cap)}")
+    print(f"[*] Binary    : {OPENSSL_BIN}")
+    print(f"[*] Server    : {BASE_URL}")
+    print(f"[*] Sample    : {not args.production}")
+
+    session        = requests.Session()
+    session.cert   = (CERT_FILE, KEY_FILE)
+    session.verify = True  # verify NIST server cert via system CA
+
+    totp_secret = load_totp_secret()
+
+    token, size_constraint = login(session, totp_secret)
+    ts_id, vs_ids, token   = register(
+        session, token, algorithm_cap, is_sample=not args.production
+    )
+
+    all_passed = True
+    for vs_id in vs_ids:
+        vs_data = download_vector_set(session, token, ts_id, vs_id)
+
+        if args.save_vectors:
+            fname = f"vectors_vs{vs_id}.json"
+            with open(fname, "w") as f:
+                json.dump(vs_data, f, indent=2)
+            print(f"[+] Saved vectors → {fname}")
+
+        print(f"[+] Running OpenSSL for VS {vs_id}...")
+        results = process_vector_set(vs_data, args.algorithm)
+
+        with open(f"results_vs{vs_id}.json", "w") as f:
+            json.dump(results, f, indent=2)
+
+        upload_results(session, token, ts_id, vs_id, results, size_constraint)
+
+        final  = poll_results(session, token, ts_id, vs_id)
+        info   = final[1] if isinstance(final, list) and len(final) > 1 else final
+        # Server uses "disposition": "passed"/"failed"; per-test field is "result": "passed"/"failed"
+        disposition = info.get("disposition", "")
+        passed = disposition == "passed"
+        failed_tcs = sum(
+            1 for tc in info.get("tests", [])
+            if tc.get("result", "passed") != "passed"
+        )
+        label = "PASS" if passed else "FAIL"
+        print(f"[{label}] VS {vs_id}  disposition={disposition}  failed_tcs={failed_tcs}")
+        if not passed:
+            all_passed = False
+
+    if not args.production:
+        print("[*] Sample session — skipping certify (not allowed for sample sessions)")
+    else:
+        certify_session(session, token, ts_id)
+
+    print()
+    print("=" * 60)
+    print(f"{'ALL PASSED' if all_passed else 'ONE OR MORE FAILED'} — session {ts_id}")
+    sys.exit(0 if all_passed else 1)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/deps/openssl/openssl/util/analyze-contention-log.sh b/deps/openssl/openssl/util/analyze-contention-log.sh
new file mode 100755
index 00000000000..0051df21df1
--- /dev/null
+++ b/deps/openssl/openssl/util/analyze-contention-log.sh
@@ -0,0 +1,106 @@
+#!/bin/bash -eu
+# Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").
+# You may not use this file except in compliance with the License.
+# You can obtain a copy in the file LICENSE in the source distribution
+# or at https://www.openssl.org/source/license.html
+#
+# Script to analyze logs produced by REPORT_RWLOCK_CONTENTION
+# Usage: ./analyze-contention-log.sh <logfile>
+###################################################################
+
+#
+# Setup a temp directory to massage our log file
+#
+TEMPDIR=$(mktemp -d /tmp/contention.XXXXXX)
+
+trap "rm -rf $TEMPDIR" EXIT
+
+echo "Splitting files" > /dev/stderr
+
+#
+#start by splitting the log into separate stack traces
+#
+mkdir "$TEMPDIR/individual_files"
+cat "$@" > "$TEMPDIR/individual_files/log"
+pushd $TEMPDIR/individual_files/ > /dev/null
+awk '
+    BEGIN {RS = ""; FS = "\n"}
+    {file_num++; print > ("stacktrace" file_num ".txt")}' ./log
+popd > /dev/null
+rm -f $TEMPDIR/individual_files/log
+
+#
+# Make some associative arrays to track our stats
+#
+declare -A filenames
+declare -A total_latency
+declare -A latency_counts
+
+echo "Gathering latencies" > /dev/stderr
+FILECOUNT=$(ls $TEMPDIR/individual_files/stacktrace*.* | wc -l)
+currentidx=0
+
+#
+# Look at every stack trace, get and record its latency, and hash value
+#
+for i in $(ls $TEMPDIR/individual_files/stacktrace*.*)
+do
+    LATENCY=$(awk '{print $6}' $i)
+    #drop the non-stacktrace line
+    sed -i -e"s/lock blocked on.*//" $i
+    #now compute its sha1sum
+    SHA1SUM=$(sha1sum $i | awk '{print $1}')
+    filenames["$SHA1SUM"]=$i
+    CUR_LATENCY=0
+    LATENCY_COUNT=0
+
+    #
+    # If we already have a latency total for this hash value
+    # fetch it from the total_latency array, along with
+    # the number of times we've encountered this hash
+    #
+    if [[ -v total_latency["$SHA1SUM"] ]]
+    then
+        CUR_LATENCY=${total_latency["$SHA1SUM"]}
+        LATENCY_COUNT=${latency_counts["$SHA1SUM"]}
+    fi
+
+    #
+    # Add this files latency to the hashes total latency amount
+    # and increment its associated count by 1
+    #
+    total_latency["$SHA1SUM"]=$(dc -e "$CUR_LATENCY $LATENCY + p")
+    latency_counts["$SHA1SUM"]=$(dc -e "$LATENCY_COUNT 1 + p")
+    echo -e -n "FILE $currentidx/$FILECOUNT \r" > /dev/stderr
+    currentidx=$((currentidx + 1))
+done
+
+#
+# Write out each latency in the hash array to a file named after its total latency
+#
+mkdir $TEMPDIR/sorted_latencies/
+for i in ${!total_latency[@]}
+do
+    TOTAL=${total_latency[$i]}
+    COUNT=${latency_counts[$i]}
+    FNAME=${filenames[$i]}
+    AVG=$(dc -e "6 k $TOTAL $COUNT / p")
+    echo "Total latency $TOTAL usec, count $COUNT (avg $AVG usec)" >> $TEMPDIR/sorted_latencies/$TOTAL.txt
+    cat $FNAME >> $TEMPDIR/sorted_latencies/$TOTAL.txt
+done
+
+#
+# Now because we have our cumulative latencies recorded in files named
+# after their total cumulative latency, we can easily do a numerical
+# sort on them in reverse order to display them from greatest to least
+#
+echo "Top latencies"
+for i in $(ls $TEMPDIR/sorted_latencies/ | sort -n -r)
+do
+    echo "============================================="
+    cat $TEMPDIR/sorted_latencies/$i
+    echo ""
+done
+
diff --git a/deps/openssl/openssl/util/check-news-changes.sh b/deps/openssl/openssl/util/check-news-changes.sh
new file mode 100755
index 00000000000..fec2a318b88
--- /dev/null
+++ b/deps/openssl/openssl/util/check-news-changes.sh
@@ -0,0 +1,81 @@
+#!/bin/bash
+
+# Copyright 2025-2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").
+# You may not use this file except in compliance with the License.
+# You can obtain a copy in the file LICENSE in the source distribution
+# or at https://www.openssl.org/source/license.html
+
+#
+# This script scans a commit range for common things in prs that we normally
+# expect to come with a CHANGE.md or NEWS.md entry.  Its meant to be run prior
+# to the release process to aid in the capturing on PR's that got merged without
+# a corresponding CHANGES/NEWS entry. Arguments are two tree references to scan between
+# looking for PR's that (a) didn't add a NEWS/CHANGES entry and (b) have attributes that
+# make them look like they might require one
+#
+
+BASE_REF=$(git rev-parse $1)
+HEAD_REF=$(git rev-parse $2)
+
+TEMPDIR=$(mktemp -d /tmp/CHECKCHANGES.XXXXXX)
+
+trap "rm -rf $TEMPDIR" EXIT
+
+check_for_news_changes_update() {
+    local COMMITS_FILE=$TEMPDIR/$1/commits
+
+    for commit in $(cat $COMMITS_FILE); do
+        git show --pretty="format:" --name-only $commit | grep -q "NEWS\.md"
+        if [ $? -eq 0 ]; then
+            echo "FOUND"
+            return
+        fi
+        git show --pretty="format:" --name-only $commit | grep -q "CHANGES\.md"
+        if [ $? -eq 0 ]; then
+            echo "FOUND"
+            return
+       fi
+    done
+    echo "SCAN"
+}
+
+scan_pr_for_news_changes_needs() {
+    local COMMITS_FILE=$TEMPDIR/$1/commits
+    local pr=$2
+
+    for commit in $(cat $COMMITS_FILE); do
+        # Check for the CVE keyword in the commit
+        git show --no-patch --pretty=format:"%B" $commit | grep -q "CVE-"
+        if [ $? -eq 0 ]; then
+            echo "$pr references a CVE in commit $commit, probably needs a CHANGES.md entry"
+            return
+        fi
+
+        # Check for public api and config script modifications
+        git show --pretty="format:" --name-only $commit | grep -q "include/openssl"
+        if [ $? -eq 0 ]; then
+            echo "$pr modifies headers in include/openssl in commit $commit, probably needs a CHANGES.md entry"
+            return
+        fi
+        git show --pretty="format:" --name-only $commit | grep -q "Configure"
+        if [ $? -eq 0 ]; then
+            echo "$pr modifies ./Configure in commit $commit, probably needs a CHANGES.md entry"
+            return
+        fi
+
+    done
+}
+
+git log $BASE_REF..$HEAD_REF | grep "Merged from" | sort | uniq | awk '{print $3}' | sed -e"s/)//" > $TEMPDIR/prs
+
+for pr in $(cat $TEMPDIR/prs); do
+    PRNUM=$(basename $pr)
+    mkdir $TEMPDIR/$PRNUM
+    git log --reverse --format=%H --grep="$pr" $BASE_REF..$HEAD_REF > $TEMPDIR/$PRNUM/commits
+    FOUND=$(check_for_news_changes_update $PRNUM)
+    if [ "$FOUND" == "SCAN" ]; then
+        scan_pr_for_news_changes_needs $PRNUM $pr
+    fi
+done
diff --git a/deps/openssl/openssl/util/ck_errf.pl b/deps/openssl/openssl/util/ck_errf.pl
index 681535e7200..a77eac56d70 100755
--- a/deps/openssl/openssl/util/ck_errf.pl
+++ b/deps/openssl/openssl/util/ck_errf.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -80,6 +80,33 @@ if ( $internal ) {
     @source = @ARGV;
 }

+# util/mkerr.pl keeps a stamp file next to its statefile recording the
+# last completed error-code pass over the tree.  While the stamp is
+# newer than the config file, the statefile and every source file,
+# this check has already run against the current tree; skip the scan.
+# (If the config file names its statefile with an S line, this
+# derivation misses it and the check simply never skips.)
+if ( !$debug ) {
+    my $statefile = $config;
+
+    $statefile =~ s/\.ec$/.txt/;
+    my $stamp = (stat "$statefile.stamp")[9];
+
+    if ( defined $stamp ) {
+        my $uptodate = 1;
+
+        foreach my $file ( $config, $statefile, @source ) {
+            my $mtime = (stat $file)[9];
+
+            if ( !defined $mtime || $mtime >= $stamp ) {
+                $uptodate = 0;
+                last;
+            }
+        }
+        exit 0 if $uptodate;
+    }
+}
+
 # To detect if there is any error generation for a libcrypto/libssl libs
 # we don't know, we need to find out what libs we do know.  That list is
 # readily available in crypto/err/openssl.ec, in form of lines starting
diff --git a/deps/openssl/openssl/util/ctags.sh b/deps/openssl/openssl/util/ctags.sh
index 60fa5369297..cfc94a0d7c1 100755
--- a/deps/openssl/openssl/util/ctags.sh
+++ b/deps/openssl/openssl/util/ctags.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -26,7 +26,7 @@ if ! type "${CTAGS}" > /dev/null; then
 fi

 if [ $# -eq 0 ]; then
-    set - -R
+    set -- -R
 fi

 if ! "${CTAGS}" --version | grep -q "Universal Ctags"; then
diff --git a/deps/openssl/openssl/util/engines.num b/deps/openssl/openssl/util/engines.num
deleted file mode 100644
index 4fc4e001df4..00000000000
--- a/deps/openssl/openssl/util/engines.num
+++ /dev/null
@@ -1,2 +0,0 @@
-bind_engine                            1	*	EXIST::FUNCTION:
-v_check                                2	*	EXIST::FUNCTION:
diff --git a/deps/openssl/openssl/util/err-to-raise b/deps/openssl/openssl/util/err-to-raise
index 174686d3ab1..4eb9159536b 100755
--- a/deps/openssl/openssl/util/err-to-raise
+++ b/deps/openssl/openssl/util/err-to-raise
@@ -13,9 +13,6 @@
 # Consider running util/merge-err-lines first, to catch most (all?) of the
 # cases where the XXXerr() call is split into two lines.

-# Do not use this in engines/, they have their own error reporting functions,
-# which do call ERR_raise().
-
 use strict;
 use warnings;

diff --git a/deps/openssl/openssl/util/file-from-stdout.pl b/deps/openssl/openssl/util/file-from-stdout.pl
new file mode 100644
index 00000000000..8c4946e5688
--- /dev/null
+++ b/deps/openssl/openssl/util/file-from-stdout.pl
@@ -0,0 +1,74 @@
+#! /usr/bin/env perl
+# Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+use strict;
+use warnings;
+
+# Run a command and make its standard output into a file, in place of the
+# shell's ">".  The output is collected in a temporary file and renamed over
+# the target once the command has succeeded, so a failing command leaves the
+# previous target rather than a truncated one with a fresh timestamp.
+#
+# The target is left read-only.  Renaming onto a read-only file needs no
+# permission on the file itself, so it can still be replaced.
+#
+# Usage: file-from-stdout.pl [-x] FILE command [args...]
+
+my $executable = 0;
+
+if (@ARGV && $ARGV[0] eq "-x") {
+    $executable = 1;
+    shift @ARGV;
+}
+
+my $target = shift @ARGV;
+
+die "Usage: $0 [-x] FILE command [args...]\n"
+    unless defined $target && @ARGV;
+
+my $temp = "$target.tmp$$";
+
+unlink $temp;
+
+open my $out, ">", $temp
+    or die "Can't write $temp, $!\n";
+
+END {
+    unlink $temp if defined $temp && -e $temp;
+}
+
+my $exec = shift @ARGV;
+open my $saved, ">&", \*STDOUT
+    or die "Can't save stdout, $!\n";
+open STDOUT, ">&", $out
+    or die "Can't redirect stdout to $temp, $!\n";
+
+my $status = system($exec, @ARGV);
+my $why = $!;
+
+open STDOUT, ">&", $saved
+    or die "Can't restore stdout, $!\n";
+close $saved;
+close $out
+    or die "Can't finish writing $temp, $!\n";
+
+if ($status != 0) {
+    my $how = $status == -1 ? "could not be run, $why"
+            : $status & 127 ? "died with signal " . ($status & 127)
+            :                 "exited with " . ($status >> 8);
+    my $code = $status == -1 || ($status & 127) ? 1 : $status >> 8;
+
+    print STDERR "$exec $how\n";
+    exit $code;
+}
+
+chmod $executable ? 0555 : 0444, $temp
+    or die "Can't set the mode of $temp, $!\n";
+
+rename $temp, $target
+    or die "Can't rename $temp to $target, $!\n";
diff --git a/deps/openssl/openssl/util/find-doc-nits b/deps/openssl/openssl/util/find-doc-nits
index 892375a1b6a..8c1a26cba5f 100755
--- a/deps/openssl/openssl/util/find-doc-nits
+++ b/deps/openssl/openssl/util/find-doc-nits
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2002-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -13,6 +13,7 @@ use strict;

 use Carp qw(:DEFAULT cluck);
 use Pod::Checker;
+use Cwd qw(realpath);
 use File::Find;
 use File::Basename;
 use File::Spec::Functions;
@@ -32,7 +33,6 @@ my $debug = 0;
 our($opt_d);
 our($opt_e);
 our($opt_s);
-our($opt_o);
 our($opt_h);
 our($opt_l);
 our($opt_m);
@@ -42,11 +42,13 @@ our($opt_u);
 our($opt_v);
 our($opt_c);
 our($opt_i);
+our($opt_a);

 # Print usage message and exit.
 sub help {
     print <<EOF;
 Find small errors (nits) in documentation.  Options:
+    -a List undocumented env vars
     -c List undocumented commands, undocumented options and unimplemented options.
     -d Detailed list of undocumented (implies -u)
     -e Detailed list of new undocumented (implies -v)
@@ -54,19 +56,18 @@ Find small errors (nits) in documentation.  Options:
     -l Print bogus links
     -m Name(s) of manuals to focus on. Default: man1,man3,man5,man7
     -n Print nits in POD pages
-    -o Causes -e/-v to count symbols added since 1.1.1 as new (implies -v)
-    -i Checks for history entries available for symbols added since 3.0.0 as new
+    -i Checks for history entries available for symbols added since 4.0.0 as new
     -u Count undocumented functions
     -v Count new undocumented functions
 EOF
     exit;
 }

-getopts('cdehlm:noiuv');
+getopts('acdehlm:niuv');

 help() if $opt_h;
 $opt_u = 1 if $opt_d;
-$opt_v = 1 if $opt_o || $opt_e;
+$opt_v = 1 if $opt_e;
 die "Cannot use both -u and -v"
     if $opt_u && $opt_v;
 die "Cannot use both -d and -e"
@@ -74,8 +75,8 @@ die "Cannot use both -d and -e"

 # We only need to check c, l, n, u and v.
 # Options d, e, o imply one of the above.
-die "Need one of -[cdehlnouv] flags.\n"
-    unless $opt_c or $opt_l or $opt_n or $opt_u or $opt_v;
+die "Need one of -[acdehlnouv] flags.\n"
+    unless $opt_a or $opt_c or $opt_l or $opt_n or $opt_u or $opt_v;


 my $temp = '/tmp/docnits.txt';
@@ -110,8 +111,64 @@ my $ignored = qr/(?| ^i2d_
                  |   ^DEFINE_LHASH_OF_(INTERNAL|DEPRECATED)
                  |   ^OSSL_HTO[BL]E(16|32|64)   # undefed
                  |   ^OSSL_[BL]E(16|32|64)TOH   # undefed
+                 |   ^ENGINE_   # TODO(ENGINE REMOVAL): Fix docs
                  )/x;

+# There are macro functions added before version 1.1.1 we don't want to track
+# in the history sections.
+my %exclude_macro_history = map { $_ => 1 } qw(
+        BIO_append_filename BIO_ctrl_dgram_connect BIO_ctrl_set_connected
+        BIO_destroy_bio_pair BIO_dgram_get_mtu BIO_dgram_get_mtu_overhead
+        BIO_dgram_get_peer BIO_dgram_recv_timedout BIO_dgram_send_timedout
+        BIO_dgram_set_peer BIO_do_accept BIO_do_connect BIO_do_handshake BIO_eof
+        BIO_flush BIO_get_accept_ip_family BIO_get_accept_name
+        BIO_get_accept_port BIO_get_app_data BIO_get_bind_mode
+        BIO_get_buffer_num_lines BIO_get_cipher_ctx BIO_get_cipher_status
+        BIO_get_close BIO_get_conn_hostname BIO_get_conn_ip_family
+        BIO_get_conn_port BIO_get_ex_new_index BIO_get_fd BIO_get_fp
+        BIO_get_info_callback BIO_get_mem_data BIO_get_mem_ptr
+        BIO_get_num_renegotiates BIO_get_peer_name BIO_get_peer_port
+        BIO_get_read_request BIO_get_ssl BIO_get_write_buf_size
+        BIO_get_write_guarantee BIO_make_bio_pair BIO_pending BIO_read_filename
+        BIO_reset BIO_rw_filename BIO_seek BIO_set_accept_bios
+        BIO_set_accept_ip_family BIO_set_accept_name BIO_set_accept_port
+        BIO_set_app_data BIO_set_bind_mode BIO_set_buffer_read_data
+        BIO_set_buffer_size BIO_set_close BIO_set_conn_hostname
+        BIO_set_conn_ip_family BIO_set_conn_port BIO_set_fd BIO_set_fp
+        BIO_set_info_callback BIO_set_md BIO_set_mem_buf BIO_set_mem_eof_return
+        BIO_set_nbio BIO_set_nbio_accept BIO_set_read_buffer_size BIO_set_ssl
+        BIO_set_ssl_mode BIO_set_ssl_renegotiate_bytes
+        BIO_set_ssl_renegotiate_timeout BIO_set_write_buf_size
+        BIO_set_write_buffer_size BIO_shutdown_wr BIO_tell BIO_wpending
+        BIO_write_filename BN_mod BN_num_bytes BN_one EVP_OpenUpdate
+        EVP_SealUpdate OPENSSL_clear_free OPENSSL_clear_realloc OPENSSL_free
+        OPENSSL_malloc OPENSSL_malloc_init OPENSSL_memdup OPENSSL_realloc
+        OPENSSL_strdup OPENSSL_strndup OPENSSL_zalloc
+        SSL_CTX_add_extra_chain_cert SSL_CTX_clear_extra_chain_certs
+        SSL_CTX_clear_mode SSL_CTX_disable_ct SSL_CTX_get_default_read_ahead
+        SSL_CTX_get_extra_chain_certs SSL_CTX_get_extra_chain_certs_only
+        SSL_CTX_get_max_cert_list SSL_CTX_get_mode SSL_CTX_get_read_ahead
+        SSL_CTX_get_session_cache_mode SSL_CTX_sess_accept
+        SSL_CTX_sess_accept_good SSL_CTX_sess_accept_renegotiate
+        SSL_CTX_sess_cache_full SSL_CTX_sess_cb_hits SSL_CTX_sess_connect
+        SSL_CTX_sess_connect_good SSL_CTX_sess_connect_renegotiate
+        SSL_CTX_sess_get_cache_size SSL_CTX_sess_hits SSL_CTX_sess_misses
+        SSL_CTX_sess_number SSL_CTX_sess_set_cache_size SSL_CTX_sess_timeouts
+        SSL_CTX_set_dh_auto SSL_CTX_set_ecdh_auto SSL_CTX_set_max_cert_list
+        SSL_CTX_set_mode SSL_CTX_set_msg_callback_arg SSL_CTX_set_read_ahead
+        SSL_CTX_set_session_cache_mode SSL_CTX_set_tlsext_servername_arg
+        SSL_CTX_set_tlsext_servername_callback SSL_CTX_set_tmp_dh
+        SSL_CTX_set_tmp_ecdh SSL_clear_mode SSL_disable_ct SSL_get_cipher
+        SSL_get_cipher_bits SSL_get_cipher_name SSL_get_cipher_version
+        SSL_get_extms_support SSL_get_max_cert_list SSL_get_mode
+        SSL_get_peer_signature_nid SSL_get_secure_renegotiation_support
+        SSL_get_server_tmp_key SSL_get_time SSL_get_timeout SSL_in_accept_init
+        SSL_in_connect_init SSL_set_dh_auto SSL_set_ecdh_auto
+        SSL_set_max_cert_list SSL_set_mode SSL_set_msg_callback_arg SSL_set_time
+        SSL_set_timeout SSL_set_tlsext_host_name SSL_set_tmp_dh SSL_set_tmp_ecdh
+        SSL_want_async SSL_want_async_job SSL_want_nothing SSL_want_read
+        SSL_want_write SSL_want_x509_lookup X509_LOOKUP_add_dir);
+
 # A common regexp for C symbol names
 my $C_symbol = qr/\b[[:alpha:]][_[:alnum:]]*\b/;

@@ -882,10 +939,11 @@ my %name_map = ();
 # 'other' : belongs in libcrypto or libssl (loaded from other.syms)
 # 'internal' : Internal
 # 'public' : Public (generic name or external documentation)
+# 'macro_functions' : Used to check history of macro functions
 # Any of these values except 'public' may be prefixed with 'missing_'
 # to indicate that they are known to be missing.
 my %state;
-# history contains the same as state above for entries with version info != 3_0_0
+# history contains the same as state above for entries with version info != 4_0_0
 my %history;
 # %missing is affected by loading util/missing*.txt.  Values may be one of:
 # 'crypto' : belongs in libcrypto (loaded from libcrypto.num)
@@ -893,6 +951,13 @@ my %history;
 # 'other' : belongs in libcrypto or libssl (loaded from other.syms)
 # 'internal' : Internal
 my %missing;
+# A list of definitions which may be function names.
+# This reads util/other.syms to get the public names and checks which of them
+# are functions in `checkmacros` function
+my @history_maybe_macro_functions;
+# The list of macros found by checking defines in our header files
+# Saves the filename for error handling purposes
+my %macros_maybe_undocumented;

 # Parse libcrypto.num, etc., and return sorted list of what's there.
 sub loadnum ($;$) {
@@ -909,10 +974,14 @@ sub loadnum ($;$) {
         my @fields = split();
         if ($type && ($type eq "crypto" || $type eq "ssl")) {
             # 3rd field is version
-            if (not $fields[2] eq "3_0_0") {
+            if (not $fields[2] eq "4_0_0") {
                 $history{$fields[0].'(3)'} = $type.$fields[2];
             }
         }
+        if ($type && $type eq "other" && $fields[1] eq "define" &&
+            scalar @fields == 2) {
+            push(@history_maybe_macro_functions, $fields[0]);
+        }
         die "Malformed line $. in $file: $_"
             if scalar @fields != 2 && scalar @fields != 4;
         $state{$fields[0].'(3)'} = $type // 'internal';
@@ -963,12 +1032,9 @@ sub checkstate () {
     }
 }

-# Check for undocumented macros; ignore those in the "missing" file
-# and do simple check for #define in our header files.
+# Check for undocumented and history of macros; ignore those in the
+# "missing" file and do simple check for #define in our header files.
 sub checkmacros {
-    my $count = 0;
-    my %seen;
-
     foreach my $f ( files(TAGS => 'public_header') ) {
         # Skip some internals we don't want to document yet.
         my $b = basename($f);
@@ -980,18 +1046,36 @@ sub checkmacros {
         while ( <IN> ) {
             next unless /^#\s*define\s*(\S+)\(/;
             my $macro = "$1(3)"; # We know they're all in section 3
-            next if defined $name_map{$macro}
-                || defined $missing{$macro}
-                || defined $seen{$macro}
+
+            next if defined $missing{$macro}
+                || exists $exclude_macro_history{$1}
                 || $macro =~ /$ignored/;

-            err("$f:", "macro $macro undocumented")
-                if $opt_d || $opt_e;
-            $count++;
-            $seen{$macro} = 1;
+            if ($opt_i && grep {$_ eq $1} @history_maybe_macro_functions) {
+                $history{$macro} = "macro_functions";
+                $state{$macro} = "macro_functions";
+            }
+
+            next if defined $macros_maybe_undocumented{$macro};
+
+            $macros_maybe_undocumented{$macro} = $f;
         }
         close(IN);
     }
+}
+
+# Check remaining macros against $name_map
+# This function has to be called after checkmacros
+sub checkmacros_undocumented {
+    my $count = 0;
+
+    foreach my $m ( keys %macros_maybe_undocumented ) {
+        next if defined $name_map{$m};
+        err("$macros_maybe_undocumented{$m}:", "macro $m undocumented")
+            if $opt_d || $opt_e;
+        $count++;
+    }
+
     err("# $count macros undocumented (count is approximate)")
         if $count > 0;
 }
@@ -1193,6 +1277,150 @@ sub checkflags {
     }
 }

+sub check_env_vars {
+    # initialized with the list of "untracable" variables
+    my %env_list = ("SSL_CERT_FILE" => 1);
+    my @env_files;
+    my @except_dirs = (
+        "$config{sourcedir}/demos",
+        "$config{sourcedir}/test",
+    );
+    my @except_env_files = (
+        "$config{sourcedir}/providers/implementations/kem/template_kem.c",
+        # The following files are generated, and are therefore found in the
+        # build directory rather than the source directory
+        "$config{builddir}/providers/implementations/keymgmt/template_kmgmt.c",
+        "$config{builddir}/Makefile.in",
+    );
+    my @env_headers;
+    my @env_macro;
+
+    if (open my $gs_file, '<', "$config{sourcedir}/.gitmodules") {
+        while (<$gs_file>) {
+            s/\R$//; # better chomp
+            if ($_ =~ /\s*path\s*=\s*(.*)$/) {
+                print STDERR "DEBUG[check_env_vars]: adding "
+                             . "\"$config{sourcedir}/$1\" to except_dirs\n"
+                    if $debug;
+                push @except_dirs, "$config{sourcedir}/$1";
+            }
+        }
+    }
+
+    # Because we compare against them, make sure that all elements in
+    # @except_dirs and @except_env_files are real paths.  Otherwise,
+    # we may get false positives because relative paths to the same
+    # file could look different.
+    # For example, './foo.c' == '../dir/foo.c', but turning them into
+    # real paths will have them actually look the same.
+    @except_dirs = map { realpath($_) } @except_dirs;
+    @except_env_files = map { realpath($_) } @except_env_files;
+
+    # look for source files
+    my $git_ok = 0;
+    open my $glf_pipe, '-|', "git ls-files -- \"$config{sourcedir}\"";
+    while (<$glf_pipe>) {
+        $git_ok = 1;
+        s/\R$//; # better chomp
+        push @env_files, $_ if /\.c$|\.in$/;
+    }
+    close $glf_pipe;
+    # git call has failed, trying to find files manually
+    if (!$git_ok) {
+        find(sub { push @env_files, $File::Find::name if /\.c$|\.in$/; },
+             $config{sourcedir});
+    }
+
+    foreach my $filename (@env_files) {
+        my $realfilename = realpath($filename);
+        next if (grep { $realfilename =~ /^$_\// } @except_dirs)
+                || grep { $_ eq $realfilename } @except_env_files;
+
+        open my $fh, '<', $filename or die "Can't open $filename: $!";
+        while (my $line = <$fh>) {
+            # for windows
+            # for .in files
+            push @{$env_list{$1}}, "${filename}:$."
+                if ($line =~ /GetEnvironmentVariableW\([\s\S]*"([^"]+)",/
+                    || $line =~ /\$ENV\{([^}"']+)\}/);
+            # this also handles ossl_safe_getenv
+            if ($line =~ /getenv\(([^()\s]+)\)/) {
+                my $env1 = $1;
+                if ($env1 =~ /"([^"]+)"/) {
+                    push @{$env_list{$1}}, "${filename}:$.";
+                } elsif ($env1 =~ /([A-Z0-9_])/) {
+                    push(@env_macro, $env1);
+                }
+            }
+            # match ternary operators; $1 - true, $2 - false
+            if ($line =~ /env\(\s*[^?]+\?\s*([^:( ]+)\s*:\s*([^(]+)\s*\)/) {
+                my ($env1, $env2) = ($1, $2);
+                # if it's a string just add to the list
+                # otherwise look for the constant value later
+                if ($env1 =~ /"([^"]+)"/) {
+                    push @{$env_list{$1}}, "${filename}:$.";
+                } else {
+                    push(@env_macro, $env1);
+                }
+                if ($env2 =~ /"([^"]+)"/) {
+                    push @{$env_list{$1}}, "${filename}:$.";
+                } else {
+                    push(@env_macro, $env2);
+                }
+            }
+        }
+        close $fh;
+    }
+
+    # look for constants in header files
+    find(sub { push @env_headers, $File::Find::name if /\.h$/; },
+         $config{sourcedir});
+
+    foreach my $filename (@env_headers) {
+        open my $fh, '<', $filename or die "Can't open $filename: $!";
+        while (my $line = <$fh>) {
+            foreach my $em (@env_macro) {
+                push @{$env_list{$1}}, "${filename}:$."
+                    if ($line =~ /define\s+\Q$em\E\s+"(\S+)"/);
+            }
+        }
+    }
+
+    # need to save the value before starting to delete from the hash
+    my $number_of_env = scalar keys %env_list;
+
+    # check for env vars in pod files
+    foreach ( files(TAGS => [ 'manual' ]) ) {
+        my %podinfo = extract_pod_info($_, { debug => $debug });
+        my $contents = $podinfo{contents};
+
+        # openssl-env.pod does not have ENVIRONMENT section, but the whole file
+        # is about environment variables
+        if ( $contents =~ /=head1 ENVIRONMENT(.*)=head1/ms ) {
+            $contents = $1;
+        } elsif ( $_ !~ /openssl-env.pod/ ) {
+            next;
+        }
+
+        for my $env_name (keys %env_list) {
+            delete($env_list{$env_name}) if $contents =~ $env_name;
+        }
+    }
+
+    print "Number of env vars found:".$number_of_env."\n" if $debug;
+    $number_of_env = scalar keys %env_list;
+    if ($number_of_env != 0) {
+        print "Undocumented environment variables:\n";
+        foreach my $env_name (sort keys %env_list) {
+            print $env_name;
+            print " (found in '", join("', '", @{$env_list{$env_name}}), "')"
+                if ref $env_list{$env_name} eq 'ARRAY';
+            print "\n";
+        }
+        err("Total:".$number_of_env."\n");
+    }
+}
+
 ##
 ##  MAIN()
 ##  Do the work requested by the various getopt flags.
@@ -1244,11 +1472,7 @@ loadnum('util/libcrypto.num', 'crypto');
 loadnum('util/libssl.num', 'ssl');
 loadnum('util/other.syms', 'other');
 loadnum('util/other-internal.syms');
-if ( $opt_o ) {
-    loadmissing('util/missingmacro111.txt', 'crypto');
-    loadmissing('util/missingcrypto111.txt', 'crypto');
-    loadmissing('util/missingssl111.txt', 'ssl');
-} elsif ( !$opt_u ) {
+if ( !$opt_u ) {
     loadmissing('util/missingmacro.txt', 'crypto');
     loadmissing('util/missingcrypto.txt', 'crypto');
     loadmissing('util/missingssl.txt', 'ssl');
@@ -1256,6 +1480,12 @@ if ( $opt_o ) {
     loadmissing('util/missingssl-internal.txt');
 }

+# Load the list of macros that are missing from history section
+# and save the remaining macros for checking of undocumentation
+if ( $opt_u || $opt_v) {
+    checkmacros();
+}
+
 if ( $opt_n || $opt_l || $opt_u || $opt_v ) {
     my @files_to_read = ( $opt_n && @ARGV ) ? @ARGV : files(TAGS => 'manual');

@@ -1285,12 +1515,17 @@ if ( $opt_n ) {
     }
 }

+if ( $opt_a ) {
+    check_env_vars();
+}
+
 checkstate();

 if ( $opt_u || $opt_v) {
     printem('crypto');
     printem('ssl');
-    checkmacros();
+    checkmacros_undocumented();
+    printem('macro_functions');
 }

 exit $status;
diff --git a/deps/openssl/openssl/util/fix-includes.sed b/deps/openssl/openssl/util/fix-includes.sed
index db66809a197..60b64ed69c2 100644
--- a/deps/openssl/openssl/util/fix-includes.sed
+++ b/deps/openssl/openssl/util/fix-includes.sed
@@ -1,5 +1,5 @@
 s|internal/([a-z0-9_]+)_int\.h|crypto/\1.h|g ;
-s@internal/(aria.h|asn1_dsa.h|async.h|bn_conf.h|bn_conf.h|bn_dh.h|bn_srp.h|chacha.h|(aes|des|cmll)_platform.h|ctype.h|__DECC_INCLUDE_EPILOGUE.H|__DECC_INCLUDE_PROLOGUE.H|dso_conf.h|dso_conf.h|engine.h|lhash.h|md32_common.h|objects.h|poly1305.h|sha.h|siphash.h|sm2err.h|sm2.h|sm4.h|sparse_array.h|store.h|foobar)@crypto/\1@g ;
+s@internal/(aria.h|asn1_dsa.h|async.h|bn_dh.h|bn_srp.h|chacha.h|(aes|des|cmll)_platform.h|ctype.h|__DECC_INCLUDE_EPILOGUE.H|__DECC_INCLUDE_PROLOGUE.H|dso_conf.h|dso_conf.h|lhash.h|objects.h|poly1305.h|sha.h|siphash.h|sm2err.h|sm2.h|sm4.h|sparse_array.h|store.h|foobar)@crypto/\1@g ;
 s/constant_time_locl/constant_time/g ;
 s/_lo?cl\.h/_local.h/g ;
 s/_int\.h/_local.h/g ;
diff --git a/deps/openssl/openssl/util/help.pl b/deps/openssl/openssl/util/help.pl
index a1614fe8a98..c13c669ccd3 100755
--- a/deps/openssl/openssl/util/help.pl
+++ b/deps/openssl/openssl/util/help.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -14,7 +14,7 @@ while (<>) {
     chomp;	# strip record separator
     @Fld = split($FS, $_, -1);
     if (/^[a-zA-Z0-9_\-]+:.*?##/) {
-	printf "  \033[36m%-15s\033[0m %s\n", $Fld[0], $Fld[1]
+	printf "  \033[36m%-19s\033[0m %s\n", $Fld[0], $Fld[1]
     }
     if (/^##@/) {
 	printf "\n\033[1m%s\033[0m\n", substr($Fld[$_], (5)-1);
diff --git a/deps/openssl/openssl/util/indent.pro b/deps/openssl/openssl/util/indent.pro
index bc626e4a4bc..16ff4afb968 100644
--- a/deps/openssl/openssl/util/indent.pro
+++ b/deps/openssl/openssl/util/indent.pro
@@ -123,6 +123,7 @@
 -T CMAC_CTX
 -T CMS_AuthenticatedData
 -T CMS_CertificateChoices
+-T CMS_CMSORIforKEMOtherInfo
 -T CMS_CompressedData
 -T CMS_ContentInfo
 -T CMS_DigestedData
@@ -133,6 +134,7 @@
 -T CMS_IssuerAndSerialNumber
 -T CMS_KEKIdentifier
 -T CMS_KEKRecipientInfo
+-T CMS_KEMRecipientInfo
 -T CMS_KeyAgreeRecipientIdentifier
 -T CMS_KeyAgreeRecipientInfo
 -T CMS_KeyTransRecipientInfo
@@ -205,22 +207,6 @@
 -T EC_PRIVATEKEY
 -T EC_builtin_curve
 -T EDIPARTYNAME
--T ENGINE
--T ENGINE_CIPHERS_PTR
--T ENGINE_CLEANUP_CB
--T ENGINE_CLEANUP_ITEM
--T ENGINE_CMD_DEFN
--T ENGINE_CTRL_FUNC_PTR
--T ENGINE_DIGESTS_PTR
--T ENGINE_GEN_FUNC_PTR
--T ENGINE_GEN_INT_FUNC_PTR
--T ENGINE_LOAD_KEY_PTR
--T ENGINE_PILE
--T ENGINE_PILE_DOALL
--T ENGINE_PKEY_ASN1_METHS_PTR
--T ENGINE_PKEY_METHS_PTR
--T ENGINE_SSL_CLIENT_CERT_PTR
--T ENGINE_TABLE
 -T ENUMERATED_NAMES
 -T ERR_STATE
 -T ERR_STRING_DATA
@@ -526,8 +512,6 @@
 -T STACK_OF_CONF_VALUE_
 -T STACK_OF_CRYPTO_dynlock_
 -T STACK_OF_DIST_POINT_
--T STACK_OF_ENGINE_
--T STACK_OF_ENGINE_CLEANUP_ITEM_
 -T STACK_OF_ESS_CERT_ID_
 -T STACK_OF_ESS_CERT_ID_V2_
 -T STACK_OF_EVP_PBE_CTL_
@@ -588,7 +572,6 @@
 -T STACK_OF_void_
 -T LHASH_OF_ADDED_OBJ_
 -T LHASH_OF_CONF_VALUE_
--T LHASH_OF_ENGINE_PILE_
 -T LHASH_OF_ERR_STATE_
 -T LHASH_OF_ERR_STRING_DATA_
 -T LHASH_OF_FUNCTION_
@@ -600,6 +583,8 @@
 -T clock_t
 -T custom_ext_methods
 -T hm_fragment
+-T dtls_msg_info
+-T dtls_sent_msg
 -T ssl_ctx_st
 -T ssl_flag_tbl
 -T ssl_st
@@ -636,7 +621,5 @@
 -T ossl_uintmax_t
 -T ossl_uintmax_t
 -T CT_POLICY_EVAL_CTX
--T RAND_DRBG
--T RAND_DRBG_CTR
 -T RAND_POOL
 -T RAND_METHOD
diff --git a/deps/openssl/openssl/util/install-files.pl b/deps/openssl/openssl/util/install-files.pl
new file mode 100644
index 00000000000..5028fe38e56
--- /dev/null
+++ b/deps/openssl/openssl/util/install-files.pl
@@ -0,0 +1,40 @@
+#! /usr/bin/env perl
+# Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+require 5.10.0;
+use warnings;
+use strict;
+
+use File::Basename;
+use File::Compare;
+use File::Copy;
+
+# Install a set of files into one directory in a single process,
+# replacing only the files whose content changed; an installed file
+# that is already identical keeps its timestamp, so consumers that
+# build against the installed tree do not see it as modified.
+
+if ($#ARGV + 1 < 2) {
+    print STDERR "Usage: install-files.pl mode target-dir [file...]\n";
+    exit 1;
+}
+
+my ($mode, $targetdir, @files) = @ARGV;
+
+$mode = oct($mode);
+
+foreach my $file (@files) {
+    my $target = "$targetdir/" . basename($file);
+
+    next if -f $target && compare($file, $target) == 0;
+    print "install $file -> $target\n";
+    copy($file, $target)
+        || die "Can't install $file to $target, $!\n";
+    chmod $mode, $target
+        || die "Can't chmod $target, $!\n";
+}
diff --git a/deps/openssl/openssl/util/install-man-pages.pl b/deps/openssl/openssl/util/install-man-pages.pl
new file mode 100644
index 00000000000..ef7d712eafc
--- /dev/null
+++ b/deps/openssl/openssl/util/install-man-pages.pl
@@ -0,0 +1,88 @@
+#! /usr/bin/env perl
+# Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+require 5.10.0;
+use warnings;
+use strict;
+
+use File::Basename;
+use File::Compare;
+use File::Copy;
+use FindBin;
+use lib "$FindBin::Bin/perl";
+
+use OpenSSL::Util::Pod;
+
+# Install or uninstall a whole man section's pages and their NAME
+# symlinks in a single process; one process per page does not scale
+# to the number of pages OpenSSL installs.
+
+if ($#ARGV + 1 < 5 || $ARGV[0] !~ /^(un)?install$/) {
+    print STDERR
+        "Usage: install-man-pages.pl [install|uninstall] src-dir build-dir target-dir man-suffix [man-page-file...]\n";
+    exit 1;
+}
+
+my ($action, $srcdir, $builddir, $targetdir, $suffix, @files) = @ARGV;
+
+foreach my $file (@files) {
+    my $manname = basename($file);
+
+    $manname =~ m|(.+)\.(.+)|;
+    my $mainf = $1;
+    my $section = $2;
+    die "Bad man page name $file\n" if !defined $mainf;
+
+    my $target = "$targetdir/$manname$suffix";
+
+    if ($action eq "install") {
+        # A page is a regular file; a symlink here is a leftover alias,
+        # and copying would write this page over the one it points to.
+        unlink $target if -l $target;
+
+        next if -f $target && compare($file, $target) == 0;
+
+        print "install $file -> $target\n";
+        copy($file, $target)
+            || die "Can't install $file to $target, $!\n";
+        chmod 0644, $target
+            || die "Can't chmod $target, $!\n";
+    } else {
+        print "rm -f $target\n";
+        unlink $target;
+    }
+
+    my $podfile = "$srcdir/$mainf.pod";
+    # Some pod files are generated and are in the build dir
+    unless (-e $podfile) {
+        $podfile = "$builddir/$mainf.pod";
+    }
+    my %podinfo = extract_pod_info($podfile);
+
+    for my $name (@{$podinfo{names}}) {
+        next if $name eq $mainf;
+        my $link = "$targetdir/$name.$section$suffix";
+        my $linktarget = "$manname$suffix";
+
+        next if $action eq "install"
+            && -l $link && readlink($link) eq $linktarget;
+
+        # An alias can collide with an installed page on a
+        # case-insensitive file system (OSSL_TRACE_ENABLED alongside
+        # OSSL_trace_enabled), where unlinking the alias would remove
+        # the page and the symlink would point to itself.  Never
+        # remove anything that is not a symlink, and skip an alias
+        # whose name is already occupied.
+        unlink $link if -l $link;
+        if ($action eq "install") {
+            symlink $linktarget, $link
+                || warn "Can't symlink $link to $linktarget, $!\n"
+                unless -e $link;
+        }
+    }
+}
diff --git a/deps/openssl/openssl/util/libcrypto.num b/deps/openssl/openssl/util/libcrypto.num
index ceb4948839a..557d995a912 100644
--- a/deps/openssl/openssl/util/libcrypto.num
+++ b/deps/openssl/openssl/util/libcrypto.num
@@ -1,5926 +1,5735 @@
-d2i_EC_PUBKEY                           1	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-b2i_PVK_bio                             2	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_NETSCAPE_CERT_SEQUENCE     3	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get0_chain               4	3_0_0	EXIST::FUNCTION:
-COMP_expand_block                       5	3_0_0	EXIST::FUNCTION:COMP
-X509V3_get_string                       6	3_0_0	EXIST::FUNCTION:
-TS_MSG_IMPRINT_free                     7	3_0_0	EXIST::FUNCTION:TS
-DES_xcbc_encrypt                        8	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-TS_RESP_CTX_new                         9	3_0_0	EXIST::FUNCTION:TS
-PKCS5_PBE_add                           10	3_0_0	EXIST::FUNCTION:
-i2d_DSAparams                           11	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-X509_NAME_get0_der                      12	3_0_0	EXIST::FUNCTION:
-i2d_ESS_ISSUER_SERIAL                   13	3_0_0	EXIST::FUNCTION:
-X509at_get_attr_by_NID                  14	3_0_0	EXIST::FUNCTION:
-X509_PUBKEY_set0_param                  15	3_0_0	EXIST::FUNCTION:
-PKCS12_it                               16	3_0_0	EXIST::FUNCTION:
-i2d_ASN1_OCTET_STRING                   17	3_0_0	EXIST::FUNCTION:
-EC_KEY_set_private_key                  18	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-SRP_VBASE_get_by_user                   19	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SRP
-Camellia_cfb128_encrypt                 21	3_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
-DES_ncbc_encrypt                        22	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-TS_REQ_get_ext_count                    23	3_0_0	EXIST::FUNCTION:TS
-EVP_aes_128_ocb                         24	3_0_0	EXIST::FUNCTION:OCB
-ASN1_item_d2i_fp                        25	3_0_0	EXIST::FUNCTION:STDIO
-BN_lshift                               26	3_0_0	EXIST::FUNCTION:
-X509_NAME_add_entry_by_NID              27	3_0_0	EXIST::FUNCTION:
-X509V3_add_value_bool                   28	3_0_0	EXIST::FUNCTION:
-GENERAL_NAME_get0_otherName             29	3_0_0	EXIST::FUNCTION:
-ASN1_INTEGER_get_uint64                 30	3_0_0	EXIST::FUNCTION:
-EVP_DigestInit_ex                       31	3_0_0	EXIST::FUNCTION:
-CTLOG_new                               32	3_0_0	EXIST::FUNCTION:CT
-UI_get_result_minsize                   33	3_0_0	EXIST::FUNCTION:
-EVP_PBE_alg_add_type                    34	3_0_0	EXIST::FUNCTION:
-EVP_cast5_ofb                           35	3_0_0	EXIST::FUNCTION:CAST
-d2i_PUBKEY_fp                           36	3_0_0	EXIST::FUNCTION:STDIO
-PKCS7_set_cipher                        37	3_0_0	EXIST::FUNCTION:
-BF_decrypt                              38	3_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
-PEM_read_bio_PUBKEY                     39	3_0_0	EXIST::FUNCTION:
-X509_NAME_delete_entry                  40	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_set_verify_recover        41	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-UI_set_method                           42	3_0_0	EXIST::FUNCTION:
-PKCS7_ISSUER_AND_SERIAL_it              43	3_0_0	EXIST::FUNCTION:
-EC_GROUP_method_of                      44	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-RSA_blinding_on                         45	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_get0_signature                     47	3_0_0	EXIST::FUNCTION:
-X509_REVOKED_get0_extensions            48	3_0_0	EXIST::FUNCTION:
-NETSCAPE_SPKI_verify                    49	3_0_0	EXIST::FUNCTION:
-i2d_OCSP_RESPONSE                       50	3_0_0	EXIST::FUNCTION:OCSP
-ERR_peek_error                          51	3_0_0	EXIST::FUNCTION:
-X509v3_asid_validate_resource_set       52	3_0_0	EXIST::FUNCTION:RFC3779
-PEM_write_bio_Parameters                53	3_0_0	EXIST::FUNCTION:
-CMS_SignerInfo_verify                   54	3_0_0	EXIST::FUNCTION:CMS
-X509v3_asid_is_canonical                55	3_0_0	EXIST::FUNCTION:RFC3779
-ASN1_ENUMERATED_get                     56	3_0_0	EXIST::FUNCTION:
-EVP_MD_do_all_sorted                    57	3_0_0	EXIST::FUNCTION:
-OCSP_crl_reason_str                     58	3_0_0	EXIST::FUNCTION:OCSP
-ENGINE_ctrl_cmd_string                  59	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ENGINE_finish                           60	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-SRP_Calc_client_key                     61	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-X509_PUBKEY_free                        62	3_0_0	EXIST::FUNCTION:
-BIO_free_all                            63	3_0_0	EXIST::FUNCTION:
-EVP_idea_ofb                            64	3_0_0	EXIST::FUNCTION:IDEA
-DSO_bind_func                           65	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_get_copy                  66	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_up_ref                              67	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_set_ctrl                  68	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OCSP_basic_sign                         69	3_0_0	EXIST::FUNCTION:OCSP
-BN_GENCB_set                            70	3_0_0	EXIST::FUNCTION:
-BN_generate_prime                       71	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8
-d2i_DSAPrivateKey_fp                    72	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
-BIO_nread0                              73	3_0_0	EXIST::FUNCTION:
-NETSCAPE_SPKI_print                     74	3_0_0	EXIST::FUNCTION:
-X509_set_pubkey                         75	3_0_0	EXIST::FUNCTION:
-ASN1_item_print                         76	3_0_0	EXIST::FUNCTION:
-CONF_set_nconf                          77	3_0_0	EXIST::FUNCTION:
-RAND_set_rand_method                    78	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BN_GF2m_mod_mul                         79	3_0_0	EXIST::FUNCTION:EC2M
-UI_add_input_boolean                    80	3_0_0	EXIST::FUNCTION:
-ASN1_TIME_adj                           81	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_get0_info                 82	3_0_0	EXIST::FUNCTION:
-BN_add_word                             83	3_0_0	EXIST::FUNCTION:
-EVP_des_ede                             84	3_0_0	EXIST::FUNCTION:DES
-EVP_PKEY_add1_attr_by_OBJ               85	3_0_0	EXIST::FUNCTION:
-ASYNC_WAIT_CTX_get_all_fds              86	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_meth_set_do_cipher           87	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_set_pw_prompt                       88	3_0_0	EXIST::FUNCTION:
-d2i_OCSP_RESPBYTES                      89	3_0_0	EXIST::FUNCTION:OCSP
-TS_REQ_get_ext_by_NID                   90	3_0_0	EXIST::FUNCTION:TS
-ASN1_item_ndef_i2d                      91	3_0_0	EXIST::FUNCTION:
-OCSP_archive_cutoff_new                 92	3_0_0	EXIST::FUNCTION:OCSP
-DSA_size                                93	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-IPAddressRange_free                     94	3_0_0	EXIST::FUNCTION:RFC3779
-CMS_ContentInfo_free                    95	3_0_0	EXIST::FUNCTION:CMS
-BIO_accept                              96	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SOCK
-X509_VERIFY_PARAM_set1_policies         97	3_0_0	EXIST::FUNCTION:
-SCT_set0_extensions                     98	3_0_0	EXIST::FUNCTION:CT
-PKCS5_pbe2_set_scrypt                   99	3_0_0	EXIST::FUNCTION:SCRYPT
-X509_find_by_subject                    100	3_0_0	EXIST::FUNCTION:
-DSAparams_print                         101	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-BF_set_key                              102	3_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
-d2i_DHparams                            103	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-i2d_PKCS7_ENC_CONTENT                   104	3_0_0	EXIST::FUNCTION:
-DH_generate_key                         105	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-ENGINE_add_conf_module                  106	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-BIO_new_socket                          107	3_0_0	EXIST::FUNCTION:SOCK
-ASN1_OBJECT_free                        108	3_0_0	EXIST::FUNCTION:
-X509_REQ_get_extensions                 109	3_0_0	EXIST::FUNCTION:
-X509_get_version                        110	3_0_0	EXIST::FUNCTION:
-OCSP_CERTID_dup                         111	3_0_0	EXIST::FUNCTION:OCSP
-RSA_PSS_PARAMS_free                     112	3_0_0	EXIST::FUNCTION:
-i2d_TS_MSG_IMPRINT                      113	3_0_0	EXIST::FUNCTION:TS
-EC_POINT_mul                            114	3_0_0	EXIST::FUNCTION:EC
-WHIRLPOOL_Final                         115	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,WHIRLPOOL
-CMS_get1_ReceiptRequest                 116	3_0_0	EXIST::FUNCTION:CMS
-BIO_sock_non_fatal_error                117	3_0_0	EXIST::FUNCTION:SOCK
-HMAC_Update                             118	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-i2d_PKCS12                              119	3_0_0	EXIST::FUNCTION:
-EVP_BytesToKey                          120	3_0_0	EXIST::FUNCTION:
-ENGINE_set_default_pkey_asn1_meths      121	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-OCSP_BASICRESP_add1_ext_i2d             122	3_0_0	EXIST::FUNCTION:OCSP
-EVP_camellia_128_ctr                    123	3_0_0	EXIST::FUNCTION:CAMELLIA
-EVP_CIPHER_impl_ctx_size                124	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_CRL_get_nextUpdate                 125	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
-PKCS12_free                             126	3_0_0	EXIST::FUNCTION:
-CMS_signed_get_attr                     127	3_0_0	EXIST::FUNCTION:CMS
-ENGINE_set_destroy_function             128	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ASN1_STRING_TABLE_add                   129	3_0_0	EXIST::FUNCTION:
-d2i_ASIdentifiers                       130	3_0_0	EXIST::FUNCTION:RFC3779
-i2d_PKCS12_bio                          131	3_0_0	EXIST::FUNCTION:
-X509_to_X509_REQ                        132	3_0_0	EXIST::FUNCTION:
-OCSP_basic_add1_nonce                   133	3_0_0	EXIST::FUNCTION:OCSP
-d2i_OCSP_BASICRESP                      134	3_0_0	EXIST::FUNCTION:OCSP
-X509v3_add_ext                          135	3_0_0	EXIST::FUNCTION:
-X509v3_addr_subset                      136	3_0_0	EXIST::FUNCTION:RFC3779
-CRYPTO_strndup                          137	3_0_0	EXIST::FUNCTION:
-OSSL_HTTP_REQ_CTX_free                  138	3_0_0	EXIST::FUNCTION:HTTP
-X509_STORE_new                          140	3_0_0	EXIST::FUNCTION:
-ASN1_TYPE_free                          141	3_0_0	EXIST::FUNCTION:
-PKCS12_BAGS_new                         142	3_0_0	EXIST::FUNCTION:
-CMAC_CTX_new                            143	3_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
-ASIdentifierChoice_new                  144	3_0_0	EXIST::FUNCTION:RFC3779
-EVP_PKEY_asn1_set_public                145	3_0_0	EXIST::FUNCTION:
-IDEA_set_decrypt_key                    146	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
-X509_STORE_CTX_set_flags                147	3_0_0	EXIST::FUNCTION:
-BIO_ADDR_rawmake                        148	3_0_0	EXIST::FUNCTION:SOCK
-EVP_PKEY_asn1_set_ctrl                  149	3_0_0	EXIST::FUNCTION:
-EC_POINTs_mul                           150	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-ASN1_get_object                         151	3_0_0	EXIST::FUNCTION:
-i2d_IPAddressFamily                     152	3_0_0	EXIST::FUNCTION:RFC3779
-ENGINE_get_ctrl_function                153	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-X509_REVOKED_get_ext_count              154	3_0_0	EXIST::FUNCTION:
-BN_is_prime_fasttest_ex                 155	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ERR_load_PKCS12_strings                 156	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_sha384                              157	3_0_0	EXIST::FUNCTION:
-i2d_DHparams                            158	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-TS_VERIFY_CTX_set_store                 159	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_4,TS
-PKCS12_verify_mac                       160	3_0_0	EXIST::FUNCTION:
-X509v3_addr_canonize                    161	3_0_0	EXIST::FUNCTION:RFC3779
-ASN1_item_ex_i2d                        162	3_0_0	EXIST::FUNCTION:
-ENGINE_set_digests                      163	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-PEM_ASN1_read_bio                       164	3_0_0	EXIST::FUNCTION:
-CT_POLICY_EVAL_CTX_free                 165	3_0_0	EXIST::FUNCTION:CT
-CMS_RecipientInfo_kari_get0_ctx         166	3_0_0	EXIST::FUNCTION:CMS
-PKCS7_set_attributes                    167	3_0_0	EXIST::FUNCTION:
-d2i_POLICYQUALINFO                      168	3_0_0	EXIST::FUNCTION:
-EVP_MD_get_type                         170	3_0_0	EXIST::FUNCTION:
-EVP_PKCS82PKEY                          171	3_0_0	EXIST::FUNCTION:
-BN_generate_prime_ex                    172	3_0_0	EXIST::FUNCTION:
-EVP_EncryptInit                         173	3_0_0	EXIST::FUNCTION:
-RAND_OpenSSL                            174	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BN_uadd                                 175	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_derive_init                    176	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_ASN1_stream               177	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_delete_attr                    178	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_get_key_length           179	3_0_0	EXIST::FUNCTION:
-BIO_clear_flags                         180	3_0_0	EXIST::FUNCTION:
-i2d_DISPLAYTEXT                         181	3_0_0	EXIST::FUNCTION:
-OCSP_response_status                    182	3_0_0	EXIST::FUNCTION:OCSP
-i2d_ASN1_PRINTABLESTRING                183	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_set_hostflags         184	3_0_0	EXIST::FUNCTION:
-SCT_get0_log_id                         185	3_0_0	EXIST::FUNCTION:CT
-ASN1_IA5STRING_it                       186	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_ECPrivateKey              187	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-BN_consttime_swap                       188	3_0_0	EXIST::FUNCTION:
-BIO_f_buffer                            189	3_0_0	EXIST::FUNCTION:
-CMS_SignerInfo_get0_signer_id           190	3_0_0	EXIST::FUNCTION:CMS
-TS_TST_INFO_new                         191	3_0_0	EXIST::FUNCTION:TS
-X509_REQ_check_private_key              192	3_0_0	EXIST::FUNCTION:
-EVP_DigestInit                          193	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_find                      194	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_VERIFY_PARAM_get_count             195	3_0_0	EXIST::FUNCTION:
-ASN1_BIT_STRING_get_bit                 196	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_cmp                            197	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-d2i_X509_ALGORS                         198	3_0_0	EXIST::FUNCTION:
-EVP_PKEY2PKCS8                          199	3_0_0	EXIST::FUNCTION:
-BN_nist_mod_256                         200	3_0_0	EXIST::FUNCTION:
-OCSP_request_add0_id                    201	3_0_0	EXIST::FUNCTION:OCSP
-EVP_seed_cfb128                         202	3_0_0	EXIST::FUNCTION:SEED
-BASIC_CONSTRAINTS_free                  203	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_get_flags                    204	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_ECPKParameters            205	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-SCT_set_version                         206	3_0_0	EXIST::FUNCTION:CT
-CMS_add1_ReceiptRequest                 207	3_0_0	EXIST::FUNCTION:CMS
-d2i_CRL_DIST_POINTS                     208	3_0_0	EXIST::FUNCTION:
-X509_CRL_INFO_free                      209	3_0_0	EXIST::FUNCTION:
-ERR_load_UI_strings                     210	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ERR_load_strings                        211	3_0_0	EXIST::FUNCTION:
-RSA_X931_hash_id                        212	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EC_KEY_set_method                       213	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-PEM_write_PKCS8_PRIV_KEY_INFO           214	3_0_0	EXIST::FUNCTION:STDIO
-X509at_get0_data_by_OBJ                 215	3_0_0	EXIST::FUNCTION:
-b2i_PublicKey_bio                       216	3_0_0	EXIST::FUNCTION:
-s2i_ASN1_OCTET_STRING                   217	3_0_0	EXIST::FUNCTION:
-POLICYINFO_it                           218	3_0_0	EXIST::FUNCTION:
-OBJ_create                              219	3_0_0	EXIST::FUNCTION:
-d2i_NOTICEREF                           220	3_0_0	EXIST::FUNCTION:
-BN_get_rfc2409_prime_768                221	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_PKCS8                      222	3_0_0	EXIST::FUNCTION:
-X509_ATTRIBUTE_new                      223	3_0_0	EXIST::FUNCTION:
-ASN1_STRING_TABLE_cleanup               224	3_0_0	EXIST::FUNCTION:
-ASN1_put_eoc                            225	3_0_0	EXIST::FUNCTION:
-EVP_MD_meth_set_input_blocksize         226	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-PKCS12_SAFEBAG_get0_attrs               227	3_0_0	EXIST::FUNCTION:
-PKCS8_get_attr                          228	3_0_0	EXIST::FUNCTION:
-DSAparams_print_fp                      229	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
-EC_POINT_set_Jprojective_coordinates_GFp 230	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-DIST_POINT_NAME_new                     231	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_file                        232	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_set_decrypt               233	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_rc2_ecb                             234	3_0_0	EXIST::FUNCTION:RC2
-i2b_PublicKey_bio                       235	3_0_0	EXIST::FUNCTION:
-d2i_ASN1_SET_ANY                        236	3_0_0	EXIST::FUNCTION:
-ASN1_item_i2d                           238	3_0_0	EXIST::FUNCTION:
-OCSP_copy_nonce                         239	3_0_0	EXIST::FUNCTION:OCSP
-OBJ_txt2nid                             240	3_0_0	EXIST::FUNCTION:
-SEED_set_key                            241	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SEED
-EC_KEY_clear_flags                      242	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-CMS_RecipientInfo_ktri_get0_algs        243	3_0_0	EXIST::FUNCTION:CMS
-i2d_EC_PUBKEY                           244	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-MDC2                                    245	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MDC2
-BN_clear_free                           246	3_0_0	EXIST::FUNCTION:
-ENGINE_get_pkey_asn1_meths              247	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-DSO_merge                               248	3_0_0	EXIST::FUNCTION:
-RSA_get_ex_data                         249	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_get_decrypt               250	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-DES_cfb_encrypt                         251	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-CMS_SignerInfo_set1_signer_cert         252	3_0_0	EXIST::FUNCTION:CMS
-X509_CRL_load_http                      253	3_0_0	EXIST::FUNCTION:
-ENGINE_register_all_ciphers             254	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-SXNET_new                               255	3_0_0	EXIST::FUNCTION:
-EVP_camellia_256_ctr                    256	3_0_0	EXIST::FUNCTION:CAMELLIA
-d2i_PKCS8_PRIV_KEY_INFO                 257	3_0_0	EXIST::FUNCTION:
-EVP_md2                                 259	3_0_0	EXIST::FUNCTION:MD2
-RC2_ecb_encrypt                         260	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC2
-ENGINE_register_DH                      261	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ASN1_NULL_free                          262	3_0_0	EXIST::FUNCTION:
-EC_KEY_copy                             263	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_des_ede3                            264	3_0_0	EXIST::FUNCTION:DES
-PKCS7_add1_attrib_digest                265	3_0_0	EXIST::FUNCTION:
-EC_POINT_get_affine_coordinates_GFp     266	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_seed_ecb                            267	3_0_0	EXIST::FUNCTION:SEED
-BIO_dgram_sctp_wait_for_dry             268	3_0_0	EXIST::FUNCTION:DGRAM,SCTP
-ASN1_OCTET_STRING_NDEF_it               269	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_get_count                 270	3_0_0	EXIST::FUNCTION:
-WHIRLPOOL_Init                          271	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,WHIRLPOOL
-EVP_OpenInit                            272	3_0_0	EXIST::FUNCTION:
-OCSP_response_get1_basic                273	3_0_0	EXIST::FUNCTION:OCSP
-CRYPTO_gcm128_tag                       274	3_0_0	EXIST::FUNCTION:
-OSSL_HTTP_parse_url                     275	3_0_0	EXIST::FUNCTION:HTTP
-UI_get0_test_string                     276	3_0_0	EXIST::FUNCTION:
-CRYPTO_secure_free                      277	3_0_0	EXIST::FUNCTION:
-DSA_print_fp                            278	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
-X509_get_ext_d2i                        279	3_0_0	EXIST::FUNCTION:
-d2i_PKCS7_ENC_CONTENT                   280	3_0_0	EXIST::FUNCTION:
-BUF_MEM_grow                            281	3_0_0	EXIST::FUNCTION:
-TS_REQ_free                             282	3_0_0	EXIST::FUNCTION:TS
-PEM_read_DHparams                       283	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH,STDIO
-RSA_private_decrypt                     284	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509V3_EXT_get_nid                      285	3_0_0	EXIST::FUNCTION:
-BIO_s_log                               286	3_0_0	EXIST::FUNCTION:
-EC_POINT_set_to_infinity                287	3_0_0	EXIST::FUNCTION:EC
-EVP_des_ede_ofb                         288	3_0_0	EXIST::FUNCTION:DES
-ECDH_KDF_X9_62                          289	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-ASN1_UNIVERSALSTRING_to_string          290	3_0_0	EXIST::FUNCTION:
-CRYPTO_gcm128_setiv                     291	3_0_0	EXIST::FUNCTION:
-ASN1_PCTX_set_oid_flags                 292	3_0_0	EXIST::FUNCTION:
-d2i_ASN1_INTEGER                        293	3_0_0	EXIST::FUNCTION:
-i2d_PKCS7_ENCRYPT                       294	3_0_0	EXIST::FUNCTION:
-CT_POLICY_EVAL_CTX_set1_issuer          295	3_0_0	EXIST::FUNCTION:CT
-X509_NAME_ENTRY_set                     296	3_0_0	EXIST::FUNCTION:
-PKCS8_set0_pbe                          297	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_DSA_PUBKEY                298	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-PEM_X509_INFO_read_bio                  299	3_0_0	EXIST::FUNCTION:
-EC_GROUP_get0_order                     300	3_0_0	EXIST::FUNCTION:EC
-OCSP_BASICRESP_delete_ext               301	3_0_0	EXIST::FUNCTION:OCSP
-PKCS12_get_attr_gen                     302	3_0_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_get0_safes               303	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_derive                         304	3_0_0	EXIST::FUNCTION:
-OCSP_BASICRESP_get_ext_by_NID           305	3_0_0	EXIST::FUNCTION:OCSP
-OBJ_dup                                 306	3_0_0	EXIST::FUNCTION:
-CMS_signed_get_attr_count               307	3_0_0	EXIST::FUNCTION:CMS
-EC_get_builtin_curves                   308	3_0_0	EXIST::FUNCTION:EC
-i2d_ASN1_IA5STRING                      309	3_0_0	EXIST::FUNCTION:
-OCSP_check_nonce                        310	3_0_0	EXIST::FUNCTION:OCSP
-X509_STORE_CTX_init                     311	3_0_0	EXIST::FUNCTION:
-OCSP_RESPONSE_free                      312	3_0_0	EXIST::FUNCTION:OCSP
-ENGINE_set_DH                           313	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EVP_CIPHER_CTX_set_flags                314	3_0_0	EXIST::FUNCTION:
-err_free_strings_int                    315	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_PKCS7_stream              316	3_0_0	EXIST::FUNCTION:
-d2i_X509_CERT_AUX                       317	3_0_0	EXIST::FUNCTION:
-UI_process                              318	3_0_0	EXIST::FUNCTION:
-X509_get_subject_name                   319	3_0_0	EXIST::FUNCTION:
-DH_get_1024_160                         320	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-i2d_ASN1_UNIVERSALSTRING                321	3_0_0	EXIST::FUNCTION:
-d2i_OCSP_RESPID                         322	3_0_0	EXIST::FUNCTION:OCSP
-BIO_s_accept                            323	3_0_0	EXIST::FUNCTION:SOCK
-EVP_whirlpool                           324	3_0_0	EXIST::FUNCTION:WHIRLPOOL
-OCSP_ONEREQ_get1_ext_d2i                325	3_0_0	EXIST::FUNCTION:OCSP
-d2i_ESS_SIGNING_CERT                    326	3_0_0	EXIST::FUNCTION:
-EC_KEY_set_default_method               327	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_OBJECT_up_ref_count                328	3_0_0	EXIST::FUNCTION:
-RAND_load_file                          329	3_0_0	EXIST::FUNCTION:
-BIO_ctrl_reset_read_request             330	3_0_0	EXIST::FUNCTION:
-CRYPTO_ccm128_tag                       331	3_0_0	EXIST::FUNCTION:
-BIO_new_dgram_sctp                      332	3_0_0	EXIST::FUNCTION:DGRAM,SCTP
-d2i_RSAPrivateKey_fp                    333	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
-s2i_ASN1_IA5STRING                      334	3_0_0	EXIST::FUNCTION:
-UI_get_ex_data                          335	3_0_0	EXIST::FUNCTION:
-EVP_EncryptUpdate                       336	3_0_0	EXIST::FUNCTION:
-SRP_create_verifier                     337	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-TS_TST_INFO_print_bio                   338	3_0_0	EXIST::FUNCTION:TS
-X509_NAME_get_index_by_OBJ              339	3_0_0	EXIST::FUNCTION:
-BIO_get_host_ip                         340	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SOCK
-PKCS7_add_certificate                   341	3_0_0	EXIST::FUNCTION:
-TS_REQ_get_ext                          342	3_0_0	EXIST::FUNCTION:TS
-X509_NAME_cmp                           343	3_0_0	EXIST::FUNCTION:
-DIST_POINT_it                           344	3_0_0	EXIST::FUNCTION:
-PEM_read_X509_CRL                       345	3_0_0	EXIST::FUNCTION:STDIO
-OPENSSL_sk_sort                         346	3_0_0	EXIST::FUNCTION:
-CTLOG_STORE_load_file                   347	3_0_0	EXIST::FUNCTION:CT
-ASN1_SEQUENCE_it                        348	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_get_tst_info                349	3_0_0	EXIST::FUNCTION:TS
-RC4                                     350	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC4
-PKCS7_stream                            352	3_0_0	EXIST::FUNCTION:
-i2t_ASN1_OBJECT                         353	3_0_0	EXIST::FUNCTION:
-EC_GROUP_get0_generator                 354	3_0_0	EXIST::FUNCTION:EC
-RSA_padding_add_PKCS1_PSS_mgf1          355	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_MD_meth_set_init                    356	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_get_issuer_name                    357	3_0_0	EXIST::FUNCTION:
-EVP_SignFinal                           358	3_0_0	EXIST::FUNCTION:
-PKCS12_mac_present                      359	3_0_0	EXIST::FUNCTION:
-d2i_PUBKEY_bio                          360	3_0_0	EXIST::FUNCTION:
-BN_asc2bn                               361	3_0_0	EXIST::FUNCTION:
-EVP_desx_cbc                            362	3_0_0	EXIST::FUNCTION:DES
-SXNETID_it                              363	3_0_0	EXIST::FUNCTION:
-CRYPTO_gcm128_encrypt                   364	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_ctrl_str                   365	3_0_0	EXIST::FUNCTION:
-CMS_signed_add1_attr_by_txt             366	3_0_0	EXIST::FUNCTION:CMS
-i2d_NETSCAPE_SPKAC                      367	3_0_0	EXIST::FUNCTION:
-X509V3_add_value_bool_nf                368	3_0_0	EXIST::FUNCTION:
-ASN1_item_verify                        369	3_0_0	EXIST::FUNCTION:
-SEED_ecb_encrypt                        370	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SEED
-X509_PUBKEY_get0_param                  371	3_0_0	EXIST::FUNCTION:
-ASN1_i2d_fp                             372	3_0_0	EXIST::FUNCTION:STDIO
-BIO_new_mem_buf                         373	3_0_0	EXIST::FUNCTION:
-UI_get_input_flags                      374	3_0_0	EXIST::FUNCTION:
-X509V3_EXT_REQ_add_nconf                375	3_0_0	EXIST::FUNCTION:
-X509v3_asid_subset                      376	3_0_0	EXIST::FUNCTION:RFC3779
-RSA_check_key_ex                        377	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-d2i_TS_MSG_IMPRINT_bio                  378	3_0_0	EXIST::FUNCTION:TS
-i2d_ASN1_TYPE                           379	3_0_0	EXIST::FUNCTION:
-EVP_aes_256_wrap_pad                    380	3_0_0	EXIST::FUNCTION:
-CMS_RecipientInfo_kekri_id_cmp          381	3_0_0	EXIST::FUNCTION:CMS
-X509_VERIFY_PARAM_get0_peername         382	3_0_0	EXIST::FUNCTION:
-ASN1_PCTX_get_oid_flags                 383	3_0_0	EXIST::FUNCTION:
-CONF_free                               384	3_0_0	EXIST::FUNCTION:
-DSO_get_filename                        385	3_0_0	EXIST::FUNCTION:
-i2d_ASN1_SEQUENCE_ANY                   387	3_0_0	EXIST::FUNCTION:
-OPENSSL_strlcpy                         388	3_0_0	EXIST::FUNCTION:
-BIO_get_port                            389	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SOCK
-DISPLAYTEXT_free                        390	3_0_0	EXIST::FUNCTION:
-BN_div                                  391	3_0_0	EXIST::FUNCTION:
-RIPEMD160_Update                        392	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RMD160
-PEM_write_bio_CMS                       393	3_0_0	EXIST::FUNCTION:CMS
-ASN1_OBJECT_new                         394	3_0_0	EXIST::FUNCTION:
-EVP_des_ede3_cfb8                       395	3_0_0	EXIST::FUNCTION:DES
-BIO_dump_indent_fp                      396	3_0_0	EXIST::FUNCTION:STDIO
-X509_NAME_ENTRY_get_data                397	3_0_0	EXIST::FUNCTION:
-BIO_socket                              398	3_0_0	EXIST::FUNCTION:SOCK
-EVP_PKEY_meth_get_derive                399	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_STRING_clear_free                  400	3_0_0	EXIST::FUNCTION:
-d2i_OCSP_REVOKEDINFO                    401	3_0_0	EXIST::FUNCTION:OCSP
-ASN1_STRING_print_ex_fp                 402	3_0_0	EXIST::FUNCTION:STDIO
-PKCS7_SIGNED_new                        403	3_0_0	EXIST::FUNCTION:
-CMS_get0_eContentType                   404	3_0_0	EXIST::FUNCTION:CMS
-HMAC_Final                              405	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_CRL_delete_ext                     406	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_get_ordering                407	3_0_0	EXIST::FUNCTION:TS
-X509_get_extended_key_usage             408	3_0_0	EXIST::FUNCTION:
-ERR_print_errors                        409	3_0_0	EXIST::FUNCTION:
-X509_REVOKED_set_revocationDate         410	3_0_0	EXIST::FUNCTION:
-EVP_CipherFinal_ex                      411	3_0_0	EXIST::FUNCTION:
-d2i_DSA_PUBKEY                          412	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-BN_CTX_get                              413	3_0_0	EXIST::FUNCTION:
-BN_to_montgomery                        414	3_0_0	EXIST::FUNCTION:
-X509_OBJECT_get0_X509_CRL               415	3_0_0	EXIST::FUNCTION:
-EVP_camellia_128_cfb8                   416	3_0_0	EXIST::FUNCTION:CAMELLIA
-EC_KEY_METHOD_free                      417	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-TS_TST_INFO_set_policy_id               418	3_0_0	EXIST::FUNCTION:TS
-d2i_EXTENDED_KEY_USAGE                  419	3_0_0	EXIST::FUNCTION:
-ASYNC_unblock_pause                     420	3_0_0	EXIST::FUNCTION:
-i2d_X509_VAL                            421	3_0_0	EXIST::FUNCTION:
-ASN1_SCTX_get_flags                     422	3_0_0	EXIST::FUNCTION:
-RIPEMD160                               423	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RMD160
-CRYPTO_ocb128_setiv                     424	3_0_0	EXIST::FUNCTION:OCB
-X509_CRL_digest                         425	3_0_0	EXIST::FUNCTION:
-EVP_aes_128_cbc_hmac_sha1               426	3_0_0	EXIST::FUNCTION:
-ERR_load_CMS_strings                    427	3_0_0	EXIST::FUNCTION:CMS,DEPRECATEDIN_3_0
-EVP_MD_CTX_md                           428	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_REVOKED_get_ext                    429	3_0_0	EXIST::FUNCTION:
-d2i_RSA_PSS_PARAMS                      430	3_0_0	EXIST::FUNCTION:
-USERNOTICE_free                         431	3_0_0	EXIST::FUNCTION:
-MD4_Transform                           432	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD4
-EVP_CIPHER_get_block_size               433	3_0_0	EXIST::FUNCTION:
-CERTIFICATEPOLICIES_new                 434	3_0_0	EXIST::FUNCTION:
-BIO_dump_fp                             435	3_0_0	EXIST::FUNCTION:STDIO
-BIO_set_flags                           436	3_0_0	EXIST::FUNCTION:
-BN_is_one                               437	3_0_0	EXIST::FUNCTION:
-TS_CONF_set_def_policy                  438	3_0_0	EXIST::FUNCTION:TS
-DSA_free                                439	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-BN_GENCB_new                            440	3_0_0	EXIST::FUNCTION:
-X509_VAL_new                            441	3_0_0	EXIST::FUNCTION:
-NCONF_load                              442	3_0_0	EXIST::FUNCTION:
-ASN1_put_object                         443	3_0_0	EXIST::FUNCTION:
-d2i_OCSP_RESPONSE                       444	3_0_0	EXIST::FUNCTION:OCSP
-d2i_PublicKey                           445	3_0_0	EXIST::FUNCTION:
-ENGINE_set_ex_data                      446	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-X509_get_default_private_dir            447	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_set0_dane                448	3_0_0	EXIST::FUNCTION:
-EVP_des_ecb                             449	3_0_0	EXIST::FUNCTION:DES
-OCSP_resp_get0                          450	3_0_0	EXIST::FUNCTION:OCSP
-RSA_X931_generate_key_ex                452	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_get_serialNumber                   453	3_0_0	EXIST::FUNCTION:
-BIO_sock_should_retry                   454	3_0_0	EXIST::FUNCTION:SOCK
-ENGINE_get_digests                      455	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-TS_MSG_IMPRINT_get_algo                 456	3_0_0	EXIST::FUNCTION:TS
-DH_new_method                           457	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-BF_ecb_encrypt                          458	3_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
-PEM_write_bio_DHparams                  459	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-EVP_DigestFinal                         460	3_0_0	EXIST::FUNCTION:
-CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE 461	3_0_0	EXIST::FUNCTION:CT
-X509v3_asid_add_id_or_range             462	3_0_0	EXIST::FUNCTION:RFC3779
-X509_NAME_ENTRY_create_by_NID           463	3_0_0	EXIST::FUNCTION:
-EC_KEY_METHOD_get_init                  464	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-ASN1_INTEGER_to_BN                      465	3_0_0	EXIST::FUNCTION:
-OPENSSL_memcmp                          466	3_0_0	NOEXIST::FUNCTION:
-BUF_MEM_new                             467	3_0_0	EXIST::FUNCTION:
-DSO_set_filename                        468	3_0_0	EXIST::FUNCTION:
-DH_new                                  469	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-OCSP_RESPID_free                        470	3_0_0	EXIST::FUNCTION:OCSP
-PKCS5_pbe2_set                          471	3_0_0	EXIST::FUNCTION:
-SCT_set_signature_nid                   473	3_0_0	EXIST::FUNCTION:CT
-i2d_RSA_PUBKEY_fp                       474	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
-PKCS12_BAGS_it                          475	3_0_0	EXIST::FUNCTION:
-X509_pubkey_digest                      476	3_0_0	EXIST::FUNCTION:
-ENGINE_register_all_RSA                 477	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-CRYPTO_THREAD_set_local                 478	3_0_0	EXIST::FUNCTION:
-X509_get_default_cert_dir_env           479	3_0_0	EXIST::FUNCTION:
-X509_CRL_sort                           480	3_0_0	EXIST::FUNCTION:
-i2d_RSA_PUBKEY_bio                      481	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_T61STRING_free                     482	3_0_0	EXIST::FUNCTION:
-PEM_write_CMS                           483	3_0_0	EXIST::FUNCTION:CMS,STDIO
-OPENSSL_sk_find                         484	3_0_0	EXIST::FUNCTION:
-ENGINE_get_ciphers                      485	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EVP_rc2_ofb                             486	3_0_0	EXIST::FUNCTION:RC2
-EVP_PKEY_set1_RSA                       487	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CMS_SignerInfo_get0_md_ctx              488	3_0_0	EXIST::FUNCTION:CMS
-X509_STORE_set_trust                    489	3_0_0	EXIST::FUNCTION:
-d2i_POLICYINFO                          490	3_0_0	EXIST::FUNCTION:
-DES_cbc_encrypt                         491	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-BN_GF2m_mod_sqr_arr                     492	3_0_0	EXIST::FUNCTION:EC2M
-ASN1_PRINTABLESTRING_it                 493	3_0_0	EXIST::FUNCTION:
-BIO_f_cipher                            494	3_0_0	EXIST::FUNCTION:
-UI_destroy_method                       495	3_0_0	EXIST::FUNCTION:
-BN_get_rfc3526_prime_3072               496	3_0_0	EXIST::FUNCTION:
-X509_INFO_new                           497	3_0_0	EXIST::FUNCTION:
-OCSP_RESPDATA_it                        498	3_0_0	EXIST::FUNCTION:OCSP
-X509_CRL_print                          499	3_0_0	EXIST::FUNCTION:
-WHIRLPOOL_Update                        500	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,WHIRLPOOL
-DSA_get_ex_data                         501	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-BN_copy                                 502	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_add0_policy           504	3_0_0	EXIST::FUNCTION:
-PKCS7_cert_from_signer_info             505	3_0_0	EXIST::FUNCTION:
-X509_TRUST_get_trust                    506	3_0_0	EXIST::FUNCTION:
-DES_string_to_key                       507	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-ERR_error_string                        508	3_0_0	EXIST::FUNCTION:
-BIO_new_connect                         509	3_0_0	EXIST::FUNCTION:SOCK
-DSA_new_method                          511	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-OCSP_CERTID_new                         512	3_0_0	EXIST::FUNCTION:OCSP
-X509_CRL_get_signature_nid              513	3_0_0	EXIST::FUNCTION:
-X509_policy_level_node_count            514	3_0_0	EXIST::FUNCTION:
-d2i_OCSP_CERTSTATUS                     515	3_0_0	EXIST::FUNCTION:OCSP
-X509V3_add1_i2d                         516	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_set_serial                  517	3_0_0	EXIST::FUNCTION:TS
-OCSP_RESPBYTES_new                      518	3_0_0	EXIST::FUNCTION:OCSP
-OCSP_SINGLERESP_delete_ext              519	3_0_0	EXIST::FUNCTION:OCSP
-EVP_MD_CTX_test_flags                   521	3_0_0	EXIST::FUNCTION:
-X509v3_addr_validate_path               522	3_0_0	EXIST::FUNCTION:RFC3779
-BIO_new_fp                              523	3_0_0	EXIST::FUNCTION:STDIO
-EC_GROUP_set_generator                  524	3_0_0	EXIST::FUNCTION:EC
-CRYPTO_memdup                           525	3_0_0	EXIST::FUNCTION:
-DH_generate_parameters                  526	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8,DH
-BN_set_negative                         527	3_0_0	EXIST::FUNCTION:
-i2d_TS_RESP_bio                         528	3_0_0	EXIST::FUNCTION:TS
-ASYNC_WAIT_CTX_set_wait_fd              529	3_0_0	EXIST::FUNCTION:
-ERR_func_error_string                   530	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_STRING_data                        531	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
-X509_CRL_add1_ext_i2d                   532	3_0_0	EXIST::FUNCTION:
-i2d_TS_TST_INFO                         533	3_0_0	EXIST::FUNCTION:TS
-OBJ_sigid_free                          534	3_0_0	EXIST::FUNCTION:
-TS_STATUS_INFO_get0_status              535	3_0_0	EXIST::FUNCTION:TS
-EC_KEY_get_flags                        536	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-ASN1_TYPE_cmp                           537	3_0_0	EXIST::FUNCTION:
-i2d_RSAPublicKey                        538	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EC_GROUP_get_trinomial_basis            539	3_0_0	EXIST::FUNCTION:EC,EC2M
-BIO_ADDRINFO_protocol                   540	3_0_0	EXIST::FUNCTION:SOCK
-i2d_PBKDF2PARAM                         541	3_0_0	EXIST::FUNCTION:
-ENGINE_unregister_RAND                  542	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-PEM_write_bio_RSAPrivateKey             543	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CONF_get_number                         544	3_0_0	EXIST::FUNCTION:
-X509_EXTENSION_get_object               545	3_0_0	EXIST::FUNCTION:
-X509_EXTENSIONS_it                      546	3_0_0	EXIST::FUNCTION:
-EC_POINT_set_compressed_coordinates_GF2m 547	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC2M
-RSA_sign_ASN1_OCTET_STRING              548	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-d2i_X509_CRL_fp                         549	3_0_0	EXIST::FUNCTION:STDIO
-i2d_RSA_PUBKEY                          550	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_aes_128_ccm                         551	3_0_0	EXIST::FUNCTION:
-ECParameters_print                      552	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-OCSP_SINGLERESP_get1_ext_d2i            553	3_0_0	EXIST::FUNCTION:OCSP
-RAND_status                             554	3_0_0	EXIST::FUNCTION:
-EVP_ripemd160                           555	3_0_0	EXIST::FUNCTION:RMD160
-EVP_MD_meth_set_final                   556	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ENGINE_get_cmd_defns                    557	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-d2i_PKEY_USAGE_PERIOD                   558	3_0_0	EXIST::FUNCTION:
-RSAPublicKey_dup                        559	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RAND_write_file                         560	3_0_0	EXIST::FUNCTION:
-BN_GF2m_mod                             561	3_0_0	EXIST::FUNCTION:EC2M
-EC_GROUP_get_pentanomial_basis          562	3_0_0	EXIST::FUNCTION:EC,EC2M
-X509_CINF_free                          563	3_0_0	EXIST::FUNCTION:
-X509_EXTENSION_free                     564	3_0_0	EXIST::FUNCTION:
-EVP_DigestSignInit                      565	3_0_0	EXIST::FUNCTION:
-CT_POLICY_EVAL_CTX_get0_issuer          566	3_0_0	EXIST::FUNCTION:CT
-TLS_FEATURE_new                         567	3_0_0	EXIST::FUNCTION:
-RSA_get_default_method                  568	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CRYPTO_cts128_encrypt_block             569	3_0_0	EXIST::FUNCTION:
-ASN1_digest                             570	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ERR_load_X509V3_strings                 571	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_get_cleanup               572	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-d2i_X509                                574	3_0_0	EXIST::FUNCTION:
-a2i_ASN1_STRING                         575	3_0_0	EXIST::FUNCTION:
-EC_GROUP_get_mont_data                  576	3_0_0	EXIST::FUNCTION:EC
-CMAC_CTX_copy                           577	3_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
-EVP_camellia_128_cfb128                 579	3_0_0	EXIST::FUNCTION:CAMELLIA
-DH_compute_key_padded                   580	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-ERR_load_CONF_strings                   581	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ESS_ISSUER_SERIAL_dup                   582	3_0_0	EXIST::FUNCTION:
-BN_GF2m_mod_exp_arr                     583	3_0_0	EXIST::FUNCTION:EC2M
-ASN1_UTF8STRING_free                    584	3_0_0	EXIST::FUNCTION:
-BN_X931_generate_prime_ex               585	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ENGINE_get_RAND                         586	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EVP_DecryptInit                         587	3_0_0	EXIST::FUNCTION:
-BN_bin2bn                               588	3_0_0	EXIST::FUNCTION:
-X509_subject_name_hash                  589	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_meth_set_flags               590	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-TS_CONF_set_clock_precision_digits      591	3_0_0	EXIST::FUNCTION:TS
-ASN1_TYPE_set                           592	3_0_0	EXIST::FUNCTION:
-i2d_PKCS8_PRIV_KEY_INFO                 593	3_0_0	EXIST::FUNCTION:
-i2d_PKCS7_bio                           594	3_0_0	EXIST::FUNCTION:
-EVP_MD_meth_get_copy                    595	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RAND_query_egd_bytes                    596	3_0_0	EXIST::FUNCTION:EGD
-i2d_ASN1_PRINTABLE                      597	3_0_0	EXIST::FUNCTION:
-ENGINE_cmd_is_executable                598	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-BIO_puts                                599	3_0_0	EXIST::FUNCTION:
-RSAPublicKey_it                         601	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ISSUING_DIST_POINT_new                  602	3_0_0	EXIST::FUNCTION:
-X509_VAL_it                             603	3_0_0	EXIST::FUNCTION:
-EVP_DigestVerifyInit                    604	3_0_0	EXIST::FUNCTION:
-i2d_IPAddressChoice                     605	3_0_0	EXIST::FUNCTION:RFC3779
-EVP_md5                                 606	3_0_0	EXIST::FUNCTION:MD5
-ASRange_new                             607	3_0_0	EXIST::FUNCTION:RFC3779
-BN_GF2m_mod_mul_arr                     608	3_0_0	EXIST::FUNCTION:EC2M
-d2i_RSA_OAEP_PARAMS                     609	3_0_0	EXIST::FUNCTION:
-BIO_s_bio                               610	3_0_0	EXIST::FUNCTION:
-OBJ_NAME_add                            611	3_0_0	EXIST::FUNCTION:
-BIO_fd_non_fatal_error                  612	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_set_type                       613	3_0_0	EXIST::FUNCTION:
-ENGINE_get_next                         614	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-BN_is_negative                          615	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_attr_count                 616	3_0_0	EXIST::FUNCTION:
-X509_REVOKED_get_ext_by_critical        617	3_0_0	EXIST::FUNCTION:
-X509at_get_attr                         618	3_0_0	EXIST::FUNCTION:
-X509_PUBKEY_it                          619	3_0_0	EXIST::FUNCTION:
-DES_ede3_ofb64_encrypt                  620	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-EC_KEY_METHOD_get_compute_key           621	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-RC2_cfb64_encrypt                       622	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC2
-EVP_EncryptFinal_ex                     623	3_0_0	EXIST::FUNCTION:
-ERR_load_RSA_strings                    624	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CRYPTO_secure_malloc_done               625	3_0_0	EXIST::FUNCTION:
-RSA_OAEP_PARAMS_new                     626	3_0_0	EXIST::FUNCTION:
-X509_NAME_free                          627	3_0_0	EXIST::FUNCTION:
-PKCS12_set_mac                          628	3_0_0	EXIST::FUNCTION:
-UI_get0_result_string                   629	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_add_policy                  630	3_0_0	EXIST::FUNCTION:TS
-X509_REQ_dup                            631	3_0_0	EXIST::FUNCTION:
-d2i_DSA_PUBKEY_fp                       633	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
-OSSL_HTTP_REQ_CTX_exchange              634	3_0_0	EXIST::FUNCTION:HTTP
-d2i_X509_REQ_fp                         635	3_0_0	EXIST::FUNCTION:STDIO
-DH_OpenSSL                              636	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-BN_get_rfc3526_prime_8192               637	3_0_0	EXIST::FUNCTION:
-X509_REVOKED_it                         638	3_0_0	EXIST::FUNCTION:
-CRYPTO_THREAD_write_lock                639	3_0_0	EXIST::FUNCTION:
-X509V3_NAME_from_section                640	3_0_0	EXIST::FUNCTION:
-EC_POINT_set_compressed_coordinates_GFp 641	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-OCSP_SINGLERESP_get0_id                 642	3_0_0	EXIST::FUNCTION:OCSP
-UI_add_info_string                      643	3_0_0	EXIST::FUNCTION:
-OBJ_NAME_remove                         644	3_0_0	EXIST::FUNCTION:
-UI_get_method                           645	3_0_0	EXIST::FUNCTION:
-CONF_modules_unload                     646	3_0_0	EXIST::FUNCTION:
-CRYPTO_ccm128_encrypt_ccm64             647	3_0_0	EXIST::FUNCTION:
-CRYPTO_secure_malloc_init               648	3_0_0	EXIST::FUNCTION:
-DSAparams_dup                           649	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-PKCS8_PRIV_KEY_INFO_new                 650	3_0_0	EXIST::FUNCTION:
-TS_RESP_verify_token                    652	3_0_0	EXIST::FUNCTION:TS
-PEM_read_bio_CMS                        653	3_0_0	EXIST::FUNCTION:CMS
-PEM_get_EVP_CIPHER_INFO                 654	3_0_0	EXIST::FUNCTION:
-X509V3_EXT_print                        655	3_0_0	EXIST::FUNCTION:
-i2d_OCSP_SINGLERESP                     656	3_0_0	EXIST::FUNCTION:OCSP
-ESS_CERT_ID_free                        657	3_0_0	EXIST::FUNCTION:
-PEM_SignInit                            658	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_set_key_length           659	3_0_0	EXIST::FUNCTION:
-X509_delete_ext                         660	3_0_0	EXIST::FUNCTION:
-OCSP_resp_get0_produced_at              661	3_0_0	EXIST::FUNCTION:OCSP
-IDEA_encrypt                            662	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
-CRYPTO_nistcts128_encrypt_block         663	3_0_0	EXIST::FUNCTION:
-EVP_MD_do_all                           664	3_0_0	EXIST::FUNCTION:
-EC_KEY_oct2priv                         665	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-CONF_parse_list                         666	3_0_0	EXIST::FUNCTION:
-ENGINE_set_table_flags                  667	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EVP_MD_meth_get_ctrl                    668	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_TYPE_get_int_octetstring           669	3_0_0	EXIST::FUNCTION:
-PKCS5_pbe_set0_algor                    670	3_0_0	EXIST::FUNCTION:
-ENGINE_get_table_flags                  671	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-PKCS12_MAC_DATA_new                     672	3_0_0	EXIST::FUNCTION:
-X509_chain_up_ref                       673	3_0_0	EXIST::FUNCTION:
-OCSP_REQINFO_it                         674	3_0_0	EXIST::FUNCTION:OCSP
-PKCS12_add_localkeyid                   675	3_0_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_get0_type                676	3_0_0	EXIST::FUNCTION:
-X509_TRUST_set_default                  677	3_0_0	EXIST::FUNCTION:
-TXT_DB_read                             678	3_0_0	EXIST::FUNCTION:
-BN_sub                                  679	3_0_0	EXIST::FUNCTION:
-ASRange_free                            680	3_0_0	EXIST::FUNCTION:RFC3779
-EVP_aes_192_cfb8                        681	3_0_0	EXIST::FUNCTION:
-DSO_global_lookup                       682	3_0_0	EXIST::FUNCTION:
-PKCS7_SIGNER_INFO_it                    683	3_0_0	EXIST::FUNCTION:
-CRYPTO_ocb128_copy_ctx                  684	3_0_0	EXIST::FUNCTION:OCB
-TS_REQ_get_ext_d2i                      685	3_0_0	EXIST::FUNCTION:TS
-AES_ige_encrypt                         686	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-d2i_SXNET                               687	3_0_0	EXIST::FUNCTION:
-CTLOG_get0_log_id                       688	3_0_0	EXIST::FUNCTION:CT
-CMS_RecipientInfo_ktri_get0_signer_id   689	3_0_0	EXIST::FUNCTION:CMS
-OCSP_REQUEST_add1_ext_i2d               690	3_0_0	EXIST::FUNCTION:OCSP
-EVP_PBE_CipherInit                      691	3_0_0	EXIST::FUNCTION:
-DSA_dup_DH                              692	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH,DSA
-CONF_imodule_get_value                  693	3_0_0	EXIST::FUNCTION:
-OCSP_id_issuer_cmp                      694	3_0_0	EXIST::FUNCTION:OCSP
-ASN1_INTEGER_free                       695	3_0_0	EXIST::FUNCTION:
-BN_get0_nist_prime_224                  696	3_0_0	EXIST::FUNCTION:
-OPENSSL_isservice                       697	3_0_0	EXIST::FUNCTION:
-DH_compute_key                          698	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-TS_RESP_CTX_set_signer_key              699	3_0_0	EXIST::FUNCTION:TS
-i2d_DSAPrivateKey_bio                   700	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-ASN1_item_d2i                           702	3_0_0	EXIST::FUNCTION:
-BIO_int_ctrl                            703	3_0_0	EXIST::FUNCTION:
-CMS_ReceiptRequest_it                   704	3_0_0	EXIST::FUNCTION:CMS
-X509_ATTRIBUTE_get0_type                705	3_0_0	EXIST::FUNCTION:
-EVP_MD_meth_set_copy                    706	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-d2i_ASN1_ENUMERATED                     707	3_0_0	EXIST::FUNCTION:
-d2i_ASIdOrRange                         708	3_0_0	EXIST::FUNCTION:RFC3779
-i2s_ASN1_OCTET_STRING                   709	3_0_0	EXIST::FUNCTION:
-X509_add1_reject_object                 710	3_0_0	EXIST::FUNCTION:
-ERR_set_mark                            711	3_0_0	EXIST::FUNCTION:
-d2i_ASN1_VISIBLESTRING                  712	3_0_0	EXIST::FUNCTION:
-X509_NAME_ENTRY_dup                     714	3_0_0	EXIST::FUNCTION:
-X509_certificate_type                   715	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-PKCS7_add_signature                     716	3_0_0	EXIST::FUNCTION:
-OBJ_ln2nid                              717	3_0_0	EXIST::FUNCTION:
-CRYPTO_128_unwrap                       718	3_0_0	EXIST::FUNCTION:
-BIO_new_PKCS7                           719	3_0_0	EXIST::FUNCTION:
-UI_get0_user_data                       720	3_0_0	EXIST::FUNCTION:
-TS_RESP_get_token                       721	3_0_0	EXIST::FUNCTION:TS
-OCSP_RESPID_new                         722	3_0_0	EXIST::FUNCTION:OCSP
-ASN1_SET_ANY_it                         723	3_0_0	EXIST::FUNCTION:
-d2i_TS_RESP_bio                         724	3_0_0	EXIST::FUNCTION:TS
-PEM_write_X509_REQ                      725	3_0_0	EXIST::FUNCTION:STDIO
-BIO_snprintf                            726	3_0_0	EXIST::FUNCTION:
-EC_POINT_hex2point                      727	3_0_0	EXIST::FUNCTION:EC
-X509v3_get_ext_by_critical              728	3_0_0	EXIST::FUNCTION:
-ENGINE_get_default_RSA                  729	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-DSA_sign_setup                          730	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-OPENSSL_sk_new_null                     731	3_0_0	EXIST::FUNCTION:
-PEM_read_PKCS8                          732	3_0_0	EXIST::FUNCTION:STDIO
-BN_mod_sqr                              733	3_0_0	EXIST::FUNCTION:
-CAST_ofb64_encrypt                      734	3_0_0	EXIST::FUNCTION:CAST,DEPRECATEDIN_3_0
-TXT_DB_write                            735	3_0_0	EXIST::FUNCTION:
-OCSP_REQUEST_get1_ext_d2i               736	3_0_0	EXIST::FUNCTION:OCSP
-CMS_unsigned_add1_attr_by_NID           737	3_0_0	EXIST::FUNCTION:CMS
-BN_mod_exp_mont                         738	3_0_0	EXIST::FUNCTION:
-d2i_DHxparams                           739	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_size                                 740	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-CONF_imodule_get_name                   741	3_0_0	EXIST::FUNCTION:
-ENGINE_get_pkey_meth_engine             742	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-OCSP_BASICRESP_free                     743	3_0_0	EXIST::FUNCTION:OCSP
-BN_set_params                           744	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8
-BN_add                                  745	3_0_0	EXIST::FUNCTION:
-OPENSSL_sk_free                         746	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_get_ext_d2i                 747	3_0_0	EXIST::FUNCTION:TS
-RSA_check_key                           748	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-TS_MSG_IMPRINT_set_algo                 749	3_0_0	EXIST::FUNCTION:TS
-BN_nist_mod_521                         750	3_0_0	EXIST::FUNCTION:
-CRYPTO_THREAD_get_local                 751	3_0_0	EXIST::FUNCTION:
-PKCS7_to_TS_TST_INFO                    752	3_0_0	EXIST::FUNCTION:TS
-X509_STORE_CTX_new                      753	3_0_0	EXIST::FUNCTION:
-CTLOG_STORE_new                         754	3_0_0	EXIST::FUNCTION:CT
-EVP_CIPHER_meth_set_cleanup             755	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-d2i_PKCS12_SAFEBAG                      756	3_0_0	EXIST::FUNCTION:
-EVP_MD_get_pkey_type                    757	3_0_0	EXIST::FUNCTION:
-X509_policy_node_get0_qualifiers        758	3_0_0	EXIST::FUNCTION:
-OCSP_cert_status_str                    759	3_0_0	EXIST::FUNCTION:OCSP
-EVP_MD_meth_get_flags                   760	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_ENUMERATED_set                     761	3_0_0	EXIST::FUNCTION:
-UI_UTIL_read_pw                         762	3_0_0	EXIST::FUNCTION:
-PKCS7_ENC_CONTENT_free                  763	3_0_0	EXIST::FUNCTION:
-CMS_RecipientInfo_type                  764	3_0_0	EXIST::FUNCTION:CMS
-OCSP_BASICRESP_get_ext                  765	3_0_0	EXIST::FUNCTION:OCSP
-BN_lebin2bn                             766	3_0_0	EXIST::FUNCTION:
-AES_decrypt                             767	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BIO_fd_should_retry                     768	3_0_0	EXIST::FUNCTION:
-ASN1_STRING_new                         769	3_0_0	EXIST::FUNCTION:
-ENGINE_init                             770	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-TS_RESP_CTX_add_flags                   771	3_0_0	EXIST::FUNCTION:TS
-BIO_gethostbyname                       772	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SOCK
-X509V3_EXT_add                          773	3_0_0	EXIST::FUNCTION:
-UI_add_verify_string                    774	3_0_0	EXIST::FUNCTION:
-EVP_rc5_32_12_16_cfb64                  775	3_0_0	EXIST::FUNCTION:RC5
-PKCS7_dataVerify                        776	3_0_0	EXIST::FUNCTION:
-PKCS7_SIGNER_INFO_free                  777	3_0_0	EXIST::FUNCTION:
-PKCS7_add_attrib_smimecap               778	3_0_0	EXIST::FUNCTION:
-ERR_peek_last_error_line_data           779	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_set_sign                  780	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_i2d_bio                            781	3_0_0	EXIST::FUNCTION:
-DSA_verify                              782	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-i2a_ASN1_OBJECT                         783	3_0_0	EXIST::FUNCTION:
-i2d_PKEY_USAGE_PERIOD                   784	3_0_0	EXIST::FUNCTION:
-DSA_new                                 785	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-PEM_read_bio_X509_CRL                   786	3_0_0	EXIST::FUNCTION:
-PKCS7_dataDecode                        787	3_0_0	EXIST::FUNCTION:
-DSA_up_ref                              788	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-EVP_DecryptInit_ex                      789	3_0_0	EXIST::FUNCTION:
-CONF_get1_default_config_file           790	3_0_0	EXIST::FUNCTION:
-CRYPTO_ocb128_encrypt                   791	3_0_0	EXIST::FUNCTION:OCB
-EXTENDED_KEY_USAGE_new                  792	3_0_0	EXIST::FUNCTION:
-EVP_EncryptFinal                        793	3_0_0	EXIST::FUNCTION:
-PEM_write_ECPrivateKey                  794	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
-EVP_CIPHER_meth_set_get_asn1_params     796	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-PKCS7_dataInit                          797	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_app_data               798	3_0_0	EXIST::FUNCTION:
-a2i_GENERAL_NAME                        799	3_0_0	EXIST::FUNCTION:
-SXNETID_new                             800	3_0_0	EXIST::FUNCTION:
-RC4_options                             801	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC4
-BIO_f_null                              802	3_0_0	EXIST::FUNCTION:
-EC_GROUP_set_curve_name                 803	3_0_0	EXIST::FUNCTION:EC
-d2i_PBE2PARAM                           804	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_security_bits              805	3_0_0	EXIST::FUNCTION:
-PKCS12_unpack_p7encdata                 806	3_0_0	EXIST::FUNCTION:
-X509V3_EXT_i2d                          807	3_0_0	EXIST::FUNCTION:
-X509V3_get_value_bool                   808	3_0_0	EXIST::FUNCTION:
-X509_verify_cert_error_string           809	3_0_0	EXIST::FUNCTION:
-d2i_X509_PUBKEY                         810	3_0_0	EXIST::FUNCTION:
-i2a_ASN1_ENUMERATED                     811	3_0_0	EXIST::FUNCTION:
-PKCS7_ISSUER_AND_SERIAL_new             812	3_0_0	EXIST::FUNCTION:
-d2i_USERNOTICE                          813	3_0_0	EXIST::FUNCTION:
-X509_cmp                                814	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_set1_EC_KEY                    815	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-ECPKParameters_print_fp                 816	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
-GENERAL_SUBTREE_free                    817	3_0_0	EXIST::FUNCTION:
-RSA_blinding_off                        818	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-i2d_OCSP_REVOKEDINFO                    819	3_0_0	EXIST::FUNCTION:OCSP
-X509V3_add_standard_extensions          820	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_RSA_PUBKEY                821	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-i2d_ASN1_UTF8STRING                     822	3_0_0	EXIST::FUNCTION:
-TS_REQ_delete_ext                       823	3_0_0	EXIST::FUNCTION:TS
-PKCS7_DIGEST_free                       824	3_0_0	EXIST::FUNCTION:
-OBJ_nid2ln                              825	3_0_0	EXIST::FUNCTION:
-COMP_CTX_new                            826	3_0_0	EXIST::FUNCTION:COMP
-BIO_ADDR_family                         827	3_0_0	EXIST::FUNCTION:SOCK
-OCSP_RESPONSE_it                        828	3_0_0	EXIST::FUNCTION:OCSP
-BIO_ADDRINFO_socktype                   829	3_0_0	EXIST::FUNCTION:SOCK
-d2i_X509_REQ_bio                        830	3_0_0	EXIST::FUNCTION:
-EVP_PBE_cleanup                         831	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get0_current_crl         832	3_0_0	EXIST::FUNCTION:
-CMS_get0_SignerInfos                    833	3_0_0	EXIST::FUNCTION:CMS
-EVP_PKEY_paramgen                       834	3_0_0	EXIST::FUNCTION:
-PEM_write_PKCS8PrivateKey_nid           835	3_0_0	EXIST::FUNCTION:STDIO
-PKCS7_ATTR_VERIFY_it                    836	3_0_0	EXIST::FUNCTION:
-OCSP_response_status_str                837	3_0_0	EXIST::FUNCTION:OCSP
-CRYPTO_gcm128_new                       838	3_0_0	EXIST::FUNCTION:
-SMIME_read_PKCS7                        839	3_0_0	EXIST::FUNCTION:
-EC_GROUP_copy                           840	3_0_0	EXIST::FUNCTION:EC
-ENGINE_set_ciphers                      841	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-OPENSSL_LH_doall_arg                    842	3_0_0	EXIST::FUNCTION:
-OCSP_REQUEST_get_ext_by_NID             843	3_0_0	EXIST::FUNCTION:OCSP
-X509_REQ_get_attr_by_NID                844	3_0_0	EXIST::FUNCTION:
-PBE2PARAM_new                           845	3_0_0	EXIST::FUNCTION:
-DES_ecb_encrypt                         846	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-EVP_camellia_256_ecb                    847	3_0_0	EXIST::FUNCTION:CAMELLIA
-PEM_read_RSA_PUBKEY                     848	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
-d2i_NETSCAPE_SPKAC                      849	3_0_0	EXIST::FUNCTION:
-ASN1_TIME_check                         851	3_0_0	EXIST::FUNCTION:
-PKCS7_DIGEST_new                        852	3_0_0	EXIST::FUNCTION:
-i2d_TS_TST_INFO_fp                      853	3_0_0	EXIST::FUNCTION:STDIO,TS
-d2i_PKCS8_fp                            854	3_0_0	EXIST::FUNCTION:STDIO
-EVP_PKEY_keygen                         855	3_0_0	EXIST::FUNCTION:
-X509_CRL_dup                            856	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_cb                     857	3_0_0	EXIST::FUNCTION:
-X509_STORE_free                         858	3_0_0	EXIST::FUNCTION:
-ECDSA_sign_ex                           859	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-TXT_DB_insert                           860	3_0_0	EXIST::FUNCTION:
-EC_POINTs_make_affine                   861	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-RSA_padding_add_PKCS1_PSS               862	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BF_options                              863	3_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
-OCSP_BASICRESP_it                       864	3_0_0	EXIST::FUNCTION:OCSP
-X509_VERIFY_PARAM_get0_name             865	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_set_signer_digest           866	3_0_0	EXIST::FUNCTION:TS
-X509_VERIFY_PARAM_set1_email            867	3_0_0	EXIST::FUNCTION:
-BIO_sock_error                          868	3_0_0	EXIST::FUNCTION:SOCK
-RSA_set_default_method                  869	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BN_GF2m_mod_sqrt_arr                    870	3_0_0	EXIST::FUNCTION:EC2M
-X509_get0_extensions                    871	3_0_0	EXIST::FUNCTION:
-TS_STATUS_INFO_set_status               872	3_0_0	EXIST::FUNCTION:TS
-RSA_verify                              873	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_FBOOLEAN_it                        874	3_0_0	EXIST::FUNCTION:
-d2i_ASN1_TIME                           875	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_get_signctx               876	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EC_KEY_METHOD_set_compute_key           877	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_REQ_INFO_free                      878	3_0_0	EXIST::FUNCTION:
-CMS_ReceiptRequest_create0              879	3_0_0	EXIST::FUNCTION:CMS
-EVP_MD_meth_set_cleanup                 880	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_aes_128_xts                         881	3_0_0	EXIST::FUNCTION:
-TS_RESP_verify_signature                883	3_0_0	EXIST::FUNCTION:TS
-ENGINE_set_pkey_meths                   884	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-CMS_EncryptedData_decrypt               885	3_0_0	EXIST::FUNCTION:CMS
-CONF_module_add                         886	3_0_0	EXIST::FUNCTION:
-ASN1_UTCTIME_print                      887	3_0_0	EXIST::FUNCTION:
-X509_REQ_verify                         888	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_set_purpose           889	3_0_0	EXIST::FUNCTION:
-i2d_TS_MSG_IMPRINT_bio                  890	3_0_0	EXIST::FUNCTION:TS
-X509_EXTENSION_set_object               891	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_get_app_data             892	3_0_0	EXIST::FUNCTION:
-CRL_DIST_POINTS_it                      893	3_0_0	EXIST::FUNCTION:
-DIRECTORYSTRING_new                     894	3_0_0	EXIST::FUNCTION:
-ERR_load_ASYNC_strings                  895	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_bf_cfb64                            896	3_0_0	EXIST::FUNCTION:BF
-PKCS7_sign_add_signer                   897	3_0_0	EXIST::FUNCTION:
-X509_print_ex                           898	3_0_0	EXIST::FUNCTION:
-PKCS7_add_recipient                     899	3_0_0	EXIST::FUNCTION:
-OCSP_SINGLERESP_add_ext                 900	3_0_0	EXIST::FUNCTION:OCSP
-d2i_X509_SIG                            901	3_0_0	EXIST::FUNCTION:
-X509_NAME_set                           902	3_0_0	EXIST::FUNCTION:
-OPENSSL_sk_pop                          903	3_0_0	EXIST::FUNCTION:
-ENGINE_register_ciphers                 904	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-PKCS5_pbe2_set_iv                       905	3_0_0	EXIST::FUNCTION:
-ASN1_add_stable_module                  906	3_0_0	EXIST::FUNCTION:
-EVP_camellia_128_cbc                    907	3_0_0	EXIST::FUNCTION:CAMELLIA
-COMP_zlib                               908	3_0_0	EXIST::FUNCTION:COMP
-EVP_read_pw_string                      909	3_0_0	EXIST::FUNCTION:
-i2d_ASN1_NULL                           910	3_0_0	EXIST::FUNCTION:
-DES_encrypt1                            911	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-BN_mod_lshift1_quick                    912	3_0_0	EXIST::FUNCTION:
-BN_get_rfc3526_prime_6144               913	3_0_0	EXIST::FUNCTION:
-OBJ_obj2txt                             914	3_0_0	EXIST::FUNCTION:
-UI_set_result                           915	3_0_0	EXIST::FUNCTION:
-EVP_EncodeUpdate                        916	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_X509_CRL                  917	3_0_0	EXIST::FUNCTION:
-BN_cmp                                  918	3_0_0	EXIST::FUNCTION:
-CT_POLICY_EVAL_CTX_get0_log_store       919	3_0_0	EXIST::FUNCTION:CT
-CONF_set_default_method                 920	3_0_0	EXIST::FUNCTION:
-ASN1_PCTX_get_nm_flags                  921	3_0_0	EXIST::FUNCTION:
-X509_add1_ext_i2d                       922	3_0_0	EXIST::FUNCTION:
-i2d_PKCS7_RECIP_INFO                    924	3_0_0	EXIST::FUNCTION:
-PKCS1_MGF1                              925	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BIO_vsnprintf                           926	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get0_current_issuer      927	3_0_0	EXIST::FUNCTION:
-CRYPTO_secure_malloc_initialized        928	3_0_0	EXIST::FUNCTION:
-o2i_SCT_LIST                            929	3_0_0	EXIST::FUNCTION:CT
-ASN1_PCTX_get_cert_flags                930	3_0_0	EXIST::FUNCTION:
-X509at_add1_attr_by_NID                 931	3_0_0	EXIST::FUNCTION:
-DHparams_dup                            932	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-X509_get_ext                            933	3_0_0	EXIST::FUNCTION:
-X509_issuer_and_serial_hash             934	3_0_0	EXIST::FUNCTION:
-ASN1_BMPSTRING_it                       935	3_0_0	EXIST::FUNCTION:
-PEM_read_EC_PUBKEY                      936	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
-d2i_ASN1_IA5STRING                      937	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_ext_free                    938	3_0_0	EXIST::FUNCTION:TS
-i2d_X509_CRL_fp                         939	3_0_0	EXIST::FUNCTION:STDIO
-PKCS7_get0_signers                      940	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_set_ex_data              941	3_0_0	EXIST::FUNCTION:
-TS_VERIFY_CTX_set_certs                 942	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_4,TS
-BN_MONT_CTX_copy                        943	3_0_0	EXIST::FUNCTION:
-OPENSSL_INIT_new                        945	3_0_0	EXIST::FUNCTION:
-TS_ACCURACY_dup                         946	3_0_0	EXIST::FUNCTION:TS
-i2d_ECPrivateKey                        947	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_NAME_ENTRY_create_by_OBJ           948	3_0_0	EXIST::FUNCTION:
-TS_VERIFY_CTX_cleanup                   949	3_0_0	EXIST::FUNCTION:TS
-ASN1_INTEGER_get                        950	3_0_0	EXIST::FUNCTION:
-ASN1_PRINTABLE_it                       951	3_0_0	EXIST::FUNCTION:
-EVP_VerifyFinal                         952	3_0_0	EXIST::FUNCTION:
-TS_ASN1_INTEGER_print_bio               953	3_0_0	EXIST::FUNCTION:TS
-X509_NAME_ENTRY_set_object              954	3_0_0	EXIST::FUNCTION:
-BIO_s_socket                            955	3_0_0	EXIST::FUNCTION:SOCK
-EVP_rc5_32_12_16_ecb                    956	3_0_0	EXIST::FUNCTION:RC5
-i2d_PKCS8_bio                           957	3_0_0	EXIST::FUNCTION:
-v2i_ASN1_BIT_STRING                     958	3_0_0	EXIST::FUNCTION:
-PKEY_USAGE_PERIOD_new                   959	3_0_0	EXIST::FUNCTION:
-OBJ_NAME_init                           960	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_set_keygen                961	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_PSS_PARAMS_new                      962	3_0_0	EXIST::FUNCTION:
-RSA_sign                                963	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_DigestVerifyFinal                   964	3_0_0	EXIST::FUNCTION:
-d2i_RSA_PUBKEY_bio                      965	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-TS_RESP_dup                             966	3_0_0	EXIST::FUNCTION:TS
-ERR_set_error_data                      967	3_0_0	EXIST::FUNCTION:
-BN_RECP_CTX_new                         968	3_0_0	EXIST::FUNCTION:
-DES_options                             969	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-IPAddressChoice_it                      970	3_0_0	EXIST::FUNCTION:RFC3779
-ASN1_UNIVERSALSTRING_it                 971	3_0_0	EXIST::FUNCTION:
-d2i_DSAPublicKey                        972	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-ENGINE_get_name                         973	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-CRYPTO_THREAD_read_lock                 974	3_0_0	EXIST::FUNCTION:
-ASIdentifierChoice_free                 975	3_0_0	EXIST::FUNCTION:RFC3779
-BIO_dgram_sctp_msg_waiting              976	3_0_0	EXIST::FUNCTION:DGRAM,SCTP
-BN_is_bit_set                           978	3_0_0	EXIST::FUNCTION:
-AES_ofb128_encrypt                      979	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_STORE_add_lookup                   980	3_0_0	EXIST::FUNCTION:
-ASN1_GENERALSTRING_new                  981	3_0_0	EXIST::FUNCTION:
-IDEA_options                            982	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
-d2i_X509_REQ                            983	3_0_0	EXIST::FUNCTION:
-i2d_TS_STATUS_INFO                      984	3_0_0	EXIST::FUNCTION:TS
-X509_PURPOSE_get_by_id                  985	3_0_0	EXIST::FUNCTION:
-X509_get1_ocsp                          986	3_0_0	EXIST::FUNCTION:
-ISSUING_DIST_POINT_free                 987	3_0_0	EXIST::FUNCTION:
-ASN1_UTCTIME_free                       988	3_0_0	EXIST::FUNCTION:
-ERR_load_TS_strings                     989	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,TS
-BN_nist_mod_func                        990	3_0_0	EXIST::FUNCTION:
-OCSP_ONEREQ_new                         991	3_0_0	EXIST::FUNCTION:OCSP
-DSA_SIG_new                             992	3_0_0	EXIST::FUNCTION:DSA
-DH_get_default_method                   993	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-PEM_proc_type                           994	3_0_0	EXIST::FUNCTION:
-BIO_printf                              995	3_0_0	EXIST::FUNCTION:
-a2i_IPADDRESS                           996	3_0_0	EXIST::FUNCTION:
-ERR_peek_error_line_data                997	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ERR_unload_strings                      998	3_0_0	EXIST::FUNCTION:
-SEED_cfb128_encrypt                     999	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SEED
-ASN1_BIT_STRING_it                      1000	3_0_0	EXIST::FUNCTION:
-PKCS12_decrypt_skey                     1001	3_0_0	EXIST::FUNCTION:
-ENGINE_register_EC                      1002	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-OCSP_RESPONSE_new                       1003	3_0_0	EXIST::FUNCTION:OCSP
-CRYPTO_cbc128_encrypt                   1004	3_0_0	EXIST::FUNCTION:
-i2d_RSAPublicKey_bio                    1005	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_chain_check_suiteb                 1006	3_0_0	EXIST::FUNCTION:
-i2d_OCSP_REQUEST                        1007	3_0_0	EXIST::FUNCTION:OCSP
-BN_X931_generate_Xpq                    1008	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_item_digest                        1009	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_set_trust             1010	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_error                1011	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_set_encrypt               1012	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_UTCTIME_it                         1013	3_0_0	EXIST::FUNCTION:
-i2d_DSA_PUBKEY_fp                       1014	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
-X509at_get_attr_by_OBJ                  1015	3_0_0	EXIST::FUNCTION:
-EVP_MD_CTX_copy_ex                      1016	3_0_0	EXIST::FUNCTION:
-UI_dup_error_string                     1017	3_0_0	EXIST::FUNCTION:
-OPENSSL_LH_num_items                    1018	3_0_0	EXIST::FUNCTION:
-ASN1_INTEGER_cmp                        1020	3_0_0	EXIST::FUNCTION:
-X509_NAME_entry_count                   1021	3_0_0	EXIST::FUNCTION:
-UI_method_set_closer                    1022	3_0_0	EXIST::FUNCTION:
-OPENSSL_LH_get_down_load                1023	3_0_0	EXIST::FUNCTION:
-EVP_md4                                 1024	3_0_0	EXIST::FUNCTION:MD4
-X509_set_subject_name                   1025	3_0_0	EXIST::FUNCTION:
-i2d_PKCS8PrivateKey_nid_bio             1026	3_0_0	EXIST::FUNCTION:
-ERR_put_error                           1027	3_0_0	NOEXIST::FUNCTION:
-ERR_add_error_data                      1028	3_0_0	EXIST::FUNCTION:
-X509_ALGORS_it                          1029	3_0_0	EXIST::FUNCTION:
-MD5_Update                              1030	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
-X509_policy_check                       1031	3_0_0	EXIST::FUNCTION:
-X509_CRL_METHOD_new                     1032	3_0_0	EXIST::FUNCTION:
-ASN1_ANY_it                             1033	3_0_0	EXIST::FUNCTION:
-d2i_DSA_SIG                             1034	3_0_0	EXIST::FUNCTION:DSA
-DH_free                                 1035	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-ENGINE_register_all_DSA                 1036	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-TS_REQ_set_msg_imprint                  1037	3_0_0	EXIST::FUNCTION:TS
-BN_mod_sub_quick                        1038	3_0_0	EXIST::FUNCTION:
-SMIME_write_CMS                         1039	3_0_0	EXIST::FUNCTION:CMS
-i2d_DSAPublicKey                        1040	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-SMIME_text                              1042	3_0_0	EXIST::FUNCTION:
-PKCS7_add_recipient_info                1043	3_0_0	EXIST::FUNCTION:
-BN_get_word                             1044	3_0_0	EXIST::FUNCTION:
-EVP_CipherFinal                         1045	3_0_0	EXIST::FUNCTION:
-i2d_X509_bio                            1046	3_0_0	EXIST::FUNCTION:
-X509_EXTENSION_new                      1047	3_0_0	EXIST::FUNCTION:
-X509_getm_notAfter                      1048	3_0_0	EXIST::FUNCTION:
-X509_ALGOR_dup                          1049	3_0_0	EXIST::FUNCTION:
-d2i_X509_REQ_INFO                       1050	3_0_0	EXIST::FUNCTION:
-d2i_EC_PUBKEY_bio                       1051	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_STORE_CTX_set_error                1052	3_0_0	EXIST::FUNCTION:
-EC_KEY_METHOD_set_keygen                1053	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-CRYPTO_free                             1054	3_0_0	EXIST::FUNCTION:
-BN_GF2m_mod_exp                         1055	3_0_0	EXIST::FUNCTION:EC2M
-OPENSSL_buf2hexstr                      1056	3_0_0	EXIST::FUNCTION:
-DES_encrypt2                            1057	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-DH_up_ref                               1058	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-RC2_ofb64_encrypt                       1059	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC2
-PKCS12_pbe_crypt                        1060	3_0_0	EXIST::FUNCTION:
-ASIdentifiers_free                      1061	3_0_0	EXIST::FUNCTION:RFC3779
-X509_VERIFY_PARAM_get0                  1062	3_0_0	EXIST::FUNCTION:
-EVP_MD_meth_get_input_blocksize         1063	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-TS_ACCURACY_get_micros                  1064	3_0_0	EXIST::FUNCTION:TS
-PKCS12_SAFEBAG_create_cert              1065	3_0_0	EXIST::FUNCTION:
-CRYPTO_mem_debug_malloc                 1066	3_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
-RAND_seed                               1067	3_0_0	EXIST::FUNCTION:
-NETSCAPE_SPKAC_free                     1068	3_0_0	EXIST::FUNCTION:
-X509_CRL_diff                           1069	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_set_flags             1070	3_0_0	EXIST::FUNCTION:
-X509_EXTENSION_set_data                 1071	3_0_0	EXIST::FUNCTION:
-ENGINE_get_EC                           1072	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ASN1_STRING_copy                        1073	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_encrypt_old                    1074	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OPENSSL_LH_free                         1075	3_0_0	EXIST::FUNCTION:
-DES_is_weak_key                         1076	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-EVP_PKEY_verify                         1077	3_0_0	EXIST::FUNCTION:
-ERR_load_BIO_strings                    1078	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BIO_nread                               1079	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_RSAPrivateKey              1080	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OBJ_nid2obj                             1081	3_0_0	EXIST::FUNCTION:
-CRYPTO_ofb128_encrypt                   1082	3_0_0	EXIST::FUNCTION:
-ENGINE_set_init_function                1083	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-NCONF_default                           1084	3_0_0	EXIST::FUNCTION:
-ENGINE_remove                           1085	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ASYNC_get_current_job                   1086	3_0_0	EXIST::FUNCTION:
-OBJ_nid2sn                              1087	3_0_0	EXIST::FUNCTION:
-X509_gmtime_adj                         1088	3_0_0	EXIST::FUNCTION:
-X509_add_ext                            1089	3_0_0	EXIST::FUNCTION:
-ENGINE_set_DSA                          1090	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EC_KEY_METHOD_set_sign                  1091	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-d2i_TS_MSG_IMPRINT                      1092	3_0_0	EXIST::FUNCTION:TS
-X509_print_ex_fp                        1093	3_0_0	EXIST::FUNCTION:STDIO
-ERR_load_PEM_strings                    1094	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ENGINE_unregister_pkey_asn1_meths       1095	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-IPAddressFamily_free                    1096	3_0_0	EXIST::FUNCTION:RFC3779
-UI_method_get_prompt_constructor        1097	3_0_0	EXIST::FUNCTION:
-ASN1_NULL_it                            1098	3_0_0	EXIST::FUNCTION:
-X509_REQ_get_pubkey                     1099	3_0_0	EXIST::FUNCTION:
-X509_CRL_set1_nextUpdate                1100	3_0_0	EXIST::FUNCTION:
-EVP_des_ede3_cfb64                      1101	3_0_0	EXIST::FUNCTION:DES
-BN_to_ASN1_INTEGER                      1102	3_0_0	EXIST::FUNCTION:
-EXTENDED_KEY_USAGE_free                 1103	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_EC_PUBKEY                  1104	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-BN_MONT_CTX_set                         1105	3_0_0	EXIST::FUNCTION:
-TS_CONF_set_serial                      1106	3_0_0	EXIST::FUNCTION:TS
-X509_NAME_ENTRY_new                     1107	3_0_0	EXIST::FUNCTION:
-RSA_security_bits                       1108	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509v3_addr_add_prefix                  1109	3_0_0	EXIST::FUNCTION:RFC3779
-X509_REQ_print_fp                       1110	3_0_0	EXIST::FUNCTION:STDIO
-ASN1_item_ex_new                        1111	3_0_0	EXIST::FUNCTION:
-BIO_s_datagram                          1112	3_0_0	EXIST::FUNCTION:DGRAM
-PEM_write_bio_PKCS8                     1113	3_0_0	EXIST::FUNCTION:
-ASN1_str2mask                           1114	3_0_0	EXIST::FUNCTION:
-ASN1_TYPE_get                           1115	3_0_0	EXIST::FUNCTION:
-i2d_X509_EXTENSIONS                     1116	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get0_store               1117	3_0_0	EXIST::FUNCTION:
-PKCS12_pack_p7data                      1118	3_0_0	EXIST::FUNCTION:
-RSA_print_fp                            1119	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
-OPENSSL_INIT_set_config_appname         1120	3_0_0	EXIST::FUNCTION:STDIO
-EC_KEY_print_fp                         1121	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
-BIO_dup_chain                           1122	3_0_0	EXIST::FUNCTION:
-PKCS8_PRIV_KEY_INFO_it                  1123	3_0_0	EXIST::FUNCTION:
-RSA_OAEP_PARAMS_free                    1124	3_0_0	EXIST::FUNCTION:
-ASN1_item_new                           1125	3_0_0	EXIST::FUNCTION:
-CRYPTO_cts128_encrypt                   1126	3_0_0	EXIST::FUNCTION:
-RC2_encrypt                             1127	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC2
-PEM_write                               1128	3_0_0	EXIST::FUNCTION:STDIO
-EVP_CIPHER_meth_get_get_asn1_params     1129	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-i2d_OCSP_RESPBYTES                      1130	3_0_0	EXIST::FUNCTION:OCSP
-d2i_ASN1_UTF8STRING                     1131	3_0_0	EXIST::FUNCTION:
-EXTENDED_KEY_USAGE_it                   1132	3_0_0	EXIST::FUNCTION:
-EVP_CipherInit                          1133	3_0_0	EXIST::FUNCTION:
-PKCS12_add_safe                         1134	3_0_0	EXIST::FUNCTION:
-ENGINE_get_digest                       1135	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EC_GROUP_have_precompute_mult           1136	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-OPENSSL_gmtime                          1137	3_0_0	EXIST::FUNCTION:
-X509_set_issuer_name                    1138	3_0_0	EXIST::FUNCTION:
-RSA_new                                 1139	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_STRING_set_by_NID                  1140	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_PKCS7                     1141	3_0_0	EXIST::FUNCTION:
-MDC2_Final                              1142	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MDC2
-SMIME_crlf_copy                         1143	3_0_0	EXIST::FUNCTION:
-OCSP_REQUEST_get_ext_count              1144	3_0_0	EXIST::FUNCTION:OCSP
-OSSL_HTTP_REQ_CTX_new                   1145	3_0_0	EXIST::FUNCTION:HTTP
-X509_load_cert_crl_file                 1146	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_new_mac_key                    1147	3_0_0	EXIST::FUNCTION:
-DIST_POINT_new                          1148	3_0_0	EXIST::FUNCTION:
-BN_is_prime_fasttest                    1149	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8
-EC_POINT_dup                            1150	3_0_0	EXIST::FUNCTION:EC
-PKCS5_v2_scrypt_keyivgen                1151	3_0_0	EXIST::FUNCTION:SCRYPT
-X509_STORE_CTX_set0_param               1152	3_0_0	EXIST::FUNCTION:
-DES_check_key_parity                    1153	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-EVP_aes_256_ocb                         1154	3_0_0	EXIST::FUNCTION:OCB
-X509_VAL_free                           1155	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get1_certs               1156	3_0_0	EXIST::FUNCTION:
-PEM_write_RSA_PUBKEY                    1157	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
-PKCS12_SAFEBAG_get0_p8inf               1158	3_0_0	EXIST::FUNCTION:
-X509_CRL_set_issuer_name                1159	3_0_0	EXIST::FUNCTION:
-CMS_EncryptedData_encrypt               1160	3_0_0	EXIST::FUNCTION:CMS
-ASN1_tag2str                            1161	3_0_0	EXIST::FUNCTION:
-BN_zero_ex                              1162	3_0_0	EXIST::FUNCTION:
-X509_NAME_dup                           1163	3_0_0	EXIST::FUNCTION:
-SCT_LIST_print                          1164	3_0_0	EXIST::FUNCTION:CT
-NOTICEREF_it                            1165	3_0_0	EXIST::FUNCTION:
-CMS_add0_crl                            1166	3_0_0	EXIST::FUNCTION:CMS
-d2i_DSAparams                           1167	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-EVP_CIPHER_CTX_set_app_data             1168	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_param_to_asn1                1169	3_0_0	EXIST::FUNCTION:
-TS_CONF_set_certs                       1170	3_0_0	EXIST::FUNCTION:TS
-BN_security_bits                        1171	3_0_0	EXIST::FUNCTION:
-X509_PURPOSE_get0_name                  1172	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_get_serial                  1173	3_0_0	EXIST::FUNCTION:TS
-ASN1_PCTX_get_str_flags                 1174	3_0_0	EXIST::FUNCTION:
-SHA256                                  1175	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_hash_dir                    1176	3_0_0	EXIST::FUNCTION:
-ASN1_BIT_STRING_check                   1177	3_0_0	EXIST::FUNCTION:
-ENGINE_set_default_RAND                 1178	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-BIO_connect                             1179	3_0_0	EXIST::FUNCTION:SOCK
-TS_TST_INFO_add_ext                     1180	3_0_0	EXIST::FUNCTION:TS
-EVP_aes_192_ccm                         1181	3_0_0	EXIST::FUNCTION:
-X509V3_add_value                        1182	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set0_keygen_info           1183	3_0_0	EXIST::FUNCTION:
-ENGINE_unregister_digests               1184	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-IPAddressOrRange_new                    1185	3_0_0	EXIST::FUNCTION:RFC3779
-EVP_aes_256_ofb                         1186	3_0_0	EXIST::FUNCTION:
-CRYPTO_mem_debug_push                   1187	3_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
-X509_PKEY_new                           1188	3_0_0	EXIST::FUNCTION:
-X509_get_key_usage                      1189	3_0_0	EXIST::FUNCTION:
-X509_ATTRIBUTE_create_by_txt            1190	3_0_0	EXIST::FUNCTION:
-PEM_SignFinal                           1191	3_0_0	EXIST::FUNCTION:
-PEM_bytes_read_bio                      1192	3_0_0	EXIST::FUNCTION:
-X509_signature_dump                     1193	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_set_def_policy              1194	3_0_0	EXIST::FUNCTION:TS
-RAND_pseudo_bytes                       1195	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
-DES_ofb_encrypt                         1196	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-EVP_add_digest                          1197	3_0_0	EXIST::FUNCTION:
-ASN1_item_sign_ctx                      1198	3_0_0	EXIST::FUNCTION:
-BIO_dump_indent_cb                      1199	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_set_depth             1200	3_0_0	EXIST::FUNCTION:
-DES_ecb3_encrypt                        1201	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-OBJ_obj2nid                             1202	3_0_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_free                     1203	3_0_0	EXIST::FUNCTION:
-EVP_cast5_cfb64                         1204	3_0_0	EXIST::FUNCTION:CAST
-OPENSSL_uni2asc                         1205	3_0_0	EXIST::FUNCTION:
-SCT_validation_status_string            1206	3_0_0	EXIST::FUNCTION:CT
-PKCS7_add_attribute                     1207	3_0_0	EXIST::FUNCTION:
-ENGINE_register_DSA                     1208	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-OPENSSL_LH_node_stats                   1209	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_1,STDIO
-X509_policy_tree_free                   1210	3_0_0	EXIST::FUNCTION:
-EC_GFp_simple_method                    1211	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_it                                 1212	3_0_0	EXIST::FUNCTION:
-d2i_PROXY_POLICY                        1213	3_0_0	EXIST::FUNCTION:
-MDC2_Update                             1214	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MDC2
-EC_KEY_new_by_curve_name                1215	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_CRL_free                           1216	3_0_0	EXIST::FUNCTION:
-i2d_PKCS7_SIGN_ENVELOPE                 1217	3_0_0	EXIST::FUNCTION:
-OCSP_CERTSTATUS_it                      1218	3_0_0	EXIST::FUNCTION:OCSP
-BIO_f_reliable                          1219	3_0_0	EXIST::FUNCTION:
-OCSP_resp_count                         1220	3_0_0	EXIST::FUNCTION:OCSP
-i2d_X509_AUX                            1221	3_0_0	EXIST::FUNCTION:
-RSA_verify_PKCS1_PSS_mgf1               1222	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_time_adj                           1223	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_find_str                  1224	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_get_flags             1225	3_0_0	EXIST::FUNCTION:
-OPENSSL_DIR_end                         1226	3_0_0	EXIST::FUNCTION:
-EC_GROUP_new                            1227	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-CMS_SignerInfo_get0_pkey_ctx            1228	3_0_0	EXIST::FUNCTION:CMS
-d2i_ASN1_PRINTABLESTRING                1229	3_0_0	EXIST::FUNCTION:
-CMS_RecipientInfo_ktri_cert_cmp         1230	3_0_0	EXIST::FUNCTION:CMS
-CMS_decrypt_set1_pkey                   1231	3_0_0	EXIST::FUNCTION:CMS
-PKCS7_RECIP_INFO_set                    1232	3_0_0	EXIST::FUNCTION:
-EC_POINT_is_on_curve                    1233	3_0_0	EXIST::FUNCTION:EC
-PKCS12_add_cert                         1234	3_0_0	EXIST::FUNCTION:
-X509_NAME_hash_old                      1235	3_0_0	EXIST::FUNCTION:
-PBKDF2PARAM_free                        1236	3_0_0	EXIST::FUNCTION:
-i2d_CMS_ContentInfo                     1237	3_0_0	EXIST::FUNCTION:CMS
-EVP_CIPHER_meth_set_ctrl                1238	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_public_decrypt                      1239	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ENGINE_get_id                           1240	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-PKCS12_item_decrypt_d2i                 1241	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_DSAparams                  1242	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-X509_CRL_cmp                            1243	3_0_0	EXIST::FUNCTION:
-DSO_METHOD_openssl                      1244	3_0_0	EXIST::FUNCTION:
-d2i_PrivateKey_fp                       1245	3_0_0	EXIST::FUNCTION:STDIO
-i2d_NETSCAPE_CERT_SEQUENCE              1246	3_0_0	EXIST::FUNCTION:
-EC_POINT_oct2point                      1248	3_0_0	EXIST::FUNCTION:EC
-EVP_CIPHER_CTX_buf_noconst              1249	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OPENSSL_DIR_read                        1250	3_0_0	EXIST::FUNCTION:
-CMS_add_smimecap                        1251	3_0_0	EXIST::FUNCTION:CMS
-X509_check_email                        1252	3_0_0	EXIST::FUNCTION:
-CRYPTO_cts128_decrypt_block             1253	3_0_0	EXIST::FUNCTION:
-UI_method_get_opener                    1254	3_0_0	EXIST::FUNCTION:
-EVP_aes_192_gcm                         1255	3_0_0	EXIST::FUNCTION:
-TS_CONF_set_tsa_name                    1256	3_0_0	EXIST::FUNCTION:TS
-X509_email_free                         1257	3_0_0	EXIST::FUNCTION:
-BIO_get_callback                        1258	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OPENSSL_sk_shift                        1259	3_0_0	EXIST::FUNCTION:
-i2d_X509_REVOKED                        1260	3_0_0	EXIST::FUNCTION:
-CMS_sign                                1261	3_0_0	EXIST::FUNCTION:CMS
-X509_STORE_add_cert                     1262	3_0_0	EXIST::FUNCTION:
-EC_GROUP_precompute_mult                1263	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-d2i_DISPLAYTEXT                         1265	3_0_0	EXIST::FUNCTION:
-HMAC_CTX_copy                           1266	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CRYPTO_gcm128_init                      1267	3_0_0	EXIST::FUNCTION:
-i2d_X509_CINF                           1268	3_0_0	EXIST::FUNCTION:
-X509_REVOKED_delete_ext                 1269	3_0_0	EXIST::FUNCTION:
-RC5_32_cfb64_encrypt                    1270	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC5
-TS_REQ_set_cert_req                     1271	3_0_0	EXIST::FUNCTION:TS
-TXT_DB_get_by_index                     1272	3_0_0	EXIST::FUNCTION:
-X509_check_ca                           1273	3_0_0	EXIST::FUNCTION:
-DH_get_2048_224                         1274	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-X509_load_http                          1275	3_0_0	EXIST::FUNCTION:
-i2d_AUTHORITY_INFO_ACCESS               1276	3_0_0	EXIST::FUNCTION:
-EVP_get_cipherbyname                    1277	3_0_0	EXIST::FUNCTION:
-CONF_dump_fp                            1278	3_0_0	EXIST::FUNCTION:STDIO
-d2i_DIST_POINT_NAME                     1279	3_0_0	EXIST::FUNCTION:
-ASN1_INTEGER_set_int64                  1280	3_0_0	EXIST::FUNCTION:
-ASN1_TIME_free                          1281	3_0_0	EXIST::FUNCTION:
-i2o_SCT_LIST                            1282	3_0_0	EXIST::FUNCTION:CT
-AES_encrypt                             1283	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-MD5_Init                                1284	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
-UI_add_error_string                     1285	3_0_0	EXIST::FUNCTION:
-X509_TRUST_cleanup                      1286	3_0_0	EXIST::FUNCTION:
-PEM_read_X509                           1287	3_0_0	EXIST::FUNCTION:STDIO
-EC_KEY_new_method                       1288	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-i2d_RSAPublicKey_fp                     1289	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
-CRYPTO_ctr128_encrypt_ctr32             1290	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_move_peername         1291	3_0_0	EXIST::FUNCTION:
-OCSP_SINGLERESP_it                      1292	3_0_0	EXIST::FUNCTION:OCSP
-BN_num_bits                             1293	3_0_0	EXIST::FUNCTION:
-X509_CRL_METHOD_free                    1294	3_0_0	EXIST::FUNCTION:
-PEM_read_NETSCAPE_CERT_SEQUENCE         1295	3_0_0	EXIST::FUNCTION:STDIO
-OPENSSL_load_builtin_modules            1296	3_0_0	EXIST::FUNCTION:
-X509_set_version                        1297	3_0_0	EXIST::FUNCTION:
-i2d_EC_PUBKEY_bio                       1298	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_REQ_get_attr_count                 1299	3_0_0	EXIST::FUNCTION:
-CMS_set1_signers_certs                  1300	3_0_0	EXIST::FUNCTION:CMS
-TS_ACCURACY_free                        1301	3_0_0	EXIST::FUNCTION:TS
-PEM_write_DSA_PUBKEY                    1302	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
-BN_rshift1                              1303	3_0_0	EXIST::FUNCTION:
-i2d_PKCS7_ENVELOPE                      1304	3_0_0	EXIST::FUNCTION:
-PBKDF2PARAM_it                          1305	3_0_0	EXIST::FUNCTION:
-UI_get_result_maxsize                   1306	3_0_0	EXIST::FUNCTION:
-PBEPARAM_it                             1307	3_0_0	EXIST::FUNCTION:
-TS_ACCURACY_set_seconds                 1308	3_0_0	EXIST::FUNCTION:TS
-UI_get0_action_string                   1309	3_0_0	EXIST::FUNCTION:
-RC2_decrypt                             1310	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC2
-OPENSSL_atexit                          1311	3_0_0	EXIST::FUNCTION:
-CMS_add_standard_smimecap               1312	3_0_0	EXIST::FUNCTION:CMS
-PKCS7_add_attrib_content_type           1313	3_0_0	EXIST::FUNCTION:
-BN_BLINDING_set_flags                   1314	3_0_0	EXIST::FUNCTION:
-ERR_peek_last_error                     1315	3_0_0	EXIST::FUNCTION:
-ENGINE_set_cmd_defns                    1316	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-d2i_ASN1_NULL                           1317	3_0_0	EXIST::FUNCTION:
-RAND_event                              1318	3_0_0	EXIST:_WIN32:FUNCTION:DEPRECATEDIN_1_1_0
-i2d_PKCS12_fp                           1319	3_0_0	EXIST::FUNCTION:STDIO
-EVP_PKEY_meth_get_init                  1320	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_check_trust                        1321	3_0_0	EXIST::FUNCTION:
-b2i_PrivateKey                          1322	3_0_0	EXIST::FUNCTION:
-HMAC_Init_ex                            1323	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-SMIME_read_CMS                          1324	3_0_0	EXIST::FUNCTION:CMS
-X509_subject_name_cmp                   1325	3_0_0	EXIST::FUNCTION:
-CRYPTO_ocb128_finish                    1326	3_0_0	EXIST::FUNCTION:OCB
-EVP_CIPHER_do_all                       1327	3_0_0	EXIST::FUNCTION:
-POLICY_MAPPINGS_it                      1328	3_0_0	EXIST::FUNCTION:
-SCT_set0_log_id                         1329	3_0_0	EXIST::FUNCTION:CT
-CRYPTO_cfb128_encrypt                   1330	3_0_0	EXIST::FUNCTION:
-RSA_padding_add_PKCS1_type_2            1331	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-TS_CONF_set_signer_cert                 1332	3_0_0	EXIST::FUNCTION:TS
-i2d_ASN1_OBJECT                         1333	3_0_0	EXIST::FUNCTION:
-d2i_PKCS8_PRIV_KEY_INFO_bio             1334	3_0_0	EXIST::FUNCTION:
-X509V3_add_value_int                    1335	3_0_0	EXIST::FUNCTION:
-TS_REQ_set_nonce                        1336	3_0_0	EXIST::FUNCTION:TS
-Camellia_ctr128_encrypt                 1337	3_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
-X509_LOOKUP_new                         1338	3_0_0	EXIST::FUNCTION:
-AUTHORITY_INFO_ACCESS_new               1339	3_0_0	EXIST::FUNCTION:
-CRYPTO_mem_leaks_fp                     1340	3_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0,STDIO
-DES_set_key_unchecked                   1341	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-BN_free                                 1342	3_0_0	EXIST::FUNCTION:
-EVP_aes_128_cfb1                        1343	3_0_0	EXIST::FUNCTION:
-EC_KEY_get0_group                       1344	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-PEM_write_bio_CMS_stream                1345	3_0_0	EXIST::FUNCTION:CMS
-BIO_f_linebuffer                        1346	3_0_0	EXIST::FUNCTION:
-ASN1_item_d2i_bio                       1347	3_0_0	EXIST::FUNCTION:
-ENGINE_get_flags                        1348	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-OCSP_resp_find                          1349	3_0_0	EXIST::FUNCTION:OCSP
-OPENSSL_LH_node_usage_stats_bio         1350	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_1
-EVP_PKEY_encrypt                        1351	3_0_0	EXIST::FUNCTION:
-CRYPTO_cfb128_8_encrypt                 1352	3_0_0	EXIST::FUNCTION:
-SXNET_get_id_INTEGER                    1353	3_0_0	EXIST::FUNCTION:
-CRYPTO_clear_free                       1354	3_0_0	EXIST::FUNCTION:
-i2v_GENERAL_NAME                        1355	3_0_0	EXIST::FUNCTION:
-PKCS7_ENC_CONTENT_new                   1356	3_0_0	EXIST::FUNCTION:
-CRYPTO_realloc                          1357	3_0_0	EXIST::FUNCTION:
-BIO_ctrl_pending                        1358	3_0_0	EXIST::FUNCTION:
-EVP_MD_meth_new                         1360	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_sign_ctx                           1361	3_0_0	EXIST::FUNCTION:
-BN_is_odd                               1362	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_current_cert         1363	3_0_0	EXIST::FUNCTION:
-ASN1_ENUMERATED_get_int64               1364	3_0_0	EXIST::FUNCTION:
-ASN1_SCTX_get_app_data                  1365	3_0_0	EXIST::FUNCTION:
-X509_get_default_cert_file_env          1366	3_0_0	EXIST::FUNCTION:
-X509v3_addr_validate_resource_set       1367	3_0_0	EXIST::FUNCTION:RFC3779
-d2i_X509_VAL                            1368	3_0_0	EXIST::FUNCTION:
-CRYPTO_gcm128_decrypt_ctr32             1370	3_0_0	EXIST::FUNCTION:
-DHparams_print                          1371	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-OPENSSL_sk_unshift                      1372	3_0_0	EXIST::FUNCTION:
-BN_GENCB_set_old                        1373	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_X509                      1374	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_free                      1375	3_0_0	EXIST::FUNCTION:
-ENGINE_unregister_DH                    1376	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-PROXY_CERT_INFO_EXTENSION_it            1377	3_0_0	EXIST::FUNCTION:
-CT_POLICY_EVAL_CTX_set1_cert            1378	3_0_0	EXIST::FUNCTION:CT
-X509_NAME_hash_ex                       1379	3_0_0	EXIST::FUNCTION:
-SCT_set_timestamp                       1380	3_0_0	EXIST::FUNCTION:CT
-UI_new                                  1381	3_0_0	EXIST::FUNCTION:
-TS_REQ_get_msg_imprint                  1382	3_0_0	EXIST::FUNCTION:TS
-i2d_PKCS12_BAGS                         1383	3_0_0	EXIST::FUNCTION:
-CERTIFICATEPOLICIES_free                1385	3_0_0	EXIST::FUNCTION:
-X509V3_get_section                      1386	3_0_0	EXIST::FUNCTION:
-BIO_parse_hostserv                      1387	3_0_0	EXIST::FUNCTION:SOCK
-EVP_PKEY_meth_set_cleanup               1388	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-PROXY_CERT_INFO_EXTENSION_free          1389	3_0_0	EXIST::FUNCTION:
-X509_dup                                1390	3_0_0	EXIST::FUNCTION:
-EDIPARTYNAME_free                       1391	3_0_0	EXIST::FUNCTION:
-X509_CRL_add0_revoked                   1393	3_0_0	EXIST::FUNCTION:
-GENERAL_NAME_set0_value                 1394	3_0_0	EXIST::FUNCTION:
-X509_ATTRIBUTE_dup                      1395	3_0_0	EXIST::FUNCTION:
-EC_GROUP_check_discriminant             1396	3_0_0	EXIST::FUNCTION:EC
-PKCS12_MAC_DATA_free                    1397	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_PrivateKey                 1398	3_0_0	EXIST::FUNCTION:
-d2i_PKCS7_ENCRYPT                       1399	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_ctrl                       1400	3_0_0	EXIST::FUNCTION:
-X509_REQ_set_pubkey                     1401	3_0_0	EXIST::FUNCTION:
-UI_create_method                        1402	3_0_0	EXIST::FUNCTION:
-X509_REQ_add_extensions_nid             1403	3_0_0	EXIST::FUNCTION:
-PEM_X509_INFO_write_bio                 1404	3_0_0	EXIST::FUNCTION:
-BIO_dump_cb                             1405	3_0_0	EXIST::FUNCTION:
-v2i_GENERAL_NAMES                       1406	3_0_0	EXIST::FUNCTION:
-EVP_des_ede3_ofb                        1407	3_0_0	EXIST::FUNCTION:DES
-EVP_MD_meth_get_cleanup                 1408	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-SRP_Calc_server_key                     1409	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-BN_mod_exp_simple                       1410	3_0_0	EXIST::FUNCTION:
-BIO_set_ex_data                         1411	3_0_0	EXIST::FUNCTION:
-SHA512                                  1412	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_explicit_policy      1413	3_0_0	EXIST::FUNCTION:
-EVP_DecodeBlock                         1414	3_0_0	EXIST::FUNCTION:
-OSSL_HTTP_REQ_CTX_set_request_line      1415	3_0_0	EXIST::FUNCTION:HTTP
-EVP_MD_CTX_reset                        1416	3_0_0	EXIST::FUNCTION:
-X509_NAME_new                           1417	3_0_0	EXIST::FUNCTION:
-ASN1_item_pack                          1418	3_0_0	EXIST::FUNCTION:
-ASN1_BIT_STRING_set_asc                 1419	3_0_0	EXIST::FUNCTION:
-d2i_GENERAL_NAME                        1420	3_0_0	EXIST::FUNCTION:
-i2d_ESS_CERT_ID                         1421	3_0_0	EXIST::FUNCTION:
-X509_TRUST_get_by_id                    1422	3_0_0	EXIST::FUNCTION:
-d2i_RSA_PUBKEY_fp                       1423	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
-EVP_PBE_get                             1424	3_0_0	EXIST::FUNCTION:
-CRYPTO_nistcts128_encrypt               1425	3_0_0	EXIST::FUNCTION:
-CONF_modules_finish                     1426	3_0_0	EXIST::FUNCTION:
-BN_value_one                            1427	3_0_0	EXIST::FUNCTION:
-RSA_padding_add_SSLv23                  1428	3_0_0	NOEXIST::FUNCTION:DEPRECATEDIN_3_0
-OCSP_RESPBYTES_it                       1429	3_0_0	EXIST::FUNCTION:OCSP
-EVP_aes_192_wrap                        1430	3_0_0	EXIST::FUNCTION:
-OCSP_CERTID_it                          1431	3_0_0	EXIST::FUNCTION:OCSP
-ENGINE_get_RSA                          1432	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-RAND_get_rand_method                    1433	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ERR_load_DSA_strings                    1434	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-ASN1_check_infinite_end                 1435	3_0_0	EXIST::FUNCTION:
-i2d_PKCS7_DIGEST                        1436	3_0_0	EXIST::FUNCTION:
-ERR_lib_error_string                    1437	3_0_0	EXIST::FUNCTION:
-X509_ATTRIBUTE_set1_object              1438	3_0_0	EXIST::FUNCTION:
-i2d_ECPrivateKey_bio                    1439	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-BN_GENCB_free                           1440	3_0_0	EXIST::FUNCTION:
-HMAC_size                               1441	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_get0_DH                        1442	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-d2i_OCSP_CRLID                          1443	3_0_0	EXIST::FUNCTION:OCSP
-EVP_CIPHER_CTX_set_padding              1444	3_0_0	EXIST::FUNCTION:
-CTLOG_new_from_base64                   1445	3_0_0	EXIST::FUNCTION:CT
-AES_bi_ige_encrypt                      1446	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ERR_pop_to_mark                         1447	3_0_0	EXIST::FUNCTION:
-CRL_DIST_POINTS_new                     1449	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get0_asn1                      1450	3_0_0	EXIST::FUNCTION:
-EVP_camellia_192_ctr                    1451	3_0_0	EXIST::FUNCTION:CAMELLIA
-EVP_PKEY_free                           1452	3_0_0	EXIST::FUNCTION:
-X509_ATTRIBUTE_count                    1453	3_0_0	EXIST::FUNCTION:
-BIO_new_dgram                           1454	3_0_0	EXIST::FUNCTION:DGRAM
-CMS_RecipientInfo_kari_get0_reks        1455	3_0_0	EXIST::FUNCTION:CMS
-BASIC_CONSTRAINTS_new                   1456	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_X509_REQ                   1457	3_0_0	EXIST::FUNCTION:
-BIO_sock_init                           1458	3_0_0	EXIST::FUNCTION:SOCK
-BN_nist_mod_192                         1459	3_0_0	EXIST::FUNCTION:
-i2d_PKCS7_ISSUER_AND_SERIAL             1460	3_0_0	EXIST::FUNCTION:
-X509V3_EXT_nconf                        1461	3_0_0	EXIST::FUNCTION:
-X509v3_addr_inherits                    1462	3_0_0	EXIST::FUNCTION:RFC3779
-NETSCAPE_SPKI_sign                      1463	3_0_0	EXIST::FUNCTION:
-BN_BLINDING_update                      1464	3_0_0	EXIST::FUNCTION:
-BN_gcd                                  1465	3_0_0	EXIST::FUNCTION:
-CMS_dataInit                            1466	3_0_0	EXIST::FUNCTION:CMS
-TS_CONF_get_tsa_section                 1467	3_0_0	EXIST::FUNCTION:TS
-i2d_PKCS7_SIGNER_INFO                   1468	3_0_0	EXIST::FUNCTION:
-EVP_get_pw_prompt                       1469	3_0_0	EXIST::FUNCTION:
-BN_bn2bin                               1470	3_0_0	EXIST::FUNCTION:
-d2i_ASN1_BIT_STRING                     1471	3_0_0	EXIST::FUNCTION:
-OCSP_CERTSTATUS_new                     1472	3_0_0	EXIST::FUNCTION:OCSP
-ENGINE_register_RAND                    1473	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-X509V3_section_free                     1474	3_0_0	EXIST::FUNCTION:
-CRYPTO_mem_debug_free                   1475	3_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
-d2i_OCSP_REQUEST                        1476	3_0_0	EXIST::FUNCTION:OCSP
-ENGINE_get_cipher_engine                1477	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-SHA384_Final                            1478	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-TS_RESP_CTX_set_certs                   1479	3_0_0	EXIST::FUNCTION:TS
-BN_MONT_CTX_free                        1480	3_0_0	EXIST::FUNCTION:
-BN_GF2m_mod_solve_quad_arr              1481	3_0_0	EXIST::FUNCTION:EC2M
-UI_add_input_string                     1482	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_get_version                 1483	3_0_0	EXIST::FUNCTION:TS
-BIO_accept_ex                           1484	3_0_0	EXIST::FUNCTION:SOCK
-CRYPTO_get_mem_functions                1485	3_0_0	EXIST::FUNCTION:
-PEM_read_bio                            1486	3_0_0	EXIST::FUNCTION:
-OCSP_BASICRESP_get_ext_by_critical      1487	3_0_0	EXIST::FUNCTION:OCSP
-SXNET_it                                1488	3_0_0	EXIST::FUNCTION:
-BIO_indent                              1489	3_0_0	EXIST::FUNCTION:
-i2d_X509_fp                             1490	3_0_0	EXIST::FUNCTION:STDIO
-d2i_ASN1_TYPE                           1491	3_0_0	EXIST::FUNCTION:
-CTLOG_STORE_free                        1492	3_0_0	EXIST::FUNCTION:CT
-ENGINE_get_pkey_meths                   1493	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-i2d_TS_REQ_bio                          1494	3_0_0	EXIST::FUNCTION:TS
-EVP_PKEY_CTX_get_operation              1495	3_0_0	EXIST::FUNCTION:
-EVP_MD_meth_set_ctrl                    1496	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_EXTENSION_set_critical             1497	3_0_0	EXIST::FUNCTION:
-BIO_ADDR_clear                          1498	3_0_0	EXIST::FUNCTION:SOCK
-ENGINE_get_DSA                          1499	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ASYNC_get_wait_ctx                      1500	3_0_0	EXIST::FUNCTION:
-ENGINE_set_load_privkey_function        1501	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-CRYPTO_ccm128_setiv                     1502	3_0_0	EXIST::FUNCTION:
-PKCS7_dataFinal                         1503	3_0_0	EXIST::FUNCTION:
-SHA1_Final                              1504	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-i2a_ASN1_STRING                         1505	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_rand_key                 1506	3_0_0	EXIST::FUNCTION:
-AES_set_encrypt_key                     1507	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_UTCTIME_new                        1508	3_0_0	EXIST::FUNCTION:
-AES_cbc_encrypt                         1509	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OCSP_RESPDATA_free                      1510	3_0_0	EXIST::FUNCTION:OCSP
-EVP_PKEY_asn1_find                      1511	3_0_0	EXIST::FUNCTION:
-d2i_ASN1_GENERALIZEDTIME                1512	3_0_0	EXIST::FUNCTION:
-OPENSSL_cleanup                         1513	3_0_0	EXIST::FUNCTION:
-X509_ATTRIBUTE_create                   1514	3_0_0	EXIST::FUNCTION:
-SCT_get_source                          1515	3_0_0	EXIST::FUNCTION:CT
-EVP_PKEY_verify_init                    1516	3_0_0	EXIST::FUNCTION:
-ASN1_TIME_set_string                    1517	3_0_0	EXIST::FUNCTION:
-BIO_free                                1518	3_0_0	EXIST::FUNCTION:
-i2d_X509_ALGOR                          1519	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_set0_crls                1520	3_0_0	EXIST::FUNCTION:
-ASYNC_pause_job                         1521	3_0_0	EXIST::FUNCTION:
-OCSP_BASICRESP_new                      1522	3_0_0	EXIST::FUNCTION:OCSP
-EVP_camellia_256_ofb                    1523	3_0_0	EXIST::FUNCTION:CAMELLIA
-PKCS12_item_i2d_encrypt                 1524	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_set_copy                  1525	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EC_POINT_clear_free                     1526	3_0_0	EXIST::FUNCTION:EC
-i2s_ASN1_ENUMERATED_TABLE               1527	3_0_0	EXIST::FUNCTION:
-PKCS7_verify                            1528	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_add0_table            1529	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_set_cert                 1530	3_0_0	EXIST::FUNCTION:
-ASN1_GENERALSTRING_free                 1531	3_0_0	EXIST::FUNCTION:
-BN_MONT_CTX_set_locked                  1532	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_set_num                  1533	3_0_0	EXIST::FUNCTION:
-CONF_load                               1534	3_0_0	EXIST::FUNCTION:
-EC_KEY_METHOD_get_keygen                1535	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_PKEY_add1_attr_by_txt               1536	3_0_0	EXIST::FUNCTION:
-ASN1_INTEGER_set_uint64                 1537	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_attr_by_OBJ                1538	3_0_0	EXIST::FUNCTION:
-ASN1_add_oid_module                     1539	3_0_0	EXIST::FUNCTION:
-BN_div_recp                             1540	3_0_0	EXIST::FUNCTION:
-SRP_Verify_B_mod_N                      1541	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SXNET_free                              1542	3_0_0	EXIST::FUNCTION:
-CMS_get0_content                        1543	3_0_0	EXIST::FUNCTION:CMS
-BN_is_word                              1544	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_get_key_length               1545	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_asn1_to_param                1546	3_0_0	EXIST::FUNCTION:
-OCSP_request_onereq_get0                1547	3_0_0	EXIST::FUNCTION:OCSP
-ERR_load_PKCS7_strings                  1548	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_PUBKEY_get                         1549	3_0_0	EXIST::FUNCTION:
-EC_KEY_free                             1550	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-BIO_read                                1551	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_attr_by_NID                1552	3_0_0	EXIST::FUNCTION:
-BIO_get_accept_socket                   1553	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SOCK
-CMS_SignerInfo_sign                     1554	3_0_0	EXIST::FUNCTION:CMS
-ASN1_item_i2d_bio                       1555	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_get_block_size           1556	3_0_0	EXIST::FUNCTION:
-DIRECTORYSTRING_free                    1557	3_0_0	EXIST::FUNCTION:
-TS_CONF_set_default_engine              1558	3_0_0	EXIST::FUNCTION:ENGINE,TS
-BN_set_bit                              1559	3_0_0	EXIST::FUNCTION:
-EVP_MD_meth_set_app_datasize            1560	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-DSO_free                                1561	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_get_tsa                     1562	3_0_0	EXIST::FUNCTION:TS
-EC_GROUP_check                          1563	3_0_0	EXIST::FUNCTION:EC
-OPENSSL_sk_delete                       1564	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_set_extension_cb            1565	3_0_0	EXIST::FUNCTION:TS
-EVP_CIPHER_CTX_get_nid                  1566	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_add_md                      1567	3_0_0	EXIST::FUNCTION:TS
-DES_set_key                             1568	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-X509V3_extensions_print                 1569	3_0_0	EXIST::FUNCTION:
-PEM_do_header                           1570	3_0_0	EXIST::FUNCTION:
-i2d_re_X509_CRL_tbs                     1571	3_0_0	EXIST::FUNCTION:
-BIO_method_name                         1572	3_0_0	EXIST::FUNCTION:
-i2d_OCSP_CRLID                          1573	3_0_0	EXIST::FUNCTION:OCSP
-OCSP_request_set1_name                  1574	3_0_0	EXIST::FUNCTION:OCSP
-d2i_X509_NAME_ENTRY                     1575	3_0_0	EXIST::FUNCTION:
-X509_trusted                            1576	3_0_0	EXIST::FUNCTION:
-X509_TRUST_get_flags                    1577	3_0_0	EXIST::FUNCTION:
-PKCS7_set_content                       1578	3_0_0	EXIST::FUNCTION:
-PEM_write_X509_REQ_NEW                  1579	3_0_0	EXIST::FUNCTION:STDIO
-CONF_imodule_set_usr_data               1580	3_0_0	EXIST::FUNCTION:
-d2i_TS_RESP_fp                          1581	3_0_0	EXIST::FUNCTION:STDIO,TS
-X509_policy_tree_get0_user_policies     1582	3_0_0	EXIST::FUNCTION:
-DSA_do_sign                             1584	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-EVP_CIPHER_CTX_reset                    1585	3_0_0	EXIST::FUNCTION:
-OCSP_REVOKEDINFO_new                    1586	3_0_0	EXIST::FUNCTION:OCSP
-SRP_Verify_A_mod_N                      1587	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SRP_VBASE_free                          1588	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-PKCS7_add0_attrib_signing_time          1589	3_0_0	EXIST::FUNCTION:
-X509_STORE_set_flags                    1590	3_0_0	EXIST::FUNCTION:
-UI_get0_output_string                   1591	3_0_0	EXIST::FUNCTION:
-ERR_get_error_line_data                 1592	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CTLOG_get0_name                         1593	3_0_0	EXIST::FUNCTION:CT
-ASN1_TBOOLEAN_it                        1594	3_0_0	EXIST::FUNCTION:
-RC2_set_key                             1595	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC2
-X509_REVOKED_get_ext_by_NID             1596	3_0_0	EXIST::FUNCTION:
-RSA_padding_add_none                    1597	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_rc5_32_12_16_cbc                    1599	3_0_0	EXIST::FUNCTION:RC5
-PEM_dek_info                            1600	3_0_0	EXIST::FUNCTION:
-ASN1_SCTX_get_template                  1601	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_get0                      1602	3_0_0	EXIST::FUNCTION:
-X509_verify                             1603	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_get_request                 1604	3_0_0	EXIST::FUNCTION:TS
-EVP_cast5_cbc                           1605	3_0_0	EXIST::FUNCTION:CAST
-PEM_read_bio_X509_AUX                   1606	3_0_0	EXIST::FUNCTION:
-TS_ext_print_bio                        1607	3_0_0	EXIST::FUNCTION:TS
-SCT_set1_log_id                         1608	3_0_0	EXIST::FUNCTION:CT
-X509_get0_pubkey_bitstr                 1609	3_0_0	EXIST::FUNCTION:
-ENGINE_register_all_RAND                1610	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EVP_MD_meth_get_result_size             1612	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BIO_ADDRINFO_address                    1613	3_0_0	EXIST::FUNCTION:SOCK
-ASN1_STRING_print_ex                    1614	3_0_0	EXIST::FUNCTION:
-i2d_CMS_ReceiptRequest                  1615	3_0_0	EXIST::FUNCTION:CMS
-d2i_TS_REQ_fp                           1616	3_0_0	EXIST::FUNCTION:STDIO,TS
-OSSL_HTTP_REQ_CTX_set1_req              1617	3_0_0	EXIST::FUNCTION:HTTP
-EVP_PKEY_get_default_digest_nid         1618	3_0_0	EXIST::FUNCTION:
-ASIdOrRange_new                         1619	3_0_0	EXIST::FUNCTION:RFC3779
-ASN1_SCTX_new                           1620	3_0_0	EXIST::FUNCTION:
-X509V3_EXT_get                          1621	3_0_0	EXIST::FUNCTION:
-OCSP_id_cmp                             1622	3_0_0	EXIST::FUNCTION:OCSP
-NCONF_dump_bio                          1623	3_0_0	EXIST::FUNCTION:
-X509_NAME_get_entry                     1624	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get1_DH                        1625	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-CRYPTO_gcm128_aad                       1626	3_0_0	EXIST::FUNCTION:
-EVP_des_cfb8                            1627	3_0_0	EXIST::FUNCTION:DES
-BN_BLINDING_convert                     1628	3_0_0	EXIST::FUNCTION:
-CRYPTO_ocb128_cleanup                   1629	3_0_0	EXIST::FUNCTION:OCB
-EVP_des_ede_cbc                         1630	3_0_0	EXIST::FUNCTION:DES
-i2d_ASN1_TIME                           1631	3_0_0	EXIST::FUNCTION:
-ENGINE_register_all_pkey_asn1_meths     1632	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-OSSL_HTTP_REQ_CTX_set_max_response_length 1633	3_0_0	EXIST::FUNCTION:HTTP
-d2i_ISSUING_DIST_POINT                  1634	3_0_0	EXIST::FUNCTION:
-CMS_RecipientInfo_set0_key              1635	3_0_0	EXIST::FUNCTION:CMS
-NCONF_new                               1636	3_0_0	EXIST::FUNCTION:
-OCSP_SINGLERESP_free                    1637	3_0_0	EXIST::FUNCTION:OCSP
-PKCS7_ENCRYPT_free                      1638	3_0_0	EXIST::FUNCTION:
-i2d_DIST_POINT                          1639	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_paramgen_init                  1640	3_0_0	EXIST::FUNCTION:
-TS_MSG_IMPRINT_dup                      1641	3_0_0	EXIST::FUNCTION:TS
-CMS_ContentInfo_it                      1642	3_0_0	EXIST::FUNCTION:CMS
-OCSP_resp_get0_signature                1643	3_0_0	EXIST::FUNCTION:OCSP
-X509_STORE_CTX_get1_issuer              1644	3_0_0	EXIST::FUNCTION:
-EVP_Digest                              1645	3_0_0	EXIST::FUNCTION:
-CRYPTO_set_ex_data                      1646	3_0_0	EXIST::FUNCTION:
-BN_bn2hex                               1647	3_0_0	EXIST::FUNCTION:
-BN_lshift1                              1648	3_0_0	EXIST::FUNCTION:
-i2d_EDIPARTYNAME                        1649	3_0_0	EXIST::FUNCTION:
-X509_policy_tree_get0_policies          1650	3_0_0	EXIST::FUNCTION:
-X509at_add1_attr                        1651	3_0_0	EXIST::FUNCTION:
-X509_get_ex_data                        1653	3_0_0	EXIST::FUNCTION:
-RSA_set_method                          1654	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_REVOKED_dup                        1655	3_0_0	EXIST::FUNCTION:
-ASN1_TIME_new                           1656	3_0_0	EXIST::FUNCTION:
-PEM_write_NETSCAPE_CERT_SEQUENCE        1657	3_0_0	EXIST::FUNCTION:STDIO
-PEM_read_X509_REQ                       1658	3_0_0	EXIST::FUNCTION:STDIO
-EC_GROUP_free                           1659	3_0_0	EXIST::FUNCTION:EC
-X509_CRL_get_meth_data                  1660	3_0_0	EXIST::FUNCTION:
-X509V3_add_value_uchar                  1661	3_0_0	EXIST::FUNCTION:
-BIO_asn1_get_suffix                     1662	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_clear_flags           1663	3_0_0	EXIST::FUNCTION:
-X509_NAME_add_entry_by_txt              1664	3_0_0	EXIST::FUNCTION:
-DES_ede3_cfb_encrypt                    1665	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-i2d_CMS_bio_stream                      1667	3_0_0	EXIST::FUNCTION:CMS
-DES_quad_cksum                          1668	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-X509_ATTRIBUTE_create_by_NID            1669	3_0_0	EXIST::FUNCTION:
-TS_VERIFY_CTX_free                      1670	3_0_0	EXIST::FUNCTION:TS
-EC_KEY_up_ref                           1671	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EC_GROUP_get_basis_type                 1672	3_0_0	EXIST::FUNCTION:EC
-OCSP_crlID_new                          1673	3_0_0	EXIST:!VMS:FUNCTION:OCSP
-OCSP_crlID2_new                         1673	3_0_0	EXIST:VMS:FUNCTION:OCSP
-PEM_write_PKCS7                         1674	3_0_0	EXIST::FUNCTION:STDIO
-PKCS7_add_signer                        1675	3_0_0	EXIST::FUNCTION:
-X509_SIG_it                             1676	3_0_0	EXIST::FUNCTION:
-ASYNC_start_job                         1677	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_dup                         1678	3_0_0	EXIST::FUNCTION:TS
-EVP_aes_192_ctr                         1679	3_0_0	EXIST::FUNCTION:
-PKCS12_pack_authsafes                   1680	3_0_0	EXIST::FUNCTION:
-PKCS7_get_attribute                     1681	3_0_0	EXIST::FUNCTION:
-OPENSSL_config                          1682	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
-s2i_ASN1_INTEGER                        1683	3_0_0	EXIST::FUNCTION:
-CMS_signed_add1_attr_by_OBJ             1684	3_0_0	EXIST::FUNCTION:CMS
-CRYPTO_128_wrap_pad                     1685	3_0_0	EXIST::FUNCTION:
-CMS_EncryptedData_set1_key              1686	3_0_0	EXIST::FUNCTION:CMS
-OBJ_find_sigid_by_algs                  1687	3_0_0	EXIST::FUNCTION:
-ASN1_generate_nconf                     1688	3_0_0	EXIST::FUNCTION:
-CMS_add0_recipient_password             1689	3_0_0	EXIST::FUNCTION:CMS
-UI_get_string_type                      1690	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_ECPrivateKey               1691	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_PKEY_get_attr                       1692	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_ECPKParameters             1693	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-d2i_PKCS12_MAC_DATA                     1694	3_0_0	EXIST::FUNCTION:
-ENGINE_ctrl_cmd                         1695	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-PKCS12_SAFEBAG_get_bag_nid              1696	3_0_0	EXIST::FUNCTION:
-TS_CONF_set_digests                     1697	3_0_0	EXIST::FUNCTION:TS
-PKCS7_SIGNED_it                         1698	3_0_0	EXIST::FUNCTION:
-b2i_PublicKey                           1699	3_0_0	EXIST::FUNCTION:
-X509_PURPOSE_cleanup                    1700	3_0_0	EXIST::FUNCTION:
-ESS_SIGNING_CERT_dup                    1701	3_0_0	EXIST::FUNCTION:
-ENGINE_set_default_DSA                  1702	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-X509_REVOKED_new                        1703	3_0_0	EXIST::FUNCTION:
-NCONF_WIN32                             1704	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_padding_check_PKCS1_OAEP_mgf1       1705	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_policy_tree_get0_level             1706	3_0_0	EXIST::FUNCTION:
-ASN1_parse_dump                         1708	3_0_0	EXIST::FUNCTION:
-BIO_vfree                               1709	3_0_0	EXIST::FUNCTION:
-CRYPTO_cbc128_decrypt                   1710	3_0_0	EXIST::FUNCTION:
-UI_dup_verify_string                    1711	3_0_0	EXIST::FUNCTION:
-d2i_PKCS7_bio                           1712	3_0_0	EXIST::FUNCTION:
-ENGINE_set_default_digests              1713	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-i2d_PublicKey                           1714	3_0_0	EXIST::FUNCTION:
-RC5_32_set_key                          1715	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC5
-AES_unwrap_key                          1716	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_Cipher                              1717	3_0_0	EXIST::FUNCTION:
-AES_set_decrypt_key                     1718	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BF_ofb64_encrypt                        1719	3_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
-d2i_TS_TST_INFO_fp                      1720	3_0_0	EXIST::FUNCTION:STDIO,TS
-X509_find_by_issuer_and_serial          1721	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_type                           1722	3_0_0	EXIST::FUNCTION:
-ENGINE_ctrl                             1723	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EVP_cast5_ecb                           1724	3_0_0	EXIST::FUNCTION:CAST
-BIO_nwrite0                             1725	3_0_0	EXIST::FUNCTION:
-CAST_encrypt                            1726	3_0_0	EXIST::FUNCTION:CAST,DEPRECATEDIN_3_0
-a2d_ASN1_OBJECT                         1727	3_0_0	EXIST::FUNCTION:
-OCSP_ONEREQ_delete_ext                  1728	3_0_0	EXIST::FUNCTION:OCSP
-UI_method_get_reader                    1729	3_0_0	EXIST::FUNCTION:
-CMS_unsigned_get_attr                   1730	3_0_0	EXIST::FUNCTION:CMS
-EVP_aes_256_cbc                         1731	3_0_0	EXIST::FUNCTION:
-X509_check_ip_asc                       1732	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_X509_AUX                  1733	3_0_0	EXIST::FUNCTION:
-RC2_cbc_encrypt                         1734	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC2
-TS_MSG_IMPRINT_new                      1735	3_0_0	EXIST::FUNCTION:TS
-EVP_ENCODE_CTX_new                      1736	3_0_0	EXIST::FUNCTION:
-BIO_f_base64                            1737	3_0_0	EXIST::FUNCTION:
-CMS_verify                              1738	3_0_0	EXIST::FUNCTION:CMS
-i2d_PrivateKey                          1739	3_0_0	EXIST::FUNCTION:
-i2d_OCSP_ONEREQ                         1740	3_0_0	EXIST::FUNCTION:OCSP
-OPENSSL_issetugid                       1741	3_0_0	EXIST::FUNCTION:
-d2i_ASN1_OBJECT                         1742	3_0_0	EXIST::FUNCTION:
-EVP_MD_meth_set_flags                   1743	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_idea_cbc                            1744	3_0_0	EXIST::FUNCTION:IDEA
-EC_POINT_cmp                            1745	3_0_0	EXIST::FUNCTION:EC
-ASN1_buf_print                          1746	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_hex2ctrl                   1747	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_PKCS8PrivateKey           1748	3_0_0	EXIST::FUNCTION:
-CMAC_Update                             1749	3_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
-d2i_ASN1_UTCTIME                        1750	3_0_0	EXIST::FUNCTION:
-OPENSSL_sk_insert                       1751	3_0_0	EXIST::FUNCTION:
-DSO_up_ref                              1752	3_0_0	EXIST::FUNCTION:
-EVP_rc2_cbc                             1753	3_0_0	EXIST::FUNCTION:RC2
-i2d_NETSCAPE_SPKI                       1754	3_0_0	EXIST::FUNCTION:
-ASYNC_init_thread                       1755	3_0_0	EXIST::FUNCTION:
-OCSP_BASICRESP_get_ext_by_OBJ           1756	3_0_0	EXIST::FUNCTION:OCSP
-X509_reject_clear                       1757	3_0_0	EXIST::FUNCTION:
-DH_security_bits                        1758	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-LONG_it                                 1759	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_dup                                1760	3_0_0	EXIST::FUNCTION:
-TS_RESP_new                             1761	3_0_0	EXIST::FUNCTION:TS
-i2d_PKCS8PrivateKeyInfo_fp              1762	3_0_0	EXIST::FUNCTION:STDIO
-X509_alias_get0                         1763	3_0_0	EXIST::FUNCTION:
-X509_ATTRIBUTE_free                     1764	3_0_0	EXIST::FUNCTION:
-d2i_X509_bio                            1765	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_get_exts                    1766	3_0_0	EXIST::FUNCTION:TS
-EVP_aes_256_ecb                         1767	3_0_0	EXIST::FUNCTION:
-ASN1_BIT_STRING_name_print              1768	3_0_0	EXIST::FUNCTION:
-d2i_X509_EXTENSIONS                     1769	3_0_0	EXIST::FUNCTION:
-ASN1_OCTET_STRING_free                  1770	3_0_0	EXIST::FUNCTION:
-PKCS7_RECIP_INFO_free                   1771	3_0_0	EXIST::FUNCTION:
-ASN1_tag2bit                            1772	3_0_0	EXIST::FUNCTION:
-TS_REQ_add_ext                          1773	3_0_0	EXIST::FUNCTION:TS
-X509_digest                             1776	3_0_0	EXIST::FUNCTION:
-CRYPTO_THREAD_cleanup_local             1777	3_0_0	EXIST::FUNCTION:
-NETSCAPE_CERT_SEQUENCE_it               1778	3_0_0	EXIST::FUNCTION:
-EVP_aes_128_wrap                        1779	3_0_0	EXIST::FUNCTION:
-X509V3_conf_free                        1780	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_get_ext_by_NID              1781	3_0_0	EXIST::FUNCTION:TS
-EVP_aes_256_cfb1                        1782	3_0_0	EXIST::FUNCTION:
-X509_issuer_name_cmp                    1783	3_0_0	EXIST::FUNCTION:
-CMS_RecipientEncryptedKey_get0_id       1784	3_0_0	EXIST::FUNCTION:CMS
-EVP_PKEY_meth_get_verify_recover        1785	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-NAME_CONSTRAINTS_check                  1786	3_0_0	EXIST::FUNCTION:
-X509_CERT_AUX_it                        1787	3_0_0	EXIST::FUNCTION:
-X509_get_X509_PUBKEY                    1789	3_0_0	EXIST::FUNCTION:
-TXT_DB_create_index                     1790	3_0_0	EXIST::FUNCTION:
-RAND_set_rand_engine                    1791	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-X509_set_serialNumber                   1792	3_0_0	EXIST::FUNCTION:
-BN_mod_exp_mont_consttime               1793	3_0_0	EXIST::FUNCTION:
-X509V3_parse_list                       1794	3_0_0	EXIST::FUNCTION:
-ACCESS_DESCRIPTION_new                  1795	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_clear_flags              1796	3_0_0	EXIST::FUNCTION:
-ECDSA_size                              1797	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_ALGOR_get0                         1798	3_0_0	EXIST::FUNCTION:
-d2i_ACCESS_DESCRIPTION                  1799	3_0_0	EXIST::FUNCTION:
-OCSP_SINGLERESP_get_ext_by_NID          1800	3_0_0	EXIST::FUNCTION:OCSP
-a2i_IPADDRESS_NC                        1801	3_0_0	EXIST::FUNCTION:
-CTLOG_STORE_load_default_file           1802	3_0_0	EXIST::FUNCTION:CT
-PKCS12_SAFEBAG_create_pkcs8_encrypt     1803	3_0_0	EXIST::FUNCTION:
-RAND_screen                             1804	3_0_0	EXIST:_WIN32:FUNCTION:DEPRECATEDIN_1_1_0
-CONF_get_string                         1805	3_0_0	EXIST::FUNCTION:
-X509_cmp_current_time                   1806	3_0_0	EXIST::FUNCTION:
-i2d_DSAPrivateKey                       1807	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-ASN1_BIT_STRING_new                     1808	3_0_0	EXIST::FUNCTION:
-BIO_new_file                            1809	3_0_0	EXIST::FUNCTION:
-PKCS7_SIGNER_INFO_get0_algs             1810	3_0_0	EXIST::FUNCTION:
-TS_RESP_set_status_info                 1811	3_0_0	EXIST::FUNCTION:TS
-OPENSSL_LH_delete                       1812	3_0_0	EXIST::FUNCTION:
-TS_STATUS_INFO_dup                      1813	3_0_0	EXIST::FUNCTION:TS
-X509v3_addr_get_range                   1814	3_0_0	EXIST::FUNCTION:RFC3779
-X509_EXTENSION_get_data                 1815	3_0_0	EXIST::FUNCTION:
-RC5_32_encrypt                          1816	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC5
-DIST_POINT_set_dpname                   1817	3_0_0	EXIST::FUNCTION:
-BIO_sock_info                           1818	3_0_0	EXIST::FUNCTION:SOCK
-OPENSSL_hexstr2buf                      1819	3_0_0	EXIST::FUNCTION:
-EVP_add_cipher                          1820	3_0_0	EXIST::FUNCTION:
-X509V3_EXT_add_list                     1821	3_0_0	EXIST::FUNCTION:
-CMS_compress                            1822	3_0_0	EXIST::FUNCTION:CMS
-X509_get_ext_by_critical                1823	3_0_0	EXIST::FUNCTION:
-ASYNC_WAIT_CTX_clear_fd                 1824	3_0_0	EXIST::FUNCTION:
-ZLONG_it                                1825	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OPENSSL_sk_find_ex                      1826	3_0_0	EXIST::FUNCTION:
-ASN1_ENUMERATED_to_BN                   1827	3_0_0	EXIST::FUNCTION:
-X509_CRL_get_ext_d2i                    1828	3_0_0	EXIST::FUNCTION:
-i2d_AUTHORITY_KEYID                     1829	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_get_time                    1830	3_0_0	EXIST::FUNCTION:TS
-ASN1_VISIBLESTRING_it                   1831	3_0_0	EXIST::FUNCTION:
-X509V3_EXT_REQ_add_conf                 1832	3_0_0	EXIST::FUNCTION:
-ASN1_STRING_to_UTF8                     1833	3_0_0	EXIST::FUNCTION:
-EVP_MD_meth_set_update                  1835	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_camellia_192_cbc                    1836	3_0_0	EXIST::FUNCTION:CAMELLIA
-OPENSSL_LH_stats_bio                    1837	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_1
-PKCS7_set_signed_attributes             1838	3_0_0	EXIST::FUNCTION:
-EC_KEY_priv2buf                         1839	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-BN_BLINDING_free                        1840	3_0_0	EXIST::FUNCTION:
-IPAddressChoice_new                     1841	3_0_0	EXIST::FUNCTION:RFC3779
-X509_CRL_get_ext_count                  1842	3_0_0	EXIST::FUNCTION:
-PKCS12_add_key                          1843	3_0_0	EXIST::FUNCTION:
-EVP_camellia_128_cfb1                   1844	3_0_0	EXIST::FUNCTION:CAMELLIA
-BIO_find_type                           1845	3_0_0	EXIST::FUNCTION:
-ISSUING_DIST_POINT_it                   1846	3_0_0	EXIST::FUNCTION:
-BIO_ctrl_wpending                       1847	3_0_0	EXIST::FUNCTION:
-X509_ALGOR_cmp                          1848	3_0_0	EXIST::FUNCTION:
-i2d_ASN1_bio_stream                     1849	3_0_0	EXIST::FUNCTION:
-CRYPTO_THREAD_init_local                1850	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_set_serial_cb               1851	3_0_0	EXIST::FUNCTION:TS
-POLICY_MAPPING_it                       1852	3_0_0	EXIST::FUNCTION:
-ERR_load_KDF_strings                    1853	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-UI_method_set_reader                    1854	3_0_0	EXIST::FUNCTION:
-BIO_next                                1855	3_0_0	EXIST::FUNCTION:
-ASN1_STRING_set_default_mask_asc        1856	3_0_0	EXIST::FUNCTION:
-X509_CRL_new                            1857	3_0_0	EXIST::FUNCTION:
-i2b_PrivateKey_bio                      1858	3_0_0	EXIST::FUNCTION:
-ASN1_STRING_length_set                  1859	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-PEM_write_PKCS8                         1860	3_0_0	EXIST::FUNCTION:STDIO
-PKCS7_digest_from_attributes            1861	3_0_0	EXIST::FUNCTION:
-EC_GROUP_set_curve_GFp                  1862	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_PURPOSE_get0                       1863	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_set1_DSA                       1864	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-X509_NAME_it                            1865	3_0_0	EXIST::FUNCTION:
-OBJ_add_object                          1866	3_0_0	EXIST::FUNCTION:
-DSA_generate_key                        1867	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-EVP_DigestUpdate                        1868	3_0_0	EXIST::FUNCTION:
-X509_get_ext_by_OBJ                     1869	3_0_0	EXIST::FUNCTION:
-PBEPARAM_new                            1870	3_0_0	EXIST::FUNCTION:
-EVP_aes_128_cbc                         1871	3_0_0	EXIST::FUNCTION:
-CRYPTO_dup_ex_data                      1872	3_0_0	EXIST::FUNCTION:
-OCSP_single_get0_status                 1873	3_0_0	EXIST::FUNCTION:OCSP
-d2i_AUTHORITY_INFO_ACCESS               1874	3_0_0	EXIST::FUNCTION:
-PEM_read_RSAPrivateKey                  1875	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
-BIO_closesocket                         1876	3_0_0	EXIST::FUNCTION:SOCK
-RSA_verify_ASN1_OCTET_STRING            1877	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-SCT_set_log_entry_type                  1878	3_0_0	EXIST::FUNCTION:CT
-BN_new                                  1879	3_0_0	EXIST::FUNCTION:
-X509_OBJECT_retrieve_by_subject         1880	3_0_0	EXIST::FUNCTION:
-MD5_Final                               1881	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
-X509_STORE_set_verify_cb                1882	3_0_0	EXIST::FUNCTION:
-OCSP_REQUEST_print                      1883	3_0_0	EXIST::FUNCTION:OCSP
-CMS_add1_crl                            1884	3_0_0	EXIST::FUNCTION:CMS
-d2i_EDIPARTYNAME                        1885	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_set0_trusted_stack       1886	3_0_0	EXIST::FUNCTION:
-BIO_ADDR_service_string                 1887	3_0_0	EXIST::FUNCTION:SOCK
-ASN1_BOOLEAN_it                         1888	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_set_time_cb                 1889	3_0_0	EXIST::FUNCTION:TS
-IDEA_cbc_encrypt                        1890	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
-BN_CTX_secure_new                       1891	3_0_0	EXIST::FUNCTION:
-OCSP_ONEREQ_add_ext                     1892	3_0_0	EXIST::FUNCTION:OCSP
-CMS_uncompress                          1893	3_0_0	EXIST::FUNCTION:CMS
-CRYPTO_mem_debug_pop                    1895	3_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
-EVP_aes_192_cfb128                      1896	3_0_0	EXIST::FUNCTION:
-OSSL_HTTP_REQ_CTX_nbio                  1897	3_0_0	EXIST::FUNCTION:HTTP
-EVP_CIPHER_CTX_copy                     1898	3_0_0	EXIST::FUNCTION:
-CRYPTO_secure_allocated                 1899	3_0_0	EXIST::FUNCTION:
-UI_UTIL_read_pw_string                  1900	3_0_0	EXIST::FUNCTION:
-NOTICEREF_free                          1901	3_0_0	EXIST::FUNCTION:
-AES_cfb1_encrypt                        1902	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509v3_get_ext                          1903	3_0_0	EXIST::FUNCTION:
-CRYPTO_gcm128_encrypt_ctr32             1905	3_0_0	EXIST::FUNCTION:
-SCT_set1_signature                      1906	3_0_0	EXIST::FUNCTION:CT
-CONF_imodule_get_module                 1907	3_0_0	EXIST::FUNCTION:
-NAME_CONSTRAINTS_new                    1908	3_0_0	EXIST::FUNCTION:
-BN_usub                                 1909	3_0_0	EXIST::FUNCTION:
-SRP_Calc_B                              1910	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-CMS_decrypt_set1_key                    1911	3_0_0	EXIST::FUNCTION:CMS
-EC_GROUP_get_degree                     1912	3_0_0	EXIST::FUNCTION:EC
-X509_ALGOR_set0                         1913	3_0_0	EXIST::FUNCTION:
-OPENSSL_LH_set_down_load                1914	3_0_0	EXIST::FUNCTION:
-X509v3_asid_inherits                    1915	3_0_0	EXIST::FUNCTION:RFC3779
-EVP_MD_meth_get_app_datasize            1916	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_STORE_CTX_get_num_untrusted        1917	3_0_0	EXIST::FUNCTION:
-RAND_poll                               1918	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_print_public                   1919	3_0_0	EXIST::FUNCTION:
-CMS_SignedData_init                     1920	3_0_0	EXIST::FUNCTION:CMS
-X509_REQ_free                           1921	3_0_0	EXIST::FUNCTION:
-ASN1_INTEGER_set                        1922	3_0_0	EXIST::FUNCTION:
-EVP_DecodeFinal                         1923	3_0_0	EXIST::FUNCTION:
-MD5_Transform                           1925	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
-SRP_create_verifier_BN                  1926	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-ENGINE_register_all_EC                  1927	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EVP_camellia_128_ofb                    1928	3_0_0	EXIST::FUNCTION:CAMELLIA
-PEM_write_X509_AUX                      1929	3_0_0	EXIST::FUNCTION:STDIO
-X509_LOOKUP_by_subject                  1930	3_0_0	EXIST::FUNCTION:
-X509_REQ_add_extensions                 1931	3_0_0	EXIST::FUNCTION:
-Camellia_cbc_encrypt                    1932	3_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
-EC_KEY_METHOD_new                       1933	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-RSA_flags                               1934	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_NAME_add_entry                     1935	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_get_asn1_iv                  1936	3_0_0	EXIST::FUNCTION:
-i2d_RSAPrivateKey_bio                   1937	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-PKCS5_PBE_keyivgen                      1938	3_0_0	EXIST::FUNCTION:
-i2d_OCSP_SERVICELOC                     1939	3_0_0	EXIST::FUNCTION:OCSP
-EC_POINT_copy                           1940	3_0_0	EXIST::FUNCTION:EC
-X509V3_EXT_CRL_add_nconf                1941	3_0_0	EXIST::FUNCTION:
-SHA256_Init                             1942	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_NAME_ENTRY_get_object              1943	3_0_0	EXIST::FUNCTION:
-ASN1_ENUMERATED_free                    1944	3_0_0	EXIST::FUNCTION:
-X509_CRL_set_meth_data                  1945	3_0_0	EXIST::FUNCTION:
-EVP_aes_192_cfb1                        1946	3_0_0	EXIST::FUNCTION:
-EVP_MD_CTX_set_flags                    1947	3_0_0	EXIST::FUNCTION:
-EVP_seed_cbc                            1948	3_0_0	EXIST::FUNCTION:SEED
-d2i_PKCS12                              1949	3_0_0	EXIST::FUNCTION:
-X509_policy_node_get0_policy            1950	3_0_0	EXIST::FUNCTION:
-PKCS12_unpack_p7data                    1951	3_0_0	EXIST::FUNCTION:
-ECDSA_sign                              1952	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-d2i_PKCS12_fp                           1953	3_0_0	EXIST::FUNCTION:STDIO
-CMS_unsigned_get_attr_by_NID            1954	3_0_0	EXIST::FUNCTION:CMS
-UI_add_user_data                        1955	3_0_0	EXIST::FUNCTION:
-BN_bntest_rand                          1956	3_0_0	EXIST::FUNCTION:
-X509_get_pubkey                         1957	3_0_0	EXIST::FUNCTION:
-i2d_X509_NAME                           1958	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_add1_attr                      1959	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_purpose_inherit          1960	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_get_keygen                1961	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ENGINE_get_pkey_asn1_meth               1962	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-SHA256_Update                           1963	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-d2i_PKCS7_ISSUER_AND_SERIAL             1964	3_0_0	EXIST::FUNCTION:
-PKCS12_unpack_authsafes                 1965	3_0_0	EXIST::FUNCTION:
-X509_CRL_it                             1966	3_0_0	EXIST::FUNCTION:
-d2i_X509_ALGOR                          1967	3_0_0	EXIST::FUNCTION:
-PKCS12_PBE_keyivgen                     1968	3_0_0	EXIST::FUNCTION:
-BIO_test_flags                          1969	3_0_0	EXIST::FUNCTION:
-EC_POINT_get_affine_coordinates_GF2m    1970	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC2M
-EVP_ENCODE_CTX_num                      1971	3_0_0	EXIST::FUNCTION:
-Camellia_cfb1_encrypt                   1972	3_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
-NCONF_load_fp                           1973	3_0_0	EXIST::FUNCTION:STDIO
-i2d_OCSP_REQINFO                        1974	3_0_0	EXIST::FUNCTION:OCSP
-EVP_PKEY_sign                           1975	3_0_0	EXIST::FUNCTION:
-TS_REQ_get_ext_by_critical              1976	3_0_0	EXIST::FUNCTION:TS
-EC_KEY_key2buf                          1977	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_EXTENSION_it                       1978	3_0_0	EXIST::FUNCTION:
-i2d_PKCS8_fp                            1979	3_0_0	EXIST::FUNCTION:STDIO
-UTF8_getc                               1980	3_0_0	EXIST::FUNCTION:
-ASN1_IA5STRING_free                     1981	3_0_0	EXIST::FUNCTION:
-EC_KEY_METHOD_get_verify                1982	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-OBJ_NAME_do_all                         1983	3_0_0	EXIST::FUNCTION:
-d2i_TS_MSG_IMPRINT_fp                   1984	3_0_0	EXIST::FUNCTION:STDIO,TS
-X509_CRL_verify                         1985	3_0_0	EXIST::FUNCTION:
-X509_get0_uids                          1986	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get0_DSA                       1987	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-d2i_CMS_ContentInfo                     1988	3_0_0	EXIST::FUNCTION:CMS
-EVP_CIPHER_meth_get_do_cipher           1989	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-i2d_DSA_PUBKEY                          1990	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-GENERAL_NAME_it                         1991	3_0_0	EXIST::FUNCTION:
-EVP_des_ede_ecb                         1992	3_0_0	EXIST::FUNCTION:DES
-i2d_CRL_DIST_POINTS                     1993	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_X509_REQ_NEW              1994	3_0_0	EXIST::FUNCTION:
-RC5_32_ofb64_encrypt                    1995	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC5
-i2d_PKCS7                               1996	3_0_0	EXIST::FUNCTION:
-BN_mod_lshift_quick                     1997	3_0_0	EXIST::FUNCTION:
-DIST_POINT_NAME_it                      1998	3_0_0	EXIST::FUNCTION:
-PEM_read_PrivateKey                     1999	3_0_0	EXIST::FUNCTION:STDIO
-X509V3_get_d2i                          2000	3_0_0	EXIST::FUNCTION:
-PKCS7_SIGNER_INFO_sign                  2001	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_free                        2002	3_0_0	EXIST::FUNCTION:TS
-DSA_security_bits                       2003	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-X509v3_addr_is_canonical                2004	3_0_0	EXIST::FUNCTION:RFC3779
-BN_mod_mul_reciprocal                   2005	3_0_0	EXIST::FUNCTION:
-TS_REQ_get_version                      2006	3_0_0	EXIST::FUNCTION:TS
-BN_exp                                  2007	3_0_0	EXIST::FUNCTION:
-i2d_SXNET                               2008	3_0_0	EXIST::FUNCTION:
-OBJ_bsearch_                            2009	3_0_0	EXIST::FUNCTION:
-OPENSSL_LH_new                          2010	3_0_0	EXIST::FUNCTION:
-ENGINE_register_all_pkey_meths          2011	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ENGINE_get_init_function                2012	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EC_POINT_point2hex                      2013	3_0_0	EXIST::FUNCTION:EC
-ENGINE_get_default_DSA                  2014	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ENGINE_register_all_complete            2015	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-SRP_get_default_gN                      2016	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-UI_dup_input_boolean                    2017	3_0_0	EXIST::FUNCTION:
-PKCS7_dup                               2018	3_0_0	EXIST::FUNCTION:
-i2d_TS_REQ_fp                           2019	3_0_0	EXIST::FUNCTION:STDIO,TS
-i2d_OTHERNAME                           2020	3_0_0	EXIST::FUNCTION:
-EC_KEY_get0_private_key                 2021	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-SCT_get0_extensions                     2022	3_0_0	EXIST::FUNCTION:CT
-OPENSSL_LH_node_stats_bio               2023	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_1
-i2d_DIRECTORYSTRING                     2024	3_0_0	EXIST::FUNCTION:
-BN_X931_derive_prime_ex                 2025	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ENGINE_get_pkey_asn1_meth_str           2026	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-PKCS7_signatureVerify                   2027	3_0_0	EXIST::FUNCTION:
-CRYPTO_ocb128_new                       2028	3_0_0	EXIST::FUNCTION:OCB
-EC_curve_nist2nid                       2029	3_0_0	EXIST::FUNCTION:EC
-UI_get0_result                          2030	3_0_0	EXIST::FUNCTION:
-OCSP_request_add1_nonce                 2031	3_0_0	EXIST::FUNCTION:OCSP
-UI_construct_prompt                     2032	3_0_0	EXIST::FUNCTION:
-ENGINE_unregister_RSA                   2033	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EC_GROUP_order_bits                     2034	3_0_0	EXIST::FUNCTION:EC
-d2i_CMS_bio                             2035	3_0_0	EXIST::FUNCTION:CMS
-OPENSSL_sk_num                          2036	3_0_0	EXIST::FUNCTION:
-CMS_RecipientInfo_set0_pkey             2038	3_0_0	EXIST::FUNCTION:CMS
-X509_STORE_CTX_set_default              2039	3_0_0	EXIST::FUNCTION:
-AES_wrap_key                            2040	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_md_null                             2041	3_0_0	EXIST::FUNCTION:
-i2d_SCT_LIST                            2042	3_0_0	EXIST::FUNCTION:CT
-PKCS7_get_issuer_and_serial             2043	3_0_0	EXIST::FUNCTION:
-PKCS7_SIGN_ENVELOPE_it                  2044	3_0_0	EXIST::FUNCTION:
-ASN1_d2i_fp                             2045	3_0_0	EXIST::FUNCTION:STDIO
-EVP_DecryptFinal                        2046	3_0_0	EXIST::FUNCTION:
-ASN1_ENUMERATED_it                      2047	3_0_0	EXIST::FUNCTION:
-o2i_ECPublicKey                         2048	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-ERR_load_BUF_strings                    2049	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-PEM_read_bio_RSA_PUBKEY                 2050	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OCSP_SINGLERESP_new                     2051	3_0_0	EXIST::FUNCTION:OCSP
-ASN1_SCTX_free                          2052	3_0_0	EXIST::FUNCTION:
-i2d_ECPrivateKey_fp                     2053	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
-EVP_CIPHER_CTX_original_iv              2054	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-PKCS7_SIGNED_free                       2055	3_0_0	EXIST::FUNCTION:
-X509_TRUST_get0_name                    2056	3_0_0	EXIST::FUNCTION:
-ENGINE_get_load_pubkey_function         2057	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-UI_get_default_method                   2058	3_0_0	EXIST::FUNCTION:
-PKCS12_add_CSPName_asc                  2059	3_0_0	EXIST::FUNCTION:
-PEM_write_PUBKEY                        2060	3_0_0	EXIST::FUNCTION:STDIO
-UI_method_set_prompt_constructor        2061	3_0_0	EXIST::FUNCTION:
-OBJ_length                              2062	3_0_0	EXIST::FUNCTION:
-BN_GENCB_get_arg                        2063	3_0_0	EXIST::FUNCTION:
-EVP_MD_CTX_clear_flags                  2064	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_get_verifyctx             2065	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CT_POLICY_EVAL_CTX_get0_cert            2066	3_0_0	EXIST::FUNCTION:CT
-PEM_write_DHparams                      2067	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH,STDIO
-DH_set_ex_data                          2068	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-OCSP_SIGNATURE_free                     2069	3_0_0	EXIST::FUNCTION:OCSP
-CRYPTO_128_unwrap_pad                   2070	3_0_0	EXIST::FUNCTION:
-BIO_new_CMS                             2071	3_0_0	EXIST::FUNCTION:CMS
-i2d_ASN1_ENUMERATED                     2072	3_0_0	EXIST::FUNCTION:
-PEM_read_DSAparams                      2073	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
-TS_TST_INFO_set_ordering                2074	3_0_0	EXIST::FUNCTION:TS
-MDC2_Init                               2075	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MDC2
-i2o_SCT                                 2076	3_0_0	EXIST::FUNCTION:CT
-d2i_TS_STATUS_INFO                      2077	3_0_0	EXIST::FUNCTION:TS
-ERR_error_string_n                      2078	3_0_0	EXIST::FUNCTION:
-HMAC                                    2079	3_0_0	EXIST::FUNCTION:
-BN_mul                                  2080	3_0_0	EXIST::FUNCTION:
-BN_get0_nist_prime_384                  2081	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_set1_ip_asc           2082	3_0_0	EXIST::FUNCTION:
-CONF_modules_load                       2083	3_0_0	EXIST::FUNCTION:
-d2i_RSAPublicKey                        2084	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-i2d_ASN1_GENERALSTRING                  2085	3_0_0	EXIST::FUNCTION:
-POLICYQUALINFO_new                      2086	3_0_0	EXIST::FUNCTION:
-PKCS7_RECIP_INFO_get0_alg               2087	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_base_id                    2088	3_0_0	EXIST::FUNCTION:
-UI_method_set_opener                    2089	3_0_0	EXIST::FUNCTION:
-X509v3_get_ext_by_NID                   2090	3_0_0	EXIST::FUNCTION:
-TS_CONF_set_policies                    2091	3_0_0	EXIST::FUNCTION:TS
-CMS_SignerInfo_cert_cmp                 2092	3_0_0	EXIST::FUNCTION:CMS
-PEM_read                                2093	3_0_0	EXIST::FUNCTION:STDIO
-X509_STORE_set_depth                    2094	3_0_0	EXIST::FUNCTION:
-EC_KEY_METHOD_get_sign                  2095	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_CIPHER_CTX_iv                       2096	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-i2d_ESS_SIGNING_CERT                    2097	3_0_0	EXIST::FUNCTION:
-TS_RESP_set_tst_info                    2098	3_0_0	EXIST::FUNCTION:TS
-EVP_PKEY_CTX_set_data                   2099	3_0_0	EXIST::FUNCTION:
-CMS_EnvelopedData_create                2100	3_0_0	EXIST::FUNCTION:CMS
-SCT_new                                 2101	3_0_0	EXIST::FUNCTION:CT
-X509_REQ_add1_attr                      2102	3_0_0	EXIST::FUNCTION:
-X509_get_ext_count                      2103	3_0_0	EXIST::FUNCTION:
-CRYPTO_cts128_decrypt                   2104	3_0_0	EXIST::FUNCTION:
-ASYNC_WAIT_CTX_get_fd                   2105	3_0_0	EXIST::FUNCTION:
-i2d_TS_REQ                              2106	3_0_0	EXIST::FUNCTION:TS
-OCSP_ONEREQ_add1_ext_i2d                2107	3_0_0	EXIST::FUNCTION:OCSP
-ENGINE_register_pkey_meths              2108	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ENGINE_load_public_key                  2109	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ASIdOrRange_it                          2110	3_0_0	EXIST::FUNCTION:RFC3779
-DHparams_print_fp                       2111	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH,STDIO
-ERR_load_CRYPTO_strings                 2112	3_0_0	EXIST:!VMS:FUNCTION:DEPRECATEDIN_3_0
-ERR_load_CRYPTOlib_strings              2112	3_0_0	EXIST:VMS:FUNCTION:DEPRECATEDIN_3_0
-X509_REQ_set_version                    2113	3_0_0	EXIST::FUNCTION:
-d2i_ASN1_GENERALSTRING                  2114	3_0_0	EXIST::FUNCTION:
-i2d_ASIdentifiers                       2115	3_0_0	EXIST::FUNCTION:RFC3779
-X509V3_EXT_cleanup                      2116	3_0_0	EXIST::FUNCTION:
-CAST_ecb_encrypt                        2117	3_0_0	EXIST::FUNCTION:CAST,DEPRECATEDIN_3_0
-BIO_s_file                              2118	3_0_0	EXIST::FUNCTION:
-RSA_X931_derive_ex                      2119	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_decrypt_init                   2120	3_0_0	EXIST::FUNCTION:
-ENGINE_get_destroy_function             2121	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-SHA224_Init                             2122	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509V3_EXT_add_conf                     2123	3_0_0	EXIST::FUNCTION:
-ASN1_object_size                        2124	3_0_0	EXIST::FUNCTION:
-X509_REVOKED_free                       2125	3_0_0	EXIST::FUNCTION:
-BN_mod_exp_recp                         2126	3_0_0	EXIST::FUNCTION:
-EVP_mdc2                                2127	3_0_0	EXIST::FUNCTION:MDC2
-EVP_des_cfb64                           2128	3_0_0	EXIST::FUNCTION:DES
-PKCS7_sign                              2129	3_0_0	EXIST::FUNCTION:
-OCSP_SINGLERESP_get_ext_by_critical     2130	3_0_0	EXIST::FUNCTION:OCSP
-EDIPARTYNAME_it                         2131	3_0_0	EXIST::FUNCTION:
-ERR_print_errors_fp                     2132	3_0_0	EXIST::FUNCTION:STDIO
-BN_GF2m_mod_div_arr                     2133	3_0_0	EXIST::FUNCTION:EC2M
-PKCS12_SAFEBAG_get0_attr                2134	3_0_0	EXIST::FUNCTION:
-BIO_s_mem                               2135	3_0_0	EXIST::FUNCTION:
-OCSP_RESPDATA_new                       2136	3_0_0	EXIST::FUNCTION:OCSP
-ASN1_item_i2d_fp                        2137	3_0_0	EXIST::FUNCTION:STDIO
-BN_GF2m_mod_sqr                         2138	3_0_0	EXIST::FUNCTION:EC2M
-ASN1_PRINTABLE_new                      2139	3_0_0	EXIST::FUNCTION:
-OBJ_NAME_new_index                      2140	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_add_alias                 2141	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get1_DSA                       2142	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-SEED_cbc_encrypt                        2143	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SEED
-EVP_rc2_40_cbc                          2144	3_0_0	EXIST::FUNCTION:RC2
-ECDSA_SIG_new                           2145	3_0_0	EXIST::FUNCTION:EC
-i2d_PKCS8PrivateKey_nid_fp              2146	3_0_0	EXIST::FUNCTION:STDIO
-X509_NAME_ENTRY_it                      2147	3_0_0	EXIST::FUNCTION:
-CRYPTO_THREAD_compare_id                2148	3_0_0	EXIST::FUNCTION:
-d2i_IPAddressChoice                     2149	3_0_0	EXIST::FUNCTION:RFC3779
-IPAddressFamily_it                      2150	3_0_0	EXIST::FUNCTION:RFC3779
-ERR_load_OCSP_strings                   2151	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,OCSP
-BIO_push                                2152	3_0_0	EXIST::FUNCTION:
-ASN1_BMPSTRING_new                      2153	3_0_0	EXIST::FUNCTION:
-COMP_get_type                           2154	3_0_0	EXIST::FUNCTION:COMP
-d2i_ASIdentifierChoice                  2155	3_0_0	EXIST::FUNCTION:RFC3779
-i2d_ASN1_T61STRING                      2156	3_0_0	EXIST::FUNCTION:
-X509_add1_trust_object                  2157	3_0_0	EXIST::FUNCTION:
-PEM_write_X509                          2158	3_0_0	EXIST::FUNCTION:STDIO
-BN_CTX_free                             2159	3_0_0	EXIST::FUNCTION:
-EC_GROUP_get_curve_GF2m                 2160	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC2M
-EVP_MD_get_flags                        2161	3_0_0	EXIST::FUNCTION:
-OPENSSL_sk_set                          2162	3_0_0	EXIST::FUNCTION:
-OCSP_request_sign                       2163	3_0_0	EXIST::FUNCTION:OCSP
-BN_GF2m_mod_solve_quad                  2164	3_0_0	EXIST::FUNCTION:EC2M
-EC_POINT_method_of                      2165	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-PKCS7_ENCRYPT_it                        2166	3_0_0	EXIST::FUNCTION:
-AUTHORITY_INFO_ACCESS_it                2167	3_0_0	EXIST::FUNCTION:
-X509_EXTENSION_create_by_NID            2168	3_0_0	EXIST::FUNCTION:
-i2d_RSAPrivateKey                       2169	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-d2i_CERTIFICATEPOLICIES                 2170	3_0_0	EXIST::FUNCTION:
-CMAC_CTX_get0_cipher_ctx                2171	3_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
-X509_STORE_load_locations               2172	3_0_0	EXIST::FUNCTION:
-OBJ_find_sigid_algs                     2173	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_set_accuracy                2174	3_0_0	EXIST::FUNCTION:TS
-NETSCAPE_SPKI_get_pubkey                2175	3_0_0	EXIST::FUNCTION:
-ECDSA_do_sign_ex                        2176	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-OCSP_ONEREQ_get_ext                     2177	3_0_0	EXIST::FUNCTION:OCSP
-BN_get_rfc3526_prime_4096               2179	3_0_0	EXIST::FUNCTION:
-d2i_PKCS7_fp                            2180	3_0_0	EXIST::FUNCTION:STDIO
-PEM_write_bio_NETSCAPE_CERT_SEQUENCE    2181	3_0_0	EXIST::FUNCTION:
-PKCS12_AUTHSAFES_it                     2182	3_0_0	EXIST::FUNCTION:
-EVP_MD_CTX_free                         2183	3_0_0	EXIST::FUNCTION:
-CMS_RecipientInfo_kari_orig_id_cmp      2184	3_0_0	EXIST::FUNCTION:CMS
-NETSCAPE_SPKI_b64_encode                2185	3_0_0	EXIST::FUNCTION:
-d2i_PrivateKey                          2186	3_0_0	EXIST::FUNCTION:
-EVP_MD_CTX_new                          2187	3_0_0	EXIST::FUNCTION:
-X509_get0_tbs_sigalg                    2189	3_0_0	EXIST::FUNCTION:
-ASN1_GENERALIZEDTIME_new                2190	3_0_0	EXIST::FUNCTION:
-d2i_ECDSA_SIG                           2191	3_0_0	EXIST::FUNCTION:EC
-d2i_OTHERNAME                           2192	3_0_0	EXIST::FUNCTION:
-i2d_TS_RESP_fp                          2193	3_0_0	EXIST::FUNCTION:STDIO,TS
-OCSP_BASICRESP_get_ext_count            2194	3_0_0	EXIST::FUNCTION:OCSP
-ASN1_T61STRING_new                      2195	3_0_0	EXIST::FUNCTION:
-BN_kronecker                            2196	3_0_0	EXIST::FUNCTION:
-i2d_ACCESS_DESCRIPTION                  2197	3_0_0	EXIST::FUNCTION:
-EVP_camellia_192_cfb8                   2198	3_0_0	EXIST::FUNCTION:CAMELLIA
-X509_STORE_CTX_set_depth                2199	3_0_0	EXIST::FUNCTION:
-X509v3_delete_ext                       2200	3_0_0	EXIST::FUNCTION:
-ASN1_STRING_set0                        2201	3_0_0	EXIST::FUNCTION:
-BN_GF2m_add                             2202	3_0_0	EXIST::FUNCTION:EC2M
-CMAC_resume                             2203	3_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
-TS_ACCURACY_set_millis                  2204	3_0_0	EXIST::FUNCTION:TS
-X509V3_EXT_conf                         2205	3_0_0	EXIST::FUNCTION:
-i2d_DHxparams                           2206	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-EVP_CIPHER_CTX_free                     2207	3_0_0	EXIST::FUNCTION:
-WHIRLPOOL_BitUpdate                     2208	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,WHIRLPOOL
-EVP_idea_ecb                            2209	3_0_0	EXIST::FUNCTION:IDEA
-i2d_TS_ACCURACY                         2210	3_0_0	EXIST::FUNCTION:TS
-ASN1_VISIBLESTRING_free                 2211	3_0_0	EXIST::FUNCTION:
-NCONF_load_bio                          2212	3_0_0	EXIST::FUNCTION:
-DSA_get_default_method                  2213	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-OPENSSL_LH_retrieve                     2214	3_0_0	EXIST::FUNCTION:
-CRYPTO_ccm128_decrypt_ccm64             2215	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_set_clock_precision_digits  2216	3_0_0	EXIST::FUNCTION:TS
-SCT_LIST_validate                       2217	3_0_0	EXIST::FUNCTION:CT
-X509_PURPOSE_get_id                     2218	3_0_0	EXIST::FUNCTION:
-EC_KEY_get_ex_data                      2219	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_MD_get_size                         2220	3_0_0	EXIST::FUNCTION:
-CRYPTO_malloc                           2221	3_0_0	EXIST::FUNCTION:
-ERR_load_ASN1_strings                   2222	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_REQ_get_extension_nids             2223	3_0_0	EXIST::FUNCTION:
-TS_REQ_get_ext_by_OBJ                   2224	3_0_0	EXIST::FUNCTION:TS
-i2d_X509                                2225	3_0_0	EXIST::FUNCTION:
-PEM_read_X509_AUX                       2226	3_0_0	EXIST::FUNCTION:STDIO
-TS_VERIFY_CTX_set_flags                 2227	3_0_0	EXIST::FUNCTION:TS
-IPAddressRange_new                      2228	3_0_0	EXIST::FUNCTION:RFC3779
-TS_REQ_get_exts                         2229	3_0_0	EXIST::FUNCTION:TS
-POLICY_CONSTRAINTS_new                  2230	3_0_0	EXIST::FUNCTION:
-OTHERNAME_new                           2231	3_0_0	EXIST::FUNCTION:
-BN_rshift                               2232	3_0_0	EXIST::FUNCTION:
-i2d_GENERAL_NAMES                       2233	3_0_0	EXIST::FUNCTION:
-EC_METHOD_get_field_type                2234	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-ENGINE_set_name                         2235	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-TS_TST_INFO_get_policy_id               2236	3_0_0	EXIST::FUNCTION:TS
-PKCS7_SIGNER_INFO_set                   2237	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_PKCS8_PRIV_KEY_INFO       2238	3_0_0	EXIST::FUNCTION:
-EC_GROUP_set_curve_GF2m                 2239	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC2M
-ENGINE_load_builtin_engines             2240	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-SRP_VBASE_init                          2241	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SHA224_Final                            2242	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OCSP_CERTSTATUS_free                    2243	3_0_0	EXIST::FUNCTION:OCSP
-d2i_TS_TST_INFO                         2244	3_0_0	EXIST::FUNCTION:TS
-IPAddressOrRange_it                     2245	3_0_0	EXIST::FUNCTION:RFC3779
-ENGINE_get_cipher                       2246	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-TS_TST_INFO_delete_ext                  2247	3_0_0	EXIST::FUNCTION:TS
-TS_OBJ_print_bio                        2248	3_0_0	EXIST::FUNCTION:TS
-X509_time_adj_ex                        2249	3_0_0	EXIST::FUNCTION:
-OCSP_request_add1_cert                  2250	3_0_0	EXIST::FUNCTION:OCSP
-ERR_load_X509_strings                   2251	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-SHA1_Transform                          2252	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CMS_signed_get_attr_by_NID              2253	3_0_0	EXIST::FUNCTION:CMS
-X509_STORE_CTX_get_by_subject           2254	3_0_0	EXIST::FUNCTION:
-ASN1_OCTET_STRING_it                    2255	3_0_0	EXIST::FUNCTION:
-OPENSSL_sk_set_cmp_func                 2256	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_table_cleanup         2257	3_0_0	EXIST::FUNCTION:
-i2d_re_X509_REQ_tbs                     2258	3_0_0	EXIST::FUNCTION:
-CONF_load_bio                           2259	3_0_0	EXIST::FUNCTION:
-X509_ATTRIBUTE_get0_object              2260	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_missing_parameters             2261	3_0_0	EXIST::FUNCTION:
-X509_REQ_INFO_new                       2262	3_0_0	EXIST::FUNCTION:
-EVP_rc2_cfb64                           2263	3_0_0	EXIST::FUNCTION:RC2
-PKCS7_get_smimecap                      2264	3_0_0	EXIST::FUNCTION:
-ERR_get_state                           2265	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-d2i_DSAPrivateKey_bio                   2266	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-X509_PURPOSE_get_trust                  2267	3_0_0	EXIST::FUNCTION:
-EC_GROUP_get_point_conversion_form      2268	3_0_0	EXIST::FUNCTION:EC
-ASN1_OBJECT_it                          2269	3_0_0	EXIST::FUNCTION:
-BN_mod_add_quick                        2270	3_0_0	EXIST::FUNCTION:
-NCONF_free                              2271	3_0_0	EXIST::FUNCTION:
-NETSCAPE_SPKI_b64_decode                2272	3_0_0	EXIST::FUNCTION:
-BIO_f_md                                2273	3_0_0	EXIST::FUNCTION:
-EVP_MD_CTX_get_pkey_ctx                 2274	3_0_0	EXIST::FUNCTION:
-ENGINE_set_default_EC                   2275	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-CMS_ReceiptRequest_free                 2276	3_0_0	EXIST::FUNCTION:CMS
-TS_STATUS_INFO_get0_text                2277	3_0_0	EXIST::FUNCTION:TS
-CRYPTO_get_ex_new_index                 2278	3_0_0	EXIST::FUNCTION:
-ASN1_PCTX_set_flags                     2279	3_0_0	EXIST::FUNCTION:
-PEM_write_X509_CRL                      2280	3_0_0	EXIST::FUNCTION:STDIO
-BF_cbc_encrypt                          2281	3_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
-BN_num_bits_word                        2282	3_0_0	EXIST::FUNCTION:
-EVP_DecodeInit                          2283	3_0_0	EXIST::FUNCTION:
-BN_ucmp                                 2284	3_0_0	EXIST::FUNCTION:
-SXNET_get_id_asc                        2285	3_0_0	EXIST::FUNCTION:
-SCT_set1_extensions                     2286	3_0_0	EXIST::FUNCTION:CT
-PKCS12_SAFEBAG_new                      2287	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_set_nonce                   2288	3_0_0	EXIST::FUNCTION:TS
-PEM_read_ECPrivateKey                   2289	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
-RSA_free                                2290	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_CRL_INFO_new                       2291	3_0_0	EXIST::FUNCTION:
-AES_cfb8_encrypt                        2292	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-d2i_ASN1_SEQUENCE_ANY                   2293	3_0_0	EXIST::FUNCTION:
-PKCS12_create                           2294	3_0_0	EXIST::FUNCTION:
-X509at_get_attr_count                   2295	3_0_0	EXIST::FUNCTION:
-PKCS12_init                             2296	3_0_0	EXIST::FUNCTION:
-CRYPTO_free_ex_data                     2297	3_0_0	EXIST::FUNCTION:
-EVP_aes_128_cfb8                        2298	3_0_0	EXIST::FUNCTION:
-ESS_ISSUER_SERIAL_free                  2299	3_0_0	EXIST::FUNCTION:
-BN_mod_exp_mont_word                    2300	3_0_0	EXIST::FUNCTION:
-X509V3_EXT_nconf_nid                    2301	3_0_0	EXIST::FUNCTION:
-UTF8_putc                               2302	3_0_0	EXIST::FUNCTION:
-RSA_private_encrypt                     2303	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_LOOKUP_shutdown                    2304	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_set_accuracy                2305	3_0_0	EXIST::FUNCTION:TS
-OCSP_basic_verify                       2306	3_0_0	EXIST::FUNCTION:OCSP
-X509at_add1_attr_by_OBJ                 2307	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_add0                      2308	3_0_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_get1_crl                 2309	3_0_0	EXIST::FUNCTION:
-ASN1_STRING_get_default_mask            2310	3_0_0	EXIST::FUNCTION:
-X509_alias_set1                         2311	3_0_0	EXIST::FUNCTION:
-ASN1_item_unpack                        2312	3_0_0	EXIST::FUNCTION:
-HMAC_CTX_free                           2313	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EC_POINT_new                            2314	3_0_0	EXIST::FUNCTION:EC
-PKCS7_ISSUER_AND_SERIAL_digest          2315	3_0_0	EXIST::FUNCTION:
-EVP_des_ofb                             2316	3_0_0	EXIST::FUNCTION:DES
-DSA_set_method                          2317	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-EVP_PKEY_get1_RSA                       2318	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EC_KEY_OpenSSL                          2319	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_camellia_192_ofb                    2320	3_0_0	EXIST::FUNCTION:CAMELLIA
-ASN1_STRING_length                      2321	3_0_0	EXIST::FUNCTION:
-PKCS7_set_digest                        2322	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_PUBKEY                    2323	3_0_0	EXIST::FUNCTION:
-PEM_read_PKCS7                          2324	3_0_0	EXIST::FUNCTION:STDIO
-DH_get_2048_256                         2325	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-X509at_delete_attr                      2326	3_0_0	EXIST::FUNCTION:
-PEM_write_bio                           2327	3_0_0	EXIST::FUNCTION:
-CMS_signed_get_attr_by_OBJ              2329	3_0_0	EXIST::FUNCTION:CMS
-X509_REVOKED_add_ext                    2330	3_0_0	EXIST::FUNCTION:
-EVP_CipherUpdate                        2331	3_0_0	EXIST::FUNCTION:
-Camellia_cfb8_encrypt                   2332	3_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
-EVP_aes_256_xts                         2333	3_0_0	EXIST::FUNCTION:
-EVP_DigestSignFinal                     2334	3_0_0	EXIST::FUNCTION:
-ASN1_STRING_cmp                         2335	3_0_0	EXIST::FUNCTION:
-EVP_chacha20_poly1305                   2336	3_0_0	EXIST::FUNCTION:CHACHA,POLY1305
-OPENSSL_sk_zero                         2337	3_0_0	EXIST::FUNCTION:
-ASN1_PRINTABLE_type                     2338	3_0_0	EXIST::FUNCTION:
-TS_CONF_set_ess_cert_id_chain           2339	3_0_0	EXIST::FUNCTION:TS
-PEM_read_DSAPrivateKey                  2340	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
-DH_generate_parameters_ex               2341	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-UI_dup_input_string                     2342	3_0_0	EXIST::FUNCTION:
-X509_keyid_set1                         2343	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_set1                  2344	3_0_0	EXIST::FUNCTION:
-EC_GROUP_get_asn1_flag                  2345	3_0_0	EXIST::FUNCTION:EC
-CMS_decrypt_set1_password               2346	3_0_0	EXIST::FUNCTION:CMS
-BIO_copy_next_retry                     2347	3_0_0	EXIST::FUNCTION:
-X509_POLICY_NODE_print                  2348	3_0_0	EXIST::FUNCTION:
-ASN1_TIME_diff                          2349	3_0_0	EXIST::FUNCTION:
-BIO_s_fd                                2350	3_0_0	EXIST::FUNCTION:
-i2d_CMS_bio                             2351	3_0_0	EXIST::FUNCTION:CMS
-CRYPTO_gcm128_decrypt                   2352	3_0_0	EXIST::FUNCTION:
-EVP_aes_256_ctr                         2353	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_bits                       2354	3_0_0	EXIST::FUNCTION:
-BN_BLINDING_new                         2355	3_0_0	EXIST::FUNCTION:
-ASN1_GENERALIZEDTIME_check              2356	3_0_0	EXIST::FUNCTION:
-BN_clear_bit                            2357	3_0_0	EXIST::FUNCTION:
-BN_bn2lebinpad                          2358	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_up_ref                         2359	3_0_0	EXIST::FUNCTION:
-X509_getm_notBefore                     2360	3_0_0	EXIST::FUNCTION:
-BN_nist_mod_224                         2361	3_0_0	EXIST::FUNCTION:
-DES_decrypt3                            2362	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-OTHERNAME_it                            2363	3_0_0	EXIST::FUNCTION:
-X509at_add1_attr_by_txt                 2364	3_0_0	EXIST::FUNCTION:
-PKCS7_SIGN_ENVELOPE_free                2365	3_0_0	EXIST::FUNCTION:
-BIO_dgram_is_sctp                       2366	3_0_0	EXIST::FUNCTION:DGRAM,SCTP
-DH_check                                2367	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-Camellia_set_key                        2368	3_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
-X509_LOOKUP_by_issuer_serial            2369	3_0_0	EXIST::FUNCTION:
-ASN1_BMPSTRING_free                     2370	3_0_0	EXIST::FUNCTION:
-BIO_new_accept                          2371	3_0_0	EXIST::FUNCTION:SOCK
-GENERAL_NAME_new                        2372	3_0_0	EXIST::FUNCTION:
-DES_encrypt3                            2373	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-PKCS7_get_signer_info                   2374	3_0_0	EXIST::FUNCTION:
-ASN1_OCTET_STRING_set                   2375	3_0_0	EXIST::FUNCTION:
-BN_mask_bits                            2376	3_0_0	EXIST::FUNCTION:
-ASN1_UTF8STRING_it                      2377	3_0_0	EXIST::FUNCTION:
-ASN1_SCTX_set_app_data                  2378	3_0_0	EXIST::FUNCTION:
-CMS_add0_cert                           2379	3_0_0	EXIST::FUNCTION:CMS
-i2d_GENERAL_NAME                        2380	3_0_0	EXIST::FUNCTION:
-BIO_ADDR_new                            2381	3_0_0	EXIST::FUNCTION:SOCK
-ENGINE_get_pkey_asn1_meth_engine        2382	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-d2i_ASN1_BMPSTRING                      2383	3_0_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_create0_p8inf            2384	3_0_0	EXIST::FUNCTION:
-OBJ_cmp                                 2385	3_0_0	EXIST::FUNCTION:
-MD2                                     2386	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD2
-X509_PUBKEY_new                         2387	3_0_0	EXIST::FUNCTION:
-BN_CTX_end                              2388	3_0_0	EXIST::FUNCTION:
-BIO_get_retry_BIO                       2389	3_0_0	EXIST::FUNCTION:
-X509_REQ_add1_attr_by_OBJ               2390	3_0_0	EXIST::FUNCTION:
-ASN1_item_ex_free                       2391	3_0_0	EXIST::FUNCTION:
-X509_SIG_new                            2392	3_0_0	EXIST::FUNCTION:
-BN_sqr                                  2393	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_set_time                    2394	3_0_0	EXIST::FUNCTION:TS
-OPENSSL_die                             2395	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_by_alias                    2396	3_0_0	EXIST::FUNCTION:
-EC_KEY_set_conv_form                    2397	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_TRUST_get_count                    2399	3_0_0	EXIST::FUNCTION:
-IPAddressOrRange_free                   2400	3_0_0	EXIST::FUNCTION:RFC3779
-RSA_padding_add_PKCS1_OAEP              2401	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EC_KEY_set_ex_data                      2402	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-SRP_VBASE_new                           2403	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-i2d_ECDSA_SIG                           2404	3_0_0	EXIST::FUNCTION:EC
-BIO_dump_indent                         2405	3_0_0	EXIST::FUNCTION:
-ENGINE_set_pkey_asn1_meths              2406	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-OPENSSL_gmtime_diff                     2407	3_0_0	EXIST::FUNCTION:
-TS_CONF_set_crypto_device               2408	3_0_0	EXIST::FUNCTION:ENGINE,TS
-COMP_CTX_get_method                     2409	3_0_0	EXIST::FUNCTION:COMP
-EC_GROUP_get_cofactor                   2410	3_0_0	EXIST::FUNCTION:EC
-EVP_rc5_32_12_16_ofb                    2411	3_0_0	EXIST::FUNCTION:RC5
-EVP_MD_CTX_get0_md_data                 2412	3_0_0	EXIST::FUNCTION:
-ASN1_PCTX_set_nm_flags                  2413	3_0_0	EXIST::FUNCTION:
-BIO_ctrl                                2414	3_0_0	EXIST::FUNCTION:
-X509_CRL_set_default_method             2415	3_0_0	EXIST::FUNCTION:
-d2i_RSAPublicKey_fp                     2417	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
-UI_method_get_flusher                   2418	3_0_0	EXIST::FUNCTION:
-EC_POINT_dbl                            2419	3_0_0	EXIST::FUNCTION:EC
-i2d_X509_CRL_INFO                       2420	3_0_0	EXIST::FUNCTION:
-i2d_OCSP_CERTSTATUS                     2421	3_0_0	EXIST::FUNCTION:OCSP
-X509_REVOKED_get0_revocationDate        2422	3_0_0	EXIST::FUNCTION:
-PKCS7_add_crl                           2423	3_0_0	EXIST::FUNCTION:
-ECDSA_do_sign                           2424	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-ASN1_GENERALIZEDTIME_it                 2425	3_0_0	EXIST::FUNCTION:
-PKCS8_pkey_get0                         2426	3_0_0	EXIST::FUNCTION:
-OCSP_sendreq_new                        2427	3_0_0	EXIST::FUNCTION:OCSP
-EVP_aes_256_cfb128                      2428	3_0_0	EXIST::FUNCTION:
-RSA_set_ex_data                         2429	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BN_GENCB_call                           2430	3_0_0	EXIST::FUNCTION:
-X509V3_EXT_add_nconf_sk                 2431	3_0_0	EXIST::FUNCTION:
-i2d_TS_MSG_IMPRINT_fp                   2432	3_0_0	EXIST::FUNCTION:STDIO,TS
-PKCS12_new                              2433	3_0_0	EXIST::FUNCTION:
-X509_REVOKED_set_serialNumber           2434	3_0_0	EXIST::FUNCTION:
-EVP_get_digestbyname                    2435	3_0_0	EXIST::FUNCTION:
-X509_CRL_get_lastUpdate                 2436	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
-OBJ_create_objects                      2437	3_0_0	EXIST::FUNCTION:
-EVP_enc_null                            2438	3_0_0	EXIST::FUNCTION:
-OCSP_ONEREQ_get_ext_by_critical         2439	3_0_0	EXIST::FUNCTION:OCSP
-OCSP_request_onereq_count               2440	3_0_0	EXIST::FUNCTION:OCSP
-BN_hex2bn                               2441	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_meth_set_impl_ctx_size       2442	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASIdentifiers_new                       2443	3_0_0	EXIST::FUNCTION:RFC3779
-CONF_imodule_get_flags                  2444	3_0_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_it                       2445	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_meth_set_set_asn1_params     2446	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EC_KEY_get_enc_flags                    2447	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_OBJECT_idx_by_subject              2448	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_copy                      2449	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-NETSCAPE_CERT_SEQUENCE_new              2450	3_0_0	EXIST::FUNCTION:
-CRYPTO_ocb128_decrypt                   2451	3_0_0	EXIST::FUNCTION:OCB
-ASYNC_WAIT_CTX_free                     2452	3_0_0	EXIST::FUNCTION:
-d2i_PKCS7_DIGEST                        2453	3_0_0	EXIST::FUNCTION:
-d2i_TS_TST_INFO_bio                     2454	3_0_0	EXIST::FUNCTION:TS
-BIGNUM_it                               2455	3_0_0	EXIST::FUNCTION:
-BN_BLINDING_get_flags                   2456	3_0_0	EXIST::FUNCTION:
-X509_EXTENSION_get_critical             2457	3_0_0	EXIST::FUNCTION:
-DSA_set_default_method                  2458	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-PEM_write_bio_DHxparams                 2459	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DSA_set_ex_data                         2460	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-BIO_s_datagram_sctp                     2461	3_0_0	EXIST::FUNCTION:DGRAM,SCTP
-SXNET_add_id_asc                        2462	3_0_0	EXIST::FUNCTION:
-X509_print_fp                           2463	3_0_0	EXIST::FUNCTION:STDIO
-TS_REQ_set_version                      2464	3_0_0	EXIST::FUNCTION:TS
-OCSP_REQINFO_new                        2465	3_0_0	EXIST::FUNCTION:OCSP
-Camellia_decrypt                        2466	3_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
-X509_signature_print                    2467	3_0_0	EXIST::FUNCTION:
-EVP_camellia_128_ecb                    2468	3_0_0	EXIST::FUNCTION:CAMELLIA
-MD2_Final                               2469	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD2
-OSSL_HTTP_REQ_CTX_add1_header           2470	3_0_0	EXIST::FUNCTION:HTTP
-NETSCAPE_SPKAC_it                       2471	3_0_0	EXIST::FUNCTION:
-ASIdOrRange_free                        2472	3_0_0	EXIST::FUNCTION:RFC3779
-EC_POINT_get_Jprojective_coordinates_GFp 2473	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_aes_128_cbc_hmac_sha256             2474	3_0_0	EXIST::FUNCTION:
-i2d_PKCS7_SIGNED                        2475	3_0_0	EXIST::FUNCTION:
-TS_VERIFY_CTX_set_data                  2476	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_4,TS
-BN_pseudo_rand_range                    2477	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509V3_EXT_add_nconf                    2478	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_ctrl                     2479	3_0_0	EXIST::FUNCTION:
-ASN1_T61STRING_it                       2480	3_0_0	EXIST::FUNCTION:
-ENGINE_get_prev                         2481	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-OCSP_accept_responses_new               2482	3_0_0	EXIST::FUNCTION:OCSP
-ERR_load_EC_strings                     2483	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509V3_string_free                      2484	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_set_paramgen              2485	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ENGINE_set_load_ssl_client_cert_function 2486	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EVP_ENCODE_CTX_free                     2487	3_0_0	EXIST::FUNCTION:
-i2d_ASN1_BIT_STRING                     2488	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_set_verifyctx             2489	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_TRUST_add                          2490	3_0_0	EXIST::FUNCTION:
-BUF_MEM_free                            2491	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_get_accuracy                2492	3_0_0	EXIST::FUNCTION:TS
-TS_REQ_dup                              2493	3_0_0	EXIST::FUNCTION:TS
-ASN1_STRING_type_new                    2494	3_0_0	EXIST::FUNCTION:
-TS_STATUS_INFO_free                     2495	3_0_0	EXIST::FUNCTION:TS
-BN_mod_mul                              2496	3_0_0	EXIST::FUNCTION:
-CMS_add0_recipient_key                  2497	3_0_0	EXIST::FUNCTION:CMS
-BIO_f_zlib                              2498	3_0_0	EXIST::FUNCTION:COMP
-AES_cfb128_encrypt                      2499	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ENGINE_set_EC                           2500	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-d2i_ECPKParameters                      2501	3_0_0	EXIST::FUNCTION:EC
-IDEA_ofb64_encrypt                      2502	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
-CAST_decrypt                            2503	3_0_0	EXIST::FUNCTION:CAST,DEPRECATEDIN_3_0
-TS_STATUS_INFO_get0_failure_info        2504	3_0_0	EXIST::FUNCTION:TS
-ENGINE_unregister_pkey_meths            2506	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-DISPLAYTEXT_new                         2507	3_0_0	EXIST::FUNCTION:
-CMS_final                               2508	3_0_0	EXIST::FUNCTION:CMS
-BIO_nwrite                              2509	3_0_0	EXIST::FUNCTION:
-GENERAL_NAME_free                       2510	3_0_0	EXIST::FUNCTION:
-PKCS12_pack_p7encdata                   2511	3_0_0	EXIST::FUNCTION:
-BN_generate_dsa_nonce                   2512	3_0_0	EXIST::FUNCTION:
-X509_verify_cert                        2513	3_0_0	EXIST::FUNCTION:
-X509_policy_level_get0_node             2514	3_0_0	EXIST::FUNCTION:
-X509_REQ_get_attr                       2515	3_0_0	EXIST::FUNCTION:
-SHA1                                    2516	3_0_0	EXIST::FUNCTION:
-X509_print                              2517	3_0_0	EXIST::FUNCTION:
-d2i_AutoPrivateKey                      2518	3_0_0	EXIST::FUNCTION:
-X509_REQ_new                            2519	3_0_0	EXIST::FUNCTION:
-PKCS12_add_safes                        2520	3_0_0	EXIST::FUNCTION:
-PKCS12_parse                            2521	3_0_0	EXIST::FUNCTION:
-BN_GF2m_mod_div                         2522	3_0_0	EXIST::FUNCTION:EC2M
-i2d_USERNOTICE                          2523	3_0_0	EXIST::FUNCTION:
-d2i_NETSCAPE_SPKI                       2524	3_0_0	EXIST::FUNCTION:
-CRYPTO_mem_leaks                        2525	3_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
-BN_get_rfc3526_prime_1536               2526	3_0_0	EXIST::FUNCTION:
-DSA_sign                                2527	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-RAND_egd                                2528	3_0_0	EXIST::FUNCTION:EGD
-ASN1_d2i_bio                            2529	3_0_0	EXIST::FUNCTION:
-X509_REQ_digest                         2531	3_0_0	EXIST::FUNCTION:
-X509_set1_notAfter                      2532	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_get_type                     2533	3_0_0	EXIST::FUNCTION:
-ASN1_TYPE_set_octetstring               2534	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_set_free                  2535	3_0_0	EXIST::FUNCTION:
-CMS_signed_get0_data_by_OBJ             2536	3_0_0	EXIST::FUNCTION:CMS
-X509_PURPOSE_add                        2537	3_0_0	EXIST::FUNCTION:
-PKCS7_ENVELOPE_free                     2538	3_0_0	EXIST::FUNCTION:
-PKCS12_key_gen_uni                      2539	3_0_0	EXIST::FUNCTION:
-WHIRLPOOL                               2540	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,WHIRLPOOL
-UI_set_default_method                   2542	3_0_0	EXIST::FUNCTION:
-EC_POINT_is_at_infinity                 2543	3_0_0	EXIST::FUNCTION:EC
-i2d_NOTICEREF                           2544	3_0_0	EXIST::FUNCTION:
-EC_KEY_new                              2545	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_chacha20                            2546	3_0_0	EXIST::FUNCTION:CHACHA
-BN_bn2dec                               2547	3_0_0	EXIST::FUNCTION:
-X509_REQ_print_ex                       2548	3_0_0	EXIST::FUNCTION:
-PEM_read_CMS                            2549	3_0_0	EXIST::FUNCTION:CMS,STDIO
-d2i_NETSCAPE_CERT_SEQUENCE              2550	3_0_0	EXIST::FUNCTION:
-X509_CRL_set_version                    2551	3_0_0	EXIST::FUNCTION:
-ASN1_PCTX_set_cert_flags                2552	3_0_0	EXIST::FUNCTION:
-PKCS8_PRIV_KEY_INFO_free                2553	3_0_0	EXIST::FUNCTION:
-SHA224_Update                           2554	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EC_GROUP_new_by_curve_name              2555	3_0_0	EXIST::FUNCTION:EC
-X509_STORE_set_purpose                  2556	3_0_0	EXIST::FUNCTION:
-X509_CRL_get0_signature                 2557	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_keygen_info            2558	3_0_0	EXIST::FUNCTION:
-d2i_ASN1_UINTEGER                       2559	3_0_0	EXIST::FUNCTION:
-i2s_ASN1_INTEGER                        2560	3_0_0	EXIST::FUNCTION:
-d2i_EC_PUBKEY_fp                        2561	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
-i2d_OCSP_SIGNATURE                      2562	3_0_0	EXIST::FUNCTION:OCSP
-i2d_X509_EXTENSION                      2563	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_X509                       2564	3_0_0	EXIST::FUNCTION:
-DES_key_sched                           2565	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-GENERAL_NAME_dup                        2566	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get1_crls                2567	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_set_verify                2568	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_sha256                              2569	3_0_0	EXIST::FUNCTION:
-CMS_unsigned_delete_attr                2570	3_0_0	EXIST::FUNCTION:CMS
-EVP_md5_sha1                            2571	3_0_0	EXIST::FUNCTION:MD5
-EVP_PKEY_sign_init                      2572	3_0_0	EXIST::FUNCTION:
-OPENSSL_LH_insert                       2573	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_meth_get_cleanup             2574	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_item_ex_d2i                        2575	3_0_0	EXIST::FUNCTION:
-EVP_MD_meth_free                        2576	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_new                       2577	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_padding_check_PKCS1_OAEP            2578	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OCSP_SERVICELOC_it                      2579	3_0_0	EXIST::FUNCTION:OCSP
-PKCS12_SAFEBAG_get_nid                  2580	3_0_0	EXIST::FUNCTION:
-EVP_MD_CTX_set_update_fn                2581	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BIO_f_asn1                              2582	3_0_0	EXIST::FUNCTION:
-BIO_dump                                2583	3_0_0	EXIST::FUNCTION:
-ENGINE_load_ssl_client_cert             2584	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-X509_STORE_CTX_set_verify_cb            2585	3_0_0	EXIST::FUNCTION:
-CRYPTO_clear_realloc                    2586	3_0_0	EXIST::FUNCTION:
-OPENSSL_strnlen                         2587	3_0_0	EXIST::FUNCTION:
-IDEA_ecb_encrypt                        2588	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
-ASN1_STRING_set_default_mask            2589	3_0_0	EXIST::FUNCTION:
-TS_VERIFY_CTX_add_flags                 2590	3_0_0	EXIST::FUNCTION:TS
-d2i_ASN1_UNIVERSALSTRING                2592	3_0_0	EXIST::FUNCTION:
-NAME_CONSTRAINTS_free                   2593	3_0_0	EXIST::FUNCTION:
-EC_GROUP_get_order                      2594	3_0_0	EXIST::FUNCTION:EC
-X509_REVOKED_add1_ext_i2d               2595	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_add1_host             2596	3_0_0	EXIST::FUNCTION:
-i2d_PUBKEY_bio                          2597	3_0_0	EXIST::FUNCTION:
-MD4_Update                              2598	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD4
-X509_STORE_CTX_set_time                 2599	3_0_0	EXIST::FUNCTION:
-ENGINE_set_default_DH                   2600	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-X509_ocspid_print                       2601	3_0_0	EXIST::FUNCTION:
-DH_set_method                           2602	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-EVP_rc2_64_cbc                          2603	3_0_0	EXIST::FUNCTION:RC2
-CRYPTO_THREAD_get_current_id            2604	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_cb                     2605	3_0_0	EXIST::FUNCTION:
-PROXY_POLICY_it                         2606	3_0_0	EXIST::FUNCTION:
-ENGINE_register_complete                2607	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EVP_DecodeUpdate                        2609	3_0_0	EXIST::FUNCTION:
-ENGINE_get_default_RAND                 2610	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ERR_peek_last_error_line                2611	3_0_0	EXIST::FUNCTION:
-ENGINE_get_ssl_client_cert_function     2612	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-OPENSSL_LH_node_usage_stats             2613	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_1,STDIO
-DIRECTORYSTRING_it                      2614	3_0_0	EXIST::FUNCTION:
-BIO_write                               2615	3_0_0	EXIST::FUNCTION:
-OCSP_ONEREQ_get_ext_by_OBJ              2616	3_0_0	EXIST::FUNCTION:OCSP
-SEED_encrypt                            2617	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SEED
-IPAddressRange_it                       2618	3_0_0	EXIST::FUNCTION:RFC3779
-PEM_read_bio_DSAPrivateKey              2619	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-CMS_get0_type                           2620	3_0_0	EXIST::FUNCTION:CMS
-ASN1_PCTX_free                          2621	3_0_0	EXIST::FUNCTION:
-ESS_SIGNING_CERT_new                    2622	3_0_0	EXIST::FUNCTION:
-X509V3_EXT_conf_nid                     2623	3_0_0	EXIST::FUNCTION:
-EC_KEY_check_key                        2624	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-PKCS5_PBKDF2_HMAC                       2625	3_0_0	EXIST::FUNCTION:
-CONF_get_section                        2626	3_0_0	EXIST::FUNCTION:
-CMS_RecipientInfo_kari_decrypt          2627	3_0_0	EXIST::FUNCTION:CMS
-OBJ_add_sigid                           2628	3_0_0	EXIST::FUNCTION:
-d2i_SXNETID                             2629	3_0_0	EXIST::FUNCTION:
-CMS_get1_certs                          2630	3_0_0	EXIST::FUNCTION:CMS
-X509_CRL_check_suiteb                   2631	3_0_0	EXIST::FUNCTION:
-PKCS7_ENVELOPE_it                       2632	3_0_0	EXIST::FUNCTION:
-ASIdentifierChoice_it                   2633	3_0_0	EXIST::FUNCTION:RFC3779
-CMS_RecipientEncryptedKey_cert_cmp      2634	3_0_0	EXIST::FUNCTION:CMS
-EVP_PKEY_CTX_get_app_data               2635	3_0_0	EXIST::FUNCTION:
-EC_GROUP_clear_free                     2636	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-BN_get_rfc2409_prime_1024               2637	3_0_0	EXIST::FUNCTION:
-CRYPTO_set_mem_functions                2638	3_0_0	EXIST::FUNCTION:
-i2d_ASN1_VISIBLESTRING                  2639	3_0_0	EXIST::FUNCTION:
-d2i_PBKDF2PARAM                         2640	3_0_0	EXIST::FUNCTION:
-ERR_load_COMP_strings                   2641	3_0_0	EXIST::FUNCTION:COMP,DEPRECATEDIN_3_0
-EVP_PKEY_meth_add0                      2642	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_rc4_40                              2643	3_0_0	EXIST::FUNCTION:RC4
-RSA_bits                                2645	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_item_dup                           2646	3_0_0	EXIST::FUNCTION:
-GENERAL_NAMES_it                        2647	3_0_0	EXIST::FUNCTION:
-X509_issuer_name_hash                   2648	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_get_nonce                   2649	3_0_0	EXIST::FUNCTION:TS
-MD4_Init                                2650	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD4
-X509_EXTENSION_create_by_OBJ            2651	3_0_0	EXIST::FUNCTION:
-EVP_aes_256_cbc_hmac_sha1               2652	3_0_0	EXIST::FUNCTION:
-SCT_validate                            2653	3_0_0	EXIST::FUNCTION:CT
-EC_GROUP_dup                            2654	3_0_0	EXIST::FUNCTION:EC
-EVP_sha1                                2655	3_0_0	EXIST::FUNCTION:
-OPENSSL_sk_new                          2656	3_0_0	EXIST::FUNCTION:
-BN_dup                                  2657	3_0_0	EXIST::FUNCTION:
-TS_MSG_IMPRINT_print_bio                2658	3_0_0	EXIST::FUNCTION:TS
-CONF_module_set_usr_data                2659	3_0_0	EXIST::FUNCTION:
-EC_KEY_generate_key                     2660	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-BIO_ctrl_get_write_guarantee            2661	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_assign                         2662	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_aes_128_ofb                         2663	3_0_0	EXIST::FUNCTION:
-CMS_data                                2664	3_0_0	EXIST::FUNCTION:CMS
-X509_load_cert_file                     2665	3_0_0	EXIST::FUNCTION:
-EC_GFp_nistp521_method                  2667	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC_NISTP_64_GCC_128
-ECDSA_SIG_free                          2668	3_0_0	EXIST::FUNCTION:EC
-d2i_PKCS12_BAGS                         2669	3_0_0	EXIST::FUNCTION:
-RSA_public_encrypt                      2670	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_CRL_get0_extensions                2671	3_0_0	EXIST::FUNCTION:
-CMS_digest_verify                       2672	3_0_0	EXIST::FUNCTION:CMS
-ASN1_GENERALIZEDTIME_set                2673	3_0_0	EXIST::FUNCTION:
-TS_VERIFY_CTX_set_imprint               2674	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_4,TS
-BN_RECP_CTX_set                         2675	3_0_0	EXIST::FUNCTION:
-CRYPTO_secure_zalloc                    2676	3_0_0	EXIST::FUNCTION:
-i2d_EXTENDED_KEY_USAGE                  2677	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_DSAparams                 2678	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-X509_cmp_time                           2679	3_0_0	EXIST::FUNCTION:
-d2i_CMS_ReceiptRequest                  2680	3_0_0	EXIST::FUNCTION:CMS
-X509_CRL_INFO_it                        2681	3_0_0	EXIST::FUNCTION:
-BUF_reverse                             2682	3_0_0	EXIST::FUNCTION:
-d2i_OCSP_SIGNATURE                      2683	3_0_0	EXIST::FUNCTION:OCSP
-X509_REQ_delete_attr                    2684	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_set_signer_cert             2685	3_0_0	EXIST::FUNCTION:TS
-X509V3_EXT_d2i                          2686	3_0_0	EXIST::FUNCTION:
-ASN1_GENERALSTRING_it                   2687	3_0_0	EXIST::FUNCTION:
-POLICYQUALINFO_free                     2688	3_0_0	EXIST::FUNCTION:
-EC_KEY_set_group                        2689	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-OCSP_check_validity                     2690	3_0_0	EXIST::FUNCTION:OCSP
-PEM_write_ECPKParameters                2691	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
-X509_VERIFY_PARAM_lookup                2692	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_by_fingerprint              2693	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_meth_free                    2694	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-PKCS7_RECIP_INFO_new                    2695	3_0_0	EXIST::FUNCTION:
-d2i_ECPrivateKey_fp                     2696	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
-TS_CONF_set_ordering                    2697	3_0_0	EXIST::FUNCTION:TS
-X509_CRL_get_ext                        2698	3_0_0	EXIST::FUNCTION:
-X509_CRL_get_ext_by_OBJ                 2699	3_0_0	EXIST::FUNCTION:
-OCSP_basic_add1_cert                    2700	3_0_0	EXIST::FUNCTION:OCSP
-ASN1_PRINTABLESTRING_new                2701	3_0_0	EXIST::FUNCTION:
-i2d_PBEPARAM                            2702	3_0_0	EXIST::FUNCTION:
-NETSCAPE_SPKI_new                       2703	3_0_0	EXIST::FUNCTION:
-AES_options                             2704	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-POLICYINFO_free                         2705	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_Parameters                 2706	3_0_0	EXIST::FUNCTION:
-BN_abs_is_word                          2707	3_0_0	EXIST::FUNCTION:
-BIO_set_callback_arg                    2708	3_0_0	EXIST::FUNCTION:
-CONF_modules_load_file                  2709	3_0_0	EXIST::FUNCTION:
-X509_trust_clear                        2710	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_test_flags               2711	3_0_0	EXIST::FUNCTION:
-PKCS12_BAGS_free                        2712	3_0_0	EXIST::FUNCTION:
-PEM_X509_INFO_read                      2713	3_0_0	EXIST::FUNCTION:STDIO
-d2i_DSAPrivateKey                       2714	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-i2d_PKCS8_PRIV_KEY_INFO_fp              2715	3_0_0	EXIST::FUNCTION:STDIO
-TS_RESP_print_bio                       2716	3_0_0	EXIST::FUNCTION:TS
-X509_STORE_set_default_paths            2717	3_0_0	EXIST::FUNCTION:
-d2i_TS_REQ                              2718	3_0_0	EXIST::FUNCTION:TS
-i2d_TS_TST_INFO_bio                     2719	3_0_0	EXIST::FUNCTION:TS
-CMS_sign_receipt                        2720	3_0_0	EXIST::FUNCTION:CMS
-ENGINE_set_RAND                         2721	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-X509_REVOKED_get_ext_by_OBJ             2722	3_0_0	EXIST::FUNCTION:
-SEED_decrypt                            2723	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SEED
-PEM_write_PKCS8PrivateKey               2724	3_0_0	EXIST::FUNCTION:STDIO
-ENGINE_new                              2725	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-X509_check_issued                       2726	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_get_iv_length            2727	3_0_0	EXIST::FUNCTION:
-DES_string_to_2keys                     2728	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-EVP_PKEY_copy_parameters                2729	3_0_0	EXIST::FUNCTION:
-CMS_ContentInfo_print_ctx               2730	3_0_0	EXIST::FUNCTION:CMS
-d2i_PKCS7_SIGNED                        2731	3_0_0	EXIST::FUNCTION:
-GENERAL_NAMES_free                      2732	3_0_0	EXIST::FUNCTION:
-SCT_get_timestamp                       2733	3_0_0	EXIST::FUNCTION:CT
-OCSP_SIGNATURE_it                       2734	3_0_0	EXIST::FUNCTION:OCSP
-CMS_verify_receipt                      2735	3_0_0	EXIST::FUNCTION:CMS
-CRYPTO_THREAD_lock_new                  2736	3_0_0	EXIST::FUNCTION:
-BIO_get_ex_data                         2737	3_0_0	EXIST::FUNCTION:
-CMS_digest_create                       2738	3_0_0	EXIST::FUNCTION:CMS
-EC_KEY_METHOD_set_verify                2739	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-PEM_read_RSAPublicKey                   2740	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
-ENGINE_pkey_asn1_find_str               2741	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ENGINE_get_load_privkey_function        2742	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-d2i_IPAddressRange                      2743	3_0_0	EXIST::FUNCTION:RFC3779
-ERR_remove_state                        2744	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_0_0
-X509_CRL_print_fp                       2745	3_0_0	EXIST::FUNCTION:STDIO
-TS_CONF_load_key                        2746	3_0_0	EXIST::FUNCTION:TS
-d2i_OCSP_REQINFO                        2747	3_0_0	EXIST::FUNCTION:OCSP
-d2i_X509_CINF                           2748	3_0_0	EXIST::FUNCTION:
-OCSP_REQUEST_get_ext_by_critical        2749	3_0_0	EXIST::FUNCTION:OCSP
-X509_REQ_to_X509                        2750	3_0_0	EXIST::FUNCTION:
-EVP_aes_192_wrap_pad                    2751	3_0_0	EXIST::FUNCTION:
-PKCS7_SIGN_ENVELOPE_new                 2752	3_0_0	EXIST::FUNCTION:
-TS_REQ_get_policy_id                    2753	3_0_0	EXIST::FUNCTION:TS
-RC5_32_cbc_encrypt                      2754	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC5
-BN_is_zero                              2755	3_0_0	EXIST::FUNCTION:
-CT_POLICY_EVAL_CTX_new                  2756	3_0_0	EXIST::FUNCTION:CT
-NETSCAPE_SPKI_it                        2757	3_0_0	EXIST::FUNCTION:
-CRYPTO_THREAD_unlock                    2758	3_0_0	EXIST::FUNCTION:
-UI_method_set_writer                    2759	3_0_0	EXIST::FUNCTION:
-UI_dup_info_string                      2760	3_0_0	EXIST::FUNCTION:
-OPENSSL_init                            2761	3_0_0	EXIST::FUNCTION:
-TS_RESP_get_tst_info                    2762	3_0_0	EXIST::FUNCTION:TS
-X509_VERIFY_PARAM_get_depth             2763	3_0_0	EXIST::FUNCTION:
-EVP_SealFinal                           2764	3_0_0	EXIST::FUNCTION:
-CONF_imodule_set_flags                  2766	3_0_0	EXIST::FUNCTION:
-i2d_ASN1_SET_ANY                        2767	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_decrypt                        2768	3_0_0	EXIST::FUNCTION:
-OCSP_RESPID_it                          2769	3_0_0	EXIST::FUNCTION:OCSP
-EVP_des_ede3_cbc                        2770	3_0_0	EXIST::FUNCTION:DES
-X509_up_ref                             2771	3_0_0	EXIST::FUNCTION:
-OBJ_NAME_do_all_sorted                  2772	3_0_0	EXIST::FUNCTION:
-ENGINE_unregister_DSA                   2773	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ASN1_bn_print                           2774	3_0_0	EXIST::FUNCTION:
-CMS_is_detached                         2775	3_0_0	EXIST::FUNCTION:CMS
-X509_REQ_INFO_it                        2776	3_0_0	EXIST::FUNCTION:
-RSAPrivateKey_it                        2777	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_NAME_ENTRY_free                    2778	3_0_0	EXIST::FUNCTION:
-BIO_new_fd                              2779	3_0_0	EXIST::FUNCTION:
-OPENSSL_sk_value                        2781	3_0_0	EXIST::FUNCTION:
-NCONF_get_section                       2782	3_0_0	EXIST::FUNCTION:
-PKCS12_MAC_DATA_it                      2783	3_0_0	EXIST::FUNCTION:
-X509_REQ_add1_attr_by_NID               2784	3_0_0	EXIST::FUNCTION:
-ASN1_sign                               2785	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CMS_RecipientInfo_encrypt               2786	3_0_0	EXIST::FUNCTION:CMS
-X509_get_pubkey_parameters              2787	3_0_0	EXIST::FUNCTION:
-PKCS12_setup_mac                        2788	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_PKCS7                      2789	3_0_0	EXIST::FUNCTION:
-SHA512_Final                            2790	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_VERIFY_PARAM_set1_host             2791	3_0_0	EXIST::FUNCTION:
-OCSP_resp_find_status                   2792	3_0_0	EXIST::FUNCTION:OCSP
-d2i_ASN1_T61STRING                      2793	3_0_0	EXIST::FUNCTION:
-DES_pcbc_encrypt                        2794	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-EVP_PKEY_print_params                   2795	3_0_0	EXIST::FUNCTION:
-BN_get0_nist_prime_192                  2796	3_0_0	EXIST::FUNCTION:
-EVP_SealInit                            2798	3_0_0	EXIST::FUNCTION:
-X509_REQ_get0_signature                 2799	3_0_0	EXIST::FUNCTION:
-PKEY_USAGE_PERIOD_free                  2800	3_0_0	EXIST::FUNCTION:
-EC_GROUP_set_point_conversion_form      2801	3_0_0	EXIST::FUNCTION:EC
-CMS_dataFinal                           2802	3_0_0	EXIST::FUNCTION:CMS
-ASN1_TIME_it                            2803	3_0_0	EXIST::FUNCTION:
-ENGINE_get_static_state                 2804	3_0_0	EXIST::FUNCTION:ENGINE
-EC_KEY_set_asn1_flag                    2805	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EC_GFp_mont_method                      2806	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-OPENSSL_asc2uni                         2807	3_0_0	EXIST::FUNCTION:
-TS_REQ_new                              2808	3_0_0	EXIST::FUNCTION:TS
-ENGINE_register_all_DH                  2809	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ERR_clear_error                         2810	3_0_0	EXIST::FUNCTION:
-EC_KEY_dup                              2811	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_LOOKUP_init                        2812	3_0_0	EXIST::FUNCTION:
-i2b_PVK_bio                             2813	3_0_0	EXIST::FUNCTION:
-OCSP_ONEREQ_free                        2814	3_0_0	EXIST::FUNCTION:OCSP
-X509V3_EXT_print_fp                     2815	3_0_0	EXIST::FUNCTION:STDIO
-OBJ_bsearch_ex_                         2816	3_0_0	EXIST::FUNCTION:
-DES_ofb64_encrypt                       2817	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-i2d_IPAddressOrRange                    2818	3_0_0	EXIST::FUNCTION:RFC3779
-CRYPTO_secure_used                      2819	3_0_0	EXIST::FUNCTION:
-d2i_X509_CRL_INFO                       2820	3_0_0	EXIST::FUNCTION:
-X509_CRL_get_issuer                     2821	3_0_0	EXIST::FUNCTION:
-d2i_SCT_LIST                            2822	3_0_0	EXIST::FUNCTION:CT
-EC_GFp_nist_method                      2823	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-SCT_free                                2824	3_0_0	EXIST::FUNCTION:CT
-TS_TST_INFO_get_msg_imprint             2825	3_0_0	EXIST::FUNCTION:TS
-X509v3_addr_add_range                   2826	3_0_0	EXIST::FUNCTION:RFC3779
-PKCS12_get_friendlyname                 2827	3_0_0	EXIST::FUNCTION:
-X509_CRL_add_ext                        2829	3_0_0	EXIST::FUNCTION:
-X509_REQ_get_signature_nid              2830	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_get_ext                     2831	3_0_0	EXIST::FUNCTION:TS
-i2d_OCSP_RESPID                         2832	3_0_0	EXIST::FUNCTION:OCSP
-EVP_camellia_256_cfb8                   2833	3_0_0	EXIST::FUNCTION:CAMELLIA
-EC_KEY_get0_public_key                  2834	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-SRP_Calc_x                              2835	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-a2i_ASN1_ENUMERATED                     2836	3_0_0	EXIST::FUNCTION:
-CONF_module_get_usr_data                2837	3_0_0	EXIST::FUNCTION:
-i2d_X509_NAME_ENTRY                     2838	3_0_0	EXIST::FUNCTION:
-SCT_LIST_free                           2839	3_0_0	EXIST::FUNCTION:CT
-PROXY_POLICY_new                        2840	3_0_0	EXIST::FUNCTION:
-X509_ALGOR_set_md                       2841	3_0_0	EXIST::FUNCTION:
-PKCS7_print_ctx                         2842	3_0_0	EXIST::FUNCTION:
-ASN1_UTF8STRING_new                     2843	3_0_0	EXIST::FUNCTION:
-EVP_des_cbc                             2844	3_0_0	EXIST::FUNCTION:DES
-i2v_ASN1_BIT_STRING                     2845	3_0_0	EXIST::FUNCTION:
-ASN1_TYPE_set1                          2846	3_0_0	EXIST::FUNCTION:
-d2i_X509_CRL_bio                        2847	3_0_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_get1_cert                2848	3_0_0	EXIST::FUNCTION:
-ASN1_UNIVERSALSTRING_free               2849	3_0_0	EXIST::FUNCTION:
-EC_KEY_precompute_mult                  2850	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-CRYPTO_mem_debug_realloc                2851	3_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
-PKCS7_new                               2852	3_0_0	EXIST::FUNCTION:
-BASIC_CONSTRAINTS_it                    2853	3_0_0	EXIST::FUNCTION:
-ASN1_generate_v3                        2854	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_PrivateKey                2855	3_0_0	EXIST::FUNCTION:
-ASN1_UTCTIME_check                      2856	3_0_0	EXIST::FUNCTION:
-ACCESS_DESCRIPTION_it                   2857	3_0_0	EXIST::FUNCTION:
-TS_MSG_IMPRINT_get_msg                  2859	3_0_0	EXIST::FUNCTION:TS
-PKCS8_add_keyusage                      2860	3_0_0	EXIST::FUNCTION:
-X509_EXTENSION_dup                      2861	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_new                       2862	3_0_0	EXIST::FUNCTION:
-BIO_socket_nbio                         2863	3_0_0	EXIST::FUNCTION:SOCK
-EVP_CIPHER_set_asn1_iv                  2864	3_0_0	EXIST::FUNCTION:
-EC_GFp_nistp224_method                  2865	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC_NISTP_64_GCC_128
-BN_swap                                 2866	3_0_0	EXIST::FUNCTION:
-d2i_ECParameters                        2867	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_NAME_add_entry_by_OBJ              2868	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_get_ext_count               2869	3_0_0	EXIST::FUNCTION:TS
-i2d_OCSP_CERTID                         2870	3_0_0	EXIST::FUNCTION:OCSP
-BN_CTX_start                            2871	3_0_0	EXIST::FUNCTION:
-BN_print                                2872	3_0_0	EXIST::FUNCTION:
-EC_KEY_set_flags                        2873	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_PKEY_get0                           2874	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ENGINE_set_default                      2875	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-NCONF_get_number_e                      2876	3_0_0	EXIST::FUNCTION:
-OPENSSL_cleanse                         2877	3_0_0	EXIST::FUNCTION:
-SCT_set0_signature                      2878	3_0_0	EXIST::FUNCTION:CT
-X509_CRL_sign                           2879	3_0_0	EXIST::FUNCTION:
-X509_CINF_it                            2880	3_0_0	EXIST::FUNCTION:
-TS_CONF_set_accuracy                    2881	3_0_0	EXIST::FUNCTION:TS
-DES_crypt                               2882	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-BN_BLINDING_create_param                2883	3_0_0	EXIST::FUNCTION:
-OCSP_SERVICELOC_free                    2884	3_0_0	EXIST::FUNCTION:OCSP
-DIST_POINT_NAME_free                    2885	3_0_0	EXIST::FUNCTION:
-BIO_listen                              2886	3_0_0	EXIST::FUNCTION:SOCK
-BIO_ADDR_path_string                    2887	3_0_0	EXIST::FUNCTION:SOCK
-POLICY_CONSTRAINTS_it                   2888	3_0_0	EXIST::FUNCTION:
-NCONF_free_data                         2889	3_0_0	EXIST::FUNCTION:
-BIO_asn1_set_prefix                     2890	3_0_0	EXIST::FUNCTION:
-PEM_SignUpdate                          2891	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_EC_PUBKEY                 2892	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-CMS_add_simple_smimecap                 2893	3_0_0	EXIST::FUNCTION:CMS
-IPAddressChoice_free                    2894	3_0_0	EXIST::FUNCTION:RFC3779
-d2i_X509_AUX                            2895	3_0_0	EXIST::FUNCTION:
-X509_get_default_cert_area              2896	3_0_0	EXIST::FUNCTION:
-ERR_load_DSO_strings                    2897	3_0_0	NOEXIST::FUNCTION:
-ASIdentifiers_it                        2898	3_0_0	EXIST::FUNCTION:RFC3779
-BN_mod_lshift                           2899	3_0_0	EXIST::FUNCTION:
-ENGINE_get_last                         2900	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EVP_PKEY_encrypt_init                   2901	3_0_0	EXIST::FUNCTION:
-i2d_RSAPrivateKey_fp                    2902	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
-X509_REQ_print                          2903	3_0_0	EXIST::FUNCTION:
-RSA_size                                2904	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_CIPHER_CTX_iv_noconst               2905	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-DH_set_default_method                   2906	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-X509_ALGOR_new                          2907	3_0_0	EXIST::FUNCTION:
-EVP_aes_192_ofb                         2908	3_0_0	EXIST::FUNCTION:
-EVP_des_ede3_cfb1                       2909	3_0_0	EXIST::FUNCTION:DES
-TS_REQ_to_TS_VERIFY_CTX                 2910	3_0_0	EXIST::FUNCTION:TS
-d2i_PBEPARAM                            2911	3_0_0	EXIST::FUNCTION:
-BN_get0_nist_prime_521                  2912	3_0_0	EXIST::FUNCTION:
-OCSP_ONEREQ_get_ext_by_NID              2913	3_0_0	EXIST::FUNCTION:OCSP
-X509_PUBKEY_get0                        2914	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get0_parent_ctx          2915	3_0_0	EXIST::FUNCTION:
-EC_GROUP_set_seed                       2916	3_0_0	EXIST::FUNCTION:EC
-X509_STORE_CTX_free                     2917	3_0_0	EXIST::FUNCTION:
-AUTHORITY_KEYID_it                      2918	3_0_0	EXIST::FUNCTION:
-X509V3_get_value_int                    2919	3_0_0	EXIST::FUNCTION:
-ASN1_UTCTIME_set_string                 2920	3_0_0	EXIST::FUNCTION:
-RC5_32_decrypt                          2921	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC5
-i2d_X509_REQ_INFO                       2922	3_0_0	EXIST::FUNCTION:
-EVP_des_cfb1                            2923	3_0_0	EXIST::FUNCTION:DES
-OBJ_NAME_cleanup                        2924	3_0_0	EXIST::FUNCTION:
-OCSP_BASICRESP_get1_ext_d2i             2925	3_0_0	EXIST::FUNCTION:OCSP
-DES_cfb64_encrypt                       2926	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-CAST_cfb64_encrypt                      2927	3_0_0	EXIST::FUNCTION:CAST,DEPRECATEDIN_3_0
-EVP_PKEY_asn1_set_param                 2928	3_0_0	EXIST::FUNCTION:
-BN_RECP_CTX_free                        2929	3_0_0	EXIST::FUNCTION:
-BN_with_flags                           2930	3_0_0	EXIST::FUNCTION:
-DSO_ctrl                                2931	3_0_0	EXIST::FUNCTION:
-EVP_MD_meth_get_final                   2932	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_TYPE_get_octetstring               2933	3_0_0	EXIST::FUNCTION:
-ENGINE_by_id                            2934	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-d2i_PKCS7_SIGNER_INFO                   2935	3_0_0	EXIST::FUNCTION:
-EVP_aes_192_cbc                         2936	3_0_0	EXIST::FUNCTION:
-PKCS8_pkey_set0                         2937	3_0_0	EXIST::FUNCTION:
-X509_get1_email                         2938	3_0_0	EXIST::FUNCTION:
-EC_POINT_point2oct                      2939	3_0_0	EXIST::FUNCTION:EC
-EC_GROUP_get_curve_GFp                  2940	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-ASYNC_block_pause                       2941	3_0_0	EXIST::FUNCTION:
-OCSP_SINGLERESP_get_ext                 2942	3_0_0	EXIST::FUNCTION:OCSP
-CRYPTO_strdup                           2943	3_0_0	EXIST::FUNCTION:
-i2d_X509_CRL_bio                        2945	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_set_item                  2946	3_0_0	EXIST::FUNCTION:
-CRYPTO_ccm128_encrypt                   2947	3_0_0	EXIST::FUNCTION:
-X509v3_addr_get_afi                     2948	3_0_0	EXIST::FUNCTION:RFC3779
-X509_STORE_CTX_get0_param               2949	3_0_0	EXIST::FUNCTION:
-EVP_add_alg_module                      2950	3_0_0	EXIST::FUNCTION:
-X509_check_purpose                      2951	3_0_0	EXIST::FUNCTION:
-OCSP_REQUEST_delete_ext                 2952	3_0_0	EXIST::FUNCTION:OCSP
-X509_PURPOSE_get_count                  2953	3_0_0	EXIST::FUNCTION:
-d2i_PKCS12_bio                          2954	3_0_0	EXIST::FUNCTION:
-ASN1_item_free                          2955	3_0_0	EXIST::FUNCTION:
-PKCS7_content_new                       2956	3_0_0	EXIST::FUNCTION:
-X509_keyid_get0                         2957	3_0_0	EXIST::FUNCTION:
-COMP_get_name                           2958	3_0_0	EXIST::FUNCTION:COMP
-EC_GROUP_new_curve_GF2m                 2959	3_0_0	EXIST::FUNCTION:EC,EC2M
-X509_SIG_free                           2960	3_0_0	EXIST::FUNCTION:
-PEM_ASN1_write                          2961	3_0_0	EXIST::FUNCTION:STDIO
-ENGINE_get_digest_engine                2962	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-BN_CTX_new                              2963	3_0_0	EXIST::FUNCTION:
-EC_curve_nid2nist                       2964	3_0_0	EXIST::FUNCTION:EC
-ENGINE_get_finish_function              2965	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EC_POINT_add                            2966	3_0_0	EXIST::FUNCTION:EC
-EC_KEY_oct2key                          2967	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-SHA384_Init                             2968	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_UNIVERSALSTRING_new                2969	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_print_private                  2970	3_0_0	EXIST::FUNCTION:
-ASN1_INTEGER_new                        2971	3_0_0	EXIST::FUNCTION:
-NAME_CONSTRAINTS_it                     2972	3_0_0	EXIST::FUNCTION:
-TS_REQ_get_cert_req                     2973	3_0_0	EXIST::FUNCTION:TS
-BIO_pop                                 2974	3_0_0	EXIST::FUNCTION:
-SHA256_Final                            2975	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_set1_DH                        2976	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_get_ex_data                          2977	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-CRYPTO_secure_malloc                    2978	3_0_0	EXIST::FUNCTION:
-TS_RESP_get_status_info                 2979	3_0_0	EXIST::FUNCTION:TS
-HMAC_CTX_new                            2980	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ENGINE_get_default_DH                   2981	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ECDSA_do_verify                         2982	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-DSO_flags                               2983	3_0_0	EXIST::FUNCTION:
-RAND_add                                2984	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_do_all_sorted                2985	3_0_0	EXIST::FUNCTION:
-PKCS7_encrypt                           2986	3_0_0	EXIST::FUNCTION:
-i2d_DSA_SIG                             2987	3_0_0	EXIST::FUNCTION:DSA
-CMS_set_detached                        2988	3_0_0	EXIST::FUNCTION:CMS
-X509_REQ_get_attr_by_OBJ                2989	3_0_0	EXIST::FUNCTION:
-i2d_ASRange                             2990	3_0_0	EXIST::FUNCTION:RFC3779
-EC_GROUP_set_asn1_flag                  2991	3_0_0	EXIST::FUNCTION:EC
-EVP_PKEY_new                            2992	3_0_0	EXIST::FUNCTION:
-i2d_POLICYINFO                          2993	3_0_0	EXIST::FUNCTION:
-BN_get_flags                            2994	3_0_0	EXIST::FUNCTION:
-SHA384                                  2995	3_0_0	EXIST::FUNCTION:
-NCONF_get_string                        2996	3_0_0	EXIST::FUNCTION:
-d2i_PROXY_CERT_INFO_EXTENSION           2997	3_0_0	EXIST::FUNCTION:
-EC_POINT_point2buf                      2998	3_0_0	EXIST::FUNCTION:EC
-RSA_padding_add_PKCS1_OAEP_mgf1         2999	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-COMP_CTX_get_type                       3000	3_0_0	EXIST::FUNCTION:COMP
-TS_RESP_CTX_set_status_info             3001	3_0_0	EXIST::FUNCTION:TS
-BIO_f_nbio_test                         3002	3_0_0	EXIST::FUNCTION:
-SEED_ofb128_encrypt                     3003	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SEED
-d2i_RSAPrivateKey_bio                   3004	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-DH_KDF_X9_42                            3005	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-EVP_PKEY_meth_set_signctx               3006	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_CRL_get_version                    3007	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_get0_info                 3008	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-PEM_read_bio_RSAPublicKey               3009	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_asn1_set_private               3010	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get0_RSA                       3011	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-DES_ede3_cfb64_encrypt                  3012	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-POLICY_MAPPING_free                     3014	3_0_0	EXIST::FUNCTION:
-EVP_aes_128_gcm                         3015	3_0_0	EXIST::FUNCTION:
-BIO_dgram_non_fatal_error               3016	3_0_0	EXIST::FUNCTION:DGRAM
-OCSP_request_is_signed                  3017	3_0_0	EXIST::FUNCTION:OCSP
-i2d_BASIC_CONSTRAINTS                   3018	3_0_0	EXIST::FUNCTION:
-EC_KEY_get_method                       3019	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EC_POINT_bn2point                       3021	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-PBE2PARAM_it                            3022	3_0_0	EXIST::FUNCTION:
-BN_rand                                 3023	3_0_0	EXIST::FUNCTION:
-ASN1_TYPE_unpack_sequence               3024	3_0_0	EXIST::FUNCTION:
-X509_CRL_sign_ctx                       3025	3_0_0	EXIST::FUNCTION:
-X509_STORE_add_crl                      3026	3_0_0	EXIST::FUNCTION:
-PEM_write_RSAPrivateKey                 3027	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
-RC4_set_key                             3028	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC4
-EVP_CIPHER_CTX_cipher                   3029	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-PEM_write_bio_PKCS8PrivateKey_nid       3030	3_0_0	EXIST::FUNCTION:
-BN_MONT_CTX_new                         3031	3_0_0	EXIST::FUNCTION:
-CRYPTO_free_ex_index                    3032	3_0_0	EXIST::FUNCTION:
-ASYNC_WAIT_CTX_new                      3033	3_0_0	EXIST::FUNCTION:
-PKCS7_it                                3034	3_0_0	EXIST::FUNCTION:
-CMS_unsigned_get_attr_by_OBJ            3035	3_0_0	EXIST::FUNCTION:CMS
-BN_clear                                3036	3_0_0	EXIST::FUNCTION:
-BIO_socket_ioctl                        3037	3_0_0	EXIST::FUNCTION:SOCK
-GENERAL_NAME_cmp                        3038	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_set_purpose              3039	3_0_0	EXIST::FUNCTION:
-X509_REVOKED_get_ext_d2i                3040	3_0_0	EXIST::FUNCTION:
-X509V3_set_conf_lhash                   3041	3_0_0	EXIST::FUNCTION:
-PKCS7_ENC_CONTENT_it                    3042	3_0_0	EXIST::FUNCTION:
-PKCS12_item_pack_safebag                3043	3_0_0	EXIST::FUNCTION:
-i2d_OCSP_RESPDATA                       3044	3_0_0	EXIST::FUNCTION:OCSP
-i2d_X509_PUBKEY                         3045	3_0_0	EXIST::FUNCTION:
-EVP_DecryptUpdate                       3046	3_0_0	EXIST::FUNCTION:
-CAST_cbc_encrypt                        3047	3_0_0	EXIST::FUNCTION:CAST,DEPRECATEDIN_3_0
-BN_BLINDING_invert                      3048	3_0_0	EXIST::FUNCTION:
-SHA512_Update                           3049	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ESS_ISSUER_SERIAL_new                   3050	3_0_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_get0_pkcs8               3051	3_0_0	EXIST::FUNCTION:
-X509_get_ext_by_NID                     3052	3_0_0	EXIST::FUNCTION:
-d2i_IPAddressFamily                     3053	3_0_0	EXIST::FUNCTION:RFC3779
-X509_check_private_key                  3054	3_0_0	EXIST::FUNCTION:
-GENERAL_NAME_get0_value                 3055	3_0_0	EXIST::FUNCTION:
-X509_check_akid                         3056	3_0_0	EXIST::FUNCTION:
-PKCS12_key_gen_asc                      3057	3_0_0	EXIST::FUNCTION:
-EVP_bf_ofb                              3058	3_0_0	EXIST::FUNCTION:BF
-AUTHORITY_KEYID_free                    3059	3_0_0	EXIST::FUNCTION:
-EVP_seed_ofb                            3060	3_0_0	EXIST::FUNCTION:SEED
-OBJ_NAME_get                            3061	3_0_0	EXIST::FUNCTION:
-ASN1_UTCTIME_set                        3062	3_0_0	EXIST::FUNCTION:
-X509_NAME_ENTRY_set_data                3063	3_0_0	EXIST::FUNCTION:
-ASN1_PCTX_set_str_flags                 3064	3_0_0	EXIST::FUNCTION:
-i2a_ASN1_INTEGER                        3065	3_0_0	EXIST::FUNCTION:
-d2i_TS_RESP                             3066	3_0_0	EXIST::FUNCTION:TS
-EVP_des_ede_cfb64                       3067	3_0_0	EXIST::FUNCTION:DES
-d2i_RSAPrivateKey                       3068	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ERR_load_BN_strings                     3069	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BF_encrypt                              3070	3_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
-MD5                                     3071	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
-BN_GF2m_arr2poly                        3072	3_0_0	EXIST::FUNCTION:EC2M
-EVP_PKEY_meth_get_ctrl                  3073	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-i2d_X509_REQ_bio                        3074	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_set1_name             3075	3_0_0	EXIST::FUNCTION:
-d2i_RSAPublicKey_bio                    3076	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_REQ_get_X509_PUBKEY                3077	3_0_0	EXIST::FUNCTION:
-ENGINE_load_private_key                 3078	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-GENERAL_NAMES_new                       3079	3_0_0	EXIST::FUNCTION:
-i2d_POLICYQUALINFO                      3080	3_0_0	EXIST::FUNCTION:
-EC_GF2m_simple_method                   3081	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC2M
-RSA_get_method                          3082	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-d2i_ASRange                             3083	3_0_0	EXIST::FUNCTION:RFC3779
-CMS_ContentInfo_new                     3084	3_0_0	EXIST::FUNCTION:CMS
-OPENSSL_init_crypto                     3085	3_0_0	EXIST::FUNCTION:
-X509_TRUST_set                          3086	3_0_0	EXIST::FUNCTION:
-EVP_camellia_192_ecb                    3087	3_0_0	EXIST::FUNCTION:CAMELLIA
-d2i_X509_REVOKED                        3088	3_0_0	EXIST::FUNCTION:
-d2i_IPAddressOrRange                    3089	3_0_0	EXIST::FUNCTION:RFC3779
-TS_TST_INFO_set_version                 3090	3_0_0	EXIST::FUNCTION:TS
-PKCS12_get0_mac                         3091	3_0_0	EXIST::FUNCTION:
-EVP_EncodeInit                          3092	3_0_0	EXIST::FUNCTION:
-X509_get0_trust_objects                 3093	3_0_0	EXIST::FUNCTION:
-d2i_ECPrivateKey_bio                    3094	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-BIO_s_secmem                            3095	3_0_0	EXIST::FUNCTION:
-ENGINE_get_default_EC                   3096	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-TS_RESP_create_response                 3097	3_0_0	EXIST::FUNCTION:TS
-BIO_ADDR_rawaddress                     3098	3_0_0	EXIST::FUNCTION:SOCK
-PKCS7_ENCRYPT_new                       3099	3_0_0	EXIST::FUNCTION:
-i2d_PKCS8PrivateKey_fp                  3100	3_0_0	EXIST::FUNCTION:STDIO
-SRP_user_pwd_free                       3101	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-Camellia_encrypt                        3102	3_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
-BIO_ADDR_hostname_string                3103	3_0_0	EXIST::FUNCTION:SOCK
-USERNOTICE_new                          3104	3_0_0	EXIST::FUNCTION:
-POLICY_MAPPING_new                      3105	3_0_0	EXIST::FUNCTION:
-CRYPTO_gcm128_release                   3106	3_0_0	EXIST::FUNCTION:
-BIO_new                                 3107	3_0_0	EXIST::FUNCTION:
-d2i_GENERAL_NAMES                       3108	3_0_0	EXIST::FUNCTION:
-PKCS7_SIGNER_INFO_new                   3109	3_0_0	EXIST::FUNCTION:
-PEM_read_DSA_PUBKEY                     3110	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
-X509_get0_subject_key_id                3111	3_0_0	EXIST::FUNCTION:
-i2s_ASN1_ENUMERATED                     3112	3_0_0	EXIST::FUNCTION:
-X509v3_get_ext_by_OBJ                   3113	3_0_0	EXIST::FUNCTION:
-OCSP_REQUEST_free                       3114	3_0_0	EXIST::FUNCTION:OCSP
-CRYPTO_ocb128_aad                       3115	3_0_0	EXIST::FUNCTION:OCB
-OPENSSL_sk_deep_copy                    3116	3_0_0	EXIST::FUNCTION:
-i2d_RSA_PSS_PARAMS                      3117	3_0_0	EXIST::FUNCTION:
-EVP_aes_128_wrap_pad                    3118	3_0_0	EXIST::FUNCTION:
-ASN1_BIT_STRING_set                     3119	3_0_0	EXIST::FUNCTION:
-PKCS5_PBKDF2_HMAC_SHA1                  3120	3_0_0	EXIST::FUNCTION:
-RSA_padding_check_PKCS1_type_2          3121	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_des_ede3_ecb                        3122	3_0_0	EXIST::FUNCTION:DES
-CBIGNUM_it                              3123	3_0_0	EXIST::FUNCTION:
-BIO_new_NDEF                            3124	3_0_0	EXIST::FUNCTION:
-EVP_aes_256_wrap                        3125	3_0_0	EXIST::FUNCTION:
-ASN1_STRING_print                       3126	3_0_0	EXIST::FUNCTION:
-CRYPTO_THREAD_lock_free                 3127	3_0_0	EXIST::FUNCTION:
-TS_ACCURACY_get_seconds                 3128	3_0_0	EXIST::FUNCTION:TS
-BN_options                              3129	3_0_0	EXIST::FUNCTION:
-BIO_debug_callback                      3130	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_MD_meth_get_update                  3131	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-GENERAL_NAME_set0_othername             3132	3_0_0	EXIST::FUNCTION:
-ASN1_BIT_STRING_set_bit                 3133	3_0_0	EXIST::FUNCTION:
-EVP_aes_256_ccm                         3134	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get0_pkey                  3135	3_0_0	EXIST::FUNCTION:
-CONF_load_fp                            3136	3_0_0	EXIST::FUNCTION:STDIO
-BN_to_ASN1_ENUMERATED                   3137	3_0_0	EXIST::FUNCTION:
-i2d_ISSUING_DIST_POINT                  3138	3_0_0	EXIST::FUNCTION:
-TXT_DB_free                             3139	3_0_0	EXIST::FUNCTION:
-ASN1_STRING_set                         3140	3_0_0	EXIST::FUNCTION:
-d2i_ESS_CERT_ID                         3141	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_set_derive                3142	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OPENSSL_LH_stats                        3143	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_1,STDIO
-NCONF_dump_fp                           3144	3_0_0	EXIST::FUNCTION:STDIO
-TS_STATUS_INFO_print_bio                3145	3_0_0	EXIST::FUNCTION:TS
-OPENSSL_sk_dup                          3146	3_0_0	EXIST::FUNCTION:
-BF_cfb64_encrypt                        3147	3_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
-ASN1_GENERALIZEDTIME_adj                3148	3_0_0	EXIST::FUNCTION:
-ECDSA_verify                            3149	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_camellia_256_cfb128                 3150	3_0_0	EXIST::FUNCTION:CAMELLIA
-CMAC_Init                               3151	3_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
-OCSP_basic_add1_status                  3152	3_0_0	EXIST::FUNCTION:OCSP
-X509_CRL_get0_by_cert                   3153	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_set_tsa                     3154	3_0_0	EXIST::FUNCTION:TS
-i2d_ASN1_GENERALIZEDTIME                3155	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_derive_set_peer                3156	3_0_0	EXIST::FUNCTION:
-X509V3_EXT_CRL_add_conf                 3157	3_0_0	EXIST::FUNCTION:
-CRYPTO_ccm128_init                      3158	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_set_time              3159	3_0_0	EXIST::FUNCTION:
-BN_reciprocal                           3160	3_0_0	EXIST::FUNCTION:
-d2i_PKCS7_SIGN_ENVELOPE                 3161	3_0_0	EXIST::FUNCTION:
-X509_NAME_digest                        3162	3_0_0	EXIST::FUNCTION:
-d2i_OCSP_SERVICELOC                     3163	3_0_0	EXIST::FUNCTION:OCSP
-GENERAL_NAME_print                      3164	3_0_0	EXIST::FUNCTION:
-CMS_ReceiptRequest_get0_values          3165	3_0_0	EXIST::FUNCTION:CMS
-a2i_ASN1_INTEGER                        3166	3_0_0	EXIST::FUNCTION:
-OCSP_sendreq_bio                        3167	3_0_0	EXIST::FUNCTION:OCSP
-PKCS12_SAFEBAG_create_crl               3168	3_0_0	EXIST::FUNCTION:
-d2i_X509_NAME                           3169	3_0_0	EXIST::FUNCTION:
-IDEA_cfb64_encrypt                      3170	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
-BN_mod_sub                              3171	3_0_0	EXIST::FUNCTION:
-ASN1_NULL_new                           3172	3_0_0	EXIST::FUNCTION:
-HMAC_Init                               3173	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
-EVP_MD_CTX_update_fn                    3174	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_aes_128_ecb                         3175	3_0_0	EXIST::FUNCTION:
-i2d_PKCS7_bio_stream                    3176	3_0_0	EXIST::FUNCTION:
-i2a_ACCESS_DESCRIPTION                  3178	3_0_0	EXIST::FUNCTION:
-EC_KEY_set_enc_flags                    3179	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-i2d_PUBKEY_fp                           3180	3_0_0	EXIST::FUNCTION:STDIO
-b2i_PrivateKey_bio                      3181	3_0_0	EXIST::FUNCTION:
-OCSP_REQUEST_add_ext                    3182	3_0_0	EXIST::FUNCTION:OCSP
-SXNET_add_id_INTEGER                    3183	3_0_0	EXIST::FUNCTION:
-CTLOG_get0_public_key                   3184	3_0_0	EXIST::FUNCTION:CT
-OCSP_REQUEST_get_ext_by_OBJ             3185	3_0_0	EXIST::FUNCTION:OCSP
-X509_NAME_oneline                       3186	3_0_0	EXIST::FUNCTION:
-X509V3_set_nconf                        3187	3_0_0	EXIST::FUNCTION:
-RSAPrivateKey_dup                       3188	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BN_mod_add                              3189	3_0_0	EXIST::FUNCTION:
-EC_POINT_set_affine_coordinates_GFp     3190	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-X509_get_default_cert_file              3191	3_0_0	EXIST::FUNCTION:
-UI_method_set_flusher                   3192	3_0_0	EXIST::FUNCTION:
-RSA_new_method                          3193	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OCSP_request_verify                     3194	3_0_0	EXIST::FUNCTION:OCSP
-CRYPTO_THREAD_run_once                  3195	3_0_0	EXIST::FUNCTION:
-TS_REQ_print_bio                        3196	3_0_0	EXIST::FUNCTION:TS
-SCT_get_version                         3197	3_0_0	EXIST::FUNCTION:CT
-IDEA_set_encrypt_key                    3198	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
-ENGINE_get_DH                           3199	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-i2d_ASIdentifierChoice                  3200	3_0_0	EXIST::FUNCTION:RFC3779
-SRP_Calc_A                              3201	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-OCSP_BASICRESP_add_ext                  3202	3_0_0	EXIST::FUNCTION:OCSP
-EVP_idea_cfb64                          3203	3_0_0	EXIST::FUNCTION:IDEA
-PKCS12_newpass                          3204	3_0_0	EXIST::FUNCTION:
-EVP_aes_256_cbc_hmac_sha256             3205	3_0_0	EXIST::FUNCTION:
-TS_ACCURACY_get_millis                  3206	3_0_0	EXIST::FUNCTION:TS
-X509_CRL_get_REVOKED                    3207	3_0_0	EXIST::FUNCTION:
-X509_issuer_name_hash_old               3208	3_0_0	EXIST::FUNCTION:MD5
-i2d_PKCS12_SAFEBAG                      3209	3_0_0	EXIST::FUNCTION:
-BN_rand_range                           3210	3_0_0	EXIST::FUNCTION:
-SMIME_write_ASN1                        3211	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_new                      3212	3_0_0	EXIST::FUNCTION:
-MD4_Final                               3213	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD4
-EVP_PKEY_get_id                         3214	3_0_0	EXIST::FUNCTION:
-CMS_RecipientInfo_get0_pkey_ctx         3215	3_0_0	EXIST::FUNCTION:CMS
-OCSP_REQINFO_free                       3216	3_0_0	EXIST::FUNCTION:OCSP
-AUTHORITY_KEYID_new                     3217	3_0_0	EXIST::FUNCTION:
-i2d_DIST_POINT_NAME                     3218	3_0_0	EXIST::FUNCTION:
-OpenSSL_version_num                     3219	3_0_0	EXIST::FUNCTION:
-OCSP_CERTID_free                        3220	3_0_0	EXIST::FUNCTION:OCSP
-BIO_hex_string                          3221	3_0_0	EXIST::FUNCTION:
-X509_REQ_sign_ctx                       3222	3_0_0	EXIST::FUNCTION:
-CRYPTO_ocb128_init                      3223	3_0_0	EXIST::FUNCTION:OCB
-EVP_PKEY_get1_EC_KEY                    3224	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-ASN1_PRINTABLESTRING_free               3225	3_0_0	EXIST::FUNCTION:
-BIO_get_retry_reason                    3226	3_0_0	EXIST::FUNCTION:
-X509_NAME_print                         3227	3_0_0	EXIST::FUNCTION:
-ACCESS_DESCRIPTION_free                 3228	3_0_0	EXIST::FUNCTION:
-BN_nist_mod_384                         3229	3_0_0	EXIST::FUNCTION:
-i2d_EC_PUBKEY_fp                        3230	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
-ENGINE_set_default_pkey_meths           3231	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-DH_bits                                 3232	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-i2d_X509_ALGORS                         3233	3_0_0	EXIST::FUNCTION:
-EVP_camellia_192_cfb1                   3234	3_0_0	EXIST::FUNCTION:CAMELLIA
-TS_RESP_CTX_add_failure_info            3235	3_0_0	EXIST::FUNCTION:TS
-EVP_PBE_alg_add                         3236	3_0_0	EXIST::FUNCTION:
-ESS_CERT_ID_dup                         3237	3_0_0	EXIST::FUNCTION:
-CMS_SignerInfo_get0_signature           3238	3_0_0	EXIST::FUNCTION:CMS
-EVP_PKEY_verify_recover                 3239	3_0_0	EXIST::FUNCTION:
-i2d_PUBKEY                              3240	3_0_0	EXIST::FUNCTION:
-ERR_load_EVP_strings                    3241	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_ATTRIBUTE_set1_data                3242	3_0_0	EXIST::FUNCTION:
-d2i_X509_fp                             3243	3_0_0	EXIST::FUNCTION:STDIO
-MD2_Init                                3244	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD2
-ERR_get_error_line                      3245	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_CRL_get_ext_by_NID                 3246	3_0_0	EXIST::FUNCTION:
-OPENSSL_INIT_free                       3247	3_0_0	EXIST::FUNCTION:
-PBE2PARAM_free                          3248	3_0_0	EXIST::FUNCTION:
-EVP_aes_192_ecb                         3249	3_0_0	EXIST::FUNCTION:
-ASN1_OCTET_STRING_new                   3250	3_0_0	EXIST::FUNCTION:
-CMS_set1_eContentType                   3251	3_0_0	EXIST::FUNCTION:CMS
-EVP_des_ede3_wrap                       3252	3_0_0	EXIST::FUNCTION:DES
-GENERAL_SUBTREE_it                      3253	3_0_0	EXIST::FUNCTION:
-EVP_read_pw_string_min                  3254	3_0_0	EXIST::FUNCTION:
-X509_set1_notBefore                     3255	3_0_0	EXIST::FUNCTION:
-MD4                                     3256	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD4
-EVP_PKEY_CTX_dup                        3257	3_0_0	EXIST::FUNCTION:
-ENGINE_setup_bsd_cryptodev              3258	3_0_0	EXIST:__FreeBSD__:FUNCTION:DEPRECATEDIN_1_1_0,ENGINE
-PEM_read_bio_DHparams                   3259	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-CMS_SharedInfo_encode                   3260	3_0_0	EXIST::FUNCTION:CMS
-ASN1_OBJECT_create                      3261	3_0_0	EXIST::FUNCTION:
-i2d_ECParameters                        3262	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-BN_GF2m_mod_arr                         3263	3_0_0	EXIST::FUNCTION:EC2M
-ENGINE_set_finish_function              3264	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-d2i_ASN1_OCTET_STRING                   3265	3_0_0	EXIST::FUNCTION:
-ENGINE_set_load_pubkey_function         3266	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-BIO_vprintf                             3267	3_0_0	EXIST::FUNCTION:
-CMS_RecipientInfo_decrypt               3268	3_0_0	EXIST::FUNCTION:CMS
-RSA_generate_key                        3269	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8
-PKCS7_set0_type_other                   3270	3_0_0	EXIST::FUNCTION:
-OCSP_REQUEST_new                        3271	3_0_0	EXIST::FUNCTION:OCSP
-BIO_lookup                              3272	3_0_0	EXIST::FUNCTION:SOCK
-EC_GROUP_get0_cofactor                  3273	3_0_0	EXIST::FUNCTION:EC
-SCT_print                               3275	3_0_0	EXIST::FUNCTION:CT
-X509_PUBKEY_set                         3276	3_0_0	EXIST::FUNCTION:
-POLICY_CONSTRAINTS_free                 3277	3_0_0	EXIST::FUNCTION:
-EVP_aes_256_cfb8                        3278	3_0_0	EXIST::FUNCTION:
-d2i_DSA_PUBKEY_bio                      3279	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-X509_NAME_get_text_by_OBJ               3280	3_0_0	EXIST::FUNCTION:
-RSA_padding_check_none                  3281	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CRYPTO_set_mem_debug                    3282	3_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
-TS_VERIFY_CTX_init                      3283	3_0_0	EXIST::FUNCTION:TS
-OCSP_cert_id_new                        3284	3_0_0	EXIST::FUNCTION:OCSP
-GENERAL_SUBTREE_new                     3285	3_0_0	EXIST::FUNCTION:
-OPENSSL_sk_push                         3286	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_ctrl                        3287	3_0_0	EXIST::FUNCTION:
-SRP_check_known_gN_param                3288	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-d2i_DIST_POINT                          3289	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_free                       3290	3_0_0	EXIST::FUNCTION:
-PBEPARAM_free                           3291	3_0_0	EXIST::FUNCTION:
-NETSCAPE_SPKI_set_pubkey                3292	3_0_0	EXIST::FUNCTION:
-EVP_sha512                              3293	3_0_0	EXIST::FUNCTION:
-X509_CRL_match                          3294	3_0_0	EXIST::FUNCTION:
-i2s_ASN1_IA5STRING                      3295	3_0_0	EXIST::FUNCTION:
-EC_KEY_get_default_method               3296	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-PKCS8_decrypt                           3297	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_data                   3298	3_0_0	EXIST::FUNCTION:
-POLICYQUALINFO_it                       3299	3_0_0	EXIST::FUNCTION:
-PKCS7_ISSUER_AND_SERIAL_free            3300	3_0_0	EXIST::FUNCTION:
-DSA_SIG_free                            3301	3_0_0	EXIST::FUNCTION:DSA
-BIO_asn1_set_suffix                     3302	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_set_type_str                   3303	3_0_0	EXIST::FUNCTION:
-i2d_X509_SIG                            3304	3_0_0	EXIST::FUNCTION:
-OPENSSL_LH_strhash                      3305	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_set_trust                3306	3_0_0	EXIST::FUNCTION:
-TS_ACCURACY_set_micros                  3307	3_0_0	EXIST::FUNCTION:TS
-EVP_DigestFinal_ex                      3308	3_0_0	EXIST::FUNCTION:
-X509_get0_pubkey                        3309	3_0_0	EXIST::FUNCTION:
-X509_check_ip                           3310	3_0_0	EXIST::FUNCTION:
-PKCS7_get_signed_attribute              3311	3_0_0	EXIST::FUNCTION:
-ASN1_GENERALIZEDTIME_free               3312	3_0_0	EXIST::FUNCTION:
-COMP_compress_block                     3313	3_0_0	EXIST::FUNCTION:COMP
-ASN1_STRING_dup                         3314	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_free                        3315	3_0_0	EXIST::FUNCTION:
-EC_GROUP_cmp                            3316	3_0_0	EXIST::FUNCTION:EC
-TS_TST_INFO_get_ext_by_critical         3317	3_0_0	EXIST::FUNCTION:TS
-ECParameters_print_fp                   3318	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
-X509_REQ_sign                           3319	3_0_0	EXIST::FUNCTION:
-CRYPTO_xts128_encrypt                   3320	3_0_0	EXIST::FUNCTION:
-PEM_def_callback                        3321	3_0_0	EXIST::FUNCTION:
-PKCS12_add_friendlyname_uni             3322	3_0_0	EXIST::FUNCTION:
-X509_policy_tree_level_count            3323	3_0_0	EXIST::FUNCTION:
-OBJ_sn2nid                              3324	3_0_0	EXIST::FUNCTION:
-CTLOG_free                              3325	3_0_0	EXIST::FUNCTION:CT
-EVP_CIPHER_meth_dup                     3326	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CMS_get1_crls                           3327	3_0_0	EXIST::FUNCTION:CMS
-X509_aux_print                          3328	3_0_0	EXIST::FUNCTION:
-OPENSSL_thread_stop                     3330	3_0_0	EXIST::FUNCTION:
-X509_policy_node_get0_parent            3331	3_0_0	EXIST::FUNCTION:
-X509_PKEY_free                          3332	3_0_0	EXIST::FUNCTION:
-OCSP_CRLID_new                          3333	3_0_0	EXIST::FUNCTION:OCSP
-CONF_dump_bio                           3334	3_0_0	EXIST::FUNCTION:
-d2i_PKCS8PrivateKey_fp                  3335	3_0_0	EXIST::FUNCTION:STDIO
-RSA_setup_blinding                      3336	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ERR_peek_error_line                     3337	3_0_0	EXIST::FUNCTION:
-d2i_PKCS7                               3338	3_0_0	EXIST::FUNCTION:
-ERR_reason_error_string                 3339	3_0_0	EXIST::FUNCTION:
-ERR_remove_thread_state                 3340	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
-PEM_write_PrivateKey                    3341	3_0_0	EXIST::FUNCTION:STDIO
-EVP_PKEY_CTX_str2ctrl                   3342	3_0_0	EXIST::FUNCTION:
-CMS_SignerInfo_verify_content           3343	3_0_0	EXIST::FUNCTION:CMS
-ASN1_INTEGER_get_int64                  3344	3_0_0	EXIST::FUNCTION:
-ASN1_item_sign                          3345	3_0_0	EXIST::FUNCTION:
-OCSP_SERVICELOC_new                     3346	3_0_0	EXIST::FUNCTION:OCSP
-ASN1_VISIBLESTRING_new                  3347	3_0_0	EXIST::FUNCTION:
-BN_set_flags                            3348	3_0_0	EXIST::FUNCTION:
-d2i_PrivateKey_bio                      3349	3_0_0	EXIST::FUNCTION:
-ASN1_SEQUENCE_ANY_it                    3350	3_0_0	EXIST::FUNCTION:
-ASN1_UTCTIME_adj                        3351	3_0_0	EXIST::FUNCTION:
-BN_mod_sqrt                             3352	3_0_0	EXIST::FUNCTION:
-OPENSSL_sk_is_sorted                    3353	3_0_0	EXIST::FUNCTION:
-OCSP_SIGNATURE_new                      3354	3_0_0	EXIST::FUNCTION:OCSP
-EVP_PKEY_meth_get_paramgen              3355	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_ATTRIBUTE_create_by_OBJ            3356	3_0_0	EXIST::FUNCTION:
-RSA_generate_key_ex                     3357	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CMS_SignerInfo_get0_algs                3358	3_0_0	EXIST::FUNCTION:CMS
-DIST_POINT_free                         3359	3_0_0	EXIST::FUNCTION:
-ESS_SIGNING_CERT_free                   3360	3_0_0	EXIST::FUNCTION:
-SCT_new_from_base64                     3361	3_0_0	EXIST::FUNCTION:CT
-OpenSSL_version                         3362	3_0_0	EXIST::FUNCTION:
-OCSP_SINGLERESP_get_ext_by_OBJ          3363	3_0_0	EXIST::FUNCTION:OCSP
-ECDSA_SIG_get0                          3364	3_0_0	EXIST::FUNCTION:EC
-BN_set_word                             3365	3_0_0	EXIST::FUNCTION:
-ENGINE_set_flags                        3366	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-DSA_OpenSSL                             3367	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-CMS_RecipientInfo_kari_get0_alg         3368	3_0_0	EXIST::FUNCTION:CMS
-PKCS7_ENVELOPE_new                      3369	3_0_0	EXIST::FUNCTION:
-EDIPARTYNAME_new                        3370	3_0_0	EXIST::FUNCTION:
-CMS_add1_cert                           3371	3_0_0	EXIST::FUNCTION:CMS
-DSO_convert_filename                    3372	3_0_0	EXIST::FUNCTION:
-RSA_padding_check_SSLv23                3373	3_0_0	NOEXIST::FUNCTION:DEPRECATEDIN_3_0
-CRYPTO_gcm128_finish                    3374	3_0_0	EXIST::FUNCTION:
-PKCS12_SAFEBAGS_it                      3375	3_0_0	EXIST::FUNCTION:
-PKCS12_PBE_add                          3376	3_0_0	EXIST::FUNCTION:
-EC_KEY_set_public_key_affine_coordinates 3377	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_EncryptInit_ex                      3378	3_0_0	EXIST::FUNCTION:
-ENGINE_add                              3379	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-OPENSSL_LH_error                        3380	3_0_0	EXIST::FUNCTION:
-PKCS7_DIGEST_it                         3381	3_0_0	EXIST::FUNCTION:
-X509_CINF_new                           3382	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_keygen_init                    3383	3_0_0	EXIST::FUNCTION:
-EVP_aes_192_ocb                         3384	3_0_0	EXIST::FUNCTION:OCB
-EVP_camellia_256_cfb1                   3385	3_0_0	EXIST::FUNCTION:CAMELLIA
-CRYPTO_secure_actual_size               3387	3_0_0	EXIST::FUNCTION:
-COMP_CTX_free                           3388	3_0_0	EXIST::FUNCTION:COMP
-i2d_PBE2PARAM                           3389	3_0_0	EXIST::FUNCTION:
-EC_POINT_make_affine                    3390	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-DSA_generate_parameters                 3391	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8,DSA
-ASN1_BIT_STRING_num_asc                 3392	3_0_0	EXIST::FUNCTION:
-X509_INFO_free                          3394	3_0_0	EXIST::FUNCTION:
-d2i_PKCS8_PRIV_KEY_INFO_fp              3395	3_0_0	EXIST::FUNCTION:STDIO
-X509_OBJECT_retrieve_match              3396	3_0_0	EXIST::FUNCTION:
-EVP_aes_128_ctr                         3397	3_0_0	EXIST::FUNCTION:
-EVP_PBE_find                            3398	3_0_0	EXIST::FUNCTION:
-SHA512_Transform                        3399	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ERR_add_error_vdata                     3400	3_0_0	EXIST::FUNCTION:
-OCSP_REQUEST_get_ext                    3401	3_0_0	EXIST::FUNCTION:OCSP
-NETSCAPE_SPKAC_new                      3402	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_get_verify                3403	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CRYPTO_128_wrap                         3404	3_0_0	EXIST::FUNCTION:
-X509_STORE_set_lookup_crls              3405	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_meth_get_ctrl                3406	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CONF_imodule_get_usr_data               3408	3_0_0	EXIST::FUNCTION:
-CRYPTO_new_ex_data                      3409	3_0_0	EXIST::FUNCTION:
-PEM_read_PKCS8_PRIV_KEY_INFO            3410	3_0_0	EXIST::FUNCTION:STDIO
-TS_VERIFY_CTX_new                       3411	3_0_0	EXIST::FUNCTION:TS
-BUF_MEM_new_ex                          3412	3_0_0	EXIST::FUNCTION:
-RSA_padding_add_X931                    3413	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BN_get0_nist_prime_256                  3414	3_0_0	EXIST::FUNCTION:
-CRYPTO_memcmp                           3415	3_0_0	EXIST::FUNCTION:
-DH_check_pub_key                        3416	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-ASN1_mbstring_copy                      3417	3_0_0	EXIST::FUNCTION:
-PKCS7_set_type                          3418	3_0_0	EXIST::FUNCTION:
-BIO_gets                                3419	3_0_0	EXIST::FUNCTION:
-RSA_padding_check_PKCS1_type_1          3420	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-UI_ctrl                                 3421	3_0_0	EXIST::FUNCTION:
-i2d_X509_REQ_fp                         3422	3_0_0	EXIST::FUNCTION:STDIO
-BN_BLINDING_convert_ex                  3423	3_0_0	EXIST::FUNCTION:
-ASN1_GENERALIZEDTIME_print              3424	3_0_0	EXIST::FUNCTION:
-BIO_s_null                              3425	3_0_0	EXIST::FUNCTION:
-PEM_ASN1_read                           3426	3_0_0	EXIST::FUNCTION:STDIO
-SCT_get_log_entry_type                  3427	3_0_0	EXIST::FUNCTION:CT
-EVP_CIPHER_meth_get_init                3428	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_ALGOR_free                         3429	3_0_0	EXIST::FUNCTION:
-OCSP_SINGLERESP_get_ext_count           3430	3_0_0	EXIST::FUNCTION:OCSP
-EC_POINT_free                           3431	3_0_0	EXIST::FUNCTION:EC
-EVP_OpenFinal                           3432	3_0_0	EXIST::FUNCTION:
-RAND_egd_bytes                          3433	3_0_0	EXIST::FUNCTION:EGD
-UI_method_get_writer                    3434	3_0_0	EXIST::FUNCTION:
-BN_secure_new                           3435	3_0_0	EXIST::FUNCTION:
-SHA1_Update                             3437	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BIO_s_connect                           3438	3_0_0	EXIST::FUNCTION:SOCK
-EVP_MD_meth_get_init                    3439	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_BIT_STRING_free                    3440	3_0_0	EXIST::FUNCTION:
-i2d_PROXY_CERT_INFO_EXTENSION           3441	3_0_0	EXIST::FUNCTION:
-ASN1_IA5STRING_new                      3442	3_0_0	EXIST::FUNCTION:
-X509_CRL_up_ref                         3443	3_0_0	EXIST::FUNCTION:
-EVP_EncodeFinal                         3444	3_0_0	EXIST::FUNCTION:
-X509_set_ex_data                        3445	3_0_0	EXIST::FUNCTION:
-ERR_get_next_error_library              3446	3_0_0	EXIST::FUNCTION:
-OCSP_RESPONSE_print                     3447	3_0_0	EXIST::FUNCTION:OCSP
-BN_get_rfc3526_prime_2048               3448	3_0_0	EXIST::FUNCTION:
-BIO_new_bio_pair                        3449	3_0_0	EXIST::FUNCTION:
-EC_GFp_nistp256_method                  3450	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC_NISTP_64_GCC_128
-BIO_method_type                         3451	3_0_0	EXIST::FUNCTION:
-ECPKParameters_print                    3452	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_rc4                                 3453	3_0_0	EXIST::FUNCTION:RC4
-CMS_data_create                         3454	3_0_0	EXIST::FUNCTION:CMS
-EC_POINT_point2bn                       3455	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-CMS_unsigned_get0_data_by_OBJ           3456	3_0_0	EXIST::FUNCTION:CMS
-ASN1_OCTET_STRING_cmp                   3457	3_0_0	EXIST::FUNCTION:
-X509_NAME_print_ex                      3458	3_0_0	EXIST::FUNCTION:
-ASN1_parse                              3459	3_0_0	EXIST::FUNCTION:
-EC_KEY_priv2oct                         3460	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-PKCS7_simple_smimecap                   3461	3_0_0	EXIST::FUNCTION:
-ASN1_TYPE_set_int_octetstring           3462	3_0_0	EXIST::FUNCTION:
-BIO_number_written                      3463	3_0_0	EXIST::FUNCTION:
-TS_TST_INFO_set_msg_imprint             3464	3_0_0	EXIST::FUNCTION:TS
-CRYPTO_get_ex_data                      3465	3_0_0	EXIST::FUNCTION:
-X509_PURPOSE_get0_sname                 3466	3_0_0	EXIST::FUNCTION:
-RSA_verify_PKCS1_PSS                    3467	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-HMAC_CTX_reset                          3468	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_set_init                  3469	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_REQ_extension_nid                  3470	3_0_0	EXIST::FUNCTION:
-ENGINE_up_ref                           3471	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-BN_BLINDING_invert_ex                   3472	3_0_0	EXIST::FUNCTION:
-RIPEMD160_Init                          3473	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RMD160
-ASYNC_WAIT_CTX_get_changed_fds          3474	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_save_parameters                3475	3_0_0	EXIST::FUNCTION:
-SCT_set_source                          3476	3_0_0	EXIST::FUNCTION:CT
-DES_set_odd_parity                      3477	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-CMAC_CTX_free                           3478	3_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
-d2i_ESS_ISSUER_SERIAL                   3479	3_0_0	EXIST::FUNCTION:
-HMAC_CTX_set_flags                      3480	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-d2i_PKCS8_bio                           3481	3_0_0	EXIST::FUNCTION:
-OCSP_ONEREQ_get_ext_count               3482	3_0_0	EXIST::FUNCTION:OCSP
-PEM_read_bio_PKCS8_PRIV_KEY_INFO        3483	3_0_0	EXIST::FUNCTION:
-i2d_OCSP_BASICRESP                      3484	3_0_0	EXIST::FUNCTION:OCSP
-CMAC_Final                              3485	3_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
-X509V3_EXT_add_alias                    3486	3_0_0	EXIST::FUNCTION:
-BN_get_params                           3487	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8
-PKCS5_pbkdf2_set                        3488	3_0_0	EXIST::FUNCTION:
-d2i_PKCS8PrivateKey_bio                 3489	3_0_0	EXIST::FUNCTION:
-ASN1_ENUMERATED_new                     3490	3_0_0	EXIST::FUNCTION:
-ENGINE_register_digests                 3491	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-X509_NAME_get_text_by_NID               3492	3_0_0	EXIST::FUNCTION:
-SMIME_read_ASN1                         3493	3_0_0	EXIST::FUNCTION:
-X509_REQ_set_subject_name               3494	3_0_0	EXIST::FUNCTION:
-BN_sub_word                             3495	3_0_0	EXIST::FUNCTION:
-DSO_load                                3496	3_0_0	EXIST::FUNCTION:
-BN_mod_exp                              3497	3_0_0	EXIST::FUNCTION:
-X509_get_signature_type                 3498	3_0_0	EXIST::FUNCTION:
-BIO_ptr_ctrl                            3499	3_0_0	EXIST::FUNCTION:
-EVP_rc4_hmac_md5                        3500	3_0_0	EXIST::FUNCTION:MD5,RC4
-OPENSSL_strlcat                         3501	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_new                   3502	3_0_0	EXIST::FUNCTION:
-BIO_ADDR_rawport                        3503	3_0_0	EXIST::FUNCTION:SOCK
-BUF_MEM_grow_clean                      3504	3_0_0	EXIST::FUNCTION:
-X509_NAME_print_ex_fp                   3505	3_0_0	EXIST::FUNCTION:STDIO
-X509_check_host                         3506	3_0_0	EXIST::FUNCTION:
-PEM_read_ECPKParameters                 3507	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
-X509_ATTRIBUTE_get0_data                3508	3_0_0	EXIST::FUNCTION:
-CMS_add1_signer                         3509	3_0_0	EXIST::FUNCTION:CMS
-BN_pseudo_rand                          3510	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-d2i_DIRECTORYSTRING                     3511	3_0_0	EXIST::FUNCTION:
-d2i_ASN1_PRINTABLE                      3512	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_add1_attr_by_NID               3513	3_0_0	EXIST::FUNCTION:
-i2d_PKCS8_PRIV_KEY_INFO_bio             3514	3_0_0	EXIST::FUNCTION:
-X509_NAME_get_index_by_NID              3515	3_0_0	EXIST::FUNCTION:
-ENGINE_get_first                        3516	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-CERTIFICATEPOLICIES_it                  3517	3_0_0	EXIST::FUNCTION:
-EVP_MD_CTX_ctrl                         3518	3_0_0	EXIST::FUNCTION:
-PKCS7_final                             3519	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_size                       3520	3_0_0	EXIST::FUNCTION:
-EVP_DecryptFinal_ex                     3521	3_0_0	EXIST::FUNCTION:
-SCT_get_signature_nid                   3522	3_0_0	EXIST::FUNCTION:CT
-PROXY_CERT_INFO_EXTENSION_new           3523	3_0_0	EXIST::FUNCTION:
-EVP_bf_cbc                              3524	3_0_0	EXIST::FUNCTION:BF
-DSA_do_verify                           3525	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-EC_GROUP_get_seed_len                   3526	3_0_0	EXIST::FUNCTION:EC
-EC_POINT_set_affine_coordinates_GF2m    3527	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC2M
-TS_REQ_set_policy_id                    3528	3_0_0	EXIST::FUNCTION:TS
-BIO_callback_ctrl                       3529	3_0_0	EXIST::FUNCTION:
-v2i_GENERAL_NAME                        3530	3_0_0	EXIST::FUNCTION:
-ERR_print_errors_cb                     3531	3_0_0	EXIST::FUNCTION:
-ENGINE_set_default_string               3532	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-BIO_number_read                         3533	3_0_0	EXIST::FUNCTION:
-CRYPTO_zalloc                           3534	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_cmp_parameters                 3535	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_CTX_new_id                     3537	3_0_0	EXIST::FUNCTION:
-TLS_FEATURE_free                        3538	3_0_0	EXIST::FUNCTION:
-d2i_BASIC_CONSTRAINTS                   3539	3_0_0	EXIST::FUNCTION:
-X509_CERT_AUX_new                       3540	3_0_0	EXIST::FUNCTION:
-ENGINE_register_pkey_asn1_meths         3541	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-CRYPTO_ocb128_tag                       3542	3_0_0	EXIST::FUNCTION:OCB
-ERR_load_OBJ_strings                    3544	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BIO_ctrl_get_read_request               3545	3_0_0	EXIST::FUNCTION:
-BN_from_montgomery                      3546	3_0_0	EXIST::FUNCTION:
-DSO_new                                 3547	3_0_0	EXIST::FUNCTION:
-AES_ecb_encrypt                         3548	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BN_dec2bn                               3549	3_0_0	EXIST::FUNCTION:
-CMS_decrypt                             3550	3_0_0	EXIST::FUNCTION:CMS
-BN_mpi2bn                               3551	3_0_0	EXIST::FUNCTION:
-EVP_aes_128_cfb128                      3552	3_0_0	EXIST::FUNCTION:
-RC5_32_ecb_encrypt                      3554	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC5
-EVP_CIPHER_meth_new                     3555	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-i2d_RSA_OAEP_PARAMS                     3556	3_0_0	EXIST::FUNCTION:
-SXNET_get_id_ulong                      3557	3_0_0	EXIST::FUNCTION:
-BIO_get_callback_arg                    3558	3_0_0	EXIST::FUNCTION:
-ENGINE_register_RSA                     3559	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-i2v_GENERAL_NAMES                       3560	3_0_0	EXIST::FUNCTION:
-PKCS7_decrypt                           3562	3_0_0	EXIST::FUNCTION:
-X509_STORE_set1_param                   3563	3_0_0	EXIST::FUNCTION:
-RAND_file_name                          3564	3_0_0	EXIST::FUNCTION:
-EVP_CipherInit_ex                       3566	3_0_0	EXIST::FUNCTION:
-BIO_dgram_sctp_notification_cb          3567	3_0_0	EXIST::FUNCTION:DGRAM,SCTP
-ERR_load_RAND_strings                   3568	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_ATTRIBUTE_it                       3569	3_0_0	EXIST::FUNCTION:
-X509_ALGOR_it                           3570	3_0_0	EXIST::FUNCTION:
-OCSP_CRLID_free                         3571	3_0_0	EXIST::FUNCTION:OCSP
-CRYPTO_ccm128_aad                       3572	3_0_0	EXIST::FUNCTION:
-IPAddressFamily_new                     3573	3_0_0	EXIST::FUNCTION:RFC3779
-d2i_TS_ACCURACY                         3574	3_0_0	EXIST::FUNCTION:TS
-X509_load_crl_file                      3575	3_0_0	EXIST::FUNCTION:
-SXNET_add_id_ulong                      3576	3_0_0	EXIST::FUNCTION:
-EVP_camellia_256_cbc                    3577	3_0_0	EXIST::FUNCTION:CAMELLIA
-i2d_PROXY_POLICY                        3578	3_0_0	EXIST::FUNCTION:
-X509_subject_name_hash_old              3579	3_0_0	EXIST::FUNCTION:MD5
-PEM_read_bio_DSA_PUBKEY                 3580	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-OCSP_cert_to_id                         3581	3_0_0	EXIST::FUNCTION:OCSP
-PEM_write_DSAparams                     3582	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
-ASN1_TIME_to_generalizedtime            3583	3_0_0	EXIST::FUNCTION:
-X509_CRL_get_ext_by_critical            3584	3_0_0	EXIST::FUNCTION:
-ASN1_STRING_type                        3585	3_0_0	EXIST::FUNCTION:
-X509_REQ_add1_attr_by_txt               3586	3_0_0	EXIST::FUNCTION:
-PEM_write_RSAPublicKey                  3587	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
-EVP_MD_meth_dup                         3588	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ENGINE_unregister_ciphers               3589	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-X509_issuer_and_serial_cmp              3590	3_0_0	EXIST::FUNCTION:
-OCSP_response_create                    3591	3_0_0	EXIST::FUNCTION:OCSP
-SHA224                                  3592	3_0_0	EXIST::FUNCTION:
-MD2_options                             3593	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD2
-X509_REQ_it                             3595	3_0_0	EXIST::FUNCTION:
-RAND_bytes                              3596	3_0_0	EXIST::FUNCTION:
-PKCS7_free                              3597	3_0_0	EXIST::FUNCTION:
-X509_NAME_ENTRY_create_by_txt           3598	3_0_0	EXIST::FUNCTION:
-DES_cbc_cksum                           3599	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-UI_free                                 3600	3_0_0	EXIST::FUNCTION:
-BN_is_prime                             3601	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8
-CMS_get0_signers                        3602	3_0_0	EXIST::FUNCTION:CMS
-i2d_PrivateKey_fp                       3603	3_0_0	EXIST::FUNCTION:STDIO
-OTHERNAME_cmp                           3604	3_0_0	EXIST::FUNCTION:
-SMIME_write_PKCS7                       3605	3_0_0	EXIST::FUNCTION:
-EC_KEY_set_public_key                   3606	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-d2i_X509_EXTENSION                      3607	3_0_0	EXIST::FUNCTION:
-CMS_add1_recipient_cert                 3608	3_0_0	EXIST::FUNCTION:CMS
-CMS_RecipientInfo_kekri_get0_id         3609	3_0_0	EXIST::FUNCTION:CMS
-BN_mod_word                             3610	3_0_0	EXIST::FUNCTION:
-ASN1_PCTX_new                           3611	3_0_0	EXIST::FUNCTION:
-BN_is_prime_ex                          3612	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-PKCS5_v2_PBE_keyivgen                   3613	3_0_0	EXIST::FUNCTION:
-CRYPTO_ctr128_encrypt                   3614	3_0_0	EXIST::FUNCTION:
-CMS_unsigned_add1_attr_by_OBJ           3615	3_0_0	EXIST::FUNCTION:CMS
-PEM_write_EC_PUBKEY                     3616	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
-X509v3_asid_add_inherit                 3617	3_0_0	EXIST::FUNCTION:RFC3779
-ERR_get_error                           3618	3_0_0	EXIST::FUNCTION:
-TS_CONF_set_signer_digest               3619	3_0_0	EXIST::FUNCTION:TS
-OBJ_new_nid                             3620	3_0_0	EXIST::FUNCTION:
-CMS_ReceiptRequest_new                  3621	3_0_0	EXIST::FUNCTION:CMS
-SRP_VBASE_get1_by_user                  3622	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-UI_method_get_closer                    3623	3_0_0	EXIST::FUNCTION:
-ENGINE_get_ex_data                      3624	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-BN_print_fp                             3625	3_0_0	EXIST::FUNCTION:STDIO
-MD2_Update                              3626	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD2
-ENGINE_free                             3628	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-d2i_X509_ATTRIBUTE                      3629	3_0_0	EXIST::FUNCTION:
-TS_RESP_free                            3630	3_0_0	EXIST::FUNCTION:TS
-PKCS5_pbe_set                           3631	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_free                        3632	3_0_0	EXIST::FUNCTION:TS
-d2i_PUBKEY                              3633	3_0_0	EXIST::FUNCTION:
-ASYNC_cleanup_thread                    3634	3_0_0	EXIST::FUNCTION:
-SHA384_Update                           3635	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CRYPTO_cfb128_1_encrypt                 3636	3_0_0	EXIST::FUNCTION:
-BIO_set_cipher                          3637	3_0_0	EXIST::FUNCTION:
-PEM_read_PUBKEY                         3638	3_0_0	EXIST::FUNCTION:STDIO
-RSA_PKCS1_OpenSSL                       3639	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-AUTHORITY_INFO_ACCESS_free              3640	3_0_0	EXIST::FUNCTION:
-SCT_get0_signature                      3641	3_0_0	EXIST::FUNCTION:CT
-DISPLAYTEXT_it                          3643	3_0_0	EXIST::FUNCTION:
-OPENSSL_gmtime_adj                      3644	3_0_0	EXIST::FUNCTION:
-ASN1_INTEGER_dup                        3645	3_0_0	EXIST::FUNCTION:
-DSA_print                               3646	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-X509_REQ_set_extension_nids             3647	3_0_0	EXIST::FUNCTION:
-X509_free                               3648	3_0_0	EXIST::FUNCTION:
-ERR_load_ERR_strings                    3649	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_const_check_infinite_end           3650	3_0_0	EXIST::FUNCTION:
-RSA_null_method                         3651	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-TS_REQ_ext_free                         3652	3_0_0	EXIST::FUNCTION:TS
-EVP_PKEY_meth_get_encrypt               3653	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-Camellia_ecb_encrypt                    3654	3_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
-ENGINE_set_default_RSA                  3655	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EVP_EncodeBlock                         3656	3_0_0	EXIST::FUNCTION:
-SXNETID_free                            3657	3_0_0	EXIST::FUNCTION:
-SHA1_Init                               3658	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-CRYPTO_atomic_add                       3659	3_0_0	EXIST::FUNCTION:
-TS_CONF_load_certs                      3660	3_0_0	EXIST::FUNCTION:TS
-PEM_write_bio_DSAPrivateKey             3661	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-CMS_encrypt                             3662	3_0_0	EXIST::FUNCTION:CMS
-CRYPTO_nistcts128_decrypt               3663	3_0_0	EXIST::FUNCTION:
-ERR_load_DH_strings                     3664	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-EVP_MD_get_block_size                   3665	3_0_0	EXIST::FUNCTION:
-TS_X509_ALGOR_print_bio                 3666	3_0_0	EXIST::FUNCTION:TS
-d2i_PKCS7_ENVELOPE                      3667	3_0_0	EXIST::FUNCTION:
-ESS_CERT_ID_new                         3669	3_0_0	EXIST::FUNCTION:
-EC_POINT_invert                         3670	3_0_0	EXIST::FUNCTION:EC
-CAST_set_key                            3671	3_0_0	EXIST::FUNCTION:CAST,DEPRECATEDIN_3_0
-ENGINE_get_pkey_meth                    3672	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-BIO_ADDRINFO_free                       3673	3_0_0	EXIST::FUNCTION:SOCK
-DES_ede3_cbc_encrypt                    3674	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-X509v3_asid_canonize                    3675	3_0_0	EXIST::FUNCTION:RFC3779
-i2d_ASIdOrRange                         3676	3_0_0	EXIST::FUNCTION:RFC3779
-OCSP_url_svcloc_new                     3677	3_0_0	EXIST::FUNCTION:OCSP
-CRYPTO_mem_ctrl                         3678	3_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
-ASN1_verify                             3679	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-DSA_generate_parameters_ex              3680	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-X509_sign                               3681	3_0_0	EXIST::FUNCTION:
-SHA256_Transform                        3682	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BIO_ADDR_free                           3683	3_0_0	EXIST::FUNCTION:SOCK
-ASN1_STRING_free                        3684	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_inherit               3685	3_0_0	EXIST::FUNCTION:
-EC_GROUP_get_curve_name                 3686	3_0_0	EXIST::FUNCTION:EC
-RSA_print                               3687	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-i2d_ASN1_BMPSTRING                      3688	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_decrypt_old                    3689	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ASN1_UTCTIME_cmp_time_t                 3690	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_set1_ip               3691	3_0_0	EXIST::FUNCTION:
-OTHERNAME_free                          3692	3_0_0	EXIST::FUNCTION:
-OCSP_REVOKEDINFO_free                   3693	3_0_0	EXIST::FUNCTION:OCSP
-EVP_CIPHER_CTX_is_encrypting            3694	3_0_0	EXIST::FUNCTION:
-EC_KEY_can_sign                         3695	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-PEM_write_bio_RSAPublicKey              3696	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_CRL_set1_lastUpdate                3697	3_0_0	EXIST::FUNCTION:
-OSSL_HTTP_REQ_CTX_nbio_d2i              3698	3_0_0	EXIST::FUNCTION:HTTP
-PKCS8_encrypt                           3699	3_0_0	EXIST::FUNCTION:
-i2d_PKCS7_fp                            3700	3_0_0	EXIST::FUNCTION:STDIO
-i2d_X509_REQ                            3701	3_0_0	EXIST::FUNCTION:
-OCSP_CRLID_it                           3702	3_0_0	EXIST::FUNCTION:OCSP
-PEM_ASN1_write_bio                      3703	3_0_0	EXIST::FUNCTION:
-X509_get0_reject_objects                3704	3_0_0	EXIST::FUNCTION:
-BIO_set_tcp_ndelay                      3705	3_0_0	EXIST::FUNCTION:SOCK
-CMS_add0_CertificateChoices             3706	3_0_0	EXIST::FUNCTION:CMS
-POLICYINFO_new                          3707	3_0_0	EXIST::FUNCTION:
-X509_CRL_get0_by_serial                 3708	3_0_0	EXIST::FUNCTION:
-PKCS12_add_friendlyname_asc             3709	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get1_chain               3710	3_0_0	EXIST::FUNCTION:
-ASN1_mbstring_ncopy                     3711	3_0_0	EXIST::FUNCTION:
-PKCS7_RECIP_INFO_it                     3712	3_0_0	EXIST::FUNCTION:
-ENGINE_register_all_digests             3713	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-X509_REQ_get_version                    3714	3_0_0	EXIST::FUNCTION:
-i2d_ASN1_UTCTIME                        3715	3_0_0	EXIST::FUNCTION:
-TS_STATUS_INFO_new                      3716	3_0_0	EXIST::FUNCTION:TS
-UI_set_ex_data                          3717	3_0_0	EXIST::FUNCTION:
-ASN1_TIME_set                           3718	3_0_0	EXIST::FUNCTION:
-TS_RESP_verify_response                 3719	3_0_0	EXIST::FUNCTION:TS
-X509_REVOKED_get0_serialNumber          3720	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_free                  3721	3_0_0	EXIST::FUNCTION:
-ASN1_TYPE_new                           3722	3_0_0	EXIST::FUNCTION:
-CMAC_CTX_cleanup                        3723	3_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
-i2d_PKCS7_NDEF                          3724	3_0_0	EXIST::FUNCTION:
-OPENSSL_sk_pop_free                     3725	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get0_policy_tree         3726	3_0_0	EXIST::FUNCTION:
-DES_set_key_checked                     3727	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-EVP_PKEY_meth_free                      3728	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_sha224                              3729	3_0_0	EXIST::FUNCTION:
-ENGINE_set_id                           3730	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-d2i_ECPrivateKey                        3731	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-CMS_signed_add1_attr_by_NID             3732	3_0_0	EXIST::FUNCTION:CMS
-i2d_DSAPrivateKey_fp                    3733	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
-EVP_CIPHER_meth_get_set_asn1_params     3734	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_STORE_CTX_get_ex_data              3735	3_0_0	EXIST::FUNCTION:
-CMS_RecipientInfo_kari_set0_pkey        3736	3_0_0	EXIST::FUNCTION:CMS
-X509v3_addr_add_inherit                 3737	3_0_0	EXIST::FUNCTION:RFC3779
-SRP_Calc_u                              3738	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-i2d_PKCS8PrivateKey_bio                 3739	3_0_0	EXIST::FUNCTION:
-X509_get_extension_flags                3740	3_0_0	EXIST::FUNCTION:
-X509V3_EXT_val_prn                      3741	3_0_0	EXIST::FUNCTION:
-SCT_get_validation_status               3742	3_0_0	EXIST::FUNCTION:CT
-NETSCAPE_CERT_SEQUENCE_free             3743	3_0_0	EXIST::FUNCTION:
-EVP_PBE_scrypt                          3744	3_0_0	EXIST::FUNCTION:SCRYPT
-d2i_TS_REQ_bio                          3745	3_0_0	EXIST::FUNCTION:TS
-ENGINE_set_default_ciphers              3746	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-X509_get_signature_nid                  3747	3_0_0	EXIST::FUNCTION:
-DES_fcrypt                              3748	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-PEM_write_bio_X509_REQ                  3749	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_get_sign                  3750	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-TS_REQ_get_nonce                        3751	3_0_0	EXIST::FUNCTION:TS
-ENGINE_unregister_EC                    3752	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-X509v3_get_ext_count                    3753	3_0_0	EXIST::FUNCTION:
-UI_OpenSSL                              3754	3_0_0	EXIST::FUNCTION:UI_CONSOLE
-CRYPTO_ccm128_decrypt                   3755	3_0_0	EXIST::FUNCTION:
-d2i_OCSP_RESPDATA                       3756	3_0_0	EXIST::FUNCTION:OCSP
-BIO_set_callback                        3757	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-BN_GF2m_poly2arr                        3758	3_0_0	EXIST::FUNCTION:EC2M
-CMS_unsigned_get_attr_count             3759	3_0_0	EXIST::FUNCTION:CMS
-EVP_aes_256_gcm                         3760	3_0_0	EXIST::FUNCTION:
-RSA_padding_check_X931                  3761	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ECDH_compute_key                        3762	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-ASN1_TIME_print                         3763	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get0_peerkey               3764	3_0_0	EXIST::FUNCTION:
-BN_mod_lshift1                          3765	3_0_0	EXIST::FUNCTION:
-BIO_ADDRINFO_family                     3766	3_0_0	EXIST::FUNCTION:SOCK
-PEM_write_DHxparams                     3767	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH,STDIO
-BN_mod_exp2_mont                        3768	3_0_0	EXIST::FUNCTION:
-ASN1_PRINTABLE_free                     3769	3_0_0	EXIST::FUNCTION:
-PKCS7_ATTR_SIGN_it                      3771	3_0_0	EXIST::FUNCTION:
-EVP_MD_CTX_copy                         3772	3_0_0	EXIST::FUNCTION:
-ENGINE_set_ctrl_function                3773	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-OCSP_id_get0_info                       3774	3_0_0	EXIST::FUNCTION:OCSP
-BIO_ADDRINFO_next                       3775	3_0_0	EXIST::FUNCTION:SOCK
-OCSP_RESPBYTES_free                     3776	3_0_0	EXIST::FUNCTION:OCSP
-EC_KEY_METHOD_set_init                  3777	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_PKEY_asn1_copy                      3778	3_0_0	EXIST::FUNCTION:
-RSA_PSS_PARAMS_it                       3779	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_error_depth          3780	3_0_0	EXIST::FUNCTION:
-ASN1_GENERALIZEDTIME_set_string         3781	3_0_0	EXIST::FUNCTION:
-EC_GROUP_new_curve_GFp                  3782	3_0_0	EXIST::FUNCTION:EC
-UI_new_method                           3783	3_0_0	EXIST::FUNCTION:
-Camellia_ofb128_encrypt                 3784	3_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
-X509_new                                3785	3_0_0	EXIST::FUNCTION:
-EC_KEY_get_conv_form                    3786	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-CTLOG_STORE_get0_log_by_id              3787	3_0_0	EXIST::FUNCTION:CT
-CMS_signed_add1_attr                    3788	3_0_0	EXIST::FUNCTION:CMS
-EVP_CIPHER_meth_set_iv_length           3789	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509v3_asid_validate_path               3790	3_0_0	EXIST::FUNCTION:RFC3779
-CMS_RecipientInfo_set0_password         3791	3_0_0	EXIST::FUNCTION:CMS
-TS_CONF_load_cert                       3792	3_0_0	EXIST::FUNCTION:TS
-i2d_ECPKParameters                      3793	3_0_0	EXIST::FUNCTION:EC
-X509_TRUST_get0                         3794	3_0_0	EXIST::FUNCTION:
-CMS_get0_RecipientInfos                 3795	3_0_0	EXIST::FUNCTION:CMS
-EVP_PKEY_CTX_new                        3796	3_0_0	EXIST::FUNCTION:
-i2d_DSA_PUBKEY_bio                      3797	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-X509_REQ_get_subject_name               3798	3_0_0	EXIST::FUNCTION:
-BN_div_word                             3799	3_0_0	EXIST::FUNCTION:
-TS_CONF_set_signer_key                  3800	3_0_0	EXIST::FUNCTION:TS
-BN_GF2m_mod_sqrt                        3801	3_0_0	EXIST::FUNCTION:EC2M
-EVP_CIPHER_get_nid                      3802	3_0_0	EXIST::FUNCTION:
-OBJ_txt2obj                             3803	3_0_0	EXIST::FUNCTION:
-CMS_RecipientInfo_kari_get0_orig_id     3804	3_0_0	EXIST::FUNCTION:CMS
-EVP_bf_ecb                              3805	3_0_0	EXIST::FUNCTION:BF
-v2i_GENERAL_NAME_ex                     3806	3_0_0	EXIST::FUNCTION:
-CMS_signed_delete_attr                  3807	3_0_0	EXIST::FUNCTION:CMS
-ASN1_TYPE_pack_sequence                 3808	3_0_0	EXIST::FUNCTION:
-USERNOTICE_it                           3809	3_0_0	EXIST::FUNCTION:
-PKEY_USAGE_PERIOD_it                    3810	3_0_0	EXIST::FUNCTION:
-BN_mul_word                             3811	3_0_0	EXIST::FUNCTION:
-i2d_IPAddressRange                      3813	3_0_0	EXIST::FUNCTION:RFC3779
-CMS_unsigned_add1_attr_by_txt           3814	3_0_0	EXIST::FUNCTION:CMS
-d2i_RSA_PUBKEY                          3815	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-PKCS12_gen_mac                          3816	3_0_0	EXIST::FUNCTION:
-ERR_load_ENGINE_strings                 3817	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-ERR_load_CT_strings                     3818	3_0_0	EXIST::FUNCTION:CT,DEPRECATEDIN_3_0
-OCSP_ONEREQ_it                          3819	3_0_0	EXIST::FUNCTION:OCSP
-X509_PURPOSE_get_by_sname               3820	3_0_0	EXIST::FUNCTION:
-X509_PURPOSE_set                        3821	3_0_0	EXIST::FUNCTION:
-BN_mod_inverse                          3822	3_0_0	EXIST::FUNCTION:
-ASN1_STRING_TABLE_get                   3823	3_0_0	EXIST::FUNCTION:
-BN_bn2binpad                            3824	3_0_0	EXIST::FUNCTION:
-X509_supported_extension                3825	3_0_0	EXIST::FUNCTION:
-ECDSA_sign_setup                        3826	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_camellia_192_cfb128                 3827	3_0_0	EXIST::FUNCTION:CAMELLIA
-d2i_AUTHORITY_KEYID                     3828	3_0_0	EXIST::FUNCTION:
-RIPEMD160_Transform                     3829	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RMD160
-DES_random_key                          3830	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
-i2d_PKCS12_MAC_DATA                     3831	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get0_EC_KEY                    3832	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-ASN1_SCTX_get_item                      3833	3_0_0	EXIST::FUNCTION:
-NOTICEREF_new                           3834	3_0_0	EXIST::FUNCTION:
-BN_GF2m_mod_inv                         3835	3_0_0	EXIST::FUNCTION:EC2M
-X509_CERT_AUX_free                      3836	3_0_0	EXIST::FUNCTION:
-BN_GF2m_mod_inv_arr                     3837	3_0_0	EXIST::FUNCTION:EC2M
-X509_REQ_get1_email                     3838	3_0_0	EXIST::FUNCTION:
-EC_KEY_print                            3839	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-i2d_ASN1_INTEGER                        3840	3_0_0	EXIST::FUNCTION:
-OCSP_SINGLERESP_add1_ext_i2d            3841	3_0_0	EXIST::FUNCTION:OCSP
-PKCS7_add_signed_attribute              3842	3_0_0	EXIST::FUNCTION:
-i2d_PrivateKey_bio                      3843	3_0_0	EXIST::FUNCTION:
-RSA_padding_add_PKCS1_type_1            3844	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-i2d_re_X509_tbs                         3845	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_get_iv_length                3846	3_0_0	EXIST::FUNCTION:
-OSSL_HTTP_REQ_CTX_get0_mem_bio          3847	3_0_0	EXIST::FUNCTION:HTTP
-i2d_PKCS8PrivateKeyInfo_bio             3848	3_0_0	EXIST::FUNCTION:
-d2i_OCSP_CERTID                         3849	3_0_0	EXIST::FUNCTION:OCSP
-EVP_CIPHER_meth_set_init                3850	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RIPEMD160_Final                         3851	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RMD160
-NETSCAPE_SPKI_free                      3852	3_0_0	EXIST::FUNCTION:
-BIO_asn1_get_prefix                     3853	3_0_0	EXIST::FUNCTION:
-d2i_OCSP_ONEREQ                         3854	3_0_0	EXIST::FUNCTION:OCSP
-EVP_PKEY_asn1_set_security_bits         3855	3_0_0	EXIST::FUNCTION:
-i2d_CERTIFICATEPOLICIES                 3856	3_0_0	EXIST::FUNCTION:
-i2d_X509_CERT_AUX                       3857	3_0_0	EXIST::FUNCTION:
-i2o_ECPublicKey                         3858	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-PKCS12_SAFEBAG_create0_pkcs8            3859	3_0_0	EXIST::FUNCTION:
-OBJ_get0_data                           3860	3_0_0	EXIST::FUNCTION:
-EC_GROUP_get0_seed                      3861	3_0_0	EXIST::FUNCTION:EC
-OCSP_REQUEST_it                         3862	3_0_0	EXIST::FUNCTION:OCSP
-ASRange_it                              3863	3_0_0	EXIST::FUNCTION:RFC3779
-i2d_TS_RESP                             3864	3_0_0	EXIST::FUNCTION:TS
-TS_TST_INFO_get_ext_by_OBJ              3865	3_0_0	EXIST::FUNCTION:TS
-d2i_PKCS7_RECIP_INFO                    3866	3_0_0	EXIST::FUNCTION:
-d2i_X509_CRL                            3867	3_0_0	EXIST::FUNCTION:
-ASN1_OCTET_STRING_dup                   3868	3_0_0	EXIST::FUNCTION:
-CRYPTO_nistcts128_decrypt_block         3869	3_0_0	EXIST::FUNCTION:
-CMS_stream                              3870	3_0_0	EXIST::FUNCTION:CMS
-RSA_OAEP_PARAMS_it                      3871	3_0_0	EXIST::FUNCTION:
-BN_bn2mpi                               3872	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_cleanup                  3873	3_0_0	EXIST::FUNCTION:
-OCSP_onereq_get0_id                     3874	3_0_0	EXIST::FUNCTION:OCSP
-X509_get_default_cert_dir               3875	3_0_0	EXIST::FUNCTION:
-PROXY_POLICY_free                       3877	3_0_0	EXIST::FUNCTION:
-PEM_write_DSAPrivateKey                 3878	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
-OPENSSL_sk_delete_ptr                   3879	3_0_0	EXIST::FUNCTION:
-CMS_add0_RevocationInfoChoice           3880	3_0_0	EXIST::FUNCTION:CMS
-ASN1_PCTX_get_flags                     3881	3_0_0	EXIST::FUNCTION:
-EVP_MD_meth_set_result_size             3882	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-i2d_X509_CRL                            3883	3_0_0	EXIST::FUNCTION:
-ASN1_INTEGER_it                         3885	3_0_0	EXIST::FUNCTION:
-TS_ACCURACY_new                         3886	3_0_0	EXIST::FUNCTION:TS
-i2d_SXNETID                             3887	3_0_0	EXIST::FUNCTION:
-BN_mod_mul_montgomery                   3888	3_0_0	EXIST::FUNCTION:
-BN_nnmod                                3889	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_set_status_info_cond        3890	3_0_0	EXIST::FUNCTION:TS
-PBKDF2PARAM_new                         3891	3_0_0	EXIST::FUNCTION:
-ENGINE_set_RSA                          3892	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-i2d_X509_ATTRIBUTE                      3893	3_0_0	EXIST::FUNCTION:
-PKCS7_ctrl                              3894	3_0_0	EXIST::FUNCTION:
-OCSP_REVOKEDINFO_it                     3895	3_0_0	EXIST::FUNCTION:OCSP
-X509V3_set_ctx                          3896	3_0_0	EXIST::FUNCTION:
-ASN1_ENUMERATED_set_int64               3897	3_0_0	EXIST::FUNCTION:
-o2i_SCT                                 3898	3_0_0	EXIST::FUNCTION:CT
-CRL_DIST_POINTS_free                    3899	3_0_0	EXIST::FUNCTION:
-d2i_OCSP_SINGLERESP                     3900	3_0_0	EXIST::FUNCTION:OCSP
-EVP_CIPHER_CTX_get_num                  3901	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_verify_recover_init            3902	3_0_0	EXIST::FUNCTION:
-SHA512_Init                             3903	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-TS_MSG_IMPRINT_set_msg                  3904	3_0_0	EXIST::FUNCTION:TS
-CMS_unsigned_add1_attr                  3905	3_0_0	EXIST::FUNCTION:CMS
-OPENSSL_LH_doall                        3906	3_0_0	EXIST::FUNCTION:
-PKCS8_pkey_get0_attrs                   3907	3_0_0	EXIST::FUNCTION:
-PKCS8_pkey_add1_attr_by_NID             3908	3_0_0	EXIST::FUNCTION:
-ASYNC_is_capable                        3909	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_set_cipher_data          3910	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_get_cipher_data          3911	3_0_0	EXIST::FUNCTION:
-BIO_up_ref                              3912	3_0_0	EXIST::FUNCTION:
-X509_STORE_up_ref                       3913	3_0_0	EXIST::FUNCTION:
-DSA_SIG_get0                            3914	3_0_0	EXIST::FUNCTION:DSA
-BN_BLINDING_is_current_thread           3915	3_0_0	EXIST::FUNCTION:
-BN_BLINDING_set_current_thread          3916	3_0_0	EXIST::FUNCTION:
-BN_BLINDING_lock                        3917	3_0_0	EXIST::FUNCTION:
-BN_BLINDING_unlock                      3918	3_0_0	EXIST::FUNCTION:
-EC_GROUP_new_from_ecpkparameters        3919	3_0_0	EXIST::FUNCTION:EC
-EC_GROUP_get_ecpkparameters             3920	3_0_0	EXIST::FUNCTION:EC
-EC_GROUP_new_from_ecparameters          3921	3_0_0	EXIST::FUNCTION:EC
-ECPARAMETERS_it                         3922	3_0_0	EXIST::FUNCTION:EC
-ECPKPARAMETERS_it                       3923	3_0_0	EXIST::FUNCTION:EC
-EC_GROUP_get_ecparameters               3924	3_0_0	EXIST::FUNCTION:EC
-DHparams_it                             3925	3_0_0	EXIST::FUNCTION:DH
-EVP_blake2s256                          3926	3_0_0	EXIST::FUNCTION:BLAKE2
-EVP_blake2b512                          3927	3_0_0	EXIST::FUNCTION:BLAKE2
-X509_SIG_get0                           3928	3_0_0	EXIST::FUNCTION:
-BIO_meth_new                            3929	3_0_0	EXIST::FUNCTION:
-BIO_meth_get_puts                       3930	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
-BIO_meth_get_ctrl                       3931	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
-BIO_meth_get_gets                       3932	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
-BIO_get_data                            3933	3_0_0	EXIST::FUNCTION:
-BIO_set_init                            3934	3_0_0	EXIST::FUNCTION:
-BIO_meth_set_puts                       3935	3_0_0	EXIST::FUNCTION:
-BIO_get_shutdown                        3936	3_0_0	EXIST::FUNCTION:
-BIO_get_init                            3937	3_0_0	EXIST::FUNCTION:
-BIO_meth_set_ctrl                       3938	3_0_0	EXIST::FUNCTION:
-BIO_meth_set_read                       3939	3_0_0	EXIST::FUNCTION:
-BIO_set_shutdown                        3940	3_0_0	EXIST::FUNCTION:
-BIO_meth_set_create                     3941	3_0_0	EXIST::FUNCTION:
-BIO_meth_get_write                      3942	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
-BIO_meth_set_callback_ctrl              3943	3_0_0	EXIST::FUNCTION:
-BIO_meth_get_create                     3944	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
-BIO_set_next                            3945	3_0_0	EXIST::FUNCTION:
-BIO_set_data                            3946	3_0_0	EXIST::FUNCTION:
-BIO_meth_set_write                      3947	3_0_0	EXIST::FUNCTION:
-BIO_meth_set_destroy                    3948	3_0_0	EXIST::FUNCTION:
-BIO_meth_set_gets                       3949	3_0_0	EXIST::FUNCTION:
-BIO_meth_get_callback_ctrl              3950	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
-BIO_meth_get_destroy                    3951	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
-BIO_meth_get_read                       3952	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
-BIO_set_retry_reason                    3953	3_0_0	EXIST::FUNCTION:
-BIO_meth_free                           3954	3_0_0	EXIST::FUNCTION:
-DSA_meth_set_bn_mod_exp                 3955	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_set_init                       3956	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_free                           3957	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_set_mod_exp                    3958	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_set_sign                       3959	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_get_finish                     3960	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_set_flags                           3961	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_get0_pqg                            3962	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_get0_app_data                  3963	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_get_keygen                     3964	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_clear_flags                         3965	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_get0_name                      3966	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_get_paramgen                   3967	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_get_sign                       3968	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_set_paramgen                   3969	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_test_flags                          3970	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_set0_app_data                  3971	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_set1_name                      3972	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_get0_key                            3973	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_get_mod_exp                    3974	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_set0_pqg                            3975	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_get_flags                      3976	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_get_verify                     3977	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_set_verify                     3978	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_set_finish                     3979	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_set_keygen                     3980	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_dup                            3981	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_set0_key                            3982	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_get_init                       3983	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_set_sign_setup                 3984	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_get_bn_mod_exp                 3985	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_get_method                          3986	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_new                            3987	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_set_flags                      3988	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_meth_get_sign_setup                 3989	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_get0_engine                         3990	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-X509_VERIFY_PARAM_set_auth_level        3991	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_get_auth_level        3992	3_0_0	EXIST::FUNCTION:
-X509_REQ_get0_pubkey                    3993	3_0_0	EXIST::FUNCTION:
-RSA_set0_key                            3994	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get_flags                      3995	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set_finish                     3996	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get_priv_dec                   3997	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get_sign                       3998	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get_bn_mod_exp                 3999	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_test_flags                          4000	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_new                            4001	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get0_app_data                  4002	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_dup                            4003	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set1_name                      4004	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set0_app_data                  4005	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_set_flags                           4006	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set_sign                       4007	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_clear_flags                         4008	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get_keygen                     4009	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set_keygen                     4010	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set_pub_dec                    4011	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get_finish                     4012	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_get0_key                            4013	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_get0_engine                         4014	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set_priv_enc                   4015	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set_verify                     4016	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_get0_factors                        4017	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get0_name                      4018	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get_mod_exp                    4019	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set_flags                      4020	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get_pub_dec                    4021	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set_bn_mod_exp                 4022	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get_init                       4023	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_free                           4024	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get_pub_enc                    4025	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set_mod_exp                    4026	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_set0_factors                        4027	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set_pub_enc                    4028	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set_priv_dec                   4029	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get_verify                     4030	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set_init                       4031	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get_priv_enc                   4032	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_set0_crt_params                     4037	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_get0_crt_params                     4038	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-DH_set0_pqg                             4039	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_clear_flags                          4041	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_get0_key                             4042	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_get0_engine                          4043	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_set0_key                             4044	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_set_length                           4045	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_test_flags                           4046	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_get_length                           4047	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_get0_pqg                             4048	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_get_compute_key                 4049	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_set1_name                       4050	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_set_init                        4051	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_get_finish                      4052	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_get0_name                       4053	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_set_generate_params             4054	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_set_compute_key                 4055	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_set_flags                       4056	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_get_generate_params             4057	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_get_flags                       4058	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_set_finish                      4059	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_get0_app_data                   4060	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_set0_app_data                   4061	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_get_init                        4062	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_get_bn_mod_exp                  4063	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_new                             4064	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_dup                             4065	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_set_bn_mod_exp                  4066	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_set_generate_key                4067	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_free                            4068	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_meth_get_generate_key                4069	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_set_flags                            4070	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-X509_STORE_CTX_get_obj_by_subject       4071	3_0_0	EXIST::FUNCTION:
-X509_OBJECT_free                        4072	3_0_0	EXIST::FUNCTION:
-X509_OBJECT_get0_X509                   4073	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get0_untrusted           4074	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_set_error_depth          4075	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get0_cert                4076	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_set_verify               4077	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_set_current_cert         4078	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_verify               4079	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_verify_cb            4080	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_set0_verified_chain      4081	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_set0_untrusted           4082	3_0_0	EXIST::FUNCTION:
-OPENSSL_hexchar2int                     4083	3_0_0	EXIST::FUNCTION:
-X509_STORE_set_ex_data                  4084	3_0_0	EXIST::FUNCTION:
-X509_STORE_get_ex_data                  4085	3_0_0	EXIST::FUNCTION:
-X509_STORE_get0_objects                 4086	3_0_0	EXIST::FUNCTION:
-X509_OBJECT_get_type                    4087	3_0_0	EXIST::FUNCTION:
-X509_STORE_set_verify                   4088	3_0_0	EXIST::FUNCTION:
-X509_OBJECT_new                         4089	3_0_0	EXIST::FUNCTION:
-X509_STORE_get0_param                   4090	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_PrivateKey_traditional    4091	3_0_0	EXIST::FUNCTION:
-X509_get_pathlen                        4092	3_0_0	EXIST::FUNCTION:
-ECDSA_SIG_set0                          4093	3_0_0	EXIST::FUNCTION:EC
-DSA_SIG_set0                            4094	3_0_0	EXIST::FUNCTION:DSA
-EVP_PKEY_get0_hmac                      4095	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-HMAC_CTX_get_md                         4096	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-NAME_CONSTRAINTS_check_CN               4097	3_0_0	EXIST::FUNCTION:
-OCSP_resp_get0_id                       4098	3_0_0	EXIST::FUNCTION:OCSP
-OCSP_resp_get0_certs                    4099	3_0_0	EXIST::FUNCTION:OCSP
-X509_set_proxy_flag                     4100	3_0_0	EXIST::FUNCTION:
-EVP_ENCODE_CTX_copy                     4101	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_check_issued         4102	3_0_0	EXIST::FUNCTION:
-X509_STORE_set_lookup_certs             4103	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_check_crl            4104	3_0_0	EXIST::FUNCTION:
-X509_STORE_get_cleanup                  4105	3_0_0	EXIST::FUNCTION:
-X509_STORE_get_lookup_crls              4106	3_0_0	EXIST::FUNCTION:
-X509_STORE_get_cert_crl                 4107	3_0_0	EXIST::FUNCTION:
-X509_STORE_get_lookup_certs             4108	3_0_0	EXIST::FUNCTION:
-X509_STORE_get_check_revocation         4109	3_0_0	EXIST::FUNCTION:
-X509_STORE_set_get_crl                  4110	3_0_0	EXIST::FUNCTION:
-X509_STORE_set_check_issued             4111	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_check_policy         4112	3_0_0	EXIST::FUNCTION:
-X509_STORE_get_check_crl                4113	3_0_0	EXIST::FUNCTION:
-X509_STORE_set_check_crl                4114	3_0_0	EXIST::FUNCTION:
-X509_STORE_get_check_issued             4115	3_0_0	EXIST::FUNCTION:
-X509_STORE_get_get_issuer               4116	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_get_crl              4117	3_0_0	EXIST::FUNCTION:
-X509_STORE_set_get_issuer               4118	3_0_0	EXIST::FUNCTION:
-X509_STORE_set_cleanup                  4119	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_cleanup              4120	3_0_0	EXIST::FUNCTION:
-X509_STORE_get_get_crl                  4121	3_0_0	EXIST::FUNCTION:
-X509_STORE_set_check_revocation         4122	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_cert_crl             4123	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_lookup_certs         4124	3_0_0	EXIST::FUNCTION:
-X509_STORE_set_check_policy             4125	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_get_issuer           4126	3_0_0	EXIST::FUNCTION:
-X509_STORE_get_check_policy             4127	3_0_0	EXIST::FUNCTION:
-X509_STORE_set_cert_crl                 4128	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_check_revocation     4129	3_0_0	EXIST::FUNCTION:
-X509_STORE_get_verify_cb                4130	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_get_lookup_crls          4131	3_0_0	EXIST::FUNCTION:
-X509_STORE_get_verify                   4132	3_0_0	EXIST::FUNCTION:
-X509_STORE_unlock                       4133	3_0_0	EXIST::FUNCTION:
-X509_STORE_lock                         4134	3_0_0	EXIST::FUNCTION:
-X509_set_proxy_pathlen                  4135	3_0_0	EXIST::FUNCTION:
-X509_get_proxy_pathlen                  4136	3_0_0	EXIST::FUNCTION:
-DSA_bits                                4137	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-EVP_PKEY_set1_tls_encodedpoint          4138	3_0_0	NOEXIST::FUNCTION:
-EVP_PKEY_get1_tls_encodedpoint          4139	3_0_0	NOEXIST::FUNCTION:
-ASN1_STRING_get0_data                   4140	3_0_0	EXIST::FUNCTION:
-X509_SIG_getm                           4141	3_0_0	EXIST::FUNCTION:
-X509_get0_serialNumber                  4142	3_0_0	EXIST::FUNCTION:
-PKCS12_get_attr                         4143	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
-X509_CRL_get0_lastUpdate                4144	3_0_0	EXIST::FUNCTION:
-X509_get0_notBefore                     4145	3_0_0	EXIST::FUNCTION:
-X509_get0_notAfter                      4146	3_0_0	EXIST::FUNCTION:
-X509_CRL_get0_nextUpdate                4147	3_0_0	EXIST::FUNCTION:
-BIO_get_new_index                       4148	3_0_0	EXIST::FUNCTION:
-OPENSSL_utf82uni                        4149	3_0_0	EXIST::FUNCTION:
-PKCS12_add_friendlyname_utf8            4150	3_0_0	EXIST::FUNCTION:
-OPENSSL_uni2utf8                        4151	3_0_0	EXIST::FUNCTION:
-PKCS12_key_gen_utf8                     4152	3_0_0	EXIST::FUNCTION:
-ECPKPARAMETERS_free                     4153	3_0_0	EXIST::FUNCTION:EC
-ECPARAMETERS_free                       4154	3_0_0	EXIST::FUNCTION:EC
-ECPKPARAMETERS_new                      4155	3_0_0	EXIST::FUNCTION:EC
-ECPARAMETERS_new                        4156	3_0_0	EXIST::FUNCTION:EC
-OCSP_RESPID_set_by_name                 4157	3_0_0	EXIST::FUNCTION:OCSP
-OCSP_RESPID_set_by_key                  4158	3_0_0	EXIST::FUNCTION:OCSP
-OCSP_RESPID_match                       4159	3_0_0	EXIST::FUNCTION:OCSP
-ASN1_ITEM_lookup                        4160	3_0_0	EXIST::FUNCTION:
-ASN1_ITEM_get                           4161	3_0_0	EXIST::FUNCTION:
-BIO_read_ex                             4162	3_0_0	EXIST::FUNCTION:
-BIO_set_callback_ex                     4163	3_0_0	EXIST::FUNCTION:
-BIO_get_callback_ex                     4164	3_0_0	EXIST::FUNCTION:
-BIO_meth_set_read_ex                    4165	3_0_0	EXIST::FUNCTION:
-BIO_meth_get_read_ex                    4166	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
-BIO_write_ex                            4167	3_0_0	EXIST::FUNCTION:
-BIO_meth_get_write_ex                   4168	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
-BIO_meth_set_write_ex                   4169	3_0_0	EXIST::FUNCTION:
-DSO_pathbyaddr                          4170	3_0_0	EXIST::FUNCTION:
-DSO_dsobyaddr                           4171	3_0_0	EXIST::FUNCTION:
-CT_POLICY_EVAL_CTX_get_time             4172	3_0_0	EXIST::FUNCTION:CT
-CT_POLICY_EVAL_CTX_set_time             4173	3_0_0	EXIST::FUNCTION:CT
-X509_VERIFY_PARAM_set_inh_flags         4174	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_get_inh_flags         4175	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_md                         4176	3_0_0	EXIST::FUNCTION:
-RSA_pkey_ctx_ctrl                       4177	3_0_0	EXIST::FUNCTION:
-UI_method_set_ex_data                   4178	3_0_0	EXIST::FUNCTION:
-UI_method_get_ex_data                   4179	3_0_0	EXIST::FUNCTION:
-UI_UTIL_wrap_read_pem_callback          4180	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_get_time              4181	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get0_poly1305                  4182	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,POLY1305
-DH_check_params                         4183	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-EVP_PKEY_get0_siphash                   4184	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SIPHASH
-EVP_aria_256_ofb                        4185	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_256_cfb128                     4186	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_128_cfb1                       4187	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_128_ecb                        4188	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_128_cfb128                     4189	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_192_ecb                        4190	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_128_cbc                        4191	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_192_ofb                        4192	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_192_cbc                        4193	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_192_cfb1                       4194	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_128_cfb8                       4195	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_256_cfb1                       4196	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_192_cfb8                       4197	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_256_cfb8                       4198	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_256_cbc                        4199	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_128_ofb                        4200	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_192_cfb128                     4201	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_256_ecb                        4202	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_256_ctr                        4203	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_128_ctr                        4204	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_192_ctr                        4205	3_0_0	EXIST::FUNCTION:ARIA
-UI_null                                 4206	3_0_0	EXIST::FUNCTION:
-EC_KEY_get0_engine                      4207	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-INT32_it                                4208	3_0_0	EXIST::FUNCTION:
-UINT64_it                               4209	3_0_0	EXIST::FUNCTION:
-ZINT32_it                               4210	3_0_0	EXIST::FUNCTION:
-ZUINT64_it                              4211	3_0_0	EXIST::FUNCTION:
-INT64_it                                4212	3_0_0	EXIST::FUNCTION:
-ZUINT32_it                              4213	3_0_0	EXIST::FUNCTION:
-UINT32_it                               4214	3_0_0	EXIST::FUNCTION:
-ZINT64_it                               4215	3_0_0	EXIST::FUNCTION:
-CRYPTO_mem_leaks_cb                     4216	3_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
-BIO_lookup_ex                           4217	3_0_0	EXIST::FUNCTION:SOCK
-X509_CRL_print_ex                       4218	3_0_0	EXIST::FUNCTION:
-X509_SIG_INFO_get                       4219	3_0_0	EXIST::FUNCTION:
-X509_get_signature_info                 4220	3_0_0	EXIST::FUNCTION:
-X509_SIG_INFO_set                       4221	3_0_0	EXIST::FUNCTION:
-ESS_CERT_ID_V2_free                     4222	3_0_0	EXIST::FUNCTION:
-ESS_SIGNING_CERT_V2_new                 4223	3_0_0	EXIST::FUNCTION:
-d2i_ESS_SIGNING_CERT_V2                 4224	3_0_0	EXIST::FUNCTION:
-i2d_ESS_CERT_ID_V2                      4225	3_0_0	EXIST::FUNCTION:
-ESS_CERT_ID_V2_dup                      4226	3_0_0	EXIST::FUNCTION:
-TS_RESP_CTX_set_ess_cert_id_digest      4227	3_0_0	EXIST::FUNCTION:TS
-d2i_ESS_CERT_ID_V2                      4228	3_0_0	EXIST::FUNCTION:
-i2d_ESS_SIGNING_CERT_V2                 4229	3_0_0	EXIST::FUNCTION:
-TS_CONF_set_ess_cert_id_digest          4230	3_0_0	EXIST::FUNCTION:TS
-ESS_SIGNING_CERT_V2_free                4231	3_0_0	EXIST::FUNCTION:
-ESS_SIGNING_CERT_V2_dup                 4232	3_0_0	EXIST::FUNCTION:
-ESS_CERT_ID_V2_new                      4233	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_ex                         4234	3_0_0	EXIST::FUNCTION:
-PEM_bytes_read_bio_secmem               4235	3_0_0	EXIST::FUNCTION:
-EVP_DigestSign                          4236	3_0_0	EXIST::FUNCTION:
-EVP_DigestVerify                        4237	3_0_0	EXIST::FUNCTION:
-UI_method_get_data_duplicator           4238	3_0_0	EXIST::FUNCTION:
-UI_method_set_data_duplicator           4239	3_0_0	EXIST::FUNCTION:
-UI_dup_user_data                        4240	3_0_0	EXIST::FUNCTION:
-UI_method_get_data_destructor           4241	3_0_0	EXIST::FUNCTION:
-ERR_load_strings_const                  4242	3_0_0	EXIST::FUNCTION:
-ASN1_TIME_to_tm                         4243	3_0_0	EXIST::FUNCTION:
-ASN1_TIME_set_string_X509               4244	3_0_0	EXIST::FUNCTION:
-OCSP_resp_get1_id                       4245	3_0_0	EXIST::FUNCTION:OCSP
-OSSL_STORE_register_loader              4246	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_LOADER_set_error             4247	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_INFO_get0_PKEY               4248	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_get_type                4249	3_0_0	EXIST::FUNCTION:
-ERR_load_OSSL_STORE_strings             4250	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_LOADER_free                  4251	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_get1_PKEY               4252	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_free                    4253	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_LOADER_set_eof               4255	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_LOADER_new                   4256	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_INFO_get0_CERT               4257	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_LOADER_set_close             4258	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_INFO_new_PARAMS              4259	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_new_PKEY                4260	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_get1_PARAMS             4261	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_get1_CRL                4262	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_error                        4263	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_get1_CERT               4264	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_get0_PARAMS             4265	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_type_string             4266	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_get1_NAME               4267	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_LOADER_set_load              4268	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_LOADER_get0_scheme           4269	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_open                         4270	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_close                        4271	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_new_CERT                4272	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_get0_CRL                4273	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_load                         4274	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_get0_NAME               4275	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_unregister_loader            4276	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_INFO_new_CRL                 4277	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_new_NAME                4278	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_eof                          4279	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_LOADER_set_open              4280	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_LOADER_set_ctrl              4281	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_ctrl                         4282	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_INFO_get0_NAME_description   4283	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_set0_NAME_description   4284	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_get1_NAME_description   4285	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_do_all_loaders               4286	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_LOADER_get0_engine           4287	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OPENSSL_fork_prepare                    4288	3_0_0	EXIST:UNIX:FUNCTION:DEPRECATEDIN_3_0
-OPENSSL_fork_parent                     4289	3_0_0	EXIST:UNIX:FUNCTION:DEPRECATEDIN_3_0
-OPENSSL_fork_child                      4290	3_0_0	EXIST:UNIX:FUNCTION:DEPRECATEDIN_3_0
-EVP_sha3_224                            4304	3_0_0	EXIST::FUNCTION:
-EVP_sha3_256                            4305	3_0_0	EXIST::FUNCTION:
-EVP_sha3_384                            4306	3_0_0	EXIST::FUNCTION:
-EVP_sha3_512                            4307	3_0_0	EXIST::FUNCTION:
-EVP_shake128                            4308	3_0_0	EXIST::FUNCTION:
-EVP_shake256                            4309	3_0_0	EXIST::FUNCTION:
-SCRYPT_PARAMS_new                       4310	3_0_0	EXIST::FUNCTION:SCRYPT
-SCRYPT_PARAMS_free                      4311	3_0_0	EXIST::FUNCTION:SCRYPT
-i2d_SCRYPT_PARAMS                       4312	3_0_0	EXIST::FUNCTION:SCRYPT
-d2i_SCRYPT_PARAMS                       4313	3_0_0	EXIST::FUNCTION:SCRYPT
-SCRYPT_PARAMS_it                        4314	3_0_0	EXIST::FUNCTION:SCRYPT
-CRYPTO_secure_clear_free                4315	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_get0                      4316	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_get_count                 4317	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RAND_priv_bytes                         4320	3_0_0	EXIST::FUNCTION:
-BN_priv_rand                            4321	3_0_0	EXIST::FUNCTION:
-BN_priv_rand_range                      4322	3_0_0	EXIST::FUNCTION:
-ASN1_TIME_normalize                     4323	3_0_0	EXIST::FUNCTION:
-ASN1_TIME_cmp_time_t                    4324	3_0_0	EXIST::FUNCTION:
-ASN1_TIME_compare                       4325	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_ctrl_uint64                4326	3_0_0	EXIST::FUNCTION:
-EVP_DigestFinalXOF                      4327	3_0_0	EXIST::FUNCTION:
-ERR_clear_last_mark                     4328	3_0_0	EXIST::FUNCTION:
-EVP_aria_192_ccm                        4330	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_256_gcm                        4331	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_256_ccm                        4332	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_128_gcm                        4333	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_128_ccm                        4334	3_0_0	EXIST::FUNCTION:ARIA
-EVP_aria_192_gcm                        4335	3_0_0	EXIST::FUNCTION:ARIA
-UI_get_result_length                    4337	3_0_0	EXIST::FUNCTION:
-UI_set_result_ex                        4338	3_0_0	EXIST::FUNCTION:
-UI_get_result_string_length             4339	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_check                          4340	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_set_check                 4341	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_get_check                 4342	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_remove                    4343	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OPENSSL_sk_reserve                      4344	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_set1_engine                    4347	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-DH_new_by_nid                           4348	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_get_nid                              4349	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-CRYPTO_get_alloc_counts                 4350	3_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG
-OPENSSL_sk_new_reserve                  4351	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_set_check                 4352	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_set_siginf                4353	3_0_0	EXIST::FUNCTION:
-EVP_sm4_ctr                             4354	3_0_0	EXIST::FUNCTION:SM4
-EVP_sm4_cbc                             4355	3_0_0	EXIST::FUNCTION:SM4
-EVP_sm4_ofb                             4356	3_0_0	EXIST::FUNCTION:SM4
-EVP_sm4_ecb                             4357	3_0_0	EXIST::FUNCTION:SM4
-EVP_sm4_cfb128                          4358	3_0_0	EXIST::FUNCTION:SM4
-EVP_sm3                                 4359	3_0_0	EXIST::FUNCTION:SM3
-RSA_get0_multi_prime_factors            4360	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_public_check                   4361	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_param_check                    4362	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_set_public_check          4363	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_set_param_check           4364	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_get_public_check          4365	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_get_param_check           4366	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_asn1_set_public_check          4367	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_set_param_check           4368	3_0_0	EXIST::FUNCTION:
-DH_check_ex                             4369	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_check_pub_key_ex                     4370	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_check_params_ex                      4371	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-RSA_generate_multi_prime_key            4372	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_get_multi_prime_extra_count         4373	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OCSP_resp_get0_signer                   4374	3_0_0	EXIST::FUNCTION:OCSP
-RSA_get0_multi_prime_crt_params         4375	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_set0_multi_prime_params             4376	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_get_version                         4377	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_get_multi_prime_keygen         4378	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_meth_set_multi_prime_keygen         4379	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-PROFESSION_INFO_get0_addProfessionInfo  4382	3_0_0	EXIST::FUNCTION:
-ADMISSION_SYNTAX_free                   4383	3_0_0	EXIST::FUNCTION:
-d2i_ADMISSION_SYNTAX                    4384	3_0_0	EXIST::FUNCTION:
-NAMING_AUTHORITY_set0_authorityId       4385	3_0_0	EXIST::FUNCTION:
-NAMING_AUTHORITY_set0_authorityURL      4386	3_0_0	EXIST::FUNCTION:
-d2i_PROFESSION_INFO                     4387	3_0_0	EXIST::FUNCTION:
-NAMING_AUTHORITY_it                     4388	3_0_0	EXIST::FUNCTION:
-ADMISSION_SYNTAX_get0_contentsOfAdmissions 4389	3_0_0	EXIST::FUNCTION:
-PROFESSION_INFO_set0_professionItems    4390	3_0_0	EXIST::FUNCTION:
-NAMING_AUTHORITY_new                    4391	3_0_0	EXIST::FUNCTION:
-NAMING_AUTHORITY_get0_authorityURL      4392	3_0_0	EXIST::FUNCTION:
-ADMISSION_SYNTAX_get0_admissionAuthority 4393	3_0_0	EXIST::FUNCTION:
-PROFESSION_INFO_new                     4394	3_0_0	EXIST::FUNCTION:
-ADMISSIONS_new                          4395	3_0_0	EXIST::FUNCTION:
-ADMISSION_SYNTAX_set0_admissionAuthority 4396	3_0_0	EXIST::FUNCTION:
-PROFESSION_INFO_get0_professionOIDs     4397	3_0_0	EXIST::FUNCTION:
-PROFESSION_INFO_it                      4398	3_0_0	EXIST::FUNCTION:
-i2d_PROFESSION_INFO                     4399	3_0_0	EXIST::FUNCTION:
-ADMISSIONS_set0_professionInfos         4400	3_0_0	EXIST::FUNCTION:
-PROFESSION_INFO_get0_namingAuthority    4401	3_0_0	EXIST::FUNCTION:
-PROFESSION_INFO_free                    4402	3_0_0	EXIST::FUNCTION:
-PROFESSION_INFO_set0_addProfessionInfo  4403	3_0_0	EXIST::FUNCTION:
-PROFESSION_INFO_set0_registrationNumber 4404	3_0_0	EXIST::FUNCTION:
-ADMISSION_SYNTAX_set0_contentsOfAdmissions 4405	3_0_0	EXIST::FUNCTION:
-NAMING_AUTHORITY_get0_authorityId       4406	3_0_0	EXIST::FUNCTION:
-ADMISSION_SYNTAX_it                     4407	3_0_0	EXIST::FUNCTION:
-i2d_ADMISSION_SYNTAX                    4408	3_0_0	EXIST::FUNCTION:
-NAMING_AUTHORITY_get0_authorityText     4409	3_0_0	EXIST::FUNCTION:
-PROFESSION_INFO_set0_namingAuthority    4410	3_0_0	EXIST::FUNCTION:
-i2d_NAMING_AUTHORITY                    4411	3_0_0	EXIST::FUNCTION:
-NAMING_AUTHORITY_free                   4412	3_0_0	EXIST::FUNCTION:
-ADMISSIONS_set0_admissionAuthority      4413	3_0_0	EXIST::FUNCTION:
-ADMISSIONS_free                         4414	3_0_0	EXIST::FUNCTION:
-PROFESSION_INFO_get0_registrationNumber 4415	3_0_0	EXIST::FUNCTION:
-d2i_ADMISSIONS                          4416	3_0_0	EXIST::FUNCTION:
-i2d_ADMISSIONS                          4417	3_0_0	EXIST::FUNCTION:
-PROFESSION_INFO_get0_professionItems    4418	3_0_0	EXIST::FUNCTION:
-ADMISSIONS_get0_admissionAuthority      4419	3_0_0	EXIST::FUNCTION:
-PROFESSION_INFO_set0_professionOIDs     4420	3_0_0	EXIST::FUNCTION:
-d2i_NAMING_AUTHORITY                    4421	3_0_0	EXIST::FUNCTION:
-ADMISSIONS_it                           4422	3_0_0	EXIST::FUNCTION:
-ADMISSIONS_get0_namingAuthority         4423	3_0_0	EXIST::FUNCTION:
-NAMING_AUTHORITY_set0_authorityText     4424	3_0_0	EXIST::FUNCTION:
-ADMISSIONS_set0_namingAuthority         4425	3_0_0	EXIST::FUNCTION:
-ADMISSIONS_get0_professionInfos         4426	3_0_0	EXIST::FUNCTION:
-ADMISSION_SYNTAX_new                    4427	3_0_0	EXIST::FUNCTION:
-EVP_sha512_256                          4428	3_0_0	EXIST::FUNCTION:
-EVP_sha512_224                          4429	3_0_0	EXIST::FUNCTION:
-OCSP_basic_sign_ctx                     4430	3_0_0	EXIST::FUNCTION:OCSP
-OSSL_STORE_vctrl                        4433	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_SEARCH_by_alias              4434	3_0_0	EXIST::FUNCTION:
-BIO_bind                                4435	3_0_0	EXIST::FUNCTION:SOCK
-OSSL_STORE_LOADER_set_expect            4436	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_expect                       4437	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_SEARCH_by_key_fingerprint    4438	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_SEARCH_get0_serial           4439	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_SEARCH_by_name               4440	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_supports_search              4441	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_find                         4442	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_SEARCH_get_type              4443	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_SEARCH_get0_bytes            4444	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_SEARCH_get0_string           4445	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_SEARCH_by_issuer_serial      4446	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_SEARCH_get0_name             4447	3_0_0	EXIST::FUNCTION:
-X509_get0_authority_key_id              4448	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_LOADER_set_find              4449	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_SEARCH_free                  4450	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_SEARCH_get0_digest           4451	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_new_raw_private_key            4453	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_new_raw_public_key             4454	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_new_CMAC_key                   4455	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_asn1_set_set_priv_key          4456	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_set_set_pub_key           4457	3_0_0	EXIST::FUNCTION:
-conf_ssl_name_find                      4469	3_0_0	EXIST::FUNCTION:
-conf_ssl_get_cmd                        4470	3_0_0	EXIST::FUNCTION:
-conf_ssl_get                            4471	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_get_hostflags         4472	3_0_0	EXIST::FUNCTION:
-DH_get0_p                               4473	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_get0_q                               4474	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_get0_g                               4475	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_get0_priv_key                        4476	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DH_get0_pub_key                         4477	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-DSA_get0_priv_key                       4478	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_get0_pub_key                        4479	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_get0_q                              4480	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_get0_p                              4481	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-DSA_get0_g                              4482	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
-RSA_get0_dmp1                           4483	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_get0_d                              4484	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_get0_n                              4485	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_get0_dmq1                           4486	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_get0_e                              4487	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_get0_q                              4488	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_get0_p                              4489	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-RSA_get0_iqmp                           4490	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-ECDSA_SIG_get0_r                        4491	3_0_0	EXIST::FUNCTION:EC
-ECDSA_SIG_get0_s                        4492	3_0_0	EXIST::FUNCTION:EC
-X509_LOOKUP_meth_get_get_by_fingerprint 4493	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_new                    4494	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_get_init               4495	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_get_get_by_alias       4496	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_set_new_item           4497	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_set_shutdown           4498	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_get_new_item           4499	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_set_ctrl               4500	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_set_get_by_issuer_serial 4501	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_get_store                   4502	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_get_ctrl               4503	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_set_get_by_alias       4504	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_get_get_by_subject     4505	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_get_free               4506	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_set_get_by_subject     4507	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_set_free               4508	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_get_shutdown           4509	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_set_method_data             4510	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_get_method_data             4511	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_set_get_by_fingerprint 4512	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_free                   4513	3_0_0	EXIST::FUNCTION:
-X509_OBJECT_set1_X509                   4514	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_get_get_by_issuer_serial 4515	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_meth_set_init               4516	3_0_0	EXIST::FUNCTION:
-X509_OBJECT_set1_X509_CRL               4517	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_raw_public_key             4518	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_raw_private_key            4519	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_set_get_priv_key          4520	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_asn1_set_get_pub_key           4521	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_set_alias_type                 4522	3_0_0	NOEXIST::FUNCTION:DEPRECATEDIN_3_0
-RAND_keep_random_devices_open           4523	3_0_0	EXIST::FUNCTION:
-EC_POINT_set_compressed_coordinates     4524	3_0_0	EXIST::FUNCTION:EC
-EC_POINT_set_affine_coordinates         4525	3_0_0	EXIST::FUNCTION:EC
-EC_POINT_get_affine_coordinates         4526	3_0_0	EXIST::FUNCTION:EC
-EC_GROUP_set_curve                      4527	3_0_0	EXIST::FUNCTION:EC
-EC_GROUP_get_curve                      4528	3_0_0	EXIST::FUNCTION:EC
-OCSP_resp_get0_tbs_sigalg               4529	3_0_0	EXIST::FUNCTION:OCSP
-OCSP_resp_get0_respdata                 4530	3_0_0	EXIST::FUNCTION:OCSP
-EVP_MD_CTX_set_pkey_ctx                 4531	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_set_digest_custom         4532	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_get_digest_custom         4533	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_MAC_CTX_new                         4534	3_0_0	EXIST::FUNCTION:
-EVP_MAC_CTX_free                        4535	3_0_0	EXIST::FUNCTION:
-EVP_MAC_CTX_dup                         4536	3_0_0	EXIST::FUNCTION:
-EVP_MAC_CTX_get0_mac                    4537	3_0_0	EXIST::FUNCTION:
-EVP_MAC_CTX_get_mac_size                4538	3_0_0	EXIST::FUNCTION:
-EVP_Q_mac                               4539	3_0_0	EXIST::FUNCTION:
-EVP_MAC_init                            4540	3_0_0	EXIST::FUNCTION:
-EVP_MAC_update                          4541	3_0_0	EXIST::FUNCTION:
-EVP_MAC_final                           4542	3_0_0	EXIST::FUNCTION:
-EVP_MAC_finalXOF                        4543	3_0_0	EXIST::FUNCTION:
-OSSL_EC_curve_nid2name                  4544	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_digestsign_supports_digest     4545	3_0_0	EXIST::FUNCTION:
-SRP_VBASE_add0_user                     4546	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SRP_user_pwd_new                        4547	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SRP_user_pwd_set_gN                     4548	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SRP_user_pwd_set1_ids                   4549	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SRP_user_pwd_set0_sv                    4550	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-OPENSSL_version_major                   4551	3_0_0	EXIST::FUNCTION:
-OPENSSL_version_minor                   4552	3_0_0	EXIST::FUNCTION:
-OPENSSL_version_patch                   4553	3_0_0	EXIST::FUNCTION:
-OPENSSL_version_pre_release             4554	3_0_0	EXIST::FUNCTION:
-OPENSSL_version_build_metadata          4555	3_0_0	EXIST::FUNCTION:
-OPENSSL_INIT_set_config_filename        4556	3_0_0	EXIST::FUNCTION:STDIO
-OPENSSL_INIT_set_config_file_flags      4557	3_0_0	EXIST::FUNCTION:STDIO
-ASYNC_WAIT_CTX_get_callback             4558	3_0_0	EXIST::FUNCTION:
-ASYNC_WAIT_CTX_set_callback             4559	3_0_0	EXIST::FUNCTION:
-ASYNC_WAIT_CTX_set_status               4560	3_0_0	EXIST::FUNCTION:
-ASYNC_WAIT_CTX_get_status               4561	3_0_0	EXIST::FUNCTION:
-EVP_KDF_CTX_free                        4562	3_0_0	EXIST::FUNCTION:
-EVP_KDF_CTX_reset                       4563	3_0_0	EXIST::FUNCTION:
-EVP_KDF_CTX_get_kdf_size                4564	3_0_0	EXIST::FUNCTION:
-EVP_KDF_derive                          4565	3_0_0	EXIST::FUNCTION:
-EVP_KDF_get0_name                       4566	3_0_0	EXIST::FUNCTION:
-EC_GROUP_get0_field                     4567	3_0_0	EXIST::FUNCTION:EC
-CRYPTO_alloc_ex_data                    4568	3_0_0	EXIST::FUNCTION:
-OSSL_LIB_CTX_new                        4569	3_0_0	EXIST::FUNCTION:
-OSSL_LIB_CTX_free                       4570	3_0_0	EXIST::FUNCTION:
-OPENSSL_LH_flush                        4571	3_0_0	EXIST::FUNCTION:
-BN_native2bn                            4572	3_0_0	EXIST::FUNCTION:
-BN_bn2nativepad                         4573	3_0_0	EXIST::FUNCTION:
-OSSL_trace_get_category_num             4574	3_0_0	EXIST::FUNCTION:
-OSSL_trace_get_category_name            4575	3_0_0	EXIST::FUNCTION:
-OSSL_trace_set_channel                  4576	3_0_0	EXIST::FUNCTION:
-OSSL_trace_set_prefix                   4577	3_0_0	EXIST::FUNCTION:
-OSSL_trace_set_suffix                   4578	3_0_0	EXIST::FUNCTION:
-OSSL_trace_set_callback                 4579	3_0_0	EXIST::FUNCTION:
-OSSL_trace_enabled                      4580	3_0_0	EXIST::FUNCTION:
-OSSL_trace_begin                        4581	3_0_0	EXIST::FUNCTION:
-OSSL_trace_end                          4582	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_load                      4583	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_try_load                  4584	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_unload                    4585	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_add_builtin               4586	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_gettable_params           4587	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_get_params                4588	3_0_0	EXIST::FUNCTION:
-d2i_OSSL_CRMF_ENCRYPTEDVALUE            4589	3_0_0	EXIST::FUNCTION:CRMF
-i2d_OSSL_CRMF_ENCRYPTEDVALUE            4590	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_ENCRYPTEDVALUE_free           4591	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_ENCRYPTEDVALUE_new            4592	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_ENCRYPTEDVALUE_it             4593	3_0_0	EXIST::FUNCTION:CRMF
-d2i_OSSL_CRMF_MSG                       4594	3_0_0	EXIST::FUNCTION:CRMF
-i2d_OSSL_CRMF_MSG                       4595	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_dup                       4596	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_free                      4597	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_new                       4598	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_it                        4599	3_0_0	EXIST::FUNCTION:CRMF
-d2i_OSSL_CRMF_PBMPARAMETER              4600	3_0_0	EXIST::FUNCTION:CRMF
-i2d_OSSL_CRMF_PBMPARAMETER              4601	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_PBMPARAMETER_free             4602	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_PBMPARAMETER_new              4603	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_PBMPARAMETER_it               4604	3_0_0	EXIST::FUNCTION:CRMF
-d2i_OSSL_CRMF_CERTID                    4605	3_0_0	EXIST::FUNCTION:CRMF
-i2d_OSSL_CRMF_CERTID                    4606	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTID_dup                    4607	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTID_free                   4608	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTID_new                    4609	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTID_it                     4610	3_0_0	EXIST::FUNCTION:CRMF
-d2i_OSSL_CRMF_PKIPUBLICATIONINFO        4611	3_0_0	EXIST::FUNCTION:CRMF
-i2d_OSSL_CRMF_PKIPUBLICATIONINFO        4612	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_PKIPUBLICATIONINFO_free       4613	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_PKIPUBLICATIONINFO_new        4614	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_PKIPUBLICATIONINFO_it         4615	3_0_0	EXIST::FUNCTION:CRMF
-d2i_OSSL_CRMF_SINGLEPUBINFO             4616	3_0_0	EXIST::FUNCTION:CRMF
-i2d_OSSL_CRMF_SINGLEPUBINFO             4617	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_SINGLEPUBINFO_free            4618	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_SINGLEPUBINFO_new             4619	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_SINGLEPUBINFO_it              4620	3_0_0	EXIST::FUNCTION:CRMF
-d2i_OSSL_CRMF_CERTTEMPLATE              4621	3_0_0	EXIST::FUNCTION:CRMF
-i2d_OSSL_CRMF_CERTTEMPLATE              4622	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTTEMPLATE_free             4623	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTTEMPLATE_new              4624	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTTEMPLATE_it               4625	3_0_0	EXIST::FUNCTION:CRMF
-d2i_OSSL_CRMF_MSGS                      4626	3_0_0	EXIST::FUNCTION:CRMF
-i2d_OSSL_CRMF_MSGS                      4627	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSGS_free                     4628	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSGS_new                      4629	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSGS_it                       4630	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_pbmp_new                      4631	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_pbm_new                       4632	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_get0_regCtrl_regToken     4633	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_set1_regCtrl_regToken     4634	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_get0_regCtrl_authenticator 4635	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_set1_regCtrl_authenticator 4636	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_PKIPublicationInfo_push0_SinglePubInfo 4637	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_set0_SinglePubInfo        4638	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_get0_regCtrl_pkiPublicationInfo 4639	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_set_PKIPublicationInfo_action 4640	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_set1_regCtrl_pkiPublicationInfo 4641	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_get0_regCtrl_protocolEncrKey 4642	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_set1_regCtrl_protocolEncrKey 4643	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_get0_regCtrl_oldCertID    4644	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_set1_regCtrl_oldCertID    4645	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTID_gen                    4646	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_get0_regInfo_utf8Pairs    4647	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_set1_regInfo_utf8Pairs    4648	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_get0_regInfo_certReq      4649	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_set1_regInfo_certReq      4650	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_set0_validity             4651	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_set_certReqId             4652	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_get_certReqId             4653	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_set0_extensions           4654	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_push0_extension           4655	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_create_popo               4656	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSGS_verify_popo              4657	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_get0_tmpl                 4658	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTTEMPLATE_get0_serialNumber 4659	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTTEMPLATE_get0_subject     4660	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTTEMPLATE_get0_issuer      4661	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTTEMPLATE_get0_extensions  4662	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTTEMPLATE_fill             4663	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert   4664	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_PARAM_locate                       4665	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_int                4666	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_uint               4667	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_long               4668	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_ulong              4669	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_int32              4670	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_uint32             4671	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_int64              4672	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_uint64             4673	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_size_t             4674	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_BN                 4675	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_double             4676	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_utf8_string        4677	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_utf8_ptr           4678	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_octet_string       4679	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_octet_ptr          4680	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_int                      4681	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_uint                     4682	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_long                     4683	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_ulong                    4684	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_int32                    4685	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_uint32                   4686	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_int64                    4687	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_uint64                   4688	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_size_t                   4689	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_int                      4690	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_uint                     4691	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_long                     4692	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_ulong                    4693	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_int32                    4694	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_uint32                   4695	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_int64                    4696	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_uint64                   4697	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_size_t                   4698	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_double                   4699	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_double                   4700	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_BN                       4701	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_BN                       4702	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_utf8_string              4703	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_utf8_string              4704	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_octet_string             4705	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_octet_string             4706	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_utf8_ptr                 4707	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_utf8_ptr                 4708	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_octet_ptr                4709	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_octet_ptr                4710	3_0_0	EXIST::FUNCTION:
-X509_set0_distinguishing_id             4711	3_0_0	EXIST::FUNCTION:
-X509_get0_distinguishing_id             4712	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get0_engine                    4713	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
-EVP_MD_up_ref                           4714	3_0_0	EXIST::FUNCTION:
-EVP_MD_fetch                            4715	3_0_0	EXIST::FUNCTION:
-EVP_set_default_properties              4716	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_end                4717	3_0_0	EXIST::FUNCTION:
-EC_GROUP_check_named_curve              4718	3_0_0	EXIST::FUNCTION:EC
-EVP_CIPHER_up_ref                       4719	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_fetch                        4720	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_get_mode                     4721	3_0_0	EXIST::FUNCTION:
-OPENSSL_info                            4722	3_0_0	EXIST::FUNCTION:
-EVP_KDF_CTX_new                         4723	3_0_0	EXIST::FUNCTION:
-EVP_KDF_CTX_kdf                         4724	3_0_0	EXIST::FUNCTION:
-i2d_KeyParams                           4725	3_0_0	EXIST::FUNCTION:
-d2i_KeyParams                           4726	3_0_0	EXIST::FUNCTION:
-i2d_KeyParams_bio                       4727	3_0_0	EXIST::FUNCTION:
-d2i_KeyParams_bio                       4728	3_0_0	EXIST::FUNCTION:
-OSSL_CMP_PKISTATUS_it                   4729	3_0_0	EXIST::FUNCTION:CMP
-d2i_OSSL_CMP_PKIHEADER                  4730	3_0_0	EXIST::FUNCTION:CMP
-i2d_OSSL_CMP_PKIHEADER                  4731	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_PKIHEADER_free                 4732	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_PKIHEADER_new                  4733	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_PKIHEADER_it                   4734	3_0_0	EXIST::FUNCTION:CMP
-d2i_OSSL_CMP_MSG                        4735	3_0_0	EXIST::FUNCTION:CMP
-i2d_OSSL_CMP_MSG                        4736	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_MSG_it                         4737	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_create                    4738	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_set0                      4739	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_get0_type                 4740	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_get0_value                4741	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_push0_stack_item          4742	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_free                      4743	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_MSG_free                       4744	3_0_0	EXIST::FUNCTION:CMP
-EVP_MD_CTX_set_params                   4745	3_0_0	EXIST::FUNCTION:
-EVP_MD_CTX_get_params                   4746	3_0_0	EXIST::FUNCTION:
-BN_CTX_new_ex                           4747	3_0_0	EXIST::FUNCTION:
-BN_CTX_secure_new_ex                    4748	3_0_0	EXIST::FUNCTION:
-OPENSSL_thread_stop_ex                  4749	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_locate_const                 4750	3_0_0	EXIST::FUNCTION:
-X509_REQ_set0_distinguishing_id         4751	3_0_0	EXIST::FUNCTION:
-X509_REQ_get0_distinguishing_id         4752	3_0_0	EXIST::FUNCTION:
-BN_rand_ex                              4753	3_0_0	EXIST::FUNCTION:
-BN_priv_rand_ex                         4754	3_0_0	EXIST::FUNCTION:
-BN_rand_range_ex                        4755	3_0_0	EXIST::FUNCTION:
-BN_priv_rand_range_ex                   4756	3_0_0	EXIST::FUNCTION:
-BN_generate_prime_ex2                   4757	3_0_0	EXIST::FUNCTION:
-EVP_KEYEXCH_free                        4758	3_0_0	EXIST::FUNCTION:
-EVP_KEYEXCH_up_ref                      4759	3_0_0	EXIST::FUNCTION:
-EVP_KEYEXCH_fetch                       4760	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dh_pad                 4761	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_params                 4762	3_0_0	EXIST::FUNCTION:
-EVP_KEYMGMT_fetch                       4763	3_0_0	EXIST::FUNCTION:
-EVP_KEYMGMT_up_ref                      4764	3_0_0	EXIST::FUNCTION:
-EVP_KEYMGMT_free                        4765	3_0_0	EXIST::FUNCTION:
-EVP_KEYMGMT_get0_provider               4766	3_0_0	EXIST::FUNCTION:
-X509_PUBKEY_dup                         4767	3_0_0	EXIST::FUNCTION:
-EVP_MD_get0_name                        4768	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_get0_name                    4769	3_0_0	EXIST::FUNCTION:
-EVP_MD_get0_provider                    4770	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_get0_provider                4771	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_get0_name                 4772	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_do_all_provided              4773	3_0_0	EXIST::FUNCTION:
-EVP_MD_do_all_provided                  4774	3_0_0	EXIST::FUNCTION:
-EVP_KEYEXCH_get0_provider               4775	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_available                 4776	3_0_0	EXIST::FUNCTION:
-ERR_new                                 4777	3_0_0	EXIST::FUNCTION:
-ERR_set_debug                           4778	3_0_0	EXIST::FUNCTION:
-ERR_set_error                           4779	3_0_0	EXIST::FUNCTION:
-ERR_vset_error                          4780	3_0_0	EXIST::FUNCTION:
-X509_get0_authority_issuer              4781	3_0_0	EXIST::FUNCTION:
-X509_get0_authority_serial              4782	3_0_0	EXIST::FUNCTION:
-X509_self_signed                        4783	3_0_0	EXIST::FUNCTION:
-OPENSSL_hexstr2buf_ex                   4784	3_0_0	EXIST::FUNCTION:
-OPENSSL_buf2hexstr_ex                   4785	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_allocate_from_text           4786	3_0_0	EXIST::FUNCTION:
-EVP_MD_gettable_params                  4787	3_0_0	EXIST::FUNCTION:
-EVP_MD_CTX_settable_params              4788	3_0_0	EXIST::FUNCTION:
-EVP_MD_CTX_gettable_params              4789	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_get_params                   4790	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_set_params               4791	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_get_params               4792	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_gettable_params              4793	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_settable_ctx_params          4794	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_gettable_ctx_params          4795	3_0_0	EXIST::FUNCTION:
-EVP_MD_get_params                       4796	3_0_0	EXIST::FUNCTION:
-EVP_MAC_fetch                           4797	3_0_0	EXIST::FUNCTION:
-EVP_MAC_settable_ctx_params             4798	3_0_0	EXIST::FUNCTION:
-EVP_MAC_CTX_set_params                  4799	3_0_0	EXIST::FUNCTION:
-EVP_MAC_CTX_get_params                  4800	3_0_0	EXIST::FUNCTION:
-EVP_MAC_gettable_ctx_params             4801	3_0_0	EXIST::FUNCTION:
-EVP_MAC_free                            4802	3_0_0	EXIST::FUNCTION:
-EVP_MAC_up_ref                          4803	3_0_0	EXIST::FUNCTION:
-EVP_MAC_get_params                      4804	3_0_0	EXIST::FUNCTION:
-EVP_MAC_gettable_params                 4805	3_0_0	EXIST::FUNCTION:
-EVP_MAC_get0_provider                   4806	3_0_0	EXIST::FUNCTION:
-EVP_MAC_do_all_provided                 4807	3_0_0	EXIST::FUNCTION:
-EVP_MAC_get0_name                       4808	3_0_0	EXIST::FUNCTION:
-EVP_MD_free                             4809	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_free                         4810	3_0_0	EXIST::FUNCTION:
-EVP_KDF_up_ref                          4811	3_0_0	EXIST::FUNCTION:
-EVP_KDF_free                            4812	3_0_0	EXIST::FUNCTION:
-EVP_KDF_fetch                           4813	3_0_0	EXIST::FUNCTION:
-EVP_KDF_CTX_dup                         4814	3_0_0	EXIST::FUNCTION:
-EVP_KDF_get0_provider                   4815	3_0_0	EXIST::FUNCTION:
-EVP_KDF_get_params                      4816	3_0_0	EXIST::FUNCTION:
-EVP_KDF_CTX_get_params                  4817	3_0_0	EXIST::FUNCTION:
-EVP_KDF_CTX_set_params                  4818	3_0_0	EXIST::FUNCTION:
-EVP_KDF_gettable_params                 4819	3_0_0	EXIST::FUNCTION:
-EVP_KDF_gettable_ctx_params             4820	3_0_0	EXIST::FUNCTION:
-EVP_KDF_settable_ctx_params             4821	3_0_0	EXIST::FUNCTION:
-EVP_KDF_do_all_provided                 4822	3_0_0	EXIST::FUNCTION:
-EVP_SIGNATURE_free                      4823	3_0_0	EXIST::FUNCTION:
-EVP_SIGNATURE_up_ref                    4824	3_0_0	EXIST::FUNCTION:
-EVP_SIGNATURE_get0_provider             4825	3_0_0	EXIST::FUNCTION:
-EVP_SIGNATURE_fetch                     4826	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_signature_md           4827	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_signature_md           4828	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_params                 4829	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_gettable_params            4830	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_settable_params            4831	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_get_tag_length           4832	3_0_0	EXIST::FUNCTION:
-ERR_get_error_all                       4833	3_0_0	EXIST::FUNCTION:
-ERR_peek_error_func                     4834	3_0_0	EXIST::FUNCTION:
-ERR_peek_error_data                     4835	3_0_0	EXIST::FUNCTION:
-ERR_peek_error_all                      4836	3_0_0	EXIST::FUNCTION:
-ERR_peek_last_error_func                4837	3_0_0	EXIST::FUNCTION:
-ERR_peek_last_error_data                4838	3_0_0	EXIST::FUNCTION:
-ERR_peek_last_error_all                 4839	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_is_a                         4840	3_0_0	EXIST::FUNCTION:
-EVP_MAC_is_a                            4841	3_0_0	EXIST::FUNCTION:
-EVP_MD_settable_ctx_params              4842	3_0_0	EXIST::FUNCTION:
-EVP_MD_gettable_ctx_params              4843	3_0_0	EXIST::FUNCTION:
-OSSL_CMP_CTX_new                        4844	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_free                       4845	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_reinit                     4846	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set_option                 4847	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get_option                 4848	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set_log_cb                 4849	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_print_errors               4850	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_serverPath            4851	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_server                4852	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set_serverPort             4853	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_proxy                 4854	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_no_proxy              4855	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set_http_cb                4856	3_0_0	EXIST::FUNCTION:CMP,HTTP
-OSSL_CMP_CTX_set_http_cb_arg            4857	3_0_0	EXIST::FUNCTION:CMP,HTTP
-OSSL_CMP_CTX_get_http_cb_arg            4858	3_0_0	EXIST::FUNCTION:CMP,HTTP
-OSSL_CMP_CTX_set_transfer_cb            4859	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set_transfer_cb_arg        4860	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get_transfer_cb_arg        4861	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_srvCert               4862	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_expected_sender       4863	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set0_trustedStore          4864	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get0_trustedStore          4865	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_untrusted             4866	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get0_untrusted             4867	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_cert                  4868	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_pkey                  4869	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_build_cert_chain           4870	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_referenceValue        4871	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_secretValue           4872	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_recipient             4873	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_push0_geninfo_ITAV         4874	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_extraCertsOut         4875	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set0_newPkey               4876	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get0_newPkey               4877	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_issuer                4878	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_subjectName           4879	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_push1_subjectAltName       4880	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set0_reqExtensions         4881	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_reqExtensions_have_SAN     4882	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_push0_policy               4883	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_oldCert               4884	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_p10CSR                4885	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_push0_genm_ITAV            4886	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set_certConf_cb            4887	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set_certConf_cb_arg        4888	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get_certConf_cb_arg        4889	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get_status                 4890	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get0_statusString          4891	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get_failInfoCode           4892	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get0_newCert               4893	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get1_newChain              4894	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get1_caPubs                4895	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get1_extraCertsIn          4896	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_transactionID         4897	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_senderNonce           4898	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_log_open                       4899	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_log_close                      4900	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_print_to_bio                   4901	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_print_errors_cb                4902	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CRMF_CERTID_get0_issuer            4903	3_0_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTID_get0_serialNumber      4904	3_0_0	EXIST::FUNCTION:CRMF
-EVP_DigestSignUpdate                    4905	3_0_0	EXIST::FUNCTION:
-EVP_DigestVerifyUpdate                  4906	3_0_0	EXIST::FUNCTION:
-BN_check_prime                          4907	3_0_0	EXIST::FUNCTION:
-EVP_KEYMGMT_is_a                        4908	3_0_0	EXIST::FUNCTION:
-EVP_KEYMGMT_do_all_provided             4909	3_0_0	EXIST::FUNCTION:
-EVP_KEYEXCH_is_a                        4910	3_0_0	EXIST::FUNCTION:
-EVP_KEYEXCH_do_all_provided             4911	3_0_0	EXIST::FUNCTION:
-EVP_KDF_is_a                            4912	3_0_0	EXIST::FUNCTION:
-EVP_MD_is_a                             4913	3_0_0	EXIST::FUNCTION:
-EVP_SIGNATURE_is_a                      4914	3_0_0	EXIST::FUNCTION:
-EVP_SIGNATURE_do_all_provided           4915	3_0_0	EXIST::FUNCTION:
-EVP_MD_names_do_all                     4916	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_names_do_all                 4917	3_0_0	EXIST::FUNCTION:
-EVP_MAC_names_do_all                    4918	3_0_0	EXIST::FUNCTION:
-EVP_KEYMGMT_names_do_all                4919	3_0_0	EXIST::FUNCTION:
-EVP_KEYEXCH_names_do_all                4920	3_0_0	EXIST::FUNCTION:
-EVP_KDF_names_do_all                    4921	3_0_0	EXIST::FUNCTION:
-EVP_SIGNATURE_names_do_all              4922	3_0_0	EXIST::FUNCTION:
-OSSL_CMP_CTX_snprint_PKIStatus          4923	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_HDR_get0_transactionID         4924	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_HDR_get0_recipNonce            4925	3_0_0	EXIST::FUNCTION:CMP
-X509_LOOKUP_store                       4926	3_0_0	EXIST::FUNCTION:
-X509_add_cert                           4927	3_0_0	EXIST::FUNCTION:
-X509_add_certs                          4928	3_0_0	EXIST::FUNCTION:
-X509_STORE_load_file                    4929	3_0_0	EXIST::FUNCTION:
-X509_STORE_load_path                    4930	3_0_0	EXIST::FUNCTION:
-X509_STORE_load_store                   4931	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_fromdata                       4932	3_0_0	EXIST::FUNCTION:
-EVP_ASYM_CIPHER_free                    4933	3_0_0	EXIST::FUNCTION:
-EVP_ASYM_CIPHER_up_ref                  4934	3_0_0	EXIST::FUNCTION:
-EVP_ASYM_CIPHER_get0_provider           4935	3_0_0	EXIST::FUNCTION:
-EVP_ASYM_CIPHER_fetch                   4936	3_0_0	EXIST::FUNCTION:
-EVP_ASYM_CIPHER_is_a                    4937	3_0_0	EXIST::FUNCTION:
-EVP_ASYM_CIPHER_do_all_provided         4938	3_0_0	EXIST::FUNCTION:
-EVP_ASYM_CIPHER_names_do_all            4939	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_rsa_padding            4940	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_rsa_padding            4941	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_rsa_mgf1_md            4942	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_rsa_mgf1_md_name       4943	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_rsa_mgf1_md            4944	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_rsa_oaep_md            4945	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_rsa_oaep_md_name       4946	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_rsa_oaep_md            4947	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set0_rsa_oaep_label        4948	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get0_rsa_oaep_label        4949	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_rsa_mgf1_md_name       4950	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_rsa_oaep_md_name       4951	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_meth_set_digestsign            4952	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_set_digestverify          4953	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_get_digestsign            4954	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_meth_get_digestverify          4955	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_ENCODER_up_ref                     4956	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_free                       4957	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_fetch                      4958	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_is_a                       4959	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_get0_provider              4960	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_do_all_provided            4961	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_names_do_all               4962	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_settable_ctx_params        4963	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_new                    4964	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_set_params             4965	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_free                   4966	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_get0_properties            4967	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_to_bio                     4968	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_to_fp                      4969	3_0_0	EXIST::FUNCTION:STDIO
-OSSL_ENCODER_CTX_new_for_pkey           4970	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_set_cipher             4971	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_set_passphrase         4972	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_set_pem_password_cb    4973	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_set_passphrase_ui      4974	3_0_0	EXIST::FUNCTION:
-PEM_read_X509_PUBKEY                    4975	3_0_0	EXIST::FUNCTION:STDIO
-PEM_write_X509_PUBKEY                   4976	3_0_0	EXIST::FUNCTION:STDIO
-PEM_read_bio_X509_PUBKEY                4977	3_0_0	EXIST::FUNCTION:
-PEM_write_bio_X509_PUBKEY               4978	3_0_0	EXIST::FUNCTION:
-d2i_X509_PUBKEY_fp                      4979	3_0_0	EXIST::FUNCTION:STDIO
-i2d_X509_PUBKEY_fp                      4980	3_0_0	EXIST::FUNCTION:STDIO
-d2i_X509_PUBKEY_bio                     4981	3_0_0	EXIST::FUNCTION:
-i2d_X509_PUBKEY_bio                     4982	3_0_0	EXIST::FUNCTION:
-RSA_get0_pss_params                     4983	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-X509_cmp_timeframe                      4984	3_0_0	EXIST::FUNCTION:
-OSSL_CMP_MSG_get0_header                4985	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_MSG_get_bodytype               4986	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_MSG_update_transactionID       4987	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_setup_CRM                  4988	3_0_0	EXIST::FUNCTION:CMP
-BIO_f_prefix                            4989	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_new_from_name              4990	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_new_from_pkey              4991	3_0_0	EXIST::FUNCTION:
-OSSL_SELF_TEST_set_callback             4992	3_0_0	EXIST::FUNCTION:
-OSSL_SELF_TEST_get_callback             4993	3_0_0	EXIST::FUNCTION:
-ASN1_TIME_dup                           4994	3_0_0	EXIST::FUNCTION:
-ASN1_UTCTIME_dup                        4995	3_0_0	EXIST::FUNCTION:
-ASN1_GENERALIZEDTIME_dup                4996	3_0_0	EXIST::FUNCTION:
-RAND_priv_bytes_ex                      4997	3_0_0	EXIST::FUNCTION:
-RAND_bytes_ex                           4998	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_default_digest_name        4999	3_0_0	EXIST::FUNCTION:
-CMS_decrypt_set1_pkey_and_peer          5000	3_0_0	EXIST::FUNCTION:CMS
-CMS_add1_recipient                      5001	3_0_0	EXIST::FUNCTION:CMS
-CMS_RecipientInfo_kari_set0_pkey_and_peer 5002	3_0_0	EXIST::FUNCTION:CMS
-PKCS8_pkey_add1_attr                    5003	3_0_0	EXIST::FUNCTION:
-PKCS8_pkey_add1_attr_by_OBJ             5004	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_private_check                  5005	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_pairwise_check                 5006	3_0_0	EXIST::FUNCTION:
-ASN1_item_verify_ctx                    5007	3_0_0	EXIST::FUNCTION:
-ASN1_item_sign_ex                       5008	3_0_0	EXIST::FUNCTION:
-ASN1_item_verify_ex                     5009	3_0_0	EXIST::FUNCTION:
-BIO_socket_wait                         5010	3_0_0	EXIST::FUNCTION:SOCK
-BIO_wait                                5011	3_0_0	EXIST::FUNCTION:
-BIO_do_connect_retry                    5012	3_0_0	EXIST::FUNCTION:
-OSSL_parse_url                          5013	3_0_0	EXIST::FUNCTION:
-OSSL_HTTP_adapt_proxy                   5014	3_0_0	EXIST::FUNCTION:HTTP
-OSSL_HTTP_REQ_CTX_get_resp_len          5015	3_0_0	EXIST::FUNCTION:HTTP
-OSSL_HTTP_REQ_CTX_set_expected          5016	3_0_0	EXIST::FUNCTION:HTTP
-OSSL_HTTP_is_alive                      5017	3_0_0	EXIST::FUNCTION:HTTP
-OSSL_HTTP_open                          5018	3_0_0	EXIST::FUNCTION:HTTP
-OSSL_HTTP_proxy_connect                 5019	3_0_0	EXIST::FUNCTION:HTTP
-OSSL_HTTP_set1_request                  5020	3_0_0	EXIST::FUNCTION:HTTP
-OSSL_HTTP_exchange                      5021	3_0_0	EXIST::FUNCTION:HTTP
-OSSL_HTTP_get                           5022	3_0_0	EXIST::FUNCTION:HTTP
-OSSL_HTTP_transfer                      5023	3_0_0	EXIST::FUNCTION:HTTP
-OSSL_HTTP_close                         5024	3_0_0	EXIST::FUNCTION:HTTP
-ASN1_item_i2d_mem_bio                   5025	3_0_0	EXIST::FUNCTION:
-ERR_add_error_txt                       5026	3_0_0	EXIST::FUNCTION:
-ERR_add_error_mem_bio                   5027	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_print_verify_cb          5028	3_0_0	EXIST::FUNCTION:
-X509_STORE_get1_all_certs               5029	3_0_0	EXIST::FUNCTION:
-OSSL_CMP_validate_msg                   5030	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_validate_cert_path             5031	3_0_0	EXIST::FUNCTION:CMP
-EVP_PKEY_CTX_set_ecdh_cofactor_mode     5032	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_ecdh_cofactor_mode     5033	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_ecdh_kdf_type          5034	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_ecdh_kdf_type          5035	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_ecdh_kdf_md            5036	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_ecdh_kdf_md            5037	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_ecdh_kdf_outlen        5038	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_ecdh_kdf_outlen        5039	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set0_ecdh_kdf_ukm          5040	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get0_ecdh_kdf_ukm          5041	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_CTX_set_rsa_pss_saltlen        5042	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_rsa_pss_saltlen        5043	3_0_0	EXIST::FUNCTION:
-d2i_ISSUER_SIGN_TOOL                    5044	3_0_0	EXIST::FUNCTION:
-i2d_ISSUER_SIGN_TOOL                    5045	3_0_0	EXIST::FUNCTION:
-ISSUER_SIGN_TOOL_free                   5046	3_0_0	EXIST::FUNCTION:
-ISSUER_SIGN_TOOL_new                    5047	3_0_0	EXIST::FUNCTION:
-ISSUER_SIGN_TOOL_it                     5048	3_0_0	EXIST::FUNCTION:
-OSSL_SELF_TEST_new                      5049	3_0_0	EXIST::FUNCTION:
-OSSL_SELF_TEST_free                     5050	3_0_0	EXIST::FUNCTION:
-OSSL_SELF_TEST_onbegin                  5051	3_0_0	EXIST::FUNCTION:
-OSSL_SELF_TEST_oncorrupt_byte           5052	3_0_0	EXIST::FUNCTION:
-OSSL_SELF_TEST_onend                    5053	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_set_default_search_path   5054	3_0_0	EXIST::FUNCTION:
-X509_digest_sig                         5055	3_0_0	EXIST::FUNCTION:
-OSSL_CMP_MSG_dup                        5056	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_dup                       5057	3_0_0	EXIST::FUNCTION:CMP
-d2i_OSSL_CMP_PKISI                      5058	3_0_0	EXIST::FUNCTION:CMP
-i2d_OSSL_CMP_PKISI                      5059	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_PKISI_free                     5060	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_PKISI_new                      5061	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_PKISI_it                       5062	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_PKISI_dup                      5063	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_snprint_PKIStatusInfo          5064	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_STATUSINFO_new                 5065	3_0_0	EXIST::FUNCTION:CMP
-d2i_OSSL_CMP_MSG_bio                    5066	3_0_0	EXIST::FUNCTION:CMP
-i2d_OSSL_CMP_MSG_bio                    5067	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_SRV_process_request            5068	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_server_perform             5069	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_SRV_CTX_new                    5070	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_SRV_CTX_free                   5071	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_SRV_CTX_init                   5072	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_SRV_CTX_get0_cmp_ctx           5073	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_SRV_CTX_get0_custom_ctx        5074	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_SRV_CTX_set_send_unprotected_errors 5075	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_SRV_CTX_set_accept_unprotected 5076	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_SRV_CTX_set_accept_raverified  5077	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_SRV_CTX_set_grant_implicit_confirm 5078	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_exec_certreq                   5079	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_try_certreq                    5080	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_certConf_cb                    5081	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_exec_RR_ses                    5082	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_exec_GENM_ses                  5083	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_MSG_http_perform               5084	3_0_0	EXIST::FUNCTION:CMP,HTTP
-OSSL_CMP_MSG_read                       5085	3_0_0	EXIST::FUNCTION:CMP
-OSSL_CMP_MSG_write                      5086	3_0_0	EXIST::FUNCTION:CMP
-EVP_PKEY_Q_keygen                       5087	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_generate                       5088	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_rsa_keygen_bits        5089	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_rsa_keygen_pubexp      5090	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_CTX_set1_rsa_keygen_pubexp     5091	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_rsa_keygen_primes      5092	3_0_0	EXIST::FUNCTION:
-NCONF_new_ex                            5093	3_0_0	EXIST::FUNCTION:
-CONF_modules_load_file_ex               5094	3_0_0	EXIST::FUNCTION:
-OSSL_LIB_CTX_load_config                5095	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_to_param                 5096	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_int                 5097	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_uint                5098	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_long                5099	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_ulong               5100	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_int32               5101	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_uint32              5102	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_int64               5103	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_uint64              5104	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_size_t              5105	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_double              5106	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_BN                  5107	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_BN_pad              5108	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_utf8_string         5109	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_utf8_ptr            5110	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_octet_string        5111	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_octet_ptr           5112	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_new                      5113	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_free                     5114	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_set_type_by_keymgmt            5115	3_0_0	EXIST::FUNCTION:
-OCSP_RESPID_set_by_key_ex               5116	3_0_0	EXIST::FUNCTION:OCSP
-OCSP_RESPID_match_ex                    5117	3_0_0	EXIST::FUNCTION:OCSP
-SRP_create_verifier_ex                  5118	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SRP_create_verifier_BN_ex               5119	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SRP_Calc_B_ex                           5120	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SRP_Calc_u_ex                           5121	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SRP_Calc_x_ex                           5122	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SRP_Calc_client_key_ex                  5123	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-EVP_PKEY_gettable_params                5124	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_int_param                  5125	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_size_t_param               5126	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_bn_param                   5127	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_utf8_string_param          5128	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_octet_string_param         5129	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_is_a                           5130	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_can_sign                       5131	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_new_ex                   5132	3_0_0	EXIST::FUNCTION:
-X509_STORE_CTX_verify                   5133	3_0_0	EXIST::FUNCTION:
-CT_POLICY_EVAL_CTX_new_ex               5134	3_0_0	EXIST::FUNCTION:CT
-CTLOG_new_ex                            5135	3_0_0	EXIST::FUNCTION:CT
-CTLOG_new_from_base64_ex                5136	3_0_0	EXIST::FUNCTION:CT
-CTLOG_STORE_new_ex                      5137	3_0_0	EXIST::FUNCTION:CT
-EVP_PKEY_set_ex_data                    5138	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_ex_data                    5139	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_group_name             5140	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_group_name             5141	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_ec_paramgen_curve_nid  5142	3_0_0	EXIST::FUNCTION:
-d2i_PrivateKey_ex                       5143	3_0_0	EXIST::FUNCTION:
-d2i_AutoPrivateKey_ex                   5144	3_0_0	EXIST::FUNCTION:
-d2i_PrivateKey_ex_fp                    5145	3_0_0	EXIST::FUNCTION:STDIO
-d2i_PrivateKey_ex_bio                   5146	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_PrivateKey_ex              5147	3_0_0	EXIST::FUNCTION:
-PEM_read_PrivateKey_ex                  5148	3_0_0	EXIST::FUNCTION:STDIO
-EVP_PKEY_CTX_set_dsa_paramgen_bits      5149	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dsa_paramgen_q_bits    5150	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dsa_paramgen_md_props  5151	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dsa_paramgen_gindex    5152	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dsa_paramgen_type      5153	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dsa_paramgen_seed      5154	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dsa_paramgen_md        5155	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dh_paramgen_type       5156	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dh_paramgen_gindex     5157	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dh_paramgen_seed       5158	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dh_paramgen_prime_len  5159	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dh_paramgen_subprime_len 5160	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dh_paramgen_generator  5161	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dh_nid                 5162	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dh_rfc5114             5163	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dhx_rfc5114            5164	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_get0_host             5165	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_get0_email            5166	3_0_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_get1_ip_asc           5167	3_0_0	EXIST::FUNCTION:
-X509_ALGOR_copy                         5168	3_0_0	EXIST::FUNCTION:
-X509_REQ_set0_signature                 5169	3_0_0	EXIST::FUNCTION:
-X509_REQ_set1_signature_algo            5170	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_modified                     5171	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_all_unmodified           5172	3_0_0	EXIST::FUNCTION:
-EVP_RAND_fetch                          5173	3_0_0	EXIST::FUNCTION:
-EVP_RAND_up_ref                         5174	3_0_0	EXIST::FUNCTION:
-EVP_RAND_free                           5175	3_0_0	EXIST::FUNCTION:
-EVP_RAND_get0_name                      5176	3_0_0	EXIST::FUNCTION:
-EVP_RAND_is_a                           5177	3_0_0	EXIST::FUNCTION:
-EVP_RAND_get0_provider                  5178	3_0_0	EXIST::FUNCTION:
-EVP_RAND_get_params                     5179	3_0_0	EXIST::FUNCTION:
-EVP_RAND_CTX_new                        5180	3_0_0	EXIST::FUNCTION:
-EVP_RAND_CTX_free                       5181	3_0_0	EXIST::FUNCTION:
-EVP_RAND_CTX_get0_rand                  5182	3_0_0	EXIST::FUNCTION:
-EVP_RAND_CTX_get_params                 5183	3_0_0	EXIST::FUNCTION:
-EVP_RAND_CTX_set_params                 5184	3_0_0	EXIST::FUNCTION:
-EVP_RAND_gettable_params                5185	3_0_0	EXIST::FUNCTION:
-EVP_RAND_gettable_ctx_params            5186	3_0_0	EXIST::FUNCTION:
-EVP_RAND_settable_ctx_params            5187	3_0_0	EXIST::FUNCTION:
-EVP_RAND_do_all_provided                5188	3_0_0	EXIST::FUNCTION:
-EVP_RAND_names_do_all                   5189	3_0_0	EXIST::FUNCTION:
-EVP_RAND_instantiate                    5190	3_0_0	EXIST::FUNCTION:
-EVP_RAND_uninstantiate                  5191	3_0_0	EXIST::FUNCTION:
-EVP_RAND_generate                       5192	3_0_0	EXIST::FUNCTION:
-EVP_RAND_reseed                         5193	3_0_0	EXIST::FUNCTION:
-EVP_RAND_nonce                          5194	3_0_0	EXIST::FUNCTION:
-EVP_RAND_enable_locking                 5195	3_0_0	EXIST::FUNCTION:
-EVP_RAND_verify_zeroization             5196	3_0_0	EXIST::FUNCTION:
-EVP_RAND_get_strength                   5197	3_0_0	EXIST::FUNCTION:
-EVP_RAND_get_state                      5198	3_0_0	EXIST::FUNCTION:
-EVP_default_properties_is_fips_enabled  5199	3_0_0	EXIST::FUNCTION:
-EVP_default_properties_enable_fips      5200	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_new_raw_private_key_ex         5201	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_new_raw_public_key_ex          5202	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_BLD_push_time_t              5203	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_construct_time_t             5204	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_time_t                   5205	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_set_time_t                   5206	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_attach                       5207	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_LOADER_set_attach            5208	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen 5209	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md 5210	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name 5211	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_do_all                    5212	3_0_0	EXIST::FUNCTION:
-EC_GROUP_get_field_type                 5213	3_0_0	EXIST::FUNCTION:EC
-X509_PUBKEY_eq                          5214	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_eq                             5215	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_parameters_eq                  5216	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_query_operation           5217	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_unquery_operation         5218	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_get0_provider_ctx         5219	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_get_capabilities          5220	3_0_0	EXIST::FUNCTION:
-EC_GROUP_new_by_curve_name_ex           5221	3_0_0	EXIST::FUNCTION:EC
-EC_KEY_new_ex                           5222	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EC_KEY_new_by_curve_name_ex             5223	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-OSSL_LIB_CTX_set0_default               5224	3_0_0	EXIST::FUNCTION:
-PEM_X509_INFO_read_bio_ex               5225	3_0_0	EXIST::FUNCTION:
-PEM_X509_INFO_read_ex                   5226	3_0_0	EXIST::FUNCTION:STDIO
-X509_REQ_verify_ex                      5227	3_0_0	EXIST::FUNCTION:
-X509_new_ex                             5228	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_ctrl_ex                     5229	3_0_0	EXIST::FUNCTION:
-X509_load_cert_file_ex                  5230	3_0_0	EXIST::FUNCTION:
-X509_load_cert_crl_file_ex              5231	3_0_0	EXIST::FUNCTION:
-X509_LOOKUP_by_subject_ex               5232	3_0_0	EXIST::FUNCTION:
-X509_STORE_load_file_ex                 5233	3_0_0	EXIST::FUNCTION:
-X509_STORE_load_store_ex                5234	3_0_0	EXIST::FUNCTION:
-X509_STORE_load_locations_ex            5235	3_0_0	EXIST::FUNCTION:
-X509_STORE_set_default_paths_ex         5236	3_0_0	EXIST::FUNCTION:
-X509_build_chain                        5237	3_0_0	EXIST::FUNCTION:
-X509V3_set_issuer_pkey                  5238	3_0_0	EXIST::FUNCTION:
-i2s_ASN1_UTF8STRING                     5239	3_0_0	EXIST::FUNCTION:
-s2i_ASN1_UTF8STRING                     5240	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_open_ex                      5241	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_fetch                      5242	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_up_ref                     5243	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_free                       5244	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_get0_provider              5245	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_get0_properties            5246	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_is_a                       5247	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_do_all_provided            5248	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_names_do_all               5249	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_settable_ctx_params        5250	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_new                    5251	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_set_params             5252	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_free                   5253	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_set_passphrase         5254	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_set_pem_password_cb    5255	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_set_passphrase_ui      5256	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_from_bio                   5257	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_from_fp                    5258	3_0_0	EXIST::FUNCTION:STDIO
-OSSL_DECODER_CTX_add_decoder            5259	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_add_extra              5260	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_get_num_decoders       5261	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_set_input_type         5262	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_export                     5263	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_INSTANCE_get_decoder       5264	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_INSTANCE_get_decoder_ctx   5265	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_gettable_params            5266	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_get_params                 5267	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_new_for_pkey           5268	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_set_construct          5269	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_set_construct_data     5270	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_set_cleanup            5271	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_get_construct          5272	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_get_construct_data     5273	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_get_cleanup            5274	3_0_0	EXIST::FUNCTION:
-RAND_get0_primary                       5275	3_0_0	EXIST::FUNCTION:
-RAND_get0_public                        5276	3_0_0	EXIST::FUNCTION:
-RAND_get0_private                       5277	3_0_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_get0_bag_obj             5278	3_0_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_get0_bag_type            5279	3_0_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_create_secret            5280	3_0_0	EXIST::FUNCTION:
-PKCS12_add1_attr_by_NID                 5281	3_0_0	EXIST::FUNCTION:
-PKCS12_add1_attr_by_txt                 5282	3_0_0	EXIST::FUNCTION:
-PKCS12_add_secret                       5283	3_0_0	EXIST::FUNCTION:
-SMIME_write_ASN1_ex                     5284	3_0_0	EXIST::FUNCTION:
-SMIME_read_ASN1_ex                      5285	3_0_0	EXIST::FUNCTION:
-CMS_ContentInfo_new_ex                  5286	3_0_0	EXIST::FUNCTION:CMS
-SMIME_read_CMS_ex                       5287	3_0_0	EXIST::FUNCTION:CMS
-CMS_sign_ex                             5288	3_0_0	EXIST::FUNCTION:CMS
-CMS_data_create_ex                      5289	3_0_0	EXIST::FUNCTION:CMS
-CMS_digest_create_ex                    5290	3_0_0	EXIST::FUNCTION:CMS
-CMS_EncryptedData_encrypt_ex            5291	3_0_0	EXIST::FUNCTION:CMS
-CMS_encrypt_ex                          5292	3_0_0	EXIST::FUNCTION:CMS
-CMS_EnvelopedData_create_ex             5293	3_0_0	EXIST::FUNCTION:CMS
-CMS_ReceiptRequest_create0_ex           5294	3_0_0	EXIST::FUNCTION:CMS
-EVP_SignFinal_ex                        5295	3_0_0	EXIST::FUNCTION:
-EVP_VerifyFinal_ex                      5296	3_0_0	EXIST::FUNCTION:
-EVP_DigestSignInit_ex                   5297	3_0_0	EXIST::FUNCTION:
-EVP_DigestVerifyInit_ex                 5298	3_0_0	EXIST::FUNCTION:
-PKCS7_new_ex                            5299	3_0_0	EXIST::FUNCTION:
-PKCS7_sign_ex                           5300	3_0_0	EXIST::FUNCTION:
-PKCS7_encrypt_ex                        5301	3_0_0	EXIST::FUNCTION:
-SMIME_read_PKCS7_ex                     5302	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_self_test                 5303	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_tls1_prf_md            5304	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set1_tls1_prf_secret       5305	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_add1_tls1_prf_seed         5306	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_hkdf_md                5307	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set1_hkdf_salt             5308	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set1_hkdf_key              5309	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_add1_hkdf_info             5310	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_hkdf_mode              5311	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set1_pbe_pass              5312	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set1_scrypt_salt           5313	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_scrypt_N               5314	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_scrypt_r               5315	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_scrypt_p               5316	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_scrypt_maxmem_bytes    5317	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dh_kdf_type            5318	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_dh_kdf_type            5319	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set0_dh_kdf_oid            5320	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get0_dh_kdf_oid            5321	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dh_kdf_md              5322	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_dh_kdf_md              5323	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_dh_kdf_outlen          5324	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_dh_kdf_outlen          5325	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set0_dh_kdf_ukm            5326	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get0_dh_kdf_ukm            5327	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_CIPHER_CTX_get_updated_iv           5328	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_get_original_iv          5329	3_0_0	EXIST::FUNCTION:
-EVP_KEYMGMT_gettable_params             5330	3_0_0	EXIST::FUNCTION:
-EVP_KEYMGMT_settable_params             5331	3_0_0	EXIST::FUNCTION:
-EVP_KEYMGMT_gen_settable_params         5332	3_0_0	EXIST::FUNCTION:
-EVP_SIGNATURE_gettable_ctx_params       5333	3_0_0	EXIST::FUNCTION:
-EVP_SIGNATURE_settable_ctx_params       5334	3_0_0	EXIST::FUNCTION:
-EVP_KEYEXCH_gettable_ctx_params         5335	3_0_0	EXIST::FUNCTION:
-EVP_KEYEXCH_settable_ctx_params         5336	3_0_0	EXIST::FUNCTION:
-d2i_PUBKEY_ex                           5337	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_new_PUBKEY              5338	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_get0_PUBKEY             5339	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_get1_PUBKEY             5340	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_PUBKEY_ex                  5341	3_0_0	EXIST::FUNCTION:
-PEM_read_PUBKEY_ex                      5342	3_0_0	EXIST::FUNCTION:STDIO
-PEM_read_bio_Parameters_ex              5343	3_0_0	EXIST::FUNCTION:
-EC_GROUP_new_from_params                5344	3_0_0	EXIST::FUNCTION:EC
-OSSL_STORE_LOADER_set_open_ex           5345	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-OSSL_STORE_LOADER_fetch                 5346	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_LOADER_up_ref                5347	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_LOADER_get0_provider         5348	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_LOADER_get0_properties       5349	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_LOADER_is_a                  5350	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_LOADER_do_all_provided       5351	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_LOADER_names_do_all          5352	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_utf8_string_ptr          5353	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_get_octet_string_ptr         5354	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_set_passphrase_cb      5355	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_mac_key                5356	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_new                     5357	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_INFO_get0_data               5358	3_0_0	EXIST::FUNCTION:
-asn1_d2i_read_bio                       5359	3_0_0	EXIST::FUNCTION:
-EVP_PKCS82PKEY_ex                       5360	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set1_id                    5361	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get1_id                    5362	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get1_id_len                5363	3_0_0	EXIST::FUNCTION:
-CMS_AuthEnvelopedData_create            5364	3_0_0	EXIST::FUNCTION:CMS
-CMS_AuthEnvelopedData_create_ex         5365	3_0_0	EXIST::FUNCTION:CMS
-EVP_PKEY_CTX_set_ec_param_enc           5366	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get0_type_name                 5367	3_0_0	EXIST::FUNCTION:
-EVP_KEYMGMT_get0_name                   5368	3_0_0	EXIST::FUNCTION:
-EC_KEY_decoded_from_explicit_params     5369	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
-EVP_KEM_free                            5370	3_0_0	EXIST::FUNCTION:
-EVP_KEM_up_ref                          5371	3_0_0	EXIST::FUNCTION:
-EVP_KEM_get0_provider                   5372	3_0_0	EXIST::FUNCTION:
-EVP_KEM_fetch                           5373	3_0_0	EXIST::FUNCTION:
-EVP_KEM_is_a                            5374	3_0_0	EXIST::FUNCTION:
-EVP_KEM_do_all_provided                 5375	3_0_0	EXIST::FUNCTION:
-EVP_KEM_names_do_all                    5376	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_encapsulate_init               5377	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_encapsulate                    5378	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_decapsulate_init               5379	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_decapsulate                    5380	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_kem_op                 5381	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_gettable_params            5382	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_get_params                 5383	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_set_output_type        5384	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_add_encoder            5385	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_add_extra              5386	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_get_num_encoders       5387	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_set_selection          5388	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_INSTANCE_get_encoder       5389	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_INSTANCE_get_encoder_ctx   5390	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_INSTANCE_get_output_type   5391	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_set_construct          5392	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_set_construct_data     5393	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_set_cleanup            5394	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_set_passphrase_cb      5395	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_type_names_do_all              5396	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_INSTANCE_get_input_type    5397	3_0_0	EXIST::FUNCTION:
-EVP_ASYM_CIPHER_gettable_ctx_params     5398	3_0_0	EXIST::FUNCTION:
-EVP_ASYM_CIPHER_settable_ctx_params     5399	3_0_0	EXIST::FUNCTION:
-EVP_KEM_gettable_ctx_params             5400	3_0_0	EXIST::FUNCTION:
-EVP_KEM_settable_ctx_params             5401	3_0_0	EXIST::FUNCTION:
-PKCS7_type_is_other                     5402	3_0_0	EXIST::FUNCTION:
-PKCS7_get_octet_string                  5403	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_from_data                  5404	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_to_data                    5405	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get0_libctx                5406	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get0_propq                 5407	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_set1_encoded_public_key        5408	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get1_encoded_public_key        5409	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_set_selection          5410	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_CTX_set_input_structure    5411	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_INSTANCE_get_input_structure 5412	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_CTX_set_output_structure   5413	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_INSTANCE_get_output_structure 5414	3_0_0	EXIST::FUNCTION:
-PEM_write_PrivateKey_ex                 5415	3_0_0	EXIST::FUNCTION:STDIO
-PEM_write_bio_PrivateKey_ex             5416	3_0_0	EXIST::FUNCTION:
-PEM_write_PUBKEY_ex                     5417	3_0_0	EXIST::FUNCTION:STDIO
-PEM_write_bio_PUBKEY_ex                 5418	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_group_name                 5419	3_0_0	EXIST::FUNCTION:
-CRYPTO_atomic_or                        5420	3_0_0	EXIST::FUNCTION:
-CRYPTO_atomic_load                      5421	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_rsa_pss_keygen_md      5422	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_rsa_pss_keygen_md_name 5423	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_settable_params                5424	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_set_params                     5425	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_set_int_param                  5426	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_set_size_t_param               5427	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_set_bn_param                   5428	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_set_utf8_string_param          5429	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_set_octet_string_param         5430	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_ec_point_conv_form         5431	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_field_type                 5432	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get_params                     5433	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_fromdata_init                  5434	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_fromdata_settable              5435	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_param_check_quick              5436	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_public_check_quick             5437	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_is_a                       5438	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_settable_params          5439	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_gettable_params          5440	3_0_0	EXIST::FUNCTION:
-EVP_KDF_CTX_gettable_params             5441	3_0_0	EXIST::FUNCTION:
-EVP_KDF_CTX_settable_params             5442	3_0_0	EXIST::FUNCTION:
-EVP_MAC_CTX_gettable_params             5443	3_0_0	EXIST::FUNCTION:
-EVP_MAC_CTX_settable_params             5444	3_0_0	EXIST::FUNCTION:
-EVP_RAND_CTX_gettable_params            5445	3_0_0	EXIST::FUNCTION:
-EVP_RAND_CTX_settable_params            5446	3_0_0	EXIST::FUNCTION:
-RAND_set_DRBG_type                      5447	3_0_0	EXIST::FUNCTION:
-RAND_set_seed_source_type               5448	3_0_0	EXIST::FUNCTION:
-BN_mod_exp_mont_consttime_x2            5449	3_0_0	EXIST::FUNCTION:
-BIO_f_readbuffer                        5450	3_0_0	EXIST::FUNCTION:
-OSSL_ESS_check_signing_certs            5451	3_0_0	EXIST::FUNCTION:
-OSSL_ESS_signing_cert_new_init          5452	3_0_0	EXIST::FUNCTION:
-OSSL_ESS_signing_cert_v2_new_init       5453	3_0_0	EXIST::FUNCTION:
-ESS_SIGNING_CERT_it                     5454	3_0_0	EXIST::FUNCTION:
-ESS_SIGNING_CERT_V2_it                  5455	3_0_0	EXIST::FUNCTION:
-EVP_Q_digest                            5456	3_0_0	EXIST::FUNCTION:
-EVP_DigestInit_ex2                      5457	3_0_0	EXIST::FUNCTION:
-EVP_EncryptInit_ex2                     5458	3_0_0	EXIST::FUNCTION:
-EVP_DecryptInit_ex2                     5459	3_0_0	EXIST::FUNCTION:
-EVP_CipherInit_ex2                      5460	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_sign_init_ex                   5461	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_verify_init_ex                 5462	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_verify_recover_init_ex         5463	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_encrypt_init_ex                5464	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_decrypt_init_ex                5465	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_derive_init_ex                 5466	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_print_public_fp                5467	3_0_0	EXIST::FUNCTION:STDIO
-EVP_PKEY_print_private_fp               5468	3_0_0	EXIST::FUNCTION:STDIO
-EVP_PKEY_print_params_fp                5469	3_0_0	EXIST::FUNCTION:STDIO
-TS_RESP_CTX_new_ex                      5470	3_0_0	EXIST::FUNCTION:TS
-X509_REQ_new_ex                         5471	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_dup                            5472	3_0_0	EXIST::FUNCTION:
-RSA_PSS_PARAMS_dup                      5473	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_derive_set_peer_ex             5474	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_get0_name                  5475	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_get0_name                  5476	3_0_0	EXIST::FUNCTION:
-OSSL_DECODER_get0_description           5477	3_0_0	EXIST::FUNCTION:
-OSSL_ENCODER_get0_description           5478	3_0_0	EXIST::FUNCTION:
-OSSL_STORE_LOADER_get0_description      5479	3_0_0	EXIST::FUNCTION:
-EVP_MD_get0_description                 5480	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_get0_description             5481	3_0_0	EXIST::FUNCTION:
-EVP_MAC_get0_description                5482	3_0_0	EXIST::FUNCTION:
-EVP_RAND_get0_description               5483	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get0_description               5484	3_0_0	EXIST::FUNCTION:
-EVP_KEYMGMT_get0_description            5485	3_0_0	EXIST::FUNCTION:
-EVP_SIGNATURE_get0_description          5486	3_0_0	EXIST::FUNCTION:
-EVP_ASYM_CIPHER_get0_description        5487	3_0_0	EXIST::FUNCTION:
-EVP_KEM_get0_description                5488	3_0_0	EXIST::FUNCTION:
-EVP_KEYEXCH_get0_description            5489	3_0_0	EXIST::FUNCTION:
-EVP_KDF_get0_description                5490	3_0_0	EXIST::FUNCTION:
-OPENSSL_sk_find_all                     5491	3_0_0	EXIST::FUNCTION:
-X509_CRL_new_ex                         5492	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_dup                          5493	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_merge                        5494	3_0_0	EXIST::FUNCTION:
-OSSL_PARAM_free                         5495	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_todata                         5496	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_export                         5497	3_0_0	EXIST::FUNCTION:
-EVP_MD_CTX_get0_md                      5498	3_0_0	EXIST::FUNCTION:
-EVP_MD_CTX_get1_md                      5499	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_get0_cipher              5500	3_0_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_get1_cipher              5501	3_0_0	EXIST::FUNCTION:
-OSSL_LIB_CTX_get0_global_default        5502	3_0_0	EXIST::FUNCTION:
-EVP_SIGNATURE_get0_name                 5503	3_0_0	EXIST::FUNCTION:
-EVP_ASYM_CIPHER_get0_name               5504	3_0_0	EXIST::FUNCTION:
-EVP_KEM_get0_name                       5505	3_0_0	EXIST::FUNCTION:
-EVP_KEYEXCH_get0_name                   5506	3_0_0	EXIST::FUNCTION:
-PKCS5_v2_PBE_keyivgen_ex                5507	3_0_0	EXIST::FUNCTION:
-EVP_PBE_scrypt_ex                       5508	3_0_0	EXIST::FUNCTION:SCRYPT
-PKCS5_v2_scrypt_keyivgen_ex             5509	3_0_0	EXIST::FUNCTION:SCRYPT
-EVP_PBE_CipherInit_ex                   5510	3_0_0	EXIST::FUNCTION:
-EVP_PBE_find_ex                         5511	3_0_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_create_pkcs8_encrypt_ex  5512	3_0_0	EXIST::FUNCTION:
-PKCS8_decrypt_ex                        5513	3_0_0	EXIST::FUNCTION:
-PKCS12_decrypt_skey_ex                  5514	3_0_0	EXIST::FUNCTION:
-PKCS8_encrypt_ex                        5515	3_0_0	EXIST::FUNCTION:
-PKCS8_set0_pbe_ex                       5516	3_0_0	EXIST::FUNCTION:
-PKCS12_pack_p7encdata_ex                5517	3_0_0	EXIST::FUNCTION:
-PKCS12_pbe_crypt_ex                     5518	3_0_0	EXIST::FUNCTION:
-PKCS12_item_decrypt_d2i_ex              5519	3_0_0	EXIST::FUNCTION:
-PKCS12_item_i2d_encrypt_ex              5520	3_0_0	EXIST::FUNCTION:
-PKCS12_init_ex                          5521	3_0_0	EXIST::FUNCTION:
-PKCS12_key_gen_asc_ex                   5522	3_0_0	EXIST::FUNCTION:
-PKCS12_key_gen_uni_ex                   5523	3_0_0	EXIST::FUNCTION:
-PKCS12_key_gen_utf8_ex                  5524	3_0_0	EXIST::FUNCTION:
-PKCS12_PBE_keyivgen_ex                  5525	3_0_0	EXIST::FUNCTION:
-PKCS12_create_ex                        5526	3_0_0	EXIST::FUNCTION:
-PKCS12_add_key_ex                       5527	3_0_0	EXIST::FUNCTION:
-PKCS12_add_safe_ex                      5528	3_0_0	EXIST::FUNCTION:
-PKCS12_add_safes_ex                     5529	3_0_0	EXIST::FUNCTION:
-PKCS5_pbe_set0_algor_ex                 5530	3_0_0	EXIST::FUNCTION:
-PKCS5_pbe_set_ex                        5531	3_0_0	EXIST::FUNCTION:
-PKCS5_pbe2_set_iv_ex                    5532	3_0_0	EXIST::FUNCTION:
-PKCS5_pbkdf2_set_ex                     5533	3_0_0	EXIST::FUNCTION:
-BIO_new_from_core_bio                   5534	3_0_0	EXIST::FUNCTION:
-BIO_new_ex                              5535	3_0_0	EXIST::FUNCTION:
-BIO_s_core                              5536	3_0_0	EXIST::FUNCTION:
-BIO_get_line                            5537	3_0_0	EXIST::FUNCTION:
-OSSL_LIB_CTX_new_from_dispatch          5538	3_0_0	EXIST::FUNCTION:
-OSSL_LIB_CTX_new_child                  5539	3_0_0	EXIST::FUNCTION:
-OSSL_PROVIDER_get0_dispatch             5540	3_0_0	EXIST::FUNCTION:
-PKCS5_PBE_keyivgen_ex                   5541	3_0_0	EXIST::FUNCTION:
-EVP_MAC_CTX_get_block_size              5542	3_0_0	EXIST::FUNCTION:
-BIO_debug_callback_ex                   5543	3_0_0	EXIST::FUNCTION:
-b2i_PVK_bio_ex                          5544	3_0_0	EXIST::FUNCTION:
-i2b_PVK_bio_ex                          5545	3_0_0	EXIST::FUNCTION:
-NCONF_get0_libctx                       5546	3_0_0	EXIST::FUNCTION:
-NCONF_get_section_names                 5547	3_0_0	EXIST::FUNCTION:
-X509_PUBKEY_new_ex                      5548	3_0_0	EXIST::FUNCTION:
-ASN1_item_new_ex                        5549	3_0_0	EXIST::FUNCTION:
-ASN1_item_d2i_fp_ex                     5550	3_0_0	EXIST::FUNCTION:STDIO
-ASN1_item_d2i_bio_ex                    5551	3_0_0	EXIST::FUNCTION:
-ASN1_item_d2i_ex                        5552	3_0_0	EXIST::FUNCTION:
-ASN1_TIME_print_ex                      5553	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_get0_provider                  5554	3_0_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get0_provider              5555	3_0_0	EXIST::FUNCTION:
-OPENSSL_strcasecmp                      5556	3_0_3	EXIST::FUNCTION:
-OPENSSL_strncasecmp                     5557	3_0_3	EXIST::FUNCTION:
-EVP_RAND_CTX_up_ref                     5558	3_1_0	EXIST::FUNCTION:
-RAND_set0_public                        5559	3_1_0	EXIST::FUNCTION:
-RAND_set0_private                       5560	3_1_0	EXIST::FUNCTION:
-BN_are_coprime                          5561	3_1_0	EXIST::FUNCTION:
-X509_PUBKEY_set0_public_key             5562	3_2_0	EXIST::FUNCTION:
-OSSL_STACK_OF_X509_free                 5563	3_2_0	EXIST::FUNCTION:
-OSSL_trace_string                       5564	3_2_0	EXIST::FUNCTION:
-EVP_MD_CTX_dup                          5565	3_2_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_dup                      5566	3_2_0	EXIST::FUNCTION:
-BN_signed_bin2bn                        5567	3_2_0	EXIST::FUNCTION:
-BN_signed_bn2bin                        5568	3_2_0	EXIST::FUNCTION:
-BN_signed_lebin2bn                      5569	3_2_0	EXIST::FUNCTION:
-BN_signed_bn2lebin                      5570	3_2_0	EXIST::FUNCTION:
-BN_signed_native2bn                     5571	3_2_0	EXIST::FUNCTION:
-BN_signed_bn2native                     5572	3_2_0	EXIST::FUNCTION:
-ASYNC_set_mem_functions                 5573	3_2_0	EXIST::FUNCTION:
-ASYNC_get_mem_functions                 5574	3_2_0	EXIST::FUNCTION:
-BIO_ADDR_dup                            5575	3_2_0	EXIST::FUNCTION:SOCK
-OSSL_CMP_ITAV_new_caCerts               5576	3_2_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_get0_caCerts              5577	3_2_0	EXIST::FUNCTION:CMP
-OSSL_CMP_get1_caCerts                   5578	3_2_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_new_rootCaCert            5579	3_2_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_get0_rootCaCert           5580	3_2_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_new_rootCaKeyUpdate       5581	3_2_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_get0_rootCaKeyUpdate      5582	3_2_0	EXIST::FUNCTION:CMP
-OSSL_CMP_get1_rootCaKeyUpdate           5583	3_2_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get0_libctx                5584	3_2_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get0_propq                 5585	3_2_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_reset_geninfo_ITAVs        5586	3_0_8	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_get0_validatedSrvCert      5587	3_2_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CTX_set1_serialNumber          5588	3_2_0	EXIST::FUNCTION:CMP
-OSSL_CMP_MSG_update_recipNonce          5589	3_0_9	EXIST::FUNCTION:CMP
-OSSL_CRMF_CERTTEMPLATE_get0_publicKey   5590	3_2_0	EXIST::FUNCTION:CRMF
-CMS_final_digest                        5591	3_2_0	EXIST::FUNCTION:CMS
-CMS_EnvelopedData_it                    5592	3_2_0	EXIST::FUNCTION:CMS
-CMS_EnvelopedData_decrypt               5593	3_2_0	EXIST::FUNCTION:CMS
-CMS_SignedData_free                     5594	3_2_0	EXIST::FUNCTION:CMS
-CMS_SignedData_new                      5595	3_2_0	EXIST::FUNCTION:CMS
-CMS_SignedData_verify                   5596	3_2_0	EXIST::FUNCTION:CMS
-BIO_s_dgram_mem                         5597	3_2_0	EXIST::FUNCTION:DGRAM
-BIO_recvmmsg                            5598	3_2_0	EXIST::FUNCTION:
-BIO_sendmmsg                            5599	3_2_0	EXIST::FUNCTION:
-BIO_meth_set_sendmmsg                   5600	3_2_0	EXIST::FUNCTION:
-BIO_meth_get_sendmmsg                   5601	3_2_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
-BIO_meth_set_recvmmsg                   5602	3_2_0	EXIST::FUNCTION:
-BIO_meth_get_recvmmsg                   5603	3_2_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
-BIO_err_is_non_fatal                    5604	3_2_0	EXIST::FUNCTION:SOCK
-BIO_s_dgram_pair                        5605	3_2_0	EXIST::FUNCTION:DGRAM
-BIO_new_bio_dgram_pair                  5606	3_2_0	EXIST::FUNCTION:DGRAM
-EVP_PKEY_auth_encapsulate_init          5607	3_2_0	EXIST::FUNCTION:
-EVP_PKEY_auth_decapsulate_init          5608	3_2_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_set0_attrs               5609	3_2_0	EXIST::FUNCTION:
-PKCS12_create_ex2                       5610	3_2_0	EXIST::FUNCTION:
-OSSL_sleep                              5611	3_2_0	EXIST::FUNCTION:
-OSSL_get_thread_support_flags           5612	3_2_0	EXIST::FUNCTION:
-OSSL_set_max_threads                    5613	3_2_0	EXIST::FUNCTION:
-OSSL_get_max_threads                    5614	3_2_0	EXIST::FUNCTION:
-COMP_brotli                             5615	3_2_0	EXIST::FUNCTION:COMP
-COMP_brotli_oneshot                     5616	3_2_0	EXIST::FUNCTION:COMP
-BIO_f_brotli                            5617	3_2_0	EXIST::FUNCTION:COMP
-COMP_zstd                               5618	3_2_0	EXIST::FUNCTION:COMP
-COMP_zstd_oneshot                       5619	3_2_0	EXIST::FUNCTION:COMP
-BIO_f_zstd                              5620	3_2_0	EXIST::FUNCTION:COMP
-d2i_PUBKEY_ex_fp                        5621	3_2_0	EXIST::FUNCTION:STDIO
-d2i_PUBKEY_ex_bio                       5622	3_2_0	EXIST::FUNCTION:
-COMP_zlib_oneshot                       5623	3_2_0	EXIST::FUNCTION:COMP
-OSSL_HPKE_keygen                        5624	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_suite_check                   5625	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_get_grease_value              5626	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_str2suite                     5627	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_CTX_free                      5628	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_CTX_new                       5629	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_CTX_set1_authpriv             5630	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_CTX_set1_authpub              5631	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_CTX_set1_psk                  5632	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_CTX_set1_ikme                 5633	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_get_ciphertext_size           5634	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_get_public_encap_size         5635	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_export                        5636	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_encap                         5637	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_decap                         5638	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_seal                          5639	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_open                          5640	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_CTX_get_seq                   5641	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_CTX_set_seq                   5642	3_2_0	EXIST::FUNCTION:
-OSSL_HPKE_get_recommended_ikmelen       5643	3_2_0	EXIST::FUNCTION:
-OSSL_PROVIDER_get0_default_search_path  5644	3_2_0	EXIST::FUNCTION:
-BIO_get_rpoll_descriptor                5645	3_2_0	EXIST::FUNCTION:
-BIO_get_wpoll_descriptor                5646	3_2_0	EXIST::FUNCTION:
-ASN1_item_unpack_ex                     5647	3_2_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_get1_cert_ex             5648	3_2_0	EXIST::FUNCTION:
-PKCS12_SAFEBAG_get1_crl_ex              5649	3_2_0	EXIST::FUNCTION:
-EC_GROUP_to_params                      5650	3_2_0	EXIST::FUNCTION:EC
-X509_STORE_CTX_init_rpk                 5651	3_2_0	EXIST::FUNCTION:
-X509_STORE_CTX_get0_rpk                 5652	3_2_0	EXIST::FUNCTION:
-X509_STORE_CTX_set0_rpk                 5653	3_2_0	EXIST::FUNCTION:
-CRYPTO_atomic_load_int                  5654	3_2_0	EXIST::FUNCTION:
-OSSL_ERR_STATE_new                      5655	3_2_0	EXIST::FUNCTION:
-OSSL_ERR_STATE_save                     5656	3_2_0	EXIST::FUNCTION:
-OSSL_ERR_STATE_restore                  5657	3_2_0	EXIST::FUNCTION:
-OSSL_ERR_STATE_free                     5658	3_2_0	EXIST::FUNCTION:
-ERR_count_to_mark                       5659	3_2_0	EXIST::FUNCTION:
-OSSL_PROVIDER_load_ex                   5660	3_2_0	EXIST::FUNCTION:
-OSSL_PROVIDER_try_load_ex               5661	3_2_0	EXIST::FUNCTION:
-OSSL_ERR_STATE_save_to_mark             5662	3_2_0	EXIST::FUNCTION:
-X509_STORE_CTX_set_get_crl              5663	3_2_0	EXIST::FUNCTION:
-X509_STORE_CTX_set_current_reasons      5664	3_2_0	EXIST::FUNCTION:
-OSSL_STORE_delete                       5665	3_2_0	EXIST::FUNCTION:
-BIO_ADDR_copy                           5666	3_2_0	EXIST::FUNCTION:SOCK
-OSSL_CMP_CTX_get0_geninfo_ITAVs         5667	3_3_0	EXIST::FUNCTION:CMP
-OSSL_CMP_HDR_get0_geninfo_ITAVs         5668	3_3_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_new0_certProfile          5669	3_3_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_get0_certProfile          5670	3_3_0	EXIST::FUNCTION:CMP
-OSSL_CMP_MSG_get0_certreq_publickey     5671	3_3_0	EXIST::FUNCTION:CMP
-OSSL_CMP_SRV_CTX_init_trans             5672	3_3_0	EXIST::FUNCTION:CMP
-EVP_DigestSqueeze                       5673	3_3_0	EXIST::FUNCTION:
-ERR_pop                                 5674	3_3_0	EXIST::FUNCTION:
-X509_STORE_get1_objects                 5675	3_3_0	EXIST::FUNCTION:
-OPENSSL_LH_set_thunks                   5676	3_3_0	EXIST::FUNCTION:
-OPENSSL_LH_doall_arg_thunk              5677	3_3_0	EXIST::FUNCTION:
-OSSL_HTTP_REQ_CTX_set_max_response_hdr_lines 5678	3_3_0	EXIST::FUNCTION:HTTP
-DIST_POINT_NAME_dup                     5679	3_4_0	EXIST::FUNCTION:
-GENERAL_NAME_set1_X509_NAME             5680	3_4_0	EXIST::FUNCTION:
-OSSL_CMP_CRLSTATUS_create               5681	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CRLSTATUS_free                 5682	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CRLSTATUS_get0                 5683	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_CRLSTATUS_new1                 5684	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_get0_crlStatusList        5685	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_get0_crls                 5686	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_new0_crlStatusList        5687	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_new_crls                  5688	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_get1_crlUpdate                 5689	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_new0_certReqTemplate      5690	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ITAV_get1_certReqTemplate      5691	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ATAV_create                    5692	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ATAV_set0                      5693	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ATAV_get0_type                 5694	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ATAV_get0_value                5695	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ATAV_new_algId                 5696	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ATAV_get0_algId                5697	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ATAV_new_rsaKeyLen             5698	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ATAV_get_rsaKeyLen             5699	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ATAV_push1                     5700	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_get1_certReqTemplate           5701	3_4_0	EXIST::FUNCTION:CMP
-d2i_OSSL_CMP_ATAVS                      5702	3_4_0	EXIST::FUNCTION:CMP
-i2d_OSSL_CMP_ATAVS                      5703	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ATAVS_free                     5704	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ATAVS_new                      5705	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CMP_ATAVS_it                       5706	3_4_0	EXIST::FUNCTION:CMP
-OSSL_CRMF_ATTRIBUTETYPEANDVALUE_free    5707	3_4_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_ATTRIBUTETYPEANDVALUE_dup     5708	3_4_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_CERTTEMPLATE_dup              5709	3_4_0	EXIST::FUNCTION:CRMF
-CRYPTO_atomic_store                     5710	3_4_0	EXIST::FUNCTION:
-CRYPTO_aligned_alloc                    5711	3_4_0	EXIST::FUNCTION:
-d2i_X509_ACERT                          5712	3_4_0	EXIST::FUNCTION:
-i2d_X509_ACERT                          5713	3_4_0	EXIST::FUNCTION:
-X509_ACERT_free                         5714	3_4_0	EXIST::FUNCTION:
-X509_ACERT_new                          5715	3_4_0	EXIST::FUNCTION:
-X509_ACERT_it                           5716	3_4_0	EXIST::FUNCTION:
-X509_ACERT_dup                          5717	3_4_0	EXIST::FUNCTION:
-X509_ACERT_INFO_it                      5718	3_4_0	EXIST::FUNCTION:
-X509_ACERT_INFO_free                    5719	3_4_0	EXIST::FUNCTION:
-X509_ACERT_INFO_new                     5720	3_4_0	EXIST::FUNCTION:
-OSSL_OBJECT_DIGEST_INFO_free            5721	3_4_0	EXIST::FUNCTION:
-OSSL_OBJECT_DIGEST_INFO_new             5722	3_4_0	EXIST::FUNCTION:
-OSSL_ISSUER_SERIAL_free                 5723	3_4_0	EXIST::FUNCTION:
-OSSL_ISSUER_SERIAL_new                  5724	3_4_0	EXIST::FUNCTION:
-X509_ACERT_ISSUER_V2FORM_free           5725	3_4_0	EXIST::FUNCTION:
-X509_ACERT_ISSUER_V2FORM_new            5726	3_4_0	EXIST::FUNCTION:
-d2i_X509_ACERT_fp                       5727	3_4_0	EXIST::FUNCTION:STDIO
-i2d_X509_ACERT_fp                       5728	3_4_0	EXIST::FUNCTION:STDIO
-PEM_read_X509_ACERT                     5729	3_4_0	EXIST::FUNCTION:STDIO
-PEM_write_X509_ACERT                    5730	3_4_0	EXIST::FUNCTION:STDIO
-PEM_read_bio_X509_ACERT                 5731	3_4_0	EXIST::FUNCTION:
-PEM_write_bio_X509_ACERT                5732	3_4_0	EXIST::FUNCTION:
-d2i_X509_ACERT_bio                      5733	3_4_0	EXIST::FUNCTION:
-i2d_X509_ACERT_bio                      5734	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get0_holder_entityName       5735	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get0_holder_baseCertId       5736	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get0_holder_digest           5737	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get0_issuerName              5738	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get_version                  5739	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get0_signature               5740	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get_signature_nid            5741	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get0_info_sigalg             5742	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get0_serialNumber            5743	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get0_notBefore               5744	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get0_notAfter                5745	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get0_issuerUID               5746	3_4_0	EXIST::FUNCTION:
-X509_ACERT_set_version                  5747	3_4_0	EXIST::FUNCTION:
-X509_ACERT_set0_holder_entityName       5748	3_4_0	EXIST::FUNCTION:
-X509_ACERT_set0_holder_baseCertId       5749	3_4_0	EXIST::FUNCTION:
-X509_ACERT_set0_holder_digest           5750	3_4_0	EXIST::FUNCTION:
-X509_ACERT_set1_issuerName              5751	3_4_0	EXIST::FUNCTION:
-X509_ACERT_set1_serialNumber            5752	3_4_0	EXIST::FUNCTION:
-X509_ACERT_set1_notBefore               5753	3_4_0	EXIST::FUNCTION:
-X509_ACERT_set1_notAfter                5754	3_4_0	EXIST::FUNCTION:
-OSSL_OBJECT_DIGEST_INFO_get0_digest     5755	3_4_0	EXIST::FUNCTION:
-OSSL_OBJECT_DIGEST_INFO_set1_digest     5756	3_4_0	EXIST::FUNCTION:
-OSSL_ISSUER_SERIAL_get0_issuer          5757	3_4_0	EXIST::FUNCTION:
-OSSL_ISSUER_SERIAL_get0_serial          5758	3_4_0	EXIST::FUNCTION:
-OSSL_ISSUER_SERIAL_get0_issuerUID       5759	3_4_0	EXIST::FUNCTION:
-OSSL_ISSUER_SERIAL_set1_issuer          5760	3_4_0	EXIST::FUNCTION:
-OSSL_ISSUER_SERIAL_set1_serial          5761	3_4_0	EXIST::FUNCTION:
-OSSL_ISSUER_SERIAL_set1_issuerUID       5762	3_4_0	EXIST::FUNCTION:
-X509_ACERT_print                        5763	3_4_0	EXIST::FUNCTION:
-X509_ACERT_print_ex                     5764	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get_attr_count               5765	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get_attr_by_NID              5766	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get_attr_by_OBJ              5767	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get_attr                     5768	3_4_0	EXIST::FUNCTION:
-X509_ACERT_delete_attr                  5769	3_4_0	EXIST::FUNCTION:
-X509_ACERT_add1_attr                    5770	3_4_0	EXIST::FUNCTION:
-X509_ACERT_add1_attr_by_OBJ             5771	3_4_0	EXIST::FUNCTION:
-X509_ACERT_add1_attr_by_NID             5772	3_4_0	EXIST::FUNCTION:
-X509_ACERT_add1_attr_by_txt             5773	3_4_0	EXIST::FUNCTION:
-X509_ACERT_sign                         5774	3_4_0	EXIST::FUNCTION:
-X509_ACERT_sign_ctx                     5775	3_4_0	EXIST::FUNCTION:
-X509_ACERT_verify                       5776	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get_ext_d2i                  5777	3_4_0	EXIST::FUNCTION:
-X509_ACERT_add1_ext_i2d                 5778	3_4_0	EXIST::FUNCTION:
-X509_ACERT_get0_extensions              5779	3_4_0	EXIST::FUNCTION:
-X509v3_add_extensions                   5780	3_4_0	EXIST::FUNCTION:
-OSSL_IETF_ATTR_SYNTAX_VALUE_it          5781	3_4_0	EXIST::FUNCTION:
-OSSL_IETF_ATTR_SYNTAX_VALUE_free        5782	3_4_0	EXIST::FUNCTION:
-OSSL_IETF_ATTR_SYNTAX_VALUE_new         5783	3_4_0	EXIST::FUNCTION:
-d2i_OSSL_IETF_ATTR_SYNTAX               5784	3_4_0	EXIST::FUNCTION:
-i2d_OSSL_IETF_ATTR_SYNTAX               5785	3_4_0	EXIST::FUNCTION:
-OSSL_IETF_ATTR_SYNTAX_free              5786	3_4_0	EXIST::FUNCTION:
-OSSL_IETF_ATTR_SYNTAX_new               5787	3_4_0	EXIST::FUNCTION:
-OSSL_IETF_ATTR_SYNTAX_it                5788	3_4_0	EXIST::FUNCTION:
-OSSL_IETF_ATTR_SYNTAX_get0_policyAuthority 5789	3_4_0	EXIST::FUNCTION:
-OSSL_IETF_ATTR_SYNTAX_set0_policyAuthority 5790	3_4_0	EXIST::FUNCTION:
-OSSL_IETF_ATTR_SYNTAX_get_value_num     5791	3_4_0	EXIST::FUNCTION:
-OSSL_IETF_ATTR_SYNTAX_get0_value        5792	3_4_0	EXIST::FUNCTION:
-OSSL_IETF_ATTR_SYNTAX_add1_value        5793	3_4_0	EXIST::FUNCTION:
-OSSL_IETF_ATTR_SYNTAX_print             5794	3_4_0	EXIST::FUNCTION:
-PKCS12_set_pbmac1_pbkdf2                5795	3_4_0	EXIST::FUNCTION:
-PBMAC1_get1_pbkdf2_param                5796	3_4_0	EXIST::FUNCTION:
-d2i_PBMAC1PARAM                         5797	3_4_0	EXIST::FUNCTION:
-i2d_PBMAC1PARAM                         5798	3_4_0	EXIST::FUNCTION:
-PBMAC1PARAM_free                        5799	3_4_0	EXIST::FUNCTION:
-PBMAC1PARAM_new                         5800	3_4_0	EXIST::FUNCTION:
-PBMAC1PARAM_it                          5801	3_4_0	EXIST::FUNCTION:
-X509_ACERT_add_attr_nconf               5802	3_4_0	EXIST::FUNCTION:
-OSSL_LIB_CTX_get_conf_diagnostics       5803	3_4_0	EXIST::FUNCTION:
-OSSL_LIB_CTX_set_conf_diagnostics       5804	3_4_0	EXIST::FUNCTION:
-OSSL_LIB_CTX_get_data                   5805	3_4_0	EXIST::FUNCTION:
-d2i_OSSL_TARGET                         5806	3_4_0	EXIST::FUNCTION:
-i2d_OSSL_TARGET                         5807	3_4_0	EXIST::FUNCTION:
-OSSL_TARGET_free                        5808	3_4_0	EXIST::FUNCTION:
-OSSL_TARGET_new                         5809	3_4_0	EXIST::FUNCTION:
-OSSL_TARGET_it                          5810	3_4_0	EXIST::FUNCTION:
-d2i_OSSL_TARGETS                        5811	3_4_0	EXIST::FUNCTION:
-i2d_OSSL_TARGETS                        5812	3_4_0	EXIST::FUNCTION:
-OSSL_TARGETS_free                       5813	3_4_0	EXIST::FUNCTION:
-OSSL_TARGETS_new                        5814	3_4_0	EXIST::FUNCTION:
-OSSL_TARGETS_it                         5815	3_4_0	EXIST::FUNCTION:
-d2i_OSSL_TARGETING_INFORMATION          5816	3_4_0	EXIST::FUNCTION:
-i2d_OSSL_TARGETING_INFORMATION          5817	3_4_0	EXIST::FUNCTION:
-OSSL_TARGETING_INFORMATION_free         5818	3_4_0	EXIST::FUNCTION:
-OSSL_TARGETING_INFORMATION_new          5819	3_4_0	EXIST::FUNCTION:
-OSSL_TARGETING_INFORMATION_it           5820	3_4_0	EXIST::FUNCTION:
-OSSL_GENERAL_NAMES_print                5821	3_4_0	EXIST::FUNCTION:
-TS_VERIFY_CTX_set0_data                 5822	3_4_0	EXIST::FUNCTION:TS
-TS_VERIFY_CTX_set0_imprint              5823	3_4_0	EXIST::FUNCTION:TS
-TS_VERIFY_CTX_set0_store                5824	3_4_0	EXIST::FUNCTION:TS
-TS_VERIFY_CTX_set0_certs                5825	3_4_0	EXIST::FUNCTION:TS
-CRYPTO_atomic_add64                     5826	3_4_0	EXIST::FUNCTION:
-CRYPTO_atomic_and                       5827	3_4_0	EXIST::FUNCTION:
-d2i_OSSL_ATTRIBUTES_SYNTAX              5828	3_4_0	EXIST::FUNCTION:
-i2d_OSSL_ATTRIBUTES_SYNTAX              5829	3_4_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTES_SYNTAX_free             5830	3_4_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTES_SYNTAX_new              5831	3_4_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTES_SYNTAX_it               5832	3_4_0	EXIST::FUNCTION:
-d2i_OSSL_USER_NOTICE_SYNTAX             5833	3_4_0	EXIST::FUNCTION:
-i2d_OSSL_USER_NOTICE_SYNTAX             5834	3_4_0	EXIST::FUNCTION:
-OSSL_USER_NOTICE_SYNTAX_free            5835	3_4_0	EXIST::FUNCTION:
-OSSL_USER_NOTICE_SYNTAX_new             5836	3_4_0	EXIST::FUNCTION:
-OSSL_USER_NOTICE_SYNTAX_it              5837	3_4_0	EXIST::FUNCTION:
-OSSL_INDICATOR_set_callback             5838	3_4_0	EXIST::FUNCTION:
-OSSL_INDICATOR_get_callback             5839	3_4_0	EXIST::FUNCTION:
-OPENSSL_strtoul                         5840	3_4_0	EXIST::FUNCTION:
-d2i_OSSL_BASIC_ATTR_CONSTRAINTS         5841	3_4_0	EXIST::FUNCTION:
-i2d_OSSL_BASIC_ATTR_CONSTRAINTS         5842	3_4_0	EXIST::FUNCTION:
-OSSL_BASIC_ATTR_CONSTRAINTS_free        5843	3_4_0	EXIST::FUNCTION:
-OSSL_BASIC_ATTR_CONSTRAINTS_new         5844	3_4_0	EXIST::FUNCTION:
-OSSL_BASIC_ATTR_CONSTRAINTS_it          5845	3_4_0	EXIST::FUNCTION:
-EVP_KEYMGMT_gen_gettable_params         5846	3_4_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_signature              5847	3_4_0	EXIST::FUNCTION:
-EVP_PKEY_sign_init_ex2                  5848	3_4_0	EXIST::FUNCTION:
-EVP_PKEY_sign_message_init              5849	3_4_0	EXIST::FUNCTION:
-EVP_PKEY_sign_message_update            5850	3_4_0	EXIST::FUNCTION:
-EVP_PKEY_sign_message_final             5851	3_4_0	EXIST::FUNCTION:
-EVP_PKEY_verify_init_ex2                5852	3_4_0	EXIST::FUNCTION:
-EVP_PKEY_verify_message_init            5853	3_4_0	EXIST::FUNCTION:
-EVP_PKEY_verify_message_update          5854	3_4_0	EXIST::FUNCTION:
-EVP_PKEY_verify_message_final           5855	3_4_0	EXIST::FUNCTION:
-EVP_PKEY_verify_recover_init_ex2        5856	3_4_0	EXIST::FUNCTION:
-EVP_MD_xof                              5857	3_4_0	EXIST::FUNCTION:
-EVP_MD_CTX_get_size_ex                  5858	3_4_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_set_algor_params         5859	3_4_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_get_algor_params         5860	3_4_0	EXIST::FUNCTION:
-EVP_CIPHER_CTX_get_algor                5861	3_4_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_set_algor_params           5862	3_4_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_algor_params           5863	3_4_0	EXIST::FUNCTION:
-EVP_PKEY_CTX_get_algor                  5864	3_4_0	EXIST::FUNCTION:
-X509_VERIFY_PARAM_get_purpose           5865	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_CRMF_ENCRYPTEDKEY              5866	3_5_0	EXIST::FUNCTION:CRMF
-i2d_OSSL_CRMF_ENCRYPTEDKEY              5867	3_5_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_ENCRYPTEDKEY_free             5868	3_5_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_ENCRYPTEDKEY_new              5869	3_5_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_ENCRYPTEDKEY_it               5870	3_5_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_ENCRYPTEDKEY_get1_encCert     5871	3_5_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_ENCRYPTEDVALUE_decrypt        5872	3_5_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_ENCRYPTEDKEY_get1_pkey        5873	3_5_0	EXIST::FUNCTION:CRMF
-OSSL_CRMF_MSG_centralkeygen_requested   5874	3_5_0	EXIST::FUNCTION:CRMF
-CMS_EnvelopedData_dup                   5875	3_5_0	EXIST::FUNCTION:CMS
-OSSL_CRMF_ENCRYPTEDKEY_init_envdata     5876	3_5_0	EXIST::FUNCTION:CMS,CRMF
-EVP_get1_default_properties             5877	3_5_0	EXIST::FUNCTION:
-RAND_set1_random_provider               5878	3_5_0	EXIST::FUNCTION:
-X509_PURPOSE_get_unused_id              5879	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX  5880	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX  5881	3_5_0	EXIST::FUNCTION:
-OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX_free 5882	3_5_0	EXIST::FUNCTION:
-OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX_new  5883	3_5_0	EXIST::FUNCTION:
-OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX_it   5884	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_ROLE_SPEC_CERT_ID              5885	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_ROLE_SPEC_CERT_ID              5886	3_5_0	EXIST::FUNCTION:
-OSSL_ROLE_SPEC_CERT_ID_free             5887	3_5_0	EXIST::FUNCTION:
-OSSL_ROLE_SPEC_CERT_ID_new              5888	3_5_0	EXIST::FUNCTION:
-OSSL_ROLE_SPEC_CERT_ID_it               5889	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_ROLE_SPEC_CERT_ID_SYNTAX       5890	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_ROLE_SPEC_CERT_ID_SYNTAX       5891	3_5_0	EXIST::FUNCTION:
-OSSL_ROLE_SPEC_CERT_ID_SYNTAX_free      5892	3_5_0	EXIST::FUNCTION:
-OSSL_ROLE_SPEC_CERT_ID_SYNTAX_new       5893	3_5_0	EXIST::FUNCTION:
-OSSL_ROLE_SPEC_CERT_ID_SYNTAX_it        5894	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_ATTRIBUTE_DESCRIPTOR           5895	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_ATTRIBUTE_DESCRIPTOR           5896	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_DESCRIPTOR_free          5897	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_DESCRIPTOR_new           5898	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_DESCRIPTOR_it            5899	3_5_0	EXIST::FUNCTION:
-OSSL_HASH_it                            5900	3_5_0	EXIST::FUNCTION:
-OSSL_INFO_SYNTAX_it                     5901	3_5_0	EXIST::FUNCTION:
-OSSL_INFO_SYNTAX_POINTER_it             5902	3_5_0	EXIST::FUNCTION:
-OSSL_PRIVILEGE_POLICY_ID_it             5903	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_HASH                           5904	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_HASH                           5905	3_5_0	EXIST::FUNCTION:
-OSSL_HASH_free                          5906	3_5_0	EXIST::FUNCTION:
-OSSL_HASH_new                           5907	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_INFO_SYNTAX                    5908	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_INFO_SYNTAX                    5909	3_5_0	EXIST::FUNCTION:
-OSSL_INFO_SYNTAX_free                   5910	3_5_0	EXIST::FUNCTION:
-OSSL_INFO_SYNTAX_new                    5911	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_INFO_SYNTAX_POINTER            5912	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_INFO_SYNTAX_POINTER            5913	3_5_0	EXIST::FUNCTION:
-OSSL_INFO_SYNTAX_POINTER_free           5914	3_5_0	EXIST::FUNCTION:
-OSSL_INFO_SYNTAX_POINTER_new            5915	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_PRIVILEGE_POLICY_ID            5916	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_PRIVILEGE_POLICY_ID            5917	3_5_0	EXIST::FUNCTION:
-OSSL_PRIVILEGE_POLICY_ID_free           5918	3_5_0	EXIST::FUNCTION:
-OSSL_PRIVILEGE_POLICY_ID_new            5919	3_5_0	EXIST::FUNCTION:
-OSSL_PARAM_print_to_bio                 5920	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_DAY_TIME                       5921	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_DAY_TIME                       5922	3_5_0	EXIST::FUNCTION:
-OSSL_DAY_TIME_free                      5923	3_5_0	EXIST::FUNCTION:
-OSSL_DAY_TIME_new                       5924	3_5_0	EXIST::FUNCTION:
-OSSL_DAY_TIME_it                        5925	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_DAY_TIME_BAND                  5926	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_DAY_TIME_BAND                  5927	3_5_0	EXIST::FUNCTION:
-OSSL_DAY_TIME_BAND_free                 5928	3_5_0	EXIST::FUNCTION:
-OSSL_DAY_TIME_BAND_new                  5929	3_5_0	EXIST::FUNCTION:
-OSSL_DAY_TIME_BAND_it                   5930	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_TIME_SPEC_DAY                  5931	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_TIME_SPEC_DAY                  5932	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_DAY_free                 5933	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_DAY_new                  5934	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_DAY_it                   5935	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_TIME_SPEC_WEEKS                5936	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_TIME_SPEC_WEEKS                5937	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_WEEKS_free               5938	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_WEEKS_new                5939	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_WEEKS_it                 5940	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_TIME_SPEC_MONTH                5941	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_TIME_SPEC_MONTH                5942	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_MONTH_free               5943	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_MONTH_new                5944	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_MONTH_it                 5945	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_NAMED_DAY                      5946	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_NAMED_DAY                      5947	3_5_0	EXIST::FUNCTION:
-OSSL_NAMED_DAY_free                     5948	3_5_0	EXIST::FUNCTION:
-OSSL_NAMED_DAY_new                      5949	3_5_0	EXIST::FUNCTION:
-OSSL_NAMED_DAY_it                       5950	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_TIME_SPEC_X_DAY_OF             5951	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_TIME_SPEC_X_DAY_OF             5952	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_X_DAY_OF_free            5953	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_X_DAY_OF_new             5954	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_X_DAY_OF_it              5955	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_TIME_SPEC_ABSOLUTE             5956	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_TIME_SPEC_ABSOLUTE             5957	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_ABSOLUTE_free            5958	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_ABSOLUTE_new             5959	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_ABSOLUTE_it              5960	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_TIME_SPEC_TIME                 5961	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_TIME_SPEC_TIME                 5962	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_TIME_free                5963	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_TIME_new                 5964	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_TIME_it                  5965	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_TIME_SPEC                      5966	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_TIME_SPEC                      5967	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_free                     5968	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_new                      5969	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_SPEC_it                       5970	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_TIME_PERIOD                    5971	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_TIME_PERIOD                    5972	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_PERIOD_free                   5973	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_PERIOD_new                    5974	3_5_0	EXIST::FUNCTION:
-OSSL_TIME_PERIOD_it                     5975	3_5_0	EXIST::FUNCTION:
-EVP_CIPHER_can_pipeline                 5976	3_5_0	EXIST::FUNCTION:
-EVP_CipherPipelineEncryptInit           5977	3_5_0	EXIST::FUNCTION:
-EVP_CipherPipelineDecryptInit           5978	3_5_0	EXIST::FUNCTION:
-EVP_CipherPipelineUpdate                5979	3_5_0	EXIST::FUNCTION:
-EVP_CipherPipelineFinal                 5980	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_ATTRIBUTE_TYPE_MAPPING         5981	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_ATTRIBUTE_TYPE_MAPPING         5982	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_TYPE_MAPPING_free        5983	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_TYPE_MAPPING_new         5984	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_TYPE_MAPPING_it          5985	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_ATTRIBUTE_VALUE_MAPPING        5986	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_ATTRIBUTE_VALUE_MAPPING        5987	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_VALUE_MAPPING_free       5988	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_VALUE_MAPPING_new        5989	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_VALUE_MAPPING_it         5990	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_ATTRIBUTE_MAPPING              5991	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_ATTRIBUTE_MAPPING              5992	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_MAPPING_free             5993	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_MAPPING_new              5994	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_MAPPING_it               5995	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_ATTRIBUTE_MAPPINGS             5996	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_ATTRIBUTE_MAPPINGS             5997	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_MAPPINGS_free            5998	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_MAPPINGS_new             5999	3_5_0	EXIST::FUNCTION:
-OSSL_ATTRIBUTE_MAPPINGS_it              6000	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_ATAV                           6001	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_ATAV                           6002	3_5_0	EXIST::FUNCTION:
-OSSL_ATAV_free                          6003	3_5_0	EXIST::FUNCTION:
-OSSL_ATAV_new                           6004	3_5_0	EXIST::FUNCTION:
-OSSL_ATAV_it                            6005	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_ALLOWED_ATTRIBUTES_CHOICE      6006	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_ALLOWED_ATTRIBUTES_CHOICE      6007	3_5_0	EXIST::FUNCTION:
-OSSL_ALLOWED_ATTRIBUTES_CHOICE_free     6008	3_5_0	EXIST::FUNCTION:
-OSSL_ALLOWED_ATTRIBUTES_CHOICE_new      6009	3_5_0	EXIST::FUNCTION:
-OSSL_ALLOWED_ATTRIBUTES_CHOICE_it       6010	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_ALLOWED_ATTRIBUTES_ITEM        6011	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_ALLOWED_ATTRIBUTES_ITEM        6012	3_5_0	EXIST::FUNCTION:
-OSSL_ALLOWED_ATTRIBUTES_ITEM_free       6013	3_5_0	EXIST::FUNCTION:
-OSSL_ALLOWED_ATTRIBUTES_ITEM_new        6014	3_5_0	EXIST::FUNCTION:
-OSSL_ALLOWED_ATTRIBUTES_ITEM_it         6015	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_ALLOWED_ATTRIBUTES_SYNTAX      6016	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_ALLOWED_ATTRIBUTES_SYNTAX      6017	3_5_0	EXIST::FUNCTION:
-OSSL_ALLOWED_ATTRIBUTES_SYNTAX_free     6018	3_5_0	EXIST::FUNCTION:
-OSSL_ALLOWED_ATTRIBUTES_SYNTAX_new      6019	3_5_0	EXIST::FUNCTION:
-OSSL_ALLOWED_ATTRIBUTES_SYNTAX_it       6020	3_5_0	EXIST::FUNCTION:
-EVP_CipherInit_SKEY                     6021	3_5_0	EXIST::FUNCTION:
-EVP_SKEY_import                         6022	3_5_0	EXIST::FUNCTION:
-EVP_SKEY_generate                       6023	3_5_0	EXIST::FUNCTION:
-EVP_SKEY_import_raw_key                 6024	3_5_0	EXIST::FUNCTION:
-EVP_SKEY_get0_raw_key                   6025	3_5_0	EXIST::FUNCTION:
-EVP_SKEY_export                         6026	3_5_0	EXIST::FUNCTION:
-EVP_SKEY_up_ref                         6027	3_5_0	EXIST::FUNCTION:
-EVP_SKEY_free                           6028	3_5_0	EXIST::FUNCTION:
-EVP_SKEYMGMT_fetch                      6029	3_5_0	EXIST::FUNCTION:
-EVP_SKEYMGMT_up_ref                     6030	3_5_0	EXIST::FUNCTION:
-EVP_SKEYMGMT_free                       6031	3_5_0	EXIST::FUNCTION:
-EVP_SKEYMGMT_get0_provider              6032	3_5_0	EXIST::FUNCTION:
-EVP_SKEYMGMT_get0_name                  6033	3_5_0	EXIST::FUNCTION:
-EVP_SKEYMGMT_get0_description           6034	3_5_0	EXIST::FUNCTION:
-EVP_SKEYMGMT_is_a                       6035	3_5_0	EXIST::FUNCTION:
-EVP_SKEYMGMT_do_all_provided            6036	3_5_0	EXIST::FUNCTION:
-EVP_SKEYMGMT_names_do_all               6037	3_5_0	EXIST::FUNCTION:
-EVP_MAC_init_SKEY                       6038	3_5_0	EXIST::FUNCTION:
-EVP_SKEY_get0_key_id                    6039	3_5_0	EXIST::FUNCTION:
-EVP_SKEY_get0_skeymgmt_name             6040	3_5_0	EXIST::FUNCTION:
-EVP_SKEY_get0_provider_name             6041	3_5_0	EXIST::FUNCTION:
-EVP_SKEYMGMT_get0_gen_settable_params   6042	3_5_0	EXIST::FUNCTION:
-EVP_SKEYMGMT_get0_imp_settable_params   6043	3_5_0	EXIST::FUNCTION:
-EVP_SKEY_is_a                           6044	3_5_0	EXIST::FUNCTION:
-EVP_SKEY_to_provider                    6045	3_5_0	EXIST::FUNCTION:
-OSSL_PROVIDER_add_conf_parameter        6046	3_5_0	EXIST::FUNCTION:
-OSSL_PROVIDER_get_conf_parameters       6047	3_5_0	EXIST::FUNCTION:
-OSSL_PROVIDER_conf_get_bool             6048	3_5_0	EXIST::FUNCTION:
-d2i_OSSL_AA_DIST_POINT                  6049	3_5_0	EXIST::FUNCTION:
-i2d_OSSL_AA_DIST_POINT                  6050	3_5_0	EXIST::FUNCTION:
-OSSL_AA_DIST_POINT_free                 6051	3_5_0	EXIST::FUNCTION:
-OSSL_AA_DIST_POINT_new                  6052	3_5_0	EXIST::FUNCTION:
-OSSL_AA_DIST_POINT_it                   6053	3_5_0	EXIST::FUNCTION:
-PEM_ASN1_write_bio_ctx                  6054	3_5_0	EXIST::FUNCTION:
+asn1_d2i_read_bio                       1	4_0_0	EXIST::FUNCTION:
+DSO_new                                 2	4_0_0	EXIST::FUNCTION:
+DSO_free                                3	4_0_0	EXIST::FUNCTION:
+DSO_flags                               4	4_0_0	EXIST::FUNCTION:
+DSO_up_ref                              5	4_0_0	EXIST::FUNCTION:
+DSO_ctrl                                6	4_0_0	EXIST::FUNCTION:
+DSO_get_filename                        7	4_0_0	EXIST::FUNCTION:
+DSO_set_filename                        8	4_0_0	EXIST::FUNCTION:
+DSO_convert_filename                    9	4_0_0	EXIST::FUNCTION:
+DSO_merge                               10	4_0_0	EXIST::FUNCTION:
+DSO_load                                11	4_0_0	EXIST::FUNCTION:
+DSO_bind_func                           12	4_0_0	EXIST::FUNCTION:
+DSO_METHOD_openssl                      13	4_0_0	EXIST::FUNCTION:
+DSO_pathbyaddr                          14	4_0_0	EXIST::FUNCTION:
+DSO_dsobyaddr                           15	4_0_0	EXIST::FUNCTION:
+DSO_global_lookup                       16	4_0_0	EXIST::FUNCTION:
+err_free_strings_int                    17	4_0_0	EXIST::FUNCTION:
+OPENSSL_DIR_read                        18	4_0_0	EXIST::FUNCTION:
+OPENSSL_DIR_end                         19	4_0_0	EXIST::FUNCTION:
+conf_ssl_get                            20	4_0_0	EXIST::FUNCTION:
+conf_ssl_name_find                      21	4_0_0	EXIST::FUNCTION:
+conf_ssl_get_cmd                        22	4_0_0	EXIST::FUNCTION:
+AES_options                             23	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+AES_set_encrypt_key                     24	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+AES_set_decrypt_key                     25	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+AES_encrypt                             26	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+AES_decrypt                             27	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+AES_ecb_encrypt                         28	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+AES_cbc_encrypt                         29	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+AES_cfb128_encrypt                      30	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+AES_cfb1_encrypt                        31	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+AES_cfb8_encrypt                        32	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+AES_ofb128_encrypt                      33	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+AES_ige_encrypt                         34	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+AES_bi_ige_encrypt                      35	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+AES_wrap_key                            36	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+AES_unwrap_key                          37	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ASYNC_init_thread                       38	4_0_0	EXIST::FUNCTION:
+ASYNC_cleanup_thread                    39	4_0_0	EXIST::FUNCTION:
+ASYNC_WAIT_CTX_new                      40	4_0_0	EXIST::FUNCTION:
+ASYNC_WAIT_CTX_free                     41	4_0_0	EXIST::FUNCTION:
+ASYNC_WAIT_CTX_set_wait_fd              42	4_0_0	EXIST::FUNCTION:
+ASYNC_WAIT_CTX_get_fd                   43	4_0_0	EXIST::FUNCTION:
+ASYNC_WAIT_CTX_get_all_fds              44	4_0_0	EXIST::FUNCTION:
+ASYNC_WAIT_CTX_get_callback             45	4_0_0	EXIST::FUNCTION:
+ASYNC_WAIT_CTX_set_callback             46	4_0_0	EXIST::FUNCTION:
+ASYNC_WAIT_CTX_set_status               47	4_0_0	EXIST::FUNCTION:
+ASYNC_WAIT_CTX_get_status               48	4_0_0	EXIST::FUNCTION:
+ASYNC_WAIT_CTX_get_changed_fds          49	4_0_0	EXIST::FUNCTION:
+ASYNC_WAIT_CTX_clear_fd                 50	4_0_0	EXIST::FUNCTION:
+ASYNC_is_capable                        51	4_0_0	EXIST::FUNCTION:
+ASYNC_set_mem_functions                 52	4_0_0	EXIST::FUNCTION:
+ASYNC_get_mem_functions                 53	4_0_0	EXIST::FUNCTION:
+ASYNC_start_job                         54	4_0_0	EXIST::FUNCTION:
+ASYNC_pause_job                         55	4_0_0	EXIST::FUNCTION:
+ASYNC_get_current_job                   56	4_0_0	EXIST::FUNCTION:
+ASYNC_get_wait_ctx                      57	4_0_0	EXIST::FUNCTION:
+ASYNC_block_pause                       58	4_0_0	EXIST::FUNCTION:
+ASYNC_unblock_pause                     59	4_0_0	EXIST::FUNCTION:
+BF_set_key                              60	4_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
+BF_encrypt                              61	4_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
+BF_decrypt                              62	4_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
+BF_ecb_encrypt                          63	4_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
+BF_cbc_encrypt                          64	4_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
+BF_cfb64_encrypt                        65	4_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
+BF_ofb64_encrypt                        66	4_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
+BF_options                              67	4_0_0	EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
+BN_set_flags                            68	4_0_0	EXIST::FUNCTION:
+BN_get_flags                            69	4_0_0	EXIST::FUNCTION:
+BN_with_flags                           70	4_0_0	EXIST::FUNCTION:
+BN_GENCB_call                           71	4_0_0	EXIST::FUNCTION:
+BN_GENCB_new                            72	4_0_0	EXIST::FUNCTION:
+BN_GENCB_free                           73	4_0_0	EXIST::FUNCTION:
+BN_GENCB_set_old                        74	4_0_0	EXIST::FUNCTION:
+BN_GENCB_set                            75	4_0_0	EXIST::FUNCTION:
+BN_GENCB_get_arg                        76	4_0_0	EXIST::FUNCTION:
+BN_abs_is_word                          77	4_0_0	EXIST::FUNCTION:
+BN_is_zero                              78	4_0_0	EXIST::FUNCTION:
+BN_is_one                               79	4_0_0	EXIST::FUNCTION:
+BN_is_word                              80	4_0_0	EXIST::FUNCTION:
+BN_is_odd                               81	4_0_0	EXIST::FUNCTION:
+BN_zero_ex                              82	4_0_0	EXIST::FUNCTION:
+BN_value_one                            83	4_0_0	EXIST::FUNCTION:
+BN_options                              84	4_0_0	EXIST::FUNCTION:
+BN_CTX_new_ex                           85	4_0_0	EXIST::FUNCTION:
+BN_CTX_new                              86	4_0_0	EXIST::FUNCTION:
+BN_CTX_secure_new_ex                    87	4_0_0	EXIST::FUNCTION:
+BN_CTX_secure_new                       88	4_0_0	EXIST::FUNCTION:
+BN_CTX_free                             89	4_0_0	EXIST::FUNCTION:
+BN_CTX_start                            90	4_0_0	EXIST::FUNCTION:
+BN_CTX_get                              91	4_0_0	EXIST::FUNCTION:
+BN_CTX_end                              92	4_0_0	EXIST::FUNCTION:
+BN_rand_ex                              93	4_0_0	EXIST::FUNCTION:
+BN_rand                                 94	4_0_0	EXIST::FUNCTION:
+BN_priv_rand_ex                         95	4_0_0	EXIST::FUNCTION:
+BN_priv_rand                            96	4_0_0	EXIST::FUNCTION:
+BN_rand_range_ex                        97	4_0_0	EXIST::FUNCTION:
+BN_rand_range                           98	4_0_0	EXIST::FUNCTION:
+BN_priv_rand_range_ex                   99	4_0_0	EXIST::FUNCTION:
+BN_priv_rand_range                      100	4_0_0	EXIST::FUNCTION:
+BN_pseudo_rand                          101	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+BN_pseudo_rand_range                    102	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+BN_num_bits                             103	4_0_0	EXIST::FUNCTION:
+BN_num_bits_word                        104	4_0_0	EXIST::FUNCTION:
+BN_security_bits                        105	4_0_0	EXIST::FUNCTION:
+BN_new                                  106	4_0_0	EXIST::FUNCTION:
+BN_secure_new                           107	4_0_0	EXIST::FUNCTION:
+BN_clear_free                           108	4_0_0	EXIST::FUNCTION:
+BN_copy                                 109	4_0_0	EXIST::FUNCTION:
+BN_swap                                 110	4_0_0	EXIST::FUNCTION:
+BN_bin2bn                               111	4_0_0	EXIST::FUNCTION:
+BN_signed_bin2bn                        112	4_0_0	EXIST::FUNCTION:
+BN_bn2bin                               113	4_0_0	EXIST::FUNCTION:
+BN_bn2binpad                            114	4_0_0	EXIST::FUNCTION:
+BN_signed_bn2bin                        115	4_0_0	EXIST::FUNCTION:
+BN_lebin2bn                             116	4_0_0	EXIST::FUNCTION:
+BN_signed_lebin2bn                      117	4_0_0	EXIST::FUNCTION:
+BN_bn2lebinpad                          118	4_0_0	EXIST::FUNCTION:
+BN_signed_bn2lebin                      119	4_0_0	EXIST::FUNCTION:
+BN_native2bn                            120	4_0_0	EXIST::FUNCTION:
+BN_signed_native2bn                     121	4_0_0	EXIST::FUNCTION:
+BN_bn2nativepad                         122	4_0_0	EXIST::FUNCTION:
+BN_signed_bn2native                     123	4_0_0	EXIST::FUNCTION:
+BN_mpi2bn                               124	4_0_0	EXIST::FUNCTION:
+BN_bn2mpi                               125	4_0_0	EXIST::FUNCTION:
+BN_sub                                  126	4_0_0	EXIST::FUNCTION:
+BN_usub                                 127	4_0_0	EXIST::FUNCTION:
+BN_uadd                                 128	4_0_0	EXIST::FUNCTION:
+BN_add                                  129	4_0_0	EXIST::FUNCTION:
+BN_mul                                  130	4_0_0	EXIST::FUNCTION:
+BN_sqr                                  131	4_0_0	EXIST::FUNCTION:
+BN_set_negative                         132	4_0_0	EXIST::FUNCTION:
+BN_is_negative                          133	4_0_0	EXIST::FUNCTION:
+BN_div                                  134	4_0_0	EXIST::FUNCTION:
+BN_nnmod                                135	4_0_0	EXIST::FUNCTION:
+BN_mod_add                              136	4_0_0	EXIST::FUNCTION:
+BN_mod_add_quick                        137	4_0_0	EXIST::FUNCTION:
+BN_mod_sub                              138	4_0_0	EXIST::FUNCTION:
+BN_mod_sub_quick                        139	4_0_0	EXIST::FUNCTION:
+BN_mod_mul                              140	4_0_0	EXIST::FUNCTION:
+BN_mod_sqr                              141	4_0_0	EXIST::FUNCTION:
+BN_mod_lshift1                          142	4_0_0	EXIST::FUNCTION:
+BN_mod_lshift1_quick                    143	4_0_0	EXIST::FUNCTION:
+BN_mod_lshift                           144	4_0_0	EXIST::FUNCTION:
+BN_mod_lshift_quick                     145	4_0_0	EXIST::FUNCTION:
+BN_mod_word                             146	4_0_0	EXIST::FUNCTION:
+BN_div_word                             147	4_0_0	EXIST::FUNCTION:
+BN_mul_word                             148	4_0_0	EXIST::FUNCTION:
+BN_add_word                             149	4_0_0	EXIST::FUNCTION:
+BN_sub_word                             150	4_0_0	EXIST::FUNCTION:
+BN_set_word                             151	4_0_0	EXIST::FUNCTION:
+BN_get_word                             152	4_0_0	EXIST::FUNCTION:
+BN_cmp                                  153	4_0_0	EXIST::FUNCTION:
+BN_free                                 154	4_0_0	EXIST::FUNCTION:
+BN_is_bit_set                           155	4_0_0	EXIST::FUNCTION:
+BN_lshift                               156	4_0_0	EXIST::FUNCTION:
+BN_lshift1                              157	4_0_0	EXIST::FUNCTION:
+BN_exp                                  158	4_0_0	EXIST::FUNCTION:
+BN_mod_exp                              159	4_0_0	EXIST::FUNCTION:
+BN_mod_exp_mont                         160	4_0_0	EXIST::FUNCTION:
+BN_mod_exp_mont_consttime               161	4_0_0	EXIST::FUNCTION:
+BN_mod_exp_mont_word                    162	4_0_0	EXIST::FUNCTION:
+BN_mod_exp2_mont                        163	4_0_0	EXIST::FUNCTION:
+BN_mod_exp_simple                       164	4_0_0	EXIST::FUNCTION:
+BN_mod_exp_mont_consttime_x2            165	4_0_0	EXIST::FUNCTION:
+BN_mask_bits                            166	4_0_0	EXIST::FUNCTION:
+BN_print_fp                             167	4_0_0	EXIST::FUNCTION:STDIO
+BN_print                                168	4_0_0	EXIST::FUNCTION:
+BN_reciprocal                           169	4_0_0	EXIST::FUNCTION:
+BN_rshift                               170	4_0_0	EXIST::FUNCTION:
+BN_rshift1                              171	4_0_0	EXIST::FUNCTION:
+BN_clear                                172	4_0_0	EXIST::FUNCTION:
+BN_dup                                  173	4_0_0	EXIST::FUNCTION:
+BN_ucmp                                 174	4_0_0	EXIST::FUNCTION:
+BN_set_bit                              175	4_0_0	EXIST::FUNCTION:
+BN_clear_bit                            176	4_0_0	EXIST::FUNCTION:
+BN_bn2hex                               177	4_0_0	EXIST::FUNCTION:
+BN_bn2dec                               178	4_0_0	EXIST::FUNCTION:
+BN_hex2bn                               179	4_0_0	EXIST::FUNCTION:
+BN_dec2bn                               180	4_0_0	EXIST::FUNCTION:
+BN_asc2bn                               181	4_0_0	EXIST::FUNCTION:
+BN_gcd                                  182	4_0_0	EXIST::FUNCTION:
+BN_kronecker                            183	4_0_0	EXIST::FUNCTION:
+BN_are_coprime                          184	4_0_0	EXIST::FUNCTION:
+BN_mod_inverse                          185	4_0_0	EXIST::FUNCTION:
+BN_mod_sqrt                             186	4_0_0	EXIST::FUNCTION:
+BN_consttime_swap                       187	4_0_0	EXIST::FUNCTION:
+BN_generate_prime                       188	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8
+BN_is_prime                             189	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8
+BN_is_prime_fasttest                    190	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8
+BN_is_prime_ex                          191	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+BN_is_prime_fasttest_ex                 192	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+BN_generate_prime_ex2                   193	4_0_0	EXIST::FUNCTION:
+BN_generate_prime_ex                    194	4_0_0	EXIST::FUNCTION:
+BN_check_prime                          195	4_0_0	EXIST::FUNCTION:
+BN_X931_generate_Xpq                    196	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+BN_X931_derive_prime_ex                 197	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+BN_X931_generate_prime_ex               198	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+BN_MONT_CTX_new                         199	4_0_0	EXIST::FUNCTION:
+BN_mod_mul_montgomery                   200	4_0_0	EXIST::FUNCTION:
+BN_to_montgomery                        201	4_0_0	EXIST::FUNCTION:
+BN_from_montgomery                      202	4_0_0	EXIST::FUNCTION:
+BN_MONT_CTX_free                        203	4_0_0	EXIST::FUNCTION:
+BN_MONT_CTX_set                         204	4_0_0	EXIST::FUNCTION:
+BN_MONT_CTX_copy                        205	4_0_0	EXIST::FUNCTION:
+BN_MONT_CTX_set_locked                  206	4_0_0	EXIST::FUNCTION:
+BN_BLINDING_new                         207	4_0_0	EXIST::FUNCTION:
+BN_BLINDING_free                        208	4_0_0	EXIST::FUNCTION:
+BN_BLINDING_update                      209	4_0_0	EXIST::FUNCTION:
+BN_BLINDING_convert                     210	4_0_0	EXIST::FUNCTION:
+BN_BLINDING_invert                      211	4_0_0	EXIST::FUNCTION:
+BN_BLINDING_convert_ex                  212	4_0_0	EXIST::FUNCTION:
+BN_BLINDING_invert_ex                   213	4_0_0	EXIST::FUNCTION:
+BN_BLINDING_is_current_thread           214	4_0_0	EXIST::FUNCTION:
+BN_BLINDING_set_current_thread          215	4_0_0	EXIST::FUNCTION:
+BN_BLINDING_lock                        216	4_0_0	EXIST::FUNCTION:
+BN_BLINDING_unlock                      217	4_0_0	EXIST::FUNCTION:
+BN_BLINDING_get_flags                   218	4_0_0	EXIST::FUNCTION:
+BN_BLINDING_set_flags                   219	4_0_0	EXIST::FUNCTION:
+BN_BLINDING_create_param                220	4_0_0	EXIST::FUNCTION:
+BN_set_params                           221	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8
+BN_get_params                           222	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8
+BN_RECP_CTX_new                         223	4_0_0	EXIST::FUNCTION:
+BN_RECP_CTX_free                        224	4_0_0	EXIST::FUNCTION:
+BN_RECP_CTX_set                         225	4_0_0	EXIST::FUNCTION:
+BN_mod_mul_reciprocal                   226	4_0_0	EXIST::FUNCTION:
+BN_mod_exp_recp                         227	4_0_0	EXIST::FUNCTION:
+BN_div_recp                             228	4_0_0	EXIST::FUNCTION:
+BN_GF2m_add                             229	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod                             230	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_mul                         231	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_sqr                         232	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_inv                         233	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_div                         234	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_exp                         235	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_sqrt                        236	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_solve_quad                  237	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_arr                         238	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_mul_arr                     239	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_sqr_arr                     240	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_inv_arr                     241	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_div_arr                     242	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_exp_arr                     243	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_sqrt_arr                    244	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_mod_solve_quad_arr              245	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_poly2arr                        246	4_0_0	EXIST::FUNCTION:EC2M
+BN_GF2m_arr2poly                        247	4_0_0	EXIST::FUNCTION:EC2M
+BN_nist_mod_192                         248	4_0_0	EXIST::FUNCTION:
+BN_nist_mod_224                         249	4_0_0	EXIST::FUNCTION:
+BN_nist_mod_256                         250	4_0_0	EXIST::FUNCTION:
+BN_nist_mod_384                         251	4_0_0	EXIST::FUNCTION:
+BN_nist_mod_521                         252	4_0_0	EXIST::FUNCTION:
+BN_get0_nist_prime_192                  253	4_0_0	EXIST::FUNCTION:
+BN_get0_nist_prime_224                  254	4_0_0	EXIST::FUNCTION:
+BN_get0_nist_prime_256                  255	4_0_0	EXIST::FUNCTION:
+BN_get0_nist_prime_384                  256	4_0_0	EXIST::FUNCTION:
+BN_get0_nist_prime_521                  257	4_0_0	EXIST::FUNCTION:
+BN_nist_mod_func                        258	4_0_0	EXIST::FUNCTION:
+BN_generate_dsa_nonce                   259	4_0_0	EXIST::FUNCTION:
+BN_get_rfc2409_prime_768                260	4_0_0	EXIST::FUNCTION:
+BN_get_rfc2409_prime_1024               261	4_0_0	EXIST::FUNCTION:
+BN_get_rfc3526_prime_1536               262	4_0_0	EXIST::FUNCTION:
+BN_get_rfc3526_prime_2048               263	4_0_0	EXIST::FUNCTION:
+BN_get_rfc3526_prime_3072               264	4_0_0	EXIST::FUNCTION:
+BN_get_rfc3526_prime_4096               265	4_0_0	EXIST::FUNCTION:
+BN_get_rfc3526_prime_6144               266	4_0_0	EXIST::FUNCTION:
+BN_get_rfc3526_prime_8192               267	4_0_0	EXIST::FUNCTION:
+BN_bntest_rand                          268	4_0_0	EXIST::FUNCTION:
+BUF_MEM_new                             269	4_0_0	EXIST::FUNCTION:
+BUF_MEM_new_ex                          270	4_0_0	EXIST::FUNCTION:
+BUF_MEM_free                            271	4_0_0	EXIST::FUNCTION:
+BUF_MEM_grow                            272	4_0_0	EXIST::FUNCTION:
+BUF_MEM_grow_clean                      273	4_0_0	EXIST::FUNCTION:
+BUF_reverse                             274	4_0_0	EXIST::FUNCTION:
+Camellia_set_key                        275	4_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
+Camellia_encrypt                        276	4_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
+Camellia_decrypt                        277	4_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
+Camellia_ecb_encrypt                    278	4_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
+Camellia_cbc_encrypt                    279	4_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
+Camellia_cfb128_encrypt                 280	4_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
+Camellia_cfb1_encrypt                   281	4_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
+Camellia_cfb8_encrypt                   282	4_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
+Camellia_ofb128_encrypt                 283	4_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
+Camellia_ctr128_encrypt                 284	4_0_0	EXIST::FUNCTION:CAMELLIA,DEPRECATEDIN_3_0
+CAST_set_key                            285	4_0_0	EXIST::FUNCTION:CAST,DEPRECATEDIN_3_0
+CAST_ecb_encrypt                        286	4_0_0	EXIST::FUNCTION:CAST,DEPRECATEDIN_3_0
+CAST_encrypt                            287	4_0_0	EXIST::FUNCTION:CAST,DEPRECATEDIN_3_0
+CAST_decrypt                            288	4_0_0	EXIST::FUNCTION:CAST,DEPRECATEDIN_3_0
+CAST_cbc_encrypt                        289	4_0_0	EXIST::FUNCTION:CAST,DEPRECATEDIN_3_0
+CAST_cfb64_encrypt                      290	4_0_0	EXIST::FUNCTION:CAST,DEPRECATEDIN_3_0
+CAST_ofb64_encrypt                      291	4_0_0	EXIST::FUNCTION:CAST,DEPRECATEDIN_3_0
+CMAC_CTX_new                            292	4_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
+CMAC_CTX_cleanup                        293	4_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
+CMAC_CTX_free                           294	4_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
+CMAC_CTX_get0_cipher_ctx                295	4_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
+CMAC_CTX_copy                           296	4_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
+CMAC_Init                               297	4_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
+CMAC_Update                             298	4_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
+CMAC_Final                              299	4_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
+CMAC_resume                             300	4_0_0	EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0
+OSSL_CMP_log_open                       301	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_log_close                      302	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_print_to_bio                   303	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_print_errors_cb                304	4_0_0	EXIST::FUNCTION:CMP
+ERR_load_ASN1_strings                   305	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_ASYNC_strings                  306	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_BIO_strings                    307	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_BN_strings                     308	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_BUF_strings                    309	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_CMS_strings                    310	4_0_0	EXIST::FUNCTION:CMS,DEPRECATEDIN_3_0
+ERR_load_COMP_strings                   311	4_0_0	EXIST::FUNCTION:COMP,DEPRECATEDIN_3_0
+ERR_load_CONF_strings                   312	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_CRYPTO_strings                 313	4_0_0	EXIST:!VMS:FUNCTION:DEPRECATEDIN_3_0
+ERR_load_CRYPTOlib_strings              313	4_0_0	EXIST:VMS:FUNCTION:DEPRECATEDIN_3_0
+ERR_load_CT_strings                     314	4_0_0	EXIST::FUNCTION:CT,DEPRECATEDIN_3_0
+ERR_load_DH_strings                     315	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+ERR_load_DSA_strings                    316	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+ERR_load_EC_strings                     317	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ERR_load_ERR_strings                    318	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_EVP_strings                    319	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_KDF_strings                    320	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_OBJ_strings                    321	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_OCSP_strings                   322	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,OCSP
+ERR_load_PEM_strings                    323	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_PKCS12_strings                 324	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_PKCS7_strings                  325	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_RAND_strings                   326	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_RSA_strings                    327	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_OSSL_STORE_strings             328	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_TS_strings                     329	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,TS
+ERR_load_UI_strings                     330	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_X509_strings                   331	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_load_X509V3_strings                 332	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_DECODER_fetch                      333	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_up_ref                     334	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_free                       335	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_get0_provider              336	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_get0_properties            337	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_get0_name                  338	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_get0_description           339	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_is_a                       340	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_do_all_provided            341	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_names_do_all               342	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_gettable_params            343	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_get_params                 344	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_settable_ctx_params        345	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_new                    346	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_set_params             347	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_free                   348	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_set_passphrase         349	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_set_pem_password_cb    350	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_set_passphrase_cb      351	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_set_passphrase_ui      352	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_set_selection          353	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_set_input_type         354	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_set_input_structure    355	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_add_decoder            356	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_add_extra              357	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_get_num_decoders       358	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_INSTANCE_get_decoder       359	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_INSTANCE_get_decoder_ctx   360	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_INSTANCE_get_input_type    361	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_INSTANCE_get_input_structure 362	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_set_construct          363	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_set_construct_data     364	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_set_cleanup            365	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_get_construct          366	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_get_construct_data     367	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_get_cleanup            368	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_export                     369	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_from_bio                   370	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_from_fp                    371	4_0_0	EXIST::FUNCTION:STDIO
+OSSL_DECODER_from_data                  372	4_0_0	EXIST::FUNCTION:
+OSSL_DECODER_CTX_new_for_pkey           373	4_0_0	EXIST::FUNCTION:
+DES_options                             374	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_ecb3_encrypt                        375	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_cbc_cksum                           376	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_cbc_encrypt                         377	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_ncbc_encrypt                        378	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_xcbc_encrypt                        379	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_cfb_encrypt                         380	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_ecb_encrypt                         381	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_encrypt1                            382	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_encrypt2                            383	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_encrypt3                            384	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_decrypt3                            385	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_ede3_cbc_encrypt                    386	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_ede3_cfb64_encrypt                  387	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_ede3_cfb_encrypt                    388	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_ede3_ofb64_encrypt                  389	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_fcrypt                              390	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_crypt                               391	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_ofb_encrypt                         392	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_pcbc_encrypt                        393	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_quad_cksum                          394	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_random_key                          395	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_set_odd_parity                      396	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_check_key_parity                    397	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_is_weak_key                         398	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_set_key                             399	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_key_sched                           400	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_set_key_checked                     401	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_set_key_unchecked                   402	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_string_to_key                       403	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_string_to_2keys                     404	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_cfb64_encrypt                       405	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+DES_ofb64_encrypt                       406	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DES
+EVP_PKEY_CTX_set_dh_paramgen_type       407	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dh_paramgen_gindex     408	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dh_paramgen_seed       409	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dh_paramgen_prime_len  410	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dh_paramgen_subprime_len 411	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dh_paramgen_generator  412	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dh_nid                 413	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dh_rfc5114             414	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dhx_rfc5114            415	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dh_pad                 416	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dh_kdf_type            417	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_dh_kdf_type            418	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set0_dh_kdf_oid            419	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get0_dh_kdf_oid            420	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dh_kdf_md              421	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_dh_kdf_md              422	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dh_kdf_outlen          423	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_dh_kdf_outlen          424	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set0_dh_kdf_ukm            425	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get0_dh_kdf_ukm            426	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+DHparams_it                             427	4_0_0	EXIST::FUNCTION:DH
+DHparams_dup                            428	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_OpenSSL                              429	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_set_default_method                   430	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_get_default_method                   431	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_set_method                           432	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_new_method                           433	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_new                                  434	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_free                                 435	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_up_ref                               436	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_bits                                 437	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_size                                 438	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_security_bits                        439	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_set_ex_data                          440	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_get_ex_data                          441	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_generate_parameters_ex               442	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_check_params_ex                      443	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_check_ex                             444	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_check_pub_key_ex                     445	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_check_params                         446	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_check                                447	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_check_pub_key                        448	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_generate_key                         449	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_compute_key                          450	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_compute_key_padded                   451	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+d2i_DHparams                            452	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+i2d_DHparams                            453	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+d2i_DHxparams                           454	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+i2d_DHxparams                           455	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DHparams_print_fp                       456	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH,STDIO
+DHparams_print                          457	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_get_1024_160                         458	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_get_2048_224                         459	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_get_2048_256                         460	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_new_by_nid                           461	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_get_nid                              462	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_KDF_X9_42                            463	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_get0_pqg                             464	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_set0_pqg                             465	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_get0_key                             466	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_set0_key                             467	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_get0_p                               468	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_get0_q                               469	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_get0_g                               470	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_get0_priv_key                        471	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_get0_pub_key                         472	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_clear_flags                          473	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_test_flags                           474	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_set_flags                            475	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_get_length                           476	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_set_length                           477	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_new                             478	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_free                            479	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_dup                             480	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_get0_name                       481	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_set1_name                       482	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_get_flags                       483	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_set_flags                       484	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_get0_app_data                   485	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_set0_app_data                   486	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_get_generate_key                487	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_set_generate_key                488	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_get_compute_key                 489	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_set_compute_key                 490	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_get_bn_mod_exp                  491	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_set_bn_mod_exp                  492	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_get_init                        493	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_set_init                        494	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_get_finish                      495	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_set_finish                      496	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_get_generate_params             497	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_meth_set_generate_params             498	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+DH_generate_parameters                  499	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8,DH
+EVP_PKEY_CTX_set_dsa_paramgen_bits      500	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dsa_paramgen_q_bits    501	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dsa_paramgen_md_props  502	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dsa_paramgen_gindex    503	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dsa_paramgen_type      504	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dsa_paramgen_seed      505	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_dsa_paramgen_md        506	4_0_0	EXIST::FUNCTION:
+DSA_SIG_new                             507	4_0_0	EXIST::FUNCTION:DSA
+DSA_SIG_free                            508	4_0_0	EXIST::FUNCTION:DSA
+d2i_DSA_SIG                             509	4_0_0	EXIST::FUNCTION:DSA
+i2d_DSA_SIG                             510	4_0_0	EXIST::FUNCTION:DSA
+DSA_SIG_get0                            511	4_0_0	EXIST::FUNCTION:DSA
+DSA_SIG_set0                            512	4_0_0	EXIST::FUNCTION:DSA
+DSAparams_dup                           513	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_do_sign                             514	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_do_verify                           515	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_OpenSSL                             516	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_set_default_method                  517	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_get_default_method                  518	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_set_method                          519	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_get_method                          520	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_new                                 521	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_new_method                          522	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_free                                523	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_up_ref                              524	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_size                                525	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_bits                                526	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_security_bits                       527	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_sign_setup                          528	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_sign                                529	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_verify                              530	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_set_ex_data                         531	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_get_ex_data                         532	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+d2i_DSAPublicKey                        533	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+i2d_DSAPublicKey                        534	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+d2i_DSAPrivateKey                       535	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+i2d_DSAPrivateKey                       536	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+d2i_DSAparams                           537	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+i2d_DSAparams                           538	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_generate_parameters                 539	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8,DSA
+DSA_generate_parameters_ex              540	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_generate_key                        541	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSAparams_print                         542	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_print                               543	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSAparams_print_fp                      544	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
+DSA_print_fp                            545	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
+DSA_dup_DH                              546	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH,DSA
+DSA_get0_pqg                            547	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_set0_pqg                            548	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_get0_key                            549	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_set0_key                            550	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_get0_p                              551	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_get0_q                              552	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_get0_g                              553	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_get0_pub_key                        554	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_get0_priv_key                       555	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_clear_flags                         556	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_test_flags                          557	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_set_flags                           558	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_new                            559	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_free                           560	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_dup                            561	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_get0_name                      562	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_set1_name                      563	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_get_flags                      564	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_set_flags                      565	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_get0_app_data                  566	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_set0_app_data                  567	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_get_sign                       568	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_set_sign                       569	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_get_sign_setup                 570	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_set_sign_setup                 571	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_get_verify                     572	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_set_verify                     573	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_get_mod_exp                    574	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_set_mod_exp                    575	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_get_bn_mod_exp                 576	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_set_bn_mod_exp                 577	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_get_init                       578	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_set_init                       579	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_get_finish                     580	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_set_finish                     581	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_get_paramgen                   582	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_set_paramgen                   583	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_get_keygen                     584	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+DSA_meth_set_keygen                     585	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+EVP_PKEY_CTX_set_ec_paramgen_curve_nid  586	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_ec_param_enc           587	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_ecdh_cofactor_mode     588	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_ecdh_cofactor_mode     589	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_ecdh_kdf_type          590	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_ecdh_kdf_type          591	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_ecdh_kdf_md            592	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_ecdh_kdf_md            593	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_ecdh_kdf_outlen        594	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_ecdh_kdf_outlen        595	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set0_ecdh_kdf_ukm          596	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get0_ecdh_kdf_ukm          597	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_EC_curve_nid2name                  598	4_0_0	EXIST::FUNCTION:
+EC_GFp_simple_method                    599	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_GFp_mont_method                      600	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_GFp_nist_method                      601	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_GFp_nistp224_method                  602	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC_NISTP_64_GCC_128
+EC_GFp_nistp256_method                  603	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC_NISTP_64_GCC_128
+EC_GFp_nistp521_method                  604	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC_NISTP_64_GCC_128
+EC_GF2m_simple_method                   605	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC2M
+EC_GROUP_new                            606	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_GROUP_clear_free                     607	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_GROUP_method_of                      608	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_METHOD_get_field_type                609	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_GROUP_free                           610	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_copy                           611	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_dup                            612	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_set_generator                  613	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get0_generator                 614	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get_mont_data                  615	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get_order                      616	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get0_order                     617	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_order_bits                     618	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_security_bits                  619	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get_cofactor                   620	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get0_cofactor                  621	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_set_curve_name                 622	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get_curve_name                 623	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get0_field                     624	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get_field_type                 625	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_set_asn1_flag                  626	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get_asn1_flag                  627	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_set_point_conversion_form      628	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get_point_conversion_form      629	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get0_seed                      630	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get_seed_len                   631	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_set_seed                       632	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_set_curve                      633	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get_curve                      634	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_set_curve_GFp                  635	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_GROUP_get_curve_GFp                  636	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_GROUP_set_curve_GF2m                 637	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC2M
+EC_GROUP_get_curve_GF2m                 638	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC2M
+EC_GROUP_get_degree                     639	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_check                          640	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_check_discriminant             641	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_cmp                            642	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_new_curve_GFp                  643	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_new_curve_GF2m                 644	4_0_0	EXIST::FUNCTION:EC,EC2M
+EC_GROUP_new_from_params                645	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_to_params                      646	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_new_by_curve_name_ex           647	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_new_by_curve_name              648	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_new_from_ecparameters          649	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get_ecparameters               650	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_new_from_ecpkparameters        651	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get_ecpkparameters             652	4_0_0	EXIST::FUNCTION:EC
+EC_get_builtin_curves                   653	4_0_0	EXIST::FUNCTION:EC
+EC_curve_nid2nist                       654	4_0_0	EXIST::FUNCTION:EC
+EC_curve_nist2nid                       655	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_check_named_curve              656	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_new                            657	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_free                           658	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_clear_free                     659	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_copy                           660	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_dup                            661	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_set_to_infinity                662	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_method_of                      663	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_POINT_set_Jprojective_coordinates_GFp 664	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_POINT_get_Jprojective_coordinates_GFp 665	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_POINT_set_affine_coordinates         666	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_get_affine_coordinates         667	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_set_affine_coordinates_GFp     668	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_POINT_get_affine_coordinates_GFp     669	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_POINT_set_compressed_coordinates     670	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_set_compressed_coordinates_GFp 671	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_POINT_set_affine_coordinates_GF2m    672	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC2M
+EC_POINT_get_affine_coordinates_GF2m    673	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC2M
+EC_POINT_set_compressed_coordinates_GF2m 674	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,EC2M
+EC_POINT_point2oct                      675	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_oct2point                      676	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_point2buf                      677	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_point2bn                       678	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_POINT_bn2point                       679	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_POINT_point2hex                      680	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_hex2point                      681	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_add                            682	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_dbl                            683	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_invert                         684	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_is_at_infinity                 685	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_is_on_curve                    686	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_cmp                            687	4_0_0	EXIST::FUNCTION:EC
+EC_POINT_make_affine                    688	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_POINTs_make_affine                   689	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_POINTs_mul                           690	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_POINT_mul                            691	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_precompute_mult                692	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_GROUP_have_precompute_mult           693	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ECPKPARAMETERS_it                       694	4_0_0	EXIST::FUNCTION:EC
+ECPKPARAMETERS_free                     695	4_0_0	EXIST::FUNCTION:EC
+ECPKPARAMETERS_new                      696	4_0_0	EXIST::FUNCTION:EC
+ECPARAMETERS_it                         697	4_0_0	EXIST::FUNCTION:EC
+ECPARAMETERS_free                       698	4_0_0	EXIST::FUNCTION:EC
+ECPARAMETERS_new                        699	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get_basis_type                 700	4_0_0	EXIST::FUNCTION:EC
+EC_GROUP_get_trinomial_basis            701	4_0_0	EXIST::FUNCTION:EC,EC2M
+EC_GROUP_get_pentanomial_basis          702	4_0_0	EXIST::FUNCTION:EC,EC2M
+d2i_ECPKParameters                      703	4_0_0	EXIST::FUNCTION:EC
+i2d_ECPKParameters                      704	4_0_0	EXIST::FUNCTION:EC
+ECPKParameters_print                    705	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ECPKParameters_print_fp                 706	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
+EC_KEY_new_ex                           707	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_new                              708	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_get_flags                        709	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_set_flags                        710	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_clear_flags                      711	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_decoded_from_explicit_params     712	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_new_by_curve_name_ex             713	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_new_by_curve_name                714	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_free                             715	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_copy                             716	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_dup                              717	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_up_ref                           718	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_get0_group                       719	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_set_group                        720	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_get0_private_key                 721	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_set_private_key                  722	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_get0_public_key                  723	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_set_public_key                   724	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_get_enc_flags                    725	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_set_enc_flags                    726	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_get_conv_form                    727	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_set_conv_form                    728	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_set_ex_data                      729	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_get_ex_data                      730	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_set_asn1_flag                    731	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_precompute_mult                  732	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_generate_key                     733	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_check_key                        734	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_can_sign                         735	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_set_public_key_affine_coordinates 736	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_key2buf                          737	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_oct2key                          738	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_oct2priv                         739	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_priv2oct                         740	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_priv2buf                         741	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+d2i_ECPrivateKey                        742	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+i2d_ECPrivateKey                        743	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+d2i_ECParameters                        744	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+i2d_ECParameters                        745	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+o2i_ECPublicKey                         746	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+i2o_ECPublicKey                         747	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ECParameters_print                      748	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_print                            749	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ECParameters_print_fp                   750	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
+EC_KEY_print_fp                         751	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
+EC_KEY_OpenSSL                          752	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_get_default_method               753	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_set_default_method               754	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_get_method                       755	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_set_method                       756	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_new_method                       757	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ECDH_KDF_X9_62                          758	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ECDH_compute_key                        759	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ECDSA_SIG_new                           760	4_0_0	EXIST::FUNCTION:EC
+ECDSA_SIG_free                          761	4_0_0	EXIST::FUNCTION:EC
+d2i_ECDSA_SIG                           762	4_0_0	EXIST::FUNCTION:EC
+i2d_ECDSA_SIG                           763	4_0_0	EXIST::FUNCTION:EC
+ECDSA_SIG_get0                          764	4_0_0	EXIST::FUNCTION:EC
+ECDSA_SIG_get0_r                        765	4_0_0	EXIST::FUNCTION:EC
+ECDSA_SIG_get0_s                        766	4_0_0	EXIST::FUNCTION:EC
+ECDSA_SIG_set0                          767	4_0_0	EXIST::FUNCTION:EC
+ECDSA_do_sign                           768	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ECDSA_do_sign_ex                        769	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ECDSA_do_verify                         770	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ECDSA_sign_setup                        771	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ECDSA_sign                              772	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ECDSA_sign_ex                           773	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ECDSA_verify                            774	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+ECDSA_size                              775	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_METHOD_new                       776	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_METHOD_free                      777	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_METHOD_set_init                  778	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_METHOD_set_keygen                779	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_METHOD_set_compute_key           780	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_METHOD_set_sign                  781	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_METHOD_set_verify                782	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_METHOD_get_init                  783	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_METHOD_get_keygen                784	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_METHOD_get_compute_key           785	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_METHOD_get_sign                  786	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EC_KEY_METHOD_get_verify                787	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+OSSL_ENCODER_fetch                      788	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_up_ref                     789	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_free                       790	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_get0_provider              791	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_get0_properties            792	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_get0_name                  793	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_get0_description           794	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_is_a                       795	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_do_all_provided            796	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_names_do_all               797	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_gettable_params            798	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_get_params                 799	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_settable_ctx_params        800	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_new                    801	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_set_params             802	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_free                   803	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_set_passphrase         804	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_set_pem_password_cb    805	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_set_passphrase_cb      806	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_set_passphrase_ui      807	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_set_cipher             808	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_set_selection          809	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_set_output_type        810	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_set_output_structure   811	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_add_encoder            812	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_add_extra              813	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_get_num_encoders       814	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_INSTANCE_get_encoder       815	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_INSTANCE_get_encoder_ctx   816	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_INSTANCE_get_output_type   817	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_INSTANCE_get_output_structure 818	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_set_construct          819	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_set_construct_data     820	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_set_cleanup            821	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_to_bio                     822	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_to_fp                      823	4_0_0	EXIST::FUNCTION:STDIO
+OSSL_ENCODER_to_data                    824	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_new_for_pkey           825	4_0_0	EXIST::FUNCTION:
+EVP_set_default_properties              826	4_0_0	EXIST::FUNCTION:
+EVP_get1_default_properties             827	4_0_0	EXIST::FUNCTION:
+EVP_default_properties_is_fips_enabled  828	4_0_0	EXIST::FUNCTION:
+EVP_default_properties_enable_fips      829	4_0_0	EXIST::FUNCTION:
+EVP_MD_get_type                         830	4_0_0	EXIST::FUNCTION:
+EVP_MD_get0_name                        831	4_0_0	EXIST::FUNCTION:
+EVP_MD_get0_description                 832	4_0_0	EXIST::FUNCTION:
+EVP_MD_is_a                             833	4_0_0	EXIST::FUNCTION:
+EVP_MD_names_do_all                     834	4_0_0	EXIST::FUNCTION:
+EVP_MD_get0_provider                    835	4_0_0	EXIST::FUNCTION:
+EVP_MD_get_pkey_type                    836	4_0_0	EXIST::FUNCTION:
+EVP_MD_get_size                         837	4_0_0	EXIST::FUNCTION:
+EVP_MD_get_block_size                   838	4_0_0	EXIST::FUNCTION:
+EVP_MD_get_flags                        839	4_0_0	EXIST::FUNCTION:
+EVP_MD_xof                              840	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_get0_md                      841	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_get1_md                      842	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_md                           843	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_MD_CTX_get_size_ex                  844	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_get_pkey_ctx                 845	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_set_pkey_ctx                 846	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_get0_md_data                 847	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_0
+EVP_CIPHER_get_nid                      848	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_get0_name                    849	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_get0_description             850	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_is_a                         851	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_names_do_all                 852	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_get0_provider                853	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_get_block_size               854	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_impl_ctx_size                855	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_CIPHER_get_key_length               856	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_get_iv_length                857	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_get_flags                    858	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_get_mode                     859	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_get_type                     860	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_fetch                        861	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_can_pipeline                 862	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_up_ref                       863	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_free                         864	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_get0_cipher              865	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_get1_cipher              866	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_is_encrypting            867	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_get_nid                  868	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_get_block_size           869	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_get_key_length           870	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_get_iv_length            871	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_get_tag_length           872	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_cipher                   873	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_CIPHER_CTX_iv                       874	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_CIPHER_CTX_original_iv              875	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_CIPHER_CTX_iv_noconst               876	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_CIPHER_CTX_get_updated_iv           877	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_get_original_iv          878	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_buf_noconst              879	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_CIPHER_CTX_get_num                  880	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+EVP_CIPHER_CTX_set_num                  881	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+EVP_CIPHER_CTX_dup                      882	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_copy                     883	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_get_app_data             884	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_set_app_data             885	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_get_cipher_data          886	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_set_cipher_data          887	4_0_0	EXIST::FUNCTION:
+EVP_Cipher                              888	4_0_0	EXIST::FUNCTION:
+EVP_MD_get_params                       889	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_set_params                   890	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_get_params                   891	4_0_0	EXIST::FUNCTION:
+EVP_MD_gettable_params                  892	4_0_0	EXIST::FUNCTION:
+EVP_MD_settable_ctx_params              893	4_0_0	EXIST::FUNCTION:
+EVP_MD_gettable_ctx_params              894	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_settable_params              895	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_gettable_params              896	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_ctrl                         897	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_new                          898	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_reset                        899	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_free                         900	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_dup                          901	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_copy_ex                      902	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_set_flags                    903	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_clear_flags                  904	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_test_flags                   905	4_0_0	EXIST::FUNCTION:
+EVP_DigestInit_ex2                      906	4_0_0	EXIST::FUNCTION:
+EVP_DigestInit_ex                       907	4_0_0	EXIST::FUNCTION:
+EVP_DigestUpdate                        908	4_0_0	EXIST::FUNCTION:
+EVP_DigestFinal_ex                      909	4_0_0	EXIST::FUNCTION:
+EVP_Digest                              910	4_0_0	EXIST::FUNCTION:
+EVP_Q_digest                            911	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_copy                         912	4_0_0	EXIST::FUNCTION:
+EVP_DigestInit                          913	4_0_0	EXIST::FUNCTION:
+EVP_DigestFinal                         914	4_0_0	EXIST::FUNCTION:
+EVP_DigestFinalXOF                      915	4_0_0	EXIST::FUNCTION:
+EVP_DigestSqueeze                       916	4_0_0	EXIST::FUNCTION:
+EVP_MD_fetch                            917	4_0_0	EXIST::FUNCTION:
+EVP_MD_up_ref                           918	4_0_0	EXIST::FUNCTION:
+EVP_MD_free                             919	4_0_0	EXIST::FUNCTION:
+EVP_read_pw_string                      920	4_0_0	EXIST::FUNCTION:
+EVP_read_pw_string_min                  921	4_0_0	EXIST::FUNCTION:
+EVP_set_pw_prompt                       922	4_0_0	EXIST::FUNCTION:
+EVP_get_pw_prompt                       923	4_0_0	EXIST::FUNCTION:
+EVP_BytesToKey                          924	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_set_flags                925	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_clear_flags              926	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_test_flags               927	4_0_0	EXIST::FUNCTION:
+EVP_EncryptInit                         928	4_0_0	EXIST::FUNCTION:
+EVP_EncryptInit_ex                      929	4_0_0	EXIST::FUNCTION:
+EVP_EncryptInit_ex2                     930	4_0_0	EXIST::FUNCTION:
+EVP_EncryptUpdate                       931	4_0_0	EXIST::FUNCTION:
+EVP_EncryptFinal_ex                     932	4_0_0	EXIST::FUNCTION:
+EVP_EncryptFinal                        933	4_0_0	EXIST::FUNCTION:
+EVP_DecryptInit                         934	4_0_0	EXIST::FUNCTION:
+EVP_DecryptInit_ex                      935	4_0_0	EXIST::FUNCTION:
+EVP_DecryptInit_ex2                     936	4_0_0	EXIST::FUNCTION:
+EVP_DecryptUpdate                       937	4_0_0	EXIST::FUNCTION:
+EVP_DecryptFinal                        938	4_0_0	EXIST::FUNCTION:
+EVP_DecryptFinal_ex                     939	4_0_0	EXIST::FUNCTION:
+EVP_CipherInit                          940	4_0_0	EXIST::FUNCTION:
+EVP_CipherInit_ex                       941	4_0_0	EXIST::FUNCTION:
+EVP_CipherInit_SKEY                     942	4_0_0	EXIST::FUNCTION:
+EVP_CipherInit_ex2                      943	4_0_0	EXIST::FUNCTION:
+EVP_CipherUpdate                        944	4_0_0	EXIST::FUNCTION:
+EVP_CipherFinal                         945	4_0_0	EXIST::FUNCTION:
+EVP_CipherPipelineEncryptInit           946	4_0_0	EXIST::FUNCTION:
+EVP_CipherPipelineDecryptInit           947	4_0_0	EXIST::FUNCTION:
+EVP_CipherPipelineUpdate                948	4_0_0	EXIST::FUNCTION:
+EVP_CipherPipelineFinal                 949	4_0_0	EXIST::FUNCTION:
+EVP_CipherFinal_ex                      950	4_0_0	EXIST::FUNCTION:
+EVP_SignFinal                           951	4_0_0	EXIST::FUNCTION:
+EVP_SignFinal_ex                        952	4_0_0	EXIST::FUNCTION:
+EVP_DigestSign                          953	4_0_0	EXIST::FUNCTION:
+EVP_VerifyFinal                         954	4_0_0	EXIST::FUNCTION:
+EVP_VerifyFinal_ex                      955	4_0_0	EXIST::FUNCTION:
+EVP_DigestVerify                        956	4_0_0	EXIST::FUNCTION:
+EVP_DigestSignInit_ex                   957	4_0_0	EXIST::FUNCTION:
+EVP_DigestSignInit                      958	4_0_0	EXIST::FUNCTION:
+EVP_DigestSignUpdate                    959	4_0_0	EXIST::FUNCTION:
+EVP_DigestSignFinal                     960	4_0_0	EXIST::FUNCTION:
+EVP_DigestVerifyInit_ex                 961	4_0_0	EXIST::FUNCTION:
+EVP_DigestVerifyInit                    962	4_0_0	EXIST::FUNCTION:
+EVP_DigestVerifyUpdate                  963	4_0_0	EXIST::FUNCTION:
+EVP_DigestVerifyFinal                   964	4_0_0	EXIST::FUNCTION:
+EVP_OpenInit                            965	4_0_0	EXIST::FUNCTION:
+EVP_OpenFinal                           966	4_0_0	EXIST::FUNCTION:
+EVP_SealInit                            967	4_0_0	EXIST::FUNCTION:
+EVP_SealFinal                           968	4_0_0	EXIST::FUNCTION:
+EVP_ENCODE_CTX_new                      969	4_0_0	EXIST::FUNCTION:
+EVP_ENCODE_CTX_free                     970	4_0_0	EXIST::FUNCTION:
+EVP_ENCODE_CTX_copy                     971	4_0_0	EXIST::FUNCTION:
+EVP_ENCODE_CTX_num                      972	4_0_0	EXIST::FUNCTION:
+EVP_EncodeInit                          973	4_0_0	EXIST::FUNCTION:
+EVP_EncodeUpdate                        974	4_0_0	EXIST::FUNCTION:
+EVP_EncodeFinal                         975	4_0_0	EXIST::FUNCTION:
+EVP_EncodeBlock                         976	4_0_0	EXIST::FUNCTION:
+EVP_DecodeInit                          977	4_0_0	EXIST::FUNCTION:
+EVP_DecodeUpdate                        978	4_0_0	EXIST::FUNCTION:
+EVP_DecodeFinal                         979	4_0_0	EXIST::FUNCTION:
+EVP_DecodeBlock                         980	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_new                      981	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_reset                    982	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_free                     983	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_set_key_length           984	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_set_padding              985	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_ctrl                     986	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_rand_key                 987	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_get_params                   988	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_set_params               989	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_get_params               990	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_gettable_params              991	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_settable_ctx_params          992	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_gettable_ctx_params          993	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_settable_params          994	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_gettable_params          995	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_set_algor_params         996	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_get_algor_params         997	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_CTX_get_algor                998	4_0_0	EXIST::FUNCTION:
+BIO_f_md                                999	4_0_0	EXIST::FUNCTION:
+BIO_f_base64                            1000	4_0_0	EXIST::FUNCTION:
+BIO_f_cipher                            1001	4_0_0	EXIST::FUNCTION:
+BIO_set_cipher                          1002	4_0_0	EXIST::FUNCTION:
+EVP_md_null                             1003	4_0_0	EXIST::FUNCTION:
+EVP_md2                                 1004	4_0_0	EXIST::FUNCTION:MD2
+EVP_md4                                 1005	4_0_0	EXIST::FUNCTION:MD4
+EVP_md5                                 1006	4_0_0	EXIST::FUNCTION:MD5
+EVP_md5_sha1                            1007	4_0_0	EXIST::FUNCTION:MD5
+EVP_blake2b512                          1008	4_0_0	EXIST::FUNCTION:BLAKE2
+EVP_blake2s256                          1009	4_0_0	EXIST::FUNCTION:BLAKE2
+EVP_sha1                                1010	4_0_0	EXIST::FUNCTION:
+EVP_sha224                              1011	4_0_0	EXIST::FUNCTION:
+EVP_sha256                              1012	4_0_0	EXIST::FUNCTION:
+EVP_sha384                              1013	4_0_0	EXIST::FUNCTION:
+EVP_sha512                              1014	4_0_0	EXIST::FUNCTION:
+EVP_sha512_224                          1015	4_0_0	EXIST::FUNCTION:
+EVP_sha512_256                          1016	4_0_0	EXIST::FUNCTION:
+EVP_sha3_224                            1017	4_0_0	EXIST::FUNCTION:
+EVP_sha3_256                            1018	4_0_0	EXIST::FUNCTION:
+EVP_sha3_384                            1019	4_0_0	EXIST::FUNCTION:
+EVP_sha3_512                            1020	4_0_0	EXIST::FUNCTION:
+EVP_shake128                            1021	4_0_0	EXIST::FUNCTION:
+EVP_shake256                            1022	4_0_0	EXIST::FUNCTION:
+EVP_mdc2                                1023	4_0_0	EXIST::FUNCTION:MDC2
+EVP_ripemd160                           1024	4_0_0	EXIST::FUNCTION:RMD160
+EVP_whirlpool                           1025	4_0_0	EXIST::FUNCTION:WHIRLPOOL
+EVP_sm3                                 1026	4_0_0	EXIST::FUNCTION:SM3
+EVP_enc_null                            1027	4_0_0	EXIST::FUNCTION:
+EVP_des_ecb                             1028	4_0_0	EXIST::FUNCTION:DES
+EVP_des_ede                             1029	4_0_0	EXIST::FUNCTION:DES
+EVP_des_ede3                            1030	4_0_0	EXIST::FUNCTION:DES
+EVP_des_ede_ecb                         1031	4_0_0	EXIST::FUNCTION:DES
+EVP_des_ede3_ecb                        1032	4_0_0	EXIST::FUNCTION:DES
+EVP_des_cfb64                           1033	4_0_0	EXIST::FUNCTION:DES
+EVP_des_cfb1                            1034	4_0_0	EXIST::FUNCTION:DES
+EVP_des_cfb8                            1035	4_0_0	EXIST::FUNCTION:DES
+EVP_des_ede_cfb64                       1036	4_0_0	EXIST::FUNCTION:DES
+EVP_des_ede3_cfb64                      1037	4_0_0	EXIST::FUNCTION:DES
+EVP_des_ede3_cfb1                       1038	4_0_0	EXIST::FUNCTION:DES
+EVP_des_ede3_cfb8                       1039	4_0_0	EXIST::FUNCTION:DES
+EVP_des_ofb                             1040	4_0_0	EXIST::FUNCTION:DES
+EVP_des_ede_ofb                         1041	4_0_0	EXIST::FUNCTION:DES
+EVP_des_ede3_ofb                        1042	4_0_0	EXIST::FUNCTION:DES
+EVP_des_cbc                             1043	4_0_0	EXIST::FUNCTION:DES
+EVP_des_ede_cbc                         1044	4_0_0	EXIST::FUNCTION:DES
+EVP_des_ede3_cbc                        1045	4_0_0	EXIST::FUNCTION:DES
+EVP_desx_cbc                            1046	4_0_0	EXIST::FUNCTION:DES
+EVP_des_ede3_wrap                       1047	4_0_0	EXIST::FUNCTION:DES
+EVP_rc4                                 1048	4_0_0	EXIST::FUNCTION:RC4
+EVP_rc4_40                              1049	4_0_0	EXIST::FUNCTION:RC4
+EVP_rc4_hmac_md5                        1050	4_0_0	EXIST::FUNCTION:MD5,RC4
+EVP_idea_ecb                            1051	4_0_0	EXIST::FUNCTION:IDEA
+EVP_idea_cfb64                          1052	4_0_0	EXIST::FUNCTION:IDEA
+EVP_idea_ofb                            1053	4_0_0	EXIST::FUNCTION:IDEA
+EVP_idea_cbc                            1054	4_0_0	EXIST::FUNCTION:IDEA
+EVP_rc2_ecb                             1055	4_0_0	EXIST::FUNCTION:RC2
+EVP_rc2_cbc                             1056	4_0_0	EXIST::FUNCTION:RC2
+EVP_rc2_40_cbc                          1057	4_0_0	EXIST::FUNCTION:RC2
+EVP_rc2_64_cbc                          1058	4_0_0	EXIST::FUNCTION:RC2
+EVP_rc2_cfb64                           1059	4_0_0	EXIST::FUNCTION:RC2
+EVP_rc2_ofb                             1060	4_0_0	EXIST::FUNCTION:RC2
+EVP_bf_ecb                              1061	4_0_0	EXIST::FUNCTION:BF
+EVP_bf_cbc                              1062	4_0_0	EXIST::FUNCTION:BF
+EVP_bf_cfb64                            1063	4_0_0	EXIST::FUNCTION:BF
+EVP_bf_ofb                              1064	4_0_0	EXIST::FUNCTION:BF
+EVP_cast5_ecb                           1065	4_0_0	EXIST::FUNCTION:CAST
+EVP_cast5_cbc                           1066	4_0_0	EXIST::FUNCTION:CAST
+EVP_cast5_cfb64                         1067	4_0_0	EXIST::FUNCTION:CAST
+EVP_cast5_ofb                           1068	4_0_0	EXIST::FUNCTION:CAST
+EVP_rc5_32_12_16_cbc                    1069	4_0_0	EXIST::FUNCTION:RC5
+EVP_rc5_32_12_16_ecb                    1070	4_0_0	EXIST::FUNCTION:RC5
+EVP_rc5_32_12_16_cfb64                  1071	4_0_0	EXIST::FUNCTION:RC5
+EVP_rc5_32_12_16_ofb                    1072	4_0_0	EXIST::FUNCTION:RC5
+EVP_aes_128_ecb                         1073	4_0_0	EXIST::FUNCTION:
+EVP_aes_128_cbc                         1074	4_0_0	EXIST::FUNCTION:
+EVP_aes_128_cfb1                        1075	4_0_0	EXIST::FUNCTION:
+EVP_aes_128_cfb8                        1076	4_0_0	EXIST::FUNCTION:
+EVP_aes_128_cfb128                      1077	4_0_0	EXIST::FUNCTION:
+EVP_aes_128_ofb                         1078	4_0_0	EXIST::FUNCTION:
+EVP_aes_128_ctr                         1079	4_0_0	EXIST::FUNCTION:
+EVP_aes_128_ccm                         1080	4_0_0	EXIST::FUNCTION:
+EVP_aes_128_gcm                         1081	4_0_0	EXIST::FUNCTION:
+EVP_aes_128_xts                         1082	4_0_0	EXIST::FUNCTION:
+EVP_aes_128_wrap                        1083	4_0_0	EXIST::FUNCTION:
+EVP_aes_128_wrap_pad                    1084	4_0_0	EXIST::FUNCTION:
+EVP_aes_128_ocb                         1085	4_0_0	EXIST::FUNCTION:OCB
+EVP_aes_192_ecb                         1086	4_0_0	EXIST::FUNCTION:
+EVP_aes_192_cbc                         1087	4_0_0	EXIST::FUNCTION:
+EVP_aes_192_cfb1                        1088	4_0_0	EXIST::FUNCTION:
+EVP_aes_192_cfb8                        1089	4_0_0	EXIST::FUNCTION:
+EVP_aes_192_cfb128                      1090	4_0_0	EXIST::FUNCTION:
+EVP_aes_192_ofb                         1091	4_0_0	EXIST::FUNCTION:
+EVP_aes_192_ctr                         1092	4_0_0	EXIST::FUNCTION:
+EVP_aes_192_ccm                         1093	4_0_0	EXIST::FUNCTION:
+EVP_aes_192_gcm                         1094	4_0_0	EXIST::FUNCTION:
+EVP_aes_192_wrap                        1095	4_0_0	EXIST::FUNCTION:
+EVP_aes_192_wrap_pad                    1096	4_0_0	EXIST::FUNCTION:
+EVP_aes_192_ocb                         1097	4_0_0	EXIST::FUNCTION:OCB
+EVP_aes_256_ecb                         1098	4_0_0	EXIST::FUNCTION:
+EVP_aes_256_cbc                         1099	4_0_0	EXIST::FUNCTION:
+EVP_aes_256_cfb1                        1100	4_0_0	EXIST::FUNCTION:
+EVP_aes_256_cfb8                        1101	4_0_0	EXIST::FUNCTION:
+EVP_aes_256_cfb128                      1102	4_0_0	EXIST::FUNCTION:
+EVP_aes_256_ofb                         1103	4_0_0	EXIST::FUNCTION:
+EVP_aes_256_ctr                         1104	4_0_0	EXIST::FUNCTION:
+EVP_aes_256_ccm                         1105	4_0_0	EXIST::FUNCTION:
+EVP_aes_256_gcm                         1106	4_0_0	EXIST::FUNCTION:
+EVP_aes_256_xts                         1107	4_0_0	EXIST::FUNCTION:
+EVP_aes_256_wrap                        1108	4_0_0	EXIST::FUNCTION:
+EVP_aes_256_wrap_pad                    1109	4_0_0	EXIST::FUNCTION:
+EVP_aes_256_ocb                         1110	4_0_0	EXIST::FUNCTION:OCB
+EVP_aes_128_cbc_hmac_sha1               1111	4_0_0	EXIST::FUNCTION:
+EVP_aes_256_cbc_hmac_sha1               1112	4_0_0	EXIST::FUNCTION:
+EVP_aes_128_cbc_hmac_sha256             1113	4_0_0	EXIST::FUNCTION:
+EVP_aes_256_cbc_hmac_sha256             1114	4_0_0	EXIST::FUNCTION:
+EVP_aria_128_ecb                        1115	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_128_cbc                        1116	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_128_cfb1                       1117	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_128_cfb8                       1118	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_128_cfb128                     1119	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_128_ctr                        1120	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_128_ofb                        1121	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_128_gcm                        1122	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_128_ccm                        1123	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_192_ecb                        1124	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_192_cbc                        1125	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_192_cfb1                       1126	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_192_cfb8                       1127	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_192_cfb128                     1128	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_192_ctr                        1129	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_192_ofb                        1130	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_192_gcm                        1131	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_192_ccm                        1132	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_256_ecb                        1133	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_256_cbc                        1134	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_256_cfb1                       1135	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_256_cfb8                       1136	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_256_cfb128                     1137	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_256_ctr                        1138	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_256_ofb                        1139	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_256_gcm                        1140	4_0_0	EXIST::FUNCTION:ARIA
+EVP_aria_256_ccm                        1141	4_0_0	EXIST::FUNCTION:ARIA
+EVP_camellia_128_ecb                    1142	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_128_cbc                    1143	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_128_cfb1                   1144	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_128_cfb8                   1145	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_128_cfb128                 1146	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_128_ofb                    1147	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_128_ctr                    1148	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_192_ecb                    1149	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_192_cbc                    1150	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_192_cfb1                   1151	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_192_cfb8                   1152	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_192_cfb128                 1153	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_192_ofb                    1154	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_192_ctr                    1155	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_256_ecb                    1156	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_256_cbc                    1157	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_256_cfb1                   1158	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_256_cfb8                   1159	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_256_cfb128                 1160	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_256_ofb                    1161	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_camellia_256_ctr                    1162	4_0_0	EXIST::FUNCTION:CAMELLIA
+EVP_chacha20                            1163	4_0_0	EXIST::FUNCTION:CHACHA
+EVP_chacha20_poly1305                   1164	4_0_0	EXIST::FUNCTION:CHACHA,POLY1305
+EVP_seed_ecb                            1165	4_0_0	EXIST::FUNCTION:SEED
+EVP_seed_cbc                            1166	4_0_0	EXIST::FUNCTION:SEED
+EVP_seed_cfb128                         1167	4_0_0	EXIST::FUNCTION:SEED
+EVP_seed_ofb                            1168	4_0_0	EXIST::FUNCTION:SEED
+EVP_sm4_ecb                             1169	4_0_0	EXIST::FUNCTION:SM4
+EVP_sm4_cbc                             1170	4_0_0	EXIST::FUNCTION:SM4
+EVP_sm4_cfb128                          1171	4_0_0	EXIST::FUNCTION:SM4
+EVP_sm4_ofb                             1172	4_0_0	EXIST::FUNCTION:SM4
+EVP_sm4_ctr                             1173	4_0_0	EXIST::FUNCTION:SM4
+EVP_add_cipher                          1174	4_0_0	EXIST::FUNCTION:
+EVP_add_digest                          1175	4_0_0	EXIST::FUNCTION:
+EVP_get_cipherbyname                    1176	4_0_0	EXIST::FUNCTION:
+EVP_get_digestbyname                    1177	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_do_all                       1178	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_do_all_sorted                1179	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_do_all_provided              1180	4_0_0	EXIST::FUNCTION:
+EVP_MD_do_all                           1181	4_0_0	EXIST::FUNCTION:
+EVP_MD_do_all_sorted                    1182	4_0_0	EXIST::FUNCTION:
+EVP_MD_do_all_provided                  1183	4_0_0	EXIST::FUNCTION:
+EVP_MAC_fetch                           1184	4_0_0	EXIST::FUNCTION:
+EVP_MAC_up_ref                          1185	4_0_0	EXIST::FUNCTION:
+EVP_MAC_free                            1186	4_0_0	EXIST::FUNCTION:
+EVP_MAC_get0_name                       1187	4_0_0	EXIST::FUNCTION:
+EVP_MAC_get0_description                1188	4_0_0	EXIST::FUNCTION:
+EVP_MAC_is_a                            1189	4_0_0	EXIST::FUNCTION:
+EVP_MAC_get0_provider                   1190	4_0_0	EXIST::FUNCTION:
+EVP_MAC_get_params                      1191	4_0_0	EXIST::FUNCTION:
+EVP_MAC_CTX_new                         1192	4_0_0	EXIST::FUNCTION:
+EVP_MAC_CTX_free                        1193	4_0_0	EXIST::FUNCTION:
+EVP_MAC_CTX_dup                         1194	4_0_0	EXIST::FUNCTION:
+EVP_MAC_CTX_get0_mac                    1195	4_0_0	EXIST::FUNCTION:
+EVP_MAC_CTX_get_params                  1196	4_0_0	EXIST::FUNCTION:
+EVP_MAC_CTX_set_params                  1197	4_0_0	EXIST::FUNCTION:
+EVP_MAC_CTX_get_mac_size                1198	4_0_0	EXIST::FUNCTION:
+EVP_MAC_CTX_get_block_size              1199	4_0_0	EXIST::FUNCTION:
+EVP_Q_mac                               1200	4_0_0	EXIST::FUNCTION:
+EVP_MAC_init                            1201	4_0_0	EXIST::FUNCTION:
+EVP_MAC_init_SKEY                       1202	4_0_0	EXIST::FUNCTION:
+EVP_MAC_update                          1203	4_0_0	EXIST::FUNCTION:
+EVP_MAC_final                           1204	4_0_0	EXIST::FUNCTION:
+EVP_MAC_finalXOF                        1205	4_0_0	EXIST::FUNCTION:
+EVP_MAC_gettable_params                 1206	4_0_0	EXIST::FUNCTION:
+EVP_MAC_gettable_ctx_params             1207	4_0_0	EXIST::FUNCTION:
+EVP_MAC_settable_ctx_params             1208	4_0_0	EXIST::FUNCTION:
+EVP_MAC_CTX_gettable_params             1209	4_0_0	EXIST::FUNCTION:
+EVP_MAC_CTX_settable_params             1210	4_0_0	EXIST::FUNCTION:
+EVP_MAC_do_all_provided                 1211	4_0_0	EXIST::FUNCTION:
+EVP_MAC_names_do_all                    1212	4_0_0	EXIST::FUNCTION:
+EVP_RAND_fetch                          1213	4_0_0	EXIST::FUNCTION:
+EVP_RAND_up_ref                         1214	4_0_0	EXIST::FUNCTION:
+EVP_RAND_free                           1215	4_0_0	EXIST::FUNCTION:
+EVP_RAND_get0_name                      1216	4_0_0	EXIST::FUNCTION:
+EVP_RAND_get0_description               1217	4_0_0	EXIST::FUNCTION:
+EVP_RAND_is_a                           1218	4_0_0	EXIST::FUNCTION:
+EVP_RAND_get0_provider                  1219	4_0_0	EXIST::FUNCTION:
+EVP_RAND_get_params                     1220	4_0_0	EXIST::FUNCTION:
+EVP_RAND_CTX_new                        1221	4_0_0	EXIST::FUNCTION:
+EVP_RAND_CTX_up_ref                     1222	4_0_0	EXIST::FUNCTION:
+EVP_RAND_CTX_free                       1223	4_0_0	EXIST::FUNCTION:
+EVP_RAND_CTX_get0_rand                  1224	4_0_0	EXIST::FUNCTION:
+EVP_RAND_CTX_get_params                 1225	4_0_0	EXIST::FUNCTION:
+EVP_RAND_CTX_set_params                 1226	4_0_0	EXIST::FUNCTION:
+EVP_RAND_gettable_params                1227	4_0_0	EXIST::FUNCTION:
+EVP_RAND_gettable_ctx_params            1228	4_0_0	EXIST::FUNCTION:
+EVP_RAND_settable_ctx_params            1229	4_0_0	EXIST::FUNCTION:
+EVP_RAND_CTX_gettable_params            1230	4_0_0	EXIST::FUNCTION:
+EVP_RAND_CTX_settable_params            1231	4_0_0	EXIST::FUNCTION:
+EVP_RAND_do_all_provided                1232	4_0_0	EXIST::FUNCTION:
+EVP_RAND_names_do_all                   1233	4_0_0	EXIST::FUNCTION:
+EVP_RAND_instantiate                    1234	4_0_0	EXIST::FUNCTION:
+EVP_RAND_uninstantiate                  1235	4_0_0	EXIST::FUNCTION:
+EVP_RAND_generate                       1236	4_0_0	EXIST::FUNCTION:
+EVP_RAND_reseed                         1237	4_0_0	EXIST::FUNCTION:
+EVP_RAND_nonce                          1238	4_0_0	EXIST::FUNCTION:
+EVP_RAND_enable_locking                 1239	4_0_0	EXIST::FUNCTION:
+EVP_RAND_verify_zeroization             1240	4_0_0	EXIST::FUNCTION:
+EVP_RAND_get_strength                   1241	4_0_0	EXIST::FUNCTION:
+EVP_RAND_get_state                      1242	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_decrypt_old                    1243	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_PKEY_encrypt_old                    1244	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_PKEY_is_a                           1245	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_type_names_do_all              1246	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_type                           1247	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_id                         1248	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_base_id                    1249	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_bits                       1250	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_security_bits              1251	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_security_category          1252	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_size                       1253	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_can_sign                       1254	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_set_type                       1255	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_set_type_str                   1256	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_set_type_by_keymgmt            1257	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_assign                         1258	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_PKEY_get0                           1259	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_PKEY_get0_hmac                      1260	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_PKEY_get0_poly1305                  1261	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,POLY1305
+EVP_PKEY_get0_siphash                   1262	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SIPHASH
+EVP_PKEY_set1_RSA                       1263	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_PKEY_get0_RSA                       1264	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_PKEY_get1_RSA                       1265	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_PKEY_set1_DSA                       1266	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+EVP_PKEY_get0_DSA                       1267	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+EVP_PKEY_get1_DSA                       1268	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+EVP_PKEY_set1_DH                        1269	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+EVP_PKEY_get0_DH                        1270	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+EVP_PKEY_get1_DH                        1271	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+EVP_PKEY_set1_EC_KEY                    1272	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EVP_PKEY_get0_EC_KEY                    1273	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EVP_PKEY_get1_EC_KEY                    1274	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+EVP_PKEY_new                            1275	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_up_ref                         1276	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_dup                            1277	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_free                           1278	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get0_description               1279	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get0_provider                  1280	4_0_0	EXIST::FUNCTION:
+d2i_PublicKey                           1281	4_0_0	EXIST::FUNCTION:
+i2d_PublicKey                           1282	4_0_0	EXIST::FUNCTION:
+d2i_PrivateKey_ex                       1283	4_0_0	EXIST::FUNCTION:
+d2i_PrivateKey                          1284	4_0_0	EXIST::FUNCTION:
+d2i_AutoPrivateKey_ex                   1285	4_0_0	EXIST::FUNCTION:
+d2i_AutoPrivateKey                      1286	4_0_0	EXIST::FUNCTION:
+i2d_PrivateKey                          1287	4_0_0	EXIST::FUNCTION:
+i2d_PKCS8PrivateKey                     1288	4_0_0	EXIST::FUNCTION:
+i2d_KeyParams                           1289	4_0_0	EXIST::FUNCTION:
+d2i_KeyParams                           1290	4_0_0	EXIST::FUNCTION:
+i2d_KeyParams_bio                       1291	4_0_0	EXIST::FUNCTION:
+d2i_KeyParams_bio                       1292	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_copy_parameters                1293	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_missing_parameters             1294	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_save_parameters                1295	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_parameters_eq                  1296	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_eq                             1297	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_cmp_parameters                 1298	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_PKEY_cmp                            1299	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_PKEY_print_public                   1300	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_print_private                  1301	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_print_params                   1302	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_print_public_fp                1303	4_0_0	EXIST::FUNCTION:STDIO
+EVP_PKEY_print_private_fp               1304	4_0_0	EXIST::FUNCTION:STDIO
+EVP_PKEY_print_params_fp                1305	4_0_0	EXIST::FUNCTION:STDIO
+EVP_PKEY_get_default_digest_nid         1306	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_default_digest_name        1307	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_digestsign_supports_digest     1308	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_set1_encoded_public_key        1309	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get1_encoded_public_key        1310	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_param_to_asn1                1311	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_asn1_to_param                1312	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_set_asn1_iv                  1313	4_0_0	EXIST::FUNCTION:
+EVP_CIPHER_get_asn1_iv                  1314	4_0_0	EXIST::FUNCTION:
+PKCS5_PBE_keyivgen                      1315	4_0_0	EXIST::FUNCTION:
+PKCS5_PBE_keyivgen_ex                   1316	4_0_0	EXIST::FUNCTION:
+PKCS5_PBKDF2_HMAC_SHA1                  1317	4_0_0	EXIST::FUNCTION:
+PKCS5_PBKDF2_HMAC                       1318	4_0_0	EXIST::FUNCTION:
+PKCS5_v2_PBE_keyivgen                   1319	4_0_0	EXIST::FUNCTION:
+PKCS5_v2_PBE_keyivgen_ex                1320	4_0_0	EXIST::FUNCTION:
+EVP_PBE_scrypt                          1321	4_0_0	EXIST::FUNCTION:SCRYPT
+EVP_PBE_scrypt_ex                       1322	4_0_0	EXIST::FUNCTION:SCRYPT
+PKCS5_v2_scrypt_keyivgen                1323	4_0_0	EXIST::FUNCTION:SCRYPT
+PKCS5_v2_scrypt_keyivgen_ex             1324	4_0_0	EXIST::FUNCTION:SCRYPT
+PKCS5_PBE_add                           1325	4_0_0	EXIST::FUNCTION:
+EVP_PBE_CipherInit                      1326	4_0_0	EXIST::FUNCTION:
+EVP_PBE_CipherInit_ex                   1327	4_0_0	EXIST::FUNCTION:
+EVP_PBE_alg_add_type                    1328	4_0_0	EXIST::FUNCTION:
+EVP_PBE_alg_add                         1329	4_0_0	EXIST::FUNCTION:
+EVP_PBE_find                            1330	4_0_0	EXIST::FUNCTION:
+EVP_PBE_find_ex                         1331	4_0_0	EXIST::FUNCTION:
+EVP_PBE_cleanup                         1332	4_0_0	EXIST::FUNCTION:
+EVP_PBE_get                             1333	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_signature_md           1334	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_signature_md           1335	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set1_id                    1336	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get1_id                    1337	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get1_id_len                1338	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_kem_op                 1339	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get0_type_name                 1340	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_mac_key                1341	4_0_0	EXIST::FUNCTION:
+EVP_KEYMGMT_fetch                       1342	4_0_0	EXIST::FUNCTION:
+EVP_KEYMGMT_up_ref                      1343	4_0_0	EXIST::FUNCTION:
+EVP_KEYMGMT_free                        1344	4_0_0	EXIST::FUNCTION:
+EVP_KEYMGMT_get0_provider               1345	4_0_0	EXIST::FUNCTION:
+EVP_KEYMGMT_get0_name                   1346	4_0_0	EXIST::FUNCTION:
+EVP_KEYMGMT_get0_description            1347	4_0_0	EXIST::FUNCTION:
+EVP_KEYMGMT_is_a                        1348	4_0_0	EXIST::FUNCTION:
+EVP_KEYMGMT_do_all_provided             1349	4_0_0	EXIST::FUNCTION:
+EVP_KEYMGMT_names_do_all                1350	4_0_0	EXIST::FUNCTION:
+EVP_KEYMGMT_gettable_params             1351	4_0_0	EXIST::FUNCTION:
+EVP_KEYMGMT_settable_params             1352	4_0_0	EXIST::FUNCTION:
+EVP_KEYMGMT_gen_settable_params         1353	4_0_0	EXIST::FUNCTION:
+EVP_KEYMGMT_gen_gettable_params         1354	4_0_0	EXIST::FUNCTION:
+EVP_SKEYMGMT_fetch                      1355	4_0_0	EXIST::FUNCTION:
+EVP_SKEYMGMT_up_ref                     1356	4_0_0	EXIST::FUNCTION:
+EVP_SKEYMGMT_free                       1357	4_0_0	EXIST::FUNCTION:
+EVP_SKEYMGMT_get0_provider              1358	4_0_0	EXIST::FUNCTION:
+EVP_SKEYMGMT_get0_name                  1359	4_0_0	EXIST::FUNCTION:
+EVP_SKEYMGMT_get0_description           1360	4_0_0	EXIST::FUNCTION:
+EVP_SKEYMGMT_is_a                       1361	4_0_0	EXIST::FUNCTION:
+EVP_SKEYMGMT_do_all_provided            1362	4_0_0	EXIST::FUNCTION:
+EVP_SKEYMGMT_names_do_all               1363	4_0_0	EXIST::FUNCTION:
+EVP_SKEYMGMT_get0_gen_settable_params   1364	4_0_0	EXIST::FUNCTION:
+EVP_SKEYMGMT_get0_imp_settable_params   1365	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_new                        1366	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_new_id                     1367	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_new_from_name              1368	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_new_from_pkey              1369	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_dup                        1370	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_free                       1371	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_is_a                       1372	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_params                 1373	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_gettable_params            1374	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_params                 1375	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_settable_params            1376	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_algor_params           1377	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_algor_params           1378	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_algor                  1379	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_ctrl                       1380	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_ctrl_str                   1381	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_ctrl_uint64                1382	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_str2ctrl                   1383	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_hex2ctrl                   1384	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_md                         1385	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_operation              1386	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set0_keygen_info           1387	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_new_mac_key                    1388	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_new_raw_private_key_ex         1389	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_new_raw_private_key            1390	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_new_raw_public_key_ex          1391	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_new_raw_public_key             1392	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_raw_private_key            1393	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_raw_public_key             1394	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_new_CMAC_key                   1395	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_PKEY_CTX_set_data                   1396	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_data                   1397	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get0_pkey                  1398	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get0_peerkey               1399	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_app_data               1400	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_app_data               1401	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_signature              1402	4_0_0	EXIST::FUNCTION:
+EVP_SIGNATURE_free                      1403	4_0_0	EXIST::FUNCTION:
+EVP_SIGNATURE_up_ref                    1404	4_0_0	EXIST::FUNCTION:
+EVP_SIGNATURE_get0_provider             1405	4_0_0	EXIST::FUNCTION:
+EVP_SIGNATURE_fetch                     1406	4_0_0	EXIST::FUNCTION:
+EVP_SIGNATURE_is_a                      1407	4_0_0	EXIST::FUNCTION:
+EVP_SIGNATURE_get0_name                 1408	4_0_0	EXIST::FUNCTION:
+EVP_SIGNATURE_get0_description          1409	4_0_0	EXIST::FUNCTION:
+EVP_SIGNATURE_do_all_provided           1410	4_0_0	EXIST::FUNCTION:
+EVP_SIGNATURE_names_do_all              1411	4_0_0	EXIST::FUNCTION:
+EVP_SIGNATURE_gettable_ctx_params       1412	4_0_0	EXIST::FUNCTION:
+EVP_SIGNATURE_settable_ctx_params       1413	4_0_0	EXIST::FUNCTION:
+EVP_ASYM_CIPHER_free                    1414	4_0_0	EXIST::FUNCTION:
+EVP_ASYM_CIPHER_up_ref                  1415	4_0_0	EXIST::FUNCTION:
+EVP_ASYM_CIPHER_get0_provider           1416	4_0_0	EXIST::FUNCTION:
+EVP_ASYM_CIPHER_fetch                   1417	4_0_0	EXIST::FUNCTION:
+EVP_ASYM_CIPHER_is_a                    1418	4_0_0	EXIST::FUNCTION:
+EVP_ASYM_CIPHER_get0_name               1419	4_0_0	EXIST::FUNCTION:
+EVP_ASYM_CIPHER_get0_description        1420	4_0_0	EXIST::FUNCTION:
+EVP_ASYM_CIPHER_do_all_provided         1421	4_0_0	EXIST::FUNCTION:
+EVP_ASYM_CIPHER_names_do_all            1422	4_0_0	EXIST::FUNCTION:
+EVP_ASYM_CIPHER_gettable_ctx_params     1423	4_0_0	EXIST::FUNCTION:
+EVP_ASYM_CIPHER_settable_ctx_params     1424	4_0_0	EXIST::FUNCTION:
+EVP_KEM_free                            1425	4_0_0	EXIST::FUNCTION:
+EVP_KEM_up_ref                          1426	4_0_0	EXIST::FUNCTION:
+EVP_KEM_get0_provider                   1427	4_0_0	EXIST::FUNCTION:
+EVP_KEM_fetch                           1428	4_0_0	EXIST::FUNCTION:
+EVP_KEM_is_a                            1429	4_0_0	EXIST::FUNCTION:
+EVP_KEM_get0_name                       1430	4_0_0	EXIST::FUNCTION:
+EVP_KEM_get0_description                1431	4_0_0	EXIST::FUNCTION:
+EVP_KEM_do_all_provided                 1432	4_0_0	EXIST::FUNCTION:
+EVP_KEM_names_do_all                    1433	4_0_0	EXIST::FUNCTION:
+EVP_KEM_gettable_ctx_params             1434	4_0_0	EXIST::FUNCTION:
+EVP_KEM_settable_ctx_params             1435	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_sign_init                      1436	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_sign_init_ex                   1437	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_sign_init_ex2                  1438	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_sign                           1439	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_sign_message_init              1440	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_sign_message_update            1441	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_sign_message_final             1442	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_verify_init                    1443	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_verify_init_ex                 1444	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_verify_init_ex2                1445	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_verify                         1446	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_verify_message_init            1447	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_verify_message_update          1448	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_verify_message_final           1449	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_verify_recover_init            1450	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_verify_recover_init_ex         1451	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_verify_recover_init_ex2        1452	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_verify_recover                 1453	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_encrypt_init                   1454	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_encrypt_init_ex                1455	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_encrypt                        1456	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_decrypt_init                   1457	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_decrypt_init_ex                1458	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_decrypt                        1459	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_derive_init                    1460	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_derive_init_ex                 1461	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_derive_set_peer_ex             1462	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_derive_set_peer                1463	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_derive                         1464	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_derive_SKEY                    1465	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_encapsulate_init               1466	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_auth_encapsulate_init          1467	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_encapsulate                    1468	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_decapsulate_init               1469	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_auth_decapsulate_init          1470	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_decapsulate                    1471	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_fromdata_init                  1472	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_fromdata                       1473	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_fromdata_settable              1474	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_todata                         1475	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_export                         1476	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_gettable_params                1477	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_params                     1478	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_int_param                  1479	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_size_t_param               1480	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_bn_param                   1481	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_utf8_string_param          1482	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_octet_string_param         1483	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_settable_params                1484	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_set_params                     1485	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_set_int_param                  1486	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_set_size_t_param               1487	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_set_bn_param                   1488	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_set_utf8_string_param          1489	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_set_octet_string_param         1490	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_ec_point_conv_form         1491	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_field_type                 1492	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_Q_keygen                       1493	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_paramgen_init                  1494	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_paramgen                       1495	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_keygen_init                    1496	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_keygen                         1497	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_generate                       1498	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_check                          1499	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_public_check                   1500	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_public_check_quick             1501	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_param_check                    1502	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_param_check_quick              1503	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_private_check                  1504	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_pairwise_check                 1505	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_set_ex_data                    1506	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_ex_data                    1507	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_cb                     1508	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_cb                     1509	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_keygen_info            1510	4_0_0	EXIST::FUNCTION:
+EVP_KEYEXCH_free                        1511	4_0_0	EXIST::FUNCTION:
+EVP_KEYEXCH_up_ref                      1512	4_0_0	EXIST::FUNCTION:
+EVP_KEYEXCH_fetch                       1513	4_0_0	EXIST::FUNCTION:
+EVP_KEYEXCH_get0_provider               1514	4_0_0	EXIST::FUNCTION:
+EVP_KEYEXCH_is_a                        1515	4_0_0	EXIST::FUNCTION:
+EVP_KEYEXCH_get0_name                   1516	4_0_0	EXIST::FUNCTION:
+EVP_KEYEXCH_get0_description            1517	4_0_0	EXIST::FUNCTION:
+EVP_KEYEXCH_do_all_provided             1518	4_0_0	EXIST::FUNCTION:
+EVP_KEYEXCH_names_do_all                1519	4_0_0	EXIST::FUNCTION:
+EVP_KEYEXCH_gettable_ctx_params         1520	4_0_0	EXIST::FUNCTION:
+EVP_KEYEXCH_settable_ctx_params         1521	4_0_0	EXIST::FUNCTION:
+EVP_add_alg_module                      1522	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_group_name             1523	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_group_name             1524	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_group_name                 1525	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get0_libctx                1526	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get0_propq                 1527	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get0_provider              1528	4_0_0	EXIST::FUNCTION:
+EVP_SKEY_is_a                           1529	4_0_0	EXIST::FUNCTION:
+EVP_SKEY_import                         1530	4_0_0	EXIST::FUNCTION:
+EVP_SKEY_generate                       1531	4_0_0	EXIST::FUNCTION:
+EVP_SKEY_import_raw_key                 1532	4_0_0	EXIST::FUNCTION:
+EVP_SKEY_import_SKEYMGMT                1533	4_0_0	EXIST::FUNCTION:
+EVP_SKEY_get0_raw_key                   1534	4_0_0	EXIST::FUNCTION:
+EVP_SKEY_get0_key_id                    1535	4_0_0	EXIST::FUNCTION:
+EVP_SKEY_export                         1536	4_0_0	EXIST::FUNCTION:
+EVP_SKEY_up_ref                         1537	4_0_0	EXIST::FUNCTION:
+EVP_SKEY_free                           1538	4_0_0	EXIST::FUNCTION:
+EVP_SKEY_get0_skeymgmt_name             1539	4_0_0	EXIST::FUNCTION:
+EVP_SKEY_get0_provider_name             1540	4_0_0	EXIST::FUNCTION:
+EVP_SKEY_to_provider                    1541	4_0_0	EXIST::FUNCTION:
+HMAC_size                               1542	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+HMAC_CTX_new                            1543	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+HMAC_CTX_reset                          1544	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+HMAC_CTX_free                           1545	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+HMAC_Init                               1546	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
+HMAC_Init_ex                            1547	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+HMAC_Update                             1548	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+HMAC_Final                              1549	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+HMAC_CTX_copy                           1550	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+HMAC_CTX_set_flags                      1551	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+HMAC_CTX_get_md                         1552	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+HMAC                                    1553	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_CTX_new                       1554	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_CTX_free                      1555	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_encap                         1556	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_seal                          1557	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_keygen                        1558	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_decap                         1559	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_open                          1560	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_export                        1561	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_CTX_set1_authpriv             1562	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_CTX_set1_authpub              1563	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_CTX_set1_psk                  1564	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_CTX_set1_ikme                 1565	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_CTX_set_seq                   1566	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_CTX_get_seq                   1567	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_suite_check                   1568	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_get_grease_value              1569	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_str2suite                     1570	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_get_ciphertext_size           1571	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_get_public_encap_size         1572	4_0_0	EXIST::FUNCTION:
+OSSL_HPKE_get_recommended_ikmelen       1573	4_0_0	EXIST::FUNCTION:
+OSSL_parse_url                          1574	4_0_0	EXIST::FUNCTION:
+OSSL_HTTP_REQ_CTX_new                   1575	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_REQ_CTX_free                  1576	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_REQ_CTX_set_request_line      1577	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_REQ_CTX_add1_header           1578	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_REQ_CTX_set_expected          1579	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_REQ_CTX_set1_req              1580	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_REQ_CTX_nbio                  1581	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_REQ_CTX_nbio_d2i              1582	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_REQ_CTX_exchange              1583	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_REQ_CTX_get0_mem_bio          1584	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_REQ_CTX_get_resp_len          1585	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_REQ_CTX_set_max_response_length 1586	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_REQ_CTX_set_max_response_hdr_lines 1587	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_is_alive                      1588	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_open                          1589	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_proxy_connect                 1590	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_set1_request                  1591	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_exchange                      1592	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_get                           1593	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_transfer                      1594	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_close                         1595	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_parse_url                     1596	4_0_0	EXIST::FUNCTION:HTTP
+OSSL_HTTP_adapt_proxy                   1597	4_0_0	EXIST::FUNCTION:HTTP
+IDEA_options                            1598	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
+IDEA_ecb_encrypt                        1599	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
+IDEA_set_encrypt_key                    1600	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
+IDEA_set_decrypt_key                    1601	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
+IDEA_cbc_encrypt                        1602	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
+IDEA_cfb64_encrypt                      1603	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
+IDEA_ofb64_encrypt                      1604	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
+IDEA_encrypt                            1605	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,IDEA
+OSSL_INDICATOR_set_callback             1606	4_0_0	EXIST::FUNCTION:
+OSSL_INDICATOR_get_callback             1607	4_0_0	EXIST::FUNCTION:
+EVP_KDF_up_ref                          1608	4_0_0	EXIST::FUNCTION:
+EVP_KDF_free                            1609	4_0_0	EXIST::FUNCTION:
+EVP_KDF_fetch                           1610	4_0_0	EXIST::FUNCTION:
+EVP_KDF_CTX_new                         1611	4_0_0	EXIST::FUNCTION:
+EVP_KDF_CTX_free                        1612	4_0_0	EXIST::FUNCTION:
+EVP_KDF_CTX_dup                         1613	4_0_0	EXIST::FUNCTION:
+EVP_KDF_get0_description                1614	4_0_0	EXIST::FUNCTION:
+EVP_KDF_is_a                            1615	4_0_0	EXIST::FUNCTION:
+EVP_KDF_get0_name                       1616	4_0_0	EXIST::FUNCTION:
+EVP_KDF_get0_provider                   1617	4_0_0	EXIST::FUNCTION:
+EVP_KDF_CTX_kdf                         1618	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+EVP_KDF_CTX_reset                       1619	4_0_0	EXIST::FUNCTION:
+EVP_KDF_CTX_get_kdf_size                1620	4_0_0	EXIST::FUNCTION:
+EVP_KDF_derive                          1621	4_0_0	EXIST::FUNCTION:
+EVP_KDF_CTX_set_SKEY                    1622	4_0_0	EXIST::FUNCTION:
+EVP_KDF_derive_SKEY                     1623	4_0_0	EXIST::FUNCTION:
+EVP_KDF_get_params                      1624	4_0_0	EXIST::FUNCTION:
+EVP_KDF_CTX_get_params                  1625	4_0_0	EXIST::FUNCTION:
+EVP_KDF_CTX_set_params                  1626	4_0_0	EXIST::FUNCTION:
+EVP_KDF_gettable_params                 1627	4_0_0	EXIST::FUNCTION:
+EVP_KDF_gettable_ctx_params             1628	4_0_0	EXIST::FUNCTION:
+EVP_KDF_settable_ctx_params             1629	4_0_0	EXIST::FUNCTION:
+EVP_KDF_CTX_gettable_params             1630	4_0_0	EXIST::FUNCTION:
+EVP_KDF_CTX_settable_params             1631	4_0_0	EXIST::FUNCTION:
+EVP_KDF_do_all_provided                 1632	4_0_0	EXIST::FUNCTION:
+EVP_KDF_names_do_all                    1633	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_tls1_prf_md            1634	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set1_tls1_prf_secret       1635	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_add1_tls1_prf_seed         1636	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_hkdf_md                1637	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set1_hkdf_salt             1638	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set1_hkdf_key              1639	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_add1_hkdf_info             1640	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_hkdf_mode              1641	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set1_pbe_pass              1642	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set1_scrypt_salt           1643	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_scrypt_N               1644	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_scrypt_r               1645	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_scrypt_p               1646	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_scrypt_maxmem_bytes    1647	4_0_0	EXIST::FUNCTION:
+MD2_options                             1648	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD2
+MD2_Init                                1649	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD2
+MD2_Update                              1650	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD2
+MD2_Final                               1651	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD2
+MD2                                     1652	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD2
+MD4_Init                                1653	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD4
+MD4_Update                              1654	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD4
+MD4_Final                               1655	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD4
+MD4                                     1656	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD4
+MD4_Transform                           1657	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD4
+MD5_Init                                1658	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
+MD5_Update                              1659	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
+MD5_Final                               1660	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
+MD5                                     1661	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
+MD5_Transform                           1662	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
+MDC2_Init                               1663	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MDC2
+MDC2_Update                             1664	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MDC2
+MDC2_Final                              1665	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MDC2
+MDC2                                    1666	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MDC2
+CRYPTO_cbc128_encrypt                   1667	4_0_0	EXIST::FUNCTION:
+CRYPTO_cbc128_decrypt                   1668	4_0_0	EXIST::FUNCTION:
+CRYPTO_ctr128_encrypt                   1669	4_0_0	EXIST::FUNCTION:
+CRYPTO_ctr128_encrypt_ctr32             1670	4_0_0	EXIST::FUNCTION:
+CRYPTO_ofb128_encrypt                   1671	4_0_0	EXIST::FUNCTION:
+CRYPTO_cfb128_encrypt                   1672	4_0_0	EXIST::FUNCTION:
+CRYPTO_cfb128_8_encrypt                 1673	4_0_0	EXIST::FUNCTION:
+CRYPTO_cfb128_1_encrypt                 1674	4_0_0	EXIST::FUNCTION:
+CRYPTO_cts128_encrypt_block             1675	4_0_0	EXIST::FUNCTION:
+CRYPTO_cts128_encrypt                   1676	4_0_0	EXIST::FUNCTION:
+CRYPTO_cts128_decrypt_block             1677	4_0_0	EXIST::FUNCTION:
+CRYPTO_cts128_decrypt                   1678	4_0_0	EXIST::FUNCTION:
+CRYPTO_nistcts128_encrypt_block         1679	4_0_0	EXIST::FUNCTION:
+CRYPTO_nistcts128_encrypt               1680	4_0_0	EXIST::FUNCTION:
+CRYPTO_nistcts128_decrypt_block         1681	4_0_0	EXIST::FUNCTION:
+CRYPTO_nistcts128_decrypt               1682	4_0_0	EXIST::FUNCTION:
+CRYPTO_gcm128_new                       1683	4_0_0	EXIST::FUNCTION:
+CRYPTO_gcm128_init                      1684	4_0_0	EXIST::FUNCTION:
+CRYPTO_gcm128_setiv                     1685	4_0_0	EXIST::FUNCTION:
+CRYPTO_gcm128_aad                       1686	4_0_0	EXIST::FUNCTION:
+CRYPTO_gcm128_encrypt                   1687	4_0_0	EXIST::FUNCTION:
+CRYPTO_gcm128_decrypt                   1688	4_0_0	EXIST::FUNCTION:
+CRYPTO_gcm128_encrypt_ctr32             1689	4_0_0	EXIST::FUNCTION:
+CRYPTO_gcm128_decrypt_ctr32             1690	4_0_0	EXIST::FUNCTION:
+CRYPTO_gcm128_finish                    1691	4_0_0	EXIST::FUNCTION:
+CRYPTO_gcm128_tag                       1692	4_0_0	EXIST::FUNCTION:
+CRYPTO_gcm128_release                   1693	4_0_0	EXIST::FUNCTION:
+CRYPTO_ccm128_init                      1694	4_0_0	EXIST::FUNCTION:
+CRYPTO_ccm128_setiv                     1695	4_0_0	EXIST::FUNCTION:
+CRYPTO_ccm128_aad                       1696	4_0_0	EXIST::FUNCTION:
+CRYPTO_ccm128_encrypt                   1697	4_0_0	EXIST::FUNCTION:
+CRYPTO_ccm128_decrypt                   1698	4_0_0	EXIST::FUNCTION:
+CRYPTO_ccm128_encrypt_ccm64             1699	4_0_0	EXIST::FUNCTION:
+CRYPTO_ccm128_decrypt_ccm64             1700	4_0_0	EXIST::FUNCTION:
+CRYPTO_ccm128_tag                       1701	4_0_0	EXIST::FUNCTION:
+CRYPTO_xts128_encrypt                   1702	4_0_0	EXIST::FUNCTION:
+CRYPTO_128_wrap                         1703	4_0_0	EXIST::FUNCTION:
+CRYPTO_128_unwrap                       1704	4_0_0	EXIST::FUNCTION:
+CRYPTO_128_wrap_pad                     1705	4_0_0	EXIST::FUNCTION:
+CRYPTO_128_unwrap_pad                   1706	4_0_0	EXIST::FUNCTION:
+CRYPTO_ocb128_new                       1707	4_0_0	EXIST::FUNCTION:OCB
+CRYPTO_ocb128_init                      1708	4_0_0	EXIST::FUNCTION:OCB
+CRYPTO_ocb128_copy_ctx                  1709	4_0_0	EXIST::FUNCTION:OCB
+CRYPTO_ocb128_setiv                     1710	4_0_0	EXIST::FUNCTION:OCB
+CRYPTO_ocb128_aad                       1711	4_0_0	EXIST::FUNCTION:OCB
+CRYPTO_ocb128_encrypt                   1712	4_0_0	EXIST::FUNCTION:OCB
+CRYPTO_ocb128_decrypt                   1713	4_0_0	EXIST::FUNCTION:OCB
+CRYPTO_ocb128_finish                    1714	4_0_0	EXIST::FUNCTION:OCB
+CRYPTO_ocb128_tag                       1715	4_0_0	EXIST::FUNCTION:OCB
+CRYPTO_ocb128_cleanup                   1716	4_0_0	EXIST::FUNCTION:OCB
+OBJ_NAME_init                           1717	4_0_0	EXIST::FUNCTION:
+OBJ_NAME_new_index                      1718	4_0_0	EXIST::FUNCTION:
+OBJ_NAME_get                            1719	4_0_0	EXIST::FUNCTION:
+OBJ_NAME_add                            1720	4_0_0	EXIST::FUNCTION:
+OBJ_NAME_remove                         1721	4_0_0	EXIST::FUNCTION:
+OBJ_NAME_cleanup                        1722	4_0_0	EXIST::FUNCTION:
+OBJ_NAME_do_all                         1723	4_0_0	EXIST::FUNCTION:
+OBJ_NAME_do_all_sorted                  1724	4_0_0	EXIST::FUNCTION:
+OBJ_dup                                 1725	4_0_0	EXIST::FUNCTION:
+OBJ_nid2obj                             1726	4_0_0	EXIST::FUNCTION:
+OBJ_nid2ln                              1727	4_0_0	EXIST::FUNCTION:
+OBJ_nid2sn                              1728	4_0_0	EXIST::FUNCTION:
+OBJ_obj2nid                             1729	4_0_0	EXIST::FUNCTION:
+OBJ_txt2obj                             1730	4_0_0	EXIST::FUNCTION:
+OBJ_obj2txt                             1731	4_0_0	EXIST::FUNCTION:
+OBJ_txt2nid                             1732	4_0_0	EXIST::FUNCTION:
+OBJ_ln2nid                              1733	4_0_0	EXIST::FUNCTION:
+OBJ_sn2nid                              1734	4_0_0	EXIST::FUNCTION:
+OBJ_cmp                                 1735	4_0_0	EXIST::FUNCTION:
+OBJ_bsearch_                            1736	4_0_0	EXIST::FUNCTION:
+OBJ_bsearch_ex_                         1737	4_0_0	EXIST::FUNCTION:
+OBJ_new_nid                             1738	4_0_0	EXIST::FUNCTION:
+OBJ_add_object                          1739	4_0_0	EXIST::FUNCTION:
+OBJ_create                              1740	4_0_0	EXIST::FUNCTION:
+OBJ_create_objects                      1741	4_0_0	EXIST::FUNCTION:
+OBJ_length                              1742	4_0_0	EXIST::FUNCTION:
+OBJ_get0_data                           1743	4_0_0	EXIST::FUNCTION:
+OBJ_find_sigid_algs                     1744	4_0_0	EXIST::FUNCTION:
+OBJ_find_sigid_by_algs                  1745	4_0_0	EXIST::FUNCTION:
+OBJ_add_sigid                           1746	4_0_0	EXIST::FUNCTION:
+OBJ_sigid_free                          1747	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_new                      1748	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_to_param                 1749	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_free                     1750	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_int                 1751	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_uint                1752	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_long                1753	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_ulong               1754	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_int32               1755	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_uint32              1756	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_int64               1757	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_uint64              1758	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_size_t              1759	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_time_t              1760	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_double              1761	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_BN                  1762	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_BN_pad              1763	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_utf8_string         1764	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_utf8_ptr            1765	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_octet_string        1766	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_BLD_push_octet_ptr           1767	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_locate                       1768	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_locate_const                 1769	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_int                1770	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_uint               1771	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_long               1772	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_ulong              1773	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_int32              1774	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_uint32             1775	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_int64              1776	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_uint64             1777	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_size_t             1778	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_time_t             1779	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_BN                 1780	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_double             1781	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_utf8_string        1782	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_utf8_ptr           1783	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_octet_string       1784	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_octet_ptr          1785	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_construct_end                1786	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_allocate_from_text           1787	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_print_to_bio                 1788	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_int                      1789	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_uint                     1790	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_long                     1791	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_ulong                    1792	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_int32                    1793	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_uint32                   1794	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_int64                    1795	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_uint64                   1796	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_size_t                   1797	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_time_t                   1798	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_int                      1799	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_uint                     1800	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_long                     1801	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_ulong                    1802	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_int32                    1803	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_uint32                   1804	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_int64                    1805	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_uint64                   1806	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_size_t                   1807	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_time_t                   1808	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_double                   1809	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_double                   1810	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_BN                       1811	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_BN                       1812	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_utf8_string              1813	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_utf8_string              1814	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_octet_string             1815	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_octet_string             1816	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_utf8_ptr                 1817	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_utf8_ptr                 1818	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_octet_ptr                1819	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_octet_ptr                1820	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_utf8_string_ptr          1821	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_get_octet_string_ptr         1822	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_modified                     1823	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_all_unmodified           1824	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_dup                          1825	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_merge                        1826	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_free                         1827	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_set_octet_string_or_ptr      1828	4_0_0	EXIST::FUNCTION:
+PEM_get_EVP_CIPHER_INFO                 1829	4_0_0	EXIST::FUNCTION:
+PEM_do_header                           1830	4_0_0	EXIST::FUNCTION:
+PEM_read_bio                            1831	4_0_0	EXIST::FUNCTION:
+PEM_read_bio_ex                         1832	4_0_0	EXIST::FUNCTION:
+PEM_bytes_read_bio_secmem               1833	4_0_0	EXIST::FUNCTION:
+PEM_write_bio                           1834	4_0_0	EXIST::FUNCTION:
+PEM_bytes_read_bio                      1835	4_0_0	EXIST::FUNCTION:
+PEM_ASN1_read_bio                       1836	4_0_0	EXIST::FUNCTION:
+PEM_ASN1_write_bio                      1837	4_0_0	EXIST::FUNCTION:
+PEM_ASN1_write_bio_ctx                  1838	4_0_0	EXIST::FUNCTION:
+PEM_X509_INFO_read_bio                  1839	4_0_0	EXIST::FUNCTION:
+PEM_X509_INFO_read_bio_ex               1840	4_0_0	EXIST::FUNCTION:
+PEM_X509_INFO_write_bio                 1841	4_0_0	EXIST::FUNCTION:
+PEM_read                                1842	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write                               1843	4_0_0	EXIST::FUNCTION:STDIO
+PEM_ASN1_read                           1844	4_0_0	EXIST::FUNCTION:STDIO
+PEM_ASN1_write                          1845	4_0_0	EXIST::FUNCTION:STDIO
+PEM_X509_INFO_read                      1846	4_0_0	EXIST::FUNCTION:STDIO
+PEM_X509_INFO_read_ex                   1847	4_0_0	EXIST::FUNCTION:STDIO
+PEM_SignInit                            1848	4_0_0	EXIST::FUNCTION:
+PEM_SignUpdate                          1849	4_0_0	EXIST::FUNCTION:
+PEM_SignFinal                           1850	4_0_0	EXIST::FUNCTION:
+PEM_def_callback                        1851	4_0_0	EXIST::FUNCTION:
+PEM_proc_type                           1852	4_0_0	EXIST::FUNCTION:
+PEM_dek_info                            1853	4_0_0	EXIST::FUNCTION:
+PEM_read_X509                           1854	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_X509                          1855	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_bio_X509                       1856	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_X509                      1857	4_0_0	EXIST::FUNCTION:
+PEM_read_X509_AUX                       1858	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_X509_AUX                      1859	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_bio_X509_AUX                   1860	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_X509_AUX                  1861	4_0_0	EXIST::FUNCTION:
+PEM_read_X509_REQ                       1862	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_X509_REQ                      1863	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_bio_X509_REQ                   1864	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_X509_REQ                  1865	4_0_0	EXIST::FUNCTION:
+PEM_write_X509_REQ_NEW                  1866	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_bio_X509_REQ_NEW              1867	4_0_0	EXIST::FUNCTION:
+PEM_read_X509_CRL                       1868	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_X509_CRL                      1869	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_bio_X509_CRL                   1870	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_X509_CRL                  1871	4_0_0	EXIST::FUNCTION:
+PEM_read_X509_PUBKEY                    1872	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_X509_PUBKEY                   1873	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_bio_X509_PUBKEY                1874	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_X509_PUBKEY               1875	4_0_0	EXIST::FUNCTION:
+PEM_read_PKCS7                          1876	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_PKCS7                         1877	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_bio_PKCS7                      1878	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_PKCS7                     1879	4_0_0	EXIST::FUNCTION:
+PEM_read_NETSCAPE_CERT_SEQUENCE         1880	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_NETSCAPE_CERT_SEQUENCE        1881	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_bio_NETSCAPE_CERT_SEQUENCE     1882	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_NETSCAPE_CERT_SEQUENCE    1883	4_0_0	EXIST::FUNCTION:
+PEM_read_PKCS8                          1884	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_PKCS8                         1885	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_bio_PKCS8                      1886	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_PKCS8                     1887	4_0_0	EXIST::FUNCTION:
+PEM_read_PKCS8_PRIV_KEY_INFO            1888	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_PKCS8_PRIV_KEY_INFO           1889	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_bio_PKCS8_PRIV_KEY_INFO        1890	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_PKCS8_PRIV_KEY_INFO       1891	4_0_0	EXIST::FUNCTION:
+PEM_read_RSAPrivateKey                  1892	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
+PEM_write_RSAPrivateKey                 1893	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
+PEM_read_bio_RSAPrivateKey              1894	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+PEM_write_bio_RSAPrivateKey             1895	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+PEM_read_RSAPublicKey                   1896	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
+PEM_write_RSAPublicKey                  1897	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
+PEM_read_bio_RSAPublicKey               1898	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+PEM_write_bio_RSAPublicKey              1899	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+PEM_read_RSA_PUBKEY                     1900	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
+PEM_write_RSA_PUBKEY                    1901	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
+PEM_read_bio_RSA_PUBKEY                 1902	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+PEM_write_bio_RSA_PUBKEY                1903	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+PEM_read_DSAPrivateKey                  1904	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
+PEM_write_DSAPrivateKey                 1905	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
+PEM_read_bio_DSAPrivateKey              1906	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+PEM_write_bio_DSAPrivateKey             1907	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+PEM_read_DSA_PUBKEY                     1908	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
+PEM_write_DSA_PUBKEY                    1909	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
+PEM_read_bio_DSA_PUBKEY                 1910	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+PEM_write_bio_DSA_PUBKEY                1911	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+PEM_read_DSAparams                      1912	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
+PEM_write_DSAparams                     1913	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
+PEM_read_bio_DSAparams                  1914	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+PEM_write_bio_DSAparams                 1915	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+PEM_read_ECPKParameters                 1916	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
+PEM_write_ECPKParameters                1917	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
+PEM_read_bio_ECPKParameters             1918	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+PEM_write_bio_ECPKParameters            1919	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+PEM_read_ECPrivateKey                   1920	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
+PEM_write_ECPrivateKey                  1921	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
+PEM_read_bio_ECPrivateKey               1922	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+PEM_write_bio_ECPrivateKey              1923	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+PEM_read_EC_PUBKEY                      1924	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
+PEM_write_EC_PUBKEY                     1925	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
+PEM_read_bio_EC_PUBKEY                  1926	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+PEM_write_bio_EC_PUBKEY                 1927	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+PEM_read_DHparams                       1928	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH,STDIO
+PEM_write_DHparams                      1929	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH,STDIO
+PEM_read_bio_DHparams                   1930	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+PEM_write_bio_DHparams                  1931	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+PEM_write_DHxparams                     1932	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH,STDIO
+PEM_write_bio_DHxparams                 1933	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+PEM_read_PrivateKey                     1934	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_PrivateKey                    1935	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_PrivateKey_ex                  1936	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_PrivateKey_ex                 1937	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_bio_PrivateKey                 1938	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_PrivateKey                1939	4_0_0	EXIST::FUNCTION:
+PEM_read_bio_PrivateKey_ex              1940	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_PrivateKey_ex             1941	4_0_0	EXIST::FUNCTION:
+PEM_read_PUBKEY                         1942	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_PUBKEY                        1943	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_PUBKEY_ex                      1944	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_PUBKEY_ex                     1945	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_bio_PUBKEY                     1946	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_PUBKEY                    1947	4_0_0	EXIST::FUNCTION:
+PEM_read_bio_PUBKEY_ex                  1948	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_PUBKEY_ex                 1949	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_PrivateKey_traditional    1950	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_PKCS8PrivateKey_nid       1951	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_PKCS8PrivateKey           1952	4_0_0	EXIST::FUNCTION:
+i2d_PKCS8PrivateKey_bio                 1953	4_0_0	EXIST::FUNCTION:
+i2d_PKCS8PrivateKey_nid_bio             1954	4_0_0	EXIST::FUNCTION:
+d2i_PKCS8PrivateKey_bio                 1955	4_0_0	EXIST::FUNCTION:
+i2d_PKCS8PrivateKey_fp                  1956	4_0_0	EXIST::FUNCTION:STDIO
+i2d_PKCS8PrivateKey_nid_fp              1957	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_PKCS8PrivateKey_nid           1958	4_0_0	EXIST::FUNCTION:STDIO
+d2i_PKCS8PrivateKey_fp                  1959	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_PKCS8PrivateKey               1960	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_bio_Parameters_ex              1961	4_0_0	EXIST::FUNCTION:
+PEM_read_bio_Parameters                 1962	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_Parameters                1963	4_0_0	EXIST::FUNCTION:
+b2i_PrivateKey                          1964	4_0_0	EXIST::FUNCTION:
+b2i_PublicKey                           1965	4_0_0	EXIST::FUNCTION:
+b2i_PrivateKey_bio                      1966	4_0_0	EXIST::FUNCTION:
+b2i_PublicKey_bio                       1967	4_0_0	EXIST::FUNCTION:
+i2b_PrivateKey_bio                      1968	4_0_0	EXIST::FUNCTION:
+i2b_PublicKey_bio                       1969	4_0_0	EXIST::FUNCTION:
+b2i_PVK_bio                             1970	4_0_0	EXIST::FUNCTION:
+b2i_PVK_bio_ex                          1971	4_0_0	EXIST::FUNCTION:
+i2b_PVK_bio                             1972	4_0_0	EXIST::FUNCTION:
+i2b_PVK_bio_ex                          1973	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_set_default_search_path   1974	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_get0_default_search_path  1975	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_load                      1976	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_load_ex                   1977	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_try_load                  1978	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_try_load_ex               1979	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_unload                    1980	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_available                 1981	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_do_all                    1982	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_gettable_params           1983	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_get_params                1984	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_self_test                 1985	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_get_capabilities          1986	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_add_conf_parameter        1987	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_get_conf_parameters       1988	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_conf_get_bool             1989	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_query_operation           1990	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_unquery_operation         1991	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_get0_provider_ctx         1992	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_get0_dispatch             1993	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_add_builtin               1994	4_0_0	EXIST::FUNCTION:
+OSSL_PROVIDER_get0_name                 1995	4_0_0	EXIST::FUNCTION:
+RAND_set_rand_method                    1996	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RAND_get_rand_method                    1997	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RAND_OpenSSL                            1998	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RAND_bytes                              1999	4_0_0	EXIST::FUNCTION:
+RAND_priv_bytes                         2000	4_0_0	EXIST::FUNCTION:
+RAND_priv_bytes_ex                      2001	4_0_0	EXIST::FUNCTION:
+RAND_bytes_ex                           2002	4_0_0	EXIST::FUNCTION:
+RAND_pseudo_bytes                       2003	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
+RAND_get0_primary                       2004	4_0_0	EXIST::FUNCTION:
+RAND_get0_public                        2005	4_0_0	EXIST::FUNCTION:
+RAND_get0_private                       2006	4_0_0	EXIST::FUNCTION:
+RAND_set0_public                        2007	4_0_0	EXIST::FUNCTION:
+RAND_set0_private                       2008	4_0_0	EXIST::FUNCTION:
+RAND_set_DRBG_type                      2009	4_0_0	EXIST::FUNCTION:
+RAND_set_seed_source_type               2010	4_0_0	EXIST::FUNCTION:
+RAND_seed                               2011	4_0_0	EXIST::FUNCTION:
+RAND_keep_random_devices_open           2012	4_0_0	EXIST::FUNCTION:
+RAND_add                                2013	4_0_0	EXIST::FUNCTION:
+RAND_load_file                          2014	4_0_0	EXIST::FUNCTION:
+RAND_write_file                         2015	4_0_0	EXIST::FUNCTION:
+RAND_file_name                          2016	4_0_0	EXIST::FUNCTION:
+RAND_status                             2017	4_0_0	EXIST::FUNCTION:
+RAND_query_egd_bytes                    2018	4_0_0	EXIST::FUNCTION:EGD
+RAND_egd                                2019	4_0_0	EXIST::FUNCTION:EGD
+RAND_egd_bytes                          2020	4_0_0	EXIST::FUNCTION:EGD
+RAND_poll                               2021	4_0_0	EXIST::FUNCTION:
+RAND_screen                             2022	4_0_0	EXIST:_WIN32:FUNCTION:DEPRECATEDIN_1_1_0
+RAND_event                              2023	4_0_0	EXIST:_WIN32:FUNCTION:DEPRECATEDIN_1_1_0
+RAND_set1_random_provider               2024	4_0_0	EXIST::FUNCTION:
+RC2_set_key                             2025	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC2
+RC2_ecb_encrypt                         2026	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC2
+RC2_encrypt                             2027	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC2
+RC2_decrypt                             2028	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC2
+RC2_cbc_encrypt                         2029	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC2
+RC2_cfb64_encrypt                       2030	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC2
+RC2_ofb64_encrypt                       2031	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC2
+RC4_options                             2032	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC4
+RC4_set_key                             2033	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC4
+RC4                                     2034	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC4
+RC5_32_set_key                          2035	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC5
+RC5_32_ecb_encrypt                      2036	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC5
+RC5_32_encrypt                          2037	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC5
+RC5_32_decrypt                          2038	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC5
+RC5_32_cbc_encrypt                      2039	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC5
+RC5_32_cfb64_encrypt                    2040	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC5
+RC5_32_ofb64_encrypt                    2041	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RC5
+RIPEMD160_Init                          2042	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RMD160
+RIPEMD160_Update                        2043	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RMD160
+RIPEMD160_Final                         2044	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RMD160
+RIPEMD160                               2045	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RMD160
+RIPEMD160_Transform                     2046	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,RMD160
+EVP_PKEY_CTX_set_rsa_padding            2047	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_rsa_padding            2048	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_rsa_pss_saltlen        2049	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_rsa_pss_saltlen        2050	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_rsa_keygen_bits        2051	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set1_rsa_keygen_pubexp     2052	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_rsa_keygen_primes      2053	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen 2054	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_rsa_keygen_pubexp      2055	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+EVP_PKEY_CTX_set_rsa_mgf1_md            2056	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_rsa_mgf1_md_name       2057	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_rsa_mgf1_md            2058	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_rsa_mgf1_md_name       2059	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md 2060	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name 2061	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_rsa_pss_keygen_md      2062	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_rsa_pss_keygen_md_name 2063	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_rsa_oaep_md            2064	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set_rsa_oaep_md_name       2065	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_rsa_oaep_md            2066	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get_rsa_oaep_md_name       2067	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_set0_rsa_oaep_label        2068	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_CTX_get0_rsa_oaep_label        2069	4_0_0	EXIST::FUNCTION:
+RSA_new                                 2070	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_new_method                          2071	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_bits                                2072	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_size                                2073	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_security_bits                       2074	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_set0_key                            2075	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_set0_factors                        2076	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_set0_crt_params                     2077	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_set0_multi_prime_params             2078	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get0_key                            2079	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get0_factors                        2080	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get_multi_prime_extra_count         2081	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get0_multi_prime_factors            2082	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get0_crt_params                     2083	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get0_multi_prime_crt_params         2084	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get0_n                              2085	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get0_e                              2086	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get0_d                              2087	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get0_p                              2088	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get0_q                              2089	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get0_dmp1                           2090	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get0_dmq1                           2091	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get0_iqmp                           2092	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get0_pss_params                     2093	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_clear_flags                         2094	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_test_flags                          2095	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_set_flags                           2096	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get_version                         2097	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_generate_key                        2098	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_0_9_8
+RSA_generate_key_ex                     2099	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_generate_multi_prime_key            2100	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_X931_derive_ex                      2101	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_X931_generate_key_ex                2102	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_check_key                           2103	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_check_key_ex                        2104	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_public_encrypt                      2105	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_private_encrypt                     2106	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_public_decrypt                      2107	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_private_decrypt                     2108	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_free                                2109	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_up_ref                              2110	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_flags                               2111	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_set_default_method                  2112	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get_default_method                  2113	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_null_method                         2114	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get_method                          2115	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_set_method                          2116	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_PKCS1_OpenSSL                       2117	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+d2i_RSAPublicKey                        2118	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+i2d_RSAPublicKey                        2119	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSAPublicKey_it                         2120	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+d2i_RSAPrivateKey                       2121	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+i2d_RSAPrivateKey                       2122	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSAPrivateKey_it                        2123	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_pkey_ctx_ctrl                       2124	4_0_0	EXIST::FUNCTION:
+d2i_RSA_PSS_PARAMS                      2125	4_0_0	EXIST::FUNCTION:
+i2d_RSA_PSS_PARAMS                      2126	4_0_0	EXIST::FUNCTION:
+RSA_PSS_PARAMS_free                     2127	4_0_0	EXIST::FUNCTION:
+RSA_PSS_PARAMS_new                      2128	4_0_0	EXIST::FUNCTION:
+RSA_PSS_PARAMS_it                       2129	4_0_0	EXIST::FUNCTION:
+RSA_PSS_PARAMS_dup                      2130	4_0_0	EXIST::FUNCTION:
+d2i_RSA_OAEP_PARAMS                     2131	4_0_0	EXIST::FUNCTION:
+i2d_RSA_OAEP_PARAMS                     2132	4_0_0	EXIST::FUNCTION:
+RSA_OAEP_PARAMS_free                    2133	4_0_0	EXIST::FUNCTION:
+RSA_OAEP_PARAMS_new                     2134	4_0_0	EXIST::FUNCTION:
+RSA_OAEP_PARAMS_it                      2135	4_0_0	EXIST::FUNCTION:
+RSA_print_fp                            2136	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
+RSA_print                               2137	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_sign                                2138	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_verify                              2139	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_sign_ASN1_OCTET_STRING              2140	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_verify_ASN1_OCTET_STRING            2141	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_blinding_on                         2142	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_blinding_off                        2143	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_setup_blinding                      2144	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_padding_add_PKCS1_type_1            2145	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_padding_check_PKCS1_type_1          2146	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_padding_add_PKCS1_type_2            2147	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_padding_check_PKCS1_type_2          2148	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+PKCS1_MGF1                              2149	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_padding_add_PKCS1_OAEP              2150	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_padding_check_PKCS1_OAEP            2151	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_padding_add_PKCS1_OAEP_mgf1         2152	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_padding_check_PKCS1_OAEP_mgf1       2153	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_padding_add_none                    2154	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_padding_check_none                  2155	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_padding_add_X931                    2156	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_padding_check_X931                  2157	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_X931_hash_id                        2158	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_verify_PKCS1_PSS                    2159	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_padding_add_PKCS1_PSS               2160	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_verify_PKCS1_PSS_mgf1               2161	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_padding_add_PKCS1_PSS_mgf1          2162	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_set_ex_data                         2163	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_get_ex_data                         2164	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSAPublicKey_dup                        2165	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSAPrivateKey_dup                       2166	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_new                            2167	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_free                           2168	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_dup                            2169	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get0_name                      2170	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set1_name                      2171	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get_flags                      2172	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set_flags                      2173	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get0_app_data                  2174	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set0_app_data                  2175	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get_pub_enc                    2176	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set_pub_enc                    2177	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get_pub_dec                    2178	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set_pub_dec                    2179	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get_priv_enc                   2180	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set_priv_enc                   2181	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get_priv_dec                   2182	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set_priv_dec                   2183	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get_mod_exp                    2184	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set_mod_exp                    2185	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get_bn_mod_exp                 2186	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set_bn_mod_exp                 2187	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get_init                       2188	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set_init                       2189	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get_finish                     2190	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set_finish                     2191	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get_sign                       2192	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set_sign                       2193	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get_verify                     2194	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set_verify                     2195	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get_keygen                     2196	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set_keygen                     2197	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_get_multi_prime_keygen         2198	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+RSA_meth_set_multi_prime_keygen         2199	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SEED_set_key                            2200	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SEED
+SEED_encrypt                            2201	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SEED
+SEED_decrypt                            2202	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SEED
+SEED_ecb_encrypt                        2203	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SEED
+SEED_cbc_encrypt                        2204	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SEED
+SEED_cfb128_encrypt                     2205	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SEED
+SEED_ofb128_encrypt                     2206	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SEED
+OSSL_SELF_TEST_set_callback             2207	4_0_0	EXIST::FUNCTION:
+OSSL_SELF_TEST_get_callback             2208	4_0_0	EXIST::FUNCTION:
+OSSL_SELF_TEST_new                      2209	4_0_0	EXIST::FUNCTION:
+OSSL_SELF_TEST_free                     2210	4_0_0	EXIST::FUNCTION:
+OSSL_SELF_TEST_onbegin                  2211	4_0_0	EXIST::FUNCTION:
+OSSL_SELF_TEST_oncorrupt_byte           2212	4_0_0	EXIST::FUNCTION:
+OSSL_SELF_TEST_onend                    2213	4_0_0	EXIST::FUNCTION:
+SHA1_Init                               2214	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA1_Update                             2215	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA1_Final                              2216	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA1_Transform                          2217	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA1                                    2218	4_0_0	EXIST::FUNCTION:
+SHA224_Init                             2219	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA224_Update                           2220	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA224_Final                            2221	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA256_Init                             2222	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA256_Update                           2223	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA256_Final                            2224	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA256_Transform                        2225	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA224                                  2226	4_0_0	EXIST::FUNCTION:
+SHA256                                  2227	4_0_0	EXIST::FUNCTION:
+SHA384_Init                             2228	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA384_Update                           2229	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA384_Final                            2230	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA512_Init                             2231	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA512_Update                           2232	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA512_Final                            2233	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA512_Transform                        2234	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SHA384                                  2235	4_0_0	EXIST::FUNCTION:
+SHA512                                  2236	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_num                          2237	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_value                        2238	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_set                          2239	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_new                          2240	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_new_null                     2241	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_new_reserve                  2242	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_set_thunks                   2243	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_reserve                      2244	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_free                         2245	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_pop_free                     2246	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_deep_copy                    2247	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_insert                       2248	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_delete                       2249	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_delete_ptr                   2250	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_find                         2251	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_find_ex                      2252	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_find_all                     2253	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_push                         2254	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_unshift                      2255	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_shift                        2256	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_pop                          2257	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_zero                         2258	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_set_cmp_func                 2259	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_dup                          2260	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_sort                         2261	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_is_sorted                    2262	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_open                         2263	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_open_ex                      2264	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_ctrl                         2265	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_vctrl                        2266	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_load                         2267	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_delete                       2268	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_eof                          2269	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_error                        2270	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_close                        2271	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_attach                       2272	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_new                     2273	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_new_NAME                2274	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_set0_NAME_description   2275	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_new_PARAMS              2276	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_new_PUBKEY              2277	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_new_PKEY                2278	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_new_CERT                2279	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_new_CRL                 2280	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get_type                2281	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get0_data               2282	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get0_NAME               2283	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get1_NAME               2284	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get0_NAME_description   2285	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get1_NAME_description   2286	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get0_PARAMS             2287	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get1_PARAMS             2288	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get0_PUBKEY             2289	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get1_PUBKEY             2290	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get0_PKEY               2291	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get1_PKEY               2292	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get0_CERT               2293	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get1_CERT               2294	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get0_CRL                2295	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get1_CRL                2296	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_type_string             2297	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_free                    2298	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_supports_search              2299	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_SEARCH_by_name               2300	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_SEARCH_by_issuer_serial      2301	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_SEARCH_by_key_fingerprint    2302	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_SEARCH_by_alias              2303	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_SEARCH_free                  2304	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_SEARCH_get_type              2305	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_SEARCH_get0_name             2306	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_SEARCH_get0_serial           2307	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_SEARCH_get0_bytes            2308	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_SEARCH_get0_string           2309	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_SEARCH_get0_digest           2310	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_expect                       2311	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_find                         2312	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_LOADER_fetch                 2313	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_LOADER_up_ref                2314	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_LOADER_free                  2315	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_LOADER_get0_provider         2316	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_LOADER_get0_properties       2317	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_LOADER_get0_description      2318	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_LOADER_is_a                  2319	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_LOADER_do_all_provided       2320	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_LOADER_names_do_all          2321	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_LOADER_settable_ctx_params   2322	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_LOADER_new                   2323	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_LOADER_set_open              2324	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_LOADER_set_open_ex           2325	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_LOADER_set_attach            2326	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_LOADER_set_ctrl              2327	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_LOADER_set_expect            2328	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_LOADER_set_find              2329	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_LOADER_set_load              2330	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_LOADER_set_eof               2331	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_LOADER_set_error             2332	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_LOADER_set_close             2333	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_LOADER_get0_scheme           2334	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_register_loader              2335	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_unregister_loader            2336	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_STORE_do_all_loaders               2337	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+OSSL_get_thread_support_flags           2338	4_0_0	EXIST::FUNCTION:
+OSSL_set_max_threads                    2339	4_0_0	EXIST::FUNCTION:
+OSSL_get_max_threads                    2340	4_0_0	EXIST::FUNCTION:
+OSSL_trace_get_category_num             2341	4_0_0	EXIST::FUNCTION:
+OSSL_trace_get_category_name            2342	4_0_0	EXIST::FUNCTION:
+OSSL_trace_set_channel                  2343	4_0_0	EXIST::FUNCTION:
+OSSL_trace_set_prefix                   2344	4_0_0	EXIST::FUNCTION:
+OSSL_trace_set_suffix                   2345	4_0_0	EXIST::FUNCTION:
+OSSL_trace_set_callback                 2346	4_0_0	EXIST::FUNCTION:
+OSSL_trace_enabled                      2347	4_0_0	EXIST::FUNCTION:
+OSSL_trace_begin                        2348	4_0_0	EXIST::FUNCTION:
+OSSL_trace_end                          2349	4_0_0	EXIST::FUNCTION:
+OSSL_trace_string                       2350	4_0_0	EXIST::FUNCTION:
+TS_REQ_free                             2351	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_new                              2352	4_0_0	EXIST::FUNCTION:TS
+d2i_TS_REQ                              2353	4_0_0	EXIST::FUNCTION:TS
+i2d_TS_REQ                              2354	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_dup                              2355	4_0_0	EXIST::FUNCTION:TS
+d2i_TS_REQ_fp                           2356	4_0_0	EXIST::FUNCTION:STDIO,TS
+i2d_TS_REQ_fp                           2357	4_0_0	EXIST::FUNCTION:STDIO,TS
+d2i_TS_REQ_bio                          2358	4_0_0	EXIST::FUNCTION:TS
+i2d_TS_REQ_bio                          2359	4_0_0	EXIST::FUNCTION:TS
+TS_MSG_IMPRINT_free                     2360	4_0_0	EXIST::FUNCTION:TS
+TS_MSG_IMPRINT_new                      2361	4_0_0	EXIST::FUNCTION:TS
+d2i_TS_MSG_IMPRINT                      2362	4_0_0	EXIST::FUNCTION:TS
+i2d_TS_MSG_IMPRINT                      2363	4_0_0	EXIST::FUNCTION:TS
+TS_MSG_IMPRINT_dup                      2364	4_0_0	EXIST::FUNCTION:TS
+d2i_TS_MSG_IMPRINT_fp                   2365	4_0_0	EXIST::FUNCTION:STDIO,TS
+i2d_TS_MSG_IMPRINT_fp                   2366	4_0_0	EXIST::FUNCTION:STDIO,TS
+d2i_TS_MSG_IMPRINT_bio                  2367	4_0_0	EXIST::FUNCTION:TS
+i2d_TS_MSG_IMPRINT_bio                  2368	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_free                            2369	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_new                             2370	4_0_0	EXIST::FUNCTION:TS
+d2i_TS_RESP                             2371	4_0_0	EXIST::FUNCTION:TS
+i2d_TS_RESP                             2372	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_dup                             2373	4_0_0	EXIST::FUNCTION:TS
+d2i_TS_RESP_fp                          2374	4_0_0	EXIST::FUNCTION:STDIO,TS
+i2d_TS_RESP_fp                          2375	4_0_0	EXIST::FUNCTION:STDIO,TS
+d2i_TS_RESP_bio                         2376	4_0_0	EXIST::FUNCTION:TS
+i2d_TS_RESP_bio                         2377	4_0_0	EXIST::FUNCTION:TS
+TS_STATUS_INFO_free                     2378	4_0_0	EXIST::FUNCTION:TS
+TS_STATUS_INFO_new                      2379	4_0_0	EXIST::FUNCTION:TS
+d2i_TS_STATUS_INFO                      2380	4_0_0	EXIST::FUNCTION:TS
+i2d_TS_STATUS_INFO                      2381	4_0_0	EXIST::FUNCTION:TS
+TS_STATUS_INFO_dup                      2382	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_free                        2383	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_new                         2384	4_0_0	EXIST::FUNCTION:TS
+d2i_TS_TST_INFO                         2385	4_0_0	EXIST::FUNCTION:TS
+i2d_TS_TST_INFO                         2386	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_dup                         2387	4_0_0	EXIST::FUNCTION:TS
+PKCS7_to_TS_TST_INFO                    2388	4_0_0	EXIST::FUNCTION:TS
+d2i_TS_TST_INFO_fp                      2389	4_0_0	EXIST::FUNCTION:STDIO,TS
+i2d_TS_TST_INFO_fp                      2390	4_0_0	EXIST::FUNCTION:STDIO,TS
+d2i_TS_TST_INFO_bio                     2391	4_0_0	EXIST::FUNCTION:TS
+i2d_TS_TST_INFO_bio                     2392	4_0_0	EXIST::FUNCTION:TS
+TS_ACCURACY_free                        2393	4_0_0	EXIST::FUNCTION:TS
+TS_ACCURACY_new                         2394	4_0_0	EXIST::FUNCTION:TS
+d2i_TS_ACCURACY                         2395	4_0_0	EXIST::FUNCTION:TS
+i2d_TS_ACCURACY                         2396	4_0_0	EXIST::FUNCTION:TS
+TS_ACCURACY_dup                         2397	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_set_version                      2398	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_get_version                      2399	4_0_0	EXIST::FUNCTION:TS
+TS_STATUS_INFO_set_status               2400	4_0_0	EXIST::FUNCTION:TS
+TS_STATUS_INFO_get0_status              2401	4_0_0	EXIST::FUNCTION:TS
+TS_STATUS_INFO_get0_text                2402	4_0_0	EXIST::FUNCTION:TS
+TS_STATUS_INFO_get0_failure_info        2403	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_set_msg_imprint                  2404	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_get_msg_imprint                  2405	4_0_0	EXIST::FUNCTION:TS
+TS_MSG_IMPRINT_set_algo                 2406	4_0_0	EXIST::FUNCTION:TS
+TS_MSG_IMPRINT_get_algo                 2407	4_0_0	EXIST::FUNCTION:TS
+TS_MSG_IMPRINT_set_msg                  2408	4_0_0	EXIST::FUNCTION:TS
+TS_MSG_IMPRINT_get_msg                  2409	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_set_policy_id                    2410	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_get_policy_id                    2411	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_set_nonce                        2412	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_get_nonce                        2413	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_set_cert_req                     2414	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_get_cert_req                     2415	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_get_exts                         2416	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_ext_free                         2417	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_get_ext_count                    2418	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_get_ext_by_NID                   2419	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_get_ext_by_OBJ                   2420	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_get_ext_by_critical              2421	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_get_ext                          2422	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_delete_ext                       2423	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_add_ext                          2424	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_get_ext_d2i                      2425	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_print_bio                        2426	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_set_status_info                 2427	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_get_status_info                 2428	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_set_tst_info                    2429	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_get_token                       2430	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_get_tst_info                    2431	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_set_version                 2432	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_version                 2433	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_set_policy_id               2434	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_policy_id               2435	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_set_msg_imprint             2436	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_msg_imprint             2437	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_set_serial                  2438	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_serial                  2439	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_set_time                    2440	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_time                    2441	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_set_accuracy                2442	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_accuracy                2443	4_0_0	EXIST::FUNCTION:TS
+TS_ACCURACY_set_seconds                 2444	4_0_0	EXIST::FUNCTION:TS
+TS_ACCURACY_get_seconds                 2445	4_0_0	EXIST::FUNCTION:TS
+TS_ACCURACY_set_millis                  2446	4_0_0	EXIST::FUNCTION:TS
+TS_ACCURACY_get_millis                  2447	4_0_0	EXIST::FUNCTION:TS
+TS_ACCURACY_set_micros                  2448	4_0_0	EXIST::FUNCTION:TS
+TS_ACCURACY_get_micros                  2449	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_set_ordering                2450	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_ordering                2451	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_set_nonce                   2452	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_nonce                   2453	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_set_tsa                     2454	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_tsa                     2455	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_exts                    2456	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_ext_free                    2457	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_ext_count               2458	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_ext_by_NID              2459	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_ext_by_OBJ              2460	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_ext_by_critical         2461	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_ext                     2462	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_delete_ext                  2463	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_add_ext                     2464	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_get_ext_d2i                 2465	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_new                         2466	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_new_ex                      2467	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_free                        2468	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_set_signer_cert             2469	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_set_signer_key              2470	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_set_signer_digest           2471	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_set_ess_cert_id_digest      2472	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_set_def_policy              2473	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_set_certs                   2474	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_add_policy                  2475	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_add_md                      2476	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_set_accuracy                2477	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_set_clock_precision_digits  2478	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_add_flags                   2479	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_set_serial_cb               2480	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_set_time_cb                 2481	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_set_extension_cb            2482	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_set_status_info             2483	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_set_status_info_cond        2484	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_add_failure_info            2485	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_get_request                 2486	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_CTX_get_tst_info                2487	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_create_response                 2488	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_verify_signature                2489	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_verify_response                 2490	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_verify_token                    2491	4_0_0	EXIST::FUNCTION:TS
+TS_VERIFY_CTX_new                       2492	4_0_0	EXIST::FUNCTION:TS
+TS_VERIFY_CTX_init                      2493	4_0_0	EXIST::FUNCTION:TS
+TS_VERIFY_CTX_free                      2494	4_0_0	EXIST::FUNCTION:TS
+TS_VERIFY_CTX_cleanup                   2495	4_0_0	EXIST::FUNCTION:TS
+TS_VERIFY_CTX_set_flags                 2496	4_0_0	EXIST::FUNCTION:TS
+TS_VERIFY_CTX_add_flags                 2497	4_0_0	EXIST::FUNCTION:TS
+TS_VERIFY_CTX_set_data                  2498	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_4,TS
+TS_VERIFY_CTX_set0_data                 2499	4_0_0	EXIST::FUNCTION:TS
+TS_VERIFY_CTX_set_imprint               2500	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_4,TS
+TS_VERIFY_CTX_set0_imprint              2501	4_0_0	EXIST::FUNCTION:TS
+TS_VERIFY_CTX_set_store                 2502	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_4,TS
+TS_VERIFY_CTX_set0_store                2503	4_0_0	EXIST::FUNCTION:TS
+TS_VERIFY_CTX_set_certs                 2504	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_4,TS
+TS_VERIFY_CTX_set0_certs                2505	4_0_0	EXIST::FUNCTION:TS
+TS_REQ_to_TS_VERIFY_CTX                 2506	4_0_0	EXIST::FUNCTION:TS
+TS_RESP_print_bio                       2507	4_0_0	EXIST::FUNCTION:TS
+TS_STATUS_INFO_print_bio                2508	4_0_0	EXIST::FUNCTION:TS
+TS_TST_INFO_print_bio                   2509	4_0_0	EXIST::FUNCTION:TS
+TS_ASN1_INTEGER_print_bio               2510	4_0_0	EXIST::FUNCTION:TS
+TS_OBJ_print_bio                        2511	4_0_0	EXIST::FUNCTION:TS
+TS_ext_print_bio                        2512	4_0_0	EXIST::FUNCTION:TS
+TS_X509_ALGOR_print_bio                 2513	4_0_0	EXIST::FUNCTION:TS
+TS_MSG_IMPRINT_print_bio                2514	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_load_cert                       2515	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_load_certs                      2516	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_load_key                        2517	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_get_tsa_section                 2518	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_set_serial                      2519	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_set_signer_cert                 2520	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_set_certs                       2521	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_set_signer_key                  2522	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_set_signer_digest               2523	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_set_def_policy                  2524	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_set_policies                    2525	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_set_digests                     2526	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_set_accuracy                    2527	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_set_clock_precision_digits      2528	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_set_ordering                    2529	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_set_tsa_name                    2530	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_set_ess_cert_id_chain           2531	4_0_0	EXIST::FUNCTION:TS
+TS_CONF_set_ess_cert_id_digest          2532	4_0_0	EXIST::FUNCTION:TS
+TXT_DB_read                             2533	4_0_0	EXIST::FUNCTION:
+TXT_DB_write                            2534	4_0_0	EXIST::FUNCTION:
+TXT_DB_create_index                     2535	4_0_0	EXIST::FUNCTION:
+TXT_DB_free                             2536	4_0_0	EXIST::FUNCTION:
+TXT_DB_get_by_index                     2537	4_0_0	EXIST::FUNCTION:
+TXT_DB_insert                           2538	4_0_0	EXIST::FUNCTION:
+WHIRLPOOL_Init                          2539	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,WHIRLPOOL
+WHIRLPOOL_Update                        2540	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,WHIRLPOOL
+WHIRLPOOL_BitUpdate                     2541	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,WHIRLPOOL
+WHIRLPOOL_Final                         2542	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,WHIRLPOOL
+WHIRLPOOL                               2543	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,WHIRLPOOL
+d2i_ASN1_SEQUENCE_ANY                   2544	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_SEQUENCE_ANY                   2545	4_0_0	EXIST::FUNCTION:
+ASN1_SEQUENCE_ANY_it                    2546	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_SET_ANY                        2547	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_SET_ANY                        2548	4_0_0	EXIST::FUNCTION:
+ASN1_SET_ANY_it                         2549	4_0_0	EXIST::FUNCTION:
+ASN1_TYPE_free                          2550	4_0_0	EXIST::FUNCTION:
+ASN1_TYPE_new                           2551	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_TYPE                           2552	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_TYPE                           2553	4_0_0	EXIST::FUNCTION:
+ASN1_ANY_it                             2554	4_0_0	EXIST::FUNCTION:
+ASN1_TYPE_get                           2555	4_0_0	EXIST::FUNCTION:
+ASN1_TYPE_set                           2556	4_0_0	EXIST::FUNCTION:
+ASN1_TYPE_set1                          2557	4_0_0	EXIST::FUNCTION:
+ASN1_TYPE_cmp                           2558	4_0_0	EXIST::FUNCTION:
+ASN1_TYPE_pack_sequence                 2559	4_0_0	EXIST::FUNCTION:
+ASN1_TYPE_unpack_sequence               2560	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_OBJECT                         2561	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_OBJECT                         2562	4_0_0	EXIST::FUNCTION:
+ASN1_OBJECT_free                        2563	4_0_0	EXIST::FUNCTION:
+ASN1_OBJECT_new                         2564	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_0
+ASN1_OBJECT_it                          2565	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_new                         2566	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_free                        2567	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_clear_free                  2568	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_copy                        2569	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_dup                         2570	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_type_new                    2571	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_cmp                         2572	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_set                         2573	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+ASN1_STRING_set0                        2574	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_length                      2575	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+ASN1_STRING_length_set                  2576	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ASN1_STRING_type                        2577	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_get0_data                   2578	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_BIT_STRING                     2579	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_BIT_STRING                     2580	4_0_0	EXIST::FUNCTION:
+ASN1_BIT_STRING_free                    2581	4_0_0	EXIST::FUNCTION:
+ASN1_BIT_STRING_new                     2582	4_0_0	EXIST::FUNCTION:
+ASN1_BIT_STRING_it                      2583	4_0_0	EXIST::FUNCTION:
+ASN1_BIT_STRING_set                     2584	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+ASN1_BIT_STRING_set_bit                 2585	4_0_0	EXIST::FUNCTION:
+ASN1_BIT_STRING_get_bit                 2586	4_0_0	EXIST::FUNCTION:
+ASN1_BIT_STRING_check                   2587	4_0_0	EXIST::FUNCTION:
+ASN1_BIT_STRING_get_length              2588	4_0_0	EXIST::FUNCTION:
+ASN1_BIT_STRING_name_print              2589	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+ASN1_BIT_STRING_num_asc                 2590	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+ASN1_BIT_STRING_set_asc                 2591	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+d2i_ASN1_INTEGER                        2592	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_INTEGER                        2593	4_0_0	EXIST::FUNCTION:
+ASN1_INTEGER_free                       2594	4_0_0	EXIST::FUNCTION:
+ASN1_INTEGER_new                        2595	4_0_0	EXIST::FUNCTION:
+ASN1_INTEGER_it                         2596	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_UINTEGER                       2597	4_0_0	EXIST::FUNCTION:
+ASN1_INTEGER_dup                        2598	4_0_0	EXIST::FUNCTION:
+ASN1_INTEGER_cmp                        2599	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_ENUMERATED                     2600	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_ENUMERATED                     2601	4_0_0	EXIST::FUNCTION:
+ASN1_ENUMERATED_free                    2602	4_0_0	EXIST::FUNCTION:
+ASN1_ENUMERATED_new                     2603	4_0_0	EXIST::FUNCTION:
+ASN1_ENUMERATED_it                      2604	4_0_0	EXIST::FUNCTION:
+ASN1_UTCTIME_check                      2605	4_0_0	EXIST::FUNCTION:
+ASN1_UTCTIME_set                        2606	4_0_0	EXIST::FUNCTION:
+ASN1_UTCTIME_adj                        2607	4_0_0	EXIST::FUNCTION:
+ASN1_UTCTIME_set_string                 2608	4_0_0	EXIST::FUNCTION:
+ASN1_UTCTIME_cmp_time_t                 2609	4_0_0	EXIST::FUNCTION:
+ASN1_GENERALIZEDTIME_check              2610	4_0_0	EXIST::FUNCTION:
+ASN1_GENERALIZEDTIME_set                2611	4_0_0	EXIST::FUNCTION:
+ASN1_GENERALIZEDTIME_adj                2612	4_0_0	EXIST::FUNCTION:
+ASN1_GENERALIZEDTIME_set_string         2613	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_diff                          2614	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_OCTET_STRING                   2615	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_OCTET_STRING                   2616	4_0_0	EXIST::FUNCTION:
+ASN1_OCTET_STRING_free                  2617	4_0_0	EXIST::FUNCTION:
+ASN1_OCTET_STRING_new                   2618	4_0_0	EXIST::FUNCTION:
+ASN1_OCTET_STRING_it                    2619	4_0_0	EXIST::FUNCTION:
+ASN1_OCTET_STRING_dup                   2620	4_0_0	EXIST::FUNCTION:
+ASN1_OCTET_STRING_cmp                   2621	4_0_0	EXIST::FUNCTION:
+ASN1_OCTET_STRING_set                   2622	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_VISIBLESTRING                  2623	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_VISIBLESTRING                  2624	4_0_0	EXIST::FUNCTION:
+ASN1_VISIBLESTRING_free                 2625	4_0_0	EXIST::FUNCTION:
+ASN1_VISIBLESTRING_new                  2626	4_0_0	EXIST::FUNCTION:
+ASN1_VISIBLESTRING_it                   2627	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_UNIVERSALSTRING                2628	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_UNIVERSALSTRING                2629	4_0_0	EXIST::FUNCTION:
+ASN1_UNIVERSALSTRING_free               2630	4_0_0	EXIST::FUNCTION:
+ASN1_UNIVERSALSTRING_new                2631	4_0_0	EXIST::FUNCTION:
+ASN1_UNIVERSALSTRING_it                 2632	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_UTF8STRING                     2633	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_UTF8STRING                     2634	4_0_0	EXIST::FUNCTION:
+ASN1_UTF8STRING_free                    2635	4_0_0	EXIST::FUNCTION:
+ASN1_UTF8STRING_new                     2636	4_0_0	EXIST::FUNCTION:
+ASN1_UTF8STRING_it                      2637	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_NULL                           2638	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_NULL                           2639	4_0_0	EXIST::FUNCTION:
+ASN1_NULL_free                          2640	4_0_0	EXIST::FUNCTION:
+ASN1_NULL_new                           2641	4_0_0	EXIST::FUNCTION:
+ASN1_NULL_it                            2642	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_BMPSTRING                      2643	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_BMPSTRING                      2644	4_0_0	EXIST::FUNCTION:
+ASN1_BMPSTRING_free                     2645	4_0_0	EXIST::FUNCTION:
+ASN1_BMPSTRING_new                      2646	4_0_0	EXIST::FUNCTION:
+ASN1_BMPSTRING_it                       2647	4_0_0	EXIST::FUNCTION:
+UTF8_getc                               2648	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+UTF8_putc                               2649	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+d2i_ASN1_PRINTABLE                      2650	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_PRINTABLE                      2651	4_0_0	EXIST::FUNCTION:
+ASN1_PRINTABLE_free                     2652	4_0_0	EXIST::FUNCTION:
+ASN1_PRINTABLE_new                      2653	4_0_0	EXIST::FUNCTION:
+ASN1_PRINTABLE_it                       2654	4_0_0	EXIST::FUNCTION:
+d2i_DIRECTORYSTRING                     2655	4_0_0	EXIST::FUNCTION:
+i2d_DIRECTORYSTRING                     2656	4_0_0	EXIST::FUNCTION:
+DIRECTORYSTRING_free                    2657	4_0_0	EXIST::FUNCTION:
+DIRECTORYSTRING_new                     2658	4_0_0	EXIST::FUNCTION:
+DIRECTORYSTRING_it                      2659	4_0_0	EXIST::FUNCTION:
+d2i_DISPLAYTEXT                         2660	4_0_0	EXIST::FUNCTION:
+i2d_DISPLAYTEXT                         2661	4_0_0	EXIST::FUNCTION:
+DISPLAYTEXT_free                        2662	4_0_0	EXIST::FUNCTION:
+DISPLAYTEXT_new                         2663	4_0_0	EXIST::FUNCTION:
+DISPLAYTEXT_it                          2664	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_PRINTABLESTRING                2665	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_PRINTABLESTRING                2666	4_0_0	EXIST::FUNCTION:
+ASN1_PRINTABLESTRING_free               2667	4_0_0	EXIST::FUNCTION:
+ASN1_PRINTABLESTRING_new                2668	4_0_0	EXIST::FUNCTION:
+ASN1_PRINTABLESTRING_it                 2669	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_T61STRING                      2670	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_T61STRING                      2671	4_0_0	EXIST::FUNCTION:
+ASN1_T61STRING_free                     2672	4_0_0	EXIST::FUNCTION:
+ASN1_T61STRING_new                      2673	4_0_0	EXIST::FUNCTION:
+ASN1_T61STRING_it                       2674	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_IA5STRING                      2675	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_IA5STRING                      2676	4_0_0	EXIST::FUNCTION:
+ASN1_IA5STRING_free                     2677	4_0_0	EXIST::FUNCTION:
+ASN1_IA5STRING_new                      2678	4_0_0	EXIST::FUNCTION:
+ASN1_IA5STRING_it                       2679	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_GENERALSTRING                  2680	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_GENERALSTRING                  2681	4_0_0	EXIST::FUNCTION:
+ASN1_GENERALSTRING_free                 2682	4_0_0	EXIST::FUNCTION:
+ASN1_GENERALSTRING_new                  2683	4_0_0	EXIST::FUNCTION:
+ASN1_GENERALSTRING_it                   2684	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_UTCTIME                        2685	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_UTCTIME                        2686	4_0_0	EXIST::FUNCTION:
+ASN1_UTCTIME_free                       2687	4_0_0	EXIST::FUNCTION:
+ASN1_UTCTIME_new                        2688	4_0_0	EXIST::FUNCTION:
+ASN1_UTCTIME_it                         2689	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_GENERALIZEDTIME                2690	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_GENERALIZEDTIME                2691	4_0_0	EXIST::FUNCTION:
+ASN1_GENERALIZEDTIME_free               2692	4_0_0	EXIST::FUNCTION:
+ASN1_GENERALIZEDTIME_new                2693	4_0_0	EXIST::FUNCTION:
+ASN1_GENERALIZEDTIME_it                 2694	4_0_0	EXIST::FUNCTION:
+d2i_ASN1_TIME                           2695	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_TIME                           2696	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_free                          2697	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_new                           2698	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_it                            2699	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_dup                           2700	4_0_0	EXIST::FUNCTION:
+ASN1_UTCTIME_dup                        2701	4_0_0	EXIST::FUNCTION:
+ASN1_GENERALIZEDTIME_dup                2702	4_0_0	EXIST::FUNCTION:
+ASN1_OCTET_STRING_NDEF_it               2703	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_set                           2704	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_adj                           2705	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_check                         2706	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_to_generalizedtime            2707	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_set_string                    2708	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_set_string_X509               2709	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_to_tm                         2710	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_normalize                     2711	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_cmp_time_t                    2712	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_compare                       2713	4_0_0	EXIST::FUNCTION:
+i2a_ASN1_INTEGER                        2714	4_0_0	EXIST::FUNCTION:
+a2i_ASN1_INTEGER                        2715	4_0_0	EXIST::FUNCTION:
+i2a_ASN1_ENUMERATED                     2716	4_0_0	EXIST::FUNCTION:
+a2i_ASN1_ENUMERATED                     2717	4_0_0	EXIST::FUNCTION:
+i2a_ASN1_OBJECT                         2718	4_0_0	EXIST::FUNCTION:
+a2i_ASN1_STRING                         2719	4_0_0	EXIST::FUNCTION:
+i2a_ASN1_STRING                         2720	4_0_0	EXIST::FUNCTION:
+i2t_ASN1_OBJECT                         2721	4_0_0	EXIST::FUNCTION:
+a2d_ASN1_OBJECT                         2722	4_0_0	EXIST::FUNCTION:
+ASN1_OBJECT_create                      2723	4_0_0	EXIST::FUNCTION:
+ASN1_INTEGER_get_int64                  2724	4_0_0	EXIST::FUNCTION:
+ASN1_INTEGER_set_int64                  2725	4_0_0	EXIST::FUNCTION:
+ASN1_INTEGER_get_uint64                 2726	4_0_0	EXIST::FUNCTION:
+ASN1_INTEGER_set_uint64                 2727	4_0_0	EXIST::FUNCTION:
+ASN1_INTEGER_set                        2728	4_0_0	EXIST::FUNCTION:
+ASN1_INTEGER_get                        2729	4_0_0	EXIST::FUNCTION:
+BN_to_ASN1_INTEGER                      2730	4_0_0	EXIST::FUNCTION:
+ASN1_INTEGER_to_BN                      2731	4_0_0	EXIST::FUNCTION:
+ASN1_ENUMERATED_get_int64               2732	4_0_0	EXIST::FUNCTION:
+ASN1_ENUMERATED_set_int64               2733	4_0_0	EXIST::FUNCTION:
+ASN1_ENUMERATED_set                     2734	4_0_0	EXIST::FUNCTION:
+ASN1_ENUMERATED_get                     2735	4_0_0	EXIST::FUNCTION:
+BN_to_ASN1_ENUMERATED                   2736	4_0_0	EXIST::FUNCTION:
+ASN1_ENUMERATED_to_BN                   2737	4_0_0	EXIST::FUNCTION:
+ASN1_PRINTABLE_type                     2738	4_0_0	EXIST::FUNCTION:
+ASN1_tag2bit                            2739	4_0_0	EXIST::FUNCTION:
+ASN1_get_object                         2740	4_0_0	EXIST::FUNCTION:
+ASN1_check_infinite_end                 2741	4_0_0	EXIST::FUNCTION:
+ASN1_const_check_infinite_end           2742	4_0_0	EXIST::FUNCTION:
+ASN1_put_object                         2743	4_0_0	EXIST::FUNCTION:
+ASN1_put_eoc                            2744	4_0_0	EXIST::FUNCTION:
+ASN1_object_size                        2745	4_0_0	EXIST::FUNCTION:
+ASN1_dup                                2746	4_0_0	EXIST::FUNCTION:
+ASN1_item_dup                           2747	4_0_0	EXIST::FUNCTION:
+ASN1_item_sign_ex                       2748	4_0_0	EXIST::FUNCTION:
+ASN1_item_verify_ex                     2749	4_0_0	EXIST::FUNCTION:
+ASN1_d2i_fp                             2750	4_0_0	EXIST::FUNCTION:STDIO
+ASN1_item_d2i_fp_ex                     2751	4_0_0	EXIST::FUNCTION:STDIO
+ASN1_item_d2i_fp                        2752	4_0_0	EXIST::FUNCTION:STDIO
+ASN1_i2d_fp                             2753	4_0_0	EXIST::FUNCTION:STDIO
+ASN1_item_i2d_fp                        2754	4_0_0	EXIST::FUNCTION:STDIO
+ASN1_STRING_print_ex_fp                 2755	4_0_0	EXIST::FUNCTION:STDIO
+ASN1_STRING_to_UTF8                     2756	4_0_0	EXIST::FUNCTION:
+ASN1_d2i_bio                            2757	4_0_0	EXIST::FUNCTION:
+ASN1_item_d2i_bio_ex                    2758	4_0_0	EXIST::FUNCTION:
+ASN1_item_d2i_bio                       2759	4_0_0	EXIST::FUNCTION:
+ASN1_i2d_bio                            2760	4_0_0	EXIST::FUNCTION:
+ASN1_item_i2d_bio                       2761	4_0_0	EXIST::FUNCTION:
+ASN1_item_i2d_mem_bio                   2762	4_0_0	EXIST::FUNCTION:
+ASN1_UTCTIME_print                      2763	4_0_0	EXIST::FUNCTION:
+ASN1_GENERALIZEDTIME_print              2764	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_print                         2765	4_0_0	EXIST::FUNCTION:
+ASN1_TIME_print_ex                      2766	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_print                       2767	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_print_ex                    2768	4_0_0	EXIST::FUNCTION:
+ASN1_buf_print                          2769	4_0_0	EXIST::FUNCTION:
+ASN1_bn_print                           2770	4_0_0	EXIST::FUNCTION:
+ASN1_parse                              2771	4_0_0	EXIST::FUNCTION:
+ASN1_parse_dump                         2772	4_0_0	EXIST::FUNCTION:
+ASN1_tag2str                            2773	4_0_0	EXIST::FUNCTION:
+ASN1_UNIVERSALSTRING_to_string          2774	4_0_0	EXIST::FUNCTION:
+ASN1_TYPE_set_octetstring               2775	4_0_0	EXIST::FUNCTION:
+ASN1_TYPE_get_octetstring               2776	4_0_0	EXIST::FUNCTION:
+ASN1_TYPE_set_int_octetstring           2777	4_0_0	EXIST::FUNCTION:
+ASN1_TYPE_get_int_octetstring           2778	4_0_0	EXIST::FUNCTION:
+ASN1_item_unpack                        2779	4_0_0	EXIST::FUNCTION:
+ASN1_item_unpack_ex                     2780	4_0_0	EXIST::FUNCTION:
+ASN1_item_pack                          2781	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_set_default_mask            2782	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_set_default_mask_asc        2783	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_get_default_mask            2784	4_0_0	EXIST::FUNCTION:
+ASN1_mbstring_copy                      2785	4_0_0	EXIST::FUNCTION:
+ASN1_mbstring_ncopy                     2786	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_set_by_NID                  2787	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_TABLE_get                   2788	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_TABLE_add                   2789	4_0_0	EXIST::FUNCTION:
+ASN1_STRING_TABLE_cleanup               2790	4_0_0	EXIST::FUNCTION:
+ASN1_item_new                           2791	4_0_0	EXIST::FUNCTION:
+ASN1_item_new_ex                        2792	4_0_0	EXIST::FUNCTION:
+ASN1_item_free                          2793	4_0_0	EXIST::FUNCTION:
+ASN1_item_d2i_ex                        2794	4_0_0	EXIST::FUNCTION:
+ASN1_item_d2i                           2795	4_0_0	EXIST::FUNCTION:
+ASN1_item_i2d                           2796	4_0_0	EXIST::FUNCTION:
+ASN1_item_ndef_i2d                      2797	4_0_0	EXIST::FUNCTION:
+ASN1_add_oid_module                     2798	4_0_0	EXIST::FUNCTION:
+ASN1_add_stable_module                  2799	4_0_0	EXIST::FUNCTION:
+ASN1_generate_nconf                     2800	4_0_0	EXIST::FUNCTION:
+ASN1_generate_v3                        2801	4_0_0	EXIST::FUNCTION:
+ASN1_str2mask                           2802	4_0_0	EXIST::FUNCTION:
+ASN1_item_print                         2803	4_0_0	EXIST::FUNCTION:
+ASN1_PCTX_new                           2804	4_0_0	EXIST::FUNCTION:
+ASN1_PCTX_free                          2805	4_0_0	EXIST::FUNCTION:
+ASN1_PCTX_get_flags                     2806	4_0_0	EXIST::FUNCTION:
+ASN1_PCTX_set_flags                     2807	4_0_0	EXIST::FUNCTION:
+ASN1_PCTX_get_nm_flags                  2808	4_0_0	EXIST::FUNCTION:
+ASN1_PCTX_set_nm_flags                  2809	4_0_0	EXIST::FUNCTION:
+ASN1_PCTX_get_cert_flags                2810	4_0_0	EXIST::FUNCTION:
+ASN1_PCTX_set_cert_flags                2811	4_0_0	EXIST::FUNCTION:
+ASN1_PCTX_get_oid_flags                 2812	4_0_0	EXIST::FUNCTION:
+ASN1_PCTX_set_oid_flags                 2813	4_0_0	EXIST::FUNCTION:
+ASN1_PCTX_get_str_flags                 2814	4_0_0	EXIST::FUNCTION:
+ASN1_PCTX_set_str_flags                 2815	4_0_0	EXIST::FUNCTION:
+ASN1_SCTX_new                           2816	4_0_0	EXIST::FUNCTION:
+ASN1_SCTX_free                          2817	4_0_0	EXIST::FUNCTION:
+ASN1_SCTX_get_item                      2818	4_0_0	EXIST::FUNCTION:
+ASN1_SCTX_get_template                  2819	4_0_0	EXIST::FUNCTION:
+ASN1_SCTX_get_flags                     2820	4_0_0	EXIST::FUNCTION:
+ASN1_SCTX_set_app_data                  2821	4_0_0	EXIST::FUNCTION:
+ASN1_SCTX_get_app_data                  2822	4_0_0	EXIST::FUNCTION:
+BIO_f_asn1                              2823	4_0_0	EXIST::FUNCTION:
+BIO_new_NDEF                            2824	4_0_0	EXIST::FUNCTION:
+i2d_ASN1_bio_stream                     2825	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_ASN1_stream               2826	4_0_0	EXIST::FUNCTION:
+SMIME_write_ASN1                        2827	4_0_0	EXIST::FUNCTION:
+SMIME_write_ASN1_ex                     2828	4_0_0	EXIST::FUNCTION:
+SMIME_read_ASN1                         2829	4_0_0	EXIST::FUNCTION:
+SMIME_read_ASN1_ex                      2830	4_0_0	EXIST::FUNCTION:
+SMIME_crlf_copy                         2831	4_0_0	EXIST::FUNCTION:
+SMIME_text                              2832	4_0_0	EXIST::FUNCTION:
+ASN1_ITEM_lookup                        2833	4_0_0	EXIST::FUNCTION:
+ASN1_ITEM_get                           2834	4_0_0	EXIST::FUNCTION:
+ASN1_BOOLEAN_it                         2835	4_0_0	EXIST::FUNCTION:
+ASN1_TBOOLEAN_it                        2836	4_0_0	EXIST::FUNCTION:
+ASN1_FBOOLEAN_it                        2837	4_0_0	EXIST::FUNCTION:
+ASN1_SEQUENCE_it                        2838	4_0_0	EXIST::FUNCTION:
+CBIGNUM_it                              2839	4_0_0	EXIST::FUNCTION:
+BIGNUM_it                               2840	4_0_0	EXIST::FUNCTION:
+INT32_it                                2841	4_0_0	EXIST::FUNCTION:
+ZINT32_it                               2842	4_0_0	EXIST::FUNCTION:
+UINT32_it                               2843	4_0_0	EXIST::FUNCTION:
+ZUINT32_it                              2844	4_0_0	EXIST::FUNCTION:
+INT64_it                                2845	4_0_0	EXIST::FUNCTION:
+ZINT64_it                               2846	4_0_0	EXIST::FUNCTION:
+UINT64_it                               2847	4_0_0	EXIST::FUNCTION:
+ZUINT64_it                              2848	4_0_0	EXIST::FUNCTION:
+LONG_it                                 2849	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ZLONG_it                                2850	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ASN1_item_ex_new                        2851	4_0_0	EXIST::FUNCTION:
+ASN1_item_ex_free                       2852	4_0_0	EXIST::FUNCTION:
+ASN1_item_ex_d2i                        2853	4_0_0	EXIST::FUNCTION:
+ASN1_item_ex_i2d                        2854	4_0_0	EXIST::FUNCTION:
+BIO_get_new_index                       2855	4_0_0	EXIST::FUNCTION:
+BIO_set_flags                           2856	4_0_0	EXIST::FUNCTION:
+BIO_test_flags                          2857	4_0_0	EXIST::FUNCTION:
+BIO_clear_flags                         2858	4_0_0	EXIST::FUNCTION:
+BIO_set_send_flags                      2859	4_0_0	EXIST::FUNCTION:
+BIO_get_callback                        2860	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+BIO_set_callback                        2861	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+BIO_debug_callback                      2862	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+BIO_get_callback_ex                     2863	4_0_0	EXIST::FUNCTION:
+BIO_set_callback_ex                     2864	4_0_0	EXIST::FUNCTION:
+BIO_debug_callback_ex                   2865	4_0_0	EXIST::FUNCTION:
+BIO_get_callback_arg                    2866	4_0_0	EXIST::FUNCTION:
+BIO_set_callback_arg                    2867	4_0_0	EXIST::FUNCTION:
+BIO_method_name                         2868	4_0_0	EXIST::FUNCTION:
+BIO_method_type                         2869	4_0_0	EXIST::FUNCTION:
+BIO_ctrl_pending                        2870	4_0_0	EXIST::FUNCTION:
+BIO_ctrl_wpending                       2871	4_0_0	EXIST::FUNCTION:
+BIO_ctrl_get_write_guarantee            2872	4_0_0	EXIST::FUNCTION:
+BIO_ctrl_get_read_request               2873	4_0_0	EXIST::FUNCTION:
+BIO_ctrl_reset_read_request             2874	4_0_0	EXIST::FUNCTION:
+BIO_set_ex_data                         2875	4_0_0	EXIST::FUNCTION:
+BIO_get_ex_data                         2876	4_0_0	EXIST::FUNCTION:
+BIO_number_read                         2877	4_0_0	EXIST::FUNCTION:
+BIO_number_written                      2878	4_0_0	EXIST::FUNCTION:
+BIO_asn1_set_prefix                     2879	4_0_0	EXIST::FUNCTION:
+BIO_asn1_get_prefix                     2880	4_0_0	EXIST::FUNCTION:
+BIO_asn1_set_suffix                     2881	4_0_0	EXIST::FUNCTION:
+BIO_asn1_get_suffix                     2882	4_0_0	EXIST::FUNCTION:
+BIO_s_file                              2883	4_0_0	EXIST::FUNCTION:
+BIO_new_file                            2884	4_0_0	EXIST::FUNCTION:
+BIO_new_from_core_bio                   2885	4_0_0	EXIST::FUNCTION:
+BIO_new_fp                              2886	4_0_0	EXIST::FUNCTION:STDIO
+BIO_new_ex                              2887	4_0_0	EXIST::FUNCTION:
+BIO_new                                 2888	4_0_0	EXIST::FUNCTION:
+BIO_free                                2889	4_0_0	EXIST::FUNCTION:
+BIO_set_data                            2890	4_0_0	EXIST::FUNCTION:
+BIO_get_data                            2891	4_0_0	EXIST::FUNCTION:
+BIO_set_init                            2892	4_0_0	EXIST::FUNCTION:
+BIO_get_init                            2893	4_0_0	EXIST::FUNCTION:
+BIO_set_shutdown                        2894	4_0_0	EXIST::FUNCTION:
+BIO_get_shutdown                        2895	4_0_0	EXIST::FUNCTION:
+BIO_vfree                               2896	4_0_0	EXIST::FUNCTION:
+BIO_up_ref                              2897	4_0_0	EXIST::FUNCTION:
+BIO_read                                2898	4_0_0	EXIST::FUNCTION:
+BIO_read_ex                             2899	4_0_0	EXIST::FUNCTION:
+BIO_recvmmsg                            2900	4_0_0	EXIST::FUNCTION:
+BIO_gets                                2901	4_0_0	EXIST::FUNCTION:
+BIO_get_line                            2902	4_0_0	EXIST::FUNCTION:
+BIO_write                               2903	4_0_0	EXIST::FUNCTION:
+BIO_write_ex                            2904	4_0_0	EXIST::FUNCTION:
+BIO_sendmmsg                            2905	4_0_0	EXIST::FUNCTION:
+BIO_get_rpoll_descriptor                2906	4_0_0	EXIST::FUNCTION:
+BIO_get_wpoll_descriptor                2907	4_0_0	EXIST::FUNCTION:
+BIO_puts                                2908	4_0_0	EXIST::FUNCTION:
+BIO_indent                              2909	4_0_0	EXIST::FUNCTION:
+BIO_ctrl                                2910	4_0_0	EXIST::FUNCTION:
+BIO_eof                                 2911	4_0_0	EXIST::FUNCTION:
+BIO_callback_ctrl                       2912	4_0_0	EXIST::FUNCTION:
+BIO_ptr_ctrl                            2913	4_0_0	EXIST::FUNCTION:
+BIO_int_ctrl                            2914	4_0_0	EXIST::FUNCTION:
+BIO_push                                2915	4_0_0	EXIST::FUNCTION:
+BIO_pop                                 2916	4_0_0	EXIST::FUNCTION:
+BIO_free_all                            2917	4_0_0	EXIST::FUNCTION:
+BIO_find_type                           2918	4_0_0	EXIST::FUNCTION:
+BIO_next                                2919	4_0_0	EXIST::FUNCTION:
+BIO_set_next                            2920	4_0_0	EXIST::FUNCTION:
+BIO_get_retry_BIO                       2921	4_0_0	EXIST::FUNCTION:
+BIO_get_retry_reason                    2922	4_0_0	EXIST::FUNCTION:
+BIO_set_retry_reason                    2923	4_0_0	EXIST::FUNCTION:
+BIO_dup_chain                           2924	4_0_0	EXIST::FUNCTION:
+BIO_nread0                              2925	4_0_0	EXIST::FUNCTION:
+BIO_nread                               2926	4_0_0	EXIST::FUNCTION:
+BIO_nwrite0                             2927	4_0_0	EXIST::FUNCTION:
+BIO_nwrite                              2928	4_0_0	EXIST::FUNCTION:
+BIO_s_mem                               2929	4_0_0	EXIST::FUNCTION:
+BIO_s_dgram_mem                         2930	4_0_0	EXIST::FUNCTION:DGRAM
+BIO_s_secmem                            2931	4_0_0	EXIST::FUNCTION:
+BIO_new_mem_buf                         2932	4_0_0	EXIST::FUNCTION:
+BIO_s_socket                            2933	4_0_0	EXIST::FUNCTION:SOCK
+BIO_s_connect                           2934	4_0_0	EXIST::FUNCTION:SOCK
+BIO_s_accept                            2935	4_0_0	EXIST::FUNCTION:SOCK
+BIO_s_fd                                2936	4_0_0	EXIST::FUNCTION:
+BIO_s_log                               2937	4_0_0	EXIST::FUNCTION:
+BIO_s_bio                               2938	4_0_0	EXIST::FUNCTION:
+BIO_s_null                              2939	4_0_0	EXIST::FUNCTION:
+BIO_f_null                              2940	4_0_0	EXIST::FUNCTION:
+BIO_f_buffer                            2941	4_0_0	EXIST::FUNCTION:
+BIO_f_readbuffer                        2942	4_0_0	EXIST::FUNCTION:
+BIO_f_linebuffer                        2943	4_0_0	EXIST::FUNCTION:
+BIO_f_nbio_test                         2944	4_0_0	EXIST::FUNCTION:
+BIO_f_prefix                            2945	4_0_0	EXIST::FUNCTION:
+BIO_s_core                              2946	4_0_0	EXIST::FUNCTION:
+BIO_s_dgram_pair                        2947	4_0_0	EXIST::FUNCTION:DGRAM
+BIO_s_datagram                          2948	4_0_0	EXIST::FUNCTION:DGRAM
+BIO_dgram_non_fatal_error               2949	4_0_0	EXIST::FUNCTION:DGRAM
+BIO_new_dgram                           2950	4_0_0	EXIST::FUNCTION:DGRAM
+BIO_s_datagram_sctp                     2951	4_0_0	EXIST::FUNCTION:DGRAM,SCTP
+BIO_new_dgram_sctp                      2952	4_0_0	EXIST::FUNCTION:DGRAM,SCTP
+BIO_dgram_is_sctp                       2953	4_0_0	EXIST::FUNCTION:DGRAM,SCTP
+BIO_dgram_sctp_notification_cb          2954	4_0_0	EXIST::FUNCTION:DGRAM,SCTP
+BIO_dgram_sctp_wait_for_dry             2955	4_0_0	EXIST::FUNCTION:DGRAM,SCTP
+BIO_dgram_sctp_msg_waiting              2956	4_0_0	EXIST::FUNCTION:DGRAM,SCTP
+BIO_sock_should_retry                   2957	4_0_0	EXIST::FUNCTION:SOCK
+BIO_sock_non_fatal_error                2958	4_0_0	EXIST::FUNCTION:SOCK
+BIO_err_is_non_fatal                    2959	4_0_0	EXIST::FUNCTION:SOCK
+BIO_socket_wait                         2960	4_0_0	EXIST::FUNCTION:SOCK
+BIO_wait                                2961	4_0_0	EXIST::FUNCTION:
+BIO_do_connect_retry                    2962	4_0_0	EXIST::FUNCTION:
+BIO_fd_should_retry                     2963	4_0_0	EXIST::FUNCTION:
+BIO_fd_non_fatal_error                  2964	4_0_0	EXIST::FUNCTION:
+BIO_dump_cb                             2965	4_0_0	EXIST::FUNCTION:
+BIO_dump_indent_cb                      2966	4_0_0	EXIST::FUNCTION:
+BIO_dump                                2967	4_0_0	EXIST::FUNCTION:
+BIO_dump_indent                         2968	4_0_0	EXIST::FUNCTION:
+BIO_dump_fp                             2969	4_0_0	EXIST::FUNCTION:STDIO
+BIO_dump_indent_fp                      2970	4_0_0	EXIST::FUNCTION:STDIO
+BIO_hex_string                          2971	4_0_0	EXIST::FUNCTION:
+BIO_ADDR_new                            2972	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDR_copy                           2973	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDR_dup                            2974	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDR_rawmake                        2975	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDR_free                           2976	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDR_clear                          2977	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDR_family                         2978	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDR_rawaddress                     2979	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDR_rawport                        2980	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDR_hostname_string                2981	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDR_service_string                 2982	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDR_path_string                    2983	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDRINFO_next                       2984	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDRINFO_family                     2985	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDRINFO_socktype                   2986	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDRINFO_protocol                   2987	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDRINFO_address                    2988	4_0_0	EXIST::FUNCTION:SOCK
+BIO_ADDRINFO_free                       2989	4_0_0	EXIST::FUNCTION:SOCK
+BIO_parse_hostserv                      2990	4_0_0	EXIST::FUNCTION:SOCK
+BIO_lookup                              2991	4_0_0	EXIST::FUNCTION:SOCK
+BIO_lookup_ex                           2992	4_0_0	EXIST::FUNCTION:SOCK
+BIO_sock_error                          2993	4_0_0	EXIST::FUNCTION:SOCK
+BIO_socket_ioctl                        2994	4_0_0	EXIST::FUNCTION:SOCK
+BIO_socket_nbio                         2995	4_0_0	EXIST::FUNCTION:SOCK
+BIO_sock_init                           2996	4_0_0	EXIST::FUNCTION:SOCK
+BIO_set_tcp_ndelay                      2997	4_0_0	EXIST::FUNCTION:SOCK
+BIO_gethostbyname                       2998	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SOCK
+BIO_get_port                            2999	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SOCK
+BIO_get_host_ip                         3000	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SOCK
+BIO_get_accept_socket                   3001	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SOCK
+BIO_accept                              3002	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SOCK
+BIO_sock_info                           3003	4_0_0	EXIST::FUNCTION:SOCK
+BIO_socket                              3004	4_0_0	EXIST::FUNCTION:SOCK
+BIO_connect                             3005	4_0_0	EXIST::FUNCTION:SOCK
+BIO_bind                                3006	4_0_0	EXIST::FUNCTION:SOCK
+BIO_listen                              3007	4_0_0	EXIST::FUNCTION:SOCK
+BIO_accept_ex                           3008	4_0_0	EXIST::FUNCTION:SOCK
+BIO_closesocket                         3009	4_0_0	EXIST::FUNCTION:SOCK
+BIO_new_socket                          3010	4_0_0	EXIST::FUNCTION:SOCK
+BIO_new_connect                         3011	4_0_0	EXIST::FUNCTION:SOCK
+BIO_new_accept                          3012	4_0_0	EXIST::FUNCTION:SOCK
+BIO_new_fd                              3013	4_0_0	EXIST::FUNCTION:
+BIO_new_bio_pair                        3014	4_0_0	EXIST::FUNCTION:
+BIO_new_bio_dgram_pair                  3015	4_0_0	EXIST::FUNCTION:DGRAM
+BIO_copy_next_retry                     3016	4_0_0	EXIST::FUNCTION:
+BIO_printf                              3017	4_0_0	EXIST::FUNCTION:
+BIO_vprintf                             3018	4_0_0	EXIST::FUNCTION:
+BIO_snprintf                            3019	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+BIO_vsnprintf                           3020	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+BIO_meth_new                            3021	4_0_0	EXIST::FUNCTION:
+BIO_meth_free                           3022	4_0_0	EXIST::FUNCTION:
+BIO_meth_set_write                      3023	4_0_0	EXIST::FUNCTION:
+BIO_meth_set_write_ex                   3024	4_0_0	EXIST::FUNCTION:
+BIO_meth_set_sendmmsg                   3025	4_0_0	EXIST::FUNCTION:
+BIO_meth_set_read                       3026	4_0_0	EXIST::FUNCTION:
+BIO_meth_set_read_ex                    3027	4_0_0	EXIST::FUNCTION:
+BIO_meth_set_recvmmsg                   3028	4_0_0	EXIST::FUNCTION:
+BIO_meth_set_puts                       3029	4_0_0	EXIST::FUNCTION:
+BIO_meth_set_gets                       3030	4_0_0	EXIST::FUNCTION:
+BIO_meth_set_ctrl                       3031	4_0_0	EXIST::FUNCTION:
+BIO_meth_set_create                     3032	4_0_0	EXIST::FUNCTION:
+BIO_meth_set_destroy                    3033	4_0_0	EXIST::FUNCTION:
+BIO_meth_set_callback_ctrl              3034	4_0_0	EXIST::FUNCTION:
+BIO_meth_get_write                      3035	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
+BIO_meth_get_write_ex                   3036	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
+BIO_meth_get_sendmmsg                   3037	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
+BIO_meth_get_read                       3038	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
+BIO_meth_get_read_ex                    3039	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
+BIO_meth_get_recvmmsg                   3040	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
+BIO_meth_get_puts                       3041	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
+BIO_meth_get_gets                       3042	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
+BIO_meth_get_ctrl                       3043	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
+BIO_meth_get_create                     3044	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
+BIO_meth_get_destroy                    3045	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
+BIO_meth_get_callback_ctrl              3046	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_5
+OSSL_CMP_PKISTATUS_it                   3047	4_0_0	EXIST::FUNCTION:CMP
+d2i_OSSL_CMP_PKIHEADER                  3048	4_0_0	EXIST::FUNCTION:CMP
+i2d_OSSL_CMP_PKIHEADER                  3049	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_PKIHEADER_free                 3050	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_PKIHEADER_new                  3051	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_PKIHEADER_it                   3052	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_MSG_dup                        3053	4_0_0	EXIST::FUNCTION:CMP
+d2i_OSSL_CMP_MSG                        3054	4_0_0	EXIST::FUNCTION:CMP
+i2d_OSSL_CMP_MSG                        3055	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_MSG_it                         3056	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_dup                       3057	4_0_0	EXIST::FUNCTION:CMP
+d2i_OSSL_CMP_ATAVS                      3058	4_0_0	EXIST::FUNCTION:CMP
+i2d_OSSL_CMP_ATAVS                      3059	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ATAVS_free                     3060	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ATAVS_new                      3061	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ATAVS_it                       3062	4_0_0	EXIST::FUNCTION:CMP
+d2i_OSSL_CMP_PKISI                      3063	4_0_0	EXIST::FUNCTION:CMP
+i2d_OSSL_CMP_PKISI                      3064	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_PKISI_free                     3065	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_PKISI_new                      3066	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_PKISI_it                       3067	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_PKISI_dup                      3068	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_create                    3069	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_set0                      3070	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_get0_type                 3071	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_get0_value                3072	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_push0_stack_item          3073	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_free                      3074	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_new0_certProfile          3075	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_get0_certProfile          3076	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_new_caCerts               3077	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_get0_caCerts              3078	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_new_rootCaCert            3079	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_get0_rootCaCert           3080	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_new_rootCaKeyUpdate       3081	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_get0_rootCaKeyUpdate      3082	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CRLSTATUS_create               3083	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CRLSTATUS_new1                 3084	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CRLSTATUS_get0                 3085	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CRLSTATUS_free                 3086	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_new0_crlStatusList        3087	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_get0_crlStatusList        3088	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_new_crls                  3089	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_get0_crls                 3090	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_new0_certReqTemplate      3091	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ITAV_get1_certReqTemplate      3092	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ATAV_create                    3093	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ATAV_set0                      3094	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ATAV_get0_type                 3095	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ATAV_get0_value                3096	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ATAV_new_algId                 3097	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ATAV_get0_algId                3098	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ATAV_new_rsaKeyLen             3099	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ATAV_get_rsaKeyLen             3100	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_ATAV_push1                     3101	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_MSG_free                       3102	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_new                        3103	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_free                       3104	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_reinit                     3105	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get0_libctx                3106	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get0_propq                 3107	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set_option                 3108	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get_option                 3109	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set_log_cb                 3110	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_print_errors               3111	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_serverPath            3112	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_server                3113	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set_serverPort             3114	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_proxy                 3115	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_no_proxy              3116	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set_http_cb                3117	4_0_0	EXIST::FUNCTION:CMP,HTTP
+OSSL_CMP_CTX_set_http_cb_arg            3118	4_0_0	EXIST::FUNCTION:CMP,HTTP
+OSSL_CMP_CTX_get_http_cb_arg            3119	4_0_0	EXIST::FUNCTION:CMP,HTTP
+OSSL_CMP_CTX_set_transfer_cb            3120	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set_transfer_cb_arg        3121	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get_transfer_cb_arg        3122	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_srvCert               3123	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_expected_sender       3124	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set0_trustedStore          3125	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get0_trustedStore          3126	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_untrusted             3127	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get0_untrusted             3128	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_cert                  3129	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_build_cert_chain           3130	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_pkey                  3131	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_referenceValue        3132	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_secretValue           3133	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_recipient             3134	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_push0_geninfo_ITAV         3135	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_reset_geninfo_ITAVs        3136	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get0_geninfo_ITAVs         3137	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_extraCertsOut         3138	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set0_newPkey               3139	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get0_newPkey               3140	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_issuer                3141	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_serialNumber          3142	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_subjectName           3143	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_push1_subjectAltName       3144	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set0_reqExtensions         3145	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_reqExtensions_have_SAN     3146	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_push0_policy               3147	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_oldCert               3148	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_p10CSR                3149	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_push0_genm_ITAV            3150	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_certConf_cb                    3151	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set_certConf_cb            3152	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set_certConf_cb_arg        3153	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get_certConf_cb_arg        3154	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get_status                 3155	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get0_statusString          3156	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get_failInfoCode           3157	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get0_validatedSrvCert      3158	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get0_newCert               3159	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get1_newChain              3160	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get1_caPubs                3161	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_get1_extraCertsIn          3162	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_transactionID         3163	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_set1_senderNonce           3164	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_snprint_PKIStatus          3165	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_snprint_PKIStatusInfo          3166	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_STATUSINFO_new                 3167	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_HDR_get0_transactionID         3168	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_HDR_get0_recipNonce            3169	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_HDR_get0_geninfo_ITAVs         3170	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_MSG_get0_header                3171	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_MSG_get_bodytype               3172	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_MSG_get0_certreq_publickey     3173	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_MSG_update_transactionID       3174	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_MSG_update_recipNonce          3175	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_setup_CRM                  3176	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_MSG_read                       3177	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_MSG_write                      3178	4_0_0	EXIST::FUNCTION:CMP
+d2i_OSSL_CMP_MSG_bio                    3179	4_0_0	EXIST::FUNCTION:CMP
+i2d_OSSL_CMP_MSG_bio                    3180	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_validate_msg                   3181	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_validate_cert_path             3182	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_MSG_http_perform               3183	4_0_0	EXIST::FUNCTION:CMP,HTTP
+OSSL_CMP_SRV_process_request            3184	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_CTX_server_perform             3185	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_SRV_CTX_new                    3186	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_SRV_CTX_free                   3187	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_SRV_CTX_init                   3188	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_SRV_CTX_init_trans             3189	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_SRV_CTX_get0_cmp_ctx           3190	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_SRV_CTX_get0_custom_ctx        3191	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_SRV_CTX_set_send_unprotected_errors 3192	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_SRV_CTX_set_accept_unprotected 3193	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_SRV_CTX_set_accept_raverified  3194	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_SRV_CTX_set_grant_implicit_confirm 3195	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_exec_certreq                   3196	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_try_certreq                    3197	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_exec_RR_ses                    3198	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_exec_GENM_ses                  3199	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_get1_caCerts                   3200	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_get1_rootCaKeyUpdate           3201	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_get1_crlUpdate                 3202	4_0_0	EXIST::FUNCTION:CMP
+OSSL_CMP_get1_certReqTemplate           3203	4_0_0	EXIST::FUNCTION:CMP
+CMS_EnvelopedData_it                    3204	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignedData_free                     3205	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignedData_new                      3206	4_0_0	EXIST::FUNCTION:CMS
+d2i_CMS_ContentInfo                     3207	4_0_0	EXIST::FUNCTION:CMS
+i2d_CMS_ContentInfo                     3208	4_0_0	EXIST::FUNCTION:CMS
+CMS_ContentInfo_free                    3209	4_0_0	EXIST::FUNCTION:CMS
+CMS_ContentInfo_new                     3210	4_0_0	EXIST::FUNCTION:CMS
+CMS_ContentInfo_it                      3211	4_0_0	EXIST::FUNCTION:CMS
+d2i_CMS_ReceiptRequest                  3212	4_0_0	EXIST::FUNCTION:CMS
+i2d_CMS_ReceiptRequest                  3213	4_0_0	EXIST::FUNCTION:CMS
+CMS_ReceiptRequest_free                 3214	4_0_0	EXIST::FUNCTION:CMS
+CMS_ReceiptRequest_new                  3215	4_0_0	EXIST::FUNCTION:CMS
+CMS_ReceiptRequest_it                   3216	4_0_0	EXIST::FUNCTION:CMS
+CMS_ContentInfo_print_ctx               3217	4_0_0	EXIST::FUNCTION:CMS
+CMS_EnvelopedData_dup                   3218	4_0_0	EXIST::FUNCTION:CMS
+CMS_ContentInfo_new_ex                  3219	4_0_0	EXIST::FUNCTION:CMS
+CMS_get0_type                           3220	4_0_0	EXIST::FUNCTION:CMS
+CMS_dataInit                            3221	4_0_0	EXIST::FUNCTION:CMS
+CMS_dataFinal                           3222	4_0_0	EXIST::FUNCTION:CMS
+CMS_get0_content                        3223	4_0_0	EXIST::FUNCTION:CMS
+CMS_is_detached                         3224	4_0_0	EXIST::FUNCTION:CMS
+CMS_set_detached                        3225	4_0_0	EXIST::FUNCTION:CMS
+PEM_read_CMS                            3226	4_0_0	EXIST::FUNCTION:CMS,STDIO
+PEM_write_CMS                           3227	4_0_0	EXIST::FUNCTION:CMS,STDIO
+PEM_read_bio_CMS                        3228	4_0_0	EXIST::FUNCTION:CMS
+PEM_write_bio_CMS                       3229	4_0_0	EXIST::FUNCTION:CMS
+CMS_stream                              3230	4_0_0	EXIST::FUNCTION:CMS,DEPRECATEDIN_4_1
+d2i_CMS_bio                             3231	4_0_0	EXIST::FUNCTION:CMS
+i2d_CMS_bio                             3232	4_0_0	EXIST::FUNCTION:CMS
+BIO_new_CMS                             3233	4_0_0	EXIST::FUNCTION:CMS
+i2d_CMS_bio_stream                      3234	4_0_0	EXIST::FUNCTION:CMS
+PEM_write_bio_CMS_stream                3235	4_0_0	EXIST::FUNCTION:CMS
+SMIME_read_CMS                          3236	4_0_0	EXIST::FUNCTION:CMS
+SMIME_read_CMS_ex                       3237	4_0_0	EXIST::FUNCTION:CMS
+SMIME_write_CMS                         3238	4_0_0	EXIST::FUNCTION:CMS
+CMS_final                               3239	4_0_0	EXIST::FUNCTION:CMS
+CMS_final_digest                        3240	4_0_0	EXIST::FUNCTION:CMS
+CMS_sign                                3241	4_0_0	EXIST::FUNCTION:CMS
+CMS_sign_ex                             3242	4_0_0	EXIST::FUNCTION:CMS
+CMS_sign_receipt                        3243	4_0_0	EXIST::FUNCTION:CMS
+CMS_data                                3244	4_0_0	EXIST::FUNCTION:CMS
+CMS_data_create                         3245	4_0_0	EXIST::FUNCTION:CMS
+CMS_data_create_ex                      3246	4_0_0	EXIST::FUNCTION:CMS
+CMS_digest_verify                       3247	4_0_0	EXIST::FUNCTION:CMS
+CMS_digest_create                       3248	4_0_0	EXIST::FUNCTION:CMS
+CMS_digest_create_ex                    3249	4_0_0	EXIST::FUNCTION:CMS
+CMS_EncryptedData_decrypt               3250	4_0_0	EXIST::FUNCTION:CMS
+CMS_EncryptedData_encrypt               3251	4_0_0	EXIST::FUNCTION:CMS
+CMS_EncryptedData_encrypt_ex            3252	4_0_0	EXIST::FUNCTION:CMS
+CMS_EncryptedData_set1_key              3253	4_0_0	EXIST::FUNCTION:CMS
+CMS_verify                              3254	4_0_0	EXIST::FUNCTION:CMS
+CMS_verify_receipt                      3255	4_0_0	EXIST::FUNCTION:CMS
+CMS_get0_signers                        3256	4_0_0	EXIST::FUNCTION:CMS
+CMS_encrypt                             3257	4_0_0	EXIST::FUNCTION:CMS
+CMS_encrypt_ex                          3258	4_0_0	EXIST::FUNCTION:CMS
+CMS_decrypt                             3259	4_0_0	EXIST::FUNCTION:CMS
+CMS_decrypt_set1_pkey                   3260	4_0_0	EXIST::FUNCTION:CMS
+CMS_decrypt_set1_pkey_and_peer          3261	4_0_0	EXIST::FUNCTION:CMS
+CMS_decrypt_set1_key                    3262	4_0_0	EXIST::FUNCTION:CMS
+CMS_decrypt_set1_password               3263	4_0_0	EXIST::FUNCTION:CMS
+CMS_get0_RecipientInfos                 3264	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_type                  3265	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_get0_pkey_ctx         3266	4_0_0	EXIST::FUNCTION:CMS
+CMS_AuthEnvelopedData_create            3267	4_0_0	EXIST::FUNCTION:CMS
+CMS_AuthEnvelopedData_create_ex         3268	4_0_0	EXIST::FUNCTION:CMS
+CMS_EnvelopedData_create                3269	4_0_0	EXIST::FUNCTION:CMS
+CMS_EnvelopedData_create_ex             3270	4_0_0	EXIST::FUNCTION:CMS
+CMS_EnvelopedData_decrypt               3271	4_0_0	EXIST::FUNCTION:CMS
+CMS_add1_recipient_cert                 3272	4_0_0	EXIST::FUNCTION:CMS
+CMS_add1_recipient                      3273	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_set0_pkey             3274	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_ktri_cert_cmp         3275	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_ktri_get0_algs        3276	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_ktri_get0_signer_id   3277	4_0_0	EXIST::FUNCTION:CMS
+CMS_add0_recipient_key                  3278	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kekri_get0_id         3279	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_set0_key              3280	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kekri_id_cmp          3281	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_set0_password         3282	4_0_0	EXIST::FUNCTION:CMS
+CMS_add0_recipient_password             3283	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_decrypt               3284	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_encrypt               3285	4_0_0	EXIST::FUNCTION:CMS
+CMS_uncompress                          3286	4_0_0	EXIST::FUNCTION:CMS
+CMS_compress                            3287	4_0_0	EXIST::FUNCTION:CMS
+CMS_set1_eContentType                   3288	4_0_0	EXIST::FUNCTION:CMS
+CMS_get0_eContentType                   3289	4_0_0	EXIST::FUNCTION:CMS
+CMS_add0_CertificateChoices             3290	4_0_0	EXIST::FUNCTION:CMS
+CMS_add0_cert                           3291	4_0_0	EXIST::FUNCTION:CMS
+CMS_add1_cert                           3292	4_0_0	EXIST::FUNCTION:CMS
+CMS_get1_certs                          3293	4_0_0	EXIST::FUNCTION:CMS
+CMS_add0_RevocationInfoChoice           3294	4_0_0	EXIST::FUNCTION:CMS
+CMS_add0_crl                            3295	4_0_0	EXIST::FUNCTION:CMS
+CMS_add1_crl                            3296	4_0_0	EXIST::FUNCTION:CMS
+CMS_get1_crls                           3297	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignedData_init                     3298	4_0_0	EXIST::FUNCTION:CMS
+CMS_add1_signer                         3299	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignerInfo_get0_pkey_ctx            3300	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignerInfo_get0_md_ctx              3301	4_0_0	EXIST::FUNCTION:CMS
+CMS_get0_SignerInfos                    3302	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignerInfo_set1_signer_cert         3303	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignerInfo_get0_signer_id           3304	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignerInfo_cert_cmp                 3305	4_0_0	EXIST::FUNCTION:CMS
+CMS_set1_signers_certs                  3306	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignerInfo_get0_algs                3307	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignerInfo_get0_signature           3308	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignerInfo_sign                     3309	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignerInfo_verify                   3310	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignerInfo_verify_content           3311	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignedData_verify                   3312	4_0_0	EXIST::FUNCTION:CMS
+CMS_add_smimecap                        3313	4_0_0	EXIST::FUNCTION:CMS
+CMS_add_simple_smimecap                 3314	4_0_0	EXIST::FUNCTION:CMS
+CMS_add_standard_smimecap               3315	4_0_0	EXIST::FUNCTION:CMS
+CMS_signed_get_attr_count               3316	4_0_0	EXIST::FUNCTION:CMS
+CMS_signed_get_attr_by_NID              3317	4_0_0	EXIST::FUNCTION:CMS
+CMS_signed_get_attr_by_OBJ              3318	4_0_0	EXIST::FUNCTION:CMS
+CMS_signed_get_attr                     3319	4_0_0	EXIST::FUNCTION:CMS
+CMS_signed_delete_attr                  3320	4_0_0	EXIST::FUNCTION:CMS
+CMS_signed_add1_attr                    3321	4_0_0	EXIST::FUNCTION:CMS
+CMS_signed_add1_attr_by_OBJ             3322	4_0_0	EXIST::FUNCTION:CMS
+CMS_signed_add1_attr_by_NID             3323	4_0_0	EXIST::FUNCTION:CMS
+CMS_signed_add1_attr_by_txt             3324	4_0_0	EXIST::FUNCTION:CMS
+CMS_signed_get0_data_by_OBJ             3325	4_0_0	EXIST::FUNCTION:CMS
+CMS_unsigned_get_attr_count             3326	4_0_0	EXIST::FUNCTION:CMS
+CMS_unsigned_get_attr_by_NID            3327	4_0_0	EXIST::FUNCTION:CMS
+CMS_unsigned_get_attr_by_OBJ            3328	4_0_0	EXIST::FUNCTION:CMS
+CMS_unsigned_get_attr                   3329	4_0_0	EXIST::FUNCTION:CMS
+CMS_unsigned_delete_attr                3330	4_0_0	EXIST::FUNCTION:CMS
+CMS_unsigned_add1_attr                  3331	4_0_0	EXIST::FUNCTION:CMS
+CMS_unsigned_add1_attr_by_OBJ           3332	4_0_0	EXIST::FUNCTION:CMS
+CMS_unsigned_add1_attr_by_NID           3333	4_0_0	EXIST::FUNCTION:CMS
+CMS_unsigned_add1_attr_by_txt           3334	4_0_0	EXIST::FUNCTION:CMS
+CMS_unsigned_get0_data_by_OBJ           3335	4_0_0	EXIST::FUNCTION:CMS
+CMS_get1_ReceiptRequest                 3336	4_0_0	EXIST::FUNCTION:CMS
+CMS_ReceiptRequest_create0              3337	4_0_0	EXIST::FUNCTION:CMS
+CMS_ReceiptRequest_create0_ex           3338	4_0_0	EXIST::FUNCTION:CMS
+CMS_add1_ReceiptRequest                 3339	4_0_0	EXIST::FUNCTION:CMS
+CMS_ReceiptRequest_get0_values          3340	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kari_get0_alg         3341	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kari_get0_reks        3342	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kari_get0_orig_id     3343	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kari_orig_id_cmp      3344	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientEncryptedKey_get0_id       3345	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientEncryptedKey_cert_cmp      3346	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kari_set0_pkey        3347	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kari_set0_pkey_and_peer 3348	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kari_get0_ctx         3349	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kari_decrypt          3350	4_0_0	EXIST::FUNCTION:CMS
+CMS_SharedInfo_encode                   3351	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kemri_cert_cmp        3352	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kemri_set0_pkey       3353	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kemri_get0_ctx        3354	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kemri_get0_kdf_alg    3355	4_0_0	EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kemri_set_ukm         3356	4_0_0	EXIST::FUNCTION:CMS
+COMP_CTX_new                            3357	4_0_0	EXIST::FUNCTION:COMP
+COMP_CTX_get_method                     3358	4_0_0	EXIST::FUNCTION:COMP
+COMP_CTX_get_type                       3359	4_0_0	EXIST::FUNCTION:COMP
+COMP_get_type                           3360	4_0_0	EXIST::FUNCTION:COMP
+COMP_get_name                           3361	4_0_0	EXIST::FUNCTION:COMP
+COMP_CTX_free                           3362	4_0_0	EXIST::FUNCTION:COMP
+COMP_compress_block                     3363	4_0_0	EXIST::FUNCTION:COMP
+COMP_expand_block                       3364	4_0_0	EXIST::FUNCTION:COMP
+COMP_zlib                               3365	4_0_0	EXIST::FUNCTION:COMP
+COMP_zlib_oneshot                       3366	4_0_0	EXIST::FUNCTION:COMP
+COMP_brotli                             3367	4_0_0	EXIST::FUNCTION:COMP
+COMP_brotli_oneshot                     3368	4_0_0	EXIST::FUNCTION:COMP
+COMP_zstd                               3369	4_0_0	EXIST::FUNCTION:COMP
+COMP_zstd_oneshot                       3370	4_0_0	EXIST::FUNCTION:COMP
+BIO_f_zlib                              3371	4_0_0	EXIST::FUNCTION:COMP
+BIO_f_brotli                            3372	4_0_0	EXIST::FUNCTION:COMP
+BIO_f_zstd                              3373	4_0_0	EXIST::FUNCTION:COMP
+CONF_set_default_method                 3374	4_0_0	EXIST::FUNCTION:
+CONF_set_nconf                          3375	4_0_0	EXIST::FUNCTION:
+CONF_load                               3376	4_0_0	EXIST::FUNCTION:
+CONF_load_fp                            3377	4_0_0	EXIST::FUNCTION:STDIO
+CONF_load_bio                           3378	4_0_0	EXIST::FUNCTION:
+CONF_get_section                        3379	4_0_0	EXIST::FUNCTION:
+CONF_get_string                         3380	4_0_0	EXIST::FUNCTION:
+CONF_get_number                         3381	4_0_0	EXIST::FUNCTION:
+CONF_free                               3382	4_0_0	EXIST::FUNCTION:
+CONF_dump_fp                            3383	4_0_0	EXIST::FUNCTION:STDIO
+CONF_dump_bio                           3384	4_0_0	EXIST::FUNCTION:
+OPENSSL_config                          3385	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
+NCONF_new_ex                            3386	4_0_0	EXIST::FUNCTION:
+NCONF_get0_libctx                       3387	4_0_0	EXIST::FUNCTION:
+NCONF_new                               3388	4_0_0	EXIST::FUNCTION:
+NCONF_default                           3389	4_0_0	EXIST::FUNCTION:
+NCONF_WIN32                             3390	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+NCONF_free                              3391	4_0_0	EXIST::FUNCTION:
+NCONF_free_data                         3392	4_0_0	EXIST::FUNCTION:
+NCONF_load                              3393	4_0_0	EXIST::FUNCTION:
+NCONF_load_fp                           3394	4_0_0	EXIST::FUNCTION:STDIO
+NCONF_load_bio                          3395	4_0_0	EXIST::FUNCTION:
+NCONF_get_section_names                 3396	4_0_0	EXIST::FUNCTION:
+NCONF_get_section                       3397	4_0_0	EXIST::FUNCTION:
+NCONF_get_string                        3398	4_0_0	EXIST::FUNCTION:
+NCONF_get_number_e                      3399	4_0_0	EXIST::FUNCTION:
+NCONF_dump_fp                           3400	4_0_0	EXIST::FUNCTION:STDIO
+NCONF_dump_bio                          3401	4_0_0	EXIST::FUNCTION:
+CONF_modules_load                       3402	4_0_0	EXIST::FUNCTION:
+CONF_modules_load_file_ex               3403	4_0_0	EXIST::FUNCTION:
+CONF_modules_load_file                  3404	4_0_0	EXIST::FUNCTION:
+CONF_modules_unload                     3405	4_0_0	EXIST::FUNCTION:
+CONF_modules_finish                     3406	4_0_0	EXIST::FUNCTION:
+CONF_module_add                         3407	4_0_0	EXIST::FUNCTION:
+CONF_imodule_get_name                   3408	4_0_0	EXIST::FUNCTION:
+CONF_imodule_get_value                  3409	4_0_0	EXIST::FUNCTION:
+CONF_imodule_get_usr_data               3410	4_0_0	EXIST::FUNCTION:
+CONF_imodule_set_usr_data               3411	4_0_0	EXIST::FUNCTION:
+CONF_imodule_get_module                 3412	4_0_0	EXIST::FUNCTION:
+CONF_imodule_get_flags                  3413	4_0_0	EXIST::FUNCTION:
+CONF_imodule_set_flags                  3414	4_0_0	EXIST::FUNCTION:
+CONF_module_get_usr_data                3415	4_0_0	EXIST::FUNCTION:
+CONF_module_set_usr_data                3416	4_0_0	EXIST::FUNCTION:
+CONF_get1_default_config_file           3417	4_0_0	EXIST::FUNCTION:
+CONF_parse_list                         3418	4_0_0	EXIST::FUNCTION:
+OPENSSL_load_builtin_modules            3419	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_CRMF_ENCRYPTEDVALUE            3420	4_0_0	EXIST::FUNCTION:CRMF
+i2d_OSSL_CRMF_ENCRYPTEDVALUE            3421	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_ENCRYPTEDVALUE_free           3422	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_ENCRYPTEDVALUE_new            3423	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_ENCRYPTEDVALUE_it             3424	4_0_0	EXIST::FUNCTION:CRMF
+d2i_OSSL_CRMF_ENCRYPTEDKEY              3425	4_0_0	EXIST::FUNCTION:CRMF
+i2d_OSSL_CRMF_ENCRYPTEDKEY              3426	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_ENCRYPTEDKEY_free             3427	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_ENCRYPTEDKEY_new              3428	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_ENCRYPTEDKEY_it               3429	4_0_0	EXIST::FUNCTION:CRMF
+d2i_OSSL_CRMF_MSG                       3430	4_0_0	EXIST::FUNCTION:CRMF
+i2d_OSSL_CRMF_MSG                       3431	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_free                      3432	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_new                       3433	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_it                        3434	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_dup                       3435	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_ATTRIBUTETYPEANDVALUE_free    3436	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_ATTRIBUTETYPEANDVALUE_dup     3437	4_0_0	EXIST::FUNCTION:CRMF
+d2i_OSSL_CRMF_PBMPARAMETER              3438	4_0_0	EXIST::FUNCTION:CRMF
+i2d_OSSL_CRMF_PBMPARAMETER              3439	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_PBMPARAMETER_free             3440	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_PBMPARAMETER_new              3441	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_PBMPARAMETER_it               3442	4_0_0	EXIST::FUNCTION:CRMF
+d2i_OSSL_CRMF_CERTID                    3443	4_0_0	EXIST::FUNCTION:CRMF
+i2d_OSSL_CRMF_CERTID                    3444	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTID_free                   3445	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTID_new                    3446	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTID_it                     3447	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTID_dup                    3448	4_0_0	EXIST::FUNCTION:CRMF
+d2i_OSSL_CRMF_PKIPUBLICATIONINFO        3449	4_0_0	EXIST::FUNCTION:CRMF
+i2d_OSSL_CRMF_PKIPUBLICATIONINFO        3450	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_PKIPUBLICATIONINFO_free       3451	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_PKIPUBLICATIONINFO_new        3452	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_PKIPUBLICATIONINFO_it         3453	4_0_0	EXIST::FUNCTION:CRMF
+d2i_OSSL_CRMF_SINGLEPUBINFO             3454	4_0_0	EXIST::FUNCTION:CRMF
+i2d_OSSL_CRMF_SINGLEPUBINFO             3455	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_SINGLEPUBINFO_free            3456	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_SINGLEPUBINFO_new             3457	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_SINGLEPUBINFO_it              3458	4_0_0	EXIST::FUNCTION:CRMF
+d2i_OSSL_CRMF_CERTTEMPLATE              3459	4_0_0	EXIST::FUNCTION:CRMF
+i2d_OSSL_CRMF_CERTTEMPLATE              3460	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTTEMPLATE_free             3461	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTTEMPLATE_new              3462	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTTEMPLATE_it               3463	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTTEMPLATE_dup              3464	4_0_0	EXIST::FUNCTION:CRMF
+d2i_OSSL_CRMF_MSGS                      3465	4_0_0	EXIST::FUNCTION:CRMF
+i2d_OSSL_CRMF_MSGS                      3466	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSGS_free                     3467	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSGS_new                      3468	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSGS_it                       3469	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_pbmp_new                      3470	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_pbm_new                       3471	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_set1_regCtrl_regToken     3472	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_get0_regCtrl_regToken     3473	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_set1_regCtrl_authenticator 3474	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_get0_regCtrl_authenticator 3475	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_PKIPublicationInfo_push0_SinglePubInfo 3476	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_set0_SinglePubInfo        3477	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_set_PKIPublicationInfo_action 3478	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_set1_regCtrl_pkiPublicationInfo 3479	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_get0_regCtrl_pkiPublicationInfo 3480	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_set1_regCtrl_protocolEncrKey 3481	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_get0_regCtrl_protocolEncrKey 3482	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_set1_regCtrl_oldCertID    3483	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_get0_regCtrl_oldCertID    3484	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTID_gen                    3485	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_set1_regInfo_utf8Pairs    3486	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_get0_regInfo_utf8Pairs    3487	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_set1_regInfo_certReq      3488	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_get0_regInfo_certReq      3489	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_set0_validity             3490	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_set_certReqId             3491	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_get_certReqId             3492	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_set0_extensions           3493	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_push0_extension           3494	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_create_popo               3495	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSGS_verify_popo              3496	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_get0_tmpl                 3497	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTTEMPLATE_get0_publicKey   3498	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTTEMPLATE_get0_subject     3499	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTTEMPLATE_get0_issuer      3500	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTTEMPLATE_get0_serialNumber 3501	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTTEMPLATE_get0_extensions  3502	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTID_get0_issuer            3503	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTID_get0_serialNumber      3504	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_CERTTEMPLATE_fill             3505	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert   3506	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_ENCRYPTEDKEY_get1_encCert     3507	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_ENCRYPTEDVALUE_decrypt        3508	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_ENCRYPTEDKEY_get1_pkey        3509	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_MSG_centralkeygen_requested   3510	4_0_0	EXIST::FUNCTION:CRMF
+OSSL_CRMF_ENCRYPTEDKEY_init_envdata     3511	4_0_0	EXIST::FUNCTION:CMS,CRMF
+CRYPTO_THREAD_lock_new                  3512	4_0_0	EXIST::FUNCTION:
+CRYPTO_THREAD_read_lock                 3513	4_0_0	EXIST::FUNCTION:
+CRYPTO_THREAD_write_lock                3514	4_0_0	EXIST::FUNCTION:
+CRYPTO_THREAD_unlock                    3515	4_0_0	EXIST::FUNCTION:
+CRYPTO_THREAD_lock_free                 3516	4_0_0	EXIST::FUNCTION:
+CRYPTO_atomic_add                       3517	4_0_0	EXIST::FUNCTION:
+CRYPTO_atomic_add64                     3518	4_0_0	EXIST::FUNCTION:
+CRYPTO_atomic_and                       3519	4_0_0	EXIST::FUNCTION:
+CRYPTO_atomic_or                        3520	4_0_0	EXIST::FUNCTION:
+CRYPTO_atomic_load                      3521	4_0_0	EXIST::FUNCTION:
+CRYPTO_atomic_load_int                  3522	4_0_0	EXIST::FUNCTION:
+CRYPTO_atomic_store                     3523	4_0_0	EXIST::FUNCTION:
+CRYPTO_atomic_store_int                 3524	4_0_0	EXIST::FUNCTION:
+OPENSSL_strlcpy                         3525	4_0_0	EXIST::FUNCTION:
+OPENSSL_strlcat                         3526	4_0_0	EXIST::FUNCTION:
+OPENSSL_strnlen                         3527	4_0_0	EXIST::FUNCTION:
+OPENSSL_strtoul                         3528	4_0_0	EXIST::FUNCTION:
+OPENSSL_buf2hexstr_ex                   3529	4_0_0	EXIST::FUNCTION:
+OPENSSL_buf2hexstr                      3530	4_0_0	EXIST::FUNCTION:
+OPENSSL_hexstr2buf_ex                   3531	4_0_0	EXIST::FUNCTION:
+OPENSSL_hexstr2buf                      3532	4_0_0	EXIST::FUNCTION:
+OPENSSL_hexchar2int                     3533	4_0_0	EXIST::FUNCTION:
+OPENSSL_strcasecmp                      3534	4_0_0	EXIST::FUNCTION:
+OPENSSL_strncasecmp                     3535	4_0_0	EXIST::FUNCTION:
+OPENSSL_version_major                   3536	4_0_0	EXIST::FUNCTION:
+OPENSSL_version_minor                   3537	4_0_0	EXIST::FUNCTION:
+OPENSSL_version_patch                   3538	4_0_0	EXIST::FUNCTION:
+OPENSSL_version_pre_release             3539	4_0_0	EXIST::FUNCTION:
+OPENSSL_version_build_metadata          3540	4_0_0	EXIST::FUNCTION:
+OpenSSL_version_num                     3541	4_0_0	EXIST::FUNCTION:
+OpenSSL_version                         3542	4_0_0	EXIST::FUNCTION:
+OPENSSL_info                            3543	4_0_0	EXIST::FUNCTION:
+OPENSSL_issetugid                       3544	4_0_0	EXIST::FUNCTION:
+CRYPTO_get_ex_new_index                 3545	4_0_0	EXIST::FUNCTION:
+CRYPTO_free_ex_index                    3546	4_0_0	EXIST::FUNCTION:
+CRYPTO_new_ex_data                      3547	4_0_0	EXIST::FUNCTION:
+CRYPTO_dup_ex_data                      3548	4_0_0	EXIST::FUNCTION:
+CRYPTO_free_ex_data                     3549	4_0_0	EXIST::FUNCTION:
+CRYPTO_alloc_ex_data                    3550	4_0_0	EXIST::FUNCTION:
+CRYPTO_set_ex_data                      3551	4_0_0	EXIST::FUNCTION:
+CRYPTO_get_ex_data                      3552	4_0_0	EXIST::FUNCTION:
+CRYPTO_set_mem_functions                3553	4_0_0	EXIST::FUNCTION:
+CRYPTO_get_mem_functions                3554	4_0_0	EXIST::FUNCTION:
+CRYPTO_malloc                           3555	4_0_0	EXIST::FUNCTION:
+CRYPTO_zalloc                           3556	4_0_0	EXIST::FUNCTION:
+CRYPTO_malloc_array                     3557	4_0_0	EXIST::FUNCTION:
+CRYPTO_calloc                           3558	4_0_0	EXIST::FUNCTION:
+CRYPTO_aligned_alloc                    3559	4_0_0	EXIST::FUNCTION:
+CRYPTO_aligned_alloc_array              3560	4_0_0	EXIST::FUNCTION:
+CRYPTO_memdup                           3561	4_0_0	EXIST::FUNCTION:
+CRYPTO_strdup                           3562	4_0_0	EXIST::FUNCTION:
+CRYPTO_strndup                          3563	4_0_0	EXIST::FUNCTION:
+CRYPTO_free                             3564	4_0_0	EXIST::FUNCTION:
+CRYPTO_clear_free                       3565	4_0_0	EXIST::FUNCTION:
+CRYPTO_realloc                          3566	4_0_0	EXIST::FUNCTION:
+CRYPTO_clear_realloc                    3567	4_0_0	EXIST::FUNCTION:
+CRYPTO_realloc_array                    3568	4_0_0	EXIST::FUNCTION:
+CRYPTO_clear_realloc_array              3569	4_0_0	EXIST::FUNCTION:
+CRYPTO_secure_malloc_init               3570	4_0_0	EXIST::FUNCTION:
+CRYPTO_secure_malloc_done               3571	4_0_0	EXIST::FUNCTION:
+CRYPTO_secure_malloc                    3572	4_0_0	EXIST::FUNCTION:
+CRYPTO_secure_zalloc                    3573	4_0_0	EXIST::FUNCTION:
+CRYPTO_secure_malloc_array              3574	4_0_0	EXIST::FUNCTION:
+CRYPTO_secure_calloc                    3575	4_0_0	EXIST::FUNCTION:
+CRYPTO_secure_free                      3576	4_0_0	EXIST::FUNCTION:
+CRYPTO_secure_clear_free                3577	4_0_0	EXIST::FUNCTION:
+CRYPTO_secure_allocated                 3578	4_0_0	EXIST::FUNCTION:
+CRYPTO_secure_malloc_initialized        3579	4_0_0	EXIST::FUNCTION:
+CRYPTO_secure_actual_size               3580	4_0_0	EXIST::FUNCTION:
+CRYPTO_secure_used                      3581	4_0_0	EXIST::FUNCTION:
+OPENSSL_cleanse                         3582	4_0_0	EXIST::FUNCTION:
+CRYPTO_get_alloc_counts                 3583	4_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG
+CRYPTO_set_mem_debug                    3584	4_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
+CRYPTO_mem_ctrl                         3585	4_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
+CRYPTO_mem_debug_push                   3586	4_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
+CRYPTO_mem_debug_pop                    3587	4_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
+CRYPTO_mem_debug_malloc                 3588	4_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
+CRYPTO_mem_debug_realloc                3589	4_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
+CRYPTO_mem_debug_free                   3590	4_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
+CRYPTO_mem_leaks_cb                     3591	4_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
+CRYPTO_mem_leaks_fp                     3592	4_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0,STDIO
+CRYPTO_mem_leaks                        3593	4_0_0	EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3_0
+OPENSSL_die                             3594	4_0_0	EXIST::FUNCTION:
+OPENSSL_isservice                       3595	4_0_0	EXIST::FUNCTION:
+OPENSSL_init                            3596	4_0_0	EXIST::FUNCTION:
+OPENSSL_fork_prepare                    3597	4_0_0	EXIST:UNIX:FUNCTION:DEPRECATEDIN_3_0
+OPENSSL_fork_parent                     3598	4_0_0	EXIST:UNIX:FUNCTION:DEPRECATEDIN_3_0
+OPENSSL_fork_child                      3599	4_0_0	EXIST:UNIX:FUNCTION:DEPRECATEDIN_3_0
+OPENSSL_gmtime                          3600	4_0_0	EXIST::FUNCTION:
+OPENSSL_gmtime_adj                      3601	4_0_0	EXIST::FUNCTION:
+OPENSSL_gmtime_diff                     3602	4_0_0	EXIST::FUNCTION:
+CRYPTO_memcmp                           3603	4_0_0	EXIST::FUNCTION:
+OPENSSL_cleanup                         3604	4_0_0	EXIST::FUNCTION:
+OPENSSL_init_crypto                     3605	4_0_0	EXIST::FUNCTION:
+OPENSSL_thread_stop                     3606	4_0_0	EXIST::FUNCTION:
+OPENSSL_thread_stop_ex                  3607	4_0_0	EXIST::FUNCTION:
+OPENSSL_INIT_new                        3608	4_0_0	EXIST::FUNCTION:
+OPENSSL_INIT_set_config_filename        3609	4_0_0	EXIST::FUNCTION:STDIO
+OPENSSL_INIT_set_config_file_flags      3610	4_0_0	EXIST::FUNCTION:STDIO
+OPENSSL_INIT_set_config_appname         3611	4_0_0	EXIST::FUNCTION:STDIO
+OPENSSL_INIT_free                       3612	4_0_0	EXIST::FUNCTION:
+CRYPTO_THREAD_run_once                  3613	4_0_0	EXIST::FUNCTION:
+CRYPTO_THREAD_init_local                3614	4_0_0	EXIST::FUNCTION:
+CRYPTO_THREAD_get_local                 3615	4_0_0	EXIST::FUNCTION:
+CRYPTO_THREAD_set_local                 3616	4_0_0	EXIST::FUNCTION:
+CRYPTO_THREAD_cleanup_local             3617	4_0_0	EXIST::FUNCTION:
+CRYPTO_THREAD_get_current_id            3618	4_0_0	EXIST::FUNCTION:
+CRYPTO_THREAD_compare_id                3619	4_0_0	EXIST::FUNCTION:
+OSSL_LIB_CTX_new                        3620	4_0_0	EXIST::FUNCTION:
+OSSL_LIB_CTX_new_from_dispatch          3621	4_0_0	EXIST::FUNCTION:
+OSSL_LIB_CTX_new_child                  3622	4_0_0	EXIST::FUNCTION:
+OSSL_LIB_CTX_load_config                3623	4_0_0	EXIST::FUNCTION:
+OSSL_LIB_CTX_free                       3624	4_0_0	EXIST::FUNCTION:
+OSSL_LIB_CTX_get0_global_default        3625	4_0_0	EXIST::FUNCTION:
+OSSL_LIB_CTX_set0_default               3626	4_0_0	EXIST::FUNCTION:
+OSSL_LIB_CTX_get_conf_diagnostics       3627	4_0_0	EXIST::FUNCTION:
+OSSL_LIB_CTX_set_conf_diagnostics       3628	4_0_0	EXIST::FUNCTION:
+OSSL_sleep                              3629	4_0_0	EXIST::FUNCTION:
+OSSL_LIB_CTX_get_data                   3630	4_0_0	EXIST::FUNCTION:
+CT_POLICY_EVAL_CTX_new_ex               3631	4_0_0	EXIST::FUNCTION:CT
+CT_POLICY_EVAL_CTX_new                  3632	4_0_0	EXIST::FUNCTION:CT
+CT_POLICY_EVAL_CTX_free                 3633	4_0_0	EXIST::FUNCTION:CT
+CT_POLICY_EVAL_CTX_get0_cert            3634	4_0_0	EXIST::FUNCTION:CT
+CT_POLICY_EVAL_CTX_set1_cert            3635	4_0_0	EXIST::FUNCTION:CT
+CT_POLICY_EVAL_CTX_get0_issuer          3636	4_0_0	EXIST::FUNCTION:CT
+CT_POLICY_EVAL_CTX_set1_issuer          3637	4_0_0	EXIST::FUNCTION:CT
+CT_POLICY_EVAL_CTX_get0_log_store       3638	4_0_0	EXIST::FUNCTION:CT
+CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE 3639	4_0_0	EXIST::FUNCTION:CT
+CT_POLICY_EVAL_CTX_get_time             3640	4_0_0	EXIST::FUNCTION:CT
+CT_POLICY_EVAL_CTX_set_time             3641	4_0_0	EXIST::FUNCTION:CT
+SCT_new                                 3642	4_0_0	EXIST::FUNCTION:CT
+SCT_new_from_base64                     3643	4_0_0	EXIST::FUNCTION:CT
+SCT_free                                3644	4_0_0	EXIST::FUNCTION:CT
+SCT_LIST_free                           3645	4_0_0	EXIST::FUNCTION:CT
+SCT_get_version                         3646	4_0_0	EXIST::FUNCTION:CT
+SCT_set_version                         3647	4_0_0	EXIST::FUNCTION:CT
+SCT_get_log_entry_type                  3648	4_0_0	EXIST::FUNCTION:CT
+SCT_set_log_entry_type                  3649	4_0_0	EXIST::FUNCTION:CT
+SCT_get0_log_id                         3650	4_0_0	EXIST::FUNCTION:CT
+SCT_set0_log_id                         3651	4_0_0	EXIST::FUNCTION:CT
+SCT_set1_log_id                         3652	4_0_0	EXIST::FUNCTION:CT
+SCT_get_timestamp                       3653	4_0_0	EXIST::FUNCTION:CT
+SCT_set_timestamp                       3654	4_0_0	EXIST::FUNCTION:CT
+SCT_get_signature_nid                   3655	4_0_0	EXIST::FUNCTION:CT
+SCT_set_signature_nid                   3656	4_0_0	EXIST::FUNCTION:CT
+SCT_get0_extensions                     3657	4_0_0	EXIST::FUNCTION:CT
+SCT_set0_extensions                     3658	4_0_0	EXIST::FUNCTION:CT
+SCT_set1_extensions                     3659	4_0_0	EXIST::FUNCTION:CT
+SCT_get0_signature                      3660	4_0_0	EXIST::FUNCTION:CT
+SCT_set0_signature                      3661	4_0_0	EXIST::FUNCTION:CT
+SCT_set1_signature                      3662	4_0_0	EXIST::FUNCTION:CT
+SCT_get_source                          3663	4_0_0	EXIST::FUNCTION:CT
+SCT_set_source                          3664	4_0_0	EXIST::FUNCTION:CT
+SCT_validation_status_string            3665	4_0_0	EXIST::FUNCTION:CT
+SCT_print                               3666	4_0_0	EXIST::FUNCTION:CT
+SCT_LIST_print                          3667	4_0_0	EXIST::FUNCTION:CT
+SCT_get_validation_status               3668	4_0_0	EXIST::FUNCTION:CT
+SCT_validate                            3669	4_0_0	EXIST::FUNCTION:CT
+SCT_LIST_validate                       3670	4_0_0	EXIST::FUNCTION:CT
+i2o_SCT_LIST                            3671	4_0_0	EXIST::FUNCTION:CT
+o2i_SCT_LIST                            3672	4_0_0	EXIST::FUNCTION:CT
+i2d_SCT_LIST                            3673	4_0_0	EXIST::FUNCTION:CT
+d2i_SCT_LIST                            3674	4_0_0	EXIST::FUNCTION:CT
+i2o_SCT                                 3675	4_0_0	EXIST::FUNCTION:CT
+o2i_SCT                                 3676	4_0_0	EXIST::FUNCTION:CT
+CTLOG_new_ex                            3677	4_0_0	EXIST::FUNCTION:CT
+CTLOG_new                               3678	4_0_0	EXIST::FUNCTION:CT
+CTLOG_new_from_base64_ex                3679	4_0_0	EXIST::FUNCTION:CT
+CTLOG_new_from_base64                   3680	4_0_0	EXIST::FUNCTION:CT
+CTLOG_free                              3681	4_0_0	EXIST::FUNCTION:CT
+CTLOG_get0_name                         3682	4_0_0	EXIST::FUNCTION:CT
+CTLOG_get0_log_id                       3683	4_0_0	EXIST::FUNCTION:CT
+CTLOG_get0_public_key                   3684	4_0_0	EXIST::FUNCTION:CT
+CTLOG_STORE_new_ex                      3685	4_0_0	EXIST::FUNCTION:CT
+CTLOG_STORE_new                         3686	4_0_0	EXIST::FUNCTION:CT
+CTLOG_STORE_free                        3687	4_0_0	EXIST::FUNCTION:CT
+CTLOG_STORE_get0_log_by_id              3688	4_0_0	EXIST::FUNCTION:CT
+CTLOG_STORE_load_file                   3689	4_0_0	EXIST::FUNCTION:CT
+CTLOG_STORE_load_default_file           3690	4_0_0	EXIST::FUNCTION:CT
+ERR_new                                 3691	4_0_0	EXIST::FUNCTION:
+ERR_set_debug                           3692	4_0_0	EXIST::FUNCTION:
+ERR_set_error                           3693	4_0_0	EXIST::FUNCTION:
+ERR_vset_error                          3694	4_0_0	EXIST::FUNCTION:
+ERR_set_error_data                      3695	4_0_0	EXIST::FUNCTION:
+ERR_get_error                           3696	4_0_0	EXIST::FUNCTION:
+ERR_get_error_all                       3697	4_0_0	EXIST::FUNCTION:
+ERR_get_error_line                      3698	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_get_error_line_data                 3699	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_peek_error                          3700	4_0_0	EXIST::FUNCTION:
+ERR_peek_error_line                     3701	4_0_0	EXIST::FUNCTION:
+ERR_peek_error_func                     3702	4_0_0	EXIST::FUNCTION:
+ERR_peek_error_data                     3703	4_0_0	EXIST::FUNCTION:
+ERR_peek_error_all                      3704	4_0_0	EXIST::FUNCTION:
+ERR_peek_error_line_data                3705	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_peek_last_error                     3706	4_0_0	EXIST::FUNCTION:
+ERR_peek_last_error_line                3707	4_0_0	EXIST::FUNCTION:
+ERR_peek_last_error_func                3708	4_0_0	EXIST::FUNCTION:
+ERR_peek_last_error_data                3709	4_0_0	EXIST::FUNCTION:
+ERR_peek_last_error_all                 3710	4_0_0	EXIST::FUNCTION:
+ERR_peek_last_error_line_data           3711	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_clear_error                         3712	4_0_0	EXIST::FUNCTION:
+ERR_error_string                        3713	4_0_0	EXIST::FUNCTION:
+ERR_error_string_n                      3714	4_0_0	EXIST::FUNCTION:
+ERR_lib_error_string                    3715	4_0_0	EXIST::FUNCTION:
+ERR_func_error_string                   3716	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ERR_reason_error_string                 3717	4_0_0	EXIST::FUNCTION:
+ERR_print_errors_cb                     3718	4_0_0	EXIST::FUNCTION:
+ERR_print_errors_fp                     3719	4_0_0	EXIST::FUNCTION:STDIO
+ERR_print_errors                        3720	4_0_0	EXIST::FUNCTION:
+ERR_add_error_data                      3721	4_0_0	EXIST::FUNCTION:
+ERR_add_error_vdata                     3722	4_0_0	EXIST::FUNCTION:
+ERR_add_error_txt                       3723	4_0_0	EXIST::FUNCTION:
+ERR_add_error_mem_bio                   3724	4_0_0	EXIST::FUNCTION:
+ERR_load_strings                        3725	4_0_0	EXIST::FUNCTION:
+ERR_load_strings_const                  3726	4_0_0	EXIST::FUNCTION:
+ERR_unload_strings                      3727	4_0_0	EXIST::FUNCTION:
+ERR_get_next_error_library              3728	4_0_0	EXIST::FUNCTION:
+ERR_set_mark                            3729	4_0_0	EXIST::FUNCTION:
+ERR_pop_to_mark                         3730	4_0_0	EXIST::FUNCTION:
+ERR_clear_last_mark                     3731	4_0_0	EXIST::FUNCTION:
+ERR_count_to_mark                       3732	4_0_0	EXIST::FUNCTION:
+ERR_pop                                 3733	4_0_0	EXIST::FUNCTION:
+OSSL_ERR_STATE_new                      3734	4_0_0	EXIST::FUNCTION:
+OSSL_ERR_STATE_save                     3735	4_0_0	EXIST::FUNCTION:
+OSSL_ERR_STATE_save_to_mark             3736	4_0_0	EXIST::FUNCTION:
+OSSL_ERR_STATE_restore                  3737	4_0_0	EXIST::FUNCTION:
+OSSL_ERR_STATE_free                     3738	4_0_0	EXIST::FUNCTION:
+ESS_ISSUER_SERIAL_free                  3739	4_0_0	EXIST::FUNCTION:
+ESS_ISSUER_SERIAL_new                   3740	4_0_0	EXIST::FUNCTION:
+d2i_ESS_ISSUER_SERIAL                   3741	4_0_0	EXIST::FUNCTION:
+i2d_ESS_ISSUER_SERIAL                   3742	4_0_0	EXIST::FUNCTION:
+ESS_ISSUER_SERIAL_dup                   3743	4_0_0	EXIST::FUNCTION:
+ESS_CERT_ID_free                        3744	4_0_0	EXIST::FUNCTION:
+ESS_CERT_ID_new                         3745	4_0_0	EXIST::FUNCTION:
+d2i_ESS_CERT_ID                         3746	4_0_0	EXIST::FUNCTION:
+i2d_ESS_CERT_ID                         3747	4_0_0	EXIST::FUNCTION:
+ESS_CERT_ID_dup                         3748	4_0_0	EXIST::FUNCTION:
+d2i_ESS_SIGNING_CERT                    3749	4_0_0	EXIST::FUNCTION:
+i2d_ESS_SIGNING_CERT                    3750	4_0_0	EXIST::FUNCTION:
+ESS_SIGNING_CERT_free                   3751	4_0_0	EXIST::FUNCTION:
+ESS_SIGNING_CERT_new                    3752	4_0_0	EXIST::FUNCTION:
+ESS_SIGNING_CERT_it                     3753	4_0_0	EXIST::FUNCTION:
+ESS_SIGNING_CERT_dup                    3754	4_0_0	EXIST::FUNCTION:
+ESS_CERT_ID_V2_free                     3755	4_0_0	EXIST::FUNCTION:
+ESS_CERT_ID_V2_new                      3756	4_0_0	EXIST::FUNCTION:
+d2i_ESS_CERT_ID_V2                      3757	4_0_0	EXIST::FUNCTION:
+i2d_ESS_CERT_ID_V2                      3758	4_0_0	EXIST::FUNCTION:
+ESS_CERT_ID_V2_dup                      3759	4_0_0	EXIST::FUNCTION:
+d2i_ESS_SIGNING_CERT_V2                 3760	4_0_0	EXIST::FUNCTION:
+i2d_ESS_SIGNING_CERT_V2                 3761	4_0_0	EXIST::FUNCTION:
+ESS_SIGNING_CERT_V2_free                3762	4_0_0	EXIST::FUNCTION:
+ESS_SIGNING_CERT_V2_new                 3763	4_0_0	EXIST::FUNCTION:
+ESS_SIGNING_CERT_V2_it                  3764	4_0_0	EXIST::FUNCTION:
+ESS_SIGNING_CERT_V2_dup                 3765	4_0_0	EXIST::FUNCTION:
+OSSL_ESS_signing_cert_new_init          3766	4_0_0	EXIST::FUNCTION:
+OSSL_ESS_signing_cert_v2_new_init       3767	4_0_0	EXIST::FUNCTION:
+OSSL_ESS_check_signing_certs            3768	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_error                        3769	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_new                          3770	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_set_thunks                   3771	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_free                         3772	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_flush                        3773	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_insert                       3774	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_delete                       3775	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_retrieve                     3776	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_doall                        3777	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_doall_arg                    3778	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_doall_arg_thunk              3779	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_strhash                      3780	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_num_items                    3781	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_get_down_load                3782	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_set_down_load                3783	4_0_0	EXIST::FUNCTION:
+OPENSSL_LH_stats                        3784	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_1,STDIO
+OPENSSL_LH_node_stats                   3785	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_1,STDIO
+OPENSSL_LH_node_usage_stats             3786	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_1,STDIO
+OPENSSL_LH_stats_bio                    3787	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_1
+OPENSSL_LH_node_stats_bio               3788	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_1
+OPENSSL_LH_node_usage_stats_bio         3789	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_1
+OCSP_CERTID_dup                         3790	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_sendreq_new                        3791	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_sendreq_bio                        3792	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_cert_to_id                         3793	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_cert_id_new                        3794	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_request_add0_id                    3795	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_request_add1_nonce                 3796	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_basic_add1_nonce                   3797	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_check_nonce                        3798	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_copy_nonce                         3799	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_request_set1_name                  3800	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_request_add1_cert                  3801	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_request_sign                       3802	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_response_status                    3803	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_response_get1_basic                3804	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_resp_get0_signature                3805	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_resp_get0_tbs_sigalg               3806	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_resp_get0_respdata                 3807	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_resp_get0_signer                   3808	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_resp_count                         3809	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_resp_get0                          3810	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_resp_get0_produced_at              3811	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_resp_get0_certs                    3812	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_resp_get0_id                       3813	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_resp_get1_id                       3814	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_resp_find                          3815	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_single_get0_status                 3816	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_resp_find_status                   3817	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_check_validity                     3818	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_request_verify                     3819	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_id_issuer_cmp                      3820	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_id_cmp                             3821	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_request_onereq_count               3822	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_request_onereq_get0                3823	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_onereq_get0_id                     3824	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_id_get0_info                       3825	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_request_is_signed                  3826	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_response_create                    3827	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_basic_add1_status                  3828	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_basic_add1_cert                    3829	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_basic_sign                         3830	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_basic_sign_ctx                     3831	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPID_set_by_name                 3832	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPID_set_by_key_ex               3833	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPID_set_by_key                  3834	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPID_match_ex                    3835	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPID_match                       3836	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_crlID_new                          3837	4_0_0	EXIST:!VMS:FUNCTION:OCSP
+OCSP_crlID2_new                         3837	4_0_0	EXIST:VMS:FUNCTION:OCSP
+OCSP_accept_responses_new               3838	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_archive_cutoff_new                 3839	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_url_svcloc_new                     3840	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQUEST_get_ext_count              3841	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQUEST_get_ext_by_NID             3842	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQUEST_get_ext_by_OBJ             3843	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQUEST_get_ext_by_critical        3844	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQUEST_get_ext                    3845	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQUEST_delete_ext                 3846	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQUEST_get1_ext_d2i               3847	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQUEST_add1_ext_i2d               3848	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQUEST_add_ext                    3849	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_ONEREQ_get_ext_count               3850	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_ONEREQ_get_ext_by_NID              3851	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_ONEREQ_get_ext_by_OBJ              3852	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_ONEREQ_get_ext_by_critical         3853	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_ONEREQ_get_ext                     3854	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_ONEREQ_delete_ext                  3855	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_ONEREQ_get1_ext_d2i                3856	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_ONEREQ_add1_ext_i2d                3857	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_ONEREQ_add_ext                     3858	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_BASICRESP_get_ext_count            3859	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_BASICRESP_get_ext_by_NID           3860	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_BASICRESP_get_ext_by_OBJ           3861	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_BASICRESP_get_ext_by_critical      3862	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_BASICRESP_get_ext                  3863	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_BASICRESP_delete_ext               3864	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_BASICRESP_get1_ext_d2i             3865	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_BASICRESP_add1_ext_i2d             3866	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_BASICRESP_add_ext                  3867	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SINGLERESP_get_ext_count           3868	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SINGLERESP_get_ext_by_NID          3869	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SINGLERESP_get_ext_by_OBJ          3870	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SINGLERESP_get_ext_by_critical     3871	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SINGLERESP_get_ext                 3872	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SINGLERESP_delete_ext              3873	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SINGLERESP_get1_ext_d2i            3874	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SINGLERESP_add1_ext_i2d            3875	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SINGLERESP_add_ext                 3876	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SINGLERESP_get0_id                 3877	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_SINGLERESP                     3878	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_SINGLERESP                     3879	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SINGLERESP_free                    3880	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SINGLERESP_new                     3881	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SINGLERESP_it                      3882	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_CERTSTATUS                     3883	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_CERTSTATUS                     3884	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_CERTSTATUS_free                    3885	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_CERTSTATUS_new                     3886	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_CERTSTATUS_it                      3887	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_REVOKEDINFO                    3888	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_REVOKEDINFO                    3889	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REVOKEDINFO_free                   3890	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REVOKEDINFO_new                    3891	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REVOKEDINFO_it                     3892	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_BASICRESP                      3893	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_BASICRESP                      3894	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_BASICRESP_free                     3895	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_BASICRESP_new                      3896	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_BASICRESP_it                       3897	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_RESPDATA                       3898	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_RESPDATA                       3899	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPDATA_free                      3900	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPDATA_new                       3901	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPDATA_it                        3902	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_RESPID                         3903	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_RESPID                         3904	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPID_free                        3905	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPID_new                         3906	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPID_it                          3907	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_RESPONSE                       3908	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_RESPONSE                       3909	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPONSE_free                      3910	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPONSE_new                       3911	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPONSE_it                        3912	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_RESPBYTES                      3913	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_RESPBYTES                      3914	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPBYTES_free                     3915	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPBYTES_new                      3916	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPBYTES_it                       3917	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_ONEREQ                         3918	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_ONEREQ                         3919	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_ONEREQ_free                        3920	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_ONEREQ_new                         3921	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_ONEREQ_it                          3922	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_CERTID                         3923	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_CERTID                         3924	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_CERTID_free                        3925	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_CERTID_new                         3926	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_CERTID_it                          3927	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_REQUEST                        3928	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_REQUEST                        3929	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQUEST_free                       3930	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQUEST_new                        3931	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQUEST_it                         3932	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_SIGNATURE                      3933	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_SIGNATURE                      3934	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SIGNATURE_free                     3935	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SIGNATURE_new                      3936	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SIGNATURE_it                       3937	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_REQINFO                        3938	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_REQINFO                        3939	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQINFO_free                       3940	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQINFO_new                        3941	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQINFO_it                         3942	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_CRLID                          3943	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_CRLID                          3944	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_CRLID_free                         3945	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_CRLID_new                          3946	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_CRLID_it                           3947	4_0_0	EXIST::FUNCTION:OCSP
+d2i_OCSP_SERVICELOC                     3948	4_0_0	EXIST::FUNCTION:OCSP
+i2d_OCSP_SERVICELOC                     3949	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SERVICELOC_free                    3950	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SERVICELOC_new                     3951	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_SERVICELOC_it                      3952	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_response_status_str                3953	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_cert_status_str                    3954	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_crl_reason_str                     3955	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_REQUEST_print                      3956	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_RESPONSE_print                     3957	4_0_0	EXIST::FUNCTION:OCSP
+OCSP_basic_verify                       3958	4_0_0	EXIST::FUNCTION:OCSP
+PKCS12_get_attr                         3959	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
+PKCS8_get_attr                          3960	4_0_0	EXIST::FUNCTION:
+PKCS12_mac_present                      3961	4_0_0	EXIST::FUNCTION:
+PKCS12_get0_mac                         3962	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_get0_attr                3963	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_get0_type                3964	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_get_nid                  3965	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_get_bag_nid              3966	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_get0_bag_obj             3967	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_get0_bag_type            3968	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_get1_cert_ex             3969	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_get1_cert                3970	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_get1_crl_ex              3971	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_get1_crl                 3972	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_get0_safes               3973	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_get0_p8inf               3974	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_get0_pkcs8               3975	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_create_cert              3976	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_create_crl               3977	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_create_secret            3978	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_create0_p8inf            3979	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_create0_pkcs8            3980	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_create_pkcs8_encrypt     3981	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_create_pkcs8_encrypt_ex  3982	4_0_0	EXIST::FUNCTION:
+PKCS12_item_pack_safebag                3983	4_0_0	EXIST::FUNCTION:
+PKCS8_decrypt                           3984	4_0_0	EXIST::FUNCTION:
+PKCS8_decrypt_ex                        3985	4_0_0	EXIST::FUNCTION:
+PKCS12_decrypt_skey                     3986	4_0_0	EXIST::FUNCTION:
+PKCS12_decrypt_skey_ex                  3987	4_0_0	EXIST::FUNCTION:
+PKCS8_encrypt                           3988	4_0_0	EXIST::FUNCTION:
+PKCS8_encrypt_ex                        3989	4_0_0	EXIST::FUNCTION:
+PKCS8_set0_pbe                          3990	4_0_0	EXIST::FUNCTION:
+PKCS8_set0_pbe_ex                       3991	4_0_0	EXIST::FUNCTION:
+PKCS12_pack_p7data                      3992	4_0_0	EXIST::FUNCTION:
+PKCS12_unpack_p7data                    3993	4_0_0	EXIST::FUNCTION:
+PKCS12_pack_p7encdata                   3994	4_0_0	EXIST::FUNCTION:
+PKCS12_pack_p7encdata_ex                3995	4_0_0	EXIST::FUNCTION:
+PKCS12_unpack_p7encdata                 3996	4_0_0	EXIST::FUNCTION:
+PKCS12_pack_authsafes                   3997	4_0_0	EXIST::FUNCTION:
+PKCS12_unpack_authsafes                 3998	4_0_0	EXIST::FUNCTION:
+PKCS12_add_localkeyid                   3999	4_0_0	EXIST::FUNCTION:
+PKCS12_add_friendlyname_asc             4000	4_0_0	EXIST::FUNCTION:
+PKCS12_add_friendlyname_utf8            4001	4_0_0	EXIST::FUNCTION:
+PKCS12_add_CSPName_asc                  4002	4_0_0	EXIST::FUNCTION:
+PKCS12_add_friendlyname_uni             4003	4_0_0	EXIST::FUNCTION:
+PKCS12_add1_attr_by_NID                 4004	4_0_0	EXIST::FUNCTION:
+PKCS12_add1_attr_by_txt                 4005	4_0_0	EXIST::FUNCTION:
+PKCS8_add_keyusage                      4006	4_0_0	EXIST::FUNCTION:
+PKCS12_get_attr_gen                     4007	4_0_0	EXIST::FUNCTION:
+PKCS12_get_friendlyname                 4008	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_get0_attrs               4009	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_set0_attrs               4010	4_0_0	EXIST::FUNCTION:
+PKCS12_pbe_crypt                        4011	4_0_0	EXIST::FUNCTION:
+PKCS12_pbe_crypt_ex                     4012	4_0_0	EXIST::FUNCTION:
+PKCS12_item_decrypt_d2i                 4013	4_0_0	EXIST::FUNCTION:
+PKCS12_item_decrypt_d2i_ex              4014	4_0_0	EXIST::FUNCTION:
+PKCS12_item_i2d_encrypt                 4015	4_0_0	EXIST::FUNCTION:
+PKCS12_item_i2d_encrypt_ex              4016	4_0_0	EXIST::FUNCTION:
+PKCS12_init                             4017	4_0_0	EXIST::FUNCTION:
+PKCS12_init_ex                          4018	4_0_0	EXIST::FUNCTION:
+PKCS12_key_gen_asc                      4019	4_0_0	EXIST::FUNCTION:
+PKCS12_key_gen_asc_ex                   4020	4_0_0	EXIST::FUNCTION:
+PKCS12_key_gen_uni                      4021	4_0_0	EXIST::FUNCTION:
+PKCS12_key_gen_uni_ex                   4022	4_0_0	EXIST::FUNCTION:
+PKCS12_key_gen_utf8                     4023	4_0_0	EXIST::FUNCTION:
+PKCS12_key_gen_utf8_ex                  4024	4_0_0	EXIST::FUNCTION:
+PKCS12_PBE_keyivgen                     4025	4_0_0	EXIST::FUNCTION:
+PKCS12_PBE_keyivgen_ex                  4026	4_0_0	EXIST::FUNCTION:
+PKCS12_gen_mac                          4027	4_0_0	EXIST::FUNCTION:
+PKCS12_verify_mac                       4028	4_0_0	EXIST::FUNCTION:
+PKCS12_set_mac                          4029	4_0_0	EXIST::FUNCTION:
+PKCS12_set_pbmac1_pbkdf2                4030	4_0_0	EXIST::FUNCTION:
+PKCS12_setup_mac                        4031	4_0_0	EXIST::FUNCTION:
+OPENSSL_asc2uni                         4032	4_0_0	EXIST::FUNCTION:
+OPENSSL_uni2asc                         4033	4_0_0	EXIST::FUNCTION:
+OPENSSL_utf82uni                        4034	4_0_0	EXIST::FUNCTION:
+OPENSSL_uni2utf8                        4035	4_0_0	EXIST::FUNCTION:
+d2i_PKCS12                              4036	4_0_0	EXIST::FUNCTION:
+i2d_PKCS12                              4037	4_0_0	EXIST::FUNCTION:
+PKCS12_free                             4038	4_0_0	EXIST::FUNCTION:
+PKCS12_new                              4039	4_0_0	EXIST::FUNCTION:
+PKCS12_it                               4040	4_0_0	EXIST::FUNCTION:
+d2i_PKCS12_MAC_DATA                     4041	4_0_0	EXIST::FUNCTION:
+i2d_PKCS12_MAC_DATA                     4042	4_0_0	EXIST::FUNCTION:
+PKCS12_MAC_DATA_free                    4043	4_0_0	EXIST::FUNCTION:
+PKCS12_MAC_DATA_new                     4044	4_0_0	EXIST::FUNCTION:
+PKCS12_MAC_DATA_it                      4045	4_0_0	EXIST::FUNCTION:
+d2i_PKCS12_SAFEBAG                      4046	4_0_0	EXIST::FUNCTION:
+i2d_PKCS12_SAFEBAG                      4047	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_free                     4048	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_new                      4049	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAG_it                       4050	4_0_0	EXIST::FUNCTION:
+d2i_PKCS12_BAGS                         4051	4_0_0	EXIST::FUNCTION:
+i2d_PKCS12_BAGS                         4052	4_0_0	EXIST::FUNCTION:
+PKCS12_BAGS_free                        4053	4_0_0	EXIST::FUNCTION:
+PKCS12_BAGS_new                         4054	4_0_0	EXIST::FUNCTION:
+PKCS12_BAGS_it                          4055	4_0_0	EXIST::FUNCTION:
+PKCS12_SAFEBAGS_it                      4056	4_0_0	EXIST::FUNCTION:
+PKCS12_AUTHSAFES_it                     4057	4_0_0	EXIST::FUNCTION:
+PKCS12_PBE_add                          4058	4_0_0	EXIST::FUNCTION:
+PKCS12_parse                            4059	4_0_0	EXIST::FUNCTION:
+PKCS12_create                           4060	4_0_0	EXIST::FUNCTION:
+PKCS12_create_ex                        4061	4_0_0	EXIST::FUNCTION:
+PKCS12_create_ex2                       4062	4_0_0	EXIST::FUNCTION:
+PKCS12_add_cert                         4063	4_0_0	EXIST::FUNCTION:
+PKCS12_add_key                          4064	4_0_0	EXIST::FUNCTION:
+PKCS12_add_key_ex                       4065	4_0_0	EXIST::FUNCTION:
+PKCS12_add_secret                       4066	4_0_0	EXIST::FUNCTION:
+PKCS12_add_safe                         4067	4_0_0	EXIST::FUNCTION:
+PKCS12_add_safe_ex                      4068	4_0_0	EXIST::FUNCTION:
+PKCS12_add_safes                        4069	4_0_0	EXIST::FUNCTION:
+PKCS12_add_safes_ex                     4070	4_0_0	EXIST::FUNCTION:
+i2d_PKCS12_bio                          4071	4_0_0	EXIST::FUNCTION:
+i2d_PKCS12_fp                           4072	4_0_0	EXIST::FUNCTION:STDIO
+d2i_PKCS12_bio                          4073	4_0_0	EXIST::FUNCTION:
+d2i_PKCS12_fp                           4074	4_0_0	EXIST::FUNCTION:STDIO
+PKCS12_newpass                          4075	4_0_0	EXIST::FUNCTION:
+d2i_PKCS7_ISSUER_AND_SERIAL             4076	4_0_0	EXIST::FUNCTION:
+i2d_PKCS7_ISSUER_AND_SERIAL             4077	4_0_0	EXIST::FUNCTION:
+PKCS7_ISSUER_AND_SERIAL_free            4078	4_0_0	EXIST::FUNCTION:
+PKCS7_ISSUER_AND_SERIAL_new             4079	4_0_0	EXIST::FUNCTION:
+PKCS7_ISSUER_AND_SERIAL_it              4080	4_0_0	EXIST::FUNCTION:
+PKCS7_ISSUER_AND_SERIAL_digest          4081	4_0_0	EXIST::FUNCTION:
+d2i_PKCS7_fp                            4082	4_0_0	EXIST::FUNCTION:STDIO
+i2d_PKCS7_fp                            4083	4_0_0	EXIST::FUNCTION:STDIO
+PKCS7_dup                               4084	4_0_0	EXIST::FUNCTION:
+d2i_PKCS7_bio                           4085	4_0_0	EXIST::FUNCTION:
+i2d_PKCS7_bio                           4086	4_0_0	EXIST::FUNCTION:
+i2d_PKCS7_bio_stream                    4087	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_PKCS7_stream              4088	4_0_0	EXIST::FUNCTION:
+d2i_PKCS7_SIGNER_INFO                   4089	4_0_0	EXIST::FUNCTION:
+i2d_PKCS7_SIGNER_INFO                   4090	4_0_0	EXIST::FUNCTION:
+PKCS7_SIGNER_INFO_free                  4091	4_0_0	EXIST::FUNCTION:
+PKCS7_SIGNER_INFO_new                   4092	4_0_0	EXIST::FUNCTION:
+PKCS7_SIGNER_INFO_it                    4093	4_0_0	EXIST::FUNCTION:
+d2i_PKCS7_RECIP_INFO                    4094	4_0_0	EXIST::FUNCTION:
+i2d_PKCS7_RECIP_INFO                    4095	4_0_0	EXIST::FUNCTION:
+PKCS7_RECIP_INFO_free                   4096	4_0_0	EXIST::FUNCTION:
+PKCS7_RECIP_INFO_new                    4097	4_0_0	EXIST::FUNCTION:
+PKCS7_RECIP_INFO_it                     4098	4_0_0	EXIST::FUNCTION:
+d2i_PKCS7_SIGNED                        4099	4_0_0	EXIST::FUNCTION:
+i2d_PKCS7_SIGNED                        4100	4_0_0	EXIST::FUNCTION:
+PKCS7_SIGNED_free                       4101	4_0_0	EXIST::FUNCTION:
+PKCS7_SIGNED_new                        4102	4_0_0	EXIST::FUNCTION:
+PKCS7_SIGNED_it                         4103	4_0_0	EXIST::FUNCTION:
+d2i_PKCS7_ENC_CONTENT                   4104	4_0_0	EXIST::FUNCTION:
+i2d_PKCS7_ENC_CONTENT                   4105	4_0_0	EXIST::FUNCTION:
+PKCS7_ENC_CONTENT_free                  4106	4_0_0	EXIST::FUNCTION:
+PKCS7_ENC_CONTENT_new                   4107	4_0_0	EXIST::FUNCTION:
+PKCS7_ENC_CONTENT_it                    4108	4_0_0	EXIST::FUNCTION:
+d2i_PKCS7_ENVELOPE                      4109	4_0_0	EXIST::FUNCTION:
+i2d_PKCS7_ENVELOPE                      4110	4_0_0	EXIST::FUNCTION:
+PKCS7_ENVELOPE_free                     4111	4_0_0	EXIST::FUNCTION:
+PKCS7_ENVELOPE_new                      4112	4_0_0	EXIST::FUNCTION:
+PKCS7_ENVELOPE_it                       4113	4_0_0	EXIST::FUNCTION:
+d2i_PKCS7_SIGN_ENVELOPE                 4114	4_0_0	EXIST::FUNCTION:
+i2d_PKCS7_SIGN_ENVELOPE                 4115	4_0_0	EXIST::FUNCTION:
+PKCS7_SIGN_ENVELOPE_free                4116	4_0_0	EXIST::FUNCTION:
+PKCS7_SIGN_ENVELOPE_new                 4117	4_0_0	EXIST::FUNCTION:
+PKCS7_SIGN_ENVELOPE_it                  4118	4_0_0	EXIST::FUNCTION:
+d2i_PKCS7_DIGEST                        4119	4_0_0	EXIST::FUNCTION:
+i2d_PKCS7_DIGEST                        4120	4_0_0	EXIST::FUNCTION:
+PKCS7_DIGEST_free                       4121	4_0_0	EXIST::FUNCTION:
+PKCS7_DIGEST_new                        4122	4_0_0	EXIST::FUNCTION:
+PKCS7_DIGEST_it                         4123	4_0_0	EXIST::FUNCTION:
+d2i_PKCS7_ENCRYPT                       4124	4_0_0	EXIST::FUNCTION:
+i2d_PKCS7_ENCRYPT                       4125	4_0_0	EXIST::FUNCTION:
+PKCS7_ENCRYPT_free                      4126	4_0_0	EXIST::FUNCTION:
+PKCS7_ENCRYPT_new                       4127	4_0_0	EXIST::FUNCTION:
+PKCS7_ENCRYPT_it                        4128	4_0_0	EXIST::FUNCTION:
+d2i_PKCS7                               4129	4_0_0	EXIST::FUNCTION:
+i2d_PKCS7                               4130	4_0_0	EXIST::FUNCTION:
+PKCS7_free                              4131	4_0_0	EXIST::FUNCTION:
+PKCS7_new                               4132	4_0_0	EXIST::FUNCTION:
+PKCS7_it                                4133	4_0_0	EXIST::FUNCTION:
+PKCS7_new_ex                            4134	4_0_0	EXIST::FUNCTION:
+PKCS7_ATTR_SIGN_it                      4135	4_0_0	EXIST::FUNCTION:
+PKCS7_ATTR_VERIFY_it                    4136	4_0_0	EXIST::FUNCTION:
+i2d_PKCS7_NDEF                          4137	4_0_0	EXIST::FUNCTION:
+PKCS7_print_ctx                         4138	4_0_0	EXIST::FUNCTION:
+PKCS7_ctrl                              4139	4_0_0	EXIST::FUNCTION:
+PKCS7_type_is_other                     4140	4_0_0	EXIST::FUNCTION:
+PKCS7_set_type                          4141	4_0_0	EXIST::FUNCTION:
+PKCS7_set0_type_other                   4142	4_0_0	EXIST::FUNCTION:
+PKCS7_set_content                       4143	4_0_0	EXIST::FUNCTION:
+PKCS7_SIGNER_INFO_set                   4144	4_0_0	EXIST::FUNCTION:
+PKCS7_SIGNER_INFO_sign                  4145	4_0_0	EXIST::FUNCTION:
+PKCS7_add_signer                        4146	4_0_0	EXIST::FUNCTION:
+PKCS7_add_certificate                   4147	4_0_0	EXIST::FUNCTION:
+PKCS7_add_crl                           4148	4_0_0	EXIST::FUNCTION:
+PKCS7_content_new                       4149	4_0_0	EXIST::FUNCTION:
+PKCS7_dataVerify                        4150	4_0_0	EXIST::FUNCTION:
+PKCS7_signatureVerify                   4151	4_0_0	EXIST::FUNCTION:
+PKCS7_dataInit                          4152	4_0_0	EXIST::FUNCTION:
+PKCS7_dataFinal                         4153	4_0_0	EXIST::FUNCTION:
+PKCS7_dataDecode                        4154	4_0_0	EXIST::FUNCTION:
+PKCS7_add_signature                     4155	4_0_0	EXIST::FUNCTION:
+PKCS7_cert_from_signer_info             4156	4_0_0	EXIST::FUNCTION:
+PKCS7_set_digest                        4157	4_0_0	EXIST::FUNCTION:
+PKCS7_get_signer_info                   4158	4_0_0	EXIST::FUNCTION:
+PKCS7_add_recipient                     4159	4_0_0	EXIST::FUNCTION:
+PKCS7_SIGNER_INFO_get0_algs             4160	4_0_0	EXIST::FUNCTION:
+PKCS7_RECIP_INFO_get0_alg               4161	4_0_0	EXIST::FUNCTION:
+PKCS7_add_recipient_info                4162	4_0_0	EXIST::FUNCTION:
+PKCS7_RECIP_INFO_set                    4163	4_0_0	EXIST::FUNCTION:
+PKCS7_set_cipher                        4164	4_0_0	EXIST::FUNCTION:
+PKCS7_stream                            4165	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+PKCS7_get_issuer_and_serial             4166	4_0_0	EXIST::FUNCTION:
+PKCS7_get_octet_string                  4167	4_0_0	EXIST::FUNCTION:
+PKCS7_digest_from_attributes            4168	4_0_0	EXIST::FUNCTION:
+PKCS7_add_signed_attribute              4169	4_0_0	EXIST::FUNCTION:
+PKCS7_add_attribute                     4170	4_0_0	EXIST::FUNCTION:
+PKCS7_get_attribute                     4171	4_0_0	EXIST::FUNCTION:
+PKCS7_get_signed_attribute              4172	4_0_0	EXIST::FUNCTION:
+PKCS7_set_signed_attributes             4173	4_0_0	EXIST::FUNCTION:
+PKCS7_set_attributes                    4174	4_0_0	EXIST::FUNCTION:
+PKCS7_sign                              4175	4_0_0	EXIST::FUNCTION:
+PKCS7_sign_ex                           4176	4_0_0	EXIST::FUNCTION:
+PKCS7_sign_add_signer                   4177	4_0_0	EXIST::FUNCTION:
+PKCS7_final                             4178	4_0_0	EXIST::FUNCTION:
+PKCS7_verify                            4179	4_0_0	EXIST::FUNCTION:
+PKCS7_get0_signers                      4180	4_0_0	EXIST::FUNCTION:
+PKCS7_encrypt                           4181	4_0_0	EXIST::FUNCTION:
+PKCS7_encrypt_ex                        4182	4_0_0	EXIST::FUNCTION:
+PKCS7_decrypt                           4183	4_0_0	EXIST::FUNCTION:
+PKCS7_add_attrib_smimecap               4184	4_0_0	EXIST::FUNCTION:
+PKCS7_get_smimecap                      4185	4_0_0	EXIST::FUNCTION:
+PKCS7_simple_smimecap                   4186	4_0_0	EXIST::FUNCTION:
+PKCS7_add_attrib_content_type           4187	4_0_0	EXIST::FUNCTION:
+PKCS7_add0_attrib_signing_time          4188	4_0_0	EXIST::FUNCTION:
+PKCS7_add1_attrib_digest                4189	4_0_0	EXIST::FUNCTION:
+SMIME_write_PKCS7                       4190	4_0_0	EXIST::FUNCTION:
+SMIME_read_PKCS7_ex                     4191	4_0_0	EXIST::FUNCTION:
+SMIME_read_PKCS7                        4192	4_0_0	EXIST::FUNCTION:
+BIO_new_PKCS7                           4193	4_0_0	EXIST::FUNCTION:
+SRP_user_pwd_new                        4194	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_user_pwd_free                       4195	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_user_pwd_set_gN                     4196	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_user_pwd_set1_ids                   4197	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_user_pwd_set0_sv                    4198	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_VBASE_new                           4199	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_VBASE_free                          4200	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_VBASE_init                          4201	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_VBASE_add0_user                     4202	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_VBASE_get1_by_user                  4203	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_create_verifier_ex                  4204	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_create_verifier                     4205	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_create_verifier_BN_ex               4206	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_create_verifier_BN                  4207	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_check_known_gN_param                4208	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_get_default_gN                      4209	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_Calc_server_key                     4210	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_Calc_B_ex                           4211	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_Calc_B                              4212	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_Verify_A_mod_N                      4213	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_Calc_u_ex                           4214	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_Calc_u                              4215	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_Calc_x_ex                           4216	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_Calc_x                              4217	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_Calc_A                              4218	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_Calc_client_key_ex                  4219	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_Calc_client_key                     4220	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_Verify_B_mod_N                      4221	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_VBASE_get_by_user                   4222	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SRP
+UI_new                                  4223	4_0_0	EXIST::FUNCTION:
+UI_new_method                           4224	4_0_0	EXIST::FUNCTION:
+UI_free                                 4225	4_0_0	EXIST::FUNCTION:
+UI_add_input_string                     4226	4_0_0	EXIST::FUNCTION:
+UI_dup_input_string                     4227	4_0_0	EXIST::FUNCTION:
+UI_add_verify_string                    4228	4_0_0	EXIST::FUNCTION:
+UI_dup_verify_string                    4229	4_0_0	EXIST::FUNCTION:
+UI_add_input_boolean                    4230	4_0_0	EXIST::FUNCTION:
+UI_dup_input_boolean                    4231	4_0_0	EXIST::FUNCTION:
+UI_add_info_string                      4232	4_0_0	EXIST::FUNCTION:
+UI_dup_info_string                      4233	4_0_0	EXIST::FUNCTION:
+UI_add_error_string                     4234	4_0_0	EXIST::FUNCTION:
+UI_dup_error_string                     4235	4_0_0	EXIST::FUNCTION:
+UI_construct_prompt                     4236	4_0_0	EXIST::FUNCTION:
+UI_add_user_data                        4237	4_0_0	EXIST::FUNCTION:
+UI_dup_user_data                        4238	4_0_0	EXIST::FUNCTION:
+UI_get0_user_data                       4239	4_0_0	EXIST::FUNCTION:
+UI_get0_result                          4240	4_0_0	EXIST::FUNCTION:
+UI_get_result_length                    4241	4_0_0	EXIST::FUNCTION:
+UI_process                              4242	4_0_0	EXIST::FUNCTION:
+UI_ctrl                                 4243	4_0_0	EXIST::FUNCTION:
+UI_set_ex_data                          4244	4_0_0	EXIST::FUNCTION:
+UI_get_ex_data                          4245	4_0_0	EXIST::FUNCTION:
+UI_set_default_method                   4246	4_0_0	EXIST::FUNCTION:
+UI_get_default_method                   4247	4_0_0	EXIST::FUNCTION:
+UI_get_method                           4248	4_0_0	EXIST::FUNCTION:
+UI_set_method                           4249	4_0_0	EXIST::FUNCTION:
+UI_OpenSSL                              4250	4_0_0	EXIST::FUNCTION:UI_CONSOLE
+UI_null                                 4251	4_0_0	EXIST::FUNCTION:
+UI_create_method                        4252	4_0_0	EXIST::FUNCTION:
+UI_destroy_method                       4253	4_0_0	EXIST::FUNCTION:
+UI_method_set_opener                    4254	4_0_0	EXIST::FUNCTION:
+UI_method_set_writer                    4255	4_0_0	EXIST::FUNCTION:
+UI_method_set_flusher                   4256	4_0_0	EXIST::FUNCTION:
+UI_method_set_reader                    4257	4_0_0	EXIST::FUNCTION:
+UI_method_set_closer                    4258	4_0_0	EXIST::FUNCTION:
+UI_method_set_data_duplicator           4259	4_0_0	EXIST::FUNCTION:
+UI_method_set_prompt_constructor        4260	4_0_0	EXIST::FUNCTION:
+UI_method_set_ex_data                   4261	4_0_0	EXIST::FUNCTION:
+UI_method_get_opener                    4262	4_0_0	EXIST::FUNCTION:
+UI_method_get_writer                    4263	4_0_0	EXIST::FUNCTION:
+UI_method_get_flusher                   4264	4_0_0	EXIST::FUNCTION:
+UI_method_get_reader                    4265	4_0_0	EXIST::FUNCTION:
+UI_method_get_closer                    4266	4_0_0	EXIST::FUNCTION:
+UI_method_get_prompt_constructor        4267	4_0_0	EXIST::FUNCTION:
+UI_method_get_data_duplicator           4268	4_0_0	EXIST::FUNCTION:
+UI_method_get_data_destructor           4269	4_0_0	EXIST::FUNCTION:
+UI_method_get_ex_data                   4270	4_0_0	EXIST::FUNCTION:
+UI_get_string_type                      4271	4_0_0	EXIST::FUNCTION:
+UI_get_input_flags                      4272	4_0_0	EXIST::FUNCTION:
+UI_get0_output_string                   4273	4_0_0	EXIST::FUNCTION:
+UI_get0_action_string                   4274	4_0_0	EXIST::FUNCTION:
+UI_get0_result_string                   4275	4_0_0	EXIST::FUNCTION:
+UI_get_result_string_length             4276	4_0_0	EXIST::FUNCTION:
+UI_get0_test_string                     4277	4_0_0	EXIST::FUNCTION:
+UI_get_result_minsize                   4278	4_0_0	EXIST::FUNCTION:
+UI_get_result_maxsize                   4279	4_0_0	EXIST::FUNCTION:
+UI_set_result                           4280	4_0_0	EXIST::FUNCTION:
+UI_set_result_ex                        4281	4_0_0	EXIST::FUNCTION:
+UI_UTIL_read_pw_string                  4282	4_0_0	EXIST::FUNCTION:
+UI_UTIL_read_pw                         4283	4_0_0	EXIST::FUNCTION:
+UI_UTIL_wrap_read_pem_callback          4284	4_0_0	EXIST::FUNCTION:
+X509_CRL_set_default_method             4285	4_0_0	EXIST::FUNCTION:
+X509_CRL_METHOD_new                     4286	4_0_0	EXIST::FUNCTION:
+X509_CRL_METHOD_free                    4287	4_0_0	EXIST::FUNCTION:
+X509_CRL_set_meth_data                  4288	4_0_0	EXIST::FUNCTION:
+X509_CRL_get_meth_data                  4289	4_0_0	EXIST::FUNCTION:
+X509_verify_cert_error_string           4290	4_0_0	EXIST::FUNCTION:
+X509_verify                             4291	4_0_0	EXIST::FUNCTION:
+X509_self_signed                        4292	4_0_0	EXIST::FUNCTION:
+X509_REQ_verify_ex                      4293	4_0_0	EXIST::FUNCTION:
+X509_REQ_verify                         4294	4_0_0	EXIST::FUNCTION:
+X509_CRL_verify                         4295	4_0_0	EXIST::FUNCTION:
+NETSCAPE_SPKI_verify                    4296	4_0_0	EXIST::FUNCTION:
+NETSCAPE_SPKI_b64_decode                4297	4_0_0	EXIST::FUNCTION:
+NETSCAPE_SPKI_b64_encode                4298	4_0_0	EXIST::FUNCTION:
+NETSCAPE_SPKI_get_pubkey                4299	4_0_0	EXIST::FUNCTION:
+NETSCAPE_SPKI_set_pubkey                4300	4_0_0	EXIST::FUNCTION:
+NETSCAPE_SPKI_print                     4301	4_0_0	EXIST::FUNCTION:
+X509_signature_dump                     4302	4_0_0	EXIST::FUNCTION:
+X509_signature_print                    4303	4_0_0	EXIST::FUNCTION:
+X509_sign                               4304	4_0_0	EXIST::FUNCTION:
+X509_sign_ctx                           4305	4_0_0	EXIST::FUNCTION:
+X509_REQ_sign                           4306	4_0_0	EXIST::FUNCTION:
+X509_REQ_sign_ctx                       4307	4_0_0	EXIST::FUNCTION:
+X509_CRL_sign                           4308	4_0_0	EXIST::FUNCTION:
+X509_CRL_sign_ctx                       4309	4_0_0	EXIST::FUNCTION:
+NETSCAPE_SPKI_sign                      4310	4_0_0	EXIST::FUNCTION:
+X509_pubkey_digest                      4311	4_0_0	EXIST::FUNCTION:
+X509_digest                             4312	4_0_0	EXIST::FUNCTION:
+X509_digest_sig                         4313	4_0_0	EXIST::FUNCTION:
+X509_CRL_digest                         4314	4_0_0	EXIST::FUNCTION:
+X509_REQ_digest                         4315	4_0_0	EXIST::FUNCTION:
+X509_NAME_digest                        4316	4_0_0	EXIST::FUNCTION:
+X509_load_http                          4317	4_0_0	EXIST::FUNCTION:
+X509_CRL_load_http                      4318	4_0_0	EXIST::FUNCTION:
+d2i_X509_fp                             4319	4_0_0	EXIST::FUNCTION:STDIO
+i2d_X509_fp                             4320	4_0_0	EXIST::FUNCTION:STDIO
+d2i_X509_CRL_fp                         4321	4_0_0	EXIST::FUNCTION:STDIO
+i2d_X509_CRL_fp                         4322	4_0_0	EXIST::FUNCTION:STDIO
+d2i_X509_REQ_fp                         4323	4_0_0	EXIST::FUNCTION:STDIO
+i2d_X509_REQ_fp                         4324	4_0_0	EXIST::FUNCTION:STDIO
+d2i_RSAPrivateKey_fp                    4325	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
+i2d_RSAPrivateKey_fp                    4326	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
+d2i_RSAPublicKey_fp                     4327	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
+i2d_RSAPublicKey_fp                     4328	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
+d2i_RSA_PUBKEY_fp                       4329	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
+i2d_RSA_PUBKEY_fp                       4330	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,STDIO
+d2i_DSA_PUBKEY_fp                       4331	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
+i2d_DSA_PUBKEY_fp                       4332	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
+d2i_DSAPrivateKey_fp                    4333	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
+i2d_DSAPrivateKey_fp                    4334	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA,STDIO
+d2i_EC_PUBKEY_fp                        4335	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
+i2d_EC_PUBKEY_fp                        4336	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
+d2i_ECPrivateKey_fp                     4337	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
+i2d_ECPrivateKey_fp                     4338	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC,STDIO
+d2i_PKCS8_fp                            4339	4_0_0	EXIST::FUNCTION:STDIO
+i2d_PKCS8_fp                            4340	4_0_0	EXIST::FUNCTION:STDIO
+d2i_X509_PUBKEY_fp                      4341	4_0_0	EXIST::FUNCTION:STDIO
+i2d_X509_PUBKEY_fp                      4342	4_0_0	EXIST::FUNCTION:STDIO
+d2i_PKCS8_PRIV_KEY_INFO_fp              4343	4_0_0	EXIST::FUNCTION:STDIO
+i2d_PKCS8_PRIV_KEY_INFO_fp              4344	4_0_0	EXIST::FUNCTION:STDIO
+i2d_PKCS8PrivateKeyInfo_fp              4345	4_0_0	EXIST::FUNCTION:STDIO
+i2d_PrivateKey_fp                       4346	4_0_0	EXIST::FUNCTION:STDIO
+d2i_PrivateKey_ex_fp                    4347	4_0_0	EXIST::FUNCTION:STDIO
+d2i_PrivateKey_fp                       4348	4_0_0	EXIST::FUNCTION:STDIO
+i2d_PUBKEY_fp                           4349	4_0_0	EXIST::FUNCTION:STDIO
+d2i_PUBKEY_ex_fp                        4350	4_0_0	EXIST::FUNCTION:STDIO
+d2i_PUBKEY_fp                           4351	4_0_0	EXIST::FUNCTION:STDIO
+d2i_X509_bio                            4352	4_0_0	EXIST::FUNCTION:
+i2d_X509_bio                            4353	4_0_0	EXIST::FUNCTION:
+d2i_X509_CRL_bio                        4354	4_0_0	EXIST::FUNCTION:
+i2d_X509_CRL_bio                        4355	4_0_0	EXIST::FUNCTION:
+d2i_X509_REQ_bio                        4356	4_0_0	EXIST::FUNCTION:
+i2d_X509_REQ_bio                        4357	4_0_0	EXIST::FUNCTION:
+d2i_RSAPrivateKey_bio                   4358	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+i2d_RSAPrivateKey_bio                   4359	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+d2i_RSAPublicKey_bio                    4360	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+i2d_RSAPublicKey_bio                    4361	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+d2i_RSA_PUBKEY_bio                      4362	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+i2d_RSA_PUBKEY_bio                      4363	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+d2i_DSA_PUBKEY_bio                      4364	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+i2d_DSA_PUBKEY_bio                      4365	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+d2i_DSAPrivateKey_bio                   4366	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+i2d_DSAPrivateKey_bio                   4367	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+d2i_EC_PUBKEY_bio                       4368	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+i2d_EC_PUBKEY_bio                       4369	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+d2i_ECPrivateKey_bio                    4370	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+i2d_ECPrivateKey_bio                    4371	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+d2i_PKCS8_bio                           4372	4_0_0	EXIST::FUNCTION:
+i2d_PKCS8_bio                           4373	4_0_0	EXIST::FUNCTION:
+d2i_X509_PUBKEY_bio                     4374	4_0_0	EXIST::FUNCTION:
+i2d_X509_PUBKEY_bio                     4375	4_0_0	EXIST::FUNCTION:
+d2i_PKCS8_PRIV_KEY_INFO_bio             4376	4_0_0	EXIST::FUNCTION:
+i2d_PKCS8_PRIV_KEY_INFO_bio             4377	4_0_0	EXIST::FUNCTION:
+i2d_PKCS8PrivateKeyInfo_bio             4378	4_0_0	EXIST::FUNCTION:
+i2d_PrivateKey_bio                      4379	4_0_0	EXIST::FUNCTION:
+d2i_PrivateKey_ex_bio                   4380	4_0_0	EXIST::FUNCTION:
+d2i_PrivateKey_bio                      4381	4_0_0	EXIST::FUNCTION:
+i2d_PUBKEY_bio                          4382	4_0_0	EXIST::FUNCTION:
+d2i_PUBKEY_ex_bio                       4383	4_0_0	EXIST::FUNCTION:
+d2i_PUBKEY_bio                          4384	4_0_0	EXIST::FUNCTION:
+X509_dup                                4385	4_0_0	EXIST::FUNCTION:
+X509_ALGOR_dup                          4386	4_0_0	EXIST::FUNCTION:
+X509_ATTRIBUTE_dup                      4387	4_0_0	EXIST::FUNCTION:
+X509_CRL_dup                            4388	4_0_0	EXIST::FUNCTION:
+X509_EXTENSION_dup                      4389	4_0_0	EXIST::FUNCTION:
+X509_PUBKEY_dup                         4390	4_0_0	EXIST::FUNCTION:
+X509_REQ_dup                            4391	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_dup                        4392	4_0_0	EXIST::FUNCTION:
+X509_ALGOR_set0                         4393	4_0_0	EXIST::FUNCTION:
+X509_ALGOR_get0                         4394	4_0_0	EXIST::FUNCTION:
+X509_ALGOR_set_md                       4395	4_0_0	EXIST::FUNCTION:
+X509_ALGOR_cmp                          4396	4_0_0	EXIST::FUNCTION:
+X509_ALGOR_copy                         4397	4_0_0	EXIST::FUNCTION:
+X509_NAME_dup                           4398	4_0_0	EXIST::FUNCTION:
+X509_NAME_ENTRY_dup                     4399	4_0_0	EXIST::FUNCTION:
+X509_cmp_time                           4400	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_0
+X509_cmp_current_time                   4401	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_0
+X509_cmp_timeframe                      4402	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_0
+X509_check_certificate_times            4403	4_0_0	EXIST::FUNCTION:
+X509_time_adj                           4404	4_0_0	EXIST::FUNCTION:
+X509_time_adj_ex                        4405	4_0_0	EXIST::FUNCTION:
+X509_gmtime_adj                         4406	4_0_0	EXIST::FUNCTION:
+X509_get_default_cert_area              4407	4_0_0	EXIST::FUNCTION:
+X509_get_default_cert_dir               4408	4_0_0	EXIST::FUNCTION:
+X509_get_default_cert_file              4409	4_0_0	EXIST::FUNCTION:
+X509_get_default_cert_dir_env           4410	4_0_0	EXIST::FUNCTION:
+X509_get_default_cert_file_env          4411	4_0_0	EXIST::FUNCTION:
+X509_get_default_private_dir            4412	4_0_0	EXIST::FUNCTION:
+X509_to_X509_REQ                        4413	4_0_0	EXIST::FUNCTION:
+X509_REQ_to_X509                        4414	4_0_0	EXIST::FUNCTION:
+d2i_X509_ALGOR                          4415	4_0_0	EXIST::FUNCTION:
+i2d_X509_ALGOR                          4416	4_0_0	EXIST::FUNCTION:
+X509_ALGOR_free                         4417	4_0_0	EXIST::FUNCTION:
+X509_ALGOR_new                          4418	4_0_0	EXIST::FUNCTION:
+X509_ALGOR_it                           4419	4_0_0	EXIST::FUNCTION:
+d2i_X509_ALGORS                         4420	4_0_0	EXIST::FUNCTION:
+i2d_X509_ALGORS                         4421	4_0_0	EXIST::FUNCTION:
+X509_ALGORS_it                          4422	4_0_0	EXIST::FUNCTION:
+d2i_X509_VAL                            4423	4_0_0	EXIST::FUNCTION:
+i2d_X509_VAL                            4424	4_0_0	EXIST::FUNCTION:
+X509_VAL_free                           4425	4_0_0	EXIST::FUNCTION:
+X509_VAL_new                            4426	4_0_0	EXIST::FUNCTION:
+X509_VAL_it                             4427	4_0_0	EXIST::FUNCTION:
+d2i_X509_PUBKEY                         4428	4_0_0	EXIST::FUNCTION:
+i2d_X509_PUBKEY                         4429	4_0_0	EXIST::FUNCTION:
+X509_PUBKEY_free                        4430	4_0_0	EXIST::FUNCTION:
+X509_PUBKEY_new                         4431	4_0_0	EXIST::FUNCTION:
+X509_PUBKEY_it                          4432	4_0_0	EXIST::FUNCTION:
+X509_PUBKEY_new_ex                      4433	4_0_0	EXIST::FUNCTION:
+X509_PUBKEY_set                         4434	4_0_0	EXIST::FUNCTION:
+X509_PUBKEY_get0                        4435	4_0_0	EXIST::FUNCTION:
+X509_PUBKEY_get                         4436	4_0_0	EXIST::FUNCTION:
+X509_get_pubkey_parameters              4437	4_0_0	EXIST::FUNCTION:
+X509_get_pathlen                        4438	4_0_0	EXIST::FUNCTION:
+d2i_PUBKEY                              4439	4_0_0	EXIST::FUNCTION:
+i2d_PUBKEY                              4440	4_0_0	EXIST::FUNCTION:
+d2i_PUBKEY_ex                           4441	4_0_0	EXIST::FUNCTION:
+d2i_RSA_PUBKEY                          4442	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+i2d_RSA_PUBKEY                          4443	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+d2i_DSA_PUBKEY                          4444	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+i2d_DSA_PUBKEY                          4445	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA
+d2i_EC_PUBKEY                           4446	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+i2d_EC_PUBKEY                           4447	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
+d2i_X509_SIG                            4448	4_0_0	EXIST::FUNCTION:
+i2d_X509_SIG                            4449	4_0_0	EXIST::FUNCTION:
+X509_SIG_free                           4450	4_0_0	EXIST::FUNCTION:
+X509_SIG_new                            4451	4_0_0	EXIST::FUNCTION:
+X509_SIG_it                             4452	4_0_0	EXIST::FUNCTION:
+X509_SIG_get0                           4453	4_0_0	EXIST::FUNCTION:
+X509_SIG_getm                           4454	4_0_0	EXIST::FUNCTION:
+d2i_X509_REQ_INFO                       4455	4_0_0	EXIST::FUNCTION:
+i2d_X509_REQ_INFO                       4456	4_0_0	EXIST::FUNCTION:
+X509_REQ_INFO_free                      4457	4_0_0	EXIST::FUNCTION:
+X509_REQ_INFO_new                       4458	4_0_0	EXIST::FUNCTION:
+X509_REQ_INFO_it                        4459	4_0_0	EXIST::FUNCTION:
+d2i_X509_REQ                            4460	4_0_0	EXIST::FUNCTION:
+i2d_X509_REQ                            4461	4_0_0	EXIST::FUNCTION:
+X509_REQ_free                           4462	4_0_0	EXIST::FUNCTION:
+X509_REQ_new                            4463	4_0_0	EXIST::FUNCTION:
+X509_REQ_it                             4464	4_0_0	EXIST::FUNCTION:
+X509_REQ_new_ex                         4465	4_0_0	EXIST::FUNCTION:
+d2i_X509_ATTRIBUTE                      4466	4_0_0	EXIST::FUNCTION:
+i2d_X509_ATTRIBUTE                      4467	4_0_0	EXIST::FUNCTION:
+X509_ATTRIBUTE_free                     4468	4_0_0	EXIST::FUNCTION:
+X509_ATTRIBUTE_new                      4469	4_0_0	EXIST::FUNCTION:
+X509_ATTRIBUTE_it                       4470	4_0_0	EXIST::FUNCTION:
+X509_ATTRIBUTE_create                   4471	4_0_0	EXIST::FUNCTION:
+d2i_X509_EXTENSION                      4472	4_0_0	EXIST::FUNCTION:
+i2d_X509_EXTENSION                      4473	4_0_0	EXIST::FUNCTION:
+X509_EXTENSION_free                     4474	4_0_0	EXIST::FUNCTION:
+X509_EXTENSION_new                      4475	4_0_0	EXIST::FUNCTION:
+X509_EXTENSION_it                       4476	4_0_0	EXIST::FUNCTION:
+d2i_X509_EXTENSIONS                     4477	4_0_0	EXIST::FUNCTION:
+i2d_X509_EXTENSIONS                     4478	4_0_0	EXIST::FUNCTION:
+X509_EXTENSIONS_it                      4479	4_0_0	EXIST::FUNCTION:
+d2i_X509_NAME_ENTRY                     4480	4_0_0	EXIST::FUNCTION:
+i2d_X509_NAME_ENTRY                     4481	4_0_0	EXIST::FUNCTION:
+X509_NAME_ENTRY_free                    4482	4_0_0	EXIST::FUNCTION:
+X509_NAME_ENTRY_new                     4483	4_0_0	EXIST::FUNCTION:
+X509_NAME_ENTRY_it                      4484	4_0_0	EXIST::FUNCTION:
+d2i_X509_NAME                           4485	4_0_0	EXIST::FUNCTION:
+i2d_X509_NAME                           4486	4_0_0	EXIST::FUNCTION:
+X509_NAME_free                          4487	4_0_0	EXIST::FUNCTION:
+X509_NAME_new                           4488	4_0_0	EXIST::FUNCTION:
+X509_NAME_it                            4489	4_0_0	EXIST::FUNCTION:
+X509_NAME_set                           4490	4_0_0	EXIST::FUNCTION:
+d2i_X509_CINF                           4491	4_0_0	EXIST::FUNCTION:
+i2d_X509_CINF                           4492	4_0_0	EXIST::FUNCTION:
+X509_CINF_free                          4493	4_0_0	EXIST::FUNCTION:
+X509_CINF_new                           4494	4_0_0	EXIST::FUNCTION:
+X509_CINF_it                            4495	4_0_0	EXIST::FUNCTION:
+d2i_X509                                4496	4_0_0	EXIST::FUNCTION:
+i2d_X509                                4497	4_0_0	EXIST::FUNCTION:
+X509_free                               4498	4_0_0	EXIST::FUNCTION:
+X509_new                                4499	4_0_0	EXIST::FUNCTION:
+X509_it                                 4500	4_0_0	EXIST::FUNCTION:
+X509_new_ex                             4501	4_0_0	EXIST::FUNCTION:
+d2i_X509_CERT_AUX                       4502	4_0_0	EXIST::FUNCTION:
+i2d_X509_CERT_AUX                       4503	4_0_0	EXIST::FUNCTION:
+X509_CERT_AUX_free                      4504	4_0_0	EXIST::FUNCTION:
+X509_CERT_AUX_new                       4505	4_0_0	EXIST::FUNCTION:
+X509_CERT_AUX_it                        4506	4_0_0	EXIST::FUNCTION:
+X509_set_ex_data                        4507	4_0_0	EXIST::FUNCTION:
+X509_get_ex_data                        4508	4_0_0	EXIST::FUNCTION:
+d2i_X509_AUX                            4509	4_0_0	EXIST::FUNCTION:
+i2d_X509_AUX                            4510	4_0_0	EXIST::FUNCTION:
+i2d_re_X509_tbs                         4511	4_0_0	EXIST::FUNCTION:
+X509_SIG_INFO_get                       4512	4_0_0	EXIST::FUNCTION:
+X509_SIG_INFO_set                       4513	4_0_0	EXIST::FUNCTION:
+X509_get_signature_info                 4514	4_0_0	EXIST::FUNCTION:
+X509_get0_signature                     4515	4_0_0	EXIST::FUNCTION:
+X509_get_signature_nid                  4516	4_0_0	EXIST::FUNCTION:
+X509_set0_distinguishing_id             4517	4_0_0	EXIST::FUNCTION:
+X509_get0_distinguishing_id             4518	4_0_0	EXIST::FUNCTION:
+X509_REQ_set0_distinguishing_id         4519	4_0_0	EXIST::FUNCTION:
+X509_REQ_get0_distinguishing_id         4520	4_0_0	EXIST::FUNCTION:
+X509_alias_set1                         4521	4_0_0	EXIST::FUNCTION:
+X509_keyid_set1                         4522	4_0_0	EXIST::FUNCTION:
+X509_alias_get0                         4523	4_0_0	EXIST::FUNCTION:
+X509_keyid_get0                         4524	4_0_0	EXIST::FUNCTION:
+d2i_X509_REVOKED                        4525	4_0_0	EXIST::FUNCTION:
+i2d_X509_REVOKED                        4526	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_free                       4527	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_new                        4528	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_it                         4529	4_0_0	EXIST::FUNCTION:
+d2i_X509_CRL_INFO                       4530	4_0_0	EXIST::FUNCTION:
+i2d_X509_CRL_INFO                       4531	4_0_0	EXIST::FUNCTION:
+X509_CRL_INFO_free                      4532	4_0_0	EXIST::FUNCTION:
+X509_CRL_INFO_new                       4533	4_0_0	EXIST::FUNCTION:
+X509_CRL_INFO_it                        4534	4_0_0	EXIST::FUNCTION:
+d2i_X509_CRL                            4535	4_0_0	EXIST::FUNCTION:
+i2d_X509_CRL                            4536	4_0_0	EXIST::FUNCTION:
+X509_CRL_free                           4537	4_0_0	EXIST::FUNCTION:
+X509_CRL_new                            4538	4_0_0	EXIST::FUNCTION:
+X509_CRL_it                             4539	4_0_0	EXIST::FUNCTION:
+X509_CRL_new_ex                         4540	4_0_0	EXIST::FUNCTION:
+X509_CRL_add0_revoked                   4541	4_0_0	EXIST::FUNCTION:
+X509_CRL_get0_by_serial                 4542	4_0_0	EXIST::FUNCTION:
+X509_CRL_get0_by_cert                   4543	4_0_0	EXIST::FUNCTION:
+X509_PKEY_new                           4544	4_0_0	EXIST::FUNCTION:
+X509_PKEY_free                          4545	4_0_0	EXIST::FUNCTION:
+d2i_NETSCAPE_SPKI                       4546	4_0_0	EXIST::FUNCTION:
+i2d_NETSCAPE_SPKI                       4547	4_0_0	EXIST::FUNCTION:
+NETSCAPE_SPKI_free                      4548	4_0_0	EXIST::FUNCTION:
+NETSCAPE_SPKI_new                       4549	4_0_0	EXIST::FUNCTION:
+NETSCAPE_SPKI_it                        4550	4_0_0	EXIST::FUNCTION:
+d2i_NETSCAPE_SPKAC                      4551	4_0_0	EXIST::FUNCTION:
+i2d_NETSCAPE_SPKAC                      4552	4_0_0	EXIST::FUNCTION:
+NETSCAPE_SPKAC_free                     4553	4_0_0	EXIST::FUNCTION:
+NETSCAPE_SPKAC_new                      4554	4_0_0	EXIST::FUNCTION:
+NETSCAPE_SPKAC_it                       4555	4_0_0	EXIST::FUNCTION:
+d2i_NETSCAPE_CERT_SEQUENCE              4556	4_0_0	EXIST::FUNCTION:
+i2d_NETSCAPE_CERT_SEQUENCE              4557	4_0_0	EXIST::FUNCTION:
+NETSCAPE_CERT_SEQUENCE_free             4558	4_0_0	EXIST::FUNCTION:
+NETSCAPE_CERT_SEQUENCE_new              4559	4_0_0	EXIST::FUNCTION:
+NETSCAPE_CERT_SEQUENCE_it               4560	4_0_0	EXIST::FUNCTION:
+X509_INFO_new                           4561	4_0_0	EXIST::FUNCTION:
+X509_INFO_free                          4562	4_0_0	EXIST::FUNCTION:
+X509_NAME_oneline                       4563	4_0_0	EXIST::FUNCTION:
+ASN1_verify                             4564	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ASN1_digest                             4565	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ASN1_sign                               4566	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+ASN1_item_digest                        4567	4_0_0	EXIST::FUNCTION:
+ASN1_item_verify                        4568	4_0_0	EXIST::FUNCTION:
+ASN1_item_verify_ctx                    4569	4_0_0	EXIST::FUNCTION:
+ASN1_item_sign                          4570	4_0_0	EXIST::FUNCTION:
+ASN1_item_sign_ctx                      4571	4_0_0	EXIST::FUNCTION:
+X509_get_version                        4572	4_0_0	EXIST::FUNCTION:
+X509_set_version                        4573	4_0_0	EXIST::FUNCTION:
+X509_set_serialNumber                   4574	4_0_0	EXIST::FUNCTION:
+X509_get_serialNumber                   4575	4_0_0	EXIST::FUNCTION:
+X509_get0_serialNumber                  4576	4_0_0	EXIST::FUNCTION:
+X509_set_issuer_name                    4577	4_0_0	EXIST::FUNCTION:
+X509_get_issuer_name                    4578	4_0_0	EXIST::FUNCTION:
+X509_set_subject_name                   4579	4_0_0	EXIST::FUNCTION:
+X509_get_subject_name                   4580	4_0_0	EXIST::FUNCTION:
+X509_get0_notBefore                     4581	4_0_0	EXIST::FUNCTION:
+X509_getm_notBefore                     4582	4_0_0	EXIST::FUNCTION:
+X509_set1_notBefore                     4583	4_0_0	EXIST::FUNCTION:
+X509_get0_notAfter                      4584	4_0_0	EXIST::FUNCTION:
+X509_getm_notAfter                      4585	4_0_0	EXIST::FUNCTION:
+X509_set1_notAfter                      4586	4_0_0	EXIST::FUNCTION:
+X509_up_ref                             4587	4_0_0	EXIST::FUNCTION:
+X509_get_signature_type                 4588	4_0_0	EXIST::FUNCTION:
+X509_set_pubkey                         4589	4_0_0	EXIST::FUNCTION:
+X509_get_pubkey                         4590	4_0_0	EXIST::FUNCTION:
+X509_get0_pubkey                        4591	4_0_0	EXIST::FUNCTION:
+X509_get_X509_PUBKEY                    4592	4_0_0	EXIST::FUNCTION:
+X509_get0_extensions                    4593	4_0_0	EXIST::FUNCTION:
+X509_get0_uids                          4594	4_0_0	EXIST::FUNCTION:
+X509_get0_tbs_sigalg                    4595	4_0_0	EXIST::FUNCTION:
+X509_get0_pubkey_bitstr                 4596	4_0_0	EXIST::FUNCTION:
+X509_REQ_get_version                    4597	4_0_0	EXIST::FUNCTION:
+X509_REQ_set_version                    4598	4_0_0	EXIST::FUNCTION:
+X509_REQ_get_subject_name               4599	4_0_0	EXIST::FUNCTION:
+X509_REQ_set_subject_name               4600	4_0_0	EXIST::FUNCTION:
+X509_REQ_get0_signature                 4601	4_0_0	EXIST::FUNCTION:
+X509_REQ_set0_signature                 4602	4_0_0	EXIST::FUNCTION:
+X509_REQ_set1_signature_algo            4603	4_0_0	EXIST::FUNCTION:
+X509_REQ_get_signature_nid              4604	4_0_0	EXIST::FUNCTION:
+i2d_re_X509_REQ_tbs                     4605	4_0_0	EXIST::FUNCTION:
+X509_REQ_set_pubkey                     4606	4_0_0	EXIST::FUNCTION:
+X509_REQ_get_pubkey                     4607	4_0_0	EXIST::FUNCTION:
+X509_REQ_get0_pubkey                    4608	4_0_0	EXIST::FUNCTION:
+X509_REQ_get_X509_PUBKEY                4609	4_0_0	EXIST::FUNCTION:
+X509_REQ_extension_nid                  4610	4_0_0	EXIST::FUNCTION:
+X509_REQ_get_extension_nids             4611	4_0_0	EXIST::FUNCTION:
+X509_REQ_set_extension_nids             4612	4_0_0	EXIST::FUNCTION:
+X509_REQ_get_extensions                 4613	4_0_0	EXIST::FUNCTION:
+X509_REQ_add_extensions_nid             4614	4_0_0	EXIST::FUNCTION:
+X509_REQ_add_extensions                 4615	4_0_0	EXIST::FUNCTION:
+X509_REQ_get_attr_count                 4616	4_0_0	EXIST::FUNCTION:
+X509_REQ_get_attr_by_NID                4617	4_0_0	EXIST::FUNCTION:
+X509_REQ_get_attr_by_OBJ                4618	4_0_0	EXIST::FUNCTION:
+X509_REQ_get_attr                       4619	4_0_0	EXIST::FUNCTION:
+X509_REQ_delete_attr                    4620	4_0_0	EXIST::FUNCTION:
+X509_REQ_add1_attr                      4621	4_0_0	EXIST::FUNCTION:
+X509_REQ_add1_attr_by_OBJ               4622	4_0_0	EXIST::FUNCTION:
+X509_REQ_add1_attr_by_NID               4623	4_0_0	EXIST::FUNCTION:
+X509_REQ_add1_attr_by_txt               4624	4_0_0	EXIST::FUNCTION:
+X509_CRL_set_version                    4625	4_0_0	EXIST::FUNCTION:
+X509_CRL_set_issuer_name                4626	4_0_0	EXIST::FUNCTION:
+X509_CRL_set1_lastUpdate                4627	4_0_0	EXIST::FUNCTION:
+X509_CRL_set1_nextUpdate                4628	4_0_0	EXIST::FUNCTION:
+X509_CRL_sort                           4629	4_0_0	EXIST::FUNCTION:
+X509_CRL_up_ref                         4630	4_0_0	EXIST::FUNCTION:
+X509_CRL_get_version                    4631	4_0_0	EXIST::FUNCTION:
+X509_CRL_get0_lastUpdate                4632	4_0_0	EXIST::FUNCTION:
+X509_CRL_get0_nextUpdate                4633	4_0_0	EXIST::FUNCTION:
+X509_CRL_get_lastUpdate                 4634	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
+X509_CRL_get_nextUpdate                 4635	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
+X509_CRL_get_issuer                     4636	4_0_0	EXIST::FUNCTION:
+X509_CRL_get0_extensions                4637	4_0_0	EXIST::FUNCTION:
+X509_CRL_get_REVOKED                    4638	4_0_0	EXIST::FUNCTION:
+X509_CRL_get0_tbs_sigalg                4639	4_0_0	EXIST::FUNCTION:
+X509_CRL_get0_signature                 4640	4_0_0	EXIST::FUNCTION:
+X509_CRL_get_signature_nid              4641	4_0_0	EXIST::FUNCTION:
+i2d_re_X509_CRL_tbs                     4642	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_get0_serialNumber          4643	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_set_serialNumber           4644	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_get0_revocationDate        4645	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_set_revocationDate         4646	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_get0_extensions            4647	4_0_0	EXIST::FUNCTION:
+X509_CRL_diff                           4648	4_0_0	EXIST::FUNCTION:
+X509_REQ_check_private_key              4649	4_0_0	EXIST::FUNCTION:
+X509_check_private_key                  4650	4_0_0	EXIST::FUNCTION:
+X509_chain_check_suiteb                 4651	4_0_0	EXIST::FUNCTION:
+X509_CRL_check_suiteb                   4652	4_0_0	EXIST::FUNCTION:
+OSSL_STACK_OF_X509_free                 4653	4_0_0	EXIST::FUNCTION:
+X509_chain_up_ref                       4654	4_0_0	EXIST::FUNCTION:
+X509_issuer_and_serial_cmp              4655	4_0_0	EXIST::FUNCTION:
+X509_issuer_and_serial_hash             4656	4_0_0	EXIST::FUNCTION:
+X509_issuer_name_cmp                    4657	4_0_0	EXIST::FUNCTION:
+X509_issuer_name_hash                   4658	4_0_0	EXIST::FUNCTION:
+X509_subject_name_cmp                   4659	4_0_0	EXIST::FUNCTION:
+X509_subject_name_hash                  4660	4_0_0	EXIST::FUNCTION:
+X509_issuer_name_hash_old               4661	4_0_0	EXIST::FUNCTION:MD5
+X509_subject_name_hash_old              4662	4_0_0	EXIST::FUNCTION:MD5
+X509_add_cert                           4663	4_0_0	EXIST::FUNCTION:
+X509_add_certs                          4664	4_0_0	EXIST::FUNCTION:
+X509_cmp                                4665	4_0_0	EXIST::FUNCTION:
+X509_NAME_cmp                           4666	4_0_0	EXIST::FUNCTION:
+X509_certificate_type                   4667	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+X509_NAME_hash_ex                       4668	4_0_0	EXIST::FUNCTION:
+X509_NAME_hash_old                      4669	4_0_0	EXIST::FUNCTION:
+X509_CRL_cmp                            4670	4_0_0	EXIST::FUNCTION:
+X509_CRL_match                          4671	4_0_0	EXIST::FUNCTION:
+X509_aux_print                          4672	4_0_0	EXIST::FUNCTION:
+X509_print_ex_fp                        4673	4_0_0	EXIST::FUNCTION:STDIO
+X509_print_fp                           4674	4_0_0	EXIST::FUNCTION:STDIO
+X509_CRL_print_fp                       4675	4_0_0	EXIST::FUNCTION:STDIO
+X509_REQ_print_fp                       4676	4_0_0	EXIST::FUNCTION:STDIO
+X509_NAME_print_ex_fp                   4677	4_0_0	EXIST::FUNCTION:STDIO
+X509_NAME_print                         4678	4_0_0	EXIST::FUNCTION:
+X509_NAME_print_ex                      4679	4_0_0	EXIST::FUNCTION:
+X509_print_ex                           4680	4_0_0	EXIST::FUNCTION:
+X509_print                              4681	4_0_0	EXIST::FUNCTION:
+X509_ocspid_print                       4682	4_0_0	EXIST::FUNCTION:
+X509_CRL_print_ex                       4683	4_0_0	EXIST::FUNCTION:
+X509_CRL_print                          4684	4_0_0	EXIST::FUNCTION:
+X509_REQ_print_ex                       4685	4_0_0	EXIST::FUNCTION:
+X509_REQ_print                          4686	4_0_0	EXIST::FUNCTION:
+X509_NAME_entry_count                   4687	4_0_0	EXIST::FUNCTION:
+X509_NAME_get_text_by_NID               4688	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_0
+X509_NAME_get_text_by_OBJ               4689	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_0
+X509_NAME_get_index_by_NID              4690	4_0_0	EXIST::FUNCTION:
+X509_NAME_get_index_by_OBJ              4691	4_0_0	EXIST::FUNCTION:
+X509_NAME_get_entry                     4692	4_0_0	EXIST::FUNCTION:
+X509_NAME_delete_entry                  4693	4_0_0	EXIST::FUNCTION:
+X509_NAME_add_entry                     4694	4_0_0	EXIST::FUNCTION:
+X509_NAME_add_entry_by_OBJ              4695	4_0_0	EXIST::FUNCTION:
+X509_NAME_add_entry_by_NID              4696	4_0_0	EXIST::FUNCTION:
+X509_NAME_ENTRY_create_by_txt           4697	4_0_0	EXIST::FUNCTION:
+X509_NAME_ENTRY_create_by_NID           4698	4_0_0	EXIST::FUNCTION:
+X509_NAME_add_entry_by_txt              4699	4_0_0	EXIST::FUNCTION:
+X509_NAME_ENTRY_create_by_OBJ           4700	4_0_0	EXIST::FUNCTION:
+X509_NAME_ENTRY_set_object              4701	4_0_0	EXIST::FUNCTION:
+X509_NAME_ENTRY_set_data                4702	4_0_0	EXIST::FUNCTION:
+X509_NAME_ENTRY_get_object              4703	4_0_0	EXIST::FUNCTION:
+X509_NAME_ENTRY_get_data                4704	4_0_0	EXIST::FUNCTION:
+X509_NAME_ENTRY_set                     4705	4_0_0	EXIST::FUNCTION:
+X509_NAME_get0_der                      4706	4_0_0	EXIST::FUNCTION:
+X509v3_get_ext_count                    4707	4_0_0	EXIST::FUNCTION:
+X509v3_get_ext_by_NID                   4708	4_0_0	EXIST::FUNCTION:
+X509v3_get_ext_by_OBJ                   4709	4_0_0	EXIST::FUNCTION:
+X509v3_get_ext_by_critical              4710	4_0_0	EXIST::FUNCTION:
+X509v3_get_ext                          4711	4_0_0	EXIST::FUNCTION:
+X509v3_delete_ext                       4712	4_0_0	EXIST::FUNCTION:
+X509v3_add_ext                          4713	4_0_0	EXIST::FUNCTION:
+X509v3_add_extensions                   4714	4_0_0	EXIST::FUNCTION:
+X509_get_ext_count                      4715	4_0_0	EXIST::FUNCTION:
+X509_get_ext_by_NID                     4716	4_0_0	EXIST::FUNCTION:
+X509_get_ext_by_OBJ                     4717	4_0_0	EXIST::FUNCTION:
+X509_get_ext_by_critical                4718	4_0_0	EXIST::FUNCTION:
+X509_get_ext                            4719	4_0_0	EXIST::FUNCTION:
+X509_delete_ext                         4720	4_0_0	EXIST::FUNCTION:
+X509_add_ext                            4721	4_0_0	EXIST::FUNCTION:
+X509_get_ext_d2i                        4722	4_0_0	EXIST::FUNCTION:
+X509_add1_ext_i2d                       4723	4_0_0	EXIST::FUNCTION:
+X509_CRL_get_ext_count                  4724	4_0_0	EXIST::FUNCTION:
+X509_CRL_get_ext_by_NID                 4725	4_0_0	EXIST::FUNCTION:
+X509_CRL_get_ext_by_OBJ                 4726	4_0_0	EXIST::FUNCTION:
+X509_CRL_get_ext_by_critical            4727	4_0_0	EXIST::FUNCTION:
+X509_CRL_get_ext                        4728	4_0_0	EXIST::FUNCTION:
+X509_CRL_delete_ext                     4729	4_0_0	EXIST::FUNCTION:
+X509_CRL_add_ext                        4730	4_0_0	EXIST::FUNCTION:
+X509_CRL_get_ext_d2i                    4731	4_0_0	EXIST::FUNCTION:
+X509_CRL_add1_ext_i2d                   4732	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_get_ext_count              4733	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_get_ext_by_NID             4734	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_get_ext_by_OBJ             4735	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_get_ext_by_critical        4736	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_get_ext                    4737	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_delete_ext                 4738	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_add_ext                    4739	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_get_ext_d2i                4740	4_0_0	EXIST::FUNCTION:
+X509_REVOKED_add1_ext_i2d               4741	4_0_0	EXIST::FUNCTION:
+X509_EXTENSION_create_by_NID            4742	4_0_0	EXIST::FUNCTION:
+X509_EXTENSION_create_by_OBJ            4743	4_0_0	EXIST::FUNCTION:
+X509_EXTENSION_set_object               4744	4_0_0	EXIST::FUNCTION:
+X509_EXTENSION_set_critical             4745	4_0_0	EXIST::FUNCTION:
+X509_EXTENSION_set_data                 4746	4_0_0	EXIST::FUNCTION:
+X509_EXTENSION_get_object               4747	4_0_0	EXIST::FUNCTION:
+X509_EXTENSION_get_data                 4748	4_0_0	EXIST::FUNCTION:
+X509_EXTENSION_get_critical             4749	4_0_0	EXIST::FUNCTION:
+X509at_get_attr_count                   4750	4_0_0	EXIST::FUNCTION:
+X509at_get_attr_by_NID                  4751	4_0_0	EXIST::FUNCTION:
+X509at_get_attr_by_OBJ                  4752	4_0_0	EXIST::FUNCTION:
+X509at_get_attr                         4753	4_0_0	EXIST::FUNCTION:
+X509at_delete_attr                      4754	4_0_0	EXIST::FUNCTION:
+X509at_add1_attr                        4755	4_0_0	EXIST::FUNCTION:
+X509at_add1_attr_by_OBJ                 4756	4_0_0	EXIST::FUNCTION:
+X509at_add1_attr_by_NID                 4757	4_0_0	EXIST::FUNCTION:
+X509at_add1_attr_by_txt                 4758	4_0_0	EXIST::FUNCTION:
+X509at_get0_data_by_OBJ                 4759	4_0_0	EXIST::FUNCTION:
+X509_ATTRIBUTE_create_by_NID            4760	4_0_0	EXIST::FUNCTION:
+X509_ATTRIBUTE_create_by_OBJ            4761	4_0_0	EXIST::FUNCTION:
+X509_ATTRIBUTE_create_by_txt            4762	4_0_0	EXIST::FUNCTION:
+X509_ATTRIBUTE_set1_object              4763	4_0_0	EXIST::FUNCTION:
+X509_ATTRIBUTE_set1_data                4764	4_0_0	EXIST::FUNCTION:
+X509_ATTRIBUTE_get0_data                4765	4_0_0	EXIST::FUNCTION:
+X509_ATTRIBUTE_count                    4766	4_0_0	EXIST::FUNCTION:
+X509_ATTRIBUTE_get0_object              4767	4_0_0	EXIST::FUNCTION:
+X509_ATTRIBUTE_get0_type                4768	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_attr_count                 4769	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_attr_by_NID                4770	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_attr_by_OBJ                4771	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_get_attr                       4772	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_delete_attr                    4773	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_add1_attr                      4774	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_add1_attr_by_OBJ               4775	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_add1_attr_by_NID               4776	4_0_0	EXIST::FUNCTION:
+EVP_PKEY_add1_attr_by_txt               4777	4_0_0	EXIST::FUNCTION:
+X509_find_by_issuer_and_serial          4778	4_0_0	EXIST::FUNCTION:
+X509_find_by_subject                    4779	4_0_0	EXIST::FUNCTION:
+d2i_PBEPARAM                            4780	4_0_0	EXIST::FUNCTION:
+i2d_PBEPARAM                            4781	4_0_0	EXIST::FUNCTION:
+PBEPARAM_free                           4782	4_0_0	EXIST::FUNCTION:
+PBEPARAM_new                            4783	4_0_0	EXIST::FUNCTION:
+PBEPARAM_it                             4784	4_0_0	EXIST::FUNCTION:
+d2i_PBE2PARAM                           4785	4_0_0	EXIST::FUNCTION:
+i2d_PBE2PARAM                           4786	4_0_0	EXIST::FUNCTION:
+PBE2PARAM_free                          4787	4_0_0	EXIST::FUNCTION:
+PBE2PARAM_new                           4788	4_0_0	EXIST::FUNCTION:
+PBE2PARAM_it                            4789	4_0_0	EXIST::FUNCTION:
+d2i_PBKDF2PARAM                         4790	4_0_0	EXIST::FUNCTION:
+i2d_PBKDF2PARAM                         4791	4_0_0	EXIST::FUNCTION:
+PBKDF2PARAM_free                        4792	4_0_0	EXIST::FUNCTION:
+PBKDF2PARAM_new                         4793	4_0_0	EXIST::FUNCTION:
+PBKDF2PARAM_it                          4794	4_0_0	EXIST::FUNCTION:
+d2i_PBMAC1PARAM                         4795	4_0_0	EXIST::FUNCTION:
+i2d_PBMAC1PARAM                         4796	4_0_0	EXIST::FUNCTION:
+PBMAC1PARAM_free                        4797	4_0_0	EXIST::FUNCTION:
+PBMAC1PARAM_new                         4798	4_0_0	EXIST::FUNCTION:
+PBMAC1PARAM_it                          4799	4_0_0	EXIST::FUNCTION:
+d2i_SCRYPT_PARAMS                       4800	4_0_0	EXIST::FUNCTION:SCRYPT
+i2d_SCRYPT_PARAMS                       4801	4_0_0	EXIST::FUNCTION:SCRYPT
+SCRYPT_PARAMS_free                      4802	4_0_0	EXIST::FUNCTION:SCRYPT
+SCRYPT_PARAMS_new                       4803	4_0_0	EXIST::FUNCTION:SCRYPT
+SCRYPT_PARAMS_it                        4804	4_0_0	EXIST::FUNCTION:SCRYPT
+PKCS5_pbe_set0_algor                    4805	4_0_0	EXIST::FUNCTION:
+PKCS5_pbe_set0_algor_ex                 4806	4_0_0	EXIST::FUNCTION:
+PKCS5_pbe_set                           4807	4_0_0	EXIST::FUNCTION:
+PKCS5_pbe_set_ex                        4808	4_0_0	EXIST::FUNCTION:
+PKCS5_pbe2_set                          4809	4_0_0	EXIST::FUNCTION:
+PKCS5_pbe2_set_iv                       4810	4_0_0	EXIST::FUNCTION:
+PKCS5_pbe2_set_iv_ex                    4811	4_0_0	EXIST::FUNCTION:
+PKCS5_pbe2_set_scrypt                   4812	4_0_0	EXIST::FUNCTION:SCRYPT
+PKCS5_pbkdf2_set                        4813	4_0_0	EXIST::FUNCTION:
+PKCS5_pbkdf2_set_ex                     4814	4_0_0	EXIST::FUNCTION:
+PBMAC1_get1_pbkdf2_param                4815	4_0_0	EXIST::FUNCTION:
+d2i_PKCS8_PRIV_KEY_INFO                 4816	4_0_0	EXIST::FUNCTION:
+i2d_PKCS8_PRIV_KEY_INFO                 4817	4_0_0	EXIST::FUNCTION:
+PKCS8_PRIV_KEY_INFO_free                4818	4_0_0	EXIST::FUNCTION:
+PKCS8_PRIV_KEY_INFO_new                 4819	4_0_0	EXIST::FUNCTION:
+PKCS8_PRIV_KEY_INFO_it                  4820	4_0_0	EXIST::FUNCTION:
+EVP_PKCS82PKEY                          4821	4_0_0	EXIST::FUNCTION:
+EVP_PKCS82PKEY_ex                       4822	4_0_0	EXIST::FUNCTION:
+EVP_PKEY2PKCS8                          4823	4_0_0	EXIST::FUNCTION:
+PKCS8_pkey_set0                         4824	4_0_0	EXIST::FUNCTION:
+PKCS8_pkey_get0                         4825	4_0_0	EXIST::FUNCTION:
+PKCS8_pkey_get0_attrs                   4826	4_0_0	EXIST::FUNCTION:
+PKCS8_pkey_add1_attr                    4827	4_0_0	EXIST::FUNCTION:
+PKCS8_pkey_add1_attr_by_NID             4828	4_0_0	EXIST::FUNCTION:
+PKCS8_pkey_add1_attr_by_OBJ             4829	4_0_0	EXIST::FUNCTION:
+X509_PUBKEY_set0_public_key             4830	4_0_0	EXIST::FUNCTION:
+X509_PUBKEY_set0_param                  4831	4_0_0	EXIST::FUNCTION:
+X509_PUBKEY_get0_param                  4832	4_0_0	EXIST::FUNCTION:
+X509_PUBKEY_eq                          4833	4_0_0	EXIST::FUNCTION:
+d2i_X509_ACERT                          4834	4_0_0	EXIST::FUNCTION:
+i2d_X509_ACERT                          4835	4_0_0	EXIST::FUNCTION:
+X509_ACERT_free                         4836	4_0_0	EXIST::FUNCTION:
+X509_ACERT_new                          4837	4_0_0	EXIST::FUNCTION:
+X509_ACERT_it                           4838	4_0_0	EXIST::FUNCTION:
+X509_ACERT_dup                          4839	4_0_0	EXIST::FUNCTION:
+X509_ACERT_INFO_it                      4840	4_0_0	EXIST::FUNCTION:
+X509_ACERT_INFO_free                    4841	4_0_0	EXIST::FUNCTION:
+X509_ACERT_INFO_new                     4842	4_0_0	EXIST::FUNCTION:
+OSSL_OBJECT_DIGEST_INFO_free            4843	4_0_0	EXIST::FUNCTION:
+OSSL_OBJECT_DIGEST_INFO_new             4844	4_0_0	EXIST::FUNCTION:
+OSSL_ISSUER_SERIAL_free                 4845	4_0_0	EXIST::FUNCTION:
+OSSL_ISSUER_SERIAL_new                  4846	4_0_0	EXIST::FUNCTION:
+X509_ACERT_ISSUER_V2FORM_free           4847	4_0_0	EXIST::FUNCTION:
+X509_ACERT_ISSUER_V2FORM_new            4848	4_0_0	EXIST::FUNCTION:
+d2i_X509_ACERT_fp                       4849	4_0_0	EXIST::FUNCTION:STDIO
+i2d_X509_ACERT_fp                       4850	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_X509_ACERT                     4851	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_X509_ACERT                    4852	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_bio_X509_ACERT                 4853	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_X509_ACERT                4854	4_0_0	EXIST::FUNCTION:
+d2i_X509_ACERT_bio                      4855	4_0_0	EXIST::FUNCTION:
+i2d_X509_ACERT_bio                      4856	4_0_0	EXIST::FUNCTION:
+X509_ACERT_sign                         4857	4_0_0	EXIST::FUNCTION:
+X509_ACERT_sign_ctx                     4858	4_0_0	EXIST::FUNCTION:
+X509_ACERT_verify                       4859	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get0_holder_entityName       4860	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get0_holder_baseCertId       4861	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get0_holder_digest           4862	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get0_issuerName              4863	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get_version                  4864	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get0_signature               4865	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get_signature_nid            4866	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get0_info_sigalg             4867	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get0_serialNumber            4868	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get0_notBefore               4869	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get0_notAfter                4870	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get0_issuerUID               4871	4_0_0	EXIST::FUNCTION:
+X509_ACERT_print                        4872	4_0_0	EXIST::FUNCTION:
+X509_ACERT_print_ex                     4873	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get_attr_count               4874	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get_attr_by_NID              4875	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get_attr_by_OBJ              4876	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get_attr                     4877	4_0_0	EXIST::FUNCTION:
+X509_ACERT_delete_attr                  4878	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get_ext_d2i                  4879	4_0_0	EXIST::FUNCTION:
+X509_ACERT_add1_ext_i2d                 4880	4_0_0	EXIST::FUNCTION:
+X509_ACERT_get0_extensions              4881	4_0_0	EXIST::FUNCTION:
+X509_ACERT_set_version                  4882	4_0_0	EXIST::FUNCTION:
+X509_ACERT_set0_holder_entityName       4883	4_0_0	EXIST::FUNCTION:
+X509_ACERT_set0_holder_baseCertId       4884	4_0_0	EXIST::FUNCTION:
+X509_ACERT_set0_holder_digest           4885	4_0_0	EXIST::FUNCTION:
+X509_ACERT_add1_attr                    4886	4_0_0	EXIST::FUNCTION:
+X509_ACERT_add1_attr_by_OBJ             4887	4_0_0	EXIST::FUNCTION:
+X509_ACERT_add1_attr_by_NID             4888	4_0_0	EXIST::FUNCTION:
+X509_ACERT_add1_attr_by_txt             4889	4_0_0	EXIST::FUNCTION:
+X509_ACERT_add_attr_nconf               4890	4_0_0	EXIST::FUNCTION:
+X509_ACERT_set1_issuerName              4891	4_0_0	EXIST::FUNCTION:
+X509_ACERT_set1_serialNumber            4892	4_0_0	EXIST::FUNCTION:
+X509_ACERT_set1_notBefore               4893	4_0_0	EXIST::FUNCTION:
+X509_ACERT_set1_notAfter                4894	4_0_0	EXIST::FUNCTION:
+OSSL_OBJECT_DIGEST_INFO_get0_digest     4895	4_0_0	EXIST::FUNCTION:
+OSSL_OBJECT_DIGEST_INFO_set1_digest     4896	4_0_0	EXIST::FUNCTION:
+OSSL_ISSUER_SERIAL_get0_issuer          4897	4_0_0	EXIST::FUNCTION:
+OSSL_ISSUER_SERIAL_get0_serial          4898	4_0_0	EXIST::FUNCTION:
+OSSL_ISSUER_SERIAL_get0_issuerUID       4899	4_0_0	EXIST::FUNCTION:
+OSSL_ISSUER_SERIAL_set1_issuer          4900	4_0_0	EXIST::FUNCTION:
+OSSL_ISSUER_SERIAL_set1_serial          4901	4_0_0	EXIST::FUNCTION:
+OSSL_ISSUER_SERIAL_set1_issuerUID       4902	4_0_0	EXIST::FUNCTION:
+OSSL_IETF_ATTR_SYNTAX_VALUE_it          4903	4_0_0	EXIST::FUNCTION:
+OSSL_IETF_ATTR_SYNTAX_VALUE_free        4904	4_0_0	EXIST::FUNCTION:
+OSSL_IETF_ATTR_SYNTAX_VALUE_new         4905	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_IETF_ATTR_SYNTAX               4906	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_IETF_ATTR_SYNTAX               4907	4_0_0	EXIST::FUNCTION:
+OSSL_IETF_ATTR_SYNTAX_free              4908	4_0_0	EXIST::FUNCTION:
+OSSL_IETF_ATTR_SYNTAX_new               4909	4_0_0	EXIST::FUNCTION:
+OSSL_IETF_ATTR_SYNTAX_it                4910	4_0_0	EXIST::FUNCTION:
+OSSL_IETF_ATTR_SYNTAX_get0_policyAuthority 4911	4_0_0	EXIST::FUNCTION:
+OSSL_IETF_ATTR_SYNTAX_set0_policyAuthority 4912	4_0_0	EXIST::FUNCTION:
+OSSL_IETF_ATTR_SYNTAX_get_value_num     4913	4_0_0	EXIST::FUNCTION:
+OSSL_IETF_ATTR_SYNTAX_get0_value        4914	4_0_0	EXIST::FUNCTION:
+OSSL_IETF_ATTR_SYNTAX_add1_value        4915	4_0_0	EXIST::FUNCTION:
+OSSL_IETF_ATTR_SYNTAX_print             4916	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_TARGET                         4917	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_TARGET                         4918	4_0_0	EXIST::FUNCTION:
+OSSL_TARGET_free                        4919	4_0_0	EXIST::FUNCTION:
+OSSL_TARGET_new                         4920	4_0_0	EXIST::FUNCTION:
+OSSL_TARGET_it                          4921	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_TARGETS                        4922	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_TARGETS                        4923	4_0_0	EXIST::FUNCTION:
+OSSL_TARGETS_free                       4924	4_0_0	EXIST::FUNCTION:
+OSSL_TARGETS_new                        4925	4_0_0	EXIST::FUNCTION:
+OSSL_TARGETS_it                         4926	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_TARGETING_INFORMATION          4927	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_TARGETING_INFORMATION          4928	4_0_0	EXIST::FUNCTION:
+OSSL_TARGETING_INFORMATION_free         4929	4_0_0	EXIST::FUNCTION:
+OSSL_TARGETING_INFORMATION_new          4930	4_0_0	EXIST::FUNCTION:
+OSSL_TARGETING_INFORMATION_it           4931	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX  4932	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX  4933	4_0_0	EXIST::FUNCTION:
+OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX_free 4934	4_0_0	EXIST::FUNCTION:
+OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX_new  4935	4_0_0	EXIST::FUNCTION:
+OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX_it   4936	4_0_0	EXIST::FUNCTION:
+X509_TRUST_set                          4937	4_0_0	EXIST::FUNCTION:
+X509_TRUST_get_count                    4938	4_0_0	EXIST::FUNCTION:
+X509_TRUST_get0                         4939	4_0_0	EXIST::FUNCTION:
+X509_TRUST_get_by_id                    4940	4_0_0	EXIST::FUNCTION:
+X509_TRUST_add                          4941	4_0_0	EXIST::FUNCTION:
+X509_TRUST_cleanup                      4942	4_0_0	EXIST::FUNCTION:
+X509_TRUST_get_flags                    4943	4_0_0	EXIST::FUNCTION:
+X509_TRUST_get0_name                    4944	4_0_0	EXIST::FUNCTION:
+X509_TRUST_get_trust                    4945	4_0_0	EXIST::FUNCTION:
+X509_trusted                            4946	4_0_0	EXIST::FUNCTION:
+X509_add1_trust_object                  4947	4_0_0	EXIST::FUNCTION:
+X509_add1_reject_object                 4948	4_0_0	EXIST::FUNCTION:
+X509_trust_clear                        4949	4_0_0	EXIST::FUNCTION:
+X509_reject_clear                       4950	4_0_0	EXIST::FUNCTION:
+X509_get0_trust_objects                 4951	4_0_0	EXIST::FUNCTION:
+X509_get0_reject_objects                4952	4_0_0	EXIST::FUNCTION:
+X509_TRUST_set_default                  4953	4_0_0	EXIST::FUNCTION:
+X509_check_trust                        4954	4_0_0	EXIST::FUNCTION:
+X509_verify_cert                        4955	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_verify                   4956	4_0_0	EXIST::FUNCTION:
+X509_build_chain                        4957	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_depth                    4958	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_print_verify_cb          4959	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_depth                4960	4_0_0	EXIST::FUNCTION:
+X509_OBJECT_idx_by_subject              4961	4_0_0	EXIST::FUNCTION:
+X509_OBJECT_retrieve_by_subject         4962	4_0_0	EXIST::FUNCTION:
+X509_OBJECT_retrieve_match              4963	4_0_0	EXIST::FUNCTION:
+X509_OBJECT_up_ref_count                4964	4_0_0	EXIST::FUNCTION:
+X509_OBJECT_new                         4965	4_0_0	EXIST::FUNCTION:
+X509_OBJECT_free                        4966	4_0_0	EXIST::FUNCTION:
+X509_OBJECT_get_type                    4967	4_0_0	EXIST::FUNCTION:
+X509_OBJECT_get0_X509                   4968	4_0_0	EXIST::FUNCTION:
+X509_OBJECT_set1_X509                   4969	4_0_0	EXIST::FUNCTION:
+X509_OBJECT_get0_X509_CRL               4970	4_0_0	EXIST::FUNCTION:
+X509_OBJECT_set1_X509_CRL               4971	4_0_0	EXIST::FUNCTION:
+X509_STORE_new                          4972	4_0_0	EXIST::FUNCTION:
+X509_STORE_free                         4973	4_0_0	EXIST::FUNCTION:
+X509_STORE_lock                         4974	4_0_0	EXIST::FUNCTION:
+X509_STORE_unlock                       4975	4_0_0	EXIST::FUNCTION:
+X509_STORE_up_ref                       4976	4_0_0	EXIST::FUNCTION:
+X509_STORE_get0_objects                 4977	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_0
+X509_STORE_get1_objects                 4978	4_0_0	EXIST::FUNCTION:
+X509_STORE_get1_all_certs               4979	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get1_certs               4980	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get1_crls                4981	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_flags                    4982	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_purpose                  4983	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_trust                    4984	4_0_0	EXIST::FUNCTION:
+X509_STORE_set1_param                   4985	4_0_0	EXIST::FUNCTION:
+X509_STORE_get0_param                   4986	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_verify                   4987	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_verify               4988	4_0_0	EXIST::FUNCTION:
+X509_STORE_get_verify                   4989	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_verify_cb                4990	4_0_0	EXIST::FUNCTION:
+X509_STORE_get_verify_cb                4991	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_get_issuer               4992	4_0_0	EXIST::FUNCTION:
+X509_STORE_get_get_issuer               4993	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_check_issued             4994	4_0_0	EXIST::FUNCTION:
+X509_STORE_get_check_issued             4995	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_check_revocation         4996	4_0_0	EXIST::FUNCTION:
+X509_STORE_get_check_revocation         4997	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_get_crl                  4998	4_0_0	EXIST::FUNCTION:
+X509_STORE_get_get_crl                  4999	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_check_crl                5000	4_0_0	EXIST::FUNCTION:
+X509_STORE_get_check_crl                5001	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_cert_crl                 5002	4_0_0	EXIST::FUNCTION:
+X509_STORE_get_cert_crl                 5003	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_check_policy             5004	4_0_0	EXIST::FUNCTION:
+X509_STORE_get_check_policy             5005	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_lookup_certs             5006	4_0_0	EXIST::FUNCTION:
+X509_STORE_get_lookup_certs             5007	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_lookup_crls              5008	4_0_0	EXIST::FUNCTION:
+X509_STORE_get_lookup_crls              5009	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_cleanup                  5010	4_0_0	EXIST::FUNCTION:
+X509_STORE_get_cleanup                  5011	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_ex_data                  5012	4_0_0	EXIST::FUNCTION:
+X509_STORE_get_ex_data                  5013	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_new_ex                   5014	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_new                      5015	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get1_issuer              5016	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_free                     5017	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_init                     5018	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_init_rpk                 5019	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set0_trusted_stack       5020	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_cleanup                  5021	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get0_store               5022	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get0_cert                5023	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get0_rpk                 5024	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get0_untrusted           5025	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set0_untrusted           5026	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_verify_cb            5027	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_verify_cb            5028	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_verify               5029	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_get_issuer           5030	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_check_issued         5031	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_check_revocation     5032	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_get_crl              5033	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_get_crl              5034	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_check_crl            5035	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_cert_crl             5036	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_check_policy         5037	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_lookup_certs         5038	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_lookup_crls          5039	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_cleanup              5040	4_0_0	EXIST::FUNCTION:
+X509_STORE_add_lookup                   5041	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_hash_dir                    5042	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_file                        5043	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_store                       5044	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_new                    5045	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_free                   5046	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_set_new_item           5047	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_get_new_item           5048	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_set_free               5049	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_get_free               5050	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_set_init               5051	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_get_init               5052	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_set_shutdown           5053	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_get_shutdown           5054	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_set_ctrl               5055	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_get_ctrl               5056	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_set_get_by_subject     5057	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_get_get_by_subject     5058	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_set_get_by_issuer_serial 5059	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_get_get_by_issuer_serial 5060	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_set_get_by_fingerprint 5061	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_get_get_by_fingerprint 5062	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_set_get_by_alias       5063	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_meth_get_get_by_alias       5064	4_0_0	EXIST::FUNCTION:
+X509_STORE_add_cert                     5065	4_0_0	EXIST::FUNCTION:
+X509_STORE_add_crl                      5066	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_by_subject           5067	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_obj_by_subject       5068	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_ctrl                        5069	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_ctrl_ex                     5070	4_0_0	EXIST::FUNCTION:
+X509_load_cert_file                     5071	4_0_0	EXIST::FUNCTION:
+X509_load_cert_file_ex                  5072	4_0_0	EXIST::FUNCTION:
+X509_load_crl_file                      5073	4_0_0	EXIST::FUNCTION:
+X509_load_cert_crl_file                 5074	4_0_0	EXIST::FUNCTION:
+X509_load_cert_crl_file_ex              5075	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_new                         5076	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_free                        5077	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_init                        5078	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_by_subject                  5079	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_by_subject_ex               5080	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_by_issuer_serial            5081	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_by_fingerprint              5082	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_by_alias                    5083	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_set_method_data             5084	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_get_method_data             5085	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_get_store                   5086	4_0_0	EXIST::FUNCTION:
+X509_LOOKUP_shutdown                    5087	4_0_0	EXIST::FUNCTION:
+X509_STORE_load_file                    5088	4_0_0	EXIST::FUNCTION:
+X509_STORE_load_path                    5089	4_0_0	EXIST::FUNCTION:
+X509_STORE_load_store                   5090	4_0_0	EXIST::FUNCTION:
+X509_STORE_load_locations               5091	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_default_paths            5092	4_0_0	EXIST::FUNCTION:
+X509_STORE_load_file_ex                 5093	4_0_0	EXIST::FUNCTION:
+X509_STORE_load_store_ex                5094	4_0_0	EXIST::FUNCTION:
+X509_STORE_load_locations_ex            5095	4_0_0	EXIST::FUNCTION:
+X509_STORE_set_default_paths_ex         5096	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_ex_data              5097	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_ex_data              5098	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_error                5099	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_error                5100	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_error_depth          5101	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_error_depth          5102	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_current_cert         5103	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_current_cert         5104	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get0_current_issuer      5105	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get0_current_crl         5106	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get0_parent_ctx          5107	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get0_chain               5108	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get1_chain               5109	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_cert                 5110	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set0_rpk                 5111	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set0_verified_chain      5112	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set0_crls                5113	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_ocsp_resp            5114	4_0_0	EXIST::FUNCTION:OCSP
+X509_STORE_CTX_set_purpose              5115	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_trust                5116	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_purpose_inherit          5117	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_flags                5118	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_time                 5119	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_current_reasons      5120	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get0_policy_tree         5121	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_explicit_policy      5122	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get_num_untrusted        5123	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_get0_param               5124	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set0_param               5125	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set_default              5126	4_0_0	EXIST::FUNCTION:
+X509_STORE_CTX_set0_dane                5127	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_new                   5128	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_free                  5129	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_inherit               5130	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1                  5131	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_name             5132	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set_flags             5133	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_clear_flags           5134	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_get_flags             5135	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set_purpose           5136	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_get_purpose           5137	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set_trust             5138	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set_depth             5139	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set_auth_level        5140	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_get_time              5141	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set_time              5142	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_add0_policy           5143	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_policies         5144	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set_inh_flags         5145	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_get_inh_flags         5146	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_get0_host             5147	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_host             5148	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_add1_host             5149	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_host_input_validation 5150	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set_hostflags         5151	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_get_hostflags         5152	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_get0_peername         5153	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_move_peername         5154	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_get0_email            5155	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_email            5156	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_rfc822           5157	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_add1_rfc822           5158	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_rfc822_input_validation 5159	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_smtputf8         5160	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_add1_smtputf8         5161	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_smtputf8_input_validation 5162	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_get1_ip_asc           5163	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_ip               5164	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_ip_asc           5165	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_add1_ip               5166	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_add1_ip_asc           5167	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_ip_input_validation 5168	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_get_depth             5169	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_get_auth_level        5170	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_get0_name             5171	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_add0_table            5172	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_get_count             5173	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_get0                  5174	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_lookup                5175	4_0_0	EXIST::FUNCTION:
+X509_VERIFY_PARAM_table_cleanup         5176	4_0_0	EXIST::FUNCTION:
+X509_policy_check                       5177	4_0_0	EXIST::FUNCTION:
+X509_policy_tree_free                   5178	4_0_0	EXIST::FUNCTION:
+X509_policy_tree_level_count            5179	4_0_0	EXIST::FUNCTION:
+X509_policy_tree_get0_level             5180	4_0_0	EXIST::FUNCTION:
+X509_policy_tree_get0_policies          5181	4_0_0	EXIST::FUNCTION:
+X509_policy_tree_get0_user_policies     5182	4_0_0	EXIST::FUNCTION:
+X509_policy_level_node_count            5183	4_0_0	EXIST::FUNCTION:
+X509_policy_level_get0_node             5184	4_0_0	EXIST::FUNCTION:
+X509_policy_node_get0_policy            5185	4_0_0	EXIST::FUNCTION:
+X509_policy_node_get0_qualifiers        5186	4_0_0	EXIST::FUNCTION:
+X509_policy_node_get0_parent            5187	4_0_0	EXIST::FUNCTION:
+GENERAL_NAME_set1_X509_NAME             5188	4_0_0	EXIST::FUNCTION:
+DIST_POINT_NAME_dup                     5189	4_0_0	EXIST::FUNCTION:
+d2i_PROXY_POLICY                        5190	4_0_0	EXIST::FUNCTION:
+i2d_PROXY_POLICY                        5191	4_0_0	EXIST::FUNCTION:
+PROXY_POLICY_free                       5192	4_0_0	EXIST::FUNCTION:
+PROXY_POLICY_new                        5193	4_0_0	EXIST::FUNCTION:
+PROXY_POLICY_it                         5194	4_0_0	EXIST::FUNCTION:
+d2i_PROXY_CERT_INFO_EXTENSION           5195	4_0_0	EXIST::FUNCTION:
+i2d_PROXY_CERT_INFO_EXTENSION           5196	4_0_0	EXIST::FUNCTION:
+PROXY_CERT_INFO_EXTENSION_free          5197	4_0_0	EXIST::FUNCTION:
+PROXY_CERT_INFO_EXTENSION_new           5198	4_0_0	EXIST::FUNCTION:
+PROXY_CERT_INFO_EXTENSION_it            5199	4_0_0	EXIST::FUNCTION:
+d2i_BASIC_CONSTRAINTS                   5200	4_0_0	EXIST::FUNCTION:
+i2d_BASIC_CONSTRAINTS                   5201	4_0_0	EXIST::FUNCTION:
+BASIC_CONSTRAINTS_free                  5202	4_0_0	EXIST::FUNCTION:
+BASIC_CONSTRAINTS_new                   5203	4_0_0	EXIST::FUNCTION:
+BASIC_CONSTRAINTS_it                    5204	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_BASIC_ATTR_CONSTRAINTS         5205	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_BASIC_ATTR_CONSTRAINTS         5206	4_0_0	EXIST::FUNCTION:
+OSSL_BASIC_ATTR_CONSTRAINTS_free        5207	4_0_0	EXIST::FUNCTION:
+OSSL_BASIC_ATTR_CONSTRAINTS_new         5208	4_0_0	EXIST::FUNCTION:
+OSSL_BASIC_ATTR_CONSTRAINTS_it          5209	4_0_0	EXIST::FUNCTION:
+d2i_SXNET                               5210	4_0_0	EXIST::FUNCTION:
+i2d_SXNET                               5211	4_0_0	EXIST::FUNCTION:
+SXNET_free                              5212	4_0_0	EXIST::FUNCTION:
+SXNET_new                               5213	4_0_0	EXIST::FUNCTION:
+SXNET_it                                5214	4_0_0	EXIST::FUNCTION:
+d2i_SXNETID                             5215	4_0_0	EXIST::FUNCTION:
+i2d_SXNETID                             5216	4_0_0	EXIST::FUNCTION:
+SXNETID_free                            5217	4_0_0	EXIST::FUNCTION:
+SXNETID_new                             5218	4_0_0	EXIST::FUNCTION:
+SXNETID_it                              5219	4_0_0	EXIST::FUNCTION:
+d2i_ISSUER_SIGN_TOOL                    5220	4_0_0	EXIST::FUNCTION:
+i2d_ISSUER_SIGN_TOOL                    5221	4_0_0	EXIST::FUNCTION:
+ISSUER_SIGN_TOOL_free                   5222	4_0_0	EXIST::FUNCTION:
+ISSUER_SIGN_TOOL_new                    5223	4_0_0	EXIST::FUNCTION:
+ISSUER_SIGN_TOOL_it                     5224	4_0_0	EXIST::FUNCTION:
+SXNET_add_id_asc                        5225	4_0_0	EXIST::FUNCTION:
+SXNET_add_id_ulong                      5226	4_0_0	EXIST::FUNCTION:
+SXNET_add_id_INTEGER                    5227	4_0_0	EXIST::FUNCTION:
+SXNET_get_id_asc                        5228	4_0_0	EXIST::FUNCTION:
+SXNET_get_id_ulong                      5229	4_0_0	EXIST::FUNCTION:
+SXNET_get_id_INTEGER                    5230	4_0_0	EXIST::FUNCTION:
+d2i_AUTHORITY_KEYID                     5231	4_0_0	EXIST::FUNCTION:
+i2d_AUTHORITY_KEYID                     5232	4_0_0	EXIST::FUNCTION:
+AUTHORITY_KEYID_free                    5233	4_0_0	EXIST::FUNCTION:
+AUTHORITY_KEYID_new                     5234	4_0_0	EXIST::FUNCTION:
+AUTHORITY_KEYID_it                      5235	4_0_0	EXIST::FUNCTION:
+d2i_PKEY_USAGE_PERIOD                   5236	4_0_0	EXIST::FUNCTION:
+i2d_PKEY_USAGE_PERIOD                   5237	4_0_0	EXIST::FUNCTION:
+PKEY_USAGE_PERIOD_free                  5238	4_0_0	EXIST::FUNCTION:
+PKEY_USAGE_PERIOD_new                   5239	4_0_0	EXIST::FUNCTION:
+PKEY_USAGE_PERIOD_it                    5240	4_0_0	EXIST::FUNCTION:
+d2i_GENERAL_NAME                        5241	4_0_0	EXIST::FUNCTION:
+i2d_GENERAL_NAME                        5242	4_0_0	EXIST::FUNCTION:
+GENERAL_NAME_free                       5243	4_0_0	EXIST::FUNCTION:
+GENERAL_NAME_new                        5244	4_0_0	EXIST::FUNCTION:
+GENERAL_NAME_it                         5245	4_0_0	EXIST::FUNCTION:
+GENERAL_NAME_dup                        5246	4_0_0	EXIST::FUNCTION:
+GENERAL_NAME_cmp                        5247	4_0_0	EXIST::FUNCTION:
+v2i_ASN1_BIT_STRING                     5248	4_0_0	EXIST::FUNCTION:
+i2v_ASN1_BIT_STRING                     5249	4_0_0	EXIST::FUNCTION:
+i2s_ASN1_IA5STRING                      5250	4_0_0	EXIST::FUNCTION:
+s2i_ASN1_IA5STRING                      5251	4_0_0	EXIST::FUNCTION:
+i2s_ASN1_UTF8STRING                     5252	4_0_0	EXIST::FUNCTION:
+s2i_ASN1_UTF8STRING                     5253	4_0_0	EXIST::FUNCTION:
+i2v_GENERAL_NAME                        5254	4_0_0	EXIST::FUNCTION:
+GENERAL_NAME_print                      5255	4_0_0	EXIST::FUNCTION:
+d2i_GENERAL_NAMES                       5256	4_0_0	EXIST::FUNCTION:
+i2d_GENERAL_NAMES                       5257	4_0_0	EXIST::FUNCTION:
+GENERAL_NAMES_free                      5258	4_0_0	EXIST::FUNCTION:
+GENERAL_NAMES_new                       5259	4_0_0	EXIST::FUNCTION:
+GENERAL_NAMES_it                        5260	4_0_0	EXIST::FUNCTION:
+i2v_GENERAL_NAMES                       5261	4_0_0	EXIST::FUNCTION:
+v2i_GENERAL_NAMES                       5262	4_0_0	EXIST::FUNCTION:
+d2i_OTHERNAME                           5263	4_0_0	EXIST::FUNCTION:
+i2d_OTHERNAME                           5264	4_0_0	EXIST::FUNCTION:
+OTHERNAME_free                          5265	4_0_0	EXIST::FUNCTION:
+OTHERNAME_new                           5266	4_0_0	EXIST::FUNCTION:
+OTHERNAME_it                            5267	4_0_0	EXIST::FUNCTION:
+d2i_EDIPARTYNAME                        5268	4_0_0	EXIST::FUNCTION:
+i2d_EDIPARTYNAME                        5269	4_0_0	EXIST::FUNCTION:
+EDIPARTYNAME_free                       5270	4_0_0	EXIST::FUNCTION:
+EDIPARTYNAME_new                        5271	4_0_0	EXIST::FUNCTION:
+EDIPARTYNAME_it                         5272	4_0_0	EXIST::FUNCTION:
+OTHERNAME_cmp                           5273	4_0_0	EXIST::FUNCTION:
+GENERAL_NAME_set0_value                 5274	4_0_0	EXIST::FUNCTION:
+GENERAL_NAME_get0_value                 5275	4_0_0	EXIST::FUNCTION:
+GENERAL_NAME_set0_othername             5276	4_0_0	EXIST::FUNCTION:
+GENERAL_NAME_get0_otherName             5277	4_0_0	EXIST::FUNCTION:
+i2s_ASN1_OCTET_STRING                   5278	4_0_0	EXIST::FUNCTION:
+s2i_ASN1_OCTET_STRING                   5279	4_0_0	EXIST::FUNCTION:
+d2i_EXTENDED_KEY_USAGE                  5280	4_0_0	EXIST::FUNCTION:
+i2d_EXTENDED_KEY_USAGE                  5281	4_0_0	EXIST::FUNCTION:
+EXTENDED_KEY_USAGE_free                 5282	4_0_0	EXIST::FUNCTION:
+EXTENDED_KEY_USAGE_new                  5283	4_0_0	EXIST::FUNCTION:
+EXTENDED_KEY_USAGE_it                   5284	4_0_0	EXIST::FUNCTION:
+i2a_ACCESS_DESCRIPTION                  5285	4_0_0	EXIST::FUNCTION:
+TLS_FEATURE_free                        5286	4_0_0	EXIST::FUNCTION:
+TLS_FEATURE_new                         5287	4_0_0	EXIST::FUNCTION:
+d2i_CERTIFICATEPOLICIES                 5288	4_0_0	EXIST::FUNCTION:
+i2d_CERTIFICATEPOLICIES                 5289	4_0_0	EXIST::FUNCTION:
+CERTIFICATEPOLICIES_free                5290	4_0_0	EXIST::FUNCTION:
+CERTIFICATEPOLICIES_new                 5291	4_0_0	EXIST::FUNCTION:
+CERTIFICATEPOLICIES_it                  5292	4_0_0	EXIST::FUNCTION:
+d2i_POLICYINFO                          5293	4_0_0	EXIST::FUNCTION:
+i2d_POLICYINFO                          5294	4_0_0	EXIST::FUNCTION:
+POLICYINFO_free                         5295	4_0_0	EXIST::FUNCTION:
+POLICYINFO_new                          5296	4_0_0	EXIST::FUNCTION:
+POLICYINFO_it                           5297	4_0_0	EXIST::FUNCTION:
+d2i_POLICYQUALINFO                      5298	4_0_0	EXIST::FUNCTION:
+i2d_POLICYQUALINFO                      5299	4_0_0	EXIST::FUNCTION:
+POLICYQUALINFO_free                     5300	4_0_0	EXIST::FUNCTION:
+POLICYQUALINFO_new                      5301	4_0_0	EXIST::FUNCTION:
+POLICYQUALINFO_it                       5302	4_0_0	EXIST::FUNCTION:
+d2i_USERNOTICE                          5303	4_0_0	EXIST::FUNCTION:
+i2d_USERNOTICE                          5304	4_0_0	EXIST::FUNCTION:
+USERNOTICE_free                         5305	4_0_0	EXIST::FUNCTION:
+USERNOTICE_new                          5306	4_0_0	EXIST::FUNCTION:
+USERNOTICE_it                           5307	4_0_0	EXIST::FUNCTION:
+d2i_NOTICEREF                           5308	4_0_0	EXIST::FUNCTION:
+i2d_NOTICEREF                           5309	4_0_0	EXIST::FUNCTION:
+NOTICEREF_free                          5310	4_0_0	EXIST::FUNCTION:
+NOTICEREF_new                           5311	4_0_0	EXIST::FUNCTION:
+NOTICEREF_it                            5312	4_0_0	EXIST::FUNCTION:
+d2i_CRL_DIST_POINTS                     5313	4_0_0	EXIST::FUNCTION:
+i2d_CRL_DIST_POINTS                     5314	4_0_0	EXIST::FUNCTION:
+CRL_DIST_POINTS_free                    5315	4_0_0	EXIST::FUNCTION:
+CRL_DIST_POINTS_new                     5316	4_0_0	EXIST::FUNCTION:
+CRL_DIST_POINTS_it                      5317	4_0_0	EXIST::FUNCTION:
+d2i_DIST_POINT                          5318	4_0_0	EXIST::FUNCTION:
+i2d_DIST_POINT                          5319	4_0_0	EXIST::FUNCTION:
+DIST_POINT_free                         5320	4_0_0	EXIST::FUNCTION:
+DIST_POINT_new                          5321	4_0_0	EXIST::FUNCTION:
+DIST_POINT_it                           5322	4_0_0	EXIST::FUNCTION:
+d2i_DIST_POINT_NAME                     5323	4_0_0	EXIST::FUNCTION:
+i2d_DIST_POINT_NAME                     5324	4_0_0	EXIST::FUNCTION:
+DIST_POINT_NAME_free                    5325	4_0_0	EXIST::FUNCTION:
+DIST_POINT_NAME_new                     5326	4_0_0	EXIST::FUNCTION:
+DIST_POINT_NAME_it                      5327	4_0_0	EXIST::FUNCTION:
+d2i_ISSUING_DIST_POINT                  5328	4_0_0	EXIST::FUNCTION:
+i2d_ISSUING_DIST_POINT                  5329	4_0_0	EXIST::FUNCTION:
+ISSUING_DIST_POINT_free                 5330	4_0_0	EXIST::FUNCTION:
+ISSUING_DIST_POINT_new                  5331	4_0_0	EXIST::FUNCTION:
+ISSUING_DIST_POINT_it                   5332	4_0_0	EXIST::FUNCTION:
+DIST_POINT_set_dpname                   5333	4_0_0	EXIST::FUNCTION:
+NAME_CONSTRAINTS_check                  5334	4_0_0	EXIST::FUNCTION:
+NAME_CONSTRAINTS_check_CN               5335	4_0_0	EXIST::FUNCTION:
+d2i_ACCESS_DESCRIPTION                  5336	4_0_0	EXIST::FUNCTION:
+i2d_ACCESS_DESCRIPTION                  5337	4_0_0	EXIST::FUNCTION:
+ACCESS_DESCRIPTION_free                 5338	4_0_0	EXIST::FUNCTION:
+ACCESS_DESCRIPTION_new                  5339	4_0_0	EXIST::FUNCTION:
+ACCESS_DESCRIPTION_it                   5340	4_0_0	EXIST::FUNCTION:
+d2i_AUTHORITY_INFO_ACCESS               5341	4_0_0	EXIST::FUNCTION:
+i2d_AUTHORITY_INFO_ACCESS               5342	4_0_0	EXIST::FUNCTION:
+AUTHORITY_INFO_ACCESS_free              5343	4_0_0	EXIST::FUNCTION:
+AUTHORITY_INFO_ACCESS_new               5344	4_0_0	EXIST::FUNCTION:
+AUTHORITY_INFO_ACCESS_it                5345	4_0_0	EXIST::FUNCTION:
+POLICY_MAPPING_it                       5346	4_0_0	EXIST::FUNCTION:
+POLICY_MAPPING_free                     5347	4_0_0	EXIST::FUNCTION:
+POLICY_MAPPING_new                      5348	4_0_0	EXIST::FUNCTION:
+POLICY_MAPPINGS_it                      5349	4_0_0	EXIST::FUNCTION:
+GENERAL_SUBTREE_it                      5350	4_0_0	EXIST::FUNCTION:
+GENERAL_SUBTREE_free                    5351	4_0_0	EXIST::FUNCTION:
+GENERAL_SUBTREE_new                     5352	4_0_0	EXIST::FUNCTION:
+NAME_CONSTRAINTS_it                     5353	4_0_0	EXIST::FUNCTION:
+NAME_CONSTRAINTS_free                   5354	4_0_0	EXIST::FUNCTION:
+NAME_CONSTRAINTS_new                    5355	4_0_0	EXIST::FUNCTION:
+POLICY_CONSTRAINTS_free                 5356	4_0_0	EXIST::FUNCTION:
+POLICY_CONSTRAINTS_new                  5357	4_0_0	EXIST::FUNCTION:
+POLICY_CONSTRAINTS_it                   5358	4_0_0	EXIST::FUNCTION:
+a2i_GENERAL_NAME                        5359	4_0_0	EXIST::FUNCTION:
+v2i_GENERAL_NAME                        5360	4_0_0	EXIST::FUNCTION:
+v2i_GENERAL_NAME_ex                     5361	4_0_0	EXIST::FUNCTION:
+X509V3_conf_free                        5362	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_nconf_nid                    5363	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_nconf                        5364	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_add_nconf_sk                 5365	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_add_nconf                    5366	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_REQ_add_nconf                5367	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_CRL_add_nconf                5368	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_conf_nid                     5369	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_conf                         5370	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_add_conf                     5371	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_REQ_add_conf                 5372	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_CRL_add_conf                 5373	4_0_0	EXIST::FUNCTION:
+X509V3_add_value_bool_nf                5374	4_0_0	EXIST::FUNCTION:
+X509V3_get_value_bool                   5375	4_0_0	EXIST::FUNCTION:
+X509V3_get_value_int                    5376	4_0_0	EXIST::FUNCTION:
+X509V3_set_nconf                        5377	4_0_0	EXIST::FUNCTION:
+X509V3_set_conf_lhash                   5378	4_0_0	EXIST::FUNCTION:
+X509V3_get_string                       5379	4_0_0	EXIST::FUNCTION:
+X509V3_get_section                      5380	4_0_0	EXIST::FUNCTION:
+X509V3_string_free                      5381	4_0_0	EXIST::FUNCTION:
+X509V3_section_free                     5382	4_0_0	EXIST::FUNCTION:
+X509V3_set_ctx                          5383	4_0_0	EXIST::FUNCTION:
+X509V3_set_issuer_pkey                  5384	4_0_0	EXIST::FUNCTION:
+X509V3_add_value                        5385	4_0_0	EXIST::FUNCTION:
+X509V3_add_value_uchar                  5386	4_0_0	EXIST::FUNCTION:
+X509V3_add_value_bool                   5387	4_0_0	EXIST::FUNCTION:
+X509V3_add_value_int                    5388	4_0_0	EXIST::FUNCTION:
+i2s_ASN1_INTEGER                        5389	4_0_0	EXIST::FUNCTION:
+s2i_ASN1_INTEGER                        5390	4_0_0	EXIST::FUNCTION:
+i2s_ASN1_ENUMERATED                     5391	4_0_0	EXIST::FUNCTION:
+i2s_ASN1_ENUMERATED_TABLE               5392	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_add                          5393	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_add_list                     5394	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_add_alias                    5395	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_cleanup                      5396	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_get                          5397	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_get_nid                      5398	4_0_0	EXIST::FUNCTION:
+X509V3_add_standard_extensions          5399	4_0_0	EXIST::FUNCTION:
+X509V3_parse_list                       5400	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_d2i                          5401	4_0_0	EXIST::FUNCTION:
+X509V3_get_d2i                          5402	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_i2d                          5403	4_0_0	EXIST::FUNCTION:
+X509V3_add1_i2d                         5404	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_val_prn                      5405	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_print                        5406	4_0_0	EXIST::FUNCTION:
+X509V3_EXT_print_fp                     5407	4_0_0	EXIST::FUNCTION:STDIO
+X509V3_extensions_print                 5408	4_0_0	EXIST::FUNCTION:
+X509_check_ca                           5409	4_0_0	EXIST::FUNCTION:
+X509_check_purpose                      5410	4_0_0	EXIST::FUNCTION:
+X509_supported_extension                5411	4_0_0	EXIST::FUNCTION:
+X509_check_issued                       5412	4_0_0	EXIST::FUNCTION:
+X509_check_akid                         5413	4_0_0	EXIST::FUNCTION:
+X509_set_proxy_flag                     5414	4_0_0	EXIST::FUNCTION:
+X509_set_proxy_pathlen                  5415	4_0_0	EXIST::FUNCTION:
+X509_get_proxy_pathlen                  5416	4_0_0	EXIST::FUNCTION:
+X509_get_extension_flags                5417	4_0_0	EXIST::FUNCTION:
+X509_get_key_usage                      5418	4_0_0	EXIST::FUNCTION:
+X509_get_extended_key_usage             5419	4_0_0	EXIST::FUNCTION:
+X509_get0_subject_key_id                5420	4_0_0	EXIST::FUNCTION:
+X509_get0_authority_key_id              5421	4_0_0	EXIST::FUNCTION:
+X509_get0_authority_issuer              5422	4_0_0	EXIST::FUNCTION:
+X509_get0_authority_serial              5423	4_0_0	EXIST::FUNCTION:
+X509_PURPOSE_get_count                  5424	4_0_0	EXIST::FUNCTION:
+X509_PURPOSE_get_unused_id              5425	4_0_0	EXIST::FUNCTION:
+X509_PURPOSE_get_by_sname               5426	4_0_0	EXIST::FUNCTION:
+X509_PURPOSE_get_by_id                  5427	4_0_0	EXIST::FUNCTION:
+X509_PURPOSE_add                        5428	4_0_0	EXIST::FUNCTION:
+X509_PURPOSE_cleanup                    5429	4_0_0	EXIST::FUNCTION:
+X509_PURPOSE_get0                       5430	4_0_0	EXIST::FUNCTION:
+X509_PURPOSE_get_id                     5431	4_0_0	EXIST::FUNCTION:
+X509_PURPOSE_get0_name                  5432	4_0_0	EXIST::FUNCTION:
+X509_PURPOSE_get0_sname                 5433	4_0_0	EXIST::FUNCTION:
+X509_PURPOSE_get_trust                  5434	4_0_0	EXIST::FUNCTION:
+X509_PURPOSE_set                        5435	4_0_0	EXIST::FUNCTION:
+X509_get1_email                         5436	4_0_0	EXIST::FUNCTION:
+X509_REQ_get1_email                     5437	4_0_0	EXIST::FUNCTION:
+X509_email_free                         5438	4_0_0	EXIST::FUNCTION:
+X509_get1_ocsp                          5439	4_0_0	EXIST::FUNCTION:
+X509_check_host                         5440	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+X509_check_email                        5441	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+X509_check_ip                           5442	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+X509_check_ip_asc                       5443	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1
+a2i_IPADDRESS                           5444	4_0_0	EXIST::FUNCTION:
+a2i_IPADDRESS_NC                        5445	4_0_0	EXIST::FUNCTION:
+X509V3_NAME_from_section                5446	4_0_0	EXIST::FUNCTION:
+X509_POLICY_NODE_print                  5447	4_0_0	EXIST::FUNCTION:
+d2i_ASRange                             5448	4_0_0	EXIST::FUNCTION:RFC3779
+i2d_ASRange                             5449	4_0_0	EXIST::FUNCTION:RFC3779
+ASRange_free                            5450	4_0_0	EXIST::FUNCTION:RFC3779
+ASRange_new                             5451	4_0_0	EXIST::FUNCTION:RFC3779
+ASRange_it                              5452	4_0_0	EXIST::FUNCTION:RFC3779
+d2i_ASIdOrRange                         5453	4_0_0	EXIST::FUNCTION:RFC3779
+i2d_ASIdOrRange                         5454	4_0_0	EXIST::FUNCTION:RFC3779
+ASIdOrRange_free                        5455	4_0_0	EXIST::FUNCTION:RFC3779
+ASIdOrRange_new                         5456	4_0_0	EXIST::FUNCTION:RFC3779
+ASIdOrRange_it                          5457	4_0_0	EXIST::FUNCTION:RFC3779
+d2i_ASIdentifierChoice                  5458	4_0_0	EXIST::FUNCTION:RFC3779
+i2d_ASIdentifierChoice                  5459	4_0_0	EXIST::FUNCTION:RFC3779
+ASIdentifierChoice_free                 5460	4_0_0	EXIST::FUNCTION:RFC3779
+ASIdentifierChoice_new                  5461	4_0_0	EXIST::FUNCTION:RFC3779
+ASIdentifierChoice_it                   5462	4_0_0	EXIST::FUNCTION:RFC3779
+d2i_ASIdentifiers                       5463	4_0_0	EXIST::FUNCTION:RFC3779
+i2d_ASIdentifiers                       5464	4_0_0	EXIST::FUNCTION:RFC3779
+ASIdentifiers_free                      5465	4_0_0	EXIST::FUNCTION:RFC3779
+ASIdentifiers_new                       5466	4_0_0	EXIST::FUNCTION:RFC3779
+ASIdentifiers_it                        5467	4_0_0	EXIST::FUNCTION:RFC3779
+d2i_IPAddressRange                      5468	4_0_0	EXIST::FUNCTION:RFC3779
+i2d_IPAddressRange                      5469	4_0_0	EXIST::FUNCTION:RFC3779
+IPAddressRange_free                     5470	4_0_0	EXIST::FUNCTION:RFC3779
+IPAddressRange_new                      5471	4_0_0	EXIST::FUNCTION:RFC3779
+IPAddressRange_it                       5472	4_0_0	EXIST::FUNCTION:RFC3779
+d2i_IPAddressOrRange                    5473	4_0_0	EXIST::FUNCTION:RFC3779
+i2d_IPAddressOrRange                    5474	4_0_0	EXIST::FUNCTION:RFC3779
+IPAddressOrRange_free                   5475	4_0_0	EXIST::FUNCTION:RFC3779
+IPAddressOrRange_new                    5476	4_0_0	EXIST::FUNCTION:RFC3779
+IPAddressOrRange_it                     5477	4_0_0	EXIST::FUNCTION:RFC3779
+d2i_IPAddressChoice                     5478	4_0_0	EXIST::FUNCTION:RFC3779
+i2d_IPAddressChoice                     5479	4_0_0	EXIST::FUNCTION:RFC3779
+IPAddressChoice_free                    5480	4_0_0	EXIST::FUNCTION:RFC3779
+IPAddressChoice_new                     5481	4_0_0	EXIST::FUNCTION:RFC3779
+IPAddressChoice_it                      5482	4_0_0	EXIST::FUNCTION:RFC3779
+d2i_IPAddressFamily                     5483	4_0_0	EXIST::FUNCTION:RFC3779
+i2d_IPAddressFamily                     5484	4_0_0	EXIST::FUNCTION:RFC3779
+IPAddressFamily_free                    5485	4_0_0	EXIST::FUNCTION:RFC3779
+IPAddressFamily_new                     5486	4_0_0	EXIST::FUNCTION:RFC3779
+IPAddressFamily_it                      5487	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_asid_add_inherit                 5488	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_asid_add_id_or_range             5489	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_addr_add_inherit                 5490	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_addr_add_prefix                  5491	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_addr_add_range                   5492	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_addr_get_afi                     5493	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_addr_get_range                   5494	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_asid_is_canonical                5495	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_addr_is_canonical                5496	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_asid_canonize                    5497	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_addr_canonize                    5498	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_asid_inherits                    5499	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_addr_inherits                    5500	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_asid_subset                      5501	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_addr_subset                      5502	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_asid_validate_path               5503	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_addr_validate_path               5504	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_asid_validate_resource_set       5505	4_0_0	EXIST::FUNCTION:RFC3779
+X509v3_addr_validate_resource_set       5506	4_0_0	EXIST::FUNCTION:RFC3779
+d2i_NAMING_AUTHORITY                    5507	4_0_0	EXIST::FUNCTION:
+i2d_NAMING_AUTHORITY                    5508	4_0_0	EXIST::FUNCTION:
+NAMING_AUTHORITY_free                   5509	4_0_0	EXIST::FUNCTION:
+NAMING_AUTHORITY_new                    5510	4_0_0	EXIST::FUNCTION:
+NAMING_AUTHORITY_it                     5511	4_0_0	EXIST::FUNCTION:
+d2i_PROFESSION_INFO                     5512	4_0_0	EXIST::FUNCTION:
+i2d_PROFESSION_INFO                     5513	4_0_0	EXIST::FUNCTION:
+PROFESSION_INFO_free                    5514	4_0_0	EXIST::FUNCTION:
+PROFESSION_INFO_new                     5515	4_0_0	EXIST::FUNCTION:
+PROFESSION_INFO_it                      5516	4_0_0	EXIST::FUNCTION:
+d2i_ADMISSIONS                          5517	4_0_0	EXIST::FUNCTION:
+i2d_ADMISSIONS                          5518	4_0_0	EXIST::FUNCTION:
+ADMISSIONS_free                         5519	4_0_0	EXIST::FUNCTION:
+ADMISSIONS_new                          5520	4_0_0	EXIST::FUNCTION:
+ADMISSIONS_it                           5521	4_0_0	EXIST::FUNCTION:
+d2i_ADMISSION_SYNTAX                    5522	4_0_0	EXIST::FUNCTION:
+i2d_ADMISSION_SYNTAX                    5523	4_0_0	EXIST::FUNCTION:
+ADMISSION_SYNTAX_free                   5524	4_0_0	EXIST::FUNCTION:
+ADMISSION_SYNTAX_new                    5525	4_0_0	EXIST::FUNCTION:
+ADMISSION_SYNTAX_it                     5526	4_0_0	EXIST::FUNCTION:
+NAMING_AUTHORITY_get0_authorityId       5527	4_0_0	EXIST::FUNCTION:
+NAMING_AUTHORITY_get0_authorityURL      5528	4_0_0	EXIST::FUNCTION:
+NAMING_AUTHORITY_get0_authorityText     5529	4_0_0	EXIST::FUNCTION:
+NAMING_AUTHORITY_set0_authorityId       5530	4_0_0	EXIST::FUNCTION:
+NAMING_AUTHORITY_set0_authorityURL      5531	4_0_0	EXIST::FUNCTION:
+NAMING_AUTHORITY_set0_authorityText     5532	4_0_0	EXIST::FUNCTION:
+ADMISSION_SYNTAX_get0_admissionAuthority 5533	4_0_0	EXIST::FUNCTION:
+ADMISSION_SYNTAX_set0_admissionAuthority 5534	4_0_0	EXIST::FUNCTION:
+ADMISSION_SYNTAX_get0_contentsOfAdmissions 5535	4_0_0	EXIST::FUNCTION:
+ADMISSION_SYNTAX_set0_contentsOfAdmissions 5536	4_0_0	EXIST::FUNCTION:
+ADMISSIONS_get0_admissionAuthority      5537	4_0_0	EXIST::FUNCTION:
+ADMISSIONS_set0_admissionAuthority      5538	4_0_0	EXIST::FUNCTION:
+ADMISSIONS_get0_namingAuthority         5539	4_0_0	EXIST::FUNCTION:
+ADMISSIONS_set0_namingAuthority         5540	4_0_0	EXIST::FUNCTION:
+ADMISSIONS_get0_professionInfos         5541	4_0_0	EXIST::FUNCTION:
+ADMISSIONS_set0_professionInfos         5542	4_0_0	EXIST::FUNCTION:
+PROFESSION_INFO_get0_addProfessionInfo  5543	4_0_0	EXIST::FUNCTION:
+PROFESSION_INFO_set0_addProfessionInfo  5544	4_0_0	EXIST::FUNCTION:
+PROFESSION_INFO_get0_namingAuthority    5545	4_0_0	EXIST::FUNCTION:
+PROFESSION_INFO_set0_namingAuthority    5546	4_0_0	EXIST::FUNCTION:
+PROFESSION_INFO_get0_professionItems    5547	4_0_0	EXIST::FUNCTION:
+PROFESSION_INFO_set0_professionItems    5548	4_0_0	EXIST::FUNCTION:
+PROFESSION_INFO_get0_professionOIDs     5549	4_0_0	EXIST::FUNCTION:
+PROFESSION_INFO_set0_professionOIDs     5550	4_0_0	EXIST::FUNCTION:
+PROFESSION_INFO_get0_registrationNumber 5551	4_0_0	EXIST::FUNCTION:
+PROFESSION_INFO_set0_registrationNumber 5552	4_0_0	EXIST::FUNCTION:
+OSSL_GENERAL_NAMES_print                5553	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_ATTRIBUTES_SYNTAX              5554	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_ATTRIBUTES_SYNTAX              5555	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTES_SYNTAX_free             5556	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTES_SYNTAX_new              5557	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTES_SYNTAX_it               5558	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_USER_NOTICE_SYNTAX             5559	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_USER_NOTICE_SYNTAX             5560	4_0_0	EXIST::FUNCTION:
+OSSL_USER_NOTICE_SYNTAX_free            5561	4_0_0	EXIST::FUNCTION:
+OSSL_USER_NOTICE_SYNTAX_new             5562	4_0_0	EXIST::FUNCTION:
+OSSL_USER_NOTICE_SYNTAX_it              5563	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_ROLE_SPEC_CERT_ID              5564	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_ROLE_SPEC_CERT_ID              5565	4_0_0	EXIST::FUNCTION:
+OSSL_ROLE_SPEC_CERT_ID_free             5566	4_0_0	EXIST::FUNCTION:
+OSSL_ROLE_SPEC_CERT_ID_new              5567	4_0_0	EXIST::FUNCTION:
+OSSL_ROLE_SPEC_CERT_ID_it               5568	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_ROLE_SPEC_CERT_ID_SYNTAX       5569	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_ROLE_SPEC_CERT_ID_SYNTAX       5570	4_0_0	EXIST::FUNCTION:
+OSSL_ROLE_SPEC_CERT_ID_SYNTAX_free      5571	4_0_0	EXIST::FUNCTION:
+OSSL_ROLE_SPEC_CERT_ID_SYNTAX_new       5572	4_0_0	EXIST::FUNCTION:
+OSSL_ROLE_SPEC_CERT_ID_SYNTAX_it        5573	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_HASH                           5574	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_HASH                           5575	4_0_0	EXIST::FUNCTION:
+OSSL_HASH_free                          5576	4_0_0	EXIST::FUNCTION:
+OSSL_HASH_new                           5577	4_0_0	EXIST::FUNCTION:
+OSSL_HASH_it                            5578	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_INFO_SYNTAX                    5579	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_INFO_SYNTAX                    5580	4_0_0	EXIST::FUNCTION:
+OSSL_INFO_SYNTAX_free                   5581	4_0_0	EXIST::FUNCTION:
+OSSL_INFO_SYNTAX_new                    5582	4_0_0	EXIST::FUNCTION:
+OSSL_INFO_SYNTAX_it                     5583	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_INFO_SYNTAX_POINTER            5584	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_INFO_SYNTAX_POINTER            5585	4_0_0	EXIST::FUNCTION:
+OSSL_INFO_SYNTAX_POINTER_free           5586	4_0_0	EXIST::FUNCTION:
+OSSL_INFO_SYNTAX_POINTER_new            5587	4_0_0	EXIST::FUNCTION:
+OSSL_INFO_SYNTAX_POINTER_it             5588	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_PRIVILEGE_POLICY_ID            5589	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_PRIVILEGE_POLICY_ID            5590	4_0_0	EXIST::FUNCTION:
+OSSL_PRIVILEGE_POLICY_ID_free           5591	4_0_0	EXIST::FUNCTION:
+OSSL_PRIVILEGE_POLICY_ID_new            5592	4_0_0	EXIST::FUNCTION:
+OSSL_PRIVILEGE_POLICY_ID_it             5593	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_ATTRIBUTE_DESCRIPTOR           5594	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_ATTRIBUTE_DESCRIPTOR           5595	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_DESCRIPTOR_free          5596	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_DESCRIPTOR_new           5597	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_DESCRIPTOR_it            5598	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_DAY_TIME                       5599	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_DAY_TIME                       5600	4_0_0	EXIST::FUNCTION:
+OSSL_DAY_TIME_free                      5601	4_0_0	EXIST::FUNCTION:
+OSSL_DAY_TIME_new                       5602	4_0_0	EXIST::FUNCTION:
+OSSL_DAY_TIME_it                        5603	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_DAY_TIME_BAND                  5604	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_DAY_TIME_BAND                  5605	4_0_0	EXIST::FUNCTION:
+OSSL_DAY_TIME_BAND_free                 5606	4_0_0	EXIST::FUNCTION:
+OSSL_DAY_TIME_BAND_new                  5607	4_0_0	EXIST::FUNCTION:
+OSSL_DAY_TIME_BAND_it                   5608	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_TIME_SPEC_DAY                  5609	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_TIME_SPEC_DAY                  5610	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_DAY_free                 5611	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_DAY_new                  5612	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_DAY_it                   5613	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_TIME_SPEC_WEEKS                5614	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_TIME_SPEC_WEEKS                5615	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_WEEKS_free               5616	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_WEEKS_new                5617	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_WEEKS_it                 5618	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_TIME_SPEC_MONTH                5619	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_TIME_SPEC_MONTH                5620	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_MONTH_free               5621	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_MONTH_new                5622	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_MONTH_it                 5623	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_NAMED_DAY                      5624	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_NAMED_DAY                      5625	4_0_0	EXIST::FUNCTION:
+OSSL_NAMED_DAY_free                     5626	4_0_0	EXIST::FUNCTION:
+OSSL_NAMED_DAY_new                      5627	4_0_0	EXIST::FUNCTION:
+OSSL_NAMED_DAY_it                       5628	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_TIME_SPEC_X_DAY_OF             5629	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_TIME_SPEC_X_DAY_OF             5630	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_X_DAY_OF_free            5631	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_X_DAY_OF_new             5632	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_X_DAY_OF_it              5633	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_TIME_SPEC_ABSOLUTE             5634	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_TIME_SPEC_ABSOLUTE             5635	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_ABSOLUTE_free            5636	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_ABSOLUTE_new             5637	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_ABSOLUTE_it              5638	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_TIME_SPEC_TIME                 5639	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_TIME_SPEC_TIME                 5640	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_TIME_free                5641	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_TIME_new                 5642	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_TIME_it                  5643	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_TIME_SPEC                      5644	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_TIME_SPEC                      5645	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_free                     5646	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_new                      5647	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_SPEC_it                       5648	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_TIME_PERIOD                    5649	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_TIME_PERIOD                    5650	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_PERIOD_free                   5651	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_PERIOD_new                    5652	4_0_0	EXIST::FUNCTION:
+OSSL_TIME_PERIOD_it                     5653	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_ATAV                           5654	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_ATAV                           5655	4_0_0	EXIST::FUNCTION:
+OSSL_ATAV_free                          5656	4_0_0	EXIST::FUNCTION:
+OSSL_ATAV_new                           5657	4_0_0	EXIST::FUNCTION:
+OSSL_ATAV_it                            5658	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_ATTRIBUTE_TYPE_MAPPING         5659	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_ATTRIBUTE_TYPE_MAPPING         5660	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_TYPE_MAPPING_free        5661	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_TYPE_MAPPING_new         5662	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_TYPE_MAPPING_it          5663	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_ATTRIBUTE_VALUE_MAPPING        5664	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_ATTRIBUTE_VALUE_MAPPING        5665	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_VALUE_MAPPING_free       5666	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_VALUE_MAPPING_new        5667	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_VALUE_MAPPING_it         5668	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_ATTRIBUTE_MAPPING              5669	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_ATTRIBUTE_MAPPING              5670	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_MAPPING_free             5671	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_MAPPING_new              5672	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_MAPPING_it               5673	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_ATTRIBUTE_MAPPINGS             5674	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_ATTRIBUTE_MAPPINGS             5675	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_MAPPINGS_free            5676	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_MAPPINGS_new             5677	4_0_0	EXIST::FUNCTION:
+OSSL_ATTRIBUTE_MAPPINGS_it              5678	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_ALLOWED_ATTRIBUTES_CHOICE      5679	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_ALLOWED_ATTRIBUTES_CHOICE      5680	4_0_0	EXIST::FUNCTION:
+OSSL_ALLOWED_ATTRIBUTES_CHOICE_free     5681	4_0_0	EXIST::FUNCTION:
+OSSL_ALLOWED_ATTRIBUTES_CHOICE_new      5682	4_0_0	EXIST::FUNCTION:
+OSSL_ALLOWED_ATTRIBUTES_CHOICE_it       5683	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_ALLOWED_ATTRIBUTES_ITEM        5684	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_ALLOWED_ATTRIBUTES_ITEM        5685	4_0_0	EXIST::FUNCTION:
+OSSL_ALLOWED_ATTRIBUTES_ITEM_free       5686	4_0_0	EXIST::FUNCTION:
+OSSL_ALLOWED_ATTRIBUTES_ITEM_new        5687	4_0_0	EXIST::FUNCTION:
+OSSL_ALLOWED_ATTRIBUTES_ITEM_it         5688	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_ALLOWED_ATTRIBUTES_SYNTAX      5689	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_ALLOWED_ATTRIBUTES_SYNTAX      5690	4_0_0	EXIST::FUNCTION:
+OSSL_ALLOWED_ATTRIBUTES_SYNTAX_free     5691	4_0_0	EXIST::FUNCTION:
+OSSL_ALLOWED_ATTRIBUTES_SYNTAX_new      5692	4_0_0	EXIST::FUNCTION:
+OSSL_ALLOWED_ATTRIBUTES_SYNTAX_it       5693	4_0_0	EXIST::FUNCTION:
+d2i_OSSL_AA_DIST_POINT                  5694	4_0_0	EXIST::FUNCTION:
+i2d_OSSL_AA_DIST_POINT                  5695	4_0_0	EXIST::FUNCTION:
+OSSL_AA_DIST_POINT_free                 5696	4_0_0	EXIST::FUNCTION:
+OSSL_AA_DIST_POINT_new                  5697	4_0_0	EXIST::FUNCTION:
+OSSL_AA_DIST_POINT_it                   5698	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_new_SKEY                5699	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get0_SKEY               5700	4_0_0	EXIST::FUNCTION:
+OSSL_STORE_INFO_get1_SKEY               5701	4_0_0	EXIST::FUNCTION:
+OPENSSL_posix_to_tm                     5702	4_0_0	EXIST::FUNCTION:
+OPENSSL_tm_to_posix                     5703	4_0_0	EXIST::FUNCTION:
+OPENSSL_timegm                          5704	4_0_0	EXIST::FUNCTION:
+OSSL_PARAM_clear_free                   5705	4_0_0	EXIST::FUNCTION:
+CMS_dataFinal_ex                        5706	4_0_0	EXIST::FUNCTION:CMS
+CMS_SignerInfo_verify_ex                5707	4_0_0	EXIST::FUNCTION:CMS
+EVP_SIGNATURE_has_message_update        5708	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_serialize                    5709	4_0_0	EXIST::FUNCTION:
+EVP_MD_CTX_deserialize                  5710	4_0_0	EXIST::FUNCTION:
+OSSL_ENCODER_CTX_ctrl_string            5711	4_0_0	EXIST::FUNCTION:
+OPENSSL_sk_set_cmp_thunks               5712	4_0_0	EXIST::FUNCTION:
+ASN1_BIT_STRING_set1                    5713	4_0_0	EXIST::FUNCTION:
+OSSL_ESS_check_signing_certs_ex         5714	4_0_0	EXIST::FUNCTION:
+X509v3_delete_extension                 5715	4_0_0	EXIST::FUNCTION:
+CMS_SignerInfo_get0_signer_cert         5716	4_1_0	EXIST::FUNCTION:CMS
+CMS_SignerInfo_get_verification_result  5717	4_1_0	EXIST::FUNCTION:CMS
+EVP_SKEY_get0_local_keyid               5718	4_1_0	EXIST::FUNCTION:
+EVP_SKEY_get0_algorithm_id              5719	4_1_0	EXIST::FUNCTION:
+CTLOG_STORE_add0_log                    5720	4_1_0	EXIST::FUNCTION:CT
+CRYPTO_atomic_load_ptr                  5721	4_1_0	EXIST::FUNCTION:
+CRYPTO_atomic_store_ptr                 5722	4_1_0	EXIST::FUNCTION:
+CRYPTO_atomic_cmp_exch_ptr              5723	4_1_0	EXIST::FUNCTION:
+EVP_EC_affine2oct                       5724	4_1_0	EXIST::FUNCTION:
+OPENSSL_sk_set_copy_thunks              5725	4_1_0	EXIST::FUNCTION:
+ASN1_STRING_new_not_owned               5726	4_1_0	EXIST::FUNCTION:
+EVP_KDF_CTX_get0_kdf                    5727	4_1_0	EXIST::FUNCTION:
+EVP_KDF_CTX_get1_kdf                    5728	4_1_0	EXIST::FUNCTION:
+ASN1_STRING_set1_data                   5729	4_1_0	EXIST::FUNCTION:
+ASN1_STRING_set1_string                 5730	4_1_0	EXIST::FUNCTION:
+ASN1_STRING_get_length                  5731	4_1_0	EXIST::FUNCTION:
+CMS_add_standard_smimecap_ex            5732	4_1_0	EXIST::FUNCTION:CMS
+BIO_socket_ready                        5733	4_1_0	EXIST::FUNCTION:SOCK
diff --git a/deps/openssl/openssl/util/libssl.num b/deps/openssl/openssl/util/libssl.num
index dabf3b0cd06..9b24054a7c7 100644
--- a/deps/openssl/openssl/util/libssl.num
+++ b/deps/openssl/openssl/util/libssl.num
@@ -1,608 +1,628 @@
-SSL_get_selected_srtp_profile           1	3_0_0	EXIST::FUNCTION:SRTP
-SSL_set_read_ahead                      2	3_0_0	EXIST::FUNCTION:
-SSL_set_accept_state                    3	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_cipher_list                 4	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_srp_client_pwd_callback     5	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_copy_session_id                     6	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_srp_password                7	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_shutdown                            8	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_msg_callback                9	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get0_ticket                 11	3_0_0	EXIST::FUNCTION:
-SSL_get1_supported_ciphers              12	3_0_0	EXIST::FUNCTION:
-SSL_state_string_long                   13	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get0_certificate                14	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_set_ex_data                 15	3_0_0	EXIST::FUNCTION:
-SSL_get_verify_depth                    16	3_0_0	EXIST::FUNCTION:
-SSL_get0_dane                           17	3_0_0	EXIST::FUNCTION:
-SSL_CTX_sess_get_get_cb                 18	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_default_passwd_cb_userdata  19	3_0_0	EXIST::FUNCTION:
-SSL_set_tmp_dh_callback                 20	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-SSL_CTX_get_verify_depth                21	3_0_0	EXIST::FUNCTION:
-SSL_CTX_use_RSAPrivateKey_file          22	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-SSL_use_PrivateKey_file                 23	3_0_0	EXIST::FUNCTION:
-SSL_set_generate_session_id             24	3_0_0	EXIST::FUNCTION:
-SSL_get_ex_data_X509_STORE_CTX_idx      25	3_0_0	EXIST::FUNCTION:
-SSL_get_quiet_shutdown                  26	3_0_0	EXIST::FUNCTION:
-SSL_dane_enable                         27	3_0_0	EXIST::FUNCTION:
-SSL_COMP_add_compression_method         28	3_0_0	EXIST::FUNCTION:
-SSL_CTX_use_RSAPrivateKey               29	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-SSL_CTX_sess_get_new_cb                 30	3_0_0	EXIST::FUNCTION:
-d2i_SSL_SESSION                         31	3_0_0	EXIST::FUNCTION:
-SSL_use_PrivateKey_ASN1                 32	3_0_0	EXIST::FUNCTION:
-PEM_write_SSL_SESSION                   33	3_0_0	EXIST::FUNCTION:STDIO
-SSL_CTX_set_session_id_context          34	3_0_0	EXIST::FUNCTION:
-SSL_CIPHER_get_cipher_nid               35	3_0_0	EXIST::FUNCTION:
-SSL_get_srp_g                           36	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_want                                37	3_0_0	EXIST::FUNCTION:
-SSL_get_cipher_list                     38	3_0_0	EXIST::FUNCTION:
-SSL_get_verify_result                   39	3_0_0	EXIST::FUNCTION:
-SSL_renegotiate                         40	3_0_0	EXIST::FUNCTION:
-SSL_get_privatekey                      41	3_0_0	EXIST::FUNCTION:
-SSL_peek                                42	3_0_0	EXIST::FUNCTION:
-SRP_Calc_A_param                        43	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_SESSION_get_ticket_lifetime_hint    44	3_0_0	EXIST::FUNCTION:
-SSL_SRP_CTX_free                        45	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_CTX_set_client_CA_list              46	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_next_proto_select_cb        47	3_0_0	EXIST::FUNCTION:NEXTPROTONEG
-BIO_ssl_copy_session_id                 48	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_security_callback           49	3_0_0	EXIST::FUNCTION:
-SSL_CONF_cmd_value_type                 50	3_0_0	EXIST::FUNCTION:
-SSL_CTX_remove_session                  51	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_new                         52	3_0_0	EXIST::FUNCTION:
-TLSv1_2_server_method                   53	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
-BIO_new_buffer_ssl_connect              54	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set0_security_ex_data           55	3_0_0	EXIST::FUNCTION:
-SSL_alert_desc_string                   56	3_0_0	EXIST::FUNCTION:
-SSL_get0_dane_authority                 57	3_0_0	EXIST::FUNCTION:
-SSL_set_purpose                         58	3_0_0	EXIST::FUNCTION:
-SSL_CTX_use_PrivateKey_file             59	3_0_0	EXIST::FUNCTION:
-SSL_get_rfd                             60	3_0_0	EXIST::FUNCTION:
-DTLSv1_listen                           61	3_0_0	EXIST::FUNCTION:SOCK
-SSL_set_ssl_method                      62	3_0_0	EXIST::FUNCTION:
-SSL_get0_security_ex_data               63	3_0_0	EXIST::FUNCTION:
-SSLv3_client_method                     64	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
-SSL_set_security_level                  65	3_0_0	EXIST::FUNCTION:
-DTLSv1_2_method                         66	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
-SSL_get_fd                              67	3_0_0	EXIST::FUNCTION:
-SSL_get1_session                        68	3_0_0	EXIST::FUNCTION:
-SSL_use_RSAPrivateKey                   69	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-SSL_CTX_set_srp_cb_arg                  70	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_CTX_add_session                     71	3_0_0	EXIST::FUNCTION:
-SSL_get_srp_N                           72	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_has_matching_session_id             73	3_0_0	EXIST::FUNCTION:
-PEM_read_SSL_SESSION                    74	3_0_0	EXIST::FUNCTION:STDIO
-SSL_get_shared_ciphers                  75	3_0_0	EXIST::FUNCTION:
-SSL_add1_host                           76	3_0_0	EXIST::FUNCTION:
-SSL_CONF_cmd_argv                       77	3_0_0	EXIST::FUNCTION:
-SSL_version                             78	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_print                       79	3_0_0	EXIST::FUNCTION:
-SSL_get_client_ciphers                  80	3_0_0	EXIST::FUNCTION:
-SSL_get_srtp_profiles                   81	3_0_0	EXIST::FUNCTION:SRTP
-SSL_use_certificate_ASN1                82	3_0_0	EXIST::FUNCTION:
-SSL_get_peer_certificate                83	3_0_0	NOEXIST::FUNCTION:
-DTLSv1_2_server_method                  84	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
-SSL_set_cert_cb                         85	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_cookie_verify_cb            86	3_0_0	EXIST::FUNCTION:
-SSL_get_shared_sigalgs                  87	3_0_0	EXIST::FUNCTION:
-SSL_config                              88	3_0_0	EXIST::FUNCTION:
-TLSv1_1_client_method                   89	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
-SSL_CIPHER_standard_name                90	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_verify_mode                 91	3_0_0	EXIST::FUNCTION:
-SSL_get_all_async_fds                   92	3_0_0	EXIST::FUNCTION:
-SSL_CTX_check_private_key               93	3_0_0	EXIST::FUNCTION:
-SSL_set_wfd                             94	3_0_0	EXIST::FUNCTION:SOCK
-SSL_get_client_CA_list                  95	3_0_0	EXIST::FUNCTION:
-SSL_CONF_CTX_set_flags                  96	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_srp_username_callback       97	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_connect                             98	3_0_0	EXIST::FUNCTION:
-SSL_get_psk_identity                    99	3_0_0	EXIST::FUNCTION:PSK
-SSL_CTX_use_certificate_file            100	3_0_0	EXIST::FUNCTION:
-SSL_set_session_ticket_ext              101	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_psk_server_callback         102	3_0_0	EXIST::FUNCTION:PSK
-SSL_get_sigalgs                         103	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_next_protos_advertised_cb   104	3_0_0	EXIST::FUNCTION:NEXTPROTONEG
-SSL_CTX_set_trust                       105	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_verify                      106	3_0_0	EXIST::FUNCTION:
-SSL_set_rfd                             107	3_0_0	EXIST::FUNCTION:SOCK
-SSL_SESSION_set_timeout                 108	3_0_0	EXIST::FUNCTION:
-SSL_set_psk_client_callback             109	3_0_0	EXIST::FUNCTION:PSK
-SSL_get_client_random                   110	3_0_0	EXIST::FUNCTION:
-TLS_method                              111	3_0_0	EXIST::FUNCTION:
-SSL_CONF_CTX_clear_flags                112	3_0_0	EXIST::FUNCTION:
-TLSv1_client_method                     113	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
-SSL_CIPHER_get_bits                     114	3_0_0	EXIST::FUNCTION:
-SSL_test_functions                      115	3_0_0	EXIST::FUNCTION:UNIT_TEST
-SSL_get_SSL_CTX                         116	3_0_0	EXIST::FUNCTION:
-SSL_get_session                         117	3_0_0	EXIST::FUNCTION:
-SSL_CTX_callback_ctrl                   118	3_0_0	EXIST::FUNCTION:
-SSL_get_finished                        119	3_0_0	EXIST::FUNCTION:
-SSL_add_dir_cert_subjects_to_stack      120	3_0_0	EXIST::FUNCTION:
-SSL_get_state                           121	3_0_0	EXIST::FUNCTION:
-SSL_CONF_CTX_finish                     122	3_0_0	EXIST::FUNCTION:
-SSL_CTX_add_server_custom_ext           123	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get_ex_data                 124	3_0_0	EXIST::FUNCTION:
-SSL_get_srp_username                    125	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_CTX_set_purpose                     126	3_0_0	EXIST::FUNCTION:
-SSL_clear                               127	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_cert_store                  128	3_0_0	EXIST::FUNCTION:
-TLSv1_2_method                          129	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
-SSL_session_reused                      130	3_0_0	EXIST::FUNCTION:
-SSL_free                                131	3_0_0	EXIST::FUNCTION:
-BIO_ssl_shutdown                        132	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_client_CA_list              133	3_0_0	EXIST::FUNCTION:
-SSL_CTX_sessions                        134	3_0_0	EXIST::FUNCTION:
-SSL_get_options                         135	3_0_0	EXIST::FUNCTION:
-SSL_set_verify_depth                    136	3_0_0	EXIST::FUNCTION:
-SSL_get_error                           137	3_0_0	EXIST::FUNCTION:
-SSL_get_servername                      138	3_0_0	EXIST::FUNCTION:
-SSL_get_version                         139	3_0_0	EXIST::FUNCTION:
-SSL_state_string                        140	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get_timeout                 141	3_0_0	EXIST::FUNCTION:
-SSL_CTX_sess_get_remove_cb              142	3_0_0	EXIST::FUNCTION:
-SSL_get_current_cipher                  143	3_0_0	EXIST::FUNCTION:
-SSL_up_ref                              144	3_0_0	EXIST::FUNCTION:
-SSL_export_keying_material              145	3_0_0	EXIST::FUNCTION:
-SSL_callback_ctrl                       146	3_0_0	EXIST::FUNCTION:
-SSL_set_security_callback               147	3_0_0	EXIST::FUNCTION:
-SSL_SRP_CTX_init                        148	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-ERR_load_SSL_strings                    149	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-SSL_CTX_SRP_CTX_init                    150	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_SESSION_set_time                    151	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_4
-i2d_SSL_SESSION                         152	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get_master_key              153	3_0_0	EXIST::FUNCTION:
-SSL_COMP_get_compression_methods        154	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_alpn_select_cb              155	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_tmp_dh_callback             156	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
-SSL_CTX_get_default_passwd_cb           157	3_0_0	EXIST::FUNCTION:
-TLSv1_server_method                     158	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
-DTLS_server_method                      159	3_0_0	EXIST::FUNCTION:
-SSL_set0_rbio                           160	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_options                     161	3_0_0	EXIST::FUNCTION:
-SSL_set_msg_callback                    162	3_0_0	EXIST::FUNCTION:
-SSL_CONF_CTX_free                       163	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_ssl_method                  164	3_0_0	EXIST::FUNCTION:
-SSL_get_server_random                   165	3_0_0	EXIST::FUNCTION:
-SSL_set_shutdown                        166	3_0_0	EXIST::FUNCTION:
-SSL_CTX_add_client_CA                   167	3_0_0	EXIST::FUNCTION:
-TLSv1_1_server_method                   168	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
-PEM_write_bio_SSL_SESSION               169	3_0_0	EXIST::FUNCTION:
-SSL_write                               170	3_0_0	EXIST::FUNCTION:
-SSL_set1_host                           171	3_0_0	EXIST::FUNCTION:
-SSL_use_RSAPrivateKey_file              172	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-SSL_CTX_get_info_callback               173	3_0_0	EXIST::FUNCTION:
-SSL_get0_peername                       174	3_0_0	EXIST::FUNCTION:
-SSL_set_srp_server_param                175	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-TLS_server_method                       176	3_0_0	EXIST::FUNCTION:
-SSL_get_psk_identity_hint               177	3_0_0	EXIST::FUNCTION:PSK
-SSL_set_session                         178	3_0_0	EXIST::FUNCTION:
-SSL_get0_param                          179	3_0_0	EXIST::FUNCTION:
-SSL_set_default_passwd_cb               180	3_0_0	EXIST::FUNCTION:
-SSL_get_read_ahead                      181	3_0_0	EXIST::FUNCTION:
-SSL_dup_CA_list                         182	3_0_0	EXIST::FUNCTION:
-SSL_get_verify_callback                 183	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_default_passwd_cb           184	3_0_0	EXIST::FUNCTION:
-SSL_get_servername_type                 185	3_0_0	EXIST::FUNCTION:
-TLSv1_2_client_method                   186	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
-SSL_add_client_CA                       187	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get0_security_ex_data           188	3_0_0	EXIST::FUNCTION:
-SSL_get_ex_data                         189	3_0_0	EXIST::FUNCTION:
-SSL_CTX_flush_sessions                  190	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_4
-SSL_use_PrivateKey                      191	3_0_0	EXIST::FUNCTION:
-DTLSv1_client_method                    192	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
-SSL_CTX_dane_mtype_set                  193	3_0_0	EXIST::FUNCTION:
-SSL_get_wfd                             194	3_0_0	EXIST::FUNCTION:
-SSL_get_ssl_method                      195	3_0_0	EXIST::FUNCTION:
-SSL_set_verify_result                   196	3_0_0	EXIST::FUNCTION:
-SSL_use_RSAPrivateKey_ASN1              197	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-SSL_CIPHER_get_name                     198	3_0_0	EXIST::FUNCTION:
-OPENSSL_init_ssl                        199	3_0_0	EXIST::FUNCTION:
-SSL_dup                                 200	3_0_0	EXIST::FUNCTION:
-SSL_CTX_use_serverinfo                  201	3_0_0	EXIST::FUNCTION:
-SSL_CTX_use_serverinfo_file             202	3_0_0	EXIST::FUNCTION:
-SSL_set_options                         203	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_default_verify_dir          204	3_0_0	EXIST::FUNCTION:
-SSL_do_handshake                        205	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_ex_data                     206	3_0_0	EXIST::FUNCTION:
-SSL_is_init_finished                    207	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_default_verify_file         208	3_0_0	EXIST::FUNCTION:
-SSLv3_method                            209	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
-SSL_CTX_set_cookie_generate_cb          210	3_0_0	EXIST::FUNCTION:
-SSL_certs_clear                         211	3_0_0	EXIST::FUNCTION:
-SSL_set_connect_state                   212	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_ex_data                     213	3_0_0	EXIST::FUNCTION:
-SSL_rstate_string                       214	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get0_peer                   215	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get_compress_id             216	3_0_0	EXIST::FUNCTION:
-SSL_get_peer_cert_chain                 217	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_cert_cb                     218	3_0_0	EXIST::FUNCTION:
-PEM_read_bio_SSL_SESSION                219	3_0_0	EXIST::FUNCTION:
-SSL_set_info_callback                   220	3_0_0	EXIST::FUNCTION:
-SSL_CTX_sess_set_new_cb                 221	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_security_level              222	3_0_0	EXIST::FUNCTION:
-SSL_CTX_ctrl                            223	3_0_0	EXIST::FUNCTION:
-SSL_set_alpn_protos                     224	3_0_0	EXIST::FUNCTION:
-SSL_set_ex_data                         225	3_0_0	EXIST::FUNCTION:
-SSL_rstate_string_long                  226	3_0_0	EXIST::FUNCTION:
-SSL_ctrl                                227	3_0_0	EXIST::FUNCTION:
-SSL_get_current_compression             228	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_has_ticket                  229	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_cert_verify_callback        230	3_0_0	EXIST::FUNCTION:
-SSL_set_session_secret_cb               231	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_client_cert_engine          232	3_0_0	EXIST::FUNCTION:ENGINE
-SSL_CTX_get0_param                      233	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set1_param                      234	3_0_0	EXIST::FUNCTION:
-SSL_get_certificate                     235	3_0_0	EXIST::FUNCTION:
-DTLSv1_server_method                    236	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
-SSL_set_fd                              237	3_0_0	EXIST::FUNCTION:SOCK
-SSL_use_certificate                     238	3_0_0	EXIST::FUNCTION:
-DTLSv1_method                           239	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
-SSL_set0_wbio                           240	3_0_0	EXIST::FUNCTION:
-SSL_read                                241	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_options                     242	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_ssl_version                 243	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-SSL_set_SSL_CTX                         244	3_0_0	EXIST::FUNCTION:
-SSL_renegotiate_abbreviated             245	3_0_0	EXIST::FUNCTION:
-SSL_get_verify_mode                     246	3_0_0	EXIST::FUNCTION:
-SSL_CIPHER_get_id                       247	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_print_keylog                248	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_psk_client_callback         249	3_0_0	EXIST::FUNCTION:PSK
-SSL_SESSION_get_time                    250	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_4
-SSL_set_debug                           251	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
-SSL_get_security_level                  252	3_0_0	EXIST::FUNCTION:
-SSL_CIPHER_description                  253	3_0_0	EXIST::FUNCTION:
-SSL_set_default_passwd_cb_userdata      254	3_0_0	EXIST::FUNCTION:
-SSL_get_srp_userinfo                    255	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_extension_supported                 256	3_0_0	EXIST::FUNCTION:
-SSL_dane_tlsa_add                       257	3_0_0	EXIST::FUNCTION:
-SSL_srp_server_param_with_username      258	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_CIPHER_get_version                  259	3_0_0	EXIST::FUNCTION:
-SSL_get0_verified_chain                 260	3_0_0	EXIST::FUNCTION:
-SSL_CIPHER_find                         261	3_0_0	EXIST::FUNCTION:
-SSL_get_rbio                            262	3_0_0	EXIST::FUNCTION:
-SSL_CONF_CTX_set_ssl                    263	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_verify_depth                264	3_0_0	EXIST::FUNCTION:
-SSL_get_ciphers                         265	3_0_0	EXIST::FUNCTION:
-SSL_CTX_config                          266	3_0_0	EXIST::FUNCTION:
-SSL_CONF_CTX_set_ssl_ctx                267	3_0_0	EXIST::FUNCTION:
-SSL_CONF_cmd                            268	3_0_0	EXIST::FUNCTION:
-SSL_add_ssl_module                      269	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_verify_callback             270	3_0_0	EXIST::FUNCTION:
-SSL_set1_param                          271	3_0_0	EXIST::FUNCTION:
-SSL_use_certificate_file                272	3_0_0	EXIST::FUNCTION:
-SSL_get_changed_async_fds               273	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_client_cert_cb              274	3_0_0	EXIST::FUNCTION:
-DTLS_client_method                      275	3_0_0	EXIST::FUNCTION:
-SSL_set_trust                           276	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_security_callback           277	3_0_0	EXIST::FUNCTION:
-SSL_CTX_clear_options                   278	3_0_0	EXIST::FUNCTION:
-SSL_check_chain                         279	3_0_0	EXIST::FUNCTION:
-SSL_CTX_sess_set_remove_cb              280	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_info_callback               281	3_0_0	EXIST::FUNCTION:
-SSL_pending                             282	3_0_0	EXIST::FUNCTION:
-SSL_set_bio                             283	3_0_0	EXIST::FUNCTION:
-BIO_new_ssl_connect                     284	3_0_0	EXIST::FUNCTION:
-SSL_waiting_for_async                   285	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_srp_strength                286	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_CTX_get_quiet_shutdown              287	3_0_0	EXIST::FUNCTION:
-SSL_CTX_use_certificate_chain_file      288	3_0_0	EXIST::FUNCTION:
-SSL_CTX_dane_enable                     289	3_0_0	EXIST::FUNCTION:
-SSL_CONF_CTX_new                        290	3_0_0	EXIST::FUNCTION:
-SSL_get0_alpn_selected                  291	3_0_0	EXIST::FUNCTION:
-SSL_get0_next_proto_negotiated          292	3_0_0	EXIST::FUNCTION:NEXTPROTONEG
-SSL_set0_security_ex_data               293	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_tlsext_use_srtp             294	3_0_0	EXIST::FUNCTION:SRTP
-SSL_COMP_set0_compression_methods       295	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_not_resumable_session_callback 296	3_0_0	EXIST::FUNCTION:
-SSL_accept                              297	3_0_0	EXIST::FUNCTION:
-SSL_use_psk_identity_hint               298	3_0_0	EXIST::FUNCTION:PSK
-SSL_trace                               299	3_0_0	EXIST::FUNCTION:SSL_TRACE
-DTLS_method                             300	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_srp_verify_param_callback   301	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_CTX_set_timeout                     302	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_security_level              303	3_0_0	EXIST::FUNCTION:
-TLS_client_method                       304	3_0_0	EXIST::FUNCTION:
-SSL_set_quiet_shutdown                  305	3_0_0	EXIST::FUNCTION:
-SSL_CTX_up_ref                          306	3_0_0	EXIST::FUNCTION:
-SSL_check_private_key                   307	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_quiet_shutdown              308	3_0_0	EXIST::FUNCTION:
-SSL_select_next_proto                   309	3_0_0	EXIST::FUNCTION:
-SSL_load_client_CA_file                 310	3_0_0	EXIST::FUNCTION:
-SSL_set_srp_server_param_pw             311	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_renegotiate_pending                 312	3_0_0	EXIST::FUNCTION:
-SSL_CTX_new                             313	3_0_0	EXIST::FUNCTION:
-SSL_set_session_ticket_ext_cb           314	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_timeout                     315	3_0_0	EXIST::FUNCTION:
-SSL_use_certificate_chain_file          316	3_0_0	EXIST::FUNCTION:
-SSL_set_not_resumable_session_callback  317	3_0_0	EXIST::FUNCTION:
-SSL_CTX_SRP_CTX_free                    318	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_get_current_expansion               319	3_0_0	EXIST::FUNCTION:
-SSL_clear_options                       320	3_0_0	EXIST::FUNCTION:
-SSL_CTX_use_PrivateKey                  321	3_0_0	EXIST::FUNCTION:
-SSL_get_info_callback                   322	3_0_0	EXIST::FUNCTION:
-SSL_CTX_use_psk_identity_hint           323	3_0_0	EXIST::FUNCTION:PSK
-SSL_CTX_use_RSAPrivateKey_ASN1          324	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
-SSL_CTX_use_PrivateKey_ASN1             325	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get0_privatekey                 326	3_0_0	EXIST::FUNCTION:
-BIO_f_ssl                               327	3_0_0	EXIST::FUNCTION:
-SSLv3_server_method                     328	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
-SSL_SESSION_free                        329	3_0_0	EXIST::FUNCTION:
-SSL_get_shutdown                        330	3_0_0	EXIST::FUNCTION:
-SSL_get_peer_finished                   331	3_0_0	EXIST::FUNCTION:
-SSL_set_tlsext_use_srtp                 332	3_0_0	EXIST::FUNCTION:SRTP
-TLSv1_method                            333	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
-SSL_set_psk_server_callback             334	3_0_0	EXIST::FUNCTION:PSK
-SSL_CTX_set_alpn_protos                 335	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_default_verify_paths        336	3_0_0	EXIST::FUNCTION:
-SSL_CTX_sess_set_get_cb                 337	3_0_0	EXIST::FUNCTION:
-SSL_add_file_cert_subjects_to_stack     338	3_0_0	EXIST::FUNCTION:
-SSL_get_default_passwd_cb_userdata      339	3_0_0	EXIST::FUNCTION:
-SSL_get_security_callback               340	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_srp_username                341	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
-SSL_COMP_get_name                       342	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_default_passwd_cb_userdata  343	3_0_0	EXIST::FUNCTION:
-SSL_set_verify                          344	3_0_0	EXIST::FUNCTION:
-SSL_in_before                           345	3_0_0	EXIST::FUNCTION:
-SSL_CIPHER_get_digest_nid               346	3_0_0	EXIST::FUNCTION:
-SSL_CTX_add_client_custom_ext           347	3_0_0	EXIST::FUNCTION:
-SSL_CTX_use_certificate                 348	3_0_0	EXIST::FUNCTION:
-SSL_set_cipher_list                     349	3_0_0	EXIST::FUNCTION:
-SSL_get_wbio                            350	3_0_0	EXIST::FUNCTION:
-SSL_set_hostflags                       351	3_0_0	EXIST::FUNCTION:
-SSL_alert_desc_string_long              352	3_0_0	EXIST::FUNCTION:
-SSL_get_default_timeout                 353	3_0_0	EXIST::FUNCTION:
-SSL_set_session_id_context              354	3_0_0	EXIST::FUNCTION:
-SSL_new                                 355	3_0_0	EXIST::FUNCTION:
-TLSv1_1_method                          356	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
-SSL_CTX_get_cert_store                  357	3_0_0	EXIST::FUNCTION:
-SSL_CTX_load_verify_locations           358	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_print_fp                    359	3_0_0	EXIST::FUNCTION:STDIO
-SSL_get0_dane_tlsa                      360	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_generate_session_id         361	3_0_0	EXIST::FUNCTION:
-SSL_alert_type_string_long              362	3_0_0	EXIST::FUNCTION:
-SSL_CONF_CTX_set1_prefix                363	3_0_0	EXIST::FUNCTION:
-SSL_in_init                             364	3_0_0	EXIST::FUNCTION:
-BIO_new_ssl                             365	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_client_cert_cb              366	3_0_0	EXIST::FUNCTION:
-SSL_CTX_use_certificate_ASN1            367	3_0_0	EXIST::FUNCTION:
-SSL_set_client_CA_list                  368	3_0_0	EXIST::FUNCTION:
-SSL_CTX_free                            369	3_0_0	EXIST::FUNCTION:
-SSL_get_default_passwd_cb               370	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get_id                      371	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_set1_id_context             372	3_0_0	EXIST::FUNCTION:
-SSL_is_server                           373	3_0_0	EXIST::FUNCTION:
-SSL_alert_type_string                   374	3_0_0	EXIST::FUNCTION:
-DTLSv1_2_client_method                  375	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
-SSL_CTX_set_ctlog_list_file             376	3_0_0	EXIST::FUNCTION:CT
-SSL_set_ct_validation_callback          377	3_0_0	EXIST::FUNCTION:CT
-SSL_CTX_set_default_ctlog_list_file     378	3_0_0	EXIST::FUNCTION:CT
-SSL_CTX_has_client_custom_ext           379	3_0_0	EXIST::FUNCTION:
-SSL_ct_is_enabled                       380	3_0_0	EXIST::FUNCTION:CT
-SSL_get0_peer_scts                      381	3_0_0	EXIST::FUNCTION:CT
-SSL_CTX_set_ct_validation_callback      382	3_0_0	EXIST::FUNCTION:CT
-SSL_CTX_ct_is_enabled                   383	3_0_0	EXIST::FUNCTION:CT
-SSL_set_default_read_buffer_len         384	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_default_read_buffer_len     385	3_0_0	EXIST::FUNCTION:
-SSL_has_pending                         386	3_0_0	EXIST::FUNCTION:
-SSL_CIPHER_get_auth_nid                 387	3_0_0	EXIST::FUNCTION:
-SSL_CIPHER_get_kx_nid                   388	3_0_0	EXIST::FUNCTION:
-SSL_CIPHER_is_aead                      389	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_up_ref                      390	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set0_ctlog_store                391	3_0_0	EXIST::FUNCTION:CT
-SSL_CTX_get0_ctlog_store                392	3_0_0	EXIST::FUNCTION:CT
-SSL_enable_ct                           393	3_0_0	EXIST::FUNCTION:CT
-SSL_CTX_enable_ct                       394	3_0_0	EXIST::FUNCTION:CT
-SSL_CTX_get_ciphers                     395	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get0_hostname               396	3_0_0	EXIST::FUNCTION:
-SSL_client_version                      397	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get_protocol_version        398	3_0_0	EXIST::FUNCTION:
-SSL_is_dtls                             399	3_0_0	EXIST::FUNCTION:
-SSL_CTX_dane_set_flags                  400	3_0_0	EXIST::FUNCTION:
-SSL_dane_set_flags                      401	3_0_0	EXIST::FUNCTION:
-SSL_CTX_dane_clear_flags                402	3_0_0	EXIST::FUNCTION:
-SSL_dane_clear_flags                    403	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get0_cipher                 404	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get0_id_context             405	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_set1_id                     406	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set1_cert_store                 407	3_0_0	EXIST::FUNCTION:
-DTLS_get_data_mtu                       408	3_0_0	EXIST::FUNCTION:
-SSL_read_ex                             409	3_0_0	EXIST::FUNCTION:
-SSL_peek_ex                             410	3_0_0	EXIST::FUNCTION:
-SSL_write_ex                            411	3_0_0	EXIST::FUNCTION:
-SSL_COMP_get_id                         412	3_0_0	EXIST::FUNCTION:
-SSL_COMP_get0_name                      413	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_keylog_callback             414	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_keylog_callback             415	3_0_0	EXIST::FUNCTION:
-SSL_get_peer_signature_type_nid         416	3_0_0	EXIST::FUNCTION:
-SSL_key_update                          417	3_0_0	EXIST::FUNCTION:
-SSL_get_key_update_type                 418	3_0_0	EXIST::FUNCTION:
-SSL_bytes_to_cipher_list                419	3_0_0	EXIST::FUNCTION:
-SSL_client_hello_get0_compression_methods 420	3_0_0	EXIST::FUNCTION:
-SSL_client_hello_get0_ciphers           421	3_0_0	EXIST::FUNCTION:
-SSL_client_hello_get0_ext               422	3_0_0	EXIST::FUNCTION:
-SSL_client_hello_get0_session_id        423	3_0_0	EXIST::FUNCTION:
-SSL_client_hello_get0_random            424	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_client_hello_cb             425	3_0_0	EXIST::FUNCTION:
-SSL_client_hello_get0_legacy_version    426	3_0_0	EXIST::FUNCTION:
-SSL_client_hello_isv2                   427	3_0_0	EXIST::FUNCTION:
-SSL_set_max_early_data                  428	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_max_early_data              429	3_0_0	EXIST::FUNCTION:
-SSL_get_max_early_data                  430	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_max_early_data              431	3_0_0	EXIST::FUNCTION:
-SSL_write_early_data                    432	3_0_0	EXIST::FUNCTION:
-SSL_read_early_data                     433	3_0_0	EXIST::FUNCTION:
-SSL_get_early_data_status               434	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get_max_early_data          435	3_0_0	EXIST::FUNCTION:
-SSL_add1_to_CA_list                     436	3_0_0	EXIST::FUNCTION:
-SSL_set0_CA_list                        437	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set0_CA_list                    438	3_0_0	EXIST::FUNCTION:
-SSL_get0_CA_list                        439	3_0_0	EXIST::FUNCTION:
-SSL_get0_peer_CA_list                   440	3_0_0	EXIST::FUNCTION:
-SSL_CTX_add1_to_CA_list                 441	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get0_CA_list                    442	3_0_0	EXIST::FUNCTION:
-SSL_CTX_add_custom_ext                  443	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_is_resumable                444	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_record_padding_callback     445	3_0_0	EXIST::FUNCTION:
-SSL_set_record_padding_callback         446	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_block_padding               447	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_record_padding_callback_arg 448	3_0_0	EXIST::FUNCTION:
-SSL_get_record_padding_callback_arg     449	3_0_0	EXIST::FUNCTION:
-SSL_set_block_padding                   450	3_0_0	EXIST::FUNCTION:
-SSL_set_record_padding_callback_arg     451	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_record_padding_callback_arg 452	3_0_0	EXIST::FUNCTION:
-SSL_CTX_use_serverinfo_ex               453	3_0_0	EXIST::FUNCTION:
-SSL_client_hello_get1_extensions_present 454	3_0_0	EXIST::FUNCTION:
-SSL_set_psk_find_session_callback       455	3_0_0	EXIST::FUNCTION:
-SSL_set_psk_use_session_callback        456	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_psk_use_session_callback    457	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_psk_find_session_callback   458	3_0_0	EXIST::FUNCTION:
-SSL_CIPHER_get_handshake_digest         459	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_set1_master_key             460	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_set_cipher                  461	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_set_protocol_version        462	3_0_0	EXIST::FUNCTION:
-OPENSSL_cipher_name                     463	3_0_0	EXIST::FUNCTION:
-SSL_alloc_buffers                       464	3_0_0	EXIST::FUNCTION:
-SSL_free_buffers                        465	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_dup                         466	3_0_0	EXIST::FUNCTION:
-SSL_get_pending_cipher                  467	3_0_0	EXIST::FUNCTION:
-SSL_CIPHER_get_protocol_id              468	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_set_max_early_data          469	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_set1_alpn_selected          470	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_set1_hostname               471	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get0_alpn_selected          472	3_0_0	EXIST::FUNCTION:
-DTLS_set_timer_cb                       473	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_tlsext_max_fragment_length  474	3_0_0	EXIST::FUNCTION:
-SSL_set_tlsext_max_fragment_length      475	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get_max_fragment_length     476	3_0_0	EXIST::FUNCTION:
-SSL_stateless                           477	3_0_0	EXIST::FUNCTION:
-SSL_verify_client_post_handshake        478	3_0_0	EXIST::FUNCTION:
-SSL_set_post_handshake_auth             479	3_0_0	EXIST::FUNCTION:
-SSL_export_keying_material_early        480	3_0_0	EXIST::FUNCTION:
-SSL_CTX_use_cert_and_key                481	3_0_0	EXIST::FUNCTION:
-SSL_use_cert_and_key                    482	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_get0_ticket_appdata         483	3_0_0	EXIST::FUNCTION:
-SSL_SESSION_set1_ticket_appdata         484	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_session_ticket_cb           485	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_stateless_cookie_generate_cb 486	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_stateless_cookie_verify_cb  487	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_ciphersuites                488	3_0_0	EXIST::FUNCTION:
-SSL_set_ciphersuites                    489	3_0_0	EXIST::FUNCTION:
-SSL_set_num_tickets                     490	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_num_tickets                 491	3_0_0	EXIST::FUNCTION:
-SSL_get_num_tickets                     492	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_num_tickets                 493	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_allow_early_data_cb         494	3_0_0	EXIST::FUNCTION:
-SSL_set_allow_early_data_cb             495	3_0_0	EXIST::FUNCTION:
-SSL_set_recv_max_early_data             496	3_0_0	EXIST::FUNCTION:
-SSL_get_recv_max_early_data             497	3_0_0	EXIST::FUNCTION:
-SSL_CTX_get_recv_max_early_data         498	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_recv_max_early_data         499	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_post_handshake_auth         500	3_0_0	EXIST::FUNCTION:
-SSL_get_signature_type_nid              501	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_async_callback              502	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_async_callback_arg          503	3_0_0	EXIST::FUNCTION:
-SSL_set_async_callback                  504	3_0_0	EXIST::FUNCTION:
-SSL_set_async_callback_arg              505	3_0_0	EXIST::FUNCTION:
-SSL_get_async_status                    506	3_0_0	EXIST::FUNCTION:
-SSL_sendfile                            507	3_0_0	EXIST::FUNCTION:
-OSSL_default_cipher_list                508	3_0_0	EXIST::FUNCTION:
-OSSL_default_ciphersuites               509	3_0_0	EXIST::FUNCTION:
-SSL_add_store_cert_subjects_to_stack    510	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_default_verify_store        511	3_0_0	EXIST::FUNCTION:
-SSL_CTX_load_verify_file                512	3_0_0	EXIST::FUNCTION:
-SSL_CTX_load_verify_dir                 513	3_0_0	EXIST::FUNCTION:
-SSL_CTX_load_verify_store               514	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set_tlsext_ticket_key_evp_cb    515	3_0_0	EXIST::FUNCTION:
-SSL_CTX_new_ex                          516	3_0_0	EXIST::FUNCTION:
-SSL_new_session_ticket                  517	3_0_0	EXIST::FUNCTION:
-SSL_get0_peer_certificate               518	3_0_0	EXIST::FUNCTION:
-SSL_get1_peer_certificate               519	3_0_0	EXIST::FUNCTION:
-SSL_load_client_CA_file_ex              520	3_0_0	EXIST::FUNCTION:
-SSL_set0_tmp_dh_pkey                    521	3_0_0	EXIST::FUNCTION:
-SSL_CTX_set0_tmp_dh_pkey                522	3_0_0	EXIST::FUNCTION:
-SSL_group_to_name                       523	3_0_0	EXIST::FUNCTION:
-SSL_client_hello_get_extension_order    524	3_2_0	EXIST::FUNCTION:
-OSSL_QUIC_client_method                 525	3_2_0	EXIST::FUNCTION:QUIC
-OSSL_QUIC_client_thread_method          526	3_2_0	EXIST::FUNCTION:QUIC
-SSL_CTX_set1_cert_comp_preference       527	3_2_0	EXIST::FUNCTION:
-SSL_set1_cert_comp_preference           528	3_2_0	EXIST::FUNCTION:
-SSL_CTX_compress_certs                  529	3_2_0	EXIST::FUNCTION:
-SSL_compress_certs                      530	3_2_0	EXIST::FUNCTION:
-SSL_CTX_set1_compressed_cert            531	3_2_0	EXIST::FUNCTION:
-SSL_set1_compressed_cert                532	3_2_0	EXIST::FUNCTION:
-SSL_CTX_get1_compressed_cert            533	3_2_0	EXIST::FUNCTION:
-SSL_get1_compressed_cert                534	3_2_0	EXIST::FUNCTION:
-SSL_get_rpoll_descriptor                535	3_2_0	EXIST::FUNCTION:
-SSL_get_wpoll_descriptor                536	3_2_0	EXIST::FUNCTION:
-SSL_set_blocking_mode                   537	3_2_0	EXIST::FUNCTION:
-SSL_get_blocking_mode                   538	3_2_0	EXIST::FUNCTION:
-SSL_set1_initial_peer_addr              539	3_2_0	EXIST::FUNCTION:
-SSL_net_read_desired                    540	3_2_0	EXIST::FUNCTION:
-SSL_net_write_desired                   541	3_2_0	EXIST::FUNCTION:
-SSL_shutdown_ex                         542	3_2_0	EXIST::FUNCTION:
-SSL_stream_conclude                     543	3_2_0	EXIST::FUNCTION:
-SSL_inject_net_dgram                    544	3_2_0	EXIST::FUNCTION:QUIC
-SSL_get0_peer_rpk                       545	3_2_0	EXIST::FUNCTION:
-SSL_SESSION_get0_peer_rpk               546	3_2_0	EXIST::FUNCTION:
-SSL_set1_client_cert_type               547	3_2_0	EXIST::FUNCTION:
-SSL_get0_client_cert_type               548	3_2_0	EXIST::FUNCTION:
-SSL_set1_server_cert_type               549	3_2_0	EXIST::FUNCTION:
-SSL_get0_server_cert_type               550	3_2_0	EXIST::FUNCTION:
-SSL_CTX_set1_client_cert_type           551	3_2_0	EXIST::FUNCTION:
-SSL_CTX_get0_client_cert_type           552	3_2_0	EXIST::FUNCTION:
-SSL_CTX_set1_server_cert_type           553	3_2_0	EXIST::FUNCTION:
-SSL_CTX_get0_server_cert_type           554	3_2_0	EXIST::FUNCTION:
-SSL_get_negotiated_client_cert_type     555	3_2_0	EXIST::FUNCTION:
-SSL_get_negotiated_server_cert_type     556	3_2_0	EXIST::FUNCTION:
-SSL_add_expected_rpk                    557	3_2_0	EXIST::FUNCTION:
-d2i_SSL_SESSION_ex                      558	3_2_0	EXIST::FUNCTION:
-SSL_is_tls                              559	3_2_0	EXIST::FUNCTION:
-SSL_is_quic                             560	3_2_0	EXIST::FUNCTION:
-SSL_get_handshake_rtt                   561	3_2_0	EXIST::FUNCTION:
-SSL_new_stream                          562	3_2_0	EXIST::FUNCTION:
-SSL_get0_connection                     563	3_2_0	EXIST::FUNCTION:
-SSL_is_connection                       564	3_2_0	EXIST::FUNCTION:
-SSL_get_stream_type                     565	3_2_0	EXIST::FUNCTION:
-SSL_get_stream_id                       566	3_2_0	EXIST::FUNCTION:
-SSL_set_default_stream_mode             567	3_2_0	EXIST::FUNCTION:
-SSL_accept_stream                       568	3_2_0	EXIST::FUNCTION:
-SSL_get_accept_stream_queue_len         569	3_2_0	EXIST::FUNCTION:
-SSL_stream_reset                        570	3_2_0	EXIST::FUNCTION:
-SSL_get_stream_read_state               571	3_2_0	EXIST::FUNCTION:
-SSL_get_stream_write_state              572	3_2_0	EXIST::FUNCTION:
-SSL_get_stream_read_error_code          573	3_2_0	EXIST::FUNCTION:
-SSL_get_stream_write_error_code         574	3_2_0	EXIST::FUNCTION:
-SSL_get_conn_close_info                 575	3_2_0	EXIST::FUNCTION:
-SSL_set_incoming_stream_policy          576	3_2_0	EXIST::FUNCTION:
-SSL_handle_events                       577	3_2_0	EXIST::FUNCTION:
-SSL_get_event_timeout                   578	3_2_0	EXIST::FUNCTION:
-SSL_get0_group_name                     579	3_2_0	EXIST::FUNCTION:
-SSL_is_stream_local                     580	3_2_0	EXIST::FUNCTION:
-SSL_write_ex2                           581	3_3_0	EXIST::FUNCTION:
-SSL_get_value_uint                      582	3_3_0	EXIST::FUNCTION:
-SSL_set_value_uint                      583	3_3_0	EXIST::FUNCTION:
-SSL_poll                                584	3_3_0	EXIST::FUNCTION:
-SSL_SESSION_get_time_ex                 585	3_3_0	EXIST::FUNCTION:
-SSL_SESSION_set_time_ex                 586	3_3_0	EXIST::FUNCTION:
-SSL_CTX_flush_sessions_ex               587	3_4_0	EXIST::FUNCTION:
-SSL_CTX_set_block_padding_ex            588	3_4_0	EXIST::FUNCTION:
-SSL_set_block_padding_ex                589	3_4_0	EXIST::FUNCTION:
-SSL_get1_builtin_sigalgs                590	3_4_0	EXIST::FUNCTION:
-SSL_set_quic_tls_cbs                    591	3_5_0	EXIST::FUNCTION:
-SSL_set_quic_tls_transport_params       592	3_5_0	EXIST::FUNCTION:
-SSL_set_quic_tls_early_data_enabled     593	3_5_0	EXIST::FUNCTION:
-OSSL_QUIC_server_method                 594	3_5_0	EXIST::FUNCTION:QUIC
-SSL_is_listener                         595	3_5_0	EXIST::FUNCTION:
-SSL_get0_listener                       596	3_5_0	EXIST::FUNCTION:
-SSL_new_listener                        597	3_5_0	EXIST::FUNCTION:
-SSL_accept_connection                   598	3_5_0	EXIST::FUNCTION:
-SSL_get_accept_connection_queue_len     599	3_5_0	EXIST::FUNCTION:
-SSL_listen                              600	3_5_0	EXIST::FUNCTION:
-SSL_new_from_listener                   601	3_5_0	EXIST::FUNCTION:
-SSL_new_listener_from                   602	3_5_0	EXIST::FUNCTION:
-SSL_is_domain                           603	3_5_0	EXIST::FUNCTION:
-SSL_get0_domain                         604	3_5_0	EXIST::FUNCTION:
-SSL_new_domain                          605	3_5_0	EXIST::FUNCTION:
-SSL_CTX_set_domain_flags                606	3_5_0	EXIST::FUNCTION:
-SSL_CTX_get_domain_flags                607	3_5_0	EXIST::FUNCTION:
-SSL_get_domain_flags                    608	3_5_0	EXIST::FUNCTION:
-SSL_CTX_set_new_pending_conn_cb         609	3_5_0	EXIST::FUNCTION:
+OSSL_QUIC_client_method                 1	4_0_0	EXIST::FUNCTION:QUIC
+OSSL_QUIC_client_thread_method          2	4_0_0	EXIST::FUNCTION:QUIC
+OSSL_QUIC_server_method                 3	4_0_0	EXIST::FUNCTION:QUIC
+SSL_CTX_set_tlsext_use_srtp             4	4_0_0	EXIST::FUNCTION:SRTP
+SSL_set_tlsext_use_srtp                 5	4_0_0	EXIST::FUNCTION:SRTP
+SSL_get_srtp_profiles                   6	4_0_0	EXIST::FUNCTION:SRTP
+SSL_get_selected_srtp_profile           7	4_0_0	EXIST::FUNCTION:SRTP
+ERR_load_SSL_strings                    8	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SSL_CTX_set_tlsext_max_fragment_length  9	4_0_0	EXIST::FUNCTION:
+SSL_set_tlsext_max_fragment_length      10	4_0_0	EXIST::FUNCTION:
+SSL_get_servername                      11	4_0_0	EXIST::FUNCTION:
+SSL_get_servername_type                 12	4_0_0	EXIST::FUNCTION:
+SSL_export_keying_material              13	4_0_0	EXIST::FUNCTION:
+SSL_export_keying_material_early        14	4_0_0	EXIST::FUNCTION:
+SSL_get_peer_signature_type_nid         15	4_0_0	EXIST::FUNCTION:
+SSL_get_signature_type_nid              16	4_0_0	EXIST::FUNCTION:
+SSL_get_sigalgs                         17	4_0_0	EXIST::FUNCTION:
+SSL_get1_builtin_sigalgs                18	4_0_0	EXIST::FUNCTION:
+SSL_get_shared_sigalgs                  19	4_0_0	EXIST::FUNCTION:
+SSL_check_chain                         20	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_tlsext_ticket_key_evp_cb    21	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_options                     22	4_0_0	EXIST::FUNCTION:
+SSL_get_options                         23	4_0_0	EXIST::FUNCTION:
+SSL_CTX_clear_options                   24	4_0_0	EXIST::FUNCTION:
+SSL_clear_options                       25	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_options                     26	4_0_0	EXIST::FUNCTION:
+SSL_set_options                         27	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_msg_callback                28	4_0_0	EXIST::FUNCTION:
+SSL_set_msg_callback                    29	4_0_0	EXIST::FUNCTION:
+SSL_SRP_CTX_init                        30	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_CTX_SRP_CTX_init                    31	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_SRP_CTX_free                        32	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_CTX_SRP_CTX_free                    33	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_srp_server_param_with_username      34	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SRP_Calc_A_param                        35	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_CTX_sessions                        36	4_0_0	EXIST::FUNCTION:
+SSL_CTX_sess_set_new_cb                 37	4_0_0	EXIST::FUNCTION:
+SSL_CTX_sess_get_new_cb                 38	4_0_0	EXIST::FUNCTION:
+SSL_CTX_sess_set_remove_cb              39	4_0_0	EXIST::FUNCTION:
+SSL_CTX_sess_get_remove_cb              40	4_0_0	EXIST::FUNCTION:
+SSL_CTX_sess_set_get_cb                 41	4_0_0	EXIST::FUNCTION:
+SSL_CTX_sess_get_get_cb                 42	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_info_callback               43	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_info_callback               44	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_client_cert_cb              45	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_client_cert_cb              46	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_cookie_generate_cb          47	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_cookie_verify_cb            48	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_stateless_cookie_generate_cb 49	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_stateless_cookie_verify_cb  50	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_next_protos_advertised_cb   51	4_0_0	EXIST::FUNCTION:NEXTPROTONEG
+SSL_CTX_set_next_proto_select_cb        52	4_0_0	EXIST::FUNCTION:NEXTPROTONEG
+SSL_get0_next_proto_negotiated          53	4_0_0	EXIST::FUNCTION:NEXTPROTONEG
+SSL_select_next_proto                   54	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_alpn_protos                 55	4_0_0	EXIST::FUNCTION:
+SSL_set_alpn_protos                     56	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get0_alpn_protos                57	4_0_0	EXIST::FUNCTION:
+SSL_get0_alpn_protos                    58	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_alpn_select_cb              59	4_0_0	EXIST::FUNCTION:
+SSL_get0_alpn_selected                  60	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_psk_client_callback         61	4_0_0	EXIST::FUNCTION:PSK
+SSL_set_psk_client_callback             62	4_0_0	EXIST::FUNCTION:PSK
+SSL_CTX_set_psk_server_callback         63	4_0_0	EXIST::FUNCTION:PSK
+SSL_set_psk_server_callback             64	4_0_0	EXIST::FUNCTION:PSK
+SSL_CTX_use_psk_identity_hint           65	4_0_0	EXIST::FUNCTION:PSK
+SSL_use_psk_identity_hint               66	4_0_0	EXIST::FUNCTION:PSK
+SSL_get_psk_identity_hint               67	4_0_0	EXIST::FUNCTION:PSK
+SSL_get_psk_identity                    68	4_0_0	EXIST::FUNCTION:PSK
+SSL_set_psk_find_session_callback       69	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_psk_find_session_callback   70	4_0_0	EXIST::FUNCTION:
+SSL_set_psk_use_session_callback        71	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_psk_use_session_callback    72	4_0_0	EXIST::FUNCTION:
+SSL_CTX_has_client_custom_ext           73	4_0_0	EXIST::FUNCTION:
+SSL_CTX_add_client_custom_ext           74	4_0_0	EXIST::FUNCTION:
+SSL_CTX_add_server_custom_ext           75	4_0_0	EXIST::FUNCTION:
+SSL_CTX_add_custom_ext                  76	4_0_0	EXIST::FUNCTION:
+SSL_extension_supported                 77	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_keylog_callback             78	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_keylog_callback             79	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_max_early_data              80	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_max_early_data              81	4_0_0	EXIST::FUNCTION:
+SSL_set_max_early_data                  82	4_0_0	EXIST::FUNCTION:
+SSL_get_max_early_data                  83	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_recv_max_early_data         84	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_recv_max_early_data         85	4_0_0	EXIST::FUNCTION:
+SSL_set_recv_max_early_data             86	4_0_0	EXIST::FUNCTION:
+SSL_get_recv_max_early_data             87	4_0_0	EXIST::FUNCTION:
+SSL_set_debug                           88	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_1_1_0
+SSL_in_init                             89	4_0_0	EXIST::FUNCTION:
+SSL_in_before                           90	4_0_0	EXIST::FUNCTION:
+SSL_is_init_finished                    91	4_0_0	EXIST::FUNCTION:
+SSL_get_finished                        92	4_0_0	EXIST::FUNCTION:
+SSL_get_peer_finished                   93	4_0_0	EXIST::FUNCTION:
+PEM_read_SSL_SESSION                    94	4_0_0	EXIST::FUNCTION:STDIO
+PEM_write_SSL_SESSION                   95	4_0_0	EXIST::FUNCTION:STDIO
+PEM_read_bio_SSL_SESSION                96	4_0_0	EXIST::FUNCTION:
+PEM_write_bio_SSL_SESSION               97	4_0_0	EXIST::FUNCTION:
+SSL_get0_group_name                     98	4_0_0	EXIST::FUNCTION:
+SSL_group_to_name                       99	4_0_0	EXIST::FUNCTION:
+SSL_set0_tmp_dh_pkey                    100	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set0_tmp_dh_pkey                101	4_0_0	EXIST::FUNCTION:
+BIO_f_ssl                               102	4_0_0	EXIST::FUNCTION:
+BIO_new_ssl                             103	4_0_0	EXIST::FUNCTION:
+BIO_new_ssl_connect                     104	4_0_0	EXIST::FUNCTION:
+BIO_new_buffer_ssl_connect              105	4_0_0	EXIST::FUNCTION:
+BIO_ssl_copy_session_id                 106	4_0_0	EXIST::FUNCTION:
+BIO_ssl_shutdown                        107	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_cipher_list                 108	4_0_0	EXIST::FUNCTION:
+SSL_CTX_new                             109	4_0_0	EXIST::FUNCTION:
+SSL_CTX_new_ex                          110	4_0_0	EXIST::FUNCTION:
+SSL_CTX_up_ref                          111	4_0_0	EXIST::FUNCTION:
+SSL_CTX_free                            112	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_timeout                     113	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_timeout                     114	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_cert_store                  115	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_cert_store                  116	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set1_cert_store                 117	4_0_0	EXIST::FUNCTION:
+SSL_want                                118	4_0_0	EXIST::FUNCTION:
+SSL_clear                               119	4_0_0	EXIST::FUNCTION:
+SSL_CTX_flush_sessions                  120	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_4
+SSL_CTX_flush_sessions_ex               121	4_0_0	EXIST::FUNCTION:
+SSL_get_current_cipher                  122	4_0_0	EXIST::FUNCTION:
+SSL_get_pending_cipher                  123	4_0_0	EXIST::FUNCTION:
+SSL_CIPHER_get_bits                     124	4_0_0	EXIST::FUNCTION:
+SSL_CIPHER_get_version                  125	4_0_0	EXIST::FUNCTION:
+SSL_CIPHER_get_name                     126	4_0_0	EXIST::FUNCTION:
+SSL_CIPHER_standard_name                127	4_0_0	EXIST::FUNCTION:
+OPENSSL_cipher_name                     128	4_0_0	EXIST::FUNCTION:
+SSL_CIPHER_get_id                       129	4_0_0	EXIST::FUNCTION:
+SSL_CIPHER_get_protocol_id              130	4_0_0	EXIST::FUNCTION:
+SSL_CIPHER_get_kx_nid                   131	4_0_0	EXIST::FUNCTION:
+SSL_CIPHER_get_auth_nid                 132	4_0_0	EXIST::FUNCTION:
+SSL_CIPHER_get_handshake_digest         133	4_0_0	EXIST::FUNCTION:
+SSL_CIPHER_is_aead                      134	4_0_0	EXIST::FUNCTION:
+SSL_get_fd                              135	4_0_0	EXIST::FUNCTION:
+SSL_get_rfd                             136	4_0_0	EXIST::FUNCTION:
+SSL_get_wfd                             137	4_0_0	EXIST::FUNCTION:
+SSL_get_cipher_list                     138	4_0_0	EXIST::FUNCTION:
+SSL_get_shared_ciphers                  139	4_0_0	EXIST::FUNCTION:
+SSL_get_read_ahead                      140	4_0_0	EXIST::FUNCTION:
+SSL_pending                             141	4_0_0	EXIST::FUNCTION:
+SSL_has_pending                         142	4_0_0	EXIST::FUNCTION:
+SSL_set_fd                              143	4_0_0	EXIST::FUNCTION:SOCK
+SSL_set_rfd                             144	4_0_0	EXIST::FUNCTION:SOCK
+SSL_set_wfd                             145	4_0_0	EXIST::FUNCTION:SOCK
+SSL_set0_rbio                           146	4_0_0	EXIST::FUNCTION:
+SSL_set0_wbio                           147	4_0_0	EXIST::FUNCTION:
+SSL_set_bio                             148	4_0_0	EXIST::FUNCTION:
+SSL_get_rbio                            149	4_0_0	EXIST::FUNCTION:
+SSL_get_wbio                            150	4_0_0	EXIST::FUNCTION:
+SSL_set_cipher_list                     151	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_ciphersuites                152	4_0_0	EXIST::FUNCTION:
+SSL_set_ciphersuites                    153	4_0_0	EXIST::FUNCTION:
+SSL_set_read_ahead                      154	4_0_0	EXIST::FUNCTION:
+SSL_get_verify_mode                     155	4_0_0	EXIST::FUNCTION:
+SSL_get_verify_depth                    156	4_0_0	EXIST::FUNCTION:
+SSL_get_verify_callback                 157	4_0_0	EXIST::FUNCTION:
+SSL_set_verify                          158	4_0_0	EXIST::FUNCTION:
+SSL_set_verify_depth                    159	4_0_0	EXIST::FUNCTION:
+SSL_set_cert_cb                         160	4_0_0	EXIST::FUNCTION:
+SSL_use_RSAPrivateKey                   161	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SSL_use_RSAPrivateKey_ASN1              162	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SSL_use_PrivateKey                      163	4_0_0	EXIST::FUNCTION:
+SSL_use_PrivateKey_ASN1                 164	4_0_0	EXIST::FUNCTION:
+SSL_use_certificate                     165	4_0_0	EXIST::FUNCTION:
+SSL_use_certificate_ASN1                166	4_0_0	EXIST::FUNCTION:
+SSL_use_cert_and_key                    167	4_0_0	EXIST::FUNCTION:
+SSL_CTX_use_serverinfo                  168	4_0_0	EXIST::FUNCTION:
+SSL_CTX_use_serverinfo_ex               169	4_0_0	EXIST::FUNCTION:
+SSL_CTX_use_serverinfo_file             170	4_0_0	EXIST::FUNCTION:
+SSL_use_RSAPrivateKey_file              171	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SSL_use_PrivateKey_file                 172	4_0_0	EXIST::FUNCTION:
+SSL_use_certificate_file                173	4_0_0	EXIST::FUNCTION:
+SSL_CTX_use_RSAPrivateKey_file          174	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SSL_CTX_use_PrivateKey_file             175	4_0_0	EXIST::FUNCTION:
+SSL_CTX_use_certificate_file            176	4_0_0	EXIST::FUNCTION:
+SSL_CTX_use_certificate_chain_file      177	4_0_0	EXIST::FUNCTION:
+SSL_use_certificate_chain_file          178	4_0_0	EXIST::FUNCTION:
+SSL_load_client_CA_file                 179	4_0_0	EXIST::FUNCTION:
+SSL_load_client_CA_file_ex              180	4_0_0	EXIST::FUNCTION:
+SSL_add_file_cert_subjects_to_stack     181	4_0_0	EXIST::FUNCTION:
+SSL_add_dir_cert_subjects_to_stack      182	4_0_0	EXIST::FUNCTION:
+SSL_add_store_cert_subjects_to_stack    183	4_0_0	EXIST::FUNCTION:
+SSL_state_string                        184	4_0_0	EXIST::FUNCTION:
+SSL_rstate_string                       185	4_0_0	EXIST::FUNCTION:
+SSL_state_string_long                   186	4_0_0	EXIST::FUNCTION:
+SSL_rstate_string_long                  187	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get_time                    188	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_4
+SSL_SESSION_set_time                    189	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_4
+SSL_SESSION_get_timeout                 190	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_set_timeout                 191	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get_protocol_version        192	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_set_protocol_version        193	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get_time_ex                 194	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_set_time_ex                 195	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get0_hostname               196	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_set1_hostname               197	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get0_alpn_selected          198	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_set1_alpn_selected          199	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get0_cipher                 200	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_set_cipher                  201	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_has_ticket                  202	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get_ticket_lifetime_hint    203	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get0_ticket                 204	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get_max_early_data          205	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_set_max_early_data          206	4_0_0	EXIST::FUNCTION:
+SSL_copy_session_id                     207	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get0_peer                   208	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_set1_id_context             209	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_set1_id                     210	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_is_resumable                211	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_new                         212	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_dup                         213	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get_id                      214	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get0_id_context             215	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get_compress_id             216	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_print_fp                    217	4_0_0	EXIST::FUNCTION:STDIO
+SSL_SESSION_print                       218	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_print_keylog                219	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_up_ref                      220	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_free                        221	4_0_0	EXIST::FUNCTION:
+i2d_SSL_SESSION                         222	4_0_0	EXIST::FUNCTION:
+SSL_set_session                         223	4_0_0	EXIST::FUNCTION:
+SSL_CTX_add_session                     224	4_0_0	EXIST::FUNCTION:
+SSL_CTX_remove_session                  225	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_generate_session_id         226	4_0_0	EXIST::FUNCTION:
+SSL_set_generate_session_id             227	4_0_0	EXIST::FUNCTION:
+SSL_has_matching_session_id             228	4_0_0	EXIST::FUNCTION:
+d2i_SSL_SESSION                         229	4_0_0	EXIST::FUNCTION:
+d2i_SSL_SESSION_ex                      230	4_0_0	EXIST::FUNCTION:
+SSL_get0_peer_certificate               231	4_0_0	EXIST::FUNCTION:
+SSL_get1_peer_certificate               232	4_0_0	EXIST::FUNCTION:
+SSL_get_peer_cert_chain                 233	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_verify_mode                 234	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_verify_depth                235	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_verify_callback             236	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_verify                      237	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_verify_depth                238	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_cert_verify_callback        239	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_cert_cb                     240	4_0_0	EXIST::FUNCTION:
+SSL_CTX_use_RSAPrivateKey               241	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SSL_CTX_use_RSAPrivateKey_ASN1          242	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+SSL_CTX_use_PrivateKey                  243	4_0_0	EXIST::FUNCTION:
+SSL_CTX_use_PrivateKey_ASN1             244	4_0_0	EXIST::FUNCTION:
+SSL_CTX_use_certificate                 245	4_0_0	EXIST::FUNCTION:
+SSL_CTX_use_certificate_ASN1            246	4_0_0	EXIST::FUNCTION:
+SSL_CTX_use_cert_and_key                247	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_default_passwd_cb           248	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_default_passwd_cb_userdata  249	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_default_passwd_cb           250	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_default_passwd_cb_userdata  251	4_0_0	EXIST::FUNCTION:
+SSL_set_default_passwd_cb               252	4_0_0	EXIST::FUNCTION:
+SSL_set_default_passwd_cb_userdata      253	4_0_0	EXIST::FUNCTION:
+SSL_get_default_passwd_cb               254	4_0_0	EXIST::FUNCTION:
+SSL_get_default_passwd_cb_userdata      255	4_0_0	EXIST::FUNCTION:
+SSL_CTX_check_private_key               256	4_0_0	EXIST::FUNCTION:
+SSL_check_private_key                   257	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_session_id_context          258	4_0_0	EXIST::FUNCTION:
+SSL_new                                 259	4_0_0	EXIST::FUNCTION:
+SSL_up_ref                              260	4_0_0	EXIST::FUNCTION:
+SSL_is_dtls                             261	4_0_0	EXIST::FUNCTION:
+SSL_is_tls                              262	4_0_0	EXIST::FUNCTION:
+SSL_is_quic                             263	4_0_0	EXIST::FUNCTION:
+SSL_set_session_id_context              264	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_purpose                     265	4_0_0	EXIST::FUNCTION:
+SSL_set_purpose                         266	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_trust                       267	4_0_0	EXIST::FUNCTION:
+SSL_set_trust                           268	4_0_0	EXIST::FUNCTION:
+SSL_set1_host                           269	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_0
+SSL_add1_host                           270	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_0
+SSL_set1_dnsname                        271	4_0_0	EXIST::FUNCTION:
+SSL_add1_dnsname                        272	4_0_0	EXIST::FUNCTION:
+SSL_set1_ipaddr                         273	4_0_0	EXIST::FUNCTION:
+SSL_add1_ipaddr                         274	4_0_0	EXIST::FUNCTION:
+SSL_get0_peername                       275	4_0_0	EXIST::FUNCTION:
+SSL_set_hostflags                       276	4_0_0	EXIST::FUNCTION:
+SSL_CTX_dane_enable                     277	4_0_0	EXIST::FUNCTION:
+SSL_CTX_dane_mtype_set                  278	4_0_0	EXIST::FUNCTION:
+SSL_dane_enable                         279	4_0_0	EXIST::FUNCTION:
+SSL_dane_tlsa_add                       280	4_0_0	EXIST::FUNCTION:
+SSL_get0_dane_authority                 281	4_0_0	EXIST::FUNCTION:
+SSL_get0_dane_tlsa                      282	4_0_0	EXIST::FUNCTION:
+SSL_get0_dane                           283	4_0_0	EXIST::FUNCTION:
+SSL_CTX_dane_set_flags                  284	4_0_0	EXIST::FUNCTION:
+SSL_CTX_dane_clear_flags                285	4_0_0	EXIST::FUNCTION:
+SSL_dane_set_flags                      286	4_0_0	EXIST::FUNCTION:
+SSL_dane_clear_flags                    287	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set1_param                      288	4_0_0	EXIST::FUNCTION:
+SSL_set1_param                          289	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get0_param                      290	4_0_0	EXIST::FUNCTION:
+SSL_get0_param                          291	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_srp_username                292	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_CTX_set_srp_password                293	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_CTX_set_srp_strength                294	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_CTX_set_srp_client_pwd_callback     295	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_CTX_set_srp_verify_param_callback   296	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_CTX_set_srp_username_callback       297	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_CTX_set_srp_cb_arg                  298	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_set_srp_server_param                299	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_set_srp_server_param_pw             300	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_get_srp_g                           301	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_get_srp_N                           302	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_get_srp_username                    303	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_get_srp_userinfo                    304	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
+SSL_CTX_set_client_hello_cb             305	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_new_pending_conn_cb         306	4_0_0	EXIST::FUNCTION:
+SSL_client_hello_isv2                   307	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_0
+SSL_client_hello_get0_legacy_version    308	4_0_0	EXIST::FUNCTION:
+SSL_client_hello_get0_random            309	4_0_0	EXIST::FUNCTION:
+SSL_client_hello_get0_session_id        310	4_0_0	EXIST::FUNCTION:
+SSL_client_hello_get0_ciphers           311	4_0_0	EXIST::FUNCTION:
+SSL_client_hello_get0_compression_methods 312	4_0_0	EXIST::FUNCTION:
+SSL_client_hello_get1_extensions_present 313	4_0_0	EXIST::FUNCTION:
+SSL_client_hello_get_extension_order    314	4_0_0	EXIST::FUNCTION:
+SSL_client_hello_get0_ext               315	4_0_0	EXIST::FUNCTION:
+SSL_certs_clear                         316	4_0_0	EXIST::FUNCTION:
+SSL_free                                317	4_0_0	EXIST::FUNCTION:
+SSL_waiting_for_async                   318	4_0_0	EXIST::FUNCTION:
+SSL_get_all_async_fds                   319	4_0_0	EXIST::FUNCTION:
+SSL_get_changed_async_fds               320	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_async_callback              321	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_async_callback_arg          322	4_0_0	EXIST::FUNCTION:
+SSL_set_async_callback                  323	4_0_0	EXIST::FUNCTION:
+SSL_set_async_callback_arg              324	4_0_0	EXIST::FUNCTION:
+SSL_get_async_status                    325	4_0_0	EXIST::FUNCTION:
+SSL_accept                              326	4_0_0	EXIST::FUNCTION:
+SSL_stateless                           327	4_0_0	EXIST::FUNCTION:
+SSL_connect                             328	4_0_0	EXIST::FUNCTION:
+SSL_read                                329	4_0_0	EXIST::FUNCTION:
+SSL_read_ex                             330	4_0_0	EXIST::FUNCTION:
+SSL_read_early_data                     331	4_0_0	EXIST::FUNCTION:
+SSL_peek                                332	4_0_0	EXIST::FUNCTION:
+SSL_peek_ex                             333	4_0_0	EXIST::FUNCTION:
+SSL_sendfile                            334	4_0_0	EXIST::FUNCTION:
+SSL_write                               335	4_0_0	EXIST::FUNCTION:
+SSL_write_ex                            336	4_0_0	EXIST::FUNCTION:
+SSL_write_early_data                    337	4_0_0	EXIST::FUNCTION:
+SSL_ctrl                                338	4_0_0	EXIST::FUNCTION:
+SSL_callback_ctrl                       339	4_0_0	EXIST::FUNCTION:
+SSL_CTX_ctrl                            340	4_0_0	EXIST::FUNCTION:
+SSL_CTX_callback_ctrl                   341	4_0_0	EXIST::FUNCTION:
+SSL_write_ex2                           342	4_0_0	EXIST::FUNCTION:
+SSL_get_early_data_status               343	4_0_0	EXIST::FUNCTION:
+SSL_get_error                           344	4_0_0	EXIST::FUNCTION:
+SSL_get_version                         345	4_0_0	EXIST::FUNCTION:
+SSL_get_handshake_rtt                   346	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_ssl_version                 347	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0
+TLS_method                              348	4_0_0	EXIST::FUNCTION:
+TLS_server_method                       349	4_0_0	EXIST::FUNCTION:
+TLS_client_method                       350	4_0_0	EXIST::FUNCTION:
+DTLS_method                             351	4_0_0	EXIST::FUNCTION:
+DTLS_server_method                      352	4_0_0	EXIST::FUNCTION:
+DTLS_client_method                      353	4_0_0	EXIST::FUNCTION:
+DTLS_get_data_mtu                       354	4_0_0	EXIST::FUNCTION:
+SSL_get_ciphers                         355	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_ciphers                     356	4_0_0	EXIST::FUNCTION:
+SSL_get_client_ciphers                  357	4_0_0	EXIST::FUNCTION:
+SSL_get1_supported_ciphers              358	4_0_0	EXIST::FUNCTION:
+SSL_do_handshake                        359	4_0_0	EXIST::FUNCTION:
+SSL_key_update                          360	4_0_0	EXIST::FUNCTION:
+SSL_get_key_update_type                 361	4_0_0	EXIST::FUNCTION:
+SSL_renegotiate                         362	4_0_0	EXIST::FUNCTION:
+SSL_renegotiate_abbreviated             363	4_0_0	EXIST::FUNCTION:
+SSL_renegotiate_pending                 364	4_0_0	EXIST::FUNCTION:
+SSL_new_session_ticket                  365	4_0_0	EXIST::FUNCTION:
+SSL_shutdown                            366	4_0_0	EXIST::FUNCTION:
+SSL_verify_client_post_handshake        367	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_post_handshake_auth         368	4_0_0	EXIST::FUNCTION:
+SSL_set_post_handshake_auth             369	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_ssl_method                  370	4_0_0	EXIST::FUNCTION:
+SSL_get_ssl_method                      371	4_0_0	EXIST::FUNCTION:
+SSL_set_ssl_method                      372	4_0_0	EXIST::FUNCTION:
+SSL_alert_type_string_long              373	4_0_0	EXIST::FUNCTION:
+SSL_alert_type_string                   374	4_0_0	EXIST::FUNCTION:
+SSL_alert_desc_string_long              375	4_0_0	EXIST::FUNCTION:
+SSL_alert_desc_string                   376	4_0_0	EXIST::FUNCTION:
+SSL_set0_CA_list                        377	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set0_CA_list                    378	4_0_0	EXIST::FUNCTION:
+SSL_get0_CA_list                        379	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get0_CA_list                    380	4_0_0	EXIST::FUNCTION:
+SSL_add1_to_CA_list                     381	4_0_0	EXIST::FUNCTION:
+SSL_CTX_add1_to_CA_list                 382	4_0_0	EXIST::FUNCTION:
+SSL_get0_peer_CA_list                   383	4_0_0	EXIST::FUNCTION:
+SSL_set_client_CA_list                  384	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_client_CA_list              385	4_0_0	EXIST::FUNCTION:
+SSL_get_client_CA_list                  386	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_client_CA_list              387	4_0_0	EXIST::FUNCTION:
+SSL_add_client_CA                       388	4_0_0	EXIST::FUNCTION:
+SSL_CTX_add_client_CA                   389	4_0_0	EXIST::FUNCTION:
+SSL_set_connect_state                   390	4_0_0	EXIST::FUNCTION:
+SSL_set_accept_state                    391	4_0_0	EXIST::FUNCTION:
+SSL_get_default_timeout                 392	4_0_0	EXIST::FUNCTION:
+SSL_CIPHER_description                  393	4_0_0	EXIST::FUNCTION:
+SSL_dup_CA_list                         394	4_0_0	EXIST::FUNCTION:
+SSL_dup                                 395	4_0_0	EXIST::FUNCTION:
+SSL_get_certificate                     396	4_0_0	EXIST::FUNCTION:
+SSL_get_privatekey                      397	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get0_certificate                398	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get0_privatekey                 399	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_quiet_shutdown              400	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_quiet_shutdown              401	4_0_0	EXIST::FUNCTION:
+SSL_set_quiet_shutdown                  402	4_0_0	EXIST::FUNCTION:
+SSL_get_quiet_shutdown                  403	4_0_0	EXIST::FUNCTION:
+SSL_set_shutdown                        404	4_0_0	EXIST::FUNCTION:
+SSL_get_shutdown                        405	4_0_0	EXIST::FUNCTION:
+SSL_version                             406	4_0_0	EXIST::FUNCTION:
+SSL_client_version                      407	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_default_verify_paths        408	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_default_verify_dir          409	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_default_verify_file         410	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_default_verify_store        411	4_0_0	EXIST::FUNCTION:
+SSL_CTX_load_verify_file                412	4_0_0	EXIST::FUNCTION:
+SSL_CTX_load_verify_dir                 413	4_0_0	EXIST::FUNCTION:
+SSL_CTX_load_verify_store               414	4_0_0	EXIST::FUNCTION:
+SSL_CTX_load_verify_locations           415	4_0_0	EXIST::FUNCTION:
+SSL_get_session                         416	4_0_0	EXIST::FUNCTION:
+SSL_get1_session                        417	4_0_0	EXIST::FUNCTION:
+SSL_get_SSL_CTX                         418	4_0_0	EXIST::FUNCTION:
+SSL_set_SSL_CTX                         419	4_0_0	EXIST::FUNCTION:
+SSL_set_info_callback                   420	4_0_0	EXIST::FUNCTION:
+SSL_get_info_callback                   421	4_0_0	EXIST::FUNCTION:
+SSL_get_state                           422	4_0_0	EXIST::FUNCTION:
+SSL_set_verify_result                   423	4_0_0	EXIST::FUNCTION:
+SSL_get_verify_result                   424	4_0_0	EXIST::FUNCTION:
+SSL_get0_verified_chain                 425	4_0_0	EXIST::FUNCTION:
+SSL_get_client_random                   426	4_0_0	EXIST::FUNCTION:
+SSL_get_server_random                   427	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get_master_key              428	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_set1_master_key             429	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get_max_fragment_length     430	4_0_0	EXIST::FUNCTION:
+SSL_set_ex_data                         431	4_0_0	EXIST::FUNCTION:
+SSL_get_ex_data                         432	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_set_ex_data                 433	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get_ex_data                 434	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_ex_data                     435	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_ex_data                     436	4_0_0	EXIST::FUNCTION:
+SSL_get_ex_data_X509_STORE_CTX_idx      437	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_default_read_buffer_len     438	4_0_0	EXIST::FUNCTION:
+SSL_set_default_read_buffer_len         439	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_tmp_dh_callback             440	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+SSL_set_tmp_dh_callback                 441	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,DH
+SSL_get_current_compression             442	4_0_0	EXIST::FUNCTION:
+SSL_get_current_expansion               443	4_0_0	EXIST::FUNCTION:
+SSL_COMP_get_name                       444	4_0_0	EXIST::FUNCTION:
+SSL_COMP_get0_name                      445	4_0_0	EXIST::FUNCTION:
+SSL_COMP_get_id                         446	4_0_0	EXIST::FUNCTION:
+SSL_COMP_get_compression_methods        447	4_0_0	EXIST::FUNCTION:
+SSL_COMP_set0_compression_methods       448	4_0_0	EXIST::FUNCTION:
+SSL_COMP_add_compression_method         449	4_0_0	EXIST::FUNCTION:
+SSL_CIPHER_find                         450	4_0_0	EXIST::FUNCTION:
+SSL_CIPHER_get_cipher_nid               451	4_0_0	EXIST::FUNCTION:
+SSL_CIPHER_get_digest_nid               452	4_0_0	EXIST::FUNCTION:
+SSL_bytes_to_cipher_list                453	4_0_0	EXIST::FUNCTION:
+SSL_set_session_ticket_ext              454	4_0_0	EXIST::FUNCTION:
+SSL_set_session_ticket_ext_cb           455	4_0_0	EXIST::FUNCTION:
+SSL_set_session_secret_cb               456	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_not_resumable_session_callback 457	4_0_0	EXIST::FUNCTION:
+SSL_set_not_resumable_session_callback  458	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_record_padding_callback     459	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_record_padding_callback_arg 460	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_record_padding_callback_arg 461	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_block_padding               462	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_block_padding_ex            463	4_0_0	EXIST::FUNCTION:
+SSL_set_record_padding_callback         464	4_0_0	EXIST::FUNCTION:
+SSL_set_record_padding_callback_arg     465	4_0_0	EXIST::FUNCTION:
+SSL_get_record_padding_callback_arg     466	4_0_0	EXIST::FUNCTION:
+SSL_set_block_padding                   467	4_0_0	EXIST::FUNCTION:
+SSL_set_block_padding_ex                468	4_0_0	EXIST::FUNCTION:
+SSL_set_num_tickets                     469	4_0_0	EXIST::FUNCTION:
+SSL_get_num_tickets                     470	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_num_tickets                 471	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_num_tickets                 472	4_0_0	EXIST::FUNCTION:
+SSL_handle_events                       473	4_0_0	EXIST::FUNCTION:
+SSL_get_event_timeout                   474	4_0_0	EXIST::FUNCTION:
+SSL_get_peer_addr                       475	4_0_0	EXIST::FUNCTION:
+SSL_get_rpoll_descriptor                476	4_0_0	EXIST::FUNCTION:
+SSL_get_wpoll_descriptor                477	4_0_0	EXIST::FUNCTION:
+SSL_net_read_desired                    478	4_0_0	EXIST::FUNCTION:
+SSL_net_write_desired                   479	4_0_0	EXIST::FUNCTION:
+SSL_set_blocking_mode                   480	4_0_0	EXIST::FUNCTION:
+SSL_get_blocking_mode                   481	4_0_0	EXIST::FUNCTION:
+SSL_set1_initial_peer_addr              482	4_0_0	EXIST::FUNCTION:
+SSL_get0_connection                     483	4_0_0	EXIST::FUNCTION:
+SSL_is_connection                       484	4_0_0	EXIST::FUNCTION:
+SSL_is_listener                         485	4_0_0	EXIST::FUNCTION:
+SSL_get0_listener                       486	4_0_0	EXIST::FUNCTION:
+SSL_new_listener                        487	4_0_0	EXIST::FUNCTION:
+SSL_new_listener_from                   488	4_0_0	EXIST::FUNCTION:
+SSL_new_from_listener                   489	4_0_0	EXIST::FUNCTION:
+SSL_accept_connection                   490	4_0_0	EXIST::FUNCTION:
+SSL_get_accept_connection_queue_len     491	4_0_0	EXIST::FUNCTION:
+SSL_listen                              492	4_0_0	EXIST::FUNCTION:
+SSL_is_domain                           493	4_0_0	EXIST::FUNCTION:
+SSL_get0_domain                         494	4_0_0	EXIST::FUNCTION:
+SSL_new_domain                          495	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_domain_flags                496	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_domain_flags                497	4_0_0	EXIST::FUNCTION:
+SSL_get_domain_flags                    498	4_0_0	EXIST::FUNCTION:
+SSL_get_stream_type                     499	4_0_0	EXIST::FUNCTION:
+SSL_get_stream_id                       500	4_0_0	EXIST::FUNCTION:
+SSL_is_stream_local                     501	4_0_0	EXIST::FUNCTION:
+SSL_set_default_stream_mode             502	4_0_0	EXIST::FUNCTION:
+SSL_new_stream                          503	4_0_0	EXIST::FUNCTION:
+SSL_set_incoming_stream_policy          504	4_0_0	EXIST::FUNCTION:
+SSL_accept_stream                       505	4_0_0	EXIST::FUNCTION:
+SSL_get_accept_stream_queue_len         506	4_0_0	EXIST::FUNCTION:
+SSL_inject_net_dgram                    507	4_0_0	EXIST::FUNCTION:QUIC
+SSL_shutdown_ex                         508	4_0_0	EXIST::FUNCTION:
+SSL_stream_conclude                     509	4_0_0	EXIST::FUNCTION:
+SSL_stream_reset                        510	4_0_0	EXIST::FUNCTION:
+SSL_get_stream_read_state               511	4_0_0	EXIST::FUNCTION:
+SSL_get_stream_write_state              512	4_0_0	EXIST::FUNCTION:
+SSL_get_stream_read_error_code          513	4_0_0	EXIST::FUNCTION:
+SSL_get_stream_write_error_code         514	4_0_0	EXIST::FUNCTION:
+SSL_get_conn_close_info                 515	4_0_0	EXIST::FUNCTION:
+SSL_get_value_uint                      516	4_0_0	EXIST::FUNCTION:
+SSL_set_value_uint                      517	4_0_0	EXIST::FUNCTION:
+SSL_poll                                518	4_0_0	EXIST::FUNCTION:
+SSL_session_reused                      519	4_0_0	EXIST::FUNCTION:
+SSL_is_server                           520	4_0_0	EXIST::FUNCTION:
+SSL_CONF_CTX_new                        521	4_0_0	EXIST::FUNCTION:
+SSL_CONF_CTX_finish                     522	4_0_0	EXIST::FUNCTION:
+SSL_CONF_CTX_free                       523	4_0_0	EXIST::FUNCTION:
+SSL_CONF_CTX_set_flags                  524	4_0_0	EXIST::FUNCTION:
+SSL_CONF_CTX_clear_flags                525	4_0_0	EXIST::FUNCTION:
+SSL_CONF_CTX_set1_prefix                526	4_0_0	EXIST::FUNCTION:
+SSL_CONF_CTX_set_ssl                    527	4_0_0	EXIST::FUNCTION:
+SSL_CONF_CTX_set_ssl_ctx                528	4_0_0	EXIST::FUNCTION:
+SSL_CONF_cmd                            529	4_0_0	EXIST::FUNCTION:
+SSL_CONF_cmd_argv                       530	4_0_0	EXIST::FUNCTION:
+SSL_CONF_cmd_value_type                 531	4_0_0	EXIST::FUNCTION:
+SSL_add_ssl_module                      532	4_0_0	EXIST::FUNCTION:
+SSL_config                              533	4_0_0	EXIST::FUNCTION:
+SSL_CTX_config                          534	4_0_0	EXIST::FUNCTION:
+SSL_trace                               535	4_0_0	EXIST::FUNCTION:SSL_TRACE
+DTLSv1_listen                           536	4_0_0	EXIST::FUNCTION:SOCK
+SSL_set_ct_validation_callback          537	4_0_0	EXIST::FUNCTION:CT
+SSL_CTX_set_ct_validation_callback      538	4_0_0	EXIST::FUNCTION:CT
+SSL_enable_ct                           539	4_0_0	EXIST::FUNCTION:CT
+SSL_CTX_enable_ct                       540	4_0_0	EXIST::FUNCTION:CT
+SSL_ct_is_enabled                       541	4_0_0	EXIST::FUNCTION:CT
+SSL_CTX_ct_is_enabled                   542	4_0_0	EXIST::FUNCTION:CT
+SSL_get0_peer_scts                      543	4_0_0	EXIST::FUNCTION:CT
+SSL_CTX_set_default_ctlog_list_file     544	4_0_0	EXIST::FUNCTION:CT
+SSL_CTX_set_ctlog_list_file             545	4_0_0	EXIST::FUNCTION:CT
+SSL_CTX_set0_ctlog_store                546	4_0_0	EXIST::FUNCTION:CT
+SSL_CTX_get0_ctlog_store                547	4_0_0	EXIST::FUNCTION:CT
+SSL_set_security_level                  548	4_0_0	EXIST::FUNCTION:
+SSL_get_security_level                  549	4_0_0	EXIST::FUNCTION:
+SSL_set_security_callback               550	4_0_0	EXIST::FUNCTION:
+SSL_get_security_callback               551	4_0_0	EXIST::FUNCTION:
+SSL_set0_security_ex_data               552	4_0_0	EXIST::FUNCTION:
+SSL_get0_security_ex_data               553	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_security_level              554	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_security_level              555	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_security_callback           556	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get_security_callback           557	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set0_security_ex_data           558	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get0_security_ex_data           559	4_0_0	EXIST::FUNCTION:
+OPENSSL_init_ssl                        560	4_0_0	EXIST::FUNCTION:
+SSL_test_functions                      561	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_1,UNIT_TEST
+SSL_free_buffers                        562	4_0_0	EXIST::FUNCTION:
+SSL_alloc_buffers                       563	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_session_ticket_cb           564	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_set1_ticket_appdata         565	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get0_ticket_appdata         566	4_0_0	EXIST::FUNCTION:
+DTLS_set_timer_cb                       567	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set_allow_early_data_cb         568	4_0_0	EXIST::FUNCTION:
+SSL_set_allow_early_data_cb             569	4_0_0	EXIST::FUNCTION:
+OSSL_default_cipher_list                570	4_0_0	EXIST::FUNCTION:
+OSSL_default_ciphersuites               571	4_0_0	EXIST::FUNCTION:
+SSL_CTX_compress_certs                  572	4_0_0	EXIST::FUNCTION:
+SSL_compress_certs                      573	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set1_cert_comp_preference       574	4_0_0	EXIST::FUNCTION:
+SSL_set1_cert_comp_preference           575	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set1_compressed_cert            576	4_0_0	EXIST::FUNCTION:
+SSL_set1_compressed_cert                577	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get1_compressed_cert            578	4_0_0	EXIST::FUNCTION:
+SSL_get1_compressed_cert                579	4_0_0	EXIST::FUNCTION:
+SSL_add_expected_rpk                    580	4_0_0	EXIST::FUNCTION:
+SSL_get0_peer_rpk                       581	4_0_0	EXIST::FUNCTION:
+SSL_SESSION_get0_peer_rpk               582	4_0_0	EXIST::FUNCTION:
+SSL_get_negotiated_client_cert_type     583	4_0_0	EXIST::FUNCTION:
+SSL_get_negotiated_server_cert_type     584	4_0_0	EXIST::FUNCTION:
+SSL_set1_client_cert_type               585	4_0_0	EXIST::FUNCTION:
+SSL_set1_server_cert_type               586	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set1_client_cert_type           587	4_0_0	EXIST::FUNCTION:
+SSL_CTX_set1_server_cert_type           588	4_0_0	EXIST::FUNCTION:
+SSL_get0_client_cert_type               589	4_0_0	EXIST::FUNCTION:
+SSL_get0_server_cert_type               590	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get0_client_cert_type           591	4_0_0	EXIST::FUNCTION:
+SSL_CTX_get0_server_cert_type           592	4_0_0	EXIST::FUNCTION:
+SSL_set_quic_tls_cbs                    593	4_0_0	EXIST::FUNCTION:
+SSL_set_quic_tls_transport_params       594	4_0_0	EXIST::FUNCTION:
+SSL_set_quic_tls_early_data_enabled     595	4_0_0	EXIST::FUNCTION:
+SSL_CTX_is_quic                         596	4_0_0	EXIST::FUNCTION:
+SSL_CTX_is_server                       597	4_0_0	EXIST::FUNCTION:
+OSSL_QUIC_method                        598	4_0_0	EXIST::FUNCTION:QUIC
+SSL_listen_ex                           599	4_0_0	EXIST::FUNCTION:
+OSSL_ECHSTORE_new                       600	4_0_0	EXIST::FUNCTION:ECH
+OSSL_ECHSTORE_free                      601	4_0_0	EXIST::FUNCTION:ECH
+OSSL_ECHSTORE_new_config                602	4_0_0	EXIST::FUNCTION:ECH
+OSSL_ECHSTORE_write_pem                 603	4_0_0	EXIST::FUNCTION:ECH
+OSSL_ECHSTORE_read_echconfiglist        604	4_0_0	EXIST::FUNCTION:ECH
+OSSL_ECHSTORE_get1_info                 605	4_0_0	EXIST::FUNCTION:ECH
+OSSL_ECHSTORE_downselect                606	4_0_0	EXIST::FUNCTION:ECH
+OSSL_ECHSTORE_set1_key_and_read_pem     607	4_0_0	EXIST::FUNCTION:ECH
+OSSL_ECHSTORE_read_pem                  608	4_0_0	EXIST::FUNCTION:ECH
+OSSL_ECHSTORE_num_keys                  609	4_0_0	EXIST::FUNCTION:ECH
+OSSL_ECHSTORE_flush_keys                610	4_0_0	EXIST::FUNCTION:ECH
+SSL_CTX_set1_echstore                   611	4_0_0	EXIST::FUNCTION:ECH
+SSL_set1_echstore                       612	4_0_0	EXIST::FUNCTION:ECH
+SSL_CTX_get1_echstore                   613	4_0_0	EXIST::FUNCTION:ECH
+SSL_get1_echstore                       614	4_0_0	EXIST::FUNCTION:ECH
+SSL_ech_get1_status                     615	4_0_0	EXIST::FUNCTION:ECH
+SSL_ech_set_grease_type                 616	4_0_0	EXIST::FUNCTION:ECH
+SSL_ech_set_callback                    617	4_0_0	EXIST::FUNCTION:ECH
+SSL_CTX_ech_set_callback                618	4_0_0	EXIST::FUNCTION:ECH
+OSSL_ECHSTORE_num_entries               619	4_0_0	EXIST::FUNCTION:ECH
+SSL_ech_set1_server_names               620	4_0_0	EXIST::FUNCTION:ECH
+SSL_ech_set1_outer_server_name          621	4_0_0	EXIST::FUNCTION:ECH
+SSL_ech_set1_outer_alpn_protos          622	4_0_0	EXIST::FUNCTION:ECH
+SSL_ech_set1_grease_suite               623	4_0_0	EXIST::FUNCTION:ECH
+SSL_ech_get1_retry_config               624	4_0_0	EXIST::FUNCTION:ECH
+SSL_CTX_ech_set1_outer_alpn_protos      625	4_0_0	EXIST::FUNCTION:ECH
+SSL_set1_ech_config_list                626	4_0_0	EXIST::FUNCTION:ECH
+SSL_get0_sigalg                         627	4_0_0	EXIST::FUNCTION:
+SSL_get0_shared_sigalg                  628	4_0_0	EXIST::FUNCTION:
diff --git a/deps/openssl/openssl/util/lock-contention-graph.sh b/deps/openssl/openssl/util/lock-contention-graph.sh
new file mode 100755
index 00000000000..e9e252d3082
--- /dev/null
+++ b/deps/openssl/openssl/util/lock-contention-graph.sh
@@ -0,0 +1,133 @@
+#!/bin/bash -eu
+# Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").
+# You may not use this file except in compliance with the License.
+# You can obtain a copy in the file LICENSE in the source distribution
+# or at https://www.openssl.org/source/license.html
+#
+# Script to graph logs produced by REPORT_RWLOCK_CONTENTION vs time
+# Usage: ./lock-contention-graph.sh <logfile> <labels>
+#
+# Parameters:
+# logfile - output file from REPORT_RWLOCK_CONTENTION
+# labels - optional value to add timestamp markers to contention event edges
+#          for correlation with log file timestamps
+# Output:
+# The displayed graph is plots application run time on the x axis in
+# microseconds, with the y axis representing contention events for each
+# found thread individually as a unit step function.
+#
+# i.e. thread 1 toggles between the values 0 and 1, with 0 representing
+# no contention, and 1 representing waiting on a lock.  Thread 2 is offset
+# on the y axis by 1, toggling between 2 and 3, with the former representing no
+# contention, and 3 representing waiting on a lock to become available.
+###################################################################
+
+TEMPDIR=$(mktemp -d /tmp/contentiongraph.XXXXXX)
+LOGFILE=$1
+LABELS=$2
+
+trap "rm -rf $TEMPDIR" EXIT
+
+if [ ! -f $LOGFILE ]
+then
+    echo "No log file found" > /dev/stderr
+    exit 1
+fi
+LOGFILEBASE=$(basename $LOGFILE)
+
+mkdir -p $TEMPDIR/tids/
+
+#
+# Gather all our tids
+#
+declare -a filelines
+declare -a sorted_lines
+
+declare -a attimes
+declare -a unblocktimes
+declare -a levels
+
+let offset=0
+
+for i in $(cat $LOGFILE | grep "lock blocked" $LOGFILE | awk '{print $12}' | sort | uniq); do
+    filelines=()
+    sorted_lines=()
+    mapfile -t filelines < <(cat $LOGFILE | grep "tid $i")
+    IFS=$'\n' sorted_lines=($(sort -k 10 -n <<<"${filelines[*]}"))
+    unset IFS
+
+    attimes=()
+    unblocktimes=()
+    levels=()
+    rawtime=()
+    let up=$offset+1
+    let down=$offset
+    let firsttime=0
+    echo "Processing tid $i"
+    for LINE in "${sorted_lines[@]}"; do
+        DURATION=$(echo $LINE | awk '{print $6}')
+        ATTIME=$(echo $LINE | awk '{print $10}')
+        UNBLOCKTIME=$(dc -e "$ATTIME $DURATION + p")
+        if [ $firsttime -eq 0 ]; then
+            let firsttime=$ATTIME
+        fi
+        rawtime+=($ATTIME)
+        ATTIME=$(dc -e"$ATTIME $firsttime - p")
+        UNBLOCKTIME=$(dc -e "$UNBLOCKTIME $firsttime - p")
+        attimes+=($ATTIME)
+        levels+=($down)
+        levels+=($up)
+        unblocktimes+=($UNBLOCKTIME)
+        levels+=($up)
+        levels+=($down)
+    done
+
+#
+# Write out our array to a file
+#
+    NUMELEMS=${#attimes[@]}
+    for j in $(seq 0 1 $NUMELEMS); do
+        let lvlidx=$j*4
+        echo "${attimes[$j]} ${levels[$lvlidx]} ${rawtime[$j]}" >> $TEMPDIR/tids/$i.data
+        let lvlidx=$lvlidx+1
+        echo "${attimes[$j]} ${levels[$lvlidx]}" >> $TEMPDIR/tids/$i.data
+        let lvlidx=$lvlidx+1
+        echo "${unblocktimes[$j]} ${levels[$lvlidx]}" >> $TEMPDIR/tids/$i.data
+        let lvlidx=$lvlidx+1
+        echo "${unblocktimes[$j]} ${levels[$lvlidx]}" >> $TEMPDIR/tids/$i.data
+    done
+
+    let offset=$offset+2
+done
+
+#
+# Now lets use gnuplot to plot all the contentions
+#
+cat << EOF > $TEMPDIR/gnuplot.script
+set term qt
+set format x '%.0f'
+set xlabel "usecs"
+set ylabel "contentions"
+set yrange [0:5]
+set xtics 10000
+set xrange [0:5000000]
+EOF
+
+echo -n "plot " >> $TEMPDIR/gnuplot.script
+
+for i in $(ls $TEMPDIR/tids/*.data)
+do
+    TITLE=$(basename $i)
+    echo -n "\"$i\" using 1:2 with lines title \"tid $TITLE\", " >> $TEMPDIR/gnuplot.script
+    if [ -n "$LABELS" ]; then
+        echo -n "\"$i\" using 1:2:3 with labels offset 0, char 1 notitle, " >> $TEMPDIR/gnuplot.script
+    fi
+done
+
+echo "" >> $TEMPDIR/gnuplot.script
+echo "pause -1" >> $TEMPDIR/gnuplot.script
+
+gnuplot $TEMPDIR/gnuplot.script
+
diff --git a/deps/openssl/openssl/util/markdownlint.rb b/deps/openssl/openssl/util/markdownlint.rb
index 2179f15999b..1b83b881d92 100644
--- a/deps/openssl/openssl/util/markdownlint.rb
+++ b/deps/openssl/openssl/util/markdownlint.rb
@@ -26,4 +26,5 @@ exclude_rule 'MD025' # Multiple top level headers in the same document
 exclude_rule 'MD026' # Trailing punctuation in header
 exclude_rule 'MD029' # Ordered list item prefix
 exclude_rule 'MD030' # Spaces after list markers (default: 1!)
+exclude_rule 'MD032' # List surrounded by blanks check is buggy
 exclude_rule 'MD033' # Allow inline HTML (complex tables are impossible without it)
diff --git a/deps/openssl/openssl/util/missingcrypto.txt b/deps/openssl/openssl/util/missingcrypto.txt
index 2059b9414ab..7a489a1b6a6 100644
--- a/deps/openssl/openssl/util/missingcrypto.txt
+++ b/deps/openssl/openssl/util/missingcrypto.txt
@@ -20,16 +20,7 @@ ASIdOrRange_it(3)
 ASIdentifierChoice_it(3)
 ASIdentifiers_it(3)
 ASN1_ANY_it(3)
-ASN1_BIT_STRING_check(3)
-ASN1_BIT_STRING_free(3)
-ASN1_BIT_STRING_get_bit(3)
 ASN1_BIT_STRING_it(3)
-ASN1_BIT_STRING_name_print(3)
-ASN1_BIT_STRING_new(3)
-ASN1_BIT_STRING_num_asc(3)
-ASN1_BIT_STRING_set(3)
-ASN1_BIT_STRING_set_asc(3)
-ASN1_BIT_STRING_set_bit(3)
 ASN1_BMPSTRING_free(3)
 ASN1_BMPSTRING_it(3)
 ASN1_BMPSTRING_new(3)
@@ -186,7 +177,6 @@ BIO_dup_chain(3)
 BIO_f_asn1(3)
 BIO_f_linebuffer(3)
 BIO_f_nbio_test(3)
-BIO_f_reliable(3)
 BIO_fd_non_fatal_error(3)
 BIO_fd_should_retry(3)
 BIO_get_accept_socket(3)
@@ -282,7 +272,6 @@ CMS_RecipientEncryptedKey_get0_id(3)
 CMS_RecipientInfo_get0_pkey_ctx(3)
 CMS_RecipientInfo_kari_decrypt(3)
 CMS_RecipientInfo_kari_get0_alg(3)
-CMS_RecipientInfo_kari_get0_ctx(3)
 CMS_RecipientInfo_kari_get0_orig_id(3)
 CMS_RecipientInfo_kari_get0_reks(3)
 CMS_RecipientInfo_kari_orig_id_cmp(3)
@@ -293,16 +282,10 @@ CMS_SignedData_init(3)
 CMS_SignerInfo_get0_algs(3)
 CMS_SignerInfo_get0_md_ctx(3)
 CMS_SignerInfo_get0_pkey_ctx(3)
-CMS_SignerInfo_verify(3)
-CMS_SignerInfo_verify_content(3)
 CMS_add0_CertificateChoices(3)
 CMS_add0_RevocationInfoChoice(3)
 CMS_add0_recipient_password(3)
-CMS_add_simple_smimecap(3)
-CMS_add_smimecap(3)
-CMS_add_standard_smimecap(3)
 CMS_data(3)
-CMS_dataFinal(3)
 CMS_dataInit(3)
 CMS_decrypt_set1_key(3)
 CMS_digest_verify(3)
@@ -377,7 +360,6 @@ CRYPTO_gcm128_tag(3)
 CRYPTO_mem_debug_free(3)
 CRYPTO_mem_debug_malloc(3)
 CRYPTO_mem_debug_realloc(3)
-CRYPTO_memdup(3)
 CRYPTO_nistcts128_decrypt(3)
 CRYPTO_nistcts128_decrypt_block(3)
 CRYPTO_nistcts128_encrypt(3)
@@ -393,7 +375,6 @@ CRYPTO_ocb128_new(3)
 CRYPTO_ocb128_setiv(3)
 CRYPTO_ocb128_tag(3)
 CRYPTO_ofb128_encrypt(3)
-CRYPTO_secure_actual_size(3)
 CRYPTO_xts128_encrypt(3)
 Camellia_cbc_encrypt(3)
 Camellia_cfb128_encrypt(3)
@@ -414,7 +395,6 @@ DES_encrypt2(3)
 DES_encrypt3(3)
 DES_options(3)
 DH_KDF_X9_42(3)
-DH_check_pub_key(3)
 DH_up_ref(3)
 DHparams_dup(3)
 DHparams_it(3)
@@ -466,8 +446,6 @@ EC_KEY_new_method(3)
 EC_KEY_print(3)
 EC_KEY_print_fp(3)
 EC_KEY_set_default_method(3)
-EC_curve_nid2nist(3)
-EC_curve_nist2nid(3)
 EDIPARTYNAME_it(3)
 ENGINE_get_EC(3)
 ENGINE_get_default_EC(3)
@@ -499,7 +477,6 @@ ENGINE_setup_bsd_cryptodev(3)
 ENGINE_unregister_EC(3)
 ENGINE_unregister_pkey_asn1_meths(3)
 ENGINE_unregister_pkey_meths(3)
-ERR_get_state(3)
 ERR_load_ASN1_strings(3)
 ERR_load_ASYNC_strings(3)
 ERR_load_BIO_strings(3)
@@ -783,7 +760,6 @@ PKCS7_ctrl(3)
 PKCS7_dataDecode(3)
 PKCS7_dataFinal(3)
 PKCS7_dataInit(3)
-PKCS7_dataVerify(3)
 PKCS7_digest_from_attributes(3)
 PKCS7_final(3)
 PKCS7_get_attribute(3)
@@ -1118,7 +1094,6 @@ X509_STORE_CTX_get_explicit_policy(3)
 X509_STORE_CTX_set0_dane(3)
 X509_STORE_CTX_set_depth(3)
 X509_STORE_CTX_set_flags(3)
-X509_STORE_CTX_set_time(3)
 X509_STORE_get_verify(3)
 X509_TRUST_add(3)
 X509_TRUST_cleanup(3)
@@ -1150,7 +1125,6 @@ X509_alias_set1(3)
 X509_aux_print(3)
 X509_certificate_type(3)
 X509_chain_check_suiteb(3)
-X509_check_akid(3)
 X509_check_trust(3)
 X509_email_free(3)
 X509_find_by_issuer_and_serial(3)
diff --git a/deps/openssl/openssl/util/missingcrypto111.txt b/deps/openssl/openssl/util/missingcrypto111.txt
deleted file mode 100644
index b6068ec0928..00000000000
--- a/deps/openssl/openssl/util/missingcrypto111.txt
+++ /dev/null
@@ -1,1738 +0,0 @@
-# A list of libcrypto functions that are known to be missing documentation as
-# used by the find-doc-nits -v -o option. The list is as of commit 1708e3e85b
-# (the release of 1.1.1).
-ACCESS_DESCRIPTION_it(3)
-ACCESS_DESCRIPTION_it(3)
-ADMISSIONS_it(3)
-ADMISSIONS_it(3)
-ADMISSION_SYNTAX_it(3)
-ADMISSION_SYNTAX_it(3)
-AES_bi_ige_encrypt(3)
-AES_cbc_encrypt(3)
-AES_cfb128_encrypt(3)
-AES_cfb1_encrypt(3)
-AES_cfb8_encrypt(3)
-AES_decrypt(3)
-AES_ecb_encrypt(3)
-AES_encrypt(3)
-AES_ige_encrypt(3)
-AES_ofb128_encrypt(3)
-AES_options(3)
-AES_set_decrypt_key(3)
-AES_set_encrypt_key(3)
-AES_unwrap_key(3)
-AES_wrap_key(3)
-ASIdOrRange_it(3)
-ASIdOrRange_it(3)
-ASIdentifierChoice_it(3)
-ASIdentifierChoice_it(3)
-ASIdentifiers_it(3)
-ASIdentifiers_it(3)
-ASN1_ANY_it(3)
-ASN1_BIT_STRING_check(3)
-ASN1_BIT_STRING_free(3)
-ASN1_BIT_STRING_get_bit(3)
-ASN1_BIT_STRING_it(3)
-ASN1_BIT_STRING_name_print(3)
-ASN1_BIT_STRING_new(3)
-ASN1_BIT_STRING_num_asc(3)
-ASN1_BIT_STRING_set(3)
-ASN1_BIT_STRING_set_asc(3)
-ASN1_BIT_STRING_set_bit(3)
-ASN1_BMPSTRING_free(3)
-ASN1_BMPSTRING_it(3)
-ASN1_BMPSTRING_new(3)
-ASN1_BOOLEAN_it(3)
-ASN1_ENUMERATED_free(3)
-ASN1_ENUMERATED_it(3)
-ASN1_ENUMERATED_new(3)
-ASN1_FBOOLEAN_it(3)
-ASN1_GENERALIZEDTIME_free(3)
-ASN1_GENERALIZEDTIME_it(3)
-ASN1_GENERALIZEDTIME_new(3)
-ASN1_GENERALSTRING_free(3)
-ASN1_GENERALSTRING_it(3)
-ASN1_GENERALSTRING_new(3)
-ASN1_IA5STRING_free(3)
-ASN1_IA5STRING_it(3)
-ASN1_IA5STRING_new(3)
-ASN1_INTEGER_cmp(3)
-ASN1_INTEGER_dup(3)
-ASN1_INTEGER_free(3)
-ASN1_INTEGER_it(3)
-ASN1_INTEGER_new(3)
-ASN1_NULL_free(3)
-ASN1_NULL_it(3)
-ASN1_NULL_new(3)
-ASN1_OBJECT_create(3)
-ASN1_OBJECT_it(3)
-ASN1_OCTET_STRING_NDEF_it(3)
-ASN1_OCTET_STRING_cmp(3)
-ASN1_OCTET_STRING_dup(3)
-ASN1_OCTET_STRING_free(3)
-ASN1_OCTET_STRING_it(3)
-ASN1_OCTET_STRING_new(3)
-ASN1_OCTET_STRING_set(3)
-ASN1_PCTX_free(3)
-ASN1_PCTX_get_cert_flags(3)
-ASN1_PCTX_get_flags(3)
-ASN1_PCTX_get_nm_flags(3)
-ASN1_PCTX_get_oid_flags(3)
-ASN1_PCTX_get_str_flags(3)
-ASN1_PCTX_new(3)
-ASN1_PCTX_set_cert_flags(3)
-ASN1_PCTX_set_flags(3)
-ASN1_PCTX_set_nm_flags(3)
-ASN1_PCTX_set_oid_flags(3)
-ASN1_PCTX_set_str_flags(3)
-ASN1_PRINTABLESTRING_free(3)
-ASN1_PRINTABLESTRING_it(3)
-ASN1_PRINTABLESTRING_new(3)
-ASN1_PRINTABLE_free(3)
-ASN1_PRINTABLE_it(3)
-ASN1_PRINTABLE_new(3)
-ASN1_PRINTABLE_type(3)
-ASN1_SCTX_free(3)
-ASN1_SCTX_get_app_data(3)
-ASN1_SCTX_get_flags(3)
-ASN1_SCTX_get_item(3)
-ASN1_SCTX_get_template(3)
-ASN1_SCTX_new(3)
-ASN1_SCTX_set_app_data(3)
-ASN1_SEQUENCE_ANY_it(3)
-ASN1_SEQUENCE_it(3)
-ASN1_SET_ANY_it(3)
-ASN1_STRING_clear_free(3)
-ASN1_STRING_copy(3)
-ASN1_STRING_get_default_mask(3)
-ASN1_STRING_length_set(3)
-ASN1_STRING_set0(3)
-ASN1_STRING_set_by_NID(3)
-ASN1_STRING_set_default_mask(3)
-ASN1_STRING_set_default_mask_asc(3)
-ASN1_T61STRING_free(3)
-ASN1_T61STRING_it(3)
-ASN1_T61STRING_new(3)
-ASN1_TBOOLEAN_it(3)
-ASN1_TIME_free(3)
-ASN1_TIME_it(3)
-ASN1_TIME_new(3)
-ASN1_TYPE_free(3)
-ASN1_TYPE_get_int_octetstring(3)
-ASN1_TYPE_get_octetstring(3)
-ASN1_TYPE_new(3)
-ASN1_TYPE_set_int_octetstring(3)
-ASN1_TYPE_set_octetstring(3)
-ASN1_UNIVERSALSTRING_free(3)
-ASN1_UNIVERSALSTRING_it(3)
-ASN1_UNIVERSALSTRING_new(3)
-ASN1_UNIVERSALSTRING_to_string(3)
-ASN1_UTCTIME_free(3)
-ASN1_UTCTIME_it(3)
-ASN1_UTCTIME_new(3)
-ASN1_UTF8STRING_free(3)
-ASN1_UTF8STRING_it(3)
-ASN1_UTF8STRING_new(3)
-ASN1_VISIBLESTRING_free(3)
-ASN1_VISIBLESTRING_it(3)
-ASN1_VISIBLESTRING_new(3)
-ASN1_add_stable_module(3)
-ASN1_bn_print(3)
-ASN1_buf_print(3)
-ASN1_check_infinite_end(3)
-ASN1_const_check_infinite_end(3)
-ASN1_d2i_bio(3)
-ASN1_d2i_fp(3)
-ASN1_digest(3)
-ASN1_dup(3)
-ASN1_get_object(3)
-ASN1_i2d_bio(3)
-ASN1_i2d_fp(3)
-ASN1_item_d2i(3)
-ASN1_item_d2i_bio(3)
-ASN1_item_d2i_fp(3)
-ASN1_item_digest(3)
-ASN1_item_dup(3)
-ASN1_item_ex_d2i(3)
-ASN1_item_ex_free(3)
-ASN1_item_ex_i2d(3)
-ASN1_item_ex_new(3)
-ASN1_item_free(3)
-ASN1_item_i2d(3)
-ASN1_item_i2d_bio(3)
-ASN1_item_i2d_fp(3)
-ASN1_item_ndef_i2d(3)
-ASN1_item_new(3)
-ASN1_item_pack(3)
-ASN1_item_print(3)
-ASN1_item_sign(3)
-ASN1_item_sign_ctx(3)
-ASN1_item_unpack(3)
-ASN1_item_verify(3)
-ASN1_mbstring_copy(3)
-ASN1_mbstring_ncopy(3)
-ASN1_object_size(3)
-ASN1_parse(3)
-ASN1_parse_dump(3)
-ASN1_put_eoc(3)
-ASN1_put_object(3)
-ASN1_sign(3)
-ASN1_str2mask(3)
-ASN1_tag2bit(3)
-ASN1_verify(3)
-ASRange_it(3)
-AUTHORITY_INFO_ACCESS_it(3)
-AUTHORITY_INFO_ACCESS_it(3)
-AUTHORITY_KEYID_it(3)
-AUTHORITY_KEYID_it(3)
-BASIC_CONSTRAINTS_it(3)
-BASIC_CONSTRAINTS_it(3)
-BIGNUM_it(3)
-BIGNUM_it(3)
-BIO_accept(3)
-BIO_asn1_get_prefix(3)
-BIO_asn1_get_suffix(3)
-BIO_asn1_set_prefix(3)
-BIO_asn1_set_suffix(3)
-BIO_clear_flags(3)
-BIO_copy_next_retry(3)
-BIO_dgram_is_sctp(3)
-BIO_dgram_non_fatal_error(3)
-BIO_dgram_sctp_msg_waiting(3)
-BIO_dgram_sctp_notification_cb(3)
-BIO_dgram_sctp_wait_for_dry(3)
-BIO_dump(3)
-BIO_dump_cb(3)
-BIO_dump_fp(3)
-BIO_dump_indent(3)
-BIO_dump_indent_cb(3)
-BIO_dump_indent_fp(3)
-BIO_dup_chain(3)
-BIO_f_asn1(3)
-BIO_f_linebuffer(3)
-BIO_f_nbio_test(3)
-BIO_f_reliable(3)
-BIO_f_zlib(3)
-BIO_fd_non_fatal_error(3)
-BIO_fd_should_retry(3)
-BIO_get_accept_socket(3)
-BIO_get_host_ip(3)
-BIO_get_port(3)
-BIO_gethostbyname(3)
-BIO_hex_string(3)
-BIO_indent(3)
-BIO_method_name(3)
-BIO_new_NDEF(3)
-BIO_new_PKCS7(3)
-BIO_new_dgram(3)
-BIO_new_dgram_sctp(3)
-BIO_number_read(3)
-BIO_number_written(3)
-BIO_s_datagram(3)
-BIO_s_datagram_sctp(3)
-BIO_s_log(3)
-BIO_set_flags(3)
-BIO_set_tcp_ndelay(3)
-BIO_sock_error(3)
-BIO_sock_info(3)
-BIO_sock_init(3)
-BIO_sock_non_fatal_error(3)
-BIO_sock_should_retry(3)
-BIO_socket_ioctl(3)
-BIO_socket_nbio(3)
-BIO_test_flags(3)
-BN_GF2m_add(3)
-BN_GF2m_arr2poly(3)
-BN_GF2m_mod(3)
-BN_GF2m_mod_arr(3)
-BN_GF2m_mod_div(3)
-BN_GF2m_mod_div_arr(3)
-BN_GF2m_mod_exp(3)
-BN_GF2m_mod_exp_arr(3)
-BN_GF2m_mod_inv(3)
-BN_GF2m_mod_inv_arr(3)
-BN_GF2m_mod_mul(3)
-BN_GF2m_mod_mul_arr(3)
-BN_GF2m_mod_solve_quad(3)
-BN_GF2m_mod_solve_quad_arr(3)
-BN_GF2m_mod_sqr(3)
-BN_GF2m_mod_sqr_arr(3)
-BN_GF2m_mod_sqrt(3)
-BN_GF2m_mod_sqrt_arr(3)
-BN_GF2m_poly2arr(3)
-BN_MONT_CTX_set_locked(3)
-BN_X931_derive_prime_ex(3)
-BN_X931_generate_Xpq(3)
-BN_X931_generate_prime_ex(3)
-BN_abs_is_word(3)
-BN_asc2bn(3)
-BN_bntest_rand(3)
-BN_consttime_swap(3)
-BN_generate_dsa_nonce(3)
-BN_get_flags(3)
-BN_get_params(3)
-BN_is_negative(3)
-BN_kronecker(3)
-BN_mod_add_quick(3)
-BN_mod_exp2_mont(3)
-BN_mod_exp_mont(3)
-BN_mod_exp_mont_consttime(3)
-BN_mod_exp_mont_word(3)
-BN_mod_exp_recp(3)
-BN_mod_exp_simple(3)
-BN_mod_lshift(3)
-BN_mod_lshift1(3)
-BN_mod_lshift1_quick(3)
-BN_mod_lshift_quick(3)
-BN_mod_sqrt(3)
-BN_mod_sub_quick(3)
-BN_nist_mod_192(3)
-BN_nist_mod_224(3)
-BN_nist_mod_256(3)
-BN_nist_mod_384(3)
-BN_nist_mod_521(3)
-BN_nist_mod_func(3)
-BN_options(3)
-BN_reciprocal(3)
-BN_set_flags(3)
-BN_set_negative(3)
-BN_set_params(3)
-BN_uadd(3)
-BN_usub(3)
-BN_zero_ex(3)
-CAST_cbc_encrypt(3)
-CAST_cfb64_encrypt(3)
-CAST_decrypt(3)
-CAST_ecb_encrypt(3)
-CAST_encrypt(3)
-CAST_ofb64_encrypt(3)
-CAST_set_key(3)
-CBIGNUM_it(3)
-CBIGNUM_it(3)
-CERTIFICATEPOLICIES_it(3)
-CERTIFICATEPOLICIES_it(3)
-CMAC_CTX_cleanup(3)
-CMAC_CTX_copy(3)
-CMAC_CTX_free(3)
-CMAC_CTX_get0_cipher_ctx(3)
-CMAC_CTX_new(3)
-CMAC_Final(3)
-CMAC_Init(3)
-CMAC_Update(3)
-CMAC_resume(3)
-CMS_ContentInfo_it(3)
-CMS_ContentInfo_it(3)
-CMS_EncryptedData_decrypt(3)
-CMS_EncryptedData_encrypt(3)
-CMS_EncryptedData_set1_key(3)
-CMS_EnvelopedData_create(3)
-CMS_ReceiptRequest_it(3)
-CMS_ReceiptRequest_it(3)
-CMS_RecipientEncryptedKey_cert_cmp(3)
-CMS_RecipientEncryptedKey_get0_id(3)
-CMS_RecipientInfo_get0_pkey_ctx(3)
-CMS_RecipientInfo_kari_decrypt(3)
-CMS_RecipientInfo_kari_get0_alg(3)
-CMS_RecipientInfo_kari_get0_ctx(3)
-CMS_RecipientInfo_kari_get0_orig_id(3)
-CMS_RecipientInfo_kari_get0_reks(3)
-CMS_RecipientInfo_kari_orig_id_cmp(3)
-CMS_RecipientInfo_kari_set0_pkey(3)
-CMS_RecipientInfo_ktri_get0_algs(3)
-CMS_RecipientInfo_set0_password(3)
-CMS_SharedInfo_encode(3)
-CMS_SignedData_init(3)
-CMS_SignerInfo_get0_algs(3)
-CMS_SignerInfo_get0_md_ctx(3)
-CMS_SignerInfo_get0_pkey_ctx(3)
-CMS_SignerInfo_verify(3)
-CMS_SignerInfo_verify_content(3)
-CMS_add0_CertificateChoices(3)
-CMS_add0_RevocationInfoChoice(3)
-CMS_add0_recipient_password(3)
-CMS_add_simple_smimecap(3)
-CMS_add_smimecap(3)
-CMS_add_standard_smimecap(3)
-CMS_data(3)
-CMS_dataFinal(3)
-CMS_dataInit(3)
-CMS_data_create(3)
-CMS_decrypt_set1_key(3)
-CMS_decrypt_set1_password(3)
-CMS_decrypt_set1_pkey(3)
-CMS_digest_create(3)
-CMS_digest_verify(3)
-CMS_is_detached(3)
-CMS_set1_signers_certs(3)
-CMS_set_detached(3)
-CMS_signed_add1_attr(3)
-CMS_signed_add1_attr_by_NID(3)
-CMS_signed_add1_attr_by_OBJ(3)
-CMS_signed_add1_attr_by_txt(3)
-CMS_signed_delete_attr(3)
-CMS_signed_get0_data_by_OBJ(3)
-CMS_signed_get_attr(3)
-CMS_signed_get_attr_by_NID(3)
-CMS_signed_get_attr_by_OBJ(3)
-CMS_signed_get_attr_count(3)
-CMS_stream(3)
-CMS_unsigned_add1_attr(3)
-CMS_unsigned_add1_attr_by_NID(3)
-CMS_unsigned_add1_attr_by_OBJ(3)
-CMS_unsigned_add1_attr_by_txt(3)
-CMS_unsigned_delete_attr(3)
-CMS_unsigned_get0_data_by_OBJ(3)
-CMS_unsigned_get_attr(3)
-CMS_unsigned_get_attr_by_NID(3)
-CMS_unsigned_get_attr_by_OBJ(3)
-CMS_unsigned_get_attr_count(3)
-COMP_CTX_free(3)
-COMP_CTX_get_method(3)
-COMP_CTX_get_type(3)
-COMP_CTX_new(3)
-COMP_compress_block(3)
-COMP_expand_block(3)
-COMP_get_name(3)
-COMP_get_type(3)
-COMP_zlib(3)
-CONF_dump_bio(3)
-CONF_dump_fp(3)
-CONF_free(3)
-CONF_get_number(3)
-CONF_get_section(3)
-CONF_get_string(3)
-CONF_imodule_get_flags(3)
-CONF_imodule_get_module(3)
-CONF_imodule_get_name(3)
-CONF_imodule_get_usr_data(3)
-CONF_imodule_get_value(3)
-CONF_imodule_set_flags(3)
-CONF_imodule_set_usr_data(3)
-CONF_load(3)
-CONF_load_bio(3)
-CONF_load_fp(3)
-CONF_module_add(3)
-CONF_module_get_usr_data(3)
-CONF_module_set_usr_data(3)
-CONF_parse_list(3)
-CONF_set_default_method(3)
-CONF_set_nconf(3)
-CRL_DIST_POINTS_it(3)
-CRL_DIST_POINTS_it(3)
-CRYPTO_128_unwrap(3)
-CRYPTO_128_unwrap_pad(3)
-CRYPTO_128_wrap(3)
-CRYPTO_128_wrap_pad(3)
-CRYPTO_THREAD_cleanup_local(3)
-CRYPTO_THREAD_compare_id(3)
-CRYPTO_THREAD_get_current_id(3)
-CRYPTO_THREAD_get_local(3)
-CRYPTO_THREAD_init_local(3)
-CRYPTO_THREAD_set_local(3)
-CRYPTO_cbc128_decrypt(3)
-CRYPTO_cbc128_encrypt(3)
-CRYPTO_ccm128_aad(3)
-CRYPTO_ccm128_decrypt(3)
-CRYPTO_ccm128_decrypt_ccm64(3)
-CRYPTO_ccm128_encrypt(3)
-CRYPTO_ccm128_encrypt_ccm64(3)
-CRYPTO_ccm128_init(3)
-CRYPTO_ccm128_setiv(3)
-CRYPTO_ccm128_tag(3)
-CRYPTO_cfb128_1_encrypt(3)
-CRYPTO_cfb128_8_encrypt(3)
-CRYPTO_cfb128_encrypt(3)
-CRYPTO_ctr128_encrypt(3)
-CRYPTO_ctr128_encrypt_ctr32(3)
-CRYPTO_cts128_decrypt(3)
-CRYPTO_cts128_decrypt_block(3)
-CRYPTO_cts128_encrypt(3)
-CRYPTO_cts128_encrypt_block(3)
-CRYPTO_dup_ex_data(3)
-CRYPTO_gcm128_aad(3)
-CRYPTO_gcm128_decrypt(3)
-CRYPTO_gcm128_decrypt_ctr32(3)
-CRYPTO_gcm128_encrypt(3)
-CRYPTO_gcm128_encrypt_ctr32(3)
-CRYPTO_gcm128_finish(3)
-CRYPTO_gcm128_init(3)
-CRYPTO_gcm128_new(3)
-CRYPTO_gcm128_release(3)
-CRYPTO_gcm128_setiv(3)
-CRYPTO_gcm128_tag(3)
-CRYPTO_mem_debug_free(3)
-CRYPTO_mem_debug_malloc(3)
-CRYPTO_mem_debug_realloc(3)
-CRYPTO_memdup(3)
-CRYPTO_nistcts128_decrypt(3)
-CRYPTO_nistcts128_decrypt_block(3)
-CRYPTO_nistcts128_encrypt(3)
-CRYPTO_nistcts128_encrypt_block(3)
-CRYPTO_ocb128_aad(3)
-CRYPTO_ocb128_cleanup(3)
-CRYPTO_ocb128_copy_ctx(3)
-CRYPTO_ocb128_decrypt(3)
-CRYPTO_ocb128_encrypt(3)
-CRYPTO_ocb128_finish(3)
-CRYPTO_ocb128_init(3)
-CRYPTO_ocb128_new(3)
-CRYPTO_ocb128_setiv(3)
-CRYPTO_ocb128_tag(3)
-CRYPTO_ofb128_encrypt(3)
-CRYPTO_secure_actual_size(3)
-CRYPTO_xts128_encrypt(3)
-Camellia_cbc_encrypt(3)
-Camellia_cfb128_encrypt(3)
-Camellia_cfb1_encrypt(3)
-Camellia_cfb8_encrypt(3)
-Camellia_ctr128_encrypt(3)
-Camellia_decrypt(3)
-Camellia_ecb_encrypt(3)
-Camellia_encrypt(3)
-Camellia_ofb128_encrypt(3)
-Camellia_set_key(3)
-DES_cbc_encrypt(3)
-DES_check_key_parity(3)
-DES_decrypt3(3)
-DES_ede3_cfb_encrypt(3)
-DES_encrypt1(3)
-DES_encrypt2(3)
-DES_encrypt3(3)
-DES_options(3)
-DH_KDF_X9_42(3)
-DH_check_pub_key(3)
-DH_compute_key_padded(3)
-DH_up_ref(3)
-DHparams_dup(3)
-DHparams_it(3)
-DHparams_it(3)
-DIRECTORYSTRING_it(3)
-DIRECTORYSTRING_it(3)
-DISPLAYTEXT_it(3)
-DISPLAYTEXT_it(3)
-DIST_POINT_NAME_it(3)
-DIST_POINT_NAME_it(3)
-DIST_POINT_it(3)
-DIST_POINT_it(3)
-DIST_POINT_set_dpname(3)
-DSA_get_method(3)
-DSA_up_ref(3)
-DSO_METHOD_openssl(3)
-DSO_bind_func(3)
-DSO_convert_filename(3)
-DSO_ctrl(3)
-DSO_dsobyaddr(3)
-DSO_flags(3)
-DSO_free(3)
-DSO_get_filename(3)
-DSO_global_lookup(3)
-DSO_load(3)
-DSO_merge(3)
-DSO_new(3)
-DSO_pathbyaddr(3)
-DSO_set_filename(3)
-DSO_up_ref(3)
-ECDH_KDF_X9_62(3)
-ECDH_compute_key(3)
-ECPARAMETERS_it(3)
-ECPARAMETERS_it(3)
-ECPKPARAMETERS_it(3)
-ECPKPARAMETERS_it(3)
-ECParameters_print(3)
-ECParameters_print_fp(3)
-EC_GROUP_get_mont_data(3)
-EC_KEY_METHOD_free(3)
-EC_KEY_METHOD_get_compute_key(3)
-EC_KEY_METHOD_get_init(3)
-EC_KEY_METHOD_get_keygen(3)
-EC_KEY_METHOD_get_sign(3)
-EC_KEY_METHOD_get_verify(3)
-EC_KEY_METHOD_new(3)
-EC_KEY_METHOD_set_compute_key(3)
-EC_KEY_METHOD_set_init(3)
-EC_KEY_METHOD_set_keygen(3)
-EC_KEY_METHOD_set_sign(3)
-EC_KEY_METHOD_set_verify(3)
-EC_KEY_OpenSSL(3)
-EC_KEY_can_sign(3)
-EC_KEY_get_default_method(3)
-EC_KEY_new_method(3)
-EC_KEY_print(3)
-EC_KEY_print_fp(3)
-EC_KEY_set_default_method(3)
-EC_curve_nid2nist(3)
-EC_curve_nist2nid(3)
-EDIPARTYNAME_it(3)
-EDIPARTYNAME_it(3)
-ENGINE_get_EC(3)
-ENGINE_get_default_EC(3)
-ENGINE_get_pkey_asn1_meth(3)
-ENGINE_get_pkey_asn1_meth_engine(3)
-ENGINE_get_pkey_asn1_meth_str(3)
-ENGINE_get_pkey_asn1_meths(3)
-ENGINE_get_pkey_meth(3)
-ENGINE_get_pkey_meth_engine(3)
-ENGINE_get_pkey_meths(3)
-ENGINE_get_ssl_client_cert_function(3)
-ENGINE_get_static_state(3)
-ENGINE_load_ssl_client_cert(3)
-ENGINE_pkey_asn1_find_str(3)
-ENGINE_register_EC(3)
-ENGINE_register_all_EC(3)
-ENGINE_register_all_pkey_asn1_meths(3)
-ENGINE_register_all_pkey_meths(3)
-ENGINE_register_pkey_asn1_meths(3)
-ENGINE_register_pkey_meths(3)
-ENGINE_set_EC(3)
-ENGINE_set_default_EC(3)
-ENGINE_set_default_pkey_asn1_meths(3)
-ENGINE_set_default_pkey_meths(3)
-ENGINE_set_load_ssl_client_cert_function(3)
-ENGINE_set_pkey_asn1_meths(3)
-ENGINE_set_pkey_meths(3)
-ENGINE_setup_bsd_cryptodev(3)
-ENGINE_unregister_EC(3)
-ENGINE_unregister_pkey_asn1_meths(3)
-ENGINE_unregister_pkey_meths(3)
-ERR_clear_last_mark(3)
-ERR_get_state(3)
-ERR_load_ASN1_strings(3)
-ERR_load_ASYNC_strings(3)
-ERR_load_BIO_strings(3)
-ERR_load_BN_strings(3)
-ERR_load_BUF_strings(3)
-ERR_load_CMS_strings(3)
-ERR_load_COMP_strings(3)
-ERR_load_CONF_strings(3)
-ERR_load_CRYPTO_strings(3)
-ERR_load_CRYPTOlib_strings(3)
-ERR_load_CT_strings(3)
-ERR_load_DH_strings(3)
-ERR_load_DSA_strings(3)
-ERR_load_DSO_strings(3)
-ERR_load_EC_strings(3)
-ERR_load_ENGINE_strings(3)
-ERR_load_ERR_strings(3)
-ERR_load_EVP_strings(3)
-ERR_load_KDF_strings(3)
-ERR_load_OBJ_strings(3)
-ERR_load_OCSP_strings(3)
-ERR_load_OSSL_STORE_strings(3)
-ERR_load_PEM_strings(3)
-ERR_load_PKCS12_strings(3)
-ERR_load_PKCS7_strings(3)
-ERR_load_RAND_strings(3)
-ERR_load_RSA_strings(3)
-ERR_load_TS_strings(3)
-ERR_load_UI_strings(3)
-ERR_load_X509V3_strings(3)
-ERR_load_X509_strings(3)
-ERR_load_strings_const(3)
-ERR_set_error_data(3)
-ERR_unload_strings(3)
-EVP_CIPHER_CTX_buf_noconst(3)
-EVP_CIPHER_CTX_clear_flags(3)
-EVP_CIPHER_CTX_copy(3)
-EVP_CIPHER_CTX_encrypting(3)
-EVP_CIPHER_CTX_iv(3)
-EVP_CIPHER_CTX_iv_noconst(3)
-EVP_CIPHER_CTX_num(3)
-EVP_CIPHER_CTX_original_iv(3)
-EVP_CIPHER_CTX_rand_key(3)
-EVP_CIPHER_CTX_set_flags(3)
-EVP_CIPHER_CTX_set_num(3)
-EVP_CIPHER_CTX_test_flags(3)
-EVP_CIPHER_do_all(3)
-EVP_CIPHER_do_all_sorted(3)
-EVP_CIPHER_get_asn1_iv(3)
-EVP_CIPHER_impl_ctx_size(3)
-EVP_CIPHER_set_asn1_iv(3)
-EVP_Cipher(3)
-EVP_Digest(3)
-EVP_MD_CTX_pkey_ctx(3)
-EVP_MD_CTX_set_update_fn(3)
-EVP_MD_CTX_update_fn(3)
-EVP_MD_do_all(3)
-EVP_MD_do_all_sorted(3)
-EVP_MD_flags(3)
-EVP_PBE_CipherInit(3)
-EVP_PBE_alg_add(3)
-EVP_PBE_alg_add_type(3)
-EVP_PBE_cleanup(3)
-EVP_PBE_find(3)
-EVP_PBE_get(3)
-EVP_PBE_scrypt(3)
-EVP_PKCS82PKEY(3)
-EVP_PKEY2PKCS8(3)
-EVP_PKEY_CTX_ctrl_uint64(3)
-EVP_PKEY_CTX_get0_peerkey(3)
-EVP_PKEY_CTX_get0_pkey(3)
-EVP_PKEY_CTX_get_data(3)
-EVP_PKEY_CTX_get_operation(3)
-EVP_PKEY_CTX_hex2ctrl(3)
-EVP_PKEY_CTX_md(3)
-EVP_PKEY_CTX_set0_keygen_info(3)
-EVP_PKEY_CTX_set_data(3)
-EVP_PKEY_CTX_str2ctrl(3)
-EVP_PKEY_add1_attr(3)
-EVP_PKEY_add1_attr_by_NID(3)
-EVP_PKEY_add1_attr_by_OBJ(3)
-EVP_PKEY_add1_attr_by_txt(3)
-EVP_PKEY_assign(3)
-EVP_PKEY_bits(3)
-EVP_PKEY_decrypt_old(3)
-EVP_PKEY_delete_attr(3)
-EVP_PKEY_encrypt_old(3)
-EVP_PKEY_get0(3)
-EVP_PKEY_get0_poly1305(3)
-EVP_PKEY_get0_siphash(3)
-EVP_PKEY_get_attr(3)
-EVP_PKEY_get_attr_by_NID(3)
-EVP_PKEY_get_attr_by_OBJ(3)
-EVP_PKEY_get_attr_count(3)
-EVP_PKEY_save_parameters(3)
-EVP_PKEY_set_type(3)
-EVP_PKEY_set_type_str(3)
-EVP_add_alg_module(3)
-EVP_add_cipher(3)
-EVP_add_digest(3)
-EVP_aes_128_cfb128(3)
-EVP_aes_192_cfb128(3)
-EVP_aes_256_cfb128(3)
-EVP_aria_128_cfb128(3)
-EVP_aria_192_cfb128(3)
-EVP_aria_256_cfb128(3)
-EVP_bf_cfb64(3)
-EVP_camellia_128_cfb128(3)
-EVP_camellia_192_cfb128(3)
-EVP_camellia_256_cfb128(3)
-EVP_cast5_cfb64(3)
-EVP_des_cfb64(3)
-EVP_des_ede3_cfb64(3)
-EVP_des_ede3_ecb(3)
-EVP_des_ede_cfb64(3)
-EVP_des_ede_ecb(3)
-EVP_get_pw_prompt(3)
-EVP_idea_cfb64(3)
-EVP_md5_sha1(3)
-EVP_rc2_cfb64(3)
-EVP_rc5_32_12_16_cfb64(3)
-EVP_read_pw_string(3)
-EVP_read_pw_string_min(3)
-EVP_seed_cfb128(3)
-EVP_set_pw_prompt(3)
-EVP_sm4_cfb128(3)
-EXTENDED_KEY_USAGE_it(3)
-EXTENDED_KEY_USAGE_it(3)
-FIPS_mode(3)
-FIPS_mode_set(3)
-GENERAL_NAMES_it(3)
-GENERAL_NAMES_it(3)
-GENERAL_NAME_cmp(3)
-GENERAL_NAME_get0_otherName(3)
-GENERAL_NAME_get0_value(3)
-GENERAL_NAME_it(3)
-GENERAL_NAME_it(3)
-GENERAL_NAME_print(3)
-GENERAL_NAME_set0_othername(3)
-GENERAL_NAME_set0_value(3)
-GENERAL_SUBTREE_it(3)
-GENERAL_SUBTREE_it(3)
-IDEA_cbc_encrypt(3)
-IDEA_cfb64_encrypt(3)
-IDEA_ecb_encrypt(3)
-IDEA_encrypt(3)
-IDEA_ofb64_encrypt(3)
-IDEA_options(3)
-IDEA_set_decrypt_key(3)
-IDEA_set_encrypt_key(3)
-INT32_it(3)
-INT32_it(3)
-INT64_it(3)
-INT64_it(3)
-IPAddressChoice_it(3)
-IPAddressChoice_it(3)
-IPAddressFamily_it(3)
-IPAddressFamily_it(3)
-IPAddressOrRange_it(3)
-IPAddressOrRange_it(3)
-IPAddressRange_it(3)
-IPAddressRange_it(3)
-ISSUING_DIST_POINT_it(3)
-ISSUING_DIST_POINT_it(3)
-LONG_it(3)
-LONG_it(3)
-MD2_options(3)
-MD4_Transform(3)
-MD5_Transform(3)
-NAME_CONSTRAINTS_check(3)
-NAME_CONSTRAINTS_check_CN(3)
-NAME_CONSTRAINTS_it(3)
-NAME_CONSTRAINTS_it(3)
-NAMING_AUTHORITY_it(3)
-NAMING_AUTHORITY_it(3)
-NCONF_WIN32(3)
-NCONF_default(3)
-NCONF_dump_bio(3)
-NCONF_dump_fp(3)
-NCONF_free(3)
-NCONF_free_data(3)
-NCONF_get_number_e(3)
-NCONF_get_section(3)
-NCONF_get_string(3)
-NCONF_load(3)
-NCONF_load_bio(3)
-NCONF_load_fp(3)
-NCONF_new(3)
-NETSCAPE_CERT_SEQUENCE_it(3)
-NETSCAPE_CERT_SEQUENCE_it(3)
-NETSCAPE_SPKAC_it(3)
-NETSCAPE_SPKAC_it(3)
-NETSCAPE_SPKI_b64_decode(3)
-NETSCAPE_SPKI_b64_encode(3)
-NETSCAPE_SPKI_get_pubkey(3)
-NETSCAPE_SPKI_it(3)
-NETSCAPE_SPKI_it(3)
-NETSCAPE_SPKI_print(3)
-NETSCAPE_SPKI_set_pubkey(3)
-NETSCAPE_SPKI_sign(3)
-NETSCAPE_SPKI_verify(3)
-NOTICEREF_it(3)
-NOTICEREF_it(3)
-OBJ_NAME_add(3)
-OBJ_NAME_cleanup(3)
-OBJ_NAME_do_all(3)
-OBJ_NAME_do_all_sorted(3)
-OBJ_NAME_get(3)
-OBJ_NAME_init(3)
-OBJ_NAME_new_index(3)
-OBJ_NAME_remove(3)
-OBJ_add_object(3)
-OBJ_add_sigid(3)
-OBJ_bsearch_(3)
-OBJ_bsearch_ex_(3)
-OBJ_create_objects(3)
-OBJ_find_sigid_algs(3)
-OBJ_find_sigid_by_algs(3)
-OBJ_new_nid(3)
-OBJ_sigid_free(3)
-OCSP_BASICRESP_add1_ext_i2d(3)
-OCSP_BASICRESP_add_ext(3)
-OCSP_BASICRESP_delete_ext(3)
-OCSP_BASICRESP_get1_ext_d2i(3)
-OCSP_BASICRESP_get_ext(3)
-OCSP_BASICRESP_get_ext_by_NID(3)
-OCSP_BASICRESP_get_ext_by_OBJ(3)
-OCSP_BASICRESP_get_ext_by_critical(3)
-OCSP_BASICRESP_get_ext_count(3)
-OCSP_BASICRESP_it(3)
-OCSP_BASICRESP_it(3)
-OCSP_CERTID_it(3)
-OCSP_CERTID_it(3)
-OCSP_CERTSTATUS_it(3)
-OCSP_CERTSTATUS_it(3)
-OCSP_CRLID_it(3)
-OCSP_CRLID_it(3)
-OCSP_ONEREQ_add1_ext_i2d(3)
-OCSP_ONEREQ_add_ext(3)
-OCSP_ONEREQ_delete_ext(3)
-OCSP_ONEREQ_get1_ext_d2i(3)
-OCSP_ONEREQ_get_ext(3)
-OCSP_ONEREQ_get_ext_by_NID(3)
-OCSP_ONEREQ_get_ext_by_OBJ(3)
-OCSP_ONEREQ_get_ext_by_critical(3)
-OCSP_ONEREQ_get_ext_count(3)
-OCSP_ONEREQ_it(3)
-OCSP_ONEREQ_it(3)
-OCSP_REQINFO_it(3)
-OCSP_REQINFO_it(3)
-OCSP_REQUEST_add1_ext_i2d(3)
-OCSP_REQUEST_add_ext(3)
-OCSP_REQUEST_delete_ext(3)
-OCSP_REQUEST_get1_ext_d2i(3)
-OCSP_REQUEST_get_ext(3)
-OCSP_REQUEST_get_ext_by_NID(3)
-OCSP_REQUEST_get_ext_by_OBJ(3)
-OCSP_REQUEST_get_ext_by_critical(3)
-OCSP_REQUEST_get_ext_count(3)
-OCSP_REQUEST_it(3)
-OCSP_REQUEST_it(3)
-OCSP_REQUEST_print(3)
-OCSP_REQ_CTX_get0_mem_bio(3)
-OCSP_REQ_CTX_http(3)
-OCSP_REQ_CTX_i2d(3)
-OCSP_REQ_CTX_nbio(3)
-OCSP_REQ_CTX_nbio_d2i(3)
-OCSP_REQ_CTX_new(3)
-OCSP_RESPBYTES_it(3)
-OCSP_RESPBYTES_it(3)
-OCSP_RESPDATA_it(3)
-OCSP_RESPDATA_it(3)
-OCSP_RESPID_it(3)
-OCSP_RESPID_it(3)
-OCSP_RESPONSE_it(3)
-OCSP_RESPONSE_it(3)
-OCSP_RESPONSE_print(3)
-OCSP_REVOKEDINFO_it(3)
-OCSP_REVOKEDINFO_it(3)
-OCSP_SERVICELOC_it(3)
-OCSP_SERVICELOC_it(3)
-OCSP_SIGNATURE_it(3)
-OCSP_SIGNATURE_it(3)
-OCSP_SINGLERESP_add1_ext_i2d(3)
-OCSP_SINGLERESP_add_ext(3)
-OCSP_SINGLERESP_delete_ext(3)
-OCSP_SINGLERESP_get0_id(3)
-OCSP_SINGLERESP_get1_ext_d2i(3)
-OCSP_SINGLERESP_get_ext(3)
-OCSP_SINGLERESP_get_ext_by_NID(3)
-OCSP_SINGLERESP_get_ext_by_OBJ(3)
-OCSP_SINGLERESP_get_ext_by_critical(3)
-OCSP_SINGLERESP_get_ext_count(3)
-OCSP_SINGLERESP_it(3)
-OCSP_SINGLERESP_it(3)
-OCSP_accept_responses_new(3)
-OCSP_archive_cutoff_new(3)
-OCSP_basic_add1_cert(3)
-OCSP_basic_add1_status(3)
-OCSP_cert_status_str(3)
-OCSP_crlID2_new(3)
-OCSP_crlID_new(3)
-OCSP_crl_reason_str(3)
-OCSP_onereq_get0_id(3)
-OCSP_parse_url(3)
-OCSP_request_is_signed(3)
-OCSP_request_set1_name(3)
-OCSP_request_verify(3)
-OCSP_response_status_str(3)
-OCSP_url_svcloc_new(3)
-OPENSSL_DIR_end(3)
-OPENSSL_DIR_read(3)
-OPENSSL_LH_delete(3)
-OPENSSL_LH_doall(3)
-OPENSSL_LH_doall_arg(3)
-OPENSSL_LH_error(3)
-OPENSSL_LH_free(3)
-OPENSSL_LH_get_down_load(3)
-OPENSSL_LH_insert(3)
-OPENSSL_LH_new(3)
-OPENSSL_LH_num_items(3)
-OPENSSL_LH_retrieve(3)
-OPENSSL_LH_set_down_load(3)
-OPENSSL_LH_strhash(3)
-OPENSSL_asc2uni(3)
-OPENSSL_die(3)
-OPENSSL_gmtime(3)
-OPENSSL_gmtime_adj(3)
-OPENSSL_gmtime_diff(3)
-OPENSSL_init(3)
-OPENSSL_isservice(3)
-OPENSSL_issetugid(3)
-OPENSSL_memcmp(3)
-OPENSSL_sk_deep_copy(3)
-OPENSSL_sk_delete(3)
-OPENSSL_sk_delete_ptr(3)
-OPENSSL_sk_dup(3)
-OPENSSL_sk_find(3)
-OPENSSL_sk_find_ex(3)
-OPENSSL_sk_free(3)
-OPENSSL_sk_insert(3)
-OPENSSL_sk_is_sorted(3)
-OPENSSL_sk_new(3)
-OPENSSL_sk_new_null(3)
-OPENSSL_sk_new_reserve(3)
-OPENSSL_sk_num(3)
-OPENSSL_sk_pop(3)
-OPENSSL_sk_pop_free(3)
-OPENSSL_sk_push(3)
-OPENSSL_sk_reserve(3)
-OPENSSL_sk_set(3)
-OPENSSL_sk_set_cmp_func(3)
-OPENSSL_sk_shift(3)
-OPENSSL_sk_sort(3)
-OPENSSL_sk_unshift(3)
-OPENSSL_sk_value(3)
-OPENSSL_sk_zero(3)
-OPENSSL_strnlen(3)
-OPENSSL_uni2asc(3)
-OPENSSL_uni2utf8(3)
-OPENSSL_utf82uni(3)
-OSSL_STORE_do_all_loaders(3)
-OSSL_STORE_vctrl(3)
-OTHERNAME_cmp(3)
-OTHERNAME_it(3)
-OTHERNAME_it(3)
-PBE2PARAM_it(3)
-PBE2PARAM_it(3)
-PBEPARAM_it(3)
-PBEPARAM_it(3)
-PBKDF2PARAM_it(3)
-PBKDF2PARAM_it(3)
-PEM_ASN1_read(3)
-PEM_ASN1_read_bio(3)
-PEM_ASN1_write(3)
-PEM_ASN1_write_bio(3)
-PEM_SignFinal(3)
-PEM_SignInit(3)
-PEM_SignUpdate(3)
-PEM_X509_INFO_read(3)
-PEM_X509_INFO_read_bio(3)
-PEM_X509_INFO_write_bio(3)
-PEM_def_callback(3)
-PEM_dek_info(3)
-PEM_proc_type(3)
-PEM_read_bio_ECPrivateKey(3)
-PEM_read_bio_Parameters(3)
-PEM_write_bio_ASN1_stream(3)
-PEM_write_bio_Parameters(3)
-PKCS12_AUTHSAFES_it(3)
-PKCS12_AUTHSAFES_it(3)
-PKCS12_BAGS_it(3)
-PKCS12_BAGS_it(3)
-PKCS12_MAC_DATA_it(3)
-PKCS12_MAC_DATA_it(3)
-PKCS12_PBE_add(3)
-PKCS12_PBE_keyivgen(3)
-PKCS12_SAFEBAGS_it(3)
-PKCS12_SAFEBAGS_it(3)
-PKCS12_SAFEBAG_create0_p8inf(3)
-PKCS12_SAFEBAG_create0_pkcs8(3)
-PKCS12_SAFEBAG_create_cert(3)
-PKCS12_SAFEBAG_create_crl(3)
-PKCS12_SAFEBAG_create_pkcs8_encrypt(3)
-PKCS12_SAFEBAG_get0_attr(3)
-PKCS12_SAFEBAG_get0_attrs(3)
-PKCS12_SAFEBAG_get0_p8inf(3)
-PKCS12_SAFEBAG_get0_pkcs8(3)
-PKCS12_SAFEBAG_get0_safes(3)
-PKCS12_SAFEBAG_get0_type(3)
-PKCS12_SAFEBAG_get1_cert(3)
-PKCS12_SAFEBAG_get1_crl(3)
-PKCS12_SAFEBAG_get_bag_nid(3)
-PKCS12_SAFEBAG_get_nid(3)
-PKCS12_SAFEBAG_it(3)
-PKCS12_SAFEBAG_it(3)
-PKCS12_add_CSPName_asc(3)
-PKCS12_add_cert(3)
-PKCS12_add_friendlyname_asc(3)
-PKCS12_add_friendlyname_uni(3)
-PKCS12_add_friendlyname_utf8(3)
-PKCS12_add_key(3)
-PKCS12_add_localkeyid(3)
-PKCS12_add_safe(3)
-PKCS12_add_safes(3)
-PKCS12_decrypt_skey(3)
-PKCS12_gen_mac(3)
-PKCS12_get_attr(3)
-PKCS12_get_attr_gen(3)
-PKCS12_get_friendlyname(3)
-PKCS12_init(3)
-PKCS12_it(3)
-PKCS12_it(3)
-PKCS12_item_decrypt_d2i(3)
-PKCS12_item_i2d_encrypt(3)
-PKCS12_item_pack_safebag(3)
-PKCS12_key_gen_asc(3)
-PKCS12_key_gen_uni(3)
-PKCS12_key_gen_utf8(3)
-PKCS12_mac_present(3)
-PKCS12_pack_authsafes(3)
-PKCS12_pack_p7data(3)
-PKCS12_pack_p7encdata(3)
-PKCS12_pbe_crypt(3)
-PKCS12_set_mac(3)
-PKCS12_setup_mac(3)
-PKCS12_unpack_authsafes(3)
-PKCS12_unpack_p7data(3)
-PKCS12_unpack_p7encdata(3)
-PKCS12_verify_mac(3)
-PKCS1_MGF1(3)
-PKCS5_PBE_add(3)
-PKCS5_PBE_keyivgen(3)
-PKCS5_pbe2_set(3)
-PKCS5_pbe2_set_iv(3)
-PKCS5_pbe2_set_scrypt(3)
-PKCS5_pbe_set(3)
-PKCS5_pbe_set0_algor(3)
-PKCS5_pbkdf2_set(3)
-PKCS5_v2_PBE_keyivgen(3)
-PKCS5_v2_scrypt_keyivgen(3)
-PKCS7_ATTR_SIGN_it(3)
-PKCS7_ATTR_SIGN_it(3)
-PKCS7_ATTR_VERIFY_it(3)
-PKCS7_ATTR_VERIFY_it(3)
-PKCS7_DIGEST_it(3)
-PKCS7_DIGEST_it(3)
-PKCS7_ENCRYPT_it(3)
-PKCS7_ENCRYPT_it(3)
-PKCS7_ENC_CONTENT_it(3)
-PKCS7_ENC_CONTENT_it(3)
-PKCS7_ENVELOPE_it(3)
-PKCS7_ENVELOPE_it(3)
-PKCS7_ISSUER_AND_SERIAL_it(3)
-PKCS7_ISSUER_AND_SERIAL_it(3)
-PKCS7_RECIP_INFO_get0_alg(3)
-PKCS7_RECIP_INFO_it(3)
-PKCS7_RECIP_INFO_it(3)
-PKCS7_RECIP_INFO_set(3)
-PKCS7_SIGNED_it(3)
-PKCS7_SIGNED_it(3)
-PKCS7_SIGNER_INFO_get0_algs(3)
-PKCS7_SIGNER_INFO_it(3)
-PKCS7_SIGNER_INFO_it(3)
-PKCS7_SIGNER_INFO_set(3)
-PKCS7_SIGNER_INFO_sign(3)
-PKCS7_SIGN_ENVELOPE_it(3)
-PKCS7_SIGN_ENVELOPE_it(3)
-PKCS7_add0_attrib_signing_time(3)
-PKCS7_add1_attrib_digest(3)
-PKCS7_add_attrib_content_type(3)
-PKCS7_add_attrib_smimecap(3)
-PKCS7_add_attribute(3)
-PKCS7_add_certificate(3)
-PKCS7_add_crl(3)
-PKCS7_add_recipient(3)
-PKCS7_add_recipient_info(3)
-PKCS7_add_signature(3)
-PKCS7_add_signed_attribute(3)
-PKCS7_add_signer(3)
-PKCS7_cert_from_signer_info(3)
-PKCS7_content_new(3)
-PKCS7_ctrl(3)
-PKCS7_dataDecode(3)
-PKCS7_dataFinal(3)
-PKCS7_dataInit(3)
-PKCS7_dataVerify(3)
-PKCS7_digest_from_attributes(3)
-PKCS7_final(3)
-PKCS7_get_attribute(3)
-PKCS7_get_issuer_and_serial(3)
-PKCS7_get_signed_attribute(3)
-PKCS7_get_signer_info(3)
-PKCS7_get_smimecap(3)
-PKCS7_it(3)
-PKCS7_it(3)
-PKCS7_set0_type_other(3)
-PKCS7_set_attributes(3)
-PKCS7_set_cipher(3)
-PKCS7_set_content(3)
-PKCS7_set_digest(3)
-PKCS7_set_signed_attributes(3)
-PKCS7_set_type(3)
-PKCS7_signatureVerify(3)
-PKCS7_simple_smimecap(3)
-PKCS7_stream(3)
-PKCS7_to_TS_TST_INFO(3)
-PKCS8_PRIV_KEY_INFO_it(3)
-PKCS8_PRIV_KEY_INFO_it(3)
-PKCS8_add_keyusage(3)
-PKCS8_decrypt(3)
-PKCS8_encrypt(3)
-PKCS8_get_attr(3)
-PKCS8_pkey_add1_attr_by_NID(3)
-PKCS8_pkey_get0(3)
-PKCS8_pkey_get0_attrs(3)
-PKCS8_pkey_set0(3)
-PKCS8_set0_pbe(3)
-PKEY_USAGE_PERIOD_it(3)
-PKEY_USAGE_PERIOD_it(3)
-POLICYINFO_it(3)
-POLICYINFO_it(3)
-POLICYQUALINFO_it(3)
-POLICYQUALINFO_it(3)
-POLICY_CONSTRAINTS_it(3)
-POLICY_CONSTRAINTS_it(3)
-POLICY_MAPPINGS_it(3)
-POLICY_MAPPINGS_it(3)
-POLICY_MAPPING_it(3)
-POLICY_MAPPING_it(3)
-PROFESSION_INFO_it(3)
-PROFESSION_INFO_it(3)
-PROXY_CERT_INFO_EXTENSION_it(3)
-PROXY_CERT_INFO_EXTENSION_it(3)
-PROXY_POLICY_it(3)
-PROXY_POLICY_it(3)
-RAND_set_rand_engine(3)
-RC2_cbc_encrypt(3)
-RC2_cfb64_encrypt(3)
-RC2_decrypt(3)
-RC2_ecb_encrypt(3)
-RC2_encrypt(3)
-RC2_ofb64_encrypt(3)
-RC2_set_key(3)
-RC4_options(3)
-RC5_32_cbc_encrypt(3)
-RC5_32_cfb64_encrypt(3)
-RC5_32_decrypt(3)
-RC5_32_ecb_encrypt(3)
-RC5_32_encrypt(3)
-RC5_32_ofb64_encrypt(3)
-RC5_32_set_key(3)
-RIPEMD160_Transform(3)
-RSAPrivateKey_it(3)
-RSAPrivateKey_it(3)
-RSAPublicKey_it(3)
-RSAPublicKey_it(3)
-RSA_OAEP_PARAMS_it(3)
-RSA_OAEP_PARAMS_it(3)
-RSA_PSS_PARAMS_it(3)
-RSA_PSS_PARAMS_it(3)
-RSA_X931_derive_ex(3)
-RSA_X931_generate_key_ex(3)
-RSA_X931_hash_id(3)
-RSA_null_method(3)
-RSA_padding_add_PKCS1_OAEP_mgf1(3)
-RSA_padding_add_PKCS1_PSS(3)
-RSA_padding_add_PKCS1_PSS_mgf1(3)
-RSA_padding_add_X931(3)
-RSA_padding_check_PKCS1_OAEP_mgf1(3)
-RSA_padding_check_X931(3)
-RSA_pkey_ctx_ctrl(3)
-RSA_setup_blinding(3)
-RSA_up_ref(3)
-RSA_verify_PKCS1_PSS(3)
-RSA_verify_PKCS1_PSS_mgf1(3)
-SCRYPT_PARAMS_it(3)
-SCRYPT_PARAMS_it(3)
-SEED_cbc_encrypt(3)
-SEED_cfb128_encrypt(3)
-SEED_decrypt(3)
-SEED_ecb_encrypt(3)
-SEED_encrypt(3)
-SEED_ofb128_encrypt(3)
-SEED_set_key(3)
-SHA1_Transform(3)
-SHA256_Transform(3)
-SHA512_Transform(3)
-SMIME_crlf_copy(3)
-SMIME_read_ASN1(3)
-SMIME_text(3)
-SMIME_write_ASN1(3)
-SRP_Calc_A(3)
-SRP_Calc_B(3)
-SRP_Calc_client_key(3)
-SRP_Calc_server_key(3)
-SRP_Calc_u(3)
-SRP_Calc_x(3)
-SRP_VBASE_free(3)
-SRP_VBASE_get1_by_user(3)
-SRP_VBASE_get_by_user(3)
-SRP_VBASE_init(3)
-SRP_VBASE_new(3)
-SRP_Verify_A_mod_N(3)
-SRP_Verify_B_mod_N(3)
-SRP_check_known_gN_param(3)
-SRP_create_verifier(3)
-SRP_create_verifier_BN(3)
-SRP_get_default_gN(3)
-SRP_user_pwd_free(3)
-SSL_CTX_set0_ctlog_store(3)
-SXNETID_it(3)
-SXNETID_it(3)
-SXNET_add_id_INTEGER(3)
-SXNET_add_id_asc(3)
-SXNET_add_id_ulong(3)
-SXNET_get_id_INTEGER(3)
-SXNET_get_id_asc(3)
-SXNET_get_id_ulong(3)
-SXNET_it(3)
-SXNET_it(3)
-TS_ACCURACY_get_micros(3)
-TS_ACCURACY_get_millis(3)
-TS_ACCURACY_get_seconds(3)
-TS_ACCURACY_set_micros(3)
-TS_ACCURACY_set_millis(3)
-TS_ACCURACY_set_seconds(3)
-TS_ASN1_INTEGER_print_bio(3)
-TS_CONF_get_tsa_section(3)
-TS_CONF_load_cert(3)
-TS_CONF_load_certs(3)
-TS_CONF_load_key(3)
-TS_CONF_set_accuracy(3)
-TS_CONF_set_certs(3)
-TS_CONF_set_clock_precision_digits(3)
-TS_CONF_set_crypto_device(3)
-TS_CONF_set_def_policy(3)
-TS_CONF_set_default_engine(3)
-TS_CONF_set_digests(3)
-TS_CONF_set_ess_cert_id_chain(3)
-TS_CONF_set_ess_cert_id_digest(3)
-TS_CONF_set_ordering(3)
-TS_CONF_set_policies(3)
-TS_CONF_set_serial(3)
-TS_CONF_set_signer_cert(3)
-TS_CONF_set_signer_digest(3)
-TS_CONF_set_signer_key(3)
-TS_CONF_set_tsa_name(3)
-TS_MSG_IMPRINT_get_algo(3)
-TS_MSG_IMPRINT_get_msg(3)
-TS_MSG_IMPRINT_print_bio(3)
-TS_MSG_IMPRINT_set_algo(3)
-TS_MSG_IMPRINT_set_msg(3)
-TS_OBJ_print_bio(3)
-TS_REQ_add_ext(3)
-TS_REQ_delete_ext(3)
-TS_REQ_ext_free(3)
-TS_REQ_get_cert_req(3)
-TS_REQ_get_ext(3)
-TS_REQ_get_ext_by_NID(3)
-TS_REQ_get_ext_by_OBJ(3)
-TS_REQ_get_ext_by_critical(3)
-TS_REQ_get_ext_count(3)
-TS_REQ_get_ext_d2i(3)
-TS_REQ_get_exts(3)
-TS_REQ_get_msg_imprint(3)
-TS_REQ_get_nonce(3)
-TS_REQ_get_policy_id(3)
-TS_REQ_get_version(3)
-TS_REQ_print_bio(3)
-TS_REQ_set_cert_req(3)
-TS_REQ_set_msg_imprint(3)
-TS_REQ_set_nonce(3)
-TS_REQ_set_policy_id(3)
-TS_REQ_set_version(3)
-TS_REQ_to_TS_VERIFY_CTX(3)
-TS_RESP_CTX_add_failure_info(3)
-TS_RESP_CTX_add_flags(3)
-TS_RESP_CTX_add_md(3)
-TS_RESP_CTX_add_policy(3)
-TS_RESP_CTX_free(3)
-TS_RESP_CTX_get_request(3)
-TS_RESP_CTX_get_tst_info(3)
-TS_RESP_CTX_new(3)
-TS_RESP_CTX_set_accuracy(3)
-TS_RESP_CTX_set_certs(3)
-TS_RESP_CTX_set_clock_precision_digits(3)
-TS_RESP_CTX_set_def_policy(3)
-TS_RESP_CTX_set_ess_cert_id_digest(3)
-TS_RESP_CTX_set_extension_cb(3)
-TS_RESP_CTX_set_serial_cb(3)
-TS_RESP_CTX_set_signer_cert(3)
-TS_RESP_CTX_set_signer_digest(3)
-TS_RESP_CTX_set_signer_key(3)
-TS_RESP_CTX_set_status_info(3)
-TS_RESP_CTX_set_status_info_cond(3)
-TS_RESP_CTX_set_time_cb(3)
-TS_RESP_create_response(3)
-TS_RESP_get_status_info(3)
-TS_RESP_get_token(3)
-TS_RESP_get_tst_info(3)
-TS_RESP_print_bio(3)
-TS_RESP_set_status_info(3)
-TS_RESP_set_tst_info(3)
-TS_RESP_verify_response(3)
-TS_RESP_verify_signature(3)
-TS_RESP_verify_token(3)
-TS_STATUS_INFO_get0_failure_info(3)
-TS_STATUS_INFO_get0_status(3)
-TS_STATUS_INFO_get0_text(3)
-TS_STATUS_INFO_print_bio(3)
-TS_STATUS_INFO_set_status(3)
-TS_TST_INFO_add_ext(3)
-TS_TST_INFO_delete_ext(3)
-TS_TST_INFO_ext_free(3)
-TS_TST_INFO_get_accuracy(3)
-TS_TST_INFO_get_ext(3)
-TS_TST_INFO_get_ext_by_NID(3)
-TS_TST_INFO_get_ext_by_OBJ(3)
-TS_TST_INFO_get_ext_by_critical(3)
-TS_TST_INFO_get_ext_count(3)
-TS_TST_INFO_get_ext_d2i(3)
-TS_TST_INFO_get_exts(3)
-TS_TST_INFO_get_msg_imprint(3)
-TS_TST_INFO_get_nonce(3)
-TS_TST_INFO_get_ordering(3)
-TS_TST_INFO_get_policy_id(3)
-TS_TST_INFO_get_serial(3)
-TS_TST_INFO_get_time(3)
-TS_TST_INFO_get_tsa(3)
-TS_TST_INFO_get_version(3)
-TS_TST_INFO_print_bio(3)
-TS_TST_INFO_set_accuracy(3)
-TS_TST_INFO_set_msg_imprint(3)
-TS_TST_INFO_set_nonce(3)
-TS_TST_INFO_set_ordering(3)
-TS_TST_INFO_set_policy_id(3)
-TS_TST_INFO_set_serial(3)
-TS_TST_INFO_set_time(3)
-TS_TST_INFO_set_tsa(3)
-TS_TST_INFO_set_version(3)
-TS_VERIFY_CTS_set_certs(3)
-TS_VERIFY_CTX_add_flags(3)
-TS_VERIFY_CTX_cleanup(3)
-TS_VERIFY_CTX_free(3)
-TS_VERIFY_CTX_init(3)
-TS_VERIFY_CTX_new(3)
-TS_VERIFY_CTX_set_data(3)
-TS_VERIFY_CTX_set_flags(3)
-TS_VERIFY_CTX_set_imprint(3)
-TS_VERIFY_CTX_set_store(3)
-TS_X509_ALGOR_print_bio(3)
-TS_ext_print_bio(3)
-TXT_DB_create_index(3)
-TXT_DB_free(3)
-TXT_DB_get_by_index(3)
-TXT_DB_insert(3)
-TXT_DB_read(3)
-TXT_DB_write(3)
-UINT32_it(3)
-UINT32_it(3)
-UINT64_it(3)
-UINT64_it(3)
-USERNOTICE_it(3)
-USERNOTICE_it(3)
-UTF8_getc(3)
-UTF8_putc(3)
-WHIRLPOOL(3)
-WHIRLPOOL_BitUpdate(3)
-WHIRLPOOL_Final(3)
-WHIRLPOOL_Init(3)
-WHIRLPOOL_Update(3)
-X509V3_EXT_CRL_add_conf(3)
-X509V3_EXT_CRL_add_nconf(3)
-X509V3_EXT_REQ_add_conf(3)
-X509V3_EXT_REQ_add_nconf(3)
-X509V3_EXT_add(3)
-X509V3_EXT_add_alias(3)
-X509V3_EXT_add_conf(3)
-X509V3_EXT_add_list(3)
-X509V3_EXT_add_nconf(3)
-X509V3_EXT_add_nconf_sk(3)
-X509V3_EXT_cleanup(3)
-X509V3_EXT_conf(3)
-X509V3_EXT_conf_nid(3)
-X509V3_EXT_get(3)
-X509V3_EXT_get_nid(3)
-X509V3_EXT_nconf(3)
-X509V3_EXT_nconf_nid(3)
-X509V3_EXT_print(3)
-X509V3_EXT_print_fp(3)
-X509V3_EXT_val_prn(3)
-X509V3_NAME_from_section(3)
-X509V3_add_standard_extensions(3)
-X509V3_add_value(3)
-X509V3_add_value_bool(3)
-X509V3_add_value_bool_nf(3)
-X509V3_add_value_int(3)
-X509V3_add_value_uchar(3)
-X509V3_conf_free(3)
-X509V3_extensions_print(3)
-X509V3_get_section(3)
-X509V3_get_string(3)
-X509V3_get_value_bool(3)
-X509V3_get_value_int(3)
-X509V3_parse_list(3)
-X509V3_section_free(3)
-X509V3_set_conf_lhash(3)
-X509V3_set_ctx(3)
-X509V3_set_nconf(3)
-X509V3_string_free(3)
-X509_ALGORS_it(3)
-X509_ALGORS_it(3)
-X509_ALGOR_it(3)
-X509_ALGOR_it(3)
-X509_ATTRIBUTE_count(3)
-X509_ATTRIBUTE_create(3)
-X509_ATTRIBUTE_create_by_NID(3)
-X509_ATTRIBUTE_create_by_OBJ(3)
-X509_ATTRIBUTE_create_by_txt(3)
-X509_ATTRIBUTE_get0_data(3)
-X509_ATTRIBUTE_get0_object(3)
-X509_ATTRIBUTE_get0_type(3)
-X509_ATTRIBUTE_it(3)
-X509_ATTRIBUTE_it(3)
-X509_ATTRIBUTE_set1_data(3)
-X509_ATTRIBUTE_set1_object(3)
-X509_CERT_AUX_it(3)
-X509_CERT_AUX_it(3)
-X509_CINF_it(3)
-X509_CINF_it(3)
-X509_CRL_INFO_it(3)
-X509_CRL_INFO_it(3)
-X509_CRL_METHOD_free(3)
-X509_CRL_METHOD_new(3)
-X509_CRL_check_suiteb(3)
-X509_CRL_cmp(3)
-X509_CRL_diff(3)
-X509_CRL_get_lastUpdate(3)
-X509_CRL_get_meth_data(3)
-X509_CRL_get_nextUpdate(3)
-X509_CRL_http_nbio(3)
-X509_CRL_it(3)
-X509_CRL_it(3)
-X509_CRL_match(3)
-X509_CRL_print(3)
-X509_CRL_print_ex(3)
-X509_CRL_print_fp(3)
-X509_CRL_set_default_method(3)
-X509_CRL_set_meth_data(3)
-X509_CRL_up_ref(3)
-X509_EXTENSIONS_it(3)
-X509_EXTENSIONS_it(3)
-X509_EXTENSION_it(3)
-X509_EXTENSION_it(3)
-X509_INFO_free(3)
-X509_INFO_new(3)
-X509_LOOKUP_by_alias(3)
-X509_LOOKUP_by_fingerprint(3)
-X509_LOOKUP_by_issuer_serial(3)
-X509_LOOKUP_by_subject(3)
-X509_LOOKUP_ctrl(3)
-X509_LOOKUP_free(3)
-X509_LOOKUP_init(3)
-X509_LOOKUP_new(3)
-X509_LOOKUP_shutdown(3)
-X509_NAME_ENTRY_it(3)
-X509_NAME_ENTRY_it(3)
-X509_NAME_ENTRY_set(3)
-X509_NAME_cmp(3)
-X509_NAME_hash(3)
-X509_NAME_hash_old(3)
-X509_NAME_it(3)
-X509_NAME_it(3)
-X509_NAME_set(3)
-X509_OBJECT_free(3)
-X509_OBJECT_get0_X509(3)
-X509_OBJECT_get0_X509_CRL(3)
-X509_OBJECT_get_type(3)
-X509_OBJECT_idx_by_subject(3)
-X509_OBJECT_new(3)
-X509_OBJECT_retrieve_by_subject(3)
-X509_OBJECT_retrieve_match(3)
-X509_OBJECT_up_ref_count(3)
-X509_PKEY_free(3)
-X509_PKEY_new(3)
-X509_POLICY_NODE_print(3)
-X509_PUBKEY_it(3)
-X509_PUBKEY_it(3)
-X509_PURPOSE_add(3)
-X509_PURPOSE_cleanup(3)
-X509_PURPOSE_get0(3)
-X509_PURPOSE_get0_name(3)
-X509_PURPOSE_get0_sname(3)
-X509_PURPOSE_get_by_id(3)
-X509_PURPOSE_get_by_sname(3)
-X509_PURPOSE_get_count(3)
-X509_PURPOSE_get_id(3)
-X509_PURPOSE_get_trust(3)
-X509_PURPOSE_set(3)
-X509_REQ_INFO_it(3)
-X509_REQ_INFO_it(3)
-X509_REQ_add1_attr(3)
-X509_REQ_add1_attr_by_NID(3)
-X509_REQ_add1_attr_by_OBJ(3)
-X509_REQ_add1_attr_by_txt(3)
-X509_REQ_add_extensions(3)
-X509_REQ_add_extensions_nid(3)
-X509_REQ_delete_attr(3)
-X509_REQ_extension_nid(3)
-X509_REQ_get1_email(3)
-X509_REQ_get_attr(3)
-X509_REQ_get_attr_by_NID(3)
-X509_REQ_get_attr_by_OBJ(3)
-X509_REQ_get_attr_count(3)
-X509_REQ_get_extension_nids(3)
-X509_REQ_get_extensions(3)
-X509_REQ_it(3)
-X509_REQ_it(3)
-X509_REQ_print(3)
-X509_REQ_print_ex(3)
-X509_REQ_print_fp(3)
-X509_REQ_set_extension_nids(3)
-X509_REQ_to_X509(3)
-X509_REVOKED_it(3)
-X509_REVOKED_it(3)
-X509_SIG_it(3)
-X509_SIG_it(3)
-X509_STORE_CTX_get0_current_crl(3)
-X509_STORE_CTX_get0_current_issuer(3)
-X509_STORE_CTX_get0_parent_ctx(3)
-X509_STORE_CTX_get0_policy_tree(3)
-X509_STORE_CTX_get0_store(3)
-X509_STORE_CTX_get1_certs(3)
-X509_STORE_CTX_get1_crls(3)
-X509_STORE_CTX_get1_issuer(3)
-X509_STORE_CTX_get_by_subject(3)
-X509_STORE_CTX_get_explicit_policy(3)
-X509_STORE_CTX_get_obj_by_subject(3)
-X509_STORE_CTX_purpose_inherit(3)
-X509_STORE_CTX_set0_dane(3)
-X509_STORE_CTX_set_depth(3)
-X509_STORE_CTX_set_flags(3)
-X509_STORE_CTX_set_purpose(3)
-X509_STORE_CTX_set_time(3)
-X509_STORE_CTX_set_trust(3)
-X509_STORE_add_lookup(3)
-X509_STORE_get_verify(3)
-X509_TRUST_add(3)
-X509_TRUST_cleanup(3)
-X509_TRUST_get0(3)
-X509_TRUST_get0_name(3)
-X509_TRUST_get_by_id(3)
-X509_TRUST_get_count(3)
-X509_TRUST_get_flags(3)
-X509_TRUST_get_trust(3)
-X509_TRUST_set(3)
-X509_TRUST_set_default(3)
-X509_VAL_it(3)
-X509_VAL_it(3)
-X509_VERIFY_PARAM_add0_table(3)
-X509_VERIFY_PARAM_free(3)
-X509_VERIFY_PARAM_get0(3)
-X509_VERIFY_PARAM_get0_name(3)
-X509_VERIFY_PARAM_get_count(3)
-X509_VERIFY_PARAM_inherit(3)
-X509_VERIFY_PARAM_lookup(3)
-X509_VERIFY_PARAM_move_peername(3)
-X509_VERIFY_PARAM_new(3)
-X509_VERIFY_PARAM_set1(3)
-X509_VERIFY_PARAM_set1_name(3)
-X509_VERIFY_PARAM_table_cleanup(3)
-X509_add1_reject_object(3)
-X509_add1_trust_object(3)
-X509_alias_get0(3)
-X509_alias_set1(3)
-X509_aux_print(3)
-X509_certificate_type(3)
-X509_chain_check_suiteb(3)
-X509_check_akid(3)
-X509_check_purpose(3)
-X509_check_trust(3)
-X509_cmp(3)
-X509_email_free(3)
-X509_find_by_issuer_and_serial(3)
-X509_find_by_subject(3)
-X509_get0_pubkey_bitstr(3)
-X509_get0_reject_objects(3)
-X509_get0_trust_objects(3)
-X509_get1_email(3)
-X509_get1_ocsp(3)
-X509_get_default_cert_area(3)
-X509_get_default_cert_dir(3)
-X509_get_default_cert_dir_env(3)
-X509_get_default_cert_file(3)
-X509_get_default_cert_file_env(3)
-X509_get_default_private_dir(3)
-X509_get_pubkey_parameters(3)
-X509_get_signature_type(3)
-X509_gmtime_adj(3)
-X509_http_nbio(3)
-X509_issuer_and_serial_cmp(3)
-X509_issuer_and_serial_hash(3)
-X509_issuer_name_cmp(3)
-X509_issuer_name_hash(3)
-X509_issuer_name_hash_old(3)
-X509_it(3)
-X509_it(3)
-X509_keyid_get0(3)
-X509_keyid_set1(3)
-X509_ocspid_print(3)
-X509_policy_check(3)
-X509_policy_level_get0_node(3)
-X509_policy_level_node_count(3)
-X509_policy_node_get0_parent(3)
-X509_policy_node_get0_policy(3)
-X509_policy_node_get0_qualifiers(3)
-X509_policy_tree_free(3)
-X509_policy_tree_get0_level(3)
-X509_policy_tree_get0_policies(3)
-X509_policy_tree_get0_user_policies(3)
-X509_policy_tree_level_count(3)
-X509_print(3)
-X509_print_ex(3)
-X509_print_ex_fp(3)
-X509_print_fp(3)
-X509_reject_clear(3)
-X509_signature_dump(3)
-X509_signature_print(3)
-X509_subject_name_cmp(3)
-X509_subject_name_hash(3)
-X509_subject_name_hash_old(3)
-X509_supported_extension(3)
-X509_to_X509_REQ(3)
-X509_trust_clear(3)
-X509_trusted(3)
-X509at_add1_attr(3)
-X509at_add1_attr_by_NID(3)
-X509at_add1_attr_by_OBJ(3)
-X509at_add1_attr_by_txt(3)
-X509at_delete_attr(3)
-X509at_get0_data_by_OBJ(3)
-X509at_get_attr(3)
-X509at_get_attr_by_NID(3)
-X509at_get_attr_by_OBJ(3)
-X509at_get_attr_count(3)
-X509v3_addr_add_inherit(3)
-X509v3_addr_add_prefix(3)
-X509v3_addr_add_range(3)
-X509v3_addr_canonize(3)
-X509v3_addr_get_afi(3)
-X509v3_addr_get_range(3)
-X509v3_addr_inherits(3)
-X509v3_addr_is_canonical(3)
-X509v3_addr_subset(3)
-X509v3_addr_validate_path(3)
-X509v3_addr_validate_resource_set(3)
-X509v3_asid_add_id_or_range(3)
-X509v3_asid_add_inherit(3)
-X509v3_asid_canonize(3)
-X509v3_asid_inherits(3)
-X509v3_asid_is_canonical(3)
-X509v3_asid_subset(3)
-X509v3_asid_validate_path(3)
-X509v3_asid_validate_resource_set(3)
-ZINT32_it(3)
-ZINT32_it(3)
-ZINT64_it(3)
-ZINT64_it(3)
-ZLONG_it(3)
-ZLONG_it(3)
-ZUINT32_it(3)
-ZUINT32_it(3)
-ZUINT64_it(3)
-ZUINT64_it(3)
-_shadow_DES_check_key(3)
-_shadow_DES_check_key(3)
-a2d_ASN1_OBJECT(3)
-a2i_ASN1_ENUMERATED(3)
-a2i_ASN1_INTEGER(3)
-a2i_ASN1_STRING(3)
-a2i_GENERAL_NAME(3)
-a2i_IPADDRESS(3)
-a2i_IPADDRESS_NC(3)
-b2i_PVK_bio(3)
-b2i_PrivateKey(3)
-b2i_PrivateKey_bio(3)
-b2i_PublicKey(3)
-b2i_PublicKey_bio(3)
-conf_ssl_get(3)
-conf_ssl_get_cmd(3)
-conf_ssl_name_find(3)
-err_free_strings_int(3)
-i2a_ACCESS_DESCRIPTION(3)
-i2a_ASN1_ENUMERATED(3)
-i2a_ASN1_INTEGER(3)
-i2a_ASN1_OBJECT(3)
-i2a_ASN1_STRING(3)
-i2b_PVK_bio(3)
-i2b_PrivateKey_bio(3)
-i2b_PublicKey_bio(3)
-i2d_PrivateKey_bio(3)
-i2d_PrivateKey_fp(3)
-i2o_ECPublicKey(3)
-i2s_ASN1_ENUMERATED(3)
-i2s_ASN1_ENUMERATED_TABLE(3)
-i2s_ASN1_IA5STRING(3)
-i2s_ASN1_INTEGER(3)
-i2s_ASN1_OCTET_STRING(3)
-i2v_ASN1_BIT_STRING(3)
-i2v_GENERAL_NAME(3)
-i2v_GENERAL_NAMES(3)
-o2i_ECPublicKey(3)
-s2i_ASN1_IA5STRING(3)
-s2i_ASN1_INTEGER(3)
-s2i_ASN1_OCTET_STRING(3)
-v2i_ASN1_BIT_STRING(3)
-v2i_GENERAL_NAME(3)
-v2i_GENERAL_NAMES(3)
-v2i_GENERAL_NAME_ex(3)
diff --git a/deps/openssl/openssl/util/missingmacro.txt b/deps/openssl/openssl/util/missingmacro.txt
index 50b4b17b15c..20e6077c6b5 100644
--- a/deps/openssl/openssl/util/missingmacro.txt
+++ b/deps/openssl/openssl/util/missingmacro.txt
@@ -137,7 +137,6 @@ SSL_get0_certificate_types(3)
 SSL_CTX_set1_client_certificate_types(3)
 SSL_set1_client_certificate_types(3)
 SSL_get0_raw_cipherlist(3)
-SSL_get0_ec_point_formats(3)
 SSL_CTX_need_tmp_RSA(3)
 SSL_CTX_set_tmp_rsa(3)
 SSL_need_tmp_RSA(3)
diff --git a/deps/openssl/openssl/util/missingmacro111.txt b/deps/openssl/openssl/util/missingmacro111.txt
deleted file mode 100644
index 0b6a86e7e39..00000000000
--- a/deps/openssl/openssl/util/missingmacro111.txt
+++ /dev/null
@@ -1,230 +0,0 @@
-# A list of macros that are known to be missing documentation as used by the
-# find-doc-nits -v -o option. The list is as of commit 1708e3e85b (the release
-# of 1.1.1).
-BIO_get_flags(3)
-BIO_set_retry_special(3)
-BIO_set_retry_read(3)
-BIO_set_retry_write(3)
-BIO_clear_retry_flags(3)
-BIO_get_retry_flags(3)
-BIO_CB_return(3)
-BIO_cb_pre(3)
-BIO_cb_post(3)
-BIO_set_app_data(3)
-BIO_get_app_data(3)
-BIO_set_conn_mode(3)
-BIO_dup_state(3)
-BIO_buffer_get_num_lines(3)
-BIO_buffer_peek(3)
-BIO_ctrl_dgram_connect(3)
-BIO_ctrl_set_connected(3)
-BIO_dgram_recv_timedout(3)
-BIO_dgram_send_timedout(3)
-BIO_dgram_get_peer(3)
-BIO_dgram_set_peer(3)
-BIO_dgram_get_mtu_overhead(3)
-BIO_sock_cleanup(3)
-ossl_bio__attr__(3)
-BN_prime_checks_for_size(3)
-BN_GF2m_sub(3)
-BN_GF2m_cmp(3)
-BUF_strdup(3)
-BUF_strndup(3)
-BUF_memdup(3)
-BUF_strlcpy(3)
-BUF_strlcat(3)
-BUF_strnlen(3)
-COMP_zlib_cleanup(3)
-NCONF_get_number(3)
-OPENSSL_MALLOC_MAX_NELEMS(3)
-CRYPTO_cleanup_all_ex_data(3)
-CRYPTO_num_locks(3)
-CRYPTO_set_locking_callback(3)
-CRYPTO_get_locking_callback(3)
-CRYPTO_set_add_lock_callback(3)
-CRYPTO_get_add_lock_callback(3)
-CRYPTO_THREADID_set_numeric(3)
-CRYPTO_THREADID_set_pointer(3)
-CRYPTO_THREADID_set_callback(3)
-CRYPTO_THREADID_get_callback(3)
-CRYPTO_THREADID_current(3)
-CRYPTO_THREADID_cmp(3)
-CRYPTO_THREADID_cpy(3)
-CRYPTO_THREADID_hash(3)
-CRYPTO_set_id_callback(3)
-CRYPTO_get_id_callback(3)
-CRYPTO_thread_id(3)
-CRYPTO_set_dynlock_create_callback(3)
-CRYPTO_set_dynlock_lock_callback(3)
-CRYPTO_set_dynlock_destroy_callback(3)
-CRYPTO_get_dynlock_create_callback(3)
-CRYPTO_get_dynlock_lock_callback(3)
-CRYPTO_get_dynlock_destroy_callback(3)
-OpenSSLDie(3)
-OPENSSL_assert(3)
-EVP_PKEY_CTX_set_dh_paramgen_subprime_len(3)
-EVP_PKEY_CTX_set_dh_paramgen_type(3)
-EVP_PKEY_CTX_set_dh_rfc5114(3)
-EVP_PKEY_CTX_set_dhx_rfc5114(3)
-EVP_PKEY_CTX_set_dh_kdf_type(3)
-EVP_PKEY_CTX_get_dh_kdf_type(3)
-EVP_PKEY_CTX_set0_dh_kdf_oid(3)
-EVP_PKEY_CTX_get0_dh_kdf_oid(3)
-EVP_PKEY_CTX_set_dh_kdf_md(3)
-EVP_PKEY_CTX_get_dh_kdf_md(3)
-EVP_PKEY_CTX_set_dh_kdf_outlen(3)
-EVP_PKEY_CTX_get_dh_kdf_outlen(3)
-EVP_PKEY_CTX_set0_dh_kdf_ukm(3)
-EVP_PKEY_CTX_get0_dh_kdf_ukm(3)
-DSA_is_prime(3)
-OPENSSL_GLOBAL_REF(3)
-OPENSSL_GLOBAL_REF(3)
-ECParameters_dup(3)
-EVP_PKEY_CTX_set_ecdh_cofactor_mode(3)
-EVP_PKEY_CTX_get_ecdh_cofactor_mode(3)
-EVP_PKEY_CTX_set_ecdh_kdf_type(3)
-EVP_PKEY_CTX_get_ecdh_kdf_type(3)
-EVP_PKEY_CTX_set_ecdh_kdf_md(3)
-EVP_PKEY_CTX_get_ecdh_kdf_md(3)
-EVP_PKEY_CTX_set_ecdh_kdf_outlen(3)
-EVP_PKEY_CTX_get_ecdh_kdf_outlen(3)
-EVP_PKEY_CTX_set0_ecdh_kdf_ukm(3)
-EVP_PKEY_CTX_get0_ecdh_kdf_ukm(3)
-ENGINE_load_openssl(3)
-ENGINE_load_dynamic(3)
-ENGINE_load_padlock(3)
-ENGINE_load_capi(3)
-ENGINE_load_afalg(3)
-ENGINE_load_cryptodev(3)
-ENGINE_load_rdrand(3)
-EVP_PKEY_assign_SIPHASH(3)
-EVP_PKEY_assign_POLY1305(3)
-EVP_MD_nid(3)
-EVP_MD_name(3)
-EVP_CIPHER_name(3)
-EVP_ENCODE_LENGTH(3)
-EVP_DECODE_LENGTH(3)
-BIO_set_md_ctx(3)
-EVP_add_cipher_alias(3)
-EVP_add_digest_alias(3)
-EVP_delete_cipher_alias(3)
-EVP_delete_digest_alias(3)
-EVP_MD_CTX_create(3)
-EVP_MD_CTX_init(3)
-EVP_MD_CTX_destroy(3)
-EVP_CIPHER_CTX_init(3)
-EVP_CIPHER_CTX_cleanup(3)
-OPENSSL_add_all_algorithms_conf(3)
-OPENSSL_add_all_algorithms_noconf(3)
-LHASH_HASH_FN(3)
-LHASH_COMP_FN(3)
-LHASH_DOALL_ARG_FN(3)
-LHASH_OF(3)
-DEFINE_LHASH_OF(3)
-int_implement_lhash_doall(3)
-OBJ_create_and_add_object(3)
-OBJ_bsearch(3)
-OBJ_bsearch_ex(3)
-PEM_read_bio_OCSP_REQUEST(3)
-PEM_read_bio_OCSP_RESPONSE(3)
-PEM_write_bio_OCSP_REQUEST(3)
-PEM_write_bio_OCSP_RESPONSE(3)
-ASN1_BIT_STRING_digest(3)
-OCSP_CERTSTATUS_dup(3)
-PKCS7_get_signed_attributes(3)
-PKCS7_get_attributes(3)
-PKCS7_type_is_signed(3)
-PKCS7_type_is_encrypted(3)
-PKCS7_type_is_enveloped(3)
-PKCS7_type_is_signedAndEnveloped(3)
-PKCS7_type_is_data(3)
-PKCS7_type_is_digest(3)
-PKCS7_set_detached(3)
-PKCS7_get_detached(3)
-PKCS7_is_detached(3)
-EVP_PKEY_CTX_get_rsa_padding(3)
-EVP_PKEY_CTX_get_rsa_pss_saltlen(3)
-EVP_PKEY_CTX_set_rsa_keygen_primes(3)
-EVP_PKEY_CTX_set_rsa_mgf1_md(3)
-EVP_PKEY_CTX_set_rsa_oaep_md(3)
-EVP_PKEY_CTX_get_rsa_mgf1_md(3)
-EVP_PKEY_CTX_get_rsa_oaep_md(3)
-EVP_PKEY_CTX_set0_rsa_oaep_label(3)
-EVP_PKEY_CTX_get0_rsa_oaep_label(3)
-RSA_set_app_data(3)
-RSA_get_app_data(3)
-STACK_OF(3)
-SKM_DEFINE_STACK_OF(3)
-U64(3)
-U64(3)
-U64(3)
-SSL_set_mtu(3)
-DTLS_set_link_mtu(3)
-DTLS_get_link_min_mtu(3)
-SSL_heartbeat(3)
-SSL_CTX_set_cert_flags(3)
-SSL_set_cert_flags(3)
-SSL_CTX_clear_cert_flags(3)
-SSL_clear_cert_flags(3)
-SSL_set_app_data(3)
-SSL_get_app_data(3)
-SSL_SESSION_set_app_data(3)
-SSL_SESSION_get_app_data(3)
-SSL_CTX_get_app_data(3)
-SSL_CTX_set_app_data(3)
-SSLeay_add_ssl_algorithms(3)
-DTLSv1_get_timeout(3)
-DTLSv1_handle_timeout(3)
-SSL_num_renegotiations(3)
-SSL_clear_num_renegotiations(3)
-SSL_total_renegotiations(3)
-SSL_CTX_set_tmp_ecdh(3)
-SSL_set_tmp_ecdh(3)
-SSL_CTX_get_extra_chain_certs(3)
-SSL_CTX_get_extra_chain_certs_only(3)
-SSL_get0_certificate_types(3)
-SSL_CTX_set1_client_certificate_types(3)
-SSL_set1_client_certificate_types(3)
-SSL_get0_raw_cipherlist(3)
-SSL_get0_ec_point_formats(3)
-SSL_CTX_need_tmp_RSA(3)
-SSL_CTX_set_tmp_rsa(3)
-SSL_need_tmp_RSA(3)
-SSL_set_tmp_rsa(3)
-SSL_CTX_set_ecdh_auto(3)
-SSL_set_ecdh_auto(3)
-SSL_CTX_set_tmp_rsa_callback(3)
-SSL_set_tmp_rsa_callback(3)
-SSL_get_ex_new_index(3)
-SSL_SESSION_get_ex_new_index(3)
-SSL_CTX_get_ex_new_index(3)
-SSL_CTX_set_default_read_ahead(3)
-SSL_cache_hit(3)
-TLS1_get_version(3)
-TLS1_get_client_version(3)
-SSL_set_tlsext_debug_callback(3)
-SSL_set_tlsext_debug_arg(3)
-SSL_get_tlsext_status_exts(3)
-SSL_set_tlsext_status_exts(3)
-SSL_get_tlsext_status_ids(3)
-SSL_set_tlsext_status_ids(3)
-SSL_CTX_get_tlsext_ticket_keys(3)
-SSL_CTX_set_tlsext_ticket_keys(3)
-SSL_get_dtlsext_heartbeat_pending(3)
-SSL_set_dtlsext_heartbeat_no_requests(3)
-SSL_get_tlsext_heartbeat_pending(3)
-SSL_set_tlsext_heartbeat_no_requests(3)
-UI_set_app_data(3)
-UI_get_app_data(3)
-X509_extract_key(3)
-X509_REQ_extract_key(3)
-X509_name_cmp(3)
-X509_STORE_CTX_set_app_data(3)
-X509_STORE_CTX_get_app_data(3)
-X509_LOOKUP_load_file(3)
-X509_LOOKUP_add_dir(3)
-X509V3_conf_err(3)
-X509V3_set_ctx_test(3)
-X509V3_set_ctx_nodb(3)
-EXT_BITSTRING(3)
-EXT_IA5STRING(3)
diff --git a/deps/openssl/openssl/util/missingssl.txt b/deps/openssl/openssl/util/missingssl.txt
index 8da9842a0b5..0ab346fe572 100644
--- a/deps/openssl/openssl/util/missingssl.txt
+++ b/deps/openssl/openssl/util/missingssl.txt
@@ -25,7 +25,5 @@ SSL_get_peer_finished(3)
 SSL_set_SSL_CTX(3)
 SSL_set_debug(3)
 SSL_set_not_resumable_session_callback(3)
-SSL_set_session_ticket_ext(3)
-SSL_set_session_ticket_ext_cb(3)
 SSL_srp_server_param_with_username(3)
 SSL_test_functions(3)
diff --git a/deps/openssl/openssl/util/missingssl111.txt b/deps/openssl/openssl/util/missingssl111.txt
deleted file mode 100644
index da92e87737e..00000000000
--- a/deps/openssl/openssl/util/missingssl111.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-# A list of libssl functions that are known to be missing documentation as
-# used by the find-doc-nits -v -o option. The list is as of commit 1708e3e85b
-# (the release of 1.1.1).
-ERR_load_SSL_strings(3)
-SRP_Calc_A_param(3)
-SSL_COMP_get_name(3)
-SSL_COMP_set0_compression_methods(3)
-SSL_CONF_CTX_finish(3)
-SSL_CTX_SRP_CTX_free(3)
-SSL_CTX_SRP_CTX_init(3)
-SSL_CTX_get0_certificate(3)
-SSL_CTX_get0_ctlog_store(3)
-SSL_CTX_get0_privatekey(3)
-SSL_CTX_get_ssl_method(3)
-SSL_CTX_set0_ctlog_store(3)
-SSL_CTX_set_client_cert_engine(3)
-SSL_CTX_set_cookie_generate_cb(3)
-SSL_CTX_set_cookie_verify_cb(3)
-SSL_CTX_set_not_resumable_session_callback(3)
-SSL_CTX_set_purpose(3)
-SSL_CTX_set_srp_cb_arg(3)
-SSL_CTX_set_srp_client_pwd_callback(3)
-SSL_CTX_set_srp_password(3)
-SSL_CTX_set_srp_strength(3)
-SSL_CTX_set_srp_username(3)
-SSL_CTX_set_srp_username_callback(3)
-SSL_CTX_set_srp_verify_param_callback(3)
-SSL_CTX_set_trust(3)
-SSL_SRP_CTX_free(3)
-SSL_SRP_CTX_init(3)
-SSL_add_ssl_module(3)
-SSL_certs_clear(3)
-SSL_copy_session_id(3)
-SSL_dup_CA_list(3)
-SSL_get0_dane(3)
-SSL_get_certificate(3)
-SSL_get_current_compression(3)
-SSL_get_current_expansion(3)
-SSL_get_finished(3)
-SSL_get_peer_finished(3)
-SSL_get_privatekey(3)
-SSL_get_srp_N(3)
-SSL_get_srp_g(3)
-SSL_get_srp_userinfo(3)
-SSL_get_srp_username(3)
-SSL_set_SSL_CTX(3)
-SSL_set_debug(3)
-SSL_set_not_resumable_session_callback(3)
-SSL_set_purpose(3)
-SSL_set_session_secret_cb(3)
-SSL_set_session_ticket_ext(3)
-SSL_set_session_ticket_ext_cb(3)
-SSL_set_srp_server_param(3)
-SSL_set_srp_server_param_pw(3)
-SSL_set_trust(3)
-SSL_srp_server_param_with_username(3)
-SSL_test_functions(3)
-SSL_trace(3)
diff --git a/deps/openssl/openssl/util/mkerr.pl b/deps/openssl/openssl/util/mkerr.pl
index e2479e727b7..16555d4a604 100755
--- a/deps/openssl/openssl/util/mkerr.pl
+++ b/deps/openssl/openssl/util/mkerr.pl
@@ -13,7 +13,6 @@ use File::Basename;
 use File::Spec::Functions qw(abs2rel rel2abs);

 use lib ".";
-use configdata;

 my $config       = "crypto/err/openssl.ec";
 my $debug        = 0;
@@ -21,8 +20,10 @@ my $internal     = 0;
 my $nowrite      = 0;
 my $rebuild      = 0;
 my $reindex      = 0;
+my $stateonly    = 0;
 my $static       = 0;
 my $unref        = 0;
+my $emit;       # file to write on stdout instead of doing a full run
 my %modules         = ();

 my $errors       = 0;
@@ -64,6 +65,13 @@ Options:
     -reindex    Ignore previously assigned values (except for R records in
                 the config file) and renumber everything starting at 100.

+    -state      Scan the sources and update the state file, but do not
+                write any header or C files.  Only useful with -internal.
+
+    -emit FILE  Write the named generated header or C file to standard
+                output and exit; no scan, no state update.  FILE must be
+                a file the config file names.  Only useful with -internal.
+
     -static     Make the load/unload functions static.

     -unref      List all unreferenced function and reason codes on stderr;
@@ -95,6 +103,11 @@ while ( @ARGV ) {
         $rebuild = 1;
     } elsif ( $arg eq "-reindex" ) {
         $reindex = 1;
+    } elsif ( $arg eq "-state" ) {
+        $stateonly = 1;
+    } elsif ( $arg eq "-emit" ) {
+        $emit = $ARGV[1];
+        shift @ARGV;
     } elsif ( $arg eq "-static" ) {
         $static = 1;
     } elsif ( $arg eq "-unref" ) {
@@ -113,7 +126,10 @@ while ( @ARGV ) {
 }

 my @source;
-if ( $internal ) {
+if ( defined $emit ) {
+    die "-emit is only useful with -internal\n" unless $internal;
+    die "Extra parameters given.\n" if @ARGV;
+} elsif ( $internal ) {
     die "Cannot mix -internal and -static\n" if $static;
     die "Extra parameters given.\n" if @ARGV;
     @source = ( glob('crypto/*.c'), glob('crypto/*/*.c'),
@@ -143,8 +159,10 @@ my %strings;    # define -> text
 # Read and parse the config file
 open(IN, "$config") || die "Can't open config file $config, $!,";
 while ( <IN> ) {
+    s|\R$||;                    # Better chomp; this may run on a
+                                # checkout with CRLF line endings
     next if /^#/ || /^$/;
-    if ( /^L\s+(\S+)\s+(\S+)\s+(\S+)(?:\s+(\S+))?\s+$/ ) {
+    if ( /^L\s+(\S+)\s+(\S+)\s+(\S+)(?:\s+(\S+))?\s*$/ ) {
         my $lib = $1;
         my $pubhdr = $2;
         my $err = $3;
@@ -181,6 +199,34 @@ if ( ! $statefile ) {
     $statefile =~ s/.ec/.txt/;
 }

+# Unless a rewrite or a report was explicitly requested, skip the run
+# entirely if nothing relevant changed since the last one.  The stamp
+# file records when a run last completed against the current sources;
+# it is a separate file rather than the statefile's own timestamp
+# because the statefile is a build input, and freshening it would
+# spuriously regenerate every emitted error file.  While the stamp is
+# newer than the config file, the statefile and every source file, a
+# new run would find no new reason codes and write nothing.
+if ( !defined $emit
+     && !$rebuild && !$reindex && !$nowrite && !$unref && !$debug
+     && scalar keys %modules == 0 ) {
+    my $stamp = (stat "$statefile.stamp")[9];
+
+    if ( defined $stamp ) {
+        my $uptodate = 1;
+
+        foreach my $file ( $config, $statefile, @source ) {
+            my $mtime = (stat $file)[9];
+
+            if ( !defined $mtime || $mtime >= $stamp ) {
+                $uptodate = 0;
+                last;
+            }
+        }
+        exit if $uptodate;
+    }
+}
+
 # The statefile has all the previous assignments.
 &phase("Reading state");
 my $skippedstate = 0;
@@ -190,6 +236,7 @@ if ( ! $reindex && $statefile ) {
     # Scan function and reason codes and store them: keep a note of the
     # maximum code used.
     while ( <STATE> ) {
+        s|\R$||;                # Better chomp, as above
         next if /^#/ || /^$/;
         my $name;
         my $code;
@@ -197,6 +244,9 @@ if ( ! $reindex && $statefile ) {
             $name = $1;
             $code = $2;
             my $next = <STATE>;
+
+            $next =~ s|\R$||;      # Better chomp, as above; the greedy
+                                    # trim below would keep a \r
             $next =~ s/^\s*(.*)\s*$/$1/;
             die "Duplicate define $name" if exists $strings{$name};
             $strings{$name} = $next;
@@ -286,6 +336,43 @@ foreach my $file ( @source ) {
 }
 print STDERR "\n" if $debug;

+# Resolve the values of the new reason codes before anything is
+# written; the state file and the emitted headers all need them.
+# Codes are assigned per library, in sorted reason order, into the
+# lowest free slot, exactly as the header emission historically did.
+&phase("Assigning codes");
+foreach my $lib ( keys %errorfile ) {
+    next if ! $rnew{$lib};
+    foreach my $i ( sort grep( /^${lib}_/, keys %rcodes ) ) {
+        next if $rcodes{$i} ne "X";
+        $rassigned{$lib} =~ m/^:([^:]*):/;
+        my $findcode = $1;
+
+        $findcode = $rmax{$lib} if !defined $findcode;
+        while ( $rassigned{$lib} =~ m/:$findcode:/ ) {
+            $findcode++;
+        }
+        $rcodes{$i} = $findcode;
+        $rassigned{$lib} .= "$findcode:";
+        print STDERR "New Reason code $i\n" if $debug;
+    }
+}
+
+# In -emit mode the state is the single source of truth: write the one
+# requested file to standard output and do nothing else.
+if ( defined $emit ) {
+    if ( defined $libprivinc{$emit} && $emit ne 'NONE' ) {
+        write_internal_header($libprivinc{$emit}, \*STDOUT);
+    } elsif ( defined $libpubinc{$emit} ) {
+        write_public_header($libpubinc{$emit}, \*STDOUT);
+    } elsif ( defined $cskip{$emit} ) {
+        write_c_source($cskip{$emit}, \*STDOUT);
+    } else {
+        die "$emit is not a file the config file $config knows about\n";
+    }
+    exit;
+}
+
 # Now process each library in turn.
 &phase("Writing files");
 my $newstate = 0;
@@ -295,39 +382,133 @@ foreach my $lib ( keys %errorfile ) {
     next if $nowrite;
     print STDERR "$lib: $rnew{$lib} new reasons\n" if $rnew{$lib};
     $newstate = 1;
+    next if $stateonly;

-    # If we get here then we have some new error codes so we
-    # need to rebuild the header file and C file.
+    if ($hprivinc{$lib} ne 'NONE') {
+        my $hfile = $hprivinc{$lib};

-    # Make a sorted list of error and reason codes for later use.
-    my @reasons  = sort grep( /^${lib}_/, keys %rcodes );
+        open( OUT, ">$hfile" ) || die "Can't write to $hfile, $!,";
+        write_internal_header($lib, \*OUT);
+        close OUT;
+    }
+    if ($hpubinc{$lib} ne 'NONE') {
+        my $hfile = $hpubinc{$lib};

-    # indent level for innermost preprocessor lines
-    my $indent = " ";
+        open( OUT, ">$hfile" ) || die "Can't write to $hfile, $!,";
+        write_public_header($lib, \*OUT);
+        close OUT;
+    }
+    if ($errorfile{$lib} ne 'NONE') {
+        my $cfile = $errorfile{$lib};

-    # Flag if the sub-library is disablable
-    # There are a few exceptions, where disabling the sub-library
-    # doesn't actually remove the whole sub-library, but rather implements
-    # it with a NULL backend.
-    my $disablable =
-        ($lib ne "SSL" && $lib ne "ASYNC" && $lib ne "DSO"
-         && (grep { $lib eq uc $_ } @disablables, @disablables_int));
+        open( OUT, ">$cfile" )
+            || die "Can't open $cfile for writing, $!, stopped";
+        write_c_source($lib, \*OUT);
+        close OUT;
+    }
+}

-    # Rewrite the internal header file if there is one ($internal only!)
+&phase("Ending");
+# Make a list of unreferenced reason codes
+if ( $unref ) {
+    my @runref;
+    foreach ( keys %rcodes ) {
+        push( @runref, $_ ) unless exists $usedreasons{$_};
+    }
+    if ( @runref ) {
+        print STDERR "The following reason codes were not referenced:\n";
+        foreach ( sort @runref ) {
+            print STDERR "  $_\n";
+        }
+    }
+}

-    if ($hprivinc{$lib} ne 'NONE') {
-        my $hfile = $hprivinc{$lib};
-        my $guard = $hfile;
+die "Found $errors errors, quitting" if $errors;

-        if ($guard =~ m|^include/|) {
-            $guard = $';
-        } else {
-            $guard = basename($guard);
-        }
-        $guard = "OSSL_" . join('_', split(m|[./]|, uc $guard));
+# Update the state file
+if ( $newstate )  {
+    open(OUT, ">$statefile.new")
+        || die "Can't write $statefile.new, $!";
+    print OUT <<"EOF";
+# Copyright 1999-$YEAR The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+EOF
+    print OUT "\n#Reason codes\n";
+    foreach my $i ( sort keys %rcodes ) {
+        my $short = "$i:$rcodes{$i}:";
+        my $t = exists $strings{$i} ? "$strings{$i}" : "";
+        $t = "\\\n\t" . $t if length($short) + length($t) > 80;
+        print OUT "$short$t\n";
+    }
+    close(OUT);
+    if ( $skippedstate ) {
+        print "Skipped state, leaving update in $statefile.new";
+    } else {
+        rename "$statefile", "$statefile.old"
+            || die "Can't backup $statefile to $statefile.old, $!";
+        rename "$statefile.new", "$statefile"
+            || die "Can't rename $statefile to $statefile.new, $!";
+    }
+}

-        open( OUT, ">$hfile" ) || die "Can't write to $hfile, $!,";
-        print OUT <<"EOF";
+# Record that the sources have been scanned against the current state;
+# the up-to-date check at the top keys on the stamp file.  The stamp
+# is touched on every completed run, not just null ones, so it is
+# always newer than the statefile it vouches for.
+if ( !$nowrite && !$reindex && scalar keys %modules == 0 ) {
+    open(STAMP, ">$statefile.stamp")
+        || warn "Can't write $statefile.stamp, $!";
+    close(STAMP);
+}
+
+exit;
+
+sub lib_disablable
+{
+    my $lib = shift;
+
+    # configdata is large and only needed when a file is actually
+    # written, so it is loaded lazily here rather than at startup.
+    require configdata;
+
+    # Flag if the sub-library is disablable.
+    # There are a few exceptions, where disabling the sub-library
+    # doesn't actually remove the whole sub-library, but rather
+    # implements it with a NULL backend or keeps part of it: no-http
+    # still builds http_lib.c for URL parsing, so the HTTP reason
+    # codes must remain visible.
+    return do {
+        # The 'once' warning does not know that require defines these.
+        no warnings 'once';
+
+        ($lib ne "SSL" && $lib ne "ASYNC" && $lib ne "DSO"
+         && $lib ne "HTTP"
+         && (grep { $lib eq uc $_ } @configdata::disablables,
+                                    @configdata::disablables_int));
+    };
+}
+
+# Write the internal header file for $lib ($internal only!)
+sub write_internal_header
+{
+    my ( $lib, $fh ) = @_;
+    my @reasons = sort grep( /^${lib}_/, keys %rcodes );
+    my $disablable = lib_disablable($lib);
+    my $hfile = $hprivinc{$lib};
+    my $guard = $hfile;
+
+    if ($guard =~ m|^include/|) {
+        $guard = $';
+    } else {
+        $guard = basename($guard);
+    }
+    $guard = "OSSL_" . join('_', split(m|[./]|, uc $guard));
+
+    print $fh <<"EOF";
 /*
  * Generated by util/mkerr.pl DO NOT EDIT
  * Copyright 2020-$YEAR The OpenSSL Project Authors. All Rights Reserved.
@@ -350,75 +531,64 @@ extern \"C\" {
 #endif

 EOF
-        $indent = ' ';
-        if ($disablable) {
-            print OUT <<"EOF";
+    my $indent = ' ';
+    if ($disablable) {
+        print $fh <<"EOF";
 #ifndef OPENSSL_NO_${lib}

 EOF
-            $indent = "  ";
-        }
-        print OUT <<"EOF";
+        $indent = "  ";
+    }
+    print $fh <<"EOF";
 int ossl_err_load_${lib}_strings(void);
 EOF

-        # If this library doesn't have a public header file, we write all
-        # definitions that would end up there here instead
-        if ($hpubinc{$lib} eq 'NONE') {
-            print OUT "\n/*\n * $lib reason codes.\n */\n";
-            foreach my $i ( @reasons ) {
-                my $z = 48 - length($i);
-                $z = 0 if $z < 0;
-                if ( $rcodes{$i} eq "X" ) {
-                    $rassigned{$lib} =~ m/^:([^:]*):/;
-                    my $findcode = $1;
-                    $findcode = $rmax{$lib} if !defined $findcode;
-                    while ( $rassigned{$lib} =~ m/:$findcode:/ ) {
-                        $findcode++;
-                    }
-                    $rcodes{$i} = $findcode;
-                    $rassigned{$lib} .= "$findcode:";
-                    print STDERR "New Reason code $i\n" if $debug;
-                }
-                printf OUT "#define $i $rcodes{$i}\n";
-            }
-            print OUT "\n";
+    # If this library doesn't have a public header file, we write all
+    # definitions that would end up there here instead
+    if ($hpubinc{$lib} eq 'NONE') {
+        print $fh "\n/*\n * $lib reason codes.\n */\n";
+        foreach my $i ( @reasons ) {
+            print $fh "#define $i $rcodes{$i}\n";
         }
+        print $fh "\n";
+    }

-        # This doesn't go all the way down to zero, to allow for the ending
-        # brace for 'extern "C" {'.
-        while (length($indent) > 1) {
-            $indent = substr $indent, 0, -1;
-            print OUT "#endif\n";
-        }
+    # This doesn't go all the way down to zero, to allow for the ending
+    # brace for 'extern "C" {'.
+    while (length($indent) > 1) {
+        $indent = substr $indent, 0, -1;
+        print $fh "#endif\n";
+    }

-        print OUT <<"EOF";
+    print $fh <<"EOF";

 #ifdef __cplusplus
 }
 #endif
 #endif
 EOF
-        close OUT;
-    }
-
-    # Rewrite the public header file
-
-    if ($hpubinc{$lib} ne 'NONE') {
-        my $extra_include =
-            $internal
-            ? ($lib ne 'SSL'
-               ? "#include <openssl/cryptoerr_legacy.h>\n"
-               : "#include <openssl/sslerr_legacy.h>\n")
-            : '';
-        my $hfile = $hpubinc{$lib};
-        my $guard = $hfile;
-        $guard =~ s|^include/||;
-        $guard = join('_', split(m|[./]|, uc $guard));
-        $guard = "OSSL_" . $guard unless $internal;
+}

-        open( OUT, ">$hfile" ) || die "Can't write to $hfile, $!,";
-        print OUT <<"EOF";
+# Write the public header file for $lib
+sub write_public_header
+{
+    my ( $lib, $fh ) = @_;
+    my @reasons = sort grep( /^${lib}_/, keys %rcodes );
+    my $disablable = lib_disablable($lib);
+    my $extra_include =
+        $internal
+        ? ($lib ne 'SSL'
+           ? "#include <openssl/cryptoerr_legacy.h>\n"
+           : "#include <openssl/sslerr_legacy.h>\n")
+        : '';
+    my $hfile = $hpubinc{$lib};
+    my $guard = $hfile;
+
+    $guard =~ s|^include/||;
+    $guard = join('_', split(m|[./]|, uc $guard));
+    $guard = "OSSL_" . $guard unless $internal;
+
+    print $fh <<"EOF";
 /*
  * Generated by util/mkerr.pl DO NOT EDIT
  * Copyright 1995-$YEAR The OpenSSL Project Authors. All Rights Reserved.
@@ -437,21 +607,21 @@ EOF
 #include <openssl/symhacks.h>
 $extra_include
 EOF
-        $indent = ' ';
-        if ( $internal ) {
-            if ($disablable) {
-                print OUT <<"EOF";
+    my $indent = ' ';
+    if ( $internal ) {
+        if ($disablable) {
+            print $fh <<"EOF";
 #ifndef OPENSSL_NO_${lib}
 EOF
-                $indent .= ' ';
-            }
-        } else {
-            print OUT <<"EOF";
+            $indent .= ' ';
+        }
+    } else {
+        print $fh <<"EOF";
 #define ${lib}err(f, r) ERR_${lib}_error(0, (r), OPENSSL_FILE, OPENSSL_LINE)
 #define ERR_R_${lib}_LIB ERR_${lib}_lib()
 EOF
-            if ( ! $static ) {
-                print OUT <<"EOF";
+        if ( ! $static ) {
+            print $fh <<"EOF";

 #ifdef __cplusplus
 extern \"C\" {
@@ -463,66 +633,52 @@ void ERR_${lib}_error(int function, int reason, const char *file, int line);
 }
 #endif
 EOF
-            }
         }
+    }

-        print OUT "/*\n * $lib reason codes.\n */\n";
-        foreach my $i ( @reasons ) {
-            my $z = 48 - length($i);
-            $z = 0 if $z < 0;
-            if ( $rcodes{$i} eq "X" ) {
-                $rassigned{$lib} =~ m/^:([^:]*):/;
-                my $findcode = $1;
-                $findcode = $rmax{$lib} if !defined $findcode;
-                while ( $rassigned{$lib} =~ m/:$findcode:/ ) {
-                    $findcode++;
-                }
-                $rcodes{$i} = $findcode;
-                $rassigned{$lib} .= "$findcode:";
-                print STDERR "New Reason code $i\n" if $debug;
-            }
-            printf OUT "#define $i $rcodes{$i}\n";
-        }
-        print OUT "\n";
-
-        while (length($indent) > 0) {
-            $indent = substr $indent, 0, -1;
-            print OUT "#endif\n";
-        }
-        close OUT;
+    print $fh "/*\n * $lib reason codes.\n */\n";
+    foreach my $i ( @reasons ) {
+        print $fh "#define $i $rcodes{$i}\n";
     }
+    print $fh "\n";

-    # Rewrite the C source file containing the error details.
+    while (length($indent) > 0) {
+        $indent = substr $indent, 0, -1;
+        print $fh "#endif\n";
+    }
+}

-    if ($errorfile{$lib} ne 'NONE') {
-        # First, read any existing reason string definitions:
-        my $cfile = $errorfile{$lib};
-        my $pack_lib = $internal ? "ERR_LIB_${lib}" : "0";
-        my $hpubincf = $hpubinc{$lib};
-        my $hprivincf = $hprivinc{$lib};
-        my $includes = '';
-        if ($internal) {
-            if ($hpubincf ne 'NONE') {
-                $hpubincf =~ s|^include/||;
-                $includes .= "#include <${hpubincf}>\n";
-            }
-            if ($hprivincf =~ m|^include/|) {
-                $hprivincf = $';
-            } else {
-                $hprivincf = abs2rel(rel2abs($hprivincf),
-                                     rel2abs(dirname($cfile)));
-            }
-            $includes .= "#include \"${hprivincf}\"\n";
+# Write the C source file containing the error details for $lib
+sub write_c_source
+{
+    my ( $lib, $fh ) = @_;
+    my @reasons = sort grep( /^${lib}_/, keys %rcodes );
+    my $disablable = lib_disablable($lib);
+    my $cfile = $errorfile{$lib};
+    my $pack_lib = $internal ? "ERR_LIB_${lib}" : "0";
+    my $hpubincf = $hpubinc{$lib};
+    my $hprivincf = $hprivinc{$lib};
+    my $includes = '';
+
+    if ($internal) {
+        if ($hpubincf ne 'NONE') {
+            $hpubincf =~ s|^include/||;
+            $includes .= "#include <${hpubincf}>\n";
+        }
+        if ($hprivincf =~ m|^include/|) {
+            $hprivincf = $';
         } else {
-            $includes .= "#include \"${hpubincf}\"\n";
+            $hprivincf = abs2rel(rel2abs($hprivincf),
+                                 rel2abs(dirname($cfile)));
         }
+        $includes .= "#include \"${hprivincf}\"\n";
+    } else {
+        $includes .= "#include \"${hpubincf}\"\n";
+    }

-        open( OUT, ">$cfile" )
-            || die "Can't open $cfile for writing, $!, stopped";
-
-        my $const = $internal ? 'const ' : '';
+    my $const = $internal ? 'const ' : '';

-        print OUT <<"EOF";
+    print $fh <<"EOF";
 /*
  * Generated by util/mkerr.pl DO NOT EDIT
  * Copyright 1995-$YEAR The OpenSSL Project Authors. All Rights Reserved.
@@ -536,48 +692,50 @@ EOF
 #include <openssl/err.h>
 $includes
 EOF
-        $indent = '';
-        if ( $internal ) {
-            if ($disablable) {
-                print OUT <<"EOF";
+    my $indent = '';
+    if ( $internal ) {
+        if ($disablable) {
+            print $fh <<"EOF";
 #ifndef OPENSSL_NO_${lib}

 EOF
-                $indent .= ' ';
-            }
+            $indent .= ' ';
         }
-        print OUT <<"EOF";
+    }
+    print $fh <<"EOF";
 #ifndef OPENSSL_NO_ERR

 static ${const}ERR_STRING_DATA ${lib}_str_reasons[] = {
 EOF

-        # Add each reason code.
-        foreach my $i ( @reasons ) {
-            my $rn;
-            if ( exists $strings{$i} ) {
-                $rn = $strings{$i};
-                $rn = "" if $rn eq '*';
-            } else {
-                $i =~ /^${lib}_R_(\S+)$/;
-                $rn = $1;
-                $rn =~ tr/_[A-Z]/ [a-z]/;
-                $strings{$i} = $rn;
-            }
-            my $lines;
-            $lines = "    { ERR_PACK($pack_lib, 0, $i), \"$rn\" },";
-            $lines = "    { ERR_PACK($pack_lib, 0, $i),\n        \"$rn\" },"
-                if length($lines) > 82;
-            print OUT "$lines\n";
+    # Add each reason code.
+    foreach my $i ( @reasons ) {
+        my $rn;
+
+        if ( exists $strings{$i} ) {
+            $rn = $strings{$i};
+            $rn = "" if $rn eq '*';
+        } else {
+            $i =~ /^${lib}_R_(\S+)$/;
+            $rn = $1;
+            $rn =~ tr/_[A-Z]/ [a-z]/;
+            $strings{$i} = $rn;
         }
-        print OUT <<"EOF";
+        my $lines;
+
+        $lines = "    { ERR_PACK($pack_lib, 0, $i), \"$rn\" },";
+        $lines = "    { ERR_PACK($pack_lib, 0, $i),\n        \"$rn\" },"
+            if length($lines) > 82;
+        print $fh "$lines\n";
+    }
+    print $fh <<"EOF";
     { 0, NULL }
 };

 #endif
 EOF
-        if ( $internal ) {
-            print OUT <<"EOF";
+    if ( $internal ) {
+        print $fh <<"EOF";

 int ossl_err_load_${lib}_strings(void)
 {
@@ -588,9 +746,10 @@ int ossl_err_load_${lib}_strings(void)
     return 1;
 }
 EOF
-        } else {
-            my $st = $static ? "static " : "";
-            print OUT <<"EOF";
+    } else {
+        my $st = $static ? "static " : "";
+
+        print $fh <<"EOF";

 static int lib_code = 0;
 static int error_loaded = 0;
@@ -635,68 +794,17 @@ ${st}int ERR_${lib}_lib(void)
 }
 EOF

-        }
+    }

-        while (length($indent) > 1) {
-            $indent = substr $indent, 0, -1;
-            print OUT "#endif\n";
-        }
-        if ($internal && $disablable) {
-            print OUT <<"EOF";
+    while (length($indent) > 1) {
+        $indent = substr $indent, 0, -1;
+        print $fh "#endif\n";
+    }
+    if ($internal && $disablable) {
+        print $fh <<"EOF";
 #else
 NON_EMPTY_TRANSLATION_UNIT
 #endif
 EOF
-        }
-        close OUT;
     }
 }
-
-&phase("Ending");
-# Make a list of unreferenced reason codes
-if ( $unref ) {
-    my @runref;
-    foreach ( keys %rcodes ) {
-        push( @runref, $_ ) unless exists $usedreasons{$_};
-    }
-    if ( @runref ) {
-        print STDERR "The following reason codes were not referenced:\n";
-        foreach ( sort @runref ) {
-            print STDERR "  $_\n";
-        }
-    }
-}
-
-die "Found $errors errors, quitting" if $errors;
-
-# Update the state file
-if ( $newstate )  {
-    open(OUT, ">$statefile.new")
-        || die "Can't write $statefile.new, $!";
-    print OUT <<"EOF";
-# Copyright 1999-$YEAR The OpenSSL Project Authors. All Rights Reserved.
-#
-# Licensed under the Apache License 2.0 (the "License").  You may not use
-# this file except in compliance with the License.  You can obtain a copy
-# in the file LICENSE in the source distribution or at
-# https://www.openssl.org/source/license.html
-EOF
-    print OUT "\n#Reason codes\n";
-    foreach my $i ( sort keys %rcodes ) {
-        my $short = "$i:$rcodes{$i}:";
-        my $t = exists $strings{$i} ? "$strings{$i}" : "";
-        $t = "\\\n\t" . $t if length($short) + length($t) > 80;
-        print OUT "$short$t\n";
-    }
-    close(OUT);
-    if ( $skippedstate ) {
-        print "Skipped state, leaving update in $statefile.new";
-    } else {
-        rename "$statefile", "$statefile.old"
-            || die "Can't backup $statefile to $statefile.old, $!";
-        rename "$statefile.new", "$statefile"
-            || die "Can't rename $statefile to $statefile.new, $!";
-    }
-}
-
-exit;
diff --git a/deps/openssl/openssl/util/mkinstallvars.pl b/deps/openssl/openssl/util/mkinstallvars.pl
index 6e15282ddbf..09924901cef 100644
--- a/deps/openssl/openssl/util/mkinstallvars.pl
+++ b/deps/openssl/openssl/util/mkinstallvars.pl
@@ -19,6 +19,8 @@ use File::Spec;
 #use List::Util qw(pairs);
 sub _pairs (@);

+my $debug = $ENV{OPENSSL_MKINSTALLVARS_DEBUG} || 0;
+
 # These are expected to be set up as absolute directories
 my @absolutes = qw(PREFIX libdir);
 # These may be absolute directories, and if not, they are expected to be set up
@@ -26,7 +28,7 @@ my @absolutes = qw(PREFIX libdir);
 # since the LIBDIR subdirectories depend on the calculation of LIBDIR from
 # PREFIX.
 my @subdirs = _pairs (PREFIX => [ qw(BINDIR LIBDIR INCLUDEDIR APPLINKDIR) ],
-                      LIBDIR => [ qw(ENGINESDIR MODULESDIR PKGCONFIGDIR
+                      LIBDIR => [ qw(MODULESDIR PKGCONFIGDIR
                                      CMAKECONFIGDIR) ]);
 # For completeness, other expected variables
 my @others = qw(COMMENT VERSION LDLIBS);
@@ -35,7 +37,7 @@ my %all = ( );
 foreach (@absolutes) { $all{$_} = 1 }
 foreach (@subdirs) { foreach (@{$_->[1]}) { $all{$_} = 1 } }
 foreach (@others) { $all{$_} = 1 }
-print STDERR "DEBUG: all keys: ", join(", ", sort keys %all), "\n";
+print STDERR "DEBUG: all keys: ", join(", ", sort keys %all), "\n" if $debug;

 my %keys = ();
 my %values = ();
@@ -52,9 +54,9 @@ foreach (@ARGV) {
 # the former doesn't have a value, we give it the latter's value, and rely
 # on mechanisms further down to do the rest of the processing.
 # If they're both empty, it's still fine.
-print STDERR "DEBUG: LIBDIR = $values{LIBDIR}->[0], libdir = $values{libdir}->[0] => ";
+print STDERR "DEBUG: LIBDIR = $values{LIBDIR}->[0], libdir = $values{libdir}->[0] => " if $debug;
 $values{LIBDIR}->[0] = $values{libdir}->[0] unless $values{LIBDIR}->[0];
-print STDERR "LIBDIR = $values{LIBDIR}->[0]\n";
+print STDERR "LIBDIR = $values{LIBDIR}->[0]\n" if $debug;

 # warn if there are missing values, and also if there are unexpected values
 foreach my $k (sort keys %all) {
@@ -69,10 +71,10 @@ foreach my $k (sort keys %keys) {
 foreach my $k (@absolutes) {
     my $v = $values{$k} || [ '.' ];
     die "Can't have more than one $k\n" if scalar @$v > 1;
-    print STDERR "DEBUG: $k = $v->[0] => ";
+    print STDERR "DEBUG: $k = $v->[0] => " if $debug;
     $v = [ map { File::Spec->rel2abs($_) } @$v ];
     $values{$k} = $v;
-    print STDERR "$k = $v->[0]\n";
+    print STDERR "$k = $v->[0]\n" if $debug;
 }

 # Absolute paths for the subdir variables are computed.  This provides
@@ -90,7 +92,7 @@ foreach my $pair (@subdirs) {
         $values{$k} = [];       # We're rebuilding it
         print STDERR "DEBUG: $k = ",
             (scalar @$v2 > 1 ? "[ " . join(", ", @$v2) . " ]" : $v2->[0]),
-            " => ";
+            " => " if $debug;
         foreach my $v (@$v2) {
             if (File::Spec->file_name_is_absolute($v)) {
                 push @{$values{$k}}, $v;
@@ -109,7 +111,7 @@ foreach my $pair (@subdirs) {
                                          ? "[ " . join(", ", @$v) . " ]"
                                          : $v->[0]);
                           } ($k, $kr)),
-            "\n";
+            "\n" if $debug;
     }
 }

diff --git a/deps/openssl/openssl/util/mknum.pl b/deps/openssl/openssl/util/mknum.pl
index 8c978dfe2dc..7d821e20756 100644
--- a/deps/openssl/openssl/util/mknum.pl
+++ b/deps/openssl/openssl/util/mknum.pl
@@ -1,6 +1,6 @@

 #! /usr/bin/env perl
-# Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -39,6 +39,29 @@ GetOptions('ordinals=s' => \$ordinals_file,
 die "Please supply ordinals file\n"
     unless $ordinals_file;

+# The ordinals file is rewritten on every run, so its timestamp
+# records the last completed run.  While it is newer than the symbol
+# hacking file and every header given, the last run saw the tree in
+# its current state and re-parsing would change nothing; skip it.
+# Modes that exist to report or to renumber always run.
+unless ($checkexist || $renumber || $verbose || $debug) {
+    my $stamp = (stat $ordinals_file)[9];
+
+    if (defined $stamp) {
+        my $uptodate = 1;
+
+        foreach my $f (($symhacks_file // (), @ARGV)) {
+            my $mtime = (stat $f)[9];
+
+            if (!defined $mtime || $mtime >= $stamp) {
+                $uptodate = 0;
+                last;
+            }
+        }
+        exit 0 if $uptodate;
+    }
+}
+
 my $ordinals = OpenSSL::Ordinals->new(from => $ordinals_file,
                                       warnings => $warnings,
                                       verbose => $verbose,
diff --git a/deps/openssl/openssl/util/mkpod2html.pl b/deps/openssl/openssl/util/mkpod2html.pl
index ea1164d597c..d23ee4b2eaa 100755
--- a/deps/openssl/openssl/util/mkpod2html.pl
+++ b/deps/openssl/openssl/util/mkpod2html.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -11,51 +11,169 @@ use warnings;

 use lib ".";
 use Getopt::Std;
+use File::Basename;
 use Pod::Html;
 use File::Spec::Functions qw(:DEFAULT rel2abs);

+# With -i, convert the one named pod, which is what the per-page rules and
+# the other build systems do.  Without it, convert every pod named on the
+# command line, deriving each output from the pod's own path.  Pod::Html is
+# expensive to compile and OpenSSL has over nine hundred pages, so loading
+# it once and dividing the pages between a few forked workers is far
+# cheaper than starting this program once per page.
+
 # Options.
-our($opt_i);    # -i INFILE
-our($opt_o);    # -o OUTFILE
-our($opt_t);    # -t TITLE
-our($opt_r);    # -r PODROOT
+our ($opt_i);    # -i INFILE, one page; without it, pods are read from @ARGV
+our ($opt_o);    # -o OUTFILE with -i, otherwise the directory to write into
+our ($opt_t);    # -t TITLE, only with -i
+our ($opt_r);    # -r PODROOT
+our ($opt_j);    # -j JOBS, only without -i

-getopts('i:o:t:r:');
-die "-i flag missing" unless $opt_i;
+getopts('i:o:t:r:j:');
 die "-o flag missing" unless $opt_o;
-die "-t flag missing" unless $opt_t;
 die "-r flag missing" unless $opt_r;

 # We originally used realpath() here, but the Windows implementation appears
 # to require that the directory or file exist to be able to process the input,
 # so we use rel2abs() instead, which only processes the string without
 # looking further.
-$opt_i = rel2abs($opt_i) or die "Can't convert to real path: $!";
-$opt_o = rel2abs($opt_o) or die "Can't convert to real path: $!";
-$opt_r = rel2abs($opt_r) or die "Can't convert to real path: $!";
-
-pod2html
-    "--infile=$opt_i",
-    "--outfile=$opt_o",
-    "--title=$opt_t",
-    "--podroot=$opt_r",
-    "--podpath=man1:man3:man5:man7",
-    "--htmldir=..";
-
-# Read in contents.
-open F, "<$opt_o"
-    or die "Can't read $opt_o, $!";
-my $contents = '';
+my $podroot = rel2abs($opt_r) or die "Can't convert to real path: $!";
+
+sub cpu_count
+{
+    my $cpus = $ENV{"NUMBER_OF_PROCESSORS"};    # Windows sets this.
+
+    if (!defined($cpus) && $^O =~ /linux/) {
+        my $tmp = qx(nproc 2>/dev/null);
+
+        $cpus = $tmp if $? == 0 && $tmp > 0;
+    }
+    if (!defined($cpus) && -r "/proc/cpuinfo") {
+        my $tmp = qx(grep -c ^processor /proc/cpuinfo 2>/dev/null);
+
+        $cpus = $tmp if $? == 0 && $tmp > 0;
+    }
+    if (!defined($cpus)) {
+        my $tmp = qx(sysctl -n hw.ncpu 2>/dev/null);    # BSDs, macOS
+
+        $cpus = $tmp if $? == 0 && $tmp > 0;
+    }
+
+    return defined($cpus) && $cpus > 0 ? int($cpus) : 1;
+}
+
+# Turn one pod into one HTML page.
+sub format_page
+{
+    my ($pod, $out, $title) = @_;
+
+    $pod = rel2abs($pod) or die "Can't convert to real path: $!";
+    $out = rel2abs($out) or die "Can't convert to real path: $!";
+
+    unlink $out;
+
+    pod2html "--infile=$pod",
+             "--outfile=$out",
+             "--title=$title",
+             "--podroot=$podroot",
+             "--podpath=man1:man3:man5:man7",
+             "--htmldir=..";
+
+    # Read in contents.
+    open my $fh, "<", $out
+        or die "Can't read $out, $!";
+    my $contents = do { local $/ = undef; <$fh> };
+    close $fh;
+    unlink $out;
+
+    $contents =~
+        s|href="http://man\.he\.net/(man\d/[^"]+)(?:\.html)?"|href="../$1.html"|g;
+    open $fh, ">", $out
+        or die "Can't write $out, $!";
+    print $fh $contents;
+    close $fh;
+
+    chmod 0444, $out
+        or die "Can't set the mode of $out, $!\n";
+}
+
+# One named page: the output file and title are given.
+if (defined $opt_i) {
+    die "-t flag missing" unless $opt_t;
+    format_page($opt_i, $opt_o, $opt_t);
+    exit 0;
+}
+
+# Otherwise every pod named on the command line, with $opt_o the directory
+# holding the man1..man7 subdirectories: doc/man3/BIO_s_mem.pod becomes
+# $opt_o/man3/BIO_s_mem.html, titled BIO_s_mem.
+sub page_of
+{
+    my $pod = shift;
+    my $name = basename($pod, ".pod");
+    my ($section) = basename(dirname($pod)) =~ m|^man(\d)$|;
+
+    die "Can't tell the section of $pod from its directory\n"
+        unless defined $section;
+
+    return ("$opt_o/man$section/$name.html", $name);
+}
+
+my @pods = @ARGV;
+
+exit 0 unless @pods;
+
+# Only ask how many processors there are when the answer can matter; the
+# count is found by running a command.
+my $jobs = @pods > 1
+    ? (defined $opt_j && $opt_j > 0 ? int($opt_j) : cpu_count())
+    : 1;
+
+$jobs = scalar @pods if $jobs > @pods;
+
+sub format_pods
 {
-    local $/ = undef;
-    $contents = <F>;
-}
-close F;
-unlink $opt_o;
-
-$contents =~
-    s|href="http://man\.he\.net/(man\d/[^"]+)(?:\.html)?"|href="../$1.html"|g;
-open F, ">$opt_o"
-    or die "Can't write $opt_o, $!";
-print F $contents;
-close F;
+    foreach my $pod (@_) {
+        my ($out, $title) = page_of($pod);
+
+        # The page is current when it is newer than the pod it comes from.
+        next if -e $out && -M $out < -M $pod;
+
+        format_page($pod, $out, $title);
+    }
+}
+
+if ($jobs <= 1) {
+    format_pods(@pods);
+    exit 0;
+}
+
+my @pids;
+
+foreach my $worker (0 .. $jobs - 1) {
+    my $pid = fork();
+
+    die "Can't fork, $!\n" unless defined $pid;
+    if (!$pid) {
+        # Deal every $jobs'th page to this worker.  The pages differ a lot
+        # in size, and dealing them out interleaves the large ones instead
+        # of handing one worker a contiguous run of them.
+        my @mine;
+
+        for (my $i = $worker; $i <= $#pods; $i += $jobs) {
+            push @mine, $pods[$i];
+        }
+        format_pods(@mine);
+        exit 0;
+    }
+    push @pids, $pid;
+}
+
+my $failed = 0;
+
+foreach my $pid (@pids) {
+    waitpid($pid, 0);
+    $failed = 1 if $?;
+}
+
+die "Failed to convert the manual pages to HTML\n" if $failed;
diff --git a/deps/openssl/openssl/util/mkpod2man.pl b/deps/openssl/openssl/util/mkpod2man.pl
new file mode 100644
index 00000000000..778dc2b0918
--- /dev/null
+++ b/deps/openssl/openssl/util/mkpod2man.pl
@@ -0,0 +1,136 @@
+#! /usr/bin/env perl
+# Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+use strict;
+use warnings;
+
+use Getopt::Std;
+use File::Basename;
+use Pod::Man;
+
+# Format man pages without loading Pod::Man once per page.  pod2man is a
+# perl program that compiles Pod::Man before it reads a single pod, and
+# OpenSSL has over nine hundred pages, so running it once per page spends
+# most of that time compiling the same module again and again.  Here the
+# module is loaded once and the pages are then divided between a few
+# forked workers, which inherit it already compiled.
+
+# Options.  The whole manual is formatted in one run, so the section of
+# each page is taken from the directory its pod lives in rather than
+# given on the command line: doc/man3/BIO_s_mem.pod is section 3 and
+# becomes OUTDIR/man3/BIO_s_mem.3.
+our ($opt_o);    # -o OUTDIR, the directory holding the man1..man7 dirs
+our ($opt_m);    # -m MANSUFFIX, appended to the section inside the page
+our ($opt_d);    # -d DATE
+our ($opt_r);    # -r RELEASE
+our ($opt_j);    # -j JOBS
+
+getopts('o:m:d:r:j:');
+die "-o flag missing" unless defined $opt_o;
+$opt_m = '' unless defined $opt_m;
+$opt_d = '' unless defined $opt_d;
+$opt_r = '' unless defined $opt_r;
+
+sub cpu_count
+{
+    my $cpus = $ENV{"NUMBER_OF_PROCESSORS"};    # Windows sets this.
+
+    if (!defined($cpus) && $^O =~ /linux/) {
+        my $tmp = qx(nproc 2>/dev/null);
+
+        $cpus = $tmp if $? == 0 && $tmp > 0;
+    }
+    if (!defined($cpus) && -r "/proc/cpuinfo") {
+        my $tmp = qx(grep -c ^processor /proc/cpuinfo 2>/dev/null);
+
+        $cpus = $tmp if $? == 0 && $tmp > 0;
+    }
+    if (!defined($cpus)) {
+        my $tmp = qx(sysctl -n hw.ncpu 2>/dev/null);    # BSDs, macOS
+
+        $cpus = $tmp if $? == 0 && $tmp > 0;
+    }
+
+    return defined($cpus) && $cpus > 0 ? int($cpus) : 1;
+}
+
+# Turn one pod into one man page.
+sub format_page
+{
+    my $pod = shift;
+    my $name = basename($pod, ".pod");
+    my $dir = basename(dirname($pod));
+    my ($section) = $dir =~ m|^man(\d)$|;
+
+    die "Can't tell the section of $pod from its directory\n"
+        unless defined $section;
+
+    my $out = "$opt_o/man$section/$name.$section";
+
+    # The page is current when it is newer than the pod it comes from.
+    return if -e $out && -M $out < -M $pod;
+
+    unlink $out;
+
+    Pod::Man->new(name => uc $name,
+                  section => "$section$opt_m",
+                  center => "OpenSSL",
+                  date => $opt_d,
+                  release => $opt_r)
+        ->parse_from_file($pod, $out);
+
+    chmod 0444, $out
+        or die "Can't set the mode of $out, $!\n";
+}
+
+my @pods = @ARGV;
+
+exit 0 unless @pods;
+
+# Only ask how many processors there are when the answer can matter;
+# the count is found by running a command, and the per-page rules call
+# this script with a single pod.
+my $jobs = @pods > 1
+    ? (defined $opt_j && $opt_j > 0 ? int($opt_j) : cpu_count())
+    : 1;
+
+$jobs = scalar @pods if $jobs > @pods;
+
+# One page, or no reason to fork: do the work here.  This is also the path
+# taken where fork() is emulated and would cost more than it saves.
+if ($jobs <= 1) {
+    format_page($_) foreach @pods;
+    exit 0;
+}
+
+my @pids;
+
+foreach my $worker (0 .. $jobs - 1) {
+    my $pid = fork();
+
+    die "Can't fork, $!\n" unless defined $pid;
+    if (!$pid) {
+        # Deal every $jobs'th page to this worker.  The pages differ a lot
+        # in size, and dealing them out interleaves the large ones instead
+        # of handing one worker a contiguous run of them.
+        for (my $i = $worker; $i <= $#pods; $i += $jobs) {
+            format_page($pods[$i]);
+        }
+        exit 0;
+    }
+    push @pids, $pid;
+}
+
+my $failed = 0;
+
+foreach my $pid (@pids) {
+    waitpid($pid, 0);
+    $failed = 1 if $?;
+}
+
+die "Failed to format the manual pages\n" if $failed;
diff --git a/deps/openssl/openssl/util/mkwraps.pl b/deps/openssl/openssl/util/mkwraps.pl
new file mode 100755
index 00000000000..91a44cbb3fd
--- /dev/null
+++ b/deps/openssl/openssl/util/mkwraps.pl
@@ -0,0 +1,592 @@
+#! /usr/bin/env perl
+# Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+use strict;
+use warnings;
+
+use Getopt::Long;
+use File::Spec::Functions qw(catdir catfile file_name_is_absolute rel2abs);
+use File::Basename qw(dirname);
+
+my $build_info_file;
+my $target;
+my @extra_includes;
+my $output_file;
+my $mode = 'both';
+my $cc;
+my $use_system = 1;
+my $verbose = 0;
+my $help = 0;
+
+GetOptions('build-info=s' => \$build_info_file,
+           'target=s'     => \$target,
+           'include=s'    => \@extra_includes,
+           'output=s'     => \$output_file,
+           'mode=s'       => \$mode,
+           'cc=s'         => \$cc,
+           'system!'      => \$use_system,
+           'verbose'      => \$verbose,
+           'help'         => \$help)
+    or die "Error in command line arguments\n";
+
+$cc = $ENV{CC} || 'cc' unless defined $cc;
+
+sub help
+{
+    print STDERR <<"EOF";
+mkwraps.pl [options]
+
+Options:
+
+    --build-info FILE  build.info file containing a WRAP[<target>] entry.
+
+    --target NAME      Test program name used as the WRAP[]/INCLUDE[] key.
+
+    --include DIR      Extra include directory to search.  Cumulative.
+
+    --output FILE      Output file.  Defaults to stdout.
+
+    --mode MODE        What to emit: 'wraps', 'expects' or 'both'.
+                       Defaults to 'both'.
+
+    --cc NAME          C compiler used to discover the default system
+                       include search paths.  Defaults to \$CC or 'cc'.
+
+    --no-system        Do not fall back to the compiler's default system
+                       include directories.  By default, functions not
+                       found in the project headers (typically libc/POSIX
+                       functions) are looked up there.
+
+    --verbose          Print progress to stderr.
+
+    --help             Show this help text.
+
+For each function name listed in WRAP[<target>], the script searches
+the headers (*.h) under each directory in INCLUDE[<target>], resolved
+relative to the directory containing the build.info file, plus any
+extra --include directories.  The search recurses into subdirectories,
+mirroring how the compiler resolves <subdir/header.h> via -I flags.
+The first header containing a matching declaration provides the
+prototype.
+
+Functions not found in those directories (typically system functions
+such as read() or socket()) are then looked up under the compiler's
+default include search paths, as reported by the C compiler.  System
+prototypes are emitted with angle-bracket #include directives.  Use
+--no-system to disable this fallback.
+
+The output is meant as a stub for further editing.  Custom logic
+(out-parameters, variadic forwarding, side effects on globals) still
+needs to be written manually, and the emitted #include directives may
+need to be adjusted (e.g. to add internal headers for opaque types).
+Long lines in the output are not wrapped.
+EOF
+}
+
+if ($help) {
+    &help();
+    exit 0;
+}
+
+unless (defined $build_info_file && defined $target) {
+    &help();
+    exit 1;
+}
+
+die "--mode must be 'wraps', 'expects' or 'both'\n"
+    unless $mode =~ /^(?:wraps|expects|both)$/;
+
+my @t = localtime();
+my $YEAR = $t[5] + 1900;
+
+# Parse the build.info file.  We are only interested in two directives,
+# WRAP[<target>] and INCLUDE[<target>], either of which may be split
+# across several physical lines using the usual backslash continuation.
+
+my @wraps;
+my @includes;
+
+open(IN, "<$build_info_file") || die "Can't open $build_info_file, $!,";
+my $content = do { local $/; <IN> };
+close IN;
+
+$content =~ s/\\\n\s*/ /g;
+
+foreach (split /\n/, $content) {
+    next if /^\s*#/ || /^\s*$/;
+    if (/^\s*WRAP\[\Q$target\E\]\s*=\s*(.+?)\s*$/) {
+        push @wraps, split(/\s+/, $1);
+    } elsif (/^\s*INCLUDE\[\Q$target\E\]\s*=\s*(.+?)\s*$/) {
+        push @includes, split(/\s+/, $1);
+    }
+}
+
+die "No WRAP[$target] entry found in $build_info_file\n" unless @wraps;
+
+my $bi_dir = dirname($build_info_file);
+my @search_dirs;
+foreach my $inc (@includes, @extra_includes) {
+    push @search_dirs,
+        file_name_is_absolute($inc) ? $inc : rel2abs(catdir($bi_dir, $inc));
+}
+
+print STDERR "Wraps:\n  ", join("\n  ", @wraps), "\n" if $verbose;
+print STDERR "Search dirs:\n  ", join("\n  ", @search_dirs), "\n" if $verbose;
+
+# Walk all search directories and get them in the order that level ones are
+# first followed by subdirs so if there are nested includes, we get the
+# shortest ones first searched.  Each base is a [dir, is_system] pair and the
+# is_system flag is carried onto every header found beneath it, so that system
+# prototypes can later be emitted with angle-bracket includes.
+sub find_headers
+{
+    my (@bases) = @_;
+    my @found;
+    my @queue = map { [$_->[0], '', $_->[1]] } @bases;
+
+    while (@queue) {
+        my @next;
+        my @level_files;
+        foreach my $entry (@queue) {
+            my ($dir, $rel, $sys) = @$entry;
+            next unless -d $dir;
+            opendir(my $dh, $dir) or next;
+            foreach my $name (readdir $dh) {
+                next if $name =~ /^\./;
+                my $full = catfile($dir, $name);
+                my $newrel = $rel eq '' ? $name : "$rel/$name";
+                if (-d $full) {
+                    push @next, [$full, $newrel, $sys];
+                } elsif (-f $full && $name =~ /\.h$/) {
+                    push @level_files, [$full, $newrel, $sys];
+                }
+            }
+            closedir $dh;
+        }
+        # Stable sort within a level for deterministic ordering.
+        push @found, sort { $a->[1] cmp $b->[1] } @level_files;
+        @queue = sort { $a->[1] cmp $b->[1] } @next;
+    }
+    return @found;
+}
+
+# Ask the C compiler for its default "#include <...>" search paths.  Returns
+# the list of existing directories, in search order.  Empty on failure.
+sub system_include_dirs
+{
+    my ($compiler) = @_;
+    my $out = `$compiler -xc -E -v /dev/null 2>&1`;
+    return () unless defined $out
+        && $out =~ /search starts here:(.*?)End of search list\./s;
+    my @dirs;
+    foreach my $line (split /\n/, $1) {
+        $line =~ s/^\s+//;
+        $line =~ s/\s+$//;
+        # clang annotates framework directories; skip those.
+        next if $line eq '' || $line =~ /\(framework directory\)$/;
+        push @dirs, $line if -d $line;
+    }
+    return @dirs;
+}
+
+# Project headers are searched first (with is_system = 0) so that a project
+# declaration always wins over a colliding system one.  The system headers are
+# appended lazily, only if some function is not found in the project headers.
+my @search_files = find_headers(map { [$_, 0] } @search_dirs);
+my $system_loaded = 0;
+
+sub load_system_headers
+{
+    return if $system_loaded;
+    $system_loaded = 1;
+    return unless $use_system;
+    my @sys_dirs = system_include_dirs($cc);
+    unless (@sys_dirs) {
+        warn "WARNING: could not determine system include dirs from '$cc'\n";
+        return;
+    }
+    print STDERR "System include dirs:\n  ", join("\n  ", @sys_dirs), "\n"
+        if $verbose;
+    push @search_files, find_headers(map { [$_, 1] } @sys_dirs);
+}
+
+my %file_cache;
+
+sub strip_c_comments
+{
+    my $s = shift;
+    $s =~ s{/\*.*?\*/}{}sg;
+    $s =~ s{//[^\n]*}{}g;
+    return $s;
+}
+
+# Drop attribute and qualifier macros that should not appear in the
+# emitted return type.
+sub strip_attribute_macros
+{
+    my $s = shift;
+    foreach my $kw (qw(__owur __pure __malloc__ ossl_inline static inline
+                       extern OSSL_DEPRECATEDIN_0_9_8
+                       OSSL_DEPRECATEDIN_1_0_0 OSSL_DEPRECATEDIN_1_1_0
+                       OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATEDIN_3_1
+                       OSSL_DEPRECATEDIN_3_2 OSSL_DEPRECATEDIN_3_3
+                       OSSL_DEPRECATEDIN_3_4 OSSL_DEPRECATEDIN_3_5)) {
+        $s =~ s/\b\Q$kw\E\b//g;
+    }
+    $s =~ s/\b__attribute__\s*\(\([^)]*\)\)//g;
+    $s =~ s/\s+/ /g;
+    $s =~ s/^\s+|\s+$//g;
+    return $s;
+}
+
+# Consume reserved-namespace decorations between a declaration's closing
+# parenthesis and its semicolon, e.g. glibc's __THROW, __wur or
+# __attr_access ((...)).  Only __-prefixed tokens (with an optional balanced
+# argument list) are eaten, so a genuine following declaration is left alone.
+sub skip_trailing_attributes
+{
+    my $s = shift;
+    while (1) {
+        $s =~ s/^\s+//;
+        last unless $s =~ /^(__\w+)/;
+        $s = substr($s, length($1));
+        $s =~ s/^\s+//;
+        if ($s =~ /^\(/) {
+            my $depth = 0;
+            my $i = 0;
+            while ($i < length($s)) {
+                my $c = substr($s, $i, 1);
+                $depth++ if $c eq '(';
+                $depth-- if $c eq ')';
+                $i++;
+                last if $depth == 0;
+            }
+            return $s if $depth != 0;
+            $s = substr($s, $i);
+        }
+    }
+    return $s;
+}
+
+sub find_function_decl
+{
+    my ($funcname) = @_;
+
+    foreach my $entry (@search_files) {
+        my ($file, $relpath, $is_system) = @$entry;
+        unless (exists $file_cache{$file}) {
+            my $text = '';
+            if (open(my $fh, '<', $file)) {
+                local $/;
+                $text = <$fh>;
+                close $fh;
+            }
+            $file_cache{$file} = strip_c_comments($text);
+        }
+        my $text = $file_cache{$file};
+
+        while ($text =~ /\b\Q$funcname\E\s*\(/g) {
+            my $name_start = $-[0];
+            my $paren_start = pos($text);
+
+            # Find matching closing paren, respecting nesting.
+            my $depth = 1;
+            my $cursor = $paren_start;
+            while ($cursor < length($text) && $depth > 0) {
+                my $c = substr($text, $cursor, 1);
+                $depth++ if $c eq '(';
+                $depth-- if $c eq ')';
+                $cursor++;
+            }
+            next if $depth != 0;
+            my $params_str =
+                substr($text, $paren_start, $cursor - $paren_start - 1);
+
+            # What follows must be ; for this to be a declaration, possibly
+            # after trailing attribute macros (__THROW, __wur, ...).
+            my $after = substr($text, $cursor);
+            $after = skip_trailing_attributes($after);
+            next unless $after =~ /^;/;
+
+            # Anything since the previous statement terminator is the return
+            # type expression.
+            my $pre = substr($text, 0, $name_start);
+            $pre =~ s/\s+$//;
+            my $ret_start = 0;
+            $ret_start = $-[2] if $pre =~ /([;}\n])([^;}\n]*)$/s;
+            my $rettype = strip_attribute_macros(substr($pre, $ret_start));
+
+            # Normalise to forward slashes for use as an #include path.
+            my $include_path = $relpath;
+            $include_path =~ s|\\|/|g;
+
+            return { name         => $funcname,
+                     rettype      => $rettype,
+                     params       => $params_str,
+                     file         => $file,
+                     include_path => $include_path,
+                     system       => $is_system };
+        }
+    }
+    return undef;
+}
+
+# Split a parameter list on top-level commas, respecting parentheses
+sub split_params
+{
+    my $str = shift;
+    $str =~ s/^\s+|\s+$//g;
+    return () if $str eq '' || $str eq 'void';
+
+    my @parts;
+    my $current = '';
+    my $depth = 0;
+    foreach my $c (split //, $str) {
+        if ($c eq '(') {
+            $depth++;
+            $current .= $c;
+        } elsif ($c eq ')') {
+            $depth--;
+            $current .= $c;
+        } elsif ($c eq ',' && $depth == 0) {
+            push @parts, $current;
+            $current = '';
+        } else {
+            $current .= $c;
+        }
+    }
+    push @parts, $current if $current ne '';
+    foreach my $p (@parts) {
+        $p =~ s/^\s+|\s+$//g;
+    }
+    return @parts;
+}
+
+sub parse_param
+{
+    my $param = shift;
+    return { type => '', name => '', is_variadic => 1, is_ptr => 0 }
+        if $param eq '...';
+
+    # Drop the restrict qualifier; it plays no role in a mock signature.
+    $param =~ s/\b(?:__restrict(?:__)?|restrict)\b//g;
+
+    # Reduce TYPE NAME[size] to TYPE * NAME for our purposes.
+    my $is_array = 0;
+    $is_array = 1 if $param =~ s/\[\s*[^\]]*\s*\]\s*$//;
+
+    my ($type, $name);
+    if ($param =~ /^(.*?)([A-Za-z_]\w*)\s*$/) {
+        $type = $1;
+        $name = $2;
+        $type =~ s/\s+$//;
+    } else {
+        $type = $param;
+        $name = '';
+    }
+
+    # System headers name parameters in the reserved __ namespace; strip the
+    # leading underscores so the generated wrap uses ordinary local names.
+    $name =~ s/^_+//;
+
+    return { type        => $type,
+             name        => $name,
+             is_ptr      => (($type =~ /\*/) || $is_array) ? 1 : 0,
+             is_variadic => 0,
+             is_array    => $is_array };
+}
+
+sub is_void_type
+{
+    my $t = shift;
+    $t =~ s/^\s+|\s+$//g;
+    $t =~ s/\s+/ /g;
+    return $t eq 'void';
+}
+
+sub is_ptr_type { return $_[0] =~ /\*/; }
+
+# Look up each WRAP entry's signature.  Functions we cannot find are
+# skipped with a warning rather than aborting.
+my @signatures;
+my @found_includes;
+my %seen_include;
+foreach my $func (@wraps) {
+    my $info = find_function_decl($func);
+    if (!defined $info && !$system_loaded) {
+        # Not in the project headers: pull in the system ones and retry.
+        load_system_headers();
+        $info = find_function_decl($func);
+    }
+    unless (defined $info) {
+        warn "WARNING: $func: declaration not found in any include dir\n";
+        next;
+    }
+
+    my @params = map { parse_param($_) } split_params($info->{params});
+
+    my $idx = 0;
+    foreach my $p (@params) {
+        next if $p->{is_variadic};
+        $p->{name} = "arg$idx" if $p->{name} eq '';
+        $idx++;
+    }
+
+    push @signatures, { name    => $func,
+                        rettype => $info->{rettype},
+                        params  => \@params };
+
+    unless ($seen_include{$info->{include_path}}) {
+        $seen_include{$info->{include_path}} = 1;
+        push @found_includes, { path   => $info->{include_path},
+                                system => $info->{system} };
+    }
+    print STDERR "  found $func in $info->{file}\n" if $verbose;
+}
+
+die "No declarations found, nothing to emit\n" unless @signatures;
+
+my $out_fh;
+if (defined $output_file) {
+    open($out_fh, '>', $output_file) or die "$output_file: $!\n";
+} else {
+    $out_fh = \*STDOUT;
+}
+
+print $out_fh <<"EOF";
+/*
+ * Copyright $YEAR The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+EOF
+
+print $out_fh "#include <cmocka.h>\n";
+print $out_fh "\n";
+if (@found_includes) {
+    my @angle;
+    my @local;
+    foreach my $inc (sort { $a->{path} cmp $b->{path} } @found_includes) {
+        if ($inc->{system} || $inc->{path} =~ m|^openssl/|) {
+            push @angle, $inc->{path};
+        } else {
+            push @local, $inc->{path};
+        }
+    }
+    foreach my $inc (@angle) {
+        print $out_fh "#include <$inc>\n";
+    }
+    print $out_fh "\n" if @angle && @local;
+    foreach my $inc (@local) {
+        print $out_fh "#include \"$inc\"\n";
+    }
+    print $out_fh "\n";
+}
+
+if ($mode eq 'wraps' || $mode eq 'both') {
+    print $out_fh "/* wraps */\n\n";
+    foreach my $f (@signatures) {
+        print $out_fh format_signature($f->{rettype},
+                                       "__wrap_$f->{name}",
+                                       $f->{params}), ";\n";
+    }
+    print $out_fh "\n";
+
+    foreach my $f (@signatures) {
+        emit_wrap($out_fh, $f);
+        print $out_fh "\n";
+    }
+}
+
+if ($mode eq 'expects' || $mode eq 'both') {
+    print $out_fh "/* expectations */\n\n";
+    foreach my $f (@signatures) {
+        emit_expect($out_fh, $f);
+        print $out_fh "\n";
+    }
+}
+
+close $out_fh if defined $output_file;
+
+exit 0;
+
+sub format_decl
+{
+    my ($type, $name) = @_;
+    return $type =~ /\*$/ ? "$type$name" : "$type $name";
+}
+
+sub format_param
+{
+    my $p = shift;
+    return '...' if $p->{is_variadic};
+    return format_decl($p->{type}, $p->{name});
+}
+
+sub format_signature
+{
+    my ($rettype, $name, $params) = @_;
+    my $param_str = @$params
+        ? join(', ', map { format_param($_) } @$params)
+        : 'void';
+    return format_decl($rettype, $name) . "($param_str)";
+}
+
+sub emit_wrap
+{
+    my ($fh, $f) = @_;
+    print $fh format_signature($f->{rettype}, "__wrap_$f->{name}",
+                               $f->{params}), "\n{\n";
+    print $fh "    function_called();\n";
+    foreach my $p (@{$f->{params}}) {
+        next if $p->{is_variadic};
+        if ($p->{is_ptr}) {
+            print $fh "    check_expected_ptr($p->{name});\n";
+        } else {
+            print $fh "    check_expected($p->{name});\n";
+        }
+    }
+    if ( ! is_void_type($f->{rettype})) {
+        if (is_ptr_type($f->{rettype})) {
+            print $fh "\n    return mock_ptr_type($f->{rettype});\n";
+        } else {
+            print $fh "\n    return mock_type($f->{rettype});\n";
+        }
+    }
+    print $fh "}\n";
+}
+
+sub emit_expect
+{
+    my ($fh, $f) = @_;
+    my $name = $f->{name};
+    my @params = @{$f->{params}};
+
+    my @sig_parts;
+    foreach my $p (@params) {
+        next if $p->{is_variadic};
+        push @sig_parts, format_param($p);
+    }
+
+    my $needs_rc = !is_void_type($f->{rettype});
+    push @sig_parts, format_decl($f->{rettype}, 'rc') if $needs_rc;
+
+    my $param_str = @sig_parts ? join(', ', @sig_parts) : 'void';
+    print $fh "static void expect_$name($param_str)\n{\n";
+    print $fh "    expect_function_call(__wrap_$name);\n";
+    foreach my $p (@params) {
+        next if $p->{is_variadic};
+        print $fh "    expect_value(__wrap_$name, $p->{name}, $p->{name});\n";
+    }
+    print $fh "    will_return(__wrap_$name, rc);\n" if $needs_rc;
+    print $fh "}\n";
+}
diff --git a/deps/openssl/openssl/util/opensslwrap.sh b/deps/openssl/openssl/util/opensslwrap.sh
index 7a388302703..3a58bfd71b4 100755
--- a/deps/openssl/openssl/util/opensslwrap.sh
+++ b/deps/openssl/openssl/util/opensslwrap.sh
@@ -3,9 +3,6 @@
 HERE="`echo $0 | sed -e 's|[^/]*$||'`"
 OPENSSL="${HERE}../apps/openssl"

-if [ -d "${HERE}../engines" -a "x$OPENSSL_ENGINES" = "x" ]; then
-	OPENSSL_ENGINES="${HERE}../engines"; export OPENSSL_ENGINES
-fi
 if [ -d "${HERE}../providers" -a "x$OPENSSL_MODULES" = "x" ]; then
 	OPENSSL_MODULES="${HERE}../providers"; export OPENSSL_MODULES
 fi
diff --git a/deps/openssl/openssl/util/other.syms b/deps/openssl/openssl/util/other.syms
index 0bb7b92bd69..9b36384dd80 100644
--- a/deps/openssl/openssl/util/other.syms
+++ b/deps/openssl/openssl/util/other.syms
@@ -10,6 +10,7 @@ OPENSSL_s390xcap                        environment
 OPENSSL_sparcv9cap                      environment
 OPENSSL_MALLOC_FD                       environment
 OPENSSL_MALLOC_FAILURES                 environment
+OPENSSL_MALLOC_SEED                     environment
 OPENSSL_instrument_bus                  assembler
 OPENSSL_instrument_bus2                 assembler
 #
@@ -159,6 +160,7 @@ custom_ext_parse_cb                     datatype
 pem_password_cb                         datatype
 ssl_ct_validation_cb                    datatype
 tls_session_secret_cb_fn                datatype
+tls_session_ticket_ext_cb_fn            datatype
 ASYNC_stack_alloc_fn                    datatype
 ASYNC_stack_free_fn                     datatype
 PKCS12_create_cb                        datatype
@@ -292,10 +294,10 @@ BN_num_bytes                            define
 BN_one                                  define
 BN_zero                                 define deprecated 0.9.8
 CONF_modules_free                       define deprecated 1.1.0
-DES_ecb2_encrypt                        define
-DES_ede2_cbc_encrypt                    define
-DES_ede2_cfb64_encrypt                  define
-DES_ede2_ofb64_encrypt                  define
+DES_ecb2_encrypt                        define deprecated 3.0
+DES_ede2_cbc_encrypt                    define deprecated 3.0
+DES_ede2_cfb64_encrypt                  define deprecated 3.0
+DES_ede2_ofb64_encrypt                  define deprecated 3.0
 DTLS_get_link_min_mtu                   define
 DTLS_set_link_mtu                       define
 DTLSv1_get_timeout                      define
@@ -312,6 +314,7 @@ ERR_raise                               define
 ERR_raise_data                          define
 EVP_DigestSignUpdate                    define
 EVP_DigestVerifyUpdate                  define
+EVP_KDF_CTX_kdf                         define
 EVP_MD_CTX_get_block_size               define
 EVP_MD_CTX_get0_name                    define
 EVP_MD_CTX_get_size                     define
@@ -413,6 +416,7 @@ EVP_RSA_gen                             define
 EVP_seed_cfb                            define
 EVP_sm4_cfb                             define
 EXT_UTF8STRING                          define
+FIPS_mode                               define
 OBJ_cleanup                             define deprecated 1.1.0
 OCSP_parse_url                          define
 OCSP_REQ_CTX                            datatype deprecated 3.0.0
@@ -437,21 +441,28 @@ OPENSSL_VERSION_BUILD_METADATA          define
 OPENSSL_VERSION_PRE_RELEASE_STR         define
 OPENSSL_VERSION_BUILD_METADATA_STR      define
 OPENSSL_VERSION_TEXT                    define
+OPENSSL_calloc                          define
 OPENSSL_clear_free                      define
 OPENSSL_clear_realloc                   define
+OPENSSL_clear_realloc_array             define
 OPENSSL_free                            define
 OPENSSL_malloc                          define
+OPENSSL_malloc_array                    define
 OPENSSL_aligned_alloc                   define
+OPENSSL_aligned_alloc_array             define
 OPENSSL_malloc_init                     define
 OPENSSL_mem_debug_pop                   define deprecated 3.0.0
 OPENSSL_mem_debug_push                  define deprecated 3.0.0
 OPENSSL_memdup                          define
 OPENSSL_no_config                       define deprecated 1.1.0
 OPENSSL_realloc                         define
+OPENSSL_realloc_array                   define
 OPENSSL_secure_actual_size              define
 OPENSSL_secure_clear_free               define
 OPENSSL_secure_free                     define
+OPENSSL_secure_calloc                   define
 OPENSSL_secure_malloc                   define
+OPENSSL_secure_malloc_array             define
 OPENSSL_secure_zalloc                   define
 OPENSSL_strdup                          define
 OPENSSL_strndup                         define
@@ -636,6 +647,7 @@ SSL_clear_mode                          define
 SSL_disable_ct                          define
 SSL_get0_chain_certs                    define
 SSL_get0_iana_groups                    define
+SSL_get0_ec_point_formats               define
 SSL_get0_session                        define
 SSL_get0_chain_cert_store               define
 SSL_get0_verify_cert_store              define
@@ -664,6 +676,7 @@ SSL_get_signature_nid                   define
 SSL_get_time                            define
 SSL_get_timeout                         define
 SSL_get_tlsext_status_ocsp_resp         define
+SSL_get0_tlsext_status_ocsp_resp_ex     define
 SSL_get_tlsext_status_type              define
 SSL_get_tmp_key                         define
 SSL_in_accept_init                      define
@@ -701,6 +714,7 @@ SSL_set_time                            define
 SSL_set_timeout                         define
 SSL_set_tlsext_host_name                define
 SSL_set_tlsext_status_ocsp_resp         define
+SSL_set0_tlsext_status_ocsp_resp_ex     define
 SSL_set_tlsext_status_type              define
 SSL_set_tmp_dh                          define
 SSL_set_tmp_ecdh                        define
@@ -773,6 +787,8 @@ SSL_STREAM_STATE_RESET_REMOTE           define
 SSL_STREAM_STATE_CONN_CLOSED            define
 SSL_ACCEPT_CONNECTION_NO_BLOCK          define
 SSL_ACCEPT_STREAM_NO_BLOCK              define
+SSL_ACCEPT_STREAM_UNI                   define
+SSL_ACCEPT_STREAM_BIDI                  define
 SSL_DEFAULT_STREAM_MODE_AUTO_BIDI       define
 SSL_DEFAULT_STREAM_MODE_AUTO_UNI        define
 SSL_DEFAULT_STREAM_MODE_NONE            define
@@ -785,6 +801,12 @@ SSL_VALUE_CLASS_FEATURE_REQUEST         define
 SSL_VALUE_CLASS_FEATURE_PEER_REQUEST    define
 SSL_VALUE_CLASS_FEATURE_NEGOTIATED      define
 SSL_VALUE_QUIC_IDLE_TIMEOUT             define
+SSL_VALUE_QUIC_UDP_PAYLOAD_SIZE_MAX     define
+SSL_VALUE_QUIC_WINDOWCON                define
+SSL_VALUE_QUIC_WINDOWBSTR               define
+SSL_VALUE_QUIC_WINDOWUSTR               define
+SSL_VALUE_QUIC_ACK_DELAY_EXPONENT       define
+SSL_VALUE_QUIC_ACK_DELAY_MAX            define
 SSL_VALUE_QUIC_MAX_PENDING_CONNS        define
 SSL_VALUE_QUIC_STREAM_BIDI_LOCAL_AVAIL  define
 SSL_VALUE_QUIC_STREAM_BIDI_REMOTE_AVAIL define
@@ -797,8 +819,14 @@ SSL_VALUE_EVENT_HANDLING_MODE_EXPLICIT  define
 SSL_VALUE_STREAM_WRITE_BUF_SIZE         define
 SSL_VALUE_STREAM_WRITE_BUF_USED         define
 SSL_VALUE_STREAM_WRITE_BUF_AVAIL        define
+SSL_VALUE_DTLS_LISTENER_MAX_PENDING_CONNS define
+SSL_VALUE_DTLS_LISTENER_PENDING_TIMEOUT define
+SSL_VALUE_DTLS_LISTENER_MAX_DGRAM_SIZE  define
 SSL_WRITE_FLAG_CONCLUDE                 define
 SSL_LISTENER_FLAG_NO_ACCEPT             define
+SSL_LISTENER_FLAG_NO_VALIDATE           define
+SSL_LISTENER_FLAG_SINGLE_THREAD         define
+SSL_LISTENER_FLAG_ADDRESS_VALIDATION    define
 TLS_DEFAULT_CIPHERSUITES                define deprecated 3.0.0
 X509_CRL_http_nbio                      define deprecated 3.0.0
 X509_http_nbio                          define deprecated 3.0.0
@@ -879,3 +907,5 @@ OPENSSL_load_u64_be                     inline
 OPENSSL_load_u64_le                     inline
 OPENSSL_store_u64_be                    inline
 OPENSSL_store_u64_le                    inline
+OSSL_BEGIN_ALLOW_DEPRECATED             define
+OSSL_END_ALLOW_DEPRECATED               define
diff --git a/deps/openssl/openssl/util/perl/OpenSSL/ParseC.pm b/deps/openssl/openssl/util/perl/OpenSSL/ParseC.pm
index 837559e1d02..6249704a234 100644
--- a/deps/openssl/openssl/util/perl/OpenSSL/ParseC.pm
+++ b/deps/openssl/openssl/util/perl/OpenSSL/ParseC.pm
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2018-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -62,7 +62,7 @@ my @opensslcpphandlers = (
     ##################################################################
     # OpenSSL CPP specials
     #
-    # These are used to convert certain pre-precessor expressions into
+    # These are used to convert certain pre-processor expressions into
     # others that @cpphandlers have a better chance to understand.

     # This changes any OPENSSL_NO_DEPRECATED_x_y[_z] check to a check of
@@ -73,6 +73,22 @@ my @opensslcpphandlers = (
       massager => sub {
           return (<<"EOF");
 #if$1 OPENSSL_NO_DEPRECATEDIN_$2
+EOF
+      }
+    },
+    # Do the same for modern CPP definition tests.
+    { regexp   => qr/#if (\!defined).*OPENSSL_NO_DEPRECATED_(\d+_\d+(?:_\d+)?).*$/,
+      massager => sub {
+          return (<<"EOF");
+#ifndef OPENSSL_NO_DEPRECATEDIN_$2
+EOF
+      }
+    },
+    # Do the same for modern CPP definition tests.
+    { regexp   => qr/#if (defined).*OPENSSL_NO_DEPRECATED_(\d+_\d+(?:_\d+)?).*$/,
+      massager => sub {
+          return (<<"EOF");
+#ifdef OPENSSL_NO_DEPRECATEDIN_$2
 EOF
       }
     }
@@ -464,6 +480,15 @@ int i2d_$2(void);
 int $2_free(void);
 int $2_new(void);
 DECLARE_ASN1_ITEM($2)
+EOF
+      },
+    },
+    { regexp   => qr/DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr<<<\((.*),\s*(.*)\)>>>/,
+      massager => sub {
+          return (<<"EOF");
+int d2i_$2(void);
+int i2d_$2(void);
+DECLARE_ASN1_ITEM($2)
 EOF
       },
     },
diff --git a/deps/openssl/openssl/util/perl/OpenSSL/Test.pm b/deps/openssl/openssl/util/perl/OpenSSL/Test.pm
index 3381369875f..ca27dd4e008 100644
--- a/deps/openssl/openssl/util/perl/OpenSSL/Test.pm
+++ b/deps/openssl/openssl/util/perl/OpenSSL/Test.pm
@@ -23,7 +23,8 @@ $VERSION = "1.0";
                                          srctop_dir srctop_file
                                          data_file data_dir
                                          result_file result_dir
-                                         pipe with cmdstr
+                                         pipe with cmdstr app_fails
+                                         slurp_file
                                          openssl_versions
                                          ok_nofips is_nofips isnt_nofips));

@@ -73,6 +74,7 @@ use Cwd qw/getcwd abs_path/;
 use OpenSSL::Util;

 my $level = 0;
+my $idx = 0;

 # The name of the test.  This is set by setup() and is used in the other
 # functions to verify that setup() has been used.
@@ -203,7 +205,7 @@ sub indir {

     my $reverse = __cwd($subdir,%opts);
     BAIL_OUT("FAILURE: indir, \"$subdir\" wasn't possible to move into")
-	unless $reverse;
+        unless $reverse;

     $codeblock->();

@@ -328,8 +330,16 @@ sub app {
     return sub {
         my @cmdargs = ( @{$cmd} );
         my @prog = __fixup_prg(__apps_file(shift @cmdargs, __exeext()));
-        return cmd([ @prog, @cmdargs ],
-                   exe_shell => $ENV{EXE_SHELL}, %opts) -> (shift);
+        if (defined $ENV{OSSL_USE_VALGRIND}) {
+            $idx=$idx+1;
+            my $resultdir = result_dir();
+            my $srcdir = srctop_dir();
+            return cmd([ "valgrind", "--leak-check=full", "--show-leak-kinds=all", "--gen-suppressions=all", "--suppressions=$srcdir/util/valgrind.suppression", "--log-file=$resultdir/valgrind.log.$idx.%p", "--suppressions=$srcdir/util/valgrind.suppression", @prog, @cmdargs ],
+                       exe_shell => $ENV{EXE_SHELL}, %opts) -> (shift);
+        } else {
+            return cmd([ @prog, @cmdargs ],
+                       exe_shell => $ENV{EXE_SHELL}, %opts) -> (shift);
+        }
     }
 }

@@ -350,8 +360,29 @@ sub test {
     return sub {
         my @cmdargs = ( @{$cmd} );
         my @prog = __fixup_prg(__test_file(shift @cmdargs, __exeext()));
-        return cmd([ @prog, @cmdargs ],
+        if (defined $ENV{OSSL_USE_VALGRIND}) {
+           $idx=$idx+1;
+           my $resultdir = result_dir();
+           my $srcdir = srctop_dir();
+           return cmd([ "valgrind", "--leak-check=full", "--show-leak-kinds=all", "--gen-suppressions=all", "--suppressions=$srcdir/util/valgrind.suppression", "--log-file=$resultdir/valgrind.log.$idx.%p", "--suppressions=$srcdir/util/valgrind.suppression", @prog, @cmdargs ],
+                   exe_shell => $ENV{EXE_SHELL}, %opts) -> (shift);
+        } elsif (defined $ENV{OSSL_VALGRIND_CT}) {
+           # Constant-time validation mode: mark secret data as undefined and
+           # fail immediately if any branch or memory index depends on it.
+           # Unlike OSSL_USE_VALGRIND this writes to stdout (not a log file)
+           # and uses --error-exitcode so the test fails on any CT violation.
+           # Set OSSL_VALGRIND_CT=yes when building with enable-ct-validation.
+           return cmd([ "valgrind",
+                        "--tool=memcheck",
+                        "--track-origins=yes",
+                        "--error-exitcode=1",
+                        "--num-callers=20",
+                        @prog, @cmdargs ],
+                   exe_shell => $ENV{EXE_SHELL}, %opts) -> (shift);
+        } else {
+            return cmd([ @prog, @cmdargs ],
                    exe_shell => $ENV{EXE_SHELL}, %opts) -> (shift);
+        }
     }
 }

@@ -418,6 +449,14 @@ If used, B<VARREF> must be a reference to a scalar variable.  It will be
 assigned a boolean indicating if the command succeeded or not.  This is
 particularly useful together with B<capture>.

+=item B<quiet =E<gt> 0|1>
+
+If true, suppress the diagnostic line that C<run> normally prints to STDERR
+after the command completes (the C<command => exitcode> line) when running
+under a non-verbose test harness.  Has no effect outside a harness or under
+C<HARNESS_VERBOSE>.  Useful for loops that invoke many commands where that
+line would be noise.
+
 =back

 Usually 1 indicates that the command was successful and 0 indicates failure.
@@ -435,8 +474,8 @@ sub run {
     return () if !$cmd;

     my $prefix = "";
-    if ( $^O eq "VMS" ) {	# VMS
-	$prefix = "pipe ";
+    if ( $^O eq "VMS" ) { # VMS
+        $prefix = "pipe ";
     }

     my @r = ();
@@ -465,48 +504,51 @@ sub run {

     $ENV{HARNESS_OSSL_LEVEL} = $level + 1;

+    # We prefix the output with "# " in non-capture mode by default to avoid
+    # its interpretation by the TAP consumer.
+    my $default_prefix = $opts{capture} ? "" : "# ";
+    my $pipe;
+    local $_;
+
+    open($pipe, '-|', "$prefix$cmd") or die "Can't start command: $!";
+    # Read line by line, even if a recipe played with $/ (slurp or
+    # paragraph mode).  Otherwise, a bare prefix (or only the first
+    # line of a multi-line read) would hit the TAP stream unguarded.
+    local $/ = "\n";
+    while(<$pipe>) {
+        my $l = ($opts{prefix} // $default_prefix) . $_;
+        if ($opts{capture}) {
+            push @r, $l;
+        } else {
+            print STDOUT $l;
+        }
+    }
+    close $pipe;
+
     # The dance we do with $? is the same dance the Unix shells appear to
     # do.  For example, a program that gets aborted (and therefore signals
     # SIGABRT = 6) will appear to exit with the code 134.  We mimic this
     # to make it easier to compare with a manual run of the command.
-    if ($opts{capture} || defined($opts{prefix})) {
-	my $pipe;
-	local $_;
-
-	open($pipe, '-|', "$prefix$cmd") or die "Can't start command: $!";
-	while(<$pipe>) {
-	    my $l = ($opts{prefix} // "") . $_;
-	    if ($opts{capture}) {
-		push @r, $l;
-	    } else {
-		print STDOUT $l;
-	    }
-	}
-	close $pipe;
-    } else {
-	$ENV{HARNESS_OSSL_PREFIX} = "# ";
-	system("$prefix$cmd");
-	delete $ENV{HARNESS_OSSL_PREFIX};
-    }
     $e = ($? & 0x7f) ? ($? & 0x7f)|0x80 : ($? >> 8);
     $r = $hooks{exit_checker}->($e);
     if ($opts{statusvar}) {
         ${$opts{statusvar}} = $r;
     }

-    # Restore STDOUT / STDERR on VMS
+    my $harness_quiet = $ENV{HARNESS_ACTIVE} && !$ENV{HARNESS_VERBOSE};
     if ($^O eq 'VMS') {
-        if ($ENV{HARNESS_ACTIVE} && !$ENV{HARNESS_VERBOSE}) {
+        # Restore STDOUT / STDERR on VMS
+        if ($harness_quiet) {
             close STDOUT;
             close STDERR;
             open STDOUT, '>&', $save_STDOUT or die "Can't restore STDOUT: $!";
             open STDERR, '>&', $save_STDERR or die "Can't restore STDERR: $!";
         }

-        print STDERR "$prefix$display_cmd => $e\n"
-            if !$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE};
+        print STDERR "$prefix$display_cmd => $e\n" unless $harness_quiet;
     } else {
-        print STDERR "$prefix$display_cmd => $e\n";
+        print STDERR "$prefix$display_cmd => $e\n"
+            unless $opts{quiet} && $harness_quiet;
     }

     # At this point, $? stops being interesting, and unfortunately,
@@ -515,9 +557,9 @@ sub run {
     $? = 0;

     if ($opts{capture}) {
-	return @r;
+        return @r;
     } else {
-	return $r;
+        return $r;
     }
 }

@@ -525,7 +567,7 @@ END {
     my $tb = Test::More->builder;
     my $failure = scalar(grep { $_ == 0; } $tb->summary);
     if ($failure && $end_with_bailout) {
-	BAIL_OUT("Stoptest!");
+        BAIL_OUT("Stoptest!");
     }
 }

@@ -558,8 +600,8 @@ operating system.
 =cut

 sub bldtop_dir {
-    my $d = __bldtop_dir(@_);	# This caters for operating systems that have
-				# a very distinct syntax for directories.
+    my $d = __bldtop_dir(@_);   # This caters for operating systems that have
+                                # a very distinct syntax for directories.

     croak "$d isn't a directory" if -e $d && ! -d $d;
     return $d;
@@ -601,8 +643,8 @@ operating system.
 =cut

 sub srctop_dir {
-    my $d = __srctop_dir(@_);	# This caters for operating systems that have
-				# a very distinct syntax for directories.
+    my $d = __srctop_dir(@_);   # This caters for operating systems that have
+                                # a very distinct syntax for directories.

     croak "$d isn't a directory" if -e $d && ! -d $d;
     return $d;
@@ -729,25 +771,25 @@ to be passed to C<run> for execution.
 sub pipe {
     my @cmds = @_;
     return
-	sub {
-	    my @cs  = ();
-	    my @dcs = ();
-	    my @els = ();
-	    my $counter = 0;
-	    foreach (@cmds) {
-		my ($c, $dc, @el) = $_->(++$counter);
-
-		return () if !$c;
-
-		push @cs, $c;
-		push @dcs, $dc;
-		push @els, @el;
-	    }
-	    return (
-		join(" | ", @cs),
-		join(" | ", @dcs),
-		@els
-		);
+        sub {
+            my @cs  = ();
+            my @dcs = ();
+            my @els = ();
+            my $counter = 0;
+            foreach (@cmds) {
+                my ($c, $dc, @el) = $_->(++$counter);
+
+                return () if !$c;
+
+                push @cs, $c;
+                push @dcs, $dc;
+                push @els, @el;
+            }
+            return (
+                join(" | ", @cs),
+                join(" | ", @dcs),
+                @els
+                );
     };
 }

@@ -783,19 +825,85 @@ sub with {
     my %saved_hooks = ();

     foreach (keys %opts) {
-	$saved_hooks{$_} = $hooks{$_}	if exists($hooks{$_});
-	$hooks{$_} = $opts{$_};
+        $saved_hooks{$_} = $hooks{$_} if exists($hooks{$_});
+        $hooks{$_} = $opts{$_};
     }

     $codeblock->();

     foreach (keys %saved_hooks) {
-	$hooks{$_} = $saved_hooks{$_};
+        $hooks{$_} = $saved_hooks{$_};
     }
 }

 =over 4

+=item B<slurp_file FILENAME, OPTS>
+
+C<slurp_file> reads back the whole file FILENAME, usually an output
+captured with the C<stdout> or C<stderr> option of C<cmd> and its
+derivatives, and returns its content as a single string.  If the file
+cannot be opened, an empty string is returned.
+
+The following options OPTS are available:
+
+=over 4
+
+=item B<binary =E<gt> 0|1>
+
+When set to 1, the file is read in binary mode, for example to read
+back a DER encoded output.  The default is 0, reading in text mode.
+
+=back
+
+=back
+
+=cut
+
+sub slurp_file {
+    my ($file, %opts) = @_;
+    my $content = '';
+
+    if (open(my $fh, '<', $file)) {
+        binmode $fh if $opts{binary};
+        $content = do { local $/; <$fh> };
+        close($fh);
+    }
+    return $content;
+}
+
+=over 4
+
+=item B<app_fails APPNAME, TEST_NAME, REGEXP, LIST>
+
+C<app_fails> runs the C<openssl> sub-command B<APPNAME> with the command
+line arguments in LIST, expecting a non-zero (failure) exit status, as a
+test named B<TEST_NAME>.  If REGEXP is defined, it additionally checks, as
+a second test, that the stderr output of the command matches it.
+
+=back
+
+=cut
+
+sub app_fails {
+    my ($appname, $testtext, $re, @args) = @_;
+
+    my $stderr_file = "app_fails_stderr.txt";
+
+    with({ exit_checker => sub { return shift != 0; } },
+        sub {
+            ok(run(app(['openssl', $appname, @args], stderr => $stderr_file)),
+               $testtext);
+        });
+
+    if (defined $re) {
+        ok(slurp_file($stderr_file) =~ $re, "$testtext: stderr matches");
+    }
+    unlink($stderr_file) if -f $stderr_file;
+}
+
+=over 4
+
 =item B<cmdstr CODEREF, OPTS>

 C<cmdstr> takes a CODEREF from C<app> or C<test> and simply returns the
@@ -1031,10 +1139,10 @@ sub __bldtop_dir {
 # if that one is defined.
 sub __exeext {
     my $ext = "";
-    if ($^O eq "VMS" ) {	# VMS
-	$ext = ".exe";
+    if ($^O eq "VMS" ) {         # VMS
+        $ext = ".exe";
     } elsif ($^O eq "MSWin32") { # Windows
-	$ext = ".exe";
+        $ext = ".exe";
     }
     return $ENV{"EXE_EXT"} || $ext;
 }
@@ -1112,7 +1220,7 @@ sub __cwd {
     # abs_path().
     $dir = canonpath($dir);
     if ($opts{create}) {
-	mkpath($dir);
+        mkpath($dir);
     }

     my $abscurdir = abs_path(curdir());
@@ -1121,12 +1229,12 @@ sub __cwd {

     # PARANOIA: if we're not moving anywhere, we do nothing more
     if ($abscurdir eq $absdir) {
-	return $reverse;
+        return $reverse;
     }

     # Do not support a move to a different volume for now.  Maybe later.
     BAIL_OUT("FAILURE: \"$dir\" moves to a different volume, not supported")
-	if $reverse eq $abscurdir;
+        if $reverse eq $abscurdir;

     # If someone happened to give a directory that leads back to the current,
     # it's extremely silly to do anything more, so just simulate that we did
@@ -1144,32 +1252,32 @@ sub __cwd {
     # they don't change!)
     my @dirtags = sort keys %directories;
     foreach (@dirtags) {
-	if (!file_name_is_absolute($directories{$_})) {
-	    my $oldpath = abs_path($directories{$_});
-	    my $newpath = abs2rel($oldpath, $absdir);
-	    if ($debug) {
-		print STDERR "DEBUG: [dir $_] old path: $oldpath\n";
-		print STDERR "DEBUG: [dir $_] new base: $absdir\n";
-		print STDERR "DEBUG: [dir $_] resulting new path: $newpath\n";
-	    }
-	    $tmp_directories{$_} = $newpath;
-	}
+        if (!file_name_is_absolute($directories{$_})) {
+            my $oldpath = abs_path($directories{$_});
+            my $newpath = abs2rel($oldpath, $absdir);
+            if ($debug) {
+                print STDERR "DEBUG: [dir $_] old path: $oldpath\n";
+                print STDERR "DEBUG: [dir $_] new base: $absdir\n";
+                print STDERR "DEBUG: [dir $_] resulting new path: $newpath\n";
+            }
+            $tmp_directories{$_} = $newpath;
+        }
     }

     # Treat each environment variable that was used to get us the values in
     # %directories the same was as the paths in %directories, so any sub
     # process can use their values properly as well
     foreach (@direnv) {
-	if (!file_name_is_absolute($ENV{$_})) {
-	    my $oldpath = abs_path($ENV{$_});
-	    my $newpath = abs2rel($oldpath, $absdir);
-	    if ($debug) {
-		print STDERR "DEBUG: [env $_] old path: $oldpath\n";
-		print STDERR "DEBUG: [env $_] new base: $absdir\n";
-		print STDERR "DEBUG: [env $_] resulting new path: $newpath\n";
-	    }
-	    $tmp_ENV{$_} = $newpath;
-	}
+        if (!file_name_is_absolute($ENV{$_})) {
+            my $oldpath = abs_path($ENV{$_});
+            my $newpath = abs2rel($oldpath, $absdir);
+            if ($debug) {
+                print STDERR "DEBUG: [env $_] old path: $oldpath\n";
+                print STDERR "DEBUG: [env $_] new base: $absdir\n";
+                print STDERR "DEBUG: [env $_] resulting new path: $newpath\n";
+            }
+            $tmp_ENV{$_} = $newpath;
+        }
     }

     # Should we just bail out here as well?  I'm unsure.
@@ -1186,21 +1294,21 @@ sub __cwd {
     }

     if ($debug) {
-	print STDERR "DEBUG: __cwd(), directories and files:\n";
-	print STDERR "	Moving from $abscurdir\n";
-	print STDERR "	Moving to $absdir\n";
-	print STDERR "\n";
-	print STDERR "	\$directories{BLDTEST} = \"$directories{BLDTEST}\"\n";
-	print STDERR "	\$directories{SRCTEST} = \"$directories{SRCTEST}\"\n";
-	print STDERR "	\$directories{SRCDATA} = \"$directories{SRCDATA}\"\n"
+        print STDERR "DEBUG: __cwd(), directories and files:\n";
+        print STDERR "	Moving from $abscurdir\n";
+        print STDERR "	Moving to $absdir\n";
+        print STDERR "\n";
+        print STDERR "	\$directories{BLDTEST} = \"$directories{BLDTEST}\"\n";
+        print STDERR "	\$directories{SRCTEST} = \"$directories{SRCTEST}\"\n";
+        print STDERR "	\$directories{SRCDATA} = \"$directories{SRCDATA}\"\n"
             if exists $directories{SRCDATA};
-	print STDERR "	\$directories{RESULTS} = \"$directories{RESULTS}\"\n";
-	print STDERR "	\$directories{BLDAPPS} = \"$directories{BLDAPPS}\"\n";
-	print STDERR "	\$directories{SRCAPPS} = \"$directories{SRCAPPS}\"\n";
-	print STDERR "	\$directories{SRCTOP}  = \"$directories{SRCTOP}\"\n";
-	print STDERR "	\$directories{BLDTOP}  = \"$directories{BLDTOP}\"\n";
-	print STDERR "\n";
-	print STDERR "  the way back is \"$reverse\"\n";
+        print STDERR "	\$directories{RESULTS} = \"$directories{RESULTS}\"\n";
+        print STDERR "	\$directories{BLDAPPS} = \"$directories{BLDAPPS}\"\n";
+        print STDERR "	\$directories{SRCAPPS} = \"$directories{SRCAPPS}\"\n";
+        print STDERR "	\$directories{SRCTOP}  = \"$directories{SRCTOP}\"\n";
+        print STDERR "	\$directories{BLDTOP}  = \"$directories{BLDTOP}\"\n";
+        print STDERR "\n";
+        print STDERR "  the way back is \"$reverse\"\n";
     }

     return $reverse;
@@ -1288,19 +1396,17 @@ sub __decorate_cmd {

     my $display_cmd = "$cmdstr$stdin$stdout$stderr";

-    # Under a non-verbose harness nothing drains the command's stderr, so a
-    # chatty command can fill the pipe buffer and then block forever waiting
-    # for a reader that never comes.  Send it to the null device unless the
-    # recipe asked for a specific redirection.  On VMS this also keeps
-    # program output from escaping TAP::Parser.
-    $stderr=" 2> ".$null
-        unless $stderr || !$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE};
+    # VMS program output escapes TAP::Parser
+    if ($^O eq 'VMS') {
+        $stderr=" 2> ".$null
+            unless $stderr || !$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE};
+    }

     $cmdstr .= "$stdin$stdout$stderr";

     if ($debug) {
-	print STDERR "DEBUG[__decorate_cmd]: \$cmdstr = \"$cmdstr\"\n";
-	print STDERR "DEBUG[__decorate_cmd]: \$display_cmd = \"$display_cmd\"\n";
+        print STDERR "DEBUG[__decorate_cmd]: \$cmdstr = \"$cmdstr\"\n";
+        print STDERR "DEBUG[__decorate_cmd]: \$display_cmd = \"$display_cmd\"\n";
     }

     return ($cmdstr, $display_cmd);
@@ -1313,7 +1419,7 @@ L<Test::More>, L<Test::Harness>
 =head1 AUTHORS

 Richard Levitte E<lt>levitte@openssl.orgE<gt> with assistance and
-inspiration from Andy Polyakov E<lt>appro@openssl.org<gt>.
+inspiration from Andy Polyakov E<lt>https://github.com/dot-asm<gt>.

 =cut

diff --git a/deps/openssl/openssl/util/perl/OpenSSL/Test/Utils.pm b/deps/openssl/openssl/util/perl/OpenSSL/Test/Utils.pm
index 34eafc4659a..1764dc7923f 100644
--- a/deps/openssl/openssl/util/perl/OpenSSL/Test/Utils.pm
+++ b/deps/openssl/openssl/util/perl/OpenSSL/Test/Utils.pm
@@ -1,4 +1,4 @@
-# Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -91,6 +91,7 @@ sub load_configdata {
     # been run yet.
     my $configdata = bldtop_file("configdata.pm");
     eval { require $configdata;
+	   no warnings 'once';
 	   %available_protocols = %configdata::available_protocols;
 	   %disabled = %configdata::disabled;
 	   %config = %configdata::config;
diff --git a/deps/openssl/openssl/util/perl/OpenSSL/config.pm b/deps/openssl/openssl/util/perl/OpenSSL/config.pm
index 04aef069f92..e9dc9d3243d 100755
--- a/deps/openssl/openssl/util/perl/OpenSSL/config.pm
+++ b/deps/openssl/openssl/util/perl/OpenSSL/config.pm
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 1998-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1998-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -145,8 +145,6 @@ my $guess_patterns = [
       }
     ],
     [ 'Paragon.*?:.*',              'i860-intel-osf1' ],
-    [ 'Rhapsody:.*',                'ppc-apple-rhapsody' ],
-    [ 'Darwin:.*?:.*?:Power.*',     'ppc-apple-darwin' ],
     [ 'Darwin:.*',                  '${MACHINE}-apple-darwin' ],
     [ 'SunOS:5\..*',                '${MACHINE}-whatever-solaris2' ],
     [ 'SunOS:.*',                   '${MACHINE}-sun-sunos4' ],
@@ -413,7 +411,7 @@ sub determine_compiler_settings {
                 $CCVER = 0;

                 my $v = `cl 2>&1`;
-                if ( $v =~ /Microsoft .* Version ([0-9\.]+) for (x86|x64|ARM|ia64)/ ) {
+                if ( $v =~ /Microsoft .* Version ([0-9\.]+) for (x86|x64|ARM)/ ) {
                     $CCVER = $1;
                     $CL_ARCH = $2;
                 }
@@ -490,39 +488,6 @@ EOF
             return { target => "irix-mips3" };
         }
       ],
-      [ 'ppc-apple-rhapsody',     { target => "rhapsody-ppc" } ],
-      [ 'ppc-apple-darwin.*',
-        sub {
-            my $KERNEL_BITS = $ENV{KERNEL_BITS} // '';
-            my $ISA64 = `sysctl -n hw.optional.64bitops 2>/dev/null`;
-            if ( $ISA64 == 1 && $KERNEL_BITS eq '' ) {
-                print <<EOF;
-WARNING! To build 64-bit package, do this:
-         $WHERE/Configure darwin64-ppc-cc
-EOF
-                maybe_abort();
-            }
-            return { target => "darwin64-ppc" }
-                if $ISA64 == 1 && $KERNEL_BITS eq '64';
-            return { target => "darwin-ppc" };
-        }
-      ],
-      [ 'i.86-apple-darwin.*',
-        sub {
-            my $KERNEL_BITS = $ENV{KERNEL_BITS} // '';
-            my $ISA64 = `sysctl -n hw.optional.x86_64 2>/dev/null`;
-            if ( $ISA64 == 1 && $KERNEL_BITS eq '' ) {
-                print <<EOF;
-WARNING! To build 64-bit package, do this:
-         KERNEL_BITS=64 $WHERE/Configure [options...]
-EOF
-                maybe_abort();
-            }
-            return { target => "darwin64-x86_64" }
-                if $ISA64 == 1 && $KERNEL_BITS eq '64';
-            return { target => "darwin-i386" };
-        }
-      ],
       [ 'x86_64-apple-darwin.*',
         sub {
             my $KERNEL_BITS = $ENV{KERNEL_BITS} // '';
@@ -534,13 +499,6 @@ EOF
                     return { target => "darwin64-x86_64" };
                 }
             }
-            return { target => "darwin-i386" } if $KERNEL_BITS eq '32';
-
-            print <<EOF;
-WARNING! To build 32-bit package, do this:
-         KERNEL_BITS=32 $WHERE/Configure [options...]
-EOF
-            maybe_abort();
             return { target => "darwin64-x86_64" };
         }
       ],
@@ -750,7 +708,7 @@ EOF
                     # $GCC_ARCH denotes default ABI chosen by compiler driver
                     # (first one found on the $PATH). I assume that user
                     # expects certain consistency with the rest of his builds
-                    # and therefore switch over to 64-bit. <appro>
+                    # and therefore switch over to 64-bit. <@dot-asm>
                     print <<EOF;
 WARNING! To build 32-bit package, do this:
          $WHERE/Configure solaris-sparcv9-gcc
@@ -940,7 +898,7 @@ EOF
       ],

       # Windows values found by looking at Perl 5's win32/win32.c
-      [ '(amd64|ia64|x86|ARM)-.*?-Windows NT',
+      [ '(amd64|x86|ARM)-.*?-Windows NT',
         sub {
             # If we determined the arch by asking cl, take that value,
             # otherwise the SYSTEM we got from from POSIX::uname().
@@ -949,7 +907,6 @@ EOF

             if ($arch) {
                 $config = { 'amd64' => { target => 'VC-WIN64A'    },
-                            'ia64'  => { target => 'VC-WIN64I'    },
                             'x86'   => { target => 'VC-WIN32'     },
                             'x64'   => { target => 'VC-WIN64A'    },
                             'ARM'   => { target => 'VC-WIN64-ARM' },
diff --git a/deps/openssl/openssl/util/perl/OpenSSL/copyright.pm b/deps/openssl/openssl/util/perl/OpenSSL/copyright.pm
index 87567c08894..61c7ddc0eec 100644
--- a/deps/openssl/openssl/util/perl/OpenSSL/copyright.pm
+++ b/deps/openssl/openssl/util/perl/OpenSSL/copyright.pm
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2021-2022 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -8,12 +8,18 @@

 use strict;
 use warnings;
+use File::Spec;

 package OpenSSL::copyright;

 sub year_of {
     my $file = shift;

+    # A generated file is staged as FILE.new before it is compared to,
+    # and possibly replaces, FILE; the year that belongs to it is the
+    # year of the file it is staged to replace.
+    $file =~ s/\.new$//;
+
     return $ENV{'OSSL_COPYRIGHT_YEAR'} if defined $ENV{'OSSL_COPYRIGHT_YEAR'};

     # Get the current year.  We use that as the default because the other
@@ -22,10 +28,11 @@ sub year_of {
     my $YEAR = [localtime()]->[5] + 1900;

     # See if git's available
+    my $devnull = File::Spec->devnull();
     open my $FH,
-       "git log -1 --date=short --format=format:%cd $file 2>/dev/null|"
+       "git log -1 --date=short --format=format:%cd $file 2>$devnull|"
            or return $YEAR;
-    my $LINE = <$FH>;
+    my $LINE = <$FH> // '';
     close $FH;
     $LINE =~ s/^([0-9]*)-.*/$1/;
     $YEAR = $LINE if $LINE;
diff --git a/deps/openssl/openssl/util/perl/OpenSSL/fipsparams.pm b/deps/openssl/openssl/util/perl/OpenSSL/fipsparams.pm
new file mode 100755
index 00000000000..38ba27b5b1a
--- /dev/null
+++ b/deps/openssl/openssl/util/perl/OpenSSL/fipsparams.pm
@@ -0,0 +1,183 @@
+#! /usr/bin/env perl
+# Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+package OpenSSL::fipsparams;
+
+use strict;
+use warnings;
+use Exporter;
+
+our @ISA = qw(Exporter);
+our @EXPORT_OK = qw(produce_fips_params);
+
+sub produce_fips_params {
+    my @params = @_;
+    my $s;
+    open(local *STDOUT, '>', \$s);
+
+    print "/* Machine generated by util/perl/OpenSSL/fipsparams.pm */\n";
+    print "\n";
+
+    print "#ifdef FIPSPARAMS_AS_HEADER\n";
+    print "enum fips_config_id {\n";
+    my $first = " = 1";
+    foreach my $p (@params) {
+        my $name  = $p->[1];
+        my $use = $p->[4];
+        if ($use eq 'indicator') {
+            print "    FIPS_CONFIG_$name$first,\n";
+            $first = "";
+        }
+    }
+    print "};\n";
+
+    print "#else /* FIPSPARAMS_AS_HEADER */\n";
+    print "\n";
+    print "typedef struct fips_params_st {\n";
+    foreach my $p (@params) {
+        my $field = $p->[0];
+        my $type = $p->[2];
+        my $sep = $type =~ /\*$/ ? "" : " ";
+        printf "    $type$sep$field;\n";
+    }
+    print "} FIPS_PARAMS;\n";
+
+    print "\n";
+    print "static void init_fips_params(FIPS_PARAMS *fp)\n";
+    print "{\n";
+    foreach my $p (@params) {
+        my $field = $p->[0];
+        my $default = $p->[3];
+        printf "    fp->$field = $default;\n";
+    }
+    print "}\n";
+
+    print "\n";
+    print "/*\n";
+    print " * Parameters to retrieve from the core provider\n";
+    print " * NOTE: inside core_get_params() these will be loaded from config items\n";
+    print " * stored inside prov->parameters\n";
+    print " */\n";
+    print "static int fips_get_params_from_core(\n";
+    print "    const OSSL_CORE_HANDLE *handle, FIPS_PARAMS *fp)\n";
+    print "{\n";
+    foreach my $p (@params) {
+        my $field = $p->[0];
+        print "    const char *$field = NULL;\n";
+    }
+    print "    OSSL_PARAM core_params[] = {\n";
+    foreach my $p (@params) {
+        my $field = $p->[0];
+        my $name  = $p->[1];
+        my $type  = $p->[2];
+        my $use = $p->[4];
+        if ($use eq 'indicator') {
+            $name = "OSSL_PROV_PARAM_" . $name;
+        }
+        print "        OSSL_PARAM_construct_utf8_ptr($name,\n";
+        print "            (char **)&$field, 0),\n";
+    }
+    print "        OSSL_PARAM_construct_end()\n";
+    print "    };\n";
+    print "    OSSL_PARAM *p = core_params;\n";
+    print "\n";
+    print "    if (!c_get_params(handle, core_params)) {\n";
+    print "        return 0;\n";
+    print "    }\n";
+    print "\n";
+    print "    for (;p->key != NULL; p++) {\n";
+    print "        if (OSSL_PARAM_modified(p)) {\n";
+    foreach my $p (@params) {
+        my $field = $p->[0];
+        my $name  = $p->[1];
+        my $type  = $p->[2];
+        my $use = $p->[4];
+        if ($use eq 'indicator') {
+            $name = "OSSL_PROV_PARAM_" . $name;
+        }
+        print "            if (strcmp($name, p->key) == 0) {\n";
+        if ($type eq 'const char *') {
+            print "                fp->$field = $field;\n";
+        } elsif ($type eq 'unsigned char') {
+            print "                if ($field != NULL\n";
+            print "                    && strcmp($field, \"1\") == 0)\n";
+            print "                    fp->$field = 1;\n";
+            print "                else if ($field != NULL\n";
+            print "                    && strcmp($field, \"0\") == 0)\n";
+            print "                    fp->$field = 0;\n";
+            print "                else\n";
+            print "                    return 0;\n";
+        }
+        print "            }\n";
+    }
+    print "        }\n";
+    print "    }\n";
+    print "    return 1;\n";
+    print "}\n";
+
+    print "\n";
+    print "#define OSSL_FIPS_PARAMS_DEFN_TYPES \\\n";
+    my $cnt = 0;
+    my $sep = "";
+    foreach my $p (@params) {
+        my $use = $p->[4];
+        if ($use eq 'indicator') {
+            my $name  = "OSSL_PROV_PARAM_" . $p->[1];
+            print "$sep    OSSL_PARAM_DEFN($name, OSSL_PARAM_INTEGER, NULL, 0)";
+            $sep = ", \\\n";
+        }
+    }
+    print "\n";
+
+    print "\n";
+    print "static int return_fips_params(OSSL_PARAM *params, FIPS_PARAMS *fp)\n";
+    print "{\n";
+    print "    OSSL_PARAM *p = params;\n";
+    print "\n";
+    print "    for (;p->key != NULL; p++) {\n";
+    foreach my $p (@params) {
+        my $field = $p->[0];
+        my $use = $p->[4];
+        if ($use eq 'indicator') {
+            my $name = "OSSL_PROV_PARAM_" . $p->[1];
+            print "        if (strcmp($name, p->key) == 0)\n";
+            print "            if (!OSSL_PARAM_set_int(p, fp->$field))\n";
+            print "               return 0;\n";
+        }
+    }
+    print "    }\n";
+    print "    return 1;\n";
+    print "}\n";
+
+    print "\n";
+    print "struct fips_global_st;\n";
+    print "static FIPS_PARAMS *get_fips_params(struct fips_global_st *fgbl);\n";
+    print "int ossl_fips_config(OSSL_LIB_CTX *libctx, enum fips_config_id id)\n";
+    print "{\n";
+    print "    struct fips_global_st *fgbl = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_FIPS_PROV_INDEX);\n";
+    print "    FIPS_PARAMS *params = get_fips_params(fgbl);\n";
+    print "    switch (id) {\n";
+    foreach my $p (@params) {
+        my $field = $p->[0];
+        my $use = $p->[4];
+        if ($use eq 'indicator') {
+            my $id = "FIPS_CONFIG_" . $p->[1];
+            print "    case $id:\n";
+            print "        return params->$field;\n";
+        }
+    }
+    print "    default:\n";
+    print "        return -1;\n";
+    print "    }\n";
+    print "}\n";
+
+    print "\n";
+    print "#endif /* FIPSPARAMS_AS_HEADER */\n";
+
+    return $s;
+}
diff --git a/deps/openssl/openssl/util/perl/OpenSSL/paramnames.pm b/deps/openssl/openssl/util/perl/OpenSSL/paramnames.pm
index 0920931fd96..93ed49e4485 100644
--- a/deps/openssl/openssl/util/perl/OpenSSL/paramnames.pm
+++ b/deps/openssl/openssl/util/perl/OpenSSL/paramnames.pm
@@ -14,55 +14,59 @@ use warnings;
 require Exporter;
 our @ISA = qw(Exporter);
 our @EXPORT_OK = qw(generate_public_macros
-                    generate_internal_macros
-                    produce_decoder);
+                    produce_param_decoder
+                    produce_param_decoder_with_count);

+our $headers_included = 0;
 my $case_sensitive = 1;
+my $need_break = 0;
+my $invalid_param = "invalid param";
+my $default_indicator = "fips indicator";

 my %params = (
 # Well known parameter names that core passes to providers
-    'PROV_PARAM_CORE_VERSION' =>         "openssl-version",# utf8_ptr
-    'PROV_PARAM_CORE_PROV_NAME' =>       "provider-name",  # utf8_ptr
-    'PROV_PARAM_CORE_MODULE_FILENAME' => "module-filename",# utf8_ptr
+    'OSSL_PROV_PARAM_CORE_VERSION' =>         "openssl-version",# utf8_ptr
+    'OSSL_PROV_PARAM_CORE_PROV_NAME' =>       "provider-name",  # utf8_ptr
+    'OSSL_PROV_PARAM_CORE_MODULE_FILENAME' => "module-filename",# utf8_ptr

 # Well known parameter names that Providers can define
-    'PROV_PARAM_NAME' =>               "name",               # utf8_ptr
-    'PROV_PARAM_VERSION' =>            "version",            # utf8_ptr
-    'PROV_PARAM_BUILDINFO' =>          "buildinfo",          # utf8_ptr
-    'PROV_PARAM_STATUS' =>             "status",             # uint
-    'PROV_PARAM_SECURITY_CHECKS' =>    "security-checks",    # uint
-    'PROV_PARAM_HMAC_KEY_CHECK' =>     "hmac-key-check",     # uint
-    'PROV_PARAM_KMAC_KEY_CHECK' =>     "kmac-key-check",     # uint
-    'PROV_PARAM_TLS1_PRF_EMS_CHECK' => "tls1-prf-ems-check", # uint
-    'PROV_PARAM_NO_SHORT_MAC' =>       "no-short-mac",       # uint
-    'PROV_PARAM_DRBG_TRUNC_DIGEST' =>  "drbg-no-trunc-md",   # uint
-    'PROV_PARAM_HKDF_DIGEST_CHECK' =>      "hkdf-digest-check",      # uint
-    'PROV_PARAM_TLS13_KDF_DIGEST_CHECK' => "tls13-kdf-digest-check", # uint
-    'PROV_PARAM_TLS1_PRF_DIGEST_CHECK' =>  "tls1-prf-digest-check",  # uint
-    'PROV_PARAM_SSHKDF_DIGEST_CHECK' =>    "sshkdf-digest-check",    # uint
-    'PROV_PARAM_SSKDF_DIGEST_CHECK' =>     "sskdf-digest-check",     # uint
-    'PROV_PARAM_X963KDF_DIGEST_CHECK' =>   "x963kdf-digest-check",   # uint
-    'PROV_PARAM_DSA_SIGN_DISABLED' =>      "dsa-sign-disabled",      # uint
-    'PROV_PARAM_TDES_ENCRYPT_DISABLED' =>  "tdes-encrypt-disabled",  # uint
-    'PROV_PARAM_RSA_PSS_SALTLEN_CHECK' =>  "rsa-pss-saltlen-check",  # uint
-    'PROV_PARAM_RSA_SIGN_X931_PAD_DISABLED' =>  "rsa-sign-x931-pad-disabled",   # uint
-    'PROV_PARAM_RSA_PKCS15_PAD_DISABLED' => "rsa-pkcs15-pad-disabled", # uint
-    'PROV_PARAM_HKDF_KEY_CHECK' =>         "hkdf-key-check",         # uint
-    'PROV_PARAM_KBKDF_KEY_CHECK' =>        "kbkdf-key-check",        # uint
-    'PROV_PARAM_TLS13_KDF_KEY_CHECK' =>    "tls13-kdf-key-check",    # uint
-    'PROV_PARAM_TLS1_PRF_KEY_CHECK' =>     "tls1-prf-key-check",     # uint
-    'PROV_PARAM_SSHKDF_KEY_CHECK' =>       "sshkdf-key-check",       # uint
-    'PROV_PARAM_SSKDF_KEY_CHECK' =>        "sskdf-key-check",        # uint
-    'PROV_PARAM_X963KDF_KEY_CHECK' =>      "x963kdf-key-check",      # uint
-    'PROV_PARAM_X942KDF_KEY_CHECK' =>      "x942kdf-key-check",      # uint
-    'PROV_PARAM_PBKDF2_LOWER_BOUND_CHECK' => "pbkdf2-lower-bound-check", # uint
-    'PROV_PARAM_ECDH_COFACTOR_CHECK' =>    "ecdh-cofactor-check",    # uint
-    'PROV_PARAM_SIGNATURE_DIGEST_CHECK' => "signature-digest-check", # uint
+    'OSSL_PROV_PARAM_NAME' =>               "name",               # utf8_ptr
+    'OSSL_PROV_PARAM_VERSION' =>            "version",            # utf8_ptr
+    'OSSL_PROV_PARAM_BUILDINFO' =>          "buildinfo",          # utf8_ptr
+    'OSSL_PROV_PARAM_STATUS' =>             "status",             # uint
+    'OSSL_PROV_PARAM_SECURITY_CHECKS' =>    "security-checks",    # uint
+    'OSSL_PROV_PARAM_HMAC_KEY_CHECK' =>     "hmac-key-check",     # uint
+    'OSSL_PROV_PARAM_KMAC_KEY_CHECK' =>     "kmac-key-check",     # uint
+    'OSSL_PROV_PARAM_TLS1_PRF_EMS_CHECK' => "tls1-prf-ems-check", # uint
+    'OSSL_PROV_PARAM_NO_SHORT_MAC' =>       "no-short-mac",       # uint
+    'OSSL_PROV_PARAM_DRBG_TRUNC_DIGEST' =>  "drbg-no-trunc-md",   # uint
+    'OSSL_PROV_PARAM_HKDF_DIGEST_CHECK' =>      "hkdf-digest-check",      # uint
+    'OSSL_PROV_PARAM_TLS13_KDF_DIGEST_CHECK' => "tls13-kdf-digest-check", # uint
+    'OSSL_PROV_PARAM_TLS1_PRF_DIGEST_CHECK' =>  "tls1-prf-digest-check",  # uint
+    'OSSL_PROV_PARAM_SSHKDF_DIGEST_CHECK' =>    "sshkdf-digest-check",    # uint
+    'OSSL_PROV_PARAM_SSKDF_DIGEST_CHECK' =>     "sskdf-digest-check",     # uint
+    'OSSL_PROV_PARAM_X963KDF_DIGEST_CHECK' =>   "x963kdf-digest-check",   # uint
+    'OSSL_PROV_PARAM_DSA_SIGN_DISABLED' =>      "dsa-sign-disabled",      # uint
+    'OSSL_PROV_PARAM_TDES_ENCRYPT_DISABLED' =>  "tdes-encrypt-disabled",  # uint
+    'OSSL_PROV_PARAM_RSA_PSS_SALTLEN_CHECK' =>  "rsa-pss-saltlen-check",  # uint
+    'OSSL_PROV_PARAM_RSA_SIGN_X931_PAD_DISABLED' =>  "rsa-sign-x931-pad-disabled",   # uint
+    'OSSL_PROV_PARAM_RSA_PKCS15_PAD_DISABLED' => "rsa-pkcs15-pad-disabled", # uint
+    'OSSL_PROV_PARAM_HKDF_KEY_CHECK' =>         "hkdf-key-check",         # uint
+    'OSSL_PROV_PARAM_KBKDF_KEY_CHECK' =>        "kbkdf-key-check",        # uint
+    'OSSL_PROV_PARAM_TLS13_KDF_KEY_CHECK' =>    "tls13-kdf-key-check",    # uint
+    'OSSL_PROV_PARAM_TLS1_PRF_KEY_CHECK' =>     "tls1-prf-key-check",     # uint
+    'OSSL_PROV_PARAM_SSHKDF_KEY_CHECK' =>       "sshkdf-key-check",       # uint
+    'OSSL_PROV_PARAM_SSKDF_KEY_CHECK' =>        "sskdf-key-check",        # uint
+    'OSSL_PROV_PARAM_X963KDF_KEY_CHECK' =>      "x963kdf-key-check",      # uint
+    'OSSL_PROV_PARAM_X942KDF_KEY_CHECK' =>      "x942kdf-key-check",      # uint
+    'OSSL_PROV_PARAM_PBKDF2_LOWER_BOUND_CHECK' => "pbkdf2-lower-bound-check", # uint
+    'OSSL_PROV_PARAM_ECDH_COFACTOR_CHECK' =>    "ecdh-cofactor-check",    # uint
+    'OSSL_PROV_PARAM_SIGNATURE_DIGEST_CHECK' => "signature-digest-check", # uint

 # Self test callback parameters
-    'PROV_PARAM_SELF_TEST_PHASE' =>  "st-phase",# utf8_string
-    'PROV_PARAM_SELF_TEST_TYPE' =>   "st-type", # utf8_string
-    'PROV_PARAM_SELF_TEST_DESC' =>   "st-desc", # utf8_string
+    'OSSL_PROV_PARAM_SELF_TEST_PHASE' =>  "st-phase",# utf8_string
+    'OSSL_PROV_PARAM_SELF_TEST_TYPE' =>   "st-type", # utf8_string
+    'OSSL_PROV_PARAM_SELF_TEST_DESC' =>   "st-desc", # utf8_string

 # Provider-native object abstractions
 #
@@ -74,26 +78,26 @@ my %params = (
 # This set of parameter names is explained in detail in provider-object(7)
 # (doc/man7/provider-object.pod)

-    'OBJECT_PARAM_TYPE' =>              "type",     # INTEGER
-    'OBJECT_PARAM_DATA_TYPE' =>         "data-type",# UTF8_STRING
-    'OBJECT_PARAM_DATA_STRUCTURE' =>    "data-structure",# UTF8_STRING
-    'OBJECT_PARAM_REFERENCE' =>         "reference",# OCTET_STRING
-    'OBJECT_PARAM_DATA' =>              "data",# OCTET_STRING or UTF8_STRING
-    'OBJECT_PARAM_DESC' =>              "desc",     # UTF8_STRING
-    'OBJECT_PARAM_INPUT_TYPE' =>        "input-type", # UTF8_STRING
+    'OSSL_OBJECT_PARAM_TYPE' =>              "type",     # INTEGER
+    'OSSL_OBJECT_PARAM_DATA_TYPE' =>         "data-type",# UTF8_STRING
+    'OSSL_OBJECT_PARAM_DATA_STRUCTURE' =>    "data-structure",# UTF8_STRING
+    'OSSL_OBJECT_PARAM_REFERENCE' =>         "reference",# OCTET_STRING
+    'OSSL_OBJECT_PARAM_DATA' =>              "data",# OCTET_STRING or UTF8_STRING
+    'OSSL_OBJECT_PARAM_DESC' =>              "desc",     # UTF8_STRING
+    'OSSL_OBJECT_PARAM_INPUT_TYPE' =>        "input-type", # UTF8_STRING

 # Algorithm parameters
-# If "engine",or "properties",are specified, they should always be paired
+# If "properties" is specified, they should always be paired
 # with the algorithm type.
 # Note these are common names that are shared by many types (such as kdf, mac,
 # and pkey) e.g: see MAC_PARAM_DIGEST below.

-    'ALG_PARAM_DIGEST' =>       "digest",       # utf8_string
-    'ALG_PARAM_CIPHER' =>       "cipher",       # utf8_string
-    'ALG_PARAM_ENGINE' =>       "engine",       # utf8_string
-    'ALG_PARAM_MAC' =>          "mac",          # utf8_string
-    'ALG_PARAM_PROPERTIES' =>   "properties",   # utf8_string
-    'ALG_PARAM_FIPS_APPROVED_INDICATOR' => 'fips-indicator',   # int, -1, 0 or 1
+    'OSSL_ALG_PARAM_DIGEST' =>       "digest",       # utf8_string
+    'OSSL_ALG_PARAM_CIPHER' =>       "cipher",       # utf8_string
+    'OSSL_ALG_PARAM_MAC' =>          "mac",          # utf8_string
+    'OSSL_ALG_PARAM_PROPERTIES' =>   "properties",   # utf8_string
+    'OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR' => 'fips-indicator',   # int, -1, 0 or 1
+    'OSSL_ALG_PARAM_SECURITY_CATEGORY' => "security-category", # int, 0 .. 5

     # For any operation that deals with AlgorithmIdentifier, they should
     # implement both of these.
@@ -102,259 +106,282 @@ my %params = (
     # ALG_PARAM_ALGORITHM_ID_PARAMS is intended to be both settable
     # and gettable, to allow the calling application to pass or get
     # AlgID parameters to and from the provided implementation.
-    'ALG_PARAM_ALGORITHM_ID' => "algorithm-id", # octet_string (DER)
-    'ALG_PARAM_ALGORITHM_ID_PARAMS' =>  "algorithm-id-params", # octet_string
+    'OSSL_ALG_PARAM_ALGORITHM_ID' => "algorithm-id", # octet_string (DER)
+    'OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS' =>  "algorithm-id-params", # octet_string

 # cipher parameters
-    'CIPHER_PARAM_PADDING' =>              "padding",     # uint
-    'CIPHER_PARAM_USE_BITS' =>             "use-bits",    # uint
-    'CIPHER_PARAM_TLS_VERSION' =>          "tls-version", # uint
-    'CIPHER_PARAM_TLS_MAC' =>              "tls-mac",     # octet_ptr
-    'CIPHER_PARAM_TLS_MAC_SIZE' =>         "tls-mac-size",# size_t
-    'CIPHER_PARAM_MODE' =>                 "mode",        # uint
-    'CIPHER_PARAM_BLOCK_SIZE' =>           "blocksize",   # size_t
-    'CIPHER_PARAM_AEAD' =>                 "aead",        # int, 0 or 1
-    'CIPHER_PARAM_CUSTOM_IV' =>            "custom-iv",   # int, 0 or 1
-    'CIPHER_PARAM_CTS' =>                  "cts",         # int, 0 or 1
-    'CIPHER_PARAM_TLS1_MULTIBLOCK' =>      "tls-multi",   # int, 0 or 1
-    'CIPHER_PARAM_HAS_RAND_KEY' =>         "has-randkey", # int, 0 or 1
-    'CIPHER_PARAM_KEYLEN' =>               "keylen",      # size_t
-    'CIPHER_PARAM_IVLEN' =>                "ivlen",       # size_t
-    'CIPHER_PARAM_IV' =>                   "iv",          # octet_string OR octet_ptr
-    'CIPHER_PARAM_UPDATED_IV' =>           "updated-iv",  # octet_string OR octet_ptr
-    'CIPHER_PARAM_NUM' =>                  "num",         # uint
-    'CIPHER_PARAM_ROUNDS' =>               "rounds",      # uint
-    'CIPHER_PARAM_AEAD_TAG' =>             "tag",         # octet_string
-    'CIPHER_PARAM_PIPELINE_AEAD_TAG' =>    "pipeline-tag",# octet_ptr
-    'CIPHER_PARAM_AEAD_TLS1_AAD' =>        "tlsaad",      # octet_string
-    'CIPHER_PARAM_AEAD_TLS1_AAD_PAD' =>    "tlsaadpad",   # size_t
-    'CIPHER_PARAM_AEAD_TLS1_IV_FIXED' =>   "tlsivfixed",  # octet_string
-    'CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN' => "tlsivgen",    # octet_string
-    'CIPHER_PARAM_AEAD_TLS1_SET_IV_INV' => "tlsivinv",    # octet_string
-    'CIPHER_PARAM_AEAD_IVLEN' =>           '*CIPHER_PARAM_IVLEN',
-    'CIPHER_PARAM_AEAD_IV_GENERATED' => "iv-generated",   # uint
-    'CIPHER_PARAM_AEAD_TAGLEN' =>          "taglen",      # size_t
-    'CIPHER_PARAM_AEAD_MAC_KEY' =>         "mackey",      # octet_string
-    'CIPHER_PARAM_RANDOM_KEY' =>           "randkey",     # octet_string
-    'CIPHER_PARAM_RC2_KEYBITS' =>          "keybits",     # size_t
-    'CIPHER_PARAM_SPEED' =>                "speed",       # uint
-    'CIPHER_PARAM_CTS_MODE' =>             "cts_mode",    # utf8_string
-    'CIPHER_PARAM_DECRYPT_ONLY' =>         "decrypt-only",  # int, 0 or 1
-    'CIPHER_PARAM_FIPS_ENCRYPT_CHECK' =>   "encrypt-check", # int
-    'CIPHER_PARAM_FIPS_APPROVED_INDICATOR' => '*ALG_PARAM_FIPS_APPROVED_INDICATOR',
-    'CIPHER_PARAM_ALGORITHM_ID' =>         '*ALG_PARAM_ALGORITHM_ID',
+    'OSSL_CIPHER_PARAM_PADDING' =>              "padding",     # uint
+    'OSSL_CIPHER_PARAM_USE_BITS' =>             "use-bits",    # uint
+    'OSSL_CIPHER_PARAM_TLS_VERSION' =>          "tls-version", # uint
+    'OSSL_CIPHER_PARAM_TLS_MAC' =>              "tls-mac",     # octet_ptr
+    'OSSL_CIPHER_PARAM_TLS_MAC_SIZE' =>         "tls-mac-size",# size_t
+    'OSSL_CIPHER_PARAM_MODE' =>                 "mode",        # uint
+    'OSSL_CIPHER_PARAM_BLOCK_SIZE' =>           "blocksize",   # size_t
+    'OSSL_CIPHER_PARAM_AEAD' =>                 "aead",        # int, 0 or 1
+    'OSSL_CIPHER_PARAM_CUSTOM_IV' =>            "custom-iv",   # int, 0 or 1
+    'OSSL_CIPHER_PARAM_CTS' =>                  "cts",         # int, 0 or 1
+    'OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK' =>      "tls-multi",   # int, 0 or 1
+    'OSSL_CIPHER_PARAM_HAS_RAND_KEY' =>         "has-randkey", # int, 0 or 1
+    'OSSL_CIPHER_PARAM_KEYLEN' =>               "keylen",      # size_t
+    'OSSL_CIPHER_PARAM_IVLEN' =>                "ivlen",       # size_t
+    'OSSL_CIPHER_PARAM_IV' =>                   "iv",          # octet_string OR octet_ptr
+    'OSSL_CIPHER_PARAM_UPDATED_IV' =>           "updated-iv",  # octet_string OR octet_ptr
+    'OSSL_CIPHER_PARAM_NUM' =>                  "num",         # uint
+    'OSSL_CIPHER_PARAM_ROUNDS' =>               "rounds",      # uint
+    'OSSL_CIPHER_PARAM_AEAD_TAG' =>             "tag",         # octet_string
+    'OSSL_CIPHER_PARAM_PIPELINE_AEAD_TAG' =>    "pipeline-tag",# octet_ptr
+    'OSSL_CIPHER_PARAM_AEAD_TLS1_AAD' =>        "tlsaad",      # octet_string
+    'OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD' =>    "tlsaadpad",   # size_t
+    'OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED' =>   "tlsivfixed",  # octet_string
+    'OSSL_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN' => "tlsivgen",    # octet_string
+    'OSSL_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV' => "tlsivinv",    # octet_string
+    'OSSL_CIPHER_PARAM_AEAD_IVLEN' =>           '*OSSL_CIPHER_PARAM_IVLEN',
+    'OSSL_CIPHER_PARAM_AEAD_IV_GENERATED' => "iv-generated",   # uint
+    'OSSL_CIPHER_PARAM_AEAD_TAGLEN' =>          "taglen",      # size_t
+    'OSSL_CIPHER_PARAM_AEAD_MAC_KEY' =>         "mackey",      # octet_string
+    'OSSL_CIPHER_PARAM_RANDOM_KEY' =>           "randkey",     # octet_string
+    'OSSL_CIPHER_PARAM_RC2_KEYBITS' =>          "keybits",     # size_t
+    'OSSL_CIPHER_PARAM_SPEED' =>                "speed",       # uint
+    'OSSL_CIPHER_PARAM_CTS_MODE' =>             "cts_mode",    # utf8_string
+    'OSSL_CIPHER_PARAM_DECRYPT_ONLY' =>         "decrypt-only",  # int, 0 or 1
+    'OSSL_CIPHER_PARAM_FIPS_ENCRYPT_CHECK' =>   "encrypt-check", # int
+    'OSSL_CIPHER_PARAM_FIPS_APPROVED_INDICATOR' => '*OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR',
+    'OSSL_CIPHER_PARAM_ALGORITHM_ID' =>         '*OSSL_ALG_PARAM_ALGORITHM_ID',
     # Historically, CIPHER_PARAM_ALGORITHM_ID_PARAMS_OLD was used.  For the
     # time being, the old libcrypto functions will use both, so old providers
     # continue to work.
     # New providers are encouraged to use CIPHER_PARAM_ALGORITHM_ID_PARAMS.
-    'CIPHER_PARAM_ALGORITHM_ID_PARAMS' =>  '*ALG_PARAM_ALGORITHM_ID_PARAMS',
-    'CIPHER_PARAM_ALGORITHM_ID_PARAMS_OLD' => "alg_id_param", # octet_string
-    'CIPHER_PARAM_XTS_STANDARD' =>         "xts_standard",# utf8_string
-
-    'CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT' =>  "tls1multi_maxsndfrag",# uint
-    'CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE' =>        "tls1multi_maxbufsz",  # size_t
-    'CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE' =>         "tls1multi_interleave",# uint
-    'CIPHER_PARAM_TLS1_MULTIBLOCK_AAD' =>                "tls1multi_aad",       # octet_string
-    'CIPHER_PARAM_TLS1_MULTIBLOCK_AAD_PACKLEN' =>        "tls1multi_aadpacklen",# uint
-    'CIPHER_PARAM_TLS1_MULTIBLOCK_ENC' =>                "tls1multi_enc",       # octet_string
-    'CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN' =>             "tls1multi_encin",     # octet_string
-    'CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN' =>            "tls1multi_enclen",    # size_t
+    'OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS' =>  '*OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS',
+    'OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS_OLD' => "alg_id_param", # octet_string
+    'OSSL_CIPHER_PARAM_XTS_STANDARD' =>         "xts_standard",# utf8_string
+    'OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC' =>     "encrypt-then-mac",# int, 0 or 1
+    'OSSL_CIPHER_HMAC_PARAM_MAC' =>             "*OSSL_CIPHER_PARAM_AEAD_TAG",
+
+    'OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT' =>  "tls1multi_maxsndfrag",# uint
+    'OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE' =>        "tls1multi_maxbufsz",  # size_t
+    'OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE' =>         "tls1multi_interleave",# uint
+    'OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD' =>                "tls1multi_aad",       # octet_string
+    'OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD_PACKLEN' =>        "tls1multi_aadpacklen",# uint
+    'OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC' =>                "tls1multi_enc",       # octet_string
+    'OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN' =>             "tls1multi_encin",     # octet_string
+    'OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN' =>            "tls1multi_enclen",    # size_t

 # digest parameters
-    'DIGEST_PARAM_XOFLEN' =>       "xoflen",       # size_t
-    'DIGEST_PARAM_SSL3_MS' =>      "ssl3-ms",      # octet string
-    'DIGEST_PARAM_PAD_TYPE' =>     "pad-type",     # uint
-    'DIGEST_PARAM_MICALG' =>       "micalg",       # utf8 string
-    'DIGEST_PARAM_BLOCK_SIZE' =>   "blocksize",    # size_t
-    'DIGEST_PARAM_SIZE' =>         "size",         # size_t
-    'DIGEST_PARAM_XOF' =>          "xof",          # int, 0 or 1
-    'DIGEST_PARAM_ALGID_ABSENT' => "algid-absent", # int, 0 or 1
-    'DIGEST_PARAM_FIPS_APPROVED_INDICATOR' => '*ALG_PARAM_FIPS_APPROVED_INDICATOR',
+    'OSSL_DIGEST_PARAM_XOFLEN' =>       "xoflen",       # size_t
+    'OSSL_DIGEST_PARAM_SSL3_MS' =>      "ssl3-ms",      # octet string
+    'OSSL_DIGEST_PARAM_PAD_TYPE' =>     "pad-type",     # uint
+    'OSSL_DIGEST_PARAM_MICALG' =>       "micalg",       # utf8 string
+    'OSSL_DIGEST_PARAM_BLOCK_SIZE' =>   "blocksize",    # size_t
+    'OSSL_DIGEST_PARAM_SIZE' =>         "size",         # size_t
+    'OSSL_DIGEST_PARAM_XOF' =>          "xof",          # int, 0 or 1
+    'OSSL_DIGEST_PARAM_ALGID_ABSENT' => "algid-absent", # int, 0 or 1
+    'OSSL_DIGEST_PARAM_FUNCTION_NAME' =>    "function-name", # utf8 string
+    'OSSL_DIGEST_PARAM_CUSTOMIZATION' =>    "customization", # utf8 string
+    'OSSL_DIGEST_PARAM_FIPS_APPROVED_INDICATOR' => '*OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR',
+    'OSSL_DIGEST_PARAM_PROPERTIES' => '*OSSL_ALG_PARAM_PROPERTIES',# utf8 string
+
+# external mu digest parameters
+    'OSSL_DIGEST_PARAM_MU_PUB_KEY' =>        "pub",                        # octet string
+    'OSSL_DIGEST_PARAM_MU_CONTEXT_STRING' => "context-string",             # octet string
+    'OSSL_DIGEST_PARAM_MU_DIGEST' =>         '*OSSL_ALG_PARAM_DIGEST',     # utf8 string
+    'OSSL_DIGEST_PARAM_MU_PROPERTIES' =>     '*OSSL_ALG_PARAM_PROPERTIES', # utf8 string

 # MAC parameters
-    'MAC_PARAM_KEY' =>            "key",           # octet string
-    'MAC_PARAM_IV' =>             "iv",            # octet string
-    'MAC_PARAM_CUSTOM' =>         "custom",        # utf8 string
-    'MAC_PARAM_SALT' =>           "salt",          # octet string
-    'MAC_PARAM_XOF' =>            "xof",           # int, 0 or 1
-    'MAC_PARAM_DIGEST_NOINIT' =>  "digest-noinit", # int, 0 or 1
-    'MAC_PARAM_DIGEST_ONESHOT' => "digest-oneshot",# int, 0 or 1
-    'MAC_PARAM_C_ROUNDS' =>       "c-rounds",      # unsigned int
-    'MAC_PARAM_D_ROUNDS' =>       "d-rounds",      # unsigned int
-
-# If "engine",or "properties",are specified, they should always be paired
+    'OSSL_MAC_PARAM_KEY' =>            "key",           # octet string
+    'OSSL_MAC_PARAM_IV' =>             "iv",            # octet string
+    'OSSL_MAC_PARAM_CUSTOM' =>         "custom",        # utf8 string
+    'OSSL_MAC_PARAM_SALT' =>           "salt",          # octet string
+    'OSSL_MAC_PARAM_XOF' =>            "xof",           # int, 0 or 1
+    'OSSL_MAC_PARAM_DIGEST_NOINIT' =>  "digest-noinit", # int, 0 or 1
+    'OSSL_MAC_PARAM_DIGEST_ONESHOT' => "digest-oneshot",# int, 0 or 1
+    'OSSL_MAC_PARAM_C_ROUNDS' =>       "c-rounds",      # unsigned int
+    'OSSL_MAC_PARAM_D_ROUNDS' =>       "d-rounds",      # unsigned int
+
+# If "properties" is specified, they should always be paired
 # with "cipher",or "digest".

-    'MAC_PARAM_CIPHER' =>           '*ALG_PARAM_CIPHER',        # utf8 string
-    'MAC_PARAM_DIGEST' =>           '*ALG_PARAM_DIGEST',        # utf8 string
-    'MAC_PARAM_PROPERTIES' =>       '*ALG_PARAM_PROPERTIES',    # utf8 string
-    'MAC_PARAM_SIZE' =>             "size",                     # size_t
-    'MAC_PARAM_BLOCK_SIZE' =>       "block-size",               # size_t
-    'MAC_PARAM_TLS_DATA_SIZE' =>    "tls-data-size",            # size_t
-    'MAC_PARAM_FIPS_NO_SHORT_MAC' =>'*PROV_PARAM_NO_SHORT_MAC',
-    'MAC_PARAM_FIPS_KEY_CHECK' =>   '*PKEY_PARAM_FIPS_KEY_CHECK',
-    'MAC_PARAM_FIPS_APPROVED_INDICATOR' => '*ALG_PARAM_FIPS_APPROVED_INDICATOR',
-    'MAC_PARAM_FIPS_NO_SHORT_MAC' => '*PROV_PARAM_NO_SHORT_MAC',
+    'OSSL_MAC_PARAM_CIPHER' =>           '*OSSL_ALG_PARAM_CIPHER',        # utf8 string
+    'OSSL_MAC_PARAM_DIGEST' =>           '*OSSL_ALG_PARAM_DIGEST',        # utf8 string
+    'OSSL_MAC_PARAM_PROPERTIES' =>       '*OSSL_ALG_PARAM_PROPERTIES',    # utf8 string
+    'OSSL_MAC_PARAM_SIZE' =>             "size",                     # size_t
+    'OSSL_MAC_PARAM_BLOCK_SIZE' =>       "block-size",               # size_t
+    'OSSL_MAC_PARAM_TLS_DATA_SIZE' =>    "tls-data-size",            # size_t
+    'OSSL_MAC_PARAM_FIPS_NO_SHORT_MAC' =>'*OSSL_PROV_PARAM_NO_SHORT_MAC',
+    'OSSL_MAC_PARAM_FIPS_KEY_CHECK' =>   '*OSSL_PKEY_PARAM_FIPS_KEY_CHECK',
+    'OSSL_MAC_PARAM_FIPS_APPROVED_INDICATOR' => '*OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR',
+    'OSSL_MAC_PARAM_FIPS_NO_SHORT_MAC' => '*OSSL_PROV_PARAM_NO_SHORT_MAC',

 # KDF / PRF parameters
-    'KDF_PARAM_SECRET' =>       "secret",                   # octet string
-    'KDF_PARAM_KEY' =>          "key",                      # octet string
-    'KDF_PARAM_SALT' =>         "salt",                     # octet string
-    'KDF_PARAM_PASSWORD' =>     "pass",                     # octet string
-    'KDF_PARAM_PREFIX' =>       "prefix",                   # octet string
-    'KDF_PARAM_LABEL' =>        "label",                    # octet string
-    'KDF_PARAM_DATA' =>         "data",                     # octet string
-    'KDF_PARAM_DIGEST' =>       '*ALG_PARAM_DIGEST',        # utf8 string
-    'KDF_PARAM_CIPHER' =>       '*ALG_PARAM_CIPHER',        # utf8 string
-    'KDF_PARAM_MAC' =>          '*ALG_PARAM_MAC',           # utf8 string
-    'KDF_PARAM_MAC_SIZE' =>     "maclen",                   # size_t
-    'KDF_PARAM_PROPERTIES' =>   '*ALG_PARAM_PROPERTIES',    # utf8 string
-    'KDF_PARAM_ITER' =>         "iter",                     # unsigned int
-    'KDF_PARAM_MODE' =>         "mode",                     # utf8 string or int
-    'KDF_PARAM_PKCS5' =>        "pkcs5",                    # int
-    'KDF_PARAM_UKM' =>          "ukm",                      # octet string
-    'KDF_PARAM_CEK_ALG' =>      "cekalg",                   # utf8 string
-    'KDF_PARAM_SCRYPT_N' =>     "n",                        # uint64_t
-    'KDF_PARAM_SCRYPT_R' =>     "r",                        # uint32_t
-    'KDF_PARAM_SCRYPT_P' =>     "p",                        # uint32_t
-    'KDF_PARAM_SCRYPT_MAXMEM' => "maxmem_bytes",            # uint64_t
-    'KDF_PARAM_INFO' =>         "info",                     # octet string
-    'KDF_PARAM_SEED' =>         "seed",                     # octet string
-    'KDF_PARAM_SSHKDF_XCGHASH' => "xcghash",                # octet string
-    'KDF_PARAM_SSHKDF_SESSION_ID' => "session_id",          # octet string
-    'KDF_PARAM_SSHKDF_TYPE' =>  "type",                     # int
-    'KDF_PARAM_SIZE' =>         "size",                     # size_t
-    'KDF_PARAM_CONSTANT' =>     "constant",                 # octet string
-    'KDF_PARAM_PKCS12_ID' =>    "id",                       # int
-    'KDF_PARAM_KBKDF_USE_L' =>          "use-l",            # int
-    'KDF_PARAM_KBKDF_USE_SEPARATOR' =>  "use-separator",    # int
-    'KDF_PARAM_KBKDF_R' =>      "r",                        # int
-    'KDF_PARAM_X942_ACVPINFO' =>        "acvp-info",
-    'KDF_PARAM_X942_PARTYUINFO' =>      "partyu-info",
-    'KDF_PARAM_X942_PARTYVINFO' =>      "partyv-info",
-    'KDF_PARAM_X942_SUPP_PUBINFO' =>    "supp-pubinfo",
-    'KDF_PARAM_X942_SUPP_PRIVINFO' =>   "supp-privinfo",
-    'KDF_PARAM_X942_USE_KEYBITS' =>     "use-keybits",
-    'KDF_PARAM_HMACDRBG_ENTROPY' =>     "entropy",
-    'KDF_PARAM_HMACDRBG_NONCE' =>       "nonce",
-    'KDF_PARAM_THREADS' =>        "threads",                # uint32_t
-    'KDF_PARAM_EARLY_CLEAN' =>    "early_clean",            # uint32_t
-    'KDF_PARAM_ARGON2_AD' =>      "ad",                     # octet string
-    'KDF_PARAM_ARGON2_LANES' =>   "lanes",                  # uint32_t
-    'KDF_PARAM_ARGON2_MEMCOST' => "memcost",                # uint32_t
-    'KDF_PARAM_ARGON2_VERSION' => "version",                # uint32_t
-    'KDF_PARAM_FIPS_EMS_CHECK' => "ems_check",              # int
-    'KDF_PARAM_FIPS_DIGEST_CHECK' => '*PKEY_PARAM_FIPS_DIGEST_CHECK',
-    'KDF_PARAM_FIPS_KEY_CHECK' => '*PKEY_PARAM_FIPS_KEY_CHECK',
-    'KDF_PARAM_FIPS_APPROVED_INDICATOR' => '*ALG_PARAM_FIPS_APPROVED_INDICATOR',
+    'OSSL_KDF_PARAM_SECRET' =>       "secret",                   # octet string
+    'OSSL_KDF_PARAM_KEY' =>          "key",                      # octet string
+    'OSSL_KDF_PARAM_SALT' =>         "salt",                     # octet string
+    'OSSL_KDF_PARAM_PASSWORD' =>     "pass",                     # octet string
+    'OSSL_KDF_PARAM_PREFIX' =>       "prefix",                   # octet string
+    'OSSL_KDF_PARAM_LABEL' =>        "label",                    # octet string
+    'OSSL_KDF_PARAM_DATA' =>         "data",                     # octet string
+    'OSSL_KDF_PARAM_DIGEST' =>       '*OSSL_ALG_PARAM_DIGEST',        # utf8 string
+    'OSSL_KDF_PARAM_CIPHER' =>       '*OSSL_ALG_PARAM_CIPHER',        # utf8 string
+    'OSSL_KDF_PARAM_MAC' =>          '*OSSL_ALG_PARAM_MAC',           # utf8 string
+    'OSSL_KDF_PARAM_MAC_SIZE' =>     "maclen",                   # size_t
+    'OSSL_KDF_PARAM_PROPERTIES' =>   '*OSSL_ALG_PARAM_PROPERTIES',    # utf8 string
+    'OSSL_KDF_PARAM_ITER' =>         "iter",                     # unsigned int
+    'OSSL_KDF_PARAM_MODE' =>         "mode",                     # utf8 string or int
+    'OSSL_KDF_PARAM_PKCS5' =>        "pkcs5",                    # int
+    'OSSL_KDF_PARAM_UKM' =>          "ukm",                      # octet string
+    'OSSL_KDF_PARAM_CEK_ALG' =>      "cekalg",                   # utf8 string
+    'OSSL_KDF_PARAM_IKEV2KDF_NI' =>  "ni",                       # octet string
+    'OSSL_KDF_PARAM_IKEV2KDF_NR' =>  "nr",                       # octet string
+    'OSSL_KDF_PARAM_IKEV2KDF_SPII' => "spii",                    # octet string
+    'OSSL_KDF_PARAM_IKEV2KDF_SPIR' => "spir",                    # octet string
+    'OSSL_KDF_PARAM_SCRYPT_N' =>     "n",                        # uint64_t
+    'OSSL_KDF_PARAM_SCRYPT_R' =>     "r",                        # uint32_t
+    'OSSL_KDF_PARAM_SCRYPT_P' =>     "p",                        # uint32_t
+    'OSSL_KDF_PARAM_SCRYPT_MAXMEM' => "maxmem_bytes",            # uint64_t
+    'OSSL_KDF_PARAM_INFO' =>         "info",                     # octet string
+    'OSSL_KDF_PARAM_SEED' =>         "seed",                     # octet string
+    'OSSL_KDF_PARAM_SNMPKDF_EID' =>  "eid",                      # octet string
+    'OSSL_KDF_PARAM_SRTPKDF_INDEX' => "index",                   # octet string
+    'OSSL_KDF_PARAM_SRTPKDF_KDR' =>   "kdr",                     # uint32_t
+    'OSSL_KDF_PARAM_SRTPKDF_LABEL' => "label",                   # uint32_t
+    'OSSL_KDF_PARAM_SSHKDF_XCGHASH' => "xcghash",                # octet string
+    'OSSL_KDF_PARAM_SSHKDF_SESSION_ID' => "session_id",          # octet string
+    'OSSL_KDF_PARAM_SSHKDF_TYPE' =>  "type",                     # int
+    'OSSL_KDF_PARAM_SIZE' =>         "size",                     # size_t
+    'OSSL_KDF_PARAM_CONSTANT' =>     "constant",                 # octet string
+    'OSSL_KDF_PARAM_PKCS12_ID' =>    "id",                       # int
+    'OSSL_KDF_PARAM_KBKDF_USE_L' =>          "use-l",            # int
+    'OSSL_KDF_PARAM_KBKDF_USE_SEPARATOR' =>  "use-separator",    # int
+    'OSSL_KDF_PARAM_KBKDF_R' =>      "r",                        # int
+    'OSSL_KDF_PARAM_X942_ACVPINFO' =>        "acvp-info",
+    'OSSL_KDF_PARAM_X942_PARTYUINFO' =>      "partyu-info",
+    'OSSL_KDF_PARAM_X942_PARTYVINFO' =>      "partyv-info",
+    'OSSL_KDF_PARAM_X942_SUPP_PUBINFO' =>    "supp-pubinfo",
+    'OSSL_KDF_PARAM_X942_SUPP_PRIVINFO' =>   "supp-privinfo",
+    'OSSL_KDF_PARAM_X942_USE_KEYBITS' =>     "use-keybits",
+    'OSSL_KDF_PARAM_HMACDRBG_ENTROPY' =>     "entropy",
+    'OSSL_KDF_PARAM_HMACDRBG_NONCE' =>       "nonce",
+    'OSSL_KDF_PARAM_THREADS' =>        "threads",                # uint32_t
+    'OSSL_KDF_PARAM_EARLY_CLEAN' =>    "early_clean",            # uint32_t
+    'OSSL_KDF_PARAM_ARGON2_AD' =>      "ad",                     # octet string
+    'OSSL_KDF_PARAM_ARGON2_LANES' =>   "lanes",                  # uint32_t
+    'OSSL_KDF_PARAM_ARGON2_MEMCOST' => "memcost",                # uint32_t
+    'OSSL_KDF_PARAM_ARGON2_VERSION' => "version",                # uint32_t
+    'OSSL_KDF_PARAM_FIPS_EMS_CHECK' => "ems_check",              # int
+    'OSSL_KDF_PARAM_FIPS_DIGEST_CHECK' => '*OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK',
+    'OSSL_KDF_PARAM_FIPS_KEY_CHECK' => '*OSSL_PKEY_PARAM_FIPS_KEY_CHECK',
+    'OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR' => '*OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR',

 # Known RAND names
-    'RAND_PARAM_STATE' =>                   "state",
-    'RAND_PARAM_STRENGTH' =>                "strength",
-    'RAND_PARAM_MAX_REQUEST' =>             "max_request",
-    'RAND_PARAM_TEST_ENTROPY' =>            "test_entropy",
-    'RAND_PARAM_TEST_NONCE' =>              "test_nonce",
-    'RAND_PARAM_GENERATE' =>                "generate",
-    'RAND_PARAM_FIPS_APPROVED_INDICATOR' => '*ALG_PARAM_FIPS_APPROVED_INDICATOR',
+    'OSSL_RAND_PARAM_STATE' =>                   "state",
+    'OSSL_RAND_PARAM_STRENGTH' =>                "strength",
+    'OSSL_RAND_PARAM_MAX_REQUEST' =>             "max_request",
+    'OSSL_RAND_PARAM_TEST_ENTROPY' =>            "test_entropy",
+    'OSSL_RAND_PARAM_TEST_NONCE' =>              "test_nonce",
+    'OSSL_RAND_PARAM_GENERATE' =>                "generate",
+    'OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR' => '*OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR',

 # RAND/DRBG names
-    'DRBG_PARAM_RESEED_REQUESTS' =>         "reseed_requests",
-    'DRBG_PARAM_RESEED_TIME_INTERVAL' =>    "reseed_time_interval",
-    'DRBG_PARAM_MIN_ENTROPYLEN' =>          "min_entropylen",
-    'DRBG_PARAM_MAX_ENTROPYLEN' =>          "max_entropylen",
-    'DRBG_PARAM_MIN_NONCELEN' =>            "min_noncelen",
-    'DRBG_PARAM_MAX_NONCELEN' =>            "max_noncelen",
-    'DRBG_PARAM_MAX_PERSLEN' =>             "max_perslen",
-    'DRBG_PARAM_MAX_ADINLEN' =>             "max_adinlen",
-    'DRBG_PARAM_RESEED_COUNTER' =>          "reseed_counter",
-    'DRBG_PARAM_RESEED_TIME' =>             "reseed_time",
-    'DRBG_PARAM_PROPERTIES' =>              '*ALG_PARAM_PROPERTIES',
-    'DRBG_PARAM_DIGEST' =>                  '*ALG_PARAM_DIGEST',
-    'DRBG_PARAM_CIPHER' =>                  '*ALG_PARAM_CIPHER',
-    'DRBG_PARAM_MAC' =>                     '*ALG_PARAM_MAC',
-    'DRBG_PARAM_USE_DF' =>                  "use_derivation_function",
-    'DRBG_PARAM_FIPS_DIGEST_CHECK' =>       '*PKEY_PARAM_FIPS_DIGEST_CHECK',
-    'DRBG_PARAM_FIPS_APPROVED_INDICATOR' => '*ALG_PARAM_FIPS_APPROVED_INDICATOR',
+    'OSSL_DRBG_PARAM_RESEED_REQUESTS' =>         "reseed_requests",
+    'OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL' =>    "reseed_time_interval",
+    'OSSL_DRBG_PARAM_MIN_ENTROPYLEN' =>          "min_entropylen",
+    'OSSL_DRBG_PARAM_MAX_ENTROPYLEN' =>          "max_entropylen",
+    'OSSL_DRBG_PARAM_MIN_NONCELEN' =>            "min_noncelen",
+    'OSSL_DRBG_PARAM_MAX_NONCELEN' =>            "max_noncelen",
+    'OSSL_DRBG_PARAM_MAX_PERSLEN' =>             "max_perslen",
+    'OSSL_DRBG_PARAM_MAX_ADINLEN' =>             "max_adinlen",
+    'OSSL_DRBG_PARAM_RESEED_COUNTER' =>          "reseed_counter",
+    'OSSL_DRBG_PARAM_RESEED_TIME' =>             "reseed_time",
+    'OSSL_DRBG_PARAM_PROPERTIES' =>              '*OSSL_ALG_PARAM_PROPERTIES',
+    'OSSL_DRBG_PARAM_DIGEST' =>                  '*OSSL_ALG_PARAM_DIGEST',
+    'OSSL_DRBG_PARAM_CIPHER' =>                  '*OSSL_ALG_PARAM_CIPHER',
+    'OSSL_DRBG_PARAM_MAC' =>                     '*OSSL_ALG_PARAM_MAC',
+    'OSSL_DRBG_PARAM_USE_DF' =>                  "use_derivation_function",
+    'OSSL_DRBG_PARAM_FIPS_DIGEST_CHECK' =>       '*OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK',
+    'OSSL_DRBG_PARAM_FIPS_APPROVED_INDICATOR' => '*OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR',

 # DRBG call back parameters
-    'DRBG_PARAM_ENTROPY_REQUIRED' =>        "entropy_required",
-    'DRBG_PARAM_PREDICTION_RESISTANCE' =>   "prediction_resistance",
-    'DRBG_PARAM_MIN_LENGTH' =>              "minium_length",
-    'DRBG_PARAM_MAX_LENGTH' =>              "maxium_length",
-    'DRBG_PARAM_RANDOM_DATA' =>             "random_data",
-    'DRBG_PARAM_SIZE' =>                    "size",
+    'OSSL_DRBG_PARAM_ENTROPY_REQUIRED' =>        "entropy_required",
+    'OSSL_DRBG_PARAM_PREDICTION_RESISTANCE' =>   "prediction_resistance",
+    'OSSL_DRBG_PARAM_MIN_LENGTH' =>              "minium_length",
+    'OSSL_DRBG_PARAM_MAX_LENGTH' =>              "maxium_length",
+    'OSSL_DRBG_PARAM_RANDOM_DATA' =>             "random_data",
+    'OSSL_DRBG_PARAM_SIZE' =>                    "size",

 # PKEY parameters
 # Common PKEY parameters
-    'PKEY_PARAM_BITS' =>                "bits",# integer
-    'PKEY_PARAM_MAX_SIZE' =>            "max-size",# integer
-    'PKEY_PARAM_SECURITY_BITS' =>       "security-bits",# integer
-    'PKEY_PARAM_DIGEST' =>              '*ALG_PARAM_DIGEST',
-    'PKEY_PARAM_CIPHER' =>              '*ALG_PARAM_CIPHER', # utf8 string
-    'PKEY_PARAM_ENGINE' =>              '*ALG_PARAM_ENGINE', # utf8 string
-    'PKEY_PARAM_PROPERTIES' =>          '*ALG_PARAM_PROPERTIES',
-    'PKEY_PARAM_DEFAULT_DIGEST' =>      "default-digest",# utf8 string
-    'PKEY_PARAM_MANDATORY_DIGEST' =>    "mandatory-digest",# utf8 string
-    'PKEY_PARAM_PAD_MODE' =>            "pad-mode",
-    'PKEY_PARAM_DIGEST_SIZE' =>         "digest-size",
-    'PKEY_PARAM_MASKGENFUNC' =>         "mgf",
-    'PKEY_PARAM_MGF1_DIGEST' =>         "mgf1-digest",
-    'PKEY_PARAM_MGF1_PROPERTIES' =>     "mgf1-properties",
-    'PKEY_PARAM_ENCODED_PUBLIC_KEY' =>  "encoded-pub-key",
-    'PKEY_PARAM_GROUP_NAME' =>          "group",
-    'PKEY_PARAM_DIST_ID' =>             "distid",
-    'PKEY_PARAM_PUB_KEY' =>             "pub",
-    'PKEY_PARAM_PRIV_KEY' =>            "priv",
+    'OSSL_PKEY_PARAM_BITS' =>                "bits",# integer
+    'OSSL_PKEY_PARAM_MAX_SIZE' =>            "max-size",# integer
+    'OSSL_PKEY_PARAM_SECURITY_BITS' =>       "security-bits",# integer
+    'OSSL_PKEY_PARAM_SECURITY_CATEGORY' =>   '*OSSL_ALG_PARAM_SECURITY_CATEGORY',
+    'OSSL_PKEY_PARAM_DIGEST' =>              '*OSSL_ALG_PARAM_DIGEST',
+    'OSSL_PKEY_PARAM_CIPHER' =>              '*OSSL_ALG_PARAM_CIPHER', # utf8 string
+    'OSSL_PKEY_PARAM_PROPERTIES' =>          '*OSSL_ALG_PARAM_PROPERTIES',
+    'OSSL_PKEY_PARAM_DEFAULT_DIGEST' =>      "default-digest",# utf8 string
+    'OSSL_PKEY_PARAM_MANDATORY_DIGEST' =>    "mandatory-digest",# utf8 string
+    'OSSL_PKEY_PARAM_PAD_MODE' =>            "pad-mode",
+    'OSSL_PKEY_PARAM_DIGEST_SIZE' =>         "digest-size",
+    'OSSL_PKEY_PARAM_MASKGENFUNC' =>         "mgf",
+    'OSSL_PKEY_PARAM_MGF1_DIGEST' =>         "mgf1-digest",
+    'OSSL_PKEY_PARAM_MGF1_PROPERTIES' =>     "mgf1-properties",
+    'OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY' =>  "encoded-pub-key",
+    'OSSL_PKEY_PARAM_GROUP_NAME' =>          "group",
+    'OSSL_PKEY_PARAM_DIST_ID' =>             "distid",
+    'OSSL_PKEY_PARAM_PUB_KEY' =>             "pub",
+    'OSSL_PKEY_PARAM_PRIV_KEY' =>            "priv",
+    'OSSL_PKEY_PARAM_OUTPUT_FORMATS' =>      "output_formats",
     # PKEY_PARAM_IMPLICIT_REJECTION isn't actually used, or meaningful.  We keep
     # it for API stability, but please use ASYM_CIPHER_PARAM_IMPLICIT_REJECTION
     # instead.
-    'PKEY_PARAM_IMPLICIT_REJECTION' =>  "implicit-rejection",
-    'PKEY_PARAM_FIPS_DIGEST_CHECK' =>   "digest-check",
-    'PKEY_PARAM_FIPS_KEY_CHECK' =>      "key-check",
-    'PKEY_PARAM_ALGORITHM_ID' =>        '*ALG_PARAM_ALGORITHM_ID',
-    'PKEY_PARAM_ALGORITHM_ID_PARAMS' => '*ALG_PARAM_ALGORITHM_ID_PARAMS',
+    'OSSL_PKEY_PARAM_IMPLICIT_REJECTION' =>  "implicit-rejection",
+    'OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK' =>   "digest-check",
+    'OSSL_PKEY_PARAM_FIPS_KEY_CHECK' =>      "key-check",
+    'OSSL_PKEY_PARAM_ALGORITHM_ID' =>        '*OSSL_ALG_PARAM_ALGORITHM_ID',
+    'OSSL_PKEY_PARAM_ALGORITHM_ID_PARAMS' => '*OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS',
+    'OSSL_PKEY_PARAM_CMS_RI_TYPE' =>         "ri-type", # integer
+    'OSSL_PKEY_PARAM_CMS_KEMRI_KDF_ALGORITHM' => "kemri-kdf-alg",

 # Diffie-Hellman/DSA Parameters
-    'PKEY_PARAM_FFC_P' =>               "p",
-    'PKEY_PARAM_FFC_G' =>               "g",
-    'PKEY_PARAM_FFC_Q' =>               "q",
-    'PKEY_PARAM_FFC_GINDEX' =>          "gindex",
-    'PKEY_PARAM_FFC_PCOUNTER' =>        "pcounter",
-    'PKEY_PARAM_FFC_SEED' =>            "seed",
-    'PKEY_PARAM_FFC_COFACTOR' =>        "j",
-    'PKEY_PARAM_FFC_H' =>               "hindex",
-    'PKEY_PARAM_FFC_VALIDATE_PQ' =>     "validate-pq",
-    'PKEY_PARAM_FFC_VALIDATE_G' =>      "validate-g",
-    'PKEY_PARAM_FFC_VALIDATE_LEGACY' => "validate-legacy",
+    'OSSL_PKEY_PARAM_FFC_P' =>               "p",
+    'OSSL_PKEY_PARAM_FFC_G' =>               "g",
+    'OSSL_PKEY_PARAM_FFC_Q' =>               "q",
+    'OSSL_PKEY_PARAM_FFC_GINDEX' =>          "gindex",
+    'OSSL_PKEY_PARAM_FFC_PCOUNTER' =>        "pcounter",
+    'OSSL_PKEY_PARAM_FFC_SEED' =>            "seed",
+    'OSSL_PKEY_PARAM_FFC_COFACTOR' =>        "j",
+    'OSSL_PKEY_PARAM_FFC_H' =>               "hindex",
+    'OSSL_PKEY_PARAM_FFC_VALIDATE_PQ' =>     "validate-pq",
+    'OSSL_PKEY_PARAM_FFC_VALIDATE_G' =>      "validate-g",
+    'OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY' => "validate-legacy",

 # Diffie-Hellman params
-    'PKEY_PARAM_DH_GENERATOR' =>        "safeprime-generator",
-    'PKEY_PARAM_DH_PRIV_LEN' =>         "priv_len",
+    'OSSL_PKEY_PARAM_DH_GENERATOR' =>        "safeprime-generator",
+    'OSSL_PKEY_PARAM_DH_PRIV_LEN' =>         "priv_len",

 # Elliptic Curve Domain Parameters
-    'PKEY_PARAM_EC_PUB_X' =>     "qx",
-    'PKEY_PARAM_EC_PUB_Y' =>     "qy",
+    'OSSL_PKEY_PARAM_EC_PUB_X' =>     "qx",
+    'OSSL_PKEY_PARAM_EC_PUB_Y' =>     "qy",

 # Elliptic Curve Explicit Domain Parameters
-    'PKEY_PARAM_EC_FIELD_TYPE' =>                   "field-type",
-    'PKEY_PARAM_EC_P' =>                            "p",
-    'PKEY_PARAM_EC_A' =>                            "a",
-    'PKEY_PARAM_EC_B' =>                            "b",
-    'PKEY_PARAM_EC_GENERATOR' =>                    "generator",
-    'PKEY_PARAM_EC_ORDER' =>                        "order",
-    'PKEY_PARAM_EC_COFACTOR' =>                     "cofactor",
-    'PKEY_PARAM_EC_SEED' =>                         "seed",
-    'PKEY_PARAM_EC_CHAR2_M' =>                      "m",
-    'PKEY_PARAM_EC_CHAR2_TYPE' =>                   "basis-type",
-    'PKEY_PARAM_EC_CHAR2_TP_BASIS' =>               "tp",
-    'PKEY_PARAM_EC_CHAR2_PP_K1' =>                  "k1",
-    'PKEY_PARAM_EC_CHAR2_PP_K2' =>                  "k2",
-    'PKEY_PARAM_EC_CHAR2_PP_K3' =>                  "k3",
-    'PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS' => "decoded-from-explicit",
+    'OSSL_PKEY_PARAM_EC_FIELD_TYPE' =>                   "field-type",
+    'OSSL_PKEY_PARAM_EC_FIELD_DEGREE' =>                 "field-degree",
+    'OSSL_PKEY_PARAM_EC_P' =>                            "p",
+    'OSSL_PKEY_PARAM_EC_A' =>                            "a",
+    'OSSL_PKEY_PARAM_EC_B' =>                            "b",
+    'OSSL_PKEY_PARAM_EC_GENERATOR' =>                    "generator",
+    'OSSL_PKEY_PARAM_EC_ORDER' =>                        "order",
+    'OSSL_PKEY_PARAM_EC_COFACTOR' =>                     "cofactor",
+    'OSSL_PKEY_PARAM_EC_SEED' =>                         "seed",
+    'OSSL_PKEY_PARAM_EC_CHAR2_M' =>                      "m",
+    'OSSL_PKEY_PARAM_EC_CHAR2_TYPE' =>                   "basis-type",
+    'OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS' =>               "tp",
+    'OSSL_PKEY_PARAM_EC_CHAR2_PP_K1' =>                  "k1",
+    'OSSL_PKEY_PARAM_EC_CHAR2_PP_K2' =>                  "k2",
+    'OSSL_PKEY_PARAM_EC_CHAR2_PP_K3' =>                  "k3",
+    'OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS' => "decoded-from-explicit",

 # Elliptic Curve Key Parameters
-    'PKEY_PARAM_USE_COFACTOR_FLAG' => "use-cofactor-flag",
-    'PKEY_PARAM_USE_COFACTOR_ECDH' => '*PKEY_PARAM_USE_COFACTOR_FLAG',
+    'OSSL_PKEY_PARAM_USE_COFACTOR_FLAG' => "use-cofactor-flag",
+    'OSSL_PKEY_PARAM_USE_COFACTOR_ECDH' => '*OSSL_PKEY_PARAM_USE_COFACTOR_FLAG',

 # RSA Keys
 #
@@ -370,212 +397,214 @@ my %params = (
 # (the base i for the coefficients is 2, not 1, at least as implied by
 # RFC 8017)

-    'PKEY_PARAM_RSA_N' =>           "n",
-    'PKEY_PARAM_RSA_E' =>           "e",
-    'PKEY_PARAM_RSA_D' =>           "d",
-    'PKEY_PARAM_RSA_FACTOR' =>      "rsa-factor",
-    'PKEY_PARAM_RSA_EXPONENT' =>    "rsa-exponent",
-    'PKEY_PARAM_RSA_COEFFICIENT' => "rsa-coefficient",
-    'PKEY_PARAM_RSA_FACTOR1' =>      "rsa-factor1",
-    'PKEY_PARAM_RSA_FACTOR2' =>      "rsa-factor2",
-    'PKEY_PARAM_RSA_FACTOR3' =>      "rsa-factor3",
-    'PKEY_PARAM_RSA_FACTOR4' =>      "rsa-factor4",
-    'PKEY_PARAM_RSA_FACTOR5' =>      "rsa-factor5",
-    'PKEY_PARAM_RSA_FACTOR6' =>      "rsa-factor6",
-    'PKEY_PARAM_RSA_FACTOR7' =>      "rsa-factor7",
-    'PKEY_PARAM_RSA_FACTOR8' =>      "rsa-factor8",
-    'PKEY_PARAM_RSA_FACTOR9' =>      "rsa-factor9",
-    'PKEY_PARAM_RSA_FACTOR10' =>     "rsa-factor10",
-    'PKEY_PARAM_RSA_EXPONENT1' =>    "rsa-exponent1",
-    'PKEY_PARAM_RSA_EXPONENT2' =>    "rsa-exponent2",
-    'PKEY_PARAM_RSA_EXPONENT3' =>    "rsa-exponent3",
-    'PKEY_PARAM_RSA_EXPONENT4' =>    "rsa-exponent4",
-    'PKEY_PARAM_RSA_EXPONENT5' =>    "rsa-exponent5",
-    'PKEY_PARAM_RSA_EXPONENT6' =>    "rsa-exponent6",
-    'PKEY_PARAM_RSA_EXPONENT7' =>    "rsa-exponent7",
-    'PKEY_PARAM_RSA_EXPONENT8' =>    "rsa-exponent8",
-    'PKEY_PARAM_RSA_EXPONENT9' =>    "rsa-exponent9",
-    'PKEY_PARAM_RSA_EXPONENT10' =>   "rsa-exponent10",
-    'PKEY_PARAM_RSA_COEFFICIENT1' => "rsa-coefficient1",
-    'PKEY_PARAM_RSA_COEFFICIENT2' => "rsa-coefficient2",
-    'PKEY_PARAM_RSA_COEFFICIENT3' => "rsa-coefficient3",
-    'PKEY_PARAM_RSA_COEFFICIENT4' => "rsa-coefficient4",
-    'PKEY_PARAM_RSA_COEFFICIENT5' => "rsa-coefficient5",
-    'PKEY_PARAM_RSA_COEFFICIENT6' => "rsa-coefficient6",
-    'PKEY_PARAM_RSA_COEFFICIENT7' => "rsa-coefficient7",
-    'PKEY_PARAM_RSA_COEFFICIENT8' => "rsa-coefficient8",
-    'PKEY_PARAM_RSA_COEFFICIENT9' => "rsa-coefficient9",
+    'OSSL_PKEY_PARAM_RSA_N' =>           "n",
+    'OSSL_PKEY_PARAM_RSA_E' =>           "e",
+    'OSSL_PKEY_PARAM_RSA_D' =>           "d",
+    'OSSL_PKEY_PARAM_RSA_FACTOR' =>      "rsa-factor",
+    'OSSL_PKEY_PARAM_RSA_EXPONENT' =>    "rsa-exponent",
+    'OSSL_PKEY_PARAM_RSA_COEFFICIENT' => "rsa-coefficient",
+    'OSSL_PKEY_PARAM_RSA_FACTOR1' =>      "rsa-factor1",
+    'OSSL_PKEY_PARAM_RSA_FACTOR2' =>      "rsa-factor2",
+    'OSSL_PKEY_PARAM_RSA_FACTOR3' =>      "rsa-factor3",
+    'OSSL_PKEY_PARAM_RSA_FACTOR4' =>      "rsa-factor4",
+    'OSSL_PKEY_PARAM_RSA_FACTOR5' =>      "rsa-factor5",
+    'OSSL_PKEY_PARAM_RSA_FACTOR6' =>      "rsa-factor6",
+    'OSSL_PKEY_PARAM_RSA_FACTOR7' =>      "rsa-factor7",
+    'OSSL_PKEY_PARAM_RSA_FACTOR8' =>      "rsa-factor8",
+    'OSSL_PKEY_PARAM_RSA_FACTOR9' =>      "rsa-factor9",
+    'OSSL_PKEY_PARAM_RSA_FACTOR10' =>     "rsa-factor10",
+    'OSSL_PKEY_PARAM_RSA_EXPONENT1' =>    "rsa-exponent1",
+    'OSSL_PKEY_PARAM_RSA_EXPONENT2' =>    "rsa-exponent2",
+    'OSSL_PKEY_PARAM_RSA_EXPONENT3' =>    "rsa-exponent3",
+    'OSSL_PKEY_PARAM_RSA_EXPONENT4' =>    "rsa-exponent4",
+    'OSSL_PKEY_PARAM_RSA_EXPONENT5' =>    "rsa-exponent5",
+    'OSSL_PKEY_PARAM_RSA_EXPONENT6' =>    "rsa-exponent6",
+    'OSSL_PKEY_PARAM_RSA_EXPONENT7' =>    "rsa-exponent7",
+    'OSSL_PKEY_PARAM_RSA_EXPONENT8' =>    "rsa-exponent8",
+    'OSSL_PKEY_PARAM_RSA_EXPONENT9' =>    "rsa-exponent9",
+    'OSSL_PKEY_PARAM_RSA_EXPONENT10' =>   "rsa-exponent10",
+    'OSSL_PKEY_PARAM_RSA_COEFFICIENT1' => "rsa-coefficient1",
+    'OSSL_PKEY_PARAM_RSA_COEFFICIENT2' => "rsa-coefficient2",
+    'OSSL_PKEY_PARAM_RSA_COEFFICIENT3' => "rsa-coefficient3",
+    'OSSL_PKEY_PARAM_RSA_COEFFICIENT4' => "rsa-coefficient4",
+    'OSSL_PKEY_PARAM_RSA_COEFFICIENT5' => "rsa-coefficient5",
+    'OSSL_PKEY_PARAM_RSA_COEFFICIENT6' => "rsa-coefficient6",
+    'OSSL_PKEY_PARAM_RSA_COEFFICIENT7' => "rsa-coefficient7",
+    'OSSL_PKEY_PARAM_RSA_COEFFICIENT8' => "rsa-coefficient8",
+    'OSSL_PKEY_PARAM_RSA_COEFFICIENT9' => "rsa-coefficient9",

 # Key generation parameters
-    'PKEY_PARAM_RSA_BITS' =>             '*PKEY_PARAM_BITS',
-    'PKEY_PARAM_RSA_PRIMES' =>           "primes",
-    'PKEY_PARAM_RSA_DIGEST' =>           '*PKEY_PARAM_DIGEST',
-    'PKEY_PARAM_RSA_DIGEST_PROPS' =>     '*PKEY_PARAM_PROPERTIES',
-    'PKEY_PARAM_RSA_MASKGENFUNC' =>      '*PKEY_PARAM_MASKGENFUNC',
-    'PKEY_PARAM_RSA_MGF1_DIGEST' =>      '*PKEY_PARAM_MGF1_DIGEST',
-    'PKEY_PARAM_RSA_PSS_SALTLEN' =>      "saltlen",
-    'PKEY_PARAM_RSA_DERIVE_FROM_PQ'    =>     "rsa-derive-from-pq",
+    'OSSL_PKEY_PARAM_RSA_BITS' =>             '*OSSL_PKEY_PARAM_BITS',
+    'OSSL_PKEY_PARAM_RSA_PRIMES' =>           "primes",
+    'OSSL_PKEY_PARAM_RSA_DIGEST' =>           '*OSSL_PKEY_PARAM_DIGEST',
+    'OSSL_PKEY_PARAM_RSA_DIGEST_PROPS' =>     '*OSSL_PKEY_PARAM_PROPERTIES',
+    'OSSL_PKEY_PARAM_RSA_MASKGENFUNC' =>      '*OSSL_PKEY_PARAM_MASKGENFUNC',
+    'OSSL_PKEY_PARAM_RSA_MGF1_DIGEST' =>      '*OSSL_PKEY_PARAM_MGF1_DIGEST',
+    'OSSL_PKEY_PARAM_RSA_PSS_SALTLEN' =>      "saltlen",
+    'OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ'    =>     "rsa-derive-from-pq",
+    'OSSL_PKEY_PARAM_RSA_A' =>                "rsa-a",
+    'OSSL_PKEY_PARAM_RSA_B' =>                "rsa-b",

 # EC, X25519 and X448 Key generation parameters
-    'PKEY_PARAM_DHKEM_IKM' =>        "dhkem-ikm",
+    'OSSL_PKEY_PARAM_DHKEM_IKM' =>        "dhkem-ikm",

 # ML-KEM parameters
-    'PKEY_PARAM_ML_KEM_SEED' => "seed",
-    'PKEY_PARAM_ML_KEM_PREFER_SEED' => "ml-kem.prefer_seed",
-    'PKEY_PARAM_ML_KEM_RETAIN_SEED' => "ml-kem.retain_seed",
-    'PKEY_PARAM_ML_KEM_INPUT_FORMATS' => "ml-kem.input_formats",
-    'PKEY_PARAM_ML_KEM_OUTPUT_FORMATS' => "ml-kem.output_formats",
-    'PKEY_PARAM_ML_KEM_IMPORT_PCT_TYPE' => "ml-kem.import_pct_type",
+    'OSSL_PKEY_PARAM_ML_KEM_SEED' => "seed",
+    'OSSL_PKEY_PARAM_ML_KEM_PREFER_SEED' => "ml-kem.prefer_seed",
+    'OSSL_PKEY_PARAM_ML_KEM_RETAIN_SEED' => "ml-kem.retain_seed",
+    'OSSL_PKEY_PARAM_ML_KEM_INPUT_FORMATS' => "ml-kem.input_formats",
+    'OSSL_PKEY_PARAM_ML_KEM_OUTPUT_FORMATS' => "ml-kem.output_formats",
+    'OSSL_PKEY_PARAM_ML_KEM_IMPORT_PCT_TYPE' => "ml-kem.import_pct_type",

 # Key generation parameters
-    'PKEY_PARAM_FFC_TYPE' =>         "type",
-    'PKEY_PARAM_FFC_PBITS' =>        "pbits",
-    'PKEY_PARAM_FFC_QBITS' =>        "qbits",
-    'PKEY_PARAM_FFC_DIGEST' =>       '*PKEY_PARAM_DIGEST',
-    'PKEY_PARAM_FFC_DIGEST_PROPS' => '*PKEY_PARAM_PROPERTIES',
-
-    'PKEY_PARAM_EC_ENCODING' =>                "encoding",# utf8_string
-    'PKEY_PARAM_EC_POINT_CONVERSION_FORMAT' => "point-format",
-    'PKEY_PARAM_EC_GROUP_CHECK_TYPE' =>        "group-check",
-    'PKEY_PARAM_EC_INCLUDE_PUBLIC' =>          "include-public",
-    'PKEY_PARAM_FIPS_SIGN_CHECK' =>            "sign-check",
-    'PKEY_PARAM_FIPS_APPROVED_INDICATOR' => '*ALG_PARAM_FIPS_APPROVED_INDICATOR',
+    'OSSL_PKEY_PARAM_FFC_TYPE' =>         "type",
+    'OSSL_PKEY_PARAM_FFC_PBITS' =>        "pbits",
+    'OSSL_PKEY_PARAM_FFC_QBITS' =>        "qbits",
+    'OSSL_PKEY_PARAM_FFC_DIGEST' =>       '*OSSL_PKEY_PARAM_DIGEST',
+    'OSSL_PKEY_PARAM_FFC_DIGEST_PROPS' => '*OSSL_PKEY_PARAM_PROPERTIES',
+
+    'OSSL_PKEY_PARAM_EC_ENCODING' =>                "encoding",# utf8_string
+    'OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT' => "point-format",
+    'OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE' =>        "group-check",
+    'OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC' =>          "include-public",
+    'OSSL_PKEY_PARAM_FIPS_SIGN_CHECK' =>            "sign-check",
+    'OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR' => '*OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR',

 # ML_DSA Key generation parameter
-    'PKEY_PARAM_ML_DSA_SEED' =>             "seed",
-    'PKEY_PARAM_ML_DSA_RETAIN_SEED' =>      "ml-dsa.retain_seed",
-    'PKEY_PARAM_ML_DSA_PREFER_SEED' =>      "ml-dsa.prefer_seed",
-    'PKEY_PARAM_ML_DSA_INPUT_FORMATS' =>    "ml-dsa.input_formats",
-    'PKEY_PARAM_ML_DSA_OUTPUT_FORMATS' =>   "ml-dsa.output_formats",
+    'OSSL_PKEY_PARAM_ML_DSA_SEED' =>             "seed",
+    'OSSL_PKEY_PARAM_ML_DSA_RETAIN_SEED' =>      "ml-dsa.retain_seed",
+    'OSSL_PKEY_PARAM_ML_DSA_PREFER_SEED' =>      "ml-dsa.prefer_seed",
+    'OSSL_PKEY_PARAM_ML_DSA_INPUT_FORMATS' =>    "ml-dsa.input_formats",
+    'OSSL_PKEY_PARAM_ML_DSA_OUTPUT_FORMATS' =>   "ml-dsa.output_formats",

 # SLH_DSA Key generation parameters
-    'PKEY_PARAM_SLH_DSA_SEED' =>              "seed",
+    'OSSL_PKEY_PARAM_SLH_DSA_SEED' =>              "seed",

 # Key Exchange parameters
-    'EXCHANGE_PARAM_PAD' =>                   "pad",# uint
-    'EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE' => "ecdh-cofactor-mode",# int
-    'EXCHANGE_PARAM_KDF_TYPE' =>              "kdf-type",# utf8_string
-    'EXCHANGE_PARAM_KDF_DIGEST' =>            "kdf-digest",# utf8_string
-    'EXCHANGE_PARAM_KDF_DIGEST_PROPS' =>      "kdf-digest-props",# utf8_string
-    'EXCHANGE_PARAM_KDF_OUTLEN' =>            "kdf-outlen",# size_t
+    'OSSL_EXCHANGE_PARAM_PAD' =>                   "pad",# uint
+    'OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE' => "ecdh-cofactor-mode",# int
+    'OSSL_EXCHANGE_PARAM_KDF_TYPE' =>              "kdf-type",# utf8_string
+    'OSSL_EXCHANGE_PARAM_KDF_DIGEST' =>            "kdf-digest",# utf8_string
+    'OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS' =>      "kdf-digest-props",# utf8_string
+    'OSSL_EXCHANGE_PARAM_KDF_OUTLEN' =>            "kdf-outlen",# size_t
 # The following parameter is an octet_string on set and an octet_ptr on get
-    'EXCHANGE_PARAM_KDF_UKM' =>               "kdf-ukm",
-    'EXCHANGE_PARAM_FIPS_DIGEST_CHECK' =>     '*PKEY_PARAM_FIPS_DIGEST_CHECK',
-    'EXCHANGE_PARAM_FIPS_KEY_CHECK' =>        '*PKEY_PARAM_FIPS_KEY_CHECK',
-    'EXCHANGE_PARAM_FIPS_ECDH_COFACTOR_CHECK' => '*PROV_PARAM_ECDH_COFACTOR_CHECK',
-    'EXCHANGE_PARAM_FIPS_APPROVED_INDICATOR' => '*ALG_PARAM_FIPS_APPROVED_INDICATOR',
+    'OSSL_EXCHANGE_PARAM_KDF_UKM' =>               "kdf-ukm",
+    'OSSL_EXCHANGE_PARAM_FIPS_DIGEST_CHECK' =>     '*OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK',
+    'OSSL_EXCHANGE_PARAM_FIPS_KEY_CHECK' =>        '*OSSL_PKEY_PARAM_FIPS_KEY_CHECK',
+    'OSSL_EXCHANGE_PARAM_FIPS_ECDH_COFACTOR_CHECK' => '*OSSL_PROV_PARAM_ECDH_COFACTOR_CHECK',
+    'OSSL_EXCHANGE_PARAM_FIPS_APPROVED_INDICATOR' => '*OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR',

 # Signature parameters
-    'SIGNATURE_PARAM_ALGORITHM_ID' =>         '*PKEY_PARAM_ALGORITHM_ID',
-    'SIGNATURE_PARAM_ALGORITHM_ID_PARAMS' =>  '*PKEY_PARAM_ALGORITHM_ID_PARAMS',
-    'SIGNATURE_PARAM_PAD_MODE' =>             '*PKEY_PARAM_PAD_MODE',
-    'SIGNATURE_PARAM_DIGEST' =>               '*PKEY_PARAM_DIGEST',
-    'SIGNATURE_PARAM_PROPERTIES' =>           '*PKEY_PARAM_PROPERTIES',
-    'SIGNATURE_PARAM_PSS_SALTLEN' =>          "saltlen",
-    'SIGNATURE_PARAM_MGF1_DIGEST' =>          '*PKEY_PARAM_MGF1_DIGEST',
-    'SIGNATURE_PARAM_MGF1_PROPERTIES' =>      '*PKEY_PARAM_MGF1_PROPERTIES',
-    'SIGNATURE_PARAM_DIGEST_SIZE' =>          '*PKEY_PARAM_DIGEST_SIZE',
-    'SIGNATURE_PARAM_NONCE_TYPE' =>           "nonce-type",
-    'SIGNATURE_PARAM_INSTANCE' =>             "instance",
-    'SIGNATURE_PARAM_CONTEXT_STRING' =>       "context-string",
-    'SIGNATURE_PARAM_FIPS_DIGEST_CHECK' =>    '*PKEY_PARAM_FIPS_DIGEST_CHECK',
-    'SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE' =>  'verify-message',
-    'SIGNATURE_PARAM_FIPS_KEY_CHECK' =>       '*PKEY_PARAM_FIPS_KEY_CHECK',
-    'SIGNATURE_PARAM_FIPS_SIGN_CHECK' =>      '*PKEY_PARAM_FIPS_SIGN_CHECK',
-    'SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK' => "rsa-pss-saltlen-check",
-    'SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK' => "sign-x931-pad-check",
-    'SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR' => '*ALG_PARAM_FIPS_APPROVED_INDICATOR',
-    'SIGNATURE_PARAM_SIGNATURE' =>          "signature",
-    'SIGNATURE_PARAM_MESSAGE_ENCODING' =>   "message-encoding",
-    'SIGNATURE_PARAM_DETERMINISTIC' =>      "deterministic",
-    'SIGNATURE_PARAM_MU' =>                 "mu", # int
-    'SIGNATURE_PARAM_TEST_ENTROPY' =>       "test-entropy",
-    'SIGNATURE_PARAM_ADD_RANDOM' =>         "additional-random",
+    'OSSL_SIGNATURE_PARAM_ALGORITHM_ID' =>         '*OSSL_PKEY_PARAM_ALGORITHM_ID',
+    'OSSL_SIGNATURE_PARAM_ALGORITHM_ID_PARAMS' =>  '*OSSL_PKEY_PARAM_ALGORITHM_ID_PARAMS',
+    'OSSL_SIGNATURE_PARAM_PAD_MODE' =>             '*OSSL_PKEY_PARAM_PAD_MODE',
+    'OSSL_SIGNATURE_PARAM_DIGEST' =>               '*OSSL_PKEY_PARAM_DIGEST',
+    'OSSL_SIGNATURE_PARAM_PROPERTIES' =>           '*OSSL_PKEY_PARAM_PROPERTIES',
+    'OSSL_SIGNATURE_PARAM_PSS_SALTLEN' =>          "saltlen",
+    'OSSL_SIGNATURE_PARAM_MGF1_DIGEST' =>          '*OSSL_PKEY_PARAM_MGF1_DIGEST',
+    'OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES' =>      '*OSSL_PKEY_PARAM_MGF1_PROPERTIES',
+    'OSSL_SIGNATURE_PARAM_DIGEST_SIZE' =>          '*OSSL_PKEY_PARAM_DIGEST_SIZE',
+    'OSSL_SIGNATURE_PARAM_NONCE_TYPE' =>           "nonce-type",
+    'OSSL_SIGNATURE_PARAM_INSTANCE' =>             "instance",
+    'OSSL_SIGNATURE_PARAM_CONTEXT_STRING' =>       "context-string",
+    'OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK' =>    '*OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK',
+    'OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE' =>  'verify-message',
+    'OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK' =>       '*OSSL_PKEY_PARAM_FIPS_KEY_CHECK',
+    'OSSL_SIGNATURE_PARAM_FIPS_SIGN_CHECK' =>      '*OSSL_PKEY_PARAM_FIPS_SIGN_CHECK',
+    'OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK' => "rsa-pss-saltlen-check",
+    'OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK' => "sign-x931-pad-check",
+    'OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR' => '*OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR',
+    'OSSL_SIGNATURE_PARAM_SIGNATURE' =>          "signature",
+    'OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING' =>   "message-encoding",
+    'OSSL_SIGNATURE_PARAM_DETERMINISTIC' =>      "deterministic",
+    'OSSL_SIGNATURE_PARAM_MU' =>                 "mu", # int
+    'OSSL_SIGNATURE_PARAM_TEST_ENTROPY' =>       "test-entropy",
+    'OSSL_SIGNATURE_PARAM_ADD_RANDOM' =>         "additional-random",
+    'OSSL_SIGNATURE_PARAM_TLS_VERSION' =>        "tls-version",

 # Asym cipher parameters
-    'ASYM_CIPHER_PARAM_DIGEST' =>                   '*PKEY_PARAM_DIGEST',
-    'ASYM_CIPHER_PARAM_PROPERTIES' =>               '*PKEY_PARAM_PROPERTIES',
-    'ASYM_CIPHER_PARAM_ENGINE' =>                   '*PKEY_PARAM_ENGINE',
-    'ASYM_CIPHER_PARAM_PAD_MODE' =>                 '*PKEY_PARAM_PAD_MODE',
-    'ASYM_CIPHER_PARAM_MGF1_DIGEST' =>              '*PKEY_PARAM_MGF1_DIGEST',
-    'ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS' =>        '*PKEY_PARAM_MGF1_PROPERTIES',
-    'ASYM_CIPHER_PARAM_OAEP_DIGEST' =>              '*ALG_PARAM_DIGEST',
-    'ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS' =>        "digest-props",
+    'OSSL_ASYM_CIPHER_PARAM_DIGEST' =>                   '*OSSL_PKEY_PARAM_DIGEST',
+    'OSSL_ASYM_CIPHER_PARAM_PROPERTIES' =>               '*OSSL_PKEY_PARAM_PROPERTIES',
+    'OSSL_ASYM_CIPHER_PARAM_PAD_MODE' =>                 '*OSSL_PKEY_PARAM_PAD_MODE',
+    'OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST' =>              '*OSSL_PKEY_PARAM_MGF1_DIGEST',
+    'OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS' =>        '*OSSL_PKEY_PARAM_MGF1_PROPERTIES',
+    'OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST' =>              '*OSSL_ALG_PARAM_DIGEST',
+    'OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS' =>        "digest-props",
 # The following parameter is an octet_string on set and an octet_ptr on get
-    'ASYM_CIPHER_PARAM_OAEP_LABEL' =>               "oaep-label",
-    'ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION' =>       "tls-client-version",
-    'ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION' =>   "tls-negotiated-version",
-    'ASYM_CIPHER_PARAM_IMPLICIT_REJECTION' =>       "implicit-rejection",
-    'ASYM_CIPHER_PARAM_FIPS_RSA_PKCS15_PAD_DISABLED' => '*PROV_PARAM_RSA_PKCS15_PAD_DISABLED',
-    'ASYM_CIPHER_PARAM_FIPS_KEY_CHECK' =>           '*PKEY_PARAM_FIPS_KEY_CHECK',
-    'ASYM_CIPHER_PARAM_FIPS_APPROVED_INDICATOR' =>  '*ALG_PARAM_FIPS_APPROVED_INDICATOR',
+    'OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL' =>               "oaep-label",
+    'OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION' =>       "tls-client-version",
+    'OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION' =>   "tls-negotiated-version",
+    'OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION' =>       "implicit-rejection",
+    'OSSL_ASYM_CIPHER_PARAM_FIPS_RSA_PKCS15_PAD_DISABLED' => '*OSSL_PROV_PARAM_RSA_PKCS15_PAD_DISABLED',
+    'OSSL_ASYM_CIPHER_PARAM_FIPS_KEY_CHECK' =>           '*OSSL_PKEY_PARAM_FIPS_KEY_CHECK',
+    'OSSL_ASYM_CIPHER_PARAM_FIPS_APPROVED_INDICATOR' =>  '*OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR',

 # Encoder / decoder parameters

-    'ENCODER_PARAM_CIPHER' =>           '*ALG_PARAM_CIPHER',
-    'ENCODER_PARAM_PROPERTIES' =>       '*ALG_PARAM_PROPERTIES',
+    'OSSL_ENCODER_PARAM_CIPHER' =>           '*OSSL_ALG_PARAM_CIPHER',
+    'OSSL_ENCODER_PARAM_PROPERTIES' =>       '*OSSL_ALG_PARAM_PROPERTIES',
 # Currently PVK only, but reusable for others as needed
-    'ENCODER_PARAM_ENCRYPT_LEVEL' =>    "encrypt-level",
-    'ENCODER_PARAM_SAVE_PARAMETERS' =>  "save-parameters",# integer
+    'OSSL_ENCODER_PARAM_ENCRYPT_LEVEL' =>    "encrypt-level",
+    'OSSL_ENCODER_PARAM_SAVE_PARAMETERS' =>  "save-parameters",# integer

-    'DECODER_PARAM_PROPERTIES' =>       '*ALG_PARAM_PROPERTIES',
+    'OSSL_DECODER_PARAM_PROPERTIES' =>       '*OSSL_ALG_PARAM_PROPERTIES',

 # Passphrase callback parameters
-    'PASSPHRASE_PARAM_INFO' =>          "info",
+    'OSSL_PASSPHRASE_PARAM_INFO' =>          "info",

 # Keygen callback parameters, from provider to libcrypto
-    'GEN_PARAM_POTENTIAL' =>            "potential",# integer
-    'GEN_PARAM_ITERATION' =>            "iteration",# integer
+    'OSSL_GEN_PARAM_POTENTIAL' =>            "potential",# integer
+    'OSSL_GEN_PARAM_ITERATION' =>            "iteration",# integer

 # ACVP Test parameters : These should not be used normally
-    'PKEY_PARAM_RSA_TEST_XP1' => "xp1",
-    'PKEY_PARAM_RSA_TEST_XP2' => "xp2",
-    'PKEY_PARAM_RSA_TEST_XP' =>  "xp",
-    'PKEY_PARAM_RSA_TEST_XQ1' => "xq1",
-    'PKEY_PARAM_RSA_TEST_XQ2' => "xq2",
-    'PKEY_PARAM_RSA_TEST_XQ' =>  "xq",
-    'PKEY_PARAM_RSA_TEST_P1' =>  "p1",
-    'PKEY_PARAM_RSA_TEST_P2' =>  "p2",
-    'PKEY_PARAM_RSA_TEST_Q1' =>  "q1",
-    'PKEY_PARAM_RSA_TEST_Q2' =>  "q2",
-    'SIGNATURE_PARAM_KAT' =>     "kat",
+    'OSSL_PKEY_PARAM_RSA_TEST_XP1' => "xp1",
+    'OSSL_PKEY_PARAM_RSA_TEST_XP2' => "xp2",
+    'OSSL_PKEY_PARAM_RSA_TEST_XP' =>  "xp",
+    'OSSL_PKEY_PARAM_RSA_TEST_XQ1' => "xq1",
+    'OSSL_PKEY_PARAM_RSA_TEST_XQ2' => "xq2",
+    'OSSL_PKEY_PARAM_RSA_TEST_XQ' =>  "xq",
+    'OSSL_PKEY_PARAM_RSA_TEST_P1' =>  "p1",
+    'OSSL_PKEY_PARAM_RSA_TEST_P2' =>  "p2",
+    'OSSL_PKEY_PARAM_RSA_TEST_Q1' =>  "q1",
+    'OSSL_PKEY_PARAM_RSA_TEST_Q2' =>  "q2",
+    'OSSL_SIGNATURE_PARAM_KAT' =>     "kat",

 # KEM parameters
-    'KEM_PARAM_OPERATION' =>            "operation",
-    'KEM_PARAM_IKME' =>                 "ikme",
-    'KEM_PARAM_FIPS_KEY_CHECK' =>       '*PKEY_PARAM_FIPS_KEY_CHECK',
-    'KEM_PARAM_FIPS_APPROVED_INDICATOR' => '*ALG_PARAM_FIPS_APPROVED_INDICATOR',
+    'OSSL_KEM_PARAM_OPERATION' =>            "operation",
+    'OSSL_KEM_PARAM_IKME' =>                 "ikme",
+    'OSSL_KEM_PARAM_FIPS_KEY_CHECK' =>       '*OSSL_PKEY_PARAM_FIPS_KEY_CHECK',
+    'OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR' => '*OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR',

 # Capabilities

 # TLS-GROUP Capability
-    'CAPABILITY_TLS_GROUP_NAME' =>              "tls-group-name",
-    'CAPABILITY_TLS_GROUP_NAME_INTERNAL' =>     "tls-group-name-internal",
-    'CAPABILITY_TLS_GROUP_ID' =>                "tls-group-id",
-    'CAPABILITY_TLS_GROUP_ALG' =>               "tls-group-alg",
-    'CAPABILITY_TLS_GROUP_SECURITY_BITS' =>     "tls-group-sec-bits",
-    'CAPABILITY_TLS_GROUP_IS_KEM' =>            "tls-group-is-kem",
-    'CAPABILITY_TLS_GROUP_MIN_TLS' =>           "tls-min-tls",
-    'CAPABILITY_TLS_GROUP_MAX_TLS' =>           "tls-max-tls",
-    'CAPABILITY_TLS_GROUP_MIN_DTLS' =>          "tls-min-dtls",
-    'CAPABILITY_TLS_GROUP_MAX_DTLS' =>          "tls-max-dtls",
+    'OSSL_CAPABILITY_TLS_GROUP_NAME' =>              "tls-group-name",
+    'OSSL_CAPABILITY_TLS_GROUP_NAME_INTERNAL' =>     "tls-group-name-internal",
+    'OSSL_CAPABILITY_TLS_GROUP_ID' =>                "tls-group-id",
+    'OSSL_CAPABILITY_TLS_GROUP_ALG' =>               "tls-group-alg",
+    'OSSL_CAPABILITY_TLS_GROUP_SECURITY_BITS' =>     "tls-group-sec-bits",
+    'OSSL_CAPABILITY_TLS_GROUP_IS_KEM' =>            "tls-group-is-kem",
+    'OSSL_CAPABILITY_TLS_GROUP_MIN_TLS' =>           "tls-min-tls",
+    'OSSL_CAPABILITY_TLS_GROUP_MAX_TLS' =>           "tls-max-tls",
+    'OSSL_CAPABILITY_TLS_GROUP_MIN_DTLS' =>          "tls-min-dtls",
+    'OSSL_CAPABILITY_TLS_GROUP_MAX_DTLS' =>          "tls-max-dtls",

 # TLS-SIGALG Capability
-    'CAPABILITY_TLS_SIGALG_IANA_NAME' =>         "tls-sigalg-iana-name",
-    'CAPABILITY_TLS_SIGALG_CODE_POINT' =>        "tls-sigalg-code-point",
-    'CAPABILITY_TLS_SIGALG_NAME' =>              "tls-sigalg-name",
-    'CAPABILITY_TLS_SIGALG_OID' =>               "tls-sigalg-oid",
-    'CAPABILITY_TLS_SIGALG_SIG_NAME' =>          "tls-sigalg-sig-name",
-    'CAPABILITY_TLS_SIGALG_SIG_OID' =>           "tls-sigalg-sig-oid",
-    'CAPABILITY_TLS_SIGALG_HASH_NAME' =>         "tls-sigalg-hash-name",
-    'CAPABILITY_TLS_SIGALG_HASH_OID' =>          "tls-sigalg-hash-oid",
-    'CAPABILITY_TLS_SIGALG_KEYTYPE' =>           "tls-sigalg-keytype",
-    'CAPABILITY_TLS_SIGALG_KEYTYPE_OID' =>       "tls-sigalg-keytype-oid",
-    'CAPABILITY_TLS_SIGALG_SECURITY_BITS' =>     "tls-sigalg-sec-bits",
-    'CAPABILITY_TLS_SIGALG_MIN_TLS' =>           "tls-min-tls",
-    'CAPABILITY_TLS_SIGALG_MAX_TLS' =>           "tls-max-tls",
-    'CAPABILITY_TLS_SIGALG_MIN_DTLS' =>          "tls-min-dtls",
-    'CAPABILITY_TLS_SIGALG_MAX_DTLS' =>          "tls-max-dtls",
+    'OSSL_CAPABILITY_TLS_SIGALG_IANA_NAME' =>         "tls-sigalg-iana-name",
+    'OSSL_CAPABILITY_TLS_SIGALG_CODE_POINT' =>        "tls-sigalg-code-point",
+    'OSSL_CAPABILITY_TLS_SIGALG_NAME' =>              "tls-sigalg-name",
+    'OSSL_CAPABILITY_TLS_SIGALG_OID' =>               "tls-sigalg-oid",
+    'OSSL_CAPABILITY_TLS_SIGALG_SIG_NAME' =>          "tls-sigalg-sig-name",
+    'OSSL_CAPABILITY_TLS_SIGALG_SIG_OID' =>           "tls-sigalg-sig-oid",
+    'OSSL_CAPABILITY_TLS_SIGALG_HASH_NAME' =>         "tls-sigalg-hash-name",
+    'OSSL_CAPABILITY_TLS_SIGALG_HASH_OID' =>          "tls-sigalg-hash-oid",
+    'OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE' =>           "tls-sigalg-keytype",
+    'OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE_OID' =>       "tls-sigalg-keytype-oid",
+    'OSSL_CAPABILITY_TLS_SIGALG_SECURITY_BITS' =>     "tls-sigalg-sec-bits",
+    'OSSL_CAPABILITY_TLS_SIGALG_MIN_TLS' =>           "tls-min-tls",
+    'OSSL_CAPABILITY_TLS_SIGALG_MAX_TLS' =>           "tls-max-tls",
+    'OSSL_CAPABILITY_TLS_SIGALG_MIN_DTLS' =>          "tls-min-dtls",
+    'OSSL_CAPABILITY_TLS_SIGALG_MAX_DTLS' =>          "tls-max-dtls",

 # storemgmt parameters

@@ -592,151 +621,180 @@ my %params = (
 #   are used as search criteria.
 #   (STORE_PARAM_DIGEST is used with STORE_PARAM_FINGERPRINT)

-    'STORE_PARAM_EXPECT' =>     "expect",       # INTEGER
-    'STORE_PARAM_SUBJECT' =>    "subject",      # DER blob => OCTET_STRING
-    'STORE_PARAM_ISSUER' =>     "name",         # DER blob => OCTET_STRING
-    'STORE_PARAM_SERIAL' =>     "serial",       # INTEGER
-    'STORE_PARAM_DIGEST' =>     "digest",       # UTF8_STRING
-    'STORE_PARAM_FINGERPRINT' => "fingerprint", # OCTET_STRING
-    'STORE_PARAM_ALIAS' =>      "alias",        # UTF8_STRING
+    'OSSL_STORE_PARAM_EXPECT' =>     "expect",       # INTEGER
+    'OSSL_STORE_PARAM_SUBJECT' =>    "subject",      # DER blob => OCTET_STRING
+    'OSSL_STORE_PARAM_ISSUER' =>     "name",         # DER blob => OCTET_STRING
+    'OSSL_STORE_PARAM_SERIAL' =>     "serial",       # INTEGER
+    'OSSL_STORE_PARAM_DIGEST' =>     "digest",       # UTF8_STRING
+    'OSSL_STORE_PARAM_FINGERPRINT' => "fingerprint", # OCTET_STRING
+    'OSSL_STORE_PARAM_ALIAS' =>      "alias",        # UTF8_STRING

 # You may want to pass properties for the provider implementation to use
-    'STORE_PARAM_PROPERTIES' => "properties",   # utf8_string
+    'OSSL_STORE_PARAM_PROPERTIES' => "properties",   # utf8_string
 # DECODER input type if a decoder is used by the store
-    'STORE_PARAM_INPUT_TYPE' => "input-type",   # UTF8_STRING
+    'OSSL_STORE_PARAM_INPUT_TYPE' => "input-type",   # UTF8_STRING


 # Libssl record layer
-    'LIBSSL_RECORD_LAYER_PARAM_OPTIONS' =>        "options",
-    'LIBSSL_RECORD_LAYER_PARAM_MODE' =>           "mode",
-    'LIBSSL_RECORD_LAYER_PARAM_READ_AHEAD' =>     "read_ahead",
-    'LIBSSL_RECORD_LAYER_READ_BUFFER_LEN' =>      "read_buffer_len",
-    'LIBSSL_RECORD_LAYER_PARAM_USE_ETM' =>        "use_etm",
-    'LIBSSL_RECORD_LAYER_PARAM_STREAM_MAC' =>     "stream_mac",
-    'LIBSSL_RECORD_LAYER_PARAM_TLSTREE' =>        "tlstree",
-    'LIBSSL_RECORD_LAYER_PARAM_MAX_FRAG_LEN' =>   "max_frag_len",
-    'LIBSSL_RECORD_LAYER_PARAM_MAX_EARLY_DATA' => "max_early_data",
-    'LIBSSL_RECORD_LAYER_PARAM_BLOCK_PADDING' =>  "block_padding",
-    'LIBSSL_RECORD_LAYER_PARAM_HS_PADDING' =>     "hs_padding",
+    'OSSL_LIBSSL_RECORD_LAYER_PARAM_OPTIONS' =>        "options",
+    'OSSL_LIBSSL_RECORD_LAYER_PARAM_MODE' =>           "mode",
+    'OSSL_LIBSSL_RECORD_LAYER_PARAM_READ_AHEAD' =>     "read_ahead",
+    'OSSL_LIBSSL_RECORD_LAYER_READ_BUFFER_LEN' =>      "read_buffer_len",
+    'OSSL_LIBSSL_RECORD_LAYER_PARAM_USE_ETM' =>        "use_etm",
+    'OSSL_LIBSSL_RECORD_LAYER_PARAM_STREAM_MAC' =>     "stream_mac",
+    'OSSL_LIBSSL_RECORD_LAYER_PARAM_TLSTREE' =>        "tlstree",
+    'OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_FRAG_LEN' =>   "max_frag_len",
+    'OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_EARLY_DATA' => "max_early_data",
+    'OSSL_LIBSSL_RECORD_LAYER_PARAM_BLOCK_PADDING' =>  "block_padding",
+    'OSSL_LIBSSL_RECORD_LAYER_PARAM_HS_PADDING' =>     "hs_padding",

 # Symmetric Key parameters
-    'SKEY_PARAM_RAW_BYTES' => "raw-bytes",
-    'SKEY_PARAM_KEY_LENGTH' => "key-length",
+    'OSSL_SKEY_PARAM_ALIAS' => "skey-alias",
+    'OSSL_SKEY_PARAM_ALGORITHM_OID' => "skey-algorithm-oid",
+    'OSSL_SKEY_PARAM_ALGORITHM_PARAMS' => "skey-algorithm-params",
+    'OSSL_SKEY_PARAM_KEY_LENGTH' => "key-length",
+    'OSSL_SKEY_PARAM_LOCAL_KEYID' => "skey-local-keyid",
+    'OSSL_SKEY_PARAM_RAW_BYTES' => "raw-bytes",
 );

-# Generate string based macros for public consumption
-sub generate_public_macros {
-    my @macros = ();
-
-    foreach my $name (keys %params) {
-        my $val = $params{$name};
-        my $def = '# define OSSL_' . $name . ' ';
+sub output_ifdef {
+    my $cond = shift;

-        if (substr($val, 0, 1) eq '*') {
-            $def .= 'OSSL_' . substr($val, 1);
-        } else {
-            $def .= '"' . $val . '"';
-        }
-        push(@macros, $def)
+    if (defined($cond)) {
+        print "# if" . $cond . "\n";
     }
-    return join("\n", sort @macros);
 }

-# Generate number based macros for internal use
-# The numbers are unique per string
-sub generate_internal_macros {
-    my @macros = ();
-    my $count = 0;
-    my %reverse;
+sub output_else {
+    my $cond = shift;
+    my $body = shift;

-    # Determine the number for each unique string
-    # Sort the names to improve the chance of cache coherency
-    foreach my $name (sort keys %params) {
-        my $val = $params{$name};
+    if (defined($cond)) {
+        print "# else\n";
+        print($body);
+    }
+}

-        if (substr($val, 0, 1) ne '*' and not defined $reverse{$val}) {
-            $reverse{$val} = $count++;
-        }
+sub output_endifdef {
+    my $cond = shift;
+
+    if (defined($cond)) {
+        print "# endif\n";
+        $need_break = 1;
     }
+}
+
+# Generate string based macros for public consumption
+sub generate_public_macros {
+    my @macros = ();

-    # Output the defines
     foreach my $name (keys %params) {
         my $val = $params{$name};
-        my $def = '#define PIDX_' . $name . ' ';
+        my $def = '# define ' . $name . ' ';

         if (substr($val, 0, 1) eq '*') {
-            $def .= 'PIDX_' . substr($val, 1);
+            $def .= substr($val, 1);
         } else {
-            $def .= $reverse{$val};
+            $def .= '"' . $val . '"';
         }
         push(@macros, $def)
     }
-    return "#define NUM_PIDX $count\n\n" . join("\n", sort @macros);
+    return join("\n", sort @macros);
 }

-sub generate_trie {
-    my %trie;
-    my $nodes = 0;
-    my $chars = 0;
-
-    foreach my $name (sort keys %params) {
-        my $val = $params{$name};
-        if (substr($val, 0, 1) ne '*') {
-            my $cursor = \%trie;
-
-            $chars += length($val);
-            for my $i (0 .. length($val) - 1) {
-                my $c = substr($val, $i, 1);
-
-                if (not $case_sensitive) {
-                    $c = '_' if $c eq '-';
-                    $c = lc $c;
-                }
-
-                if (not defined $$cursor{$c}) {
-                    $cursor->{$c} = {};
-                    $nodes++;
-                }
-                $cursor = $cursor->{$c};
-            }
-            $cursor->{'val'} = $name;
-        }
+sub trie_matched {
+  my $with_count = shift;
+  my $field = shift;
+  my $num = shift;
+  my $dup = shift;
+  my $indent1 = shift;
+  my $indent2 = shift;
+
+  if ($field eq $invalid_param) {
+    printf "%sERR_raise_data(ERR_LIB_PROV, ERR_R_UNSUPPORTED,\n", $indent1;
+    printf "%s               \"param %%s is unsupported\", s);\n", $indent1;
+    printf "%sreturn 0;\n", $indent1;
+  } elsif ($field eq $default_indicator) {
+    printf "%sif (!OSSL_PARAM_set_int((OSSL_PARAM *)p, 1))\n", $indent1;
+    printf "%sreturn 0;\n", $indent2;
+  } elsif (defined($num)) {
+    printf "%sif (ossl_unlikely(r->num_%s >= %s)) {\n", $indent1, $field, $num;
+    printf "%sERR_raise_data(ERR_LIB_PROV, PROV_R_TOO_MANY_RECORDS,\n", $indent2;
+    printf "%s               \"param %%s present >%%d times\", s, $num);\n", $indent2;
+    printf "%sreturn 0;\n", $indent2;
+    printf "%s}\n", $indent1;
+    printf "%s++*count;\n", $indent1 if $with_count;
+    printf "%sr->%s[r->num_%s++] = (OSSL_PARAM *)p;\n", $indent1, $field, $field;
+  } else {
+    printf "%sif (ossl_unlikely(r->%s != NULL)) {\n", $indent1, $field;
+    if (defined $dup && $dup eq 'first') {
+      printf "%sbreak;\n", $indent2;
+    } else {
+      printf "%sERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,\n", $indent2;
+      printf "%s               \"param %%s is repeated\", s);\n", $indent2;
+      printf "%sreturn 0;\n", $indent2;
     }
-    #print "\n\n/* $nodes nodes for $chars letters*/\n\n";
-    return %trie;
+    printf "%s}\n", $indent1;
+    printf "%s++*count;\n", $indent1 if $with_count;
+    printf "%sr->%s = (OSSL_PARAM *)p;\n", $indent1, $field;
+  }
 }

-sub generate_code_from_trie {
+sub generate_decoder_from_trie {
+    my $with_count = shift;
     my $n = shift;
     my $trieref = shift;
+    my $identmap = shift;
+    my $concat_num = shift;
+    my $process_dup = shift;
+    my $ifdefs = shift;
     my $idt = "    ";
-    my $indent0 = $idt x ($n + 1);
+    my $indent0 = $idt x ($n + 3);
     my $indent1 = $indent0 . $idt;
+    my $indent2 = $indent1 . $idt;
     my $strcmp = $case_sensitive ? 'strcmp' : 'strcasecmp';
-
-    print "int ossl_param_find_pidx(const char *s)\n{\n" if $n == 0;
+    my $field;

     if ($trieref->{'suffix'}) {
         my $suf = $trieref->{'suffix'};

-        printf "%sif ($strcmp(\"$suf\", s + $n) == 0", $indent0;
+        $field = $identmap->{$trieref->{'name'}};
+        my $num = $concat_num->{$field};
+        my $dup = $process_dup->{$field};
+        output_ifdef($ifdefs->{$field});
+        printf "%sif (ossl_likely($strcmp(\"$suf\", s + $n) == 0", $indent0;
         if (not $case_sensitive) {
             $suf =~ tr/_/-/;
             print " || $strcmp(\"$suf\", s + $n) == 0"
                 if ($suf ne $trieref->{'suffix'});
         }
-        printf ")\n%sreturn PIDX_%s;\n", $indent1, $trieref->{'name'};
-        #printf "%sbreak;\n", $indent0;
+        print ")) {\n";
+        printf "%s/* %s */\n", $indent1, $trieref->{'name'};
+        trie_matched($with_count, $field, $num, $dup, $indent1, $indent2);
+        printf "%s}\n", $indent0;
+
+        # If this is at the top level and it's conditional, we have to
+        # insert an empty statement in an else branch to avoid badness.
+        # This isn't a problem at any other level since those are always
+        # followed by a break statement.
+        output_else($ifdefs->{$field}, $indent0 . ";\n") if ($n == 0);
+        output_endifdef($ifdefs->{$field});
         return;
     }

     printf "%sswitch(s\[%d\]) {\n", $indent0, $n;
     printf "%sdefault:\n", $indent0;
     for my $l (sort keys %$trieref) {
+        $need_break = 0;
         if ($l eq 'val') {
+            $field = $identmap->{$trieref->{'val'}};
+            my $num = $concat_num->{$field};
+            my $dup = $process_dup->{$field};
             printf "%sbreak;\n", $indent1;
             printf "%scase '\\0':\n", $indent0;
-            printf "%sreturn PIDX_%s;\n", $indent1, $trieref->{'val'};
+            output_ifdef($ifdefs->{$field});
+            trie_matched($with_count, $field, $num, $dup, $indent1, $indent2);
+            output_endifdef($ifdefs->{$field});
         } else {
             printf "%sbreak;\n", $indent1;
             printf "%scase '%s':", $indent0, $l;
@@ -745,12 +803,50 @@ sub generate_code_from_trie {
                 printf "   case '%s':", uc $l if ($l =~ /[a-z]/);
             }
             print "\n";
-            generate_code_from_trie($n + 1, $trieref->{$l});
+            generate_decoder_from_trie($with_count, $n + 1, $trieref->{$l}, $identmap, $concat_num, $process_dup, $ifdefs);
         }
     }
+    if ($need_break) {
+        printf "%sbreak;\n", $indent1;
+    }
     printf "%s}\n", $indent0;
-    print "    return -1;\n}\n" if $n == 0;
-    return "";
+    return;
+}
+
+sub generate_trie {
+    my @keys = @_;
+    my %trie;
+    my $nodes = 0;
+    my $chars = 0;
+
+    foreach my $name (sort @keys) {
+        my $val = $params{$name};
+        die("Unknown parameter name '$name'\n") if !defined $val;
+        while (substr($val, 0, 1) eq '*') {
+            $val = $params{substr($val, 1)};
+            die("Unknown referenced parameter from '$name'\n")
+                if !defined $val;
+        }
+        my $cursor = \%trie;
+
+        $chars += length($val);
+        for my $i (0 .. length($val) - 1) {
+            my $c = substr($val, $i, 1);
+
+            if (not $case_sensitive) {
+                $c = '_' if $c eq '-';
+                $c = lc $c;
+            }
+
+            if (not defined $$cursor{$c}) {
+                $cursor->{$c} = {};
+                $nodes++;
+            }
+            $cursor = $cursor->{$c};
+        }
+        $cursor->{'val'} = $name;
+    }
+    return %trie;
 }

 # Find long endings and cache what they resolve to
@@ -779,13 +875,136 @@ sub locate_long_endings {
     return 0, '';
 }

-sub produce_decoder {
-    my %t = generate_trie();
-    my $s;
+sub output_param_decoder {
+    my ($with_count, $decoder_name_base, @params) = @_;
+    my @keys = ();
+    my %prms = ();
+    my %concat_num = ();
+    my %process_dup = ();
+    my %ifdefs = ();
+
+    if (!$headers_included) {
+        $headers_included = 1;
+        print "/* Machine generated by util/perl/OpenSSL/paramnames.pm */\n";
+        # IWYU
+        print "#include <string.h>\n";
+        print "#include <openssl/params.h>\n";
+        print "#include <openssl/e_os2.h>\n";
+        print "#include \"internal/common.h\"\n";
+        print "#include \"prov/proverr.h\"\n";
+        print "\n";
+    }
+    print "/* Machine generated */\n";
+    # Output gettable param array
+    printf "#ifndef %s_list\n", $decoder_name_base;
+    printf "static ossl_unused const OSSL_PARAM %s_list[] = {\n", $decoder_name_base;
+    for (my $i = 0; $i <= $#params; $i++) {
+        my $pname = $params[$i][0];
+        my $pident = $params[$i][1];
+        my $ptype = $params[$i][2];
+        my $pnum = $params[$i][3];
+
+        $prms{$pname} = $pident;
+
+        if ($pident eq $invalid_param) {
+            # Skip error cases in parameter list
+            next;
+        } elsif ($pident eq $default_indicator) {
+            # These are only relevant for the FIPS provider
+            $ifdefs{$pident} = ' defined(FIPS_MODULE)';
+        }
+        if (defined $pnum) {
+            if ($pnum eq 'hidden') {
+                next;
+            } elsif ($pnum eq 'fips') {
+                # The `#if' is added on output
+                $ifdefs{$pident} = ' defined(FIPS_MODULE)';
+            } elsif ($pnum eq '!fips') {
+                $ifdefs{$pident} = ' !defined(FIPS_MODULE)';
+            } elsif (substr($pnum, 0, 3) eq '#if') {
+                # Trim the `#if' from the front
+                $ifdefs{$pident} = substr($pnum, 3);
+            } elsif ($pnum =~ '^duplicate: *(first)') {
+                # This provides a provision for other duplicate resolution methods
+                # even though they aren't implemented yet
+                $process_dup{$pident} = $1;
+            } elsif (not defined $concat_num{$pident}) {
+                $concat_num{$pident} = $pnum;
+            }
+        }
+        output_ifdef($ifdefs{$pident});
+        print "    OSSL_PARAM_$ptype($pname, NULL";
+        print ", 0" if $ptype eq "octet_string" || $ptype eq "octet_ptr"
+                       || $ptype eq "utf8_string" || $ptype eq "utf8_ptr"
+                       || $ptype eq "BN";
+        printf "),\n";
+        output_endifdef($ifdefs{$pident});
+    }
+    print "    OSSL_PARAM_END\n};\n#endif\n\n";
+
+    # Output param pointer structure
+    printf "#ifndef %s_st\n", $decoder_name_base;
+    printf "struct %s_st {\n", $decoder_name_base;
+    my %done_prms = ();
+    my $have_struct_field = 0;
+    foreach my $pident (sort values %prms) {
+        if ($pident eq $invalid_param || $pident eq $default_indicator) {
+            # Skip error cases and default indicators in structure
+            next;
+        }
+        if (not defined $done_prms{$pident}) {
+            $done_prms{$pident} = 1;
+            $have_struct_field = 1;
+            output_ifdef($ifdefs{$pident});
+            if (defined($concat_num{$pident})) {
+                printf "    OSSL_PARAM *%s[%s];\n", $pident, $concat_num{$pident};
+                printf "    int num_%s;\n", $pident;
+            } else {
+                printf "    OSSL_PARAM *%s;\n", $pident;
+            }
+
+            # If this is the only field and it's conditional, we have to
+            # insert a dummy field to avoid an empty struct
+            output_else($ifdefs{$pident}, "    int dummy; /* unused */\n")
+                if (keys(%prms) == 1);
+            output_endifdef($ifdefs{$pident});
+        }
+    }
+    print "    int dummy; /* unused */\n" unless $have_struct_field;
+    print "};\n#endif\n\n";

+    # Output param decoder
+    my %t = generate_trie(keys(%prms));
     locate_long_endings(\%t);

-    open local *STDOUT, '>', \$s;
-    generate_code_from_trie(0, \%t);
+    printf "#ifndef %s_decoder\n", $decoder_name_base;
+    printf "static ossl_unused int %s_decoder\n", $decoder_name_base;
+    printf "    (const OSSL_PARAM *p, struct %s_st *r", $decoder_name_base;
+    printf "%s)\n", ($with_count ? ", int *count" : "");
+    print "{\n";
+    print "    const char *s;\n\n";
+    print "    *count = 0;\n" if $with_count;
+    print "    memset(r, 0, sizeof(*r));\n";
+    print "    if (p != NULL)\n";
+    print "        for (; (s = p->key) != NULL; p++)\n";
+    generate_decoder_from_trie($with_count, 0, \%t, \%prms, \%concat_num, \%process_dup, \%ifdefs);
+    print "    return 1;\n";
+    print "}\n#endif\n";
+    print "/* End of machine generated */";
+}
+
+sub produce_param_decoder {
+    my $s;
+
+    open(local *STDOUT, '>', \$s);
+    output_param_decoder(0, @_);
+    return $s;
+}
+
+sub produce_param_decoder_with_count {
+    my $s;
+
+    open(local *STDOUT, '>', \$s);
+    output_param_decoder(1, @_);
     return $s;
 }
diff --git a/deps/openssl/openssl/util/perl/OpenSSL/stackhash.pm b/deps/openssl/openssl/util/perl/OpenSSL/stackhash.pm
index 7c2459b8a40..b3446f77478 100644
--- a/deps/openssl/openssl/util/perl/OpenSSL/stackhash.pm
+++ b/deps/openssl/openssl/util/perl/OpenSSL/stackhash.pm
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -28,9 +28,30 @@ sub generate_stack_macros_int {
 SKM_DEFINE_STACK_OF_INTERNAL(${nametype}, ${realtype}, ${plaintype})
 #define sk_${nametype}_num(sk) OPENSSL_sk_num(ossl_check_const_${nametype}_sk_type(sk))
 #define sk_${nametype}_value(sk, idx) ((${realtype} *)OPENSSL_sk_value(ossl_check_const_${nametype}_sk_type(sk), (idx)))
-#define sk_${nametype}_new(cmp) ((STACK_OF(${nametype}) *)OPENSSL_sk_new(ossl_check_${nametype}_compfunc_type(cmp)))
-#define sk_${nametype}_new_null() ((STACK_OF(${nametype}) *)OPENSSL_sk_new_null())
-#define sk_${nametype}_new_reserve(cmp, n) ((STACK_OF(${nametype}) *)OPENSSL_sk_new_reserve(ossl_check_${nametype}_compfunc_type(cmp), (n)))
+#define sk_${nametype}_new(cmp) \\
+    ((STACK_OF(${nametype}) *)OPENSSL_sk_set_thunks( \\
+        OPENSSL_sk_set_copy_thunks( \\
+            OPENSSL_sk_set_cmp_thunks( \\
+                OPENSSL_sk_new(ossl_check_${nametype}_compfunc_type(cmp)), \\
+                sk_${nametype}_cmpfunc_thunk), \\
+            sk_${nametype}_copyfunc_thunk), \\
+        sk_${nametype}_freefunc_thunk))
+#define sk_${nametype}_new_null() \\
+    ((STACK_OF(${nametype}) *)OPENSSL_sk_set_thunks( \\
+        OPENSSL_sk_set_copy_thunks( \\
+            OPENSSL_sk_set_cmp_thunks( \\
+                OPENSSL_sk_new_null(), \\
+                sk_${nametype}_cmpfunc_thunk), \\
+            sk_${nametype}_copyfunc_thunk), \\
+        sk_${nametype}_freefunc_thunk))
+#define sk_${nametype}_new_reserve(cmp, n) \\
+    ((STACK_OF(${nametype}) *)OPENSSL_sk_set_thunks( \\
+        OPENSSL_sk_set_copy_thunks( \\
+            OPENSSL_sk_set_cmp_thunks( \\
+                OPENSSL_sk_new_reserve(ossl_check_${nametype}_compfunc_type(cmp), (n)), \\
+                sk_${nametype}_cmpfunc_thunk), \\
+            sk_${nametype}_copyfunc_thunk), \\
+        sk_${nametype}_freefunc_thunk))
 #define sk_${nametype}_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_${nametype}_sk_type(sk), (n))
 #define sk_${nametype}_free(sk) OPENSSL_sk_free(ossl_check_${nametype}_sk_type(sk))
 #define sk_${nametype}_zero(sk) OPENSSL_sk_zero(ossl_check_${nametype}_sk_type(sk))
@@ -40,7 +61,7 @@ SKM_DEFINE_STACK_OF_INTERNAL(${nametype}, ${realtype}, ${plaintype})
 #define sk_${nametype}_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_${nametype}_sk_type(sk), ossl_check_${nametype}_type(ptr))
 #define sk_${nametype}_pop(sk) ((${realtype} *)OPENSSL_sk_pop(ossl_check_${nametype}_sk_type(sk)))
 #define sk_${nametype}_shift(sk) ((${realtype} *)OPENSSL_sk_shift(ossl_check_${nametype}_sk_type(sk)))
-#define sk_${nametype}_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_${nametype}_sk_type(sk),ossl_check_${nametype}_freefunc_type(freefunc))
+#define sk_${nametype}_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_${nametype}_sk_type(sk), ossl_check_${nametype}_freefunc_type(freefunc))
 #define sk_${nametype}_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_${nametype}_sk_type(sk), ossl_check_${nametype}_type(ptr), (idx))
 #define sk_${nametype}_set(sk, idx, ptr) ((${realtype} *)OPENSSL_sk_set(ossl_check_${nametype}_sk_type(sk), (idx), ossl_check_${nametype}_type(ptr)))
 #define sk_${nametype}_find(sk, ptr) OPENSSL_sk_find(ossl_check_${nametype}_sk_type(sk), ossl_check_${nametype}_type(ptr))
@@ -48,8 +69,25 @@ SKM_DEFINE_STACK_OF_INTERNAL(${nametype}, ${realtype}, ${plaintype})
 #define sk_${nametype}_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_${nametype}_sk_type(sk), ossl_check_${nametype}_type(ptr), pnum)
 #define sk_${nametype}_sort(sk) OPENSSL_sk_sort(ossl_check_${nametype}_sk_type(sk))
 #define sk_${nametype}_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_${nametype}_sk_type(sk))
-#define sk_${nametype}_dup(sk) ((STACK_OF(${nametype}) *)OPENSSL_sk_dup(ossl_check_const_${nametype}_sk_type(sk)))
-#define sk_${nametype}_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(${nametype}) *)OPENSSL_sk_deep_copy(ossl_check_const_${nametype}_sk_type(sk), ossl_check_${nametype}_copyfunc_type(copyfunc), ossl_check_${nametype}_freefunc_type(freefunc)))
+#define sk_${nametype}_dup(sk) \\
+    ((STACK_OF(${nametype}) *)OPENSSL_sk_set_thunks( \\
+        OPENSSL_sk_set_copy_thunks( \\
+            OPENSSL_sk_set_cmp_thunks( \\
+                OPENSSL_sk_dup(ossl_check_const_${nametype}_sk_type(sk)), \\
+                sk_${nametype}_cmpfunc_thunk), \\
+            sk_${nametype}_copyfunc_thunk), \\
+        sk_${nametype}_freefunc_thunk))
+#define sk_${nametype}_deep_copy(sk, copyfunc, freefunc) \\
+    ((STACK_OF(${nametype}) *)OPENSSL_sk_set_thunks( \\
+        OPENSSL_sk_set_copy_thunks( \\
+            OPENSSL_sk_set_cmp_thunks( \\
+                OPENSSL_sk_deep_copy( \\
+                    ossl_check_const_${nametype}_sk_type(sk), \\
+                    ossl_check_${nametype}_copyfunc_type(copyfunc), \\
+                    ossl_check_${nametype}_freefunc_type(freefunc)), \\
+                sk_${nametype}_cmpfunc_thunk), \\
+            sk_${nametype}_copyfunc_thunk), \\
+        sk_${nametype}_freefunc_thunk))
 #define sk_${nametype}_set_cmp_func(sk, cmp) ((sk_${nametype}_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_${nametype}_sk_type(sk), ossl_check_${nametype}_compfunc_type(cmp)))
 END_MACROS

diff --git a/deps/openssl/openssl/util/perl/TLSProxy/Certificate.pm b/deps/openssl/openssl/util/perl/TLSProxy/Certificate.pm
index 43771697476..356674b8780 100644
--- a/deps/openssl/openssl/util/perl/TLSProxy/Certificate.pm
+++ b/deps/openssl/openssl/util/perl/TLSProxy/Certificate.pm
@@ -1,4 +1,4 @@
-# Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -12,13 +12,21 @@ package TLSProxy::Certificate;
 use vars '@ISA';
 push @ISA, 'TLSProxy::Message';

+use constant {
+    TLSEXT_cert_type_x509 => 0,
+    TLSEXT_cert_type_rpk  => 2,
+};
+
+my $client_cert_type = TLSEXT_cert_type_x509;
+my $server_cert_type = TLSEXT_cert_type_x509;
+
 sub new
 {
     my $class = shift;
     my ($isdtls,
         $server,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -28,9 +36,9 @@ sub new
     my $self = $class->SUPER::new(
         $isdtls,
         $server,
-        TLSProxy::Message::MT_CERTIFICATE,
+        TLSProxy::Message::MT_CERTIFICATE(),
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -40,6 +48,7 @@ sub new
     $self->{first_certificate} = "";
     $self->{extension_data} = "";
     $self->{remaining_certdata} = "";
+    $self->{rpk} = "";

     return $self;
 }
@@ -48,6 +57,9 @@ sub parse
 {
     my $self = shift;

+    my $type = $self->server() ?
+        $self->server_type() : $self->client_type();
+
     if (TLSProxy::Proxy->is_tls13()) {
         my $context_len = unpack('C', $self->data);
         my $context = substr($self->data, 1, $context_len);
@@ -97,13 +109,26 @@ sub parse
         $remdata = substr($remdata, $extensions_len);

         $self->context($context);
-        $self->first_certificate($certdata);
         $self->extension_data(\%extensions);
-        $self->remaining_certdata($remdata);
+        if ($type == TLSEXT_cert_type_x509) {
+            $self->first_certificate($certdata);
+            $self->remaining_certdata($remdata);
+        } elsif ($type == TLSEXT_cert_type_rpk) {
+            die "Post %s RPK content\n", $self->server() ? "server" : "client"
+                if ($remdata ne "");
+            $self->rpk($certdata);
+        } else {
+            die "Unsupported %s certificate type: %d\n",
+                $self->server() ? "server" : "client", $type;
+        }

         print "    Context:".$context."\n";
         print "    Certificate List Len:".$certlistlen."\n";
-        print "    Certificate Len:".$certlen."\n";
+        if ($type == TLSEXT_cert_type_x509) {
+            print "    Certificate Len:".$certlen."\n";
+        } else {
+            print "    RPK Len:".$certlen."\n";
+        }
         print "    Extensions Len:".$extensions_len."\n";
     } else {
         my ($hicertlistlen, $certlistlen) = unpack('Cn', $self->data);
@@ -114,22 +139,33 @@ sub parse
         die "Invalid Certificate List length"
             if length($remdata) != $certlistlen;

-        my ($hicertlen, $certlen) = unpack('Cn', $remdata);
-        $certlen += ($hicertlen << 16);
+        if ($type == TLSEXT_cert_type_x509) {
+            # X.509 Chain
+            my ($hicertlen, $certlen) = unpack('Cn', $remdata);
+            $certlen += ($hicertlen << 16);

-        die "Certificate too long" if ($certlen + 3) > $certlistlen;
+            die "Certificate too long" if ($certlen + 3) > $certlistlen;

-        $remdata = substr($remdata, 3);
+            $remdata = substr($remdata, 3);

-        my $certdata = substr($remdata, 0, $certlen);
+            my $certdata = substr($remdata, 0, $certlen);

-        $remdata = substr($remdata, $certlen);
+            $remdata = substr($remdata, $certlen);

-        $self->first_certificate($certdata);
-        $self->remaining_certdata($remdata);
+            $self->first_certificate($certdata);
+            $self->remaining_certdata($remdata);

-        print "    Certificate List Len:".$certlistlen."\n";
-        print "    Certificate Len:".$certlen."\n";
+            print "    Certificate List Len:".$certlistlen."\n";
+            print "    Certificate Len:".$certlen."\n";
+        } elsif ($type == TLSEXT_cert_type_rpk) {
+            # RFC7250 RPK
+            $self->rpk($remdata);
+
+            print "    RPK LEN:".$certlistlen."\n";
+        } else {
+            die "Unsupported %s certificate type: %d\n",
+                $self->server() ? "server" : "client", $type;
+        }
     }
 }

@@ -163,16 +199,28 @@ sub set_message_contents
         $data .= $self->remaining_certdata();
         $self->data($data);
     } else {
-        my $certlen = length($self->first_certificate);
-        my $certlistlen = $certlen + length($self->remaining_certdata);
-        my $hi = $certlistlen >> 16;
-        $certlistlen = $certlistlen & 0xffff;
-        $data .= pack('Cn', $hi, $certlistlen);
-        $hi = $certlen >> 16;
-        $certlen = $certlen & 0xffff;
-        $data .= pack('Cn', $hi, $certlen);
-        $data .= $self->remaining_certdata();
-        $self->data($data);
+        my $type = $self->server() ? $self->server_type() : $self->client_type();
+        if ($type == TLSEXT_cert_type_x509) {
+            # X.509 chain
+            my $certlen = length($self->first_certificate);
+            my $certlistlen = $certlen + length($self->remaining_certdata);
+            my $hi = $certlistlen >> 16;
+            $certlistlen = $certlistlen & 0xffff;
+            $data .= pack('Cn', $hi, $certlistlen);
+            $hi = $certlen >> 16;
+            $certlen = $certlen & 0xffff;
+            $data .= pack('Cn', $hi, $certlen);
+            $data .= $self->remaining_certdata();
+            $self->data($data);
+        } elsif ($type == TLSEXT_cert_type_rpk) {
+            # RFC7250 RPK
+            my $len = length($self->rpk);
+            my $hi = $len >> 16;
+            $len = $len & 0xffff;
+            $data .= pack('Cn', $hi, $len);
+            $data .= $self->rpk();
+            $self->data($data);
+        }
     }
 }

@@ -219,4 +267,23 @@ sub delete_extension
     my ($self, $ext_type) = @_;
     delete $self->{extension_data}{$ext_type};
 }
+
+sub client_type {
+    shift;
+    $client_cert_type = shift if (@_);
+    return $client_cert_type;
+}
+
+sub server_type {
+    shift;
+    $server_cert_type = shift if (@_);
+    return $server_cert_type;
+}
+
+sub rpk {
+    my $self = shift;
+    $self->{rpk} = shift if (@_);
+    return $self->{rpk};
+}
+
 1;
diff --git a/deps/openssl/openssl/util/perl/TLSProxy/CertificateRequest.pm b/deps/openssl/openssl/util/perl/TLSProxy/CertificateRequest.pm
index 67943490bd1..87d360c03cf 100644
--- a/deps/openssl/openssl/util/perl/TLSProxy/CertificateRequest.pm
+++ b/deps/openssl/openssl/util/perl/TLSProxy/CertificateRequest.pm
@@ -1,4 +1,4 @@
-# Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -18,7 +18,7 @@ sub new
     my ($isdtls,
         $server,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -28,9 +28,9 @@ sub new
     my $self = $class->SUPER::new(
         $isdtls,
         $server,
-        TLSProxy::Message::MT_CERTIFICATE_REQUEST,
+        TLSProxy::Message::MT_CERTIFICATE_REQUEST(),
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
diff --git a/deps/openssl/openssl/util/perl/TLSProxy/CertificateVerify.pm b/deps/openssl/openssl/util/perl/TLSProxy/CertificateVerify.pm
index 637298525da..5a9ca86098b 100644
--- a/deps/openssl/openssl/util/perl/TLSProxy/CertificateVerify.pm
+++ b/deps/openssl/openssl/util/perl/TLSProxy/CertificateVerify.pm
@@ -1,4 +1,4 @@
-# Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -18,7 +18,7 @@ sub new
     my ($isdtls,
         $server,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -28,9 +28,9 @@ sub new
     my $self = $class->SUPER::new(
         $isdtls,
         $server,
-        TLSProxy::Message::MT_CERTIFICATE_VERIFY,
+        TLSProxy::Message::MT_CERTIFICATE_VERIFY(),
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -52,8 +52,8 @@ sub parse
     my $record = ${$self->records}[0];

     if (TLSProxy::Proxy->is_tls13()
-            || $record->version() == TLSProxy::Record::VERS_TLS_1_2
-            || $record->version() == TLSProxy::Record::VERS_DTLS_1_2) {
+            || $record->version() == TLSProxy::Record::VERS_TLS_1_2()
+            || $record->version() == TLSProxy::Record::VERS_DTLS_1_2()) {
         $sigalg = unpack('n', $remdata);
         $remdata = substr($remdata, 2);
     }
diff --git a/deps/openssl/openssl/util/perl/TLSProxy/ClientHello.pm b/deps/openssl/openssl/util/perl/TLSProxy/ClientHello.pm
index c24065f2b91..3d1f3652ed3 100644
--- a/deps/openssl/openssl/util/perl/TLSProxy/ClientHello.pm
+++ b/deps/openssl/openssl/util/perl/TLSProxy/ClientHello.pm
@@ -1,4 +1,4 @@
-# Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -20,7 +20,7 @@ sub new
     my ($isdtls,
         $server,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -32,7 +32,7 @@ sub new
         $server,
         TLSProxy::Message::MT_CLIENT_HELLO,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
diff --git a/deps/openssl/openssl/util/perl/TLSProxy/EncryptedExtensions.pm b/deps/openssl/openssl/util/perl/TLSProxy/EncryptedExtensions.pm
index 8b1e76afd5d..ac6f42c44d9 100644
--- a/deps/openssl/openssl/util/perl/TLSProxy/EncryptedExtensions.pm
+++ b/deps/openssl/openssl/util/perl/TLSProxy/EncryptedExtensions.pm
@@ -1,4 +1,4 @@
-# Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -18,7 +18,7 @@ sub new
     my ($isdtls,
         $server,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -28,9 +28,9 @@ sub new
     my $self = $class->SUPER::new(
         $isdtls,
         $server,
-        TLSProxy::Message::MT_ENCRYPTED_EXTENSIONS,
+        TLSProxy::Message::MT_ENCRYPTED_EXTENSIONS(),
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -103,6 +103,17 @@ sub extension_data
     if (@_) {
         $self->{extension_data} = shift;
     }
+    my $exts = $self->{extension_data};
+    if (defined($exts) && defined(my $data = $exts->{TLSProxy::Message::EXT_CLIENT_CERT_TYPE})) {
+        die "Invalid client certificate type extension\n"
+            if length($data) != 1;
+        TLSProxy::Certificate->client_type(unpack("C", $data));
+    }
+    if (defined($exts) && defined(my $data = $exts->{TLSProxy::Message::EXT_SERVER_CERT_TYPE})) {
+        die "Invalid server certificate type extension\n"
+            if length($data) != 1;
+        TLSProxy::Certificate->server_type(unpack("C", $data));
+    }
     return $self->{extension_data};
 }
 sub set_extension
diff --git a/deps/openssl/openssl/util/perl/TLSProxy/HelloVerifyRequest.pm b/deps/openssl/openssl/util/perl/TLSProxy/HelloVerifyRequest.pm
index 6fa7f1ac617..41cabd8441d 100644
--- a/deps/openssl/openssl/util/perl/TLSProxy/HelloVerifyRequest.pm
+++ b/deps/openssl/openssl/util/perl/TLSProxy/HelloVerifyRequest.pm
@@ -1,4 +1,4 @@
-# Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -21,7 +21,7 @@ sub new
     my ($isdtls,
         $server,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -33,7 +33,7 @@ sub new
         $server,
         TLSProxy::Message::MT_HELLO_VERIFY_REQUEST,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
diff --git a/deps/openssl/openssl/util/perl/TLSProxy/Message.pm b/deps/openssl/openssl/util/perl/TLSProxy/Message.pm
index 4b7cae08caf..45c4d9872b7 100644
--- a/deps/openssl/openssl/util/perl/TLSProxy/Message.pm
+++ b/deps/openssl/openssl/util/perl/TLSProxy/Message.pm
@@ -9,6 +9,7 @@ use strict;

 package TLSProxy::Message;

+use TLSProxy::RecordNumber;
 use TLSProxy::Alert;

 use constant DTLS_MESSAGE_HEADER_LENGTH => 12;
@@ -21,6 +22,7 @@ use constant {
     MT_SERVER_HELLO => 2,
     MT_HELLO_VERIFY_REQUEST => 3,
     MT_NEW_SESSION_TICKET => 4,
+    MT_END_OF_EARLY_DATA => 5,
     MT_ENCRYPTED_EXTENSIONS => 8,
     MT_CERTIFICATE => 11,
     MT_SERVER_KEY_EXCHANGE => 12,
@@ -29,7 +31,10 @@ use constant {
     MT_CERTIFICATE_VERIFY => 15,
     MT_CLIENT_KEY_EXCHANGE => 16,
     MT_FINISHED => 20,
+    MT_CERTIFICATE_URL => 21,
     MT_CERTIFICATE_STATUS => 22,
+    MT_SUPPLEMENTAL_DATA => 23,
+    MT_KEY_UPDATE => 24,
     MT_COMPRESSED_CERTIFICATE => 25,
     MT_NEXT_PROTO => 67
 };
@@ -48,9 +53,12 @@ use constant {
 	AL_DESC_BAD_CERTIFICATE => 42,
     AL_DESC_ILLEGAL_PARAMETER => 47,
     AL_DESC_DECODE_ERROR => 50,
+    AL_DESC_DECRYPT_ERROR => 51,
     AL_DESC_PROTOCOL_VERSION => 70,
+    AL_DESC_INAPPROPRIATE_FALLBACK => 86,
     AL_DESC_NO_RENEGOTIATION => 100,
-    AL_DESC_MISSING_EXTENSION => 109
+    AL_DESC_MISSING_EXTENSION => 109,
+    AL_DESC_UNSUPPORTED_EXTENSION => 110
 };

 my %message_type = (
@@ -100,6 +108,8 @@ use constant {
     EXT_RENEGOTIATE => 65281,
     EXT_NPN => 13172,
     EXT_CRYPTOPRO_BUG_EXTENSION => 0xfde8,
+    EXT_ECH => 0xfe0d,
+    EXT_ECH_OUTER => 0xfd00,
     EXT_UNKNOWN => 0xfffe,
     #Unknown extension that should appear last
     EXT_FORCE_LAST => 0xffff
@@ -148,30 +158,41 @@ use constant {
     SERVER => 1
 };

-my $payload = "";
-my $messlen = -1;
-my $mt;
-my $startoffset = -1;
+# Handshake message reassembly is tracked separately per sender
+# (CLIENT/SERVER). The two peers can each have their own in-flight,
+# independently fragmented message at the same time, so a fragment that is
+# still incomplete for one sender must never be touched by traffic that
+# arrives from the other sender.
+my @payload = ("", "");
+my @messlen = (-1, -1);
+my @messseq = (-1, -1);
+my @messfraglen = (-1, -1);
+my @messfragoffs = (-1, -1);
+my @mt = (undef, undef);
+my @startoffset = (-1, -1);
 my $server = 0;
 my $success = 0;
 my $end = 0;
-my @message_rec_list = ();
-my @message_frag_lens = ();
+my @message_rec_list = ([], []);
+my @message_frag_lens = ([], []);
 my $ciphersuite = 0;
 my $successondata = 0;
 my $alert;

 sub clear
 {
-    $payload = "";
-    $messlen = -1;
-    $startoffset = -1;
+    @payload = ("", "");
+    @messlen = (-1, -1);
+    @messseq = (-1, -1);
+    @messfraglen = (-1, -1);
+    @messfragoffs = (-1, -1);
+    @startoffset = (-1, -1);
     $server = 0;
     $success = 0;
     $end = 0;
     $successondata = 0;
-    @message_rec_list = ();
-    @message_frag_lens = ();
+    @message_rec_list = ([], []);
+    @message_frag_lens = ([], []);
     $alert = undef;
 }

@@ -179,21 +200,18 @@ sub clear
 sub get_messages
 {
     my $class = shift;
-    my $serverin = shift;
     my $record = shift;
-    my $isdtls = shift;
+    my $serverin = $record->serverissender;
+    my $isdtls = $record->isdtls;
     my @messages = ();
     my $message;

-    @message_frag_lens = ();
+    $message_frag_lens[$serverin] = [];

-    if ($serverin != $server && length($payload) != 0) {
-        die "Changed peer, but we still have fragment data\n";
-    }
     $server = $serverin;

-    if ($record->content_type == TLSProxy::Record::RT_CCS) {
-        if ($payload ne "") {
+    if ($record->content_type == TLSProxy::Record::RT_CCS()) {
+        if ($payload[$server] ne "") {
             #We can't handle this yet
             die "CCS received before message data complete\n";
         }
@@ -204,44 +222,61 @@ sub get_messages
                 TLSProxy::Record->client_encrypting(1);
             }
         }
-    } elsif ($record->content_type == TLSProxy::Record::RT_HANDSHAKE) {
+    } elsif ($record->content_type == TLSProxy::Record::RT_HANDSHAKE()) {
         if ($record->len == 0 || $record->len_real == 0) {
             print "  Message truncated\n";
         } else {
             my $recoffset = 0;

-            if (length $payload > 0) {
+            if (length $payload[$server] > 0) {
                 #We are continuing processing a message started in a previous
-                #record. Add this record to the list associated with this
-                #message
-                push @message_rec_list, $record;
+                #record from this same sender. Add this record to the list
+                #associated with this message
+                push @{$message_rec_list[$server]}, $record;

-                if ($messlen <= length($payload)) {
+                if ($messlen[$server] <= length($payload[$server])) {
                     #Shouldn't happen
-                    die "Internal error: invalid messlen: ".$messlen
-                        ." payload length:".length($payload)."\n";
+                    die "Internal error: invalid messlen: ".$messlen[$server]
+                        ." payload length:".length($payload[$server])."\n";
                 }
-                if (length($payload) + $record->decrypt_len >= $messlen) {
+                if (length($payload[$server]) + $record->decrypt_len >= $messlen[$server]) {
                     #We can complete the message with this record
-                    $recoffset = $messlen - length($payload);
-                    $payload .= substr($record->decrypt_data, 0, $recoffset);
-                    push @message_frag_lens, $recoffset;
+                    $recoffset = $messlen[$server] - length($payload[$server]);
+
                     if ($isdtls) {
-                        # We must set $msgseq, $msgfrag, $msgfragoffs
-                        die "Internal error: cannot handle partial dtls messages\n"
+                        # For fragmented messages to be parsed correctly we need to
+                        # skip the handshake header
+                        $payload[$server] .= substr($record->decrypt_data, DTLS_MESSAGE_HEADER_LENGTH, $recoffset);
+                        push @{$message_frag_lens[$server]}, $recoffset;
+
+                        # We skipped the handshake header above and we need to
+                        # update recoffset accordingly
+                        $recoffset += DTLS_MESSAGE_HEADER_LENGTH;
+                    } else {
+                        $payload[$server] .= substr($record->decrypt_data, 0, $recoffset);
+                        push @{$message_frag_lens[$server]}, $recoffset;
                     }
-                    $message = create_message($server, $mt,
-                        #$msgseq, $msgfrag, $msgfragoffs,
-                        0, 0, 0,
-                        $payload, $startoffset, $isdtls);
+
+
+                    $message = create_message($server, $mt[$server],
+                        $messseq[$server], $messfraglen[$server], $messfragoffs[$server],
+                        $payload[$server], $startoffset[$server], $isdtls);
                     push @messages, $message;

-                    $payload = "";
+                    $payload[$server] = "";
                 } else {
                     #This is just part of the total message
-                    $payload .= $record->decrypt_data;
-                    $recoffset = $record->decrypt_len;
-                    push @message_frag_lens, $record->decrypt_len;
+                    if ($isdtls) {
+                        # DTLS 1.3 has a unified header before the handshake header.
+                        # We have processed the unified header and need to skip the
+                        # handshake header.
+                        $payload[$server] .= substr($record->decrypt_data, DTLS_MESSAGE_HEADER_LENGTH, length($record->decrypt_data) - DTLS_MESSAGE_HEADER_LENGTH);
+                        $recoffset = $record->decrypt_len;
+                    } else {
+                        $payload[$server] .= $record->decrypt_data;
+                        $recoffset = $record->decrypt_len;
+                    }
+                    push @{$message_frag_lens[$server]}, $record->decrypt_len;
                 }
                 print "  Partial message data read: ".$recoffset." bytes\n";
             }
@@ -254,57 +289,58 @@ sub get_messages
                     #Whilst technically probably valid we can't cope with this
                     die "End of record in the middle of a message header\n";
                 }
-                @message_rec_list = ($record);
+                $message_rec_list[$server] = [$record];
                 my $lenhi;
                 my $lenlo;
-                my $msgseq;
-                my $msgfrag;
-                my $msgfragoffs;
                 if ($isdtls) {
-                    my $msgfraghi;
-                    my $msgfraglo;
+                    my $msgfraglenhi;
+                    my $msgfraglenlo;
                     my $msgfragoffshi;
                     my $msgfragoffslo;
-                    ($mt, $lenhi, $lenlo, $msgseq, $msgfraghi, $msgfraglo, $msgfragoffshi, $msgfragoffslo) =
+                    ($mt[$server], $lenhi, $lenlo, $messseq[$server], $msgfragoffshi, $msgfragoffslo, $msgfraglenhi, $msgfraglenlo) =
                         unpack('CnCnnCnC', substr($record->decrypt_data, $recoffset));
-                    $msgfrag = ($msgfraghi << 8) | $msgfraglo;
-                    $msgfragoffs = ($msgfragoffshi << 8) | $msgfragoffslo;
+                    $messfraglen[$server] = ($msgfraglenhi << 8) | $msgfraglenlo;
+                    $messfragoffs[$server] = ($msgfragoffshi << 8) | $msgfragoffslo;
                 } else {
-                    ($mt, $lenhi, $lenlo) =
+                    ($mt[$server], $lenhi, $lenlo) =
                         unpack('CnC', substr($record->decrypt_data, $recoffset));
                 }
-                $messlen = ($lenhi << 8) | $lenlo;
-                print "  Message type: $message_type{$mt}($mt)\n";
-                print "  Message Length: $messlen\n";
-                $startoffset = $recoffset;
+                $messlen[$server] = ($lenhi << 8) | $lenlo;
+                print "  Message type: $message_type{$mt[$server]}($mt[$server])\n";
+                print "  Message Length: $messlen[$server]\n";
+                if ($isdtls) {
+                    print "  Message fragment length: $messfraglen[$server]\n";
+                    print "  Message fragment offset: $messfragoffs[$server]\n";
+                }
+                $startoffset[$server] = $recoffset;
                 $recoffset += $msgheaderlen;
-                $payload = "";
+                $payload[$server] = "";

                 if ($recoffset <= $record->decrypt_len) {
                     #Some payload data is present in this record
-                    if ($record->decrypt_len - $recoffset >= $messlen) {
+                    if ($record->decrypt_len - $recoffset >= $messlen[$server]) {
                         #We can complete the message with this record
-                        $payload .= substr($record->decrypt_data, $recoffset,
-                                           $messlen);
-                        $recoffset += $messlen;
-                        push @message_frag_lens, $messlen;
-                        $message = create_message($server, $mt, $msgseq,
-                                                  $msgfrag, $msgfragoffs,
-                                                  $payload, $startoffset, $isdtls);
+                        $payload[$server] .= substr($record->decrypt_data, $recoffset,
+                                           $messlen[$server]);
+                        $recoffset += $messlen[$server];
+                        push @{$message_frag_lens[$server]}, $messlen[$server];
+                        $message = create_message($server, $mt[$server], $messseq[$server],
+                                                  $messfraglen[$server], $messfragoffs[$server],
+                                                  $payload[$server], $startoffset[$server], $isdtls);
                         push @messages, $message;

-                        $payload = "";
+                        $payload[$server] = "";
                     } else {
                         #This is just part of the total message
-                        $payload .= substr($record->decrypt_data, $recoffset,
+                        $payload[$server] .= substr($record->decrypt_data, $recoffset,
                                            $record->decrypt_len - $recoffset);
                         $recoffset = $record->decrypt_len;
-                        push @message_frag_lens, $recoffset;
+                        push @{$message_frag_lens[$server]}, $recoffset;
                     }
                 }
             }
         }
-    } elsif ($record->content_type == TLSProxy::Record::RT_APPLICATION_DATA) {
+    } elsif ($record->content_type == TLSProxy::Record::RT_APPLICATION_DATA()) {
         print "  [ENCRYPTED APPLICATION DATA]\n";
         print "  [".$record->decrypt_data."]\n";

@@ -312,7 +348,7 @@ sub get_messages
             $success = 1;
             $end = 1;
         }
-    } elsif ($record->content_type == TLSProxy::Record::RT_ALERT) {
+    } elsif ($record->content_type == TLSProxy::Record::RT_ALERT()) {
         my ($alertlev, $alertdesc) = unpack('CC', $record->decrypt_data);
         print "  [$alertlev, $alertdesc]\n";
         #A CloseNotify from the client indicates we have finished successfully
@@ -339,7 +375,7 @@ sub get_messages
 #construct it
 sub create_message
 {
-    my ($server, $mt, $msgseq, $msgfrag, $msgfragoffs, $data, $startoffset, $isdtls) = @_;
+    my ($server, $mt, $msgseq, $msgfraglen, $msgfragoffs, $data, $startoffset, $isdtls) = @_;
     my $message;

     if ($mt == MT_CLIENT_HELLO) {
@@ -347,12 +383,12 @@ sub create_message
             $isdtls,
             $server,
             $msgseq,
-            $msgfrag,
+            $msgfraglen,
             $msgfragoffs,
             $data,
-            [@message_rec_list],
+            [@{$message_rec_list[$server]}],
             $startoffset,
-            [@message_frag_lens]
+            [@{$message_frag_lens[$server]}]
         );
         $message->parse();
     } elsif ($mt == MT_SERVER_HELLO) {
@@ -360,12 +396,12 @@ sub create_message
             $isdtls,
             $server,
             $msgseq,
-            $msgfrag,
+            $msgfraglen,
             $msgfragoffs,
             $data,
-            [@message_rec_list],
+            [@{$message_rec_list[$server]}],
             $startoffset,
-            [@message_frag_lens]
+            [@{$message_frag_lens[$server]}]
         );
         $message->parse();
     } elsif ($mt == MT_HELLO_VERIFY_REQUEST) {
@@ -373,12 +409,12 @@ sub create_message
             $isdtls,
             $server,
             $msgseq,
-            $msgfrag,
+            $msgfraglen,
             $msgfragoffs,
             $data,
-            [@message_rec_list],
+            [@{$message_rec_list[$server]}],
             $startoffset,
-            [@message_frag_lens]
+            [@{$message_frag_lens[$server]}]
         );
         $message->parse();
     } elsif ($mt == MT_ENCRYPTED_EXTENSIONS) {
@@ -386,12 +422,12 @@ sub create_message
             $isdtls,
             $server,
             $msgseq,
-            $msgfrag,
+            $msgfraglen,
             $msgfragoffs,
             $data,
-            [@message_rec_list],
+            [@{$message_rec_list[$server]}],
             $startoffset,
-            [@message_frag_lens]
+            [@{$message_frag_lens[$server]}]
         );
         $message->parse();
     } elsif ($mt == MT_CERTIFICATE) {
@@ -399,12 +435,12 @@ sub create_message
             $isdtls,
             $server,
             $msgseq,
-            $msgfrag,
+            $msgfraglen,
             $msgfragoffs,
             $data,
-            [@message_rec_list],
+            [@{$message_rec_list[$server]}],
             $startoffset,
-            [@message_frag_lens]
+            [@{$message_frag_lens[$server]}]
         );
         $message->parse();
     } elsif ($mt == MT_CERTIFICATE_REQUEST) {
@@ -412,12 +448,12 @@ sub create_message
             $isdtls,
             $server,
             $msgseq,
-            $msgfrag,
+            $msgfraglen,
             $msgfragoffs,
             $data,
-            [@message_rec_list],
+            [@{$message_rec_list[$server]}],
             $startoffset,
-            [@message_frag_lens]
+            [@{$message_frag_lens[$server]}]
         );
         $message->parse();
     } elsif ($mt == MT_CERTIFICATE_VERIFY) {
@@ -425,12 +461,12 @@ sub create_message
             $isdtls,
             $server,
             $msgseq,
-            $msgfrag,
+            $msgfraglen,
             $msgfragoffs,
             $data,
-            [@message_rec_list],
+            [@{$message_rec_list[$server]}],
             $startoffset,
-            [@message_frag_lens]
+            [@{$message_frag_lens[$server]}]
         );
         $message->parse();
     } elsif ($mt == MT_SERVER_KEY_EXCHANGE) {
@@ -438,12 +474,12 @@ sub create_message
             $isdtls,
             $server,
             $msgseq,
-            $msgfrag,
+            $msgfraglen,
             $msgfragoffs,
             $data,
-            [@message_rec_list],
+            [@{$message_rec_list[$server]}],
             $startoffset,
-            [@message_frag_lens]
+            [@{$message_frag_lens[$server]}]
         );
         $message->parse();
     } elsif ($mt == MT_NEW_SESSION_TICKET) {
@@ -451,20 +487,20 @@ sub create_message
             $message = TLSProxy::NewSessionTicket->new_dtls(
                 $server,
                 $msgseq,
-                $msgfrag,
+                $msgfraglen,
                 $msgfragoffs,
                 $data,
-                [@message_rec_list],
+                [@{$message_rec_list[$server]}],
                 $startoffset,
-                [@message_frag_lens]
+                [@{$message_frag_lens[$server]}]
             );
         } else {
             $message = TLSProxy::NewSessionTicket->new(
                 $server,
                 $data,
-                [@message_rec_list],
+                [@{$message_rec_list[$server]}],
                 $startoffset,
-                [@message_frag_lens]
+                [@{$message_frag_lens[$server]}]
             );
         }
         $message->parse();
@@ -473,12 +509,12 @@ sub create_message
             $isdtls,
             $server,
             $msgseq,
-            $msgfrag,
+            $msgfraglen,
             $msgfragoffs,
             $data,
-            [@message_rec_list],
+            [@{$message_rec_list[$server]}],
             $startoffset,
-            [@message_frag_lens]
+            [@{$message_frag_lens[$server]}]
         );
         $message->parse();
     } else {
@@ -488,12 +524,12 @@ sub create_message
             $server,
             $mt,
             $msgseq,
-            $msgfrag,
+            $msgfraglen,
             $msgfragoffs,
             $data,
-            [@message_rec_list],
+            [@{$message_rec_list[$server]}],
             $startoffset,
-            [@message_frag_lens]
+            [@{$message_frag_lens[$server]}]
         );
     }

@@ -528,7 +564,7 @@ sub new
         $server,
         $mt,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -542,7 +578,7 @@ sub new
         records => $records,
         mt => $mt,
         msgseq => $msgseq,
-        msgfrag => $msgfrag,
+        msgfraglen => $msgfraglen,
         msgfragoffs => $msgfragoffs,
         startoffset => $startoffset,
         message_frag_lens => $message_frag_lens,
@@ -576,14 +612,21 @@ sub repack
     my $lenhi = length($self->data) >> 8;

     if ($self->{isdtls}) {
-        my $msgfraghi = $self->msgfrag >> 8;
-        my $msgfraglo = $self->msgfrag & 0xff;
+        my $msgfraglenhi = $self->msgfraglen >> 8;
+        my $msgfraglenlo = $self->msgfraglen & 0xff;
         my $msgfragoffshi = $self->msgfragoffs >> 8;
         my $msgfragoffslo = $self->msgfragoffs & 0xff;

+        if (length($self->data) != $self->msgfraglen) {
+            # TLSProxy does not support message fragmentation hence we can just
+            # overwrite the fragment lengths
+            $msgfraglenhi = $lenhi;
+            $msgfraglenlo = $lenlo;
+            print "DTLS Message Fragment Length overwritten with actual message size.\n"
+        }
         $msgdata = pack('CnCnnCnC', $self->mt, $lenhi, $lenlo, $self->msgseq,
-                                    $msgfraghi, $msgfraglo,
-                                    $msgfragoffshi, $msgfragoffslo).$self->data;
+                                    $msgfragoffshi, $msgfragoffslo,
+                                    $msgfraglenhi, $msgfraglenlo).$self->data;
     } else {
         $msgdata = pack('CnC', $self->mt, $lenhi, $lenlo).$self->data;
     }
@@ -619,7 +662,7 @@ sub repack
             if (TLSProxy::Proxy->is_tls13()) {
                 #Add content type (1 byte) and 16 tag bytes
                 $rec->data($rec->decrypt_data
-                    .pack("C", TLSProxy::Record::RT_HANDSHAKE).("\0"x16));
+                    .pack("C", TLSProxy::Record::RT_HANDSHAKE()).("\0"x16));
             } elsif ($rec->etm()) {
                 my $data = $rec->decrypt_data;
                 #Add padding
@@ -634,7 +677,8 @@ sub repack
                     $data .= pack("C", $macval);
                 }

-                if ($rec->version() >= TLSProxy::Record::VERS_TLS_1_1) {
+                if ((!$self->{isdtls} && $rec->version() >= TLSProxy::Record::VERS_TLS_1_1())
+                    || ($self->{isdtls} && $rec->version() <= TLSProxy::Record::VERS_DTLS_1())) {
                     #Explicit IV
                     $data = ("\0"x16).$data;
                 }
@@ -704,13 +748,13 @@ sub msgseq
     }
     return $self->{msgseq};
 }
-sub msgfrag
+sub msgfraglen
 {
     my $self = shift;
     if (@_) {
-        $self->{msgfrag} = shift;
+        $self->{msgfraglen} = shift;
     }
-    return $self->{msgfrag};
+    return $self->{msgfraglen};
 }
 sub msgfragoffs
 {
diff --git a/deps/openssl/openssl/util/perl/TLSProxy/NewSessionTicket.pm b/deps/openssl/openssl/util/perl/TLSProxy/NewSessionTicket.pm
index 26dcc17bb05..071c8695370 100644
--- a/deps/openssl/openssl/util/perl/TLSProxy/NewSessionTicket.pm
+++ b/deps/openssl/openssl/util/perl/TLSProxy/NewSessionTicket.pm
@@ -1,4 +1,4 @@
-# Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -18,7 +18,7 @@ sub new_dtls

     my ($server,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -29,7 +29,7 @@ sub new_dtls
         1,
         $server,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -66,7 +66,7 @@ sub init{
     my ($isdtls,
         $server,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -76,9 +76,9 @@ sub init{
     my $self = $class->SUPER::new(
         $isdtls,
         $server,
-        TLSProxy::Message::MT_NEW_SESSION_TICKET,
+        TLSProxy::Message::MT_NEW_SESSION_TICKET(),
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
diff --git a/deps/openssl/openssl/util/perl/TLSProxy/NextProto.pm b/deps/openssl/openssl/util/perl/TLSProxy/NextProto.pm
index 0825ea744f4..f37c5e253de 100644
--- a/deps/openssl/openssl/util/perl/TLSProxy/NextProto.pm
+++ b/deps/openssl/openssl/util/perl/TLSProxy/NextProto.pm
@@ -1,4 +1,4 @@
-# Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -28,7 +28,7 @@ sub new
     my $self = $class->SUPER::new(
         $isdtls,
         $server,
-        TLSProxy::Message::MT_NEXT_PROTO,
+        TLSProxy::Message::MT_NEXT_PROTO(),
         $msgseq,
         $msgfrag,
         $msgfragoffs,
diff --git a/deps/openssl/openssl/util/perl/TLSProxy/Proxy.pm b/deps/openssl/openssl/util/perl/TLSProxy/Proxy.pm
index 729b351b3f0..f1d9c2bf976 100644
--- a/deps/openssl/openssl/util/perl/TLSProxy/Proxy.pm
+++ b/deps/openssl/openssl/util/perl/TLSProxy/Proxy.pm
@@ -82,8 +82,9 @@ sub new {
     my ($filter,
         $execute,
         $cert,
-        $debug) = @_;
-    return init($class, $filter, $execute, $cert, $debug, 0);
+        $debug,
+        $use_IPv6) = @_;
+    return init($class, $filter, $execute, $cert, $debug, 0, $use_IPv6);
 }

 sub new_dtls {
@@ -91,89 +92,36 @@ sub new_dtls {
     my ($filter,
         $execute,
         $cert,
-        $debug) = @_;
-    return init($class, $filter, $execute, $cert, $debug, 1);
+        $debug,
+        $use_IPv6) = @_;
+    return init($class, $filter, $execute, $cert, $debug, 1, $use_IPv6);
 }

 sub init
 {
-    my $useSockInet = 0;
-    eval {
-        require IO::Socket::IP;
-        my $s = IO::Socket::IP->new(
-                LocalAddr => "::1",
-                LocalPort => 0,
-                Listen=>1,
-                );
-            $s or die "\n";
-            $s->close();
-    };
-    if ($@ eq "") {
-        require IO::Socket::IP;
-    } else {
-        $useSockInet = 1;
-    }
-
     my $class = shift;
     my ($filter,
         $execute,
         $cert,
         $debug,
-        $isdtls) = @_;
-
-    my $test_client_port;
-
-    # Sometimes, our random selection of client ports gets unlucky
-    # And we randomly select a port that's already in use.  This causes
-    # this test to fail, so lets harden ourselves against that by doing
-    # a test bind to the randomly selected port, and only continue once we
-    # find a port that's available.
-    my $test_client_addr = $have_IPv6 ? "[::1]" : "127.0.0.1";
-    my $found_port = 0;
-    for (my $i = 0; $i <= 10; $i++) {
-        $test_client_port = 49152 + int(rand(65535 - 49152));
-        my $test_sock;
-        if ($useINET6 == 0) {
-            if ($useSockInet == 0) {
-                $test_sock = IO::Socket::IP->new(LocalPort => $test_client_port,
-                                                 LocalAddr => $test_client_addr);
-            } else {
-                $test_sock = IO::Socket::INET->new(LocalAddr => $test_client_addr,
-                                                   LocalPort => $test_client_port);
-            }
-        } else {
-            $test_sock = IO::Socket::INET6->new(LocalAddr => $test_client_addr,
-                                                LocalPort => $test_client_port,
-                                                Domain => AF_INET6);
-        }
-        if ($test_sock) {
-            $found_port = 1;
-            $test_sock->close();
-            print "Found available client port ${test_client_port}\n";
-            last;
-        }
-        print "Port ${test_client_port} in use - $@\n";
-    }
-
-    if ($found_port == 0) {
-        die "Unable to find usable port for TLSProxy";
-    }
+        $isdtls,
+        $use_IPv6) = @_;
+    $use_IPv6 //= $have_IPv6;

     my $self = {
         #Public read/write
-        proxy_addr => $test_client_addr,
-        client_addr => $test_client_addr,
+        proxy_addr => $use_IPv6 ? "[::1]" : "127.0.0.1",
         filter => $filter,
         serverflags => "",
         clientflags => "",
         serverconnects => 1,
         reneg => 0,
         sessionfile => undef,
+        expected_tickets => 2,

         #Public read
         isdtls => $isdtls,
         proxy_port => 0,
-        client_port => $test_client_port,
         server_port => 0,
         serverpid => 0,
         clientpid => 0,
@@ -190,6 +138,7 @@ sub init
         partial => ["", ""],
         record_list => [],
         message_list => [],
+        seen_msgseq => {},
     };

     return bless $self, $class;
@@ -213,8 +162,10 @@ sub clearClient
     $self->{partial} = ["", ""];
     $self->{record_list} = [];
     $self->{message_list} = [];
+    $self->{seen_msgseq} = {};
     $self->{clientflags} = "";
     $self->{sessionfile} = undef;
+    $self->{expected_tickets} = 2;
     $self->{clientpid} = 0;
     $self->{clientexit} = 0;
     $is_tls13 = 0;
@@ -277,20 +228,30 @@ sub start
     my ($self) = shift;
     my $pid;

+    #
+    # s390x is a somewhat special case here.  It uses hw acceleration under
+    # the covers when computing MACs, and in so doing avoids the use of the
+    # needed ossltest provider when computing the underlying digest.  Since
+    # TLSProxy needs the ossltest provider to compute reliable known data in
+    # the digest, we disable MAC hw acceleration here to ensure that the provider
+    # gets used, just as it does with other architectures.
+    #
+    $ENV{OPENSSL_s390xcap} = "kmac:~0:~f000";
+
     # Create the Proxy socket
     my $proxaddr = $self->{proxy_addr};
     $proxaddr =~ s/[\[\]]//g; # Remove [ and ]
-    my $clientaddr = $self->{client_addr};
-    $clientaddr =~ s/[\[\]]//g; # Remove [ and ]

     my @proxyargs;

     if ($self->{isdtls}) {
+        # The socket is left unconnected: the client's address and port are
+        # learned from the first datagram it sends and remembered for
+        # sending back the server's flights.  That way the client's port is
+        # picked (race free) by the kernel rather than by us.
         @proxyargs = (
             LocalHost   => $proxaddr,
             LocalPort   => 0,
-            PeerHost   => $clientaddr,
-            PeerPort   => $self->{client_port},
             Proto       => "udp",
         );
     } else {
@@ -320,18 +281,23 @@ sub start
     }

     my $execcmd = $self->execute
-        ." s_server -no_comp -engine ossltest -state"
+        ." s_server -no_comp -provider=p_ossltest -provider=default -propquery ?provider=p_ossltest -state"
         #In TLSv1.3 we issue two session tickets. The default session id
-        #callback gets confused because the ossltest engine causes the same
+        #callback gets confused because the ossltest provider causes the same
         #session id to be created twice due to the changed random number
         #generation. Using "-ext_cache" replaces the default callback with a
         #different one that doesn't get confused.
         ." -ext_cache"
         ." -accept $self->{server_addr}:0"
-        ." -cert ".$self->cert." -cert2 ".$self->cert
         ." -naccept ".$self->serverconnects;
+    if (defined $self->cert) {
+        $execcmd .= " -cert ".$self->cert." -cert2 ".$self->cert;
+    } else {
+        $execcmd .= " -nocert";
+    }
+
     if ($self->{isdtls}) {
-        $execcmd .= " -dtls -max_protocol DTLSv1.2"
+        $execcmd .= " -dtls -max_protocol DTLSv1.3"
                     # TLSProxy does not support message fragmentation. So
                     # set a high mtu and fingers crossed.
                     ." -mtu 1500";
@@ -353,15 +319,28 @@ sub start

     open(my $savedin, "<&STDIN");

-    # Temporarily replace STDIN so that sink process can inherit it...
-    open(STDIN, "$^X -e 'sleep(10)' |") if $self->{isdtls};
+    # DTLS s_server exits when its stdin reaches EOF, so it needs one that
+    # stays open for as long as the test does.  Give it the read end of a
+    # pipe and keep the write end here; closing that in clientstart() is
+    # what lets it finish.
+    my $stdin_holder;
+    if ($self->{isdtls}) {
+        my $rd;
+
+        # A previous run that died before its teardown may have left one.
+        close($self->{stdin_holder}) if defined($self->{stdin_holder});
+        pipe($rd, $stdin_holder) or die "Failed to create stdin pipe: $!\n";
+        open(STDIN, "<&", $rd) or die "Failed to replace STDIN: $!\n";
+        close($rd);
+    }
     $pid = open(STDIN, "$execcmd 2>&1 |") or die "Failed to $execcmd: $!\n";
     $self->{real_serverpid} = $pid;
+    $self->{stdin_holder} = $stdin_holder;

     # Process the output from s_server until we find the ACCEPT line, which
     # tells us what the accepting address and port are.
     while (<>) {
-        print;
+        print STDERR $_;
         s/\R$//;                # Better chomp
         next unless (/^ACCEPT\s.*:(\d+)$/);
         $self->{server_port} = $1;
@@ -382,7 +361,7 @@ sub start
     my $error;
     $pid = undef;
     if (eval { require Win32::Process; 1; }) {
-        if (Win32::Process::Create(my $h, $^X, "perl -ne print", 0, 0, ".")) {
+        if (Win32::Process::Create(my $h, $^X, 'perl -ne "print STDERR $_"', 0, 0, ".")) {
             $pid = $h->GetProcessID();
             $self->{proc_handle} = $h;  # hold handle till next round [or exit]
         } else {
@@ -390,7 +369,7 @@ sub start
         }
     } else {
         if (defined($pid = fork)) {
-            $pid or exec("$^X -ne print") or exit($!);
+            $pid or exec($^X, '-ne', 'print STDERR $_') or exit($!);
         } else {
             $error = $!;
         }
@@ -425,16 +404,13 @@ sub clientstart
     if ($self->execute) {
         my $pid;
         my $execcmd = $self->execute
-             ." s_client -engine ossltest"
-             ." -connect $self->{proxy_addr}:$self->{proxy_port}";
+             ." s_client -provider=p_ossltest -provider=default -propquery ?provider=p_ossltest"
+             ." -state -connect $self->{proxy_addr}:$self->{proxy_port}";
         if ($self->{isdtls}) {
-            $execcmd .= " -dtls -max_protocol DTLSv1.2"
+            $execcmd .= " -dtls -max_protocol DTLSv1.3"
                         # TLSProxy does not support message fragmentation. So
                         # set a high mtu and fingers crossed.
-                        ." -mtu 1500"
-                        # UDP has no "accept" for sockets which means we need to
-                        # know were to send data back to.
-                        ." -bind $self->{client_addr}:$self->{client_port}";
+                        ." -mtu 1500";
         } else {
             $execcmd .= " -max_protocol TLSv1.3";
         }
@@ -456,7 +432,6 @@ sub clientstart
         if ($self->debug) {
             print STDERR "Client command: $execcmd\n";
         }
-
         open(my $savedout, ">&STDOUT");
         # If we open pipe with new descriptor, attempt to close it,
         # explicitly or implicitly, would incur waitpid and effectively
@@ -485,7 +460,12 @@ sub clientstart

     my $client_sock;
     if($self->{isdtls}) {
-        $client_sock = $self->{proxy_sock}
+        # The proxy socket is unconnected; the client's address is learned
+        # from the datagrams it sends (see client_sockaddr below).  A new
+        # s_client (with a fresh kernel-assigned port) may connect on each
+        # clientstart(), so forget any previous peer.
+        $client_sock = $self->{proxy_sock};
+        $self->{client_sockaddr} = undef;
     } elsif (!($client_sock = $self->{proxy_sock}->accept())) {
         warn "Failed accepting incoming connection: $!\n";
         return 0;
@@ -502,17 +482,41 @@ sub clientstart
     my $ctr = 0;
     local $SIG{PIPE} = "IGNORE";
     $self->{saw_session_ticket} = undef;
-    while($fdset->count && $ctr < 10) {
+    $self->{session_ticket_seq} = [];
+    $self->{saw_session_ticket_ack} = {};
+    $self->{server_epoch} = 0;
+    $self->{server_sequence_number} = 0;
+    $self->{client_epoch} = 0;
+    $self->{client_sequence_number} = 0;
+
+    while($fdset->count && $ctr < 50) {
         if (defined($self->{sessionfile})) {
             # s_client got -ign_eof and won't be exiting voluntarily, so we
             # look for data *and* session ticket...
             last if TLSProxy::Message->success()
-                    && $self->{saw_session_ticket};
+                    && $self->handshake_complete() == 1;
         }
-        if (!(@ready = $fdset->can_read(1))) {
-            last if TLSProxy::Message->success()
-                && $self->{saw_session_ticket};

+        # For DTLS, check exit conditions BEFORE calling can_read/sysread
+        # to avoid blocking on a socket where the peer has closed.
+        # Once we have the session ticket and have seen the end of the
+        # message stream (close_notify), we're done.
+        if ($self->{isdtls}) {
+            my $success_flag = TLSProxy::Message->success();
+            my $handshake_done = $self->handshake_complete();
+            my $msg_end = TLSProxy::Message->end();
+            if (($success_flag && $handshake_done == 1) || ($handshake_done == 1 && $msg_end)) {
+                last;
+            }
+        }
+
+        if (!(@ready = $fdset->can_read(0.1))) {
+            my $success_flag = TLSProxy::Message->success();
+            my $handshake_done = $self->handshake_complete();
+            my $msg_end = TLSProxy::Message->end();
+            if ($success_flag && $handshake_done == 1) {
+                last;
+            }
             $ctr++;
             next;
         }
@@ -520,22 +524,52 @@ sub clientstart
             if ($hand == $server_sock) {
                 if ($server_sock->sysread($indata, 16384)) {
                     if ($indata = $self->process_packet(1, $indata)) {
-                        $client_sock->syswrite($indata) or goto END;
+                        if (!$self->client_syswrite($client_sock, $indata)) {
+                            # For DTLS/UDP, syswrite failure after handshake completion
+                            # is not necessarily an error - the client may have already
+                            # sent close_notify and exited. Unlike TCP, UDP is
+                            # connectionless so we can't rely on socket state.
+                            if (!$self->{isdtls} || $self->handshake_complete() != 1) {
+                                goto END;
+                            }
+                        }
                     }
                     $ctr = 0;
                 } else {
-                    $fdset->remove($server_sock);
-                    $client_sock->shutdown(SHUT_WR);
+                    # For DTLS/UDP, sysread returning 0 doesn't mean the connection
+                    # is closed like it does for TCP. For TCP, 0 means EOF/FIN
+                    # received. For UDP, it may just mean no data available.
+                    # Skip the shutdown logic for DTLS to avoid prematurely
+                    # closing the connection.
+                    if (!$self->{isdtls}) {
+                        $fdset->remove($server_sock);
+                        $client_sock->shutdown(SHUT_WR);
+                    }
                 }
             } elsif ($hand == $client_sock) {
-                if ($client_sock->sysread($indata, 16384)) {
+                if ($self->client_sysread($client_sock, \$indata)) {
                     if ($indata = $self->process_packet(0, $indata)) {
-                        $server_sock->syswrite($indata) or goto END;
+                        if (!$server_sock->syswrite($indata)) {
+                            # For DTLS/UDP, syswrite failure after handshake completion
+                            # is not necessarily an error - the server may have already
+                            # sent close_notify and exited. Unlike TCP, UDP is
+                            # connectionless so we can't rely on socket state.
+                            if (!$self->{isdtls} || $self->handshake_complete() != 1) {
+                                goto END;
+                            }
+                        }
                     }
                     $ctr = 0;
                 } else {
-                    $fdset->remove($client_sock);
-                    $server_sock->shutdown(SHUT_WR);
+                    # For DTLS/UDP, sysread returning 0 doesn't mean the connection
+                    # is closed like it does for TCP. For TCP, 0 means EOF/FIN
+                    # received. For UDP, it may just mean no data available.
+                    # Skip the shutdown logic for DTLS to avoid prematurely
+                    # closing the connection.
+                    if (!$self->{isdtls}) {
+                        $fdset->remove($client_sock);
+                        $server_sock->shutdown(SHUT_WR);
+                    }
                 }
             } else {
                 kill(3, $self->{real_serverpid});
@@ -544,7 +578,7 @@ sub clientstart
         }
     }

-    if ($ctr >= 10) {
+    if ($ctr >= 50) {
         kill(3, $self->{real_serverpid});
         print "No progress made\n";
         $success = 0;
@@ -553,16 +587,37 @@ sub clientstart
     END:
     print "Connection closed\n";
     if($server_sock) {
+        if ($self->{isdtls} && $self->is_tls13()) {
+            my $alert_message = $self->construct_alert_message($self->{client_epoch}, $self->{client_sequence_number} + 1);
+            $server_sock->syswrite($alert_message) or warn "Failed to send close_notify alert: $!\n";
+        }
         $server_sock->close();
         $self->{server_sock} = undef;
     }
     if($client_sock) {
+        # For DTLSv1.3 tests that are using sessionfile we need to send a close_notify
+        # this is because closing the socket does not result in a FIN being sent as in TCP.
+        if ($self->{isdtls} && $self->is_tls13() && defined($self->{sessionfile})) {
+            my $alert_message = $self->construct_alert_message($self->{server_epoch}, $self->{server_sequence_number} + 1);
+            $self->client_syswrite($client_sock, $alert_message)
+                or warn "Failed to send close_notify alert: $!\n";
+        }
+
         #Closing this also kills the child process
-        $client_sock->close();
+        if (!$self->{isdtls}) {
+            $client_sock->close();
+        }
     }

     my $pid;
     if (--$self->{serverconnects} == 0) {
+        # Let a DTLS s_server see EOF on its stdin, so that it exits and the
+        # sink process reading its output finishes too.  This has to happen
+        # before either is waited for.
+        if (defined($self->{stdin_holder})) {
+            close($self->{stdin_holder});
+            $self->{stdin_holder} = undef;
+        }
         $pid = $self->{serverpid};
         print "Waiting for 'perl -ne print' process to close: $pid...\n";
         $pid = waitpid($pid, 0);
@@ -576,6 +631,7 @@ sub clientstart
         print "Waiting for s_server process to close: $pid...\n";
         # it's done already, just collect the exit code [and reap]...
         waitpid($pid, 0);
+
         die "exit code $? from s_server process\n" if $? != 0;
     } else {
         # It's a bit counter-intuitive spot to make next connection to
@@ -592,23 +648,95 @@ sub clientstart
     return $success;
 }

+# Read data sent by the client.  For DTLS the proxy socket is unconnected,
+# so recv() is used and the sender's address is remembered as the
+# destination for datagrams sent back to the client.
+sub client_sysread
+{
+    my ($self, $client_sock, $dataref) = @_;
+
+    if (!$self->{isdtls}) {
+        return $client_sock->sysread($$dataref, 16384);
+    }
+
+    my $peer = $client_sock->recv($$dataref, 16384, 0);
+    return undef if !defined $peer;
+    $self->{client_sockaddr} = $peer;
+    return length($$dataref);
+}
+
+# Send data to the client, using the address it last sent from in the DTLS
+# case.
+sub client_syswrite
+{
+    my ($self, $client_sock, $data) = @_;
+
+    if (!$self->{isdtls}) {
+        return $client_sock->syswrite($data);
+    }
+
+    if (!defined $self->{client_sockaddr}) {
+        warn "Cannot send to client: no datagram received from it yet\n";
+        return undef;
+    }
+
+    return $client_sock->send($data, 0, $self->{client_sockaddr});
+}
+
+sub construct_alert_message
+{
+    my ($self, $epoch, $sequence_number) = @_;
+
+    die "construct_alert_message only valid for DTLSv1.3 tests\n"
+        if !$self->{isdtls} || !$self->is_tls13();
+
+    my $alert_level = pack("C", 1);                # Warning (1)
+    my $alert_description = pack("C", 0);          # close_notify (0)
+    my $alert_payload = $alert_level.$alert_description;
+
+    if ($epoch == 0) {
+        # Epoch 0 uses DTLSPlaintext.
+        my $seqhi = ($sequence_number >> 32) & 0xffff;
+        my $seqmi = ($sequence_number >> 16) & 0xffff;
+        my $seqlo = ($sequence_number >> 0) & 0xffff;
+
+        return pack("C", 21).                 # Alert (21)
+               pack("n", 0xFEFD).             # legacy version DTLS 1.2
+               pack("n", $epoch).
+               pack('nnn', $seqhi, $seqmi, $seqlo).
+               pack("n", length($alert_payload)).
+               $alert_payload;
+    }
+
+    # Keyed epochs use DTLSCiphertext. The p_ossltest cipher leaves the
+    # payload unchanged and does not verify the tag. The inner plaintext
+    # holds close_notify and its content type; a zero tag follows.
+    # The header uses a 16 bit sequence number and a length field. Mask the
+    # sequence number with the first two payload bytes, as in Record.pm.
+    my $payload = $alert_payload.pack("C", 21).("\x00" x 16);
+    my $maskhi = unpack("n", substr($payload, 0, 2));
+    my $seqlo = ($sequence_number & 0xffff) ^ $maskhi;
+    my $first = 0x20 | 0x08 | 0x04 | ($epoch & 0x03);
+
+    return pack("C", $first).
+           pack("n", $seqlo).
+           pack("n", length($payload)).
+           $payload;
+}
+
 sub process_packet
 {
-    my ($self, $server, $packet) = @_;
-    my $len_real;
-    my $decrypt_len;
-    my $data;
-    my $recnum;
+    my ($self, $serverissender, $packet) = @_;

-    if ($server) {
+    if ($serverissender) {
         print "Received server packet\n";
     } else {
         print "Received client packet\n";
     }

-    if ($self->{direction} != $server) {
+    if ($self->{direction} != $serverissender) {
         $self->{flight} = $self->{flight} + 1;
-        $self->{direction} = $server;
+        $self->{direction} = $serverissender;
     }

     print "Packet length = ".length($packet)."\n";
@@ -616,13 +744,21 @@ sub process_packet

     #Return contains the list of record found in the packet followed by the
     #list of messages in those records and any partial message
-    my @ret = TLSProxy::Record->get_records($server, $self->flight,
-                                            $self->{partial}[$server].$packet,
+    my @ret = TLSProxy::Record->get_records($serverissender, $self->flight,
+                                            $self->{partial}[$serverissender].$packet,
                                             $self->{isdtls});

-    $self->{partial}[$server] = $ret[2];
+    $self->{partial}[$serverissender] = $ret[2];
     push @{$self->{record_list}}, @{$ret[0]};
-    push @{$self->{message_list}}, @{$ret[1]};
+    if ($self->{isdtls}) {
+        foreach my $msg (@{$ret[1]}) {
+            my $key = $msg->server . ":" . $msg->msgseq;
+            push @{$self->{message_list}}, $msg
+                unless $self->{seen_msgseq}{$key}++;
+        }
+    } else {
+        push @{$self->{message_list}}, @{$ret[1]};
+    }

     print "\n";

@@ -639,6 +775,20 @@ sub process_packet
     foreach my $message (reverse @{$self->{message_list}}) {
         if ($message->{mt} == TLSProxy::Message::MT_NEW_SESSION_TICKET) {
             $self->{saw_session_ticket} = 1;
+            # Obtain the most recent sequence number of the record
+            # that contained the NewSessionTicket message
+            if ($self->{isdtls} && $self->is_tls13()) {
+                foreach my $record (@{$message->{records}}) {
+                    if (@{$self->{session_ticket_seq}} == 0) {
+                        push @{$self->{session_ticket_seq}}, TLSProxy::RecordNumber->new($record->epoch, $record->seq);
+                    } elsif (scalar(@{$self->{session_ticket_seq}}) != $self->{expected_tickets}) {
+                        my $match = $self->find_session_ticket_ack($record->epoch, $record->seq);
+                        if ($match == -1) {
+                            push @{$self->{session_ticket_seq}}, TLSProxy::RecordNumber->new($record->epoch, $record->seq);
+                        }
+                    }
+                }
+            }
             last;
         }
     }
@@ -646,7 +796,25 @@ sub process_packet
     #Reconstruct the packet
     $packet = "";
     foreach my $record (@{$self->record_list}) {
-        $packet .= $record->reconstruct_record($server);
+        $packet .= $record->reconstruct_record($serverissender);
+
+        # After we have set the saw_session_ticket flag, we can check if we have
+        # seen a session ticket ack. This is only relevant for DTLSv1.3
+        if ($self->{isdtls} && $self->is_tls13()) {
+            $self->seen_session_ticket_ack($record);
+
+            my $epoch_key = $serverissender ? 'server_epoch' : 'client_epoch';
+            my $seq_key = $serverissender ? 'server_sequence_number' : 'client_sequence_number';
+            my $rec_epoch = $record->epoch();
+            my $rec_seq = $record->seq();
+
+            if ($rec_epoch > $self->{$epoch_key}) {
+                $self->{$epoch_key} = $rec_epoch;
+                $self->{$seq_key} = $rec_seq;
+            } elsif ($rec_epoch == $self->{$epoch_key} && $rec_seq > $self->{$seq_key}) {
+                $self->{$seq_key} = $rec_seq;
+            }
+        }
     }

     print "Forwarded packet length = ".length($packet)."\n\n";
@@ -654,6 +822,74 @@ sub process_packet
     return $packet;
 }

+sub seen_session_ticket_ack
+{
+    my $self = shift;
+    my $record = shift;
+
+    my $ack_hash = $self->{saw_session_ticket_ack};
+    return if !$self->{saw_session_ticket}
+              || scalar(keys %{$ack_hash}) == $self->{expected_tickets};
+    return if $record->content_type() != TLSProxy::Record::RT_ACK;
+
+    my @record_numbers = ();
+    $record->get_actual_acked_record_numbers(\@record_numbers);
+    my $ticket_seq = $self->{session_ticket_seq};
+
+    foreach my $record_number (@record_numbers) {
+        my $epoch = $record_number->epoch();
+        my $seqnum = $record_number->seqnum();
+        my $key = "$epoch:$seqnum";
+        next if exists $ack_hash->{$key};
+
+        my $match = $self->find_session_ticket_ack($epoch, $seqnum);
+
+        if ($match != -1) {
+            my $session_ticket = splice(@{$ticket_seq}, $match, 1);
+            $ack_hash->{$key} = $session_ticket;
+            last if scalar(keys %{$ack_hash}) == $self->{expected_tickets};
+        }
+    }
+}
+
+sub find_session_ticket_ack
+{
+    my $self = shift;
+    my $record_number_epoch = shift;
+    my $record_number_seqnum = shift;
+
+    my $tickets = $self->{session_ticket_seq};
+    for (my $i = 0; $i < @{$tickets}; $i++) {
+        my $ticket = $tickets->[$i];
+        if ($record_number_epoch == $ticket->epoch() &&
+            $record_number_seqnum == $ticket->seqnum()) {
+            return $i;
+        }
+    }
+
+    return -1;
+}
+
+sub handshake_complete
+{
+    my $self = shift;
+    my $res = 0;
+
+    if ($self->{isdtls} && $self->is_tls13() && defined($self->{sessionfile})) {
+        # The handshake is complete once every expected NewSessionTicket
+        # (2 by default, but only 1 follows a resumption) has been acked
+        if (scalar(keys %{$self->{saw_session_ticket_ack}}) == $self->{expected_tickets}) {
+            $res = 1;
+        }
+    } else {
+        if ($self->{saw_session_ticket}) {
+            $res = 1;
+        }
+    }
+
+    return $res;
+}
+
 #Read accessors
 sub execute
 {
@@ -852,6 +1088,14 @@ sub sessionfile
     }
     return $self->{sessionfile};
 }
+sub expected_tickets
+{
+    my $self = shift;
+    if (@_) {
+        $self->{expected_tickets} = shift;
+    }
+    return $self->{expected_tickets};
+}

 sub ciphersuite
 {
diff --git a/deps/openssl/openssl/util/perl/TLSProxy/Record.pm b/deps/openssl/openssl/util/perl/TLSProxy/Record.pm
index 460991e8aa8..e99edcbd1f4 100644
--- a/deps/openssl/openssl/util/perl/TLSProxy/Record.pm
+++ b/deps/openssl/openssl/util/perl/TLSProxy/Record.pm
@@ -1,4 +1,4 @@
-# Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -20,11 +20,16 @@ use constant TLS_RECORD_HEADER_LENGTH => 5;

 #Record types
 use constant {
-    RT_APPLICATION_DATA => 23,
-    RT_HANDSHAKE => 22,
-    RT_ALERT => 21,
-    RT_CCS => 20,
-    RT_UNKNOWN => 100
+    RT_APPLICATION_DATA   => 23,
+    RT_HANDSHAKE          => 22,
+    RT_ALERT              => 21,
+    RT_CCS                => 20,
+    RT_ACK                => 26,
+    RT_UNKNOWN            => 100,
+    RT_DTLS_UNIHDR_EPOCH4 => 0x2c,
+    RT_DTLS_UNIHDR_EPOCH1 => 0x2d,
+    RT_DTLS_UNIHDR_EPOCH2 => 0x2e,
+    RT_DTLS_UNIHDR_EPOCH3 => 0x2f,
 };

 my %record_type = (
@@ -32,10 +37,16 @@ my %record_type = (
     RT_HANDSHAKE, "HANDSHAKE",
     RT_ALERT, "ALERT",
     RT_CCS, "CCS",
-    RT_UNKNOWN, "UNKNOWN"
+    RT_ACK, "ACK",
+    RT_UNKNOWN, "UNKNOWN",
+    RT_DTLS_UNIHDR_EPOCH4, "DTLS UNIFIED HEADER (EPOCH 4)",
+    RT_DTLS_UNIHDR_EPOCH1, "DTLS UNIFIED HEADER (EPOCH 1)",
+    RT_DTLS_UNIHDR_EPOCH2, "DTLS UNIFIED HEADER (EPOCH 2)",
+    RT_DTLS_UNIHDR_EPOCH3, "DTLS UNIFIED HEADER (EPOCH 3)",
 );

 use constant {
+    VERS_DTLS_1_3 => 0xfefc,
     VERS_DTLS_1_2 => 0xfefd,
     VERS_DTLS_1 => 0xfeff,
     VERS_TLS_1_4 => 0x0305,
@@ -48,6 +59,7 @@ use constant {
 };

 our %tls_version = (
+    VERS_DTLS_1_3, "DTLS1.3",
     VERS_DTLS_1_2, "DTLS1.2",
     VERS_DTLS_1, "DTLS1",
     VERS_TLS_1_3, "TLS1.3",
@@ -62,38 +74,83 @@ our %tls_version = (
 sub get_records
 {
     my $class = shift;
-    my $server = shift;
+    my $serverissender = shift;
     my $flight = shift;
     my $packet = shift;
     my $isdtls = shift;
     my $partial = "";
     my @record_list = ();
     my @message_list = ();
-    my $record_hdr_len = $isdtls ? DTLS_RECORD_HEADER_LENGTH
-                                 : TLS_RECORD_HEADER_LENGTH;

     my $recnum = 1;
     while (length ($packet) > 0) {
-        print " Record $recnum ", $server ? "(server -> client)\n"
-                                          : "(client -> server)\n";
-
+        print " Record $recnum ", $serverissender ? "(server -> client)\n"
+                                                  : "(client -> server)\n";
+        my $record_hdr_len;
         my $content_type;
         my $version;
         my $len;
         my $epoch;
         my $seq;

-        if ($isdtls) {
-            my $seqhi;
-            my $seqmi;
-            my $seqlo;
-            #Get the record header (unpack can't fail if $packet is too short)
-            ($content_type, $version, $epoch,
-                $seqhi, $seqmi, $seqlo, $len) = unpack('Cnnnnnn', $packet);
-            $seq = ($seqhi << 32) | ($seqmi << 16) | $seqlo
+        if ($isdtls == 1) {
+            my $isunifiedhdr;
+
+            $content_type = unpack('B[8]', $packet);
+            $isunifiedhdr = substr($content_type, 0, 3) == "001";
+
+            if ($isunifiedhdr == 1) {
+                my $cbit = substr($content_type, 3, 1);
+                my $sbit = substr($content_type, 4, 1);
+                my $lbit = substr($content_type, 5, 1);
+                my $eebits = substr($content_type, 6, 2);
+
+                if ($cbit == "1" || $lbit == "0") {
+                    die("TLSProxy does not support variable DTLSv1.3 unified header bits");
+                }
+
+                # This is a unified header
+                if ($sbit == "1") {
+                    ($content_type, $seq, $len) = unpack('Cnn', $packet);
+                    $record_hdr_len = 5;
+                } else {
+                    ($content_type, $seq, $len) = unpack('CCn', $packet);
+                    $record_hdr_len = 4;
+                }
+                # Encrypted DTLS 1.3 records have encrypted sequence numbers.
+                # ossltest engine overrides ecb encryption to be a no-op.
+                # This effectively means that the sequence number encryption mask
+                # is just the 16 first bytes of the record body.
+                my $recordbody = substr($packet, $record_hdr_len, $len);
+                (my $maskhi, my $maskmi, my $masklo) = unpack('nnn', $recordbody);
+                $version = VERS_DTLS_1_2; # DTLSv1.3 headers has DTLSv1.2 in its legacy_version field
+
+                if ($eebits == "00") {
+                    $epoch = 4; # must be at least 4 since 0 epoch are not sent with unified hdr
+                } elsif ($eebits == "01") {
+                    $epoch = 1;
+                } elsif ($eebits == "10") {
+                    $epoch = 2;
+                } elsif ($eebits == "11") {
+                    $epoch = 3;
+                } else {
+                    die("Epoch bits is not 0's or 1's: should not happen")
+                }
+                $seq ^= $maskhi;
+            } else {
+                my $seqhi;
+                my $seqmi;
+                my $seqlo;
+                #Get the record header (unpack can't fail if $packet is too short)
+                ($content_type, $version, $epoch,
+                    $seqhi, $seqmi, $seqlo, $len) = unpack('Cnnnnnn', $packet);
+                $seq = ($seqhi << 32) | ($seqmi << 16) | $seqlo;
+                $record_hdr_len = DTLS_RECORD_HEADER_LENGTH;
+            }
         } else {
             #Get the record header (unpack can't fail if $packet is too short)
             ($content_type, $version, $len) = unpack('Cnn', $packet);
+            $record_hdr_len = TLS_RECORD_HEADER_LENGTH;
         }

         if (length($packet) < $record_hdr_len + ($len // 0)) {
@@ -106,7 +163,7 @@ sub get_records

         print "  Content type: ".$record_type{$content_type}."\n";
         print "  Version: $tls_version{$version}\n";
-        if($isdtls) {
+        if($isdtls == 1) {
             print "  Epoch: $epoch\n";
             print "  Sequence: $seq\n";
         }
@@ -115,13 +172,13 @@ sub get_records
         my $record;
         if ($isdtls) {
             $record = TLSProxy::Record->new_dtls(
+                $serverissender,
                 $flight,
                 $content_type,
                 $version,
                 $epoch,
                 $seq,
                 $len,
-                0,
                 $len,       # len_real
                 $len,       # decrypt_len
                 $data,      # data
@@ -129,11 +186,11 @@ sub get_records
             );
         } else {
             $record = TLSProxy::Record->new(
+                $serverissender,
                 $flight,
                 $content_type,
                 $version,
                 $len,
-                0,
                 $len,  # len_real
                 $len,  # decrypt_len
                 $data, # data
@@ -144,8 +201,8 @@ sub get_records
         if ($content_type != RT_CCS
                 && (!TLSProxy::Proxy->is_tls13()
                     || $content_type != RT_ALERT)) {
-            if (($server && $server_encrypting)
-                     || (!$server && $client_encrypting)) {
+            if (($serverissender && $server_encrypting)
+                     || (!$serverissender && $client_encrypting)) {
                 if (!TLSProxy::Proxy->is_tls13() && $etm) {
                     $record->decryptETM();
                 } else {
@@ -156,6 +213,7 @@ sub get_records
                 if (TLSProxy::Proxy->is_tls13()) {
                     print "  Inner content type: "
                           .$record_type{$record->content_type()}."\n";
+                    print " Data: ".unpack("n",$record->decrypt_data)."\n";
                 }
             }
         }
@@ -163,7 +221,7 @@ sub get_records
         push @record_list, $record;

         #Now figure out what messages are contained within this record
-        my @messages = TLSProxy::Message->get_messages($server, $record, $isdtls);
+        my @messages = TLSProxy::Message->get_messages($record);
         push @message_list, @messages;

         $packet = substr($packet, $record_hdr_len + $len);
@@ -209,25 +267,25 @@ sub etm
 sub new_dtls
 {
     my $class = shift;
-    my ($flight,
+    my ($serverissender,
+        $flight,
         $content_type,
         $version,
         $epoch,
         $seq,
         $len,
-        $sslv2,
         $len_real,
         $decrypt_len,
         $data,
         $decrypt_data) = @_;
-    return $class->init(1,
+    return $class->init($serverissender,
+        1,
         $flight,
         $content_type,
         $version,
         $epoch,
         $seq,
         $len,
-        $sslv2,
         $len_real,
         $decrypt_len,
         $data,
@@ -237,16 +295,17 @@ sub new_dtls
 sub new
 {
     my $class = shift;
-    my ($flight,
+    my ($serverissender,
+        $flight,
         $content_type,
         $version,
         $len,
-        $sslv2,
         $len_real,
         $decrypt_len,
         $data,
         $decrypt_data) = @_;
     return $class->init(
+        $serverissender,
         0,
         $flight,
         $content_type,
@@ -254,7 +313,6 @@ sub new
         0, #epoch
         0, #seq
         $len,
-        $sslv2,
         $len_real,
         $decrypt_len,
         $data,
@@ -264,20 +322,21 @@ sub new
 sub init
 {
     my $class = shift;
-    my ($isdtls,
+    my ($serverissender,
+        $isdtls,
         $flight,
         $content_type,
         $version,
         $epoch,
         $seq,
         $len,
-        $sslv2,
         $len_real,
         $decrypt_len,
         $data,
         $decrypt_data) = @_;

     my $self = {
+        serverissender => $serverissender,
         isdtls => $isdtls,
         flight => $flight,
         content_type => $content_type,
@@ -285,7 +344,6 @@ sub init
         epoch => $epoch,
         seq => $seq,
         len => $len,
-        sslv2 => $sslv2,
         len_real => $len_real,
         decrypt_len => $decrypt_len,
         data => $data,
@@ -293,7 +351,7 @@ sub init
         orig_decrypt_data => $decrypt_data,
         sent => 0,
         encrypted => 0,
-        outer_content_type => RT_APPLICATION_DATA
+        outer_content_type => $content_type,
     };

     return bless $self, $class;
@@ -306,7 +364,8 @@ sub decryptETM

     my $data = $self->data;

-    if($self->version >= VERS_TLS_1_1()) {
+    if((!$self->{isdtls} && $self->version >= VERS_TLS_1_1)
+       || ($self->{isdtls} && $self->version <= VERS_DTLS_1)) {
         #TLS1.1+ has an explicit IV. Throw it away
         $data = substr($data, 16);
     }
@@ -348,7 +407,8 @@ sub decrypt()
             return $data if (length($data) == 2);
         }
         $mactaglen = 16;
-    } elsif ($self->version >= VERS_TLS_1_1()) {
+    } elsif ((!$self->{isdtls} && $self->version() >= VERS_TLS_1_1)
+             || ($self->{isdtls} && $self->version() <= VERS_DTLS_1)) {
         #16 bytes for a standard IV
         $data = substr($data, 16);

@@ -388,42 +448,76 @@ sub reconstruct_record
     }
     $self->{sent} = 1;

-    if ($self->sslv2) {
-        $data = pack('n', $self->len | 0x8000);
-    } else {
-        if($self->{isdtls}) {
-            my $seqhi = ($self->seq >> 32) & 0xffff;
-            my $seqmi = ($self->seq >> 16) & 0xffff;
-            my $seqlo = ($self->seq >> 0) & 0xffff;
-            $data = pack('Cnnnnnn', $self->content_type, $self->version,
-                         $self->epoch, $seqhi, $seqmi, $seqlo, $self->len);
+    my $content_type = (TLSProxy::Proxy->is_tls13() && $self->encrypted)
+                       ? $self->outer_content_type : $self->content_type;
+    if($self->{isdtls}) {
+        my $seqhi = ($self->seq >> 32) & 0xffff;
+        my $seqmi = ($self->seq >> 16) & 0xffff;
+        my $seqlo = ($self->seq >> 0) & 0xffff;
+
+        if (TLSProxy::Proxy->is_tls13() && $self->encrypted) {
+            # Mask sequence number with record body bytes. Explanation
+            # given in get_records.
+            (my $maskhi, my $maskmi, my $masklo) = unpack("nnn", $self->data);
+            $seqlo ^= $maskhi;
+            # Prepare a unified header
+            $data = pack('Cnn', $content_type, $seqlo, $self->len);
         } else {
-            if (TLSProxy::Proxy->is_tls13() && $self->encrypted) {
-                $data = pack('Cnn', $self->outer_content_type, $self->version,
-                             $self->len);
-            }
-            else {
-                $data = pack('Cnn', $self->content_type, $self->version,
-                             $self->len);
-            }
+            $data = pack('Cnnnnnn', $content_type, $self->version,
+                $self->epoch, $seqhi, $seqmi, $seqlo, $self->len);
         }
-
+    } else {
+        $data = pack('Cnn', $content_type, $self->version, $self->len);
     }
+
     $data .= $self->data;

     return $data;
 }

+sub get_actual_acked_record_numbers
+{
+    my $self = shift;
+    my $record_numbers = shift;
+
+    if ($self->content_type == TLSProxy::Record::RT_ACK) {
+        my $recnum_count = unpack('n', $self->decrypt_data) / 16;
+        my $ptr = 2;
+
+        for (my $idx = 0; $idx < $recnum_count; $idx++) {
+            my $epoch_lo;
+            my $epoch_hi;
+            my $msgseq_lo;
+            my $msgseq_hi;
+
+            ($epoch_hi, $epoch_lo, $msgseq_hi, $msgseq_lo)
+                = unpack('NNNN', substr($self->decrypt_data, $ptr));
+            $ptr = $ptr + 16;
+
+            my $epoch = ($epoch_hi << 32) | $epoch_lo;
+            my $msgseq = ($msgseq_hi << 32) | $msgseq_lo;
+            my $recnum = TLSProxy::RecordNumber->new($epoch, $msgseq);
+
+            push(@$record_numbers, $recnum);
+        }
+    }
+}
+
 #Read only accessors
-sub flight
+sub serverissender
 {
     my $self = shift;
-    return $self->{flight};
+    return $self->{serverissender};
 }
-sub sslv2
+sub isdtls
 {
     my $self = shift;
-    return $self->{sslv2};
+    return $self->{isdtls};
+}
+sub flight
+{
+    my $self = shift;
+    return $self->{flight};
 }
 sub len_real
 {
diff --git a/deps/openssl/openssl/util/perl/TLSProxy/RecordNumber.pm b/deps/openssl/openssl/util/perl/TLSProxy/RecordNumber.pm
new file mode 100644
index 00000000000..d497df9570e
--- /dev/null
+++ b/deps/openssl/openssl/util/perl/TLSProxy/RecordNumber.pm
@@ -0,0 +1,37 @@
+# Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+use strict;
+
+package TLSProxy::RecordNumber;
+
+sub new
+{
+    my $class = shift;
+    my ($epoch,
+        $seqnum) = @_;
+
+    my $self = {
+        epoch => $epoch,
+        seqnum => $seqnum
+    };
+
+    return bless $self, $class;
+}
+
+# Read only accessors
+sub epoch
+{
+    my $self = shift;
+    return $self->{epoch};
+}
+sub seqnum
+{
+    my $self = shift;
+    return $self->{seqnum};
+}
+1;
diff --git a/deps/openssl/openssl/util/perl/TLSProxy/ServerHello.pm b/deps/openssl/openssl/util/perl/TLSProxy/ServerHello.pm
index a1dabaa2b38..034b15d013f 100644
--- a/deps/openssl/openssl/util/perl/TLSProxy/ServerHello.pm
+++ b/deps/openssl/openssl/util/perl/TLSProxy/ServerHello.pm
@@ -1,4 +1,4 @@
-# Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -10,6 +10,7 @@ use strict;
 package TLSProxy::ServerHello;

 use TLSProxy::Record;
+use TLSProxy::Certificate;

 use vars '@ISA';
 push @ISA, 'TLSProxy::Message';
@@ -25,7 +26,7 @@ sub new
     my ($isdtls,
         $server,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -37,7 +38,7 @@ sub new
         $server,
         TLSProxy::Message::MT_SERVER_HELLO,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -111,7 +112,8 @@ sub parse

     if ($random eq $hrrrandom) {
         TLSProxy::Proxy->is_tls13(1);
-    } elsif ($neg_version == TLSProxy::Record::VERS_TLS_1_3) {
+    } elsif ($neg_version == TLSProxy::Record::VERS_TLS_1_3()
+             || $neg_version == TLSProxy::Record::VERS_DTLS_1_3()) {
         TLSProxy::Proxy->is_tls13(1);

         TLSProxy::Record->server_encrypting(1);
@@ -128,6 +130,7 @@ sub parse
     $self->extension_data(\%extensions);

     $self->process_data();
+    $self->process_extensions();


     print "    Server Version:".$TLSProxy::Record::tls_version{$server_version}."\n";
@@ -145,6 +148,28 @@ sub process_data
     TLSProxy::Message->ciphersuite($self->ciphersuite);
 }

+#Perform any actions necessary based on the extensions we've seen
+sub process_extensions
+{
+    my $self = shift;
+    my %extensions = %{$self->extension_data};
+
+    #Clear any state from a previous run
+    TLSProxy::Certificate->client_type(TLSProxy::Certificate::TLSEXT_cert_type_x509);
+    TLSProxy::Certificate->server_type(TLSProxy::Certificate::TLSEXT_cert_type_x509);
+
+    if (defined(my $data = $extensions{TLSProxy::Message::EXT_CLIENT_CERT_TYPE})) {
+        die "Invalid client certificate type extension\n"
+            if length($data) != 1;
+        TLSProxy::Certificate->client_type(unpack("C", $data));
+    }
+    if (defined(my $data = $extensions{TLSProxy::Message::EXT_SERVER_CERT_TYPE})) {
+        die "Invalid server certificate type extension\n"
+            if length($data) != 1;
+        TLSProxy::Certificate->server_type(unpack("C", $data));
+    }
+}
+
 #Reconstruct the on-the-wire message data following changes
 sub set_message_contents
 {
diff --git a/deps/openssl/openssl/util/perl/TLSProxy/ServerKeyExchange.pm b/deps/openssl/openssl/util/perl/TLSProxy/ServerKeyExchange.pm
index 15dd9a8898e..df8214ce9e7 100644
--- a/deps/openssl/openssl/util/perl/TLSProxy/ServerKeyExchange.pm
+++ b/deps/openssl/openssl/util/perl/TLSProxy/ServerKeyExchange.pm
@@ -1,4 +1,4 @@
-# Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -18,7 +18,7 @@ sub new
     my ($isdtls,
         $server,
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -28,9 +28,9 @@ sub new
     my $self = $class->SUPER::new(
         $isdtls,
         $server,
-        TLSProxy::Message::MT_SERVER_KEY_EXCHANGE,
+        TLSProxy::Message::MT_SERVER_KEY_EXCHANGE(),
         $msgseq,
-        $msgfrag,
+        $msgfraglen,
         $msgfragoffs,
         $data,
         $records,
@@ -54,9 +54,9 @@ sub parse

     #Minimal SKE parsing. Only supports one known DHE ciphersuite at the moment
     return if TLSProxy::Proxy->ciphersuite()
-                 != TLSProxy::Message::CIPHER_ADH_AES_128_SHA
+                 != TLSProxy::Message::CIPHER_ADH_AES_128_SHA()
               && TLSProxy::Proxy->ciphersuite()
-                 != TLSProxy::Message::CIPHER_DHE_RSA_AES_128_SHA;
+                 != TLSProxy::Message::CIPHER_DHE_RSA_AES_128_SHA();

     my $p_len = unpack('n', $self->data);
     my $ptr = 2;
@@ -77,7 +77,8 @@ sub parse
     my $record = ${$self->records}[0];

     if (TLSProxy::Proxy->is_tls13()
-            || $record->version() == TLSProxy::Record::VERS_TLS_1_2) {
+        || $record->version() == TLSProxy::Record::VERS_TLS_1_2()
+        || $record->version() == TLSProxy::Record::VERS_DTLS_1_2()) {
         $sigalg = unpack('n', substr($self->data, $ptr));
         $ptr += 2;
     }
diff --git a/deps/openssl/openssl/util/perl/checkhandshake.pm b/deps/openssl/openssl/util/perl/checkhandshake.pm
index 618ee99577f..10f5c58ab8b 100644
--- a/deps/openssl/openssl/util/perl/checkhandshake.pm
+++ b/deps/openssl/openssl/util/perl/checkhandshake.pm
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -59,7 +59,8 @@ use constant {
     SUPPORTED_GROUPS_SRV_EXTENSION => 0x00100000,
     POST_HANDSHAKE_AUTH_CLI_EXTENSION => 0x00200000,
     CERT_COMP_CLI_EXTENSION => 0x00400000,
-    CERT_COMP_SRV_EXTENSION => 0x00800000
+    CERT_COMP_SRV_EXTENSION => 0x00800000,
+    COOKIE_EXTENSION => 0x01000000
 };

 our @handmessages = ();
@@ -68,6 +69,19 @@ our @extensions = ();
 sub checkhandshake($$$$)
 {
     my ($proxy, $handtype, $exttype, $testname) = @_;
+    my $msgs = \@handmessages;
+
+    # s_server validates DTLS peers with a HelloRetryRequest cookie, so every
+    # DTLS handshake exchanges the HRR messages and the cookie extension
+    if ($proxy->isdtls()) {
+        $msgs = [map {
+            [$_->[0],
+             $_->[1] != 0
+             && ($_->[1] & ~(HRR_HANDSHAKE | HRR_RESUME_HANDSHAKE)) == 0
+                 ? ALL_HANDSHAKES : $_->[1]]
+        } @handmessages];
+        $exttype |= COOKIE_EXTENSION;
+    }

     subtest $testname => sub {
         my $loop = 0;
@@ -79,11 +93,11 @@ sub checkhandshake($$$$)
         my $numsh = 0;
         if (TLSProxy::Proxy::is_tls13()) {
             #How many ServerHellos are we expecting?
-            for ($numtests = 0; $handmessages[$loop][1] != 0; $loop++) {
-                next if (($handmessages[$loop][1] & $handtype) == 0);
+            for ($numtests = 0; $msgs->[$loop][1] != 0; $loop++) {
+                next if (($msgs->[$loop][1] & $handtype) == 0);
                 $numsh++ if ($lastmt != TLSProxy::Message::MT_SERVER_HELLO
-                             && $handmessages[$loop][0] == TLSProxy::Message::MT_SERVER_HELLO);
-                $lastmt = $handmessages[$loop][0];
+                             && $msgs->[$loop][0] == TLSProxy::Message::MT_SERVER_HELLO);
+                $lastmt = $msgs->[$loop][0];
             }
         }

@@ -102,8 +116,8 @@ sub checkhandshake($$$$)
         #first ServerHello in the list completely
         $shnum++ if ($numsh == 1 && TLSProxy::Proxy::is_tls13());
         $loop = 0;
-        for ($numtests = 0; $handmessages[$loop][1] != 0; $loop++) {
-            next if (($handmessages[$loop][1] & $handtype) == 0);
+        for ($numtests = 0; $msgs->[$loop][1] != 0; $loop++) {
+            next if (($msgs->[$loop][1] & $handtype) == 0);
             if (scalar @{$proxy->message_list} > $nextmess) {
                 $message = ${$proxy->message_list}[$nextmess];
                 $nextmess++;
@@ -163,8 +177,8 @@ sub checkhandshake($$$$)
         #If we're only expecting one ServerHello out of two then we skip the
         #first ServerHello in the list completely
         $shnum++ if ($numsh == 1 && TLSProxy::Proxy::is_tls13());
-        for ($loop = 0; $handmessages[$loop][1] != 0; $loop++) {
-            next if (($handmessages[$loop][1] & $handtype) == 0);
+        for ($loop = 0; $msgs->[$loop][1] != 0; $loop++) {
+            next if (($msgs->[$loop][1] & $handtype) == 0);
             if (scalar @{$proxy->message_list} > $nextmess) {
                 $message = ${$proxy->message_list}[$nextmess];
                 $nextmess++;
@@ -173,12 +187,12 @@ sub checkhandshake($$$$)
             }
             if (!defined $message) {
                 fail("Message type check. Got nothing, expected "
-                     .$handmessages[$loop][0]);
+                     .$msgs->[$loop][0]);
                 next;
             } else {
-                ok($message->mt == $handmessages[$loop][0],
+                ok($message->mt == $msgs->[$loop][0],
                    "Message type check. Got ".$message->mt
-                   .", expected ".$handmessages[$loop][0]);
+                   .", expected ".$msgs->[$loop][0]);
             }
             if (TLSProxy::Proxy::is_tls13()) {
                 $chnum++ if $message->mt() == TLSProxy::Message::MT_CLIENT_HELLO;
diff --git a/deps/openssl/openssl/util/platform_symbols/unix-symbols.txt b/deps/openssl/openssl/util/platform_symbols/unix-symbols.txt
index d5d70802564..bfd60a51b7e 100644
--- a/deps/openssl/openssl/util/platform_symbols/unix-symbols.txt
+++ b/deps/openssl/openssl/util/platform_symbols/unix-symbols.txt
@@ -1,7 +1,6 @@
 abort
 accept
 aligned_alloc
-atoi
 bcmp
 bind
 calloc
@@ -118,6 +117,7 @@ recvfrom
 recvmmsg
 secure_getenv
 select
+send
 sendmmsg
 sendto
 setbuf
@@ -160,4 +160,5 @@ __timezone
 uname
 usleep
 vfprintf
+vsnprintf
 __xpg_strerror_r
diff --git a/deps/openssl/openssl/util/platform_symbols/windows-symbols.txt b/deps/openssl/openssl/util/platform_symbols/windows-symbols.txt
index 0f6cc11450c..cd41c7ec028 100644
--- a/deps/openssl/openssl/util/platform_symbols/windows-symbols.txt
+++ b/deps/openssl/openssl/util/platform_symbols/windows-symbols.txt
@@ -1,5 +1,6 @@
 AcquireSRWLockExclusive
 AcquireSRWLockShared
+BCryptGenRandom
 CertCloseStore
 CertFindCertificateInStore
 CertFreeCertificateContext
@@ -124,7 +125,6 @@ _stat64i32
 _strdup
 _time64
 _wfopen
-atoi
 calloc
 clearerr
 fclose
diff --git a/deps/openssl/openssl/util/reformat-patches.sh b/deps/openssl/openssl/util/reformat-patches.sh
new file mode 100755
index 00000000000..7f6a6be239d
--- /dev/null
+++ b/deps/openssl/openssl/util/reformat-patches.sh
@@ -0,0 +1,470 @@
+#! /bin/sh -efu
+
+# Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License").
+# You may not use this file except in compliance with the License.
+# You can obtain a copy in the file LICENSE in the source distribution
+# or at https://www.openssl.org/source/license.html
+
+# The script takes starts with PATCH_BRANCH (or commit derived from TAG_PRE_FMT
+# and openssl version derived from OPENSSL_BRANCH, if none provided), applies
+# the list of patches provided in the command line, rebases the resulting
+# branch to TAG_PRE_FMT-derived-tagged commit, then iterates over each
+# of the branch commits and processes the files with extensions specified
+# in FMT_EXTENSIONS (except for the ones in EXCLUDE_FILES) with CLANG_FMT_CMD,
+# and committing the result on top of TAG_POST_FMT-derived-tagged commit.
+# The result of successful processing is saved to OUT_DIR with
+# git format-patch, and, if PATCH_BRANCH is a local branch name, it is reset
+# to the resulting branch.
+
+: "${TAG_PRE_FMT=%s-PRE-CLANG-FORMAT-WEBKIT}"
+: "${TAG_POST_FMT=%s-POST-CLANG-FORMAT-WEBKIT}"
+: "${GIT_CMD=git}"
+: "${GIT_REMOTE=origin}"
+: "${CLANG_FMT_CMD=clang-format-21}"
+: "${EXCLUDE_FILES=crypto/asn1/charmap.h crypto/bn/bn_prime.h crypto/conf/conf_def.h crypto/objects/obj_dat.h crypto/objects/obj_xref.h include/openssl/obj_mac.h}"
+: "${FMT_EXTENSIONS=.c .h .c.in .h.in}"
+: "${WORK_BRANCH_PRE=reformat-patches-pre}"
+: "${WORK_BRANCH_POST=reformat-patches-post}"
+: "${PROCESS_BRANCH_PRE=reformat-patches-process-pre}"
+
+: "${GIT_REPO_URL=https://github.com/openssl/openssl.git}"
+: "${NO_CLEANUP=0}"
+: "${GIT_REPO_DIR=}"
+: "${OUT_DIR=out}"
+: "${NO_FORMAT_PATCH=0}"
+: "${OPENSSL_BRANCH=master}"
+: "${PATCH_BRANCH=}"
+: "${FORCE=0}"
+: "${DO_REBASE_AFTER=0}"
+: "${NO_RESET_ON_SUCCESS=0}"
+
+cleanup_done=1
+branches_created=0
+
+prn()
+{
+    printf >&2 "%s\n" "$@"
+}
+
+msg()
+{
+    printf >&2 "$0: %s\n" "$*"
+}
+
+die()
+{
+    msg "$*"
+    exit 1
+}
+
+exit_handler()
+{
+    [ 0 = "${cleanup_done}" ] || return;
+
+    if [ -n "${WORKTREE_DIR-}" ]; then
+        msg "The temporarily created worktree is located" \
+            "at '${WORKTREE_DIR}', feel free to remove it (after" \
+            "it is no longer needed) with" \
+            "$GIT_CMD ${GIT_REPO_DIR:+-C ${GIT_REPO_DIR} }worktree remove" \
+            "-f '${WORKTREE_DIR}' && rm -rf '${WORKTREE_DIR}'"
+    fi
+
+    if [ 0 = "${PERMANENT_GIT_DIR:-}" -a -n "${GIT_REPO_DIR:-}" ]; then
+        msg "The temporarily created git repository directory is located" \
+            "at '${GIT_REPO_DIR}', feel free to remove it after" \
+            "it is no longer needed."
+    fi
+
+    [ 0 = "${branches_created}" ] ||
+        msg "The temporarily created working branches ('${WORK_BRANCH_PRE}'," \
+            "'${WORK_BRANCH_POST}', and '${PROCESS_BRANCH_PRE}')" \
+            "are not removed."
+
+    cleanup_done=1
+}
+
+trap exit_handler 0 TERM INT QUIT
+
+# Check that the working branches are available for us to use
+check_branch()
+{
+    branch_name=$(eval "printf '%s' \"\${$1}\"")
+
+    if "$GIT_CMD" -C "${GIT_REPO_DIR}" show-ref --verify --quiet \
+             "refs/heads/${branch_name}"; then
+        die "'${branch_name}' branch exists already in '${GIT_REPO_DIR}';" \
+            "please specify -f option or a different working branch name" \
+            "in $1 environment variable"
+    fi
+
+    return 0
+}
+
+usage()
+{
+    prn "Usage: $0 [-g GIT_REPO_DIR] [-D] [-u GIT_REPO_URL] [-o OUT_DIR] [-O]" \
+        "       [-b OPENSSL_BRANCH] [-B PATCH_BRANCH] [-f] [-R] [-n] [-h]" \
+        "       [patch...]"
+}
+
+help()
+{
+    prn "" \
+        "Re-format OpenSSL patches using clang-format." \
+        "" \
+        "A script applies patches on top of a pre-reformat-tagged commit," \
+        "processes them with clang-format, and re-generates them on top" \
+        "of the corresponding post-reformat-tagged commit." \
+        "" \
+        "OPTIONS:" \
+        "    -g     Path to a local openssl repository;  if no local" \
+        "           directory is specified, the repository is checked out" \
+        "           from GIT_REPO_URL into a temporary directory" \
+        "           (Current: '${GIT_REPO_DIR}')." \
+        "    -D     Do not remove the temporarily created repository" \
+        "           (Current: '${NO_CLEANUP}')." \
+        "    -u     URL for cloning the openssl repository, if no git" \
+        "           repository directory was provided" \
+        "           (Current: '${GIT_REPO_URL}')." \
+        "    -o     Output directory for patches (Current: '${OUT_DIR}')." \
+        "    -O     Do not output the resulting patches with git format-patch" \
+        "           (Current: '${NO_FORMAT_PATCH}')." \
+        "    -b     openssl branch to work on, should be 'master'" \
+        "           or 'openssl-X.Y' (Current: '${OPENSSL_BRANCH}')." \
+        "    -B     If non-empty, the provided revision is used as a base" \
+        "           commit to work on: the provided patches are applied" \
+        "           on top of it (if any);  if a local branch name" \
+        "           is provided, it will be reset to the resulting patch set" \
+        "           upon success, unless -n option is specified" \
+        "           (Current: '${PATCH_BRANCH}')." \
+        "    -f     Allow overwriting working branches" \
+        "           (WORK_BRANCH_PRE='${WORK_BRANCH_PRE}'," \
+        "           WORK_BRANCH_POST='${WORK_BRANCH_POST}'," \
+        "           PROCESS_BRANCH_PRE='${PROCESS_BRANCH_PRE}') if they exist" \
+        "           already (Current: '${FORCE}')." \
+        "    -R     Try to rebase the branch on top of OPENSSL_BRANCH" \
+        "           after the processing (Current: '${DO_REBASE_AFTER}')." \
+        "    -n     Do not reset PATCH_BRANCH to the result of processing" \
+        "           on success (Current: '${NO_RESET_ON_SUCCESS}')." \
+        "    -h     Show this help message and exit." \
+        "    patch  Path to a patch file(s) to process, required" \
+        "           if no PATCH_BRANCH is specified.  If PATCH_BRANCH" \
+        "           is provided, patches are applied on top of it, otherwise" \
+        "           applied on top of pre-reformat-tagged commit, that" \
+        "           is referenced by tag name constructed from TAG_PRE_FMT" \
+        "           and version derived from the openssl branch provided" \
+        "           in -b option/OPENSSL_BRANCH." \
+        "" \
+        "ENVIRONMENT:" \
+        "    TAG_PRE_FMT" \
+        "        Format of the pre-format tag, it is passed as a format" \
+        "        string to printf with openssl version (either '4.0'" \
+        "        for the master branch or the remainder after removal" \
+        "        of 'openssl-' prefix in the OPENSSL_BRANCH value)" \
+        "        as the only argument to yield the name of the git tag" \
+        "        that is considered the last commit before the reformatting" \
+        "        with clang-format took place (Current: '${TAG_PRE_FMT}')." \
+        "    TAG_POST_FMT" \
+        "        Format of the post-format tag, semantics is similar" \
+        "        to TAG_PRE_FMT, but with respect to the first commit" \
+        "        after the clang-format reformatting" \
+        "        (Current: '${TAG_POST_FMT}')." \
+        "    GIT_CMD" \
+        "        git command (Current: '${GIT_CMD}')." \
+        "    GIT_REMOTE" \
+        "        Remote to track (Current: '${GIT_REMOTE}')." \
+        "    CLANG_FMT_CMD" \
+        "        clang-format command (Current: '${CLANG_FMT_CMD}')." \
+        "    EXCLUDE_FILES" \
+        "        Space-separated list of files to exclude from clang-format" \
+        "        processing, as they are generated with make update" \
+        "        (Current: '${EXCLUDE_FILES}')." \
+        "    FMT_EXTENSIONS" \
+        "        List of extensions of files to process with clang-format" \
+        "        (Current: '${FMT_EXTENSIONS}')." \
+        "    WORK_BRANCH_PRE " \
+        "        Name of a temporary branch for pre-reformatted commits" \
+        "        (Current: '${WORK_BRANCH_PRE}')." \
+        "    WORK_BRANCH_POST " \
+        "        Name of a temporary branch for post-reformatted commits" \
+        "        (Current: '${WORK_BRANCH_POST}')." \
+        "    PROCESS_BRANCH_PRE " \
+        "        Name of a temporary branch for tracking reformatting" \
+        "        progress (it walks from TAG_PRE to WORK_BRANCH_PRE" \
+        "        during the course of processing)" \
+        "        (Current: '${PROCESS_BRANCH_PRE}')." \
+        "    GIT_REPO_URL" \
+        "        URL to openssl git repository, can be overridden" \
+        "        with -u option." \
+        "    GIT_REPO_DIR" \
+        "        openssl git repository dir, can be overridden" \
+        "        with -g option." \
+        "    NO_CLEANUP" \
+        "        If not set to 0, skip removal of work branches, worktree," \
+        "        and a temporarily created git repository after processing," \
+        "        can be overridden with -D option." \
+        "    OUT_DIR" \
+        "        Output directory for patches, can be overridden" \
+        "        with -o option." \
+        "    NO_FORMAT_PATCH" \
+        "        If set to 1, skip calling git format-patch on the resulting" \
+        "        branch in order to store the results on the OUT_DIR," \
+        "        can be overridden with -O option." \
+        "    OPENSSL_BRANCH" \
+        "        openssl branch to work on, can be overridden with -b option." \
+        "    PATCH_BRANCH" \
+        "        If non-empty, uses the branch as the base commit" \
+        "        for processing, can be overridden with -B option." \
+        "    FORCE" \
+        "        If not set to 1, script aborts if any of WORK_BRANCH_PRE," \
+        "        WORK_BRANCH_POST, or PROCESS_BRANCH_PRE branches exists" \
+        "        before the start of processing." \
+        "    DO_REBASE_AFTER" \
+        "        If set to 1, try to perform rebase on top of OPENSSL_BRANCH" \
+        "        after processing, can be overridden with -R option." \
+        "    NO_RESET_ON_SUCCESS" \
+        "        If not set to 0, do not reset PATH_BRANCH after a successful" \
+        "        processing, can be overridden with -n option." \
+        "" \
+        "EXAMPLES:" \
+        "    Updating a patch set against a stable branch that can be applied" \
+        "    on top of pre-reformat-tagged commit:" \
+        "" \
+        "        $0 -b openssl-3.5 -o out_dir my_patches/*.patch" \
+        "" \
+        "    It will create a temporary repository, perform the processing" \
+        "    there, and output the patches into the specified directory." \
+        "" \
+        "" \
+        "    Updating a branch in an existing repository and rebase" \
+        "    it on top of the current master:" \
+        "" \
+        "        $0 -g openssl_repo -B my_branch -O -R" \
+        "" \
+        "    It will process the patches, rebase them on top of the default" \
+        "    branch (master), and then reset the provided branch name" \
+        "    upon success."
+}
+
+while getopts ":g:Du:o:Ob:B:fRnh" opt; do
+    case "${opt}" in
+    g) GIT_REPO_DIR="${OPTARG}"   ;;
+    D) NO_CLEANUP=1               ;;
+    u) GIT_REPO_URL="${OPTARG}"   ;;
+    o) OUT_DIR="${OPTARG}"        ;;
+    O) NO_FORMAT_PATCH=1          ;;
+    b) OPENSSL_BRANCH="${OPTARG}" ;;
+    B) PATCH_BRANCH="${OPTARG}"   ;;
+    f) FORCE=1                    ;;
+    R) DO_REBASE_AFTER=1          ;;
+    n) NO_RESET_ON_SUCCESS=1      ;;
+    h)
+        usage
+        help
+        exit 0
+        ;;
+    ?)
+        msg "Unknown option '-${OPTARG}', see $0 -h for more information."
+        usage
+        exit 1
+        ;;
+    esac
+done
+
+shift "$((OPTIND - 1))"
+
+[ 0 -eq "$#" -o "x--" != "x${1-}" ] || shift
+
+# Check that we have work to do
+if [ -z "${PATCH_BRANCH}" -a 1 -gt "$#" ]; then
+    usage
+    die "PATCH_BRANCH is empty and no patches supplied on the command line, exiting"
+fi
+
+if [ 1 != "${FORCE}" -a -n "${GIT_REPO_DIR}" ]; then
+    check_branch 'WORK_BRANCH_PRE'
+    check_branch 'WORK_BRANCH_POST'
+    check_branch 'PROCESS_BRANCH_PRE'
+fi
+
+# Command-line checks are done
+cleanup_done=0
+
+# Getting the repo
+PERMANENT_GIT_DIR=1
+if [ -z "${GIT_REPO_DIR}" ]; then
+    PERMANENT_GIT_DIR=0
+    GIT_REPO_DIR=$(mktemp -d "$(pwd)/reformat-openssl-XXXXXX")
+    "$GIT_CMD" clone "${GIT_REPO_URL}" "${GIT_REPO_DIR}"
+fi
+if [ 0 != "${NO_CLEANUP}" ]; then
+    msg "Created a temporary directory for the repo: ${GIT_REPO_DIR}"
+fi
+
+# Determine the tag name
+if [ "master" = "${OPENSSL_BRANCH}" ]; then
+    TAG_PREFIX=4.0
+else
+    # Check that we can extract the tag prefix first
+    [ "x${OPENSSL_BRANCH#openssl-}" != "x${OPENSSL_BRANCH}" ] ||
+        die "Can't parse branch name: '${OPENSSL_BRANCH}'," \
+            "only 'master' and 'openssl-X.Y' are supported."
+    TAG_PREFIX="${OPENSSL_BRANCH#openssl-}"
+fi
+TAG_PRE=$(printf "${TAG_PRE_FMT}" "${TAG_PREFIX}")
+TAG_POST=$(printf "${TAG_POST_FMT}" "${TAG_PREFIX}")
+
+# Checking that PATCH_BRANCH doesn't include TAG_POST already
+if [ -n "${PATCH_BRANCH}" ]; then
+    if "$GIT_CMD" -C "${GIT_REPO_DIR}" merge-base --is-ancestor "${TAG_POST}" "$PATCH_BRANCH"; then
+        die "PATCH_BRANCH ('${PATCH_BRANCH}') already includes" \
+            "post-reformat-tagged ('${TAG_POST}') commit, exiting."
+    fi
+fi
+
+
+# Create the worktree
+WORKTREE_DIR=$(mktemp -d "$(pwd)/reformat-openssl-worktree-XXXXXX")
+"$GIT_CMD" -C "$GIT_REPO_DIR" worktree add "${WORKTREE_DIR}" "${TAG_PRE}"
+
+# Get the branches set up
+BASE_COMMIT="${PATCH_BRANCH}"
+[ -n "$BASE_COMMIT" ] || BASE_COMMIT="${TAG_PRE}"
+"$GIT_CMD" -C "$WORKTREE_DIR" branch -f "${WORK_BRANCH_POST}" "${TAG_POST}"
+"$GIT_CMD" -C "$WORKTREE_DIR" branch -f "${WORK_BRANCH_PRE}" "${BASE_COMMIT}"
+"$GIT_CMD" -C "$WORKTREE_DIR" branch -u "${GIT_REMOTE}/${OPENSSL_BRANCH}" "${WORK_BRANCH_PRE}"
+branches_created=1
+
+# Apply the patches
+while [ 0 -lt "$#" ]; do
+    patch_path=$(realpath "$1")
+    "$GIT_CMD" -C "${WORKTREE_DIR}" am "${patch_path}"
+    shift
+done
+
+# Working inside the worktree from now on
+(
+cd "${WORKTREE_DIR}"
+
+# Rebase the branch
+"$GIT_CMD" checkout "${WORK_BRANCH_PRE}"
+"$GIT_CMD" rebase "${TAG_PRE}"
+
+# Iterate over the commits and process each with clang-format
+"$GIT_CMD" log --reverse --pretty="%H" "${TAG_PRE}..${WORK_BRANCH_PRE}" \
+    | while read -r commit; do
+        "$GIT_CMD" branch -f "${PROCESS_BRANCH_PRE}" "$commit"
+        "$GIT_CMD" checkout "${PROCESS_BRANCH_PRE}"
+        msg "Processing $("$GIT_CMD" log --pretty=oneline HEAD^..HEAD)"
+        # Process only the touched files
+        "$GIT_CMD" show --pretty="" --name-status --no-renames "$commit" \
+            | while read -r line; do
+                # Skip deletions
+                [ "x${line}" = "x${line#D}" ] || continue
+
+                fname="${line#*	}"
+
+                do_process=0
+                # Process only *.c *.h *.c.in *.h.in
+                for i in ${FMT_EXTENSIONS}; do
+                    if [ "x${fname}" != "x${fname%${i}}" ]; then
+                        do_process=1
+                        break
+                    fi
+                done
+
+                # Process the exclusion list
+                for i in ${EXCLUDE_FILES}; do
+                    if [ "x${fname}" = "x${i}" ]; then
+                        do_process=0
+                        break;
+                    fi
+                done
+
+                if [ 1 = "${do_process}" ]; then
+                    msg "  Formatting ${fname}"
+                    "$CLANG_FMT_CMD" -i --style=file:.clang-format "$fname"
+                else
+                    msg "  Including ${fname} without processing"
+                fi
+                "$GIT_CMD" add "$fname"
+            done
+
+        "$GIT_CMD" commit --amend --no-edit
+        "$GIT_CMD" checkout "${WORK_BRANCH_POST}"
+
+        "$GIT_CMD" show --pretty="" --name-status --no-renames "${PROCESS_BRANCH_PRE}" \
+            | while read -r line; do
+                fname="${line#*	}"
+
+                # Process deletions
+                if [ "x${line}" != "x${line#D}" ]; then
+                    "$GIT_CMD" rm "$fname"
+                    continue
+                fi
+
+                "$GIT_CMD" reset "${PROCESS_BRANCH_PRE}" -- "$fname"
+            done
+
+        "$GIT_CMD" commit -C "${commit}"
+        "$GIT_CMD" reset --hard
+    done
+
+# Rebase WORK_BRANCH_POST on top of OPENSSL_BRANCH
+if [ 1 = "${DO_REBASE_AFTER}" ]; then
+    "$GIT_CMD" checkout "${WORK_BRANCH_POST}"
+    "$GIT_CMD" rebase "${OPENSSL_BRANCH}"
+fi
+
+# Reset PATCH_BRANCH to WORK_BRANCH_POST if the former is a ref
+if [ 0 = "${NO_RESET_ON_SUCCESS}" ]; then
+    if "$GIT_CMD" show-ref --verify --quiet "refs/heads/${PATCH_BRANCH}"; then
+        msg "Resetting branch '${PATCH_BRANCH}'" \
+            "from $("$GIT_CMD" show-ref "refs/heads/${PATCH_BRANCH}")" \
+            "to $("$GIT_CMD" show-ref refs/heads/"${WORK_BRANCH_POST}")"
+        "$GIT_CMD" branch -f "${PATCH_BRANCH}" "${WORK_BRANCH_POST}"
+    fi
+fi
+) # End of the subshell with pwd in the worktree
+
+# Output the patches
+if [ 1 != "${NO_FORMAT_PATCH}" ]; then
+    mkdir -p "${OUT_DIR}"
+    OUT_DIR=$(realpath "${OUT_DIR}")
+    "$GIT_CMD" -C "${WORKTREE_DIR}" format-patch -o "${OUT_DIR}" \
+        "${TAG_POST}..${WORK_BRANCH_POST}"
+    msg "The resulting patches are saved at '${OUT_DIR}'"
+else
+    if [ 1 = "${PERMANENT_GIT_DIR}" -a 0 != "${NO_RESET_ON_SUCCESS}" ]; then
+        msg "The resulting patches are in the '${WORK_BRANCH_POST}' branch"
+    fi
+fi
+
+# Cleanup
+if [ 0 = "${NO_CLEANUP}" ]; then
+    if [ -n "${WORKTREE_DIR-}" ]; then
+        "$GIT_CMD" -C "${WORKTREE_DIR}" worktree remove -f "${WORKTREE_DIR}"
+        rm -rf "${WORKTREE_DIR}" || :
+    fi
+
+    if [ 1 = "${PERMANENT_GIT_DIR}" ]; then
+        # Removing the working branches
+        "$GIT_CMD" -C "${GIT_REPO_DIR}" branch -D "${WORK_BRANCH_PRE}" || :
+        "$GIT_CMD" -C "${GIT_REPO_DIR}" branch -D "${PROCESS_BRANCH_PRE}" || :
+
+        # Leaving WORK_BRANCH_POST if the branch has not been reset
+        # and the patches haven't been output
+        if [ 1 != "${NO_FORMAT_PATCH}" -o 0 = "${NO_RESET_ON_SUCCESS}" ]; then
+            "$GIT_CMD" -C "${GIT_REPO_DIR}" branch -D "${WORK_BRANCH_POST}" || :
+        fi
+    else
+        # Removing the temporarily created git repo
+        rm -rf "${GIT_REPO_DIR}" || :
+    fi
+fi
+
+cleanup_done=1
+
+exit 0
diff --git a/deps/openssl/openssl/util/valgrind.suppression b/deps/openssl/openssl/util/valgrind.suppression
new file mode 100644
index 00000000000..cb38471a3ff
--- /dev/null
+++ b/deps/openssl/openssl/util/valgrind.suppression
@@ -0,0 +1,162 @@
+{
+   reachable_globals_in_libcrypto
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   ...
+   obj:*/libcrypto.so.*
+}
+{
+   reachable_globals_in_libssl
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   ...
+   obj:*/libssl.so.*
+}
+{
+   openssl_test_title_reachable
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   ...
+   fun:set_test_title
+   ...
+}
+
+{
+   reachable_globals_in_openssl_static
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   ...
+   fun:CRYPTO_*alloc
+   ...
+}
+{
+   reachable_crypto_aligned_alloc
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   ...
+   fun:CRYPTO_aligned_alloc
+   ...
+}
+{
+   glibc_dl_open_reachable_issue
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   ...
+   fun:_dl_map_new_object
+   ...
+}
+{
+   glibc_dlopen_reachable_issue
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   ...
+   fun:_dl_check_map_versions
+   ...
+}
+{
+   glibc_dlopen_reachable_issue
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   ...
+   fun:_dl_new_object
+   ...
+}
+{
+   glibc_dlopen_reachable_issue
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   ...
+   fun:dl_open_worker
+   ...
+}
+{
+   valgrind_confusion_in_asm_code
+   Memcheck:Value8
+   ...
+   fun:ossl_cipher_generic_stream_update
+   ...
+}
+{
+   valgrind_confusion_in_asm_code
+   Memcheck:Cond
+   ...
+   fun:ossl_cipher_generic_stream_update
+   ...
+}
+{
+   valgrind_confusion_in_asm_code
+   Memcheck:Cond
+   fun:EVP_DecryptUpdate
+   ...
+}
+{
+   valgrind_confusion_in_asm_code
+   Memcheck:Cond
+   ...
+   fun:tls_get_more_records
+   ...
+}
+{
+   valgrind_confusion_in_asm_code
+   Memcheck:Cond
+   fun:ssl3_read_bytes
+   ...
+}
+{
+   valgrind_confusion_in_asm_code
+   Memcheck:Cond
+   fun:tls_release_record
+   ...
+}
+{
+   valgrind_confusion_in_asm_code
+   Memcheck:Cond
+   fun:ssl_release_record
+   ...
+}
+{
+   provider_activate_strdup
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:malloc
+   ...
+   fun:OSSL_provider_init
+   fun:provider_init
+   fun:provider_activate
+   ...
+}
+{
+   provider_activate_strdup_without_provider_init
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:malloc
+   ...
+   fun:OSSL_provider_init
+   fun:provider_activate
+   ...
+}
+{
+   false_positive_conditional_check
+   Memcheck:Cond
+   fun:bcmp
+   fun:test_mem_eq
+   ...
+}
+{
+   false_positive_conditional_check
+   Memcheck:Cond
+   fun:ossl_gcm_stream_final
+   ...
+}
+{
+   false_positive_conditional_check
+   Memcheck:Cond
+   fun:gcm_cipher_internal
+   ...
+}
+{
+   asn1_string_poison_test_intentional_terminator_read
+   Memcheck:Addr1
+   fun:strlen
+   obj:*/asn1_string_poison_test
+}
diff --git a/deps/openssl/openssl/util/wrap.pl.in b/deps/openssl/openssl/util/wrap.pl.in
index 5b6b2a51428..c26500ee8bb 100644
--- a/deps/openssl/openssl/util/wrap.pl.in
+++ b/deps/openssl/openssl/util/wrap.pl.in
@@ -51,7 +51,6 @@ sub quote_arg_win32 {
 }

 my $there = canonpath(catdir(dirname($0), updir()));
-my $std_engines = catdir($there, 'engines');
 my $std_providers = catdir($there, 'providers');
 my $std_openssl_conf = catdir($there, 'apps/openssl.cnf');
 my $unix_shlib_wrap = catfile($there, 'util/shlib_wrap.sh');
@@ -85,8 +84,6 @@ local $ENV{OPENSSL_CONF_INCLUDE} = $std_openssl_conf_include
     if defined $std_openssl_conf_include
        &&($ENV{OPENSSL_CONF_INCLUDE} // '') eq ''
        && -d $std_openssl_conf_include;
-local $ENV{OPENSSL_ENGINES} = $std_engines
-    if ($ENV{OPENSSL_ENGINES} // '') eq '' && -d $std_engines;
 local $ENV{OPENSSL_MODULES} = $std_providers
     if ($ENV{OPENSSL_MODULES} // '') eq '' && -d $std_providers;
 local $ENV{OPENSSL_CONF} = $std_openssl_conf
@@ -121,8 +118,16 @@ if ($^O eq 'VMS') {
     @cmd = ( @ARGV );
 }

-# The exec() statement on MSWin32 doesn't seem to give back the exit code
-# from the call, so we resort to using system() instead.
+# exec() keeps this script's pid, which matters to callers that signal the
+# command they started: a test recipe using open3() is handed this pid, not
+# the command's, so with a subprocess the signal never reaches the command.
+# MSWin32 can't use exec() because it doesn't give back the exit code, and
+# VMS needs the exit code translated below, so both keep the subprocess.
+if ($^O ne 'MSWin32' && $^O ne 'VMS') {
+    exec @cmd
+        or die "wrap.pl: Failed to execute '", join(' ', @cmd), "': $!\n";
+}
+
 my $waitcode;
 if ($^O eq 'MSWin32') {
     $waitcode = system(quote_cmd_win32(@cmd));
diff --git a/deps/openssl/openssl/util/write-man-symlinks b/deps/openssl/openssl/util/write-man-symlinks
deleted file mode 100755
index 7db7d2cbe2c..00000000000
--- a/deps/openssl/openssl/util/write-man-symlinks
+++ /dev/null
@@ -1,48 +0,0 @@
-#! /usr/bin/env perl
-# Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
-#
-# Licensed under the Apache License 2.0 (the "License").  You may not use
-# this file except in compliance with the License.  You can obtain a copy
-# in the file LICENSE in the source distribution or at
-# https://www.openssl.org/source/license.html
-
-
-require 5.10.0;
-use warnings;
-use strict;
-
-use FindBin;
-use lib "$FindBin::Bin/perl";
-
-use OpenSSL::Util::Pod;
-
-if ($#ARGV + 1 != 5 || $ARGV[0] !~ /^(un)?install$/) {
-    print "Usage: write-man-symlinks [install|uninstall] src-dir build-dir man-page-name target-dir\n";
-    exit;
-}
-
-my $action = $ARGV[0];
-my $srcdir = $ARGV[1];
-my $builddir = $ARGV[2];
-my $manname = $ARGV[3];
-my $targetdir = $ARGV[4];
-
-$manname =~ m|(.+)\.(.+)|;
-my $mainf = $1;
-my $section = $2;
-die "Bad src file" if !defined $mainf;
-my $podfile = "$srcdir/$mainf.pod";
-#Some pod files are generated and are in the build dir
-unless (-e $podfile) {
-    $podfile = "$builddir/$mainf.pod";
-}
-my %podinfo = extract_pod_info($podfile);
-
-for my $name (@{$podinfo{names}}) {
-    next if $name eq $mainf;
-    if ($action eq "install") {
-        symlink "$manname", "$targetdir/$name.$section";
-    } else {
-        unlink "$targetdir/$name.$section";
-    }
-}